@treasuredata/tdx 0.25.7 → 0.26.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.js +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.js +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.d.ts +7 -0
- package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +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.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +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-validator.d.ts +19 -0
- package/dist/sdk/segment/journey-validator.d.ts.map +1 -0
- package/dist/sdk/segment/journey-validator.js +1 -0
- package/dist/sdk/segment/journey-validator.js.map +1 -0
- package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +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-recovery.d.ts +42 -0
- package/dist/sdk/segment/push-recovery.d.ts.map +1 -0
- package/dist/sdk/segment/push-recovery.js +1 -0
- package/dist/sdk/segment/push-recovery.js.map +1 -0
- package/dist/sdk/segment/push-workflow.d.ts +18 -12
- package/dist/sdk/segment/push-workflow.d.ts.map +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js.map +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/types/segment-def.d.ts +2 -0
- package/dist/sdk/segment/types/segment-def.d.ts.map +1 -1
- package/dist/sdk/segment/validate-files.d.ts.map +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/validate-files.js.map +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts +7 -7
- package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment/yaml-validator.js.map +1 -1
- package/dist/sdk/segment.d.ts +5 -0
- package/dist/sdk/segment.d.ts.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/segment.js.map +1 -1
- package/dist/sdk/types/cdp.d.ts +117 -0
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.js +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/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_0x271be1=a42_0x5047;function a42_0x9d75(){const _0x341acd=['yes','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','Listing\x20workflow\x20projects...','\x20task','workflow:push','write','\x0a✔\x20Already\x20up\x20to\x20date','No\x20attempts\x20found\x20for:\x20','TASK_NAME_WIDTH','Output\x20directory:\x20','cyan','getMinutes','filesExtracted','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','3807104sJctyT','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','\x20modified','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','list','💡\x20Tip:\x20Use\x20','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','unchanged','white','skipValidation','startedAt','targetExists','deleted','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x22\x20to\x20new\x20project\x20\x22','set','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Starting\x20workflow\x20run...','isArray','resolve','localeCompare','buildTimelineData','rows','keys','Loading\x20session...','\x0aClone\x20\x22','round','renderSessionsTimeline','autocomplete','durationMs','tasks','\x0aError:','\x0aPush\x20these\x20changes?','generateSessionTimelineRows','fs/promises','sessionId','\x0aDry\x20run\x20-\x20nothing\x20pushed','blue','session','\x20-\x20','start','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','\x20from\x20session\x20','No\x20workflow\x20sessions\x20found','Error:\x20Secret\x20key\x20is\x20required','Retrying\x20attempt...','workflow:projects','Pulling\x20project\x20','Project:\x20','📋\x20','9HHBPUB','Attempt\x20ID:\x20','Workflow:\x20','\x20\x20Attempt\x20ID:\x20','push','workflow:upload','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','7907950vsFHrO','cancelRequested','POLL_INTERVAL_MS','toISOString','updatedAt','description','✔\x20Workflow\x20project\x20context\x20cleared.','format','Deleting\x20secret...','\x20\x20Revision:\x20','Revision:\x20','indexOf','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Dry\x20run:\x20yes','startTime','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','✔\x20Workflow\x20project\x20set\x20to:\x20','Getting\x20attempt\x20tasks...','tdx\x20wf\x20attempt\x20','some','execute','No\x20attempts\x20found\x20in\x20project:\x20','Key\x20cannot\x20be\x20empty','/sessions/','No\x20projects\x20match\x20pattern:\x20','Cloning\x20to\x20','\x0aUpdate\x20existing\x20project\x20\x22','Tip:\x20cd\x20to\x20workflows/','message','Source\x20directory:\x20','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Project\x20filter:\x20','unknown','-\x20nothing\x20pushed','Pushing\x20workflow\x20project...','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','resolveProjectDir','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','Latest\x20session\x20has\x20no\x20attempt','lastAttempt','reason','workflow:workflows','Target\x20directory:\x20','output','Total:\x20','canceling','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','\x22?\x20This\x20cannot\x20be\x20undone.','✔\x20Downloaded\x20','\x20\x20Project:\x20','delete','resumeFrom','Listing\x20workflows...','Session\x20not\x20found:\x20','Session\x20','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Loading\x20sessions...','resolveProjectId','new','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','sourceDir','map','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','group_error','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','join','\x20\x20tdx\x20wf\x20use\x20<project>','Usage:\x20tdx\x20wf\x20use\x20<project>','running','finishedAt','MIN_TIMELINE_WIDTH','No\x20workflows\x20found','projects','task','Show\x20specific\x20attempt\x20details','state','floor','Error:\x20Attempt\x20ID\x20is\x20required','✔\x20Deleted\x20project\x20','table','find','Warning:','green','attempts','sourceProjectName','navigateSessionsInteractive','✔\x20Showing\x20','\x20attempt','No\x20log\x20content\x20found','Setting\x20secret...','Key:\x20','changes','metadata','Listing\x20workflow\x20attempts...','11805926OUzoxp','createdAt','pollTimeline','LABEL_MIN_SPACING','projectName','✔\x20Found\x20','text','success','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','attempt:','renderSingleTimeline','\x20\x20Target:\x20','workflow:secrets:list','286022LdGHHQ','\x20\x20Files\x20extracted:\x20','getMonth','...','workflow:sessions','existingProjectId','fromTask','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','renderTimeline','targetDir','sessions','Include\x20retried:\x20yes','limit','showWorkflowConsoleUrl','index','modified','data','projectId','parse','workflow:kill','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','974390kwmmVI','\x0aDry\x20run\x20-\x20no\x20project\x20created','\x20logs','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Show\x20logs\x20for\x20a\x20workflow\x20attempt','pullProject','startsWith','error','\x20to\x20see\x20detailed\x20logs','pending','done','Writing\x20files...','utf-8','taskName','red','No\x20sessions\x20found','attempt','(unknown)','Retrying\x20session...','getFullYear','Killing\x20attempt...','Error:','Filter:\x20project=','No\x20workflow\x20projects\x20found','3086788CRDiSX','No\x20sessions\x20found\x20in\x20project:\x20','New\x20project\x20name:\x20','Listing\x20workflow\x20sessions...','fullName','Project\x20directory:\x20','\x20\x20Location:\x20','\x0aDry\x20run\x20-\x20no\x20files\x20written','\x20unchanged','workflow:retry','\x20project','Parameters:\x20','\x20of\x20','Pull\x20workflow\x20project\x20to\x20local\x20folder','follow','fileSize','hasChanges','trimEnd','Downloading\x20logs...','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','\x20\x20New\x20attempt\x20ID:\x20','status','Analyzing\x20changes...','retryAttemptName','type','substring','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','workflow:logs','\x20\x20Console:\x20','workflow:timeline','Target:\x20','param','relative','revision:\x20','length','applyPullProject','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','\x20(system)','Including\x20subtasks:\x20yes','Invalid\x20format:\x20','name','No\x20workflow\x20tdx.json\x20found','-\x20no\x20files\x20written','select','→\x20Project:\x20','path','List\x20workflow\x20execution\x20sessions','duration','slice','Source\x20directory\x20is\x20required','filter','Project\x20name\x20is\x20required','(use\x20--limit\x20to\x20see\x20more)','trim','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Select\x20a\x20session\x20to\x20view\x20timeline:','key','Params:\x20','MAX_POLL_ITERATIONS','padStart','revision','diff','workflow:tasks','Kill\x20a\x20running\x20attempt','Files\x20to\x20upload:\x20','verbose','\x20\x20Project\x20ID:\x20','\x20\x20Session\x20ID:\x20','No\x20attempts\x20found','project','sessionTime','GUTTER','Error:\x20Invalid\x20parameter\x20format:\x20','values','all','\x22\x20with\x20new\x20revision?','Pattern:\x20','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','log','setSecret','jsonl','cwd','8VIWASZ','Getting\x20attempt\x20details...','now','→\x20New\x20project:\x20','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','match','parseProjectWorkflowPattern','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','download','yellow','✔\x20Pushed\x20','params','resolveProject','3TTLKcm','Session\x20time:\x20','logs','workflowProject','Filter:\x20','isTTY','has','Retry\x20a\x20session\x20or\x20attempt','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','columns','stat','workflowName','context','site','workflow:secrets:delete','\x0a✔\x20No\x20changes\x20to\x20push','Fetching\x20log\x20files...','\x22\x20already\x20exists\x20(ID:\x20','List\x20all\x20workflow\x20projects','Source\x20project:\x20','tdx.json','\x20(use\x20--limit\x20to\x20show\x20more)','18VPCdGq','sort','json','ICON_WIDTH','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','8609103vzCPSc','summary','listSecrets','Error:\x20KEY=VALUE\x20is\x20required','stdout','clear','getTime','max','Failed\x20to\x20fetch\x20attempt\x20data','Validation:\x20skipped','✔\x20Secret\x20\x27','No\x20sessions\x20found\x20for:\x20','repeat','msPerChar','LABEL_WIDTH_DIVISOR','From\x20task:\x20','workflow:secrets:set','isDirectory','/attempt/','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Reason:\x20','attemptId','Cancelled','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','newProjectName','title','workflows','end','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','Updating\x20','getDate','isNewProject','\x1b[1A\x1b[2K','✔\x20Clone\x20complete','MAX_TIMELINE_WIDTH','📁\x20','split','total','Error:\x20Project\x20name\x20is\x20required','✔\x20Push\x20complete','Error:\x20','---\x20','✔\x20Project\x20updated','Auto-selected\x20latest\x20session:\x20','planned','\x20\x20Changes:\x20','min','Deleting\x20project\x20','\x0aFailed\x20to\x20fetch\x20attempt\x20data','No\x20matching\x20sessions\x20found','Project\x20name:\x20','executePushProject','session:','List\x20workflows','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','.\x20Expected\x20format:\x20KEY=VALUE','getHours','includeRetried','\x20\x20Session\x20context\x20set\x20to:\x20','List\x20workflow\x20attempts','dryRun','fill','sys','retrySession','requireProject','MIN_LABEL_COUNT','toLowerCase','includes','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','every','workflow','displayLine','/app/workflows/','✔\x20Project:\x20','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','Select\x20a\x20workflow\x20to\x20run','ICON_SPACING','\x20deleted','Force:\x20yes','value','window','kill','Resolving\x20project\x20\x27','get','MAX_TASKS_DISPLAY','\x20\x20Workflow:\x20','\x27\x20from\x20project\x20\x27','dim','basename','Error:\x20Invalid\x20JSON\x20in\x20--params'];a42_0x9d75=function(){return _0x341acd;};return a42_0x9d75();}(function(_0x4f22a2,_0x38f037){const _0x315b70=a42_0x5047,_0x322a97=_0x4f22a2();while(!![]){try{const _0x441419=-parseInt(_0x315b70(0x253))/0x1*(parseInt(_0x315b70(0x2c5))/0x2)+parseInt(_0x315b70(0x353))/0x3*(-parseInt(_0x315b70(0x2f3))/0x4)+-parseInt(_0x315b70(0x2db))/0x5*(parseInt(_0x315b70(0x369))/0x6)+parseInt(_0x315b70(0x221))/0x7+-parseInt(_0x315b70(0x346))/0x8*(-parseInt(_0x315b70(0x36e))/0x9)+parseInt(_0x315b70(0x25a))/0xa+parseInt(_0x315b70(0x2b8))/0xb;if(_0x441419===_0x38f037)break;else _0x322a97['push'](_0x322a97['shift']());}catch(_0x4e0af8){_0x322a97['push'](_0x322a97['shift']());}}}(a42_0x9d75,0xb00ae));import a42_0x409acc from'chalk';import{existsSync}from'fs';import a42_0x1668b6 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a42_0x5aae83 from'prompts';function getAttemptStatusDisplay(_0x5a8d89){const _0x559e3e=a42_0x5047;if(!_0x5a8d89)return{'icon':'⏳','text':''};const {done:_0x403c23,success:_0x1c6792,cancelRequested:_0x4ede20}=_0x5a8d89;if(!_0x403c23)return _0x4ede20?{'icon':'🛑','text':a42_0x409acc[_0x559e3e(0x34f)](_0x559e3e(0x287))}:{'icon':'🔄','text':a42_0x409acc['blue']('running')};if(_0x1c6792)return{'icon':'✅','text':a42_0x409acc[_0x559e3e(0x2ac)](_0x559e3e(0x2bf))};return{'icon':'❌','text':a42_0x409acc[_0x559e3e(0x2e9)](_0x559e3e(0x2e2))};}export class WorkflowBaseCommand extends BaseCommand{[a42_0x271be1(0x352)](_0x28c297,_0x424f09,_0x333cb7=0x0){const _0x5ef870=a42_0x271be1;return _0x28c297[_0x333cb7]||_0x424f09[_0x5ef870(0x356)];}[a42_0x271be1(0x1f9)](_0x199679,_0x210a89,_0x43963d=0x0){const _0x269eb3=a42_0x271be1,_0x5de757=this[_0x269eb3(0x352)](_0x199679,_0x210a89,_0x43963d);if(!_0x5de757)return console[_0x269eb3(0x2e2)](a42_0x409acc['red'](_0x269eb3(0x2f0)),_0x269eb3(0x327)),console['error'](a42_0x409acc[_0x269eb3(0x210)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x5de757;}[a42_0x271be1(0x34c)](_0x11eb0e,_0x4cfba5){const _0x3c0ed9=a42_0x271be1;if(_0x11eb0e[0x0]){const _0x25fd7e=_0x11eb0e[0x0]['split']('.');if(_0x25fd7e[_0x3c0ed9(0x315)]===0x1)return{'projectName':_0x25fd7e[0x0],'workflowName':undefined};else return _0x25fd7e[_0x3c0ed9(0x315)]===0x2?{'projectName':_0x25fd7e[0x0],'workflowName':_0x25fd7e[0x1]}:(console[_0x3c0ed9(0x2e2)](a42_0x409acc[_0x3c0ed9(0x2e9)](_0x3c0ed9(0x2f0)),_0x3c0ed9(0x269)),null);}return{'projectName':_0x4cfba5[_0x3c0ed9(0x356)],'workflowName':undefined};}[a42_0x271be1(0x27e)](_0x593a04,_0x3831ca,_0x3658f8=0x0){const _0x3936a6=a42_0x271be1;if(_0x593a04[_0x3658f8])return _0x593a04[_0x3658f8];if(_0x3831ca[_0x3936a6(0x356)]){const _0x386ab8=a42_0x1668b6['join'](process['cwd'](),_0x3936a6(0x1d3),_0x3831ca['workflowProject']);if(existsSync(a42_0x1668b6[_0x3936a6(0x29b)](_0x386ab8,_0x3936a6(0x367))))return _0x386ab8;}return undefined;}async[a42_0x271be1(0x2d3)](_0x3e0c9a,_0x40aa9b,_0x1506df){const _0x1024df=a42_0x271be1;try{const _0x571d27=await _0x3e0c9a['workflow'][_0x1024df(0x1d3)](_0x40aa9b,{'limit':0x1});if(_0x571d27[_0x1024df(0x315)]>0x0){const _0x25f9b7=_0x571d27[0x0]['id'],_0x1fd75a=getWorkflowUrl(_0x1506df,_0x25f9b7);console[_0x1024df(0x2e2)](_0x1024df(0x30f)+a42_0x409acc[_0x1024df(0x21d)](_0x1fd75a));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a42_0x271be1(0x31c)]='workflow:use';[a42_0x271be1(0x25f)]=a42_0x271be1(0x29a);async['execute'](_0x46fc8f){const _0xb8d482=a42_0x271be1,{options:_0x538258,args:_0x29f5f9,tdx:_0x473823}=_0x46fc8f,_0x2e41e7=_0x29f5f9[0x0],_0x10ee23=_0x538258[_0xb8d482(0x373)];if(_0x10ee23)return saveSessionContext({'workflow_project':undefined},_0x538258['session']),console[_0xb8d482(0x342)](a42_0x409acc[_0xb8d482(0x2ac)](_0xb8d482(0x260))),0x0;if(!_0x2e41e7)return console[_0xb8d482(0x2e2)](a42_0x409acc[_0xb8d482(0x2e9)](_0xb8d482(0x2f0)),_0xb8d482(0x327)),console['error'](a42_0x409acc[_0xb8d482(0x210)](_0xb8d482(0x29d))),console['error'](a42_0x409acc[_0xb8d482(0x210)](_0xb8d482(0x30d))),0x1;const _0x13ed42=await withSpinner(_0xb8d482(0x20b)+_0x2e41e7+'\x27...',()=>_0x473823['workflow'][_0xb8d482(0x293)](_0x2e41e7),{'verbose':_0x538258[_0xb8d482(0x335)]}),{name:_0x160e86}=_0x13ed42['data'];return saveSessionContext({'workflow_project':_0x160e86},_0x538258[_0xb8d482(0x247)]),console['log'](a42_0x409acc[_0xb8d482(0x2ac)](_0xb8d482(0x26a)+a42_0x409acc[_0xb8d482(0x21d)](_0x160e86))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a42_0x271be1(0x24f);[a42_0x271be1(0x25f)]=a42_0x271be1(0x365);async[a42_0x271be1(0x26e)](_0x57bd9c){const _0x4bb695=a42_0x271be1,{options:_0x250279,args:_0x5b71c0,tdx:_0x58c21a}=_0x57bd9c,_0x1df46c=_0x5b71c0[0x0];_0x250279['verbose']&&_0x1df46c&&console[_0x4bb695(0x2e2)](_0x4bb695(0x340)+_0x1df46c);const _0x3d42f8=await withSpinner(_0x4bb695(0x215),()=>_0x58c21a['workflow'][_0x4bb695(0x2a2)](_0x1df46c,{'limit':_0x250279['limit']}),{'verbose':_0x250279['verbose']});let _0x458545=_0x3d42f8[_0x4bb695(0x2d6)];_0x458545[_0x4bb695(0x36a)]((_0x4116f5,_0x1de789)=>_0x4116f5['name']['localeCompare'](_0x1de789[_0x4bb695(0x31c)]));const _0x2192ad=_0x250279[_0x4bb695(0x2d2)]||0x64,_0xf83f9d=_0x458545[_0x4bb695(0x315)]>=_0x2192ad?a42_0x409acc[_0x4bb695(0x210)](_0x4bb695(0x368)):'';console[_0x4bb695(0x2e2)](_0x4bb695(0x2bd)+_0x458545['length']+_0x4bb695(0x2fd)+(_0x458545[_0x4bb695(0x315)]!==0x1?'s':'')+_0xf83f9d);if(_0x250279[_0x4bb695(0x261)]==='json'||_0x250279[_0x4bb695(0x261)]===_0x4bb695(0x344)||_0x250279['format']===_0x4bb695(0x2a9))await handleSDKOutput(_0x458545,_0x250279);else{if(_0x458545[_0x4bb695(0x315)]===0x0)_0x1df46c?console[_0x4bb695(0x342)](_0x4bb695(0x272)+_0x1df46c):console[_0x4bb695(0x342)](_0x4bb695(0x2f2));else{const _0xa6f749=_0x458545['map'](_0x3d71f4=>{const _0x493ed2=_0x4bb695,_0x4f8959=_0x3d71f4[_0x493ed2(0x2b6)]?.[_0x493ed2(0x26d)](_0x4d5847=>_0x4d5847[_0x493ed2(0x32c)]===_0x493ed2(0x1f7)),_0x180954=_0x4f8959?a42_0x409acc[_0x493ed2(0x210)](_0x493ed2(0x319)):'';return _0x493ed2(0x1dc)+_0x3d71f4['name']+_0x180954;});await writeOutput(_0xa6f749[_0x4bb695(0x29b)]('\x0a'),_0x250279['output'],_0x4bb695(0x225));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a42_0x271be1(0x31c)]=a42_0x271be1(0x283);['description']=a42_0x271be1(0x1ee);async[a42_0x271be1(0x26e)](_0x103880){const _0x4c5859=a42_0x271be1,{options:_0x15ec8c,args:_0x4e489f,tdx:_0x2cc465}=_0x103880,_0x3b6d94=this[_0x4c5859(0x352)](_0x4e489f,_0x15ec8c);_0x15ec8c[_0x4c5859(0x335)]&&_0x3b6d94&&console['error'](_0x4c5859(0x279)+_0x3b6d94);const _0x3d9570=await withSpinner(_0x4c5859(0x28e),()=>_0x2cc465[_0x4c5859(0x1ff)]['workflows'](_0x3b6d94,{'limit':_0x15ec8c['limit']}),{'verbose':_0x15ec8c[_0x4c5859(0x335)]});let _0x2d85b7=_0x3d9570[_0x4c5859(0x2d6)];_0x2d85b7[_0x4c5859(0x36a)]((_0x411c4d,_0x4e75e3)=>{const _0x31beee=_0x4c5859,_0x260ed7=_0x411c4d[_0x31beee(0x31c)][_0x31beee(0x235)](_0x4e75e3['name']);if(_0x260ed7!==0x0)return _0x260ed7;return(_0x411c4d['project']?.[_0x31beee(0x31c)]||'')[_0x31beee(0x235)](_0x4e75e3[_0x31beee(0x339)]?.[_0x31beee(0x31c)]||'');});const _0x388e48=_0x15ec8c[_0x4c5859(0x2d2)]||0x64,_0x25661f=_0x2d85b7[_0x4c5859(0x315)]>=_0x388e48?a42_0x409acc[_0x4c5859(0x210)](_0x4c5859(0x368)):'';console[_0x4c5859(0x2e2)]('✔\x20Found\x20'+_0x2d85b7[_0x4c5859(0x315)]+'\x20workflow'+(_0x2d85b7[_0x4c5859(0x315)]!==0x1?'s':'')+_0x25661f);if(_0x15ec8c['format']==='json'||_0x15ec8c[_0x4c5859(0x261)]==='jsonl'||_0x15ec8c[_0x4c5859(0x261)]===_0x4c5859(0x2a9))await handleSDKOutput(_0x2d85b7,_0x15ec8c);else{if(_0x2d85b7['length']===0x0)_0x3b6d94?console[_0x4c5859(0x342)]('No\x20workflows\x20found\x20in\x20project:\x20'+_0x3b6d94):console['log'](_0x4c5859(0x2a1));else{const _0x421dba=_0x15ec8c[_0x4c5859(0x360)],_0x2ebe51=_0x2d85b7[_0x4c5859(0x297)](_0x20daeb=>{const _0xdbd3ad=_0x4c5859,_0xddf1a6=a42_0x409acc[_0xdbd3ad(0x210)]('#'+_0x20daeb['id']),_0x42b790=hyperlink(_0xddf1a6,getWorkflowUrl(_0x421dba,_0x20daeb['id'])),_0x3eb2ac=_0x20daeb[_0xdbd3ad(0x339)]?.[_0xdbd3ad(0x31c)]?a42_0x409acc[_0xdbd3ad(0x210)]('\x20('+_0x20daeb['project']['name']+')'):'';return _0xdbd3ad(0x252)+_0x42b790+'\x20'+_0x20daeb[_0xdbd3ad(0x31c)]+_0x3eb2ac;});await writeOutput(_0x2ebe51[_0x4c5859(0x29b)]('\x0a'),_0x15ec8c['output'],_0x4c5859(0x225));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a42_0x271be1(0x31c)]=a42_0x271be1(0x2c9);[a42_0x271be1(0x25f)]=a42_0x271be1(0x322);async[a42_0x271be1(0x26e)](_0x1d4927){const _0x2b7cdc=a42_0x271be1,{options:_0x346bb7,args:_0x1bafaa,tdx:_0x5ce1b4}=_0x1d4927,_0x8b9050=this[_0x2b7cdc(0x34c)](_0x1bafaa,_0x346bb7);if(!_0x8b9050)return 0x1;const {projectName:_0x425691,workflowName:_0x197ae9}=_0x8b9050;if(_0x346bb7[_0x2b7cdc(0x335)]){if(_0x425691&&_0x197ae9)console[_0x2b7cdc(0x2e2)](_0x2b7cdc(0x357)+_0x425691+'.'+_0x197ae9);else _0x425691&&console['error'](_0x2b7cdc(0x2f1)+_0x425691);const _0x518275=_0x346bb7[_0x2b7cdc(0x308)];_0x518275&&console['error']('Status:\x20'+_0x518275);}let _0xa50d3a=0x28;if(process[_0x2b7cdc(0x372)][_0x2b7cdc(0x358)]&&!_0x346bb7['output']&&!_0x346bb7['format']){const _0x3ca810=process[_0x2b7cdc(0x372)][_0x2b7cdc(0x237)]||0x28;_0xa50d3a=Math[_0x2b7cdc(0x375)](0x14,Math[_0x2b7cdc(0x2a6)](_0x3ca810*0x2/0x3));}const _0x1519ea=_0x346bb7[_0x2b7cdc(0x2d2)]||_0xa50d3a,_0x5c1781=await withSpinner(_0x2b7cdc(0x2f6),()=>_0x5ce1b4[_0x2b7cdc(0x1ff)]['sessions']({'projectName':_0x425691,'workflowName':_0x197ae9,'status':_0x346bb7[_0x2b7cdc(0x308)],'fromTime':_0x346bb7['from'],'toTime':_0x346bb7['to'],'limit':_0x1519ea}),{'verbose':_0x346bb7[_0x2b7cdc(0x335)]}),_0x47708c=_0x5c1781[_0x2b7cdc(0x2d6)];_0x47708c[_0x2b7cdc(0x36a)]((_0x3e49ce,_0x16b295)=>{const _0x490576=_0x2b7cdc,_0x34edc2=_0x3e49ce['sessionTime']||'',_0x36b2d1=_0x16b295[_0x490576(0x33a)]||'';return _0x36b2d1[_0x490576(0x235)](_0x34edc2);});_0x47708c['length']>=_0x1519ea?console[_0x2b7cdc(0x2e2)](_0x2b7cdc(0x2b0)+_0x47708c[_0x2b7cdc(0x315)]+'\x20sessions\x20'+a42_0x409acc[_0x2b7cdc(0x210)](_0x2b7cdc(0x328))):console['error'](_0x2b7cdc(0x2bd)+_0x47708c['length']+'\x20session'+(_0x47708c[_0x2b7cdc(0x315)]!==0x1?'s':''));if(_0x346bb7[_0x2b7cdc(0x261)]==='json'||_0x346bb7[_0x2b7cdc(0x261)]==='jsonl'||_0x346bb7[_0x2b7cdc(0x261)]===_0x2b7cdc(0x2a9))await handleSDKOutput(_0x47708c,_0x346bb7);else{if(!process[_0x2b7cdc(0x372)]['isTTY']||_0x346bb7[_0x2b7cdc(0x285)]){if(_0x47708c['length']===0x0){if(_0x425691&&_0x197ae9)console[_0x2b7cdc(0x342)](_0x2b7cdc(0x379)+_0x425691+'.'+_0x197ae9);else _0x425691?console[_0x2b7cdc(0x342)](_0x2b7cdc(0x2f4)+_0x425691):console[_0x2b7cdc(0x342)](_0x2b7cdc(0x2ea));}else{const _0x469fa4=_0x346bb7[_0x2b7cdc(0x360)],_0x3063e5=this['renderSessionsTimeline'](_0x47708c,_0x469fa4);_0x346bb7[_0x2b7cdc(0x285)]?await writeOutput(_0x3063e5,_0x346bb7[_0x2b7cdc(0x285)],_0x2b7cdc(0x225)):console[_0x2b7cdc(0x342)](_0x3063e5);}!_0x425691&&(console[_0x2b7cdc(0x2e2)](''),console[_0x2b7cdc(0x2e2)](a42_0x409acc[_0x2b7cdc(0x210)](_0x2b7cdc(0x2cc))),console[_0x2b7cdc(0x2e2)](a42_0x409acc['dim'](_0x2b7cdc(0x341))+'or'+a42_0x409acc[_0x2b7cdc(0x210)](_0x2b7cdc(0x29c))));}else{if(_0x47708c['length']===0x0){if(_0x425691&&_0x197ae9)console[_0x2b7cdc(0x342)](_0x2b7cdc(0x379)+_0x425691+'.'+_0x197ae9);else _0x425691?console[_0x2b7cdc(0x342)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x425691):console[_0x2b7cdc(0x342)](_0x2b7cdc(0x2ea));}else await this[_0x2b7cdc(0x2af)](_0x47708c,_0x1d4927,_0x425691);}}return 0x0;}[a42_0x271be1(0x23c)](_0x40c4ce,_0x2dcc73){const _0x5c5042=a42_0x271be1,_0x22679d=[],_0x339cb3=new Map();let _0x110929=Infinity,_0x52ac98=-Infinity;for(const _0x8e113d of _0x40c4ce){if(_0x8e113d['lastAttempt']?.[_0x5c5042(0x2b9)]){const _0x55264d=new Date(_0x8e113d[_0x5c5042(0x281)][_0x5c5042(0x2b9)])[_0x5c5042(0x374)](),_0x35f5b3=_0x8e113d[_0x5c5042(0x281)][_0x5c5042(0x29f)]?new Date(_0x8e113d[_0x5c5042(0x281)][_0x5c5042(0x29f)])['getTime']():Date[_0x5c5042(0x348)](),_0x290f5e=_0x8e113d[_0x5c5042(0x339)]?.[_0x5c5042(0x31c)]||_0x5c5042(0x2ec);!_0x339cb3[_0x5c5042(0x359)](_0x290f5e)&&_0x339cb3[_0x5c5042(0x230)](_0x290f5e,[]),_0x339cb3[_0x5c5042(0x20c)](_0x290f5e)[_0x5c5042(0x257)]({'session':_0x8e113d,'startTime':_0x55264d,'endTime':_0x35f5b3,'duration':_0x35f5b3-_0x55264d}),_0x110929=Math[_0x5c5042(0x1e7)](_0x110929,_0x55264d),_0x52ac98=Math[_0x5c5042(0x375)](_0x52ac98,_0x35f5b3);}}if(_0x339cb3['size']===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x4c90f3=process['stdout'][_0x5c5042(0x35c)]||0x78,_0x3a0e86=0x1e,_0x5605ad=0x32,_0x51367f=0x4,_0x510599=Math[_0x5c5042(0x1e7)](_0x5605ad,Math['max'](_0x3a0e86,Math[_0x5c5042(0x2a6)](_0x4c90f3*0.3))),_0x30a037=_0x4c90f3-_0x510599-TIMELINE_CONFIG[_0x5c5042(0x33b)]-0x3-_0x51367f,_0x3a2c46=_0x52ac98-_0x110929,_0x2a0fa9=_0x3a2c46/_0x510599,_0x2d865f=renderTimeAxis({'startTime':_0x110929,'endTime':_0x52ac98,'durationMs':_0x3a2c46,'msPerChar':_0x2a0fa9},_0x510599),_0x57c0e1=[];for(const _0xab64c7 of _0x339cb3[_0x5c5042(0x33d)]()){_0x57c0e1[_0x5c5042(0x257)](..._0xab64c7);}_0x57c0e1[_0x5c5042(0x36a)]((_0x463c26,_0x607af9)=>_0x607af9[_0x5c5042(0x268)]-_0x463c26[_0x5c5042(0x268)]);const _0x410af3=new Date(_0x110929),_0x8bfc54=formatDate(_0x410af3),_0x117c3e=_0x51367f+TIMELINE_CONFIG[_0x5c5042(0x36c)]+TIMELINE_CONFIG[_0x5c5042(0x205)]+_0x30a037,_0x916c56='\x20'[_0x5c5042(0x37a)](_0x117c3e-_0x8bfc54['length']),_0x54c205=_0x916c56+a42_0x409acc[_0x5c5042(0x210)](_0x8bfc54)+'\x20'+_0x2d865f;_0x22679d[_0x5c5042(0x257)](_0x54c205);const _0x4a31c2=0x16;let _0x42057d=0x0;for(const _0x292d14 of _0x57c0e1){const _0x438d02=_0x292d14[_0x5c5042(0x247)][_0x5c5042(0x339)]?.[_0x5c5042(0x31c)]||'?',_0x1da2d0=Math['min'](stringWidth(_0x438d02),_0x4a31c2);_0x42057d=Math[_0x5c5042(0x375)](_0x42057d,_0x1da2d0);}for(const _0x4b1f5f of _0x57c0e1){const {session:_0x8961a8,startTime:_0x4e39b6,endTime:_0x2e9a2d,duration:_0x3d5729}=_0x4b1f5f,_0x1190d0=_0x8961a8[_0x5c5042(0x339)]?.['id'],_0x3f50af=_0x8961a8['id'],_0x566cb1=_0x8961a8[_0x5c5042(0x339)]?.[_0x5c5042(0x31c)]||'?',_0x5912e8=_0x8961a8[_0x5c5042(0x1ff)]?.[_0x5c5042(0x31c)]||'?';let _0x261c08,_0x50a96f;if(_0x8961a8[_0x5c5042(0x281)]){const _0x151695=_0x8961a8[_0x5c5042(0x281)];!_0x151695[_0x5c5042(0x2e5)]?(_0x261c08=_0x151695[_0x5c5042(0x25b)]?'🛑':'🔄',_0x50a96f=_0x151695['cancelRequested']?a42_0x409acc[_0x5c5042(0x34f)]:a42_0x409acc['blue']):(_0x261c08=_0x151695[_0x5c5042(0x2bf)]?'✅':'❌',_0x50a96f=_0x151695[_0x5c5042(0x2bf)]?a42_0x409acc[_0x5c5042(0x2ac)]:a42_0x409acc[_0x5c5042(0x2e9)]);}else _0x261c08='⏳',_0x50a96f=a42_0x409acc[_0x5c5042(0x210)];const _0x25e0db='#'+_0x3f50af,_0x4ebd8c=_0x1190d0?hyperlink(_0x25e0db,getWorkflowSessionUrl(_0x2dcc73,_0x1190d0,_0x3f50af)):_0x25e0db;let _0x456a1e=_0x566cb1;stringWidth(_0x566cb1)>_0x4a31c2&&(_0x456a1e=_0x566cb1[_0x5c5042(0x324)](0x0,_0x4a31c2-0x1)+'…');const _0x1528c7=a42_0x409acc['dim'](_0x456a1e),_0x2f3414=stringWidth(_0x456a1e),_0x27fd0c='\x20'[_0x5c5042(0x37a)](_0x42057d-stringWidth(_0x456a1e)+0x2),_0x1fce54='('+formatElapsed(_0x3d5729)+')',_0x58dabb=stringWidth(_0x1fce54),_0x28bad2=stringWidth(_0x25e0db),_0x5e2df3=_0x28bad2+0x1+_0x2f3414+_0x27fd0c[_0x5c5042(0x315)],_0x31a5d1=_0x30a037-_0x5e2df3-_0x58dabb-0x1-0x8;let _0x41f5cd=_0x5912e8;stringWidth(_0x41f5cd)>_0x31a5d1&&(_0x41f5cd=_0x41f5cd[_0x5c5042(0x324)](0x0,_0x31a5d1-0x1)+'…');const _0x7eee0d=_0x4ebd8c+'\x20'+_0x1528c7+_0x27fd0c+_0x41f5cd,_0xf646aa=stringWidth(_0x7eee0d),_0x4d072b=_0x30a037-_0xf646aa-_0x58dabb,_0x52a7dc=_0x7eee0d+'\x20'['repeat'](Math[_0x5c5042(0x375)](0x1,_0x4d072b))+a42_0x409acc[_0x5c5042(0x210)](_0x1fce54),_0x4c26fd=Math['floor']((_0x4e39b6-_0x110929)/_0x2a0fa9),_0x7b1b78=Math[_0x5c5042(0x2a6)]((_0x2e9a2d-_0x110929)/_0x2a0fa9),_0x40c6d3=Math['max'](_0x4c26fd+0x1,_0x7b1b78),_0x3a9a8f=new Array(_0x510599)[_0x5c5042(0x1f6)]('\x20');for(let _0x28a69e=_0x4c26fd;_0x28a69e<Math[_0x5c5042(0x1e7)](_0x40c6d3,_0x510599);_0x28a69e++){_0x3a9a8f[_0x28a69e]='─';}const _0x1ed629=_0x3a9a8f['map'](_0x36542c=>_0x36542c==='\x20'?'\x20':_0x50a96f(_0x36542c))[_0x5c5042(0x29b)]('');_0x22679d[_0x5c5042(0x257)](_0x261c08+'\x20'+_0x52a7dc+'│'+_0x1ed629+'│');}return _0x22679d[_0x5c5042(0x29b)]('\x0a');}async[a42_0x271be1(0x2af)](_0x137cd1,_0x1929ff,_0x77ea){const _0x47009b=a42_0x271be1,{options:_0x76c35d,tdx:_0x440fe0}=_0x1929ff,_0xac2d0c=_0x76c35d[_0x47009b(0x360)],{timelineRows:_0x4f2ee7,timeAxisHeader:_0x57a9d7}=this['generateSessionTimelineRows'](_0x137cd1,_0xac2d0c),_0x2edefa=_0x4f2ee7['filter'](_0x4ccdb6=>_0x4ccdb6[_0x47009b(0x383)]);if(_0x2edefa['length']===0x0){const _0x364188=this[_0x47009b(0x23c)](_0x137cd1,_0xac2d0c);console[_0x47009b(0x342)](_0x364188);!_0x77ea&&(console[_0x47009b(0x2e2)](''),console[_0x47009b(0x2e2)](a42_0x409acc[_0x47009b(0x210)](_0x47009b(0x2cc))),console[_0x47009b(0x2e2)](a42_0x409acc['dim']('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a42_0x409acc[_0x47009b(0x210)](_0x47009b(0x29c))));return;}_0x57a9d7&&console[_0x47009b(0x342)](_0x57a9d7);const _0x2de29c=_0x4f2ee7[_0x47009b(0x326)](_0x13c018=>_0x13c018[_0x47009b(0x383)])[_0x47009b(0x297)](_0xe8858b=>({'title':_0xe8858b[_0x47009b(0x200)],'value':_0xe8858b['attemptId']})),_0x438950=process[_0x47009b(0x372)][_0x47009b(0x237)]||0x3c,_0x3406c6=Math[_0x47009b(0x375)](0x28,Math['floor'](_0x438950*0x2/0x3)),_0x36dd7d=await a42_0x5aae83({'type':_0x47009b(0x23d),'name':_0x47009b(0x383),'message':_0x47009b(0x214),'choices':_0x2de29c,'initial':-0x1,'limit':_0x3406c6,'clearFirst':!![],'fallback':{'title':_0x47009b(0x1ea),'value':null},'suggest':(_0x497919,_0xd7d104)=>{const _0x27b8ff=_0x47009b;if(!_0x497919)return Promise[_0x27b8ff(0x234)](_0xd7d104);const _0x49f670=_0xd7d104[_0x27b8ff(0x326)](_0x44f8c6=>{const _0x31b321=_0x27b8ff,_0x46088d=_0x44f8c6;return _0x46088d[_0x31b321(0x387)][_0x31b321(0x1fb)]()[_0x31b321(0x1fc)](_0x497919[_0x31b321(0x1fb)]());});return Promise[_0x27b8ff(0x234)](_0x49f670);}}),_0x58ea01=()=>{const _0x13de0f=_0x47009b;process[_0x13de0f(0x372)]['write']('\x1b[1A\x1b[2K'),process[_0x13de0f(0x372)][_0x13de0f(0x218)](_0x13de0f(0x1d9)),process['stdout'][_0x13de0f(0x218)]('\x1b[1A\x1b[2K');},_0x3da2cb=_0x36dd7d&&_0x36dd7d[_0x47009b(0x383)]&&_0x36dd7d[_0x47009b(0x383)]!==null&&_0x36dd7d[_0x47009b(0x383)][_0x47009b(0x329)]()!=='';if(!_0x3da2cb){_0x58ea01(),console[_0x47009b(0x342)](a42_0x409acc[_0x47009b(0x210)](_0x47009b(0x384)));return;}_0x58ea01();const _0x2b7e56=_0x137cd1[_0x47009b(0x2aa)](_0x5f2927=>_0x5f2927['lastAttempt']?.['id']===_0x36dd7d[_0x47009b(0x383)]);if(_0x2b7e56){const _0x2ac635=_0x2b7e56[_0x47009b(0x339)]?.[_0x47009b(0x31c)]||'?',_0x1ad4a1=_0x2b7e56[_0x47009b(0x1ff)]?.[_0x47009b(0x31c)]||'?';console['log'](_0x47009b(0x251)+a42_0x409acc[_0x47009b(0x210)](_0x2ac635)+',\x20Workflow:\x20'+a42_0x409acc['dim'](_0x1ad4a1));}const _0x3eb5fa=new WorkflowTimelineCommand();await _0x3eb5fa['execute']({'args':[],'options':{..._0x76c35d,'attemptId':_0x36dd7d[_0x47009b(0x383)]},'tdx':_0x440fe0});}[a42_0x271be1(0x242)](_0xd8f23b,_0x43ab9c){const _0xe18327=a42_0x271be1,_0x34aecf=new Map();for(const _0x11ab86 of _0xd8f23b){_0x11ab86['id']&&_0x11ab86[_0xe18327(0x281)]?.['id']&&_0x34aecf[_0xe18327(0x230)](_0x11ab86['id'],_0x11ab86[_0xe18327(0x281)]['id']);}const _0x57d05b=[];let _0x1eb1b4='';const _0x571694=this[_0xe18327(0x23c)](_0xd8f23b,_0x43ab9c),_0x3328da=_0x571694['split']('\x0a');for(const _0x1cf0e6 of _0x3328da){if(_0x1cf0e6[_0xe18327(0x2e1)](_0xe18327(0x385))||_0x1cf0e6[_0xe18327(0x34b)](/^\s+\d{4}-\d{2}-\d{2}/))_0x1eb1b4=_0x1cf0e6;else{if(_0x1cf0e6[_0xe18327(0x34b)](/^[✅❌🔄🛑⏳]/)){const _0x210845=_0x1cf0e6[_0xe18327(0x34b)](/#(\d+)/),_0x3a084c=_0x210845?_0x210845[0x1]:null,_0x2ae05e=_0x3a084c?_0x34aecf[_0xe18327(0x20c)](_0x3a084c)||null:null,_0x4eb807=_0xd8f23b[_0xe18327(0x2aa)](_0x47fc2a=>_0x47fc2a['id']===_0x3a084c),_0x35a080=_0x4eb807?.[_0xe18327(0x339)]?.['name']||'';_0x57d05b[_0xe18327(0x257)]({'displayLine':_0x1cf0e6,'attemptId':_0x2ae05e,'projectName':_0x35a080});}}}return{'timelineRows':_0x57d05b,'timeAxisHeader':_0x1eb1b4};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a42_0x271be1(0x31c)]='workflow:attempts';['description']=a42_0x271be1(0x1f4);async[a42_0x271be1(0x26e)](_0x410927){const _0xc8507d=a42_0x271be1,{options:_0x4450c8,args:_0x31763b,tdx:_0x589523}=_0x410927,_0x3deee4=this[_0xc8507d(0x34c)](_0x31763b,_0x4450c8);if(!_0x3deee4)return 0x1;const {projectName:_0x42de13,workflowName:_0x16afa2}=_0x3deee4,_0x1ff49=_0x4450c8[_0xc8507d(0x1f2)];if(_0x4450c8['verbose']){if(_0x42de13&&_0x16afa2)console[_0xc8507d(0x2e2)](_0xc8507d(0x357)+_0x42de13+'.'+_0x16afa2);else _0x42de13&&console[_0xc8507d(0x2e2)](_0xc8507d(0x2f1)+_0x42de13);_0x1ff49&&console['error'](_0xc8507d(0x2d1));}const _0x4d5dc1=await withSpinner(_0xc8507d(0x2b7),()=>_0x589523[_0xc8507d(0x1ff)][_0xc8507d(0x2ad)]({'projectName':_0x42de13,'workflowName':_0x16afa2,'includeRetried':_0x1ff49,'limit':_0x4450c8[_0xc8507d(0x2d2)]}),{'verbose':_0x4450c8[_0xc8507d(0x335)]}),_0x2dc88d=_0x4d5dc1[_0xc8507d(0x2d6)],_0x32315e=_0x4450c8[_0xc8507d(0x2d2)]||0x64,_0x12f4f5=_0x2dc88d[_0xc8507d(0x315)]>=_0x32315e?a42_0x409acc[_0xc8507d(0x210)](_0xc8507d(0x368)):'';console[_0xc8507d(0x2e2)](_0xc8507d(0x2bd)+_0x2dc88d[_0xc8507d(0x315)]+_0xc8507d(0x2b1)+(_0x2dc88d['length']!==0x1?'s':'')+_0x12f4f5);if(_0x4450c8['format']==='json'||_0x4450c8['format']===_0xc8507d(0x344)||_0x4450c8[_0xc8507d(0x261)]==='table')await handleSDKOutput(_0x2dc88d,_0x4450c8);else{if(_0x2dc88d[_0xc8507d(0x315)]===0x0){if(_0x42de13&&_0x16afa2)console['log'](_0xc8507d(0x21a)+_0x42de13+'.'+_0x16afa2);else _0x42de13?console[_0xc8507d(0x342)](_0xc8507d(0x26f)+_0x42de13):console[_0xc8507d(0x342)](_0xc8507d(0x338));}else{const _0x57fe36=_0x4450c8[_0xc8507d(0x360)],_0x352d57=_0x2dc88d[_0xc8507d(0x297)](_0x137117=>{const _0x532f46=_0xc8507d,_0x22fb87=a42_0x409acc[_0x532f46(0x210)]('#'+_0x137117['id']),_0x3b142d=_0x137117['project']?.['id'],_0x139c53=_0x137117['session_id']||_0x137117[_0x532f46(0x244)],_0x31072a=_0x3b142d&&_0x139c53?hyperlink(_0x22fb87,getWorkflowAttemptUrl(_0x57fe36,_0x3b142d,_0x139c53,_0x137117['id'])):_0x22fb87,{icon:_0xd69150,text:_0x13e4df}=getAttemptStatusDisplay(_0x137117),_0x22d008=(_0x137117[_0x532f46(0x339)]?.[_0x532f46(0x31c)]||'?')+'.'+(_0x137117[_0x532f46(0x1ff)]?.['name']||'?'),_0x2310ac=_0x137117[_0x532f46(0x33a)]?a42_0x409acc[_0x532f46(0x210)](_0x137117['sessionTime']):'';return(_0x31072a+'\x20'+_0xd69150+(_0x13e4df?'\x20'+_0x13e4df:'')+'\x20'+_0x22d008+'\x20'+_0x2310ac)[_0x532f46(0x304)]();});await writeOutput(_0x352d57[_0xc8507d(0x29b)]('\x0a'),_0x4450c8[_0xc8507d(0x285)],'list');}}return 0x0;}}function a42_0x5047(_0xb2beb2,_0x4dce4f){_0xb2beb2=_0xb2beb2-0x1d3;const _0x9d75cc=a42_0x9d75();let _0x504738=_0x9d75cc[_0xb2beb2];return _0x504738;}export class WorkflowAttemptCommand extends BaseCommand{[a42_0x271be1(0x31c)]='workflow:attempt';['description']=a42_0x271be1(0x2a4);async[a42_0x271be1(0x26e)](_0x2afaa1){const _0x11b719=a42_0x271be1,{options:_0x34046b,args:_0x3d9c46,tdx:_0x426412}=_0x2afaa1,_0x4742e7=_0x3d9c46[0x0];if(!_0x4742e7)return console[_0x11b719(0x2e2)](_0x11b719(0x2a7)),0x1;_0x34046b[_0x11b719(0x335)]&&console[_0x11b719(0x2e2)]('Attempt\x20ID:\x20'+_0x4742e7);const _0x1a893a=await withSpinner(_0x11b719(0x347),()=>_0x426412['workflow'][_0x11b719(0x2eb)](_0x4742e7),{'verbose':_0x34046b['verbose']}),_0x3d56cb=_0x1a893a[_0x11b719(0x2d6)];let _0x2edac5;!_0x3d56cb[_0x11b719(0x2e5)]?_0x2edac5=_0x3d56cb[_0x11b719(0x25b)]?_0x11b719(0x287):_0x11b719(0x29e):_0x2edac5=_0x3d56cb['success']?_0x11b719(0x2bf):_0x11b719(0x2e2);let _0x44a467;if(_0x3d56cb[_0x11b719(0x2b9)]&&_0x3d56cb[_0x11b719(0x29f)]){const _0x34b854=new Date(_0x3d56cb[_0x11b719(0x2b9)])[_0x11b719(0x374)](),_0x521561=new Date(_0x3d56cb['finishedAt'])[_0x11b719(0x374)]();_0x44a467=Math[_0x11b719(0x23b)]((_0x521561-_0x34b854)/0x3e8);}const _0x3cac89={'attempt_id':_0x3d56cb['id'],'status':_0x2edac5,..._0x3d56cb[_0x11b719(0x2d4)]!==undefined&&{'index':_0x3d56cb[_0x11b719(0x2d4)]},..._0x3d56cb[_0x11b719(0x339)]&&{'project':_0x3d56cb['project'][_0x11b719(0x31c)]},..._0x3d56cb['workflow']&&{'workflow':_0x3d56cb[_0x11b719(0x1ff)][_0x11b719(0x31c)]},..._0x3d56cb[_0x11b719(0x244)]&&{'session_id':_0x3d56cb[_0x11b719(0x244)]},..._0x3d56cb[_0x11b719(0x33a)]&&{'session_time':_0x3d56cb[_0x11b719(0x33a)]},..._0x3d56cb[_0x11b719(0x30a)]&&{'retry_attempt':_0x3d56cb[_0x11b719(0x30a)]},..._0x44a467!==undefined&&{'duration_sec':_0x44a467},..._0x3d56cb[_0x11b719(0x2b9)]&&{'created_at':_0x3d56cb[_0x11b719(0x2b9)]},..._0x3d56cb[_0x11b719(0x29f)]&&{'finished_at':_0x3d56cb['finishedAt']},...Object[_0x11b719(0x238)](_0x3d56cb['params'])[_0x11b719(0x315)]>0x0&&{'params':_0x3d56cb[_0x11b719(0x351)]}};return await handleSingleObjectOutput(_0x3cac89,_0x34046b),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a42_0x271be1(0x31c)]=a42_0x271be1(0x332);[a42_0x271be1(0x25f)]='Show\x20tasks\x20for\x20an\x20attempt';async[a42_0x271be1(0x26e)](_0x53cd08){const _0x1774f8=a42_0x271be1,{options:_0x4d08ec,args:_0x4b3f0f,tdx:_0x16a8b6}=_0x53cd08,_0x581b9c=_0x4b3f0f[0x0];if(!_0x581b9c)return console[_0x1774f8(0x2e2)](_0x1774f8(0x2a7)),0x1;const _0x1cd4d6=_0x4d08ec['includeSubtasks'];_0x4d08ec[_0x1774f8(0x335)]&&(console[_0x1774f8(0x2e2)](_0x1774f8(0x254)+_0x581b9c),_0x1cd4d6&&console[_0x1774f8(0x2e2)](_0x1774f8(0x31a)));const _0x49543c=await withSpinner(_0x1774f8(0x26b),()=>_0x16a8b6[_0x1774f8(0x1ff)][_0x1774f8(0x23f)](_0x581b9c,_0x1cd4d6||![]),{'verbose':_0x4d08ec[_0x1774f8(0x335)]}),_0x41b93e=_0x49543c['data'];return console[_0x1774f8(0x2e2)]('✔\x20Found\x20'+_0x41b93e['length']+_0x1774f8(0x216)+(_0x41b93e[_0x1774f8(0x315)]!==0x1?'s':'')),await handleSDKOutput(_0x41b93e,_0x4d08ec),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a42_0x271be1(0x31c)]=a42_0x271be1(0x30e);[a42_0x271be1(0x25f)]=a42_0x271be1(0x2df);async['execute'](_0x17b553){const _0x20f61a=a42_0x271be1,{options:_0x2a823e,args:_0x5e9106,tdx:_0x352e0e}=_0x17b553,_0x36498c=_0x5e9106[0x0];let _0x26dbcf=_0x5e9106[0x1];if(!_0x36498c)return console[_0x20f61a(0x2e2)](_0x20f61a(0x2a7)),0x1;_0x2a823e[_0x20f61a(0x335)]&&(console['error'](_0x20f61a(0x254)+_0x36498c),_0x26dbcf&&console[_0x20f61a(0x2e2)]('Task\x20name:\x20'+_0x26dbcf));const _0x342a6a=await withSpinner(_0x20f61a(0x363),()=>_0x352e0e[_0x20f61a(0x1ff)]['logFiles'](_0x36498c,_0x26dbcf),{'verbose':_0x2a823e[_0x20f61a(0x335)]}),_0x25c664=_0x342a6a[_0x20f61a(0x2d6)];if(_0x25c664[_0x20f61a(0x315)]===0x0)return console['error'](_0x20f61a(0x2de)),0x0;if(!_0x26dbcf&&(_0x2a823e[_0x20f61a(0x36b)]||_0x2a823e[_0x20f61a(0x261)]))return await handleSDKOutput(_0x25c664,_0x2a823e),0x0;if(!_0x26dbcf){const _0x4f1331=_0x25c664['map'](_0x32d0f0=>({'title':_0x32d0f0['taskName']+'\x20('+formatBytes(_0x32d0f0[_0x20f61a(0x302)])+')','value':_0x32d0f0[_0x20f61a(0x2e8)]})),_0x500a91=await a42_0x5aae83({'type':_0x20f61a(0x31f),'name':_0x20f61a(0x2a3),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x4f1331});if(!_0x500a91[_0x20f61a(0x2a3)])return console[_0x20f61a(0x2e2)](_0x20f61a(0x384)),0x0;_0x26dbcf=_0x500a91[_0x20f61a(0x2a3)];}const _0x21e5bb=await withSpinner(_0x20f61a(0x305),()=>_0x352e0e[_0x20f61a(0x1ff)][_0x20f61a(0x355)](_0x36498c,_0x26dbcf),{'verbose':_0x2a823e['verbose']}),_0x184d79=_0x21e5bb[_0x20f61a(0x2d6)];return _0x184d79?console[_0x20f61a(0x342)](_0x184d79):console[_0x20f61a(0x2e2)](_0x20f61a(0x2b2)),0x0;}}export class WorkflowKillCommand extends BaseCommand{['name']=a42_0x271be1(0x2d9);[a42_0x271be1(0x25f)]=a42_0x271be1(0x333);async['execute'](_0x1498eb){const _0x258d52=a42_0x271be1,{options:_0x2bda0e,args:_0x585cf0,tdx:_0x3de4a6}=_0x1498eb,_0x4c7793=_0x585cf0[0x0];if(!_0x4c7793)return console[_0x258d52(0x2e2)](_0x258d52(0x2a7)),0x1;const _0x46fdd=_0x2bda0e[_0x258d52(0x282)];_0x2bda0e[_0x258d52(0x335)]&&(console[_0x258d52(0x2e2)]('Attempt\x20ID:\x20'+_0x4c7793),_0x46fdd&&console['error'](_0x258d52(0x382)+_0x46fdd));if(!_0x2bda0e[_0x258d52(0x213)]){if(!isInteractive())return console[_0x258d52(0x2e2)](a42_0x409acc['red'](_0x258d52(0x240)),_0x258d52(0x34d)),console['error'](a42_0x409acc[_0x258d52(0x210)](_0x258d52(0x1fd))),0x1;const _0x1d2f01=await confirmKey(_0x258d52(0x266)+_0x4c7793+'?');if(!_0x1d2f01)return console[_0x258d52(0x2e2)](a42_0x409acc[_0x258d52(0x34f)](_0x258d52(0x384))),0x1;}const _0x10ed07=await withSpinner(_0x258d52(0x2ef),()=>_0x3de4a6[_0x258d52(0x1ff)][_0x258d52(0x20a)](_0x4c7793,_0x46fdd),{'verbose':_0x2bda0e[_0x258d52(0x335)]}),_0x52de91=_0x10ed07['data'];return console[_0x258d52(0x2e2)]('✔\x20'+_0x52de91),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a42_0x271be1(0x2fc);[a42_0x271be1(0x25f)]=a42_0x271be1(0x35a);async[a42_0x271be1(0x26e)](_0xae2aa4){const _0x4e1cf9=a42_0x271be1,{options:_0x31c75c,args:_0x42572f,tdx:_0x55e210}=_0xae2aa4,_0x37da7d=_0x42572f[0x0];if(!_0x37da7d)return console[_0x4e1cf9(0x2e2)](_0x4e1cf9(0x381)),console[_0x4e1cf9(0x2e2)](_0x4e1cf9(0x298)),0x1;let _0x3ab2e0=![],_0x350957=_0x37da7d;if(_0x37da7d['startsWith'](_0x4e1cf9(0x1ed)))_0x3ab2e0=!![],_0x350957=_0x37da7d[_0x4e1cf9(0x30c)](0x8);else{if(_0x37da7d[_0x4e1cf9(0x2e1)](_0x4e1cf9(0x2c1)))_0x3ab2e0=![],_0x350957=_0x37da7d['substring'](0x8);else return console['error'](_0x4e1cf9(0x22e)),console[_0x4e1cf9(0x2e2)](_0x4e1cf9(0x298)),0x1;}const _0x407186=_0x31c75c[_0x4e1cf9(0x2cb)],_0xfd877=_0x31c75c[_0x4e1cf9(0x28d)],_0x244be5=_0x31c75c[_0x4e1cf9(0x351)],_0x5065b8=_0x31c75c['force'];_0x31c75c[_0x4e1cf9(0x335)]&&(console[_0x4e1cf9(0x2e2)](_0x4e1cf9(0x311)+(_0x3ab2e0?_0x4e1cf9(0x247):_0x4e1cf9(0x2eb))+'\x20'+_0x350957),_0x407186&&console[_0x4e1cf9(0x2e2)](_0x4e1cf9(0x37d)+_0x407186),_0xfd877&&console[_0x4e1cf9(0x2e2)]('Resume\x20from:\x20'+_0xfd877),_0x244be5&&console['error'](_0x4e1cf9(0x32d)+_0x244be5),_0x5065b8&&console[_0x4e1cf9(0x2e2)](_0x4e1cf9(0x207)));let _0x4cb548;if(_0x244be5)try{if(_0x244be5[_0x4e1cf9(0x2e1)]('@')){const _0xaed3b7=await import(_0x4e1cf9(0x243)),_0x5ad31c=_0x244be5[_0x4e1cf9(0x30c)](0x1),_0x4fcf28=await _0xaed3b7['readFile'](_0x5ad31c,_0x4e1cf9(0x2e7));_0x4cb548=JSON[_0x4e1cf9(0x2d8)](_0x4fcf28);}else _0x4cb548=JSON['parse'](_0x244be5);}catch{return console[_0x4e1cf9(0x2e2)](_0x4e1cf9(0x212)),0x1;}if(!_0x31c75c[_0x4e1cf9(0x213)]){if(!isInteractive())return console[_0x4e1cf9(0x2e2)](a42_0x409acc['red']('\x0aError:'),_0x4e1cf9(0x34d)),console[_0x4e1cf9(0x2e2)](a42_0x409acc[_0x4e1cf9(0x210)](_0x4e1cf9(0x1fd))),0x1;const _0x2f286a=await confirmKey(_0x4e1cf9(0x36d)+(_0x3ab2e0?_0x4e1cf9(0x247):_0x4e1cf9(0x2eb))+'\x20'+_0x350957+'?');if(!_0x2f286a)return console[_0x4e1cf9(0x2e2)](a42_0x409acc[_0x4e1cf9(0x34f)](_0x4e1cf9(0x384))),0x1;}let _0x2a2710;_0x3ab2e0?_0x2a2710=await withSpinner(_0x4e1cf9(0x2ed),()=>_0x55e210[_0x4e1cf9(0x1ff)][_0x4e1cf9(0x1f8)](_0x350957,{'fromTask':_0x407186,'retryParams':_0x4cb548}),{'verbose':_0x31c75c[_0x4e1cf9(0x335)]}):_0x2a2710=await withSpinner(_0x4e1cf9(0x24e),()=>_0x55e210[_0x4e1cf9(0x1ff)]['retryAttempt'](_0x350957,{'resumeFrom':_0xfd877,'retryParams':_0x4cb548,'force':_0x5065b8}),{'verbose':_0x31c75c['verbose']});const _0x3b3ec2=_0x2a2710['data'];return console[_0x4e1cf9(0x2e2)]('✔\x20Retry\x20started'),console[_0x4e1cf9(0x2e2)](_0x4e1cf9(0x307)+_0x3b3ec2[_0x4e1cf9(0x383)]),console[_0x4e1cf9(0x2e2)]('\x20\x20Session\x20ID:\x20'+_0x3b3ec2[_0x4e1cf9(0x244)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a42_0x271be1(0x31c)]='workflow:run';[a42_0x271be1(0x25f)]='Start\x20a\x20workflow\x20run';async[a42_0x271be1(0x26e)](_0x254993){const _0x12de1d=a42_0x271be1,{options:_0x4cacf4,args:_0x309510,tdx:_0x27ddce}=_0x254993;let _0x2a0c1f=_0x309510[0x0];if(!_0x2a0c1f){const _0x2d2431=this[_0x12de1d(0x352)]([],_0x4cacf4),_0x3c187d=await withSpinner('Loading\x20workflows...',()=>_0x27ddce[_0x12de1d(0x1ff)][_0x12de1d(0x1d3)](_0x2d2431,{'limit':_0x4cacf4[_0x12de1d(0x2d2)]}),{'verbose':_0x4cacf4[_0x12de1d(0x335)]}),_0x1c940a=_0x3c187d['data'];if(_0x1c940a[_0x12de1d(0x315)]===0x0)return console[_0x12de1d(0x2e2)]('No\x20workflows\x20found'),!_0x2d2431&&console[_0x12de1d(0x2e2)](a42_0x409acc[_0x12de1d(0x210)](_0x12de1d(0x306))),0x1;const _0x33b989=_0x1c940a[_0x12de1d(0x297)](_0x2b0d3e=>({'title':_0x2b0d3e[_0x12de1d(0x339)]?.[_0x12de1d(0x31c)]+'.'+_0x2b0d3e[_0x12de1d(0x31c)],'value':_0x2b0d3e['project']?.[_0x12de1d(0x31c)]+'.'+_0x2b0d3e[_0x12de1d(0x31c)],'description':_0x2b0d3e[_0x12de1d(0x330)]?_0x12de1d(0x314)+_0x2b0d3e[_0x12de1d(0x330)]:undefined})),_0x2f69b1=await a42_0x5aae83({'type':_0x12de1d(0x31f),'name':'workflow','message':_0x12de1d(0x204),'choices':_0x33b989});if(!_0x2f69b1['workflow'])return 0x1;_0x2a0c1f=_0x2f69b1[_0x12de1d(0x1ff)];}if(!_0x2a0c1f[_0x12de1d(0x1fc)]('.')){const _0x2a6c90=this[_0x12de1d(0x352)]([],_0x4cacf4);if(_0x2a6c90)_0x2a0c1f=_0x2a6c90+'.'+_0x2a0c1f;else return console[_0x12de1d(0x2e2)](a42_0x409acc[_0x12de1d(0x2e9)]('Error:'),_0x12de1d(0x34a)),console[_0x12de1d(0x2e2)](a42_0x409acc['dim'](_0x12de1d(0x306))),0x1;}const _0x23114b=_0x4cacf4[_0x12de1d(0x312)],_0x2f5b83=_0x4cacf4[_0x12de1d(0x33a)],_0x4c832d={};if(_0x23114b&&Array[_0x12de1d(0x233)](_0x23114b))for(const _0x803bd2 of _0x23114b){const _0x2994bd=_0x803bd2['indexOf']('=');if(_0x2994bd===-0x1)return console[_0x12de1d(0x2e2)](_0x12de1d(0x33c)+_0x803bd2),console['error']('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x1b6618=_0x803bd2['substring'](0x0,_0x2994bd),_0x2999b3=_0x803bd2[_0x12de1d(0x30c)](_0x2994bd+0x1);try{_0x4c832d[_0x1b6618]=JSON[_0x12de1d(0x2d8)](_0x2999b3);}catch{_0x4c832d[_0x1b6618]=_0x2999b3;}}_0x4cacf4['verbose']&&(console[_0x12de1d(0x2e2)](_0x12de1d(0x255)+_0x2a0c1f),Object[_0x12de1d(0x238)](_0x4c832d)['length']>0x0&&console['error'](_0x12de1d(0x2fe)+JSON['stringify'](_0x4c832d)),_0x2f5b83&&console['error'](_0x12de1d(0x354)+_0x2f5b83));const _0x4d7738=await withSpinner(_0x12de1d(0x232),()=>_0x27ddce[_0x12de1d(0x1ff)]['run'](_0x2a0c1f,_0x4c832d,{'sessionTime':_0x2f5b83}),{'verbose':_0x4cacf4[_0x12de1d(0x335)]}),_0x634a72=_0x4d7738[_0x12de1d(0x2d6)];console['error']('✔\x20Workflow\x20run\x20started'),console[_0x12de1d(0x2e2)](_0x12de1d(0x256)+_0x634a72['id']),console[_0x12de1d(0x2e2)](_0x12de1d(0x337)+_0x634a72[_0x12de1d(0x244)]),console[_0x12de1d(0x2e2)](_0x12de1d(0x28b)+_0x634a72[_0x12de1d(0x339)]?.['name']),console[_0x12de1d(0x2e2)](_0x12de1d(0x20e)+_0x634a72[_0x12de1d(0x1ff)]?.[_0x12de1d(0x31c)]);if(_0x634a72['project']?.['id']&&_0x634a72[_0x12de1d(0x244)]&&_0x634a72['id']){const _0x24bf47=_0x4cacf4[_0x12de1d(0x360)],_0x4ec2e5=getConsoleUrl(_0x24bf47,_0x12de1d(0x201)+_0x634a72[_0x12de1d(0x339)]['id']+_0x12de1d(0x271)+_0x634a72[_0x12de1d(0x244)]+_0x12de1d(0x380)+_0x634a72['id']);console[_0x12de1d(0x2e2)](_0x12de1d(0x30f)+a42_0x409acc[_0x12de1d(0x21d)](_0x4ec2e5));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']='workflow:download';[a42_0x271be1(0x25f)]=a42_0x271be1(0x317);async[a42_0x271be1(0x26e)](_0x836c36){const _0x53f120=a42_0x271be1,{options:_0x5d57e7,args:_0x2d4d9f,tdx:_0x26b46e}=_0x836c36,_0x68889a=_0x2d4d9f[0x0],_0x1301a5=_0x2d4d9f[0x1]||'.';if(!_0x68889a)return console[_0x53f120(0x2e2)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x53f120(0x2c0)),0x1;const _0x2359ae=_0x5d57e7[_0x53f120(0x330)];_0x5d57e7[_0x53f120(0x335)]&&(console['error'](_0x53f120(0x251)+_0x68889a),console[_0x53f120(0x2e2)](_0x53f120(0x21c)+_0x1301a5),_0x2359ae&&console['error']('Revision:\x20'+_0x2359ae));const _0x1fee69=await withSpinner('Downloading\x20project\x20'+_0x68889a+_0x53f120(0x2c8),()=>_0x26b46e['workflow'][_0x53f120(0x34e)](_0x68889a,_0x1301a5,{'revision':_0x2359ae}),{'verbose':_0x5d57e7[_0x53f120(0x335)]}),_0x2f6912=_0x1fee69[_0x53f120(0x2d6)];return console[_0x53f120(0x2e2)](_0x53f120(0x28a)+_0x2f6912[_0x53f120(0x2bc)]),console[_0x53f120(0x2e2)](_0x53f120(0x263)+_0x2f6912[_0x53f120(0x330)]),console['error'](_0x53f120(0x2c6)+_0x2f6912[_0x53f120(0x21f)]),console['error'](_0x53f120(0x2f9)+_0x1301a5+'/'+_0x2f6912[_0x53f120(0x2bc)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a42_0x271be1(0x31c)]=a42_0x271be1(0x258);[a42_0x271be1(0x25f)]=a42_0x271be1(0x288);async[a42_0x271be1(0x26e)](_0x34a8b1){const _0x366ef5=a42_0x271be1,{options:_0x183364,args:_0x23f05c,tdx:_0x5be8b8}=_0x34a8b1;let _0x49b28f='.',_0x529a20=_0x183364[_0x366ef5(0x31c)];if(_0x23f05c[0x0]){const {promises:_0x28d4fc}=await import('fs');try{const _0x2f7f14=await _0x28d4fc[_0x366ef5(0x35d)](_0x23f05c[0x0]);if(_0x2f7f14[_0x366ef5(0x37f)]())_0x49b28f=_0x23f05c[0x0];else return console[_0x366ef5(0x2e2)](_0x366ef5(0x1e1)+_0x23f05c[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x529a20=_0x23f05c[0x0],_0x49b28f='.';}}const _0x37989f=_0x183364[_0x366ef5(0x330)],_0x48ed13=_0x183364[_0x366ef5(0x22a)];_0x183364[_0x366ef5(0x335)]&&(console[_0x366ef5(0x2e2)](_0x366ef5(0x2f8)+_0x49b28f),_0x529a20&&console[_0x366ef5(0x2e2)](_0x366ef5(0x1eb)+_0x529a20),_0x37989f&&console[_0x366ef5(0x2e2)](_0x366ef5(0x264)+_0x37989f),_0x48ed13&&console[_0x366ef5(0x2e2)]('Validation:\x20skipped'));const _0x3dce4b=await withSpinner(_0x366ef5(0x27c),()=>_0x5be8b8['workflow'][_0x366ef5(0x257)](_0x49b28f,{'projectName':_0x529a20,'revision':_0x37989f,'skipValidation':_0x48ed13}),{'verbose':_0x183364[_0x366ef5(0x335)]}),_0x164b7f=_0x3dce4b[_0x366ef5(0x2d6)];return console[_0x366ef5(0x2e2)](_0x366ef5(0x350)+_0x164b7f['projectName']),console[_0x366ef5(0x2e2)]('\x20\x20Project\x20ID:\x20'+_0x164b7f[_0x366ef5(0x2d7)]),console['error'](_0x366ef5(0x263)+_0x164b7f[_0x366ef5(0x330)]),await this[_0x366ef5(0x2d3)](_0x5be8b8,_0x164b7f[_0x366ef5(0x2bc)],_0x183364['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']='workflow:pull';[a42_0x271be1(0x25f)]=a42_0x271be1(0x300);async[a42_0x271be1(0x26e)](_0x946f34){const _0x3798e9=a42_0x271be1,{options:_0x38222a,args:_0x9f2ec8,tdx:_0x3804c5}=_0x946f34,_0x199e20=_0x9f2ec8[0x0],_0x27abd3=_0x9f2ec8[0x1];if(!_0x199e20)return console[_0x3798e9(0x2e2)](a42_0x409acc['red'](_0x3798e9(0x2f0)),_0x3798e9(0x327)),console['error'](a42_0x409acc[_0x3798e9(0x210)]('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x3400c5=_0x38222a[_0x3798e9(0x330)];_0x38222a[_0x3798e9(0x335)]&&(console[_0x3798e9(0x2e2)](_0x3798e9(0x251)+_0x199e20),_0x27abd3&&console[_0x3798e9(0x2e2)](_0x3798e9(0x284)+_0x27abd3),_0x3400c5&&console[_0x3798e9(0x2e2)](_0x3798e9(0x264)+_0x3400c5),_0x38222a[_0x3798e9(0x1f5)]&&console['error'](_0x3798e9(0x267)));const _0x2f6d89=await withSpinner(_0x3798e9(0x250)+_0x199e20+_0x3798e9(0x2c8),()=>_0x3804c5[_0x3798e9(0x1ff)][_0x3798e9(0x2e0)](_0x199e20,{'targetDir':_0x27abd3,'revision':_0x3400c5}),{'verbose':_0x38222a[_0x3798e9(0x335)]}),_0xeb0ea5=_0x2f6d89[_0x3798e9(0x2d6)];_0xeb0ea5[_0x3798e9(0x1d8)]?console[_0x3798e9(0x2e2)](_0x3798e9(0x349)+_0xeb0ea5[_0x3798e9(0x2bc)]):console[_0x3798e9(0x2e2)](_0x3798e9(0x320)+_0xeb0ea5[_0x3798e9(0x2bc)]);console[_0x3798e9(0x2e2)](_0x3798e9(0x263)+_0xeb0ea5[_0x3798e9(0x330)]),console[_0x3798e9(0x2e2)](_0x3798e9(0x2c3)+(a42_0x1668b6[_0x3798e9(0x313)](process[_0x3798e9(0x345)](),_0xeb0ea5[_0x3798e9(0x2cf)])||'.')),console[_0x3798e9(0x2e2)](_0x3798e9(0x1e6)+a42_0x409acc[_0x3798e9(0x2ac)]('+'+_0xeb0ea5['summary']['new']+'\x20new')+',\x20'+(a42_0x409acc['yellow']('~'+_0xeb0ea5[_0x3798e9(0x36f)][_0x3798e9(0x2d5)]+_0x3798e9(0x223))+',\x20')+(a42_0x409acc[_0x3798e9(0x2e9)]('-'+_0xeb0ea5['summary'][_0x3798e9(0x22d)]+_0x3798e9(0x206))+',\x20')+(''+a42_0x409acc['dim'](_0xeb0ea5['summary'][_0x3798e9(0x228)]+_0x3798e9(0x2fb))));for(const _0x4b359b of _0xeb0ea5[_0x3798e9(0x2b5)]){_0x4b359b[_0x3798e9(0x30b)]===_0x3798e9(0x2d5)&&_0x4b359b[_0x3798e9(0x331)]&&(console[_0x3798e9(0x2e2)]('\x0a'+a42_0x409acc[_0x3798e9(0x21d)](_0x3798e9(0x1e2)+_0x4b359b[_0x3798e9(0x321)])),console[_0x3798e9(0x2e2)](_0x4b359b[_0x3798e9(0x331)]));}if(!_0xeb0ea5[_0x3798e9(0x303)])return saveSessionContext({'workflow_project':_0xeb0ea5[_0x3798e9(0x2bc)]},_0x38222a['session']),console[_0x3798e9(0x2e2)](a42_0x409acc[_0x3798e9(0x2ac)](_0x3798e9(0x219))),console['error'](a42_0x409acc[_0x3798e9(0x210)](_0x3798e9(0x1f3)+_0xeb0ea5[_0x3798e9(0x2bc)])),0x0;if(_0x38222a[_0x3798e9(0x1f5)])return console[_0x3798e9(0x2e2)](a42_0x409acc[_0x3798e9(0x34f)](_0x3798e9(0x2fa))),0x0;if(!_0x38222a[_0x3798e9(0x213)]){if(!isInteractive())return console[_0x3798e9(0x2e2)](a42_0x409acc[_0x3798e9(0x2e9)](_0x3798e9(0x240)),_0x3798e9(0x34d)),console[_0x3798e9(0x2e2)](a42_0x409acc['dim'](_0x3798e9(0x1fd))),0x1;const _0x3a353c=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x3a353c)return console['error'](a42_0x409acc[_0x3798e9(0x34f)](_0x3798e9(0x384)),_0x3798e9(0x31e)),0x1;}await withSpinner(_0x3798e9(0x2e6),()=>_0x3804c5[_0x3798e9(0x1ff)][_0x3798e9(0x316)](_0xeb0ea5,{'revision':_0x3400c5}),{'verbose':_0x38222a[_0x3798e9(0x335)]}),saveSessionContext({'workflow_project':_0xeb0ea5[_0x3798e9(0x2bc)]},_0x38222a[_0x3798e9(0x247)]),console[_0x3798e9(0x2e2)](a42_0x409acc[_0x3798e9(0x2ac)]('✔\x20Pull\x20complete'));const _0x522431=a42_0x1668b6[_0x3798e9(0x313)](process[_0x3798e9(0x345)](),_0xeb0ea5[_0x3798e9(0x2cf)])||'.';return console['error'](a42_0x409acc[_0x3798e9(0x210)](_0x3798e9(0x2f9)+_0x522431)),console[_0x3798e9(0x2e2)](a42_0x409acc[_0x3798e9(0x210)](_0x3798e9(0x1f3)+_0xeb0ea5[_0x3798e9(0x2bc)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a42_0x271be1(0x31c)]=a42_0x271be1(0x217);[a42_0x271be1(0x25f)]=a42_0x271be1(0x224);async['execute'](_0xac07e2){const _0x4df1ca=a42_0x271be1,{options:_0x228340,args:_0x216c0c,tdx:_0x562ad3}=_0xac07e2,_0x4a5194=this[_0x4df1ca(0x27e)](_0x216c0c,_0x228340),_0x489389=_0x228340[_0x4df1ca(0x330)],_0x434be8=_0x228340[_0x4df1ca(0x22a)];_0x228340[_0x4df1ca(0x335)]&&(_0x4a5194&&console[_0x4df1ca(0x2e2)](_0x4df1ca(0x277)+_0x4a5194),_0x489389&&console[_0x4df1ca(0x2e2)](_0x4df1ca(0x264)+_0x489389),_0x228340['dryRun']&&console[_0x4df1ca(0x2e2)](_0x4df1ca(0x267)),_0x434be8&&console[_0x4df1ca(0x2e2)](_0x4df1ca(0x377)));let _0x387347;try{_0x387347=await withSpinner(_0x4df1ca(0x309),()=>_0x562ad3[_0x4df1ca(0x1ff)]['preparePushProject']({'sourceDir':_0x4a5194,'revision':_0x489389,'skipValidation':_0x434be8}),{'verbose':_0x228340['verbose']});}catch(_0x37ef18){if(_0x37ef18 instanceof Error&&_0x37ef18[_0x4df1ca(0x276)][_0x4df1ca(0x1fc)](_0x4df1ca(0x31d)))return console['error'](a42_0x409acc[_0x4df1ca(0x2e9)](_0x4df1ca(0x2f0)),_0x4df1ca(0x227)),_0x228340[_0x4df1ca(0x356)]?console[_0x4df1ca(0x2e2)](a42_0x409acc[_0x4df1ca(0x210)](_0x4df1ca(0x275)+_0x228340[_0x4df1ca(0x356)]+_0x4df1ca(0x318)+_0x228340[_0x4df1ca(0x356)]+'\x27')):console[_0x4df1ca(0x2e2)](a42_0x409acc[_0x4df1ca(0x210)](_0x4df1ca(0x35b))),0x1;throw _0x37ef18;}const _0x3fa6ff=_0x387347[_0x4df1ca(0x2d6)];console[_0x4df1ca(0x2e2)](_0x4df1ca(0x202)+_0x3fa6ff['projectName']),console['error']('\x20\x20Source:\x20'+_0x3fa6ff[_0x4df1ca(0x296)]),console[_0x4df1ca(0x2e2)](_0x4df1ca(0x263)+_0x3fa6ff[_0x4df1ca(0x330)]),console['error'](_0x4df1ca(0x1e6)+a42_0x409acc[_0x4df1ca(0x2ac)]('+'+_0x3fa6ff[_0x4df1ca(0x36f)][_0x4df1ca(0x294)]+'\x20new')+',\x20'+(a42_0x409acc[_0x4df1ca(0x34f)]('~'+_0x3fa6ff[_0x4df1ca(0x36f)][_0x4df1ca(0x2d5)]+_0x4df1ca(0x223))+',\x20')+(a42_0x409acc[_0x4df1ca(0x2e9)]('-'+_0x3fa6ff['summary'][_0x4df1ca(0x22d)]+'\x20deleted')+',\x20')+(''+a42_0x409acc['dim'](_0x3fa6ff[_0x4df1ca(0x36f)]['unchanged']+_0x4df1ca(0x2fb))));for(const _0x3052c4 of _0x3fa6ff[_0x4df1ca(0x2b5)]){_0x3052c4[_0x4df1ca(0x30b)]==='modified'&&_0x3052c4[_0x4df1ca(0x331)]&&(console['error']('\x0a'+a42_0x409acc[_0x4df1ca(0x21d)](_0x4df1ca(0x1e2)+_0x3052c4['path'])),console[_0x4df1ca(0x2e2)](_0x3052c4['diff']));}if(!_0x3fa6ff[_0x4df1ca(0x303)])return console[_0x4df1ca(0x2e2)](a42_0x409acc[_0x4df1ca(0x2ac)](_0x4df1ca(0x362))),await this[_0x4df1ca(0x2d3)](_0x562ad3,_0x3fa6ff[_0x4df1ca(0x2bc)],_0x228340[_0x4df1ca(0x360)]),0x0;if(_0x228340[_0x4df1ca(0x1f5)])return console[_0x4df1ca(0x2e2)](a42_0x409acc['yellow'](_0x4df1ca(0x245))),0x0;if(!_0x228340[_0x4df1ca(0x213)]){if(!isInteractive())return console[_0x4df1ca(0x2e2)](a42_0x409acc['red'](_0x4df1ca(0x240)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4df1ca(0x2e2)](a42_0x409acc[_0x4df1ca(0x210)](_0x4df1ca(0x1fd))),0x1;const _0x27b6c4=await confirmKey(_0x4df1ca(0x241));if(!_0x27b6c4)return console[_0x4df1ca(0x2e2)](a42_0x409acc[_0x4df1ca(0x34f)]('Cancelled'),_0x4df1ca(0x27b)),0x1;}const _0x2a2192=await withSpinner('Pushing\x20project...',()=>_0x562ad3[_0x4df1ca(0x1ff)][_0x4df1ca(0x1ec)](_0x3fa6ff),{'verbose':_0x228340[_0x4df1ca(0x335)]}),_0x4aee33=_0x2a2192[_0x4df1ca(0x2d6)];return console[_0x4df1ca(0x2e2)](a42_0x409acc[_0x4df1ca(0x2ac)](_0x4df1ca(0x1e0))),console[_0x4df1ca(0x2e2)](_0x4df1ca(0x336)+_0x4aee33['projectId']),console[_0x4df1ca(0x2e2)](_0x4df1ca(0x263)+_0x4aee33[_0x4df1ca(0x330)]),await this[_0x4df1ca(0x2d3)](_0x562ad3,_0x4aee33[_0x4df1ca(0x2bc)],_0x228340[_0x4df1ca(0x360)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a42_0x271be1(0x31c)]='workflow:clone';[a42_0x271be1(0x25f)]=a42_0x271be1(0x27f);async['execute'](_0x471029){const _0x411044=a42_0x271be1,{options:_0x277147,args:_0x52f42c,tdx:_0x3e5331}=_0x471029,_0x4368d9=this[_0x411044(0x27e)](_0x52f42c,_0x277147),_0x5cb784=_0x277147[_0x411044(0x31c)],_0x2d3a38=_0x277147[_0x411044(0x330)],_0x19f274=_0x277147[_0x411044(0x22a)];if(!_0x4368d9)return console[_0x411044(0x2e2)](a42_0x409acc[_0x411044(0x2e9)]('Error:'),_0x411044(0x325)),console[_0x411044(0x2e2)](a42_0x409acc['dim'](_0x411044(0x32a))),console['error'](a42_0x409acc[_0x411044(0x210)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x5cb784)return console[_0x411044(0x2e2)](a42_0x409acc[_0x411044(0x2e9)](_0x411044(0x2f0)),_0x411044(0x203)),console[_0x411044(0x2e2)](a42_0x409acc[_0x411044(0x210)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x277147['verbose']&&(console['error'](_0x411044(0x277)+_0x4368d9),console['error'](_0x411044(0x2f5)+_0x5cb784),_0x2d3a38&&console[_0x411044(0x2e2)](_0x411044(0x264)+_0x2d3a38),_0x277147[_0x411044(0x1f5)]&&console[_0x411044(0x2e2)](_0x411044(0x267)),_0x19f274&&console[_0x411044(0x2e2)]('Validation:\x20skipped'));const _0x4ed1e3=await withSpinner('Analyzing\x20project...',()=>_0x3e5331[_0x411044(0x1ff)]['prepareCloneProject'](_0x4368d9,_0x5cb784,{'revision':_0x2d3a38,'skipValidation':_0x19f274}),{'verbose':_0x277147['verbose']}),_0x33fe66=_0x4ed1e3[_0x411044(0x2d6)];console[_0x411044(0x2e2)]('Source:\x20'+_0x33fe66[_0x411044(0x296)]);_0x33fe66['sourceProjectName']&&console[_0x411044(0x2e2)](_0x411044(0x366)+_0x33fe66[_0x411044(0x2ae)]);console[_0x411044(0x2e2)](_0x411044(0x2f5)+_0x33fe66[_0x411044(0x386)]),console[_0x411044(0x2e2)](_0x411044(0x264)+_0x33fe66[_0x411044(0x330)]),console[_0x411044(0x2e2)](_0x411044(0x334)+_0x33fe66['fileCount']);_0x33fe66['targetExists']&&(console[_0x411044(0x2e2)](a42_0x409acc[_0x411044(0x34f)]('\x0a⚠\x20Project\x20\x22'+_0x33fe66[_0x411044(0x386)]+_0x411044(0x364)+_0x33fe66[_0x411044(0x2ca)]+')')),console[_0x411044(0x2e2)](a42_0x409acc[_0x411044(0x34f)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x277147[_0x411044(0x1f5)])return console[_0x411044(0x2e2)](a42_0x409acc[_0x411044(0x34f)](_0x411044(0x2dc))),0x0;if(!_0x277147['yes']){if(!isInteractive())return console[_0x411044(0x2e2)](a42_0x409acc[_0x411044(0x2e9)](_0x411044(0x240)),_0x411044(0x34d)),console[_0x411044(0x2e2)](a42_0x409acc['dim'](_0x411044(0x1fd))),0x1;const _0x5d01b7=_0x33fe66['sourceProjectName']||a42_0x1668b6[_0x411044(0x211)](_0x4368d9),_0x4c095d=_0x33fe66['targetExists']?_0x411044(0x274)+_0x5cb784+_0x411044(0x33f):_0x411044(0x23a)+_0x5d01b7+_0x411044(0x22f)+_0x5cb784+'\x22?',_0x4e2e3e=await confirmKey(_0x4c095d);if(!_0x4e2e3e)return console['error'](a42_0x409acc[_0x411044(0x34f)]('Cancelled')),0x1;}const _0x423e7e=await withSpinner(_0x33fe66[_0x411044(0x22c)]?_0x411044(0x1d6)+_0x5cb784+_0x411044(0x2c8):_0x411044(0x273)+_0x5cb784+_0x411044(0x2c8),()=>_0x3e5331['workflow']['executeCloneProject'](_0x33fe66),{'verbose':_0x277147['verbose']}),_0x1a01ae=_0x423e7e['data'];return console[_0x411044(0x2e2)](a42_0x409acc['green'](_0x33fe66[_0x411044(0x22c)]?_0x411044(0x1e3):_0x411044(0x1da))),console[_0x411044(0x2e2)](_0x411044(0x28b)+_0x1a01ae[_0x411044(0x386)]),console[_0x411044(0x2e2)]('\x20\x20Project\x20ID:\x20'+_0x1a01ae['newProjectId']),console[_0x411044(0x2e2)]('\x20\x20Revision:\x20'+_0x1a01ae['revision']),await this[_0x411044(0x2d3)](_0x3e5331,_0x1a01ae[_0x411044(0x386)],_0x277147[_0x411044(0x360)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a42_0x271be1(0x31c)]='workflow:delete';['description']=a42_0x271be1(0x222);async[a42_0x271be1(0x26e)](_0x58019c){const _0x1db89d=a42_0x271be1,{options:_0x28abb4,args:_0x22b9f6,tdx:_0x34ade7}=_0x58019c,_0x45fd03=_0x22b9f6[0x0];if(!_0x45fd03)return console['error'](_0x1db89d(0x27d)),console[_0x1db89d(0x2e2)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x28abb4[_0x1db89d(0x335)]&&console[_0x1db89d(0x2e2)]('Project:\x20'+_0x45fd03);if(!_0x28abb4[_0x1db89d(0x213)]){if(!isInteractive())return console[_0x1db89d(0x2e2)](a42_0x409acc[_0x1db89d(0x2e9)](_0x1db89d(0x240)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1db89d(0x2e2)](a42_0x409acc[_0x1db89d(0x210)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x493403=await confirmKey(_0x1db89d(0x220)+_0x45fd03+_0x1db89d(0x289));if(!_0x493403)return console['error'](a42_0x409acc[_0x1db89d(0x34f)](_0x1db89d(0x384))),0x1;}const _0xb29122=await withSpinner(_0x1db89d(0x1e8)+_0x45fd03+'...',()=>_0x34ade7[_0x1db89d(0x1ff)][_0x1db89d(0x28c)](_0x45fd03),{'verbose':_0x28abb4['verbose']}),_0xb6ea27=_0xb29122[_0x1db89d(0x2d6)];return console[_0x1db89d(0x2e2)](_0x1db89d(0x2a8)+_0xb6ea27[_0x1db89d(0x2bc)]),console['error'](_0x1db89d(0x336)+_0xb6ea27['projectId']),0x0;}}export function parseKeyValue(_0x136e3f){const _0x5b314b=a42_0x271be1,_0x19b7d6=_0x136e3f[_0x5b314b(0x265)]('=');if(_0x19b7d6===-0x1)throw new Error(_0x5b314b(0x31b)+_0x136e3f+_0x5b314b(0x1f0));const _0x21a624=_0x136e3f['substring'](0x0,_0x19b7d6),_0x1829c0=_0x136e3f[_0x5b314b(0x30c)](_0x19b7d6+0x1);if(!_0x21a624)throw new Error(_0x5b314b(0x270));return{'key':_0x21a624,'value':_0x1829c0};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a42_0x271be1(0x31c)]=a42_0x271be1(0x2c4);[a42_0x271be1(0x25f)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async['execute'](_0x83e179){const _0x1678c8=a42_0x271be1,{options:_0x5884af,args:_0x3314be,tdx:_0x13f246}=_0x83e179,_0x20c41d=this[_0x1678c8(0x1f9)](_0x3314be,_0x5884af);if(!_0x20c41d)return 0x1;_0x5884af[_0x1678c8(0x335)]&&console['error'](_0x1678c8(0x251)+_0x20c41d);const _0x21ece9=await withSpinner('Listing\x20secrets...',()=>_0x13f246[_0x1678c8(0x1ff)][_0x1678c8(0x370)](_0x20c41d),{'verbose':_0x5884af[_0x1678c8(0x335)]}),{secrets:_0x7ec53e}=_0x21ece9['data'];return console[_0x1678c8(0x2e2)](_0x1678c8(0x2bd)+_0x7ec53e[_0x1678c8(0x315)]+'\x20secret'+(_0x7ec53e[_0x1678c8(0x315)]!==0x1?'s':'')),await handleSDKOutput(_0x7ec53e,_0x5884af),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a42_0x271be1(0x37e);[a42_0x271be1(0x25f)]='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async[a42_0x271be1(0x26e)](_0x52b2db){const _0x5d0dee=a42_0x271be1,{options:_0x2c7d9e,args:_0x476547,tdx:_0x29a24b}=_0x52b2db;let _0x5e7997,_0x45056e;if(_0x476547[_0x5d0dee(0x315)]>=0x2)_0x5e7997=_0x476547[0x0],_0x45056e=_0x476547[0x1];else{if(_0x476547[_0x5d0dee(0x315)]===0x1&&_0x2c7d9e[_0x5d0dee(0x356)])_0x5e7997=_0x2c7d9e[_0x5d0dee(0x356)],_0x45056e=_0x476547[0x0];else return _0x476547[_0x5d0dee(0x315)]===0x1?(console[_0x5d0dee(0x2e2)](_0x5d0dee(0x1df)),console['error'](_0x5d0dee(0x306)),0x1):(console[_0x5d0dee(0x2e2)](_0x5d0dee(0x371)),console[_0x5d0dee(0x2e2)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE'),0x1);}let _0x3c362c,_0x5187a4;try{({key:_0x3c362c,value:_0x5187a4}=parseKeyValue(_0x45056e));}catch(_0x155691){return _0x155691 instanceof Error&&console[_0x5d0dee(0x2e2)](a42_0x409acc[_0x5d0dee(0x2e9)](_0x5d0dee(0x2f0)),_0x155691['message']),0x1;}_0x2c7d9e[_0x5d0dee(0x335)]&&(console[_0x5d0dee(0x2e2)]('Project:\x20'+_0x5e7997),console[_0x5d0dee(0x2e2)](_0x5d0dee(0x2b4)+_0x3c362c));const _0x59da80=await withSpinner(_0x5d0dee(0x2b3),()=>_0x29a24b[_0x5d0dee(0x1ff)][_0x5d0dee(0x343)](_0x5e7997,_0x3c362c,_0x5187a4),{'verbose':_0x2c7d9e[_0x5d0dee(0x335)]}),_0x3a3a9f=_0x59da80[_0x5d0dee(0x2d6)];return console['error'](_0x5d0dee(0x378)+_0x3a3a9f[_0x5d0dee(0x32c)]+_0x5d0dee(0x231)+_0x3a3a9f['projectName']+'\x27'),(_0x2c7d9e[_0x5d0dee(0x36b)]||_0x2c7d9e[_0x5d0dee(0x344)])&&await handleSingleObjectOutput(_0x3a3a9f,_0x2c7d9e),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a42_0x271be1(0x31c)]=a42_0x271be1(0x361);[a42_0x271be1(0x25f)]='Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project';async[a42_0x271be1(0x26e)](_0x79d665){const _0x2bc88d=a42_0x271be1,{options:_0xb3ef9c,args:_0x16881a,tdx:_0x5e5cee}=_0x79d665;let _0x2419bc,_0x1c714f;if(_0x16881a['length']>=0x2)_0x2419bc=_0x16881a[0x0],_0x1c714f=_0x16881a[0x1];else{if(_0x16881a[_0x2bc88d(0x315)]===0x1&&_0xb3ef9c['workflowProject'])_0x2419bc=_0xb3ef9c[_0x2bc88d(0x356)],_0x1c714f=_0x16881a[0x0];else return _0x16881a[_0x2bc88d(0x315)]===0x1?(console[_0x2bc88d(0x2e2)](_0x2bc88d(0x1df)),console[_0x2bc88d(0x2e2)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console['error'](_0x2bc88d(0x24d)),console[_0x2bc88d(0x2e2)](_0x2bc88d(0x1d5)),0x1);}_0xb3ef9c[_0x2bc88d(0x335)]&&(console['error'](_0x2bc88d(0x251)+_0x2419bc),console['error'](_0x2bc88d(0x2b4)+_0x1c714f));if(!_0xb3ef9c[_0x2bc88d(0x213)]){if(!isInteractive())return console['error'](a42_0x409acc[_0x2bc88d(0x2e9)](_0x2bc88d(0x240)),_0x2bc88d(0x34d)),console[_0x2bc88d(0x2e2)](a42_0x409acc[_0x2bc88d(0x210)](_0x2bc88d(0x1fd))),0x1;const _0x5ea4a0=await confirmKey(_0x2bc88d(0x295)+_0x1c714f+_0x2bc88d(0x20f)+_0x2419bc+'\x27?');if(!_0x5ea4a0)return console[_0x2bc88d(0x2e2)](a42_0x409acc[_0x2bc88d(0x34f)](_0x2bc88d(0x384))),0x1;}const _0x54ca98=await withSpinner(_0x2bc88d(0x262),()=>_0x5e5cee[_0x2bc88d(0x1ff)]['deleteSecret'](_0x2419bc,_0x1c714f),{'verbose':_0xb3ef9c[_0x2bc88d(0x335)]}),_0x55d9be=_0x54ca98[_0x2bc88d(0x2d6)];return console[_0x2bc88d(0x2e2)]('✔\x20Secret\x20\x27'+_0x55d9be[_0x2bc88d(0x32c)]+_0x2bc88d(0x278)+_0x55d9be['projectName']+'\x27'),(_0xb3ef9c['json']||_0xb3ef9c['jsonl'])&&await handleSingleObjectOutput(_0x55d9be,_0xb3ef9c),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(_0x448d7c){const _0x2784ac=a42_0x271be1,_0x2e4c6d=Math[_0x2784ac(0x2a6)](_0x448d7c/0x3e8),_0x406ca7=Math['floor'](_0x2e4c6d/0x3c),_0x49adb5=Math['floor'](_0x406ca7/0x3c),_0x18e12b=Math[_0x2784ac(0x2a6)](_0x49adb5/0x18);if(_0x18e12b>0x0){const _0x2b8cb6=_0x49adb5%0x18;return _0x2b8cb6>0x0?_0x18e12b+'d\x20'+_0x2b8cb6+'h':_0x18e12b+'d';}else{if(_0x49adb5>0x0){const _0x54ea37=_0x406ca7%0x3c;return _0x54ea37>0x0?_0x49adb5+'h\x20'+_0x54ea37+'m':_0x49adb5+'h';}else{if(_0x406ca7>0x0){const _0x5a79b7=_0x2e4c6d%0x3c;return _0x5a79b7>0x0?_0x406ca7+'m\x20'+_0x5a79b7+'s':_0x406ca7+'m';}else return _0x2e4c6d+'s';}}}function formatTimestamp(_0x2e33d1,_0x173f51){const _0x14253c=a42_0x271be1,_0x512d80=new Date(_0x2e33d1),_0x475af7=String(_0x512d80[_0x14253c(0x1f1)]())[_0x14253c(0x32f)](0x2,'0'),_0x66ff11=String(_0x512d80[_0x14253c(0x21e)]())[_0x14253c(0x32f)](0x2,'0'),_0x440e0a=_0x475af7+':'+_0x66ff11,_0x43605d=_0x512d80[_0x14253c(0x2ee)]()===_0x173f51['getFullYear']()&&_0x512d80['getMonth']()===_0x173f51[_0x14253c(0x2c7)]()&&_0x512d80[_0x14253c(0x1d7)]()===_0x173f51[_0x14253c(0x1d7)]();if(_0x43605d)return _0x440e0a;else{const _0x5abe4a=String(_0x512d80[_0x14253c(0x2c7)]()+0x1)[_0x14253c(0x32f)](0x2,'0'),_0xf46e95=String(_0x512d80[_0x14253c(0x1d7)]())[_0x14253c(0x32f)](0x2,'0');return _0x5abe4a+'-'+_0xf46e95+'\x20'+_0x440e0a;}}function formatDate(_0x556d3c){const _0x3302e7=a42_0x271be1,_0x4d213e=_0x556d3c[_0x3302e7(0x2ee)](),_0x4f1444=String(_0x556d3c[_0x3302e7(0x2c7)]()+0x1)[_0x3302e7(0x32f)](0x2,'0'),_0x37da29=String(_0x556d3c[_0x3302e7(0x1d7)]())[_0x3302e7(0x32f)](0x2,'0');return _0x4d213e+'-'+_0x4f1444+'-'+_0x37da29;}function getTaskStateIcon(_0x2a5984){const _0x494650={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x494650[_0x2a5984]||'⚪';}function getBarChar(_0x48ae39){const _0x5f20c8=a42_0x271be1;return _0x48ae39===_0x5f20c8(0x2e2)||_0x48ae39===_0x5f20c8(0x299)?'×':'─';}function getBarColor(_0x390bd7){const _0x47d5ed=a42_0x271be1,_0x553ac6={'success':a42_0x409acc[_0x47d5ed(0x2ac)],'error':a42_0x409acc[_0x47d5ed(0x2e9)],'group_error':a42_0x409acc[_0x47d5ed(0x2e9)],'running':a42_0x409acc[_0x47d5ed(0x246)],'blocked':a42_0x409acc[_0x47d5ed(0x34f)],'planned':a42_0x409acc[_0x47d5ed(0x210)],'canceling':a42_0x409acc[_0x47d5ed(0x34f)]};return _0x553ac6[_0x390bd7]||a42_0x409acc[_0x47d5ed(0x229)];}function parseTaskName(_0x4c3d09){const _0x55c01e=a42_0x271be1;let _0x3994c4=_0x4c3d09['replace'](/^\++/,'');const _0x4a95b4=_0x3994c4[_0x55c01e(0x1dd)]('+'),_0x4ac978=_0x4a95b4[_0x55c01e(0x315)]>0x1?_0x4a95b4[_0x55c01e(0x315)]-0x2:0x0,_0xee5d48=_0x4a95b4[_0x4a95b4['length']-0x1]||_0x3994c4;return{'level':_0x4ac978,'name':'+'+_0xee5d48};}function truncateTaskName(_0x3cd36f,_0x20d7a0){const _0x48a4b2=a42_0x271be1,_0x49d3e2=stringWidth(_0x3cd36f);if(_0x49d3e2<=_0x20d7a0)return _0x3cd36f;let _0x215713=_0x3cd36f;while(stringWidth(_0x215713+'…')>_0x20d7a0&&_0x215713[_0x48a4b2(0x315)]>0x0){_0x215713=_0x215713[_0x48a4b2(0x324)](0x0,-0x1);}return _0x215713+'…';}function calculateTimeScale(_0x30b6a4,_0x172759){const _0x3a3fa5=a42_0x271be1;return{'startTime':_0x30b6a4['start'],'endTime':_0x30b6a4[_0x3a3fa5(0x1d4)],'durationMs':_0x30b6a4[_0x3a3fa5(0x323)],'msPerChar':_0x30b6a4[_0x3a3fa5(0x323)]/_0x172759};}function timeToPosition(_0x41dd5a,_0x25d409,_0x538c53){const _0xabf57d=a42_0x271be1,_0x46abfe=_0x41dd5a-_0x25d409[_0xabf57d(0x268)],_0x2460f8=Math[_0xabf57d(0x2a6)](_0x46abfe/_0x25d409[_0xabf57d(0x37b)]);return Math[_0xabf57d(0x375)](0x0,Math[_0xabf57d(0x1e7)](_0x2460f8,_0x538c53));}function renderTimeAxis(_0x481e2d,_0x4a81fb){const _0xdffa7e=a42_0x271be1,_0x58e21e=Math[_0xdffa7e(0x1e7)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0xdffa7e(0x375)](TIMELINE_CONFIG[_0xdffa7e(0x1fa)],Math[_0xdffa7e(0x2a6)](_0x4a81fb/TIMELINE_CONFIG[_0xdffa7e(0x37c)]))),_0x1ea3f8=_0x481e2d[_0xdffa7e(0x23e)]/(_0x58e21e-0x1),_0xb88f23=new Date(_0x481e2d['startTime']),_0xfe4295=[];for(let _0x297a48=0x0;_0x297a48<_0x58e21e;_0x297a48++){const _0x18a29d=_0x481e2d[_0xdffa7e(0x268)]+_0x297a48*_0x1ea3f8,_0x37f7fc=timeToPosition(_0x18a29d,_0x481e2d,_0x4a81fb),_0x2d79fe=formatTimestamp(_0x18a29d,_0xb88f23);_0xfe4295[_0xdffa7e(0x257)]({'pos':_0x37f7fc,'text':_0x2d79fe});}const _0x421885=new Array(_0x4a81fb)[_0xdffa7e(0x1f6)]('\x20');let _0x5788b2=-0x1;for(const {pos:_0x5812cf,text:_0x333760}of _0xfe4295){let _0x15eba2=Math['max'](0x0,_0x5812cf-Math[_0xdffa7e(0x2a6)](_0x333760[_0xdffa7e(0x315)]/0x2));_0x15eba2<=_0x5788b2+TIMELINE_CONFIG[_0xdffa7e(0x2bb)]&&(_0x15eba2=_0x5788b2+TIMELINE_CONFIG[_0xdffa7e(0x2bb)]+0x1);_0x15eba2+_0x333760[_0xdffa7e(0x315)]>_0x4a81fb&&(_0x15eba2=_0x4a81fb-_0x333760[_0xdffa7e(0x315)]);if(_0x15eba2>=0x0&&_0x15eba2+_0x333760[_0xdffa7e(0x315)]<=_0x4a81fb&&_0x15eba2>_0x5788b2){for(let _0x2dcf2c=0x0;_0x2dcf2c<_0x333760[_0xdffa7e(0x315)];_0x2dcf2c++){_0x421885[_0x15eba2+_0x2dcf2c]=_0x333760[_0x2dcf2c];}_0x5788b2=_0x15eba2+_0x333760[_0xdffa7e(0x315)]-0x1;}}return _0x421885[_0xdffa7e(0x29b)]('');}function renderTaskRow(_0x3eb0ec,_0x13577e,_0x1c9f80,_0x31d0ba){const _0xc589c8=a42_0x271be1,{level:_0x5dde9d,name:_0x1bccee}=parseTaskName(_0x3eb0ec['name']),_0x325cb5='\x20'[_0xc589c8(0x37a)](_0x5dde9d),_0x6e26bd=_0x3eb0ec[_0xc589c8(0x209)]?'('+formatElapsed(_0x3eb0ec[_0xc589c8(0x209)]['duration'])+')':'',_0x814911=stringWidth(_0x6e26bd),_0x484247=_0x5dde9d*0x1,_0x2ca89e=_0x31d0ba-_0x484247-_0x814911-0x1,_0x32551f=truncateTaskName(_0x1bccee,_0x2ca89e),_0x182ef3=_0x325cb5+_0x32551f,_0x5a1b8a=stringWidth(_0x182ef3),_0xf831f7=_0x31d0ba-_0x5a1b8a-_0x814911,_0x57520d=_0x182ef3+'\x20'[_0xc589c8(0x37a)](Math['max'](0x1,_0xf831f7))+a42_0x409acc['dim'](_0x6e26bd),_0x1442e8=getTaskStateIcon(_0x3eb0ec[_0xc589c8(0x2a5)]),_0x380775=new Array(_0x1c9f80)[_0xc589c8(0x1f6)]('\x20');if(_0x3eb0ec['window']){const _0x31b501=timeToPosition(_0x3eb0ec[_0xc589c8(0x209)][_0xc589c8(0x249)],_0x13577e,_0x1c9f80),_0x5e217f=timeToPosition(_0x3eb0ec[_0xc589c8(0x209)][_0xc589c8(0x1d4)],_0x13577e,_0x1c9f80),_0x443c12=getBarChar(_0x3eb0ec[_0xc589c8(0x2a5)]),_0x3cc479=Math[_0xc589c8(0x375)](_0x31b501+0x1,_0x5e217f);for(let _0x2f7674=_0x31b501;_0x2f7674<Math[_0xc589c8(0x1e7)](_0x3cc479,_0x1c9f80);_0x2f7674++){_0x380775[_0x2f7674]=_0x443c12;}}const _0x270c1e=getBarColor(_0x3eb0ec['state']),_0x368872=_0x380775['map'](_0x15b02=>_0x15b02==='\x20'?'\x20':_0x270c1e(_0x15b02))[_0xc589c8(0x29b)]('');return _0x1442e8+'\x20'+_0x57520d+'│'+_0x368872+'│';}function calculateStats(_0x42aa08){const _0x170b61=a42_0x271be1,_0x24ba27={'total':_0x42aa08[_0x170b61(0x315)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x3a78c9 of _0x42aa08){if(_0x3a78c9['state']===_0x170b61(0x2bf))_0x24ba27[_0x170b61(0x2bf)]++;else{if(_0x3a78c9[_0x170b61(0x2a5)]===_0x170b61(0x2e2)||_0x3a78c9['state']===_0x170b61(0x299))_0x24ba27['error']++;else _0x3a78c9['state']===_0x170b61(0x29e)?_0x24ba27['running']++:_0x24ba27[_0x170b61(0x2e4)]++;}}return _0x24ba27;}function formatStats(_0x580e94){const _0x49f48d=a42_0x271be1;return[_0x49f48d(0x286)+_0x580e94[_0x49f48d(0x1de)],'✅\x20'+_0x580e94[_0x49f48d(0x2bf)],'❌\x20'+_0x580e94[_0x49f48d(0x2e2)],'🔄\x20'+_0x580e94['running'],'⏳\x20'+_0x580e94[_0x49f48d(0x2e4)]][_0x49f48d(0x29b)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a42_0x271be1(0x31c)]=a42_0x271be1(0x310);[a42_0x271be1(0x25f)]='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a42_0x271be1(0x26e)](_0x1b560e){const _0x4cd5b1=a42_0x271be1,{options:_0x39ffe9,args:_0x5d65ec,tdx:_0xa75601}=_0x1b560e;let _0x1c9cc5,_0x19c114,_0x573a85=![];if(_0x5d65ec[0x0]){if(_0x5d65ec[0x0]['includes']('.')){const _0x17c019=this[_0x4cd5b1(0x34c)](_0x5d65ec,_0x39ffe9);if(!_0x17c019)return 0x1;_0x1c9cc5=_0x17c019[_0x4cd5b1(0x2bc)],_0x19c114=_0x17c019[_0x4cd5b1(0x35e)];}else{_0x19c114=_0x5d65ec[0x0],_0x1c9cc5=_0x39ffe9[_0x4cd5b1(0x356)];if(!_0x1c9cc5)return console[_0x4cd5b1(0x2e2)](a42_0x409acc[_0x4cd5b1(0x2e9)](_0x4cd5b1(0x2f0)),_0x4cd5b1(0x2da)),0x1;_0x573a85=!![];}}else{const _0x3fccc4=this['parseProjectWorkflowPattern'](_0x5d65ec,_0x39ffe9);if(!_0x3fccc4)return 0x1;_0x1c9cc5=_0x3fccc4[_0x4cd5b1(0x2bc)],_0x19c114=_0x3fccc4[_0x4cd5b1(0x35e)];}if(_0x39ffe9[_0x4cd5b1(0x335)]){if(_0x1c9cc5&&_0x19c114)console[_0x4cd5b1(0x2e2)](_0x4cd5b1(0x357)+_0x1c9cc5+'.'+_0x19c114);else _0x1c9cc5&&console[_0x4cd5b1(0x2e2)](_0x4cd5b1(0x2f1)+_0x1c9cc5);}const _0x1138e1=_0x39ffe9[_0x4cd5b1(0x383)],_0x26d96a=_0x39ffe9[_0x4cd5b1(0x244)];if(_0x1138e1){_0x26d96a&&console[_0x4cd5b1(0x2e2)](a42_0x409acc[_0x4cd5b1(0x34f)](_0x4cd5b1(0x2ab)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0xa1fe2e=_0x39ffe9['follow'];return _0xa1fe2e?await this[_0x4cd5b1(0x2ba)](_0x1b560e,_0x1138e1):await this[_0x4cd5b1(0x2c2)](_0x1b560e,_0x1138e1,_0x39ffe9),0x0;}if(_0x26d96a){const _0x5b58bc=await withSpinner(_0x4cd5b1(0x239),()=>_0xa75601['workflow'][_0x4cd5b1(0x2d0)]({'projectName':_0x1c9cc5,'workflowName':_0x19c114,'limit':0x64}),{'verbose':_0x39ffe9['verbose']}),_0xb6de79=_0x5b58bc[_0x4cd5b1(0x2d6)][_0x4cd5b1(0x2aa)](_0x56c949=>_0x56c949['id']===_0x26d96a);if(!_0xb6de79)return console[_0x4cd5b1(0x2e2)](a42_0x409acc[_0x4cd5b1(0x2e9)](_0x4cd5b1(0x2f0)),_0x4cd5b1(0x28f)+_0x26d96a),0x1;if(!_0xb6de79[_0x4cd5b1(0x281)]?.['id'])return console[_0x4cd5b1(0x2e2)](a42_0x409acc[_0x4cd5b1(0x2e9)]('Error:'),_0x4cd5b1(0x290)+_0x26d96a+'\x20has\x20no\x20attempts'),0x1;const _0x38189f=_0xb6de79[_0x4cd5b1(0x281)]['id'];_0x39ffe9[_0x4cd5b1(0x335)]&&console[_0x4cd5b1(0x2e2)]('Using\x20attempt\x20'+_0x38189f+_0x4cd5b1(0x24b)+_0x26d96a);const _0x203a22=_0x39ffe9[_0x4cd5b1(0x301)];return _0x203a22?await this[_0x4cd5b1(0x2ba)](_0x1b560e,_0x38189f):await this[_0x4cd5b1(0x2c2)](_0x1b560e,_0x38189f,_0x39ffe9),0x0;}const _0x50eaa0=await withSpinner(_0x4cd5b1(0x292),()=>_0xa75601['workflow'][_0x4cd5b1(0x2d0)]({'projectName':_0x1c9cc5,'workflowName':_0x19c114,'limit':_0x39ffe9[_0x4cd5b1(0x2d2)]||0x32}),{'verbose':_0x39ffe9['verbose']}),_0x47d39d=_0x50eaa0[_0x4cd5b1(0x2d6)];if(_0x47d39d[_0x4cd5b1(0x315)]===0x0){if(_0x1c9cc5&&_0x19c114)console[_0x4cd5b1(0x2e2)]('No\x20sessions\x20found\x20for:\x20'+_0x1c9cc5+'.'+_0x19c114);else _0x1c9cc5?console['error']('No\x20sessions\x20found\x20in\x20project:\x20'+_0x1c9cc5):(console[_0x4cd5b1(0x2e2)](_0x4cd5b1(0x24c)),console['error'](a42_0x409acc[_0x4cd5b1(0x210)](_0x4cd5b1(0x291))));return 0x0;}_0x47d39d[_0x4cd5b1(0x36a)]((_0xff9210,_0x5dfd08)=>{const _0x5362dd=_0x4cd5b1,_0x496299=_0xff9210[_0x5362dd(0x33a)]||'',_0x5b01e4=_0x5dfd08[_0x5362dd(0x33a)]||'';return _0x5b01e4[_0x5362dd(0x235)](_0x496299);});if(_0x39ffe9[_0x4cd5b1(0x36b)]||_0x39ffe9[_0x4cd5b1(0x344)])return await handleSDKOutput(_0x47d39d,_0x39ffe9),0x0;let _0x514937;if(_0x573a85){const _0x57ed00=_0x47d39d[0x0];if(!_0x57ed00['lastAttempt']?.['id'])return console[_0x4cd5b1(0x2e2)](_0x4cd5b1(0x280)),0x0;_0x514937=_0x57ed00[_0x4cd5b1(0x281)]['id'],_0x39ffe9['verbose']&&console[_0x4cd5b1(0x2e2)](_0x4cd5b1(0x1e4)+_0x57ed00[_0x4cd5b1(0x33a)]);}else{const _0x6b1209=_0x47d39d['map'](_0x506df5=>{const _0x2180f4=_0x4cd5b1,_0x454032=getAttemptStatusDisplay(_0x506df5[_0x2180f4(0x281)]);return{'title':_0x506df5[_0x2180f4(0x339)]?.[_0x2180f4(0x31c)]+'.'+_0x506df5[_0x2180f4(0x1ff)]?.['name']+_0x2180f4(0x248)+_0x506df5['sessionTime']+'\x20'+_0x454032['icon'],'value':_0x506df5['lastAttempt']?.['id']||'','description':_0x454032[_0x2180f4(0x2be)]};}),_0x776fc6=await a42_0x5aae83({'type':_0x4cd5b1(0x31f),'name':'attemptId','message':_0x4cd5b1(0x32b),'choices':_0x6b1209['filter'](_0x20ad47=>_0x20ad47[_0x4cd5b1(0x208)]!=='')});if(!_0x776fc6[_0x4cd5b1(0x383)])return 0x0;_0x514937=_0x776fc6['attemptId'];}const _0x487df9=_0x39ffe9[_0x4cd5b1(0x301)];return _0x487df9?await this[_0x4cd5b1(0x2ba)](_0x1b560e,_0x514937):await this[_0x4cd5b1(0x2c2)](_0x1b560e,_0x514937,_0x39ffe9),0x0;}async[a42_0x271be1(0x2c2)](_0x5a0124,_0x34a943,_0x5ba07b){const _0x1ed0bd=a42_0x271be1,{tdx:_0x3311e4}=_0x5a0124;let _0x54f933,_0x2a351e;try{[_0x54f933,_0x2a351e]=await Promise[_0x1ed0bd(0x33e)]([_0x3311e4[_0x1ed0bd(0x1ff)][_0x1ed0bd(0x2eb)](_0x34a943),_0x3311e4['workflow'][_0x1ed0bd(0x23f)](_0x34a943,![])]);}catch(_0x1cd2ec){console[_0x1ed0bd(0x2e2)](a42_0x409acc[_0x1ed0bd(0x2e9)](_0x1ed0bd(0x376)));_0x5ba07b['verbose']&&console[_0x1ed0bd(0x2e2)](_0x1cd2ec);throw _0x1cd2ec;}if(_0x5ba07b[_0x1ed0bd(0x36b)]||_0x5ba07b[_0x1ed0bd(0x344)]){const _0x33ab29=this[_0x1ed0bd(0x236)](_0x54f933,_0x2a351e);await handleSDKOutput([_0x33ab29],_0x5ba07b);return;}const _0x561dff=_0x3311e4['context'][_0x1ed0bd(0x360)],_0x24d581=this[_0x1ed0bd(0x2ce)](_0x54f933,_0x2a351e,_0x561dff);console[_0x1ed0bd(0x342)](_0x24d581);}async['pollTimeline'](_0x2dc110,_0x327f4d){const _0x8a55f5=a42_0x271be1,{tdx:_0x35f1b4}=_0x2dc110,_0x1bf7e0=TIMELINE_CONFIG[_0x8a55f5(0x25c)],_0x9d42c6=TIMELINE_CONFIG[_0x8a55f5(0x32e)];let _0x1990ce=0x0;while(_0x1990ce<_0x9d42c6){process[_0x8a55f5(0x372)][_0x8a55f5(0x358)]&&process[_0x8a55f5(0x372)][_0x8a55f5(0x218)]('\x1bc');let _0x2b7ffa,_0x2cee02;try{[_0x2b7ffa,_0x2cee02]=await Promise['all']([_0x35f1b4['workflow'][_0x8a55f5(0x2eb)](_0x327f4d),_0x35f1b4[_0x8a55f5(0x1ff)]['tasks'](_0x327f4d,![])]);}catch(_0x565f45){console[_0x8a55f5(0x2e2)](a42_0x409acc[_0x8a55f5(0x2e9)](_0x8a55f5(0x1e9)));_0x1990ce>0x0&&console[_0x8a55f5(0x2e2)](a42_0x409acc['dim'](_0x8a55f5(0x2cd)+_0x1990ce));throw _0x565f45;}const _0x317661=_0x35f1b4[_0x8a55f5(0x35f)][_0x8a55f5(0x360)],_0x1c840c=this[_0x8a55f5(0x2ce)](_0x2b7ffa,_0x2cee02,_0x317661);console['log'](_0x1c840c);const _0x521783=_0x2b7ffa['done']&&_0x2cee02[_0x8a55f5(0x1fe)](_0x3407c0=>_0x3407c0[_0x8a55f5(0x2a5)]!=='running'&&_0x3407c0[_0x8a55f5(0x2a5)]!==_0x8a55f5(0x1e5));if(_0x521783){console['error'](a42_0x409acc[_0x8a55f5(0x2ac)]('\x0a✔\x20Attempt\x20complete'));break;}console[_0x8a55f5(0x2e2)](a42_0x409acc['dim']('\x0aPolling...\x20('+_0x1990ce*0x2+_0x8a55f5(0x24a))),await new Promise(_0x1b95f7=>setTimeout(_0x1b95f7,_0x1bf7e0)),_0x1990ce++;}_0x1990ce>=_0x9d42c6&&console[_0x8a55f5(0x2e2)](a42_0x409acc['yellow'](_0x8a55f5(0x1ef)));}[a42_0x271be1(0x2ce)](_0x27a2d3,_0x5c275f,_0x3ffc9c){const _0x2fad26=a42_0x271be1,_0x51b4e3=[],_0xd08c4c=TIMELINE_CONFIG[_0x2fad26(0x21b)],_0x3c636b=0x5,_0x4ef5ea=process['stdout'][_0x2fad26(0x35c)]||0x78,_0x202c8f=_0x4ef5ea-_0xd08c4c-_0x3c636b,_0xba75d5=Math[_0x2fad26(0x375)](TIMELINE_CONFIG[_0x2fad26(0x2a0)],Math[_0x2fad26(0x1e7)](_0x202c8f,TIMELINE_CONFIG[_0x2fad26(0x1db)])),_0x32e2c7=new Date(_0x27a2d3['createdAt'])[_0x2fad26(0x374)](),_0x591784=_0x27a2d3[_0x2fad26(0x29f)]?new Date(_0x27a2d3[_0x2fad26(0x29f)])[_0x2fad26(0x374)]():Date[_0x2fad26(0x348)](),_0x3f5e16={'start':_0x32e2c7,'end':_0x591784,'duration':_0x591784-_0x32e2c7},_0x3a6fea=new Map(),_0x216564=[];for(const _0x29d922 of _0x5c275f){if(_0x29d922[_0x2fad26(0x22b)]){const _0x2518e9=new Date(_0x29d922[_0x2fad26(0x22b)])[_0x2fad26(0x374)](),_0x66d5db=_0x29d922['updatedAt']?new Date(_0x29d922[_0x2fad26(0x25e)])[_0x2fad26(0x374)]():Date[_0x2fad26(0x348)](),_0xe8b488={'start':_0x2518e9,'end':_0x66d5db,'duration':_0x66d5db-_0x2518e9};_0x3a6fea[_0x2fad26(0x230)](_0x29d922['id'],_0xe8b488),_0x216564['push']({'name':_0x29d922['fullName'],'state':_0x29d922['state']||'unknown','window':_0xe8b488});}else _0x216564[_0x2fad26(0x257)]({'name':_0x29d922[_0x2fad26(0x2f7)],'state':_0x29d922['state']||_0x2fad26(0x1e5),'window':undefined});}_0x216564['sort']((_0x2e4e59,_0x4c67d2)=>{const _0xf3f0e6=_0x2fad26;if(!_0x2e4e59[_0xf3f0e6(0x209)])return 0x1;if(!_0x4c67d2[_0xf3f0e6(0x209)])return-0x1;return _0x2e4e59[_0xf3f0e6(0x209)]['start']-_0x4c67d2['window'][_0xf3f0e6(0x249)];});const _0x566a94=_0x216564[_0x2fad26(0x315)],_0x283cc8=_0x566a94>TIMELINE_CONFIG[_0x2fad26(0x20d)];_0x283cc8&&_0x216564['splice'](TIMELINE_CONFIG[_0x2fad26(0x20d)]);const _0x1764a8=calculateTimeScale(_0x3f5e16,_0xba75d5),_0x505632=_0x27a2d3['done']?_0x27a2d3[_0x2fad26(0x2bf)]?a42_0x409acc[_0x2fad26(0x2ac)](_0x2fad26(0x2bf)):a42_0x409acc[_0x2fad26(0x2e9)]('error'):a42_0x409acc[_0x2fad26(0x246)]('running'),_0x5bfe02=_0x27a2d3['project']?.['id'],_0x116e73=_0x27a2d3[_0x2fad26(0x244)];let _0x1b6b32;if(_0x5bfe02&&_0x116e73){const _0x2cd19e=getWorkflowAttemptUrl(_0x3ffc9c,_0x5bfe02,_0x116e73,_0x27a2d3['id']);_0x1b6b32=hyperlink(a42_0x409acc[_0x2fad26(0x210)](_0x27a2d3['id']),_0x2cd19e);}else _0x1b6b32=a42_0x409acc[_0x2fad26(0x210)](_0x27a2d3['id']);_0x51b4e3[_0x2fad26(0x257)]('Attempt:\x20'+_0x1b6b32+_0x2fad26(0x248)+_0x505632+_0x2fad26(0x248)+formatElapsed(_0x3f5e16[_0x2fad26(0x323)]));if(_0x216564[_0x2fad26(0x315)]>0x0){const _0x4edf78=renderTimeAxis(_0x1764a8,_0xba75d5),_0x266bde=new Date(_0x3f5e16[_0x2fad26(0x249)]),_0x2b44ce=formatDate(_0x266bde),_0xf772dd=TIMELINE_CONFIG[_0x2fad26(0x36c)]+TIMELINE_CONFIG[_0x2fad26(0x205)]+_0xd08c4c,_0x56f5a3=_0x2b44ce[_0x2fad26(0x32f)](_0xf772dd),_0x50d00b=a42_0x409acc[_0x2fad26(0x210)](_0x56f5a3);_0x51b4e3[_0x2fad26(0x257)](_0x50d00b+'\x20'+_0x4edf78);for(const _0x2b75f7 of _0x216564){_0x51b4e3['push'](renderTaskRow(_0x2b75f7,_0x1764a8,_0xba75d5,_0xd08c4c));}const _0xd4eef4=calculateStats(_0x216564);_0x51b4e3[_0x2fad26(0x257)](formatStats(_0xd4eef4)),_0x283cc8&&_0x51b4e3[_0x2fad26(0x257)](a42_0x409acc[_0x2fad26(0x34f)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x2fad26(0x2ff)+_0x566a94+'\x20tasks')),_0x51b4e3[_0x2fad26(0x257)](''),_0x51b4e3[_0x2fad26(0x257)](a42_0x409acc[_0x2fad26(0x210)](_0x2fad26(0x226))+(_0x2fad26(0x26c)+_0x27a2d3['id']+_0x2fad26(0x2dd))+a42_0x409acc['dim'](_0x2fad26(0x2e3)));}else _0x51b4e3[_0x2fad26(0x257)](_0x2fad26(0x259));return _0x51b4e3[_0x2fad26(0x29b)]('\x0a');}[a42_0x271be1(0x236)](_0x3401eb,_0x558cf7){const _0x409adc=a42_0x271be1,_0x53bda4=new Date(_0x3401eb['createdAt'])[_0x409adc(0x374)](),_0x442de5=_0x3401eb[_0x409adc(0x29f)]?new Date(_0x3401eb[_0x409adc(0x29f)])['getTime']():Date[_0x409adc(0x348)](),_0x1a2ef2=_0x442de5-_0x53bda4,_0x83152b=[];for(const _0x164e47 of _0x558cf7){if(_0x164e47['startedAt']){const _0x37f2b1=new Date(_0x164e47[_0x409adc(0x22b)])[_0x409adc(0x374)](),_0x5acfff=_0x164e47[_0x409adc(0x25e)]?new Date(_0x164e47[_0x409adc(0x25e)])[_0x409adc(0x374)]():Date['now']();_0x83152b[_0x409adc(0x257)]({'name':_0x164e47['fullName'],'state':_0x164e47[_0x409adc(0x2a5)]||_0x409adc(0x27a),'window':{'start':_0x37f2b1,'end':_0x5acfff,'duration':_0x5acfff-_0x37f2b1}});}else _0x83152b[_0x409adc(0x257)]({'name':_0x164e47['fullName'],'state':_0x164e47[_0x409adc(0x2a5)]||_0x409adc(0x1e5),'window':undefined});}const _0x3fa62c=calculateStats(_0x83152b);return{'attempt':{'id':_0x3401eb['id'],'status':_0x3401eb[_0x409adc(0x2e5)]?_0x3401eb['success']?_0x409adc(0x2bf):_0x409adc(0x2e2):_0x409adc(0x29e),'createdAt':_0x3401eb[_0x409adc(0x2b9)],'finishedAt':_0x3401eb[_0x409adc(0x29f)],'duration_ms':_0x1a2ef2},'tasks':_0x83152b['map'](_0xeef70d=>({'name':_0xeef70d[_0x409adc(0x31c)],'state':_0xeef70d['state'],'startedAt':_0xeef70d[_0x409adc(0x209)]?new Date(_0xeef70d[_0x409adc(0x209)][_0x409adc(0x249)])[_0x409adc(0x25d)]():null,'updatedAt':_0xeef70d[_0x409adc(0x209)]?new Date(_0xeef70d['window'][_0x409adc(0x1d4)])[_0x409adc(0x25d)]():null,'duration_ms':_0xeef70d[_0x409adc(0x209)]?.[_0x409adc(0x323)]||null})),'stats':_0x3fa62c};}}
|
|
1
|
+
const a42_0x383d92=a42_0x34a3;(function(_0x387e1b,_0xf6167c){const _0x480b5b=a42_0x34a3,_0x1d82d4=_0x387e1b();while(!![]){try{const _0x442d73=parseInt(_0x480b5b(0x1ef))/0x1+-parseInt(_0x480b5b(0x2ec))/0x2*(-parseInt(_0x480b5b(0x2fa))/0x3)+-parseInt(_0x480b5b(0x27d))/0x4+parseInt(_0x480b5b(0x23e))/0x5+parseInt(_0x480b5b(0x33c))/0x6+-parseInt(_0x480b5b(0x31e))/0x7*(-parseInt(_0x480b5b(0x261))/0x8)+-parseInt(_0x480b5b(0x2e2))/0x9;if(_0x442d73===_0xf6167c)break;else _0x1d82d4['push'](_0x1d82d4['shift']());}catch(_0x5924b1){_0x1d82d4['push'](_0x1d82d4['shift']());}}}(a42_0x8dc8,0x995d0));import a42_0x5853ac from'chalk';import{existsSync}from'fs';import a42_0x219276 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a42_0x3f4844 from'prompts';function getAttemptStatusDisplay(_0x5beeef){const _0x17cc54=a42_0x34a3;if(!_0x5beeef)return{'icon':'⏳','text':''};const {done:_0x1a7350,success:_0x2013b9,cancelRequested:_0x1e58da}=_0x5beeef;if(!_0x1a7350)return _0x1e58da?{'icon':'🛑','text':a42_0x5853ac[_0x17cc54(0x1ed)](_0x17cc54(0x33d))}:{'icon':'🔄','text':a42_0x5853ac[_0x17cc54(0x289)](_0x17cc54(0x248))};if(_0x2013b9)return{'icon':'✅','text':a42_0x5853ac[_0x17cc54(0x1ee)]('success')};return{'icon':'❌','text':a42_0x5853ac[_0x17cc54(0x2cd)]('error')};}export class WorkflowBaseCommand extends BaseCommand{[a42_0x383d92(0x356)](_0xe90a97,_0x5cbd7b,_0x15fadb=0x0){const _0x24e58a=a42_0x383d92;return _0xe90a97[_0x15fadb]||_0x5cbd7b[_0x24e58a(0x2b7)];}[a42_0x383d92(0x2b9)](_0x468831,_0x568a93,_0x4b6f82=0x0){const _0x402823=a42_0x383d92,_0x1ed5a8=this[_0x402823(0x356)](_0x468831,_0x568a93,_0x4b6f82);if(!_0x1ed5a8)return console['error'](a42_0x5853ac[_0x402823(0x2cd)]('Error:'),'Project\x20name\x20is\x20required'),console[_0x402823(0x222)](a42_0x5853ac[_0x402823(0x218)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x1ed5a8;}[a42_0x383d92(0x34a)](_0x55b24b,_0x58f9fe){const _0x12b607=a42_0x383d92;if(_0x55b24b[0x0]){const _0x101e1f=_0x55b24b[0x0]['split']('.');if(_0x101e1f[_0x12b607(0x2a3)]===0x1)return{'projectName':_0x101e1f[0x0],'workflowName':undefined};else return _0x101e1f['length']===0x2?{'projectName':_0x101e1f[0x0],'workflowName':_0x101e1f[0x1]}:(console[_0x12b607(0x222)](a42_0x5853ac[_0x12b607(0x2cd)](_0x12b607(0x305)),_0x12b607(0x31c)),null);}return{'projectName':_0x58f9fe[_0x12b607(0x2b7)],'workflowName':undefined};}[a42_0x383d92(0x263)](_0x5b5735,_0x42fb81,_0x3c2ea4=0x0){const _0x378109=a42_0x383d92;if(_0x5b5735[_0x3c2ea4])return _0x5b5735[_0x3c2ea4];if(_0x42fb81[_0x378109(0x2b7)]){const _0x564817=a42_0x219276[_0x378109(0x37a)](process[_0x378109(0x2db)](),'workflows',_0x42fb81[_0x378109(0x2b7)]);if(existsSync(a42_0x219276[_0x378109(0x37a)](_0x564817,_0x378109(0x2fb))))return _0x564817;}return undefined;}async[a42_0x383d92(0x388)](_0x2077d2,_0x2d9fac,_0x2187a4){const _0x17995c=a42_0x383d92;try{const _0x43e085=await _0x2077d2[_0x17995c(0x201)]['workflows'](_0x2d9fac,{'limit':0x1});if(_0x43e085[_0x17995c(0x2a3)]>0x0){const _0x189a14=_0x43e085[0x0]['id'],_0x15fcb0=getWorkflowUrl(_0x2187a4,_0x189a14);console[_0x17995c(0x222)](_0x17995c(0x366)+a42_0x5853ac[_0x17995c(0x214)](_0x15fcb0));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a42_0x383d92(0x380)]=a42_0x383d92(0x374);['description']=a42_0x383d92(0x340);async[a42_0x383d92(0x342)](_0x3660da){const _0xe3dd9c=a42_0x383d92,{options:_0x571d65,args:_0x4aefd7,tdx:_0x448c5e}=_0x3660da,_0x54087e=_0x4aefd7[0x0],_0x1b50d1=_0x571d65[_0xe3dd9c(0x2e1)];if(_0x1b50d1)return saveSessionContext({'workflow_project':undefined},_0x571d65[_0xe3dd9c(0x249)]),console[_0xe3dd9c(0x2bf)](a42_0x5853ac['green']('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x54087e)return console[_0xe3dd9c(0x222)](a42_0x5853ac[_0xe3dd9c(0x2cd)]('Error:'),_0xe3dd9c(0x2f2)),console[_0xe3dd9c(0x222)](a42_0x5853ac[_0xe3dd9c(0x218)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console['error'](a42_0x5853ac['dim']('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x3ed09a=await withSpinner(_0xe3dd9c(0x2b1)+_0x54087e+_0xe3dd9c(0x38a),()=>_0x448c5e[_0xe3dd9c(0x201)]['resolveProjectId'](_0x54087e),{'verbose':_0x571d65[_0xe3dd9c(0x304)]}),{name:_0x23651c}=_0x3ed09a[_0xe3dd9c(0x308)];return saveSessionContext({'workflow_project':_0x23651c},_0x571d65[_0xe3dd9c(0x249)]),console[_0xe3dd9c(0x2bf)](a42_0x5853ac['green'](_0xe3dd9c(0x25c)+a42_0x5853ac[_0xe3dd9c(0x214)](_0x23651c))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']='workflow:projects';[a42_0x383d92(0x206)]=a42_0x383d92(0x2d3);async[a42_0x383d92(0x342)](_0x503f55){const _0x19510b=a42_0x383d92,{options:_0x3c81ec,args:_0x22efb7,tdx:_0x594a30}=_0x503f55,_0x114efa=_0x22efb7[0x0];_0x3c81ec[_0x19510b(0x304)]&&_0x114efa&&console['error'](_0x19510b(0x303)+_0x114efa);const _0x308499=await withSpinner(_0x19510b(0x386),()=>_0x594a30[_0x19510b(0x201)][_0x19510b(0x1f5)](_0x114efa,{'limit':_0x3c81ec[_0x19510b(0x2d4)]}),{'verbose':_0x3c81ec[_0x19510b(0x304)]});let _0x45d8d0=_0x308499[_0x19510b(0x308)];_0x45d8d0['sort']((_0x3478d7,_0x29d054)=>_0x3478d7[_0x19510b(0x380)]['localeCompare'](_0x29d054[_0x19510b(0x380)]));const _0x469093=_0x3c81ec[_0x19510b(0x2d4)]||0x64,_0x1c20d5=_0x45d8d0['length']>=_0x469093?a42_0x5853ac[_0x19510b(0x218)](_0x19510b(0x326)):'';console[_0x19510b(0x222)](_0x19510b(0x23d)+_0x45d8d0[_0x19510b(0x2a3)]+'\x20project'+(_0x45d8d0[_0x19510b(0x2a3)]!==0x1?'s':'')+_0x1c20d5);if(_0x3c81ec['format']===_0x19510b(0x237)||_0x3c81ec[_0x19510b(0x300)]==='jsonl'||_0x3c81ec['format']===_0x19510b(0x2cb))await handleSDKOutput(_0x45d8d0,_0x3c81ec);else{if(_0x45d8d0[_0x19510b(0x2a3)]===0x0)_0x114efa?console[_0x19510b(0x2bf)](_0x19510b(0x21b)+_0x114efa):console[_0x19510b(0x2bf)](_0x19510b(0x2ca));else{const _0x34ae76=_0x45d8d0[_0x19510b(0x2f1)](_0x25b1c6=>{const _0x58a9b1=_0x19510b,_0x3352db=_0x25b1c6[_0x58a9b1(0x349)]?.[_0x58a9b1(0x2ae)](_0x1348a5=>_0x1348a5[_0x58a9b1(0x2ac)]==='sys'),_0x51b5d7=_0x3352db?a42_0x5853ac[_0x58a9b1(0x218)](_0x58a9b1(0x317)):'';return _0x58a9b1(0x246)+_0x25b1c6['name']+_0x51b5d7;});await writeOutput(_0x34ae76['join']('\x0a'),_0x3c81ec[_0x19510b(0x279)],_0x19510b(0x280));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a42_0x383d92(0x212);[a42_0x383d92(0x206)]=a42_0x383d92(0x265);async['execute'](_0x1d5b34){const _0x912660=a42_0x383d92,{options:_0x4ea407,args:_0x376d60,tdx:_0x2eedd4}=_0x1d5b34,_0x5e31ec=this[_0x912660(0x356)](_0x376d60,_0x4ea407);_0x4ea407['verbose']&&_0x5e31ec&&console['error'](_0x912660(0x299)+_0x5e31ec);const _0x52aa56=await withSpinner('Listing\x20workflows...',()=>_0x2eedd4[_0x912660(0x201)][_0x912660(0x204)](_0x5e31ec,{'limit':_0x4ea407['limit']}),{'verbose':_0x4ea407[_0x912660(0x304)]});let _0x13111e=_0x52aa56[_0x912660(0x308)];_0x13111e[_0x912660(0x282)]((_0x90aeed,_0x136913)=>{const _0x426246=_0x912660,_0xe62d06=_0x90aeed['name'][_0x426246(0x341)](_0x136913['name']);if(_0xe62d06!==0x0)return _0xe62d06;return(_0x90aeed['project']?.[_0x426246(0x380)]||'')[_0x426246(0x341)](_0x136913['project']?.[_0x426246(0x380)]||'');});const _0x3b85f4=_0x4ea407[_0x912660(0x2d4)]||0x64,_0x59be71=_0x13111e[_0x912660(0x2a3)]>=_0x3b85f4?a42_0x5853ac[_0x912660(0x218)](_0x912660(0x326)):'';console[_0x912660(0x222)]('✔\x20Found\x20'+_0x13111e[_0x912660(0x2a3)]+_0x912660(0x2da)+(_0x13111e['length']!==0x1?'s':'')+_0x59be71);if(_0x4ea407['format']===_0x912660(0x237)||_0x4ea407[_0x912660(0x300)]==='jsonl'||_0x4ea407['format']===_0x912660(0x2cb))await handleSDKOutput(_0x13111e,_0x4ea407);else{if(_0x13111e['length']===0x0)_0x5e31ec?console[_0x912660(0x2bf)](_0x912660(0x345)+_0x5e31ec):console[_0x912660(0x2bf)](_0x912660(0x372));else{const _0x4ecda5=_0x4ea407[_0x912660(0x357)],_0x39225c=_0x13111e[_0x912660(0x2f1)](_0x2ff946=>{const _0x5dc385=_0x912660,_0x15a359=a42_0x5853ac[_0x5dc385(0x218)]('#'+_0x2ff946['id']),_0x1d16e2=hyperlink(_0x15a359,getWorkflowUrl(_0x4ecda5,_0x2ff946['id'])),_0x16bcf1=_0x2ff946[_0x5dc385(0x334)]?.[_0x5dc385(0x380)]?a42_0x5853ac[_0x5dc385(0x218)]('\x20('+_0x2ff946['project'][_0x5dc385(0x380)]+')'):'';return _0x5dc385(0x264)+_0x1d16e2+'\x20'+_0x2ff946['name']+_0x16bcf1;});await writeOutput(_0x39225c[_0x912660(0x37a)]('\x0a'),_0x4ea407['output'],_0x912660(0x280));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a42_0x383d92(0x380)]=a42_0x383d92(0x2b3);[a42_0x383d92(0x206)]='List\x20workflow\x20execution\x20sessions';async[a42_0x383d92(0x342)](_0x4c17fc){const _0x3f3bff=a42_0x383d92,{options:_0x29b013,args:_0x1a3e37,tdx:_0x2894e2}=_0x4c17fc,_0x551235=this[_0x3f3bff(0x34a)](_0x1a3e37,_0x29b013);if(!_0x551235)return 0x1;const {projectName:_0x19f5d3,workflowName:_0x54bdc0}=_0x551235;if(_0x29b013['verbose']){if(_0x19f5d3&&_0x54bdc0)console[_0x3f3bff(0x222)]('Filter:\x20'+_0x19f5d3+'.'+_0x54bdc0);else _0x19f5d3&&console['error'](_0x3f3bff(0x231)+_0x19f5d3);const _0xe1aa64=_0x29b013[_0x3f3bff(0x327)];_0xe1aa64&&console[_0x3f3bff(0x222)](_0x3f3bff(0x2e6)+_0xe1aa64);}let _0x3aec51=0x28;if(process[_0x3f3bff(0x239)]['isTTY']&&!_0x29b013[_0x3f3bff(0x279)]&&!_0x29b013[_0x3f3bff(0x300)]){const _0xaf37a2=process[_0x3f3bff(0x239)]['rows']||0x28;_0x3aec51=Math[_0x3f3bff(0x2f9)](0x14,Math[_0x3f3bff(0x241)](_0xaf37a2*0x2/0x3));}const _0x3dcd02=_0x29b013[_0x3f3bff(0x2d4)]||_0x3aec51,_0x329574=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x2894e2[_0x3f3bff(0x201)]['sessions']({'projectName':_0x19f5d3,'workflowName':_0x54bdc0,'status':_0x29b013[_0x3f3bff(0x327)],'fromTime':_0x29b013['from'],'toTime':_0x29b013['to'],'limit':_0x3dcd02}),{'verbose':_0x29b013[_0x3f3bff(0x304)]}),_0x2988ce=_0x329574[_0x3f3bff(0x308)];_0x2988ce[_0x3f3bff(0x282)]((_0x4f2b08,_0xc70884)=>{const _0x5481da=_0x3f3bff,_0x510be4=_0x4f2b08[_0x5481da(0x284)]||'',_0x4db3f2=_0xc70884[_0x5481da(0x284)]||'';return _0x4db3f2[_0x5481da(0x341)](_0x510be4);});_0x2988ce[_0x3f3bff(0x2a3)]>=_0x3dcd02?console['error'](_0x3f3bff(0x210)+_0x2988ce['length']+'\x20sessions\x20'+a42_0x5853ac[_0x3f3bff(0x218)]('(use\x20--limit\x20to\x20see\x20more)')):console[_0x3f3bff(0x222)]('✔\x20Found\x20'+_0x2988ce[_0x3f3bff(0x2a3)]+'\x20session'+(_0x2988ce[_0x3f3bff(0x2a3)]!==0x1?'s':''));if(_0x29b013[_0x3f3bff(0x300)]==='json'||_0x29b013[_0x3f3bff(0x300)]===_0x3f3bff(0x339)||_0x29b013['format']===_0x3f3bff(0x2cb))await handleSDKOutput(_0x2988ce,_0x29b013);else{if(!process[_0x3f3bff(0x239)][_0x3f3bff(0x28a)]||_0x29b013['output']){if(_0x2988ce['length']===0x0){if(_0x19f5d3&&_0x54bdc0)console[_0x3f3bff(0x2bf)](_0x3f3bff(0x389)+_0x19f5d3+'.'+_0x54bdc0);else _0x19f5d3?console[_0x3f3bff(0x2bf)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x19f5d3):console['log']('No\x20sessions\x20found');}else{const _0x510de1=_0x29b013[_0x3f3bff(0x357)],_0x203d26=this['renderSessionsTimeline'](_0x2988ce,_0x510de1);_0x29b013[_0x3f3bff(0x279)]?await writeOutput(_0x203d26,_0x29b013[_0x3f3bff(0x279)],'list'):console[_0x3f3bff(0x2bf)](_0x203d26);}!_0x19f5d3&&(console[_0x3f3bff(0x222)](''),console[_0x3f3bff(0x222)](a42_0x5853ac[_0x3f3bff(0x218)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console['error'](a42_0x5853ac['dim'](_0x3f3bff(0x1fb))+'or'+a42_0x5853ac['dim']('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x2988ce[_0x3f3bff(0x2a3)]===0x0){if(_0x19f5d3&&_0x54bdc0)console['log']('No\x20sessions\x20found\x20for:\x20'+_0x19f5d3+'.'+_0x54bdc0);else _0x19f5d3?console[_0x3f3bff(0x2bf)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x19f5d3):console[_0x3f3bff(0x2bf)](_0x3f3bff(0x36b));}else await this['navigateSessionsInteractive'](_0x2988ce,_0x4c17fc,_0x19f5d3);}}return 0x0;}['renderSessionsTimeline'](_0x461f46,_0x4d5ca5){const _0x27ed1c=a42_0x383d92,_0x7d44d2=[],_0x5dadc6=new Map();let _0x56776d=Infinity,_0x27340b=-Infinity;for(const _0x686a5f of _0x461f46){if(_0x686a5f[_0x27ed1c(0x2c4)]?.[_0x27ed1c(0x1f1)]){const _0x51e211=new Date(_0x686a5f[_0x27ed1c(0x2c4)]['createdAt'])['getTime'](),_0x5a1423=_0x686a5f[_0x27ed1c(0x2c4)][_0x27ed1c(0x385)]?new Date(_0x686a5f[_0x27ed1c(0x2c4)]['finishedAt'])[_0x27ed1c(0x312)]():Date[_0x27ed1c(0x344)](),_0x4aead7=_0x686a5f['project']?.['name']||_0x27ed1c(0x2d9);!_0x5dadc6[_0x27ed1c(0x267)](_0x4aead7)&&_0x5dadc6[_0x27ed1c(0x244)](_0x4aead7,[]),_0x5dadc6[_0x27ed1c(0x314)](_0x4aead7)[_0x27ed1c(0x375)]({'session':_0x686a5f,'startTime':_0x51e211,'endTime':_0x5a1423,'duration':_0x5a1423-_0x51e211}),_0x56776d=Math[_0x27ed1c(0x2cf)](_0x56776d,_0x51e211),_0x27340b=Math[_0x27ed1c(0x2f9)](_0x27340b,_0x5a1423);}}if(_0x5dadc6['size']===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x4f57e5=process[_0x27ed1c(0x239)][_0x27ed1c(0x23a)]||0x78,_0x7c6ce7=0x1e,_0x31fe96=0x32,_0x74b841=0x4,_0x38c758=Math[_0x27ed1c(0x2cf)](_0x31fe96,Math[_0x27ed1c(0x2f9)](_0x7c6ce7,Math[_0x27ed1c(0x241)](_0x4f57e5*0.3))),_0x1511e3=_0x4f57e5-_0x38c758-TIMELINE_CONFIG[_0x27ed1c(0x321)]-0x3-_0x74b841,_0x35bb57=_0x27340b-_0x56776d,_0x5c9eed=_0x35bb57/_0x38c758,_0x2be2f2=renderTimeAxis({'startTime':_0x56776d,'endTime':_0x27340b,'durationMs':_0x35bb57,'msPerChar':_0x5c9eed},_0x38c758),_0x3f49e3=[];for(const _0x19f683 of _0x5dadc6[_0x27ed1c(0x381)]()){_0x3f49e3[_0x27ed1c(0x375)](..._0x19f683);}_0x3f49e3[_0x27ed1c(0x282)]((_0x4e8a2d,_0x964f48)=>_0x964f48[_0x27ed1c(0x2f5)]-_0x4e8a2d[_0x27ed1c(0x2f5)]);const _0x5354b3=new Date(_0x56776d),_0x541ae9=formatDate(_0x5354b3),_0x382cc9=_0x74b841+TIMELINE_CONFIG[_0x27ed1c(0x371)]+TIMELINE_CONFIG['ICON_SPACING']+_0x1511e3,_0x8187c1='\x20'[_0x27ed1c(0x362)](_0x382cc9-_0x541ae9[_0x27ed1c(0x2a3)]),_0x3755fe=_0x8187c1+a42_0x5853ac[_0x27ed1c(0x218)](_0x541ae9)+'\x20'+_0x2be2f2;_0x7d44d2[_0x27ed1c(0x375)](_0x3755fe);const _0x3f3a58=0x16;let _0x441d99=0x0;for(const _0x2da5d1 of _0x3f49e3){const _0x5f1713=_0x2da5d1[_0x27ed1c(0x249)][_0x27ed1c(0x334)]?.[_0x27ed1c(0x380)]||'?',_0x2fef47=Math['min'](stringWidth(_0x5f1713),_0x3f3a58);_0x441d99=Math[_0x27ed1c(0x2f9)](_0x441d99,_0x2fef47);}for(const _0x2226e8 of _0x3f49e3){const {session:_0x5166d7,startTime:_0x4ee6a0,endTime:_0x47df53,duration:_0x18bd92}=_0x2226e8,_0x4cbe51=_0x5166d7[_0x27ed1c(0x334)]?.['id'],_0x116733=_0x5166d7['id'],_0x579159=_0x5166d7[_0x27ed1c(0x334)]?.['name']||'?',_0x18bca6=_0x5166d7[_0x27ed1c(0x201)]?.[_0x27ed1c(0x380)]||'?';let _0x4cdf76,_0x17e7ca;if(_0x5166d7[_0x27ed1c(0x2c4)]){const _0x2e8308=_0x5166d7[_0x27ed1c(0x2c4)];!_0x2e8308[_0x27ed1c(0x2ce)]?(_0x4cdf76=_0x2e8308[_0x27ed1c(0x30d)]?'🛑':'🔄',_0x17e7ca=_0x2e8308[_0x27ed1c(0x30d)]?a42_0x5853ac['yellow']:a42_0x5853ac['blue']):(_0x4cdf76=_0x2e8308[_0x27ed1c(0x2d0)]?'✅':'❌',_0x17e7ca=_0x2e8308['success']?a42_0x5853ac['green']:a42_0x5853ac[_0x27ed1c(0x2cd)]);}else _0x4cdf76='⏳',_0x17e7ca=a42_0x5853ac[_0x27ed1c(0x218)];const _0x2159d4='#'+_0x116733,_0x194779=_0x4cbe51?hyperlink(_0x2159d4,getWorkflowSessionUrl(_0x4d5ca5,_0x4cbe51,_0x116733)):_0x2159d4;let _0x4416ef=_0x579159;stringWidth(_0x579159)>_0x3f3a58&&(_0x4416ef=_0x579159[_0x27ed1c(0x2ba)](0x0,_0x3f3a58-0x1)+'…');const _0x24a0ae=a42_0x5853ac[_0x27ed1c(0x218)](_0x4416ef),_0x18d160=stringWidth(_0x4416ef),_0x173fe1='\x20'[_0x27ed1c(0x362)](_0x441d99-stringWidth(_0x4416ef)+0x2),_0x4f57c4='('+formatElapsed(_0x18bd92)+')',_0x10b70d=stringWidth(_0x4f57c4),_0x238bce=stringWidth(_0x2159d4),_0x209d92=_0x238bce+0x1+_0x18d160+_0x173fe1['length'],_0xe8e690=_0x1511e3-_0x209d92-_0x10b70d-0x1-0x8;let _0x4193d1=_0x18bca6;stringWidth(_0x4193d1)>_0xe8e690&&(_0x4193d1=_0x4193d1[_0x27ed1c(0x2ba)](0x0,_0xe8e690-0x1)+'…');const _0x1daf50=_0x194779+'\x20'+_0x24a0ae+_0x173fe1+_0x4193d1,_0x4c5f8e=stringWidth(_0x1daf50),_0x4c1867=_0x1511e3-_0x4c5f8e-_0x10b70d,_0x39f885=_0x1daf50+'\x20'[_0x27ed1c(0x362)](Math['max'](0x1,_0x4c1867))+a42_0x5853ac[_0x27ed1c(0x218)](_0x4f57c4),_0x124e42=Math[_0x27ed1c(0x241)]((_0x4ee6a0-_0x56776d)/_0x5c9eed),_0x38627a=Math[_0x27ed1c(0x241)]((_0x47df53-_0x56776d)/_0x5c9eed),_0xce0808=Math['max'](_0x124e42+0x1,_0x38627a),_0x1bb651=new Array(_0x38c758)['fill']('\x20');for(let _0xacd3c0=_0x124e42;_0xacd3c0<Math[_0x27ed1c(0x2cf)](_0xce0808,_0x38c758);_0xacd3c0++){_0x1bb651[_0xacd3c0]='─';}const _0x3f5f11=_0x1bb651[_0x27ed1c(0x2f1)](_0x54c52a=>_0x54c52a==='\x20'?'\x20':_0x17e7ca(_0x54c52a))[_0x27ed1c(0x37a)]('');_0x7d44d2[_0x27ed1c(0x375)](_0x4cdf76+'\x20'+_0x39f885+'│'+_0x3f5f11+'│');}return _0x7d44d2[_0x27ed1c(0x37a)]('\x0a');}async[a42_0x383d92(0x223)](_0x466c46,_0x177c68,_0x54234a){const _0x2412b3=a42_0x383d92,{options:_0x53cac3,tdx:_0x55b647}=_0x177c68,_0xdf51b6=_0x53cac3['site'],{timelineRows:_0x4493aa,timeAxisHeader:_0x45cfdf}=this['generateSessionTimelineRows'](_0x466c46,_0xdf51b6),_0x31812e=_0x4493aa[_0x2412b3(0x20c)](_0x2b9083=>_0x2b9083[_0x2412b3(0x36a)]);if(_0x31812e[_0x2412b3(0x2a3)]===0x0){const _0x530d2d=this[_0x2412b3(0x22b)](_0x466c46,_0xdf51b6);console['log'](_0x530d2d);!_0x54234a&&(console['error'](''),console[_0x2412b3(0x222)](a42_0x5853ac[_0x2412b3(0x218)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x2412b3(0x222)](a42_0x5853ac[_0x2412b3(0x218)](_0x2412b3(0x1fb))+'or'+a42_0x5853ac[_0x2412b3(0x218)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0x45cfdf&&console[_0x2412b3(0x2bf)](_0x45cfdf);const _0x1eee22=_0x4493aa[_0x2412b3(0x20c)](_0x225b2b=>_0x225b2b['attemptId'])[_0x2412b3(0x2f1)](_0x59f695=>({'title':_0x59f695[_0x2412b3(0x1f0)],'value':_0x59f695[_0x2412b3(0x36a)]})),_0x5340aa=process['stdout'][_0x2412b3(0x36c)]||0x3c,_0x414483=Math[_0x2412b3(0x2f9)](0x28,Math['floor'](_0x5340aa*0x2/0x3)),_0x54dd34=await a42_0x3f4844({'type':'autocomplete','name':_0x2412b3(0x36a),'message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x1eee22,'initial':-0x1,'limit':_0x414483,'clearFirst':!![],'fallback':{'title':_0x2412b3(0x255),'value':null},'suggest':(_0x3a6b0b,_0x225f42)=>{const _0x4af41c=_0x2412b3;if(!_0x3a6b0b)return Promise[_0x4af41c(0x1f4)](_0x225f42);const _0x2207b4=_0x225f42[_0x4af41c(0x20c)](_0x154b37=>{const _0x225dd2=_0x4af41c,_0x4488ce=_0x154b37;return _0x4488ce[_0x225dd2(0x352)][_0x225dd2(0x228)]()[_0x225dd2(0x2b8)](_0x3a6b0b[_0x225dd2(0x228)]());});return Promise['resolve'](_0x2207b4);}}),_0x3715cb=()=>{const _0x5c58da=_0x2412b3;process[_0x5c58da(0x239)][_0x5c58da(0x30e)]('\x1b[1A\x1b[2K'),process['stdout'][_0x5c58da(0x30e)]('\x1b[1A\x1b[2K'),process[_0x5c58da(0x239)][_0x5c58da(0x30e)]('\x1b[1A\x1b[2K');},_0x47ffbe=_0x54dd34&&_0x54dd34[_0x2412b3(0x36a)]&&_0x54dd34['attemptId']!==null&&_0x54dd34[_0x2412b3(0x36a)][_0x2412b3(0x309)]()!=='';if(!_0x47ffbe){_0x3715cb(),console[_0x2412b3(0x2bf)](a42_0x5853ac[_0x2412b3(0x218)](_0x2412b3(0x25f)));return;}_0x3715cb();const _0x3fd3bb=_0x466c46[_0x2412b3(0x2c5)](_0x4a6316=>_0x4a6316[_0x2412b3(0x2c4)]?.['id']===_0x54dd34[_0x2412b3(0x36a)]);if(_0x3fd3bb){const _0x5a61c0=_0x3fd3bb[_0x2412b3(0x334)]?.[_0x2412b3(0x380)]||'?',_0x29d346=_0x3fd3bb['workflow']?.[_0x2412b3(0x380)]||'?';console[_0x2412b3(0x2bf)](_0x2412b3(0x26d)+a42_0x5853ac[_0x2412b3(0x218)](_0x5a61c0)+_0x2412b3(0x30a)+a42_0x5853ac[_0x2412b3(0x218)](_0x29d346));}const _0x206304=new WorkflowTimelineCommand();await _0x206304[_0x2412b3(0x342)]({'args':[],'options':{..._0x53cac3,'attemptId':_0x54dd34['attemptId']},'tdx':_0x55b647});}[a42_0x383d92(0x29d)](_0x2fecd5,_0x56eb68){const _0x32eaff=a42_0x383d92,_0x5806c5=new Map();for(const _0x487633 of _0x2fecd5){_0x487633['id']&&_0x487633[_0x32eaff(0x2c4)]?.['id']&&_0x5806c5[_0x32eaff(0x244)](_0x487633['id'],_0x487633[_0x32eaff(0x2c4)]['id']);}const _0x37433c=[];let _0x24c444='';const _0x5982a8=this[_0x32eaff(0x22b)](_0x2fecd5,_0x56eb68),_0x312b01=_0x5982a8['split']('\x0a');for(const _0x2b5956 of _0x312b01){if(_0x2b5956['startsWith']('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x2b5956['match'](/^\s+\d{4}-\d{2}-\d{2}/))_0x24c444=_0x2b5956;else{if(_0x2b5956[_0x32eaff(0x205)](/^[✅❌🔄🛑⏳]/)){const _0x4c9a37=_0x2b5956[_0x32eaff(0x205)](/#(\d+)/),_0x40ffa7=_0x4c9a37?_0x4c9a37[0x1]:null,_0x31cc3f=_0x40ffa7?_0x5806c5[_0x32eaff(0x314)](_0x40ffa7)||null:null,_0x37fc8e=_0x2fecd5['find'](_0x29b43d=>_0x29b43d['id']===_0x40ffa7),_0x2460c5=_0x37fc8e?.[_0x32eaff(0x334)]?.[_0x32eaff(0x380)]||'';_0x37433c[_0x32eaff(0x375)]({'displayLine':_0x2b5956,'attemptId':_0x31cc3f,'projectName':_0x2460c5});}}}return{'timelineRows':_0x37433c,'timeAxisHeader':_0x24c444};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a42_0x383d92(0x380)]=a42_0x383d92(0x373);['description']=a42_0x383d92(0x2d6);async[a42_0x383d92(0x342)](_0x537695){const _0x22eea1=a42_0x383d92,{options:_0x3e13f9,args:_0xb425a5,tdx:_0x3f0fa9}=_0x537695,_0xc1d414=this[_0x22eea1(0x34a)](_0xb425a5,_0x3e13f9);if(!_0xc1d414)return 0x1;const {projectName:_0x177db7,workflowName:_0x4a65ac}=_0xc1d414,_0x3bbc7b=_0x3e13f9[_0x22eea1(0x24e)];if(_0x3e13f9[_0x22eea1(0x304)]){if(_0x177db7&&_0x4a65ac)console[_0x22eea1(0x222)](_0x22eea1(0x376)+_0x177db7+'.'+_0x4a65ac);else _0x177db7&&console['error']('Filter:\x20project='+_0x177db7);_0x3bbc7b&&console[_0x22eea1(0x222)]('Include\x20retried:\x20yes');}const _0x241a60=await withSpinner(_0x22eea1(0x35c),()=>_0x3f0fa9['workflow'][_0x22eea1(0x332)]({'projectName':_0x177db7,'workflowName':_0x4a65ac,'includeRetried':_0x3bbc7b,'limit':_0x3e13f9['limit']}),{'verbose':_0x3e13f9[_0x22eea1(0x304)]}),_0x2b811e=_0x241a60['data'],_0x524ebd=_0x3e13f9['limit']||0x64,_0x2b5d0b=_0x2b811e['length']>=_0x524ebd?a42_0x5853ac['dim'](_0x22eea1(0x326)):'';console['error']('✔\x20Found\x20'+_0x2b811e[_0x22eea1(0x2a3)]+'\x20attempt'+(_0x2b811e[_0x22eea1(0x2a3)]!==0x1?'s':'')+_0x2b5d0b);if(_0x3e13f9[_0x22eea1(0x300)]===_0x22eea1(0x237)||_0x3e13f9[_0x22eea1(0x300)]==='jsonl'||_0x3e13f9[_0x22eea1(0x300)]===_0x22eea1(0x2cb))await handleSDKOutput(_0x2b811e,_0x3e13f9);else{if(_0x2b811e['length']===0x0){if(_0x177db7&&_0x4a65ac)console[_0x22eea1(0x2bf)](_0x22eea1(0x2d7)+_0x177db7+'.'+_0x4a65ac);else _0x177db7?console['log'](_0x22eea1(0x22c)+_0x177db7):console[_0x22eea1(0x2bf)](_0x22eea1(0x368));}else{const _0x5f3578=_0x3e13f9[_0x22eea1(0x357)],_0x29b562=_0x2b811e[_0x22eea1(0x2f1)](_0x4f0a7c=>{const _0x53c7e8=_0x22eea1,_0x5b7a3f=a42_0x5853ac['dim']('#'+_0x4f0a7c['id']),_0x4cd0e4=_0x4f0a7c[_0x53c7e8(0x334)]?.['id'],_0x1515ee=_0x4f0a7c['session_id']||_0x4f0a7c[_0x53c7e8(0x252)],_0x31ca4f=_0x4cd0e4&&_0x1515ee?hyperlink(_0x5b7a3f,getWorkflowAttemptUrl(_0x5f3578,_0x4cd0e4,_0x1515ee,_0x4f0a7c['id'])):_0x5b7a3f,{icon:_0x32b8a0,text:_0x1d84d6}=getAttemptStatusDisplay(_0x4f0a7c),_0xa0add=(_0x4f0a7c[_0x53c7e8(0x334)]?.[_0x53c7e8(0x380)]||'?')+'.'+(_0x4f0a7c[_0x53c7e8(0x201)]?.['name']||'?'),_0x4a19f5=_0x4f0a7c['sessionTime']?a42_0x5853ac['dim'](_0x4f0a7c[_0x53c7e8(0x284)]):'';return(_0x31ca4f+'\x20'+_0x32b8a0+(_0x1d84d6?'\x20'+_0x1d84d6:'')+'\x20'+_0xa0add+'\x20'+_0x4a19f5)[_0x53c7e8(0x33b)]();});await writeOutput(_0x29b562[_0x22eea1(0x37a)]('\x0a'),_0x3e13f9[_0x22eea1(0x279)],_0x22eea1(0x280));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a42_0x383d92(0x270);['description']='Show\x20specific\x20attempt\x20details';async[a42_0x383d92(0x342)](_0x7732bc){const _0x52d776=a42_0x383d92,{options:_0x201006,args:_0x1d056f,tdx:_0x539889}=_0x7732bc,_0x30673c=_0x1d056f[0x0];if(!_0x30673c)return console['error'](_0x52d776(0x240)),0x1;_0x201006['verbose']&&console[_0x52d776(0x222)]('Attempt\x20ID:\x20'+_0x30673c);const _0xcbce76=await withSpinner(_0x52d776(0x2bb),()=>_0x539889[_0x52d776(0x201)][_0x52d776(0x347)](_0x30673c),{'verbose':_0x201006[_0x52d776(0x304)]}),_0x1a4657=_0xcbce76[_0x52d776(0x308)];let _0x553d2a;!_0x1a4657[_0x52d776(0x2ce)]?_0x553d2a=_0x1a4657[_0x52d776(0x30d)]?_0x52d776(0x33d):_0x52d776(0x248):_0x553d2a=_0x1a4657['success']?_0x52d776(0x2d0):'error';let _0x18231c;if(_0x1a4657['createdAt']&&_0x1a4657['finishedAt']){const _0x107038=new Date(_0x1a4657[_0x52d776(0x1f1)])['getTime'](),_0x184b32=new Date(_0x1a4657[_0x52d776(0x385)])[_0x52d776(0x312)]();_0x18231c=Math[_0x52d776(0x2aa)]((_0x184b32-_0x107038)/0x3e8);}const _0x2375c0={'attempt_id':_0x1a4657['id'],'status':_0x553d2a,..._0x1a4657[_0x52d776(0x2a5)]!==undefined&&{'index':_0x1a4657[_0x52d776(0x2a5)]},..._0x1a4657[_0x52d776(0x334)]&&{'project':_0x1a4657[_0x52d776(0x334)][_0x52d776(0x380)]},..._0x1a4657[_0x52d776(0x201)]&&{'workflow':_0x1a4657[_0x52d776(0x201)][_0x52d776(0x380)]},..._0x1a4657[_0x52d776(0x252)]&&{'session_id':_0x1a4657[_0x52d776(0x252)]},..._0x1a4657[_0x52d776(0x284)]&&{'session_time':_0x1a4657[_0x52d776(0x284)]},..._0x1a4657[_0x52d776(0x298)]&&{'retry_attempt':_0x1a4657[_0x52d776(0x298)]},..._0x18231c!==undefined&&{'duration_sec':_0x18231c},..._0x1a4657[_0x52d776(0x1f1)]&&{'created_at':_0x1a4657['createdAt']},..._0x1a4657['finishedAt']&&{'finished_at':_0x1a4657[_0x52d776(0x385)]},...Object['keys'](_0x1a4657[_0x52d776(0x277)])[_0x52d776(0x2a3)]>0x0&&{'params':_0x1a4657[_0x52d776(0x277)]}};return await handleSingleObjectOutput(_0x2375c0,_0x201006),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a42_0x383d92(0x380)]=a42_0x383d92(0x275);['description']=a42_0x383d92(0x268);async[a42_0x383d92(0x342)](_0xf6a5d4){const _0x130de4=a42_0x383d92,{options:_0x420b0d,args:_0x3bc2de,tdx:_0x42005f}=_0xf6a5d4,_0x21ab32=_0x3bc2de[0x0];if(!_0x21ab32)return console[_0x130de4(0x222)](_0x130de4(0x240)),0x1;const _0x10edb0=_0x420b0d[_0x130de4(0x281)];_0x420b0d['verbose']&&(console[_0x130de4(0x222)](_0x130de4(0x2c7)+_0x21ab32),_0x10edb0&&console['error'](_0x130de4(0x384)));const _0x2dc79d=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x42005f[_0x130de4(0x201)][_0x130de4(0x2df)](_0x21ab32,_0x10edb0||![]),{'verbose':_0x420b0d[_0x130de4(0x304)]}),_0x1cecff=_0x2dc79d[_0x130de4(0x308)];return console[_0x130de4(0x222)](_0x130de4(0x23d)+_0x1cecff[_0x130de4(0x2a3)]+'\x20task'+(_0x1cecff[_0x130de4(0x2a3)]!==0x1?'s':'')),await handleSDKOutput(_0x1cecff,_0x420b0d),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']='workflow:logs';['description']='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a42_0x383d92(0x342)](_0x56f150){const _0x5ca61d=a42_0x383d92,{options:_0x3ccb9d,args:_0x53c215,tdx:_0x338e3f}=_0x56f150,_0x27df24=_0x53c215[0x0];let _0x2d9abe=_0x53c215[0x1];if(!_0x27df24)return console['error'](_0x5ca61d(0x240)),0x1;_0x3ccb9d['verbose']&&(console['error'](_0x5ca61d(0x2c7)+_0x27df24),_0x2d9abe&&console['error'](_0x5ca61d(0x21a)+_0x2d9abe));const _0x13f25e=await withSpinner(_0x5ca61d(0x22f),()=>_0x338e3f[_0x5ca61d(0x201)][_0x5ca61d(0x2a0)](_0x27df24,_0x2d9abe),{'verbose':_0x3ccb9d[_0x5ca61d(0x304)]}),_0x1cf0ff=_0x13f25e['data'];if(_0x1cf0ff['length']===0x0)return console[_0x5ca61d(0x222)](_0x5ca61d(0x2c3)),0x0;if(!_0x2d9abe&&(_0x3ccb9d[_0x5ca61d(0x237)]||_0x3ccb9d[_0x5ca61d(0x300)]))return await handleSDKOutput(_0x1cf0ff,_0x3ccb9d),0x0;if(!_0x2d9abe){const _0x1affb7=_0x1cf0ff[_0x5ca61d(0x2f1)](_0x3102d8=>({'title':_0x3102d8['taskName']+'\x20('+formatBytes(_0x3102d8[_0x5ca61d(0x2eb)])+')','value':_0x3102d8[_0x5ca61d(0x325)]})),_0x1bfa33=await a42_0x3f4844({'type':_0x5ca61d(0x324),'name':_0x5ca61d(0x323),'message':_0x5ca61d(0x316),'choices':_0x1affb7});if(!_0x1bfa33['task'])return console['error'](_0x5ca61d(0x25f)),0x0;_0x2d9abe=_0x1bfa33['task'];}const _0x1bfc40=await withSpinner(_0x5ca61d(0x20b),()=>_0x338e3f[_0x5ca61d(0x201)]['logs'](_0x27df24,_0x2d9abe),{'verbose':_0x3ccb9d['verbose']}),_0x257f23=_0x1bfc40['data'];return _0x257f23?console[_0x5ca61d(0x2bf)](_0x257f23):console[_0x5ca61d(0x222)](_0x5ca61d(0x215)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a42_0x383d92(0x380)]=a42_0x383d92(0x209);[a42_0x383d92(0x206)]=a42_0x383d92(0x21c);async[a42_0x383d92(0x342)](_0x3d7aaa){const _0x31eb0e=a42_0x383d92,{options:_0x49905f,args:_0x1568e9,tdx:_0xb64d2d}=_0x3d7aaa,_0x50e8c0=_0x1568e9[0x0];if(!_0x50e8c0)return console[_0x31eb0e(0x222)](_0x31eb0e(0x240)),0x1;const _0x1f15ee=_0x49905f[_0x31eb0e(0x358)];_0x49905f[_0x31eb0e(0x304)]&&(console[_0x31eb0e(0x222)](_0x31eb0e(0x2c7)+_0x50e8c0),_0x1f15ee&&console[_0x31eb0e(0x222)](_0x31eb0e(0x2fd)+_0x1f15ee));if(!_0x49905f[_0x31eb0e(0x2a6)]){if(!isInteractive())return console[_0x31eb0e(0x222)](a42_0x5853ac['red'](_0x31eb0e(0x28e)),_0x31eb0e(0x25b)),console[_0x31eb0e(0x222)](a42_0x5853ac['dim'](_0x31eb0e(0x2dc))),0x1;const _0x2a56d7=await confirmKey(_0x31eb0e(0x35d)+_0x50e8c0+'?');if(!_0x2a56d7)return console[_0x31eb0e(0x222)](a42_0x5853ac[_0x31eb0e(0x1ed)](_0x31eb0e(0x25f))),0x1;}const _0x4c1d29=await withSpinner(_0x31eb0e(0x272),()=>_0xb64d2d[_0x31eb0e(0x201)][_0x31eb0e(0x36d)](_0x50e8c0,_0x1f15ee),{'verbose':_0x49905f[_0x31eb0e(0x304)]}),_0x387d5a=_0x4c1d29[_0x31eb0e(0x308)];return console[_0x31eb0e(0x222)]('✔\x20'+_0x387d5a),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a42_0x383d92(0x26b);[a42_0x383d92(0x206)]=a42_0x383d92(0x38b);async['execute'](_0x4b2c38){const _0x3c1fce=a42_0x383d92,{options:_0x456979,args:_0x54f106,tdx:_0x32c838}=_0x4b2c38,_0x34005e=_0x54f106[0x0];if(!_0x34005e)return console[_0x3c1fce(0x222)](_0x3c1fce(0x338)),console['error'](_0x3c1fce(0x32a)),0x1;let _0x3e2cb6=![],_0xe6e5c7=_0x34005e;if(_0x34005e[_0x3c1fce(0x242)](_0x3c1fce(0x28c)))_0x3e2cb6=!![],_0xe6e5c7=_0x34005e['substring'](0x8);else{if(_0x34005e[_0x3c1fce(0x242)](_0x3c1fce(0x31d)))_0x3e2cb6=![],_0xe6e5c7=_0x34005e[_0x3c1fce(0x27f)](0x8);else return console[_0x3c1fce(0x222)](_0x3c1fce(0x35f)),console[_0x3c1fce(0x222)](_0x3c1fce(0x32a)),0x1;}const _0x3c601f=_0x456979['fromTask'],_0x527ef5=_0x456979['resumeFrom'],_0x4afea0=_0x456979[_0x3c1fce(0x277)],_0x504c48=_0x456979[_0x3c1fce(0x364)];_0x456979[_0x3c1fce(0x304)]&&(console[_0x3c1fce(0x222)](_0x3c1fce(0x2a4)+(_0x3e2cb6?_0x3c1fce(0x249):'attempt')+'\x20'+_0xe6e5c7),_0x3c601f&&console['error'](_0x3c1fce(0x23b)+_0x3c601f),_0x527ef5&&console['error'](_0x3c1fce(0x250)+_0x527ef5),_0x4afea0&&console[_0x3c1fce(0x222)]('Params:\x20'+_0x4afea0),_0x504c48&&console[_0x3c1fce(0x222)](_0x3c1fce(0x238)));let _0x1ca009;if(_0x4afea0)try{if(_0x4afea0[_0x3c1fce(0x242)]('@')){const _0x3a986c=await import(_0x3c1fce(0x2ea)),_0x35c8d9=_0x4afea0[_0x3c1fce(0x27f)](0x1),_0x5ce361=await _0x3a986c[_0x3c1fce(0x258)](_0x35c8d9,_0x3c1fce(0x2f3));_0x1ca009=JSON[_0x3c1fce(0x236)](_0x5ce361);}else _0x1ca009=JSON[_0x3c1fce(0x236)](_0x4afea0);}catch{return console[_0x3c1fce(0x222)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x456979['yes']){if(!isInteractive())return console[_0x3c1fce(0x222)](a42_0x5853ac[_0x3c1fce(0x2cd)](_0x3c1fce(0x28e)),_0x3c1fce(0x25b)),console[_0x3c1fce(0x222)](a42_0x5853ac['dim'](_0x3c1fce(0x2dc))),0x1;const _0x212b89=await confirmKey(_0x3c1fce(0x26c)+(_0x3e2cb6?_0x3c1fce(0x249):_0x3c1fce(0x347))+'\x20'+_0xe6e5c7+'?');if(!_0x212b89)return console[_0x3c1fce(0x222)](a42_0x5853ac[_0x3c1fce(0x1ed)]('Cancelled')),0x1;}let _0x1cc9ae;_0x3e2cb6?_0x1cc9ae=await withSpinner(_0x3c1fce(0x28b),()=>_0x32c838[_0x3c1fce(0x201)]['retrySession'](_0xe6e5c7,{'fromTask':_0x3c601f,'retryParams':_0x1ca009}),{'verbose':_0x456979['verbose']}):_0x1cc9ae=await withSpinner(_0x3c1fce(0x337),()=>_0x32c838['workflow'][_0x3c1fce(0x254)](_0xe6e5c7,{'resumeFrom':_0x527ef5,'retryParams':_0x1ca009,'force':_0x504c48}),{'verbose':_0x456979['verbose']});const _0x3f1ecd=_0x1cc9ae['data'];return console[_0x3c1fce(0x222)](_0x3c1fce(0x226)),console[_0x3c1fce(0x222)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x3f1ecd[_0x3c1fce(0x36a)]),console[_0x3c1fce(0x222)](_0x3c1fce(0x216)+_0x3f1ecd[_0x3c1fce(0x252)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a42_0x383d92(0x380)]=a42_0x383d92(0x319);[a42_0x383d92(0x206)]=a42_0x383d92(0x329);async['execute'](_0x443359){const _0x48b378=a42_0x383d92,{options:_0x1feb36,args:_0x256f20,tdx:_0x292aea}=_0x443359;let _0x20f1db=_0x256f20[0x0];if(!_0x20f1db){const _0x56abcc=this[_0x48b378(0x356)]([],_0x1feb36),_0x318d39=await withSpinner(_0x48b378(0x365),()=>_0x292aea[_0x48b378(0x201)][_0x48b378(0x204)](_0x56abcc,{'limit':_0x1feb36[_0x48b378(0x2d4)]}),{'verbose':_0x1feb36[_0x48b378(0x304)]}),_0xa8accb=_0x318d39[_0x48b378(0x308)];if(_0xa8accb[_0x48b378(0x2a3)]===0x0)return console[_0x48b378(0x222)](_0x48b378(0x372)),!_0x56abcc&&console[_0x48b378(0x222)](a42_0x5853ac[_0x48b378(0x218)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x274f31=_0xa8accb[_0x48b378(0x2f1)](_0x2a934b=>({'title':_0x2a934b['project']?.['name']+'.'+_0x2a934b[_0x48b378(0x380)],'value':_0x2a934b['project']?.['name']+'.'+_0x2a934b['name'],'description':_0x2a934b['revision']?'revision:\x20'+_0x2a934b[_0x48b378(0x2d5)]:undefined})),_0x324a22=await a42_0x3f4844({'type':_0x48b378(0x324),'name':_0x48b378(0x201),'message':_0x48b378(0x2a9),'choices':_0x274f31});if(!_0x324a22[_0x48b378(0x201)])return 0x1;_0x20f1db=_0x324a22[_0x48b378(0x201)];}if(!_0x20f1db[_0x48b378(0x2b8)]('.')){const _0x3f3b61=this[_0x48b378(0x356)]([],_0x1feb36);if(_0x3f3b61)_0x20f1db=_0x3f3b61+'.'+_0x20f1db;else return console[_0x48b378(0x222)](a42_0x5853ac[_0x48b378(0x2cd)](_0x48b378(0x305)),_0x48b378(0x33f)),console[_0x48b378(0x222)](a42_0x5853ac['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x3c2e28=_0x1feb36['param'],_0x311512=_0x1feb36[_0x48b378(0x284)],_0x37df6f={};if(_0x3c2e28&&Array[_0x48b378(0x33a)](_0x3c2e28))for(const _0x4646b4 of _0x3c2e28){const _0x5bd16e=_0x4646b4[_0x48b378(0x229)]('=');if(_0x5bd16e===-0x1)return console[_0x48b378(0x222)](_0x48b378(0x2b0)+_0x4646b4),console[_0x48b378(0x222)](_0x48b378(0x346)),0x1;const _0xb4f170=_0x4646b4[_0x48b378(0x27f)](0x0,_0x5bd16e),_0x262533=_0x4646b4[_0x48b378(0x27f)](_0x5bd16e+0x1);try{_0x37df6f[_0xb4f170]=JSON['parse'](_0x262533);}catch{_0x37df6f[_0xb4f170]=_0x262533;}}_0x1feb36[_0x48b378(0x304)]&&(console[_0x48b378(0x222)](_0x48b378(0x21e)+_0x20f1db),Object['keys'](_0x37df6f)['length']>0x0&&console['error']('Parameters:\x20'+JSON['stringify'](_0x37df6f)),_0x311512&&console[_0x48b378(0x222)](_0x48b378(0x333)+_0x311512));const _0x1bcc49=await withSpinner('Starting\x20workflow\x20run...',()=>_0x292aea['workflow'][_0x48b378(0x31a)](_0x20f1db,_0x37df6f,{'sessionTime':_0x311512}),{'verbose':_0x1feb36[_0x48b378(0x304)]}),_0x1b7505=_0x1bcc49[_0x48b378(0x308)];console[_0x48b378(0x222)](_0x48b378(0x21f)),console[_0x48b378(0x222)](_0x48b378(0x1fa)+_0x1b7505['id']),console[_0x48b378(0x222)](_0x48b378(0x216)+_0x1b7505[_0x48b378(0x252)]),console['error']('\x20\x20Project:\x20'+_0x1b7505[_0x48b378(0x334)]?.[_0x48b378(0x380)]),console['error'](_0x48b378(0x302)+_0x1b7505['workflow']?.[_0x48b378(0x380)]);if(_0x1b7505[_0x48b378(0x334)]?.['id']&&_0x1b7505[_0x48b378(0x252)]&&_0x1b7505['id']){const _0xa4202e=_0x1feb36[_0x48b378(0x357)],_0x3abd66=getConsoleUrl(_0xa4202e,_0x48b378(0x2a2)+_0x1b7505[_0x48b378(0x334)]['id']+_0x48b378(0x20a)+_0x1b7505[_0x48b378(0x252)]+'/attempt/'+_0x1b7505['id']);console[_0x48b378(0x222)](_0x48b378(0x366)+a42_0x5853ac['cyan'](_0x3abd66));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a42_0x383d92(0x2e7);['description']='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a42_0x383d92(0x342)](_0x246efb){const _0x478078=a42_0x383d92,{options:_0x11a26a,args:_0x2a1d83,tdx:_0x1ae6b4}=_0x246efb,_0x419f29=_0x2a1d83[0x0],_0x2b8cec=_0x2a1d83[0x1]||'.';if(!_0x419f29)return console['error'](_0x478078(0x233)),console[_0x478078(0x222)](_0x478078(0x27a)),0x1;const _0x4b38c2=_0x11a26a[_0x478078(0x2d5)];_0x11a26a[_0x478078(0x304)]&&(console[_0x478078(0x222)](_0x478078(0x26d)+_0x419f29),console[_0x478078(0x222)]('Output\x20directory:\x20'+_0x2b8cec),_0x4b38c2&&console[_0x478078(0x222)](_0x478078(0x260)+_0x4b38c2));const _0x3973d2=await withSpinner(_0x478078(0x2a1)+_0x419f29+_0x478078(0x292),()=>_0x1ae6b4[_0x478078(0x201)][_0x478078(0x32e)](_0x419f29,_0x2b8cec,{'revision':_0x4b38c2}),{'verbose':_0x11a26a['verbose']}),_0x19c0a5=_0x3973d2['data'];return console[_0x478078(0x222)](_0x478078(0x2f7)+_0x19c0a5[_0x478078(0x379)]),console[_0x478078(0x222)]('\x20\x20Revision:\x20'+_0x19c0a5['revision']),console[_0x478078(0x222)](_0x478078(0x2c1)+_0x19c0a5[_0x478078(0x35b)]),console['error'](_0x478078(0x29a)+_0x2b8cec+'/'+_0x19c0a5[_0x478078(0x379)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a42_0x383d92(0x380)]=a42_0x383d92(0x294);[a42_0x383d92(0x206)]=a42_0x383d92(0x38c);async['execute'](_0x2ebbc7){const _0x435d57=a42_0x383d92,{options:_0x40076f,args:_0x221da,tdx:_0x2136d9}=_0x2ebbc7;let _0x2c9572='.',_0x27c13a=_0x40076f[_0x435d57(0x380)];if(_0x221da[0x0]){const {promises:_0x2fbf84}=await import('fs');try{const _0x2a27df=await _0x2fbf84[_0x435d57(0x2b2)](_0x221da[0x0]);if(_0x2a27df['isDirectory']())_0x2c9572=_0x221da[0x0];else return console[_0x435d57(0x222)](_0x435d57(0x37b)+_0x221da[0x0]+_0x435d57(0x295)),0x1;}catch{_0x27c13a=_0x221da[0x0],_0x2c9572='.';}}const _0x59a51c=_0x40076f[_0x435d57(0x2d5)],_0x56ce64=_0x40076f[_0x435d57(0x30f)];_0x40076f['verbose']&&(console['error']('Project\x20directory:\x20'+_0x2c9572),_0x27c13a&&console[_0x435d57(0x222)](_0x435d57(0x37c)+_0x27c13a),_0x59a51c&&console['error'](_0x435d57(0x260)+_0x59a51c),_0x56ce64&&console[_0x435d57(0x222)](_0x435d57(0x37e)));const _0x4bd298=await withSpinner(_0x435d57(0x35e),()=>_0x2136d9[_0x435d57(0x201)][_0x435d57(0x375)](_0x2c9572,{'projectName':_0x27c13a,'revision':_0x59a51c,'skipValidation':_0x56ce64}),{'verbose':_0x40076f['verbose']}),_0x4725b4=_0x4bd298[_0x435d57(0x308)];return console[_0x435d57(0x222)](_0x435d57(0x202)+_0x4725b4[_0x435d57(0x379)]),console[_0x435d57(0x222)](_0x435d57(0x26f)+_0x4725b4['projectId']),console[_0x435d57(0x222)](_0x435d57(0x2fc)+_0x4725b4[_0x435d57(0x2d5)]),await this[_0x435d57(0x388)](_0x2136d9,_0x4725b4[_0x435d57(0x379)],_0x40076f[_0x435d57(0x357)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a42_0x383d92(0x380)]=a42_0x383d92(0x367);['description']='Pull\x20workflow\x20project\x20to\x20local\x20folder';async[a42_0x383d92(0x342)](_0x4aeec9){const _0x390c64=a42_0x383d92,{options:_0x5a5703,args:_0x4af8ae,tdx:_0xa6f6f1}=_0x4aeec9,_0x1dffb5=_0x4af8ae[0x0],_0x248935=_0x4af8ae[0x1];if(!_0x1dffb5)return console['error'](a42_0x5853ac[_0x390c64(0x2cd)]('Error:'),_0x390c64(0x2f2)),console[_0x390c64(0x222)](a42_0x5853ac[_0x390c64(0x218)]('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x10ad93=_0x5a5703[_0x390c64(0x2d5)];_0x5a5703[_0x390c64(0x304)]&&(console['error']('Project:\x20'+_0x1dffb5),_0x248935&&console[_0x390c64(0x222)](_0x390c64(0x23c)+_0x248935),_0x10ad93&&console[_0x390c64(0x222)](_0x390c64(0x260)+_0x10ad93),_0x5a5703[_0x390c64(0x2cc)]&&console[_0x390c64(0x222)]('Dry\x20run:\x20yes'));const _0x4db27e=await withSpinner('Pulling\x20project\x20'+_0x1dffb5+_0x390c64(0x292),()=>_0xa6f6f1[_0x390c64(0x201)]['pullProject'](_0x1dffb5,{'targetDir':_0x248935,'revision':_0x10ad93}),{'verbose':_0x5a5703[_0x390c64(0x304)]}),_0x1cf02a=_0x4db27e[_0x390c64(0x308)];_0x1cf02a[_0x390c64(0x247)]?console[_0x390c64(0x222)]('→\x20New\x20project:\x20'+_0x1cf02a['projectName']):console[_0x390c64(0x222)](_0x390c64(0x34c)+_0x1cf02a[_0x390c64(0x379)]);console['error']('\x20\x20Revision:\x20'+_0x1cf02a[_0x390c64(0x2d5)]),console[_0x390c64(0x222)](_0x390c64(0x30b)+(a42_0x219276[_0x390c64(0x245)](process[_0x390c64(0x2db)](),_0x1cf02a[_0x390c64(0x2de)])||'.')),console[_0x390c64(0x222)](_0x390c64(0x1f9)+a42_0x5853ac[_0x390c64(0x1ee)]('+'+_0x1cf02a['summary']['new']+_0x390c64(0x378))+',\x20'+(a42_0x5853ac[_0x390c64(0x1ed)]('~'+_0x1cf02a['summary'][_0x390c64(0x207)]+_0x390c64(0x2d1))+',\x20')+(a42_0x5853ac[_0x390c64(0x2cd)]('-'+_0x1cf02a[_0x390c64(0x232)][_0x390c64(0x343)]+_0x390c64(0x36e))+',\x20')+(''+a42_0x5853ac[_0x390c64(0x218)](_0x1cf02a[_0x390c64(0x232)][_0x390c64(0x331)]+_0x390c64(0x22d))));for(const _0x3fc209 of _0x1cf02a[_0x390c64(0x2e3)]){_0x3fc209[_0x390c64(0x273)]===_0x390c64(0x207)&&_0x3fc209[_0x390c64(0x25a)]&&(console[_0x390c64(0x222)]('\x0a'+a42_0x5853ac['cyan'](_0x390c64(0x26e)+_0x3fc209[_0x390c64(0x225)])),console[_0x390c64(0x222)](_0x3fc209[_0x390c64(0x25a)]));}if(!_0x1cf02a[_0x390c64(0x336)])return saveSessionContext({'workflow_project':_0x1cf02a[_0x390c64(0x379)]},_0x5a5703[_0x390c64(0x249)]),console[_0x390c64(0x222)](a42_0x5853ac['green'](_0x390c64(0x2bc))),console[_0x390c64(0x222)](a42_0x5853ac[_0x390c64(0x218)](_0x390c64(0x369)+_0x1cf02a[_0x390c64(0x379)])),0x0;if(_0x5a5703[_0x390c64(0x2cc)])return console['error'](a42_0x5853ac[_0x390c64(0x1ed)](_0x390c64(0x2a8))),0x0;if(!_0x5a5703[_0x390c64(0x2a6)]){if(!isInteractive())return console['error'](a42_0x5853ac[_0x390c64(0x2cd)](_0x390c64(0x28e)),_0x390c64(0x25b)),console[_0x390c64(0x222)](a42_0x5853ac[_0x390c64(0x218)](_0x390c64(0x2dc))),0x1;const _0x368c54=await confirmKey(_0x390c64(0x353));if(!_0x368c54)return console['error'](a42_0x5853ac[_0x390c64(0x1ed)](_0x390c64(0x25f)),_0x390c64(0x382)),0x1;}await withSpinner(_0x390c64(0x306),()=>_0xa6f6f1[_0x390c64(0x201)][_0x390c64(0x221)](_0x1cf02a,{'revision':_0x10ad93}),{'verbose':_0x5a5703['verbose']}),saveSessionContext({'workflow_project':_0x1cf02a['projectName']},_0x5a5703['session']),console[_0x390c64(0x222)](a42_0x5853ac[_0x390c64(0x1ee)](_0x390c64(0x2dd)));const _0x38705b=a42_0x219276[_0x390c64(0x245)](process[_0x390c64(0x2db)](),_0x1cf02a[_0x390c64(0x2de)])||'.';return console['error'](a42_0x5853ac[_0x390c64(0x218)](_0x390c64(0x29a)+_0x38705b)),console[_0x390c64(0x222)](a42_0x5853ac[_0x390c64(0x218)](_0x390c64(0x369)+_0x1cf02a[_0x390c64(0x379)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a42_0x383d92(0x380)]='workflow:push';[a42_0x383d92(0x206)]=a42_0x383d92(0x271);async[a42_0x383d92(0x342)](_0x566f46){const _0x25db91=a42_0x383d92,{options:_0xde22bc,args:_0xddc78d,tdx:_0x5144fd}=_0x566f46,_0x42c6f6=this['resolveProjectDir'](_0xddc78d,_0xde22bc),_0x35ede3=_0xde22bc[_0x25db91(0x2d5)],_0x47b0f8=_0xde22bc['skipValidation'];_0xde22bc[_0x25db91(0x304)]&&(_0x42c6f6&&console[_0x25db91(0x222)](_0x25db91(0x2d2)+_0x42c6f6),_0x35ede3&&console[_0x25db91(0x222)](_0x25db91(0x260)+_0x35ede3),_0xde22bc[_0x25db91(0x2cc)]&&console[_0x25db91(0x222)]('Dry\x20run:\x20yes'),_0x47b0f8&&console[_0x25db91(0x222)](_0x25db91(0x37e)));let _0x189db9;try{_0x189db9=await withSpinner(_0x25db91(0x278),()=>_0x5144fd[_0x25db91(0x201)][_0x25db91(0x251)]({'sourceDir':_0x42c6f6,'revision':_0x35ede3,'skipValidation':_0x47b0f8}),{'verbose':_0xde22bc[_0x25db91(0x304)]});}catch(_0x30e4d9){if(_0x30e4d9 instanceof Error&&_0x30e4d9[_0x25db91(0x1eb)][_0x25db91(0x2b8)](_0x25db91(0x34b)))return console[_0x25db91(0x222)](a42_0x5853ac['red'](_0x25db91(0x305)),_0x25db91(0x224)),_0xde22bc[_0x25db91(0x2b7)]?console[_0x25db91(0x222)](a42_0x5853ac['dim'](_0x25db91(0x230)+_0xde22bc[_0x25db91(0x2b7)]+_0x25db91(0x318)+_0xde22bc[_0x25db91(0x2b7)]+'\x27')):console[_0x25db91(0x222)](a42_0x5853ac[_0x25db91(0x218)](_0x25db91(0x2f4))),0x1;throw _0x30e4d9;}const _0x2aa2dc=_0x189db9[_0x25db91(0x308)];console[_0x25db91(0x222)](_0x25db91(0x32c)+_0x2aa2dc[_0x25db91(0x379)]),console[_0x25db91(0x222)](_0x25db91(0x2ee)+_0x2aa2dc[_0x25db91(0x29c)]),console['error'](_0x25db91(0x2fc)+_0x2aa2dc[_0x25db91(0x2d5)]),console[_0x25db91(0x222)]('\x20\x20Changes:\x20'+a42_0x5853ac['green']('+'+_0x2aa2dc['summary'][_0x25db91(0x31f)]+'\x20new')+',\x20'+(a42_0x5853ac[_0x25db91(0x1ed)]('~'+_0x2aa2dc[_0x25db91(0x232)][_0x25db91(0x207)]+_0x25db91(0x2d1))+',\x20')+(a42_0x5853ac['red']('-'+_0x2aa2dc[_0x25db91(0x232)][_0x25db91(0x343)]+_0x25db91(0x36e))+',\x20')+(''+a42_0x5853ac[_0x25db91(0x218)](_0x2aa2dc[_0x25db91(0x232)]['unchanged']+_0x25db91(0x22d))));for(const _0x366aa4 of _0x2aa2dc[_0x25db91(0x2e3)]){_0x366aa4[_0x25db91(0x273)]===_0x25db91(0x207)&&_0x366aa4[_0x25db91(0x25a)]&&(console[_0x25db91(0x222)]('\x0a'+a42_0x5853ac['cyan'](_0x25db91(0x26e)+_0x366aa4['path'])),console[_0x25db91(0x222)](_0x366aa4[_0x25db91(0x25a)]));}if(!_0x2aa2dc['hasChanges'])return console[_0x25db91(0x222)](a42_0x5853ac['green'](_0x25db91(0x1f6))),await this['showWorkflowConsoleUrl'](_0x5144fd,_0x2aa2dc[_0x25db91(0x379)],_0xde22bc[_0x25db91(0x357)]),0x0;if(_0xde22bc[_0x25db91(0x2cc)])return console[_0x25db91(0x222)](a42_0x5853ac[_0x25db91(0x1ed)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0xde22bc[_0x25db91(0x2a6)]){if(!isInteractive())return console[_0x25db91(0x222)](a42_0x5853ac['red'](_0x25db91(0x28e)),_0x25db91(0x25b)),console['error'](a42_0x5853ac[_0x25db91(0x218)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x19983d=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x19983d)return console[_0x25db91(0x222)](a42_0x5853ac[_0x25db91(0x1ed)](_0x25db91(0x25f)),_0x25db91(0x2f6)),0x1;}const _0x47a6e8=await withSpinner(_0x25db91(0x2bd),()=>_0x5144fd[_0x25db91(0x201)]['executePushProject'](_0x2aa2dc),{'verbose':_0xde22bc[_0x25db91(0x304)]}),_0x45e3a5=_0x47a6e8[_0x25db91(0x308)];return console[_0x25db91(0x222)](a42_0x5853ac[_0x25db91(0x1ee)](_0x25db91(0x2e4))),console[_0x25db91(0x222)](_0x25db91(0x26f)+_0x45e3a5[_0x25db91(0x21d)]),console[_0x25db91(0x222)]('\x20\x20Revision:\x20'+_0x45e3a5['revision']),await this['showWorkflowConsoleUrl'](_0x5144fd,_0x45e3a5[_0x25db91(0x379)],_0xde22bc[_0x25db91(0x357)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a42_0x383d92(0x220);['description']='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a42_0x383d92(0x342)](_0x3ce5d5){const _0x3f1314=a42_0x383d92,{options:_0x9f28fa,args:_0x1a6d2b,tdx:_0x1bcb0c}=_0x3ce5d5,_0x57dbb2=this[_0x3f1314(0x263)](_0x1a6d2b,_0x9f28fa),_0x2c5cc1=_0x9f28fa[_0x3f1314(0x380)],_0x1f87ce=_0x9f28fa[_0x3f1314(0x2d5)],_0x25b76f=_0x9f28fa[_0x3f1314(0x30f)];if(!_0x57dbb2)return console[_0x3f1314(0x222)](a42_0x5853ac[_0x3f1314(0x2cd)](_0x3f1314(0x305)),_0x3f1314(0x1f7)),console['error'](a42_0x5853ac[_0x3f1314(0x218)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x3f1314(0x222)](a42_0x5853ac[_0x3f1314(0x218)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x2c5cc1)return console[_0x3f1314(0x222)](a42_0x5853ac[_0x3f1314(0x2cd)](_0x3f1314(0x305)),_0x3f1314(0x328)),console['error'](a42_0x5853ac[_0x3f1314(0x218)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x9f28fa[_0x3f1314(0x304)]&&(console[_0x3f1314(0x222)](_0x3f1314(0x2d2)+_0x57dbb2),console[_0x3f1314(0x222)](_0x3f1314(0x234)+_0x2c5cc1),_0x1f87ce&&console[_0x3f1314(0x222)](_0x3f1314(0x260)+_0x1f87ce),_0x9f28fa[_0x3f1314(0x2cc)]&&console['error'](_0x3f1314(0x24a)),_0x25b76f&&console[_0x3f1314(0x222)]('Validation:\x20skipped'));const _0x5cdba3=await withSpinner(_0x3f1314(0x2f8),()=>_0x1bcb0c['workflow'][_0x3f1314(0x37f)](_0x57dbb2,_0x2c5cc1,{'revision':_0x1f87ce,'skipValidation':_0x25b76f}),{'verbose':_0x9f28fa[_0x3f1314(0x304)]}),_0x36617b=_0x5cdba3['data'];console[_0x3f1314(0x222)]('Source:\x20'+_0x36617b[_0x3f1314(0x29c)]);_0x36617b['sourceProjectName']&&console['error'](_0x3f1314(0x29e)+_0x36617b['sourceProjectName']);console[_0x3f1314(0x222)](_0x3f1314(0x234)+_0x36617b['newProjectName']),console[_0x3f1314(0x222)]('Revision:\x20'+_0x36617b[_0x3f1314(0x2d5)]),console['error']('Files\x20to\x20upload:\x20'+_0x36617b[_0x3f1314(0x2ef)]);_0x36617b[_0x3f1314(0x2c6)]&&(console[_0x3f1314(0x222)](a42_0x5853ac[_0x3f1314(0x1ed)](_0x3f1314(0x1fd)+_0x36617b[_0x3f1314(0x27c)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x36617b[_0x3f1314(0x24f)]+')')),console['error'](a42_0x5853ac[_0x3f1314(0x1ed)](_0x3f1314(0x310))));if(_0x9f28fa[_0x3f1314(0x2cc)])return console[_0x3f1314(0x222)](a42_0x5853ac[_0x3f1314(0x1ed)](_0x3f1314(0x288))),0x0;if(!_0x9f28fa[_0x3f1314(0x2a6)]){if(!isInteractive())return console[_0x3f1314(0x222)](a42_0x5853ac[_0x3f1314(0x2cd)](_0x3f1314(0x28e)),_0x3f1314(0x25b)),console[_0x3f1314(0x222)](a42_0x5853ac['dim'](_0x3f1314(0x2dc))),0x1;const _0x6ea41c=_0x36617b[_0x3f1314(0x211)]||a42_0x219276[_0x3f1314(0x335)](_0x57dbb2),_0x992062=_0x36617b['targetExists']?_0x3f1314(0x315)+_0x2c5cc1+_0x3f1314(0x32d):_0x3f1314(0x35a)+_0x6ea41c+_0x3f1314(0x351)+_0x2c5cc1+'\x22?',_0x3f56b7=await confirmKey(_0x992062);if(!_0x3f56b7)return console['error'](a42_0x5853ac[_0x3f1314(0x1ed)]('Cancelled')),0x1;}const _0x442ac4=await withSpinner(_0x36617b['targetExists']?'Updating\x20'+_0x2c5cc1+_0x3f1314(0x292):'Cloning\x20to\x20'+_0x2c5cc1+_0x3f1314(0x292),()=>_0x1bcb0c[_0x3f1314(0x201)]['executeCloneProject'](_0x36617b),{'verbose':_0x9f28fa[_0x3f1314(0x304)]}),_0x5ee08d=_0x442ac4['data'];return console[_0x3f1314(0x222)](a42_0x5853ac['green'](_0x36617b[_0x3f1314(0x2c6)]?_0x3f1314(0x2c9):_0x3f1314(0x213))),console['error'](_0x3f1314(0x20e)+_0x5ee08d[_0x3f1314(0x27c)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x5ee08d[_0x3f1314(0x2ff)]),console[_0x3f1314(0x222)]('\x20\x20Revision:\x20'+_0x5ee08d['revision']),await this[_0x3f1314(0x388)](_0x1bcb0c,_0x5ee08d[_0x3f1314(0x27c)],_0x9f28fa[_0x3f1314(0x357)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a42_0x383d92(0x380)]=a42_0x383d92(0x1ff);[a42_0x383d92(0x206)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a42_0x383d92(0x342)](_0x2ec492){const _0x3375fa=a42_0x383d92,{options:_0x5f0847,args:_0x3dba96,tdx:_0x366e08}=_0x2ec492,_0x14feb7=_0x3dba96[0x0];if(!_0x14feb7)return console[_0x3375fa(0x222)](_0x3375fa(0x297)),console[_0x3375fa(0x222)](_0x3375fa(0x219)),0x1;_0x5f0847[_0x3375fa(0x304)]&&console[_0x3375fa(0x222)](_0x3375fa(0x26d)+_0x14feb7);if(!_0x5f0847[_0x3375fa(0x2a6)]){if(!isInteractive())return console['error'](a42_0x5853ac[_0x3375fa(0x2cd)](_0x3375fa(0x28e)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3375fa(0x222)](a42_0x5853ac[_0x3375fa(0x218)](_0x3375fa(0x2dc))),0x1;const _0x2f486f=await confirmKey(_0x3375fa(0x22e)+_0x14feb7+_0x3375fa(0x259));if(!_0x2f486f)return console[_0x3375fa(0x222)](a42_0x5853ac[_0x3375fa(0x1ed)]('Cancelled')),0x1;}const _0x524e94=await withSpinner(_0x3375fa(0x1f8)+_0x14feb7+_0x3375fa(0x292),()=>_0x366e08[_0x3375fa(0x201)][_0x3375fa(0x200)](_0x14feb7),{'verbose':_0x5f0847[_0x3375fa(0x304)]}),_0x498313=_0x524e94[_0x3375fa(0x308)];return console[_0x3375fa(0x222)]('✔\x20Deleted\x20project\x20'+_0x498313['projectName']),console[_0x3375fa(0x222)](_0x3375fa(0x26f)+_0x498313['projectId']),0x0;}}export function parseKeyValue(_0x59fa57){const _0x44eaea=a42_0x383d92,_0x62f5fc=_0x59fa57[_0x44eaea(0x229)]('=');if(_0x62f5fc===-0x1)throw new Error(_0x44eaea(0x287)+_0x59fa57+_0x44eaea(0x256));const _0x37cf62=_0x59fa57[_0x44eaea(0x27f)](0x0,_0x62f5fc),_0x12301a=_0x59fa57[_0x44eaea(0x27f)](_0x62f5fc+0x1);if(!_0x37cf62)throw new Error(_0x44eaea(0x34f));return{'key':_0x37cf62,'value':_0x12301a};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a42_0x383d92(0x380)]=a42_0x383d92(0x283);['description']=a42_0x383d92(0x32b);async[a42_0x383d92(0x342)](_0x23531e){const _0x1e8bfb=a42_0x383d92,{options:_0x333fb0,args:_0x5258ea,tdx:_0x107675}=_0x23531e,_0x2cda42=this[_0x1e8bfb(0x2b9)](_0x5258ea,_0x333fb0);if(!_0x2cda42)return 0x1;_0x333fb0['verbose']&&console[_0x1e8bfb(0x222)]('Project:\x20'+_0x2cda42);const _0x1f5480=await withSpinner(_0x1e8bfb(0x2af),()=>_0x107675[_0x1e8bfb(0x201)][_0x1e8bfb(0x291)](_0x2cda42),{'verbose':_0x333fb0['verbose']}),{secrets:_0x9902d1}=_0x1f5480[_0x1e8bfb(0x308)];return console[_0x1e8bfb(0x222)](_0x1e8bfb(0x23d)+_0x9902d1[_0x1e8bfb(0x2a3)]+_0x1e8bfb(0x320)+(_0x9902d1[_0x1e8bfb(0x2a3)]!==0x1?'s':'')),await handleSDKOutput(_0x9902d1,_0x333fb0),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a42_0x383d92(0x380)]='workflow:secrets:set';['description']='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async[a42_0x383d92(0x342)](_0x11ed5a){const _0x4bdb13=a42_0x383d92,{options:_0x53dbe9,args:_0x1183d2,tdx:_0x2fe93d}=_0x11ed5a;let _0x36ea9d,_0xa77703;if(_0x1183d2['length']>=0x2)_0x36ea9d=_0x1183d2[0x0],_0xa77703=_0x1183d2[0x1];else{if(_0x1183d2[_0x4bdb13(0x2a3)]===0x1&&_0x53dbe9['workflowProject'])_0x36ea9d=_0x53dbe9[_0x4bdb13(0x2b7)],_0xa77703=_0x1183d2[0x0];else return _0x1183d2[_0x4bdb13(0x2a3)]===0x1?(console['error'](_0x4bdb13(0x233)),console[_0x4bdb13(0x222)](_0x4bdb13(0x20f)),0x1):(console['error'](_0x4bdb13(0x2ab)),console[_0x4bdb13(0x222)](_0x4bdb13(0x22a)),0x1);}let _0x384554,_0x2646df;try{({key:_0x384554,value:_0x2646df}=parseKeyValue(_0xa77703));}catch(_0x18b71d){return _0x18b71d instanceof Error&&console[_0x4bdb13(0x222)](a42_0x5853ac[_0x4bdb13(0x2cd)](_0x4bdb13(0x305)),_0x18b71d[_0x4bdb13(0x1eb)]),0x1;}_0x53dbe9[_0x4bdb13(0x304)]&&(console['error']('Project:\x20'+_0x36ea9d),console[_0x4bdb13(0x222)]('Key:\x20'+_0x384554));const _0x4ad134=await withSpinner(_0x4bdb13(0x311),()=>_0x2fe93d[_0x4bdb13(0x201)][_0x4bdb13(0x2ed)](_0x36ea9d,_0x384554,_0x2646df),{'verbose':_0x53dbe9['verbose']}),_0x221893=_0x4ad134['data'];return console[_0x4bdb13(0x222)](_0x4bdb13(0x20d)+_0x221893[_0x4bdb13(0x2ac)]+_0x4bdb13(0x370)+_0x221893[_0x4bdb13(0x379)]+'\x27'),(_0x53dbe9[_0x4bdb13(0x237)]||_0x53dbe9[_0x4bdb13(0x339)])&&await handleSingleObjectOutput(_0x221893,_0x53dbe9),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a42_0x383d92(0x380)]='workflow:secrets:delete';[a42_0x383d92(0x206)]=a42_0x383d92(0x307);async['execute'](_0x3188ff){const _0x4a9292=a42_0x383d92,{options:_0x14e510,args:_0x1731b0,tdx:_0x2a1ba9}=_0x3188ff;let _0x3eca6b,_0x62346a;if(_0x1731b0[_0x4a9292(0x2a3)]>=0x2)_0x3eca6b=_0x1731b0[0x0],_0x62346a=_0x1731b0[0x1];else{if(_0x1731b0['length']===0x1&&_0x14e510['workflowProject'])_0x3eca6b=_0x14e510['workflowProject'],_0x62346a=_0x1731b0[0x0];else return _0x1731b0[_0x4a9292(0x2a3)]===0x1?(console[_0x4a9292(0x222)](_0x4a9292(0x233)),console[_0x4a9292(0x222)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x4a9292(0x222)](_0x4a9292(0x296)),console[_0x4a9292(0x222)]('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x14e510['verbose']&&(console[_0x4a9292(0x222)](_0x4a9292(0x26d)+_0x3eca6b),console[_0x4a9292(0x222)](_0x4a9292(0x1f3)+_0x62346a));if(!_0x14e510[_0x4a9292(0x2a6)]){if(!isInteractive())return console['error'](a42_0x5853ac[_0x4a9292(0x2cd)]('\x0aError:'),_0x4a9292(0x25b)),console[_0x4a9292(0x222)](a42_0x5853ac[_0x4a9292(0x218)](_0x4a9292(0x2dc))),0x1;const _0x44e6f2=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x62346a+_0x4a9292(0x2c0)+_0x3eca6b+'\x27?');if(!_0x44e6f2)return console[_0x4a9292(0x222)](a42_0x5853ac[_0x4a9292(0x1ed)](_0x4a9292(0x25f))),0x1;}const _0x130b08=await withSpinner('Deleting\x20secret...',()=>_0x2a1ba9[_0x4a9292(0x201)][_0x4a9292(0x23f)](_0x3eca6b,_0x62346a),{'verbose':_0x14e510[_0x4a9292(0x304)]}),_0x5bddd0=_0x130b08[_0x4a9292(0x308)];return console[_0x4a9292(0x222)](_0x4a9292(0x20d)+_0x5bddd0['key']+_0x4a9292(0x253)+_0x5bddd0[_0x4a9292(0x379)]+'\x27'),(_0x14e510[_0x4a9292(0x237)]||_0x14e510[_0x4a9292(0x339)])&&await handleSingleObjectOutput(_0x5bddd0,_0x14e510),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(_0x2b3999){const _0x510317=a42_0x383d92,_0x24ab71=Math[_0x510317(0x241)](_0x2b3999/0x3e8),_0x21dd47=Math[_0x510317(0x241)](_0x24ab71/0x3c),_0x4ab3c8=Math['floor'](_0x21dd47/0x3c),_0x220030=Math['floor'](_0x4ab3c8/0x18);if(_0x220030>0x0){const _0x499b82=_0x4ab3c8%0x18;return _0x499b82>0x0?_0x220030+'d\x20'+_0x499b82+'h':_0x220030+'d';}else{if(_0x4ab3c8>0x0){const _0x2e6a34=_0x21dd47%0x3c;return _0x2e6a34>0x0?_0x4ab3c8+'h\x20'+_0x2e6a34+'m':_0x4ab3c8+'h';}else{if(_0x21dd47>0x0){const _0x39b19d=_0x24ab71%0x3c;return _0x39b19d>0x0?_0x21dd47+'m\x20'+_0x39b19d+'s':_0x21dd47+'m';}else return _0x24ab71+'s';}}}function formatTimestamp(_0x3089b7,_0x4e766b){const _0x8d567d=a42_0x383d92,_0x2b0f17=new Date(_0x3089b7),_0x4fb4a9=String(_0x2b0f17[_0x8d567d(0x36f)]())[_0x8d567d(0x32f)](0x2,'0'),_0x1eb4c5=String(_0x2b0f17['getMinutes']())[_0x8d567d(0x32f)](0x2,'0'),_0x5da0d5=_0x4fb4a9+':'+_0x1eb4c5,_0x514f60=_0x2b0f17[_0x8d567d(0x360)]()===_0x4e766b[_0x8d567d(0x360)]()&&_0x2b0f17[_0x8d567d(0x28d)]()===_0x4e766b[_0x8d567d(0x28d)]()&&_0x2b0f17[_0x8d567d(0x1fe)]()===_0x4e766b[_0x8d567d(0x1fe)]();if(_0x514f60)return _0x5da0d5;else{const _0x2da0cf=String(_0x2b0f17[_0x8d567d(0x28d)]()+0x1)['padStart'](0x2,'0'),_0x425c77=String(_0x2b0f17[_0x8d567d(0x1fe)]())[_0x8d567d(0x32f)](0x2,'0');return _0x2da0cf+'-'+_0x425c77+'\x20'+_0x5da0d5;}}function formatDate(_0x4cbd46){const _0x3397fc=a42_0x383d92,_0x44d466=_0x4cbd46[_0x3397fc(0x360)](),_0x2fdf54=String(_0x4cbd46[_0x3397fc(0x28d)]()+0x1)[_0x3397fc(0x32f)](0x2,'0'),_0x513725=String(_0x4cbd46['getDate']())[_0x3397fc(0x32f)](0x2,'0');return _0x44d466+'-'+_0x2fdf54+'-'+_0x513725;}function getTaskStateIcon(_0x21b9e6){const _0x4b3d47={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x4b3d47[_0x21b9e6]||'⚪';}function getBarChar(_0x14930b){const _0x56061e=a42_0x383d92;return _0x14930b===_0x56061e(0x222)||_0x14930b===_0x56061e(0x2a7)?'×':'─';}function a42_0x8dc8(){const _0x4fbdb1=['\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','Setting\x20secret...','getTime','Total:\x20','get','\x0aUpdate\x20existing\x20project\x20\x22','Select\x20a\x20task\x20to\x20view\x20logs:','\x20(system)','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','workflow:run','run','sessions','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','attempt:','63HIsShd','new','\x20secret','GUTTER','follow','task','select','taskName','\x20(use\x20--limit\x20to\x20show\x20more)','status','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','Start\x20a\x20workflow\x20run','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','✔\x20Project:\x20','\x22\x20with\x20new\x20revision?','download','padStart','context','unchanged','attempts','Session\x20time:\x20','project','basename','hasChanges','Retrying\x20attempt...','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','jsonl','isArray','trimEnd','3021636pxeeHM','canceling','MAX_TASKS_DISPLAY','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','localeCompare','execute','deleted','now','No\x20workflows\x20found\x20in\x20project:\x20','Expected\x20format:\x20--param\x20key=value','attempt','\x0a✔\x20Attempt\x20complete','metadata','parseProjectWorkflowPattern','No\x20workflow\x20tdx.json\x20found','→\x20Project:\x20','\x20from\x20session\x20','LABEL_WIDTH_DIVISOR','Key\x20cannot\x20be\x20empty','Session\x20','\x22\x20to\x20new\x20project\x20\x22','title','\x0aApply\x20these\x20changes?','POLL_INTERVAL_MS','Auto-selected\x20latest\x20session:\x20','resolveProject','site','reason','Attempt:\x20','\x0aClone\x20\x22','filesExtracted','Listing\x20workflow\x20attempts...','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Pushing\x20workflow\x20project...','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','getFullYear','planned','repeat','workflowName','force','Loading\x20workflows...','\x20\x20Console:\x20','workflow:pull','No\x20attempts\x20found','\x20\x20Session\x20context\x20set\x20to:\x20','attemptId','No\x20sessions\x20found','rows','kill','\x20deleted','getHours','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','ICON_WIDTH','No\x20workflows\x20found','workflow:attempts','workflow:use','push','Filter:\x20','\x20-\x20','\x20new','projectName','join','Error:\x20','Project\x20name:\x20','renderTimeline','Validation:\x20skipped','prepareCloneProject','name','values','-\x20no\x20files\x20written','duration','Including\x20subtasks:\x20yes','finishedAt','Listing\x20workflow\x20projects...','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','showWorkflowConsoleUrl','No\x20sessions\x20found\x20for:\x20','\x27...','Retry\x20a\x20session\x20or\x20attempt','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','message','Select\x20a\x20session\x20to\x20view\x20timeline:','yellow','green','221611PCErBO','displayLine','createdAt','🔄\x20','Key:\x20','resolve','projects','\x0a✔\x20No\x20changes\x20to\x20push','Source\x20directory\x20is\x20required','Deleting\x20project\x20','\x20\x20Changes:\x20','\x20\x20Attempt\x20ID:\x20','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','pollTimeline','\x0a⚠\x20Project\x20\x22','getDate','workflow:delete','delete','workflow','✔\x20Pushed\x20','fill','workflows','match','description','modified','end','workflow:kill','/sessions/','Downloading\x20logs...','filter','✔\x20Secret\x20\x27','\x20\x20Project:\x20','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','✔\x20Showing\x20','sourceProjectName','workflow:workflows','✔\x20Clone\x20complete','cyan','No\x20log\x20content\x20found','\x20\x20Session\x20ID:\x20','splice','dim','Usage:\x20workflow:delete\x20<project-name-or-id>','Task\x20name:\x20','No\x20projects\x20match\x20pattern:\x20','Kill\x20a\x20running\x20attempt','projectId','Workflow:\x20','✔\x20Workflow\x20run\x20started','workflow:clone','applyPullProject','error','navigateSessionsInteractive','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','path','✔\x20Retry\x20started','white','toLowerCase','indexOf','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','renderSessionsTimeline','No\x20attempts\x20found\x20in\x20project:\x20','\x20unchanged','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Fetching\x20log\x20files...','Tip:\x20cd\x20to\x20workflows/','Filter:\x20project=','summary','Error:\x20Project\x20name\x20is\x20required','New\x20project\x20name:\x20','fullName','parse','json','Force:\x20yes','stdout','columns','From\x20task:\x20','Target\x20directory:\x20','✔\x20Found\x20','1724135RcOvHP','deleteSecret','Error:\x20Attempt\x20ID\x20is\x20required','floor','startsWith','replace','set','relative','📁\x20','isNewProject','running','session','Dry\x20run:\x20yes','toISOString','start','msPerChar','includeRetried','existingProjectId','Resume\x20from:\x20','preparePushProject','sessionId','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','retryAttempt','No\x20matching\x20sessions\x20found','.\x20Expected\x20format:\x20KEY=VALUE','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','readFile','\x22?\x20This\x20cannot\x20be\x20undone.','diff','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','✔\x20Workflow\x20project\x20set\x20to:\x20','\x20has\x20no\x20attempts','Warning:','Cancelled','Revision:\x20','627656VRYmdZ','tdx\x20wf\x20attempt\x20','resolveProjectDir','📋\x20','List\x20workflows','Loading\x20sessions...','has','Show\x20tasks\x20for\x20an\x20attempt','window','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','workflow:retry','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Project:\x20','---\x20','\x20\x20Project\x20ID:\x20','workflow:attempt','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Killing\x20attempt...','type','durationMs','workflow:tasks','\x0aPolling...\x20(','params','Analyzing\x20changes...','output','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','💡\x20Tip:\x20Use\x20','newProjectName','3122464XizRCe','\x20logs','substring','list','includeSubtasks','sort','workflow:secrets:list','sessionTime','MIN_TIMELINE_WIDTH','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Invalid\x20format:\x20','\x0aDry\x20run\x20-\x20no\x20project\x20created','blue','isTTY','Retrying\x20session...','session:','getMonth','\x0aError:','renderSingleTimeline','ICON_SPACING','listSecrets','...','LABEL_MIN_SPACING','workflow:upload','\x20is\x20not\x20a\x20directory','Error:\x20Secret\x20key\x20is\x20required','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','retryAttemptName','Project\x20filter:\x20','\x20\x20Location:\x20','startedAt','sourceDir','generateSessionTimelineRows','Source\x20project:\x20','Latest\x20session\x20has\x20no\x20attempt','logFiles','Downloading\x20project\x20','/app/workflows/','length','Target:\x20','index','yes','group_error','\x0aDry\x20run\x20-\x20no\x20files\x20written','Select\x20a\x20workflow\x20to\x20run','round','Error:\x20KEY=VALUE\x20is\x20required','key','\x20of\x20','some','Listing\x20secrets...','Error:\x20Invalid\x20parameter\x20format:\x20','Resolving\x20project\x20\x27','stat','workflow:sessions','updatedAt','MIN_LABEL_COUNT','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','workflowProject','includes','requireProject','slice','Getting\x20attempt\x20details...','\x0a✔\x20Already\x20up\x20to\x20date','Pushing\x20project...','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','log','\x27\x20from\x20project\x20\x27','\x20\x20Files\x20extracted:\x20','state','No\x20log\x20files\x20found\x20for\x20this\x20attempt','lastAttempt','find','targetExists','Attempt\x20ID:\x20','MAX_LABEL_COUNT','✔\x20Project\x20updated','No\x20workflow\x20projects\x20found','table','dryRun','red','done','min','success','\x20modified','Source\x20directory:\x20','List\x20all\x20workflow\x20projects','limit','revision','List\x20workflow\x20attempts','No\x20attempts\x20found\x20for:\x20','pending','(unknown)','\x20workflow','cwd','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','✔\x20Pull\x20complete','targetDir','tasks','TASK_NAME_WIDTH','clear','10188360hgbCQq','changes','✔\x20Push\x20complete','all','Status:\x20','workflow:download','Using\x20attempt\x20','buildTimelineData','fs/promises','fileSize','305870xgIaSr','setSecret','\x20\x20Source:\x20','fileCount','unknown','map','Project\x20name\x20is\x20required','utf-8','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','startTime','-\x20nothing\x20pushed','✔\x20Downloaded\x20','Analyzing\x20project...','max','15ycRYtX','tdx.json','\x20\x20Revision:\x20','Reason:\x20','Loading\x20session...','newProjectId','format','icon','\x20\x20Workflow:\x20','Pattern:\x20','verbose','Error:','Writing\x20files...','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','data','trim',',\x20Workflow:\x20','\x20\x20Target:\x20','\x20tasks','cancelRequested','write','skipValidation'];a42_0x8dc8=function(){return _0x4fbdb1;};return a42_0x8dc8();}function getBarColor(_0x2425d0){const _0x465804=a42_0x383d92,_0x2c9e70={'success':a42_0x5853ac[_0x465804(0x1ee)],'error':a42_0x5853ac[_0x465804(0x2cd)],'group_error':a42_0x5853ac['red'],'running':a42_0x5853ac['blue'],'blocked':a42_0x5853ac['yellow'],'planned':a42_0x5853ac[_0x465804(0x218)],'canceling':a42_0x5853ac['yellow']};return _0x2c9e70[_0x2425d0]||a42_0x5853ac[_0x465804(0x227)];}function parseTaskName(_0xdfa3ab){const _0x4368f9=a42_0x383d92;let _0x4b012e=_0xdfa3ab[_0x4368f9(0x243)](/^\++/,'');const _0x20b2cd=_0x4b012e['split']('+'),_0x1d4c4b=_0x20b2cd[_0x4368f9(0x2a3)]>0x1?_0x20b2cd['length']-0x2:0x0,_0x560d1b=_0x20b2cd[_0x20b2cd['length']-0x1]||_0x4b012e;return{'level':_0x1d4c4b,'name':'+'+_0x560d1b};}function truncateTaskName(_0x54a93a,_0x358b05){const _0x34c5ca=a42_0x383d92,_0x87bc75=stringWidth(_0x54a93a);if(_0x87bc75<=_0x358b05)return _0x54a93a;let _0x143f26=_0x54a93a;while(stringWidth(_0x143f26+'…')>_0x358b05&&_0x143f26[_0x34c5ca(0x2a3)]>0x0){_0x143f26=_0x143f26[_0x34c5ca(0x2ba)](0x0,-0x1);}return _0x143f26+'…';}function calculateTimeScale(_0x27c427,_0x579fe5){const _0x34241a=a42_0x383d92;return{'startTime':_0x27c427[_0x34241a(0x24c)],'endTime':_0x27c427[_0x34241a(0x208)],'durationMs':_0x27c427[_0x34241a(0x383)],'msPerChar':_0x27c427[_0x34241a(0x383)]/_0x579fe5};}function timeToPosition(_0x577878,_0x3a2e17,_0x5652a5){const _0x114de6=a42_0x383d92,_0x1004cd=_0x577878-_0x3a2e17[_0x114de6(0x2f5)],_0x1fe505=Math[_0x114de6(0x241)](_0x1004cd/_0x3a2e17[_0x114de6(0x24d)]);return Math[_0x114de6(0x2f9)](0x0,Math[_0x114de6(0x2cf)](_0x1fe505,_0x5652a5));}function a42_0x34a3(_0x3abe3e,_0x5040ac){_0x3abe3e=_0x3abe3e-0x1eb;const _0x8dc82b=a42_0x8dc8();let _0x34a3b6=_0x8dc82b[_0x3abe3e];return _0x34a3b6;}function renderTimeAxis(_0x10ecb1,_0x326db7){const _0x34054a=a42_0x383d92,_0x30684e=Math[_0x34054a(0x2cf)](TIMELINE_CONFIG[_0x34054a(0x2c8)],Math[_0x34054a(0x2f9)](TIMELINE_CONFIG[_0x34054a(0x2b5)],Math[_0x34054a(0x241)](_0x326db7/TIMELINE_CONFIG[_0x34054a(0x34e)]))),_0x23ca15=_0x10ecb1[_0x34054a(0x274)]/(_0x30684e-0x1),_0x2a59d8=new Date(_0x10ecb1[_0x34054a(0x2f5)]),_0x2fab42=[];for(let _0x22e22e=0x0;_0x22e22e<_0x30684e;_0x22e22e++){const _0x4bb8a7=_0x10ecb1[_0x34054a(0x2f5)]+_0x22e22e*_0x23ca15,_0x311391=timeToPosition(_0x4bb8a7,_0x10ecb1,_0x326db7),_0x511e4c=formatTimestamp(_0x4bb8a7,_0x2a59d8);_0x2fab42['push']({'pos':_0x311391,'text':_0x511e4c});}const _0x2806b2=new Array(_0x326db7)[_0x34054a(0x203)]('\x20');let _0x1d76eb=-0x1;for(const {pos:_0x1aad06,text:_0x9146f0}of _0x2fab42){let _0x1fd09b=Math[_0x34054a(0x2f9)](0x0,_0x1aad06-Math[_0x34054a(0x241)](_0x9146f0[_0x34054a(0x2a3)]/0x2));_0x1fd09b<=_0x1d76eb+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x1fd09b=_0x1d76eb+TIMELINE_CONFIG[_0x34054a(0x293)]+0x1);_0x1fd09b+_0x9146f0['length']>_0x326db7&&(_0x1fd09b=_0x326db7-_0x9146f0[_0x34054a(0x2a3)]);if(_0x1fd09b>=0x0&&_0x1fd09b+_0x9146f0['length']<=_0x326db7&&_0x1fd09b>_0x1d76eb){for(let _0x235ec9=0x0;_0x235ec9<_0x9146f0[_0x34054a(0x2a3)];_0x235ec9++){_0x2806b2[_0x1fd09b+_0x235ec9]=_0x9146f0[_0x235ec9];}_0x1d76eb=_0x1fd09b+_0x9146f0[_0x34054a(0x2a3)]-0x1;}}return _0x2806b2[_0x34054a(0x37a)]('');}function renderTaskRow(_0x32d71f,_0x17cdbd,_0x5a6d58,_0x18e1f4){const _0x5535ab=a42_0x383d92,{level:_0x5b4e3b,name:_0xe2323b}=parseTaskName(_0x32d71f[_0x5535ab(0x380)]),_0x5e2666='\x20'['repeat'](_0x5b4e3b),_0x288f69=_0x32d71f[_0x5535ab(0x269)]?'('+formatElapsed(_0x32d71f[_0x5535ab(0x269)][_0x5535ab(0x383)])+')':'',_0x7c680d=stringWidth(_0x288f69),_0x4f2907=_0x5b4e3b*0x1,_0x4e910a=_0x18e1f4-_0x4f2907-_0x7c680d-0x1,_0x1a5fee=truncateTaskName(_0xe2323b,_0x4e910a),_0xfc114b=_0x5e2666+_0x1a5fee,_0x1898ca=stringWidth(_0xfc114b),_0xbc1253=_0x18e1f4-_0x1898ca-_0x7c680d,_0xa03c9=_0xfc114b+'\x20'[_0x5535ab(0x362)](Math['max'](0x1,_0xbc1253))+a42_0x5853ac[_0x5535ab(0x218)](_0x288f69),_0x1fb524=getTaskStateIcon(_0x32d71f['state']),_0x1a77c3=new Array(_0x5a6d58)[_0x5535ab(0x203)]('\x20');if(_0x32d71f[_0x5535ab(0x269)]){const _0x4ea77d=timeToPosition(_0x32d71f['window'][_0x5535ab(0x24c)],_0x17cdbd,_0x5a6d58),_0x2d990b=timeToPosition(_0x32d71f[_0x5535ab(0x269)][_0x5535ab(0x208)],_0x17cdbd,_0x5a6d58),_0x4d21ea=getBarChar(_0x32d71f[_0x5535ab(0x2c2)]),_0x4f861c=Math[_0x5535ab(0x2f9)](_0x4ea77d+0x1,_0x2d990b);for(let _0x433cd8=_0x4ea77d;_0x433cd8<Math[_0x5535ab(0x2cf)](_0x4f861c,_0x5a6d58);_0x433cd8++){_0x1a77c3[_0x433cd8]=_0x4d21ea;}}const _0x577cf1=getBarColor(_0x32d71f[_0x5535ab(0x2c2)]),_0x530a25=_0x1a77c3[_0x5535ab(0x2f1)](_0x3e4860=>_0x3e4860==='\x20'?'\x20':_0x577cf1(_0x3e4860))[_0x5535ab(0x37a)]('');return _0x1fb524+'\x20'+_0xa03c9+'│'+_0x530a25+'│';}function calculateStats(_0x41738b){const _0x4ff612=a42_0x383d92,_0x417114={'total':_0x41738b[_0x4ff612(0x2a3)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x37e9ea of _0x41738b){if(_0x37e9ea[_0x4ff612(0x2c2)]==='success')_0x417114[_0x4ff612(0x2d0)]++;else{if(_0x37e9ea[_0x4ff612(0x2c2)]===_0x4ff612(0x222)||_0x37e9ea[_0x4ff612(0x2c2)]===_0x4ff612(0x2a7))_0x417114[_0x4ff612(0x222)]++;else _0x37e9ea['state']===_0x4ff612(0x248)?_0x417114[_0x4ff612(0x248)]++:_0x417114[_0x4ff612(0x2d8)]++;}}return _0x417114;}function formatStats(_0x4f1224){const _0x59fce5=a42_0x383d92;return[_0x59fce5(0x313)+_0x4f1224['total'],'✅\x20'+_0x4f1224[_0x59fce5(0x2d0)],'❌\x20'+_0x4f1224[_0x59fce5(0x222)],_0x59fce5(0x1f2)+_0x4f1224[_0x59fce5(0x248)],'⏳\x20'+_0x4f1224['pending']][_0x59fce5(0x37a)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']='workflow:timeline';[a42_0x383d92(0x206)]=a42_0x383d92(0x257);async[a42_0x383d92(0x342)](_0x4cd89e){const _0xfb5fad=a42_0x383d92,{options:_0x44f919,args:_0x480e9f,tdx:_0x21badf}=_0x4cd89e;let _0x40b20b,_0x582127,_0x2b783e=![];if(_0x480e9f[0x0]){if(_0x480e9f[0x0][_0xfb5fad(0x2b8)]('.')){const _0x539160=this[_0xfb5fad(0x34a)](_0x480e9f,_0x44f919);if(!_0x539160)return 0x1;_0x40b20b=_0x539160[_0xfb5fad(0x379)],_0x582127=_0x539160[_0xfb5fad(0x363)];}else{_0x582127=_0x480e9f[0x0],_0x40b20b=_0x44f919[_0xfb5fad(0x2b7)];if(!_0x40b20b)return console['error'](a42_0x5853ac['red'](_0xfb5fad(0x305)),_0xfb5fad(0x387)),0x1;_0x2b783e=!![];}}else{const _0x5c9ad4=this[_0xfb5fad(0x34a)](_0x480e9f,_0x44f919);if(!_0x5c9ad4)return 0x1;_0x40b20b=_0x5c9ad4[_0xfb5fad(0x379)],_0x582127=_0x5c9ad4[_0xfb5fad(0x363)];}if(_0x44f919[_0xfb5fad(0x304)]){if(_0x40b20b&&_0x582127)console['error'](_0xfb5fad(0x376)+_0x40b20b+'.'+_0x582127);else _0x40b20b&&console[_0xfb5fad(0x222)]('Filter:\x20project='+_0x40b20b);}const _0x4131cb=_0x44f919['attemptId'],_0x4120b8=_0x44f919['sessionId'];if(_0x4131cb){_0x4120b8&&console[_0xfb5fad(0x222)](a42_0x5853ac['yellow'](_0xfb5fad(0x25e)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x4e07ea=_0x44f919[_0xfb5fad(0x322)];return _0x4e07ea?await this['pollTimeline'](_0x4cd89e,_0x4131cb):await this[_0xfb5fad(0x28f)](_0x4cd89e,_0x4131cb,_0x44f919),0x0;}if(_0x4120b8){const _0x45ecde=await withSpinner(_0xfb5fad(0x2fe),()=>_0x21badf['workflow'][_0xfb5fad(0x31b)]({'projectName':_0x40b20b,'workflowName':_0x582127,'limit':0x64}),{'verbose':_0x44f919[_0xfb5fad(0x304)]}),_0x9f0a4=_0x45ecde[_0xfb5fad(0x308)][_0xfb5fad(0x2c5)](_0x241dc7=>_0x241dc7['id']===_0x4120b8);if(!_0x9f0a4)return console[_0xfb5fad(0x222)](a42_0x5853ac[_0xfb5fad(0x2cd)]('Error:'),'Session\x20not\x20found:\x20'+_0x4120b8),0x1;if(!_0x9f0a4[_0xfb5fad(0x2c4)]?.['id'])return console[_0xfb5fad(0x222)](a42_0x5853ac[_0xfb5fad(0x2cd)](_0xfb5fad(0x305)),_0xfb5fad(0x350)+_0x4120b8+_0xfb5fad(0x25d)),0x1;const _0x30858c=_0x9f0a4['lastAttempt']['id'];_0x44f919[_0xfb5fad(0x304)]&&console[_0xfb5fad(0x222)](_0xfb5fad(0x2e8)+_0x30858c+_0xfb5fad(0x34d)+_0x4120b8);const _0x4c8cde=_0x44f919['follow'];return _0x4c8cde?await this[_0xfb5fad(0x1fc)](_0x4cd89e,_0x30858c):await this[_0xfb5fad(0x28f)](_0x4cd89e,_0x30858c,_0x44f919),0x0;}const _0x1c0c20=await withSpinner(_0xfb5fad(0x266),()=>_0x21badf[_0xfb5fad(0x201)][_0xfb5fad(0x31b)]({'projectName':_0x40b20b,'workflowName':_0x582127,'limit':_0x44f919['limit']||0x32}),{'verbose':_0x44f919[_0xfb5fad(0x304)]}),_0x24d9e3=_0x1c0c20['data'];if(_0x24d9e3[_0xfb5fad(0x2a3)]===0x0){if(_0x40b20b&&_0x582127)console['error']('No\x20sessions\x20found\x20for:\x20'+_0x40b20b+'.'+_0x582127);else _0x40b20b?console[_0xfb5fad(0x222)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x40b20b):(console['error']('No\x20workflow\x20sessions\x20found'),console[_0xfb5fad(0x222)](a42_0x5853ac[_0xfb5fad(0x218)](_0xfb5fad(0x26a))));return 0x0;}_0x24d9e3[_0xfb5fad(0x282)]((_0x195c50,_0x20ead3)=>{const _0x17d189=_0xfb5fad,_0x232e11=_0x195c50[_0x17d189(0x284)]||'',_0x145073=_0x20ead3[_0x17d189(0x284)]||'';return _0x145073[_0x17d189(0x341)](_0x232e11);});if(_0x44f919['json']||_0x44f919[_0xfb5fad(0x339)])return await handleSDKOutput(_0x24d9e3,_0x44f919),0x0;let _0x504c73;if(_0x2b783e){const _0x5b400c=_0x24d9e3[0x0];if(!_0x5b400c[_0xfb5fad(0x2c4)]?.['id'])return console[_0xfb5fad(0x222)](_0xfb5fad(0x29f)),0x0;_0x504c73=_0x5b400c['lastAttempt']['id'],_0x44f919[_0xfb5fad(0x304)]&&console['error'](_0xfb5fad(0x355)+_0x5b400c['sessionTime']);}else{const _0x2c7ba8=_0x24d9e3['map'](_0x3843e0=>{const _0x5d224b=_0xfb5fad,_0x243284=getAttemptStatusDisplay(_0x3843e0['lastAttempt']);return{'title':_0x3843e0['project']?.[_0x5d224b(0x380)]+'.'+_0x3843e0[_0x5d224b(0x201)]?.[_0x5d224b(0x380)]+_0x5d224b(0x377)+_0x3843e0[_0x5d224b(0x284)]+'\x20'+_0x243284[_0x5d224b(0x301)],'value':_0x3843e0[_0x5d224b(0x2c4)]?.['id']||'','description':_0x243284['text']};}),_0x488f43=await a42_0x3f4844({'type':_0xfb5fad(0x324),'name':_0xfb5fad(0x36a),'message':_0xfb5fad(0x1ec),'choices':_0x2c7ba8[_0xfb5fad(0x20c)](_0x34bbb9=>_0x34bbb9['value']!=='')});if(!_0x488f43[_0xfb5fad(0x36a)])return 0x0;_0x504c73=_0x488f43['attemptId'];}const _0x4c6026=_0x44f919[_0xfb5fad(0x322)];return _0x4c6026?await this['pollTimeline'](_0x4cd89e,_0x504c73):await this[_0xfb5fad(0x28f)](_0x4cd89e,_0x504c73,_0x44f919),0x0;}async['renderSingleTimeline'](_0x2516f2,_0x34898d,_0x297983){const _0x5e49b9=a42_0x383d92,{tdx:_0x29b626}=_0x2516f2;let _0x1f351d,_0x572c62;try{[_0x1f351d,_0x572c62]=await Promise['all']([_0x29b626[_0x5e49b9(0x201)][_0x5e49b9(0x347)](_0x34898d),_0x29b626[_0x5e49b9(0x201)][_0x5e49b9(0x2df)](_0x34898d,![])]);}catch(_0x5871b5){console[_0x5e49b9(0x222)](a42_0x5853ac[_0x5e49b9(0x2cd)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x297983['verbose']&&console[_0x5e49b9(0x222)](_0x5871b5);throw _0x5871b5;}if(_0x297983[_0x5e49b9(0x237)]||_0x297983[_0x5e49b9(0x339)]){const _0x3dbb46=this[_0x5e49b9(0x2e9)](_0x1f351d,_0x572c62);await handleSDKOutput([_0x3dbb46],_0x297983);return;}const _0x957bdd=_0x29b626[_0x5e49b9(0x330)][_0x5e49b9(0x357)],_0x2030bb=this[_0x5e49b9(0x37d)](_0x1f351d,_0x572c62,_0x957bdd);console[_0x5e49b9(0x2bf)](_0x2030bb);}async[a42_0x383d92(0x1fc)](_0x4f7edf,_0x4672ad){const _0x4b365c=a42_0x383d92,{tdx:_0x4808a9}=_0x4f7edf,_0x27964a=TIMELINE_CONFIG[_0x4b365c(0x354)],_0x409d7b=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x58ba44=0x0;while(_0x58ba44<_0x409d7b){process[_0x4b365c(0x239)]['isTTY']&&process[_0x4b365c(0x239)][_0x4b365c(0x30e)]('\x1bc');let _0x5fbe3d,_0x1cbd17;try{[_0x5fbe3d,_0x1cbd17]=await Promise[_0x4b365c(0x2e5)]([_0x4808a9[_0x4b365c(0x201)]['attempt'](_0x4672ad),_0x4808a9[_0x4b365c(0x201)][_0x4b365c(0x2df)](_0x4672ad,![])]);}catch(_0x37e444){console[_0x4b365c(0x222)](a42_0x5853ac[_0x4b365c(0x2cd)](_0x4b365c(0x286)));_0x58ba44>0x0&&console['error'](a42_0x5853ac['dim'](_0x4b365c(0x2b6)+_0x58ba44));throw _0x37e444;}const _0x1ff131=_0x4808a9[_0x4b365c(0x330)]['site'],_0x4f1be1=this[_0x4b365c(0x37d)](_0x5fbe3d,_0x1cbd17,_0x1ff131);console['log'](_0x4f1be1);const _0x7e91fd=_0x5fbe3d[_0x4b365c(0x2ce)]&&_0x1cbd17['every'](_0x2d9670=>_0x2d9670[_0x4b365c(0x2c2)]!=='running'&&_0x2d9670[_0x4b365c(0x2c2)]!==_0x4b365c(0x361));if(_0x7e91fd){console['error'](a42_0x5853ac[_0x4b365c(0x1ee)](_0x4b365c(0x348)));break;}console[_0x4b365c(0x222)](a42_0x5853ac[_0x4b365c(0x218)](_0x4b365c(0x276)+_0x58ba44*0x2+_0x4b365c(0x2be))),await new Promise(_0x376821=>setTimeout(_0x376821,_0x27964a)),_0x58ba44++;}_0x58ba44>=_0x409d7b&&console[_0x4b365c(0x222)](a42_0x5853ac[_0x4b365c(0x1ed)]('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a42_0x383d92(0x37d)](_0xc0ce36,_0xdc7881,_0x47f263){const _0x1fb58a=a42_0x383d92,_0xe9c131=[],_0x170a39=TIMELINE_CONFIG[_0x1fb58a(0x2e0)],_0x167981=0x5,_0x3e0500=process[_0x1fb58a(0x239)][_0x1fb58a(0x23a)]||0x78,_0x10ad0a=_0x3e0500-_0x170a39-_0x167981,_0x5cbc96=Math[_0x1fb58a(0x2f9)](TIMELINE_CONFIG[_0x1fb58a(0x285)],Math[_0x1fb58a(0x2cf)](_0x10ad0a,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x98d3e8=new Date(_0xc0ce36[_0x1fb58a(0x1f1)])[_0x1fb58a(0x312)](),_0x5b4268=_0xc0ce36[_0x1fb58a(0x385)]?new Date(_0xc0ce36[_0x1fb58a(0x385)])['getTime']():Date[_0x1fb58a(0x344)](),_0x5134fe={'start':_0x98d3e8,'end':_0x5b4268,'duration':_0x5b4268-_0x98d3e8},_0xd48dc8=new Map(),_0x25d286=[];for(const _0x706060 of _0xdc7881){if(_0x706060[_0x1fb58a(0x29b)]){const _0x34d80b=new Date(_0x706060['startedAt'])['getTime'](),_0x419f91=_0x706060[_0x1fb58a(0x2b4)]?new Date(_0x706060[_0x1fb58a(0x2b4)])['getTime']():Date['now'](),_0xcfdd20={'start':_0x34d80b,'end':_0x419f91,'duration':_0x419f91-_0x34d80b};_0xd48dc8[_0x1fb58a(0x244)](_0x706060['id'],_0xcfdd20),_0x25d286[_0x1fb58a(0x375)]({'name':_0x706060[_0x1fb58a(0x235)],'state':_0x706060[_0x1fb58a(0x2c2)]||_0x1fb58a(0x2f0),'window':_0xcfdd20});}else _0x25d286[_0x1fb58a(0x375)]({'name':_0x706060[_0x1fb58a(0x235)],'state':_0x706060[_0x1fb58a(0x2c2)]||_0x1fb58a(0x361),'window':undefined});}_0x25d286[_0x1fb58a(0x282)]((_0x242c6e,_0x2d2f5c)=>{const _0x456f0a=_0x1fb58a;if(!_0x242c6e['window'])return 0x1;if(!_0x2d2f5c[_0x456f0a(0x269)])return-0x1;return _0x242c6e[_0x456f0a(0x269)][_0x456f0a(0x24c)]-_0x2d2f5c[_0x456f0a(0x269)]['start'];});const _0x46dd06=_0x25d286[_0x1fb58a(0x2a3)],_0x1df4e1=_0x46dd06>TIMELINE_CONFIG[_0x1fb58a(0x33e)];_0x1df4e1&&_0x25d286[_0x1fb58a(0x217)](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0xa61bac=calculateTimeScale(_0x5134fe,_0x5cbc96),_0x5681de=_0xc0ce36[_0x1fb58a(0x2ce)]?_0xc0ce36[_0x1fb58a(0x2d0)]?a42_0x5853ac['green']('success'):a42_0x5853ac[_0x1fb58a(0x2cd)](_0x1fb58a(0x222)):a42_0x5853ac[_0x1fb58a(0x289)](_0x1fb58a(0x248)),_0x25b709=_0xc0ce36[_0x1fb58a(0x334)]?.['id'],_0x4f28cf=_0xc0ce36[_0x1fb58a(0x252)];let _0x131cdb;if(_0x25b709&&_0x4f28cf){const _0x3443e0=getWorkflowAttemptUrl(_0x47f263,_0x25b709,_0x4f28cf,_0xc0ce36['id']);_0x131cdb=hyperlink(a42_0x5853ac['dim'](_0xc0ce36['id']),_0x3443e0);}else _0x131cdb=a42_0x5853ac[_0x1fb58a(0x218)](_0xc0ce36['id']);_0xe9c131[_0x1fb58a(0x375)](_0x1fb58a(0x359)+_0x131cdb+_0x1fb58a(0x377)+_0x5681de+'\x20-\x20'+formatElapsed(_0x5134fe['duration']));if(_0x25d286[_0x1fb58a(0x2a3)]>0x0){const _0x2d26fe=renderTimeAxis(_0xa61bac,_0x5cbc96),_0x6357f5=new Date(_0x5134fe[_0x1fb58a(0x24c)]),_0x43bc73=formatDate(_0x6357f5),_0x8952eb=TIMELINE_CONFIG[_0x1fb58a(0x371)]+TIMELINE_CONFIG[_0x1fb58a(0x290)]+_0x170a39,_0x2eaca2=_0x43bc73[_0x1fb58a(0x32f)](_0x8952eb),_0x911379=a42_0x5853ac[_0x1fb58a(0x218)](_0x2eaca2);_0xe9c131['push'](_0x911379+'\x20'+_0x2d26fe);for(const _0x4f1199 of _0x25d286){_0xe9c131[_0x1fb58a(0x375)](renderTaskRow(_0x4f1199,_0xa61bac,_0x5cbc96,_0x170a39));}const _0x1a62b3=calculateStats(_0x25d286);_0xe9c131[_0x1fb58a(0x375)](formatStats(_0x1a62b3)),_0x1df4e1&&_0xe9c131[_0x1fb58a(0x375)](a42_0x5853ac[_0x1fb58a(0x1ed)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0x1fb58a(0x33e)]+_0x1fb58a(0x2ad)+_0x46dd06+_0x1fb58a(0x30c))),_0xe9c131['push'](''),_0xe9c131[_0x1fb58a(0x375)](a42_0x5853ac[_0x1fb58a(0x218)](_0x1fb58a(0x27b))+(_0x1fb58a(0x262)+_0xc0ce36['id']+_0x1fb58a(0x27e))+a42_0x5853ac['dim']('\x20to\x20see\x20detailed\x20logs'));}else _0xe9c131[_0x1fb58a(0x375)]('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0xe9c131[_0x1fb58a(0x37a)]('\x0a');}[a42_0x383d92(0x2e9)](_0xd1acc5,_0x268343){const _0x226bb9=a42_0x383d92,_0x5c842d=new Date(_0xd1acc5['createdAt'])[_0x226bb9(0x312)](),_0x3ba48b=_0xd1acc5[_0x226bb9(0x385)]?new Date(_0xd1acc5[_0x226bb9(0x385)])[_0x226bb9(0x312)]():Date['now'](),_0x329a25=_0x3ba48b-_0x5c842d,_0x153ace=[];for(const _0x3774de of _0x268343){if(_0x3774de[_0x226bb9(0x29b)]){const _0x514369=new Date(_0x3774de[_0x226bb9(0x29b)])[_0x226bb9(0x312)](),_0x5ed153=_0x3774de[_0x226bb9(0x2b4)]?new Date(_0x3774de[_0x226bb9(0x2b4)])[_0x226bb9(0x312)]():Date[_0x226bb9(0x344)]();_0x153ace[_0x226bb9(0x375)]({'name':_0x3774de['fullName'],'state':_0x3774de[_0x226bb9(0x2c2)]||_0x226bb9(0x2f0),'window':{'start':_0x514369,'end':_0x5ed153,'duration':_0x5ed153-_0x514369}});}else _0x153ace[_0x226bb9(0x375)]({'name':_0x3774de[_0x226bb9(0x235)],'state':_0x3774de[_0x226bb9(0x2c2)]||_0x226bb9(0x361),'window':undefined});}const _0x29b3f5=calculateStats(_0x153ace);return{'attempt':{'id':_0xd1acc5['id'],'status':_0xd1acc5[_0x226bb9(0x2ce)]?_0xd1acc5['success']?_0x226bb9(0x2d0):_0x226bb9(0x222):'running','createdAt':_0xd1acc5[_0x226bb9(0x1f1)],'finishedAt':_0xd1acc5['finishedAt'],'duration_ms':_0x329a25},'tasks':_0x153ace[_0x226bb9(0x2f1)](_0x517e87=>({'name':_0x517e87[_0x226bb9(0x380)],'state':_0x517e87[_0x226bb9(0x2c2)],'startedAt':_0x517e87[_0x226bb9(0x269)]?new Date(_0x517e87['window']['start'])[_0x226bb9(0x24b)]():null,'updatedAt':_0x517e87[_0x226bb9(0x269)]?new Date(_0x517e87[_0x226bb9(0x269)][_0x226bb9(0x208)])['toISOString']():null,'duration_ms':_0x517e87[_0x226bb9(0x269)]?.[_0x226bb9(0x383)]||null})),'stats':_0x29b3f5};}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x575d85,_0x185ac2){const _0x47acda=a43_0x8a64,_0xb893d2=_0x575d85();while(!![]){try{const _0x28e95a=parseInt(_0x47acda(0x1ef))/0x1*(-parseInt(_0x47acda(0x1eb))/0x2)+parseInt(_0x47acda(0x1f1))/0x3+parseInt(_0x47acda(0x1f7))/0x4+-parseInt(_0x47acda(0x1f8))/0x5+parseInt(_0x47acda(0x1f3))/0x6+-parseInt(_0x47acda(0x1fa))/0x7+-parseInt(_0x47acda(0x1f5))/0x8*(parseInt(_0x47acda(0x1ec))/0x9);if(_0x28e95a===_0x185ac2)break;else _0xb893d2['push'](_0xb893d2['shift']());}catch(_0x4d74b4){_0xb893d2['push'](_0xb893d2['shift']());}}}(a43_0x4277,0xbe9f8));function a43_0x8a64(_0x101274,_0x21a853){_0x101274=_0x101274-0x1ea;const _0x42776e=a43_0x4277();let _0x8a6455=_0x42776e[_0x101274];return _0x8a6455;}function a43_0x4277(){const _0xf7611b=['X-Trino-User','114CMyJns','12108996tnhEiQ','length','replace','1134prUnOw','tdx','500235cCEqTA',';\x20node/','9299478laZGrz','Authorization','8LUmyEr','TD1\x20','5941392FpbjnJ','4589995FOVgzx','entries','651931KVJXhx','tdx/'];a43_0x4277=function(){return _0xf7611b;};return a43_0x4277();}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 _0x312b4d=a43_0x8a64,_0x455463=getVersion(),_0x2865d1=platform(),_0x24f777=process['version'][_0x312b4d(0x1ee)]('v','');return _0x312b4d(0x1fb)+_0x455463+'\x20('+_0x2865d1+_0x312b4d(0x1f2)+_0x24f777+')';}export function getAuthHeaders(_0x13c8c9,_0x536783){const _0x17c261=a43_0x8a64,_0x3b7b13=getVersion(),_0x5d9252={'User-Agent':getUserAgent(),'X-TD-Client':_0x17c261(0x1f0),'X-TD-Client-Version':_0x3b7b13};return _0x536783&&(_0x5d9252[_0x17c261(0x1f4)]=_0x17c261(0x1f6)+_0x536783),_0x5d9252;}export function toHeaderRecord(_0x5e8cf8){const _0x3b14cd=a43_0x8a64,_0x3a159c={};for(const [_0x1b8471,_0x291db9]of Object[_0x3b14cd(0x1f9)](_0x5e8cf8)){_0x291db9!==undefined&&(_0x3a159c[_0x1b8471]=_0x291db9);}return _0x3a159c;}export function getTrinoHeaders(_0x3c7019,_0x218302){const _0x48f82c=a43_0x8a64,_0x2e769f=getAuthHeaders(_0x3c7019,_0x218302),_0x5406e7=toHeaderRecord(_0x2e769f);return delete _0x5406e7[_0x48f82c(0x1f4)],_0x218302&&(_0x5406e7[_0x48f82c(0x1ea)]=_0x218302),_0x5406e7;}export function hasAPIKey(_0x32969d){const _0x459b0e=a43_0x8a64,_0x3d0b1b=getAPIKey();return _0x3d0b1b!==undefined&&_0x3d0b1b[_0x459b0e(0x1ed)]>0x0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x2b3b85,_0x86a498){const _0x53f86f=a44_0x17b4,_0x223b93=_0x2b3b85();while(!![]){try{const _0x4bf29a=-parseInt(_0x53f86f(0xb4))/0x1+parseInt(_0x53f86f(0xa7))/0x2*(parseInt(_0x53f86f(0x87))/0x3)+-parseInt(_0x53f86f(0x85))/0x4*(parseInt(_0x53f86f(0xaa))/0x5)+parseInt(_0x53f86f(0xa9))/0x6+-parseInt(_0x53f86f(0xb1))/0x7+-parseInt(_0x53f86f(0x7d))/0x8+parseInt(_0x53f86f(0x8c))/0x9;if(_0x4bf29a===_0x86a498)break;else _0x223b93['push'](_0x223b93['shift']());}catch(_0x41645a){_0x223b93['push'](_0x223b93['shift']());}}}(a44_0x5114,0xc0236));function a44_0x5114(){const _0x5998fb=['[error]','Results\x20saved\x20to\x20','─┴─','isTTY','7160461HYdwCT','query','json','305135TCGtoa','keys','noColor','number','list','split','bold','red','[logs]','No\x20data','tsv','pipe','yellow','1018544OBoHPs','entries','isInteger','rule','map','repeat','stderr','max','14412VDOvbC','trim','1806699KNDDbi','FINISHED','table','padEnd','-FXRSn','8742114tUjayJ','varchar','[params]','debug','filter','[query]','magenta','blue','join','color','string','stringify','output','format','limit','stdout','stdin','cyan','params','length','spawn','log','push','bigint','forEach','jsonl','boolean','2ZVBIFN','inherit','9179472XVdLDn','1195cJwLKI','error','object'];a44_0x5114=function(){return _0x5998fb;};return a44_0x5114();}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_0xce1b06 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x1ac9d){const _0x4c3305=a44_0x17b4;return _0x1ac9d[_0x4c3305(0x99)]===_0x4c3305(0xb3)||_0x1ac9d[_0x4c3305(0x99)]===_0x4c3305(0xa5)||_0x1ac9d[_0x4c3305(0x99)]==='tsv'||_0x1ac9d[_0x4c3305(0x99)]==='table'||_0x1ac9d[_0x4c3305(0xb3)]===!![]||_0x1ac9d[_0x4c3305(0xa5)]===!![]||_0x1ac9d[_0x4c3305(0x7a)]===!![]||_0x1ac9d[_0x4c3305(0x89)]===!![];}export function parseOutputOptions(_0x5ca4cf){const _0x20538f=a44_0x17b4;return{'format':_0x5ca4cf['format']||_0x20538f(0x89),'output':_0x5ca4cf[_0x20538f(0x98)]||'','limit':_0x5ca4cf[_0x20538f(0x9a)],'color':_0x5ca4cf[_0x20538f(0x95)],'noColor':_0x5ca4cf[_0x20538f(0xb6)]};}function convertSDKResultToQueryResult(_0x3095cf){const _0x5d1bb8=a44_0x17b4,_0x496aa7=[];if(_0x3095cf[_0x5d1bb8(0x9f)]>0x0){const _0x4a203e=_0x3095cf[0x0];for(const [_0x52fe44,_0x4cd847]of Object[_0x5d1bb8(0x7e)](_0x4a203e)){let _0x50eb0c='varchar';if(typeof _0x4cd847===_0x5d1bb8(0xb7))_0x50eb0c=Number[_0x5d1bb8(0x7f)](_0x4cd847)?_0x5d1bb8(0xa3):'double';else{if(typeof _0x4cd847===_0x5d1bb8(0xa6))_0x50eb0c=_0x5d1bb8(0xa6);else _0x4cd847===null&&(_0x50eb0c=_0x5d1bb8(0x8d));}_0x496aa7[_0x5d1bb8(0xa2)]({'name':_0x52fe44,'type':_0x50eb0c});}}return{'queryId':'sdk-result','columns':_0x496aa7,'data':_0x3095cf,'stats':{'state':_0x5d1bb8(0x88),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3095cf[_0x5d1bb8(0x9f)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x5fc6c2,_0x1e4e5d){const _0x1162d2=convertSDKResultToQueryResult(_0x5fc6c2);return formatQueryOutput(_0x1162d2,_0x1e4e5d);}export async function formatQueryOutput(_0x31bae1,_0x100a31){const _0x51b323=a44_0x17b4,{format:_0x3765e4,limit:_0x55670b,output:_0x3d3757,color:_0x3650df,noColor:_0x24b18c}=_0x100a31,_0xd982f=Boolean(_0x3d3757)&&!_0x3650df,_0xafbafa={'color':_0x3650df,'noColor':_0x24b18c||_0xd982f};if(_0x3765e4==='table'){const _0x3b5b72=shouldUseLess(_0x3765e4,_0x3d3757);return formatAsTable(_0x31bae1,_0x55670b,_0x3b5b72,_0xafbafa);}else{if(_0x3765e4==='json')return formatAsJSON(_0x31bae1,_0xafbafa);else return _0x3765e4===_0x51b323(0xa5)?formatAsJSONL(_0x31bae1,_0xafbafa):formatQueryResult(_0x31bae1,_0x3765e4);}}function a44_0x17b4(_0x280344,_0x396bc7){_0x280344=_0x280344-0x77;const _0x5114f1=a44_0x5114();let _0x17b46b=_0x5114f1[_0x280344];return _0x17b46b;}function shouldUseLess(_0x3a9b2c,_0x332a12){const _0x5d0d72=a44_0x17b4;return(_0x3a9b2c===_0x5d0d72(0x89)||_0x3a9b2c===_0x5d0d72(0xb8))&&process[_0x5d0d72(0x9b)][_0x5d0d72(0xb0)]&&!_0x332a12;}export function resolveOutputOptions(_0x42513d){const _0x1d7f6f=a44_0x17b4,_0x5eee81=resolveOutputFormat(_0x42513d[_0x1d7f6f(0x99)],_0x42513d['output'],_0x1d7f6f(0x89));let _0x5cae71=typeof _0x42513d[_0x1d7f6f(0x9a)]==='number'?_0x42513d[_0x1d7f6f(0x9a)]:parseInt(_0x42513d[_0x1d7f6f(0x9a)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x45e225=_0x42513d[_0x1d7f6f(0x98)]||'';return shouldUseLess(_0x5eee81,_0x45e225)&&(_0x5cae71=Infinity),{'format':_0x5eee81,'output':_0x45e225,'limit':_0x5cae71,'color':_0x42513d[_0x1d7f6f(0x95)],'noColor':_0x42513d[_0x1d7f6f(0xb6)]};}export function writeOutput(_0x128ae3,_0x556998,_0x22a533){const _0x257c1c=a44_0x17b4;return _0x556998?(writeFileSync(_0x556998,_0x128ae3),console[_0x257c1c(0xab)](_0x257c1c(0xae)+_0x556998),Promise['resolve']()):shouldUseLess(_0x22a533||'','')?new Promise(_0xff6b2a=>{const _0x2584a7=_0x257c1c,_0xd2197a=spawn('less',[_0x2584a7(0x8b)],{'stdio':[_0x2584a7(0x7b),_0x2584a7(0xa8),'inherit']});let _0x5016e8=![];_0xd2197a['on'](_0x2584a7(0xab),()=>{const _0x592807=_0x2584a7;!_0x5016e8&&(_0x5016e8=!![],console[_0x592807(0xa1)](_0x128ae3),_0xff6b2a());}),_0xd2197a['on']('close',()=>{!_0x5016e8&&(_0x5016e8=!![],_0xff6b2a());}),_0xd2197a['on'](_0x2584a7(0xa0),()=>{const _0x38473d=_0x2584a7;!_0x5016e8&&_0xd2197a['stdin']&&(_0xd2197a[_0x38473d(0x9c)]['on'](_0x38473d(0xab),()=>{}),_0xd2197a['stdin']['write'](_0x128ae3),_0xd2197a['stdin']['end']());}),!_0xd2197a[_0x2584a7(0x9c)]&&(!_0x5016e8&&(_0x5016e8=!![],console[_0x2584a7(0xa1)](_0x128ae3),_0xff6b2a()));}):(console[_0x257c1c(0xa1)](_0x128ae3),Promise['resolve']());}export async function handleSDKOutput(_0x22760d,_0x41ec91){const _0x632508=a44_0x17b4,_0x369236=resolveOutputOptions(_0x41ec91),_0x3efc70=await formatSDKOutput(_0x22760d,_0x369236);await writeOutput(_0x3efc70,_0x369236[_0x632508(0x98)]||undefined,_0x369236['format']);}export async function handleQueryOutput(_0x32ec9f,_0x7b2aff){const _0x4ca8b4=a44_0x17b4,_0x2724f5=resolveOutputOptions(_0x7b2aff),_0x4451e6=await formatQueryOutput(_0x32ec9f,_0x2724f5);await writeOutput(_0x4451e6,_0x2724f5['output']||undefined,_0x2724f5[_0x4ca8b4(0x99)]);}async function formatSingleObject(_0x2c1bce,_0x1f8e0b){const _0x414d5a=a44_0x17b4,{format:_0x22b9d5,color:_0x213458,noColor:_0x8fb65b}=_0x1f8e0b,_0x496c11={'color':_0x213458,'noColor':_0x8fb65b};if(_0x22b9d5===_0x414d5a(0xb3)){if(shouldUseColor(_0x496c11))return colorizeJSON(_0x2c1bce,_0x496c11);return JSON[_0x414d5a(0x97)](_0x2c1bce,null,0x2);}else{if(_0x22b9d5===_0x414d5a(0xa5)){if(shouldUseColor(_0x496c11))return colorizeJSONCompact(_0x2c1bce,_0x496c11);return JSON[_0x414d5a(0x97)](_0x2c1bce);}else{if(_0x22b9d5===_0x414d5a(0x7a))return Object[_0x414d5a(0x7e)](_0x2c1bce)[_0x414d5a(0x81)](([_0x19ddc1,_0x31bc70])=>_0x19ddc1+'\x09'+_0x31bc70)[_0x414d5a(0x94)]('\x0a');else{const _0x17742b=Object[_0x414d5a(0x7e)](_0x2c1bce);if(_0x17742b[_0x414d5a(0x9f)]===0x0)return _0x414d5a(0x79);const _0x2cd0aa=_0x2c1bce[_0x414d5a(0x8f)],_0x25d8be=_0x2c1bce[_0x414d5a(0xb2)],_0x1252ab=_0x2c1bce[_0x414d5a(0x9e)],_0x2731bb=_0x2c1bce[_0x414d5a(0x80)],_0x4cac91=_0x25d8be?typeof _0x25d8be===_0x414d5a(0x96)?_0x25d8be:JSON[_0x414d5a(0x97)](_0x25d8be,null,0x2):undefined,_0x526cac=_0x1252ab&&Object[_0x414d5a(0xb5)](_0x1252ab)['length']>0x0?JSON[_0x414d5a(0x97)](_0x1252ab,null,0x2):undefined,_0x11f534=_0x2731bb&&Object[_0x414d5a(0xb5)](_0x2731bb)[_0x414d5a(0x9f)]>0x0?JSON['stringify'](_0x2731bb,null,0x2):undefined,_0x37d32d=_0x17742b[_0x414d5a(0x90)](([_0x3e23d8])=>_0x3e23d8!==_0x414d5a(0x8f)&&_0x3e23d8!==_0x414d5a(0xb2)&&_0x3e23d8!==_0x414d5a(0x9e)&&_0x3e23d8!==_0x414d5a(0x80)),_0x519f8e=Math[_0x414d5a(0x84)](..._0x37d32d[_0x414d5a(0x81)](([_0x985b96])=>_0x985b96[_0x414d5a(0x9f)])),_0x409c6f=Math[_0x414d5a(0x84)](..._0x37d32d[_0x414d5a(0x81)](([,_0xf0d6cd])=>{const _0x30ae05=_0x414d5a;try{const _0x139452=_0xf0d6cd===null||_0xf0d6cd===undefined?'':typeof _0xf0d6cd==='object'?JSON[_0x30ae05(0x97)](_0xf0d6cd):String(_0xf0d6cd),_0x586b26=_0x139452[_0x30ae05(0xb9)]('\x0a');return Math[_0x30ae05(0x84)](..._0x586b26[_0x30ae05(0x81)](_0x2f4e7a=>_0x2f4e7a['length']),0x0);}catch{return 0x0;}}),0x14),_0x3cc172=[];_0x3cc172[_0x414d5a(0xa2)](colorBorder('┌─'+'─'[_0x414d5a(0x82)](_0x519f8e)+'─┬─'+'─'[_0x414d5a(0x82)](_0x409c6f)+'─┐',_0x496c11)),_0x37d32d[_0x414d5a(0xa4)](([_0x6b288b,_0x4d0882])=>{const _0x6aa096=_0x414d5a;let _0x350d82;try{_0x350d82=_0x4d0882===null||_0x4d0882===undefined?'':typeof _0x4d0882===_0x6aa096(0xac)?JSON[_0x6aa096(0x97)](_0x4d0882):String(_0x4d0882);}catch{_0x350d82='[Object]';}const _0x3cb9d5=_0x6b288b[_0x6aa096(0x8a)](_0x519f8e),_0x1bfb4d=_0x350d82['split']('\x0a');_0x1bfb4d[_0x6aa096(0xa4)]((_0x2aa665,_0x38026a)=>{const _0x324a8e=_0x6aa096,_0xd7a84d=colorBorder('│',_0x496c11);_0x38026a===0x0?_0x3cc172[_0x324a8e(0xa2)](_0xd7a84d+'\x20'+_0x3cb9d5+'\x20'+_0xd7a84d+'\x20'+_0x2aa665['padEnd'](_0x409c6f)+'\x20'+_0xd7a84d):_0x3cc172[_0x324a8e(0xa2)](_0xd7a84d+'\x20'+'\x20'['repeat'](_0x519f8e)+'\x20'+_0xd7a84d+'\x20'+_0x2aa665[_0x324a8e(0x8a)](_0x409c6f)+'\x20'+_0xd7a84d);});}),_0x3cc172[_0x414d5a(0xa2)](colorBorder('└─'+'─'['repeat'](_0x519f8e)+_0x414d5a(0xaf)+'─'[_0x414d5a(0x82)](_0x409c6f)+'─┘',_0x496c11));_0x4cac91&&(_0x3cc172[_0x414d5a(0xa2)](''),_0x3cc172['push'](String(a44_0xce1b06[_0x414d5a(0x7c)][_0x414d5a(0xba)](_0x414d5a(0x91)))),_0x3cc172['push'](_0x4cac91));_0x526cac&&(_0x3cc172['push'](''),_0x3cc172[_0x414d5a(0xa2)](String(a44_0xce1b06[_0x414d5a(0x93)][_0x414d5a(0xba)](_0x414d5a(0x8e)))),_0x3cc172[_0x414d5a(0xa2)](_0x526cac));_0x11f534&&(_0x3cc172[_0x414d5a(0xa2)](''),_0x3cc172[_0x414d5a(0xa2)](String(a44_0xce1b06[_0x414d5a(0x92)][_0x414d5a(0xba)]('[rule]'))),_0x3cc172['push'](_0x11f534));if(_0x2cd0aa){if(_0x2cd0aa[_0x414d5a(0x83)]){_0x3cc172[_0x414d5a(0xa2)](''),_0x3cc172[_0x414d5a(0xa2)](String(a44_0xce1b06[_0x414d5a(0x77)][_0x414d5a(0xba)](_0x414d5a(0xad))));const _0x377247=_0x2cd0aa[_0x414d5a(0x83)]['split']('\x0a');_0x377247[_0x414d5a(0xa4)](_0x363a33=>{const _0x48ec23=_0x414d5a;_0x363a33['trim']()&&_0x3cc172[_0x48ec23(0xa2)](_0x363a33);});}if(_0x2cd0aa['cmdout']){_0x3cc172[_0x414d5a(0xa2)](''),_0x3cc172[_0x414d5a(0xa2)](String(a44_0xce1b06[_0x414d5a(0x9d)][_0x414d5a(0xba)](_0x414d5a(0x78))));const _0x437cbe=_0x2cd0aa['cmdout'][_0x414d5a(0xb9)]('\x0a');_0x437cbe[_0x414d5a(0xa4)](_0x275f89=>{const _0x359dee=_0x414d5a;_0x275f89[_0x359dee(0x86)]()&&_0x3cc172['push'](_0x275f89);});}}return _0x3cc172[_0x414d5a(0x94)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x45fe75,_0x51e562){const _0x557e42=a44_0x17b4;if(_0x51e562['format']==='table'){await handleSDKOutput([_0x45fe75],_0x51e562);return;}const _0x2e5dce=resolveOutputOptions(_0x51e562),_0x26e79e=await formatSingleObject(_0x45fe75,_0x2e5dce);await writeOutput(_0x26e79e,_0x2e5dce['output']||undefined,_0x2e5dce[_0x557e42(0x99)]);}
|
|
1
|
+
(function(_0x522f28,_0x2edc25){const _0x35ca05=a44_0x2443,_0x1764d6=_0x522f28();while(!![]){try{const _0x14272e=-parseInt(_0x35ca05(0x13c))/0x1+-parseInt(_0x35ca05(0x147))/0x2*(-parseInt(_0x35ca05(0x15a))/0x3)+parseInt(_0x35ca05(0x165))/0x4*(parseInt(_0x35ca05(0x141))/0x5)+-parseInt(_0x35ca05(0x132))/0x6*(parseInt(_0x35ca05(0x151))/0x7)+parseInt(_0x35ca05(0x142))/0x8*(parseInt(_0x35ca05(0x16f))/0x9)+parseInt(_0x35ca05(0x173))/0xa+-parseInt(_0x35ca05(0x140))/0xb;if(_0x14272e===_0x2edc25)break;else _0x1764d6['push'](_0x1764d6['shift']());}catch(_0x4bd6f1){_0x1764d6['push'](_0x1764d6['shift']());}}}(a44_0x3e55,0x80f3c));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_0x405f3c from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0xb41067){const _0x1af241=a44_0x2443;return _0xb41067[_0x1af241(0x175)]==='json'||_0xb41067[_0x1af241(0x175)]===_0x1af241(0x157)||_0xb41067[_0x1af241(0x175)]==='tsv'||_0xb41067[_0x1af241(0x175)]==='table'||_0xb41067[_0x1af241(0x158)]===!![]||_0xb41067[_0x1af241(0x157)]===!![]||_0xb41067[_0x1af241(0x160)]===!![]||_0xb41067[_0x1af241(0x177)]===!![];}export function parseOutputOptions(_0x3b882a){const _0x1649d2=a44_0x2443;return{'format':_0x3b882a[_0x1649d2(0x175)]||_0x1649d2(0x177),'output':_0x3b882a['output']||'','limit':_0x3b882a[_0x1649d2(0x14c)],'color':_0x3b882a[_0x1649d2(0x159)],'noColor':_0x3b882a[_0x1649d2(0x163)]};}function convertSDKResultToQueryResult(_0x3d499b){const _0x44989b=a44_0x2443,_0x4bcd7a=[];if(_0x3d499b['length']>0x0){const _0x556b73=_0x3d499b[0x0];for(const [_0x545bd7,_0xcd658f]of Object['entries'](_0x556b73)){let _0x1165bc=_0x44989b(0x15f);if(typeof _0xcd658f==='number')_0x1165bc=Number[_0x44989b(0x13e)](_0xcd658f)?_0x44989b(0x15c):_0x44989b(0x138);else{if(typeof _0xcd658f==='boolean')_0x1165bc=_0x44989b(0x156);else _0xcd658f===null&&(_0x1165bc=_0x44989b(0x15f));}_0x4bcd7a[_0x44989b(0x164)]({'name':_0x545bd7,'type':_0x1165bc});}}return{'queryId':_0x44989b(0x14b),'columns':_0x4bcd7a,'data':_0x3d499b,'stats':{'state':_0x44989b(0x179),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3d499b[_0x44989b(0x155)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x213aea,_0x5d2b1a){const _0x3fdde6=convertSDKResultToQueryResult(_0x213aea);return formatQueryOutput(_0x3fdde6,_0x5d2b1a);}export async function formatQueryOutput(_0x11890b,_0xa6d61d){const _0x3e73f4=a44_0x2443,{format:_0xcb362a,limit:_0x56bd25,output:_0x6291d1,color:_0x5c7967,noColor:_0x2ffd91}=_0xa6d61d,_0x411b86=Boolean(_0x6291d1)&&!_0x5c7967,_0x30ac2c={'color':_0x5c7967,'noColor':_0x2ffd91||_0x411b86};if(_0xcb362a===_0x3e73f4(0x177)){const _0x1d7a69=shouldUseLess(_0xcb362a,_0x6291d1);return formatAsTable(_0x11890b,_0x56bd25,_0x1d7a69,_0x30ac2c);}else{if(_0xcb362a===_0x3e73f4(0x158))return formatAsJSON(_0x11890b,_0x30ac2c);else return _0xcb362a==='jsonl'?formatAsJSONL(_0x11890b,_0x30ac2c):formatQueryResult(_0x11890b,_0xcb362a);}}function shouldUseLess(_0x36369a,_0x300cb7){const _0x15e8a7=a44_0x2443;return(_0x36369a===_0x15e8a7(0x177)||_0x36369a==='list')&&process[_0x15e8a7(0x146)][_0x15e8a7(0x174)]&&!_0x300cb7;}export function resolveOutputOptions(_0x578282){const _0x4421e3=a44_0x2443,_0xea11b6=resolveOutputFormat(_0x578282['format'],_0x578282['output'],'table');let _0xdcf009=typeof _0x578282[_0x4421e3(0x14c)]==='number'?_0x578282[_0x4421e3(0x14c)]:parseInt(_0x578282[_0x4421e3(0x14c)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x2e6c64=_0x578282[_0x4421e3(0x16d)]||'';return shouldUseLess(_0xea11b6,_0x2e6c64)&&(_0xdcf009=Infinity),{'format':_0xea11b6,'output':_0x2e6c64,'limit':_0xdcf009,'color':_0x578282[_0x4421e3(0x159)],'noColor':_0x578282[_0x4421e3(0x163)]};}export function writeOutput(_0x2ddd5b,_0x29efd4,_0x143e43){const _0x3d2a92=a44_0x2443;return _0x29efd4?(writeFileSync(_0x29efd4,_0x2ddd5b),console[_0x3d2a92(0x13f)]('Results\x20saved\x20to\x20'+_0x29efd4),Promise[_0x3d2a92(0x149)]()):shouldUseLess(_0x143e43||'','')?new Promise(_0x285fb7=>{const _0x2d9b7d=_0x3d2a92,_0x3a7e71=spawn(_0x2d9b7d(0x161),[_0x2d9b7d(0x172)],{'stdio':[_0x2d9b7d(0x16b),_0x2d9b7d(0x13a),'inherit']});let _0x140436=![];_0x3a7e71['on'](_0x2d9b7d(0x13f),()=>{const _0x5d51a6=_0x2d9b7d;!_0x140436&&(_0x140436=!![],console[_0x5d51a6(0x16e)](_0x2ddd5b),_0x285fb7());}),_0x3a7e71['on']('close',()=>{!_0x140436&&(_0x140436=!![],_0x285fb7());}),_0x3a7e71['on'](_0x2d9b7d(0x145),()=>{const _0x5bf8b3=_0x2d9b7d;!_0x140436&&_0x3a7e71[_0x5bf8b3(0x14d)]&&(_0x3a7e71[_0x5bf8b3(0x14d)]['on'](_0x5bf8b3(0x13f),()=>{}),_0x3a7e71[_0x5bf8b3(0x14d)][_0x5bf8b3(0x176)](_0x2ddd5b),_0x3a7e71[_0x5bf8b3(0x14d)][_0x5bf8b3(0x14f)]());}),!_0x3a7e71[_0x2d9b7d(0x14d)]&&(!_0x140436&&(_0x140436=!![],console[_0x2d9b7d(0x16e)](_0x2ddd5b),_0x285fb7()));}):(console[_0x3d2a92(0x16e)](_0x2ddd5b),Promise[_0x3d2a92(0x149)]());}export async function handleSDKOutput(_0x59f8d5,_0x2814db){const _0x32ac13=a44_0x2443,_0x2f80f0=resolveOutputOptions(_0x2814db),_0x173009=await formatSDKOutput(_0x59f8d5,_0x2f80f0);await writeOutput(_0x173009,_0x2f80f0[_0x32ac13(0x16d)]||undefined,_0x2f80f0[_0x32ac13(0x175)]);}function a44_0x2443(_0x2e1dc7,_0x4d92c7){_0x2e1dc7=_0x2e1dc7-0x131;const _0x3e5586=a44_0x3e55();let _0x244314=_0x3e5586[_0x2e1dc7];return _0x244314;}export async function handleQueryOutput(_0x30515b,_0xdfb1a9){const _0x20a9ee=a44_0x2443,_0x20725c=resolveOutputOptions(_0xdfb1a9),_0x2bff27=await formatQueryOutput(_0x30515b,_0x20725c);await writeOutput(_0x2bff27,_0x20725c[_0x20a9ee(0x16d)]||undefined,_0x20725c['format']);}async function formatSingleObject(_0x4df8f1,_0x2109ec){const _0x5e9fcc=a44_0x2443,{format:_0x575763,color:_0x126b1c,noColor:_0x3565c6}=_0x2109ec,_0x57195a={'color':_0x126b1c,'noColor':_0x3565c6};if(_0x575763===_0x5e9fcc(0x158)){if(shouldUseColor(_0x57195a))return colorizeJSON(_0x4df8f1,_0x57195a);return JSON['stringify'](_0x4df8f1,null,0x2);}else{if(_0x575763===_0x5e9fcc(0x157)){if(shouldUseColor(_0x57195a))return colorizeJSONCompact(_0x4df8f1,_0x57195a);return JSON['stringify'](_0x4df8f1);}else{if(_0x575763===_0x5e9fcc(0x160))return Object['entries'](_0x4df8f1)[_0x5e9fcc(0x148)](([_0x370be4,_0x4781bb])=>_0x370be4+'\x09'+_0x4781bb)[_0x5e9fcc(0x15e)]('\x0a');else{const _0x4204fb=Object['entries'](_0x4df8f1);if(_0x4204fb[_0x5e9fcc(0x155)]===0x0)return _0x5e9fcc(0x16c);const _0x424b7b=_0x4df8f1[_0x5e9fcc(0x143)],_0x3590e8=_0x4df8f1[_0x5e9fcc(0x134)],_0x544119=_0x4df8f1[_0x5e9fcc(0x150)],_0x2f78c3=_0x4df8f1[_0x5e9fcc(0x135)],_0x28896d=_0x3590e8?typeof _0x3590e8===_0x5e9fcc(0x168)?_0x3590e8:JSON[_0x5e9fcc(0x152)](_0x3590e8,null,0x2):undefined,_0x431718=_0x544119&&Object['keys'](_0x544119)[_0x5e9fcc(0x155)]>0x0?JSON[_0x5e9fcc(0x152)](_0x544119,null,0x2):undefined,_0x2f909d=_0x2f78c3&&Object['keys'](_0x2f78c3)[_0x5e9fcc(0x155)]>0x0?JSON[_0x5e9fcc(0x152)](_0x2f78c3,null,0x2):undefined,_0x5e13ea=_0x4204fb['filter'](([_0x1a83f3])=>_0x1a83f3!=='debug'&&_0x1a83f3!==_0x5e9fcc(0x134)&&_0x1a83f3!==_0x5e9fcc(0x150)&&_0x1a83f3!==_0x5e9fcc(0x135)),_0x5a0bf0=Math[_0x5e9fcc(0x169)](..._0x5e13ea['map'](([_0x108e57])=>_0x108e57['length'])),_0xe56452=Math[_0x5e9fcc(0x169)](..._0x5e13ea[_0x5e9fcc(0x148)](([,_0x31bff1])=>{const _0xa1fb0c=_0x5e9fcc;try{const _0x3d3377=_0x31bff1===null||_0x31bff1===undefined?'':typeof _0x31bff1===_0xa1fb0c(0x14e)?JSON[_0xa1fb0c(0x152)](_0x31bff1):String(_0x31bff1),_0x1e548d=_0x3d3377[_0xa1fb0c(0x16a)]('\x0a');return Math[_0xa1fb0c(0x169)](..._0x1e548d[_0xa1fb0c(0x148)](_0x5e06ee=>_0x5e06ee[_0xa1fb0c(0x155)]),0x0);}catch{return 0x0;}}),0x14),_0x712cf8=[];_0x712cf8[_0x5e9fcc(0x164)](colorBorder('┌─'+'─'[_0x5e9fcc(0x154)](_0x5a0bf0)+_0x5e9fcc(0x153)+'─'[_0x5e9fcc(0x154)](_0xe56452)+'─┐',_0x57195a)),_0x5e13ea[_0x5e9fcc(0x13b)](([_0x51494c,_0x181482])=>{const _0x3a34fc=_0x5e9fcc;let _0x13b5d3;try{_0x13b5d3=_0x181482===null||_0x181482===undefined?'':typeof _0x181482===_0x3a34fc(0x14e)?JSON['stringify'](_0x181482):String(_0x181482);}catch{_0x13b5d3='[Object]';}const _0x2f8140=_0x51494c[_0x3a34fc(0x162)](_0x5a0bf0),_0xa2c861=_0x13b5d3[_0x3a34fc(0x16a)]('\x0a');_0xa2c861[_0x3a34fc(0x13b)]((_0x1d2466,_0x4658b1)=>{const _0x19c4a3=_0x3a34fc,_0x51bc64=colorBorder('│',_0x57195a);_0x4658b1===0x0?_0x712cf8[_0x19c4a3(0x164)](_0x51bc64+'\x20'+_0x2f8140+'\x20'+_0x51bc64+'\x20'+_0x1d2466[_0x19c4a3(0x162)](_0xe56452)+'\x20'+_0x51bc64):_0x712cf8[_0x19c4a3(0x164)](_0x51bc64+'\x20'+'\x20'[_0x19c4a3(0x154)](_0x5a0bf0)+'\x20'+_0x51bc64+'\x20'+_0x1d2466[_0x19c4a3(0x162)](_0xe56452)+'\x20'+_0x51bc64);});}),_0x712cf8[_0x5e9fcc(0x164)](colorBorder('└─'+'─'[_0x5e9fcc(0x154)](_0x5a0bf0)+_0x5e9fcc(0x144)+'─'[_0x5e9fcc(0x154)](_0xe56452)+'─┘',_0x57195a));_0x28896d&&(_0x712cf8[_0x5e9fcc(0x164)](''),_0x712cf8[_0x5e9fcc(0x164)](String(a44_0x405f3c[_0x5e9fcc(0x170)][_0x5e9fcc(0x15b)](_0x5e9fcc(0x15d)))),_0x712cf8[_0x5e9fcc(0x164)](_0x28896d));_0x431718&&(_0x712cf8[_0x5e9fcc(0x164)](''),_0x712cf8[_0x5e9fcc(0x164)](String(a44_0x405f3c[_0x5e9fcc(0x137)][_0x5e9fcc(0x15b)](_0x5e9fcc(0x133)))),_0x712cf8[_0x5e9fcc(0x164)](_0x431718));_0x2f909d&&(_0x712cf8[_0x5e9fcc(0x164)](''),_0x712cf8['push'](String(a44_0x405f3c[_0x5e9fcc(0x13d)][_0x5e9fcc(0x15b)](_0x5e9fcc(0x166)))),_0x712cf8['push'](_0x2f909d));if(_0x424b7b){if(_0x424b7b[_0x5e9fcc(0x178)]){_0x712cf8[_0x5e9fcc(0x164)](''),_0x712cf8[_0x5e9fcc(0x164)](String(a44_0x405f3c[_0x5e9fcc(0x131)]['bold'](_0x5e9fcc(0x136))));const _0x43aaaf=_0x424b7b[_0x5e9fcc(0x178)]['split']('\x0a');_0x43aaaf[_0x5e9fcc(0x13b)](_0x4b748a=>{const _0xe0814d=_0x5e9fcc;_0x4b748a['trim']()&&_0x712cf8[_0xe0814d(0x164)](_0x4b748a);});}if(_0x424b7b['cmdout']){_0x712cf8[_0x5e9fcc(0x164)](''),_0x712cf8[_0x5e9fcc(0x164)](String(a44_0x405f3c[_0x5e9fcc(0x171)][_0x5e9fcc(0x15b)](_0x5e9fcc(0x139))));const _0x3e9b67=_0x424b7b[_0x5e9fcc(0x14a)][_0x5e9fcc(0x16a)]('\x0a');_0x3e9b67[_0x5e9fcc(0x13b)](_0x53c453=>{const _0x98a71f=_0x5e9fcc;_0x53c453[_0x98a71f(0x167)]()&&_0x712cf8[_0x98a71f(0x164)](_0x53c453);});}}return _0x712cf8[_0x5e9fcc(0x15e)]('\x0a');}}}}function a44_0x3e55(){const _0x2bf097=['tsv','less','padEnd','noColor','push','535376Cyaiif','[rule]','trim','string','max','split','pipe','No\x20data','output','log','9kspbyk','yellow','cyan','-FXRSn','3917480hpTRwZ','isTTY','format','write','table','stderr','FINISHED','red','84582ltHRAo','[params]','query','rule','[error]','blue','double','[logs]','inherit','forEach','150533eIFCOp','magenta','isInteger','error','416801majFLL','20yyQvEQ','371216bNKfyf','debug','─┴─','spawn','stdout','2pyjveA','map','resolve','cmdout','sdk-result','limit','stdin','object','end','params','217NrXUNU','stringify','─┬─','repeat','length','boolean','jsonl','json','color','540279qZXxbI','bold','bigint','[query]','join','varchar'];a44_0x3e55=function(){return _0x2bf097;};return a44_0x3e55();}export async function handleSingleObjectOutput(_0x586180,_0x295692){const _0x2f187e=a44_0x2443;if(_0x295692[_0x2f187e(0x175)]==='table'){await handleSDKOutput([_0x586180],_0x295692);return;}const _0x1fe0bc=resolveOutputOptions(_0x295692),_0x3c74f6=await formatSingleObject(_0x586180,_0x1fe0bc);await writeOutput(_0x3c74f6,_0x1fe0bc['output']||undefined,_0x1fe0bc['format']);}
|