@treasuredata/tdx 0.25.8 → 0.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/mcp-command.js +1 -1
  24. package/dist/commands/parent-segment-command.js +1 -1
  25. package/dist/commands/profile-command.js +1 -1
  26. package/dist/commands/profiles-command.js +1 -1
  27. package/dist/commands/query-command.js +1 -1
  28. package/dist/commands/schedule-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/status-command.js +1 -1
  40. package/dist/commands/tables.js +1 -1
  41. package/dist/commands/unset-command.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/command-output.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/constants.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/core/version.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/mcp/server.js +1 -1
  60. package/dist/mcp/tools/index.js +1 -1
  61. package/dist/mcp/tools/tdx-run.js +1 -1
  62. package/dist/mcp/tools/tdx-search.js +1 -1
  63. package/dist/mcp/utils.js +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/passthrough-server.js +1 -1
  66. package/dist/proxy/sse-usage-parser.js +1 -1
  67. package/dist/sdk/agent/agent-config.js +1 -1
  68. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  69. package/dist/sdk/agent/agent-yaml.js +1 -1
  70. package/dist/sdk/agent/test/evaluator.js +1 -1
  71. package/dist/sdk/agent/test/executor.js +1 -1
  72. package/dist/sdk/agent/test/index.js +1 -1
  73. package/dist/sdk/agent/test/output.js +1 -1
  74. package/dist/sdk/agent/test/parser.js +1 -1
  75. package/dist/sdk/api.js +1 -1
  76. package/dist/sdk/client/cdp-api-client.js +1 -1
  77. package/dist/sdk/client/endpoints.js +1 -1
  78. package/dist/sdk/client/engage-api-client.js +1 -1
  79. package/dist/sdk/client/http-client.js +1 -1
  80. package/dist/sdk/client/llm-api-client.js +1 -1
  81. package/dist/sdk/client/rate-limiter.js +1 -1
  82. package/dist/sdk/client/td-api-client.js +1 -1
  83. package/dist/sdk/client/trino-api-client.js +1 -1
  84. package/dist/sdk/client/workflow-client.js +1 -1
  85. package/dist/sdk/connection-validator.js +1 -1
  86. package/dist/sdk/connection.js +1 -1
  87. package/dist/sdk/engage.js +1 -1
  88. package/dist/sdk/errors.js +1 -1
  89. package/dist/sdk/index.js +1 -1
  90. package/dist/sdk/io/index.js +1 -1
  91. package/dist/sdk/io/node-filesystem.js +1 -1
  92. package/dist/sdk/job.js +1 -1
  93. package/dist/sdk/journey.js +1 -1
  94. package/dist/sdk/llm/chat-cache.js +1 -1
  95. package/dist/sdk/llm/index.js +1 -1
  96. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  97. package/dist/sdk/llm/model-factors.js +1 -1
  98. package/dist/sdk/personalization.js +1 -1
  99. package/dist/sdk/query/index.js +1 -1
  100. package/dist/sdk/query/sql-parser.js +1 -1
  101. package/dist/sdk/realtime.js +1 -1
  102. package/dist/sdk/schedule.js +1 -1
  103. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  104. package/dist/sdk/segment/fields-display.js +1 -1
  105. package/dist/sdk/segment/file-discovery.js +1 -1
  106. package/dist/sdk/segment/journey-utils.js +1 -1
  107. package/dist/sdk/segment/journey-validator.js +1 -1
  108. package/dist/sdk/segment/journey-yaml.js +1 -1
  109. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  110. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  111. package/dist/sdk/segment/pull-workflow.js +1 -1
  112. package/dist/sdk/segment/push-recovery.js +1 -1
  113. package/dist/sdk/segment/push-workflow.js +1 -1
  114. package/dist/sdk/segment/resolution-context.js +1 -1
  115. package/dist/sdk/segment/segment-path-parser.js +1 -1
  116. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  117. package/dist/sdk/segment/target-resolution.js +1 -1
  118. package/dist/sdk/segment/tdx-config.js +1 -1
  119. package/dist/sdk/segment/validate-files.js +1 -1
  120. package/dist/sdk/segment/yaml-validator.js +1 -1
  121. package/dist/sdk/segment.js +1 -1
  122. package/dist/sdk/types/index.js +1 -1
  123. package/dist/sdk/types/progress.js +1 -1
  124. package/dist/sdk/user.js +1 -1
  125. package/dist/sdk/util/format-detector.js +1 -1
  126. package/dist/sdk/util/formatters.js +1 -1
  127. package/dist/sdk/util/index.js +1 -1
  128. package/dist/sdk/util/tree-formatter.js +1 -1
  129. package/dist/sdk/workflow/archive-validation.js +1 -1
  130. package/dist/sdk/workflow/clone-workflow.js +1 -1
  131. package/dist/sdk/workflow/index.js +1 -1
  132. package/dist/sdk/workflow/pull-workflow.js +1 -1
  133. package/dist/sdk/workflow/push-workflow.js +1 -1
  134. package/dist/sdk/workflow/tdx-config.js +1 -1
  135. package/dist/sdk/workflow/workflow-utils.js +1 -1
  136. package/dist/test-utils/command-runner.js +1 -1
  137. package/dist/test-utils/factories.js +1 -1
  138. package/dist/test-utils/fixtures.js +1 -1
  139. package/dist/test-utils/http-mock.js +1 -1
  140. package/dist/test-utils/index.js +1 -1
  141. package/dist/utils/async.js +1 -1
  142. package/dist/utils/colors.js +1 -1
  143. package/dist/utils/diff.js +1 -1
  144. package/dist/utils/file-permissions.js +1 -1
  145. package/dist/utils/global-cache.js +1 -1
  146. package/dist/utils/json-loader.js +1 -1
  147. package/dist/utils/local-cache.d.ts +2 -1
  148. package/dist/utils/local-cache.d.ts.map +1 -1
  149. package/dist/utils/local-cache.js +1 -1
  150. package/dist/utils/local-cache.js.map +1 -1
  151. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  152. package/dist/utils/logger/formatters/index.js +1 -1
  153. package/dist/utils/logger/handlers/console-handler.js +1 -1
  154. package/dist/utils/logger/handlers/file-handler.js +1 -1
  155. package/dist/utils/logger/handlers/index.js +1 -1
  156. package/dist/utils/logger/handlers/null-handler.js +1 -1
  157. package/dist/utils/logger/index.js +1 -1
  158. package/dist/utils/logger/logger.js +1 -1
  159. package/dist/utils/logger/types.js +1 -1
  160. package/dist/utils/option-validation.js +1 -1
  161. package/dist/utils/port.js +1 -1
  162. package/dist/utils/process.js +1 -1
  163. package/dist/utils/prompt.js +1 -1
  164. package/dist/utils/spinner.js +1 -1
  165. package/dist/utils/sse-parser.js +1 -1
  166. package/dist/utils/string-utils.js +1 -1
  167. package/dist/utils/table-ref-parser.js +1 -1
  168. package/dist/utils/tdx-logger.js +1 -1
  169. package/dist/utils/version-check.js +1 -1
  170. package/package.json +1 -1
