@treasuredata/tdx 0.14.6 → 0.14.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) 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/api-command.js +1 -1
  8. package/dist/commands/auth-command.js +1 -1
  9. package/dist/commands/chat-command.js +1 -1
  10. package/dist/commands/claude-command.d.ts.map +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-command.js.map +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-command.js +1 -1
  20. package/dist/commands/job-command.js +1 -1
  21. package/dist/commands/journey-command.js +1 -1
  22. package/dist/commands/journey-validate-command.js +1 -1
  23. package/dist/commands/llm-command.js +1 -1
  24. package/dist/commands/llm-proxy.js +1 -1
  25. package/dist/commands/parent-segment-command.js +1 -1
  26. package/dist/commands/profile-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-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/tables.js +1 -1
  40. package/dist/commands/unset-command.js +1 -1
  41. package/dist/commands/use-command.js +1 -1
  42. package/dist/commands/user-command.js +1 -1
  43. package/dist/commands/workflow-command.js +1 -1
  44. package/dist/core/auth.js +1 -1
  45. package/dist/core/command-output.js +1 -1
  46. package/dist/core/config.js +1 -1
  47. package/dist/core/connection-cache.js +1 -1
  48. package/dist/core/constants.js +1 -1
  49. package/dist/core/credential-cache.js +1 -1
  50. package/dist/core/global-context.js +1 -1
  51. package/dist/core/keychain.js +1 -1
  52. package/dist/core/profile.js +1 -1
  53. package/dist/core/project-config.js +1 -1
  54. package/dist/core/session.js +1 -1
  55. package/dist/core/user-cache.js +1 -1
  56. package/dist/core/version.js +1 -1
  57. package/dist/index.js +1 -1
  58. package/dist/proxy/anthropic-adapter.js +1 -1
  59. package/dist/proxy/claude-usage-tracker.js +1 -1
  60. package/dist/proxy/context-signature.js +1 -1
  61. package/dist/proxy/conversation-utils.js +1 -1
  62. package/dist/proxy/passthrough-server.js +1 -1
  63. package/dist/proxy/server.js +1 -1
  64. package/dist/proxy/session-cache.js +1 -1
  65. package/dist/proxy/sse-usage-parser.js +1 -1
  66. package/dist/sdk/agent/agent-config.js +1 -1
  67. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  68. package/dist/sdk/agent/agent-yaml.js +1 -1
  69. package/dist/sdk/api.js +1 -1
  70. package/dist/sdk/client/cdp-api-client.js +1 -1
  71. package/dist/sdk/client/endpoints.js +1 -1
  72. package/dist/sdk/client/engage-api-client.js +1 -1
  73. package/dist/sdk/client/http-client.d.ts.map +1 -1
  74. package/dist/sdk/client/http-client.js +1 -1
  75. package/dist/sdk/client/http-client.js.map +1 -1
  76. package/dist/sdk/client/llm-api-client.js +1 -1
  77. package/dist/sdk/client/rate-limiter.js +1 -1
  78. package/dist/sdk/client/td-api-client.js +1 -1
  79. package/dist/sdk/client/trino-api-client.js +1 -1
  80. package/dist/sdk/client/workflow-client.js +1 -1
  81. package/dist/sdk/connection-validator.js +1 -1
  82. package/dist/sdk/connection.js +1 -1
  83. package/dist/sdk/engage.js +1 -1
  84. package/dist/sdk/errors.js +1 -1
  85. package/dist/sdk/index.js +1 -1
  86. package/dist/sdk/io/index.js +1 -1
  87. package/dist/sdk/io/node-filesystem.js +1 -1
  88. package/dist/sdk/job.js +1 -1
  89. package/dist/sdk/journey.js +1 -1
  90. package/dist/sdk/llm/chat-cache.js +1 -1
  91. package/dist/sdk/llm/index.js +1 -1
  92. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  93. package/dist/sdk/llm/model-aliases.js +1 -1
  94. package/dist/sdk/llm/model-factors.js +1 -1
  95. package/dist/sdk/query/index.js +1 -1
  96. package/dist/sdk/query/sql-parser.js +1 -1
  97. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  98. package/dist/sdk/segment/fields-display.js +1 -1
  99. package/dist/sdk/segment/file-discovery.js +1 -1
  100. package/dist/sdk/segment/journey-utils.js +1 -1
  101. package/dist/sdk/segment/journey-yaml.js +1 -1
  102. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  103. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  104. package/dist/sdk/segment/pull-workflow.js +1 -1
  105. package/dist/sdk/segment/push-workflow.js +1 -1
  106. package/dist/sdk/segment/resolution-context.js +1 -1
  107. package/dist/sdk/segment/segment-path-parser.js +1 -1
  108. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  109. package/dist/sdk/segment/target-resolution.js +1 -1
  110. package/dist/sdk/segment/tdx-config.js +1 -1
  111. package/dist/sdk/segment/validate-files.js +1 -1
  112. package/dist/sdk/segment/yaml-validator.js +1 -1
  113. package/dist/sdk/segment.js +1 -1
  114. package/dist/sdk/types/index.js +1 -1
  115. package/dist/sdk/types/progress.js +1 -1
  116. package/dist/sdk/user.js +1 -1
  117. package/dist/sdk/util/format-detector.js +1 -1
  118. package/dist/sdk/util/formatters.js +1 -1
  119. package/dist/sdk/util/index.js +1 -1
  120. package/dist/sdk/util/tree-formatter.js +1 -1
  121. package/dist/sdk/workflow/clone-workflow.js +1 -1
  122. package/dist/sdk/workflow/index.js +1 -1
  123. package/dist/sdk/workflow/pull-workflow.js +1 -1
  124. package/dist/sdk/workflow/push-workflow.js +1 -1
  125. package/dist/sdk/workflow/tdx-config.js +1 -1
  126. package/dist/sdk/workflow/workflow-utils.js +1 -1
  127. package/dist/tdx +10 -0
  128. package/dist/utils/async.js +1 -1
  129. package/dist/utils/colors.js +1 -1
  130. package/dist/utils/diff.js +1 -1
  131. package/dist/utils/file-permissions.js +1 -1
  132. package/dist/utils/json-loader.js +1 -1
  133. package/dist/utils/option-validation.js +1 -1
  134. package/dist/utils/port.js +1 -1
  135. package/dist/utils/process.js +1 -1
  136. package/dist/utils/prompt.js +1 -1
  137. package/dist/utils/spinner.js +1 -1
  138. package/dist/utils/sse-parser.js +1 -1
  139. package/dist/utils/string-utils.js +1 -1
  140. package/dist/utils/table-ref-parser.js +1 -1
  141. package/dist/utils/tdx-logger.js +1 -1
  142. package/dist/utils/version-check.js +1 -1
  143. package/package.json +2 -2
