@treasuredata/tdx 0.14.5 → 0.14.7
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/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.d.ts +0 -4
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +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/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/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/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/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.d.ts.map +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/http-client.js.map +1 -1
- package/dist/sdk/client/llm-api-client.d.ts +3 -2
- package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js.map +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/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/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.d.ts +21 -0
- package/dist/utils/process.d.ts.map +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a39_0xf0f359=a39_0x4576;(function(_0x3415a6,_0x224f47){const _0x297bf3=a39_0x4576,_0x549994=_0x3415a6();while(!![]){try{const _0x49ad9a=-parseInt(_0x297bf3(0x25e))/0x1+parseInt(_0x297bf3(0x15e))/0x2+parseInt(_0x297bf3(0x15c))/0x3+-parseInt(_0x297bf3(0x1df))/0x4+parseInt(_0x297bf3(0x256))/0x5*(parseInt(_0x297bf3(0x111))/0x6)+-parseInt(_0x297bf3(0x1ef))/0x7*(-parseInt(_0x297bf3(0x1c4))/0x8)+-parseInt(_0x297bf3(0x24a))/0x9*(-parseInt(_0x297bf3(0x113))/0xa);if(_0x49ad9a===_0x224f47)break;else _0x549994['push'](_0x549994['shift']());}catch(_0x5a8cff){_0x549994['push'](_0x549994['shift']());}}}(a39_0x413e,0x8401a));import a39_0x37d687 from'chalk';import{existsSync}from'fs';import a39_0x2e3d89 from'path';import{BaseCommand}from'./command.js';function a39_0x413e(){const _0x21aa70=['Pull\x20workflow\x20project\x20to\x20local\x20folder','set','\x0aPolling...\x20(','Session\x20','getTime','Listing\x20workflows...','pollTimeline','message','No\x20sessions\x20found\x20for:\x20','every','workflow:use','tasks','Error:\x20Secret\x20key\x20is\x20required','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Cancelled','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','max','No\x20attempts\x20found\x20in\x20project:\x20','startsWith','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Project\x20name\x20is\x20required','includeSubtasks','green','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Select\x20a\x20workflow\x20to\x20run','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','✔\x20Deleted\x20project\x20','getDate','3169386arqrOo','Failed\x20to\x20fetch\x20attempt\x20data','173370rdcmoj','Attempt\x20ID:\x20','\x20\x20Project:\x20','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','sourceProjectName','\x20workflow','Target:\x20','group_error','\x20\x20Location:\x20','No\x20sessions\x20found','Select\x20a\x20session\x20to\x20view\x20timeline:','deleteSecret','\x0aApply\x20these\x20changes?','getMonth','run','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','filesExtracted','relative','Params:\x20','---\x20','workflows','Key:\x20','jsonl','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Cloning\x20to\x20','type','session:','generateSessionTimelineRows','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','\x20\x20Changes:\x20','getFullYear','fs/promises','fileCount','total','Deleting\x20project\x20','\x20has\x20no\x20attempts','prepareCloneProject','\x20\x20Session\x20ID:\x20','workflow:projects','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','params','No\x20workflows\x20found','status','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','new','summary','MIN_LABEL_COUNT','\x22\x20already\x20exists\x20(ID:\x20','Error:\x20Attempt\x20ID\x20is\x20required','dim','sessions','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','sort','revision:\x20','Pulling\x20project\x20','modified','deleted','Pattern:\x20','\x20sessions\x20','resolveProjectDir','workflow:logs','workflow:tasks','Attempt:\x20','success','fullName','.\x20Expected\x20format:\x20KEY=VALUE','find','Kill\x20a\x20running\x20attempt','json','Error:\x20Project\x20name\x20is\x20required','\x20\x20Project\x20ID:\x20','\x20from\x20session\x20','485517iyTXbu','\x20logs','656932ZQBnGh','session_id','replace','title','Start\x20a\x20workflow\x20run','No\x20projects\x20match\x20pattern:\x20','project','stdout','💡\x20Tip:\x20Use\x20','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','List\x20workflow\x20execution\x20sessions','\x20\x20Attempt\x20ID:\x20','output','select','startTime','Usage:\x20workflow:delete\x20<project-name-or-id>','✔\x20Pull\x20complete','pending','attempt','\x0aClone\x20\x22','trimEnd','Files\x20to\x20upload:\x20','\x20(system)','workflow:upload','sessionId','ICON_WIDTH','Deleting\x20secret...','GUTTER','text','resolveProject','finishedAt','applyPullProject','indexOf','✔\x20Project:\x20','✔\x20Push\x20complete','No\x20log\x20content\x20found','unknown','ICON_SPACING','floor','\x20modified','LABEL_MIN_SPACING','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','TASK_NAME_WIDTH','renderSessionsTimeline','Latest\x20session\x20has\x20no\x20attempt','round','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','size','Getting\x20attempt\x20tasks...','projectName','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','has','index','MAX_TIMELINE_WIDTH','Downloading\x20project\x20','Warning:','retrySession','resolveProjectId','workflow:secrets:delete','Reason:\x20','Auto-selected\x20latest\x20session:\x20','table','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','canceling','planned','some','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','\x20of\x20','✔\x20Workflow\x20run\x20started','navigateSessionsInteractive','state','Error:\x20Invalid\x20parameter\x20format:\x20','Resume\x20from:\x20','MAX_TASKS_DISPLAY','\x20\x20tdx\x20wf\x20use\x20<project>','splice','diff','newProjectName','Session\x20time:\x20','toISOString','\x20\x20Session\x20context\x20set\x20to:\x20','fill','✔\x20Secret\x20\x27','\x0aDry\x20run\x20-\x20nothing\x20pushed','No\x20attempts\x20found\x20for:\x20','(unknown)','Project\x20directory:\x20','error','existingProjectId','Retrying\x20session...','attempt:','param','key','✔\x20Workflow\x20project\x20context\x20cleared.','workflow:push','projectId','\x20attempt','name','No\x20matching\x20sessions\x20found','Dry\x20run:\x20yes','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','990184saPJPM','\x20unchanged','localeCompare','log','Filter:\x20','isNewProject','push','substring','metadata','No\x20sessions\x20with\x20timing\x20information','workflowName','Fetching\x20log\x20files...','getHours','Usage:\x20tdx\x20wf\x20use\x20<project>','Output\x20directory:\x20','running','filter','✔\x20Clone\x20complete','Show\x20specific\x20attempt\x20details','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Revision:\x20','Include\x20retried:\x20yes','\x27...','List\x20workflow\x20attempts','\x20\x20Workflow:\x20','2851040DFaKiQ','\x0aPush\x20these\x20changes?','\x20\x20Target:\x20','targetDir','\x0a✔\x20Attempt\x20complete','blue','duration','path','lastAttempt','workflow:sessions','yes','Updating\x20','split','Filter:\x20project=','pullProject','window','21RTCiYE','No\x20log\x20files\x20found\x20for\x20this\x20attempt','slice','Project\x20name:\x20','\x20session','msPerChar','Status:\x20','preparePushProject','retryAttemptName','/sessions/','Error:\x20','resolve','Show\x20logs\x20for\x20a\x20workflow\x20attempt','done','yellow','isDirectory','fromTask','\x20deleted','from','✔\x20Found\x20','now','\x20\x20Revision:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Tip:\x20cd\x20to\x20workflows/','workflow:attempts','\x0a⚠\x20Project\x20\x22','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','revision','displayLine','✔\x20Workflow\x20project\x20set\x20to:\x20','🔄\x20','stat','Analyzing\x20project...','workflow:timeline','all','MAX_POLL_ITERATIONS','✔\x20Pushed\x20','description','verbose','No\x20workflow\x20projects\x20found','keys','durationMs','showWorkflowConsoleUrl','fileSize','Source\x20directory:\x20','dryRun','Source:\x20','\x20tasks','stringify','Resolving\x20project\x20\x27','start','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','unchanged','red','format','repeat','basename','Project:\x20','follow','skipValidation','isArray','Force:\x20yes','\x22?\x20This\x20cannot\x20be\x20undone.','sessionTime','MIN_TIMELINE_WIDTH','data','workflow:delete','taskName','site','From\x20task:\x20','cyan','...','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','parse','renderSingleTimeline','Source\x20directory\x20is\x20required','LABEL_WIDTH_DIVISOR','session','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','List\x20all\x20workflow\x20projects','Total:\x20','workflow:kill','parseProjectWorkflowPattern','No\x20attempts\x20found','reason','No\x20workflow\x20sessions\x20found','download','execute','✔\x20Showing\x20','includeRetried','columns','351wPzNPh','attemptId','\x20-\x20','Expected\x20format:\x20--param\x20key=value','readFile','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Loading\x20session...','changes','autocomplete','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','match','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','5eqrPcg','\x0aUpdate\x20existing\x20project\x20\x22','list','min','Retrying\x20attempt...','end','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','Listing\x20workflow\x20sessions...','812540kIRGCG','logFiles','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','workflow:clone','workflow','updatedAt','Error:','workflow:run','📋\x20','Listing\x20workflow\x20attempts...','Error:\x20KEY=VALUE\x20is\x20required','\x0a✔\x20No\x20changes\x20to\x20push','write','\x20\x20Source:\x20','trim','cancelRequested','No\x20sessions\x20found\x20in\x20project:\x20','cwd','delete','\x22\x20to\x20new\x20project\x20\x22','workflow:secrets:list','isTTY','\x20(use\x20--limit\x20to\x20show\x20more)','Listing\x20workflow\x20projects...','includes','\x20new','No\x20workflow\x20tdx.json\x20found','createdAt','resumeFrom','Validation:\x20skipped','force','map','New\x20project\x20name:\x20','limit','padStart','Error:\x20Invalid\x20JSON\x20in\x20--params','✔\x20New\x20project:\x20','Downloading\x20logs...','✔\x20Downloaded\x20','white','requireProject','workflowProject','length','retryAttempt','targetExists',',\x20Workflow:\x20','POLL_INTERVAL_MS','Retry\x20a\x20session\x20or\x20attempt','context','newProjectId','join','workflow:download','projects','startedAt','renderTimeline','\x20task','value','icon','workflow:attempt','executePushProject','task','\x0aDry\x20run\x20-\x20no\x20project\x20created','\x0a✔\x20Already\x20up\x20to\x20date'];a39_0x413e=function(){return _0x21aa70;};return a39_0x413e();}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 a39_0xe7a3e1 from'prompts';function getAttemptStatusDisplay(_0x3ccf18){const _0x21dda2=a39_0x4576;if(!_0x3ccf18)return{'icon':'⏳','text':''};const {done:_0x17751e,success:_0x40cacc,cancelRequested:_0x539b0b}=_0x3ccf18;if(!_0x17751e)return _0x539b0b?{'icon':'🛑','text':a39_0x37d687[_0x21dda2(0x1fd)](_0x21dda2(0x19e))}:{'icon':'🔄','text':a39_0x37d687['blue']('running')};if(_0x40cacc)return{'icon':'✅','text':a39_0x37d687[_0x21dda2(0x10b)](_0x21dda2(0x153))};return{'icon':'❌','text':a39_0x37d687['red']('error')};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x7580d3,_0x34db1d,_0x225f16=0x0){const _0x40efd0=a39_0x4576;return _0x7580d3[_0x225f16]||_0x34db1d[_0x40efd0(0x287)];}[a39_0xf0f359(0x286)](_0x20e92e,_0x10f0a7,_0x2ee668=0x0){const _0x1bc2c5=a39_0xf0f359,_0x5a164b=this[_0x1bc2c5(0x17b)](_0x20e92e,_0x10f0a7,_0x2ee668);if(!_0x5a164b)return console[_0x1bc2c5(0x1b6)](a39_0x37d687[_0x1bc2c5(0x224)](_0x1bc2c5(0x264)),_0x1bc2c5(0x109)),console[_0x1bc2c5(0x1b6)](a39_0x37d687[_0x1bc2c5(0x145)](_0x1bc2c5(0x209))),null;return _0x5a164b;}[a39_0xf0f359(0x241)](_0x44b373,_0xa6227e){const _0x48de35=a39_0xf0f359;if(_0x44b373[0x0]){const _0x448eaf=_0x44b373[0x0][_0x48de35(0x1eb)]('.');if(_0x448eaf['length']===0x1)return{'projectName':_0x448eaf[0x0],'workflowName':undefined};else return _0x448eaf[_0x48de35(0x288)]===0x2?{'projectName':_0x448eaf[0x0],'workflowName':_0x448eaf[0x1]}:(console['error'](a39_0x37d687['red'](_0x48de35(0x264)),_0x48de35(0x23d)),null);}return{'projectName':_0xa6227e[_0x48de35(0x287)],'workflowName':undefined};}['resolveProjectDir'](_0x51a365,_0x19c25c,_0x452e57=0x0){const _0x1cc809=a39_0xf0f359;if(_0x51a365[_0x452e57])return _0x51a365[_0x452e57];if(_0x19c25c['workflowProject']){const _0x49a931=a39_0x2e3d89[_0x1cc809(0xe8)](process[_0x1cc809(0x26f)](),'workflows',_0x19c25c['workflowProject']);if(existsSync(a39_0x2e3d89['join'](_0x49a931,'tdx.json')))return _0x49a931;}return undefined;}async[a39_0xf0f359(0x219)](_0x53d825,_0x2a3f27,_0x512b29){const _0x5cb50b=a39_0xf0f359;try{const _0x10240d=await _0x53d825[_0x5cb50b(0x262)][_0x5cb50b(0x127)](_0x2a3f27,{'limit':0x1});if(_0x10240d['length']>0x0){const _0x1fd18a=_0x10240d[0x0]['id'],_0x40178d=getWorkflowUrl(_0x512b29,_0x1fd18a);console[_0x5cb50b(0x1b6)]('\x20\x20Console:\x20'+a39_0x37d687[_0x5cb50b(0x235)](_0x40178d));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0xff);[a39_0xf0f359(0x214)]=a39_0xf0f359(0x1d9);async['execute'](_0x27ee6a){const _0x9beb85=a39_0xf0f359,{options:_0x2a3c8a,args:_0x3b5b7b,tdx:_0x4300e0}=_0x27ee6a,_0x1b39d8=_0x3b5b7b[0x0],_0x3513af=_0x2a3c8a['clear'];if(_0x3513af)return saveSessionContext({'workflow_project':undefined},_0x2a3c8a['session']),console[_0x9beb85(0x1c7)](a39_0x37d687[_0x9beb85(0x10b)](_0x9beb85(0x1bc))),0x0;if(!_0x1b39d8)return console[_0x9beb85(0x1b6)](a39_0x37d687['red'](_0x9beb85(0x264)),_0x9beb85(0x109)),console[_0x9beb85(0x1b6)](a39_0x37d687[_0x9beb85(0x145)](_0x9beb85(0x1d1))),console[_0x9beb85(0x1b6)](a39_0x37d687['dim'](_0x9beb85(0x255))),0x1;const _0x57bd08=await withSpinner(_0x9beb85(0x220)+_0x1b39d8+_0x9beb85(0x1dc),()=>_0x4300e0[_0x9beb85(0x262)][_0x9beb85(0x198)](_0x1b39d8),{'verbose':_0x2a3c8a[_0x9beb85(0x215)]}),{name:_0x38b3ca}=_0x57bd08[_0x9beb85(0x230)];return saveSessionContext({'workflow_project':_0x38b3ca},_0x2a3c8a[_0x9beb85(0x23c)]),console[_0x9beb85(0x1c7)](a39_0x37d687[_0x9beb85(0x10b)](_0x9beb85(0x20c)+a39_0x37d687[_0x9beb85(0x235)](_0x38b3ca))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a39_0xf0f359(0x139);[a39_0xf0f359(0x214)]=a39_0xf0f359(0x23e);async[a39_0xf0f359(0x246)](_0x56b2fe){const _0x465bf4=a39_0xf0f359,{options:_0x2af902,args:_0x91b47,tdx:_0x5991b2}=_0x56b2fe,_0x40002f=_0x91b47[0x0];_0x2af902['verbose']&&_0x40002f&&console[_0x465bf4(0x1b6)](_0x465bf4(0x14d)+_0x40002f);const _0xa6e102=await withSpinner(_0x465bf4(0x275),()=>_0x5991b2['workflow'][_0x465bf4(0xea)](_0x40002f,{'limit':_0x2af902[_0x465bf4(0x27f)]}),{'verbose':_0x2af902[_0x465bf4(0x215)]});let _0x1338e4=_0xa6e102[_0x465bf4(0x230)];_0x1338e4[_0x465bf4(0x148)]((_0x56fd52,_0x3429d3)=>_0x56fd52[_0x465bf4(0x1c0)][_0x465bf4(0x1c6)](_0x3429d3[_0x465bf4(0x1c0)]));const _0x582a92=_0x2af902[_0x465bf4(0x27f)]||0x64,_0x7f4a89=_0x1338e4[_0x465bf4(0x288)]>=_0x582a92?a39_0x37d687[_0x465bf4(0x145)](_0x465bf4(0x274)):'';console['error'](_0x465bf4(0x202)+_0x1338e4['length']+'\x20project'+(_0x1338e4[_0x465bf4(0x288)]!==0x1?'s':'')+_0x7f4a89);if(_0x2af902[_0x465bf4(0x225)]===_0x465bf4(0x158)||_0x2af902['format']===_0x465bf4(0x129)||_0x2af902['format']===_0x465bf4(0x19c))await handleSDKOutput(_0x1338e4,_0x2af902);else{if(_0x1338e4['length']===0x0)_0x40002f?console[_0x465bf4(0x1c7)](_0x465bf4(0x163)+_0x40002f):console[_0x465bf4(0x1c7)](_0x465bf4(0x216));else{const _0x54277a=_0x1338e4['map'](_0x552ebf=>{const _0x424230=_0x465bf4,_0x34726c=_0x552ebf[_0x424230(0x1cc)]?.[_0x424230(0x1a0)](_0x1a2032=>_0x1a2032['key']==='sys'),_0x1a592e=_0x34726c?a39_0x37d687['dim'](_0x424230(0x174)):'';return'📁\x20'+_0x552ebf[_0x424230(0x1c0)]+_0x1a592e;});await writeOutput(_0x54277a['join']('\x0a'),_0x2af902['output'],_0x465bf4(0x258));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']='workflow:workflows';[a39_0xf0f359(0x214)]='List\x20workflows';async[a39_0xf0f359(0x246)](_0x43601a){const _0x2e1d2b=a39_0xf0f359,{options:_0x489e1e,args:_0x2e8741,tdx:_0x266e9c}=_0x43601a,_0x524cc8=this[_0x2e1d2b(0x17b)](_0x2e8741,_0x489e1e);_0x489e1e['verbose']&&_0x524cc8&&console['error']('Project\x20filter:\x20'+_0x524cc8);const _0x1bdaaa=await withSpinner(_0x2e1d2b(0xfa),()=>_0x266e9c[_0x2e1d2b(0x262)][_0x2e1d2b(0x127)](_0x524cc8,{'limit':_0x489e1e[_0x2e1d2b(0x27f)]}),{'verbose':_0x489e1e[_0x2e1d2b(0x215)]});let _0x19f9a2=_0x1bdaaa[_0x2e1d2b(0x230)];_0x19f9a2[_0x2e1d2b(0x148)]((_0x241e07,_0x459eb7)=>{const _0x56b172=_0x2e1d2b,_0x4a1e9c=_0x241e07[_0x56b172(0x1c0)][_0x56b172(0x1c6)](_0x459eb7['name']);if(_0x4a1e9c!==0x0)return _0x4a1e9c;return(_0x241e07[_0x56b172(0x164)]?.[_0x56b172(0x1c0)]||'')[_0x56b172(0x1c6)](_0x459eb7[_0x56b172(0x164)]?.['name']||'');});const _0x14397d=_0x489e1e[_0x2e1d2b(0x27f)]||0x64,_0x5225f4=_0x19f9a2['length']>=_0x14397d?a39_0x37d687[_0x2e1d2b(0x145)](_0x2e1d2b(0x274)):'';console['error'](_0x2e1d2b(0x202)+_0x19f9a2[_0x2e1d2b(0x288)]+_0x2e1d2b(0x118)+(_0x19f9a2[_0x2e1d2b(0x288)]!==0x1?'s':'')+_0x5225f4);if(_0x489e1e[_0x2e1d2b(0x225)]===_0x2e1d2b(0x158)||_0x489e1e[_0x2e1d2b(0x225)]===_0x2e1d2b(0x129)||_0x489e1e[_0x2e1d2b(0x225)]===_0x2e1d2b(0x19c))await handleSDKOutput(_0x19f9a2,_0x489e1e);else{if(_0x19f9a2['length']===0x0)_0x524cc8?console[_0x2e1d2b(0x1c7)]('No\x20workflows\x20found\x20in\x20project:\x20'+_0x524cc8):console[_0x2e1d2b(0x1c7)](_0x2e1d2b(0x13c));else{const _0x2bdf39=_0x489e1e['site'],_0x2ac52a=_0x19f9a2[_0x2e1d2b(0x27d)](_0x1ffe5d=>{const _0x1326e0=_0x2e1d2b,_0x21d1a3=a39_0x37d687[_0x1326e0(0x145)]('#'+_0x1ffe5d['id']),_0x13185b=hyperlink(_0x21d1a3,getWorkflowUrl(_0x2bdf39,_0x1ffe5d['id'])),_0x285934=_0x1ffe5d[_0x1326e0(0x164)]?.['name']?a39_0x37d687['dim']('\x20('+_0x1ffe5d['project'][_0x1326e0(0x1c0)]+')'):'';return _0x1326e0(0x266)+_0x13185b+'\x20'+_0x1ffe5d[_0x1326e0(0x1c0)]+_0x285934;});await writeOutput(_0x2ac52a['join']('\x0a'),_0x489e1e[_0x2e1d2b(0x16a)],_0x2e1d2b(0x258));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']=a39_0xf0f359(0x1e8);['description']=a39_0xf0f359(0x168);async[a39_0xf0f359(0x246)](_0x28f403){const _0x2a4b69=a39_0xf0f359,{options:_0x4a8799,args:_0x55cc62,tdx:_0x2c2bce}=_0x28f403,_0x4b9af2=this[_0x2a4b69(0x241)](_0x55cc62,_0x4a8799);if(!_0x4b9af2)return 0x1;const {projectName:_0x3a87eb,workflowName:_0x40b416}=_0x4b9af2;if(_0x4a8799[_0x2a4b69(0x215)]){if(_0x3a87eb&&_0x40b416)console[_0x2a4b69(0x1b6)]('Filter:\x20'+_0x3a87eb+'.'+_0x40b416);else _0x3a87eb&&console[_0x2a4b69(0x1b6)](_0x2a4b69(0x1ec)+_0x3a87eb);const _0x5715b5=_0x4a8799[_0x2a4b69(0x13d)];_0x5715b5&&console[_0x2a4b69(0x1b6)](_0x2a4b69(0x1f5)+_0x5715b5);}let _0x371e10=0x28;if(process[_0x2a4b69(0x165)][_0x2a4b69(0x273)]&&!_0x4a8799[_0x2a4b69(0x16a)]&&!_0x4a8799['format']){const _0x8a4726=process[_0x2a4b69(0x165)]['rows']||0x28;_0x371e10=Math[_0x2a4b69(0x105)](0x14,Math['floor'](_0x8a4726*0x2/0x3));}const _0x562114=_0x4a8799[_0x2a4b69(0x27f)]||_0x371e10,_0x24add3=await withSpinner(_0x2a4b69(0x25d),()=>_0x2c2bce['workflow'][_0x2a4b69(0x146)]({'projectName':_0x3a87eb,'workflowName':_0x40b416,'status':_0x4a8799[_0x2a4b69(0x13d)],'fromTime':_0x4a8799[_0x2a4b69(0x201)],'toTime':_0x4a8799['to'],'limit':_0x562114}),{'verbose':_0x4a8799[_0x2a4b69(0x215)]}),_0x3bda5b=_0x24add3['data'];_0x3bda5b[_0x2a4b69(0x148)]((_0x2114bc,_0x6051e1)=>{const _0x395a1f=_0x2a4b69,_0x2064bf=_0x2114bc['sessionTime']||'',_0x2abc8f=_0x6051e1[_0x395a1f(0x22e)]||'';return _0x2abc8f[_0x395a1f(0x1c6)](_0x2064bf);});_0x3bda5b['length']>=_0x562114?console[_0x2a4b69(0x1b6)](_0x2a4b69(0x247)+_0x3bda5b[_0x2a4b69(0x288)]+_0x2a4b69(0x14e)+a39_0x37d687[_0x2a4b69(0x145)]('(use\x20--limit\x20to\x20see\x20more)')):console['error'](_0x2a4b69(0x202)+_0x3bda5b[_0x2a4b69(0x288)]+_0x2a4b69(0x1f3)+(_0x3bda5b[_0x2a4b69(0x288)]!==0x1?'s':''));if(_0x4a8799[_0x2a4b69(0x225)]==='json'||_0x4a8799[_0x2a4b69(0x225)]===_0x2a4b69(0x129)||_0x4a8799[_0x2a4b69(0x225)]===_0x2a4b69(0x19c))await handleSDKOutput(_0x3bda5b,_0x4a8799);else{if(!process[_0x2a4b69(0x165)][_0x2a4b69(0x273)]||_0x4a8799[_0x2a4b69(0x16a)]){if(_0x3bda5b[_0x2a4b69(0x288)]===0x0){if(_0x3a87eb&&_0x40b416)console[_0x2a4b69(0x1c7)](_0x2a4b69(0xfd)+_0x3a87eb+'.'+_0x40b416);else _0x3a87eb?console['log'](_0x2a4b69(0x26e)+_0x3a87eb):console[_0x2a4b69(0x1c7)](_0x2a4b69(0x11c));}else{const _0x1e6737=_0x4a8799[_0x2a4b69(0x233)],_0x840af8=this[_0x2a4b69(0x189)](_0x3bda5b,_0x1e6737);_0x4a8799[_0x2a4b69(0x16a)]?await writeOutput(_0x840af8,_0x4a8799[_0x2a4b69(0x16a)],'list'):console[_0x2a4b69(0x1c7)](_0x840af8);}!_0x3a87eb&&(console['error'](''),console[_0x2a4b69(0x1b6)](a39_0x37d687[_0x2a4b69(0x145)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x2a4b69(0x1b6)](a39_0x37d687[_0x2a4b69(0x145)](_0x2a4b69(0x260))+'or'+a39_0x37d687[_0x2a4b69(0x145)](_0x2a4b69(0x1a9))));}else{if(_0x3bda5b[_0x2a4b69(0x288)]===0x0){if(_0x3a87eb&&_0x40b416)console[_0x2a4b69(0x1c7)]('No\x20sessions\x20found\x20for:\x20'+_0x3a87eb+'.'+_0x40b416);else _0x3a87eb?console[_0x2a4b69(0x1c7)](_0x2a4b69(0x26e)+_0x3a87eb):console[_0x2a4b69(0x1c7)](_0x2a4b69(0x11c));}else await this[_0x2a4b69(0x1a4)](_0x3bda5b,_0x28f403,_0x3a87eb);}}return 0x0;}[a39_0xf0f359(0x189)](_0x44956d,_0x52a367){const _0x397b77=a39_0xf0f359,_0x1c7407=[],_0x582b87=new Map();let _0x337b1e=Infinity,_0x5cfabf=-Infinity;for(const _0x4cd59f of _0x44956d){if(_0x4cd59f['lastAttempt']?.['createdAt']){const _0x963b87=new Date(_0x4cd59f['lastAttempt'][_0x397b77(0x279)])['getTime'](),_0x41bd4c=_0x4cd59f['lastAttempt'][_0x397b77(0x17c)]?new Date(_0x4cd59f['lastAttempt'][_0x397b77(0x17c)])[_0x397b77(0xf9)]():Date['now'](),_0x341474=_0x4cd59f[_0x397b77(0x164)]?.[_0x397b77(0x1c0)]||_0x397b77(0x1b4);!_0x582b87[_0x397b77(0x192)](_0x341474)&&_0x582b87[_0x397b77(0xf6)](_0x341474,[]),_0x582b87['get'](_0x341474)[_0x397b77(0x1ca)]({'session':_0x4cd59f,'startTime':_0x963b87,'endTime':_0x41bd4c,'duration':_0x41bd4c-_0x963b87}),_0x337b1e=Math[_0x397b77(0x259)](_0x337b1e,_0x963b87),_0x5cfabf=Math[_0x397b77(0x105)](_0x5cfabf,_0x41bd4c);}}if(_0x582b87[_0x397b77(0x18d)]===0x0)return _0x397b77(0x1cd);const _0x267377=process[_0x397b77(0x165)][_0x397b77(0x249)]||0x78,_0x4075b1=0x1e,_0x284175=0x32,_0x1817a9=0x4,_0x1c48ad=Math[_0x397b77(0x259)](_0x284175,Math['max'](_0x4075b1,Math[_0x397b77(0x184)](_0x267377*0.3))),_0x336d6e=_0x267377-_0x1c48ad-TIMELINE_CONFIG[_0x397b77(0x179)]-0x3-_0x1817a9,_0x584e9a=_0x5cfabf-_0x337b1e,_0x273e1c=_0x584e9a/_0x1c48ad,_0x582049=renderTimeAxis({'startTime':_0x337b1e,'endTime':_0x5cfabf,'durationMs':_0x584e9a,'msPerChar':_0x273e1c},_0x1c48ad),_0x333f03=[];for(const _0x399632 of _0x582b87['values']()){_0x333f03[_0x397b77(0x1ca)](..._0x399632);}_0x333f03[_0x397b77(0x148)]((_0x119583,_0x154b8a)=>_0x154b8a[_0x397b77(0x16c)]-_0x119583[_0x397b77(0x16c)]);const _0x163d1b=new Date(_0x337b1e),_0xa03ff5=formatDate(_0x163d1b),_0x19d5b5=_0x1817a9+TIMELINE_CONFIG[_0x397b77(0x177)]+TIMELINE_CONFIG['ICON_SPACING']+_0x336d6e,_0x46a7b6='\x20'[_0x397b77(0x226)](_0x19d5b5-_0xa03ff5['length']),_0x2d5f8f=_0x46a7b6+a39_0x37d687['dim'](_0xa03ff5)+'\x20'+_0x582049;_0x1c7407['push'](_0x2d5f8f);const _0x16a100=0x16;let _0x179798=0x0;for(const _0x44934d of _0x333f03){const _0x12fd41=_0x44934d[_0x397b77(0x23c)]['project']?.[_0x397b77(0x1c0)]||'?',_0x424bb6=Math[_0x397b77(0x259)](stringWidth(_0x12fd41),_0x16a100);_0x179798=Math[_0x397b77(0x105)](_0x179798,_0x424bb6);}for(const _0x3ceb18 of _0x333f03){const {session:_0x262cb4,startTime:_0x30f327,endTime:_0x20dcde,duration:_0x1f845c}=_0x3ceb18,_0x410fcf=_0x262cb4[_0x397b77(0x164)]?.['id'],_0x4c4c6f=_0x262cb4['id'],_0x98dce0=_0x262cb4[_0x397b77(0x164)]?.[_0x397b77(0x1c0)]||'?',_0x145447=_0x262cb4[_0x397b77(0x262)]?.[_0x397b77(0x1c0)]||'?';let _0x26a61b,_0x467a74;if(_0x262cb4['lastAttempt']){const _0x52b657=_0x262cb4[_0x397b77(0x1e7)];!_0x52b657['done']?(_0x26a61b=_0x52b657['cancelRequested']?'🛑':'🔄',_0x467a74=_0x52b657[_0x397b77(0x26d)]?a39_0x37d687['yellow']:a39_0x37d687[_0x397b77(0x1e4)]):(_0x26a61b=_0x52b657[_0x397b77(0x153)]?'✅':'❌',_0x467a74=_0x52b657[_0x397b77(0x153)]?a39_0x37d687[_0x397b77(0x10b)]:a39_0x37d687['red']);}else _0x26a61b='⏳',_0x467a74=a39_0x37d687['dim'];const _0x510ea5='#'+_0x4c4c6f,_0x430c37=_0x410fcf?hyperlink(_0x510ea5,getWorkflowSessionUrl(_0x52a367,_0x410fcf,_0x4c4c6f)):_0x510ea5;let _0x5dcf84=_0x98dce0;stringWidth(_0x98dce0)>_0x16a100&&(_0x5dcf84=_0x98dce0['slice'](0x0,_0x16a100-0x1)+'…');const _0x5d0fee=a39_0x37d687[_0x397b77(0x145)](_0x5dcf84),_0x467f73=stringWidth(_0x5dcf84),_0x45d9ea='\x20'[_0x397b77(0x226)](_0x179798-stringWidth(_0x5dcf84)+0x2),_0x40ec4c='('+formatElapsed(_0x1f845c)+')',_0x7c23b2=stringWidth(_0x40ec4c),_0x4c2747=stringWidth(_0x510ea5),_0x2c8fb0=_0x4c2747+0x1+_0x467f73+_0x45d9ea[_0x397b77(0x288)],_0x342223=_0x336d6e-_0x2c8fb0-_0x7c23b2-0x1-0x8;let _0x4efc17=_0x145447;stringWidth(_0x4efc17)>_0x342223&&(_0x4efc17=_0x4efc17['slice'](0x0,_0x342223-0x1)+'…');const _0x53663a=_0x430c37+'\x20'+_0x5d0fee+_0x45d9ea+_0x4efc17,_0x2e0d42=stringWidth(_0x53663a),_0x12c0f5=_0x336d6e-_0x2e0d42-_0x7c23b2,_0xa98880=_0x53663a+'\x20'[_0x397b77(0x226)](Math['max'](0x1,_0x12c0f5))+a39_0x37d687['dim'](_0x40ec4c),_0x103cd0=Math[_0x397b77(0x184)]((_0x30f327-_0x337b1e)/_0x273e1c),_0x344bde=Math[_0x397b77(0x184)]((_0x20dcde-_0x337b1e)/_0x273e1c),_0x14e172=Math[_0x397b77(0x105)](_0x103cd0+0x1,_0x344bde),_0x1d5176=new Array(_0x1c48ad)[_0x397b77(0x1b0)]('\x20');for(let _0x6a3b7f=_0x103cd0;_0x6a3b7f<Math[_0x397b77(0x259)](_0x14e172,_0x1c48ad);_0x6a3b7f++){_0x1d5176[_0x6a3b7f]='─';}const _0x5b8e38=_0x1d5176[_0x397b77(0x27d)](_0x54e464=>_0x54e464==='\x20'?'\x20':_0x467a74(_0x54e464))['join']('');_0x1c7407[_0x397b77(0x1ca)](_0x26a61b+'\x20'+_0xa98880+'│'+_0x5b8e38+'│');}return _0x1c7407[_0x397b77(0xe8)]('\x0a');}async[a39_0xf0f359(0x1a4)](_0x343686,_0x53cea2,_0x5f57c1){const _0x2ace30=a39_0xf0f359,{options:_0x1d8be0,tdx:_0x5e40a6}=_0x53cea2,_0x32afcf=_0x1d8be0[_0x2ace30(0x233)],{timelineRows:_0x1e328a,timeAxisHeader:_0xbea986}=this[_0x2ace30(0x12e)](_0x343686,_0x32afcf),_0x29658e=_0x1e328a[_0x2ace30(0x1d4)](_0x1f8e40=>_0x1f8e40[_0x2ace30(0x24b)]);if(_0x29658e[_0x2ace30(0x288)]===0x0){const _0x26fb1c=this[_0x2ace30(0x189)](_0x343686,_0x32afcf);console[_0x2ace30(0x1c7)](_0x26fb1c);!_0x5f57c1&&(console[_0x2ace30(0x1b6)](''),console[_0x2ace30(0x1b6)](a39_0x37d687['dim'](_0x2ace30(0x13a))),console[_0x2ace30(0x1b6)](a39_0x37d687[_0x2ace30(0x145)](_0x2ace30(0x260))+'or'+a39_0x37d687['dim'](_0x2ace30(0x1a9))));return;}_0xbea986&&console[_0x2ace30(0x1c7)](_0xbea986);const _0x34478c=_0x1e328a['filter'](_0x504706=>_0x504706[_0x2ace30(0x24b)])['map'](_0x5421bf=>({'title':_0x5421bf[_0x2ace30(0x20b)],'value':_0x5421bf[_0x2ace30(0x24b)]})),_0xbcc741=process[_0x2ace30(0x165)]['rows']||0x3c,_0xe529c5=Math[_0x2ace30(0x105)](0x28,Math[_0x2ace30(0x184)](_0xbcc741*0x2/0x3)),_0x480fa9=await a39_0xe7a3e1({'type':_0x2ace30(0x252),'name':'attemptId','message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x34478c,'initial':-0x1,'limit':_0xe529c5,'clearFirst':!![],'fallback':{'title':_0x2ace30(0x1c1),'value':null},'suggest':(_0x3d04b4,_0x1453d0)=>{const _0x32f743=_0x2ace30;if(!_0x3d04b4)return Promise['resolve'](_0x1453d0);const _0x27ced9=_0x1453d0[_0x32f743(0x1d4)](_0x3f4e6d=>{const _0xa0d96b=_0x32f743,_0x1ecb4e=_0x3f4e6d;return _0x1ecb4e[_0xa0d96b(0x161)]['toLowerCase']()['includes'](_0x3d04b4['toLowerCase']());});return Promise[_0x32f743(0x1fa)](_0x27ced9);}}),_0x28e285=()=>{const _0x32cc9d=_0x2ace30;process['stdout']['write']('\x1b[1A\x1b[2K'),process[_0x32cc9d(0x165)]['write']('\x1b[1A\x1b[2K'),process[_0x32cc9d(0x165)][_0x32cc9d(0x26a)]('\x1b[1A\x1b[2K');},_0x26f502=_0x480fa9&&_0x480fa9[_0x2ace30(0x24b)]&&_0x480fa9['attemptId']!==null&&_0x480fa9['attemptId'][_0x2ace30(0x26c)]()!=='';if(!_0x26f502){_0x28e285(),console[_0x2ace30(0x1c7)](a39_0x37d687[_0x2ace30(0x145)](_0x2ace30(0x103)));return;}_0x28e285();const _0x26b092=_0x343686[_0x2ace30(0x156)](_0x14d453=>_0x14d453['lastAttempt']?.['id']===_0x480fa9[_0x2ace30(0x24b)]);if(_0x26b092){const _0xf74a2b=_0x26b092[_0x2ace30(0x164)]?.['name']||'?',_0xd39bc7=_0x26b092[_0x2ace30(0x262)]?.['name']||'?';console[_0x2ace30(0x1c7)](_0x2ace30(0x228)+a39_0x37d687[_0x2ace30(0x145)](_0xf74a2b)+_0x2ace30(0xe3)+a39_0x37d687[_0x2ace30(0x145)](_0xd39bc7));}const _0x294e78=new WorkflowTimelineCommand();await _0x294e78[_0x2ace30(0x246)]({'args':[],'options':{..._0x1d8be0,'attemptId':_0x480fa9[_0x2ace30(0x24b)]},'tdx':_0x5e40a6});}[a39_0xf0f359(0x12e)](_0x461581,_0x293937){const _0x3bec3a=a39_0xf0f359,_0x1748d8=new Map();for(const _0x12eac7 of _0x461581){_0x12eac7['id']&&_0x12eac7[_0x3bec3a(0x1e7)]?.['id']&&_0x1748d8['set'](_0x12eac7['id'],_0x12eac7[_0x3bec3a(0x1e7)]['id']);}const _0x1051cd=[];let _0x8d0b04='';const _0x4093e8=this[_0x3bec3a(0x189)](_0x461581,_0x293937),_0x1a098c=_0x4093e8[_0x3bec3a(0x1eb)]('\x0a');for(const _0x16bac1 of _0x1a098c){if(_0x16bac1['startsWith']('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x16bac1[_0x3bec3a(0x254)](/^\s+\d{4}-\d{2}-\d{2}/))_0x8d0b04=_0x16bac1;else{if(_0x16bac1[_0x3bec3a(0x254)](/^[✅❌🔄🛑⏳]/)){const _0x33c45e=_0x16bac1['match'](/#(\d+)/),_0x486d55=_0x33c45e?_0x33c45e[0x1]:null,_0x49ccd2=_0x486d55?_0x1748d8['get'](_0x486d55)||null:null,_0x2e121b=_0x461581[_0x3bec3a(0x156)](_0x10452d=>_0x10452d['id']===_0x486d55),_0x282449=_0x2e121b?.[_0x3bec3a(0x164)]?.[_0x3bec3a(0x1c0)]||'';_0x1051cd['push']({'displayLine':_0x16bac1,'attemptId':_0x49ccd2,'projectName':_0x282449});}}}return{'timelineRows':_0x1051cd,'timeAxisHeader':_0x8d0b04};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0x207);[a39_0xf0f359(0x214)]=a39_0xf0f359(0x1dd);async[a39_0xf0f359(0x246)](_0x23ddcc){const _0x1f9c98=a39_0xf0f359,{options:_0x4cc009,args:_0x5c7e31,tdx:_0x110098}=_0x23ddcc,_0x334ddf=this[_0x1f9c98(0x241)](_0x5c7e31,_0x4cc009);if(!_0x334ddf)return 0x1;const {projectName:_0x59daa4,workflowName:_0x5847a0}=_0x334ddf,_0x1ac5e2=_0x4cc009[_0x1f9c98(0x248)];if(_0x4cc009['verbose']){if(_0x59daa4&&_0x5847a0)console[_0x1f9c98(0x1b6)]('Filter:\x20'+_0x59daa4+'.'+_0x5847a0);else _0x59daa4&&console[_0x1f9c98(0x1b6)]('Filter:\x20project='+_0x59daa4);_0x1ac5e2&&console[_0x1f9c98(0x1b6)](_0x1f9c98(0x1db));}const _0x46f980=await withSpinner(_0x1f9c98(0x267),()=>_0x110098[_0x1f9c98(0x262)]['attempts']({'projectName':_0x59daa4,'workflowName':_0x5847a0,'includeRetried':_0x1ac5e2,'limit':_0x4cc009[_0x1f9c98(0x27f)]}),{'verbose':_0x4cc009[_0x1f9c98(0x215)]}),_0x2fcdd4=_0x46f980['data'],_0x5650db=_0x4cc009['limit']||0x64,_0x1c0c37=_0x2fcdd4[_0x1f9c98(0x288)]>=_0x5650db?a39_0x37d687[_0x1f9c98(0x145)](_0x1f9c98(0x274)):'';console[_0x1f9c98(0x1b6)]('✔\x20Found\x20'+_0x2fcdd4[_0x1f9c98(0x288)]+_0x1f9c98(0x1bf)+(_0x2fcdd4[_0x1f9c98(0x288)]!==0x1?'s':'')+_0x1c0c37);if(_0x4cc009[_0x1f9c98(0x225)]==='json'||_0x4cc009['format']===_0x1f9c98(0x129)||_0x4cc009[_0x1f9c98(0x225)]===_0x1f9c98(0x19c))await handleSDKOutput(_0x2fcdd4,_0x4cc009);else{if(_0x2fcdd4['length']===0x0){if(_0x59daa4&&_0x5847a0)console[_0x1f9c98(0x1c7)](_0x1f9c98(0x1b3)+_0x59daa4+'.'+_0x5847a0);else _0x59daa4?console[_0x1f9c98(0x1c7)](_0x1f9c98(0x106)+_0x59daa4):console[_0x1f9c98(0x1c7)](_0x1f9c98(0x242));}else{const _0xeec727=_0x4cc009[_0x1f9c98(0x233)],_0x34d8bf=_0x2fcdd4[_0x1f9c98(0x27d)](_0xbae08b=>{const _0x123d04=_0x1f9c98,_0xf55f5d=a39_0x37d687[_0x123d04(0x145)]('#'+_0xbae08b['id']),_0xdd4c9b=_0xbae08b[_0x123d04(0x164)]?.['id'],_0x437211=_0xbae08b[_0x123d04(0x15f)]||_0xbae08b['sessionId'],_0x84bf=_0xdd4c9b&&_0x437211?hyperlink(_0xf55f5d,getWorkflowAttemptUrl(_0xeec727,_0xdd4c9b,_0x437211,_0xbae08b['id'])):_0xf55f5d,{icon:_0x147a93,text:_0x41d003}=getAttemptStatusDisplay(_0xbae08b),_0x107eec=(_0xbae08b[_0x123d04(0x164)]?.[_0x123d04(0x1c0)]||'?')+'.'+(_0xbae08b[_0x123d04(0x262)]?.[_0x123d04(0x1c0)]||'?'),_0x525dec=_0xbae08b[_0x123d04(0x22e)]?a39_0x37d687[_0x123d04(0x145)](_0xbae08b[_0x123d04(0x22e)]):'';return(_0x84bf+'\x20'+_0x147a93+(_0x41d003?'\x20'+_0x41d003:'')+'\x20'+_0x107eec+'\x20'+_0x525dec)[_0x123d04(0x172)]();});await writeOutput(_0x34d8bf[_0x1f9c98(0xe8)]('\x0a'),_0x4cc009[_0x1f9c98(0x16a)],'list');}}return 0x0;}}function a39_0x4576(_0x501420,_0x22c6b7){_0x501420=_0x501420-0xe2;const _0x413ea=a39_0x413e();let _0x45769d=_0x413ea[_0x501420];return _0x45769d;}export class WorkflowAttemptCommand extends BaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0xf0);[a39_0xf0f359(0x214)]=a39_0xf0f359(0x1d6);async['execute'](_0x2ddfe6){const _0x134cce=a39_0xf0f359,{options:_0x1523f1,args:_0x23f181,tdx:_0x152a36}=_0x2ddfe6,_0x159121=_0x23f181[0x0];if(!_0x159121)return console[_0x134cce(0x1b6)](_0x134cce(0x144)),0x1;_0x1523f1['verbose']&&console[_0x134cce(0x1b6)](_0x134cce(0x114)+_0x159121);const _0xc3ea94=await withSpinner('Getting\x20attempt\x20details...',()=>_0x152a36[_0x134cce(0x262)][_0x134cce(0x170)](_0x159121),{'verbose':_0x1523f1[_0x134cce(0x215)]}),_0x20a806=_0xc3ea94['data'];let _0xaae21d;!_0x20a806[_0x134cce(0x1fc)]?_0xaae21d=_0x20a806['cancelRequested']?_0x134cce(0x19e):_0x134cce(0x1d3):_0xaae21d=_0x20a806['success']?'success':_0x134cce(0x1b6);let _0x38c034;if(_0x20a806['createdAt']&&_0x20a806['finishedAt']){const _0x2c998f=new Date(_0x20a806[_0x134cce(0x279)])['getTime'](),_0x3ace07=new Date(_0x20a806['finishedAt'])[_0x134cce(0xf9)]();_0x38c034=Math[_0x134cce(0x18b)]((_0x3ace07-_0x2c998f)/0x3e8);}const _0x5360b0={'attempt_id':_0x20a806['id'],'status':_0xaae21d,..._0x20a806[_0x134cce(0x193)]!==undefined&&{'index':_0x20a806[_0x134cce(0x193)]},..._0x20a806[_0x134cce(0x164)]&&{'project':_0x20a806[_0x134cce(0x164)][_0x134cce(0x1c0)]},..._0x20a806[_0x134cce(0x262)]&&{'workflow':_0x20a806[_0x134cce(0x262)]['name']},..._0x20a806[_0x134cce(0x176)]&&{'session_id':_0x20a806['sessionId']},..._0x20a806['sessionTime']&&{'session_time':_0x20a806[_0x134cce(0x22e)]},..._0x20a806[_0x134cce(0x1f7)]&&{'retry_attempt':_0x20a806[_0x134cce(0x1f7)]},..._0x38c034!==undefined&&{'duration_sec':_0x38c034},..._0x20a806[_0x134cce(0x279)]&&{'created_at':_0x20a806[_0x134cce(0x279)]},..._0x20a806[_0x134cce(0x17c)]&&{'finished_at':_0x20a806[_0x134cce(0x17c)]},...Object[_0x134cce(0x217)](_0x20a806['params'])[_0x134cce(0x288)]>0x0&&{'params':_0x20a806[_0x134cce(0x13b)]}};return await handleSingleObjectOutput(_0x5360b0,_0x1523f1),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0x151);[a39_0xf0f359(0x214)]='Show\x20tasks\x20for\x20an\x20attempt';async[a39_0xf0f359(0x246)](_0x6a602b){const _0xbe9fed=a39_0xf0f359,{options:_0x44cfff,args:_0x51224b,tdx:_0x4b283a}=_0x6a602b,_0x911fb9=_0x51224b[0x0];if(!_0x911fb9)return console[_0xbe9fed(0x1b6)](_0xbe9fed(0x144)),0x1;const _0x3d79f2=_0x44cfff[_0xbe9fed(0x10a)];_0x44cfff[_0xbe9fed(0x215)]&&(console['error'](_0xbe9fed(0x114)+_0x911fb9),_0x3d79f2&&console[_0xbe9fed(0x1b6)]('Including\x20subtasks:\x20yes'));const _0xa8498f=await withSpinner(_0xbe9fed(0x18e),()=>_0x4b283a[_0xbe9fed(0x262)]['tasks'](_0x911fb9,_0x3d79f2||![]),{'verbose':_0x44cfff[_0xbe9fed(0x215)]}),_0x350109=_0xa8498f[_0xbe9fed(0x230)];return console[_0xbe9fed(0x1b6)](_0xbe9fed(0x202)+_0x350109[_0xbe9fed(0x288)]+_0xbe9fed(0xed)+(_0x350109[_0xbe9fed(0x288)]!==0x1?'s':'')),await handleSDKOutput(_0x350109,_0x44cfff),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0x150);[a39_0xf0f359(0x214)]=a39_0xf0f359(0x1fb);async[a39_0xf0f359(0x246)](_0x241c21){const _0x91e76a=a39_0xf0f359,{options:_0x5e163b,args:_0x1ce8bc,tdx:_0x4a3b39}=_0x241c21,_0x2334e0=_0x1ce8bc[0x0];let _0x333d85=_0x1ce8bc[0x1];if(!_0x2334e0)return console[_0x91e76a(0x1b6)](_0x91e76a(0x144)),0x1;_0x5e163b[_0x91e76a(0x215)]&&(console[_0x91e76a(0x1b6)](_0x91e76a(0x114)+_0x2334e0),_0x333d85&&console[_0x91e76a(0x1b6)]('Task\x20name:\x20'+_0x333d85));const _0x4dd0ce=await withSpinner(_0x91e76a(0x1cf),()=>_0x4a3b39[_0x91e76a(0x262)][_0x91e76a(0x25f)](_0x2334e0,_0x333d85),{'verbose':_0x5e163b[_0x91e76a(0x215)]}),_0x2ad14b=_0x4dd0ce['data'];if(_0x2ad14b[_0x91e76a(0x288)]===0x0)return console[_0x91e76a(0x1b6)](_0x91e76a(0x1f0)),0x0;if(!_0x333d85&&(_0x5e163b['json']||_0x5e163b[_0x91e76a(0x225)]))return await handleSDKOutput(_0x2ad14b,_0x5e163b),0x0;if(!_0x333d85){const _0x468d75=_0x2ad14b[_0x91e76a(0x27d)](_0x42ce11=>({'title':_0x42ce11[_0x91e76a(0x232)]+'\x20('+formatBytes(_0x42ce11[_0x91e76a(0x21a)])+')','value':_0x42ce11[_0x91e76a(0x232)]})),_0x41719d=await a39_0xe7a3e1({'type':_0x91e76a(0x16b),'name':'task','message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x468d75});if(!_0x41719d[_0x91e76a(0xf2)])return console['error']('Cancelled'),0x0;_0x333d85=_0x41719d['task'];}const _0x497c4d=await withSpinner(_0x91e76a(0x283),()=>_0x4a3b39[_0x91e76a(0x262)]['logs'](_0x2334e0,_0x333d85),{'verbose':_0x5e163b[_0x91e76a(0x215)]}),_0x1cf05a=_0x497c4d[_0x91e76a(0x230)];return _0x1cf05a?console['log'](_0x1cf05a):console[_0x91e76a(0x1b6)](_0x91e76a(0x181)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0x240);['description']=a39_0xf0f359(0x157);async[a39_0xf0f359(0x246)](_0x323c66){const _0x454467=a39_0xf0f359,{options:_0x58ba42,args:_0x4a41ae,tdx:_0xf3d109}=_0x323c66,_0x5dd587=_0x4a41ae[0x0];if(!_0x5dd587)return console[_0x454467(0x1b6)](_0x454467(0x144)),0x1;const _0xc23cb1=_0x58ba42[_0x454467(0x243)];_0x58ba42[_0x454467(0x215)]&&(console[_0x454467(0x1b6)](_0x454467(0x114)+_0x5dd587),_0xc23cb1&&console[_0x454467(0x1b6)](_0x454467(0x19a)+_0xc23cb1));if(!_0x58ba42['yes']){const _0x4a6dca=await confirmKey(_0x454467(0x24f)+_0x5dd587+'?');if(!_0x4a6dca)return console[_0x454467(0x1b6)](_0x454467(0x103)),0x0;}const _0x17655d=await withSpinner('Killing\x20attempt...',()=>_0xf3d109['workflow']['kill'](_0x5dd587,_0xc23cb1),{'verbose':_0x58ba42[_0x454467(0x215)]}),_0x564269=_0x17655d[_0x454467(0x230)];return console[_0x454467(0x1b6)]('✔\x20'+_0x564269),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a39_0xf0f359(0x1c0)]='workflow:retry';[a39_0xf0f359(0x214)]=a39_0xf0f359(0xe5);async[a39_0xf0f359(0x246)](_0x132d1a){const _0x378efb=a39_0xf0f359,{options:_0x1109f8,args:_0x14ee5f,tdx:_0x3026a2}=_0x132d1a,_0x16e251=_0x14ee5f[0x0];if(!_0x16e251)return console['error'](_0x378efb(0x122)),console[_0x378efb(0x1b6)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x5b3aea=![],_0x45df59=_0x16e251;if(_0x16e251['startsWith'](_0x378efb(0x12d)))_0x5b3aea=!![],_0x45df59=_0x16e251[_0x378efb(0x1cb)](0x8);else{if(_0x16e251[_0x378efb(0x107)](_0x378efb(0x1b9)))_0x5b3aea=![],_0x45df59=_0x16e251[_0x378efb(0x1cb)](0x8);else return console[_0x378efb(0x1b6)](_0x378efb(0x12a)),console[_0x378efb(0x1b6)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0xe82b5c=_0x1109f8[_0x378efb(0x1ff)],_0x18dde9=_0x1109f8[_0x378efb(0x27a)],_0x7eef50=_0x1109f8['params'],_0x410525=_0x1109f8[_0x378efb(0x27c)];_0x1109f8[_0x378efb(0x215)]&&(console[_0x378efb(0x1b6)](_0x378efb(0x119)+(_0x5b3aea?_0x378efb(0x23c):_0x378efb(0x170))+'\x20'+_0x45df59),_0xe82b5c&&console[_0x378efb(0x1b6)](_0x378efb(0x234)+_0xe82b5c),_0x18dde9&&console['error'](_0x378efb(0x1a7)+_0x18dde9),_0x7eef50&&console[_0x378efb(0x1b6)](_0x378efb(0x125)+_0x7eef50),_0x410525&&console['error'](_0x378efb(0x22c)));let _0x130192;if(_0x7eef50)try{if(_0x7eef50[_0x378efb(0x107)]('@')){const _0x82dc5=await import(_0x378efb(0x132)),_0x17e5a5=_0x7eef50[_0x378efb(0x1cb)](0x1),_0x3fbeec=await _0x82dc5[_0x378efb(0x24e)](_0x17e5a5,'utf-8');_0x130192=JSON[_0x378efb(0x238)](_0x3fbeec);}else _0x130192=JSON['parse'](_0x7eef50);}catch{return console[_0x378efb(0x1b6)](_0x378efb(0x281)),0x1;}if(!_0x1109f8[_0x378efb(0x1e9)]){const _0x5d47ea=await confirmKey(_0x378efb(0x104)+(_0x5b3aea?_0x378efb(0x23c):_0x378efb(0x170))+'\x20'+_0x45df59+'?');if(!_0x5d47ea)return console[_0x378efb(0x1b6)]('Cancelled'),0x0;}let _0x446406;_0x5b3aea?_0x446406=await withSpinner(_0x378efb(0x1b8),()=>_0x3026a2[_0x378efb(0x262)][_0x378efb(0x197)](_0x45df59,{'fromTask':_0xe82b5c,'retryParams':_0x130192}),{'verbose':_0x1109f8[_0x378efb(0x215)]}):_0x446406=await withSpinner(_0x378efb(0x25a),()=>_0x3026a2[_0x378efb(0x262)][_0x378efb(0x289)](_0x45df59,{'resumeFrom':_0x18dde9,'retryParams':_0x130192,'force':_0x410525}),{'verbose':_0x1109f8['verbose']});const _0x343ead=_0x446406[_0x378efb(0x230)];return console[_0x378efb(0x1b6)]('✔\x20Retry\x20started'),console['error']('\x20\x20New\x20attempt\x20ID:\x20'+_0x343ead[_0x378efb(0x24b)]),console[_0x378efb(0x1b6)](_0x378efb(0x138)+_0x343ead[_0x378efb(0x176)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a39_0xf0f359(0x265);[a39_0xf0f359(0x214)]=a39_0xf0f359(0x162);async[a39_0xf0f359(0x246)](_0x3970a8){const _0x12eca6=a39_0xf0f359,{options:_0x2ac1ff,args:_0x3765fa,tdx:_0x11afda}=_0x3970a8;let _0x304ece=_0x3765fa[0x0];if(!_0x304ece){const _0xfc478c=this[_0x12eca6(0x17b)]([],_0x2ac1ff),_0x3c2abe=await withSpinner('Loading\x20workflows...',()=>_0x11afda['workflow'][_0x12eca6(0x127)](_0xfc478c,{'limit':_0x2ac1ff[_0x12eca6(0x27f)]}),{'verbose':_0x2ac1ff['verbose']}),_0x441fae=_0x3c2abe[_0x12eca6(0x230)];if(_0x441fae[_0x12eca6(0x288)]===0x0)return console[_0x12eca6(0x1b6)]('No\x20workflows\x20found'),!_0xfc478c&&console['error'](a39_0x37d687[_0x12eca6(0x145)](_0x12eca6(0x209))),0x1;const _0x21c372=_0x441fae[_0x12eca6(0x27d)](_0x55da42=>({'title':_0x55da42[_0x12eca6(0x164)]?.[_0x12eca6(0x1c0)]+'.'+_0x55da42[_0x12eca6(0x1c0)],'value':_0x55da42[_0x12eca6(0x164)]?.['name']+'.'+_0x55da42[_0x12eca6(0x1c0)],'description':_0x55da42[_0x12eca6(0x20a)]?_0x12eca6(0x149)+_0x55da42[_0x12eca6(0x20a)]:undefined})),_0xaef4d0=await a39_0xe7a3e1({'type':_0x12eca6(0x16b),'name':'workflow','message':_0x12eca6(0x10d),'choices':_0x21c372});if(!_0xaef4d0[_0x12eca6(0x262)])return 0x1;_0x304ece=_0xaef4d0[_0x12eca6(0x262)];}if(!_0x304ece[_0x12eca6(0x276)]('.')){const _0x31e045=this['resolveProject']([],_0x2ac1ff);if(_0x31e045)_0x304ece=_0x31e045+'.'+_0x304ece;else return console[_0x12eca6(0x1b6)](a39_0x37d687[_0x12eca6(0x224)]('Error:'),_0x12eca6(0x253)),console['error'](a39_0x37d687['dim'](_0x12eca6(0x209))),0x1;}const _0x107bf8=_0x2ac1ff[_0x12eca6(0x1ba)],_0x1d1add=_0x2ac1ff['sessionTime'],_0xb55e6d={};if(_0x107bf8&&Array[_0x12eca6(0x22b)](_0x107bf8))for(const _0x518c6d of _0x107bf8){const _0x24a9ec=_0x518c6d['indexOf']('=');if(_0x24a9ec===-0x1)return console[_0x12eca6(0x1b6)](_0x12eca6(0x1a6)+_0x518c6d),console['error'](_0x12eca6(0x24d)),0x1;const _0x5431d9=_0x518c6d[_0x12eca6(0x1cb)](0x0,_0x24a9ec),_0x22456e=_0x518c6d[_0x12eca6(0x1cb)](_0x24a9ec+0x1);try{_0xb55e6d[_0x5431d9]=JSON[_0x12eca6(0x238)](_0x22456e);}catch{_0xb55e6d[_0x5431d9]=_0x22456e;}}_0x2ac1ff['verbose']&&(console[_0x12eca6(0x1b6)]('Workflow:\x20'+_0x304ece),Object['keys'](_0xb55e6d)[_0x12eca6(0x288)]>0x0&&console[_0x12eca6(0x1b6)]('Parameters:\x20'+JSON[_0x12eca6(0x21f)](_0xb55e6d)),_0x1d1add&&console[_0x12eca6(0x1b6)](_0x12eca6(0x1ad)+_0x1d1add));const _0x5e9991=await withSpinner('Starting\x20workflow\x20run...',()=>_0x11afda[_0x12eca6(0x262)][_0x12eca6(0x121)](_0x304ece,_0xb55e6d,{'sessionTime':_0x1d1add}),{'verbose':_0x2ac1ff['verbose']}),_0x905d6e=_0x5e9991[_0x12eca6(0x230)];console[_0x12eca6(0x1b6)](_0x12eca6(0x1a3)),console[_0x12eca6(0x1b6)](_0x12eca6(0x169)+_0x905d6e['id']),console[_0x12eca6(0x1b6)](_0x12eca6(0x138)+_0x905d6e[_0x12eca6(0x176)]),console['error'](_0x12eca6(0x115)+_0x905d6e[_0x12eca6(0x164)]?.[_0x12eca6(0x1c0)]),console['error'](_0x12eca6(0x1de)+_0x905d6e[_0x12eca6(0x262)]?.[_0x12eca6(0x1c0)]);if(_0x905d6e[_0x12eca6(0x164)]?.['id']&&_0x905d6e['sessionId']&&_0x905d6e['id']){const _0xc29920=_0x2ac1ff['site'],_0xf149af=getConsoleUrl(_0xc29920,'/app/workflows/'+_0x905d6e[_0x12eca6(0x164)]['id']+_0x12eca6(0x1f8)+_0x905d6e[_0x12eca6(0x176)]+'/attempt/'+_0x905d6e['id']);console[_0x12eca6(0x1b6)]('\x20\x20Console:\x20'+a39_0x37d687[_0x12eca6(0x235)](_0xf149af));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0xe9);[a39_0xf0f359(0x214)]=a39_0xf0f359(0x13f);async[a39_0xf0f359(0x246)](_0x323b73){const _0x10a5d9=a39_0xf0f359,{options:_0x10195c,args:_0x782f61,tdx:_0x400b92}=_0x323b73,_0x152ac4=_0x782f61[0x0],_0x244602=_0x782f61[0x1]||'.';if(!_0x152ac4)return console[_0x10a5d9(0x1b6)](_0x10a5d9(0x159)),console[_0x10a5d9(0x1b6)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x464006=_0x10195c[_0x10a5d9(0x20a)];_0x10195c['verbose']&&(console[_0x10a5d9(0x1b6)]('Project:\x20'+_0x152ac4),console[_0x10a5d9(0x1b6)](_0x10a5d9(0x1d2)+_0x244602),_0x464006&&console[_0x10a5d9(0x1b6)](_0x10a5d9(0x1da)+_0x464006));const _0x352473=await withSpinner(_0x10a5d9(0x195)+_0x152ac4+_0x10a5d9(0x236),()=>_0x400b92[_0x10a5d9(0x262)][_0x10a5d9(0x245)](_0x152ac4,_0x244602,{'revision':_0x464006}),{'verbose':_0x10195c[_0x10a5d9(0x215)]}),_0x20d928=_0x352473[_0x10a5d9(0x230)];return console[_0x10a5d9(0x1b6)](_0x10a5d9(0x284)+_0x20d928['projectName']),console['error'](_0x10a5d9(0x204)+_0x20d928[_0x10a5d9(0x20a)]),console[_0x10a5d9(0x1b6)]('\x20\x20Files\x20extracted:\x20'+_0x20d928[_0x10a5d9(0x123)]),console[_0x10a5d9(0x1b6)](_0x10a5d9(0x11b)+_0x244602+'/'+_0x20d928['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0x175);[a39_0xf0f359(0x214)]=a39_0xf0f359(0x102);async['execute'](_0x5294de){const _0x56570d=a39_0xf0f359,{options:_0x28c77f,args:_0x72318a,tdx:_0x39b069}=_0x5294de;let _0x560b85='.',_0x46d745=_0x28c77f[_0x56570d(0x1c0)];if(_0x72318a[0x0]){const {promises:_0x112f20}=await import('fs');try{const _0x374c8d=await _0x112f20[_0x56570d(0x20e)](_0x72318a[0x0]);if(_0x374c8d[_0x56570d(0x1fe)]())_0x560b85=_0x72318a[0x0];else return console[_0x56570d(0x1b6)](_0x56570d(0x1f9)+_0x72318a[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x46d745=_0x72318a[0x0],_0x560b85='.';}}const _0x1e73ca=_0x28c77f[_0x56570d(0x20a)],_0x2fa0c1=_0x28c77f[_0x56570d(0x22a)];_0x28c77f['verbose']&&(console[_0x56570d(0x1b6)](_0x56570d(0x1b5)+_0x560b85),_0x46d745&&console[_0x56570d(0x1b6)](_0x56570d(0x1f2)+_0x46d745),_0x1e73ca&&console['error'](_0x56570d(0x1da)+_0x1e73ca),_0x2fa0c1&&console[_0x56570d(0x1b6)](_0x56570d(0x27b)));const _0x5a0c7b=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x39b069[_0x56570d(0x262)][_0x56570d(0x1ca)](_0x560b85,{'projectName':_0x46d745,'revision':_0x1e73ca,'skipValidation':_0x2fa0c1}),{'verbose':_0x28c77f[_0x56570d(0x215)]}),_0x58fcaf=_0x5a0c7b['data'];return console['error'](_0x56570d(0x213)+_0x58fcaf[_0x56570d(0x18f)]),console[_0x56570d(0x1b6)](_0x56570d(0x15a)+_0x58fcaf[_0x56570d(0x1be)]),console[_0x56570d(0x1b6)](_0x56570d(0x204)+_0x58fcaf[_0x56570d(0x20a)]),await this[_0x56570d(0x219)](_0x39b069,_0x58fcaf[_0x56570d(0x18f)],_0x28c77f[_0x56570d(0x233)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a39_0xf0f359(0x1c0)]='workflow:pull';['description']=a39_0xf0f359(0xf5);async[a39_0xf0f359(0x246)](_0x960e27){const _0xb92b10=a39_0xf0f359,{options:_0xf372d2,args:_0x526c1f,tdx:_0x40da89}=_0x960e27,_0x369240=_0x526c1f[0x0],_0x410b3a=_0x526c1f[0x1];if(!_0x369240)return console[_0xb92b10(0x1b6)](a39_0x37d687[_0xb92b10(0x224)]('Error:'),'Project\x20name\x20is\x20required'),console['error'](a39_0x37d687[_0xb92b10(0x145)](_0xb92b10(0x237))),0x1;const _0x5353ee=_0xf372d2['revision'];_0xf372d2[_0xb92b10(0x215)]&&(console[_0xb92b10(0x1b6)](_0xb92b10(0x228)+_0x369240),_0x410b3a&&console[_0xb92b10(0x1b6)]('Target\x20directory:\x20'+_0x410b3a),_0x5353ee&&console[_0xb92b10(0x1b6)]('Revision:\x20'+_0x5353ee),_0xf372d2['dryRun']&&console['error'](_0xb92b10(0x1c2)));const _0x2ac775=await withSpinner(_0xb92b10(0x14a)+_0x369240+_0xb92b10(0x236),()=>_0x40da89['workflow'][_0xb92b10(0x1ed)](_0x369240,{'targetDir':_0x410b3a,'revision':_0x5353ee}),{'verbose':_0xf372d2[_0xb92b10(0x215)]}),_0x2a6258=_0x2ac775['data'];_0x2a6258[_0xb92b10(0x1c9)]?console[_0xb92b10(0x1b6)](_0xb92b10(0x282)+_0x2a6258[_0xb92b10(0x18f)]):console['error'](_0xb92b10(0x17f)+_0x2a6258[_0xb92b10(0x18f)]);console[_0xb92b10(0x1b6)](_0xb92b10(0x204)+_0x2a6258[_0xb92b10(0x20a)]),console['error'](_0xb92b10(0x1e1)+(a39_0x2e3d89[_0xb92b10(0x124)](process[_0xb92b10(0x26f)](),_0x2a6258['targetDir'])||'.')),console[_0xb92b10(0x1b6)](_0xb92b10(0x130)+a39_0x37d687['green']('+'+_0x2a6258[_0xb92b10(0x141)][_0xb92b10(0x140)]+'\x20new')+',\x20'+(a39_0x37d687[_0xb92b10(0x1fd)]('~'+_0x2a6258[_0xb92b10(0x141)]['modified']+_0xb92b10(0x185))+',\x20')+(a39_0x37d687[_0xb92b10(0x224)]('-'+_0x2a6258['summary']['deleted']+_0xb92b10(0x200))+',\x20')+(''+a39_0x37d687['dim'](_0x2a6258[_0xb92b10(0x141)][_0xb92b10(0x223)]+_0xb92b10(0x1c5))));for(const _0x12c20b of _0x2a6258[_0xb92b10(0x251)]){_0x12c20b[_0xb92b10(0x12c)]===_0xb92b10(0x14b)&&_0x12c20b[_0xb92b10(0x1ab)]&&(console[_0xb92b10(0x1b6)]('\x0a'+a39_0x37d687['cyan'](_0xb92b10(0x126)+_0x12c20b[_0xb92b10(0x1e6)])),console[_0xb92b10(0x1b6)](_0x12c20b[_0xb92b10(0x1ab)]));}if(!_0x2a6258['hasChanges'])return saveSessionContext({'workflow_project':_0x2a6258['projectName']},_0xf372d2[_0xb92b10(0x23c)]),console[_0xb92b10(0x1b6)](a39_0x37d687['green'](_0xb92b10(0xf4))),console[_0xb92b10(0x1b6)](a39_0x37d687[_0xb92b10(0x145)](_0xb92b10(0x1af)+_0x2a6258[_0xb92b10(0x18f)])),0x0;if(_0xf372d2[_0xb92b10(0x21c)])return console[_0xb92b10(0x1b6)](a39_0x37d687[_0xb92b10(0x1fd)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0xf372d2['yes']){const _0x5d70f5=await confirmKey(_0xb92b10(0x11f));if(!_0x5d70f5)return console[_0xb92b10(0x1b6)]('Cancelled'),0x0;}await withSpinner('Writing\x20files...',()=>_0x40da89['workflow'][_0xb92b10(0x17d)](_0x2a6258,{'revision':_0x5353ee}),{'verbose':_0xf372d2[_0xb92b10(0x215)]}),saveSessionContext({'workflow_project':_0x2a6258[_0xb92b10(0x18f)]},_0xf372d2[_0xb92b10(0x23c)]),console['error'](a39_0x37d687[_0xb92b10(0x10b)](_0xb92b10(0x16e)));const _0xe567cc=a39_0x2e3d89[_0xb92b10(0x124)](process[_0xb92b10(0x26f)](),_0x2a6258[_0xb92b10(0x1e2)])||'.';return console[_0xb92b10(0x1b6)](a39_0x37d687[_0xb92b10(0x145)]('\x20\x20Location:\x20'+_0xe567cc)),console[_0xb92b10(0x1b6)](a39_0x37d687[_0xb92b10(0x145)](_0xb92b10(0x1af)+_0x2a6258[_0xb92b10(0x18f)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0x1bd);[a39_0xf0f359(0x214)]='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async['execute'](_0xd92ded){const _0x35a805=a39_0xf0f359,{options:_0x5ace8e,args:_0x369339,tdx:_0x54e655}=_0xd92ded,_0x55f7e6=this[_0x35a805(0x14f)](_0x369339,_0x5ace8e),_0x3f5155=_0x5ace8e[_0x35a805(0x20a)],_0x57ae02=_0x5ace8e[_0x35a805(0x22a)];_0x5ace8e[_0x35a805(0x215)]&&(_0x55f7e6&&console[_0x35a805(0x1b6)](_0x35a805(0x21b)+_0x55f7e6),_0x3f5155&&console['error'](_0x35a805(0x1da)+_0x3f5155),_0x5ace8e['dryRun']&&console[_0x35a805(0x1b6)](_0x35a805(0x1c2)),_0x57ae02&&console[_0x35a805(0x1b6)]('Validation:\x20skipped'));let _0x457d9b;try{_0x457d9b=await withSpinner('Analyzing\x20changes...',()=>_0x54e655[_0x35a805(0x262)][_0x35a805(0x1f6)]({'sourceDir':_0x55f7e6,'revision':_0x3f5155,'skipValidation':_0x57ae02}),{'verbose':_0x5ace8e['verbose']});}catch(_0x24035b){if(_0x24035b instanceof Error&&_0x24035b[_0x35a805(0xfc)][_0x35a805(0x276)](_0x35a805(0x278)))return console[_0x35a805(0x1b6)](a39_0x37d687[_0x35a805(0x224)](_0x35a805(0x264)),_0x35a805(0x116)),_0x5ace8e[_0x35a805(0x287)]?console[_0x35a805(0x1b6)](a39_0x37d687[_0x35a805(0x145)](_0x35a805(0x206)+_0x5ace8e['workflowProject']+_0x35a805(0x25c)+_0x5ace8e[_0x35a805(0x287)]+'\x27')):console[_0x35a805(0x1b6)](a39_0x37d687['dim'](_0x35a805(0x187))),0x1;throw _0x24035b;}const _0xffa95f=_0x457d9b['data'];console['error'](_0x35a805(0x17f)+_0xffa95f['projectName']),console['error'](_0x35a805(0x26b)+_0xffa95f['sourceDir']),console[_0x35a805(0x1b6)]('\x20\x20Revision:\x20'+_0xffa95f['revision']),console[_0x35a805(0x1b6)](_0x35a805(0x130)+a39_0x37d687['green']('+'+_0xffa95f[_0x35a805(0x141)]['new']+_0x35a805(0x277))+',\x20'+(a39_0x37d687[_0x35a805(0x1fd)]('~'+_0xffa95f[_0x35a805(0x141)][_0x35a805(0x14b)]+'\x20modified')+',\x20')+(a39_0x37d687[_0x35a805(0x224)]('-'+_0xffa95f[_0x35a805(0x141)][_0x35a805(0x14c)]+_0x35a805(0x200))+',\x20')+(''+a39_0x37d687[_0x35a805(0x145)](_0xffa95f[_0x35a805(0x141)][_0x35a805(0x223)]+_0x35a805(0x1c5))));for(const _0x3caa56 of _0xffa95f[_0x35a805(0x251)]){_0x3caa56[_0x35a805(0x12c)]===_0x35a805(0x14b)&&_0x3caa56[_0x35a805(0x1ab)]&&(console[_0x35a805(0x1b6)]('\x0a'+a39_0x37d687[_0x35a805(0x235)]('---\x20'+_0x3caa56['path'])),console[_0x35a805(0x1b6)](_0x3caa56[_0x35a805(0x1ab)]));}if(!_0xffa95f['hasChanges'])return console[_0x35a805(0x1b6)](a39_0x37d687[_0x35a805(0x10b)](_0x35a805(0x269))),await this[_0x35a805(0x219)](_0x54e655,_0xffa95f['projectName'],_0x5ace8e['site']),0x0;if(_0x5ace8e[_0x35a805(0x21c)])return console[_0x35a805(0x1b6)](a39_0x37d687[_0x35a805(0x1fd)](_0x35a805(0x1b2))),0x0;if(!_0x5ace8e['yes']){const _0x3f51ac=await confirmKey(_0x35a805(0x1e0));if(!_0x3f51ac)return console[_0x35a805(0x1b6)](_0x35a805(0x103)),0x0;}const _0x310ada=await withSpinner('Pushing\x20project...',()=>_0x54e655[_0x35a805(0x262)][_0x35a805(0xf1)](_0xffa95f),{'verbose':_0x5ace8e[_0x35a805(0x215)]}),_0x607ade=_0x310ada[_0x35a805(0x230)];return console[_0x35a805(0x1b6)](a39_0x37d687[_0x35a805(0x10b)](_0x35a805(0x180))),console[_0x35a805(0x1b6)](_0x35a805(0x15a)+_0x607ade[_0x35a805(0x1be)]),console[_0x35a805(0x1b6)]('\x20\x20Revision:\x20'+_0x607ade[_0x35a805(0x20a)]),await this['showWorkflowConsoleUrl'](_0x54e655,_0x607ade[_0x35a805(0x18f)],_0x5ace8e[_0x35a805(0x233)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0x261);[a39_0xf0f359(0x214)]=a39_0xf0f359(0x1d8);async[a39_0xf0f359(0x246)](_0x20c351){const _0x2f94e8=a39_0xf0f359,{options:_0x431f4c,args:_0x477b9e,tdx:_0x32e7c2}=_0x20c351,_0x553391=this[_0x2f94e8(0x14f)](_0x477b9e,_0x431f4c),_0xc05b29=_0x431f4c[_0x2f94e8(0x1c0)],_0x8a0497=_0x431f4c[_0x2f94e8(0x20a)],_0x1165b8=_0x431f4c[_0x2f94e8(0x22a)];if(!_0x553391)return console[_0x2f94e8(0x1b6)](a39_0x37d687[_0x2f94e8(0x224)](_0x2f94e8(0x264)),_0x2f94e8(0x23a)),console[_0x2f94e8(0x1b6)](a39_0x37d687[_0x2f94e8(0x145)](_0x2f94e8(0x10c))),console['error'](a39_0x37d687[_0x2f94e8(0x145)](_0x2f94e8(0x12f))),0x1;if(!_0xc05b29)return console['error'](a39_0x37d687[_0x2f94e8(0x224)](_0x2f94e8(0x264)),_0x2f94e8(0x10e)),console[_0x2f94e8(0x1b6)](a39_0x37d687[_0x2f94e8(0x145)](_0x2f94e8(0x10c))),0x1;_0x431f4c[_0x2f94e8(0x215)]&&(console[_0x2f94e8(0x1b6)](_0x2f94e8(0x21b)+_0x553391),console[_0x2f94e8(0x1b6)](_0x2f94e8(0x27e)+_0xc05b29),_0x8a0497&&console[_0x2f94e8(0x1b6)]('Revision:\x20'+_0x8a0497),_0x431f4c[_0x2f94e8(0x21c)]&&console['error']('Dry\x20run:\x20yes'),_0x1165b8&&console[_0x2f94e8(0x1b6)]('Validation:\x20skipped'));const _0x4d0549=await withSpinner(_0x2f94e8(0x20f),()=>_0x32e7c2[_0x2f94e8(0x262)][_0x2f94e8(0x137)](_0x553391,_0xc05b29,{'revision':_0x8a0497,'skipValidation':_0x1165b8}),{'verbose':_0x431f4c['verbose']}),_0x2000fd=_0x4d0549['data'];console[_0x2f94e8(0x1b6)](_0x2f94e8(0x21d)+_0x2000fd['sourceDir']);_0x2000fd[_0x2f94e8(0x117)]&&console[_0x2f94e8(0x1b6)]('Source\x20project:\x20'+_0x2000fd[_0x2f94e8(0x117)]);console['error'](_0x2f94e8(0x27e)+_0x2000fd['newProjectName']),console[_0x2f94e8(0x1b6)](_0x2f94e8(0x1da)+_0x2000fd[_0x2f94e8(0x20a)]),console[_0x2f94e8(0x1b6)](_0x2f94e8(0x173)+_0x2000fd[_0x2f94e8(0x133)]);_0x2000fd[_0x2f94e8(0xe2)]&&(console[_0x2f94e8(0x1b6)](a39_0x37d687['yellow'](_0x2f94e8(0x208)+_0x2000fd[_0x2f94e8(0x1ac)]+_0x2f94e8(0x143)+_0x2000fd[_0x2f94e8(0x1b7)]+')')),console['error'](a39_0x37d687[_0x2f94e8(0x1fd)](_0x2f94e8(0x191))));if(_0x431f4c[_0x2f94e8(0x21c)])return console['error'](a39_0x37d687[_0x2f94e8(0x1fd)](_0x2f94e8(0xf3))),0x0;if(!_0x431f4c['yes']){const _0x286f48=_0x2000fd[_0x2f94e8(0x117)]||a39_0x2e3d89[_0x2f94e8(0x227)](_0x553391),_0x1d2f2a=_0x2000fd['targetExists']?_0x2f94e8(0x257)+_0xc05b29+'\x22\x20with\x20new\x20revision?':_0x2f94e8(0x171)+_0x286f48+_0x2f94e8(0x271)+_0xc05b29+'\x22?',_0x4848a5=await confirmKey(_0x1d2f2a);if(!_0x4848a5)return console[_0x2f94e8(0x1b6)](_0x2f94e8(0x103)),0x0;}const _0x53ee9a=await withSpinner(_0x2000fd[_0x2f94e8(0xe2)]?_0x2f94e8(0x1ea)+_0xc05b29+_0x2f94e8(0x236):_0x2f94e8(0x12b)+_0xc05b29+_0x2f94e8(0x236),()=>_0x32e7c2[_0x2f94e8(0x262)]['executeCloneProject'](_0x2000fd),{'verbose':_0x431f4c[_0x2f94e8(0x215)]}),_0x4be0b1=_0x53ee9a['data'];return console[_0x2f94e8(0x1b6)](a39_0x37d687[_0x2f94e8(0x10b)](_0x2000fd[_0x2f94e8(0xe2)]?'✔\x20Project\x20updated':_0x2f94e8(0x1d5))),console['error'](_0x2f94e8(0x115)+_0x4be0b1['newProjectName']),console[_0x2f94e8(0x1b6)](_0x2f94e8(0x15a)+_0x4be0b1[_0x2f94e8(0xe7)]),console[_0x2f94e8(0x1b6)](_0x2f94e8(0x204)+_0x4be0b1[_0x2f94e8(0x20a)]),await this[_0x2f94e8(0x219)](_0x32e7c2,_0x4be0b1[_0x2f94e8(0x1ac)],_0x431f4c[_0x2f94e8(0x233)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0x231);['description']=a39_0xf0f359(0x205);async[a39_0xf0f359(0x246)](_0x570e5c){const _0x32552e=a39_0xf0f359,{options:_0x4249ee,args:_0x105301,tdx:_0x2c69f1}=_0x570e5c,_0x8fb2b6=_0x105301[0x0];if(!_0x8fb2b6)return console['error'](_0x32552e(0x1a1)),console[_0x32552e(0x1b6)](_0x32552e(0x16d)),0x1;_0x4249ee[_0x32552e(0x215)]&&console['error'](_0x32552e(0x228)+_0x8fb2b6);if(!_0x4249ee[_0x32552e(0x1e9)]){const _0x416931=await confirmKey(_0x32552e(0x18c)+_0x8fb2b6+_0x32552e(0x22d));if(!_0x416931)return console[_0x32552e(0x1b6)]('Cancelled'),0x0;}const _0xeb77d4=await withSpinner(_0x32552e(0x135)+_0x8fb2b6+_0x32552e(0x236),()=>_0x2c69f1[_0x32552e(0x262)][_0x32552e(0x270)](_0x8fb2b6),{'verbose':_0x4249ee[_0x32552e(0x215)]}),_0x553a35=_0xeb77d4[_0x32552e(0x230)];return console[_0x32552e(0x1b6)](_0x32552e(0x10f)+_0x553a35['projectName']),console['error'](_0x32552e(0x15a)+_0x553a35[_0x32552e(0x1be)]),0x0;}}export function parseKeyValue(_0x201315){const _0xf9c1e5=a39_0xf0f359,_0x39d183=_0x201315[_0xf9c1e5(0x17e)]('=');if(_0x39d183===-0x1)throw new Error('Invalid\x20format:\x20'+_0x201315+_0xf9c1e5(0x155));const _0x384af4=_0x201315[_0xf9c1e5(0x1cb)](0x0,_0x39d183),_0x508b21=_0x201315['substring'](_0x39d183+0x1);if(!_0x384af4)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x384af4,'value':_0x508b21};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0x272);[a39_0xf0f359(0x214)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a39_0xf0f359(0x246)](_0x536c9e){const _0x4d73f3=a39_0xf0f359,{options:_0x1de6c7,args:_0xe9a774,tdx:_0x1efbec}=_0x536c9e,_0x5cc13c=this[_0x4d73f3(0x286)](_0xe9a774,_0x1de6c7);if(!_0x5cc13c)return 0x1;_0x1de6c7['verbose']&&console['error'](_0x4d73f3(0x228)+_0x5cc13c);const _0x58bc78=await withSpinner('Listing\x20secrets...',()=>_0x1efbec['workflow']['listSecrets'](_0x5cc13c),{'verbose':_0x1de6c7['verbose']}),{secrets:_0x1b1119}=_0x58bc78[_0x4d73f3(0x230)];return console[_0x4d73f3(0x1b6)](_0x4d73f3(0x202)+_0x1b1119[_0x4d73f3(0x288)]+'\x20secret'+(_0x1b1119['length']!==0x1?'s':'')),await handleSDKOutput(_0x1b1119,_0x1de6c7),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a39_0xf0f359(0x1c0)]='workflow:secrets:set';[a39_0xf0f359(0x214)]='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async[a39_0xf0f359(0x246)](_0xf4364d){const _0x16b8a8=a39_0xf0f359,{options:_0x38ca3d,args:_0x516459,tdx:_0x2b2f02}=_0xf4364d;let _0xe276af,_0x1f07f7;if(_0x516459[_0x16b8a8(0x288)]>=0x2)_0xe276af=_0x516459[0x0],_0x1f07f7=_0x516459[0x1];else{if(_0x516459[_0x16b8a8(0x288)]===0x1&&_0x38ca3d[_0x16b8a8(0x287)])_0xe276af=_0x38ca3d[_0x16b8a8(0x287)],_0x1f07f7=_0x516459[0x0];else return _0x516459[_0x16b8a8(0x288)]===0x1?(console[_0x16b8a8(0x1b6)](_0x16b8a8(0x159)),console[_0x16b8a8(0x1b6)](_0x16b8a8(0x209)),0x1):(console[_0x16b8a8(0x1b6)](_0x16b8a8(0x268)),console[_0x16b8a8(0x1b6)](_0x16b8a8(0x13e)),0x1);}let _0x223cd2,_0x294d87;try{({key:_0x223cd2,value:_0x294d87}=parseKeyValue(_0x1f07f7));}catch(_0x6e6e7b){return _0x6e6e7b instanceof Error&&console[_0x16b8a8(0x1b6)](a39_0x37d687[_0x16b8a8(0x224)](_0x16b8a8(0x264)),_0x6e6e7b[_0x16b8a8(0xfc)]),0x1;}_0x38ca3d[_0x16b8a8(0x215)]&&(console[_0x16b8a8(0x1b6)](_0x16b8a8(0x228)+_0xe276af),console['error'](_0x16b8a8(0x128)+_0x223cd2));const _0x11dfc6=await withSpinner('Setting\x20secret...',()=>_0x2b2f02[_0x16b8a8(0x262)]['setSecret'](_0xe276af,_0x223cd2,_0x294d87),{'verbose':_0x38ca3d['verbose']}),_0x247203=_0x11dfc6[_0x16b8a8(0x230)];return console[_0x16b8a8(0x1b6)](_0x16b8a8(0x1b1)+_0x247203['key']+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x247203[_0x16b8a8(0x18f)]+'\x27'),(_0x38ca3d[_0x16b8a8(0x158)]||_0x38ca3d[_0x16b8a8(0x129)])&&await handleSingleObjectOutput(_0x247203,_0x38ca3d),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0x199);[a39_0xf0f359(0x214)]=a39_0xf0f359(0x190);async[a39_0xf0f359(0x246)](_0x27baf1){const _0x22ecd1=a39_0xf0f359,{options:_0x1a05fb,args:_0x367329,tdx:_0x7683e3}=_0x27baf1;let _0x340967,_0x14c165;if(_0x367329[_0x22ecd1(0x288)]>=0x2)_0x340967=_0x367329[0x0],_0x14c165=_0x367329[0x1];else{if(_0x367329['length']===0x1&&_0x1a05fb[_0x22ecd1(0x287)])_0x340967=_0x1a05fb[_0x22ecd1(0x287)],_0x14c165=_0x367329[0x0];else return _0x367329[_0x22ecd1(0x288)]===0x1?(console[_0x22ecd1(0x1b6)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x22ecd1(0x209)),0x1):(console[_0x22ecd1(0x1b6)](_0x22ecd1(0x101)),console[_0x22ecd1(0x1b6)](_0x22ecd1(0x167)),0x1);}_0x1a05fb[_0x22ecd1(0x215)]&&(console[_0x22ecd1(0x1b6)]('Project:\x20'+_0x340967),console[_0x22ecd1(0x1b6)]('Key:\x20'+_0x14c165));if(!_0x1a05fb['yes']){const _0x1301dc=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x14c165+'\x27\x20from\x20project\x20\x27'+_0x340967+'\x27?');if(!_0x1301dc)return console['error'](_0x22ecd1(0x103)),0x0;}const _0xb63bd9=await withSpinner(_0x22ecd1(0x178),()=>_0x7683e3[_0x22ecd1(0x262)][_0x22ecd1(0x11e)](_0x340967,_0x14c165),{'verbose':_0x1a05fb[_0x22ecd1(0x215)]}),_0x2cebe9=_0xb63bd9[_0x22ecd1(0x230)];return console['error']('✔\x20Secret\x20\x27'+_0x2cebe9[_0x22ecd1(0x1bb)]+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x2cebe9[_0x22ecd1(0x18f)]+'\x27'),(_0x1a05fb[_0x22ecd1(0x158)]||_0x1a05fb[_0x22ecd1(0x129)])&&await handleSingleObjectOutput(_0x2cebe9,_0x1a05fb),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(_0x3a648f){const _0x1c7e0f=a39_0xf0f359,_0x12abd1=Math['floor'](_0x3a648f/0x3e8),_0x3f0393=Math[_0x1c7e0f(0x184)](_0x12abd1/0x3c),_0x45d617=Math[_0x1c7e0f(0x184)](_0x3f0393/0x3c),_0x2117bf=Math[_0x1c7e0f(0x184)](_0x45d617/0x18);if(_0x2117bf>0x0){const _0x56576e=_0x45d617%0x18;return _0x56576e>0x0?_0x2117bf+'d\x20'+_0x56576e+'h':_0x2117bf+'d';}else{if(_0x45d617>0x0){const _0x4c3779=_0x3f0393%0x3c;return _0x4c3779>0x0?_0x45d617+'h\x20'+_0x4c3779+'m':_0x45d617+'h';}else{if(_0x3f0393>0x0){const _0x14d790=_0x12abd1%0x3c;return _0x14d790>0x0?_0x3f0393+'m\x20'+_0x14d790+'s':_0x3f0393+'m';}else return _0x12abd1+'s';}}}function formatTimestamp(_0x1e64e4,_0x1dbed2){const _0x50679f=a39_0xf0f359,_0x1213a5=new Date(_0x1e64e4),_0x436a33=String(_0x1213a5[_0x50679f(0x1d0)]())[_0x50679f(0x280)](0x2,'0'),_0xbd19df=String(_0x1213a5['getMinutes']())['padStart'](0x2,'0'),_0x357361=_0x436a33+':'+_0xbd19df,_0x2072c5=_0x1213a5[_0x50679f(0x131)]()===_0x1dbed2[_0x50679f(0x131)]()&&_0x1213a5[_0x50679f(0x120)]()===_0x1dbed2[_0x50679f(0x120)]()&&_0x1213a5[_0x50679f(0x110)]()===_0x1dbed2['getDate']();if(_0x2072c5)return _0x357361;else{const _0x5a3924=String(_0x1213a5[_0x50679f(0x120)]()+0x1)[_0x50679f(0x280)](0x2,'0'),_0x28c378=String(_0x1213a5[_0x50679f(0x110)]())[_0x50679f(0x280)](0x2,'0');return _0x5a3924+'-'+_0x28c378+'\x20'+_0x357361;}}function formatDate(_0x4907f8){const _0x3ae2a3=a39_0xf0f359,_0x122b45=_0x4907f8[_0x3ae2a3(0x131)](),_0x18ab37=String(_0x4907f8[_0x3ae2a3(0x120)]()+0x1)[_0x3ae2a3(0x280)](0x2,'0'),_0x23f733=String(_0x4907f8[_0x3ae2a3(0x110)]())[_0x3ae2a3(0x280)](0x2,'0');return _0x122b45+'-'+_0x18ab37+'-'+_0x23f733;}function getTaskStateIcon(_0x19c2af){const _0x5487b5={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x5487b5[_0x19c2af]||'⚪';}function getBarChar(_0xe3a1ae){const _0x1fffa1=a39_0xf0f359;return _0xe3a1ae==='error'||_0xe3a1ae===_0x1fffa1(0x11a)?'×':'─';}function getBarColor(_0x75f7b6){const _0x44578b=a39_0xf0f359,_0x3315fe={'success':a39_0x37d687['green'],'error':a39_0x37d687['red'],'group_error':a39_0x37d687[_0x44578b(0x224)],'running':a39_0x37d687[_0x44578b(0x1e4)],'blocked':a39_0x37d687[_0x44578b(0x1fd)],'planned':a39_0x37d687[_0x44578b(0x145)],'canceling':a39_0x37d687['yellow']};return _0x3315fe[_0x75f7b6]||a39_0x37d687[_0x44578b(0x285)];}function parseTaskName(_0x15ec74){const _0x33441b=a39_0xf0f359;let _0x46b15e=_0x15ec74[_0x33441b(0x160)](/^\++/,'');const _0x578a32=_0x46b15e['split']('+'),_0x57d3d6=_0x578a32[_0x33441b(0x288)]>0x1?_0x578a32[_0x33441b(0x288)]-0x2:0x0,_0x93639e=_0x578a32[_0x578a32['length']-0x1]||_0x46b15e;return{'level':_0x57d3d6,'name':'+'+_0x93639e};}function truncateTaskName(_0x1f3629,_0x271878){const _0x125464=a39_0xf0f359,_0x266bfc=stringWidth(_0x1f3629);if(_0x266bfc<=_0x271878)return _0x1f3629;let _0x4ae129=_0x1f3629;while(stringWidth(_0x4ae129+'…')>_0x271878&&_0x4ae129[_0x125464(0x288)]>0x0){_0x4ae129=_0x4ae129[_0x125464(0x1f1)](0x0,-0x1);}return _0x4ae129+'…';}function calculateTimeScale(_0x3d883a,_0x12b105){const _0x346070=a39_0xf0f359;return{'startTime':_0x3d883a[_0x346070(0x221)],'endTime':_0x3d883a['end'],'durationMs':_0x3d883a[_0x346070(0x1e5)],'msPerChar':_0x3d883a['duration']/_0x12b105};}function timeToPosition(_0x595a8c,_0x49710f,_0x7b7a66){const _0x275d82=a39_0xf0f359,_0x5d0989=_0x595a8c-_0x49710f[_0x275d82(0x16c)],_0x2bb539=Math['floor'](_0x5d0989/_0x49710f[_0x275d82(0x1f4)]);return Math[_0x275d82(0x105)](0x0,Math[_0x275d82(0x259)](_0x2bb539,_0x7b7a66));}function renderTimeAxis(_0x331e4c,_0x4c0e80){const _0x1680d9=a39_0xf0f359,_0x46ff34=Math[_0x1680d9(0x259)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math['max'](TIMELINE_CONFIG[_0x1680d9(0x142)],Math['floor'](_0x4c0e80/TIMELINE_CONFIG[_0x1680d9(0x23b)]))),_0x5f3549=_0x331e4c[_0x1680d9(0x218)]/(_0x46ff34-0x1),_0x1e2b96=new Date(_0x331e4c[_0x1680d9(0x16c)]),_0x516fd=[];for(let _0x40e075=0x0;_0x40e075<_0x46ff34;_0x40e075++){const _0x1a7d2d=_0x331e4c['startTime']+_0x40e075*_0x5f3549,_0xc4b956=timeToPosition(_0x1a7d2d,_0x331e4c,_0x4c0e80),_0x6184fc=formatTimestamp(_0x1a7d2d,_0x1e2b96);_0x516fd['push']({'pos':_0xc4b956,'text':_0x6184fc});}const _0x524760=new Array(_0x4c0e80)[_0x1680d9(0x1b0)]('\x20');let _0x39a50a=-0x1;for(const {pos:_0x513028,text:_0x368d22}of _0x516fd){let _0x2c1579=Math['max'](0x0,_0x513028-Math[_0x1680d9(0x184)](_0x368d22['length']/0x2));_0x2c1579<=_0x39a50a+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x2c1579=_0x39a50a+TIMELINE_CONFIG[_0x1680d9(0x186)]+0x1);_0x2c1579+_0x368d22[_0x1680d9(0x288)]>_0x4c0e80&&(_0x2c1579=_0x4c0e80-_0x368d22[_0x1680d9(0x288)]);if(_0x2c1579>=0x0&&_0x2c1579+_0x368d22[_0x1680d9(0x288)]<=_0x4c0e80&&_0x2c1579>_0x39a50a){for(let _0x2b451f=0x0;_0x2b451f<_0x368d22[_0x1680d9(0x288)];_0x2b451f++){_0x524760[_0x2c1579+_0x2b451f]=_0x368d22[_0x2b451f];}_0x39a50a=_0x2c1579+_0x368d22[_0x1680d9(0x288)]-0x1;}}return _0x524760[_0x1680d9(0xe8)]('');}function renderTaskRow(_0x376379,_0x225967,_0xe9f4b1,_0x5a63d6){const _0x20f9ff=a39_0xf0f359,{level:_0x57a8c4,name:_0x1091ce}=parseTaskName(_0x376379[_0x20f9ff(0x1c0)]),_0x4e6a38='\x20'['repeat'](_0x57a8c4),_0x1b5403=_0x376379[_0x20f9ff(0x1ee)]?'('+formatElapsed(_0x376379[_0x20f9ff(0x1ee)][_0x20f9ff(0x1e5)])+')':'',_0x478623=stringWidth(_0x1b5403),_0x2566f5=_0x57a8c4*0x1,_0x945971=_0x5a63d6-_0x2566f5-_0x478623-0x1,_0x4c199c=truncateTaskName(_0x1091ce,_0x945971),_0x26f7aa=_0x4e6a38+_0x4c199c,_0x4f6a88=stringWidth(_0x26f7aa),_0x305496=_0x5a63d6-_0x4f6a88-_0x478623,_0x1d952f=_0x26f7aa+'\x20'[_0x20f9ff(0x226)](Math['max'](0x1,_0x305496))+a39_0x37d687['dim'](_0x1b5403),_0x20ef95=getTaskStateIcon(_0x376379[_0x20f9ff(0x1a5)]),_0x32862c=new Array(_0xe9f4b1)[_0x20f9ff(0x1b0)]('\x20');if(_0x376379['window']){const _0x4b30ac=timeToPosition(_0x376379[_0x20f9ff(0x1ee)]['start'],_0x225967,_0xe9f4b1),_0x3ddcee=timeToPosition(_0x376379[_0x20f9ff(0x1ee)][_0x20f9ff(0x25b)],_0x225967,_0xe9f4b1),_0x132b75=getBarChar(_0x376379[_0x20f9ff(0x1a5)]),_0x4311db=Math[_0x20f9ff(0x105)](_0x4b30ac+0x1,_0x3ddcee);for(let _0x1babe9=_0x4b30ac;_0x1babe9<Math[_0x20f9ff(0x259)](_0x4311db,_0xe9f4b1);_0x1babe9++){_0x32862c[_0x1babe9]=_0x132b75;}}const _0x341590=getBarColor(_0x376379['state']),_0x40636c=_0x32862c[_0x20f9ff(0x27d)](_0x3dd9e1=>_0x3dd9e1==='\x20'?'\x20':_0x341590(_0x3dd9e1))['join']('');return _0x20ef95+'\x20'+_0x1d952f+'│'+_0x40636c+'│';}function calculateStats(_0x31ab49){const _0xd32afc=a39_0xf0f359,_0x38b382={'total':_0x31ab49[_0xd32afc(0x288)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x17dd61 of _0x31ab49){if(_0x17dd61[_0xd32afc(0x1a5)]===_0xd32afc(0x153))_0x38b382[_0xd32afc(0x153)]++;else{if(_0x17dd61['state']===_0xd32afc(0x1b6)||_0x17dd61[_0xd32afc(0x1a5)]==='group_error')_0x38b382[_0xd32afc(0x1b6)]++;else _0x17dd61[_0xd32afc(0x1a5)]===_0xd32afc(0x1d3)?_0x38b382[_0xd32afc(0x1d3)]++:_0x38b382['pending']++;}}return _0x38b382;}function formatStats(_0x37a73d){const _0x52f549=a39_0xf0f359;return[_0x52f549(0x23f)+_0x37a73d[_0x52f549(0x134)],'✅\x20'+_0x37a73d[_0x52f549(0x153)],'❌\x20'+_0x37a73d[_0x52f549(0x1b6)],_0x52f549(0x20d)+_0x37a73d[_0x52f549(0x1d3)],'⏳\x20'+_0x37a73d[_0x52f549(0x16f)]][_0x52f549(0xe8)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0x210);['description']=a39_0xf0f359(0x222);async[a39_0xf0f359(0x246)](_0xb8fc60){const _0x148c16=a39_0xf0f359,{options:_0x39c69e,args:_0x2f9a6c,tdx:_0x39de4e}=_0xb8fc60;let _0x4af9f1,_0x40b410,_0x46115b=![];if(_0x2f9a6c[0x0]){if(_0x2f9a6c[0x0][_0x148c16(0x276)]('.')){const _0xad437=this[_0x148c16(0x241)](_0x2f9a6c,_0x39c69e);if(!_0xad437)return 0x1;_0x4af9f1=_0xad437['projectName'],_0x40b410=_0xad437[_0x148c16(0x1ce)];}else{_0x40b410=_0x2f9a6c[0x0],_0x4af9f1=_0x39c69e[_0x148c16(0x287)];if(!_0x4af9f1)return console[_0x148c16(0x1b6)](a39_0x37d687[_0x148c16(0x224)](_0x148c16(0x264)),_0x148c16(0x1c3)),0x1;_0x46115b=!![];}}else{const _0x1fab33=this[_0x148c16(0x241)](_0x2f9a6c,_0x39c69e);if(!_0x1fab33)return 0x1;_0x4af9f1=_0x1fab33[_0x148c16(0x18f)],_0x40b410=_0x1fab33[_0x148c16(0x1ce)];}if(_0x39c69e[_0x148c16(0x215)]){if(_0x4af9f1&&_0x40b410)console[_0x148c16(0x1b6)](_0x148c16(0x1c8)+_0x4af9f1+'.'+_0x40b410);else _0x4af9f1&&console[_0x148c16(0x1b6)](_0x148c16(0x1ec)+_0x4af9f1);}const _0xf3e16f=_0x39c69e['attemptId'],_0x43bb18=_0x39c69e[_0x148c16(0x176)];if(_0xf3e16f){_0x43bb18&&console[_0x148c16(0x1b6)](a39_0x37d687['yellow'](_0x148c16(0x196)),_0x148c16(0x147));const _0x56a68d=_0x39c69e[_0x148c16(0x229)];return _0x56a68d?await this[_0x148c16(0xfb)](_0xb8fc60,_0xf3e16f):await this[_0x148c16(0x239)](_0xb8fc60,_0xf3e16f,_0x39c69e),0x0;}if(_0x43bb18){const _0x1265d5=await withSpinner(_0x148c16(0x250),()=>_0x39de4e[_0x148c16(0x262)][_0x148c16(0x146)]({'projectName':_0x4af9f1,'workflowName':_0x40b410,'limit':0x64}),{'verbose':_0x39c69e[_0x148c16(0x215)]}),_0x2f639f=_0x1265d5[_0x148c16(0x230)][_0x148c16(0x156)](_0x100566=>_0x100566['id']===_0x43bb18);if(!_0x2f639f)return console['error'](a39_0x37d687[_0x148c16(0x224)](_0x148c16(0x264)),'Session\x20not\x20found:\x20'+_0x43bb18),0x1;if(!_0x2f639f[_0x148c16(0x1e7)]?.['id'])return console['error'](a39_0x37d687[_0x148c16(0x224)](_0x148c16(0x264)),_0x148c16(0xf8)+_0x43bb18+_0x148c16(0x136)),0x1;const _0x32e2d8=_0x2f639f[_0x148c16(0x1e7)]['id'];_0x39c69e['verbose']&&console[_0x148c16(0x1b6)]('Using\x20attempt\x20'+_0x32e2d8+_0x148c16(0x15b)+_0x43bb18);const _0x361e96=_0x39c69e[_0x148c16(0x229)];return _0x361e96?await this[_0x148c16(0xfb)](_0xb8fc60,_0x32e2d8):await this['renderSingleTimeline'](_0xb8fc60,_0x32e2d8,_0x39c69e),0x0;}const _0x3856d5=await withSpinner('Loading\x20sessions...',()=>_0x39de4e['workflow'][_0x148c16(0x146)]({'projectName':_0x4af9f1,'workflowName':_0x40b410,'limit':_0x39c69e[_0x148c16(0x27f)]||0x32}),{'verbose':_0x39c69e['verbose']}),_0x533a6a=_0x3856d5[_0x148c16(0x230)];if(_0x533a6a[_0x148c16(0x288)]===0x0){if(_0x4af9f1&&_0x40b410)console[_0x148c16(0x1b6)](_0x148c16(0xfd)+_0x4af9f1+'.'+_0x40b410);else _0x4af9f1?console[_0x148c16(0x1b6)](_0x148c16(0x26e)+_0x4af9f1):(console[_0x148c16(0x1b6)](_0x148c16(0x244)),console[_0x148c16(0x1b6)](a39_0x37d687[_0x148c16(0x145)]('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x533a6a[_0x148c16(0x148)]((_0x29d7a0,_0x4e1021)=>{const _0x2806c9=_0x148c16,_0x25cc22=_0x29d7a0[_0x2806c9(0x22e)]||'',_0x18a7ed=_0x4e1021[_0x2806c9(0x22e)]||'';return _0x18a7ed[_0x2806c9(0x1c6)](_0x25cc22);});if(_0x39c69e[_0x148c16(0x158)]||_0x39c69e[_0x148c16(0x129)])return await handleSDKOutput(_0x533a6a,_0x39c69e),0x0;let _0x3f0563;if(_0x46115b){const _0x3a9da7=_0x533a6a[0x0];if(!_0x3a9da7[_0x148c16(0x1e7)]?.['id'])return console[_0x148c16(0x1b6)](_0x148c16(0x18a)),0x0;_0x3f0563=_0x3a9da7[_0x148c16(0x1e7)]['id'],_0x39c69e['verbose']&&console[_0x148c16(0x1b6)](_0x148c16(0x19b)+_0x3a9da7[_0x148c16(0x22e)]);}else{const _0x3bdbe9=_0x533a6a[_0x148c16(0x27d)](_0x4cf47d=>{const _0x5a0976=_0x148c16,_0x1acf31=getAttemptStatusDisplay(_0x4cf47d[_0x5a0976(0x1e7)]);return{'title':_0x4cf47d[_0x5a0976(0x164)]?.[_0x5a0976(0x1c0)]+'.'+_0x4cf47d[_0x5a0976(0x262)]?.[_0x5a0976(0x1c0)]+_0x5a0976(0x24c)+_0x4cf47d[_0x5a0976(0x22e)]+'\x20'+_0x1acf31[_0x5a0976(0xef)],'value':_0x4cf47d[_0x5a0976(0x1e7)]?.['id']||'','description':_0x1acf31[_0x5a0976(0x17a)]};}),_0x48b7f2=await a39_0xe7a3e1({'type':_0x148c16(0x16b),'name':_0x148c16(0x24b),'message':_0x148c16(0x11d),'choices':_0x3bdbe9[_0x148c16(0x1d4)](_0x1a88b7=>_0x1a88b7[_0x148c16(0xee)]!=='')});if(!_0x48b7f2[_0x148c16(0x24b)])return 0x0;_0x3f0563=_0x48b7f2[_0x148c16(0x24b)];}const _0x576767=_0x39c69e['follow'];return _0x576767?await this[_0x148c16(0xfb)](_0xb8fc60,_0x3f0563):await this[_0x148c16(0x239)](_0xb8fc60,_0x3f0563,_0x39c69e),0x0;}async[a39_0xf0f359(0x239)](_0x219b4b,_0x3c675f,_0x51fd8a){const _0x3f65b8=a39_0xf0f359,{tdx:_0x576bf5}=_0x219b4b;let _0x26f5d2,_0xf84ab0;try{[_0x26f5d2,_0xf84ab0]=await Promise[_0x3f65b8(0x211)]([_0x576bf5['workflow']['attempt'](_0x3c675f),_0x576bf5[_0x3f65b8(0x262)][_0x3f65b8(0x100)](_0x3c675f,![])]);}catch(_0x45c671){console[_0x3f65b8(0x1b6)](a39_0x37d687[_0x3f65b8(0x224)](_0x3f65b8(0x112)));_0x51fd8a['verbose']&&console[_0x3f65b8(0x1b6)](_0x45c671);throw _0x45c671;}if(_0x51fd8a['json']||_0x51fd8a[_0x3f65b8(0x129)]){const _0x1b0b34=this['buildTimelineData'](_0x26f5d2,_0xf84ab0);await handleSDKOutput([_0x1b0b34],_0x51fd8a);return;}const _0x34ed31=_0x576bf5[_0x3f65b8(0xe6)]['site'],_0x5df9e2=this[_0x3f65b8(0xec)](_0x26f5d2,_0xf84ab0,_0x34ed31);console[_0x3f65b8(0x1c7)](_0x5df9e2);}async[a39_0xf0f359(0xfb)](_0x34944e,_0x553d40){const _0x16474b=a39_0xf0f359,{tdx:_0x6b3253}=_0x34944e,_0xbcfadd=TIMELINE_CONFIG[_0x16474b(0xe4)],_0x382d33=TIMELINE_CONFIG[_0x16474b(0x212)];let _0x46bc2f=0x0;while(_0x46bc2f<_0x382d33){process[_0x16474b(0x165)][_0x16474b(0x273)]&&process[_0x16474b(0x165)]['write']('\x1bc');let _0x3274c1,_0x4036f2;try{[_0x3274c1,_0x4036f2]=await Promise[_0x16474b(0x211)]([_0x6b3253[_0x16474b(0x262)][_0x16474b(0x170)](_0x553d40),_0x6b3253['workflow'][_0x16474b(0x100)](_0x553d40,![])]);}catch(_0x17dd81){console[_0x16474b(0x1b6)](a39_0x37d687[_0x16474b(0x224)](_0x16474b(0x1d7)));_0x46bc2f>0x0&&console[_0x16474b(0x1b6)](a39_0x37d687[_0x16474b(0x145)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x46bc2f));throw _0x17dd81;}const _0x538535=_0x6b3253[_0x16474b(0xe6)][_0x16474b(0x233)],_0x155190=this[_0x16474b(0xec)](_0x3274c1,_0x4036f2,_0x538535);console[_0x16474b(0x1c7)](_0x155190);const _0x3b0f17=_0x3274c1[_0x16474b(0x1fc)]&&_0x4036f2[_0x16474b(0xfe)](_0x4f615f=>_0x4f615f['state']!==_0x16474b(0x1d3)&&_0x4f615f[_0x16474b(0x1a5)]!==_0x16474b(0x19f));if(_0x3b0f17){console[_0x16474b(0x1b6)](a39_0x37d687[_0x16474b(0x10b)](_0x16474b(0x1e3)));break;}console[_0x16474b(0x1b6)](a39_0x37d687[_0x16474b(0x145)](_0x16474b(0xf7)+_0x46bc2f*0x2+_0x16474b(0x19d))),await new Promise(_0x4561b5=>setTimeout(_0x4561b5,_0xbcfadd)),_0x46bc2f++;}_0x46bc2f>=_0x382d33&&console['error'](a39_0x37d687[_0x16474b(0x1fd)](_0x16474b(0x108)));}[a39_0xf0f359(0xec)](_0x50535b,_0x3117d1,_0x1237a8){const _0x359fce=a39_0xf0f359,_0x205f29=[],_0x540444=TIMELINE_CONFIG[_0x359fce(0x188)],_0x2b6778=0x5,_0xa0696=process[_0x359fce(0x165)][_0x359fce(0x249)]||0x78,_0x4846da=_0xa0696-_0x540444-_0x2b6778,_0x37273b=Math[_0x359fce(0x105)](TIMELINE_CONFIG[_0x359fce(0x22f)],Math[_0x359fce(0x259)](_0x4846da,TIMELINE_CONFIG[_0x359fce(0x194)])),_0xb1d6f0=new Date(_0x50535b['createdAt'])[_0x359fce(0xf9)](),_0x2d007c=_0x50535b[_0x359fce(0x17c)]?new Date(_0x50535b[_0x359fce(0x17c)])[_0x359fce(0xf9)]():Date['now'](),_0x44d5cb={'start':_0xb1d6f0,'end':_0x2d007c,'duration':_0x2d007c-_0xb1d6f0},_0x145563=new Map(),_0x118f58=[];for(const _0x33b083 of _0x3117d1){if(_0x33b083[_0x359fce(0xeb)]){const _0x2febdc=new Date(_0x33b083[_0x359fce(0xeb)])[_0x359fce(0xf9)](),_0x4ecacc=_0x33b083[_0x359fce(0x263)]?new Date(_0x33b083[_0x359fce(0x263)])[_0x359fce(0xf9)]():Date[_0x359fce(0x203)](),_0x353c3b={'start':_0x2febdc,'end':_0x4ecacc,'duration':_0x4ecacc-_0x2febdc};_0x145563[_0x359fce(0xf6)](_0x33b083['id'],_0x353c3b),_0x118f58['push']({'name':_0x33b083[_0x359fce(0x154)],'state':_0x33b083[_0x359fce(0x1a5)]||_0x359fce(0x182),'window':_0x353c3b});}else _0x118f58[_0x359fce(0x1ca)]({'name':_0x33b083[_0x359fce(0x154)],'state':_0x33b083[_0x359fce(0x1a5)]||_0x359fce(0x19f),'window':undefined});}_0x118f58[_0x359fce(0x148)]((_0x125770,_0x4b9807)=>{const _0x13c323=_0x359fce;if(!_0x125770[_0x13c323(0x1ee)])return 0x1;if(!_0x4b9807['window'])return-0x1;return _0x125770[_0x13c323(0x1ee)][_0x13c323(0x221)]-_0x4b9807['window']['start'];});const _0x29159c=_0x118f58[_0x359fce(0x288)],_0x20403f=_0x29159c>TIMELINE_CONFIG[_0x359fce(0x1a8)];_0x20403f&&_0x118f58[_0x359fce(0x1aa)](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x395453=calculateTimeScale(_0x44d5cb,_0x37273b),_0x55ca40=_0x50535b[_0x359fce(0x1fc)]?_0x50535b[_0x359fce(0x153)]?a39_0x37d687[_0x359fce(0x10b)](_0x359fce(0x153)):a39_0x37d687['red']('error'):a39_0x37d687[_0x359fce(0x1e4)](_0x359fce(0x1d3)),_0x51a9c3=_0x50535b[_0x359fce(0x164)]?.['id'],_0x308769=_0x50535b[_0x359fce(0x176)];let _0xf69f81;if(_0x51a9c3&&_0x308769){const _0x6806c=getWorkflowAttemptUrl(_0x1237a8,_0x51a9c3,_0x308769,_0x50535b['id']);_0xf69f81=hyperlink(a39_0x37d687[_0x359fce(0x145)](_0x50535b['id']),_0x6806c);}else _0xf69f81=a39_0x37d687[_0x359fce(0x145)](_0x50535b['id']);_0x205f29[_0x359fce(0x1ca)](_0x359fce(0x152)+_0xf69f81+_0x359fce(0x24c)+_0x55ca40+'\x20-\x20'+formatElapsed(_0x44d5cb[_0x359fce(0x1e5)]));if(_0x118f58[_0x359fce(0x288)]>0x0){const _0x108c96=renderTimeAxis(_0x395453,_0x37273b),_0x23e0ce=new Date(_0x44d5cb[_0x359fce(0x221)]),_0x4ed694=formatDate(_0x23e0ce),_0xe1a28b=TIMELINE_CONFIG[_0x359fce(0x177)]+TIMELINE_CONFIG[_0x359fce(0x183)]+_0x540444,_0x195baf=_0x4ed694[_0x359fce(0x280)](_0xe1a28b),_0x58cf7a=a39_0x37d687[_0x359fce(0x145)](_0x195baf);_0x205f29['push'](_0x58cf7a+'\x20'+_0x108c96);for(const _0x537fde of _0x118f58){_0x205f29[_0x359fce(0x1ca)](renderTaskRow(_0x537fde,_0x395453,_0x37273b,_0x540444));}const _0x4f5ba1=calculateStats(_0x118f58);_0x205f29[_0x359fce(0x1ca)](formatStats(_0x4f5ba1)),_0x20403f&&_0x205f29[_0x359fce(0x1ca)](a39_0x37d687[_0x359fce(0x1fd)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0x359fce(0x1a8)]+_0x359fce(0x1a2)+_0x29159c+_0x359fce(0x21e))),_0x205f29['push'](''),_0x205f29[_0x359fce(0x1ca)](a39_0x37d687[_0x359fce(0x145)](_0x359fce(0x166))+('tdx\x20wf\x20attempt\x20'+_0x50535b['id']+_0x359fce(0x15d))+a39_0x37d687['dim']('\x20to\x20see\x20detailed\x20logs'));}else _0x205f29[_0x359fce(0x1ca)]('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x205f29[_0x359fce(0xe8)]('\x0a');}['buildTimelineData'](_0x1d8834,_0x4fd744){const _0x54140a=a39_0xf0f359,_0x23ecf2=new Date(_0x1d8834[_0x54140a(0x279)])[_0x54140a(0xf9)](),_0x117d5d=_0x1d8834['finishedAt']?new Date(_0x1d8834[_0x54140a(0x17c)])[_0x54140a(0xf9)]():Date[_0x54140a(0x203)](),_0x25ef52=_0x117d5d-_0x23ecf2,_0x3b5070=[];for(const _0x4e5598 of _0x4fd744){if(_0x4e5598[_0x54140a(0xeb)]){const _0x84f53f=new Date(_0x4e5598[_0x54140a(0xeb)])['getTime'](),_0x393483=_0x4e5598['updatedAt']?new Date(_0x4e5598['updatedAt'])[_0x54140a(0xf9)]():Date[_0x54140a(0x203)]();_0x3b5070[_0x54140a(0x1ca)]({'name':_0x4e5598[_0x54140a(0x154)],'state':_0x4e5598[_0x54140a(0x1a5)]||_0x54140a(0x182),'window':{'start':_0x84f53f,'end':_0x393483,'duration':_0x393483-_0x84f53f}});}else _0x3b5070[_0x54140a(0x1ca)]({'name':_0x4e5598[_0x54140a(0x154)],'state':_0x4e5598[_0x54140a(0x1a5)]||_0x54140a(0x19f),'window':undefined});}const _0x448b5b=calculateStats(_0x3b5070);return{'attempt':{'id':_0x1d8834['id'],'status':_0x1d8834[_0x54140a(0x1fc)]?_0x1d8834[_0x54140a(0x153)]?'success':_0x54140a(0x1b6):_0x54140a(0x1d3),'createdAt':_0x1d8834[_0x54140a(0x279)],'finishedAt':_0x1d8834[_0x54140a(0x17c)],'duration_ms':_0x25ef52},'tasks':_0x3b5070['map'](_0x2b1f01=>({'name':_0x2b1f01[_0x54140a(0x1c0)],'state':_0x2b1f01[_0x54140a(0x1a5)],'startedAt':_0x2b1f01[_0x54140a(0x1ee)]?new Date(_0x2b1f01[_0x54140a(0x1ee)][_0x54140a(0x221)])['toISOString']():null,'updatedAt':_0x2b1f01[_0x54140a(0x1ee)]?new Date(_0x2b1f01['window'][_0x54140a(0x25b)])[_0x54140a(0x1ae)]():null,'duration_ms':_0x2b1f01[_0x54140a(0x1ee)]?.[_0x54140a(0x1e5)]||null})),'stats':_0x448b5b};}}
|
|
1
|
+
const a39_0x1430a8=a39_0x26ab;(function(_0x520cf9,_0x5cbe24){const _0x7fc14c=a39_0x26ab,_0x242aaa=_0x520cf9();while(!![]){try{const _0x5f2599=parseInt(_0x7fc14c(0x228))/0x1+-parseInt(_0x7fc14c(0x1f2))/0x2*(-parseInt(_0x7fc14c(0x1e4))/0x3)+parseInt(_0x7fc14c(0x229))/0x4+parseInt(_0x7fc14c(0x26f))/0x5+-parseInt(_0x7fc14c(0x12b))/0x6+-parseInt(_0x7fc14c(0x17e))/0x7+parseInt(_0x7fc14c(0x1f1))/0x8;if(_0x5f2599===_0x5cbe24)break;else _0x242aaa['push'](_0x242aaa['shift']());}catch(_0x3aa9e5){_0x242aaa['push'](_0x242aaa['shift']());}}}(a39_0xf564,0x2160e));import a39_0x5e8019 from'chalk';import{existsSync}from'fs';import a39_0x281c60 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 a39_0x269b13 from'prompts';function getAttemptStatusDisplay(_0x299cfc){const _0x28348e=a39_0x26ab;if(!_0x299cfc)return{'icon':'⏳','text':''};const {done:_0x4d928f,success:_0x69ad04,cancelRequested:_0x4c4c55}=_0x299cfc;if(!_0x4d928f)return _0x4c4c55?{'icon':'🛑','text':a39_0x5e8019[_0x28348e(0x116)](_0x28348e(0x230))}:{'icon':'🔄','text':a39_0x5e8019['blue'](_0x28348e(0x1ed))};if(_0x69ad04)return{'icon':'✅','text':a39_0x5e8019['green'](_0x28348e(0x21b))};return{'icon':'❌','text':a39_0x5e8019[_0x28348e(0x16d)](_0x28348e(0x19b))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x2aabb7,_0x40cc92,_0x4f8041=0x0){const _0x2a0e5b=a39_0x26ab;return _0x2aabb7[_0x4f8041]||_0x40cc92[_0x2a0e5b(0x1e3)];}[a39_0x1430a8(0x24b)](_0x194f9d,_0x11a9ef,_0x48db13=0x0){const _0x20412b=a39_0x1430a8,_0x470d5f=this['resolveProject'](_0x194f9d,_0x11a9ef,_0x48db13);if(!_0x470d5f)return console['error'](a39_0x5e8019[_0x20412b(0x16d)]('Error:'),_0x20412b(0x139)),console['error'](a39_0x5e8019[_0x20412b(0x20a)](_0x20412b(0x23e))),null;return _0x470d5f;}[a39_0x1430a8(0x12d)](_0x1a8094,_0x1a0e0c){const _0x56232=a39_0x1430a8;if(_0x1a8094[0x0]){const _0x5c0d3=_0x1a8094[0x0][_0x56232(0x28a)]('.');if(_0x5c0d3[_0x56232(0x124)]===0x1)return{'projectName':_0x5c0d3[0x0],'workflowName':undefined};else return _0x5c0d3['length']===0x2?{'projectName':_0x5c0d3[0x0],'workflowName':_0x5c0d3[0x1]}:(console[_0x56232(0x19b)](a39_0x5e8019[_0x56232(0x16d)](_0x56232(0x13a)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x1a0e0c[_0x56232(0x1e3)],'workflowName':undefined};}['resolveProjectDir'](_0x2766bb,_0x3ec696,_0x3df0f7=0x0){const _0x1380a9=a39_0x1430a8;if(_0x2766bb[_0x3df0f7])return _0x2766bb[_0x3df0f7];if(_0x3ec696[_0x1380a9(0x1e3)]){const _0xce1557=a39_0x281c60[_0x1380a9(0x164)](process[_0x1380a9(0x1d5)](),_0x1380a9(0x150),_0x3ec696[_0x1380a9(0x1e3)]);if(existsSync(a39_0x281c60[_0x1380a9(0x164)](_0xce1557,'tdx.json')))return _0xce1557;}return undefined;}async['showWorkflowConsoleUrl'](_0x10226e,_0x1ab199,_0xbb5230){const _0xc0ce3a=a39_0x1430a8;try{const _0x515dbd=await _0x10226e[_0xc0ce3a(0x16c)][_0xc0ce3a(0x150)](_0x1ab199,{'limit':0x1});if(_0x515dbd[_0xc0ce3a(0x124)]>0x0){const _0x2dd026=_0x515dbd[0x0]['id'],_0x37c259=getWorkflowUrl(_0xbb5230,_0x2dd026);console[_0xc0ce3a(0x19b)]('\x20\x20Console:\x20'+a39_0x5e8019[_0xc0ce3a(0x176)](_0x37c259));}}catch{}}}function a39_0xf564(){const _0x715022=['\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','site','Select\x20a\x20workflow\x20to\x20run','execute','Expected\x20format:\x20--param\x20key=value','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','workflow:attempts','\x20to\x20see\x20detailed\x20logs','Analyzing\x20changes...','LABEL_WIDTH_DIVISOR','resolveProjectDir','basename','keys','💡\x20Tip:\x20Use\x20','substring','updatedAt','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','✔\x20Project\x20updated','Listing\x20secrets...','existingProjectId','Error:\x20Attempt\x20ID\x20is\x20required','cwd','No\x20sessions\x20with\x20timing\x20information','Key:\x20','session:','slice','columns','autocomplete','executeCloneProject','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','Attempt:\x20','project','Deleting\x20secret...','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','\x20\x20Session\x20ID:\x20','workflowProject','4863IXIBpG','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','max','name','Session\x20','setSecret','\x0aUpdate\x20existing\x20project\x20\x22','Pulling\x20project\x20','Failed\x20to\x20fetch\x20attempt\x20data','running','Target:\x20','No\x20log\x20content\x20found','summary','150584pAntLv','14EQAweH','\x20of\x20','GUTTER','Getting\x20attempt\x20details...','Loading\x20sessions...','\x20\x20Attempt\x20ID:\x20','sourceProjectName','workflowName','sys','\x20task','\x22\x20to\x20new\x20project\x20\x22','\x20unchanged','group_error','has','(use\x20--limit\x20to\x20see\x20more)','limit','Total:\x20','Error:\x20Invalid\x20JSON\x20in\x20--params','push','task','workflow:projects','ICON_WIDTH','Error:\x20Secret\x20key\x20is\x20required','workflow:tasks','dim','\x20\x20Location:\x20','unchanged','follow','renderSingleTimeline','relative','padStart','fullName','renderSessionsTimeline','diff','\x20\x20New\x20attempt\x20ID:\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','workflow:secrets:set','\x20attempt','log','verbose','getMonth','success','resolveProject','workflow:upload','write','stdout','parse','workflow:use','\x20\x20Project\x20ID:\x20','startTime','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','includeSubtasks','\x20\x20tdx\x20wf\x20use\x20<project>','download','100276XgieOo','853468VNzVcJ','No\x20workflows\x20found','all','session','List\x20workflow\x20execution\x20sessions','getHours','sessions','canceling','Kill\x20a\x20running\x20attempt','type','MIN_TIMELINE_WIDTH','\x0a✔\x20No\x20changes\x20to\x20push','🔄\x20','context','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','workflow:clone','Pattern:\x20','\x20\x20Files\x20extracted:\x20','Parameters:\x20','retrySession','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','fill','Filter:\x20','Listing\x20workflow\x20projects...','Invalid\x20format:\x20','Attempt\x20ID:\x20','get','msPerChar','state','\x0aDry\x20run\x20-\x20no\x20project\x20created','Dry\x20run:\x20yes','readFile','Include\x20retried:\x20yes','requireProject','fromTask','✔\x20Push\x20complete','\x20sessions\x20','\x20logs','end','/sessions/','Params:\x20','lastAttempt','✔\x20Clone\x20complete','showWorkflowConsoleUrl','buildTimelineData','Writing\x20files...','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','POLL_INTERVAL_MS','Show\x20tasks\x20for\x20an\x20attempt','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','Error:\x20KEY=VALUE\x20is\x20required','blue','attempt','resolve','every','✔\x20New\x20project:\x20','size','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','createdAt','map','splice','table','jsonl','hasChanges','✔\x20Found\x20','.\x20Expected\x20format:\x20KEY=VALUE','navigateSessionsInteractive','dryRun','replace','1332600WCLefn','tdx\x20wf\x20attempt\x20','(unknown)','No\x20attempts\x20found\x20in\x20project:\x20','MAX_POLL_ITERATIONS','\x20modified','pullProject','pending','Project\x20directory:\x20','value','\x20\x20Changes:\x20','preparePushProject','workflow:pull','Session\x20time:\x20','📁\x20','Error:\x20Project\x20name\x20is\x20required','toLowerCase','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','targetExists','json','TASK_NAME_WIDTH','message','✔\x20Pushed\x20','\x20session','filter','prepareCloneProject','...','split','\x20-\x20','getTime','Error:\x20Invalid\x20parameter\x20format:\x20','workflow:logs','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Files\x20to\x20upload:\x20','Select\x20a\x20session\x20to\x20view\x20timeline:','workflow:retry','Error:\x20','metadata','isTTY','sessionTime','indexOf','deleted','No\x20matching\x20sessions\x20found','Downloading\x20project\x20','Session\x20not\x20found:\x20','\x0a✔\x20Attempt\x20complete','status','revision','getMinutes','text','\x20\x20Revision:\x20','sessionId','\x20\x20Session\x20context\x20set\x20to:\x20','index','Source\x20directory:\x20','green','round','match','Analyzing\x20project...','No\x20sessions\x20found\x20in\x20project:\x20','yes','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','Project\x20name:\x20','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Downloading\x20logs...','yellow','from','Key\x20cannot\x20be\x20empty','finishedAt','utf-8','output','\x0a⚠\x20Project\x20\x22','\x0aDry\x20run\x20-\x20nothing\x20pushed','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','floor','Usage:\x20workflow:delete\x20<project-name-or-id>','list','Resume\x20from:\x20','some','length','workflow:run','fileSize','delete','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','\x20deleted','✔\x20Project:\x20','1281246WaVvZo','changes','parseProjectWorkflowPattern','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','\x27\x20from\x20project\x20\x27','projectName','📋\x20','\x0a✔\x20Already\x20up\x20to\x20date','\x20\x20Source:\x20','✔\x20Pull\x20complete','Start\x20a\x20workflow\x20run','Source\x20project:\x20','new','Pushing\x20project...','Project\x20name\x20is\x20required','Error:','tasks','Retrying\x20session...','Status:\x20','✔\x20Workflow\x20project\x20context\x20cleared.','\x20has\x20no\x20attempts','---\x20','Revision:\x20','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','unknown','Getting\x20attempt\x20tasks...','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','applyPullProject','getFullYear','targetDir','newProjectName','Warning:','✔\x20Retry\x20started','Select\x20a\x20task\x20to\x20view\x20logs:','select','Tip:\x20cd\x20to\x20workflows/','\x0aApply\x20these\x20changes?','workflows','duration','Starting\x20workflow\x20run...','\x27...','Cancelled','generateSessionTimelineRows','Latest\x20session\x20has\x20no\x20attempt','planned','\x22?\x20This\x20cannot\x20be\x20undone.','✔\x20Secret\x20\x27','Show\x20logs\x20for\x20a\x20workflow\x20attempt','\x0aDry\x20run\x20-\x20no\x20files\x20written','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','key','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','start','find','Retry\x20a\x20session\x20or\x20attempt','resumeFrom','Listing\x20workflows...','join','startsWith','now','includes','cancelRequested','attemptId','Pull\x20workflow\x20project\x20to\x20local\x20folder','✔\x20Deleted\x20project\x20','workflow','red','workflow:kill','skipValidation','pollTimeline','\x20new','params','Deleting\x20project\x20','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Listing\x20workflow\x20attempts...','cyan','set','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','projectId','Target\x20directory:\x20','ICON_SPACING','Task\x20name:\x20','description','1820518IAHdyU','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','format','executePushProject','sourceDir','white','\x20(use\x20--limit\x20to\x20show\x20more)','Including\x20subtasks:\x20yes','reason','No\x20sessions\x20found\x20for:\x20','Output\x20directory:\x20','Validation:\x20skipped','New\x20project\x20name:\x20','Source:\x20','getDate','clear','Workflow:\x20','retryAttemptName','done','Listing\x20workflow\x20sessions...','No\x20workflow\x20projects\x20found','Source\x20directory\x20is\x20required','total','taskName','From\x20task:\x20','min','Cloning\x20to\x20','kill','localeCompare','error','modified','MAX_TASKS_DISPLAY','stringify','repeat','Project:\x20','toISOString','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','Loading\x20workflows...','run','\x20workflow','displayLine','window','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','data','workflow:delete','Loading\x20session...','/attempt/','sort','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Filter:\x20project=','attempt:','No\x20sessions\x20found','workflow:workflows','\x20secret','\x20project','Usage:\x20tdx\x20wf\x20use\x20<project>','durationMs','\x0aFailed\x20to\x20fetch\x20attempt\x20data','\x20is\x20not\x20a\x20directory','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','retryAttempt','Resolving\x20project\x20\x27','⚠\x20Showing\x20first\x20','startedAt','\x0aClone\x20\x22'];a39_0xf564=function(){return _0x715022;};return a39_0xf564();}export class WorkflowUseCommand extends BaseCommand{[a39_0x1430a8(0x1e7)]=a39_0x1430a8(0x221);[a39_0x1430a8(0x17d)]=a39_0x1430a8(0x17f);async[a39_0x1430a8(0x1c3)](_0x52a704){const _0x5e58bc=a39_0x1430a8,{options:_0x4d4ac4,args:_0x24ed6f,tdx:_0x23fdca}=_0x52a704,_0x256abb=_0x24ed6f[0x0],_0x18efdc=_0x4d4ac4[_0x5e58bc(0x18d)];if(_0x18efdc)return saveSessionContext({'workflow_project':undefined},_0x4d4ac4[_0x5e58bc(0x22c)]),console[_0x5e58bc(0x218)](a39_0x5e8019[_0x5e58bc(0x10c)](_0x5e58bc(0x13e))),0x0;if(!_0x256abb)return console[_0x5e58bc(0x19b)](a39_0x5e8019['red'](_0x5e58bc(0x13a)),_0x5e58bc(0x139)),console['error'](a39_0x5e8019[_0x5e58bc(0x20a)](_0x5e58bc(0x1b5))),console[_0x5e58bc(0x19b)](a39_0x5e8019['dim'](_0x5e58bc(0x28f))),0x1;const _0x28b5a0=await withSpinner(_0x5e58bc(0x1bb)+_0x256abb+_0x5e58bc(0x153),()=>_0x23fdca[_0x5e58bc(0x16c)]['resolveProjectId'](_0x256abb),{'verbose':_0x4d4ac4['verbose']}),{name:_0x2980f9}=_0x28b5a0[_0x5e58bc(0x1a9)];return saveSessionContext({'workflow_project':_0x2980f9},_0x4d4ac4[_0x5e58bc(0x22c)]),console[_0x5e58bc(0x218)](a39_0x5e8019['green']('✔\x20Workflow\x20project\x20set\x20to:\x20'+a39_0x5e8019[_0x5e58bc(0x176)](_0x2980f9))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a39_0x1430a8(0x1e7)]=a39_0x1430a8(0x206);[a39_0x1430a8(0x17d)]='List\x20all\x20workflow\x20projects';async[a39_0x1430a8(0x1c3)](_0x23863e){const _0xd9ecf5=a39_0x1430a8,{options:_0x29277e,args:_0x35bd22,tdx:_0x25509d}=_0x23863e,_0x219d1f=_0x35bd22[0x0];_0x29277e[_0xd9ecf5(0x219)]&&_0x219d1f&&console[_0xd9ecf5(0x19b)](_0xd9ecf5(0x23a)+_0x219d1f);const _0x4d086e=await withSpinner(_0xd9ecf5(0x241),()=>_0x25509d[_0xd9ecf5(0x16c)]['projects'](_0x219d1f,{'limit':_0x29277e[_0xd9ecf5(0x201)]}),{'verbose':_0x29277e[_0xd9ecf5(0x219)]});let _0xefd616=_0x4d086e['data'];_0xefd616[_0xd9ecf5(0x1ad)]((_0x1aa0ca,_0x169736)=>_0x1aa0ca[_0xd9ecf5(0x1e7)][_0xd9ecf5(0x19a)](_0x169736[_0xd9ecf5(0x1e7)]));const _0x4c39c8=_0x29277e[_0xd9ecf5(0x201)]||0x64,_0xf022ad=_0xefd616[_0xd9ecf5(0x124)]>=_0x4c39c8?a39_0x5e8019[_0xd9ecf5(0x20a)](_0xd9ecf5(0x184)):'';console[_0xd9ecf5(0x19b)](_0xd9ecf5(0x26a)+_0xefd616['length']+_0xd9ecf5(0x1b4)+(_0xefd616[_0xd9ecf5(0x124)]!==0x1?'s':'')+_0xf022ad);if(_0x29277e[_0xd9ecf5(0x180)]===_0xd9ecf5(0x282)||_0x29277e[_0xd9ecf5(0x180)]===_0xd9ecf5(0x268)||_0x29277e['format']===_0xd9ecf5(0x267))await handleSDKOutput(_0xefd616,_0x29277e);else{if(_0xefd616[_0xd9ecf5(0x124)]===0x0)_0x219d1f?console[_0xd9ecf5(0x218)]('No\x20projects\x20match\x20pattern:\x20'+_0x219d1f):console[_0xd9ecf5(0x218)](_0xd9ecf5(0x192));else{const _0x36809f=_0xefd616[_0xd9ecf5(0x265)](_0x5bb81b=>{const _0x5e01c2=_0xd9ecf5,_0xe20156=_0x5bb81b[_0x5e01c2(0xfa)]?.[_0x5e01c2(0x123)](_0x41113d=>_0x41113d[_0x5e01c2(0x15d)]===_0x5e01c2(0x1fa)),_0x211ad1=_0xe20156?a39_0x5e8019['dim']('\x20(system)'):'';return _0x5e01c2(0x27d)+_0x5bb81b[_0x5e01c2(0x1e7)]+_0x211ad1;});await writeOutput(_0x36809f['join']('\x0a'),_0x29277e[_0xd9ecf5(0x11b)],_0xd9ecf5(0x121));}}return 0x0;}}function a39_0x26ab(_0x3b2690,_0x198c27){_0x3b2690=_0x3b2690-0xfa;const _0xf564ca=a39_0xf564();let _0x26ab26=_0xf564ca[_0x3b2690];return _0x26ab26;}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a39_0x1430a8(0x1e7)]=a39_0x1430a8(0x1b2);[a39_0x1430a8(0x17d)]='List\x20workflows';async['execute'](_0x5cfbc3){const _0x21c56a=a39_0x1430a8,{options:_0x5e6322,args:_0x1c9a86,tdx:_0x17fcc4}=_0x5cfbc3,_0x2229ba=this[_0x21c56a(0x21c)](_0x1c9a86,_0x5e6322);_0x5e6322['verbose']&&_0x2229ba&&console['error']('Project\x20filter:\x20'+_0x2229ba);const _0x3da797=await withSpinner(_0x21c56a(0x163),()=>_0x17fcc4['workflow'][_0x21c56a(0x150)](_0x2229ba,{'limit':_0x5e6322[_0x21c56a(0x201)]}),{'verbose':_0x5e6322[_0x21c56a(0x219)]});let _0x51a2de=_0x3da797[_0x21c56a(0x1a9)];_0x51a2de[_0x21c56a(0x1ad)]((_0x4dce7b,_0x2bafaf)=>{const _0x32a74e=_0x21c56a,_0x233d92=_0x4dce7b[_0x32a74e(0x1e7)][_0x32a74e(0x19a)](_0x2bafaf[_0x32a74e(0x1e7)]);if(_0x233d92!==0x0)return _0x233d92;return(_0x4dce7b[_0x32a74e(0x1df)]?.[_0x32a74e(0x1e7)]||'')[_0x32a74e(0x19a)](_0x2bafaf[_0x32a74e(0x1df)]?.[_0x32a74e(0x1e7)]||'');});const _0x29b9ad=_0x5e6322[_0x21c56a(0x201)]||0x64,_0x3da489=_0x51a2de[_0x21c56a(0x124)]>=_0x29b9ad?a39_0x5e8019[_0x21c56a(0x20a)](_0x21c56a(0x184)):'';console[_0x21c56a(0x19b)](_0x21c56a(0x26a)+_0x51a2de[_0x21c56a(0x124)]+_0x21c56a(0x1a5)+(_0x51a2de['length']!==0x1?'s':'')+_0x3da489);if(_0x5e6322[_0x21c56a(0x180)]===_0x21c56a(0x282)||_0x5e6322['format']===_0x21c56a(0x268)||_0x5e6322[_0x21c56a(0x180)]===_0x21c56a(0x267))await handleSDKOutput(_0x51a2de,_0x5e6322);else{if(_0x51a2de[_0x21c56a(0x124)]===0x0)_0x2229ba?console['log']('No\x20workflows\x20found\x20in\x20project:\x20'+_0x2229ba):console[_0x21c56a(0x218)](_0x21c56a(0x22a));else{const _0x28d1b1=_0x5e6322[_0x21c56a(0x1c1)],_0x11e399=_0x51a2de['map'](_0xc30bf6=>{const _0x2b239e=_0x21c56a,_0x111e71=a39_0x5e8019[_0x2b239e(0x20a)]('#'+_0xc30bf6['id']),_0x19b0da=hyperlink(_0x111e71,getWorkflowUrl(_0x28d1b1,_0xc30bf6['id'])),_0x484c04=_0xc30bf6['project']?.[_0x2b239e(0x1e7)]?a39_0x5e8019[_0x2b239e(0x20a)]('\x20('+_0xc30bf6['project']['name']+')'):'';return _0x2b239e(0x131)+_0x19b0da+'\x20'+_0xc30bf6['name']+_0x484c04;});await writeOutput(_0x11e399['join']('\x0a'),_0x5e6322[_0x21c56a(0x11b)],_0x21c56a(0x121));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']='workflow:sessions';[a39_0x1430a8(0x17d)]=a39_0x1430a8(0x22d);async[a39_0x1430a8(0x1c3)](_0x47059f){const _0x24ba00=a39_0x1430a8,{options:_0x5b70f2,args:_0x45ea56,tdx:_0x4cbf6c}=_0x47059f,_0x4988b6=this[_0x24ba00(0x12d)](_0x45ea56,_0x5b70f2);if(!_0x4988b6)return 0x1;const {projectName:_0x22803b,workflowName:_0x23a558}=_0x4988b6;if(_0x5b70f2['verbose']){if(_0x22803b&&_0x23a558)console[_0x24ba00(0x19b)](_0x24ba00(0x240)+_0x22803b+'.'+_0x23a558);else _0x22803b&&console[_0x24ba00(0x19b)](_0x24ba00(0x1af)+_0x22803b);const _0x1ce263=_0x5b70f2[_0x24ba00(0x103)];_0x1ce263&&console[_0x24ba00(0x19b)](_0x24ba00(0x13d)+_0x1ce263);}let _0x476742=0x28;if(process[_0x24ba00(0x21f)]['isTTY']&&!_0x5b70f2['output']&&!_0x5b70f2[_0x24ba00(0x180)]){const _0x7169ee=process[_0x24ba00(0x21f)]['rows']||0x28;_0x476742=Math[_0x24ba00(0x1e6)](0x14,Math[_0x24ba00(0x11f)](_0x7169ee*0x2/0x3));}const _0x39fef2=_0x5b70f2[_0x24ba00(0x201)]||_0x476742,_0x332d0e=await withSpinner(_0x24ba00(0x191),()=>_0x4cbf6c[_0x24ba00(0x16c)]['sessions']({'projectName':_0x22803b,'workflowName':_0x23a558,'status':_0x5b70f2[_0x24ba00(0x103)],'fromTime':_0x5b70f2[_0x24ba00(0x117)],'toTime':_0x5b70f2['to'],'limit':_0x39fef2}),{'verbose':_0x5b70f2[_0x24ba00(0x219)]}),_0x1d6621=_0x332d0e[_0x24ba00(0x1a9)];_0x1d6621[_0x24ba00(0x1ad)]((_0x58592d,_0x3fa8bc)=>{const _0x1d2651=_0x24ba00,_0x29e7f6=_0x58592d[_0x1d2651(0xfc)]||'',_0x2dcb18=_0x3fa8bc[_0x1d2651(0xfc)]||'';return _0x2dcb18[_0x1d2651(0x19a)](_0x29e7f6);});_0x1d6621[_0x24ba00(0x124)]>=_0x39fef2?console['error']('✔\x20Showing\x20'+_0x1d6621[_0x24ba00(0x124)]+_0x24ba00(0x24e)+a39_0x5e8019[_0x24ba00(0x20a)](_0x24ba00(0x200))):console[_0x24ba00(0x19b)](_0x24ba00(0x26a)+_0x1d6621[_0x24ba00(0x124)]+_0x24ba00(0x286)+(_0x1d6621[_0x24ba00(0x124)]!==0x1?'s':''));if(_0x5b70f2[_0x24ba00(0x180)]===_0x24ba00(0x282)||_0x5b70f2[_0x24ba00(0x180)]===_0x24ba00(0x268)||_0x5b70f2[_0x24ba00(0x180)]==='table')await handleSDKOutput(_0x1d6621,_0x5b70f2);else{if(!process[_0x24ba00(0x21f)][_0x24ba00(0xfb)]||_0x5b70f2[_0x24ba00(0x11b)]){if(_0x1d6621[_0x24ba00(0x124)]===0x0){if(_0x22803b&&_0x23a558)console[_0x24ba00(0x218)](_0x24ba00(0x187)+_0x22803b+'.'+_0x23a558);else _0x22803b?console['log'](_0x24ba00(0x110)+_0x22803b):console['log'](_0x24ba00(0x1b1));}else{const _0x2d33ca=_0x5b70f2[_0x24ba00(0x1c1)],_0x45a3f0=this['renderSessionsTimeline'](_0x1d6621,_0x2d33ca);_0x5b70f2[_0x24ba00(0x11b)]?await writeOutput(_0x45a3f0,_0x5b70f2[_0x24ba00(0x11b)],_0x24ba00(0x121)):console[_0x24ba00(0x218)](_0x45a3f0);}!_0x22803b&&(console['error'](''),console[_0x24ba00(0x19b)](a39_0x5e8019['dim'](_0x24ba00(0x280))),console[_0x24ba00(0x19b)](a39_0x5e8019[_0x24ba00(0x20a)](_0x24ba00(0x237))+'or'+a39_0x5e8019[_0x24ba00(0x20a)](_0x24ba00(0x226))));}else{if(_0x1d6621[_0x24ba00(0x124)]===0x0){if(_0x22803b&&_0x23a558)console[_0x24ba00(0x218)]('No\x20sessions\x20found\x20for:\x20'+_0x22803b+'.'+_0x23a558);else _0x22803b?console[_0x24ba00(0x218)](_0x24ba00(0x110)+_0x22803b):console[_0x24ba00(0x218)](_0x24ba00(0x1b1));}else await this[_0x24ba00(0x26c)](_0x1d6621,_0x47059f,_0x22803b);}}return 0x0;}[a39_0x1430a8(0x212)](_0x5f27ad,_0x8a8970){const _0x1a3992=a39_0x1430a8,_0x2e8e83=[],_0x5f4a60=new Map();let _0x4ba1cc=Infinity,_0x2bf553=-Infinity;for(const _0x22f646 of _0x5f27ad){if(_0x22f646[_0x1a3992(0x253)]?.[_0x1a3992(0x264)]){const _0x215e43=new Date(_0x22f646['lastAttempt'][_0x1a3992(0x264)])[_0x1a3992(0x28c)](),_0x1e1f35=_0x22f646[_0x1a3992(0x253)]['finishedAt']?new Date(_0x22f646['lastAttempt'][_0x1a3992(0x119)])[_0x1a3992(0x28c)]():Date[_0x1a3992(0x166)](),_0x317572=_0x22f646['project']?.['name']||_0x1a3992(0x271);!_0x5f4a60[_0x1a3992(0x1ff)](_0x317572)&&_0x5f4a60[_0x1a3992(0x177)](_0x317572,[]),_0x5f4a60[_0x1a3992(0x244)](_0x317572)[_0x1a3992(0x204)]({'session':_0x22f646,'startTime':_0x215e43,'endTime':_0x1e1f35,'duration':_0x1e1f35-_0x215e43}),_0x4ba1cc=Math[_0x1a3992(0x197)](_0x4ba1cc,_0x215e43),_0x2bf553=Math[_0x1a3992(0x1e6)](_0x2bf553,_0x1e1f35);}}if(_0x5f4a60[_0x1a3992(0x262)]===0x0)return _0x1a3992(0x1d6);const _0x3cde3d=process[_0x1a3992(0x21f)][_0x1a3992(0x1da)]||0x78,_0x5b5e4c=0x1e,_0x49c691=0x32,_0x5040bf=0x4,_0x47c408=Math[_0x1a3992(0x197)](_0x49c691,Math[_0x1a3992(0x1e6)](_0x5b5e4c,Math[_0x1a3992(0x11f)](_0x3cde3d*0.3))),_0x3925b4=_0x3cde3d-_0x47c408-TIMELINE_CONFIG[_0x1a3992(0x1f4)]-0x3-_0x5040bf,_0x45292d=_0x2bf553-_0x4ba1cc,_0x53cf2e=_0x45292d/_0x47c408,_0x488590=renderTimeAxis({'startTime':_0x4ba1cc,'endTime':_0x2bf553,'durationMs':_0x45292d,'msPerChar':_0x53cf2e},_0x47c408),_0x3c3f30=[];for(const _0x40e832 of _0x5f4a60['values']()){_0x3c3f30[_0x1a3992(0x204)](..._0x40e832);}_0x3c3f30[_0x1a3992(0x1ad)]((_0x7c85b,_0x445a39)=>_0x445a39['startTime']-_0x7c85b[_0x1a3992(0x223)]);const _0x5b8574=new Date(_0x4ba1cc),_0x19d1db=formatDate(_0x5b8574),_0x4a55a1=_0x5040bf+TIMELINE_CONFIG[_0x1a3992(0x207)]+TIMELINE_CONFIG[_0x1a3992(0x17b)]+_0x3925b4,_0x20c2c1='\x20'['repeat'](_0x4a55a1-_0x19d1db[_0x1a3992(0x124)]),_0x5f7138=_0x20c2c1+a39_0x5e8019[_0x1a3992(0x20a)](_0x19d1db)+'\x20'+_0x488590;_0x2e8e83[_0x1a3992(0x204)](_0x5f7138);const _0x87f796=0x16;let _0x10caf2=0x0;for(const _0x29057a of _0x3c3f30){const _0x2d3ef9=_0x29057a[_0x1a3992(0x22c)][_0x1a3992(0x1df)]?.[_0x1a3992(0x1e7)]||'?',_0x20114a=Math[_0x1a3992(0x197)](stringWidth(_0x2d3ef9),_0x87f796);_0x10caf2=Math[_0x1a3992(0x1e6)](_0x10caf2,_0x20114a);}for(const _0x11cb03 of _0x3c3f30){const {session:_0x17adb6,startTime:_0x125d22,endTime:_0xf33fb3,duration:_0x525c45}=_0x11cb03,_0x4d23ee=_0x17adb6[_0x1a3992(0x1df)]?.['id'],_0x4094b5=_0x17adb6['id'],_0x2a6846=_0x17adb6[_0x1a3992(0x1df)]?.[_0x1a3992(0x1e7)]||'?',_0x43e1a3=_0x17adb6[_0x1a3992(0x16c)]?.[_0x1a3992(0x1e7)]||'?';let _0x1094f9,_0x6332f2;if(_0x17adb6[_0x1a3992(0x253)]){const _0x34c3ce=_0x17adb6[_0x1a3992(0x253)];!_0x34c3ce[_0x1a3992(0x190)]?(_0x1094f9=_0x34c3ce[_0x1a3992(0x168)]?'🛑':'🔄',_0x6332f2=_0x34c3ce['cancelRequested']?a39_0x5e8019[_0x1a3992(0x116)]:a39_0x5e8019[_0x1a3992(0x25d)]):(_0x1094f9=_0x34c3ce['success']?'✅':'❌',_0x6332f2=_0x34c3ce[_0x1a3992(0x21b)]?a39_0x5e8019['green']:a39_0x5e8019['red']);}else _0x1094f9='⏳',_0x6332f2=a39_0x5e8019[_0x1a3992(0x20a)];const _0x351ee1='#'+_0x4094b5,_0x349145=_0x4d23ee?hyperlink(_0x351ee1,getWorkflowSessionUrl(_0x8a8970,_0x4d23ee,_0x4094b5)):_0x351ee1;let _0x2130b8=_0x2a6846;stringWidth(_0x2a6846)>_0x87f796&&(_0x2130b8=_0x2a6846['slice'](0x0,_0x87f796-0x1)+'…');const _0x572a76=a39_0x5e8019[_0x1a3992(0x20a)](_0x2130b8),_0x1135a8=stringWidth(_0x2130b8),_0x49d2b4='\x20'[_0x1a3992(0x19f)](_0x10caf2-stringWidth(_0x2130b8)+0x2),_0x2f035c='('+formatElapsed(_0x525c45)+')',_0x259fef=stringWidth(_0x2f035c),_0x44f4f9=stringWidth(_0x351ee1),_0x13037e=_0x44f4f9+0x1+_0x1135a8+_0x49d2b4[_0x1a3992(0x124)],_0x537bb3=_0x3925b4-_0x13037e-_0x259fef-0x1-0x8;let _0x51b423=_0x43e1a3;stringWidth(_0x51b423)>_0x537bb3&&(_0x51b423=_0x51b423[_0x1a3992(0x1d9)](0x0,_0x537bb3-0x1)+'…');const _0x3db746=_0x349145+'\x20'+_0x572a76+_0x49d2b4+_0x51b423,_0x53b33a=stringWidth(_0x3db746),_0x40f4d1=_0x3925b4-_0x53b33a-_0x259fef,_0x2cb738=_0x3db746+'\x20'['repeat'](Math[_0x1a3992(0x1e6)](0x1,_0x40f4d1))+a39_0x5e8019[_0x1a3992(0x20a)](_0x2f035c),_0x2dfce7=Math[_0x1a3992(0x11f)]((_0x125d22-_0x4ba1cc)/_0x53cf2e),_0x17a3fc=Math[_0x1a3992(0x11f)]((_0xf33fb3-_0x4ba1cc)/_0x53cf2e),_0x29007e=Math[_0x1a3992(0x1e6)](_0x2dfce7+0x1,_0x17a3fc),_0x37f286=new Array(_0x47c408)[_0x1a3992(0x23f)]('\x20');for(let _0x394fe2=_0x2dfce7;_0x394fe2<Math[_0x1a3992(0x197)](_0x29007e,_0x47c408);_0x394fe2++){_0x37f286[_0x394fe2]='─';}const _0x26de4f=_0x37f286['map'](_0x113639=>_0x113639==='\x20'?'\x20':_0x6332f2(_0x113639))[_0x1a3992(0x164)]('');_0x2e8e83['push'](_0x1094f9+'\x20'+_0x2cb738+'│'+_0x26de4f+'│');}return _0x2e8e83[_0x1a3992(0x164)]('\x0a');}async['navigateSessionsInteractive'](_0x56e926,_0x1aa682,_0x265722){const _0x4e2316=a39_0x1430a8,{options:_0x19d0e2,tdx:_0x4a22fd}=_0x1aa682,_0x419ace=_0x19d0e2[_0x4e2316(0x1c1)],{timelineRows:_0x55d2ea,timeAxisHeader:_0x52d010}=this[_0x4e2316(0x155)](_0x56e926,_0x419ace),_0x1e79da=_0x55d2ea[_0x4e2316(0x287)](_0x503ab5=>_0x503ab5[_0x4e2316(0x169)]);if(_0x1e79da[_0x4e2316(0x124)]===0x0){const _0x1aa1e5=this['renderSessionsTimeline'](_0x56e926,_0x419ace);console[_0x4e2316(0x218)](_0x1aa1e5);!_0x265722&&(console[_0x4e2316(0x19b)](''),console['error'](a39_0x5e8019['dim'](_0x4e2316(0x280))),console[_0x4e2316(0x19b)](a39_0x5e8019[_0x4e2316(0x20a)](_0x4e2316(0x237))+'or'+a39_0x5e8019[_0x4e2316(0x20a)](_0x4e2316(0x226))));return;}_0x52d010&&console['log'](_0x52d010);const _0x3bf53c=_0x55d2ea[_0x4e2316(0x287)](_0x2828e3=>_0x2828e3[_0x4e2316(0x169)])[_0x4e2316(0x265)](_0x4c6eb7=>({'title':_0x4c6eb7[_0x4e2316(0x1a6)],'value':_0x4c6eb7[_0x4e2316(0x169)]})),_0x5bb6c6=process['stdout']['rows']||0x3c,_0x5cd212=Math[_0x4e2316(0x1e6)](0x28,Math[_0x4e2316(0x11f)](_0x5bb6c6*0x2/0x3)),_0x1b5461=await a39_0x269b13({'type':_0x4e2316(0x1db),'name':_0x4e2316(0x169),'message':_0x4e2316(0x112),'choices':_0x3bf53c,'initial':-0x1,'limit':_0x5cd212,'clearFirst':!![],'fallback':{'title':_0x4e2316(0xff),'value':null},'suggest':(_0x2e7f75,_0x52b2a6)=>{const _0x28a811=_0x4e2316;if(!_0x2e7f75)return Promise['resolve'](_0x52b2a6);const _0x5e3d16=_0x52b2a6[_0x28a811(0x287)](_0x15a0b6=>{const _0x523811=_0x28a811,_0x4abf14=_0x15a0b6;return _0x4abf14['title'][_0x523811(0x27f)]()['includes'](_0x2e7f75[_0x523811(0x27f)]());});return Promise[_0x28a811(0x25f)](_0x5e3d16);}}),_0x4007ac=()=>{const _0x551096=_0x4e2316;process[_0x551096(0x21f)][_0x551096(0x21e)]('\x1b[1A\x1b[2K'),process[_0x551096(0x21f)][_0x551096(0x21e)]('\x1b[1A\x1b[2K'),process[_0x551096(0x21f)][_0x551096(0x21e)]('\x1b[1A\x1b[2K');},_0x9142=_0x1b5461&&_0x1b5461[_0x4e2316(0x169)]&&_0x1b5461['attemptId']!==null&&_0x1b5461[_0x4e2316(0x169)]['trim']()!=='';if(!_0x9142){_0x4007ac(),console['log'](a39_0x5e8019[_0x4e2316(0x20a)](_0x4e2316(0x154)));return;}_0x4007ac();const _0x497e35=_0x56e926[_0x4e2316(0x160)](_0xe162fa=>_0xe162fa[_0x4e2316(0x253)]?.['id']===_0x1b5461[_0x4e2316(0x169)]);if(_0x497e35){const _0x21baca=_0x497e35[_0x4e2316(0x1df)]?.[_0x4e2316(0x1e7)]||'?',_0x45d33c=_0x497e35[_0x4e2316(0x16c)]?.['name']||'?';console['log'](_0x4e2316(0x1a0)+a39_0x5e8019[_0x4e2316(0x20a)](_0x21baca)+',\x20Workflow:\x20'+a39_0x5e8019[_0x4e2316(0x20a)](_0x45d33c));}const _0x377a30=new WorkflowTimelineCommand();await _0x377a30[_0x4e2316(0x1c3)]({'args':[],'options':{..._0x19d0e2,'attemptId':_0x1b5461[_0x4e2316(0x169)]},'tdx':_0x4a22fd});}['generateSessionTimelineRows'](_0x53cd5d,_0x5d640a){const _0x1e8b56=a39_0x1430a8,_0x275cce=new Map();for(const _0x3d02f1 of _0x53cd5d){_0x3d02f1['id']&&_0x3d02f1[_0x1e8b56(0x253)]?.['id']&&_0x275cce['set'](_0x3d02f1['id'],_0x3d02f1[_0x1e8b56(0x253)]['id']);}const _0x401244=[];let _0x151a4c='';const _0x48c353=this[_0x1e8b56(0x212)](_0x53cd5d,_0x5d640a),_0x3a8103=_0x48c353[_0x1e8b56(0x28a)]('\x0a');for(const _0x5f0713 of _0x3a8103){if(_0x5f0713['startsWith']('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x5f0713[_0x1e8b56(0x10e)](/^\s+\d{4}-\d{2}-\d{2}/))_0x151a4c=_0x5f0713;else{if(_0x5f0713[_0x1e8b56(0x10e)](/^[✅❌🔄🛑⏳]/)){const _0x38304b=_0x5f0713[_0x1e8b56(0x10e)](/#(\d+)/),_0x7cf539=_0x38304b?_0x38304b[0x1]:null,_0x13d16d=_0x7cf539?_0x275cce[_0x1e8b56(0x244)](_0x7cf539)||null:null,_0x3a71db=_0x53cd5d['find'](_0x4329e1=>_0x4329e1['id']===_0x7cf539),_0x9ad730=_0x3a71db?.[_0x1e8b56(0x1df)]?.['name']||'';_0x401244[_0x1e8b56(0x204)]({'displayLine':_0x5f0713,'attemptId':_0x13d16d,'projectName':_0x9ad730});}}}return{'timelineRows':_0x401244,'timeAxisHeader':_0x151a4c};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a39_0x1430a8(0x1e7)]=a39_0x1430a8(0x1c6);['description']='List\x20workflow\x20attempts';async[a39_0x1430a8(0x1c3)](_0x30d3bc){const _0x37f249=a39_0x1430a8,{options:_0x5e4b03,args:_0x178e62,tdx:_0x849622}=_0x30d3bc,_0x39d770=this[_0x37f249(0x12d)](_0x178e62,_0x5e4b03);if(!_0x39d770)return 0x1;const {projectName:_0x27c07d,workflowName:_0x5c4e38}=_0x39d770,_0xa61be9=_0x5e4b03['includeRetried'];if(_0x5e4b03[_0x37f249(0x219)]){if(_0x27c07d&&_0x5c4e38)console[_0x37f249(0x19b)](_0x37f249(0x240)+_0x27c07d+'.'+_0x5c4e38);else _0x27c07d&&console[_0x37f249(0x19b)](_0x37f249(0x1af)+_0x27c07d);_0xa61be9&&console[_0x37f249(0x19b)](_0x37f249(0x24a));}const _0x501b00=await withSpinner(_0x37f249(0x175),()=>_0x849622[_0x37f249(0x16c)]['attempts']({'projectName':_0x27c07d,'workflowName':_0x5c4e38,'includeRetried':_0xa61be9,'limit':_0x5e4b03[_0x37f249(0x201)]}),{'verbose':_0x5e4b03[_0x37f249(0x219)]}),_0x5c5c85=_0x501b00[_0x37f249(0x1a9)],_0x43600e=_0x5e4b03[_0x37f249(0x201)]||0x64,_0x40cadf=_0x5c5c85[_0x37f249(0x124)]>=_0x43600e?a39_0x5e8019[_0x37f249(0x20a)](_0x37f249(0x184)):'';console[_0x37f249(0x19b)](_0x37f249(0x26a)+_0x5c5c85[_0x37f249(0x124)]+_0x37f249(0x217)+(_0x5c5c85[_0x37f249(0x124)]!==0x1?'s':'')+_0x40cadf);if(_0x5e4b03[_0x37f249(0x180)]===_0x37f249(0x282)||_0x5e4b03[_0x37f249(0x180)]==='jsonl'||_0x5e4b03[_0x37f249(0x180)]===_0x37f249(0x267))await handleSDKOutput(_0x5c5c85,_0x5e4b03);else{if(_0x5c5c85[_0x37f249(0x124)]===0x0){if(_0x27c07d&&_0x5c4e38)console[_0x37f249(0x218)]('No\x20attempts\x20found\x20for:\x20'+_0x27c07d+'.'+_0x5c4e38);else _0x27c07d?console[_0x37f249(0x218)](_0x37f249(0x272)+_0x27c07d):console['log']('No\x20attempts\x20found');}else{const _0x1b5433=_0x5e4b03[_0x37f249(0x1c1)],_0x2996bb=_0x5c5c85[_0x37f249(0x265)](_0x2fb3f3=>{const _0xcb70f0=_0x37f249,_0x14f820=a39_0x5e8019['dim']('#'+_0x2fb3f3['id']),_0x4e076c=_0x2fb3f3[_0xcb70f0(0x1df)]?.['id'],_0x103ad3=_0x2fb3f3['session_id']||_0x2fb3f3[_0xcb70f0(0x108)],_0x353447=_0x4e076c&&_0x103ad3?hyperlink(_0x14f820,getWorkflowAttemptUrl(_0x1b5433,_0x4e076c,_0x103ad3,_0x2fb3f3['id'])):_0x14f820,{icon:_0x217f1b,text:_0x2cecc3}=getAttemptStatusDisplay(_0x2fb3f3),_0x323b65=(_0x2fb3f3[_0xcb70f0(0x1df)]?.[_0xcb70f0(0x1e7)]||'?')+'.'+(_0x2fb3f3[_0xcb70f0(0x16c)]?.[_0xcb70f0(0x1e7)]||'?'),_0x357d0b=_0x2fb3f3[_0xcb70f0(0xfc)]?a39_0x5e8019['dim'](_0x2fb3f3[_0xcb70f0(0xfc)]):'';return(_0x353447+'\x20'+_0x217f1b+(_0x2cecc3?'\x20'+_0x2cecc3:'')+'\x20'+_0x323b65+'\x20'+_0x357d0b)['trimEnd']();});await writeOutput(_0x2996bb[_0x37f249(0x164)]('\x0a'),_0x5e4b03[_0x37f249(0x11b)],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a39_0x1430a8(0x1e7)]='workflow:attempt';[a39_0x1430a8(0x17d)]='Show\x20specific\x20attempt\x20details';async[a39_0x1430a8(0x1c3)](_0x4bc820){const _0x2afaba=a39_0x1430a8,{options:_0x5eac02,args:_0x9da8f4,tdx:_0x5bfb53}=_0x4bc820,_0x3e7f30=_0x9da8f4[0x0];if(!_0x3e7f30)return console[_0x2afaba(0x19b)](_0x2afaba(0x1d4)),0x1;_0x5eac02['verbose']&&console[_0x2afaba(0x19b)](_0x2afaba(0x243)+_0x3e7f30);const _0x440217=await withSpinner(_0x2afaba(0x1f5),()=>_0x5bfb53[_0x2afaba(0x16c)]['attempt'](_0x3e7f30),{'verbose':_0x5eac02[_0x2afaba(0x219)]}),_0x593819=_0x440217['data'];let _0x18baf7;!_0x593819[_0x2afaba(0x190)]?_0x18baf7=_0x593819[_0x2afaba(0x168)]?_0x2afaba(0x230):_0x2afaba(0x1ed):_0x18baf7=_0x593819[_0x2afaba(0x21b)]?_0x2afaba(0x21b):_0x2afaba(0x19b);let _0x1f3808;if(_0x593819[_0x2afaba(0x264)]&&_0x593819[_0x2afaba(0x119)]){const _0x5f3aaf=new Date(_0x593819[_0x2afaba(0x264)])[_0x2afaba(0x28c)](),_0x179286=new Date(_0x593819['finishedAt'])[_0x2afaba(0x28c)]();_0x1f3808=Math[_0x2afaba(0x10d)]((_0x179286-_0x5f3aaf)/0x3e8);}const _0x43b17e={'attempt_id':_0x593819['id'],'status':_0x18baf7,..._0x593819[_0x2afaba(0x10a)]!==undefined&&{'index':_0x593819[_0x2afaba(0x10a)]},..._0x593819['project']&&{'project':_0x593819[_0x2afaba(0x1df)][_0x2afaba(0x1e7)]},..._0x593819['workflow']&&{'workflow':_0x593819[_0x2afaba(0x16c)][_0x2afaba(0x1e7)]},..._0x593819[_0x2afaba(0x108)]&&{'session_id':_0x593819[_0x2afaba(0x108)]},..._0x593819[_0x2afaba(0xfc)]&&{'session_time':_0x593819[_0x2afaba(0xfc)]},..._0x593819[_0x2afaba(0x18f)]&&{'retry_attempt':_0x593819[_0x2afaba(0x18f)]},..._0x1f3808!==undefined&&{'duration_sec':_0x1f3808},..._0x593819[_0x2afaba(0x264)]&&{'created_at':_0x593819[_0x2afaba(0x264)]},..._0x593819['finishedAt']&&{'finished_at':_0x593819[_0x2afaba(0x119)]},...Object[_0x2afaba(0x1cc)](_0x593819[_0x2afaba(0x172)])[_0x2afaba(0x124)]>0x0&&{'params':_0x593819['params']}};return await handleSingleObjectOutput(_0x43b17e,_0x5eac02),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a39_0x1430a8(0x1e7)]=a39_0x1430a8(0x209);['description']=a39_0x1430a8(0x25a);async[a39_0x1430a8(0x1c3)](_0x4ec6ec){const _0x1c4b4d=a39_0x1430a8,{options:_0x4df717,args:_0x26a802,tdx:_0x24e23f}=_0x4ec6ec,_0x17c1ce=_0x26a802[0x0];if(!_0x17c1ce)return console[_0x1c4b4d(0x19b)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x24152c=_0x4df717[_0x1c4b4d(0x225)];_0x4df717[_0x1c4b4d(0x219)]&&(console[_0x1c4b4d(0x19b)](_0x1c4b4d(0x243)+_0x17c1ce),_0x24152c&&console[_0x1c4b4d(0x19b)](_0x1c4b4d(0x185)));const _0x4e09a0=await withSpinner(_0x1c4b4d(0x144),()=>_0x24e23f[_0x1c4b4d(0x16c)][_0x1c4b4d(0x13b)](_0x17c1ce,_0x24152c||![]),{'verbose':_0x4df717[_0x1c4b4d(0x219)]}),_0xbc1df4=_0x4e09a0[_0x1c4b4d(0x1a9)];return console[_0x1c4b4d(0x19b)](_0x1c4b4d(0x26a)+_0xbc1df4['length']+_0x1c4b4d(0x1fb)+(_0xbc1df4[_0x1c4b4d(0x124)]!==0x1?'s':'')),await handleSDKOutput(_0xbc1df4,_0x4df717),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a39_0x1430a8(0x28e);[a39_0x1430a8(0x17d)]=a39_0x1430a8(0x15a);async['execute'](_0x1554d1){const _0x7f4532=a39_0x1430a8,{options:_0x5540db,args:_0x157eb8,tdx:_0x5b1b55}=_0x1554d1,_0x1010a0=_0x157eb8[0x0];let _0x33b297=_0x157eb8[0x1];if(!_0x1010a0)return console['error'](_0x7f4532(0x1d4)),0x1;_0x5540db[_0x7f4532(0x219)]&&(console[_0x7f4532(0x19b)](_0x7f4532(0x243)+_0x1010a0),_0x33b297&&console[_0x7f4532(0x19b)](_0x7f4532(0x17c)+_0x33b297));const _0x47bba1=await withSpinner('Fetching\x20log\x20files...',()=>_0x5b1b55['workflow']['logFiles'](_0x1010a0,_0x33b297),{'verbose':_0x5540db['verbose']}),_0x17367d=_0x47bba1['data'];if(_0x17367d['length']===0x0)return console[_0x7f4532(0x19b)](_0x7f4532(0x1ae)),0x0;if(!_0x33b297&&(_0x5540db[_0x7f4532(0x282)]||_0x5540db['format']))return await handleSDKOutput(_0x17367d,_0x5540db),0x0;if(!_0x33b297){const _0x4fb54d=_0x17367d[_0x7f4532(0x265)](_0x23849f=>({'title':_0x23849f[_0x7f4532(0x195)]+'\x20('+formatBytes(_0x23849f[_0x7f4532(0x126)])+')','value':_0x23849f[_0x7f4532(0x195)]})),_0x4d772b=await a39_0x269b13({'type':_0x7f4532(0x14d),'name':_0x7f4532(0x205),'message':_0x7f4532(0x14c),'choices':_0x4fb54d});if(!_0x4d772b[_0x7f4532(0x205)])return console[_0x7f4532(0x19b)](_0x7f4532(0x154)),0x0;_0x33b297=_0x4d772b[_0x7f4532(0x205)];}const _0x1cb9fa=await withSpinner(_0x7f4532(0x115),()=>_0x5b1b55['workflow']['logs'](_0x1010a0,_0x33b297),{'verbose':_0x5540db[_0x7f4532(0x219)]}),_0x4d6b71=_0x1cb9fa[_0x7f4532(0x1a9)];return _0x4d6b71?console[_0x7f4532(0x218)](_0x4d6b71):console[_0x7f4532(0x19b)](_0x7f4532(0x1ef)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a39_0x1430a8(0x1e7)]=a39_0x1430a8(0x16e);[a39_0x1430a8(0x17d)]=a39_0x1430a8(0x231);async[a39_0x1430a8(0x1c3)](_0x354ef1){const _0x4035b4=a39_0x1430a8,{options:_0x53d147,args:_0x5353d0,tdx:_0x1dbeb0}=_0x354ef1,_0x25638b=_0x5353d0[0x0];if(!_0x25638b)return console[_0x4035b4(0x19b)](_0x4035b4(0x1d4)),0x1;const _0x167e19=_0x53d147[_0x4035b4(0x186)];_0x53d147['verbose']&&(console[_0x4035b4(0x19b)](_0x4035b4(0x243)+_0x25638b),_0x167e19&&console['error']('Reason:\x20'+_0x167e19));if(!_0x53d147[_0x4035b4(0x111)]){const _0x1e47d5=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x25638b+'?');if(!_0x1e47d5)return console[_0x4035b4(0x19b)]('Cancelled'),0x0;}const _0x4e237c=await withSpinner('Killing\x20attempt...',()=>_0x1dbeb0[_0x4035b4(0x16c)][_0x4035b4(0x199)](_0x25638b,_0x167e19),{'verbose':_0x53d147[_0x4035b4(0x219)]}),_0x564fe5=_0x4e237c[_0x4035b4(0x1a9)];return console['error']('✔\x20'+_0x564fe5),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a39_0x1430a8(0x292);[a39_0x1430a8(0x17d)]=a39_0x1430a8(0x161);async[a39_0x1430a8(0x1c3)](_0x3fb932){const _0x42cf4a=a39_0x1430a8,{options:_0x41f9df,args:_0x746d5c,tdx:_0x387390}=_0x3fb932,_0x5dc39b=_0x746d5c[0x0];if(!_0x5dc39b)return console[_0x42cf4a(0x19b)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x42cf4a(0x19b)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x46392d=![],_0x45844d=_0x5dc39b;if(_0x5dc39b['startsWith'](_0x42cf4a(0x1d8)))_0x46392d=!![],_0x45844d=_0x5dc39b['substring'](0x8);else{if(_0x5dc39b[_0x42cf4a(0x165)](_0x42cf4a(0x1b0)))_0x46392d=![],_0x45844d=_0x5dc39b[_0x42cf4a(0x1ce)](0x8);else return console['error']('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console['error'](_0x42cf4a(0x15c)),0x1;}const _0xbf6e35=_0x41f9df[_0x42cf4a(0x24c)],_0x4ffc36=_0x41f9df[_0x42cf4a(0x162)],_0x41124a=_0x41f9df[_0x42cf4a(0x172)],_0x42b23d=_0x41f9df['force'];_0x41f9df['verbose']&&(console[_0x42cf4a(0x19b)](_0x42cf4a(0x1ee)+(_0x46392d?'session':'attempt')+'\x20'+_0x45844d),_0xbf6e35&&console['error'](_0x42cf4a(0x196)+_0xbf6e35),_0x4ffc36&&console[_0x42cf4a(0x19b)](_0x42cf4a(0x122)+_0x4ffc36),_0x41124a&&console[_0x42cf4a(0x19b)](_0x42cf4a(0x252)+_0x41124a),_0x42b23d&&console['error']('Force:\x20yes'));let _0x59e28a;if(_0x41124a)try{if(_0x41124a['startsWith']('@')){const _0x3aa170=await import('fs/promises'),_0x428ac8=_0x41124a['substring'](0x1),_0x3d45a3=await _0x3aa170[_0x42cf4a(0x249)](_0x428ac8,_0x42cf4a(0x11a));_0x59e28a=JSON[_0x42cf4a(0x220)](_0x3d45a3);}else _0x59e28a=JSON[_0x42cf4a(0x220)](_0x41124a);}catch{return console[_0x42cf4a(0x19b)](_0x42cf4a(0x203)),0x1;}if(!_0x41f9df[_0x42cf4a(0x111)]){const _0xcd471e=await confirmKey(_0x42cf4a(0x263)+(_0x46392d?_0x42cf4a(0x22c):'attempt')+'\x20'+_0x45844d+'?');if(!_0xcd471e)return console[_0x42cf4a(0x19b)](_0x42cf4a(0x154)),0x0;}let _0x39f9f1;_0x46392d?_0x39f9f1=await withSpinner(_0x42cf4a(0x13c),()=>_0x387390[_0x42cf4a(0x16c)][_0x42cf4a(0x23d)](_0x45844d,{'fromTask':_0xbf6e35,'retryParams':_0x59e28a}),{'verbose':_0x41f9df[_0x42cf4a(0x219)]}):_0x39f9f1=await withSpinner('Retrying\x20attempt...',()=>_0x387390['workflow'][_0x42cf4a(0x1ba)](_0x45844d,{'resumeFrom':_0x4ffc36,'retryParams':_0x59e28a,'force':_0x42b23d}),{'verbose':_0x41f9df[_0x42cf4a(0x219)]});const _0x2e33cc=_0x39f9f1[_0x42cf4a(0x1a9)];return console['error'](_0x42cf4a(0x14b)),console[_0x42cf4a(0x19b)](_0x42cf4a(0x214)+_0x2e33cc[_0x42cf4a(0x169)]),console[_0x42cf4a(0x19b)](_0x42cf4a(0x1e2)+_0x2e33cc[_0x42cf4a(0x108)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a39_0x1430a8(0x125);['description']=a39_0x1430a8(0x135);async[a39_0x1430a8(0x1c3)](_0x5e4893){const _0x389f93=a39_0x1430a8,{options:_0x4862ae,args:_0x440f8b,tdx:_0x10e80e}=_0x5e4893;let _0x2f1a50=_0x440f8b[0x0];if(!_0x2f1a50){const _0x4b09b5=this['resolveProject']([],_0x4862ae),_0x28665c=await withSpinner(_0x389f93(0x1a3),()=>_0x10e80e[_0x389f93(0x16c)]['workflows'](_0x4b09b5,{'limit':_0x4862ae[_0x389f93(0x201)]}),{'verbose':_0x4862ae[_0x389f93(0x219)]}),_0x43fa4b=_0x28665c[_0x389f93(0x1a9)];if(_0x43fa4b[_0x389f93(0x124)]===0x0)return console[_0x389f93(0x19b)](_0x389f93(0x22a)),!_0x4b09b5&&console['error'](a39_0x5e8019['dim'](_0x389f93(0x23e))),0x1;const _0x1e8974=_0x43fa4b[_0x389f93(0x265)](_0x4895e1=>({'title':_0x4895e1['project']?.[_0x389f93(0x1e7)]+'.'+_0x4895e1[_0x389f93(0x1e7)],'value':_0x4895e1['project']?.[_0x389f93(0x1e7)]+'.'+_0x4895e1['name'],'description':_0x4895e1[_0x389f93(0x104)]?'revision:\x20'+_0x4895e1[_0x389f93(0x104)]:undefined})),_0x1c1275=await a39_0x269b13({'type':_0x389f93(0x14d),'name':_0x389f93(0x16c),'message':_0x389f93(0x1c2),'choices':_0x1e8974});if(!_0x1c1275[_0x389f93(0x16c)])return 0x1;_0x2f1a50=_0x1c1275[_0x389f93(0x16c)];}if(!_0x2f1a50[_0x389f93(0x167)]('.')){const _0x372e65=this['resolveProject']([],_0x4862ae);if(_0x372e65)_0x2f1a50=_0x372e65+'.'+_0x2f1a50;else return console[_0x389f93(0x19b)](a39_0x5e8019[_0x389f93(0x16d)]('Error:'),_0x389f93(0x1a2)),console[_0x389f93(0x19b)](a39_0x5e8019[_0x389f93(0x20a)](_0x389f93(0x23e))),0x1;}const _0x1bb7d3=_0x4862ae['param'],_0x17f559=_0x4862ae['sessionTime'],_0x25dec9={};if(_0x1bb7d3&&Array['isArray'](_0x1bb7d3))for(const _0x1de544 of _0x1bb7d3){const _0x501753=_0x1de544[_0x389f93(0xfd)]('=');if(_0x501753===-0x1)return console[_0x389f93(0x19b)](_0x389f93(0x28d)+_0x1de544),console[_0x389f93(0x19b)](_0x389f93(0x1c4)),0x1;const _0x20118e=_0x1de544[_0x389f93(0x1ce)](0x0,_0x501753),_0x4e9962=_0x1de544[_0x389f93(0x1ce)](_0x501753+0x1);try{_0x25dec9[_0x20118e]=JSON[_0x389f93(0x220)](_0x4e9962);}catch{_0x25dec9[_0x20118e]=_0x4e9962;}}_0x4862ae[_0x389f93(0x219)]&&(console[_0x389f93(0x19b)](_0x389f93(0x18e)+_0x2f1a50),Object[_0x389f93(0x1cc)](_0x25dec9)[_0x389f93(0x124)]>0x0&&console[_0x389f93(0x19b)](_0x389f93(0x23c)+JSON[_0x389f93(0x19e)](_0x25dec9)),_0x17f559&&console[_0x389f93(0x19b)](_0x389f93(0x27c)+_0x17f559));const _0x5e79c4=await withSpinner(_0x389f93(0x152),()=>_0x10e80e[_0x389f93(0x16c)][_0x389f93(0x1a4)](_0x2f1a50,_0x25dec9,{'sessionTime':_0x17f559}),{'verbose':_0x4862ae[_0x389f93(0x219)]}),_0x211a1f=_0x5e79c4[_0x389f93(0x1a9)];console[_0x389f93(0x19b)]('✔\x20Workflow\x20run\x20started'),console[_0x389f93(0x19b)](_0x389f93(0x1f7)+_0x211a1f['id']),console['error'](_0x389f93(0x1e2)+_0x211a1f['sessionId']),console[_0x389f93(0x19b)]('\x20\x20Project:\x20'+_0x211a1f[_0x389f93(0x1df)]?.[_0x389f93(0x1e7)]),console['error']('\x20\x20Workflow:\x20'+_0x211a1f[_0x389f93(0x16c)]?.[_0x389f93(0x1e7)]);if(_0x211a1f['project']?.['id']&&_0x211a1f['sessionId']&&_0x211a1f['id']){const _0x42db46=_0x4862ae[_0x389f93(0x1c1)],_0x1dadb4=getConsoleUrl(_0x42db46,'/app/workflows/'+_0x211a1f['project']['id']+_0x389f93(0x251)+_0x211a1f[_0x389f93(0x108)]+_0x389f93(0x1ac)+_0x211a1f['id']);console[_0x389f93(0x19b)]('\x20\x20Console:\x20'+a39_0x5e8019[_0x389f93(0x176)](_0x1dadb4));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a39_0x1430a8(0x1e7)]='workflow:download';[a39_0x1430a8(0x17d)]=a39_0x1430a8(0x215);async[a39_0x1430a8(0x1c3)](_0xcaea77){const _0x591895=a39_0x1430a8,{options:_0x27f6ae,args:_0x482549,tdx:_0x402951}=_0xcaea77,_0x2910eb=_0x482549[0x0],_0x520190=_0x482549[0x1]||'.';if(!_0x2910eb)return console['error'](_0x591895(0x27e)),console[_0x591895(0x19b)](_0x591895(0x1c0)),0x1;const _0xcb0e94=_0x27f6ae[_0x591895(0x104)];_0x27f6ae['verbose']&&(console[_0x591895(0x19b)](_0x591895(0x1a0)+_0x2910eb),console['error'](_0x591895(0x188)+_0x520190),_0xcb0e94&&console[_0x591895(0x19b)](_0x591895(0x141)+_0xcb0e94));const _0x39de02=await withSpinner(_0x591895(0x100)+_0x2910eb+_0x591895(0x289),()=>_0x402951['workflow'][_0x591895(0x227)](_0x2910eb,_0x520190,{'revision':_0xcb0e94}),{'verbose':_0x27f6ae[_0x591895(0x219)]}),_0x4b5010=_0x39de02[_0x591895(0x1a9)];return console['error']('✔\x20Downloaded\x20'+_0x4b5010['projectName']),console[_0x591895(0x19b)](_0x591895(0x107)+_0x4b5010[_0x591895(0x104)]),console[_0x591895(0x19b)](_0x591895(0x23b)+_0x4b5010['filesExtracted']),console[_0x591895(0x19b)](_0x591895(0x20b)+_0x520190+'/'+_0x4b5010['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a39_0x1430a8(0x1e7)]=a39_0x1430a8(0x21d);[a39_0x1430a8(0x17d)]=a39_0x1430a8(0x1c5);async[a39_0x1430a8(0x1c3)](_0x5df5bb){const _0x1866e3=a39_0x1430a8,{options:_0x4d79f1,args:_0x2b0581,tdx:_0x3cb184}=_0x5df5bb;let _0x481caf='.',_0x525471=_0x4d79f1[_0x1866e3(0x1e7)];if(_0x2b0581[0x0]){const {promises:_0x387d47}=await import('fs');try{const _0x2cf8da=await _0x387d47['stat'](_0x2b0581[0x0]);if(_0x2cf8da['isDirectory']())_0x481caf=_0x2b0581[0x0];else return console[_0x1866e3(0x19b)](_0x1866e3(0x293)+_0x2b0581[0x0]+_0x1866e3(0x1b8)),0x1;}catch{_0x525471=_0x2b0581[0x0],_0x481caf='.';}}const _0x10522f=_0x4d79f1['revision'],_0xf6d064=_0x4d79f1[_0x1866e3(0x16f)];_0x4d79f1[_0x1866e3(0x219)]&&(console[_0x1866e3(0x19b)](_0x1866e3(0x277)+_0x481caf),_0x525471&&console['error'](_0x1866e3(0x113)+_0x525471),_0x10522f&&console[_0x1866e3(0x19b)]('Revision:\x20'+_0x10522f),_0xf6d064&&console[_0x1866e3(0x19b)](_0x1866e3(0x189)));const _0x15874f=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x3cb184['workflow'][_0x1866e3(0x204)](_0x481caf,{'projectName':_0x525471,'revision':_0x10522f,'skipValidation':_0xf6d064}),{'verbose':_0x4d79f1[_0x1866e3(0x219)]}),_0x461784=_0x15874f[_0x1866e3(0x1a9)];return console['error'](_0x1866e3(0x285)+_0x461784['projectName']),console[_0x1866e3(0x19b)](_0x1866e3(0x222)+_0x461784['projectId']),console['error'](_0x1866e3(0x107)+_0x461784[_0x1866e3(0x104)]),await this['showWorkflowConsoleUrl'](_0x3cb184,_0x461784[_0x1866e3(0x130)],_0x4d79f1[_0x1866e3(0x1c1)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a39_0x1430a8(0x1e7)]=a39_0x1430a8(0x27b);[a39_0x1430a8(0x17d)]=a39_0x1430a8(0x16a);async[a39_0x1430a8(0x1c3)](_0x391d59){const _0x115688=a39_0x1430a8,{options:_0x2dc8b4,args:_0x5d38b8,tdx:_0x388534}=_0x391d59,_0x59ff91=_0x5d38b8[0x0],_0x2e1ca5=_0x5d38b8[0x1];if(!_0x59ff91)return console[_0x115688(0x19b)](a39_0x5e8019['red']('Error:'),'Project\x20name\x20is\x20required'),console[_0x115688(0x19b)](a39_0x5e8019['dim']('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x1927d5=_0x2dc8b4[_0x115688(0x104)];_0x2dc8b4['verbose']&&(console[_0x115688(0x19b)](_0x115688(0x1a0)+_0x59ff91),_0x2e1ca5&&console[_0x115688(0x19b)](_0x115688(0x17a)+_0x2e1ca5),_0x1927d5&&console['error']('Revision:\x20'+_0x1927d5),_0x2dc8b4[_0x115688(0x26d)]&&console['error']('Dry\x20run:\x20yes'));const _0x5323ea=await withSpinner(_0x115688(0x1eb)+_0x59ff91+'...',()=>_0x388534[_0x115688(0x16c)][_0x115688(0x275)](_0x59ff91,{'targetDir':_0x2e1ca5,'revision':_0x1927d5}),{'verbose':_0x2dc8b4[_0x115688(0x219)]}),_0x3b38a4=_0x5323ea[_0x115688(0x1a9)];_0x3b38a4['isNewProject']?console[_0x115688(0x19b)](_0x115688(0x261)+_0x3b38a4[_0x115688(0x130)]):console['error'](_0x115688(0x12a)+_0x3b38a4[_0x115688(0x130)]);console['error']('\x20\x20Revision:\x20'+_0x3b38a4['revision']),console[_0x115688(0x19b)]('\x20\x20Target:\x20'+(a39_0x281c60['relative'](process[_0x115688(0x1d5)](),_0x3b38a4[_0x115688(0x148)])||'.')),console[_0x115688(0x19b)](_0x115688(0x279)+a39_0x5e8019[_0x115688(0x10c)]('+'+_0x3b38a4[_0x115688(0x1f0)][_0x115688(0x137)]+_0x115688(0x171))+',\x20'+(a39_0x5e8019[_0x115688(0x116)]('~'+_0x3b38a4[_0x115688(0x1f0)]['modified']+_0x115688(0x274))+',\x20')+(a39_0x5e8019[_0x115688(0x16d)]('-'+_0x3b38a4[_0x115688(0x1f0)][_0x115688(0xfe)]+_0x115688(0x129))+',\x20')+(''+a39_0x5e8019['dim'](_0x3b38a4['summary']['unchanged']+_0x115688(0x1fd))));for(const _0x4c5253 of _0x3b38a4[_0x115688(0x12c)]){_0x4c5253[_0x115688(0x232)]===_0x115688(0x19c)&&_0x4c5253[_0x115688(0x213)]&&(console[_0x115688(0x19b)]('\x0a'+a39_0x5e8019[_0x115688(0x176)]('---\x20'+_0x4c5253['path'])),console[_0x115688(0x19b)](_0x4c5253[_0x115688(0x213)]));}if(!_0x3b38a4[_0x115688(0x269)])return saveSessionContext({'workflow_project':_0x3b38a4[_0x115688(0x130)]},_0x2dc8b4[_0x115688(0x22c)]),console[_0x115688(0x19b)](a39_0x5e8019[_0x115688(0x10c)](_0x115688(0x132))),console[_0x115688(0x19b)](a39_0x5e8019[_0x115688(0x20a)](_0x115688(0x109)+_0x3b38a4[_0x115688(0x130)])),0x0;if(_0x2dc8b4[_0x115688(0x26d)])return console[_0x115688(0x19b)](a39_0x5e8019[_0x115688(0x116)](_0x115688(0x15b))),0x0;if(!_0x2dc8b4[_0x115688(0x111)]){const _0x39fd04=await confirmKey(_0x115688(0x14f));if(!_0x39fd04)return console['error']('Cancelled'),0x0;}await withSpinner(_0x115688(0x257),()=>_0x388534['workflow'][_0x115688(0x146)](_0x3b38a4,{'revision':_0x1927d5}),{'verbose':_0x2dc8b4[_0x115688(0x219)]}),saveSessionContext({'workflow_project':_0x3b38a4[_0x115688(0x130)]},_0x2dc8b4[_0x115688(0x22c)]),console['error'](a39_0x5e8019[_0x115688(0x10c)](_0x115688(0x134)));const _0x1dba6e=a39_0x281c60[_0x115688(0x20f)](process['cwd'](),_0x3b38a4['targetDir'])||'.';return console['error'](a39_0x5e8019[_0x115688(0x20a)](_0x115688(0x20b)+_0x1dba6e)),console['error'](a39_0x5e8019[_0x115688(0x20a)](_0x115688(0x109)+_0x3b38a4[_0x115688(0x130)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a39_0x1430a8(0x1e7)]='workflow:push';[a39_0x1430a8(0x17d)]=a39_0x1430a8(0x1b9);async['execute'](_0x7f7c27){const _0x264c5f=a39_0x1430a8,{options:_0x3e9e1f,args:_0x2d4244,tdx:_0x2baa3d}=_0x7f7c27,_0x5ea8a8=this[_0x264c5f(0x1ca)](_0x2d4244,_0x3e9e1f),_0xce48ef=_0x3e9e1f['revision'],_0x494921=_0x3e9e1f[_0x264c5f(0x16f)];_0x3e9e1f[_0x264c5f(0x219)]&&(_0x5ea8a8&&console[_0x264c5f(0x19b)](_0x264c5f(0x10b)+_0x5ea8a8),_0xce48ef&&console['error'](_0x264c5f(0x141)+_0xce48ef),_0x3e9e1f[_0x264c5f(0x26d)]&&console['error']('Dry\x20run:\x20yes'),_0x494921&&console['error'](_0x264c5f(0x189)));let _0x20c956;try{_0x20c956=await withSpinner(_0x264c5f(0x1c8),()=>_0x2baa3d[_0x264c5f(0x16c)][_0x264c5f(0x27a)]({'sourceDir':_0x5ea8a8,'revision':_0xce48ef,'skipValidation':_0x494921}),{'verbose':_0x3e9e1f[_0x264c5f(0x219)]});}catch(_0x26e6b6){if(_0x26e6b6 instanceof Error&&_0x26e6b6[_0x264c5f(0x284)][_0x264c5f(0x167)]('No\x20workflow\x20tdx.json\x20found'))return console[_0x264c5f(0x19b)](a39_0x5e8019[_0x264c5f(0x16d)](_0x264c5f(0x13a)),_0x264c5f(0x1a8)),_0x3e9e1f[_0x264c5f(0x1e3)]?console[_0x264c5f(0x19b)](a39_0x5e8019[_0x264c5f(0x20a)](_0x264c5f(0x14e)+_0x3e9e1f[_0x264c5f(0x1e3)]+_0x264c5f(0x11e)+_0x3e9e1f[_0x264c5f(0x1e3)]+'\x27')):console[_0x264c5f(0x19b)](a39_0x5e8019['dim'](_0x264c5f(0x25b))),0x1;throw _0x26e6b6;}const _0x5c021b=_0x20c956[_0x264c5f(0x1a9)];console[_0x264c5f(0x19b)](_0x264c5f(0x12a)+_0x5c021b[_0x264c5f(0x130)]),console['error'](_0x264c5f(0x133)+_0x5c021b[_0x264c5f(0x182)]),console[_0x264c5f(0x19b)]('\x20\x20Revision:\x20'+_0x5c021b[_0x264c5f(0x104)]),console[_0x264c5f(0x19b)](_0x264c5f(0x279)+a39_0x5e8019[_0x264c5f(0x10c)]('+'+_0x5c021b[_0x264c5f(0x1f0)]['new']+_0x264c5f(0x171))+',\x20'+(a39_0x5e8019[_0x264c5f(0x116)]('~'+_0x5c021b[_0x264c5f(0x1f0)][_0x264c5f(0x19c)]+_0x264c5f(0x274))+',\x20')+(a39_0x5e8019[_0x264c5f(0x16d)]('-'+_0x5c021b[_0x264c5f(0x1f0)]['deleted']+_0x264c5f(0x129))+',\x20')+(''+a39_0x5e8019[_0x264c5f(0x20a)](_0x5c021b[_0x264c5f(0x1f0)][_0x264c5f(0x20c)]+_0x264c5f(0x1fd))));for(const _0x29b8e3 of _0x5c021b[_0x264c5f(0x12c)]){_0x29b8e3[_0x264c5f(0x232)]===_0x264c5f(0x19c)&&_0x29b8e3[_0x264c5f(0x213)]&&(console[_0x264c5f(0x19b)]('\x0a'+a39_0x5e8019[_0x264c5f(0x176)](_0x264c5f(0x140)+_0x29b8e3['path'])),console[_0x264c5f(0x19b)](_0x29b8e3[_0x264c5f(0x213)]));}if(!_0x5c021b[_0x264c5f(0x269)])return console[_0x264c5f(0x19b)](a39_0x5e8019[_0x264c5f(0x10c)](_0x264c5f(0x234))),await this[_0x264c5f(0x255)](_0x2baa3d,_0x5c021b[_0x264c5f(0x130)],_0x3e9e1f[_0x264c5f(0x1c1)]),0x0;if(_0x3e9e1f[_0x264c5f(0x26d)])return console['error'](a39_0x5e8019['yellow'](_0x264c5f(0x11d))),0x0;if(!_0x3e9e1f[_0x264c5f(0x111)]){const _0xaef8d4=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0xaef8d4)return console['error'](_0x264c5f(0x154)),0x0;}const _0x124717=await withSpinner(_0x264c5f(0x138),()=>_0x2baa3d[_0x264c5f(0x16c)][_0x264c5f(0x181)](_0x5c021b),{'verbose':_0x3e9e1f['verbose']}),_0x5cca19=_0x124717[_0x264c5f(0x1a9)];return console[_0x264c5f(0x19b)](a39_0x5e8019[_0x264c5f(0x10c)](_0x264c5f(0x24d))),console['error'](_0x264c5f(0x222)+_0x5cca19['projectId']),console['error']('\x20\x20Revision:\x20'+_0x5cca19[_0x264c5f(0x104)]),await this[_0x264c5f(0x255)](_0x2baa3d,_0x5cca19[_0x264c5f(0x130)],_0x3e9e1f[_0x264c5f(0x1c1)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a39_0x1430a8(0x239);[a39_0x1430a8(0x17d)]=a39_0x1430a8(0x1dd);async[a39_0x1430a8(0x1c3)](_0x8e9160){const _0x47641a=a39_0x1430a8,{options:_0x3ae774,args:_0x3eb611,tdx:_0x308c86}=_0x8e9160,_0x3d4292=this['resolveProjectDir'](_0x3eb611,_0x3ae774),_0x38b500=_0x3ae774[_0x47641a(0x1e7)],_0x3bba56=_0x3ae774[_0x47641a(0x104)],_0x4c5d66=_0x3ae774[_0x47641a(0x16f)];if(!_0x3d4292)return console[_0x47641a(0x19b)](a39_0x5e8019['red'](_0x47641a(0x13a)),_0x47641a(0x193)),console['error'](a39_0x5e8019[_0x47641a(0x20a)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x47641a(0x19b)](a39_0x5e8019['dim']('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x38b500)return console[_0x47641a(0x19b)](a39_0x5e8019[_0x47641a(0x16d)](_0x47641a(0x13a)),_0x47641a(0x12e)),console[_0x47641a(0x19b)](a39_0x5e8019[_0x47641a(0x20a)](_0x47641a(0x114))),0x1;_0x3ae774['verbose']&&(console[_0x47641a(0x19b)]('Source\x20directory:\x20'+_0x3d4292),console[_0x47641a(0x19b)]('New\x20project\x20name:\x20'+_0x38b500),_0x3bba56&&console['error'](_0x47641a(0x141)+_0x3bba56),_0x3ae774[_0x47641a(0x26d)]&&console[_0x47641a(0x19b)](_0x47641a(0x248)),_0x4c5d66&&console['error'](_0x47641a(0x189)));const _0x5a3993=await withSpinner(_0x47641a(0x10f),()=>_0x308c86[_0x47641a(0x16c)][_0x47641a(0x288)](_0x3d4292,_0x38b500,{'revision':_0x3bba56,'skipValidation':_0x4c5d66}),{'verbose':_0x3ae774[_0x47641a(0x219)]}),_0x38ff28=_0x5a3993[_0x47641a(0x1a9)];console[_0x47641a(0x19b)](_0x47641a(0x18b)+_0x38ff28[_0x47641a(0x182)]);_0x38ff28['sourceProjectName']&&console[_0x47641a(0x19b)](_0x47641a(0x136)+_0x38ff28[_0x47641a(0x1f8)]);console[_0x47641a(0x19b)](_0x47641a(0x18a)+_0x38ff28[_0x47641a(0x149)]),console[_0x47641a(0x19b)]('Revision:\x20'+_0x38ff28['revision']),console[_0x47641a(0x19b)](_0x47641a(0x290)+_0x38ff28['fileCount']);_0x38ff28[_0x47641a(0x281)]&&(console[_0x47641a(0x19b)](a39_0x5e8019['yellow'](_0x47641a(0x11c)+_0x38ff28[_0x47641a(0x149)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x38ff28[_0x47641a(0x1d3)]+')')),console['error'](a39_0x5e8019[_0x47641a(0x116)](_0x47641a(0x1bf))));if(_0x3ae774[_0x47641a(0x26d)])return console['error'](a39_0x5e8019[_0x47641a(0x116)](_0x47641a(0x247))),0x0;if(!_0x3ae774[_0x47641a(0x111)]){const _0x3b4172=_0x38ff28[_0x47641a(0x1f8)]||a39_0x281c60[_0x47641a(0x1cb)](_0x3d4292),_0x1cd4f6=_0x38ff28[_0x47641a(0x281)]?_0x47641a(0x1ea)+_0x38b500+'\x22\x20with\x20new\x20revision?':_0x47641a(0x1be)+_0x3b4172+_0x47641a(0x1fc)+_0x38b500+'\x22?',_0x53f8f5=await confirmKey(_0x1cd4f6);if(!_0x53f8f5)return console[_0x47641a(0x19b)](_0x47641a(0x154)),0x0;}const _0x8fb0ac=await withSpinner(_0x38ff28[_0x47641a(0x281)]?'Updating\x20'+_0x38b500+_0x47641a(0x289):_0x47641a(0x198)+_0x38b500+'...',()=>_0x308c86[_0x47641a(0x16c)][_0x47641a(0x1dc)](_0x38ff28),{'verbose':_0x3ae774[_0x47641a(0x219)]}),_0x34e841=_0x8fb0ac['data'];return console['error'](a39_0x5e8019['green'](_0x38ff28[_0x47641a(0x281)]?_0x47641a(0x1d1):_0x47641a(0x254))),console['error']('\x20\x20Project:\x20'+_0x34e841[_0x47641a(0x149)]),console[_0x47641a(0x19b)](_0x47641a(0x222)+_0x34e841['newProjectId']),console[_0x47641a(0x19b)]('\x20\x20Revision:\x20'+_0x34e841[_0x47641a(0x104)]),await this[_0x47641a(0x255)](_0x308c86,_0x34e841[_0x47641a(0x149)],_0x3ae774[_0x47641a(0x1c1)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a39_0x1430a8(0x1e7)]=a39_0x1430a8(0x1aa);['description']='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a39_0x1430a8(0x1c3)](_0x5040d7){const _0x393514=a39_0x1430a8,{options:_0x48da03,args:_0x330b65,tdx:_0x35caf1}=_0x5040d7,_0x25e637=_0x330b65[0x0];if(!_0x25e637)return console[_0x393514(0x19b)](_0x393514(0x224)),console[_0x393514(0x19b)](_0x393514(0x120)),0x1;_0x48da03[_0x393514(0x219)]&&console[_0x393514(0x19b)]('Project:\x20'+_0x25e637);if(!_0x48da03[_0x393514(0x111)]){const _0x4f739c=await confirmKey(_0x393514(0x15e)+_0x25e637+_0x393514(0x158));if(!_0x4f739c)return console['error'](_0x393514(0x154)),0x0;}const _0x109004=await withSpinner(_0x393514(0x173)+_0x25e637+_0x393514(0x289),()=>_0x35caf1[_0x393514(0x16c)][_0x393514(0x127)](_0x25e637),{'verbose':_0x48da03[_0x393514(0x219)]}),_0x2a2f84=_0x109004[_0x393514(0x1a9)];return console[_0x393514(0x19b)](_0x393514(0x16b)+_0x2a2f84[_0x393514(0x130)]),console[_0x393514(0x19b)](_0x393514(0x222)+_0x2a2f84[_0x393514(0x179)]),0x0;}}export function parseKeyValue(_0x3a89c8){const _0x4af1fc=a39_0x1430a8,_0x433af1=_0x3a89c8[_0x4af1fc(0xfd)]('=');if(_0x433af1===-0x1)throw new Error(_0x4af1fc(0x242)+_0x3a89c8+_0x4af1fc(0x26b));const _0x325fe4=_0x3a89c8[_0x4af1fc(0x1ce)](0x0,_0x433af1),_0x5f5052=_0x3a89c8['substring'](_0x433af1+0x1);if(!_0x325fe4)throw new Error(_0x4af1fc(0x118));return{'key':_0x325fe4,'value':_0x5f5052};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a39_0x1430a8(0x1e7)]='workflow:secrets:list';['description']=a39_0x1430a8(0x1e5);async['execute'](_0x3cbf7c){const _0x37943a=a39_0x1430a8,{options:_0x133465,args:_0x3dd11b,tdx:_0x5edc12}=_0x3cbf7c,_0x384b32=this[_0x37943a(0x24b)](_0x3dd11b,_0x133465);if(!_0x384b32)return 0x1;_0x133465[_0x37943a(0x219)]&&console['error'](_0x37943a(0x1a0)+_0x384b32);const _0x366fe3=await withSpinner(_0x37943a(0x1d2),()=>_0x5edc12['workflow']['listSecrets'](_0x384b32),{'verbose':_0x133465[_0x37943a(0x219)]}),{secrets:_0x2178e6}=_0x366fe3[_0x37943a(0x1a9)];return console[_0x37943a(0x19b)]('✔\x20Found\x20'+_0x2178e6[_0x37943a(0x124)]+_0x37943a(0x1b3)+(_0x2178e6[_0x37943a(0x124)]!==0x1?'s':'')),await handleSDKOutput(_0x2178e6,_0x133465),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a39_0x1430a8(0x216);[a39_0x1430a8(0x17d)]='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async['execute'](_0x1b2a06){const _0x3c5ed6=a39_0x1430a8,{options:_0x462018,args:_0x18a172,tdx:_0x4bbd84}=_0x1b2a06;let _0x5265c3,_0x1a5798;if(_0x18a172['length']>=0x2)_0x5265c3=_0x18a172[0x0],_0x1a5798=_0x18a172[0x1];else{if(_0x18a172[_0x3c5ed6(0x124)]===0x1&&_0x462018[_0x3c5ed6(0x1e3)])_0x5265c3=_0x462018[_0x3c5ed6(0x1e3)],_0x1a5798=_0x18a172[0x0];else return _0x18a172['length']===0x1?(console[_0x3c5ed6(0x19b)](_0x3c5ed6(0x27e)),console[_0x3c5ed6(0x19b)](_0x3c5ed6(0x23e)),0x1):(console[_0x3c5ed6(0x19b)](_0x3c5ed6(0x25c)),console[_0x3c5ed6(0x19b)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE'),0x1);}let _0x2c26dc,_0x85dc7b;try{({key:_0x2c26dc,value:_0x85dc7b}=parseKeyValue(_0x1a5798));}catch(_0x15fbb2){return _0x15fbb2 instanceof Error&&console[_0x3c5ed6(0x19b)](a39_0x5e8019[_0x3c5ed6(0x16d)](_0x3c5ed6(0x13a)),_0x15fbb2[_0x3c5ed6(0x284)]),0x1;}_0x462018['verbose']&&(console[_0x3c5ed6(0x19b)]('Project:\x20'+_0x5265c3),console['error']('Key:\x20'+_0x2c26dc));const _0x2d768d=await withSpinner('Setting\x20secret...',()=>_0x4bbd84[_0x3c5ed6(0x16c)][_0x3c5ed6(0x1e9)](_0x5265c3,_0x2c26dc,_0x85dc7b),{'verbose':_0x462018['verbose']}),_0x5c687e=_0x2d768d[_0x3c5ed6(0x1a9)];return console[_0x3c5ed6(0x19b)](_0x3c5ed6(0x159)+_0x5c687e['key']+_0x3c5ed6(0x238)+_0x5c687e['projectName']+'\x27'),(_0x462018[_0x3c5ed6(0x282)]||_0x462018[_0x3c5ed6(0x268)])&&await handleSingleObjectOutput(_0x5c687e,_0x462018),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a39_0x1430a8(0x1e7)]='workflow:secrets:delete';['description']=a39_0x1430a8(0x1e1);async[a39_0x1430a8(0x1c3)](_0x51ec38){const _0x6c5acc=a39_0x1430a8,{options:_0xd4ebcd,args:_0x256ac1,tdx:_0x202d37}=_0x51ec38;let _0x34ac47,_0xd89800;if(_0x256ac1[_0x6c5acc(0x124)]>=0x2)_0x34ac47=_0x256ac1[0x0],_0xd89800=_0x256ac1[0x1];else{if(_0x256ac1[_0x6c5acc(0x124)]===0x1&&_0xd4ebcd['workflowProject'])_0x34ac47=_0xd4ebcd[_0x6c5acc(0x1e3)],_0xd89800=_0x256ac1[0x0];else return _0x256ac1[_0x6c5acc(0x124)]===0x1?(console[_0x6c5acc(0x19b)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x6c5acc(0x19b)](_0x6c5acc(0x23e)),0x1):(console[_0x6c5acc(0x19b)](_0x6c5acc(0x208)),console[_0x6c5acc(0x19b)](_0x6c5acc(0x1d0)),0x1);}_0xd4ebcd[_0x6c5acc(0x219)]&&(console[_0x6c5acc(0x19b)](_0x6c5acc(0x1a0)+_0x34ac47),console[_0x6c5acc(0x19b)](_0x6c5acc(0x1d7)+_0xd89800));if(!_0xd4ebcd['yes']){const _0x10a93d=await confirmKey(_0x6c5acc(0x145)+_0xd89800+_0x6c5acc(0x12f)+_0x34ac47+'\x27?');if(!_0x10a93d)return console[_0x6c5acc(0x19b)](_0x6c5acc(0x154)),0x0;}const _0x2ce7a5=await withSpinner(_0x6c5acc(0x1e0),()=>_0x202d37[_0x6c5acc(0x16c)]['deleteSecret'](_0x34ac47,_0xd89800),{'verbose':_0xd4ebcd[_0x6c5acc(0x219)]}),_0x86297d=_0x2ce7a5['data'];return console[_0x6c5acc(0x19b)]('✔\x20Secret\x20\x27'+_0x86297d[_0x6c5acc(0x15d)]+_0x6c5acc(0x128)+_0x86297d[_0x6c5acc(0x130)]+'\x27'),(_0xd4ebcd[_0x6c5acc(0x282)]||_0xd4ebcd[_0x6c5acc(0x268)])&&await handleSingleObjectOutput(_0x86297d,_0xd4ebcd),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(_0x3909e1){const _0x175db3=a39_0x1430a8,_0x1c77a5=Math[_0x175db3(0x11f)](_0x3909e1/0x3e8),_0x1e4040=Math['floor'](_0x1c77a5/0x3c),_0x340abd=Math[_0x175db3(0x11f)](_0x1e4040/0x3c),_0x18d299=Math[_0x175db3(0x11f)](_0x340abd/0x18);if(_0x18d299>0x0){const _0x2ba2ce=_0x340abd%0x18;return _0x2ba2ce>0x0?_0x18d299+'d\x20'+_0x2ba2ce+'h':_0x18d299+'d';}else{if(_0x340abd>0x0){const _0x2514a4=_0x1e4040%0x3c;return _0x2514a4>0x0?_0x340abd+'h\x20'+_0x2514a4+'m':_0x340abd+'h';}else{if(_0x1e4040>0x0){const _0x2e76ae=_0x1c77a5%0x3c;return _0x2e76ae>0x0?_0x1e4040+'m\x20'+_0x2e76ae+'s':_0x1e4040+'m';}else return _0x1c77a5+'s';}}}function formatTimestamp(_0x290b45,_0x396ecf){const _0x2e20e4=a39_0x1430a8,_0x471012=new Date(_0x290b45),_0x556a06=String(_0x471012[_0x2e20e4(0x22e)]())[_0x2e20e4(0x210)](0x2,'0'),_0x41bf51=String(_0x471012[_0x2e20e4(0x105)]())[_0x2e20e4(0x210)](0x2,'0'),_0x26fb6c=_0x556a06+':'+_0x41bf51,_0x10be19=_0x471012[_0x2e20e4(0x147)]()===_0x396ecf[_0x2e20e4(0x147)]()&&_0x471012[_0x2e20e4(0x21a)]()===_0x396ecf[_0x2e20e4(0x21a)]()&&_0x471012[_0x2e20e4(0x18c)]()===_0x396ecf[_0x2e20e4(0x18c)]();if(_0x10be19)return _0x26fb6c;else{const _0x10e27f=String(_0x471012[_0x2e20e4(0x21a)]()+0x1)[_0x2e20e4(0x210)](0x2,'0'),_0xd8eb00=String(_0x471012[_0x2e20e4(0x18c)]())[_0x2e20e4(0x210)](0x2,'0');return _0x10e27f+'-'+_0xd8eb00+'\x20'+_0x26fb6c;}}function formatDate(_0x559d19){const _0x53f039=a39_0x1430a8,_0x574584=_0x559d19[_0x53f039(0x147)](),_0x59a98c=String(_0x559d19[_0x53f039(0x21a)]()+0x1)[_0x53f039(0x210)](0x2,'0'),_0x4cf443=String(_0x559d19[_0x53f039(0x18c)]())[_0x53f039(0x210)](0x2,'0');return _0x574584+'-'+_0x59a98c+'-'+_0x4cf443;}function getTaskStateIcon(_0x3c7225){const _0x2c699a={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x2c699a[_0x3c7225]||'⚪';}function getBarChar(_0x386e73){const _0x4a4406=a39_0x1430a8;return _0x386e73==='error'||_0x386e73===_0x4a4406(0x1fe)?'×':'─';}function getBarColor(_0x3bc4e3){const _0x58ce94=a39_0x1430a8,_0x4582a4={'success':a39_0x5e8019[_0x58ce94(0x10c)],'error':a39_0x5e8019[_0x58ce94(0x16d)],'group_error':a39_0x5e8019[_0x58ce94(0x16d)],'running':a39_0x5e8019[_0x58ce94(0x25d)],'blocked':a39_0x5e8019[_0x58ce94(0x116)],'planned':a39_0x5e8019['dim'],'canceling':a39_0x5e8019[_0x58ce94(0x116)]};return _0x4582a4[_0x3bc4e3]||a39_0x5e8019[_0x58ce94(0x183)];}function parseTaskName(_0x5a8462){const _0x25fce8=a39_0x1430a8;let _0x13ce96=_0x5a8462[_0x25fce8(0x26e)](/^\++/,'');const _0x592006=_0x13ce96['split']('+'),_0x543c95=_0x592006[_0x25fce8(0x124)]>0x1?_0x592006[_0x25fce8(0x124)]-0x2:0x0,_0x3f2efe=_0x592006[_0x592006[_0x25fce8(0x124)]-0x1]||_0x13ce96;return{'level':_0x543c95,'name':'+'+_0x3f2efe};}function truncateTaskName(_0x45c865,_0x322af6){const _0x29fbd7=a39_0x1430a8,_0x19917e=stringWidth(_0x45c865);if(_0x19917e<=_0x322af6)return _0x45c865;let _0x33a876=_0x45c865;while(stringWidth(_0x33a876+'…')>_0x322af6&&_0x33a876[_0x29fbd7(0x124)]>0x0){_0x33a876=_0x33a876['slice'](0x0,-0x1);}return _0x33a876+'…';}function calculateTimeScale(_0x14a852,_0xb8143e){const _0x2b6608=a39_0x1430a8;return{'startTime':_0x14a852[_0x2b6608(0x15f)],'endTime':_0x14a852[_0x2b6608(0x250)],'durationMs':_0x14a852['duration'],'msPerChar':_0x14a852['duration']/_0xb8143e};}function timeToPosition(_0x22206b,_0x13054d,_0x1f4809){const _0x4b1057=a39_0x1430a8,_0xd285b8=_0x22206b-_0x13054d['startTime'],_0x572775=Math[_0x4b1057(0x11f)](_0xd285b8/_0x13054d[_0x4b1057(0x245)]);return Math[_0x4b1057(0x1e6)](0x0,Math['min'](_0x572775,_0x1f4809));}function renderTimeAxis(_0x28e258,_0x4a92ef){const _0x101aa6=a39_0x1430a8,_0x3ef106=Math[_0x101aa6(0x197)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x101aa6(0x1e6)](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math[_0x101aa6(0x11f)](_0x4a92ef/TIMELINE_CONFIG[_0x101aa6(0x1c9)]))),_0x1af2e7=_0x28e258[_0x101aa6(0x1b6)]/(_0x3ef106-0x1),_0x26c9e2=new Date(_0x28e258[_0x101aa6(0x223)]),_0x33a4f0=[];for(let _0x1254db=0x0;_0x1254db<_0x3ef106;_0x1254db++){const _0x88399c=_0x28e258[_0x101aa6(0x223)]+_0x1254db*_0x1af2e7,_0x165f70=timeToPosition(_0x88399c,_0x28e258,_0x4a92ef),_0x1c3632=formatTimestamp(_0x88399c,_0x26c9e2);_0x33a4f0['push']({'pos':_0x165f70,'text':_0x1c3632});}const _0x381bce=new Array(_0x4a92ef)[_0x101aa6(0x23f)]('\x20');let _0x3d66b0=-0x1;for(const {pos:_0x3ef440,text:_0x31efe4}of _0x33a4f0){let _0x5495d2=Math['max'](0x0,_0x3ef440-Math['floor'](_0x31efe4[_0x101aa6(0x124)]/0x2));_0x5495d2<=_0x3d66b0+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x5495d2=_0x3d66b0+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x5495d2+_0x31efe4[_0x101aa6(0x124)]>_0x4a92ef&&(_0x5495d2=_0x4a92ef-_0x31efe4[_0x101aa6(0x124)]);if(_0x5495d2>=0x0&&_0x5495d2+_0x31efe4[_0x101aa6(0x124)]<=_0x4a92ef&&_0x5495d2>_0x3d66b0){for(let _0x5572a8=0x0;_0x5572a8<_0x31efe4[_0x101aa6(0x124)];_0x5572a8++){_0x381bce[_0x5495d2+_0x5572a8]=_0x31efe4[_0x5572a8];}_0x3d66b0=_0x5495d2+_0x31efe4[_0x101aa6(0x124)]-0x1;}}return _0x381bce['join']('');}function renderTaskRow(_0x45f4db,_0x5ef520,_0x3598ba,_0x5d0ff9){const _0x2615b9=a39_0x1430a8,{level:_0x3372a7,name:_0x33b7a2}=parseTaskName(_0x45f4db[_0x2615b9(0x1e7)]),_0x54184c='\x20'[_0x2615b9(0x19f)](_0x3372a7),_0x347456=_0x45f4db[_0x2615b9(0x1a7)]?'('+formatElapsed(_0x45f4db[_0x2615b9(0x1a7)][_0x2615b9(0x151)])+')':'',_0x5419af=stringWidth(_0x347456),_0x504774=_0x3372a7*0x1,_0xbbbf6f=_0x5d0ff9-_0x504774-_0x5419af-0x1,_0x4d4654=truncateTaskName(_0x33b7a2,_0xbbbf6f),_0x5bfc6c=_0x54184c+_0x4d4654,_0x465821=stringWidth(_0x5bfc6c),_0x472ec3=_0x5d0ff9-_0x465821-_0x5419af,_0x15711d=_0x5bfc6c+'\x20'[_0x2615b9(0x19f)](Math['max'](0x1,_0x472ec3))+a39_0x5e8019[_0x2615b9(0x20a)](_0x347456),_0x5d86f1=getTaskStateIcon(_0x45f4db[_0x2615b9(0x246)]),_0x56d58a=new Array(_0x3598ba)['fill']('\x20');if(_0x45f4db['window']){const _0x555ae5=timeToPosition(_0x45f4db[_0x2615b9(0x1a7)][_0x2615b9(0x15f)],_0x5ef520,_0x3598ba),_0x68d88f=timeToPosition(_0x45f4db['window'][_0x2615b9(0x250)],_0x5ef520,_0x3598ba),_0x284818=getBarChar(_0x45f4db[_0x2615b9(0x246)]),_0x177480=Math[_0x2615b9(0x1e6)](_0x555ae5+0x1,_0x68d88f);for(let _0x199a6a=_0x555ae5;_0x199a6a<Math[_0x2615b9(0x197)](_0x177480,_0x3598ba);_0x199a6a++){_0x56d58a[_0x199a6a]=_0x284818;}}const _0x506c53=getBarColor(_0x45f4db['state']),_0x408764=_0x56d58a[_0x2615b9(0x265)](_0x362bdc=>_0x362bdc==='\x20'?'\x20':_0x506c53(_0x362bdc))[_0x2615b9(0x164)]('');return _0x5d86f1+'\x20'+_0x15711d+'│'+_0x408764+'│';}function calculateStats(_0x3760d7){const _0x300bc4=a39_0x1430a8,_0x3f98f7={'total':_0x3760d7[_0x300bc4(0x124)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x1bcab8 of _0x3760d7){if(_0x1bcab8[_0x300bc4(0x246)]===_0x300bc4(0x21b))_0x3f98f7[_0x300bc4(0x21b)]++;else{if(_0x1bcab8['state']==='error'||_0x1bcab8[_0x300bc4(0x246)]===_0x300bc4(0x1fe))_0x3f98f7[_0x300bc4(0x19b)]++;else _0x1bcab8[_0x300bc4(0x246)]==='running'?_0x3f98f7['running']++:_0x3f98f7[_0x300bc4(0x276)]++;}}return _0x3f98f7;}function formatStats(_0x27ef79){const _0x1d6e81=a39_0x1430a8;return[_0x1d6e81(0x202)+_0x27ef79[_0x1d6e81(0x194)],'✅\x20'+_0x27ef79[_0x1d6e81(0x21b)],'❌\x20'+_0x27ef79[_0x1d6e81(0x19b)],_0x1d6e81(0x235)+_0x27ef79[_0x1d6e81(0x1ed)],'⏳\x20'+_0x27ef79[_0x1d6e81(0x276)]][_0x1d6e81(0x164)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a39_0x1430a8(0x1e7)]='workflow:timeline';['description']=a39_0x1430a8(0x258);async[a39_0x1430a8(0x1c3)](_0x5b446d){const _0xebea04=a39_0x1430a8,{options:_0x583cdd,args:_0x56dd4d,tdx:_0x476041}=_0x5b446d;let _0x43125f,_0x23768a,_0xe4a97=![];if(_0x56dd4d[0x0]){if(_0x56dd4d[0x0][_0xebea04(0x167)]('.')){const _0xf0dfac=this[_0xebea04(0x12d)](_0x56dd4d,_0x583cdd);if(!_0xf0dfac)return 0x1;_0x43125f=_0xf0dfac[_0xebea04(0x130)],_0x23768a=_0xf0dfac[_0xebea04(0x1f9)];}else{_0x23768a=_0x56dd4d[0x0],_0x43125f=_0x583cdd[_0xebea04(0x1e3)];if(!_0x43125f)return console[_0xebea04(0x19b)](a39_0x5e8019[_0xebea04(0x16d)](_0xebea04(0x13a)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0xe4a97=!![];}}else{const _0x2e262b=this[_0xebea04(0x12d)](_0x56dd4d,_0x583cdd);if(!_0x2e262b)return 0x1;_0x43125f=_0x2e262b[_0xebea04(0x130)],_0x23768a=_0x2e262b[_0xebea04(0x1f9)];}if(_0x583cdd[_0xebea04(0x219)]){if(_0x43125f&&_0x23768a)console[_0xebea04(0x19b)]('Filter:\x20'+_0x43125f+'.'+_0x23768a);else _0x43125f&&console['error']('Filter:\x20project='+_0x43125f);}const _0xb22c7c=_0x583cdd[_0xebea04(0x169)],_0x2ef89a=_0x583cdd['sessionId'];if(_0xb22c7c){_0x2ef89a&&console[_0xebea04(0x19b)](a39_0x5e8019['yellow'](_0xebea04(0x14a)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0xe4edfb=_0x583cdd[_0xebea04(0x20d)];return _0xe4edfb?await this['pollTimeline'](_0x5b446d,_0xb22c7c):await this[_0xebea04(0x20e)](_0x5b446d,_0xb22c7c,_0x583cdd),0x0;}if(_0x2ef89a){const _0x2d02ba=await withSpinner(_0xebea04(0x1ab),()=>_0x476041[_0xebea04(0x16c)][_0xebea04(0x22f)]({'projectName':_0x43125f,'workflowName':_0x23768a,'limit':0x64}),{'verbose':_0x583cdd[_0xebea04(0x219)]}),_0x4c8b24=_0x2d02ba['data'][_0xebea04(0x160)](_0x499571=>_0x499571['id']===_0x2ef89a);if(!_0x4c8b24)return console['error'](a39_0x5e8019[_0xebea04(0x16d)](_0xebea04(0x13a)),_0xebea04(0x101)+_0x2ef89a),0x1;if(!_0x4c8b24['lastAttempt']?.['id'])return console[_0xebea04(0x19b)](a39_0x5e8019[_0xebea04(0x16d)](_0xebea04(0x13a)),_0xebea04(0x1e8)+_0x2ef89a+_0xebea04(0x13f)),0x1;const _0x27910a=_0x4c8b24[_0xebea04(0x253)]['id'];_0x583cdd[_0xebea04(0x219)]&&console[_0xebea04(0x19b)]('Using\x20attempt\x20'+_0x27910a+'\x20from\x20session\x20'+_0x2ef89a);const _0x554151=_0x583cdd[_0xebea04(0x20d)];return _0x554151?await this[_0xebea04(0x170)](_0x5b446d,_0x27910a):await this[_0xebea04(0x20e)](_0x5b446d,_0x27910a,_0x583cdd),0x0;}const _0x5cd7e1=await withSpinner(_0xebea04(0x1f6),()=>_0x476041[_0xebea04(0x16c)][_0xebea04(0x22f)]({'projectName':_0x43125f,'workflowName':_0x23768a,'limit':_0x583cdd[_0xebea04(0x201)]||0x32}),{'verbose':_0x583cdd[_0xebea04(0x219)]}),_0x11c131=_0x5cd7e1[_0xebea04(0x1a9)];if(_0x11c131[_0xebea04(0x124)]===0x0){if(_0x43125f&&_0x23768a)console[_0xebea04(0x19b)]('No\x20sessions\x20found\x20for:\x20'+_0x43125f+'.'+_0x23768a);else _0x43125f?console['error']('No\x20sessions\x20found\x20in\x20project:\x20'+_0x43125f):(console[_0xebea04(0x19b)]('No\x20workflow\x20sessions\x20found'),console[_0xebea04(0x19b)](a39_0x5e8019['dim'](_0xebea04(0x174))));return 0x0;}_0x11c131['sort']((_0x2a68e5,_0x4fde2c)=>{const _0x44e098=_0xebea04,_0x15a095=_0x2a68e5[_0x44e098(0xfc)]||'',_0x1ac90d=_0x4fde2c[_0x44e098(0xfc)]||'';return _0x1ac90d['localeCompare'](_0x15a095);});if(_0x583cdd[_0xebea04(0x282)]||_0x583cdd[_0xebea04(0x268)])return await handleSDKOutput(_0x11c131,_0x583cdd),0x0;let _0x24f46d;if(_0xe4a97){const _0x485cc6=_0x11c131[0x0];if(!_0x485cc6['lastAttempt']?.['id'])return console[_0xebea04(0x19b)](_0xebea04(0x156)),0x0;_0x24f46d=_0x485cc6[_0xebea04(0x253)]['id'],_0x583cdd['verbose']&&console['error']('Auto-selected\x20latest\x20session:\x20'+_0x485cc6[_0xebea04(0xfc)]);}else{const _0xbb00a8=_0x11c131[_0xebea04(0x265)](_0x31a3dd=>{const _0x35bb8a=_0xebea04,_0x20ccef=getAttemptStatusDisplay(_0x31a3dd['lastAttempt']);return{'title':_0x31a3dd[_0x35bb8a(0x1df)]?.[_0x35bb8a(0x1e7)]+'.'+_0x31a3dd[_0x35bb8a(0x16c)]?.[_0x35bb8a(0x1e7)]+_0x35bb8a(0x28b)+_0x31a3dd[_0x35bb8a(0xfc)]+'\x20'+_0x20ccef['icon'],'value':_0x31a3dd[_0x35bb8a(0x253)]?.['id']||'','description':_0x20ccef[_0x35bb8a(0x106)]};}),_0x11ddef=await a39_0x269b13({'type':_0xebea04(0x14d),'name':_0xebea04(0x169),'message':_0xebea04(0x291),'choices':_0xbb00a8[_0xebea04(0x287)](_0x3baa92=>_0x3baa92[_0xebea04(0x278)]!=='')});if(!_0x11ddef['attemptId'])return 0x0;_0x24f46d=_0x11ddef[_0xebea04(0x169)];}const _0x172f99=_0x583cdd[_0xebea04(0x20d)];return _0x172f99?await this[_0xebea04(0x170)](_0x5b446d,_0x24f46d):await this[_0xebea04(0x20e)](_0x5b446d,_0x24f46d,_0x583cdd),0x0;}async[a39_0x1430a8(0x20e)](_0x3e590c,_0x3cf13f,_0x12b716){const _0x284a6d=a39_0x1430a8,{tdx:_0x15bb96}=_0x3e590c;let _0x130437,_0x589fa1;try{[_0x130437,_0x589fa1]=await Promise[_0x284a6d(0x22b)]([_0x15bb96[_0x284a6d(0x16c)]['attempt'](_0x3cf13f),_0x15bb96['workflow'][_0x284a6d(0x13b)](_0x3cf13f,![])]);}catch(_0x4fb490){console[_0x284a6d(0x19b)](a39_0x5e8019[_0x284a6d(0x16d)](_0x284a6d(0x1ec)));_0x12b716['verbose']&&console[_0x284a6d(0x19b)](_0x4fb490);throw _0x4fb490;}if(_0x12b716[_0x284a6d(0x282)]||_0x12b716['jsonl']){const _0x4e3926=this[_0x284a6d(0x256)](_0x130437,_0x589fa1);await handleSDKOutput([_0x4e3926],_0x12b716);return;}const _0x1490b8=_0x15bb96[_0x284a6d(0x236)][_0x284a6d(0x1c1)],_0x50a85d=this['renderTimeline'](_0x130437,_0x589fa1,_0x1490b8);console['log'](_0x50a85d);}async[a39_0x1430a8(0x170)](_0x496997,_0x29c019){const _0x31625d=a39_0x1430a8,{tdx:_0x4562c3}=_0x496997,_0x34321a=TIMELINE_CONFIG[_0x31625d(0x259)],_0x512efc=TIMELINE_CONFIG[_0x31625d(0x273)];let _0x3a32c1=0x0;while(_0x3a32c1<_0x512efc){process['stdout']['isTTY']&&process[_0x31625d(0x21f)][_0x31625d(0x21e)]('\x1bc');let _0x19ebdf,_0x5c774e;try{[_0x19ebdf,_0x5c774e]=await Promise['all']([_0x4562c3['workflow'][_0x31625d(0x25e)](_0x29c019),_0x4562c3['workflow'][_0x31625d(0x13b)](_0x29c019,![])]);}catch(_0x4fcdd5){console[_0x31625d(0x19b)](a39_0x5e8019['red'](_0x31625d(0x1b7)));_0x3a32c1>0x0&&console['error'](a39_0x5e8019['dim']('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x3a32c1));throw _0x4fcdd5;}const _0x38fdcc=_0x4562c3[_0x31625d(0x236)]['site'],_0x5503d0=this['renderTimeline'](_0x19ebdf,_0x5c774e,_0x38fdcc);console['log'](_0x5503d0);const _0xaca701=_0x19ebdf[_0x31625d(0x190)]&&_0x5c774e[_0x31625d(0x260)](_0x54910b=>_0x54910b[_0x31625d(0x246)]!==_0x31625d(0x1ed)&&_0x54910b[_0x31625d(0x246)]!=='planned');if(_0xaca701){console[_0x31625d(0x19b)](a39_0x5e8019[_0x31625d(0x10c)](_0x31625d(0x102)));break;}console[_0x31625d(0x19b)](a39_0x5e8019[_0x31625d(0x20a)]('\x0aPolling...\x20('+_0x3a32c1*0x2+_0x31625d(0x178))),await new Promise(_0x12e90d=>setTimeout(_0x12e90d,_0x34321a)),_0x3a32c1++;}_0x3a32c1>=_0x512efc&&console[_0x31625d(0x19b)](a39_0x5e8019[_0x31625d(0x116)]('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}['renderTimeline'](_0x291835,_0x258e20,_0x36e3f9){const _0x2dd620=a39_0x1430a8,_0x52c490=[],_0x35f46d=TIMELINE_CONFIG[_0x2dd620(0x283)],_0x41145b=0x5,_0x24a4f4=process['stdout'][_0x2dd620(0x1da)]||0x78,_0x1abd6a=_0x24a4f4-_0x35f46d-_0x41145b,_0x1b1821=Math[_0x2dd620(0x1e6)](TIMELINE_CONFIG[_0x2dd620(0x233)],Math[_0x2dd620(0x197)](_0x1abd6a,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x325b4e=new Date(_0x291835[_0x2dd620(0x264)])['getTime'](),_0x5ae349=_0x291835[_0x2dd620(0x119)]?new Date(_0x291835[_0x2dd620(0x119)])[_0x2dd620(0x28c)]():Date[_0x2dd620(0x166)](),_0x1c64c9={'start':_0x325b4e,'end':_0x5ae349,'duration':_0x5ae349-_0x325b4e},_0x4af87c=new Map(),_0x55b7e7=[];for(const _0x5e8fc0 of _0x258e20){if(_0x5e8fc0[_0x2dd620(0x1bd)]){const _0x39010f=new Date(_0x5e8fc0[_0x2dd620(0x1bd)])[_0x2dd620(0x28c)](),_0x5b0acb=_0x5e8fc0['updatedAt']?new Date(_0x5e8fc0[_0x2dd620(0x1cf)])[_0x2dd620(0x28c)]():Date[_0x2dd620(0x166)](),_0x474f9d={'start':_0x39010f,'end':_0x5b0acb,'duration':_0x5b0acb-_0x39010f};_0x4af87c['set'](_0x5e8fc0['id'],_0x474f9d),_0x55b7e7[_0x2dd620(0x204)]({'name':_0x5e8fc0[_0x2dd620(0x211)],'state':_0x5e8fc0[_0x2dd620(0x246)]||_0x2dd620(0x143),'window':_0x474f9d});}else _0x55b7e7[_0x2dd620(0x204)]({'name':_0x5e8fc0[_0x2dd620(0x211)],'state':_0x5e8fc0[_0x2dd620(0x246)]||_0x2dd620(0x157),'window':undefined});}_0x55b7e7['sort']((_0x546c89,_0x84a709)=>{const _0x3e5fa9=_0x2dd620;if(!_0x546c89[_0x3e5fa9(0x1a7)])return 0x1;if(!_0x84a709[_0x3e5fa9(0x1a7)])return-0x1;return _0x546c89[_0x3e5fa9(0x1a7)][_0x3e5fa9(0x15f)]-_0x84a709['window']['start'];});const _0x5669d3=_0x55b7e7[_0x2dd620(0x124)],_0x252d80=_0x5669d3>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x252d80&&_0x55b7e7[_0x2dd620(0x266)](TIMELINE_CONFIG[_0x2dd620(0x19d)]);const _0x456fa6=calculateTimeScale(_0x1c64c9,_0x1b1821),_0x307d2b=_0x291835[_0x2dd620(0x190)]?_0x291835[_0x2dd620(0x21b)]?a39_0x5e8019['green'](_0x2dd620(0x21b)):a39_0x5e8019[_0x2dd620(0x16d)](_0x2dd620(0x19b)):a39_0x5e8019['blue']('running'),_0xc52b48=_0x291835[_0x2dd620(0x1df)]?.['id'],_0x2d5a2b=_0x291835['sessionId'];let _0x3f6618;if(_0xc52b48&&_0x2d5a2b){const _0x49ef88=getWorkflowAttemptUrl(_0x36e3f9,_0xc52b48,_0x2d5a2b,_0x291835['id']);_0x3f6618=hyperlink(a39_0x5e8019[_0x2dd620(0x20a)](_0x291835['id']),_0x49ef88);}else _0x3f6618=a39_0x5e8019[_0x2dd620(0x20a)](_0x291835['id']);_0x52c490[_0x2dd620(0x204)](_0x2dd620(0x1de)+_0x3f6618+_0x2dd620(0x28b)+_0x307d2b+_0x2dd620(0x28b)+formatElapsed(_0x1c64c9[_0x2dd620(0x151)]));if(_0x55b7e7[_0x2dd620(0x124)]>0x0){const _0xe9b40b=renderTimeAxis(_0x456fa6,_0x1b1821),_0x24c194=new Date(_0x1c64c9['start']),_0x5da65e=formatDate(_0x24c194),_0x1bb737=TIMELINE_CONFIG[_0x2dd620(0x207)]+TIMELINE_CONFIG[_0x2dd620(0x17b)]+_0x35f46d,_0x22105e=_0x5da65e[_0x2dd620(0x210)](_0x1bb737),_0x5efaff=a39_0x5e8019['dim'](_0x22105e);_0x52c490[_0x2dd620(0x204)](_0x5efaff+'\x20'+_0xe9b40b);for(const _0x525377 of _0x55b7e7){_0x52c490['push'](renderTaskRow(_0x525377,_0x456fa6,_0x1b1821,_0x35f46d));}const _0x41d103=calculateStats(_0x55b7e7);_0x52c490[_0x2dd620(0x204)](formatStats(_0x41d103)),_0x252d80&&_0x52c490['push'](a39_0x5e8019[_0x2dd620(0x116)](_0x2dd620(0x1bc)+TIMELINE_CONFIG[_0x2dd620(0x19d)]+_0x2dd620(0x1f3)+_0x5669d3+'\x20tasks')),_0x52c490[_0x2dd620(0x204)](''),_0x52c490[_0x2dd620(0x204)](a39_0x5e8019[_0x2dd620(0x20a)](_0x2dd620(0x1cd))+(_0x2dd620(0x270)+_0x291835['id']+_0x2dd620(0x24f))+a39_0x5e8019[_0x2dd620(0x20a)](_0x2dd620(0x1c7)));}else _0x52c490[_0x2dd620(0x204)](_0x2dd620(0x142));return _0x52c490[_0x2dd620(0x164)]('\x0a');}['buildTimelineData'](_0x5c7dc7,_0x11154d){const _0x5d15b2=a39_0x1430a8,_0x4be6c2=new Date(_0x5c7dc7[_0x5d15b2(0x264)])[_0x5d15b2(0x28c)](),_0x25b895=_0x5c7dc7[_0x5d15b2(0x119)]?new Date(_0x5c7dc7[_0x5d15b2(0x119)])[_0x5d15b2(0x28c)]():Date[_0x5d15b2(0x166)](),_0x11414b=_0x25b895-_0x4be6c2,_0xfa8ab0=[];for(const _0x3a5db5 of _0x11154d){if(_0x3a5db5[_0x5d15b2(0x1bd)]){const _0x300ba9=new Date(_0x3a5db5[_0x5d15b2(0x1bd)])[_0x5d15b2(0x28c)](),_0x580364=_0x3a5db5[_0x5d15b2(0x1cf)]?new Date(_0x3a5db5[_0x5d15b2(0x1cf)])['getTime']():Date[_0x5d15b2(0x166)]();_0xfa8ab0[_0x5d15b2(0x204)]({'name':_0x3a5db5[_0x5d15b2(0x211)],'state':_0x3a5db5[_0x5d15b2(0x246)]||'unknown','window':{'start':_0x300ba9,'end':_0x580364,'duration':_0x580364-_0x300ba9}});}else _0xfa8ab0[_0x5d15b2(0x204)]({'name':_0x3a5db5[_0x5d15b2(0x211)],'state':_0x3a5db5[_0x5d15b2(0x246)]||_0x5d15b2(0x157),'window':undefined});}const _0x7c829f=calculateStats(_0xfa8ab0);return{'attempt':{'id':_0x5c7dc7['id'],'status':_0x5c7dc7[_0x5d15b2(0x190)]?_0x5c7dc7[_0x5d15b2(0x21b)]?_0x5d15b2(0x21b):_0x5d15b2(0x19b):'running','createdAt':_0x5c7dc7[_0x5d15b2(0x264)],'finishedAt':_0x5c7dc7[_0x5d15b2(0x119)],'duration_ms':_0x11414b},'tasks':_0xfa8ab0[_0x5d15b2(0x265)](_0x1d56c3=>({'name':_0x1d56c3[_0x5d15b2(0x1e7)],'state':_0x1d56c3['state'],'startedAt':_0x1d56c3[_0x5d15b2(0x1a7)]?new Date(_0x1d56c3['window'][_0x5d15b2(0x15f)])[_0x5d15b2(0x1a1)]():null,'updatedAt':_0x1d56c3[_0x5d15b2(0x1a7)]?new Date(_0x1d56c3[_0x5d15b2(0x1a7)]['end'])[_0x5d15b2(0x1a1)]():null,'duration_ms':_0x1d56c3[_0x5d15b2(0x1a7)]?.[_0x5d15b2(0x151)]||null})),'stats':_0x7c829f};}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1126b5,_0x5debde){const _0x45a291=a40_0x494a,_0x43c8f7=_0x1126b5();while(!![]){try{const _0x40fd21=-parseInt(_0x45a291(0x1db))/0x1+parseInt(_0x45a291(0x1e9))/0x2*(-parseInt(_0x45a291(0x1e6))/0x3)+-parseInt(_0x45a291(0x1df))/0x4+-parseInt(_0x45a291(0x1dd))/0x5+parseInt(_0x45a291(0x1e0))/0x6*(parseInt(_0x45a291(0x1e2))/0x7)+-parseInt(_0x45a291(0x1dc))/0x8*(-parseInt(_0x45a291(0x1d7))/0x9)+parseInt(_0x45a291(0x1d8))/0xa;if(_0x40fd21===_0x5debde)break;else _0x43c8f7['push'](_0x43c8f7['shift']());}catch(_0x5534d3){_0x43c8f7['push'](_0x43c8f7['shift']());}}}(a40_0x3d96,0x5a850));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x2cbc2e=a40_0x494a,_0x1224b2=getVersion(),_0x5ec2e3=platform(),_0x41914f=process[_0x2cbc2e(0x1e5)][_0x2cbc2e(0x1e3)]('v','');return _0x2cbc2e(0x1e8)+_0x1224b2+'\x20('+_0x5ec2e3+_0x2cbc2e(0x1e1)+_0x41914f+')';}function a40_0x494a(_0x591986,_0x4b6764){_0x591986=_0x591986-0x1d7;const _0x3d96f2=a40_0x3d96();let _0x494ac=_0x3d96f2[_0x591986];return _0x494ac;}export function getAuthHeaders(_0x49f07d,_0x3fc157){const _0x14ccbc=a40_0x494a,_0x4f76c5=getVersion(),_0x1cee36={'User-Agent':getUserAgent(),'X-TD-Client':_0x14ccbc(0x1e4),'X-TD-Client-Version':_0x4f76c5};return _0x3fc157&&(_0x1cee36[_0x14ccbc(0x1e7)]=_0x14ccbc(0x1da)+_0x3fc157),_0x1cee36;}export function toHeaderRecord(_0x4926fb){const _0x2cc670=a40_0x494a,_0x4596cf={};for(const [_0x10a1f7,_0x113412]of Object[_0x2cc670(0x1d9)](_0x4926fb)){_0x113412!==undefined&&(_0x4596cf[_0x10a1f7]=_0x113412);}return _0x4596cf;}export function getTrinoHeaders(_0x2bcc28,_0x203821){const _0x1a7393=a40_0x494a,_0x3cb380=getAuthHeaders(_0x2bcc28,_0x203821),_0x245d4a=toHeaderRecord(_0x3cb380);return delete _0x245d4a[_0x1a7393(0x1e7)],_0x203821&&(_0x245d4a['X-Trino-User']=_0x203821),_0x245d4a;}export function hasAPIKey(_0x4b1a9a){const _0x26b0a2=a40_0x494a,_0x169262=getAPIKey(_0x4b1a9a);return _0x169262!==undefined&&_0x169262[_0x26b0a2(0x1de)]>0x0;}function a40_0x3d96(){const _0x1dfbf5=['8GZoMHK','1586060bSnzCn','length','852180AXiYAU','12axiGCI',';\x20node/','293230kJLxPY','replace','tdx','version','231576fEtVOm','Authorization','tdx/','18KthMoU','3797865XPwOEM','12282560sOaVrA','entries','TD1\x20','138268zbuGtU'];a40_0x3d96=function(){return _0x1dfbf5;};return a40_0x3d96();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4192f6,_0x1259b8){const _0x2bdb1c=a41_0x13fa,_0x395521=_0x4192f6();while(!![]){try{const _0x7068c2=parseInt(_0x2bdb1c(0xeb))/0x1+parseInt(_0x2bdb1c(0xec))/0x2+-parseInt(_0x2bdb1c(0xca))/0x3+-parseInt(_0x2bdb1c(0xb6))/0x4+-parseInt(_0x2bdb1c(0xcb))/0x5*(-parseInt(_0x2bdb1c(0xf6))/0x6)+parseInt(_0x2bdb1c(0xcc))/0x7*(-parseInt(_0x2bdb1c(0xc5))/0x8)+-parseInt(_0x2bdb1c(0xdd))/0x9*(parseInt(_0x2bdb1c(0xbd))/0xa);if(_0x7068c2===_0x1259b8)break;else _0x395521['push'](_0x395521['shift']());}catch(_0x247568){_0x395521['push'](_0x395521['shift']());}}}(a41_0xbd76,0xbd60b));import{writeFileSync}from'fs';function a41_0x13fa(_0x552a58,_0x8b81f){_0x552a58=_0x552a58-0xb2;const _0xbd76b8=a41_0xbd76();let _0x13fa50=_0xbd76b8[_0x552a58];return _0x13fa50;}import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a41_0x427623 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x3b7916){const _0x18b82c=a41_0x13fa;return _0x3b7916[_0x18b82c(0xb7)]===_0x18b82c(0xdc)||_0x3b7916[_0x18b82c(0xb7)]===_0x18b82c(0xb5)||_0x3b7916[_0x18b82c(0xb7)]===_0x18b82c(0xf4)||_0x3b7916[_0x18b82c(0xb7)]===_0x18b82c(0xda)||_0x3b7916[_0x18b82c(0xdc)]===!![]||_0x3b7916['jsonl']===!![]||_0x3b7916['tsv']===!![]||_0x3b7916[_0x18b82c(0xda)]===!![];}export function parseOutputOptions(_0x50e2a2){const _0x514c65=a41_0x13fa;return{'format':_0x50e2a2[_0x514c65(0xb7)]||_0x514c65(0xda),'output':_0x50e2a2[_0x514c65(0xc0)]||'','limit':_0x50e2a2['limit'],'color':_0x50e2a2[_0x514c65(0xe6)],'noColor':_0x50e2a2[_0x514c65(0xc3)]};}function convertSDKResultToQueryResult(_0x56e311){const _0x20d489=a41_0x13fa,_0x1ceb7d=[];if(_0x56e311[_0x20d489(0xdb)]>0x0){const _0x352095=_0x56e311[0x0];for(const [_0x5e3f2d,_0x51789b]of Object[_0x20d489(0xc2)](_0x352095)){let _0xcc6fbb=_0x20d489(0xc9);if(typeof _0x51789b===_0x20d489(0xe3))_0xcc6fbb=Number[_0x20d489(0xd2)](_0x51789b)?'bigint':_0x20d489(0xd8);else{if(typeof _0x51789b===_0x20d489(0xf3))_0xcc6fbb=_0x20d489(0xf3);else _0x51789b===null&&(_0xcc6fbb=_0x20d489(0xc9));}_0x1ceb7d[_0x20d489(0xf5)]({'name':_0x5e3f2d,'type':_0xcc6fbb});}}return{'queryId':'sdk-result','columns':_0x1ceb7d,'data':_0x56e311,'stats':{'state':_0x20d489(0xf8),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x56e311[_0x20d489(0xdb)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x573181,_0x3198a6){const _0x25b320=convertSDKResultToQueryResult(_0x573181);return formatQueryOutput(_0x25b320,_0x3198a6);}export async function formatQueryOutput(_0x28954c,_0x4a46f9){const _0x3fc51f=a41_0x13fa,{format:_0x1b9908,limit:_0x57909c,output:_0x518fe4,color:_0x540ad7,noColor:_0x5a6897}=_0x4a46f9,_0x1b7fe3=Boolean(_0x518fe4)&&!_0x540ad7,_0x48c33c={'color':_0x540ad7,'noColor':_0x5a6897||_0x1b7fe3};if(_0x1b9908===_0x3fc51f(0xda)){const _0x58bc5d=shouldUseLess(_0x1b9908,_0x518fe4);return formatAsTable(_0x28954c,_0x57909c,_0x58bc5d,_0x48c33c);}else{if(_0x1b9908===_0x3fc51f(0xdc))return formatAsJSON(_0x28954c,_0x48c33c);else return _0x1b9908===_0x3fc51f(0xb5)?formatAsJSONL(_0x28954c,_0x48c33c):formatQueryResult(_0x28954c,_0x1b9908);}}function shouldUseLess(_0x43f84e,_0x4e56e2){const _0xa4a960=a41_0x13fa;return(_0x43f84e===_0xa4a960(0xda)||_0x43f84e===_0xa4a960(0xed))&&process[_0xa4a960(0xe2)][_0xa4a960(0xc7)]&&!_0x4e56e2;}function a41_0xbd76(){const _0x46a1c5=['342kuPdxZ','repeat','FINISHED','resolve','limit','query','jsonl','3385724gBwsyZ','format','bold','inherit','less','cmdout','blue','20aNmgch','[rule]','string','output','error','entries','noColor','trim','4594904tgxhEJ','[query]','isTTY','magenta','varchar','1730511tmsvKs','117175iORavp','14aBBKMh','split','─┬─','object','No\x20data','[logs]','isInteger','map','keys','spawn','write','─┴─','double','debug','table','length','json','2174373WexgRW','params','stdin','end','log','stdout','number','rule','forEach','color','[error]','max','pipe','Results\x20saved\x20to\x20','1303655UbnEXH','2382858RWHQuC','list','join','stderr','stringify','red','padEnd','boolean','tsv','push'];a41_0xbd76=function(){return _0x46a1c5;};return a41_0xbd76();}export function resolveOutputOptions(_0xe7e3fe){const _0x3deaed=a41_0x13fa,_0xb7cf94=resolveOutputFormat(_0xe7e3fe[_0x3deaed(0xb7)],_0xe7e3fe['output'],'table');let _0x43a937=typeof _0xe7e3fe[_0x3deaed(0xb3)]==='number'?_0xe7e3fe[_0x3deaed(0xb3)]:parseInt(_0xe7e3fe['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0xfa00d2=_0xe7e3fe[_0x3deaed(0xc0)]||'';return shouldUseLess(_0xb7cf94,_0xfa00d2)&&(_0x43a937=Infinity),{'format':_0xb7cf94,'output':_0xfa00d2,'limit':_0x43a937,'color':_0xe7e3fe[_0x3deaed(0xe6)],'noColor':_0xe7e3fe[_0x3deaed(0xc3)]};}export function writeOutput(_0x5cfbeb,_0x48b7e8,_0x9895a6){const _0x371a1=a41_0x13fa;return _0x48b7e8?(writeFileSync(_0x48b7e8,_0x5cfbeb),console['error'](_0x371a1(0xea)+_0x48b7e8),Promise[_0x371a1(0xb2)]()):shouldUseLess(_0x9895a6||'','')?new Promise(_0x1ccb85=>{const _0x9412cf=_0x371a1,_0x26dddc=spawn(_0x9412cf(0xba),['-FXRSn'],{'stdio':[_0x9412cf(0xe9),_0x9412cf(0xb9),_0x9412cf(0xb9)]});let _0x4e4f80=![];_0x26dddc['on']('error',()=>{const _0x51490b=_0x9412cf;!_0x4e4f80&&(_0x4e4f80=!![],console[_0x51490b(0xe1)](_0x5cfbeb),_0x1ccb85());}),_0x26dddc['on']('close',()=>{!_0x4e4f80&&(_0x4e4f80=!![],_0x1ccb85());}),_0x26dddc['on'](_0x9412cf(0xd5),()=>{const _0x394180=_0x9412cf;!_0x4e4f80&&_0x26dddc[_0x394180(0xdf)]&&(_0x26dddc[_0x394180(0xdf)]['on'](_0x394180(0xc1),()=>{}),_0x26dddc[_0x394180(0xdf)][_0x394180(0xd6)](_0x5cfbeb),_0x26dddc[_0x394180(0xdf)][_0x394180(0xe0)]());}),!_0x26dddc[_0x9412cf(0xdf)]&&(!_0x4e4f80&&(_0x4e4f80=!![],console[_0x9412cf(0xe1)](_0x5cfbeb),_0x1ccb85()));}):(console['log'](_0x5cfbeb),Promise[_0x371a1(0xb2)]());}export async function handleSDKOutput(_0x39e949,_0x2b4fe1){const _0x187208=a41_0x13fa,_0x6796a=resolveOutputOptions(_0x2b4fe1),_0x36899a=await formatSDKOutput(_0x39e949,_0x6796a);await writeOutput(_0x36899a,_0x6796a[_0x187208(0xc0)]||undefined,_0x6796a[_0x187208(0xb7)]);}export async function handleQueryOutput(_0x6082dc,_0x24cdec){const _0x594b69=a41_0x13fa,_0x380a4e=resolveOutputOptions(_0x24cdec),_0x527c35=await formatQueryOutput(_0x6082dc,_0x380a4e);await writeOutput(_0x527c35,_0x380a4e[_0x594b69(0xc0)]||undefined,_0x380a4e[_0x594b69(0xb7)]);}async function formatSingleObject(_0x1bfa23,_0x9f1b07){const _0x1dacc1=a41_0x13fa,{format:_0x1aeb3a,color:_0x26247c,noColor:_0x56a197}=_0x9f1b07,_0x5ea563={'color':_0x26247c,'noColor':_0x56a197};if(_0x1aeb3a==='json'){if(shouldUseColor(_0x5ea563))return colorizeJSON(_0x1bfa23,_0x5ea563);return JSON[_0x1dacc1(0xf0)](_0x1bfa23,null,0x2);}else{if(_0x1aeb3a===_0x1dacc1(0xb5)){if(shouldUseColor(_0x5ea563))return colorizeJSONCompact(_0x1bfa23,_0x5ea563);return JSON[_0x1dacc1(0xf0)](_0x1bfa23);}else{if(_0x1aeb3a===_0x1dacc1(0xf4))return Object[_0x1dacc1(0xc2)](_0x1bfa23)[_0x1dacc1(0xd3)](([_0x596b44,_0x474f1c])=>_0x596b44+'\x09'+_0x474f1c)[_0x1dacc1(0xee)]('\x0a');else{const _0x5316f2=Object[_0x1dacc1(0xc2)](_0x1bfa23);if(_0x5316f2[_0x1dacc1(0xdb)]===0x0)return _0x1dacc1(0xd0);const _0x24dbb3=_0x1bfa23[_0x1dacc1(0xd9)],_0x209821=_0x1bfa23[_0x1dacc1(0xb4)],_0x475413=_0x1bfa23[_0x1dacc1(0xde)],_0x28178a=_0x1bfa23[_0x1dacc1(0xe4)],_0x34be0b=_0x209821?typeof _0x209821===_0x1dacc1(0xbf)?_0x209821:JSON[_0x1dacc1(0xf0)](_0x209821,null,0x2):undefined,_0x509fdb=_0x475413&&Object[_0x1dacc1(0xd4)](_0x475413)[_0x1dacc1(0xdb)]>0x0?JSON[_0x1dacc1(0xf0)](_0x475413,null,0x2):undefined,_0x31813a=_0x28178a&&Object[_0x1dacc1(0xd4)](_0x28178a)['length']>0x0?JSON[_0x1dacc1(0xf0)](_0x28178a,null,0x2):undefined,_0x4b2632=_0x5316f2['filter'](([_0x2ed219])=>_0x2ed219!==_0x1dacc1(0xd9)&&_0x2ed219!==_0x1dacc1(0xb4)&&_0x2ed219!==_0x1dacc1(0xde)&&_0x2ed219!==_0x1dacc1(0xe4)),_0x57ba7f=Math['max'](..._0x4b2632[_0x1dacc1(0xd3)](([_0x741cb6])=>_0x741cb6[_0x1dacc1(0xdb)])),_0x128163=Math['max'](..._0x4b2632[_0x1dacc1(0xd3)](([,_0x1803d0])=>{const _0x191745=_0x1dacc1;try{const _0x59d93e=_0x1803d0===null||_0x1803d0===undefined?'':typeof _0x1803d0===_0x191745(0xcf)?JSON[_0x191745(0xf0)](_0x1803d0):String(_0x1803d0),_0x9897b9=_0x59d93e['split']('\x0a');return Math[_0x191745(0xe8)](..._0x9897b9[_0x191745(0xd3)](_0x46fc2f=>_0x46fc2f['length']),0x0);}catch{return 0x0;}}),0x14),_0x3a1d37=[];_0x3a1d37[_0x1dacc1(0xf5)](colorBorder('┌─'+'─'[_0x1dacc1(0xf7)](_0x57ba7f)+_0x1dacc1(0xce)+'─'[_0x1dacc1(0xf7)](_0x128163)+'─┐',_0x5ea563)),_0x4b2632[_0x1dacc1(0xe5)](([_0x44b642,_0x27185e])=>{const _0xf75055=_0x1dacc1;let _0x33894d;try{_0x33894d=_0x27185e===null||_0x27185e===undefined?'':typeof _0x27185e===_0xf75055(0xcf)?JSON[_0xf75055(0xf0)](_0x27185e):String(_0x27185e);}catch{_0x33894d='[Object]';}const _0x1f2034=_0x44b642[_0xf75055(0xf2)](_0x57ba7f),_0x5a5297=_0x33894d[_0xf75055(0xcd)]('\x0a');_0x5a5297['forEach']((_0x1e42fb,_0x1d74c7)=>{const _0x5cee3e=_0xf75055,_0x4fd94a=colorBorder('│',_0x5ea563);_0x1d74c7===0x0?_0x3a1d37[_0x5cee3e(0xf5)](_0x4fd94a+'\x20'+_0x1f2034+'\x20'+_0x4fd94a+'\x20'+_0x1e42fb[_0x5cee3e(0xf2)](_0x128163)+'\x20'+_0x4fd94a):_0x3a1d37[_0x5cee3e(0xf5)](_0x4fd94a+'\x20'+'\x20'[_0x5cee3e(0xf7)](_0x57ba7f)+'\x20'+_0x4fd94a+'\x20'+_0x1e42fb[_0x5cee3e(0xf2)](_0x128163)+'\x20'+_0x4fd94a);});}),_0x3a1d37[_0x1dacc1(0xf5)](colorBorder('└─'+'─'[_0x1dacc1(0xf7)](_0x57ba7f)+_0x1dacc1(0xd7)+'─'[_0x1dacc1(0xf7)](_0x128163)+'─┘',_0x5ea563));_0x34be0b&&(_0x3a1d37[_0x1dacc1(0xf5)](''),_0x3a1d37[_0x1dacc1(0xf5)](String(a41_0x427623['yellow'][_0x1dacc1(0xb8)](_0x1dacc1(0xc6)))),_0x3a1d37[_0x1dacc1(0xf5)](_0x34be0b));_0x509fdb&&(_0x3a1d37[_0x1dacc1(0xf5)](''),_0x3a1d37['push'](String(a41_0x427623[_0x1dacc1(0xbc)]['bold']('[params]'))),_0x3a1d37[_0x1dacc1(0xf5)](_0x509fdb));_0x31813a&&(_0x3a1d37[_0x1dacc1(0xf5)](''),_0x3a1d37[_0x1dacc1(0xf5)](String(a41_0x427623[_0x1dacc1(0xc8)]['bold'](_0x1dacc1(0xbe)))),_0x3a1d37[_0x1dacc1(0xf5)](_0x31813a));if(_0x24dbb3){if(_0x24dbb3[_0x1dacc1(0xef)]){_0x3a1d37[_0x1dacc1(0xf5)](''),_0x3a1d37['push'](String(a41_0x427623[_0x1dacc1(0xf1)][_0x1dacc1(0xb8)](_0x1dacc1(0xe7))));const _0x4b374a=_0x24dbb3[_0x1dacc1(0xef)][_0x1dacc1(0xcd)]('\x0a');_0x4b374a[_0x1dacc1(0xe5)](_0x58b79b=>{const _0x2c1235=_0x1dacc1;_0x58b79b[_0x2c1235(0xc4)]()&&_0x3a1d37[_0x2c1235(0xf5)](_0x58b79b);});}if(_0x24dbb3[_0x1dacc1(0xbb)]){_0x3a1d37['push'](''),_0x3a1d37[_0x1dacc1(0xf5)](String(a41_0x427623['cyan']['bold'](_0x1dacc1(0xd1))));const _0x30fffc=_0x24dbb3[_0x1dacc1(0xbb)]['split']('\x0a');_0x30fffc[_0x1dacc1(0xe5)](_0x5a1e9d=>{const _0x2c4838=_0x1dacc1;_0x5a1e9d[_0x2c4838(0xc4)]()&&_0x3a1d37[_0x2c4838(0xf5)](_0x5a1e9d);});}}return _0x3a1d37[_0x1dacc1(0xee)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x220f35,_0x1e8961){const _0x4e7ef8=a41_0x13fa;if(_0x1e8961['format']===_0x4e7ef8(0xda)){await handleSDKOutput([_0x220f35],_0x1e8961);return;}const _0x2c836f=resolveOutputOptions(_0x1e8961),_0x224dc4=await formatSingleObject(_0x220f35,_0x2c836f);await writeOutput(_0x224dc4,_0x2c836f[_0x4e7ef8(0xc0)]||undefined,_0x2c836f[_0x4e7ef8(0xb7)]);}
|
|
1
|
+
(function(_0x4189ad,_0x3788e3){const _0x5db833=a41_0x2cbf,_0x442aaf=_0x4189ad();while(!![]){try{const _0xcdd373=-parseInt(_0x5db833(0x1d1))/0x1+-parseInt(_0x5db833(0x1dd))/0x2*(parseInt(_0x5db833(0x1a3))/0x3)+parseInt(_0x5db833(0x1a9))/0x4+parseInt(_0x5db833(0x1af))/0x5*(parseInt(_0x5db833(0x1b0))/0x6)+parseInt(_0x5db833(0x1bd))/0x7*(parseInt(_0x5db833(0x1e4))/0x8)+-parseInt(_0x5db833(0x1c6))/0x9*(parseInt(_0x5db833(0x1a4))/0xa)+parseInt(_0x5db833(0x1d7))/0xb*(parseInt(_0x5db833(0x1e8))/0xc);if(_0xcdd373===_0x3788e3)break;else _0x442aaf['push'](_0x442aaf['shift']());}catch(_0x59418e){_0x442aaf['push'](_0x442aaf['shift']());}}}(a41_0x4319,0x1bcac));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 a41_0x5aa65f from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x10a46c){const _0x31f006=a41_0x2cbf;return _0x10a46c[_0x31f006(0x1e1)]===_0x31f006(0x1df)||_0x10a46c[_0x31f006(0x1e1)]===_0x31f006(0x1ba)||_0x10a46c[_0x31f006(0x1e1)]===_0x31f006(0x1e5)||_0x10a46c[_0x31f006(0x1e1)]===_0x31f006(0x1ca)||_0x10a46c[_0x31f006(0x1df)]===!![]||_0x10a46c[_0x31f006(0x1ba)]===!![]||_0x10a46c['tsv']===!![]||_0x10a46c[_0x31f006(0x1ca)]===!![];}export function parseOutputOptions(_0x38c1ad){const _0x5a79b3=a41_0x2cbf;return{'format':_0x38c1ad['format']||_0x5a79b3(0x1ca),'output':_0x38c1ad[_0x5a79b3(0x1b1)]||'','limit':_0x38c1ad['limit'],'color':_0x38c1ad['color'],'noColor':_0x38c1ad[_0x5a79b3(0x1b4)]};}function a41_0x2cbf(_0x1a3136,_0x1cc397){_0x1a3136=_0x1a3136-0x1a2;const _0x4319d7=a41_0x4319();let _0x2cbf93=_0x4319d7[_0x1a3136];return _0x2cbf93;}function convertSDKResultToQueryResult(_0x2b664e){const _0x26432b=a41_0x2cbf,_0x595e8e=[];if(_0x2b664e[_0x26432b(0x1ad)]>0x0){const _0x14a5cf=_0x2b664e[0x0];for(const [_0x2c49ee,_0x437f48]of Object[_0x26432b(0x1d6)](_0x14a5cf)){let _0x421b82=_0x26432b(0x1bf);if(typeof _0x437f48===_0x26432b(0x1c2))_0x421b82=Number['isInteger'](_0x437f48)?_0x26432b(0x1a7):_0x26432b(0x1bb);else{if(typeof _0x437f48===_0x26432b(0x1c0))_0x421b82='boolean';else _0x437f48===null&&(_0x421b82='varchar');}_0x595e8e[_0x26432b(0x1d4)]({'name':_0x2c49ee,'type':_0x421b82});}}return{'queryId':_0x26432b(0x1e9),'columns':_0x595e8e,'data':_0x2b664e,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x2b664e['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x388919,_0x1fe512){const _0x1486af=convertSDKResultToQueryResult(_0x388919);return formatQueryOutput(_0x1486af,_0x1fe512);}export async function formatQueryOutput(_0x57c99d,_0xe1e81e){const _0x5af51a=a41_0x2cbf,{format:_0x1c422e,limit:_0x2b62b0,output:_0x3f5bf4,color:_0x798b4b,noColor:_0x46eec2}=_0xe1e81e,_0x4ec4ba=Boolean(_0x3f5bf4)&&!_0x798b4b,_0x3dca1f={'color':_0x798b4b,'noColor':_0x46eec2||_0x4ec4ba};if(_0x1c422e===_0x5af51a(0x1ca)){const _0x1876bd=shouldUseLess(_0x1c422e,_0x3f5bf4);return formatAsTable(_0x57c99d,_0x2b62b0,_0x1876bd,_0x3dca1f);}else{if(_0x1c422e===_0x5af51a(0x1df))return formatAsJSON(_0x57c99d,_0x3dca1f);else return _0x1c422e===_0x5af51a(0x1ba)?formatAsJSONL(_0x57c99d,_0x3dca1f):formatQueryResult(_0x57c99d,_0x1c422e);}}function shouldUseLess(_0x150da0,_0x2cae5c){const _0x3bf7fc=a41_0x2cbf;return(_0x150da0===_0x3bf7fc(0x1ca)||_0x150da0===_0x3bf7fc(0x1d0))&&process[_0x3bf7fc(0x1de)][_0x3bf7fc(0x1db)]&&!_0x2cae5c;}export function resolveOutputOptions(_0x3b733e){const _0x52fcf6=a41_0x2cbf,_0x1d2bc1=resolveOutputFormat(_0x3b733e['format'],_0x3b733e[_0x52fcf6(0x1b1)],'table');let _0x1e7714=typeof _0x3b733e['limit']===_0x52fcf6(0x1c2)?_0x3b733e[_0x52fcf6(0x1ac)]:parseInt(_0x3b733e['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x9fe8f4=_0x3b733e['output']||'';return shouldUseLess(_0x1d2bc1,_0x9fe8f4)&&(_0x1e7714=Infinity),{'format':_0x1d2bc1,'output':_0x9fe8f4,'limit':_0x1e7714,'color':_0x3b733e[_0x52fcf6(0x1d3)],'noColor':_0x3b733e[_0x52fcf6(0x1b4)]};}export function writeOutput(_0x21e264,_0x3379a9,_0x204c6b){const _0x5435a8=a41_0x2cbf;return _0x3379a9?(writeFileSync(_0x3379a9,_0x21e264),console[_0x5435a8(0x1b2)](_0x5435a8(0x1c1)+_0x3379a9),Promise[_0x5435a8(0x1ae)]()):shouldUseLess(_0x204c6b||'','')?new Promise(_0x3cf940=>{const _0x24773b=_0x5435a8,_0x23d634=spawn('less',['-FXRSn'],{'stdio':['pipe','inherit','inherit']});let _0x2ae5c7=![];_0x23d634['on'](_0x24773b(0x1b2),()=>{const _0x505e46=_0x24773b;!_0x2ae5c7&&(_0x2ae5c7=!![],console[_0x505e46(0x1a5)](_0x21e264),_0x3cf940());}),_0x23d634['on'](_0x24773b(0x1a6),()=>{!_0x2ae5c7&&(_0x2ae5c7=!![],_0x3cf940());}),_0x23d634['on'](_0x24773b(0x1b8),()=>{const _0x443f33=_0x24773b;!_0x2ae5c7&&_0x23d634[_0x443f33(0x1e6)]&&(_0x23d634[_0x443f33(0x1e6)]['on'](_0x443f33(0x1b2),()=>{}),_0x23d634[_0x443f33(0x1e6)][_0x443f33(0x1dc)](_0x21e264),_0x23d634['stdin'][_0x443f33(0x1aa)]());}),!_0x23d634['stdin']&&(!_0x2ae5c7&&(_0x2ae5c7=!![],console[_0x24773b(0x1a5)](_0x21e264),_0x3cf940()));}):(console['log'](_0x21e264),Promise[_0x5435a8(0x1ae)]());}export async function handleSDKOutput(_0x219d46,_0x26905b){const _0x3775f9=a41_0x2cbf,_0x53a2d7=resolveOutputOptions(_0x26905b),_0x5366b4=await formatSDKOutput(_0x219d46,_0x53a2d7);await writeOutput(_0x5366b4,_0x53a2d7[_0x3775f9(0x1b1)]||undefined,_0x53a2d7[_0x3775f9(0x1e1)]);}export async function handleQueryOutput(_0x539b96,_0x714edd){const _0x145637=a41_0x2cbf,_0x51220f=resolveOutputOptions(_0x714edd),_0x38896b=await formatQueryOutput(_0x539b96,_0x51220f);await writeOutput(_0x38896b,_0x51220f[_0x145637(0x1b1)]||undefined,_0x51220f['format']);}async function formatSingleObject(_0x565bac,_0x33a4c2){const _0x1b6531=a41_0x2cbf,{format:_0x3813a2,color:_0x32c714,noColor:_0x369046}=_0x33a4c2,_0x426781={'color':_0x32c714,'noColor':_0x369046};if(_0x3813a2===_0x1b6531(0x1df)){if(shouldUseColor(_0x426781))return colorizeJSON(_0x565bac,_0x426781);return JSON[_0x1b6531(0x1d2)](_0x565bac,null,0x2);}else{if(_0x3813a2===_0x1b6531(0x1ba)){if(shouldUseColor(_0x426781))return colorizeJSONCompact(_0x565bac,_0x426781);return JSON['stringify'](_0x565bac);}else{if(_0x3813a2===_0x1b6531(0x1e5))return Object[_0x1b6531(0x1d6)](_0x565bac)[_0x1b6531(0x1c8)](([_0x4fe60b,_0x875434])=>_0x4fe60b+'\x09'+_0x875434)[_0x1b6531(0x1a2)]('\x0a');else{const _0xf1e61f=Object['entries'](_0x565bac);if(_0xf1e61f[_0x1b6531(0x1ad)]===0x0)return _0x1b6531(0x1cb);const _0x48a358=_0x565bac[_0x1b6531(0x1e7)],_0x42f037=_0x565bac[_0x1b6531(0x1b9)],_0x20777b=_0x565bac[_0x1b6531(0x1b7)],_0x3b6317=_0x565bac[_0x1b6531(0x1c4)],_0x167249=_0x42f037?typeof _0x42f037==='string'?_0x42f037:JSON[_0x1b6531(0x1d2)](_0x42f037,null,0x2):undefined,_0x55aeb7=_0x20777b&&Object[_0x1b6531(0x1cc)](_0x20777b)[_0x1b6531(0x1ad)]>0x0?JSON[_0x1b6531(0x1d2)](_0x20777b,null,0x2):undefined,_0x871b7=_0x3b6317&&Object['keys'](_0x3b6317)['length']>0x0?JSON[_0x1b6531(0x1d2)](_0x3b6317,null,0x2):undefined,_0xf25ce4=_0xf1e61f[_0x1b6531(0x1cf)](([_0xaa3046])=>_0xaa3046!==_0x1b6531(0x1e7)&&_0xaa3046!==_0x1b6531(0x1b9)&&_0xaa3046!==_0x1b6531(0x1b7)&&_0xaa3046!==_0x1b6531(0x1c4)),_0xfac5d7=Math[_0x1b6531(0x1be)](..._0xf25ce4[_0x1b6531(0x1c8)](([_0x108853])=>_0x108853['length'])),_0x16f324=Math[_0x1b6531(0x1be)](..._0xf25ce4[_0x1b6531(0x1c8)](([,_0x45d0bc])=>{const _0xfc160e=_0x1b6531;try{const _0x103057=_0x45d0bc===null||_0x45d0bc===undefined?'':typeof _0x45d0bc===_0xfc160e(0x1b6)?JSON[_0xfc160e(0x1d2)](_0x45d0bc):String(_0x45d0bc),_0x9325a0=_0x103057[_0xfc160e(0x1bc)]('\x0a');return Math[_0xfc160e(0x1be)](..._0x9325a0[_0xfc160e(0x1c8)](_0x58c317=>_0x58c317[_0xfc160e(0x1ad)]),0x0);}catch{return 0x0;}}),0x14),_0x1619c0=[];_0x1619c0['push'](colorBorder('┌─'+'─'['repeat'](_0xfac5d7)+_0x1b6531(0x1e0)+'─'[_0x1b6531(0x1d5)](_0x16f324)+'─┐',_0x426781)),_0xf25ce4[_0x1b6531(0x1c9)](([_0x363e33,_0x36402f])=>{const _0x2bf528=_0x1b6531;let _0x23fe74;try{_0x23fe74=_0x36402f===null||_0x36402f===undefined?'':typeof _0x36402f==='object'?JSON[_0x2bf528(0x1d2)](_0x36402f):String(_0x36402f);}catch{_0x23fe74='[Object]';}const _0x2649b2=_0x363e33[_0x2bf528(0x1c3)](_0xfac5d7),_0x32fa46=_0x23fe74[_0x2bf528(0x1bc)]('\x0a');_0x32fa46[_0x2bf528(0x1c9)]((_0x5f480f,_0x55cd35)=>{const _0x24ef39=_0x2bf528,_0x8029b2=colorBorder('│',_0x426781);_0x55cd35===0x0?_0x1619c0[_0x24ef39(0x1d4)](_0x8029b2+'\x20'+_0x2649b2+'\x20'+_0x8029b2+'\x20'+_0x5f480f['padEnd'](_0x16f324)+'\x20'+_0x8029b2):_0x1619c0[_0x24ef39(0x1d4)](_0x8029b2+'\x20'+'\x20'['repeat'](_0xfac5d7)+'\x20'+_0x8029b2+'\x20'+_0x5f480f[_0x24ef39(0x1c3)](_0x16f324)+'\x20'+_0x8029b2);});}),_0x1619c0['push'](colorBorder('└─'+'─'['repeat'](_0xfac5d7)+_0x1b6531(0x1c7)+'─'[_0x1b6531(0x1d5)](_0x16f324)+'─┘',_0x426781));_0x167249&&(_0x1619c0['push'](''),_0x1619c0['push'](String(a41_0x5aa65f[_0x1b6531(0x1ea)][_0x1b6531(0x1c5)](_0x1b6531(0x1cd)))),_0x1619c0[_0x1b6531(0x1d4)](_0x167249));_0x55aeb7&&(_0x1619c0[_0x1b6531(0x1d4)](''),_0x1619c0[_0x1b6531(0x1d4)](String(a41_0x5aa65f['blue'][_0x1b6531(0x1c5)](_0x1b6531(0x1ce)))),_0x1619c0[_0x1b6531(0x1d4)](_0x55aeb7));_0x871b7&&(_0x1619c0['push'](''),_0x1619c0[_0x1b6531(0x1d4)](String(a41_0x5aa65f[_0x1b6531(0x1d8)][_0x1b6531(0x1c5)](_0x1b6531(0x1e3)))),_0x1619c0[_0x1b6531(0x1d4)](_0x871b7));if(_0x48a358){if(_0x48a358[_0x1b6531(0x1d9)]){_0x1619c0[_0x1b6531(0x1d4)](''),_0x1619c0[_0x1b6531(0x1d4)](String(a41_0x5aa65f[_0x1b6531(0x1b5)]['bold'](_0x1b6531(0x1a8))));const _0x1b4987=_0x48a358[_0x1b6531(0x1d9)]['split']('\x0a');_0x1b4987[_0x1b6531(0x1c9)](_0x44f9d5=>{const _0x3ea617=_0x1b6531;_0x44f9d5['trim']()&&_0x1619c0[_0x3ea617(0x1d4)](_0x44f9d5);});}if(_0x48a358[_0x1b6531(0x1b3)]){_0x1619c0[_0x1b6531(0x1d4)](''),_0x1619c0[_0x1b6531(0x1d4)](String(a41_0x5aa65f[_0x1b6531(0x1e2)][_0x1b6531(0x1c5)](_0x1b6531(0x1ab))));const _0x365edb=_0x48a358[_0x1b6531(0x1b3)][_0x1b6531(0x1bc)]('\x0a');_0x365edb['forEach'](_0x2523af=>{const _0xda1342=_0x1b6531;_0x2523af[_0xda1342(0x1da)]()&&_0x1619c0[_0xda1342(0x1d4)](_0x2523af);});}}return _0x1619c0[_0x1b6531(0x1a2)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x16ff42,_0x1ba54e){const _0x1d46a8=a41_0x2cbf;if(_0x1ba54e[_0x1d46a8(0x1e1)]==='table'){await handleSDKOutput([_0x16ff42],_0x1ba54e);return;}const _0x455081=resolveOutputOptions(_0x1ba54e),_0x2887ca=await formatSingleObject(_0x16ff42,_0x455081);await writeOutput(_0x2887ca,_0x455081[_0x1d46a8(0x1b1)]||undefined,_0x455081[_0x1d46a8(0x1e1)]);}function a41_0x4319(){const _0x50f488=['max','varchar','boolean','Results\x20saved\x20to\x20','number','padEnd','rule','bold','1062261WjFKgw','─┴─','map','forEach','table','No\x20data','keys','[query]','[params]','filter','list','137440FGjpxT','stringify','color','push','repeat','entries','110kUgPqD','magenta','stderr','trim','isTTY','write','2vkugnU','stdout','json','─┬─','format','cyan','[rule]','20056yQTRGp','tsv','stdin','debug','154716UpcFKe','sdk-result','yellow','join','200649StUvJu','10DYDVXk','log','close','bigint','[error]','479468EzdjOq','end','[logs]','limit','length','resolve','290VtNHCI','5640lsodGi','output','error','cmdout','noColor','red','object','params','spawn','query','jsonl','double','split','371OVROjM'];a41_0x4319=function(){return _0x50f488;};return a41_0x4319();}
|