@treasuredata/tdx 2026.3.3 → 2026.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/delivery-command.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-campaign-pull-command.js +1 -1
  20. package/dist/commands/engage-campaign-push-command.js +1 -1
  21. package/dist/commands/engage-campaign-validate-command.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/engage-template-pull-command.js +1 -1
  24. package/dist/commands/engage-template-push-command.js +1 -1
  25. package/dist/commands/engage-template-validate-command.js +1 -1
  26. package/dist/commands/job-command.js +1 -1
  27. package/dist/commands/journey-command.js +1 -1
  28. package/dist/commands/journey-validate-command.js +1 -1
  29. package/dist/commands/llm-command.js +1 -1
  30. package/dist/commands/mcp-command.js +1 -1
  31. package/dist/commands/parent-segment-command.js +1 -1
  32. package/dist/commands/profile-command.js +1 -1
  33. package/dist/commands/profiles-command.js +1 -1
  34. package/dist/commands/query-command.js +1 -1
  35. package/dist/commands/schedule-command.js +1 -1
  36. package/dist/commands/segment-command.js +1 -1
  37. package/dist/commands/segment-create-command.js +1 -1
  38. package/dist/commands/segment-fields-command.js +1 -1
  39. package/dist/commands/segment-pull-command.js +1 -1
  40. package/dist/commands/segment-push-command.js +1 -1
  41. package/dist/commands/segment-update-command.js +1 -1
  42. package/dist/commands/segment-use-command.js +1 -1
  43. package/dist/commands/segment-validate-command.js +1 -1
  44. package/dist/commands/segments.js +1 -1
  45. package/dist/commands/show.js +1 -1
  46. package/dist/commands/status-command.js +1 -1
  47. package/dist/commands/tables.js +1 -1
  48. package/dist/commands/unset-command.js +1 -1
  49. package/dist/commands/upgrade-command.js +1 -1
  50. package/dist/commands/use-command.js +1 -1
  51. package/dist/commands/user-command.js +1 -1
  52. package/dist/commands/workflow-command.js +1 -1
  53. package/dist/core/auth.js +1 -1
  54. package/dist/core/command-output.js +1 -1
  55. package/dist/core/config.js +1 -1
  56. package/dist/core/connection-cache.js +1 -1
  57. package/dist/core/constants.js +1 -1
  58. package/dist/core/credential-cache.js +1 -1
  59. package/dist/core/global-context.js +1 -1
  60. package/dist/core/keychain.js +1 -1
  61. package/dist/core/profile.js +1 -1
  62. package/dist/core/project-config.js +1 -1
  63. package/dist/core/session.js +1 -1
  64. package/dist/core/user-cache.js +1 -1
  65. package/dist/core/version.js +1 -1
  66. package/dist/index.js +1 -1
  67. package/dist/mcp/server.js +1 -1
  68. package/dist/mcp/tools/index.js +1 -1
  69. package/dist/mcp/tools/tdx-run.js +1 -1
  70. package/dist/mcp/tools/tdx-search.js +1 -1
  71. package/dist/mcp/utils.js +1 -1
  72. package/dist/proxy/claude-usage-tracker.js +1 -1
  73. package/dist/proxy/passthrough-server.js +1 -1
  74. package/dist/proxy/sse-usage-parser.js +1 -1
  75. package/dist/sdk/agent/agent-config.js +1 -1
  76. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  77. package/dist/sdk/agent/agent-yaml.js +1 -1
  78. package/dist/sdk/agent/test/evaluator.js +1 -1
  79. package/dist/sdk/agent/test/executor.js +1 -1
  80. package/dist/sdk/agent/test/index.js +1 -1
  81. package/dist/sdk/agent/test/output.js +1 -1
  82. package/dist/sdk/agent/test/parser.js +1 -1
  83. package/dist/sdk/agent/tool-target-registry.js +1 -1
  84. package/dist/sdk/api.js +1 -1
  85. package/dist/sdk/client/cdp-api-client.js +1 -1
  86. package/dist/sdk/client/delivery-api-client.js +1 -1
  87. package/dist/sdk/client/endpoints.js +1 -1
  88. package/dist/sdk/client/engage-api-client.js +1 -1
  89. package/dist/sdk/client/http-client.js +1 -1
  90. package/dist/sdk/client/llm-api-client.js +1 -1
  91. package/dist/sdk/client/rate-limiter.js +1 -1
  92. package/dist/sdk/client/td-api-client.js +1 -1
  93. package/dist/sdk/client/trino-api-client.js +1 -1
  94. package/dist/sdk/client/workflow-client.js +1 -1
  95. package/dist/sdk/connection-validator.js +1 -1
  96. package/dist/sdk/connection.js +1 -1
  97. package/dist/sdk/delivery.js +1 -1
  98. package/dist/sdk/engage/campaign-pull.js +1 -1
  99. package/dist/sdk/engage/campaign-push.js +1 -1
  100. package/dist/sdk/engage/campaign-validator.js +1 -1
  101. package/dist/sdk/engage/campaign-yaml.js +1 -1
  102. package/dist/sdk/engage/template-pull.js +1 -1
  103. package/dist/sdk/engage/template-push.js +1 -1
  104. package/dist/sdk/engage/template-validator.js +1 -1
  105. package/dist/sdk/engage/template-yaml.js +1 -1
  106. package/dist/sdk/engage/types/campaign-def.js +1 -1
  107. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  108. package/dist/sdk/engage/types/template-schema.js +1 -1
  109. package/dist/sdk/engage.js +1 -1
  110. package/dist/sdk/errors.js +1 -1
  111. package/dist/sdk/index.js +1 -1
  112. package/dist/sdk/io/index.js +1 -1
  113. package/dist/sdk/io/node-filesystem.js +1 -1
  114. package/dist/sdk/job.js +1 -1
  115. package/dist/sdk/journey.js +1 -1
  116. package/dist/sdk/llm/chat-cache.js +1 -1
  117. package/dist/sdk/llm/index.js +1 -1
  118. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  119. package/dist/sdk/llm/model-factors.js +1 -1
  120. package/dist/sdk/personalization.js +1 -1
  121. package/dist/sdk/query/index.js +1 -1
  122. package/dist/sdk/query/sql-parser.js +1 -1
  123. package/dist/sdk/realtime.js +1 -1
  124. package/dist/sdk/schedule.js +1 -1
  125. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  126. package/dist/sdk/segment/fields-display.js +1 -1
  127. package/dist/sdk/segment/file-discovery.js +1 -1
  128. package/dist/sdk/segment/journey-utils.js +1 -1
  129. package/dist/sdk/segment/journey-validator.js +1 -1
  130. package/dist/sdk/segment/journey-yaml.js +1 -1
  131. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  132. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  133. package/dist/sdk/segment/pull-workflow.js +1 -1
  134. package/dist/sdk/segment/push-recovery.js +1 -1
  135. package/dist/sdk/segment/push-workflow.js +1 -1
  136. package/dist/sdk/segment/resolution-context.js +1 -1
  137. package/dist/sdk/segment/segment-path-parser.js +1 -1
  138. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  139. package/dist/sdk/segment/segment-validator.js +1 -1
  140. package/dist/sdk/segment/target-resolution.js +1 -1
  141. package/dist/sdk/segment/tdx-config.js +1 -1
  142. package/dist/sdk/segment/types/activation-schema.js +1 -1
  143. package/dist/sdk/segment/types/journey-def.js +1 -1
  144. package/dist/sdk/segment/types/journey-schema.js +1 -1
  145. package/dist/sdk/segment/types/segment-def.js +1 -1
  146. package/dist/sdk/segment/types/segment-schema.js +1 -1
  147. package/dist/sdk/segment/validate-files.js +1 -1
  148. package/dist/sdk/segment/yaml-validator.js +1 -1
  149. package/dist/sdk/segment.js +1 -1
  150. package/dist/sdk/types/index.js +1 -1
  151. package/dist/sdk/types/progress.js +1 -1
  152. package/dist/sdk/user.js +1 -1
  153. package/dist/sdk/util/format-detector.js +1 -1
  154. package/dist/sdk/util/formatters.js +1 -1
  155. package/dist/sdk/util/index.js +1 -1
  156. package/dist/sdk/util/paginate.js +1 -1
  157. package/dist/sdk/util/tree-formatter.js +1 -1
  158. package/dist/sdk/workflow/archive-validation.js +1 -1
  159. package/dist/sdk/workflow/clone-workflow.js +1 -1
  160. package/dist/sdk/workflow/index.js +1 -1
  161. package/dist/sdk/workflow/pull-workflow.js +1 -1
  162. package/dist/sdk/workflow/push-workflow.js +1 -1
  163. package/dist/sdk/workflow/tdx-config.js +1 -1
  164. package/dist/sdk/workflow/workflow-utils.js +1 -1
  165. package/dist/test-utils/command-runner.js +1 -1
  166. package/dist/test-utils/factories.js +1 -1
  167. package/dist/test-utils/fixtures.js +1 -1
  168. package/dist/test-utils/http-mock.js +1 -1
  169. package/dist/test-utils/index.js +1 -1
  170. package/dist/utils/async.js +1 -1
  171. package/dist/utils/colors.js +1 -1
  172. package/dist/utils/diff.js +1 -1
  173. package/dist/utils/file-permissions.js +1 -1
  174. package/dist/utils/file-reader.js +1 -1
  175. package/dist/utils/github-releases.js +1 -1
  176. package/dist/utils/global-cache.js +1 -1
  177. package/dist/utils/json-loader.js +1 -1
  178. package/dist/utils/local-cache.js +1 -1
  179. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  180. package/dist/utils/logger/formatters/index.js +1 -1
  181. package/dist/utils/logger/handlers/console-handler.js +1 -1
  182. package/dist/utils/logger/handlers/file-handler.js +1 -1
  183. package/dist/utils/logger/handlers/index.js +1 -1
  184. package/dist/utils/logger/handlers/null-handler.js +1 -1
  185. package/dist/utils/logger/index.js +1 -1
  186. package/dist/utils/logger/logger.js +1 -1
  187. package/dist/utils/logger/types.js +1 -1
  188. package/dist/utils/option-validation.js +1 -1
  189. package/dist/utils/process.js +1 -1
  190. package/dist/utils/prompt.js +1 -1
  191. package/dist/utils/spinner.js +1 -1
  192. package/dist/utils/sse-parser.js +1 -1
  193. package/dist/utils/string-utils.js +1 -1
  194. package/dist/utils/table-ref-parser.js +1 -1
  195. package/dist/utils/tdx-logger.js +1 -1
  196. package/dist/utils/version-check.js +1 -1
  197. package/package.json +1 -1
