@treasuredata/tdx 0.16.13 → 0.16.14
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/llm-proxy.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/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/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/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/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_0x2fdd13=a42_0x2fc9;(function(_0x3784d6,_0x27d677){const _0x3a9355=a42_0x2fc9,_0x40aeba=_0x3784d6();while(!![]){try{const _0x56016a=-parseInt(_0x3a9355(0x22f))/0x1*(parseInt(_0x3a9355(0x12d))/0x2)+parseInt(_0x3a9355(0xc5))/0x3+parseInt(_0x3a9355(0x180))/0x4*(parseInt(_0x3a9355(0x1c8))/0x5)+-parseInt(_0x3a9355(0x238))/0x6*(-parseInt(_0x3a9355(0x1d7))/0x7)+parseInt(_0x3a9355(0x221))/0x8+-parseInt(_0x3a9355(0x216))/0x9+-parseInt(_0x3a9355(0xa3))/0xa*(-parseInt(_0x3a9355(0x1b7))/0xb);if(_0x56016a===_0x27d677)break;else _0x40aeba['push'](_0x40aeba['shift']());}catch(_0x12c9ee){_0x40aeba['push'](_0x40aeba['shift']());}}}(a42_0x2cb8,0xc9d98));import a42_0x350d9e from'chalk';import{existsSync}from'fs';function a42_0x2cb8(){const _0x76812=['Select\x20a\x20task\x20to\x20view\x20logs:','\x20-\x20','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','unchanged','✔\x20Clone\x20complete','\x20sessions\x20','\x0a✔\x20No\x20changes\x20to\x20push','\x20(use\x20--limit\x20to\x20show\x20more)','readFile','newProjectId','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Invalid\x20format:\x20','✔\x20Push\x20complete','parse','sourceProjectName','Source\x20project:\x20','✔\x20Found\x20','\x20\x20Workflow:\x20','\x0a✔\x20Already\x20up\x20to\x20date','green','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','log','/attempt/','indexOf','projects','sessions','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','📋\x20','yes','ICON_WIDTH','window','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Show\x20tasks\x20for\x20an\x20attempt','localeCompare','workflow:projects','\x20attempt','Loading\x20sessions...','select','updatedAt','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','download','startsWith','newProjectName','title','execute','workflow:secrets:list','\x20workflow','new','metadata','renderTimeline','sessionId','attempt:','\x20(system)','trim','Resume\x20from:\x20','POLL_INTERVAL_MS','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Status:\x20','startedAt','Getting\x20attempt\x20details...','duration','blue','\x20\x20Revision:\x20','Usage:\x20tdx\x20wf\x20use\x20<project>','reason','logFiles','parseProjectWorkflowPattern','kill','Filter:\x20project=','workflow:download','10584FOawmi','Session\x20not\x20found:\x20','No\x20workflow\x20tdx.json\x20found','Total:\x20','map','resolve','executePushProject','\x20session','all','rows','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','path','skipValidation','workflows','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','message','\x20\x20Project\x20ID:\x20','push','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','diff','Target\x20directory:\x20','running','fromTask','Source\x20directory:\x20','Analyzing\x20changes...','/app/workflows/','displayLine','targetDir','existingProjectId','name','toISOString','\x20has\x20no\x20attempts','\x20\x20Project:\x20','✔\x20Project:\x20','Task\x20name:\x20','No\x20attempts\x20found\x20for:\x20','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','sourceDir','startTime','Listing\x20workflow\x20sessions...','cwd','includeSubtasks','from','Cancelled','icon','Project\x20name\x20is\x20required','Error:\x20Attempt\x20ID\x20is\x20required','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','No\x20workflows\x20found','includes','planned','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','45991zXdPZo','padStart','projectId','getMonth','No\x20attempts\x20found','Listing\x20secrets...','revision:\x20','sort','Key:\x20','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','set','isArray','\x20task','\x20tasks','List\x20workflow\x20execution\x20sessions','list','Start\x20a\x20workflow\x20run','1395wHzAOV','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Expected\x20format:\x20--param\x20key=value','\x0aUpdate\x20existing\x20project\x20\x22','\x22\x20to\x20new\x20project\x20\x22','start','\x20to\x20see\x20detailed\x20logs','session:','Kill\x20a\x20running\x20attempt','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','\x20unchanged','delete','Loading\x20session...','min','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','117103izskMM','tdx\x20wf\x20attempt\x20','projectName','Using\x20attempt\x20','From\x20task:\x20','cancelRequested','hasChanges','changes','replace','Include\x20retried:\x20yes','\x27\x20from\x20project\x20\x27','site','verbose','🔄\x20','match','No\x20sessions\x20found\x20for:\x20','Fetching\x20log\x20files...','isDirectory','Validation:\x20skipped','Project\x20directory:\x20','logs','fill','\x20is\x20not\x20a\x20directory','dim','\x20secret','\x0a⚠\x20Project\x20\x22','deleted','msPerChar','.\x20Expected\x20format:\x20KEY=VALUE','LABEL_WIDTH_DIVISOR','resolveProjectDir','value','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Resolving\x20project\x20\x27','split','✔\x20New\x20project:\x20','showWorkflowConsoleUrl','Usage:\x20workflow:delete\x20<project-name-or-id>','MAX_TASKS_DISPLAY','LABEL_MIN_SPACING','session_id','text','\x22\x20with\x20new\x20revision?','output','fileSize','stat','Pushing\x20workflow\x20project...','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','unknown','force','✔\x20Secret\x20\x27','No\x20workflow\x20projects\x20found','fullName','isTTY','workflow:clone','workflow:retry','getTime','canceling','No\x20sessions\x20with\x20timing\x20information','MAX_POLL_ITERATIONS','getFullYear','values','Killing\x20attempt...','6111054dLkVAp','modified','group_error','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','relative','✔\x20Deleted\x20project\x20','stdout','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','...','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','workflow:workflows','3693752yneBsN','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','columns','workflow:sessions','Project\x20name:\x20','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','retrySession','Revision:\x20','getDate','yellow','resolveProjectId','state','renderSessionsTimeline','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','6785njJIRS','New\x20project\x20name:\x20','Deleting\x20secret...','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','✔\x20Project\x20updated','Select\x20a\x20workflow\x20to\x20run','✔\x20Retry\x20started','(unknown)','filesExtracted','168cYODlj','\x20\x20Session\x20ID:\x20','find','key','session','✔\x20Pull\x20complete','preparePushProject','status','resolveProject','Force:\x20yes','Getting\x20attempt\x20tasks...','MAX_LABEL_COUNT','max','task','params','workflow:logs','\x20\x20Session\x20context\x20set\x20to:\x20','Filter:\x20','No\x20sessions\x20found\x20in\x20project:\x20','Retrying\x20attempt...','Files\x20to\x20upload:\x20','workflow:pull','autocomplete','\x20\x20Target:\x20','workflow:use','\x0aPush\x20these\x20changes?','Session\x20','slice','880mJLWDG','Project:\x20','Attempt\x20ID:\x20','\x20logs','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','renderSingleTimeline','project','data','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Dry\x20run:\x20yes','Session\x20time:\x20','Latest\x20session\x20has\x20no\x20attempt','\x1b[1A\x1b[2K','generateSessionTimelineRows','attempt','context','workflow','Params:\x20','revision','Project\x20filter:\x20','splice','description','\x20\x20Changes:\x20','No\x20matching\x20sessions\x20found','MIN_LABEL_COUNT','✔\x20Workflow\x20project\x20context\x20cleared.','\x0aFailed\x20to\x20fetch\x20attempt\x20data','workflow:attempts','round','red','Auto-selected\x20latest\x20session:\x20','workflow:timeline','buildTimelineData','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','2052012tkcMYa','requireProject','Setting\x20secret...','Listing\x20workflow\x20projects...','run','format','Error:\x20KEY=VALUE\x20is\x20required','\x20of\x20','Error:\x20Invalid\x20parameter\x20format:\x20','limit','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','pollTimeline','getHours','now','substring','error','has','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Key\x20cannot\x20be\x20empty','getMinutes','dryRun','📁\x20','length','Analyzing\x20project...','cyan','jsonl','filter','repeat','workflow:attempt','\x20\x20Source:\x20','\x0aApply\x20these\x20changes?','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','createdAt','Error:\x20Invalid\x20JSON\x20in\x20--params','Cloning\x20to\x20','finishedAt','end','trimEnd','attemptId','\x0aDry\x20run\x20-\x20nothing\x20pushed','fs/promises','Pull\x20workflow\x20project\x20to\x20local\x20folder','Select\x20a\x20session\x20to\x20view\x20timeline:','follow','\x20\x20Location:\x20','Parameters:\x20','Warning:','\x20modified','\x22?\x20This\x20cannot\x20be\x20undone.','success','lastAttempt','ICON_SPACING','MAX_TIMELINE_WIDTH','List\x20all\x20workflow\x20projects','Target:\x20','Attempt:\x20','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','tdx.json','sessionTime','\x20\x20Console:\x20','write','join','listSecrets','targetExists','pending','/sessions/','setSecret','\x20new','white','param','List\x20workflow\x20attempts','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','\x20project','summary','Error:','workflow:push','done','No\x20log\x20content\x20found','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','index','total','✔\x20Downloaded\x20','List\x20workflows','\x20\x20tdx\x20wf\x20use\x20<project>','GUTTER','floor','type','Pattern:\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Error:\x20Project\x20name\x20is\x20required','---\x20','workflowProject','size','workflow:kill','✔\x20Workflow\x20project\x20set\x20to:\x20','Pushing\x20project...','Source\x20directory\x20is\x20required','utf-8','workflow:secrets:set','table','keys','every','tasks','358cFxzUO','navigateSessionsInteractive','Pulling\x20project\x20','json','\x20\x20Files\x20extracted:\x20','Starting\x20workflow\x20run...','workflowName','\x20deleted','Source:\x20','No\x20workflow\x20sessions\x20found','Failed\x20to\x20fetch\x20attempt\x20data','Deleting\x20project\x20','✔\x20Showing\x20'];a42_0x2cb8=function(){return _0x76812;};return a42_0x2cb8();}import a42_0x2a9db0 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a42_0x1cf71e from'prompts';function getAttemptStatusDisplay(_0x3b74a5){const _0x4c4408=a42_0x2fc9;if(!_0x3b74a5)return{'icon':'⏳','text':''};const {done:_0x4212d2,success:_0x17ccaa,cancelRequested:_0x4e6f7f}=_0x3b74a5;if(!_0x4212d2)return _0x4e6f7f?{'icon':'🛑','text':a42_0x350d9e[_0x4c4408(0x22a)]('canceling')}:{'icon':'🔄','text':a42_0x350d9e[_0x4c4408(0x177)]('running')};if(_0x17ccaa)return{'icon':'✅','text':a42_0x350d9e[_0x4c4408(0x14d)](_0x4c4408(0xf7))};return{'icon':'❌','text':a42_0x350d9e[_0x4c4408(0xc0)](_0x4c4408(0xd4))};}export class WorkflowBaseCommand extends BaseCommand{[a42_0x2fdd13(0x240)](_0x381ecb,_0x3eaa34,_0x5c78ed=0x0){const _0x34bb8d=a42_0x2fdd13;return _0x381ecb[_0x5c78ed]||_0x3eaa34[_0x34bb8d(0x121)];}[a42_0x2fdd13(0xc6)](_0xa33590,_0x3e3e64,_0x4c9adb=0x0){const _0x10e4fb=a42_0x2fdd13,_0x537f11=this['resolveProject'](_0xa33590,_0x3e3e64,_0x4c9adb);if(!_0x537f11)return console[_0x10e4fb(0xd4)](a42_0x350d9e[_0x10e4fb(0xc0)](_0x10e4fb(0x110)),'Project\x20name\x20is\x20required'),console[_0x10e4fb(0xd4)](a42_0x350d9e[_0x10e4fb(0x1ee)](_0x10e4fb(0x21d))),null;return _0x537f11;}[a42_0x2fdd13(0x17c)](_0x1dcc24,_0x158a0a){const _0x1543d5=a42_0x2fdd13;if(_0x1dcc24[0x0]){const _0x4aba92=_0x1dcc24[0x0][_0x1543d5(0x1f9)]('.');if(_0x4aba92['length']===0x1)return{'projectName':_0x4aba92[0x0],'workflowName':undefined};else return _0x4aba92[_0x1543d5(0xdb)]===0x2?{'projectName':_0x4aba92[0x0],'workflowName':_0x4aba92[0x1]}:(console[_0x1543d5(0xd4)](a42_0x350d9e[_0x1543d5(0xc0)]('Error:'),_0x1543d5(0x11e)),null);}return{'projectName':_0x158a0a[_0x1543d5(0x121)],'workflowName':undefined};}[a42_0x2fdd13(0x1f5)](_0x2ffd53,_0x177299,_0x4c612b=0x0){const _0x3a8575=a42_0x2fdd13;if(_0x2ffd53[_0x4c612b])return _0x2ffd53[_0x4c612b];if(_0x177299[_0x3a8575(0x121)]){const _0x405235=a42_0x2a9db0[_0x3a8575(0x103)](process[_0x3a8575(0x1aa)](),_0x3a8575(0x18d),_0x177299[_0x3a8575(0x121)]);if(existsSync(a42_0x2a9db0[_0x3a8575(0x103)](_0x405235,_0x3a8575(0xff))))return _0x405235;}return undefined;}async[a42_0x2fdd13(0x1fb)](_0x5d4416,_0x455d4d,_0x4c71aa){const _0x2036e9=a42_0x2fdd13;try{const _0x5e2870=await _0x5d4416['workflow'][_0x2036e9(0x18d)](_0x455d4d,{'limit':0x1});if(_0x5e2870[_0x2036e9(0xdb)]>0x0){const _0x51f0c5=_0x5e2870[0x0]['id'],_0xfca45b=getWorkflowUrl(_0x4c71aa,_0x51f0c5);console[_0x2036e9(0xd4)]('\x20\x20Console:\x20'+a42_0x350d9e[_0x2036e9(0xdd)](_0xfca45b));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a42_0x2fdd13(0x9f);[a42_0x2fdd13(0xb8)]=a42_0x2fdd13(0x114);async['execute'](_0x4ab061){const _0x10c060=a42_0x2fdd13,{options:_0x463bc9,args:_0x2c8317,tdx:_0x132d01}=_0x4ab061,_0x5768f2=_0x2c8317[0x0],_0x21d706=_0x463bc9['clear'];if(_0x21d706)return saveSessionContext({'workflow_project':undefined},_0x463bc9['session']),console[_0x10c060(0x14f)](a42_0x350d9e[_0x10c060(0x14d)](_0x10c060(0xbc))),0x0;if(!_0x5768f2)return console['error'](a42_0x350d9e[_0x10c060(0xc0)](_0x10c060(0x110)),'Project\x20name\x20is\x20required'),console['error'](a42_0x350d9e[_0x10c060(0x1ee)](_0x10c060(0x179))),console[_0x10c060(0xd4)](a42_0x350d9e[_0x10c060(0x1ee)](_0x10c060(0xd6))),0x1;const _0x3428c1=await withSpinner(_0x10c060(0x1f8)+_0x5768f2+'\x27...',()=>_0x132d01[_0x10c060(0xb3)][_0x10c060(0x22b)](_0x5768f2),{'verbose':_0x463bc9['verbose']}),{name:_0x40d301}=_0x3428c1['data'];return saveSessionContext({'workflow_project':_0x40d301},_0x463bc9[_0x10c060(0x23c)]),console[_0x10c060(0x14f)](a42_0x350d9e[_0x10c060(0x14d)](_0x10c060(0x124)+a42_0x350d9e[_0x10c060(0xdd)](_0x40d301))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a42_0x2fdd13(0x19f)]=a42_0x2fdd13(0x15c);['description']=a42_0x2fdd13(0xfb);async[a42_0x2fdd13(0x166)](_0x253a77){const _0x3fee86=a42_0x2fdd13,{options:_0x58d070,args:_0x497983,tdx:_0x5c0654}=_0x253a77,_0x493719=_0x497983[0x0];_0x58d070[_0x3fee86(0x1e3)]&&_0x493719&&console[_0x3fee86(0xd4)](_0x3fee86(0x11d)+_0x493719);const _0x97fed6=await withSpinner(_0x3fee86(0xc8),()=>_0x5c0654['workflow'][_0x3fee86(0x152)](_0x493719,{'limit':_0x58d070['limit']}),{'verbose':_0x58d070[_0x3fee86(0x1e3)]});let _0x124053=_0x97fed6['data'];_0x124053['sort']((_0x55122e,_0x206f2a)=>_0x55122e[_0x3fee86(0x19f)]['localeCompare'](_0x206f2a['name']));const _0x570cd4=_0x58d070[_0x3fee86(0xce)]||0x64,_0x3aa5c1=_0x124053[_0x3fee86(0xdb)]>=_0x570cd4?a42_0x350d9e[_0x3fee86(0x1ee)](_0x3fee86(0x141)):'';console[_0x3fee86(0xd4)](_0x3fee86(0x14a)+_0x124053[_0x3fee86(0xdb)]+_0x3fee86(0x10e)+(_0x124053['length']!==0x1?'s':'')+_0x3aa5c1);if(_0x58d070['format']===_0x3fee86(0x130)||_0x58d070[_0x3fee86(0xca)]===_0x3fee86(0xde)||_0x58d070[_0x3fee86(0xca)]===_0x3fee86(0x129))await handleSDKOutput(_0x124053,_0x58d070);else{if(_0x124053[_0x3fee86(0xdb)]===0x0)_0x493719?console['log']('No\x20projects\x20match\x20pattern:\x20'+_0x493719):console[_0x3fee86(0x14f)](_0x3fee86(0x20a));else{const _0x1e1955=_0x124053[_0x3fee86(0x184)](_0x4cb64c=>{const _0x51611b=_0x3fee86,_0x3ad067=_0x4cb64c[_0x51611b(0x16a)]?.['some'](_0x280d08=>_0x280d08[_0x51611b(0x23b)]==='sys'),_0x41d8cf=_0x3ad067?a42_0x350d9e[_0x51611b(0x1ee)](_0x51611b(0x16e)):'';return _0x51611b(0xda)+_0x4cb64c[_0x51611b(0x19f)]+_0x41d8cf;});await writeOutput(_0x1e1955[_0x3fee86(0x103)]('\x0a'),_0x58d070[_0x3fee86(0x202)],_0x3fee86(0x1c6));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a42_0x2fdd13(0x19f)]=a42_0x2fdd13(0x220);[a42_0x2fdd13(0xb8)]=a42_0x2fdd13(0x118);async[a42_0x2fdd13(0x166)](_0x43db48){const _0xe22bab=a42_0x2fdd13,{options:_0x5e2755,args:_0x5a9735,tdx:_0x12a791}=_0x43db48,_0x28e674=this['resolveProject'](_0x5a9735,_0x5e2755);_0x5e2755[_0xe22bab(0x1e3)]&&_0x28e674&&console[_0xe22bab(0xd4)](_0xe22bab(0xb6)+_0x28e674);const _0xe7b40a=await withSpinner('Listing\x20workflows...',()=>_0x12a791[_0xe22bab(0xb3)][_0xe22bab(0x18d)](_0x28e674,{'limit':_0x5e2755[_0xe22bab(0xce)]}),{'verbose':_0x5e2755['verbose']});let _0x528be8=_0xe7b40a[_0xe22bab(0xaa)];_0x528be8[_0xe22bab(0x1be)]((_0x430ff9,_0x4a509a)=>{const _0x223755=_0xe22bab,_0x11d6b3=_0x430ff9[_0x223755(0x19f)]['localeCompare'](_0x4a509a[_0x223755(0x19f)]);if(_0x11d6b3!==0x0)return _0x11d6b3;return(_0x430ff9[_0x223755(0xa9)]?.['name']||'')['localeCompare'](_0x4a509a[_0x223755(0xa9)]?.[_0x223755(0x19f)]||'');});const _0x56a9a6=_0x5e2755['limit']||0x64,_0x177a52=_0x528be8[_0xe22bab(0xdb)]>=_0x56a9a6?a42_0x350d9e[_0xe22bab(0x1ee)](_0xe22bab(0x141)):'';console[_0xe22bab(0xd4)](_0xe22bab(0x14a)+_0x528be8[_0xe22bab(0xdb)]+_0xe22bab(0x168)+(_0x528be8[_0xe22bab(0xdb)]!==0x1?'s':'')+_0x177a52);if(_0x5e2755['format']===_0xe22bab(0x130)||_0x5e2755[_0xe22bab(0xca)]===_0xe22bab(0xde)||_0x5e2755[_0xe22bab(0xca)]==='table')await handleSDKOutput(_0x528be8,_0x5e2755);else{if(_0x528be8[_0xe22bab(0xdb)]===0x0)_0x28e674?console['log']('No\x20workflows\x20found\x20in\x20project:\x20'+_0x28e674):console[_0xe22bab(0x14f)]('No\x20workflows\x20found');else{const _0x21d95e=_0x5e2755[_0xe22bab(0x1e2)],_0x445ecf=_0x528be8[_0xe22bab(0x184)](_0x5221e7=>{const _0x1ec720=_0xe22bab,_0x2f54bf=a42_0x350d9e[_0x1ec720(0x1ee)]('#'+_0x5221e7['id']),_0x309c68=hyperlink(_0x2f54bf,getWorkflowUrl(_0x21d95e,_0x5221e7['id'])),_0x58cdd1=_0x5221e7[_0x1ec720(0xa9)]?.['name']?a42_0x350d9e['dim']('\x20('+_0x5221e7[_0x1ec720(0xa9)][_0x1ec720(0x19f)]+')'):'';return _0x1ec720(0x155)+_0x309c68+'\x20'+_0x5221e7['name']+_0x58cdd1;});await writeOutput(_0x445ecf[_0xe22bab(0x103)]('\x0a'),_0x5e2755[_0xe22bab(0x202)],_0xe22bab(0x1c6));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a42_0x2fdd13(0x19f)]=a42_0x2fdd13(0x224);[a42_0x2fdd13(0xb8)]=a42_0x2fdd13(0x1c5);async['execute'](_0x2c2da6){const _0x3fcf7c=a42_0x2fdd13,{options:_0x132505,args:_0x1bf2a8,tdx:_0x4d72cf}=_0x2c2da6,_0x263f7e=this[_0x3fcf7c(0x17c)](_0x1bf2a8,_0x132505);if(!_0x263f7e)return 0x1;const {projectName:_0x21a0db,workflowName:_0x131f86}=_0x263f7e;if(_0x132505[_0x3fcf7c(0x1e3)]){if(_0x21a0db&&_0x131f86)console[_0x3fcf7c(0xd4)](_0x3fcf7c(0x249)+_0x21a0db+'.'+_0x131f86);else _0x21a0db&&console[_0x3fcf7c(0xd4)](_0x3fcf7c(0x17e)+_0x21a0db);const _0x1d4092=_0x132505[_0x3fcf7c(0x23f)];_0x1d4092&&console[_0x3fcf7c(0xd4)](_0x3fcf7c(0x173)+_0x1d4092);}let _0x5e5329=0x28;if(process['stdout']['isTTY']&&!_0x132505[_0x3fcf7c(0x202)]&&!_0x132505[_0x3fcf7c(0xca)]){const _0xbb3656=process['stdout']['rows']||0x28;_0x5e5329=Math[_0x3fcf7c(0x244)](0x14,Math[_0x3fcf7c(0x11b)](_0xbb3656*0x2/0x3));}const _0x40157c=_0x132505['limit']||_0x5e5329,_0x1a97c=await withSpinner(_0x3fcf7c(0x1a9),()=>_0x4d72cf[_0x3fcf7c(0xb3)][_0x3fcf7c(0x153)]({'projectName':_0x21a0db,'workflowName':_0x131f86,'status':_0x132505[_0x3fcf7c(0x23f)],'fromTime':_0x132505[_0x3fcf7c(0x1ac)],'toTime':_0x132505['to'],'limit':_0x40157c}),{'verbose':_0x132505['verbose']}),_0x21e47e=_0x1a97c[_0x3fcf7c(0xaa)];_0x21e47e[_0x3fcf7c(0x1be)]((_0x3f28fa,_0x26fd05)=>{const _0x3dd4f1=_0x3fcf7c,_0x5e8bb9=_0x3f28fa[_0x3dd4f1(0x100)]||'',_0x4bda54=_0x26fd05['sessionTime']||'';return _0x4bda54[_0x3dd4f1(0x15b)](_0x5e8bb9);});_0x21e47e[_0x3fcf7c(0xdb)]>=_0x40157c?console['error'](_0x3fcf7c(0x139)+_0x21e47e[_0x3fcf7c(0xdb)]+_0x3fcf7c(0x13f)+a42_0x350d9e[_0x3fcf7c(0x1ee)]('(use\x20--limit\x20to\x20see\x20more)')):console['error'](_0x3fcf7c(0x14a)+_0x21e47e['length']+_0x3fcf7c(0x187)+(_0x21e47e['length']!==0x1?'s':''));if(_0x132505[_0x3fcf7c(0xca)]==='json'||_0x132505['format']===_0x3fcf7c(0xde)||_0x132505[_0x3fcf7c(0xca)]==='table')await handleSDKOutput(_0x21e47e,_0x132505);else{if(!process[_0x3fcf7c(0x21c)][_0x3fcf7c(0x20c)]||_0x132505[_0x3fcf7c(0x202)]){if(_0x21e47e[_0x3fcf7c(0xdb)]===0x0){if(_0x21a0db&&_0x131f86)console[_0x3fcf7c(0x14f)](_0x3fcf7c(0x1e6)+_0x21a0db+'.'+_0x131f86);else _0x21a0db?console[_0x3fcf7c(0x14f)](_0x3fcf7c(0x24a)+_0x21a0db):console[_0x3fcf7c(0x14f)]('No\x20sessions\x20found');}else{const _0x1b4782=_0x132505['site'],_0x11f88e=this[_0x3fcf7c(0x22d)](_0x21e47e,_0x1b4782);_0x132505['output']?await writeOutput(_0x11f88e,_0x132505[_0x3fcf7c(0x202)],_0x3fcf7c(0x1c6)):console[_0x3fcf7c(0x14f)](_0x11f88e);}!_0x21a0db&&(console[_0x3fcf7c(0xd4)](''),console[_0x3fcf7c(0xd4)](a42_0x350d9e[_0x3fcf7c(0x1ee)](_0x3fcf7c(0x226))),console['error'](a42_0x350d9e['dim'](_0x3fcf7c(0x10d))+'or'+a42_0x350d9e[_0x3fcf7c(0x1ee)](_0x3fcf7c(0x119))));}else{if(_0x21e47e[_0x3fcf7c(0xdb)]===0x0){if(_0x21a0db&&_0x131f86)console['log'](_0x3fcf7c(0x1e6)+_0x21a0db+'.'+_0x131f86);else _0x21a0db?console[_0x3fcf7c(0x14f)](_0x3fcf7c(0x24a)+_0x21a0db):console['log']('No\x20sessions\x20found');}else await this[_0x3fcf7c(0x12e)](_0x21e47e,_0x2c2da6,_0x21a0db);}}return 0x0;}['renderSessionsTimeline'](_0x35f6da,_0x3c7e3e){const _0x3b3424=a42_0x2fdd13,_0x27e4a3=[],_0x3a36d5=new Map();let _0x3beebf=Infinity,_0x583706=-Infinity;for(const _0x32a149 of _0x35f6da){if(_0x32a149[_0x3b3424(0xf8)]?.[_0x3b3424(0xe6)]){const _0x116f03=new Date(_0x32a149['lastAttempt'][_0x3b3424(0xe6)])[_0x3b3424(0x20f)](),_0x193dd6=_0x32a149[_0x3b3424(0xf8)][_0x3b3424(0xe9)]?new Date(_0x32a149['lastAttempt']['finishedAt'])[_0x3b3424(0x20f)]():Date[_0x3b3424(0xd2)](),_0x1d1bb8=_0x32a149[_0x3b3424(0xa9)]?.[_0x3b3424(0x19f)]||_0x3b3424(0x236);!_0x3a36d5[_0x3b3424(0xd5)](_0x1d1bb8)&&_0x3a36d5[_0x3b3424(0x1c1)](_0x1d1bb8,[]),_0x3a36d5['get'](_0x1d1bb8)[_0x3b3424(0x192)]({'session':_0x32a149,'startTime':_0x116f03,'endTime':_0x193dd6,'duration':_0x193dd6-_0x116f03}),_0x3beebf=Math[_0x3b3424(0x1d5)](_0x3beebf,_0x116f03),_0x583706=Math[_0x3b3424(0x244)](_0x583706,_0x193dd6);}}if(_0x3a36d5[_0x3b3424(0x122)]===0x0)return _0x3b3424(0x211);const _0x24ac7e=process[_0x3b3424(0x21c)][_0x3b3424(0x223)]||0x78,_0xf80d07=0x1e,_0x91f104=0x32,_0x3ca211=0x4,_0x4e80de=Math[_0x3b3424(0x1d5)](_0x91f104,Math[_0x3b3424(0x244)](_0xf80d07,Math[_0x3b3424(0x11b)](_0x24ac7e*0.3))),_0x3bd670=_0x24ac7e-_0x4e80de-TIMELINE_CONFIG[_0x3b3424(0x11a)]-0x3-_0x3ca211,_0x2baec7=_0x583706-_0x3beebf,_0x4aa9af=_0x2baec7/_0x4e80de,_0x2faceb=renderTimeAxis({'startTime':_0x3beebf,'endTime':_0x583706,'durationMs':_0x2baec7,'msPerChar':_0x4aa9af},_0x4e80de),_0x12b585=[];for(const _0x25cf37 of _0x3a36d5[_0x3b3424(0x214)]()){_0x12b585[_0x3b3424(0x192)](..._0x25cf37);}_0x12b585['sort']((_0x51c391,_0x96edb0)=>_0x96edb0[_0x3b3424(0x1a8)]-_0x51c391[_0x3b3424(0x1a8)]);const _0xa45c39=new Date(_0x3beebf),_0x5d408b=formatDate(_0xa45c39),_0x5bc0e1=_0x3ca211+TIMELINE_CONFIG[_0x3b3424(0x157)]+TIMELINE_CONFIG['ICON_SPACING']+_0x3bd670,_0x1e36ba='\x20'[_0x3b3424(0xe0)](_0x5bc0e1-_0x5d408b[_0x3b3424(0xdb)]),_0x1a7df=_0x1e36ba+a42_0x350d9e['dim'](_0x5d408b)+'\x20'+_0x2faceb;_0x27e4a3['push'](_0x1a7df);const _0x830878=0x16;let _0x1ccfa4=0x0;for(const _0x43502a of _0x12b585){const _0x1a0f7a=_0x43502a['session']['project']?.['name']||'?',_0x56d953=Math[_0x3b3424(0x1d5)](stringWidth(_0x1a0f7a),_0x830878);_0x1ccfa4=Math[_0x3b3424(0x244)](_0x1ccfa4,_0x56d953);}for(const _0x561edc of _0x12b585){const {session:_0x4f9991,startTime:_0x3f51f1,endTime:_0x4abc51,duration:_0x41de11}=_0x561edc,_0x8874ac=_0x4f9991[_0x3b3424(0xa9)]?.['id'],_0x6afea4=_0x4f9991['id'],_0x2314b7=_0x4f9991[_0x3b3424(0xa9)]?.[_0x3b3424(0x19f)]||'?',_0x3377d4=_0x4f9991['workflow']?.['name']||'?';let _0x417bbe,_0x4bcd90;if(_0x4f9991['lastAttempt']){const _0x3ea921=_0x4f9991[_0x3b3424(0xf8)];!_0x3ea921[_0x3b3424(0x112)]?(_0x417bbe=_0x3ea921[_0x3b3424(0x1dc)]?'🛑':'🔄',_0x4bcd90=_0x3ea921['cancelRequested']?a42_0x350d9e[_0x3b3424(0x22a)]:a42_0x350d9e[_0x3b3424(0x177)]):(_0x417bbe=_0x3ea921[_0x3b3424(0xf7)]?'✅':'❌',_0x4bcd90=_0x3ea921['success']?a42_0x350d9e[_0x3b3424(0x14d)]:a42_0x350d9e['red']);}else _0x417bbe='⏳',_0x4bcd90=a42_0x350d9e['dim'];const _0x888825='#'+_0x6afea4,_0x5919df=_0x8874ac?hyperlink(_0x888825,getWorkflowSessionUrl(_0x3c7e3e,_0x8874ac,_0x6afea4)):_0x888825;let _0x192c17=_0x2314b7;stringWidth(_0x2314b7)>_0x830878&&(_0x192c17=_0x2314b7[_0x3b3424(0xa2)](0x0,_0x830878-0x1)+'…');const _0x10fcce=a42_0x350d9e[_0x3b3424(0x1ee)](_0x192c17),_0x2f223b=stringWidth(_0x192c17),_0x3bb12d='\x20'['repeat'](_0x1ccfa4-stringWidth(_0x192c17)+0x2),_0x5d6188='('+formatElapsed(_0x41de11)+')',_0x11cf33=stringWidth(_0x5d6188),_0x2a2db9=stringWidth(_0x888825),_0x2bb5ee=_0x2a2db9+0x1+_0x2f223b+_0x3bb12d[_0x3b3424(0xdb)],_0x20c465=_0x3bd670-_0x2bb5ee-_0x11cf33-0x1-0x8;let _0x45e238=_0x3377d4;stringWidth(_0x45e238)>_0x20c465&&(_0x45e238=_0x45e238[_0x3b3424(0xa2)](0x0,_0x20c465-0x1)+'…');const _0x2b50cd=_0x5919df+'\x20'+_0x10fcce+_0x3bb12d+_0x45e238,_0x22be91=stringWidth(_0x2b50cd),_0x8fe902=_0x3bd670-_0x22be91-_0x11cf33,_0x265eb7=_0x2b50cd+'\x20'['repeat'](Math[_0x3b3424(0x244)](0x1,_0x8fe902))+a42_0x350d9e[_0x3b3424(0x1ee)](_0x5d6188),_0x1ce376=Math[_0x3b3424(0x11b)]((_0x3f51f1-_0x3beebf)/_0x4aa9af),_0x209b33=Math[_0x3b3424(0x11b)]((_0x4abc51-_0x3beebf)/_0x4aa9af),_0x52b7e9=Math['max'](_0x1ce376+0x1,_0x209b33),_0x139820=new Array(_0x4e80de)['fill']('\x20');for(let _0x4d9f23=_0x1ce376;_0x4d9f23<Math[_0x3b3424(0x1d5)](_0x52b7e9,_0x4e80de);_0x4d9f23++){_0x139820[_0x4d9f23]='─';}const _0x34588d=_0x139820[_0x3b3424(0x184)](_0x319a14=>_0x319a14==='\x20'?'\x20':_0x4bcd90(_0x319a14))[_0x3b3424(0x103)]('');_0x27e4a3[_0x3b3424(0x192)](_0x417bbe+'\x20'+_0x265eb7+'│'+_0x34588d+'│');}return _0x27e4a3[_0x3b3424(0x103)]('\x0a');}async['navigateSessionsInteractive'](_0x13cc95,_0xf19b29,_0x5891ff){const _0x343b01=a42_0x2fdd13,{options:_0x3ce1f2,tdx:_0x1c4ca3}=_0xf19b29,_0x2d63af=_0x3ce1f2[_0x343b01(0x1e2)],{timelineRows:_0x2bd43b,timeAxisHeader:_0x5ef316}=this['generateSessionTimelineRows'](_0x13cc95,_0x2d63af),_0x4d1dd0=_0x2bd43b[_0x343b01(0xdf)](_0x9e9bcc=>_0x9e9bcc[_0x343b01(0xec)]);if(_0x4d1dd0[_0x343b01(0xdb)]===0x0){const _0x2f400b=this[_0x343b01(0x22d)](_0x13cc95,_0x2d63af);console[_0x343b01(0x14f)](_0x2f400b);!_0x5891ff&&(console['error'](''),console[_0x343b01(0xd4)](a42_0x350d9e[_0x343b01(0x1ee)](_0x343b01(0x226))),console[_0x343b01(0xd4)](a42_0x350d9e[_0x343b01(0x1ee)](_0x343b01(0x10d))+'or'+a42_0x350d9e[_0x343b01(0x1ee)](_0x343b01(0x119))));return;}_0x5ef316&&console[_0x343b01(0x14f)](_0x5ef316);const _0x3b5556=_0x2bd43b[_0x343b01(0xdf)](_0x25f682=>_0x25f682[_0x343b01(0xec)])['map'](_0x368a62=>({'title':_0x368a62[_0x343b01(0x19c)],'value':_0x368a62[_0x343b01(0xec)]})),_0x31f318=process['stdout'][_0x343b01(0x189)]||0x3c,_0x550a2c=Math[_0x343b01(0x244)](0x28,Math[_0x343b01(0x11b)](_0x31f318*0x2/0x3)),_0x34a057=await a42_0x1cf71e({'type':_0x343b01(0x9d),'name':'attemptId','message':_0x343b01(0x13c),'choices':_0x3b5556,'initial':-0x1,'limit':_0x550a2c,'clearFirst':!![],'fallback':{'title':_0x343b01(0xba),'value':null},'suggest':(_0x2e7f1e,_0x5e91f2)=>{const _0xd738bb=_0x343b01;if(!_0x2e7f1e)return Promise['resolve'](_0x5e91f2);const _0x2f66c4=_0x5e91f2['filter'](_0x1d94f2=>{const _0x3b3a07=a42_0x2fc9,_0x321695=_0x1d94f2;return _0x321695[_0x3b3a07(0x165)]['toLowerCase']()[_0x3b3a07(0x1b4)](_0x2e7f1e['toLowerCase']());});return Promise[_0xd738bb(0x185)](_0x2f66c4);}}),_0x45e21b=()=>{const _0x560bef=_0x343b01;process[_0x560bef(0x21c)][_0x560bef(0x102)](_0x560bef(0xaf)),process['stdout'][_0x560bef(0x102)](_0x560bef(0xaf)),process['stdout']['write']('\x1b[1A\x1b[2K');},_0x142344=_0x34a057&&_0x34a057[_0x343b01(0xec)]&&_0x34a057[_0x343b01(0xec)]!==null&&_0x34a057['attemptId'][_0x343b01(0x16f)]()!=='';if(!_0x142344){_0x45e21b(),console['log'](a42_0x350d9e[_0x343b01(0x1ee)]('Cancelled'));return;}_0x45e21b();const _0x2bface=_0x13cc95[_0x343b01(0x23a)](_0x3715a6=>_0x3715a6['lastAttempt']?.['id']===_0x34a057[_0x343b01(0xec)]);if(_0x2bface){const _0x349468=_0x2bface['project']?.[_0x343b01(0x19f)]||'?',_0x52e474=_0x2bface[_0x343b01(0xb3)]?.[_0x343b01(0x19f)]||'?';console[_0x343b01(0x14f)](_0x343b01(0xa4)+a42_0x350d9e[_0x343b01(0x1ee)](_0x349468)+',\x20Workflow:\x20'+a42_0x350d9e['dim'](_0x52e474));}const _0x1baddc=new WorkflowTimelineCommand();await _0x1baddc[_0x343b01(0x166)]({'args':[],'options':{..._0x3ce1f2,'attemptId':_0x34a057[_0x343b01(0xec)]},'tdx':_0x1c4ca3});}[a42_0x2fdd13(0xb0)](_0x24873e,_0x1a186e){const _0x43335c=a42_0x2fdd13,_0x3cc7a2=new Map();for(const _0xe50792 of _0x24873e){_0xe50792['id']&&_0xe50792['lastAttempt']?.['id']&&_0x3cc7a2['set'](_0xe50792['id'],_0xe50792[_0x43335c(0xf8)]['id']);}const _0x56c408=[];let _0x54f5b9='';const _0x4fae9f=this[_0x43335c(0x22d)](_0x24873e,_0x1a186e),_0x8bacfc=_0x4fae9f[_0x43335c(0x1f9)]('\x0a');for(const _0x1c70de of _0x8bacfc){if(_0x1c70de[_0x43335c(0x163)](_0x43335c(0x1a6))||_0x1c70de[_0x43335c(0x1e5)](/^\s+\d{4}-\d{2}-\d{2}/))_0x54f5b9=_0x1c70de;else{if(_0x1c70de[_0x43335c(0x1e5)](/^[✅❌🔄🛑⏳]/)){const _0xb46d6e=_0x1c70de[_0x43335c(0x1e5)](/#(\d+)/),_0x428eff=_0xb46d6e?_0xb46d6e[0x1]:null,_0x511ed0=_0x428eff?_0x3cc7a2['get'](_0x428eff)||null:null,_0x41bc92=_0x24873e[_0x43335c(0x23a)](_0x836410=>_0x836410['id']===_0x428eff),_0x3ba44f=_0x41bc92?.['project']?.[_0x43335c(0x19f)]||'';_0x56c408[_0x43335c(0x192)]({'displayLine':_0x1c70de,'attemptId':_0x511ed0,'projectName':_0x3ba44f});}}}return{'timelineRows':_0x56c408,'timeAxisHeader':_0x54f5b9};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a42_0x2fdd13(0x19f)]=a42_0x2fdd13(0xbe);['description']=a42_0x2fdd13(0x10c);async[a42_0x2fdd13(0x166)](_0x38d2ae){const _0x4cbbd5=a42_0x2fdd13,{options:_0x1d413d,args:_0x5a88f9,tdx:_0x405eb2}=_0x38d2ae,_0x3af905=this[_0x4cbbd5(0x17c)](_0x5a88f9,_0x1d413d);if(!_0x3af905)return 0x1;const {projectName:_0x1edb47,workflowName:_0x510f63}=_0x3af905,_0x160154=_0x1d413d['includeRetried'];if(_0x1d413d[_0x4cbbd5(0x1e3)]){if(_0x1edb47&&_0x510f63)console[_0x4cbbd5(0xd4)](_0x4cbbd5(0x249)+_0x1edb47+'.'+_0x510f63);else _0x1edb47&&console['error'](_0x4cbbd5(0x17e)+_0x1edb47);_0x160154&&console[_0x4cbbd5(0xd4)](_0x4cbbd5(0x1e0));}const _0x4890a8=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x405eb2[_0x4cbbd5(0xb3)]['attempts']({'projectName':_0x1edb47,'workflowName':_0x510f63,'includeRetried':_0x160154,'limit':_0x1d413d[_0x4cbbd5(0xce)]}),{'verbose':_0x1d413d[_0x4cbbd5(0x1e3)]}),_0x229a82=_0x4890a8[_0x4cbbd5(0xaa)],_0x5df1be=_0x1d413d['limit']||0x64,_0x45ed80=_0x229a82[_0x4cbbd5(0xdb)]>=_0x5df1be?a42_0x350d9e[_0x4cbbd5(0x1ee)](_0x4cbbd5(0x141)):'';console[_0x4cbbd5(0xd4)](_0x4cbbd5(0x14a)+_0x229a82['length']+_0x4cbbd5(0x15d)+(_0x229a82[_0x4cbbd5(0xdb)]!==0x1?'s':'')+_0x45ed80);if(_0x1d413d[_0x4cbbd5(0xca)]===_0x4cbbd5(0x130)||_0x1d413d[_0x4cbbd5(0xca)]===_0x4cbbd5(0xde)||_0x1d413d['format']===_0x4cbbd5(0x129))await handleSDKOutput(_0x229a82,_0x1d413d);else{if(_0x229a82['length']===0x0){if(_0x1edb47&&_0x510f63)console['log'](_0x4cbbd5(0x1a5)+_0x1edb47+'.'+_0x510f63);else _0x1edb47?console['log']('No\x20attempts\x20found\x20in\x20project:\x20'+_0x1edb47):console[_0x4cbbd5(0x14f)](_0x4cbbd5(0x1bb));}else{const _0x53926f=_0x1d413d[_0x4cbbd5(0x1e2)],_0x3c5208=_0x229a82['map'](_0x206161=>{const _0x129823=_0x4cbbd5,_0x3336c4=a42_0x350d9e[_0x129823(0x1ee)]('#'+_0x206161['id']),_0x297f93=_0x206161[_0x129823(0xa9)]?.['id'],_0x44e4e4=_0x206161[_0x129823(0x1ff)]||_0x206161['sessionId'],_0x1485f0=_0x297f93&&_0x44e4e4?hyperlink(_0x3336c4,getWorkflowAttemptUrl(_0x53926f,_0x297f93,_0x44e4e4,_0x206161['id'])):_0x3336c4,{icon:_0x1781c0,text:_0x73089b}=getAttemptStatusDisplay(_0x206161),_0x15c49a=(_0x206161[_0x129823(0xa9)]?.['name']||'?')+'.'+(_0x206161['workflow']?.['name']||'?'),_0x177ced=_0x206161[_0x129823(0x100)]?a42_0x350d9e[_0x129823(0x1ee)](_0x206161[_0x129823(0x100)]):'';return(_0x1485f0+'\x20'+_0x1781c0+(_0x73089b?'\x20'+_0x73089b:'')+'\x20'+_0x15c49a+'\x20'+_0x177ced)[_0x129823(0xeb)]();});await writeOutput(_0x3c5208[_0x4cbbd5(0x103)]('\x0a'),_0x1d413d['output'],_0x4cbbd5(0x1c6));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a42_0x2fdd13(0x19f)]=a42_0x2fdd13(0xe1);[a42_0x2fdd13(0xb8)]='Show\x20specific\x20attempt\x20details';async[a42_0x2fdd13(0x166)](_0x166a9d){const _0x3b7776=a42_0x2fdd13,{options:_0x44d3fe,args:_0xbcd9b6,tdx:_0x5507db}=_0x166a9d,_0x420d91=_0xbcd9b6[0x0];if(!_0x420d91)return console['error'](_0x3b7776(0x1b0)),0x1;_0x44d3fe['verbose']&&console['error'](_0x3b7776(0xa5)+_0x420d91);const _0x53a428=await withSpinner(_0x3b7776(0x175),()=>_0x5507db['workflow'][_0x3b7776(0xb1)](_0x420d91),{'verbose':_0x44d3fe[_0x3b7776(0x1e3)]}),_0x303579=_0x53a428['data'];let _0x4d008e;!_0x303579[_0x3b7776(0x112)]?_0x4d008e=_0x303579[_0x3b7776(0x1dc)]?_0x3b7776(0x210):_0x3b7776(0x197):_0x4d008e=_0x303579[_0x3b7776(0xf7)]?_0x3b7776(0xf7):_0x3b7776(0xd4);let _0x99a60a;if(_0x303579[_0x3b7776(0xe6)]&&_0x303579[_0x3b7776(0xe9)]){const _0x456feb=new Date(_0x303579[_0x3b7776(0xe6)])[_0x3b7776(0x20f)](),_0xafeb60=new Date(_0x303579[_0x3b7776(0xe9)])[_0x3b7776(0x20f)]();_0x99a60a=Math[_0x3b7776(0xbf)]((_0xafeb60-_0x456feb)/0x3e8);}const _0x334568={'attempt_id':_0x303579['id'],'status':_0x4d008e,..._0x303579['index']!==undefined&&{'index':_0x303579[_0x3b7776(0x115)]},..._0x303579[_0x3b7776(0xa9)]&&{'project':_0x303579['project']['name']},..._0x303579[_0x3b7776(0xb3)]&&{'workflow':_0x303579[_0x3b7776(0xb3)][_0x3b7776(0x19f)]},..._0x303579['sessionId']&&{'session_id':_0x303579[_0x3b7776(0x16c)]},..._0x303579['sessionTime']&&{'session_time':_0x303579[_0x3b7776(0x100)]},..._0x303579['retryAttemptName']&&{'retry_attempt':_0x303579['retryAttemptName']},..._0x99a60a!==undefined&&{'duration_sec':_0x99a60a},..._0x303579[_0x3b7776(0xe6)]&&{'created_at':_0x303579['createdAt']},..._0x303579['finishedAt']&&{'finished_at':_0x303579[_0x3b7776(0xe9)]},...Object[_0x3b7776(0x12a)](_0x303579['params'])[_0x3b7776(0xdb)]>0x0&&{'params':_0x303579[_0x3b7776(0x246)]}};return await handleSingleObjectOutput(_0x334568,_0x44d3fe),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a42_0x2fdd13(0x19f)]='workflow:tasks';['description']=a42_0x2fdd13(0x15a);async[a42_0x2fdd13(0x166)](_0x4d4805){const _0x40a1ed=a42_0x2fdd13,{options:_0x57388b,args:_0x1068c4,tdx:_0x5cd123}=_0x4d4805,_0x579fa8=_0x1068c4[0x0];if(!_0x579fa8)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x3859c5=_0x57388b[_0x40a1ed(0x1ab)];_0x57388b['verbose']&&(console[_0x40a1ed(0xd4)](_0x40a1ed(0xa5)+_0x579fa8),_0x3859c5&&console['error']('Including\x20subtasks:\x20yes'));const _0xa97292=await withSpinner(_0x40a1ed(0x242),()=>_0x5cd123[_0x40a1ed(0xb3)][_0x40a1ed(0x12c)](_0x579fa8,_0x3859c5||![]),{'verbose':_0x57388b[_0x40a1ed(0x1e3)]}),_0x26e309=_0xa97292[_0x40a1ed(0xaa)];return console[_0x40a1ed(0xd4)](_0x40a1ed(0x14a)+_0x26e309[_0x40a1ed(0xdb)]+_0x40a1ed(0x1c3)+(_0x26e309[_0x40a1ed(0xdb)]!==0x1?'s':'')),await handleSDKOutput(_0x26e309,_0x57388b),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a42_0x2fdd13(0x19f)]=a42_0x2fdd13(0x247);[a42_0x2fdd13(0xb8)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a42_0x2fdd13(0x166)](_0x4f6f62){const _0x3ca898=a42_0x2fdd13,{options:_0x34e32c,args:_0x4c80a7,tdx:_0x44f63c}=_0x4f6f62,_0x3acdc9=_0x4c80a7[0x0];let _0x400a31=_0x4c80a7[0x1];if(!_0x3acdc9)return console[_0x3ca898(0xd4)](_0x3ca898(0x1b0)),0x1;_0x34e32c['verbose']&&(console[_0x3ca898(0xd4)](_0x3ca898(0xa5)+_0x3acdc9),_0x400a31&&console[_0x3ca898(0xd4)](_0x3ca898(0x1a4)+_0x400a31));const _0x2e9780=await withSpinner(_0x3ca898(0x1e7),()=>_0x44f63c['workflow'][_0x3ca898(0x17b)](_0x3acdc9,_0x400a31),{'verbose':_0x34e32c[_0x3ca898(0x1e3)]}),_0x2158f5=_0x2e9780[_0x3ca898(0xaa)];if(_0x2158f5[_0x3ca898(0xdb)]===0x0)return console[_0x3ca898(0xd4)](_0x3ca898(0x193)),0x0;if(!_0x400a31&&(_0x34e32c[_0x3ca898(0x130)]||_0x34e32c[_0x3ca898(0xca)]))return await handleSDKOutput(_0x2158f5,_0x34e32c),0x0;if(!_0x400a31){const _0x464534=_0x2158f5[_0x3ca898(0x184)](_0x3cc658=>({'title':_0x3cc658['taskName']+'\x20('+formatBytes(_0x3cc658[_0x3ca898(0x203)])+')','value':_0x3cc658['taskName']})),_0x44a21d=await a42_0x1cf71e({'type':_0x3ca898(0x15f),'name':_0x3ca898(0x245),'message':_0x3ca898(0x13a),'choices':_0x464534});if(!_0x44a21d[_0x3ca898(0x245)])return console[_0x3ca898(0xd4)]('Cancelled'),0x0;_0x400a31=_0x44a21d[_0x3ca898(0x245)];}const _0x295e51=await withSpinner('Downloading\x20logs...',()=>_0x44f63c[_0x3ca898(0xb3)][_0x3ca898(0x1eb)](_0x3acdc9,_0x400a31),{'verbose':_0x34e32c['verbose']}),_0x3fc2f1=_0x295e51[_0x3ca898(0xaa)];return _0x3fc2f1?console['log'](_0x3fc2f1):console[_0x3ca898(0xd4)](_0x3ca898(0x113)),0x0;}}export class WorkflowKillCommand extends BaseCommand{['name']=a42_0x2fdd13(0x123);[a42_0x2fdd13(0xb8)]=a42_0x2fdd13(0x1d0);async[a42_0x2fdd13(0x166)](_0x314500){const _0x5e8fbc=a42_0x2fdd13,{options:_0x53337d,args:_0x1d1a0d,tdx:_0x179bbc}=_0x314500,_0x357402=_0x1d1a0d[0x0];if(!_0x357402)return console[_0x5e8fbc(0xd4)](_0x5e8fbc(0x1b0)),0x1;const _0x5187c8=_0x53337d[_0x5e8fbc(0x17a)];_0x53337d[_0x5e8fbc(0x1e3)]&&(console[_0x5e8fbc(0xd4)](_0x5e8fbc(0xa5)+_0x357402),_0x5187c8&&console[_0x5e8fbc(0xd4)]('Reason:\x20'+_0x5187c8));if(!_0x53337d[_0x5e8fbc(0x156)]){const _0x221925=await confirmKey(_0x5e8fbc(0x161)+_0x357402+'?');if(!_0x221925)return console[_0x5e8fbc(0xd4)]('Cancelled'),0x0;}const _0x3cbe73=await withSpinner(_0x5e8fbc(0x215),()=>_0x179bbc[_0x5e8fbc(0xb3)][_0x5e8fbc(0x17d)](_0x357402,_0x5187c8),{'verbose':_0x53337d['verbose']}),_0x29ec98=_0x3cbe73[_0x5e8fbc(0xaa)];return console[_0x5e8fbc(0xd4)]('✔\x20'+_0x29ec98),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a42_0x2fdd13(0x19f)]=a42_0x2fdd13(0x20e);[a42_0x2fdd13(0xb8)]='Retry\x20a\x20session\x20or\x20attempt';async[a42_0x2fdd13(0x166)](_0x3c65d2){const _0x365fc8=a42_0x2fdd13,{options:_0x3e5133,args:_0x75572b,tdx:_0x16108b}=_0x3c65d2,_0x194541=_0x75572b[0x0];if(!_0x194541)return console[_0x365fc8(0xd4)](_0x365fc8(0x1c9)),console[_0x365fc8(0xd4)](_0x365fc8(0x154)),0x1;let _0x55bbe6=![],_0x3a333a=_0x194541;if(_0x194541[_0x365fc8(0x163)](_0x365fc8(0x1cf)))_0x55bbe6=!![],_0x3a333a=_0x194541[_0x365fc8(0xd3)](0x8);else{if(_0x194541[_0x365fc8(0x163)](_0x365fc8(0x16d)))_0x55bbe6=![],_0x3a333a=_0x194541[_0x365fc8(0xd3)](0x8);else return console[_0x365fc8(0xd4)](_0x365fc8(0xe4)),console['error'](_0x365fc8(0x154)),0x1;}const _0x5ae304=_0x3e5133[_0x365fc8(0x198)],_0x36150e=_0x3e5133['resumeFrom'],_0x1838fa=_0x3e5133[_0x365fc8(0x246)],_0x5b4ddb=_0x3e5133[_0x365fc8(0x208)];_0x3e5133[_0x365fc8(0x1e3)]&&(console[_0x365fc8(0xd4)](_0x365fc8(0xfc)+(_0x55bbe6?_0x365fc8(0x23c):_0x365fc8(0xb1))+'\x20'+_0x3a333a),_0x5ae304&&console[_0x365fc8(0xd4)](_0x365fc8(0x1db)+_0x5ae304),_0x36150e&&console[_0x365fc8(0xd4)](_0x365fc8(0x170)+_0x36150e),_0x1838fa&&console['error'](_0x365fc8(0xb4)+_0x1838fa),_0x5b4ddb&&console[_0x365fc8(0xd4)](_0x365fc8(0x241)));let _0x215b5d;if(_0x1838fa)try{if(_0x1838fa['startsWith']('@')){const _0x516536=await import(_0x365fc8(0xee)),_0x119153=_0x1838fa['substring'](0x1),_0x46a93b=await _0x516536[_0x365fc8(0x142)](_0x119153,_0x365fc8(0x127));_0x215b5d=JSON[_0x365fc8(0x147)](_0x46a93b);}else _0x215b5d=JSON[_0x365fc8(0x147)](_0x1838fa);}catch{return console['error'](_0x365fc8(0xe7)),0x1;}if(!_0x3e5133['yes']){const _0x1f0fd9=await confirmKey(_0x365fc8(0xa7)+(_0x55bbe6?_0x365fc8(0x23c):'attempt')+'\x20'+_0x3a333a+'?');if(!_0x1f0fd9)return console[_0x365fc8(0xd4)](_0x365fc8(0x1ad)),0x0;}let _0x59e836;_0x55bbe6?_0x59e836=await withSpinner('Retrying\x20session...',()=>_0x16108b[_0x365fc8(0xb3)][_0x365fc8(0x227)](_0x3a333a,{'fromTask':_0x5ae304,'retryParams':_0x215b5d}),{'verbose':_0x3e5133['verbose']}):_0x59e836=await withSpinner(_0x365fc8(0x9a),()=>_0x16108b[_0x365fc8(0xb3)]['retryAttempt'](_0x3a333a,{'resumeFrom':_0x36150e,'retryParams':_0x215b5d,'force':_0x5b4ddb}),{'verbose':_0x3e5133['verbose']});const _0x25891c=_0x59e836[_0x365fc8(0xaa)];return console[_0x365fc8(0xd4)](_0x365fc8(0x235)),console[_0x365fc8(0xd4)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x25891c[_0x365fc8(0xec)]),console[_0x365fc8(0xd4)](_0x365fc8(0x239)+_0x25891c[_0x365fc8(0x16c)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a42_0x2fdd13(0x19f)]='workflow:run';[a42_0x2fdd13(0xb8)]=a42_0x2fdd13(0x1c7);async[a42_0x2fdd13(0x166)](_0x514222){const _0x1ef438=a42_0x2fdd13,{options:_0xcfcbea,args:_0x3ee9d8,tdx:_0x779657}=_0x514222;let _0x20823d=_0x3ee9d8[0x0];if(!_0x20823d){const _0xaa43ce=this[_0x1ef438(0x240)]([],_0xcfcbea),_0xc5eed8=await withSpinner('Loading\x20workflows...',()=>_0x779657[_0x1ef438(0xb3)][_0x1ef438(0x18d)](_0xaa43ce,{'limit':_0xcfcbea[_0x1ef438(0xce)]}),{'verbose':_0xcfcbea[_0x1ef438(0x1e3)]}),_0x2ff180=_0xc5eed8[_0x1ef438(0xaa)];if(_0x2ff180['length']===0x0)return console['error'](_0x1ef438(0x1b3)),!_0xaa43ce&&console[_0x1ef438(0xd4)](a42_0x350d9e['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x2cd2da=_0x2ff180[_0x1ef438(0x184)](_0x19a03e=>({'title':_0x19a03e[_0x1ef438(0xa9)]?.[_0x1ef438(0x19f)]+'.'+_0x19a03e[_0x1ef438(0x19f)],'value':_0x19a03e['project']?.[_0x1ef438(0x19f)]+'.'+_0x19a03e[_0x1ef438(0x19f)],'description':_0x19a03e['revision']?_0x1ef438(0x1bd)+_0x19a03e['revision']:undefined})),_0xb709f4=await a42_0x1cf71e({'type':_0x1ef438(0x15f),'name':_0x1ef438(0xb3),'message':_0x1ef438(0x234),'choices':_0x2cd2da});if(!_0xb709f4[_0x1ef438(0xb3)])return 0x1;_0x20823d=_0xb709f4[_0x1ef438(0xb3)];}if(!_0x20823d[_0x1ef438(0x1b4)]('.')){const _0x3b71f9=this[_0x1ef438(0x240)]([],_0xcfcbea);if(_0x3b71f9)_0x20823d=_0x3b71f9+'.'+_0x20823d;else return console[_0x1ef438(0xd4)](a42_0x350d9e['red'](_0x1ef438(0x110)),_0x1ef438(0x21f)),console['error'](a42_0x350d9e[_0x1ef438(0x1ee)](_0x1ef438(0x21d))),0x1;}const _0x4cdf08=_0xcfcbea[_0x1ef438(0x10b)],_0x20ac68=_0xcfcbea[_0x1ef438(0x100)],_0x16ebf8={};if(_0x4cdf08&&Array[_0x1ef438(0x1c2)](_0x4cdf08))for(const _0x1720b8 of _0x4cdf08){const _0x2a542e=_0x1720b8[_0x1ef438(0x151)]('=');if(_0x2a542e===-0x1)return console['error'](_0x1ef438(0xcd)+_0x1720b8),console['error'](_0x1ef438(0x1ca)),0x1;const _0x1ddce2=_0x1720b8[_0x1ef438(0xd3)](0x0,_0x2a542e),_0x2f3ef2=_0x1720b8[_0x1ef438(0xd3)](_0x2a542e+0x1);try{_0x16ebf8[_0x1ddce2]=JSON[_0x1ef438(0x147)](_0x2f3ef2);}catch{_0x16ebf8[_0x1ddce2]=_0x2f3ef2;}}_0xcfcbea[_0x1ef438(0x1e3)]&&(console['error']('Workflow:\x20'+_0x20823d),Object[_0x1ef438(0x12a)](_0x16ebf8)['length']>0x0&&console['error'](_0x1ef438(0xf3)+JSON['stringify'](_0x16ebf8)),_0x20ac68&&console[_0x1ef438(0xd4)](_0x1ef438(0xad)+_0x20ac68));const _0x29e0b0=await withSpinner(_0x1ef438(0x132),()=>_0x779657[_0x1ef438(0xb3)][_0x1ef438(0xc9)](_0x20823d,_0x16ebf8,{'sessionTime':_0x20ac68}),{'verbose':_0xcfcbea[_0x1ef438(0x1e3)]}),_0x513d94=_0x29e0b0[_0x1ef438(0xaa)];console[_0x1ef438(0xd4)]('✔\x20Workflow\x20run\x20started'),console[_0x1ef438(0xd4)]('\x20\x20Attempt\x20ID:\x20'+_0x513d94['id']),console[_0x1ef438(0xd4)](_0x1ef438(0x239)+_0x513d94[_0x1ef438(0x16c)]),console[_0x1ef438(0xd4)](_0x1ef438(0x1a2)+_0x513d94[_0x1ef438(0xa9)]?.[_0x1ef438(0x19f)]),console['error'](_0x1ef438(0x14b)+_0x513d94[_0x1ef438(0xb3)]?.['name']);if(_0x513d94[_0x1ef438(0xa9)]?.['id']&&_0x513d94[_0x1ef438(0x16c)]&&_0x513d94['id']){const _0x446d64=_0xcfcbea['site'],_0x2a6b1a=getConsoleUrl(_0x446d64,_0x1ef438(0x19b)+_0x513d94[_0x1ef438(0xa9)]['id']+_0x1ef438(0x107)+_0x513d94[_0x1ef438(0x16c)]+_0x1ef438(0x150)+_0x513d94['id']);console['error'](_0x1ef438(0x101)+a42_0x350d9e[_0x1ef438(0xdd)](_0x2a6b1a));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a42_0x2fdd13(0x19f)]=a42_0x2fdd13(0x17f);[a42_0x2fdd13(0xb8)]=a42_0x2fdd13(0xcf);async[a42_0x2fdd13(0x166)](_0x55ccc1){const _0x5e5aee=a42_0x2fdd13,{options:_0x214080,args:_0x108f89,tdx:_0x5465d7}=_0x55ccc1,_0x2455a0=_0x108f89[0x0],_0x5e743=_0x108f89[0x1]||'.';if(!_0x2455a0)return console['error'](_0x5e5aee(0x11f)),console['error'](_0x5e5aee(0x14e)),0x1;const _0x3af736=_0x214080[_0x5e5aee(0xb5)];_0x214080['verbose']&&(console[_0x5e5aee(0xd4)](_0x5e5aee(0xa4)+_0x2455a0),console[_0x5e5aee(0xd4)]('Output\x20directory:\x20'+_0x5e743),_0x3af736&&console[_0x5e5aee(0xd4)](_0x5e5aee(0x228)+_0x3af736));const _0x48a723=await withSpinner('Downloading\x20project\x20'+_0x2455a0+'...',()=>_0x5465d7[_0x5e5aee(0xb3)][_0x5e5aee(0x162)](_0x2455a0,_0x5e743,{'revision':_0x3af736}),{'verbose':_0x214080['verbose']}),_0x49f7db=_0x48a723[_0x5e5aee(0xaa)];return console[_0x5e5aee(0xd4)](_0x5e5aee(0x117)+_0x49f7db['projectName']),console[_0x5e5aee(0xd4)](_0x5e5aee(0x178)+_0x49f7db['revision']),console[_0x5e5aee(0xd4)](_0x5e5aee(0x131)+_0x49f7db[_0x5e5aee(0x237)]),console[_0x5e5aee(0xd4)](_0x5e5aee(0xf2)+_0x5e743+'/'+_0x49f7db[_0x5e5aee(0x1d9)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a42_0x2fdd13(0x19f)]='workflow:upload';[a42_0x2fdd13(0xb8)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async[a42_0x2fdd13(0x166)](_0xfe2965){const _0x38eb51=a42_0x2fdd13,{options:_0x3f6866,args:_0x9145c5,tdx:_0x22de37}=_0xfe2965;let _0x562724='.',_0x2f7663=_0x3f6866[_0x38eb51(0x19f)];if(_0x9145c5[0x0]){const {promises:_0x501759}=await import('fs');try{const _0x5267f4=await _0x501759[_0x38eb51(0x204)](_0x9145c5[0x0]);if(_0x5267f4[_0x38eb51(0x1e8)]())_0x562724=_0x9145c5[0x0];else return console[_0x38eb51(0xd4)]('Error:\x20'+_0x9145c5[0x0]+_0x38eb51(0x1ed)),0x1;}catch{_0x2f7663=_0x9145c5[0x0],_0x562724='.';}}const _0x259a8d=_0x3f6866[_0x38eb51(0xb5)],_0x597176=_0x3f6866[_0x38eb51(0x18c)];_0x3f6866[_0x38eb51(0x1e3)]&&(console[_0x38eb51(0xd4)](_0x38eb51(0x1ea)+_0x562724),_0x2f7663&&console[_0x38eb51(0xd4)](_0x38eb51(0x225)+_0x2f7663),_0x259a8d&&console[_0x38eb51(0xd4)](_0x38eb51(0x228)+_0x259a8d),_0x597176&&console['error'](_0x38eb51(0x1e9)));const _0x3fba57=await withSpinner(_0x38eb51(0x205),()=>_0x22de37[_0x38eb51(0xb3)][_0x38eb51(0x192)](_0x562724,{'projectName':_0x2f7663,'revision':_0x259a8d,'skipValidation':_0x597176}),{'verbose':_0x3f6866['verbose']}),_0x3cebc5=_0x3fba57[_0x38eb51(0xaa)];return console['error']('✔\x20Pushed\x20'+_0x3cebc5[_0x38eb51(0x1d9)]),console[_0x38eb51(0xd4)](_0x38eb51(0x191)+_0x3cebc5[_0x38eb51(0x1b9)]),console[_0x38eb51(0xd4)](_0x38eb51(0x178)+_0x3cebc5[_0x38eb51(0xb5)]),await this[_0x38eb51(0x1fb)](_0x22de37,_0x3cebc5[_0x38eb51(0x1d9)],_0x3f6866[_0x38eb51(0x1e2)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a42_0x2fdd13(0x19f)]=a42_0x2fdd13(0x9c);[a42_0x2fdd13(0xb8)]=a42_0x2fdd13(0xef);async[a42_0x2fdd13(0x166)](_0x5a41ae){const _0x50c41a=a42_0x2fdd13,{options:_0x14f9b9,args:_0x3f2684,tdx:_0x3340ee}=_0x5a41ae,_0x152270=_0x3f2684[0x0],_0x5e874d=_0x3f2684[0x1];if(!_0x152270)return console[_0x50c41a(0xd4)](a42_0x350d9e['red'](_0x50c41a(0x110)),_0x50c41a(0x1af)),console['error'](a42_0x350d9e[_0x50c41a(0x1ee)](_0x50c41a(0xfe))),0x1;const _0x15d2b0=_0x14f9b9[_0x50c41a(0xb5)];_0x14f9b9['verbose']&&(console[_0x50c41a(0xd4)](_0x50c41a(0xa4)+_0x152270),_0x5e874d&&console['error'](_0x50c41a(0x196)+_0x5e874d),_0x15d2b0&&console[_0x50c41a(0xd4)](_0x50c41a(0x228)+_0x15d2b0),_0x14f9b9[_0x50c41a(0xd9)]&&console['error'](_0x50c41a(0xac)));const _0x2abb27=await withSpinner(_0x50c41a(0x12f)+_0x152270+_0x50c41a(0x21e),()=>_0x3340ee[_0x50c41a(0xb3)]['pullProject'](_0x152270,{'targetDir':_0x5e874d,'revision':_0x15d2b0}),{'verbose':_0x14f9b9['verbose']}),_0x3bf00d=_0x2abb27[_0x50c41a(0xaa)];_0x3bf00d['isNewProject']?console[_0x50c41a(0xd4)](_0x50c41a(0x1fa)+_0x3bf00d[_0x50c41a(0x1d9)]):console[_0x50c41a(0xd4)](_0x50c41a(0x1a3)+_0x3bf00d[_0x50c41a(0x1d9)]);console['error'](_0x50c41a(0x178)+_0x3bf00d[_0x50c41a(0xb5)]),console[_0x50c41a(0xd4)](_0x50c41a(0x9e)+(a42_0x2a9db0['relative'](process[_0x50c41a(0x1aa)](),_0x3bf00d[_0x50c41a(0x19d)])||'.')),console[_0x50c41a(0xd4)](_0x50c41a(0xb9)+a42_0x350d9e[_0x50c41a(0x14d)]('+'+_0x3bf00d['summary']['new']+_0x50c41a(0x109))+',\x20'+(a42_0x350d9e[_0x50c41a(0x22a)]('~'+_0x3bf00d['summary']['modified']+_0x50c41a(0xf5))+',\x20')+(a42_0x350d9e[_0x50c41a(0xc0)]('-'+_0x3bf00d[_0x50c41a(0x10f)][_0x50c41a(0x1f1)]+_0x50c41a(0x134))+',\x20')+(''+a42_0x350d9e[_0x50c41a(0x1ee)](_0x3bf00d[_0x50c41a(0x10f)][_0x50c41a(0x13d)]+_0x50c41a(0x1d2))));for(const _0x660628 of _0x3bf00d[_0x50c41a(0x1de)]){_0x660628[_0x50c41a(0x11c)]==='modified'&&_0x660628[_0x50c41a(0x195)]&&(console['error']('\x0a'+a42_0x350d9e[_0x50c41a(0xdd)](_0x50c41a(0x120)+_0x660628['path'])),console[_0x50c41a(0xd4)](_0x660628['diff']));}if(!_0x3bf00d[_0x50c41a(0x1dd)])return saveSessionContext({'workflow_project':_0x3bf00d[_0x50c41a(0x1d9)]},_0x14f9b9[_0x50c41a(0x23c)]),console[_0x50c41a(0xd4)](a42_0x350d9e[_0x50c41a(0x14d)](_0x50c41a(0x14c))),console[_0x50c41a(0xd4)](a42_0x350d9e[_0x50c41a(0x1ee)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x3bf00d['projectName'])),0x0;if(_0x14f9b9[_0x50c41a(0xd9)])return console[_0x50c41a(0xd4)](a42_0x350d9e['yellow']('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x14f9b9['yes']){const _0x5864e6=await confirmKey(_0x50c41a(0xe3));if(!_0x5864e6)return console[_0x50c41a(0xd4)](_0x50c41a(0x1ad)),0x0;}await withSpinner('Writing\x20files...',()=>_0x3340ee['workflow']['applyPullProject'](_0x3bf00d,{'revision':_0x15d2b0}),{'verbose':_0x14f9b9['verbose']}),saveSessionContext({'workflow_project':_0x3bf00d[_0x50c41a(0x1d9)]},_0x14f9b9[_0x50c41a(0x23c)]),console[_0x50c41a(0xd4)](a42_0x350d9e[_0x50c41a(0x14d)](_0x50c41a(0x23d)));const _0x4d9176=a42_0x2a9db0[_0x50c41a(0x21a)](process['cwd'](),_0x3bf00d[_0x50c41a(0x19d)])||'.';return console[_0x50c41a(0xd4)](a42_0x350d9e['dim'](_0x50c41a(0xf2)+_0x4d9176)),console[_0x50c41a(0xd4)](a42_0x350d9e['dim'](_0x50c41a(0x248)+_0x3bf00d[_0x50c41a(0x1d9)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a42_0x2fdd13(0x19f)]=a42_0x2fdd13(0x111);[a42_0x2fdd13(0xb8)]=a42_0x2fdd13(0x194);async[a42_0x2fdd13(0x166)](_0x423f81){const _0x289830=a42_0x2fdd13,{options:_0x4df4af,args:_0x27d37b,tdx:_0x2b49e2}=_0x423f81,_0x4f84c9=this[_0x289830(0x1f5)](_0x27d37b,_0x4df4af),_0x3e364d=_0x4df4af['revision'],_0x4eeeb7=_0x4df4af[_0x289830(0x18c)];_0x4df4af[_0x289830(0x1e3)]&&(_0x4f84c9&&console[_0x289830(0xd4)](_0x289830(0x199)+_0x4f84c9),_0x3e364d&&console['error']('Revision:\x20'+_0x3e364d),_0x4df4af['dryRun']&&console[_0x289830(0xd4)]('Dry\x20run:\x20yes'),_0x4eeeb7&&console[_0x289830(0xd4)](_0x289830(0x1e9)));let _0x190bd3;try{_0x190bd3=await withSpinner(_0x289830(0x19a),()=>_0x2b49e2[_0x289830(0xb3)][_0x289830(0x23e)]({'sourceDir':_0x4f84c9,'revision':_0x3e364d,'skipValidation':_0x4eeeb7}),{'verbose':_0x4df4af['verbose']});}catch(_0x18e881){if(_0x18e881 instanceof Error&&_0x18e881[_0x289830(0x190)]['includes'](_0x289830(0x182)))return console['error'](a42_0x350d9e[_0x289830(0xc0)](_0x289830(0x110)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x4df4af['workflowProject']?console[_0x289830(0xd4)](a42_0x350d9e['dim']('Tip:\x20cd\x20to\x20workflows/'+_0x4df4af['workflowProject']+_0x289830(0x232)+_0x4df4af[_0x289830(0x121)]+'\x27')):console[_0x289830(0xd4)](a42_0x350d9e['dim']('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x18e881;}const _0x570ec9=_0x190bd3[_0x289830(0xaa)];console[_0x289830(0xd4)](_0x289830(0x1a3)+_0x570ec9[_0x289830(0x1d9)]),console[_0x289830(0xd4)](_0x289830(0xe2)+_0x570ec9['sourceDir']),console[_0x289830(0xd4)](_0x289830(0x178)+_0x570ec9[_0x289830(0xb5)]),console[_0x289830(0xd4)]('\x20\x20Changes:\x20'+a42_0x350d9e[_0x289830(0x14d)]('+'+_0x570ec9['summary'][_0x289830(0x169)]+_0x289830(0x109))+',\x20'+(a42_0x350d9e['yellow']('~'+_0x570ec9['summary'][_0x289830(0x217)]+_0x289830(0xf5))+',\x20')+(a42_0x350d9e[_0x289830(0xc0)]('-'+_0x570ec9[_0x289830(0x10f)][_0x289830(0x1f1)]+_0x289830(0x134))+',\x20')+(''+a42_0x350d9e['dim'](_0x570ec9[_0x289830(0x10f)][_0x289830(0x13d)]+'\x20unchanged')));for(const _0x572345 of _0x570ec9[_0x289830(0x1de)]){_0x572345[_0x289830(0x11c)]===_0x289830(0x217)&&_0x572345[_0x289830(0x195)]&&(console[_0x289830(0xd4)]('\x0a'+a42_0x350d9e[_0x289830(0xdd)](_0x289830(0x120)+_0x572345[_0x289830(0x18b)])),console[_0x289830(0xd4)](_0x572345[_0x289830(0x195)]));}if(!_0x570ec9[_0x289830(0x1dd)])return console[_0x289830(0xd4)](a42_0x350d9e[_0x289830(0x14d)](_0x289830(0x140))),await this['showWorkflowConsoleUrl'](_0x2b49e2,_0x570ec9[_0x289830(0x1d9)],_0x4df4af['site']),0x0;if(_0x4df4af[_0x289830(0xd9)])return console[_0x289830(0xd4)](a42_0x350d9e['yellow'](_0x289830(0xed))),0x0;if(!_0x4df4af[_0x289830(0x156)]){const _0x36437d=await confirmKey(_0x289830(0xa0));if(!_0x36437d)return console[_0x289830(0xd4)](_0x289830(0x1ad)),0x0;}const _0x3434fa=await withSpinner(_0x289830(0x125),()=>_0x2b49e2['workflow'][_0x289830(0x186)](_0x570ec9),{'verbose':_0x4df4af['verbose']}),_0x34ead2=_0x3434fa[_0x289830(0xaa)];return console[_0x289830(0xd4)](a42_0x350d9e['green'](_0x289830(0x146))),console[_0x289830(0xd4)](_0x289830(0x191)+_0x34ead2[_0x289830(0x1b9)]),console[_0x289830(0xd4)](_0x289830(0x178)+_0x34ead2[_0x289830(0xb5)]),await this[_0x289830(0x1fb)](_0x2b49e2,_0x34ead2['projectName'],_0x4df4af[_0x289830(0x1e2)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a42_0x2fdd13(0x19f)]=a42_0x2fdd13(0x20d);[a42_0x2fdd13(0xb8)]=a42_0x2fdd13(0x1d1);async[a42_0x2fdd13(0x166)](_0x33f925){const _0x509cf8=a42_0x2fdd13,{options:_0x147b88,args:_0x27303d,tdx:_0x24689d}=_0x33f925,_0x333af0=this[_0x509cf8(0x1f5)](_0x27303d,_0x147b88),_0x4f4086=_0x147b88['name'],_0x5b9f06=_0x147b88[_0x509cf8(0xb5)],_0x33f6c5=_0x147b88['skipValidation'];if(!_0x333af0)return console[_0x509cf8(0xd4)](a42_0x350d9e['red'](_0x509cf8(0x110)),_0x509cf8(0x126)),console[_0x509cf8(0xd4)](a42_0x350d9e[_0x509cf8(0x1ee)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x509cf8(0xd4)](a42_0x350d9e[_0x509cf8(0x1ee)](_0x509cf8(0x219))),0x1;if(!_0x4f4086)return console[_0x509cf8(0xd4)](a42_0x350d9e['red'](_0x509cf8(0x110)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x509cf8(0xd4)](a42_0x350d9e[_0x509cf8(0x1ee)](_0x509cf8(0x159))),0x1;_0x147b88['verbose']&&(console['error'](_0x509cf8(0x199)+_0x333af0),console['error'](_0x509cf8(0x230)+_0x4f4086),_0x5b9f06&&console['error']('Revision:\x20'+_0x5b9f06),_0x147b88[_0x509cf8(0xd9)]&&console[_0x509cf8(0xd4)]('Dry\x20run:\x20yes'),_0x33f6c5&&console[_0x509cf8(0xd4)](_0x509cf8(0x1e9)));const _0x462768=await withSpinner(_0x509cf8(0xdc),()=>_0x24689d[_0x509cf8(0xb3)]['prepareCloneProject'](_0x333af0,_0x4f4086,{'revision':_0x5b9f06,'skipValidation':_0x33f6c5}),{'verbose':_0x147b88['verbose']}),_0x5de88a=_0x462768[_0x509cf8(0xaa)];console['error'](_0x509cf8(0x135)+_0x5de88a[_0x509cf8(0x1a7)]);_0x5de88a[_0x509cf8(0x148)]&&console[_0x509cf8(0xd4)](_0x509cf8(0x149)+_0x5de88a[_0x509cf8(0x148)]);console[_0x509cf8(0xd4)]('New\x20project\x20name:\x20'+_0x5de88a[_0x509cf8(0x164)]),console[_0x509cf8(0xd4)](_0x509cf8(0x228)+_0x5de88a[_0x509cf8(0xb5)]),console[_0x509cf8(0xd4)](_0x509cf8(0x9b)+_0x5de88a['fileCount']);_0x5de88a[_0x509cf8(0x105)]&&(console[_0x509cf8(0xd4)](a42_0x350d9e[_0x509cf8(0x22a)](_0x509cf8(0x1f0)+_0x5de88a[_0x509cf8(0x164)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x5de88a[_0x509cf8(0x19e)]+')')),console[_0x509cf8(0xd4)](a42_0x350d9e[_0x509cf8(0x22a)](_0x509cf8(0x18f))));if(_0x147b88[_0x509cf8(0xd9)])return console[_0x509cf8(0xd4)](a42_0x350d9e[_0x509cf8(0x22a)]('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x147b88[_0x509cf8(0x156)]){const _0x483f14=_0x5de88a[_0x509cf8(0x148)]||a42_0x2a9db0['basename'](_0x333af0),_0x252877=_0x5de88a[_0x509cf8(0x105)]?_0x509cf8(0x1cb)+_0x4f4086+_0x509cf8(0x201):'\x0aClone\x20\x22'+_0x483f14+_0x509cf8(0x1cc)+_0x4f4086+'\x22?',_0x252eef=await confirmKey(_0x252877);if(!_0x252eef)return console[_0x509cf8(0xd4)]('Cancelled'),0x0;}const _0xa71e44=await withSpinner(_0x5de88a[_0x509cf8(0x105)]?'Updating\x20'+_0x4f4086+_0x509cf8(0x21e):_0x509cf8(0xe8)+_0x4f4086+_0x509cf8(0x21e),()=>_0x24689d[_0x509cf8(0xb3)]['executeCloneProject'](_0x5de88a),{'verbose':_0x147b88['verbose']}),_0x5537af=_0xa71e44[_0x509cf8(0xaa)];return console['error'](a42_0x350d9e[_0x509cf8(0x14d)](_0x5de88a[_0x509cf8(0x105)]?_0x509cf8(0x233):_0x509cf8(0x13e))),console['error'](_0x509cf8(0x1a2)+_0x5537af[_0x509cf8(0x164)]),console['error'](_0x509cf8(0x191)+_0x5537af[_0x509cf8(0x143)]),console[_0x509cf8(0xd4)](_0x509cf8(0x178)+_0x5537af[_0x509cf8(0xb5)]),await this[_0x509cf8(0x1fb)](_0x24689d,_0x5537af[_0x509cf8(0x164)],_0x147b88['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a42_0x2fdd13(0x19f)]='workflow:delete';[a42_0x2fdd13(0xb8)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a42_0x2fdd13(0x166)](_0x440fc7){const _0xccc431=a42_0x2fdd13,{options:_0x31f8e5,args:_0x23619a,tdx:_0x55afe2}=_0x440fc7,_0x4b13f9=_0x23619a[0x0];if(!_0x4b13f9)return console['error'](_0xccc431(0xab)),console['error'](_0xccc431(0x1fc)),0x1;_0x31f8e5['verbose']&&console['error'](_0xccc431(0xa4)+_0x4b13f9);if(!_0x31f8e5[_0xccc431(0x156)]){const _0x6deab8=await confirmKey(_0xccc431(0x222)+_0x4b13f9+_0xccc431(0xf6));if(!_0x6deab8)return console[_0xccc431(0xd4)](_0xccc431(0x1ad)),0x0;}const _0x1c2d51=await withSpinner(_0xccc431(0x138)+_0x4b13f9+_0xccc431(0x21e),()=>_0x55afe2['workflow'][_0xccc431(0x1d3)](_0x4b13f9),{'verbose':_0x31f8e5['verbose']}),_0x5d471a=_0x1c2d51[_0xccc431(0xaa)];return console[_0xccc431(0xd4)](_0xccc431(0x21b)+_0x5d471a[_0xccc431(0x1d9)]),console['error'](_0xccc431(0x191)+_0x5d471a[_0xccc431(0x1b9)]),0x0;}}export function parseKeyValue(_0x45d627){const _0x3db75b=a42_0x2fdd13,_0x4fd982=_0x45d627['indexOf']('=');if(_0x4fd982===-0x1)throw new Error(_0x3db75b(0x145)+_0x45d627+_0x3db75b(0x1f3));const _0x1635c4=_0x45d627[_0x3db75b(0xd3)](0x0,_0x4fd982),_0x50e0bd=_0x45d627[_0x3db75b(0xd3)](_0x4fd982+0x1);if(!_0x1635c4)throw new Error(_0x3db75b(0xd7));return{'key':_0x1635c4,'value':_0x50e0bd};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a42_0x2fdd13(0x19f)]=a42_0x2fdd13(0x167);['description']=a42_0x2fdd13(0x1b6);async[a42_0x2fdd13(0x166)](_0x33aa82){const _0x343900=a42_0x2fdd13,{options:_0x24133f,args:_0x2452d7,tdx:_0x4cd618}=_0x33aa82,_0x36df8a=this[_0x343900(0xc6)](_0x2452d7,_0x24133f);if(!_0x36df8a)return 0x1;_0x24133f[_0x343900(0x1e3)]&&console[_0x343900(0xd4)](_0x343900(0xa4)+_0x36df8a);const _0x590502=await withSpinner(_0x343900(0x1bc),()=>_0x4cd618[_0x343900(0xb3)][_0x343900(0x104)](_0x36df8a),{'verbose':_0x24133f[_0x343900(0x1e3)]}),{secrets:_0x4df75c}=_0x590502[_0x343900(0xaa)];return console[_0x343900(0xd4)]('✔\x20Found\x20'+_0x4df75c['length']+_0x343900(0x1ef)+(_0x4df75c[_0x343900(0xdb)]!==0x1?'s':'')),await handleSDKOutput(_0x4df75c,_0x24133f),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a42_0x2fdd13(0x19f)]=a42_0x2fdd13(0x128);['description']=a42_0x2fdd13(0x18a);async[a42_0x2fdd13(0x166)](_0x155448){const _0x227597=a42_0x2fdd13,{options:_0x4ec621,args:_0x414558,tdx:_0xeda02d}=_0x155448;let _0x1b4a07,_0x87e967;if(_0x414558[_0x227597(0xdb)]>=0x2)_0x1b4a07=_0x414558[0x0],_0x87e967=_0x414558[0x1];else{if(_0x414558[_0x227597(0xdb)]===0x1&&_0x4ec621[_0x227597(0x121)])_0x1b4a07=_0x4ec621[_0x227597(0x121)],_0x87e967=_0x414558[0x0];else return _0x414558[_0x227597(0xdb)]===0x1?(console['error'](_0x227597(0x11f)),console[_0x227597(0xd4)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console['error'](_0x227597(0xcb)),console[_0x227597(0xd4)](_0x227597(0xc4)),0x1);}let _0x1f69ea,_0x249d56;try{({key:_0x1f69ea,value:_0x249d56}=parseKeyValue(_0x87e967));}catch(_0x3d9b8d){return _0x3d9b8d instanceof Error&&console[_0x227597(0xd4)](a42_0x350d9e[_0x227597(0xc0)](_0x227597(0x110)),_0x3d9b8d[_0x227597(0x190)]),0x1;}_0x4ec621[_0x227597(0x1e3)]&&(console[_0x227597(0xd4)](_0x227597(0xa4)+_0x1b4a07),console[_0x227597(0xd4)](_0x227597(0x1bf)+_0x1f69ea));const _0xde9bd4=await withSpinner(_0x227597(0xc7),()=>_0xeda02d[_0x227597(0xb3)][_0x227597(0x108)](_0x1b4a07,_0x1f69ea,_0x249d56),{'verbose':_0x4ec621[_0x227597(0x1e3)]}),_0x1548f6=_0xde9bd4[_0x227597(0xaa)];return console[_0x227597(0xd4)](_0x227597(0x209)+_0x1548f6[_0x227597(0x23b)]+_0x227597(0x1f7)+_0x1548f6['projectName']+'\x27'),(_0x4ec621[_0x227597(0x130)]||_0x4ec621[_0x227597(0xde)])&&await handleSingleObjectOutput(_0x1548f6,_0x4ec621),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a42_0x2fdd13(0x19f)]='workflow:secrets:delete';[a42_0x2fdd13(0xb8)]=a42_0x2fdd13(0x144);async[a42_0x2fdd13(0x166)](_0x18960e){const _0x3e17b1=a42_0x2fdd13,{options:_0xac43b4,args:_0x1ea54d,tdx:_0x146c0f}=_0x18960e;let _0x43f632,_0x319707;if(_0x1ea54d[_0x3e17b1(0xdb)]>=0x2)_0x43f632=_0x1ea54d[0x0],_0x319707=_0x1ea54d[0x1];else{if(_0x1ea54d[_0x3e17b1(0xdb)]===0x1&&_0xac43b4[_0x3e17b1(0x121)])_0x43f632=_0xac43b4['workflowProject'],_0x319707=_0x1ea54d[0x0];else return _0x1ea54d[_0x3e17b1(0xdb)]===0x1?(console[_0x3e17b1(0xd4)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x3e17b1(0xd4)](_0x3e17b1(0x21d)),0x1):(console['error']('Error:\x20Secret\x20key\x20is\x20required'),console[_0x3e17b1(0xd4)](_0x3e17b1(0x206)),0x1);}_0xac43b4[_0x3e17b1(0x1e3)]&&(console[_0x3e17b1(0xd4)](_0x3e17b1(0xa4)+_0x43f632),console[_0x3e17b1(0xd4)]('Key:\x20'+_0x319707));if(!_0xac43b4[_0x3e17b1(0x156)]){const _0x189427=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x319707+_0x3e17b1(0x1e1)+_0x43f632+'\x27?');if(!_0x189427)return console[_0x3e17b1(0xd4)]('Cancelled'),0x0;}const _0x59f1fa=await withSpinner(_0x3e17b1(0x231),()=>_0x146c0f['workflow']['deleteSecret'](_0x43f632,_0x319707),{'verbose':_0xac43b4[_0x3e17b1(0x1e3)]}),_0x4637e7=_0x59f1fa['data'];return console['error'](_0x3e17b1(0x209)+_0x4637e7['key']+_0x3e17b1(0x18e)+_0x4637e7[_0x3e17b1(0x1d9)]+'\x27'),(_0xac43b4[_0x3e17b1(0x130)]||_0xac43b4['jsonl'])&&await handleSingleObjectOutput(_0x4637e7,_0xac43b4),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(_0x576d00){const _0x53a511=a42_0x2fdd13,_0x34cd9e=Math['floor'](_0x576d00/0x3e8),_0x15f8d5=Math[_0x53a511(0x11b)](_0x34cd9e/0x3c),_0xa6f7cd=Math[_0x53a511(0x11b)](_0x15f8d5/0x3c),_0x5dbf6f=Math[_0x53a511(0x11b)](_0xa6f7cd/0x18);if(_0x5dbf6f>0x0){const _0x5e104a=_0xa6f7cd%0x18;return _0x5e104a>0x0?_0x5dbf6f+'d\x20'+_0x5e104a+'h':_0x5dbf6f+'d';}else{if(_0xa6f7cd>0x0){const _0x4f97af=_0x15f8d5%0x3c;return _0x4f97af>0x0?_0xa6f7cd+'h\x20'+_0x4f97af+'m':_0xa6f7cd+'h';}else{if(_0x15f8d5>0x0){const _0x178949=_0x34cd9e%0x3c;return _0x178949>0x0?_0x15f8d5+'m\x20'+_0x178949+'s':_0x15f8d5+'m';}else return _0x34cd9e+'s';}}}function formatTimestamp(_0x5d492c,_0x2a6a4b){const _0x37d45a=a42_0x2fdd13,_0x293e9d=new Date(_0x5d492c),_0x38d9ae=String(_0x293e9d[_0x37d45a(0xd1)]())['padStart'](0x2,'0'),_0x466911=String(_0x293e9d[_0x37d45a(0xd8)]())['padStart'](0x2,'0'),_0x283bdb=_0x38d9ae+':'+_0x466911,_0x5f0714=_0x293e9d[_0x37d45a(0x213)]()===_0x2a6a4b[_0x37d45a(0x213)]()&&_0x293e9d[_0x37d45a(0x1ba)]()===_0x2a6a4b['getMonth']()&&_0x293e9d[_0x37d45a(0x229)]()===_0x2a6a4b['getDate']();if(_0x5f0714)return _0x283bdb;else{const _0x24554a=String(_0x293e9d[_0x37d45a(0x1ba)]()+0x1)[_0x37d45a(0x1b8)](0x2,'0'),_0x15ffb5=String(_0x293e9d[_0x37d45a(0x229)]())[_0x37d45a(0x1b8)](0x2,'0');return _0x24554a+'-'+_0x15ffb5+'\x20'+_0x283bdb;}}function a42_0x2fc9(_0x51b7d9,_0x13b707){_0x51b7d9=_0x51b7d9-0x9a;const _0x2cb8b0=a42_0x2cb8();let _0x2fc9f3=_0x2cb8b0[_0x51b7d9];return _0x2fc9f3;}function formatDate(_0x4a958a){const _0x5791d0=a42_0x2fdd13,_0x3c3192=_0x4a958a[_0x5791d0(0x213)](),_0x4412fc=String(_0x4a958a[_0x5791d0(0x1ba)]()+0x1)[_0x5791d0(0x1b8)](0x2,'0'),_0x2b8c5f=String(_0x4a958a['getDate']())[_0x5791d0(0x1b8)](0x2,'0');return _0x3c3192+'-'+_0x4412fc+'-'+_0x2b8c5f;}function getTaskStateIcon(_0x238237){const _0x4799da={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x4799da[_0x238237]||'⚪';}function getBarChar(_0x1d1fdf){const _0x5a102a=a42_0x2fdd13;return _0x1d1fdf===_0x5a102a(0xd4)||_0x1d1fdf===_0x5a102a(0x218)?'×':'─';}function getBarColor(_0x7bdf15){const _0x43a028=a42_0x2fdd13,_0x4c023c={'success':a42_0x350d9e[_0x43a028(0x14d)],'error':a42_0x350d9e[_0x43a028(0xc0)],'group_error':a42_0x350d9e['red'],'running':a42_0x350d9e['blue'],'blocked':a42_0x350d9e['yellow'],'planned':a42_0x350d9e[_0x43a028(0x1ee)],'canceling':a42_0x350d9e[_0x43a028(0x22a)]};return _0x4c023c[_0x7bdf15]||a42_0x350d9e[_0x43a028(0x10a)];}function parseTaskName(_0x5b1d13){const _0x2e4f35=a42_0x2fdd13;let _0x2176d4=_0x5b1d13[_0x2e4f35(0x1df)](/^\++/,'');const _0x3734b4=_0x2176d4[_0x2e4f35(0x1f9)]('+'),_0x2c0d69=_0x3734b4[_0x2e4f35(0xdb)]>0x1?_0x3734b4['length']-0x2:0x0,_0x46b699=_0x3734b4[_0x3734b4[_0x2e4f35(0xdb)]-0x1]||_0x2176d4;return{'level':_0x2c0d69,'name':'+'+_0x46b699};}function truncateTaskName(_0x38c32d,_0x5afce8){const _0x4e51f7=stringWidth(_0x38c32d);if(_0x4e51f7<=_0x5afce8)return _0x38c32d;let _0x42f32e=_0x38c32d;while(stringWidth(_0x42f32e+'…')>_0x5afce8&&_0x42f32e['length']>0x0){_0x42f32e=_0x42f32e['slice'](0x0,-0x1);}return _0x42f32e+'…';}function calculateTimeScale(_0x112041,_0x15c00e){const _0x132044=a42_0x2fdd13;return{'startTime':_0x112041[_0x132044(0x1cd)],'endTime':_0x112041[_0x132044(0xea)],'durationMs':_0x112041[_0x132044(0x176)],'msPerChar':_0x112041['duration']/_0x15c00e};}function timeToPosition(_0x863a79,_0x2e9d1e,_0x148f31){const _0x403dd6=a42_0x2fdd13,_0x2094a2=_0x863a79-_0x2e9d1e[_0x403dd6(0x1a8)],_0x2f4ade=Math[_0x403dd6(0x11b)](_0x2094a2/_0x2e9d1e[_0x403dd6(0x1f2)]);return Math[_0x403dd6(0x244)](0x0,Math[_0x403dd6(0x1d5)](_0x2f4ade,_0x148f31));}function renderTimeAxis(_0x6f5368,_0x54c75e){const _0x4f5542=a42_0x2fdd13,_0x478fcb=Math['min'](TIMELINE_CONFIG[_0x4f5542(0x243)],Math[_0x4f5542(0x244)](TIMELINE_CONFIG[_0x4f5542(0xbb)],Math[_0x4f5542(0x11b)](_0x54c75e/TIMELINE_CONFIG[_0x4f5542(0x1f4)]))),_0x4649f3=_0x6f5368['durationMs']/(_0x478fcb-0x1),_0x37c143=new Date(_0x6f5368[_0x4f5542(0x1a8)]),_0xdf4eed=[];for(let _0x362efd=0x0;_0x362efd<_0x478fcb;_0x362efd++){const _0x27a891=_0x6f5368[_0x4f5542(0x1a8)]+_0x362efd*_0x4649f3,_0x50bdc8=timeToPosition(_0x27a891,_0x6f5368,_0x54c75e),_0x476d81=formatTimestamp(_0x27a891,_0x37c143);_0xdf4eed['push']({'pos':_0x50bdc8,'text':_0x476d81});}const _0x273c81=new Array(_0x54c75e)[_0x4f5542(0x1ec)]('\x20');let _0x226038=-0x1;for(const {pos:_0x2e6da1,text:_0x4b7165}of _0xdf4eed){let _0x4354f1=Math[_0x4f5542(0x244)](0x0,_0x2e6da1-Math['floor'](_0x4b7165['length']/0x2));_0x4354f1<=_0x226038+TIMELINE_CONFIG[_0x4f5542(0x1fe)]&&(_0x4354f1=_0x226038+TIMELINE_CONFIG[_0x4f5542(0x1fe)]+0x1);_0x4354f1+_0x4b7165[_0x4f5542(0xdb)]>_0x54c75e&&(_0x4354f1=_0x54c75e-_0x4b7165[_0x4f5542(0xdb)]);if(_0x4354f1>=0x0&&_0x4354f1+_0x4b7165[_0x4f5542(0xdb)]<=_0x54c75e&&_0x4354f1>_0x226038){for(let _0x2d8ee4=0x0;_0x2d8ee4<_0x4b7165[_0x4f5542(0xdb)];_0x2d8ee4++){_0x273c81[_0x4354f1+_0x2d8ee4]=_0x4b7165[_0x2d8ee4];}_0x226038=_0x4354f1+_0x4b7165[_0x4f5542(0xdb)]-0x1;}}return _0x273c81[_0x4f5542(0x103)]('');}function renderTaskRow(_0x388c69,_0x20c00f,_0x14353f,_0x402b9e){const _0x1226c1=a42_0x2fdd13,{level:_0x31744a,name:_0x51e6e5}=parseTaskName(_0x388c69['name']),_0xf69313='\x20'['repeat'](_0x31744a),_0x5cfabb=_0x388c69[_0x1226c1(0x158)]?'('+formatElapsed(_0x388c69[_0x1226c1(0x158)]['duration'])+')':'',_0x214aae=stringWidth(_0x5cfabb),_0x191a39=_0x31744a*0x1,_0x3e82db=_0x402b9e-_0x191a39-_0x214aae-0x1,_0xad445b=truncateTaskName(_0x51e6e5,_0x3e82db),_0xfee8fa=_0xf69313+_0xad445b,_0x302be6=stringWidth(_0xfee8fa),_0x1c031d=_0x402b9e-_0x302be6-_0x214aae,_0x288e85=_0xfee8fa+'\x20'[_0x1226c1(0xe0)](Math['max'](0x1,_0x1c031d))+a42_0x350d9e[_0x1226c1(0x1ee)](_0x5cfabb),_0x11991e=getTaskStateIcon(_0x388c69['state']),_0x3072ff=new Array(_0x14353f)[_0x1226c1(0x1ec)]('\x20');if(_0x388c69[_0x1226c1(0x158)]){const _0x1690d3=timeToPosition(_0x388c69[_0x1226c1(0x158)][_0x1226c1(0x1cd)],_0x20c00f,_0x14353f),_0x3896fc=timeToPosition(_0x388c69[_0x1226c1(0x158)]['end'],_0x20c00f,_0x14353f),_0x38a117=getBarChar(_0x388c69[_0x1226c1(0x22c)]),_0x39a621=Math[_0x1226c1(0x244)](_0x1690d3+0x1,_0x3896fc);for(let _0x4c0af7=_0x1690d3;_0x4c0af7<Math['min'](_0x39a621,_0x14353f);_0x4c0af7++){_0x3072ff[_0x4c0af7]=_0x38a117;}}const _0xd5bc21=getBarColor(_0x388c69[_0x1226c1(0x22c)]),_0x522d4d=_0x3072ff[_0x1226c1(0x184)](_0x256b25=>_0x256b25==='\x20'?'\x20':_0xd5bc21(_0x256b25))[_0x1226c1(0x103)]('');return _0x11991e+'\x20'+_0x288e85+'│'+_0x522d4d+'│';}function calculateStats(_0x3ed1e7){const _0x2ed5fa=a42_0x2fdd13,_0x270a8a={'total':_0x3ed1e7['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x4ca1e5 of _0x3ed1e7){if(_0x4ca1e5['state']===_0x2ed5fa(0xf7))_0x270a8a['success']++;else{if(_0x4ca1e5[_0x2ed5fa(0x22c)]==='error'||_0x4ca1e5['state']===_0x2ed5fa(0x218))_0x270a8a[_0x2ed5fa(0xd4)]++;else _0x4ca1e5['state']===_0x2ed5fa(0x197)?_0x270a8a[_0x2ed5fa(0x197)]++:_0x270a8a['pending']++;}}return _0x270a8a;}function formatStats(_0x1c3e9e){const _0x179565=a42_0x2fdd13;return[_0x179565(0x183)+_0x1c3e9e[_0x179565(0x116)],'✅\x20'+_0x1c3e9e[_0x179565(0xf7)],'❌\x20'+_0x1c3e9e[_0x179565(0xd4)],_0x179565(0x1e4)+_0x1c3e9e['running'],'⏳\x20'+_0x1c3e9e[_0x179565(0x106)]][_0x179565(0x103)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a42_0x2fdd13(0x19f)]=a42_0x2fdd13(0xc2);[a42_0x2fdd13(0xb8)]=a42_0x2fdd13(0x1b2);async[a42_0x2fdd13(0x166)](_0x35c257){const _0x2e9b5d=a42_0x2fdd13,{options:_0x545ce1,args:_0x2444d3,tdx:_0x419bf0}=_0x35c257;let _0x56e1c7,_0x1322ee,_0x3e7421=![];if(_0x2444d3[0x0]){if(_0x2444d3[0x0][_0x2e9b5d(0x1b4)]('.')){const _0x3248c8=this[_0x2e9b5d(0x17c)](_0x2444d3,_0x545ce1);if(!_0x3248c8)return 0x1;_0x56e1c7=_0x3248c8[_0x2e9b5d(0x1d9)],_0x1322ee=_0x3248c8['workflowName'];}else{_0x1322ee=_0x2444d3[0x0],_0x56e1c7=_0x545ce1[_0x2e9b5d(0x121)];if(!_0x56e1c7)return console['error'](a42_0x350d9e['red'](_0x2e9b5d(0x110)),_0x2e9b5d(0x1d6)),0x1;_0x3e7421=!![];}}else{const _0x2a14af=this[_0x2e9b5d(0x17c)](_0x2444d3,_0x545ce1);if(!_0x2a14af)return 0x1;_0x56e1c7=_0x2a14af[_0x2e9b5d(0x1d9)],_0x1322ee=_0x2a14af[_0x2e9b5d(0x133)];}if(_0x545ce1['verbose']){if(_0x56e1c7&&_0x1322ee)console[_0x2e9b5d(0xd4)](_0x2e9b5d(0x249)+_0x56e1c7+'.'+_0x1322ee);else _0x56e1c7&&console['error']('Filter:\x20project='+_0x56e1c7);}const _0x1e7f61=_0x545ce1[_0x2e9b5d(0xec)],_0x53acf7=_0x545ce1[_0x2e9b5d(0x16c)];if(_0x1e7f61){_0x53acf7&&console['error'](a42_0x350d9e[_0x2e9b5d(0x22a)](_0x2e9b5d(0xf4)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x58c8c0=_0x545ce1[_0x2e9b5d(0xf1)];return _0x58c8c0?await this[_0x2e9b5d(0xd0)](_0x35c257,_0x1e7f61):await this['renderSingleTimeline'](_0x35c257,_0x1e7f61,_0x545ce1),0x0;}if(_0x53acf7){const _0x129c89=await withSpinner(_0x2e9b5d(0x1d4),()=>_0x419bf0[_0x2e9b5d(0xb3)][_0x2e9b5d(0x153)]({'projectName':_0x56e1c7,'workflowName':_0x1322ee,'limit':0x64}),{'verbose':_0x545ce1[_0x2e9b5d(0x1e3)]}),_0xb5492c=_0x129c89[_0x2e9b5d(0xaa)][_0x2e9b5d(0x23a)](_0x13f1ac=>_0x13f1ac['id']===_0x53acf7);if(!_0xb5492c)return console[_0x2e9b5d(0xd4)](a42_0x350d9e[_0x2e9b5d(0xc0)](_0x2e9b5d(0x110)),_0x2e9b5d(0x181)+_0x53acf7),0x1;if(!_0xb5492c[_0x2e9b5d(0xf8)]?.['id'])return console['error'](a42_0x350d9e[_0x2e9b5d(0xc0)](_0x2e9b5d(0x110)),_0x2e9b5d(0xa1)+_0x53acf7+_0x2e9b5d(0x1a1)),0x1;const _0x27a2c4=_0xb5492c[_0x2e9b5d(0xf8)]['id'];_0x545ce1['verbose']&&console[_0x2e9b5d(0xd4)](_0x2e9b5d(0x1da)+_0x27a2c4+'\x20from\x20session\x20'+_0x53acf7);const _0xed1486=_0x545ce1['follow'];return _0xed1486?await this['pollTimeline'](_0x35c257,_0x27a2c4):await this[_0x2e9b5d(0xa8)](_0x35c257,_0x27a2c4,_0x545ce1),0x0;}const _0x30c1aa=await withSpinner(_0x2e9b5d(0x15e),()=>_0x419bf0[_0x2e9b5d(0xb3)]['sessions']({'projectName':_0x56e1c7,'workflowName':_0x1322ee,'limit':_0x545ce1[_0x2e9b5d(0xce)]||0x32}),{'verbose':_0x545ce1[_0x2e9b5d(0x1e3)]}),_0x1829cd=_0x30c1aa['data'];if(_0x1829cd[_0x2e9b5d(0xdb)]===0x0){if(_0x56e1c7&&_0x1322ee)console[_0x2e9b5d(0xd4)]('No\x20sessions\x20found\x20for:\x20'+_0x56e1c7+'.'+_0x1322ee);else _0x56e1c7?console['error'](_0x2e9b5d(0x24a)+_0x56e1c7):(console[_0x2e9b5d(0xd4)](_0x2e9b5d(0x136)),console[_0x2e9b5d(0xd4)](a42_0x350d9e['dim'](_0x2e9b5d(0x1c0))));return 0x0;}_0x1829cd[_0x2e9b5d(0x1be)]((_0x45a210,_0x35583d)=>{const _0x162cc7=_0x2e9b5d,_0x1dbf2f=_0x45a210['sessionTime']||'',_0xed1ca1=_0x35583d[_0x162cc7(0x100)]||'';return _0xed1ca1[_0x162cc7(0x15b)](_0x1dbf2f);});if(_0x545ce1[_0x2e9b5d(0x130)]||_0x545ce1[_0x2e9b5d(0xde)])return await handleSDKOutput(_0x1829cd,_0x545ce1),0x0;let _0x193a75;if(_0x3e7421){const _0x4a88ae=_0x1829cd[0x0];if(!_0x4a88ae[_0x2e9b5d(0xf8)]?.['id'])return console[_0x2e9b5d(0xd4)](_0x2e9b5d(0xae)),0x0;_0x193a75=_0x4a88ae[_0x2e9b5d(0xf8)]['id'],_0x545ce1[_0x2e9b5d(0x1e3)]&&console[_0x2e9b5d(0xd4)](_0x2e9b5d(0xc1)+_0x4a88ae['sessionTime']);}else{const _0x455bcd=_0x1829cd['map'](_0x240e75=>{const _0x2944c6=_0x2e9b5d,_0x28df81=getAttemptStatusDisplay(_0x240e75['lastAttempt']);return{'title':_0x240e75['project']?.[_0x2944c6(0x19f)]+'.'+_0x240e75[_0x2944c6(0xb3)]?.['name']+'\x20-\x20'+_0x240e75[_0x2944c6(0x100)]+'\x20'+_0x28df81[_0x2944c6(0x1ae)],'value':_0x240e75[_0x2944c6(0xf8)]?.['id']||'','description':_0x28df81[_0x2944c6(0x200)]};}),_0x2b9d32=await a42_0x1cf71e({'type':_0x2e9b5d(0x15f),'name':_0x2e9b5d(0xec),'message':_0x2e9b5d(0xf0),'choices':_0x455bcd[_0x2e9b5d(0xdf)](_0x54445d=>_0x54445d[_0x2e9b5d(0x1f6)]!=='')});if(!_0x2b9d32[_0x2e9b5d(0xec)])return 0x0;_0x193a75=_0x2b9d32[_0x2e9b5d(0xec)];}const _0x44de11=_0x545ce1[_0x2e9b5d(0xf1)];return _0x44de11?await this[_0x2e9b5d(0xd0)](_0x35c257,_0x193a75):await this[_0x2e9b5d(0xa8)](_0x35c257,_0x193a75,_0x545ce1),0x0;}async['renderSingleTimeline'](_0x55fe51,_0x5a71e7,_0x3d43a0){const _0x402acd=a42_0x2fdd13,{tdx:_0x502c6c}=_0x55fe51;let _0x4484d3,_0x418979;try{[_0x4484d3,_0x418979]=await Promise['all']([_0x502c6c['workflow'][_0x402acd(0xb1)](_0x5a71e7),_0x502c6c[_0x402acd(0xb3)][_0x402acd(0x12c)](_0x5a71e7,![])]);}catch(_0x3c7e78){console['error'](a42_0x350d9e['red'](_0x402acd(0x137)));_0x3d43a0[_0x402acd(0x1e3)]&&console[_0x402acd(0xd4)](_0x3c7e78);throw _0x3c7e78;}if(_0x3d43a0[_0x402acd(0x130)]||_0x3d43a0['jsonl']){const _0x595b16=this['buildTimelineData'](_0x4484d3,_0x418979);await handleSDKOutput([_0x595b16],_0x3d43a0);return;}const _0xc57811=_0x502c6c[_0x402acd(0xb2)][_0x402acd(0x1e2)],_0xfeb827=this[_0x402acd(0x16b)](_0x4484d3,_0x418979,_0xc57811);console[_0x402acd(0x14f)](_0xfeb827);}async['pollTimeline'](_0x5b9c6b,_0x3b3962){const _0x1e2d71=a42_0x2fdd13,{tdx:_0x31ef26}=_0x5b9c6b,_0xedfe11=TIMELINE_CONFIG[_0x1e2d71(0x171)],_0x4a627f=TIMELINE_CONFIG[_0x1e2d71(0x212)];let _0x383c03=0x0;while(_0x383c03<_0x4a627f){process[_0x1e2d71(0x21c)][_0x1e2d71(0x20c)]&&process[_0x1e2d71(0x21c)][_0x1e2d71(0x102)]('\x1bc');let _0x4ee859,_0x4d87ea;try{[_0x4ee859,_0x4d87ea]=await Promise[_0x1e2d71(0x188)]([_0x31ef26[_0x1e2d71(0xb3)][_0x1e2d71(0xb1)](_0x3b3962),_0x31ef26[_0x1e2d71(0xb3)][_0x1e2d71(0x12c)](_0x3b3962,![])]);}catch(_0xf8217e){console[_0x1e2d71(0xd4)](a42_0x350d9e[_0x1e2d71(0xc0)](_0x1e2d71(0xbd)));_0x383c03>0x0&&console[_0x1e2d71(0xd4)](a42_0x350d9e['dim'](_0x1e2d71(0x1b1)+_0x383c03));throw _0xf8217e;}const _0x3843fe=_0x31ef26['context']['site'],_0x28aa6d=this['renderTimeline'](_0x4ee859,_0x4d87ea,_0x3843fe);console[_0x1e2d71(0x14f)](_0x28aa6d);const _0x57d479=_0x4ee859['done']&&_0x4d87ea[_0x1e2d71(0x12b)](_0x18b0f9=>_0x18b0f9[_0x1e2d71(0x22c)]!==_0x1e2d71(0x197)&&_0x18b0f9[_0x1e2d71(0x22c)]!==_0x1e2d71(0x1b5));if(_0x57d479){console[_0x1e2d71(0xd4)](a42_0x350d9e[_0x1e2d71(0x14d)]('\x0a✔\x20Attempt\x20complete'));break;}console[_0x1e2d71(0xd4)](a42_0x350d9e[_0x1e2d71(0x1ee)]('\x0aPolling...\x20('+_0x383c03*0x2+_0x1e2d71(0x22e))),await new Promise(_0x732983=>setTimeout(_0x732983,_0xedfe11)),_0x383c03++;}_0x383c03>=_0x4a627f&&console[_0x1e2d71(0xd4)](a42_0x350d9e[_0x1e2d71(0x22a)](_0x1e2d71(0x172)));}[a42_0x2fdd13(0x16b)](_0x2104b3,_0x500896,_0x2aa2fe){const _0x42aa05=a42_0x2fdd13,_0x7c8877=[],_0x4a03cb=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x5b5af9=0x5,_0x31e736=process['stdout']['columns']||0x78,_0xe46d38=_0x31e736-_0x4a03cb-_0x5b5af9,_0x13e386=Math[_0x42aa05(0x244)](TIMELINE_CONFIG['MIN_TIMELINE_WIDTH'],Math[_0x42aa05(0x1d5)](_0xe46d38,TIMELINE_CONFIG[_0x42aa05(0xfa)])),_0x3f61d7=new Date(_0x2104b3[_0x42aa05(0xe6)])['getTime'](),_0x307817=_0x2104b3['finishedAt']?new Date(_0x2104b3['finishedAt'])['getTime']():Date[_0x42aa05(0xd2)](),_0x3edf1c={'start':_0x3f61d7,'end':_0x307817,'duration':_0x307817-_0x3f61d7},_0x5b3290=new Map(),_0x78ea55=[];for(const _0x5bd2ac of _0x500896){if(_0x5bd2ac['startedAt']){const _0x3b0e96=new Date(_0x5bd2ac[_0x42aa05(0x174)])[_0x42aa05(0x20f)](),_0x4d1f2b=_0x5bd2ac[_0x42aa05(0x160)]?new Date(_0x5bd2ac[_0x42aa05(0x160)])['getTime']():Date[_0x42aa05(0xd2)](),_0x2606ee={'start':_0x3b0e96,'end':_0x4d1f2b,'duration':_0x4d1f2b-_0x3b0e96};_0x5b3290['set'](_0x5bd2ac['id'],_0x2606ee),_0x78ea55[_0x42aa05(0x192)]({'name':_0x5bd2ac['fullName'],'state':_0x5bd2ac[_0x42aa05(0x22c)]||_0x42aa05(0x207),'window':_0x2606ee});}else _0x78ea55[_0x42aa05(0x192)]({'name':_0x5bd2ac[_0x42aa05(0x20b)],'state':_0x5bd2ac[_0x42aa05(0x22c)]||_0x42aa05(0x1b5),'window':undefined});}_0x78ea55[_0x42aa05(0x1be)]((_0x52e524,_0x26cffe)=>{const _0x42bc37=_0x42aa05;if(!_0x52e524[_0x42bc37(0x158)])return 0x1;if(!_0x26cffe[_0x42bc37(0x158)])return-0x1;return _0x52e524['window'][_0x42bc37(0x1cd)]-_0x26cffe['window'][_0x42bc37(0x1cd)];});const _0x5f37f1=_0x78ea55[_0x42aa05(0xdb)],_0x43e968=_0x5f37f1>TIMELINE_CONFIG[_0x42aa05(0x1fd)];_0x43e968&&_0x78ea55[_0x42aa05(0xb7)](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x4da8f2=calculateTimeScale(_0x3edf1c,_0x13e386),_0x1dee64=_0x2104b3['done']?_0x2104b3[_0x42aa05(0xf7)]?a42_0x350d9e[_0x42aa05(0x14d)](_0x42aa05(0xf7)):a42_0x350d9e['red'](_0x42aa05(0xd4)):a42_0x350d9e['blue'](_0x42aa05(0x197)),_0x43bcf7=_0x2104b3[_0x42aa05(0xa9)]?.['id'],_0x16896b=_0x2104b3[_0x42aa05(0x16c)];let _0x24571d;if(_0x43bcf7&&_0x16896b){const _0x38fabd=getWorkflowAttemptUrl(_0x2aa2fe,_0x43bcf7,_0x16896b,_0x2104b3['id']);_0x24571d=hyperlink(a42_0x350d9e[_0x42aa05(0x1ee)](_0x2104b3['id']),_0x38fabd);}else _0x24571d=a42_0x350d9e[_0x42aa05(0x1ee)](_0x2104b3['id']);_0x7c8877[_0x42aa05(0x192)](_0x42aa05(0xfd)+_0x24571d+_0x42aa05(0x13b)+_0x1dee64+_0x42aa05(0x13b)+formatElapsed(_0x3edf1c[_0x42aa05(0x176)]));if(_0x78ea55['length']>0x0){const _0x149749=renderTimeAxis(_0x4da8f2,_0x13e386),_0x55a059=new Date(_0x3edf1c['start']),_0xbb2641=formatDate(_0x55a059),_0x48f760=TIMELINE_CONFIG[_0x42aa05(0x157)]+TIMELINE_CONFIG[_0x42aa05(0xf9)]+_0x4a03cb,_0x543347=_0xbb2641[_0x42aa05(0x1b8)](_0x48f760),_0x2803f=a42_0x350d9e['dim'](_0x543347);_0x7c8877['push'](_0x2803f+'\x20'+_0x149749);for(const _0x4e52bd of _0x78ea55){_0x7c8877['push'](renderTaskRow(_0x4e52bd,_0x4da8f2,_0x13e386,_0x4a03cb));}const _0x1be74f=calculateStats(_0x78ea55);_0x7c8877[_0x42aa05(0x192)](formatStats(_0x1be74f)),_0x43e968&&_0x7c8877['push'](a42_0x350d9e['yellow']('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0x42aa05(0x1fd)]+_0x42aa05(0xcc)+_0x5f37f1+_0x42aa05(0x1c4))),_0x7c8877[_0x42aa05(0x192)](''),_0x7c8877[_0x42aa05(0x192)](a42_0x350d9e[_0x42aa05(0x1ee)]('💡\x20Tip:\x20Use\x20')+(_0x42aa05(0x1d8)+_0x2104b3['id']+_0x42aa05(0xa6))+a42_0x350d9e[_0x42aa05(0x1ee)](_0x42aa05(0x1ce)));}else _0x7c8877[_0x42aa05(0x192)](_0x42aa05(0xe5));return _0x7c8877['join']('\x0a');}[a42_0x2fdd13(0xc3)](_0x1d9512,_0x579a36){const _0x36dc27=a42_0x2fdd13,_0x4bfe5c=new Date(_0x1d9512[_0x36dc27(0xe6)])[_0x36dc27(0x20f)](),_0x275ccf=_0x1d9512[_0x36dc27(0xe9)]?new Date(_0x1d9512[_0x36dc27(0xe9)])[_0x36dc27(0x20f)]():Date['now'](),_0x556ca1=_0x275ccf-_0x4bfe5c,_0x33d814=[];for(const _0x281771 of _0x579a36){if(_0x281771['startedAt']){const _0x1cf002=new Date(_0x281771[_0x36dc27(0x174)])[_0x36dc27(0x20f)](),_0x408761=_0x281771[_0x36dc27(0x160)]?new Date(_0x281771[_0x36dc27(0x160)])[_0x36dc27(0x20f)]():Date[_0x36dc27(0xd2)]();_0x33d814[_0x36dc27(0x192)]({'name':_0x281771[_0x36dc27(0x20b)],'state':_0x281771[_0x36dc27(0x22c)]||'unknown','window':{'start':_0x1cf002,'end':_0x408761,'duration':_0x408761-_0x1cf002}});}else _0x33d814['push']({'name':_0x281771[_0x36dc27(0x20b)],'state':_0x281771['state']||_0x36dc27(0x1b5),'window':undefined});}const _0x17c5c2=calculateStats(_0x33d814);return{'attempt':{'id':_0x1d9512['id'],'status':_0x1d9512['done']?_0x1d9512[_0x36dc27(0xf7)]?_0x36dc27(0xf7):_0x36dc27(0xd4):_0x36dc27(0x197),'createdAt':_0x1d9512['createdAt'],'finishedAt':_0x1d9512['finishedAt'],'duration_ms':_0x556ca1},'tasks':_0x33d814[_0x36dc27(0x184)](_0x4fe1f9=>({'name':_0x4fe1f9[_0x36dc27(0x19f)],'state':_0x4fe1f9['state'],'startedAt':_0x4fe1f9['window']?new Date(_0x4fe1f9['window'][_0x36dc27(0x1cd)])[_0x36dc27(0x1a0)]():null,'updatedAt':_0x4fe1f9[_0x36dc27(0x158)]?new Date(_0x4fe1f9[_0x36dc27(0x158)][_0x36dc27(0xea)])[_0x36dc27(0x1a0)]():null,'duration_ms':_0x4fe1f9['window']?.[_0x36dc27(0x176)]||null})),'stats':_0x17c5c2};}}
|
|
1
|
+
const a42_0x360d23=a42_0x1132;function a42_0x1132(_0x2c9dc6,_0x412cef){_0x2c9dc6=_0x2c9dc6-0x9f;const _0x1fac13=a42_0x1fac();let _0x1132af=_0x1fac13[_0x2c9dc6];return _0x1132af;}(function(_0x293ab0,_0x240b85){const _0x47e880=a42_0x1132,_0x4311ed=_0x293ab0();while(!![]){try{const _0x3aa30d=parseInt(_0x47e880(0x22e))/0x1+parseInt(_0x47e880(0xbc))/0x2*(parseInt(_0x47e880(0x110))/0x3)+parseInt(_0x47e880(0x198))/0x4*(-parseInt(_0x47e880(0xae))/0x5)+-parseInt(_0x47e880(0x1ef))/0x6*(-parseInt(_0x47e880(0x10c))/0x7)+-parseInt(_0x47e880(0x14e))/0x8+-parseInt(_0x47e880(0x123))/0x9+-parseInt(_0x47e880(0x1f6))/0xa*(-parseInt(_0x47e880(0xb0))/0xb);if(_0x3aa30d===_0x240b85)break;else _0x4311ed['push'](_0x4311ed['shift']());}catch(_0x449a55){_0x4311ed['push'](_0x4311ed['shift']());}}}(a42_0x1fac,0xe278c));import a42_0x1731c7 from'chalk';import{existsSync}from'fs';import a42_0x39af89 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a42_0x8efb79 from'prompts';function getAttemptStatusDisplay(_0x2aa4b9){const _0xb111fc=a42_0x1132;if(!_0x2aa4b9)return{'icon':'⏳','text':''};const {done:_0x5d840e,success:_0x40cb05,cancelRequested:_0x2c0a98}=_0x2aa4b9;if(!_0x5d840e)return _0x2c0a98?{'icon':'🛑','text':a42_0x1731c7[_0xb111fc(0xfe)](_0xb111fc(0x172))}:{'icon':'🔄','text':a42_0x1731c7[_0xb111fc(0x1f9)](_0xb111fc(0x137))};if(_0x40cb05)return{'icon':'✅','text':a42_0x1731c7[_0xb111fc(0x202)](_0xb111fc(0x1c7))};return{'icon':'❌','text':a42_0x1731c7[_0xb111fc(0x11c)](_0xb111fc(0xa8))};}function a42_0x1fac(){const _0x5086f7=['updatedAt','Error:\x20KEY=VALUE\x20is\x20required','Include\x20retried:\x20yes','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','MAX_TASKS_DISPLAY','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','workflows','Filter:\x20','executeCloneProject','canceling','Listing\x20secrets...','Params:\x20','\x0aApply\x20these\x20changes?','\x20session','duration','Warning:','workflow:projects','renderSingleTimeline','\x0aPolling...\x20(','\x22\x20to\x20new\x20project\x20\x22','start','MIN_TIMELINE_WIDTH','revision','\x0aFailed\x20to\x20fetch\x20attempt\x20data','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Cloning\x20to\x20','💡\x20Tip:\x20Use\x20','taskName','\x20is\x20not\x20a\x20directory','attempt:','session','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','fileSize','changes','sessionId','deleteSecret','executePushProject','round','Workflow:\x20','\x20workflow','Reason:\x20','floor','tdx.json','(use\x20--limit\x20to\x20see\x20more)','site','length','splice','5732516GuZLgp','isDirectory','parseProjectWorkflowPattern','Source\x20project:\x20','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','POLL_INTERVAL_MS','Total:\x20','fs/promises','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','prepareCloneProject','summary','rows','\x20\x20Session\x20context\x20set\x20to:\x20','workflow:attempt','\x20modified','autocomplete','Select\x20a\x20workflow\x20to\x20run','startedAt','title','deleted','hasChanges','dim','\x22?\x20This\x20cannot\x20be\x20undone.','find','unknown','some','sessions','Error:\x20Invalid\x20parameter\x20format:\x20','Updating\x20','Expected\x20format:\x20--param\x20key=value','modified','icon','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','params','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','workflow:download','task','displayLine','param','every','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','format','Select\x20a\x20task\x20to\x20view\x20logs:','\x0aDry\x20run\x20-\x20no\x20files\x20written','window','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Project:\x20','success','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Pushing\x20workflow\x20project...','sourceDir','\x20(use\x20--limit\x20to\x20show\x20more)','No\x20matching\x20sessions\x20found','\x20secret','/sessions/','getFullYear','localeCompare','toLowerCase','✔\x20Retry\x20started','yes','\x20\x20Changes:\x20','set','\x0a✔\x20No\x20changes\x20to\x20push','\x0aDry\x20run\x20-\x20nothing\x20pushed','workflowName','list','attempt','has','\x0aPush\x20these\x20changes?','Select\x20a\x20session\x20to\x20view\x20timeline:','all','Filter:\x20project=','Retrying\x20session...','\x20tasks','isTTY','Session\x20not\x20found:\x20','\x20\x20Attempt\x20ID:\x20','.\x20Expected\x20format:\x20KEY=VALUE','\x20task','Project\x20filter:\x20','workflow','columns','\x20to\x20see\x20detailed\x20logs','\x27...','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','Getting\x20attempt\x20details...','projectName','7984338PUOJvW','join','Fetching\x20log\x20files...','\x1b[1A\x1b[2K','replace','Start\x20a\x20workflow\x20run','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','10LLVUFK','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','⚠\x20Showing\x20first\x20','blue','Session\x20','✔\x20Pushed\x20','Error:\x20Project\x20name\x20is\x20required','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','dryRun','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','---\x20','\x20\x20Console:\x20','green','requireProject','existingProjectId','msPerChar','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','✔\x20Found\x20','table','projectId','cyan','logs','\x27\x20from\x20project\x20\x27','workflow:sessions','No\x20attempts\x20found\x20in\x20project:\x20','\x0a⚠\x20Project\x20\x22','workflow:workflows','\x20\x20New\x20attempt\x20ID:\x20','retryAttempt','workflow:logs','substring','Analyzing\x20changes...','resolveProjectDir','Cancelled','Key\x20cannot\x20be\x20empty','LABEL_WIDTH_DIVISOR','\x0aClone\x20\x22','✔\x20Workflow\x20project\x20context\x20cleared.','\x20\x20Revision:\x20','write','workflow:upload','newProjectName','\x0aUpdate\x20existing\x20project\x20\x22','ICON_SPACING','Project\x20name:\x20','generateSessionTimelineRows','preparePushProject','utf-8','\x20of\x20','message','getMinutes','sort','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','diff','New\x20project\x20name:\x20','Latest\x20session\x20has\x20no\x20attempt','1355072rpMShN','getTime','Starting\x20workflow\x20run...','\x20new','new','lastAttempt','startTime','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Revision:\x20','cancelRequested','Attempt\x20ID:\x20','data','\x20\x20Workflow:\x20','name','Resolving\x20project\x20\x27','Loading\x20sessions...','...','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','\x20\x20Target:\x20','max','pollTimeline','Dry\x20run:\x20yes','Error:\x20','\x20attempt','Validation:\x20skipped','MIN_LABEL_COUNT','renderTimeline','stringify','type','verbose','Session\x20time:\x20','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','resolveProjectId','workflow:run','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','retryAttemptName','size','context','List\x20workflows','tdx\x20wf\x20attempt\x20','fullName','finishedAt','No\x20sessions\x20found','values','No\x20workflows\x20found','error','Key:\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Parameters:\x20','Downloading\x20logs...','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','5NdgziJ','includeRetried','18078511LzOWWt','Setting\x20secret...','min','resolveProject','/attempt/','No\x20workflows\x20found\x20in\x20project:\x20','✔\x20Secret\x20\x27','Listing\x20workflow\x20sessions...','Source\x20directory\x20is\x20required','get','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','✔\x20Project:\x20','64qsOERN','fill','LABEL_MIN_SPACING','No\x20log\x20content\x20found','Force:\x20yes','status','\x0aDry\x20run\x20-\x20no\x20project\x20created','download','planned','No\x20sessions\x20found\x20in\x20project:\x20','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','pending','repeat','skipValidation','startsWith','showWorkflowConsoleUrl','end','index','padStart','MAX_POLL_ITERATIONS','resumeFrom','tasks','stat','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','📋\x20','Usage:\x20tdx\x20wf\x20use\x20<project>','navigateSessionsInteractive','session_id','targetExists','Error:\x20Secret\x20key\x20is\x20required','match','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','from','No\x20attempts\x20found','Pull\x20workflow\x20project\x20to\x20local\x20folder','\x20deleted','ICON_WIDTH','\x20\x20Project\x20ID:\x20','\x0a✔\x20Already\x20up\x20to\x20date','getMonth','Including\x20subtasks:\x20yes','attemptId','workflow:pull','workflow:tasks','project','\x20-\x20','Error:\x20Attempt\x20ID\x20is\x20required','\x22\x20already\x20exists\x20(ID:\x20','Show\x20tasks\x20for\x20an\x20attempt','state','attempts','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Loading\x20workflows...','Project\x20name\x20is\x20required','Killing\x20attempt...','fromTask','includes','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Source:\x20','\x20\x20Source:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Listing\x20workflows...','\x20\x20tdx\x20wf\x20use\x20<project>','targetDir','Analyzing\x20project...','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','yellow','✔\x20Pull\x20complete','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','total','Project\x20directory:\x20','buildTimelineData','text','No\x20sessions\x20with\x20timing\x20information','now','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','No\x20workflow\x20tdx.json\x20found','parse','No\x20projects\x20match\x20pattern:\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','7eNniXq','cwd','TASK_NAME_WIDTH','includeSubtasks','112254WUoAgv','white','json','map','newProjectId','toISOString','Status:\x20','Resume\x20from:\x20','Pushing\x20project...','group_error','fileCount','log','red','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','workflow:use','path','✔\x20Workflow\x20project\x20set\x20to:\x20','\x20\x20Files\x20extracted:\x20','✔\x20Deleted\x20project\x20','13040910DdMYsv','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','jsonl','stdout','Usage:\x20workflow:delete\x20<project-name-or-id>','unchanged','Listing\x20workflow\x20projects...','split','metadata','description','workflow:kill','relative','🔄\x20','session:','sourceProjectName','trimEnd','key','createdAt','kill','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','running','\x20\x20Project:\x20','projects','List\x20workflow\x20attempts','sessionTime','keys','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','filter','workflow:secrets:delete','Error:\x20Invalid\x20JSON\x20in\x20--params','No\x20workflow\x20sessions\x20found','Getting\x20attempt\x20tasks...','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Error:','Invalid\x20format:\x20','execute','MAX_TIMELINE_WIDTH','renderSessionsTimeline','logFiles','No\x20attempts\x20found\x20for:\x20','\x20unchanged','\x20project','push','13735400vqpGiw','workflowProject','Retry\x20a\x20session\x20or\x20attempt','workflow:clone','\x0a✔\x20Attempt\x20complete','basename','follow','getDate','limit','\x20\x20Session\x20ID:\x20','Output\x20directory:\x20','Source\x20directory:\x20','pullProject','indexOf','isArray','output',',\x20Workflow:\x20','✔\x20Clone\x20complete','\x20\x20Location:\x20','\x20logs','No\x20workflow\x20projects\x20found','📁\x20','Show\x20specific\x20attempt\x20details','done','delete','select','No\x20sessions\x20found\x20for:\x20'];a42_0x1fac=function(){return _0x5086f7;};return a42_0x1fac();}export class WorkflowBaseCommand extends BaseCommand{[a42_0x360d23(0xb3)](_0x1e6d97,_0x4b47f8,_0x575461=0x0){const _0x376f53=a42_0x360d23;return _0x1e6d97[_0x575461]||_0x4b47f8[_0x376f53(0x14f)];}[a42_0x360d23(0x203)](_0x1896ad,_0x5d3b9d,_0x4ec33a=0x0){const _0x3895ea=a42_0x360d23,_0x47698e=this['resolveProject'](_0x1896ad,_0x5d3b9d,_0x4ec33a);if(!_0x47698e)return console[_0x3895ea(0xa8)](a42_0x1731c7[_0x3895ea(0x11c)](_0x3895ea(0x144)),'Project\x20name\x20is\x20required'),console[_0x3895ea(0xa8)](a42_0x1731c7[_0x3895ea(0x1ad)](_0x3895ea(0x11d))),null;return _0x47698e;}['parseProjectWorkflowPattern'](_0x590f15,_0x394ccc){const _0xfa637e=a42_0x360d23;if(_0x590f15[0x0]){const _0x1fd6dc=_0x590f15[0x0][_0xfa637e(0x12a)]('.');if(_0x1fd6dc[_0xfa637e(0x196)]===0x1)return{'projectName':_0x1fd6dc[0x0],'workflowName':undefined};else return _0x1fd6dc['length']===0x2?{'projectName':_0x1fd6dc[0x0],'workflowName':_0x1fd6dc[0x1]}:(console[_0xfa637e(0xa8)](a42_0x1731c7['red'](_0xfa637e(0x144)),_0xfa637e(0xdb)),null);}return{'projectName':_0x394ccc[_0xfa637e(0x14f)],'workflowName':undefined};}[a42_0x360d23(0x216)](_0x31064b,_0x361070,_0x4718b0=0x0){const _0x26a17f=a42_0x360d23;if(_0x31064b[_0x4718b0])return _0x31064b[_0x4718b0];if(_0x361070[_0x26a17f(0x14f)]){const _0x570925=a42_0x39af89[_0x26a17f(0x1f0)](process[_0x26a17f(0x10d)](),_0x26a17f(0x16f),_0x361070[_0x26a17f(0x14f)]);if(existsSync(a42_0x39af89[_0x26a17f(0x1f0)](_0x570925,_0x26a17f(0x193))))return _0x570925;}return undefined;}async[a42_0x360d23(0xcb)](_0x339b1f,_0x335e86,_0x3519ba){const _0x4d5d31=a42_0x360d23;try{const _0xfcb9fb=await _0x339b1f[_0x4d5d31(0x1e8)]['workflows'](_0x335e86,{'limit':0x1});if(_0xfcb9fb[_0x4d5d31(0x196)]>0x0){const _0xd51a2c=_0xfcb9fb[0x0]['id'],_0x946aef=getWorkflowUrl(_0x3519ba,_0xd51a2c);console[_0x4d5d31(0xa8)](_0x4d5d31(0x201)+a42_0x1731c7[_0x4d5d31(0x20a)](_0x946aef));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a42_0x360d23(0x23b)]=a42_0x360d23(0x11e);['description']=a42_0x360d23(0xad);async[a42_0x360d23(0x146)](_0x1f35d2){const _0x34f21c=a42_0x360d23,{options:_0x134bc6,args:_0x542751,tdx:_0xc554eb}=_0x1f35d2,_0x1ee449=_0x542751[0x0],_0x26ca49=_0x134bc6['clear'];if(_0x26ca49)return saveSessionContext({'workflow_project':undefined},_0x134bc6['session']),console[_0x34f21c(0x11b)](a42_0x1731c7[_0x34f21c(0x202)](_0x34f21c(0x21b))),0x0;if(!_0x1ee449)return console[_0x34f21c(0xa8)](a42_0x1731c7[_0x34f21c(0x11c)]('Error:'),_0x34f21c(0xf1)),console[_0x34f21c(0xa8)](a42_0x1731c7['dim'](_0x34f21c(0xd5))),console[_0x34f21c(0xa8)](a42_0x1731c7['dim'](_0x34f21c(0x181))),0x1;const _0xffb868=await withSpinner(_0x34f21c(0x23c)+_0x1ee449+_0x34f21c(0x1eb),()=>_0xc554eb[_0x34f21c(0x1e8)][_0x34f21c(0x24e)](_0x1ee449),{'verbose':_0x134bc6[_0x34f21c(0x24b)]}),{name:_0x25148a}=_0xffb868[_0x34f21c(0x239)];return saveSessionContext({'workflow_project':_0x25148a},_0x134bc6[_0x34f21c(0x187)]),console['log'](a42_0x1731c7['green'](_0x34f21c(0x120)+a42_0x1731c7['cyan'](_0x25148a))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a42_0x360d23(0x179);[a42_0x360d23(0x12c)]='List\x20all\x20workflow\x20projects';async[a42_0x360d23(0x146)](_0x3d556b){const _0x4461d6=a42_0x360d23,{options:_0x280ff2,args:_0x4f6db7,tdx:_0x34801c}=_0x3d556b,_0x1517e0=_0x4f6db7[0x0];_0x280ff2['verbose']&&_0x1517e0&&console['error']('Pattern:\x20'+_0x1517e0);const _0x4ada5f=await withSpinner(_0x4461d6(0x129),()=>_0x34801c[_0x4461d6(0x1e8)][_0x4461d6(0x139)](_0x1517e0,{'limit':_0x280ff2['limit']}),{'verbose':_0x280ff2[_0x4461d6(0x24b)]});let _0x35e1ac=_0x4ada5f[_0x4461d6(0x239)];_0x35e1ac['sort']((_0x5f426d,_0x1ee3cd)=>_0x5f426d['name'][_0x4461d6(0x1d0)](_0x1ee3cd[_0x4461d6(0x23b)]));const _0x49bbf3=_0x280ff2[_0x4461d6(0x156)]||0x64,_0x160086=_0x35e1ac[_0x4461d6(0x196)]>=_0x49bbf3?a42_0x1731c7[_0x4461d6(0x1ad)](_0x4461d6(0x1cb)):'';console[_0x4461d6(0xa8)](_0x4461d6(0x207)+_0x35e1ac[_0x4461d6(0x196)]+_0x4461d6(0x14c)+(_0x35e1ac['length']!==0x1?'s':'')+_0x160086);if(_0x280ff2[_0x4461d6(0x1c1)]===_0x4461d6(0x112)||_0x280ff2[_0x4461d6(0x1c1)]===_0x4461d6(0x125)||_0x280ff2[_0x4461d6(0x1c1)]===_0x4461d6(0x208))await handleSDKOutput(_0x35e1ac,_0x280ff2);else{if(_0x35e1ac['length']===0x0)_0x1517e0?console[_0x4461d6(0x11b)](_0x4461d6(0x10a)+_0x1517e0):console[_0x4461d6(0x11b)](_0x4461d6(0x162));else{const _0x48429f=_0x35e1ac[_0x4461d6(0x113)](_0x28637d=>{const _0x58c90c=_0x4461d6,_0x43a3fd=_0x28637d[_0x58c90c(0x12b)]?.[_0x58c90c(0x1b1)](_0x464a8e=>_0x464a8e[_0x58c90c(0x133)]==='sys'),_0x328ff9=_0x43a3fd?a42_0x1731c7['dim']('\x20(system)'):'';return _0x58c90c(0x163)+_0x28637d[_0x58c90c(0x23b)]+_0x328ff9;});await writeOutput(_0x48429f['join']('\x0a'),_0x280ff2[_0x4461d6(0x15d)],_0x4461d6(0x1d9));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a42_0x360d23(0x23b)]=a42_0x360d23(0x210);['description']=a42_0x360d23(0xa1);async[a42_0x360d23(0x146)](_0x5b7dc1){const _0x28778e=a42_0x360d23,{options:_0x5a4008,args:_0x1fa80a,tdx:_0x57addc}=_0x5b7dc1,_0x5dc6e2=this[_0x28778e(0xb3)](_0x1fa80a,_0x5a4008);_0x5a4008[_0x28778e(0x24b)]&&_0x5dc6e2&&console['error'](_0x28778e(0x1e7)+_0x5dc6e2);const _0x10f727=await withSpinner(_0x28778e(0xf9),()=>_0x57addc[_0x28778e(0x1e8)][_0x28778e(0x16f)](_0x5dc6e2,{'limit':_0x5a4008[_0x28778e(0x156)]}),{'verbose':_0x5a4008['verbose']});let _0x61c5d=_0x10f727['data'];_0x61c5d[_0x28778e(0x229)]((_0x2b5ec9,_0x269753)=>{const _0x1f45a4=_0x28778e,_0x38e617=_0x2b5ec9['name'][_0x1f45a4(0x1d0)](_0x269753[_0x1f45a4(0x23b)]);if(_0x38e617!==0x0)return _0x38e617;return(_0x2b5ec9[_0x1f45a4(0xe8)]?.[_0x1f45a4(0x23b)]||'')[_0x1f45a4(0x1d0)](_0x269753[_0x1f45a4(0xe8)]?.[_0x1f45a4(0x23b)]||'');});const _0x153f42=_0x5a4008[_0x28778e(0x156)]||0x64,_0x5c5dc2=_0x61c5d['length']>=_0x153f42?a42_0x1731c7[_0x28778e(0x1ad)](_0x28778e(0x1cb)):'';console[_0x28778e(0xa8)](_0x28778e(0x207)+_0x61c5d[_0x28778e(0x196)]+_0x28778e(0x190)+(_0x61c5d['length']!==0x1?'s':'')+_0x5c5dc2);if(_0x5a4008['format']==='json'||_0x5a4008['format']===_0x28778e(0x125)||_0x5a4008['format']===_0x28778e(0x208))await handleSDKOutput(_0x61c5d,_0x5a4008);else{if(_0x61c5d['length']===0x0)_0x5dc6e2?console['log'](_0x28778e(0xb5)+_0x5dc6e2):console[_0x28778e(0x11b)](_0x28778e(0xa7));else{const _0x40c5cd=_0x5a4008[_0x28778e(0x195)],_0x20c7fa=_0x61c5d['map'](_0x28f192=>{const _0x18b3d6=_0x28778e,_0xd0311d=a42_0x1731c7[_0x18b3d6(0x1ad)]('#'+_0x28f192['id']),_0xaf3232=hyperlink(_0xd0311d,getWorkflowUrl(_0x40c5cd,_0x28f192['id'])),_0x2987af=_0x28f192['project']?.['name']?a42_0x1731c7[_0x18b3d6(0x1ad)]('\x20('+_0x28f192[_0x18b3d6(0xe8)][_0x18b3d6(0x23b)]+')'):'';return _0x18b3d6(0xd4)+_0xaf3232+'\x20'+_0x28f192[_0x18b3d6(0x23b)]+_0x2987af;});await writeOutput(_0x20c7fa[_0x28778e(0x1f0)]('\x0a'),_0x5a4008[_0x28778e(0x15d)],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a42_0x360d23(0x23b)]=a42_0x360d23(0x20d);[a42_0x360d23(0x12c)]='List\x20workflow\x20execution\x20sessions';async['execute'](_0x2f0df2){const _0x75fae7=a42_0x360d23,{options:_0x140bbe,args:_0x24f73d,tdx:_0x15e88c}=_0x2f0df2,_0x307da1=this['parseProjectWorkflowPattern'](_0x24f73d,_0x140bbe);if(!_0x307da1)return 0x1;const {projectName:_0x647aa5,workflowName:_0x5c6b40}=_0x307da1;if(_0x140bbe[_0x75fae7(0x24b)]){if(_0x647aa5&&_0x5c6b40)console[_0x75fae7(0xa8)](_0x75fae7(0x170)+_0x647aa5+'.'+_0x5c6b40);else _0x647aa5&&console[_0x75fae7(0xa8)](_0x75fae7(0x1df)+_0x647aa5);const _0x99dd9f=_0x140bbe[_0x75fae7(0xc1)];_0x99dd9f&&console[_0x75fae7(0xa8)](_0x75fae7(0x116)+_0x99dd9f);}let _0x1b05e1=0x28;if(process[_0x75fae7(0x126)][_0x75fae7(0x1e2)]&&!_0x140bbe[_0x75fae7(0x15d)]&&!_0x140bbe[_0x75fae7(0x1c1)]){const _0x22f9ac=process[_0x75fae7(0x126)][_0x75fae7(0x1a3)]||0x28;_0x1b05e1=Math[_0x75fae7(0x241)](0x14,Math[_0x75fae7(0x192)](_0x22f9ac*0x2/0x3));}const _0x34ed13=_0x140bbe[_0x75fae7(0x156)]||_0x1b05e1,_0x470b74=await withSpinner(_0x75fae7(0xb7),()=>_0x15e88c[_0x75fae7(0x1e8)][_0x75fae7(0x1b2)]({'projectName':_0x647aa5,'workflowName':_0x5c6b40,'status':_0x140bbe['status'],'fromTime':_0x140bbe[_0x75fae7(0xdc)],'toTime':_0x140bbe['to'],'limit':_0x34ed13}),{'verbose':_0x140bbe[_0x75fae7(0x24b)]}),_0x43f106=_0x470b74['data'];_0x43f106['sort']((_0x4e7baa,_0x4f02fa)=>{const _0x1102c4=_0x75fae7,_0x1acff2=_0x4e7baa[_0x1102c4(0x13b)]||'',_0x4a818a=_0x4f02fa['sessionTime']||'';return _0x4a818a[_0x1102c4(0x1d0)](_0x1acff2);});_0x43f106[_0x75fae7(0x196)]>=_0x34ed13?console[_0x75fae7(0xa8)]('✔\x20Showing\x20'+_0x43f106[_0x75fae7(0x196)]+'\x20sessions\x20'+a42_0x1731c7[_0x75fae7(0x1ad)](_0x75fae7(0x194))):console['error'](_0x75fae7(0x207)+_0x43f106[_0x75fae7(0x196)]+_0x75fae7(0x176)+(_0x43f106[_0x75fae7(0x196)]!==0x1?'s':''));if(_0x140bbe[_0x75fae7(0x1c1)]===_0x75fae7(0x112)||_0x140bbe[_0x75fae7(0x1c1)]===_0x75fae7(0x125)||_0x140bbe[_0x75fae7(0x1c1)]===_0x75fae7(0x208))await handleSDKOutput(_0x43f106,_0x140bbe);else{if(!process[_0x75fae7(0x126)]['isTTY']||_0x140bbe[_0x75fae7(0x15d)]){if(_0x43f106[_0x75fae7(0x196)]===0x0){if(_0x647aa5&&_0x5c6b40)console[_0x75fae7(0x11b)]('No\x20sessions\x20found\x20for:\x20'+_0x647aa5+'.'+_0x5c6b40);else _0x647aa5?console[_0x75fae7(0x11b)](_0x75fae7(0xc5)+_0x647aa5):console[_0x75fae7(0x11b)]('No\x20sessions\x20found');}else{const _0xc9cc00=_0x140bbe[_0x75fae7(0x195)],_0x286e34=this[_0x75fae7(0x148)](_0x43f106,_0xc9cc00);_0x140bbe[_0x75fae7(0x15d)]?await writeOutput(_0x286e34,_0x140bbe[_0x75fae7(0x15d)],_0x75fae7(0x1d9)):console[_0x75fae7(0x11b)](_0x286e34);}!_0x647aa5&&(console['error'](''),console[_0x75fae7(0xa8)](a42_0x1731c7[_0x75fae7(0x1ad)](_0x75fae7(0x24d))),console[_0x75fae7(0xa8)](a42_0x1731c7[_0x75fae7(0x1ad)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a42_0x1731c7['dim'](_0x75fae7(0xfa))));}else{if(_0x43f106[_0x75fae7(0x196)]===0x0){if(_0x647aa5&&_0x5c6b40)console[_0x75fae7(0x11b)](_0x75fae7(0x168)+_0x647aa5+'.'+_0x5c6b40);else _0x647aa5?console[_0x75fae7(0x11b)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x647aa5):console[_0x75fae7(0x11b)](_0x75fae7(0xa5));}else await this['navigateSessionsInteractive'](_0x43f106,_0x2f0df2,_0x647aa5);}}return 0x0;}[a42_0x360d23(0x148)](_0x914361,_0x1f9cae){const _0xdd953c=a42_0x360d23,_0x5106b3=[],_0x5264f5=new Map();let _0x301217=Infinity,_0x12aad7=-Infinity;for(const _0x4f293a of _0x914361){if(_0x4f293a[_0xdd953c(0x233)]?.[_0xdd953c(0x134)]){const _0x528888=new Date(_0x4f293a[_0xdd953c(0x233)][_0xdd953c(0x134)])['getTime'](),_0x544106=_0x4f293a[_0xdd953c(0x233)][_0xdd953c(0xa4)]?new Date(_0x4f293a['lastAttempt']['finishedAt'])[_0xdd953c(0x22f)]():Date['now'](),_0x5ad519=_0x4f293a[_0xdd953c(0xe8)]?.[_0xdd953c(0x23b)]||'(unknown)';!_0x5264f5[_0xdd953c(0x1db)](_0x5ad519)&&_0x5264f5[_0xdd953c(0x1d5)](_0x5ad519,[]),_0x5264f5[_0xdd953c(0xb9)](_0x5ad519)[_0xdd953c(0x14d)]({'session':_0x4f293a,'startTime':_0x528888,'endTime':_0x544106,'duration':_0x544106-_0x528888}),_0x301217=Math[_0xdd953c(0xb2)](_0x301217,_0x528888),_0x12aad7=Math[_0xdd953c(0x241)](_0x12aad7,_0x544106);}}if(_0x5264f5[_0xdd953c(0x9f)]===0x0)return _0xdd953c(0x105);const _0x10bb06=process[_0xdd953c(0x126)][_0xdd953c(0x1e9)]||0x78,_0x2d7dfc=0x1e,_0x44ed59=0x32,_0x12568f=0x4,_0xc3cd2d=Math[_0xdd953c(0xb2)](_0x44ed59,Math['max'](_0x2d7dfc,Math['floor'](_0x10bb06*0.3))),_0x1ce554=_0x10bb06-_0xc3cd2d-TIMELINE_CONFIG['GUTTER']-0x3-_0x12568f,_0x284ad5=_0x12aad7-_0x301217,_0x43f07f=_0x284ad5/_0xc3cd2d,_0x1bb6c4=renderTimeAxis({'startTime':_0x301217,'endTime':_0x12aad7,'durationMs':_0x284ad5,'msPerChar':_0x43f07f},_0xc3cd2d),_0x2fa7af=[];for(const _0x3c4a30 of _0x5264f5[_0xdd953c(0xa6)]()){_0x2fa7af['push'](..._0x3c4a30);}_0x2fa7af['sort']((_0x171ca3,_0x28e69c)=>_0x28e69c[_0xdd953c(0x234)]-_0x171ca3['startTime']);const _0x2f3dc1=new Date(_0x301217),_0x5019fc=formatDate(_0x2f3dc1),_0x53ec37=_0x12568f+TIMELINE_CONFIG[_0xdd953c(0xe0)]+TIMELINE_CONFIG[_0xdd953c(0x221)]+_0x1ce554,_0x916a72='\x20'[_0xdd953c(0xc8)](_0x53ec37-_0x5019fc[_0xdd953c(0x196)]),_0x3a496a=_0x916a72+a42_0x1731c7[_0xdd953c(0x1ad)](_0x5019fc)+'\x20'+_0x1bb6c4;_0x5106b3[_0xdd953c(0x14d)](_0x3a496a);const _0x2fc5c7=0x16;let _0x2c1eb7=0x0;for(const _0x337ec9 of _0x2fa7af){const _0x27d3ec=_0x337ec9[_0xdd953c(0x187)][_0xdd953c(0xe8)]?.['name']||'?',_0xd1ecef=Math[_0xdd953c(0xb2)](stringWidth(_0x27d3ec),_0x2fc5c7);_0x2c1eb7=Math[_0xdd953c(0x241)](_0x2c1eb7,_0xd1ecef);}for(const _0x199c49 of _0x2fa7af){const {session:_0x4b2190,startTime:_0x2b398c,endTime:_0x3196fa,duration:_0x1ef76e}=_0x199c49,_0x229239=_0x4b2190['project']?.['id'],_0x22a2be=_0x4b2190['id'],_0x4884a0=_0x4b2190[_0xdd953c(0xe8)]?.[_0xdd953c(0x23b)]||'?',_0x5d66f9=_0x4b2190[_0xdd953c(0x1e8)]?.[_0xdd953c(0x23b)]||'?';let _0x155a4b,_0x1b4475;if(_0x4b2190['lastAttempt']){const _0x297238=_0x4b2190['lastAttempt'];!_0x297238['done']?(_0x155a4b=_0x297238[_0xdd953c(0x237)]?'🛑':'🔄',_0x1b4475=_0x297238['cancelRequested']?a42_0x1731c7[_0xdd953c(0xfe)]:a42_0x1731c7[_0xdd953c(0x1f9)]):(_0x155a4b=_0x297238[_0xdd953c(0x1c7)]?'✅':'❌',_0x1b4475=_0x297238['success']?a42_0x1731c7[_0xdd953c(0x202)]:a42_0x1731c7['red']);}else _0x155a4b='⏳',_0x1b4475=a42_0x1731c7[_0xdd953c(0x1ad)];const _0x35661d='#'+_0x22a2be,_0x137d7f=_0x229239?hyperlink(_0x35661d,getWorkflowSessionUrl(_0x1f9cae,_0x229239,_0x22a2be)):_0x35661d;let _0x553e12=_0x4884a0;stringWidth(_0x4884a0)>_0x2fc5c7&&(_0x553e12=_0x4884a0['slice'](0x0,_0x2fc5c7-0x1)+'…');const _0x72988a=a42_0x1731c7['dim'](_0x553e12),_0x475550=stringWidth(_0x553e12),_0x4921e7='\x20'[_0xdd953c(0xc8)](_0x2c1eb7-stringWidth(_0x553e12)+0x2),_0x2a9962='('+formatElapsed(_0x1ef76e)+')',_0x5885cb=stringWidth(_0x2a9962),_0x1fcb7f=stringWidth(_0x35661d),_0x4276b3=_0x1fcb7f+0x1+_0x475550+_0x4921e7[_0xdd953c(0x196)],_0x3d9fd7=_0x1ce554-_0x4276b3-_0x5885cb-0x1-0x8;let _0x5f2abf=_0x5d66f9;stringWidth(_0x5f2abf)>_0x3d9fd7&&(_0x5f2abf=_0x5f2abf['slice'](0x0,_0x3d9fd7-0x1)+'…');const _0x416086=_0x137d7f+'\x20'+_0x72988a+_0x4921e7+_0x5f2abf,_0x3e883e=stringWidth(_0x416086),_0x48ec99=_0x1ce554-_0x3e883e-_0x5885cb,_0x56d730=_0x416086+'\x20'['repeat'](Math['max'](0x1,_0x48ec99))+a42_0x1731c7[_0xdd953c(0x1ad)](_0x2a9962),_0x5dfd40=Math[_0xdd953c(0x192)]((_0x2b398c-_0x301217)/_0x43f07f),_0x1f15d7=Math['floor']((_0x3196fa-_0x301217)/_0x43f07f),_0x25d00c=Math['max'](_0x5dfd40+0x1,_0x1f15d7),_0x3bf13=new Array(_0xc3cd2d)[_0xdd953c(0xbd)]('\x20');for(let _0x1d00ce=_0x5dfd40;_0x1d00ce<Math[_0xdd953c(0xb2)](_0x25d00c,_0xc3cd2d);_0x1d00ce++){_0x3bf13[_0x1d00ce]='─';}const _0x34b009=_0x3bf13[_0xdd953c(0x113)](_0x4418cb=>_0x4418cb==='\x20'?'\x20':_0x1b4475(_0x4418cb))['join']('');_0x5106b3[_0xdd953c(0x14d)](_0x155a4b+'\x20'+_0x56d730+'│'+_0x34b009+'│');}return _0x5106b3[_0xdd953c(0x1f0)]('\x0a');}async[a42_0x360d23(0xd6)](_0xbea17d,_0x34fefa,_0x36beb3){const _0x453056=a42_0x360d23,{options:_0x1a6683,tdx:_0x55917c}=_0x34fefa,_0x583187=_0x1a6683[_0x453056(0x195)],{timelineRows:_0x3aed4c,timeAxisHeader:_0x34ebcf}=this[_0x453056(0x223)](_0xbea17d,_0x583187),_0x1f693c=_0x3aed4c[_0x453056(0x13e)](_0x5e25ea=>_0x5e25ea[_0x453056(0xe5)]);if(_0x1f693c[_0x453056(0x196)]===0x0){const _0x28fc81=this[_0x453056(0x148)](_0xbea17d,_0x583187);console['log'](_0x28fc81);!_0x36beb3&&(console[_0x453056(0xa8)](''),console[_0x453056(0xa8)](a42_0x1731c7[_0x453056(0x1ad)](_0x453056(0x24d))),console[_0x453056(0xa8)](a42_0x1731c7[_0x453056(0x1ad)](_0x453056(0x22a))+'or'+a42_0x1731c7[_0x453056(0x1ad)](_0x453056(0xfa))));return;}_0x34ebcf&&console[_0x453056(0x11b)](_0x34ebcf);const _0x4725b7=_0x3aed4c[_0x453056(0x13e)](_0x46ba9c=>_0x46ba9c[_0x453056(0xe5)])[_0x453056(0x113)](_0x2e8d18=>({'title':_0x2e8d18[_0x453056(0x1bd)],'value':_0x2e8d18[_0x453056(0xe5)]})),_0x2e7ce6=process[_0x453056(0x126)][_0x453056(0x1a3)]||0x3c,_0x57e35a=Math['max'](0x28,Math[_0x453056(0x192)](_0x2e7ce6*0x2/0x3)),_0x5d8750=await a42_0x8efb79({'type':_0x453056(0x1a7),'name':_0x453056(0xe5),'message':_0x453056(0x1a0),'choices':_0x4725b7,'initial':-0x1,'limit':_0x57e35a,'clearFirst':!![],'fallback':{'title':_0x453056(0x1cc),'value':null},'suggest':(_0x375689,_0x5b88c8)=>{if(!_0x375689)return Promise['resolve'](_0x5b88c8);const _0x2a4b2d=_0x5b88c8['filter'](_0x161c80=>{const _0xd1daaf=a42_0x1132,_0xa1ce76=_0x161c80;return _0xa1ce76[_0xd1daaf(0x1aa)][_0xd1daaf(0x1d1)]()[_0xd1daaf(0xf4)](_0x375689[_0xd1daaf(0x1d1)]());});return Promise['resolve'](_0x2a4b2d);}}),_0x338829=()=>{const _0x280945=_0x453056;process[_0x280945(0x126)][_0x280945(0x21d)](_0x280945(0x1f2)),process[_0x280945(0x126)]['write'](_0x280945(0x1f2)),process[_0x280945(0x126)][_0x280945(0x21d)](_0x280945(0x1f2));},_0x1d40a2=_0x5d8750&&_0x5d8750[_0x453056(0xe5)]&&_0x5d8750[_0x453056(0xe5)]!==null&&_0x5d8750[_0x453056(0xe5)]['trim']()!=='';if(!_0x1d40a2){_0x338829(),console['log'](a42_0x1731c7[_0x453056(0x1ad)](_0x453056(0x217)));return;}_0x338829();const _0x49a675=_0xbea17d[_0x453056(0x1af)](_0x555a2e=>_0x555a2e[_0x453056(0x233)]?.['id']===_0x5d8750[_0x453056(0xe5)]);if(_0x49a675){const _0x48491b=_0x49a675['project']?.[_0x453056(0x23b)]||'?',_0x23dc23=_0x49a675['workflow']?.[_0x453056(0x23b)]||'?';console[_0x453056(0x11b)](_0x453056(0x1c6)+a42_0x1731c7[_0x453056(0x1ad)](_0x48491b)+_0x453056(0x15e)+a42_0x1731c7[_0x453056(0x1ad)](_0x23dc23));}const _0x9e3d47=new WorkflowTimelineCommand();await _0x9e3d47[_0x453056(0x146)]({'args':[],'options':{..._0x1a6683,'attemptId':_0x5d8750[_0x453056(0xe5)]},'tdx':_0x55917c});}[a42_0x360d23(0x223)](_0xfcb63,_0x3cba3d){const _0x174847=a42_0x360d23,_0x542138=new Map();for(const _0x161a36 of _0xfcb63){_0x161a36['id']&&_0x161a36['lastAttempt']?.['id']&&_0x542138[_0x174847(0x1d5)](_0x161a36['id'],_0x161a36[_0x174847(0x233)]['id']);}const _0x1d8d89=[];let _0x220fc4='';const _0x11f018=this[_0x174847(0x148)](_0xfcb63,_0x3cba3d),_0x46c4d4=_0x11f018['split']('\x0a');for(const _0x3b696a of _0x46c4d4){if(_0x3b696a['startsWith'](_0x174847(0x136))||_0x3b696a[_0x174847(0xda)](/^\s+\d{4}-\d{2}-\d{2}/))_0x220fc4=_0x3b696a;else{if(_0x3b696a[_0x174847(0xda)](/^[✅❌🔄🛑⏳]/)){const _0x110b25=_0x3b696a[_0x174847(0xda)](/#(\d+)/),_0x14c088=_0x110b25?_0x110b25[0x1]:null,_0x2ca83c=_0x14c088?_0x542138[_0x174847(0xb9)](_0x14c088)||null:null,_0x1e04fa=_0xfcb63[_0x174847(0x1af)](_0x523c9a=>_0x523c9a['id']===_0x14c088),_0x342d80=_0x1e04fa?.[_0x174847(0xe8)]?.[_0x174847(0x23b)]||'';_0x1d8d89['push']({'displayLine':_0x3b696a,'attemptId':_0x2ca83c,'projectName':_0x342d80});}}}return{'timelineRows':_0x1d8d89,'timeAxisHeader':_0x220fc4};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a42_0x360d23(0x23b)]='workflow:attempts';[a42_0x360d23(0x12c)]=a42_0x360d23(0x13a);async[a42_0x360d23(0x146)](_0x5f0107){const _0x3630a9=a42_0x360d23,{options:_0x1eb7b5,args:_0x5d3b45,tdx:_0x4aaf57}=_0x5f0107,_0x5d145b=this[_0x3630a9(0x19a)](_0x5d3b45,_0x1eb7b5);if(!_0x5d145b)return 0x1;const {projectName:_0x353a7c,workflowName:_0x2ea725}=_0x5d145b,_0x30e35d=_0x1eb7b5[_0x3630a9(0xaf)];if(_0x1eb7b5[_0x3630a9(0x24b)]){if(_0x353a7c&&_0x2ea725)console[_0x3630a9(0xa8)](_0x3630a9(0x170)+_0x353a7c+'.'+_0x2ea725);else _0x353a7c&&console['error']('Filter:\x20project='+_0x353a7c);_0x30e35d&&console[_0x3630a9(0xa8)](_0x3630a9(0x16b));}const _0x174f61=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x4aaf57[_0x3630a9(0x1e8)][_0x3630a9(0xee)]({'projectName':_0x353a7c,'workflowName':_0x2ea725,'includeRetried':_0x30e35d,'limit':_0x1eb7b5['limit']}),{'verbose':_0x1eb7b5[_0x3630a9(0x24b)]}),_0x4ed657=_0x174f61[_0x3630a9(0x239)],_0x401222=_0x1eb7b5[_0x3630a9(0x156)]||0x64,_0x3fede7=_0x4ed657[_0x3630a9(0x196)]>=_0x401222?a42_0x1731c7[_0x3630a9(0x1ad)](_0x3630a9(0x1cb)):'';console['error'](_0x3630a9(0x207)+_0x4ed657[_0x3630a9(0x196)]+_0x3630a9(0x245)+(_0x4ed657[_0x3630a9(0x196)]!==0x1?'s':'')+_0x3fede7);if(_0x1eb7b5[_0x3630a9(0x1c1)]===_0x3630a9(0x112)||_0x1eb7b5[_0x3630a9(0x1c1)]===_0x3630a9(0x125)||_0x1eb7b5['format']==='table')await handleSDKOutput(_0x4ed657,_0x1eb7b5);else{if(_0x4ed657[_0x3630a9(0x196)]===0x0){if(_0x353a7c&&_0x2ea725)console['log'](_0x3630a9(0x14a)+_0x353a7c+'.'+_0x2ea725);else _0x353a7c?console[_0x3630a9(0x11b)](_0x3630a9(0x20e)+_0x353a7c):console[_0x3630a9(0x11b)](_0x3630a9(0xdd));}else{const _0x34bd5d=_0x1eb7b5['site'],_0x5769d3=_0x4ed657[_0x3630a9(0x113)](_0x525306=>{const _0x4f5595=_0x3630a9,_0x2130ba=a42_0x1731c7['dim']('#'+_0x525306['id']),_0x4b3a16=_0x525306[_0x4f5595(0xe8)]?.['id'],_0x40eb56=_0x525306[_0x4f5595(0xd7)]||_0x525306[_0x4f5595(0x18b)],_0x5507a4=_0x4b3a16&&_0x40eb56?hyperlink(_0x2130ba,getWorkflowAttemptUrl(_0x34bd5d,_0x4b3a16,_0x40eb56,_0x525306['id'])):_0x2130ba,{icon:_0x5ccdba,text:_0x4efa9e}=getAttemptStatusDisplay(_0x525306),_0x4b5320=(_0x525306[_0x4f5595(0xe8)]?.[_0x4f5595(0x23b)]||'?')+'.'+(_0x525306[_0x4f5595(0x1e8)]?.[_0x4f5595(0x23b)]||'?'),_0x3155fd=_0x525306[_0x4f5595(0x13b)]?a42_0x1731c7[_0x4f5595(0x1ad)](_0x525306[_0x4f5595(0x13b)]):'';return(_0x5507a4+'\x20'+_0x5ccdba+(_0x4efa9e?'\x20'+_0x4efa9e:'')+'\x20'+_0x4b5320+'\x20'+_0x3155fd)[_0x4f5595(0x132)]();});await writeOutput(_0x5769d3[_0x3630a9(0x1f0)]('\x0a'),_0x1eb7b5['output'],_0x3630a9(0x1d9));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a42_0x360d23(0x23b)]=a42_0x360d23(0x1a5);[a42_0x360d23(0x12c)]=a42_0x360d23(0x164);async[a42_0x360d23(0x146)](_0x17e887){const _0x21db21=a42_0x360d23,{options:_0x2f8a4d,args:_0x3c1925,tdx:_0x49b677}=_0x17e887,_0x2c3699=_0x3c1925[0x0];if(!_0x2c3699)return console[_0x21db21(0xa8)](_0x21db21(0xea)),0x1;_0x2f8a4d[_0x21db21(0x24b)]&&console[_0x21db21(0xa8)](_0x21db21(0x238)+_0x2c3699);const _0x213a39=await withSpinner(_0x21db21(0x1ed),()=>_0x49b677['workflow']['attempt'](_0x2c3699),{'verbose':_0x2f8a4d['verbose']}),_0xfc7b53=_0x213a39[_0x21db21(0x239)];let _0x2fc4ee;!_0xfc7b53[_0x21db21(0x165)]?_0x2fc4ee=_0xfc7b53['cancelRequested']?_0x21db21(0x172):_0x21db21(0x137):_0x2fc4ee=_0xfc7b53[_0x21db21(0x1c7)]?_0x21db21(0x1c7):_0x21db21(0xa8);let _0x1f413c;if(_0xfc7b53['createdAt']&&_0xfc7b53['finishedAt']){const _0x23a683=new Date(_0xfc7b53['createdAt'])[_0x21db21(0x22f)](),_0x5452e9=new Date(_0xfc7b53[_0x21db21(0xa4)])[_0x21db21(0x22f)]();_0x1f413c=Math[_0x21db21(0x18e)]((_0x5452e9-_0x23a683)/0x3e8);}const _0x14ec2a={'attempt_id':_0xfc7b53['id'],'status':_0x2fc4ee,..._0xfc7b53[_0x21db21(0xcd)]!==undefined&&{'index':_0xfc7b53[_0x21db21(0xcd)]},..._0xfc7b53['project']&&{'project':_0xfc7b53[_0x21db21(0xe8)]['name']},..._0xfc7b53[_0x21db21(0x1e8)]&&{'workflow':_0xfc7b53[_0x21db21(0x1e8)][_0x21db21(0x23b)]},..._0xfc7b53[_0x21db21(0x18b)]&&{'session_id':_0xfc7b53[_0x21db21(0x18b)]},..._0xfc7b53[_0x21db21(0x13b)]&&{'session_time':_0xfc7b53[_0x21db21(0x13b)]},..._0xfc7b53[_0x21db21(0x251)]&&{'retry_attempt':_0xfc7b53[_0x21db21(0x251)]},..._0x1f413c!==undefined&&{'duration_sec':_0x1f413c},..._0xfc7b53[_0x21db21(0x134)]&&{'created_at':_0xfc7b53[_0x21db21(0x134)]},..._0xfc7b53['finishedAt']&&{'finished_at':_0xfc7b53[_0x21db21(0xa4)]},...Object['keys'](_0xfc7b53[_0x21db21(0x1b9)])[_0x21db21(0x196)]>0x0&&{'params':_0xfc7b53[_0x21db21(0x1b9)]}};return await handleSingleObjectOutput(_0x14ec2a,_0x2f8a4d),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a42_0x360d23(0xe7);['description']=a42_0x360d23(0xec);async[a42_0x360d23(0x146)](_0x1e2807){const _0x4532ac=a42_0x360d23,{options:_0x6187fb,args:_0xebd9ff,tdx:_0x10e480}=_0x1e2807,_0x544f65=_0xebd9ff[0x0];if(!_0x544f65)return console[_0x4532ac(0xa8)](_0x4532ac(0xea)),0x1;const _0x27dba0=_0x6187fb[_0x4532ac(0x10f)];_0x6187fb[_0x4532ac(0x24b)]&&(console[_0x4532ac(0xa8)](_0x4532ac(0x238)+_0x544f65),_0x27dba0&&console[_0x4532ac(0xa8)](_0x4532ac(0xe4)));const _0x120a82=await withSpinner(_0x4532ac(0x142),()=>_0x10e480[_0x4532ac(0x1e8)]['tasks'](_0x544f65,_0x27dba0||![]),{'verbose':_0x6187fb[_0x4532ac(0x24b)]}),_0x36cef5=_0x120a82[_0x4532ac(0x239)];return console[_0x4532ac(0xa8)](_0x4532ac(0x207)+_0x36cef5[_0x4532ac(0x196)]+_0x4532ac(0x1e6)+(_0x36cef5[_0x4532ac(0x196)]!==0x1?'s':'')),await handleSDKOutput(_0x36cef5,_0x6187fb),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a42_0x360d23(0x213);['description']='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a42_0x360d23(0x146)](_0x2f449d){const _0x3f4368=a42_0x360d23,{options:_0x5c2c2f,args:_0x498e9d,tdx:_0x4b00e3}=_0x2f449d,_0x29cff1=_0x498e9d[0x0];let _0x399b28=_0x498e9d[0x1];if(!_0x29cff1)return console[_0x3f4368(0xa8)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x5c2c2f[_0x3f4368(0x24b)]&&(console[_0x3f4368(0xa8)]('Attempt\x20ID:\x20'+_0x29cff1),_0x399b28&&console['error']('Task\x20name:\x20'+_0x399b28));const _0x2d458a=await withSpinner(_0x3f4368(0x1f1),()=>_0x4b00e3['workflow'][_0x3f4368(0x149)](_0x29cff1,_0x399b28),{'verbose':_0x5c2c2f[_0x3f4368(0x24b)]}),_0x6cd799=_0x2d458a[_0x3f4368(0x239)];if(_0x6cd799[_0x3f4368(0x196)]===0x0)return console[_0x3f4368(0xa8)](_0x3f4368(0x10b)),0x0;if(!_0x399b28&&(_0x5c2c2f[_0x3f4368(0x112)]||_0x5c2c2f[_0x3f4368(0x1c1)]))return await handleSDKOutput(_0x6cd799,_0x5c2c2f),0x0;if(!_0x399b28){const _0x4bc357=_0x6cd799[_0x3f4368(0x113)](_0x82f4b3=>({'title':_0x82f4b3[_0x3f4368(0x184)]+'\x20('+formatBytes(_0x82f4b3[_0x3f4368(0x189)])+')','value':_0x82f4b3['taskName']})),_0x3f2660=await a42_0x8efb79({'type':_0x3f4368(0x167),'name':'task','message':_0x3f4368(0x1c2),'choices':_0x4bc357});if(!_0x3f2660[_0x3f4368(0x1bc)])return console[_0x3f4368(0xa8)]('Cancelled'),0x0;_0x399b28=_0x3f2660[_0x3f4368(0x1bc)];}const _0x25131e=await withSpinner(_0x3f4368(0xac),()=>_0x4b00e3[_0x3f4368(0x1e8)][_0x3f4368(0x20b)](_0x29cff1,_0x399b28),{'verbose':_0x5c2c2f[_0x3f4368(0x24b)]}),_0x162f94=_0x25131e['data'];return _0x162f94?console[_0x3f4368(0x11b)](_0x162f94):console['error'](_0x3f4368(0xbf)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a42_0x360d23(0x23b)]=a42_0x360d23(0x12d);['description']='Kill\x20a\x20running\x20attempt';async[a42_0x360d23(0x146)](_0x4354e8){const _0x32d120=a42_0x360d23,{options:_0x5904b8,args:_0x10304e,tdx:_0x1b531f}=_0x4354e8,_0x5add2f=_0x10304e[0x0];if(!_0x5add2f)return console[_0x32d120(0xa8)](_0x32d120(0xea)),0x1;const _0x4e8786=_0x5904b8['reason'];_0x5904b8[_0x32d120(0x24b)]&&(console[_0x32d120(0xa8)]('Attempt\x20ID:\x20'+_0x5add2f),_0x4e8786&&console[_0x32d120(0xa8)](_0x32d120(0x191)+_0x4e8786));if(!_0x5904b8[_0x32d120(0x1d3)]){const _0x5b351a=await confirmKey(_0x32d120(0xf8)+_0x5add2f+'?');if(!_0x5b351a)return console[_0x32d120(0xa8)](_0x32d120(0x217)),0x0;}const _0x586c6d=await withSpinner(_0x32d120(0xf2),()=>_0x1b531f['workflow'][_0x32d120(0x135)](_0x5add2f,_0x4e8786),{'verbose':_0x5904b8[_0x32d120(0x24b)]}),_0x34b59f=_0x586c6d[_0x32d120(0x239)];return console[_0x32d120(0xa8)]('✔\x20'+_0x34b59f),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']='workflow:retry';['description']=a42_0x360d23(0x150);async['execute'](_0xd345eb){const _0x19f695=a42_0x360d23,{options:_0x4a54b1,args:_0x2e2d09,tdx:_0x33c2bb}=_0xd345eb,_0x11f9f3=_0x2e2d09[0x0];if(!_0x11f9f3)return console['error'](_0x19f695(0x250)),console[_0x19f695(0xa8)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x41af95=![],_0x5195b8=_0x11f9f3;if(_0x11f9f3['startsWith'](_0x19f695(0x130)))_0x41af95=!![],_0x5195b8=_0x11f9f3[_0x19f695(0x214)](0x8);else{if(_0x11f9f3[_0x19f695(0xca)](_0x19f695(0x186)))_0x41af95=![],_0x5195b8=_0x11f9f3[_0x19f695(0x214)](0x8);else return console[_0x19f695(0xa8)](_0x19f695(0x143)),console[_0x19f695(0xa8)](_0x19f695(0xba)),0x1;}const _0x2f4bc8=_0x4a54b1[_0x19f695(0xf3)],_0x4828de=_0x4a54b1[_0x19f695(0xd0)],_0x56266d=_0x4a54b1[_0x19f695(0x1b9)],_0x309ec0=_0x4a54b1['force'];_0x4a54b1[_0x19f695(0x24b)]&&(console[_0x19f695(0xa8)]('Target:\x20'+(_0x41af95?_0x19f695(0x187):_0x19f695(0x1da))+'\x20'+_0x5195b8),_0x2f4bc8&&console[_0x19f695(0xa8)]('From\x20task:\x20'+_0x2f4bc8),_0x4828de&&console[_0x19f695(0xa8)](_0x19f695(0x117)+_0x4828de),_0x56266d&&console[_0x19f695(0xa8)](_0x19f695(0x174)+_0x56266d),_0x309ec0&&console[_0x19f695(0xa8)](_0x19f695(0xc0)));let _0x25a215;if(_0x56266d)try{if(_0x56266d[_0x19f695(0xca)]('@')){const _0x18ee45=await import(_0x19f695(0x19f)),_0x22dd16=_0x56266d[_0x19f695(0x214)](0x1),_0x36e258=await _0x18ee45['readFile'](_0x22dd16,_0x19f695(0x225));_0x25a215=JSON[_0x19f695(0x109)](_0x36e258);}else _0x25a215=JSON['parse'](_0x56266d);}catch{return console['error'](_0x19f695(0x140)),0x1;}if(!_0x4a54b1[_0x19f695(0x1d3)]){const _0xcb2d4f=await confirmKey(_0x19f695(0x1f5)+(_0x41af95?'session':_0x19f695(0x1da))+'\x20'+_0x5195b8+'?');if(!_0xcb2d4f)return console[_0x19f695(0xa8)](_0x19f695(0x217)),0x0;}let _0x1cc237;_0x41af95?_0x1cc237=await withSpinner(_0x19f695(0x1e0),()=>_0x33c2bb[_0x19f695(0x1e8)]['retrySession'](_0x5195b8,{'fromTask':_0x2f4bc8,'retryParams':_0x25a215}),{'verbose':_0x4a54b1[_0x19f695(0x24b)]}):_0x1cc237=await withSpinner('Retrying\x20attempt...',()=>_0x33c2bb[_0x19f695(0x1e8)][_0x19f695(0x212)](_0x5195b8,{'resumeFrom':_0x4828de,'retryParams':_0x25a215,'force':_0x309ec0}),{'verbose':_0x4a54b1[_0x19f695(0x24b)]});const _0x216a99=_0x1cc237[_0x19f695(0x239)];return console[_0x19f695(0xa8)](_0x19f695(0x1d2)),console[_0x19f695(0xa8)](_0x19f695(0x211)+_0x216a99['attemptId']),console[_0x19f695(0xa8)](_0x19f695(0x157)+_0x216a99[_0x19f695(0x18b)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a42_0x360d23(0x23b)]=a42_0x360d23(0x24f);['description']=a42_0x360d23(0x1f4);async[a42_0x360d23(0x146)](_0x287be5){const _0x61b498=a42_0x360d23,{options:_0x1a9063,args:_0x579306,tdx:_0x3eb8e1}=_0x287be5;let _0x4ee93e=_0x579306[0x0];if(!_0x4ee93e){const _0x3f8181=this[_0x61b498(0xb3)]([],_0x1a9063),_0x3ac660=await withSpinner(_0x61b498(0xf0),()=>_0x3eb8e1[_0x61b498(0x1e8)][_0x61b498(0x16f)](_0x3f8181,{'limit':_0x1a9063[_0x61b498(0x156)]}),{'verbose':_0x1a9063['verbose']}),_0x3e477d=_0x3ac660[_0x61b498(0x239)];if(_0x3e477d[_0x61b498(0x196)]===0x0)return console[_0x61b498(0xa8)](_0x61b498(0xa7)),!_0x3f8181&&console[_0x61b498(0xa8)](a42_0x1731c7['dim'](_0x61b498(0x11d))),0x1;const _0x216f4c=_0x3e477d[_0x61b498(0x113)](_0x4faab4=>({'title':_0x4faab4['project']?.[_0x61b498(0x23b)]+'.'+_0x4faab4[_0x61b498(0x23b)],'value':_0x4faab4[_0x61b498(0xe8)]?.['name']+'.'+_0x4faab4[_0x61b498(0x23b)],'description':_0x4faab4[_0x61b498(0x17f)]?'revision:\x20'+_0x4faab4[_0x61b498(0x17f)]:undefined})),_0x38c3c2=await a42_0x8efb79({'type':_0x61b498(0x167),'name':_0x61b498(0x1e8),'message':_0x61b498(0x1a8),'choices':_0x216f4c});if(!_0x38c3c2[_0x61b498(0x1e8)])return 0x1;_0x4ee93e=_0x38c3c2[_0x61b498(0x1e8)];}if(!_0x4ee93e['includes']('.')){const _0x2bb929=this[_0x61b498(0xb3)]([],_0x1a9063);if(_0x2bb929)_0x4ee93e=_0x2bb929+'.'+_0x4ee93e;else return console[_0x61b498(0xa8)](a42_0x1731c7[_0x61b498(0x11c)](_0x61b498(0x144)),_0x61b498(0xc6)),console['error'](a42_0x1731c7['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x5ec9c3=_0x1a9063[_0x61b498(0x1be)],_0x3765ab=_0x1a9063['sessionTime'],_0x307454={};if(_0x5ec9c3&&Array[_0x61b498(0x15c)](_0x5ec9c3))for(const _0x205210 of _0x5ec9c3){const _0x2dd08a=_0x205210[_0x61b498(0x15b)]('=');if(_0x2dd08a===-0x1)return console['error'](_0x61b498(0x1b3)+_0x205210),console[_0x61b498(0xa8)](_0x61b498(0x1b5)),0x1;const _0x24d601=_0x205210[_0x61b498(0x214)](0x0,_0x2dd08a),_0xfa5e5b=_0x205210[_0x61b498(0x214)](_0x2dd08a+0x1);try{_0x307454[_0x24d601]=JSON[_0x61b498(0x109)](_0xfa5e5b);}catch{_0x307454[_0x24d601]=_0xfa5e5b;}}_0x1a9063['verbose']&&(console[_0x61b498(0xa8)](_0x61b498(0x18f)+_0x4ee93e),Object[_0x61b498(0x13c)](_0x307454)['length']>0x0&&console['error'](_0x61b498(0xab)+JSON[_0x61b498(0x249)](_0x307454)),_0x3765ab&&console[_0x61b498(0xa8)](_0x61b498(0x24c)+_0x3765ab));const _0x41ba18=await withSpinner(_0x61b498(0x230),()=>_0x3eb8e1[_0x61b498(0x1e8)]['run'](_0x4ee93e,_0x307454,{'sessionTime':_0x3765ab}),{'verbose':_0x1a9063['verbose']}),_0x47e268=_0x41ba18['data'];console['error']('✔\x20Workflow\x20run\x20started'),console[_0x61b498(0xa8)](_0x61b498(0x1e4)+_0x47e268['id']),console[_0x61b498(0xa8)](_0x61b498(0x157)+_0x47e268[_0x61b498(0x18b)]),console['error'](_0x61b498(0x138)+_0x47e268[_0x61b498(0xe8)]?.[_0x61b498(0x23b)]),console['error'](_0x61b498(0x23a)+_0x47e268['workflow']?.['name']);if(_0x47e268[_0x61b498(0xe8)]?.['id']&&_0x47e268['sessionId']&&_0x47e268['id']){const _0x58f842=_0x1a9063[_0x61b498(0x195)],_0x246d75=getConsoleUrl(_0x58f842,'/app/workflows/'+_0x47e268[_0x61b498(0xe8)]['id']+_0x61b498(0x1ce)+_0x47e268['sessionId']+_0x61b498(0xb4)+_0x47e268['id']);console[_0x61b498(0xa8)](_0x61b498(0x201)+a42_0x1731c7[_0x61b498(0x20a)](_0x246d75));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a42_0x360d23(0x23b)]=a42_0x360d23(0x1bb);[a42_0x360d23(0x12c)]=a42_0x360d23(0x1fd);async[a42_0x360d23(0x146)](_0x303a4a){const _0x3257c6=a42_0x360d23,{options:_0x183437,args:_0x427c63,tdx:_0x50f4ac}=_0x303a4a,_0x242d30=_0x427c63[0x0],_0xccdb7f=_0x427c63[0x1]||'.';if(!_0x242d30)return console[_0x3257c6(0xa8)](_0x3257c6(0x1fc)),console[_0x3257c6(0xa8)](_0x3257c6(0xaa)),0x1;const _0x5e2a4c=_0x183437[_0x3257c6(0x17f)];_0x183437[_0x3257c6(0x24b)]&&(console['error'](_0x3257c6(0x1c6)+_0x242d30),console[_0x3257c6(0xa8)](_0x3257c6(0x158)+_0xccdb7f),_0x5e2a4c&&console['error'](_0x3257c6(0x236)+_0x5e2a4c));const _0x23d8a3=await withSpinner('Downloading\x20project\x20'+_0x242d30+_0x3257c6(0x23e),()=>_0x50f4ac[_0x3257c6(0x1e8)][_0x3257c6(0xc3)](_0x242d30,_0xccdb7f,{'revision':_0x5e2a4c}),{'verbose':_0x183437['verbose']}),_0x5442f4=_0x23d8a3[_0x3257c6(0x239)];return console[_0x3257c6(0xa8)]('✔\x20Downloaded\x20'+_0x5442f4[_0x3257c6(0x1ee)]),console[_0x3257c6(0xa8)]('\x20\x20Revision:\x20'+_0x5442f4[_0x3257c6(0x17f)]),console[_0x3257c6(0xa8)](_0x3257c6(0x121)+_0x5442f4['filesExtracted']),console[_0x3257c6(0xa8)](_0x3257c6(0x160)+_0xccdb7f+'/'+_0x5442f4[_0x3257c6(0x1ee)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a42_0x360d23(0x23b)]=a42_0x360d23(0x21e);[a42_0x360d23(0x12c)]=a42_0x360d23(0x206);async['execute'](_0x2cf5ba){const _0x3fa078=a42_0x360d23,{options:_0x35eb4f,args:_0x2cdf4d,tdx:_0x920e3a}=_0x2cf5ba;let _0x63d64c='.',_0x3def6a=_0x35eb4f[_0x3fa078(0x23b)];if(_0x2cdf4d[0x0]){const {promises:_0x2650f0}=await import('fs');try{const _0xa7d732=await _0x2650f0[_0x3fa078(0xd2)](_0x2cdf4d[0x0]);if(_0xa7d732[_0x3fa078(0x199)]())_0x63d64c=_0x2cdf4d[0x0];else return console[_0x3fa078(0xa8)](_0x3fa078(0x244)+_0x2cdf4d[0x0]+_0x3fa078(0x185)),0x1;}catch{_0x3def6a=_0x2cdf4d[0x0],_0x63d64c='.';}}const _0x1ddf4a=_0x35eb4f[_0x3fa078(0x17f)],_0x199a6f=_0x35eb4f[_0x3fa078(0xc9)];_0x35eb4f[_0x3fa078(0x24b)]&&(console[_0x3fa078(0xa8)](_0x3fa078(0x102)+_0x63d64c),_0x3def6a&&console[_0x3fa078(0xa8)](_0x3fa078(0x222)+_0x3def6a),_0x1ddf4a&&console[_0x3fa078(0xa8)]('Revision:\x20'+_0x1ddf4a),_0x199a6f&&console['error']('Validation:\x20skipped'));const _0xf637ce=await withSpinner(_0x3fa078(0x1c9),()=>_0x920e3a[_0x3fa078(0x1e8)][_0x3fa078(0x14d)](_0x63d64c,{'projectName':_0x3def6a,'revision':_0x1ddf4a,'skipValidation':_0x199a6f}),{'verbose':_0x35eb4f[_0x3fa078(0x24b)]}),_0x3bd8ae=_0xf637ce[_0x3fa078(0x239)];return console[_0x3fa078(0xa8)](_0x3fa078(0x1fb)+_0x3bd8ae['projectName']),console[_0x3fa078(0xa8)]('\x20\x20Project\x20ID:\x20'+_0x3bd8ae[_0x3fa078(0x209)]),console['error'](_0x3fa078(0x21c)+_0x3bd8ae['revision']),await this['showWorkflowConsoleUrl'](_0x920e3a,_0x3bd8ae[_0x3fa078(0x1ee)],_0x35eb4f[_0x3fa078(0x195)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a42_0x360d23(0x23b)]=a42_0x360d23(0xe6);[a42_0x360d23(0x12c)]=a42_0x360d23(0xde);async['execute'](_0x5d9c67){const _0x13bb9d=a42_0x360d23,{options:_0x57ba53,args:_0x5dac84,tdx:_0x59a421}=_0x5d9c67,_0x1289de=_0x5dac84[0x0],_0x17ff18=_0x5dac84[0x1];if(!_0x1289de)return console[_0x13bb9d(0xa8)](a42_0x1731c7['red']('Error:'),_0x13bb9d(0xf1)),console['error'](a42_0x1731c7[_0x13bb9d(0x1ad)](_0x13bb9d(0x16e))),0x1;const _0x81a992=_0x57ba53[_0x13bb9d(0x17f)];_0x57ba53['verbose']&&(console[_0x13bb9d(0xa8)]('Project:\x20'+_0x1289de),_0x17ff18&&console[_0x13bb9d(0xa8)]('Target\x20directory:\x20'+_0x17ff18),_0x81a992&&console[_0x13bb9d(0xa8)](_0x13bb9d(0x236)+_0x81a992),_0x57ba53['dryRun']&&console[_0x13bb9d(0xa8)](_0x13bb9d(0x243)));const _0xe9e346=await withSpinner('Pulling\x20project\x20'+_0x1289de+'...',()=>_0x59a421[_0x13bb9d(0x1e8)][_0x13bb9d(0x15a)](_0x1289de,{'targetDir':_0x17ff18,'revision':_0x81a992}),{'verbose':_0x57ba53[_0x13bb9d(0x24b)]}),_0xd5ec16=_0xe9e346[_0x13bb9d(0x239)];_0xd5ec16['isNewProject']?console[_0x13bb9d(0xa8)]('✔\x20New\x20project:\x20'+_0xd5ec16['projectName']):console[_0x13bb9d(0xa8)](_0x13bb9d(0xbb)+_0xd5ec16['projectName']);console[_0x13bb9d(0xa8)](_0x13bb9d(0x21c)+_0xd5ec16[_0x13bb9d(0x17f)]),console[_0x13bb9d(0xa8)](_0x13bb9d(0x240)+(a42_0x39af89[_0x13bb9d(0x12e)](process[_0x13bb9d(0x10d)](),_0xd5ec16['targetDir'])||'.')),console['error'](_0x13bb9d(0x1d4)+a42_0x1731c7[_0x13bb9d(0x202)]('+'+_0xd5ec16[_0x13bb9d(0x1a2)][_0x13bb9d(0x232)]+'\x20new')+',\x20'+(a42_0x1731c7[_0x13bb9d(0xfe)]('~'+_0xd5ec16[_0x13bb9d(0x1a2)][_0x13bb9d(0x1b6)]+_0x13bb9d(0x1a6))+',\x20')+(a42_0x1731c7[_0x13bb9d(0x11c)]('-'+_0xd5ec16['summary'][_0x13bb9d(0x1ab)]+_0x13bb9d(0xdf))+',\x20')+(''+a42_0x1731c7['dim'](_0xd5ec16[_0x13bb9d(0x1a2)][_0x13bb9d(0x128)]+'\x20unchanged')));for(const _0x4ab63f of _0xd5ec16['changes']){_0x4ab63f[_0x13bb9d(0x24a)]===_0x13bb9d(0x1b6)&&_0x4ab63f[_0x13bb9d(0x22b)]&&(console['error']('\x0a'+a42_0x1731c7[_0x13bb9d(0x20a)]('---\x20'+_0x4ab63f[_0x13bb9d(0x11f)])),console['error'](_0x4ab63f[_0x13bb9d(0x22b)]));}if(!_0xd5ec16[_0x13bb9d(0x1ac)])return saveSessionContext({'workflow_project':_0xd5ec16[_0x13bb9d(0x1ee)]},_0x57ba53[_0x13bb9d(0x187)]),console['error'](a42_0x1731c7[_0x13bb9d(0x202)](_0x13bb9d(0xe2))),console[_0x13bb9d(0xa8)](a42_0x1731c7[_0x13bb9d(0x1ad)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0xd5ec16[_0x13bb9d(0x1ee)])),0x0;if(_0x57ba53[_0x13bb9d(0x1fe)])return console['error'](a42_0x1731c7[_0x13bb9d(0xfe)](_0x13bb9d(0x1c3))),0x0;if(!_0x57ba53[_0x13bb9d(0x1d3)]){const _0x14b406=await confirmKey(_0x13bb9d(0x175));if(!_0x14b406)return console[_0x13bb9d(0xa8)](_0x13bb9d(0x217)),0x0;}await withSpinner('Writing\x20files...',()=>_0x59a421['workflow']['applyPullProject'](_0xd5ec16,{'revision':_0x81a992}),{'verbose':_0x57ba53[_0x13bb9d(0x24b)]}),saveSessionContext({'workflow_project':_0xd5ec16['projectName']},_0x57ba53['session']),console[_0x13bb9d(0xa8)](a42_0x1731c7[_0x13bb9d(0x202)](_0x13bb9d(0xff)));const _0x560c28=a42_0x39af89[_0x13bb9d(0x12e)](process['cwd'](),_0xd5ec16[_0x13bb9d(0xfb)])||'.';return console[_0x13bb9d(0xa8)](a42_0x1731c7[_0x13bb9d(0x1ad)](_0x13bb9d(0x160)+_0x560c28)),console[_0x13bb9d(0xa8)](a42_0x1731c7[_0x13bb9d(0x1ad)](_0x13bb9d(0x1a4)+_0xd5ec16[_0x13bb9d(0x1ee)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a42_0x360d23(0x23b)]='workflow:push';['description']=a42_0x360d23(0xef);async[a42_0x360d23(0x146)](_0x46ca57){const _0x275a5a=a42_0x360d23,{options:_0x394f46,args:_0x428776,tdx:_0x39dc15}=_0x46ca57,_0x21d024=this[_0x275a5a(0x216)](_0x428776,_0x394f46),_0x38c228=_0x394f46[_0x275a5a(0x17f)],_0x5c9de8=_0x394f46[_0x275a5a(0xc9)];_0x394f46[_0x275a5a(0x24b)]&&(_0x21d024&&console[_0x275a5a(0xa8)](_0x275a5a(0x159)+_0x21d024),_0x38c228&&console[_0x275a5a(0xa8)]('Revision:\x20'+_0x38c228),_0x394f46[_0x275a5a(0x1fe)]&&console[_0x275a5a(0xa8)](_0x275a5a(0x243)),_0x5c9de8&&console[_0x275a5a(0xa8)](_0x275a5a(0x246)));let _0x58f264;try{_0x58f264=await withSpinner(_0x275a5a(0x215),()=>_0x39dc15[_0x275a5a(0x1e8)][_0x275a5a(0x224)]({'sourceDir':_0x21d024,'revision':_0x38c228,'skipValidation':_0x5c9de8}),{'verbose':_0x394f46[_0x275a5a(0x24b)]});}catch(_0x3ad8cb){if(_0x3ad8cb instanceof Error&&_0x3ad8cb[_0x275a5a(0x227)][_0x275a5a(0xf4)](_0x275a5a(0x108)))return console[_0x275a5a(0xa8)](a42_0x1731c7[_0x275a5a(0x11c)]('Error:'),_0x275a5a(0x1c0)),_0x394f46[_0x275a5a(0x14f)]?console[_0x275a5a(0xa8)](a42_0x1731c7[_0x275a5a(0x1ad)]('Tip:\x20cd\x20to\x20workflows/'+_0x394f46[_0x275a5a(0x14f)]+_0x275a5a(0x124)+_0x394f46[_0x275a5a(0x14f)]+'\x27')):console[_0x275a5a(0xa8)](a42_0x1731c7[_0x275a5a(0x1ad)](_0x275a5a(0x188))),0x1;throw _0x3ad8cb;}const _0x565eb2=_0x58f264['data'];console[_0x275a5a(0xa8)](_0x275a5a(0xbb)+_0x565eb2[_0x275a5a(0x1ee)]),console[_0x275a5a(0xa8)](_0x275a5a(0xf7)+_0x565eb2[_0x275a5a(0x1ca)]),console[_0x275a5a(0xa8)]('\x20\x20Revision:\x20'+_0x565eb2['revision']),console[_0x275a5a(0xa8)](_0x275a5a(0x1d4)+a42_0x1731c7['green']('+'+_0x565eb2['summary'][_0x275a5a(0x232)]+_0x275a5a(0x231))+',\x20'+(a42_0x1731c7[_0x275a5a(0xfe)]('~'+_0x565eb2[_0x275a5a(0x1a2)][_0x275a5a(0x1b6)]+_0x275a5a(0x1a6))+',\x20')+(a42_0x1731c7[_0x275a5a(0x11c)]('-'+_0x565eb2[_0x275a5a(0x1a2)][_0x275a5a(0x1ab)]+_0x275a5a(0xdf))+',\x20')+(''+a42_0x1731c7['dim'](_0x565eb2[_0x275a5a(0x1a2)][_0x275a5a(0x128)]+_0x275a5a(0x14b))));for(const _0xaa784f of _0x565eb2[_0x275a5a(0x18a)]){_0xaa784f[_0x275a5a(0x24a)]===_0x275a5a(0x1b6)&&_0xaa784f['diff']&&(console[_0x275a5a(0xa8)]('\x0a'+a42_0x1731c7[_0x275a5a(0x20a)](_0x275a5a(0x200)+_0xaa784f[_0x275a5a(0x11f)])),console[_0x275a5a(0xa8)](_0xaa784f[_0x275a5a(0x22b)]));}if(!_0x565eb2[_0x275a5a(0x1ac)])return console[_0x275a5a(0xa8)](a42_0x1731c7[_0x275a5a(0x202)](_0x275a5a(0x1d6))),await this['showWorkflowConsoleUrl'](_0x39dc15,_0x565eb2['projectName'],_0x394f46[_0x275a5a(0x195)]),0x0;if(_0x394f46[_0x275a5a(0x1fe)])return console[_0x275a5a(0xa8)](a42_0x1731c7[_0x275a5a(0xfe)](_0x275a5a(0x1d7))),0x0;if(!_0x394f46[_0x275a5a(0x1d3)]){const _0x40900b=await confirmKey(_0x275a5a(0x1dc));if(!_0x40900b)return console[_0x275a5a(0xa8)](_0x275a5a(0x217)),0x0;}const _0x769951=await withSpinner(_0x275a5a(0x118),()=>_0x39dc15[_0x275a5a(0x1e8)][_0x275a5a(0x18d)](_0x565eb2),{'verbose':_0x394f46[_0x275a5a(0x24b)]}),_0x4e09d8=_0x769951['data'];return console[_0x275a5a(0xa8)](a42_0x1731c7[_0x275a5a(0x202)]('✔\x20Push\x20complete')),console[_0x275a5a(0xa8)](_0x275a5a(0xe1)+_0x4e09d8[_0x275a5a(0x209)]),console[_0x275a5a(0xa8)](_0x275a5a(0x21c)+_0x4e09d8[_0x275a5a(0x17f)]),await this['showWorkflowConsoleUrl'](_0x39dc15,_0x4e09d8[_0x275a5a(0x1ee)],_0x394f46['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a42_0x360d23(0x151);[a42_0x360d23(0x12c)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a42_0x360d23(0x146)](_0x10c424){const _0x4faa26=a42_0x360d23,{options:_0x1710bc,args:_0x569c6a,tdx:_0x3d1d6c}=_0x10c424,_0xc1b29c=this['resolveProjectDir'](_0x569c6a,_0x1710bc),_0x830b28=_0x1710bc[_0x4faa26(0x23b)],_0x3c5d76=_0x1710bc[_0x4faa26(0x17f)],_0x306d71=_0x1710bc[_0x4faa26(0xc9)];if(!_0xc1b29c)return console[_0x4faa26(0xa8)](a42_0x1731c7[_0x4faa26(0x11c)](_0x4faa26(0x144)),_0x4faa26(0xb8)),console[_0x4faa26(0xa8)](a42_0x1731c7['dim'](_0x4faa26(0x235))),console['error'](a42_0x1731c7[_0x4faa26(0x1ad)](_0x4faa26(0x16c))),0x1;if(!_0x830b28)return console[_0x4faa26(0xa8)](a42_0x1731c7[_0x4faa26(0x11c)](_0x4faa26(0x144)),_0x4faa26(0x107)),console[_0x4faa26(0xa8)](a42_0x1731c7[_0x4faa26(0x1ad)](_0x4faa26(0x235))),0x1;_0x1710bc[_0x4faa26(0x24b)]&&(console[_0x4faa26(0xa8)](_0x4faa26(0x159)+_0xc1b29c),console[_0x4faa26(0xa8)](_0x4faa26(0x22c)+_0x830b28),_0x3c5d76&&console[_0x4faa26(0xa8)](_0x4faa26(0x236)+_0x3c5d76),_0x1710bc[_0x4faa26(0x1fe)]&&console[_0x4faa26(0xa8)](_0x4faa26(0x243)),_0x306d71&&console['error'](_0x4faa26(0x246)));const _0x37514d=await withSpinner(_0x4faa26(0xfc),()=>_0x3d1d6c['workflow'][_0x4faa26(0x1a1)](_0xc1b29c,_0x830b28,{'revision':_0x3c5d76,'skipValidation':_0x306d71}),{'verbose':_0x1710bc[_0x4faa26(0x24b)]}),_0x2e8ae7=_0x37514d[_0x4faa26(0x239)];console[_0x4faa26(0xa8)](_0x4faa26(0xf6)+_0x2e8ae7[_0x4faa26(0x1ca)]);_0x2e8ae7[_0x4faa26(0x131)]&&console['error'](_0x4faa26(0x19b)+_0x2e8ae7[_0x4faa26(0x131)]);console['error'](_0x4faa26(0x22c)+_0x2e8ae7[_0x4faa26(0x21f)]),console[_0x4faa26(0xa8)]('Revision:\x20'+_0x2e8ae7[_0x4faa26(0x17f)]),console['error']('Files\x20to\x20upload:\x20'+_0x2e8ae7[_0x4faa26(0x11a)]);_0x2e8ae7[_0x4faa26(0xd8)]&&(console['error'](a42_0x1731c7[_0x4faa26(0xfe)](_0x4faa26(0x20f)+_0x2e8ae7[_0x4faa26(0x21f)]+_0x4faa26(0xeb)+_0x2e8ae7[_0x4faa26(0x204)]+')')),console[_0x4faa26(0xa8)](a42_0x1731c7['yellow'](_0x4faa26(0x1b8))));if(_0x1710bc['dryRun'])return console[_0x4faa26(0xa8)](a42_0x1731c7['yellow'](_0x4faa26(0xc2))),0x0;if(!_0x1710bc[_0x4faa26(0x1d3)]){const _0x43493c=_0x2e8ae7[_0x4faa26(0x131)]||a42_0x39af89[_0x4faa26(0x153)](_0xc1b29c),_0x99f4b=_0x2e8ae7[_0x4faa26(0xd8)]?_0x4faa26(0x220)+_0x830b28+'\x22\x20with\x20new\x20revision?':_0x4faa26(0x21a)+_0x43493c+_0x4faa26(0x17c)+_0x830b28+'\x22?',_0x4b8c07=await confirmKey(_0x99f4b);if(!_0x4b8c07)return console[_0x4faa26(0xa8)](_0x4faa26(0x217)),0x0;}const _0x17240c=await withSpinner(_0x2e8ae7[_0x4faa26(0xd8)]?_0x4faa26(0x1b4)+_0x830b28+_0x4faa26(0x23e):_0x4faa26(0x182)+_0x830b28+_0x4faa26(0x23e),()=>_0x3d1d6c[_0x4faa26(0x1e8)][_0x4faa26(0x171)](_0x2e8ae7),{'verbose':_0x1710bc[_0x4faa26(0x24b)]}),_0x44ac45=_0x17240c[_0x4faa26(0x239)];return console[_0x4faa26(0xa8)](a42_0x1731c7[_0x4faa26(0x202)](_0x2e8ae7['targetExists']?'✔\x20Project\x20updated':_0x4faa26(0x15f))),console['error'](_0x4faa26(0x138)+_0x44ac45[_0x4faa26(0x21f)]),console[_0x4faa26(0xa8)](_0x4faa26(0xe1)+_0x44ac45[_0x4faa26(0x114)]),console[_0x4faa26(0xa8)](_0x4faa26(0x21c)+_0x44ac45[_0x4faa26(0x17f)]),await this[_0x4faa26(0xcb)](_0x3d1d6c,_0x44ac45[_0x4faa26(0x21f)],_0x1710bc[_0x4faa26(0x195)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']='workflow:delete';[a42_0x360d23(0x12c)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a42_0x360d23(0x146)](_0x108ff1){const _0x57fff6=a42_0x360d23,{options:_0x247a77,args:_0x58d44d,tdx:_0x2c017b}=_0x108ff1,_0x8122ad=_0x58d44d[0x0];if(!_0x8122ad)return console[_0x57fff6(0xa8)](_0x57fff6(0xf5)),console[_0x57fff6(0xa8)](_0x57fff6(0x127)),0x1;_0x247a77[_0x57fff6(0x24b)]&&console['error']('Project:\x20'+_0x8122ad);if(!_0x247a77['yes']){const _0x1e8cab=await confirmKey(_0x57fff6(0x1f7)+_0x8122ad+_0x57fff6(0x1ae));if(!_0x1e8cab)return console[_0x57fff6(0xa8)](_0x57fff6(0x217)),0x0;}const _0x4b0eb7=await withSpinner('Deleting\x20project\x20'+_0x8122ad+_0x57fff6(0x23e),()=>_0x2c017b[_0x57fff6(0x1e8)][_0x57fff6(0x166)](_0x8122ad),{'verbose':_0x247a77['verbose']}),_0x3e6d9e=_0x4b0eb7['data'];return console[_0x57fff6(0xa8)](_0x57fff6(0x122)+_0x3e6d9e['projectName']),console[_0x57fff6(0xa8)]('\x20\x20Project\x20ID:\x20'+_0x3e6d9e[_0x57fff6(0x209)]),0x0;}}export function parseKeyValue(_0x1337df){const _0x4e9c74=a42_0x360d23,_0x38f49e=_0x1337df[_0x4e9c74(0x15b)]('=');if(_0x38f49e===-0x1)throw new Error(_0x4e9c74(0x145)+_0x1337df+_0x4e9c74(0x1e5));const _0x432826=_0x1337df[_0x4e9c74(0x214)](0x0,_0x38f49e),_0x36d9a3=_0x1337df[_0x4e9c74(0x214)](_0x38f49e+0x1);if(!_0x432826)throw new Error(_0x4e9c74(0x218));return{'key':_0x432826,'value':_0x36d9a3};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a42_0x360d23(0x23b)]='workflow:secrets:list';[a42_0x360d23(0x12c)]=a42_0x360d23(0x13d);async[a42_0x360d23(0x146)](_0x3a514d){const _0x1ba99e=a42_0x360d23,{options:_0x5c91c3,args:_0x37185d,tdx:_0x5b7730}=_0x3a514d,_0x2dad7f=this['requireProject'](_0x37185d,_0x5c91c3);if(!_0x2dad7f)return 0x1;_0x5c91c3[_0x1ba99e(0x24b)]&&console[_0x1ba99e(0xa8)]('Project:\x20'+_0x2dad7f);const _0x56f8b5=await withSpinner(_0x1ba99e(0x173),()=>_0x5b7730[_0x1ba99e(0x1e8)]['listSecrets'](_0x2dad7f),{'verbose':_0x5c91c3[_0x1ba99e(0x24b)]}),{secrets:_0x4885e8}=_0x56f8b5[_0x1ba99e(0x239)];return console[_0x1ba99e(0xa8)](_0x1ba99e(0x207)+_0x4885e8['length']+_0x1ba99e(0x1cd)+(_0x4885e8[_0x1ba99e(0x196)]!==0x1?'s':'')),await handleSDKOutput(_0x4885e8,_0x5c91c3),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']='workflow:secrets:set';[a42_0x360d23(0x12c)]='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async[a42_0x360d23(0x146)](_0x5d30a4){const _0x3fc673=a42_0x360d23,{options:_0x46b94d,args:_0x331657,tdx:_0x598493}=_0x5d30a4;let _0x4774ab,_0x1b7750;if(_0x331657['length']>=0x2)_0x4774ab=_0x331657[0x0],_0x1b7750=_0x331657[0x1];else{if(_0x331657[_0x3fc673(0x196)]===0x1&&_0x46b94d[_0x3fc673(0x14f)])_0x4774ab=_0x46b94d[_0x3fc673(0x14f)],_0x1b7750=_0x331657[0x0];else return _0x331657['length']===0x1?(console['error']('Error:\x20Project\x20name\x20is\x20required'),console[_0x3fc673(0xa8)](_0x3fc673(0x11d)),0x1):(console[_0x3fc673(0xa8)](_0x3fc673(0x16a)),console[_0x3fc673(0xa8)](_0x3fc673(0x1ec)),0x1);}let _0x21e339,_0x2ecc3e;try{({key:_0x21e339,value:_0x2ecc3e}=parseKeyValue(_0x1b7750));}catch(_0x112844){return _0x112844 instanceof Error&&console[_0x3fc673(0xa8)](a42_0x1731c7[_0x3fc673(0x11c)](_0x3fc673(0x144)),_0x112844[_0x3fc673(0x227)]),0x1;}_0x46b94d[_0x3fc673(0x24b)]&&(console[_0x3fc673(0xa8)](_0x3fc673(0x1c6)+_0x4774ab),console[_0x3fc673(0xa8)](_0x3fc673(0xa9)+_0x21e339));const _0x5a96d6=await withSpinner(_0x3fc673(0xb1),()=>_0x598493['workflow']['setSecret'](_0x4774ab,_0x21e339,_0x2ecc3e),{'verbose':_0x46b94d[_0x3fc673(0x24b)]}),_0x273170=_0x5a96d6[_0x3fc673(0x239)];return console[_0x3fc673(0xa8)]('✔\x20Secret\x20\x27'+_0x273170['key']+_0x3fc673(0x1ff)+_0x273170[_0x3fc673(0x1ee)]+'\x27'),(_0x46b94d[_0x3fc673(0x112)]||_0x46b94d['jsonl'])&&await handleSingleObjectOutput(_0x273170,_0x46b94d),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a42_0x360d23(0x23b)]=a42_0x360d23(0x13f);[a42_0x360d23(0x12c)]='Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project';async[a42_0x360d23(0x146)](_0x1e821a){const _0x36e363=a42_0x360d23,{options:_0x2c3826,args:_0x3b7645,tdx:_0x7470cc}=_0x1e821a;let _0x13650e,_0x4c8ff7;if(_0x3b7645[_0x36e363(0x196)]>=0x2)_0x13650e=_0x3b7645[0x0],_0x4c8ff7=_0x3b7645[0x1];else{if(_0x3b7645[_0x36e363(0x196)]===0x1&&_0x2c3826[_0x36e363(0x14f)])_0x13650e=_0x2c3826[_0x36e363(0x14f)],_0x4c8ff7=_0x3b7645[0x0];else return _0x3b7645[_0x36e363(0x196)]===0x1?(console[_0x36e363(0xa8)](_0x36e363(0x1fc)),console['error'](_0x36e363(0x11d)),0x1):(console['error'](_0x36e363(0xd9)),console[_0x36e363(0xa8)]('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x2c3826[_0x36e363(0x24b)]&&(console[_0x36e363(0xa8)](_0x36e363(0x1c6)+_0x13650e),console[_0x36e363(0xa8)](_0x36e363(0xa9)+_0x4c8ff7));if(!_0x2c3826['yes']){const _0x2c63c1=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x4c8ff7+_0x36e363(0x20c)+_0x13650e+'\x27?');if(!_0x2c63c1)return console['error'](_0x36e363(0x217)),0x0;}const _0x10886b=await withSpinner('Deleting\x20secret...',()=>_0x7470cc['workflow'][_0x36e363(0x18c)](_0x13650e,_0x4c8ff7),{'verbose':_0x2c3826[_0x36e363(0x24b)]}),_0x18629f=_0x10886b['data'];return console[_0x36e363(0xa8)](_0x36e363(0xb6)+_0x18629f[_0x36e363(0x133)]+_0x36e363(0x1c5)+_0x18629f['projectName']+'\x27'),(_0x2c3826[_0x36e363(0x112)]||_0x2c3826[_0x36e363(0x125)])&&await handleSingleObjectOutput(_0x18629f,_0x2c3826),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(_0x3a3b61){const _0x8f5ba5=a42_0x360d23,_0x3edc38=Math['floor'](_0x3a3b61/0x3e8),_0x410dd2=Math[_0x8f5ba5(0x192)](_0x3edc38/0x3c),_0x463675=Math['floor'](_0x410dd2/0x3c),_0x36d0cb=Math[_0x8f5ba5(0x192)](_0x463675/0x18);if(_0x36d0cb>0x0){const _0x6b14b8=_0x463675%0x18;return _0x6b14b8>0x0?_0x36d0cb+'d\x20'+_0x6b14b8+'h':_0x36d0cb+'d';}else{if(_0x463675>0x0){const _0x1ac479=_0x410dd2%0x3c;return _0x1ac479>0x0?_0x463675+'h\x20'+_0x1ac479+'m':_0x463675+'h';}else{if(_0x410dd2>0x0){const _0x1491d2=_0x3edc38%0x3c;return _0x1491d2>0x0?_0x410dd2+'m\x20'+_0x1491d2+'s':_0x410dd2+'m';}else return _0x3edc38+'s';}}}function formatTimestamp(_0xede36a,_0xb8f0e2){const _0x5bdba1=a42_0x360d23,_0x4ec1d5=new Date(_0xede36a),_0x5bba14=String(_0x4ec1d5['getHours']())[_0x5bdba1(0xce)](0x2,'0'),_0x3947a7=String(_0x4ec1d5[_0x5bdba1(0x228)]())[_0x5bdba1(0xce)](0x2,'0'),_0x4c8b43=_0x5bba14+':'+_0x3947a7,_0x10cbb0=_0x4ec1d5[_0x5bdba1(0x1cf)]()===_0xb8f0e2[_0x5bdba1(0x1cf)]()&&_0x4ec1d5[_0x5bdba1(0xe3)]()===_0xb8f0e2[_0x5bdba1(0xe3)]()&&_0x4ec1d5['getDate']()===_0xb8f0e2[_0x5bdba1(0x155)]();if(_0x10cbb0)return _0x4c8b43;else{const _0x239e3e=String(_0x4ec1d5[_0x5bdba1(0xe3)]()+0x1)[_0x5bdba1(0xce)](0x2,'0'),_0x23bd5c=String(_0x4ec1d5[_0x5bdba1(0x155)]())['padStart'](0x2,'0');return _0x239e3e+'-'+_0x23bd5c+'\x20'+_0x4c8b43;}}function formatDate(_0xf3d4a8){const _0x872e8d=a42_0x360d23,_0x154073=_0xf3d4a8['getFullYear'](),_0x27f0b3=String(_0xf3d4a8[_0x872e8d(0xe3)]()+0x1)['padStart'](0x2,'0'),_0x362c94=String(_0xf3d4a8[_0x872e8d(0x155)]())[_0x872e8d(0xce)](0x2,'0');return _0x154073+'-'+_0x27f0b3+'-'+_0x362c94;}function getTaskStateIcon(_0x4e9b92){const _0x1d3b6d={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x1d3b6d[_0x4e9b92]||'⚪';}function getBarChar(_0x2a3c76){const _0x4e9f06=a42_0x360d23;return _0x2a3c76==='error'||_0x2a3c76===_0x4e9f06(0x119)?'×':'─';}function getBarColor(_0x425047){const _0x2b9d6b=a42_0x360d23,_0x8b294f={'success':a42_0x1731c7[_0x2b9d6b(0x202)],'error':a42_0x1731c7[_0x2b9d6b(0x11c)],'group_error':a42_0x1731c7[_0x2b9d6b(0x11c)],'running':a42_0x1731c7[_0x2b9d6b(0x1f9)],'blocked':a42_0x1731c7['yellow'],'planned':a42_0x1731c7[_0x2b9d6b(0x1ad)],'canceling':a42_0x1731c7['yellow']};return _0x8b294f[_0x425047]||a42_0x1731c7[_0x2b9d6b(0x111)];}function parseTaskName(_0x592fdf){const _0xed1652=a42_0x360d23;let _0x21f645=_0x592fdf[_0xed1652(0x1f3)](/^\++/,'');const _0x5cb317=_0x21f645['split']('+'),_0x29d3ab=_0x5cb317['length']>0x1?_0x5cb317[_0xed1652(0x196)]-0x2:0x0,_0x1e8430=_0x5cb317[_0x5cb317['length']-0x1]||_0x21f645;return{'level':_0x29d3ab,'name':'+'+_0x1e8430};}function truncateTaskName(_0x102db6,_0x1677e4){const _0x105633=a42_0x360d23,_0x2242e2=stringWidth(_0x102db6);if(_0x2242e2<=_0x1677e4)return _0x102db6;let _0x2af6e5=_0x102db6;while(stringWidth(_0x2af6e5+'…')>_0x1677e4&&_0x2af6e5[_0x105633(0x196)]>0x0){_0x2af6e5=_0x2af6e5['slice'](0x0,-0x1);}return _0x2af6e5+'…';}function calculateTimeScale(_0x20e8e8,_0x3bd830){const _0x30b2c4=a42_0x360d23;return{'startTime':_0x20e8e8[_0x30b2c4(0x17d)],'endTime':_0x20e8e8[_0x30b2c4(0xcc)],'durationMs':_0x20e8e8[_0x30b2c4(0x177)],'msPerChar':_0x20e8e8['duration']/_0x3bd830};}function timeToPosition(_0x5447e1,_0x287171,_0x4bd380){const _0x2f49a8=a42_0x360d23,_0x22b1f6=_0x5447e1-_0x287171[_0x2f49a8(0x234)],_0x30cc0a=Math[_0x2f49a8(0x192)](_0x22b1f6/_0x287171[_0x2f49a8(0x205)]);return Math['max'](0x0,Math[_0x2f49a8(0xb2)](_0x30cc0a,_0x4bd380));}function renderTimeAxis(_0x4d769b,_0x52e4e7){const _0x4379c0=a42_0x360d23,_0xa8e57d=Math['min'](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math['max'](TIMELINE_CONFIG[_0x4379c0(0x247)],Math[_0x4379c0(0x192)](_0x52e4e7/TIMELINE_CONFIG[_0x4379c0(0x219)]))),_0x3bb456=_0x4d769b['durationMs']/(_0xa8e57d-0x1),_0x27b83a=new Date(_0x4d769b[_0x4379c0(0x234)]),_0x303c48=[];for(let _0x591161=0x0;_0x591161<_0xa8e57d;_0x591161++){const _0x26e1b0=_0x4d769b['startTime']+_0x591161*_0x3bb456,_0xc35e66=timeToPosition(_0x26e1b0,_0x4d769b,_0x52e4e7),_0x537879=formatTimestamp(_0x26e1b0,_0x27b83a);_0x303c48[_0x4379c0(0x14d)]({'pos':_0xc35e66,'text':_0x537879});}const _0x2e8f6c=new Array(_0x52e4e7)[_0x4379c0(0xbd)]('\x20');let _0x2ae80e=-0x1;for(const {pos:_0x50be8d,text:_0x435179}of _0x303c48){let _0x3dbca9=Math['max'](0x0,_0x50be8d-Math[_0x4379c0(0x192)](_0x435179['length']/0x2));_0x3dbca9<=_0x2ae80e+TIMELINE_CONFIG[_0x4379c0(0xbe)]&&(_0x3dbca9=_0x2ae80e+TIMELINE_CONFIG[_0x4379c0(0xbe)]+0x1);_0x3dbca9+_0x435179[_0x4379c0(0x196)]>_0x52e4e7&&(_0x3dbca9=_0x52e4e7-_0x435179[_0x4379c0(0x196)]);if(_0x3dbca9>=0x0&&_0x3dbca9+_0x435179[_0x4379c0(0x196)]<=_0x52e4e7&&_0x3dbca9>_0x2ae80e){for(let _0x2de9c0=0x0;_0x2de9c0<_0x435179['length'];_0x2de9c0++){_0x2e8f6c[_0x3dbca9+_0x2de9c0]=_0x435179[_0x2de9c0];}_0x2ae80e=_0x3dbca9+_0x435179[_0x4379c0(0x196)]-0x1;}}return _0x2e8f6c[_0x4379c0(0x1f0)]('');}function renderTaskRow(_0x497ff4,_0x5cd396,_0x5af6b8,_0xeabc74){const _0x458cb1=a42_0x360d23,{level:_0x123a0f,name:_0xfcafa1}=parseTaskName(_0x497ff4[_0x458cb1(0x23b)]),_0x388253='\x20'['repeat'](_0x123a0f),_0x4510f9=_0x497ff4[_0x458cb1(0x1c4)]?'('+formatElapsed(_0x497ff4[_0x458cb1(0x1c4)][_0x458cb1(0x177)])+')':'',_0x438b60=stringWidth(_0x4510f9),_0x45bd13=_0x123a0f*0x1,_0x1db41f=_0xeabc74-_0x45bd13-_0x438b60-0x1,_0x430d4c=truncateTaskName(_0xfcafa1,_0x1db41f),_0x5d5f1c=_0x388253+_0x430d4c,_0x43a428=stringWidth(_0x5d5f1c),_0x370d49=_0xeabc74-_0x43a428-_0x438b60,_0x214f95=_0x5d5f1c+'\x20'['repeat'](Math[_0x458cb1(0x241)](0x1,_0x370d49))+a42_0x1731c7[_0x458cb1(0x1ad)](_0x4510f9),_0x4b1fde=getTaskStateIcon(_0x497ff4[_0x458cb1(0xed)]),_0x12273c=new Array(_0x5af6b8)['fill']('\x20');if(_0x497ff4['window']){const _0x3de936=timeToPosition(_0x497ff4[_0x458cb1(0x1c4)][_0x458cb1(0x17d)],_0x5cd396,_0x5af6b8),_0x7fb8c7=timeToPosition(_0x497ff4[_0x458cb1(0x1c4)][_0x458cb1(0xcc)],_0x5cd396,_0x5af6b8),_0x2070de=getBarChar(_0x497ff4[_0x458cb1(0xed)]),_0x1c0768=Math[_0x458cb1(0x241)](_0x3de936+0x1,_0x7fb8c7);for(let _0x4bcb49=_0x3de936;_0x4bcb49<Math['min'](_0x1c0768,_0x5af6b8);_0x4bcb49++){_0x12273c[_0x4bcb49]=_0x2070de;}}const _0x27bf6e=getBarColor(_0x497ff4[_0x458cb1(0xed)]),_0x33dad4=_0x12273c[_0x458cb1(0x113)](_0x41ada3=>_0x41ada3==='\x20'?'\x20':_0x27bf6e(_0x41ada3))[_0x458cb1(0x1f0)]('');return _0x4b1fde+'\x20'+_0x214f95+'│'+_0x33dad4+'│';}function calculateStats(_0x53faf1){const _0xf4710f=a42_0x360d23,_0x47971f={'total':_0x53faf1['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x30ac0d of _0x53faf1){if(_0x30ac0d['state']===_0xf4710f(0x1c7))_0x47971f[_0xf4710f(0x1c7)]++;else{if(_0x30ac0d[_0xf4710f(0xed)]===_0xf4710f(0xa8)||_0x30ac0d[_0xf4710f(0xed)]===_0xf4710f(0x119))_0x47971f[_0xf4710f(0xa8)]++;else _0x30ac0d[_0xf4710f(0xed)]==='running'?_0x47971f[_0xf4710f(0x137)]++:_0x47971f[_0xf4710f(0xc7)]++;}}return _0x47971f;}function formatStats(_0x5b58a5){const _0x3cf95d=a42_0x360d23;return[_0x3cf95d(0x19e)+_0x5b58a5[_0x3cf95d(0x101)],'✅\x20'+_0x5b58a5[_0x3cf95d(0x1c7)],'❌\x20'+_0x5b58a5[_0x3cf95d(0xa8)],_0x3cf95d(0x12f)+_0x5b58a5['running'],'⏳\x20'+_0x5b58a5[_0x3cf95d(0xc7)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a42_0x360d23(0x23b)]='workflow:timeline';['description']=a42_0x360d23(0x100);async[a42_0x360d23(0x146)](_0x16a818){const _0x4ba1e9=a42_0x360d23,{options:_0x4df388,args:_0x574754,tdx:_0x77131d}=_0x16a818;let _0x9aa4e4,_0x5a159d,_0x57bb77=![];if(_0x574754[0x0]){if(_0x574754[0x0]['includes']('.')){const _0x2ac6b3=this[_0x4ba1e9(0x19a)](_0x574754,_0x4df388);if(!_0x2ac6b3)return 0x1;_0x9aa4e4=_0x2ac6b3['projectName'],_0x5a159d=_0x2ac6b3[_0x4ba1e9(0x1d8)];}else{_0x5a159d=_0x574754[0x0],_0x9aa4e4=_0x4df388[_0x4ba1e9(0x14f)];if(!_0x9aa4e4)return console['error'](a42_0x1731c7[_0x4ba1e9(0x11c)](_0x4ba1e9(0x144)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x57bb77=!![];}}else{const _0x52a83b=this[_0x4ba1e9(0x19a)](_0x574754,_0x4df388);if(!_0x52a83b)return 0x1;_0x9aa4e4=_0x52a83b[_0x4ba1e9(0x1ee)],_0x5a159d=_0x52a83b[_0x4ba1e9(0x1d8)];}if(_0x4df388[_0x4ba1e9(0x24b)]){if(_0x9aa4e4&&_0x5a159d)console[_0x4ba1e9(0xa8)](_0x4ba1e9(0x170)+_0x9aa4e4+'.'+_0x5a159d);else _0x9aa4e4&&console[_0x4ba1e9(0xa8)](_0x4ba1e9(0x1df)+_0x9aa4e4);}const _0x43d39c=_0x4df388['attemptId'],_0x5013e4=_0x4df388[_0x4ba1e9(0x18b)];if(_0x43d39c){_0x5013e4&&console[_0x4ba1e9(0xa8)](a42_0x1731c7['yellow'](_0x4ba1e9(0x178)),_0x4ba1e9(0x1ba));const _0x32e182=_0x4df388[_0x4ba1e9(0x154)];return _0x32e182?await this[_0x4ba1e9(0x242)](_0x16a818,_0x43d39c):await this[_0x4ba1e9(0x17a)](_0x16a818,_0x43d39c,_0x4df388),0x0;}if(_0x5013e4){const _0x3689eb=await withSpinner('Loading\x20session...',()=>_0x77131d[_0x4ba1e9(0x1e8)][_0x4ba1e9(0x1b2)]({'projectName':_0x9aa4e4,'workflowName':_0x5a159d,'limit':0x64}),{'verbose':_0x4df388['verbose']}),_0x4a87ce=_0x3689eb['data'][_0x4ba1e9(0x1af)](_0x5f5d9a=>_0x5f5d9a['id']===_0x5013e4);if(!_0x4a87ce)return console['error'](a42_0x1731c7[_0x4ba1e9(0x11c)](_0x4ba1e9(0x144)),_0x4ba1e9(0x1e3)+_0x5013e4),0x1;if(!_0x4a87ce[_0x4ba1e9(0x233)]?.['id'])return console[_0x4ba1e9(0xa8)](a42_0x1731c7[_0x4ba1e9(0x11c)](_0x4ba1e9(0x144)),_0x4ba1e9(0x1fa)+_0x5013e4+'\x20has\x20no\x20attempts'),0x1;const _0x5623a6=_0x4a87ce[_0x4ba1e9(0x233)]['id'];_0x4df388[_0x4ba1e9(0x24b)]&&console[_0x4ba1e9(0xa8)]('Using\x20attempt\x20'+_0x5623a6+'\x20from\x20session\x20'+_0x5013e4);const _0x572303=_0x4df388[_0x4ba1e9(0x154)];return _0x572303?await this[_0x4ba1e9(0x242)](_0x16a818,_0x5623a6):await this[_0x4ba1e9(0x17a)](_0x16a818,_0x5623a6,_0x4df388),0x0;}const _0x5b2a19=await withSpinner(_0x4ba1e9(0x23d),()=>_0x77131d['workflow'][_0x4ba1e9(0x1b2)]({'projectName':_0x9aa4e4,'workflowName':_0x5a159d,'limit':_0x4df388['limit']||0x32}),{'verbose':_0x4df388[_0x4ba1e9(0x24b)]}),_0x29e554=_0x5b2a19[_0x4ba1e9(0x239)];if(_0x29e554['length']===0x0){if(_0x9aa4e4&&_0x5a159d)console[_0x4ba1e9(0xa8)](_0x4ba1e9(0x168)+_0x9aa4e4+'.'+_0x5a159d);else _0x9aa4e4?console[_0x4ba1e9(0xa8)](_0x4ba1e9(0xc5)+_0x9aa4e4):(console[_0x4ba1e9(0xa8)](_0x4ba1e9(0x141)),console[_0x4ba1e9(0xa8)](a42_0x1731c7['dim'](_0x4ba1e9(0xd3))));return 0x0;}_0x29e554[_0x4ba1e9(0x229)]((_0x4c64a3,_0x2ba98d)=>{const _0x3d091b=_0x4ba1e9,_0x3bf566=_0x4c64a3[_0x3d091b(0x13b)]||'',_0x21f6c6=_0x2ba98d[_0x3d091b(0x13b)]||'';return _0x21f6c6[_0x3d091b(0x1d0)](_0x3bf566);});if(_0x4df388[_0x4ba1e9(0x112)]||_0x4df388[_0x4ba1e9(0x125)])return await handleSDKOutput(_0x29e554,_0x4df388),0x0;let _0x27a463;if(_0x57bb77){const _0x1b5c0b=_0x29e554[0x0];if(!_0x1b5c0b[_0x4ba1e9(0x233)]?.['id'])return console[_0x4ba1e9(0xa8)](_0x4ba1e9(0x22d)),0x0;_0x27a463=_0x1b5c0b['lastAttempt']['id'],_0x4df388[_0x4ba1e9(0x24b)]&&console[_0x4ba1e9(0xa8)]('Auto-selected\x20latest\x20session:\x20'+_0x1b5c0b['sessionTime']);}else{const _0x194510=_0x29e554['map'](_0xb06fe8=>{const _0x4b7ee0=_0x4ba1e9,_0x24c05a=getAttemptStatusDisplay(_0xb06fe8['lastAttempt']);return{'title':_0xb06fe8[_0x4b7ee0(0xe8)]?.[_0x4b7ee0(0x23b)]+'.'+_0xb06fe8[_0x4b7ee0(0x1e8)]?.['name']+_0x4b7ee0(0xe9)+_0xb06fe8[_0x4b7ee0(0x13b)]+'\x20'+_0x24c05a[_0x4b7ee0(0x1b7)],'value':_0xb06fe8['lastAttempt']?.['id']||'','description':_0x24c05a[_0x4b7ee0(0x104)]};}),_0x513b14=await a42_0x8efb79({'type':'select','name':'attemptId','message':_0x4ba1e9(0x1dd),'choices':_0x194510[_0x4ba1e9(0x13e)](_0x263b0c=>_0x263b0c['value']!=='')});if(!_0x513b14[_0x4ba1e9(0xe5)])return 0x0;_0x27a463=_0x513b14[_0x4ba1e9(0xe5)];}const _0x4898f2=_0x4df388['follow'];return _0x4898f2?await this[_0x4ba1e9(0x242)](_0x16a818,_0x27a463):await this[_0x4ba1e9(0x17a)](_0x16a818,_0x27a463,_0x4df388),0x0;}async[a42_0x360d23(0x17a)](_0x227f80,_0x14e893,_0x19f2c8){const _0x5b6326=a42_0x360d23,{tdx:_0x2a5fc1}=_0x227f80;let _0x259eed,_0x610bf2;try{[_0x259eed,_0x610bf2]=await Promise[_0x5b6326(0x1de)]([_0x2a5fc1[_0x5b6326(0x1e8)]['attempt'](_0x14e893),_0x2a5fc1[_0x5b6326(0x1e8)][_0x5b6326(0xd1)](_0x14e893,![])]);}catch(_0x366026){console[_0x5b6326(0xa8)](a42_0x1731c7[_0x5b6326(0x11c)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x19f2c8['verbose']&&console[_0x5b6326(0xa8)](_0x366026);throw _0x366026;}if(_0x19f2c8['json']||_0x19f2c8['jsonl']){const _0x17ace4=this['buildTimelineData'](_0x259eed,_0x610bf2);await handleSDKOutput([_0x17ace4],_0x19f2c8);return;}const _0x9365f9=_0x2a5fc1[_0x5b6326(0xa0)][_0x5b6326(0x195)],_0x367d2d=this['renderTimeline'](_0x259eed,_0x610bf2,_0x9365f9);console[_0x5b6326(0x11b)](_0x367d2d);}async[a42_0x360d23(0x242)](_0x443ae5,_0xd2b4b3){const _0x26fb56=a42_0x360d23,{tdx:_0x53786a}=_0x443ae5,_0x17169d=TIMELINE_CONFIG[_0x26fb56(0x19d)],_0x4620e5=TIMELINE_CONFIG[_0x26fb56(0xcf)];let _0x1672da=0x0;while(_0x1672da<_0x4620e5){process['stdout'][_0x26fb56(0x1e2)]&&process[_0x26fb56(0x126)][_0x26fb56(0x21d)]('\x1bc');let _0x39e49,_0x8755bb;try{[_0x39e49,_0x8755bb]=await Promise[_0x26fb56(0x1de)]([_0x53786a[_0x26fb56(0x1e8)][_0x26fb56(0x1da)](_0xd2b4b3),_0x53786a['workflow'][_0x26fb56(0xd1)](_0xd2b4b3,![])]);}catch(_0x51ae73){console[_0x26fb56(0xa8)](a42_0x1731c7[_0x26fb56(0x11c)](_0x26fb56(0x180)));_0x1672da>0x0&&console['error'](a42_0x1731c7[_0x26fb56(0x1ad)](_0x26fb56(0x23f)+_0x1672da));throw _0x51ae73;}const _0x1daf61=_0x53786a['context']['site'],_0x548a0a=this[_0x26fb56(0x248)](_0x39e49,_0x8755bb,_0x1daf61);console['log'](_0x548a0a);const _0x59e8d7=_0x39e49[_0x26fb56(0x165)]&&_0x8755bb[_0x26fb56(0x1bf)](_0x38f50c=>_0x38f50c['state']!==_0x26fb56(0x137)&&_0x38f50c[_0x26fb56(0xed)]!==_0x26fb56(0xc4));if(_0x59e8d7){console[_0x26fb56(0xa8)](a42_0x1731c7['green'](_0x26fb56(0x152)));break;}console[_0x26fb56(0xa8)](a42_0x1731c7[_0x26fb56(0x1ad)](_0x26fb56(0x17b)+_0x1672da*0x2+_0x26fb56(0xfd))),await new Promise(_0x233d6f=>setTimeout(_0x233d6f,_0x17169d)),_0x1672da++;}_0x1672da>=_0x4620e5&&console[_0x26fb56(0xa8)](a42_0x1731c7[_0x26fb56(0xfe)](_0x26fb56(0x19c)));}[a42_0x360d23(0x248)](_0x21abfd,_0x188c87,_0x2acd59){const _0x264dec=a42_0x360d23,_0x454786=[],_0x2849fa=TIMELINE_CONFIG[_0x264dec(0x10e)],_0x3eb1e8=0x5,_0x30afd2=process[_0x264dec(0x126)][_0x264dec(0x1e9)]||0x78,_0x436264=_0x30afd2-_0x2849fa-_0x3eb1e8,_0x15ff8f=Math['max'](TIMELINE_CONFIG[_0x264dec(0x17e)],Math[_0x264dec(0xb2)](_0x436264,TIMELINE_CONFIG[_0x264dec(0x147)])),_0xab9db=new Date(_0x21abfd[_0x264dec(0x134)])[_0x264dec(0x22f)](),_0x4ac006=_0x21abfd[_0x264dec(0xa4)]?new Date(_0x21abfd['finishedAt'])[_0x264dec(0x22f)]():Date[_0x264dec(0x106)](),_0x5f2342={'start':_0xab9db,'end':_0x4ac006,'duration':_0x4ac006-_0xab9db},_0x2bff74=new Map(),_0x20322e=[];for(const _0x5f3eff of _0x188c87){if(_0x5f3eff[_0x264dec(0x1a9)]){const _0x38b2b8=new Date(_0x5f3eff[_0x264dec(0x1a9)])[_0x264dec(0x22f)](),_0x2c4a7f=_0x5f3eff[_0x264dec(0x169)]?new Date(_0x5f3eff[_0x264dec(0x169)])[_0x264dec(0x22f)]():Date[_0x264dec(0x106)](),_0x5d5a38={'start':_0x38b2b8,'end':_0x2c4a7f,'duration':_0x2c4a7f-_0x38b2b8};_0x2bff74[_0x264dec(0x1d5)](_0x5f3eff['id'],_0x5d5a38),_0x20322e[_0x264dec(0x14d)]({'name':_0x5f3eff[_0x264dec(0xa3)],'state':_0x5f3eff['state']||_0x264dec(0x1b0),'window':_0x5d5a38});}else _0x20322e[_0x264dec(0x14d)]({'name':_0x5f3eff[_0x264dec(0xa3)],'state':_0x5f3eff[_0x264dec(0xed)]||'planned','window':undefined});}_0x20322e[_0x264dec(0x229)]((_0x35e101,_0x36730a)=>{const _0x4603ec=_0x264dec;if(!_0x35e101[_0x4603ec(0x1c4)])return 0x1;if(!_0x36730a['window'])return-0x1;return _0x35e101['window']['start']-_0x36730a[_0x4603ec(0x1c4)][_0x4603ec(0x17d)];});const _0x958546=_0x20322e[_0x264dec(0x196)],_0x53192f=_0x958546>TIMELINE_CONFIG[_0x264dec(0x16d)];_0x53192f&&_0x20322e[_0x264dec(0x197)](TIMELINE_CONFIG[_0x264dec(0x16d)]);const _0x29d523=calculateTimeScale(_0x5f2342,_0x15ff8f),_0x552c67=_0x21abfd[_0x264dec(0x165)]?_0x21abfd[_0x264dec(0x1c7)]?a42_0x1731c7['green'](_0x264dec(0x1c7)):a42_0x1731c7[_0x264dec(0x11c)](_0x264dec(0xa8)):a42_0x1731c7[_0x264dec(0x1f9)](_0x264dec(0x137)),_0x28f17b=_0x21abfd['project']?.['id'],_0x38157a=_0x21abfd[_0x264dec(0x18b)];let _0x1c0646;if(_0x28f17b&&_0x38157a){const _0x1b10fe=getWorkflowAttemptUrl(_0x2acd59,_0x28f17b,_0x38157a,_0x21abfd['id']);_0x1c0646=hyperlink(a42_0x1731c7[_0x264dec(0x1ad)](_0x21abfd['id']),_0x1b10fe);}else _0x1c0646=a42_0x1731c7[_0x264dec(0x1ad)](_0x21abfd['id']);_0x454786[_0x264dec(0x14d)]('Attempt:\x20'+_0x1c0646+'\x20-\x20'+_0x552c67+'\x20-\x20'+formatElapsed(_0x5f2342['duration']));if(_0x20322e[_0x264dec(0x196)]>0x0){const _0x58e545=renderTimeAxis(_0x29d523,_0x15ff8f),_0x1d3a23=new Date(_0x5f2342['start']),_0x5436a5=formatDate(_0x1d3a23),_0x16ecc3=TIMELINE_CONFIG[_0x264dec(0xe0)]+TIMELINE_CONFIG[_0x264dec(0x221)]+_0x2849fa,_0x8c8015=_0x5436a5[_0x264dec(0xce)](_0x16ecc3),_0x2e8c5e=a42_0x1731c7['dim'](_0x8c8015);_0x454786[_0x264dec(0x14d)](_0x2e8c5e+'\x20'+_0x58e545);for(const _0x6bab47 of _0x20322e){_0x454786[_0x264dec(0x14d)](renderTaskRow(_0x6bab47,_0x29d523,_0x15ff8f,_0x2849fa));}const _0x152040=calculateStats(_0x20322e);_0x454786['push'](formatStats(_0x152040)),_0x53192f&&_0x454786['push'](a42_0x1731c7[_0x264dec(0xfe)](_0x264dec(0x1f8)+TIMELINE_CONFIG[_0x264dec(0x16d)]+_0x264dec(0x226)+_0x958546+_0x264dec(0x1e1))),_0x454786['push'](''),_0x454786[_0x264dec(0x14d)](a42_0x1731c7[_0x264dec(0x1ad)](_0x264dec(0x183))+(_0x264dec(0xa2)+_0x21abfd['id']+_0x264dec(0x161))+a42_0x1731c7[_0x264dec(0x1ad)](_0x264dec(0x1ea)));}else _0x454786[_0x264dec(0x14d)](_0x264dec(0x1c8));return _0x454786[_0x264dec(0x1f0)]('\x0a');}[a42_0x360d23(0x103)](_0x1557bc,_0x26d4f2){const _0x48f1a5=a42_0x360d23,_0x49d4b1=new Date(_0x1557bc[_0x48f1a5(0x134)])['getTime'](),_0xd2b7d3=_0x1557bc[_0x48f1a5(0xa4)]?new Date(_0x1557bc[_0x48f1a5(0xa4)])[_0x48f1a5(0x22f)]():Date[_0x48f1a5(0x106)](),_0x47bce5=_0xd2b7d3-_0x49d4b1,_0x34cb9e=[];for(const _0x44bc5e of _0x26d4f2){if(_0x44bc5e[_0x48f1a5(0x1a9)]){const _0xf40928=new Date(_0x44bc5e[_0x48f1a5(0x1a9)])['getTime'](),_0x3d8164=_0x44bc5e[_0x48f1a5(0x169)]?new Date(_0x44bc5e[_0x48f1a5(0x169)])[_0x48f1a5(0x22f)]():Date[_0x48f1a5(0x106)]();_0x34cb9e[_0x48f1a5(0x14d)]({'name':_0x44bc5e['fullName'],'state':_0x44bc5e[_0x48f1a5(0xed)]||_0x48f1a5(0x1b0),'window':{'start':_0xf40928,'end':_0x3d8164,'duration':_0x3d8164-_0xf40928}});}else _0x34cb9e[_0x48f1a5(0x14d)]({'name':_0x44bc5e[_0x48f1a5(0xa3)],'state':_0x44bc5e[_0x48f1a5(0xed)]||_0x48f1a5(0xc4),'window':undefined});}const _0xb4c218=calculateStats(_0x34cb9e);return{'attempt':{'id':_0x1557bc['id'],'status':_0x1557bc['done']?_0x1557bc[_0x48f1a5(0x1c7)]?'success':_0x48f1a5(0xa8):_0x48f1a5(0x137),'createdAt':_0x1557bc[_0x48f1a5(0x134)],'finishedAt':_0x1557bc['finishedAt'],'duration_ms':_0x47bce5},'tasks':_0x34cb9e[_0x48f1a5(0x113)](_0x1efae3=>({'name':_0x1efae3[_0x48f1a5(0x23b)],'state':_0x1efae3[_0x48f1a5(0xed)],'startedAt':_0x1efae3['window']?new Date(_0x1efae3['window']['start'])[_0x48f1a5(0x115)]():null,'updatedAt':_0x1efae3[_0x48f1a5(0x1c4)]?new Date(_0x1efae3[_0x48f1a5(0x1c4)][_0x48f1a5(0xcc)])[_0x48f1a5(0x115)]():null,'duration_ms':_0x1efae3[_0x48f1a5(0x1c4)]?.[_0x48f1a5(0x177)]||null})),'stats':_0xb4c218};}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2f3357,_0x5cb04c){const _0x1c4cd6=a43_0x46b7,_0x2da80e=_0x2f3357();while(!![]){try{const _0x476f6d=parseInt(_0x1c4cd6(0xf0))/0x1*(-parseInt(_0x1c4cd6(0xf8))/0x2)+parseInt(_0x1c4cd6(0xe9))/0x3*(parseInt(_0x1c4cd6(0xf3))/0x4)+parseInt(_0x1c4cd6(0xee))/0x5+-parseInt(_0x1c4cd6(0xf2))/0x6*(parseInt(_0x1c4cd6(0xf1))/0x7)+parseInt(_0x1c4cd6(0xed))/0x8*(-parseInt(_0x1c4cd6(0xe8))/0x9)+parseInt(_0x1c4cd6(0xf4))/0xa*(parseInt(_0x1c4cd6(0xec))/0xb)+-parseInt(_0x1c4cd6(0xeb))/0xc;if(_0x476f6d===_0x5cb04c)break;else _0x2da80e['push'](_0x2da80e['shift']());}catch(_0x14f67c){_0x2da80e['push'](_0x2da80e['shift']());}}}(a43_0x513f,0xb1f97));import{platform}from'os';function a43_0x46b7(_0x34619e,_0x109eb0){_0x34619e=_0x34619e-0xe7;const _0x513fd6=a43_0x513f();let _0x46b7c6=_0x513fd6[_0x34619e];return _0x46b7c6;}import{getAPIKey}from'./config.js';function a43_0x513f(){const _0x576846=['30890ulTgPS','version',';\x20node/','Authorization','4ZmuvyV','tdx/','X-Trino-User','5003019GgwGeD','21YIoVUd','replace','16822752cCjVoK','2266tasylY','8OlLMDd','6269670uhMEPE','length','34179wcOniV','8953LxyHpI','534knRLhe','559252zOlhjS'];a43_0x513f=function(){return _0x576846;};return a43_0x513f();}import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x32bef4=a43_0x46b7,_0x2435c2=getVersion(),_0x56bac8=platform(),_0x2b4d05=process[_0x32bef4(0xf5)][_0x32bef4(0xea)]('v','');return _0x32bef4(0xf9)+_0x2435c2+'\x20('+_0x56bac8+_0x32bef4(0xf6)+_0x2b4d05+')';}export function getAuthHeaders(_0x34e9db,_0x2f8b98){const _0x701fec=a43_0x46b7,_0x3c99b6=getVersion(),_0x3b7817={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x3c99b6};return _0x2f8b98&&(_0x3b7817[_0x701fec(0xf7)]='TD1\x20'+_0x2f8b98),_0x3b7817;}export function toHeaderRecord(_0x536f2e){const _0x1cadae={};for(const [_0x43e689,_0x3623cf]of Object['entries'](_0x536f2e)){_0x3623cf!==undefined&&(_0x1cadae[_0x43e689]=_0x3623cf);}return _0x1cadae;}export function getTrinoHeaders(_0xbd0b76,_0x545111){const _0x2c708c=a43_0x46b7,_0x2369fd=getAuthHeaders(_0xbd0b76,_0x545111),_0x356323=toHeaderRecord(_0x2369fd);return delete _0x356323['Authorization'],_0x545111&&(_0x356323[_0x2c708c(0xe7)]=_0x545111),_0x356323;}export function hasAPIKey(_0x54d4ae){const _0x34fe8c=a43_0x46b7,_0x4e2681=getAPIKey(_0x54d4ae);return _0x4e2681!==undefined&&_0x4e2681[_0x34fe8c(0xef)]>0x0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4ffc87,_0x2aa72b){const _0xda91bb=a44_0x20b1,_0x5a2fd3=_0x4ffc87();while(!![]){try{const _0x248db3=parseInt(_0xda91bb(0x16c))/0x1*(parseInt(_0xda91bb(0x162))/0x2)+-parseInt(_0xda91bb(0x166))/0x3+parseInt(_0xda91bb(0x14d))/0x4*(-parseInt(_0xda91bb(0x16a))/0x5)+-parseInt(_0xda91bb(0x12f))/0x6*(-parseInt(_0xda91bb(0x170))/0x7)+parseInt(_0xda91bb(0x142))/0x8+-parseInt(_0xda91bb(0x140))/0x9+parseInt(_0xda91bb(0x16d))/0xa;if(_0x248db3===_0x2aa72b)break;else _0x5a2fd3['push'](_0x5a2fd3['shift']());}catch(_0x5ca153){_0x5a2fd3['push'](_0x5a2fd3['shift']());}}}(a44_0x320c,0x90ef5));import{writeFileSync}from'fs';function a44_0x320c(){const _0x4a86a8=['isTTY','log','bigint','cmdout','stringify','bold','stderr','[params]','788tBeTYv','length','red','table','noColor','map','list','tsv','No\x20data','write','boolean','sdk-result','[query]','-FXRSn','output','end','varchar','debug','pipe','entries','max','1012378pwtWtv','number','split','format','3524232fpOnoD','padEnd','repeat','[logs]','9835kCDOLW','push','1XcYeHp','3396870SvoMFt','stdin','filter','7298669Ckymfi','Results\x20saved\x20to\x20','─┴─','object','yellow','magenta','json','6Nriule','error','forEach','inherit','[error]','isInteger','limit','resolve','FINISHED','color','query','params','trim','[Object]','[rule]','stdout','join','3126393UAOVAh','jsonl','4917840KEaKlD','keys','rule'];a44_0x320c=function(){return _0x4a86a8;};return a44_0x320c();}import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a44_0x40be92 from'chalk';function a44_0x20b1(_0x2274ee,_0x3651c3){_0x2274ee=_0x2274ee-0x12e;const _0x320c4c=a44_0x320c();let _0x20b1f9=_0x320c4c[_0x2274ee];return _0x20b1f9;}import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0xe15a17){const _0x57a1f1=a44_0x20b1;return _0xe15a17[_0x57a1f1(0x165)]===_0x57a1f1(0x12e)||_0xe15a17['format']==='jsonl'||_0xe15a17[_0x57a1f1(0x165)]===_0x57a1f1(0x154)||_0xe15a17[_0x57a1f1(0x165)]===_0x57a1f1(0x150)||_0xe15a17['json']===!![]||_0xe15a17[_0x57a1f1(0x141)]===!![]||_0xe15a17['tsv']===!![]||_0xe15a17['table']===!![];}export function parseOutputOptions(_0x2a9d14){const _0x1f5f86=a44_0x20b1;return{'format':_0x2a9d14['format']||_0x1f5f86(0x150),'output':_0x2a9d14['output']||'','limit':_0x2a9d14[_0x1f5f86(0x135)],'color':_0x2a9d14[_0x1f5f86(0x138)],'noColor':_0x2a9d14[_0x1f5f86(0x151)]};}function convertSDKResultToQueryResult(_0x50ca97){const _0xb8cc17=a44_0x20b1,_0x878531=[];if(_0x50ca97[_0xb8cc17(0x14e)]>0x0){const _0x31023b=_0x50ca97[0x0];for(const [_0x55c6c1,_0x284ed6]of Object['entries'](_0x31023b)){let _0x2bd2e4=_0xb8cc17(0x15d);if(typeof _0x284ed6==='number')_0x2bd2e4=Number[_0xb8cc17(0x134)](_0x284ed6)?_0xb8cc17(0x147):'double';else{if(typeof _0x284ed6===_0xb8cc17(0x157))_0x2bd2e4=_0xb8cc17(0x157);else _0x284ed6===null&&(_0x2bd2e4=_0xb8cc17(0x15d));}_0x878531[_0xb8cc17(0x16b)]({'name':_0x55c6c1,'type':_0x2bd2e4});}}return{'queryId':_0xb8cc17(0x158),'columns':_0x878531,'data':_0x50ca97,'stats':{'state':_0xb8cc17(0x137),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x50ca97['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0xbdeea6,_0x3d0e2f){const _0x1733d1=convertSDKResultToQueryResult(_0xbdeea6);return formatQueryOutput(_0x1733d1,_0x3d0e2f);}export async function formatQueryOutput(_0x51208f,_0x54fd8d){const _0x956759=a44_0x20b1,{format:_0x2c0b2c,limit:_0x50314e,output:_0x2a01d0,color:_0x51ac17,noColor:_0x26c66b}=_0x54fd8d,_0x29a409=Boolean(_0x2a01d0)&&!_0x51ac17,_0x188620={'color':_0x51ac17,'noColor':_0x26c66b||_0x29a409};if(_0x2c0b2c===_0x956759(0x150)){const _0x10bd52=shouldUseLess(_0x2c0b2c,_0x2a01d0);return formatAsTable(_0x51208f,_0x50314e,_0x10bd52,_0x188620);}else{if(_0x2c0b2c===_0x956759(0x12e))return formatAsJSON(_0x51208f,_0x188620);else return _0x2c0b2c===_0x956759(0x141)?formatAsJSONL(_0x51208f,_0x188620):formatQueryResult(_0x51208f,_0x2c0b2c);}}function shouldUseLess(_0x33fa41,_0x5916e1){const _0x31f104=a44_0x20b1;return(_0x33fa41===_0x31f104(0x150)||_0x33fa41===_0x31f104(0x153))&&process[_0x31f104(0x13e)][_0x31f104(0x145)]&&!_0x5916e1;}export function resolveOutputOptions(_0xcea6b0){const _0x5efe35=a44_0x20b1,_0x4f4c0d=resolveOutputFormat(_0xcea6b0['format'],_0xcea6b0[_0x5efe35(0x15b)],'table');let _0x427347=typeof _0xcea6b0['limit']===_0x5efe35(0x163)?_0xcea6b0['limit']:parseInt(_0xcea6b0[_0x5efe35(0x135)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x55f8a7=_0xcea6b0[_0x5efe35(0x15b)]||'';return shouldUseLess(_0x4f4c0d,_0x55f8a7)&&(_0x427347=Infinity),{'format':_0x4f4c0d,'output':_0x55f8a7,'limit':_0x427347,'color':_0xcea6b0['color'],'noColor':_0xcea6b0['noColor']};}export function writeOutput(_0x538f0a,_0xa1dda5,_0x44ca13){const _0x2ae671=a44_0x20b1;return _0xa1dda5?(writeFileSync(_0xa1dda5,_0x538f0a),console[_0x2ae671(0x130)](_0x2ae671(0x171)+_0xa1dda5),Promise[_0x2ae671(0x136)]()):shouldUseLess(_0x44ca13||'','')?new Promise(_0x209a91=>{const _0x21bdf7=_0x2ae671,_0x3e29c0=spawn('less',[_0x21bdf7(0x15a)],{'stdio':[_0x21bdf7(0x15f),_0x21bdf7(0x132),_0x21bdf7(0x132)]});let _0x5b6fe9=![];_0x3e29c0['on'](_0x21bdf7(0x130),()=>{const _0x355bf3=_0x21bdf7;!_0x5b6fe9&&(_0x5b6fe9=!![],console[_0x355bf3(0x146)](_0x538f0a),_0x209a91());}),_0x3e29c0['on']('close',()=>{!_0x5b6fe9&&(_0x5b6fe9=!![],_0x209a91());}),_0x3e29c0['on']('spawn',()=>{const _0x5dcc19=_0x21bdf7;!_0x5b6fe9&&_0x3e29c0['stdin']&&(_0x3e29c0['stdin']['on'](_0x5dcc19(0x130),()=>{}),_0x3e29c0['stdin'][_0x5dcc19(0x156)](_0x538f0a),_0x3e29c0[_0x5dcc19(0x16e)][_0x5dcc19(0x15c)]());}),!_0x3e29c0[_0x21bdf7(0x16e)]&&(!_0x5b6fe9&&(_0x5b6fe9=!![],console[_0x21bdf7(0x146)](_0x538f0a),_0x209a91()));}):(console[_0x2ae671(0x146)](_0x538f0a),Promise[_0x2ae671(0x136)]());}export async function handleSDKOutput(_0x4a21f8,_0x163068){const _0x106a73=a44_0x20b1,_0xc6286f=resolveOutputOptions(_0x163068),_0x16db84=await formatSDKOutput(_0x4a21f8,_0xc6286f);await writeOutput(_0x16db84,_0xc6286f[_0x106a73(0x15b)]||undefined,_0xc6286f[_0x106a73(0x165)]);}export async function handleQueryOutput(_0x105eac,_0x121be2){const _0x43a624=a44_0x20b1,_0x4bafa5=resolveOutputOptions(_0x121be2),_0x1685d8=await formatQueryOutput(_0x105eac,_0x4bafa5);await writeOutput(_0x1685d8,_0x4bafa5['output']||undefined,_0x4bafa5[_0x43a624(0x165)]);}async function formatSingleObject(_0x2d784f,_0x18918e){const _0x3ad0c4=a44_0x20b1,{format:_0x351c3f,color:_0x256f7f,noColor:_0x36cba3}=_0x18918e,_0x409363={'color':_0x256f7f,'noColor':_0x36cba3};if(_0x351c3f==='json'){if(shouldUseColor(_0x409363))return colorizeJSON(_0x2d784f,_0x409363);return JSON[_0x3ad0c4(0x149)](_0x2d784f,null,0x2);}else{if(_0x351c3f===_0x3ad0c4(0x141)){if(shouldUseColor(_0x409363))return colorizeJSONCompact(_0x2d784f,_0x409363);return JSON[_0x3ad0c4(0x149)](_0x2d784f);}else{if(_0x351c3f===_0x3ad0c4(0x154))return Object['entries'](_0x2d784f)[_0x3ad0c4(0x152)](([_0x3b127a,_0x55c55c])=>_0x3b127a+'\x09'+_0x55c55c)[_0x3ad0c4(0x13f)]('\x0a');else{const _0x5ca6f3=Object[_0x3ad0c4(0x160)](_0x2d784f);if(_0x5ca6f3[_0x3ad0c4(0x14e)]===0x0)return _0x3ad0c4(0x155);const _0x5289cf=_0x2d784f[_0x3ad0c4(0x15e)],_0x2487dc=_0x2d784f[_0x3ad0c4(0x139)],_0xb95f4b=_0x2d784f[_0x3ad0c4(0x13a)],_0x36e9cd=_0x2d784f[_0x3ad0c4(0x144)],_0x3cf466=_0x2487dc?typeof _0x2487dc==='string'?_0x2487dc:JSON['stringify'](_0x2487dc,null,0x2):undefined,_0x4513f2=_0xb95f4b&&Object[_0x3ad0c4(0x143)](_0xb95f4b)[_0x3ad0c4(0x14e)]>0x0?JSON['stringify'](_0xb95f4b,null,0x2):undefined,_0x7382ab=_0x36e9cd&&Object[_0x3ad0c4(0x143)](_0x36e9cd)['length']>0x0?JSON[_0x3ad0c4(0x149)](_0x36e9cd,null,0x2):undefined,_0x559591=_0x5ca6f3[_0x3ad0c4(0x16f)](([_0x4fa1e7])=>_0x4fa1e7!=='debug'&&_0x4fa1e7!==_0x3ad0c4(0x139)&&_0x4fa1e7!==_0x3ad0c4(0x13a)&&_0x4fa1e7!==_0x3ad0c4(0x144)),_0x1522f9=Math[_0x3ad0c4(0x161)](..._0x559591['map'](([_0x50904e])=>_0x50904e[_0x3ad0c4(0x14e)])),_0x33f928=Math[_0x3ad0c4(0x161)](..._0x559591['map'](([,_0x28f45e])=>{const _0x595731=_0x3ad0c4;try{const _0x164d3e=_0x28f45e===null||_0x28f45e===undefined?'':typeof _0x28f45e==='object'?JSON[_0x595731(0x149)](_0x28f45e):String(_0x28f45e),_0x1facaf=_0x164d3e[_0x595731(0x164)]('\x0a');return Math['max'](..._0x1facaf[_0x595731(0x152)](_0x21b3c2=>_0x21b3c2[_0x595731(0x14e)]),0x0);}catch{return 0x0;}}),0x14),_0x42edc0=[];_0x42edc0['push'](colorBorder('┌─'+'─'[_0x3ad0c4(0x168)](_0x1522f9)+'─┬─'+'─'['repeat'](_0x33f928)+'─┐',_0x409363)),_0x559591[_0x3ad0c4(0x131)](([_0x3a9f10,_0xc415f3])=>{const _0x5f272c=_0x3ad0c4;let _0x168f3c;try{_0x168f3c=_0xc415f3===null||_0xc415f3===undefined?'':typeof _0xc415f3===_0x5f272c(0x173)?JSON['stringify'](_0xc415f3):String(_0xc415f3);}catch{_0x168f3c=_0x5f272c(0x13c);}const _0x4c675a=_0x3a9f10[_0x5f272c(0x167)](_0x1522f9),_0x456c21=_0x168f3c[_0x5f272c(0x164)]('\x0a');_0x456c21[_0x5f272c(0x131)]((_0x1bbae3,_0x354640)=>{const _0x1bdcf5=_0x5f272c,_0x52116a=colorBorder('│',_0x409363);_0x354640===0x0?_0x42edc0[_0x1bdcf5(0x16b)](_0x52116a+'\x20'+_0x4c675a+'\x20'+_0x52116a+'\x20'+_0x1bbae3[_0x1bdcf5(0x167)](_0x33f928)+'\x20'+_0x52116a):_0x42edc0[_0x1bdcf5(0x16b)](_0x52116a+'\x20'+'\x20'[_0x1bdcf5(0x168)](_0x1522f9)+'\x20'+_0x52116a+'\x20'+_0x1bbae3[_0x1bdcf5(0x167)](_0x33f928)+'\x20'+_0x52116a);});}),_0x42edc0[_0x3ad0c4(0x16b)](colorBorder('└─'+'─'[_0x3ad0c4(0x168)](_0x1522f9)+_0x3ad0c4(0x172)+'─'['repeat'](_0x33f928)+'─┘',_0x409363));_0x3cf466&&(_0x42edc0[_0x3ad0c4(0x16b)](''),_0x42edc0[_0x3ad0c4(0x16b)](String(a44_0x40be92[_0x3ad0c4(0x174)][_0x3ad0c4(0x14a)](_0x3ad0c4(0x159)))),_0x42edc0['push'](_0x3cf466));_0x4513f2&&(_0x42edc0['push'](''),_0x42edc0[_0x3ad0c4(0x16b)](String(a44_0x40be92['blue'][_0x3ad0c4(0x14a)](_0x3ad0c4(0x14c)))),_0x42edc0[_0x3ad0c4(0x16b)](_0x4513f2));_0x7382ab&&(_0x42edc0[_0x3ad0c4(0x16b)](''),_0x42edc0['push'](String(a44_0x40be92[_0x3ad0c4(0x175)][_0x3ad0c4(0x14a)](_0x3ad0c4(0x13d)))),_0x42edc0['push'](_0x7382ab));if(_0x5289cf){if(_0x5289cf[_0x3ad0c4(0x14b)]){_0x42edc0[_0x3ad0c4(0x16b)](''),_0x42edc0[_0x3ad0c4(0x16b)](String(a44_0x40be92[_0x3ad0c4(0x14f)][_0x3ad0c4(0x14a)](_0x3ad0c4(0x133))));const _0x24c709=_0x5289cf[_0x3ad0c4(0x14b)][_0x3ad0c4(0x164)]('\x0a');_0x24c709[_0x3ad0c4(0x131)](_0x5d627e=>{const _0x52a962=_0x3ad0c4;_0x5d627e[_0x52a962(0x13b)]()&&_0x42edc0['push'](_0x5d627e);});}if(_0x5289cf[_0x3ad0c4(0x148)]){_0x42edc0[_0x3ad0c4(0x16b)](''),_0x42edc0['push'](String(a44_0x40be92['cyan']['bold'](_0x3ad0c4(0x169))));const _0x59518d=_0x5289cf['cmdout']['split']('\x0a');_0x59518d[_0x3ad0c4(0x131)](_0x281e11=>{const _0x401ba4=_0x3ad0c4;_0x281e11[_0x401ba4(0x13b)]()&&_0x42edc0[_0x401ba4(0x16b)](_0x281e11);});}}return _0x42edc0[_0x3ad0c4(0x13f)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x9ab630,_0x581353){const _0x5174e5=a44_0x20b1;if(_0x581353['format']===_0x5174e5(0x150)){await handleSDKOutput([_0x9ab630],_0x581353);return;}const _0x534b9e=resolveOutputOptions(_0x581353),_0x2103c6=await formatSingleObject(_0x9ab630,_0x534b9e);await writeOutput(_0x2103c6,_0x534b9e[_0x5174e5(0x15b)]||undefined,_0x534b9e['format']);}
|
|
1
|
+
(function(_0x9ce7f2,_0x1c40e8){const _0x4333be=a44_0x2358,_0x578fd5=_0x9ce7f2();while(!![]){try{const _0x4e360e=-parseInt(_0x4333be(0x133))/0x1*(-parseInt(_0x4333be(0x134))/0x2)+-parseInt(_0x4333be(0x146))/0x3*(-parseInt(_0x4333be(0x15b))/0x4)+-parseInt(_0x4333be(0x113))/0x5+-parseInt(_0x4333be(0x157))/0x6+parseInt(_0x4333be(0x117))/0x7+parseInt(_0x4333be(0x139))/0x8*(-parseInt(_0x4333be(0x11c))/0x9)+parseInt(_0x4333be(0x14a))/0xa;if(_0x4e360e===_0x1c40e8)break;else _0x578fd5['push'](_0x578fd5['shift']());}catch(_0x401425){_0x578fd5['push'](_0x578fd5['shift']());}}}(a44_0x4fd2,0xdf5ac));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_0x45993a from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x561fe9){const _0x48f257=a44_0x2358;return _0x561fe9[_0x48f257(0x14d)]===_0x48f257(0x12a)||_0x561fe9[_0x48f257(0x14d)]===_0x48f257(0x149)||_0x561fe9[_0x48f257(0x14d)]==='tsv'||_0x561fe9[_0x48f257(0x14d)]===_0x48f257(0x150)||_0x561fe9[_0x48f257(0x12a)]===!![]||_0x561fe9[_0x48f257(0x149)]===!![]||_0x561fe9[_0x48f257(0x12d)]===!![]||_0x561fe9[_0x48f257(0x150)]===!![];}function a44_0x2358(_0x23b2d3,_0x5a4ba1){_0x23b2d3=_0x23b2d3-0x10f;const _0x4fd2e0=a44_0x4fd2();let _0x2358e9=_0x4fd2e0[_0x23b2d3];return _0x2358e9;}export function parseOutputOptions(_0x3c8213){const _0x39cf7b=a44_0x2358;return{'format':_0x3c8213[_0x39cf7b(0x14d)]||_0x39cf7b(0x150),'output':_0x3c8213[_0x39cf7b(0x159)]||'','limit':_0x3c8213['limit'],'color':_0x3c8213[_0x39cf7b(0x112)],'noColor':_0x3c8213['noColor']};}function convertSDKResultToQueryResult(_0x20c0a9){const _0x35b8fb=a44_0x2358,_0x168ce8=[];if(_0x20c0a9[_0x35b8fb(0x154)]>0x0){const _0x43533a=_0x20c0a9[0x0];for(const [_0x642a91,_0xf6917b]of Object[_0x35b8fb(0x120)](_0x43533a)){let _0x45bd7f=_0x35b8fb(0x10f);if(typeof _0xf6917b===_0x35b8fb(0x121))_0x45bd7f=Number[_0x35b8fb(0x13a)](_0xf6917b)?_0x35b8fb(0x13d):_0x35b8fb(0x12c);else{if(typeof _0xf6917b===_0x35b8fb(0x128))_0x45bd7f=_0x35b8fb(0x128);else _0xf6917b===null&&(_0x45bd7f='varchar');}_0x168ce8[_0x35b8fb(0x118)]({'name':_0x642a91,'type':_0x45bd7f});}}return{'queryId':_0x35b8fb(0x12e),'columns':_0x168ce8,'data':_0x20c0a9,'stats':{'state':_0x35b8fb(0x11a),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x20c0a9[_0x35b8fb(0x154)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x2964ce,_0x2a4084){const _0x12a41c=convertSDKResultToQueryResult(_0x2964ce);return formatQueryOutput(_0x12a41c,_0x2a4084);}export async function formatQueryOutput(_0x3932ea,_0x1dbc41){const _0x3e725a=a44_0x2358,{format:_0x1bb886,limit:_0x1bc617,output:_0x4ea156,color:_0x449778,noColor:_0x31860f}=_0x1dbc41,_0x39466a=Boolean(_0x4ea156)&&!_0x449778,_0x149fd7={'color':_0x449778,'noColor':_0x31860f||_0x39466a};if(_0x1bb886===_0x3e725a(0x150)){const _0xa08efb=shouldUseLess(_0x1bb886,_0x4ea156);return formatAsTable(_0x3932ea,_0x1bc617,_0xa08efb,_0x149fd7);}else{if(_0x1bb886===_0x3e725a(0x12a))return formatAsJSON(_0x3932ea,_0x149fd7);else return _0x1bb886===_0x3e725a(0x149)?formatAsJSONL(_0x3932ea,_0x149fd7):formatQueryResult(_0x3932ea,_0x1bb886);}}function shouldUseLess(_0x1bb7f2,_0x4aa216){const _0x3ba2d1=a44_0x2358;return(_0x1bb7f2==='table'||_0x1bb7f2===_0x3ba2d1(0x151))&&process[_0x3ba2d1(0x125)][_0x3ba2d1(0x11d)]&&!_0x4aa216;}export function resolveOutputOptions(_0x312740){const _0x8bf4a8=a44_0x2358,_0x57263b=resolveOutputFormat(_0x312740[_0x8bf4a8(0x14d)],_0x312740[_0x8bf4a8(0x159)],'table');let _0x415b2e=typeof _0x312740[_0x8bf4a8(0x156)]==='number'?_0x312740[_0x8bf4a8(0x156)]:parseInt(_0x312740[_0x8bf4a8(0x156)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x2be650=_0x312740[_0x8bf4a8(0x159)]||'';return shouldUseLess(_0x57263b,_0x2be650)&&(_0x415b2e=Infinity),{'format':_0x57263b,'output':_0x2be650,'limit':_0x415b2e,'color':_0x312740[_0x8bf4a8(0x112)],'noColor':_0x312740[_0x8bf4a8(0x11f)]};}export function writeOutput(_0x5ac305,_0x45f989,_0x13e477){const _0x745fff=a44_0x2358;return _0x45f989?(writeFileSync(_0x45f989,_0x5ac305),console[_0x745fff(0x135)](_0x745fff(0x141)+_0x45f989),Promise[_0x745fff(0x130)]()):shouldUseLess(_0x13e477||'','')?new Promise(_0x30a260=>{const _0x41842b=_0x745fff,_0x5da844=spawn(_0x41842b(0x142),[_0x41842b(0x14e)],{'stdio':[_0x41842b(0x13b),_0x41842b(0x153),'inherit']});let _0x56a9bb=![];_0x5da844['on']('error',()=>{!_0x56a9bb&&(_0x56a9bb=!![],console['log'](_0x5ac305),_0x30a260());}),_0x5da844['on'](_0x41842b(0x136),()=>{!_0x56a9bb&&(_0x56a9bb=!![],_0x30a260());}),_0x5da844['on'](_0x41842b(0x144),()=>{const _0x1ec4c9=_0x41842b;!_0x56a9bb&&_0x5da844[_0x1ec4c9(0x138)]&&(_0x5da844['stdin']['on'](_0x1ec4c9(0x135),()=>{}),_0x5da844['stdin'][_0x1ec4c9(0x155)](_0x5ac305),_0x5da844['stdin'][_0x1ec4c9(0x122)]());}),!_0x5da844[_0x41842b(0x138)]&&(!_0x56a9bb&&(_0x56a9bb=!![],console[_0x41842b(0x131)](_0x5ac305),_0x30a260()));}):(console['log'](_0x5ac305),Promise[_0x745fff(0x130)]());}export async function handleSDKOutput(_0x5b9b03,_0x3d5d55){const _0x621baf=a44_0x2358,_0x326ee5=resolveOutputOptions(_0x3d5d55),_0x65faad=await formatSDKOutput(_0x5b9b03,_0x326ee5);await writeOutput(_0x65faad,_0x326ee5[_0x621baf(0x159)]||undefined,_0x326ee5[_0x621baf(0x14d)]);}export async function handleQueryOutput(_0x598e78,_0x151c4d){const _0x1ba2c4=a44_0x2358,_0x478f69=resolveOutputOptions(_0x151c4d),_0x294704=await formatQueryOutput(_0x598e78,_0x478f69);await writeOutput(_0x294704,_0x478f69[_0x1ba2c4(0x159)]||undefined,_0x478f69[_0x1ba2c4(0x14d)]);}async function formatSingleObject(_0x3ab53f,_0x1f3315){const _0x2eb943=a44_0x2358,{format:_0x16f407,color:_0x1ad822,noColor:_0xa338b}=_0x1f3315,_0x3b0613={'color':_0x1ad822,'noColor':_0xa338b};if(_0x16f407===_0x2eb943(0x12a)){if(shouldUseColor(_0x3b0613))return colorizeJSON(_0x3ab53f,_0x3b0613);return JSON[_0x2eb943(0x129)](_0x3ab53f,null,0x2);}else{if(_0x16f407===_0x2eb943(0x149)){if(shouldUseColor(_0x3b0613))return colorizeJSONCompact(_0x3ab53f,_0x3b0613);return JSON[_0x2eb943(0x129)](_0x3ab53f);}else{if(_0x16f407===_0x2eb943(0x12d))return Object[_0x2eb943(0x120)](_0x3ab53f)['map'](([_0x18b7ff,_0x5f58aa])=>_0x18b7ff+'\x09'+_0x5f58aa)['join']('\x0a');else{const _0x515a45=Object[_0x2eb943(0x120)](_0x3ab53f);if(_0x515a45['length']===0x0)return _0x2eb943(0x143);const _0x1a8789=_0x3ab53f[_0x2eb943(0x123)],_0x3a5c0e=_0x3ab53f[_0x2eb943(0x13c)],_0x3e3be9=_0x3ab53f[_0x2eb943(0x124)],_0x490555=_0x3ab53f[_0x2eb943(0x119)],_0x2f51ec=_0x3a5c0e?typeof _0x3a5c0e===_0x2eb943(0x116)?_0x3a5c0e:JSON['stringify'](_0x3a5c0e,null,0x2):undefined,_0x34119d=_0x3e3be9&&Object[_0x2eb943(0x115)](_0x3e3be9)[_0x2eb943(0x154)]>0x0?JSON[_0x2eb943(0x129)](_0x3e3be9,null,0x2):undefined,_0x57d236=_0x490555&&Object[_0x2eb943(0x115)](_0x490555)[_0x2eb943(0x154)]>0x0?JSON[_0x2eb943(0x129)](_0x490555,null,0x2):undefined,_0x531191=_0x515a45['filter'](([_0x552120])=>_0x552120!==_0x2eb943(0x123)&&_0x552120!=='query'&&_0x552120!==_0x2eb943(0x124)&&_0x552120!==_0x2eb943(0x119)),_0x1f14e9=Math['max'](..._0x531191['map'](([_0x54bb55])=>_0x54bb55[_0x2eb943(0x154)])),_0x2d9201=Math[_0x2eb943(0x14f)](..._0x531191[_0x2eb943(0x13e)](([,_0x527b0a])=>{const _0x3d7190=_0x2eb943;try{const _0x3cc6af=_0x527b0a===null||_0x527b0a===undefined?'':typeof _0x527b0a===_0x3d7190(0x158)?JSON[_0x3d7190(0x129)](_0x527b0a):String(_0x527b0a),_0x4bd22f=_0x3cc6af[_0x3d7190(0x147)]('\x0a');return Math[_0x3d7190(0x14f)](..._0x4bd22f[_0x3d7190(0x13e)](_0x1dd69d=>_0x1dd69d['length']),0x0);}catch{return 0x0;}}),0x14),_0x275037=[];_0x275037[_0x2eb943(0x118)](colorBorder('┌─'+'─'[_0x2eb943(0x13f)](_0x1f14e9)+_0x2eb943(0x11b)+'─'[_0x2eb943(0x13f)](_0x2d9201)+'─┐',_0x3b0613)),_0x531191['forEach'](([_0x541654,_0x3825a2])=>{const _0x5b554c=_0x2eb943;let _0x2b2c7d;try{_0x2b2c7d=_0x3825a2===null||_0x3825a2===undefined?'':typeof _0x3825a2===_0x5b554c(0x158)?JSON[_0x5b554c(0x129)](_0x3825a2):String(_0x3825a2);}catch{_0x2b2c7d='[Object]';}const _0x5f3681=_0x541654[_0x5b554c(0x15a)](_0x1f14e9),_0x766c13=_0x2b2c7d['split']('\x0a');_0x766c13[_0x5b554c(0x114)]((_0x46e6fd,_0x457ab2)=>{const _0x11c488=_0x5b554c,_0x22f33d=colorBorder('│',_0x3b0613);_0x457ab2===0x0?_0x275037[_0x11c488(0x118)](_0x22f33d+'\x20'+_0x5f3681+'\x20'+_0x22f33d+'\x20'+_0x46e6fd[_0x11c488(0x15a)](_0x2d9201)+'\x20'+_0x22f33d):_0x275037[_0x11c488(0x118)](_0x22f33d+'\x20'+'\x20'['repeat'](_0x1f14e9)+'\x20'+_0x22f33d+'\x20'+_0x46e6fd[_0x11c488(0x15a)](_0x2d9201)+'\x20'+_0x22f33d);});}),_0x275037[_0x2eb943(0x118)](colorBorder('└─'+'─'['repeat'](_0x1f14e9)+'─┴─'+'─'[_0x2eb943(0x13f)](_0x2d9201)+'─┘',_0x3b0613));_0x2f51ec&&(_0x275037[_0x2eb943(0x118)](''),_0x275037[_0x2eb943(0x118)](String(a44_0x45993a[_0x2eb943(0x145)][_0x2eb943(0x110)](_0x2eb943(0x127)))),_0x275037[_0x2eb943(0x118)](_0x2f51ec));_0x34119d&&(_0x275037[_0x2eb943(0x118)](''),_0x275037['push'](String(a44_0x45993a[_0x2eb943(0x148)][_0x2eb943(0x110)](_0x2eb943(0x132)))),_0x275037[_0x2eb943(0x118)](_0x34119d));_0x57d236&&(_0x275037['push'](''),_0x275037[_0x2eb943(0x118)](String(a44_0x45993a[_0x2eb943(0x14b)][_0x2eb943(0x110)](_0x2eb943(0x12b)))),_0x275037[_0x2eb943(0x118)](_0x57d236));if(_0x1a8789){if(_0x1a8789[_0x2eb943(0x126)]){_0x275037[_0x2eb943(0x118)](''),_0x275037[_0x2eb943(0x118)](String(a44_0x45993a[_0x2eb943(0x11e)][_0x2eb943(0x110)](_0x2eb943(0x152))));const _0x3a94f6=_0x1a8789[_0x2eb943(0x126)][_0x2eb943(0x147)]('\x0a');_0x3a94f6[_0x2eb943(0x114)](_0x3d4bce=>{const _0x184482=_0x2eb943;_0x3d4bce[_0x184482(0x111)]()&&_0x275037[_0x184482(0x118)](_0x3d4bce);});}if(_0x1a8789[_0x2eb943(0x12f)]){_0x275037['push'](''),_0x275037[_0x2eb943(0x118)](String(a44_0x45993a[_0x2eb943(0x140)][_0x2eb943(0x110)](_0x2eb943(0x14c))));const _0x449c24=_0x1a8789[_0x2eb943(0x12f)]['split']('\x0a');_0x449c24[_0x2eb943(0x114)](_0x5e7dc8=>{const _0x55d9e9=_0x2eb943;_0x5e7dc8[_0x55d9e9(0x111)]()&&_0x275037['push'](_0x5e7dc8);});}}return _0x275037[_0x2eb943(0x137)]('\x0a');}}}}function a44_0x4fd2(){const _0xa82f7=['-FXRSn','max','table','list','[error]','inherit','length','write','limit','8330034skkqEd','object','output','padEnd','452ZePSMQ','varchar','bold','trim','color','5010470IPqWmj','forEach','keys','string','6166629LIEqhn','push','rule','FINISHED','─┬─','27jZodrA','isTTY','red','noColor','entries','number','end','debug','params','stdout','stderr','[query]','boolean','stringify','json','[rule]','double','tsv','sdk-result','cmdout','resolve','log','[params]','4glSksQ','192612wkTirU','error','close','join','stdin','3084416oKZJof','isInteger','pipe','query','bigint','map','repeat','cyan','Results\x20saved\x20to\x20','less','No\x20data','spawn','yellow','14226mkjTUs','split','blue','jsonl','26599320mPuAtG','magenta','[logs]','format'];a44_0x4fd2=function(){return _0xa82f7;};return a44_0x4fd2();}export async function handleSingleObjectOutput(_0x591efc,_0x168fd5){const _0x43279f=a44_0x2358;if(_0x168fd5[_0x43279f(0x14d)]==='table'){await handleSDKOutput([_0x591efc],_0x168fd5);return;}const _0x5a6012=resolveOutputOptions(_0x168fd5),_0x43cbaa=await formatSingleObject(_0x591efc,_0x5a6012);await writeOutput(_0x43cbaa,_0x5a6012[_0x43279f(0x159)]||undefined,_0x5a6012[_0x43279f(0x14d)]);}
|