@@ -1 +1 @@
1
- const a42_0x594cc1=a42_0x3b61;(function(_0x2277ed,_0x4603cc){const _0x5ae2a3=a42_0x3b61,_0x53f8a2=_0x2277ed();while(!![]){try{const _0x8f475=parseInt(_0x5ae2a3(0x20f))/0x1+-parseInt(_0x5ae2a3(0x1d8))/0x2+parseInt(_0x5ae2a3(0x2fa))/0x3*(-parseInt(_0x5ae2a3(0x34a))/0x4)+-parseInt(_0x5ae2a3(0x1cc))/0x5+-parseInt(_0x5ae2a3(0x273))/0x6+-parseInt(_0x5ae2a3(0x2f9))/0x7+parseInt(_0x5ae2a3(0x21c))/0x8;if(_0x8f475===_0x4603cc)break;else _0x53f8a2['push'](_0x53f8a2['shift']());}catch(_0x366c06){_0x53f8a2['push'](_0x53f8a2['shift']());}}}(a42_0x3a7d,0x2aaa2));import a42_0x20b7b8 from'chalk';import{existsSync}from'fs';import a42_0xcdeb1c from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';function a42_0x3b61(_0x97e509,_0x3d5466){_0x97e509=_0x97e509-0x1b2;const _0x3a7d55=a42_0x3a7d();let _0x3b61f3=_0x3a7d55[_0x97e509];return _0x3b61f3;}function a42_0x3a7d(){const _0x804b81=['No\x20workflow\x20tdx.json\x20found','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Filter:\x20project=','value','\x20logs','No\x20attempts\x20found\x20for:\x20','\x20secret','Loading\x20workflows...','preparePushProject','\x20is\x20not\x20a\x20directory','Using\x20attempt\x20','splice','No\x20workflows\x20found','No\x20attempts\x20found','cwd','stdout','Error:\x20Project\x20name\x20is\x20required','Cancelled','cyan','\x0aDry\x20run\x20-\x20no\x20project\x20created','workflow','Auto-selected\x20latest\x20session:\x20','summary','getHours','Source\x20project:\x20','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','\x0aDry\x20run\x20-\x20no\x20files\x20written','now','renderTimeline','\x20\x20Revision:\x20','\x1b[1A\x1b[2K','site','limit','modified','\x20attempt','output','startTime','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Key\x20cannot\x20be\x20empty','toISOString','floor','\x20\x20Target:\x20','Invalid\x20format:\x20','pollTimeline','List\x20workflow\x20attempts','resumeFrom','✔\x20Pushed\x20','isDirectory','filter','\x0aApply\x20these\x20changes?','workflow:secrets:set','match','every','MAX_TASKS_DISPLAY','Getting\x20attempt\x20details...','No\x20matching\x20sessions\x20found','Source:\x20','List\x20all\x20workflow\x20projects','context','stat','status','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','ICON_SPACING','isTTY','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','sessionTime','filesExtracted','Pushing\x20workflow\x20project...','get','workflow:logs','\x20workflow','end','workflow:upload','resolveProject','join','data','Project:\x20','map','Show\x20logs\x20for\x20a\x20workflow\x20attempt','finishedAt','Error:','✔\x20Project\x20updated','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','ICON_WIDTH','localeCompare','\x20\x20Workflow:\x20','path','Deleting\x20secret...','No\x20sessions\x20found\x20in\x20project:\x20','getDate','Select\x20a\x20task\x20to\x20view\x20logs:','includes','Key:\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','msPerChar','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','deleted','\x20new','project','relative','some','generateSessionTimelineRows','createdAt','attempt','renderSessionsTimeline','workflow:run','session_id','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','renderSingleTimeline','Usage:\x20tdx\x20wf\x20use\x20<project>','tasks','Source\x20directory:\x20','.\x20Expected\x20format:\x20KEY=VALUE','revision','LABEL_WIDTH_DIVISOR','split','attemptId','targetExists','\x20unchanged','fullName','yes','MIN_LABEL_COUNT','Expected\x20format:\x20--param\x20key=value','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','Usage:\x20workflow:delete\x20<project-name-or-id>','includeSubtasks','Failed\x20to\x20fetch\x20attempt\x20data','🔄\x20','includeRetried','/app/workflows/','770042UcsDfU','183033lfhiYM','keys','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','applyPullProject','json','\x20\x20tdx\x20wf\x20use\x20<project>','Status:\x20','workflow:secrets:delete','basename','MIN_TIMELINE_WIDTH','revision:\x20','skipValidation','changes','isNewProject','projectName','metadata','✔\x20Showing\x20','Filter:\x20','size','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','icon','\x20(system)','workflow:use','substring','pending','\x20-\x20','follow','durationMs','Start\x20a\x20workflow\x20run','red','No\x20workflow\x20projects\x20found','Listing\x20workflow\x20sessions...','sort','MAX_LABEL_COUNT','Show\x20tasks\x20for\x20an\x20attempt','duration','Loading\x20sessions...','\x0a✔\x20No\x20changes\x20to\x20push','navigateSessionsInteractive','\x27...','workflowName','verbose','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','from','error','\x22\x20with\x20new\x20revision?','utf-8','execute','-\x20no\x20files\x20written','done','targetDir','workflow:workflows','No\x20workflows\x20found\x20in\x20project:\x20','Writing\x20files...','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x20\x20Source:\x20','workflow:secrets:list','Target\x20directory:\x20','sessions','executePushProject','jsonl','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','max','showWorkflowConsoleUrl','sessionId','Validation:\x20skipped','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','executeCloneProject','success','getFullYear','canceling','retryAttempt','✔\x20Clone\x20complete','workflow:kill','POLL_INTERVAL_MS','GUTTER','force','Files\x20to\x20upload:\x20','set','12evksRg','fs/promises','select','param','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','find','padStart','parseProjectWorkflowPattern','Warning:','pullProject','format','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','\x20has\x20no\x20attempts','logs','Task\x20name:\x20','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','length','\x27\x20from\x20project\x20\x27','getMinutes','green','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','\x20sessions\x20','workflow:projects','state','log','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Error:\x20Invalid\x20parameter\x20format:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','Source\x20directory\x20is\x20required','506135GyqkpB','buildTimelineData','has','deleteSecret','→\x20Project:\x20','✔\x20Retry\x20started','Downloading\x20project\x20','\x20of\x20','\x20\x20Session\x20ID:\x20','Force:\x20yes','Pattern:\x20','projectId','221680eskxRq','total','retryAttemptName','lastAttempt','reason','trimEnd','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','attempt:','Pulling\x20project\x20','group_error','workflows','Project\x20name\x20is\x20required','No\x20log\x20files\x20found\x20for\x20this\x20attempt','rows','⚠\x20Showing\x20first\x20','fileSize','sourceProjectName','hasChanges','kill','Cloning\x20to\x20','\x20\x20Console:\x20','Killing\x20attempt...','✔\x20Workflow\x20project\x20context\x20cleared.','Dry\x20run:\x20yes','fromTask','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','dim','repeat','\x20\x20Location:\x20','resolveProjectId','list','startsWith','newProjectName','/sessions/','\x0aPush\x20these\x20changes?','Target:\x20','Reason:\x20','unchanged','min','description','\x20(use\x20--limit\x20to\x20show\x20more)','---\x20','window','Fetching\x20log\x20files...','Pushing\x20project...','Retry\x20a\x20session\x20or\x20attempt','workflow:download','\x20\x20Session\x20context\x20set\x20to:\x20','✔\x20Downloaded\x20','name','resolve','No\x20log\x20content\x20found','key','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','attempts','61660RUysEh','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','trim','cancelRequested','\x20deleted','Revision:\x20','Deleting\x20project\x20','\x0aPolling...\x20(','Error:\x20KEY=VALUE\x20is\x20required','workflow:pull','write','Select\x20a\x20session\x20to\x20view\x20timeline:','5976560Aczyac','✔\x20Deleted\x20project\x20','startedAt','No\x20projects\x20match\x20pattern:\x20','No\x20sessions\x20found\x20for:\x20','task','✔\x20Secret\x20\x27','resolveProjectDir','✔\x20Workflow\x20run\x20started','\x0aError:','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Listing\x20workflows...','Error:\x20Invalid\x20JSON\x20in\x20--params','logFiles','getMonth','run','Downloading\x20logs...','Retrying\x20attempt...','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','workflow:delete','-\x20nothing\x20pushed','\x20modified','autocomplete','sourceDir','\x20\x20Changes:\x20','fill','→\x20New\x20project:\x20','Parameters:\x20','Attempt\x20ID:\x20','Session\x20','/attempt/','\x20task','✔\x20Workflow\x20project\x20set\x20to:\x20','blue','LABEL_MIN_SPACING','type','parse','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','📁\x20','slice','Tip:\x20cd\x20to\x20workflows/','running','Starting\x20workflow\x20run...','start','new','Listing\x20secrets...','\x20\x20Project\x20ID:\x20','Retrying\x20session...','workflow:clone','List\x20workflows','diff','index','requireProject','Project\x20name:\x20','getTime','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','text','Listing\x20workflow\x20attempts...','params','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','\x20from\x20session\x20','Error:\x20Secret\x20key\x20is\x20required','yellow','tdx.json','\x0aClone\x20\x22','updatedAt','indexOf','(use\x20--limit\x20to\x20see\x20more)','table','workflow:retry','No\x20sessions\x20with\x20timing\x20information','New\x20project\x20name:\x20','\x0a✔\x20Attempt\x20complete','✔\x20Found\x20','✔\x20Pull\x20complete','session','message','dryRun','push','prepareCloneProject','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','workflowProject','...','Error:\x20Attempt\x20ID\x20is\x20required','\x20\x20New\x20attempt\x20ID:\x20','workflow:attempt','toLowerCase','773220mkYnQF','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','projects'];a42_0x3a7d=function(){return _0x804b81;};return a42_0x3a7d();}import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a42_0x5b9160 from'prompts';function getAttemptStatusDisplay(_0x1f03a4){const _0x168674=a42_0x3b61;if(!_0x1f03a4)return{'icon':'⏳','text':''};const {done:_0x44dca7,success:_0x3e8366,cancelRequested:_0xfe143b}=_0x1f03a4;if(!_0x44dca7)return _0xfe143b?{'icon':'🛑','text':a42_0x20b7b8[_0x168674(0x25a)](_0x168674(0x341))}:{'icon':'🔄','text':a42_0x20b7b8[_0x168674(0x23d)](_0x168674(0x245))};if(_0x3e8366)return{'icon':'✅','text':a42_0x20b7b8[_0x168674(0x1c2)](_0x168674(0x33f))};return{'icon':'❌','text':a42_0x20b7b8[_0x168674(0x317)](_0x168674(0x326))};}export class WorkflowBaseCommand extends BaseCommand{[a42_0x594cc1(0x2c0)](_0x2fac16,_0xabf629,_0x2b5435=0x0){const _0x9b4c24=a42_0x594cc1;return _0x2fac16[_0x2b5435]||_0xabf629[_0x9b4c24(0x26d)];}[a42_0x594cc1(0x250)](_0x57bdeb,_0x2add42,_0x315826=0x0){const _0x1ac651=a42_0x594cc1,_0x29062b=this[_0x1ac651(0x2c0)](_0x57bdeb,_0x2add42,_0x315826);if(!_0x29062b)return console[_0x1ac651(0x326)](a42_0x20b7b8[_0x1ac651(0x317)](_0x1ac651(0x2c7)),'Project\x20name\x20is\x20required'),console[_0x1ac651(0x326)](a42_0x20b7b8[_0x1ac651(0x1f2)](_0x1ac651(0x20d))),null;return _0x29062b;}['parseProjectWorkflowPattern'](_0x279942,_0x2d1603){const _0x55d97a=a42_0x594cc1;if(_0x279942[0x0]){const _0x55edfd=_0x279942[0x0]['split']('.');if(_0x55edfd[_0x55d97a(0x1bf)]===0x1)return{'projectName':_0x55edfd[0x0],'workflowName':undefined};else return _0x55edfd[_0x55d97a(0x1bf)]===0x2?{'projectName':_0x55edfd[0x0],'workflowName':_0x55edfd[0x1]}:(console['error'](a42_0x20b7b8['red'](_0x55d97a(0x2c7)),_0x55d97a(0x2d4)),null);}return{'projectName':_0x2d1603[_0x55d97a(0x26d)],'workflowName':undefined};}['resolveProjectDir'](_0x39467d,_0x21991f,_0x5829ff=0x0){const _0x18842b=a42_0x594cc1;if(_0x39467d[_0x5829ff])return _0x39467d[_0x5829ff];if(_0x21991f[_0x18842b(0x26d)]){const _0x4003f7=a42_0xcdeb1c[_0x18842b(0x2c1)](process[_0x18842b(0x284)](),'workflows',_0x21991f[_0x18842b(0x26d)]);if(existsSync(a42_0xcdeb1c['join'](_0x4003f7,_0x18842b(0x25b))))return _0x4003f7;}return undefined;}async['showWorkflowConsoleUrl'](_0x14ad71,_0x1f4b41,_0x42845e){const _0x3ea9a9=a42_0x594cc1;try{const _0x5e9dec=await _0x14ad71[_0x3ea9a9(0x28a)][_0x3ea9a9(0x1e2)](_0x1f4b41,{'limit':0x1});if(_0x5e9dec['length']>0x0){const _0x4d885e=_0x5e9dec[0x0]['id'],_0x11c747=getWorkflowUrl(_0x42845e,_0x4d885e);console[_0x3ea9a9(0x326)](_0x3ea9a9(0x1ec)+a42_0x20b7b8[_0x3ea9a9(0x288)](_0x11c747));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a42_0x594cc1(0x209)]=a42_0x594cc1(0x310);['description']='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async[a42_0x594cc1(0x329)](_0x3033a2){const _0x23dc78=a42_0x594cc1,{options:_0x360d1e,args:_0x119da4,tdx:_0x2eccf2}=_0x3033a2,_0x4ba7a2=_0x119da4[0x0],_0x3d1f4f=_0x360d1e['clear'];if(_0x3d1f4f)return saveSessionContext({'workflow_project':undefined},_0x360d1e['session']),console['log'](a42_0x20b7b8['green'](_0x23dc78(0x1ee))),0x0;if(!_0x4ba7a2)return console['error'](a42_0x20b7b8['red'](_0x23dc78(0x2c7)),_0x23dc78(0x1e3)),console[_0x23dc78(0x326)](a42_0x20b7b8['dim'](_0x23dc78(0x2e4))),console['error'](a42_0x20b7b8[_0x23dc78(0x1f2)](_0x23dc78(0x1ba))),0x1;const _0x484ab9=await withSpinner('Resolving\x20project\x20\x27'+_0x4ba7a2+_0x23dc78(0x321),()=>_0x2eccf2[_0x23dc78(0x28a)][_0x23dc78(0x1f5)](_0x4ba7a2),{'verbose':_0x360d1e[_0x23dc78(0x323)]}),{name:_0x763ced}=_0x484ab9[_0x23dc78(0x2c2)];return saveSessionContext({'workflow_project':_0x763ced},_0x360d1e[_0x23dc78(0x267)]),console[_0x23dc78(0x1c7)](a42_0x20b7b8['green'](_0x23dc78(0x23c)+a42_0x20b7b8[_0x23dc78(0x288)](_0x763ced))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a42_0x594cc1(0x209)]=a42_0x594cc1(0x1c5);[a42_0x594cc1(0x1ff)]=a42_0x594cc1(0x2b0);async[a42_0x594cc1(0x329)](_0x46ff2b){const _0x47fa77=a42_0x594cc1,{options:_0x1d877b,args:_0xf74716,tdx:_0x307ec2}=_0x46ff2b,_0x473c9a=_0xf74716[0x0];_0x1d877b[_0x47fa77(0x323)]&&_0x473c9a&&console['error'](_0x47fa77(0x1d6)+_0x473c9a);const _0x14e293=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x307ec2[_0x47fa77(0x28a)][_0x47fa77(0x275)](_0x473c9a,{'limit':_0x1d877b[_0x47fa77(0x296)]}),{'verbose':_0x1d877b[_0x47fa77(0x323)]});let _0x4735ad=_0x14e293[_0x47fa77(0x2c2)];_0x4735ad[_0x47fa77(0x31a)]((_0x1f6047,_0x59670e)=>_0x1f6047['name'][_0x47fa77(0x2cb)](_0x59670e[_0x47fa77(0x209)]));const _0x2274cf=_0x1d877b[_0x47fa77(0x296)]||0x64,_0x1fdb25=_0x4735ad['length']>=_0x2274cf?a42_0x20b7b8[_0x47fa77(0x1f2)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x47fa77(0x326)](_0x47fa77(0x265)+_0x4735ad[_0x47fa77(0x1bf)]+'\x20project'+(_0x4735ad[_0x47fa77(0x1bf)]!==0x1?'s':'')+_0x1fdb25);if(_0x1d877b[_0x47fa77(0x1b9)]===_0x47fa77(0x2fe)||_0x1d877b[_0x47fa77(0x1b9)]===_0x47fa77(0x336)||_0x1d877b[_0x47fa77(0x1b9)]==='table')await handleSDKOutput(_0x4735ad,_0x1d877b);else{if(_0x4735ad[_0x47fa77(0x1bf)]===0x0)_0x473c9a?console[_0x47fa77(0x1c7)](_0x47fa77(0x21f)+_0x473c9a):console[_0x47fa77(0x1c7)](_0x47fa77(0x318));else{const _0x42d17c=_0x4735ad[_0x47fa77(0x2c4)](_0x32389b=>{const _0x5e45ab=_0x47fa77,_0x574424=_0x32389b[_0x5e45ab(0x309)]?.[_0x5e45ab(0x2db)](_0x11b5ce=>_0x11b5ce[_0x5e45ab(0x20c)]==='sys'),_0x27f1c8=_0x574424?a42_0x20b7b8[_0x5e45ab(0x1f2)](_0x5e45ab(0x30f)):'';return _0x5e45ab(0x242)+_0x32389b['name']+_0x27f1c8;});await writeOutput(_0x42d17c[_0x47fa77(0x2c1)]('\x0a'),_0x1d877b[_0x47fa77(0x299)],_0x47fa77(0x1f6));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a42_0x594cc1(0x209)]=a42_0x594cc1(0x32d);['description']=a42_0x594cc1(0x24d);async[a42_0x594cc1(0x329)](_0x41d813){const _0x25872a=a42_0x594cc1,{options:_0x5198c4,args:_0x27ab2a,tdx:_0x297f26}=_0x41d813,_0x39b470=this[_0x25872a(0x2c0)](_0x27ab2a,_0x5198c4);_0x5198c4[_0x25872a(0x323)]&&_0x39b470&&console[_0x25872a(0x326)]('Project\x20filter:\x20'+_0x39b470);const _0x1f1e3e=await withSpinner(_0x25872a(0x227),()=>_0x297f26[_0x25872a(0x28a)][_0x25872a(0x1e2)](_0x39b470,{'limit':_0x5198c4[_0x25872a(0x296)]}),{'verbose':_0x5198c4[_0x25872a(0x323)]});let _0x34cd8d=_0x1f1e3e['data'];_0x34cd8d[_0x25872a(0x31a)]((_0x59e994,_0x300ca4)=>{const _0x4f72d4=_0x25872a,_0x478bea=_0x59e994[_0x4f72d4(0x209)]['localeCompare'](_0x300ca4[_0x4f72d4(0x209)]);if(_0x478bea!==0x0)return _0x478bea;return(_0x59e994[_0x4f72d4(0x2d9)]?.[_0x4f72d4(0x209)]||'')[_0x4f72d4(0x2cb)](_0x300ca4['project']?.[_0x4f72d4(0x209)]||'');});const _0x268be2=_0x5198c4[_0x25872a(0x296)]||0x64,_0x1833e2=_0x34cd8d['length']>=_0x268be2?a42_0x20b7b8[_0x25872a(0x1f2)](_0x25872a(0x200)):'';console[_0x25872a(0x326)]('✔\x20Found\x20'+_0x34cd8d[_0x25872a(0x1bf)]+_0x25872a(0x2bd)+(_0x34cd8d[_0x25872a(0x1bf)]!==0x1?'s':'')+_0x1833e2);if(_0x5198c4[_0x25872a(0x1b9)]===_0x25872a(0x2fe)||_0x5198c4[_0x25872a(0x1b9)]===_0x25872a(0x336)||_0x5198c4[_0x25872a(0x1b9)]===_0x25872a(0x260))await handleSDKOutput(_0x34cd8d,_0x5198c4);else{if(_0x34cd8d[_0x25872a(0x1bf)]===0x0)_0x39b470?console[_0x25872a(0x1c7)](_0x25872a(0x32e)+_0x39b470):console['log'](_0x25872a(0x282));else{const _0x3bcad9=_0x5198c4['site'],_0x38f3c5=_0x34cd8d[_0x25872a(0x2c4)](_0x4a4345=>{const _0xeaee37=_0x25872a,_0x383273=a42_0x20b7b8[_0xeaee37(0x1f2)]('#'+_0x4a4345['id']),_0x51c52e=hyperlink(_0x383273,getWorkflowUrl(_0x3bcad9,_0x4a4345['id'])),_0x39c851=_0x4a4345[_0xeaee37(0x2d9)]?.[_0xeaee37(0x209)]?a42_0x20b7b8[_0xeaee37(0x1f2)]('\x20('+_0x4a4345[_0xeaee37(0x2d9)]['name']+')'):'';return'📋\x20'+_0x51c52e+'\x20'+_0x4a4345[_0xeaee37(0x209)]+_0x39c851;});await writeOutput(_0x38f3c5[_0x25872a(0x2c1)]('\x0a'),_0x5198c4['output'],_0x25872a(0x1f6));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a42_0x594cc1(0x209)]='workflow:sessions';[a42_0x594cc1(0x1ff)]='List\x20workflow\x20execution\x20sessions';async[a42_0x594cc1(0x329)](_0x27e695){const _0x3b762e=a42_0x594cc1,{options:_0xfc06ce,args:_0x4013b4,tdx:_0x5e06cc}=_0x27e695,_0x58df35=this[_0x3b762e(0x1b6)](_0x4013b4,_0xfc06ce);if(!_0x58df35)return 0x1;const {projectName:_0x3dc47c,workflowName:_0x1f6b1b}=_0x58df35;if(_0xfc06ce[_0x3b762e(0x323)]){if(_0x3dc47c&&_0x1f6b1b)console['error'](_0x3b762e(0x30b)+_0x3dc47c+'.'+_0x1f6b1b);else _0x3dc47c&&console['error']('Filter:\x20project='+_0x3dc47c);const _0x40d78e=_0xfc06ce[_0x3b762e(0x2b3)];_0x40d78e&&console[_0x3b762e(0x326)](_0x3b762e(0x300)+_0x40d78e);}let _0x34e582=0x28;if(process[_0x3b762e(0x285)][_0x3b762e(0x2b6)]&&!_0xfc06ce[_0x3b762e(0x299)]&&!_0xfc06ce[_0x3b762e(0x1b9)]){const _0x1148e3=process['stdout'][_0x3b762e(0x1e5)]||0x28;_0x34e582=Math['max'](0x14,Math[_0x3b762e(0x29f)](_0x1148e3*0x2/0x3));}const _0x107f2e=_0xfc06ce[_0x3b762e(0x296)]||_0x34e582,_0x321261=await withSpinner(_0x3b762e(0x319),()=>_0x5e06cc['workflow']['sessions']({'projectName':_0x3dc47c,'workflowName':_0x1f6b1b,'status':_0xfc06ce['status'],'fromTime':_0xfc06ce[_0x3b762e(0x325)],'toTime':_0xfc06ce['to'],'limit':_0x107f2e}),{'verbose':_0xfc06ce[_0x3b762e(0x323)]}),_0x32db02=_0x321261[_0x3b762e(0x2c2)];_0x32db02[_0x3b762e(0x31a)]((_0xb4941d,_0xe1c15a)=>{const _0x30c49d=_0x3b762e,_0x216718=_0xb4941d[_0x30c49d(0x2b8)]||'',_0x10ba6d=_0xe1c15a[_0x30c49d(0x2b8)]||'';return _0x10ba6d[_0x30c49d(0x2cb)](_0x216718);});_0x32db02['length']>=_0x107f2e?console[_0x3b762e(0x326)](_0x3b762e(0x30a)+_0x32db02[_0x3b762e(0x1bf)]+_0x3b762e(0x1c4)+a42_0x20b7b8[_0x3b762e(0x1f2)](_0x3b762e(0x25f))):console[_0x3b762e(0x326)](_0x3b762e(0x265)+_0x32db02['length']+'\x20session'+(_0x32db02[_0x3b762e(0x1bf)]!==0x1?'s':''));if(_0xfc06ce['format']===_0x3b762e(0x2fe)||_0xfc06ce[_0x3b762e(0x1b9)]==='jsonl'||_0xfc06ce[_0x3b762e(0x1b9)]==='table')await handleSDKOutput(_0x32db02,_0xfc06ce);else{if(!process[_0x3b762e(0x285)][_0x3b762e(0x2b6)]||_0xfc06ce[_0x3b762e(0x299)]){if(_0x32db02['length']===0x0){if(_0x3dc47c&&_0x1f6b1b)console[_0x3b762e(0x1c7)](_0x3b762e(0x220)+_0x3dc47c+'.'+_0x1f6b1b);else _0x3dc47c?console['log'](_0x3b762e(0x2cf)+_0x3dc47c):console[_0x3b762e(0x1c7)]('No\x20sessions\x20found');}else{const _0x27c110=_0xfc06ce[_0x3b762e(0x295)],_0x5c659c=this[_0x3b762e(0x2df)](_0x32db02,_0x27c110);_0xfc06ce[_0x3b762e(0x299)]?await writeOutput(_0x5c659c,_0xfc06ce[_0x3b762e(0x299)],_0x3b762e(0x1f6)):console['log'](_0x5c659c);}!_0x3dc47c&&(console['error'](''),console[_0x3b762e(0x326)](a42_0x20b7b8[_0x3b762e(0x1f2)](_0x3b762e(0x29c))),console[_0x3b762e(0x326)](a42_0x20b7b8[_0x3b762e(0x1f2)](_0x3b762e(0x1c3))+'or'+a42_0x20b7b8['dim'](_0x3b762e(0x2ff))));}else{if(_0x32db02[_0x3b762e(0x1bf)]===0x0){if(_0x3dc47c&&_0x1f6b1b)console['log'](_0x3b762e(0x220)+_0x3dc47c+'.'+_0x1f6b1b);else _0x3dc47c?console['log'](_0x3b762e(0x2cf)+_0x3dc47c):console[_0x3b762e(0x1c7)]('No\x20sessions\x20found');}else await this['navigateSessionsInteractive'](_0x32db02,_0x27e695,_0x3dc47c);}}return 0x0;}['renderSessionsTimeline'](_0x96d831,_0x2b9edf){const _0x26d9a4=a42_0x594cc1,_0x5e2144=[],_0xd8bee8=new Map();let _0x1a2333=Infinity,_0x2fe578=-Infinity;for(const _0x193679 of _0x96d831){if(_0x193679[_0x26d9a4(0x1db)]?.[_0x26d9a4(0x2dd)]){const _0x4368ad=new Date(_0x193679['lastAttempt'][_0x26d9a4(0x2dd)])['getTime'](),_0x57051b=_0x193679[_0x26d9a4(0x1db)][_0x26d9a4(0x2c6)]?new Date(_0x193679[_0x26d9a4(0x1db)][_0x26d9a4(0x2c6)])[_0x26d9a4(0x252)]():Date[_0x26d9a4(0x291)](),_0xcc4583=_0x193679[_0x26d9a4(0x2d9)]?.['name']||'(unknown)';!_0xd8bee8[_0x26d9a4(0x1ce)](_0xcc4583)&&_0xd8bee8[_0x26d9a4(0x349)](_0xcc4583,[]),_0xd8bee8[_0x26d9a4(0x2bb)](_0xcc4583)[_0x26d9a4(0x26a)]({'session':_0x193679,'startTime':_0x4368ad,'endTime':_0x57051b,'duration':_0x57051b-_0x4368ad}),_0x1a2333=Math[_0x26d9a4(0x1fe)](_0x1a2333,_0x4368ad),_0x2fe578=Math['max'](_0x2fe578,_0x57051b);}}if(_0xd8bee8[_0x26d9a4(0x30c)]===0x0)return _0x26d9a4(0x262);const _0x2fb32a=process[_0x26d9a4(0x285)]['columns']||0x78,_0x42e744=0x1e,_0x35e971=0x32,_0x25d01c=0x4,_0xb0ac4e=Math[_0x26d9a4(0x1fe)](_0x35e971,Math[_0x26d9a4(0x338)](_0x42e744,Math[_0x26d9a4(0x29f)](_0x2fb32a*0.3))),_0x59baa2=_0x2fb32a-_0xb0ac4e-TIMELINE_CONFIG[_0x26d9a4(0x346)]-0x3-_0x25d01c,_0x1e79c1=_0x2fe578-_0x1a2333,_0x232373=_0x1e79c1/_0xb0ac4e,_0x2cacef=renderTimeAxis({'startTime':_0x1a2333,'endTime':_0x2fe578,'durationMs':_0x1e79c1,'msPerChar':_0x232373},_0xb0ac4e),_0x29a675=[];for(const _0x1b7f3a of _0xd8bee8['values']()){_0x29a675['push'](..._0x1b7f3a);}_0x29a675[_0x26d9a4(0x31a)]((_0x339e5b,_0x1bece3)=>_0x1bece3[_0x26d9a4(0x29a)]-_0x339e5b[_0x26d9a4(0x29a)]);const _0x535a40=new Date(_0x1a2333),_0x101bfe=formatDate(_0x535a40),_0x2d5e01=_0x25d01c+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x26d9a4(0x2b5)]+_0x59baa2,_0x172e9e='\x20'[_0x26d9a4(0x1f3)](_0x2d5e01-_0x101bfe[_0x26d9a4(0x1bf)]),_0x12cc8e=_0x172e9e+a42_0x20b7b8['dim'](_0x101bfe)+'\x20'+_0x2cacef;_0x5e2144['push'](_0x12cc8e);const _0x3e84f1=0x16;let _0xb4433e=0x0;for(const _0x547245 of _0x29a675){const _0x106707=_0x547245[_0x26d9a4(0x267)]['project']?.[_0x26d9a4(0x209)]||'?',_0x3c4e16=Math[_0x26d9a4(0x1fe)](stringWidth(_0x106707),_0x3e84f1);_0xb4433e=Math[_0x26d9a4(0x338)](_0xb4433e,_0x3c4e16);}for(const _0x6b5c06 of _0x29a675){const {session:_0xd481f,startTime:_0x4098fc,endTime:_0x42c727,duration:_0x36ce31}=_0x6b5c06,_0xa1ab9f=_0xd481f[_0x26d9a4(0x2d9)]?.['id'],_0x471621=_0xd481f['id'],_0x480f52=_0xd481f[_0x26d9a4(0x2d9)]?.[_0x26d9a4(0x209)]||'?',_0x597a1d=_0xd481f[_0x26d9a4(0x28a)]?.[_0x26d9a4(0x209)]||'?';let _0x4041e7,_0x343782;if(_0xd481f['lastAttempt']){const _0x2e7698=_0xd481f['lastAttempt'];!_0x2e7698[_0x26d9a4(0x32b)]?(_0x4041e7=_0x2e7698[_0x26d9a4(0x213)]?'🛑':'🔄',_0x343782=_0x2e7698[_0x26d9a4(0x213)]?a42_0x20b7b8['yellow']:a42_0x20b7b8[_0x26d9a4(0x23d)]):(_0x4041e7=_0x2e7698[_0x26d9a4(0x33f)]?'✅':'❌',_0x343782=_0x2e7698[_0x26d9a4(0x33f)]?a42_0x20b7b8[_0x26d9a4(0x1c2)]:a42_0x20b7b8[_0x26d9a4(0x317)]);}else _0x4041e7='⏳',_0x343782=a42_0x20b7b8['dim'];const _0x4a2be6='#'+_0x471621,_0xe65096=_0xa1ab9f?hyperlink(_0x4a2be6,getWorkflowSessionUrl(_0x2b9edf,_0xa1ab9f,_0x471621)):_0x4a2be6;let _0x197eac=_0x480f52;stringWidth(_0x480f52)>_0x3e84f1&&(_0x197eac=_0x480f52['slice'](0x0,_0x3e84f1-0x1)+'…');const _0x45a908=a42_0x20b7b8[_0x26d9a4(0x1f2)](_0x197eac),_0x480a98=stringWidth(_0x197eac),_0x14fc66='\x20'['repeat'](_0xb4433e-stringWidth(_0x197eac)+0x2),_0x357c78='('+formatElapsed(_0x36ce31)+')',_0x126856=stringWidth(_0x357c78),_0x5b927c=stringWidth(_0x4a2be6),_0x557786=_0x5b927c+0x1+_0x480a98+_0x14fc66[_0x26d9a4(0x1bf)],_0x46a5ec=_0x59baa2-_0x557786-_0x126856-0x1-0x8;let _0x1331be=_0x597a1d;stringWidth(_0x1331be)>_0x46a5ec&&(_0x1331be=_0x1331be[_0x26d9a4(0x243)](0x0,_0x46a5ec-0x1)+'…');const _0x59250a=_0xe65096+'\x20'+_0x45a908+_0x14fc66+_0x1331be,_0x54dbf9=stringWidth(_0x59250a),_0x192cf8=_0x59baa2-_0x54dbf9-_0x126856,_0x33249a=_0x59250a+'\x20'[_0x26d9a4(0x1f3)](Math[_0x26d9a4(0x338)](0x1,_0x192cf8))+a42_0x20b7b8[_0x26d9a4(0x1f2)](_0x357c78),_0x16c43a=Math[_0x26d9a4(0x29f)]((_0x4098fc-_0x1a2333)/_0x232373),_0x1f2174=Math[_0x26d9a4(0x29f)]((_0x42c727-_0x1a2333)/_0x232373),_0x18dc77=Math[_0x26d9a4(0x338)](_0x16c43a+0x1,_0x1f2174),_0x23cae6=new Array(_0xb0ac4e)[_0x26d9a4(0x235)]('\x20');for(let _0x20813d=_0x16c43a;_0x20813d<Math[_0x26d9a4(0x1fe)](_0x18dc77,_0xb0ac4e);_0x20813d++){_0x23cae6[_0x20813d]='─';}const _0xc3e8a9=_0x23cae6['map'](_0x17c0bd=>_0x17c0bd==='\x20'?'\x20':_0x343782(_0x17c0bd))[_0x26d9a4(0x2c1)]('');_0x5e2144[_0x26d9a4(0x26a)](_0x4041e7+'\x20'+_0x33249a+'│'+_0xc3e8a9+'│');}return _0x5e2144['join']('\x0a');}async[a42_0x594cc1(0x320)](_0x85dd4f,_0x2d3a37,_0x502e9d){const _0x32acab=a42_0x594cc1,{options:_0x29c5db,tdx:_0x18f367}=_0x2d3a37,_0x4ad877=_0x29c5db[_0x32acab(0x295)],{timelineRows:_0x3c1fe1,timeAxisHeader:_0x3414f0}=this[_0x32acab(0x2dc)](_0x85dd4f,_0x4ad877),_0x255882=_0x3c1fe1[_0x32acab(0x2a7)](_0x31dd7c=>_0x31dd7c[_0x32acab(0x2eb)]);if(_0x255882['length']===0x0){const _0x91a2de=this['renderSessionsTimeline'](_0x85dd4f,_0x4ad877);console[_0x32acab(0x1c7)](_0x91a2de);!_0x502e9d&&(console[_0x32acab(0x326)](''),console[_0x32acab(0x326)](a42_0x20b7b8['dim']('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x32acab(0x326)](a42_0x20b7b8[_0x32acab(0x1f2)](_0x32acab(0x1c3))+'or'+a42_0x20b7b8['dim'](_0x32acab(0x2ff))));return;}_0x3414f0&&console[_0x32acab(0x1c7)](_0x3414f0);const _0xabee1c=_0x3c1fe1[_0x32acab(0x2a7)](_0x50dd38=>_0x50dd38[_0x32acab(0x2eb)])['map'](_0x1b99f3=>({'title':_0x1b99f3['displayLine'],'value':_0x1b99f3[_0x32acab(0x2eb)]})),_0x1de8d1=process[_0x32acab(0x285)]['rows']||0x3c,_0x545151=Math['max'](0x28,Math[_0x32acab(0x29f)](_0x1de8d1*0x2/0x3)),_0x3fbd78=await a42_0x5b9160({'type':_0x32acab(0x232),'name':_0x32acab(0x2eb),'message':_0x32acab(0x274),'choices':_0xabee1c,'initial':-0x1,'limit':_0x545151,'clearFirst':!![],'fallback':{'title':_0x32acab(0x2ae),'value':null},'suggest':(_0x292c84,_0x388ad9)=>{const _0x3a659e=_0x32acab;if(!_0x292c84)return Promise[_0x3a659e(0x20a)](_0x388ad9);const _0x4753a9=_0x388ad9[_0x3a659e(0x2a7)](_0x14f011=>{const _0x285b0a=_0x3a659e,_0x5cb245=_0x14f011;return _0x5cb245['title'][_0x285b0a(0x272)]()[_0x285b0a(0x2d2)](_0x292c84['toLowerCase']());});return Promise[_0x3a659e(0x20a)](_0x4753a9);}}),_0x1f2b7e=()=>{const _0x441196=_0x32acab;process[_0x441196(0x285)][_0x441196(0x21a)]('\x1b[1A\x1b[2K'),process[_0x441196(0x285)][_0x441196(0x21a)](_0x441196(0x294)),process[_0x441196(0x285)]['write'](_0x441196(0x294));},_0x4c5866=_0x3fbd78&&_0x3fbd78[_0x32acab(0x2eb)]&&_0x3fbd78[_0x32acab(0x2eb)]!==null&&_0x3fbd78['attemptId'][_0x32acab(0x212)]()!=='';if(!_0x4c5866){_0x1f2b7e(),console[_0x32acab(0x1c7)](a42_0x20b7b8[_0x32acab(0x1f2)](_0x32acab(0x287)));return;}_0x1f2b7e();const _0x1e33a7=_0x85dd4f['find'](_0x26337b=>_0x26337b[_0x32acab(0x1db)]?.['id']===_0x3fbd78[_0x32acab(0x2eb)]);if(_0x1e33a7){const _0x2a1ccc=_0x1e33a7['project']?.[_0x32acab(0x209)]||'?',_0xb856ef=_0x1e33a7[_0x32acab(0x28a)]?.[_0x32acab(0x209)]||'?';console[_0x32acab(0x1c7)](_0x32acab(0x2c3)+a42_0x20b7b8['dim'](_0x2a1ccc)+',\x20Workflow:\x20'+a42_0x20b7b8[_0x32acab(0x1f2)](_0xb856ef));}const _0x459d40=new WorkflowTimelineCommand();await _0x459d40[_0x32acab(0x329)]({'args':[],'options':{..._0x29c5db,'attemptId':_0x3fbd78[_0x32acab(0x2eb)]},'tdx':_0x18f367});}[a42_0x594cc1(0x2dc)](_0x43ae4c,_0x5ea062){const _0x4bb233=a42_0x594cc1,_0x20abbb=new Map();for(const _0x55911f of _0x43ae4c){_0x55911f['id']&&_0x55911f[_0x4bb233(0x1db)]?.['id']&&_0x20abbb[_0x4bb233(0x349)](_0x55911f['id'],_0x55911f[_0x4bb233(0x1db)]['id']);}const _0x52444c=[];let _0x49a5d7='';const _0x1de98b=this['renderSessionsTimeline'](_0x43ae4c,_0x5ea062),_0x35d526=_0x1de98b[_0x4bb233(0x2ea)]('\x0a');for(const _0x14fd60 of _0x35d526){if(_0x14fd60[_0x4bb233(0x1f7)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x14fd60['match'](/^\s+\d{4}-\d{2}-\d{2}/))_0x49a5d7=_0x14fd60;else{if(_0x14fd60['match'](/^[✅❌🔄🛑⏳]/)){const _0x127b2a=_0x14fd60[_0x4bb233(0x2aa)](/#(\d+)/),_0x31d62b=_0x127b2a?_0x127b2a[0x1]:null,_0x6d3b2a=_0x31d62b?_0x20abbb[_0x4bb233(0x2bb)](_0x31d62b)||null:null,_0x17ea40=_0x43ae4c[_0x4bb233(0x1b4)](_0x56c77d=>_0x56c77d['id']===_0x31d62b),_0x1d0ac5=_0x17ea40?.[_0x4bb233(0x2d9)]?.['name']||'';_0x52444c['push']({'displayLine':_0x14fd60,'attemptId':_0x6d3b2a,'projectName':_0x1d0ac5});}}}return{'timelineRows':_0x52444c,'timeAxisHeader':_0x49a5d7};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']='workflow:attempts';['description']=a42_0x594cc1(0x2a3);async[a42_0x594cc1(0x329)](_0x4e9f14){const _0x3955e9=a42_0x594cc1,{options:_0x370b94,args:_0x3197c7,tdx:_0x5dcbd9}=_0x4e9f14,_0x2624a4=this['parseProjectWorkflowPattern'](_0x3197c7,_0x370b94);if(!_0x2624a4)return 0x1;const {projectName:_0x250a5b,workflowName:_0x3f56e3}=_0x2624a4,_0x2d98b4=_0x370b94[_0x3955e9(0x2f7)];if(_0x370b94[_0x3955e9(0x323)]){if(_0x250a5b&&_0x3f56e3)console[_0x3955e9(0x326)]('Filter:\x20'+_0x250a5b+'.'+_0x3f56e3);else _0x250a5b&&console[_0x3955e9(0x326)]('Filter:\x20project='+_0x250a5b);_0x2d98b4&&console[_0x3955e9(0x326)]('Include\x20retried:\x20yes');}const _0x5d48d2=await withSpinner(_0x3955e9(0x255),()=>_0x5dcbd9[_0x3955e9(0x28a)][_0x3955e9(0x20e)]({'projectName':_0x250a5b,'workflowName':_0x3f56e3,'includeRetried':_0x2d98b4,'limit':_0x370b94[_0x3955e9(0x296)]}),{'verbose':_0x370b94[_0x3955e9(0x323)]}),_0x7025fa=_0x5d48d2[_0x3955e9(0x2c2)],_0x399174=_0x370b94['limit']||0x64,_0x5b4d97=_0x7025fa[_0x3955e9(0x1bf)]>=_0x399174?a42_0x20b7b8[_0x3955e9(0x1f2)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console['error'](_0x3955e9(0x265)+_0x7025fa[_0x3955e9(0x1bf)]+_0x3955e9(0x298)+(_0x7025fa[_0x3955e9(0x1bf)]!==0x1?'s':'')+_0x5b4d97);if(_0x370b94[_0x3955e9(0x1b9)]===_0x3955e9(0x2fe)||_0x370b94[_0x3955e9(0x1b9)]===_0x3955e9(0x336)||_0x370b94[_0x3955e9(0x1b9)]===_0x3955e9(0x260))await handleSDKOutput(_0x7025fa,_0x370b94);else{if(_0x7025fa['length']===0x0){if(_0x250a5b&&_0x3f56e3)console['log'](_0x3955e9(0x27b)+_0x250a5b+'.'+_0x3f56e3);else _0x250a5b?console[_0x3955e9(0x1c7)]('No\x20attempts\x20found\x20in\x20project:\x20'+_0x250a5b):console[_0x3955e9(0x1c7)](_0x3955e9(0x283));}else{const _0x2cd69d=_0x370b94[_0x3955e9(0x295)],_0x42e9eb=_0x7025fa[_0x3955e9(0x2c4)](_0x306a35=>{const _0x315ceb=_0x3955e9,_0x1c1ad1=a42_0x20b7b8[_0x315ceb(0x1f2)]('#'+_0x306a35['id']),_0xe06757=_0x306a35[_0x315ceb(0x2d9)]?.['id'],_0x337793=_0x306a35[_0x315ceb(0x2e1)]||_0x306a35[_0x315ceb(0x33a)],_0x2beb98=_0xe06757&&_0x337793?hyperlink(_0x1c1ad1,getWorkflowAttemptUrl(_0x2cd69d,_0xe06757,_0x337793,_0x306a35['id'])):_0x1c1ad1,{icon:_0x51b07a,text:_0x5b1e89}=getAttemptStatusDisplay(_0x306a35),_0x3b14b2=(_0x306a35['project']?.[_0x315ceb(0x209)]||'?')+'.'+(_0x306a35[_0x315ceb(0x28a)]?.[_0x315ceb(0x209)]||'?'),_0x4fcfab=_0x306a35[_0x315ceb(0x2b8)]?a42_0x20b7b8[_0x315ceb(0x1f2)](_0x306a35[_0x315ceb(0x2b8)]):'';return(_0x2beb98+'\x20'+_0x51b07a+(_0x5b1e89?'\x20'+_0x5b1e89:'')+'\x20'+_0x3b14b2+'\x20'+_0x4fcfab)[_0x315ceb(0x1dd)]();});await writeOutput(_0x42e9eb['join']('\x0a'),_0x370b94[_0x3955e9(0x299)],_0x3955e9(0x1f6));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a42_0x594cc1(0x271);[a42_0x594cc1(0x1ff)]='Show\x20specific\x20attempt\x20details';async[a42_0x594cc1(0x329)](_0x2d595e){const _0x53a30b=a42_0x594cc1,{options:_0x474deb,args:_0x5840d9,tdx:_0x799a5d}=_0x2d595e,_0x259756=_0x5840d9[0x0];if(!_0x259756)return console['error'](_0x53a30b(0x26f)),0x1;_0x474deb[_0x53a30b(0x323)]&&console[_0x53a30b(0x326)]('Attempt\x20ID:\x20'+_0x259756);const _0x378c99=await withSpinner(_0x53a30b(0x2ad),()=>_0x799a5d[_0x53a30b(0x28a)]['attempt'](_0x259756),{'verbose':_0x474deb[_0x53a30b(0x323)]}),_0x5ea612=_0x378c99[_0x53a30b(0x2c2)];let _0x3fafdc;!_0x5ea612[_0x53a30b(0x32b)]?_0x3fafdc=_0x5ea612[_0x53a30b(0x213)]?_0x53a30b(0x341):_0x53a30b(0x245):_0x3fafdc=_0x5ea612[_0x53a30b(0x33f)]?_0x53a30b(0x33f):_0x53a30b(0x326);let _0x8f9ce4;if(_0x5ea612[_0x53a30b(0x2dd)]&&_0x5ea612['finishedAt']){const _0x1a2dca=new Date(_0x5ea612[_0x53a30b(0x2dd)])['getTime'](),_0x5e8d87=new Date(_0x5ea612[_0x53a30b(0x2c6)])[_0x53a30b(0x252)]();_0x8f9ce4=Math['round']((_0x5e8d87-_0x1a2dca)/0x3e8);}const _0x3b5666={'attempt_id':_0x5ea612['id'],'status':_0x3fafdc,..._0x5ea612[_0x53a30b(0x24f)]!==undefined&&{'index':_0x5ea612['index']},..._0x5ea612[_0x53a30b(0x2d9)]&&{'project':_0x5ea612[_0x53a30b(0x2d9)][_0x53a30b(0x209)]},..._0x5ea612[_0x53a30b(0x28a)]&&{'workflow':_0x5ea612[_0x53a30b(0x28a)][_0x53a30b(0x209)]},..._0x5ea612[_0x53a30b(0x33a)]&&{'session_id':_0x5ea612[_0x53a30b(0x33a)]},..._0x5ea612[_0x53a30b(0x2b8)]&&{'session_time':_0x5ea612['sessionTime']},..._0x5ea612[_0x53a30b(0x1da)]&&{'retry_attempt':_0x5ea612['retryAttemptName']},..._0x8f9ce4!==undefined&&{'duration_sec':_0x8f9ce4},..._0x5ea612[_0x53a30b(0x2dd)]&&{'created_at':_0x5ea612[_0x53a30b(0x2dd)]},..._0x5ea612[_0x53a30b(0x2c6)]&&{'finished_at':_0x5ea612[_0x53a30b(0x2c6)]},...Object[_0x53a30b(0x2fb)](_0x5ea612['params'])[_0x53a30b(0x1bf)]>0x0&&{'params':_0x5ea612[_0x53a30b(0x256)]}};return await handleSingleObjectOutput(_0x3b5666,_0x474deb),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a42_0x594cc1(0x209)]='workflow:tasks';[a42_0x594cc1(0x1ff)]=a42_0x594cc1(0x31c);async[a42_0x594cc1(0x329)](_0x509c70){const _0x5a7788=a42_0x594cc1,{options:_0x247134,args:_0x11c7ec,tdx:_0x5d9f6a}=_0x509c70,_0x9bf5d1=_0x11c7ec[0x0];if(!_0x9bf5d1)return console[_0x5a7788(0x326)](_0x5a7788(0x26f)),0x1;const _0x412a03=_0x247134[_0x5a7788(0x2f4)];_0x247134[_0x5a7788(0x323)]&&(console['error'](_0x5a7788(0x238)+_0x9bf5d1),_0x412a03&&console[_0x5a7788(0x326)]('Including\x20subtasks:\x20yes'));const _0x3de934=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x5d9f6a['workflow'][_0x5a7788(0x2e5)](_0x9bf5d1,_0x412a03||![]),{'verbose':_0x247134['verbose']}),_0x365e22=_0x3de934[_0x5a7788(0x2c2)];return console[_0x5a7788(0x326)](_0x5a7788(0x265)+_0x365e22['length']+_0x5a7788(0x23b)+(_0x365e22['length']!==0x1?'s':'')),await handleSDKOutput(_0x365e22,_0x247134),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a42_0x594cc1(0x209)]=a42_0x594cc1(0x2bc);[a42_0x594cc1(0x1ff)]=a42_0x594cc1(0x2c5);async[a42_0x594cc1(0x329)](_0x19d0b1){const _0x3b9b27=a42_0x594cc1,{options:_0xb5c7f0,args:_0x219e24,tdx:_0x5c6862}=_0x19d0b1,_0x3c7f97=_0x219e24[0x0];let _0x3ef932=_0x219e24[0x1];if(!_0x3c7f97)return console['error'](_0x3b9b27(0x26f)),0x1;_0xb5c7f0['verbose']&&(console[_0x3b9b27(0x326)](_0x3b9b27(0x238)+_0x3c7f97),_0x3ef932&&console['error'](_0x3b9b27(0x1bd)+_0x3ef932));const _0x42d967=await withSpinner(_0x3b9b27(0x203),()=>_0x5c6862[_0x3b9b27(0x28a)][_0x3b9b27(0x229)](_0x3c7f97,_0x3ef932),{'verbose':_0xb5c7f0[_0x3b9b27(0x323)]}),_0x3e2688=_0x42d967['data'];if(_0x3e2688[_0x3b9b27(0x1bf)]===0x0)return console['error'](_0x3b9b27(0x1e4)),0x0;if(!_0x3ef932&&(_0xb5c7f0[_0x3b9b27(0x2fe)]||_0xb5c7f0[_0x3b9b27(0x1b9)]))return await handleSDKOutput(_0x3e2688,_0xb5c7f0),0x0;if(!_0x3ef932){const _0x4b05f4=_0x3e2688[_0x3b9b27(0x2c4)](_0x9ef270=>({'title':_0x9ef270['taskName']+'\x20('+formatBytes(_0x9ef270[_0x3b9b27(0x1e7)])+')','value':_0x9ef270['taskName']})),_0x15de48=await a42_0x5b9160({'type':'select','name':_0x3b9b27(0x221),'message':_0x3b9b27(0x2d1),'choices':_0x4b05f4});if(!_0x15de48[_0x3b9b27(0x221)])return console[_0x3b9b27(0x326)](_0x3b9b27(0x287)),0x0;_0x3ef932=_0x15de48[_0x3b9b27(0x221)];}const _0x38160c=await withSpinner(_0x3b9b27(0x22c),()=>_0x5c6862[_0x3b9b27(0x28a)][_0x3b9b27(0x1bc)](_0x3c7f97,_0x3ef932),{'verbose':_0xb5c7f0[_0x3b9b27(0x323)]}),_0x9e1d34=_0x38160c[_0x3b9b27(0x2c2)];return _0x9e1d34?console[_0x3b9b27(0x1c7)](_0x9e1d34):console[_0x3b9b27(0x326)](_0x3b9b27(0x20b)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a42_0x594cc1(0x209)]=a42_0x594cc1(0x344);['description']='Kill\x20a\x20running\x20attempt';async[a42_0x594cc1(0x329)](_0x1d070b){const _0x4efe36=a42_0x594cc1,{options:_0xf14138,args:_0x388a76,tdx:_0x9cb40d}=_0x1d070b,_0x5c0236=_0x388a76[0x0];if(!_0x5c0236)return console[_0x4efe36(0x326)](_0x4efe36(0x26f)),0x1;const _0x4388f5=_0xf14138[_0x4efe36(0x1dc)];_0xf14138['verbose']&&(console['error'](_0x4efe36(0x238)+_0x5c0236),_0x4388f5&&console[_0x4efe36(0x326)](_0x4efe36(0x1fc)+_0x4388f5));if(!_0xf14138[_0x4efe36(0x2ef)]){if(!isInteractive())return console['error'](a42_0x20b7b8[_0x4efe36(0x317)](_0x4efe36(0x225)),_0x4efe36(0x1b3)),console[_0x4efe36(0x326)](a42_0x20b7b8[_0x4efe36(0x1f2)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1275db=await confirmKey(_0x4efe36(0x2c9)+_0x5c0236+'?');if(!_0x1275db)return console[_0x4efe36(0x326)](a42_0x20b7b8[_0x4efe36(0x25a)]('Cancelled')),0x1;}const _0x1cfeb2=await withSpinner(_0x4efe36(0x1ed),()=>_0x9cb40d[_0x4efe36(0x28a)][_0x4efe36(0x1ea)](_0x5c0236,_0x4388f5),{'verbose':_0xf14138[_0x4efe36(0x323)]}),_0x1da89a=_0x1cfeb2['data'];return console[_0x4efe36(0x326)]('✔\x20'+_0x1da89a),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a42_0x594cc1(0x209)]=a42_0x594cc1(0x261);[a42_0x594cc1(0x1ff)]=a42_0x594cc1(0x205);async['execute'](_0x120fe1){const _0x1a5c5c=a42_0x594cc1,{options:_0x523daf,args:_0x2d0aae,tdx:_0xb2bb80}=_0x120fe1,_0x1f3198=_0x2d0aae[0x0];if(!_0x1f3198)return console[_0x1a5c5c(0x326)](_0x1a5c5c(0x337)),console['error']('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x250e8b=![],_0xb919e=_0x1f3198;if(_0x1f3198[_0x1a5c5c(0x1f7)]('session:'))_0x250e8b=!![],_0xb919e=_0x1f3198[_0x1a5c5c(0x311)](0x8);else{if(_0x1f3198[_0x1a5c5c(0x1f7)](_0x1a5c5c(0x1df)))_0x250e8b=![],_0xb919e=_0x1f3198['substring'](0x8);else return console['error'](_0x1a5c5c(0x330)),console[_0x1a5c5c(0x326)](_0x1a5c5c(0x257)),0x1;}const _0x3e54a0=_0x523daf[_0x1a5c5c(0x1f0)],_0x4d1e89=_0x523daf[_0x1a5c5c(0x2a4)],_0x2fc9d3=_0x523daf[_0x1a5c5c(0x256)],_0x196702=_0x523daf[_0x1a5c5c(0x347)];_0x523daf['verbose']&&(console[_0x1a5c5c(0x326)](_0x1a5c5c(0x1fb)+(_0x250e8b?_0x1a5c5c(0x267):'attempt')+'\x20'+_0xb919e),_0x3e54a0&&console[_0x1a5c5c(0x326)]('From\x20task:\x20'+_0x3e54a0),_0x4d1e89&&console[_0x1a5c5c(0x326)]('Resume\x20from:\x20'+_0x4d1e89),_0x2fc9d3&&console[_0x1a5c5c(0x326)]('Params:\x20'+_0x2fc9d3),_0x196702&&console[_0x1a5c5c(0x326)](_0x1a5c5c(0x1d5)));let _0x461f0a;if(_0x2fc9d3)try{if(_0x2fc9d3[_0x1a5c5c(0x1f7)]('@')){const _0x3284e4=await import(_0x1a5c5c(0x34b)),_0x4e573b=_0x2fc9d3[_0x1a5c5c(0x311)](0x1),_0x4985d3=await _0x3284e4['readFile'](_0x4e573b,_0x1a5c5c(0x328));_0x461f0a=JSON[_0x1a5c5c(0x240)](_0x4985d3);}else _0x461f0a=JSON[_0x1a5c5c(0x240)](_0x2fc9d3);}catch{return console[_0x1a5c5c(0x326)](_0x1a5c5c(0x228)),0x1;}if(!_0x523daf[_0x1a5c5c(0x2ef)]){if(!isInteractive())return console[_0x1a5c5c(0x326)](a42_0x20b7b8[_0x1a5c5c(0x317)]('\x0aError:'),_0x1a5c5c(0x1b3)),console[_0x1a5c5c(0x326)](a42_0x20b7b8[_0x1a5c5c(0x1f2)](_0x1a5c5c(0x324))),0x1;const _0x522567=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x250e8b?_0x1a5c5c(0x267):'attempt')+'\x20'+_0xb919e+'?');if(!_0x522567)return console['error'](a42_0x20b7b8[_0x1a5c5c(0x25a)]('Cancelled')),0x1;}let _0x5f2fe2;_0x250e8b?_0x5f2fe2=await withSpinner(_0x1a5c5c(0x24b),()=>_0xb2bb80[_0x1a5c5c(0x28a)]['retrySession'](_0xb919e,{'fromTask':_0x3e54a0,'retryParams':_0x461f0a}),{'verbose':_0x523daf[_0x1a5c5c(0x323)]}):_0x5f2fe2=await withSpinner(_0x1a5c5c(0x22d),()=>_0xb2bb80[_0x1a5c5c(0x28a)][_0x1a5c5c(0x342)](_0xb919e,{'resumeFrom':_0x4d1e89,'retryParams':_0x461f0a,'force':_0x196702}),{'verbose':_0x523daf[_0x1a5c5c(0x323)]});const _0xab44e=_0x5f2fe2['data'];return console[_0x1a5c5c(0x326)](_0x1a5c5c(0x1d1)),console['error'](_0x1a5c5c(0x270)+_0xab44e[_0x1a5c5c(0x2eb)]),console[_0x1a5c5c(0x326)](_0x1a5c5c(0x1d4)+_0xab44e[_0x1a5c5c(0x33a)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a42_0x594cc1(0x209)]=a42_0x594cc1(0x2e0);[a42_0x594cc1(0x1ff)]=a42_0x594cc1(0x316);async['execute'](_0x4c2830){const _0x48f546=a42_0x594cc1,{options:_0x30a921,args:_0x4f3e2c,tdx:_0x51b383}=_0x4c2830;let _0x5294e2=_0x4f3e2c[0x0];if(!_0x5294e2){const _0x517d3d=this[_0x48f546(0x2c0)]([],_0x30a921),_0x39a68f=await withSpinner(_0x48f546(0x27d),()=>_0x51b383[_0x48f546(0x28a)][_0x48f546(0x1e2)](_0x517d3d,{'limit':_0x30a921[_0x48f546(0x296)]}),{'verbose':_0x30a921[_0x48f546(0x323)]}),_0x458ef2=_0x39a68f[_0x48f546(0x2c2)];if(_0x458ef2[_0x48f546(0x1bf)]===0x0)return console['error'](_0x48f546(0x282)),!_0x517d3d&&console['error'](a42_0x20b7b8[_0x48f546(0x1f2)](_0x48f546(0x20d))),0x1;const _0x53e5bf=_0x458ef2[_0x48f546(0x2c4)](_0x343604=>({'title':_0x343604[_0x48f546(0x2d9)]?.['name']+'.'+_0x343604[_0x48f546(0x209)],'value':_0x343604[_0x48f546(0x2d9)]?.[_0x48f546(0x209)]+'.'+_0x343604[_0x48f546(0x209)],'description':_0x343604['revision']?_0x48f546(0x304)+_0x343604[_0x48f546(0x2e8)]:undefined})),_0x2e1b8c=await a42_0x5b9160({'type':_0x48f546(0x34c),'name':'workflow','message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x53e5bf});if(!_0x2e1b8c[_0x48f546(0x28a)])return 0x1;_0x5294e2=_0x2e1b8c['workflow'];}if(!_0x5294e2['includes']('.')){const _0xb6e85e=this[_0x48f546(0x2c0)]([],_0x30a921);if(_0xb6e85e)_0x5294e2=_0xb6e85e+'.'+_0x5294e2;else return console[_0x48f546(0x326)](a42_0x20b7b8['red'](_0x48f546(0x2c7)),_0x48f546(0x253)),console['error'](a42_0x20b7b8[_0x48f546(0x1f2)](_0x48f546(0x20d))),0x1;}const _0x33158c=_0x30a921[_0x48f546(0x1b2)],_0x11a643=_0x30a921['sessionTime'],_0x12cc60={};if(_0x33158c&&Array['isArray'](_0x33158c))for(const _0x5551e9 of _0x33158c){const _0x598729=_0x5551e9[_0x48f546(0x25e)]('=');if(_0x598729===-0x1)return console[_0x48f546(0x326)](_0x48f546(0x1c9)+_0x5551e9),console[_0x48f546(0x326)](_0x48f546(0x2f1)),0x1;const _0x5bbd14=_0x5551e9[_0x48f546(0x311)](0x0,_0x598729),_0x18d7e6=_0x5551e9['substring'](_0x598729+0x1);try{_0x12cc60[_0x5bbd14]=JSON[_0x48f546(0x240)](_0x18d7e6);}catch{_0x12cc60[_0x5bbd14]=_0x18d7e6;}}_0x30a921[_0x48f546(0x323)]&&(console[_0x48f546(0x326)]('Workflow:\x20'+_0x5294e2),Object[_0x48f546(0x2fb)](_0x12cc60)[_0x48f546(0x1bf)]>0x0&&console[_0x48f546(0x326)](_0x48f546(0x237)+JSON['stringify'](_0x12cc60)),_0x11a643&&console[_0x48f546(0x326)]('Session\x20time:\x20'+_0x11a643));const _0x55fb3e=await withSpinner(_0x48f546(0x246),()=>_0x51b383[_0x48f546(0x28a)][_0x48f546(0x22b)](_0x5294e2,_0x12cc60,{'sessionTime':_0x11a643}),{'verbose':_0x30a921['verbose']}),_0x4528ab=_0x55fb3e[_0x48f546(0x2c2)];console[_0x48f546(0x326)](_0x48f546(0x224)),console[_0x48f546(0x326)]('\x20\x20Attempt\x20ID:\x20'+_0x4528ab['id']),console[_0x48f546(0x326)](_0x48f546(0x1d4)+_0x4528ab[_0x48f546(0x33a)]),console[_0x48f546(0x326)]('\x20\x20Project:\x20'+_0x4528ab['project']?.[_0x48f546(0x209)]),console['error'](_0x48f546(0x2cc)+_0x4528ab['workflow']?.['name']);if(_0x4528ab[_0x48f546(0x2d9)]?.['id']&&_0x4528ab[_0x48f546(0x33a)]&&_0x4528ab['id']){const _0x397527=_0x30a921[_0x48f546(0x295)],_0x356328=getConsoleUrl(_0x397527,_0x48f546(0x2f8)+_0x4528ab['project']['id']+_0x48f546(0x1f9)+_0x4528ab[_0x48f546(0x33a)]+_0x48f546(0x23a)+_0x4528ab['id']);console['error'](_0x48f546(0x1ec)+a42_0x20b7b8[_0x48f546(0x288)](_0x356328));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a42_0x594cc1(0x209)]=a42_0x594cc1(0x206);['description']='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a42_0x594cc1(0x329)](_0x465e8c){const _0x4c84b9=a42_0x594cc1,{options:_0x352049,args:_0x57d838,tdx:_0x2eec6c}=_0x465e8c,_0x2f4783=_0x57d838[0x0],_0x442d1c=_0x57d838[0x1]||'.';if(!_0x2f4783)return console['error'](_0x4c84b9(0x286)),console[_0x4c84b9(0x326)](_0x4c84b9(0x2e2)),0x1;const _0x32124c=_0x352049[_0x4c84b9(0x2e8)];_0x352049[_0x4c84b9(0x323)]&&(console['error'](_0x4c84b9(0x2c3)+_0x2f4783),console[_0x4c84b9(0x326)]('Output\x20directory:\x20'+_0x442d1c),_0x32124c&&console[_0x4c84b9(0x326)](_0x4c84b9(0x215)+_0x32124c));const _0x28aed4=await withSpinner(_0x4c84b9(0x1d2)+_0x2f4783+_0x4c84b9(0x26e),()=>_0x2eec6c['workflow']['download'](_0x2f4783,_0x442d1c,{'revision':_0x32124c}),{'verbose':_0x352049[_0x4c84b9(0x323)]}),_0x1ec54d=_0x28aed4[_0x4c84b9(0x2c2)];return console['error'](_0x4c84b9(0x208)+_0x1ec54d[_0x4c84b9(0x308)]),console[_0x4c84b9(0x326)](_0x4c84b9(0x293)+_0x1ec54d['revision']),console[_0x4c84b9(0x326)]('\x20\x20Files\x20extracted:\x20'+_0x1ec54d[_0x4c84b9(0x2b9)]),console[_0x4c84b9(0x326)](_0x4c84b9(0x1f4)+_0x442d1c+'/'+_0x1ec54d[_0x4c84b9(0x308)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a42_0x594cc1(0x2bf);[a42_0x594cc1(0x1ff)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async[a42_0x594cc1(0x329)](_0x37b729){const _0xa3e218=a42_0x594cc1,{options:_0x1aea67,args:_0x2ed82e,tdx:_0x3d32d9}=_0x37b729;let _0x437b45='.',_0xd3e2a2=_0x1aea67[_0xa3e218(0x209)];if(_0x2ed82e[0x0]){const {promises:_0x5a7779}=await import('fs');try{const _0x279372=await _0x5a7779[_0xa3e218(0x2b2)](_0x2ed82e[0x0]);if(_0x279372[_0xa3e218(0x2a6)]())_0x437b45=_0x2ed82e[0x0];else return console['error']('Error:\x20'+_0x2ed82e[0x0]+_0xa3e218(0x27f)),0x1;}catch{_0xd3e2a2=_0x2ed82e[0x0],_0x437b45='.';}}const _0x4207ab=_0x1aea67[_0xa3e218(0x2e8)],_0x17db38=_0x1aea67['skipValidation'];_0x1aea67[_0xa3e218(0x323)]&&(console[_0xa3e218(0x326)]('Project\x20directory:\x20'+_0x437b45),_0xd3e2a2&&console[_0xa3e218(0x326)](_0xa3e218(0x251)+_0xd3e2a2),_0x4207ab&&console[_0xa3e218(0x326)]('Revision:\x20'+_0x4207ab),_0x17db38&&console['error'](_0xa3e218(0x33b)));const _0x273ed8=await withSpinner(_0xa3e218(0x2ba),()=>_0x3d32d9['workflow']['push'](_0x437b45,{'projectName':_0xd3e2a2,'revision':_0x4207ab,'skipValidation':_0x17db38}),{'verbose':_0x1aea67[_0xa3e218(0x323)]}),_0x5a26a6=_0x273ed8[_0xa3e218(0x2c2)];return console[_0xa3e218(0x326)](_0xa3e218(0x2a5)+_0x5a26a6['projectName']),console[_0xa3e218(0x326)](_0xa3e218(0x24a)+_0x5a26a6['projectId']),console['error'](_0xa3e218(0x293)+_0x5a26a6[_0xa3e218(0x2e8)]),await this[_0xa3e218(0x339)](_0x3d32d9,_0x5a26a6[_0xa3e218(0x308)],_0x1aea67[_0xa3e218(0x295)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a42_0x594cc1(0x209)]=a42_0x594cc1(0x219);['description']='Pull\x20workflow\x20project\x20to\x20local\x20folder';async[a42_0x594cc1(0x329)](_0x1cabd6){const _0x2bf017=a42_0x594cc1,{options:_0x42073f,args:_0x15b3ae,tdx:_0x2c33f0}=_0x1cabd6,_0x4839ed=_0x15b3ae[0x0],_0x2e20e0=_0x15b3ae[0x1];if(!_0x4839ed)return console[_0x2bf017(0x326)](a42_0x20b7b8['red']('Error:'),_0x2bf017(0x1e3)),console[_0x2bf017(0x326)](a42_0x20b7b8[_0x2bf017(0x1f2)](_0x2bf017(0x33d))),0x1;const _0x3c3ca6=_0x42073f[_0x2bf017(0x2e8)];_0x42073f[_0x2bf017(0x323)]&&(console[_0x2bf017(0x326)]('Project:\x20'+_0x4839ed),_0x2e20e0&&console['error'](_0x2bf017(0x333)+_0x2e20e0),_0x3c3ca6&&console['error'](_0x2bf017(0x215)+_0x3c3ca6),_0x42073f[_0x2bf017(0x269)]&&console['error']('Dry\x20run:\x20yes'));const _0x344280=await withSpinner(_0x2bf017(0x1e0)+_0x4839ed+'...',()=>_0x2c33f0['workflow'][_0x2bf017(0x1b8)](_0x4839ed,{'targetDir':_0x2e20e0,'revision':_0x3c3ca6}),{'verbose':_0x42073f[_0x2bf017(0x323)]}),_0x1843cb=_0x344280[_0x2bf017(0x2c2)];_0x1843cb[_0x2bf017(0x307)]?console['error'](_0x2bf017(0x236)+_0x1843cb['projectName']):console['error'](_0x2bf017(0x1d0)+_0x1843cb[_0x2bf017(0x308)]);console[_0x2bf017(0x326)]('\x20\x20Revision:\x20'+_0x1843cb[_0x2bf017(0x2e8)]),console[_0x2bf017(0x326)](_0x2bf017(0x2a0)+(a42_0xcdeb1c[_0x2bf017(0x2da)](process['cwd'](),_0x1843cb[_0x2bf017(0x32c)])||'.')),console[_0x2bf017(0x326)](_0x2bf017(0x234)+a42_0x20b7b8[_0x2bf017(0x1c2)]('+'+_0x1843cb[_0x2bf017(0x28c)][_0x2bf017(0x248)]+'\x20new')+',\x20'+(a42_0x20b7b8[_0x2bf017(0x25a)]('~'+_0x1843cb[_0x2bf017(0x28c)][_0x2bf017(0x297)]+_0x2bf017(0x231))+',\x20')+(a42_0x20b7b8[_0x2bf017(0x317)]('-'+_0x1843cb['summary'][_0x2bf017(0x2d7)]+'\x20deleted')+',\x20')+(''+a42_0x20b7b8[_0x2bf017(0x1f2)](_0x1843cb[_0x2bf017(0x28c)][_0x2bf017(0x1fd)]+'\x20unchanged')));for(const _0x58469d of _0x1843cb[_0x2bf017(0x306)]){_0x58469d[_0x2bf017(0x23f)]==='modified'&&_0x58469d['diff']&&(console[_0x2bf017(0x326)]('\x0a'+a42_0x20b7b8[_0x2bf017(0x288)](_0x2bf017(0x201)+_0x58469d[_0x2bf017(0x2cd)])),console[_0x2bf017(0x326)](_0x58469d['diff']));}if(!_0x1843cb[_0x2bf017(0x1e9)])return saveSessionContext({'workflow_project':_0x1843cb['projectName']},_0x42073f[_0x2bf017(0x267)]),console[_0x2bf017(0x326)](a42_0x20b7b8[_0x2bf017(0x1c2)]('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x2bf017(0x326)](a42_0x20b7b8[_0x2bf017(0x1f2)](_0x2bf017(0x207)+_0x1843cb[_0x2bf017(0x308)])),0x0;if(_0x42073f[_0x2bf017(0x269)])return console[_0x2bf017(0x326)](a42_0x20b7b8[_0x2bf017(0x25a)](_0x2bf017(0x290))),0x0;if(!_0x42073f[_0x2bf017(0x2ef)]){if(!isInteractive())return console['error'](a42_0x20b7b8[_0x2bf017(0x317)](_0x2bf017(0x225)),_0x2bf017(0x1b3)),console['error'](a42_0x20b7b8['dim'](_0x2bf017(0x324))),0x1;const _0x3e5e63=await confirmKey(_0x2bf017(0x2a8));if(!_0x3e5e63)return console[_0x2bf017(0x326)](a42_0x20b7b8['yellow'](_0x2bf017(0x287)),_0x2bf017(0x32a)),0x1;}await withSpinner(_0x2bf017(0x32f),()=>_0x2c33f0['workflow'][_0x2bf017(0x2fd)](_0x1843cb,{'revision':_0x3c3ca6}),{'verbose':_0x42073f[_0x2bf017(0x323)]}),saveSessionContext({'workflow_project':_0x1843cb[_0x2bf017(0x308)]},_0x42073f['session']),console[_0x2bf017(0x326)](a42_0x20b7b8[_0x2bf017(0x1c2)](_0x2bf017(0x266)));const _0x5a45cf=a42_0xcdeb1c['relative'](process[_0x2bf017(0x284)](),_0x1843cb[_0x2bf017(0x32c)])||'.';return console[_0x2bf017(0x326)](a42_0x20b7b8['dim'](_0x2bf017(0x1f4)+_0x5a45cf)),console[_0x2bf017(0x326)](a42_0x20b7b8['dim'](_0x2bf017(0x207)+_0x1843cb[_0x2bf017(0x308)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a42_0x594cc1(0x209)]='workflow:push';[a42_0x594cc1(0x1ff)]='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async[a42_0x594cc1(0x329)](_0xa21712){const _0x27d625=a42_0x594cc1,{options:_0x4c9da2,args:_0x20dcf2,tdx:_0x65ea66}=_0xa21712,_0x16b0b2=this[_0x27d625(0x223)](_0x20dcf2,_0x4c9da2),_0x246b1f=_0x4c9da2[_0x27d625(0x2e8)],_0x5d8b14=_0x4c9da2[_0x27d625(0x305)];_0x4c9da2[_0x27d625(0x323)]&&(_0x16b0b2&&console[_0x27d625(0x326)]('Source\x20directory:\x20'+_0x16b0b2),_0x246b1f&&console['error'](_0x27d625(0x215)+_0x246b1f),_0x4c9da2['dryRun']&&console[_0x27d625(0x326)](_0x27d625(0x1ef)),_0x5d8b14&&console[_0x27d625(0x326)](_0x27d625(0x33b)));let _0xb36c1a;try{_0xb36c1a=await withSpinner('Analyzing\x20changes...',()=>_0x65ea66[_0x27d625(0x28a)][_0x27d625(0x27e)]({'sourceDir':_0x16b0b2,'revision':_0x246b1f,'skipValidation':_0x5d8b14}),{'verbose':_0x4c9da2['verbose']});}catch(_0x3dd040){if(_0x3dd040 instanceof Error&&_0x3dd040[_0x27d625(0x268)][_0x27d625(0x2d2)](_0x27d625(0x276)))return console['error'](a42_0x20b7b8['red'](_0x27d625(0x2c7)),_0x27d625(0x277)),_0x4c9da2[_0x27d625(0x26d)]?console[_0x27d625(0x326)](a42_0x20b7b8[_0x27d625(0x1f2)](_0x27d625(0x244)+_0x4c9da2[_0x27d625(0x26d)]+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x4c9da2[_0x27d625(0x26d)]+'\x27')):console['error'](a42_0x20b7b8['dim'](_0x27d625(0x26c))),0x1;throw _0x3dd040;}const _0x3af20b=_0xb36c1a[_0x27d625(0x2c2)];console['error']('✔\x20Project:\x20'+_0x3af20b['projectName']),console[_0x27d625(0x326)](_0x27d625(0x331)+_0x3af20b[_0x27d625(0x233)]),console[_0x27d625(0x326)](_0x27d625(0x293)+_0x3af20b['revision']),console['error'](_0x27d625(0x234)+a42_0x20b7b8[_0x27d625(0x1c2)]('+'+_0x3af20b[_0x27d625(0x28c)][_0x27d625(0x248)]+_0x27d625(0x2d8))+',\x20'+(a42_0x20b7b8[_0x27d625(0x25a)]('~'+_0x3af20b[_0x27d625(0x28c)]['modified']+'\x20modified')+',\x20')+(a42_0x20b7b8[_0x27d625(0x317)]('-'+_0x3af20b[_0x27d625(0x28c)][_0x27d625(0x2d7)]+_0x27d625(0x214))+',\x20')+(''+a42_0x20b7b8[_0x27d625(0x1f2)](_0x3af20b['summary'][_0x27d625(0x1fd)]+_0x27d625(0x2ed))));for(const _0x5b1544 of _0x3af20b[_0x27d625(0x306)]){_0x5b1544[_0x27d625(0x23f)]===_0x27d625(0x297)&&_0x5b1544[_0x27d625(0x24e)]&&(console[_0x27d625(0x326)]('\x0a'+a42_0x20b7b8['cyan'](_0x27d625(0x201)+_0x5b1544[_0x27d625(0x2cd)])),console[_0x27d625(0x326)](_0x5b1544[_0x27d625(0x24e)]));}if(!_0x3af20b[_0x27d625(0x1e9)])return console[_0x27d625(0x326)](a42_0x20b7b8[_0x27d625(0x1c2)](_0x27d625(0x31f))),await this[_0x27d625(0x339)](_0x65ea66,_0x3af20b[_0x27d625(0x308)],_0x4c9da2['site']),0x0;if(_0x4c9da2[_0x27d625(0x269)])return console['error'](a42_0x20b7b8[_0x27d625(0x25a)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x4c9da2['yes']){if(!isInteractive())return console['error'](a42_0x20b7b8['red']('\x0aError:'),_0x27d625(0x1b3)),console[_0x27d625(0x326)](a42_0x20b7b8[_0x27d625(0x1f2)](_0x27d625(0x324))),0x1;const _0x493791=await confirmKey(_0x27d625(0x1fa));if(!_0x493791)return console[_0x27d625(0x326)](a42_0x20b7b8['yellow']('Cancelled'),_0x27d625(0x230)),0x1;}const _0x279505=await withSpinner(_0x27d625(0x204),()=>_0x65ea66[_0x27d625(0x28a)][_0x27d625(0x335)](_0x3af20b),{'verbose':_0x4c9da2[_0x27d625(0x323)]}),_0x172d0a=_0x279505['data'];return console['error'](a42_0x20b7b8[_0x27d625(0x1c2)]('✔\x20Push\x20complete')),console[_0x27d625(0x326)]('\x20\x20Project\x20ID:\x20'+_0x172d0a['projectId']),console[_0x27d625(0x326)](_0x27d625(0x293)+_0x172d0a[_0x27d625(0x2e8)]),await this[_0x27d625(0x339)](_0x65ea66,_0x172d0a[_0x27d625(0x308)],_0x4c9da2[_0x27d625(0x295)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a42_0x594cc1(0x209)]=a42_0x594cc1(0x24c);['description']=a42_0x594cc1(0x210);async[a42_0x594cc1(0x329)](_0x4e8bd4){const _0x198eb3=a42_0x594cc1,{options:_0x3c4109,args:_0x597f44,tdx:_0xea3348}=_0x4e8bd4,_0x43ee4b=this[_0x198eb3(0x223)](_0x597f44,_0x3c4109),_0x531a57=_0x3c4109[_0x198eb3(0x209)],_0x34d003=_0x3c4109['revision'],_0x13193c=_0x3c4109['skipValidation'];if(!_0x43ee4b)return console[_0x198eb3(0x326)](a42_0x20b7b8[_0x198eb3(0x317)](_0x198eb3(0x2c7)),_0x198eb3(0x1cb)),console[_0x198eb3(0x326)](a42_0x20b7b8[_0x198eb3(0x1f2)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x198eb3(0x326)](a42_0x20b7b8[_0x198eb3(0x1f2)](_0x198eb3(0x241))),0x1;if(!_0x531a57)return console[_0x198eb3(0x326)](a42_0x20b7b8['red'](_0x198eb3(0x2c7)),_0x198eb3(0x1de)),console[_0x198eb3(0x326)](a42_0x20b7b8['dim']('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x3c4109[_0x198eb3(0x323)]&&(console[_0x198eb3(0x326)](_0x198eb3(0x2e6)+_0x43ee4b),console[_0x198eb3(0x326)](_0x198eb3(0x263)+_0x531a57),_0x34d003&&console[_0x198eb3(0x326)](_0x198eb3(0x215)+_0x34d003),_0x3c4109['dryRun']&&console[_0x198eb3(0x326)](_0x198eb3(0x1ef)),_0x13193c&&console[_0x198eb3(0x326)](_0x198eb3(0x33b)));const _0x51c24b=await withSpinner('Analyzing\x20project...',()=>_0xea3348['workflow'][_0x198eb3(0x26b)](_0x43ee4b,_0x531a57,{'revision':_0x34d003,'skipValidation':_0x13193c}),{'verbose':_0x3c4109['verbose']}),_0x2bbbe7=_0x51c24b[_0x198eb3(0x2c2)];console[_0x198eb3(0x326)](_0x198eb3(0x2af)+_0x2bbbe7[_0x198eb3(0x233)]);_0x2bbbe7[_0x198eb3(0x1e8)]&&console[_0x198eb3(0x326)](_0x198eb3(0x28e)+_0x2bbbe7[_0x198eb3(0x1e8)]);console['error'](_0x198eb3(0x263)+_0x2bbbe7[_0x198eb3(0x1f8)]),console[_0x198eb3(0x326)](_0x198eb3(0x215)+_0x2bbbe7['revision']),console[_0x198eb3(0x326)](_0x198eb3(0x348)+_0x2bbbe7['fileCount']);_0x2bbbe7[_0x198eb3(0x2ec)]&&(console['error'](a42_0x20b7b8[_0x198eb3(0x25a)]('\x0a⚠\x20Project\x20\x22'+_0x2bbbe7['newProjectName']+'\x22\x20already\x20exists\x20(ID:\x20'+_0x2bbbe7['existingProjectId']+')')),console['error'](a42_0x20b7b8[_0x198eb3(0x25a)](_0x198eb3(0x2b7))));if(_0x3c4109[_0x198eb3(0x269)])return console[_0x198eb3(0x326)](a42_0x20b7b8[_0x198eb3(0x25a)](_0x198eb3(0x289))),0x0;if(!_0x3c4109[_0x198eb3(0x2ef)]){if(!isInteractive())return console[_0x198eb3(0x326)](a42_0x20b7b8[_0x198eb3(0x317)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x198eb3(0x326)](a42_0x20b7b8['dim'](_0x198eb3(0x324))),0x1;const _0x3356f1=_0x2bbbe7[_0x198eb3(0x1e8)]||a42_0xcdeb1c[_0x198eb3(0x302)](_0x43ee4b),_0x1f456e=_0x2bbbe7[_0x198eb3(0x2ec)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x531a57+_0x198eb3(0x327):_0x198eb3(0x25c)+_0x3356f1+'\x22\x20to\x20new\x20project\x20\x22'+_0x531a57+'\x22?',_0x55e143=await confirmKey(_0x1f456e);if(!_0x55e143)return console[_0x198eb3(0x326)](a42_0x20b7b8['yellow'](_0x198eb3(0x287))),0x1;}const _0xba1150=await withSpinner(_0x2bbbe7[_0x198eb3(0x2ec)]?'Updating\x20'+_0x531a57+'...':_0x198eb3(0x1eb)+_0x531a57+_0x198eb3(0x26e),()=>_0xea3348[_0x198eb3(0x28a)][_0x198eb3(0x33e)](_0x2bbbe7),{'verbose':_0x3c4109['verbose']}),_0x279db1=_0xba1150[_0x198eb3(0x2c2)];return console[_0x198eb3(0x326)](a42_0x20b7b8['green'](_0x2bbbe7['targetExists']?_0x198eb3(0x2c8):_0x198eb3(0x343))),console[_0x198eb3(0x326)]('\x20\x20Project:\x20'+_0x279db1[_0x198eb3(0x1f8)]),console[_0x198eb3(0x326)](_0x198eb3(0x24a)+_0x279db1['newProjectId']),console[_0x198eb3(0x326)](_0x198eb3(0x293)+_0x279db1[_0x198eb3(0x2e8)]),await this['showWorkflowConsoleUrl'](_0xea3348,_0x279db1[_0x198eb3(0x1f8)],_0x3c4109[_0x198eb3(0x295)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a42_0x594cc1(0x209)]=a42_0x594cc1(0x22f);[a42_0x594cc1(0x1ff)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a42_0x594cc1(0x329)](_0x20862c){const _0x2ce1fa=a42_0x594cc1,{options:_0x130072,args:_0x417049,tdx:_0x3dde14}=_0x20862c,_0x14fe14=_0x417049[0x0];if(!_0x14fe14)return console[_0x2ce1fa(0x326)](_0x2ce1fa(0x211)),console[_0x2ce1fa(0x326)](_0x2ce1fa(0x2f3)),0x1;_0x130072[_0x2ce1fa(0x323)]&&console[_0x2ce1fa(0x326)](_0x2ce1fa(0x2c3)+_0x14fe14);if(!_0x130072[_0x2ce1fa(0x2ef)]){if(!isInteractive())return console[_0x2ce1fa(0x326)](a42_0x20b7b8['red'](_0x2ce1fa(0x225)),_0x2ce1fa(0x1b3)),console[_0x2ce1fa(0x326)](a42_0x20b7b8['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x52f354=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x14fe14+_0x2ce1fa(0x1ca));if(!_0x52f354)return console['error'](a42_0x20b7b8[_0x2ce1fa(0x25a)](_0x2ce1fa(0x287))),0x1;}const _0x2ba8a3=await withSpinner(_0x2ce1fa(0x216)+_0x14fe14+'...',()=>_0x3dde14[_0x2ce1fa(0x28a)]['delete'](_0x14fe14),{'verbose':_0x130072[_0x2ce1fa(0x323)]}),_0x27b77a=_0x2ba8a3[_0x2ce1fa(0x2c2)];return console[_0x2ce1fa(0x326)](_0x2ce1fa(0x21d)+_0x27b77a[_0x2ce1fa(0x308)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x27b77a[_0x2ce1fa(0x1d7)]),0x0;}}export function parseKeyValue(_0x34b7b5){const _0x363062=a42_0x594cc1,_0x3272ed=_0x34b7b5[_0x363062(0x25e)]('=');if(_0x3272ed===-0x1)throw new Error(_0x363062(0x2a1)+_0x34b7b5+_0x363062(0x2e7));const _0x1e423a=_0x34b7b5[_0x363062(0x311)](0x0,_0x3272ed),_0x6c5f32=_0x34b7b5[_0x363062(0x311)](_0x3272ed+0x1);if(!_0x1e423a)throw new Error(_0x363062(0x29d));return{'key':_0x1e423a,'value':_0x6c5f32};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a42_0x594cc1(0x209)]=a42_0x594cc1(0x332);[a42_0x594cc1(0x1ff)]=a42_0x594cc1(0x2fc);async['execute'](_0x33dc2e){const _0x13c37c=a42_0x594cc1,{options:_0x1426a8,args:_0x4eb0e7,tdx:_0x4e5620}=_0x33dc2e,_0x25bea3=this['requireProject'](_0x4eb0e7,_0x1426a8);if(!_0x25bea3)return 0x1;_0x1426a8[_0x13c37c(0x323)]&&console[_0x13c37c(0x326)](_0x13c37c(0x2c3)+_0x25bea3);const _0x5b1a1e=await withSpinner(_0x13c37c(0x249),()=>_0x4e5620[_0x13c37c(0x28a)]['listSecrets'](_0x25bea3),{'verbose':_0x1426a8[_0x13c37c(0x323)]}),{secrets:_0x2cabcb}=_0x5b1a1e[_0x13c37c(0x2c2)];return console[_0x13c37c(0x326)](_0x13c37c(0x265)+_0x2cabcb[_0x13c37c(0x1bf)]+_0x13c37c(0x27c)+(_0x2cabcb[_0x13c37c(0x1bf)]!==0x1?'s':'')),await handleSDKOutput(_0x2cabcb,_0x1426a8),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a42_0x594cc1(0x209)]=a42_0x594cc1(0x2a9);[a42_0x594cc1(0x1ff)]=a42_0x594cc1(0x28f);async[a42_0x594cc1(0x329)](_0x3f5c55){const _0x465fd2=a42_0x594cc1,{options:_0x11a546,args:_0x472e05,tdx:_0x152300}=_0x3f5c55;let _0x516574,_0x5304b8;if(_0x472e05[_0x465fd2(0x1bf)]>=0x2)_0x516574=_0x472e05[0x0],_0x5304b8=_0x472e05[0x1];else{if(_0x472e05[_0x465fd2(0x1bf)]===0x1&&_0x11a546[_0x465fd2(0x26d)])_0x516574=_0x11a546['workflowProject'],_0x5304b8=_0x472e05[0x0];else return _0x472e05[_0x465fd2(0x1bf)]===0x1?(console[_0x465fd2(0x326)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x465fd2(0x326)](_0x465fd2(0x20d)),0x1):(console['error'](_0x465fd2(0x218)),console[_0x465fd2(0x326)](_0x465fd2(0x2d6)),0x1);}let _0x2729ef,_0x437cd7;try{({key:_0x2729ef,value:_0x437cd7}=parseKeyValue(_0x5304b8));}catch(_0x2b6dc0){return _0x2b6dc0 instanceof Error&&console[_0x465fd2(0x326)](a42_0x20b7b8[_0x465fd2(0x317)](_0x465fd2(0x2c7)),_0x2b6dc0['message']),0x1;}_0x11a546[_0x465fd2(0x323)]&&(console['error'](_0x465fd2(0x2c3)+_0x516574),console[_0x465fd2(0x326)](_0x465fd2(0x2d3)+_0x2729ef));const _0x47f07c=await withSpinner('Setting\x20secret...',()=>_0x152300['workflow']['setSecret'](_0x516574,_0x2729ef,_0x437cd7),{'verbose':_0x11a546[_0x465fd2(0x323)]}),_0x4d5b02=_0x47f07c[_0x465fd2(0x2c2)];return console[_0x465fd2(0x326)](_0x465fd2(0x222)+_0x4d5b02[_0x465fd2(0x20c)]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x4d5b02['projectName']+'\x27'),(_0x11a546['json']||_0x11a546[_0x465fd2(0x336)])&&await handleSingleObjectOutput(_0x4d5b02,_0x11a546),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a42_0x594cc1(0x209)]=a42_0x594cc1(0x301);['description']=a42_0x594cc1(0x1f1);async[a42_0x594cc1(0x329)](_0x3eb5af){const _0x3c1bd3=a42_0x594cc1,{options:_0x4e727c,args:_0x2330f2,tdx:_0x4085de}=_0x3eb5af;let _0x59bfd0,_0xbdc1f8;if(_0x2330f2[_0x3c1bd3(0x1bf)]>=0x2)_0x59bfd0=_0x2330f2[0x0],_0xbdc1f8=_0x2330f2[0x1];else{if(_0x2330f2['length']===0x1&&_0x4e727c[_0x3c1bd3(0x26d)])_0x59bfd0=_0x4e727c[_0x3c1bd3(0x26d)],_0xbdc1f8=_0x2330f2[0x0];else return _0x2330f2['length']===0x1?(console['error']('Error:\x20Project\x20name\x20is\x20required'),console[_0x3c1bd3(0x326)](_0x3c1bd3(0x20d)),0x1):(console['error'](_0x3c1bd3(0x259)),console[_0x3c1bd3(0x326)](_0x3c1bd3(0x22e)),0x1);}_0x4e727c['verbose']&&(console['error'](_0x3c1bd3(0x2c3)+_0x59bfd0),console[_0x3c1bd3(0x326)]('Key:\x20'+_0xbdc1f8));if(!_0x4e727c['yes']){if(!isInteractive())return console[_0x3c1bd3(0x326)](a42_0x20b7b8[_0x3c1bd3(0x317)](_0x3c1bd3(0x225)),_0x3c1bd3(0x1b3)),console['error'](a42_0x20b7b8['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4d6013=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0xbdc1f8+_0x3c1bd3(0x1c0)+_0x59bfd0+'\x27?');if(!_0x4d6013)return console[_0x3c1bd3(0x326)](a42_0x20b7b8[_0x3c1bd3(0x25a)](_0x3c1bd3(0x287))),0x1;}const _0x3c084d=await withSpinner(_0x3c1bd3(0x2ce),()=>_0x4085de[_0x3c1bd3(0x28a)][_0x3c1bd3(0x1cf)](_0x59bfd0,_0xbdc1f8),{'verbose':_0x4e727c['verbose']}),_0x1279ed=_0x3c084d[_0x3c1bd3(0x2c2)];return console[_0x3c1bd3(0x326)](_0x3c1bd3(0x222)+_0x1279ed['key']+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x1279ed[_0x3c1bd3(0x308)]+'\x27'),(_0x4e727c[_0x3c1bd3(0x2fe)]||_0x4e727c['jsonl'])&&await handleSingleObjectOutput(_0x1279ed,_0x4e727c),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(_0x55e4aa){const _0x1c6cb3=a42_0x594cc1,_0x2e5630=Math['floor'](_0x55e4aa/0x3e8),_0x38d534=Math['floor'](_0x2e5630/0x3c),_0x577eff=Math[_0x1c6cb3(0x29f)](_0x38d534/0x3c),_0x3a2c55=Math['floor'](_0x577eff/0x18);if(_0x3a2c55>0x0){const _0x179287=_0x577eff%0x18;return _0x179287>0x0?_0x3a2c55+'d\x20'+_0x179287+'h':_0x3a2c55+'d';}else{if(_0x577eff>0x0){const _0x3a1f77=_0x38d534%0x3c;return _0x3a1f77>0x0?_0x577eff+'h\x20'+_0x3a1f77+'m':_0x577eff+'h';}else{if(_0x38d534>0x0){const _0x4070e9=_0x2e5630%0x3c;return _0x4070e9>0x0?_0x38d534+'m\x20'+_0x4070e9+'s':_0x38d534+'m';}else return _0x2e5630+'s';}}}function formatTimestamp(_0x7ae069,_0x14f00c){const _0x57c5e4=a42_0x594cc1,_0x34f194=new Date(_0x7ae069),_0x582ec7=String(_0x34f194[_0x57c5e4(0x28d)]())[_0x57c5e4(0x1b5)](0x2,'0'),_0x20782a=String(_0x34f194[_0x57c5e4(0x1c1)]())[_0x57c5e4(0x1b5)](0x2,'0'),_0x2ca28b=_0x582ec7+':'+_0x20782a,_0x3e768f=_0x34f194['getFullYear']()===_0x14f00c[_0x57c5e4(0x340)]()&&_0x34f194[_0x57c5e4(0x22a)]()===_0x14f00c[_0x57c5e4(0x22a)]()&&_0x34f194[_0x57c5e4(0x2d0)]()===_0x14f00c[_0x57c5e4(0x2d0)]();if(_0x3e768f)return _0x2ca28b;else{const _0x26c1f6=String(_0x34f194[_0x57c5e4(0x22a)]()+0x1)[_0x57c5e4(0x1b5)](0x2,'0'),_0x2b5105=String(_0x34f194['getDate']())[_0x57c5e4(0x1b5)](0x2,'0');return _0x26c1f6+'-'+_0x2b5105+'\x20'+_0x2ca28b;}}function formatDate(_0x523616){const _0x5ea4c8=a42_0x594cc1,_0xba23bb=_0x523616['getFullYear'](),_0x51a7a3=String(_0x523616[_0x5ea4c8(0x22a)]()+0x1)[_0x5ea4c8(0x1b5)](0x2,'0'),_0x4f7e72=String(_0x523616[_0x5ea4c8(0x2d0)]())[_0x5ea4c8(0x1b5)](0x2,'0');return _0xba23bb+'-'+_0x51a7a3+'-'+_0x4f7e72;}function getTaskStateIcon(_0x281bd1){const _0x27938e={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x27938e[_0x281bd1]||'⚪';}function getBarChar(_0x8fec6f){const _0x3916ae=a42_0x594cc1;return _0x8fec6f===_0x3916ae(0x326)||_0x8fec6f===_0x3916ae(0x1e1)?'×':'─';}function getBarColor(_0x185b92){const _0x5f1989=a42_0x594cc1,_0x273422={'success':a42_0x20b7b8[_0x5f1989(0x1c2)],'error':a42_0x20b7b8[_0x5f1989(0x317)],'group_error':a42_0x20b7b8['red'],'running':a42_0x20b7b8[_0x5f1989(0x23d)],'blocked':a42_0x20b7b8[_0x5f1989(0x25a)],'planned':a42_0x20b7b8['dim'],'canceling':a42_0x20b7b8[_0x5f1989(0x25a)]};return _0x273422[_0x185b92]||a42_0x20b7b8['white'];}function parseTaskName(_0x5b0573){const _0x4ab199=a42_0x594cc1;let _0x335901=_0x5b0573['replace'](/^\++/,'');const _0x568a35=_0x335901['split']('+'),_0x25adba=_0x568a35[_0x4ab199(0x1bf)]>0x1?_0x568a35[_0x4ab199(0x1bf)]-0x2:0x0,_0x1c9101=_0x568a35[_0x568a35[_0x4ab199(0x1bf)]-0x1]||_0x335901;return{'level':_0x25adba,'name':'+'+_0x1c9101};}function truncateTaskName(_0xd01088,_0x5278a9){const _0x58600d=a42_0x594cc1,_0x15324d=stringWidth(_0xd01088);if(_0x15324d<=_0x5278a9)return _0xd01088;let _0xcda587=_0xd01088;while(stringWidth(_0xcda587+'…')>_0x5278a9&&_0xcda587[_0x58600d(0x1bf)]>0x0){_0xcda587=_0xcda587['slice'](0x0,-0x1);}return _0xcda587+'…';}function calculateTimeScale(_0x56fae1,_0x140101){const _0x471788=a42_0x594cc1;return{'startTime':_0x56fae1[_0x471788(0x247)],'endTime':_0x56fae1['end'],'durationMs':_0x56fae1['duration'],'msPerChar':_0x56fae1[_0x471788(0x31d)]/_0x140101};}function timeToPosition(_0x3633a5,_0x44435c,_0x17ab94){const _0x18e2da=a42_0x594cc1,_0x1d81d8=_0x3633a5-_0x44435c[_0x18e2da(0x29a)],_0x2cdefd=Math[_0x18e2da(0x29f)](_0x1d81d8/_0x44435c[_0x18e2da(0x2d5)]);return Math[_0x18e2da(0x338)](0x0,Math[_0x18e2da(0x1fe)](_0x2cdefd,_0x17ab94));}function renderTimeAxis(_0xa29f6d,_0x9a25e7){const _0x2d3f26=a42_0x594cc1,_0x227995=Math[_0x2d3f26(0x1fe)](TIMELINE_CONFIG[_0x2d3f26(0x31b)],Math['max'](TIMELINE_CONFIG[_0x2d3f26(0x2f0)],Math[_0x2d3f26(0x29f)](_0x9a25e7/TIMELINE_CONFIG[_0x2d3f26(0x2e9)]))),_0x2132a6=_0xa29f6d[_0x2d3f26(0x315)]/(_0x227995-0x1),_0x4eca8a=new Date(_0xa29f6d['startTime']),_0x1f0ae8=[];for(let _0x59debe=0x0;_0x59debe<_0x227995;_0x59debe++){const _0x423855=_0xa29f6d[_0x2d3f26(0x29a)]+_0x59debe*_0x2132a6,_0x3c99f6=timeToPosition(_0x423855,_0xa29f6d,_0x9a25e7),_0x514fe0=formatTimestamp(_0x423855,_0x4eca8a);_0x1f0ae8[_0x2d3f26(0x26a)]({'pos':_0x3c99f6,'text':_0x514fe0});}const _0x5329a6=new Array(_0x9a25e7)[_0x2d3f26(0x235)]('\x20');let _0x161767=-0x1;for(const {pos:_0x45e6bf,text:_0x541bbd}of _0x1f0ae8){let _0x9c8323=Math['max'](0x0,_0x45e6bf-Math[_0x2d3f26(0x29f)](_0x541bbd[_0x2d3f26(0x1bf)]/0x2));_0x9c8323<=_0x161767+TIMELINE_CONFIG[_0x2d3f26(0x23e)]&&(_0x9c8323=_0x161767+TIMELINE_CONFIG[_0x2d3f26(0x23e)]+0x1);_0x9c8323+_0x541bbd['length']>_0x9a25e7&&(_0x9c8323=_0x9a25e7-_0x541bbd[_0x2d3f26(0x1bf)]);if(_0x9c8323>=0x0&&_0x9c8323+_0x541bbd['length']<=_0x9a25e7&&_0x9c8323>_0x161767){for(let _0x531272=0x0;_0x531272<_0x541bbd[_0x2d3f26(0x1bf)];_0x531272++){_0x5329a6[_0x9c8323+_0x531272]=_0x541bbd[_0x531272];}_0x161767=_0x9c8323+_0x541bbd['length']-0x1;}}return _0x5329a6['join']('');}function renderTaskRow(_0x4f4780,_0x4882b6,_0x147de0,_0x4356f5){const _0x18a402=a42_0x594cc1,{level:_0x5deda2,name:_0x12f830}=parseTaskName(_0x4f4780[_0x18a402(0x209)]),_0x1379f6='\x20'[_0x18a402(0x1f3)](_0x5deda2),_0xb74fee=_0x4f4780[_0x18a402(0x202)]?'('+formatElapsed(_0x4f4780[_0x18a402(0x202)][_0x18a402(0x31d)])+')':'',_0x4bcc0d=stringWidth(_0xb74fee),_0x30d1c3=_0x5deda2*0x1,_0xfdae5c=_0x4356f5-_0x30d1c3-_0x4bcc0d-0x1,_0x340e93=truncateTaskName(_0x12f830,_0xfdae5c),_0x47bffc=_0x1379f6+_0x340e93,_0x3bf256=stringWidth(_0x47bffc),_0x42eb5f=_0x4356f5-_0x3bf256-_0x4bcc0d,_0x1c3576=_0x47bffc+'\x20'[_0x18a402(0x1f3)](Math[_0x18a402(0x338)](0x1,_0x42eb5f))+a42_0x20b7b8['dim'](_0xb74fee),_0xc2e6ca=getTaskStateIcon(_0x4f4780[_0x18a402(0x1c6)]),_0x366165=new Array(_0x147de0)[_0x18a402(0x235)]('\x20');if(_0x4f4780[_0x18a402(0x202)]){const _0x60d2bb=timeToPosition(_0x4f4780[_0x18a402(0x202)][_0x18a402(0x247)],_0x4882b6,_0x147de0),_0x399af6=timeToPosition(_0x4f4780[_0x18a402(0x202)][_0x18a402(0x2be)],_0x4882b6,_0x147de0),_0x231db6=getBarChar(_0x4f4780[_0x18a402(0x1c6)]),_0x2e05b3=Math[_0x18a402(0x338)](_0x60d2bb+0x1,_0x399af6);for(let _0x470209=_0x60d2bb;_0x470209<Math[_0x18a402(0x1fe)](_0x2e05b3,_0x147de0);_0x470209++){_0x366165[_0x470209]=_0x231db6;}}const _0x30b908=getBarColor(_0x4f4780[_0x18a402(0x1c6)]),_0x2d6d19=_0x366165['map'](_0x48a6d9=>_0x48a6d9==='\x20'?'\x20':_0x30b908(_0x48a6d9))[_0x18a402(0x2c1)]('');return _0xc2e6ca+'\x20'+_0x1c3576+'│'+_0x2d6d19+'│';}function calculateStats(_0x26fe37){const _0x3733aa=a42_0x594cc1,_0x4020d4={'total':_0x26fe37[_0x3733aa(0x1bf)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x2246d3 of _0x26fe37){if(_0x2246d3['state']==='success')_0x4020d4['success']++;else{if(_0x2246d3['state']===_0x3733aa(0x326)||_0x2246d3['state']===_0x3733aa(0x1e1))_0x4020d4[_0x3733aa(0x326)]++;else _0x2246d3['state']===_0x3733aa(0x245)?_0x4020d4[_0x3733aa(0x245)]++:_0x4020d4[_0x3733aa(0x312)]++;}}return _0x4020d4;}function formatStats(_0x10f19a){const _0xa43418=a42_0x594cc1;return['Total:\x20'+_0x10f19a[_0xa43418(0x1d9)],'✅\x20'+_0x10f19a[_0xa43418(0x33f)],'❌\x20'+_0x10f19a['error'],_0xa43418(0x2f6)+_0x10f19a[_0xa43418(0x245)],'⏳\x20'+_0x10f19a[_0xa43418(0x312)]][_0xa43418(0x2c1)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a42_0x594cc1(0x209)]='workflow:timeline';['description']=a42_0x594cc1(0x29b);async[a42_0x594cc1(0x329)](_0xd0fa29){const _0x1e1ad5=a42_0x594cc1,{options:_0x155ae4,args:_0x2db33f,tdx:_0x37c523}=_0xd0fa29;let _0x38fd2f,_0x22de4d,_0x79d928=![];if(_0x2db33f[0x0]){if(_0x2db33f[0x0][_0x1e1ad5(0x2d2)]('.')){const _0x7f96f=this['parseProjectWorkflowPattern'](_0x2db33f,_0x155ae4);if(!_0x7f96f)return 0x1;_0x38fd2f=_0x7f96f['projectName'],_0x22de4d=_0x7f96f[_0x1e1ad5(0x322)];}else{_0x22de4d=_0x2db33f[0x0],_0x38fd2f=_0x155ae4['workflowProject'];if(!_0x38fd2f)return console[_0x1e1ad5(0x326)](a42_0x20b7b8[_0x1e1ad5(0x317)]('Error:'),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x79d928=!![];}}else{const _0x17fb5e=this[_0x1e1ad5(0x1b6)](_0x2db33f,_0x155ae4);if(!_0x17fb5e)return 0x1;_0x38fd2f=_0x17fb5e[_0x1e1ad5(0x308)],_0x22de4d=_0x17fb5e['workflowName'];}if(_0x155ae4[_0x1e1ad5(0x323)]){if(_0x38fd2f&&_0x22de4d)console[_0x1e1ad5(0x326)](_0x1e1ad5(0x30b)+_0x38fd2f+'.'+_0x22de4d);else _0x38fd2f&&console[_0x1e1ad5(0x326)](_0x1e1ad5(0x278)+_0x38fd2f);}const _0x2b424a=_0x155ae4['attemptId'],_0x613aa4=_0x155ae4[_0x1e1ad5(0x33a)];if(_0x2b424a){_0x613aa4&&console[_0x1e1ad5(0x326)](a42_0x20b7b8[_0x1e1ad5(0x25a)](_0x1e1ad5(0x1b7)),_0x1e1ad5(0x2f2));const _0x203a98=_0x155ae4['follow'];return _0x203a98?await this[_0x1e1ad5(0x2a2)](_0xd0fa29,_0x2b424a):await this['renderSingleTimeline'](_0xd0fa29,_0x2b424a,_0x155ae4),0x0;}if(_0x613aa4){const _0x4aefbf=await withSpinner('Loading\x20session...',()=>_0x37c523[_0x1e1ad5(0x28a)][_0x1e1ad5(0x334)]({'projectName':_0x38fd2f,'workflowName':_0x22de4d,'limit':0x64}),{'verbose':_0x155ae4[_0x1e1ad5(0x323)]}),_0x7b2e88=_0x4aefbf[_0x1e1ad5(0x2c2)][_0x1e1ad5(0x1b4)](_0x482935=>_0x482935['id']===_0x613aa4);if(!_0x7b2e88)return console[_0x1e1ad5(0x326)](a42_0x20b7b8[_0x1e1ad5(0x317)](_0x1e1ad5(0x2c7)),'Session\x20not\x20found:\x20'+_0x613aa4),0x1;if(!_0x7b2e88[_0x1e1ad5(0x1db)]?.['id'])return console[_0x1e1ad5(0x326)](a42_0x20b7b8[_0x1e1ad5(0x317)](_0x1e1ad5(0x2c7)),_0x1e1ad5(0x239)+_0x613aa4+_0x1e1ad5(0x1bb)),0x1;const _0x5f1e2e=_0x7b2e88['lastAttempt']['id'];_0x155ae4[_0x1e1ad5(0x323)]&&console['error'](_0x1e1ad5(0x280)+_0x5f1e2e+_0x1e1ad5(0x258)+_0x613aa4);const _0x354287=_0x155ae4[_0x1e1ad5(0x314)];return _0x354287?await this[_0x1e1ad5(0x2a2)](_0xd0fa29,_0x5f1e2e):await this[_0x1e1ad5(0x2e3)](_0xd0fa29,_0x5f1e2e,_0x155ae4),0x0;}const _0x146870=await withSpinner(_0x1e1ad5(0x31e),()=>_0x37c523[_0x1e1ad5(0x28a)]['sessions']({'projectName':_0x38fd2f,'workflowName':_0x22de4d,'limit':_0x155ae4['limit']||0x32}),{'verbose':_0x155ae4[_0x1e1ad5(0x323)]}),_0x1c95de=_0x146870['data'];if(_0x1c95de[_0x1e1ad5(0x1bf)]===0x0){if(_0x38fd2f&&_0x22de4d)console['error']('No\x20sessions\x20found\x20for:\x20'+_0x38fd2f+'.'+_0x22de4d);else _0x38fd2f?console['error'](_0x1e1ad5(0x2cf)+_0x38fd2f):(console['error']('No\x20workflow\x20sessions\x20found'),console[_0x1e1ad5(0x326)](a42_0x20b7b8[_0x1e1ad5(0x1f2)](_0x1e1ad5(0x1be))));return 0x0;}_0x1c95de['sort']((_0x879554,_0x1629f6)=>{const _0xbe2bc8=_0x1e1ad5,_0x160d96=_0x879554['sessionTime']||'',_0x3a8dc7=_0x1629f6[_0xbe2bc8(0x2b8)]||'';return _0x3a8dc7[_0xbe2bc8(0x2cb)](_0x160d96);});if(_0x155ae4[_0x1e1ad5(0x2fe)]||_0x155ae4[_0x1e1ad5(0x336)])return await handleSDKOutput(_0x1c95de,_0x155ae4),0x0;let _0x106885;if(_0x79d928){const _0x141691=_0x1c95de[0x0];if(!_0x141691[_0x1e1ad5(0x1db)]?.['id'])return console['error']('Latest\x20session\x20has\x20no\x20attempt'),0x0;_0x106885=_0x141691[_0x1e1ad5(0x1db)]['id'],_0x155ae4[_0x1e1ad5(0x323)]&&console[_0x1e1ad5(0x326)](_0x1e1ad5(0x28b)+_0x141691[_0x1e1ad5(0x2b8)]);}else{const _0x4d470d=_0x1c95de[_0x1e1ad5(0x2c4)](_0x19a92c=>{const _0x47e472=_0x1e1ad5,_0x1b5817=getAttemptStatusDisplay(_0x19a92c[_0x47e472(0x1db)]);return{'title':_0x19a92c[_0x47e472(0x2d9)]?.[_0x47e472(0x209)]+'.'+_0x19a92c[_0x47e472(0x28a)]?.['name']+_0x47e472(0x313)+_0x19a92c['sessionTime']+'\x20'+_0x1b5817[_0x47e472(0x30e)],'value':_0x19a92c[_0x47e472(0x1db)]?.['id']||'','description':_0x1b5817[_0x47e472(0x254)]};}),_0x1231ed=await a42_0x5b9160({'type':_0x1e1ad5(0x34c),'name':_0x1e1ad5(0x2eb),'message':_0x1e1ad5(0x21b),'choices':_0x4d470d['filter'](_0x573283=>_0x573283[_0x1e1ad5(0x279)]!=='')});if(!_0x1231ed[_0x1e1ad5(0x2eb)])return 0x0;_0x106885=_0x1231ed[_0x1e1ad5(0x2eb)];}const _0x2561e3=_0x155ae4[_0x1e1ad5(0x314)];return _0x2561e3?await this[_0x1e1ad5(0x2a2)](_0xd0fa29,_0x106885):await this[_0x1e1ad5(0x2e3)](_0xd0fa29,_0x106885,_0x155ae4),0x0;}async[a42_0x594cc1(0x2e3)](_0x5f29e6,_0x5cf205,_0x562f07){const _0x15fb25=a42_0x594cc1,{tdx:_0x26f524}=_0x5f29e6;let _0x259b4e,_0x39791e;try{[_0x259b4e,_0x39791e]=await Promise['all']([_0x26f524['workflow'][_0x15fb25(0x2de)](_0x5cf205),_0x26f524[_0x15fb25(0x28a)]['tasks'](_0x5cf205,![])]);}catch(_0x538833){console[_0x15fb25(0x326)](a42_0x20b7b8[_0x15fb25(0x317)](_0x15fb25(0x2f5)));_0x562f07[_0x15fb25(0x323)]&&console['error'](_0x538833);throw _0x538833;}if(_0x562f07[_0x15fb25(0x2fe)]||_0x562f07[_0x15fb25(0x336)]){const _0x2f11b8=this[_0x15fb25(0x1cd)](_0x259b4e,_0x39791e);await handleSDKOutput([_0x2f11b8],_0x562f07);return;}const _0x73565e=_0x26f524[_0x15fb25(0x2b1)][_0x15fb25(0x295)],_0x14a4b2=this[_0x15fb25(0x292)](_0x259b4e,_0x39791e,_0x73565e);console['log'](_0x14a4b2);}async[a42_0x594cc1(0x2a2)](_0x11568f,_0x3bb716){const _0x135e14=a42_0x594cc1,{tdx:_0x90cbad}=_0x11568f,_0x1137fe=TIMELINE_CONFIG[_0x135e14(0x345)],_0x277b3e=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x3e33f0=0x0;while(_0x3e33f0<_0x277b3e){process[_0x135e14(0x285)][_0x135e14(0x2b6)]&&process[_0x135e14(0x285)][_0x135e14(0x21a)]('\x1bc');let _0x3a30e6,_0x39e138;try{[_0x3a30e6,_0x39e138]=await Promise['all']([_0x90cbad['workflow'][_0x135e14(0x2de)](_0x3bb716),_0x90cbad[_0x135e14(0x28a)][_0x135e14(0x2e5)](_0x3bb716,![])]);}catch(_0x4968c5){console[_0x135e14(0x326)](a42_0x20b7b8[_0x135e14(0x317)](_0x135e14(0x33c)));_0x3e33f0>0x0&&console[_0x135e14(0x326)](a42_0x20b7b8[_0x135e14(0x1f2)](_0x135e14(0x30d)+_0x3e33f0));throw _0x4968c5;}const _0x57e597=_0x90cbad[_0x135e14(0x2b1)]['site'],_0x275e78=this[_0x135e14(0x292)](_0x3a30e6,_0x39e138,_0x57e597);console[_0x135e14(0x1c7)](_0x275e78);const _0x4e2e24=_0x3a30e6['done']&&_0x39e138[_0x135e14(0x2ab)](_0x5079f1=>_0x5079f1[_0x135e14(0x1c6)]!==_0x135e14(0x245)&&_0x5079f1[_0x135e14(0x1c6)]!=='planned');if(_0x4e2e24){console['error'](a42_0x20b7b8[_0x135e14(0x1c2)](_0x135e14(0x264)));break;}console['error'](a42_0x20b7b8['dim'](_0x135e14(0x217)+_0x3e33f0*0x2+_0x135e14(0x226))),await new Promise(_0x1a2600=>setTimeout(_0x1a2600,_0x1137fe)),_0x3e33f0++;}_0x3e33f0>=_0x277b3e&&console[_0x135e14(0x326)](a42_0x20b7b8['yellow'](_0x135e14(0x2b4)));}['renderTimeline'](_0x15f46c,_0x21857f,_0x529063){const _0x4c0ae4=a42_0x594cc1,_0x2a2161=[],_0x547e65=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x350d61=0x5,_0x18d16a=process[_0x4c0ae4(0x285)]['columns']||0x78,_0x5a27da=_0x18d16a-_0x547e65-_0x350d61,_0x37efcd=Math[_0x4c0ae4(0x338)](TIMELINE_CONFIG[_0x4c0ae4(0x303)],Math[_0x4c0ae4(0x1fe)](_0x5a27da,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x1a0a99=new Date(_0x15f46c[_0x4c0ae4(0x2dd)])['getTime'](),_0x443d55=_0x15f46c['finishedAt']?new Date(_0x15f46c[_0x4c0ae4(0x2c6)])[_0x4c0ae4(0x252)]():Date['now'](),_0x197c91={'start':_0x1a0a99,'end':_0x443d55,'duration':_0x443d55-_0x1a0a99},_0x5e4772=new Map(),_0x141064=[];for(const _0x147a27 of _0x21857f){if(_0x147a27[_0x4c0ae4(0x21e)]){const _0x214bc2=new Date(_0x147a27[_0x4c0ae4(0x21e)])['getTime'](),_0x15db8b=_0x147a27[_0x4c0ae4(0x25d)]?new Date(_0x147a27[_0x4c0ae4(0x25d)])[_0x4c0ae4(0x252)]():Date['now'](),_0x4cb257={'start':_0x214bc2,'end':_0x15db8b,'duration':_0x15db8b-_0x214bc2};_0x5e4772['set'](_0x147a27['id'],_0x4cb257),_0x141064[_0x4c0ae4(0x26a)]({'name':_0x147a27['fullName'],'state':_0x147a27[_0x4c0ae4(0x1c6)]||'unknown','window':_0x4cb257});}else _0x141064[_0x4c0ae4(0x26a)]({'name':_0x147a27[_0x4c0ae4(0x2ee)],'state':_0x147a27[_0x4c0ae4(0x1c6)]||'planned','window':undefined});}_0x141064[_0x4c0ae4(0x31a)]((_0x139af8,_0x21b7fb)=>{const _0x4e6c85=_0x4c0ae4;if(!_0x139af8['window'])return 0x1;if(!_0x21b7fb[_0x4e6c85(0x202)])return-0x1;return _0x139af8[_0x4e6c85(0x202)][_0x4e6c85(0x247)]-_0x21b7fb[_0x4e6c85(0x202)][_0x4e6c85(0x247)];});const _0x34f214=_0x141064[_0x4c0ae4(0x1bf)],_0x42bb59=_0x34f214>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x42bb59&&_0x141064[_0x4c0ae4(0x281)](TIMELINE_CONFIG[_0x4c0ae4(0x2ac)]);const _0x2ea82b=calculateTimeScale(_0x197c91,_0x37efcd),_0x21276b=_0x15f46c[_0x4c0ae4(0x32b)]?_0x15f46c[_0x4c0ae4(0x33f)]?a42_0x20b7b8['green'](_0x4c0ae4(0x33f)):a42_0x20b7b8[_0x4c0ae4(0x317)](_0x4c0ae4(0x326)):a42_0x20b7b8[_0x4c0ae4(0x23d)](_0x4c0ae4(0x245)),_0x5cb7b1=_0x15f46c[_0x4c0ae4(0x2d9)]?.['id'],_0x484653=_0x15f46c[_0x4c0ae4(0x33a)];let _0x159a76;if(_0x5cb7b1&&_0x484653){const _0x2abcf9=getWorkflowAttemptUrl(_0x529063,_0x5cb7b1,_0x484653,_0x15f46c['id']);_0x159a76=hyperlink(a42_0x20b7b8[_0x4c0ae4(0x1f2)](_0x15f46c['id']),_0x2abcf9);}else _0x159a76=a42_0x20b7b8[_0x4c0ae4(0x1f2)](_0x15f46c['id']);_0x2a2161[_0x4c0ae4(0x26a)]('Attempt:\x20'+_0x159a76+_0x4c0ae4(0x313)+_0x21276b+_0x4c0ae4(0x313)+formatElapsed(_0x197c91[_0x4c0ae4(0x31d)]));if(_0x141064[_0x4c0ae4(0x1bf)]>0x0){const _0x17d314=renderTimeAxis(_0x2ea82b,_0x37efcd),_0x34d8a0=new Date(_0x197c91[_0x4c0ae4(0x247)]),_0xa33a06=formatDate(_0x34d8a0),_0x5b19a2=TIMELINE_CONFIG[_0x4c0ae4(0x2ca)]+TIMELINE_CONFIG[_0x4c0ae4(0x2b5)]+_0x547e65,_0x263af4=_0xa33a06[_0x4c0ae4(0x1b5)](_0x5b19a2),_0x196aba=a42_0x20b7b8['dim'](_0x263af4);_0x2a2161[_0x4c0ae4(0x26a)](_0x196aba+'\x20'+_0x17d314);for(const _0x31275e of _0x141064){_0x2a2161[_0x4c0ae4(0x26a)](renderTaskRow(_0x31275e,_0x2ea82b,_0x37efcd,_0x547e65));}const _0x5786d5=calculateStats(_0x141064);_0x2a2161['push'](formatStats(_0x5786d5)),_0x42bb59&&_0x2a2161[_0x4c0ae4(0x26a)](a42_0x20b7b8[_0x4c0ae4(0x25a)](_0x4c0ae4(0x1e6)+TIMELINE_CONFIG[_0x4c0ae4(0x2ac)]+_0x4c0ae4(0x1d3)+_0x34f214+'\x20tasks')),_0x2a2161['push'](''),_0x2a2161[_0x4c0ae4(0x26a)](a42_0x20b7b8[_0x4c0ae4(0x1f2)]('💡\x20Tip:\x20Use\x20')+('tdx\x20wf\x20attempt\x20'+_0x15f46c['id']+_0x4c0ae4(0x27a))+a42_0x20b7b8[_0x4c0ae4(0x1f2)]('\x20to\x20see\x20detailed\x20logs'));}else _0x2a2161[_0x4c0ae4(0x26a)](_0x4c0ae4(0x1c8));return _0x2a2161[_0x4c0ae4(0x2c1)]('\x0a');}[a42_0x594cc1(0x1cd)](_0x11a2d5,_0x457c6e){const _0x4560ae=a42_0x594cc1,_0x4b08c7=new Date(_0x11a2d5['createdAt'])[_0x4560ae(0x252)](),_0x1217a2=_0x11a2d5[_0x4560ae(0x2c6)]?new Date(_0x11a2d5[_0x4560ae(0x2c6)])[_0x4560ae(0x252)]():Date[_0x4560ae(0x291)](),_0x120cdb=_0x1217a2-_0x4b08c7,_0x349a15=[];for(const _0x2d9914 of _0x457c6e){if(_0x2d9914[_0x4560ae(0x21e)]){const _0x1a87d4=new Date(_0x2d9914[_0x4560ae(0x21e)])[_0x4560ae(0x252)](),_0x583e71=_0x2d9914[_0x4560ae(0x25d)]?new Date(_0x2d9914[_0x4560ae(0x25d)])[_0x4560ae(0x252)]():Date[_0x4560ae(0x291)]();_0x349a15['push']({'name':_0x2d9914['fullName'],'state':_0x2d9914[_0x4560ae(0x1c6)]||'unknown','window':{'start':_0x1a87d4,'end':_0x583e71,'duration':_0x583e71-_0x1a87d4}});}else _0x349a15[_0x4560ae(0x26a)]({'name':_0x2d9914[_0x4560ae(0x2ee)],'state':_0x2d9914['state']||'planned','window':undefined});}const _0x2d2298=calculateStats(_0x349a15);return{'attempt':{'id':_0x11a2d5['id'],'status':_0x11a2d5[_0x4560ae(0x32b)]?_0x11a2d5[_0x4560ae(0x33f)]?'success':_0x4560ae(0x326):_0x4560ae(0x245),'createdAt':_0x11a2d5['createdAt'],'finishedAt':_0x11a2d5[_0x4560ae(0x2c6)],'duration_ms':_0x120cdb},'tasks':_0x349a15[_0x4560ae(0x2c4)](_0x188f6a=>({'name':_0x188f6a[_0x4560ae(0x209)],'state':_0x188f6a[_0x4560ae(0x1c6)],'startedAt':_0x188f6a[_0x4560ae(0x202)]?new Date(_0x188f6a[_0x4560ae(0x202)][_0x4560ae(0x247)])[_0x4560ae(0x29e)]():null,'updatedAt':_0x188f6a[_0x4560ae(0x202)]?new Date(_0x188f6a[_0x4560ae(0x202)][_0x4560ae(0x2be)])[_0x4560ae(0x29e)]():null,'duration_ms':_0x188f6a['window']?.[_0x4560ae(0x31d)]||null})),'stats':_0x2d2298};}}
1
+ const a42_0x428ab2=a42_0xf21f;(function(_0x4b6732,_0x51b5c2){const _0x5ad71a=a42_0xf21f,_0x3b3d6e=_0x4b6732();while(!![]){try{const _0x264a77=parseInt(_0x5ad71a(0x1e4))/0x1*(-parseInt(_0x5ad71a(0x216))/0x2)+-parseInt(_0x5ad71a(0x21f))/0x3+-parseInt(_0x5ad71a(0x208))/0x4*(-parseInt(_0x5ad71a(0x316))/0x5)+-parseInt(_0x5ad71a(0x21a))/0x6+-parseInt(_0x5ad71a(0x379))/0x7+-parseInt(_0x5ad71a(0x2fc))/0x8*(parseInt(_0x5ad71a(0x24f))/0x9)+parseInt(_0x5ad71a(0x36f))/0xa;if(_0x264a77===_0x51b5c2)break;else _0x3b3d6e['push'](_0x3b3d6e['shift']());}catch(_0x5511aa){_0x3b3d6e['push'](_0x3b3d6e['shift']());}}}(a42_0x3aa6,0xe71c1));import a42_0xc4b429 from'chalk';import{existsSync}from'fs';import a42_0x45a691 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a42_0x2ce4d7 from'prompts';function getAttemptStatusDisplay(_0x42ffb5){const _0x5223e3=a42_0xf21f;if(!_0x42ffb5)return{'icon':'⏳','text':''};const {done:_0x2c6838,success:_0x2a2024,cancelRequested:_0x32390d}=_0x42ffb5;if(!_0x2c6838)return _0x32390d?{'icon':'🛑','text':a42_0xc4b429[_0x5223e3(0x29c)](_0x5223e3(0x27c))}:{'icon':'🔄','text':a42_0xc4b429[_0x5223e3(0x2b5)](_0x5223e3(0x227))};if(_0x2a2024)return{'icon':'✅','text':a42_0xc4b429['green']('success')};return{'icon':'❌','text':a42_0xc4b429[_0x5223e3(0x2ab)](_0x5223e3(0x28e))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x487b36,_0x2c488f,_0x54383a=0x0){const _0x363c57=a42_0xf21f;return _0x487b36[_0x54383a]||_0x2c488f[_0x363c57(0x361)];}[a42_0x428ab2(0x289)](_0xff3ddf,_0x3d01c3,_0x167c0e=0x0){const _0x5d2680=a42_0x428ab2,_0x4f1230=this['resolveProject'](_0xff3ddf,_0x3d01c3,_0x167c0e);if(!_0x4f1230)return console[_0x5d2680(0x28e)](a42_0xc4b429[_0x5d2680(0x2ab)](_0x5d2680(0x349)),_0x5d2680(0x309)),console[_0x5d2680(0x28e)](a42_0xc4b429[_0x5d2680(0x33f)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x4f1230;}['parseProjectWorkflowPattern'](_0x49fbfc,_0x5bc724){const _0x48fbd6=a42_0x428ab2;if(_0x49fbfc[0x0]){const _0x33385e=_0x49fbfc[0x0][_0x48fbd6(0x20f)]('.');if(_0x33385e[_0x48fbd6(0x2f0)]===0x1)return{'projectName':_0x33385e[0x0],'workflowName':undefined};else return _0x33385e[_0x48fbd6(0x2f0)]===0x2?{'projectName':_0x33385e[0x0],'workflowName':_0x33385e[0x1]}:(console[_0x48fbd6(0x28e)](a42_0xc4b429[_0x48fbd6(0x2ab)](_0x48fbd6(0x349)),_0x48fbd6(0x228)),null);}return{'projectName':_0x5bc724['workflowProject'],'workflowName':undefined};}[a42_0x428ab2(0x345)](_0x4fda0e,_0x31ce34,_0x5249a3=0x0){const _0x1a4ebb=a42_0x428ab2;if(_0x4fda0e[_0x5249a3])return _0x4fda0e[_0x5249a3];if(_0x31ce34[_0x1a4ebb(0x361)]){const _0x1896d7=a42_0x45a691[_0x1a4ebb(0x275)](process[_0x1a4ebb(0x2db)](),'workflows',_0x31ce34[_0x1a4ebb(0x361)]);if(existsSync(a42_0x45a691['join'](_0x1896d7,_0x1a4ebb(0x25e))))return _0x1896d7;}return undefined;}async[a42_0x428ab2(0x1e7)](_0xf72830,_0x16717e,_0x5a353f){const _0x79ce7=a42_0x428ab2;try{const _0x4a181b=await _0xf72830[_0x79ce7(0x2c9)]['workflows'](_0x16717e,{'limit':0x1});if(_0x4a181b[_0x79ce7(0x2f0)]>0x0){const _0x49ebb1=_0x4a181b[0x0]['id'],_0x5e7ab7=getWorkflowUrl(_0x5a353f,_0x49ebb1);console[_0x79ce7(0x28e)]('\x20\x20Console:\x20'+a42_0xc4b429[_0x79ce7(0x31b)](_0x5e7ab7));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']='workflow:use';[a42_0x428ab2(0x38d)]=a42_0x428ab2(0x21d);async[a42_0x428ab2(0x2a1)](_0x4bb48f){const _0x5a8395=a42_0x428ab2,{options:_0x3192d0,args:_0x52f919,tdx:_0x409f21}=_0x4bb48f,_0x39caff=_0x52f919[0x0],_0x38bcc7=_0x3192d0[_0x5a8395(0x2d4)];if(_0x38bcc7)return saveSessionContext({'workflow_project':undefined},_0x3192d0['session']),console['log'](a42_0xc4b429['green']('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x39caff)return console[_0x5a8395(0x28e)](a42_0xc4b429[_0x5a8395(0x2ab)](_0x5a8395(0x349)),_0x5a8395(0x309)),console['error'](a42_0xc4b429[_0x5a8395(0x33f)](_0x5a8395(0x29d))),console['error'](a42_0xc4b429[_0x5a8395(0x33f)](_0x5a8395(0x331))),0x1;const _0x34d71a=await withSpinner('Resolving\x20project\x20\x27'+_0x39caff+_0x5a8395(0x2c5),()=>_0x409f21[_0x5a8395(0x2c9)][_0x5a8395(0x23a)](_0x39caff),{'verbose':_0x3192d0[_0x5a8395(0x320)]}),{name:_0x3e64bd}=_0x34d71a[_0x5a8395(0x35c)];return saveSessionContext({'workflow_project':_0x3e64bd},_0x3192d0['session']),console[_0x5a8395(0x2c0)](a42_0xc4b429[_0x5a8395(0x1e6)](_0x5a8395(0x363)+a42_0xc4b429[_0x5a8395(0x31b)](_0x3e64bd))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a42_0x428ab2(0x209)]=a42_0x428ab2(0x2f9);[a42_0x428ab2(0x38d)]='List\x20all\x20workflow\x20projects';async[a42_0x428ab2(0x2a1)](_0x59a761){const _0x57de9a=a42_0x428ab2,{options:_0x2d46ab,args:_0x49057d,tdx:_0x66c208}=_0x59a761,_0x26ab22=_0x49057d[0x0];_0x2d46ab[_0x57de9a(0x320)]&&_0x26ab22&&console[_0x57de9a(0x28e)](_0x57de9a(0x294)+_0x26ab22);const _0x97d6a7=await withSpinner(_0x57de9a(0x203),()=>_0x66c208[_0x57de9a(0x2c9)]['projects'](_0x26ab22,{'limit':_0x2d46ab['limit']}),{'verbose':_0x2d46ab['verbose']});let _0xa89350=_0x97d6a7[_0x57de9a(0x35c)];_0xa89350[_0x57de9a(0x1f2)]((_0x36eb40,_0x3e0afa)=>_0x36eb40[_0x57de9a(0x209)]['localeCompare'](_0x3e0afa[_0x57de9a(0x209)]));const _0x43d267=_0x2d46ab[_0x57de9a(0x2d1)]||0x64,_0x3b37fe=_0xa89350[_0x57de9a(0x2f0)]>=_0x43d267?a42_0xc4b429[_0x57de9a(0x33f)](_0x57de9a(0x270)):'';console[_0x57de9a(0x28e)](_0x57de9a(0x35e)+_0xa89350[_0x57de9a(0x2f0)]+'\x20project'+(_0xa89350[_0x57de9a(0x2f0)]!==0x1?'s':'')+_0x3b37fe);if(_0x2d46ab[_0x57de9a(0x2cc)]===_0x57de9a(0x250)||_0x2d46ab[_0x57de9a(0x2cc)]===_0x57de9a(0x236)||_0x2d46ab[_0x57de9a(0x2cc)]==='table')await handleSDKOutput(_0xa89350,_0x2d46ab);else{if(_0xa89350[_0x57de9a(0x2f0)]===0x0)_0x26ab22?console[_0x57de9a(0x2c0)](_0x57de9a(0x28a)+_0x26ab22):console[_0x57de9a(0x2c0)](_0x57de9a(0x260));else{const _0xa2dbe6=_0xa89350[_0x57de9a(0x376)](_0x3cea2b=>{const _0x2b9824=_0x57de9a,_0x245bc1=_0x3cea2b[_0x2b9824(0x24d)]?.[_0x2b9824(0x2a7)](_0x15c627=>_0x15c627[_0x2b9824(0x263)]===_0x2b9824(0x253)),_0xc8bd13=_0x245bc1?a42_0xc4b429['dim']('\x20(system)'):'';return _0x2b9824(0x207)+_0x3cea2b[_0x2b9824(0x209)]+_0xc8bd13;});await writeOutput(_0xa2dbe6[_0x57de9a(0x275)]('\x0a'),_0x2d46ab[_0x57de9a(0x1f4)],_0x57de9a(0x282));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a42_0x428ab2(0x209)]=a42_0x428ab2(0x248);['description']='List\x20workflows';async['execute'](_0x1b8898){const _0x5c1a06=a42_0x428ab2,{options:_0x6fb8f,args:_0xb9b8e,tdx:_0x2f016d}=_0x1b8898,_0x1a08c9=this['resolveProject'](_0xb9b8e,_0x6fb8f);_0x6fb8f['verbose']&&_0x1a08c9&&console[_0x5c1a06(0x28e)](_0x5c1a06(0x28d)+_0x1a08c9);const _0x1469b4=await withSpinner(_0x5c1a06(0x243),()=>_0x2f016d[_0x5c1a06(0x2c9)][_0x5c1a06(0x26c)](_0x1a08c9,{'limit':_0x6fb8f[_0x5c1a06(0x2d1)]}),{'verbose':_0x6fb8f['verbose']});let _0x38189e=_0x1469b4['data'];_0x38189e[_0x5c1a06(0x1f2)]((_0x1abb7e,_0x2e153b)=>{const _0x228793=_0x5c1a06,_0x2a78c8=_0x1abb7e['name'][_0x228793(0x299)](_0x2e153b[_0x228793(0x209)]);if(_0x2a78c8!==0x0)return _0x2a78c8;return(_0x1abb7e[_0x228793(0x2ba)]?.['name']||'')['localeCompare'](_0x2e153b[_0x228793(0x2ba)]?.[_0x228793(0x209)]||'');});const _0x36101b=_0x6fb8f[_0x5c1a06(0x2d1)]||0x64,_0x1ea809=_0x38189e['length']>=_0x36101b?a42_0xc4b429['dim'](_0x5c1a06(0x270)):'';console['error'](_0x5c1a06(0x35e)+_0x38189e[_0x5c1a06(0x2f0)]+'\x20workflow'+(_0x38189e[_0x5c1a06(0x2f0)]!==0x1?'s':'')+_0x1ea809);if(_0x6fb8f[_0x5c1a06(0x2cc)]===_0x5c1a06(0x250)||_0x6fb8f[_0x5c1a06(0x2cc)]===_0x5c1a06(0x236)||_0x6fb8f[_0x5c1a06(0x2cc)]===_0x5c1a06(0x246))await handleSDKOutput(_0x38189e,_0x6fb8f);else{if(_0x38189e[_0x5c1a06(0x2f0)]===0x0)_0x1a08c9?console['log'](_0x5c1a06(0x23b)+_0x1a08c9):console['log'](_0x5c1a06(0x27e));else{const _0x12a09c=_0x6fb8f[_0x5c1a06(0x34c)],_0x5da909=_0x38189e[_0x5c1a06(0x376)](_0x12e7da=>{const _0x324e1b=_0x5c1a06,_0xaf618d=a42_0xc4b429['dim']('#'+_0x12e7da['id']),_0x37e493=hyperlink(_0xaf618d,getWorkflowUrl(_0x12a09c,_0x12e7da['id'])),_0x3abafc=_0x12e7da[_0x324e1b(0x2ba)]?.[_0x324e1b(0x209)]?a42_0xc4b429['dim']('\x20('+_0x12e7da[_0x324e1b(0x2ba)][_0x324e1b(0x209)]+')'):'';return _0x324e1b(0x2e7)+_0x37e493+'\x20'+_0x12e7da[_0x324e1b(0x209)]+_0x3abafc;});await writeOutput(_0x5da909['join']('\x0a'),_0x6fb8f['output'],_0x5c1a06(0x282));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']='workflow:sessions';[a42_0x428ab2(0x38d)]=a42_0x428ab2(0x311);async['execute'](_0x2c5627){const _0x2e0c31=a42_0x428ab2,{options:_0x4f9f19,args:_0x1c758f,tdx:_0x2762d8}=_0x2c5627,_0x1d5f3a=this[_0x2e0c31(0x2ee)](_0x1c758f,_0x4f9f19);if(!_0x1d5f3a)return 0x1;const {projectName:_0x4c76fa,workflowName:_0x377f5c}=_0x1d5f3a;if(_0x4f9f19[_0x2e0c31(0x320)]){if(_0x4c76fa&&_0x377f5c)console['error'](_0x2e0c31(0x2d9)+_0x4c76fa+'.'+_0x377f5c);else _0x4c76fa&&console['error'](_0x2e0c31(0x247)+_0x4c76fa);const _0x492bc4=_0x4f9f19['status'];_0x492bc4&&console[_0x2e0c31(0x28e)]('Status:\x20'+_0x492bc4);}let _0x45579c=0x28;if(process[_0x2e0c31(0x268)][_0x2e0c31(0x258)]&&!_0x4f9f19[_0x2e0c31(0x1f4)]&&!_0x4f9f19[_0x2e0c31(0x2cc)]){const _0x4b6cba=process[_0x2e0c31(0x268)][_0x2e0c31(0x2ec)]||0x28;_0x45579c=Math[_0x2e0c31(0x29f)](0x14,Math['floor'](_0x4b6cba*0x2/0x3));}const _0x4fc73a=_0x4f9f19[_0x2e0c31(0x2d1)]||_0x45579c,_0x5ca096=await withSpinner(_0x2e0c31(0x204),()=>_0x2762d8[_0x2e0c31(0x2c9)]['sessions']({'projectName':_0x4c76fa,'workflowName':_0x377f5c,'status':_0x4f9f19[_0x2e0c31(0x1e3)],'fromTime':_0x4f9f19['from'],'toTime':_0x4f9f19['to'],'limit':_0x4fc73a}),{'verbose':_0x4f9f19[_0x2e0c31(0x320)]}),_0x3663f0=_0x5ca096[_0x2e0c31(0x35c)];_0x3663f0[_0x2e0c31(0x1f2)]((_0x5dfc60,_0x36c235)=>{const _0x4ef347=_0x2e0c31,_0x53fbd3=_0x5dfc60[_0x4ef347(0x2ef)]||'',_0x59a05d=_0x36c235['sessionTime']||'';return _0x59a05d[_0x4ef347(0x299)](_0x53fbd3);});_0x3663f0[_0x2e0c31(0x2f0)]>=_0x4fc73a?console[_0x2e0c31(0x28e)](_0x2e0c31(0x255)+_0x3663f0[_0x2e0c31(0x2f0)]+_0x2e0c31(0x297)+a42_0xc4b429[_0x2e0c31(0x33f)](_0x2e0c31(0x224))):console['error'](_0x2e0c31(0x35e)+_0x3663f0['length']+'\x20session'+(_0x3663f0[_0x2e0c31(0x2f0)]!==0x1?'s':''));if(_0x4f9f19[_0x2e0c31(0x2cc)]===_0x2e0c31(0x250)||_0x4f9f19[_0x2e0c31(0x2cc)]===_0x2e0c31(0x236)||_0x4f9f19['format']===_0x2e0c31(0x246))await handleSDKOutput(_0x3663f0,_0x4f9f19);else{if(!process['stdout']['isTTY']||_0x4f9f19[_0x2e0c31(0x1f4)]){if(_0x3663f0[_0x2e0c31(0x2f0)]===0x0){if(_0x4c76fa&&_0x377f5c)console['log'](_0x2e0c31(0x2d5)+_0x4c76fa+'.'+_0x377f5c);else _0x4c76fa?console[_0x2e0c31(0x2c0)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x4c76fa):console['log'](_0x2e0c31(0x2f5));}else{const _0x538eb3=_0x4f9f19[_0x2e0c31(0x34c)],_0xd79658=this[_0x2e0c31(0x380)](_0x3663f0,_0x538eb3);_0x4f9f19[_0x2e0c31(0x1f4)]?await writeOutput(_0xd79658,_0x4f9f19[_0x2e0c31(0x1f4)],_0x2e0c31(0x282)):console['log'](_0xd79658);}!_0x4c76fa&&(console[_0x2e0c31(0x28e)](''),console[_0x2e0c31(0x28e)](a42_0xc4b429[_0x2e0c31(0x33f)](_0x2e0c31(0x202))),console[_0x2e0c31(0x28e)](a42_0xc4b429[_0x2e0c31(0x33f)](_0x2e0c31(0x2dd))+'or'+a42_0xc4b429[_0x2e0c31(0x33f)](_0x2e0c31(0x215))));}else{if(_0x3663f0['length']===0x0){if(_0x4c76fa&&_0x377f5c)console[_0x2e0c31(0x2c0)](_0x2e0c31(0x2d5)+_0x4c76fa+'.'+_0x377f5c);else _0x4c76fa?console[_0x2e0c31(0x2c0)](_0x2e0c31(0x37e)+_0x4c76fa):console[_0x2e0c31(0x2c0)](_0x2e0c31(0x2f5));}else await this[_0x2e0c31(0x338)](_0x3663f0,_0x2c5627,_0x4c76fa);}}return 0x0;}[a42_0x428ab2(0x380)](_0x130d62,_0x3bf8b9){const _0xfa46fa=a42_0x428ab2,_0x5bb009=[],_0x343c92=new Map();let _0x230cdd=Infinity,_0x1703ef=-Infinity;for(const _0x34b25b of _0x130d62){if(_0x34b25b[_0xfa46fa(0x2c7)]?.[_0xfa46fa(0x377)]){const _0x45d044=new Date(_0x34b25b['lastAttempt'][_0xfa46fa(0x377)])['getTime'](),_0x46cbee=_0x34b25b[_0xfa46fa(0x2c7)]['finishedAt']?new Date(_0x34b25b[_0xfa46fa(0x2c7)][_0xfa46fa(0x28f)])['getTime']():Date[_0xfa46fa(0x22f)](),_0x5ad1da=_0x34b25b['project']?.[_0xfa46fa(0x209)]||_0xfa46fa(0x26a);!_0x343c92[_0xfa46fa(0x254)](_0x5ad1da)&&_0x343c92[_0xfa46fa(0x2d2)](_0x5ad1da,[]),_0x343c92[_0xfa46fa(0x358)](_0x5ad1da)['push']({'session':_0x34b25b,'startTime':_0x45d044,'endTime':_0x46cbee,'duration':_0x46cbee-_0x45d044}),_0x230cdd=Math['min'](_0x230cdd,_0x45d044),_0x1703ef=Math[_0xfa46fa(0x29f)](_0x1703ef,_0x46cbee);}}if(_0x343c92[_0xfa46fa(0x378)]===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x4f4994=process[_0xfa46fa(0x268)]['columns']||0x78,_0x1cc15e=0x1e,_0x163a6b=0x32,_0x369491=0x4,_0x3bb72a=Math[_0xfa46fa(0x1fe)](_0x163a6b,Math['max'](_0x1cc15e,Math[_0xfa46fa(0x33d)](_0x4f4994*0.3))),_0x320c8d=_0x4f4994-_0x3bb72a-TIMELINE_CONFIG[_0xfa46fa(0x278)]-0x3-_0x369491,_0x50d257=_0x1703ef-_0x230cdd,_0x43b749=_0x50d257/_0x3bb72a,_0x2e2ec0=renderTimeAxis({'startTime':_0x230cdd,'endTime':_0x1703ef,'durationMs':_0x50d257,'msPerChar':_0x43b749},_0x3bb72a),_0x1d16ee=[];for(const _0x2619c3 of _0x343c92[_0xfa46fa(0x234)]()){_0x1d16ee[_0xfa46fa(0x23f)](..._0x2619c3);}_0x1d16ee['sort']((_0x5a2cd3,_0x3f4a4c)=>_0x3f4a4c[_0xfa46fa(0x226)]-_0x5a2cd3[_0xfa46fa(0x226)]);const _0x177d11=new Date(_0x230cdd),_0x53d600=formatDate(_0x177d11),_0x3720ef=_0x369491+TIMELINE_CONFIG[_0xfa46fa(0x2c6)]+TIMELINE_CONFIG[_0xfa46fa(0x336)]+_0x320c8d,_0x3c75f0='\x20'[_0xfa46fa(0x304)](_0x3720ef-_0x53d600[_0xfa46fa(0x2f0)]),_0x3ed0a8=_0x3c75f0+a42_0xc4b429['dim'](_0x53d600)+'\x20'+_0x2e2ec0;_0x5bb009[_0xfa46fa(0x23f)](_0x3ed0a8);const _0x57dded=0x16;let _0x484d8d=0x0;for(const _0x115a5f of _0x1d16ee){const _0x1e77bb=_0x115a5f[_0xfa46fa(0x355)][_0xfa46fa(0x2ba)]?.[_0xfa46fa(0x209)]||'?',_0x1a5e3f=Math[_0xfa46fa(0x1fe)](stringWidth(_0x1e77bb),_0x57dded);_0x484d8d=Math[_0xfa46fa(0x29f)](_0x484d8d,_0x1a5e3f);}for(const _0x1187e4 of _0x1d16ee){const {session:_0x3f3e90,startTime:_0x346d5d,endTime:_0x42907a,duration:_0x479a7c}=_0x1187e4,_0x18943d=_0x3f3e90[_0xfa46fa(0x2ba)]?.['id'],_0x57a7a5=_0x3f3e90['id'],_0x4933c1=_0x3f3e90[_0xfa46fa(0x2ba)]?.[_0xfa46fa(0x209)]||'?',_0x269d81=_0x3f3e90[_0xfa46fa(0x2c9)]?.[_0xfa46fa(0x209)]||'?';let _0x49cf67,_0x80951c;if(_0x3f3e90['lastAttempt']){const _0x1890a8=_0x3f3e90['lastAttempt'];!_0x1890a8[_0xfa46fa(0x24c)]?(_0x49cf67=_0x1890a8[_0xfa46fa(0x343)]?'🛑':'🔄',_0x80951c=_0x1890a8['cancelRequested']?a42_0xc4b429[_0xfa46fa(0x29c)]:a42_0xc4b429[_0xfa46fa(0x2b5)]):(_0x49cf67=_0x1890a8[_0xfa46fa(0x32b)]?'✅':'❌',_0x80951c=_0x1890a8['success']?a42_0xc4b429['green']:a42_0xc4b429['red']);}else _0x49cf67='⏳',_0x80951c=a42_0xc4b429['dim'];const _0x3be5c='#'+_0x57a7a5,_0x19658d=_0x18943d?hyperlink(_0x3be5c,getWorkflowSessionUrl(_0x3bf8b9,_0x18943d,_0x57a7a5)):_0x3be5c;let _0x3372e2=_0x4933c1;stringWidth(_0x4933c1)>_0x57dded&&(_0x3372e2=_0x4933c1[_0xfa46fa(0x24b)](0x0,_0x57dded-0x1)+'…');const _0x27ff45=a42_0xc4b429[_0xfa46fa(0x33f)](_0x3372e2),_0x11c8f3=stringWidth(_0x3372e2),_0x24e7b1='\x20'['repeat'](_0x484d8d-stringWidth(_0x3372e2)+0x2),_0x3d688c='('+formatElapsed(_0x479a7c)+')',_0x517efc=stringWidth(_0x3d688c),_0x5c89eb=stringWidth(_0x3be5c),_0x53916b=_0x5c89eb+0x1+_0x11c8f3+_0x24e7b1['length'],_0x2fce1d=_0x320c8d-_0x53916b-_0x517efc-0x1-0x8;let _0x4a4523=_0x269d81;stringWidth(_0x4a4523)>_0x2fce1d&&(_0x4a4523=_0x4a4523[_0xfa46fa(0x24b)](0x0,_0x2fce1d-0x1)+'…');const _0x449c1b=_0x19658d+'\x20'+_0x27ff45+_0x24e7b1+_0x4a4523,_0x1ddb47=stringWidth(_0x449c1b),_0x12f534=_0x320c8d-_0x1ddb47-_0x517efc,_0x333f16=_0x449c1b+'\x20'['repeat'](Math[_0xfa46fa(0x29f)](0x1,_0x12f534))+a42_0xc4b429[_0xfa46fa(0x33f)](_0x3d688c),_0x5a4528=Math[_0xfa46fa(0x33d)]((_0x346d5d-_0x230cdd)/_0x43b749),_0x3ccb96=Math['floor']((_0x42907a-_0x230cdd)/_0x43b749),_0xbe66a=Math['max'](_0x5a4528+0x1,_0x3ccb96),_0x34f331=new Array(_0x3bb72a)[_0xfa46fa(0x32d)]('\x20');for(let _0x4e5aa2=_0x5a4528;_0x4e5aa2<Math[_0xfa46fa(0x1fe)](_0xbe66a,_0x3bb72a);_0x4e5aa2++){_0x34f331[_0x4e5aa2]='─';}const _0x237d2d=_0x34f331['map'](_0x1cdc7b=>_0x1cdc7b==='\x20'?'\x20':_0x80951c(_0x1cdc7b))['join']('');_0x5bb009['push'](_0x49cf67+'\x20'+_0x333f16+'│'+_0x237d2d+'│');}return _0x5bb009[_0xfa46fa(0x275)]('\x0a');}async[a42_0x428ab2(0x338)](_0x3418b3,_0x5ba534,_0x29e4a8){const _0x30bfc0=a42_0x428ab2,{options:_0x4eaaa2,tdx:_0x109920}=_0x5ba534,_0x7b4f1d=_0x4eaaa2[_0x30bfc0(0x34c)],{timelineRows:_0x1065aa,timeAxisHeader:_0xaf797e}=this[_0x30bfc0(0x328)](_0x3418b3,_0x7b4f1d),_0x5a9fc4=_0x1065aa[_0x30bfc0(0x318)](_0x5d842b=>_0x5d842b['attemptId']);if(_0x5a9fc4[_0x30bfc0(0x2f0)]===0x0){const _0x3343d4=this[_0x30bfc0(0x380)](_0x3418b3,_0x7b4f1d);console['log'](_0x3343d4);!_0x29e4a8&&(console[_0x30bfc0(0x28e)](''),console['error'](a42_0xc4b429[_0x30bfc0(0x33f)](_0x30bfc0(0x202))),console[_0x30bfc0(0x28e)](a42_0xc4b429[_0x30bfc0(0x33f)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a42_0xc4b429['dim'](_0x30bfc0(0x215))));return;}_0xaf797e&&console[_0x30bfc0(0x2c0)](_0xaf797e);const _0x417269=_0x1065aa[_0x30bfc0(0x318)](_0x1381b1=>_0x1381b1[_0x30bfc0(0x25a)])[_0x30bfc0(0x376)](_0x2830eb=>({'title':_0x2830eb['displayLine'],'value':_0x2830eb[_0x30bfc0(0x25a)]})),_0x3e267c=process['stdout'][_0x30bfc0(0x2ec)]||0x3c,_0x3a0c6c=Math[_0x30bfc0(0x29f)](0x28,Math[_0x30bfc0(0x33d)](_0x3e267c*0x2/0x3)),_0x2e8379=await a42_0x2ce4d7({'type':_0x30bfc0(0x298),'name':_0x30bfc0(0x25a),'message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x417269,'initial':-0x1,'limit':_0x3a0c6c,'clearFirst':!![],'fallback':{'title':_0x30bfc0(0x30d),'value':null},'suggest':(_0x304346,_0x2bfcd0)=>{const _0x415ee3=_0x30bfc0;if(!_0x304346)return Promise['resolve'](_0x2bfcd0);const _0x24bc16=_0x2bfcd0[_0x415ee3(0x318)](_0x59c6c4=>{const _0x1421a7=_0x415ee3,_0xa0e065=_0x59c6c4;return _0xa0e065[_0x1421a7(0x31f)][_0x1421a7(0x232)]()[_0x1421a7(0x21c)](_0x304346['toLowerCase']());});return Promise[_0x415ee3(0x277)](_0x24bc16);}}),_0x5736cc=()=>{const _0x4b6e5c=_0x30bfc0;process['stdout'][_0x4b6e5c(0x256)](_0x4b6e5c(0x388)),process['stdout'][_0x4b6e5c(0x256)]('\x1b[1A\x1b[2K'),process[_0x4b6e5c(0x268)]['write']('\x1b[1A\x1b[2K');},_0x23a3de=_0x2e8379&&_0x2e8379[_0x30bfc0(0x25a)]&&_0x2e8379['attemptId']!==null&&_0x2e8379['attemptId'][_0x30bfc0(0x284)]()!=='';if(!_0x23a3de){_0x5736cc(),console[_0x30bfc0(0x2c0)](a42_0xc4b429[_0x30bfc0(0x33f)](_0x30bfc0(0x2e3)));return;}_0x5736cc();const _0x555c55=_0x3418b3[_0x30bfc0(0x303)](_0x1e4a8e=>_0x1e4a8e[_0x30bfc0(0x2c7)]?.['id']===_0x2e8379[_0x30bfc0(0x25a)]);if(_0x555c55){const _0x3b8531=_0x555c55['project']?.['name']||'?',_0x190ea5=_0x555c55[_0x30bfc0(0x2c9)]?.['name']||'?';console['log']('Project:\x20'+a42_0xc4b429[_0x30bfc0(0x33f)](_0x3b8531)+_0x30bfc0(0x332)+a42_0xc4b429['dim'](_0x190ea5));}const _0x4e0a25=new WorkflowTimelineCommand();await _0x4e0a25[_0x30bfc0(0x2a1)]({'args':[],'options':{..._0x4eaaa2,'attemptId':_0x2e8379['attemptId']},'tdx':_0x109920});}['generateSessionTimelineRows'](_0x3b5e3c,_0xfc5ad9){const _0x5a4122=a42_0x428ab2,_0x25cadc=new Map();for(const _0x5353ad of _0x3b5e3c){_0x5353ad['id']&&_0x5353ad[_0x5a4122(0x2c7)]?.['id']&&_0x25cadc[_0x5a4122(0x2d2)](_0x5353ad['id'],_0x5353ad[_0x5a4122(0x2c7)]['id']);}const _0x16d8aa=[];let _0xed128c='';const _0x211ed1=this[_0x5a4122(0x380)](_0x3b5e3c,_0xfc5ad9),_0x3246e0=_0x211ed1['split']('\x0a');for(const _0x3e6e6f of _0x3246e0){if(_0x3e6e6f[_0x5a4122(0x2bd)](_0x5a4122(0x20d))||_0x3e6e6f[_0x5a4122(0x346)](/^\s+\d{4}-\d{2}-\d{2}/))_0xed128c=_0x3e6e6f;else{if(_0x3e6e6f[_0x5a4122(0x346)](/^[✅❌🔄🛑⏳]/)){const _0x2231c7=_0x3e6e6f[_0x5a4122(0x346)](/#(\d+)/),_0x1ab13e=_0x2231c7?_0x2231c7[0x1]:null,_0x157d7f=_0x1ab13e?_0x25cadc[_0x5a4122(0x358)](_0x1ab13e)||null:null,_0x455071=_0x3b5e3c[_0x5a4122(0x303)](_0x187368=>_0x187368['id']===_0x1ab13e),_0x3fcb47=_0x455071?.[_0x5a4122(0x2ba)]?.[_0x5a4122(0x209)]||'';_0x16d8aa[_0x5a4122(0x23f)]({'displayLine':_0x3e6e6f,'attemptId':_0x157d7f,'projectName':_0x3fcb47});}}}return{'timelineRows':_0x16d8aa,'timeAxisHeader':_0xed128c};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a42_0x428ab2(0x209)]=a42_0x428ab2(0x2d0);[a42_0x428ab2(0x38d)]='List\x20workflow\x20attempts';async['execute'](_0x5f1d29){const _0x42c991=a42_0x428ab2,{options:_0x450910,args:_0xcaa2fa,tdx:_0x50fabd}=_0x5f1d29,_0x2a86b7=this[_0x42c991(0x2ee)](_0xcaa2fa,_0x450910);if(!_0x2a86b7)return 0x1;const {projectName:_0x491ddd,workflowName:_0x1bd9ae}=_0x2a86b7,_0x185b5e=_0x450910[_0x42c991(0x218)];if(_0x450910[_0x42c991(0x320)]){if(_0x491ddd&&_0x1bd9ae)console[_0x42c991(0x28e)](_0x42c991(0x2d9)+_0x491ddd+'.'+_0x1bd9ae);else _0x491ddd&&console[_0x42c991(0x28e)](_0x42c991(0x247)+_0x491ddd);_0x185b5e&&console[_0x42c991(0x28e)](_0x42c991(0x2f4));}const _0x4b8c52=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x50fabd[_0x42c991(0x2c9)][_0x42c991(0x360)]({'projectName':_0x491ddd,'workflowName':_0x1bd9ae,'includeRetried':_0x185b5e,'limit':_0x450910[_0x42c991(0x2d1)]}),{'verbose':_0x450910[_0x42c991(0x320)]}),_0x46435d=_0x4b8c52['data'],_0x594c70=_0x450910[_0x42c991(0x2d1)]||0x64,_0x29bb63=_0x46435d[_0x42c991(0x2f0)]>=_0x594c70?a42_0xc4b429[_0x42c991(0x33f)](_0x42c991(0x270)):'';console[_0x42c991(0x28e)]('✔\x20Found\x20'+_0x46435d[_0x42c991(0x2f0)]+_0x42c991(0x296)+(_0x46435d['length']!==0x1?'s':'')+_0x29bb63);if(_0x450910[_0x42c991(0x2cc)]==='json'||_0x450910['format']===_0x42c991(0x236)||_0x450910['format']==='table')await handleSDKOutput(_0x46435d,_0x450910);else{if(_0x46435d[_0x42c991(0x2f0)]===0x0){if(_0x491ddd&&_0x1bd9ae)console['log'](_0x42c991(0x2b1)+_0x491ddd+'.'+_0x1bd9ae);else _0x491ddd?console[_0x42c991(0x2c0)](_0x42c991(0x2bc)+_0x491ddd):console[_0x42c991(0x2c0)](_0x42c991(0x2e5));}else{const _0x393b85=_0x450910[_0x42c991(0x34c)],_0x536db6=_0x46435d[_0x42c991(0x376)](_0x36ba7a=>{const _0x2ffac5=_0x42c991,_0xbc0bb6=a42_0xc4b429[_0x2ffac5(0x33f)]('#'+_0x36ba7a['id']),_0x49e929=_0x36ba7a[_0x2ffac5(0x2ba)]?.['id'],_0x5bd924=_0x36ba7a[_0x2ffac5(0x1f0)]||_0x36ba7a['sessionId'],_0x2c0fbe=_0x49e929&&_0x5bd924?hyperlink(_0xbc0bb6,getWorkflowAttemptUrl(_0x393b85,_0x49e929,_0x5bd924,_0x36ba7a['id'])):_0xbc0bb6,{icon:_0x2557cf,text:_0x5ba146}=getAttemptStatusDisplay(_0x36ba7a),_0x5d95d7=(_0x36ba7a[_0x2ffac5(0x2ba)]?.['name']||'?')+'.'+(_0x36ba7a['workflow']?.['name']||'?'),_0x23fb96=_0x36ba7a['sessionTime']?a42_0xc4b429['dim'](_0x36ba7a[_0x2ffac5(0x2ef)]):'';return(_0x2c0fbe+'\x20'+_0x2557cf+(_0x5ba146?'\x20'+_0x5ba146:'')+'\x20'+_0x5d95d7+'\x20'+_0x23fb96)[_0x2ffac5(0x32e)]();});await writeOutput(_0x536db6[_0x42c991(0x275)]('\x0a'),_0x450910[_0x42c991(0x1f4)],_0x42c991(0x282));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a42_0x428ab2(0x209)]=a42_0x428ab2(0x2ae);['description']=a42_0x428ab2(0x347);async['execute'](_0x3ca189){const _0x1cd361=a42_0x428ab2,{options:_0x4ad007,args:_0x28c6e6,tdx:_0x46e7e7}=_0x3ca189,_0x4f4c66=_0x28c6e6[0x0];if(!_0x4f4c66)return console[_0x1cd361(0x28e)](_0x1cd361(0x327)),0x1;_0x4ad007[_0x1cd361(0x320)]&&console['error']('Attempt\x20ID:\x20'+_0x4f4c66);const _0x1fe832=await withSpinner(_0x1cd361(0x1ec),()=>_0x46e7e7[_0x1cd361(0x2c9)][_0x1cd361(0x2dc)](_0x4f4c66),{'verbose':_0x4ad007[_0x1cd361(0x320)]}),_0x151375=_0x1fe832['data'];let _0x4f7068;!_0x151375['done']?_0x4f7068=_0x151375[_0x1cd361(0x343)]?_0x1cd361(0x27c):_0x1cd361(0x227):_0x4f7068=_0x151375[_0x1cd361(0x32b)]?_0x1cd361(0x32b):_0x1cd361(0x28e);let _0x40786c;if(_0x151375['createdAt']&&_0x151375['finishedAt']){const _0x5129ea=new Date(_0x151375[_0x1cd361(0x377)])[_0x1cd361(0x279)](),_0x111084=new Date(_0x151375['finishedAt'])['getTime']();_0x40786c=Math[_0x1cd361(0x308)]((_0x111084-_0x5129ea)/0x3e8);}const _0x7a84a5={'attempt_id':_0x151375['id'],'status':_0x4f7068,..._0x151375['index']!==undefined&&{'index':_0x151375[_0x1cd361(0x23e)]},..._0x151375[_0x1cd361(0x2ba)]&&{'project':_0x151375['project'][_0x1cd361(0x209)]},..._0x151375[_0x1cd361(0x2c9)]&&{'workflow':_0x151375['workflow']['name']},..._0x151375[_0x1cd361(0x34d)]&&{'session_id':_0x151375[_0x1cd361(0x34d)]},..._0x151375[_0x1cd361(0x2ef)]&&{'session_time':_0x151375[_0x1cd361(0x2ef)]},..._0x151375[_0x1cd361(0x1f3)]&&{'retry_attempt':_0x151375[_0x1cd361(0x1f3)]},..._0x40786c!==undefined&&{'duration_sec':_0x40786c},..._0x151375['createdAt']&&{'created_at':_0x151375[_0x1cd361(0x377)]},..._0x151375[_0x1cd361(0x28f)]&&{'finished_at':_0x151375[_0x1cd361(0x28f)]},...Object[_0x1cd361(0x1ee)](_0x151375[_0x1cd361(0x2b4)])['length']>0x0&&{'params':_0x151375[_0x1cd361(0x2b4)]}};return await handleSingleObjectOutput(_0x7a84a5,_0x4ad007),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a42_0x428ab2(0x209)]=a42_0x428ab2(0x370);[a42_0x428ab2(0x38d)]=a42_0x428ab2(0x341);async['execute'](_0x259189){const _0x2c0374=a42_0x428ab2,{options:_0x47982e,args:_0x41358b,tdx:_0x3458a3}=_0x259189,_0x1253e6=_0x41358b[0x0];if(!_0x1253e6)return console[_0x2c0374(0x28e)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x1e3bd5=_0x47982e[_0x2c0374(0x267)];_0x47982e[_0x2c0374(0x320)]&&(console[_0x2c0374(0x28e)](_0x2c0374(0x2f8)+_0x1253e6),_0x1e3bd5&&console[_0x2c0374(0x28e)]('Including\x20subtasks:\x20yes'));const _0x3f8e77=await withSpinner(_0x2c0374(0x335),()=>_0x3458a3[_0x2c0374(0x2c9)][_0x2c0374(0x329)](_0x1253e6,_0x1e3bd5||![]),{'verbose':_0x47982e[_0x2c0374(0x320)]}),_0x157511=_0x3f8e77[_0x2c0374(0x35c)];return console[_0x2c0374(0x28e)](_0x2c0374(0x35e)+_0x157511[_0x2c0374(0x2f0)]+_0x2c0374(0x350)+(_0x157511[_0x2c0374(0x2f0)]!==0x1?'s':'')),await handleSDKOutput(_0x157511,_0x47982e),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a42_0x428ab2(0x209)]='workflow:logs';[a42_0x428ab2(0x38d)]=a42_0x428ab2(0x35a);async[a42_0x428ab2(0x2a1)](_0x1b4897){const _0x3391d3=a42_0x428ab2,{options:_0x333a30,args:_0x3aba6f,tdx:_0x536417}=_0x1b4897,_0x14c095=_0x3aba6f[0x0];let _0xb44690=_0x3aba6f[0x1];if(!_0x14c095)return console[_0x3391d3(0x28e)](_0x3391d3(0x327)),0x1;_0x333a30[_0x3391d3(0x320)]&&(console['error'](_0x3391d3(0x2f8)+_0x14c095),_0xb44690&&console[_0x3391d3(0x28e)](_0x3391d3(0x24e)+_0xb44690));const _0xc4c1df=await withSpinner(_0x3391d3(0x35d),()=>_0x536417[_0x3391d3(0x2c9)][_0x3391d3(0x1ff)](_0x14c095,_0xb44690),{'verbose':_0x333a30[_0x3391d3(0x320)]}),_0x48bac8=_0xc4c1df[_0x3391d3(0x35c)];if(_0x48bac8[_0x3391d3(0x2f0)]===0x0)return console[_0x3391d3(0x28e)](_0x3391d3(0x2c3)),0x0;if(!_0xb44690&&(_0x333a30[_0x3391d3(0x250)]||_0x333a30[_0x3391d3(0x2cc)]))return await handleSDKOutput(_0x48bac8,_0x333a30),0x0;if(!_0xb44690){const _0x127f61=_0x48bac8[_0x3391d3(0x376)](_0x309eb5=>({'title':_0x309eb5['taskName']+'\x20('+formatBytes(_0x309eb5[_0x3391d3(0x29a)])+')','value':_0x309eb5[_0x3391d3(0x2a2)]})),_0x68657e=await a42_0x2ce4d7({'type':'select','name':_0x3391d3(0x386),'message':_0x3391d3(0x357),'choices':_0x127f61});if(!_0x68657e[_0x3391d3(0x386)])return console[_0x3391d3(0x28e)](_0x3391d3(0x2e3)),0x0;_0xb44690=_0x68657e[_0x3391d3(0x386)];}const _0x2e7800=await withSpinner('Downloading\x20logs...',()=>_0x536417[_0x3391d3(0x2c9)][_0x3391d3(0x223)](_0x14c095,_0xb44690),{'verbose':_0x333a30['verbose']}),_0xa1096a=_0x2e7800[_0x3391d3(0x35c)];return _0xa1096a?console['log'](_0xa1096a):console['error'](_0x3391d3(0x2a0)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a42_0x428ab2(0x209)]='workflow:kill';[a42_0x428ab2(0x38d)]=a42_0x428ab2(0x2cf);async[a42_0x428ab2(0x2a1)](_0x42c81c){const _0xf1dc61=a42_0x428ab2,{options:_0x48a884,args:_0x4538f0,tdx:_0x28546b}=_0x42c81c,_0x4e6376=_0x4538f0[0x0];if(!_0x4e6376)return console['error'](_0xf1dc61(0x327)),0x1;const _0x3a07d6=_0x48a884[_0xf1dc61(0x217)];_0x48a884[_0xf1dc61(0x320)]&&(console['error'](_0xf1dc61(0x2f8)+_0x4e6376),_0x3a07d6&&console[_0xf1dc61(0x28e)](_0xf1dc61(0x324)+_0x3a07d6));if(!_0x48a884[_0xf1dc61(0x36d)]){if(!isInteractive())return console[_0xf1dc61(0x28e)](a42_0xc4b429[_0xf1dc61(0x2ab)](_0xf1dc61(0x365)),_0xf1dc61(0x306)),console[_0xf1dc61(0x28e)](a42_0xc4b429['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x34be01=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x4e6376+'?');if(!_0x34be01)return console['error'](a42_0xc4b429[_0xf1dc61(0x29c)](_0xf1dc61(0x2e3))),0x1;}const _0x3feedd=await withSpinner(_0xf1dc61(0x2f3),()=>_0x28546b[_0xf1dc61(0x2c9)][_0xf1dc61(0x1fc)](_0x4e6376,_0x3a07d6),{'verbose':_0x48a884[_0xf1dc61(0x320)]}),_0x396bf8=_0x3feedd[_0xf1dc61(0x35c)];return console['error']('✔\x20'+_0x396bf8),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a42_0x428ab2(0x209)]=a42_0x428ab2(0x2b8);[a42_0x428ab2(0x38d)]=a42_0x428ab2(0x2a6);async[a42_0x428ab2(0x2a1)](_0x398e56){const _0x49705f=a42_0x428ab2,{options:_0x1ea803,args:_0x3376e1,tdx:_0x1dd1c2}=_0x398e56,_0x2fd88a=_0x3376e1[0x0];if(!_0x2fd88a)return console[_0x49705f(0x28e)](_0x49705f(0x2e8)),console[_0x49705f(0x28e)](_0x49705f(0x2aa)),0x1;let _0x33f80a=![],_0x147ec4=_0x2fd88a;if(_0x2fd88a[_0x49705f(0x2bd)](_0x49705f(0x310)))_0x33f80a=!![],_0x147ec4=_0x2fd88a[_0x49705f(0x25c)](0x8);else{if(_0x2fd88a['startsWith'](_0x49705f(0x366)))_0x33f80a=![],_0x147ec4=_0x2fd88a[_0x49705f(0x25c)](0x8);else return console[_0x49705f(0x28e)](_0x49705f(0x220)),console[_0x49705f(0x28e)](_0x49705f(0x2aa)),0x1;}const _0x2a3b2c=_0x1ea803[_0x49705f(0x1fb)],_0x55c5da=_0x1ea803['resumeFrom'],_0x538cb6=_0x1ea803['params'],_0x21a006=_0x1ea803[_0x49705f(0x1ea)];_0x1ea803[_0x49705f(0x320)]&&(console['error']('Target:\x20'+(_0x33f80a?_0x49705f(0x355):'attempt')+'\x20'+_0x147ec4),_0x2a3b2c&&console[_0x49705f(0x28e)](_0x49705f(0x20a)+_0x2a3b2c),_0x55c5da&&console[_0x49705f(0x28e)](_0x49705f(0x2e4)+_0x55c5da),_0x538cb6&&console[_0x49705f(0x28e)](_0x49705f(0x359)+_0x538cb6),_0x21a006&&console['error'](_0x49705f(0x381)));let _0x2f27b0;if(_0x538cb6)try{if(_0x538cb6[_0x49705f(0x2bd)]('@')){const _0x3d3857=await import(_0x49705f(0x330)),_0x553038=_0x538cb6[_0x49705f(0x25c)](0x1),_0x417206=await _0x3d3857['readFile'](_0x553038,_0x49705f(0x231));_0x2f27b0=JSON[_0x49705f(0x271)](_0x417206);}else _0x2f27b0=JSON[_0x49705f(0x271)](_0x538cb6);}catch{return console[_0x49705f(0x28e)](_0x49705f(0x302)),0x1;}if(!_0x1ea803[_0x49705f(0x36d)]){if(!isInteractive())return console['error'](a42_0xc4b429['red'](_0x49705f(0x365)),_0x49705f(0x306)),console[_0x49705f(0x28e)](a42_0xc4b429[_0x49705f(0x33f)](_0x49705f(0x2a3))),0x1;const _0x5ee51e=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x33f80a?'session':_0x49705f(0x2dc))+'\x20'+_0x147ec4+'?');if(!_0x5ee51e)return console[_0x49705f(0x28e)](a42_0xc4b429[_0x49705f(0x29c)]('Cancelled')),0x1;}let _0x25b839;_0x33f80a?_0x25b839=await withSpinner(_0x49705f(0x240),()=>_0x1dd1c2[_0x49705f(0x2c9)]['retrySession'](_0x147ec4,{'fromTask':_0x2a3b2c,'retryParams':_0x2f27b0}),{'verbose':_0x1ea803[_0x49705f(0x320)]}):_0x25b839=await withSpinner(_0x49705f(0x30f),()=>_0x1dd1c2[_0x49705f(0x2c9)][_0x49705f(0x35f)](_0x147ec4,{'resumeFrom':_0x55c5da,'retryParams':_0x2f27b0,'force':_0x21a006}),{'verbose':_0x1ea803[_0x49705f(0x320)]});const _0x11b4f6=_0x25b839[_0x49705f(0x35c)];return console[_0x49705f(0x28e)](_0x49705f(0x2fb)),console[_0x49705f(0x28e)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x11b4f6[_0x49705f(0x25a)]),console[_0x49705f(0x28e)](_0x49705f(0x1ef)+_0x11b4f6[_0x49705f(0x34d)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a42_0x428ab2(0x209)]=a42_0x428ab2(0x2a8);[a42_0x428ab2(0x38d)]=a42_0x428ab2(0x2e9);async[a42_0x428ab2(0x2a1)](_0xe97da4){const _0x33f827=a42_0x428ab2,{options:_0x3303be,args:_0x53869b,tdx:_0x445ce0}=_0xe97da4;let _0x2c884b=_0x53869b[0x0];if(!_0x2c884b){const _0x5afcb3=this[_0x33f827(0x27a)]([],_0x3303be),_0x3a9ac7=await withSpinner(_0x33f827(0x317),()=>_0x445ce0[_0x33f827(0x2c9)]['workflows'](_0x5afcb3,{'limit':_0x3303be[_0x33f827(0x2d1)]}),{'verbose':_0x3303be[_0x33f827(0x320)]}),_0x1baabc=_0x3a9ac7[_0x33f827(0x35c)];if(_0x1baabc['length']===0x0)return console['error']('No\x20workflows\x20found'),!_0x5afcb3&&console[_0x33f827(0x28e)](a42_0xc4b429['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x17467b=_0x1baabc[_0x33f827(0x376)](_0x5e5e61=>({'title':_0x5e5e61[_0x33f827(0x2ba)]?.[_0x33f827(0x209)]+'.'+_0x5e5e61[_0x33f827(0x209)],'value':_0x5e5e61[_0x33f827(0x2ba)]?.['name']+'.'+_0x5e5e61['name'],'description':_0x5e5e61[_0x33f827(0x307)]?_0x33f827(0x313)+_0x5e5e61['revision']:undefined})),_0x2be59d=await a42_0x2ce4d7({'type':'select','name':_0x33f827(0x2c9),'message':_0x33f827(0x348),'choices':_0x17467b});if(!_0x2be59d['workflow'])return 0x1;_0x2c884b=_0x2be59d[_0x33f827(0x2c9)];}if(!_0x2c884b['includes']('.')){const _0x40915b=this[_0x33f827(0x27a)]([],_0x3303be);if(_0x40915b)_0x2c884b=_0x40915b+'.'+_0x2c884b;else return console['error'](a42_0xc4b429[_0x33f827(0x2ab)](_0x33f827(0x349)),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console['error'](a42_0xc4b429[_0x33f827(0x33f)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x596d0b=_0x3303be[_0x33f827(0x322)],_0x53cbe8=_0x3303be['sessionTime'],_0x2494c6={};if(_0x596d0b&&Array[_0x33f827(0x2c2)](_0x596d0b))for(const _0x2ed9ed of _0x596d0b){const _0x1908c7=_0x2ed9ed[_0x33f827(0x283)]('=');if(_0x1908c7===-0x1)return console['error']('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x2ed9ed),console[_0x33f827(0x28e)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x49dfb3=_0x2ed9ed[_0x33f827(0x25c)](0x0,_0x1908c7),_0x283f45=_0x2ed9ed[_0x33f827(0x25c)](_0x1908c7+0x1);try{_0x2494c6[_0x49dfb3]=JSON[_0x33f827(0x271)](_0x283f45);}catch{_0x2494c6[_0x49dfb3]=_0x283f45;}}_0x3303be[_0x33f827(0x320)]&&(console[_0x33f827(0x28e)]('Workflow:\x20'+_0x2c884b),Object[_0x33f827(0x1ee)](_0x2494c6)[_0x33f827(0x2f0)]>0x0&&console['error'](_0x33f827(0x233)+JSON[_0x33f827(0x2d7)](_0x2494c6)),_0x53cbe8&&console['error'](_0x33f827(0x333)+_0x53cbe8));const _0x4ce8ee=await withSpinner(_0x33f827(0x2e1),()=>_0x445ce0[_0x33f827(0x2c9)][_0x33f827(0x27f)](_0x2c884b,_0x2494c6,{'sessionTime':_0x53cbe8}),{'verbose':_0x3303be[_0x33f827(0x320)]}),_0x4b0510=_0x4ce8ee[_0x33f827(0x35c)];console[_0x33f827(0x28e)](_0x33f827(0x280)),console['error'](_0x33f827(0x32c)+_0x4b0510['id']),console[_0x33f827(0x28e)](_0x33f827(0x1ef)+_0x4b0510['sessionId']),console['error']('\x20\x20Project:\x20'+_0x4b0510[_0x33f827(0x2ba)]?.[_0x33f827(0x209)]),console['error'](_0x33f827(0x213)+_0x4b0510[_0x33f827(0x2c9)]?.[_0x33f827(0x209)]);if(_0x4b0510[_0x33f827(0x2ba)]?.['id']&&_0x4b0510[_0x33f827(0x34d)]&&_0x4b0510['id']){const _0xd16d1=_0x3303be[_0x33f827(0x34c)],_0x3e2e24=getConsoleUrl(_0xd16d1,_0x33f827(0x295)+_0x4b0510[_0x33f827(0x2ba)]['id']+_0x33f827(0x1f5)+_0x4b0510[_0x33f827(0x34d)]+_0x33f827(0x26e)+_0x4b0510['id']);console[_0x33f827(0x28e)]('\x20\x20Console:\x20'+a42_0xc4b429[_0x33f827(0x31b)](_0x3e2e24));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a42_0x428ab2(0x209)]=a42_0x428ab2(0x214);[a42_0x428ab2(0x38d)]=a42_0x428ab2(0x1f9);async['execute'](_0x10e8bb){const _0x400ae7=a42_0x428ab2,{options:_0x572d7a,args:_0x4db4b0,tdx:_0x2d3cff}=_0x10e8bb,_0x2edfe4=_0x4db4b0[0x0],_0x59b77d=_0x4db4b0[0x1]||'.';if(!_0x2edfe4)return console[_0x400ae7(0x28e)](_0x400ae7(0x31a)),console[_0x400ae7(0x28e)](_0x400ae7(0x26d)),0x1;const _0x306395=_0x572d7a[_0x400ae7(0x307)];_0x572d7a[_0x400ae7(0x320)]&&(console[_0x400ae7(0x28e)](_0x400ae7(0x339)+_0x2edfe4),console[_0x400ae7(0x28e)]('Output\x20directory:\x20'+_0x59b77d),_0x306395&&console[_0x400ae7(0x28e)](_0x400ae7(0x29b)+_0x306395));const _0x385f2d=await withSpinner(_0x400ae7(0x37a)+_0x2edfe4+_0x400ae7(0x28c),()=>_0x2d3cff['workflow'][_0x400ae7(0x21b)](_0x2edfe4,_0x59b77d,{'revision':_0x306395}),{'verbose':_0x572d7a[_0x400ae7(0x320)]}),_0x192080=_0x385f2d['data'];return console['error'](_0x400ae7(0x31d)+_0x192080[_0x400ae7(0x353)]),console[_0x400ae7(0x28e)](_0x400ae7(0x1f8)+_0x192080[_0x400ae7(0x307)]),console[_0x400ae7(0x28e)](_0x400ae7(0x2d6)+_0x192080[_0x400ae7(0x2f6)]),console[_0x400ae7(0x28e)](_0x400ae7(0x37b)+_0x59b77d+'/'+_0x192080[_0x400ae7(0x353)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a42_0x428ab2(0x209)]='workflow:upload';['description']='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async['execute'](_0x54038e){const _0x35d7f8=a42_0x428ab2,{options:_0x35c90f,args:_0x1ee3b1,tdx:_0x5c5753}=_0x54038e;let _0x5bc0b2='.',_0x5ebc33=_0x35c90f['name'];if(_0x1ee3b1[0x0]){const {promises:_0x47c474}=await import('fs');try{const _0x4c9e73=await _0x47c474[_0x35d7f8(0x257)](_0x1ee3b1[0x0]);if(_0x4c9e73[_0x35d7f8(0x356)]())_0x5bc0b2=_0x1ee3b1[0x0];else return console[_0x35d7f8(0x28e)](_0x35d7f8(0x2b2)+_0x1ee3b1[0x0]+_0x35d7f8(0x272)),0x1;}catch{_0x5ebc33=_0x1ee3b1[0x0],_0x5bc0b2='.';}}const _0x1bbd34=_0x35c90f[_0x35d7f8(0x307)],_0x71f29a=_0x35c90f['skipValidation'];_0x35c90f[_0x35d7f8(0x320)]&&(console[_0x35d7f8(0x28e)]('Project\x20directory:\x20'+_0x5bc0b2),_0x5ebc33&&console[_0x35d7f8(0x28e)]('Project\x20name:\x20'+_0x5ebc33),_0x1bbd34&&console[_0x35d7f8(0x28e)]('Revision:\x20'+_0x1bbd34),_0x71f29a&&console[_0x35d7f8(0x28e)](_0x35d7f8(0x30c)));const _0x2d7224=await withSpinner(_0x35d7f8(0x2a4),()=>_0x5c5753[_0x35d7f8(0x2c9)][_0x35d7f8(0x23f)](_0x5bc0b2,{'projectName':_0x5ebc33,'revision':_0x1bbd34,'skipValidation':_0x71f29a}),{'verbose':_0x35c90f[_0x35d7f8(0x320)]}),_0x2f8f12=_0x2d7224[_0x35d7f8(0x35c)];return console[_0x35d7f8(0x28e)]('✔\x20Pushed\x20'+_0x2f8f12[_0x35d7f8(0x353)]),console[_0x35d7f8(0x28e)](_0x35d7f8(0x1f7)+_0x2f8f12[_0x35d7f8(0x290)]),console['error'](_0x35d7f8(0x1f8)+_0x2f8f12[_0x35d7f8(0x307)]),await this[_0x35d7f8(0x1e7)](_0x5c5753,_0x2f8f12[_0x35d7f8(0x353)],_0x35c90f['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a42_0x428ab2(0x209)]=a42_0x428ab2(0x33e);[a42_0x428ab2(0x38d)]=a42_0x428ab2(0x305);async['execute'](_0xa3fd6d){const _0x3d89a6=a42_0x428ab2,{options:_0x23070a,args:_0x118f5a,tdx:_0x494a45}=_0xa3fd6d,_0x55a4a1=_0x118f5a[0x0],_0x28ee8a=_0x118f5a[0x1];if(!_0x55a4a1)return console[_0x3d89a6(0x28e)](a42_0xc4b429[_0x3d89a6(0x2ab)](_0x3d89a6(0x349)),_0x3d89a6(0x309)),console[_0x3d89a6(0x28e)](a42_0xc4b429[_0x3d89a6(0x33f)](_0x3d89a6(0x385))),0x1;const _0x405373=_0x23070a['revision'];_0x23070a[_0x3d89a6(0x320)]&&(console[_0x3d89a6(0x28e)]('Project:\x20'+_0x55a4a1),_0x28ee8a&&console[_0x3d89a6(0x28e)](_0x3d89a6(0x2e6)+_0x28ee8a),_0x405373&&console[_0x3d89a6(0x28e)](_0x3d89a6(0x29b)+_0x405373),_0x23070a['dryRun']&&console['error']('Dry\x20run:\x20yes'));const _0x141f9f=await withSpinner(_0x3d89a6(0x2ad)+_0x55a4a1+'...',()=>_0x494a45[_0x3d89a6(0x2c9)][_0x3d89a6(0x2fe)](_0x55a4a1,{'targetDir':_0x28ee8a,'revision':_0x405373}),{'verbose':_0x23070a[_0x3d89a6(0x320)]}),_0x9911b8=_0x141f9f[_0x3d89a6(0x35c)];_0x9911b8[_0x3d89a6(0x25b)]?console[_0x3d89a6(0x28e)](_0x3d89a6(0x319)+_0x9911b8[_0x3d89a6(0x353)]):console[_0x3d89a6(0x28e)](_0x3d89a6(0x22e)+_0x9911b8[_0x3d89a6(0x353)]);console[_0x3d89a6(0x28e)]('\x20\x20Revision:\x20'+_0x9911b8[_0x3d89a6(0x307)]),console[_0x3d89a6(0x28e)](_0x3d89a6(0x33c)+(a42_0x45a691[_0x3d89a6(0x367)](process[_0x3d89a6(0x2db)](),_0x9911b8['targetDir'])||'.')),console[_0x3d89a6(0x28e)](_0x3d89a6(0x22a)+a42_0xc4b429[_0x3d89a6(0x1e6)]('+'+_0x9911b8['summary'][_0x3d89a6(0x285)]+_0x3d89a6(0x252))+',\x20'+(a42_0xc4b429[_0x3d89a6(0x29c)]('~'+_0x9911b8['summary'][_0x3d89a6(0x22d)]+_0x3d89a6(0x1e5))+',\x20')+(a42_0xc4b429['red']('-'+_0x9911b8['summary']['deleted']+_0x3d89a6(0x314))+',\x20')+(''+a42_0xc4b429[_0x3d89a6(0x33f)](_0x9911b8[_0x3d89a6(0x344)][_0x3d89a6(0x326)]+_0x3d89a6(0x249))));for(const _0x2a97d9 of _0x9911b8[_0x3d89a6(0x2b6)]){_0x2a97d9[_0x3d89a6(0x244)]===_0x3d89a6(0x22d)&&_0x2a97d9[_0x3d89a6(0x22c)]&&(console[_0x3d89a6(0x28e)]('\x0a'+a42_0xc4b429[_0x3d89a6(0x31b)]('---\x20'+_0x2a97d9[_0x3d89a6(0x287)])),console[_0x3d89a6(0x28e)](_0x2a97d9[_0x3d89a6(0x22c)]));}if(!_0x9911b8['hasChanges'])return saveSessionContext({'workflow_project':_0x9911b8[_0x3d89a6(0x353)]},_0x23070a['session']),console['error'](a42_0xc4b429['green'](_0x3d89a6(0x2df))),console[_0x3d89a6(0x28e)](a42_0xc4b429['dim'](_0x3d89a6(0x222)+_0x9911b8[_0x3d89a6(0x353)])),0x0;if(_0x23070a[_0x3d89a6(0x1fd)])return console[_0x3d89a6(0x28e)](a42_0xc4b429[_0x3d89a6(0x29c)](_0x3d89a6(0x312))),0x0;if(!_0x23070a['yes']){if(!isInteractive())return console[_0x3d89a6(0x28e)](a42_0xc4b429[_0x3d89a6(0x2ab)](_0x3d89a6(0x365)),_0x3d89a6(0x306)),console[_0x3d89a6(0x28e)](a42_0xc4b429[_0x3d89a6(0x33f)](_0x3d89a6(0x2a3))),0x1;const _0x1077bd=await confirmKey(_0x3d89a6(0x37f));if(!_0x1077bd)return console[_0x3d89a6(0x28e)](a42_0xc4b429[_0x3d89a6(0x29c)](_0x3d89a6(0x2e3)),_0x3d89a6(0x387)),0x1;}await withSpinner(_0x3d89a6(0x2d8),()=>_0x494a45['workflow'][_0x3d89a6(0x1ed)](_0x9911b8,{'revision':_0x405373}),{'verbose':_0x23070a[_0x3d89a6(0x320)]}),saveSessionContext({'workflow_project':_0x9911b8[_0x3d89a6(0x353)]},_0x23070a['session']),console[_0x3d89a6(0x28e)](a42_0xc4b429[_0x3d89a6(0x1e6)]('✔\x20Pull\x20complete'));const _0x3a9af4=a42_0x45a691[_0x3d89a6(0x367)](process[_0x3d89a6(0x2db)](),_0x9911b8[_0x3d89a6(0x245)])||'.';return console[_0x3d89a6(0x28e)](a42_0xc4b429['dim'](_0x3d89a6(0x37b)+_0x3a9af4)),console[_0x3d89a6(0x28e)](a42_0xc4b429[_0x3d89a6(0x33f)](_0x3d89a6(0x222)+_0x9911b8[_0x3d89a6(0x353)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a42_0x428ab2(0x354);['description']=a42_0x428ab2(0x269);async[a42_0x428ab2(0x2a1)](_0x443e1b){const _0x141a71=a42_0x428ab2,{options:_0x45eb1d,args:_0x14142e,tdx:_0x2b04ad}=_0x443e1b,_0x4d7398=this[_0x141a71(0x345)](_0x14142e,_0x45eb1d),_0x43ea9f=_0x45eb1d[_0x141a71(0x307)],_0x47ceaa=_0x45eb1d['skipValidation'];_0x45eb1d[_0x141a71(0x320)]&&(_0x4d7398&&console[_0x141a71(0x28e)]('Source\x20directory:\x20'+_0x4d7398),_0x43ea9f&&console[_0x141a71(0x28e)](_0x141a71(0x29b)+_0x43ea9f),_0x45eb1d[_0x141a71(0x1fd)]&&console[_0x141a71(0x28e)](_0x141a71(0x36e)),_0x47ceaa&&console[_0x141a71(0x28e)](_0x141a71(0x30c)));let _0x148e1a;try{_0x148e1a=await withSpinner(_0x141a71(0x34b),()=>_0x2b04ad['workflow'][_0x141a71(0x292)]({'sourceDir':_0x4d7398,'revision':_0x43ea9f,'skipValidation':_0x47ceaa}),{'verbose':_0x45eb1d[_0x141a71(0x320)]});}catch(_0x4f8cd4){if(_0x4f8cd4 instanceof Error&&_0x4f8cd4['message'][_0x141a71(0x21c)](_0x141a71(0x2da)))return console[_0x141a71(0x28e)](a42_0xc4b429[_0x141a71(0x2ab)](_0x141a71(0x349)),_0x141a71(0x237)),_0x45eb1d[_0x141a71(0x361)]?console['error'](a42_0xc4b429[_0x141a71(0x33f)](_0x141a71(0x35b)+_0x45eb1d['workflowProject']+_0x141a71(0x389)+_0x45eb1d[_0x141a71(0x361)]+'\x27')):console[_0x141a71(0x28e)](a42_0xc4b429[_0x141a71(0x33f)](_0x141a71(0x352))),0x1;throw _0x4f8cd4;}const _0x19a403=_0x148e1a[_0x141a71(0x35c)];console[_0x141a71(0x28e)](_0x141a71(0x372)+_0x19a403[_0x141a71(0x353)]),console[_0x141a71(0x28e)](_0x141a71(0x315)+_0x19a403[_0x141a71(0x31c)]),console['error'](_0x141a71(0x1f8)+_0x19a403['revision']),console[_0x141a71(0x28e)]('\x20\x20Changes:\x20'+a42_0xc4b429[_0x141a71(0x1e6)]('+'+_0x19a403[_0x141a71(0x344)][_0x141a71(0x285)]+_0x141a71(0x252))+',\x20'+(a42_0xc4b429[_0x141a71(0x29c)]('~'+_0x19a403['summary'][_0x141a71(0x22d)]+_0x141a71(0x1e5))+',\x20')+(a42_0xc4b429[_0x141a71(0x2ab)]('-'+_0x19a403['summary']['deleted']+_0x141a71(0x314))+',\x20')+(''+a42_0xc4b429[_0x141a71(0x33f)](_0x19a403['summary']['unchanged']+'\x20unchanged')));for(const _0x1e1f59 of _0x19a403[_0x141a71(0x2b6)]){_0x1e1f59[_0x141a71(0x244)]===_0x141a71(0x22d)&&_0x1e1f59[_0x141a71(0x22c)]&&(console['error']('\x0a'+a42_0xc4b429[_0x141a71(0x31b)](_0x141a71(0x235)+_0x1e1f59[_0x141a71(0x287)])),console[_0x141a71(0x28e)](_0x1e1f59[_0x141a71(0x22c)]));}if(!_0x19a403['hasChanges'])return console['error'](a42_0xc4b429[_0x141a71(0x1e6)](_0x141a71(0x36a))),await this['showWorkflowConsoleUrl'](_0x2b04ad,_0x19a403['projectName'],_0x45eb1d['site']),0x0;if(_0x45eb1d[_0x141a71(0x1fd)])return console[_0x141a71(0x28e)](a42_0xc4b429[_0x141a71(0x29c)](_0x141a71(0x2c4))),0x0;if(!_0x45eb1d[_0x141a71(0x36d)]){if(!isInteractive())return console[_0x141a71(0x28e)](a42_0xc4b429['red'](_0x141a71(0x365)),_0x141a71(0x306)),console[_0x141a71(0x28e)](a42_0xc4b429[_0x141a71(0x33f)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4014e2=await confirmKey(_0x141a71(0x38c));if(!_0x4014e2)return console[_0x141a71(0x28e)](a42_0xc4b429[_0x141a71(0x29c)](_0x141a71(0x2e3)),_0x141a71(0x23d)),0x1;}const _0x11409f=await withSpinner(_0x141a71(0x2cb),()=>_0x2b04ad[_0x141a71(0x2c9)][_0x141a71(0x225)](_0x19a403),{'verbose':_0x45eb1d['verbose']}),_0x40324c=_0x11409f[_0x141a71(0x35c)];return console[_0x141a71(0x28e)](a42_0xc4b429[_0x141a71(0x1e6)](_0x141a71(0x2af))),console[_0x141a71(0x28e)](_0x141a71(0x1f7)+_0x40324c[_0x141a71(0x290)]),console[_0x141a71(0x28e)](_0x141a71(0x1f8)+_0x40324c[_0x141a71(0x307)]),await this[_0x141a71(0x1e7)](_0x2b04ad,_0x40324c[_0x141a71(0x353)],_0x45eb1d['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a42_0x428ab2(0x209)]='workflow:clone';[a42_0x428ab2(0x38d)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async['execute'](_0x104a16){const _0x533f3e=a42_0x428ab2,{options:_0x86a0be,args:_0x5ec366,tdx:_0x22f658}=_0x104a16,_0x54f69e=this[_0x533f3e(0x345)](_0x5ec366,_0x86a0be),_0x42edbc=_0x86a0be[_0x533f3e(0x209)],_0x644f23=_0x86a0be[_0x533f3e(0x307)],_0x1356bb=_0x86a0be[_0x533f3e(0x301)];if(!_0x54f69e)return console[_0x533f3e(0x28e)](a42_0xc4b429[_0x533f3e(0x2ab)](_0x533f3e(0x349)),_0x533f3e(0x212)),console['error'](a42_0xc4b429[_0x533f3e(0x33f)](_0x533f3e(0x20c))),console[_0x533f3e(0x28e)](a42_0xc4b429[_0x533f3e(0x33f)](_0x533f3e(0x36b))),0x1;if(!_0x42edbc)return console[_0x533f3e(0x28e)](a42_0xc4b429['red'](_0x533f3e(0x349)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x533f3e(0x28e)](a42_0xc4b429['dim'](_0x533f3e(0x20c))),0x1;_0x86a0be[_0x533f3e(0x320)]&&(console[_0x533f3e(0x28e)]('Source\x20directory:\x20'+_0x54f69e),console[_0x533f3e(0x28e)](_0x533f3e(0x273)+_0x42edbc),_0x644f23&&console[_0x533f3e(0x28e)](_0x533f3e(0x29b)+_0x644f23),_0x86a0be['dryRun']&&console[_0x533f3e(0x28e)]('Dry\x20run:\x20yes'),_0x1356bb&&console[_0x533f3e(0x28e)](_0x533f3e(0x30c)));const _0x6d1500=await withSpinner('Analyzing\x20project...',()=>_0x22f658[_0x533f3e(0x2c9)]['prepareCloneProject'](_0x54f69e,_0x42edbc,{'revision':_0x644f23,'skipValidation':_0x1356bb}),{'verbose':_0x86a0be[_0x533f3e(0x320)]}),_0x212d3b=_0x6d1500[_0x533f3e(0x35c)];console['error'](_0x533f3e(0x266)+_0x212d3b['sourceDir']);_0x212d3b[_0x533f3e(0x362)]&&console['error']('Source\x20project:\x20'+_0x212d3b[_0x533f3e(0x362)]);console[_0x533f3e(0x28e)](_0x533f3e(0x273)+_0x212d3b[_0x533f3e(0x2f2)]),console[_0x533f3e(0x28e)]('Revision:\x20'+_0x212d3b['revision']),console[_0x533f3e(0x28e)](_0x533f3e(0x1e9)+_0x212d3b['fileCount']);_0x212d3b[_0x533f3e(0x373)]&&(console[_0x533f3e(0x28e)](a42_0xc4b429[_0x533f3e(0x29c)]('\x0a⚠\x20Project\x20\x22'+_0x212d3b[_0x533f3e(0x2f2)]+_0x533f3e(0x2fa)+_0x212d3b[_0x533f3e(0x383)]+')')),console[_0x533f3e(0x28e)](a42_0xc4b429[_0x533f3e(0x29c)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x86a0be[_0x533f3e(0x1fd)])return console['error'](a42_0xc4b429[_0x533f3e(0x29c)]('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x86a0be[_0x533f3e(0x36d)]){if(!isInteractive())return console[_0x533f3e(0x28e)](a42_0xc4b429[_0x533f3e(0x2ab)](_0x533f3e(0x365)),_0x533f3e(0x306)),console['error'](a42_0xc4b429[_0x533f3e(0x33f)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x183905=_0x212d3b[_0x533f3e(0x362)]||a42_0x45a691[_0x533f3e(0x1fa)](_0x54f69e),_0x2ab443=_0x212d3b['targetExists']?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x42edbc+'\x22\x20with\x20new\x20revision?':_0x533f3e(0x25f)+_0x183905+_0x533f3e(0x334)+_0x42edbc+'\x22?',_0x14553a=await confirmKey(_0x2ab443);if(!_0x14553a)return console[_0x533f3e(0x28e)](a42_0xc4b429[_0x533f3e(0x29c)]('Cancelled')),0x1;}const _0x29049d=await withSpinner(_0x212d3b[_0x533f3e(0x373)]?_0x533f3e(0x2be)+_0x42edbc+'...':_0x533f3e(0x2a5)+_0x42edbc+_0x533f3e(0x28c),()=>_0x22f658[_0x533f3e(0x2c9)][_0x533f3e(0x288)](_0x212d3b),{'verbose':_0x86a0be['verbose']}),_0x3a965c=_0x29049d[_0x533f3e(0x35c)];return console[_0x533f3e(0x28e)](a42_0xc4b429[_0x533f3e(0x1e6)](_0x212d3b[_0x533f3e(0x373)]?_0x533f3e(0x262):_0x533f3e(0x238))),console[_0x533f3e(0x28e)](_0x533f3e(0x274)+_0x3a965c[_0x533f3e(0x2f2)]),console['error'](_0x533f3e(0x1f7)+_0x3a965c[_0x533f3e(0x2bf)]),console[_0x533f3e(0x28e)](_0x533f3e(0x1f8)+_0x3a965c[_0x533f3e(0x307)]),await this['showWorkflowConsoleUrl'](_0x22f658,_0x3a965c[_0x533f3e(0x2f2)],_0x86a0be[_0x533f3e(0x34c)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a42_0x428ab2(0x209)]=a42_0x428ab2(0x26b);[a42_0x428ab2(0x38d)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async['execute'](_0x1bc1cc){const _0x32078f=a42_0x428ab2,{options:_0x478135,args:_0x33d509,tdx:_0x8a94fe}=_0x1bc1cc,_0x5e2e5b=_0x33d509[0x0];if(!_0x5e2e5b)return console[_0x32078f(0x28e)](_0x32078f(0x33b)),console[_0x32078f(0x28e)](_0x32078f(0x2ff)),0x1;_0x478135[_0x32078f(0x320)]&&console[_0x32078f(0x28e)](_0x32078f(0x339)+_0x5e2e5b);if(!_0x478135[_0x32078f(0x36d)]){if(!isInteractive())return console[_0x32078f(0x28e)](a42_0xc4b429[_0x32078f(0x2ab)](_0x32078f(0x365)),_0x32078f(0x306)),console['error'](a42_0xc4b429[_0x32078f(0x33f)](_0x32078f(0x2a3))),0x1;const _0xa9b549=await confirmKey(_0x32078f(0x200)+_0x5e2e5b+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0xa9b549)return console[_0x32078f(0x28e)](a42_0xc4b429[_0x32078f(0x29c)](_0x32078f(0x2e3))),0x1;}const _0x2b425e=await withSpinner(_0x32078f(0x293)+_0x5e2e5b+_0x32078f(0x28c),()=>_0x8a94fe['workflow'][_0x32078f(0x291)](_0x5e2e5b),{'verbose':_0x478135[_0x32078f(0x320)]}),_0x3c2f2b=_0x2b425e[_0x32078f(0x35c)];return console[_0x32078f(0x28e)]('✔\x20Deleted\x20project\x20'+_0x3c2f2b[_0x32078f(0x353)]),console[_0x32078f(0x28e)](_0x32078f(0x1f7)+_0x3c2f2b[_0x32078f(0x290)]),0x0;}}export function parseKeyValue(_0x56863c){const _0x583a9f=a42_0x428ab2,_0x23fa71=_0x56863c[_0x583a9f(0x283)]('=');if(_0x23fa71===-0x1)throw new Error(_0x583a9f(0x281)+_0x56863c+_0x583a9f(0x369));const _0x224dfd=_0x56863c[_0x583a9f(0x25c)](0x0,_0x23fa71),_0x2d1ee6=_0x56863c[_0x583a9f(0x25c)](_0x23fa71+0x1);if(!_0x224dfd)throw new Error(_0x583a9f(0x261));return{'key':_0x224dfd,'value':_0x2d1ee6};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a42_0x428ab2(0x209)]='workflow:secrets:list';[a42_0x428ab2(0x38d)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a42_0x428ab2(0x2a1)](_0x457fb3){const _0x490ff3=a42_0x428ab2,{options:_0x2998c5,args:_0x4f3b70,tdx:_0x1513c6}=_0x457fb3,_0x244087=this['requireProject'](_0x4f3b70,_0x2998c5);if(!_0x244087)return 0x1;_0x2998c5[_0x490ff3(0x320)]&&console[_0x490ff3(0x28e)]('Project:\x20'+_0x244087);const _0x228c8e=await withSpinner(_0x490ff3(0x364),()=>_0x1513c6[_0x490ff3(0x2c9)][_0x490ff3(0x2eb)](_0x244087),{'verbose':_0x2998c5['verbose']}),{secrets:_0x4f63ed}=_0x228c8e['data'];return console['error'](_0x490ff3(0x35e)+_0x4f63ed[_0x490ff3(0x2f0)]+'\x20secret'+(_0x4f63ed['length']!==0x1?'s':'')),await handleSDKOutput(_0x4f63ed,_0x2998c5),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a42_0x428ab2(0x22b);[a42_0x428ab2(0x38d)]=a42_0x428ab2(0x374);async['execute'](_0x5463ed){const _0x3b8720=a42_0x428ab2,{options:_0x2a2319,args:_0xebaa97,tdx:_0x3781f3}=_0x5463ed;let _0x57b2ee,_0x191bda;if(_0xebaa97[_0x3b8720(0x2f0)]>=0x2)_0x57b2ee=_0xebaa97[0x0],_0x191bda=_0xebaa97[0x1];else{if(_0xebaa97[_0x3b8720(0x2f0)]===0x1&&_0x2a2319[_0x3b8720(0x361)])_0x57b2ee=_0x2a2319[_0x3b8720(0x361)],_0x191bda=_0xebaa97[0x0];else return _0xebaa97[_0x3b8720(0x2f0)]===0x1?(console[_0x3b8720(0x28e)](_0x3b8720(0x31a)),console[_0x3b8720(0x28e)](_0x3b8720(0x230)),0x1):(console[_0x3b8720(0x28e)](_0x3b8720(0x371)),console['error'](_0x3b8720(0x1f6)),0x1);}let _0x143296,_0x8f5c53;try{({key:_0x143296,value:_0x8f5c53}=parseKeyValue(_0x191bda));}catch(_0x47ffa5){return _0x47ffa5 instanceof Error&&console[_0x3b8720(0x28e)](a42_0xc4b429['red']('Error:'),_0x47ffa5[_0x3b8720(0x20b)]),0x1;}_0x2a2319[_0x3b8720(0x320)]&&(console[_0x3b8720(0x28e)](_0x3b8720(0x339)+_0x57b2ee),console[_0x3b8720(0x28e)]('Key:\x20'+_0x143296));const _0x33e6b7=await withSpinner('Setting\x20secret...',()=>_0x3781f3[_0x3b8720(0x2c9)][_0x3b8720(0x1f1)](_0x57b2ee,_0x143296,_0x8f5c53),{'verbose':_0x2a2319[_0x3b8720(0x320)]}),_0x30920f=_0x33e6b7['data'];return console[_0x3b8720(0x28e)](_0x3b8720(0x2c1)+_0x30920f[_0x3b8720(0x263)]+_0x3b8720(0x300)+_0x30920f[_0x3b8720(0x353)]+'\x27'),(_0x2a2319['json']||_0x2a2319[_0x3b8720(0x236)])&&await handleSingleObjectOutput(_0x30920f,_0x2a2319),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a42_0x428ab2(0x209)]=a42_0x428ab2(0x33a);[a42_0x428ab2(0x38d)]='Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project';async['execute'](_0x50dc6b){const _0x19344b=a42_0x428ab2,{options:_0x260d39,args:_0x34090f,tdx:_0x1f9126}=_0x50dc6b;let _0x2b196a,_0xa5181d;if(_0x34090f[_0x19344b(0x2f0)]>=0x2)_0x2b196a=_0x34090f[0x0],_0xa5181d=_0x34090f[0x1];else{if(_0x34090f[_0x19344b(0x2f0)]===0x1&&_0x260d39['workflowProject'])_0x2b196a=_0x260d39[_0x19344b(0x361)],_0xa5181d=_0x34090f[0x0];else return _0x34090f[_0x19344b(0x2f0)]===0x1?(console['error'](_0x19344b(0x31a)),console[_0x19344b(0x28e)](_0x19344b(0x230)),0x1):(console[_0x19344b(0x28e)](_0x19344b(0x229)),console['error'](_0x19344b(0x2bb)),0x1);}_0x260d39[_0x19344b(0x320)]&&(console[_0x19344b(0x28e)](_0x19344b(0x339)+_0x2b196a),console[_0x19344b(0x28e)]('Key:\x20'+_0xa5181d));if(!_0x260d39[_0x19344b(0x36d)]){if(!isInteractive())return console[_0x19344b(0x28e)](a42_0xc4b429[_0x19344b(0x2ab)](_0x19344b(0x365)),_0x19344b(0x306)),console[_0x19344b(0x28e)](a42_0xc4b429[_0x19344b(0x33f)](_0x19344b(0x2a3))),0x1;const _0x4ff7e2=await confirmKey(_0x19344b(0x2cd)+_0xa5181d+_0x19344b(0x321)+_0x2b196a+'\x27?');if(!_0x4ff7e2)return console[_0x19344b(0x28e)](a42_0xc4b429[_0x19344b(0x29c)](_0x19344b(0x2e3))),0x1;}const _0x29fa37=await withSpinner(_0x19344b(0x241),()=>_0x1f9126[_0x19344b(0x2c9)][_0x19344b(0x30b)](_0x2b196a,_0xa5181d),{'verbose':_0x260d39[_0x19344b(0x320)]}),_0x30441c=_0x29fa37[_0x19344b(0x35c)];return console[_0x19344b(0x28e)](_0x19344b(0x2c1)+_0x30441c[_0x19344b(0x263)]+_0x19344b(0x31e)+_0x30441c['projectName']+'\x27'),(_0x260d39[_0x19344b(0x250)]||_0x260d39[_0x19344b(0x236)])&&await handleSingleObjectOutput(_0x30441c,_0x260d39),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(_0x14a4be){const _0xd70d57=a42_0x428ab2,_0x4f21db=Math['floor'](_0x14a4be/0x3e8),_0x51aba3=Math[_0xd70d57(0x33d)](_0x4f21db/0x3c),_0x1fc9bd=Math['floor'](_0x51aba3/0x3c),_0x3492e7=Math[_0xd70d57(0x33d)](_0x1fc9bd/0x18);if(_0x3492e7>0x0){const _0x3935bc=_0x1fc9bd%0x18;return _0x3935bc>0x0?_0x3492e7+'d\x20'+_0x3935bc+'h':_0x3492e7+'d';}else{if(_0x1fc9bd>0x0){const _0x5e094d=_0x51aba3%0x3c;return _0x5e094d>0x0?_0x1fc9bd+'h\x20'+_0x5e094d+'m':_0x1fc9bd+'h';}else{if(_0x51aba3>0x0){const _0x1d886c=_0x4f21db%0x3c;return _0x1d886c>0x0?_0x51aba3+'m\x20'+_0x1d886c+'s':_0x51aba3+'m';}else return _0x4f21db+'s';}}}function formatTimestamp(_0x1a6311,_0x3e5b5a){const _0x196deb=a42_0x428ab2,_0x273e07=new Date(_0x1a6311),_0x440004=String(_0x273e07[_0x196deb(0x30e)]())[_0x196deb(0x2ca)](0x2,'0'),_0x561bcc=String(_0x273e07[_0x196deb(0x1e8)]())[_0x196deb(0x2ca)](0x2,'0'),_0x46660c=_0x440004+':'+_0x561bcc,_0x370c6d=_0x273e07[_0x196deb(0x251)]()===_0x3e5b5a[_0x196deb(0x251)]()&&_0x273e07[_0x196deb(0x2f7)]()===_0x3e5b5a['getMonth']()&&_0x273e07[_0x196deb(0x221)]()===_0x3e5b5a[_0x196deb(0x221)]();if(_0x370c6d)return _0x46660c;else{const _0x23b196=String(_0x273e07[_0x196deb(0x2f7)]()+0x1)[_0x196deb(0x2ca)](0x2,'0'),_0x57f3a4=String(_0x273e07[_0x196deb(0x221)]())[_0x196deb(0x2ca)](0x2,'0');return _0x23b196+'-'+_0x57f3a4+'\x20'+_0x46660c;}}function formatDate(_0x4ed424){const _0x1a8544=a42_0x428ab2,_0x43ec5a=_0x4ed424[_0x1a8544(0x251)](),_0x142535=String(_0x4ed424[_0x1a8544(0x2f7)]()+0x1)['padStart'](0x2,'0'),_0x5a59e4=String(_0x4ed424[_0x1a8544(0x221)]())[_0x1a8544(0x2ca)](0x2,'0');return _0x43ec5a+'-'+_0x142535+'-'+_0x5a59e4;}function getTaskStateIcon(_0x54c472){const _0x1c420f={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x1c420f[_0x54c472]||'⚪';}function getBarChar(_0x432fba){const _0x55b193=a42_0x428ab2;return _0x432fba===_0x55b193(0x28e)||_0x432fba==='group_error'?'×':'─';}function getBarColor(_0x2a3a87){const _0x57dd51=a42_0x428ab2,_0x2e9d9d={'success':a42_0xc4b429['green'],'error':a42_0xc4b429[_0x57dd51(0x2ab)],'group_error':a42_0xc4b429[_0x57dd51(0x2ab)],'running':a42_0xc4b429[_0x57dd51(0x2b5)],'blocked':a42_0xc4b429[_0x57dd51(0x29c)],'planned':a42_0xc4b429[_0x57dd51(0x33f)],'canceling':a42_0xc4b429[_0x57dd51(0x29c)]};return _0x2e9d9d[_0x2a3a87]||a42_0xc4b429['white'];}function parseTaskName(_0x25dcd9){const _0xbfeafa=a42_0x428ab2;let _0x57099f=_0x25dcd9[_0xbfeafa(0x2b3)](/^\++/,'');const _0x3420ae=_0x57099f[_0xbfeafa(0x20f)]('+'),_0x21d596=_0x3420ae[_0xbfeafa(0x2f0)]>0x1?_0x3420ae['length']-0x2:0x0,_0x3b30d4=_0x3420ae[_0x3420ae['length']-0x1]||_0x57099f;return{'level':_0x21d596,'name':'+'+_0x3b30d4};}function truncateTaskName(_0x33a74b,_0x405f94){const _0x29b9c9=a42_0x428ab2,_0x1d36a3=stringWidth(_0x33a74b);if(_0x1d36a3<=_0x405f94)return _0x33a74b;let _0xcef776=_0x33a74b;while(stringWidth(_0xcef776+'…')>_0x405f94&&_0xcef776[_0x29b9c9(0x2f0)]>0x0){_0xcef776=_0xcef776[_0x29b9c9(0x24b)](0x0,-0x1);}return _0xcef776+'…';}function calculateTimeScale(_0xcfc623,_0x231cbd){const _0x4aa5a8=a42_0x428ab2;return{'startTime':_0xcfc623[_0x4aa5a8(0x337)],'endTime':_0xcfc623[_0x4aa5a8(0x239)],'durationMs':_0xcfc623['duration'],'msPerChar':_0xcfc623[_0x4aa5a8(0x2e0)]/_0x231cbd};}function timeToPosition(_0x451f21,_0x26f7e2,_0x19a6a0){const _0x5eeecd=a42_0x428ab2,_0x141d50=_0x451f21-_0x26f7e2['startTime'],_0x38872a=Math[_0x5eeecd(0x33d)](_0x141d50/_0x26f7e2['msPerChar']);return Math[_0x5eeecd(0x29f)](0x0,Math[_0x5eeecd(0x1fe)](_0x38872a,_0x19a6a0));}function renderTimeAxis(_0x32edc0,_0x4b0240){const _0x599b5f=a42_0x428ab2,_0x3b2335=Math[_0x599b5f(0x1fe)](TIMELINE_CONFIG[_0x599b5f(0x37c)],Math[_0x599b5f(0x29f)](TIMELINE_CONFIG[_0x599b5f(0x1eb)],Math[_0x599b5f(0x33d)](_0x4b0240/TIMELINE_CONFIG[_0x599b5f(0x37d)]))),_0x5e9138=_0x32edc0[_0x599b5f(0x34e)]/(_0x3b2335-0x1),_0x23da53=new Date(_0x32edc0[_0x599b5f(0x226)]),_0x2ac304=[];for(let _0x3d4186=0x0;_0x3d4186<_0x3b2335;_0x3d4186++){const _0x595025=_0x32edc0['startTime']+_0x3d4186*_0x5e9138,_0x398cbd=timeToPosition(_0x595025,_0x32edc0,_0x4b0240),_0x4bb89b=formatTimestamp(_0x595025,_0x23da53);_0x2ac304[_0x599b5f(0x23f)]({'pos':_0x398cbd,'text':_0x4bb89b});}const _0x144771=new Array(_0x4b0240)['fill']('\x20');let _0x49fb08=-0x1;for(const {pos:_0x4d41e1,text:_0x1c7dc4}of _0x2ac304){let _0x5b05a4=Math[_0x599b5f(0x29f)](0x0,_0x4d41e1-Math['floor'](_0x1c7dc4[_0x599b5f(0x2f0)]/0x2));_0x5b05a4<=_0x49fb08+TIMELINE_CONFIG[_0x599b5f(0x34f)]&&(_0x5b05a4=_0x49fb08+TIMELINE_CONFIG[_0x599b5f(0x34f)]+0x1);_0x5b05a4+_0x1c7dc4[_0x599b5f(0x2f0)]>_0x4b0240&&(_0x5b05a4=_0x4b0240-_0x1c7dc4['length']);if(_0x5b05a4>=0x0&&_0x5b05a4+_0x1c7dc4[_0x599b5f(0x2f0)]<=_0x4b0240&&_0x5b05a4>_0x49fb08){for(let _0x177fb5=0x0;_0x177fb5<_0x1c7dc4[_0x599b5f(0x2f0)];_0x177fb5++){_0x144771[_0x5b05a4+_0x177fb5]=_0x1c7dc4[_0x177fb5];}_0x49fb08=_0x5b05a4+_0x1c7dc4[_0x599b5f(0x2f0)]-0x1;}}return _0x144771[_0x599b5f(0x275)]('');}function a42_0xf21f(_0x1865e4,_0x4d8980){_0x1865e4=_0x1865e4-0x1e3;const _0x3aa625=a42_0x3aa6();let _0xf21f0f=_0x3aa625[_0x1865e4];return _0xf21f0f;}function renderTaskRow(_0x1b6253,_0x244483,_0x38f64e,_0x282779){const _0x58a895=a42_0x428ab2,{level:_0x11e4a3,name:_0x136c17}=parseTaskName(_0x1b6253[_0x58a895(0x209)]),_0x3c0ade='\x20'[_0x58a895(0x304)](_0x11e4a3),_0x55a5cb=_0x1b6253[_0x58a895(0x384)]?'('+formatElapsed(_0x1b6253['window'][_0x58a895(0x2e0)])+')':'',_0x42942c=stringWidth(_0x55a5cb),_0x23e395=_0x11e4a3*0x1,_0x15e7f7=_0x282779-_0x23e395-_0x42942c-0x1,_0x4a1f3f=truncateTaskName(_0x136c17,_0x15e7f7),_0x5724ea=_0x3c0ade+_0x4a1f3f,_0x59870f=stringWidth(_0x5724ea),_0x25ec59=_0x282779-_0x59870f-_0x42942c,_0x18fb9d=_0x5724ea+'\x20'[_0x58a895(0x304)](Math[_0x58a895(0x29f)](0x1,_0x25ec59))+a42_0xc4b429[_0x58a895(0x33f)](_0x55a5cb),_0x26e549=getTaskStateIcon(_0x1b6253[_0x58a895(0x206)]),_0x5481f9=new Array(_0x38f64e)[_0x58a895(0x32d)]('\x20');if(_0x1b6253[_0x58a895(0x384)]){const _0x18072c=timeToPosition(_0x1b6253[_0x58a895(0x384)]['start'],_0x244483,_0x38f64e),_0x219d45=timeToPosition(_0x1b6253[_0x58a895(0x384)][_0x58a895(0x239)],_0x244483,_0x38f64e),_0x59899c=getBarChar(_0x1b6253[_0x58a895(0x206)]),_0x216f1f=Math['max'](_0x18072c+0x1,_0x219d45);for(let _0x545214=_0x18072c;_0x545214<Math[_0x58a895(0x1fe)](_0x216f1f,_0x38f64e);_0x545214++){_0x5481f9[_0x545214]=_0x59899c;}}const _0xf3168f=getBarColor(_0x1b6253[_0x58a895(0x206)]),_0x134cc1=_0x5481f9[_0x58a895(0x376)](_0x1b5e37=>_0x1b5e37==='\x20'?'\x20':_0xf3168f(_0x1b5e37))['join']('');return _0x26e549+'\x20'+_0x18fb9d+'│'+_0x134cc1+'│';}function calculateStats(_0xbccc03){const _0x2bb2b6=a42_0x428ab2,_0x27f190={'total':_0xbccc03[_0x2bb2b6(0x2f0)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x3c1d7e of _0xbccc03){if(_0x3c1d7e[_0x2bb2b6(0x206)]===_0x2bb2b6(0x32b))_0x27f190['success']++;else{if(_0x3c1d7e['state']===_0x2bb2b6(0x28e)||_0x3c1d7e[_0x2bb2b6(0x206)]===_0x2bb2b6(0x30a))_0x27f190[_0x2bb2b6(0x28e)]++;else _0x3c1d7e[_0x2bb2b6(0x206)]===_0x2bb2b6(0x227)?_0x27f190[_0x2bb2b6(0x227)]++:_0x27f190['pending']++;}}return _0x27f190;}function a42_0x3aa6(){const _0x20d207=['showWorkflowConsoleUrl','getMinutes','Files\x20to\x20upload:\x20','force','MIN_LABEL_COUNT','Getting\x20attempt\x20details...','applyPullProject','keys','\x20\x20Session\x20ID:\x20','session_id','setSecret','sort','retryAttemptName','output','/sessions/','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','\x20\x20Project\x20ID:\x20','\x20\x20Revision:\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','basename','fromTask','kill','dryRun','min','logFiles','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Listing\x20workflow\x20projects...','Listing\x20workflow\x20sessions...','unknown','state','📁\x20','84fUWZdN','name','From\x20task:\x20','message','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','tdx\x20wf\x20attempt\x20','split','total','\x20-\x20','Source\x20directory\x20is\x20required','\x20\x20Workflow:\x20','workflow:download','\x20\x20tdx\x20wf\x20use\x20<project>','2bfqgWh','reason','includeRetried','renderSingleTimeline','11300598vmgtBU','download','includes','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','POLL_INTERVAL_MS','4151427jtBhBO','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','getDate','\x20\x20Session\x20context\x20set\x20to:\x20','logs','(use\x20--limit\x20to\x20see\x20more)','executePushProject','startTime','running','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Error:\x20Secret\x20key\x20is\x20required','\x20\x20Changes:\x20','workflow:secrets:set','diff','modified','→\x20Project:\x20','now','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','utf-8','toLowerCase','Parameters:\x20','values','---\x20','jsonl','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','✔\x20Clone\x20complete','end','resolveProjectId','No\x20workflows\x20found\x20in\x20project:\x20','⚠\x20Showing\x20first\x20','-\x20nothing\x20pushed','index','push','Retrying\x20session...','Deleting\x20secret...','\x20from\x20session\x20','Listing\x20workflows...','type','targetDir','table','Filter:\x20project=','workflow:workflows','\x20unchanged','Loading\x20sessions...','slice','done','metadata','Task\x20name:\x20','261gJlMgY','json','getFullYear','\x20new','sys','has','✔\x20Showing\x20','write','stat','isTTY','Loading\x20session...','attemptId','isNewProject','substring','💡\x20Tip:\x20Use\x20','tdx.json','\x0aClone\x20\x22','No\x20workflow\x20projects\x20found','Key\x20cannot\x20be\x20empty','✔\x20Project\x20updated','key','all','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Source:\x20','includeSubtasks','stdout','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','(unknown)','workflow:delete','workflows','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','/attempt/','renderTimeline','\x20(use\x20--limit\x20to\x20show\x20more)','parse','\x20is\x20not\x20a\x20directory','New\x20project\x20name:\x20','\x20\x20Project:\x20','join','\x0aPolling...\x20(','resolve','GUTTER','getTime','resolveProject','workflowName','canceling','select','No\x20workflows\x20found','run','✔\x20Workflow\x20run\x20started','Invalid\x20format:\x20','list','indexOf','trim','new','No\x20workflow\x20sessions\x20found','path','executeCloneProject','requireProject','No\x20projects\x20match\x20pattern:\x20','follow','...','Project\x20filter:\x20','error','finishedAt','projectId','delete','preparePushProject','Deleting\x20project\x20','Pattern:\x20','/app/workflows/','\x20attempt','\x20sessions\x20','autocomplete','localeCompare','fileSize','Revision:\x20','yellow','Usage:\x20tdx\x20wf\x20use\x20<project>','toISOString','max','No\x20log\x20content\x20found','execute','taskName','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Pushing\x20workflow\x20project...','Cloning\x20to\x20','Retry\x20a\x20session\x20or\x20attempt','some','workflow:run','updatedAt','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','red','MIN_TIMELINE_WIDTH','Pulling\x20project\x20','workflow:attempt','✔\x20Push\x20complete','MAX_TASKS_DISPLAY','No\x20attempts\x20found\x20for:\x20','Error:\x20','replace','params','blue','changes','Select\x20a\x20session\x20to\x20view\x20timeline:','workflow:retry','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','project','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','No\x20attempts\x20found\x20in\x20project:\x20','startsWith','Updating\x20','newProjectId','log','✔\x20Secret\x20\x27','isArray','No\x20log\x20files\x20found\x20for\x20this\x20attempt','\x0aDry\x20run\x20-\x20nothing\x20pushed','\x27...','ICON_WIDTH','lastAttempt','Total:\x20','workflow','padStart','Pushing\x20project...','format','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Warning:','Kill\x20a\x20running\x20attempt','workflow:attempts','limit','set','\x20has\x20no\x20attempts','clear','No\x20sessions\x20found\x20for:\x20','\x20\x20Files\x20extracted:\x20','stringify','Writing\x20files...','Filter:\x20','No\x20workflow\x20tdx.json\x20found','cwd','attempt','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','context','\x0a✔\x20Already\x20up\x20to\x20date','duration','Starting\x20workflow\x20run...','Auto-selected\x20latest\x20session:\x20','Cancelled','Resume\x20from:\x20','No\x20attempts\x20found','Target\x20directory:\x20','📋\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Start\x20a\x20workflow\x20run','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','listSecrets','rows','fullName','parseProjectWorkflowPattern','sessionTime','length','Session\x20','newProjectName','Killing\x20attempt...','Include\x20retried:\x20yes','No\x20sessions\x20found','filesExtracted','getMonth','Attempt\x20ID:\x20','workflow:projects','\x22\x20already\x20exists\x20(ID:\x20','✔\x20Retry\x20started','238152dkMZRJ','\x20logs','pullProject','Usage:\x20workflow:delete\x20<project-name-or-id>','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','skipValidation','Error:\x20Invalid\x20JSON\x20in\x20--params','find','repeat','Pull\x20workflow\x20project\x20to\x20local\x20folder','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','revision','round','Project\x20name\x20is\x20required','group_error','deleteSecret','Validation:\x20skipped','No\x20matching\x20sessions\x20found','getHours','Retrying\x20attempt...','session:','List\x20workflow\x20execution\x20sessions','\x0aDry\x20run\x20-\x20no\x20files\x20written','revision:\x20','\x20deleted','\x20\x20Source:\x20','323515VpMOUU','Loading\x20workflows...','filter','→\x20New\x20project:\x20','Error:\x20Project\x20name\x20is\x20required','cyan','sourceDir','✔\x20Downloaded\x20','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','title','verbose','\x27\x20from\x20project\x20\x27','param','pollTimeline','Reason:\x20','\x20tasks','unchanged','Error:\x20Attempt\x20ID\x20is\x20required','generateSessionTimelineRows','tasks','startedAt','success','\x20\x20Attempt\x20ID:\x20','fill','trimEnd','text','fs/promises','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context',',\x20Workflow:\x20','Session\x20time:\x20','\x22\x20to\x20new\x20project\x20\x22','Getting\x20attempt\x20tasks...','ICON_SPACING','start','navigateSessionsInteractive','Project:\x20','workflow:secrets:delete','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','\x20\x20Target:\x20','floor','workflow:pull','dim','Failed\x20to\x20fetch\x20attempt\x20data','Show\x20tasks\x20for\x20an\x20attempt','pending','cancelRequested','summary','resolveProjectDir','match','Show\x20specific\x20attempt\x20details','Select\x20a\x20workflow\x20to\x20run','Error:','buildTimelineData','Analyzing\x20changes...','site','sessionId','durationMs','LABEL_MIN_SPACING','\x20task','Attempt:\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','projectName','workflow:push','session','isDirectory','Select\x20a\x20task\x20to\x20view\x20logs:','get','Params:\x20','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Tip:\x20cd\x20to\x20workflows/','data','Fetching\x20log\x20files...','✔\x20Found\x20','retryAttempt','attempts','workflowProject','sourceProjectName','✔\x20Workflow\x20project\x20set\x20to:\x20','Listing\x20secrets...','\x0aError:','attempt:','relative','Using\x20attempt\x20','.\x20Expected\x20format:\x20KEY=VALUE','\x0a✔\x20No\x20changes\x20to\x20push','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','planned','yes','Dry\x20run:\x20yes','61090120qgShbL','workflow:tasks','Error:\x20KEY=VALUE\x20is\x20required','✔\x20Project:\x20','targetExists','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','map','createdAt','size','11724146TBinGU','Downloading\x20project\x20','\x20\x20Location:\x20','MAX_LABEL_COUNT','LABEL_WIDTH_DIVISOR','No\x20sessions\x20found\x20in\x20project:\x20','\x0aApply\x20these\x20changes?','renderSessionsTimeline','Force:\x20yes','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','existingProjectId','window','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','task','-\x20no\x20files\x20written','\x1b[1A\x1b[2K','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','sessions','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','\x0aPush\x20these\x20changes?','description','status','715729uhGLbl','\x20modified','green'];a42_0x3aa6=function(){return _0x20d207;};return a42_0x3aa6();}function formatStats(_0x74743d){const _0x488d35=a42_0x428ab2;return[_0x488d35(0x2c8)+_0x74743d[_0x488d35(0x210)],'✅\x20'+_0x74743d[_0x488d35(0x32b)],'❌\x20'+_0x74743d[_0x488d35(0x28e)],'🔄\x20'+_0x74743d[_0x488d35(0x227)],'⏳\x20'+_0x74743d[_0x488d35(0x342)]][_0x488d35(0x275)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a42_0x428ab2(0x209)]='workflow:timeline';[a42_0x428ab2(0x38d)]=a42_0x428ab2(0x2ea);async[a42_0x428ab2(0x2a1)](_0xa0ddf8){const _0x213b6=a42_0x428ab2,{options:_0x5f3799,args:_0x4d323e,tdx:_0x55ed31}=_0xa0ddf8;let _0x28b791,_0x3bf970,_0x5f2d06=![];if(_0x4d323e[0x0]){if(_0x4d323e[0x0]['includes']('.')){const _0x5cd228=this[_0x213b6(0x2ee)](_0x4d323e,_0x5f3799);if(!_0x5cd228)return 0x1;_0x28b791=_0x5cd228[_0x213b6(0x353)],_0x3bf970=_0x5cd228[_0x213b6(0x27b)];}else{_0x3bf970=_0x4d323e[0x0],_0x28b791=_0x5f3799[_0x213b6(0x361)];if(!_0x28b791)return console[_0x213b6(0x28e)](a42_0xc4b429[_0x213b6(0x2ab)]('Error:'),_0x213b6(0x375)),0x1;_0x5f2d06=!![];}}else{const _0x308a97=this[_0x213b6(0x2ee)](_0x4d323e,_0x5f3799);if(!_0x308a97)return 0x1;_0x28b791=_0x308a97['projectName'],_0x3bf970=_0x308a97[_0x213b6(0x27b)];}if(_0x5f3799['verbose']){if(_0x28b791&&_0x3bf970)console[_0x213b6(0x28e)]('Filter:\x20'+_0x28b791+'.'+_0x3bf970);else _0x28b791&&console[_0x213b6(0x28e)](_0x213b6(0x247)+_0x28b791);}const _0x280e86=_0x5f3799[_0x213b6(0x25a)],_0x565570=_0x5f3799[_0x213b6(0x34d)];if(_0x280e86){_0x565570&&console[_0x213b6(0x28e)](a42_0xc4b429['yellow'](_0x213b6(0x2ce)),_0x213b6(0x2b9));const _0x394bea=_0x5f3799[_0x213b6(0x28b)];return _0x394bea?await this['pollTimeline'](_0xa0ddf8,_0x280e86):await this[_0x213b6(0x219)](_0xa0ddf8,_0x280e86,_0x5f3799),0x0;}if(_0x565570){const _0x5598ca=await withSpinner(_0x213b6(0x259),()=>_0x55ed31[_0x213b6(0x2c9)][_0x213b6(0x38a)]({'projectName':_0x28b791,'workflowName':_0x3bf970,'limit':0x64}),{'verbose':_0x5f3799['verbose']}),_0x16c2b6=_0x5598ca['data']['find'](_0x2ce98c=>_0x2ce98c['id']===_0x565570);if(!_0x16c2b6)return console[_0x213b6(0x28e)](a42_0xc4b429[_0x213b6(0x2ab)](_0x213b6(0x349)),'Session\x20not\x20found:\x20'+_0x565570),0x1;if(!_0x16c2b6[_0x213b6(0x2c7)]?.['id'])return console['error'](a42_0xc4b429[_0x213b6(0x2ab)](_0x213b6(0x349)),_0x213b6(0x2f1)+_0x565570+_0x213b6(0x2d3)),0x1;const _0x31e39d=_0x16c2b6[_0x213b6(0x2c7)]['id'];_0x5f3799[_0x213b6(0x320)]&&console['error'](_0x213b6(0x368)+_0x31e39d+_0x213b6(0x242)+_0x565570);const _0x56e372=_0x5f3799['follow'];return _0x56e372?await this[_0x213b6(0x323)](_0xa0ddf8,_0x31e39d):await this[_0x213b6(0x219)](_0xa0ddf8,_0x31e39d,_0x5f3799),0x0;}const _0x1c99fd=await withSpinner(_0x213b6(0x24a),()=>_0x55ed31[_0x213b6(0x2c9)][_0x213b6(0x38a)]({'projectName':_0x28b791,'workflowName':_0x3bf970,'limit':_0x5f3799[_0x213b6(0x2d1)]||0x32}),{'verbose':_0x5f3799['verbose']}),_0x4a1c4f=_0x1c99fd['data'];if(_0x4a1c4f['length']===0x0){if(_0x28b791&&_0x3bf970)console[_0x213b6(0x28e)](_0x213b6(0x2d5)+_0x28b791+'.'+_0x3bf970);else _0x28b791?console[_0x213b6(0x28e)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x28b791):(console[_0x213b6(0x28e)](_0x213b6(0x286)),console['error'](a42_0xc4b429[_0x213b6(0x33f)](_0x213b6(0x265))));return 0x0;}_0x4a1c4f[_0x213b6(0x1f2)]((_0x325341,_0x2543cc)=>{const _0x72be64=_0x213b6,_0x207785=_0x325341[_0x72be64(0x2ef)]||'',_0x61ae04=_0x2543cc[_0x72be64(0x2ef)]||'';return _0x61ae04[_0x72be64(0x299)](_0x207785);});if(_0x5f3799[_0x213b6(0x250)]||_0x5f3799[_0x213b6(0x236)])return await handleSDKOutput(_0x4a1c4f,_0x5f3799),0x0;let _0x45207a;if(_0x5f2d06){const _0x23115d=_0x4a1c4f[0x0];if(!_0x23115d[_0x213b6(0x2c7)]?.['id'])return console['error']('Latest\x20session\x20has\x20no\x20attempt'),0x0;_0x45207a=_0x23115d[_0x213b6(0x2c7)]['id'],_0x5f3799[_0x213b6(0x320)]&&console[_0x213b6(0x28e)](_0x213b6(0x2e2)+_0x23115d[_0x213b6(0x2ef)]);}else{const _0x569ebc=_0x4a1c4f[_0x213b6(0x376)](_0x532a5d=>{const _0x57f209=_0x213b6,_0x362d46=getAttemptStatusDisplay(_0x532a5d[_0x57f209(0x2c7)]);return{'title':_0x532a5d[_0x57f209(0x2ba)]?.[_0x57f209(0x209)]+'.'+_0x532a5d[_0x57f209(0x2c9)]?.[_0x57f209(0x209)]+'\x20-\x20'+_0x532a5d[_0x57f209(0x2ef)]+'\x20'+_0x362d46['icon'],'value':_0x532a5d[_0x57f209(0x2c7)]?.['id']||'','description':_0x362d46[_0x57f209(0x32f)]};}),_0x4c977a=await a42_0x2ce4d7({'type':_0x213b6(0x27d),'name':_0x213b6(0x25a),'message':_0x213b6(0x2b7),'choices':_0x569ebc[_0x213b6(0x318)](_0x2d01f2=>_0x2d01f2['value']!=='')});if(!_0x4c977a['attemptId'])return 0x0;_0x45207a=_0x4c977a['attemptId'];}const _0x25d66a=_0x5f3799['follow'];return _0x25d66a?await this[_0x213b6(0x323)](_0xa0ddf8,_0x45207a):await this['renderSingleTimeline'](_0xa0ddf8,_0x45207a,_0x5f3799),0x0;}async[a42_0x428ab2(0x219)](_0x4f3973,_0x46a03e,_0x4dca16){const _0x20bd9d=a42_0x428ab2,{tdx:_0x3f5a2f}=_0x4f3973;let _0x161b4f,_0x116fc6;try{[_0x161b4f,_0x116fc6]=await Promise[_0x20bd9d(0x264)]([_0x3f5a2f[_0x20bd9d(0x2c9)][_0x20bd9d(0x2dc)](_0x46a03e),_0x3f5a2f[_0x20bd9d(0x2c9)]['tasks'](_0x46a03e,![])]);}catch(_0x286b58){console['error'](a42_0xc4b429[_0x20bd9d(0x2ab)](_0x20bd9d(0x340)));_0x4dca16['verbose']&&console[_0x20bd9d(0x28e)](_0x286b58);throw _0x286b58;}if(_0x4dca16['json']||_0x4dca16['jsonl']){const _0x278597=this[_0x20bd9d(0x34a)](_0x161b4f,_0x116fc6);await handleSDKOutput([_0x278597],_0x4dca16);return;}const _0x491db5=_0x3f5a2f[_0x20bd9d(0x2de)][_0x20bd9d(0x34c)],_0x40f5ae=this['renderTimeline'](_0x161b4f,_0x116fc6,_0x491db5);console['log'](_0x40f5ae);}async[a42_0x428ab2(0x323)](_0x355673,_0x57b2ce){const _0x83432b=a42_0x428ab2,{tdx:_0x36eaf5}=_0x355673,_0x1b87bd=TIMELINE_CONFIG[_0x83432b(0x21e)],_0x58b774=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x4f3444=0x0;while(_0x4f3444<_0x58b774){process[_0x83432b(0x268)][_0x83432b(0x258)]&&process[_0x83432b(0x268)][_0x83432b(0x256)]('\x1bc');let _0x587004,_0x22c8db;try{[_0x587004,_0x22c8db]=await Promise[_0x83432b(0x264)]([_0x36eaf5[_0x83432b(0x2c9)][_0x83432b(0x2dc)](_0x57b2ce),_0x36eaf5[_0x83432b(0x2c9)][_0x83432b(0x329)](_0x57b2ce,![])]);}catch(_0x29e3fd){console[_0x83432b(0x28e)](a42_0xc4b429[_0x83432b(0x2ab)]('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x4f3444>0x0&&console['error'](a42_0xc4b429['dim'](_0x83432b(0x38b)+_0x4f3444));throw _0x29e3fd;}const _0x3d568e=_0x36eaf5[_0x83432b(0x2de)]['site'],_0x24bdaa=this[_0x83432b(0x26f)](_0x587004,_0x22c8db,_0x3d568e);console[_0x83432b(0x2c0)](_0x24bdaa);const _0x3364d6=_0x587004[_0x83432b(0x24c)]&&_0x22c8db['every'](_0x141b0f=>_0x141b0f[_0x83432b(0x206)]!==_0x83432b(0x227)&&_0x141b0f[_0x83432b(0x206)]!==_0x83432b(0x36c));if(_0x3364d6){console[_0x83432b(0x28e)](a42_0xc4b429[_0x83432b(0x1e6)]('\x0a✔\x20Attempt\x20complete'));break;}console[_0x83432b(0x28e)](a42_0xc4b429['dim'](_0x83432b(0x276)+_0x4f3444*0x2+_0x83432b(0x382))),await new Promise(_0x372cfb=>setTimeout(_0x372cfb,_0x1b87bd)),_0x4f3444++;}_0x4f3444>=_0x58b774&&console['error'](a42_0xc4b429[_0x83432b(0x29c)](_0x83432b(0x201)));}['renderTimeline'](_0x4442fd,_0x3b603e,_0xc3baf1){const _0x516d8a=a42_0x428ab2,_0x59c870=[],_0x601a8b=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x397ad6=0x5,_0x69af8d=process[_0x516d8a(0x268)]['columns']||0x78,_0x11eaf9=_0x69af8d-_0x601a8b-_0x397ad6,_0x4302bf=Math[_0x516d8a(0x29f)](TIMELINE_CONFIG[_0x516d8a(0x2ac)],Math[_0x516d8a(0x1fe)](_0x11eaf9,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x92ec10=new Date(_0x4442fd['createdAt'])[_0x516d8a(0x279)](),_0x53c327=_0x4442fd[_0x516d8a(0x28f)]?new Date(_0x4442fd[_0x516d8a(0x28f)])['getTime']():Date[_0x516d8a(0x22f)](),_0x28a394={'start':_0x92ec10,'end':_0x53c327,'duration':_0x53c327-_0x92ec10},_0x13ca5d=new Map(),_0x1da7a8=[];for(const _0x5228eb of _0x3b603e){if(_0x5228eb['startedAt']){const _0x2c23dd=new Date(_0x5228eb[_0x516d8a(0x32a)])[_0x516d8a(0x279)](),_0x1ce43d=_0x5228eb[_0x516d8a(0x2a9)]?new Date(_0x5228eb['updatedAt'])['getTime']():Date['now'](),_0x461bfc={'start':_0x2c23dd,'end':_0x1ce43d,'duration':_0x1ce43d-_0x2c23dd};_0x13ca5d['set'](_0x5228eb['id'],_0x461bfc),_0x1da7a8[_0x516d8a(0x23f)]({'name':_0x5228eb[_0x516d8a(0x2ed)],'state':_0x5228eb[_0x516d8a(0x206)]||_0x516d8a(0x205),'window':_0x461bfc});}else _0x1da7a8[_0x516d8a(0x23f)]({'name':_0x5228eb[_0x516d8a(0x2ed)],'state':_0x5228eb[_0x516d8a(0x206)]||_0x516d8a(0x36c),'window':undefined});}_0x1da7a8['sort']((_0x37572d,_0x13a8cb)=>{const _0x57fbd1=_0x516d8a;if(!_0x37572d[_0x57fbd1(0x384)])return 0x1;if(!_0x13a8cb[_0x57fbd1(0x384)])return-0x1;return _0x37572d['window'][_0x57fbd1(0x337)]-_0x13a8cb[_0x57fbd1(0x384)][_0x57fbd1(0x337)];});const _0x4d48a1=_0x1da7a8['length'],_0x29cfc9=_0x4d48a1>TIMELINE_CONFIG[_0x516d8a(0x2b0)];_0x29cfc9&&_0x1da7a8['splice'](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x2f209d=calculateTimeScale(_0x28a394,_0x4302bf),_0x4e2eaf=_0x4442fd[_0x516d8a(0x24c)]?_0x4442fd['success']?a42_0xc4b429[_0x516d8a(0x1e6)]('success'):a42_0xc4b429[_0x516d8a(0x2ab)](_0x516d8a(0x28e)):a42_0xc4b429[_0x516d8a(0x2b5)](_0x516d8a(0x227)),_0x1115ff=_0x4442fd[_0x516d8a(0x2ba)]?.['id'],_0x5b5880=_0x4442fd[_0x516d8a(0x34d)];let _0x12e1e0;if(_0x1115ff&&_0x5b5880){const _0x281ff2=getWorkflowAttemptUrl(_0xc3baf1,_0x1115ff,_0x5b5880,_0x4442fd['id']);_0x12e1e0=hyperlink(a42_0xc4b429[_0x516d8a(0x33f)](_0x4442fd['id']),_0x281ff2);}else _0x12e1e0=a42_0xc4b429['dim'](_0x4442fd['id']);_0x59c870[_0x516d8a(0x23f)](_0x516d8a(0x351)+_0x12e1e0+_0x516d8a(0x211)+_0x4e2eaf+_0x516d8a(0x211)+formatElapsed(_0x28a394['duration']));if(_0x1da7a8[_0x516d8a(0x2f0)]>0x0){const _0x220a85=renderTimeAxis(_0x2f209d,_0x4302bf),_0x3f6b9d=new Date(_0x28a394[_0x516d8a(0x337)]),_0x3a72af=formatDate(_0x3f6b9d),_0x301878=TIMELINE_CONFIG[_0x516d8a(0x2c6)]+TIMELINE_CONFIG[_0x516d8a(0x336)]+_0x601a8b,_0xbc7e4f=_0x3a72af['padStart'](_0x301878),_0x13f104=a42_0xc4b429[_0x516d8a(0x33f)](_0xbc7e4f);_0x59c870[_0x516d8a(0x23f)](_0x13f104+'\x20'+_0x220a85);for(const _0x267069 of _0x1da7a8){_0x59c870[_0x516d8a(0x23f)](renderTaskRow(_0x267069,_0x2f209d,_0x4302bf,_0x601a8b));}const _0x2074e0=calculateStats(_0x1da7a8);_0x59c870[_0x516d8a(0x23f)](formatStats(_0x2074e0)),_0x29cfc9&&_0x59c870[_0x516d8a(0x23f)](a42_0xc4b429['yellow'](_0x516d8a(0x23c)+TIMELINE_CONFIG[_0x516d8a(0x2b0)]+'\x20of\x20'+_0x4d48a1+_0x516d8a(0x325))),_0x59c870[_0x516d8a(0x23f)](''),_0x59c870[_0x516d8a(0x23f)](a42_0xc4b429[_0x516d8a(0x33f)](_0x516d8a(0x25d))+(_0x516d8a(0x20e)+_0x4442fd['id']+_0x516d8a(0x2fd))+a42_0xc4b429['dim']('\x20to\x20see\x20detailed\x20logs'));}else _0x59c870['push']('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x59c870['join']('\x0a');}[a42_0x428ab2(0x34a)](_0x37960c,_0x594c61){const _0x3d4a91=a42_0x428ab2,_0x1b0229=new Date(_0x37960c[_0x3d4a91(0x377)])['getTime'](),_0xe40673=_0x37960c['finishedAt']?new Date(_0x37960c[_0x3d4a91(0x28f)])[_0x3d4a91(0x279)]():Date[_0x3d4a91(0x22f)](),_0x40d844=_0xe40673-_0x1b0229,_0x3be99b=[];for(const _0x1f524c of _0x594c61){if(_0x1f524c[_0x3d4a91(0x32a)]){const _0x3be5cc=new Date(_0x1f524c['startedAt'])[_0x3d4a91(0x279)](),_0x2d33d0=_0x1f524c['updatedAt']?new Date(_0x1f524c[_0x3d4a91(0x2a9)])[_0x3d4a91(0x279)]():Date[_0x3d4a91(0x22f)]();_0x3be99b['push']({'name':_0x1f524c[_0x3d4a91(0x2ed)],'state':_0x1f524c[_0x3d4a91(0x206)]||_0x3d4a91(0x205),'window':{'start':_0x3be5cc,'end':_0x2d33d0,'duration':_0x2d33d0-_0x3be5cc}});}else _0x3be99b[_0x3d4a91(0x23f)]({'name':_0x1f524c[_0x3d4a91(0x2ed)],'state':_0x1f524c[_0x3d4a91(0x206)]||'planned','window':undefined});}const _0x5523f0=calculateStats(_0x3be99b);return{'attempt':{'id':_0x37960c['id'],'status':_0x37960c[_0x3d4a91(0x24c)]?_0x37960c[_0x3d4a91(0x32b)]?_0x3d4a91(0x32b):_0x3d4a91(0x28e):_0x3d4a91(0x227),'createdAt':_0x37960c[_0x3d4a91(0x377)],'finishedAt':_0x37960c[_0x3d4a91(0x28f)],'duration_ms':_0x40d844},'tasks':_0x3be99b[_0x3d4a91(0x376)](_0x56a29f=>({'name':_0x56a29f[_0x3d4a91(0x209)],'state':_0x56a29f[_0x3d4a91(0x206)],'startedAt':_0x56a29f['window']?new Date(_0x56a29f[_0x3d4a91(0x384)][_0x3d4a91(0x337)])[_0x3d4a91(0x29e)]():null,'updatedAt':_0x56a29f['window']?new Date(_0x56a29f[_0x3d4a91(0x384)][_0x3d4a91(0x239)])[_0x3d4a91(0x29e)]():null,'duration_ms':_0x56a29f[_0x3d4a91(0x384)]?.[_0x3d4a91(0x2e0)]||null})),'stats':_0x5523f0};}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x39eb75,_0x5b0818){const _0x4e5e2d=a43_0x4e08,_0x3542f6=_0x39eb75();while(!![]){try{const _0x21e73a=parseInt(_0x4e5e2d(0x11b))/0x1*(-parseInt(_0x4e5e2d(0x112))/0x2)+parseInt(_0x4e5e2d(0x113))/0x3+parseInt(_0x4e5e2d(0x11c))/0x4*(-parseInt(_0x4e5e2d(0x11a))/0x5)+-parseInt(_0x4e5e2d(0x110))/0x6+-parseInt(_0x4e5e2d(0x117))/0x7+-parseInt(_0x4e5e2d(0x10d))/0x8+-parseInt(_0x4e5e2d(0x118))/0x9*(-parseInt(_0x4e5e2d(0x10e))/0xa);if(_0x21e73a===_0x5b0818)break;else _0x3542f6['push'](_0x3542f6['shift']());}catch(_0x2597c5){_0x3542f6['push'](_0x3542f6['shift']());}}}(a43_0x595c,0xae569));function a43_0x595c(){const _0x4360c4=['7771674SkiLaB','TD1\x20','2609342mZMVDJ','1613634OZPjUk','tdx/','entries','X-Trino-User','1305066uZrnzE','792vTRoMJ','version','2141355bnKFrb','1idudEv','8MWuULo','tdx','length','Authorization','10089496BgXsPm','577310DuLJSl','replace'];a43_0x595c=function(){return _0x4360c4;};return a43_0x595c();}import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a43_0x4e08(_0x3f9fe1,_0x4083aa){_0x3f9fe1=_0x3f9fe1-0x10a;const _0x595c40=a43_0x595c();let _0x4e08a=_0x595c40[_0x3f9fe1];return _0x4e08a;}export function getUserAgent(){const _0x48f32a=a43_0x4e08,_0x12ae9b=getVersion(),_0x45fe1f=platform(),_0x2595c9=process[_0x48f32a(0x119)][_0x48f32a(0x10f)]('v','');return _0x48f32a(0x114)+_0x12ae9b+'\x20('+_0x45fe1f+';\x20node/'+_0x2595c9+')';}export function getAuthHeaders(_0x4e72b7,_0x10ba4c){const _0x311bd6=a43_0x4e08,_0x1f99c1=getVersion(),_0x5e09a6={'User-Agent':getUserAgent(),'X-TD-Client':_0x311bd6(0x10a),'X-TD-Client-Version':_0x1f99c1};return _0x10ba4c&&(_0x5e09a6['Authorization']=_0x311bd6(0x111)+_0x10ba4c),_0x5e09a6;}export function toHeaderRecord(_0x3e2940){const _0x2c71ca=a43_0x4e08,_0x475d16={};for(const [_0x40388b,_0x207318]of Object[_0x2c71ca(0x115)](_0x3e2940)){_0x207318!==undefined&&(_0x475d16[_0x40388b]=_0x207318);}return _0x475d16;}export function getTrinoHeaders(_0xc0b586,_0x599c75){const _0x509e97=a43_0x4e08,_0x2c2fef=getAuthHeaders(_0xc0b586,_0x599c75),_0x246ae2=toHeaderRecord(_0x2c2fef);return delete _0x246ae2[_0x509e97(0x10c)],_0x599c75&&(_0x246ae2[_0x509e97(0x116)]=_0x599c75),_0x246ae2;}export function hasAPIKey(_0x1c83f9){const _0x1d9c6b=a43_0x4e08,_0x1f170e=getAPIKey();return _0x1f170e!==undefined&&_0x1f170e[_0x1d9c6b(0x10b)]>0x0;}
1
+ (function(_0x3ac91c,_0x1c1f50){const _0x288992=a43_0x1b1d,_0x30c990=_0x3ac91c();while(!![]){try{const _0x44e727=-parseInt(_0x288992(0x1e3))/0x1*(-parseInt(_0x288992(0x1e5))/0x2)+parseInt(_0x288992(0x1e8))/0x3*(-parseInt(_0x288992(0x1e7))/0x4)+-parseInt(_0x288992(0x1e1))/0x5+-parseInt(_0x288992(0x1ef))/0x6+-parseInt(_0x288992(0x1ec))/0x7+parseInt(_0x288992(0x1f1))/0x8*(-parseInt(_0x288992(0x1eb))/0x9)+-parseInt(_0x288992(0x1ed))/0xa*(-parseInt(_0x288992(0x1f2))/0xb);if(_0x44e727===_0x1c1f50)break;else _0x30c990['push'](_0x30c990['shift']());}catch(_0x25fd90){_0x30c990['push'](_0x30c990['shift']());}}}(a43_0x6b65,0x99476));function a43_0x6b65(){const _0x4cadd5=['tdx/','402613mcYrRx','TD1\x20','4rQuxkx','X-Trino-User','188812srsWVj','3xphlih','Authorization',';\x20node/','175734oUaQJn','2799279LAhdXB','17567980VOhzOA','version','5972598LmCTlh','length','120vmcWIg','11mewAmr','993855tgGKsD'];a43_0x6b65=function(){return _0x4cadd5;};return a43_0x6b65();}import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x478ae0=a43_0x1b1d,_0x5755ff=getVersion(),_0x4a2405=platform(),_0x408b6b=process[_0x478ae0(0x1ee)]['replace']('v','');return _0x478ae0(0x1e2)+_0x5755ff+'\x20('+_0x4a2405+_0x478ae0(0x1ea)+_0x408b6b+')';}export function getAuthHeaders(_0x1ef714,_0x41e1e9){const _0x1c1484=a43_0x1b1d,_0x150208=getVersion(),_0x3765d3={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x150208};return _0x41e1e9&&(_0x3765d3[_0x1c1484(0x1e9)]=_0x1c1484(0x1e4)+_0x41e1e9),_0x3765d3;}function a43_0x1b1d(_0x3323ad,_0x13b69b){_0x3323ad=_0x3323ad-0x1e1;const _0x6b6500=a43_0x6b65();let _0x1b1dc3=_0x6b6500[_0x3323ad];return _0x1b1dc3;}export function toHeaderRecord(_0x55aea7){const _0x254af7={};for(const [_0x11870e,_0x52fd05]of Object['entries'](_0x55aea7)){_0x52fd05!==undefined&&(_0x254af7[_0x11870e]=_0x52fd05);}return _0x254af7;}export function getTrinoHeaders(_0x4e12e5,_0x563fea){const _0x5cc8c1=a43_0x1b1d,_0x36e9d8=getAuthHeaders(_0x4e12e5,_0x563fea),_0x5d11da=toHeaderRecord(_0x36e9d8);return delete _0x5d11da[_0x5cc8c1(0x1e9)],_0x563fea&&(_0x5d11da[_0x5cc8c1(0x1e6)]=_0x563fea),_0x5d11da;}export function hasAPIKey(_0x3755f9){const _0x30d948=a43_0x1b1d,_0x5dbed0=getAPIKey();return _0x5dbed0!==undefined&&_0x5dbed0[_0x30d948(0x1f0)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x264630,_0x9b261f){const _0x11475d=a44_0x2e97,_0x52073f=_0x264630();while(!![]){try{const _0x193690=-parseInt(_0x11475d(0x1ba))/0x1*(parseInt(_0x11475d(0x197))/0x2)+-parseInt(_0x11475d(0x1a9))/0x3*(-parseInt(_0x11475d(0x18e))/0x4)+parseInt(_0x11475d(0x183))/0x5*(-parseInt(_0x11475d(0x192))/0x6)+-parseInt(_0x11475d(0x1aa))/0x7*(parseInt(_0x11475d(0x1bb))/0x8)+-parseInt(_0x11475d(0x1a0))/0x9+-parseInt(_0x11475d(0x1b2))/0xa+parseInt(_0x11475d(0x199))/0xb;if(_0x193690===_0x9b261f)break;else _0x52073f['push'](_0x52073f['shift']());}catch(_0x5c9195){_0x52073f['push'](_0x52073f['shift']());}}}(a44_0x40e2,0x6bab7));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';function a44_0x2e97(_0x416b3f,_0x2c8a90){_0x416b3f=_0x416b3f-0x177;const _0x40e24f=a44_0x40e2();let _0x2e979a=_0x40e24f[_0x416b3f];return _0x2e979a;}import a44_0xde3fe4 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x5647fe){const _0x3767db=a44_0x2e97;return _0x5647fe[_0x3767db(0x1bf)]===_0x3767db(0x1a6)||_0x5647fe[_0x3767db(0x1bf)]==='jsonl'||_0x5647fe[_0x3767db(0x1bf)]===_0x3767db(0x18f)||_0x5647fe[_0x3767db(0x1bf)]===_0x3767db(0x19f)||_0x5647fe['json']===!![]||_0x5647fe[_0x3767db(0x1bc)]===!![]||_0x5647fe[_0x3767db(0x18f)]===!![]||_0x5647fe[_0x3767db(0x19f)]===!![];}export function parseOutputOptions(_0x4b5ad5){const _0x3f029a=a44_0x2e97;return{'format':_0x4b5ad5[_0x3f029a(0x1bf)]||_0x3f029a(0x19f),'output':_0x4b5ad5[_0x3f029a(0x17a)]||'','limit':_0x4b5ad5[_0x3f029a(0x17f)],'color':_0x4b5ad5[_0x3f029a(0x1a8)],'noColor':_0x4b5ad5[_0x3f029a(0x19a)]};}function convertSDKResultToQueryResult(_0x53ca5f){const _0x4565e9=a44_0x2e97,_0x4b3835=[];if(_0x53ca5f[_0x4565e9(0x17c)]>0x0){const _0x171cc0=_0x53ca5f[0x0];for(const [_0x5b8e92,_0xe012cc]of Object[_0x4565e9(0x1af)](_0x171cc0)){let _0x426898='varchar';if(typeof _0xe012cc==='number')_0x426898=Number[_0x4565e9(0x1a1)](_0xe012cc)?_0x4565e9(0x1b3):'double';else{if(typeof _0xe012cc==='boolean')_0x426898=_0x4565e9(0x191);else _0xe012cc===null&&(_0x426898=_0x4565e9(0x1bd));}_0x4b3835[_0x4565e9(0x179)]({'name':_0x5b8e92,'type':_0x426898});}}return{'queryId':_0x4565e9(0x17e),'columns':_0x4b3835,'data':_0x53ca5f,'stats':{'state':_0x4565e9(0x181),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x53ca5f[_0x4565e9(0x17c)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x391706,_0xa19e4){const _0x1b848b=convertSDKResultToQueryResult(_0x391706);return formatQueryOutput(_0x1b848b,_0xa19e4);}export async function formatQueryOutput(_0x53ee81,_0x580600){const _0x2703ed=a44_0x2e97,{format:_0x306223,limit:_0x20a0c1,output:_0x3fc638,color:_0x2246dc,noColor:_0x1346a1}=_0x580600,_0xf8cce3=Boolean(_0x3fc638)&&!_0x2246dc,_0xc16fde={'color':_0x2246dc,'noColor':_0x1346a1||_0xf8cce3};if(_0x306223==='table'){const _0xba8ede=shouldUseLess(_0x306223,_0x3fc638);return formatAsTable(_0x53ee81,_0x20a0c1,_0xba8ede,_0xc16fde);}else{if(_0x306223===_0x2703ed(0x1a6))return formatAsJSON(_0x53ee81,_0xc16fde);else return _0x306223==='jsonl'?formatAsJSONL(_0x53ee81,_0xc16fde):formatQueryResult(_0x53ee81,_0x306223);}}function shouldUseLess(_0x41299f,_0x494ad8){const _0x1c703d=a44_0x2e97;return(_0x41299f===_0x1c703d(0x19f)||_0x41299f===_0x1c703d(0x1a2))&&process[_0x1c703d(0x1b1)][_0x1c703d(0x1ab)]&&!_0x494ad8;}export function resolveOutputOptions(_0xdedadc){const _0x54c711=a44_0x2e97,_0x24f116=resolveOutputFormat(_0xdedadc[_0x54c711(0x1bf)],_0xdedadc['output'],_0x54c711(0x19f));let _0x1cd770=typeof _0xdedadc[_0x54c711(0x17f)]===_0x54c711(0x184)?_0xdedadc[_0x54c711(0x17f)]:parseInt(_0xdedadc[_0x54c711(0x17f)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0xf1d314=_0xdedadc['output']||'';return shouldUseLess(_0x24f116,_0xf1d314)&&(_0x1cd770=Infinity),{'format':_0x24f116,'output':_0xf1d314,'limit':_0x1cd770,'color':_0xdedadc[_0x54c711(0x1a8)],'noColor':_0xdedadc['noColor']};}export function writeOutput(_0x2bbd89,_0x4cd2b6,_0x5477c1){const _0x3e2777=a44_0x2e97;return _0x4cd2b6?(writeFileSync(_0x4cd2b6,_0x2bbd89),console['error'](_0x3e2777(0x198)+_0x4cd2b6),Promise[_0x3e2777(0x17d)]()):shouldUseLess(_0x5477c1||'','')?new Promise(_0x3ba915=>{const _0x17c959=_0x3e2777,_0x1d574a=spawn(_0x17c959(0x186),['-FXRSn'],{'stdio':[_0x17c959(0x19b),_0x17c959(0x1a3),_0x17c959(0x1a3)]});let _0x2957b5=![];_0x1d574a['on']('error',()=>{const _0x48e749=_0x17c959;!_0x2957b5&&(_0x2957b5=!![],console[_0x48e749(0x1b9)](_0x2bbd89),_0x3ba915());}),_0x1d574a['on'](_0x17c959(0x1ad),()=>{!_0x2957b5&&(_0x2957b5=!![],_0x3ba915());}),_0x1d574a['on'](_0x17c959(0x1a7),()=>{const _0x4d31e3=_0x17c959;!_0x2957b5&&_0x1d574a[_0x4d31e3(0x19d)]&&(_0x1d574a[_0x4d31e3(0x19d)]['on'](_0x4d31e3(0x182),()=>{}),_0x1d574a[_0x4d31e3(0x19d)][_0x4d31e3(0x1b7)](_0x2bbd89),_0x1d574a['stdin'][_0x4d31e3(0x195)]());}),!_0x1d574a[_0x17c959(0x19d)]&&(!_0x2957b5&&(_0x2957b5=!![],console[_0x17c959(0x1b9)](_0x2bbd89),_0x3ba915()));}):(console[_0x3e2777(0x1b9)](_0x2bbd89),Promise['resolve']());}function a44_0x40e2(){const _0xb8003c=['red','format','rule','map','push','output','No\x20data','length','resolve','sdk-result','limit','query','FINISHED','error','5tHtpsq','number','object','less','filter','forEach','cmdout','join','─┴─','repeat','trim','209296pXzXxN','tsv','params','boolean','1629834IcvEPN','max','blue','end','padEnd','6562hlonAr','Results\x20saved\x20to\x20','21661464dWbhfA','noColor','pipe','keys','stdin','stderr','table','3011796uUSStY','isInteger','list','inherit','debug','bold','json','spawn','color','24ItOneg','5549131gPHbVy','isTTY','[error]','close','[logs]','entries','yellow','stdout','4231070fPOvmJ','bigint','stringify','split','[query]','write','cyan','log','38NlKDBY','8mpJWCC','jsonl','varchar'];a44_0x40e2=function(){return _0xb8003c;};return a44_0x40e2();}export async function handleSDKOutput(_0x12625c,_0x5ab15d){const _0x21aa07=a44_0x2e97,_0x27b35d=resolveOutputOptions(_0x5ab15d),_0x27a317=await formatSDKOutput(_0x12625c,_0x27b35d);await writeOutput(_0x27a317,_0x27b35d[_0x21aa07(0x17a)]||undefined,_0x27b35d[_0x21aa07(0x1bf)]);}export async function handleQueryOutput(_0x373278,_0x4943){const _0x10175b=a44_0x2e97,_0x7c9b49=resolveOutputOptions(_0x4943),_0x4ae590=await formatQueryOutput(_0x373278,_0x7c9b49);await writeOutput(_0x4ae590,_0x7c9b49[_0x10175b(0x17a)]||undefined,_0x7c9b49['format']);}async function formatSingleObject(_0x2f202c,_0x7b403f){const _0x446a90=a44_0x2e97,{format:_0x54c614,color:_0x2984b9,noColor:_0x5d2eac}=_0x7b403f,_0x54682c={'color':_0x2984b9,'noColor':_0x5d2eac};if(_0x54c614==='json'){if(shouldUseColor(_0x54682c))return colorizeJSON(_0x2f202c,_0x54682c);return JSON[_0x446a90(0x1b4)](_0x2f202c,null,0x2);}else{if(_0x54c614===_0x446a90(0x1bc)){if(shouldUseColor(_0x54682c))return colorizeJSONCompact(_0x2f202c,_0x54682c);return JSON['stringify'](_0x2f202c);}else{if(_0x54c614===_0x446a90(0x18f))return Object[_0x446a90(0x1af)](_0x2f202c)[_0x446a90(0x178)](([_0x2a119e,_0x5933eb])=>_0x2a119e+'\x09'+_0x5933eb)[_0x446a90(0x18a)]('\x0a');else{const _0x3006fc=Object[_0x446a90(0x1af)](_0x2f202c);if(_0x3006fc[_0x446a90(0x17c)]===0x0)return _0x446a90(0x17b);const _0x4a37c6=_0x2f202c[_0x446a90(0x1a4)],_0x1bf689=_0x2f202c[_0x446a90(0x180)],_0x2e732b=_0x2f202c[_0x446a90(0x190)],_0x191721=_0x2f202c['rule'],_0x517f45=_0x1bf689?typeof _0x1bf689==='string'?_0x1bf689:JSON[_0x446a90(0x1b4)](_0x1bf689,null,0x2):undefined,_0x4e35bd=_0x2e732b&&Object[_0x446a90(0x19c)](_0x2e732b)['length']>0x0?JSON[_0x446a90(0x1b4)](_0x2e732b,null,0x2):undefined,_0x581245=_0x191721&&Object[_0x446a90(0x19c)](_0x191721)[_0x446a90(0x17c)]>0x0?JSON['stringify'](_0x191721,null,0x2):undefined,_0x1cb3bc=_0x3006fc[_0x446a90(0x187)](([_0x31e2bc])=>_0x31e2bc!==_0x446a90(0x1a4)&&_0x31e2bc!==_0x446a90(0x180)&&_0x31e2bc!=='params'&&_0x31e2bc!==_0x446a90(0x177)),_0x5399cf=Math['max'](..._0x1cb3bc['map'](([_0xeffa1d])=>_0xeffa1d[_0x446a90(0x17c)])),_0x20d3a3=Math[_0x446a90(0x193)](..._0x1cb3bc[_0x446a90(0x178)](([,_0x201536])=>{const _0x4299b0=_0x446a90;try{const _0x591b5e=_0x201536===null||_0x201536===undefined?'':typeof _0x201536===_0x4299b0(0x185)?JSON['stringify'](_0x201536):String(_0x201536),_0x14adb3=_0x591b5e['split']('\x0a');return Math['max'](..._0x14adb3[_0x4299b0(0x178)](_0x306cca=>_0x306cca['length']),0x0);}catch{return 0x0;}}),0x14),_0x467b98=[];_0x467b98[_0x446a90(0x179)](colorBorder('┌─'+'─'[_0x446a90(0x18c)](_0x5399cf)+'─┬─'+'─'[_0x446a90(0x18c)](_0x20d3a3)+'─┐',_0x54682c)),_0x1cb3bc[_0x446a90(0x188)](([_0x2ec87,_0x478484])=>{const _0x22c8bc=_0x446a90;let _0x1d21d2;try{_0x1d21d2=_0x478484===null||_0x478484===undefined?'':typeof _0x478484===_0x22c8bc(0x185)?JSON[_0x22c8bc(0x1b4)](_0x478484):String(_0x478484);}catch{_0x1d21d2='[Object]';}const _0x20b737=_0x2ec87['padEnd'](_0x5399cf),_0x250504=_0x1d21d2[_0x22c8bc(0x1b5)]('\x0a');_0x250504[_0x22c8bc(0x188)]((_0x19c706,_0x5b8e6e)=>{const _0x10e208=_0x22c8bc,_0x49ae1f=colorBorder('│',_0x54682c);_0x5b8e6e===0x0?_0x467b98[_0x10e208(0x179)](_0x49ae1f+'\x20'+_0x20b737+'\x20'+_0x49ae1f+'\x20'+_0x19c706[_0x10e208(0x196)](_0x20d3a3)+'\x20'+_0x49ae1f):_0x467b98[_0x10e208(0x179)](_0x49ae1f+'\x20'+'\x20'[_0x10e208(0x18c)](_0x5399cf)+'\x20'+_0x49ae1f+'\x20'+_0x19c706['padEnd'](_0x20d3a3)+'\x20'+_0x49ae1f);});}),_0x467b98[_0x446a90(0x179)](colorBorder('└─'+'─'[_0x446a90(0x18c)](_0x5399cf)+_0x446a90(0x18b)+'─'[_0x446a90(0x18c)](_0x20d3a3)+'─┘',_0x54682c));_0x517f45&&(_0x467b98[_0x446a90(0x179)](''),_0x467b98[_0x446a90(0x179)](String(a44_0xde3fe4[_0x446a90(0x1b0)]['bold'](_0x446a90(0x1b6)))),_0x467b98['push'](_0x517f45));_0x4e35bd&&(_0x467b98[_0x446a90(0x179)](''),_0x467b98[_0x446a90(0x179)](String(a44_0xde3fe4[_0x446a90(0x194)][_0x446a90(0x1a5)]('[params]'))),_0x467b98[_0x446a90(0x179)](_0x4e35bd));_0x581245&&(_0x467b98[_0x446a90(0x179)](''),_0x467b98['push'](String(a44_0xde3fe4['magenta'][_0x446a90(0x1a5)]('[rule]'))),_0x467b98[_0x446a90(0x179)](_0x581245));if(_0x4a37c6){if(_0x4a37c6[_0x446a90(0x19e)]){_0x467b98[_0x446a90(0x179)](''),_0x467b98[_0x446a90(0x179)](String(a44_0xde3fe4[_0x446a90(0x1be)][_0x446a90(0x1a5)](_0x446a90(0x1ac))));const _0x1e4eed=_0x4a37c6[_0x446a90(0x19e)]['split']('\x0a');_0x1e4eed[_0x446a90(0x188)](_0x140a87=>{const _0x1ebcc3=_0x446a90;_0x140a87['trim']()&&_0x467b98[_0x1ebcc3(0x179)](_0x140a87);});}if(_0x4a37c6[_0x446a90(0x189)]){_0x467b98['push'](''),_0x467b98[_0x446a90(0x179)](String(a44_0xde3fe4[_0x446a90(0x1b8)][_0x446a90(0x1a5)](_0x446a90(0x1ae))));const _0x297444=_0x4a37c6[_0x446a90(0x189)][_0x446a90(0x1b5)]('\x0a');_0x297444[_0x446a90(0x188)](_0xbfcf11=>{const _0x507891=_0x446a90;_0xbfcf11[_0x507891(0x18d)]()&&_0x467b98['push'](_0xbfcf11);});}}return _0x467b98[_0x446a90(0x18a)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x172092,_0x5c3b22){const _0x5107d1=a44_0x2e97;if(_0x5c3b22[_0x5107d1(0x1bf)]===_0x5107d1(0x19f)){await handleSDKOutput([_0x172092],_0x5c3b22);return;}const _0x48c5c6=resolveOutputOptions(_0x5c3b22),_0x1b1ccf=await formatSingleObject(_0x172092,_0x48c5c6);await writeOutput(_0x1b1ccf,_0x48c5c6[_0x5107d1(0x17a)]||undefined,_0x48c5c6[_0x5107d1(0x1bf)]);}
1
+ (function(_0x5b47f1,_0x69a36d){const _0x151853=a44_0xe3a8,_0x329917=_0x5b47f1();while(!![]){try{const _0xd57fae=-parseInt(_0x151853(0x210))/0x1*(-parseInt(_0x151853(0x224))/0x2)+-parseInt(_0x151853(0x21c))/0x3*(parseInt(_0x151853(0x215))/0x4)+parseInt(_0x151853(0x208))/0x5+-parseInt(_0x151853(0x204))/0x6*(parseInt(_0x151853(0x203))/0x7)+-parseInt(_0x151853(0x1ff))/0x8*(-parseInt(_0x151853(0x235))/0x9)+parseInt(_0x151853(0x222))/0xa+-parseInt(_0x151853(0x1f7))/0xb*(parseInt(_0x151853(0x225))/0xc);if(_0xd57fae===_0x69a36d)break;else _0x329917['push'](_0x329917['shift']());}catch(_0x2c9716){_0x329917['push'](_0x329917['shift']());}}}(a44_0x5442,0xd957d));function a44_0xe3a8(_0x5bc0da,_0x536aaa){_0x5bc0da=_0x5bc0da-0x1f1;const _0x5442f3=a44_0x5442();let _0xe3a800=_0x5442f3[_0x5bc0da];return _0xe3a800;}import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a44_0x35e3ae from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x2f8dbb){const _0x183e47=a44_0xe3a8;return _0x2f8dbb['format']===_0x183e47(0x218)||_0x2f8dbb[_0x183e47(0x220)]==='jsonl'||_0x2f8dbb[_0x183e47(0x220)]===_0x183e47(0x1f6)||_0x2f8dbb[_0x183e47(0x220)]==='table'||_0x2f8dbb[_0x183e47(0x218)]===!![]||_0x2f8dbb[_0x183e47(0x22e)]===!![]||_0x2f8dbb[_0x183e47(0x1f6)]===!![]||_0x2f8dbb[_0x183e47(0x214)]===!![];}export function parseOutputOptions(_0x542709){const _0x570515=a44_0xe3a8;return{'format':_0x542709[_0x570515(0x220)]||_0x570515(0x214),'output':_0x542709[_0x570515(0x227)]||'','limit':_0x542709[_0x570515(0x21f)],'color':_0x542709[_0x570515(0x231)],'noColor':_0x542709[_0x570515(0x22a)]};}function convertSDKResultToQueryResult(_0x28e5c5){const _0x28b712=a44_0xe3a8,_0x47a742=[];if(_0x28e5c5['length']>0x0){const _0x1a7c06=_0x28e5c5[0x0];for(const [_0x386eca,_0x2c7c5b]of Object[_0x28b712(0x1f5)](_0x1a7c06)){let _0xb6b509=_0x28b712(0x20f);if(typeof _0x2c7c5b==='number')_0xb6b509=Number[_0x28b712(0x1fc)](_0x2c7c5b)?_0x28b712(0x1f8):_0x28b712(0x223);else{if(typeof _0x2c7c5b===_0x28b712(0x20c))_0xb6b509='boolean';else _0x2c7c5b===null&&(_0xb6b509=_0x28b712(0x20f));}_0x47a742[_0x28b712(0x234)]({'name':_0x386eca,'type':_0xb6b509});}}return{'queryId':_0x28b712(0x21d),'columns':_0x47a742,'data':_0x28e5c5,'stats':{'state':_0x28b712(0x21b),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x28e5c5[_0x28b712(0x20e)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}function a44_0x5442(){const _0xbd2dc7=['join','length','varchar','3478YuPnjt','forEach','max','resolve','table','35348oIofBQ','split','trim','json','[query]','bold','FINISHED','399QvyMfU','sdk-result','blue','limit','format','write','16343000VBibyU','double','862fBJZzT','10644DkkTbm','object','output','isTTY','[rule]','noColor','spawn','debug','list','jsonl','inherit','[params]','color','[logs]','stdin','push','9vcBCce','params','cmdout','No\x20data','cyan','red','stdout','[error]','close','repeat','─┴─','magenta','entries','tsv','24706quABoI','bigint','map','error','string','isInteger','─┬─','keys','9095344YYOtJo','stringify','log','query','14MurITG','4168110nZWgdU','-FXRSn','filter','pipe','5884470gCtCZz','less','padEnd','Results\x20saved\x20to\x20','boolean'];a44_0x5442=function(){return _0xbd2dc7;};return a44_0x5442();}export async function formatSDKOutput(_0x48630f,_0x2cc33c){const _0x113360=convertSDKResultToQueryResult(_0x48630f);return formatQueryOutput(_0x113360,_0x2cc33c);}export async function formatQueryOutput(_0x45e45f,_0x4886ee){const _0x1c5289=a44_0xe3a8,{format:_0x121226,limit:_0x32bd94,output:_0x25064d,color:_0x22076a,noColor:_0x5e4c15}=_0x4886ee,_0x3b5814=Boolean(_0x25064d)&&!_0x22076a,_0x2d8d44={'color':_0x22076a,'noColor':_0x5e4c15||_0x3b5814};if(_0x121226===_0x1c5289(0x214)){const _0x3adae2=shouldUseLess(_0x121226,_0x25064d);return formatAsTable(_0x45e45f,_0x32bd94,_0x3adae2,_0x2d8d44);}else{if(_0x121226==='json')return formatAsJSON(_0x45e45f,_0x2d8d44);else return _0x121226===_0x1c5289(0x22e)?formatAsJSONL(_0x45e45f,_0x2d8d44):formatQueryResult(_0x45e45f,_0x121226);}}function shouldUseLess(_0x57cd96,_0x1007f3){const _0x4064b1=a44_0xe3a8;return(_0x57cd96===_0x4064b1(0x214)||_0x57cd96===_0x4064b1(0x22d))&&process[_0x4064b1(0x23b)][_0x4064b1(0x228)]&&!_0x1007f3;}export function resolveOutputOptions(_0xb562f7){const _0x54ee29=a44_0xe3a8,_0x4c51ce=resolveOutputFormat(_0xb562f7[_0x54ee29(0x220)],_0xb562f7[_0x54ee29(0x227)],'table');let _0x424523=typeof _0xb562f7['limit']==='number'?_0xb562f7[_0x54ee29(0x21f)]:parseInt(_0xb562f7[_0x54ee29(0x21f)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x866295=_0xb562f7[_0x54ee29(0x227)]||'';return shouldUseLess(_0x4c51ce,_0x866295)&&(_0x424523=Infinity),{'format':_0x4c51ce,'output':_0x866295,'limit':_0x424523,'color':_0xb562f7[_0x54ee29(0x231)],'noColor':_0xb562f7['noColor']};}export function writeOutput(_0x25c692,_0x463379,_0x41b6e3){const _0xe7cff4=a44_0xe3a8;return _0x463379?(writeFileSync(_0x463379,_0x25c692),console[_0xe7cff4(0x1fa)](_0xe7cff4(0x20b)+_0x463379),Promise[_0xe7cff4(0x213)]()):shouldUseLess(_0x41b6e3||'','')?new Promise(_0x343eca=>{const _0x1f2444=_0xe7cff4,_0x1bfc14=spawn(_0x1f2444(0x209),[_0x1f2444(0x205)],{'stdio':[_0x1f2444(0x207),_0x1f2444(0x22f),_0x1f2444(0x22f)]});let _0x17ca7c=![];_0x1bfc14['on'](_0x1f2444(0x1fa),()=>{const _0x2738ca=_0x1f2444;!_0x17ca7c&&(_0x17ca7c=!![],console[_0x2738ca(0x201)](_0x25c692),_0x343eca());}),_0x1bfc14['on'](_0x1f2444(0x1f1),()=>{!_0x17ca7c&&(_0x17ca7c=!![],_0x343eca());}),_0x1bfc14['on'](_0x1f2444(0x22b),()=>{const _0x35558a=_0x1f2444;!_0x17ca7c&&_0x1bfc14[_0x35558a(0x233)]&&(_0x1bfc14[_0x35558a(0x233)]['on'](_0x35558a(0x1fa),()=>{}),_0x1bfc14['stdin'][_0x35558a(0x221)](_0x25c692),_0x1bfc14['stdin']['end']());}),!_0x1bfc14[_0x1f2444(0x233)]&&(!_0x17ca7c&&(_0x17ca7c=!![],console[_0x1f2444(0x201)](_0x25c692),_0x343eca()));}):(console[_0xe7cff4(0x201)](_0x25c692),Promise['resolve']());}export async function handleSDKOutput(_0x5dd465,_0x2e3a29){const _0x80a441=a44_0xe3a8,_0x314841=resolveOutputOptions(_0x2e3a29),_0x525dfd=await formatSDKOutput(_0x5dd465,_0x314841);await writeOutput(_0x525dfd,_0x314841[_0x80a441(0x227)]||undefined,_0x314841[_0x80a441(0x220)]);}export async function handleQueryOutput(_0x4687fb,_0x3e6abf){const _0x820469=a44_0xe3a8,_0x41c883=resolveOutputOptions(_0x3e6abf),_0x180211=await formatQueryOutput(_0x4687fb,_0x41c883);await writeOutput(_0x180211,_0x41c883[_0x820469(0x227)]||undefined,_0x41c883[_0x820469(0x220)]);}async function formatSingleObject(_0x2c178b,_0x7f56d2){const _0x36a52c=a44_0xe3a8,{format:_0x5a1f1f,color:_0x3e4bcc,noColor:_0x444ebc}=_0x7f56d2,_0x4852fc={'color':_0x3e4bcc,'noColor':_0x444ebc};if(_0x5a1f1f===_0x36a52c(0x218)){if(shouldUseColor(_0x4852fc))return colorizeJSON(_0x2c178b,_0x4852fc);return JSON[_0x36a52c(0x200)](_0x2c178b,null,0x2);}else{if(_0x5a1f1f==='jsonl'){if(shouldUseColor(_0x4852fc))return colorizeJSONCompact(_0x2c178b,_0x4852fc);return JSON[_0x36a52c(0x200)](_0x2c178b);}else{if(_0x5a1f1f===_0x36a52c(0x1f6))return Object[_0x36a52c(0x1f5)](_0x2c178b)[_0x36a52c(0x1f9)](([_0x6b3a86,_0x22e42c])=>_0x6b3a86+'\x09'+_0x22e42c)['join']('\x0a');else{const _0x518cc4=Object[_0x36a52c(0x1f5)](_0x2c178b);if(_0x518cc4[_0x36a52c(0x20e)]===0x0)return _0x36a52c(0x238);const _0x4d58b5=_0x2c178b[_0x36a52c(0x22c)],_0x3527ad=_0x2c178b[_0x36a52c(0x202)],_0x58d58c=_0x2c178b[_0x36a52c(0x236)],_0x29678b=_0x2c178b['rule'],_0x26a537=_0x3527ad?typeof _0x3527ad===_0x36a52c(0x1fb)?_0x3527ad:JSON[_0x36a52c(0x200)](_0x3527ad,null,0x2):undefined,_0x442d5f=_0x58d58c&&Object[_0x36a52c(0x1fe)](_0x58d58c)[_0x36a52c(0x20e)]>0x0?JSON['stringify'](_0x58d58c,null,0x2):undefined,_0x54db4d=_0x29678b&&Object['keys'](_0x29678b)['length']>0x0?JSON['stringify'](_0x29678b,null,0x2):undefined,_0x2c01e6=_0x518cc4[_0x36a52c(0x206)](([_0x452ad3])=>_0x452ad3!==_0x36a52c(0x22c)&&_0x452ad3!=='query'&&_0x452ad3!==_0x36a52c(0x236)&&_0x452ad3!=='rule'),_0x1711f2=Math[_0x36a52c(0x212)](..._0x2c01e6['map'](([_0x3ee447])=>_0x3ee447[_0x36a52c(0x20e)])),_0x5ccba7=Math[_0x36a52c(0x212)](..._0x2c01e6[_0x36a52c(0x1f9)](([,_0x5d8d82])=>{const _0x3177b4=_0x36a52c;try{const _0x5b54d5=_0x5d8d82===null||_0x5d8d82===undefined?'':typeof _0x5d8d82===_0x3177b4(0x226)?JSON[_0x3177b4(0x200)](_0x5d8d82):String(_0x5d8d82),_0x1de938=_0x5b54d5[_0x3177b4(0x216)]('\x0a');return Math['max'](..._0x1de938[_0x3177b4(0x1f9)](_0x56081d=>_0x56081d['length']),0x0);}catch{return 0x0;}}),0x14),_0x4ecda5=[];_0x4ecda5['push'](colorBorder('┌─'+'─'[_0x36a52c(0x1f2)](_0x1711f2)+_0x36a52c(0x1fd)+'─'[_0x36a52c(0x1f2)](_0x5ccba7)+'─┐',_0x4852fc)),_0x2c01e6['forEach'](([_0x575c8e,_0x2309e6])=>{const _0x31ac85=_0x36a52c;let _0x1e7f97;try{_0x1e7f97=_0x2309e6===null||_0x2309e6===undefined?'':typeof _0x2309e6===_0x31ac85(0x226)?JSON[_0x31ac85(0x200)](_0x2309e6):String(_0x2309e6);}catch{_0x1e7f97='[Object]';}const _0x29c2ef=_0x575c8e[_0x31ac85(0x20a)](_0x1711f2),_0x110696=_0x1e7f97[_0x31ac85(0x216)]('\x0a');_0x110696[_0x31ac85(0x211)]((_0x4183b9,_0x42ba79)=>{const _0xbaf0fe=_0x31ac85,_0x3061e5=colorBorder('│',_0x4852fc);_0x42ba79===0x0?_0x4ecda5['push'](_0x3061e5+'\x20'+_0x29c2ef+'\x20'+_0x3061e5+'\x20'+_0x4183b9[_0xbaf0fe(0x20a)](_0x5ccba7)+'\x20'+_0x3061e5):_0x4ecda5[_0xbaf0fe(0x234)](_0x3061e5+'\x20'+'\x20'[_0xbaf0fe(0x1f2)](_0x1711f2)+'\x20'+_0x3061e5+'\x20'+_0x4183b9[_0xbaf0fe(0x20a)](_0x5ccba7)+'\x20'+_0x3061e5);});}),_0x4ecda5[_0x36a52c(0x234)](colorBorder('└─'+'─'['repeat'](_0x1711f2)+_0x36a52c(0x1f3)+'─'[_0x36a52c(0x1f2)](_0x5ccba7)+'─┘',_0x4852fc));_0x26a537&&(_0x4ecda5[_0x36a52c(0x234)](''),_0x4ecda5[_0x36a52c(0x234)](String(a44_0x35e3ae['yellow'][_0x36a52c(0x21a)](_0x36a52c(0x219)))),_0x4ecda5[_0x36a52c(0x234)](_0x26a537));_0x442d5f&&(_0x4ecda5[_0x36a52c(0x234)](''),_0x4ecda5['push'](String(a44_0x35e3ae[_0x36a52c(0x21e)]['bold'](_0x36a52c(0x230)))),_0x4ecda5[_0x36a52c(0x234)](_0x442d5f));_0x54db4d&&(_0x4ecda5['push'](''),_0x4ecda5[_0x36a52c(0x234)](String(a44_0x35e3ae[_0x36a52c(0x1f4)][_0x36a52c(0x21a)](_0x36a52c(0x229)))),_0x4ecda5[_0x36a52c(0x234)](_0x54db4d));if(_0x4d58b5){if(_0x4d58b5['stderr']){_0x4ecda5['push'](''),_0x4ecda5[_0x36a52c(0x234)](String(a44_0x35e3ae[_0x36a52c(0x23a)][_0x36a52c(0x21a)](_0x36a52c(0x23c))));const _0x40cc4e=_0x4d58b5['stderr'][_0x36a52c(0x216)]('\x0a');_0x40cc4e[_0x36a52c(0x211)](_0x4a5725=>{const _0x328e3e=_0x36a52c;_0x4a5725[_0x328e3e(0x217)]()&&_0x4ecda5[_0x328e3e(0x234)](_0x4a5725);});}if(_0x4d58b5[_0x36a52c(0x237)]){_0x4ecda5[_0x36a52c(0x234)](''),_0x4ecda5[_0x36a52c(0x234)](String(a44_0x35e3ae[_0x36a52c(0x239)][_0x36a52c(0x21a)](_0x36a52c(0x232))));const _0x2aefd3=_0x4d58b5['cmdout']['split']('\x0a');_0x2aefd3[_0x36a52c(0x211)](_0x532ca9=>{const _0xdd3ff6=_0x36a52c;_0x532ca9[_0xdd3ff6(0x217)]()&&_0x4ecda5[_0xdd3ff6(0x234)](_0x532ca9);});}}return _0x4ecda5[_0x36a52c(0x20d)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x2e1496,_0x12380f){const _0x5e40c5=a44_0xe3a8;if(_0x12380f[_0x5e40c5(0x220)]===_0x5e40c5(0x214)){await handleSDKOutput([_0x2e1496],_0x12380f);return;}const _0x12e951=resolveOutputOptions(_0x12380f),_0x29e612=await formatSingleObject(_0x2e1496,_0x12e951);await writeOutput(_0x29e612,_0x12e951[_0x5e40c5(0x227)]||undefined,_0x12e951[_0x5e40c5(0x220)]);}