@@ -1 +1 @@
1
- const a50_0x718729=a50_0x42f7;(function(_0x891756,_0x342fca){const _0x399088=a50_0x42f7,_0x14323c=_0x891756();while(!![]){try{const _0x4ea5c9=-parseInt(_0x399088(0x312))/0x1+parseInt(_0x399088(0x27e))/0x2*(parseInt(_0x399088(0x2b3))/0x3)+-parseInt(_0x399088(0x323))/0x4+-parseInt(_0x399088(0x341))/0x5*(-parseInt(_0x399088(0x270))/0x6)+-parseInt(_0x399088(0x2c7))/0x7+parseInt(_0x399088(0x218))/0x8+-parseInt(_0x399088(0x34a))/0x9;if(_0x4ea5c9===_0x342fca)break;else _0x14323c['push'](_0x14323c['shift']());}catch(_0x3ff9b1){_0x14323c['push'](_0x14323c['shift']());}}}(a50_0x54dc,0x3af76));import a50_0x3872fc from'chalk';import{existsSync}from'fs';import a50_0x2b6305 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a50_0x6abfdd from'prompts';function getAttemptStatusDisplay(_0x46c4db){const _0x29d288=a50_0x42f7;if(!_0x46c4db)return{'icon':'⏳','text':''};const {done:_0x1d8f37,success:_0x3ceed5,cancelRequested:_0xf0c317}=_0x46c4db;if(!_0x1d8f37)return _0xf0c317?{'icon':'🛑','text':a50_0x3872fc[_0x29d288(0x303)]('canceling')}:{'icon':'🔄','text':a50_0x3872fc[_0x29d288(0x256)]('running')};if(_0x3ceed5)return{'icon':'✅','text':a50_0x3872fc['green']('success')};return{'icon':'❌','text':a50_0x3872fc[_0x29d288(0x2fd)](_0x29d288(0x25b))};}export class WorkflowBaseCommand extends BaseCommand{[a50_0x718729(0x207)](_0x46536b,_0x307f66,_0xd20f50=0x0){const _0x5dab88=a50_0x718729;return _0x46536b[_0xd20f50]||_0x307f66[_0x5dab88(0x371)];}[a50_0x718729(0x361)](_0x1f0899,_0x4b8efc,_0x3832b1=0x0){const _0x10b300=a50_0x718729,_0x1c5e3b=this[_0x10b300(0x207)](_0x1f0899,_0x4b8efc,_0x3832b1);if(!_0x1c5e3b)return console[_0x10b300(0x25b)](a50_0x3872fc['red'](_0x10b300(0x215)),_0x10b300(0x2da)),console[_0x10b300(0x25b)](a50_0x3872fc['dim'](_0x10b300(0x29e))),null;return _0x1c5e3b;}['parseProjectWorkflowPattern'](_0x41f9dc,_0x18ef47){const _0x1c97db=a50_0x718729;if(_0x41f9dc[0x0]){const _0x3c3b6d=_0x41f9dc[0x0][_0x1c97db(0x36b)]('.');if(_0x3c3b6d[_0x1c97db(0x2f1)]===0x1)return{'projectName':_0x3c3b6d[0x0],'workflowName':undefined};else return _0x3c3b6d[_0x1c97db(0x2f1)]===0x2?{'projectName':_0x3c3b6d[0x0],'workflowName':_0x3c3b6d[0x1]}:(console['error'](a50_0x3872fc[_0x1c97db(0x2fd)]('Error:'),_0x1c97db(0x258)),null);}return{'projectName':_0x18ef47[_0x1c97db(0x371)],'workflowName':undefined};}['resolveProjectDir'](_0x5bf1b0,_0x345cfc,_0x1b5388=0x0){const _0x19a53a=a50_0x718729;if(_0x5bf1b0[_0x1b5388])return _0x5bf1b0[_0x1b5388];if(_0x345cfc[_0x19a53a(0x371)]){const _0x475d36=a50_0x2b6305['join'](process[_0x19a53a(0x389)](),_0x19a53a(0x38c),_0x345cfc['workflowProject']);if(existsSync(a50_0x2b6305[_0x19a53a(0x370)](_0x475d36,'tdx.json')))return _0x475d36;}return undefined;}async['showWorkflowConsoleUrl'](_0x17c19b,_0x4bdff7,_0x32beda){const _0x5754e7=a50_0x718729;try{const _0xc489ec=await _0x17c19b[_0x5754e7(0x30c)][_0x5754e7(0x38c)](_0x4bdff7,{'limit':0x1});if(_0xc489ec[_0x5754e7(0x2f1)]>0x0){const _0x388116=_0xc489ec[0x0]['id'],_0x4278a1=getWorkflowUrl(_0x32beda,_0x388116);console[_0x5754e7(0x25b)]('\x20\x20Console:\x20'+a50_0x3872fc[_0x5754e7(0x2bb)](_0x4278a1));}}catch{}}}function a50_0x54dc(){const _0xcb5f22=['length','cancelRequested','log','✔\x20Push\x20complete','json','Including\x20subtasks:\x20yes','workflow:sessions','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','buildTimelineData','match','tdx\x20wf\x20attempt\x20','kill','red','Deleting\x20project\x20','prepareCloneProject','startedAt','all','max','yellow','duration','workflow:download','Resolving\x20project\x20\x27','No\x20attempts\x20found\x20for:\x20','Pulling\x20project\x20','tasks','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','newProjectName','workflow','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)',',\x20Workflow:\x20','revision','yes','235543EYylwn','skipValidation','retrySession','✔\x20Project:\x20','-\x20nothing\x20pushed','Downloading\x20logs...','Source\x20directory\x20is\x20required','\x20\x20Revision:\x20','keys','stringify','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','⚠\x20Showing\x20first\x20','slice','✔\x20Showing\x20','/attempt/','has','diff','1126380XmDkpo','project','List\x20workflows','Expected\x20format:\x20--param\x20key=value','\x20of\x20','Include\x20retried:\x20yes','select','changes','canceling','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','\x20is\x20not\x20a\x20directory','navigateSessionsInteractive','No\x20log\x20files\x20found\x20for\x20this\x20attempt','\x20\x20tdx\x20wf\x20use\x20<project>','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','group_error','startsWith','No\x20projects\x20match\x20pattern:\x20','Analyzing\x20changes...','includes','...','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Filter:\x20project=','No\x20workflow\x20projects\x20found','→\x20Project:\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','Pull\x20workflow\x20project\x20to\x20local\x20folder','Attempt\x20ID:\x20','unknown','\x20logs','1137365ZQMjdt','retryAttemptName','workflow:clone','Session\x20time:\x20','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','\x1b[1A\x1b[2K','planned','autocomplete','fs/promises','1215117VAjQrN','attempt','workflow:secrets:set','Dry\x20run:\x20yes','\x20(system)','reason','deleted','No\x20attempts\x20found','\x20to\x20see\x20detailed\x20logs','MAX_POLL_ITERATIONS','param','✔\x20Secret\x20\x27','format','\x20project','execute','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','getTime','\x27...','Pushing\x20workflow\x20project...','toISOString','padStart','sessionTime','fullName','requireProject','\x22\x20already\x20exists\x20(ID:\x20','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','Key:\x20','stat','limit','resolve','workflow:upload','Pattern:\x20','MAX_TIMELINE_WIDTH','split','includeRetried','ICON_SPACING','session_id','\x20modified','join','workflowProject','Error:\x20Invalid\x20JSON\x20in\x20--params','From\x20task:\x20','rows','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','modified','ICON_WIDTH','Listing\x20workflow\x20projects...','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','relative','Params:\x20','name','Invalid\x20format:\x20','sessions','description','clear','\x20\x20Files\x20extracted:\x20','\x22\x20to\x20new\x20project\x20\x22','Attempt:\x20','lastAttempt','list','output','values','status','cwd','dryRun','trim','workflows','push','Show\x20tasks\x20for\x20an\x20attempt','Failed\x20to\x20fetch\x20attempt\x20data','getDate','No\x20workflow\x20sessions\x20found','No\x20sessions\x20with\x20timing\x20information','🔄\x20','\x0aDry\x20run\x20-\x20nothing\x20pushed','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Analyzing\x20project...','sourceProjectName','Listing\x20workflows...','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','LABEL_MIN_SPACING','\x0aError:','session:','✔\x20Project\x20updated','.\x20Expected\x20format:\x20KEY=VALUE','state','unchanged','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','\x0aDry\x20run\x20-\x20no\x20files\x20written','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Filter:\x20','sessionId','generateSessionTimelineRows','existingProjectId','path','workflow:projects','getFullYear','isTTY','\x20new','resolveProject','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x22\x20with\x20new\x20revision?','find','Writing\x20files...','/app/workflows/','✔\x20Pushed\x20','Select\x20a\x20session\x20to\x20view\x20timeline:','write','\x20\x20Session\x20ID:\x20','\x20\x20Target:\x20','Revision:\x20','set','verbose','Error:','renderSingleTimeline','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','3382448BhBMjJ','icon','\x0a⚠\x20Project\x20\x22','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','/sessions/','isNewProject','dim','✔\x20Workflow\x20run\x20started','context','done','(use\x20--limit\x20to\x20see\x20more)','LABEL_WIDTH_DIVISOR','\x20has\x20no\x20attempts','index','Status:\x20','Files\x20to\x20upload:\x20','Source\x20project:\x20','durationMs','\x20\x20Location:\x20','MAX_LABEL_COUNT','includeSubtasks','Updating\x20','text','fill','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','min','targetDir','\x20\x20Workflow:\x20','parse','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Project\x20filter:\x20','No\x20sessions\x20found\x20in\x20project:\x20','\x20secret','Loading\x20session...','Target:\x20','now','total','Loading\x20workflows...','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','workflow:run','\x20workflow','Retrying\x20session...','listSecrets','projects','projectName','trimEnd','Starting\x20workflow\x20run...','\x20\x20Attempt\x20ID:\x20','Latest\x20session\x20has\x20no\x20attempt','workflow:use','pollTimeline','Pushing\x20project...','hasChanges','success','fileSize','\x0aPush\x20these\x20changes?','Using\x20attempt\x20','(unknown)','toLowerCase','site','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','\x20tasks','blue','Error:\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Warning:','pullProject','error','📁\x20','parseProjectWorkflowPattern','splice','No\x20log\x20content\x20found','Listing\x20workflow\x20attempts...','running','key','MIN_LABEL_COUNT','resolveProjectId','logFiles','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','✔\x20Workflow\x20project\x20context\x20cleared.','params','\x0aClone\x20\x22','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','message','floor','title','getMonth','Task\x20name:\x20','12MwnTqw','\x20sessions\x20','workflowName','executeCloneProject','Retry\x20a\x20session\x20or\x20attempt','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','No\x20workflows\x20found','filter','✔\x20Pull\x20complete','Error:\x20Invalid\x20parameter\x20format:\x20','\x20\x20Changes:\x20','TASK_NAME_WIDTH','stdout','new','8958pLkGCn','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Cancelled','Project:\x20','\x0aDry\x20run\x20-\x20no\x20project\x20created','workflow:retry','Workflow:\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','basename','\x22?\x20This\x20cannot\x20be\x20undone.','Listing\x20secrets...','\x20(use\x20--limit\x20to\x20show\x20more)','repeat','Target\x20directory:\x20','\x20-\x20','sort','✔\x20Retry\x20started','attempts','\x20deleted','\x0aApply\x20these\x20changes?','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','\x0a✔\x20Already\x20up\x20to\x20date','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','📋\x20','delete','resolveProjectDir','Killing\x20attempt...','Show\x20logs\x20for\x20a\x20workflow\x20attempt','summary','Validation:\x20skipped','workflow:logs','isArray','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','\x20\x20New\x20attempt\x20ID:\x20','---\x20','size','retryAttempt','get','finishedAt','\x27\x20from\x20project\x20\x27','Deleting\x20secret...','follow','sourceDir','workflow:secrets:list','Project\x20directory:\x20','workflow:kill','metadata','List\x20all\x20workflow\x20projects','renderSessionsTimeline','\x0aPolling...\x20(','startTime','start','from','81ZmgcfW','end','displayLine','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Auto-selected\x20latest\x20session:\x20','Session\x20not\x20found:\x20','\x20unchanged','cyan','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','window','Key\x20cannot\x20be\x20empty','✔\x20Found\x20','List\x20workflow\x20execution\x20sessions','No\x20sessions\x20found\x20for:\x20','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Source\x20directory:\x20','run','columns','Force:\x20yes','735056vrTfGq','\x20\x20Project\x20ID:\x20','targetExists','download','map','createdAt','Reason:\x20','table','Output\x20directory:\x20','some','💡\x20Tip:\x20Use\x20','replace','executePushProject','updatedAt','fromTask','workflow:tasks','\x0aUpdate\x20existing\x20project\x20\x22','jsonl','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Project\x20name\x20is\x20required','localeCompare','data','renderTimeline','type','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','task','Usage:\x20tdx\x20wf\x20use\x20<project>','session','green','workflow:pull','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','fileCount','Retrying\x20attempt...','New\x20project\x20name:\x20','\x20\x20Session\x20context\x20set\x20to:\x20','force','attemptId','showWorkflowConsoleUrl','substring','Error:\x20Attempt\x20ID\x20is\x20required','indexOf'];a50_0x54dc=function(){return _0xcb5f22;};return a50_0x54dc();}export class WorkflowUseCommand extends BaseCommand{[a50_0x718729(0x37c)]=a50_0x718729(0x249);[a50_0x718729(0x37f)]=a50_0x718729(0x395);async['execute'](_0x41f09f){const _0x2fe2e7=a50_0x718729,{options:_0x369907,args:_0x4d0d39,tdx:_0x237b5b}=_0x41f09f,_0x3ef992=_0x4d0d39[0x0],_0x5207f1=_0x369907[_0x2fe2e7(0x380)];if(_0x5207f1)return saveSessionContext({'workflow_project':undefined},_0x369907[_0x2fe2e7(0x2e2)]),console[_0x2fe2e7(0x2f3)](a50_0x3872fc[_0x2fe2e7(0x2e3)](_0x2fe2e7(0x267))),0x0;if(!_0x3ef992)return console[_0x2fe2e7(0x25b)](a50_0x3872fc[_0x2fe2e7(0x2fd)](_0x2fe2e7(0x215)),_0x2fe2e7(0x2da)),console['error'](a50_0x3872fc[_0x2fe2e7(0x21e)](_0x2fe2e7(0x2e1))),console['error'](a50_0x3872fc[_0x2fe2e7(0x21e)](_0x2fe2e7(0x1fb))),0x1;const _0x5e60a1=await withSpinner(_0x2fe2e7(0x306)+_0x3ef992+_0x2fe2e7(0x35b),()=>_0x237b5b[_0x2fe2e7(0x30c)][_0x2fe2e7(0x264)](_0x3ef992),{'verbose':_0x369907[_0x2fe2e7(0x214)]}),{name:_0x52cc3a}=_0x5e60a1[_0x2fe2e7(0x2dc)];return saveSessionContext({'workflow_project':_0x52cc3a},_0x369907[_0x2fe2e7(0x2e2)]),console['log'](a50_0x3872fc['green']('✔\x20Workflow\x20project\x20set\x20to:\x20'+a50_0x3872fc['cyan'](_0x52cc3a))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a50_0x718729(0x37c)]=a50_0x718729(0x203);[a50_0x718729(0x37f)]=a50_0x718729(0x2ad);async['execute'](_0x1d48c6){const _0xc6a8b6=a50_0x718729,{options:_0x25b4f7,args:_0x1e4205,tdx:_0x134992}=_0x1d48c6,_0x188a1a=_0x1e4205[0x0];_0x25b4f7['verbose']&&_0x188a1a&&console[_0xc6a8b6(0x25b)](_0xc6a8b6(0x369)+_0x188a1a);const _0x2ce776=await withSpinner(_0xc6a8b6(0x378),()=>_0x134992[_0xc6a8b6(0x30c)][_0xc6a8b6(0x243)](_0x188a1a,{'limit':_0x25b4f7['limit']}),{'verbose':_0x25b4f7[_0xc6a8b6(0x214)]});let _0x275bf8=_0x2ce776[_0xc6a8b6(0x2dc)];_0x275bf8['sort']((_0x104da9,_0x190b11)=>_0x104da9[_0xc6a8b6(0x37c)][_0xc6a8b6(0x2db)](_0x190b11['name']));const _0xa4833e=_0x25b4f7[_0xc6a8b6(0x366)]||0x64,_0x5ed6f9=_0x275bf8[_0xc6a8b6(0x2f1)]>=_0xa4833e?a50_0x3872fc['dim'](_0xc6a8b6(0x289)):'';console[_0xc6a8b6(0x25b)](_0xc6a8b6(0x2bf)+_0x275bf8['length']+_0xc6a8b6(0x357)+(_0x275bf8['length']!==0x1?'s':'')+_0x5ed6f9);if(_0x25b4f7[_0xc6a8b6(0x356)]===_0xc6a8b6(0x2f5)||_0x25b4f7['format']==='jsonl'||_0x25b4f7[_0xc6a8b6(0x356)]===_0xc6a8b6(0x2ce))await handleSDKOutput(_0x275bf8,_0x25b4f7);else{if(_0x275bf8[_0xc6a8b6(0x2f1)]===0x0)_0x188a1a?console[_0xc6a8b6(0x2f3)](_0xc6a8b6(0x334)+_0x188a1a):console[_0xc6a8b6(0x2f3)](_0xc6a8b6(0x33a));else{const _0x57f9cf=_0x275bf8['map'](_0x15e980=>{const _0x5e0eac=_0xc6a8b6,_0x3d9f96=_0x15e980[_0x5e0eac(0x2ac)]?.[_0x5e0eac(0x2d0)](_0x56b3e6=>_0x56b3e6['key']==='sys'),_0x118f0d=_0x3d9f96?a50_0x3872fc['dim'](_0x5e0eac(0x34e)):'';return _0x5e0eac(0x25c)+_0x15e980[_0x5e0eac(0x37c)]+_0x118f0d;});await writeOutput(_0x57f9cf['join']('\x0a'),_0x25b4f7['output'],_0xc6a8b6(0x385));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a50_0x718729(0x37c)]='workflow:workflows';[a50_0x718729(0x37f)]=a50_0x718729(0x325);async[a50_0x718729(0x358)](_0x1cc453){const _0x15b98d=a50_0x718729,{options:_0xa3d6fa,args:_0x44554e,tdx:_0x183a02}=_0x1cc453,_0x15cece=this[_0x15b98d(0x207)](_0x44554e,_0xa3d6fa);_0xa3d6fa['verbose']&&_0x15cece&&console['error'](_0x15b98d(0x236)+_0x15cece);const _0x43ba50=await withSpinner(_0x15b98d(0x398),()=>_0x183a02[_0x15b98d(0x30c)][_0x15b98d(0x38c)](_0x15cece,{'limit':_0xa3d6fa[_0x15b98d(0x366)]}),{'verbose':_0xa3d6fa[_0x15b98d(0x214)]});let _0x15c424=_0x43ba50['data'];_0x15c424[_0x15b98d(0x28d)]((_0x1503c8,_0x170a9e)=>{const _0x26cbcf=_0x15b98d,_0x43bbf0=_0x1503c8[_0x26cbcf(0x37c)][_0x26cbcf(0x2db)](_0x170a9e[_0x26cbcf(0x37c)]);if(_0x43bbf0!==0x0)return _0x43bbf0;return(_0x1503c8[_0x26cbcf(0x324)]?.[_0x26cbcf(0x37c)]||'')[_0x26cbcf(0x2db)](_0x170a9e[_0x26cbcf(0x324)]?.[_0x26cbcf(0x37c)]||'');});const _0x4b6866=_0xa3d6fa[_0x15b98d(0x366)]||0x64,_0x45cdfe=_0x15c424['length']>=_0x4b6866?a50_0x3872fc[_0x15b98d(0x21e)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console['error'](_0x15b98d(0x2bf)+_0x15c424['length']+_0x15b98d(0x240)+(_0x15c424[_0x15b98d(0x2f1)]!==0x1?'s':'')+_0x45cdfe);if(_0xa3d6fa['format']==='json'||_0xa3d6fa[_0x15b98d(0x356)]==='jsonl'||_0xa3d6fa[_0x15b98d(0x356)]==='table')await handleSDKOutput(_0x15c424,_0xa3d6fa);else{if(_0x15c424[_0x15b98d(0x2f1)]===0x0)_0x15cece?console['log']('No\x20workflows\x20found\x20in\x20project:\x20'+_0x15cece):console['log'](_0x15b98d(0x276));else{const _0xabc85a=_0xa3d6fa[_0x15b98d(0x253)],_0x4cd911=_0x15c424[_0x15b98d(0x2cb)](_0x54a842=>{const _0x921af=_0x15b98d,_0x17047f=a50_0x3872fc[_0x921af(0x21e)]('#'+_0x54a842['id']),_0x100390=hyperlink(_0x17047f,getWorkflowUrl(_0xabc85a,_0x54a842['id'])),_0x47a7db=_0x54a842[_0x921af(0x324)]?.[_0x921af(0x37c)]?a50_0x3872fc[_0x921af(0x21e)]('\x20('+_0x54a842[_0x921af(0x324)][_0x921af(0x37c)]+')'):'';return _0x921af(0x295)+_0x100390+'\x20'+_0x54a842[_0x921af(0x37c)]+_0x47a7db;});await writeOutput(_0x4cd911[_0x15b98d(0x370)]('\x0a'),_0xa3d6fa[_0x15b98d(0x386)],_0x15b98d(0x385));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a50_0x718729(0x37c)]=a50_0x718729(0x2f7);[a50_0x718729(0x37f)]=a50_0x718729(0x2c0);async[a50_0x718729(0x358)](_0x4bf286){const _0x19a5ce=a50_0x718729,{options:_0x53aac8,args:_0x2f650c,tdx:_0x112a63}=_0x4bf286,_0x468c15=this[_0x19a5ce(0x25d)](_0x2f650c,_0x53aac8);if(!_0x468c15)return 0x1;const {projectName:_0x2b5083,workflowName:_0x5e45ca}=_0x468c15;if(_0x53aac8[_0x19a5ce(0x214)]){if(_0x2b5083&&_0x5e45ca)console['error'](_0x19a5ce(0x1fe)+_0x2b5083+'.'+_0x5e45ca);else _0x2b5083&&console[_0x19a5ce(0x25b)](_0x19a5ce(0x339)+_0x2b5083);const _0x35068c=_0x53aac8[_0x19a5ce(0x388)];_0x35068c&&console[_0x19a5ce(0x25b)](_0x19a5ce(0x226)+_0x35068c);}let _0x54cb25=0x28;if(process[_0x19a5ce(0x27c)]['isTTY']&&!_0x53aac8[_0x19a5ce(0x386)]&&!_0x53aac8[_0x19a5ce(0x356)]){const _0x105da7=process[_0x19a5ce(0x27c)][_0x19a5ce(0x374)]||0x28;_0x54cb25=Math[_0x19a5ce(0x302)](0x14,Math['floor'](_0x105da7*0x2/0x3));}const _0x4b2da5=_0x53aac8[_0x19a5ce(0x366)]||_0x54cb25,_0x3c3339=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x112a63[_0x19a5ce(0x30c)]['sessions']({'projectName':_0x2b5083,'workflowName':_0x5e45ca,'status':_0x53aac8[_0x19a5ce(0x388)],'fromTime':_0x53aac8[_0x19a5ce(0x2b2)],'toTime':_0x53aac8['to'],'limit':_0x4b2da5}),{'verbose':_0x53aac8[_0x19a5ce(0x214)]}),_0x2f758d=_0x3c3339[_0x19a5ce(0x2dc)];_0x2f758d[_0x19a5ce(0x28d)]((_0x25288e,_0xb5bd36)=>{const _0x361e53=_0x19a5ce,_0x2f916=_0x25288e[_0x361e53(0x35f)]||'',_0x275bcf=_0xb5bd36[_0x361e53(0x35f)]||'';return _0x275bcf[_0x361e53(0x2db)](_0x2f916);});_0x2f758d['length']>=_0x4b2da5?console[_0x19a5ce(0x25b)](_0x19a5ce(0x31f)+_0x2f758d['length']+_0x19a5ce(0x271)+a50_0x3872fc[_0x19a5ce(0x21e)](_0x19a5ce(0x222))):console[_0x19a5ce(0x25b)]('✔\x20Found\x20'+_0x2f758d['length']+'\x20session'+(_0x2f758d['length']!==0x1?'s':''));if(_0x53aac8[_0x19a5ce(0x356)]===_0x19a5ce(0x2f5)||_0x53aac8[_0x19a5ce(0x356)]===_0x19a5ce(0x2d8)||_0x53aac8[_0x19a5ce(0x356)]===_0x19a5ce(0x2ce))await handleSDKOutput(_0x2f758d,_0x53aac8);else{if(!process[_0x19a5ce(0x27c)][_0x19a5ce(0x205)]||_0x53aac8['output']){if(_0x2f758d['length']===0x0){if(_0x2b5083&&_0x5e45ca)console[_0x19a5ce(0x2f3)]('No\x20sessions\x20found\x20for:\x20'+_0x2b5083+'.'+_0x5e45ca);else _0x2b5083?console['log'](_0x19a5ce(0x237)+_0x2b5083):console[_0x19a5ce(0x2f3)]('No\x20sessions\x20found');}else{const _0x5eaf2e=_0x53aac8[_0x19a5ce(0x253)],_0x571d32=this[_0x19a5ce(0x2ae)](_0x2f758d,_0x5eaf2e);_0x53aac8['output']?await writeOutput(_0x571d32,_0x53aac8[_0x19a5ce(0x386)],'list'):console[_0x19a5ce(0x2f3)](_0x571d32);}!_0x2b5083&&(console[_0x19a5ce(0x25b)](''),console['error'](a50_0x3872fc[_0x19a5ce(0x21e)](_0x19a5ce(0x27f))),console['error'](a50_0x3872fc[_0x19a5ce(0x21e)](_0x19a5ce(0x30d))+'or'+a50_0x3872fc['dim'](_0x19a5ce(0x330))));}else{if(_0x2f758d[_0x19a5ce(0x2f1)]===0x0){if(_0x2b5083&&_0x5e45ca)console[_0x19a5ce(0x2f3)](_0x19a5ce(0x2c1)+_0x2b5083+'.'+_0x5e45ca);else _0x2b5083?console['log'](_0x19a5ce(0x237)+_0x2b5083):console[_0x19a5ce(0x2f3)]('No\x20sessions\x20found');}else await this['navigateSessionsInteractive'](_0x2f758d,_0x4bf286,_0x2b5083);}}return 0x0;}[a50_0x718729(0x2ae)](_0x1dfd07,_0xf9a90f){const _0x1486f7=a50_0x718729,_0x2a5137=[],_0x326f74=new Map();let _0x431c4d=Infinity,_0x4121a4=-Infinity;for(const _0x7a166 of _0x1dfd07){if(_0x7a166['lastAttempt']?.[_0x1486f7(0x2cc)]){const _0x20e739=new Date(_0x7a166[_0x1486f7(0x384)]['createdAt'])[_0x1486f7(0x35a)](),_0x3b7d70=_0x7a166[_0x1486f7(0x384)][_0x1486f7(0x2a4)]?new Date(_0x7a166[_0x1486f7(0x384)][_0x1486f7(0x2a4)])['getTime']():Date[_0x1486f7(0x23b)](),_0x322c7c=_0x7a166[_0x1486f7(0x324)]?.[_0x1486f7(0x37c)]||_0x1486f7(0x251);!_0x326f74[_0x1486f7(0x321)](_0x322c7c)&&_0x326f74[_0x1486f7(0x213)](_0x322c7c,[]),_0x326f74[_0x1486f7(0x2a3)](_0x322c7c)[_0x1486f7(0x38d)]({'session':_0x7a166,'startTime':_0x20e739,'endTime':_0x3b7d70,'duration':_0x3b7d70-_0x20e739}),_0x431c4d=Math['min'](_0x431c4d,_0x20e739),_0x4121a4=Math[_0x1486f7(0x302)](_0x4121a4,_0x3b7d70);}}if(_0x326f74[_0x1486f7(0x2a1)]===0x0)return _0x1486f7(0x392);const _0x1f25fb=process[_0x1486f7(0x27c)]['columns']||0x78,_0x4d0e82=0x1e,_0x8ea64e=0x32,_0x17bfac=0x4,_0x4097ac=Math[_0x1486f7(0x231)](_0x8ea64e,Math[_0x1486f7(0x302)](_0x4d0e82,Math[_0x1486f7(0x26c)](_0x1f25fb*0.3))),_0x2cb45c=_0x1f25fb-_0x4097ac-TIMELINE_CONFIG['GUTTER']-0x3-_0x17bfac,_0x447863=_0x4121a4-_0x431c4d,_0x38dc31=_0x447863/_0x4097ac,_0x17aaf6=renderTimeAxis({'startTime':_0x431c4d,'endTime':_0x4121a4,'durationMs':_0x447863,'msPerChar':_0x38dc31},_0x4097ac),_0x299c94=[];for(const _0x4b13cf of _0x326f74[_0x1486f7(0x387)]()){_0x299c94['push'](..._0x4b13cf);}_0x299c94[_0x1486f7(0x28d)]((_0x5ac2e4,_0x278d71)=>_0x278d71['startTime']-_0x5ac2e4['startTime']);const _0x121161=new Date(_0x431c4d),_0x151dea=formatDate(_0x121161),_0x27b6fc=_0x17bfac+TIMELINE_CONFIG[_0x1486f7(0x377)]+TIMELINE_CONFIG['ICON_SPACING']+_0x2cb45c,_0x3cc85e='\x20'['repeat'](_0x27b6fc-_0x151dea['length']),_0x2e54a2=_0x3cc85e+a50_0x3872fc[_0x1486f7(0x21e)](_0x151dea)+'\x20'+_0x17aaf6;_0x2a5137[_0x1486f7(0x38d)](_0x2e54a2);const _0x31e17a=0x16;let _0x39184f=0x0;for(const _0xfb181 of _0x299c94){const _0x20c137=_0xfb181[_0x1486f7(0x2e2)]['project']?.[_0x1486f7(0x37c)]||'?',_0x2f37c4=Math[_0x1486f7(0x231)](stringWidth(_0x20c137),_0x31e17a);_0x39184f=Math[_0x1486f7(0x302)](_0x39184f,_0x2f37c4);}for(const _0xe92dc9 of _0x299c94){const {session:_0x3eb03f,startTime:_0x3e4c43,endTime:_0xac8a07,duration:_0x434faa}=_0xe92dc9,_0x4bb917=_0x3eb03f[_0x1486f7(0x324)]?.['id'],_0xe4ab31=_0x3eb03f['id'],_0x582ce2=_0x3eb03f[_0x1486f7(0x324)]?.[_0x1486f7(0x37c)]||'?',_0x2ee1e7=_0x3eb03f[_0x1486f7(0x30c)]?.['name']||'?';let _0x34e9a7,_0x59fd44;if(_0x3eb03f['lastAttempt']){const _0x206710=_0x3eb03f[_0x1486f7(0x384)];!_0x206710[_0x1486f7(0x221)]?(_0x34e9a7=_0x206710['cancelRequested']?'🛑':'🔄',_0x59fd44=_0x206710[_0x1486f7(0x2f2)]?a50_0x3872fc[_0x1486f7(0x303)]:a50_0x3872fc['blue']):(_0x34e9a7=_0x206710[_0x1486f7(0x24d)]?'✅':'❌',_0x59fd44=_0x206710[_0x1486f7(0x24d)]?a50_0x3872fc[_0x1486f7(0x2e3)]:a50_0x3872fc['red']);}else _0x34e9a7='⏳',_0x59fd44=a50_0x3872fc['dim'];const _0x309b0b='#'+_0xe4ab31,_0xa58db=_0x4bb917?hyperlink(_0x309b0b,getWorkflowSessionUrl(_0xf9a90f,_0x4bb917,_0xe4ab31)):_0x309b0b;let _0x2bf086=_0x582ce2;stringWidth(_0x582ce2)>_0x31e17a&&(_0x2bf086=_0x582ce2['slice'](0x0,_0x31e17a-0x1)+'…');const _0x49ff74=a50_0x3872fc[_0x1486f7(0x21e)](_0x2bf086),_0x5b6b28=stringWidth(_0x2bf086),_0x2cfe6c='\x20'[_0x1486f7(0x28a)](_0x39184f-stringWidth(_0x2bf086)+0x2),_0x47ecea='('+formatElapsed(_0x434faa)+')',_0x4b2f61=stringWidth(_0x47ecea),_0x56ce74=stringWidth(_0x309b0b),_0x35e6c9=_0x56ce74+0x1+_0x5b6b28+_0x2cfe6c[_0x1486f7(0x2f1)],_0x1e33e4=_0x2cb45c-_0x35e6c9-_0x4b2f61-0x1-0x8;let _0x12c78f=_0x2ee1e7;stringWidth(_0x12c78f)>_0x1e33e4&&(_0x12c78f=_0x12c78f['slice'](0x0,_0x1e33e4-0x1)+'…');const _0x52388b=_0xa58db+'\x20'+_0x49ff74+_0x2cfe6c+_0x12c78f,_0x4f5f90=stringWidth(_0x52388b),_0x25c63c=_0x2cb45c-_0x4f5f90-_0x4b2f61,_0x5e6496=_0x52388b+'\x20'[_0x1486f7(0x28a)](Math[_0x1486f7(0x302)](0x1,_0x25c63c))+a50_0x3872fc[_0x1486f7(0x21e)](_0x47ecea),_0x4f2c9e=Math['floor']((_0x3e4c43-_0x431c4d)/_0x38dc31),_0x140c88=Math[_0x1486f7(0x26c)]((_0xac8a07-_0x431c4d)/_0x38dc31),_0x5243e4=Math['max'](_0x4f2c9e+0x1,_0x140c88),_0x489327=new Array(_0x4097ac)['fill']('\x20');for(let _0x2b170c=_0x4f2c9e;_0x2b170c<Math[_0x1486f7(0x231)](_0x5243e4,_0x4097ac);_0x2b170c++){_0x489327[_0x2b170c]='─';}const _0xae611b=_0x489327['map'](_0x3483e8=>_0x3483e8==='\x20'?'\x20':_0x59fd44(_0x3483e8))[_0x1486f7(0x370)]('');_0x2a5137[_0x1486f7(0x38d)](_0x34e9a7+'\x20'+_0x5e6496+'│'+_0xae611b+'│');}return _0x2a5137['join']('\x0a');}async[a50_0x718729(0x32e)](_0x1151fc,_0x42a7b0,_0xd1e528){const _0xe62796=a50_0x718729,{options:_0x222136,tdx:_0x429423}=_0x42a7b0,_0x1ff447=_0x222136[_0xe62796(0x253)],{timelineRows:_0x3e2e9e,timeAxisHeader:_0x27ca27}=this['generateSessionTimelineRows'](_0x1151fc,_0x1ff447),_0x4a1e52=_0x3e2e9e[_0xe62796(0x277)](_0x3216ae=>_0x3216ae[_0xe62796(0x2ec)]);if(_0x4a1e52[_0xe62796(0x2f1)]===0x0){const _0x462ea2=this['renderSessionsTimeline'](_0x1151fc,_0x1ff447);console[_0xe62796(0x2f3)](_0x462ea2);!_0xd1e528&&(console[_0xe62796(0x25b)](''),console[_0xe62796(0x25b)](a50_0x3872fc[_0xe62796(0x21e)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console['error'](a50_0x3872fc[_0xe62796(0x21e)](_0xe62796(0x30d))+'or'+a50_0x3872fc[_0xe62796(0x21e)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0x27ca27&&console[_0xe62796(0x2f3)](_0x27ca27);const _0x59c8f1=_0x3e2e9e['filter'](_0x214aae=>_0x214aae[_0xe62796(0x2ec)])[_0xe62796(0x2cb)](_0x2e8043=>({'title':_0x2e8043[_0xe62796(0x2b5)],'value':_0x2e8043[_0xe62796(0x2ec)]})),_0x577f8c=process[_0xe62796(0x27c)][_0xe62796(0x374)]||0x3c,_0x24fda7=Math[_0xe62796(0x302)](0x28,Math[_0xe62796(0x26c)](_0x577f8c*0x2/0x3)),_0x26b96f=await a50_0x6abfdd({'type':_0xe62796(0x348),'name':'attemptId','message':_0xe62796(0x254),'choices':_0x59c8f1,'initial':-0x1,'limit':_0x24fda7,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x381e4a,_0x1be2d3)=>{const _0x20a86e=_0xe62796;if(!_0x381e4a)return Promise[_0x20a86e(0x367)](_0x1be2d3);const _0x2a4384=_0x1be2d3[_0x20a86e(0x277)](_0x452871=>{const _0x44bdd6=_0x20a86e,_0x593002=_0x452871;return _0x593002[_0x44bdd6(0x26d)][_0x44bdd6(0x252)]()['includes'](_0x381e4a[_0x44bdd6(0x252)]());});return Promise[_0x20a86e(0x367)](_0x2a4384);}}),_0x4cbd7e=()=>{const _0x5c7e90=_0xe62796;process['stdout'][_0x5c7e90(0x20f)](_0x5c7e90(0x346)),process[_0x5c7e90(0x27c)][_0x5c7e90(0x20f)](_0x5c7e90(0x346)),process[_0x5c7e90(0x27c)]['write']('\x1b[1A\x1b[2K');},_0x5edaf5=_0x26b96f&&_0x26b96f[_0xe62796(0x2ec)]&&_0x26b96f[_0xe62796(0x2ec)]!==null&&_0x26b96f[_0xe62796(0x2ec)][_0xe62796(0x38b)]()!=='';if(!_0x5edaf5){_0x4cbd7e(),console[_0xe62796(0x2f3)](a50_0x3872fc[_0xe62796(0x21e)](_0xe62796(0x280)));return;}_0x4cbd7e();const _0x36ab95=_0x1151fc[_0xe62796(0x20a)](_0x4eb533=>_0x4eb533['lastAttempt']?.['id']===_0x26b96f[_0xe62796(0x2ec)]);if(_0x36ab95){const _0xb799e4=_0x36ab95['project']?.[_0xe62796(0x37c)]||'?',_0x2913b5=_0x36ab95[_0xe62796(0x30c)]?.['name']||'?';console[_0xe62796(0x2f3)](_0xe62796(0x281)+a50_0x3872fc[_0xe62796(0x21e)](_0xb799e4)+_0xe62796(0x30f)+a50_0x3872fc[_0xe62796(0x21e)](_0x2913b5));}const _0x3f821f=new WorkflowTimelineCommand();await _0x3f821f[_0xe62796(0x358)]({'args':[],'options':{..._0x222136,'attemptId':_0x26b96f['attemptId']},'tdx':_0x429423});}[a50_0x718729(0x200)](_0x3e0094,_0x20b3ef){const _0x5501fb=a50_0x718729,_0x2f0bd2=new Map();for(const _0x457efd of _0x3e0094){_0x457efd['id']&&_0x457efd['lastAttempt']?.['id']&&_0x2f0bd2[_0x5501fb(0x213)](_0x457efd['id'],_0x457efd['lastAttempt']['id']);}const _0x28eb9d=[];let _0x3176b5='';const _0x3b5062=this[_0x5501fb(0x2ae)](_0x3e0094,_0x20b3ef),_0x8dc8d6=_0x3b5062['split']('\x0a');for(const _0x30badc of _0x8dc8d6){if(_0x30badc['startsWith']('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x30badc[_0x5501fb(0x2fa)](/^\s+\d{4}-\d{2}-\d{2}/))_0x3176b5=_0x30badc;else{if(_0x30badc[_0x5501fb(0x2fa)](/^[✅❌🔄🛑⏳]/)){const _0xa336cf=_0x30badc[_0x5501fb(0x2fa)](/#(\d+)/),_0x32595b=_0xa336cf?_0xa336cf[0x1]:null,_0x11b9c0=_0x32595b?_0x2f0bd2[_0x5501fb(0x2a3)](_0x32595b)||null:null,_0x4bdc57=_0x3e0094[_0x5501fb(0x20a)](_0xe19990=>_0xe19990['id']===_0x32595b),_0x3fd609=_0x4bdc57?.[_0x5501fb(0x324)]?.['name']||'';_0x28eb9d[_0x5501fb(0x38d)]({'displayLine':_0x30badc,'attemptId':_0x11b9c0,'projectName':_0x3fd609});}}}return{'timelineRows':_0x28eb9d,'timeAxisHeader':_0x3176b5};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a50_0x718729(0x37c)]='workflow:attempts';[a50_0x718729(0x37f)]='List\x20workflow\x20attempts';async['execute'](_0x5b86d6){const _0x211cf0=a50_0x718729,{options:_0x53cafd,args:_0x4c9a6d,tdx:_0x213119}=_0x5b86d6,_0xad7fe=this[_0x211cf0(0x25d)](_0x4c9a6d,_0x53cafd);if(!_0xad7fe)return 0x1;const {projectName:_0x315e20,workflowName:_0x5979b8}=_0xad7fe,_0x3ef8a4=_0x53cafd[_0x211cf0(0x36c)];if(_0x53cafd[_0x211cf0(0x214)]){if(_0x315e20&&_0x5979b8)console[_0x211cf0(0x25b)](_0x211cf0(0x1fe)+_0x315e20+'.'+_0x5979b8);else _0x315e20&&console['error'](_0x211cf0(0x339)+_0x315e20);_0x3ef8a4&&console[_0x211cf0(0x25b)](_0x211cf0(0x328));}const _0x4fbf0a=await withSpinner(_0x211cf0(0x260),()=>_0x213119[_0x211cf0(0x30c)][_0x211cf0(0x28f)]({'projectName':_0x315e20,'workflowName':_0x5979b8,'includeRetried':_0x3ef8a4,'limit':_0x53cafd[_0x211cf0(0x366)]}),{'verbose':_0x53cafd[_0x211cf0(0x214)]}),_0x1793a3=_0x4fbf0a['data'],_0x393138=_0x53cafd[_0x211cf0(0x366)]||0x64,_0x37e580=_0x1793a3[_0x211cf0(0x2f1)]>=_0x393138?a50_0x3872fc[_0x211cf0(0x21e)](_0x211cf0(0x289)):'';console[_0x211cf0(0x25b)](_0x211cf0(0x2bf)+_0x1793a3[_0x211cf0(0x2f1)]+'\x20attempt'+(_0x1793a3[_0x211cf0(0x2f1)]!==0x1?'s':'')+_0x37e580);if(_0x53cafd[_0x211cf0(0x356)]===_0x211cf0(0x2f5)||_0x53cafd[_0x211cf0(0x356)]===_0x211cf0(0x2d8)||_0x53cafd[_0x211cf0(0x356)]===_0x211cf0(0x2ce))await handleSDKOutput(_0x1793a3,_0x53cafd);else{if(_0x1793a3[_0x211cf0(0x2f1)]===0x0){if(_0x315e20&&_0x5979b8)console['log'](_0x211cf0(0x307)+_0x315e20+'.'+_0x5979b8);else _0x315e20?console['log']('No\x20attempts\x20found\x20in\x20project:\x20'+_0x315e20):console['log'](_0x211cf0(0x351));}else{const _0x15af5d=_0x53cafd[_0x211cf0(0x253)],_0x31bf6b=_0x1793a3['map'](_0x11f136=>{const _0x5a2685=_0x211cf0,_0x4eb080=a50_0x3872fc[_0x5a2685(0x21e)]('#'+_0x11f136['id']),_0x17c364=_0x11f136[_0x5a2685(0x324)]?.['id'],_0x81095b=_0x11f136[_0x5a2685(0x36e)]||_0x11f136['sessionId'],_0xe7172e=_0x17c364&&_0x81095b?hyperlink(_0x4eb080,getWorkflowAttemptUrl(_0x15af5d,_0x17c364,_0x81095b,_0x11f136['id'])):_0x4eb080,{icon:_0x1bc143,text:_0x2a7e37}=getAttemptStatusDisplay(_0x11f136),_0x5018e7=(_0x11f136[_0x5a2685(0x324)]?.[_0x5a2685(0x37c)]||'?')+'.'+(_0x11f136[_0x5a2685(0x30c)]?.['name']||'?'),_0x366e54=_0x11f136[_0x5a2685(0x35f)]?a50_0x3872fc[_0x5a2685(0x21e)](_0x11f136[_0x5a2685(0x35f)]):'';return(_0xe7172e+'\x20'+_0x1bc143+(_0x2a7e37?'\x20'+_0x2a7e37:'')+'\x20'+_0x5018e7+'\x20'+_0x366e54)[_0x5a2685(0x245)]();});await writeOutput(_0x31bf6b[_0x211cf0(0x370)]('\x0a'),_0x53cafd[_0x211cf0(0x386)],_0x211cf0(0x385));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a50_0x718729(0x37c)]='workflow:attempt';['description']='Show\x20specific\x20attempt\x20details';async[a50_0x718729(0x358)](_0xd84aa5){const _0x348ec5=a50_0x718729,{options:_0x364627,args:_0x367cb3,tdx:_0x4aaf28}=_0xd84aa5,_0xc454e7=_0x367cb3[0x0];if(!_0xc454e7)return console[_0x348ec5(0x25b)](_0x348ec5(0x2ef)),0x1;_0x364627[_0x348ec5(0x214)]&&console[_0x348ec5(0x25b)]('Attempt\x20ID:\x20'+_0xc454e7);const _0x91f87e=await withSpinner('Getting\x20attempt\x20details...',()=>_0x4aaf28['workflow'][_0x348ec5(0x34b)](_0xc454e7),{'verbose':_0x364627['verbose']}),_0x242be2=_0x91f87e[_0x348ec5(0x2dc)];let _0x1d46d4;!_0x242be2['done']?_0x1d46d4=_0x242be2[_0x348ec5(0x2f2)]?_0x348ec5(0x32b):_0x348ec5(0x261):_0x1d46d4=_0x242be2[_0x348ec5(0x24d)]?_0x348ec5(0x24d):_0x348ec5(0x25b);let _0x81ed27;if(_0x242be2['createdAt']&&_0x242be2[_0x348ec5(0x2a4)]){const _0x1a6a5b=new Date(_0x242be2[_0x348ec5(0x2cc)])[_0x348ec5(0x35a)](),_0x1a7078=new Date(_0x242be2[_0x348ec5(0x2a4)])[_0x348ec5(0x35a)]();_0x81ed27=Math['round']((_0x1a7078-_0x1a6a5b)/0x3e8);}const _0x49d88a={'attempt_id':_0x242be2['id'],'status':_0x1d46d4,..._0x242be2[_0x348ec5(0x225)]!==undefined&&{'index':_0x242be2[_0x348ec5(0x225)]},..._0x242be2[_0x348ec5(0x324)]&&{'project':_0x242be2[_0x348ec5(0x324)]['name']},..._0x242be2[_0x348ec5(0x30c)]&&{'workflow':_0x242be2[_0x348ec5(0x30c)][_0x348ec5(0x37c)]},..._0x242be2[_0x348ec5(0x1ff)]&&{'session_id':_0x242be2[_0x348ec5(0x1ff)]},..._0x242be2[_0x348ec5(0x35f)]&&{'session_time':_0x242be2[_0x348ec5(0x35f)]},..._0x242be2['retryAttemptName']&&{'retry_attempt':_0x242be2[_0x348ec5(0x342)]},..._0x81ed27!==undefined&&{'duration_sec':_0x81ed27},..._0x242be2[_0x348ec5(0x2cc)]&&{'created_at':_0x242be2['createdAt']},..._0x242be2[_0x348ec5(0x2a4)]&&{'finished_at':_0x242be2[_0x348ec5(0x2a4)]},...Object[_0x348ec5(0x31a)](_0x242be2['params'])[_0x348ec5(0x2f1)]>0x0&&{'params':_0x242be2[_0x348ec5(0x268)]}};return await handleSingleObjectOutput(_0x49d88a,_0x364627),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a50_0x718729(0x2d6);[a50_0x718729(0x37f)]=a50_0x718729(0x38e);async['execute'](_0x38a7b2){const _0x1afed0=a50_0x718729,{options:_0x352330,args:_0xa46cda,tdx:_0x4aac88}=_0x38a7b2,_0x2f7efd=_0xa46cda[0x0];if(!_0x2f7efd)return console['error'](_0x1afed0(0x2ef)),0x1;const _0xb362c5=_0x352330[_0x1afed0(0x22c)];_0x352330[_0x1afed0(0x214)]&&(console['error'](_0x1afed0(0x33e)+_0x2f7efd),_0xb362c5&&console[_0x1afed0(0x25b)](_0x1afed0(0x2f6)));const _0x4637db=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x4aac88['workflow']['tasks'](_0x2f7efd,_0xb362c5||![]),{'verbose':_0x352330['verbose']}),_0x3f3c39=_0x4637db['data'];return console[_0x1afed0(0x25b)](_0x1afed0(0x2bf)+_0x3f3c39[_0x1afed0(0x2f1)]+'\x20task'+(_0x3f3c39[_0x1afed0(0x2f1)]!==0x1?'s':'')),await handleSDKOutput(_0x3f3c39,_0x352330),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a50_0x718729(0x29c);[a50_0x718729(0x37f)]=a50_0x718729(0x299);async[a50_0x718729(0x358)](_0x5cd680){const _0xbfc0c6=a50_0x718729,{options:_0x41b286,args:_0xd0a49f,tdx:_0x40830c}=_0x5cd680,_0x2ba293=_0xd0a49f[0x0];let _0x4679fb=_0xd0a49f[0x1];if(!_0x2ba293)return console['error'](_0xbfc0c6(0x2ef)),0x1;_0x41b286['verbose']&&(console[_0xbfc0c6(0x25b)]('Attempt\x20ID:\x20'+_0x2ba293),_0x4679fb&&console[_0xbfc0c6(0x25b)](_0xbfc0c6(0x26f)+_0x4679fb));const _0x69b9ce=await withSpinner('Fetching\x20log\x20files...',()=>_0x40830c[_0xbfc0c6(0x30c)][_0xbfc0c6(0x265)](_0x2ba293,_0x4679fb),{'verbose':_0x41b286[_0xbfc0c6(0x214)]}),_0x393544=_0x69b9ce[_0xbfc0c6(0x2dc)];if(_0x393544[_0xbfc0c6(0x2f1)]===0x0)return console[_0xbfc0c6(0x25b)](_0xbfc0c6(0x32f)),0x0;if(!_0x4679fb&&(_0x41b286[_0xbfc0c6(0x2f5)]||_0x41b286[_0xbfc0c6(0x356)]))return await handleSDKOutput(_0x393544,_0x41b286),0x0;if(!_0x4679fb){const _0x2c5798=_0x393544[_0xbfc0c6(0x2cb)](_0x3ed7be=>({'title':_0x3ed7be['taskName']+'\x20('+formatBytes(_0x3ed7be[_0xbfc0c6(0x24e)])+')','value':_0x3ed7be['taskName']})),_0x559aae=await a50_0x6abfdd({'type':_0xbfc0c6(0x329),'name':_0xbfc0c6(0x2e0),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x2c5798});if(!_0x559aae['task'])return console[_0xbfc0c6(0x25b)]('Cancelled'),0x0;_0x4679fb=_0x559aae[_0xbfc0c6(0x2e0)];}const _0x5f0b52=await withSpinner(_0xbfc0c6(0x317),()=>_0x40830c[_0xbfc0c6(0x30c)]['logs'](_0x2ba293,_0x4679fb),{'verbose':_0x41b286[_0xbfc0c6(0x214)]}),_0x1a83ce=_0x5f0b52[_0xbfc0c6(0x2dc)];return _0x1a83ce?console[_0xbfc0c6(0x2f3)](_0x1a83ce):console['error'](_0xbfc0c6(0x25f)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a50_0x718729(0x37c)]=a50_0x718729(0x2ab);[a50_0x718729(0x37f)]='Kill\x20a\x20running\x20attempt';async[a50_0x718729(0x358)](_0x209d98){const _0x9f3e61=a50_0x718729,{options:_0x4c65d5,args:_0x3564b7,tdx:_0x1f0263}=_0x209d98,_0x12c96c=_0x3564b7[0x0];if(!_0x12c96c)return console[_0x9f3e61(0x25b)](_0x9f3e61(0x2ef)),0x1;const _0xaaae4e=_0x4c65d5[_0x9f3e61(0x34f)];_0x4c65d5[_0x9f3e61(0x214)]&&(console['error'](_0x9f3e61(0x33e)+_0x12c96c),_0xaaae4e&&console[_0x9f3e61(0x25b)](_0x9f3e61(0x2cd)+_0xaaae4e));if(!_0x4c65d5[_0x9f3e61(0x311)]){if(!isInteractive())return console[_0x9f3e61(0x25b)](a50_0x3872fc['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x9f3e61(0x25b)](a50_0x3872fc[_0x9f3e61(0x21e)](_0x9f3e61(0x208))),0x1;const _0x212037=await confirmKey(_0x9f3e61(0x217)+_0x12c96c+'?');if(!_0x212037)return console[_0x9f3e61(0x25b)](a50_0x3872fc[_0x9f3e61(0x303)](_0x9f3e61(0x280))),0x1;}const _0x946085=await withSpinner(_0x9f3e61(0x298),()=>_0x1f0263['workflow'][_0x9f3e61(0x2fc)](_0x12c96c,_0xaaae4e),{'verbose':_0x4c65d5[_0x9f3e61(0x214)]}),_0x2da3d0=_0x946085[_0x9f3e61(0x2dc)];return console[_0x9f3e61(0x25b)]('✔\x20'+_0x2da3d0),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a50_0x718729(0x37c)]=a50_0x718729(0x283);[a50_0x718729(0x37f)]=a50_0x718729(0x274);async['execute'](_0x1eece3){const _0x21a887=a50_0x718729,{options:_0x293a68,args:_0x5aa168,tdx:_0x4a00fb}=_0x1eece3,_0x5c3877=_0x5aa168[0x0];if(!_0x5c3877)return console[_0x21a887(0x25b)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x21a887(0x25b)](_0x21a887(0x26a)),0x1;let _0x65112b=![],_0x1b3847=_0x5c3877;if(_0x5c3877[_0x21a887(0x333)](_0x21a887(0x1f6)))_0x65112b=!![],_0x1b3847=_0x5c3877[_0x21a887(0x2ee)](0x8);else{if(_0x5c3877[_0x21a887(0x333)]('attempt:'))_0x65112b=![],_0x1b3847=_0x5c3877[_0x21a887(0x2ee)](0x8);else return console[_0x21a887(0x25b)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console['error'](_0x21a887(0x26a)),0x1;}const _0x5bf17d=_0x293a68[_0x21a887(0x2d5)],_0xa6f65a=_0x293a68['resumeFrom'],_0x1a2862=_0x293a68[_0x21a887(0x268)],_0x58d6ad=_0x293a68[_0x21a887(0x2eb)];_0x293a68['verbose']&&(console[_0x21a887(0x25b)](_0x21a887(0x23a)+(_0x65112b?'session':_0x21a887(0x34b))+'\x20'+_0x1b3847),_0x5bf17d&&console['error'](_0x21a887(0x373)+_0x5bf17d),_0xa6f65a&&console[_0x21a887(0x25b)]('Resume\x20from:\x20'+_0xa6f65a),_0x1a2862&&console['error'](_0x21a887(0x37b)+_0x1a2862),_0x58d6ad&&console[_0x21a887(0x25b)](_0x21a887(0x2c6)));let _0x514560;if(_0x1a2862)try{if(_0x1a2862[_0x21a887(0x333)]('@')){const _0x1aade7=await import(_0x21a887(0x349)),_0x5c6250=_0x1a2862[_0x21a887(0x2ee)](0x1),_0x2f6e1c=await _0x1aade7['readFile'](_0x5c6250,'utf-8');_0x514560=JSON[_0x21a887(0x234)](_0x2f6e1c);}else _0x514560=JSON[_0x21a887(0x234)](_0x1a2862);}catch{return console['error'](_0x21a887(0x372)),0x1;}if(!_0x293a68[_0x21a887(0x311)]){if(!isInteractive())return console[_0x21a887(0x25b)](a50_0x3872fc[_0x21a887(0x2fd)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x21a887(0x25b)](a50_0x3872fc[_0x21a887(0x21e)](_0x21a887(0x208))),0x1;const _0x114cc4=await confirmKey(_0x21a887(0x266)+(_0x65112b?_0x21a887(0x2e2):_0x21a887(0x34b))+'\x20'+_0x1b3847+'?');if(!_0x114cc4)return console[_0x21a887(0x25b)](a50_0x3872fc[_0x21a887(0x303)](_0x21a887(0x280))),0x1;}let _0xcdd034;_0x65112b?_0xcdd034=await withSpinner(_0x21a887(0x241),()=>_0x4a00fb[_0x21a887(0x30c)][_0x21a887(0x314)](_0x1b3847,{'fromTask':_0x5bf17d,'retryParams':_0x514560}),{'verbose':_0x293a68[_0x21a887(0x214)]}):_0xcdd034=await withSpinner(_0x21a887(0x2e8),()=>_0x4a00fb[_0x21a887(0x30c)][_0x21a887(0x2a2)](_0x1b3847,{'resumeFrom':_0xa6f65a,'retryParams':_0x514560,'force':_0x58d6ad}),{'verbose':_0x293a68[_0x21a887(0x214)]});const _0x200dff=_0xcdd034[_0x21a887(0x2dc)];return console[_0x21a887(0x25b)](_0x21a887(0x28e)),console[_0x21a887(0x25b)](_0x21a887(0x29f)+_0x200dff[_0x21a887(0x2ec)]),console[_0x21a887(0x25b)]('\x20\x20Session\x20ID:\x20'+_0x200dff[_0x21a887(0x1ff)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a50_0x718729(0x37c)]=a50_0x718729(0x23f);[a50_0x718729(0x37f)]='Start\x20a\x20workflow\x20run';async[a50_0x718729(0x358)](_0x2a56b8){const _0x4bfe76=a50_0x718729,{options:_0x5c5ead,args:_0x61c347,tdx:_0x1e525d}=_0x2a56b8;let _0x2fcd14=_0x61c347[0x0];if(!_0x2fcd14){const _0x3375f7=this['resolveProject']([],_0x5c5ead),_0x3b6e70=await withSpinner(_0x4bfe76(0x23d),()=>_0x1e525d[_0x4bfe76(0x30c)][_0x4bfe76(0x38c)](_0x3375f7,{'limit':_0x5c5ead['limit']}),{'verbose':_0x5c5ead['verbose']}),_0x557a56=_0x3b6e70['data'];if(_0x557a56[_0x4bfe76(0x2f1)]===0x0)return console[_0x4bfe76(0x25b)](_0x4bfe76(0x276)),!_0x3375f7&&console['error'](a50_0x3872fc[_0x4bfe76(0x21e)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x30b79c=_0x557a56['map'](_0x125a29=>({'title':_0x125a29[_0x4bfe76(0x324)]?.[_0x4bfe76(0x37c)]+'.'+_0x125a29[_0x4bfe76(0x37c)],'value':_0x125a29[_0x4bfe76(0x324)]?.['name']+'.'+_0x125a29['name'],'description':_0x125a29[_0x4bfe76(0x310)]?'revision:\x20'+_0x125a29['revision']:undefined})),_0x59fa0b=await a50_0x6abfdd({'type':'select','name':_0x4bfe76(0x30c),'message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x30b79c});if(!_0x59fa0b[_0x4bfe76(0x30c)])return 0x1;_0x2fcd14=_0x59fa0b[_0x4bfe76(0x30c)];}if(!_0x2fcd14[_0x4bfe76(0x336)]('.')){const _0x16ec14=this[_0x4bfe76(0x207)]([],_0x5c5ead);if(_0x16ec14)_0x2fcd14=_0x16ec14+'.'+_0x2fcd14;else return console[_0x4bfe76(0x25b)](a50_0x3872fc[_0x4bfe76(0x2fd)](_0x4bfe76(0x215)),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console[_0x4bfe76(0x25b)](a50_0x3872fc[_0x4bfe76(0x21e)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x44a0ae=_0x5c5ead[_0x4bfe76(0x354)],_0x46b238=_0x5c5ead[_0x4bfe76(0x35f)],_0x30cc31={};if(_0x44a0ae&&Array[_0x4bfe76(0x29d)](_0x44a0ae))for(const _0x5d86be of _0x44a0ae){const _0x460509=_0x5d86be[_0x4bfe76(0x2f0)]('=');if(_0x460509===-0x1)return console[_0x4bfe76(0x25b)](_0x4bfe76(0x279)+_0x5d86be),console[_0x4bfe76(0x25b)](_0x4bfe76(0x326)),0x1;const _0x477bd2=_0x5d86be[_0x4bfe76(0x2ee)](0x0,_0x460509),_0xba1962=_0x5d86be['substring'](_0x460509+0x1);try{_0x30cc31[_0x477bd2]=JSON[_0x4bfe76(0x234)](_0xba1962);}catch{_0x30cc31[_0x477bd2]=_0xba1962;}}_0x5c5ead[_0x4bfe76(0x214)]&&(console['error'](_0x4bfe76(0x284)+_0x2fcd14),Object[_0x4bfe76(0x31a)](_0x30cc31)[_0x4bfe76(0x2f1)]>0x0&&console[_0x4bfe76(0x25b)]('Parameters:\x20'+JSON[_0x4bfe76(0x31b)](_0x30cc31)),_0x46b238&&console[_0x4bfe76(0x25b)](_0x4bfe76(0x344)+_0x46b238));const _0x4fac15=await withSpinner(_0x4bfe76(0x246),()=>_0x1e525d[_0x4bfe76(0x30c)][_0x4bfe76(0x2c4)](_0x2fcd14,_0x30cc31,{'sessionTime':_0x46b238}),{'verbose':_0x5c5ead[_0x4bfe76(0x214)]}),_0x4724c6=_0x4fac15[_0x4bfe76(0x2dc)];console[_0x4bfe76(0x25b)](_0x4bfe76(0x21f)),console[_0x4bfe76(0x25b)](_0x4bfe76(0x247)+_0x4724c6['id']),console[_0x4bfe76(0x25b)](_0x4bfe76(0x210)+_0x4724c6['sessionId']),console[_0x4bfe76(0x25b)]('\x20\x20Project:\x20'+_0x4724c6[_0x4bfe76(0x324)]?.[_0x4bfe76(0x37c)]),console[_0x4bfe76(0x25b)](_0x4bfe76(0x233)+_0x4724c6[_0x4bfe76(0x30c)]?.[_0x4bfe76(0x37c)]);if(_0x4724c6[_0x4bfe76(0x324)]?.['id']&&_0x4724c6[_0x4bfe76(0x1ff)]&&_0x4724c6['id']){const _0x1eb74f=_0x5c5ead[_0x4bfe76(0x253)],_0x338ac5=getConsoleUrl(_0x1eb74f,_0x4bfe76(0x20c)+_0x4724c6['project']['id']+_0x4bfe76(0x21c)+_0x4724c6[_0x4bfe76(0x1ff)]+_0x4bfe76(0x320)+_0x4724c6['id']);console[_0x4bfe76(0x25b)]('\x20\x20Console:\x20'+a50_0x3872fc[_0x4bfe76(0x2bb)](_0x338ac5));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a50_0x718729(0x37c)]=a50_0x718729(0x305);[a50_0x718729(0x37f)]=a50_0x718729(0x235);async[a50_0x718729(0x358)](_0x108f94){const _0xaeff53=a50_0x718729,{options:_0x592641,args:_0x586ea9,tdx:_0x5a4c12}=_0x108f94,_0x2fe801=_0x586ea9[0x0],_0x3623ed=_0x586ea9[0x1]||'.';if(!_0x2fe801)return console[_0xaeff53(0x25b)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0xaeff53(0x292)),0x1;const _0x5e9908=_0x592641[_0xaeff53(0x310)];_0x592641['verbose']&&(console[_0xaeff53(0x25b)](_0xaeff53(0x281)+_0x2fe801),console[_0xaeff53(0x25b)](_0xaeff53(0x2cf)+_0x3623ed),_0x5e9908&&console[_0xaeff53(0x25b)](_0xaeff53(0x212)+_0x5e9908));const _0xb76c59=await withSpinner('Downloading\x20project\x20'+_0x2fe801+_0xaeff53(0x337),()=>_0x5a4c12['workflow'][_0xaeff53(0x2ca)](_0x2fe801,_0x3623ed,{'revision':_0x5e9908}),{'verbose':_0x592641[_0xaeff53(0x214)]}),_0x127349=_0xb76c59[_0xaeff53(0x2dc)];return console[_0xaeff53(0x25b)]('✔\x20Downloaded\x20'+_0x127349[_0xaeff53(0x244)]),console[_0xaeff53(0x25b)]('\x20\x20Revision:\x20'+_0x127349[_0xaeff53(0x310)]),console[_0xaeff53(0x25b)](_0xaeff53(0x381)+_0x127349['filesExtracted']),console['error'](_0xaeff53(0x22a)+_0x3623ed+'/'+_0x127349['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a50_0x718729(0x37c)]=a50_0x718729(0x368);[a50_0x718729(0x37f)]=a50_0x718729(0x30e);async[a50_0x718729(0x358)](_0x1e5f21){const _0x3602f1=a50_0x718729,{options:_0x29c6a5,args:_0x89748f,tdx:_0x317bc9}=_0x1e5f21;let _0x4c6ead='.',_0x5dd3cd=_0x29c6a5[_0x3602f1(0x37c)];if(_0x89748f[0x0]){const {promises:_0x5089d4}=await import('fs');try{const _0x50f689=await _0x5089d4[_0x3602f1(0x365)](_0x89748f[0x0]);if(_0x50f689['isDirectory']())_0x4c6ead=_0x89748f[0x0];else return console[_0x3602f1(0x25b)](_0x3602f1(0x257)+_0x89748f[0x0]+_0x3602f1(0x32d)),0x1;}catch{_0x5dd3cd=_0x89748f[0x0],_0x4c6ead='.';}}const _0x206e33=_0x29c6a5['revision'],_0x2f11df=_0x29c6a5['skipValidation'];_0x29c6a5['verbose']&&(console[_0x3602f1(0x25b)](_0x3602f1(0x2aa)+_0x4c6ead),_0x5dd3cd&&console[_0x3602f1(0x25b)]('Project\x20name:\x20'+_0x5dd3cd),_0x206e33&&console[_0x3602f1(0x25b)](_0x3602f1(0x212)+_0x206e33),_0x2f11df&&console[_0x3602f1(0x25b)](_0x3602f1(0x29b)));const _0x42c371=await withSpinner(_0x3602f1(0x35c),()=>_0x317bc9[_0x3602f1(0x30c)][_0x3602f1(0x38d)](_0x4c6ead,{'projectName':_0x5dd3cd,'revision':_0x206e33,'skipValidation':_0x2f11df}),{'verbose':_0x29c6a5[_0x3602f1(0x214)]}),_0x1a61be=_0x42c371[_0x3602f1(0x2dc)];return console['error'](_0x3602f1(0x20d)+_0x1a61be[_0x3602f1(0x244)]),console['error'](_0x3602f1(0x2c8)+_0x1a61be['projectId']),console[_0x3602f1(0x25b)](_0x3602f1(0x319)+_0x1a61be[_0x3602f1(0x310)]),await this[_0x3602f1(0x2ed)](_0x317bc9,_0x1a61be[_0x3602f1(0x244)],_0x29c6a5[_0x3602f1(0x253)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a50_0x718729(0x37c)]=a50_0x718729(0x2e4);[a50_0x718729(0x37f)]=a50_0x718729(0x33d);async[a50_0x718729(0x358)](_0x2b55d1){const _0x1e9698=a50_0x718729,{options:_0x3a193d,args:_0x190dc6,tdx:_0x269a82}=_0x2b55d1,_0x29d29e=_0x190dc6[0x0],_0x1d13d2=_0x190dc6[0x1];if(!_0x29d29e)return console[_0x1e9698(0x25b)](a50_0x3872fc[_0x1e9698(0x2fd)](_0x1e9698(0x215)),'Project\x20name\x20is\x20required'),console['error'](a50_0x3872fc[_0x1e9698(0x21e)](_0x1e9698(0x345))),0x1;const _0x6ed6f5=_0x3a193d[_0x1e9698(0x310)];_0x3a193d[_0x1e9698(0x214)]&&(console[_0x1e9698(0x25b)](_0x1e9698(0x281)+_0x29d29e),_0x1d13d2&&console[_0x1e9698(0x25b)](_0x1e9698(0x28b)+_0x1d13d2),_0x6ed6f5&&console['error'](_0x1e9698(0x212)+_0x6ed6f5),_0x3a193d[_0x1e9698(0x38a)]&&console[_0x1e9698(0x25b)](_0x1e9698(0x34d)));const _0xf322a0=await withSpinner(_0x1e9698(0x308)+_0x29d29e+'...',()=>_0x269a82[_0x1e9698(0x30c)][_0x1e9698(0x25a)](_0x29d29e,{'targetDir':_0x1d13d2,'revision':_0x6ed6f5}),{'verbose':_0x3a193d[_0x1e9698(0x214)]}),_0x4cba7a=_0xf322a0[_0x1e9698(0x2dc)];_0x4cba7a[_0x1e9698(0x21d)]?console[_0x1e9698(0x25b)]('→\x20New\x20project:\x20'+_0x4cba7a[_0x1e9698(0x244)]):console[_0x1e9698(0x25b)](_0x1e9698(0x33b)+_0x4cba7a[_0x1e9698(0x244)]);console[_0x1e9698(0x25b)](_0x1e9698(0x319)+_0x4cba7a[_0x1e9698(0x310)]),console[_0x1e9698(0x25b)](_0x1e9698(0x211)+(a50_0x2b6305[_0x1e9698(0x37a)](process[_0x1e9698(0x389)](),_0x4cba7a[_0x1e9698(0x232)])||'.')),console[_0x1e9698(0x25b)](_0x1e9698(0x27a)+a50_0x3872fc['green']('+'+_0x4cba7a[_0x1e9698(0x29a)]['new']+_0x1e9698(0x206))+',\x20'+(a50_0x3872fc['yellow']('~'+_0x4cba7a[_0x1e9698(0x29a)][_0x1e9698(0x376)]+_0x1e9698(0x36f))+',\x20')+(a50_0x3872fc[_0x1e9698(0x2fd)]('-'+_0x4cba7a[_0x1e9698(0x29a)][_0x1e9698(0x350)]+_0x1e9698(0x290))+',\x20')+(''+a50_0x3872fc[_0x1e9698(0x21e)](_0x4cba7a['summary'][_0x1e9698(0x1fa)]+_0x1e9698(0x2ba))));for(const _0x17f25a of _0x4cba7a[_0x1e9698(0x32a)]){_0x17f25a[_0x1e9698(0x2de)]===_0x1e9698(0x376)&&_0x17f25a[_0x1e9698(0x322)]&&(console['error']('\x0a'+a50_0x3872fc[_0x1e9698(0x2bb)](_0x1e9698(0x2a0)+_0x17f25a[_0x1e9698(0x202)])),console[_0x1e9698(0x25b)](_0x17f25a[_0x1e9698(0x322)]));}if(!_0x4cba7a['hasChanges'])return saveSessionContext({'workflow_project':_0x4cba7a[_0x1e9698(0x244)]},_0x3a193d[_0x1e9698(0x2e2)]),console['error'](a50_0x3872fc[_0x1e9698(0x2e3)](_0x1e9698(0x293))),console[_0x1e9698(0x25b)](a50_0x3872fc[_0x1e9698(0x21e)](_0x1e9698(0x2ea)+_0x4cba7a['projectName'])),0x0;if(_0x3a193d['dryRun'])return console[_0x1e9698(0x25b)](a50_0x3872fc['yellow'](_0x1e9698(0x1fc))),0x0;if(!_0x3a193d[_0x1e9698(0x311)]){if(!isInteractive())return console['error'](a50_0x3872fc[_0x1e9698(0x2fd)](_0x1e9698(0x1f5)),_0x1e9698(0x21b)),console[_0x1e9698(0x25b)](a50_0x3872fc[_0x1e9698(0x21e)](_0x1e9698(0x208))),0x1;const _0x3ad385=await confirmKey(_0x1e9698(0x291));if(!_0x3ad385)return console[_0x1e9698(0x25b)](a50_0x3872fc['yellow'](_0x1e9698(0x280)),'-\x20no\x20files\x20written'),0x1;}await withSpinner(_0x1e9698(0x20b),()=>_0x269a82[_0x1e9698(0x30c)]['applyPullProject'](_0x4cba7a,{'revision':_0x6ed6f5}),{'verbose':_0x3a193d[_0x1e9698(0x214)]}),saveSessionContext({'workflow_project':_0x4cba7a[_0x1e9698(0x244)]},_0x3a193d[_0x1e9698(0x2e2)]),console[_0x1e9698(0x25b)](a50_0x3872fc[_0x1e9698(0x2e3)](_0x1e9698(0x278)));const _0x3d985=a50_0x2b6305[_0x1e9698(0x37a)](process[_0x1e9698(0x389)](),_0x4cba7a[_0x1e9698(0x232)])||'.';return console[_0x1e9698(0x25b)](a50_0x3872fc[_0x1e9698(0x21e)](_0x1e9698(0x22a)+_0x3d985)),console[_0x1e9698(0x25b)](a50_0x3872fc['dim'](_0x1e9698(0x2ea)+_0x4cba7a[_0x1e9698(0x244)])),0x0;}}function a50_0x42f7(_0x302e66,_0x2ba1b4){_0x302e66=_0x302e66-0x1f3;const _0x54dc8c=a50_0x54dc();let _0x42f70f=_0x54dc8c[_0x302e66];return _0x42f70f;}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']='workflow:push';[a50_0x718729(0x37f)]=a50_0x718729(0x2d9);async[a50_0x718729(0x358)](_0x44676e){const _0x2f6b63=a50_0x718729,{options:_0x5e6030,args:_0x4ca4a3,tdx:_0x52a425}=_0x44676e,_0x30f032=this[_0x2f6b63(0x297)](_0x4ca4a3,_0x5e6030),_0x5234ad=_0x5e6030[_0x2f6b63(0x310)],_0x3f628b=_0x5e6030[_0x2f6b63(0x313)];_0x5e6030[_0x2f6b63(0x214)]&&(_0x30f032&&console[_0x2f6b63(0x25b)](_0x2f6b63(0x2c3)+_0x30f032),_0x5234ad&&console['error'](_0x2f6b63(0x212)+_0x5234ad),_0x5e6030[_0x2f6b63(0x38a)]&&console[_0x2f6b63(0x25b)](_0x2f6b63(0x34d)),_0x3f628b&&console[_0x2f6b63(0x25b)](_0x2f6b63(0x29b)));let _0x4e84bc;try{_0x4e84bc=await withSpinner(_0x2f6b63(0x335),()=>_0x52a425['workflow']['preparePushProject']({'sourceDir':_0x30f032,'revision':_0x5234ad,'skipValidation':_0x3f628b}),{'verbose':_0x5e6030[_0x2f6b63(0x214)]});}catch(_0x722f95){if(_0x722f95 instanceof Error&&_0x722f95[_0x2f6b63(0x26b)]['includes']('No\x20workflow\x20tdx.json\x20found'))return console['error'](a50_0x3872fc[_0x2f6b63(0x2fd)](_0x2f6b63(0x215)),_0x2f6b63(0x2e6)),_0x5e6030['workflowProject']?console[_0x2f6b63(0x25b)](a50_0x3872fc['dim']('Tip:\x20cd\x20to\x20workflows/'+_0x5e6030['workflowProject']+_0x2f6b63(0x32c)+_0x5e6030[_0x2f6b63(0x371)]+'\x27')):console[_0x2f6b63(0x25b)](a50_0x3872fc['dim'](_0x2f6b63(0x285))),0x1;throw _0x722f95;}const _0x45ac65=_0x4e84bc[_0x2f6b63(0x2dc)];console['error'](_0x2f6b63(0x315)+_0x45ac65['projectName']),console['error']('\x20\x20Source:\x20'+_0x45ac65['sourceDir']),console['error']('\x20\x20Revision:\x20'+_0x45ac65[_0x2f6b63(0x310)]),console['error'](_0x2f6b63(0x27a)+a50_0x3872fc[_0x2f6b63(0x2e3)]('+'+_0x45ac65['summary'][_0x2f6b63(0x27d)]+_0x2f6b63(0x206))+',\x20'+(a50_0x3872fc[_0x2f6b63(0x303)]('~'+_0x45ac65['summary'][_0x2f6b63(0x376)]+_0x2f6b63(0x36f))+',\x20')+(a50_0x3872fc[_0x2f6b63(0x2fd)]('-'+_0x45ac65[_0x2f6b63(0x29a)][_0x2f6b63(0x350)]+_0x2f6b63(0x290))+',\x20')+(''+a50_0x3872fc['dim'](_0x45ac65[_0x2f6b63(0x29a)][_0x2f6b63(0x1fa)]+_0x2f6b63(0x2ba))));for(const _0x3f9369 of _0x45ac65[_0x2f6b63(0x32a)]){_0x3f9369['type']===_0x2f6b63(0x376)&&_0x3f9369[_0x2f6b63(0x322)]&&(console[_0x2f6b63(0x25b)]('\x0a'+a50_0x3872fc[_0x2f6b63(0x2bb)](_0x2f6b63(0x2a0)+_0x3f9369[_0x2f6b63(0x202)])),console[_0x2f6b63(0x25b)](_0x3f9369[_0x2f6b63(0x322)]));}if(!_0x45ac65[_0x2f6b63(0x24c)])return console['error'](a50_0x3872fc[_0x2f6b63(0x2e3)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this['showWorkflowConsoleUrl'](_0x52a425,_0x45ac65[_0x2f6b63(0x244)],_0x5e6030[_0x2f6b63(0x253)]),0x0;if(_0x5e6030[_0x2f6b63(0x38a)])return console[_0x2f6b63(0x25b)](a50_0x3872fc['yellow'](_0x2f6b63(0x394))),0x0;if(!_0x5e6030[_0x2f6b63(0x311)]){if(!isInteractive())return console[_0x2f6b63(0x25b)](a50_0x3872fc[_0x2f6b63(0x2fd)](_0x2f6b63(0x1f5)),_0x2f6b63(0x21b)),console[_0x2f6b63(0x25b)](a50_0x3872fc[_0x2f6b63(0x21e)](_0x2f6b63(0x208))),0x1;const _0x5dffde=await confirmKey(_0x2f6b63(0x24f));if(!_0x5dffde)return console[_0x2f6b63(0x25b)](a50_0x3872fc['yellow']('Cancelled'),_0x2f6b63(0x316)),0x1;}const _0x2be87a=await withSpinner(_0x2f6b63(0x24b),()=>_0x52a425[_0x2f6b63(0x30c)][_0x2f6b63(0x2d3)](_0x45ac65),{'verbose':_0x5e6030[_0x2f6b63(0x214)]}),_0x17b1f6=_0x2be87a[_0x2f6b63(0x2dc)];return console[_0x2f6b63(0x25b)](a50_0x3872fc['green'](_0x2f6b63(0x2f4))),console[_0x2f6b63(0x25b)]('\x20\x20Project\x20ID:\x20'+_0x17b1f6['projectId']),console[_0x2f6b63(0x25b)](_0x2f6b63(0x319)+_0x17b1f6[_0x2f6b63(0x310)]),await this[_0x2f6b63(0x2ed)](_0x52a425,_0x17b1f6[_0x2f6b63(0x244)],_0x5e6030[_0x2f6b63(0x253)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a50_0x718729(0x37c)]=a50_0x718729(0x343);['description']='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a50_0x718729(0x358)](_0x2dcf06){const _0x306585=a50_0x718729,{options:_0xcf3588,args:_0x4f9998,tdx:_0x2047bf}=_0x2dcf06,_0x1622de=this['resolveProjectDir'](_0x4f9998,_0xcf3588),_0x776a72=_0xcf3588[_0x306585(0x37c)],_0xe9033e=_0xcf3588[_0x306585(0x310)],_0x554ae5=_0xcf3588[_0x306585(0x313)];if(!_0x1622de)return console[_0x306585(0x25b)](a50_0x3872fc[_0x306585(0x2fd)]('Error:'),_0x306585(0x318)),console['error'](a50_0x3872fc[_0x306585(0x21e)](_0x306585(0x230))),console[_0x306585(0x25b)](a50_0x3872fc[_0x306585(0x21e)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x776a72)return console['error'](a50_0x3872fc[_0x306585(0x2fd)](_0x306585(0x215)),_0x306585(0x375)),console[_0x306585(0x25b)](a50_0x3872fc[_0x306585(0x21e)](_0x306585(0x230))),0x1;_0xcf3588[_0x306585(0x214)]&&(console['error'](_0x306585(0x2c3)+_0x1622de),console['error']('New\x20project\x20name:\x20'+_0x776a72),_0xe9033e&&console[_0x306585(0x25b)](_0x306585(0x212)+_0xe9033e),_0xcf3588['dryRun']&&console[_0x306585(0x25b)](_0x306585(0x34d)),_0x554ae5&&console['error'](_0x306585(0x29b)));const _0x17be6f=await withSpinner(_0x306585(0x396),()=>_0x2047bf[_0x306585(0x30c)][_0x306585(0x2ff)](_0x1622de,_0x776a72,{'revision':_0xe9033e,'skipValidation':_0x554ae5}),{'verbose':_0xcf3588['verbose']}),_0x175f3d=_0x17be6f['data'];console[_0x306585(0x25b)]('Source:\x20'+_0x175f3d[_0x306585(0x2a8)]);_0x175f3d['sourceProjectName']&&console['error'](_0x306585(0x228)+_0x175f3d[_0x306585(0x397)]);console[_0x306585(0x25b)](_0x306585(0x2e9)+_0x175f3d[_0x306585(0x30b)]),console[_0x306585(0x25b)](_0x306585(0x212)+_0x175f3d[_0x306585(0x310)]),console['error'](_0x306585(0x227)+_0x175f3d[_0x306585(0x2e7)]);_0x175f3d['targetExists']&&(console[_0x306585(0x25b)](a50_0x3872fc['yellow'](_0x306585(0x21a)+_0x175f3d[_0x306585(0x30b)]+_0x306585(0x362)+_0x175f3d[_0x306585(0x201)]+')')),console[_0x306585(0x25b)](a50_0x3872fc['yellow'](_0x306585(0x2f8))));if(_0xcf3588[_0x306585(0x38a)])return console['error'](a50_0x3872fc[_0x306585(0x303)](_0x306585(0x282))),0x0;if(!_0xcf3588['yes']){if(!isInteractive())return console[_0x306585(0x25b)](a50_0x3872fc[_0x306585(0x2fd)](_0x306585(0x1f5)),_0x306585(0x21b)),console['error'](a50_0x3872fc['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x15ea25=_0x175f3d['sourceProjectName']||a50_0x2b6305[_0x306585(0x286)](_0x1622de),_0x4781ee=_0x175f3d['targetExists']?_0x306585(0x2d7)+_0x776a72+_0x306585(0x209):_0x306585(0x269)+_0x15ea25+_0x306585(0x382)+_0x776a72+'\x22?',_0x4ab9f7=await confirmKey(_0x4781ee);if(!_0x4ab9f7)return console[_0x306585(0x25b)](a50_0x3872fc[_0x306585(0x303)](_0x306585(0x280))),0x1;}const _0x507362=await withSpinner(_0x175f3d[_0x306585(0x2c9)]?_0x306585(0x22d)+_0x776a72+'...':'Cloning\x20to\x20'+_0x776a72+_0x306585(0x337),()=>_0x2047bf[_0x306585(0x30c)][_0x306585(0x273)](_0x175f3d),{'verbose':_0xcf3588[_0x306585(0x214)]}),_0x278e8c=_0x507362[_0x306585(0x2dc)];return console[_0x306585(0x25b)](a50_0x3872fc[_0x306585(0x2e3)](_0x175f3d[_0x306585(0x2c9)]?_0x306585(0x1f7):'✔\x20Clone\x20complete')),console[_0x306585(0x25b)]('\x20\x20Project:\x20'+_0x278e8c[_0x306585(0x30b)]),console[_0x306585(0x25b)](_0x306585(0x2c8)+_0x278e8c['newProjectId']),console[_0x306585(0x25b)](_0x306585(0x319)+_0x278e8c[_0x306585(0x310)]),await this[_0x306585(0x2ed)](_0x2047bf,_0x278e8c[_0x306585(0x30b)],_0xcf3588[_0x306585(0x253)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a50_0x718729(0x37c)]='workflow:delete';[a50_0x718729(0x37f)]=a50_0x718729(0x31c);async[a50_0x718729(0x358)](_0x148ec1){const _0x4b7ad9=a50_0x718729,{options:_0x577901,args:_0x58fb54,tdx:_0x2b1d68}=_0x148ec1,_0x468904=_0x58fb54[0x0];if(!_0x468904)return console['error'](_0x4b7ad9(0x275)),console[_0x4b7ad9(0x25b)](_0x4b7ad9(0x33c)),0x1;_0x577901[_0x4b7ad9(0x214)]&&console[_0x4b7ad9(0x25b)]('Project:\x20'+_0x468904);if(!_0x577901['yes']){if(!isInteractive())return console[_0x4b7ad9(0x25b)](a50_0x3872fc[_0x4b7ad9(0x2fd)](_0x4b7ad9(0x1f5)),_0x4b7ad9(0x21b)),console['error'](a50_0x3872fc[_0x4b7ad9(0x21e)](_0x4b7ad9(0x208))),0x1;const _0x41dceb=await confirmKey(_0x4b7ad9(0x359)+_0x468904+_0x4b7ad9(0x287));if(!_0x41dceb)return console[_0x4b7ad9(0x25b)](a50_0x3872fc[_0x4b7ad9(0x303)](_0x4b7ad9(0x280))),0x1;}const _0x4106f1=await withSpinner(_0x4b7ad9(0x2fe)+_0x468904+_0x4b7ad9(0x337),()=>_0x2b1d68[_0x4b7ad9(0x30c)][_0x4b7ad9(0x296)](_0x468904),{'verbose':_0x577901[_0x4b7ad9(0x214)]}),_0x5c5f81=_0x4106f1[_0x4b7ad9(0x2dc)];return console[_0x4b7ad9(0x25b)]('✔\x20Deleted\x20project\x20'+_0x5c5f81[_0x4b7ad9(0x244)]),console['error'](_0x4b7ad9(0x2c8)+_0x5c5f81['projectId']),0x0;}}export function parseKeyValue(_0x4f23f9){const _0x4c12ff=a50_0x718729,_0x4bdaba=_0x4f23f9['indexOf']('=');if(_0x4bdaba===-0x1)throw new Error(_0x4c12ff(0x37d)+_0x4f23f9+_0x4c12ff(0x1f8));const _0x136fa1=_0x4f23f9[_0x4c12ff(0x2ee)](0x0,_0x4bdaba),_0x59a2be=_0x4f23f9[_0x4c12ff(0x2ee)](_0x4bdaba+0x1);if(!_0x136fa1)throw new Error(_0x4c12ff(0x2be));return{'key':_0x136fa1,'value':_0x59a2be};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a50_0x718729(0x37c)]=a50_0x718729(0x2a9);[a50_0x718729(0x37f)]=a50_0x718729(0x1fd);async[a50_0x718729(0x358)](_0x24efa8){const _0x831a=a50_0x718729,{options:_0x3e6d5f,args:_0x408147,tdx:_0x22b430}=_0x24efa8,_0x27a713=this['requireProject'](_0x408147,_0x3e6d5f);if(!_0x27a713)return 0x1;_0x3e6d5f[_0x831a(0x214)]&&console['error'](_0x831a(0x281)+_0x27a713);const _0x55b2c0=await withSpinner(_0x831a(0x288),()=>_0x22b430[_0x831a(0x30c)][_0x831a(0x242)](_0x27a713),{'verbose':_0x3e6d5f[_0x831a(0x214)]}),{secrets:_0x59a913}=_0x55b2c0[_0x831a(0x2dc)];return console[_0x831a(0x25b)](_0x831a(0x2bf)+_0x59a913[_0x831a(0x2f1)]+_0x831a(0x238)+(_0x59a913[_0x831a(0x2f1)]!==0x1?'s':'')),await handleSDKOutput(_0x59a913,_0x3e6d5f),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a50_0x718729(0x37c)]=a50_0x718729(0x34c);['description']=a50_0x718729(0x2e5);async[a50_0x718729(0x358)](_0x510c9d){const _0x1279bb=a50_0x718729,{options:_0x1f5542,args:_0x221d8a,tdx:_0x23ee4a}=_0x510c9d;let _0x81b75b,_0x2af502;if(_0x221d8a[_0x1279bb(0x2f1)]>=0x2)_0x81b75b=_0x221d8a[0x0],_0x2af502=_0x221d8a[0x1];else{if(_0x221d8a[_0x1279bb(0x2f1)]===0x1&&_0x1f5542['workflowProject'])_0x81b75b=_0x1f5542[_0x1279bb(0x371)],_0x2af502=_0x221d8a[0x0];else return _0x221d8a[_0x1279bb(0x2f1)]===0x1?(console[_0x1279bb(0x25b)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x1279bb(0x25b)](_0x1279bb(0x29e)),0x1):(console[_0x1279bb(0x25b)]('Error:\x20KEY=VALUE\x20is\x20required'),console['error'](_0x1279bb(0x2b6)),0x1);}let _0xf47430,_0x372e32;try{({key:_0xf47430,value:_0x372e32}=parseKeyValue(_0x2af502));}catch(_0x405a35){return _0x405a35 instanceof Error&&console[_0x1279bb(0x25b)](a50_0x3872fc[_0x1279bb(0x2fd)]('Error:'),_0x405a35[_0x1279bb(0x26b)]),0x1;}_0x1f5542['verbose']&&(console[_0x1279bb(0x25b)](_0x1279bb(0x281)+_0x81b75b),console[_0x1279bb(0x25b)](_0x1279bb(0x364)+_0xf47430));const _0x2888c2=await withSpinner('Setting\x20secret...',()=>_0x23ee4a[_0x1279bb(0x30c)]['setSecret'](_0x81b75b,_0xf47430,_0x372e32),{'verbose':_0x1f5542[_0x1279bb(0x214)]}),_0x11ce12=_0x2888c2[_0x1279bb(0x2dc)];return console[_0x1279bb(0x25b)](_0x1279bb(0x355)+_0x11ce12[_0x1279bb(0x262)]+_0x1279bb(0x1f3)+_0x11ce12[_0x1279bb(0x244)]+'\x27'),(_0x1f5542['json']||_0x1f5542[_0x1279bb(0x2d8)])&&await handleSingleObjectOutput(_0x11ce12,_0x1f5542),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a50_0x718729(0x37c)]='workflow:secrets:delete';[a50_0x718729(0x37f)]=a50_0x718729(0x2c2);async[a50_0x718729(0x358)](_0x5bbe3a){const _0x8f12f9=a50_0x718729,{options:_0x5309d0,args:_0x14ecb2,tdx:_0x142cde}=_0x5bbe3a;let _0x28f4ad,_0x274dd5;if(_0x14ecb2['length']>=0x2)_0x28f4ad=_0x14ecb2[0x0],_0x274dd5=_0x14ecb2[0x1];else{if(_0x14ecb2[_0x8f12f9(0x2f1)]===0x1&&_0x5309d0[_0x8f12f9(0x371)])_0x28f4ad=_0x5309d0[_0x8f12f9(0x371)],_0x274dd5=_0x14ecb2[0x0];else return _0x14ecb2[_0x8f12f9(0x2f1)]===0x1?(console[_0x8f12f9(0x25b)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x8f12f9(0x25b)](_0x8f12f9(0x29e)),0x1):(console[_0x8f12f9(0x25b)]('Error:\x20Secret\x20key\x20is\x20required'),console[_0x8f12f9(0x25b)](_0x8f12f9(0x2bc)),0x1);}_0x5309d0[_0x8f12f9(0x214)]&&(console[_0x8f12f9(0x25b)](_0x8f12f9(0x281)+_0x28f4ad),console['error'](_0x8f12f9(0x364)+_0x274dd5));if(!_0x5309d0['yes']){if(!isInteractive())return console[_0x8f12f9(0x25b)](a50_0x3872fc['red'](_0x8f12f9(0x1f5)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a50_0x3872fc['dim'](_0x8f12f9(0x208))),0x1;const _0x923350=await confirmKey(_0x8f12f9(0x30a)+_0x274dd5+_0x8f12f9(0x2a5)+_0x28f4ad+'\x27?');if(!_0x923350)return console[_0x8f12f9(0x25b)](a50_0x3872fc[_0x8f12f9(0x303)](_0x8f12f9(0x280))),0x1;}const _0x5dec0f=await withSpinner(_0x8f12f9(0x2a6),()=>_0x142cde[_0x8f12f9(0x30c)]['deleteSecret'](_0x28f4ad,_0x274dd5),{'verbose':_0x5309d0[_0x8f12f9(0x214)]}),_0x48c80f=_0x5dec0f[_0x8f12f9(0x2dc)];return console[_0x8f12f9(0x25b)]('✔\x20Secret\x20\x27'+_0x48c80f['key']+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x48c80f[_0x8f12f9(0x244)]+'\x27'),(_0x5309d0[_0x8f12f9(0x2f5)]||_0x5309d0[_0x8f12f9(0x2d8)])&&await handleSingleObjectOutput(_0x48c80f,_0x5309d0),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(_0x343c48){const _0x1656d7=a50_0x718729,_0x345bfe=Math[_0x1656d7(0x26c)](_0x343c48/0x3e8),_0x408528=Math['floor'](_0x345bfe/0x3c),_0x1d7009=Math['floor'](_0x408528/0x3c),_0x47fd95=Math[_0x1656d7(0x26c)](_0x1d7009/0x18);if(_0x47fd95>0x0){const _0x3e18b5=_0x1d7009%0x18;return _0x3e18b5>0x0?_0x47fd95+'d\x20'+_0x3e18b5+'h':_0x47fd95+'d';}else{if(_0x1d7009>0x0){const _0x8a317e=_0x408528%0x3c;return _0x8a317e>0x0?_0x1d7009+'h\x20'+_0x8a317e+'m':_0x1d7009+'h';}else{if(_0x408528>0x0){const _0x4e5dd8=_0x345bfe%0x3c;return _0x4e5dd8>0x0?_0x408528+'m\x20'+_0x4e5dd8+'s':_0x408528+'m';}else return _0x345bfe+'s';}}}function formatTimestamp(_0x127361,_0x44c7ac){const _0x241074=a50_0x718729,_0x241c40=new Date(_0x127361),_0xc785ed=String(_0x241c40['getHours']())[_0x241074(0x35e)](0x2,'0'),_0x30e6f0=String(_0x241c40['getMinutes']())[_0x241074(0x35e)](0x2,'0'),_0x5c7b89=_0xc785ed+':'+_0x30e6f0,_0x1e19e4=_0x241c40['getFullYear']()===_0x44c7ac[_0x241074(0x204)]()&&_0x241c40[_0x241074(0x26e)]()===_0x44c7ac[_0x241074(0x26e)]()&&_0x241c40[_0x241074(0x390)]()===_0x44c7ac['getDate']();if(_0x1e19e4)return _0x5c7b89;else{const _0x717ac4=String(_0x241c40[_0x241074(0x26e)]()+0x1)[_0x241074(0x35e)](0x2,'0'),_0x3ab3ca=String(_0x241c40[_0x241074(0x390)]())[_0x241074(0x35e)](0x2,'0');return _0x717ac4+'-'+_0x3ab3ca+'\x20'+_0x5c7b89;}}function formatDate(_0x71c741){const _0x5be81d=a50_0x718729,_0x36cc2b=_0x71c741[_0x5be81d(0x204)](),_0x2bc158=String(_0x71c741['getMonth']()+0x1)[_0x5be81d(0x35e)](0x2,'0'),_0x438e25=String(_0x71c741['getDate']())['padStart'](0x2,'0');return _0x36cc2b+'-'+_0x2bc158+'-'+_0x438e25;}function getTaskStateIcon(_0x23ae09){const _0x38d672={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x38d672[_0x23ae09]||'⚪';}function getBarChar(_0x42add6){const _0x18acf=a50_0x718729;return _0x42add6==='error'||_0x42add6===_0x18acf(0x332)?'×':'─';}function getBarColor(_0x53caea){const _0x289d5b=a50_0x718729,_0x232eda={'success':a50_0x3872fc['green'],'error':a50_0x3872fc['red'],'group_error':a50_0x3872fc['red'],'running':a50_0x3872fc[_0x289d5b(0x256)],'blocked':a50_0x3872fc[_0x289d5b(0x303)],'planned':a50_0x3872fc[_0x289d5b(0x21e)],'canceling':a50_0x3872fc[_0x289d5b(0x303)]};return _0x232eda[_0x53caea]||a50_0x3872fc['white'];}function parseTaskName(_0x30e87c){const _0x45e33d=a50_0x718729;let _0x523b7d=_0x30e87c[_0x45e33d(0x2d2)](/^\++/,'');const _0x2601e6=_0x523b7d[_0x45e33d(0x36b)]('+'),_0x525ee5=_0x2601e6[_0x45e33d(0x2f1)]>0x1?_0x2601e6[_0x45e33d(0x2f1)]-0x2:0x0,_0x411d61=_0x2601e6[_0x2601e6[_0x45e33d(0x2f1)]-0x1]||_0x523b7d;return{'level':_0x525ee5,'name':'+'+_0x411d61};}function truncateTaskName(_0x19b0a9,_0x1151d4){const _0x237471=a50_0x718729,_0x5ed634=stringWidth(_0x19b0a9);if(_0x5ed634<=_0x1151d4)return _0x19b0a9;let _0x8e507c=_0x19b0a9;while(stringWidth(_0x8e507c+'…')>_0x1151d4&&_0x8e507c[_0x237471(0x2f1)]>0x0){_0x8e507c=_0x8e507c[_0x237471(0x31e)](0x0,-0x1);}return _0x8e507c+'…';}function calculateTimeScale(_0x487208,_0xb60522){const _0x606fa6=a50_0x718729;return{'startTime':_0x487208['start'],'endTime':_0x487208[_0x606fa6(0x2b4)],'durationMs':_0x487208[_0x606fa6(0x304)],'msPerChar':_0x487208[_0x606fa6(0x304)]/_0xb60522};}function timeToPosition(_0x48c739,_0x4a15ac,_0x382214){const _0x3d8568=a50_0x718729,_0x374e3f=_0x48c739-_0x4a15ac['startTime'],_0x6a182c=Math[_0x3d8568(0x26c)](_0x374e3f/_0x4a15ac['msPerChar']);return Math['max'](0x0,Math[_0x3d8568(0x231)](_0x6a182c,_0x382214));}function renderTimeAxis(_0x304aa3,_0x4bafeb){const _0x456de2=a50_0x718729,_0x3969bd=Math['min'](TIMELINE_CONFIG[_0x456de2(0x22b)],Math[_0x456de2(0x302)](TIMELINE_CONFIG[_0x456de2(0x263)],Math[_0x456de2(0x26c)](_0x4bafeb/TIMELINE_CONFIG[_0x456de2(0x223)]))),_0x2cb001=_0x304aa3[_0x456de2(0x229)]/(_0x3969bd-0x1),_0x5efb8c=new Date(_0x304aa3[_0x456de2(0x2b0)]),_0x56fccf=[];for(let _0x2c3c42=0x0;_0x2c3c42<_0x3969bd;_0x2c3c42++){const _0x2ec1cd=_0x304aa3[_0x456de2(0x2b0)]+_0x2c3c42*_0x2cb001,_0x2bab44=timeToPosition(_0x2ec1cd,_0x304aa3,_0x4bafeb),_0x3a909e=formatTimestamp(_0x2ec1cd,_0x5efb8c);_0x56fccf['push']({'pos':_0x2bab44,'text':_0x3a909e});}const _0x4dd0e6=new Array(_0x4bafeb)[_0x456de2(0x22f)]('\x20');let _0x1d0d1b=-0x1;for(const {pos:_0x1fab4e,text:_0x18fa0a}of _0x56fccf){let _0x1d2c7a=Math[_0x456de2(0x302)](0x0,_0x1fab4e-Math[_0x456de2(0x26c)](_0x18fa0a[_0x456de2(0x2f1)]/0x2));_0x1d2c7a<=_0x1d0d1b+TIMELINE_CONFIG[_0x456de2(0x1f4)]&&(_0x1d2c7a=_0x1d0d1b+TIMELINE_CONFIG[_0x456de2(0x1f4)]+0x1);_0x1d2c7a+_0x18fa0a[_0x456de2(0x2f1)]>_0x4bafeb&&(_0x1d2c7a=_0x4bafeb-_0x18fa0a['length']);if(_0x1d2c7a>=0x0&&_0x1d2c7a+_0x18fa0a[_0x456de2(0x2f1)]<=_0x4bafeb&&_0x1d2c7a>_0x1d0d1b){for(let _0x4a5c0d=0x0;_0x4a5c0d<_0x18fa0a['length'];_0x4a5c0d++){_0x4dd0e6[_0x1d2c7a+_0x4a5c0d]=_0x18fa0a[_0x4a5c0d];}_0x1d0d1b=_0x1d2c7a+_0x18fa0a[_0x456de2(0x2f1)]-0x1;}}return _0x4dd0e6[_0x456de2(0x370)]('');}function renderTaskRow(_0x1baf7b,_0x4b7a7a,_0x2d59d6,_0x465e23){const _0x586fba=a50_0x718729,{level:_0x442e0c,name:_0x4b1cd2}=parseTaskName(_0x1baf7b[_0x586fba(0x37c)]),_0x17c84e='\x20'[_0x586fba(0x28a)](_0x442e0c),_0x458f8b=_0x1baf7b[_0x586fba(0x2bd)]?'('+formatElapsed(_0x1baf7b[_0x586fba(0x2bd)][_0x586fba(0x304)])+')':'',_0x50e692=stringWidth(_0x458f8b),_0x1dbe6a=_0x442e0c*0x1,_0x47e123=_0x465e23-_0x1dbe6a-_0x50e692-0x1,_0xb999ce=truncateTaskName(_0x4b1cd2,_0x47e123),_0x118852=_0x17c84e+_0xb999ce,_0x3d6ff5=stringWidth(_0x118852),_0x48a111=_0x465e23-_0x3d6ff5-_0x50e692,_0x17d1f3=_0x118852+'\x20'[_0x586fba(0x28a)](Math[_0x586fba(0x302)](0x1,_0x48a111))+a50_0x3872fc[_0x586fba(0x21e)](_0x458f8b),_0x4806ea=getTaskStateIcon(_0x1baf7b[_0x586fba(0x1f9)]),_0x58ddca=new Array(_0x2d59d6)[_0x586fba(0x22f)]('\x20');if(_0x1baf7b['window']){const _0x5cb112=timeToPosition(_0x1baf7b[_0x586fba(0x2bd)][_0x586fba(0x2b1)],_0x4b7a7a,_0x2d59d6),_0x56a646=timeToPosition(_0x1baf7b[_0x586fba(0x2bd)][_0x586fba(0x2b4)],_0x4b7a7a,_0x2d59d6),_0x40f551=getBarChar(_0x1baf7b[_0x586fba(0x1f9)]),_0x34f96c=Math[_0x586fba(0x302)](_0x5cb112+0x1,_0x56a646);for(let _0x3f4922=_0x5cb112;_0x3f4922<Math[_0x586fba(0x231)](_0x34f96c,_0x2d59d6);_0x3f4922++){_0x58ddca[_0x3f4922]=_0x40f551;}}const _0x5cfc8a=getBarColor(_0x1baf7b[_0x586fba(0x1f9)]),_0x2e23e8=_0x58ddca[_0x586fba(0x2cb)](_0x43c89c=>_0x43c89c==='\x20'?'\x20':_0x5cfc8a(_0x43c89c))['join']('');return _0x4806ea+'\x20'+_0x17d1f3+'│'+_0x2e23e8+'│';}function calculateStats(_0x47c587){const _0x6739bd=a50_0x718729,_0x5302f4={'total':_0x47c587[_0x6739bd(0x2f1)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x8c710c of _0x47c587){if(_0x8c710c[_0x6739bd(0x1f9)]===_0x6739bd(0x24d))_0x5302f4['success']++;else{if(_0x8c710c[_0x6739bd(0x1f9)]==='error'||_0x8c710c[_0x6739bd(0x1f9)]===_0x6739bd(0x332))_0x5302f4['error']++;else _0x8c710c['state']===_0x6739bd(0x261)?_0x5302f4['running']++:_0x5302f4['pending']++;}}return _0x5302f4;}function formatStats(_0x594282){const _0xeda3ea=a50_0x718729;return['Total:\x20'+_0x594282[_0xeda3ea(0x23c)],'✅\x20'+_0x594282[_0xeda3ea(0x24d)],'❌\x20'+_0x594282['error'],_0xeda3ea(0x393)+_0x594282[_0xeda3ea(0x261)],'⏳\x20'+_0x594282['pending']][_0xeda3ea(0x370)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a50_0x718729(0x37c)]='workflow:timeline';[a50_0x718729(0x37f)]=a50_0x718729(0x363);async[a50_0x718729(0x358)](_0x497473){const _0x20626a=a50_0x718729,{options:_0x1a20fe,args:_0x577f37,tdx:_0x207051}=_0x497473;let _0x350e7c,_0x37d72e,_0x151fe4=![];if(_0x577f37[0x0]){if(_0x577f37[0x0]['includes']('.')){const _0x18fce3=this[_0x20626a(0x25d)](_0x577f37,_0x1a20fe);if(!_0x18fce3)return 0x1;_0x350e7c=_0x18fce3['projectName'],_0x37d72e=_0x18fce3[_0x20626a(0x272)];}else{_0x37d72e=_0x577f37[0x0],_0x350e7c=_0x1a20fe[_0x20626a(0x371)];if(!_0x350e7c)return console[_0x20626a(0x25b)](a50_0x3872fc[_0x20626a(0x2fd)](_0x20626a(0x215)),_0x20626a(0x379)),0x1;_0x151fe4=!![];}}else{const _0x3ab7b0=this[_0x20626a(0x25d)](_0x577f37,_0x1a20fe);if(!_0x3ab7b0)return 0x1;_0x350e7c=_0x3ab7b0['projectName'],_0x37d72e=_0x3ab7b0[_0x20626a(0x272)];}if(_0x1a20fe[_0x20626a(0x214)]){if(_0x350e7c&&_0x37d72e)console[_0x20626a(0x25b)](_0x20626a(0x1fe)+_0x350e7c+'.'+_0x37d72e);else _0x350e7c&&console[_0x20626a(0x25b)](_0x20626a(0x339)+_0x350e7c);}const _0x106603=_0x1a20fe[_0x20626a(0x2ec)],_0x2a16f2=_0x1a20fe[_0x20626a(0x1ff)];if(_0x106603){_0x2a16f2&&console['error'](a50_0x3872fc['yellow'](_0x20626a(0x259)),_0x20626a(0x2df));const _0x4c3519=_0x1a20fe[_0x20626a(0x2a7)];return _0x4c3519?await this[_0x20626a(0x24a)](_0x497473,_0x106603):await this[_0x20626a(0x216)](_0x497473,_0x106603,_0x1a20fe),0x0;}if(_0x2a16f2){const _0x3007f9=await withSpinner(_0x20626a(0x239),()=>_0x207051[_0x20626a(0x30c)][_0x20626a(0x37e)]({'projectName':_0x350e7c,'workflowName':_0x37d72e,'limit':0x64}),{'verbose':_0x1a20fe[_0x20626a(0x214)]}),_0x3e8a68=_0x3007f9['data'][_0x20626a(0x20a)](_0x520d83=>_0x520d83['id']===_0x2a16f2);if(!_0x3e8a68)return console['error'](a50_0x3872fc[_0x20626a(0x2fd)](_0x20626a(0x215)),_0x20626a(0x2b9)+_0x2a16f2),0x1;if(!_0x3e8a68[_0x20626a(0x384)]?.['id'])return console['error'](a50_0x3872fc[_0x20626a(0x2fd)](_0x20626a(0x215)),'Session\x20'+_0x2a16f2+_0x20626a(0x224)),0x1;const _0x392f22=_0x3e8a68[_0x20626a(0x384)]['id'];_0x1a20fe[_0x20626a(0x214)]&&console[_0x20626a(0x25b)](_0x20626a(0x250)+_0x392f22+'\x20from\x20session\x20'+_0x2a16f2);const _0xb9d4a0=_0x1a20fe[_0x20626a(0x2a7)];return _0xb9d4a0?await this[_0x20626a(0x24a)](_0x497473,_0x392f22):await this[_0x20626a(0x216)](_0x497473,_0x392f22,_0x1a20fe),0x0;}const _0x28fe86=await withSpinner('Loading\x20sessions...',()=>_0x207051['workflow'][_0x20626a(0x37e)]({'projectName':_0x350e7c,'workflowName':_0x37d72e,'limit':_0x1a20fe['limit']||0x32}),{'verbose':_0x1a20fe[_0x20626a(0x214)]}),_0x1dc73d=_0x28fe86[_0x20626a(0x2dc)];if(_0x1dc73d[_0x20626a(0x2f1)]===0x0){if(_0x350e7c&&_0x37d72e)console[_0x20626a(0x25b)]('No\x20sessions\x20found\x20for:\x20'+_0x350e7c+'.'+_0x37d72e);else _0x350e7c?console[_0x20626a(0x25b)](_0x20626a(0x237)+_0x350e7c):(console[_0x20626a(0x25b)](_0x20626a(0x391)),console['error'](a50_0x3872fc[_0x20626a(0x21e)](_0x20626a(0x338))));return 0x0;}_0x1dc73d[_0x20626a(0x28d)]((_0x54416f,_0x3c01b2)=>{const _0x127f95=_0x20626a,_0xcc2ffc=_0x54416f[_0x127f95(0x35f)]||'',_0x28433f=_0x3c01b2[_0x127f95(0x35f)]||'';return _0x28433f['localeCompare'](_0xcc2ffc);});if(_0x1a20fe[_0x20626a(0x2f5)]||_0x1a20fe[_0x20626a(0x2d8)])return await handleSDKOutput(_0x1dc73d,_0x1a20fe),0x0;let _0x3039e0;if(_0x151fe4){const _0x16b221=_0x1dc73d[0x0];if(!_0x16b221[_0x20626a(0x384)]?.['id'])return console[_0x20626a(0x25b)](_0x20626a(0x248)),0x0;_0x3039e0=_0x16b221[_0x20626a(0x384)]['id'],_0x1a20fe[_0x20626a(0x214)]&&console[_0x20626a(0x25b)](_0x20626a(0x2b8)+_0x16b221[_0x20626a(0x35f)]);}else{const _0x2557ff=_0x1dc73d[_0x20626a(0x2cb)](_0x11fca4=>{const _0x307551=_0x20626a,_0x36bf2a=getAttemptStatusDisplay(_0x11fca4[_0x307551(0x384)]);return{'title':_0x11fca4[_0x307551(0x324)]?.[_0x307551(0x37c)]+'.'+_0x11fca4[_0x307551(0x30c)]?.[_0x307551(0x37c)]+'\x20-\x20'+_0x11fca4[_0x307551(0x35f)]+'\x20'+_0x36bf2a[_0x307551(0x219)],'value':_0x11fca4['lastAttempt']?.['id']||'','description':_0x36bf2a[_0x307551(0x22e)]};}),_0x2ddc52=await a50_0x6abfdd({'type':_0x20626a(0x329),'name':_0x20626a(0x2ec),'message':_0x20626a(0x20e),'choices':_0x2557ff[_0x20626a(0x277)](_0x198adf=>_0x198adf['value']!=='')});if(!_0x2ddc52['attemptId'])return 0x0;_0x3039e0=_0x2ddc52[_0x20626a(0x2ec)];}const _0x399411=_0x1a20fe[_0x20626a(0x2a7)];return _0x399411?await this[_0x20626a(0x24a)](_0x497473,_0x3039e0):await this[_0x20626a(0x216)](_0x497473,_0x3039e0,_0x1a20fe),0x0;}async['renderSingleTimeline'](_0xc3a146,_0x4a8169,_0x5a020c){const _0xb5b859=a50_0x718729,{tdx:_0x807e31}=_0xc3a146;let _0xc98f7c,_0x23b5f9;try{[_0xc98f7c,_0x23b5f9]=await Promise[_0xb5b859(0x301)]([_0x807e31[_0xb5b859(0x30c)]['attempt'](_0x4a8169),_0x807e31[_0xb5b859(0x30c)][_0xb5b859(0x309)](_0x4a8169,![])]);}catch(_0x5627d0){console[_0xb5b859(0x25b)](a50_0x3872fc['red'](_0xb5b859(0x38f)));_0x5a020c[_0xb5b859(0x214)]&&console[_0xb5b859(0x25b)](_0x5627d0);throw _0x5627d0;}if(_0x5a020c[_0xb5b859(0x2f5)]||_0x5a020c[_0xb5b859(0x2d8)]){const _0x4d5f60=this['buildTimelineData'](_0xc98f7c,_0x23b5f9);await handleSDKOutput([_0x4d5f60],_0x5a020c);return;}const _0x40497b=_0x807e31[_0xb5b859(0x220)]['site'],_0x8958f=this['renderTimeline'](_0xc98f7c,_0x23b5f9,_0x40497b);console[_0xb5b859(0x2f3)](_0x8958f);}async['pollTimeline'](_0x222782,_0x5c34d3){const _0x3fa638=a50_0x718729,{tdx:_0x149999}=_0x222782,_0x1f3ad4=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x10330c=TIMELINE_CONFIG[_0x3fa638(0x353)];let _0x4010cd=0x0;while(_0x4010cd<_0x10330c){process['stdout'][_0x3fa638(0x205)]&&process[_0x3fa638(0x27c)][_0x3fa638(0x20f)]('\x1bc');let _0x426bbe,_0x2e661e;try{[_0x426bbe,_0x2e661e]=await Promise[_0x3fa638(0x301)]([_0x149999[_0x3fa638(0x30c)]['attempt'](_0x5c34d3),_0x149999[_0x3fa638(0x30c)]['tasks'](_0x5c34d3,![])]);}catch(_0x529016){console['error'](a50_0x3872fc[_0x3fa638(0x2fd)](_0x3fa638(0x2b7)));_0x4010cd>0x0&&console[_0x3fa638(0x25b)](a50_0x3872fc[_0x3fa638(0x21e)](_0x3fa638(0x23e)+_0x4010cd));throw _0x529016;}const _0x4d3439=_0x149999[_0x3fa638(0x220)][_0x3fa638(0x253)],_0x2a6092=this[_0x3fa638(0x2dd)](_0x426bbe,_0x2e661e,_0x4d3439);console['log'](_0x2a6092);const _0x3928eb=_0x426bbe[_0x3fa638(0x221)]&&_0x2e661e['every'](_0x54d948=>_0x54d948[_0x3fa638(0x1f9)]!==_0x3fa638(0x261)&&_0x54d948[_0x3fa638(0x1f9)]!==_0x3fa638(0x347));if(_0x3928eb){console[_0x3fa638(0x25b)](a50_0x3872fc['green']('\x0a✔\x20Attempt\x20complete'));break;}console[_0x3fa638(0x25b)](a50_0x3872fc['dim'](_0x3fa638(0x2af)+_0x4010cd*0x2+_0x3fa638(0x294))),await new Promise(_0x408be4=>setTimeout(_0x408be4,_0x1f3ad4)),_0x4010cd++;}_0x4010cd>=_0x10330c&&console[_0x3fa638(0x25b)](a50_0x3872fc[_0x3fa638(0x303)]('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a50_0x718729(0x2dd)](_0x5384ab,_0x1ab757,_0x1fc644){const _0x10c65e=a50_0x718729,_0x49853c=[],_0x2fbb38=TIMELINE_CONFIG[_0x10c65e(0x27b)],_0x26011c=0x5,_0x1c7329=process[_0x10c65e(0x27c)][_0x10c65e(0x2c5)]||0x78,_0x66e3e3=_0x1c7329-_0x2fbb38-_0x26011c,_0x4b2058=Math[_0x10c65e(0x302)](TIMELINE_CONFIG['MIN_TIMELINE_WIDTH'],Math['min'](_0x66e3e3,TIMELINE_CONFIG[_0x10c65e(0x36a)])),_0xcc1037=new Date(_0x5384ab['createdAt'])[_0x10c65e(0x35a)](),_0xa47c5d=_0x5384ab[_0x10c65e(0x2a4)]?new Date(_0x5384ab[_0x10c65e(0x2a4)])[_0x10c65e(0x35a)]():Date[_0x10c65e(0x23b)](),_0x26a3c5={'start':_0xcc1037,'end':_0xa47c5d,'duration':_0xa47c5d-_0xcc1037},_0x40fb7e=new Map(),_0x57026f=[];for(const _0x41c00d of _0x1ab757){if(_0x41c00d[_0x10c65e(0x300)]){const _0xe8962f=new Date(_0x41c00d[_0x10c65e(0x300)])[_0x10c65e(0x35a)](),_0x3e505=_0x41c00d[_0x10c65e(0x2d4)]?new Date(_0x41c00d[_0x10c65e(0x2d4)])['getTime']():Date[_0x10c65e(0x23b)](),_0xce04a5={'start':_0xe8962f,'end':_0x3e505,'duration':_0x3e505-_0xe8962f};_0x40fb7e[_0x10c65e(0x213)](_0x41c00d['id'],_0xce04a5),_0x57026f['push']({'name':_0x41c00d[_0x10c65e(0x360)],'state':_0x41c00d[_0x10c65e(0x1f9)]||'unknown','window':_0xce04a5});}else _0x57026f[_0x10c65e(0x38d)]({'name':_0x41c00d[_0x10c65e(0x360)],'state':_0x41c00d[_0x10c65e(0x1f9)]||_0x10c65e(0x347),'window':undefined});}_0x57026f['sort']((_0x511bc1,_0x1ee3d8)=>{const _0x45798d=_0x10c65e;if(!_0x511bc1['window'])return 0x1;if(!_0x1ee3d8[_0x45798d(0x2bd)])return-0x1;return _0x511bc1[_0x45798d(0x2bd)][_0x45798d(0x2b1)]-_0x1ee3d8['window'][_0x45798d(0x2b1)];});const _0x31def6=_0x57026f[_0x10c65e(0x2f1)],_0x2d10ff=_0x31def6>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x2d10ff&&_0x57026f[_0x10c65e(0x25e)](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x1bf27d=calculateTimeScale(_0x26a3c5,_0x4b2058),_0x3e2651=_0x5384ab['done']?_0x5384ab['success']?a50_0x3872fc[_0x10c65e(0x2e3)](_0x10c65e(0x24d)):a50_0x3872fc[_0x10c65e(0x2fd)](_0x10c65e(0x25b)):a50_0x3872fc['blue'](_0x10c65e(0x261)),_0x169acc=_0x5384ab[_0x10c65e(0x324)]?.['id'],_0x3801d5=_0x5384ab[_0x10c65e(0x1ff)];let _0x3b7bb3;if(_0x169acc&&_0x3801d5){const _0x20ac7e=getWorkflowAttemptUrl(_0x1fc644,_0x169acc,_0x3801d5,_0x5384ab['id']);_0x3b7bb3=hyperlink(a50_0x3872fc[_0x10c65e(0x21e)](_0x5384ab['id']),_0x20ac7e);}else _0x3b7bb3=a50_0x3872fc['dim'](_0x5384ab['id']);_0x49853c[_0x10c65e(0x38d)](_0x10c65e(0x383)+_0x3b7bb3+_0x10c65e(0x28c)+_0x3e2651+'\x20-\x20'+formatElapsed(_0x26a3c5[_0x10c65e(0x304)]));if(_0x57026f['length']>0x0){const _0x35c9dd=renderTimeAxis(_0x1bf27d,_0x4b2058),_0x2cddca=new Date(_0x26a3c5[_0x10c65e(0x2b1)]),_0xfd1c74=formatDate(_0x2cddca),_0x1706a7=TIMELINE_CONFIG[_0x10c65e(0x377)]+TIMELINE_CONFIG[_0x10c65e(0x36d)]+_0x2fbb38,_0x77eeda=_0xfd1c74[_0x10c65e(0x35e)](_0x1706a7),_0x451704=a50_0x3872fc[_0x10c65e(0x21e)](_0x77eeda);_0x49853c[_0x10c65e(0x38d)](_0x451704+'\x20'+_0x35c9dd);for(const _0x2d41e of _0x57026f){_0x49853c[_0x10c65e(0x38d)](renderTaskRow(_0x2d41e,_0x1bf27d,_0x4b2058,_0x2fbb38));}const _0x5672d6=calculateStats(_0x57026f);_0x49853c[_0x10c65e(0x38d)](formatStats(_0x5672d6)),_0x2d10ff&&_0x49853c[_0x10c65e(0x38d)](a50_0x3872fc[_0x10c65e(0x303)](_0x10c65e(0x31d)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x10c65e(0x327)+_0x31def6+_0x10c65e(0x255))),_0x49853c[_0x10c65e(0x38d)](''),_0x49853c[_0x10c65e(0x38d)](a50_0x3872fc['dim'](_0x10c65e(0x2d1))+(_0x10c65e(0x2fb)+_0x5384ab['id']+_0x10c65e(0x340))+a50_0x3872fc['dim'](_0x10c65e(0x352)));}else _0x49853c[_0x10c65e(0x38d)](_0x10c65e(0x331));return _0x49853c['join']('\x0a');}[a50_0x718729(0x2f9)](_0xecee72,_0x5ac723){const _0x35f5bf=a50_0x718729,_0x28b51=new Date(_0xecee72['createdAt'])[_0x35f5bf(0x35a)](),_0x1de6d3=_0xecee72[_0x35f5bf(0x2a4)]?new Date(_0xecee72[_0x35f5bf(0x2a4)])['getTime']():Date[_0x35f5bf(0x23b)](),_0x326579=_0x1de6d3-_0x28b51,_0x4dc623=[];for(const _0x3e47e1 of _0x5ac723){if(_0x3e47e1['startedAt']){const _0x2e1d0b=new Date(_0x3e47e1[_0x35f5bf(0x300)])['getTime'](),_0x551714=_0x3e47e1[_0x35f5bf(0x2d4)]?new Date(_0x3e47e1[_0x35f5bf(0x2d4)])[_0x35f5bf(0x35a)]():Date[_0x35f5bf(0x23b)]();_0x4dc623[_0x35f5bf(0x38d)]({'name':_0x3e47e1[_0x35f5bf(0x360)],'state':_0x3e47e1['state']||_0x35f5bf(0x33f),'window':{'start':_0x2e1d0b,'end':_0x551714,'duration':_0x551714-_0x2e1d0b}});}else _0x4dc623[_0x35f5bf(0x38d)]({'name':_0x3e47e1[_0x35f5bf(0x360)],'state':_0x3e47e1[_0x35f5bf(0x1f9)]||_0x35f5bf(0x347),'window':undefined});}const _0x3ac47e=calculateStats(_0x4dc623);return{'attempt':{'id':_0xecee72['id'],'status':_0xecee72[_0x35f5bf(0x221)]?_0xecee72[_0x35f5bf(0x24d)]?_0x35f5bf(0x24d):_0x35f5bf(0x25b):_0x35f5bf(0x261),'createdAt':_0xecee72[_0x35f5bf(0x2cc)],'finishedAt':_0xecee72['finishedAt'],'duration_ms':_0x326579},'tasks':_0x4dc623[_0x35f5bf(0x2cb)](_0x199c74=>({'name':_0x199c74[_0x35f5bf(0x37c)],'state':_0x199c74[_0x35f5bf(0x1f9)],'startedAt':_0x199c74[_0x35f5bf(0x2bd)]?new Date(_0x199c74[_0x35f5bf(0x2bd)]['start'])[_0x35f5bf(0x35d)]():null,'updatedAt':_0x199c74[_0x35f5bf(0x2bd)]?new Date(_0x199c74[_0x35f5bf(0x2bd)][_0x35f5bf(0x2b4)])['toISOString']():null,'duration_ms':_0x199c74[_0x35f5bf(0x2bd)]?.[_0x35f5bf(0x304)]||null})),'stats':_0x3ac47e};}}
1
+ const a50_0x36cf24=a50_0x2ead;(function(_0x27c026,_0x1096ec){const _0x12765e=a50_0x2ead,_0x326b5b=_0x27c026();while(!![]){try{const _0x222d5f=-parseInt(_0x12765e(0x268))/0x1+-parseInt(_0x12765e(0x30d))/0x2+-parseInt(_0x12765e(0x30b))/0x3*(-parseInt(_0x12765e(0x207))/0x4)+parseInt(_0x12765e(0x29d))/0x5*(parseInt(_0x12765e(0x379))/0x6)+-parseInt(_0x12765e(0x2a9))/0x7+-parseInt(_0x12765e(0x2ff))/0x8+parseInt(_0x12765e(0x31d))/0x9;if(_0x222d5f===_0x1096ec)break;else _0x326b5b['push'](_0x326b5b['shift']());}catch(_0x88de0e){_0x326b5b['push'](_0x326b5b['shift']());}}}(a50_0x4e3c,0x2b953));import a50_0x2262f3 from'chalk';import{existsSync}from'fs';import a50_0x426a1b from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';function a50_0x2ead(_0x388c8b,_0x253029){_0x388c8b=_0x388c8b-0x1f3;const _0x4e3cee=a50_0x4e3c();let _0x2eade9=_0x4e3cee[_0x388c8b];return _0x2eade9;}import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a50_0x42cef6 from'prompts';function getAttemptStatusDisplay(_0x5e1677){const _0x453344=a50_0x2ead;if(!_0x5e1677)return{'icon':'⏳','text':''};const {done:_0x170dcc,success:_0x195f11,cancelRequested:_0x15baa3}=_0x5e1677;if(!_0x170dcc)return _0x15baa3?{'icon':'🛑','text':a50_0x2262f3[_0x453344(0x2ed)](_0x453344(0x2bc))}:{'icon':'🔄','text':a50_0x2262f3[_0x453344(0x24f)](_0x453344(0x2ba))};if(_0x195f11)return{'icon':'✅','text':a50_0x2262f3['green'](_0x453344(0x226))};return{'icon':'❌','text':a50_0x2262f3[_0x453344(0x312)]('error')};}export class WorkflowBaseCommand extends BaseCommand{[a50_0x36cf24(0x361)](_0x253d2d,_0x57eb1e,_0x14ec2e=0x0){return _0x253d2d[_0x14ec2e]||_0x57eb1e['workflowProject'];}[a50_0x36cf24(0x26e)](_0x7349f4,_0x4ed50c,_0x3aa07d=0x0){const _0x235b7e=a50_0x36cf24,_0x59fea0=this['resolveProject'](_0x7349f4,_0x4ed50c,_0x3aa07d);if(!_0x59fea0)return console['error'](a50_0x2262f3[_0x235b7e(0x312)](_0x235b7e(0x219)),_0x235b7e(0x2df)),console['error'](a50_0x2262f3[_0x235b7e(0x329)](_0x235b7e(0x21f))),null;return _0x59fea0;}['parseProjectWorkflowPattern'](_0x4cff02,_0x1980c0){const _0x53adde=a50_0x36cf24;if(_0x4cff02[0x0]){const _0x3d687b=_0x4cff02[0x0]['split']('.');if(_0x3d687b[_0x53adde(0x272)]===0x1)return{'projectName':_0x3d687b[0x0],'workflowName':undefined};else return _0x3d687b['length']===0x2?{'projectName':_0x3d687b[0x0],'workflowName':_0x3d687b[0x1]}:(console[_0x53adde(0x26f)](a50_0x2262f3[_0x53adde(0x312)](_0x53adde(0x219)),_0x53adde(0x2e0)),null);}return{'projectName':_0x1980c0[_0x53adde(0x325)],'workflowName':undefined};}[a50_0x36cf24(0x1ff)](_0x5c981e,_0x315f24,_0x104860=0x0){const _0x5871e0=a50_0x36cf24;if(_0x5c981e[_0x104860])return _0x5c981e[_0x104860];if(_0x315f24[_0x5871e0(0x325)]){const _0x2c90bb=a50_0x426a1b[_0x5871e0(0x31f)](process[_0x5871e0(0x2d8)](),_0x5871e0(0x216),_0x315f24[_0x5871e0(0x325)]);if(existsSync(a50_0x426a1b[_0x5871e0(0x31f)](_0x2c90bb,'tdx.json')))return _0x2c90bb;}return undefined;}async['showWorkflowConsoleUrl'](_0x3a27b6,_0x53db66,_0x70b57c){const _0x6cc7d3=a50_0x36cf24;try{const _0x58c22d=await _0x3a27b6[_0x6cc7d3(0x29f)][_0x6cc7d3(0x216)](_0x53db66,{'limit':0x1});if(_0x58c22d[_0x6cc7d3(0x272)]>0x0){const _0x135fb0=_0x58c22d[0x0]['id'],_0x2320d6=getWorkflowUrl(_0x70b57c,_0x135fb0);console[_0x6cc7d3(0x26f)]('\x20\x20Console:\x20'+a50_0x2262f3[_0x6cc7d3(0x2b5)](_0x2320d6));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a50_0x36cf24(0x2d7)]=a50_0x36cf24(0x39c);[a50_0x36cf24(0x266)]=a50_0x36cf24(0x31a);async['execute'](_0x3d793f){const _0x1dcb86=a50_0x36cf24,{options:_0x4ded54,args:_0x1fb014,tdx:_0x5c2ea3}=_0x3d793f,_0x25f33e=_0x1fb014[0x0],_0x27b1b5=_0x4ded54[_0x1dcb86(0x2bd)];if(_0x27b1b5)return saveSessionContext({'workflow_project':undefined},_0x4ded54[_0x1dcb86(0x2e3)]),console['log'](a50_0x2262f3[_0x1dcb86(0x37f)](_0x1dcb86(0x371))),0x0;if(!_0x25f33e)return console[_0x1dcb86(0x26f)](a50_0x2262f3['red'](_0x1dcb86(0x219)),_0x1dcb86(0x2df)),console[_0x1dcb86(0x26f)](a50_0x2262f3[_0x1dcb86(0x329)](_0x1dcb86(0x363))),console[_0x1dcb86(0x26f)](a50_0x2262f3[_0x1dcb86(0x329)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x4e9f5b=await withSpinner('Resolving\x20project\x20\x27'+_0x25f33e+_0x1dcb86(0x396),()=>_0x5c2ea3[_0x1dcb86(0x29f)][_0x1dcb86(0x2e1)](_0x25f33e),{'verbose':_0x4ded54[_0x1dcb86(0x279)]}),{name:_0x4975fb}=_0x4e9f5b[_0x1dcb86(0x215)];return saveSessionContext({'workflow_project':_0x4975fb},_0x4ded54[_0x1dcb86(0x2e3)]),console[_0x1dcb86(0x35a)](a50_0x2262f3[_0x1dcb86(0x37f)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a50_0x2262f3[_0x1dcb86(0x2b5)](_0x4975fb))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a50_0x36cf24(0x2d7)]='workflow:projects';[a50_0x36cf24(0x266)]=a50_0x36cf24(0x28a);async[a50_0x36cf24(0x35f)](_0x50afa4){const _0x262594=a50_0x36cf24,{options:_0x4a282b,args:_0x2ab2ac,tdx:_0x559bec}=_0x50afa4,_0x32340a=_0x2ab2ac[0x0];_0x4a282b['verbose']&&_0x32340a&&console[_0x262594(0x26f)](_0x262594(0x2c5)+_0x32340a);const _0x58d538=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x559bec[_0x262594(0x29f)][_0x262594(0x293)](_0x32340a,{'limit':_0x4a282b['limit']}),{'verbose':_0x4a282b[_0x262594(0x279)]});let _0x14f284=_0x58d538['data'];_0x14f284['sort']((_0x5abf13,_0x2f786b)=>_0x5abf13['name']['localeCompare'](_0x2f786b[_0x262594(0x2d7)]));const _0x4557ff=_0x4a282b[_0x262594(0x297)]||0x64,_0x353384=_0x14f284['length']>=_0x4557ff?a50_0x2262f3['dim'](_0x262594(0x295)):'';console[_0x262594(0x26f)](_0x262594(0x21a)+_0x14f284['length']+_0x262594(0x288)+(_0x14f284['length']!==0x1?'s':'')+_0x353384);if(_0x4a282b['format']===_0x262594(0x280)||_0x4a282b['format']===_0x262594(0x235)||_0x4a282b[_0x262594(0x2fb)]===_0x262594(0x32b))await handleSDKOutput(_0x14f284,_0x4a282b);else{if(_0x14f284[_0x262594(0x272)]===0x0)_0x32340a?console[_0x262594(0x35a)](_0x262594(0x397)+_0x32340a):console[_0x262594(0x35a)](_0x262594(0x313));else{const _0x518372=_0x14f284[_0x262594(0x2e4)](_0x54a5ff=>{const _0x45d879=_0x262594,_0x445e22=_0x54a5ff[_0x45d879(0x38e)]?.[_0x45d879(0x385)](_0x202cb0=>_0x202cb0[_0x45d879(0x2db)]===_0x45d879(0x343)),_0x58582f=_0x445e22?a50_0x2262f3[_0x45d879(0x329)](_0x45d879(0x332)):'';return'📁\x20'+_0x54a5ff[_0x45d879(0x2d7)]+_0x58582f;});await writeOutput(_0x518372['join']('\x0a'),_0x4a282b[_0x262594(0x341)],_0x262594(0x339));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a50_0x36cf24(0x2d7)]=a50_0x36cf24(0x2b3);['description']='List\x20workflows';async['execute'](_0x1d49b3){const _0x21efcf=a50_0x36cf24,{options:_0x26b5a0,args:_0x47ddf5,tdx:_0x5df0b7}=_0x1d49b3,_0x14bd7f=this[_0x21efcf(0x361)](_0x47ddf5,_0x26b5a0);_0x26b5a0[_0x21efcf(0x279)]&&_0x14bd7f&&console[_0x21efcf(0x26f)](_0x21efcf(0x2fd)+_0x14bd7f);const _0x15e48a=await withSpinner(_0x21efcf(0x378),()=>_0x5df0b7['workflow'][_0x21efcf(0x216)](_0x14bd7f,{'limit':_0x26b5a0[_0x21efcf(0x297)]}),{'verbose':_0x26b5a0[_0x21efcf(0x279)]});let _0x597ff4=_0x15e48a[_0x21efcf(0x215)];_0x597ff4['sort']((_0x1c52b3,_0x204b37)=>{const _0x4fef58=_0x21efcf,_0x387865=_0x1c52b3[_0x4fef58(0x2d7)][_0x4fef58(0x2cd)](_0x204b37[_0x4fef58(0x2d7)]);if(_0x387865!==0x0)return _0x387865;return(_0x1c52b3[_0x4fef58(0x22b)]?.['name']||'')[_0x4fef58(0x2cd)](_0x204b37[_0x4fef58(0x22b)]?.[_0x4fef58(0x2d7)]||'');});const _0x22f229=_0x26b5a0[_0x21efcf(0x297)]||0x64,_0x880748=_0x597ff4[_0x21efcf(0x272)]>=_0x22f229?a50_0x2262f3[_0x21efcf(0x329)](_0x21efcf(0x295)):'';console['error'](_0x21efcf(0x21a)+_0x597ff4[_0x21efcf(0x272)]+'\x20workflow'+(_0x597ff4[_0x21efcf(0x272)]!==0x1?'s':'')+_0x880748);if(_0x26b5a0[_0x21efcf(0x2fb)]===_0x21efcf(0x280)||_0x26b5a0[_0x21efcf(0x2fb)]===_0x21efcf(0x235)||_0x26b5a0[_0x21efcf(0x2fb)]===_0x21efcf(0x32b))await handleSDKOutput(_0x597ff4,_0x26b5a0);else{if(_0x597ff4[_0x21efcf(0x272)]===0x0)_0x14bd7f?console[_0x21efcf(0x35a)]('No\x20workflows\x20found\x20in\x20project:\x20'+_0x14bd7f):console[_0x21efcf(0x35a)]('No\x20workflows\x20found');else{const _0x2fa1ff=_0x26b5a0[_0x21efcf(0x309)],_0x1512a7=_0x597ff4[_0x21efcf(0x2e4)](_0x1dcf57=>{const _0x11fc5f=_0x21efcf,_0xf38572=a50_0x2262f3[_0x11fc5f(0x329)]('#'+_0x1dcf57['id']),_0x3d9a35=hyperlink(_0xf38572,getWorkflowUrl(_0x2fa1ff,_0x1dcf57['id'])),_0x93ef9=_0x1dcf57[_0x11fc5f(0x22b)]?.[_0x11fc5f(0x2d7)]?a50_0x2262f3[_0x11fc5f(0x329)]('\x20('+_0x1dcf57[_0x11fc5f(0x22b)]['name']+')'):'';return _0x11fc5f(0x238)+_0x3d9a35+'\x20'+_0x1dcf57[_0x11fc5f(0x2d7)]+_0x93ef9;});await writeOutput(_0x1512a7[_0x21efcf(0x31f)]('\x0a'),_0x26b5a0[_0x21efcf(0x341)],_0x21efcf(0x339));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']=a50_0x36cf24(0x23f);[a50_0x36cf24(0x266)]=a50_0x36cf24(0x2be);async[a50_0x36cf24(0x35f)](_0x40d9fd){const _0x44ad17=a50_0x36cf24,{options:_0x4bdd20,args:_0x594e65,tdx:_0x20d614}=_0x40d9fd,_0x4ed671=this['parseProjectWorkflowPattern'](_0x594e65,_0x4bdd20);if(!_0x4ed671)return 0x1;const {projectName:_0x59f012,workflowName:_0x35c53e}=_0x4ed671;if(_0x4bdd20[_0x44ad17(0x279)]){if(_0x59f012&&_0x35c53e)console[_0x44ad17(0x26f)](_0x44ad17(0x37e)+_0x59f012+'.'+_0x35c53e);else _0x59f012&&console['error'](_0x44ad17(0x326)+_0x59f012);const _0x633f7f=_0x4bdd20[_0x44ad17(0x202)];_0x633f7f&&console[_0x44ad17(0x26f)]('Status:\x20'+_0x633f7f);}let _0x17cbdb=0x28;if(process[_0x44ad17(0x333)][_0x44ad17(0x351)]&&!_0x4bdd20[_0x44ad17(0x341)]&&!_0x4bdd20[_0x44ad17(0x2fb)]){const _0xf81a0d=process[_0x44ad17(0x333)][_0x44ad17(0x2ee)]||0x28;_0x17cbdb=Math[_0x44ad17(0x23d)](0x14,Math[_0x44ad17(0x287)](_0xf81a0d*0x2/0x3));}const _0x19de4f=_0x4bdd20['limit']||_0x17cbdb,_0x5c164f=await withSpinner(_0x44ad17(0x224),()=>_0x20d614[_0x44ad17(0x29f)]['sessions']({'projectName':_0x59f012,'workflowName':_0x35c53e,'status':_0x4bdd20[_0x44ad17(0x202)],'fromTime':_0x4bdd20['from'],'toTime':_0x4bdd20['to'],'limit':_0x19de4f}),{'verbose':_0x4bdd20[_0x44ad17(0x279)]}),_0xf10d17=_0x5c164f[_0x44ad17(0x215)];_0xf10d17[_0x44ad17(0x22a)]((_0x2a4bbf,_0x437226)=>{const _0x3e99b4=_0x44ad17,_0x1d0cef=_0x2a4bbf[_0x3e99b4(0x296)]||'',_0x4d4167=_0x437226[_0x3e99b4(0x296)]||'';return _0x4d4167[_0x3e99b4(0x2cd)](_0x1d0cef);});_0xf10d17['length']>=_0x19de4f?console[_0x44ad17(0x26f)]('✔\x20Showing\x20'+_0xf10d17[_0x44ad17(0x272)]+_0x44ad17(0x31c)+a50_0x2262f3[_0x44ad17(0x329)](_0x44ad17(0x36f))):console[_0x44ad17(0x26f)](_0x44ad17(0x21a)+_0xf10d17[_0x44ad17(0x272)]+_0x44ad17(0x239)+(_0xf10d17[_0x44ad17(0x272)]!==0x1?'s':''));if(_0x4bdd20[_0x44ad17(0x2fb)]===_0x44ad17(0x280)||_0x4bdd20['format']==='jsonl'||_0x4bdd20['format']===_0x44ad17(0x32b))await handleSDKOutput(_0xf10d17,_0x4bdd20);else{if(!process['stdout']['isTTY']||_0x4bdd20[_0x44ad17(0x341)]){if(_0xf10d17['length']===0x0){if(_0x59f012&&_0x35c53e)console[_0x44ad17(0x35a)](_0x44ad17(0x320)+_0x59f012+'.'+_0x35c53e);else _0x59f012?console['log'](_0x44ad17(0x38a)+_0x59f012):console[_0x44ad17(0x35a)](_0x44ad17(0x29b));}else{const _0x4132fd=_0x4bdd20['site'],_0x41d334=this['renderSessionsTimeline'](_0xf10d17,_0x4132fd);_0x4bdd20[_0x44ad17(0x341)]?await writeOutput(_0x41d334,_0x4bdd20[_0x44ad17(0x341)],'list'):console[_0x44ad17(0x35a)](_0x41d334);}!_0x59f012&&(console[_0x44ad17(0x26f)](''),console[_0x44ad17(0x26f)](a50_0x2262f3[_0x44ad17(0x329)](_0x44ad17(0x285))),console[_0x44ad17(0x26f)](a50_0x2262f3[_0x44ad17(0x329)](_0x44ad17(0x2af))+'or'+a50_0x2262f3[_0x44ad17(0x329)](_0x44ad17(0x262))));}else{if(_0xf10d17[_0x44ad17(0x272)]===0x0){if(_0x59f012&&_0x35c53e)console[_0x44ad17(0x35a)](_0x44ad17(0x320)+_0x59f012+'.'+_0x35c53e);else _0x59f012?console[_0x44ad17(0x35a)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x59f012):console[_0x44ad17(0x35a)]('No\x20sessions\x20found');}else await this[_0x44ad17(0x338)](_0xf10d17,_0x40d9fd,_0x59f012);}}return 0x0;}[a50_0x36cf24(0x24a)](_0x17a70d,_0x4d3081){const _0x2b7172=a50_0x36cf24,_0x59d2b1=[],_0x317264=new Map();let _0x3b91e2=Infinity,_0x591df7=-Infinity;for(const _0x484537 of _0x17a70d){if(_0x484537[_0x2b7172(0x342)]?.[_0x2b7172(0x2d2)]){const _0x1dae01=new Date(_0x484537[_0x2b7172(0x342)][_0x2b7172(0x2d2)])[_0x2b7172(0x34f)](),_0x1a1d16=_0x484537['lastAttempt'][_0x2b7172(0x383)]?new Date(_0x484537[_0x2b7172(0x342)][_0x2b7172(0x383)])['getTime']():Date['now'](),_0x216de5=_0x484537[_0x2b7172(0x22b)]?.[_0x2b7172(0x2d7)]||_0x2b7172(0x26b);!_0x317264[_0x2b7172(0x2e9)](_0x216de5)&&_0x317264[_0x2b7172(0x247)](_0x216de5,[]),_0x317264[_0x2b7172(0x381)](_0x216de5)[_0x2b7172(0x386)]({'session':_0x484537,'startTime':_0x1dae01,'endTime':_0x1a1d16,'duration':_0x1a1d16-_0x1dae01}),_0x3b91e2=Math[_0x2b7172(0x244)](_0x3b91e2,_0x1dae01),_0x591df7=Math[_0x2b7172(0x23d)](_0x591df7,_0x1a1d16);}}if(_0x317264['size']===0x0)return _0x2b7172(0x1f9);const _0x33d451=process['stdout']['columns']||0x78,_0x3eddfe=0x1e,_0x7c3e73=0x32,_0x126069=0x4,_0x25eea0=Math['min'](_0x7c3e73,Math['max'](_0x3eddfe,Math[_0x2b7172(0x287)](_0x33d451*0.3))),_0x16b5eb=_0x33d451-_0x25eea0-TIMELINE_CONFIG[_0x2b7172(0x382)]-0x3-_0x126069,_0x25cd79=_0x591df7-_0x3b91e2,_0x1c1b74=_0x25cd79/_0x25eea0,_0x2d2729=renderTimeAxis({'startTime':_0x3b91e2,'endTime':_0x591df7,'durationMs':_0x25cd79,'msPerChar':_0x1c1b74},_0x25eea0),_0x3b3c0c=[];for(const _0x1e5efd of _0x317264[_0x2b7172(0x1fc)]()){_0x3b3c0c[_0x2b7172(0x386)](..._0x1e5efd);}_0x3b3c0c[_0x2b7172(0x22a)]((_0x5f47b6,_0x1f790a)=>_0x1f790a[_0x2b7172(0x26d)]-_0x5f47b6['startTime']);const _0x444c96=new Date(_0x3b91e2),_0x10e506=formatDate(_0x444c96),_0x501b2a=_0x126069+TIMELINE_CONFIG[_0x2b7172(0x220)]+TIMELINE_CONFIG[_0x2b7172(0x35b)]+_0x16b5eb,_0x58fea6='\x20'[_0x2b7172(0x21d)](_0x501b2a-_0x10e506['length']),_0x57900e=_0x58fea6+a50_0x2262f3[_0x2b7172(0x329)](_0x10e506)+'\x20'+_0x2d2729;_0x59d2b1['push'](_0x57900e);const _0x118c32=0x16;let _0x4b3113=0x0;for(const _0x4682ee of _0x3b3c0c){const _0x4b13a0=_0x4682ee[_0x2b7172(0x2e3)][_0x2b7172(0x22b)]?.[_0x2b7172(0x2d7)]||'?',_0x38950a=Math[_0x2b7172(0x244)](stringWidth(_0x4b13a0),_0x118c32);_0x4b3113=Math[_0x2b7172(0x23d)](_0x4b3113,_0x38950a);}for(const _0x14d9a0 of _0x3b3c0c){const {session:_0x1d8163,startTime:_0x1b1213,endTime:_0x4bbd67,duration:_0x1dba6d}=_0x14d9a0,_0x319a37=_0x1d8163[_0x2b7172(0x22b)]?.['id'],_0x5b9994=_0x1d8163['id'],_0x3957be=_0x1d8163['project']?.[_0x2b7172(0x2d7)]||'?',_0x173b77=_0x1d8163[_0x2b7172(0x29f)]?.[_0x2b7172(0x2d7)]||'?';let _0x2a11ec,_0xedea3c;if(_0x1d8163['lastAttempt']){const _0x1445a1=_0x1d8163['lastAttempt'];!_0x1445a1[_0x2b7172(0x22f)]?(_0x2a11ec=_0x1445a1[_0x2b7172(0x324)]?'🛑':'🔄',_0xedea3c=_0x1445a1[_0x2b7172(0x324)]?a50_0x2262f3[_0x2b7172(0x2ed)]:a50_0x2262f3[_0x2b7172(0x24f)]):(_0x2a11ec=_0x1445a1['success']?'✅':'❌',_0xedea3c=_0x1445a1['success']?a50_0x2262f3['green']:a50_0x2262f3[_0x2b7172(0x312)]);}else _0x2a11ec='⏳',_0xedea3c=a50_0x2262f3['dim'];const _0x1927b7='#'+_0x5b9994,_0x5a8091=_0x319a37?hyperlink(_0x1927b7,getWorkflowSessionUrl(_0x4d3081,_0x319a37,_0x5b9994)):_0x1927b7;let _0x1fbc50=_0x3957be;stringWidth(_0x3957be)>_0x118c32&&(_0x1fbc50=_0x3957be[_0x2b7172(0x306)](0x0,_0x118c32-0x1)+'…');const _0xf50b75=a50_0x2262f3['dim'](_0x1fbc50),_0x383b3c=stringWidth(_0x1fbc50),_0x1ee4ba='\x20'['repeat'](_0x4b3113-stringWidth(_0x1fbc50)+0x2),_0x681822='('+formatElapsed(_0x1dba6d)+')',_0x5a2b48=stringWidth(_0x681822),_0x294692=stringWidth(_0x1927b7),_0xc038aa=_0x294692+0x1+_0x383b3c+_0x1ee4ba[_0x2b7172(0x272)],_0x24122c=_0x16b5eb-_0xc038aa-_0x5a2b48-0x1-0x8;let _0xf70d1a=_0x173b77;stringWidth(_0xf70d1a)>_0x24122c&&(_0xf70d1a=_0xf70d1a[_0x2b7172(0x306)](0x0,_0x24122c-0x1)+'…');const _0x7e172d=_0x5a8091+'\x20'+_0xf50b75+_0x1ee4ba+_0xf70d1a,_0x18ff0e=stringWidth(_0x7e172d),_0x595363=_0x16b5eb-_0x18ff0e-_0x5a2b48,_0x1b2b0c=_0x7e172d+'\x20'[_0x2b7172(0x21d)](Math[_0x2b7172(0x23d)](0x1,_0x595363))+a50_0x2262f3['dim'](_0x681822),_0x109337=Math[_0x2b7172(0x287)]((_0x1b1213-_0x3b91e2)/_0x1c1b74),_0x5aacde=Math[_0x2b7172(0x287)]((_0x4bbd67-_0x3b91e2)/_0x1c1b74),_0x557316=Math[_0x2b7172(0x23d)](_0x109337+0x1,_0x5aacde),_0xd0f096=new Array(_0x25eea0)[_0x2b7172(0x2fe)]('\x20');for(let _0x3e0692=_0x109337;_0x3e0692<Math[_0x2b7172(0x244)](_0x557316,_0x25eea0);_0x3e0692++){_0xd0f096[_0x3e0692]='─';}const _0x2865e1=_0xd0f096['map'](_0x34c30a=>_0x34c30a==='\x20'?'\x20':_0xedea3c(_0x34c30a))[_0x2b7172(0x31f)]('');_0x59d2b1[_0x2b7172(0x386)](_0x2a11ec+'\x20'+_0x1b2b0c+'│'+_0x2865e1+'│');}return _0x59d2b1[_0x2b7172(0x31f)]('\x0a');}async[a50_0x36cf24(0x338)](_0x54cf62,_0x34ac50,_0x5524f1){const _0x58c712=a50_0x36cf24,{options:_0xac3888,tdx:_0x34bf8}=_0x34ac50,_0x586069=_0xac3888['site'],{timelineRows:_0x22378b,timeAxisHeader:_0x5e6f7c}=this['generateSessionTimelineRows'](_0x54cf62,_0x586069),_0x5786a8=_0x22378b[_0x58c712(0x374)](_0xd301a3=>_0xd301a3[_0x58c712(0x203)]);if(_0x5786a8[_0x58c712(0x272)]===0x0){const _0x12b78f=this['renderSessionsTimeline'](_0x54cf62,_0x586069);console[_0x58c712(0x35a)](_0x12b78f);!_0x5524f1&&(console[_0x58c712(0x26f)](''),console[_0x58c712(0x26f)](a50_0x2262f3[_0x58c712(0x329)](_0x58c712(0x285))),console[_0x58c712(0x26f)](a50_0x2262f3['dim']('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a50_0x2262f3['dim'](_0x58c712(0x262))));return;}_0x5e6f7c&&console[_0x58c712(0x35a)](_0x5e6f7c);const _0x863605=_0x22378b[_0x58c712(0x374)](_0x1af08b=>_0x1af08b[_0x58c712(0x203)])[_0x58c712(0x2e4)](_0x505d9d=>({'title':_0x505d9d[_0x58c712(0x335)],'value':_0x505d9d[_0x58c712(0x203)]})),_0x19ecd8=process['stdout'][_0x58c712(0x2ee)]||0x3c,_0x4b1ea8=Math[_0x58c712(0x23d)](0x28,Math[_0x58c712(0x287)](_0x19ecd8*0x2/0x3)),_0x214bcc=await a50_0x42cef6({'type':_0x58c712(0x367),'name':_0x58c712(0x203),'message':_0x58c712(0x1fa),'choices':_0x863605,'initial':-0x1,'limit':_0x4b1ea8,'clearFirst':!![],'fallback':{'title':_0x58c712(0x33d),'value':null},'suggest':(_0xb80b0e,_0x7d12ec)=>{const _0x5b1002=_0x58c712;if(!_0xb80b0e)return Promise['resolve'](_0x7d12ec);const _0x41b8d2=_0x7d12ec[_0x5b1002(0x374)](_0x4ec9cb=>{const _0x26a1fd=_0x5b1002,_0x819e3b=_0x4ec9cb;return _0x819e3b[_0x26a1fd(0x350)][_0x26a1fd(0x223)]()[_0x26a1fd(0x32f)](_0xb80b0e['toLowerCase']());});return Promise[_0x5b1002(0x252)](_0x41b8d2);}}),_0x2e3107=()=>{const _0x20f3e6=_0x58c712;process[_0x20f3e6(0x333)][_0x20f3e6(0x300)](_0x20f3e6(0x231)),process[_0x20f3e6(0x333)][_0x20f3e6(0x300)](_0x20f3e6(0x231)),process[_0x20f3e6(0x333)][_0x20f3e6(0x300)](_0x20f3e6(0x231));},_0x234521=_0x214bcc&&_0x214bcc[_0x58c712(0x203)]&&_0x214bcc[_0x58c712(0x203)]!==null&&_0x214bcc[_0x58c712(0x203)]['trim']()!=='';if(!_0x234521){_0x2e3107(),console[_0x58c712(0x35a)](a50_0x2262f3['dim'](_0x58c712(0x315)));return;}_0x2e3107();const _0x37bce5=_0x54cf62[_0x58c712(0x2ce)](_0x2cc7d2=>_0x2cc7d2[_0x58c712(0x342)]?.['id']===_0x214bcc[_0x58c712(0x203)]);if(_0x37bce5){const _0x36ccc2=_0x37bce5[_0x58c712(0x22b)]?.[_0x58c712(0x2d7)]||'?',_0x24a8fd=_0x37bce5[_0x58c712(0x29f)]?.[_0x58c712(0x2d7)]||'?';console[_0x58c712(0x35a)](_0x58c712(0x27c)+a50_0x2262f3['dim'](_0x36ccc2)+_0x58c712(0x364)+a50_0x2262f3[_0x58c712(0x329)](_0x24a8fd));}const _0x3a030e=new WorkflowTimelineCommand();await _0x3a030e['execute']({'args':[],'options':{..._0xac3888,'attemptId':_0x214bcc[_0x58c712(0x203)]},'tdx':_0x34bf8});}[a50_0x36cf24(0x1f5)](_0x5ad8f2,_0xd8397c){const _0x4a04ed=a50_0x36cf24,_0x392270=new Map();for(const _0x2a4dba of _0x5ad8f2){_0x2a4dba['id']&&_0x2a4dba[_0x4a04ed(0x342)]?.['id']&&_0x392270[_0x4a04ed(0x247)](_0x2a4dba['id'],_0x2a4dba[_0x4a04ed(0x342)]['id']);}const _0x1b810a=[];let _0x520f95='';const _0x5f05fc=this[_0x4a04ed(0x24a)](_0x5ad8f2,_0xd8397c),_0x19ca24=_0x5f05fc['split']('\x0a');for(const _0x1b4bd0 of _0x19ca24){if(_0x1b4bd0[_0x4a04ed(0x32d)](_0x4a04ed(0x37a))||_0x1b4bd0[_0x4a04ed(0x290)](/^\s+\d{4}-\d{2}-\d{2}/))_0x520f95=_0x1b4bd0;else{if(_0x1b4bd0[_0x4a04ed(0x290)](/^[✅❌🔄🛑⏳]/)){const _0x1ecf14=_0x1b4bd0[_0x4a04ed(0x290)](/#(\d+)/),_0x3d4f98=_0x1ecf14?_0x1ecf14[0x1]:null,_0x5bb402=_0x3d4f98?_0x392270[_0x4a04ed(0x381)](_0x3d4f98)||null:null,_0x32cdaf=_0x5ad8f2[_0x4a04ed(0x2ce)](_0x5e544c=>_0x5e544c['id']===_0x3d4f98),_0x52e4d1=_0x32cdaf?.['project']?.[_0x4a04ed(0x2d7)]||'';_0x1b810a[_0x4a04ed(0x386)]({'displayLine':_0x1b4bd0,'attemptId':_0x5bb402,'projectName':_0x52e4d1});}}}return{'timelineRows':_0x1b810a,'timeAxisHeader':_0x520f95};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a50_0x36cf24(0x2d7)]=a50_0x36cf24(0x2d1);[a50_0x36cf24(0x266)]=a50_0x36cf24(0x211);async['execute'](_0x3b48b0){const _0x3c5b3e=a50_0x36cf24,{options:_0x4b1051,args:_0x18eed9,tdx:_0x5bb37c}=_0x3b48b0,_0x4191a1=this[_0x3c5b3e(0x246)](_0x18eed9,_0x4b1051);if(!_0x4191a1)return 0x1;const {projectName:_0x53ca2a,workflowName:_0x2784e1}=_0x4191a1,_0x2b2de9=_0x4b1051[_0x3c5b3e(0x30a)];if(_0x4b1051['verbose']){if(_0x53ca2a&&_0x2784e1)console[_0x3c5b3e(0x26f)](_0x3c5b3e(0x37e)+_0x53ca2a+'.'+_0x2784e1);else _0x53ca2a&&console[_0x3c5b3e(0x26f)](_0x3c5b3e(0x326)+_0x53ca2a);_0x2b2de9&&console[_0x3c5b3e(0x26f)](_0x3c5b3e(0x2dc));}const _0x57e7e1=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x5bb37c['workflow'][_0x3c5b3e(0x398)]({'projectName':_0x53ca2a,'workflowName':_0x2784e1,'includeRetried':_0x2b2de9,'limit':_0x4b1051[_0x3c5b3e(0x297)]}),{'verbose':_0x4b1051['verbose']}),_0x2a1261=_0x57e7e1[_0x3c5b3e(0x215)],_0x3f48da=_0x4b1051[_0x3c5b3e(0x297)]||0x64,_0x4b06d0=_0x2a1261[_0x3c5b3e(0x272)]>=_0x3f48da?a50_0x2262f3[_0x3c5b3e(0x329)](_0x3c5b3e(0x295)):'';console[_0x3c5b3e(0x26f)](_0x3c5b3e(0x21a)+_0x2a1261[_0x3c5b3e(0x272)]+'\x20attempt'+(_0x2a1261[_0x3c5b3e(0x272)]!==0x1?'s':'')+_0x4b06d0);if(_0x4b1051[_0x3c5b3e(0x2fb)]===_0x3c5b3e(0x280)||_0x4b1051[_0x3c5b3e(0x2fb)]===_0x3c5b3e(0x235)||_0x4b1051[_0x3c5b3e(0x2fb)]===_0x3c5b3e(0x32b))await handleSDKOutput(_0x2a1261,_0x4b1051);else{if(_0x2a1261[_0x3c5b3e(0x272)]===0x0){if(_0x53ca2a&&_0x2784e1)console[_0x3c5b3e(0x35a)](_0x3c5b3e(0x254)+_0x53ca2a+'.'+_0x2784e1);else _0x53ca2a?console[_0x3c5b3e(0x35a)](_0x3c5b3e(0x2ec)+_0x53ca2a):console['log'](_0x3c5b3e(0x281));}else{const _0x37a713=_0x4b1051['site'],_0x5d3b6e=_0x2a1261[_0x3c5b3e(0x2e4)](_0x59865d=>{const _0x496539=_0x3c5b3e,_0x1a3202=a50_0x2262f3['dim']('#'+_0x59865d['id']),_0x3f48e9=_0x59865d[_0x496539(0x22b)]?.['id'],_0x5dfa84=_0x59865d[_0x496539(0x277)]||_0x59865d[_0x496539(0x37b)],_0x37af41=_0x3f48e9&&_0x5dfa84?hyperlink(_0x1a3202,getWorkflowAttemptUrl(_0x37a713,_0x3f48e9,_0x5dfa84,_0x59865d['id'])):_0x1a3202,{icon:_0x25c4af,text:_0x33991b}=getAttemptStatusDisplay(_0x59865d),_0x3c0b8f=(_0x59865d[_0x496539(0x22b)]?.[_0x496539(0x2d7)]||'?')+'.'+(_0x59865d[_0x496539(0x29f)]?.[_0x496539(0x2d7)]||'?'),_0x453d54=_0x59865d['sessionTime']?a50_0x2262f3[_0x496539(0x329)](_0x59865d[_0x496539(0x296)]):'';return(_0x37af41+'\x20'+_0x25c4af+(_0x33991b?'\x20'+_0x33991b:'')+'\x20'+_0x3c0b8f+'\x20'+_0x453d54)[_0x496539(0x25c)]();});await writeOutput(_0x5d3b6e['join']('\x0a'),_0x4b1051[_0x3c5b3e(0x341)],_0x3c5b3e(0x339));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a50_0x36cf24(0x2d7)]='workflow:attempt';[a50_0x36cf24(0x266)]=a50_0x36cf24(0x261);async[a50_0x36cf24(0x35f)](_0x34766e){const _0x135029=a50_0x36cf24,{options:_0x2250b3,args:_0x4e4fe2,tdx:_0x261973}=_0x34766e,_0x43d20a=_0x4e4fe2[0x0];if(!_0x43d20a)return console['error'](_0x135029(0x2e2)),0x1;_0x2250b3['verbose']&&console['error'](_0x135029(0x2de)+_0x43d20a);const _0xfa25a=await withSpinner(_0x135029(0x284),()=>_0x261973['workflow'][_0x135029(0x2a3)](_0x43d20a),{'verbose':_0x2250b3[_0x135029(0x279)]}),_0x1f1f9a=_0xfa25a[_0x135029(0x215)];let _0x1cd9f6;!_0x1f1f9a[_0x135029(0x22f)]?_0x1cd9f6=_0x1f1f9a[_0x135029(0x324)]?'canceling':'running':_0x1cd9f6=_0x1f1f9a[_0x135029(0x226)]?_0x135029(0x226):_0x135029(0x26f);let _0x29a03d;if(_0x1f1f9a['createdAt']&&_0x1f1f9a[_0x135029(0x383)]){const _0xf86048=new Date(_0x1f1f9a[_0x135029(0x2d2)])[_0x135029(0x34f)](),_0x25f6a1=new Date(_0x1f1f9a[_0x135029(0x383)])[_0x135029(0x34f)]();_0x29a03d=Math[_0x135029(0x2b8)]((_0x25f6a1-_0xf86048)/0x3e8);}const _0xb9f22f={'attempt_id':_0x1f1f9a['id'],'status':_0x1cd9f6,..._0x1f1f9a[_0x135029(0x376)]!==undefined&&{'index':_0x1f1f9a[_0x135029(0x376)]},..._0x1f1f9a[_0x135029(0x22b)]&&{'project':_0x1f1f9a[_0x135029(0x22b)][_0x135029(0x2d7)]},..._0x1f1f9a['workflow']&&{'workflow':_0x1f1f9a[_0x135029(0x29f)][_0x135029(0x2d7)]},..._0x1f1f9a[_0x135029(0x37b)]&&{'session_id':_0x1f1f9a[_0x135029(0x37b)]},..._0x1f1f9a['sessionTime']&&{'session_time':_0x1f1f9a[_0x135029(0x296)]},..._0x1f1f9a[_0x135029(0x37c)]&&{'retry_attempt':_0x1f1f9a[_0x135029(0x37c)]},..._0x29a03d!==undefined&&{'duration_sec':_0x29a03d},..._0x1f1f9a['createdAt']&&{'created_at':_0x1f1f9a[_0x135029(0x2d2)]},..._0x1f1f9a[_0x135029(0x383)]&&{'finished_at':_0x1f1f9a[_0x135029(0x383)]},...Object['keys'](_0x1f1f9a[_0x135029(0x1f7)])[_0x135029(0x272)]>0x0&&{'params':_0x1f1f9a[_0x135029(0x1f7)]}};return await handleSingleObjectOutput(_0xb9f22f,_0x2250b3),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a50_0x36cf24(0x20f);['description']=a50_0x36cf24(0x314);async[a50_0x36cf24(0x35f)](_0x1887c8){const _0x4c3c0d=a50_0x36cf24,{options:_0x4a8cfa,args:_0x4a8822,tdx:_0x5c4287}=_0x1887c8,_0x363d1d=_0x4a8822[0x0];if(!_0x363d1d)return console[_0x4c3c0d(0x26f)](_0x4c3c0d(0x2e2)),0x1;const _0x5715e8=_0x4a8cfa[_0x4c3c0d(0x331)];_0x4a8cfa[_0x4c3c0d(0x279)]&&(console[_0x4c3c0d(0x26f)](_0x4c3c0d(0x2de)+_0x363d1d),_0x5715e8&&console['error'](_0x4c3c0d(0x2e5)));const _0x4d920f=await withSpinner(_0x4c3c0d(0x27b),()=>_0x5c4287[_0x4c3c0d(0x29f)][_0x4c3c0d(0x274)](_0x363d1d,_0x5715e8||![]),{'verbose':_0x4a8cfa['verbose']}),_0x244976=_0x4d920f[_0x4c3c0d(0x215)];return console['error'](_0x4c3c0d(0x21a)+_0x244976['length']+_0x4c3c0d(0x377)+(_0x244976['length']!==0x1?'s':'')),await handleSDKOutput(_0x244976,_0x4a8cfa),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a50_0x36cf24(0x2d7)]=a50_0x36cf24(0x33f);['description']=a50_0x36cf24(0x24b);async['execute'](_0x5ec632){const _0x2d8d22=a50_0x36cf24,{options:_0x29b2be,args:_0x14ebd9,tdx:_0x324712}=_0x5ec632,_0x29d95c=_0x14ebd9[0x0];let _0x28a3aa=_0x14ebd9[0x1];if(!_0x29d95c)return console[_0x2d8d22(0x26f)](_0x2d8d22(0x2e2)),0x1;_0x29b2be[_0x2d8d22(0x279)]&&(console[_0x2d8d22(0x26f)](_0x2d8d22(0x2de)+_0x29d95c),_0x28a3aa&&console[_0x2d8d22(0x26f)](_0x2d8d22(0x28e)+_0x28a3aa));const _0x3e5c29=await withSpinner(_0x2d8d22(0x2a7),()=>_0x324712[_0x2d8d22(0x29f)][_0x2d8d22(0x348)](_0x29d95c,_0x28a3aa),{'verbose':_0x29b2be[_0x2d8d22(0x279)]}),_0x35dd01=_0x3e5c29[_0x2d8d22(0x215)];if(_0x35dd01[_0x2d8d22(0x272)]===0x0)return console[_0x2d8d22(0x26f)](_0x2d8d22(0x36a)),0x0;if(!_0x28a3aa&&(_0x29b2be[_0x2d8d22(0x280)]||_0x29b2be[_0x2d8d22(0x2fb)]))return await handleSDKOutput(_0x35dd01,_0x29b2be),0x0;if(!_0x28a3aa){const _0x52e31e=_0x35dd01[_0x2d8d22(0x2e4)](_0xe13dbb=>({'title':_0xe13dbb[_0x2d8d22(0x34b)]+'\x20('+formatBytes(_0xe13dbb[_0x2d8d22(0x317)])+')','value':_0xe13dbb[_0x2d8d22(0x34b)]})),_0x3d41c4=await a50_0x42cef6({'type':'select','name':_0x2d8d22(0x32e),'message':_0x2d8d22(0x2a8),'choices':_0x52e31e});if(!_0x3d41c4['task'])return console['error'](_0x2d8d22(0x315)),0x0;_0x28a3aa=_0x3d41c4[_0x2d8d22(0x32e)];}const _0x365e57=await withSpinner(_0x2d8d22(0x286),()=>_0x324712['workflow'][_0x2d8d22(0x2d0)](_0x29d95c,_0x28a3aa),{'verbose':_0x29b2be['verbose']}),_0x2157ef=_0x365e57['data'];return _0x2157ef?console[_0x2d8d22(0x35a)](_0x2157ef):console[_0x2d8d22(0x26f)](_0x2d8d22(0x2c2)),0x0;}}export class WorkflowKillCommand extends BaseCommand{['name']=a50_0x36cf24(0x2c3);['description']=a50_0x36cf24(0x24e);async[a50_0x36cf24(0x35f)](_0x1fb829){const _0x280c8e=a50_0x36cf24,{options:_0x28eb55,args:_0xe87eb3,tdx:_0x530ce9}=_0x1fb829,_0x5f55d6=_0xe87eb3[0x0];if(!_0x5f55d6)return console[_0x280c8e(0x26f)](_0x280c8e(0x2e2)),0x1;const _0xb27ec6=_0x28eb55[_0x280c8e(0x25b)];_0x28eb55[_0x280c8e(0x279)]&&(console['error'](_0x280c8e(0x2de)+_0x5f55d6),_0xb27ec6&&console[_0x280c8e(0x26f)](_0x280c8e(0x2d3)+_0xb27ec6));if(!_0x28eb55[_0x280c8e(0x292)]){if(!isInteractive())return console[_0x280c8e(0x26f)](a50_0x2262f3[_0x280c8e(0x312)]('\x0aError:'),_0x280c8e(0x25d)),console[_0x280c8e(0x26f)](a50_0x2262f3[_0x280c8e(0x329)](_0x280c8e(0x237))),0x1;const _0x341d20=await confirmKey(_0x280c8e(0x2f3)+_0x5f55d6+'?');if(!_0x341d20)return console[_0x280c8e(0x26f)](a50_0x2262f3[_0x280c8e(0x2ed)](_0x280c8e(0x315))),0x1;}const _0x56b183=await withSpinner(_0x280c8e(0x210),()=>_0x530ce9['workflow'][_0x280c8e(0x2f0)](_0x5f55d6,_0xb27ec6),{'verbose':_0x28eb55[_0x280c8e(0x279)]}),_0x5b4e61=_0x56b183['data'];return console[_0x280c8e(0x26f)]('✔\x20'+_0x5b4e61),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']='workflow:retry';[a50_0x36cf24(0x266)]='Retry\x20a\x20session\x20or\x20attempt';async[a50_0x36cf24(0x35f)](_0x215a29){const _0x208774=a50_0x36cf24,{options:_0x5673d4,args:_0x5f0c66,tdx:_0x50c8a5}=_0x215a29,_0x388f73=_0x5f0c66[0x0];if(!_0x388f73)return console[_0x208774(0x26f)](_0x208774(0x304)),console[_0x208774(0x26f)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x137e55=![],_0x53e84b=_0x388f73;if(_0x388f73[_0x208774(0x32d)](_0x208774(0x2b4)))_0x137e55=!![],_0x53e84b=_0x388f73[_0x208774(0x24c)](0x8);else{if(_0x388f73[_0x208774(0x32d)](_0x208774(0x2da)))_0x137e55=![],_0x53e84b=_0x388f73[_0x208774(0x24c)](0x8);else return console[_0x208774(0x26f)](_0x208774(0x2ae)),console[_0x208774(0x26f)](_0x208774(0x38d)),0x1;}const _0x53d55f=_0x5673d4[_0x208774(0x201)],_0x46f886=_0x5673d4[_0x208774(0x384)],_0x251d89=_0x5673d4['params'],_0x398e3e=_0x5673d4['force'];_0x5673d4['verbose']&&(console['error'](_0x208774(0x380)+(_0x137e55?_0x208774(0x2e3):_0x208774(0x2a3))+'\x20'+_0x53e84b),_0x53d55f&&console['error'](_0x208774(0x34a)+_0x53d55f),_0x46f886&&console['error'](_0x208774(0x241)+_0x46f886),_0x251d89&&console['error']('Params:\x20'+_0x251d89),_0x398e3e&&console[_0x208774(0x26f)](_0x208774(0x2b2)));let _0x4d7205;if(_0x251d89)try{if(_0x251d89['startsWith']('@')){const _0xca19c7=await import(_0x208774(0x334)),_0x21cb4c=_0x251d89[_0x208774(0x24c)](0x1),_0x2d0926=await _0xca19c7['readFile'](_0x21cb4c,'utf-8');_0x4d7205=JSON[_0x208774(0x365)](_0x2d0926);}else _0x4d7205=JSON[_0x208774(0x365)](_0x251d89);}catch{return console[_0x208774(0x26f)](_0x208774(0x38c)),0x1;}if(!_0x5673d4[_0x208774(0x292)]){if(!isInteractive())return console['error'](a50_0x2262f3[_0x208774(0x312)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x208774(0x26f)](a50_0x2262f3[_0x208774(0x329)](_0x208774(0x237))),0x1;const _0x8cb013=await confirmKey(_0x208774(0x358)+(_0x137e55?_0x208774(0x2e3):'attempt')+'\x20'+_0x53e84b+'?');if(!_0x8cb013)return console[_0x208774(0x26f)](a50_0x2262f3['yellow'](_0x208774(0x315))),0x1;}let _0x3bba42;_0x137e55?_0x3bba42=await withSpinner(_0x208774(0x2a2),()=>_0x50c8a5['workflow'][_0x208774(0x213)](_0x53e84b,{'fromTask':_0x53d55f,'retryParams':_0x4d7205}),{'verbose':_0x5673d4[_0x208774(0x279)]}):_0x3bba42=await withSpinner('Retrying\x20attempt...',()=>_0x50c8a5[_0x208774(0x29f)][_0x208774(0x33c)](_0x53e84b,{'resumeFrom':_0x46f886,'retryParams':_0x4d7205,'force':_0x398e3e}),{'verbose':_0x5673d4[_0x208774(0x279)]});const _0x527734=_0x3bba42['data'];return console[_0x208774(0x26f)]('✔\x20Retry\x20started'),console[_0x208774(0x26f)](_0x208774(0x221)+_0x527734['attemptId']),console[_0x208774(0x26f)]('\x20\x20Session\x20ID:\x20'+_0x527734['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a50_0x36cf24(0x2d7)]='workflow:run';[a50_0x36cf24(0x266)]=a50_0x36cf24(0x251);async[a50_0x36cf24(0x35f)](_0x544ee1){const _0x25ab38=a50_0x36cf24,{options:_0x5a1a53,args:_0x2cb201,tdx:_0x104cff}=_0x544ee1;let _0x5760cb=_0x2cb201[0x0];if(!_0x5760cb){const _0x5eacf0=this[_0x25ab38(0x361)]([],_0x5a1a53),_0x26b57d=await withSpinner(_0x25ab38(0x25e),()=>_0x104cff[_0x25ab38(0x29f)][_0x25ab38(0x216)](_0x5eacf0,{'limit':_0x5a1a53[_0x25ab38(0x297)]}),{'verbose':_0x5a1a53[_0x25ab38(0x279)]}),_0x4f9c88=_0x26b57d[_0x25ab38(0x215)];if(_0x4f9c88[_0x25ab38(0x272)]===0x0)return console[_0x25ab38(0x26f)](_0x25ab38(0x204)),!_0x5eacf0&&console['error'](a50_0x2262f3['dim'](_0x25ab38(0x21f))),0x1;const _0x531722=_0x4f9c88['map'](_0x4bbd87=>({'title':_0x4bbd87[_0x25ab38(0x22b)]?.[_0x25ab38(0x2d7)]+'.'+_0x4bbd87[_0x25ab38(0x2d7)],'value':_0x4bbd87[_0x25ab38(0x22b)]?.[_0x25ab38(0x2d7)]+'.'+_0x4bbd87[_0x25ab38(0x2d7)],'description':_0x4bbd87[_0x25ab38(0x346)]?_0x25ab38(0x393)+_0x4bbd87[_0x25ab38(0x346)]:undefined})),_0x124229=await a50_0x42cef6({'type':_0x25ab38(0x2d4),'name':'workflow','message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x531722});if(!_0x124229['workflow'])return 0x1;_0x5760cb=_0x124229[_0x25ab38(0x29f)];}if(!_0x5760cb[_0x25ab38(0x32f)]('.')){const _0xd952c9=this[_0x25ab38(0x361)]([],_0x5a1a53);if(_0xd952c9)_0x5760cb=_0xd952c9+'.'+_0x5760cb;else return console['error'](a50_0x2262f3[_0x25ab38(0x312)](_0x25ab38(0x219)),_0x25ab38(0x2b6)),console[_0x25ab38(0x26f)](a50_0x2262f3[_0x25ab38(0x329)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x2932b3=_0x5a1a53['param'],_0x2bc1dc=_0x5a1a53['sessionTime'],_0xd0b287={};if(_0x2932b3&&Array[_0x25ab38(0x33b)](_0x2932b3))for(const _0x30a85d of _0x2932b3){const _0x444535=_0x30a85d[_0x25ab38(0x2f4)]('=');if(_0x444535===-0x1)return console[_0x25ab38(0x26f)](_0x25ab38(0x289)+_0x30a85d),console[_0x25ab38(0x26f)](_0x25ab38(0x322)),0x1;const _0x1c800c=_0x30a85d[_0x25ab38(0x24c)](0x0,_0x444535),_0x46f80a=_0x30a85d['substring'](_0x444535+0x1);try{_0xd0b287[_0x1c800c]=JSON[_0x25ab38(0x365)](_0x46f80a);}catch{_0xd0b287[_0x1c800c]=_0x46f80a;}}_0x5a1a53[_0x25ab38(0x279)]&&(console['error']('Workflow:\x20'+_0x5760cb),Object[_0x25ab38(0x208)](_0xd0b287)[_0x25ab38(0x272)]>0x0&&console[_0x25ab38(0x26f)]('Parameters:\x20'+JSON[_0x25ab38(0x394)](_0xd0b287)),_0x2bc1dc&&console[_0x25ab38(0x26f)](_0x25ab38(0x328)+_0x2bc1dc));const _0x40ba17=await withSpinner('Starting\x20workflow\x20run...',()=>_0x104cff[_0x25ab38(0x29f)]['run'](_0x5760cb,_0xd0b287,{'sessionTime':_0x2bc1dc}),{'verbose':_0x5a1a53[_0x25ab38(0x279)]}),_0xe3cf5=_0x40ba17[_0x25ab38(0x215)];console['error'](_0x25ab38(0x209)),console['error']('\x20\x20Attempt\x20ID:\x20'+_0xe3cf5['id']),console['error'](_0x25ab38(0x30c)+_0xe3cf5[_0x25ab38(0x37b)]),console['error']('\x20\x20Project:\x20'+_0xe3cf5[_0x25ab38(0x22b)]?.['name']),console[_0x25ab38(0x26f)](_0x25ab38(0x21e)+_0xe3cf5[_0x25ab38(0x29f)]?.[_0x25ab38(0x2d7)]);if(_0xe3cf5['project']?.['id']&&_0xe3cf5['sessionId']&&_0xe3cf5['id']){const _0x14f3e0=_0x5a1a53['site'],_0x3e64cd=getConsoleUrl(_0x14f3e0,_0x25ab38(0x258)+_0xe3cf5['project']['id']+_0x25ab38(0x30e)+_0xe3cf5['sessionId']+_0x25ab38(0x391)+_0xe3cf5['id']);console[_0x25ab38(0x26f)]('\x20\x20Console:\x20'+a50_0x2262f3[_0x25ab38(0x2b5)](_0x3e64cd));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a50_0x36cf24(0x2d7)]=a50_0x36cf24(0x321);[a50_0x36cf24(0x266)]=a50_0x36cf24(0x28f);async[a50_0x36cf24(0x35f)](_0x20d420){const _0x3c25fd=a50_0x36cf24,{options:_0x5ca3c8,args:_0x38a215,tdx:_0x173d46}=_0x20d420,_0x5419d8=_0x38a215[0x0],_0x3f2867=_0x38a215[0x1]||'.';if(!_0x5419d8)return console[_0x3c25fd(0x26f)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x3c25fd(0x26f)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x59c58a=_0x5ca3c8['revision'];_0x5ca3c8[_0x3c25fd(0x279)]&&(console[_0x3c25fd(0x26f)](_0x3c25fd(0x27c)+_0x5419d8),console[_0x3c25fd(0x26f)]('Output\x20directory:\x20'+_0x3f2867),_0x59c58a&&console[_0x3c25fd(0x26f)](_0x3c25fd(0x259)+_0x59c58a));const _0x4c5c2e=await withSpinner(_0x3c25fd(0x36e)+_0x5419d8+_0x3c25fd(0x2cf),()=>_0x173d46[_0x3c25fd(0x29f)]['download'](_0x5419d8,_0x3f2867,{'revision':_0x59c58a}),{'verbose':_0x5ca3c8[_0x3c25fd(0x279)]}),_0x3bb11e=_0x4c5c2e[_0x3c25fd(0x215)];return console[_0x3c25fd(0x26f)](_0x3c25fd(0x2aa)+_0x3bb11e['projectName']),console[_0x3c25fd(0x26f)]('\x20\x20Revision:\x20'+_0x3bb11e[_0x3c25fd(0x346)]),console['error'](_0x3c25fd(0x264)+_0x3bb11e[_0x3c25fd(0x273)]),console[_0x3c25fd(0x26f)](_0x3c25fd(0x1f4)+_0x3f2867+'/'+_0x3bb11e['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a50_0x36cf24(0x2d7)]=a50_0x36cf24(0x22c);[a50_0x36cf24(0x266)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async[a50_0x36cf24(0x35f)](_0x264b34){const _0xf6134d=a50_0x36cf24,{options:_0x445102,args:_0x3e6291,tdx:_0x37840b}=_0x264b34;let _0x237ec4='.',_0x5a3ffc=_0x445102[_0xf6134d(0x2d7)];if(_0x3e6291[0x0]){const {promises:_0x3a628e}=await import('fs');try{const _0x563845=await _0x3a628e['stat'](_0x3e6291[0x0]);if(_0x563845[_0xf6134d(0x392)]())_0x237ec4=_0x3e6291[0x0];else return console[_0xf6134d(0x26f)](_0xf6134d(0x349)+_0x3e6291[0x0]+_0xf6134d(0x250)),0x1;}catch{_0x5a3ffc=_0x3e6291[0x0],_0x237ec4='.';}}const _0x402475=_0x445102[_0xf6134d(0x346)],_0x2d4a4d=_0x445102[_0xf6134d(0x2c1)];_0x445102[_0xf6134d(0x279)]&&(console[_0xf6134d(0x26f)]('Project\x20directory:\x20'+_0x237ec4),_0x5a3ffc&&console[_0xf6134d(0x26f)]('Project\x20name:\x20'+_0x5a3ffc),_0x402475&&console['error']('Revision:\x20'+_0x402475),_0x2d4a4d&&console['error'](_0xf6134d(0x2cb)));const _0x192762=await withSpinner(_0xf6134d(0x29a),()=>_0x37840b[_0xf6134d(0x29f)][_0xf6134d(0x386)](_0x237ec4,{'projectName':_0x5a3ffc,'revision':_0x402475,'skipValidation':_0x2d4a4d}),{'verbose':_0x445102['verbose']}),_0x1c3949=_0x192762[_0xf6134d(0x215)];return console[_0xf6134d(0x26f)](_0xf6134d(0x278)+_0x1c3949['projectName']),console[_0xf6134d(0x26f)](_0xf6134d(0x2eb)+_0x1c3949[_0xf6134d(0x307)]),console['error'](_0xf6134d(0x359)+_0x1c3949[_0xf6134d(0x346)]),await this[_0xf6134d(0x2fa)](_0x37840b,_0x1c3949['projectName'],_0x445102[_0xf6134d(0x309)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a50_0x36cf24(0x2d7)]=a50_0x36cf24(0x21c);[a50_0x36cf24(0x266)]=a50_0x36cf24(0x1f8);async[a50_0x36cf24(0x35f)](_0x28ee13){const _0x4cf192=a50_0x36cf24,{options:_0x24c76e,args:_0x4c7aad,tdx:_0xc84450}=_0x28ee13,_0x3638cf=_0x4c7aad[0x0],_0x5ee583=_0x4c7aad[0x1];if(!_0x3638cf)return console[_0x4cf192(0x26f)](a50_0x2262f3['red']('Error:'),_0x4cf192(0x2df)),console['error'](a50_0x2262f3[_0x4cf192(0x329)]('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x2ab05a=_0x24c76e[_0x4cf192(0x346)];_0x24c76e[_0x4cf192(0x279)]&&(console[_0x4cf192(0x26f)](_0x4cf192(0x27c)+_0x3638cf),_0x5ee583&&console[_0x4cf192(0x26f)](_0x4cf192(0x276)+_0x5ee583),_0x2ab05a&&console[_0x4cf192(0x26f)](_0x4cf192(0x259)+_0x2ab05a),_0x24c76e[_0x4cf192(0x2c6)]&&console['error'](_0x4cf192(0x2a0)));const _0x1fd8ce=await withSpinner('Pulling\x20project\x20'+_0x3638cf+_0x4cf192(0x2cf),()=>_0xc84450[_0x4cf192(0x29f)][_0x4cf192(0x2ef)](_0x3638cf,{'targetDir':_0x5ee583,'revision':_0x2ab05a}),{'verbose':_0x24c76e[_0x4cf192(0x279)]}),_0xeb756d=_0x1fd8ce[_0x4cf192(0x215)];_0xeb756d[_0x4cf192(0x2b1)]?console[_0x4cf192(0x26f)](_0x4cf192(0x2b9)+_0xeb756d[_0x4cf192(0x33a)]):console[_0x4cf192(0x26f)](_0x4cf192(0x275)+_0xeb756d['projectName']);console[_0x4cf192(0x26f)](_0x4cf192(0x359)+_0xeb756d[_0x4cf192(0x346)]),console[_0x4cf192(0x26f)](_0x4cf192(0x352)+(a50_0x426a1b[_0x4cf192(0x20a)](process[_0x4cf192(0x2d8)](),_0xeb756d[_0x4cf192(0x2a5)])||'.')),console[_0x4cf192(0x26f)](_0x4cf192(0x34d)+a50_0x2262f3['green']('+'+_0xeb756d[_0x4cf192(0x2d5)]['new']+'\x20new')+',\x20'+(a50_0x2262f3[_0x4cf192(0x2ed)]('~'+_0xeb756d['summary'][_0x4cf192(0x230)]+_0x4cf192(0x2f7))+',\x20')+(a50_0x2262f3[_0x4cf192(0x312)]('-'+_0xeb756d['summary'][_0x4cf192(0x2ac)]+'\x20deleted')+',\x20')+(''+a50_0x2262f3['dim'](_0xeb756d[_0x4cf192(0x2d5)]['unchanged']+_0x4cf192(0x1f3))));for(const _0x36967b of _0xeb756d[_0x4cf192(0x2f6)]){_0x36967b['type']==='modified'&&_0x36967b[_0x4cf192(0x2a4)]&&(console[_0x4cf192(0x26f)]('\x0a'+a50_0x2262f3['cyan']('---\x20'+_0x36967b['path'])),console[_0x4cf192(0x26f)](_0x36967b[_0x4cf192(0x2a4)]));}if(!_0xeb756d[_0x4cf192(0x200)])return saveSessionContext({'workflow_project':_0xeb756d['projectName']},_0x24c76e['session']),console[_0x4cf192(0x26f)](a50_0x2262f3[_0x4cf192(0x37f)]('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x4cf192(0x26f)](a50_0x2262f3[_0x4cf192(0x329)](_0x4cf192(0x25a)+_0xeb756d[_0x4cf192(0x33a)])),0x0;if(_0x24c76e['dryRun'])return console[_0x4cf192(0x26f)](a50_0x2262f3[_0x4cf192(0x2ed)](_0x4cf192(0x255))),0x0;if(!_0x24c76e[_0x4cf192(0x292)]){if(!isInteractive())return console[_0x4cf192(0x26f)](a50_0x2262f3['red'](_0x4cf192(0x2dd)),_0x4cf192(0x25d)),console[_0x4cf192(0x26f)](a50_0x2262f3['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5d6df4=await confirmKey(_0x4cf192(0x34e));if(!_0x5d6df4)return console['error'](a50_0x2262f3[_0x4cf192(0x2ed)](_0x4cf192(0x315)),_0x4cf192(0x212)),0x1;}await withSpinner(_0x4cf192(0x373),()=>_0xc84450['workflow'][_0x4cf192(0x229)](_0xeb756d,{'revision':_0x2ab05a}),{'verbose':_0x24c76e[_0x4cf192(0x279)]}),saveSessionContext({'workflow_project':_0xeb756d[_0x4cf192(0x33a)]},_0x24c76e[_0x4cf192(0x2e3)]),console[_0x4cf192(0x26f)](a50_0x2262f3[_0x4cf192(0x37f)](_0x4cf192(0x1f6)));const _0x56b0ad=a50_0x426a1b[_0x4cf192(0x20a)](process['cwd'](),_0xeb756d[_0x4cf192(0x2a5)])||'.';return console['error'](a50_0x2262f3[_0x4cf192(0x329)](_0x4cf192(0x1f4)+_0x56b0ad)),console[_0x4cf192(0x26f)](a50_0x2262f3['dim']('\x20\x20Session\x20context\x20set\x20to:\x20'+_0xeb756d[_0x4cf192(0x33a)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a50_0x36cf24(0x263);[a50_0x36cf24(0x266)]=a50_0x36cf24(0x269);async[a50_0x36cf24(0x35f)](_0x2aec3e){const _0x55c3b9=a50_0x36cf24,{options:_0x3c7656,args:_0x4fa0d1,tdx:_0x2adfc4}=_0x2aec3e,_0x3726b1=this['resolveProjectDir'](_0x4fa0d1,_0x3c7656),_0x449d7e=_0x3c7656[_0x55c3b9(0x346)],_0x2ba4bd=_0x3c7656[_0x55c3b9(0x2c1)];_0x3c7656[_0x55c3b9(0x279)]&&(_0x3726b1&&console[_0x55c3b9(0x26f)](_0x55c3b9(0x298)+_0x3726b1),_0x449d7e&&console[_0x55c3b9(0x26f)](_0x55c3b9(0x259)+_0x449d7e),_0x3c7656[_0x55c3b9(0x2c6)]&&console['error']('Dry\x20run:\x20yes'),_0x2ba4bd&&console[_0x55c3b9(0x26f)](_0x55c3b9(0x2cb)));let _0x3c120b;try{_0x3c120b=await withSpinner(_0x55c3b9(0x2f8),()=>_0x2adfc4[_0x55c3b9(0x29f)][_0x55c3b9(0x243)]({'sourceDir':_0x3726b1,'revision':_0x449d7e,'skipValidation':_0x2ba4bd}),{'verbose':_0x3c7656[_0x55c3b9(0x279)]});}catch(_0x193dbb){if(_0x193dbb instanceof Error&&_0x193dbb[_0x55c3b9(0x245)]['includes'](_0x55c3b9(0x225)))return console['error'](a50_0x2262f3[_0x55c3b9(0x312)](_0x55c3b9(0x219)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x3c7656[_0x55c3b9(0x325)]?console['error'](a50_0x2262f3[_0x55c3b9(0x329)]('Tip:\x20cd\x20to\x20workflows/'+_0x3c7656[_0x55c3b9(0x325)]+_0x55c3b9(0x265)+_0x3c7656[_0x55c3b9(0x325)]+'\x27')):console[_0x55c3b9(0x26f)](a50_0x2262f3[_0x55c3b9(0x329)](_0x55c3b9(0x356))),0x1;throw _0x193dbb;}const _0x2d097c=_0x3c120b['data'];console[_0x55c3b9(0x26f)](_0x55c3b9(0x387)+_0x2d097c[_0x55c3b9(0x33a)]),console[_0x55c3b9(0x26f)](_0x55c3b9(0x344)+_0x2d097c[_0x55c3b9(0x20b)]),console[_0x55c3b9(0x26f)](_0x55c3b9(0x359)+_0x2d097c[_0x55c3b9(0x346)]),console['error'](_0x55c3b9(0x34d)+a50_0x2262f3[_0x55c3b9(0x37f)]('+'+_0x2d097c[_0x55c3b9(0x2d5)]['new']+'\x20new')+',\x20'+(a50_0x2262f3[_0x55c3b9(0x2ed)]('~'+_0x2d097c[_0x55c3b9(0x2d5)]['modified']+_0x55c3b9(0x2f7))+',\x20')+(a50_0x2262f3['red']('-'+_0x2d097c[_0x55c3b9(0x2d5)][_0x55c3b9(0x2ac)]+_0x55c3b9(0x345))+',\x20')+(''+a50_0x2262f3['dim'](_0x2d097c['summary'][_0x55c3b9(0x256)]+_0x55c3b9(0x1f3))));for(const _0x6668a3 of _0x2d097c[_0x55c3b9(0x2f6)]){_0x6668a3[_0x55c3b9(0x28d)]==='modified'&&_0x6668a3['diff']&&(console['error']('\x0a'+a50_0x2262f3['cyan'](_0x55c3b9(0x28b)+_0x6668a3[_0x55c3b9(0x360)])),console[_0x55c3b9(0x26f)](_0x6668a3[_0x55c3b9(0x2a4)]));}if(!_0x2d097c[_0x55c3b9(0x200)])return console['error'](a50_0x2262f3[_0x55c3b9(0x37f)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x55c3b9(0x2fa)](_0x2adfc4,_0x2d097c['projectName'],_0x3c7656[_0x55c3b9(0x309)]),0x0;if(_0x3c7656[_0x55c3b9(0x2c6)])return console[_0x55c3b9(0x26f)](a50_0x2262f3[_0x55c3b9(0x2ed)](_0x55c3b9(0x399))),0x0;if(!_0x3c7656[_0x55c3b9(0x292)]){if(!isInteractive())return console[_0x55c3b9(0x26f)](a50_0x2262f3[_0x55c3b9(0x312)](_0x55c3b9(0x2dd)),_0x55c3b9(0x25d)),console[_0x55c3b9(0x26f)](a50_0x2262f3[_0x55c3b9(0x329)](_0x55c3b9(0x237))),0x1;const _0x1c7cb8=await confirmKey(_0x55c3b9(0x232));if(!_0x1c7cb8)return console[_0x55c3b9(0x26f)](a50_0x2262f3['yellow'](_0x55c3b9(0x315)),_0x55c3b9(0x2ca)),0x1;}const _0x4fa6bb=await withSpinner(_0x55c3b9(0x260),()=>_0x2adfc4[_0x55c3b9(0x29f)][_0x55c3b9(0x355)](_0x2d097c),{'verbose':_0x3c7656[_0x55c3b9(0x279)]}),_0x387623=_0x4fa6bb[_0x55c3b9(0x215)];return console[_0x55c3b9(0x26f)](a50_0x2262f3[_0x55c3b9(0x37f)](_0x55c3b9(0x303))),console[_0x55c3b9(0x26f)](_0x55c3b9(0x2eb)+_0x387623['projectId']),console[_0x55c3b9(0x26f)](_0x55c3b9(0x359)+_0x387623[_0x55c3b9(0x346)]),await this[_0x55c3b9(0x2fa)](_0x2adfc4,_0x387623[_0x55c3b9(0x33a)],_0x3c7656[_0x55c3b9(0x309)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a50_0x36cf24(0x2d7)]=a50_0x36cf24(0x253);[a50_0x36cf24(0x266)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async['execute'](_0xdfea8d){const _0x5acdb4=a50_0x36cf24,{options:_0x14d390,args:_0x5a74cd,tdx:_0x1919e3}=_0xdfea8d,_0x2c6d99=this[_0x5acdb4(0x1ff)](_0x5a74cd,_0x14d390),_0x409b21=_0x14d390[_0x5acdb4(0x2d7)],_0x1d2b20=_0x14d390[_0x5acdb4(0x346)],_0x2fe4b8=_0x14d390[_0x5acdb4(0x2c1)];if(!_0x2c6d99)return console[_0x5acdb4(0x26f)](a50_0x2262f3['red'](_0x5acdb4(0x219)),'Source\x20directory\x20is\x20required'),console['error'](a50_0x2262f3[_0x5acdb4(0x329)](_0x5acdb4(0x336))),console[_0x5acdb4(0x26f)](a50_0x2262f3[_0x5acdb4(0x329)](_0x5acdb4(0x267))),0x1;if(!_0x409b21)return console[_0x5acdb4(0x26f)](a50_0x2262f3['red'](_0x5acdb4(0x219)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console['error'](a50_0x2262f3[_0x5acdb4(0x329)](_0x5acdb4(0x336))),0x1;_0x14d390[_0x5acdb4(0x279)]&&(console[_0x5acdb4(0x26f)](_0x5acdb4(0x298)+_0x2c6d99),console[_0x5acdb4(0x26f)](_0x5acdb4(0x2b7)+_0x409b21),_0x1d2b20&&console['error']('Revision:\x20'+_0x1d2b20),_0x14d390[_0x5acdb4(0x2c6)]&&console[_0x5acdb4(0x26f)]('Dry\x20run:\x20yes'),_0x2fe4b8&&console[_0x5acdb4(0x26f)](_0x5acdb4(0x2cb)));const _0x2e1d7d=await withSpinner('Analyzing\x20project...',()=>_0x1919e3[_0x5acdb4(0x29f)][_0x5acdb4(0x24d)](_0x2c6d99,_0x409b21,{'revision':_0x1d2b20,'skipValidation':_0x2fe4b8}),{'verbose':_0x14d390[_0x5acdb4(0x279)]}),_0x3b74ed=_0x2e1d7d['data'];console[_0x5acdb4(0x26f)](_0x5acdb4(0x35d)+_0x3b74ed[_0x5acdb4(0x20b)]);_0x3b74ed[_0x5acdb4(0x2a6)]&&console[_0x5acdb4(0x26f)](_0x5acdb4(0x372)+_0x3b74ed[_0x5acdb4(0x2a6)]);console[_0x5acdb4(0x26f)](_0x5acdb4(0x2b7)+_0x3b74ed[_0x5acdb4(0x38b)]),console['error'](_0x5acdb4(0x259)+_0x3b74ed[_0x5acdb4(0x346)]),console[_0x5acdb4(0x26f)](_0x5acdb4(0x2b0)+_0x3b74ed['fileCount']);_0x3b74ed['targetExists']&&(console[_0x5acdb4(0x26f)](a50_0x2262f3['yellow']('\x0a⚠\x20Project\x20\x22'+_0x3b74ed['newProjectName']+_0x5acdb4(0x316)+_0x3b74ed['existingProjectId']+')')),console[_0x5acdb4(0x26f)](a50_0x2262f3[_0x5acdb4(0x2ed)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x14d390[_0x5acdb4(0x2c6)])return console[_0x5acdb4(0x26f)](a50_0x2262f3[_0x5acdb4(0x2ed)](_0x5acdb4(0x2ea))),0x0;if(!_0x14d390['yes']){if(!isInteractive())return console[_0x5acdb4(0x26f)](a50_0x2262f3[_0x5acdb4(0x312)](_0x5acdb4(0x2dd)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5acdb4(0x26f)](a50_0x2262f3[_0x5acdb4(0x329)](_0x5acdb4(0x237))),0x1;const _0x309fb0=_0x3b74ed['sourceProjectName']||a50_0x426a1b[_0x5acdb4(0x2cc)](_0x2c6d99),_0x74711a=_0x3b74ed[_0x5acdb4(0x36b)]?_0x5acdb4(0x249)+_0x409b21+_0x5acdb4(0x20c):_0x5acdb4(0x2c8)+_0x309fb0+_0x5acdb4(0x217)+_0x409b21+'\x22?',_0x44c85f=await confirmKey(_0x74711a);if(!_0x44c85f)return console[_0x5acdb4(0x26f)](a50_0x2262f3['yellow']('Cancelled')),0x1;}const _0x3772f7=await withSpinner(_0x3b74ed[_0x5acdb4(0x36b)]?_0x5acdb4(0x248)+_0x409b21+_0x5acdb4(0x2cf):'Cloning\x20to\x20'+_0x409b21+'...',()=>_0x1919e3[_0x5acdb4(0x29f)]['executeCloneProject'](_0x3b74ed),{'verbose':_0x14d390[_0x5acdb4(0x279)]}),_0x5fd3ae=_0x3772f7[_0x5acdb4(0x215)];return console['error'](a50_0x2262f3[_0x5acdb4(0x37f)](_0x3b74ed[_0x5acdb4(0x36b)]?_0x5acdb4(0x368):_0x5acdb4(0x2c7))),console[_0x5acdb4(0x26f)]('\x20\x20Project:\x20'+_0x5fd3ae['newProjectName']),console[_0x5acdb4(0x26f)](_0x5acdb4(0x2eb)+_0x5fd3ae['newProjectId']),console[_0x5acdb4(0x26f)](_0x5acdb4(0x359)+_0x5fd3ae[_0x5acdb4(0x346)]),await this[_0x5acdb4(0x2fa)](_0x1919e3,_0x5fd3ae[_0x5acdb4(0x38b)],_0x14d390[_0x5acdb4(0x309)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a50_0x36cf24(0x2d7)]=a50_0x36cf24(0x366);[a50_0x36cf24(0x266)]=a50_0x36cf24(0x31b);async[a50_0x36cf24(0x35f)](_0x2e128f){const _0x55282f=a50_0x36cf24,{options:_0x12bcf5,args:_0x24bf13,tdx:_0x53a470}=_0x2e128f,_0x335ad4=_0x24bf13[0x0];if(!_0x335ad4)return console[_0x55282f(0x26f)](_0x55282f(0x206)),console[_0x55282f(0x26f)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x12bcf5['verbose']&&console['error']('Project:\x20'+_0x335ad4);if(!_0x12bcf5[_0x55282f(0x292)]){if(!isInteractive())return console['error'](a50_0x2262f3[_0x55282f(0x312)]('\x0aError:'),_0x55282f(0x25d)),console[_0x55282f(0x26f)](a50_0x2262f3[_0x55282f(0x329)](_0x55282f(0x237))),0x1;const _0x43936b=await confirmKey(_0x55282f(0x302)+_0x335ad4+_0x55282f(0x39b));if(!_0x43936b)return console[_0x55282f(0x26f)](a50_0x2262f3[_0x55282f(0x2ed)](_0x55282f(0x315))),0x1;}const _0x4ffb6b=await withSpinner(_0x55282f(0x2e7)+_0x335ad4+_0x55282f(0x2cf),()=>_0x53a470['workflow'][_0x55282f(0x257)](_0x335ad4),{'verbose':_0x12bcf5[_0x55282f(0x279)]}),_0xa89127=_0x4ffb6b[_0x55282f(0x215)];return console[_0x55282f(0x26f)](_0x55282f(0x318)+_0xa89127[_0x55282f(0x33a)]),console[_0x55282f(0x26f)](_0x55282f(0x2eb)+_0xa89127[_0x55282f(0x307)]),0x0;}}export function parseKeyValue(_0x3cc884){const _0x4bc24a=a50_0x36cf24,_0x1725ad=_0x3cc884[_0x4bc24a(0x2f4)]('=');if(_0x1725ad===-0x1)throw new Error(_0x4bc24a(0x26a)+_0x3cc884+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x3e59de=_0x3cc884[_0x4bc24a(0x24c)](0x0,_0x1725ad),_0x283b32=_0x3cc884['substring'](_0x1725ad+0x1);if(!_0x3e59de)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x3e59de,'value':_0x283b32};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a50_0x36cf24(0x2d7)]='workflow:secrets:list';[a50_0x36cf24(0x266)]=a50_0x36cf24(0x395);async[a50_0x36cf24(0x35f)](_0x25244c){const _0x40bf06=a50_0x36cf24,{options:_0x4484bb,args:_0x47a12f,tdx:_0x2443d2}=_0x25244c,_0x1fee47=this[_0x40bf06(0x26e)](_0x47a12f,_0x4484bb);if(!_0x1fee47)return 0x1;_0x4484bb[_0x40bf06(0x279)]&&console[_0x40bf06(0x26f)](_0x40bf06(0x27c)+_0x1fee47);const _0x209b01=await withSpinner(_0x40bf06(0x1fb),()=>_0x2443d2[_0x40bf06(0x29f)][_0x40bf06(0x2d6)](_0x1fee47),{'verbose':_0x4484bb[_0x40bf06(0x279)]}),{secrets:_0x15c8fc}=_0x209b01[_0x40bf06(0x215)];return console[_0x40bf06(0x26f)](_0x40bf06(0x21a)+_0x15c8fc[_0x40bf06(0x272)]+_0x40bf06(0x2fc)+(_0x15c8fc[_0x40bf06(0x272)]!==0x1?'s':'')),await handleSDKOutput(_0x15c8fc,_0x4484bb),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a50_0x36cf24(0x2d7)]=a50_0x36cf24(0x2f1);[a50_0x36cf24(0x266)]=a50_0x36cf24(0x327);async['execute'](_0x30574c){const _0x2db02d=a50_0x36cf24,{options:_0x590257,args:_0x23e251,tdx:_0x3394a9}=_0x30574c;let _0x897085,_0x1738c7;if(_0x23e251[_0x2db02d(0x272)]>=0x2)_0x897085=_0x23e251[0x0],_0x1738c7=_0x23e251[0x1];else{if(_0x23e251[_0x2db02d(0x272)]===0x1&&_0x590257[_0x2db02d(0x325)])_0x897085=_0x590257[_0x2db02d(0x325)],_0x1738c7=_0x23e251[0x0];else return _0x23e251[_0x2db02d(0x272)]===0x1?(console[_0x2db02d(0x26f)](_0x2db02d(0x294)),console[_0x2db02d(0x26f)](_0x2db02d(0x21f)),0x1):(console['error']('Error:\x20KEY=VALUE\x20is\x20required'),console['error'](_0x2db02d(0x25f)),0x1);}let _0x3f7f43,_0x28a646;try{({key:_0x3f7f43,value:_0x28a646}=parseKeyValue(_0x1738c7));}catch(_0x4b52f8){return _0x4b52f8 instanceof Error&&console[_0x2db02d(0x26f)](a50_0x2262f3[_0x2db02d(0x312)](_0x2db02d(0x219)),_0x4b52f8[_0x2db02d(0x245)]),0x1;}_0x590257[_0x2db02d(0x279)]&&(console[_0x2db02d(0x26f)]('Project:\x20'+_0x897085),console[_0x2db02d(0x26f)](_0x2db02d(0x228)+_0x3f7f43));const _0x489423=await withSpinner(_0x2db02d(0x27d),()=>_0x3394a9['workflow']['setSecret'](_0x897085,_0x3f7f43,_0x28a646),{'verbose':_0x590257[_0x2db02d(0x279)]}),_0x81cd6=_0x489423[_0x2db02d(0x215)];return console[_0x2db02d(0x26f)]('✔\x20Secret\x20\x27'+_0x81cd6[_0x2db02d(0x2db)]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x81cd6[_0x2db02d(0x33a)]+'\x27'),(_0x590257[_0x2db02d(0x280)]||_0x590257['jsonl'])&&await handleSingleObjectOutput(_0x81cd6,_0x590257),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a50_0x36cf24(0x2d7)]=a50_0x36cf24(0x23c);[a50_0x36cf24(0x266)]=a50_0x36cf24(0x301);async[a50_0x36cf24(0x35f)](_0x47ae91){const _0x457a4f=a50_0x36cf24,{options:_0x25e42d,args:_0x3c2fcf,tdx:_0x149830}=_0x47ae91;let _0x494690,_0x14f037;if(_0x3c2fcf[_0x457a4f(0x272)]>=0x2)_0x494690=_0x3c2fcf[0x0],_0x14f037=_0x3c2fcf[0x1];else{if(_0x3c2fcf['length']===0x1&&_0x25e42d[_0x457a4f(0x325)])_0x494690=_0x25e42d[_0x457a4f(0x325)],_0x14f037=_0x3c2fcf[0x0];else return _0x3c2fcf[_0x457a4f(0x272)]===0x1?(console[_0x457a4f(0x26f)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x457a4f(0x26f)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console['error']('Error:\x20Secret\x20key\x20is\x20required'),console[_0x457a4f(0x26f)](_0x457a4f(0x27f)),0x1);}_0x25e42d['verbose']&&(console[_0x457a4f(0x26f)](_0x457a4f(0x27c)+_0x494690),console[_0x457a4f(0x26f)](_0x457a4f(0x228)+_0x14f037));if(!_0x25e42d[_0x457a4f(0x292)]){if(!isInteractive())return console[_0x457a4f(0x26f)](a50_0x2262f3['red'](_0x457a4f(0x2dd)),_0x457a4f(0x25d)),console['error'](a50_0x2262f3[_0x457a4f(0x329)](_0x457a4f(0x237))),0x1;const _0x5e9d3c=await confirmKey(_0x457a4f(0x2f5)+_0x14f037+_0x457a4f(0x330)+_0x494690+'\x27?');if(!_0x5e9d3c)return console[_0x457a4f(0x26f)](a50_0x2262f3[_0x457a4f(0x2ed)]('Cancelled')),0x1;}const _0x2f61cc=await withSpinner(_0x457a4f(0x234),()=>_0x149830[_0x457a4f(0x29f)][_0x457a4f(0x2a1)](_0x494690,_0x14f037),{'verbose':_0x25e42d[_0x457a4f(0x279)]}),_0x1f32f9=_0x2f61cc[_0x457a4f(0x215)];return console['error'](_0x457a4f(0x21b)+_0x1f32f9[_0x457a4f(0x2db)]+_0x457a4f(0x271)+_0x1f32f9['projectName']+'\x27'),(_0x25e42d[_0x457a4f(0x280)]||_0x25e42d[_0x457a4f(0x235)])&&await handleSingleObjectOutput(_0x1f32f9,_0x25e42d),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(_0x6083b2){const _0x34c3ae=a50_0x36cf24,_0x135e8c=Math[_0x34c3ae(0x287)](_0x6083b2/0x3e8),_0x45f2ca=Math[_0x34c3ae(0x287)](_0x135e8c/0x3c),_0x529c8d=Math[_0x34c3ae(0x287)](_0x45f2ca/0x3c),_0x3b186f=Math[_0x34c3ae(0x287)](_0x529c8d/0x18);if(_0x3b186f>0x0){const _0x2b1262=_0x529c8d%0x18;return _0x2b1262>0x0?_0x3b186f+'d\x20'+_0x2b1262+'h':_0x3b186f+'d';}else{if(_0x529c8d>0x0){const _0x504fb9=_0x45f2ca%0x3c;return _0x504fb9>0x0?_0x529c8d+'h\x20'+_0x504fb9+'m':_0x529c8d+'h';}else{if(_0x45f2ca>0x0){const _0xf83ac7=_0x135e8c%0x3c;return _0xf83ac7>0x0?_0x45f2ca+'m\x20'+_0xf83ac7+'s':_0x45f2ca+'m';}else return _0x135e8c+'s';}}}function formatTimestamp(_0x42a30f,_0x4a3f71){const _0x3b5742=a50_0x36cf24,_0x518e48=new Date(_0x42a30f),_0x4c5fb3=String(_0x518e48[_0x3b5742(0x388)]())[_0x3b5742(0x30f)](0x2,'0'),_0x315fa8=String(_0x518e48[_0x3b5742(0x305)]())[_0x3b5742(0x30f)](0x2,'0'),_0x4bcd4e=_0x4c5fb3+':'+_0x315fa8,_0x4f843f=_0x518e48['getFullYear']()===_0x4a3f71['getFullYear']()&&_0x518e48[_0x3b5742(0x291)]()===_0x4a3f71[_0x3b5742(0x291)]()&&_0x518e48[_0x3b5742(0x218)]()===_0x4a3f71['getDate']();if(_0x4f843f)return _0x4bcd4e;else{const _0x337685=String(_0x518e48[_0x3b5742(0x291)]()+0x1)['padStart'](0x2,'0'),_0x439dcd=String(_0x518e48[_0x3b5742(0x218)]())['padStart'](0x2,'0');return _0x337685+'-'+_0x439dcd+'\x20'+_0x4bcd4e;}}function formatDate(_0x4cbc56){const _0x40951a=a50_0x36cf24,_0x445d02=_0x4cbc56['getFullYear'](),_0x1107d1=String(_0x4cbc56[_0x40951a(0x291)]()+0x1)[_0x40951a(0x30f)](0x2,'0'),_0x105314=String(_0x4cbc56[_0x40951a(0x218)]())['padStart'](0x2,'0');return _0x445d02+'-'+_0x1107d1+'-'+_0x105314;}function getTaskStateIcon(_0x25e96c){const _0x4964fb={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x4964fb[_0x25e96c]||'⚪';}function getBarChar(_0x1758bd){const _0x3c9d12=a50_0x36cf24;return _0x1758bd===_0x3c9d12(0x26f)||_0x1758bd===_0x3c9d12(0x22e)?'×':'─';}function a50_0x4e3c(){const _0x1d4a47=['Error:\x20Invalid\x20parameter\x20format:\x20','List\x20all\x20workflow\x20projects','---\x20','icon','type','Task\x20name:\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','match','getMonth','yes','projects','Error:\x20Project\x20name\x20is\x20required','\x20(use\x20--limit\x20to\x20show\x20more)','sessionTime','limit','Source\x20directory:\x20','LABEL_MIN_SPACING','Pushing\x20workflow\x20project...','No\x20sessions\x20found','LABEL_WIDTH_DIVISOR','12255TTvsot','\x20from\x20session\x20','workflow','Dry\x20run:\x20yes','deleteSecret','Retrying\x20session...','attempt','diff','targetDir','sourceProjectName','Fetching\x20log\x20files...','Select\x20a\x20task\x20to\x20view\x20logs:','2020326yMtvLA','✔\x20Downloaded\x20','MAX_TASKS_DISPLAY','deleted','planned','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Files\x20to\x20upload:\x20','isNewProject','Force:\x20yes','workflow:workflows','session:','cyan','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','New\x20project\x20name:\x20','round','→\x20New\x20project:\x20','running','MAX_LABEL_COUNT','canceling','clear','List\x20workflow\x20execution\x20sessions','No\x20workflow\x20sessions\x20found','start','skipValidation','No\x20log\x20content\x20found','workflow:kill','\x20-\x20','Pattern:\x20','dryRun','✔\x20Clone\x20complete','\x0aClone\x20\x22','value','-\x20nothing\x20pushed','Validation:\x20skipped','basename','localeCompare','find','...','logs','workflow:attempts','createdAt','Reason:\x20','select','summary','listSecrets','name','cwd','Failed\x20to\x20fetch\x20attempt\x20data','attempt:','key','Include\x20retried:\x20yes','\x0aError:','Attempt\x20ID:\x20','Project\x20name\x20is\x20required','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','resolveProjectId','Error:\x20Attempt\x20ID\x20is\x20required','session','map','Including\x20subtasks:\x20yes','toISOString','Deleting\x20project\x20','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','has','\x0aDry\x20run\x20-\x20no\x20project\x20created','\x20\x20Project\x20ID:\x20','No\x20attempts\x20found\x20in\x20project:\x20','yellow','rows','pullProject','kill','workflow:secrets:set','\x20to\x20see\x20detailed\x20logs','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','indexOf','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','changes','\x20modified','Analyzing\x20changes...','Session\x20','showWorkflowConsoleUrl','format','\x20secret','Project\x20filter:\x20','fill','192896aTxWbE','write','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','✔\x20Push\x20complete','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','getMinutes','slice','projectId','pending','site','includeRetried','3693geIcjq','\x20\x20Session\x20ID:\x20','109736AtRuTp','/sessions/','padStart','MAX_POLL_ITERATIONS','POLL_INTERVAL_MS','red','No\x20workflow\x20projects\x20found','Show\x20tasks\x20for\x20an\x20attempt','Cancelled','\x22\x20already\x20exists\x20(ID:\x20','fileSize','✔\x20Deleted\x20project\x20','split','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','\x20sessions\x20','4086810nJprtL','\x20tasks','join','No\x20sessions\x20found\x20for:\x20','workflow:download','Expected\x20format:\x20--param\x20key=value','startedAt','cancelRequested','workflowProject','Filter:\x20project=','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Session\x20time:\x20','dim','state','table','🔄\x20','startsWith','task','includes','\x27\x20from\x20project\x20\x27','includeSubtasks','\x20(system)','stdout','fs/promises','displayLine','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','MIN_LABEL_COUNT','navigateSessionsInteractive','list','projectName','isArray','retryAttempt','No\x20matching\x20sessions\x20found','splice','workflow:logs','Total:\x20','output','lastAttempt','sys','\x20\x20Source:\x20','\x20deleted','revision','buildTimelineData','logFiles','Error:\x20','From\x20task:\x20','taskName','msPerChar','\x20\x20Changes:\x20','\x0aApply\x20these\x20changes?','getTime','title','isTTY','\x20\x20Target:\x20','end','tdx\x20wf\x20attempt\x20','executePushProject','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','MAX_TIMELINE_WIDTH','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','\x20\x20Revision:\x20','log','ICON_SPACING','⚠\x20Showing\x20first\x20','Source:\x20','unknown','execute','path','resolveProject','Loading\x20sessions...','Usage:\x20tdx\x20wf\x20use\x20<project>',',\x20Workflow:\x20','parse','workflow:delete','autocomplete','✔\x20Project\x20updated','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','No\x20log\x20files\x20found\x20for\x20this\x20attempt','targetExists','Attempt:\x20','follow','Downloading\x20project\x20','(use\x20--limit\x20to\x20see\x20more)','renderTimeline','✔\x20Workflow\x20project\x20context\x20cleared.','Source\x20project:\x20','Writing\x20files...','filter','💡\x20Tip:\x20Use\x20','index','\x20task','Listing\x20workflows...','864ZLbblh','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','sessionId','retryAttemptName','Loading\x20session...','Filter:\x20','green','Target:\x20','get','GUTTER','finishedAt','resumeFrom','some','push','✔\x20Project:\x20','getHours','now','No\x20sessions\x20found\x20in\x20project:\x20','newProjectName','Error:\x20Invalid\x20JSON\x20in\x20--params','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','metadata','workflowName','renderSingleTimeline','/attempt/','isDirectory','revision:\x20','stringify','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','\x27...','No\x20projects\x20match\x20pattern:\x20','attempts','\x0aDry\x20run\x20-\x20nothing\x20pushed','\x0a✔\x20Attempt\x20complete','\x22?\x20This\x20cannot\x20be\x20undone.','workflow:use','\x20unchanged','\x20\x20Location:\x20','generateSessionTimelineRows','✔\x20Pull\x20complete','params','Pull\x20workflow\x20project\x20to\x20local\x20folder','No\x20sessions\x20with\x20timing\x20information','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','Listing\x20secrets...','values','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','MIN_TIMELINE_WIDTH','resolveProjectDir','hasChanges','fromTask','status','attemptId','No\x20workflows\x20found','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','172QjpDQP','keys','✔\x20Workflow\x20run\x20started','relative','sourceDir','\x22\x20with\x20new\x20revision?','every','\x20of\x20','workflow:tasks','Killing\x20attempt...','List\x20workflow\x20attempts','-\x20no\x20files\x20written','retrySession','Latest\x20session\x20has\x20no\x20attempt','data','workflows','\x22\x20to\x20new\x20project\x20\x22','getDate','Error:','✔\x20Found\x20','✔\x20Secret\x20\x27','workflow:pull','repeat','\x20\x20Workflow:\x20','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','ICON_WIDTH','\x20\x20New\x20attempt\x20ID:\x20','pollTimeline','toLowerCase','Listing\x20workflow\x20sessions...','No\x20workflow\x20tdx.json\x20found','success','Select\x20a\x20session\x20to\x20view\x20timeline:','Key:\x20','applyPullProject','sort','project','workflow:upload','Auto-selected\x20latest\x20session:\x20','group_error','done','modified','\x1b[1A\x1b[2K','\x0aPush\x20these\x20changes?','window','Deleting\x20secret...','jsonl','all','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','📋\x20','\x20session','text','updatedAt','workflow:secrets:delete','max','context','workflow:sessions','sessions','Resume\x20from:\x20','duration','preparePushProject','min','message','parseProjectWorkflowPattern','set','Updating\x20','\x0aUpdate\x20existing\x20project\x20\x22','renderSessionsTimeline','Show\x20logs\x20for\x20a\x20workflow\x20attempt','substring','prepareCloneProject','Kill\x20a\x20running\x20attempt','blue','\x20is\x20not\x20a\x20directory','Start\x20a\x20workflow\x20run','resolve','workflow:clone','No\x20attempts\x20found\x20for:\x20','\x0aDry\x20run\x20-\x20no\x20files\x20written','unchanged','delete','/app/workflows/','Revision:\x20','\x20\x20Session\x20context\x20set\x20to:\x20','reason','trimEnd','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Loading\x20workflows...','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','Pushing\x20project...','Show\x20specific\x20attempt\x20details','\x20\x20tdx\x20wf\x20use\x20<project>','workflow:push','\x20\x20Files\x20extracted:\x20','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','description','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','313854jKyGeA','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Invalid\x20format:\x20','(unknown)','\x0aPolling...\x20(','startTime','requireProject','error','Warning:','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','length','filesExtracted','tasks','→\x20Project:\x20','Target\x20directory:\x20','session_id','✔\x20Pushed\x20','verbose','white','Getting\x20attempt\x20tasks...','Project:\x20','Setting\x20secret...','TASK_NAME_WIDTH','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','json','No\x20attempts\x20found','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','fullName','Getting\x20attempt\x20details...','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Downloading\x20logs...','floor','\x20project'];a50_0x4e3c=function(){return _0x1d4a47;};return a50_0x4e3c();}function getBarColor(_0x148467){const _0xebe4cb=a50_0x36cf24,_0x46649d={'success':a50_0x2262f3[_0xebe4cb(0x37f)],'error':a50_0x2262f3[_0xebe4cb(0x312)],'group_error':a50_0x2262f3[_0xebe4cb(0x312)],'running':a50_0x2262f3[_0xebe4cb(0x24f)],'blocked':a50_0x2262f3[_0xebe4cb(0x2ed)],'planned':a50_0x2262f3[_0xebe4cb(0x329)],'canceling':a50_0x2262f3[_0xebe4cb(0x2ed)]};return _0x46649d[_0x148467]||a50_0x2262f3[_0xebe4cb(0x27a)];}function parseTaskName(_0x45fe39){const _0x41c277=a50_0x36cf24;let _0x210b1e=_0x45fe39['replace'](/^\++/,'');const _0x463efe=_0x210b1e[_0x41c277(0x319)]('+'),_0x28fa33=_0x463efe[_0x41c277(0x272)]>0x1?_0x463efe[_0x41c277(0x272)]-0x2:0x0,_0x3be8eb=_0x463efe[_0x463efe['length']-0x1]||_0x210b1e;return{'level':_0x28fa33,'name':'+'+_0x3be8eb};}function truncateTaskName(_0x56308a,_0x2f0c8b){const _0x2404dc=a50_0x36cf24,_0x2edcca=stringWidth(_0x56308a);if(_0x2edcca<=_0x2f0c8b)return _0x56308a;let _0x46ec41=_0x56308a;while(stringWidth(_0x46ec41+'…')>_0x2f0c8b&&_0x46ec41[_0x2404dc(0x272)]>0x0){_0x46ec41=_0x46ec41[_0x2404dc(0x306)](0x0,-0x1);}return _0x46ec41+'…';}function calculateTimeScale(_0x1cafda,_0x2d0db6){const _0x48a5e9=a50_0x36cf24;return{'startTime':_0x1cafda[_0x48a5e9(0x2c0)],'endTime':_0x1cafda[_0x48a5e9(0x353)],'durationMs':_0x1cafda[_0x48a5e9(0x242)],'msPerChar':_0x1cafda[_0x48a5e9(0x242)]/_0x2d0db6};}function timeToPosition(_0x1a83e2,_0x21c81d,_0x1ff022){const _0x13e3f3=a50_0x36cf24,_0x345ae5=_0x1a83e2-_0x21c81d['startTime'],_0x4a3ac1=Math['floor'](_0x345ae5/_0x21c81d[_0x13e3f3(0x34c)]);return Math[_0x13e3f3(0x23d)](0x0,Math[_0x13e3f3(0x244)](_0x4a3ac1,_0x1ff022));}function renderTimeAxis(_0x1916c8,_0x1574ab){const _0x47d31b=a50_0x36cf24,_0x88f352=Math[_0x47d31b(0x244)](TIMELINE_CONFIG[_0x47d31b(0x2bb)],Math['max'](TIMELINE_CONFIG[_0x47d31b(0x337)],Math[_0x47d31b(0x287)](_0x1574ab/TIMELINE_CONFIG[_0x47d31b(0x29c)]))),_0x1ffae4=_0x1916c8['durationMs']/(_0x88f352-0x1),_0x3b933e=new Date(_0x1916c8[_0x47d31b(0x26d)]),_0x2be26a=[];for(let _0x37b3a3=0x0;_0x37b3a3<_0x88f352;_0x37b3a3++){const _0x401530=_0x1916c8['startTime']+_0x37b3a3*_0x1ffae4,_0x237fa4=timeToPosition(_0x401530,_0x1916c8,_0x1574ab),_0x1847f8=formatTimestamp(_0x401530,_0x3b933e);_0x2be26a['push']({'pos':_0x237fa4,'text':_0x1847f8});}const _0x218992=new Array(_0x1574ab)[_0x47d31b(0x2fe)]('\x20');let _0x65f111=-0x1;for(const {pos:_0x354390,text:_0x268b34}of _0x2be26a){let _0x13436a=Math[_0x47d31b(0x23d)](0x0,_0x354390-Math[_0x47d31b(0x287)](_0x268b34[_0x47d31b(0x272)]/0x2));_0x13436a<=_0x65f111+TIMELINE_CONFIG[_0x47d31b(0x299)]&&(_0x13436a=_0x65f111+TIMELINE_CONFIG[_0x47d31b(0x299)]+0x1);_0x13436a+_0x268b34['length']>_0x1574ab&&(_0x13436a=_0x1574ab-_0x268b34[_0x47d31b(0x272)]);if(_0x13436a>=0x0&&_0x13436a+_0x268b34[_0x47d31b(0x272)]<=_0x1574ab&&_0x13436a>_0x65f111){for(let _0x137b5f=0x0;_0x137b5f<_0x268b34['length'];_0x137b5f++){_0x218992[_0x13436a+_0x137b5f]=_0x268b34[_0x137b5f];}_0x65f111=_0x13436a+_0x268b34[_0x47d31b(0x272)]-0x1;}}return _0x218992[_0x47d31b(0x31f)]('');}function renderTaskRow(_0x5935a6,_0x40a6f2,_0x4b001f,_0x2e6c1c){const _0x47f81a=a50_0x36cf24,{level:_0x4d05b6,name:_0x201d45}=parseTaskName(_0x5935a6['name']),_0x2fb3bf='\x20'[_0x47f81a(0x21d)](_0x4d05b6),_0x21ac98=_0x5935a6[_0x47f81a(0x233)]?'('+formatElapsed(_0x5935a6[_0x47f81a(0x233)][_0x47f81a(0x242)])+')':'',_0x21bca9=stringWidth(_0x21ac98),_0x55a62c=_0x4d05b6*0x1,_0x1e4655=_0x2e6c1c-_0x55a62c-_0x21bca9-0x1,_0x4068e4=truncateTaskName(_0x201d45,_0x1e4655),_0x435f4b=_0x2fb3bf+_0x4068e4,_0x443402=stringWidth(_0x435f4b),_0x595e42=_0x2e6c1c-_0x443402-_0x21bca9,_0x1ed68f=_0x435f4b+'\x20'[_0x47f81a(0x21d)](Math[_0x47f81a(0x23d)](0x1,_0x595e42))+a50_0x2262f3[_0x47f81a(0x329)](_0x21ac98),_0x11542a=getTaskStateIcon(_0x5935a6[_0x47f81a(0x32a)]),_0x3a3c8c=new Array(_0x4b001f)[_0x47f81a(0x2fe)]('\x20');if(_0x5935a6['window']){const _0x29430d=timeToPosition(_0x5935a6[_0x47f81a(0x233)][_0x47f81a(0x2c0)],_0x40a6f2,_0x4b001f),_0x36070c=timeToPosition(_0x5935a6[_0x47f81a(0x233)][_0x47f81a(0x353)],_0x40a6f2,_0x4b001f),_0x155e68=getBarChar(_0x5935a6[_0x47f81a(0x32a)]),_0x3d0624=Math[_0x47f81a(0x23d)](_0x29430d+0x1,_0x36070c);for(let _0x12fa6c=_0x29430d;_0x12fa6c<Math[_0x47f81a(0x244)](_0x3d0624,_0x4b001f);_0x12fa6c++){_0x3a3c8c[_0x12fa6c]=_0x155e68;}}const _0x47cda6=getBarColor(_0x5935a6[_0x47f81a(0x32a)]),_0x1fe70a=_0x3a3c8c['map'](_0x5ecd17=>_0x5ecd17==='\x20'?'\x20':_0x47cda6(_0x5ecd17))[_0x47f81a(0x31f)]('');return _0x11542a+'\x20'+_0x1ed68f+'│'+_0x1fe70a+'│';}function calculateStats(_0x4f48b4){const _0x59c296=a50_0x36cf24,_0x416558={'total':_0x4f48b4[_0x59c296(0x272)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x303c86 of _0x4f48b4){if(_0x303c86['state']===_0x59c296(0x226))_0x416558[_0x59c296(0x226)]++;else{if(_0x303c86[_0x59c296(0x32a)]===_0x59c296(0x26f)||_0x303c86[_0x59c296(0x32a)]===_0x59c296(0x22e))_0x416558['error']++;else _0x303c86[_0x59c296(0x32a)]===_0x59c296(0x2ba)?_0x416558['running']++:_0x416558[_0x59c296(0x308)]++;}}return _0x416558;}function formatStats(_0x5c1763){const _0x455d38=a50_0x36cf24;return[_0x455d38(0x340)+_0x5c1763['total'],'✅\x20'+_0x5c1763[_0x455d38(0x226)],'❌\x20'+_0x5c1763[_0x455d38(0x26f)],_0x455d38(0x32c)+_0x5c1763[_0x455d38(0x2ba)],'⏳\x20'+_0x5c1763[_0x455d38(0x308)]][_0x455d38(0x31f)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a50_0x36cf24(0x2d7)]='workflow:timeline';[a50_0x36cf24(0x266)]=a50_0x36cf24(0x2e8);async[a50_0x36cf24(0x35f)](_0x2535ee){const _0x83106=a50_0x36cf24,{options:_0x3fb4aa,args:_0x1df75d,tdx:_0x3fb9b6}=_0x2535ee;let _0x55e670,_0x438611,_0x334fba=![];if(_0x1df75d[0x0]){if(_0x1df75d[0x0]['includes']('.')){const _0x3669a5=this[_0x83106(0x246)](_0x1df75d,_0x3fb4aa);if(!_0x3669a5)return 0x1;_0x55e670=_0x3669a5['projectName'],_0x438611=_0x3669a5[_0x83106(0x38f)];}else{_0x438611=_0x1df75d[0x0],_0x55e670=_0x3fb4aa[_0x83106(0x325)];if(!_0x55e670)return console[_0x83106(0x26f)](a50_0x2262f3['red']('Error:'),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x334fba=!![];}}else{const _0x1f6c89=this['parseProjectWorkflowPattern'](_0x1df75d,_0x3fb4aa);if(!_0x1f6c89)return 0x1;_0x55e670=_0x1f6c89[_0x83106(0x33a)],_0x438611=_0x1f6c89['workflowName'];}if(_0x3fb4aa[_0x83106(0x279)]){if(_0x55e670&&_0x438611)console[_0x83106(0x26f)](_0x83106(0x37e)+_0x55e670+'.'+_0x438611);else _0x55e670&&console['error'](_0x83106(0x326)+_0x55e670);}const _0x276bb6=_0x3fb4aa['attemptId'],_0x192d58=_0x3fb4aa[_0x83106(0x37b)];if(_0x276bb6){_0x192d58&&console[_0x83106(0x26f)](a50_0x2262f3[_0x83106(0x2ed)](_0x83106(0x270)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x329f36=_0x3fb4aa[_0x83106(0x36d)];return _0x329f36?await this[_0x83106(0x222)](_0x2535ee,_0x276bb6):await this[_0x83106(0x390)](_0x2535ee,_0x276bb6,_0x3fb4aa),0x0;}if(_0x192d58){const _0x1783d5=await withSpinner(_0x83106(0x37d),()=>_0x3fb9b6[_0x83106(0x29f)][_0x83106(0x240)]({'projectName':_0x55e670,'workflowName':_0x438611,'limit':0x64}),{'verbose':_0x3fb4aa['verbose']}),_0xc17abc=_0x1783d5[_0x83106(0x215)][_0x83106(0x2ce)](_0x599e44=>_0x599e44['id']===_0x192d58);if(!_0xc17abc)return console[_0x83106(0x26f)](a50_0x2262f3[_0x83106(0x312)](_0x83106(0x219)),'Session\x20not\x20found:\x20'+_0x192d58),0x1;if(!_0xc17abc[_0x83106(0x342)]?.['id'])return console[_0x83106(0x26f)](a50_0x2262f3[_0x83106(0x312)](_0x83106(0x219)),_0x83106(0x2f9)+_0x192d58+'\x20has\x20no\x20attempts'),0x1;const _0x82fe13=_0xc17abc['lastAttempt']['id'];_0x3fb4aa[_0x83106(0x279)]&&console['error']('Using\x20attempt\x20'+_0x82fe13+_0x83106(0x29e)+_0x192d58);const _0x23c99d=_0x3fb4aa[_0x83106(0x36d)];return _0x23c99d?await this[_0x83106(0x222)](_0x2535ee,_0x82fe13):await this['renderSingleTimeline'](_0x2535ee,_0x82fe13,_0x3fb4aa),0x0;}const _0x20f4dc=await withSpinner(_0x83106(0x362),()=>_0x3fb9b6[_0x83106(0x29f)][_0x83106(0x240)]({'projectName':_0x55e670,'workflowName':_0x438611,'limit':_0x3fb4aa[_0x83106(0x297)]||0x32}),{'verbose':_0x3fb4aa[_0x83106(0x279)]}),_0x4e9488=_0x20f4dc[_0x83106(0x215)];if(_0x4e9488[_0x83106(0x272)]===0x0){if(_0x55e670&&_0x438611)console['error'](_0x83106(0x320)+_0x55e670+'.'+_0x438611);else _0x55e670?console['error']('No\x20sessions\x20found\x20in\x20project:\x20'+_0x55e670):(console['error'](_0x83106(0x2bf)),console['error'](a50_0x2262f3[_0x83106(0x329)](_0x83106(0x1fd))));return 0x0;}_0x4e9488[_0x83106(0x22a)]((_0x14c5ee,_0x36ad82)=>{const _0x23caf2=_0x83106,_0x4c7d9a=_0x14c5ee[_0x23caf2(0x296)]||'',_0x2f69ff=_0x36ad82[_0x23caf2(0x296)]||'';return _0x2f69ff[_0x23caf2(0x2cd)](_0x4c7d9a);});if(_0x3fb4aa['json']||_0x3fb4aa[_0x83106(0x235)])return await handleSDKOutput(_0x4e9488,_0x3fb4aa),0x0;let _0x516848;if(_0x334fba){const _0x536f79=_0x4e9488[0x0];if(!_0x536f79[_0x83106(0x342)]?.['id'])return console[_0x83106(0x26f)](_0x83106(0x214)),0x0;_0x516848=_0x536f79[_0x83106(0x342)]['id'],_0x3fb4aa['verbose']&&console['error'](_0x83106(0x22d)+_0x536f79['sessionTime']);}else{const _0x15bf59=_0x4e9488[_0x83106(0x2e4)](_0x3f8632=>{const _0x2f218f=_0x83106,_0x2beb02=getAttemptStatusDisplay(_0x3f8632[_0x2f218f(0x342)]);return{'title':_0x3f8632[_0x2f218f(0x22b)]?.['name']+'.'+_0x3f8632[_0x2f218f(0x29f)]?.[_0x2f218f(0x2d7)]+_0x2f218f(0x2c4)+_0x3f8632['sessionTime']+'\x20'+_0x2beb02[_0x2f218f(0x28c)],'value':_0x3f8632['lastAttempt']?.['id']||'','description':_0x2beb02[_0x2f218f(0x23a)]};}),_0x3defe0=await a50_0x42cef6({'type':'select','name':_0x83106(0x203),'message':_0x83106(0x227),'choices':_0x15bf59[_0x83106(0x374)](_0x4cde75=>_0x4cde75[_0x83106(0x2c9)]!=='')});if(!_0x3defe0[_0x83106(0x203)])return 0x0;_0x516848=_0x3defe0[_0x83106(0x203)];}const _0x3e42ea=_0x3fb4aa[_0x83106(0x36d)];return _0x3e42ea?await this['pollTimeline'](_0x2535ee,_0x516848):await this[_0x83106(0x390)](_0x2535ee,_0x516848,_0x3fb4aa),0x0;}async[a50_0x36cf24(0x390)](_0x792af,_0x4732e1,_0x151ad0){const _0x32e942=a50_0x36cf24,{tdx:_0x41fa73}=_0x792af;let _0x217852,_0x127b92;try{[_0x217852,_0x127b92]=await Promise[_0x32e942(0x236)]([_0x41fa73[_0x32e942(0x29f)][_0x32e942(0x2a3)](_0x4732e1),_0x41fa73[_0x32e942(0x29f)]['tasks'](_0x4732e1,![])]);}catch(_0x10a3c4){console[_0x32e942(0x26f)](a50_0x2262f3[_0x32e942(0x312)](_0x32e942(0x2d9)));_0x151ad0[_0x32e942(0x279)]&&console[_0x32e942(0x26f)](_0x10a3c4);throw _0x10a3c4;}if(_0x151ad0[_0x32e942(0x280)]||_0x151ad0[_0x32e942(0x235)]){const _0x2ccba2=this[_0x32e942(0x347)](_0x217852,_0x127b92);await handleSDKOutput([_0x2ccba2],_0x151ad0);return;}const _0x5bef16=_0x41fa73[_0x32e942(0x23e)][_0x32e942(0x309)],_0x894fec=this[_0x32e942(0x370)](_0x217852,_0x127b92,_0x5bef16);console[_0x32e942(0x35a)](_0x894fec);}async[a50_0x36cf24(0x222)](_0x6eb318,_0x44fd86){const _0x498996=a50_0x36cf24,{tdx:_0x1b2b1e}=_0x6eb318,_0x375cf0=TIMELINE_CONFIG[_0x498996(0x311)],_0x58e029=TIMELINE_CONFIG[_0x498996(0x310)];let _0x48e28d=0x0;while(_0x48e28d<_0x58e029){process['stdout'][_0x498996(0x351)]&&process[_0x498996(0x333)][_0x498996(0x300)]('\x1bc');let _0xdaf083,_0x5074bc;try{[_0xdaf083,_0x5074bc]=await Promise[_0x498996(0x236)]([_0x1b2b1e[_0x498996(0x29f)][_0x498996(0x2a3)](_0x44fd86),_0x1b2b1e[_0x498996(0x29f)][_0x498996(0x274)](_0x44fd86,![])]);}catch(_0x4202cd){console[_0x498996(0x26f)](a50_0x2262f3['red']('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x48e28d>0x0&&console['error'](a50_0x2262f3[_0x498996(0x329)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x48e28d));throw _0x4202cd;}const _0x2dbf2d=_0x1b2b1e['context']['site'],_0x25a387=this['renderTimeline'](_0xdaf083,_0x5074bc,_0x2dbf2d);console[_0x498996(0x35a)](_0x25a387);const _0x437553=_0xdaf083[_0x498996(0x22f)]&&_0x5074bc[_0x498996(0x20d)](_0x16b2bd=>_0x16b2bd[_0x498996(0x32a)]!=='running'&&_0x16b2bd[_0x498996(0x32a)]!=='planned');if(_0x437553){console[_0x498996(0x26f)](a50_0x2262f3['green'](_0x498996(0x39a)));break;}console['error'](a50_0x2262f3[_0x498996(0x329)](_0x498996(0x26c)+_0x48e28d*0x2+_0x498996(0x369))),await new Promise(_0x28acd2=>setTimeout(_0x28acd2,_0x375cf0)),_0x48e28d++;}_0x48e28d>=_0x58e029&&console[_0x498996(0x26f)](a50_0x2262f3[_0x498996(0x2ed)](_0x498996(0x282)));}['renderTimeline'](_0x4a071d,_0x31825c,_0x1c0d6e){const _0x1d0114=a50_0x36cf24,_0x5dc8b4=[],_0x1d272d=TIMELINE_CONFIG[_0x1d0114(0x27e)],_0x21c6bd=0x5,_0x250204=process[_0x1d0114(0x333)]['columns']||0x78,_0x51420d=_0x250204-_0x1d272d-_0x21c6bd,_0x2811aa=Math[_0x1d0114(0x23d)](TIMELINE_CONFIG[_0x1d0114(0x1fe)],Math[_0x1d0114(0x244)](_0x51420d,TIMELINE_CONFIG[_0x1d0114(0x357)])),_0xfd3f31=new Date(_0x4a071d['createdAt'])[_0x1d0114(0x34f)](),_0x4ebac0=_0x4a071d[_0x1d0114(0x383)]?new Date(_0x4a071d[_0x1d0114(0x383)])[_0x1d0114(0x34f)]():Date[_0x1d0114(0x389)](),_0x418a60={'start':_0xfd3f31,'end':_0x4ebac0,'duration':_0x4ebac0-_0xfd3f31},_0x40c0ba=new Map(),_0x1b58dc=[];for(const _0x471c73 of _0x31825c){if(_0x471c73[_0x1d0114(0x323)]){const _0x41b9c8=new Date(_0x471c73[_0x1d0114(0x323)])[_0x1d0114(0x34f)](),_0x3115cb=_0x471c73['updatedAt']?new Date(_0x471c73[_0x1d0114(0x23b)])[_0x1d0114(0x34f)]():Date['now'](),_0x35e5a3={'start':_0x41b9c8,'end':_0x3115cb,'duration':_0x3115cb-_0x41b9c8};_0x40c0ba[_0x1d0114(0x247)](_0x471c73['id'],_0x35e5a3),_0x1b58dc[_0x1d0114(0x386)]({'name':_0x471c73['fullName'],'state':_0x471c73[_0x1d0114(0x32a)]||'unknown','window':_0x35e5a3});}else _0x1b58dc[_0x1d0114(0x386)]({'name':_0x471c73[_0x1d0114(0x283)],'state':_0x471c73[_0x1d0114(0x32a)]||_0x1d0114(0x2ad),'window':undefined});}_0x1b58dc['sort']((_0x2a48fa,_0x2caca9)=>{const _0x1b892d=_0x1d0114;if(!_0x2a48fa['window'])return 0x1;if(!_0x2caca9[_0x1b892d(0x233)])return-0x1;return _0x2a48fa[_0x1b892d(0x233)][_0x1b892d(0x2c0)]-_0x2caca9[_0x1b892d(0x233)][_0x1b892d(0x2c0)];});const _0x43b4bd=_0x1b58dc[_0x1d0114(0x272)],_0x5a3a1f=_0x43b4bd>TIMELINE_CONFIG[_0x1d0114(0x2ab)];_0x5a3a1f&&_0x1b58dc[_0x1d0114(0x33e)](TIMELINE_CONFIG[_0x1d0114(0x2ab)]);const _0x29953c=calculateTimeScale(_0x418a60,_0x2811aa),_0x10c3f6=_0x4a071d[_0x1d0114(0x22f)]?_0x4a071d[_0x1d0114(0x226)]?a50_0x2262f3['green'](_0x1d0114(0x226)):a50_0x2262f3[_0x1d0114(0x312)](_0x1d0114(0x26f)):a50_0x2262f3[_0x1d0114(0x24f)]('running'),_0x1c9ff0=_0x4a071d[_0x1d0114(0x22b)]?.['id'],_0x464093=_0x4a071d[_0x1d0114(0x37b)];let _0x3d0bdb;if(_0x1c9ff0&&_0x464093){const _0x1134e1=getWorkflowAttemptUrl(_0x1c0d6e,_0x1c9ff0,_0x464093,_0x4a071d['id']);_0x3d0bdb=hyperlink(a50_0x2262f3[_0x1d0114(0x329)](_0x4a071d['id']),_0x1134e1);}else _0x3d0bdb=a50_0x2262f3[_0x1d0114(0x329)](_0x4a071d['id']);_0x5dc8b4['push'](_0x1d0114(0x36c)+_0x3d0bdb+_0x1d0114(0x2c4)+_0x10c3f6+'\x20-\x20'+formatElapsed(_0x418a60[_0x1d0114(0x242)]));if(_0x1b58dc[_0x1d0114(0x272)]>0x0){const _0x15eaa7=renderTimeAxis(_0x29953c,_0x2811aa),_0x7a072f=new Date(_0x418a60[_0x1d0114(0x2c0)]),_0x4eeb8c=formatDate(_0x7a072f),_0x3a8557=TIMELINE_CONFIG[_0x1d0114(0x220)]+TIMELINE_CONFIG['ICON_SPACING']+_0x1d272d,_0x327a43=_0x4eeb8c[_0x1d0114(0x30f)](_0x3a8557),_0x2d2e8d=a50_0x2262f3[_0x1d0114(0x329)](_0x327a43);_0x5dc8b4[_0x1d0114(0x386)](_0x2d2e8d+'\x20'+_0x15eaa7);for(const _0x201f96 of _0x1b58dc){_0x5dc8b4[_0x1d0114(0x386)](renderTaskRow(_0x201f96,_0x29953c,_0x2811aa,_0x1d272d));}const _0xa87076=calculateStats(_0x1b58dc);_0x5dc8b4['push'](formatStats(_0xa87076)),_0x5a3a1f&&_0x5dc8b4[_0x1d0114(0x386)](a50_0x2262f3[_0x1d0114(0x2ed)](_0x1d0114(0x35c)+TIMELINE_CONFIG[_0x1d0114(0x2ab)]+_0x1d0114(0x20e)+_0x43b4bd+_0x1d0114(0x31e))),_0x5dc8b4[_0x1d0114(0x386)](''),_0x5dc8b4[_0x1d0114(0x386)](a50_0x2262f3[_0x1d0114(0x329)](_0x1d0114(0x375))+(_0x1d0114(0x354)+_0x4a071d['id']+'\x20logs')+a50_0x2262f3['dim'](_0x1d0114(0x2f2)));}else _0x5dc8b4['push'](_0x1d0114(0x205));return _0x5dc8b4[_0x1d0114(0x31f)]('\x0a');}['buildTimelineData'](_0x4a37f4,_0x126d98){const _0xb070d2=a50_0x36cf24,_0x182064=new Date(_0x4a37f4[_0xb070d2(0x2d2)])[_0xb070d2(0x34f)](),_0x91afba=_0x4a37f4['finishedAt']?new Date(_0x4a37f4[_0xb070d2(0x383)])[_0xb070d2(0x34f)]():Date[_0xb070d2(0x389)](),_0x14fb0e=_0x91afba-_0x182064,_0x598560=[];for(const _0x124a64 of _0x126d98){if(_0x124a64['startedAt']){const _0x13678d=new Date(_0x124a64[_0xb070d2(0x323)])['getTime'](),_0xcae4c4=_0x124a64['updatedAt']?new Date(_0x124a64[_0xb070d2(0x23b)])[_0xb070d2(0x34f)]():Date[_0xb070d2(0x389)]();_0x598560[_0xb070d2(0x386)]({'name':_0x124a64[_0xb070d2(0x283)],'state':_0x124a64[_0xb070d2(0x32a)]||_0xb070d2(0x35e),'window':{'start':_0x13678d,'end':_0xcae4c4,'duration':_0xcae4c4-_0x13678d}});}else _0x598560[_0xb070d2(0x386)]({'name':_0x124a64[_0xb070d2(0x283)],'state':_0x124a64['state']||'planned','window':undefined});}const _0x5ce17c=calculateStats(_0x598560);return{'attempt':{'id':_0x4a37f4['id'],'status':_0x4a37f4[_0xb070d2(0x22f)]?_0x4a37f4[_0xb070d2(0x226)]?_0xb070d2(0x226):_0xb070d2(0x26f):_0xb070d2(0x2ba),'createdAt':_0x4a37f4[_0xb070d2(0x2d2)],'finishedAt':_0x4a37f4['finishedAt'],'duration_ms':_0x14fb0e},'tasks':_0x598560[_0xb070d2(0x2e4)](_0x4dd0b6=>({'name':_0x4dd0b6[_0xb070d2(0x2d7)],'state':_0x4dd0b6[_0xb070d2(0x32a)],'startedAt':_0x4dd0b6[_0xb070d2(0x233)]?new Date(_0x4dd0b6[_0xb070d2(0x233)][_0xb070d2(0x2c0)])[_0xb070d2(0x2e6)]():null,'updatedAt':_0x4dd0b6[_0xb070d2(0x233)]?new Date(_0x4dd0b6[_0xb070d2(0x233)][_0xb070d2(0x353)])[_0xb070d2(0x2e6)]():null,'duration_ms':_0x4dd0b6['window']?.['duration']||null})),'stats':_0x5ce17c};}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x6b0cc3,_0x14f88f){const _0x2d1f1f=a51_0x2f49,_0x3c86e3=_0x6b0cc3();while(!![]){try{const _0x1b2386=parseInt(_0x2d1f1f(0x1f6))/0x1+parseInt(_0x2d1f1f(0x1fe))/0x2+-parseInt(_0x2d1f1f(0x202))/0x3+parseInt(_0x2d1f1f(0x1fc))/0x4*(-parseInt(_0x2d1f1f(0x1ff))/0x5)+-parseInt(_0x2d1f1f(0x1fb))/0x6+-parseInt(_0x2d1f1f(0x1f9))/0x7+-parseInt(_0x2d1f1f(0x1fa))/0x8*(-parseInt(_0x2d1f1f(0x1f7))/0x9);if(_0x1b2386===_0x14f88f)break;else _0x3c86e3['push'](_0x3c86e3['shift']());}catch(_0x85b2bd){_0x3c86e3['push'](_0x3c86e3['shift']());}}}(a51_0xbcb5,0x34c69));import{platform}from'os';function a51_0xbcb5(){const _0x46c243=['4338xuOBYa',';\x20node/','1352358viFCnZ','2384HhVAQw','836778IVtWuR','8tsXTKP','version','832394LtzddM','431015zsbWPC','tdx/','X-Trino-User','756867sJubAs','TD1\x20','Bearer\x20','length','Authorization','413688aPXPHP'];a51_0xbcb5=function(){return _0x46c243;};return a51_0xbcb5();}import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';function a51_0x2f49(_0x4ddb76,_0x2dd82f){_0x4ddb76=_0x4ddb76-0x1f3;const _0xbcb507=a51_0xbcb5();let _0x2f49da=_0xbcb507[_0x4ddb76];return _0x2f49da;}export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x139e3a=a51_0x2f49,_0x4f2cd8=getVersion(),_0x2b012d=platform(),_0x57c720=process[_0x139e3a(0x1fd)]['replace']('v','');return _0x139e3a(0x200)+_0x4f2cd8+'\x20('+_0x2b012d+_0x139e3a(0x1f8)+_0x57c720+')';}export function getAuthHeaders(_0x2aff43,_0x5a502d,_0x424dc4){const _0x1d8c57=a51_0x2f49,_0x2e1624=getVersion(),_0x40f15c={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x2e1624};if(_0x424dc4)_0x40f15c[_0x1d8c57(0x1f5)]='Bearer\x20'+_0x424dc4;else _0x5a502d&&(_0x40f15c[_0x1d8c57(0x1f5)]=_0x1d8c57(0x203)+_0x5a502d);return _0x40f15c;}export function toHeaderRecord(_0x14e5b3){const _0x43c1b6={};for(const [_0x22a31d,_0x2cebd5]of Object['entries'](_0x14e5b3)){_0x2cebd5!==undefined&&(_0x43c1b6[_0x22a31d]=_0x2cebd5);}return _0x43c1b6;}export function getTrinoHeaders(_0x5de3ad,_0x2812a6,_0x327947){const _0x155e3b=a51_0x2f49,_0x2d1b62=getAuthHeaders(_0x5de3ad),_0x3a88de=toHeaderRecord(_0x2d1b62);if(_0x327947)_0x3a88de[_0x155e3b(0x1f5)]=_0x155e3b(0x1f3)+_0x327947;else _0x2812a6&&(_0x3a88de[_0x155e3b(0x201)]=_0x2812a6);return _0x3a88de;}export function hasAPIKey(_0x22eab2){const _0x3f62dd=a51_0x2f49,_0x38a809=getAPIKey();return _0x38a809!==undefined&&_0x38a809[_0x3f62dd(0x1f4)]>0x0;}
1
+ (function(_0x312c0a,_0x499820){const _0x98a2c0=a51_0x14fb,_0x3ac8fe=_0x312c0a();while(!![]){try{const _0x55b9ed=parseInt(_0x98a2c0(0x16f))/0x1*(-parseInt(_0x98a2c0(0x176))/0x2)+parseInt(_0x98a2c0(0x179))/0x3*(-parseInt(_0x98a2c0(0x16a))/0x4)+-parseInt(_0x98a2c0(0x17e))/0x5*(-parseInt(_0x98a2c0(0x171))/0x6)+-parseInt(_0x98a2c0(0x170))/0x7*(-parseInt(_0x98a2c0(0x177))/0x8)+-parseInt(_0x98a2c0(0x180))/0x9+-parseInt(_0x98a2c0(0x17b))/0xa*(parseInt(_0x98a2c0(0x172))/0xb)+parseInt(_0x98a2c0(0x17f))/0xc*(parseInt(_0x98a2c0(0x178))/0xd);if(_0x55b9ed===_0x499820)break;else _0x3ac8fe['push'](_0x3ac8fe['shift']());}catch(_0x37594a){_0x3ac8fe['push'](_0x3ac8fe['shift']());}}}(a51_0x2eed,0xcc0b1));import{platform}from'os';import{getAPIKey}from'./config.js';function a51_0x2eed(){const _0x510782=['Authorization','tdx/','Bearer\x20','50QuiLRN','112848KKzmCq','2417532HVdStC','2095347nXpWmR','length','11988620tnFHUO',';\x20node/','entries','5EYtaBm','312jTpFSx','14797899WbDnWc','4GOjOmR','TD1\x20','replace','X-Trino-User','tdx','49241GyCotq','245SwFyCN','1677204wmopsL','11doCTIE'];a51_0x2eed=function(){return _0x510782;};return a51_0x2eed();}import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x1a19b3=a51_0x14fb,_0x2f0f62=getVersion(),_0x282337=platform(),_0x18a135=process['version'][_0x1a19b3(0x16c)]('v','');return _0x1a19b3(0x174)+_0x2f0f62+'\x20('+_0x282337+_0x1a19b3(0x17c)+_0x18a135+')';}export function getAuthHeaders(_0x3c8ad2,_0x153d6c,_0x87f55c){const _0x9466a1=a51_0x14fb,_0x3a163b=getVersion(),_0x15bd82={'User-Agent':getUserAgent(),'X-TD-Client':_0x9466a1(0x16e),'X-TD-Client-Version':_0x3a163b};if(_0x87f55c)_0x15bd82[_0x9466a1(0x173)]=_0x9466a1(0x175)+_0x87f55c;else _0x153d6c&&(_0x15bd82[_0x9466a1(0x173)]=_0x9466a1(0x16b)+_0x153d6c);return _0x15bd82;}export function toHeaderRecord(_0x239645){const _0x4a2802=a51_0x14fb,_0x3cb69e={};for(const [_0x242486,_0xc9e6d3]of Object[_0x4a2802(0x17d)](_0x239645)){_0xc9e6d3!==undefined&&(_0x3cb69e[_0x242486]=_0xc9e6d3);}return _0x3cb69e;}function a51_0x14fb(_0x43b7d5,_0x4643f7){_0x43b7d5=_0x43b7d5-0x16a;const _0x2eeda1=a51_0x2eed();let _0x14fb97=_0x2eeda1[_0x43b7d5];return _0x14fb97;}export function getTrinoHeaders(_0x395153,_0x127116,_0x48121d){const _0x4dc6ed=a51_0x14fb,_0x223b94=getAuthHeaders(_0x395153),_0x77607=toHeaderRecord(_0x223b94);if(_0x48121d)_0x77607[_0x4dc6ed(0x173)]='Bearer\x20'+_0x48121d;else _0x127116&&(_0x77607[_0x4dc6ed(0x16d)]=_0x127116);return _0x77607;}export function hasAPIKey(_0x33e455){const _0x4f08f4=a51_0x14fb,_0x183036=getAPIKey();return _0x183036!==undefined&&_0x183036[_0x4f08f4(0x17a)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x396b06,_0x4dc003){const _0xb21e86=a52_0xc254,_0x20300e=_0x396b06();while(!![]){try{const _0x39e16d=parseInt(_0xb21e86(0x17c))/0x1+-parseInt(_0xb21e86(0x179))/0x2*(parseInt(_0xb21e86(0x17f))/0x3)+parseInt(_0xb21e86(0x15d))/0x4+parseInt(_0xb21e86(0x156))/0x5+parseInt(_0xb21e86(0x15a))/0x6+parseInt(_0xb21e86(0x180))/0x7*(-parseInt(_0xb21e86(0x15e))/0x8)+-parseInt(_0xb21e86(0x17a))/0x9*(parseInt(_0xb21e86(0x155))/0xa);if(_0x39e16d===_0x4dc003)break;else _0x20300e['push'](_0x20300e['shift']());}catch(_0x366f30){_0x20300e['push'](_0x20300e['shift']());}}}(a52_0x3844,0xc149c));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a52_0x5d458b from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x2345ff){const _0x204e91=a52_0xc254;return _0x2345ff[_0x204e91(0x18b)]==='json'||_0x2345ff[_0x204e91(0x18b)]===_0x204e91(0x178)||_0x2345ff['format']===_0x204e91(0x14e)||_0x2345ff[_0x204e91(0x18b)]===_0x204e91(0x158)||_0x2345ff[_0x204e91(0x195)]===!![]||_0x2345ff[_0x204e91(0x178)]===!![]||_0x2345ff[_0x204e91(0x14e)]===!![]||_0x2345ff[_0x204e91(0x158)]===!![];}export function parseOutputOptions(_0x53a37f){const _0x50af30=a52_0xc254;return{'format':_0x53a37f['format']||_0x50af30(0x158),'output':_0x53a37f[_0x50af30(0x183)]||'','limit':_0x53a37f[_0x50af30(0x16c)],'limitStructuredFormats':_0x53a37f[_0x50af30(0x182)],'color':_0x53a37f['color'],'noColor':_0x53a37f[_0x50af30(0x153)]};}function convertSDKResultToQueryResult(_0xecddfc){const _0xe94141=a52_0xc254,_0xb47ec4=[];if(_0xecddfc['length']>0x0){const _0x3493c5=_0xecddfc[0x0];for(const [_0x46b6ae,_0x279ab3]of Object[_0xe94141(0x169)](_0x3493c5)){let _0x34e3eb=_0xe94141(0x16b);if(typeof _0x279ab3===_0xe94141(0x198))_0x34e3eb=Number[_0xe94141(0x17d)](_0x279ab3)?_0xe94141(0x176):_0xe94141(0x165);else{if(typeof _0x279ab3===_0xe94141(0x168))_0x34e3eb=_0xe94141(0x168);else _0x279ab3===null&&(_0x34e3eb=_0xe94141(0x16b));}_0xb47ec4[_0xe94141(0x184)]({'name':_0x46b6ae,'type':_0x34e3eb});}}return{'queryId':'sdk-result','columns':_0xb47ec4,'data':_0xecddfc,'stats':{'state':_0xe94141(0x181),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0xecddfc['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x3133cf,_0x4906c3){const _0x6f2576=convertSDKResultToQueryResult(_0x3133cf);return formatQueryOutput(_0x6f2576,_0x4906c3);}export async function formatQueryOutput(_0x135534,_0xf4dc23){const _0x1d5b2c=a52_0xc254,{format:_0x9f1b3f,limit:_0x28a8bd,output:_0x9c39d4,color:_0x497c95,noColor:_0x2e01e9,limitStructuredFormats:_0x30b8f9}=_0xf4dc23,_0x550b65=Boolean(_0x9c39d4)&&!_0x497c95,_0x207bb2={'color':_0x497c95,'noColor':_0x2e01e9||_0x550b65};if(_0x9f1b3f==='table'){const _0x47595f=shouldUseLess(_0x9f1b3f,_0x9c39d4);return formatAsTable(_0x135534,_0x28a8bd,_0x47595f,_0x207bb2);}const _0x15f49f=_0x30b8f9&&Number['isFinite'](_0x28a8bd)&&_0x135534[_0x1d5b2c(0x154)][_0x1d5b2c(0x175)]>_0x28a8bd?{..._0x135534,'data':_0x135534[_0x1d5b2c(0x154)][_0x1d5b2c(0x16a)](0x0,_0x28a8bd)}:_0x135534;if(_0x9f1b3f===_0x1d5b2c(0x195))return formatAsJSON(_0x15f49f,_0x207bb2);else return _0x9f1b3f==='jsonl'?formatAsJSONL(_0x15f49f,_0x207bb2):formatQueryResult(_0x15f49f,_0x9f1b3f);}function shouldUseLess(_0x57889a,_0x52b72c){const _0x6bd7eb=a52_0xc254;return(_0x57889a===_0x6bd7eb(0x158)||_0x57889a==='list')&&process[_0x6bd7eb(0x185)][_0x6bd7eb(0x16f)]&&!_0x52b72c;}export function resolveOutputOptions(_0x32546f){const _0x141ffc=a52_0xc254,_0x12c447=_0x32546f[_0x141ffc(0x183)]||'',_0x54cbab=resolveOutputFormat(_0x32546f['format'],_0x12c447,_0x141ffc(0x158));let _0x2e671b=typeof _0x32546f[_0x141ffc(0x16c)]===_0x141ffc(0x198)?_0x32546f[_0x141ffc(0x16c)]:parseInt(_0x32546f[_0x141ffc(0x16c)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x32546f[_0x141ffc(0x16c)]===undefined&&shouldUseLess(_0x54cbab,_0x12c447)&&(_0x2e671b=Infinity),{'format':_0x54cbab,'output':_0x12c447,'limit':_0x2e671b,'limitStructuredFormats':_0x32546f[_0x141ffc(0x182)],'color':_0x32546f[_0x141ffc(0x188)],'noColor':_0x32546f[_0x141ffc(0x153)]};}export function writeOutput(_0x3de548,_0x3e7f58,_0x3e08fa){const _0x2852c4=a52_0xc254;return _0x3e7f58?(writeFileSync(_0x3e7f58,_0x3de548),console[_0x2852c4(0x172)](_0x2852c4(0x16d)+_0x3e7f58),Promise[_0x2852c4(0x170)]()):shouldUseLess(_0x3e08fa||'','')?new Promise(_0x5981ee=>{const _0x40a573=_0x2852c4,_0x500fec=spawn(_0x40a573(0x173),[_0x40a573(0x164)],{'stdio':[_0x40a573(0x194),_0x40a573(0x163),_0x40a573(0x163)]});let _0x197046=![];_0x500fec['on']('error',()=>{const _0x5b9ffa=_0x40a573;!_0x197046&&(_0x197046=!![],console[_0x5b9ffa(0x151)](_0x3de548),_0x5981ee());}),_0x500fec['on'](_0x40a573(0x174),()=>{!_0x197046&&(_0x197046=!![],_0x5981ee());}),_0x500fec['on'](_0x40a573(0x191),()=>{const _0x428eeb=_0x40a573;!_0x197046&&_0x500fec[_0x428eeb(0x192)]&&(_0x500fec[_0x428eeb(0x192)]['on'](_0x428eeb(0x172),()=>{}),_0x500fec[_0x428eeb(0x192)][_0x428eeb(0x189)](_0x3de548),_0x500fec[_0x428eeb(0x192)][_0x428eeb(0x177)]());}),!_0x500fec[_0x40a573(0x192)]&&(!_0x197046&&(_0x197046=!![],console[_0x40a573(0x151)](_0x3de548),_0x5981ee()));}):(console[_0x2852c4(0x151)](_0x3de548),Promise[_0x2852c4(0x170)]());}export async function handleSDKOutput(_0x92d056,_0x28bb0e){const _0xac564e=a52_0xc254,_0x5c5576=resolveOutputOptions(_0x28bb0e),_0x5dba91=await formatSDKOutput(_0x92d056,_0x5c5576);await writeOutput(_0x5dba91,_0x5c5576[_0xac564e(0x183)]||undefined,_0x5c5576[_0xac564e(0x18b)]);}export async function handleQueryOutput(_0x4d2529,_0x3b0dd9){const _0x2cab3a=a52_0xc254,_0x38d403=resolveOutputOptions(_0x3b0dd9),_0x58abb6=await formatQueryOutput(_0x4d2529,_0x38d403);await writeOutput(_0x58abb6,_0x38d403[_0x2cab3a(0x183)]||undefined,_0x38d403['format']);}async function formatSingleObject(_0x154560,_0x2ee2bf){const _0x2df48f=a52_0xc254,{format:_0x59072a,color:_0x4a67bb,noColor:_0x3aba0b}=_0x2ee2bf,_0x5326a6={'color':_0x4a67bb,'noColor':_0x3aba0b};if(_0x59072a===_0x2df48f(0x195)){if(shouldUseColor(_0x5326a6))return colorizeJSON(_0x154560,_0x5326a6);return JSON[_0x2df48f(0x186)](_0x154560,null,0x2);}else{if(_0x59072a===_0x2df48f(0x178)){if(shouldUseColor(_0x5326a6))return colorizeJSONCompact(_0x154560,_0x5326a6);return JSON[_0x2df48f(0x186)](_0x154560);}else{if(_0x59072a==='tsv')return Object[_0x2df48f(0x169)](_0x154560)[_0x2df48f(0x150)](([_0x19e70c,_0x46a092])=>_0x19e70c+'\x09'+_0x46a092)[_0x2df48f(0x18d)]('\x0a');else{const _0x361f76=Object['entries'](_0x154560);if(_0x361f76[_0x2df48f(0x175)]===0x0)return _0x2df48f(0x166);const _0x401ab9=_0x154560[_0x2df48f(0x196)],_0x4f2390=_0x154560['query'],_0x2abdb2=_0x154560[_0x2df48f(0x14f)],_0x5bc091=_0x154560[_0x2df48f(0x167)],_0x90d065=_0x4f2390?typeof _0x4f2390===_0x2df48f(0x18c)?_0x4f2390:JSON[_0x2df48f(0x186)](_0x4f2390,null,0x2):undefined,_0x3fb319=_0x2abdb2&&Object['keys'](_0x2abdb2)[_0x2df48f(0x175)]>0x0?JSON[_0x2df48f(0x186)](_0x2abdb2,null,0x2):undefined,_0x22c518=_0x5bc091&&Object[_0x2df48f(0x161)](_0x5bc091)['length']>0x0?JSON[_0x2df48f(0x186)](_0x5bc091,null,0x2):undefined,_0x5ab669=_0x361f76[_0x2df48f(0x16e)](([_0x48fb39])=>_0x48fb39!==_0x2df48f(0x196)&&_0x48fb39!==_0x2df48f(0x18e)&&_0x48fb39!==_0x2df48f(0x14f)&&_0x48fb39!==_0x2df48f(0x167)),_0x13f518=Math[_0x2df48f(0x171)](..._0x5ab669[_0x2df48f(0x150)](([_0x1aa86c])=>_0x1aa86c['length'])),_0x3ae161=Math[_0x2df48f(0x171)](..._0x5ab669[_0x2df48f(0x150)](([,_0x1f067a])=>{const _0x1b8a04=_0x2df48f;try{const _0x63de64=_0x1f067a===null||_0x1f067a===undefined?'':typeof _0x1f067a===_0x1b8a04(0x193)?JSON[_0x1b8a04(0x186)](_0x1f067a):String(_0x1f067a),_0x5c181f=_0x63de64[_0x1b8a04(0x17e)]('\x0a');return Math[_0x1b8a04(0x171)](..._0x5c181f['map'](_0x4c07af=>_0x4c07af[_0x1b8a04(0x175)]),0x0);}catch{return 0x0;}}),0x14),_0x24a7aa=[];_0x24a7aa[_0x2df48f(0x184)](colorBorder('┌─'+'─'[_0x2df48f(0x15b)](_0x13f518)+_0x2df48f(0x17b)+'─'[_0x2df48f(0x15b)](_0x3ae161)+'─┐',_0x5326a6)),_0x5ab669['forEach'](([_0x4531db,_0x34e931])=>{const _0x27f541=_0x2df48f;let _0x264d0c;try{_0x264d0c=_0x34e931===null||_0x34e931===undefined?'':typeof _0x34e931===_0x27f541(0x193)?JSON['stringify'](_0x34e931):String(_0x34e931);}catch{_0x264d0c='[Object]';}const _0x2f8322=_0x4531db[_0x27f541(0x157)](_0x13f518),_0x25463e=_0x264d0c['split']('\x0a');_0x25463e[_0x27f541(0x190)]((_0x56d3ca,_0x3d6f6d)=>{const _0x5703de=_0x27f541,_0x5ea974=colorBorder('│',_0x5326a6);_0x3d6f6d===0x0?_0x24a7aa[_0x5703de(0x184)](_0x5ea974+'\x20'+_0x2f8322+'\x20'+_0x5ea974+'\x20'+_0x56d3ca[_0x5703de(0x157)](_0x3ae161)+'\x20'+_0x5ea974):_0x24a7aa[_0x5703de(0x184)](_0x5ea974+'\x20'+'\x20'[_0x5703de(0x15b)](_0x13f518)+'\x20'+_0x5ea974+'\x20'+_0x56d3ca[_0x5703de(0x157)](_0x3ae161)+'\x20'+_0x5ea974);});}),_0x24a7aa['push'](colorBorder('└─'+'─'[_0x2df48f(0x15b)](_0x13f518)+'─┴─'+'─'[_0x2df48f(0x15b)](_0x3ae161)+'─┘',_0x5326a6));_0x90d065&&(_0x24a7aa[_0x2df48f(0x184)](''),_0x24a7aa[_0x2df48f(0x184)](String(a52_0x5d458b['yellow'][_0x2df48f(0x18f)](_0x2df48f(0x197)))),_0x24a7aa['push'](_0x90d065));_0x3fb319&&(_0x24a7aa[_0x2df48f(0x184)](''),_0x24a7aa[_0x2df48f(0x184)](String(a52_0x5d458b[_0x2df48f(0x14d)][_0x2df48f(0x18f)](_0x2df48f(0x18a)))),_0x24a7aa[_0x2df48f(0x184)](_0x3fb319));_0x22c518&&(_0x24a7aa[_0x2df48f(0x184)](''),_0x24a7aa[_0x2df48f(0x184)](String(a52_0x5d458b[_0x2df48f(0x15f)][_0x2df48f(0x18f)]('[rule]'))),_0x24a7aa[_0x2df48f(0x184)](_0x22c518));if(_0x401ab9){if(_0x401ab9[_0x2df48f(0x159)]){_0x24a7aa[_0x2df48f(0x184)](''),_0x24a7aa[_0x2df48f(0x184)](String(a52_0x5d458b[_0x2df48f(0x162)][_0x2df48f(0x18f)]('[error]')));const _0x28c8d7=_0x401ab9[_0x2df48f(0x159)]['split']('\x0a');_0x28c8d7['forEach'](_0x1e4436=>{const _0x51b778=_0x2df48f;_0x1e4436[_0x51b778(0x152)]()&&_0x24a7aa[_0x51b778(0x184)](_0x1e4436);});}if(_0x401ab9[_0x2df48f(0x15c)]){_0x24a7aa[_0x2df48f(0x184)](''),_0x24a7aa['push'](String(a52_0x5d458b[_0x2df48f(0x187)][_0x2df48f(0x18f)](_0x2df48f(0x160))));const _0x367874=_0x401ab9['cmdout'][_0x2df48f(0x17e)]('\x0a');_0x367874['forEach'](_0x5af975=>{const _0xa7ba50=_0x2df48f;_0x5af975[_0xa7ba50(0x152)]()&&_0x24a7aa[_0xa7ba50(0x184)](_0x5af975);});}}return _0x24a7aa[_0x2df48f(0x18d)]('\x0a');}}}}function a52_0x3844(){const _0xe7c16c=['9EGZXTG','─┬─','1188067nbwxWU','isInteger','split','12NqZBAj','28izBniX','FINISHED','limitStructuredFormats','output','push','stdout','stringify','cyan','color','write','[params]','format','string','join','query','bold','forEach','spawn','stdin','object','pipe','json','debug','[query]','number','blue','tsv','params','map','log','trim','noColor','data','20789420XrHjya','3056660rLnnfP','padEnd','table','stderr','9183264fVVRJH','repeat','cmdout','2562316uSCKgp','855544qslgYG','magenta','[logs]','keys','red','inherit','-FXRSn','double','No\x20data','rule','boolean','entries','slice','varchar','limit','Results\x20saved\x20to\x20','filter','isTTY','resolve','max','error','less','close','length','bigint','end','jsonl','336050whXxdV'];a52_0x3844=function(){return _0xe7c16c;};return a52_0x3844();}function a52_0xc254(_0x370d03,_0x5792e0){_0x370d03=_0x370d03-0x14d;const _0x38446e=a52_0x3844();let _0xc25412=_0x38446e[_0x370d03];return _0xc25412;}export async function handleSingleObjectOutput(_0x51d836,_0xc7e202){const _0x29595c=a52_0xc254;if(_0xc7e202[_0x29595c(0x18b)]==='table'){await handleSDKOutput([_0x51d836],_0xc7e202);return;}const _0x35a326=resolveOutputOptions(_0xc7e202),_0x463c02=await formatSingleObject(_0x51d836,_0x35a326);await writeOutput(_0x463c02,_0x35a326['output']||undefined,_0x35a326[_0x29595c(0x18b)]);}
1
+ (function(_0x2b739d,_0x1fbffd){const _0x2d334d=a52_0x2f07,_0x55edf8=_0x2b739d();while(!![]){try{const _0x6514a4=-parseInt(_0x2d334d(0xed))/0x1*(-parseInt(_0x2d334d(0xdf))/0x2)+-parseInt(_0x2d334d(0xee))/0x3*(-parseInt(_0x2d334d(0xe1))/0x4)+parseInt(_0x2d334d(0xd7))/0x5*(parseInt(_0x2d334d(0xd2))/0x6)+-parseInt(_0x2d334d(0xfa))/0x7+parseInt(_0x2d334d(0xc5))/0x8*(parseInt(_0x2d334d(0xb3))/0x9)+parseInt(_0x2d334d(0xb4))/0xa*(parseInt(_0x2d334d(0xbc))/0xb)+-parseInt(_0x2d334d(0xc7))/0xc;if(_0x6514a4===_0x1fbffd)break;else _0x55edf8['push'](_0x55edf8['shift']());}catch(_0x263d2a){_0x55edf8['push'](_0x55edf8['shift']());}}}(a52_0x252f,0x62dcf));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';function a52_0x2f07(_0x3f6060,_0x12296e){_0x3f6060=_0x3f6060-0xb0;const _0x252f1b=a52_0x252f();let _0x2f0737=_0x252f1b[_0x3f6060];return _0x2f0737;}import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a52_0x15dbad from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';function a52_0x252f(){const _0x57a3e3=['varchar','stdin','push','bold','4955314jCouYX','blue','slice','bigint','[error]','657bliCeH','5650AVOIAN','list','─┴─','keys','error','map','resolve','number','12177zdrPff','stderr','cmdout','length','params','filter','format','FINISHED','write','18056Aktsqx','data','1229724zsHXEn','log','[logs]','query','limit','close','sdk-result','double','table','repeat','tsv','69798oRMfEB','trim','forEach','color','output','45dLajoW','boolean','─┬─','yellow','object','noColor','inherit','json','621106yRVAYs','padEnd','176fKjsPw','magenta','rule','pipe','split','[rule]','string','cyan','isTTY','limitStructuredFormats','spawn','-FXRSn','1jkmisQ','672wqILBo','stdout','stringify','max','Results\x20saved\x20to\x20','entries','jsonl','debug'];a52_0x252f=function(){return _0x57a3e3;};return a52_0x252f();}export function isStructuredFormat(_0x9dc69b){const _0x41cf0d=a52_0x2f07;return _0x9dc69b[_0x41cf0d(0xc2)]==='json'||_0x9dc69b[_0x41cf0d(0xc2)]===_0x41cf0d(0xf4)||_0x9dc69b[_0x41cf0d(0xc2)]===_0x41cf0d(0xd1)||_0x9dc69b[_0x41cf0d(0xc2)]===_0x41cf0d(0xcf)||_0x9dc69b[_0x41cf0d(0xde)]===!![]||_0x9dc69b['jsonl']===!![]||_0x9dc69b[_0x41cf0d(0xd1)]===!![]||_0x9dc69b[_0x41cf0d(0xcf)]===!![];}export function parseOutputOptions(_0x42dccf){const _0x1f3bf8=a52_0x2f07;return{'format':_0x42dccf[_0x1f3bf8(0xc2)]||_0x1f3bf8(0xcf),'output':_0x42dccf[_0x1f3bf8(0xd6)]||'','limit':_0x42dccf[_0x1f3bf8(0xcb)],'limitStructuredFormats':_0x42dccf[_0x1f3bf8(0xea)],'color':_0x42dccf['color'],'noColor':_0x42dccf[_0x1f3bf8(0xdc)]};}function convertSDKResultToQueryResult(_0x126457){const _0x489544=a52_0x2f07,_0x21ff0f=[];if(_0x126457[_0x489544(0xbf)]>0x0){const _0x1553d4=_0x126457[0x0];for(const [_0xff5df9,_0x19de34]of Object[_0x489544(0xf3)](_0x1553d4)){let _0x23c138=_0x489544(0xf6);if(typeof _0x19de34===_0x489544(0xbb))_0x23c138=Number['isInteger'](_0x19de34)?_0x489544(0xb1):_0x489544(0xce);else{if(typeof _0x19de34===_0x489544(0xd8))_0x23c138=_0x489544(0xd8);else _0x19de34===null&&(_0x23c138='varchar');}_0x21ff0f[_0x489544(0xf8)]({'name':_0xff5df9,'type':_0x23c138});}}return{'queryId':_0x489544(0xcd),'columns':_0x21ff0f,'data':_0x126457,'stats':{'state':_0x489544(0xc3),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x126457[_0x489544(0xbf)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x2fc747,_0x1c8a6a){const _0x35f489=convertSDKResultToQueryResult(_0x2fc747);return formatQueryOutput(_0x35f489,_0x1c8a6a);}export async function formatQueryOutput(_0x595cd9,_0x51ce0b){const _0x54654e=a52_0x2f07,{format:_0xbabea6,limit:_0x575f78,output:_0x4d3011,color:_0x1f8b05,noColor:_0x3659ba,limitStructuredFormats:_0x4dceef}=_0x51ce0b,_0x2fee9c=Boolean(_0x4d3011)&&!_0x1f8b05,_0x5ef2a2={'color':_0x1f8b05,'noColor':_0x3659ba||_0x2fee9c};if(_0xbabea6===_0x54654e(0xcf)){const _0x11f8f4=shouldUseLess(_0xbabea6,_0x4d3011);return formatAsTable(_0x595cd9,_0x575f78,_0x11f8f4,_0x5ef2a2);}const _0x9dd225=_0x4dceef&&Number['isFinite'](_0x575f78)&&_0x595cd9['data'][_0x54654e(0xbf)]>_0x575f78?{..._0x595cd9,'data':_0x595cd9[_0x54654e(0xc6)][_0x54654e(0xb0)](0x0,_0x575f78)}:_0x595cd9;if(_0xbabea6===_0x54654e(0xde))return formatAsJSON(_0x9dd225,_0x5ef2a2);else return _0xbabea6==='jsonl'?formatAsJSONL(_0x9dd225,_0x5ef2a2):formatQueryResult(_0x9dd225,_0xbabea6);}function shouldUseLess(_0x4e79fa,_0x1f992a){const _0xac74bb=a52_0x2f07;return(_0x4e79fa===_0xac74bb(0xcf)||_0x4e79fa===_0xac74bb(0xb5))&&process[_0xac74bb(0xef)][_0xac74bb(0xe9)]&&!_0x1f992a;}export function resolveOutputOptions(_0x298825){const _0x12e833=a52_0x2f07,_0x59f2c8=_0x298825[_0x12e833(0xd6)]||'',_0x54748a=resolveOutputFormat(_0x298825[_0x12e833(0xc2)],_0x59f2c8,'table');let _0x415dad=typeof _0x298825[_0x12e833(0xcb)]===_0x12e833(0xbb)?_0x298825[_0x12e833(0xcb)]:parseInt(_0x298825['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x298825[_0x12e833(0xcb)]===undefined&&shouldUseLess(_0x54748a,_0x59f2c8)&&(_0x415dad=Infinity),{'format':_0x54748a,'output':_0x59f2c8,'limit':_0x415dad,'limitStructuredFormats':_0x298825[_0x12e833(0xea)],'color':_0x298825[_0x12e833(0xd5)],'noColor':_0x298825['noColor']};}export function writeOutput(_0x482fd6,_0x36a97f,_0x9342cd){const _0x2637b4=a52_0x2f07;return _0x36a97f?(writeFileSync(_0x36a97f,_0x482fd6),console[_0x2637b4(0xb8)](_0x2637b4(0xf2)+_0x36a97f),Promise['resolve']()):shouldUseLess(_0x9342cd||'','')?new Promise(_0x1463cc=>{const _0x3ced90=_0x2637b4,_0x1a79cf=spawn('less',[_0x3ced90(0xec)],{'stdio':[_0x3ced90(0xe4),_0x3ced90(0xdd),_0x3ced90(0xdd)]});let _0x303e33=![];_0x1a79cf['on']('error',()=>{!_0x303e33&&(_0x303e33=!![],console['log'](_0x482fd6),_0x1463cc());}),_0x1a79cf['on'](_0x3ced90(0xcc),()=>{!_0x303e33&&(_0x303e33=!![],_0x1463cc());}),_0x1a79cf['on'](_0x3ced90(0xeb),()=>{const _0x37506e=_0x3ced90;!_0x303e33&&_0x1a79cf[_0x37506e(0xf7)]&&(_0x1a79cf[_0x37506e(0xf7)]['on']('error',()=>{}),_0x1a79cf[_0x37506e(0xf7)][_0x37506e(0xc4)](_0x482fd6),_0x1a79cf[_0x37506e(0xf7)]['end']());}),!_0x1a79cf[_0x3ced90(0xf7)]&&(!_0x303e33&&(_0x303e33=!![],console[_0x3ced90(0xc8)](_0x482fd6),_0x1463cc()));}):(console[_0x2637b4(0xc8)](_0x482fd6),Promise[_0x2637b4(0xba)]());}export async function handleSDKOutput(_0xf8fc0f,_0x47caa7){const _0x29d576=a52_0x2f07,_0x3a7f41=resolveOutputOptions(_0x47caa7),_0x3a1b9f=await formatSDKOutput(_0xf8fc0f,_0x3a7f41);await writeOutput(_0x3a1b9f,_0x3a7f41[_0x29d576(0xd6)]||undefined,_0x3a7f41[_0x29d576(0xc2)]);}export async function handleQueryOutput(_0x1bd5b5,_0xac178e){const _0x4c24dd=a52_0x2f07,_0x5c59f4=resolveOutputOptions(_0xac178e),_0x4a8380=await formatQueryOutput(_0x1bd5b5,_0x5c59f4);await writeOutput(_0x4a8380,_0x5c59f4[_0x4c24dd(0xd6)]||undefined,_0x5c59f4['format']);}async function formatSingleObject(_0x5918f5,_0x15b2e2){const _0x2af78a=a52_0x2f07,{format:_0xa5358c,color:_0xe275cb,noColor:_0x1ae9f2}=_0x15b2e2,_0x99a3a4={'color':_0xe275cb,'noColor':_0x1ae9f2};if(_0xa5358c==='json'){if(shouldUseColor(_0x99a3a4))return colorizeJSON(_0x5918f5,_0x99a3a4);return JSON[_0x2af78a(0xf0)](_0x5918f5,null,0x2);}else{if(_0xa5358c===_0x2af78a(0xf4)){if(shouldUseColor(_0x99a3a4))return colorizeJSONCompact(_0x5918f5,_0x99a3a4);return JSON[_0x2af78a(0xf0)](_0x5918f5);}else{if(_0xa5358c==='tsv')return Object[_0x2af78a(0xf3)](_0x5918f5)[_0x2af78a(0xb9)](([_0x4156fd,_0x5e7535])=>_0x4156fd+'\x09'+_0x5e7535)['join']('\x0a');else{const _0x53617d=Object[_0x2af78a(0xf3)](_0x5918f5);if(_0x53617d[_0x2af78a(0xbf)]===0x0)return'No\x20data';const _0x2bdeac=_0x5918f5['debug'],_0x54b520=_0x5918f5[_0x2af78a(0xca)],_0x338993=_0x5918f5[_0x2af78a(0xc0)],_0x854f3a=_0x5918f5[_0x2af78a(0xe3)],_0x1d4a37=_0x54b520?typeof _0x54b520===_0x2af78a(0xe7)?_0x54b520:JSON['stringify'](_0x54b520,null,0x2):undefined,_0x4d9b0c=_0x338993&&Object[_0x2af78a(0xb7)](_0x338993)[_0x2af78a(0xbf)]>0x0?JSON[_0x2af78a(0xf0)](_0x338993,null,0x2):undefined,_0x1e6e13=_0x854f3a&&Object['keys'](_0x854f3a)['length']>0x0?JSON[_0x2af78a(0xf0)](_0x854f3a,null,0x2):undefined,_0xe178ac=_0x53617d[_0x2af78a(0xc1)](([_0x5b0c08])=>_0x5b0c08!==_0x2af78a(0xf5)&&_0x5b0c08!=='query'&&_0x5b0c08!=='params'&&_0x5b0c08!==_0x2af78a(0xe3)),_0x33a252=Math[_0x2af78a(0xf1)](..._0xe178ac[_0x2af78a(0xb9)](([_0x94fda6])=>_0x94fda6[_0x2af78a(0xbf)])),_0x51d874=Math['max'](..._0xe178ac[_0x2af78a(0xb9)](([,_0x31dab5])=>{const _0x5cb738=_0x2af78a;try{const _0x263a97=_0x31dab5===null||_0x31dab5===undefined?'':typeof _0x31dab5==='object'?JSON['stringify'](_0x31dab5):String(_0x31dab5),_0x45e8ed=_0x263a97[_0x5cb738(0xe5)]('\x0a');return Math[_0x5cb738(0xf1)](..._0x45e8ed[_0x5cb738(0xb9)](_0x418605=>_0x418605[_0x5cb738(0xbf)]),0x0);}catch{return 0x0;}}),0x14),_0x5cbc29=[];_0x5cbc29[_0x2af78a(0xf8)](colorBorder('┌─'+'─'[_0x2af78a(0xd0)](_0x33a252)+_0x2af78a(0xd9)+'─'[_0x2af78a(0xd0)](_0x51d874)+'─┐',_0x99a3a4)),_0xe178ac[_0x2af78a(0xd4)](([_0xa9e00f,_0x5e011f])=>{const _0x20781d=_0x2af78a;let _0x3bbe66;try{_0x3bbe66=_0x5e011f===null||_0x5e011f===undefined?'':typeof _0x5e011f===_0x20781d(0xdb)?JSON[_0x20781d(0xf0)](_0x5e011f):String(_0x5e011f);}catch{_0x3bbe66='[Object]';}const _0x22a5d8=_0xa9e00f[_0x20781d(0xe0)](_0x33a252),_0x1259a6=_0x3bbe66[_0x20781d(0xe5)]('\x0a');_0x1259a6['forEach']((_0x394abf,_0x58ce28)=>{const _0x3ef456=_0x20781d,_0x4d6f15=colorBorder('│',_0x99a3a4);_0x58ce28===0x0?_0x5cbc29[_0x3ef456(0xf8)](_0x4d6f15+'\x20'+_0x22a5d8+'\x20'+_0x4d6f15+'\x20'+_0x394abf[_0x3ef456(0xe0)](_0x51d874)+'\x20'+_0x4d6f15):_0x5cbc29[_0x3ef456(0xf8)](_0x4d6f15+'\x20'+'\x20'[_0x3ef456(0xd0)](_0x33a252)+'\x20'+_0x4d6f15+'\x20'+_0x394abf['padEnd'](_0x51d874)+'\x20'+_0x4d6f15);});}),_0x5cbc29[_0x2af78a(0xf8)](colorBorder('└─'+'─'[_0x2af78a(0xd0)](_0x33a252)+_0x2af78a(0xb6)+'─'['repeat'](_0x51d874)+'─┘',_0x99a3a4));_0x1d4a37&&(_0x5cbc29['push'](''),_0x5cbc29[_0x2af78a(0xf8)](String(a52_0x15dbad[_0x2af78a(0xda)][_0x2af78a(0xf9)]('[query]'))),_0x5cbc29[_0x2af78a(0xf8)](_0x1d4a37));_0x4d9b0c&&(_0x5cbc29['push'](''),_0x5cbc29['push'](String(a52_0x15dbad[_0x2af78a(0xfb)][_0x2af78a(0xf9)]('[params]'))),_0x5cbc29[_0x2af78a(0xf8)](_0x4d9b0c));_0x1e6e13&&(_0x5cbc29[_0x2af78a(0xf8)](''),_0x5cbc29[_0x2af78a(0xf8)](String(a52_0x15dbad[_0x2af78a(0xe2)]['bold'](_0x2af78a(0xe6)))),_0x5cbc29[_0x2af78a(0xf8)](_0x1e6e13));if(_0x2bdeac){if(_0x2bdeac[_0x2af78a(0xbd)]){_0x5cbc29[_0x2af78a(0xf8)](''),_0x5cbc29[_0x2af78a(0xf8)](String(a52_0x15dbad['red'][_0x2af78a(0xf9)](_0x2af78a(0xb2))));const _0x105b02=_0x2bdeac[_0x2af78a(0xbd)][_0x2af78a(0xe5)]('\x0a');_0x105b02[_0x2af78a(0xd4)](_0x43735d=>{const _0x481532=_0x2af78a;_0x43735d[_0x481532(0xd3)]()&&_0x5cbc29[_0x481532(0xf8)](_0x43735d);});}if(_0x2bdeac[_0x2af78a(0xbe)]){_0x5cbc29['push'](''),_0x5cbc29[_0x2af78a(0xf8)](String(a52_0x15dbad[_0x2af78a(0xe8)][_0x2af78a(0xf9)](_0x2af78a(0xc9))));const _0x3c33ce=_0x2bdeac[_0x2af78a(0xbe)]['split']('\x0a');_0x3c33ce[_0x2af78a(0xd4)](_0x32bf7b=>{const _0x5ee316=_0x2af78a;_0x32bf7b[_0x5ee316(0xd3)]()&&_0x5cbc29[_0x5ee316(0xf8)](_0x32bf7b);});}}return _0x5cbc29['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x214e10,_0x2c899b){const _0x269239=a52_0x2f07;if(_0x2c899b['format']===_0x269239(0xcf)){await handleSDKOutput([_0x214e10],_0x2c899b);return;}const _0x42da3e=resolveOutputOptions(_0x2c899b),_0x584055=await formatSingleObject(_0x214e10,_0x42da3e);await writeOutput(_0x584055,_0x42da3e[_0x269239(0xd6)]||undefined,_0x42da3e[_0x269239(0xc2)]);}