@@ -1 +1 @@
1
- const a39_0x4e0a56=a39_0x5920;(function(_0x9a52ff,_0x8cb359){const _0x102f0b=a39_0x5920,_0xfcd31b=_0x9a52ff();while(!![]){try{const _0x305846=parseInt(_0x102f0b(0x10f))/0x1*(parseInt(_0x102f0b(0x1d4))/0x2)+parseInt(_0x102f0b(0x1bf))/0x3*(-parseInt(_0x102f0b(0x1ea))/0x4)+parseInt(_0x102f0b(0x19b))/0x5*(-parseInt(_0x102f0b(0x1b9))/0x6)+-parseInt(_0x102f0b(0x272))/0x7+parseInt(_0x102f0b(0x129))/0x8*(-parseInt(_0x102f0b(0x1f3))/0x9)+-parseInt(_0x102f0b(0x15e))/0xa+parseInt(_0x102f0b(0x194))/0xb;if(_0x305846===_0x8cb359)break;else _0xfcd31b['push'](_0xfcd31b['shift']());}catch(_0xbdcd12){_0xfcd31b['push'](_0xfcd31b['shift']());}}}(a39_0x3453,0x9d3d0));import a39_0x22f752 from'chalk';import{existsSync}from'fs';import a39_0x1e5ada from'path';import{BaseCommand}from'./command.js';function a39_0x3453(){const _0x235a3d=['yes','Attempt:\x20','success','splice','Cancelled','\x1b[1A\x1b[2K','taskName','workflow:delete','retrySession','No\x20workflow\x20projects\x20found','\x20\x20Location:\x20','total','finishedAt','Usage:\x20tdx\x20wf\x20use\x20<project>','title','✔\x20Secret\x20\x27','session','5774874EkAjdv','/app/workflows/','task','replace','Cloning\x20to\x20','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','some','projectName','startedAt','Project:\x20','Including\x20subtasks:\x20yes','\x22\x20to\x20new\x20project\x20\x22','deleteSecret','Invalid\x20format:\x20','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','workflow:upload','Killing\x20attempt...','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','verbose','resolve','type','Kill\x20a\x20running\x20attempt','Source\x20directory:\x20','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','isNewProject','\x0aDry\x20run\x20-\x20no\x20files\x20written','list','data','pending','value','revision:\x20','planned','startTime','Parameters:\x20','\x20of\x20','new','✔\x20Workflow\x20project\x20context\x20cleared.','utf-8','logFiles','Attempt\x20ID:\x20','json','lastAttempt','fill','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Failed\x20to\x20fetch\x20attempt\x20data','key','Target:\x20','workflows','map','\x20\x20Files\x20extracted:\x20','buildTimelineData','---\x20','newProjectName','List\x20workflows','\x20new','attempt:','No\x20attempts\x20found\x20in\x20project:\x20','keys','📋\x20','Setting\x20secret...','\x20from\x20session\x20','updatedAt','Select\x20a\x20workflow\x20to\x20run','Force:\x20yes','352766TzmUtN','\x20\x20Project\x20ID:\x20','\x20modified','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','autocomplete','index','\x20\x20Revision:\x20','Status:\x20','write','\x20(use\x20--limit\x20to\x20show\x20more)','Source\x20project:\x20','status','✔\x20Pull\x20complete','renderTimeline','showWorkflowConsoleUrl','\x20tasks','get','No\x20workflow\x20sessions\x20found','No\x20sessions\x20found','\x22\x20with\x20new\x20revision?','indexOf','parseProjectWorkflowPattern','readFile','\x20-\x20','split','Getting\x20attempt\x20details...','40lYAnkL','includeRetried','sort','✔\x20Found\x20','Show\x20tasks\x20for\x20an\x20attempt','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','follow','path','slice','Project\x20name\x20is\x20required','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','state','match','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Downloading\x20logs...','✔\x20Retry\x20started','Session\x20time:\x20','\x27...','sourceDir','\x20deleted','MAX_POLL_ITERATIONS','size','startsWith','workflow:projects','filter','sessionTime','Error:\x20','Start\x20a\x20workflow\x20run','min','navigateSessionsInteractive','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','skipValidation','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','trim','dim','deleted','\x0a✔\x20No\x20changes\x20to\x20push','revision','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','sessions','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Reason:\x20','Project\x20filter:\x20','\x20\x20tdx\x20wf\x20use\x20<project>','attempts','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','✔\x20New\x20project:\x20','Source:\x20','Loading\x20session...','No\x20sessions\x20found\x20in\x20project:\x20','targetExists','dryRun','891340gkrteE','metadata','tasks','Analyzing\x20project...','white','/sessions/','Dry\x20run:\x20yes','Usage:\x20workflow:delete\x20<project-name-or-id>','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','includes','✔\x20Downloaded\x20','kill','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','workflow:attempt','renderSessionsTimeline','\x20project','workflow:pull','includeSubtasks','yellow','\x0aUpdate\x20existing\x20project\x20\x22','floor','No\x20sessions\x20found\x20for:\x20','Retry\x20a\x20session\x20or\x20attempt','\x20(system)','localeCompare','TASK_NAME_WIDTH','hasChanges','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','Resume\x20from:\x20','push','workflowName','\x20logs','getMonth','unchanged','blue','\x0aPush\x20these\x20changes?','\x20\x20Session\x20context\x20set\x20to:\x20','Auto-selected\x20latest\x20session:\x20','MIN_TIMELINE_WIDTH','workflow:timeline','Include\x20retried:\x20yes','Expected\x20format:\x20--param\x20key=value','\x20to\x20see\x20detailed\x20logs','session:','MAX_TIMELINE_WIDTH','pollTimeline','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','cancelRequested','isTTY','diff','table','displayLine','Analyzing\x20changes...','Pulling\x20project\x20','22114400kfsGww','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','...','No\x20projects\x20match\x20pattern:\x20','set','Show\x20specific\x20attempt\x20details','\x0aDry\x20run\x20-\x20no\x20project\x20created','25ymkENh','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','error','group_error','output','logs','parse','✔\x20Workflow\x20project\x20set\x20to:\x20','/attempt/','sys','\x20secret','Key\x20cannot\x20be\x20empty','MIN_LABEL_COUNT','modified','✔\x20Project:\x20','msPerChar','toLowerCase','site','join','Project\x20directory:\x20','all','workflow:use','✔\x20Project\x20updated','filesExtracted','workflow:download','fs/promises','Revision:\x20','log','Deleting\x20secret...','stringify','878778UEkWLX','workflow:logs','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','ICON_WIDTH','398586SjwdSH','stat','workflow:kill','relative','now','Getting\x20attempt\x20tasks...','workflow','Error:\x20Invalid\x20parameter\x20format:\x20','substring','\x0a✔\x20Attempt\x20complete','\x20\x20Target:\x20','Error:\x20Attempt\x20ID\x20is\x20required','retryAttempt','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','📁\x20','Listing\x20workflow\x20projects...','Error:','Key:\x20','✔\x20Workflow\x20run\x20started','Using\x20attempt\x20','workflow:retry','6wkZVxx','ICON_SPACING','jsonl','Source\x20directory\x20is\x20required','Resolving\x20project\x20\x27','cyan','Validation:\x20skipped','workflow:clone','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','fullName','running','basename','targetDir','description','delete','canceling','duration','projectId','force',',\x20Workflow:\x20','from','getFullYear','8bCLgOA','\x20unchanged','changes','repeat','workflowProject','No\x20workflow\x20tdx.json\x20found','renderSingleTimeline','✔\x20Showing\x20','No\x20attempts\x20found\x20for:\x20','922491sIRLjQ','Pushing\x20workflow\x20project...','sourceProjectName','Pattern:\x20','Pushing\x20project...','getDate','Total:\x20','rows','workflow:secrets:delete','Updating\x20','\x20\x20Project:\x20','List\x20workflow\x20execution\x20sessions','No\x20attempts\x20found','green','executeCloneProject','end','workflow:push','No\x20log\x20files\x20found\x20for\x20this\x20attempt','requireProject','tdx\x20wf\x20attempt\x20','resolveProjectDir','\x20sessions\x20','project','workflow:attempts','getTime','Error:\x20Project\x20name\x20is\x20required','Filter:\x20','stdout','select','Show\x20logs\x20for\x20a\x20workflow\x20attempt','workflow:workflows','Project\x20name:\x20','sessionId','execute','columns','find','done','params','Listing\x20workflow\x20sessions...','Listing\x20secrets...','Starting\x20workflow\x20run...','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','(unknown)','unknown','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','workflow:secrets:set','start','Writing\x20files...','param','Latest\x20session\x20has\x20no\x20attempt','applyPullProject','summary','✔\x20Deleted\x20project\x20','\x22?\x20This\x20cannot\x20be\x20undone.','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','has','Error:\x20KEY=VALUE\x20is\x20required','\x0aPolling...\x20(','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','pullProject','workflow:secrets:list','Error:\x20Invalid\x20JSON\x20in\x20--params','Params:\x20','Filter:\x20project=','resolveProject','\x27\x20from\x20project\x20\x27','cwd','download','Target\x20directory:\x20','workflow:sessions','attemptId','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','No\x20workflows\x20found\x20in\x20project:\x20','fileSize','attempt','createdAt','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','format','\x20workflow','Select\x20a\x20session\x20to\x20view\x20timeline:','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','length','setSecret','Loading\x20workflows...','clear','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','Warning:','\x20\x20Changes:\x20','New\x20project\x20name:\x20','context','LABEL_MIN_SPACING','red','Task\x20name:\x20','⚠\x20Showing\x20first\x20','max','window','\x20\x20Session\x20ID:\x20','Listing\x20workflows...','\x20\x20Console:\x20','padStart','name','Output\x20directory:\x20','message','toISOString','MAX_TASKS_DISPLAY','limit','No\x20workflows\x20found','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'];a39_0x3453=function(){return _0x235a3d;};return a39_0x3453();}import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a39_0x2c235c from'prompts';function getAttemptStatusDisplay(_0x5c4252){const _0x5041df=a39_0x5920;if(!_0x5c4252)return{'icon':'⏳','text':''};const {done:_0xe4a975,success:_0x5cff3f,cancelRequested:_0x19eac8}=_0x5c4252;if(!_0xe4a975)return _0x19eac8?{'icon':'🛑','text':a39_0x22f752[_0x5041df(0x170)](_0x5041df(0x1e3))}:{'icon':'🔄','text':a39_0x22f752[_0x5041df(0x180)](_0x5041df(0x1de))};if(_0x5cff3f)return{'icon':'✅','text':a39_0x22f752['green'](_0x5041df(0x263))};return{'icon':'❌','text':a39_0x22f752['red']('error')};}export class WorkflowBaseCommand extends BaseCommand{[a39_0x4e0a56(0x234)](_0x2253d5,_0x5858bd,_0x225ca1=0x0){return _0x2253d5[_0x225ca1]||_0x5858bd['workflowProject'];}[a39_0x4e0a56(0x205)](_0x19d6ac,_0x51838b,_0x192ffe=0x0){const _0x589a9b=a39_0x4e0a56,_0x1351e1=this[_0x589a9b(0x234)](_0x19d6ac,_0x51838b,_0x192ffe);if(!_0x1351e1)return console[_0x589a9b(0x19d)](a39_0x22f752[_0x589a9b(0x250)]('Error:'),_0x589a9b(0x132)),console[_0x589a9b(0x19d)](a39_0x22f752[_0x589a9b(0x14c)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x1351e1;}[a39_0x4e0a56(0x124)](_0x3d33c0,_0x50c20a){const _0x14265e=a39_0x4e0a56;if(_0x3d33c0[0x0]){const _0x2e3ce5=_0x3d33c0[0x0][_0x14265e(0x127)]('.');if(_0x2e3ce5[_0x14265e(0x246)]===0x1)return{'projectName':_0x2e3ce5[0x0],'workflowName':undefined};else return _0x2e3ce5[_0x14265e(0x246)]===0x2?{'projectName':_0x2e3ce5[0x0],'workflowName':_0x2e3ce5[0x1]}:(console[_0x14265e(0x19d)](a39_0x22f752['red'](_0x14265e(0x1cf)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x50c20a[_0x14265e(0x1ee)],'workflowName':undefined};}['resolveProjectDir'](_0x5d9766,_0x2917c5,_0x3bb2d7=0x0){const _0x458e1d=a39_0x4e0a56;if(_0x5d9766[_0x3bb2d7])return _0x5d9766[_0x3bb2d7];if(_0x2917c5[_0x458e1d(0x1ee)]){const _0x2e6e3c=a39_0x1e5ada['join'](process['cwd'](),_0x458e1d(0xfe),_0x2917c5[_0x458e1d(0x1ee)]);if(existsSync(a39_0x1e5ada[_0x458e1d(0x1ad)](_0x2e6e3c,'tdx.json')))return _0x2e6e3c;}return undefined;}async['showWorkflowConsoleUrl'](_0x2b2a48,_0x2894c7,_0x2959ed){const _0x392a5e=a39_0x4e0a56;try{const _0x325c9c=await _0x2b2a48['workflow'][_0x392a5e(0xfe)](_0x2894c7,{'limit':0x1});if(_0x325c9c[_0x392a5e(0x246)]>0x0){const _0xc70d5=_0x325c9c[0x0]['id'],_0x30bb0b=getWorkflowUrl(_0x2959ed,_0xc70d5);console[_0x392a5e(0x19d)]('\x20\x20Console:\x20'+a39_0x22f752[_0x392a5e(0x1d9)](_0x30bb0b));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a39_0x4e0a56(0x259)]=a39_0x4e0a56(0x1b0);[a39_0x4e0a56(0x1e1)]='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async[a39_0x4e0a56(0x214)](_0x19e704){const _0x3f4ecb=a39_0x4e0a56,{options:_0x1a792f,args:_0x42ed09,tdx:_0x32c016}=_0x19e704,_0x50a366=_0x42ed09[0x0],_0xd7ec25=_0x1a792f[_0x3f4ecb(0x249)];if(_0xd7ec25)return saveSessionContext({'workflow_project':undefined},_0x1a792f[_0x3f4ecb(0x271)]),console[_0x3f4ecb(0x1b6)](a39_0x22f752['green'](_0x3f4ecb(0xf3))),0x0;if(!_0x50a366)return console['error'](a39_0x22f752[_0x3f4ecb(0x250)]('Error:'),_0x3f4ecb(0x132)),console[_0x3f4ecb(0x19d)](a39_0x22f752['dim'](_0x3f4ecb(0x26e))),console[_0x3f4ecb(0x19d)](a39_0x22f752[_0x3f4ecb(0x14c)](_0x3f4ecb(0x112))),0x1;const _0x2997b3=await withSpinner(_0x3f4ecb(0x1d8)+_0x50a366+_0x3f4ecb(0x13b),()=>_0x32c016['workflow']['resolveProjectId'](_0x50a366),{'verbose':_0x1a792f[_0x3f4ecb(0x284)]}),{name:_0x2660e4}=_0x2997b3[_0x3f4ecb(0xea)];return saveSessionContext({'workflow_project':_0x2660e4},_0x1a792f[_0x3f4ecb(0x271)]),console[_0x3f4ecb(0x1b6)](a39_0x22f752['green'](_0x3f4ecb(0x1a2)+a39_0x22f752[_0x3f4ecb(0x1d9)](_0x2660e4))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a39_0x4e0a56(0x259)]=a39_0x4e0a56(0x141);['description']='List\x20all\x20workflow\x20projects';async[a39_0x4e0a56(0x214)](_0x4c187e){const _0x16d1f2=a39_0x4e0a56,{options:_0x598003,args:_0x4edcb2,tdx:_0x2e0338}=_0x4c187e,_0x20495c=_0x4edcb2[0x0];_0x598003[_0x16d1f2(0x284)]&&_0x20495c&&console[_0x16d1f2(0x19d)](_0x16d1f2(0x1f6)+_0x20495c);const _0x162109=await withSpinner(_0x16d1f2(0x1ce),()=>_0x2e0338[_0x16d1f2(0x1c5)]['projects'](_0x20495c,{'limit':_0x598003[_0x16d1f2(0x25e)]}),{'verbose':_0x598003[_0x16d1f2(0x284)]});let _0x402363=_0x162109[_0x16d1f2(0xea)];_0x402363['sort']((_0x3e625c,_0x4982cc)=>_0x3e625c['name'][_0x16d1f2(0x176)](_0x4982cc[_0x16d1f2(0x259)]));const _0x267f7b=_0x598003['limit']||0x64,_0x2a08d5=_0x402363[_0x16d1f2(0x246)]>=_0x267f7b?a39_0x22f752[_0x16d1f2(0x14c)](_0x16d1f2(0x118)):'';console[_0x16d1f2(0x19d)](_0x16d1f2(0x12c)+_0x402363['length']+_0x16d1f2(0x16d)+(_0x402363[_0x16d1f2(0x246)]!==0x1?'s':'')+_0x2a08d5);if(_0x598003[_0x16d1f2(0x241)]===_0x16d1f2(0xf7)||_0x598003[_0x16d1f2(0x241)]===_0x16d1f2(0x1d6)||_0x598003[_0x16d1f2(0x241)]===_0x16d1f2(0x190))await handleSDKOutput(_0x402363,_0x598003);else{if(_0x402363[_0x16d1f2(0x246)]===0x0)_0x20495c?console[_0x16d1f2(0x1b6)](_0x16d1f2(0x197)+_0x20495c):console[_0x16d1f2(0x1b6)](_0x16d1f2(0x26a));else{const _0x5c6977=_0x402363[_0x16d1f2(0xff)](_0x572287=>{const _0x12ea3f=_0x16d1f2,_0x619bc2=_0x572287[_0x12ea3f(0x15f)]?.[_0x12ea3f(0x278)](_0x420f40=>_0x420f40[_0x12ea3f(0xfc)]===_0x12ea3f(0x1a4)),_0x7a1c3d=_0x619bc2?a39_0x22f752[_0x12ea3f(0x14c)](_0x12ea3f(0x175)):'';return _0x12ea3f(0x1cd)+_0x572287[_0x12ea3f(0x259)]+_0x7a1c3d;});await writeOutput(_0x5c6977[_0x16d1f2(0x1ad)]('\x0a'),_0x598003[_0x16d1f2(0x19f)],'list');}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a39_0x4e0a56(0x259)]=a39_0x4e0a56(0x211);[a39_0x4e0a56(0x1e1)]=a39_0x4e0a56(0x104);async[a39_0x4e0a56(0x214)](_0x162f71){const _0x432f0b=a39_0x4e0a56,{options:_0x2f7a1f,args:_0x40f83f,tdx:_0x29e883}=_0x162f71,_0x101b9e=this[_0x432f0b(0x234)](_0x40f83f,_0x2f7a1f);_0x2f7a1f['verbose']&&_0x101b9e&&console[_0x432f0b(0x19d)](_0x432f0b(0x154)+_0x101b9e);const _0x5ca27f=await withSpinner(_0x432f0b(0x256),()=>_0x29e883[_0x432f0b(0x1c5)][_0x432f0b(0xfe)](_0x101b9e,{'limit':_0x2f7a1f[_0x432f0b(0x25e)]}),{'verbose':_0x2f7a1f['verbose']});let _0x3bd5a3=_0x5ca27f[_0x432f0b(0xea)];_0x3bd5a3[_0x432f0b(0x12b)]((_0x8cd204,_0x13508a)=>{const _0x3c212b=_0x432f0b,_0x3d5369=_0x8cd204[_0x3c212b(0x259)][_0x3c212b(0x176)](_0x13508a[_0x3c212b(0x259)]);if(_0x3d5369!==0x0)return _0x3d5369;return(_0x8cd204[_0x3c212b(0x209)]?.['name']||'')[_0x3c212b(0x176)](_0x13508a[_0x3c212b(0x209)]?.['name']||'');});const _0x3c14f5=_0x2f7a1f['limit']||0x64,_0x25c896=_0x3bd5a3[_0x432f0b(0x246)]>=_0x3c14f5?a39_0x22f752[_0x432f0b(0x14c)](_0x432f0b(0x118)):'';console['error'](_0x432f0b(0x12c)+_0x3bd5a3[_0x432f0b(0x246)]+_0x432f0b(0x242)+(_0x3bd5a3['length']!==0x1?'s':'')+_0x25c896);if(_0x2f7a1f[_0x432f0b(0x241)]===_0x432f0b(0xf7)||_0x2f7a1f[_0x432f0b(0x241)]==='jsonl'||_0x2f7a1f['format']===_0x432f0b(0x190))await handleSDKOutput(_0x3bd5a3,_0x2f7a1f);else{if(_0x3bd5a3['length']===0x0)_0x101b9e?console[_0x432f0b(0x1b6)](_0x432f0b(0x23c)+_0x101b9e):console['log']('No\x20workflows\x20found');else{const _0x5a4d68=_0x2f7a1f[_0x432f0b(0x1ac)],_0x39a1dc=_0x3bd5a3[_0x432f0b(0xff)](_0x5630d9=>{const _0x3935e0=_0x432f0b,_0x4ab3dd=a39_0x22f752[_0x3935e0(0x14c)]('#'+_0x5630d9['id']),_0x2389c3=hyperlink(_0x4ab3dd,getWorkflowUrl(_0x5a4d68,_0x5630d9['id'])),_0x168533=_0x5630d9['project']?.['name']?a39_0x22f752[_0x3935e0(0x14c)]('\x20('+_0x5630d9[_0x3935e0(0x209)][_0x3935e0(0x259)]+')'):'';return _0x3935e0(0x109)+_0x2389c3+'\x20'+_0x5630d9[_0x3935e0(0x259)]+_0x168533;});await writeOutput(_0x39a1dc[_0x432f0b(0x1ad)]('\x0a'),_0x2f7a1f[_0x432f0b(0x19f)],_0x432f0b(0xe9));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']=a39_0x4e0a56(0x239);[a39_0x4e0a56(0x1e1)]=a39_0x4e0a56(0x1fe);async[a39_0x4e0a56(0x214)](_0x1877ed){const _0x28d161=a39_0x4e0a56,{options:_0x13c168,args:_0x167d2f,tdx:_0x4f92f5}=_0x1877ed,_0x46188b=this[_0x28d161(0x124)](_0x167d2f,_0x13c168);if(!_0x46188b)return 0x1;const {projectName:_0x99a538,workflowName:_0xd1ed13}=_0x46188b;if(_0x13c168[_0x28d161(0x284)]){if(_0x99a538&&_0xd1ed13)console[_0x28d161(0x19d)](_0x28d161(0x20d)+_0x99a538+'.'+_0xd1ed13);else _0x99a538&&console[_0x28d161(0x19d)](_0x28d161(0x233)+_0x99a538);const _0x5d787e=_0x13c168[_0x28d161(0x11a)];_0x5d787e&&console[_0x28d161(0x19d)](_0x28d161(0x116)+_0x5d787e);}let _0x2f5b3a=0x28;if(process[_0x28d161(0x20e)][_0x28d161(0x18e)]&&!_0x13c168[_0x28d161(0x19f)]&&!_0x13c168[_0x28d161(0x241)]){const _0x7982fc=process[_0x28d161(0x20e)]['rows']||0x28;_0x2f5b3a=Math[_0x28d161(0x253)](0x14,Math['floor'](_0x7982fc*0x2/0x3));}const _0x59837a=_0x13c168['limit']||_0x2f5b3a,_0x26d1bb=await withSpinner(_0x28d161(0x219),()=>_0x4f92f5[_0x28d161(0x1c5)]['sessions']({'projectName':_0x99a538,'workflowName':_0xd1ed13,'status':_0x13c168[_0x28d161(0x11a)],'fromTime':_0x13c168[_0x28d161(0x1e8)],'toTime':_0x13c168['to'],'limit':_0x59837a}),{'verbose':_0x13c168['verbose']}),_0x4c6f97=_0x26d1bb['data'];_0x4c6f97[_0x28d161(0x12b)]((_0x18f0d4,_0x542032)=>{const _0x1be68a=_0x28d161,_0x226806=_0x18f0d4['sessionTime']||'',_0x27e69f=_0x542032[_0x1be68a(0x143)]||'';return _0x27e69f['localeCompare'](_0x226806);});_0x4c6f97[_0x28d161(0x246)]>=_0x59837a?console[_0x28d161(0x19d)](_0x28d161(0x1f1)+_0x4c6f97[_0x28d161(0x246)]+_0x28d161(0x208)+a39_0x22f752[_0x28d161(0x14c)]('(use\x20--limit\x20to\x20see\x20more)')):console[_0x28d161(0x19d)]('✔\x20Found\x20'+_0x4c6f97[_0x28d161(0x246)]+'\x20session'+(_0x4c6f97[_0x28d161(0x246)]!==0x1?'s':''));if(_0x13c168[_0x28d161(0x241)]===_0x28d161(0xf7)||_0x13c168[_0x28d161(0x241)]===_0x28d161(0x1d6)||_0x13c168['format']===_0x28d161(0x190))await handleSDKOutput(_0x4c6f97,_0x13c168);else{if(!process['stdout'][_0x28d161(0x18e)]||_0x13c168[_0x28d161(0x19f)]){if(_0x4c6f97['length']===0x0){if(_0x99a538&&_0xd1ed13)console['log']('No\x20sessions\x20found\x20for:\x20'+_0x99a538+'.'+_0xd1ed13);else _0x99a538?console[_0x28d161(0x1b6)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x99a538):console[_0x28d161(0x1b6)](_0x28d161(0x121));}else{const _0x515076=_0x13c168[_0x28d161(0x1ac)],_0x594c45=this[_0x28d161(0x16c)](_0x4c6f97,_0x515076);_0x13c168['output']?await writeOutput(_0x594c45,_0x13c168[_0x28d161(0x19f)],_0x28d161(0xe9)):console[_0x28d161(0x1b6)](_0x594c45);}!_0x99a538&&(console['error'](''),console[_0x28d161(0x19d)](a39_0x22f752[_0x28d161(0x14c)](_0x28d161(0x21f))),console[_0x28d161(0x19d)](a39_0x22f752['dim']('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a39_0x22f752[_0x28d161(0x14c)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x4c6f97['length']===0x0){if(_0x99a538&&_0xd1ed13)console[_0x28d161(0x1b6)](_0x28d161(0x173)+_0x99a538+'.'+_0xd1ed13);else _0x99a538?console[_0x28d161(0x1b6)](_0x28d161(0x15b)+_0x99a538):console[_0x28d161(0x1b6)](_0x28d161(0x121));}else await this['navigateSessionsInteractive'](_0x4c6f97,_0x1877ed,_0x99a538);}}return 0x0;}[a39_0x4e0a56(0x16c)](_0x335497,_0x1855dd){const _0x2889a2=a39_0x4e0a56,_0xce9804=[],_0x5e421a=new Map();let _0x2407e1=Infinity,_0x4dd40e=-Infinity;for(const _0x417e6b of _0x335497){if(_0x417e6b[_0x2889a2(0xf8)]?.[_0x2889a2(0x23f)]){const _0x5dd3b7=new Date(_0x417e6b['lastAttempt']['createdAt'])[_0x2889a2(0x20b)](),_0x4301af=_0x417e6b[_0x2889a2(0xf8)][_0x2889a2(0x26d)]?new Date(_0x417e6b[_0x2889a2(0xf8)][_0x2889a2(0x26d)])[_0x2889a2(0x20b)]():Date[_0x2889a2(0x1c3)](),_0x22aac8=_0x417e6b[_0x2889a2(0x209)]?.['name']||_0x2889a2(0x21d);!_0x5e421a[_0x2889a2(0x22b)](_0x22aac8)&&_0x5e421a['set'](_0x22aac8,[]),_0x5e421a[_0x2889a2(0x11f)](_0x22aac8)[_0x2889a2(0x17b)]({'session':_0x417e6b,'startTime':_0x5dd3b7,'endTime':_0x4301af,'duration':_0x4301af-_0x5dd3b7}),_0x2407e1=Math[_0x2889a2(0x146)](_0x2407e1,_0x5dd3b7),_0x4dd40e=Math[_0x2889a2(0x253)](_0x4dd40e,_0x4301af);}}if(_0x5e421a[_0x2889a2(0x13f)]===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x4c25e0=process[_0x2889a2(0x20e)]['columns']||0x78,_0x1fd18f=0x1e,_0x1eec78=0x32,_0x5127a4=0x4,_0x3a8791=Math[_0x2889a2(0x146)](_0x1eec78,Math[_0x2889a2(0x253)](_0x1fd18f,Math[_0x2889a2(0x172)](_0x4c25e0*0.3))),_0x7f8d5=_0x4c25e0-_0x3a8791-TIMELINE_CONFIG['GUTTER']-0x3-_0x5127a4,_0x223a92=_0x4dd40e-_0x2407e1,_0x4ac1c3=_0x223a92/_0x3a8791,_0x31e027=renderTimeAxis({'startTime':_0x2407e1,'endTime':_0x4dd40e,'durationMs':_0x223a92,'msPerChar':_0x4ac1c3},_0x3a8791),_0x3462c3=[];for(const _0x1061f9 of _0x5e421a['values']()){_0x3462c3[_0x2889a2(0x17b)](..._0x1061f9);}_0x3462c3['sort']((_0x1427ac,_0x5c5220)=>_0x5c5220[_0x2889a2(0xef)]-_0x1427ac[_0x2889a2(0xef)]);const _0x55237b=new Date(_0x2407e1),_0x55e457=formatDate(_0x55237b),_0xbe4a01=_0x5127a4+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x2889a2(0x1d5)]+_0x7f8d5,_0x15ffdb='\x20'[_0x2889a2(0x1ed)](_0xbe4a01-_0x55e457[_0x2889a2(0x246)]),_0x383843=_0x15ffdb+a39_0x22f752[_0x2889a2(0x14c)](_0x55e457)+'\x20'+_0x31e027;_0xce9804[_0x2889a2(0x17b)](_0x383843);const _0x290e64=0x16;let _0x2f7371=0x0;for(const _0x9ffa8e of _0x3462c3){const _0x1cd1cd=_0x9ffa8e[_0x2889a2(0x271)][_0x2889a2(0x209)]?.[_0x2889a2(0x259)]||'?',_0x5cf497=Math[_0x2889a2(0x146)](stringWidth(_0x1cd1cd),_0x290e64);_0x2f7371=Math['max'](_0x2f7371,_0x5cf497);}for(const _0x4ac9b4 of _0x3462c3){const {session:_0x406301,startTime:_0x2e8362,endTime:_0x580d7a,duration:_0x45a032}=_0x4ac9b4,_0x4afa4b=_0x406301[_0x2889a2(0x209)]?.['id'],_0x3db2fd=_0x406301['id'],_0x4e36db=_0x406301['project']?.['name']||'?',_0x4ea1fd=_0x406301['workflow']?.[_0x2889a2(0x259)]||'?';let _0x554a11,_0x506b77;if(_0x406301['lastAttempt']){const _0x3a1409=_0x406301[_0x2889a2(0xf8)];!_0x3a1409[_0x2889a2(0x217)]?(_0x554a11=_0x3a1409[_0x2889a2(0x18d)]?'🛑':'🔄',_0x506b77=_0x3a1409[_0x2889a2(0x18d)]?a39_0x22f752[_0x2889a2(0x170)]:a39_0x22f752['blue']):(_0x554a11=_0x3a1409[_0x2889a2(0x263)]?'✅':'❌',_0x506b77=_0x3a1409[_0x2889a2(0x263)]?a39_0x22f752[_0x2889a2(0x200)]:a39_0x22f752['red']);}else _0x554a11='⏳',_0x506b77=a39_0x22f752[_0x2889a2(0x14c)];const _0x5c9a69='#'+_0x3db2fd,_0x813159=_0x4afa4b?hyperlink(_0x5c9a69,getWorkflowSessionUrl(_0x1855dd,_0x4afa4b,_0x3db2fd)):_0x5c9a69;let _0x10d15f=_0x4e36db;stringWidth(_0x4e36db)>_0x290e64&&(_0x10d15f=_0x4e36db[_0x2889a2(0x131)](0x0,_0x290e64-0x1)+'…');const _0x36b892=a39_0x22f752[_0x2889a2(0x14c)](_0x10d15f),_0x5edbd4=stringWidth(_0x10d15f),_0x3db1eb='\x20'[_0x2889a2(0x1ed)](_0x2f7371-stringWidth(_0x10d15f)+0x2),_0x4dfcdf='('+formatElapsed(_0x45a032)+')',_0x36e375=stringWidth(_0x4dfcdf),_0x1b89a7=stringWidth(_0x5c9a69),_0x24b3b2=_0x1b89a7+0x1+_0x5edbd4+_0x3db1eb[_0x2889a2(0x246)],_0x1ae105=_0x7f8d5-_0x24b3b2-_0x36e375-0x1-0x8;let _0x3ec650=_0x4ea1fd;stringWidth(_0x3ec650)>_0x1ae105&&(_0x3ec650=_0x3ec650[_0x2889a2(0x131)](0x0,_0x1ae105-0x1)+'…');const _0x58f643=_0x813159+'\x20'+_0x36b892+_0x3db1eb+_0x3ec650,_0x340b9b=stringWidth(_0x58f643),_0x2f28d8=_0x7f8d5-_0x340b9b-_0x36e375,_0x5c8377=_0x58f643+'\x20'[_0x2889a2(0x1ed)](Math[_0x2889a2(0x253)](0x1,_0x2f28d8))+a39_0x22f752[_0x2889a2(0x14c)](_0x4dfcdf),_0x5b223a=Math[_0x2889a2(0x172)]((_0x2e8362-_0x2407e1)/_0x4ac1c3),_0x2aeb65=Math[_0x2889a2(0x172)]((_0x580d7a-_0x2407e1)/_0x4ac1c3),_0x38c502=Math[_0x2889a2(0x253)](_0x5b223a+0x1,_0x2aeb65),_0x4dd419=new Array(_0x3a8791)[_0x2889a2(0xf9)]('\x20');for(let _0x507869=_0x5b223a;_0x507869<Math['min'](_0x38c502,_0x3a8791);_0x507869++){_0x4dd419[_0x507869]='─';}const _0x85a021=_0x4dd419[_0x2889a2(0xff)](_0x1d6566=>_0x1d6566==='\x20'?'\x20':_0x506b77(_0x1d6566))[_0x2889a2(0x1ad)]('');_0xce9804[_0x2889a2(0x17b)](_0x554a11+'\x20'+_0x5c8377+'│'+_0x85a021+'│');}return _0xce9804[_0x2889a2(0x1ad)]('\x0a');}async[a39_0x4e0a56(0x147)](_0x2b79ca,_0x43d4a1,_0x563416){const _0x558c7a=a39_0x4e0a56,{options:_0x10574c,tdx:_0x1c3607}=_0x43d4a1,_0x592655=_0x10574c[_0x558c7a(0x1ac)],{timelineRows:_0x4b5624,timeAxisHeader:_0x5a768e}=this['generateSessionTimelineRows'](_0x2b79ca,_0x592655),_0x2780fc=_0x4b5624['filter'](_0x577d6e=>_0x577d6e[_0x558c7a(0x23a)]);if(_0x2780fc['length']===0x0){const _0x3bc08d=this['renderSessionsTimeline'](_0x2b79ca,_0x592655);console[_0x558c7a(0x1b6)](_0x3bc08d);!_0x563416&&(console['error'](''),console['error'](a39_0x22f752[_0x558c7a(0x14c)](_0x558c7a(0x21f))),console[_0x558c7a(0x19d)](a39_0x22f752['dim'](_0x558c7a(0x22e))+'or'+a39_0x22f752[_0x558c7a(0x14c)](_0x558c7a(0x155))));return;}_0x5a768e&&console[_0x558c7a(0x1b6)](_0x5a768e);const _0x27614c=_0x4b5624[_0x558c7a(0x142)](_0x424a9a=>_0x424a9a[_0x558c7a(0x23a)])[_0x558c7a(0xff)](_0x4332b5=>({'title':_0x4332b5[_0x558c7a(0x191)],'value':_0x4332b5['attemptId']})),_0x4d4e34=process['stdout'][_0x558c7a(0x1fa)]||0x3c,_0x515dfd=Math['max'](0x28,Math[_0x558c7a(0x172)](_0x4d4e34*0x2/0x3)),_0x52df10=await a39_0x2c235c({'type':_0x558c7a(0x113),'name':_0x558c7a(0x23a),'message':_0x558c7a(0x12e),'choices':_0x27614c,'initial':-0x1,'limit':_0x515dfd,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x8d1d44,_0x193e52)=>{const _0x32fdcc=_0x558c7a;if(!_0x8d1d44)return Promise[_0x32fdcc(0x285)](_0x193e52);const _0x2bdf11=_0x193e52['filter'](_0xa9dabc=>{const _0x20f2c1=_0x32fdcc,_0x3be4ce=_0xa9dabc;return _0x3be4ce[_0x20f2c1(0x26f)][_0x20f2c1(0x1ab)]()[_0x20f2c1(0x167)](_0x8d1d44[_0x20f2c1(0x1ab)]());});return Promise[_0x32fdcc(0x285)](_0x2bdf11);}}),_0x16445f=()=>{const _0x19da7a=_0x558c7a;process[_0x19da7a(0x20e)][_0x19da7a(0x117)]('\x1b[1A\x1b[2K'),process[_0x19da7a(0x20e)][_0x19da7a(0x117)](_0x19da7a(0x266)),process[_0x19da7a(0x20e)]['write'](_0x19da7a(0x266));},_0x14e978=_0x52df10&&_0x52df10['attemptId']&&_0x52df10[_0x558c7a(0x23a)]!==null&&_0x52df10['attemptId'][_0x558c7a(0x14b)]()!=='';if(!_0x14e978){_0x16445f(),console[_0x558c7a(0x1b6)](a39_0x22f752['dim'](_0x558c7a(0x265)));return;}_0x16445f();const _0x268631=_0x2b79ca[_0x558c7a(0x216)](_0x306c5f=>_0x306c5f[_0x558c7a(0xf8)]?.['id']===_0x52df10[_0x558c7a(0x23a)]);if(_0x268631){const _0x5b33b8=_0x268631[_0x558c7a(0x209)]?.[_0x558c7a(0x259)]||'?',_0x2c238f=_0x268631['workflow']?.[_0x558c7a(0x259)]||'?';console[_0x558c7a(0x1b6)](_0x558c7a(0x27b)+a39_0x22f752[_0x558c7a(0x14c)](_0x5b33b8)+_0x558c7a(0x1e7)+a39_0x22f752['dim'](_0x2c238f));}const _0x3dae50=new WorkflowTimelineCommand();await _0x3dae50['execute']({'args':[],'options':{..._0x10574c,'attemptId':_0x52df10[_0x558c7a(0x23a)]},'tdx':_0x1c3607});}['generateSessionTimelineRows'](_0x20090e,_0x257fce){const _0x400108=a39_0x4e0a56,_0x3b92fa=new Map();for(const _0x1d184a of _0x20090e){_0x1d184a['id']&&_0x1d184a[_0x400108(0xf8)]?.['id']&&_0x3b92fa[_0x400108(0x198)](_0x1d184a['id'],_0x1d184a[_0x400108(0xf8)]['id']);}const _0x165dc4=[];let _0x18a999='';const _0x36aca6=this[_0x400108(0x16c)](_0x20090e,_0x257fce),_0x335461=_0x36aca6[_0x400108(0x127)]('\x0a');for(const _0x37e254 of _0x335461){if(_0x37e254[_0x400108(0x140)](_0x400108(0x260))||_0x37e254[_0x400108(0x136)](/^\s+\d{4}-\d{2}-\d{2}/))_0x18a999=_0x37e254;else{if(_0x37e254[_0x400108(0x136)](/^[✅❌🔄🛑⏳]/)){const _0x94d3fa=_0x37e254['match'](/#(\d+)/),_0x3bb0e2=_0x94d3fa?_0x94d3fa[0x1]:null,_0x2c81b1=_0x3bb0e2?_0x3b92fa[_0x400108(0x11f)](_0x3bb0e2)||null:null,_0x3bc5ba=_0x20090e[_0x400108(0x216)](_0x1b69e0=>_0x1b69e0['id']===_0x3bb0e2),_0x556de4=_0x3bc5ba?.[_0x400108(0x209)]?.[_0x400108(0x259)]||'';_0x165dc4[_0x400108(0x17b)]({'displayLine':_0x37e254,'attemptId':_0x2c81b1,'projectName':_0x556de4});}}}return{'timelineRows':_0x165dc4,'timeAxisHeader':_0x18a999};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']=a39_0x4e0a56(0x20a);[a39_0x4e0a56(0x1e1)]='List\x20workflow\x20attempts';async[a39_0x4e0a56(0x214)](_0x53d669){const _0x14843a=a39_0x4e0a56,{options:_0x49cf4e,args:_0x3e2ae6,tdx:_0x241007}=_0x53d669,_0x493fe9=this[_0x14843a(0x124)](_0x3e2ae6,_0x49cf4e);if(!_0x493fe9)return 0x1;const {projectName:_0x57d55c,workflowName:_0x1d0ea9}=_0x493fe9,_0x48a708=_0x49cf4e[_0x14843a(0x12a)];if(_0x49cf4e[_0x14843a(0x284)]){if(_0x57d55c&&_0x1d0ea9)console[_0x14843a(0x19d)]('Filter:\x20'+_0x57d55c+'.'+_0x1d0ea9);else _0x57d55c&&console[_0x14843a(0x19d)](_0x14843a(0x233)+_0x57d55c);_0x48a708&&console[_0x14843a(0x19d)](_0x14843a(0x186));}const _0x1eb549=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x241007[_0x14843a(0x1c5)][_0x14843a(0x156)]({'projectName':_0x57d55c,'workflowName':_0x1d0ea9,'includeRetried':_0x48a708,'limit':_0x49cf4e['limit']}),{'verbose':_0x49cf4e[_0x14843a(0x284)]}),_0x9bc746=_0x1eb549[_0x14843a(0xea)],_0x4ff224=_0x49cf4e['limit']||0x64,_0x55adb1=_0x9bc746[_0x14843a(0x246)]>=_0x4ff224?a39_0x22f752['dim'](_0x14843a(0x118)):'';console[_0x14843a(0x19d)](_0x14843a(0x12c)+_0x9bc746[_0x14843a(0x246)]+'\x20attempt'+(_0x9bc746[_0x14843a(0x246)]!==0x1?'s':'')+_0x55adb1);if(_0x49cf4e[_0x14843a(0x241)]===_0x14843a(0xf7)||_0x49cf4e[_0x14843a(0x241)]===_0x14843a(0x1d6)||_0x49cf4e[_0x14843a(0x241)]==='table')await handleSDKOutput(_0x9bc746,_0x49cf4e);else{if(_0x9bc746[_0x14843a(0x246)]===0x0){if(_0x57d55c&&_0x1d0ea9)console['log'](_0x14843a(0x1f2)+_0x57d55c+'.'+_0x1d0ea9);else _0x57d55c?console[_0x14843a(0x1b6)](_0x14843a(0x107)+_0x57d55c):console['log'](_0x14843a(0x1ff));}else{const _0x1ebe00=_0x49cf4e[_0x14843a(0x1ac)],_0x370dba=_0x9bc746[_0x14843a(0xff)](_0x5864cd=>{const _0x1b0ea9=_0x14843a,_0x194442=a39_0x22f752[_0x1b0ea9(0x14c)]('#'+_0x5864cd['id']),_0x5c98c9=_0x5864cd[_0x1b0ea9(0x209)]?.['id'],_0x3478d4=_0x5864cd['session_id']||_0x5864cd[_0x1b0ea9(0x213)],_0x390d06=_0x5c98c9&&_0x3478d4?hyperlink(_0x194442,getWorkflowAttemptUrl(_0x1ebe00,_0x5c98c9,_0x3478d4,_0x5864cd['id'])):_0x194442,{icon:_0x49de05,text:_0x177d81}=getAttemptStatusDisplay(_0x5864cd),_0x4d0944=(_0x5864cd['project']?.[_0x1b0ea9(0x259)]||'?')+'.'+(_0x5864cd['workflow']?.[_0x1b0ea9(0x259)]||'?'),_0x15827e=_0x5864cd['sessionTime']?a39_0x22f752[_0x1b0ea9(0x14c)](_0x5864cd[_0x1b0ea9(0x143)]):'';return(_0x390d06+'\x20'+_0x49de05+(_0x177d81?'\x20'+_0x177d81:'')+'\x20'+_0x4d0944+'\x20'+_0x15827e)['trimEnd']();});await writeOutput(_0x370dba[_0x14843a(0x1ad)]('\x0a'),_0x49cf4e[_0x14843a(0x19f)],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a39_0x4e0a56(0x259)]=a39_0x4e0a56(0x16b);['description']=a39_0x4e0a56(0x199);async[a39_0x4e0a56(0x214)](_0x4e4e65){const _0x242b8a=a39_0x4e0a56,{options:_0x53e82c,args:_0x3554ca,tdx:_0x5e6d91}=_0x4e4e65,_0x4be56b=_0x3554ca[0x0];if(!_0x4be56b)return console[_0x242b8a(0x19d)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x53e82c['verbose']&&console[_0x242b8a(0x19d)]('Attempt\x20ID:\x20'+_0x4be56b);const _0x2a92c2=await withSpinner(_0x242b8a(0x128),()=>_0x5e6d91[_0x242b8a(0x1c5)][_0x242b8a(0x23e)](_0x4be56b),{'verbose':_0x53e82c[_0x242b8a(0x284)]}),_0xb9b8d7=_0x2a92c2['data'];let _0x29cb2e;!_0xb9b8d7[_0x242b8a(0x217)]?_0x29cb2e=_0xb9b8d7[_0x242b8a(0x18d)]?'canceling':'running':_0x29cb2e=_0xb9b8d7['success']?_0x242b8a(0x263):_0x242b8a(0x19d);let _0x57d2d0;if(_0xb9b8d7[_0x242b8a(0x23f)]&&_0xb9b8d7[_0x242b8a(0x26d)]){const _0x36cb91=new Date(_0xb9b8d7[_0x242b8a(0x23f)])[_0x242b8a(0x20b)](),_0x69076f=new Date(_0xb9b8d7['finishedAt'])[_0x242b8a(0x20b)]();_0x57d2d0=Math['round']((_0x69076f-_0x36cb91)/0x3e8);}const _0x3f57a8={'attempt_id':_0xb9b8d7['id'],'status':_0x29cb2e,..._0xb9b8d7[_0x242b8a(0x114)]!==undefined&&{'index':_0xb9b8d7[_0x242b8a(0x114)]},..._0xb9b8d7['project']&&{'project':_0xb9b8d7[_0x242b8a(0x209)]['name']},..._0xb9b8d7[_0x242b8a(0x1c5)]&&{'workflow':_0xb9b8d7[_0x242b8a(0x1c5)][_0x242b8a(0x259)]},..._0xb9b8d7[_0x242b8a(0x213)]&&{'session_id':_0xb9b8d7[_0x242b8a(0x213)]},..._0xb9b8d7[_0x242b8a(0x143)]&&{'session_time':_0xb9b8d7[_0x242b8a(0x143)]},..._0xb9b8d7['retryAttemptName']&&{'retry_attempt':_0xb9b8d7['retryAttemptName']},..._0x57d2d0!==undefined&&{'duration_sec':_0x57d2d0},..._0xb9b8d7[_0x242b8a(0x23f)]&&{'created_at':_0xb9b8d7[_0x242b8a(0x23f)]},..._0xb9b8d7[_0x242b8a(0x26d)]&&{'finished_at':_0xb9b8d7['finishedAt']},...Object['keys'](_0xb9b8d7['params'])[_0x242b8a(0x246)]>0x0&&{'params':_0xb9b8d7[_0x242b8a(0x218)]}};return await handleSingleObjectOutput(_0x3f57a8,_0x53e82c),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']='workflow:tasks';[a39_0x4e0a56(0x1e1)]=a39_0x4e0a56(0x12d);async['execute'](_0x3df0b0){const _0xe91623=a39_0x4e0a56,{options:_0x25f58b,args:_0x4dbc58,tdx:_0x100a8b}=_0x3df0b0,_0x5d9d01=_0x4dbc58[0x0];if(!_0x5d9d01)return console['error'](_0xe91623(0x1ca)),0x1;const _0x14dd76=_0x25f58b[_0xe91623(0x16f)];_0x25f58b['verbose']&&(console[_0xe91623(0x19d)](_0xe91623(0xf6)+_0x5d9d01),_0x14dd76&&console[_0xe91623(0x19d)](_0xe91623(0x27c)));const _0xec6fe5=await withSpinner(_0xe91623(0x1c4),()=>_0x100a8b[_0xe91623(0x1c5)]['tasks'](_0x5d9d01,_0x14dd76||![]),{'verbose':_0x25f58b[_0xe91623(0x284)]}),_0x5a413c=_0xec6fe5[_0xe91623(0xea)];return console[_0xe91623(0x19d)](_0xe91623(0x12c)+_0x5a413c[_0xe91623(0x246)]+'\x20task'+(_0x5a413c[_0xe91623(0x246)]!==0x1?'s':'')),await handleSDKOutput(_0x5a413c,_0x25f58b),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a39_0x4e0a56(0x259)]=a39_0x4e0a56(0x1ba);[a39_0x4e0a56(0x1e1)]=a39_0x4e0a56(0x210);async[a39_0x4e0a56(0x214)](_0x4a54d8){const _0x2934c2=a39_0x4e0a56,{options:_0x845897,args:_0x33237b,tdx:_0x38f604}=_0x4a54d8,_0x5788da=_0x33237b[0x0];let _0x2aa402=_0x33237b[0x1];if(!_0x5788da)return console[_0x2934c2(0x19d)](_0x2934c2(0x1ca)),0x1;_0x845897['verbose']&&(console[_0x2934c2(0x19d)](_0x2934c2(0xf6)+_0x5788da),_0x2aa402&&console['error'](_0x2934c2(0x251)+_0x2aa402));const _0x4a30c8=await withSpinner('Fetching\x20log\x20files...',()=>_0x38f604[_0x2934c2(0x1c5)][_0x2934c2(0xf5)](_0x5788da,_0x2aa402),{'verbose':_0x845897[_0x2934c2(0x284)]}),_0x1c5f18=_0x4a30c8[_0x2934c2(0xea)];if(_0x1c5f18[_0x2934c2(0x246)]===0x0)return console['error'](_0x2934c2(0x204)),0x0;if(!_0x2aa402&&(_0x845897[_0x2934c2(0xf7)]||_0x845897['format']))return await handleSDKOutput(_0x1c5f18,_0x845897),0x0;if(!_0x2aa402){const _0x269789=_0x1c5f18[_0x2934c2(0xff)](_0x4e7e02=>({'title':_0x4e7e02[_0x2934c2(0x267)]+'\x20('+formatBytes(_0x4e7e02[_0x2934c2(0x23d)])+')','value':_0x4e7e02[_0x2934c2(0x267)]})),_0x38f926=await a39_0x2c235c({'type':_0x2934c2(0x20f),'name':'task','message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x269789});if(!_0x38f926[_0x2934c2(0x274)])return console['error'](_0x2934c2(0x265)),0x0;_0x2aa402=_0x38f926[_0x2934c2(0x274)];}const _0x132e7=await withSpinner(_0x2934c2(0x138),()=>_0x38f604[_0x2934c2(0x1c5)][_0x2934c2(0x1a0)](_0x5788da,_0x2aa402),{'verbose':_0x845897['verbose']}),_0x2a9a67=_0x132e7['data'];return _0x2a9a67?console[_0x2934c2(0x1b6)](_0x2a9a67):console[_0x2934c2(0x19d)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{['name']=a39_0x4e0a56(0x1c1);[a39_0x4e0a56(0x1e1)]=a39_0x4e0a56(0x287);async[a39_0x4e0a56(0x214)](_0x39f0f9){const _0x9f75ab=a39_0x4e0a56,{options:_0x5ce3b0,args:_0x53284d,tdx:_0x31b9b5}=_0x39f0f9,_0x1f36c9=_0x53284d[0x0];if(!_0x1f36c9)return console[_0x9f75ab(0x19d)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x3e77a9=_0x5ce3b0['reason'];_0x5ce3b0[_0x9f75ab(0x284)]&&(console['error'](_0x9f75ab(0xf6)+_0x1f36c9),_0x3e77a9&&console[_0x9f75ab(0x19d)](_0x9f75ab(0x153)+_0x3e77a9));if(!_0x5ce3b0[_0x9f75ab(0x261)]){const _0x1a26b9=await confirmKey(_0x9f75ab(0x152)+_0x1f36c9+'?');if(!_0x1a26b9)return console['error']('Cancelled'),0x0;}const _0x5a4132=await withSpinner(_0x9f75ab(0x282),()=>_0x31b9b5[_0x9f75ab(0x1c5)][_0x9f75ab(0x169)](_0x1f36c9,_0x3e77a9),{'verbose':_0x5ce3b0['verbose']}),_0x3ed9ab=_0x5a4132[_0x9f75ab(0xea)];return console[_0x9f75ab(0x19d)]('✔\x20'+_0x3ed9ab),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a39_0x4e0a56(0x259)]=a39_0x4e0a56(0x1d3);[a39_0x4e0a56(0x1e1)]=a39_0x4e0a56(0x174);async[a39_0x4e0a56(0x214)](_0x5b0242){const _0x3ee240=a39_0x4e0a56,{options:_0x39e0dc,args:_0x32e495,tdx:_0x18a277}=_0x5b0242,_0x368374=_0x32e495[0x0];if(!_0x368374)return console[_0x3ee240(0x19d)](_0x3ee240(0x22a)),console[_0x3ee240(0x19d)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x2ff375=![],_0x21eeb7=_0x368374;if(_0x368374[_0x3ee240(0x140)](_0x3ee240(0x189)))_0x2ff375=!![],_0x21eeb7=_0x368374[_0x3ee240(0x1c7)](0x8);else{if(_0x368374['startsWith'](_0x3ee240(0x106)))_0x2ff375=![],_0x21eeb7=_0x368374[_0x3ee240(0x1c7)](0x8);else return console[_0x3ee240(0x19d)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0x3ee240(0x19d)](_0x3ee240(0x1bc)),0x1;}const _0xafaa5c=_0x39e0dc['fromTask'],_0x3b047a=_0x39e0dc['resumeFrom'],_0xaaff8b=_0x39e0dc[_0x3ee240(0x218)],_0x1647a7=_0x39e0dc[_0x3ee240(0x1e6)];_0x39e0dc[_0x3ee240(0x284)]&&(console[_0x3ee240(0x19d)](_0x3ee240(0xfd)+(_0x2ff375?_0x3ee240(0x271):_0x3ee240(0x23e))+'\x20'+_0x21eeb7),_0xafaa5c&&console[_0x3ee240(0x19d)]('From\x20task:\x20'+_0xafaa5c),_0x3b047a&&console[_0x3ee240(0x19d)](_0x3ee240(0x17a)+_0x3b047a),_0xaaff8b&&console[_0x3ee240(0x19d)](_0x3ee240(0x232)+_0xaaff8b),_0x1647a7&&console['error'](_0x3ee240(0x10e)));let _0x905df9;if(_0xaaff8b)try{if(_0xaaff8b[_0x3ee240(0x140)]('@')){const _0x52d2b0=await import(_0x3ee240(0x1b4)),_0x45542c=_0xaaff8b[_0x3ee240(0x1c7)](0x1),_0x3e343d=await _0x52d2b0[_0x3ee240(0x125)](_0x45542c,_0x3ee240(0xf4));_0x905df9=JSON[_0x3ee240(0x1a1)](_0x3e343d);}else _0x905df9=JSON[_0x3ee240(0x1a1)](_0xaaff8b);}catch{return console[_0x3ee240(0x19d)](_0x3ee240(0x231)),0x1;}if(!_0x39e0dc[_0x3ee240(0x261)]){const _0x2615f5=await confirmKey(_0x3ee240(0x283)+(_0x2ff375?_0x3ee240(0x271):'attempt')+'\x20'+_0x21eeb7+'?');if(!_0x2615f5)return console[_0x3ee240(0x19d)](_0x3ee240(0x265)),0x0;}let _0x3c33f0;_0x2ff375?_0x3c33f0=await withSpinner('Retrying\x20session...',()=>_0x18a277[_0x3ee240(0x1c5)][_0x3ee240(0x269)](_0x21eeb7,{'fromTask':_0xafaa5c,'retryParams':_0x905df9}),{'verbose':_0x39e0dc[_0x3ee240(0x284)]}):_0x3c33f0=await withSpinner('Retrying\x20attempt...',()=>_0x18a277[_0x3ee240(0x1c5)][_0x3ee240(0x1cb)](_0x21eeb7,{'resumeFrom':_0x3b047a,'retryParams':_0x905df9,'force':_0x1647a7}),{'verbose':_0x39e0dc[_0x3ee240(0x284)]});const _0x11e370=_0x3c33f0[_0x3ee240(0xea)];return console[_0x3ee240(0x19d)](_0x3ee240(0x139)),console[_0x3ee240(0x19d)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x11e370[_0x3ee240(0x23a)]),console['error'](_0x3ee240(0x255)+_0x11e370['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a39_0x4e0a56(0x259)]='workflow:run';[a39_0x4e0a56(0x1e1)]=a39_0x4e0a56(0x145);async['execute'](_0x571cea){const _0x3c030b=a39_0x4e0a56,{options:_0x20b9ab,args:_0x474ff4,tdx:_0x1c2a98}=_0x571cea;let _0x16d8e7=_0x474ff4[0x0];if(!_0x16d8e7){const _0x3e19bc=this[_0x3c030b(0x234)]([],_0x20b9ab),_0x13932f=await withSpinner(_0x3c030b(0x248),()=>_0x1c2a98[_0x3c030b(0x1c5)][_0x3c030b(0xfe)](_0x3e19bc,{'limit':_0x20b9ab['limit']}),{'verbose':_0x20b9ab['verbose']}),_0x3644fc=_0x13932f[_0x3c030b(0xea)];if(_0x3644fc['length']===0x0)return console[_0x3c030b(0x19d)](_0x3c030b(0x25f)),!_0x3e19bc&&console[_0x3c030b(0x19d)](a39_0x22f752[_0x3c030b(0x14c)](_0x3c030b(0x14a))),0x1;const _0x33123b=_0x3644fc[_0x3c030b(0xff)](_0x23b125=>({'title':_0x23b125[_0x3c030b(0x209)]?.[_0x3c030b(0x259)]+'.'+_0x23b125[_0x3c030b(0x259)],'value':_0x23b125['project']?.['name']+'.'+_0x23b125[_0x3c030b(0x259)],'description':_0x23b125[_0x3c030b(0x14f)]?_0x3c030b(0xed)+_0x23b125['revision']:undefined})),_0x316980=await a39_0x2c235c({'type':_0x3c030b(0x20f),'name':'workflow','message':_0x3c030b(0x10d),'choices':_0x33123b});if(!_0x316980['workflow'])return 0x1;_0x16d8e7=_0x316980[_0x3c030b(0x1c5)];}if(!_0x16d8e7[_0x3c030b(0x167)]('.')){const _0x5b7ddd=this[_0x3c030b(0x234)]([],_0x20b9ab);if(_0x5b7ddd)_0x16d8e7=_0x5b7ddd+'.'+_0x16d8e7;else return console[_0x3c030b(0x19d)](a39_0x22f752['red']('Error:'),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console['error'](a39_0x22f752[_0x3c030b(0x14c)](_0x3c030b(0x14a))),0x1;}const _0x3d7693=_0x20b9ab[_0x3c030b(0x223)],_0x2c9179=_0x20b9ab[_0x3c030b(0x143)],_0x3cabe8={};if(_0x3d7693&&Array['isArray'](_0x3d7693))for(const _0x38ee18 of _0x3d7693){const _0x3f9ad9=_0x38ee18['indexOf']('=');if(_0x3f9ad9===-0x1)return console[_0x3c030b(0x19d)](_0x3c030b(0x1c6)+_0x38ee18),console[_0x3c030b(0x19d)](_0x3c030b(0x187)),0x1;const _0x2ea194=_0x38ee18[_0x3c030b(0x1c7)](0x0,_0x3f9ad9),_0x45d147=_0x38ee18[_0x3c030b(0x1c7)](_0x3f9ad9+0x1);try{_0x3cabe8[_0x2ea194]=JSON['parse'](_0x45d147);}catch{_0x3cabe8[_0x2ea194]=_0x45d147;}}_0x20b9ab[_0x3c030b(0x284)]&&(console[_0x3c030b(0x19d)]('Workflow:\x20'+_0x16d8e7),Object[_0x3c030b(0x108)](_0x3cabe8)['length']>0x0&&console['error'](_0x3c030b(0xf0)+JSON[_0x3c030b(0x1b8)](_0x3cabe8)),_0x2c9179&&console[_0x3c030b(0x19d)](_0x3c030b(0x13a)+_0x2c9179));const _0x4139e7=await withSpinner(_0x3c030b(0x21b),()=>_0x1c2a98['workflow']['run'](_0x16d8e7,_0x3cabe8,{'sessionTime':_0x2c9179}),{'verbose':_0x20b9ab['verbose']}),_0xec1472=_0x4139e7['data'];console['error'](_0x3c030b(0x1d1)),console[_0x3c030b(0x19d)]('\x20\x20Attempt\x20ID:\x20'+_0xec1472['id']),console[_0x3c030b(0x19d)](_0x3c030b(0x255)+_0xec1472[_0x3c030b(0x213)]),console['error'](_0x3c030b(0x1fd)+_0xec1472[_0x3c030b(0x209)]?.[_0x3c030b(0x259)]),console['error']('\x20\x20Workflow:\x20'+_0xec1472[_0x3c030b(0x1c5)]?.['name']);if(_0xec1472['project']?.['id']&&_0xec1472[_0x3c030b(0x213)]&&_0xec1472['id']){const _0x577efd=_0x20b9ab[_0x3c030b(0x1ac)],_0xc9cf94=getConsoleUrl(_0x577efd,_0x3c030b(0x273)+_0xec1472['project']['id']+_0x3c030b(0x163)+_0xec1472['sessionId']+_0x3c030b(0x1a3)+_0xec1472['id']);console[_0x3c030b(0x19d)](_0x3c030b(0x257)+a39_0x22f752['cyan'](_0xc9cf94));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a39_0x4e0a56(0x259)]=a39_0x4e0a56(0x1b3);['description']=a39_0x4e0a56(0x240);async[a39_0x4e0a56(0x214)](_0x415c7d){const _0xd3b5c4=a39_0x4e0a56,{options:_0x8e4960,args:_0x1af38e,tdx:_0x1dee60}=_0x415c7d,_0x106c45=_0x1af38e[0x0],_0x4451f2=_0x1af38e[0x1]||'.';if(!_0x106c45)return console[_0xd3b5c4(0x19d)](_0xd3b5c4(0x20c)),console[_0xd3b5c4(0x19d)](_0xd3b5c4(0x137)),0x1;const _0x464ccc=_0x8e4960[_0xd3b5c4(0x14f)];_0x8e4960[_0xd3b5c4(0x284)]&&(console[_0xd3b5c4(0x19d)](_0xd3b5c4(0x27b)+_0x106c45),console['error'](_0xd3b5c4(0x25a)+_0x4451f2),_0x464ccc&&console[_0xd3b5c4(0x19d)]('Revision:\x20'+_0x464ccc));const _0x5b5192=await withSpinner('Downloading\x20project\x20'+_0x106c45+'...',()=>_0x1dee60['workflow'][_0xd3b5c4(0x237)](_0x106c45,_0x4451f2,{'revision':_0x464ccc}),{'verbose':_0x8e4960['verbose']}),_0x5d0e8c=_0x5b5192[_0xd3b5c4(0xea)];return console[_0xd3b5c4(0x19d)](_0xd3b5c4(0x168)+_0x5d0e8c[_0xd3b5c4(0x279)]),console[_0xd3b5c4(0x19d)](_0xd3b5c4(0x115)+_0x5d0e8c[_0xd3b5c4(0x14f)]),console['error'](_0xd3b5c4(0x100)+_0x5d0e8c[_0xd3b5c4(0x1b2)]),console[_0xd3b5c4(0x19d)](_0xd3b5c4(0x26b)+_0x4451f2+'/'+_0x5d0e8c[_0xd3b5c4(0x279)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a39_0x4e0a56(0x259)]=a39_0x4e0a56(0x281);[a39_0x4e0a56(0x1e1)]=a39_0x4e0a56(0x148);async['execute'](_0x13ebbc){const _0x119d61=a39_0x4e0a56,{options:_0x442533,args:_0x1ff210,tdx:_0x37f27b}=_0x13ebbc;let _0x482180='.',_0x41536c=_0x442533[_0x119d61(0x259)];if(_0x1ff210[0x0]){const {promises:_0x27666d}=await import('fs');try{const _0x31e621=await _0x27666d[_0x119d61(0x1c0)](_0x1ff210[0x0]);if(_0x31e621['isDirectory']())_0x482180=_0x1ff210[0x0];else return console['error'](_0x119d61(0x144)+_0x1ff210[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x41536c=_0x1ff210[0x0],_0x482180='.';}}const _0x1b7e61=_0x442533[_0x119d61(0x14f)],_0x56bff3=_0x442533[_0x119d61(0x149)];_0x442533['verbose']&&(console[_0x119d61(0x19d)](_0x119d61(0x1ae)+_0x482180),_0x41536c&&console[_0x119d61(0x19d)](_0x119d61(0x212)+_0x41536c),_0x1b7e61&&console[_0x119d61(0x19d)](_0x119d61(0x1b5)+_0x1b7e61),_0x56bff3&&console[_0x119d61(0x19d)](_0x119d61(0x1da)));const _0x4681bd=await withSpinner(_0x119d61(0x1f4),()=>_0x37f27b[_0x119d61(0x1c5)][_0x119d61(0x17b)](_0x482180,{'projectName':_0x41536c,'revision':_0x1b7e61,'skipValidation':_0x56bff3}),{'verbose':_0x442533[_0x119d61(0x284)]}),_0x204d1f=_0x4681bd[_0x119d61(0xea)];return console['error']('✔\x20Pushed\x20'+_0x204d1f['projectName']),console['error'](_0x119d61(0x110)+_0x204d1f[_0x119d61(0x1e5)]),console['error'](_0x119d61(0x115)+_0x204d1f[_0x119d61(0x14f)]),await this[_0x119d61(0x11d)](_0x37f27b,_0x204d1f['projectName'],_0x442533[_0x119d61(0x1ac)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a39_0x4e0a56(0x259)]=a39_0x4e0a56(0x16e);['description']='Pull\x20workflow\x20project\x20to\x20local\x20folder';async[a39_0x4e0a56(0x214)](_0xc71c37){const _0x43ba06=a39_0x4e0a56,{options:_0x4678c0,args:_0x21e3e8,tdx:_0x56b67c}=_0xc71c37,_0x352a23=_0x21e3e8[0x0],_0x39b78c=_0x21e3e8[0x1];if(!_0x352a23)return console[_0x43ba06(0x19d)](a39_0x22f752[_0x43ba06(0x250)](_0x43ba06(0x1cf)),_0x43ba06(0x132)),console[_0x43ba06(0x19d)](a39_0x22f752[_0x43ba06(0x14c)](_0x43ba06(0x157))),0x1;const _0x5b8223=_0x4678c0[_0x43ba06(0x14f)];_0x4678c0[_0x43ba06(0x284)]&&(console[_0x43ba06(0x19d)](_0x43ba06(0x27b)+_0x352a23),_0x39b78c&&console[_0x43ba06(0x19d)](_0x43ba06(0x238)+_0x39b78c),_0x5b8223&&console[_0x43ba06(0x19d)](_0x43ba06(0x1b5)+_0x5b8223),_0x4678c0[_0x43ba06(0x15d)]&&console['error'](_0x43ba06(0x164)));const _0x2748f8=await withSpinner(_0x43ba06(0x193)+_0x352a23+'...',()=>_0x56b67c[_0x43ba06(0x1c5)][_0x43ba06(0x22f)](_0x352a23,{'targetDir':_0x39b78c,'revision':_0x5b8223}),{'verbose':_0x4678c0['verbose']}),_0x447f33=_0x2748f8[_0x43ba06(0xea)];_0x447f33[_0x43ba06(0xe7)]?console[_0x43ba06(0x19d)](_0x43ba06(0x158)+_0x447f33['projectName']):console[_0x43ba06(0x19d)](_0x43ba06(0x1a9)+_0x447f33['projectName']);console['error'](_0x43ba06(0x115)+_0x447f33[_0x43ba06(0x14f)]),console['error'](_0x43ba06(0x1c9)+(a39_0x1e5ada[_0x43ba06(0x1c2)](process[_0x43ba06(0x236)](),_0x447f33[_0x43ba06(0x1e0)])||'.')),console[_0x43ba06(0x19d)](_0x43ba06(0x24c)+a39_0x22f752[_0x43ba06(0x200)]('+'+_0x447f33[_0x43ba06(0x226)][_0x43ba06(0xf2)]+_0x43ba06(0x105))+',\x20'+(a39_0x22f752[_0x43ba06(0x170)]('~'+_0x447f33[_0x43ba06(0x226)][_0x43ba06(0x1a8)]+'\x20modified')+',\x20')+(a39_0x22f752[_0x43ba06(0x250)]('-'+_0x447f33[_0x43ba06(0x226)][_0x43ba06(0x14d)]+_0x43ba06(0x13d))+',\x20')+(''+a39_0x22f752[_0x43ba06(0x14c)](_0x447f33[_0x43ba06(0x226)][_0x43ba06(0x17f)]+_0x43ba06(0x1eb))));for(const _0x4ea7b6 of _0x447f33[_0x43ba06(0x1ec)]){_0x4ea7b6[_0x43ba06(0x286)]===_0x43ba06(0x1a8)&&_0x4ea7b6['diff']&&(console[_0x43ba06(0x19d)]('\x0a'+a39_0x22f752[_0x43ba06(0x1d9)](_0x43ba06(0x102)+_0x4ea7b6[_0x43ba06(0x130)])),console[_0x43ba06(0x19d)](_0x4ea7b6['diff']));}if(!_0x447f33[_0x43ba06(0x178)])return saveSessionContext({'workflow_project':_0x447f33[_0x43ba06(0x279)]},_0x4678c0[_0x43ba06(0x271)]),console[_0x43ba06(0x19d)](a39_0x22f752[_0x43ba06(0x200)]('\x0a✔\x20Already\x20up\x20to\x20date')),console['error'](a39_0x22f752['dim'](_0x43ba06(0x182)+_0x447f33[_0x43ba06(0x279)])),0x0;if(_0x4678c0['dryRun'])return console[_0x43ba06(0x19d)](a39_0x22f752[_0x43ba06(0x170)](_0x43ba06(0xe8))),0x0;if(!_0x4678c0[_0x43ba06(0x261)]){const _0x4a5659=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x4a5659)return console[_0x43ba06(0x19d)](_0x43ba06(0x265)),0x0;}await withSpinner(_0x43ba06(0x222),()=>_0x56b67c[_0x43ba06(0x1c5)][_0x43ba06(0x225)](_0x447f33,{'revision':_0x5b8223}),{'verbose':_0x4678c0[_0x43ba06(0x284)]}),saveSessionContext({'workflow_project':_0x447f33['projectName']},_0x4678c0[_0x43ba06(0x271)]),console[_0x43ba06(0x19d)](a39_0x22f752[_0x43ba06(0x200)](_0x43ba06(0x11b)));const _0x367f7c=a39_0x1e5ada[_0x43ba06(0x1c2)](process[_0x43ba06(0x236)](),_0x447f33['targetDir'])||'.';return console[_0x43ba06(0x19d)](a39_0x22f752[_0x43ba06(0x14c)](_0x43ba06(0x26b)+_0x367f7c)),console[_0x43ba06(0x19d)](a39_0x22f752[_0x43ba06(0x14c)](_0x43ba06(0x182)+_0x447f33[_0x43ba06(0x279)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a39_0x4e0a56(0x259)]=a39_0x4e0a56(0x203);[a39_0x4e0a56(0x1e1)]=a39_0x4e0a56(0xe6);async[a39_0x4e0a56(0x214)](_0x5ef6b4){const _0x25414a=a39_0x4e0a56,{options:_0x5d53e2,args:_0x4b9c52,tdx:_0x4fe030}=_0x5ef6b4,_0x3cfd66=this[_0x25414a(0x207)](_0x4b9c52,_0x5d53e2),_0x5c25b5=_0x5d53e2['revision'],_0x270748=_0x5d53e2[_0x25414a(0x149)];_0x5d53e2['verbose']&&(_0x3cfd66&&console[_0x25414a(0x19d)](_0x25414a(0xe5)+_0x3cfd66),_0x5c25b5&&console[_0x25414a(0x19d)](_0x25414a(0x1b5)+_0x5c25b5),_0x5d53e2[_0x25414a(0x15d)]&&console['error'](_0x25414a(0x164)),_0x270748&&console[_0x25414a(0x19d)](_0x25414a(0x1da)));let _0x1d7a99;try{_0x1d7a99=await withSpinner(_0x25414a(0x192),()=>_0x4fe030[_0x25414a(0x1c5)]['preparePushProject']({'sourceDir':_0x3cfd66,'revision':_0x5c25b5,'skipValidation':_0x270748}),{'verbose':_0x5d53e2[_0x25414a(0x284)]});}catch(_0x8f9573){if(_0x8f9573 instanceof Error&&_0x8f9573[_0x25414a(0x25b)][_0x25414a(0x167)](_0x25414a(0x1ef)))return console[_0x25414a(0x19d)](a39_0x22f752[_0x25414a(0x250)](_0x25414a(0x1cf)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x5d53e2['workflowProject']?console[_0x25414a(0x19d)](a39_0x22f752['dim']('Tip:\x20cd\x20to\x20workflows/'+_0x5d53e2[_0x25414a(0x1ee)]+_0x25414a(0x195)+_0x5d53e2[_0x25414a(0x1ee)]+'\x27')):console[_0x25414a(0x19d)](a39_0x22f752[_0x25414a(0x14c)](_0x25414a(0x229))),0x1;throw _0x8f9573;}const _0x354464=_0x1d7a99['data'];console[_0x25414a(0x19d)](_0x25414a(0x1a9)+_0x354464[_0x25414a(0x279)]),console[_0x25414a(0x19d)]('\x20\x20Source:\x20'+_0x354464['sourceDir']),console[_0x25414a(0x19d)](_0x25414a(0x115)+_0x354464[_0x25414a(0x14f)]),console[_0x25414a(0x19d)](_0x25414a(0x24c)+a39_0x22f752[_0x25414a(0x200)]('+'+_0x354464[_0x25414a(0x226)][_0x25414a(0xf2)]+_0x25414a(0x105))+',\x20'+(a39_0x22f752['yellow']('~'+_0x354464['summary'][_0x25414a(0x1a8)]+_0x25414a(0x111))+',\x20')+(a39_0x22f752[_0x25414a(0x250)]('-'+_0x354464[_0x25414a(0x226)][_0x25414a(0x14d)]+_0x25414a(0x13d))+',\x20')+(''+a39_0x22f752[_0x25414a(0x14c)](_0x354464['summary'][_0x25414a(0x17f)]+'\x20unchanged')));for(const _0x4296fb of _0x354464[_0x25414a(0x1ec)]){_0x4296fb['type']===_0x25414a(0x1a8)&&_0x4296fb[_0x25414a(0x18f)]&&(console[_0x25414a(0x19d)]('\x0a'+a39_0x22f752[_0x25414a(0x1d9)](_0x25414a(0x102)+_0x4296fb['path'])),console[_0x25414a(0x19d)](_0x4296fb['diff']));}if(!_0x354464[_0x25414a(0x178)])return console[_0x25414a(0x19d)](a39_0x22f752[_0x25414a(0x200)](_0x25414a(0x14e))),await this[_0x25414a(0x11d)](_0x4fe030,_0x354464[_0x25414a(0x279)],_0x5d53e2['site']),0x0;if(_0x5d53e2[_0x25414a(0x15d)])return console[_0x25414a(0x19d)](a39_0x22f752[_0x25414a(0x170)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x5d53e2[_0x25414a(0x261)]){const _0x377c7f=await confirmKey(_0x25414a(0x181));if(!_0x377c7f)return console[_0x25414a(0x19d)]('Cancelled'),0x0;}const _0x3275c0=await withSpinner(_0x25414a(0x1f7),()=>_0x4fe030[_0x25414a(0x1c5)]['executePushProject'](_0x354464),{'verbose':_0x5d53e2[_0x25414a(0x284)]}),_0x4ee82d=_0x3275c0[_0x25414a(0xea)];return console[_0x25414a(0x19d)](a39_0x22f752[_0x25414a(0x200)]('✔\x20Push\x20complete')),console[_0x25414a(0x19d)]('\x20\x20Project\x20ID:\x20'+_0x4ee82d[_0x25414a(0x1e5)]),console[_0x25414a(0x19d)]('\x20\x20Revision:\x20'+_0x4ee82d[_0x25414a(0x14f)]),await this['showWorkflowConsoleUrl'](_0x4fe030,_0x4ee82d['projectName'],_0x5d53e2[_0x25414a(0x1ac)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a39_0x4e0a56(0x259)]=a39_0x4e0a56(0x1db);['description']=a39_0x4e0a56(0x166);async['execute'](_0x12e523){const _0x539aa5=a39_0x4e0a56,{options:_0x4f7555,args:_0x4fc0d1,tdx:_0x3b5fd0}=_0x12e523,_0x4af140=this[_0x539aa5(0x207)](_0x4fc0d1,_0x4f7555),_0x100f16=_0x4f7555[_0x539aa5(0x259)],_0x389114=_0x4f7555['revision'],_0x3a0679=_0x4f7555[_0x539aa5(0x149)];if(!_0x4af140)return console[_0x539aa5(0x19d)](a39_0x22f752[_0x539aa5(0x250)]('Error:'),_0x539aa5(0x1d7)),console['error'](a39_0x22f752[_0x539aa5(0x14c)](_0x539aa5(0x134))),console['error'](a39_0x22f752[_0x539aa5(0x14c)](_0x539aa5(0x179))),0x1;if(!_0x100f16)return console[_0x539aa5(0x19d)](a39_0x22f752[_0x539aa5(0x250)](_0x539aa5(0x1cf)),_0x539aa5(0x150)),console[_0x539aa5(0x19d)](a39_0x22f752[_0x539aa5(0x14c)](_0x539aa5(0x134))),0x1;_0x4f7555[_0x539aa5(0x284)]&&(console['error']('Source\x20directory:\x20'+_0x4af140),console[_0x539aa5(0x19d)](_0x539aa5(0x24d)+_0x100f16),_0x389114&&console[_0x539aa5(0x19d)](_0x539aa5(0x1b5)+_0x389114),_0x4f7555[_0x539aa5(0x15d)]&&console[_0x539aa5(0x19d)](_0x539aa5(0x164)),_0x3a0679&&console[_0x539aa5(0x19d)]('Validation:\x20skipped'));const _0x1eea60=await withSpinner(_0x539aa5(0x161),()=>_0x3b5fd0['workflow']['prepareCloneProject'](_0x4af140,_0x100f16,{'revision':_0x389114,'skipValidation':_0x3a0679}),{'verbose':_0x4f7555['verbose']}),_0x235a2b=_0x1eea60[_0x539aa5(0xea)];console[_0x539aa5(0x19d)](_0x539aa5(0x159)+_0x235a2b[_0x539aa5(0x13c)]);_0x235a2b[_0x539aa5(0x1f5)]&&console[_0x539aa5(0x19d)](_0x539aa5(0x119)+_0x235a2b[_0x539aa5(0x1f5)]);console['error'](_0x539aa5(0x24d)+_0x235a2b['newProjectName']),console[_0x539aa5(0x19d)](_0x539aa5(0x1b5)+_0x235a2b[_0x539aa5(0x14f)]),console[_0x539aa5(0x19d)]('Files\x20to\x20upload:\x20'+_0x235a2b['fileCount']);_0x235a2b[_0x539aa5(0x15c)]&&(console[_0x539aa5(0x19d)](a39_0x22f752[_0x539aa5(0x170)]('\x0a⚠\x20Project\x20\x22'+_0x235a2b[_0x539aa5(0x103)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x235a2b['existingProjectId']+')')),console[_0x539aa5(0x19d)](a39_0x22f752['yellow']('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x4f7555['dryRun'])return console[_0x539aa5(0x19d)](a39_0x22f752[_0x539aa5(0x170)](_0x539aa5(0x19a))),0x0;if(!_0x4f7555[_0x539aa5(0x261)]){const _0x1dee3b=_0x235a2b['sourceProjectName']||a39_0x1e5ada[_0x539aa5(0x1df)](_0x4af140),_0x107c00=_0x235a2b[_0x539aa5(0x15c)]?_0x539aa5(0x171)+_0x100f16+_0x539aa5(0x122):'\x0aClone\x20\x22'+_0x1dee3b+_0x539aa5(0x27d)+_0x100f16+'\x22?',_0xc259e3=await confirmKey(_0x107c00);if(!_0xc259e3)return console[_0x539aa5(0x19d)](_0x539aa5(0x265)),0x0;}const _0x35eb03=await withSpinner(_0x235a2b[_0x539aa5(0x15c)]?_0x539aa5(0x1fc)+_0x100f16+_0x539aa5(0x196):_0x539aa5(0x276)+_0x100f16+_0x539aa5(0x196),()=>_0x3b5fd0[_0x539aa5(0x1c5)][_0x539aa5(0x201)](_0x235a2b),{'verbose':_0x4f7555[_0x539aa5(0x284)]}),_0x3ec38d=_0x35eb03[_0x539aa5(0xea)];return console[_0x539aa5(0x19d)](a39_0x22f752[_0x539aa5(0x200)](_0x235a2b['targetExists']?_0x539aa5(0x1b1):'✔\x20Clone\x20complete')),console[_0x539aa5(0x19d)](_0x539aa5(0x1fd)+_0x3ec38d[_0x539aa5(0x103)]),console[_0x539aa5(0x19d)](_0x539aa5(0x110)+_0x3ec38d['newProjectId']),console[_0x539aa5(0x19d)]('\x20\x20Revision:\x20'+_0x3ec38d['revision']),await this[_0x539aa5(0x11d)](_0x3b5fd0,_0x3ec38d[_0x539aa5(0x103)],_0x4f7555[_0x539aa5(0x1ac)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a39_0x4e0a56(0x259)]=a39_0x4e0a56(0x268);[a39_0x4e0a56(0x1e1)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async['execute'](_0x35e283){const _0x3d7d0a=a39_0x4e0a56,{options:_0x10ba84,args:_0xc8751c,tdx:_0x3002b5}=_0x35e283,_0x5332d2=_0xc8751c[0x0];if(!_0x5332d2)return console[_0x3d7d0a(0x19d)](_0x3d7d0a(0x1bb)),console[_0x3d7d0a(0x19d)](_0x3d7d0a(0x165)),0x1;_0x10ba84[_0x3d7d0a(0x284)]&&console['error'](_0x3d7d0a(0x27b)+_0x5332d2);if(!_0x10ba84[_0x3d7d0a(0x261)]){const _0x1a396d=await confirmKey(_0x3d7d0a(0x244)+_0x5332d2+_0x3d7d0a(0x228));if(!_0x1a396d)return console[_0x3d7d0a(0x19d)](_0x3d7d0a(0x265)),0x0;}const _0x5c50b9=await withSpinner('Deleting\x20project\x20'+_0x5332d2+_0x3d7d0a(0x196),()=>_0x3002b5[_0x3d7d0a(0x1c5)][_0x3d7d0a(0x1e2)](_0x5332d2),{'verbose':_0x10ba84[_0x3d7d0a(0x284)]}),_0x588af9=_0x5c50b9[_0x3d7d0a(0xea)];return console[_0x3d7d0a(0x19d)](_0x3d7d0a(0x227)+_0x588af9[_0x3d7d0a(0x279)]),console[_0x3d7d0a(0x19d)](_0x3d7d0a(0x110)+_0x588af9[_0x3d7d0a(0x1e5)]),0x0;}}export function parseKeyValue(_0x4707d8){const _0x506000=a39_0x4e0a56,_0x5a6d78=_0x4707d8[_0x506000(0x123)]('=');if(_0x5a6d78===-0x1)throw new Error(_0x506000(0x27f)+_0x4707d8+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x12fbc3=_0x4707d8[_0x506000(0x1c7)](0x0,_0x5a6d78),_0x54440e=_0x4707d8[_0x506000(0x1c7)](_0x5a6d78+0x1);if(!_0x12fbc3)throw new Error(_0x506000(0x1a6));return{'key':_0x12fbc3,'value':_0x54440e};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a39_0x4e0a56(0x259)]=a39_0x4e0a56(0x230);[a39_0x4e0a56(0x1e1)]=a39_0x4e0a56(0xfa);async[a39_0x4e0a56(0x214)](_0x472157){const _0x2a293c=a39_0x4e0a56,{options:_0x3182d0,args:_0x3c1d6c,tdx:_0x1d870d}=_0x472157,_0x13419d=this[_0x2a293c(0x205)](_0x3c1d6c,_0x3182d0);if(!_0x13419d)return 0x1;_0x3182d0[_0x2a293c(0x284)]&&console['error']('Project:\x20'+_0x13419d);const _0x1bafa9=await withSpinner(_0x2a293c(0x21a),()=>_0x1d870d[_0x2a293c(0x1c5)]['listSecrets'](_0x13419d),{'verbose':_0x3182d0[_0x2a293c(0x284)]}),{secrets:_0x504ea8}=_0x1bafa9[_0x2a293c(0xea)];return console[_0x2a293c(0x19d)](_0x2a293c(0x12c)+_0x504ea8['length']+_0x2a293c(0x1a5)+(_0x504ea8[_0x2a293c(0x246)]!==0x1?'s':'')),await handleSDKOutput(_0x504ea8,_0x3182d0),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a39_0x4e0a56(0x220);[a39_0x4e0a56(0x1e1)]=a39_0x4e0a56(0x1bd);async[a39_0x4e0a56(0x214)](_0x10b5c0){const _0x87bc9a=a39_0x4e0a56,{options:_0x240593,args:_0x1c1aec,tdx:_0x2f1567}=_0x10b5c0;let _0x4f3c66,_0x34d202;if(_0x1c1aec['length']>=0x2)_0x4f3c66=_0x1c1aec[0x0],_0x34d202=_0x1c1aec[0x1];else{if(_0x1c1aec[_0x87bc9a(0x246)]===0x1&&_0x240593[_0x87bc9a(0x1ee)])_0x4f3c66=_0x240593['workflowProject'],_0x34d202=_0x1c1aec[0x0];else return _0x1c1aec[_0x87bc9a(0x246)]===0x1?(console[_0x87bc9a(0x19d)](_0x87bc9a(0x20c)),console[_0x87bc9a(0x19d)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x87bc9a(0x19d)](_0x87bc9a(0x22c)),console[_0x87bc9a(0x19d)](_0x87bc9a(0x133)),0x1);}let _0x1f3784,_0x2437d8;try{({key:_0x1f3784,value:_0x2437d8}=parseKeyValue(_0x34d202));}catch(_0x3011f2){return _0x3011f2 instanceof Error&&console['error'](a39_0x22f752[_0x87bc9a(0x250)](_0x87bc9a(0x1cf)),_0x3011f2[_0x87bc9a(0x25b)]),0x1;}_0x240593['verbose']&&(console[_0x87bc9a(0x19d)](_0x87bc9a(0x27b)+_0x4f3c66),console['error'](_0x87bc9a(0x1d0)+_0x1f3784));const _0x509f22=await withSpinner(_0x87bc9a(0x10a),()=>_0x2f1567[_0x87bc9a(0x1c5)][_0x87bc9a(0x247)](_0x4f3c66,_0x1f3784,_0x2437d8),{'verbose':_0x240593[_0x87bc9a(0x284)]}),_0x2e2a0f=_0x509f22[_0x87bc9a(0xea)];return console['error'](_0x87bc9a(0x270)+_0x2e2a0f[_0x87bc9a(0xfc)]+_0x87bc9a(0x1dc)+_0x2e2a0f[_0x87bc9a(0x279)]+'\x27'),(_0x240593['json']||_0x240593[_0x87bc9a(0x1d6)])&&await handleSingleObjectOutput(_0x2e2a0f,_0x240593),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a39_0x4e0a56(0x1fb);['description']=a39_0x4e0a56(0x280);async[a39_0x4e0a56(0x214)](_0x395b15){const _0x288879=a39_0x4e0a56,{options:_0x1aa048,args:_0x2f3b34,tdx:_0x1ab57e}=_0x395b15;let _0x1f0806,_0x3784d4;if(_0x2f3b34[_0x288879(0x246)]>=0x2)_0x1f0806=_0x2f3b34[0x0],_0x3784d4=_0x2f3b34[0x1];else{if(_0x2f3b34['length']===0x1&&_0x1aa048[_0x288879(0x1ee)])_0x1f0806=_0x1aa048[_0x288879(0x1ee)],_0x3784d4=_0x2f3b34[0x0];else return _0x2f3b34[_0x288879(0x246)]===0x1?(console[_0x288879(0x19d)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x288879(0x14a)),0x1):(console[_0x288879(0x19d)]('Error:\x20Secret\x20key\x20is\x20required'),console['error'](_0x288879(0x24a)),0x1);}_0x1aa048[_0x288879(0x284)]&&(console[_0x288879(0x19d)](_0x288879(0x27b)+_0x1f0806),console[_0x288879(0x19d)](_0x288879(0x1d0)+_0x3784d4));if(!_0x1aa048[_0x288879(0x261)]){const _0x57533a=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x3784d4+_0x288879(0x235)+_0x1f0806+'\x27?');if(!_0x57533a)return console[_0x288879(0x19d)](_0x288879(0x265)),0x0;}const _0x15fd1d=await withSpinner(_0x288879(0x1b7),()=>_0x1ab57e[_0x288879(0x1c5)][_0x288879(0x27e)](_0x1f0806,_0x3784d4),{'verbose':_0x1aa048[_0x288879(0x284)]}),_0x252c97=_0x15fd1d[_0x288879(0xea)];return console['error'](_0x288879(0x270)+_0x252c97['key']+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x252c97[_0x288879(0x279)]+'\x27'),(_0x1aa048[_0x288879(0xf7)]||_0x1aa048[_0x288879(0x1d6)])&&await handleSingleObjectOutput(_0x252c97,_0x1aa048),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(_0x62f824){const _0x38d430=a39_0x4e0a56,_0x15b4dc=Math[_0x38d430(0x172)](_0x62f824/0x3e8),_0x401b67=Math[_0x38d430(0x172)](_0x15b4dc/0x3c),_0x2d4eb7=Math[_0x38d430(0x172)](_0x401b67/0x3c),_0x42d71b=Math[_0x38d430(0x172)](_0x2d4eb7/0x18);if(_0x42d71b>0x0){const _0x5a96c6=_0x2d4eb7%0x18;return _0x5a96c6>0x0?_0x42d71b+'d\x20'+_0x5a96c6+'h':_0x42d71b+'d';}else{if(_0x2d4eb7>0x0){const _0x20fbd6=_0x401b67%0x3c;return _0x20fbd6>0x0?_0x2d4eb7+'h\x20'+_0x20fbd6+'m':_0x2d4eb7+'h';}else{if(_0x401b67>0x0){const _0x4e8e01=_0x15b4dc%0x3c;return _0x4e8e01>0x0?_0x401b67+'m\x20'+_0x4e8e01+'s':_0x401b67+'m';}else return _0x15b4dc+'s';}}}function formatTimestamp(_0x4c2441,_0x4f7163){const _0x176f84=a39_0x4e0a56,_0x33f931=new Date(_0x4c2441),_0x33074a=String(_0x33f931['getHours']())[_0x176f84(0x258)](0x2,'0'),_0x267c16=String(_0x33f931['getMinutes']())['padStart'](0x2,'0'),_0x48e681=_0x33074a+':'+_0x267c16,_0x2f26b6=_0x33f931[_0x176f84(0x1e9)]()===_0x4f7163[_0x176f84(0x1e9)]()&&_0x33f931['getMonth']()===_0x4f7163[_0x176f84(0x17e)]()&&_0x33f931[_0x176f84(0x1f8)]()===_0x4f7163[_0x176f84(0x1f8)]();if(_0x2f26b6)return _0x48e681;else{const _0x173b04=String(_0x33f931[_0x176f84(0x17e)]()+0x1)[_0x176f84(0x258)](0x2,'0'),_0x4ddea5=String(_0x33f931[_0x176f84(0x1f8)]())[_0x176f84(0x258)](0x2,'0');return _0x173b04+'-'+_0x4ddea5+'\x20'+_0x48e681;}}function formatDate(_0x3d11d5){const _0x454268=a39_0x4e0a56,_0x43d913=_0x3d11d5[_0x454268(0x1e9)](),_0x2c817b=String(_0x3d11d5[_0x454268(0x17e)]()+0x1)['padStart'](0x2,'0'),_0x17e824=String(_0x3d11d5['getDate']())['padStart'](0x2,'0');return _0x43d913+'-'+_0x2c817b+'-'+_0x17e824;}function getTaskStateIcon(_0x2031ea){const _0x257ca2={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x257ca2[_0x2031ea]||'⚪';}function a39_0x5920(_0x1d1b7f,_0x347cdc){_0x1d1b7f=_0x1d1b7f-0xe5;const _0x3453c2=a39_0x3453();let _0x592051=_0x3453c2[_0x1d1b7f];return _0x592051;}function getBarChar(_0x40ec99){const _0x381ac9=a39_0x4e0a56;return _0x40ec99===_0x381ac9(0x19d)||_0x40ec99==='group_error'?'×':'─';}function getBarColor(_0x354701){const _0x1460f6=a39_0x4e0a56,_0x4109e1={'success':a39_0x22f752[_0x1460f6(0x200)],'error':a39_0x22f752[_0x1460f6(0x250)],'group_error':a39_0x22f752[_0x1460f6(0x250)],'running':a39_0x22f752[_0x1460f6(0x180)],'blocked':a39_0x22f752['yellow'],'planned':a39_0x22f752[_0x1460f6(0x14c)],'canceling':a39_0x22f752[_0x1460f6(0x170)]};return _0x4109e1[_0x354701]||a39_0x22f752[_0x1460f6(0x162)];}function parseTaskName(_0xb8d359){const _0x2da914=a39_0x4e0a56;let _0x391e23=_0xb8d359[_0x2da914(0x275)](/^\++/,'');const _0x375678=_0x391e23[_0x2da914(0x127)]('+'),_0x364d30=_0x375678[_0x2da914(0x246)]>0x1?_0x375678['length']-0x2:0x0,_0x4755a0=_0x375678[_0x375678['length']-0x1]||_0x391e23;return{'level':_0x364d30,'name':'+'+_0x4755a0};}function truncateTaskName(_0x2c6e2a,_0x14eb40){const _0xd1bc45=a39_0x4e0a56,_0x3df6d0=stringWidth(_0x2c6e2a);if(_0x3df6d0<=_0x14eb40)return _0x2c6e2a;let _0x5260f5=_0x2c6e2a;while(stringWidth(_0x5260f5+'…')>_0x14eb40&&_0x5260f5[_0xd1bc45(0x246)]>0x0){_0x5260f5=_0x5260f5['slice'](0x0,-0x1);}return _0x5260f5+'…';}function calculateTimeScale(_0x22bf7e,_0x1f2cbf){const _0x453d0b=a39_0x4e0a56;return{'startTime':_0x22bf7e[_0x453d0b(0x221)],'endTime':_0x22bf7e[_0x453d0b(0x202)],'durationMs':_0x22bf7e[_0x453d0b(0x1e4)],'msPerChar':_0x22bf7e[_0x453d0b(0x1e4)]/_0x1f2cbf};}function timeToPosition(_0x1dd695,_0x1eb96a,_0x5e1fef){const _0x5257b0=a39_0x4e0a56,_0x5e95de=_0x1dd695-_0x1eb96a[_0x5257b0(0xef)],_0x53c67c=Math['floor'](_0x5e95de/_0x1eb96a[_0x5257b0(0x1aa)]);return Math[_0x5257b0(0x253)](0x0,Math[_0x5257b0(0x146)](_0x53c67c,_0x5e1fef));}function renderTimeAxis(_0x429fd7,_0x12eecc){const _0x235905=a39_0x4e0a56,_0x35cd88=Math['min'](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math['max'](TIMELINE_CONFIG[_0x235905(0x1a7)],Math['floor'](_0x12eecc/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x38a4ee=_0x429fd7['durationMs']/(_0x35cd88-0x1),_0x423216=new Date(_0x429fd7[_0x235905(0xef)]),_0x6d605b=[];for(let _0x1eea1a=0x0;_0x1eea1a<_0x35cd88;_0x1eea1a++){const _0x164f68=_0x429fd7['startTime']+_0x1eea1a*_0x38a4ee,_0x2bfa73=timeToPosition(_0x164f68,_0x429fd7,_0x12eecc),_0x269e66=formatTimestamp(_0x164f68,_0x423216);_0x6d605b['push']({'pos':_0x2bfa73,'text':_0x269e66});}const _0x5d86aa=new Array(_0x12eecc)[_0x235905(0xf9)]('\x20');let _0x3060ad=-0x1;for(const {pos:_0x104528,text:_0x3c506b}of _0x6d605b){let _0x25cc50=Math[_0x235905(0x253)](0x0,_0x104528-Math['floor'](_0x3c506b[_0x235905(0x246)]/0x2));_0x25cc50<=_0x3060ad+TIMELINE_CONFIG[_0x235905(0x24f)]&&(_0x25cc50=_0x3060ad+TIMELINE_CONFIG[_0x235905(0x24f)]+0x1);_0x25cc50+_0x3c506b[_0x235905(0x246)]>_0x12eecc&&(_0x25cc50=_0x12eecc-_0x3c506b[_0x235905(0x246)]);if(_0x25cc50>=0x0&&_0x25cc50+_0x3c506b[_0x235905(0x246)]<=_0x12eecc&&_0x25cc50>_0x3060ad){for(let _0x1cd7bf=0x0;_0x1cd7bf<_0x3c506b[_0x235905(0x246)];_0x1cd7bf++){_0x5d86aa[_0x25cc50+_0x1cd7bf]=_0x3c506b[_0x1cd7bf];}_0x3060ad=_0x25cc50+_0x3c506b['length']-0x1;}}return _0x5d86aa[_0x235905(0x1ad)]('');}function renderTaskRow(_0x1ce81c,_0x114d5b,_0x413bfa,_0x5161d){const _0x1e4f59=a39_0x4e0a56,{level:_0x44b39e,name:_0x23874f}=parseTaskName(_0x1ce81c[_0x1e4f59(0x259)]),_0x2878ec='\x20'[_0x1e4f59(0x1ed)](_0x44b39e),_0x4e8d9e=_0x1ce81c[_0x1e4f59(0x254)]?'('+formatElapsed(_0x1ce81c[_0x1e4f59(0x254)][_0x1e4f59(0x1e4)])+')':'',_0x1951fe=stringWidth(_0x4e8d9e),_0x4323a3=_0x44b39e*0x1,_0x4b9d35=_0x5161d-_0x4323a3-_0x1951fe-0x1,_0xf90522=truncateTaskName(_0x23874f,_0x4b9d35),_0x2d4171=_0x2878ec+_0xf90522,_0x4336be=stringWidth(_0x2d4171),_0x3b9a53=_0x5161d-_0x4336be-_0x1951fe,_0x1f3194=_0x2d4171+'\x20'[_0x1e4f59(0x1ed)](Math['max'](0x1,_0x3b9a53))+a39_0x22f752[_0x1e4f59(0x14c)](_0x4e8d9e),_0x5612d5=getTaskStateIcon(_0x1ce81c['state']),_0xedcc5d=new Array(_0x413bfa)[_0x1e4f59(0xf9)]('\x20');if(_0x1ce81c[_0x1e4f59(0x254)]){const _0x5e45c5=timeToPosition(_0x1ce81c[_0x1e4f59(0x254)][_0x1e4f59(0x221)],_0x114d5b,_0x413bfa),_0x2376b4=timeToPosition(_0x1ce81c[_0x1e4f59(0x254)][_0x1e4f59(0x202)],_0x114d5b,_0x413bfa),_0xa7588d=getBarChar(_0x1ce81c[_0x1e4f59(0x135)]),_0xdd67dd=Math[_0x1e4f59(0x253)](_0x5e45c5+0x1,_0x2376b4);for(let _0x3108d1=_0x5e45c5;_0x3108d1<Math['min'](_0xdd67dd,_0x413bfa);_0x3108d1++){_0xedcc5d[_0x3108d1]=_0xa7588d;}}const _0x23622d=getBarColor(_0x1ce81c[_0x1e4f59(0x135)]),_0x4a401e=_0xedcc5d[_0x1e4f59(0xff)](_0x235af0=>_0x235af0==='\x20'?'\x20':_0x23622d(_0x235af0))[_0x1e4f59(0x1ad)]('');return _0x5612d5+'\x20'+_0x1f3194+'│'+_0x4a401e+'│';}function calculateStats(_0x4b6703){const _0x33c482=a39_0x4e0a56,_0xfe57dd={'total':_0x4b6703[_0x33c482(0x246)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0xf7ac5 of _0x4b6703){if(_0xf7ac5[_0x33c482(0x135)]===_0x33c482(0x263))_0xfe57dd[_0x33c482(0x263)]++;else{if(_0xf7ac5[_0x33c482(0x135)]===_0x33c482(0x19d)||_0xf7ac5[_0x33c482(0x135)]===_0x33c482(0x19e))_0xfe57dd[_0x33c482(0x19d)]++;else _0xf7ac5[_0x33c482(0x135)]===_0x33c482(0x1de)?_0xfe57dd[_0x33c482(0x1de)]++:_0xfe57dd[_0x33c482(0xeb)]++;}}return _0xfe57dd;}function formatStats(_0x41f6d6){const _0x979e04=a39_0x4e0a56;return[_0x979e04(0x1f9)+_0x41f6d6[_0x979e04(0x26c)],'✅\x20'+_0x41f6d6['success'],'❌\x20'+_0x41f6d6[_0x979e04(0x19d)],'🔄\x20'+_0x41f6d6[_0x979e04(0x1de)],'⏳\x20'+_0x41f6d6[_0x979e04(0xeb)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a39_0x4e0a56(0x259)]=a39_0x4e0a56(0x185);[a39_0x4e0a56(0x1e1)]=a39_0x4e0a56(0x21c);async['execute'](_0x28238b){const _0x11be6c=a39_0x4e0a56,{options:_0x45014e,args:_0x28d883,tdx:_0x5276e1}=_0x28238b;let _0x51c3da,_0x320485,_0x2d943c=![];if(_0x28d883[0x0]){if(_0x28d883[0x0][_0x11be6c(0x167)]('.')){const _0xd85279=this[_0x11be6c(0x124)](_0x28d883,_0x45014e);if(!_0xd85279)return 0x1;_0x51c3da=_0xd85279[_0x11be6c(0x279)],_0x320485=_0xd85279[_0x11be6c(0x17c)];}else{_0x320485=_0x28d883[0x0],_0x51c3da=_0x45014e['workflowProject'];if(!_0x51c3da)return console['error'](a39_0x22f752[_0x11be6c(0x250)](_0x11be6c(0x1cf)),_0x11be6c(0x23b)),0x1;_0x2d943c=!![];}}else{const _0x55dd64=this['parseProjectWorkflowPattern'](_0x28d883,_0x45014e);if(!_0x55dd64)return 0x1;_0x51c3da=_0x55dd64['projectName'],_0x320485=_0x55dd64[_0x11be6c(0x17c)];}if(_0x45014e[_0x11be6c(0x284)]){if(_0x51c3da&&_0x320485)console[_0x11be6c(0x19d)](_0x11be6c(0x20d)+_0x51c3da+'.'+_0x320485);else _0x51c3da&&console[_0x11be6c(0x19d)]('Filter:\x20project='+_0x51c3da);}const _0x4c0aa6=_0x45014e[_0x11be6c(0x23a)],_0x1bd48f=_0x45014e[_0x11be6c(0x213)];if(_0x4c0aa6){_0x1bd48f&&console[_0x11be6c(0x19d)](a39_0x22f752[_0x11be6c(0x170)](_0x11be6c(0x24b)),_0x11be6c(0x18c));const _0x46e779=_0x45014e[_0x11be6c(0x12f)];return _0x46e779?await this['pollTimeline'](_0x28238b,_0x4c0aa6):await this[_0x11be6c(0x1f0)](_0x28238b,_0x4c0aa6,_0x45014e),0x0;}if(_0x1bd48f){const _0x4ac2f4=await withSpinner(_0x11be6c(0x15a),()=>_0x5276e1[_0x11be6c(0x1c5)][_0x11be6c(0x151)]({'projectName':_0x51c3da,'workflowName':_0x320485,'limit':0x64}),{'verbose':_0x45014e[_0x11be6c(0x284)]}),_0x3462ce=_0x4ac2f4['data']['find'](_0x5c8e47=>_0x5c8e47['id']===_0x1bd48f);if(!_0x3462ce)return console[_0x11be6c(0x19d)](a39_0x22f752[_0x11be6c(0x250)](_0x11be6c(0x1cf)),'Session\x20not\x20found:\x20'+_0x1bd48f),0x1;if(!_0x3462ce[_0x11be6c(0xf8)]?.['id'])return console[_0x11be6c(0x19d)](a39_0x22f752[_0x11be6c(0x250)]('Error:'),'Session\x20'+_0x1bd48f+'\x20has\x20no\x20attempts'),0x1;const _0xe31df=_0x3462ce[_0x11be6c(0xf8)]['id'];_0x45014e[_0x11be6c(0x284)]&&console['error'](_0x11be6c(0x1d2)+_0xe31df+_0x11be6c(0x10b)+_0x1bd48f);const _0x178eeb=_0x45014e[_0x11be6c(0x12f)];return _0x178eeb?await this[_0x11be6c(0x18b)](_0x28238b,_0xe31df):await this[_0x11be6c(0x1f0)](_0x28238b,_0xe31df,_0x45014e),0x0;}const _0x4f727e=await withSpinner('Loading\x20sessions...',()=>_0x5276e1[_0x11be6c(0x1c5)][_0x11be6c(0x151)]({'projectName':_0x51c3da,'workflowName':_0x320485,'limit':_0x45014e[_0x11be6c(0x25e)]||0x32}),{'verbose':_0x45014e[_0x11be6c(0x284)]}),_0x4528dc=_0x4f727e[_0x11be6c(0xea)];if(_0x4528dc[_0x11be6c(0x246)]===0x0){if(_0x51c3da&&_0x320485)console['error'](_0x11be6c(0x173)+_0x51c3da+'.'+_0x320485);else _0x51c3da?console[_0x11be6c(0x19d)](_0x11be6c(0x15b)+_0x51c3da):(console[_0x11be6c(0x19d)](_0x11be6c(0x120)),console[_0x11be6c(0x19d)](a39_0x22f752['dim'](_0x11be6c(0x245))));return 0x0;}_0x4528dc[_0x11be6c(0x12b)]((_0x491c95,_0x16963b)=>{const _0x20f25b=_0x11be6c,_0x534143=_0x491c95['sessionTime']||'',_0x46dd02=_0x16963b[_0x20f25b(0x143)]||'';return _0x46dd02[_0x20f25b(0x176)](_0x534143);});if(_0x45014e[_0x11be6c(0xf7)]||_0x45014e[_0x11be6c(0x1d6)])return await handleSDKOutput(_0x4528dc,_0x45014e),0x0;let _0x1a86dd;if(_0x2d943c){const _0x3f3342=_0x4528dc[0x0];if(!_0x3f3342[_0x11be6c(0xf8)]?.['id'])return console[_0x11be6c(0x19d)](_0x11be6c(0x224)),0x0;_0x1a86dd=_0x3f3342['lastAttempt']['id'],_0x45014e['verbose']&&console[_0x11be6c(0x19d)](_0x11be6c(0x183)+_0x3f3342[_0x11be6c(0x143)]);}else{const _0x61da52=_0x4528dc[_0x11be6c(0xff)](_0x219094=>{const _0x4e2aae=_0x11be6c,_0x2c0cb1=getAttemptStatusDisplay(_0x219094['lastAttempt']);return{'title':_0x219094[_0x4e2aae(0x209)]?.[_0x4e2aae(0x259)]+'.'+_0x219094[_0x4e2aae(0x1c5)]?.[_0x4e2aae(0x259)]+'\x20-\x20'+_0x219094[_0x4e2aae(0x143)]+'\x20'+_0x2c0cb1['icon'],'value':_0x219094[_0x4e2aae(0xf8)]?.['id']||'','description':_0x2c0cb1['text']};}),_0x1d3532=await a39_0x2c235c({'type':'select','name':'attemptId','message':_0x11be6c(0x243),'choices':_0x61da52['filter'](_0x3fe705=>_0x3fe705[_0x11be6c(0xec)]!=='')});if(!_0x1d3532[_0x11be6c(0x23a)])return 0x0;_0x1a86dd=_0x1d3532[_0x11be6c(0x23a)];}const _0x32b3c5=_0x45014e['follow'];return _0x32b3c5?await this[_0x11be6c(0x18b)](_0x28238b,_0x1a86dd):await this[_0x11be6c(0x1f0)](_0x28238b,_0x1a86dd,_0x45014e),0x0;}async[a39_0x4e0a56(0x1f0)](_0x67b3b,_0x42489c,_0x3f5b65){const _0x225b52=a39_0x4e0a56,{tdx:_0x4b422f}=_0x67b3b;let _0x5eb924,_0x1acf09;try{[_0x5eb924,_0x1acf09]=await Promise[_0x225b52(0x1af)]([_0x4b422f[_0x225b52(0x1c5)][_0x225b52(0x23e)](_0x42489c),_0x4b422f[_0x225b52(0x1c5)]['tasks'](_0x42489c,![])]);}catch(_0x1a51b2){console[_0x225b52(0x19d)](a39_0x22f752[_0x225b52(0x250)](_0x225b52(0xfb)));_0x3f5b65[_0x225b52(0x284)]&&console[_0x225b52(0x19d)](_0x1a51b2);throw _0x1a51b2;}if(_0x3f5b65[_0x225b52(0xf7)]||_0x3f5b65[_0x225b52(0x1d6)]){const _0x4e89b0=this[_0x225b52(0x101)](_0x5eb924,_0x1acf09);await handleSDKOutput([_0x4e89b0],_0x3f5b65);return;}const _0x52e795=_0x4b422f[_0x225b52(0x24e)][_0x225b52(0x1ac)],_0x41d11c=this[_0x225b52(0x11c)](_0x5eb924,_0x1acf09,_0x52e795);console[_0x225b52(0x1b6)](_0x41d11c);}async['pollTimeline'](_0x66a648,_0x206887){const _0x19e939=a39_0x4e0a56,{tdx:_0x2361e4}=_0x66a648,_0x12071d=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x1dabff=TIMELINE_CONFIG[_0x19e939(0x13e)];let _0x5b657b=0x0;while(_0x5b657b<_0x1dabff){process[_0x19e939(0x20e)]['isTTY']&&process[_0x19e939(0x20e)]['write']('\x1bc');let _0x518ece,_0x45f387;try{[_0x518ece,_0x45f387]=await Promise['all']([_0x2361e4[_0x19e939(0x1c5)][_0x19e939(0x23e)](_0x206887),_0x2361e4['workflow'][_0x19e939(0x160)](_0x206887,![])]);}catch(_0x4b7a7c){console['error'](a39_0x22f752['red']('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x5b657b>0x0&&console[_0x19e939(0x19d)](a39_0x22f752[_0x19e939(0x14c)](_0x19e939(0x19c)+_0x5b657b));throw _0x4b7a7c;}const _0x13aab3=_0x2361e4[_0x19e939(0x24e)][_0x19e939(0x1ac)],_0x1df00e=this[_0x19e939(0x11c)](_0x518ece,_0x45f387,_0x13aab3);console['log'](_0x1df00e);const _0x10ed03=_0x518ece[_0x19e939(0x217)]&&_0x45f387['every'](_0x3fc469=>_0x3fc469[_0x19e939(0x135)]!==_0x19e939(0x1de)&&_0x3fc469['state']!==_0x19e939(0xee));if(_0x10ed03){console[_0x19e939(0x19d)](a39_0x22f752[_0x19e939(0x200)](_0x19e939(0x1c8)));break;}console[_0x19e939(0x19d)](a39_0x22f752[_0x19e939(0x14c)](_0x19e939(0x22d)+_0x5b657b*0x2+_0x19e939(0x1cc))),await new Promise(_0x5d5187=>setTimeout(_0x5d5187,_0x12071d)),_0x5b657b++;}_0x5b657b>=_0x1dabff&&console[_0x19e939(0x19d)](a39_0x22f752['yellow'](_0x19e939(0x277)));}['renderTimeline'](_0x4774a2,_0x10a51c,_0xd63f0c){const _0x411a1d=a39_0x4e0a56,_0x1dc702=[],_0x10bea1=TIMELINE_CONFIG[_0x411a1d(0x177)],_0x5bfa73=0x5,_0x5217e2=process[_0x411a1d(0x20e)][_0x411a1d(0x215)]||0x78,_0x3e26d2=_0x5217e2-_0x10bea1-_0x5bfa73,_0x10f2b4=Math[_0x411a1d(0x253)](TIMELINE_CONFIG[_0x411a1d(0x184)],Math[_0x411a1d(0x146)](_0x3e26d2,TIMELINE_CONFIG[_0x411a1d(0x18a)])),_0x12aa41=new Date(_0x4774a2['createdAt'])['getTime'](),_0x40f7a8=_0x4774a2['finishedAt']?new Date(_0x4774a2[_0x411a1d(0x26d)])[_0x411a1d(0x20b)]():Date[_0x411a1d(0x1c3)](),_0x2b88d6={'start':_0x12aa41,'end':_0x40f7a8,'duration':_0x40f7a8-_0x12aa41},_0x426629=new Map(),_0x25a142=[];for(const _0xefd6be of _0x10a51c){if(_0xefd6be[_0x411a1d(0x27a)]){const _0x452275=new Date(_0xefd6be[_0x411a1d(0x27a)])[_0x411a1d(0x20b)](),_0x46ce67=_0xefd6be['updatedAt']?new Date(_0xefd6be[_0x411a1d(0x10c)])[_0x411a1d(0x20b)]():Date['now'](),_0x2a6514={'start':_0x452275,'end':_0x46ce67,'duration':_0x46ce67-_0x452275};_0x426629[_0x411a1d(0x198)](_0xefd6be['id'],_0x2a6514),_0x25a142[_0x411a1d(0x17b)]({'name':_0xefd6be['fullName'],'state':_0xefd6be[_0x411a1d(0x135)]||_0x411a1d(0x21e),'window':_0x2a6514});}else _0x25a142[_0x411a1d(0x17b)]({'name':_0xefd6be[_0x411a1d(0x1dd)],'state':_0xefd6be[_0x411a1d(0x135)]||_0x411a1d(0xee),'window':undefined});}_0x25a142[_0x411a1d(0x12b)]((_0x40e68e,_0x36df06)=>{const _0x51edd6=_0x411a1d;if(!_0x40e68e[_0x51edd6(0x254)])return 0x1;if(!_0x36df06[_0x51edd6(0x254)])return-0x1;return _0x40e68e[_0x51edd6(0x254)]['start']-_0x36df06[_0x51edd6(0x254)]['start'];});const _0x57faab=_0x25a142[_0x411a1d(0x246)],_0xc0796f=_0x57faab>TIMELINE_CONFIG[_0x411a1d(0x25d)];_0xc0796f&&_0x25a142[_0x411a1d(0x264)](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x34bf74=calculateTimeScale(_0x2b88d6,_0x10f2b4),_0x5b8398=_0x4774a2['done']?_0x4774a2[_0x411a1d(0x263)]?a39_0x22f752['green']('success'):a39_0x22f752['red'](_0x411a1d(0x19d)):a39_0x22f752['blue'](_0x411a1d(0x1de)),_0xc5a47e=_0x4774a2[_0x411a1d(0x209)]?.['id'],_0x2a43f4=_0x4774a2[_0x411a1d(0x213)];let _0x437c96;if(_0xc5a47e&&_0x2a43f4){const _0x4fd574=getWorkflowAttemptUrl(_0xd63f0c,_0xc5a47e,_0x2a43f4,_0x4774a2['id']);_0x437c96=hyperlink(a39_0x22f752[_0x411a1d(0x14c)](_0x4774a2['id']),_0x4fd574);}else _0x437c96=a39_0x22f752[_0x411a1d(0x14c)](_0x4774a2['id']);_0x1dc702[_0x411a1d(0x17b)](_0x411a1d(0x262)+_0x437c96+_0x411a1d(0x126)+_0x5b8398+_0x411a1d(0x126)+formatElapsed(_0x2b88d6[_0x411a1d(0x1e4)]));if(_0x25a142[_0x411a1d(0x246)]>0x0){const _0x2d45e6=renderTimeAxis(_0x34bf74,_0x10f2b4),_0x89595e=new Date(_0x2b88d6['start']),_0x49d375=formatDate(_0x89595e),_0x23432f=TIMELINE_CONFIG[_0x411a1d(0x1be)]+TIMELINE_CONFIG['ICON_SPACING']+_0x10bea1,_0x5d5c89=_0x49d375[_0x411a1d(0x258)](_0x23432f),_0x4fe0f4=a39_0x22f752[_0x411a1d(0x14c)](_0x5d5c89);_0x1dc702['push'](_0x4fe0f4+'\x20'+_0x2d45e6);for(const _0x355d71 of _0x25a142){_0x1dc702[_0x411a1d(0x17b)](renderTaskRow(_0x355d71,_0x34bf74,_0x10f2b4,_0x10bea1));}const _0x3b361c=calculateStats(_0x25a142);_0x1dc702[_0x411a1d(0x17b)](formatStats(_0x3b361c)),_0xc0796f&&_0x1dc702['push'](a39_0x22f752[_0x411a1d(0x170)](_0x411a1d(0x252)+TIMELINE_CONFIG[_0x411a1d(0x25d)]+_0x411a1d(0xf1)+_0x57faab+_0x411a1d(0x11e))),_0x1dc702['push'](''),_0x1dc702[_0x411a1d(0x17b)](a39_0x22f752[_0x411a1d(0x14c)]('💡\x20Tip:\x20Use\x20')+(_0x411a1d(0x206)+_0x4774a2['id']+_0x411a1d(0x17d))+a39_0x22f752[_0x411a1d(0x14c)](_0x411a1d(0x188)));}else _0x1dc702['push'](_0x411a1d(0x16a));return _0x1dc702['join']('\x0a');}['buildTimelineData'](_0x419d0b,_0x2355ab){const _0x5a10da=a39_0x4e0a56,_0x57715a=new Date(_0x419d0b[_0x5a10da(0x23f)])[_0x5a10da(0x20b)](),_0xa00603=_0x419d0b[_0x5a10da(0x26d)]?new Date(_0x419d0b[_0x5a10da(0x26d)])[_0x5a10da(0x20b)]():Date[_0x5a10da(0x1c3)](),_0x58a76a=_0xa00603-_0x57715a,_0x4f6ff8=[];for(const _0x4e5635 of _0x2355ab){if(_0x4e5635[_0x5a10da(0x27a)]){const _0x9ae80f=new Date(_0x4e5635[_0x5a10da(0x27a)])['getTime'](),_0x4674a5=_0x4e5635[_0x5a10da(0x10c)]?new Date(_0x4e5635[_0x5a10da(0x10c)])[_0x5a10da(0x20b)]():Date[_0x5a10da(0x1c3)]();_0x4f6ff8[_0x5a10da(0x17b)]({'name':_0x4e5635[_0x5a10da(0x1dd)],'state':_0x4e5635[_0x5a10da(0x135)]||'unknown','window':{'start':_0x9ae80f,'end':_0x4674a5,'duration':_0x4674a5-_0x9ae80f}});}else _0x4f6ff8['push']({'name':_0x4e5635[_0x5a10da(0x1dd)],'state':_0x4e5635[_0x5a10da(0x135)]||_0x5a10da(0xee),'window':undefined});}const _0x64e5bd=calculateStats(_0x4f6ff8);return{'attempt':{'id':_0x419d0b['id'],'status':_0x419d0b['done']?_0x419d0b[_0x5a10da(0x263)]?'success':'error':_0x5a10da(0x1de),'createdAt':_0x419d0b[_0x5a10da(0x23f)],'finishedAt':_0x419d0b[_0x5a10da(0x26d)],'duration_ms':_0x58a76a},'tasks':_0x4f6ff8['map'](_0x3c3bab=>({'name':_0x3c3bab[_0x5a10da(0x259)],'state':_0x3c3bab[_0x5a10da(0x135)],'startedAt':_0x3c3bab[_0x5a10da(0x254)]?new Date(_0x3c3bab[_0x5a10da(0x254)]['start'])[_0x5a10da(0x25c)]():null,'updatedAt':_0x3c3bab[_0x5a10da(0x254)]?new Date(_0x3c3bab['window'][_0x5a10da(0x202)])[_0x5a10da(0x25c)]():null,'duration_ms':_0x3c3bab[_0x5a10da(0x254)]?.[_0x5a10da(0x1e4)]||null})),'stats':_0x64e5bd};}}
1
+ const a39_0x1b0c43=a39_0x5863;(function(_0x361a49,_0x1930d4){const _0x20d49a=a39_0x5863,_0x93c9cb=_0x361a49();while(!![]){try{const _0x52a4e7=-parseInt(_0x20d49a(0x269))/0x1*(-parseInt(_0x20d49a(0x158))/0x2)+-parseInt(_0x20d49a(0x243))/0x3*(-parseInt(_0x20d49a(0x251))/0x4)+parseInt(_0x20d49a(0x257))/0x5*(parseInt(_0x20d49a(0x12e))/0x6)+parseInt(_0x20d49a(0x1fb))/0x7*(-parseInt(_0x20d49a(0x17d))/0x8)+parseInt(_0x20d49a(0x1f2))/0x9*(parseInt(_0x20d49a(0x1f9))/0xa)+parseInt(_0x20d49a(0x176))/0xb+-parseInt(_0x20d49a(0x1df))/0xc*(parseInt(_0x20d49a(0x245))/0xd);if(_0x52a4e7===_0x1930d4)break;else _0x93c9cb['push'](_0x93c9cb['shift']());}catch(_0x3a966a){_0x93c9cb['push'](_0x93c9cb['shift']());}}}(a39_0x2f76,0x53dd3));import a39_0x4049ae from'chalk';import{existsSync}from'fs';import a39_0x613a32 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a39_0x4a9c7f from'prompts';function getAttemptStatusDisplay(_0x28b960){const _0x30ca30=a39_0x5863;if(!_0x28b960)return{'icon':'⏳','text':''};const {done:_0x1ab7bb,success:_0x121688,cancelRequested:_0x575aae}=_0x28b960;if(!_0x1ab7bb)return _0x575aae?{'icon':'🛑','text':a39_0x4049ae['yellow'](_0x30ca30(0xfc))}:{'icon':'🔄','text':a39_0x4049ae[_0x30ca30(0x255)](_0x30ca30(0x1b7))};if(_0x121688)return{'icon':'✅','text':a39_0x4049ae['green']('success')};return{'icon':'❌','text':a39_0x4049ae[_0x30ca30(0x213)](_0x30ca30(0x280))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x404810,_0x40e3ee,_0x1d71af=0x0){const _0x42af60=a39_0x5863;return _0x404810[_0x1d71af]||_0x40e3ee[_0x42af60(0x110)];}[a39_0x1b0c43(0x25a)](_0x521731,_0xd64a32,_0x127fd1=0x0){const _0x1562b5=a39_0x1b0c43,_0x37836e=this[_0x1562b5(0x115)](_0x521731,_0xd64a32,_0x127fd1);if(!_0x37836e)return console[_0x1562b5(0x280)](a39_0x4049ae[_0x1562b5(0x213)]('Error:'),_0x1562b5(0x16f)),console[_0x1562b5(0x280)](a39_0x4049ae[_0x1562b5(0x239)](_0x1562b5(0x15c))),null;return _0x37836e;}[a39_0x1b0c43(0x242)](_0x190223,_0x579023){const _0x1ca5d1=a39_0x1b0c43;if(_0x190223[0x0]){const _0xe7c951=_0x190223[0x0][_0x1ca5d1(0x2a5)]('.');if(_0xe7c951[_0x1ca5d1(0x21b)]===0x1)return{'projectName':_0xe7c951[0x0],'workflowName':undefined};else return _0xe7c951[_0x1ca5d1(0x21b)]===0x2?{'projectName':_0xe7c951[0x0],'workflowName':_0xe7c951[0x1]}:(console[_0x1ca5d1(0x280)](a39_0x4049ae[_0x1ca5d1(0x213)](_0x1ca5d1(0x12a)),_0x1ca5d1(0x1e5)),null);}return{'projectName':_0x579023[_0x1ca5d1(0x110)],'workflowName':undefined};}['resolveProjectDir'](_0x5673e3,_0x2e63c3,_0x2209c6=0x0){const _0x510241=a39_0x1b0c43;if(_0x5673e3[_0x2209c6])return _0x5673e3[_0x2209c6];if(_0x2e63c3[_0x510241(0x110)]){const _0x4411a4=a39_0x613a32[_0x510241(0x1a5)](process[_0x510241(0x1e2)](),_0x510241(0x15e),_0x2e63c3[_0x510241(0x110)]);if(existsSync(a39_0x613a32[_0x510241(0x1a5)](_0x4411a4,_0x510241(0x101))))return _0x4411a4;}return undefined;}async[a39_0x1b0c43(0x199)](_0x4991c8,_0x2ac9aa,_0x2447c7){const _0x2aa230=a39_0x1b0c43;try{const _0x54efbd=await _0x4991c8[_0x2aa230(0x132)]['workflows'](_0x2ac9aa,{'limit':0x1});if(_0x54efbd['length']>0x0){const _0x5ace8f=_0x54efbd[0x0]['id'],_0x346585=getWorkflowUrl(_0x2447c7,_0x5ace8f);console[_0x2aa230(0x280)](_0x2aa230(0x20d)+a39_0x4049ae[_0x2aa230(0x22b)](_0x346585));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a39_0x1b0c43(0x238)]=a39_0x1b0c43(0x161);[a39_0x1b0c43(0x252)]=a39_0x1b0c43(0x169);async['execute'](_0x1ceef7){const _0x5f232d=a39_0x1b0c43,{options:_0x215b4b,args:_0x5b8040,tdx:_0x169b0d}=_0x1ceef7,_0x43e89e=_0x5b8040[0x0],_0x258013=_0x215b4b['clear'];if(_0x258013)return saveSessionContext({'workflow_project':undefined},_0x215b4b[_0x5f232d(0x1dd)]),console[_0x5f232d(0x21e)](a39_0x4049ae[_0x5f232d(0x293)](_0x5f232d(0x1f1))),0x0;if(!_0x43e89e)return console[_0x5f232d(0x280)](a39_0x4049ae[_0x5f232d(0x213)]('Error:'),_0x5f232d(0x16f)),console[_0x5f232d(0x280)](a39_0x4049ae[_0x5f232d(0x239)](_0x5f232d(0x128))),console[_0x5f232d(0x280)](a39_0x4049ae[_0x5f232d(0x239)](_0x5f232d(0x1ea))),0x1;const _0x34b4b0=await withSpinner(_0x5f232d(0x299)+_0x43e89e+_0x5f232d(0x1ec),()=>_0x169b0d[_0x5f232d(0x132)][_0x5f232d(0x298)](_0x43e89e),{'verbose':_0x215b4b['verbose']}),{name:_0x156517}=_0x34b4b0[_0x5f232d(0x29a)];return saveSessionContext({'workflow_project':_0x156517},_0x215b4b[_0x5f232d(0x1dd)]),console[_0x5f232d(0x21e)](a39_0x4049ae[_0x5f232d(0x293)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a39_0x4049ae[_0x5f232d(0x22b)](_0x156517))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a39_0x1b0c43(0x238)]=a39_0x1b0c43(0x203);['description']='List\x20all\x20workflow\x20projects';async[a39_0x1b0c43(0x260)](_0x20d324){const _0x5d563e=a39_0x1b0c43,{options:_0x19d11d,args:_0x2c09ae,tdx:_0x24dad0}=_0x20d324,_0x5d501d=_0x2c09ae[0x0];_0x19d11d['verbose']&&_0x5d501d&&console['error'](_0x5d563e(0x1b1)+_0x5d501d);const _0x2c14fd=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x24dad0[_0x5d563e(0x132)]['projects'](_0x5d501d,{'limit':_0x19d11d['limit']}),{'verbose':_0x19d11d[_0x5d563e(0x130)]});let _0x19b416=_0x2c14fd['data'];_0x19b416[_0x5d563e(0x150)]((_0x304fa4,_0x59ad00)=>_0x304fa4['name'][_0x5d563e(0x291)](_0x59ad00['name']));const _0x3d4ac2=_0x19d11d[_0x5d563e(0x1a8)]||0x64,_0x18ca49=_0x19b416[_0x5d563e(0x21b)]>=_0x3d4ac2?a39_0x4049ae[_0x5d563e(0x239)](_0x5d563e(0x191)):'';console[_0x5d563e(0x280)]('✔\x20Found\x20'+_0x19b416[_0x5d563e(0x21b)]+'\x20project'+(_0x19b416['length']!==0x1?'s':'')+_0x18ca49);if(_0x19d11d['format']===_0x5d563e(0x20b)||_0x19d11d[_0x5d563e(0x210)]==='jsonl'||_0x19d11d['format']===_0x5d563e(0x216))await handleSDKOutput(_0x19b416,_0x19d11d);else{if(_0x19b416['length']===0x0)_0x5d501d?console[_0x5d563e(0x21e)](_0x5d563e(0x177)+_0x5d501d):console[_0x5d563e(0x21e)](_0x5d563e(0x1ba));else{const _0x516ab9=_0x19b416[_0x5d563e(0x24a)](_0x6808f9=>{const _0x4f5d2d=_0x5d563e,_0xe33be2=_0x6808f9[_0x4f5d2d(0x133)]?.['some'](_0x1e9b4a=>_0x1e9b4a[_0x4f5d2d(0x121)]===_0x4f5d2d(0x1ad)),_0x3107ab=_0xe33be2?a39_0x4049ae['dim']('\x20(system)'):'';return'📁\x20'+_0x6808f9[_0x4f5d2d(0x238)]+_0x3107ab;});await writeOutput(_0x516ab9[_0x5d563e(0x1a5)]('\x0a'),_0x19d11d[_0x5d563e(0x283)],_0x5d563e(0x1d7));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a39_0x1b0c43(0x238)]='workflow:workflows';['description']='List\x20workflows';async[a39_0x1b0c43(0x260)](_0x521ad3){const _0x2997d7=a39_0x1b0c43,{options:_0x27c889,args:_0x104f86,tdx:_0x2ddb5c}=_0x521ad3,_0x4a49f4=this[_0x2997d7(0x115)](_0x104f86,_0x27c889);_0x27c889['verbose']&&_0x4a49f4&&console['error'](_0x2997d7(0x231)+_0x4a49f4);const _0x18efd6=await withSpinner('Listing\x20workflows...',()=>_0x2ddb5c[_0x2997d7(0x132)][_0x2997d7(0x15e)](_0x4a49f4,{'limit':_0x27c889[_0x2997d7(0x1a8)]}),{'verbose':_0x27c889[_0x2997d7(0x130)]});let _0x15b8dc=_0x18efd6[_0x2997d7(0x29a)];_0x15b8dc[_0x2997d7(0x150)]((_0x54f00c,_0x4a3183)=>{const _0x11db3f=_0x2997d7,_0x53e664=_0x54f00c['name'][_0x11db3f(0x291)](_0x4a3183[_0x11db3f(0x238)]);if(_0x53e664!==0x0)return _0x53e664;return(_0x54f00c[_0x11db3f(0x14d)]?.[_0x11db3f(0x238)]||'')[_0x11db3f(0x291)](_0x4a3183['project']?.[_0x11db3f(0x238)]||'');});const _0x16f74a=_0x27c889[_0x2997d7(0x1a8)]||0x64,_0x1f6a41=_0x15b8dc[_0x2997d7(0x21b)]>=_0x16f74a?a39_0x4049ae[_0x2997d7(0x239)](_0x2997d7(0x191)):'';console[_0x2997d7(0x280)](_0x2997d7(0x2a6)+_0x15b8dc[_0x2997d7(0x21b)]+_0x2997d7(0x1ca)+(_0x15b8dc['length']!==0x1?'s':'')+_0x1f6a41);if(_0x27c889[_0x2997d7(0x210)]===_0x2997d7(0x20b)||_0x27c889[_0x2997d7(0x210)]===_0x2997d7(0x24b)||_0x27c889[_0x2997d7(0x210)]===_0x2997d7(0x216))await handleSDKOutput(_0x15b8dc,_0x27c889);else{if(_0x15b8dc[_0x2997d7(0x21b)]===0x0)_0x4a49f4?console[_0x2997d7(0x21e)](_0x2997d7(0x226)+_0x4a49f4):console[_0x2997d7(0x21e)]('No\x20workflows\x20found');else{const _0x37d145=_0x27c889[_0x2997d7(0x1cc)],_0x3d44ec=_0x15b8dc['map'](_0x17d37f=>{const _0x2037f5=_0x2997d7,_0x508264=a39_0x4049ae['dim']('#'+_0x17d37f['id']),_0x4e30e7=hyperlink(_0x508264,getWorkflowUrl(_0x37d145,_0x17d37f['id'])),_0x17f4bd=_0x17d37f[_0x2037f5(0x14d)]?.[_0x2037f5(0x238)]?a39_0x4049ae[_0x2037f5(0x239)]('\x20('+_0x17d37f[_0x2037f5(0x14d)][_0x2037f5(0x238)]+')'):'';return _0x2037f5(0x17b)+_0x4e30e7+'\x20'+_0x17d37f[_0x2037f5(0x238)]+_0x17f4bd;});await writeOutput(_0x3d44ec[_0x2997d7(0x1a5)]('\x0a'),_0x27c889[_0x2997d7(0x283)],_0x2997d7(0x1d7));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a39_0x1b0c43(0x238)]=a39_0x1b0c43(0x285);[a39_0x1b0c43(0x252)]=a39_0x1b0c43(0x14a);async[a39_0x1b0c43(0x260)](_0x21cf6b){const _0x146256=a39_0x1b0c43,{options:_0x450bbe,args:_0x343977,tdx:_0x506bfd}=_0x21cf6b,_0x87b045=this[_0x146256(0x242)](_0x343977,_0x450bbe);if(!_0x87b045)return 0x1;const {projectName:_0x78a8bf,workflowName:_0x142daa}=_0x87b045;if(_0x450bbe[_0x146256(0x130)]){if(_0x78a8bf&&_0x142daa)console['error']('Filter:\x20'+_0x78a8bf+'.'+_0x142daa);else _0x78a8bf&&console[_0x146256(0x280)]('Filter:\x20project='+_0x78a8bf);const _0x4c69b7=_0x450bbe[_0x146256(0x20c)];_0x4c69b7&&console[_0x146256(0x280)]('Status:\x20'+_0x4c69b7);}let _0x4f73c2=0x28;if(process[_0x146256(0x21f)][_0x146256(0x140)]&&!_0x450bbe['output']&&!_0x450bbe[_0x146256(0x210)]){const _0x1d55fc=process[_0x146256(0x21f)][_0x146256(0x18d)]||0x28;_0x4f73c2=Math[_0x146256(0x1e7)](0x14,Math[_0x146256(0x1c0)](_0x1d55fc*0x2/0x3));}const _0x189fc4=_0x450bbe[_0x146256(0x1a8)]||_0x4f73c2,_0x1ad029=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x506bfd['workflow'][_0x146256(0x10f)]({'projectName':_0x78a8bf,'workflowName':_0x142daa,'status':_0x450bbe[_0x146256(0x20c)],'fromTime':_0x450bbe[_0x146256(0x13d)],'toTime':_0x450bbe['to'],'limit':_0x189fc4}),{'verbose':_0x450bbe['verbose']}),_0x44288e=_0x1ad029[_0x146256(0x29a)];_0x44288e[_0x146256(0x150)]((_0x1009d8,_0x22fd1a)=>{const _0x291c10=_0x146256,_0xb80d5d=_0x1009d8['sessionTime']||'',_0x46a02b=_0x22fd1a[_0x291c10(0x1c8)]||'';return _0x46a02b[_0x291c10(0x291)](_0xb80d5d);});_0x44288e[_0x146256(0x21b)]>=_0x189fc4?console[_0x146256(0x280)](_0x146256(0x123)+_0x44288e[_0x146256(0x21b)]+_0x146256(0x1a1)+a39_0x4049ae[_0x146256(0x239)](_0x146256(0x1ef))):console[_0x146256(0x280)](_0x146256(0x2a6)+_0x44288e[_0x146256(0x21b)]+_0x146256(0x111)+(_0x44288e[_0x146256(0x21b)]!==0x1?'s':''));if(_0x450bbe[_0x146256(0x210)]===_0x146256(0x20b)||_0x450bbe['format']==='jsonl'||_0x450bbe[_0x146256(0x210)]===_0x146256(0x216))await handleSDKOutput(_0x44288e,_0x450bbe);else{if(!process['stdout']['isTTY']||_0x450bbe[_0x146256(0x283)]){if(_0x44288e[_0x146256(0x21b)]===0x0){if(_0x78a8bf&&_0x142daa)console['log']('No\x20sessions\x20found\x20for:\x20'+_0x78a8bf+'.'+_0x142daa);else _0x78a8bf?console[_0x146256(0x21e)](_0x146256(0x117)+_0x78a8bf):console['log'](_0x146256(0x294));}else{const _0x174af9=_0x450bbe[_0x146256(0x1cc)],_0x3b7f81=this['renderSessionsTimeline'](_0x44288e,_0x174af9);_0x450bbe[_0x146256(0x283)]?await writeOutput(_0x3b7f81,_0x450bbe[_0x146256(0x283)],'list'):console[_0x146256(0x21e)](_0x3b7f81);}!_0x78a8bf&&(console[_0x146256(0x280)](''),console['error'](a39_0x4049ae[_0x146256(0x239)](_0x146256(0x142))),console['error'](a39_0x4049ae[_0x146256(0x239)](_0x146256(0x235))+'or'+a39_0x4049ae[_0x146256(0x239)](_0x146256(0x209))));}else{if(_0x44288e['length']===0x0){if(_0x78a8bf&&_0x142daa)console[_0x146256(0x21e)]('No\x20sessions\x20found\x20for:\x20'+_0x78a8bf+'.'+_0x142daa);else _0x78a8bf?console[_0x146256(0x21e)](_0x146256(0x117)+_0x78a8bf):console[_0x146256(0x21e)]('No\x20sessions\x20found');}else await this[_0x146256(0x1e8)](_0x44288e,_0x21cf6b,_0x78a8bf);}}return 0x0;}['renderSessionsTimeline'](_0x59e567,_0x594d3d){const _0x552bfc=a39_0x1b0c43,_0x4fabdb=[],_0x5e05f4=new Map();let _0x5066ad=Infinity,_0x260d8f=-Infinity;for(const _0x24435c of _0x59e567){if(_0x24435c[_0x552bfc(0x1fc)]?.[_0x552bfc(0x17f)]){const _0x5291f0=new Date(_0x24435c['lastAttempt']['createdAt'])[_0x552bfc(0x151)](),_0x1d54be=_0x24435c['lastAttempt'][_0x552bfc(0x124)]?new Date(_0x24435c['lastAttempt'][_0x552bfc(0x124)])['getTime']():Date[_0x552bfc(0x106)](),_0x410707=_0x24435c[_0x552bfc(0x14d)]?.[_0x552bfc(0x238)]||'(unknown)';!_0x5e05f4[_0x552bfc(0x205)](_0x410707)&&_0x5e05f4[_0x552bfc(0x275)](_0x410707,[]),_0x5e05f4[_0x552bfc(0x264)](_0x410707)[_0x552bfc(0x262)]({'session':_0x24435c,'startTime':_0x5291f0,'endTime':_0x1d54be,'duration':_0x1d54be-_0x5291f0}),_0x5066ad=Math[_0x552bfc(0x16a)](_0x5066ad,_0x5291f0),_0x260d8f=Math[_0x552bfc(0x1e7)](_0x260d8f,_0x1d54be);}}if(_0x5e05f4[_0x552bfc(0x145)]===0x0)return _0x552bfc(0x1a4);const _0x407955=process['stdout'][_0x552bfc(0x200)]||0x78,_0x366423=0x1e,_0x40d76e=0x32,_0x38fdea=0x4,_0x31e7a2=Math['min'](_0x40d76e,Math[_0x552bfc(0x1e7)](_0x366423,Math[_0x552bfc(0x1c0)](_0x407955*0.3))),_0x301a5d=_0x407955-_0x31e7a2-TIMELINE_CONFIG[_0x552bfc(0x19a)]-0x3-_0x38fdea,_0x1278a4=_0x260d8f-_0x5066ad,_0x2f005d=_0x1278a4/_0x31e7a2,_0x3bfbbd=renderTimeAxis({'startTime':_0x5066ad,'endTime':_0x260d8f,'durationMs':_0x1278a4,'msPerChar':_0x2f005d},_0x31e7a2),_0x467625=[];for(const _0x1468b9 of _0x5e05f4[_0x552bfc(0x1d0)]()){_0x467625[_0x552bfc(0x262)](..._0x1468b9);}_0x467625[_0x552bfc(0x150)]((_0x548d56,_0x140758)=>_0x140758[_0x552bfc(0x192)]-_0x548d56['startTime']);const _0x13bb93=new Date(_0x5066ad),_0x30d407=formatDate(_0x13bb93),_0x1579ab=_0x38fdea+TIMELINE_CONFIG[_0x552bfc(0x1c5)]+TIMELINE_CONFIG['ICON_SPACING']+_0x301a5d,_0x3c36d3='\x20'[_0x552bfc(0x12f)](_0x1579ab-_0x30d407[_0x552bfc(0x21b)]),_0x438621=_0x3c36d3+a39_0x4049ae[_0x552bfc(0x239)](_0x30d407)+'\x20'+_0x3bfbbd;_0x4fabdb['push'](_0x438621);const _0x48d9dc=0x16;let _0x50f36f=0x0;for(const _0x5e3983 of _0x467625){const _0x405706=_0x5e3983[_0x552bfc(0x1dd)][_0x552bfc(0x14d)]?.['name']||'?',_0x11a1c6=Math[_0x552bfc(0x16a)](stringWidth(_0x405706),_0x48d9dc);_0x50f36f=Math['max'](_0x50f36f,_0x11a1c6);}for(const _0xe0966c of _0x467625){const {session:_0x38c463,startTime:_0x117f05,endTime:_0x1dddd1,duration:_0x95ee1c}=_0xe0966c,_0x5518e6=_0x38c463[_0x552bfc(0x14d)]?.['id'],_0x2b94a7=_0x38c463['id'],_0xfd8ba5=_0x38c463[_0x552bfc(0x14d)]?.[_0x552bfc(0x238)]||'?',_0x45b148=_0x38c463[_0x552bfc(0x132)]?.[_0x552bfc(0x238)]||'?';let _0x59e785,_0x445e9d;if(_0x38c463['lastAttempt']){const _0x5bd4dd=_0x38c463[_0x552bfc(0x1fc)];!_0x5bd4dd[_0x552bfc(0x20e)]?(_0x59e785=_0x5bd4dd[_0x552bfc(0x19d)]?'🛑':'🔄',_0x445e9d=_0x5bd4dd[_0x552bfc(0x19d)]?a39_0x4049ae[_0x552bfc(0x1a2)]:a39_0x4049ae['blue']):(_0x59e785=_0x5bd4dd[_0x552bfc(0x182)]?'✅':'❌',_0x445e9d=_0x5bd4dd['success']?a39_0x4049ae[_0x552bfc(0x293)]:a39_0x4049ae[_0x552bfc(0x213)]);}else _0x59e785='⏳',_0x445e9d=a39_0x4049ae['dim'];const _0x58af9a='#'+_0x2b94a7,_0x4bc869=_0x5518e6?hyperlink(_0x58af9a,getWorkflowSessionUrl(_0x594d3d,_0x5518e6,_0x2b94a7)):_0x58af9a;let _0x163f1b=_0xfd8ba5;stringWidth(_0xfd8ba5)>_0x48d9dc&&(_0x163f1b=_0xfd8ba5[_0x552bfc(0x272)](0x0,_0x48d9dc-0x1)+'…');const _0x27139a=a39_0x4049ae[_0x552bfc(0x239)](_0x163f1b),_0x5c2342=stringWidth(_0x163f1b),_0x607907='\x20'[_0x552bfc(0x12f)](_0x50f36f-stringWidth(_0x163f1b)+0x2),_0x29df20='('+formatElapsed(_0x95ee1c)+')',_0x55afa8=stringWidth(_0x29df20),_0x4d2212=stringWidth(_0x58af9a),_0x507df0=_0x4d2212+0x1+_0x5c2342+_0x607907[_0x552bfc(0x21b)],_0x366ff5=_0x301a5d-_0x507df0-_0x55afa8-0x1-0x8;let _0x48a731=_0x45b148;stringWidth(_0x48a731)>_0x366ff5&&(_0x48a731=_0x48a731['slice'](0x0,_0x366ff5-0x1)+'…');const _0x34c403=_0x4bc869+'\x20'+_0x27139a+_0x607907+_0x48a731,_0x17a824=stringWidth(_0x34c403),_0x19c901=_0x301a5d-_0x17a824-_0x55afa8,_0x4ecfc7=_0x34c403+'\x20'[_0x552bfc(0x12f)](Math['max'](0x1,_0x19c901))+a39_0x4049ae[_0x552bfc(0x239)](_0x29df20),_0x597db2=Math[_0x552bfc(0x1c0)]((_0x117f05-_0x5066ad)/_0x2f005d),_0x3682a7=Math['floor']((_0x1dddd1-_0x5066ad)/_0x2f005d),_0x33f7e3=Math['max'](_0x597db2+0x1,_0x3682a7),_0xf17d54=new Array(_0x31e7a2)[_0x552bfc(0x228)]('\x20');for(let _0x526a97=_0x597db2;_0x526a97<Math[_0x552bfc(0x16a)](_0x33f7e3,_0x31e7a2);_0x526a97++){_0xf17d54[_0x526a97]='─';}const _0x4e30ef=_0xf17d54[_0x552bfc(0x24a)](_0x49cd0f=>_0x49cd0f==='\x20'?'\x20':_0x445e9d(_0x49cd0f))[_0x552bfc(0x1a5)]('');_0x4fabdb[_0x552bfc(0x262)](_0x59e785+'\x20'+_0x4ecfc7+'│'+_0x4e30ef+'│');}return _0x4fabdb['join']('\x0a');}async['navigateSessionsInteractive'](_0xde8712,_0x5a04cd,_0x265d7b){const _0x387009=a39_0x1b0c43,{options:_0xcc83c8,tdx:_0xfa45e2}=_0x5a04cd,_0x51a59b=_0xcc83c8['site'],{timelineRows:_0x1e79c8,timeAxisHeader:_0x281225}=this[_0x387009(0x1bd)](_0xde8712,_0x51a59b),_0x5a985f=_0x1e79c8[_0x387009(0x160)](_0x1b2c1e=>_0x1b2c1e['attemptId']);if(_0x5a985f['length']===0x0){const _0xb6211a=this[_0x387009(0x171)](_0xde8712,_0x51a59b);console[_0x387009(0x21e)](_0xb6211a);!_0x265d7b&&(console['error'](''),console['error'](a39_0x4049ae[_0x387009(0x239)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x387009(0x280)](a39_0x4049ae['dim'](_0x387009(0x235))+'or'+a39_0x4049ae[_0x387009(0x239)](_0x387009(0x209))));return;}_0x281225&&console[_0x387009(0x21e)](_0x281225);const _0x336f81=_0x1e79c8[_0x387009(0x160)](_0x459f55=>_0x459f55['attemptId'])['map'](_0x5530e7=>({'title':_0x5530e7[_0x387009(0x278)],'value':_0x5530e7[_0x387009(0x126)]})),_0x4b4de7=process[_0x387009(0x21f)]['rows']||0x3c,_0x415154=Math[_0x387009(0x1e7)](0x28,Math['floor'](_0x4b4de7*0x2/0x3)),_0x1419b4=await a39_0x4a9c7f({'type':_0x387009(0x174),'name':_0x387009(0x126),'message':_0x387009(0x18f),'choices':_0x336f81,'initial':-0x1,'limit':_0x415154,'clearFirst':!![],'fallback':{'title':_0x387009(0x207),'value':null},'suggest':(_0x9cc2aa,_0x8735d9)=>{const _0x2417fb=_0x387009;if(!_0x9cc2aa)return Promise['resolve'](_0x8735d9);const _0x371ac0=_0x8735d9[_0x2417fb(0x160)](_0x533841=>{const _0x319554=_0x2417fb,_0x133cb2=_0x533841;return _0x133cb2[_0x319554(0x25c)][_0x319554(0x107)]()[_0x319554(0x14f)](_0x9cc2aa[_0x319554(0x107)]());});return Promise[_0x2417fb(0x144)](_0x371ac0);}}),_0x4dafe5=()=>{const _0x19582d=_0x387009;process[_0x19582d(0x21f)]['write'](_0x19582d(0x13e)),process[_0x19582d(0x21f)][_0x19582d(0x1de)](_0x19582d(0x13e)),process[_0x19582d(0x21f)][_0x19582d(0x1de)](_0x19582d(0x13e));},_0x40ab99=_0x1419b4&&_0x1419b4[_0x387009(0x126)]&&_0x1419b4[_0x387009(0x126)]!==null&&_0x1419b4['attemptId'][_0x387009(0x1ce)]()!=='';if(!_0x40ab99){_0x4dafe5(),console[_0x387009(0x21e)](a39_0x4049ae[_0x387009(0x239)]('Cancelled'));return;}_0x4dafe5();const _0x5ec63e=_0xde8712[_0x387009(0x1b2)](_0x5c968c=>_0x5c968c[_0x387009(0x1fc)]?.['id']===_0x1419b4[_0x387009(0x126)]);if(_0x5ec63e){const _0x430892=_0x5ec63e[_0x387009(0x14d)]?.[_0x387009(0x238)]||'?',_0x50c08d=_0x5ec63e[_0x387009(0x132)]?.['name']||'?';console['log'](_0x387009(0x2a0)+a39_0x4049ae[_0x387009(0x239)](_0x430892)+_0x387009(0x1e1)+a39_0x4049ae['dim'](_0x50c08d));}const _0x98405a=new WorkflowTimelineCommand();await _0x98405a[_0x387009(0x260)]({'args':[],'options':{..._0xcc83c8,'attemptId':_0x1419b4[_0x387009(0x126)]},'tdx':_0xfa45e2});}[a39_0x1b0c43(0x1bd)](_0x13ebc1,_0x3dd4ba){const _0x40c3a5=a39_0x1b0c43,_0x4b79ae=new Map();for(const _0x6bc8de of _0x13ebc1){_0x6bc8de['id']&&_0x6bc8de[_0x40c3a5(0x1fc)]?.['id']&&_0x4b79ae[_0x40c3a5(0x275)](_0x6bc8de['id'],_0x6bc8de[_0x40c3a5(0x1fc)]['id']);}const _0xa55042=[];let _0x4df38a='';const _0x153f65=this[_0x40c3a5(0x171)](_0x13ebc1,_0x3dd4ba),_0x52d67c=_0x153f65[_0x40c3a5(0x2a5)]('\x0a');for(const _0x3252d3 of _0x52d67c){if(_0x3252d3[_0x40c3a5(0x2a4)](_0x40c3a5(0x26f))||_0x3252d3[_0x40c3a5(0x241)](/^\s+\d{4}-\d{2}-\d{2}/))_0x4df38a=_0x3252d3;else{if(_0x3252d3['match'](/^[✅❌🔄🛑⏳]/)){const _0x36830d=_0x3252d3[_0x40c3a5(0x241)](/#(\d+)/),_0x1b20e7=_0x36830d?_0x36830d[0x1]:null,_0x4282e9=_0x1b20e7?_0x4b79ae[_0x40c3a5(0x264)](_0x1b20e7)||null:null,_0x3b82ec=_0x13ebc1['find'](_0x345db0=>_0x345db0['id']===_0x1b20e7),_0x39752f=_0x3b82ec?.[_0x40c3a5(0x14d)]?.['name']||'';_0xa55042['push']({'displayLine':_0x3252d3,'attemptId':_0x4282e9,'projectName':_0x39752f});}}}return{'timelineRows':_0xa55042,'timeAxisHeader':_0x4df38a};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a39_0x1b0c43(0x238)]=a39_0x1b0c43(0x178);[a39_0x1b0c43(0x252)]=a39_0x1b0c43(0x1ee);async[a39_0x1b0c43(0x260)](_0x3f3338){const _0x3f4860=a39_0x1b0c43,{options:_0x5741ee,args:_0x1e0278,tdx:_0x53b3fa}=_0x3f3338,_0x156a0e=this[_0x3f4860(0x242)](_0x1e0278,_0x5741ee);if(!_0x156a0e)return 0x1;const {projectName:_0x1818c8,workflowName:_0x28a937}=_0x156a0e,_0x4653ac=_0x5741ee[_0x3f4860(0x28a)];if(_0x5741ee[_0x3f4860(0x130)]){if(_0x1818c8&&_0x28a937)console[_0x3f4860(0x280)](_0x3f4860(0x25f)+_0x1818c8+'.'+_0x28a937);else _0x1818c8&&console['error'](_0x3f4860(0x292)+_0x1818c8);_0x4653ac&&console[_0x3f4860(0x280)](_0x3f4860(0x223));}const _0xc24ff4=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x53b3fa['workflow']['attempts']({'projectName':_0x1818c8,'workflowName':_0x28a937,'includeRetried':_0x4653ac,'limit':_0x5741ee[_0x3f4860(0x1a8)]}),{'verbose':_0x5741ee[_0x3f4860(0x130)]}),_0x3b6308=_0xc24ff4[_0x3f4860(0x29a)],_0x57fa52=_0x5741ee[_0x3f4860(0x1a8)]||0x64,_0x4fd4f6=_0x3b6308[_0x3f4860(0x21b)]>=_0x57fa52?a39_0x4049ae[_0x3f4860(0x239)](_0x3f4860(0x191)):'';console[_0x3f4860(0x280)](_0x3f4860(0x2a6)+_0x3b6308[_0x3f4860(0x21b)]+_0x3f4860(0x11c)+(_0x3b6308[_0x3f4860(0x21b)]!==0x1?'s':'')+_0x4fd4f6);if(_0x5741ee['format']==='json'||_0x5741ee[_0x3f4860(0x210)]===_0x3f4860(0x24b)||_0x5741ee['format']===_0x3f4860(0x216))await handleSDKOutput(_0x3b6308,_0x5741ee);else{if(_0x3b6308[_0x3f4860(0x21b)]===0x0){if(_0x1818c8&&_0x28a937)console[_0x3f4860(0x21e)]('No\x20attempts\x20found\x20for:\x20'+_0x1818c8+'.'+_0x28a937);else _0x1818c8?console['log'](_0x3f4860(0x284)+_0x1818c8):console[_0x3f4860(0x21e)](_0x3f4860(0x1bf));}else{const _0x3ddb7d=_0x5741ee[_0x3f4860(0x1cc)],_0x4036cd=_0x3b6308[_0x3f4860(0x24a)](_0x49f9db=>{const _0x45f5ce=_0x3f4860,_0x227f8a=a39_0x4049ae[_0x45f5ce(0x239)]('#'+_0x49f9db['id']),_0x40ce2c=_0x49f9db[_0x45f5ce(0x14d)]?.['id'],_0x370d84=_0x49f9db[_0x45f5ce(0x208)]||_0x49f9db[_0x45f5ce(0x1b5)],_0xd98647=_0x40ce2c&&_0x370d84?hyperlink(_0x227f8a,getWorkflowAttemptUrl(_0x3ddb7d,_0x40ce2c,_0x370d84,_0x49f9db['id'])):_0x227f8a,{icon:_0x585de4,text:_0x4af103}=getAttemptStatusDisplay(_0x49f9db),_0x38d7ce=(_0x49f9db[_0x45f5ce(0x14d)]?.[_0x45f5ce(0x238)]||'?')+'.'+(_0x49f9db[_0x45f5ce(0x132)]?.[_0x45f5ce(0x238)]||'?'),_0xd8f94b=_0x49f9db[_0x45f5ce(0x1c8)]?a39_0x4049ae[_0x45f5ce(0x239)](_0x49f9db['sessionTime']):'';return(_0xd98647+'\x20'+_0x585de4+(_0x4af103?'\x20'+_0x4af103:'')+'\x20'+_0x38d7ce+'\x20'+_0xd8f94b)['trimEnd']();});await writeOutput(_0x4036cd[_0x3f4860(0x1a5)]('\x0a'),_0x5741ee['output'],_0x3f4860(0x1d7));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']='workflow:attempt';[a39_0x1b0c43(0x252)]=a39_0x1b0c43(0x220);async[a39_0x1b0c43(0x260)](_0xf3ba0f){const _0x211d24=a39_0x1b0c43,{options:_0x116272,args:_0x5654ea,tdx:_0x32b25f}=_0xf3ba0f,_0x7fca3f=_0x5654ea[0x0];if(!_0x7fca3f)return console['error'](_0x211d24(0x1fe)),0x1;_0x116272[_0x211d24(0x130)]&&console['error']('Attempt\x20ID:\x20'+_0x7fca3f);const _0x5839dd=await withSpinner(_0x211d24(0x1a7),()=>_0x32b25f[_0x211d24(0x132)][_0x211d24(0x17e)](_0x7fca3f),{'verbose':_0x116272['verbose']}),_0x206baf=_0x5839dd[_0x211d24(0x29a)];let _0x46cb7a;!_0x206baf[_0x211d24(0x20e)]?_0x46cb7a=_0x206baf[_0x211d24(0x19d)]?'canceling':_0x211d24(0x1b7):_0x46cb7a=_0x206baf['success']?_0x211d24(0x182):'error';let _0x536e75;if(_0x206baf[_0x211d24(0x17f)]&&_0x206baf[_0x211d24(0x124)]){const _0x538231=new Date(_0x206baf[_0x211d24(0x17f)])['getTime'](),_0x347322=new Date(_0x206baf[_0x211d24(0x124)])['getTime']();_0x536e75=Math[_0x211d24(0x11a)]((_0x347322-_0x538231)/0x3e8);}const _0x13b5a2={'attempt_id':_0x206baf['id'],'status':_0x46cb7a,..._0x206baf[_0x211d24(0x29b)]!==undefined&&{'index':_0x206baf['index']},..._0x206baf[_0x211d24(0x14d)]&&{'project':_0x206baf[_0x211d24(0x14d)][_0x211d24(0x238)]},..._0x206baf[_0x211d24(0x132)]&&{'workflow':_0x206baf['workflow'][_0x211d24(0x238)]},..._0x206baf['sessionId']&&{'session_id':_0x206baf[_0x211d24(0x1b5)]},..._0x206baf[_0x211d24(0x1c8)]&&{'session_time':_0x206baf['sessionTime']},..._0x206baf['retryAttemptName']&&{'retry_attempt':_0x206baf['retryAttemptName']},..._0x536e75!==undefined&&{'duration_sec':_0x536e75},..._0x206baf[_0x211d24(0x17f)]&&{'created_at':_0x206baf[_0x211d24(0x17f)]},..._0x206baf[_0x211d24(0x124)]&&{'finished_at':_0x206baf[_0x211d24(0x124)]},...Object['keys'](_0x206baf[_0x211d24(0x16c)])['length']>0x0&&{'params':_0x206baf[_0x211d24(0x16c)]}};return await handleSingleObjectOutput(_0x13b5a2,_0x116272),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a39_0x1b0c43(0x238)]=a39_0x1b0c43(0x100);[a39_0x1b0c43(0x252)]=a39_0x1b0c43(0x202);async[a39_0x1b0c43(0x260)](_0x13174c){const _0x14cabe=a39_0x1b0c43,{options:_0x9ebf54,args:_0x21e817,tdx:_0x524c7a}=_0x13174c,_0xa20654=_0x21e817[0x0];if(!_0xa20654)return console['error'](_0x14cabe(0x1fe)),0x1;const _0x1e823a=_0x9ebf54['includeSubtasks'];_0x9ebf54[_0x14cabe(0x130)]&&(console[_0x14cabe(0x280)](_0x14cabe(0x1b8)+_0xa20654),_0x1e823a&&console[_0x14cabe(0x280)](_0x14cabe(0x125)));const _0x26d6e9=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x524c7a[_0x14cabe(0x132)][_0x14cabe(0x159)](_0xa20654,_0x1e823a||![]),{'verbose':_0x9ebf54[_0x14cabe(0x130)]}),_0x57f5f3=_0x26d6e9[_0x14cabe(0x29a)];return console[_0x14cabe(0x280)](_0x14cabe(0x2a6)+_0x57f5f3[_0x14cabe(0x21b)]+_0x14cabe(0x1b0)+(_0x57f5f3[_0x14cabe(0x21b)]!==0x1?'s':'')),await handleSDKOutput(_0x57f5f3,_0x9ebf54),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a39_0x1b0c43(0x289);[a39_0x1b0c43(0x252)]=a39_0x1b0c43(0x18b);async['execute'](_0x5adf19){const _0x35a8c0=a39_0x1b0c43,{options:_0x185d45,args:_0x34135a,tdx:_0x5c64c2}=_0x5adf19,_0x49148c=_0x34135a[0x0];let _0x1fc212=_0x34135a[0x1];if(!_0x49148c)return console[_0x35a8c0(0x280)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x185d45[_0x35a8c0(0x130)]&&(console[_0x35a8c0(0x280)](_0x35a8c0(0x1b8)+_0x49148c),_0x1fc212&&console[_0x35a8c0(0x280)](_0x35a8c0(0x253)+_0x1fc212));const _0x8c9b1f=await withSpinner(_0x35a8c0(0x27e),()=>_0x5c64c2[_0x35a8c0(0x132)][_0x35a8c0(0x215)](_0x49148c,_0x1fc212),{'verbose':_0x185d45[_0x35a8c0(0x130)]}),_0x506ace=_0x8c9b1f[_0x35a8c0(0x29a)];if(_0x506ace['length']===0x0)return console[_0x35a8c0(0x280)](_0x35a8c0(0x1f5)),0x0;if(!_0x1fc212&&(_0x185d45['json']||_0x185d45[_0x35a8c0(0x210)]))return await handleSDKOutput(_0x506ace,_0x185d45),0x0;if(!_0x1fc212){const _0x520748=_0x506ace[_0x35a8c0(0x24a)](_0x3e8d9e=>({'title':_0x3e8d9e['taskName']+'\x20('+formatBytes(_0x3e8d9e['fileSize'])+')','value':_0x3e8d9e['taskName']})),_0x3b4e89=await a39_0x4a9c7f({'type':_0x35a8c0(0x170),'name':_0x35a8c0(0xfe),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x520748});if(!_0x3b4e89[_0x35a8c0(0xfe)])return console[_0x35a8c0(0x280)](_0x35a8c0(0x232)),0x0;_0x1fc212=_0x3b4e89[_0x35a8c0(0xfe)];}const _0x495872=await withSpinner('Downloading\x20logs...',()=>_0x5c64c2[_0x35a8c0(0x132)]['logs'](_0x49148c,_0x1fc212),{'verbose':_0x185d45['verbose']}),_0x1715ab=_0x495872['data'];return _0x1715ab?console[_0x35a8c0(0x21e)](_0x1715ab):console[_0x35a8c0(0x280)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a39_0x1b0c43(0x238)]=a39_0x1b0c43(0x10d);[a39_0x1b0c43(0x252)]=a39_0x1b0c43(0x173);async[a39_0x1b0c43(0x260)](_0x22a5d4){const _0x4f92a1=a39_0x1b0c43,{options:_0x190858,args:_0x473287,tdx:_0x121da2}=_0x22a5d4,_0x68ed46=_0x473287[0x0];if(!_0x68ed46)return console[_0x4f92a1(0x280)](_0x4f92a1(0x1fe)),0x1;const _0x332649=_0x190858['reason'];_0x190858[_0x4f92a1(0x130)]&&(console[_0x4f92a1(0x280)](_0x4f92a1(0x1b8)+_0x68ed46),_0x332649&&console['error'](_0x4f92a1(0x274)+_0x332649));if(!_0x190858[_0x4f92a1(0x180)]){const _0x156810=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x68ed46+'?');if(!_0x156810)return console[_0x4f92a1(0x280)](_0x4f92a1(0x232)),0x0;}const _0x29bee2=await withSpinner(_0x4f92a1(0x27d),()=>_0x121da2[_0x4f92a1(0x132)][_0x4f92a1(0x297)](_0x68ed46,_0x332649),{'verbose':_0x190858[_0x4f92a1(0x130)]}),_0x3fd1fc=_0x29bee2['data'];return console[_0x4f92a1(0x280)]('✔\x20'+_0x3fd1fc),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']='workflow:retry';['description']='Retry\x20a\x20session\x20or\x20attempt';async[a39_0x1b0c43(0x260)](_0x25456f){const _0x59f41a=a39_0x1b0c43,{options:_0x380028,args:_0x2464b5,tdx:_0x3338b8}=_0x25456f,_0x5361ee=_0x2464b5[0x0];if(!_0x5361ee)return console['error'](_0x59f41a(0x184)),console[_0x59f41a(0x280)](_0x59f41a(0x153)),0x1;let _0x23ff09=![],_0x606b5a=_0x5361ee;if(_0x5361ee['startsWith'](_0x59f41a(0x29d)))_0x23ff09=!![],_0x606b5a=_0x5361ee[_0x59f41a(0x23c)](0x8);else{if(_0x5361ee[_0x59f41a(0x2a4)](_0x59f41a(0x212)))_0x23ff09=![],_0x606b5a=_0x5361ee['substring'](0x8);else return console[_0x59f41a(0x280)](_0x59f41a(0x15b)),console['error'](_0x59f41a(0x153)),0x1;}const _0x49a800=_0x380028[_0x59f41a(0x225)],_0x2ee911=_0x380028[_0x59f41a(0x1ed)],_0x15afec=_0x380028['params'],_0x1d8701=_0x380028[_0x59f41a(0x270)];_0x380028[_0x59f41a(0x130)]&&(console[_0x59f41a(0x280)](_0x59f41a(0x236)+(_0x23ff09?_0x59f41a(0x1dd):'attempt')+'\x20'+_0x606b5a),_0x49a800&&console['error'](_0x59f41a(0x1d3)+_0x49a800),_0x2ee911&&console['error']('Resume\x20from:\x20'+_0x2ee911),_0x15afec&&console[_0x59f41a(0x280)]('Params:\x20'+_0x15afec),_0x1d8701&&console[_0x59f41a(0x280)](_0x59f41a(0x1b4)));let _0x44cad3;if(_0x15afec)try{if(_0x15afec[_0x59f41a(0x2a4)]('@')){const _0x3a3d84=await import(_0x59f41a(0x167)),_0x28cbe6=_0x15afec['substring'](0x1),_0x1176ad=await _0x3a3d84[_0x59f41a(0x1e6)](_0x28cbe6,_0x59f41a(0x1dc));_0x44cad3=JSON[_0x59f41a(0x247)](_0x1176ad);}else _0x44cad3=JSON[_0x59f41a(0x247)](_0x15afec);}catch{return console[_0x59f41a(0x280)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x380028['yes']){const _0x204c39=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x23ff09?_0x59f41a(0x1dd):_0x59f41a(0x17e))+'\x20'+_0x606b5a+'?');if(!_0x204c39)return console[_0x59f41a(0x280)](_0x59f41a(0x232)),0x0;}let _0x389e0d;_0x23ff09?_0x389e0d=await withSpinner(_0x59f41a(0x198),()=>_0x3338b8[_0x59f41a(0x132)]['retrySession'](_0x606b5a,{'fromTask':_0x49a800,'retryParams':_0x44cad3}),{'verbose':_0x380028['verbose']}):_0x389e0d=await withSpinner(_0x59f41a(0x261),()=>_0x3338b8[_0x59f41a(0x132)]['retryAttempt'](_0x606b5a,{'resumeFrom':_0x2ee911,'retryParams':_0x44cad3,'force':_0x1d8701}),{'verbose':_0x380028[_0x59f41a(0x130)]});const _0x1a29a1=_0x389e0d[_0x59f41a(0x29a)];return console[_0x59f41a(0x280)]('✔\x20Retry\x20started'),console[_0x59f41a(0x280)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x1a29a1[_0x59f41a(0x126)]),console[_0x59f41a(0x280)](_0x59f41a(0x221)+_0x1a29a1['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a39_0x1b0c43(0x238)]='workflow:run';[a39_0x1b0c43(0x252)]=a39_0x1b0c43(0x1b3);async['execute'](_0x2a0e59){const _0x5b1eb9=a39_0x1b0c43,{options:_0x12100f,args:_0x2dd247,tdx:_0x1babc1}=_0x2a0e59;let _0x508267=_0x2dd247[0x0];if(!_0x508267){const _0x483e44=this[_0x5b1eb9(0x115)]([],_0x12100f),_0x3da9f5=await withSpinner(_0x5b1eb9(0x113),()=>_0x1babc1['workflow']['workflows'](_0x483e44,{'limit':_0x12100f['limit']}),{'verbose':_0x12100f[_0x5b1eb9(0x130)]}),_0x5aa4b7=_0x3da9f5[_0x5b1eb9(0x29a)];if(_0x5aa4b7[_0x5b1eb9(0x21b)]===0x0)return console[_0x5b1eb9(0x280)]('No\x20workflows\x20found'),!_0x483e44&&console[_0x5b1eb9(0x280)](a39_0x4049ae[_0x5b1eb9(0x239)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x27f47c=_0x5aa4b7[_0x5b1eb9(0x24a)](_0x3bf17e=>({'title':_0x3bf17e[_0x5b1eb9(0x14d)]?.['name']+'.'+_0x3bf17e[_0x5b1eb9(0x238)],'value':_0x3bf17e[_0x5b1eb9(0x14d)]?.[_0x5b1eb9(0x238)]+'.'+_0x3bf17e['name'],'description':_0x3bf17e[_0x5b1eb9(0x15a)]?_0x5b1eb9(0x116)+_0x3bf17e[_0x5b1eb9(0x15a)]:undefined})),_0x2f0954=await a39_0x4a9c7f({'type':_0x5b1eb9(0x170),'name':_0x5b1eb9(0x132),'message':_0x5b1eb9(0x246),'choices':_0x27f47c});if(!_0x2f0954[_0x5b1eb9(0x132)])return 0x1;_0x508267=_0x2f0954[_0x5b1eb9(0x132)];}if(!_0x508267[_0x5b1eb9(0x14f)]('.')){const _0x3f0b19=this[_0x5b1eb9(0x115)]([],_0x12100f);if(_0x3f0b19)_0x508267=_0x3f0b19+'.'+_0x508267;else return console[_0x5b1eb9(0x280)](a39_0x4049ae['red'](_0x5b1eb9(0x12a)),_0x5b1eb9(0x190)),console[_0x5b1eb9(0x280)](a39_0x4049ae[_0x5b1eb9(0x239)](_0x5b1eb9(0x15c))),0x1;}const _0x2b0a82=_0x12100f[_0x5b1eb9(0x229)],_0x10f600=_0x12100f[_0x5b1eb9(0x1c8)],_0x1e7c08={};if(_0x2b0a82&&Array['isArray'](_0x2b0a82))for(const _0x341946 of _0x2b0a82){const _0x268685=_0x341946['indexOf']('=');if(_0x268685===-0x1)return console['error']('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x341946),console[_0x5b1eb9(0x280)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x2e4507=_0x341946['substring'](0x0,_0x268685),_0x1654d4=_0x341946['substring'](_0x268685+0x1);try{_0x1e7c08[_0x2e4507]=JSON['parse'](_0x1654d4);}catch{_0x1e7c08[_0x2e4507]=_0x1654d4;}}_0x12100f[_0x5b1eb9(0x130)]&&(console[_0x5b1eb9(0x280)](_0x5b1eb9(0x134)+_0x508267),Object[_0x5b1eb9(0x143)](_0x1e7c08)[_0x5b1eb9(0x21b)]>0x0&&console[_0x5b1eb9(0x280)](_0x5b1eb9(0x1aa)+JSON[_0x5b1eb9(0x2a1)](_0x1e7c08)),_0x10f600&&console[_0x5b1eb9(0x280)](_0x5b1eb9(0x211)+_0x10f600));const _0x1b58e1=await withSpinner('Starting\x20workflow\x20run...',()=>_0x1babc1[_0x5b1eb9(0x132)][_0x5b1eb9(0x230)](_0x508267,_0x1e7c08,{'sessionTime':_0x10f600}),{'verbose':_0x12100f[_0x5b1eb9(0x130)]}),_0x1ffc8a=_0x1b58e1[_0x5b1eb9(0x29a)];console[_0x5b1eb9(0x280)](_0x5b1eb9(0x266)),console[_0x5b1eb9(0x280)](_0x5b1eb9(0x11d)+_0x1ffc8a['id']),console['error']('\x20\x20Session\x20ID:\x20'+_0x1ffc8a[_0x5b1eb9(0x1b5)]),console[_0x5b1eb9(0x280)]('\x20\x20Project:\x20'+_0x1ffc8a[_0x5b1eb9(0x14d)]?.['name']),console['error'](_0x5b1eb9(0x181)+_0x1ffc8a[_0x5b1eb9(0x132)]?.[_0x5b1eb9(0x238)]);if(_0x1ffc8a['project']?.['id']&&_0x1ffc8a['sessionId']&&_0x1ffc8a['id']){const _0x340835=_0x12100f[_0x5b1eb9(0x1cc)],_0x4ab95e=getConsoleUrl(_0x340835,_0x5b1eb9(0x218)+_0x1ffc8a[_0x5b1eb9(0x14d)]['id']+_0x5b1eb9(0x189)+_0x1ffc8a[_0x5b1eb9(0x1b5)]+_0x5b1eb9(0xfd)+_0x1ffc8a['id']);console[_0x5b1eb9(0x280)]('\x20\x20Console:\x20'+a39_0x4049ae['cyan'](_0x4ab95e));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a39_0x1b0c43(0x238)]=a39_0x1b0c43(0x10c);[a39_0x1b0c43(0x252)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a39_0x1b0c43(0x260)](_0x3a7dac){const _0x5d4e69=a39_0x1b0c43,{options:_0x2a23f2,args:_0x5cc325,tdx:_0x44f142}=_0x3a7dac,_0x4803ac=_0x5cc325[0x0],_0x59bdbb=_0x5cc325[0x1]||'.';if(!_0x4803ac)return console[_0x5d4e69(0x280)](_0x5d4e69(0x1c7)),console[_0x5d4e69(0x280)](_0x5d4e69(0x16d)),0x1;const _0x3f1e71=_0x2a23f2[_0x5d4e69(0x15a)];_0x2a23f2[_0x5d4e69(0x130)]&&(console[_0x5d4e69(0x280)]('Project:\x20'+_0x4803ac),console[_0x5d4e69(0x280)](_0x5d4e69(0x1ab)+_0x59bdbb),_0x3f1e71&&console[_0x5d4e69(0x280)](_0x5d4e69(0x13f)+_0x3f1e71));const _0x563b97=await withSpinner(_0x5d4e69(0x1fd)+_0x4803ac+_0x5d4e69(0x29f),()=>_0x44f142[_0x5d4e69(0x132)][_0x5d4e69(0x1b6)](_0x4803ac,_0x59bdbb,{'revision':_0x3f1e71}),{'verbose':_0x2a23f2[_0x5d4e69(0x130)]}),_0x4dd655=_0x563b97[_0x5d4e69(0x29a)];return console[_0x5d4e69(0x280)]('✔\x20Downloaded\x20'+_0x4dd655['projectName']),console[_0x5d4e69(0x280)]('\x20\x20Revision:\x20'+_0x4dd655[_0x5d4e69(0x15a)]),console[_0x5d4e69(0x280)](_0x5d4e69(0x222)+_0x4dd655[_0x5d4e69(0x14c)]),console[_0x5d4e69(0x280)](_0x5d4e69(0x217)+_0x59bdbb+'/'+_0x4dd655['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a39_0x1b0c43(0x238)]=a39_0x1b0c43(0x1f0);[a39_0x1b0c43(0x252)]=a39_0x1b0c43(0x16e);async[a39_0x1b0c43(0x260)](_0x576a3e){const _0x518a56=a39_0x1b0c43,{options:_0x284e08,args:_0x4f334f,tdx:_0x1451f7}=_0x576a3e;let _0x27cb46='.',_0x2a1afa=_0x284e08[_0x518a56(0x238)];if(_0x4f334f[0x0]){const {promises:_0x1c6256}=await import('fs');try{const _0x1b92f4=await _0x1c6256[_0x518a56(0x28e)](_0x4f334f[0x0]);if(_0x1b92f4['isDirectory']())_0x27cb46=_0x4f334f[0x0];else return console[_0x518a56(0x280)](_0x518a56(0x20a)+_0x4f334f[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x2a1afa=_0x4f334f[0x0],_0x27cb46='.';}}const _0xcb822f=_0x284e08['revision'],_0x1be940=_0x284e08['skipValidation'];_0x284e08[_0x518a56(0x130)]&&(console[_0x518a56(0x280)](_0x518a56(0x1fa)+_0x27cb46),_0x2a1afa&&console[_0x518a56(0x280)](_0x518a56(0x28f)+_0x2a1afa),_0xcb822f&&console[_0x518a56(0x280)](_0x518a56(0x13f)+_0xcb822f),_0x1be940&&console[_0x518a56(0x280)](_0x518a56(0x2a2)));const _0x9cebc=await withSpinner(_0x518a56(0x119),()=>_0x1451f7[_0x518a56(0x132)][_0x518a56(0x262)](_0x27cb46,{'projectName':_0x2a1afa,'revision':_0xcb822f,'skipValidation':_0x1be940}),{'verbose':_0x284e08[_0x518a56(0x130)]}),_0x10cb72=_0x9cebc[_0x518a56(0x29a)];return console['error'](_0x518a56(0x22c)+_0x10cb72[_0x518a56(0x183)]),console['error'](_0x518a56(0x26c)+_0x10cb72[_0x518a56(0x26b)]),console[_0x518a56(0x280)]('\x20\x20Revision:\x20'+_0x10cb72[_0x518a56(0x15a)]),await this[_0x518a56(0x199)](_0x1451f7,_0x10cb72[_0x518a56(0x183)],_0x284e08[_0x518a56(0x1cc)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a39_0x1b0c43(0x238)]=a39_0x1b0c43(0x139);['description']=a39_0x1b0c43(0x29c);async['execute'](_0x3e3cad){const _0x48c68a=a39_0x1b0c43,{options:_0x5862d9,args:_0x2c754c,tdx:_0x16c082}=_0x3e3cad,_0x2ce2f2=_0x2c754c[0x0],_0x48cd07=_0x2c754c[0x1];if(!_0x2ce2f2)return console[_0x48c68a(0x280)](a39_0x4049ae['red'](_0x48c68a(0x12a)),_0x48c68a(0x16f)),console[_0x48c68a(0x280)](a39_0x4049ae[_0x48c68a(0x239)](_0x48c68a(0x237))),0x1;const _0x36cb2d=_0x5862d9[_0x48c68a(0x15a)];_0x5862d9[_0x48c68a(0x130)]&&(console[_0x48c68a(0x280)](_0x48c68a(0x2a0)+_0x2ce2f2),_0x48cd07&&console['error'](_0x48c68a(0x259)+_0x48cd07),_0x36cb2d&&console['error'](_0x48c68a(0x13f)+_0x36cb2d),_0x5862d9['dryRun']&&console[_0x48c68a(0x280)](_0x48c68a(0x1c9)));const _0x19201a=await withSpinner(_0x48c68a(0x248)+_0x2ce2f2+_0x48c68a(0x29f),()=>_0x16c082['workflow'][_0x48c68a(0x175)](_0x2ce2f2,{'targetDir':_0x48cd07,'revision':_0x36cb2d}),{'verbose':_0x5862d9[_0x48c68a(0x130)]}),_0x4df355=_0x19201a[_0x48c68a(0x29a)];_0x4df355[_0x48c68a(0x163)]?console[_0x48c68a(0x280)](_0x48c68a(0x25b)+_0x4df355[_0x48c68a(0x183)]):console[_0x48c68a(0x280)]('✔\x20Project:\x20'+_0x4df355[_0x48c68a(0x183)]);console[_0x48c68a(0x280)](_0x48c68a(0x136)+_0x4df355[_0x48c68a(0x15a)]),console['error'](_0x48c68a(0x279)+(a39_0x613a32[_0x48c68a(0x1e3)](process['cwd'](),_0x4df355[_0x48c68a(0x1d4)])||'.')),console['error'](_0x48c68a(0x1c2)+a39_0x4049ae[_0x48c68a(0x293)]('+'+_0x4df355[_0x48c68a(0x103)]['new']+_0x48c68a(0x1b9))+',\x20'+(a39_0x4049ae[_0x48c68a(0x1a2)]('~'+_0x4df355[_0x48c68a(0x103)][_0x48c68a(0x19c)]+_0x48c68a(0x156))+',\x20')+(a39_0x4049ae['red']('-'+_0x4df355[_0x48c68a(0x103)][_0x48c68a(0x1d1)]+'\x20deleted')+',\x20')+(''+a39_0x4049ae['dim'](_0x4df355[_0x48c68a(0x103)][_0x48c68a(0x27a)]+_0x48c68a(0x187))));for(const _0x19f44b of _0x4df355['changes']){_0x19f44b['type']===_0x48c68a(0x19c)&&_0x19f44b[_0x48c68a(0x206)]&&(console[_0x48c68a(0x280)]('\x0a'+a39_0x4049ae[_0x48c68a(0x22b)](_0x48c68a(0x13a)+_0x19f44b[_0x48c68a(0x1bb)])),console['error'](_0x19f44b['diff']));}if(!_0x4df355[_0x48c68a(0x1d8)])return saveSessionContext({'workflow_project':_0x4df355[_0x48c68a(0x183)]},_0x5862d9[_0x48c68a(0x1dd)]),console['error'](a39_0x4049ae[_0x48c68a(0x293)](_0x48c68a(0x201))),console[_0x48c68a(0x280)](a39_0x4049ae[_0x48c68a(0x239)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x4df355[_0x48c68a(0x183)])),0x0;if(_0x5862d9[_0x48c68a(0x1a6)])return console[_0x48c68a(0x280)](a39_0x4049ae['yellow'](_0x48c68a(0x295))),0x0;if(!_0x5862d9[_0x48c68a(0x180)]){const _0x28a4e2=await confirmKey(_0x48c68a(0x22e));if(!_0x28a4e2)return console['error']('Cancelled'),0x0;}await withSpinner(_0x48c68a(0x256),()=>_0x16c082['workflow'][_0x48c68a(0x129)](_0x4df355,{'revision':_0x36cb2d}),{'verbose':_0x5862d9[_0x48c68a(0x130)]}),saveSessionContext({'workflow_project':_0x4df355[_0x48c68a(0x183)]},_0x5862d9['session']),console['error'](a39_0x4049ae[_0x48c68a(0x293)](_0x48c68a(0x168)));const _0x38203e=a39_0x613a32[_0x48c68a(0x1e3)](process[_0x48c68a(0x1e2)](),_0x4df355[_0x48c68a(0x1d4)])||'.';return console[_0x48c68a(0x280)](a39_0x4049ae['dim'](_0x48c68a(0x217)+_0x38203e)),console['error'](a39_0x4049ae[_0x48c68a(0x239)](_0x48c68a(0x1da)+_0x4df355[_0x48c68a(0x183)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a39_0x1b0c43(0x238)]=a39_0x1b0c43(0x109);['description']='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async[a39_0x1b0c43(0x260)](_0x26347d){const _0x5f0e86=a39_0x1b0c43,{options:_0x289330,args:_0x28ff89,tdx:_0x2ec63a}=_0x26347d,_0x1ea406=this['resolveProjectDir'](_0x28ff89,_0x289330),_0x32f631=_0x289330[_0x5f0e86(0x15a)],_0x357d1e=_0x289330[_0x5f0e86(0x19e)];_0x289330['verbose']&&(_0x1ea406&&console[_0x5f0e86(0x280)](_0x5f0e86(0x290)+_0x1ea406),_0x32f631&&console[_0x5f0e86(0x280)](_0x5f0e86(0x13f)+_0x32f631),_0x289330[_0x5f0e86(0x1a6)]&&console[_0x5f0e86(0x280)](_0x5f0e86(0x1c9)),_0x357d1e&&console['error'](_0x5f0e86(0x2a2)));let _0x18f0ad;try{_0x18f0ad=await withSpinner('Analyzing\x20changes...',()=>_0x2ec63a[_0x5f0e86(0x132)][_0x5f0e86(0x162)]({'sourceDir':_0x1ea406,'revision':_0x32f631,'skipValidation':_0x357d1e}),{'verbose':_0x289330['verbose']});}catch(_0x168f92){if(_0x168f92 instanceof Error&&_0x168f92['message'][_0x5f0e86(0x14f)](_0x5f0e86(0x214)))return console[_0x5f0e86(0x280)](a39_0x4049ae[_0x5f0e86(0x213)]('Error:'),_0x5f0e86(0x254)),_0x289330['workflowProject']?console[_0x5f0e86(0x280)](a39_0x4049ae['dim'](_0x5f0e86(0x114)+_0x289330[_0x5f0e86(0x110)]+_0x5f0e86(0x1be)+_0x289330[_0x5f0e86(0x110)]+'\x27')):console[_0x5f0e86(0x280)](a39_0x4049ae['dim'](_0x5f0e86(0x22f))),0x1;throw _0x168f92;}const _0x2b0b95=_0x18f0ad[_0x5f0e86(0x29a)];console[_0x5f0e86(0x280)](_0x5f0e86(0x18e)+_0x2b0b95[_0x5f0e86(0x183)]),console['error'](_0x5f0e86(0x149)+_0x2b0b95[_0x5f0e86(0x1f7)]),console['error'](_0x5f0e86(0x136)+_0x2b0b95[_0x5f0e86(0x15a)]),console[_0x5f0e86(0x280)](_0x5f0e86(0x1c2)+a39_0x4049ae[_0x5f0e86(0x293)]('+'+_0x2b0b95[_0x5f0e86(0x103)][_0x5f0e86(0x11f)]+_0x5f0e86(0x1b9))+',\x20'+(a39_0x4049ae['yellow']('~'+_0x2b0b95[_0x5f0e86(0x103)][_0x5f0e86(0x19c)]+_0x5f0e86(0x156))+',\x20')+(a39_0x4049ae[_0x5f0e86(0x213)]('-'+_0x2b0b95[_0x5f0e86(0x103)][_0x5f0e86(0x1d1)]+_0x5f0e86(0x25e))+',\x20')+(''+a39_0x4049ae[_0x5f0e86(0x239)](_0x2b0b95[_0x5f0e86(0x103)][_0x5f0e86(0x27a)]+_0x5f0e86(0x187))));for(const _0x1d5a51 of _0x2b0b95[_0x5f0e86(0x17c)]){_0x1d5a51[_0x5f0e86(0x240)]===_0x5f0e86(0x19c)&&_0x1d5a51[_0x5f0e86(0x206)]&&(console['error']('\x0a'+a39_0x4049ae['cyan']('---\x20'+_0x1d5a51['path'])),console[_0x5f0e86(0x280)](_0x1d5a51[_0x5f0e86(0x206)]));}if(!_0x2b0b95['hasChanges'])return console[_0x5f0e86(0x280)](a39_0x4049ae[_0x5f0e86(0x293)](_0x5f0e86(0x10e))),await this['showWorkflowConsoleUrl'](_0x2ec63a,_0x2b0b95['projectName'],_0x289330[_0x5f0e86(0x1cc)]),0x0;if(_0x289330[_0x5f0e86(0x1a6)])return console[_0x5f0e86(0x280)](a39_0x4049ae['yellow'](_0x5f0e86(0x233))),0x0;if(!_0x289330[_0x5f0e86(0x180)]){const _0x28ed08=await confirmKey(_0x5f0e86(0x141));if(!_0x28ed08)return console[_0x5f0e86(0x280)](_0x5f0e86(0x232)),0x0;}const _0x506ffc=await withSpinner('Pushing\x20project...',()=>_0x2ec63a[_0x5f0e86(0x132)]['executePushProject'](_0x2b0b95),{'verbose':_0x289330[_0x5f0e86(0x130)]}),_0x3a2d19=_0x506ffc['data'];return console[_0x5f0e86(0x280)](a39_0x4049ae[_0x5f0e86(0x293)](_0x5f0e86(0x277))),console['error'](_0x5f0e86(0x26c)+_0x3a2d19['projectId']),console[_0x5f0e86(0x280)](_0x5f0e86(0x136)+_0x3a2d19['revision']),await this[_0x5f0e86(0x199)](_0x2ec63a,_0x3a2d19[_0x5f0e86(0x183)],_0x289330[_0x5f0e86(0x1cc)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a39_0x1b0c43(0x238)]=a39_0x1b0c43(0x21c);[a39_0x1b0c43(0x252)]=a39_0x1b0c43(0x1d2);async[a39_0x1b0c43(0x260)](_0x23a2f8){const _0x1f11f7=a39_0x1b0c43,{options:_0x29a820,args:_0x5cf12e,tdx:_0x5002b8}=_0x23a2f8,_0x393792=this[_0x1f11f7(0x23b)](_0x5cf12e,_0x29a820),_0x2083d8=_0x29a820['name'],_0x1551eb=_0x29a820[_0x1f11f7(0x15a)],_0x3c9757=_0x29a820[_0x1f11f7(0x19e)];if(!_0x393792)return console['error'](a39_0x4049ae[_0x1f11f7(0x213)](_0x1f11f7(0x12a)),_0x1f11f7(0x104)),console[_0x1f11f7(0x280)](a39_0x4049ae[_0x1f11f7(0x239)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x1f11f7(0x280)](a39_0x4049ae['dim'](_0x1f11f7(0x21d))),0x1;if(!_0x2083d8)return console[_0x1f11f7(0x280)](a39_0x4049ae[_0x1f11f7(0x213)]('Error:'),_0x1f11f7(0x263)),console[_0x1f11f7(0x280)](a39_0x4049ae[_0x1f11f7(0x239)](_0x1f11f7(0x18a))),0x1;_0x29a820[_0x1f11f7(0x130)]&&(console[_0x1f11f7(0x280)](_0x1f11f7(0x290)+_0x393792),console[_0x1f11f7(0x280)](_0x1f11f7(0x23a)+_0x2083d8),_0x1551eb&&console[_0x1f11f7(0x280)](_0x1f11f7(0x13f)+_0x1551eb),_0x29a820[_0x1f11f7(0x1a6)]&&console[_0x1f11f7(0x280)](_0x1f11f7(0x1c9)),_0x3c9757&&console[_0x1f11f7(0x280)]('Validation:\x20skipped'));const _0x49c69e=await withSpinner(_0x1f11f7(0x11b),()=>_0x5002b8['workflow']['prepareCloneProject'](_0x393792,_0x2083d8,{'revision':_0x1551eb,'skipValidation':_0x3c9757}),{'verbose':_0x29a820[_0x1f11f7(0x130)]}),_0x2f39a1=_0x49c69e[_0x1f11f7(0x29a)];console['error'](_0x1f11f7(0x185)+_0x2f39a1['sourceDir']);_0x2f39a1[_0x1f11f7(0x234)]&&console['error'](_0x1f11f7(0x1e0)+_0x2f39a1[_0x1f11f7(0x234)]);console['error'](_0x1f11f7(0x23a)+_0x2f39a1[_0x1f11f7(0x1cf)]),console[_0x1f11f7(0x280)](_0x1f11f7(0x13f)+_0x2f39a1['revision']),console[_0x1f11f7(0x280)](_0x1f11f7(0x219)+_0x2f39a1['fileCount']);_0x2f39a1[_0x1f11f7(0x165)]&&(console['error'](a39_0x4049ae[_0x1f11f7(0x1a2)](_0x1f11f7(0x14e)+_0x2f39a1[_0x1f11f7(0x1cf)]+_0x1f11f7(0x102)+_0x2f39a1[_0x1f11f7(0x1a0)]+')')),console[_0x1f11f7(0x280)](a39_0x4049ae[_0x1f11f7(0x1a2)](_0x1f11f7(0x1f4))));if(_0x29a820[_0x1f11f7(0x1a6)])return console[_0x1f11f7(0x280)](a39_0x4049ae[_0x1f11f7(0x1a2)](_0x1f11f7(0x18c))),0x0;if(!_0x29a820['yes']){const _0x3a4dd8=_0x2f39a1[_0x1f11f7(0x234)]||a39_0x613a32[_0x1f11f7(0x15f)](_0x393792),_0x295d8a=_0x2f39a1['targetExists']?_0x1f11f7(0x131)+_0x2083d8+_0x1f11f7(0x224):_0x1f11f7(0x1f8)+_0x3a4dd8+_0x1f11f7(0x194)+_0x2083d8+'\x22?',_0x2ff6c2=await confirmKey(_0x295d8a);if(!_0x2ff6c2)return console[_0x1f11f7(0x280)](_0x1f11f7(0x232)),0x0;}const _0x4cc55c=await withSpinner(_0x2f39a1[_0x1f11f7(0x165)]?'Updating\x20'+_0x2083d8+_0x1f11f7(0x29f):_0x1f11f7(0x1ae)+_0x2083d8+_0x1f11f7(0x29f),()=>_0x5002b8[_0x1f11f7(0x132)][_0x1f11f7(0x118)](_0x2f39a1),{'verbose':_0x29a820['verbose']}),_0x27f4dd=_0x4cc55c[_0x1f11f7(0x29a)];return console['error'](a39_0x4049ae[_0x1f11f7(0x293)](_0x2f39a1[_0x1f11f7(0x165)]?_0x1f11f7(0x188):_0x1f11f7(0x1c4))),console['error'](_0x1f11f7(0x193)+_0x27f4dd[_0x1f11f7(0x1cf)]),console['error'](_0x1f11f7(0x26c)+_0x27f4dd[_0x1f11f7(0x1c6)]),console[_0x1f11f7(0x280)](_0x1f11f7(0x136)+_0x27f4dd[_0x1f11f7(0x15a)]),await this['showWorkflowConsoleUrl'](_0x5002b8,_0x27f4dd[_0x1f11f7(0x1cf)],_0x29a820[_0x1f11f7(0x1cc)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a39_0x1b0c43(0x238)]='workflow:delete';[a39_0x1b0c43(0x252)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a39_0x1b0c43(0x260)](_0x41ca89){const _0x358b37=a39_0x1b0c43,{options:_0xd92f5e,args:_0x3f6836,tdx:_0x1e3642}=_0x41ca89,_0x4845c3=_0x3f6836[0x0];if(!_0x4845c3)return console[_0x358b37(0x280)](_0x358b37(0x27b)),console[_0x358b37(0x280)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0xd92f5e['verbose']&&console[_0x358b37(0x280)](_0x358b37(0x2a0)+_0x4845c3);if(!_0xd92f5e['yes']){const _0x34dccb=await confirmKey(_0x358b37(0x271)+_0x4845c3+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x34dccb)return console['error']('Cancelled'),0x0;}const _0x60f160=await withSpinner(_0x358b37(0x1e4)+_0x4845c3+'...',()=>_0x1e3642[_0x358b37(0x132)]['delete'](_0x4845c3),{'verbose':_0xd92f5e['verbose']}),_0x35efd4=_0x60f160[_0x358b37(0x29a)];return console['error'](_0x358b37(0x282)+_0x35efd4['projectName']),console['error'](_0x358b37(0x26c)+_0x35efd4['projectId']),0x0;}}export function parseKeyValue(_0x36d9f2){const _0x56083d=a39_0x1b0c43,_0x3a7701=_0x36d9f2[_0x56083d(0x286)]('=');if(_0x3a7701===-0x1)throw new Error(_0x56083d(0x2a3)+_0x36d9f2+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x149cac=_0x36d9f2[_0x56083d(0x23c)](0x0,_0x3a7701),_0x9c6a6e=_0x36d9f2[_0x56083d(0x23c)](_0x3a7701+0x1);if(!_0x149cac)throw new Error(_0x56083d(0x10b));return{'key':_0x149cac,'value':_0x9c6a6e};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a39_0x1b0c43(0x238)]=a39_0x1b0c43(0xfb);[a39_0x1b0c43(0x252)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a39_0x1b0c43(0x260)](_0x153d8f){const _0x40de2d=a39_0x1b0c43,{options:_0x1a6f72,args:_0x2b05f1,tdx:_0x30eac1}=_0x153d8f,_0x143177=this[_0x40de2d(0x25a)](_0x2b05f1,_0x1a6f72);if(!_0x143177)return 0x1;_0x1a6f72[_0x40de2d(0x130)]&&console[_0x40de2d(0x280)](_0x40de2d(0x2a0)+_0x143177);const _0x1d633f=await withSpinner(_0x40de2d(0x186),()=>_0x30eac1[_0x40de2d(0x132)][_0x40de2d(0x17a)](_0x143177),{'verbose':_0x1a6f72['verbose']}),{secrets:_0x5951a0}=_0x1d633f['data'];return console[_0x40de2d(0x280)](_0x40de2d(0x2a6)+_0x5951a0[_0x40de2d(0x21b)]+_0x40de2d(0x265)+(_0x5951a0['length']!==0x1?'s':'')),await handleSDKOutput(_0x5951a0,_0x1a6f72),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a39_0x1b0c43(0x238)]=a39_0x1b0c43(0x28b);[a39_0x1b0c43(0x252)]=a39_0x1b0c43(0x148);async[a39_0x1b0c43(0x260)](_0x2f4692){const _0x2db2e2=a39_0x1b0c43,{options:_0x3183bc,args:_0x277a6a,tdx:_0x2e549d}=_0x2f4692;let _0x12ff2f,_0x2b194e;if(_0x277a6a['length']>=0x2)_0x12ff2f=_0x277a6a[0x0],_0x2b194e=_0x277a6a[0x1];else{if(_0x277a6a[_0x2db2e2(0x21b)]===0x1&&_0x3183bc['workflowProject'])_0x12ff2f=_0x3183bc[_0x2db2e2(0x110)],_0x2b194e=_0x277a6a[0x0];else return _0x277a6a[_0x2db2e2(0x21b)]===0x1?(console['error'](_0x2db2e2(0x1c7)),console[_0x2db2e2(0x280)](_0x2db2e2(0x15c)),0x1):(console[_0x2db2e2(0x280)]('Error:\x20KEY=VALUE\x20is\x20required'),console['error'](_0x2db2e2(0x23e)),0x1);}let _0x3cf617,_0x3387e5;try{({key:_0x3cf617,value:_0x3387e5}=parseKeyValue(_0x2b194e));}catch(_0x3bbe68){return _0x3bbe68 instanceof Error&&console[_0x2db2e2(0x280)](a39_0x4049ae['red'](_0x2db2e2(0x12a)),_0x3bbe68[_0x2db2e2(0x1c1)]),0x1;}_0x3183bc[_0x2db2e2(0x130)]&&(console['error'](_0x2db2e2(0x2a0)+_0x12ff2f),console[_0x2db2e2(0x280)](_0x2db2e2(0x24d)+_0x3cf617));const _0x1f1734=await withSpinner(_0x2db2e2(0x12d),()=>_0x2e549d[_0x2db2e2(0x132)]['setSecret'](_0x12ff2f,_0x3cf617,_0x3387e5),{'verbose':_0x3183bc[_0x2db2e2(0x130)]}),_0x258c16=_0x1f1734[_0x2db2e2(0x29a)];return console[_0x2db2e2(0x280)](_0x2db2e2(0x28d)+_0x258c16['key']+_0x2db2e2(0x273)+_0x258c16['projectName']+'\x27'),(_0x3183bc[_0x2db2e2(0x20b)]||_0x3183bc[_0x2db2e2(0x24b)])&&await handleSingleObjectOutput(_0x258c16,_0x3183bc),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a39_0x1b0c43(0x238)]='workflow:secrets:delete';[a39_0x1b0c43(0x252)]=a39_0x1b0c43(0x204);async[a39_0x1b0c43(0x260)](_0x82de5){const _0x40408b=a39_0x1b0c43,{options:_0x303454,args:_0x1b0801,tdx:_0x4ee01e}=_0x82de5;let _0x33ee8f,_0x518382;if(_0x1b0801['length']>=0x2)_0x33ee8f=_0x1b0801[0x0],_0x518382=_0x1b0801[0x1];else{if(_0x1b0801[_0x40408b(0x21b)]===0x1&&_0x303454['workflowProject'])_0x33ee8f=_0x303454['workflowProject'],_0x518382=_0x1b0801[0x0];else return _0x1b0801[_0x40408b(0x21b)]===0x1?(console[_0x40408b(0x280)](_0x40408b(0x1c7)),console[_0x40408b(0x280)](_0x40408b(0x15c)),0x1):(console[_0x40408b(0x280)](_0x40408b(0x13c)),console['error'](_0x40408b(0x288)),0x1);}_0x303454['verbose']&&(console[_0x40408b(0x280)](_0x40408b(0x2a0)+_0x33ee8f),console[_0x40408b(0x280)](_0x40408b(0x24d)+_0x518382));if(!_0x303454[_0x40408b(0x180)]){const _0x2bfdd6=await confirmKey(_0x40408b(0x1eb)+_0x518382+'\x27\x20from\x20project\x20\x27'+_0x33ee8f+'\x27?');if(!_0x2bfdd6)return console[_0x40408b(0x280)]('Cancelled'),0x0;}const _0x445fc8=await withSpinner(_0x40408b(0x157),()=>_0x4ee01e[_0x40408b(0x132)]['deleteSecret'](_0x33ee8f,_0x518382),{'verbose':_0x303454['verbose']}),_0x3266da=_0x445fc8[_0x40408b(0x29a)];return console['error'](_0x40408b(0x28d)+_0x3266da[_0x40408b(0x121)]+_0x40408b(0x267)+_0x3266da[_0x40408b(0x183)]+'\x27'),(_0x303454['json']||_0x303454[_0x40408b(0x24b)])&&await handleSingleObjectOutput(_0x3266da,_0x303454),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(_0x4f4441){const _0x15aa3f=a39_0x1b0c43,_0x1a51c1=Math[_0x15aa3f(0x1c0)](_0x4f4441/0x3e8),_0x5060fb=Math['floor'](_0x1a51c1/0x3c),_0x34fba8=Math['floor'](_0x5060fb/0x3c),_0xdae76=Math[_0x15aa3f(0x1c0)](_0x34fba8/0x18);if(_0xdae76>0x0){const _0x3a9d4d=_0x34fba8%0x18;return _0x3a9d4d>0x0?_0xdae76+'d\x20'+_0x3a9d4d+'h':_0xdae76+'d';}else{if(_0x34fba8>0x0){const _0x4b3cc1=_0x5060fb%0x3c;return _0x4b3cc1>0x0?_0x34fba8+'h\x20'+_0x4b3cc1+'m':_0x34fba8+'h';}else{if(_0x5060fb>0x0){const _0x2f3e43=_0x1a51c1%0x3c;return _0x2f3e43>0x0?_0x5060fb+'m\x20'+_0x2f3e43+'s':_0x5060fb+'m';}else return _0x1a51c1+'s';}}}function formatTimestamp(_0x361995,_0x2aecce){const _0x24bc48=a39_0x1b0c43,_0x5d320f=new Date(_0x361995),_0x39699f=String(_0x5d320f['getHours']())[_0x24bc48(0x250)](0x2,'0'),_0xb449a9=String(_0x5d320f[_0x24bc48(0x27c)]())['padStart'](0x2,'0'),_0x5e2594=_0x39699f+':'+_0xb449a9,_0x2bc064=_0x5d320f[_0x24bc48(0x127)]()===_0x2aecce[_0x24bc48(0x127)]()&&_0x5d320f[_0x24bc48(0x249)]()===_0x2aecce[_0x24bc48(0x249)]()&&_0x5d320f['getDate']()===_0x2aecce[_0x24bc48(0x112)]();if(_0x2bc064)return _0x5e2594;else{const _0x10c4cd=String(_0x5d320f[_0x24bc48(0x249)]()+0x1)['padStart'](0x2,'0'),_0x4d5ba7=String(_0x5d320f[_0x24bc48(0x112)]())[_0x24bc48(0x250)](0x2,'0');return _0x10c4cd+'-'+_0x4d5ba7+'\x20'+_0x5e2594;}}function formatDate(_0x2f4b08){const _0x46b5f1=a39_0x1b0c43,_0x5484a7=_0x2f4b08['getFullYear'](),_0x40ea17=String(_0x2f4b08[_0x46b5f1(0x249)]()+0x1)[_0x46b5f1(0x250)](0x2,'0'),_0x50b90e=String(_0x2f4b08['getDate']())[_0x46b5f1(0x250)](0x2,'0');return _0x5484a7+'-'+_0x40ea17+'-'+_0x50b90e;}function a39_0x2f76(){const _0xe18944=['Deleting\x20secret...','436874IvUUvD','tasks','revision','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','duration','workflows','basename','filter','workflow:use','preparePushProject','isNewProject','No\x20sessions\x20found\x20for:\x20','targetExists','state','fs/promises','✔\x20Pull\x20complete','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','min','MAX_LABEL_COUNT','params','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Project\x20name\x20is\x20required','select','renderSessionsTimeline','every','Kill\x20a\x20running\x20attempt','autocomplete','pullProject','1056264iAFmjl','No\x20projects\x20match\x20pattern:\x20','workflow:attempts','planned','listSecrets','📋\x20','changes','104pCUaJO','attempt','createdAt','yes','\x20\x20Workflow:\x20','success','projectName','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Source:\x20','Listing\x20secrets...','\x20unchanged','✔\x20Project\x20updated','/sessions/','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Show\x20logs\x20for\x20a\x20workflow\x20attempt','\x0aDry\x20run\x20-\x20no\x20project\x20created','rows','✔\x20Project:\x20','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','\x20(use\x20--limit\x20to\x20show\x20more)','startTime','\x20\x20Project:\x20','\x22\x20to\x20new\x20project\x20\x22','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','💡\x20Tip:\x20Use\x20','MAX_TASKS_DISPLAY','Retrying\x20session...','showWorkflowConsoleUrl','GUTTER','msPerChar','modified','cancelRequested','skipValidation','MIN_TIMELINE_WIDTH','existingProjectId','\x20sessions\x20','yellow','🔄\x20','No\x20sessions\x20with\x20timing\x20information','join','dryRun','Getting\x20attempt\x20details...','limit','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','Parameters:\x20','Output\x20directory:\x20','Total:\x20','sys','Cloning\x20to\x20','value','\x20task','Pattern:\x20','find','Start\x20a\x20workflow\x20run','Force:\x20yes','sessionId','download','running','Attempt\x20ID:\x20','\x20new','No\x20workflow\x20projects\x20found','path','icon','generateSessionTimelineRows','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','No\x20attempts\x20found','floor','message','\x20\x20Changes:\x20','Latest\x20session\x20has\x20no\x20attempt','✔\x20Clone\x20complete','ICON_WIDTH','newProjectId','Error:\x20Project\x20name\x20is\x20required','sessionTime','Dry\x20run:\x20yes','\x20workflow','pending','site','LABEL_MIN_SPACING','trim','newProjectName','values','deleted','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','From\x20task:\x20','targetDir','Using\x20attempt\x20','renderSingleTimeline','list','hasChanges','ICON_SPACING','\x20\x20Session\x20context\x20set\x20to:\x20','group_error','utf-8','session','write','60DctDDi','Source\x20project:\x20',',\x20Workflow:\x20','cwd','relative','Deleting\x20project\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','readFile','max','navigateSessionsInteractive','workflow:timeline','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','\x27...','resumeFrom','List\x20workflow\x20attempts','(use\x20--limit\x20to\x20see\x20more)','workflow:upload','✔\x20Workflow\x20project\x20context\x20cleared.','442881UUTFxg','\x20tasks','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','sourceDir','\x0aClone\x20\x22','10vCcauT','Project\x20directory:\x20','12754pFYLil','lastAttempt','Downloading\x20project\x20','Error:\x20Attempt\x20ID\x20is\x20required','all','columns','\x0a✔\x20Already\x20up\x20to\x20date','Show\x20tasks\x20for\x20an\x20attempt','workflow:projects','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','has','diff','No\x20matching\x20sessions\x20found','session_id','\x20\x20tdx\x20wf\x20use\x20<project>','Error:\x20','json','status','\x20\x20Console:\x20','done','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','format','Session\x20time:\x20','attempt:','red','No\x20workflow\x20tdx.json\x20found','logFiles','table','\x20\x20Location:\x20','/app/workflows/','Files\x20to\x20upload:\x20','\x20logs','length','workflow:clone','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','log','stdout','Show\x20specific\x20attempt\x20details','\x20\x20Session\x20ID:\x20','\x20\x20Files\x20extracted:\x20','Include\x20retried:\x20yes','\x22\x20with\x20new\x20revision?','fromTask','No\x20workflows\x20found\x20in\x20project:\x20','Auto-selected\x20latest\x20session:\x20','fill','param','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','cyan','✔\x20Pushed\x20','Select\x20a\x20session\x20to\x20view\x20timeline:','\x0aApply\x20these\x20changes?','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','run','Project\x20filter:\x20','Cancelled','\x0aDry\x20run\x20-\x20nothing\x20pushed','sourceProjectName','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Target:\x20','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','name','dim','New\x20project\x20name:\x20','resolveProjectDir','substring','end','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','\x20has\x20no\x20attempts','type','match','parseProjectWorkflowPattern','30djbtfT','LABEL_WIDTH_DIVISOR','2211716cfnhIW','Select\x20a\x20workflow\x20to\x20run','parse','Pulling\x20project\x20','getMonth','map','jsonl','toISOString','Key:\x20','pollTimeline','Session\x20','padStart','123092vvrBnF','description','Task\x20name:\x20','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','blue','Writing\x20files...','555lYUXCY','\x20to\x20see\x20detailed\x20logs','Target\x20directory:\x20','requireProject','✔\x20New\x20project:\x20','title','renderTimeline','\x20deleted','Filter:\x20','execute','Retrying\x20attempt...','push','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','get','\x20secret','✔\x20Workflow\x20run\x20started','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','startedAt','1GiRpJd','TASK_NAME_WIDTH','projectId','\x20\x20Project\x20ID:\x20','MAX_POLL_ITERATIONS','follow','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','force','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','slice','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Reason:\x20','set','⚠\x20Showing\x20first\x20','✔\x20Push\x20complete','displayLine','\x20\x20Target:\x20','unchanged','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','getMinutes','Killing\x20attempt...','Fetching\x20log\x20files...','Loading\x20session...','error','workflowName','✔\x20Deleted\x20project\x20','output','No\x20attempts\x20found\x20in\x20project:\x20','workflow:sessions','indexOf','\x0aPolling...\x20(','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','workflow:logs','includeRetried','workflow:secrets:set','start','✔\x20Secret\x20\x27','stat','Project\x20name:\x20','Source\x20directory:\x20','localeCompare','Filter:\x20project=','green','No\x20sessions\x20found','\x0aDry\x20run\x20-\x20no\x20files\x20written','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','kill','resolveProjectId','Resolving\x20project\x20\x27','data','index','Pull\x20workflow\x20project\x20to\x20local\x20folder','session:','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','...','Project:\x20','stringify','Validation:\x20skipped','Invalid\x20format:\x20','startsWith','split','✔\x20Found\x20','MAX_TIMELINE_WIDTH','workflow:secrets:list','canceling','/attempt/','task','\x20-\x20','workflow:tasks','tdx.json','\x22\x20already\x20exists\x20(ID:\x20','summary','Source\x20directory\x20is\x20required','POLL_INTERVAL_MS','now','toLowerCase','No\x20workflow\x20sessions\x20found','workflow:push','splice','Key\x20cannot\x20be\x20empty','workflow:download','workflow:kill','\x0a✔\x20No\x20changes\x20to\x20push','sessions','workflowProject','\x20session','getDate','Loading\x20workflows...','Tip:\x20cd\x20to\x20workflows/','resolveProject','revision:\x20','No\x20sessions\x20found\x20in\x20project:\x20','executeCloneProject','Pushing\x20workflow\x20project...','round','Analyzing\x20project...','\x20attempt','\x20\x20Attempt\x20ID:\x20','text','new','buildTimelineData','key','durationMs','✔\x20Showing\x20','finishedAt','Including\x20subtasks:\x20yes','attemptId','getFullYear','Usage:\x20tdx\x20wf\x20use\x20<project>','applyPullProject','Error:','updatedAt','MIN_LABEL_COUNT','Setting\x20secret...','29538owiPlV','repeat','verbose','\x0aUpdate\x20existing\x20project\x20\x22','workflow','metadata','Workflow:\x20','\x20of\x20','\x20\x20Revision:\x20','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Session\x20not\x20found:\x20','workflow:pull','---\x20','total','Error:\x20Secret\x20key\x20is\x20required','from','\x1b[1A\x1b[2K','Revision:\x20','isTTY','\x0aPush\x20these\x20changes?','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','keys','resolve','size','Failed\x20to\x20fetch\x20attempt\x20data','fullName','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','\x20\x20Source:\x20','List\x20workflow\x20execution\x20sessions','window','filesExtracted','project','\x0a⚠\x20Project\x20\x22','includes','sort','getTime','Warning:','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','tdx\x20wf\x20attempt\x20','unknown','\x20modified'];a39_0x2f76=function(){return _0xe18944;};return a39_0x2f76();}function getTaskStateIcon(_0x32dcbd){const _0x520c1a={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x520c1a[_0x32dcbd]||'⚪';}function getBarChar(_0x5f0241){const _0x42c5e0=a39_0x1b0c43;return _0x5f0241===_0x42c5e0(0x280)||_0x5f0241===_0x42c5e0(0x1db)?'×':'─';}function getBarColor(_0x2ae4ea){const _0x348979=a39_0x1b0c43,_0x388e54={'success':a39_0x4049ae[_0x348979(0x293)],'error':a39_0x4049ae[_0x348979(0x213)],'group_error':a39_0x4049ae[_0x348979(0x213)],'running':a39_0x4049ae[_0x348979(0x255)],'blocked':a39_0x4049ae[_0x348979(0x1a2)],'planned':a39_0x4049ae[_0x348979(0x239)],'canceling':a39_0x4049ae['yellow']};return _0x388e54[_0x2ae4ea]||a39_0x4049ae['white'];}function a39_0x5863(_0x18ef02,_0x2ff721){_0x18ef02=_0x18ef02-0xfb;const _0x2f76f9=a39_0x2f76();let _0x5863e6=_0x2f76f9[_0x18ef02];return _0x5863e6;}function parseTaskName(_0x4ef752){const _0x3315d0=a39_0x1b0c43;let _0x20a1a3=_0x4ef752['replace'](/^\++/,'');const _0x201948=_0x20a1a3[_0x3315d0(0x2a5)]('+'),_0x5a4077=_0x201948[_0x3315d0(0x21b)]>0x1?_0x201948[_0x3315d0(0x21b)]-0x2:0x0,_0x20aa07=_0x201948[_0x201948['length']-0x1]||_0x20a1a3;return{'level':_0x5a4077,'name':'+'+_0x20aa07};}function truncateTaskName(_0x311b60,_0x2e84c2){const _0x12ce9f=a39_0x1b0c43,_0x29d725=stringWidth(_0x311b60);if(_0x29d725<=_0x2e84c2)return _0x311b60;let _0x2b41b9=_0x311b60;while(stringWidth(_0x2b41b9+'…')>_0x2e84c2&&_0x2b41b9['length']>0x0){_0x2b41b9=_0x2b41b9[_0x12ce9f(0x272)](0x0,-0x1);}return _0x2b41b9+'…';}function calculateTimeScale(_0x26f566,_0x23ba90){const _0x3bbae0=a39_0x1b0c43;return{'startTime':_0x26f566[_0x3bbae0(0x28c)],'endTime':_0x26f566['end'],'durationMs':_0x26f566['duration'],'msPerChar':_0x26f566['duration']/_0x23ba90};}function timeToPosition(_0x533c86,_0xce1df1,_0x369381){const _0xbd3d35=a39_0x1b0c43,_0xb54919=_0x533c86-_0xce1df1['startTime'],_0x4053c5=Math[_0xbd3d35(0x1c0)](_0xb54919/_0xce1df1[_0xbd3d35(0x19b)]);return Math[_0xbd3d35(0x1e7)](0x0,Math[_0xbd3d35(0x16a)](_0x4053c5,_0x369381));}function renderTimeAxis(_0x1f9a0c,_0x1163ac){const _0x1d18b3=a39_0x1b0c43,_0x3d5698=Math['min'](TIMELINE_CONFIG[_0x1d18b3(0x16b)],Math['max'](TIMELINE_CONFIG[_0x1d18b3(0x12c)],Math[_0x1d18b3(0x1c0)](_0x1163ac/TIMELINE_CONFIG[_0x1d18b3(0x244)]))),_0x10c5f0=_0x1f9a0c[_0x1d18b3(0x122)]/(_0x3d5698-0x1),_0x2df645=new Date(_0x1f9a0c['startTime']),_0x547b22=[];for(let _0xc085f=0x0;_0xc085f<_0x3d5698;_0xc085f++){const _0x57e1b2=_0x1f9a0c[_0x1d18b3(0x192)]+_0xc085f*_0x10c5f0,_0x12160a=timeToPosition(_0x57e1b2,_0x1f9a0c,_0x1163ac),_0x4d5977=formatTimestamp(_0x57e1b2,_0x2df645);_0x547b22['push']({'pos':_0x12160a,'text':_0x4d5977});}const _0x16a7bf=new Array(_0x1163ac)['fill']('\x20');let _0x4d8d5e=-0x1;for(const {pos:_0x478fc2,text:_0x2f443b}of _0x547b22){let _0x3eb54a=Math[_0x1d18b3(0x1e7)](0x0,_0x478fc2-Math[_0x1d18b3(0x1c0)](_0x2f443b[_0x1d18b3(0x21b)]/0x2));_0x3eb54a<=_0x4d8d5e+TIMELINE_CONFIG[_0x1d18b3(0x1cd)]&&(_0x3eb54a=_0x4d8d5e+TIMELINE_CONFIG[_0x1d18b3(0x1cd)]+0x1);_0x3eb54a+_0x2f443b[_0x1d18b3(0x21b)]>_0x1163ac&&(_0x3eb54a=_0x1163ac-_0x2f443b[_0x1d18b3(0x21b)]);if(_0x3eb54a>=0x0&&_0x3eb54a+_0x2f443b[_0x1d18b3(0x21b)]<=_0x1163ac&&_0x3eb54a>_0x4d8d5e){for(let _0x3d8488=0x0;_0x3d8488<_0x2f443b[_0x1d18b3(0x21b)];_0x3d8488++){_0x16a7bf[_0x3eb54a+_0x3d8488]=_0x2f443b[_0x3d8488];}_0x4d8d5e=_0x3eb54a+_0x2f443b[_0x1d18b3(0x21b)]-0x1;}}return _0x16a7bf['join']('');}function renderTaskRow(_0x3f54eb,_0xc0a407,_0x19cbbc,_0x51ba94){const _0x1159ba=a39_0x1b0c43,{level:_0x5e380d,name:_0x1d1537}=parseTaskName(_0x3f54eb[_0x1159ba(0x238)]),_0x3d8ea9='\x20'['repeat'](_0x5e380d),_0x43168e=_0x3f54eb[_0x1159ba(0x14b)]?'('+formatElapsed(_0x3f54eb['window'][_0x1159ba(0x15d)])+')':'',_0x1f0ed0=stringWidth(_0x43168e),_0x48d495=_0x5e380d*0x1,_0x354ccc=_0x51ba94-_0x48d495-_0x1f0ed0-0x1,_0x504a81=truncateTaskName(_0x1d1537,_0x354ccc),_0xe8406c=_0x3d8ea9+_0x504a81,_0x3ed3f8=stringWidth(_0xe8406c),_0x45042c=_0x51ba94-_0x3ed3f8-_0x1f0ed0,_0x25a8cc=_0xe8406c+'\x20'[_0x1159ba(0x12f)](Math[_0x1159ba(0x1e7)](0x1,_0x45042c))+a39_0x4049ae[_0x1159ba(0x239)](_0x43168e),_0x134b2=getTaskStateIcon(_0x3f54eb['state']),_0xb4d2dc=new Array(_0x19cbbc)[_0x1159ba(0x228)]('\x20');if(_0x3f54eb[_0x1159ba(0x14b)]){const _0x3c3972=timeToPosition(_0x3f54eb['window']['start'],_0xc0a407,_0x19cbbc),_0xc139d0=timeToPosition(_0x3f54eb[_0x1159ba(0x14b)][_0x1159ba(0x23d)],_0xc0a407,_0x19cbbc),_0x4040f0=getBarChar(_0x3f54eb[_0x1159ba(0x166)]),_0x597260=Math[_0x1159ba(0x1e7)](_0x3c3972+0x1,_0xc139d0);for(let _0x281cf4=_0x3c3972;_0x281cf4<Math[_0x1159ba(0x16a)](_0x597260,_0x19cbbc);_0x281cf4++){_0xb4d2dc[_0x281cf4]=_0x4040f0;}}const _0x55feee=getBarColor(_0x3f54eb[_0x1159ba(0x166)]),_0x2e5201=_0xb4d2dc[_0x1159ba(0x24a)](_0x1cb33d=>_0x1cb33d==='\x20'?'\x20':_0x55feee(_0x1cb33d))[_0x1159ba(0x1a5)]('');return _0x134b2+'\x20'+_0x25a8cc+'│'+_0x2e5201+'│';}function calculateStats(_0xbcb12f){const _0x3f17be=a39_0x1b0c43,_0x84bdfb={'total':_0xbcb12f[_0x3f17be(0x21b)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x5969d6 of _0xbcb12f){if(_0x5969d6[_0x3f17be(0x166)]==='success')_0x84bdfb['success']++;else{if(_0x5969d6[_0x3f17be(0x166)]==='error'||_0x5969d6[_0x3f17be(0x166)]==='group_error')_0x84bdfb['error']++;else _0x5969d6['state']===_0x3f17be(0x1b7)?_0x84bdfb[_0x3f17be(0x1b7)]++:_0x84bdfb[_0x3f17be(0x1cb)]++;}}return _0x84bdfb;}function formatStats(_0x31a020){const _0x1e0078=a39_0x1b0c43;return[_0x1e0078(0x1ac)+_0x31a020[_0x1e0078(0x13b)],'✅\x20'+_0x31a020[_0x1e0078(0x182)],'❌\x20'+_0x31a020[_0x1e0078(0x280)],_0x1e0078(0x1a3)+_0x31a020[_0x1e0078(0x1b7)],'⏳\x20'+_0x31a020['pending']]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a39_0x1b0c43(0x238)]=a39_0x1b0c43(0x1e9);[a39_0x1b0c43(0x252)]=a39_0x1b0c43(0x1f6);async[a39_0x1b0c43(0x260)](_0x453a77){const _0x37a4af=a39_0x1b0c43,{options:_0x229df2,args:_0x471888,tdx:_0x14d276}=_0x453a77;let _0x588fb8,_0x227a48,_0x42ba7c=![];if(_0x471888[0x0]){if(_0x471888[0x0][_0x37a4af(0x14f)]('.')){const _0x3f43d7=this[_0x37a4af(0x242)](_0x471888,_0x229df2);if(!_0x3f43d7)return 0x1;_0x588fb8=_0x3f43d7['projectName'],_0x227a48=_0x3f43d7[_0x37a4af(0x281)];}else{_0x227a48=_0x471888[0x0],_0x588fb8=_0x229df2[_0x37a4af(0x110)];if(!_0x588fb8)return console[_0x37a4af(0x280)](a39_0x4049ae['red'](_0x37a4af(0x12a)),_0x37a4af(0x296)),0x1;_0x42ba7c=!![];}}else{const _0x5e4551=this[_0x37a4af(0x242)](_0x471888,_0x229df2);if(!_0x5e4551)return 0x1;_0x588fb8=_0x5e4551[_0x37a4af(0x183)],_0x227a48=_0x5e4551[_0x37a4af(0x281)];}if(_0x229df2[_0x37a4af(0x130)]){if(_0x588fb8&&_0x227a48)console[_0x37a4af(0x280)](_0x37a4af(0x25f)+_0x588fb8+'.'+_0x227a48);else _0x588fb8&&console[_0x37a4af(0x280)](_0x37a4af(0x292)+_0x588fb8);}const _0x3bb13b=_0x229df2[_0x37a4af(0x126)],_0xbd2c29=_0x229df2[_0x37a4af(0x1b5)];if(_0x3bb13b){_0xbd2c29&&console[_0x37a4af(0x280)](a39_0x4049ae[_0x37a4af(0x1a2)](_0x37a4af(0x152)),_0x37a4af(0x1a9));const _0x5d4d47=_0x229df2['follow'];return _0x5d4d47?await this['pollTimeline'](_0x453a77,_0x3bb13b):await this[_0x37a4af(0x1d6)](_0x453a77,_0x3bb13b,_0x229df2),0x0;}if(_0xbd2c29){const _0x4ec90f=await withSpinner(_0x37a4af(0x27f),()=>_0x14d276['workflow'][_0x37a4af(0x10f)]({'projectName':_0x588fb8,'workflowName':_0x227a48,'limit':0x64}),{'verbose':_0x229df2['verbose']}),_0x51fcbf=_0x4ec90f[_0x37a4af(0x29a)][_0x37a4af(0x1b2)](_0x2e652c=>_0x2e652c['id']===_0xbd2c29);if(!_0x51fcbf)return console[_0x37a4af(0x280)](a39_0x4049ae[_0x37a4af(0x213)](_0x37a4af(0x12a)),_0x37a4af(0x138)+_0xbd2c29),0x1;if(!_0x51fcbf[_0x37a4af(0x1fc)]?.['id'])return console[_0x37a4af(0x280)](a39_0x4049ae[_0x37a4af(0x213)]('Error:'),_0x37a4af(0x24f)+_0xbd2c29+_0x37a4af(0x23f)),0x1;const _0x22f88f=_0x51fcbf[_0x37a4af(0x1fc)]['id'];_0x229df2[_0x37a4af(0x130)]&&console[_0x37a4af(0x280)](_0x37a4af(0x1d5)+_0x22f88f+'\x20from\x20session\x20'+_0xbd2c29);const _0x30ddf3=_0x229df2[_0x37a4af(0x26e)];return _0x30ddf3?await this['pollTimeline'](_0x453a77,_0x22f88f):await this[_0x37a4af(0x1d6)](_0x453a77,_0x22f88f,_0x229df2),0x0;}const _0x194222=await withSpinner('Loading\x20sessions...',()=>_0x14d276['workflow']['sessions']({'projectName':_0x588fb8,'workflowName':_0x227a48,'limit':_0x229df2[_0x37a4af(0x1a8)]||0x32}),{'verbose':_0x229df2[_0x37a4af(0x130)]}),_0x45b93d=_0x194222[_0x37a4af(0x29a)];if(_0x45b93d[_0x37a4af(0x21b)]===0x0){if(_0x588fb8&&_0x227a48)console['error'](_0x37a4af(0x164)+_0x588fb8+'.'+_0x227a48);else _0x588fb8?console[_0x37a4af(0x280)](_0x37a4af(0x117)+_0x588fb8):(console[_0x37a4af(0x280)](_0x37a4af(0x108)),console['error'](a39_0x4049ae[_0x37a4af(0x239)](_0x37a4af(0x20f))));return 0x0;}_0x45b93d[_0x37a4af(0x150)]((_0x15380c,_0x515b4a)=>{const _0x595ee5=_0x37a4af,_0x557c39=_0x15380c[_0x595ee5(0x1c8)]||'',_0x1f14a3=_0x515b4a[_0x595ee5(0x1c8)]||'';return _0x1f14a3[_0x595ee5(0x291)](_0x557c39);});if(_0x229df2[_0x37a4af(0x20b)]||_0x229df2[_0x37a4af(0x24b)])return await handleSDKOutput(_0x45b93d,_0x229df2),0x0;let _0x55bbf1;if(_0x42ba7c){const _0x3f19be=_0x45b93d[0x0];if(!_0x3f19be[_0x37a4af(0x1fc)]?.['id'])return console[_0x37a4af(0x280)](_0x37a4af(0x1c3)),0x0;_0x55bbf1=_0x3f19be[_0x37a4af(0x1fc)]['id'],_0x229df2[_0x37a4af(0x130)]&&console[_0x37a4af(0x280)](_0x37a4af(0x227)+_0x3f19be[_0x37a4af(0x1c8)]);}else{const _0x4008b6=_0x45b93d[_0x37a4af(0x24a)](_0x515fe2=>{const _0x3ab1ce=_0x37a4af,_0x2139ea=getAttemptStatusDisplay(_0x515fe2[_0x3ab1ce(0x1fc)]);return{'title':_0x515fe2['project']?.[_0x3ab1ce(0x238)]+'.'+_0x515fe2[_0x3ab1ce(0x132)]?.['name']+_0x3ab1ce(0xff)+_0x515fe2[_0x3ab1ce(0x1c8)]+'\x20'+_0x2139ea[_0x3ab1ce(0x1bc)],'value':_0x515fe2[_0x3ab1ce(0x1fc)]?.['id']||'','description':_0x2139ea[_0x3ab1ce(0x11e)]};}),_0xb3b48a=await a39_0x4a9c7f({'type':_0x37a4af(0x170),'name':_0x37a4af(0x126),'message':_0x37a4af(0x22d),'choices':_0x4008b6['filter'](_0x1d4296=>_0x1d4296[_0x37a4af(0x1af)]!=='')});if(!_0xb3b48a[_0x37a4af(0x126)])return 0x0;_0x55bbf1=_0xb3b48a['attemptId'];}const _0xc42142=_0x229df2[_0x37a4af(0x26e)];return _0xc42142?await this[_0x37a4af(0x24e)](_0x453a77,_0x55bbf1):await this[_0x37a4af(0x1d6)](_0x453a77,_0x55bbf1,_0x229df2),0x0;}async['renderSingleTimeline'](_0xaceeaa,_0x291fb7,_0x3499f7){const _0x158b70=a39_0x1b0c43,{tdx:_0x23a11e}=_0xaceeaa;let _0x17381f,_0x35bed9;try{[_0x17381f,_0x35bed9]=await Promise[_0x158b70(0x1ff)]([_0x23a11e[_0x158b70(0x132)]['attempt'](_0x291fb7),_0x23a11e[_0x158b70(0x132)][_0x158b70(0x159)](_0x291fb7,![])]);}catch(_0x2c54f9){console[_0x158b70(0x280)](a39_0x4049ae[_0x158b70(0x213)](_0x158b70(0x146)));_0x3499f7['verbose']&&console['error'](_0x2c54f9);throw _0x2c54f9;}if(_0x3499f7[_0x158b70(0x20b)]||_0x3499f7['jsonl']){const _0x1ac42d=this[_0x158b70(0x120)](_0x17381f,_0x35bed9);await handleSDKOutput([_0x1ac42d],_0x3499f7);return;}const _0x24fe61=_0x23a11e['context'][_0x158b70(0x1cc)],_0x342a09=this['renderTimeline'](_0x17381f,_0x35bed9,_0x24fe61);console[_0x158b70(0x21e)](_0x342a09);}async[a39_0x1b0c43(0x24e)](_0x525295,_0x542786){const _0x40d5c4=a39_0x1b0c43,{tdx:_0x2935de}=_0x525295,_0x4a50a8=TIMELINE_CONFIG[_0x40d5c4(0x105)],_0x3c573a=TIMELINE_CONFIG[_0x40d5c4(0x26d)];let _0x1318cb=0x0;while(_0x1318cb<_0x3c573a){process[_0x40d5c4(0x21f)][_0x40d5c4(0x140)]&&process['stdout'][_0x40d5c4(0x1de)]('\x1bc');let _0x40ac40,_0x31fec2;try{[_0x40ac40,_0x31fec2]=await Promise[_0x40d5c4(0x1ff)]([_0x2935de['workflow'][_0x40d5c4(0x17e)](_0x542786),_0x2935de[_0x40d5c4(0x132)][_0x40d5c4(0x159)](_0x542786,![])]);}catch(_0x592b5c){console[_0x40d5c4(0x280)](a39_0x4049ae[_0x40d5c4(0x213)](_0x40d5c4(0x137)));_0x1318cb>0x0&&console[_0x40d5c4(0x280)](a39_0x4049ae[_0x40d5c4(0x239)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x1318cb));throw _0x592b5c;}const _0xcb7327=_0x2935de['context'][_0x40d5c4(0x1cc)],_0x2a18b4=this[_0x40d5c4(0x25d)](_0x40ac40,_0x31fec2,_0xcb7327);console['log'](_0x2a18b4);const _0x57abc1=_0x40ac40[_0x40d5c4(0x20e)]&&_0x31fec2[_0x40d5c4(0x172)](_0xe35bd6=>_0xe35bd6[_0x40d5c4(0x166)]!==_0x40d5c4(0x1b7)&&_0xe35bd6[_0x40d5c4(0x166)]!==_0x40d5c4(0x179));if(_0x57abc1){console['error'](a39_0x4049ae['green']('\x0a✔\x20Attempt\x20complete'));break;}console[_0x40d5c4(0x280)](a39_0x4049ae[_0x40d5c4(0x239)](_0x40d5c4(0x287)+_0x1318cb*0x2+_0x40d5c4(0x195))),await new Promise(_0x100d63=>setTimeout(_0x100d63,_0x4a50a8)),_0x1318cb++;}_0x1318cb>=_0x3c573a&&console[_0x40d5c4(0x280)](a39_0x4049ae[_0x40d5c4(0x1a2)](_0x40d5c4(0x22a)));}[a39_0x1b0c43(0x25d)](_0x19aea4,_0x3fecc8,_0x1a45bf){const _0x1d10f2=a39_0x1b0c43,_0x39e84d=[],_0x53653b=TIMELINE_CONFIG[_0x1d10f2(0x26a)],_0x3811e9=0x5,_0x3a2d17=process[_0x1d10f2(0x21f)][_0x1d10f2(0x200)]||0x78,_0x2c09ed=_0x3a2d17-_0x53653b-_0x3811e9,_0x238a52=Math[_0x1d10f2(0x1e7)](TIMELINE_CONFIG[_0x1d10f2(0x19f)],Math['min'](_0x2c09ed,TIMELINE_CONFIG[_0x1d10f2(0x2a7)])),_0x5f184d=new Date(_0x19aea4[_0x1d10f2(0x17f)])[_0x1d10f2(0x151)](),_0x396337=_0x19aea4[_0x1d10f2(0x124)]?new Date(_0x19aea4[_0x1d10f2(0x124)])[_0x1d10f2(0x151)]():Date[_0x1d10f2(0x106)](),_0x5008be={'start':_0x5f184d,'end':_0x396337,'duration':_0x396337-_0x5f184d},_0x4873b7=new Map(),_0x459325=[];for(const _0x4f52be of _0x3fecc8){if(_0x4f52be[_0x1d10f2(0x268)]){const _0x4d400b=new Date(_0x4f52be['startedAt'])[_0x1d10f2(0x151)](),_0x22636e=_0x4f52be[_0x1d10f2(0x12b)]?new Date(_0x4f52be[_0x1d10f2(0x12b)])[_0x1d10f2(0x151)]():Date[_0x1d10f2(0x106)](),_0x540862={'start':_0x4d400b,'end':_0x22636e,'duration':_0x22636e-_0x4d400b};_0x4873b7[_0x1d10f2(0x275)](_0x4f52be['id'],_0x540862),_0x459325[_0x1d10f2(0x262)]({'name':_0x4f52be[_0x1d10f2(0x147)],'state':_0x4f52be[_0x1d10f2(0x166)]||_0x1d10f2(0x155),'window':_0x540862});}else _0x459325['push']({'name':_0x4f52be['fullName'],'state':_0x4f52be[_0x1d10f2(0x166)]||_0x1d10f2(0x179),'window':undefined});}_0x459325[_0x1d10f2(0x150)]((_0x1c059a,_0x498f88)=>{const _0x114ad4=_0x1d10f2;if(!_0x1c059a[_0x114ad4(0x14b)])return 0x1;if(!_0x498f88[_0x114ad4(0x14b)])return-0x1;return _0x1c059a[_0x114ad4(0x14b)][_0x114ad4(0x28c)]-_0x498f88[_0x114ad4(0x14b)]['start'];});const _0x691445=_0x459325[_0x1d10f2(0x21b)],_0x123716=_0x691445>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x123716&&_0x459325[_0x1d10f2(0x10a)](TIMELINE_CONFIG[_0x1d10f2(0x197)]);const _0x10f748=calculateTimeScale(_0x5008be,_0x238a52),_0x388240=_0x19aea4['done']?_0x19aea4[_0x1d10f2(0x182)]?a39_0x4049ae[_0x1d10f2(0x293)](_0x1d10f2(0x182)):a39_0x4049ae['red'](_0x1d10f2(0x280)):a39_0x4049ae[_0x1d10f2(0x255)](_0x1d10f2(0x1b7)),_0x224de3=_0x19aea4[_0x1d10f2(0x14d)]?.['id'],_0x22247e=_0x19aea4[_0x1d10f2(0x1b5)];let _0x2b6dba;if(_0x224de3&&_0x22247e){const _0x57336f=getWorkflowAttemptUrl(_0x1a45bf,_0x224de3,_0x22247e,_0x19aea4['id']);_0x2b6dba=hyperlink(a39_0x4049ae['dim'](_0x19aea4['id']),_0x57336f);}else _0x2b6dba=a39_0x4049ae[_0x1d10f2(0x239)](_0x19aea4['id']);_0x39e84d[_0x1d10f2(0x262)]('Attempt:\x20'+_0x2b6dba+_0x1d10f2(0xff)+_0x388240+_0x1d10f2(0xff)+formatElapsed(_0x5008be[_0x1d10f2(0x15d)]));if(_0x459325['length']>0x0){const _0x61ad9d=renderTimeAxis(_0x10f748,_0x238a52),_0x176432=new Date(_0x5008be['start']),_0x729f03=formatDate(_0x176432),_0x1d7753=TIMELINE_CONFIG[_0x1d10f2(0x1c5)]+TIMELINE_CONFIG[_0x1d10f2(0x1d9)]+_0x53653b,_0xc7a465=_0x729f03['padStart'](_0x1d7753),_0x2020f5=a39_0x4049ae['dim'](_0xc7a465);_0x39e84d['push'](_0x2020f5+'\x20'+_0x61ad9d);for(const _0x51eea8 of _0x459325){_0x39e84d[_0x1d10f2(0x262)](renderTaskRow(_0x51eea8,_0x10f748,_0x238a52,_0x53653b));}const _0x3cb61f=calculateStats(_0x459325);_0x39e84d[_0x1d10f2(0x262)](formatStats(_0x3cb61f)),_0x123716&&_0x39e84d[_0x1d10f2(0x262)](a39_0x4049ae[_0x1d10f2(0x1a2)](_0x1d10f2(0x276)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x1d10f2(0x135)+_0x691445+_0x1d10f2(0x1f3))),_0x39e84d[_0x1d10f2(0x262)](''),_0x39e84d[_0x1d10f2(0x262)](a39_0x4049ae[_0x1d10f2(0x239)](_0x1d10f2(0x196))+(_0x1d10f2(0x154)+_0x19aea4['id']+_0x1d10f2(0x21a))+a39_0x4049ae[_0x1d10f2(0x239)](_0x1d10f2(0x258)));}else _0x39e84d[_0x1d10f2(0x262)](_0x1d10f2(0x29e));return _0x39e84d[_0x1d10f2(0x1a5)]('\x0a');}[a39_0x1b0c43(0x120)](_0x5be960,_0x55fca3){const _0x549a4c=a39_0x1b0c43,_0x20e56f=new Date(_0x5be960[_0x549a4c(0x17f)])[_0x549a4c(0x151)](),_0x268d21=_0x5be960[_0x549a4c(0x124)]?new Date(_0x5be960[_0x549a4c(0x124)])[_0x549a4c(0x151)]():Date['now'](),_0x31d052=_0x268d21-_0x20e56f,_0x28fb9c=[];for(const _0x3d0f34 of _0x55fca3){if(_0x3d0f34['startedAt']){const _0x4a941b=new Date(_0x3d0f34['startedAt'])[_0x549a4c(0x151)](),_0x35b5b2=_0x3d0f34[_0x549a4c(0x12b)]?new Date(_0x3d0f34[_0x549a4c(0x12b)])[_0x549a4c(0x151)]():Date[_0x549a4c(0x106)]();_0x28fb9c[_0x549a4c(0x262)]({'name':_0x3d0f34[_0x549a4c(0x147)],'state':_0x3d0f34[_0x549a4c(0x166)]||_0x549a4c(0x155),'window':{'start':_0x4a941b,'end':_0x35b5b2,'duration':_0x35b5b2-_0x4a941b}});}else _0x28fb9c[_0x549a4c(0x262)]({'name':_0x3d0f34[_0x549a4c(0x147)],'state':_0x3d0f34[_0x549a4c(0x166)]||_0x549a4c(0x179),'window':undefined});}const _0x43bf4f=calculateStats(_0x28fb9c);return{'attempt':{'id':_0x5be960['id'],'status':_0x5be960[_0x549a4c(0x20e)]?_0x5be960[_0x549a4c(0x182)]?_0x549a4c(0x182):_0x549a4c(0x280):_0x549a4c(0x1b7),'createdAt':_0x5be960[_0x549a4c(0x17f)],'finishedAt':_0x5be960['finishedAt'],'duration_ms':_0x31d052},'tasks':_0x28fb9c['map'](_0x73fae2=>({'name':_0x73fae2[_0x549a4c(0x238)],'state':_0x73fae2['state'],'startedAt':_0x73fae2[_0x549a4c(0x14b)]?new Date(_0x73fae2['window'][_0x549a4c(0x28c)])[_0x549a4c(0x24c)]():null,'updatedAt':_0x73fae2['window']?new Date(_0x73fae2['window'][_0x549a4c(0x23d)])[_0x549a4c(0x24c)]():null,'duration_ms':_0x73fae2[_0x549a4c(0x14b)]?.[_0x549a4c(0x15d)]||null})),'stats':_0x43bf4f};}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x2fe978,_0x3be2b4){const _0xbbef21=a40_0x495e,_0x220f79=_0x2fe978();while(!![]){try{const _0x20f762=parseInt(_0xbbef21(0xb2))/0x1*(parseInt(_0xbbef21(0xb5))/0x2)+parseInt(_0xbbef21(0xb6))/0x3+parseInt(_0xbbef21(0xac))/0x4+parseInt(_0xbbef21(0xaf))/0x5+-parseInt(_0xbbef21(0xb8))/0x6+-parseInt(_0xbbef21(0xba))/0x7+parseInt(_0xbbef21(0xb1))/0x8*(-parseInt(_0xbbef21(0xb7))/0x9);if(_0x20f762===_0x3be2b4)break;else _0x220f79['push'](_0x220f79['shift']());}catch(_0x816c39){_0x220f79['push'](_0x220f79['shift']());}}}(a40_0x273e,0x693d0));import{platform}from'os';import{getAPIKey}from'./config.js';function a40_0x495e(_0x1a2369,_0x20dd27){_0x1a2369=_0x1a2369-0xac;const _0x273e81=a40_0x273e();let _0x495eb4=_0x273e81[_0x1a2369];return _0x495eb4;}import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x3fe940=a40_0x495e,_0xb81647=getVersion(),_0x8b6510=platform(),_0x43e913=process[_0x3fe940(0xb4)]['replace']('v','');return'tdx/'+_0xb81647+'\x20('+_0x8b6510+_0x3fe940(0xae)+_0x43e913+')';}export function getAuthHeaders(_0x1da05b,_0x28cc1f){const _0x19ae53=a40_0x495e,_0x2ce798=getVersion(),_0x594ed1={'User-Agent':getUserAgent(),'X-TD-Client':_0x19ae53(0xb9),'X-TD-Client-Version':_0x2ce798};return _0x28cc1f&&(_0x594ed1['Authorization']=_0x19ae53(0xad)+_0x28cc1f),_0x594ed1;}function a40_0x273e(){const _0x3f9085=['188154IdcgIs','tdx','5450788Lodktc','2493516NHPTzU','TD1\x20',';\x20node/','1145120tADddA','X-Trino-User','891320dTRVuA','1DDtNSX','length','version','894422hxRpsU','2164170azBryP','63KDSJuF'];a40_0x273e=function(){return _0x3f9085;};return a40_0x273e();}export function toHeaderRecord(_0x5a4f30){const _0x525f9b={};for(const [_0x54f909,_0x504522]of Object['entries'](_0x5a4f30)){_0x504522!==undefined&&(_0x525f9b[_0x54f909]=_0x504522);}return _0x525f9b;}export function getTrinoHeaders(_0x52cde3,_0x2e30bb){const _0x1ebe4f=a40_0x495e,_0x20efcc=getAuthHeaders(_0x52cde3,_0x2e30bb),_0x12e5b7=toHeaderRecord(_0x20efcc);return delete _0x12e5b7['Authorization'],_0x2e30bb&&(_0x12e5b7[_0x1ebe4f(0xb0)]=_0x2e30bb),_0x12e5b7;}export function hasAPIKey(_0x3fbc71){const _0x30fac7=a40_0x495e,_0x3bdf17=getAPIKey(_0x3fbc71);return _0x3bdf17!==undefined&&_0x3bdf17[_0x30fac7(0xb3)]>0x0;}
1
+ (function(_0x9dfb6b,_0x3a9f5a){const _0x3596f0=a40_0x3937,_0x131702=_0x9dfb6b();while(!![]){try{const _0x1a06d7=parseInt(_0x3596f0(0x1be))/0x1*(parseInt(_0x3596f0(0x1c0))/0x2)+parseInt(_0x3596f0(0x1bd))/0x3*(parseInt(_0x3596f0(0x1b8))/0x4)+-parseInt(_0x3596f0(0x1b9))/0x5+-parseInt(_0x3596f0(0x1c4))/0x6+-parseInt(_0x3596f0(0x1b4))/0x7+-parseInt(_0x3596f0(0x1bb))/0x8*(-parseInt(_0x3596f0(0x1c1))/0x9)+-parseInt(_0x3596f0(0x1c2))/0xa;if(_0x1a06d7===_0x3a9f5a)break;else _0x131702['push'](_0x131702['shift']());}catch(_0x383775){_0x131702['push'](_0x131702['shift']());}}}(a40_0x5c9d,0x56e75));function a40_0x3937(_0x978f03,_0xcea0a2){_0x978f03=_0x978f03-0x1b4;const _0x5c9dbf=a40_0x5c9d();let _0x3937cd=_0x5c9dbf[_0x978f03];return _0x3937cd;}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 _0x298d49=a40_0x3937,_0x3c531e=getVersion(),_0x54a36d=platform(),_0x20e26d=process[_0x298d49(0x1c3)]['replace']('v','');return _0x298d49(0x1c5)+_0x3c531e+'\x20('+_0x54a36d+_0x298d49(0x1b7)+_0x20e26d+')';}export function getAuthHeaders(_0x244831,_0x216a8e){const _0x5c8de1=a40_0x3937,_0x451b55=getVersion(),_0x172ce1={'User-Agent':getUserAgent(),'X-TD-Client':_0x5c8de1(0x1b6),'X-TD-Client-Version':_0x451b55};return _0x216a8e&&(_0x172ce1[_0x5c8de1(0x1bf)]=_0x5c8de1(0x1b5)+_0x216a8e),_0x172ce1;}function a40_0x5c9d(){const _0x4b753c=['TD1\x20','tdx',';\x20node/','12QKMVVT','1638705wkYqPB','length','749320cCLvSt','X-Trino-User','575109kjIgjc','6TaPgiI','Authorization','167452zSdBpI','45dszQEi','64060YoBvEy','version','1311306khlggk','tdx/','entries','4459945NtgIOq'];a40_0x5c9d=function(){return _0x4b753c;};return a40_0x5c9d();}export function toHeaderRecord(_0x46faa8){const _0x2a3c22=a40_0x3937,_0x264cdb={};for(const [_0x524fe6,_0x2c0161]of Object[_0x2a3c22(0x1c6)](_0x46faa8)){_0x2c0161!==undefined&&(_0x264cdb[_0x524fe6]=_0x2c0161);}return _0x264cdb;}export function getTrinoHeaders(_0x4d0ddc,_0x473d6f){const _0x5356f8=a40_0x3937,_0x5e0537=getAuthHeaders(_0x4d0ddc,_0x473d6f),_0xcbeb08=toHeaderRecord(_0x5e0537);return delete _0xcbeb08[_0x5356f8(0x1bf)],_0x473d6f&&(_0xcbeb08[_0x5356f8(0x1bc)]=_0x473d6f),_0xcbeb08;}export function hasAPIKey(_0xd1fee3){const _0x11f685=a40_0x3937,_0x24b40a=getAPIKey(_0xd1fee3);return _0x24b40a!==undefined&&_0x24b40a[_0x11f685(0x1ba)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x146c6b,_0x483e5b){const _0x34254e=a41_0x33da,_0x39f20a=_0x146c6b();while(!![]){try{const _0x154502=parseInt(_0x34254e(0x130))/0x1*(-parseInt(_0x34254e(0x113))/0x2)+parseInt(_0x34254e(0x12f))/0x3+-parseInt(_0x34254e(0x14a))/0x4*(-parseInt(_0x34254e(0x146))/0x5)+parseInt(_0x34254e(0x137))/0x6+-parseInt(_0x34254e(0x144))/0x7*(-parseInt(_0x34254e(0x10e))/0x8)+parseInt(_0x34254e(0x128))/0x9+parseInt(_0x34254e(0x10d))/0xa*(-parseInt(_0x34254e(0x120))/0xb);if(_0x154502===_0x483e5b)break;else _0x39f20a['push'](_0x39f20a['shift']());}catch(_0x116b43){_0x39f20a['push'](_0x39f20a['shift']());}}}(a41_0x5b68,0x87e6c));function a41_0x5b68(){const _0x199eec=['less','output','join','10AimnFW','33752CcnoKJ','filter','stringify','stdout','color','30068AaVEds','FINISHED','cmdout','[query]','[Object]','padEnd','object','debug','[logs]','noColor','cyan','varchar','write','7199126DEyYPw','log','─┴─','─┬─','keys','length','isInteger','boolean','3658581YsRiBj','format','Results\x20saved\x20to\x20','max','query','trim','number','84639cKJJBC','23PIZeSn','forEach','stderr','table','limit','jsonl','json','5234604TKqFBs','bigint','tsv','repeat','[rule]','error','stdin','map','sdk-result','[error]','entries','bold','spawn','91YZlnxZ','inherit','31435htsazP','-FXRSn','push','rule','124paTaYK','split','yellow','resolve','magenta','blue'];a41_0x5b68=function(){return _0x199eec;};return a41_0x5b68();}import{writeFileSync}from'fs';function a41_0x33da(_0x3efc56,_0x39bda9){_0x3efc56=_0x3efc56-0x107;const _0x5b686f=a41_0x5b68();let _0x33da6b=_0x5b686f[_0x3efc56];return _0x33da6b;}import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a41_0xbb618e from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x54536a){const _0x4ade6b=a41_0x33da;return _0x54536a[_0x4ade6b(0x129)]===_0x4ade6b(0x136)||_0x54536a['format']==='jsonl'||_0x54536a[_0x4ade6b(0x129)]===_0x4ade6b(0x139)||_0x54536a[_0x4ade6b(0x129)]===_0x4ade6b(0x133)||_0x54536a[_0x4ade6b(0x136)]===!![]||_0x54536a[_0x4ade6b(0x135)]===!![]||_0x54536a['tsv']===!![]||_0x54536a[_0x4ade6b(0x133)]===!![];}export function parseOutputOptions(_0x2b46cf){const _0x496145=a41_0x33da;return{'format':_0x2b46cf['format']||_0x496145(0x133),'output':_0x2b46cf['output']||'','limit':_0x2b46cf['limit'],'color':_0x2b46cf[_0x496145(0x112)],'noColor':_0x2b46cf[_0x496145(0x11c)]};}function convertSDKResultToQueryResult(_0x4db56c){const _0xf117e1=a41_0x33da,_0x48463c=[];if(_0x4db56c[_0xf117e1(0x125)]>0x0){const _0x3fdd1c=_0x4db56c[0x0];for(const [_0x1a4127,_0x477d63]of Object[_0xf117e1(0x141)](_0x3fdd1c)){let _0x4e6b9f=_0xf117e1(0x11e);if(typeof _0x477d63===_0xf117e1(0x12e))_0x4e6b9f=Number[_0xf117e1(0x126)](_0x477d63)?_0xf117e1(0x138):'double';else{if(typeof _0x477d63==='boolean')_0x4e6b9f=_0xf117e1(0x127);else _0x477d63===null&&(_0x4e6b9f=_0xf117e1(0x11e));}_0x48463c['push']({'name':_0x1a4127,'type':_0x4e6b9f});}}return{'queryId':_0xf117e1(0x13f),'columns':_0x48463c,'data':_0x4db56c,'stats':{'state':_0xf117e1(0x114),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x4db56c[_0xf117e1(0x125)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x42598f,_0x5c0526){const _0x1a5e89=convertSDKResultToQueryResult(_0x42598f);return formatQueryOutput(_0x1a5e89,_0x5c0526);}export async function formatQueryOutput(_0x24f4ab,_0x1b67c4){const _0x33e60d=a41_0x33da,{format:_0x3b537e,limit:_0x31ba91,output:_0x285fca,color:_0x4f43ee,noColor:_0x4216c6}=_0x1b67c4,_0x3edff6=Boolean(_0x285fca)&&!_0x4f43ee,_0x12e93d={'color':_0x4f43ee,'noColor':_0x4216c6||_0x3edff6};if(_0x3b537e==='table'){const _0x4c211f=shouldUseLess(_0x3b537e,_0x285fca);return formatAsTable(_0x24f4ab,_0x31ba91,_0x4c211f,_0x12e93d);}else{if(_0x3b537e===_0x33e60d(0x136))return formatAsJSON(_0x24f4ab,_0x12e93d);else return _0x3b537e==='jsonl'?formatAsJSONL(_0x24f4ab,_0x12e93d):formatQueryResult(_0x24f4ab,_0x3b537e);}}function shouldUseLess(_0x5f4239,_0x5c45e0){const _0x3e5f03=a41_0x33da;return(_0x5f4239===_0x3e5f03(0x133)||_0x5f4239==='list')&&process[_0x3e5f03(0x111)]['isTTY']&&!_0x5c45e0;}export function resolveOutputOptions(_0x58e968){const _0x5b1f01=a41_0x33da,_0x20ef70=resolveOutputFormat(_0x58e968['format'],_0x58e968[_0x5b1f01(0x10b)],_0x5b1f01(0x133));let _0x2cc0cd=typeof _0x58e968[_0x5b1f01(0x134)]==='number'?_0x58e968[_0x5b1f01(0x134)]:parseInt(_0x58e968[_0x5b1f01(0x134)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x48fd1f=_0x58e968[_0x5b1f01(0x10b)]||'';return shouldUseLess(_0x20ef70,_0x48fd1f)&&(_0x2cc0cd=Infinity),{'format':_0x20ef70,'output':_0x48fd1f,'limit':_0x2cc0cd,'color':_0x58e968[_0x5b1f01(0x112)],'noColor':_0x58e968['noColor']};}export function writeOutput(_0xd59dc6,_0x522c70,_0x29010d){const _0x51f631=a41_0x33da;return _0x522c70?(writeFileSync(_0x522c70,_0xd59dc6),console['error'](_0x51f631(0x12a)+_0x522c70),Promise[_0x51f631(0x107)]()):shouldUseLess(_0x29010d||'','')?new Promise(_0xb808b5=>{const _0x357d0f=_0x51f631,_0x20fe07=spawn(_0x357d0f(0x10a),[_0x357d0f(0x147)],{'stdio':['pipe','inherit',_0x357d0f(0x145)]});let _0x44df6a=![];_0x20fe07['on'](_0x357d0f(0x13c),()=>{const _0x53fafd=_0x357d0f;!_0x44df6a&&(_0x44df6a=!![],console[_0x53fafd(0x121)](_0xd59dc6),_0xb808b5());}),_0x20fe07['on']('close',()=>{!_0x44df6a&&(_0x44df6a=!![],_0xb808b5());}),_0x20fe07['on'](_0x357d0f(0x143),()=>{const _0x36d1f0=_0x357d0f;!_0x44df6a&&_0x20fe07['stdin']&&(_0x20fe07[_0x36d1f0(0x13d)]['on'](_0x36d1f0(0x13c),()=>{}),_0x20fe07[_0x36d1f0(0x13d)][_0x36d1f0(0x11f)](_0xd59dc6),_0x20fe07[_0x36d1f0(0x13d)]['end']());}),!_0x20fe07[_0x357d0f(0x13d)]&&(!_0x44df6a&&(_0x44df6a=!![],console[_0x357d0f(0x121)](_0xd59dc6),_0xb808b5()));}):(console[_0x51f631(0x121)](_0xd59dc6),Promise[_0x51f631(0x107)]());}export async function handleSDKOutput(_0x1795e1,_0x55f4ac){const _0x467297=a41_0x33da,_0x5df741=resolveOutputOptions(_0x55f4ac),_0x5e1832=await formatSDKOutput(_0x1795e1,_0x5df741);await writeOutput(_0x5e1832,_0x5df741['output']||undefined,_0x5df741[_0x467297(0x129)]);}export async function handleQueryOutput(_0xd0e447,_0x7389da){const _0x3eb4fe=a41_0x33da,_0x2a0d79=resolveOutputOptions(_0x7389da),_0x137d20=await formatQueryOutput(_0xd0e447,_0x2a0d79);await writeOutput(_0x137d20,_0x2a0d79[_0x3eb4fe(0x10b)]||undefined,_0x2a0d79[_0x3eb4fe(0x129)]);}async function formatSingleObject(_0x3e2115,_0x33596c){const _0x30dc9c=a41_0x33da,{format:_0x2c902d,color:_0x482fd1,noColor:_0x211a92}=_0x33596c,_0x249b5d={'color':_0x482fd1,'noColor':_0x211a92};if(_0x2c902d===_0x30dc9c(0x136)){if(shouldUseColor(_0x249b5d))return colorizeJSON(_0x3e2115,_0x249b5d);return JSON['stringify'](_0x3e2115,null,0x2);}else{if(_0x2c902d===_0x30dc9c(0x135)){if(shouldUseColor(_0x249b5d))return colorizeJSONCompact(_0x3e2115,_0x249b5d);return JSON['stringify'](_0x3e2115);}else{if(_0x2c902d===_0x30dc9c(0x139))return Object[_0x30dc9c(0x141)](_0x3e2115)['map'](([_0x5546eb,_0x23025c])=>_0x5546eb+'\x09'+_0x23025c)['join']('\x0a');else{const _0x5ddc38=Object[_0x30dc9c(0x141)](_0x3e2115);if(_0x5ddc38['length']===0x0)return'No\x20data';const _0x71f9c7=_0x3e2115['debug'],_0x5ce93b=_0x3e2115['query'],_0x446554=_0x3e2115['params'],_0x1b5814=_0x3e2115[_0x30dc9c(0x149)],_0x55767c=_0x5ce93b?typeof _0x5ce93b==='string'?_0x5ce93b:JSON[_0x30dc9c(0x110)](_0x5ce93b,null,0x2):undefined,_0x3cc883=_0x446554&&Object['keys'](_0x446554)['length']>0x0?JSON[_0x30dc9c(0x110)](_0x446554,null,0x2):undefined,_0x309ce6=_0x1b5814&&Object[_0x30dc9c(0x124)](_0x1b5814)[_0x30dc9c(0x125)]>0x0?JSON[_0x30dc9c(0x110)](_0x1b5814,null,0x2):undefined,_0xa106b5=_0x5ddc38[_0x30dc9c(0x10f)](([_0x141646])=>_0x141646!==_0x30dc9c(0x11a)&&_0x141646!==_0x30dc9c(0x12c)&&_0x141646!=='params'&&_0x141646!=='rule'),_0x538036=Math[_0x30dc9c(0x12b)](..._0xa106b5['map'](([_0x4e759f])=>_0x4e759f['length'])),_0x56824a=Math[_0x30dc9c(0x12b)](..._0xa106b5[_0x30dc9c(0x13e)](([,_0x3d73e8])=>{const _0x31f087=_0x30dc9c;try{const _0x49a638=_0x3d73e8===null||_0x3d73e8===undefined?'':typeof _0x3d73e8==='object'?JSON[_0x31f087(0x110)](_0x3d73e8):String(_0x3d73e8),_0x16a91d=_0x49a638[_0x31f087(0x14b)]('\x0a');return Math[_0x31f087(0x12b)](..._0x16a91d['map'](_0x4107f3=>_0x4107f3[_0x31f087(0x125)]),0x0);}catch{return 0x0;}}),0x14),_0x1673e3=[];_0x1673e3[_0x30dc9c(0x148)](colorBorder('┌─'+'─'['repeat'](_0x538036)+_0x30dc9c(0x123)+'─'[_0x30dc9c(0x13a)](_0x56824a)+'─┐',_0x249b5d)),_0xa106b5[_0x30dc9c(0x131)](([_0x32610b,_0x2d0ca6])=>{const _0x484a1b=_0x30dc9c;let _0x327d04;try{_0x327d04=_0x2d0ca6===null||_0x2d0ca6===undefined?'':typeof _0x2d0ca6===_0x484a1b(0x119)?JSON['stringify'](_0x2d0ca6):String(_0x2d0ca6);}catch{_0x327d04=_0x484a1b(0x117);}const _0x1f0bbe=_0x32610b[_0x484a1b(0x118)](_0x538036),_0x204ec8=_0x327d04[_0x484a1b(0x14b)]('\x0a');_0x204ec8[_0x484a1b(0x131)]((_0x16dd5e,_0x3dce8b)=>{const _0x3c9185=_0x484a1b,_0x47f2cd=colorBorder('│',_0x249b5d);_0x3dce8b===0x0?_0x1673e3[_0x3c9185(0x148)](_0x47f2cd+'\x20'+_0x1f0bbe+'\x20'+_0x47f2cd+'\x20'+_0x16dd5e[_0x3c9185(0x118)](_0x56824a)+'\x20'+_0x47f2cd):_0x1673e3[_0x3c9185(0x148)](_0x47f2cd+'\x20'+'\x20'[_0x3c9185(0x13a)](_0x538036)+'\x20'+_0x47f2cd+'\x20'+_0x16dd5e[_0x3c9185(0x118)](_0x56824a)+'\x20'+_0x47f2cd);});}),_0x1673e3[_0x30dc9c(0x148)](colorBorder('└─'+'─'['repeat'](_0x538036)+_0x30dc9c(0x122)+'─'['repeat'](_0x56824a)+'─┘',_0x249b5d));_0x55767c&&(_0x1673e3[_0x30dc9c(0x148)](''),_0x1673e3['push'](String(a41_0xbb618e[_0x30dc9c(0x14c)][_0x30dc9c(0x142)](_0x30dc9c(0x116)))),_0x1673e3[_0x30dc9c(0x148)](_0x55767c));_0x3cc883&&(_0x1673e3[_0x30dc9c(0x148)](''),_0x1673e3[_0x30dc9c(0x148)](String(a41_0xbb618e[_0x30dc9c(0x109)][_0x30dc9c(0x142)]('[params]'))),_0x1673e3['push'](_0x3cc883));_0x309ce6&&(_0x1673e3[_0x30dc9c(0x148)](''),_0x1673e3['push'](String(a41_0xbb618e[_0x30dc9c(0x108)]['bold'](_0x30dc9c(0x13b)))),_0x1673e3['push'](_0x309ce6));if(_0x71f9c7){if(_0x71f9c7[_0x30dc9c(0x132)]){_0x1673e3[_0x30dc9c(0x148)](''),_0x1673e3[_0x30dc9c(0x148)](String(a41_0xbb618e['red'][_0x30dc9c(0x142)](_0x30dc9c(0x140))));const _0x17226d=_0x71f9c7[_0x30dc9c(0x132)][_0x30dc9c(0x14b)]('\x0a');_0x17226d[_0x30dc9c(0x131)](_0x2ee81b=>{const _0x4b6cfa=_0x30dc9c;_0x2ee81b[_0x4b6cfa(0x12d)]()&&_0x1673e3[_0x4b6cfa(0x148)](_0x2ee81b);});}if(_0x71f9c7[_0x30dc9c(0x115)]){_0x1673e3[_0x30dc9c(0x148)](''),_0x1673e3[_0x30dc9c(0x148)](String(a41_0xbb618e[_0x30dc9c(0x11d)]['bold'](_0x30dc9c(0x11b))));const _0x406d5a=_0x71f9c7[_0x30dc9c(0x115)][_0x30dc9c(0x14b)]('\x0a');_0x406d5a['forEach'](_0x1be599=>{const _0x203dc3=_0x30dc9c;_0x1be599[_0x203dc3(0x12d)]()&&_0x1673e3[_0x203dc3(0x148)](_0x1be599);});}}return _0x1673e3[_0x30dc9c(0x10c)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x4767d2,_0x1caeb0){const _0x6ae11f=a41_0x33da;if(_0x1caeb0[_0x6ae11f(0x129)]==='table'){await handleSDKOutput([_0x4767d2],_0x1caeb0);return;}const _0x346876=resolveOutputOptions(_0x1caeb0),_0x2f2d4e=await formatSingleObject(_0x4767d2,_0x346876);await writeOutput(_0x2f2d4e,_0x346876[_0x6ae11f(0x10b)]||undefined,_0x346876[_0x6ae11f(0x129)]);}
1
+ (function(_0x571cdc,_0x37b252){const _0x373d47=a41_0x1368,_0x36b67d=_0x571cdc();while(!![]){try{const _0x46b1ae=parseInt(_0x373d47(0xd3))/0x1*(-parseInt(_0x373d47(0xda))/0x2)+parseInt(_0x373d47(0x105))/0x3*(parseInt(_0x373d47(0xee))/0x4)+-parseInt(_0x373d47(0x114))/0x5*(-parseInt(_0x373d47(0xf8))/0x6)+parseInt(_0x373d47(0xf5))/0x7*(parseInt(_0x373d47(0xd1))/0x8)+parseInt(_0x373d47(0xef))/0x9*(-parseInt(_0x373d47(0x112))/0xa)+parseInt(_0x373d47(0xea))/0xb+-parseInt(_0x373d47(0xdc))/0xc*(-parseInt(_0x373d47(0xf9))/0xd);if(_0x46b1ae===_0x37b252)break;else _0x36b67d['push'](_0x36b67d['shift']());}catch(_0x1e6324){_0x36b67d['push'](_0x36b67d['shift']());}}}(a41_0x5c4e,0x20fed));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';function a41_0x5c4e(){const _0xbd03f1=['stderr','[logs]','padEnd','noColor','[rule]','red','rule','varchar','jsonl','1556907fdALuN','map','join','end','1132QxhRMH','747ArAIfu','yellow','isTTY','max','list','filter','205471bbXZKi','boolean','keys','6gVPyDB','26IjgzRT','pipe','stdout','json','error','debug','stringify','length','format','number','color','tsv','1857wnXMDa','trim','forEach','query','sdk-result','log','output','stdin','inherit','resolve','less','[query]','-FXRSn','11350IwUnKC','write','72455QRvsKq','split','table','repeat','limit','8jQtzYt','No\x20data','69570nclcHs','entries','cmdout','string','[Object]','object','params','6OhGBkm','[error]','465036FCjyTM','push','bold','blue','FINISHED'];a41_0x5c4e=function(){return _0xbd03f1;};return a41_0x5c4e();}import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a41_0x59ae3d from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x1718a2){const _0x17c207=a41_0x1368;return _0x1718a2[_0x17c207(0x101)]===_0x17c207(0xfc)||_0x1718a2[_0x17c207(0x101)]===_0x17c207(0xe9)||_0x1718a2[_0x17c207(0x101)]===_0x17c207(0x104)||_0x1718a2[_0x17c207(0x101)]===_0x17c207(0x116)||_0x1718a2[_0x17c207(0xfc)]===!![]||_0x1718a2[_0x17c207(0xe9)]===!![]||_0x1718a2['tsv']===!![]||_0x1718a2[_0x17c207(0x116)]===!![];}export function parseOutputOptions(_0x3c6383){const _0x51b638=a41_0x1368;return{'format':_0x3c6383[_0x51b638(0x101)]||_0x51b638(0x116),'output':_0x3c6383[_0x51b638(0x10b)]||'','limit':_0x3c6383['limit'],'color':_0x3c6383[_0x51b638(0x103)],'noColor':_0x3c6383[_0x51b638(0xe4)]};}function convertSDKResultToQueryResult(_0x3c6045){const _0x5a07b4=a41_0x1368,_0x4ef229=[];if(_0x3c6045[_0x5a07b4(0x100)]>0x0){const _0x6d98e5=_0x3c6045[0x0];for(const [_0x4534bd,_0x274701]of Object['entries'](_0x6d98e5)){let _0x305754=_0x5a07b4(0xe8);if(typeof _0x274701===_0x5a07b4(0x102))_0x305754=Number['isInteger'](_0x274701)?'bigint':'double';else{if(typeof _0x274701===_0x5a07b4(0xf6))_0x305754=_0x5a07b4(0xf6);else _0x274701===null&&(_0x305754='varchar');}_0x4ef229[_0x5a07b4(0xdd)]({'name':_0x4534bd,'type':_0x305754});}}return{'queryId':_0x5a07b4(0x109),'columns':_0x4ef229,'data':_0x3c6045,'stats':{'state':_0x5a07b4(0xe0),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3c6045[_0x5a07b4(0x100)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x4a767b,_0x338d24){const _0x2b3857=convertSDKResultToQueryResult(_0x4a767b);return formatQueryOutput(_0x2b3857,_0x338d24);}export async function formatQueryOutput(_0x3affba,_0x53a97b){const _0x1423de=a41_0x1368,{format:_0x33640b,limit:_0xd209b5,output:_0x1e0e8b,color:_0x6e545d,noColor:_0x147150}=_0x53a97b,_0x1a329b=Boolean(_0x1e0e8b)&&!_0x6e545d,_0x466282={'color':_0x6e545d,'noColor':_0x147150||_0x1a329b};if(_0x33640b===_0x1423de(0x116)){const _0x25e2e0=shouldUseLess(_0x33640b,_0x1e0e8b);return formatAsTable(_0x3affba,_0xd209b5,_0x25e2e0,_0x466282);}else{if(_0x33640b===_0x1423de(0xfc))return formatAsJSON(_0x3affba,_0x466282);else return _0x33640b==='jsonl'?formatAsJSONL(_0x3affba,_0x466282):formatQueryResult(_0x3affba,_0x33640b);}}function shouldUseLess(_0x21c61b,_0x309fc8){const _0x27f9ff=a41_0x1368;return(_0x21c61b===_0x27f9ff(0x116)||_0x21c61b===_0x27f9ff(0xf3))&&process[_0x27f9ff(0xfb)][_0x27f9ff(0xf1)]&&!_0x309fc8;}export function resolveOutputOptions(_0x3fc95b){const _0x511c79=a41_0x1368,_0x46e70c=resolveOutputFormat(_0x3fc95b[_0x511c79(0x101)],_0x3fc95b['output'],'table');let _0x38d375=typeof _0x3fc95b[_0x511c79(0x118)]===_0x511c79(0x102)?_0x3fc95b[_0x511c79(0x118)]:parseInt(_0x3fc95b['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x582098=_0x3fc95b[_0x511c79(0x10b)]||'';return shouldUseLess(_0x46e70c,_0x582098)&&(_0x38d375=Infinity),{'format':_0x46e70c,'output':_0x582098,'limit':_0x38d375,'color':_0x3fc95b[_0x511c79(0x103)],'noColor':_0x3fc95b[_0x511c79(0xe4)]};}function a41_0x1368(_0x437b32,_0xc12778){_0x437b32=_0x437b32-0xd1;const _0x5c4e66=a41_0x5c4e();let _0x136898=_0x5c4e66[_0x437b32];return _0x136898;}export function writeOutput(_0x1e36a6,_0x329893,_0x205e12){const _0x267152=a41_0x1368;return _0x329893?(writeFileSync(_0x329893,_0x1e36a6),console['error']('Results\x20saved\x20to\x20'+_0x329893),Promise[_0x267152(0x10e)]()):shouldUseLess(_0x205e12||'','')?new Promise(_0x3828d0=>{const _0x841226=_0x267152,_0xc4b313=spawn(_0x841226(0x10f),[_0x841226(0x111)],{'stdio':[_0x841226(0xfa),'inherit',_0x841226(0x10d)]});let _0x55966b=![];_0xc4b313['on'](_0x841226(0xfd),()=>{!_0x55966b&&(_0x55966b=!![],console['log'](_0x1e36a6),_0x3828d0());}),_0xc4b313['on']('close',()=>{!_0x55966b&&(_0x55966b=!![],_0x3828d0());}),_0xc4b313['on']('spawn',()=>{const _0xb97066=_0x841226;!_0x55966b&&_0xc4b313['stdin']&&(_0xc4b313[_0xb97066(0x10c)]['on'](_0xb97066(0xfd),()=>{}),_0xc4b313['stdin'][_0xb97066(0x113)](_0x1e36a6),_0xc4b313[_0xb97066(0x10c)][_0xb97066(0xed)]());}),!_0xc4b313[_0x841226(0x10c)]&&(!_0x55966b&&(_0x55966b=!![],console[_0x841226(0x10a)](_0x1e36a6),_0x3828d0()));}):(console[_0x267152(0x10a)](_0x1e36a6),Promise[_0x267152(0x10e)]());}export async function handleSDKOutput(_0x554817,_0x1a5f09){const _0xaa5991=a41_0x1368,_0x4d977f=resolveOutputOptions(_0x1a5f09),_0x103a53=await formatSDKOutput(_0x554817,_0x4d977f);await writeOutput(_0x103a53,_0x4d977f[_0xaa5991(0x10b)]||undefined,_0x4d977f[_0xaa5991(0x101)]);}export async function handleQueryOutput(_0x2fec9a,_0x254723){const _0xd2e931=a41_0x1368,_0x1d4953=resolveOutputOptions(_0x254723),_0x2cbdc6=await formatQueryOutput(_0x2fec9a,_0x1d4953);await writeOutput(_0x2cbdc6,_0x1d4953['output']||undefined,_0x1d4953[_0xd2e931(0x101)]);}async function formatSingleObject(_0x5d7880,_0x49db0f){const _0x319367=a41_0x1368,{format:_0x2a5a4c,color:_0x469c40,noColor:_0x1ab9e8}=_0x49db0f,_0x434435={'color':_0x469c40,'noColor':_0x1ab9e8};if(_0x2a5a4c===_0x319367(0xfc)){if(shouldUseColor(_0x434435))return colorizeJSON(_0x5d7880,_0x434435);return JSON['stringify'](_0x5d7880,null,0x2);}else{if(_0x2a5a4c==='jsonl'){if(shouldUseColor(_0x434435))return colorizeJSONCompact(_0x5d7880,_0x434435);return JSON['stringify'](_0x5d7880);}else{if(_0x2a5a4c===_0x319367(0x104))return Object[_0x319367(0xd4)](_0x5d7880)[_0x319367(0xeb)](([_0x567320,_0xab26de])=>_0x567320+'\x09'+_0xab26de)[_0x319367(0xec)]('\x0a');else{const _0x5af293=Object[_0x319367(0xd4)](_0x5d7880);if(_0x5af293[_0x319367(0x100)]===0x0)return _0x319367(0xd2);const _0x12fb82=_0x5d7880[_0x319367(0xfe)],_0x121bb6=_0x5d7880[_0x319367(0x108)],_0x23ab77=_0x5d7880[_0x319367(0xd9)],_0x386e33=_0x5d7880[_0x319367(0xe7)],_0x4040c5=_0x121bb6?typeof _0x121bb6===_0x319367(0xd6)?_0x121bb6:JSON[_0x319367(0xff)](_0x121bb6,null,0x2):undefined,_0x452a46=_0x23ab77&&Object[_0x319367(0xf7)](_0x23ab77)['length']>0x0?JSON['stringify'](_0x23ab77,null,0x2):undefined,_0x58a290=_0x386e33&&Object[_0x319367(0xf7)](_0x386e33)['length']>0x0?JSON[_0x319367(0xff)](_0x386e33,null,0x2):undefined,_0x18bb0a=_0x5af293[_0x319367(0xf4)](([_0x1ad966])=>_0x1ad966!=='debug'&&_0x1ad966!=='query'&&_0x1ad966!=='params'&&_0x1ad966!==_0x319367(0xe7)),_0x298f87=Math[_0x319367(0xf2)](..._0x18bb0a[_0x319367(0xeb)](([_0x407b28])=>_0x407b28[_0x319367(0x100)])),_0x13b567=Math[_0x319367(0xf2)](..._0x18bb0a[_0x319367(0xeb)](([,_0x1f1518])=>{const _0xdf3cbc=_0x319367;try{const _0x415881=_0x1f1518===null||_0x1f1518===undefined?'':typeof _0x1f1518===_0xdf3cbc(0xd8)?JSON[_0xdf3cbc(0xff)](_0x1f1518):String(_0x1f1518),_0x5df29e=_0x415881[_0xdf3cbc(0x115)]('\x0a');return Math[_0xdf3cbc(0xf2)](..._0x5df29e[_0xdf3cbc(0xeb)](_0x375678=>_0x375678[_0xdf3cbc(0x100)]),0x0);}catch{return 0x0;}}),0x14),_0x59a84b=[];_0x59a84b[_0x319367(0xdd)](colorBorder('┌─'+'─'['repeat'](_0x298f87)+'─┬─'+'─'[_0x319367(0x117)](_0x13b567)+'─┐',_0x434435)),_0x18bb0a[_0x319367(0x107)](([_0x4db874,_0x37ad7d])=>{const _0x15b488=_0x319367;let _0x2c0739;try{_0x2c0739=_0x37ad7d===null||_0x37ad7d===undefined?'':typeof _0x37ad7d===_0x15b488(0xd8)?JSON['stringify'](_0x37ad7d):String(_0x37ad7d);}catch{_0x2c0739=_0x15b488(0xd7);}const _0x430686=_0x4db874[_0x15b488(0xe3)](_0x298f87),_0x30b7e5=_0x2c0739[_0x15b488(0x115)]('\x0a');_0x30b7e5[_0x15b488(0x107)]((_0x297ca7,_0x19b60a)=>{const _0xee3521=_0x15b488,_0x39b8f1=colorBorder('│',_0x434435);_0x19b60a===0x0?_0x59a84b[_0xee3521(0xdd)](_0x39b8f1+'\x20'+_0x430686+'\x20'+_0x39b8f1+'\x20'+_0x297ca7['padEnd'](_0x13b567)+'\x20'+_0x39b8f1):_0x59a84b[_0xee3521(0xdd)](_0x39b8f1+'\x20'+'\x20'['repeat'](_0x298f87)+'\x20'+_0x39b8f1+'\x20'+_0x297ca7[_0xee3521(0xe3)](_0x13b567)+'\x20'+_0x39b8f1);});}),_0x59a84b[_0x319367(0xdd)](colorBorder('└─'+'─'[_0x319367(0x117)](_0x298f87)+'─┴─'+'─'['repeat'](_0x13b567)+'─┘',_0x434435));_0x4040c5&&(_0x59a84b[_0x319367(0xdd)](''),_0x59a84b['push'](String(a41_0x59ae3d[_0x319367(0xf0)][_0x319367(0xde)](_0x319367(0x110)))),_0x59a84b[_0x319367(0xdd)](_0x4040c5));_0x452a46&&(_0x59a84b[_0x319367(0xdd)](''),_0x59a84b[_0x319367(0xdd)](String(a41_0x59ae3d[_0x319367(0xdf)][_0x319367(0xde)]('[params]'))),_0x59a84b['push'](_0x452a46));_0x58a290&&(_0x59a84b[_0x319367(0xdd)](''),_0x59a84b[_0x319367(0xdd)](String(a41_0x59ae3d['magenta'][_0x319367(0xde)](_0x319367(0xe5)))),_0x59a84b['push'](_0x58a290));if(_0x12fb82){if(_0x12fb82[_0x319367(0xe1)]){_0x59a84b[_0x319367(0xdd)](''),_0x59a84b[_0x319367(0xdd)](String(a41_0x59ae3d[_0x319367(0xe6)][_0x319367(0xde)](_0x319367(0xdb))));const _0x2307a1=_0x12fb82[_0x319367(0xe1)]['split']('\x0a');_0x2307a1[_0x319367(0x107)](_0x3707f2=>{const _0x5e0168=_0x319367;_0x3707f2[_0x5e0168(0x106)]()&&_0x59a84b[_0x5e0168(0xdd)](_0x3707f2);});}if(_0x12fb82['cmdout']){_0x59a84b['push'](''),_0x59a84b['push'](String(a41_0x59ae3d['cyan'][_0x319367(0xde)](_0x319367(0xe2))));const _0x351c4f=_0x12fb82[_0x319367(0xd5)][_0x319367(0x115)]('\x0a');_0x351c4f[_0x319367(0x107)](_0x5961a5=>{const _0x3d3a9a=_0x319367;_0x5961a5[_0x3d3a9a(0x106)]()&&_0x59a84b['push'](_0x5961a5);});}}return _0x59a84b[_0x319367(0xec)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x49d2da,_0x264e59){const _0x337c7e=a41_0x1368;if(_0x264e59[_0x337c7e(0x101)]===_0x337c7e(0x116)){await handleSDKOutput([_0x49d2da],_0x264e59);return;}const _0x4f85da=resolveOutputOptions(_0x264e59),_0x3c020d=await formatSingleObject(_0x49d2da,_0x4f85da);await writeOutput(_0x3c020d,_0x4f85da[_0x337c7e(0x10b)]||undefined,_0x4f85da[_0x337c7e(0x101)]);}