@treasuredata/tdx 0.23.1 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.d.ts +14 -3
- package/dist/commands/chat-command.d.ts.map +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/chat-command.js.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.d.ts.map +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/index.js.map +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.d.ts +4 -4
- package/dist/sdk/llm/model-factors.d.ts.map +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/model-factors.js.map +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/llm.d.ts +1 -0
- package/dist/sdk/types/llm.d.ts.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a42_0x548fe7=a42_0x3632;(function(_0x220811,_0xf56ec6){const _0xb87c72=a42_0x3632,_0xd0e709=_0x220811();while(!![]){try{const _0xeb8ff8=parseInt(_0xb87c72(0x304))/0x1+-parseInt(_0xb87c72(0x205))/0x2*(parseInt(_0xb87c72(0x353))/0x3)+-parseInt(_0xb87c72(0x226))/0x4*(parseInt(_0xb87c72(0x21f))/0x5)+parseInt(_0xb87c72(0x37d))/0x6+-parseInt(_0xb87c72(0x2a8))/0x7+parseInt(_0xb87c72(0x2be))/0x8*(-parseInt(_0xb87c72(0x2f0))/0x9)+parseInt(_0xb87c72(0x2b3))/0xa;if(_0xeb8ff8===_0xf56ec6)break;else _0xd0e709['push'](_0xd0e709['shift']());}catch(_0x1ad299){_0xd0e709['push'](_0xd0e709['shift']());}}}(a42_0x46c0,0x291cf));import a42_0x5737de from'chalk';import{existsSync}from'fs';import a42_0x32a3eb from'path';import{BaseCommand}from'./command.js';function a42_0x46c0(){const _0x3a4e79=['No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Reason:\x20','running','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','workflow:kill','generateSessionTimelineRows','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Parameters:\x20','localeCompare','\x20attempt','projects','Project\x20name\x20is\x20required','Using\x20attempt\x20','\x20\x20Session\x20context\x20set\x20to:\x20','isTTY','limit','---\x20','planned','getDate','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','startedAt','createdAt','getFullYear','\x20tasks','sessionTime','resumeFrom','relative','\x0aPolling...\x20(','toLowerCase','499142RAylvk','now','message','tasks','List\x20workflow\x20execution\x20sessions','\x0a⚠\x20Project\x20\x22','Project:\x20','MAX_POLL_ITERATIONS','jsonl','Error:\x20Secret\x20key\x20is\x20required','\x20has\x20no\x20attempts','5653880LNcEaN','list','durationMs','No\x20sessions\x20found','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','reason','Attempt:\x20','Source\x20directory:\x20','prepareCloneProject','Error:\x20Invalid\x20JSON\x20in\x20--params','→\x20Project:\x20','136QFqEgW','projectId','substring','applyPullProject','sort','blue','unchanged','run','\x20(use\x20--limit\x20to\x20show\x20more)','listSecrets','📁\x20','window','workflow:tasks','Getting\x20attempt\x20details...','ICON_SPACING','Source\x20project:\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','Pull\x20workflow\x20project\x20to\x20local\x20folder','Show\x20tasks\x20for\x20an\x20attempt','Error:\x20Invalid\x20parameter\x20format:\x20','dim','indexOf','Killing\x20attempt...','No\x20sessions\x20found\x20in\x20project:\x20','from','getMonth','Session\x20not\x20found:\x20','\x0aError:','description','fileSize','Invalid\x20format:\x20','Key:\x20','msPerChar','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','buildTimelineData','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','red','Output\x20directory:\x20','No\x20workflow\x20sessions\x20found','renderSingleTimeline','rows','Error:\x20Attempt\x20ID\x20is\x20required','List\x20all\x20workflow\x20projects','size','workflowProject','Error:\x20','revision','metadata','✔\x20Project\x20updated','Warning:','146871hrjLdX','kill','\x1b[1A\x1b[2K','newProjectId','/attempt/','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Include\x20retried:\x20yes','logFiles','✔\x20Found\x20','padStart','workflow:use','write','Listing\x20secrets...','Auto-selected\x20latest\x20session:\x20','duration','Downloading\x20logs...','workflow:workflows','summary','session','workflow:secrets:delete','267821eVjKPO','yes','site','\x20(system)','filesExtracted','⚠\x20Showing\x20first\x20','✔\x20Retry\x20started','renderTimeline','resolveProjectDir','Force:\x20yes','\x0a✔\x20Attempt\x20complete','text','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','No\x20attempts\x20found','No\x20workflow\x20projects\x20found','name','yellow','autocomplete','workflows','min','Resume\x20from:\x20','Files\x20to\x20upload:\x20','updatedAt','Failed\x20to\x20fetch\x20attempt\x20data','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','\x20\x20Revision:\x20','isNewProject','.\x20Expected\x20format:\x20KEY=VALUE','\x27\x20from\x20project\x20\x27','setSecret','has','MIN_LABEL_COUNT','\x0aDry\x20run\x20-\x20nothing\x20pushed','set','Error:\x20Project\x20name\x20is\x20required','✔\x20Push\x20complete','\x20\x20tdx\x20wf\x20use\x20<project>','\x20\x20New\x20attempt\x20ID:\x20','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','No\x20workflows\x20found','startTime','\x22\x20already\x20exists\x20(ID:\x20','✔\x20Secret\x20\x27','-\x20nothing\x20pushed','getMinutes','workflow:timeline','MAX_TASKS_DISPLAY','error','cyan','pullProject','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','modified','retryAttempt','title','deleteSecret','find','skipValidation','\x20deleted','group_error','\x20workflow','path','preparePushProject','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','success','Fetching\x20log\x20files...','navigateSessionsInteractive','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','\x20\x20Project:\x20','changes','\x20unchanged','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','✔\x20Showing\x20','✔\x20Workflow\x20project\x20context\x20cleared.','fullName','attempt','end','workflow','\x22?\x20This\x20cannot\x20be\x20undone.','\x22\x20to\x20new\x20project\x20\x22','111MbBaAM','\x20to\x20see\x20detailed\x20logs','(use\x20--limit\x20to\x20see\x20more)','session_id','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Cloning\x20to\x20','parseProjectWorkflowPattern','sourceProjectName','pollTimeline','Tip:\x20cd\x20to\x20workflows/','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','start','executeCloneProject','Source\x20directory\x20is\x20required','workflow:attempt','green','New\x20project\x20name:\x20','tdx.json','(unknown)','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','unknown','renderSessionsTimeline','every','total','type','-\x20no\x20files\x20written','max','List\x20workflows','POLL_INTERVAL_MS','\x20logs','finishedAt','executePushProject','log','dryRun','\x0a✔\x20No\x20changes\x20to\x20push','params','replace','readFile','\x20\x20Workflow:\x20','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Project\x20ID:\x20','Target:\x20','51036opjSsk','Attempt\x20ID:\x20','\x20-\x20','value','workflow:download','push','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','filter','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','Task\x20name:\x20','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Select\x20a\x20workflow\x20to\x20run','List\x20workflow\x20attempts','includeRetried','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','Select\x20a\x20task\x20to\x20view\x20logs:','requireProject','Listing\x20workflow\x20projects...','No\x20matching\x20sessions\x20found','resolve','sessions','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','map','deleted','task','targetDir','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','match','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','/sessions/','Latest\x20session\x20has\x20no\x20attempt','Filter:\x20project=','From\x20task:\x20','targetExists','Source:\x20','\x20\x20Location:\x20','follow','toISOString','Resolving\x20project\x20\x27','splice','stdout','fileCount','workflow:clone','✔\x20Clone\x20complete','pending','basename','Retrying\x20session...','✔\x20Workflow\x20run\x20started','Retrying\x20attempt...','stringify','cwd','✔\x20Pushed\x20','\x20task','No\x20log\x20files\x20found\x20for\x20this\x20attempt','10038krHTzl','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','...','newProjectName','Total:\x20','ICON_WIDTH','\x20\x20Console:\x20','round','cancelRequested','workflow:retry','\x20new','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Analyzing\x20changes...','No\x20projects\x20match\x20pattern:\x20','resolveProjectId','length','No\x20sessions\x20found\x20for:\x20','\x20session','keys','Including\x20subtasks:\x20yes','\x20\x20Source:\x20','verbose','Deleting\x20project\x20','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','→\x20New\x20project:\x20','\x20is\x20not\x20a\x20directory','694420wcKTiS','startsWith','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','Session\x20','output','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','project','4xSAFum','force','Validation:\x20skipped','trimEnd','tdx\x20wf\x20attempt\x20','slice','white','MIN_TIMELINE_WIDTH','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','key','json','No\x20attempts\x20found\x20in\x20project:\x20','TASK_NAME_WIDTH','Params:\x20','canceling','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','clear','Dry\x20run:\x20yes','🔄\x20','Show\x20specific\x20attempt\x20details','lastAttempt','taskName','hasChanges','workflow:projects','sys','Key\x20cannot\x20be\x20empty','isArray','✔\x20Deleted\x20project\x20','Deleting\x20secret...','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','session:','showWorkflowConsoleUrl','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','parse','\x20\x20Session\x20ID:\x20','trim','Start\x20a\x20workflow\x20run','GUTTER','format','join','getTime','table','done','\x20secret','data','Session\x20time:\x20','\x20\x20Changes:\x20','Filter:\x20','\x0aPush\x20these\x20changes?','Status:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','includes','attempts','✔\x20Pull\x20complete','get','utf-8','MAX_LABEL_COUNT','retrySession','Updating\x20','\x20sessions\x20','execute','Error:\x20KEY=VALUE\x20is\x20required','Cancelled','repeat','split','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','workflow:secrets:set','attemptId','\x0aUpdate\x20existing\x20project\x20\x22','download','Getting\x20attempt\x20tasks...','No\x20workflows\x20found\x20in\x20project:\x20','fill','projectName','resolveProject','Revision:\x20','diff','floor','Project\x20name:\x20','Project\x20filter:\x20','Loading\x20workflows...','workflowName','getHours','sourceDir','Setting\x20secret...','\x20modified','delete','Error:','\x20\x20Attempt\x20ID:\x20','fs/promises','sessionId','state','✔\x20Workflow\x20project\x20set\x20to:\x20','💡\x20Tip:\x20Use\x20','LABEL_MIN_SPACING','select','index','displayLine','\x20\x20Target:\x20','new','\x0aFailed\x20to\x20fetch\x20attempt\x20data'];a42_0x46c0=function(){return _0x3a4e79;};return a42_0x46c0();}import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a42_0x2a4a52 from'prompts';function getAttemptStatusDisplay(_0x31fbc3){const _0x4e4037=a42_0x3632;if(!_0x31fbc3)return{'icon':'⏳','text':''};const {done:_0x26091d,success:_0x4ee619,cancelRequested:_0x226621}=_0x31fbc3;if(!_0x26091d)return _0x226621?{'icon':'🛑','text':a42_0x5737de[_0x4e4037(0x314)](_0x4e4037(0x234))}:{'icon':'🔄','text':a42_0x5737de[_0x4e4037(0x2c3)](_0x4e4037(0x28d))};if(_0x4ee619)return{'icon':'✅','text':a42_0x5737de[_0x4e4037(0x362)](_0x4e4037(0x343))};return{'icon':'❌','text':a42_0x5737de[_0x4e4037(0x2e2)](_0x4e4037(0x333))};}export class WorkflowBaseCommand extends BaseCommand{[a42_0x548fe7(0x270)](_0x297db6,_0x243d99,_0x1df67f=0x0){const _0x5f2bfb=a42_0x548fe7;return _0x297db6[_0x1df67f]||_0x243d99[_0x5f2bfb(0x2ea)];}[a42_0x548fe7(0x38e)](_0xcef595,_0x17238e,_0xe9453=0x0){const _0x3c6e11=a42_0x548fe7,_0x446675=this['resolveProject'](_0xcef595,_0x17238e,_0xe9453);if(!_0x446675)return console[_0x3c6e11(0x333)](a42_0x5737de['red'](_0x3c6e11(0x27d)),_0x3c6e11(0x296)),console[_0x3c6e11(0x333)](a42_0x5737de['dim'](_0x3c6e11(0x34a))),null;return _0x446675;}[a42_0x548fe7(0x359)](_0x5cd2de,_0x301f7f){const _0x20857b=a42_0x548fe7;if(_0x5cd2de[0x0]){const _0x3cd391=_0x5cd2de[0x0][_0x20857b(0x266)]('.');if(_0x3cd391['length']===0x1)return{'projectName':_0x3cd391[0x0],'workflowName':undefined};else return _0x3cd391[_0x20857b(0x214)]===0x2?{'projectName':_0x3cd391[0x0],'workflowName':_0x3cd391[0x1]}:(console[_0x20857b(0x333)](a42_0x5737de[_0x20857b(0x2e2)](_0x20857b(0x27d)),_0x20857b(0x35d)),null);}return{'projectName':_0x301f7f[_0x20857b(0x2ea)],'workflowName':undefined};}['resolveProjectDir'](_0x37b183,_0x433d76,_0x18c5b3=0x0){const _0x1b980a=a42_0x548fe7;if(_0x37b183[_0x18c5b3])return _0x37b183[_0x18c5b3];if(_0x433d76[_0x1b980a(0x2ea)]){const _0x46a890=a42_0x32a3eb[_0x1b980a(0x24d)](process['cwd'](),_0x1b980a(0x316),_0x433d76['workflowProject']);if(existsSync(a42_0x32a3eb[_0x1b980a(0x24d)](_0x46a890,_0x1b980a(0x364))))return _0x46a890;}return undefined;}async['showWorkflowConsoleUrl'](_0x21f519,_0x2635a3,_0x511aa3){const _0x5e3867=a42_0x548fe7;try{const _0x26c424=await _0x21f519[_0x5e3867(0x350)][_0x5e3867(0x316)](_0x2635a3,{'limit':0x1});if(_0x26c424[_0x5e3867(0x214)]>0x0){const _0x1874a6=_0x26c424[0x0]['id'],_0x48f7f0=getWorkflowUrl(_0x511aa3,_0x1874a6);console['error']('\x20\x20Console:\x20'+a42_0x5737de[_0x5e3867(0x334)](_0x48f7f0));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a42_0x548fe7(0x313)]=a42_0x548fe7(0x2fa);[a42_0x548fe7(0x2da)]='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async[a42_0x548fe7(0x262)](_0x1b07da){const _0x4e1f45=a42_0x548fe7,{options:_0x29f45c,args:_0x3b62c7,tdx:_0x328c84}=_0x1b07da,_0x545aae=_0x3b62c7[0x0],_0x2003fc=_0x29f45c[_0x4e1f45(0x236)];if(_0x2003fc)return saveSessionContext({'workflow_project':undefined},_0x29f45c[_0x4e1f45(0x302)]),console[_0x4e1f45(0x373)](a42_0x5737de['green'](_0x4e1f45(0x34c))),0x0;if(!_0x545aae)return console[_0x4e1f45(0x333)](a42_0x5737de['red']('Error:'),_0x4e1f45(0x296)),console['error'](a42_0x5737de[_0x4e1f45(0x2d2)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x4e1f45(0x333)](a42_0x5737de[_0x4e1f45(0x2d2)](_0x4e1f45(0x346))),0x1;const _0x300760=await withSpinner(_0x4e1f45(0x1f5)+_0x545aae+'\x27...',()=>_0x328c84[_0x4e1f45(0x350)][_0x4e1f45(0x213)](_0x545aae),{'verbose':_0x29f45c[_0x4e1f45(0x21a)]}),{name:_0xbfb7a9}=_0x300760[_0x4e1f45(0x252)];return saveSessionContext({'workflow_project':_0xbfb7a9},_0x29f45c['session']),console['log'](a42_0x5737de[_0x4e1f45(0x362)](_0x4e1f45(0x282)+a42_0x5737de['cyan'](_0xbfb7a9))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a42_0x548fe7(0x23d);[a42_0x548fe7(0x2da)]=a42_0x548fe7(0x2e8);async[a42_0x548fe7(0x262)](_0x308048){const _0x14f68b=a42_0x548fe7,{options:_0x2d22c0,args:_0x326669,tdx:_0x10bfee}=_0x308048,_0xcee178=_0x326669[0x0];_0x2d22c0[_0x14f68b(0x21a)]&&_0xcee178&&console[_0x14f68b(0x333)]('Pattern:\x20'+_0xcee178);const _0x518a2b=await withSpinner(_0x14f68b(0x38f),()=>_0x10bfee[_0x14f68b(0x350)][_0x14f68b(0x295)](_0xcee178,{'limit':_0x2d22c0[_0x14f68b(0x29a)]}),{'verbose':_0x2d22c0['verbose']});let _0x3ee269=_0x518a2b['data'];_0x3ee269['sort']((_0x3001bf,_0x281421)=>_0x3001bf[_0x14f68b(0x313)][_0x14f68b(0x293)](_0x281421['name']));const _0x59ba40=_0x2d22c0[_0x14f68b(0x29a)]||0x64,_0x579432=_0x3ee269['length']>=_0x59ba40?a42_0x5737de[_0x14f68b(0x2d2)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x14f68b(0x333)]('✔\x20Found\x20'+_0x3ee269['length']+'\x20project'+(_0x3ee269['length']!==0x1?'s':'')+_0x579432);if(_0x2d22c0[_0x14f68b(0x24c)]===_0x14f68b(0x230)||_0x2d22c0['format']==='jsonl'||_0x2d22c0[_0x14f68b(0x24c)]===_0x14f68b(0x24f))await handleSDKOutput(_0x3ee269,_0x2d22c0);else{if(_0x3ee269['length']===0x0)_0xcee178?console['log'](_0x14f68b(0x212)+_0xcee178):console['log'](_0x14f68b(0x312));else{const _0x1c2400=_0x3ee269['map'](_0x149eb0=>{const _0x2be110=_0x14f68b,_0x82a2ca=_0x149eb0[_0x2be110(0x2ed)]?.['some'](_0x93afce=>_0x93afce[_0x2be110(0x22f)]===_0x2be110(0x23e)),_0xea0a3c=_0x82a2ca?a42_0x5737de['dim'](_0x2be110(0x307)):'';return _0x2be110(0x2c8)+_0x149eb0['name']+_0xea0a3c;});await writeOutput(_0x1c2400[_0x14f68b(0x24d)]('\x0a'),_0x2d22c0['output'],_0x14f68b(0x2b4));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a42_0x548fe7(0x313)]=a42_0x548fe7(0x300);['description']=a42_0x548fe7(0x36e);async[a42_0x548fe7(0x262)](_0x3d2645){const _0x360754=a42_0x548fe7,{options:_0x21385c,args:_0x4b4f61,tdx:_0x2bcbf8}=_0x3d2645,_0x37959d=this[_0x360754(0x270)](_0x4b4f61,_0x21385c);_0x21385c[_0x360754(0x21a)]&&_0x37959d&&console[_0x360754(0x333)](_0x360754(0x275)+_0x37959d);const _0x5c9a21=await withSpinner('Listing\x20workflows...',()=>_0x2bcbf8[_0x360754(0x350)][_0x360754(0x316)](_0x37959d,{'limit':_0x21385c[_0x360754(0x29a)]}),{'verbose':_0x21385c[_0x360754(0x21a)]});let _0x4f681a=_0x5c9a21['data'];_0x4f681a[_0x360754(0x2c2)]((_0x6a6122,_0x1bfa32)=>{const _0x1cca46=_0x360754,_0x558adf=_0x6a6122[_0x1cca46(0x313)]['localeCompare'](_0x1bfa32[_0x1cca46(0x313)]);if(_0x558adf!==0x0)return _0x558adf;return(_0x6a6122[_0x1cca46(0x225)]?.[_0x1cca46(0x313)]||'')[_0x1cca46(0x293)](_0x1bfa32[_0x1cca46(0x225)]?.['name']||'');});const _0x4da198=_0x21385c[_0x360754(0x29a)]||0x64,_0x42c140=_0x4f681a[_0x360754(0x214)]>=_0x4da198?a42_0x5737de['dim']('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x360754(0x333)]('✔\x20Found\x20'+_0x4f681a[_0x360754(0x214)]+_0x360754(0x33f)+(_0x4f681a[_0x360754(0x214)]!==0x1?'s':'')+_0x42c140);if(_0x21385c[_0x360754(0x24c)]==='json'||_0x21385c[_0x360754(0x24c)]===_0x360754(0x2b0)||_0x21385c[_0x360754(0x24c)]==='table')await handleSDKOutput(_0x4f681a,_0x21385c);else{if(_0x4f681a[_0x360754(0x214)]===0x0)_0x37959d?console['log'](_0x360754(0x26d)+_0x37959d):console['log'](_0x360754(0x32b));else{const _0x292e92=_0x21385c['site'],_0x22d406=_0x4f681a[_0x360754(0x394)](_0x559521=>{const _0x370cc3=_0x360754,_0x394d4c=a42_0x5737de[_0x370cc3(0x2d2)]('#'+_0x559521['id']),_0x290548=hyperlink(_0x394d4c,getWorkflowUrl(_0x292e92,_0x559521['id'])),_0xf50f5e=_0x559521[_0x370cc3(0x225)]?.[_0x370cc3(0x313)]?a42_0x5737de[_0x370cc3(0x2d2)]('\x20('+_0x559521['project'][_0x370cc3(0x313)]+')'):'';return'📋\x20'+_0x290548+'\x20'+_0x559521[_0x370cc3(0x313)]+_0xf50f5e;});await writeOutput(_0x22d406['join']('\x0a'),_0x21385c[_0x360754(0x223)],_0x360754(0x2b4));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a42_0x548fe7(0x313)]='workflow:sessions';[a42_0x548fe7(0x2da)]=a42_0x548fe7(0x2ac);async['execute'](_0x479d71){const _0x4035e5=a42_0x548fe7,{options:_0x46251d,args:_0x466db9,tdx:_0xa3d7e4}=_0x479d71,_0x1d450f=this['parseProjectWorkflowPattern'](_0x466db9,_0x46251d);if(!_0x1d450f)return 0x1;const {projectName:_0x4b6b18,workflowName:_0x6e1ba2}=_0x1d450f;if(_0x46251d[_0x4035e5(0x21a)]){if(_0x4b6b18&&_0x6e1ba2)console[_0x4035e5(0x333)](_0x4035e5(0x255)+_0x4b6b18+'.'+_0x6e1ba2);else _0x4b6b18&&console['error'](_0x4035e5(0x1ee)+_0x4b6b18);const _0x183a5d=_0x46251d['status'];_0x183a5d&&console[_0x4035e5(0x333)](_0x4035e5(0x257)+_0x183a5d);}let _0x1d9a51=0x28;if(process[_0x4035e5(0x1f7)][_0x4035e5(0x299)]&&!_0x46251d[_0x4035e5(0x223)]&&!_0x46251d[_0x4035e5(0x24c)]){const _0x2f823b=process[_0x4035e5(0x1f7)][_0x4035e5(0x2e6)]||0x28;_0x1d9a51=Math[_0x4035e5(0x36d)](0x14,Math[_0x4035e5(0x273)](_0x2f823b*0x2/0x3));}const _0x212d27=_0x46251d[_0x4035e5(0x29a)]||_0x1d9a51,_0x10e9ec=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0xa3d7e4['workflow'][_0x4035e5(0x392)]({'projectName':_0x4b6b18,'workflowName':_0x6e1ba2,'status':_0x46251d['status'],'fromTime':_0x46251d[_0x4035e5(0x2d6)],'toTime':_0x46251d['to'],'limit':_0x212d27}),{'verbose':_0x46251d[_0x4035e5(0x21a)]}),_0xab1ea5=_0x10e9ec[_0x4035e5(0x252)];_0xab1ea5['sort']((_0x1a45bb,_0x49d324)=>{const _0x52e990=_0x4035e5,_0x324d45=_0x1a45bb[_0x52e990(0x2a3)]||'',_0x1d031a=_0x49d324[_0x52e990(0x2a3)]||'';return _0x1d031a[_0x52e990(0x293)](_0x324d45);});_0xab1ea5[_0x4035e5(0x214)]>=_0x212d27?console[_0x4035e5(0x333)](_0x4035e5(0x34b)+_0xab1ea5['length']+_0x4035e5(0x261)+a42_0x5737de[_0x4035e5(0x2d2)](_0x4035e5(0x355))):console['error']('✔\x20Found\x20'+_0xab1ea5[_0x4035e5(0x214)]+_0x4035e5(0x216)+(_0xab1ea5[_0x4035e5(0x214)]!==0x1?'s':''));if(_0x46251d[_0x4035e5(0x24c)]===_0x4035e5(0x230)||_0x46251d[_0x4035e5(0x24c)]===_0x4035e5(0x2b0)||_0x46251d[_0x4035e5(0x24c)]==='table')await handleSDKOutput(_0xab1ea5,_0x46251d);else{if(!process[_0x4035e5(0x1f7)][_0x4035e5(0x299)]||_0x46251d[_0x4035e5(0x223)]){if(_0xab1ea5['length']===0x0){if(_0x4b6b18&&_0x6e1ba2)console[_0x4035e5(0x373)](_0x4035e5(0x215)+_0x4b6b18+'.'+_0x6e1ba2);else _0x4b6b18?console[_0x4035e5(0x373)](_0x4035e5(0x2d5)+_0x4b6b18):console[_0x4035e5(0x373)](_0x4035e5(0x2b6));}else{const _0x51177b=_0x46251d['site'],_0x453358=this['renderSessionsTimeline'](_0xab1ea5,_0x51177b);_0x46251d[_0x4035e5(0x223)]?await writeOutput(_0x453358,_0x46251d[_0x4035e5(0x223)],_0x4035e5(0x2b4)):console[_0x4035e5(0x373)](_0x453358);}!_0x4b6b18&&(console[_0x4035e5(0x333)](''),console[_0x4035e5(0x333)](a42_0x5737de['dim'](_0x4035e5(0x388))),console['error'](a42_0x5737de[_0x4035e5(0x2d2)](_0x4035e5(0x22e))+'or'+a42_0x5737de[_0x4035e5(0x2d2)](_0x4035e5(0x328))));}else{if(_0xab1ea5[_0x4035e5(0x214)]===0x0){if(_0x4b6b18&&_0x6e1ba2)console[_0x4035e5(0x373)](_0x4035e5(0x215)+_0x4b6b18+'.'+_0x6e1ba2);else _0x4b6b18?console[_0x4035e5(0x373)](_0x4035e5(0x2d5)+_0x4b6b18):console[_0x4035e5(0x373)](_0x4035e5(0x2b6));}else await this['navigateSessionsInteractive'](_0xab1ea5,_0x479d71,_0x4b6b18);}}return 0x0;}['renderSessionsTimeline'](_0x4d3db2,_0xd25341){const _0x28d738=a42_0x548fe7,_0x24da2c=[],_0x11de17=new Map();let _0x4f902e=Infinity,_0x2e3e86=-Infinity;for(const _0x3e5aa1 of _0x4d3db2){if(_0x3e5aa1[_0x28d738(0x23a)]?.['createdAt']){const _0x547dd1=new Date(_0x3e5aa1[_0x28d738(0x23a)]['createdAt'])[_0x28d738(0x24e)](),_0x50df69=_0x3e5aa1['lastAttempt'][_0x28d738(0x371)]?new Date(_0x3e5aa1[_0x28d738(0x23a)][_0x28d738(0x371)])['getTime']():Date[_0x28d738(0x2a9)](),_0xdfc5b4=_0x3e5aa1['project']?.[_0x28d738(0x313)]||_0x28d738(0x365);!_0x11de17[_0x28d738(0x322)](_0xdfc5b4)&&_0x11de17['set'](_0xdfc5b4,[]),_0x11de17[_0x28d738(0x25c)](_0xdfc5b4)['push']({'session':_0x3e5aa1,'startTime':_0x547dd1,'endTime':_0x50df69,'duration':_0x50df69-_0x547dd1}),_0x4f902e=Math['min'](_0x4f902e,_0x547dd1),_0x2e3e86=Math[_0x28d738(0x36d)](_0x2e3e86,_0x50df69);}}if(_0x11de17[_0x28d738(0x2e9)]===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x4d26ec=process[_0x28d738(0x1f7)]['columns']||0x78,_0x1306a4=0x1e,_0x2d6977=0x32,_0x1073cd=0x4,_0x498c88=Math[_0x28d738(0x317)](_0x2d6977,Math[_0x28d738(0x36d)](_0x1306a4,Math[_0x28d738(0x273)](_0x4d26ec*0.3))),_0x319d17=_0x4d26ec-_0x498c88-TIMELINE_CONFIG[_0x28d738(0x24b)]-0x3-_0x1073cd,_0x313294=_0x2e3e86-_0x4f902e,_0x493071=_0x313294/_0x498c88,_0x201703=renderTimeAxis({'startTime':_0x4f902e,'endTime':_0x2e3e86,'durationMs':_0x313294,'msPerChar':_0x493071},_0x498c88),_0x2210eb=[];for(const _0x1c1de9 of _0x11de17['values']()){_0x2210eb[_0x28d738(0x382)](..._0x1c1de9);}_0x2210eb[_0x28d738(0x2c2)]((_0x403e93,_0x4be78b)=>_0x4be78b['startTime']-_0x403e93['startTime']);const _0x27e3ae=new Date(_0x4f902e),_0x4a28da=formatDate(_0x27e3ae),_0x4f3264=_0x1073cd+TIMELINE_CONFIG[_0x28d738(0x20a)]+TIMELINE_CONFIG[_0x28d738(0x2cc)]+_0x319d17,_0x17cb4e='\x20'[_0x28d738(0x265)](_0x4f3264-_0x4a28da[_0x28d738(0x214)]),_0x107dc2=_0x17cb4e+a42_0x5737de[_0x28d738(0x2d2)](_0x4a28da)+'\x20'+_0x201703;_0x24da2c[_0x28d738(0x382)](_0x107dc2);const _0x1ff45e=0x16;let _0x553ec9=0x0;for(const _0x377ff1 of _0x2210eb){const _0x4b36a0=_0x377ff1[_0x28d738(0x302)]['project']?.['name']||'?',_0x4870cd=Math[_0x28d738(0x317)](stringWidth(_0x4b36a0),_0x1ff45e);_0x553ec9=Math[_0x28d738(0x36d)](_0x553ec9,_0x4870cd);}for(const _0x3b0088 of _0x2210eb){const {session:_0xb4221c,startTime:_0x500a05,endTime:_0x21f175,duration:_0xbf352a}=_0x3b0088,_0x21b614=_0xb4221c[_0x28d738(0x225)]?.['id'],_0x285bdb=_0xb4221c['id'],_0x3f82a8=_0xb4221c[_0x28d738(0x225)]?.[_0x28d738(0x313)]||'?',_0x3b46d3=_0xb4221c[_0x28d738(0x350)]?.[_0x28d738(0x313)]||'?';let _0x315e00,_0x35d7fc;if(_0xb4221c[_0x28d738(0x23a)]){const _0x5d77a1=_0xb4221c[_0x28d738(0x23a)];!_0x5d77a1[_0x28d738(0x250)]?(_0x315e00=_0x5d77a1[_0x28d738(0x20d)]?'🛑':'🔄',_0x35d7fc=_0x5d77a1[_0x28d738(0x20d)]?a42_0x5737de['yellow']:a42_0x5737de[_0x28d738(0x2c3)]):(_0x315e00=_0x5d77a1[_0x28d738(0x343)]?'✅':'❌',_0x35d7fc=_0x5d77a1[_0x28d738(0x343)]?a42_0x5737de[_0x28d738(0x362)]:a42_0x5737de[_0x28d738(0x2e2)]);}else _0x315e00='⏳',_0x35d7fc=a42_0x5737de[_0x28d738(0x2d2)];const _0x404d03='#'+_0x285bdb,_0x390533=_0x21b614?hyperlink(_0x404d03,getWorkflowSessionUrl(_0xd25341,_0x21b614,_0x285bdb)):_0x404d03;let _0x454d73=_0x3f82a8;stringWidth(_0x3f82a8)>_0x1ff45e&&(_0x454d73=_0x3f82a8[_0x28d738(0x22b)](0x0,_0x1ff45e-0x1)+'…');const _0x3a6c8c=a42_0x5737de['dim'](_0x454d73),_0x425593=stringWidth(_0x454d73),_0x189363='\x20'[_0x28d738(0x265)](_0x553ec9-stringWidth(_0x454d73)+0x2),_0x3c4ea8='('+formatElapsed(_0xbf352a)+')',_0x3d40d2=stringWidth(_0x3c4ea8),_0x44373e=stringWidth(_0x404d03),_0x39395c=_0x44373e+0x1+_0x425593+_0x189363[_0x28d738(0x214)],_0x5b0d8d=_0x319d17-_0x39395c-_0x3d40d2-0x1-0x8;let _0x307195=_0x3b46d3;stringWidth(_0x307195)>_0x5b0d8d&&(_0x307195=_0x307195['slice'](0x0,_0x5b0d8d-0x1)+'…');const _0x49159c=_0x390533+'\x20'+_0x3a6c8c+_0x189363+_0x307195,_0x502ddb=stringWidth(_0x49159c),_0xe9b6d8=_0x319d17-_0x502ddb-_0x3d40d2,_0x318dbe=_0x49159c+'\x20'[_0x28d738(0x265)](Math[_0x28d738(0x36d)](0x1,_0xe9b6d8))+a42_0x5737de[_0x28d738(0x2d2)](_0x3c4ea8),_0x199f3a=Math[_0x28d738(0x273)]((_0x500a05-_0x4f902e)/_0x493071),_0x2a2c36=Math[_0x28d738(0x273)]((_0x21f175-_0x4f902e)/_0x493071),_0x1e6980=Math[_0x28d738(0x36d)](_0x199f3a+0x1,_0x2a2c36),_0x46e20e=new Array(_0x498c88)[_0x28d738(0x26e)]('\x20');for(let _0x5577e2=_0x199f3a;_0x5577e2<Math['min'](_0x1e6980,_0x498c88);_0x5577e2++){_0x46e20e[_0x5577e2]='─';}const _0x5bef0f=_0x46e20e[_0x28d738(0x394)](_0x3d1e30=>_0x3d1e30==='\x20'?'\x20':_0x35d7fc(_0x3d1e30))[_0x28d738(0x24d)]('');_0x24da2c[_0x28d738(0x382)](_0x315e00+'\x20'+_0x318dbe+'│'+_0x5bef0f+'│');}return _0x24da2c['join']('\x0a');}async[a42_0x548fe7(0x345)](_0x1b7cf5,_0x3a6a22,_0x1c5c29){const _0xd13e1d=a42_0x548fe7,{options:_0x23d756,tdx:_0x2b2820}=_0x3a6a22,_0x2381bd=_0x23d756[_0xd13e1d(0x306)],{timelineRows:_0x13c6f4,timeAxisHeader:_0x187c0c}=this[_0xd13e1d(0x290)](_0x1b7cf5,_0x2381bd),_0x147d27=_0x13c6f4[_0xd13e1d(0x384)](_0x14c8c3=>_0x14c8c3[_0xd13e1d(0x269)]);if(_0x147d27[_0xd13e1d(0x214)]===0x0){const _0x365238=this[_0xd13e1d(0x368)](_0x1b7cf5,_0x2381bd);console[_0xd13e1d(0x373)](_0x365238);!_0x1c5c29&&(console[_0xd13e1d(0x333)](''),console[_0xd13e1d(0x333)](a42_0x5737de['dim'](_0xd13e1d(0x388))),console[_0xd13e1d(0x333)](a42_0x5737de[_0xd13e1d(0x2d2)](_0xd13e1d(0x22e))+'or'+a42_0x5737de[_0xd13e1d(0x2d2)](_0xd13e1d(0x328))));return;}_0x187c0c&&console[_0xd13e1d(0x373)](_0x187c0c);const _0x4a61b5=_0x13c6f4[_0xd13e1d(0x384)](_0x4887d8=>_0x4887d8['attemptId'])['map'](_0x3fe34d=>({'title':_0x3fe34d[_0xd13e1d(0x287)],'value':_0x3fe34d[_0xd13e1d(0x269)]})),_0x1f889f=process['stdout']['rows']||0x3c,_0xeee27d=Math[_0xd13e1d(0x36d)](0x28,Math['floor'](_0x1f889f*0x2/0x3)),_0x21e027=await a42_0x2a4a52({'type':_0xd13e1d(0x315),'name':'attemptId','message':_0xd13e1d(0x32a),'choices':_0x4a61b5,'initial':-0x1,'limit':_0xeee27d,'clearFirst':!![],'fallback':{'title':_0xd13e1d(0x390),'value':null},'suggest':(_0x2a0403,_0x4a8d6b)=>{const _0x67bd9b=_0xd13e1d;if(!_0x2a0403)return Promise[_0x67bd9b(0x391)](_0x4a8d6b);const _0x666fc=_0x4a8d6b[_0x67bd9b(0x384)](_0x32078b=>{const _0x4acc65=_0x67bd9b,_0x2bd40a=_0x32078b;return _0x2bd40a[_0x4acc65(0x339)][_0x4acc65(0x2a7)]()['includes'](_0x2a0403[_0x4acc65(0x2a7)]());});return Promise[_0x67bd9b(0x391)](_0x666fc);}}),_0x117d73=()=>{const _0x564390=_0xd13e1d;process['stdout'][_0x564390(0x2fb)](_0x564390(0x2f2)),process['stdout'][_0x564390(0x2fb)](_0x564390(0x2f2)),process[_0x564390(0x1f7)][_0x564390(0x2fb)](_0x564390(0x2f2));},_0x24f662=_0x21e027&&_0x21e027[_0xd13e1d(0x269)]&&_0x21e027[_0xd13e1d(0x269)]!==null&&_0x21e027['attemptId'][_0xd13e1d(0x249)]()!=='';if(!_0x24f662){_0x117d73(),console[_0xd13e1d(0x373)](a42_0x5737de[_0xd13e1d(0x2d2)](_0xd13e1d(0x264)));return;}_0x117d73();const _0x2c2513=_0x1b7cf5['find'](_0x4e0576=>_0x4e0576[_0xd13e1d(0x23a)]?.['id']===_0x21e027['attemptId']);if(_0x2c2513){const _0x56f48a=_0x2c2513[_0xd13e1d(0x225)]?.[_0xd13e1d(0x313)]||'?',_0x4f0121=_0x2c2513[_0xd13e1d(0x350)]?.[_0xd13e1d(0x313)]||'?';console['log']('Project:\x20'+a42_0x5737de[_0xd13e1d(0x2d2)](_0x56f48a)+',\x20Workflow:\x20'+a42_0x5737de[_0xd13e1d(0x2d2)](_0x4f0121));}const _0x7b19d3=new WorkflowTimelineCommand();await _0x7b19d3[_0xd13e1d(0x262)]({'args':[],'options':{..._0x23d756,'attemptId':_0x21e027[_0xd13e1d(0x269)]},'tdx':_0x2b2820});}[a42_0x548fe7(0x290)](_0x45107e,_0xa6cb72){const _0x170c5d=a42_0x548fe7,_0x357c3e=new Map();for(const _0xee43f1 of _0x45107e){_0xee43f1['id']&&_0xee43f1[_0x170c5d(0x23a)]?.['id']&&_0x357c3e[_0x170c5d(0x325)](_0xee43f1['id'],_0xee43f1[_0x170c5d(0x23a)]['id']);}const _0x12b86c=[];let _0x186d0d='';const _0x2759ab=this[_0x170c5d(0x368)](_0x45107e,_0xa6cb72),_0x3a3963=_0x2759ab[_0x170c5d(0x266)]('\x0a');for(const _0x71ec38 of _0x3a3963){if(_0x71ec38[_0x170c5d(0x220)](_0x170c5d(0x37a))||_0x71ec38[_0x170c5d(0x1ea)](/^\s+\d{4}-\d{2}-\d{2}/))_0x186d0d=_0x71ec38;else{if(_0x71ec38['match'](/^[✅❌🔄🛑⏳]/)){const _0x346ef6=_0x71ec38[_0x170c5d(0x1ea)](/#(\d+)/),_0x137f07=_0x346ef6?_0x346ef6[0x1]:null,_0x2f84be=_0x137f07?_0x357c3e[_0x170c5d(0x25c)](_0x137f07)||null:null,_0x1b37a2=_0x45107e['find'](_0x50069c=>_0x50069c['id']===_0x137f07),_0x2c78c0=_0x1b37a2?.[_0x170c5d(0x225)]?.['name']||'';_0x12b86c['push']({'displayLine':_0x71ec38,'attemptId':_0x2f84be,'projectName':_0x2c78c0});}}}return{'timelineRows':_0x12b86c,'timeAxisHeader':_0x186d0d};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']='workflow:attempts';['description']=a42_0x548fe7(0x38a);async[a42_0x548fe7(0x262)](_0x1f6d71){const _0x212bdf=a42_0x548fe7,{options:_0xab0d0b,args:_0x50ed2b,tdx:_0x499e4f}=_0x1f6d71,_0xdf6d62=this[_0x212bdf(0x359)](_0x50ed2b,_0xab0d0b);if(!_0xdf6d62)return 0x1;const {projectName:_0x41bdac,workflowName:_0x213441}=_0xdf6d62,_0x36c388=_0xab0d0b[_0x212bdf(0x38b)];if(_0xab0d0b[_0x212bdf(0x21a)]){if(_0x41bdac&&_0x213441)console[_0x212bdf(0x333)](_0x212bdf(0x255)+_0x41bdac+'.'+_0x213441);else _0x41bdac&&console[_0x212bdf(0x333)]('Filter:\x20project='+_0x41bdac);_0x36c388&&console[_0x212bdf(0x333)](_0x212bdf(0x2f6));}const _0x32b32f=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x499e4f[_0x212bdf(0x350)][_0x212bdf(0x25a)]({'projectName':_0x41bdac,'workflowName':_0x213441,'includeRetried':_0x36c388,'limit':_0xab0d0b[_0x212bdf(0x29a)]}),{'verbose':_0xab0d0b[_0x212bdf(0x21a)]}),_0x2ab4e1=_0x32b32f['data'],_0x2a673c=_0xab0d0b['limit']||0x64,_0x1ca62d=_0x2ab4e1['length']>=_0x2a673c?a42_0x5737de['dim'](_0x212bdf(0x2c6)):'';console[_0x212bdf(0x333)](_0x212bdf(0x2f8)+_0x2ab4e1[_0x212bdf(0x214)]+_0x212bdf(0x294)+(_0x2ab4e1['length']!==0x1?'s':'')+_0x1ca62d);if(_0xab0d0b[_0x212bdf(0x24c)]===_0x212bdf(0x230)||_0xab0d0b[_0x212bdf(0x24c)]===_0x212bdf(0x2b0)||_0xab0d0b[_0x212bdf(0x24c)]===_0x212bdf(0x24f))await handleSDKOutput(_0x2ab4e1,_0xab0d0b);else{if(_0x2ab4e1[_0x212bdf(0x214)]===0x0){if(_0x41bdac&&_0x213441)console[_0x212bdf(0x373)]('No\x20attempts\x20found\x20for:\x20'+_0x41bdac+'.'+_0x213441);else _0x41bdac?console[_0x212bdf(0x373)](_0x212bdf(0x231)+_0x41bdac):console['log'](_0x212bdf(0x311));}else{const _0x32f5e9=_0xab0d0b[_0x212bdf(0x306)],_0x18c566=_0x2ab4e1['map'](_0x5e4d2b=>{const _0x43111a=_0x212bdf,_0x3467ad=a42_0x5737de['dim']('#'+_0x5e4d2b['id']),_0x44645f=_0x5e4d2b['project']?.['id'],_0x28ad3f=_0x5e4d2b[_0x43111a(0x356)]||_0x5e4d2b[_0x43111a(0x280)],_0x1a6c2e=_0x44645f&&_0x28ad3f?hyperlink(_0x3467ad,getWorkflowAttemptUrl(_0x32f5e9,_0x44645f,_0x28ad3f,_0x5e4d2b['id'])):_0x3467ad,{icon:_0x2d9f80,text:_0x4c7eb9}=getAttemptStatusDisplay(_0x5e4d2b),_0x2ba2eb=(_0x5e4d2b['project']?.[_0x43111a(0x313)]||'?')+'.'+(_0x5e4d2b[_0x43111a(0x350)]?.['name']||'?'),_0x2aac79=_0x5e4d2b['sessionTime']?a42_0x5737de[_0x43111a(0x2d2)](_0x5e4d2b['sessionTime']):'';return(_0x1a6c2e+'\x20'+_0x2d9f80+(_0x4c7eb9?'\x20'+_0x4c7eb9:'')+'\x20'+_0x2ba2eb+'\x20'+_0x2aac79)[_0x43111a(0x229)]();});await writeOutput(_0x18c566[_0x212bdf(0x24d)]('\x0a'),_0xab0d0b['output'],_0x212bdf(0x2b4));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a42_0x548fe7(0x313)]=a42_0x548fe7(0x361);['description']=a42_0x548fe7(0x239);async['execute'](_0x1bb502){const _0x4ea1d7=a42_0x548fe7,{options:_0x9d2c08,args:_0x52610a,tdx:_0x576ec4}=_0x1bb502,_0x183943=_0x52610a[0x0];if(!_0x183943)return console[_0x4ea1d7(0x333)](_0x4ea1d7(0x2e7)),0x1;_0x9d2c08[_0x4ea1d7(0x21a)]&&console[_0x4ea1d7(0x333)]('Attempt\x20ID:\x20'+_0x183943);const _0x1c4e12=await withSpinner(_0x4ea1d7(0x2cb),()=>_0x576ec4[_0x4ea1d7(0x350)]['attempt'](_0x183943),{'verbose':_0x9d2c08[_0x4ea1d7(0x21a)]}),_0xea0dc0=_0x1c4e12['data'];let _0x4c1fc2;!_0xea0dc0[_0x4ea1d7(0x250)]?_0x4c1fc2=_0xea0dc0[_0x4ea1d7(0x20d)]?_0x4ea1d7(0x234):_0x4ea1d7(0x28d):_0x4c1fc2=_0xea0dc0[_0x4ea1d7(0x343)]?_0x4ea1d7(0x343):_0x4ea1d7(0x333);let _0x46d172;if(_0xea0dc0['createdAt']&&_0xea0dc0['finishedAt']){const _0x298ec8=new Date(_0xea0dc0[_0x4ea1d7(0x2a0)])[_0x4ea1d7(0x24e)](),_0x302d47=new Date(_0xea0dc0['finishedAt'])['getTime']();_0x46d172=Math[_0x4ea1d7(0x20c)]((_0x302d47-_0x298ec8)/0x3e8);}const _0x18598f={'attempt_id':_0xea0dc0['id'],'status':_0x4c1fc2,..._0xea0dc0[_0x4ea1d7(0x286)]!==undefined&&{'index':_0xea0dc0[_0x4ea1d7(0x286)]},..._0xea0dc0[_0x4ea1d7(0x225)]&&{'project':_0xea0dc0['project'][_0x4ea1d7(0x313)]},..._0xea0dc0[_0x4ea1d7(0x350)]&&{'workflow':_0xea0dc0[_0x4ea1d7(0x350)][_0x4ea1d7(0x313)]},..._0xea0dc0[_0x4ea1d7(0x280)]&&{'session_id':_0xea0dc0[_0x4ea1d7(0x280)]},..._0xea0dc0[_0x4ea1d7(0x2a3)]&&{'session_time':_0xea0dc0[_0x4ea1d7(0x2a3)]},..._0xea0dc0['retryAttemptName']&&{'retry_attempt':_0xea0dc0['retryAttemptName']},..._0x46d172!==undefined&&{'duration_sec':_0x46d172},..._0xea0dc0['createdAt']&&{'created_at':_0xea0dc0[_0x4ea1d7(0x2a0)]},..._0xea0dc0[_0x4ea1d7(0x371)]&&{'finished_at':_0xea0dc0[_0x4ea1d7(0x371)]},...Object[_0x4ea1d7(0x217)](_0xea0dc0[_0x4ea1d7(0x376)])[_0x4ea1d7(0x214)]>0x0&&{'params':_0xea0dc0[_0x4ea1d7(0x376)]}};return await handleSingleObjectOutput(_0x18598f,_0x9d2c08),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a42_0x548fe7(0x313)]=a42_0x548fe7(0x2ca);['description']=a42_0x548fe7(0x2d0);async[a42_0x548fe7(0x262)](_0xa707e7){const _0x3755f4=a42_0x548fe7,{options:_0x5bb324,args:_0x1f5570,tdx:_0x429902}=_0xa707e7,_0x592ae2=_0x1f5570[0x0];if(!_0x592ae2)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x2d1a4c=_0x5bb324['includeSubtasks'];_0x5bb324['verbose']&&(console['error'](_0x3755f4(0x37e)+_0x592ae2),_0x2d1a4c&&console[_0x3755f4(0x333)](_0x3755f4(0x218)));const _0x25b2bd=await withSpinner(_0x3755f4(0x26c),()=>_0x429902[_0x3755f4(0x350)][_0x3755f4(0x2ab)](_0x592ae2,_0x2d1a4c||![]),{'verbose':_0x5bb324[_0x3755f4(0x21a)]}),_0x1e1030=_0x25b2bd['data'];return console[_0x3755f4(0x333)](_0x3755f4(0x2f8)+_0x1e1030[_0x3755f4(0x214)]+_0x3755f4(0x203)+(_0x1e1030[_0x3755f4(0x214)]!==0x1?'s':'')),await handleSDKOutput(_0x1e1030,_0x5bb324),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']='workflow:logs';[a42_0x548fe7(0x2da)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a42_0x548fe7(0x262)](_0x509324){const _0x4b8937=a42_0x548fe7,{options:_0x395f67,args:_0x3d9796,tdx:_0x292ff8}=_0x509324,_0x2f1a36=_0x3d9796[0x0];let _0x5b4474=_0x3d9796[0x1];if(!_0x2f1a36)return console['error'](_0x4b8937(0x2e7)),0x1;_0x395f67[_0x4b8937(0x21a)]&&(console[_0x4b8937(0x333)](_0x4b8937(0x37e)+_0x2f1a36),_0x5b4474&&console[_0x4b8937(0x333)](_0x4b8937(0x386)+_0x5b4474));const _0x1aad2d=await withSpinner(_0x4b8937(0x344),()=>_0x292ff8['workflow'][_0x4b8937(0x2f7)](_0x2f1a36,_0x5b4474),{'verbose':_0x395f67[_0x4b8937(0x21a)]}),_0x7da375=_0x1aad2d[_0x4b8937(0x252)];if(_0x7da375[_0x4b8937(0x214)]===0x0)return console['error'](_0x4b8937(0x204)),0x0;if(!_0x5b4474&&(_0x395f67[_0x4b8937(0x230)]||_0x395f67['format']))return await handleSDKOutput(_0x7da375,_0x395f67),0x0;if(!_0x5b4474){const _0x597fb7=_0x7da375[_0x4b8937(0x394)](_0x58b038=>({'title':_0x58b038[_0x4b8937(0x23b)]+'\x20('+formatBytes(_0x58b038[_0x4b8937(0x2db)])+')','value':_0x58b038[_0x4b8937(0x23b)]})),_0x265e1d=await a42_0x2a4a52({'type':'select','name':_0x4b8937(0x396),'message':_0x4b8937(0x38d),'choices':_0x597fb7});if(!_0x265e1d['task'])return console[_0x4b8937(0x333)](_0x4b8937(0x264)),0x0;_0x5b4474=_0x265e1d[_0x4b8937(0x396)];}const _0x57accf=await withSpinner(_0x4b8937(0x2ff),()=>_0x292ff8[_0x4b8937(0x350)]['logs'](_0x2f1a36,_0x5b4474),{'verbose':_0x395f67[_0x4b8937(0x21a)]}),_0x1762ae=_0x57accf[_0x4b8937(0x252)];return _0x1762ae?console[_0x4b8937(0x373)](_0x1762ae):console[_0x4b8937(0x333)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a42_0x548fe7(0x313)]=a42_0x548fe7(0x28f);['description']='Kill\x20a\x20running\x20attempt';async[a42_0x548fe7(0x262)](_0xbf6e64){const _0x25e1d8=a42_0x548fe7,{options:_0x2169dd,args:_0x1fbc41,tdx:_0x572790}=_0xbf6e64,_0x2227ea=_0x1fbc41[0x0];if(!_0x2227ea)return console['error'](_0x25e1d8(0x2e7)),0x1;const _0x404bc8=_0x2169dd[_0x25e1d8(0x2b8)];_0x2169dd['verbose']&&(console[_0x25e1d8(0x333)](_0x25e1d8(0x37e)+_0x2227ea),_0x404bc8&&console['error'](_0x25e1d8(0x28c)+_0x404bc8));if(!_0x2169dd[_0x25e1d8(0x305)]){if(!isInteractive())return console[_0x25e1d8(0x333)](a42_0x5737de[_0x25e1d8(0x2e2)]('\x0aError:'),_0x25e1d8(0x366)),console['error'](a42_0x5737de[_0x25e1d8(0x2d2)](_0x25e1d8(0x393))),0x1;const _0x292238=await confirmKey(_0x25e1d8(0x336)+_0x2227ea+'?');if(!_0x292238)return console['error'](a42_0x5737de[_0x25e1d8(0x314)](_0x25e1d8(0x264))),0x1;}const _0x49393b=await withSpinner(_0x25e1d8(0x2d4),()=>_0x572790[_0x25e1d8(0x350)][_0x25e1d8(0x2f1)](_0x2227ea,_0x404bc8),{'verbose':_0x2169dd['verbose']}),_0x569ee3=_0x49393b['data'];return console['error']('✔\x20'+_0x569ee3),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a42_0x548fe7(0x20e);[a42_0x548fe7(0x2da)]='Retry\x20a\x20session\x20or\x20attempt';async[a42_0x548fe7(0x262)](_0xc0c708){const _0x504a97=a42_0x548fe7,{options:_0x467d3f,args:_0x1a889f,tdx:_0x10d19f}=_0xc0c708,_0x41b30e=_0x1a889f[0x0];if(!_0x41b30e)return console[_0x504a97(0x333)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x504a97(0x333)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x21b1db=![],_0x5649a0=_0x41b30e;if(_0x41b30e[_0x504a97(0x220)](_0x504a97(0x244)))_0x21b1db=!![],_0x5649a0=_0x41b30e[_0x504a97(0x2c0)](0x8);else{if(_0x41b30e['startsWith']('attempt:'))_0x21b1db=![],_0x5649a0=_0x41b30e['substring'](0x8);else return console[_0x504a97(0x333)](_0x504a97(0x235)),console['error']('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x5c743c=_0x467d3f['fromTask'],_0x5db078=_0x467d3f[_0x504a97(0x2a4)],_0x4a81c2=_0x467d3f[_0x504a97(0x376)],_0x5f0215=_0x467d3f[_0x504a97(0x227)];_0x467d3f[_0x504a97(0x21a)]&&(console['error'](_0x504a97(0x37c)+(_0x21b1db?_0x504a97(0x302):_0x504a97(0x34e))+'\x20'+_0x5649a0),_0x5c743c&&console[_0x504a97(0x333)](_0x504a97(0x1ef)+_0x5c743c),_0x5db078&&console['error'](_0x504a97(0x318)+_0x5db078),_0x4a81c2&&console[_0x504a97(0x333)](_0x504a97(0x233)+_0x4a81c2),_0x5f0215&&console[_0x504a97(0x333)](_0x504a97(0x30d)));let _0x29fef1;if(_0x4a81c2)try{if(_0x4a81c2[_0x504a97(0x220)]('@')){const _0x4f2436=await import(_0x504a97(0x27f)),_0x5ced2f=_0x4a81c2[_0x504a97(0x2c0)](0x1),_0x2e3d56=await _0x4f2436[_0x504a97(0x378)](_0x5ced2f,_0x504a97(0x25d));_0x29fef1=JSON[_0x504a97(0x247)](_0x2e3d56);}else _0x29fef1=JSON['parse'](_0x4a81c2);}catch{return console['error'](_0x504a97(0x2bc)),0x1;}if(!_0x467d3f[_0x504a97(0x305)]){if(!isInteractive())return console[_0x504a97(0x333)](a42_0x5737de[_0x504a97(0x2e2)](_0x504a97(0x2d9)),_0x504a97(0x366)),console[_0x504a97(0x333)](a42_0x5737de['dim'](_0x504a97(0x393))),0x1;const _0x54d330=await confirmKey(_0x504a97(0x310)+(_0x21b1db?_0x504a97(0x302):'attempt')+'\x20'+_0x5649a0+'?');if(!_0x54d330)return console['error'](a42_0x5737de[_0x504a97(0x314)](_0x504a97(0x264))),0x1;}let _0x27ed22;_0x21b1db?_0x27ed22=await withSpinner(_0x504a97(0x1fd),()=>_0x10d19f[_0x504a97(0x350)][_0x504a97(0x25f)](_0x5649a0,{'fromTask':_0x5c743c,'retryParams':_0x29fef1}),{'verbose':_0x467d3f['verbose']}):_0x27ed22=await withSpinner(_0x504a97(0x1ff),()=>_0x10d19f[_0x504a97(0x350)][_0x504a97(0x338)](_0x5649a0,{'resumeFrom':_0x5db078,'retryParams':_0x29fef1,'force':_0x5f0215}),{'verbose':_0x467d3f[_0x504a97(0x21a)]});const _0x24e6ce=_0x27ed22['data'];return console['error'](_0x504a97(0x30a)),console['error'](_0x504a97(0x329)+_0x24e6ce[_0x504a97(0x269)]),console[_0x504a97(0x333)]('\x20\x20Session\x20ID:\x20'+_0x24e6ce['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a42_0x548fe7(0x313)]='workflow:run';[a42_0x548fe7(0x2da)]=a42_0x548fe7(0x24a);async['execute'](_0x4b49c2){const _0x323071=a42_0x548fe7,{options:_0x149786,args:_0x116863,tdx:_0x3deabf}=_0x4b49c2;let _0x5b0777=_0x116863[0x0];if(!_0x5b0777){const _0x6071e7=this[_0x323071(0x270)]([],_0x149786),_0x5b3275=await withSpinner(_0x323071(0x276),()=>_0x3deabf[_0x323071(0x350)][_0x323071(0x316)](_0x6071e7,{'limit':_0x149786[_0x323071(0x29a)]}),{'verbose':_0x149786[_0x323071(0x21a)]}),_0x12a5f9=_0x5b3275[_0x323071(0x252)];if(_0x12a5f9['length']===0x0)return console[_0x323071(0x333)](_0x323071(0x32b)),!_0x6071e7&&console[_0x323071(0x333)](a42_0x5737de[_0x323071(0x2d2)](_0x323071(0x34a))),0x1;const _0x5655a4=_0x12a5f9[_0x323071(0x394)](_0xc70a0a=>({'title':_0xc70a0a[_0x323071(0x225)]?.[_0x323071(0x313)]+'.'+_0xc70a0a[_0x323071(0x313)],'value':_0xc70a0a[_0x323071(0x225)]?.[_0x323071(0x313)]+'.'+_0xc70a0a[_0x323071(0x313)],'description':_0xc70a0a['revision']?'revision:\x20'+_0xc70a0a['revision']:undefined})),_0x5285f8=await a42_0x2a4a52({'type':_0x323071(0x285),'name':_0x323071(0x350),'message':_0x323071(0x389),'choices':_0x5655a4});if(!_0x5285f8['workflow'])return 0x1;_0x5b0777=_0x5285f8[_0x323071(0x350)];}if(!_0x5b0777[_0x323071(0x259)]('.')){const _0x41bc4a=this[_0x323071(0x270)]([],_0x149786);if(_0x41bc4a)_0x5b0777=_0x41bc4a+'.'+_0x5b0777;else return console[_0x323071(0x333)](a42_0x5737de[_0x323071(0x2e2)](_0x323071(0x27d)),_0x323071(0x1eb)),console[_0x323071(0x333)](a42_0x5737de[_0x323071(0x2d2)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x1c9374=_0x149786['param'],_0x13b589=_0x149786[_0x323071(0x2a3)],_0x2f44ad={};if(_0x1c9374&&Array[_0x323071(0x240)](_0x1c9374))for(const _0x299fbd of _0x1c9374){const _0x9b833f=_0x299fbd[_0x323071(0x2d3)]('=');if(_0x9b833f===-0x1)return console[_0x323071(0x333)](_0x323071(0x2d1)+_0x299fbd),console[_0x323071(0x333)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x6b515b=_0x299fbd[_0x323071(0x2c0)](0x0,_0x9b833f),_0x172789=_0x299fbd['substring'](_0x9b833f+0x1);try{_0x2f44ad[_0x6b515b]=JSON[_0x323071(0x247)](_0x172789);}catch{_0x2f44ad[_0x6b515b]=_0x172789;}}_0x149786['verbose']&&(console[_0x323071(0x333)]('Workflow:\x20'+_0x5b0777),Object[_0x323071(0x217)](_0x2f44ad)[_0x323071(0x214)]>0x0&&console[_0x323071(0x333)](_0x323071(0x292)+JSON[_0x323071(0x200)](_0x2f44ad)),_0x13b589&&console['error'](_0x323071(0x253)+_0x13b589));const _0x160d52=await withSpinner('Starting\x20workflow\x20run...',()=>_0x3deabf[_0x323071(0x350)][_0x323071(0x2c5)](_0x5b0777,_0x2f44ad,{'sessionTime':_0x13b589}),{'verbose':_0x149786[_0x323071(0x21a)]}),_0x5dd7a4=_0x160d52[_0x323071(0x252)];console[_0x323071(0x333)](_0x323071(0x1fe)),console['error'](_0x323071(0x27e)+_0x5dd7a4['id']),console['error'](_0x323071(0x248)+_0x5dd7a4[_0x323071(0x280)]),console[_0x323071(0x333)](_0x323071(0x347)+_0x5dd7a4[_0x323071(0x225)]?.[_0x323071(0x313)]),console['error'](_0x323071(0x379)+_0x5dd7a4[_0x323071(0x350)]?.['name']);if(_0x5dd7a4[_0x323071(0x225)]?.['id']&&_0x5dd7a4[_0x323071(0x280)]&&_0x5dd7a4['id']){const _0x2d3ee1=_0x149786[_0x323071(0x306)],_0x2a4b31=getConsoleUrl(_0x2d3ee1,'/app/workflows/'+_0x5dd7a4[_0x323071(0x225)]['id']+_0x323071(0x1ec)+_0x5dd7a4[_0x323071(0x280)]+_0x323071(0x2f4)+_0x5dd7a4['id']);console[_0x323071(0x333)](_0x323071(0x20b)+a42_0x5737de[_0x323071(0x334)](_0x2a4b31));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a42_0x548fe7(0x313)]=a42_0x548fe7(0x381);[a42_0x548fe7(0x2da)]=a42_0x548fe7(0x2df);async[a42_0x548fe7(0x262)](_0x10c02f){const _0x5e7a95=a42_0x548fe7,{options:_0x55d913,args:_0x4dc8a5,tdx:_0x1e283d}=_0x10c02f,_0x11cf44=_0x4dc8a5[0x0],_0xefb325=_0x4dc8a5[0x1]||'.';if(!_0x11cf44)return console[_0x5e7a95(0x333)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x5e7a95(0x333)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0xff608f=_0x55d913['revision'];_0x55d913[_0x5e7a95(0x21a)]&&(console['error'](_0x5e7a95(0x2ae)+_0x11cf44),console['error'](_0x5e7a95(0x2e3)+_0xefb325),_0xff608f&&console['error']('Revision:\x20'+_0xff608f));const _0xf5d71f=await withSpinner('Downloading\x20project\x20'+_0x11cf44+_0x5e7a95(0x207),()=>_0x1e283d[_0x5e7a95(0x350)][_0x5e7a95(0x26b)](_0x11cf44,_0xefb325,{'revision':_0xff608f}),{'verbose':_0x55d913[_0x5e7a95(0x21a)]}),_0x36f308=_0xf5d71f[_0x5e7a95(0x252)];return console[_0x5e7a95(0x333)]('✔\x20Downloaded\x20'+_0x36f308[_0x5e7a95(0x26f)]),console[_0x5e7a95(0x333)](_0x5e7a95(0x31d)+_0x36f308[_0x5e7a95(0x2ec)]),console[_0x5e7a95(0x333)]('\x20\x20Files\x20extracted:\x20'+_0x36f308[_0x5e7a95(0x308)]),console[_0x5e7a95(0x333)](_0x5e7a95(0x1f2)+_0xefb325+'/'+_0x36f308[_0x5e7a95(0x26f)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a42_0x548fe7(0x313)]='workflow:upload';[a42_0x548fe7(0x2da)]=a42_0x548fe7(0x246);async[a42_0x548fe7(0x262)](_0x1f5a09){const _0x20d665=a42_0x548fe7,{options:_0x31c480,args:_0x2379c9,tdx:_0x3a981d}=_0x1f5a09;let _0x53afe6='.',_0x1b4fbc=_0x31c480['name'];if(_0x2379c9[0x0]){const {promises:_0x456755}=await import('fs');try{const _0x499718=await _0x456755['stat'](_0x2379c9[0x0]);if(_0x499718['isDirectory']())_0x53afe6=_0x2379c9[0x0];else return console['error'](_0x20d665(0x2eb)+_0x2379c9[0x0]+_0x20d665(0x21e)),0x1;}catch{_0x1b4fbc=_0x2379c9[0x0],_0x53afe6='.';}}const _0x1c0fc3=_0x31c480[_0x20d665(0x2ec)],_0x2e6b67=_0x31c480[_0x20d665(0x33c)];_0x31c480[_0x20d665(0x21a)]&&(console[_0x20d665(0x333)]('Project\x20directory:\x20'+_0x53afe6),_0x1b4fbc&&console[_0x20d665(0x333)](_0x20d665(0x274)+_0x1b4fbc),_0x1c0fc3&&console[_0x20d665(0x333)](_0x20d665(0x271)+_0x1c0fc3),_0x2e6b67&&console[_0x20d665(0x333)](_0x20d665(0x228)));const _0x39ebec=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x3a981d[_0x20d665(0x350)][_0x20d665(0x382)](_0x53afe6,{'projectName':_0x1b4fbc,'revision':_0x1c0fc3,'skipValidation':_0x2e6b67}),{'verbose':_0x31c480[_0x20d665(0x21a)]}),_0x25d60d=_0x39ebec[_0x20d665(0x252)];return console[_0x20d665(0x333)](_0x20d665(0x202)+_0x25d60d[_0x20d665(0x26f)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x25d60d['projectId']),console[_0x20d665(0x333)](_0x20d665(0x31d)+_0x25d60d[_0x20d665(0x2ec)]),await this[_0x20d665(0x245)](_0x3a981d,_0x25d60d[_0x20d665(0x26f)],_0x31c480[_0x20d665(0x306)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a42_0x548fe7(0x313)]='workflow:pull';[a42_0x548fe7(0x2da)]=a42_0x548fe7(0x2cf);async['execute'](_0xeb6f60){const _0x1985ca=a42_0x548fe7,{options:_0x484cfa,args:_0x1fd5c8,tdx:_0x35c5a9}=_0xeb6f60,_0x5b43bf=_0x1fd5c8[0x0],_0x4edb5c=_0x1fd5c8[0x1];if(!_0x5b43bf)return console['error'](a42_0x5737de['red'](_0x1985ca(0x27d)),_0x1985ca(0x296)),console[_0x1985ca(0x333)](a42_0x5737de[_0x1985ca(0x2d2)](_0x1985ca(0x38c))),0x1;const _0x40824c=_0x484cfa[_0x1985ca(0x2ec)];_0x484cfa[_0x1985ca(0x21a)]&&(console[_0x1985ca(0x333)](_0x1985ca(0x2ae)+_0x5b43bf),_0x4edb5c&&console[_0x1985ca(0x333)]('Target\x20directory:\x20'+_0x4edb5c),_0x40824c&&console[_0x1985ca(0x333)](_0x1985ca(0x271)+_0x40824c),_0x484cfa['dryRun']&&console['error'](_0x1985ca(0x237)));const _0x4fde35=await withSpinner('Pulling\x20project\x20'+_0x5b43bf+'...',()=>_0x35c5a9[_0x1985ca(0x350)][_0x1985ca(0x335)](_0x5b43bf,{'targetDir':_0x4edb5c,'revision':_0x40824c}),{'verbose':_0x484cfa[_0x1985ca(0x21a)]}),_0x512883=_0x4fde35[_0x1985ca(0x252)];_0x512883[_0x1985ca(0x31e)]?console[_0x1985ca(0x333)](_0x1985ca(0x21d)+_0x512883[_0x1985ca(0x26f)]):console['error'](_0x1985ca(0x2bd)+_0x512883[_0x1985ca(0x26f)]);console['error'](_0x1985ca(0x31d)+_0x512883[_0x1985ca(0x2ec)]),console[_0x1985ca(0x333)](_0x1985ca(0x288)+(a42_0x32a3eb['relative'](process[_0x1985ca(0x201)](),_0x512883[_0x1985ca(0x397)])||'.')),console[_0x1985ca(0x333)]('\x20\x20Changes:\x20'+a42_0x5737de[_0x1985ca(0x362)]('+'+_0x512883['summary']['new']+_0x1985ca(0x20f))+',\x20'+(a42_0x5737de[_0x1985ca(0x314)]('~'+_0x512883['summary']['modified']+_0x1985ca(0x27b))+',\x20')+(a42_0x5737de[_0x1985ca(0x2e2)]('-'+_0x512883['summary'][_0x1985ca(0x395)]+'\x20deleted')+',\x20')+(''+a42_0x5737de[_0x1985ca(0x2d2)](_0x512883['summary'][_0x1985ca(0x2c4)]+_0x1985ca(0x349))));for(const _0x58c82e of _0x512883['changes']){_0x58c82e[_0x1985ca(0x36b)]===_0x1985ca(0x337)&&_0x58c82e[_0x1985ca(0x272)]&&(console[_0x1985ca(0x333)]('\x0a'+a42_0x5737de[_0x1985ca(0x334)](_0x1985ca(0x29b)+_0x58c82e[_0x1985ca(0x340)])),console[_0x1985ca(0x333)](_0x58c82e['diff']));}if(!_0x512883[_0x1985ca(0x23c)])return saveSessionContext({'workflow_project':_0x512883['projectName']},_0x484cfa[_0x1985ca(0x302)]),console[_0x1985ca(0x333)](a42_0x5737de[_0x1985ca(0x362)]('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x1985ca(0x333)](a42_0x5737de[_0x1985ca(0x2d2)](_0x1985ca(0x298)+_0x512883['projectName'])),0x0;if(_0x484cfa[_0x1985ca(0x374)])return console[_0x1985ca(0x333)](a42_0x5737de[_0x1985ca(0x314)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x484cfa[_0x1985ca(0x305)]){if(!isInteractive())return console[_0x1985ca(0x333)](a42_0x5737de[_0x1985ca(0x2e2)](_0x1985ca(0x2d9)),_0x1985ca(0x366)),console[_0x1985ca(0x333)](a42_0x5737de[_0x1985ca(0x2d2)](_0x1985ca(0x393))),0x1;const _0x7d079b=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x7d079b)return console[_0x1985ca(0x333)](a42_0x5737de[_0x1985ca(0x314)]('Cancelled'),_0x1985ca(0x36c)),0x1;}await withSpinner('Writing\x20files...',()=>_0x35c5a9[_0x1985ca(0x350)][_0x1985ca(0x2c1)](_0x512883,{'revision':_0x40824c}),{'verbose':_0x484cfa[_0x1985ca(0x21a)]}),saveSessionContext({'workflow_project':_0x512883[_0x1985ca(0x26f)]},_0x484cfa[_0x1985ca(0x302)]),console['error'](a42_0x5737de['green'](_0x1985ca(0x25b)));const _0x5f2d8a=a42_0x32a3eb[_0x1985ca(0x2a5)](process['cwd'](),_0x512883[_0x1985ca(0x397)])||'.';return console[_0x1985ca(0x333)](a42_0x5737de[_0x1985ca(0x2d2)](_0x1985ca(0x1f2)+_0x5f2d8a)),console[_0x1985ca(0x333)](a42_0x5737de[_0x1985ca(0x2d2)](_0x1985ca(0x298)+_0x512883[_0x1985ca(0x26f)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']='workflow:push';['description']=a42_0x548fe7(0x291);async[a42_0x548fe7(0x262)](_0x471c83){const _0x4f81db=a42_0x548fe7,{options:_0x1ddae4,args:_0x4eaa4c,tdx:_0x4e3119}=_0x471c83,_0x1a2fae=this[_0x4f81db(0x30c)](_0x4eaa4c,_0x1ddae4),_0x10464e=_0x1ddae4[_0x4f81db(0x2ec)],_0x2a6d60=_0x1ddae4[_0x4f81db(0x33c)];_0x1ddae4[_0x4f81db(0x21a)]&&(_0x1a2fae&&console[_0x4f81db(0x333)](_0x4f81db(0x2ba)+_0x1a2fae),_0x10464e&&console[_0x4f81db(0x333)]('Revision:\x20'+_0x10464e),_0x1ddae4[_0x4f81db(0x374)]&&console['error'](_0x4f81db(0x237)),_0x2a6d60&&console[_0x4f81db(0x333)](_0x4f81db(0x228)));let _0x34195c;try{_0x34195c=await withSpinner(_0x4f81db(0x211),()=>_0x4e3119[_0x4f81db(0x350)][_0x4f81db(0x341)]({'sourceDir':_0x1a2fae,'revision':_0x10464e,'skipValidation':_0x2a6d60}),{'verbose':_0x1ddae4['verbose']});}catch(_0x483ed7){if(_0x483ed7 instanceof Error&&_0x483ed7['message']['includes']('No\x20workflow\x20tdx.json\x20found'))return console['error'](a42_0x5737de[_0x4f81db(0x2e2)](_0x4f81db(0x27d)),_0x4f81db(0x28b)),_0x1ddae4[_0x4f81db(0x2ea)]?console[_0x4f81db(0x333)](a42_0x5737de[_0x4f81db(0x2d2)](_0x4f81db(0x35c)+_0x1ddae4['workflowProject']+_0x4f81db(0x29e)+_0x1ddae4[_0x4f81db(0x2ea)]+'\x27')):console[_0x4f81db(0x333)](a42_0x5737de[_0x4f81db(0x2d2)](_0x4f81db(0x1e9))),0x1;throw _0x483ed7;}const _0x237aa8=_0x34195c[_0x4f81db(0x252)];console[_0x4f81db(0x333)]('✔\x20Project:\x20'+_0x237aa8[_0x4f81db(0x26f)]),console['error'](_0x4f81db(0x219)+_0x237aa8['sourceDir']),console[_0x4f81db(0x333)](_0x4f81db(0x31d)+_0x237aa8[_0x4f81db(0x2ec)]),console[_0x4f81db(0x333)](_0x4f81db(0x254)+a42_0x5737de['green']('+'+_0x237aa8[_0x4f81db(0x301)][_0x4f81db(0x289)]+'\x20new')+',\x20'+(a42_0x5737de['yellow']('~'+_0x237aa8[_0x4f81db(0x301)]['modified']+_0x4f81db(0x27b))+',\x20')+(a42_0x5737de['red']('-'+_0x237aa8[_0x4f81db(0x301)][_0x4f81db(0x395)]+_0x4f81db(0x33d))+',\x20')+(''+a42_0x5737de[_0x4f81db(0x2d2)](_0x237aa8[_0x4f81db(0x301)][_0x4f81db(0x2c4)]+_0x4f81db(0x349))));for(const _0x386af2 of _0x237aa8[_0x4f81db(0x348)]){_0x386af2[_0x4f81db(0x36b)]===_0x4f81db(0x337)&&_0x386af2[_0x4f81db(0x272)]&&(console[_0x4f81db(0x333)]('\x0a'+a42_0x5737de['cyan'](_0x4f81db(0x29b)+_0x386af2[_0x4f81db(0x340)])),console[_0x4f81db(0x333)](_0x386af2[_0x4f81db(0x272)]));}if(!_0x237aa8[_0x4f81db(0x23c)])return console[_0x4f81db(0x333)](a42_0x5737de[_0x4f81db(0x362)](_0x4f81db(0x375))),await this[_0x4f81db(0x245)](_0x4e3119,_0x237aa8['projectName'],_0x1ddae4['site']),0x0;if(_0x1ddae4[_0x4f81db(0x374)])return console['error'](a42_0x5737de['yellow'](_0x4f81db(0x324))),0x0;if(!_0x1ddae4[_0x4f81db(0x305)]){if(!isInteractive())return console[_0x4f81db(0x333)](a42_0x5737de[_0x4f81db(0x2e2)](_0x4f81db(0x2d9)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4f81db(0x333)](a42_0x5737de[_0x4f81db(0x2d2)](_0x4f81db(0x393))),0x1;const _0x2cae97=await confirmKey(_0x4f81db(0x256));if(!_0x2cae97)return console[_0x4f81db(0x333)](a42_0x5737de[_0x4f81db(0x314)](_0x4f81db(0x264)),_0x4f81db(0x32f)),0x1;}const _0x3804f3=await withSpinner('Pushing\x20project...',()=>_0x4e3119[_0x4f81db(0x350)][_0x4f81db(0x372)](_0x237aa8),{'verbose':_0x1ddae4[_0x4f81db(0x21a)]}),_0x48664f=_0x3804f3['data'];return console[_0x4f81db(0x333)](a42_0x5737de[_0x4f81db(0x362)](_0x4f81db(0x327))),console['error'](_0x4f81db(0x37b)+_0x48664f['projectId']),console['error'](_0x4f81db(0x31d)+_0x48664f[_0x4f81db(0x2ec)]),await this['showWorkflowConsoleUrl'](_0x4e3119,_0x48664f[_0x4f81db(0x26f)],_0x1ddae4['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a42_0x548fe7(0x313)]=a42_0x548fe7(0x1f9);[a42_0x548fe7(0x2da)]=a42_0x548fe7(0x267);async[a42_0x548fe7(0x262)](_0x4ee035){const _0xbd4dc6=a42_0x548fe7,{options:_0x3caac2,args:_0x6a4696,tdx:_0x4e5aea}=_0x4ee035,_0x11238b=this[_0xbd4dc6(0x30c)](_0x6a4696,_0x3caac2),_0x4d1915=_0x3caac2['name'],_0x46de18=_0x3caac2[_0xbd4dc6(0x2ec)],_0x1bdb11=_0x3caac2[_0xbd4dc6(0x33c)];if(!_0x11238b)return console['error'](a42_0x5737de[_0xbd4dc6(0x2e2)](_0xbd4dc6(0x27d)),_0xbd4dc6(0x360)),console[_0xbd4dc6(0x333)](a42_0x5737de[_0xbd4dc6(0x2d2)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console['error'](a42_0x5737de[_0xbd4dc6(0x2d2)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x4d1915)return console[_0xbd4dc6(0x333)](a42_0x5737de['red'](_0xbd4dc6(0x27d)),_0xbd4dc6(0x383)),console['error'](a42_0x5737de[_0xbd4dc6(0x2d2)](_0xbd4dc6(0x28e))),0x1;_0x3caac2[_0xbd4dc6(0x21a)]&&(console['error'](_0xbd4dc6(0x2ba)+_0x11238b),console[_0xbd4dc6(0x333)]('New\x20project\x20name:\x20'+_0x4d1915),_0x46de18&&console['error'](_0xbd4dc6(0x271)+_0x46de18),_0x3caac2['dryRun']&&console[_0xbd4dc6(0x333)](_0xbd4dc6(0x237)),_0x1bdb11&&console[_0xbd4dc6(0x333)](_0xbd4dc6(0x228)));const _0x3753d6=await withSpinner('Analyzing\x20project...',()=>_0x4e5aea[_0xbd4dc6(0x350)][_0xbd4dc6(0x2bb)](_0x11238b,_0x4d1915,{'revision':_0x46de18,'skipValidation':_0x1bdb11}),{'verbose':_0x3caac2[_0xbd4dc6(0x21a)]}),_0xa6b0c0=_0x3753d6[_0xbd4dc6(0x252)];console[_0xbd4dc6(0x333)](_0xbd4dc6(0x1f1)+_0xa6b0c0[_0xbd4dc6(0x279)]);_0xa6b0c0['sourceProjectName']&&console[_0xbd4dc6(0x333)](_0xbd4dc6(0x2cd)+_0xa6b0c0[_0xbd4dc6(0x35a)]);console[_0xbd4dc6(0x333)](_0xbd4dc6(0x363)+_0xa6b0c0[_0xbd4dc6(0x208)]),console[_0xbd4dc6(0x333)](_0xbd4dc6(0x271)+_0xa6b0c0[_0xbd4dc6(0x2ec)]),console['error'](_0xbd4dc6(0x319)+_0xa6b0c0[_0xbd4dc6(0x1f8)]);_0xa6b0c0[_0xbd4dc6(0x1f0)]&&(console[_0xbd4dc6(0x333)](a42_0x5737de[_0xbd4dc6(0x314)](_0xbd4dc6(0x2ad)+_0xa6b0c0[_0xbd4dc6(0x208)]+_0xbd4dc6(0x32d)+_0xa6b0c0['existingProjectId']+')')),console[_0xbd4dc6(0x333)](a42_0x5737de[_0xbd4dc6(0x314)](_0xbd4dc6(0x224))));if(_0x3caac2['dryRun'])return console['error'](a42_0x5737de[_0xbd4dc6(0x314)]('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x3caac2[_0xbd4dc6(0x305)]){if(!isInteractive())return console['error'](a42_0x5737de[_0xbd4dc6(0x2e2)](_0xbd4dc6(0x2d9)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xbd4dc6(0x333)](a42_0x5737de[_0xbd4dc6(0x2d2)](_0xbd4dc6(0x393))),0x1;const _0x137f7b=_0xa6b0c0[_0xbd4dc6(0x35a)]||a42_0x32a3eb[_0xbd4dc6(0x1fc)](_0x11238b),_0x4f2101=_0xa6b0c0[_0xbd4dc6(0x1f0)]?_0xbd4dc6(0x26a)+_0x4d1915+'\x22\x20with\x20new\x20revision?':'\x0aClone\x20\x22'+_0x137f7b+_0xbd4dc6(0x352)+_0x4d1915+'\x22?',_0x23d380=await confirmKey(_0x4f2101);if(!_0x23d380)return console['error'](a42_0x5737de['yellow'](_0xbd4dc6(0x264))),0x1;}const _0x20e39a=await withSpinner(_0xa6b0c0[_0xbd4dc6(0x1f0)]?_0xbd4dc6(0x260)+_0x4d1915+_0xbd4dc6(0x207):_0xbd4dc6(0x358)+_0x4d1915+_0xbd4dc6(0x207),()=>_0x4e5aea[_0xbd4dc6(0x350)][_0xbd4dc6(0x35f)](_0xa6b0c0),{'verbose':_0x3caac2[_0xbd4dc6(0x21a)]}),_0x1c99f4=_0x20e39a['data'];return console[_0xbd4dc6(0x333)](a42_0x5737de[_0xbd4dc6(0x362)](_0xa6b0c0[_0xbd4dc6(0x1f0)]?_0xbd4dc6(0x2ee):_0xbd4dc6(0x1fa))),console[_0xbd4dc6(0x333)](_0xbd4dc6(0x347)+_0x1c99f4['newProjectName']),console[_0xbd4dc6(0x333)](_0xbd4dc6(0x37b)+_0x1c99f4[_0xbd4dc6(0x2f3)]),console[_0xbd4dc6(0x333)](_0xbd4dc6(0x31d)+_0x1c99f4['revision']),await this['showWorkflowConsoleUrl'](_0x4e5aea,_0x1c99f4[_0xbd4dc6(0x208)],_0x3caac2[_0xbd4dc6(0x306)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a42_0x548fe7(0x313)]='workflow:delete';[a42_0x548fe7(0x2da)]=a42_0x548fe7(0x258);async[a42_0x548fe7(0x262)](_0x45a61d){const _0x3128a2=a42_0x548fe7,{options:_0x50d360,args:_0x496338,tdx:_0x5465a1}=_0x45a61d,_0x3ce076=_0x496338[0x0];if(!_0x3ce076)return console['error']('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x3128a2(0x333)](_0x3128a2(0x2ce)),0x1;_0x50d360[_0x3128a2(0x21a)]&&console[_0x3128a2(0x333)]('Project:\x20'+_0x3ce076);if(!_0x50d360['yes']){if(!isInteractive())return console[_0x3128a2(0x333)](a42_0x5737de[_0x3128a2(0x2e2)](_0x3128a2(0x2d9)),_0x3128a2(0x366)),console[_0x3128a2(0x333)](a42_0x5737de['dim'](_0x3128a2(0x393))),0x1;const _0x35567f=await confirmKey(_0x3128a2(0x342)+_0x3ce076+_0x3128a2(0x351));if(!_0x35567f)return console['error'](a42_0x5737de[_0x3128a2(0x314)](_0x3128a2(0x264))),0x1;}const _0x3db09b=await withSpinner(_0x3128a2(0x21b)+_0x3ce076+_0x3128a2(0x207),()=>_0x5465a1['workflow'][_0x3128a2(0x27c)](_0x3ce076),{'verbose':_0x50d360[_0x3128a2(0x21a)]}),_0x4618d1=_0x3db09b[_0x3128a2(0x252)];return console[_0x3128a2(0x333)](_0x3128a2(0x241)+_0x4618d1[_0x3128a2(0x26f)]),console[_0x3128a2(0x333)](_0x3128a2(0x37b)+_0x4618d1[_0x3128a2(0x2bf)]),0x0;}}export function parseKeyValue(_0x1de4c2){const _0x58152c=a42_0x548fe7,_0x17644a=_0x1de4c2[_0x58152c(0x2d3)]('=');if(_0x17644a===-0x1)throw new Error(_0x58152c(0x2dc)+_0x1de4c2+_0x58152c(0x31f));const _0xe8c54d=_0x1de4c2[_0x58152c(0x2c0)](0x0,_0x17644a),_0x475c53=_0x1de4c2[_0x58152c(0x2c0)](_0x17644a+0x1);if(!_0xe8c54d)throw new Error(_0x58152c(0x23f));return{'key':_0xe8c54d,'value':_0x475c53};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a42_0x548fe7(0x313)]='workflow:secrets:list';['description']='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a42_0x548fe7(0x262)](_0x3ee15e){const _0x43c21a=a42_0x548fe7,{options:_0x4338fb,args:_0x54e150,tdx:_0x2e66dc}=_0x3ee15e,_0x4824b3=this['requireProject'](_0x54e150,_0x4338fb);if(!_0x4824b3)return 0x1;_0x4338fb[_0x43c21a(0x21a)]&&console[_0x43c21a(0x333)]('Project:\x20'+_0x4824b3);const _0x59e49c=await withSpinner(_0x43c21a(0x2fc),()=>_0x2e66dc[_0x43c21a(0x350)][_0x43c21a(0x2c7)](_0x4824b3),{'verbose':_0x4338fb[_0x43c21a(0x21a)]}),{secrets:_0x43b843}=_0x59e49c[_0x43c21a(0x252)];return console[_0x43c21a(0x333)](_0x43c21a(0x2f8)+_0x43b843[_0x43c21a(0x214)]+_0x43c21a(0x251)+(_0x43b843[_0x43c21a(0x214)]!==0x1?'s':'')),await handleSDKOutput(_0x43b843,_0x4338fb),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a42_0x548fe7(0x313)]=a42_0x548fe7(0x268);[a42_0x548fe7(0x2da)]=a42_0x548fe7(0x357);async[a42_0x548fe7(0x262)](_0x5bb3fc){const _0x5342e6=a42_0x548fe7,{options:_0x476180,args:_0x37d7a1,tdx:_0x4bc263}=_0x5bb3fc;let _0xcb5262,_0x32d29f;if(_0x37d7a1['length']>=0x2)_0xcb5262=_0x37d7a1[0x0],_0x32d29f=_0x37d7a1[0x1];else{if(_0x37d7a1[_0x5342e6(0x214)]===0x1&&_0x476180[_0x5342e6(0x2ea)])_0xcb5262=_0x476180[_0x5342e6(0x2ea)],_0x32d29f=_0x37d7a1[0x0];else return _0x37d7a1['length']===0x1?(console['error'](_0x5342e6(0x326)),console[_0x5342e6(0x333)](_0x5342e6(0x34a)),0x1):(console[_0x5342e6(0x333)](_0x5342e6(0x263)),console[_0x5342e6(0x333)](_0x5342e6(0x206)),0x1);}let _0x59995a,_0x20c4b0;try{({key:_0x59995a,value:_0x20c4b0}=parseKeyValue(_0x32d29f));}catch(_0x786910){return _0x786910 instanceof Error&&console[_0x5342e6(0x333)](a42_0x5737de[_0x5342e6(0x2e2)](_0x5342e6(0x27d)),_0x786910[_0x5342e6(0x2aa)]),0x1;}_0x476180[_0x5342e6(0x21a)]&&(console[_0x5342e6(0x333)](_0x5342e6(0x2ae)+_0xcb5262),console[_0x5342e6(0x333)]('Key:\x20'+_0x59995a));const _0x1994e6=await withSpinner(_0x5342e6(0x27a),()=>_0x4bc263[_0x5342e6(0x350)][_0x5342e6(0x321)](_0xcb5262,_0x59995a,_0x20c4b0),{'verbose':_0x476180[_0x5342e6(0x21a)]}),_0x171deb=_0x1994e6[_0x5342e6(0x252)];return console[_0x5342e6(0x333)]('✔\x20Secret\x20\x27'+_0x171deb[_0x5342e6(0x22f)]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x171deb[_0x5342e6(0x26f)]+'\x27'),(_0x476180[_0x5342e6(0x230)]||_0x476180[_0x5342e6(0x2b0)])&&await handleSingleObjectOutput(_0x171deb,_0x476180),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a42_0x548fe7(0x313)]=a42_0x548fe7(0x303);[a42_0x548fe7(0x2da)]=a42_0x548fe7(0x21c);async[a42_0x548fe7(0x262)](_0x3c3078){const _0x1c164f=a42_0x548fe7,{options:_0x367544,args:_0x5f57d6,tdx:_0x3e3e0d}=_0x3c3078;let _0x3f3f35,_0x244a83;if(_0x5f57d6['length']>=0x2)_0x3f3f35=_0x5f57d6[0x0],_0x244a83=_0x5f57d6[0x1];else{if(_0x5f57d6[_0x1c164f(0x214)]===0x1&&_0x367544[_0x1c164f(0x2ea)])_0x3f3f35=_0x367544['workflowProject'],_0x244a83=_0x5f57d6[0x0];else return _0x5f57d6[_0x1c164f(0x214)]===0x1?(console[_0x1c164f(0x333)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x1c164f(0x34a)),0x1):(console['error'](_0x1c164f(0x2b1)),console[_0x1c164f(0x333)](_0x1c164f(0x31c)),0x1);}_0x367544[_0x1c164f(0x21a)]&&(console[_0x1c164f(0x333)](_0x1c164f(0x2ae)+_0x3f3f35),console[_0x1c164f(0x333)](_0x1c164f(0x2dd)+_0x244a83));if(!_0x367544['yes']){if(!isInteractive())return console[_0x1c164f(0x333)](a42_0x5737de[_0x1c164f(0x2e2)]('\x0aError:'),_0x1c164f(0x366)),console[_0x1c164f(0x333)](a42_0x5737de[_0x1c164f(0x2d2)](_0x1c164f(0x393))),0x1;const _0xb5b2f=await confirmKey(_0x1c164f(0x2b7)+_0x244a83+_0x1c164f(0x320)+_0x3f3f35+'\x27?');if(!_0xb5b2f)return console[_0x1c164f(0x333)](a42_0x5737de[_0x1c164f(0x314)](_0x1c164f(0x264))),0x1;}const _0x147ae1=await withSpinner(_0x1c164f(0x242),()=>_0x3e3e0d[_0x1c164f(0x350)][_0x1c164f(0x33a)](_0x3f3f35,_0x244a83),{'verbose':_0x367544[_0x1c164f(0x21a)]}),_0x55d37e=_0x147ae1[_0x1c164f(0x252)];return console[_0x1c164f(0x333)](_0x1c164f(0x32e)+_0x55d37e[_0x1c164f(0x22f)]+_0x1c164f(0x387)+_0x55d37e[_0x1c164f(0x26f)]+'\x27'),(_0x367544[_0x1c164f(0x230)]||_0x367544[_0x1c164f(0x2b0)])&&await handleSingleObjectOutput(_0x55d37e,_0x367544),0x0;}}const TIMELINE_CONFIG={'TASK_NAME_WIDTH':0x28,'ICON_WIDTH':0x2,'ICON_SPACING':0x1,'GUTTER':0x5,'MIN_TIMELINE_WIDTH':0x28,'MAX_TIMELINE_WIDTH':0x50,'LABEL_MIN_SPACING':0x2,'POLL_INTERVAL_MS':0x7d0,'MAX_POLL_TIME_MS':0x36ee80,'MAX_POLL_ITERATIONS':0x708,'MAX_TASKS_DISPLAY':0x64,'MIN_LABEL_COUNT':0x3,'MAX_LABEL_COUNT':0x6,'LABEL_WIDTH_DIVISOR':0xf};function formatElapsed(_0x2e81ce){const _0x274088=a42_0x548fe7,_0x5469a1=Math[_0x274088(0x273)](_0x2e81ce/0x3e8),_0xe9b4c=Math[_0x274088(0x273)](_0x5469a1/0x3c),_0x3ccf30=Math[_0x274088(0x273)](_0xe9b4c/0x3c),_0x3509f4=Math[_0x274088(0x273)](_0x3ccf30/0x18);if(_0x3509f4>0x0){const _0x5ac706=_0x3ccf30%0x18;return _0x5ac706>0x0?_0x3509f4+'d\x20'+_0x5ac706+'h':_0x3509f4+'d';}else{if(_0x3ccf30>0x0){const _0x327baa=_0xe9b4c%0x3c;return _0x327baa>0x0?_0x3ccf30+'h\x20'+_0x327baa+'m':_0x3ccf30+'h';}else{if(_0xe9b4c>0x0){const _0x49b09e=_0x5469a1%0x3c;return _0x49b09e>0x0?_0xe9b4c+'m\x20'+_0x49b09e+'s':_0xe9b4c+'m';}else return _0x5469a1+'s';}}}function formatTimestamp(_0x3148c0,_0x219ab5){const _0x3bf275=a42_0x548fe7,_0x507642=new Date(_0x3148c0),_0x17d99c=String(_0x507642[_0x3bf275(0x278)]())['padStart'](0x2,'0'),_0x113341=String(_0x507642[_0x3bf275(0x330)]())[_0x3bf275(0x2f9)](0x2,'0'),_0x18b2a3=_0x17d99c+':'+_0x113341,_0x34e208=_0x507642[_0x3bf275(0x2a1)]()===_0x219ab5[_0x3bf275(0x2a1)]()&&_0x507642[_0x3bf275(0x2d7)]()===_0x219ab5[_0x3bf275(0x2d7)]()&&_0x507642[_0x3bf275(0x29d)]()===_0x219ab5['getDate']();if(_0x34e208)return _0x18b2a3;else{const _0xd81691=String(_0x507642['getMonth']()+0x1)[_0x3bf275(0x2f9)](0x2,'0'),_0x431201=String(_0x507642[_0x3bf275(0x29d)]())[_0x3bf275(0x2f9)](0x2,'0');return _0xd81691+'-'+_0x431201+'\x20'+_0x18b2a3;}}function formatDate(_0x3eeff9){const _0x5acca8=a42_0x548fe7,_0x3c325e=_0x3eeff9[_0x5acca8(0x2a1)](),_0x56e812=String(_0x3eeff9['getMonth']()+0x1)['padStart'](0x2,'0'),_0x24a483=String(_0x3eeff9[_0x5acca8(0x29d)]())['padStart'](0x2,'0');return _0x3c325e+'-'+_0x56e812+'-'+_0x24a483;}function a42_0x3632(_0x1a6033,_0xcefc7b){_0x1a6033=_0x1a6033-0x1e9;const _0x46c0b0=a42_0x46c0();let _0x3632d4=_0x46c0b0[_0x1a6033];return _0x3632d4;}function getTaskStateIcon(_0x24b671){const _0x41f612={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x41f612[_0x24b671]||'⚪';}function getBarChar(_0x52673d){const _0x2232cf=a42_0x548fe7;return _0x52673d==='error'||_0x52673d===_0x2232cf(0x33e)?'×':'─';}function getBarColor(_0x5b9511){const _0x1511ae=a42_0x548fe7,_0x11ca6d={'success':a42_0x5737de[_0x1511ae(0x362)],'error':a42_0x5737de[_0x1511ae(0x2e2)],'group_error':a42_0x5737de[_0x1511ae(0x2e2)],'running':a42_0x5737de[_0x1511ae(0x2c3)],'blocked':a42_0x5737de[_0x1511ae(0x314)],'planned':a42_0x5737de[_0x1511ae(0x2d2)],'canceling':a42_0x5737de['yellow']};return _0x11ca6d[_0x5b9511]||a42_0x5737de[_0x1511ae(0x22c)];}function parseTaskName(_0x4cac28){const _0x126ea8=a42_0x548fe7;let _0x41ecad=_0x4cac28[_0x126ea8(0x377)](/^\++/,'');const _0x52a84e=_0x41ecad[_0x126ea8(0x266)]('+'),_0x439288=_0x52a84e[_0x126ea8(0x214)]>0x1?_0x52a84e['length']-0x2:0x0,_0x5893c8=_0x52a84e[_0x52a84e[_0x126ea8(0x214)]-0x1]||_0x41ecad;return{'level':_0x439288,'name':'+'+_0x5893c8};}function truncateTaskName(_0x37843b,_0x25047c){const _0x14c5a2=a42_0x548fe7,_0x6f664d=stringWidth(_0x37843b);if(_0x6f664d<=_0x25047c)return _0x37843b;let _0x422199=_0x37843b;while(stringWidth(_0x422199+'…')>_0x25047c&&_0x422199[_0x14c5a2(0x214)]>0x0){_0x422199=_0x422199[_0x14c5a2(0x22b)](0x0,-0x1);}return _0x422199+'…';}function calculateTimeScale(_0x28eb92,_0x4bd1a3){const _0x495040=a42_0x548fe7;return{'startTime':_0x28eb92[_0x495040(0x35e)],'endTime':_0x28eb92['end'],'durationMs':_0x28eb92[_0x495040(0x2fe)],'msPerChar':_0x28eb92[_0x495040(0x2fe)]/_0x4bd1a3};}function timeToPosition(_0x21d6c0,_0x46bc27,_0x1885ca){const _0x4ffd1b=a42_0x548fe7,_0x2d3c64=_0x21d6c0-_0x46bc27[_0x4ffd1b(0x32c)],_0x24aff1=Math[_0x4ffd1b(0x273)](_0x2d3c64/_0x46bc27[_0x4ffd1b(0x2de)]);return Math[_0x4ffd1b(0x36d)](0x0,Math[_0x4ffd1b(0x317)](_0x24aff1,_0x1885ca));}function renderTimeAxis(_0x4112f2,_0x21b01f){const _0x313c2f=a42_0x548fe7,_0x23fc28=Math[_0x313c2f(0x317)](TIMELINE_CONFIG[_0x313c2f(0x25e)],Math[_0x313c2f(0x36d)](TIMELINE_CONFIG[_0x313c2f(0x323)],Math[_0x313c2f(0x273)](_0x21b01f/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x50ebed=_0x4112f2[_0x313c2f(0x2b5)]/(_0x23fc28-0x1),_0x45ea75=new Date(_0x4112f2['startTime']),_0x4f983b=[];for(let _0x2cb93a=0x0;_0x2cb93a<_0x23fc28;_0x2cb93a++){const _0x28104e=_0x4112f2['startTime']+_0x2cb93a*_0x50ebed,_0x3ccdd8=timeToPosition(_0x28104e,_0x4112f2,_0x21b01f),_0xcf146d=formatTimestamp(_0x28104e,_0x45ea75);_0x4f983b[_0x313c2f(0x382)]({'pos':_0x3ccdd8,'text':_0xcf146d});}const _0x1cd6e3=new Array(_0x21b01f)[_0x313c2f(0x26e)]('\x20');let _0x4516ab=-0x1;for(const {pos:_0x17117c,text:_0x28da98}of _0x4f983b){let _0x39534b=Math[_0x313c2f(0x36d)](0x0,_0x17117c-Math[_0x313c2f(0x273)](_0x28da98[_0x313c2f(0x214)]/0x2));_0x39534b<=_0x4516ab+TIMELINE_CONFIG[_0x313c2f(0x284)]&&(_0x39534b=_0x4516ab+TIMELINE_CONFIG[_0x313c2f(0x284)]+0x1);_0x39534b+_0x28da98['length']>_0x21b01f&&(_0x39534b=_0x21b01f-_0x28da98[_0x313c2f(0x214)]);if(_0x39534b>=0x0&&_0x39534b+_0x28da98[_0x313c2f(0x214)]<=_0x21b01f&&_0x39534b>_0x4516ab){for(let _0xe62e8c=0x0;_0xe62e8c<_0x28da98[_0x313c2f(0x214)];_0xe62e8c++){_0x1cd6e3[_0x39534b+_0xe62e8c]=_0x28da98[_0xe62e8c];}_0x4516ab=_0x39534b+_0x28da98[_0x313c2f(0x214)]-0x1;}}return _0x1cd6e3[_0x313c2f(0x24d)]('');}function renderTaskRow(_0xdbd99e,_0x174058,_0xf23900,_0x2b0fd9){const _0x2fbfef=a42_0x548fe7,{level:_0x31676a,name:_0xec952b}=parseTaskName(_0xdbd99e['name']),_0x31b9b3='\x20'[_0x2fbfef(0x265)](_0x31676a),_0x34bd44=_0xdbd99e[_0x2fbfef(0x2c9)]?'('+formatElapsed(_0xdbd99e[_0x2fbfef(0x2c9)][_0x2fbfef(0x2fe)])+')':'',_0x164351=stringWidth(_0x34bd44),_0x55d24f=_0x31676a*0x1,_0x20a7e5=_0x2b0fd9-_0x55d24f-_0x164351-0x1,_0x1e24aa=truncateTaskName(_0xec952b,_0x20a7e5),_0x5dbf2f=_0x31b9b3+_0x1e24aa,_0x59ffe7=stringWidth(_0x5dbf2f),_0x81a1cb=_0x2b0fd9-_0x59ffe7-_0x164351,_0x3c97bb=_0x5dbf2f+'\x20'['repeat'](Math[_0x2fbfef(0x36d)](0x1,_0x81a1cb))+a42_0x5737de[_0x2fbfef(0x2d2)](_0x34bd44),_0x500826=getTaskStateIcon(_0xdbd99e[_0x2fbfef(0x281)]),_0x1f778b=new Array(_0xf23900)[_0x2fbfef(0x26e)]('\x20');if(_0xdbd99e['window']){const _0x1323c1=timeToPosition(_0xdbd99e[_0x2fbfef(0x2c9)][_0x2fbfef(0x35e)],_0x174058,_0xf23900),_0x1301b6=timeToPosition(_0xdbd99e[_0x2fbfef(0x2c9)]['end'],_0x174058,_0xf23900),_0x5be582=getBarChar(_0xdbd99e[_0x2fbfef(0x281)]),_0x415b3c=Math['max'](_0x1323c1+0x1,_0x1301b6);for(let _0x5d543b=_0x1323c1;_0x5d543b<Math[_0x2fbfef(0x317)](_0x415b3c,_0xf23900);_0x5d543b++){_0x1f778b[_0x5d543b]=_0x5be582;}}const _0x6e9b5=getBarColor(_0xdbd99e['state']),_0x5e8476=_0x1f778b[_0x2fbfef(0x394)](_0x2459e9=>_0x2459e9==='\x20'?'\x20':_0x6e9b5(_0x2459e9))['join']('');return _0x500826+'\x20'+_0x3c97bb+'│'+_0x5e8476+'│';}function calculateStats(_0x3cf30a){const _0x422f65=a42_0x548fe7,_0x5b2df8={'total':_0x3cf30a[_0x422f65(0x214)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x5840b2 of _0x3cf30a){if(_0x5840b2[_0x422f65(0x281)]===_0x422f65(0x343))_0x5b2df8[_0x422f65(0x343)]++;else{if(_0x5840b2[_0x422f65(0x281)]===_0x422f65(0x333)||_0x5840b2[_0x422f65(0x281)]===_0x422f65(0x33e))_0x5b2df8['error']++;else _0x5840b2[_0x422f65(0x281)]===_0x422f65(0x28d)?_0x5b2df8[_0x422f65(0x28d)]++:_0x5b2df8[_0x422f65(0x1fb)]++;}}return _0x5b2df8;}function formatStats(_0x555c2d){const _0xb59538=a42_0x548fe7;return[_0xb59538(0x209)+_0x555c2d[_0xb59538(0x36a)],'✅\x20'+_0x555c2d['success'],'❌\x20'+_0x555c2d['error'],_0xb59538(0x238)+_0x555c2d['running'],'⏳\x20'+_0x555c2d[_0xb59538(0x1fb)]][_0xb59538(0x24d)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a42_0x548fe7(0x313)]=a42_0x548fe7(0x331);[a42_0x548fe7(0x2da)]=a42_0x548fe7(0x2e1);async['execute'](_0x4881bc){const _0x395242=a42_0x548fe7,{options:_0x1857d0,args:_0x28e4d9,tdx:_0x2cfa54}=_0x4881bc;let _0x14f744,_0x5a6102,_0x774d9=![];if(_0x28e4d9[0x0]){if(_0x28e4d9[0x0][_0x395242(0x259)]('.')){const _0x4fd3a5=this[_0x395242(0x359)](_0x28e4d9,_0x1857d0);if(!_0x4fd3a5)return 0x1;_0x14f744=_0x4fd3a5[_0x395242(0x26f)],_0x5a6102=_0x4fd3a5[_0x395242(0x277)];}else{_0x5a6102=_0x28e4d9[0x0],_0x14f744=_0x1857d0['workflowProject'];if(!_0x14f744)return console[_0x395242(0x333)](a42_0x5737de['red']('Error:'),_0x395242(0x210)),0x1;_0x774d9=!![];}}else{const _0x286ec5=this[_0x395242(0x359)](_0x28e4d9,_0x1857d0);if(!_0x286ec5)return 0x1;_0x14f744=_0x286ec5['projectName'],_0x5a6102=_0x286ec5[_0x395242(0x277)];}if(_0x1857d0[_0x395242(0x21a)]){if(_0x14f744&&_0x5a6102)console[_0x395242(0x333)](_0x395242(0x255)+_0x14f744+'.'+_0x5a6102);else _0x14f744&&console[_0x395242(0x333)]('Filter:\x20project='+_0x14f744);}const _0x37bf70=_0x1857d0[_0x395242(0x269)],_0x597184=_0x1857d0[_0x395242(0x280)];if(_0x37bf70){_0x597184&&console[_0x395242(0x333)](a42_0x5737de[_0x395242(0x314)](_0x395242(0x2ef)),_0x395242(0x385));const _0x1f28e0=_0x1857d0['follow'];return _0x1f28e0?await this[_0x395242(0x35b)](_0x4881bc,_0x37bf70):await this[_0x395242(0x2e5)](_0x4881bc,_0x37bf70,_0x1857d0),0x0;}if(_0x597184){const _0x3aef49=await withSpinner('Loading\x20session...',()=>_0x2cfa54[_0x395242(0x350)][_0x395242(0x392)]({'projectName':_0x14f744,'workflowName':_0x5a6102,'limit':0x64}),{'verbose':_0x1857d0['verbose']}),_0x34c8d6=_0x3aef49['data'][_0x395242(0x33b)](_0x2499d4=>_0x2499d4['id']===_0x597184);if(!_0x34c8d6)return console[_0x395242(0x333)](a42_0x5737de[_0x395242(0x2e2)]('Error:'),_0x395242(0x2d8)+_0x597184),0x1;if(!_0x34c8d6[_0x395242(0x23a)]?.['id'])return console[_0x395242(0x333)](a42_0x5737de[_0x395242(0x2e2)]('Error:'),_0x395242(0x222)+_0x597184+_0x395242(0x2b2)),0x1;const _0x585fcb=_0x34c8d6[_0x395242(0x23a)]['id'];_0x1857d0[_0x395242(0x21a)]&&console[_0x395242(0x333)](_0x395242(0x297)+_0x585fcb+'\x20from\x20session\x20'+_0x597184);const _0x3333b8=_0x1857d0[_0x395242(0x1f3)];return _0x3333b8?await this[_0x395242(0x35b)](_0x4881bc,_0x585fcb):await this[_0x395242(0x2e5)](_0x4881bc,_0x585fcb,_0x1857d0),0x0;}const _0x4f6fc3=await withSpinner('Loading\x20sessions...',()=>_0x2cfa54['workflow'][_0x395242(0x392)]({'projectName':_0x14f744,'workflowName':_0x5a6102,'limit':_0x1857d0[_0x395242(0x29a)]||0x32}),{'verbose':_0x1857d0[_0x395242(0x21a)]}),_0x1f39e2=_0x4f6fc3['data'];if(_0x1f39e2[_0x395242(0x214)]===0x0){if(_0x14f744&&_0x5a6102)console[_0x395242(0x333)](_0x395242(0x215)+_0x14f744+'.'+_0x5a6102);else _0x14f744?console['error'](_0x395242(0x2d5)+_0x14f744):(console[_0x395242(0x333)](_0x395242(0x2e4)),console[_0x395242(0x333)](a42_0x5737de[_0x395242(0x2d2)]('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x1f39e2[_0x395242(0x2c2)]((_0x56319f,_0x3c0908)=>{const _0x4ea7bd=_0x395242,_0x1ebe82=_0x56319f[_0x4ea7bd(0x2a3)]||'',_0xca80f5=_0x3c0908[_0x4ea7bd(0x2a3)]||'';return _0xca80f5['localeCompare'](_0x1ebe82);});if(_0x1857d0['json']||_0x1857d0[_0x395242(0x2b0)])return await handleSDKOutput(_0x1f39e2,_0x1857d0),0x0;let _0x5cf999;if(_0x774d9){const _0x42e729=_0x1f39e2[0x0];if(!_0x42e729[_0x395242(0x23a)]?.['id'])return console[_0x395242(0x333)](_0x395242(0x1ed)),0x0;_0x5cf999=_0x42e729[_0x395242(0x23a)]['id'],_0x1857d0['verbose']&&console['error'](_0x395242(0x2fd)+_0x42e729[_0x395242(0x2a3)]);}else{const _0x3a363f=_0x1f39e2['map'](_0x1b16c9=>{const _0x3aac24=_0x395242,_0x44b89f=getAttemptStatusDisplay(_0x1b16c9[_0x3aac24(0x23a)]);return{'title':_0x1b16c9['project']?.[_0x3aac24(0x313)]+'.'+_0x1b16c9[_0x3aac24(0x350)]?.[_0x3aac24(0x313)]+'\x20-\x20'+_0x1b16c9['sessionTime']+'\x20'+_0x44b89f['icon'],'value':_0x1b16c9[_0x3aac24(0x23a)]?.['id']||'','description':_0x44b89f[_0x3aac24(0x30f)]};}),_0x24d747=await a42_0x2a4a52({'type':'select','name':_0x395242(0x269),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x3a363f[_0x395242(0x384)](_0x41f1c0=>_0x41f1c0[_0x395242(0x380)]!=='')});if(!_0x24d747['attemptId'])return 0x0;_0x5cf999=_0x24d747['attemptId'];}const _0x3fc209=_0x1857d0[_0x395242(0x1f3)];return _0x3fc209?await this[_0x395242(0x35b)](_0x4881bc,_0x5cf999):await this[_0x395242(0x2e5)](_0x4881bc,_0x5cf999,_0x1857d0),0x0;}async[a42_0x548fe7(0x2e5)](_0x42c7c5,_0x46f757,_0x175368){const _0x578d83=a42_0x548fe7,{tdx:_0x5886b0}=_0x42c7c5;let _0x58b6ba,_0x211612;try{[_0x58b6ba,_0x211612]=await Promise['all']([_0x5886b0[_0x578d83(0x350)][_0x578d83(0x34e)](_0x46f757),_0x5886b0['workflow'][_0x578d83(0x2ab)](_0x46f757,![])]);}catch(_0x461d17){console['error'](a42_0x5737de['red'](_0x578d83(0x31b)));_0x175368['verbose']&&console[_0x578d83(0x333)](_0x461d17);throw _0x461d17;}if(_0x175368['json']||_0x175368[_0x578d83(0x2b0)]){const _0xa820c3=this[_0x578d83(0x2e0)](_0x58b6ba,_0x211612);await handleSDKOutput([_0xa820c3],_0x175368);return;}const _0x298ce2=_0x5886b0['context'][_0x578d83(0x306)],_0x9c9b6a=this[_0x578d83(0x30b)](_0x58b6ba,_0x211612,_0x298ce2);console['log'](_0x9c9b6a);}async[a42_0x548fe7(0x35b)](_0x279b1b,_0x1db7e6){const _0x1f832b=a42_0x548fe7,{tdx:_0x39e7bb}=_0x279b1b,_0x2c2cf8=TIMELINE_CONFIG[_0x1f832b(0x36f)],_0x2dedb0=TIMELINE_CONFIG[_0x1f832b(0x2af)];let _0x29dc5b=0x0;while(_0x29dc5b<_0x2dedb0){process[_0x1f832b(0x1f7)][_0x1f832b(0x299)]&&process[_0x1f832b(0x1f7)]['write']('\x1bc');let _0x1e3b1f,_0x237861;try{[_0x1e3b1f,_0x237861]=await Promise['all']([_0x39e7bb[_0x1f832b(0x350)][_0x1f832b(0x34e)](_0x1db7e6),_0x39e7bb[_0x1f832b(0x350)][_0x1f832b(0x2ab)](_0x1db7e6,![])]);}catch(_0x488414){console[_0x1f832b(0x333)](a42_0x5737de[_0x1f832b(0x2e2)](_0x1f832b(0x28a)));_0x29dc5b>0x0&&console[_0x1f832b(0x333)](a42_0x5737de['dim'](_0x1f832b(0x221)+_0x29dc5b));throw _0x488414;}const _0x1e5663=_0x39e7bb['context'][_0x1f832b(0x306)],_0x5953e6=this[_0x1f832b(0x30b)](_0x1e3b1f,_0x237861,_0x1e5663);console['log'](_0x5953e6);const _0x26db27=_0x1e3b1f[_0x1f832b(0x250)]&&_0x237861[_0x1f832b(0x369)](_0x3e7993=>_0x3e7993[_0x1f832b(0x281)]!==_0x1f832b(0x28d)&&_0x3e7993[_0x1f832b(0x281)]!=='planned');if(_0x26db27){console[_0x1f832b(0x333)](a42_0x5737de[_0x1f832b(0x362)](_0x1f832b(0x30e)));break;}console['error'](a42_0x5737de[_0x1f832b(0x2d2)](_0x1f832b(0x2a6)+_0x29dc5b*0x2+_0x1f832b(0x243))),await new Promise(_0x4f1b7a=>setTimeout(_0x4f1b7a,_0x2c2cf8)),_0x29dc5b++;}_0x29dc5b>=_0x2dedb0&&console[_0x1f832b(0x333)](a42_0x5737de[_0x1f832b(0x314)]('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a42_0x548fe7(0x30b)](_0x2d9760,_0x1b49ee,_0x2b26b9){const _0x380563=a42_0x548fe7,_0x284e5e=[],_0x2e997e=TIMELINE_CONFIG[_0x380563(0x232)],_0x35b3a1=0x5,_0x1a3e57=process[_0x380563(0x1f7)]['columns']||0x78,_0xa7e8fc=_0x1a3e57-_0x2e997e-_0x35b3a1,_0x44aa20=Math[_0x380563(0x36d)](TIMELINE_CONFIG[_0x380563(0x22d)],Math[_0x380563(0x317)](_0xa7e8fc,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x456402=new Date(_0x2d9760[_0x380563(0x2a0)])[_0x380563(0x24e)](),_0x9170bf=_0x2d9760[_0x380563(0x371)]?new Date(_0x2d9760['finishedAt'])[_0x380563(0x24e)]():Date['now'](),_0x146444={'start':_0x456402,'end':_0x9170bf,'duration':_0x9170bf-_0x456402},_0xa81a1c=new Map(),_0x39b970=[];for(const _0x4d3b0e of _0x1b49ee){if(_0x4d3b0e[_0x380563(0x29f)]){const _0x1b00e6=new Date(_0x4d3b0e[_0x380563(0x29f)])[_0x380563(0x24e)](),_0x202369=_0x4d3b0e[_0x380563(0x31a)]?new Date(_0x4d3b0e[_0x380563(0x31a)])[_0x380563(0x24e)]():Date[_0x380563(0x2a9)](),_0x4fea12={'start':_0x1b00e6,'end':_0x202369,'duration':_0x202369-_0x1b00e6};_0xa81a1c[_0x380563(0x325)](_0x4d3b0e['id'],_0x4fea12),_0x39b970[_0x380563(0x382)]({'name':_0x4d3b0e[_0x380563(0x34d)],'state':_0x4d3b0e['state']||_0x380563(0x367),'window':_0x4fea12});}else _0x39b970[_0x380563(0x382)]({'name':_0x4d3b0e[_0x380563(0x34d)],'state':_0x4d3b0e[_0x380563(0x281)]||'planned','window':undefined});}_0x39b970[_0x380563(0x2c2)]((_0x3c07ad,_0x52e7ea)=>{const _0x3318e9=_0x380563;if(!_0x3c07ad['window'])return 0x1;if(!_0x52e7ea[_0x3318e9(0x2c9)])return-0x1;return _0x3c07ad[_0x3318e9(0x2c9)][_0x3318e9(0x35e)]-_0x52e7ea[_0x3318e9(0x2c9)][_0x3318e9(0x35e)];});const _0x1b6d5c=_0x39b970[_0x380563(0x214)],_0x1ff0a3=_0x1b6d5c>TIMELINE_CONFIG[_0x380563(0x332)];_0x1ff0a3&&_0x39b970[_0x380563(0x1f6)](TIMELINE_CONFIG[_0x380563(0x332)]);const _0x2d7bbd=calculateTimeScale(_0x146444,_0x44aa20),_0x1732bf=_0x2d9760[_0x380563(0x250)]?_0x2d9760[_0x380563(0x343)]?a42_0x5737de['green'](_0x380563(0x343)):a42_0x5737de[_0x380563(0x2e2)](_0x380563(0x333)):a42_0x5737de[_0x380563(0x2c3)]('running'),_0x244211=_0x2d9760[_0x380563(0x225)]?.['id'],_0x5b16a8=_0x2d9760[_0x380563(0x280)];let _0x7e7171;if(_0x244211&&_0x5b16a8){const _0x26301c=getWorkflowAttemptUrl(_0x2b26b9,_0x244211,_0x5b16a8,_0x2d9760['id']);_0x7e7171=hyperlink(a42_0x5737de[_0x380563(0x2d2)](_0x2d9760['id']),_0x26301c);}else _0x7e7171=a42_0x5737de[_0x380563(0x2d2)](_0x2d9760['id']);_0x284e5e['push'](_0x380563(0x2b9)+_0x7e7171+_0x380563(0x37f)+_0x1732bf+_0x380563(0x37f)+formatElapsed(_0x146444['duration']));if(_0x39b970['length']>0x0){const _0x2ff428=renderTimeAxis(_0x2d7bbd,_0x44aa20),_0x3c4f58=new Date(_0x146444[_0x380563(0x35e)]),_0x14c81c=formatDate(_0x3c4f58),_0x43ef6e=TIMELINE_CONFIG[_0x380563(0x20a)]+TIMELINE_CONFIG[_0x380563(0x2cc)]+_0x2e997e,_0x12ed5e=_0x14c81c['padStart'](_0x43ef6e),_0x54264f=a42_0x5737de['dim'](_0x12ed5e);_0x284e5e[_0x380563(0x382)](_0x54264f+'\x20'+_0x2ff428);for(const _0x3b2ad2 of _0x39b970){_0x284e5e[_0x380563(0x382)](renderTaskRow(_0x3b2ad2,_0x2d7bbd,_0x44aa20,_0x2e997e));}const _0x4eae21=calculateStats(_0x39b970);_0x284e5e[_0x380563(0x382)](formatStats(_0x4eae21)),_0x1ff0a3&&_0x284e5e[_0x380563(0x382)](a42_0x5737de['yellow'](_0x380563(0x309)+TIMELINE_CONFIG[_0x380563(0x332)]+'\x20of\x20'+_0x1b6d5c+_0x380563(0x2a2))),_0x284e5e[_0x380563(0x382)](''),_0x284e5e[_0x380563(0x382)](a42_0x5737de['dim'](_0x380563(0x283))+(_0x380563(0x22a)+_0x2d9760['id']+_0x380563(0x370))+a42_0x5737de[_0x380563(0x2d2)](_0x380563(0x354)));}else _0x284e5e[_0x380563(0x382)](_0x380563(0x2f5));return _0x284e5e['join']('\x0a');}[a42_0x548fe7(0x2e0)](_0xaf5d6f,_0x5595f9){const _0x222da3=a42_0x548fe7,_0xdb0790=new Date(_0xaf5d6f[_0x222da3(0x2a0)])[_0x222da3(0x24e)](),_0xec5aef=_0xaf5d6f['finishedAt']?new Date(_0xaf5d6f[_0x222da3(0x371)])['getTime']():Date[_0x222da3(0x2a9)](),_0x5a4fca=_0xec5aef-_0xdb0790,_0x1bc98c=[];for(const _0x262a73 of _0x5595f9){if(_0x262a73['startedAt']){const _0xa6d8dd=new Date(_0x262a73['startedAt'])[_0x222da3(0x24e)](),_0x16d4d6=_0x262a73['updatedAt']?new Date(_0x262a73['updatedAt'])[_0x222da3(0x24e)]():Date[_0x222da3(0x2a9)]();_0x1bc98c[_0x222da3(0x382)]({'name':_0x262a73[_0x222da3(0x34d)],'state':_0x262a73[_0x222da3(0x281)]||_0x222da3(0x367),'window':{'start':_0xa6d8dd,'end':_0x16d4d6,'duration':_0x16d4d6-_0xa6d8dd}});}else _0x1bc98c['push']({'name':_0x262a73[_0x222da3(0x34d)],'state':_0x262a73[_0x222da3(0x281)]||_0x222da3(0x29c),'window':undefined});}const _0x34d24d=calculateStats(_0x1bc98c);return{'attempt':{'id':_0xaf5d6f['id'],'status':_0xaf5d6f[_0x222da3(0x250)]?_0xaf5d6f[_0x222da3(0x343)]?_0x222da3(0x343):_0x222da3(0x333):_0x222da3(0x28d),'createdAt':_0xaf5d6f[_0x222da3(0x2a0)],'finishedAt':_0xaf5d6f[_0x222da3(0x371)],'duration_ms':_0x5a4fca},'tasks':_0x1bc98c[_0x222da3(0x394)](_0x2d787a=>({'name':_0x2d787a[_0x222da3(0x313)],'state':_0x2d787a[_0x222da3(0x281)],'startedAt':_0x2d787a[_0x222da3(0x2c9)]?new Date(_0x2d787a['window'][_0x222da3(0x35e)])[_0x222da3(0x1f4)]():null,'updatedAt':_0x2d787a['window']?new Date(_0x2d787a[_0x222da3(0x2c9)][_0x222da3(0x34f)])[_0x222da3(0x1f4)]():null,'duration_ms':_0x2d787a[_0x222da3(0x2c9)]?.[_0x222da3(0x2fe)]||null})),'stats':_0x34d24d};}}
|
|
1
|
+
const a42_0x3bd9b9=a42_0x5c3c;(function(_0x346e53,_0x6bd87d){const _0x335842=a42_0x5c3c,_0x70842f=_0x346e53();while(!![]){try{const _0x3392b6=parseInt(_0x335842(0x327))/0x1+-parseInt(_0x335842(0x1f9))/0x2+parseInt(_0x335842(0x27a))/0x3*(-parseInt(_0x335842(0x2ac))/0x4)+parseInt(_0x335842(0x26b))/0x5+-parseInt(_0x335842(0x2f5))/0x6*(parseInt(_0x335842(0x1fb))/0x7)+-parseInt(_0x335842(0x256))/0x8+parseInt(_0x335842(0x2e3))/0x9;if(_0x3392b6===_0x6bd87d)break;else _0x70842f['push'](_0x70842f['shift']());}catch(_0x1a346e){_0x70842f['push'](_0x70842f['shift']());}}}(a42_0x148a,0x64492));import a42_0x48c95c from'chalk';import{existsSync}from'fs';import a42_0x50631b 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';function a42_0x148a(){const _0x2e8adb=['sort','Task\x20name:\x20','Source\x20directory:\x20','done','dim','Key:\x20','logFiles','List\x20workflow\x20attempts','tasks','No\x20workflow\x20projects\x20found','now','Session\x20','LABEL_MIN_SPACING','\x0a✔\x20Attempt\x20complete','→\x20Project:\x20','✔\x20Deleted\x20project\x20','workflow:kill','length','showWorkflowConsoleUrl','key','Expected\x20format:\x20--param\x20key=value','join','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','\x20unchanged','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','\x20\x20Attempt\x20ID:\x20','description','Show\x20specific\x20attempt\x20details','delete','Validation:\x20skipped','get','requireProject','MIN_LABEL_COUNT','parseProjectWorkflowPattern','No\x20sessions\x20found\x20for:\x20','\x20\x20Workflow:\x20','session:','Key\x20cannot\x20be\x20empty','window','readFile','param','No\x20workflow\x20sessions\x20found','Using\x20attempt\x20','📋\x20','Include\x20retried:\x20yes','slice','projectId','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','trim','new','columns','floor','\x0aPush\x20these\x20changes?','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Start\x20a\x20workflow\x20run','state','Session\x20time:\x20','\x22\x20with\x20new\x20revision?','✔\x20Clone\x20complete','LABEL_WIDTH_DIVISOR','Source\x20directory\x20is\x20required','createdAt','trimEnd','type','\x20is\x20not\x20a\x20directory','match','Killing\x20attempt...','toLowerCase','Project\x20name\x20is\x20required','workflow:workflows','project','✔\x20Found\x20','1284644izjTpO','text','99687wNFLLH','\x20\x20Console:\x20','List\x20workflow\x20execution\x20sessions','repeat','params','Latest\x20session\x20has\x20no\x20attempt','resolveProject','yes','No\x20sessions\x20found','taskName','path','POLL_INTERVAL_MS','prepareCloneProject','\x20secret','getMonth','navigateSessionsInteractive','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','workflow:retry','Error:\x20Attempt\x20ID\x20is\x20required','Kill\x20a\x20running\x20attempt','Auto-selected\x20latest\x20session:\x20','Dry\x20run:\x20yes','unknown','summary','Error:\x20KEY=VALUE\x20is\x20required','startTime','Error:','Retrying\x20attempt...','Workflow:\x20','No\x20matching\x20sessions\x20found','No\x20workflows\x20found','\x22\x20to\x20new\x20project\x20\x22','split','isDirectory','\x20new','changes','fileSize','Error:\x20Secret\x20key\x20is\x20required','📁\x20','No\x20workflow\x20tdx.json\x20found','Select\x20a\x20session\x20to\x20view\x20timeline:','No\x20log\x20content\x20found','min','\x0aDry\x20run\x20-\x20no\x20files\x20written','revision:\x20','group_error','buildTimelineData','/sessions/','newProjectName','workflow:run','getTime','rows','includeRetried','\x0aFailed\x20to\x20fetch\x20attempt\x20data','find','\x20(use\x20--limit\x20to\x20show\x20more)','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','→\x20New\x20project:\x20','running','attempt:','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','Listing\x20workflow\x20sessions...','error','Deleting\x20project\x20','durationMs','\x20sessions\x20','Cloning\x20to\x20','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','list','end','Warning:','retryAttemptName','Invalid\x20format:\x20','diff','session','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','(use\x20--limit\x20to\x20see\x20more)','select','site','\x20\x20Changes:\x20','fileCount','projectName','startsWith','planned','\x0a⚠\x20Project\x20\x22','✔\x20Push\x20complete','\x20task','cwd','Output\x20directory:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','Files\x20to\x20upload:\x20','1088544JejUgQ','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','canceling','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','\x0aClone\x20\x22','\x0aUpdate\x20existing\x20project\x20\x22','kill','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','pending','Retry\x20a\x20session\x20or\x20attempt','Project\x20directory:\x20','map','\x0aDry\x20run\x20-\x20no\x20project\x20created','Listing\x20workflow\x20projects...','No\x20attempts\x20found','success','run','\x20\x20Files\x20extracted:\x20','table','Filter:\x20','648485xzINMs','metadata','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','\x22?\x20This\x20cannot\x20be\x20undone.','\x20\x20Location:\x20','lastAttempt','keys','startedAt','\x20\x20tdx\x20wf\x20use\x20<project>','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','.\x20Expected\x20format:\x20KEY=VALUE','log','sessionId','workflow:push','green','464208ZOzaQh','reason','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','resolveProjectId','Downloading\x20logs...','fullName','Listing\x20workflow\x20attempts...','No\x20log\x20files\x20found\x20for\x20this\x20attempt','skipValidation','dryRun','Resolving\x20project\x20\x27','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Loading\x20workflows...','duration','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','List\x20workflows','msPerChar','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','TASK_NAME_WIDTH','sourceDir','\x20modified','json','every','workflow:secrets:list','includes','Downloading\x20project\x20','getDate','MAX_TIMELINE_WIDTH','deleted','substring','MAX_LABEL_COUNT','Cancelled','sessionTime','Error:\x20Invalid\x20parameter\x20format:\x20','Getting\x20attempt\x20details...','\x20(system)','yellow','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','isArray','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','targetDir','fill','No\x20sessions\x20found\x20in\x20project:\x20','workflow:attempt','\x1b[1A\x1b[2K','Usage:\x20tdx\x20wf\x20use\x20<project>','\x20attempt','status','workflow','From\x20task:\x20','8vbRBQq','toISOString','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','\x20deleted','Project\x20name:\x20','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','cancelRequested','✔\x20Secret\x20\x27','targetExists','resolve','round','\x20\x20Project\x20ID:\x20','\x20\x20Session\x20ID:\x20','Project:\x20','Select\x20a\x20workflow\x20to\x20run','filesExtracted','workflow:secrets:delete','✔\x20Project\x20updated','write','Pushing\x20project...','workflow:upload','GUTTER','renderSingleTimeline','updatedAt','\x20\x20Revision:\x20','autocomplete','MAX_POLL_ITERATIONS','Revision:\x20','parse','data','Select\x20a\x20task\x20to\x20view\x20logs:','attemptId','white','...','renderTimeline','follow','Getting\x20attempt\x20tasks...','verbose','Listing\x20secrets...','Target:\x20','index','Fetching\x20log\x20files...','Resume\x20from:\x20','has','✔\x20Retry\x20started','ICON_SPACING','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Error:\x20Invalid\x20JSON\x20in\x20--params','finishedAt','cyan','projects','getFullYear','No\x20projects\x20match\x20pattern:\x20','blue','values','12377349vSNOXJ','/app/workflows/','push','Pulling\x20project\x20','\x20\x20New\x20attempt\x20ID:\x20','stdout','✔\x20Pushed\x20','workflow:logs','workflow:projects','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','clear','\x20\x20Session\x20context\x20set\x20to:\x20','workflow:tasks','revision','Loading\x20sessions...','from','icon','context','6EscKKL','value','task','Session\x20not\x20found:\x20','\x20\x20Target:\x20','Show\x20tasks\x20for\x20an\x20attempt','-\x20no\x20files\x20written','\x20workflow','resolveProjectDir','filter','sessions','(unknown)','existingProjectId','padStart','max','force','Attempt\x20ID:\x20','Source:\x20','\x20tasks','No\x20workflows\x20found\x20in\x20project:\x20','hasChanges','includeSubtasks','pollTimeline','✔\x20Workflow\x20project\x20set\x20to:\x20','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','MAX_TASKS_DISPLAY','name','\x22\x20already\x20exists\x20(ID:\x20','total','title','pullProject','---\x20','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','output','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Pattern:\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Parameters:\x20','Project\x20filter:\x20','generateSessionTimelineRows','isTTY','Show\x20logs\x20for\x20a\x20workflow\x20attempt','workflow:download','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','download','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','✔\x20Pull\x20complete','Including\x20subtasks:\x20yes','workflow:secrets:set','7915jowWeL','✔\x20Showing\x20','Reason:\x20','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','isNewProject','applyPullProject','\x20session','message','retryAttempt','New\x20project\x20name:\x20','🔄\x20','indexOf','utf-8','attempt','Params:\x20','format','\x20has\x20no\x20attempts','\x0aError:','modified','stat','deleteSecret','workflows','No\x20attempts\x20found\x20in\x20project:\x20','✔\x20Project:\x20','\x20\x20Project:\x20','Filter:\x20project=','limit','✔\x20Downloaded\x20','Loading\x20session...','Writing\x20files...','localeCompare','start','red','\x20-\x20','workflow:delete','unchanged','Total:\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Usage:\x20workflow:delete\x20<project-name-or-id>','relative','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','getHours','Error:\x20Project\x20name\x20is\x20required','workflowProject','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','renderSessionsTimeline','set','workflow:pull','size','✔\x20Workflow\x20project\x20context\x20cleared.','sourceProjectName','execute','jsonl','all','replace','Failed\x20to\x20fetch\x20attempt\x20data','Pushing\x20workflow\x20project...','workflow:timeline','\x0aPolling...\x20('];a42_0x148a=function(){return _0x2e8adb;};return a42_0x148a();}import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a42_0x1933bf from'prompts';function getAttemptStatusDisplay(_0x35af6e){const _0x3d609e=a42_0x5c3c;if(!_0x35af6e)return{'icon':'⏳','text':''};const {done:_0x20fea2,success:_0x1b2316,cancelRequested:_0x301b36}=_0x35af6e;if(!_0x20fea2)return _0x301b36?{'icon':'🛑','text':a42_0x48c95c[_0x3d609e(0x29e)](_0x3d609e(0x258))}:{'icon':'🔄','text':a42_0x48c95c[_0x3d609e(0x2e1)](_0x3d609e(0x235))};if(_0x1b2316)return{'icon':'✅','text':a42_0x48c95c[_0x3d609e(0x279)](_0x3d609e(0x266))};return{'icon':'❌','text':a42_0x48c95c[_0x3d609e(0x196)](_0x3d609e(0x239))};}export class WorkflowBaseCommand extends BaseCommand{[a42_0x3bd9b9(0x201)](_0x13e702,_0x29f939,_0x4ced7a=0x0){const _0xf8c38c=a42_0x3bd9b9;return _0x13e702[_0x4ced7a]||_0x29f939[_0xf8c38c(0x1a1)];}[a42_0x3bd9b9(0x1d0)](_0x5f08ac,_0x4c8d07,_0x3cd58d=0x0){const _0x1dcc9c=a42_0x3bd9b9,_0x4853bd=this[_0x1dcc9c(0x201)](_0x5f08ac,_0x4c8d07,_0x3cd58d);if(!_0x4853bd)return console[_0x1dcc9c(0x239)](a42_0x48c95c['red'](_0x1dcc9c(0x215)),_0x1dcc9c(0x1f5)),console[_0x1dcc9c(0x239)](a42_0x48c95c['dim'](_0x1dcc9c(0x26d))),null;return _0x4853bd;}[a42_0x3bd9b9(0x1d2)](_0x1bdc31,_0x363b27){const _0x8c0fd6=a42_0x3bd9b9;if(_0x1bdc31[0x0]){const _0x2ec06f=_0x1bdc31[0x0][_0x8c0fd6(0x21b)]('.');if(_0x2ec06f[_0x8c0fd6(0x1c2)]===0x1)return{'projectName':_0x2ec06f[0x0],'workflowName':undefined};else return _0x2ec06f['length']===0x2?{'projectName':_0x2ec06f[0x0],'workflowName':_0x2ec06f[0x1]}:(console[_0x8c0fd6(0x239)](a42_0x48c95c['red'](_0x8c0fd6(0x215)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x363b27['workflowProject'],'workflowName':undefined};}[a42_0x3bd9b9(0x2fd)](_0x12a544,_0x50a673,_0x212477=0x0){const _0x36cc26=a42_0x3bd9b9;if(_0x12a544[_0x212477])return _0x12a544[_0x212477];if(_0x50a673[_0x36cc26(0x1a1)]){const _0x2fbdc4=a42_0x50631b[_0x36cc26(0x1c6)](process['cwd'](),_0x36cc26(0x18b),_0x50a673[_0x36cc26(0x1a1)]);if(existsSync(a42_0x50631b[_0x36cc26(0x1c6)](_0x2fbdc4,'tdx.json')))return _0x2fbdc4;}return undefined;}async[a42_0x3bd9b9(0x1c3)](_0x1f7034,_0x2005fb,_0x5ef06e){const _0x26e7a1=a42_0x3bd9b9;try{const _0x5248ad=await _0x1f7034[_0x26e7a1(0x2aa)][_0x26e7a1(0x18b)](_0x2005fb,{'limit':0x1});if(_0x5248ad[_0x26e7a1(0x1c2)]>0x0){const _0x368017=_0x5248ad[0x0]['id'],_0x3664bc=getWorkflowUrl(_0x5ef06e,_0x368017);console[_0x26e7a1(0x239)](_0x26e7a1(0x1fc)+a42_0x48c95c[_0x26e7a1(0x2dd)](_0x3664bc));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a42_0x3bd9b9(0x30f)]='workflow:use';['description']=a42_0x3bd9b9(0x1e0);async[a42_0x3bd9b9(0x1a9)](_0x1f7a22){const _0x1348f1=a42_0x3bd9b9,{options:_0x12d913,args:_0x1e3889,tdx:_0xbd12f2}=_0x1f7a22,_0x2df0fa=_0x1e3889[0x0],_0x4b6947=_0x12d913[_0x1348f1(0x2ed)];if(_0x4b6947)return saveSessionContext({'workflow_project':undefined},_0x12d913[_0x1348f1(0x245)]),console[_0x1348f1(0x276)](a42_0x48c95c['green'](_0x1348f1(0x1a7))),0x0;if(!_0x2df0fa)return console[_0x1348f1(0x239)](a42_0x48c95c[_0x1348f1(0x196)]('Error:'),_0x1348f1(0x1f5)),console[_0x1348f1(0x239)](a42_0x48c95c[_0x1348f1(0x1b5)](_0x1348f1(0x2a7))),console['error'](a42_0x48c95c['dim'](_0x1348f1(0x2da))),0x1;const _0x45f2f7=await withSpinner(_0x1348f1(0x284)+_0x2df0fa+'\x27...',()=>_0xbd12f2[_0x1348f1(0x2aa)][_0x1348f1(0x27d)](_0x2df0fa),{'verbose':_0x12d913['verbose']}),{name:_0x371616}=_0x45f2f7[_0x1348f1(0x2c9)];return saveSessionContext({'workflow_project':_0x371616},_0x12d913[_0x1348f1(0x245)]),console[_0x1348f1(0x276)](a42_0x48c95c['green'](_0x1348f1(0x30c)+a42_0x48c95c[_0x1348f1(0x2dd)](_0x371616))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a42_0x3bd9b9(0x30f)]=a42_0x3bd9b9(0x2eb);[a42_0x3bd9b9(0x1cb)]='List\x20all\x20workflow\x20projects';async[a42_0x3bd9b9(0x1a9)](_0x3cfd19){const _0x2cff16=a42_0x3bd9b9,{options:_0x48b58f,args:_0x36599e,tdx:_0x4fc7b8}=_0x3cfd19,_0x1895db=_0x36599e[0x0];_0x48b58f[_0x2cff16(0x2d1)]&&_0x1895db&&console['error'](_0x2cff16(0x318)+_0x1895db);const _0x6cc8db=await withSpinner(_0x2cff16(0x264),()=>_0x4fc7b8['workflow'][_0x2cff16(0x2de)](_0x1895db,{'limit':_0x48b58f[_0x2cff16(0x190)]}),{'verbose':_0x48b58f[_0x2cff16(0x2d1)]});let _0x5ede45=_0x6cc8db[_0x2cff16(0x2c9)];_0x5ede45[_0x2cff16(0x1b1)]((_0x5a9ca7,_0x1c0ae5)=>_0x5a9ca7[_0x2cff16(0x30f)][_0x2cff16(0x194)](_0x1c0ae5[_0x2cff16(0x30f)]));const _0x33f883=_0x48b58f[_0x2cff16(0x190)]||0x64,_0xbd366b=_0x5ede45[_0x2cff16(0x1c2)]>=_0x33f883?a42_0x48c95c[_0x2cff16(0x1b5)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x2cff16(0x239)](_0x2cff16(0x1f8)+_0x5ede45['length']+'\x20project'+(_0x5ede45[_0x2cff16(0x1c2)]!==0x1?'s':'')+_0xbd366b);if(_0x48b58f[_0x2cff16(0x185)]===_0x2cff16(0x28f)||_0x48b58f[_0x2cff16(0x185)]===_0x2cff16(0x1aa)||_0x48b58f[_0x2cff16(0x185)]===_0x2cff16(0x269))await handleSDKOutput(_0x5ede45,_0x48b58f);else{if(_0x5ede45['length']===0x0)_0x1895db?console[_0x2cff16(0x276)](_0x2cff16(0x2e0)+_0x1895db):console['log'](_0x2cff16(0x1ba));else{const _0xd8aa9e=_0x5ede45[_0x2cff16(0x262)](_0x15fa4a=>{const _0x42c180=_0x2cff16,_0x2e3c4b=_0x15fa4a[_0x42c180(0x26c)]?.['some'](_0x3e4890=>_0x3e4890[_0x42c180(0x1c4)]==='sys'),_0x462eed=_0x2e3c4b?a42_0x48c95c[_0x42c180(0x1b5)](_0x42c180(0x29d)):'';return _0x42c180(0x221)+_0x15fa4a['name']+_0x462eed;});await writeOutput(_0xd8aa9e[_0x2cff16(0x1c6)]('\x0a'),_0x48b58f[_0x2cff16(0x316)],_0x2cff16(0x23f));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a42_0x3bd9b9(0x30f)]=a42_0x3bd9b9(0x1f6);[a42_0x3bd9b9(0x1cb)]=a42_0x3bd9b9(0x289);async[a42_0x3bd9b9(0x1a9)](_0x369c84){const _0x9370e0=a42_0x3bd9b9,{options:_0x113819,args:_0x467f47,tdx:_0xc00be3}=_0x369c84,_0x3db071=this[_0x9370e0(0x201)](_0x467f47,_0x113819);_0x113819[_0x9370e0(0x2d1)]&&_0x3db071&&console['error'](_0x9370e0(0x31b)+_0x3db071);const _0xbf1fe6=await withSpinner('Listing\x20workflows...',()=>_0xc00be3[_0x9370e0(0x2aa)][_0x9370e0(0x18b)](_0x3db071,{'limit':_0x113819['limit']}),{'verbose':_0x113819[_0x9370e0(0x2d1)]});let _0x5b9542=_0xbf1fe6['data'];_0x5b9542[_0x9370e0(0x1b1)]((_0x4608b0,_0x28d64b)=>{const _0x1e459e=_0x9370e0,_0xbac584=_0x4608b0[_0x1e459e(0x30f)][_0x1e459e(0x194)](_0x28d64b[_0x1e459e(0x30f)]);if(_0xbac584!==0x0)return _0xbac584;return(_0x4608b0[_0x1e459e(0x1f7)]?.[_0x1e459e(0x30f)]||'')[_0x1e459e(0x194)](_0x28d64b[_0x1e459e(0x1f7)]?.[_0x1e459e(0x30f)]||'');});const _0x3122e5=_0x113819[_0x9370e0(0x190)]||0x64,_0x3b02ab=_0x5b9542['length']>=_0x3122e5?a42_0x48c95c[_0x9370e0(0x1b5)](_0x9370e0(0x232)):'';console[_0x9370e0(0x239)](_0x9370e0(0x1f8)+_0x5b9542['length']+_0x9370e0(0x2fc)+(_0x5b9542['length']!==0x1?'s':'')+_0x3b02ab);if(_0x113819[_0x9370e0(0x185)]===_0x9370e0(0x28f)||_0x113819[_0x9370e0(0x185)]==='jsonl'||_0x113819['format']==='table')await handleSDKOutput(_0x5b9542,_0x113819);else{if(_0x5b9542[_0x9370e0(0x1c2)]===0x0)_0x3db071?console['log'](_0x9370e0(0x308)+_0x3db071):console[_0x9370e0(0x276)](_0x9370e0(0x219));else{const _0x4734b4=_0x113819[_0x9370e0(0x249)],_0xb89f97=_0x5b9542[_0x9370e0(0x262)](_0x40da1c=>{const _0x3965ad=_0x9370e0,_0xec9387=a42_0x48c95c[_0x3965ad(0x1b5)]('#'+_0x40da1c['id']),_0x2541ec=hyperlink(_0xec9387,getWorkflowUrl(_0x4734b4,_0x40da1c['id'])),_0x4e2b96=_0x40da1c[_0x3965ad(0x1f7)]?.['name']?a42_0x48c95c[_0x3965ad(0x1b5)]('\x20('+_0x40da1c[_0x3965ad(0x1f7)][_0x3965ad(0x30f)]+')'):'';return _0x3965ad(0x1dc)+_0x2541ec+'\x20'+_0x40da1c[_0x3965ad(0x30f)]+_0x4e2b96;});await writeOutput(_0xb89f97['join']('\x0a'),_0x113819['output'],_0x9370e0(0x23f));}}return 0x0;}}function a42_0x5c3c(_0x731f4f,_0x1bb16a){_0x731f4f=_0x731f4f-0x17f;const _0x148aa3=a42_0x148a();let _0x5c3c07=_0x148aa3[_0x731f4f];return _0x5c3c07;}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']='workflow:sessions';[a42_0x3bd9b9(0x1cb)]=a42_0x3bd9b9(0x1fd);async[a42_0x3bd9b9(0x1a9)](_0x2f576a){const _0x830f5d=a42_0x3bd9b9,{options:_0x1e199f,args:_0x2b17b2,tdx:_0x2ba4c6}=_0x2f576a,_0x368154=this[_0x830f5d(0x1d2)](_0x2b17b2,_0x1e199f);if(!_0x368154)return 0x1;const {projectName:_0x2849b2,workflowName:_0x2574f1}=_0x368154;if(_0x1e199f[_0x830f5d(0x2d1)]){if(_0x2849b2&&_0x2574f1)console['error']('Filter:\x20'+_0x2849b2+'.'+_0x2574f1);else _0x2849b2&&console[_0x830f5d(0x239)](_0x830f5d(0x18f)+_0x2849b2);const _0x1b216f=_0x1e199f[_0x830f5d(0x2a9)];_0x1b216f&&console[_0x830f5d(0x239)]('Status:\x20'+_0x1b216f);}let _0x559c99=0x28;if(process['stdout'][_0x830f5d(0x31d)]&&!_0x1e199f['output']&&!_0x1e199f[_0x830f5d(0x185)]){const _0x8c686=process[_0x830f5d(0x2e8)][_0x830f5d(0x22e)]||0x28;_0x559c99=Math['max'](0x14,Math['floor'](_0x8c686*0x2/0x3));}const _0x3ef7db=_0x1e199f[_0x830f5d(0x190)]||_0x559c99,_0x56c16a=await withSpinner(_0x830f5d(0x238),()=>_0x2ba4c6[_0x830f5d(0x2aa)]['sessions']({'projectName':_0x2849b2,'workflowName':_0x2574f1,'status':_0x1e199f['status'],'fromTime':_0x1e199f[_0x830f5d(0x2f2)],'toTime':_0x1e199f['to'],'limit':_0x3ef7db}),{'verbose':_0x1e199f[_0x830f5d(0x2d1)]}),_0x40495f=_0x56c16a['data'];_0x40495f[_0x830f5d(0x1b1)]((_0xfc641d,_0x6a2e20)=>{const _0x361e86=_0x830f5d,_0x479b25=_0xfc641d[_0x361e86(0x29a)]||'',_0x3c0e2f=_0x6a2e20[_0x361e86(0x29a)]||'';return _0x3c0e2f[_0x361e86(0x194)](_0x479b25);});_0x40495f['length']>=_0x3ef7db?console[_0x830f5d(0x239)](_0x830f5d(0x328)+_0x40495f['length']+_0x830f5d(0x23c)+a42_0x48c95c[_0x830f5d(0x1b5)](_0x830f5d(0x247))):console[_0x830f5d(0x239)]('✔\x20Found\x20'+_0x40495f[_0x830f5d(0x1c2)]+_0x830f5d(0x32d)+(_0x40495f[_0x830f5d(0x1c2)]!==0x1?'s':''));if(_0x1e199f['format']===_0x830f5d(0x28f)||_0x1e199f[_0x830f5d(0x185)]===_0x830f5d(0x1aa)||_0x1e199f[_0x830f5d(0x185)]===_0x830f5d(0x269))await handleSDKOutput(_0x40495f,_0x1e199f);else{if(!process[_0x830f5d(0x2e8)]['isTTY']||_0x1e199f[_0x830f5d(0x316)]){if(_0x40495f[_0x830f5d(0x1c2)]===0x0){if(_0x2849b2&&_0x2574f1)console['log'](_0x830f5d(0x1d3)+_0x2849b2+'.'+_0x2574f1);else _0x2849b2?console['log']('No\x20sessions\x20found\x20in\x20project:\x20'+_0x2849b2):console[_0x830f5d(0x276)]('No\x20sessions\x20found');}else{const _0x4b3908=_0x1e199f['site'],_0x3216a2=this[_0x830f5d(0x1a3)](_0x40495f,_0x4b3908);_0x1e199f[_0x830f5d(0x316)]?await writeOutput(_0x3216a2,_0x1e199f[_0x830f5d(0x316)],_0x830f5d(0x23f)):console[_0x830f5d(0x276)](_0x3216a2);}!_0x2849b2&&(console['error'](''),console[_0x830f5d(0x239)](a42_0x48c95c['dim'](_0x830f5d(0x30d))),console[_0x830f5d(0x239)](a42_0x48c95c['dim']('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a42_0x48c95c[_0x830f5d(0x1b5)](_0x830f5d(0x273))));}else{if(_0x40495f[_0x830f5d(0x1c2)]===0x0){if(_0x2849b2&&_0x2574f1)console[_0x830f5d(0x276)](_0x830f5d(0x1d3)+_0x2849b2+'.'+_0x2574f1);else _0x2849b2?console[_0x830f5d(0x276)](_0x830f5d(0x2a4)+_0x2849b2):console[_0x830f5d(0x276)](_0x830f5d(0x203));}else await this[_0x830f5d(0x20a)](_0x40495f,_0x2f576a,_0x2849b2);}}return 0x0;}[a42_0x3bd9b9(0x1a3)](_0x1ae285,_0x33696f){const _0x289675=a42_0x3bd9b9,_0x48cfbb=[],_0x1519b4=new Map();let _0x5abf06=Infinity,_0x1b3d51=-Infinity;for(const _0x4da571 of _0x1ae285){if(_0x4da571[_0x289675(0x270)]?.['createdAt']){const _0x3fef58=new Date(_0x4da571[_0x289675(0x270)][_0x289675(0x1ee)])['getTime'](),_0x30e952=_0x4da571[_0x289675(0x270)][_0x289675(0x2dc)]?new Date(_0x4da571['lastAttempt'][_0x289675(0x2dc)])[_0x289675(0x22d)]():Date[_0x289675(0x1bb)](),_0x5eab35=_0x4da571[_0x289675(0x1f7)]?.[_0x289675(0x30f)]||_0x289675(0x300);!_0x1519b4[_0x289675(0x2d7)](_0x5eab35)&&_0x1519b4[_0x289675(0x1a4)](_0x5eab35,[]),_0x1519b4[_0x289675(0x1cf)](_0x5eab35)[_0x289675(0x2e5)]({'session':_0x4da571,'startTime':_0x3fef58,'endTime':_0x30e952,'duration':_0x30e952-_0x3fef58}),_0x5abf06=Math[_0x289675(0x225)](_0x5abf06,_0x3fef58),_0x1b3d51=Math['max'](_0x1b3d51,_0x30e952);}}if(_0x1519b4[_0x289675(0x1a6)]===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x1b567a=process['stdout'][_0x289675(0x1e3)]||0x78,_0x36be3a=0x1e,_0x3cb3bd=0x32,_0x3b75d9=0x4,_0x4b9f51=Math[_0x289675(0x225)](_0x3cb3bd,Math['max'](_0x36be3a,Math['floor'](_0x1b567a*0.3))),_0x1585ce=_0x1b567a-_0x4b9f51-TIMELINE_CONFIG[_0x289675(0x2c1)]-0x3-_0x3b75d9,_0x526cc6=_0x1b3d51-_0x5abf06,_0x26cc7b=_0x526cc6/_0x4b9f51,_0x7b2530=renderTimeAxis({'startTime':_0x5abf06,'endTime':_0x1b3d51,'durationMs':_0x526cc6,'msPerChar':_0x26cc7b},_0x4b9f51),_0x522854=[];for(const _0x3bba5b of _0x1519b4[_0x289675(0x2e2)]()){_0x522854['push'](..._0x3bba5b);}_0x522854[_0x289675(0x1b1)]((_0x4258fe,_0x321a7e)=>_0x321a7e['startTime']-_0x4258fe['startTime']);const _0x29ea03=new Date(_0x5abf06),_0x1c9018=formatDate(_0x29ea03),_0x556bf3=_0x3b75d9+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG['ICON_SPACING']+_0x1585ce,_0x176086='\x20'[_0x289675(0x1fe)](_0x556bf3-_0x1c9018[_0x289675(0x1c2)]),_0x3dbc27=_0x176086+a42_0x48c95c[_0x289675(0x1b5)](_0x1c9018)+'\x20'+_0x7b2530;_0x48cfbb[_0x289675(0x2e5)](_0x3dbc27);const _0x1d1620=0x16;let _0x391b34=0x0;for(const _0x4712ba of _0x522854){const _0x458180=_0x4712ba['session'][_0x289675(0x1f7)]?.[_0x289675(0x30f)]||'?',_0x29b747=Math[_0x289675(0x225)](stringWidth(_0x458180),_0x1d1620);_0x391b34=Math['max'](_0x391b34,_0x29b747);}for(const _0xeabe9b of _0x522854){const {session:_0x2b4e98,startTime:_0x2a5819,endTime:_0x2c7ebf,duration:_0x47aa19}=_0xeabe9b,_0x432efb=_0x2b4e98[_0x289675(0x1f7)]?.['id'],_0x24cfdd=_0x2b4e98['id'],_0x431175=_0x2b4e98[_0x289675(0x1f7)]?.[_0x289675(0x30f)]||'?',_0x110de5=_0x2b4e98[_0x289675(0x2aa)]?.['name']||'?';let _0x5ce43b,_0x5fbe28;if(_0x2b4e98['lastAttempt']){const _0x3d756a=_0x2b4e98['lastAttempt'];!_0x3d756a[_0x289675(0x1b4)]?(_0x5ce43b=_0x3d756a[_0x289675(0x2b2)]?'🛑':'🔄',_0x5fbe28=_0x3d756a[_0x289675(0x2b2)]?a42_0x48c95c[_0x289675(0x29e)]:a42_0x48c95c['blue']):(_0x5ce43b=_0x3d756a[_0x289675(0x266)]?'✅':'❌',_0x5fbe28=_0x3d756a[_0x289675(0x266)]?a42_0x48c95c[_0x289675(0x279)]:a42_0x48c95c[_0x289675(0x196)]);}else _0x5ce43b='⏳',_0x5fbe28=a42_0x48c95c[_0x289675(0x1b5)];const _0x387517='#'+_0x24cfdd,_0x32f426=_0x432efb?hyperlink(_0x387517,getWorkflowSessionUrl(_0x33696f,_0x432efb,_0x24cfdd)):_0x387517;let _0x10da74=_0x431175;stringWidth(_0x431175)>_0x1d1620&&(_0x10da74=_0x431175['slice'](0x0,_0x1d1620-0x1)+'…');const _0x33a55a=a42_0x48c95c[_0x289675(0x1b5)](_0x10da74),_0x488e43=stringWidth(_0x10da74),_0x319b8c='\x20'['repeat'](_0x391b34-stringWidth(_0x10da74)+0x2),_0x22a523='('+formatElapsed(_0x47aa19)+')',_0x1f9c30=stringWidth(_0x22a523),_0x36b17a=stringWidth(_0x387517),_0x22c80b=_0x36b17a+0x1+_0x488e43+_0x319b8c[_0x289675(0x1c2)],_0x2cffcb=_0x1585ce-_0x22c80b-_0x1f9c30-0x1-0x8;let _0x23e18d=_0x110de5;stringWidth(_0x23e18d)>_0x2cffcb&&(_0x23e18d=_0x23e18d[_0x289675(0x1de)](0x0,_0x2cffcb-0x1)+'…');const _0x537d4c=_0x32f426+'\x20'+_0x33a55a+_0x319b8c+_0x23e18d,_0x3c7b98=stringWidth(_0x537d4c),_0x4bcee0=_0x1585ce-_0x3c7b98-_0x1f9c30,_0x27ed8b=_0x537d4c+'\x20'[_0x289675(0x1fe)](Math[_0x289675(0x303)](0x1,_0x4bcee0))+a42_0x48c95c[_0x289675(0x1b5)](_0x22a523),_0x2a71ee=Math['floor']((_0x2a5819-_0x5abf06)/_0x26cc7b),_0x44f222=Math[_0x289675(0x1e4)]((_0x2c7ebf-_0x5abf06)/_0x26cc7b),_0x1e00f1=Math[_0x289675(0x303)](_0x2a71ee+0x1,_0x44f222),_0x279fc3=new Array(_0x4b9f51)[_0x289675(0x2a3)]('\x20');for(let _0x2d6ed3=_0x2a71ee;_0x2d6ed3<Math['min'](_0x1e00f1,_0x4b9f51);_0x2d6ed3++){_0x279fc3[_0x2d6ed3]='─';}const _0x2df2f2=_0x279fc3[_0x289675(0x262)](_0x37b65a=>_0x37b65a==='\x20'?'\x20':_0x5fbe28(_0x37b65a))[_0x289675(0x1c6)]('');_0x48cfbb[_0x289675(0x2e5)](_0x5ce43b+'\x20'+_0x27ed8b+'│'+_0x2df2f2+'│');}return _0x48cfbb[_0x289675(0x1c6)]('\x0a');}async[a42_0x3bd9b9(0x20a)](_0x3a6e0f,_0x500704,_0x18aa5e){const _0x3054bc=a42_0x3bd9b9,{options:_0x2e7522,tdx:_0x4b3032}=_0x500704,_0x26efcb=_0x2e7522[_0x3054bc(0x249)],{timelineRows:_0x4f5b6c,timeAxisHeader:_0x21993c}=this['generateSessionTimelineRows'](_0x3a6e0f,_0x26efcb),_0x48f6bb=_0x4f5b6c[_0x3054bc(0x2fe)](_0x31b15a=>_0x31b15a[_0x3054bc(0x2cb)]);if(_0x48f6bb[_0x3054bc(0x1c2)]===0x0){const _0x3bbe60=this['renderSessionsTimeline'](_0x3a6e0f,_0x26efcb);console[_0x3054bc(0x276)](_0x3bbe60);!_0x18aa5e&&(console[_0x3054bc(0x239)](''),console[_0x3054bc(0x239)](a42_0x48c95c[_0x3054bc(0x1b5)](_0x3054bc(0x30d))),console[_0x3054bc(0x239)](a42_0x48c95c['dim'](_0x3054bc(0x1c9))+'or'+a42_0x48c95c[_0x3054bc(0x1b5)](_0x3054bc(0x273))));return;}_0x21993c&&console[_0x3054bc(0x276)](_0x21993c);const _0x38e739=_0x4f5b6c[_0x3054bc(0x2fe)](_0x2b78de=>_0x2b78de[_0x3054bc(0x2cb)])[_0x3054bc(0x262)](_0x422cca=>({'title':_0x422cca['displayLine'],'value':_0x422cca[_0x3054bc(0x2cb)]})),_0x40f5d3=process['stdout'][_0x3054bc(0x22e)]||0x3c,_0x1ba9a8=Math[_0x3054bc(0x303)](0x28,Math[_0x3054bc(0x1e4)](_0x40f5d3*0x2/0x3)),_0x530f03=await a42_0x1933bf({'type':_0x3054bc(0x2c5),'name':_0x3054bc(0x2cb),'message':_0x3054bc(0x322),'choices':_0x38e739,'initial':-0x1,'limit':_0x1ba9a8,'clearFirst':!![],'fallback':{'title':_0x3054bc(0x218),'value':null},'suggest':(_0x8c11a9,_0x240b21)=>{const _0x58bf48=_0x3054bc;if(!_0x8c11a9)return Promise[_0x58bf48(0x2b5)](_0x240b21);const _0x300009=_0x240b21[_0x58bf48(0x2fe)](_0xb567f2=>{const _0x4855ba=_0x58bf48,_0x223b60=_0xb567f2;return _0x223b60[_0x4855ba(0x312)][_0x4855ba(0x1f4)]()[_0x4855ba(0x292)](_0x8c11a9[_0x4855ba(0x1f4)]());});return Promise[_0x58bf48(0x2b5)](_0x300009);}}),_0xa038b3=()=>{const _0x12fd6a=_0x3054bc;process[_0x12fd6a(0x2e8)][_0x12fd6a(0x2be)](_0x12fd6a(0x2a6)),process[_0x12fd6a(0x2e8)][_0x12fd6a(0x2be)](_0x12fd6a(0x2a6)),process[_0x12fd6a(0x2e8)][_0x12fd6a(0x2be)](_0x12fd6a(0x2a6));},_0x58d6c6=_0x530f03&&_0x530f03['attemptId']&&_0x530f03['attemptId']!==null&&_0x530f03[_0x3054bc(0x2cb)][_0x3054bc(0x1e1)]()!=='';if(!_0x58d6c6){_0xa038b3(),console['log'](a42_0x48c95c[_0x3054bc(0x1b5)](_0x3054bc(0x299)));return;}_0xa038b3();const _0x383929=_0x3a6e0f[_0x3054bc(0x231)](_0x149852=>_0x149852[_0x3054bc(0x270)]?.['id']===_0x530f03[_0x3054bc(0x2cb)]);if(_0x383929){const _0x472b6d=_0x383929[_0x3054bc(0x1f7)]?.['name']||'?',_0x275b8a=_0x383929[_0x3054bc(0x2aa)]?.[_0x3054bc(0x30f)]||'?';console[_0x3054bc(0x276)](_0x3054bc(0x2b9)+a42_0x48c95c[_0x3054bc(0x1b5)](_0x472b6d)+',\x20Workflow:\x20'+a42_0x48c95c['dim'](_0x275b8a));}const _0x5e3c26=new WorkflowTimelineCommand();await _0x5e3c26[_0x3054bc(0x1a9)]({'args':[],'options':{..._0x2e7522,'attemptId':_0x530f03[_0x3054bc(0x2cb)]},'tdx':_0x4b3032});}[a42_0x3bd9b9(0x31c)](_0xa6687e,_0x2c4214){const _0x5e45a0=a42_0x3bd9b9,_0x3295fc=new Map();for(const _0x28db9c of _0xa6687e){_0x28db9c['id']&&_0x28db9c['lastAttempt']?.['id']&&_0x3295fc[_0x5e45a0(0x1a4)](_0x28db9c['id'],_0x28db9c[_0x5e45a0(0x270)]['id']);}const _0x314cc7=[];let _0x28617e='';const _0xea36c1=this[_0x5e45a0(0x1a3)](_0xa6687e,_0x2c4214),_0x2c8291=_0xea36c1[_0x5e45a0(0x21b)]('\x0a');for(const _0x79aa9e of _0x2c8291){if(_0x79aa9e[_0x5e45a0(0x24d)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x79aa9e['match'](/^\s+\d{4}-\d{2}-\d{2}/))_0x28617e=_0x79aa9e;else{if(_0x79aa9e[_0x5e45a0(0x1f2)](/^[✅❌🔄🛑⏳]/)){const _0x38d15f=_0x79aa9e[_0x5e45a0(0x1f2)](/#(\d+)/),_0x445894=_0x38d15f?_0x38d15f[0x1]:null,_0x593383=_0x445894?_0x3295fc[_0x5e45a0(0x1cf)](_0x445894)||null:null,_0x4fec36=_0xa6687e[_0x5e45a0(0x231)](_0x5eafd2=>_0x5eafd2['id']===_0x445894),_0x36b4a6=_0x4fec36?.[_0x5e45a0(0x1f7)]?.[_0x5e45a0(0x30f)]||'';_0x314cc7[_0x5e45a0(0x2e5)]({'displayLine':_0x79aa9e,'attemptId':_0x593383,'projectName':_0x36b4a6});}}}return{'timelineRows':_0x314cc7,'timeAxisHeader':_0x28617e};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a42_0x3bd9b9(0x30f)]='workflow:attempts';['description']=a42_0x3bd9b9(0x1b8);async[a42_0x3bd9b9(0x1a9)](_0xdafa85){const _0x353370=a42_0x3bd9b9,{options:_0x3a8da9,args:_0x5f2893,tdx:_0x1f4d7b}=_0xdafa85,_0x360056=this[_0x353370(0x1d2)](_0x5f2893,_0x3a8da9);if(!_0x360056)return 0x1;const {projectName:_0x56d05d,workflowName:_0x4b4fbe}=_0x360056,_0x3838a9=_0x3a8da9[_0x353370(0x22f)];if(_0x3a8da9['verbose']){if(_0x56d05d&&_0x4b4fbe)console[_0x353370(0x239)](_0x353370(0x26a)+_0x56d05d+'.'+_0x4b4fbe);else _0x56d05d&&console[_0x353370(0x239)](_0x353370(0x18f)+_0x56d05d);_0x3838a9&&console[_0x353370(0x239)](_0x353370(0x1dd));}const _0x332c07=await withSpinner(_0x353370(0x280),()=>_0x1f4d7b[_0x353370(0x2aa)]['attempts']({'projectName':_0x56d05d,'workflowName':_0x4b4fbe,'includeRetried':_0x3838a9,'limit':_0x3a8da9[_0x353370(0x190)]}),{'verbose':_0x3a8da9[_0x353370(0x2d1)]}),_0xbb6edb=_0x332c07[_0x353370(0x2c9)],_0x12800d=_0x3a8da9[_0x353370(0x190)]||0x64,_0x5d98b2=_0xbb6edb[_0x353370(0x1c2)]>=_0x12800d?a42_0x48c95c[_0x353370(0x1b5)](_0x353370(0x232)):'';console[_0x353370(0x239)](_0x353370(0x1f8)+_0xbb6edb['length']+_0x353370(0x2a8)+(_0xbb6edb[_0x353370(0x1c2)]!==0x1?'s':'')+_0x5d98b2);if(_0x3a8da9[_0x353370(0x185)]===_0x353370(0x28f)||_0x3a8da9['format']==='jsonl'||_0x3a8da9[_0x353370(0x185)]===_0x353370(0x269))await handleSDKOutput(_0xbb6edb,_0x3a8da9);else{if(_0xbb6edb[_0x353370(0x1c2)]===0x0){if(_0x56d05d&&_0x4b4fbe)console[_0x353370(0x276)]('No\x20attempts\x20found\x20for:\x20'+_0x56d05d+'.'+_0x4b4fbe);else _0x56d05d?console[_0x353370(0x276)](_0x353370(0x18c)+_0x56d05d):console['log'](_0x353370(0x265));}else{const _0x80cb03=_0x3a8da9[_0x353370(0x249)],_0x5a8a43=_0xbb6edb[_0x353370(0x262)](_0x30bad9=>{const _0x3f6583=_0x353370,_0x3c6a7e=a42_0x48c95c[_0x3f6583(0x1b5)]('#'+_0x30bad9['id']),_0x3e8771=_0x30bad9[_0x3f6583(0x1f7)]?.['id'],_0x436800=_0x30bad9['session_id']||_0x30bad9['sessionId'],_0x8a0d68=_0x3e8771&&_0x436800?hyperlink(_0x3c6a7e,getWorkflowAttemptUrl(_0x80cb03,_0x3e8771,_0x436800,_0x30bad9['id'])):_0x3c6a7e,{icon:_0x240c73,text:_0x9dc51d}=getAttemptStatusDisplay(_0x30bad9),_0x1f2dad=(_0x30bad9['project']?.[_0x3f6583(0x30f)]||'?')+'.'+(_0x30bad9[_0x3f6583(0x2aa)]?.[_0x3f6583(0x30f)]||'?'),_0x27de7a=_0x30bad9[_0x3f6583(0x29a)]?a42_0x48c95c[_0x3f6583(0x1b5)](_0x30bad9[_0x3f6583(0x29a)]):'';return(_0x8a0d68+'\x20'+_0x240c73+(_0x9dc51d?'\x20'+_0x9dc51d:'')+'\x20'+_0x1f2dad+'\x20'+_0x27de7a)[_0x3f6583(0x1ef)]();});await writeOutput(_0x5a8a43[_0x353370(0x1c6)]('\x0a'),_0x3a8da9[_0x353370(0x316)],_0x353370(0x23f));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a42_0x3bd9b9(0x30f)]=a42_0x3bd9b9(0x2a5);[a42_0x3bd9b9(0x1cb)]=a42_0x3bd9b9(0x1cc);async[a42_0x3bd9b9(0x1a9)](_0xce29f4){const _0x4a8531=a42_0x3bd9b9,{options:_0x5643de,args:_0x14a6f6,tdx:_0x169582}=_0xce29f4,_0x90e383=_0x14a6f6[0x0];if(!_0x90e383)return console[_0x4a8531(0x239)](_0x4a8531(0x20d)),0x1;_0x5643de[_0x4a8531(0x2d1)]&&console[_0x4a8531(0x239)]('Attempt\x20ID:\x20'+_0x90e383);const _0x17fa6a=await withSpinner(_0x4a8531(0x29c),()=>_0x169582[_0x4a8531(0x2aa)][_0x4a8531(0x183)](_0x90e383),{'verbose':_0x5643de[_0x4a8531(0x2d1)]}),_0x5eb1f8=_0x17fa6a[_0x4a8531(0x2c9)];let _0x4f3e72;!_0x5eb1f8[_0x4a8531(0x1b4)]?_0x4f3e72=_0x5eb1f8[_0x4a8531(0x2b2)]?_0x4a8531(0x258):'running':_0x4f3e72=_0x5eb1f8[_0x4a8531(0x266)]?_0x4a8531(0x266):_0x4a8531(0x239);let _0x43517e;if(_0x5eb1f8['createdAt']&&_0x5eb1f8[_0x4a8531(0x2dc)]){const _0x36666f=new Date(_0x5eb1f8[_0x4a8531(0x1ee)])['getTime'](),_0x516dc6=new Date(_0x5eb1f8[_0x4a8531(0x2dc)])[_0x4a8531(0x22d)]();_0x43517e=Math[_0x4a8531(0x2b6)]((_0x516dc6-_0x36666f)/0x3e8);}const _0x41b558={'attempt_id':_0x5eb1f8['id'],'status':_0x4f3e72,..._0x5eb1f8[_0x4a8531(0x2d4)]!==undefined&&{'index':_0x5eb1f8[_0x4a8531(0x2d4)]},..._0x5eb1f8[_0x4a8531(0x1f7)]&&{'project':_0x5eb1f8[_0x4a8531(0x1f7)][_0x4a8531(0x30f)]},..._0x5eb1f8[_0x4a8531(0x2aa)]&&{'workflow':_0x5eb1f8[_0x4a8531(0x2aa)][_0x4a8531(0x30f)]},..._0x5eb1f8['sessionId']&&{'session_id':_0x5eb1f8[_0x4a8531(0x277)]},..._0x5eb1f8['sessionTime']&&{'session_time':_0x5eb1f8['sessionTime']},..._0x5eb1f8['retryAttemptName']&&{'retry_attempt':_0x5eb1f8[_0x4a8531(0x242)]},..._0x43517e!==undefined&&{'duration_sec':_0x43517e},..._0x5eb1f8[_0x4a8531(0x1ee)]&&{'created_at':_0x5eb1f8['createdAt']},..._0x5eb1f8[_0x4a8531(0x2dc)]&&{'finished_at':_0x5eb1f8[_0x4a8531(0x2dc)]},...Object['keys'](_0x5eb1f8[_0x4a8531(0x1ff)])[_0x4a8531(0x1c2)]>0x0&&{'params':_0x5eb1f8['params']}};return await handleSingleObjectOutput(_0x41b558,_0x5643de),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a42_0x3bd9b9(0x2ef);[a42_0x3bd9b9(0x1cb)]=a42_0x3bd9b9(0x2fa);async[a42_0x3bd9b9(0x1a9)](_0x3fc53f){const _0x4bf06f=a42_0x3bd9b9,{options:_0x8762ea,args:_0x3b6cc4,tdx:_0x59e12}=_0x3fc53f,_0x292838=_0x3b6cc4[0x0];if(!_0x292838)return console[_0x4bf06f(0x239)](_0x4bf06f(0x20d)),0x1;const _0x2050e4=_0x8762ea[_0x4bf06f(0x30a)];_0x8762ea['verbose']&&(console['error'](_0x4bf06f(0x305)+_0x292838),_0x2050e4&&console['error'](_0x4bf06f(0x325)));const _0x3b8d7f=await withSpinner(_0x4bf06f(0x2d0),()=>_0x59e12['workflow']['tasks'](_0x292838,_0x2050e4||![]),{'verbose':_0x8762ea[_0x4bf06f(0x2d1)]}),_0x1391ac=_0x3b8d7f[_0x4bf06f(0x2c9)];return console[_0x4bf06f(0x239)]('✔\x20Found\x20'+_0x1391ac[_0x4bf06f(0x1c2)]+_0x4bf06f(0x251)+(_0x1391ac[_0x4bf06f(0x1c2)]!==0x1?'s':'')),await handleSDKOutput(_0x1391ac,_0x8762ea),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a42_0x3bd9b9(0x2ea);[a42_0x3bd9b9(0x1cb)]=a42_0x3bd9b9(0x31e);async[a42_0x3bd9b9(0x1a9)](_0x4aea2a){const _0x9fe843=a42_0x3bd9b9,{options:_0x5ba80f,args:_0x312d1f,tdx:_0xd62722}=_0x4aea2a,_0x42c8e4=_0x312d1f[0x0];let _0x53b1d7=_0x312d1f[0x1];if(!_0x42c8e4)return console[_0x9fe843(0x239)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x5ba80f[_0x9fe843(0x2d1)]&&(console[_0x9fe843(0x239)]('Attempt\x20ID:\x20'+_0x42c8e4),_0x53b1d7&&console[_0x9fe843(0x239)](_0x9fe843(0x1b2)+_0x53b1d7));const _0x414edd=await withSpinner(_0x9fe843(0x2d5),()=>_0xd62722[_0x9fe843(0x2aa)][_0x9fe843(0x1b7)](_0x42c8e4,_0x53b1d7),{'verbose':_0x5ba80f[_0x9fe843(0x2d1)]}),_0x20a518=_0x414edd[_0x9fe843(0x2c9)];if(_0x20a518[_0x9fe843(0x1c2)]===0x0)return console[_0x9fe843(0x239)](_0x9fe843(0x281)),0x0;if(!_0x53b1d7&&(_0x5ba80f[_0x9fe843(0x28f)]||_0x5ba80f[_0x9fe843(0x185)]))return await handleSDKOutput(_0x20a518,_0x5ba80f),0x0;if(!_0x53b1d7){const _0x51ce5c=_0x20a518[_0x9fe843(0x262)](_0x431bff=>({'title':_0x431bff[_0x9fe843(0x204)]+'\x20('+formatBytes(_0x431bff[_0x9fe843(0x21f)])+')','value':_0x431bff[_0x9fe843(0x204)]})),_0x421add=await a42_0x1933bf({'type':_0x9fe843(0x248),'name':_0x9fe843(0x2f7),'message':_0x9fe843(0x2ca),'choices':_0x51ce5c});if(!_0x421add[_0x9fe843(0x2f7)])return console[_0x9fe843(0x239)](_0x9fe843(0x299)),0x0;_0x53b1d7=_0x421add[_0x9fe843(0x2f7)];}const _0xe4de96=await withSpinner(_0x9fe843(0x27e),()=>_0xd62722[_0x9fe843(0x2aa)]['logs'](_0x42c8e4,_0x53b1d7),{'verbose':_0x5ba80f['verbose']}),_0x19c57c=_0xe4de96['data'];return _0x19c57c?console[_0x9fe843(0x276)](_0x19c57c):console[_0x9fe843(0x239)](_0x9fe843(0x224)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a42_0x3bd9b9(0x30f)]=a42_0x3bd9b9(0x1c1);['description']=a42_0x3bd9b9(0x20e);async[a42_0x3bd9b9(0x1a9)](_0x3b7095){const _0x102e16=a42_0x3bd9b9,{options:_0x1ace83,args:_0x4a18f3,tdx:_0xc3a209}=_0x3b7095,_0x1a0f45=_0x4a18f3[0x0];if(!_0x1a0f45)return console['error'](_0x102e16(0x20d)),0x1;const _0x5a75bb=_0x1ace83[_0x102e16(0x27b)];_0x1ace83[_0x102e16(0x2d1)]&&(console[_0x102e16(0x239)](_0x102e16(0x305)+_0x1a0f45),_0x5a75bb&&console[_0x102e16(0x239)](_0x102e16(0x329)+_0x5a75bb));if(!_0x1ace83[_0x102e16(0x202)]){if(!isInteractive())return console[_0x102e16(0x239)](a42_0x48c95c[_0x102e16(0x196)](_0x102e16(0x187)),_0x102e16(0x285)),console[_0x102e16(0x239)](a42_0x48c95c[_0x102e16(0x1b5)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x52277e=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x1a0f45+'?');if(!_0x52277e)return console[_0x102e16(0x239)](a42_0x48c95c[_0x102e16(0x29e)](_0x102e16(0x299))),0x1;}const _0x368975=await withSpinner(_0x102e16(0x1f3),()=>_0xc3a209[_0x102e16(0x2aa)][_0x102e16(0x25d)](_0x1a0f45,_0x5a75bb),{'verbose':_0x1ace83[_0x102e16(0x2d1)]}),_0x41a4ed=_0x368975[_0x102e16(0x2c9)];return console[_0x102e16(0x239)]('✔\x20'+_0x41a4ed),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a42_0x3bd9b9(0x30f)]=a42_0x3bd9b9(0x20c);['description']=a42_0x3bd9b9(0x260);async[a42_0x3bd9b9(0x1a9)](_0x19a7a9){const _0x22d51f=a42_0x3bd9b9,{options:_0x427ca2,args:_0x3349b8,tdx:_0x286fc1}=_0x19a7a9,_0x5eae6a=_0x3349b8[0x0];if(!_0x5eae6a)return console[_0x22d51f(0x239)](_0x22d51f(0x29f)),console[_0x22d51f(0x239)](_0x22d51f(0x317)),0x1;let _0x2ec7e8=![],_0x229daf=_0x5eae6a;if(_0x5eae6a['startsWith'](_0x22d51f(0x1d5)))_0x2ec7e8=!![],_0x229daf=_0x5eae6a[_0x22d51f(0x297)](0x8);else{if(_0x5eae6a[_0x22d51f(0x24d)](_0x22d51f(0x236)))_0x2ec7e8=![],_0x229daf=_0x5eae6a[_0x22d51f(0x297)](0x8);else return console[_0x22d51f(0x239)](_0x22d51f(0x320)),console[_0x22d51f(0x239)](_0x22d51f(0x317)),0x1;}const _0x4d6991=_0x427ca2['fromTask'],_0x4ea455=_0x427ca2['resumeFrom'],_0x2ff5e8=_0x427ca2['params'],_0x15fe96=_0x427ca2[_0x22d51f(0x304)];_0x427ca2['verbose']&&(console[_0x22d51f(0x239)](_0x22d51f(0x2d3)+(_0x2ec7e8?'session':_0x22d51f(0x183))+'\x20'+_0x229daf),_0x4d6991&&console[_0x22d51f(0x239)](_0x22d51f(0x2ab)+_0x4d6991),_0x4ea455&&console[_0x22d51f(0x239)](_0x22d51f(0x2d6)+_0x4ea455),_0x2ff5e8&&console[_0x22d51f(0x239)](_0x22d51f(0x184)+_0x2ff5e8),_0x15fe96&&console[_0x22d51f(0x239)]('Force:\x20yes'));let _0x5eafc5;if(_0x2ff5e8)try{if(_0x2ff5e8[_0x22d51f(0x24d)]('@')){const _0x4c37be=await import('fs/promises'),_0x39ebf0=_0x2ff5e8[_0x22d51f(0x297)](0x1),_0x11659f=await _0x4c37be[_0x22d51f(0x1d8)](_0x39ebf0,_0x22d51f(0x182));_0x5eafc5=JSON['parse'](_0x11659f);}else _0x5eafc5=JSON['parse'](_0x2ff5e8);}catch{return console[_0x22d51f(0x239)](_0x22d51f(0x2db)),0x1;}if(!_0x427ca2['yes']){if(!isInteractive())return console[_0x22d51f(0x239)](a42_0x48c95c['red']('\x0aError:'),_0x22d51f(0x285)),console[_0x22d51f(0x239)](a42_0x48c95c['dim'](_0x22d51f(0x246))),0x1;const _0x52de72=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x2ec7e8?_0x22d51f(0x245):_0x22d51f(0x183))+'\x20'+_0x229daf+'?');if(!_0x52de72)return console[_0x22d51f(0x239)](a42_0x48c95c['yellow'](_0x22d51f(0x299))),0x1;}let _0xe26113;_0x2ec7e8?_0xe26113=await withSpinner('Retrying\x20session...',()=>_0x286fc1[_0x22d51f(0x2aa)]['retrySession'](_0x229daf,{'fromTask':_0x4d6991,'retryParams':_0x5eafc5}),{'verbose':_0x427ca2[_0x22d51f(0x2d1)]}):_0xe26113=await withSpinner(_0x22d51f(0x216),()=>_0x286fc1[_0x22d51f(0x2aa)][_0x22d51f(0x32f)](_0x229daf,{'resumeFrom':_0x4ea455,'retryParams':_0x5eafc5,'force':_0x15fe96}),{'verbose':_0x427ca2[_0x22d51f(0x2d1)]});const _0x1e72d5=_0xe26113[_0x22d51f(0x2c9)];return console[_0x22d51f(0x239)](_0x22d51f(0x2d8)),console[_0x22d51f(0x239)](_0x22d51f(0x2e7)+_0x1e72d5[_0x22d51f(0x2cb)]),console[_0x22d51f(0x239)](_0x22d51f(0x2b8)+_0x1e72d5['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a42_0x3bd9b9(0x30f)]=a42_0x3bd9b9(0x22c);['description']=a42_0x3bd9b9(0x1e7);async[a42_0x3bd9b9(0x1a9)](_0x565d81){const _0x5b1434=a42_0x3bd9b9,{options:_0x2bdac9,args:_0x560eb0,tdx:_0x5d0f9c}=_0x565d81;let _0x3430ff=_0x560eb0[0x0];if(!_0x3430ff){const _0x5a1266=this[_0x5b1434(0x201)]([],_0x2bdac9),_0x27ed79=await withSpinner(_0x5b1434(0x286),()=>_0x5d0f9c['workflow']['workflows'](_0x5a1266,{'limit':_0x2bdac9[_0x5b1434(0x190)]}),{'verbose':_0x2bdac9['verbose']}),_0x435bdd=_0x27ed79[_0x5b1434(0x2c9)];if(_0x435bdd[_0x5b1434(0x1c2)]===0x0)return console[_0x5b1434(0x239)](_0x5b1434(0x219)),!_0x5a1266&&console[_0x5b1434(0x239)](a42_0x48c95c[_0x5b1434(0x1b5)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x4d546b=_0x435bdd[_0x5b1434(0x262)](_0x261da4=>({'title':_0x261da4[_0x5b1434(0x1f7)]?.[_0x5b1434(0x30f)]+'.'+_0x261da4[_0x5b1434(0x30f)],'value':_0x261da4['project']?.[_0x5b1434(0x30f)]+'.'+_0x261da4['name'],'description':_0x261da4[_0x5b1434(0x2f0)]?_0x5b1434(0x227)+_0x261da4['revision']:undefined})),_0x23ad45=await a42_0x1933bf({'type':_0x5b1434(0x248),'name':_0x5b1434(0x2aa),'message':_0x5b1434(0x2ba),'choices':_0x4d546b});if(!_0x23ad45[_0x5b1434(0x2aa)])return 0x1;_0x3430ff=_0x23ad45[_0x5b1434(0x2aa)];}if(!_0x3430ff[_0x5b1434(0x292)]('.')){const _0x58c17e=this['resolveProject']([],_0x2bdac9);if(_0x58c17e)_0x3430ff=_0x58c17e+'.'+_0x3430ff;else return console[_0x5b1434(0x239)](a42_0x48c95c[_0x5b1434(0x196)](_0x5b1434(0x215)),_0x5b1434(0x274)),console['error'](a42_0x48c95c[_0x5b1434(0x1b5)](_0x5b1434(0x26d))),0x1;}const _0xf6eac8=_0x2bdac9[_0x5b1434(0x1d9)],_0x5cab15=_0x2bdac9[_0x5b1434(0x29a)],_0x1803b4={};if(_0xf6eac8&&Array[_0x5b1434(0x2a0)](_0xf6eac8))for(const _0x3230ec of _0xf6eac8){const _0x498413=_0x3230ec[_0x5b1434(0x181)]('=');if(_0x498413===-0x1)return console['error'](_0x5b1434(0x29b)+_0x3230ec),console[_0x5b1434(0x239)](_0x5b1434(0x1c5)),0x1;const _0x30ec7b=_0x3230ec[_0x5b1434(0x297)](0x0,_0x498413),_0x502717=_0x3230ec[_0x5b1434(0x297)](_0x498413+0x1);try{_0x1803b4[_0x30ec7b]=JSON[_0x5b1434(0x2c8)](_0x502717);}catch{_0x1803b4[_0x30ec7b]=_0x502717;}}_0x2bdac9[_0x5b1434(0x2d1)]&&(console[_0x5b1434(0x239)](_0x5b1434(0x217)+_0x3430ff),Object[_0x5b1434(0x271)](_0x1803b4)['length']>0x0&&console['error'](_0x5b1434(0x31a)+JSON['stringify'](_0x1803b4)),_0x5cab15&&console[_0x5b1434(0x239)](_0x5b1434(0x1e9)+_0x5cab15));const _0x4c19a0=await withSpinner('Starting\x20workflow\x20run...',()=>_0x5d0f9c['workflow'][_0x5b1434(0x267)](_0x3430ff,_0x1803b4,{'sessionTime':_0x5cab15}),{'verbose':_0x2bdac9[_0x5b1434(0x2d1)]}),_0x44df37=_0x4c19a0['data'];console[_0x5b1434(0x239)]('✔\x20Workflow\x20run\x20started'),console[_0x5b1434(0x239)](_0x5b1434(0x1ca)+_0x44df37['id']),console[_0x5b1434(0x239)]('\x20\x20Session\x20ID:\x20'+_0x44df37[_0x5b1434(0x277)]),console['error'](_0x5b1434(0x18e)+_0x44df37[_0x5b1434(0x1f7)]?.[_0x5b1434(0x30f)]),console[_0x5b1434(0x239)](_0x5b1434(0x1d4)+_0x44df37[_0x5b1434(0x2aa)]?.[_0x5b1434(0x30f)]);if(_0x44df37[_0x5b1434(0x1f7)]?.['id']&&_0x44df37['sessionId']&&_0x44df37['id']){const _0x2f1fea=_0x2bdac9['site'],_0x577077=getConsoleUrl(_0x2f1fea,_0x5b1434(0x2e4)+_0x44df37[_0x5b1434(0x1f7)]['id']+_0x5b1434(0x22a)+_0x44df37[_0x5b1434(0x277)]+'/attempt/'+_0x44df37['id']);console[_0x5b1434(0x239)](_0x5b1434(0x1fc)+a42_0x48c95c[_0x5b1434(0x2dd)](_0x577077));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a42_0x3bd9b9(0x30f)]=a42_0x3bd9b9(0x31f);[a42_0x3bd9b9(0x1cb)]=a42_0x3bd9b9(0x19b);async[a42_0x3bd9b9(0x1a9)](_0xeb96e3){const _0x492ce9=a42_0x3bd9b9,{options:_0x32cb01,args:_0x4c78f7,tdx:_0x22b18c}=_0xeb96e3,_0x302ef4=_0x4c78f7[0x0],_0x389f73=_0x4c78f7[0x1]||'.';if(!_0x302ef4)return console['error'](_0x492ce9(0x1a0)),console[_0x492ce9(0x239)](_0x492ce9(0x1c7)),0x1;const _0x4ca46a=_0x32cb01['revision'];_0x32cb01[_0x492ce9(0x2d1)]&&(console['error'](_0x492ce9(0x2b9)+_0x302ef4),console[_0x492ce9(0x239)](_0x492ce9(0x253)+_0x389f73),_0x4ca46a&&console[_0x492ce9(0x239)]('Revision:\x20'+_0x4ca46a));const _0x51619e=await withSpinner(_0x492ce9(0x293)+_0x302ef4+_0x492ce9(0x2cd),()=>_0x22b18c[_0x492ce9(0x2aa)][_0x492ce9(0x321)](_0x302ef4,_0x389f73,{'revision':_0x4ca46a}),{'verbose':_0x32cb01[_0x492ce9(0x2d1)]}),_0x1a5f24=_0x51619e[_0x492ce9(0x2c9)];return console['error'](_0x492ce9(0x191)+_0x1a5f24[_0x492ce9(0x24c)]),console['error'](_0x492ce9(0x2c4)+_0x1a5f24[_0x492ce9(0x2f0)]),console[_0x492ce9(0x239)](_0x492ce9(0x268)+_0x1a5f24[_0x492ce9(0x2bb)]),console['error']('\x20\x20Location:\x20'+_0x389f73+'/'+_0x1a5f24['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a42_0x3bd9b9(0x30f)]=a42_0x3bd9b9(0x2c0);[a42_0x3bd9b9(0x1cb)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async['execute'](_0x316321){const _0x4524c3=a42_0x3bd9b9,{options:_0xeedbbf,args:_0xc357df,tdx:_0x5d696d}=_0x316321;let _0x2276a1='.',_0x27ca6c=_0xeedbbf[_0x4524c3(0x30f)];if(_0xc357df[0x0]){const {promises:_0x17ce4f}=await import('fs');try{const _0x5baeca=await _0x17ce4f[_0x4524c3(0x189)](_0xc357df[0x0]);if(_0x5baeca[_0x4524c3(0x21c)]())_0x2276a1=_0xc357df[0x0];else return console[_0x4524c3(0x239)]('Error:\x20'+_0xc357df[0x0]+_0x4524c3(0x1f1)),0x1;}catch{_0x27ca6c=_0xc357df[0x0],_0x2276a1='.';}}const _0x1a481f=_0xeedbbf[_0x4524c3(0x2f0)],_0x1d9101=_0xeedbbf[_0x4524c3(0x282)];_0xeedbbf[_0x4524c3(0x2d1)]&&(console[_0x4524c3(0x239)](_0x4524c3(0x261)+_0x2276a1),_0x27ca6c&&console[_0x4524c3(0x239)](_0x4524c3(0x2b0)+_0x27ca6c),_0x1a481f&&console['error']('Revision:\x20'+_0x1a481f),_0x1d9101&&console['error'](_0x4524c3(0x1ce)));const _0x154943=await withSpinner(_0x4524c3(0x1ae),()=>_0x5d696d[_0x4524c3(0x2aa)][_0x4524c3(0x2e5)](_0x2276a1,{'projectName':_0x27ca6c,'revision':_0x1a481f,'skipValidation':_0x1d9101}),{'verbose':_0xeedbbf[_0x4524c3(0x2d1)]}),_0x4fd520=_0x154943['data'];return console[_0x4524c3(0x239)](_0x4524c3(0x2e9)+_0x4fd520[_0x4524c3(0x24c)]),console[_0x4524c3(0x239)](_0x4524c3(0x2b7)+_0x4fd520[_0x4524c3(0x1df)]),console[_0x4524c3(0x239)]('\x20\x20Revision:\x20'+_0x4fd520[_0x4524c3(0x2f0)]),await this[_0x4524c3(0x1c3)](_0x5d696d,_0x4fd520['projectName'],_0xeedbbf[_0x4524c3(0x249)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a42_0x3bd9b9(0x30f)]=a42_0x3bd9b9(0x1a5);[a42_0x3bd9b9(0x1cb)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async['execute'](_0x42ac3d){const _0x575f70=a42_0x3bd9b9,{options:_0x4ca51b,args:_0x563f1d,tdx:_0xabbff7}=_0x42ac3d,_0x288be5=_0x563f1d[0x0],_0x1082c2=_0x563f1d[0x1];if(!_0x288be5)return console[_0x575f70(0x239)](a42_0x48c95c[_0x575f70(0x196)](_0x575f70(0x215)),'Project\x20name\x20is\x20required'),console[_0x575f70(0x239)](a42_0x48c95c['dim']('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x2db4da=_0x4ca51b[_0x575f70(0x2f0)];_0x4ca51b[_0x575f70(0x2d1)]&&(console['error'](_0x575f70(0x2b9)+_0x288be5),_0x1082c2&&console[_0x575f70(0x239)]('Target\x20directory:\x20'+_0x1082c2),_0x2db4da&&console[_0x575f70(0x239)]('Revision:\x20'+_0x2db4da),_0x4ca51b['dryRun']&&console[_0x575f70(0x239)]('Dry\x20run:\x20yes'));const _0x421d22=await withSpinner(_0x575f70(0x2e6)+_0x288be5+_0x575f70(0x2cd),()=>_0xabbff7[_0x575f70(0x2aa)][_0x575f70(0x313)](_0x288be5,{'targetDir':_0x1082c2,'revision':_0x2db4da}),{'verbose':_0x4ca51b[_0x575f70(0x2d1)]}),_0xb7d90d=_0x421d22[_0x575f70(0x2c9)];_0xb7d90d[_0x575f70(0x32b)]?console['error'](_0x575f70(0x234)+_0xb7d90d[_0x575f70(0x24c)]):console[_0x575f70(0x239)](_0x575f70(0x1bf)+_0xb7d90d[_0x575f70(0x24c)]);console[_0x575f70(0x239)]('\x20\x20Revision:\x20'+_0xb7d90d['revision']),console['error'](_0x575f70(0x2f9)+(a42_0x50631b[_0x575f70(0x19d)](process[_0x575f70(0x252)](),_0xb7d90d[_0x575f70(0x2a2)])||'.')),console['error'](_0x575f70(0x24a)+a42_0x48c95c[_0x575f70(0x279)]('+'+_0xb7d90d[_0x575f70(0x212)][_0x575f70(0x1e2)]+_0x575f70(0x21d))+',\x20'+(a42_0x48c95c[_0x575f70(0x29e)]('~'+_0xb7d90d[_0x575f70(0x212)]['modified']+'\x20modified')+',\x20')+(a42_0x48c95c['red']('-'+_0xb7d90d[_0x575f70(0x212)][_0x575f70(0x296)]+_0x575f70(0x2af))+',\x20')+(''+a42_0x48c95c[_0x575f70(0x1b5)](_0xb7d90d[_0x575f70(0x212)][_0x575f70(0x199)]+'\x20unchanged')));for(const _0x3ea70d of _0xb7d90d[_0x575f70(0x21e)]){_0x3ea70d[_0x575f70(0x1f0)]===_0x575f70(0x188)&&_0x3ea70d[_0x575f70(0x244)]&&(console[_0x575f70(0x239)]('\x0a'+a42_0x48c95c[_0x575f70(0x2dd)]('---\x20'+_0x3ea70d[_0x575f70(0x205)])),console['error'](_0x3ea70d[_0x575f70(0x244)]));}if(!_0xb7d90d[_0x575f70(0x309)])return saveSessionContext({'workflow_project':_0xb7d90d[_0x575f70(0x24c)]},_0x4ca51b['session']),console[_0x575f70(0x239)](a42_0x48c95c[_0x575f70(0x279)]('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x575f70(0x239)](a42_0x48c95c[_0x575f70(0x1b5)](_0x575f70(0x2ee)+_0xb7d90d[_0x575f70(0x24c)])),0x0;if(_0x4ca51b[_0x575f70(0x283)])return console[_0x575f70(0x239)](a42_0x48c95c[_0x575f70(0x29e)](_0x575f70(0x226))),0x0;if(!_0x4ca51b[_0x575f70(0x202)]){if(!isInteractive())return console['error'](a42_0x48c95c[_0x575f70(0x196)](_0x575f70(0x187)),_0x575f70(0x285)),console[_0x575f70(0x239)](a42_0x48c95c[_0x575f70(0x1b5)](_0x575f70(0x246))),0x1;const _0x25b0e5=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x25b0e5)return console['error'](a42_0x48c95c['yellow']('Cancelled'),_0x575f70(0x2fb)),0x1;}await withSpinner(_0x575f70(0x193),()=>_0xabbff7[_0x575f70(0x2aa)][_0x575f70(0x32c)](_0xb7d90d,{'revision':_0x2db4da}),{'verbose':_0x4ca51b[_0x575f70(0x2d1)]}),saveSessionContext({'workflow_project':_0xb7d90d[_0x575f70(0x24c)]},_0x4ca51b['session']),console['error'](a42_0x48c95c[_0x575f70(0x279)](_0x575f70(0x324)));const _0x2d28a4=a42_0x50631b[_0x575f70(0x19d)](process[_0x575f70(0x252)](),_0xb7d90d['targetDir'])||'.';return console['error'](a42_0x48c95c[_0x575f70(0x1b5)](_0x575f70(0x26f)+_0x2d28a4)),console['error'](a42_0x48c95c['dim'](_0x575f70(0x2ee)+_0xb7d90d[_0x575f70(0x24c)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a42_0x3bd9b9(0x278);[a42_0x3bd9b9(0x1cb)]=a42_0x3bd9b9(0x27c);async[a42_0x3bd9b9(0x1a9)](_0x4a8afd){const _0x3c2675=a42_0x3bd9b9,{options:_0x586543,args:_0x13cd33,tdx:_0x29eda6}=_0x4a8afd,_0xe2269e=this[_0x3c2675(0x2fd)](_0x13cd33,_0x586543),_0x2f49b4=_0x586543[_0x3c2675(0x2f0)],_0x3bee3b=_0x586543['skipValidation'];_0x586543[_0x3c2675(0x2d1)]&&(_0xe2269e&&console[_0x3c2675(0x239)](_0x3c2675(0x1b3)+_0xe2269e),_0x2f49b4&&console[_0x3c2675(0x239)](_0x3c2675(0x2c7)+_0x2f49b4),_0x586543[_0x3c2675(0x283)]&&console[_0x3c2675(0x239)](_0x3c2675(0x210)),_0x3bee3b&&console['error'](_0x3c2675(0x1ce)));let _0x2b2404;try{_0x2b2404=await withSpinner('Analyzing\x20changes...',()=>_0x29eda6[_0x3c2675(0x2aa)]['preparePushProject']({'sourceDir':_0xe2269e,'revision':_0x2f49b4,'skipValidation':_0x3bee3b}),{'verbose':_0x586543[_0x3c2675(0x2d1)]});}catch(_0x5e9aab){if(_0x5e9aab instanceof Error&&_0x5e9aab[_0x3c2675(0x32e)][_0x3c2675(0x292)](_0x3c2675(0x222)))return console[_0x3c2675(0x239)](a42_0x48c95c[_0x3c2675(0x196)](_0x3c2675(0x215)),_0x3c2675(0x20b)),_0x586543[_0x3c2675(0x1a1)]?console[_0x3c2675(0x239)](a42_0x48c95c[_0x3c2675(0x1b5)]('Tip:\x20cd\x20to\x20workflows/'+_0x586543[_0x3c2675(0x1a1)]+_0x3c2675(0x28b)+_0x586543[_0x3c2675(0x1a1)]+'\x27')):console[_0x3c2675(0x239)](a42_0x48c95c[_0x3c2675(0x1b5)](_0x3c2675(0x233))),0x1;throw _0x5e9aab;}const _0x979268=_0x2b2404[_0x3c2675(0x2c9)];console['error'](_0x3c2675(0x18d)+_0x979268[_0x3c2675(0x24c)]),console[_0x3c2675(0x239)]('\x20\x20Source:\x20'+_0x979268['sourceDir']),console[_0x3c2675(0x239)](_0x3c2675(0x2c4)+_0x979268[_0x3c2675(0x2f0)]),console[_0x3c2675(0x239)](_0x3c2675(0x24a)+a42_0x48c95c[_0x3c2675(0x279)]('+'+_0x979268['summary']['new']+_0x3c2675(0x21d))+',\x20'+(a42_0x48c95c[_0x3c2675(0x29e)]('~'+_0x979268['summary'][_0x3c2675(0x188)]+_0x3c2675(0x28e))+',\x20')+(a42_0x48c95c[_0x3c2675(0x196)]('-'+_0x979268[_0x3c2675(0x212)][_0x3c2675(0x296)]+_0x3c2675(0x2af))+',\x20')+(''+a42_0x48c95c['dim'](_0x979268[_0x3c2675(0x212)][_0x3c2675(0x199)]+_0x3c2675(0x1c8))));for(const _0x467a9c of _0x979268[_0x3c2675(0x21e)]){_0x467a9c[_0x3c2675(0x1f0)]===_0x3c2675(0x188)&&_0x467a9c['diff']&&(console['error']('\x0a'+a42_0x48c95c['cyan'](_0x3c2675(0x314)+_0x467a9c[_0x3c2675(0x205)])),console[_0x3c2675(0x239)](_0x467a9c[_0x3c2675(0x244)]));}if(!_0x979268[_0x3c2675(0x309)])return console[_0x3c2675(0x239)](a42_0x48c95c[_0x3c2675(0x279)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x3c2675(0x1c3)](_0x29eda6,_0x979268['projectName'],_0x586543[_0x3c2675(0x249)]),0x0;if(_0x586543[_0x3c2675(0x283)])return console[_0x3c2675(0x239)](a42_0x48c95c[_0x3c2675(0x29e)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x586543[_0x3c2675(0x202)]){if(!isInteractive())return console[_0x3c2675(0x239)](a42_0x48c95c[_0x3c2675(0x196)]('\x0aError:'),_0x3c2675(0x285)),console[_0x3c2675(0x239)](a42_0x48c95c[_0x3c2675(0x1b5)](_0x3c2675(0x246))),0x1;const _0x293687=await confirmKey(_0x3c2675(0x1e5));if(!_0x293687)return console[_0x3c2675(0x239)](a42_0x48c95c[_0x3c2675(0x29e)](_0x3c2675(0x299)),'-\x20nothing\x20pushed'),0x1;}const _0x122410=await withSpinner(_0x3c2675(0x2bf),()=>_0x29eda6[_0x3c2675(0x2aa)]['executePushProject'](_0x979268),{'verbose':_0x586543[_0x3c2675(0x2d1)]}),_0x2c0392=_0x122410[_0x3c2675(0x2c9)];return console[_0x3c2675(0x239)](a42_0x48c95c[_0x3c2675(0x279)](_0x3c2675(0x250))),console[_0x3c2675(0x239)](_0x3c2675(0x2b7)+_0x2c0392[_0x3c2675(0x1df)]),console[_0x3c2675(0x239)](_0x3c2675(0x2c4)+_0x2c0392[_0x3c2675(0x2f0)]),await this[_0x3c2675(0x1c3)](_0x29eda6,_0x2c0392[_0x3c2675(0x24c)],_0x586543[_0x3c2675(0x249)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']='workflow:clone';['description']='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a42_0x3bd9b9(0x1a9)](_0x52a399){const _0x3b7cfa=a42_0x3bd9b9,{options:_0xd28724,args:_0x29edbc,tdx:_0x5b5403}=_0x52a399,_0x86c13c=this['resolveProjectDir'](_0x29edbc,_0xd28724),_0xc39ce2=_0xd28724[_0x3b7cfa(0x30f)],_0x624560=_0xd28724[_0x3b7cfa(0x2f0)],_0x5c3790=_0xd28724[_0x3b7cfa(0x282)];if(!_0x86c13c)return console['error'](a42_0x48c95c[_0x3b7cfa(0x196)]('Error:'),_0x3b7cfa(0x1ed)),console[_0x3b7cfa(0x239)](a42_0x48c95c[_0x3b7cfa(0x1b5)](_0x3b7cfa(0x1e6))),console[_0x3b7cfa(0x239)](a42_0x48c95c[_0x3b7cfa(0x1b5)](_0x3b7cfa(0x254))),0x1;if(!_0xc39ce2)return console[_0x3b7cfa(0x239)](a42_0x48c95c[_0x3b7cfa(0x196)](_0x3b7cfa(0x215)),_0x3b7cfa(0x1a2)),console[_0x3b7cfa(0x239)](a42_0x48c95c['dim'](_0x3b7cfa(0x1e6))),0x1;_0xd28724['verbose']&&(console[_0x3b7cfa(0x239)](_0x3b7cfa(0x1b3)+_0x86c13c),console['error']('New\x20project\x20name:\x20'+_0xc39ce2),_0x624560&&console[_0x3b7cfa(0x239)](_0x3b7cfa(0x2c7)+_0x624560),_0xd28724['dryRun']&&console[_0x3b7cfa(0x239)]('Dry\x20run:\x20yes'),_0x5c3790&&console[_0x3b7cfa(0x239)]('Validation:\x20skipped'));const _0x2df1d9=await withSpinner('Analyzing\x20project...',()=>_0x5b5403[_0x3b7cfa(0x2aa)][_0x3b7cfa(0x207)](_0x86c13c,_0xc39ce2,{'revision':_0x624560,'skipValidation':_0x5c3790}),{'verbose':_0xd28724[_0x3b7cfa(0x2d1)]}),_0x106e61=_0x2df1d9['data'];console[_0x3b7cfa(0x239)](_0x3b7cfa(0x306)+_0x106e61[_0x3b7cfa(0x28d)]);_0x106e61[_0x3b7cfa(0x1a8)]&&console['error']('Source\x20project:\x20'+_0x106e61[_0x3b7cfa(0x1a8)]);console[_0x3b7cfa(0x239)](_0x3b7cfa(0x17f)+_0x106e61['newProjectName']),console[_0x3b7cfa(0x239)](_0x3b7cfa(0x2c7)+_0x106e61[_0x3b7cfa(0x2f0)]),console['error'](_0x3b7cfa(0x255)+_0x106e61[_0x3b7cfa(0x24b)]);_0x106e61[_0x3b7cfa(0x2b4)]&&(console[_0x3b7cfa(0x239)](a42_0x48c95c['yellow'](_0x3b7cfa(0x24f)+_0x106e61[_0x3b7cfa(0x22b)]+_0x3b7cfa(0x310)+_0x106e61[_0x3b7cfa(0x301)]+')')),console[_0x3b7cfa(0x239)](a42_0x48c95c[_0x3b7cfa(0x29e)](_0x3b7cfa(0x23e))));if(_0xd28724['dryRun'])return console['error'](a42_0x48c95c[_0x3b7cfa(0x29e)](_0x3b7cfa(0x263))),0x0;if(!_0xd28724[_0x3b7cfa(0x202)]){if(!isInteractive())return console[_0x3b7cfa(0x239)](a42_0x48c95c[_0x3b7cfa(0x196)](_0x3b7cfa(0x187)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a42_0x48c95c[_0x3b7cfa(0x1b5)](_0x3b7cfa(0x246))),0x1;const _0x26b1c1=_0x106e61[_0x3b7cfa(0x1a8)]||a42_0x50631b['basename'](_0x86c13c),_0x542992=_0x106e61[_0x3b7cfa(0x2b4)]?_0x3b7cfa(0x25c)+_0xc39ce2+_0x3b7cfa(0x1ea):_0x3b7cfa(0x25b)+_0x26b1c1+_0x3b7cfa(0x21a)+_0xc39ce2+'\x22?',_0x2a5e0b=await confirmKey(_0x542992);if(!_0x2a5e0b)return console[_0x3b7cfa(0x239)](a42_0x48c95c[_0x3b7cfa(0x29e)](_0x3b7cfa(0x299))),0x1;}const _0x5b58f9=await withSpinner(_0x106e61[_0x3b7cfa(0x2b4)]?'Updating\x20'+_0xc39ce2+_0x3b7cfa(0x2cd):_0x3b7cfa(0x23d)+_0xc39ce2+_0x3b7cfa(0x2cd),()=>_0x5b5403[_0x3b7cfa(0x2aa)]['executeCloneProject'](_0x106e61),{'verbose':_0xd28724[_0x3b7cfa(0x2d1)]}),_0x3aa8c6=_0x5b58f9[_0x3b7cfa(0x2c9)];return console[_0x3b7cfa(0x239)](a42_0x48c95c['green'](_0x106e61[_0x3b7cfa(0x2b4)]?_0x3b7cfa(0x2bd):_0x3b7cfa(0x1eb))),console[_0x3b7cfa(0x239)](_0x3b7cfa(0x18e)+_0x3aa8c6[_0x3b7cfa(0x22b)]),console['error'](_0x3b7cfa(0x2b7)+_0x3aa8c6['newProjectId']),console[_0x3b7cfa(0x239)](_0x3b7cfa(0x2c4)+_0x3aa8c6[_0x3b7cfa(0x2f0)]),await this[_0x3b7cfa(0x1c3)](_0x5b5403,_0x3aa8c6['newProjectName'],_0xd28724['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a42_0x3bd9b9(0x30f)]=a42_0x3bd9b9(0x198);['description']=a42_0x3bd9b9(0x2ec);async[a42_0x3bd9b9(0x1a9)](_0x2b3210){const _0x43a894=a42_0x3bd9b9,{options:_0x33b968,args:_0x1cdf10,tdx:_0x3d5247}=_0x2b3210,_0x82902f=_0x1cdf10[0x0];if(!_0x82902f)return console[_0x43a894(0x239)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x43a894(0x239)](_0x43a894(0x19c)),0x1;_0x33b968[_0x43a894(0x2d1)]&&console['error'](_0x43a894(0x2b9)+_0x82902f);if(!_0x33b968[_0x43a894(0x202)]){if(!isInteractive())return console[_0x43a894(0x239)](a42_0x48c95c['red']('\x0aError:'),_0x43a894(0x285)),console[_0x43a894(0x239)](a42_0x48c95c[_0x43a894(0x1b5)](_0x43a894(0x246))),0x1;const _0x45497b=await confirmKey(_0x43a894(0x259)+_0x82902f+_0x43a894(0x26e));if(!_0x45497b)return console[_0x43a894(0x239)](a42_0x48c95c[_0x43a894(0x29e)](_0x43a894(0x299))),0x1;}const _0x2212f1=await withSpinner(_0x43a894(0x23a)+_0x82902f+'...',()=>_0x3d5247['workflow'][_0x43a894(0x1cd)](_0x82902f),{'verbose':_0x33b968[_0x43a894(0x2d1)]}),_0x19b2ee=_0x2212f1['data'];return console[_0x43a894(0x239)](_0x43a894(0x1c0)+_0x19b2ee[_0x43a894(0x24c)]),console[_0x43a894(0x239)](_0x43a894(0x2b7)+_0x19b2ee[_0x43a894(0x1df)]),0x0;}}export function parseKeyValue(_0x25c050){const _0x16d38f=a42_0x3bd9b9,_0x5bc80e=_0x25c050[_0x16d38f(0x181)]('=');if(_0x5bc80e===-0x1)throw new Error(_0x16d38f(0x243)+_0x25c050+_0x16d38f(0x275));const _0x116675=_0x25c050[_0x16d38f(0x297)](0x0,_0x5bc80e),_0x220c4d=_0x25c050[_0x16d38f(0x297)](_0x5bc80e+0x1);if(!_0x116675)throw new Error(_0x16d38f(0x1d6));return{'key':_0x116675,'value':_0x220c4d};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a42_0x3bd9b9(0x30f)]=a42_0x3bd9b9(0x291);[a42_0x3bd9b9(0x1cb)]=a42_0x3bd9b9(0x2ae);async[a42_0x3bd9b9(0x1a9)](_0x103fd4){const _0x2fb820=a42_0x3bd9b9,{options:_0x3f218f,args:_0x4bee08,tdx:_0x2371a4}=_0x103fd4,_0x1e5f78=this['requireProject'](_0x4bee08,_0x3f218f);if(!_0x1e5f78)return 0x1;_0x3f218f[_0x2fb820(0x2d1)]&&console[_0x2fb820(0x239)](_0x2fb820(0x2b9)+_0x1e5f78);const _0x14a863=await withSpinner(_0x2fb820(0x2d2),()=>_0x2371a4[_0x2fb820(0x2aa)]['listSecrets'](_0x1e5f78),{'verbose':_0x3f218f[_0x2fb820(0x2d1)]}),{secrets:_0x527aa4}=_0x14a863['data'];return console[_0x2fb820(0x239)](_0x2fb820(0x1f8)+_0x527aa4[_0x2fb820(0x1c2)]+_0x2fb820(0x208)+(_0x527aa4[_0x2fb820(0x1c2)]!==0x1?'s':'')),await handleSDKOutput(_0x527aa4,_0x3f218f),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a42_0x3bd9b9(0x30f)]=a42_0x3bd9b9(0x326);[a42_0x3bd9b9(0x1cb)]=a42_0x3bd9b9(0x323);async[a42_0x3bd9b9(0x1a9)](_0x3ba7e9){const _0x3a0a24=a42_0x3bd9b9,{options:_0x316bbf,args:_0x1fa561,tdx:_0x25f10c}=_0x3ba7e9;let _0x1fe099,_0x3c6872;if(_0x1fa561[_0x3a0a24(0x1c2)]>=0x2)_0x1fe099=_0x1fa561[0x0],_0x3c6872=_0x1fa561[0x1];else{if(_0x1fa561[_0x3a0a24(0x1c2)]===0x1&&_0x316bbf[_0x3a0a24(0x1a1)])_0x1fe099=_0x316bbf[_0x3a0a24(0x1a1)],_0x3c6872=_0x1fa561[0x0];else return _0x1fa561[_0x3a0a24(0x1c2)]===0x1?(console[_0x3a0a24(0x239)](_0x3a0a24(0x1a0)),console[_0x3a0a24(0x239)](_0x3a0a24(0x26d)),0x1):(console['error'](_0x3a0a24(0x213)),console[_0x3a0a24(0x239)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE'),0x1);}let _0x11a38c,_0x1669d3;try{({key:_0x11a38c,value:_0x1669d3}=parseKeyValue(_0x3c6872));}catch(_0x4f2810){return _0x4f2810 instanceof Error&&console[_0x3a0a24(0x239)](a42_0x48c95c[_0x3a0a24(0x196)](_0x3a0a24(0x215)),_0x4f2810[_0x3a0a24(0x32e)]),0x1;}_0x316bbf[_0x3a0a24(0x2d1)]&&(console[_0x3a0a24(0x239)](_0x3a0a24(0x2b9)+_0x1fe099),console['error'](_0x3a0a24(0x1b6)+_0x11a38c));const _0x3ea60e=await withSpinner('Setting\x20secret...',()=>_0x25f10c[_0x3a0a24(0x2aa)]['setSecret'](_0x1fe099,_0x11a38c,_0x1669d3),{'verbose':_0x316bbf[_0x3a0a24(0x2d1)]}),_0x320ca7=_0x3ea60e[_0x3a0a24(0x2c9)];return console[_0x3a0a24(0x239)](_0x3a0a24(0x2b3)+_0x320ca7[_0x3a0a24(0x1c4)]+_0x3a0a24(0x2a1)+_0x320ca7[_0x3a0a24(0x24c)]+'\x27'),(_0x316bbf['json']||_0x316bbf[_0x3a0a24(0x1aa)])&&await handleSingleObjectOutput(_0x320ca7,_0x316bbf),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a42_0x3bd9b9(0x30f)]=a42_0x3bd9b9(0x2bc);[a42_0x3bd9b9(0x1cb)]=a42_0x3bd9b9(0x288);async['execute'](_0x1c7bb5){const _0x34c5c1=a42_0x3bd9b9,{options:_0x2ca4a8,args:_0x83f62f,tdx:_0x1093c8}=_0x1c7bb5;let _0x366302,_0x227554;if(_0x83f62f[_0x34c5c1(0x1c2)]>=0x2)_0x366302=_0x83f62f[0x0],_0x227554=_0x83f62f[0x1];else{if(_0x83f62f[_0x34c5c1(0x1c2)]===0x1&&_0x2ca4a8[_0x34c5c1(0x1a1)])_0x366302=_0x2ca4a8[_0x34c5c1(0x1a1)],_0x227554=_0x83f62f[0x0];else return _0x83f62f['length']===0x1?(console[_0x34c5c1(0x239)](_0x34c5c1(0x1a0)),console[_0x34c5c1(0x239)](_0x34c5c1(0x26d)),0x1):(console[_0x34c5c1(0x239)](_0x34c5c1(0x220)),console[_0x34c5c1(0x239)](_0x34c5c1(0x2b1)),0x1);}_0x2ca4a8[_0x34c5c1(0x2d1)]&&(console[_0x34c5c1(0x239)](_0x34c5c1(0x2b9)+_0x366302),console[_0x34c5c1(0x239)](_0x34c5c1(0x1b6)+_0x227554));if(!_0x2ca4a8[_0x34c5c1(0x202)]){if(!isInteractive())return console['error'](a42_0x48c95c[_0x34c5c1(0x196)](_0x34c5c1(0x187)),_0x34c5c1(0x285)),console[_0x34c5c1(0x239)](a42_0x48c95c['dim'](_0x34c5c1(0x246))),0x1;const _0xb5635d=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x227554+'\x27\x20from\x20project\x20\x27'+_0x366302+'\x27?');if(!_0xb5635d)return console['error'](a42_0x48c95c[_0x34c5c1(0x29e)](_0x34c5c1(0x299))),0x1;}const _0x1b9c95=await withSpinner('Deleting\x20secret...',()=>_0x1093c8['workflow'][_0x34c5c1(0x18a)](_0x366302,_0x227554),{'verbose':_0x2ca4a8['verbose']}),_0x476a4a=_0x1b9c95['data'];return console[_0x34c5c1(0x239)](_0x34c5c1(0x2b3)+_0x476a4a[_0x34c5c1(0x1c4)]+_0x34c5c1(0x25a)+_0x476a4a['projectName']+'\x27'),(_0x2ca4a8['json']||_0x2ca4a8[_0x34c5c1(0x1aa)])&&await handleSingleObjectOutput(_0x476a4a,_0x2ca4a8),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(_0xeb54bc){const _0x149155=a42_0x3bd9b9,_0x29f163=Math[_0x149155(0x1e4)](_0xeb54bc/0x3e8),_0x84b6e1=Math[_0x149155(0x1e4)](_0x29f163/0x3c),_0x5ad25f=Math['floor'](_0x84b6e1/0x3c),_0x21111c=Math[_0x149155(0x1e4)](_0x5ad25f/0x18);if(_0x21111c>0x0){const _0xe8b529=_0x5ad25f%0x18;return _0xe8b529>0x0?_0x21111c+'d\x20'+_0xe8b529+'h':_0x21111c+'d';}else{if(_0x5ad25f>0x0){const _0x32aef7=_0x84b6e1%0x3c;return _0x32aef7>0x0?_0x5ad25f+'h\x20'+_0x32aef7+'m':_0x5ad25f+'h';}else{if(_0x84b6e1>0x0){const _0x428f5c=_0x29f163%0x3c;return _0x428f5c>0x0?_0x84b6e1+'m\x20'+_0x428f5c+'s':_0x84b6e1+'m';}else return _0x29f163+'s';}}}function formatTimestamp(_0x5c43f7,_0x5a1fd5){const _0x477af4=a42_0x3bd9b9,_0x4082d0=new Date(_0x5c43f7),_0x2a0900=String(_0x4082d0[_0x477af4(0x19f)]())[_0x477af4(0x302)](0x2,'0'),_0x375ea4=String(_0x4082d0['getMinutes']())[_0x477af4(0x302)](0x2,'0'),_0x4f9cf2=_0x2a0900+':'+_0x375ea4,_0x10d1bd=_0x4082d0['getFullYear']()===_0x5a1fd5[_0x477af4(0x2df)]()&&_0x4082d0[_0x477af4(0x209)]()===_0x5a1fd5[_0x477af4(0x209)]()&&_0x4082d0[_0x477af4(0x294)]()===_0x5a1fd5['getDate']();if(_0x10d1bd)return _0x4f9cf2;else{const _0x2797a1=String(_0x4082d0[_0x477af4(0x209)]()+0x1)['padStart'](0x2,'0'),_0x2c8605=String(_0x4082d0[_0x477af4(0x294)]())[_0x477af4(0x302)](0x2,'0');return _0x2797a1+'-'+_0x2c8605+'\x20'+_0x4f9cf2;}}function formatDate(_0x4bdf13){const _0x3a9e4d=a42_0x3bd9b9,_0x58479f=_0x4bdf13[_0x3a9e4d(0x2df)](),_0x15cd64=String(_0x4bdf13['getMonth']()+0x1)['padStart'](0x2,'0'),_0x10d0ec=String(_0x4bdf13[_0x3a9e4d(0x294)]())[_0x3a9e4d(0x302)](0x2,'0');return _0x58479f+'-'+_0x15cd64+'-'+_0x10d0ec;}function getTaskStateIcon(_0x28b045){const _0x3d0684={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x3d0684[_0x28b045]||'⚪';}function getBarChar(_0x38a11b){const _0x2b97a5=a42_0x3bd9b9;return _0x38a11b===_0x2b97a5(0x239)||_0x38a11b===_0x2b97a5(0x228)?'×':'─';}function getBarColor(_0x4f64ca){const _0x472256=a42_0x3bd9b9,_0x5e72d2={'success':a42_0x48c95c['green'],'error':a42_0x48c95c[_0x472256(0x196)],'group_error':a42_0x48c95c[_0x472256(0x196)],'running':a42_0x48c95c[_0x472256(0x2e1)],'blocked':a42_0x48c95c[_0x472256(0x29e)],'planned':a42_0x48c95c['dim'],'canceling':a42_0x48c95c[_0x472256(0x29e)]};return _0x5e72d2[_0x4f64ca]||a42_0x48c95c[_0x472256(0x2cc)];}function parseTaskName(_0x45021f){const _0x1ff120=a42_0x3bd9b9;let _0x4b69a6=_0x45021f[_0x1ff120(0x1ac)](/^\++/,'');const _0x4d096d=_0x4b69a6[_0x1ff120(0x21b)]('+'),_0x29f792=_0x4d096d[_0x1ff120(0x1c2)]>0x1?_0x4d096d['length']-0x2:0x0,_0x59df62=_0x4d096d[_0x4d096d[_0x1ff120(0x1c2)]-0x1]||_0x4b69a6;return{'level':_0x29f792,'name':'+'+_0x59df62};}function truncateTaskName(_0x3dd618,_0x2c1f09){const _0x19c811=a42_0x3bd9b9,_0x4bf96e=stringWidth(_0x3dd618);if(_0x4bf96e<=_0x2c1f09)return _0x3dd618;let _0x278da2=_0x3dd618;while(stringWidth(_0x278da2+'…')>_0x2c1f09&&_0x278da2[_0x19c811(0x1c2)]>0x0){_0x278da2=_0x278da2[_0x19c811(0x1de)](0x0,-0x1);}return _0x278da2+'…';}function calculateTimeScale(_0x40edfb,_0x248b25){const _0x517aba=a42_0x3bd9b9;return{'startTime':_0x40edfb[_0x517aba(0x195)],'endTime':_0x40edfb[_0x517aba(0x240)],'durationMs':_0x40edfb[_0x517aba(0x287)],'msPerChar':_0x40edfb[_0x517aba(0x287)]/_0x248b25};}function timeToPosition(_0x35eda7,_0x3125c5,_0x9699ce){const _0x59de11=a42_0x3bd9b9,_0x5f0096=_0x35eda7-_0x3125c5[_0x59de11(0x214)],_0x5b336a=Math[_0x59de11(0x1e4)](_0x5f0096/_0x3125c5[_0x59de11(0x28a)]);return Math[_0x59de11(0x303)](0x0,Math[_0x59de11(0x225)](_0x5b336a,_0x9699ce));}function renderTimeAxis(_0x3ed425,_0x33d313){const _0x143782=a42_0x3bd9b9,_0x599fba=Math[_0x143782(0x225)](TIMELINE_CONFIG[_0x143782(0x298)],Math[_0x143782(0x303)](TIMELINE_CONFIG[_0x143782(0x1d1)],Math[_0x143782(0x1e4)](_0x33d313/TIMELINE_CONFIG[_0x143782(0x1ec)]))),_0x30c081=_0x3ed425[_0x143782(0x23b)]/(_0x599fba-0x1),_0x45e37a=new Date(_0x3ed425[_0x143782(0x214)]),_0x3d3eea=[];for(let _0x1ea4cb=0x0;_0x1ea4cb<_0x599fba;_0x1ea4cb++){const _0x25f1cc=_0x3ed425[_0x143782(0x214)]+_0x1ea4cb*_0x30c081,_0x1026af=timeToPosition(_0x25f1cc,_0x3ed425,_0x33d313),_0x476482=formatTimestamp(_0x25f1cc,_0x45e37a);_0x3d3eea[_0x143782(0x2e5)]({'pos':_0x1026af,'text':_0x476482});}const _0x5347a5=new Array(_0x33d313)[_0x143782(0x2a3)]('\x20');let _0x1eebb4=-0x1;for(const {pos:_0x4c4a7e,text:_0x242ce8}of _0x3d3eea){let _0x2b1f62=Math[_0x143782(0x303)](0x0,_0x4c4a7e-Math['floor'](_0x242ce8[_0x143782(0x1c2)]/0x2));_0x2b1f62<=_0x1eebb4+TIMELINE_CONFIG[_0x143782(0x1bd)]&&(_0x2b1f62=_0x1eebb4+TIMELINE_CONFIG[_0x143782(0x1bd)]+0x1);_0x2b1f62+_0x242ce8['length']>_0x33d313&&(_0x2b1f62=_0x33d313-_0x242ce8[_0x143782(0x1c2)]);if(_0x2b1f62>=0x0&&_0x2b1f62+_0x242ce8['length']<=_0x33d313&&_0x2b1f62>_0x1eebb4){for(let _0x1c9d64=0x0;_0x1c9d64<_0x242ce8[_0x143782(0x1c2)];_0x1c9d64++){_0x5347a5[_0x2b1f62+_0x1c9d64]=_0x242ce8[_0x1c9d64];}_0x1eebb4=_0x2b1f62+_0x242ce8[_0x143782(0x1c2)]-0x1;}}return _0x5347a5[_0x143782(0x1c6)]('');}function renderTaskRow(_0x3e9569,_0x2fbe7b,_0x46efee,_0x5bd25a){const _0x30c4f2=a42_0x3bd9b9,{level:_0x2e236c,name:_0x54549a}=parseTaskName(_0x3e9569['name']),_0x2cdf10='\x20'[_0x30c4f2(0x1fe)](_0x2e236c),_0xb370d2=_0x3e9569[_0x30c4f2(0x1d7)]?'('+formatElapsed(_0x3e9569[_0x30c4f2(0x1d7)][_0x30c4f2(0x287)])+')':'',_0x56130f=stringWidth(_0xb370d2),_0x412de1=_0x2e236c*0x1,_0xef1fb5=_0x5bd25a-_0x412de1-_0x56130f-0x1,_0x93651a=truncateTaskName(_0x54549a,_0xef1fb5),_0x1945db=_0x2cdf10+_0x93651a,_0x58cf5f=stringWidth(_0x1945db),_0x52d2ae=_0x5bd25a-_0x58cf5f-_0x56130f,_0xf9ef28=_0x1945db+'\x20'['repeat'](Math[_0x30c4f2(0x303)](0x1,_0x52d2ae))+a42_0x48c95c[_0x30c4f2(0x1b5)](_0xb370d2),_0x5ea3cc=getTaskStateIcon(_0x3e9569['state']),_0x4758ba=new Array(_0x46efee)[_0x30c4f2(0x2a3)]('\x20');if(_0x3e9569['window']){const _0x1ec4d3=timeToPosition(_0x3e9569[_0x30c4f2(0x1d7)][_0x30c4f2(0x195)],_0x2fbe7b,_0x46efee),_0x394e14=timeToPosition(_0x3e9569['window'][_0x30c4f2(0x240)],_0x2fbe7b,_0x46efee),_0x1d55d1=getBarChar(_0x3e9569[_0x30c4f2(0x1e8)]),_0x434cfc=Math['max'](_0x1ec4d3+0x1,_0x394e14);for(let _0x20bc7e=_0x1ec4d3;_0x20bc7e<Math[_0x30c4f2(0x225)](_0x434cfc,_0x46efee);_0x20bc7e++){_0x4758ba[_0x20bc7e]=_0x1d55d1;}}const _0x1ea107=getBarColor(_0x3e9569[_0x30c4f2(0x1e8)]),_0x9549c9=_0x4758ba['map'](_0x87b18a=>_0x87b18a==='\x20'?'\x20':_0x1ea107(_0x87b18a))[_0x30c4f2(0x1c6)]('');return _0x5ea3cc+'\x20'+_0xf9ef28+'│'+_0x9549c9+'│';}function calculateStats(_0x565ef3){const _0x398dd0=a42_0x3bd9b9,_0x1ccbf4={'total':_0x565ef3[_0x398dd0(0x1c2)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x27c4bf of _0x565ef3){if(_0x27c4bf['state']===_0x398dd0(0x266))_0x1ccbf4[_0x398dd0(0x266)]++;else{if(_0x27c4bf['state']===_0x398dd0(0x239)||_0x27c4bf['state']===_0x398dd0(0x228))_0x1ccbf4[_0x398dd0(0x239)]++;else _0x27c4bf[_0x398dd0(0x1e8)]===_0x398dd0(0x235)?_0x1ccbf4[_0x398dd0(0x235)]++:_0x1ccbf4['pending']++;}}return _0x1ccbf4;}function formatStats(_0x1ba3fc){const _0x59688f=a42_0x3bd9b9;return[_0x59688f(0x19a)+_0x1ba3fc[_0x59688f(0x311)],'✅\x20'+_0x1ba3fc['success'],'❌\x20'+_0x1ba3fc['error'],_0x59688f(0x180)+_0x1ba3fc[_0x59688f(0x235)],'⏳\x20'+_0x1ba3fc[_0x59688f(0x25f)]][_0x59688f(0x1c6)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a42_0x3bd9b9(0x30f)]=a42_0x3bd9b9(0x1af);[a42_0x3bd9b9(0x1cb)]='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a42_0x3bd9b9(0x1a9)](_0x2ea8c7){const _0x18b5bd=a42_0x3bd9b9,{options:_0x199fb0,args:_0x445379,tdx:_0x2e49e5}=_0x2ea8c7;let _0x2cd210,_0x50ea2f,_0x1bf374=![];if(_0x445379[0x0]){if(_0x445379[0x0][_0x18b5bd(0x292)]('.')){const _0x5267fb=this['parseProjectWorkflowPattern'](_0x445379,_0x199fb0);if(!_0x5267fb)return 0x1;_0x2cd210=_0x5267fb[_0x18b5bd(0x24c)],_0x50ea2f=_0x5267fb['workflowName'];}else{_0x50ea2f=_0x445379[0x0],_0x2cd210=_0x199fb0[_0x18b5bd(0x1a1)];if(!_0x2cd210)return console[_0x18b5bd(0x239)](a42_0x48c95c[_0x18b5bd(0x196)](_0x18b5bd(0x215)),_0x18b5bd(0x315)),0x1;_0x1bf374=!![];}}else{const _0x440a66=this[_0x18b5bd(0x1d2)](_0x445379,_0x199fb0);if(!_0x440a66)return 0x1;_0x2cd210=_0x440a66[_0x18b5bd(0x24c)],_0x50ea2f=_0x440a66['workflowName'];}if(_0x199fb0[_0x18b5bd(0x2d1)]){if(_0x2cd210&&_0x50ea2f)console[_0x18b5bd(0x239)](_0x18b5bd(0x26a)+_0x2cd210+'.'+_0x50ea2f);else _0x2cd210&&console[_0x18b5bd(0x239)]('Filter:\x20project='+_0x2cd210);}const _0x76bd89=_0x199fb0[_0x18b5bd(0x2cb)],_0x1ac7ed=_0x199fb0[_0x18b5bd(0x277)];if(_0x76bd89){_0x1ac7ed&&console['error'](a42_0x48c95c['yellow'](_0x18b5bd(0x241)),_0x18b5bd(0x32a));const _0x12d64b=_0x199fb0[_0x18b5bd(0x2cf)];return _0x12d64b?await this[_0x18b5bd(0x30b)](_0x2ea8c7,_0x76bd89):await this['renderSingleTimeline'](_0x2ea8c7,_0x76bd89,_0x199fb0),0x0;}if(_0x1ac7ed){const _0x481abc=await withSpinner(_0x18b5bd(0x192),()=>_0x2e49e5[_0x18b5bd(0x2aa)][_0x18b5bd(0x2ff)]({'projectName':_0x2cd210,'workflowName':_0x50ea2f,'limit':0x64}),{'verbose':_0x199fb0['verbose']}),_0x2137ea=_0x481abc[_0x18b5bd(0x2c9)][_0x18b5bd(0x231)](_0x30c4e3=>_0x30c4e3['id']===_0x1ac7ed);if(!_0x2137ea)return console['error'](a42_0x48c95c[_0x18b5bd(0x196)](_0x18b5bd(0x215)),_0x18b5bd(0x2f8)+_0x1ac7ed),0x1;if(!_0x2137ea[_0x18b5bd(0x270)]?.['id'])return console[_0x18b5bd(0x239)](a42_0x48c95c[_0x18b5bd(0x196)]('Error:'),_0x18b5bd(0x1bc)+_0x1ac7ed+_0x18b5bd(0x186)),0x1;const _0x5bb3e0=_0x2137ea[_0x18b5bd(0x270)]['id'];_0x199fb0[_0x18b5bd(0x2d1)]&&console[_0x18b5bd(0x239)](_0x18b5bd(0x1db)+_0x5bb3e0+'\x20from\x20session\x20'+_0x1ac7ed);const _0x21d64a=_0x199fb0[_0x18b5bd(0x2cf)];return _0x21d64a?await this[_0x18b5bd(0x30b)](_0x2ea8c7,_0x5bb3e0):await this[_0x18b5bd(0x2c2)](_0x2ea8c7,_0x5bb3e0,_0x199fb0),0x0;}const _0x25c9f5=await withSpinner(_0x18b5bd(0x2f1),()=>_0x2e49e5['workflow']['sessions']({'projectName':_0x2cd210,'workflowName':_0x50ea2f,'limit':_0x199fb0[_0x18b5bd(0x190)]||0x32}),{'verbose':_0x199fb0[_0x18b5bd(0x2d1)]}),_0x2101d9=_0x25c9f5['data'];if(_0x2101d9[_0x18b5bd(0x1c2)]===0x0){if(_0x2cd210&&_0x50ea2f)console[_0x18b5bd(0x239)]('No\x20sessions\x20found\x20for:\x20'+_0x2cd210+'.'+_0x50ea2f);else _0x2cd210?console[_0x18b5bd(0x239)](_0x18b5bd(0x2a4)+_0x2cd210):(console['error'](_0x18b5bd(0x1da)),console['error'](a42_0x48c95c[_0x18b5bd(0x1b5)](_0x18b5bd(0x25e))));return 0x0;}_0x2101d9[_0x18b5bd(0x1b1)]((_0x120274,_0x1cd172)=>{const _0x136eb7=_0x18b5bd,_0x2e0c03=_0x120274[_0x136eb7(0x29a)]||'',_0x379213=_0x1cd172[_0x136eb7(0x29a)]||'';return _0x379213[_0x136eb7(0x194)](_0x2e0c03);});if(_0x199fb0[_0x18b5bd(0x28f)]||_0x199fb0['jsonl'])return await handleSDKOutput(_0x2101d9,_0x199fb0),0x0;let _0x58a0e2;if(_0x1bf374){const _0x4b0e07=_0x2101d9[0x0];if(!_0x4b0e07[_0x18b5bd(0x270)]?.['id'])return console[_0x18b5bd(0x239)](_0x18b5bd(0x200)),0x0;_0x58a0e2=_0x4b0e07[_0x18b5bd(0x270)]['id'],_0x199fb0[_0x18b5bd(0x2d1)]&&console['error'](_0x18b5bd(0x20f)+_0x4b0e07[_0x18b5bd(0x29a)]);}else{const _0x28a030=_0x2101d9['map'](_0x1a20dd=>{const _0x511e71=_0x18b5bd,_0x4dbb50=getAttemptStatusDisplay(_0x1a20dd[_0x511e71(0x270)]);return{'title':_0x1a20dd[_0x511e71(0x1f7)]?.[_0x511e71(0x30f)]+'.'+_0x1a20dd[_0x511e71(0x2aa)]?.[_0x511e71(0x30f)]+_0x511e71(0x197)+_0x1a20dd['sessionTime']+'\x20'+_0x4dbb50[_0x511e71(0x2f3)],'value':_0x1a20dd[_0x511e71(0x270)]?.['id']||'','description':_0x4dbb50[_0x511e71(0x1fa)]};}),_0x2d7979=await a42_0x1933bf({'type':'select','name':_0x18b5bd(0x2cb),'message':_0x18b5bd(0x223),'choices':_0x28a030[_0x18b5bd(0x2fe)](_0x1d7129=>_0x1d7129[_0x18b5bd(0x2f6)]!=='')});if(!_0x2d7979[_0x18b5bd(0x2cb)])return 0x0;_0x58a0e2=_0x2d7979[_0x18b5bd(0x2cb)];}const _0x5c36e1=_0x199fb0[_0x18b5bd(0x2cf)];return _0x5c36e1?await this[_0x18b5bd(0x30b)](_0x2ea8c7,_0x58a0e2):await this[_0x18b5bd(0x2c2)](_0x2ea8c7,_0x58a0e2,_0x199fb0),0x0;}async[a42_0x3bd9b9(0x2c2)](_0x4ab601,_0x11f624,_0x5ce4e9){const _0x30c485=a42_0x3bd9b9,{tdx:_0x34983a}=_0x4ab601;let _0x42c712,_0x51de82;try{[_0x42c712,_0x51de82]=await Promise[_0x30c485(0x1ab)]([_0x34983a[_0x30c485(0x2aa)]['attempt'](_0x11f624),_0x34983a[_0x30c485(0x2aa)][_0x30c485(0x1b9)](_0x11f624,![])]);}catch(_0x221443){console[_0x30c485(0x239)](a42_0x48c95c[_0x30c485(0x196)](_0x30c485(0x1ad)));_0x5ce4e9[_0x30c485(0x2d1)]&&console[_0x30c485(0x239)](_0x221443);throw _0x221443;}if(_0x5ce4e9[_0x30c485(0x28f)]||_0x5ce4e9[_0x30c485(0x1aa)]){const _0x13b558=this[_0x30c485(0x229)](_0x42c712,_0x51de82);await handleSDKOutput([_0x13b558],_0x5ce4e9);return;}const _0x13e62e=_0x34983a[_0x30c485(0x2f4)]['site'],_0x22da1c=this[_0x30c485(0x2ce)](_0x42c712,_0x51de82,_0x13e62e);console['log'](_0x22da1c);}async[a42_0x3bd9b9(0x30b)](_0x3de622,_0x269347){const _0x4f6f4a=a42_0x3bd9b9,{tdx:_0x4117e8}=_0x3de622,_0x535bb4=TIMELINE_CONFIG[_0x4f6f4a(0x206)],_0x169979=TIMELINE_CONFIG[_0x4f6f4a(0x2c6)];let _0x15dc9c=0x0;while(_0x15dc9c<_0x169979){process[_0x4f6f4a(0x2e8)][_0x4f6f4a(0x31d)]&&process[_0x4f6f4a(0x2e8)][_0x4f6f4a(0x2be)]('\x1bc');let _0x2ab7cf,_0x22736e;try{[_0x2ab7cf,_0x22736e]=await Promise['all']([_0x4117e8['workflow'][_0x4f6f4a(0x183)](_0x269347),_0x4117e8[_0x4f6f4a(0x2aa)]['tasks'](_0x269347,![])]);}catch(_0xcacc4){console[_0x4f6f4a(0x239)](a42_0x48c95c['red'](_0x4f6f4a(0x230)));_0x15dc9c>0x0&&console[_0x4f6f4a(0x239)](a42_0x48c95c[_0x4f6f4a(0x1b5)](_0x4f6f4a(0x237)+_0x15dc9c));throw _0xcacc4;}const _0x2a4a95=_0x4117e8[_0x4f6f4a(0x2f4)][_0x4f6f4a(0x249)],_0x2c3b40=this['renderTimeline'](_0x2ab7cf,_0x22736e,_0x2a4a95);console['log'](_0x2c3b40);const _0x4f0a4e=_0x2ab7cf[_0x4f6f4a(0x1b4)]&&_0x22736e[_0x4f6f4a(0x290)](_0x205643=>_0x205643[_0x4f6f4a(0x1e8)]!=='running'&&_0x205643[_0x4f6f4a(0x1e8)]!==_0x4f6f4a(0x24e));if(_0x4f0a4e){console[_0x4f6f4a(0x239)](a42_0x48c95c[_0x4f6f4a(0x279)](_0x4f6f4a(0x1be)));break;}console[_0x4f6f4a(0x239)](a42_0x48c95c[_0x4f6f4a(0x1b5)](_0x4f6f4a(0x1b0)+_0x15dc9c*0x2+_0x4f6f4a(0x319))),await new Promise(_0xbeccc9=>setTimeout(_0xbeccc9,_0x535bb4)),_0x15dc9c++;}_0x15dc9c>=_0x169979&&console[_0x4f6f4a(0x239)](a42_0x48c95c[_0x4f6f4a(0x29e)](_0x4f6f4a(0x257)));}[a42_0x3bd9b9(0x2ce)](_0x40f315,_0x122d40,_0x5d0d82){const _0x309f00=a42_0x3bd9b9,_0x3a3abd=[],_0x420451=TIMELINE_CONFIG[_0x309f00(0x28c)],_0x262320=0x5,_0x427c00=process[_0x309f00(0x2e8)][_0x309f00(0x1e3)]||0x78,_0xe8710d=_0x427c00-_0x420451-_0x262320,_0x37637a=Math['max'](TIMELINE_CONFIG['MIN_TIMELINE_WIDTH'],Math['min'](_0xe8710d,TIMELINE_CONFIG[_0x309f00(0x295)])),_0x56b4e5=new Date(_0x40f315[_0x309f00(0x1ee)])[_0x309f00(0x22d)](),_0x33ad50=_0x40f315[_0x309f00(0x2dc)]?new Date(_0x40f315['finishedAt'])[_0x309f00(0x22d)]():Date[_0x309f00(0x1bb)](),_0x5049a0={'start':_0x56b4e5,'end':_0x33ad50,'duration':_0x33ad50-_0x56b4e5},_0x11d6fd=new Map(),_0x126501=[];for(const _0xdbe1c6 of _0x122d40){if(_0xdbe1c6[_0x309f00(0x272)]){const _0x37e48c=new Date(_0xdbe1c6[_0x309f00(0x272)])[_0x309f00(0x22d)](),_0x17fdd4=_0xdbe1c6[_0x309f00(0x2c3)]?new Date(_0xdbe1c6[_0x309f00(0x2c3)])[_0x309f00(0x22d)]():Date['now'](),_0x57e134={'start':_0x37e48c,'end':_0x17fdd4,'duration':_0x17fdd4-_0x37e48c};_0x11d6fd['set'](_0xdbe1c6['id'],_0x57e134),_0x126501[_0x309f00(0x2e5)]({'name':_0xdbe1c6[_0x309f00(0x27f)],'state':_0xdbe1c6['state']||'unknown','window':_0x57e134});}else _0x126501['push']({'name':_0xdbe1c6[_0x309f00(0x27f)],'state':_0xdbe1c6[_0x309f00(0x1e8)]||_0x309f00(0x24e),'window':undefined});}_0x126501[_0x309f00(0x1b1)]((_0x4588d9,_0x1bfda1)=>{const _0x5bf4aa=_0x309f00;if(!_0x4588d9[_0x5bf4aa(0x1d7)])return 0x1;if(!_0x1bfda1['window'])return-0x1;return _0x4588d9['window'][_0x5bf4aa(0x195)]-_0x1bfda1[_0x5bf4aa(0x1d7)][_0x5bf4aa(0x195)];});const _0x24b5c3=_0x126501[_0x309f00(0x1c2)],_0x47c07c=_0x24b5c3>TIMELINE_CONFIG[_0x309f00(0x30e)];_0x47c07c&&_0x126501['splice'](TIMELINE_CONFIG[_0x309f00(0x30e)]);const _0x138103=calculateTimeScale(_0x5049a0,_0x37637a),_0x1b20ac=_0x40f315[_0x309f00(0x1b4)]?_0x40f315[_0x309f00(0x266)]?a42_0x48c95c[_0x309f00(0x279)](_0x309f00(0x266)):a42_0x48c95c['red'](_0x309f00(0x239)):a42_0x48c95c[_0x309f00(0x2e1)]('running'),_0x132506=_0x40f315['project']?.['id'],_0x6e2c4a=_0x40f315[_0x309f00(0x277)];let _0x64a2f4;if(_0x132506&&_0x6e2c4a){const _0x43c2c6=getWorkflowAttemptUrl(_0x5d0d82,_0x132506,_0x6e2c4a,_0x40f315['id']);_0x64a2f4=hyperlink(a42_0x48c95c[_0x309f00(0x1b5)](_0x40f315['id']),_0x43c2c6);}else _0x64a2f4=a42_0x48c95c[_0x309f00(0x1b5)](_0x40f315['id']);_0x3a3abd[_0x309f00(0x2e5)]('Attempt:\x20'+_0x64a2f4+_0x309f00(0x197)+_0x1b20ac+_0x309f00(0x197)+formatElapsed(_0x5049a0[_0x309f00(0x287)]));if(_0x126501['length']>0x0){const _0x4712da=renderTimeAxis(_0x138103,_0x37637a),_0x2d3d1b=new Date(_0x5049a0[_0x309f00(0x195)]),_0x2af6e5=formatDate(_0x2d3d1b),_0x41c033=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x309f00(0x2d9)]+_0x420451,_0x3b61bd=_0x2af6e5['padStart'](_0x41c033),_0x1d4b84=a42_0x48c95c[_0x309f00(0x1b5)](_0x3b61bd);_0x3a3abd[_0x309f00(0x2e5)](_0x1d4b84+'\x20'+_0x4712da);for(const _0x15bb06 of _0x126501){_0x3a3abd[_0x309f00(0x2e5)](renderTaskRow(_0x15bb06,_0x138103,_0x37637a,_0x420451));}const _0x3b0474=calculateStats(_0x126501);_0x3a3abd[_0x309f00(0x2e5)](formatStats(_0x3b0474)),_0x47c07c&&_0x3a3abd['push'](a42_0x48c95c[_0x309f00(0x29e)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0x309f00(0x30e)]+'\x20of\x20'+_0x24b5c3+_0x309f00(0x307))),_0x3a3abd[_0x309f00(0x2e5)](''),_0x3a3abd[_0x309f00(0x2e5)](a42_0x48c95c[_0x309f00(0x1b5)]('💡\x20Tip:\x20Use\x20')+('tdx\x20wf\x20attempt\x20'+_0x40f315['id']+'\x20logs')+a42_0x48c95c[_0x309f00(0x1b5)]('\x20to\x20see\x20detailed\x20logs'));}else _0x3a3abd['push'](_0x309f00(0x19e));return _0x3a3abd[_0x309f00(0x1c6)]('\x0a');}[a42_0x3bd9b9(0x229)](_0x49cc03,_0x12da41){const _0x4d2219=a42_0x3bd9b9,_0x197b1d=new Date(_0x49cc03[_0x4d2219(0x1ee)])[_0x4d2219(0x22d)](),_0x3103e4=_0x49cc03[_0x4d2219(0x2dc)]?new Date(_0x49cc03[_0x4d2219(0x2dc)])[_0x4d2219(0x22d)]():Date[_0x4d2219(0x1bb)](),_0x29857e=_0x3103e4-_0x197b1d,_0x147191=[];for(const _0x35e41b of _0x12da41){if(_0x35e41b[_0x4d2219(0x272)]){const _0x2428e8=new Date(_0x35e41b[_0x4d2219(0x272)])[_0x4d2219(0x22d)](),_0x413ddf=_0x35e41b[_0x4d2219(0x2c3)]?new Date(_0x35e41b[_0x4d2219(0x2c3)])[_0x4d2219(0x22d)]():Date['now']();_0x147191[_0x4d2219(0x2e5)]({'name':_0x35e41b[_0x4d2219(0x27f)],'state':_0x35e41b[_0x4d2219(0x1e8)]||_0x4d2219(0x211),'window':{'start':_0x2428e8,'end':_0x413ddf,'duration':_0x413ddf-_0x2428e8}});}else _0x147191[_0x4d2219(0x2e5)]({'name':_0x35e41b[_0x4d2219(0x27f)],'state':_0x35e41b[_0x4d2219(0x1e8)]||_0x4d2219(0x24e),'window':undefined});}const _0x5bc975=calculateStats(_0x147191);return{'attempt':{'id':_0x49cc03['id'],'status':_0x49cc03[_0x4d2219(0x1b4)]?_0x49cc03[_0x4d2219(0x266)]?_0x4d2219(0x266):_0x4d2219(0x239):'running','createdAt':_0x49cc03[_0x4d2219(0x1ee)],'finishedAt':_0x49cc03[_0x4d2219(0x2dc)],'duration_ms':_0x29857e},'tasks':_0x147191[_0x4d2219(0x262)](_0x127242=>({'name':_0x127242['name'],'state':_0x127242[_0x4d2219(0x1e8)],'startedAt':_0x127242[_0x4d2219(0x1d7)]?new Date(_0x127242[_0x4d2219(0x1d7)][_0x4d2219(0x195)])['toISOString']():null,'updatedAt':_0x127242['window']?new Date(_0x127242[_0x4d2219(0x1d7)][_0x4d2219(0x240)])[_0x4d2219(0x2ad)]():null,'duration_ms':_0x127242[_0x4d2219(0x1d7)]?.[_0x4d2219(0x287)]||null})),'stats':_0x5bc975};}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x8cfb04,_0x77e3d9){const _0xc74793=a43_0x32d7,_0x2c9f81=_0x8cfb04();while(!![]){try{const _0x455d9a=-parseInt(_0xc74793(0x107))/0x1*(parseInt(_0xc74793(0xfe))/0x2)+-parseInt(_0xc74793(0x100))/0x3*(-parseInt(_0xc74793(0x103))/0x4)+parseInt(_0xc74793(0x106))/0x5+parseInt(_0xc74793(0xf7))/0x6*(-parseInt(_0xc74793(0x108))/0x7)+parseInt(_0xc74793(0x104))/0x8*(-parseInt(_0xc74793(0x102))/0x9)+parseInt(_0xc74793(0xfa))/0xa+parseInt(_0xc74793(0xfb))/0xb;if(_0x455d9a===_0x77e3d9)break;else _0x2c9f81['push'](_0x2c9f81['shift']());}catch(_0x3ffa74){_0x2c9f81['push'](_0x2c9f81['shift']());}}}(a43_0x1649,0xf102a));function a43_0x1649(){const _0x18f9cd=['replace','442593ZGMrvp','1927756qrMtiX','272xJgtoR','entries','9328605sLliWU','140863BGFSos','1334067qOdGfF','tdx/','6CIdoyK','Authorization','tdx','221290oXgDEu','6829361EjBFSN','version','X-Trino-User','2IZLAon','length','3qizuKX'];a43_0x1649=function(){return _0x18f9cd;};return a43_0x1649();}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 _0x5c4272=a43_0x32d7,_0xa6d679=getVersion(),_0x25e36d=platform(),_0x1429a0=process[_0x5c4272(0xfc)][_0x5c4272(0x101)]('v','');return _0x5c4272(0xf6)+_0xa6d679+'\x20('+_0x25e36d+';\x20node/'+_0x1429a0+')';}export function getAuthHeaders(_0x256ded,_0x1ae6ac){const _0x29d181=a43_0x32d7,_0x485b39=getVersion(),_0x521621={'User-Agent':getUserAgent(),'X-TD-Client':_0x29d181(0xf9),'X-TD-Client-Version':_0x485b39};return _0x1ae6ac&&(_0x521621[_0x29d181(0xf8)]='TD1\x20'+_0x1ae6ac),_0x521621;}export function toHeaderRecord(_0x59266a){const _0x4f01e7=a43_0x32d7,_0x4a65c5={};for(const [_0x185736,_0x3c9e76]of Object[_0x4f01e7(0x105)](_0x59266a)){_0x3c9e76!==undefined&&(_0x4a65c5[_0x185736]=_0x3c9e76);}return _0x4a65c5;}export function getTrinoHeaders(_0x3ae6c3,_0x4da3b3){const _0x3ffd6d=a43_0x32d7,_0x75b59a=getAuthHeaders(_0x3ae6c3,_0x4da3b3),_0x2c1206=toHeaderRecord(_0x75b59a);return delete _0x2c1206['Authorization'],_0x4da3b3&&(_0x2c1206[_0x3ffd6d(0xfd)]=_0x4da3b3),_0x2c1206;}function a43_0x32d7(_0x1d139d,_0x3b8026){_0x1d139d=_0x1d139d-0xf6;const _0x164905=a43_0x1649();let _0x32d7ff=_0x164905[_0x1d139d];return _0x32d7ff;}export function hasAPIKey(_0x3fb5cc){const _0x3c4a77=a43_0x32d7,_0x3b8195=getAPIKey();return _0x3b8195!==undefined&&_0x3b8195[_0x3c4a77(0xff)]>0x0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1dd258,_0x3bf123){const _0x5c3675=a44_0x56f5,_0x3c493d=_0x1dd258();while(!![]){try{const _0x36909a=-parseInt(_0x5c3675(0x140))/0x1+parseInt(_0x5c3675(0x10f))/0x2*(-parseInt(_0x5c3675(0x122))/0x3)+-parseInt(_0x5c3675(0x132))/0x4+-parseInt(_0x5c3675(0x127))/0x5+-parseInt(_0x5c3675(0x12b))/0x6+-parseInt(_0x5c3675(0x139))/0x7*(-parseInt(_0x5c3675(0x12a))/0x8)+-parseInt(_0x5c3675(0x111))/0x9*(-parseInt(_0x5c3675(0x138))/0xa);if(_0x36909a===_0x3bf123)break;else _0x3c493d['push'](_0x3c493d['shift']());}catch(_0x10b7d7){_0x3c493d['push'](_0x3c493d['shift']());}}}(a44_0x2e4d,0x43e42));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a44_0x4dfe64 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x48ac6f){const _0x2b5dd7=a44_0x56f5;return _0x48ac6f[_0x2b5dd7(0x13e)]==='json'||_0x48ac6f[_0x2b5dd7(0x13e)]==='jsonl'||_0x48ac6f['format']===_0x2b5dd7(0x13f)||_0x48ac6f[_0x2b5dd7(0x13e)]===_0x2b5dd7(0x114)||_0x48ac6f['json']===!![]||_0x48ac6f[_0x2b5dd7(0x11d)]===!![]||_0x48ac6f[_0x2b5dd7(0x13f)]===!![]||_0x48ac6f[_0x2b5dd7(0x114)]===!![];}export function parseOutputOptions(_0x3288a4){const _0x34d40f=a44_0x56f5;return{'format':_0x3288a4['format']||_0x34d40f(0x114),'output':_0x3288a4[_0x34d40f(0x12d)]||'','limit':_0x3288a4[_0x34d40f(0x130)],'color':_0x3288a4[_0x34d40f(0x106)],'noColor':_0x3288a4[_0x34d40f(0x120)]};}function convertSDKResultToQueryResult(_0xc8f08){const _0x310d09=a44_0x56f5,_0x22ee09=[];if(_0xc8f08[_0x310d09(0x137)]>0x0){const _0x380e9f=_0xc8f08[0x0];for(const [_0x151e68,_0x411e7f]of Object[_0x310d09(0x10a)](_0x380e9f)){let _0x35497e=_0x310d09(0x11e);if(typeof _0x411e7f===_0x310d09(0x112))_0x35497e=Number[_0x310d09(0x10c)](_0x411e7f)?_0x310d09(0x13c):_0x310d09(0x135);else{if(typeof _0x411e7f==='boolean')_0x35497e=_0x310d09(0x10e);else _0x411e7f===null&&(_0x35497e='varchar');}_0x22ee09[_0x310d09(0x142)]({'name':_0x151e68,'type':_0x35497e});}}return{'queryId':_0x310d09(0x10b),'columns':_0x22ee09,'data':_0xc8f08,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0xc8f08[_0x310d09(0x137)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x5a2015,_0x51d993){const _0x51bd0c=convertSDKResultToQueryResult(_0x5a2015);return formatQueryOutput(_0x51bd0c,_0x51d993);}function a44_0x56f5(_0xc26417,_0x1a5692){_0xc26417=_0xc26417-0x101;const _0x2e4db1=a44_0x2e4d();let _0x56f5a8=_0x2e4db1[_0xc26417];return _0x56f5a8;}export async function formatQueryOutput(_0x3166b5,_0x4c3293){const _0x5369ed=a44_0x56f5,{format:_0x155060,limit:_0x378e64,output:_0x37d38f,color:_0x176107,noColor:_0x28b362}=_0x4c3293,_0x24790b=Boolean(_0x37d38f)&&!_0x176107,_0x391700={'color':_0x176107,'noColor':_0x28b362||_0x24790b};if(_0x155060===_0x5369ed(0x114)){const _0x59b30d=shouldUseLess(_0x155060,_0x37d38f);return formatAsTable(_0x3166b5,_0x378e64,_0x59b30d,_0x391700);}else{if(_0x155060===_0x5369ed(0x123))return formatAsJSON(_0x3166b5,_0x391700);else return _0x155060===_0x5369ed(0x11d)?formatAsJSONL(_0x3166b5,_0x391700):formatQueryResult(_0x3166b5,_0x155060);}}function shouldUseLess(_0x1c0758,_0x229dca){const _0x213010=a44_0x56f5;return(_0x1c0758===_0x213010(0x114)||_0x1c0758===_0x213010(0x143))&&process['stdout'][_0x213010(0x12f)]&&!_0x229dca;}export function resolveOutputOptions(_0x2894f6){const _0x30cf6c=a44_0x56f5,_0x25aac8=resolveOutputFormat(_0x2894f6[_0x30cf6c(0x13e)],_0x2894f6[_0x30cf6c(0x12d)],_0x30cf6c(0x114));let _0x35e868=typeof _0x2894f6[_0x30cf6c(0x130)]===_0x30cf6c(0x112)?_0x2894f6[_0x30cf6c(0x130)]:parseInt(_0x2894f6['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0xcd20aa=_0x2894f6[_0x30cf6c(0x12d)]||'';return shouldUseLess(_0x25aac8,_0xcd20aa)&&(_0x35e868=Infinity),{'format':_0x25aac8,'output':_0xcd20aa,'limit':_0x35e868,'color':_0x2894f6[_0x30cf6c(0x106)],'noColor':_0x2894f6[_0x30cf6c(0x120)]};}export function writeOutput(_0x2a6d0e,_0x4d1d40,_0x4c28fb){const _0x7dccec=a44_0x56f5;return _0x4d1d40?(writeFileSync(_0x4d1d40,_0x2a6d0e),console[_0x7dccec(0x128)]('Results\x20saved\x20to\x20'+_0x4d1d40),Promise['resolve']()):shouldUseLess(_0x4c28fb||'','')?new Promise(_0x4672f4=>{const _0x4b65be=_0x7dccec,_0x30322d=spawn(_0x4b65be(0x110),[_0x4b65be(0x102)],{'stdio':['pipe',_0x4b65be(0x131),'inherit']});let _0x7898af=![];_0x30322d['on']('error',()=>{const _0x5659de=_0x4b65be;!_0x7898af&&(_0x7898af=!![],console[_0x5659de(0x136)](_0x2a6d0e),_0x4672f4());}),_0x30322d['on'](_0x4b65be(0x108),()=>{!_0x7898af&&(_0x7898af=!![],_0x4672f4());}),_0x30322d['on']('spawn',()=>{const _0x4f210c=_0x4b65be;!_0x7898af&&_0x30322d[_0x4f210c(0x124)]&&(_0x30322d[_0x4f210c(0x124)]['on'](_0x4f210c(0x128),()=>{}),_0x30322d['stdin'][_0x4f210c(0x134)](_0x2a6d0e),_0x30322d['stdin'][_0x4f210c(0x125)]());}),!_0x30322d[_0x4b65be(0x124)]&&(!_0x7898af&&(_0x7898af=!![],console[_0x4b65be(0x136)](_0x2a6d0e),_0x4672f4()));}):(console['log'](_0x2a6d0e),Promise[_0x7dccec(0x11f)]());}function a44_0x2e4d(){const _0x3ec475=['repeat','[logs]','cyan','stringify','─┴─','padEnd','jsonl','varchar','resolve','noColor','red','3iaZzaH','json','stdin','end','[query]','2298470ALztOq','error','debug','80768UKbfhO','440994ZAFzgQ','[params]','output','bold','isTTY','limit','inherit','380644zhSpUb','trim','write','double','log','length','1295870Iuwzzu','133XQddMh','No\x20data','map','bigint','join','format','tsv','227904ZvhmFo','split','push','list','max','-FXRSn','string','[rule]','stderr','color','yellow','close','forEach','entries','sdk-result','isInteger','magenta','boolean','706708RIyRIC','less','90ZIfupm','number','keys','table','─┬─','params'];a44_0x2e4d=function(){return _0x3ec475;};return a44_0x2e4d();}export async function handleSDKOutput(_0x4825d8,_0x15797b){const _0x3d6b03=a44_0x56f5,_0x582823=resolveOutputOptions(_0x15797b),_0x262834=await formatSDKOutput(_0x4825d8,_0x582823);await writeOutput(_0x262834,_0x582823['output']||undefined,_0x582823[_0x3d6b03(0x13e)]);}export async function handleQueryOutput(_0x5940d5,_0x4e90ea){const _0x1ad16a=a44_0x56f5,_0x4345fc=resolveOutputOptions(_0x4e90ea),_0x292f58=await formatQueryOutput(_0x5940d5,_0x4345fc);await writeOutput(_0x292f58,_0x4345fc['output']||undefined,_0x4345fc[_0x1ad16a(0x13e)]);}async function formatSingleObject(_0x619a51,_0x2a01d3){const _0x3286e3=a44_0x56f5,{format:_0x972417,color:_0x491f85,noColor:_0x584c9c}=_0x2a01d3,_0x5313aa={'color':_0x491f85,'noColor':_0x584c9c};if(_0x972417===_0x3286e3(0x123)){if(shouldUseColor(_0x5313aa))return colorizeJSON(_0x619a51,_0x5313aa);return JSON['stringify'](_0x619a51,null,0x2);}else{if(_0x972417===_0x3286e3(0x11d)){if(shouldUseColor(_0x5313aa))return colorizeJSONCompact(_0x619a51,_0x5313aa);return JSON[_0x3286e3(0x11a)](_0x619a51);}else{if(_0x972417==='tsv')return Object[_0x3286e3(0x10a)](_0x619a51)[_0x3286e3(0x13b)](([_0x2fce92,_0xbfd0e3])=>_0x2fce92+'\x09'+_0xbfd0e3)['join']('\x0a');else{const _0x387f0a=Object[_0x3286e3(0x10a)](_0x619a51);if(_0x387f0a[_0x3286e3(0x137)]===0x0)return _0x3286e3(0x13a);const _0x4068d1=_0x619a51['debug'],_0xf4dda4=_0x619a51['query'],_0xe57be=_0x619a51[_0x3286e3(0x116)],_0x328a60=_0x619a51['rule'],_0x2c3754=_0xf4dda4?typeof _0xf4dda4===_0x3286e3(0x103)?_0xf4dda4:JSON[_0x3286e3(0x11a)](_0xf4dda4,null,0x2):undefined,_0x5729cd=_0xe57be&&Object[_0x3286e3(0x113)](_0xe57be)['length']>0x0?JSON['stringify'](_0xe57be,null,0x2):undefined,_0x28760c=_0x328a60&&Object[_0x3286e3(0x113)](_0x328a60)[_0x3286e3(0x137)]>0x0?JSON[_0x3286e3(0x11a)](_0x328a60,null,0x2):undefined,_0x9e1c85=_0x387f0a['filter'](([_0x179a4c])=>_0x179a4c!==_0x3286e3(0x129)&&_0x179a4c!=='query'&&_0x179a4c!=='params'&&_0x179a4c!=='rule'),_0x321533=Math[_0x3286e3(0x101)](..._0x9e1c85[_0x3286e3(0x13b)](([_0x59e06a])=>_0x59e06a[_0x3286e3(0x137)])),_0x4bc800=Math['max'](..._0x9e1c85[_0x3286e3(0x13b)](([,_0x435587])=>{const _0x45ed7b=_0x3286e3;try{const _0x4e1ccb=_0x435587===null||_0x435587===undefined?'':typeof _0x435587==='object'?JSON[_0x45ed7b(0x11a)](_0x435587):String(_0x435587),_0x13c699=_0x4e1ccb[_0x45ed7b(0x141)]('\x0a');return Math[_0x45ed7b(0x101)](..._0x13c699['map'](_0x1e33d1=>_0x1e33d1['length']),0x0);}catch{return 0x0;}}),0x14),_0x27f3ee=[];_0x27f3ee['push'](colorBorder('┌─'+'─'['repeat'](_0x321533)+_0x3286e3(0x115)+'─'[_0x3286e3(0x117)](_0x4bc800)+'─┐',_0x5313aa)),_0x9e1c85['forEach'](([_0x2094c9,_0x5db99d])=>{const _0x4528a4=_0x3286e3;let _0x4073;try{_0x4073=_0x5db99d===null||_0x5db99d===undefined?'':typeof _0x5db99d==='object'?JSON[_0x4528a4(0x11a)](_0x5db99d):String(_0x5db99d);}catch{_0x4073='[Object]';}const _0x4f36bb=_0x2094c9[_0x4528a4(0x11c)](_0x321533),_0x51390=_0x4073[_0x4528a4(0x141)]('\x0a');_0x51390[_0x4528a4(0x109)]((_0x9b4cb1,_0x518c08)=>{const _0x28f679=_0x4528a4,_0x16a580=colorBorder('│',_0x5313aa);_0x518c08===0x0?_0x27f3ee['push'](_0x16a580+'\x20'+_0x4f36bb+'\x20'+_0x16a580+'\x20'+_0x9b4cb1[_0x28f679(0x11c)](_0x4bc800)+'\x20'+_0x16a580):_0x27f3ee[_0x28f679(0x142)](_0x16a580+'\x20'+'\x20'[_0x28f679(0x117)](_0x321533)+'\x20'+_0x16a580+'\x20'+_0x9b4cb1[_0x28f679(0x11c)](_0x4bc800)+'\x20'+_0x16a580);});}),_0x27f3ee[_0x3286e3(0x142)](colorBorder('└─'+'─'[_0x3286e3(0x117)](_0x321533)+_0x3286e3(0x11b)+'─'[_0x3286e3(0x117)](_0x4bc800)+'─┘',_0x5313aa));_0x2c3754&&(_0x27f3ee[_0x3286e3(0x142)](''),_0x27f3ee[_0x3286e3(0x142)](String(a44_0x4dfe64[_0x3286e3(0x107)][_0x3286e3(0x12e)](_0x3286e3(0x126)))),_0x27f3ee[_0x3286e3(0x142)](_0x2c3754));_0x5729cd&&(_0x27f3ee['push'](''),_0x27f3ee['push'](String(a44_0x4dfe64['blue'][_0x3286e3(0x12e)](_0x3286e3(0x12c)))),_0x27f3ee['push'](_0x5729cd));_0x28760c&&(_0x27f3ee['push'](''),_0x27f3ee[_0x3286e3(0x142)](String(a44_0x4dfe64[_0x3286e3(0x10d)][_0x3286e3(0x12e)](_0x3286e3(0x104)))),_0x27f3ee[_0x3286e3(0x142)](_0x28760c));if(_0x4068d1){if(_0x4068d1[_0x3286e3(0x105)]){_0x27f3ee[_0x3286e3(0x142)](''),_0x27f3ee[_0x3286e3(0x142)](String(a44_0x4dfe64[_0x3286e3(0x121)][_0x3286e3(0x12e)]('[error]')));const _0x34be46=_0x4068d1[_0x3286e3(0x105)][_0x3286e3(0x141)]('\x0a');_0x34be46['forEach'](_0x4db5c4=>{const _0x257c34=_0x3286e3;_0x4db5c4[_0x257c34(0x133)]()&&_0x27f3ee[_0x257c34(0x142)](_0x4db5c4);});}if(_0x4068d1['cmdout']){_0x27f3ee[_0x3286e3(0x142)](''),_0x27f3ee[_0x3286e3(0x142)](String(a44_0x4dfe64[_0x3286e3(0x119)][_0x3286e3(0x12e)](_0x3286e3(0x118))));const _0xf3da3b=_0x4068d1['cmdout'][_0x3286e3(0x141)]('\x0a');_0xf3da3b[_0x3286e3(0x109)](_0x582b30=>{const _0x3f562e=_0x3286e3;_0x582b30[_0x3f562e(0x133)]()&&_0x27f3ee['push'](_0x582b30);});}}return _0x27f3ee[_0x3286e3(0x13d)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x2170ca,_0x3ed082){const _0x443e12=a44_0x56f5;if(_0x3ed082[_0x443e12(0x13e)]===_0x443e12(0x114)){await handleSDKOutput([_0x2170ca],_0x3ed082);return;}const _0x87681a=resolveOutputOptions(_0x3ed082),_0x18afac=await formatSingleObject(_0x2170ca,_0x87681a);await writeOutput(_0x18afac,_0x87681a[_0x443e12(0x12d)]||undefined,_0x87681a[_0x443e12(0x13e)]);}
|
|
1
|
+
(function(_0x5162cc,_0x28632f){const _0x432b61=a44_0x268e,_0xe18435=_0x5162cc();while(!![]){try{const _0x15e45b=parseInt(_0x432b61(0x1e4))/0x1+parseInt(_0x432b61(0x1dc))/0x2+parseInt(_0x432b61(0x1ed))/0x3*(-parseInt(_0x432b61(0x214))/0x4)+parseInt(_0x432b61(0x209))/0x5*(-parseInt(_0x432b61(0x20b))/0x6)+parseInt(_0x432b61(0x1e1))/0x7+parseInt(_0x432b61(0x1dd))/0x8+-parseInt(_0x432b61(0x216))/0x9;if(_0x15e45b===_0x28632f)break;else _0xe18435['push'](_0xe18435['shift']());}catch(_0x1b5b30){_0xe18435['push'](_0xe18435['shift']());}}}(a44_0xe8c3,0x74b23));function a44_0x268e(_0x4bbc2c,_0x2b4116){_0x4bbc2c=_0x4bbc2c-0x1d9;const _0xe8c3d7=a44_0xe8c3();let _0x268e04=_0xe8c3d7[_0x4bbc2c];return _0x268e04;}import{writeFileSync}from'fs';import{spawn}from'child_process';function a44_0xe8c3(){const _0x351c5e=['rule','string','755536OjaXCT','949784zHXpQr','[rule]','tsv','map','6671826hoYwEI','stderr','FINISHED','854617CwQSaS','error','keys','sdk-result','params','blue','log','format','-FXRSn','365628lOKfgq','table','padEnd','length','color','double','query','object','split','bold','stdin','jsonl','entries','─┬─','max','boolean','json','inherit','cmdout','less','spawn','noColor','resolve','No\x20data','varchar','limit','[query]','join','280555odZBss','list','30dvITaa','magenta','stringify','forEach','trim','repeat','stdout','[logs]','write','20FgBReu','push','8426736vFogQN','isInteger','number','[params]','Results\x20saved\x20to\x20','[error]','debug','output'];a44_0xe8c3=function(){return _0x351c5e;};return a44_0xe8c3();}import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a44_0x56cb3c from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x4c8d5a){const _0x4a995b=a44_0x268e;return _0x4c8d5a[_0x4a995b(0x1eb)]===_0x4a995b(0x1fd)||_0x4c8d5a[_0x4a995b(0x1eb)]===_0x4a995b(0x1f8)||_0x4c8d5a[_0x4a995b(0x1eb)]==='tsv'||_0x4c8d5a[_0x4a995b(0x1eb)]===_0x4a995b(0x1ee)||_0x4c8d5a[_0x4a995b(0x1fd)]===!![]||_0x4c8d5a[_0x4a995b(0x1f8)]===!![]||_0x4c8d5a[_0x4a995b(0x1df)]===!![]||_0x4c8d5a['table']===!![];}export function parseOutputOptions(_0x386772){const _0x56e5f6=a44_0x268e;return{'format':_0x386772[_0x56e5f6(0x1eb)]||_0x56e5f6(0x1ee),'output':_0x386772['output']||'','limit':_0x386772[_0x56e5f6(0x206)],'color':_0x386772[_0x56e5f6(0x1f1)],'noColor':_0x386772[_0x56e5f6(0x202)]};}function convertSDKResultToQueryResult(_0x398e2d){const _0x36aed0=a44_0x268e,_0x5c296b=[];if(_0x398e2d[_0x36aed0(0x1f0)]>0x0){const _0x2f4645=_0x398e2d[0x0];for(const [_0x49ab3b,_0x356efc]of Object[_0x36aed0(0x1f9)](_0x2f4645)){let _0x59edbf='varchar';if(typeof _0x356efc===_0x36aed0(0x218))_0x59edbf=Number[_0x36aed0(0x217)](_0x356efc)?'bigint':_0x36aed0(0x1f2);else{if(typeof _0x356efc===_0x36aed0(0x1fc))_0x59edbf=_0x36aed0(0x1fc);else _0x356efc===null&&(_0x59edbf=_0x36aed0(0x205));}_0x5c296b[_0x36aed0(0x215)]({'name':_0x49ab3b,'type':_0x59edbf});}}return{'queryId':_0x36aed0(0x1e7),'columns':_0x5c296b,'data':_0x398e2d,'stats':{'state':_0x36aed0(0x1e3),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x398e2d[_0x36aed0(0x1f0)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x441bdd,_0x21c70a){const _0x42d01d=convertSDKResultToQueryResult(_0x441bdd);return formatQueryOutput(_0x42d01d,_0x21c70a);}export async function formatQueryOutput(_0x51d222,_0x4ae8c5){const _0x1f8b5c=a44_0x268e,{format:_0x36574b,limit:_0x753cc7,output:_0x25a800,color:_0x12cbe1,noColor:_0x218624}=_0x4ae8c5,_0x59f148=Boolean(_0x25a800)&&!_0x12cbe1,_0x2f5c4d={'color':_0x12cbe1,'noColor':_0x218624||_0x59f148};if(_0x36574b===_0x1f8b5c(0x1ee)){const _0xe9ee7f=shouldUseLess(_0x36574b,_0x25a800);return formatAsTable(_0x51d222,_0x753cc7,_0xe9ee7f,_0x2f5c4d);}else{if(_0x36574b===_0x1f8b5c(0x1fd))return formatAsJSON(_0x51d222,_0x2f5c4d);else return _0x36574b===_0x1f8b5c(0x1f8)?formatAsJSONL(_0x51d222,_0x2f5c4d):formatQueryResult(_0x51d222,_0x36574b);}}function shouldUseLess(_0x361f95,_0x5ee92e){const _0x4f7522=a44_0x268e;return(_0x361f95==='table'||_0x361f95===_0x4f7522(0x20a))&&process[_0x4f7522(0x211)]['isTTY']&&!_0x5ee92e;}export function resolveOutputOptions(_0x33fb6f){const _0x5b951e=a44_0x268e,_0xd05881=resolveOutputFormat(_0x33fb6f[_0x5b951e(0x1eb)],_0x33fb6f[_0x5b951e(0x1d9)],_0x5b951e(0x1ee));let _0x5018e6=typeof _0x33fb6f[_0x5b951e(0x206)]==='number'?_0x33fb6f[_0x5b951e(0x206)]:parseInt(_0x33fb6f[_0x5b951e(0x206)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x2d199a=_0x33fb6f[_0x5b951e(0x1d9)]||'';return shouldUseLess(_0xd05881,_0x2d199a)&&(_0x5018e6=Infinity),{'format':_0xd05881,'output':_0x2d199a,'limit':_0x5018e6,'color':_0x33fb6f[_0x5b951e(0x1f1)],'noColor':_0x33fb6f[_0x5b951e(0x202)]};}export function writeOutput(_0x1eb864,_0x4b9e4b,_0xebcab2){const _0x2f38da=a44_0x268e;return _0x4b9e4b?(writeFileSync(_0x4b9e4b,_0x1eb864),console[_0x2f38da(0x1e5)](_0x2f38da(0x21a)+_0x4b9e4b),Promise[_0x2f38da(0x203)]()):shouldUseLess(_0xebcab2||'','')?new Promise(_0x28e539=>{const _0x3fac25=_0x2f38da,_0x595d5c=spawn(_0x3fac25(0x200),[_0x3fac25(0x1ec)],{'stdio':['pipe',_0x3fac25(0x1fe),'inherit']});let _0xd12adc=![];_0x595d5c['on'](_0x3fac25(0x1e5),()=>{!_0xd12adc&&(_0xd12adc=!![],console['log'](_0x1eb864),_0x28e539());}),_0x595d5c['on']('close',()=>{!_0xd12adc&&(_0xd12adc=!![],_0x28e539());}),_0x595d5c['on'](_0x3fac25(0x201),()=>{const _0x3dad51=_0x3fac25;!_0xd12adc&&_0x595d5c[_0x3dad51(0x1f7)]&&(_0x595d5c[_0x3dad51(0x1f7)]['on']('error',()=>{}),_0x595d5c[_0x3dad51(0x1f7)][_0x3dad51(0x213)](_0x1eb864),_0x595d5c['stdin']['end']());}),!_0x595d5c[_0x3fac25(0x1f7)]&&(!_0xd12adc&&(_0xd12adc=!![],console['log'](_0x1eb864),_0x28e539()));}):(console[_0x2f38da(0x1ea)](_0x1eb864),Promise[_0x2f38da(0x203)]());}export async function handleSDKOutput(_0x247c6e,_0x34e2f3){const _0x573164=a44_0x268e,_0x5287de=resolveOutputOptions(_0x34e2f3),_0x2f142a=await formatSDKOutput(_0x247c6e,_0x5287de);await writeOutput(_0x2f142a,_0x5287de[_0x573164(0x1d9)]||undefined,_0x5287de['format']);}export async function handleQueryOutput(_0x27f2fc,_0x5b53c4){const _0x5bf2c7=a44_0x268e,_0x291693=resolveOutputOptions(_0x5b53c4),_0x2a877a=await formatQueryOutput(_0x27f2fc,_0x291693);await writeOutput(_0x2a877a,_0x291693[_0x5bf2c7(0x1d9)]||undefined,_0x291693[_0x5bf2c7(0x1eb)]);}async function formatSingleObject(_0x19e285,_0x5d64e5){const _0x530974=a44_0x268e,{format:_0x3d9df6,color:_0x285756,noColor:_0x44c9ce}=_0x5d64e5,_0x4af8c0={'color':_0x285756,'noColor':_0x44c9ce};if(_0x3d9df6==='json'){if(shouldUseColor(_0x4af8c0))return colorizeJSON(_0x19e285,_0x4af8c0);return JSON[_0x530974(0x20d)](_0x19e285,null,0x2);}else{if(_0x3d9df6===_0x530974(0x1f8)){if(shouldUseColor(_0x4af8c0))return colorizeJSONCompact(_0x19e285,_0x4af8c0);return JSON[_0x530974(0x20d)](_0x19e285);}else{if(_0x3d9df6==='tsv')return Object[_0x530974(0x1f9)](_0x19e285)[_0x530974(0x1e0)](([_0x22dd37,_0x3494f0])=>_0x22dd37+'\x09'+_0x3494f0)[_0x530974(0x208)]('\x0a');else{const _0x1023b7=Object['entries'](_0x19e285);if(_0x1023b7['length']===0x0)return _0x530974(0x204);const _0x24e72f=_0x19e285[_0x530974(0x21c)],_0x11efa9=_0x19e285['query'],_0x20e0ac=_0x19e285['params'],_0x435823=_0x19e285[_0x530974(0x1da)],_0x4c2508=_0x11efa9?typeof _0x11efa9===_0x530974(0x1db)?_0x11efa9:JSON[_0x530974(0x20d)](_0x11efa9,null,0x2):undefined,_0x168f1a=_0x20e0ac&&Object[_0x530974(0x1e6)](_0x20e0ac)[_0x530974(0x1f0)]>0x0?JSON['stringify'](_0x20e0ac,null,0x2):undefined,_0x183dd8=_0x435823&&Object[_0x530974(0x1e6)](_0x435823)[_0x530974(0x1f0)]>0x0?JSON[_0x530974(0x20d)](_0x435823,null,0x2):undefined,_0x46cdc2=_0x1023b7['filter'](([_0x2cffd7])=>_0x2cffd7!==_0x530974(0x21c)&&_0x2cffd7!==_0x530974(0x1f3)&&_0x2cffd7!==_0x530974(0x1e8)&&_0x2cffd7!==_0x530974(0x1da)),_0x3ac566=Math[_0x530974(0x1fb)](..._0x46cdc2[_0x530974(0x1e0)](([_0x3d766c])=>_0x3d766c[_0x530974(0x1f0)])),_0x3afcbb=Math[_0x530974(0x1fb)](..._0x46cdc2['map'](([,_0x367524])=>{const _0x39c7ec=_0x530974;try{const _0x3243e6=_0x367524===null||_0x367524===undefined?'':typeof _0x367524===_0x39c7ec(0x1f4)?JSON[_0x39c7ec(0x20d)](_0x367524):String(_0x367524),_0x4bf230=_0x3243e6[_0x39c7ec(0x1f5)]('\x0a');return Math['max'](..._0x4bf230[_0x39c7ec(0x1e0)](_0x26ae42=>_0x26ae42[_0x39c7ec(0x1f0)]),0x0);}catch{return 0x0;}}),0x14),_0x4b4958=[];_0x4b4958[_0x530974(0x215)](colorBorder('┌─'+'─'[_0x530974(0x210)](_0x3ac566)+_0x530974(0x1fa)+'─'[_0x530974(0x210)](_0x3afcbb)+'─┐',_0x4af8c0)),_0x46cdc2['forEach'](([_0x15a77e,_0x2192da])=>{const _0x756115=_0x530974;let _0x415415;try{_0x415415=_0x2192da===null||_0x2192da===undefined?'':typeof _0x2192da===_0x756115(0x1f4)?JSON['stringify'](_0x2192da):String(_0x2192da);}catch{_0x415415='[Object]';}const _0x28c743=_0x15a77e[_0x756115(0x1ef)](_0x3ac566),_0x8ee966=_0x415415[_0x756115(0x1f5)]('\x0a');_0x8ee966['forEach']((_0x5376ff,_0x2f7a26)=>{const _0x2eb128=_0x756115,_0x40d18d=colorBorder('│',_0x4af8c0);_0x2f7a26===0x0?_0x4b4958[_0x2eb128(0x215)](_0x40d18d+'\x20'+_0x28c743+'\x20'+_0x40d18d+'\x20'+_0x5376ff['padEnd'](_0x3afcbb)+'\x20'+_0x40d18d):_0x4b4958[_0x2eb128(0x215)](_0x40d18d+'\x20'+'\x20'[_0x2eb128(0x210)](_0x3ac566)+'\x20'+_0x40d18d+'\x20'+_0x5376ff[_0x2eb128(0x1ef)](_0x3afcbb)+'\x20'+_0x40d18d);});}),_0x4b4958[_0x530974(0x215)](colorBorder('└─'+'─'['repeat'](_0x3ac566)+'─┴─'+'─'[_0x530974(0x210)](_0x3afcbb)+'─┘',_0x4af8c0));_0x4c2508&&(_0x4b4958[_0x530974(0x215)](''),_0x4b4958['push'](String(a44_0x56cb3c['yellow']['bold'](_0x530974(0x207)))),_0x4b4958[_0x530974(0x215)](_0x4c2508));_0x168f1a&&(_0x4b4958[_0x530974(0x215)](''),_0x4b4958[_0x530974(0x215)](String(a44_0x56cb3c[_0x530974(0x1e9)][_0x530974(0x1f6)](_0x530974(0x219)))),_0x4b4958['push'](_0x168f1a));_0x183dd8&&(_0x4b4958['push'](''),_0x4b4958[_0x530974(0x215)](String(a44_0x56cb3c[_0x530974(0x20c)][_0x530974(0x1f6)](_0x530974(0x1de)))),_0x4b4958[_0x530974(0x215)](_0x183dd8));if(_0x24e72f){if(_0x24e72f[_0x530974(0x1e2)]){_0x4b4958[_0x530974(0x215)](''),_0x4b4958[_0x530974(0x215)](String(a44_0x56cb3c['red'][_0x530974(0x1f6)](_0x530974(0x21b))));const _0x48d0fb=_0x24e72f[_0x530974(0x1e2)][_0x530974(0x1f5)]('\x0a');_0x48d0fb[_0x530974(0x20e)](_0x4498a1=>{const _0x3e4141=_0x530974;_0x4498a1[_0x3e4141(0x20f)]()&&_0x4b4958[_0x3e4141(0x215)](_0x4498a1);});}if(_0x24e72f[_0x530974(0x1ff)]){_0x4b4958[_0x530974(0x215)](''),_0x4b4958[_0x530974(0x215)](String(a44_0x56cb3c['cyan'][_0x530974(0x1f6)](_0x530974(0x212))));const _0x30121f=_0x24e72f[_0x530974(0x1ff)][_0x530974(0x1f5)]('\x0a');_0x30121f[_0x530974(0x20e)](_0x1b9ab3=>{const _0x404342=_0x530974;_0x1b9ab3[_0x404342(0x20f)]()&&_0x4b4958['push'](_0x1b9ab3);});}}return _0x4b4958[_0x530974(0x208)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x7f774c,_0x7de0e4){const _0x46d217=a44_0x268e;if(_0x7de0e4[_0x46d217(0x1eb)]===_0x46d217(0x1ee)){await handleSDKOutput([_0x7f774c],_0x7de0e4);return;}const _0x1fe875=resolveOutputOptions(_0x7de0e4),_0x1180c5=await formatSingleObject(_0x7f774c,_0x1fe875);await writeOutput(_0x1180c5,_0x1fe875[_0x46d217(0x1d9)]||undefined,_0x1fe875[_0x46d217(0x1eb)]);}
|