@treasuredata/tdx 2026.4.7 → 2026.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-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/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.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-validator.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-recovery.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/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.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/types/workspace.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/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.d.ts +2 -0
- package/dist/sdk/workspace/access-tracker.d.ts.map +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/access-tracker.js.map +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.d.ts +2 -0
- package/dist/sdk/workspace/index.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.d.ts +3 -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.d.ts +10 -2
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/version-check.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a54_0x49055a=a54_0x5887;(function(_0x4a13bc,_0x1a44e0){const _0x1d49b1=a54_0x5887,_0xf551c3=_0x4a13bc();while(!![]){try{const _0x36c247=parseInt(_0x1d49b1(0x227))/0x1*(-parseInt(_0x1d49b1(0x189))/0x2)+parseInt(_0x1d49b1(0x264))/0x3+parseInt(_0x1d49b1(0x1a3))/0x4+parseInt(_0x1d49b1(0x126))/0x5*(parseInt(_0x1d49b1(0x190))/0x6)+parseInt(_0x1d49b1(0x15b))/0x7+parseInt(_0x1d49b1(0x250))/0x8+parseInt(_0x1d49b1(0x244))/0x9*(-parseInt(_0x1d49b1(0x255))/0xa);if(_0x36c247===_0x1a44e0)break;else _0xf551c3['push'](_0xf551c3['shift']());}catch(_0x59dcf2){_0xf551c3['push'](_0xf551c3['shift']());}}}(a54_0x37b1,0xcdc3f));import a54_0x4da4e1 from'chalk';import{existsSync}from'fs';import a54_0x2de0d1 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';function a54_0x37b1(){const _0x5b91ac=['cwd','-\x20nothing\x20pushed','workflow:schedule:enable','param','\x20\x20New\x20attempt\x20ID:\x20','text','keys','join','\x20tasks','✔\x20Workflow\x20run\x20started','Start\x20a\x20workflow\x20run','requireProject','workflow','sourceProjectName','\x22\x20to\x20new\x20project\x20\x22','\x20\x20Source:\x20','/sessions/','rows','Source:\x20','Dry\x20run:\x20yes','workflow:schedules','No\x20log\x20content\x20found','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','localeCompare','Downloading\x20logs...','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','workflow:pull','From\x20task:\x20','sessionTime','\x20logs','projectId','deleted','description','✔\x20Project\x20updated','yes','path','Getting\x20attempt\x20details...','getTime','\x0a✔\x20No\x20changes\x20to\x20push','toLocaleString','Project\x20name:\x20','renderTimeline','disableSchedule','\x20\x20Workflow:\x20','\x0aApply\x20these\x20changes?','Error:','Validation:\x20skipped','getMinutes','projects','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','Disable\x20a\x20workflow\x20schedule','248612oFYixJ','MAX_TASKS_DISPLAY','workflow:push','getDate','slice','Error:\x20Project\x20name\x20is\x20required','✔\x20Project:\x20','group_error','\x0aPolling...\x20(','MAX_TIMELINE_WIDTH','Task\x20name:\x20','output','tdx.json','\x20\x20Revision:\x20','splice','Retrying\x20attempt...','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Listing\x20secrets...','dryRun','sourceDir','Loading\x20session...','Revision:\x20','cyan','diff','workflow:secrets:delete','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','Source\x20directory\x20is\x20required','\x20next:\x20','✔\x20Schedule\x20#','Attempt\x20ID:\x20','disabledAt','attempt:','sessions','fill','status','split','lastAttempt','Using\x20attempt\x20','state','workflow:sessions','\x20session','stringify','Status:\x20','match','round','size','3328246XZtolU','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','getFullYear','Cancelled','key','renderSingleTimeline','reason','6PLoWhE','Session\x20not\x20found:\x20','\x20to\x20see\x20detailed\x20logs','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','unchanged','projectName','unknown','json','\x20of\x20','workflow:run','No\x20sessions\x20found\x20for:\x20','displayLine','\x20\x20tdx\x20wf\x20use\x20<project>','data','List\x20workflow\x20execution\x20sessions','No\x20workflow\x20projects\x20found','\x0aDry\x20run\x20-\x20nothing\x20pushed','ICON_SPACING','Session\x20time:\x20','3985964XuhYRl','Include\x20retried:\x20yes','hasChanges','\x20-\x20','generateSessionTimelineRows','\x0aUpdate\x20existing\x20project\x20\x22','columns','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','No\x20sessions\x20with\x20timing\x20information','\x20new','verbose','log','MIN_TIMELINE_WIDTH','\x0aPush\x20these\x20changes?','workflowProject','workflow:secrets:list','max','canceling','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','✔\x20Pushed\x20','\x20\x20Location:\x20','error','changes','value','executeCloneProject','Writing\x20files...','table','limit','listSchedules','isDirectory','\x20modified','substring','List\x20workflows','trim','session','✔\x20Push\x20complete','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','No\x20sessions\x20found\x20in\x20project:\x20','targetExists','finishedAt','all','find','Attempt:\x20','sys','No\x20workflows\x20found\x20in\x20project:\x20','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','site','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','task','stat','No\x20attempts\x20found\x20for:\x20','push','end','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','startsWith','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','params','Filter:\x20','padStart','write','Warning:','\x0aDry\x20run\x20-\x20no\x20project\x20created','Tip:\x20cd\x20to\x20workflows/','ICON_WIDTH','planned','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','workflows','Kill\x20a\x20running\x20attempt','\x0a✔\x20Already\x20up\x20to\x20date','\x20\x20Next\x20run:\x20','retrySession','pollTimeline','✔\x20Deleted\x20project\x20','modified','attemptId','workflow:workflows','\x20attempt','Show\x20tasks\x20for\x20an\x20attempt','/app/workflows/','\x0aDry\x20run\x20-\x20no\x20files\x20written','icon','nextRunTime','follow','message','workflow:attempt','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','clear','Secrets\x20to\x20set:\x20','Target:\x20','success','basename','some','Select\x20a\x20session\x20to\x20view\x20timeline:','attempt','Resume\x20from:\x20','Fetching\x20log\x20files...','listSecrets','MAX_POLL_ITERATIONS','existingProjectId','retryAttempt','newProjectId','\x20\x20Project\x20ID:\x20','💡\x20Tip:\x20Use\x20','toISOString','\x20deleted','✔\x20Downloaded\x20','Error:\x20Attempt\x20ID\x20is\x20required','\x20secrets\x20set\x20for\x20project\x20\x27','type','readFile','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Output\x20directory:\x20','Resolving\x20project\x20\x27','taskName','📋\x20','List\x20workflow\x20schedules','Setting\x20secret...','parseProjectWorkflowPattern','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Analyzing\x20project...','blue','🔄\x20','isArray','includeSubtasks','startTime','List\x20workflow\x20attempts','LABEL_MIN_SPACING','Killing\x20attempt...','1osfBPa','\x0a⚠\x20Project\x20\x22','GUTTER','logs','retryAttemptName','applyPullProject','List\x20all\x20workflow\x20projects','\x20\x20Session\x20ID:\x20','Retry\x20a\x20session\x20or\x20attempt','targetDir','total','LABEL_WIDTH_DIVISOR','✔\x20Found\x20','set','\x0a✔\x20Attempt\x20complete','→\x20Project:\x20','Pull\x20workflow\x20project\x20to\x20local\x20folder','sort','New\x20project\x20name:\x20','repeat','Select\x20a\x20workflow\x20to\x20run','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','min','Project\x20name\x20is\x20required','(unknown)','attempts','done','relative','72rYOZmx','format','Auto-selected\x20latest\x20session:\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','window','Show\x20specific\x20attempt\x20details','✔\x20Secret\x20\x27','Starting\x20workflow\x20run...','new','Params:\x20','stdout','---\x20','6001464hNLXzR','showWorkflowConsoleUrl','\x20enabled\x20(','Listing\x20workflows...','summary','1075070GWdwju','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','revision:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','toLowerCase','isTTY','resolve','now','resolveProjectDir','\x20schedule','workflow:projects','createdAt','executePushProject','\x20unchanged','157752KPHAPn','\x20\x20Attempt\x20ID:\x20','\x20\x20Session\x20context\x20set\x20to:\x20','includes','\x20has\x20no\x20attempts','floor','Retrying\x20session...','jsonl','\x20(use\x20--limit\x20to\x20show\x20more)','workflow:clone','newProjectName','context','workflowName','Key\x20cannot\x20be\x20empty','msPerChar','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','tasks','Project:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','\x0aClone\x20\x22','Analyzing\x20changes...','duration','📁\x20','\x27\x20from\x20project\x20\x27','red','get','getMonth','Pulling\x20project\x20','✔\x20Retry\x20started','Reason:\x20','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','project','workflow:kill','Downloading\x20project\x20','\x22\x20already\x20exists\x20(ID:\x20','trimEnd','isNewProject','\x20\x20Files\x20extracted:\x20','updatedAt','\x22?\x20This\x20cannot\x20be\x20undone.','Select\x20a\x20task\x20to\x20view\x20logs:','resolveProject','Parameters:\x20','Deleting\x20secret...','name','No\x20workflows\x20found','length','workflow:delete','yellow','session:','startedAt','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','list','filter','\x20\x20Target:\x20','...','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','sessionId','No\x20sessions\x20found','MIN_LABEL_COUNT','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','No\x20projects\x20match\x20pattern:\x20','Enabling\x20schedule\x20#','fs/promises','dim','revision','has','(use\x20--limit\x20to\x20see\x20more)','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','map','skipValidation','session_id','indexOf','Disabling\x20schedule\x20#','workflow:tasks','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','preparePushProject','workflow:logs','navigateSessionsInteractive','execute','Invalid\x20format:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','white','Schedule\x20ID\x20is\x20required','\x1b[1A\x1b[2K','Deleting\x20project\x20','\x20secret','Loading\x20workflows...','renderSessionsTimeline','index','\x20workflow','running','fullName','\x20\x20Project:\x20','buildTimelineData','Source\x20directory:\x20','⚠\x20Showing\x20first\x20','kill','\x20secrets...','Project\x20directory:\x20','MAX_LABEL_COUNT','Expected\x20format:\x20--param\x20key=value','Failed\x20to\x20fetch\x20attempt\x20data','start','Error:\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Updating\x20','filesExtracted','green','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','cancelRequested','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','No\x20attempts\x20found\x20in\x20project:\x20','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','Error:\x20Invalid\x20parameter\x20format:\x20','\x0aError:','Project\x20filter:\x20','7661100xKmpCD'];a54_0x37b1=function(){return _0x5b91ac;};return a54_0x37b1();}import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a54_0x5887(_0x486c14,_0x575f9d){_0x486c14=_0x486c14-0xfa;const _0x37b1cf=a54_0x37b1();let _0x58872b=_0x37b1cf[_0x486c14];return _0x58872b;}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 a54_0x29f2c3 from'prompts';function getAttemptStatusDisplay(_0x12eb2b){const _0x21492e=a54_0x5887;if(!_0x12eb2b)return{'icon':'⏳','text':''};const {done:_0x3db4c6,success:_0xc03e97,cancelRequested:_0x1acff8}=_0x12eb2b;if(!_0x3db4c6)return _0x1acff8?{'icon':'🛑','text':a54_0x4da4e1[_0x21492e(0x294)](_0x21492e(0x1b4))}:{'icon':'🔄','text':a54_0x4da4e1[_0x21492e(0x21f)]('running')};if(_0xc03e97)return{'icon':'✅','text':a54_0x4da4e1[_0x21492e(0x11d)](_0x21492e(0x200))};return{'icon':'❌','text':a54_0x4da4e1['red']('error')};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x49055a(0x28d)](_0x3cc8a1,_0x4f484b,_0x1ee0a2=0x0){const _0x4f22b6=a54_0x49055a;return _0x3cc8a1[_0x1ee0a2]||_0x4f484b[_0x4f22b6(0x1b1)];}[a54_0x49055a(0x132)](_0x2135fa,_0x2b550c,_0x37f7f1=0x0){const _0x4554a3=a54_0x49055a,_0x4277ac=this[_0x4554a3(0x28d)](_0x2135fa,_0x2b550c,_0x37f7f1);if(!_0x4277ac)return console['error'](a54_0x4da4e1[_0x4554a3(0x27c)](_0x4554a3(0x154)),'Project\x20name\x20is\x20required'),console['error'](a54_0x4da4e1[_0x4554a3(0x2a4)](_0x4554a3(0x140))),null;return _0x4277ac;}[a54_0x49055a(0x21c)](_0x22730e,_0x3cf931){const _0x2af191=a54_0x49055a;if(_0x22730e[0x0]){const _0x523565=_0x22730e[0x0][_0x2af191(0x17e)]('.');if(_0x523565[_0x2af191(0x292)]===0x1)return{'projectName':_0x523565[0x0],'workflowName':undefined};else return _0x523565['length']===0x2?{'projectName':_0x523565[0x0],'workflowName':_0x523565[0x1]}:(console[_0x2af191(0x1ba)](a54_0x4da4e1['red'](_0x2af191(0x154)),_0x2af191(0x1e7)),null);}return{'projectName':_0x3cf931[_0x2af191(0x1b1)],'workflowName':undefined};}[a54_0x49055a(0x25e)](_0x36cf1d,_0x3b06f1,_0xad76e0=0x0){const _0x3c2e09=a54_0x49055a;if(_0x36cf1d[_0xad76e0])return _0x36cf1d[_0xad76e0];if(_0x3b06f1[_0x3c2e09(0x1b1)]){const _0x27640f=a54_0x2de0d1[_0x3c2e09(0x12e)](process[_0x3c2e09(0x127)](),_0x3c2e09(0x1e9),_0x3b06f1[_0x3c2e09(0x1b1)]);if(existsSync(a54_0x2de0d1['join'](_0x27640f,_0x3c2e09(0x167))))return _0x27640f;}return undefined;}async['showWorkflowConsoleUrl'](_0x388734,_0x37a497,_0x3c1bff){const _0x5e76f1=a54_0x49055a;try{const _0x37aaaa=await _0x388734[_0x5e76f1(0x133)]['workflows'](_0x37a497,{'limit':0x1});if(_0x37aaaa['length']>0x0){const _0x50ed32=_0x37aaaa[0x0]['id'],_0x52b6c2=getWorkflowUrl(_0x3c1bff,_0x50ed32);console['error']('\x20\x20Console:\x20'+a54_0x4da4e1['cyan'](_0x52b6c2));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a54_0x49055a(0x290)]='workflow:use';[a54_0x49055a(0x147)]='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async['execute'](_0x2f5ceb){const _0x49b704=a54_0x49055a,{options:_0x43ecd6,args:_0x47190c,tdx:_0x1080aa}=_0x2f5ceb,_0x238fe6=_0x47190c[0x0],_0x598dd8=_0x43ecd6[_0x49b704(0x1fd)];if(_0x598dd8)return saveSessionContext({'workflow_project':undefined},_0x43ecd6['session']),console[_0x49b704(0x1ae)](a54_0x4da4e1[_0x49b704(0x11d)]('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x238fe6)return console[_0x49b704(0x1ba)](a54_0x4da4e1[_0x49b704(0x27c)](_0x49b704(0x154)),_0x49b704(0x23f)),console[_0x49b704(0x1ba)](a54_0x4da4e1['dim']('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x49b704(0x1ba)](a54_0x4da4e1[_0x49b704(0x2a4)](_0x49b704(0x276))),0x1;const _0x290b59=await withSpinner(_0x49b704(0x217)+_0x238fe6+'\x27...',()=>_0x1080aa[_0x49b704(0x133)]['resolveProjectId'](_0x238fe6),{'verbose':_0x43ecd6[_0x49b704(0x1ad)]}),{name:_0xa5e5ec}=_0x290b59['data'];return saveSessionContext({'workflow_project':_0xa5e5ec},_0x43ecd6['session']),console[_0x49b704(0x1ae)](a54_0x4da4e1[_0x49b704(0x11d)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a54_0x4da4e1[_0x49b704(0x171)](_0xa5e5ec))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x49055a(0x290)]=a54_0x49055a(0x260);['description']=a54_0x49055a(0x22d);async[a54_0x49055a(0x100)](_0x15e2d3){const _0xf1619d=a54_0x49055a,{options:_0x1f85f8,args:_0x10e9ec,tdx:_0x37e9ed}=_0x15e2d3,_0xaf014d=_0x10e9ec[0x0];_0x1f85f8[_0xf1619d(0x1ad)]&&_0xaf014d&&console[_0xf1619d(0x1ba)]('Pattern:\x20'+_0xaf014d);const _0x96e841=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x37e9ed[_0xf1619d(0x133)][_0xf1619d(0x157)](_0xaf014d,{'limit':_0x1f85f8['limit']}),{'verbose':_0x1f85f8['verbose']});let _0xa98b0=_0x96e841['data'];_0xa98b0[_0xf1619d(0x238)]((_0x236841,_0x2b5347)=>_0x236841[_0xf1619d(0x290)]['localeCompare'](_0x2b5347['name']));const _0x15dfa9=_0x1f85f8['limit']||0x64,_0x2b172c=_0xa98b0['length']>=_0x15dfa9?a54_0x4da4e1['dim'](_0xf1619d(0x26c)):'';console[_0xf1619d(0x1ba)](_0xf1619d(0x233)+_0xa98b0[_0xf1619d(0x292)]+'\x20project'+(_0xa98b0[_0xf1619d(0x292)]!==0x1?'s':'')+_0x2b172c);if(_0x1f85f8['format']===_0xf1619d(0x197)||_0x1f85f8[_0xf1619d(0x245)]==='jsonl'||_0x1f85f8[_0xf1619d(0x245)]===_0xf1619d(0x1bf))await handleSDKOutput(_0xa98b0,_0x1f85f8);else{if(_0xa98b0[_0xf1619d(0x292)]===0x0)_0xaf014d?console['log'](_0xf1619d(0x2a1)+_0xaf014d):console[_0xf1619d(0x1ae)](_0xf1619d(0x19f));else{const _0x66d2e8=_0xa98b0['map'](_0x24d62b=>{const _0x507f1f=_0xf1619d,_0x3fd5d4=_0x24d62b['metadata']?.[_0x507f1f(0x202)](_0x336066=>_0x336066[_0x507f1f(0x18d)]===_0x507f1f(0x1d0)),_0x4521dd=_0x3fd5d4?a54_0x4da4e1[_0x507f1f(0x2a4)]('\x20(system)'):'';return _0x507f1f(0x27a)+_0x24d62b[_0x507f1f(0x290)]+_0x4521dd;});await writeOutput(_0x66d2e8[_0xf1619d(0x12e)]('\x0a'),_0x1f85f8['output'],'list');}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a54_0x49055a(0x1f2);[a54_0x49055a(0x147)]=a54_0x49055a(0x1c5);async['execute'](_0x42752a){const _0x4835ce=a54_0x49055a,{options:_0x20f857,args:_0x5869b2,tdx:_0x3abb84}=_0x42752a,_0x22b8ea=this[_0x4835ce(0x28d)](_0x5869b2,_0x20f857);_0x20f857['verbose']&&_0x22b8ea&&console[_0x4835ce(0x1ba)](_0x4835ce(0x125)+_0x22b8ea);const _0x1d022e=await withSpinner(_0x4835ce(0x253),()=>_0x3abb84[_0x4835ce(0x133)][_0x4835ce(0x1e9)](_0x22b8ea,{'limit':_0x20f857[_0x4835ce(0x1c0)]}),{'verbose':_0x20f857[_0x4835ce(0x1ad)]});let _0x2676dd=_0x1d022e[_0x4835ce(0x19d)];_0x2676dd[_0x4835ce(0x238)]((_0x4c19fc,_0x218a84)=>{const _0x28c544=_0x4835ce,_0x5973ba=_0x4c19fc[_0x28c544(0x290)]['localeCompare'](_0x218a84['name']);if(_0x5973ba!==0x0)return _0x5973ba;return(_0x4c19fc[_0x28c544(0x283)]?.[_0x28c544(0x290)]||'')[_0x28c544(0x13e)](_0x218a84[_0x28c544(0x283)]?.[_0x28c544(0x290)]||'');});const _0x2c740d=_0x20f857[_0x4835ce(0x1c0)]||0x64,_0x46ad96=_0x2676dd[_0x4835ce(0x292)]>=_0x2c740d?a54_0x4da4e1[_0x4835ce(0x2a4)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x4835ce(0x1ba)](_0x4835ce(0x233)+_0x2676dd['length']+_0x4835ce(0x10b)+(_0x2676dd[_0x4835ce(0x292)]!==0x1?'s':'')+_0x46ad96);if(_0x20f857[_0x4835ce(0x245)]==='json'||_0x20f857['format']===_0x4835ce(0x26b)||_0x20f857[_0x4835ce(0x245)]===_0x4835ce(0x1bf))await handleSDKOutput(_0x2676dd,_0x20f857);else{if(_0x2676dd[_0x4835ce(0x292)]===0x0)_0x22b8ea?console[_0x4835ce(0x1ae)](_0x4835ce(0x1d1)+_0x22b8ea):console[_0x4835ce(0x1ae)](_0x4835ce(0x291));else{const _0x4ccbd3=_0x20f857[_0x4835ce(0x1d3)],_0x15be9b=_0x2676dd[_0x4835ce(0x2a9)](_0x44ff94=>{const _0x238af7=_0x4835ce,_0x3b9367=a54_0x4da4e1[_0x238af7(0x2a4)]('#'+_0x44ff94['id']),_0x554201=hyperlink(_0x3b9367,getWorkflowUrl(_0x4ccbd3,_0x44ff94['id'])),_0x4ad68e=_0x44ff94[_0x238af7(0x283)]?.[_0x238af7(0x290)]?a54_0x4da4e1['dim']('\x20('+_0x44ff94[_0x238af7(0x283)][_0x238af7(0x290)]+')'):'';return _0x238af7(0x219)+_0x554201+'\x20'+_0x44ff94[_0x238af7(0x290)]+_0x4ad68e;});await writeOutput(_0x15be9b['join']('\x0a'),_0x20f857[_0x4835ce(0x166)],_0x4835ce(0x298));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']=a54_0x49055a(0x182);[a54_0x49055a(0x147)]=a54_0x49055a(0x19e);async[a54_0x49055a(0x100)](_0x258a20){const _0x2dc6c9=a54_0x49055a,{options:_0x28da12,args:_0x56f77a,tdx:_0x39fa1e}=_0x258a20,_0x471555=this[_0x2dc6c9(0x21c)](_0x56f77a,_0x28da12);if(!_0x471555)return 0x1;const {projectName:_0x30f0cb,workflowName:_0x2b679c}=_0x471555;if(_0x28da12[_0x2dc6c9(0x1ad)]){if(_0x30f0cb&&_0x2b679c)console['error'](_0x2dc6c9(0x1df)+_0x30f0cb+'.'+_0x2b679c);else _0x30f0cb&&console[_0x2dc6c9(0x1ba)]('Filter:\x20project='+_0x30f0cb);const _0x9447=_0x28da12[_0x2dc6c9(0x17d)];_0x9447&&console['error'](_0x2dc6c9(0x185)+_0x9447);}let _0x1b9dc4=0x28;if(process[_0x2dc6c9(0x24e)][_0x2dc6c9(0x25b)]&&!_0x28da12[_0x2dc6c9(0x166)]&&!_0x28da12[_0x2dc6c9(0x245)]){const _0x57986a=process['stdout'][_0x2dc6c9(0x138)]||0x28;_0x1b9dc4=Math['max'](0x14,Math[_0x2dc6c9(0x269)](_0x57986a*0x2/0x3));}const _0x49f0cd=_0x28da12[_0x2dc6c9(0x1c0)]||_0x1b9dc4,_0x31cbb1=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x39fa1e[_0x2dc6c9(0x133)][_0x2dc6c9(0x17b)]({'projectName':_0x30f0cb,'workflowName':_0x2b679c,'status':_0x28da12[_0x2dc6c9(0x17d)],'fromTime':_0x28da12['from'],'toTime':_0x28da12['to'],'limit':_0x49f0cd}),{'verbose':_0x28da12['verbose']}),_0x396b05=_0x31cbb1[_0x2dc6c9(0x19d)];_0x396b05[_0x2dc6c9(0x238)]((_0xea0ab3,_0x117df8)=>{const _0x4a1573=_0x2dc6c9,_0x34e900=_0xea0ab3['sessionTime']||'',_0x902bfa=_0x117df8[_0x4a1573(0x143)]||'';return _0x902bfa[_0x4a1573(0x13e)](_0x34e900);});_0x396b05[_0x2dc6c9(0x292)]>=_0x49f0cd?console[_0x2dc6c9(0x1ba)]('✔\x20Showing\x20'+_0x396b05[_0x2dc6c9(0x292)]+'\x20sessions\x20'+a54_0x4da4e1[_0x2dc6c9(0x2a4)](_0x2dc6c9(0x2a7))):console[_0x2dc6c9(0x1ba)](_0x2dc6c9(0x233)+_0x396b05[_0x2dc6c9(0x292)]+_0x2dc6c9(0x183)+(_0x396b05['length']!==0x1?'s':''));if(_0x28da12['format']===_0x2dc6c9(0x197)||_0x28da12[_0x2dc6c9(0x245)]===_0x2dc6c9(0x26b)||_0x28da12[_0x2dc6c9(0x245)]===_0x2dc6c9(0x1bf))await handleSDKOutput(_0x396b05,_0x28da12);else{if(!process['stdout']['isTTY']||_0x28da12[_0x2dc6c9(0x166)]){if(_0x396b05[_0x2dc6c9(0x292)]===0x0){if(_0x30f0cb&&_0x2b679c)console[_0x2dc6c9(0x1ae)](_0x2dc6c9(0x19a)+_0x30f0cb+'.'+_0x2b679c);else _0x30f0cb?console[_0x2dc6c9(0x1ae)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x30f0cb):console['log'](_0x2dc6c9(0x29e));}else{const _0x158b13=_0x28da12[_0x2dc6c9(0x1d3)],_0x8ca862=this[_0x2dc6c9(0x109)](_0x396b05,_0x158b13);_0x28da12['output']?await writeOutput(_0x8ca862,_0x28da12['output'],_0x2dc6c9(0x298)):console[_0x2dc6c9(0x1ae)](_0x8ca862);}!_0x30f0cb&&(console[_0x2dc6c9(0x1ba)](''),console[_0x2dc6c9(0x1ba)](a54_0x4da4e1['dim']('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x2dc6c9(0x1ba)](a54_0x4da4e1[_0x2dc6c9(0x2a4)](_0x2dc6c9(0x1b7))+'or'+a54_0x4da4e1['dim'](_0x2dc6c9(0x19c))));}else{if(_0x396b05[_0x2dc6c9(0x292)]===0x0){if(_0x30f0cb&&_0x2b679c)console[_0x2dc6c9(0x1ae)](_0x2dc6c9(0x19a)+_0x30f0cb+'.'+_0x2b679c);else _0x30f0cb?console['log']('No\x20sessions\x20found\x20in\x20project:\x20'+_0x30f0cb):console['log'](_0x2dc6c9(0x29e));}else await this[_0x2dc6c9(0xff)](_0x396b05,_0x258a20,_0x30f0cb);}}return 0x0;}[a54_0x49055a(0x109)](_0x5020ff,_0xd72af9){const _0x18f5a2=a54_0x49055a,_0x531599=[],_0x3412b7=new Map();let _0x57453d=Infinity,_0xd3b008=-Infinity;for(const _0x551702 of _0x5020ff){if(_0x551702[_0x18f5a2(0x17f)]?.['createdAt']){const _0x3af838=new Date(_0x551702['lastAttempt'][_0x18f5a2(0x261)])[_0x18f5a2(0x14c)](),_0x441297=_0x551702[_0x18f5a2(0x17f)]['finishedAt']?new Date(_0x551702[_0x18f5a2(0x17f)][_0x18f5a2(0x1cc)])[_0x18f5a2(0x14c)]():Date[_0x18f5a2(0x25d)](),_0xe92702=_0x551702[_0x18f5a2(0x283)]?.['name']||_0x18f5a2(0x240);!_0x3412b7[_0x18f5a2(0x2a6)](_0xe92702)&&_0x3412b7[_0x18f5a2(0x234)](_0xe92702,[]),_0x3412b7[_0x18f5a2(0x27d)](_0xe92702)['push']({'session':_0x551702,'startTime':_0x3af838,'endTime':_0x441297,'duration':_0x441297-_0x3af838}),_0x57453d=Math[_0x18f5a2(0x23e)](_0x57453d,_0x3af838),_0xd3b008=Math[_0x18f5a2(0x1b3)](_0xd3b008,_0x441297);}}if(_0x3412b7[_0x18f5a2(0x188)]===0x0)return _0x18f5a2(0x1ab);const _0x3354c4=process['stdout'][_0x18f5a2(0x1a9)]||0x78,_0x319d1c=0x1e,_0x5f5dea=0x32,_0x20a4d4=0x4,_0x15d7f6=Math[_0x18f5a2(0x23e)](_0x5f5dea,Math['max'](_0x319d1c,Math['floor'](_0x3354c4*0.3))),_0x414d10=_0x3354c4-_0x15d7f6-TIMELINE_CONFIG[_0x18f5a2(0x229)]-0x3-_0x20a4d4,_0x41eaba=_0xd3b008-_0x57453d,_0xd9fabd=_0x41eaba/_0x15d7f6,_0x5802ce=renderTimeAxis({'startTime':_0x57453d,'endTime':_0xd3b008,'durationMs':_0x41eaba,'msPerChar':_0xd9fabd},_0x15d7f6),_0x25d4ed=[];for(const _0x243e09 of _0x3412b7['values']()){_0x25d4ed[_0x18f5a2(0x1d8)](..._0x243e09);}_0x25d4ed[_0x18f5a2(0x238)]((_0x5d4f58,_0x685169)=>_0x685169['startTime']-_0x5d4f58[_0x18f5a2(0x223)]);const _0x50d7cf=new Date(_0x57453d),_0x3493ef=formatDate(_0x50d7cf),_0x1fb620=_0x20a4d4+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x18f5a2(0x1a1)]+_0x414d10,_0x5c487c='\x20'[_0x18f5a2(0x23a)](_0x1fb620-_0x3493ef[_0x18f5a2(0x292)]),_0x4dd2d6=_0x5c487c+a54_0x4da4e1[_0x18f5a2(0x2a4)](_0x3493ef)+'\x20'+_0x5802ce;_0x531599[_0x18f5a2(0x1d8)](_0x4dd2d6);const _0x208bcf=0x16;let _0x367557=0x0;for(const _0x36d963 of _0x25d4ed){const _0x38dd74=_0x36d963[_0x18f5a2(0x1c7)][_0x18f5a2(0x283)]?.[_0x18f5a2(0x290)]||'?',_0x54b45b=Math['min'](stringWidth(_0x38dd74),_0x208bcf);_0x367557=Math[_0x18f5a2(0x1b3)](_0x367557,_0x54b45b);}for(const _0xca495b of _0x25d4ed){const {session:_0x89a02c,startTime:_0xf0cadd,endTime:_0xd16fab,duration:_0x138518}=_0xca495b,_0x580649=_0x89a02c['project']?.['id'],_0x1ea754=_0x89a02c['id'],_0x446627=_0x89a02c['project']?.[_0x18f5a2(0x290)]||'?',_0x3891b3=_0x89a02c[_0x18f5a2(0x133)]?.[_0x18f5a2(0x290)]||'?';let _0x589c0f,_0x18396f;if(_0x89a02c[_0x18f5a2(0x17f)]){const _0x2ca462=_0x89a02c[_0x18f5a2(0x17f)];!_0x2ca462[_0x18f5a2(0x242)]?(_0x589c0f=_0x2ca462[_0x18f5a2(0x11f)]?'🛑':'🔄',_0x18396f=_0x2ca462[_0x18f5a2(0x11f)]?a54_0x4da4e1[_0x18f5a2(0x294)]:a54_0x4da4e1[_0x18f5a2(0x21f)]):(_0x589c0f=_0x2ca462[_0x18f5a2(0x200)]?'✅':'❌',_0x18396f=_0x2ca462['success']?a54_0x4da4e1[_0x18f5a2(0x11d)]:a54_0x4da4e1[_0x18f5a2(0x27c)]);}else _0x589c0f='⏳',_0x18396f=a54_0x4da4e1[_0x18f5a2(0x2a4)];const _0x2d9108='#'+_0x1ea754,_0x32f61d=_0x580649?hyperlink(_0x2d9108,getWorkflowSessionUrl(_0xd72af9,_0x580649,_0x1ea754)):_0x2d9108;let _0x344b8b=_0x446627;stringWidth(_0x446627)>_0x208bcf&&(_0x344b8b=_0x446627['slice'](0x0,_0x208bcf-0x1)+'…');const _0x4e1605=a54_0x4da4e1['dim'](_0x344b8b),_0x3e51b3=stringWidth(_0x344b8b),_0x7b16db='\x20'['repeat'](_0x367557-stringWidth(_0x344b8b)+0x2),_0x5926dd='('+formatElapsed(_0x138518)+')',_0x2ffde5=stringWidth(_0x5926dd),_0x78b36d=stringWidth(_0x2d9108),_0x51a4f5=_0x78b36d+0x1+_0x3e51b3+_0x7b16db['length'],_0x32e1ec=_0x414d10-_0x51a4f5-_0x2ffde5-0x1-0x8;let _0x6cec88=_0x3891b3;stringWidth(_0x6cec88)>_0x32e1ec&&(_0x6cec88=_0x6cec88[_0x18f5a2(0x15f)](0x0,_0x32e1ec-0x1)+'…');const _0x59b997=_0x32f61d+'\x20'+_0x4e1605+_0x7b16db+_0x6cec88,_0x1d5ac9=stringWidth(_0x59b997),_0x2a4c92=_0x414d10-_0x1d5ac9-_0x2ffde5,_0x33cb49=_0x59b997+'\x20'[_0x18f5a2(0x23a)](Math[_0x18f5a2(0x1b3)](0x1,_0x2a4c92))+a54_0x4da4e1[_0x18f5a2(0x2a4)](_0x5926dd),_0x15cec5=Math[_0x18f5a2(0x269)]((_0xf0cadd-_0x57453d)/_0xd9fabd),_0x1a8842=Math['floor']((_0xd16fab-_0x57453d)/_0xd9fabd),_0x54274f=Math[_0x18f5a2(0x1b3)](_0x15cec5+0x1,_0x1a8842),_0x5eeeb8=new Array(_0x15d7f6)[_0x18f5a2(0x17c)]('\x20');for(let _0x173d7e=_0x15cec5;_0x173d7e<Math[_0x18f5a2(0x23e)](_0x54274f,_0x15d7f6);_0x173d7e++){_0x5eeeb8[_0x173d7e]='─';}const _0x462bf7=_0x5eeeb8[_0x18f5a2(0x2a9)](_0x46d160=>_0x46d160==='\x20'?'\x20':_0x18396f(_0x46d160))[_0x18f5a2(0x12e)]('');_0x531599[_0x18f5a2(0x1d8)](_0x589c0f+'\x20'+_0x33cb49+'│'+_0x462bf7+'│');}return _0x531599[_0x18f5a2(0x12e)]('\x0a');}async['navigateSessionsInteractive'](_0x5e9528,_0x3ed456,_0x1e24ca){const _0x2df925=a54_0x49055a,{options:_0x459ab9,tdx:_0x2ddbff}=_0x3ed456,_0x2a3c8b=_0x459ab9['site'],{timelineRows:_0x5b151c,timeAxisHeader:_0xfa5ee1}=this[_0x2df925(0x1a7)](_0x5e9528,_0x2a3c8b),_0x52abd0=_0x5b151c[_0x2df925(0x299)](_0x2a7e5d=>_0x2a7e5d['attemptId']);if(_0x52abd0['length']===0x0){const _0x31b6e6=this[_0x2df925(0x109)](_0x5e9528,_0x2a3c8b);console[_0x2df925(0x1ae)](_0x31b6e6);!_0x1e24ca&&(console[_0x2df925(0x1ba)](''),console[_0x2df925(0x1ba)](a54_0x4da4e1[_0x2df925(0x2a4)](_0x2df925(0x23d))),console[_0x2df925(0x1ba)](a54_0x4da4e1[_0x2df925(0x2a4)](_0x2df925(0x1b7))+'or'+a54_0x4da4e1['dim']('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0xfa5ee1&&console[_0x2df925(0x1ae)](_0xfa5ee1);const _0x3a21e7=_0x5b151c[_0x2df925(0x299)](_0x39f9e3=>_0x39f9e3[_0x2df925(0x1f1)])[_0x2df925(0x2a9)](_0xb1ade=>({'title':_0xb1ade[_0x2df925(0x19b)],'value':_0xb1ade[_0x2df925(0x1f1)]})),_0x35c999=process[_0x2df925(0x24e)][_0x2df925(0x138)]||0x3c,_0x26b9f9=Math[_0x2df925(0x1b3)](0x28,Math[_0x2df925(0x269)](_0x35c999*0x2/0x3)),_0x2be470=await a54_0x29f2c3({'type':'autocomplete','name':_0x2df925(0x1f1),'message':_0x2df925(0x13d),'choices':_0x3a21e7,'initial':-0x1,'limit':_0x26b9f9,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x4975f4,_0x4ff668)=>{const _0x369a60=_0x2df925;if(!_0x4975f4)return Promise['resolve'](_0x4ff668);const _0x1452aa=_0x4ff668[_0x369a60(0x299)](_0x2f73b0=>{const _0x31d011=_0x369a60,_0x2f6762=_0x2f73b0;return _0x2f6762['title'][_0x31d011(0x25a)]()[_0x31d011(0x267)](_0x4975f4[_0x31d011(0x25a)]());});return Promise[_0x369a60(0x25c)](_0x1452aa);}}),_0x4a45e7=()=>{const _0x5b91f6=_0x2df925;process[_0x5b91f6(0x24e)]['write'](_0x5b91f6(0x105)),process[_0x5b91f6(0x24e)]['write'](_0x5b91f6(0x105)),process[_0x5b91f6(0x24e)][_0x5b91f6(0x1e1)](_0x5b91f6(0x105));},_0x44f8eb=_0x2be470&&_0x2be470[_0x2df925(0x1f1)]&&_0x2be470[_0x2df925(0x1f1)]!==null&&_0x2be470[_0x2df925(0x1f1)][_0x2df925(0x1c6)]()!=='';if(!_0x44f8eb){_0x4a45e7(),console['log'](a54_0x4da4e1['dim'](_0x2df925(0x18c)));return;}_0x4a45e7();const _0x5c707d=_0x5e9528[_0x2df925(0x1ce)](_0x419c96=>_0x419c96[_0x2df925(0x17f)]?.['id']===_0x2be470[_0x2df925(0x1f1)]);if(_0x5c707d){const _0x37bfbc=_0x5c707d['project']?.[_0x2df925(0x290)]||'?',_0x4887bc=_0x5c707d['workflow']?.[_0x2df925(0x290)]||'?';console[_0x2df925(0x1ae)]('Project:\x20'+a54_0x4da4e1[_0x2df925(0x2a4)](_0x37bfbc)+',\x20Workflow:\x20'+a54_0x4da4e1[_0x2df925(0x2a4)](_0x4887bc));}const _0x41b7b4=new WorkflowTimelineCommand();await _0x41b7b4[_0x2df925(0x100)]({'args':[],'options':{..._0x459ab9,'attemptId':_0x2be470[_0x2df925(0x1f1)]},'tdx':_0x2ddbff});}[a54_0x49055a(0x1a7)](_0x99f426,_0x78fadc){const _0x127071=a54_0x49055a,_0x371909=new Map();for(const _0x2cefc6 of _0x99f426){_0x2cefc6['id']&&_0x2cefc6[_0x127071(0x17f)]?.['id']&&_0x371909[_0x127071(0x234)](_0x2cefc6['id'],_0x2cefc6['lastAttempt']['id']);}const _0x3b937a=[];let _0x1fb0fd='';const _0xe17e41=this[_0x127071(0x109)](_0x99f426,_0x78fadc),_0x338e99=_0xe17e41[_0x127071(0x17e)]('\x0a');for(const _0x4c571e of _0x338e99){if(_0x4c571e['startsWith'](_0x127071(0x120))||_0x4c571e['match'](/^\s+\d{4}-\d{2}-\d{2}/))_0x1fb0fd=_0x4c571e;else{if(_0x4c571e[_0x127071(0x186)](/^[✅❌🔄🛑⏳]/)){const _0x13cf84=_0x4c571e[_0x127071(0x186)](/#(\d+)/),_0x17f752=_0x13cf84?_0x13cf84[0x1]:null,_0x256839=_0x17f752?_0x371909[_0x127071(0x27d)](_0x17f752)||null:null,_0x57ed73=_0x99f426[_0x127071(0x1ce)](_0x15c59e=>_0x15c59e['id']===_0x17f752),_0x4b8b0f=_0x57ed73?.[_0x127071(0x283)]?.[_0x127071(0x290)]||'';_0x3b937a[_0x127071(0x1d8)]({'displayLine':_0x4c571e,'attemptId':_0x256839,'projectName':_0x4b8b0f});}}}return{'timelineRows':_0x3b937a,'timeAxisHeader':_0x1fb0fd};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0x49055a(0x290)]='workflow:attempts';[a54_0x49055a(0x147)]=a54_0x49055a(0x224);async[a54_0x49055a(0x100)](_0x2b6f75){const _0x13df00=a54_0x49055a,{options:_0x4935b9,args:_0x1900af,tdx:_0x5c366b}=_0x2b6f75,_0x59536f=this[_0x13df00(0x21c)](_0x1900af,_0x4935b9);if(!_0x59536f)return 0x1;const {projectName:_0x484653,workflowName:_0x53f185}=_0x59536f,_0x564602=_0x4935b9['includeRetried'];if(_0x4935b9[_0x13df00(0x1ad)]){if(_0x484653&&_0x53f185)console['error'](_0x13df00(0x1df)+_0x484653+'.'+_0x53f185);else _0x484653&&console[_0x13df00(0x1ba)]('Filter:\x20project='+_0x484653);_0x564602&&console[_0x13df00(0x1ba)](_0x13df00(0x1a4));}const _0x2d7797=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x5c366b[_0x13df00(0x133)][_0x13df00(0x241)]({'projectName':_0x484653,'workflowName':_0x53f185,'includeRetried':_0x564602,'limit':_0x4935b9['limit']}),{'verbose':_0x4935b9[_0x13df00(0x1ad)]}),_0x4d2a06=_0x2d7797['data'],_0x26d820=_0x4935b9[_0x13df00(0x1c0)]||0x64,_0x5f42d6=_0x4d2a06[_0x13df00(0x292)]>=_0x26d820?a54_0x4da4e1[_0x13df00(0x2a4)](_0x13df00(0x26c)):'';console[_0x13df00(0x1ba)](_0x13df00(0x233)+_0x4d2a06[_0x13df00(0x292)]+_0x13df00(0x1f3)+(_0x4d2a06[_0x13df00(0x292)]!==0x1?'s':'')+_0x5f42d6);if(_0x4935b9['format']==='json'||_0x4935b9[_0x13df00(0x245)]===_0x13df00(0x26b)||_0x4935b9['format']===_0x13df00(0x1bf))await handleSDKOutput(_0x4d2a06,_0x4935b9);else{if(_0x4d2a06[_0x13df00(0x292)]===0x0){if(_0x484653&&_0x53f185)console[_0x13df00(0x1ae)](_0x13df00(0x1d7)+_0x484653+'.'+_0x53f185);else _0x484653?console[_0x13df00(0x1ae)](_0x13df00(0x121)+_0x484653):console[_0x13df00(0x1ae)]('No\x20attempts\x20found');}else{const _0x46a569=_0x4935b9[_0x13df00(0x1d3)],_0x542044=_0x4d2a06[_0x13df00(0x2a9)](_0x113468=>{const _0x4185af=_0x13df00,_0x5e691f=a54_0x4da4e1[_0x4185af(0x2a4)]('#'+_0x113468['id']),_0x505c30=_0x113468[_0x4185af(0x283)]?.['id'],_0x4aae1b=_0x113468[_0x4185af(0x2ab)]||_0x113468[_0x4185af(0x29d)],_0x4dec11=_0x505c30&&_0x4aae1b?hyperlink(_0x5e691f,getWorkflowAttemptUrl(_0x46a569,_0x505c30,_0x4aae1b,_0x113468['id'])):_0x5e691f,{icon:_0x270717,text:_0x17f922}=getAttemptStatusDisplay(_0x113468),_0x4f7500=(_0x113468[_0x4185af(0x283)]?.[_0x4185af(0x290)]||'?')+'.'+(_0x113468['workflow']?.[_0x4185af(0x290)]||'?'),_0x48f60c=_0x113468[_0x4185af(0x143)]?a54_0x4da4e1[_0x4185af(0x2a4)](_0x113468[_0x4185af(0x143)]):'';return(_0x4dec11+'\x20'+_0x270717+(_0x17f922?'\x20'+_0x17f922:'')+'\x20'+_0x4f7500+'\x20'+_0x48f60c)[_0x4185af(0x287)]();});await writeOutput(_0x542044[_0x13df00(0x12e)]('\x0a'),_0x4935b9['output'],_0x13df00(0x298));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x49055a(0x290)]=a54_0x49055a(0x1fb);[a54_0x49055a(0x147)]=a54_0x49055a(0x249);async[a54_0x49055a(0x100)](_0x2b38e1){const _0x1d9231=a54_0x49055a,{options:_0x3f492b,args:_0xc0dee2,tdx:_0x231870}=_0x2b38e1,_0x421bb2=_0xc0dee2[0x0];if(!_0x421bb2)return console[_0x1d9231(0x1ba)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x3f492b[_0x1d9231(0x1ad)]&&console['error'](_0x1d9231(0x178)+_0x421bb2);const _0x40e2ae=await withSpinner(_0x1d9231(0x14b),()=>_0x231870['workflow'][_0x1d9231(0x204)](_0x421bb2),{'verbose':_0x3f492b[_0x1d9231(0x1ad)]}),_0x643c5b=_0x40e2ae[_0x1d9231(0x19d)];let _0x16865b;!_0x643c5b[_0x1d9231(0x242)]?_0x16865b=_0x643c5b[_0x1d9231(0x11f)]?_0x1d9231(0x1b4):_0x1d9231(0x10c):_0x16865b=_0x643c5b['success']?_0x1d9231(0x200):_0x1d9231(0x1ba);let _0x2b7127;if(_0x643c5b[_0x1d9231(0x261)]&&_0x643c5b['finishedAt']){const _0x5a6738=new Date(_0x643c5b[_0x1d9231(0x261)])['getTime'](),_0x30c74d=new Date(_0x643c5b[_0x1d9231(0x1cc)])[_0x1d9231(0x14c)]();_0x2b7127=Math[_0x1d9231(0x187)]((_0x30c74d-_0x5a6738)/0x3e8);}const _0xd3e901={'attempt_id':_0x643c5b['id'],'status':_0x16865b,..._0x643c5b[_0x1d9231(0x10a)]!==undefined&&{'index':_0x643c5b[_0x1d9231(0x10a)]},..._0x643c5b[_0x1d9231(0x283)]&&{'project':_0x643c5b[_0x1d9231(0x283)][_0x1d9231(0x290)]},..._0x643c5b[_0x1d9231(0x133)]&&{'workflow':_0x643c5b[_0x1d9231(0x133)][_0x1d9231(0x290)]},..._0x643c5b['sessionId']&&{'session_id':_0x643c5b[_0x1d9231(0x29d)]},..._0x643c5b[_0x1d9231(0x143)]&&{'session_time':_0x643c5b[_0x1d9231(0x143)]},..._0x643c5b[_0x1d9231(0x22b)]&&{'retry_attempt':_0x643c5b[_0x1d9231(0x22b)]},..._0x2b7127!==undefined&&{'duration_sec':_0x2b7127},..._0x643c5b[_0x1d9231(0x261)]&&{'created_at':_0x643c5b['createdAt']},..._0x643c5b[_0x1d9231(0x1cc)]&&{'finished_at':_0x643c5b[_0x1d9231(0x1cc)]},...Object['keys'](_0x643c5b[_0x1d9231(0x1de)])[_0x1d9231(0x292)]>0x0&&{'params':_0x643c5b[_0x1d9231(0x1de)]}};return await handleSingleObjectOutput(_0xd3e901,_0x3f492b),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a54_0x49055a(0x290)]=a54_0x49055a(0xfb);[a54_0x49055a(0x147)]=a54_0x49055a(0x1f4);async[a54_0x49055a(0x100)](_0x1ec5a2){const _0x4efe29=a54_0x49055a,{options:_0x32b54b,args:_0x5771ae,tdx:_0xd1760}=_0x1ec5a2,_0x5f0925=_0x5771ae[0x0];if(!_0x5f0925)return console['error'](_0x4efe29(0x211)),0x1;const _0x3baaa4=_0x32b54b[_0x4efe29(0x222)];_0x32b54b[_0x4efe29(0x1ad)]&&(console[_0x4efe29(0x1ba)](_0x4efe29(0x178)+_0x5f0925),_0x3baaa4&&console[_0x4efe29(0x1ba)]('Including\x20subtasks:\x20yes'));const _0x4c73c3=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0xd1760[_0x4efe29(0x133)][_0x4efe29(0x274)](_0x5f0925,_0x3baaa4||![]),{'verbose':_0x32b54b[_0x4efe29(0x1ad)]}),_0x41132e=_0x4c73c3[_0x4efe29(0x19d)];return console[_0x4efe29(0x1ba)](_0x4efe29(0x233)+_0x41132e[_0x4efe29(0x292)]+'\x20task'+(_0x41132e[_0x4efe29(0x292)]!==0x1?'s':'')),await handleSDKOutput(_0x41132e,_0x32b54b),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0x49055a(0x290)]=a54_0x49055a(0xfe);[a54_0x49055a(0x147)]=a54_0x49055a(0x256);async[a54_0x49055a(0x100)](_0x1378f1){const _0x4f8bdf=a54_0x49055a,{options:_0x1cfa14,args:_0x1241bd,tdx:_0x3e42a4}=_0x1378f1,_0x26db1e=_0x1241bd[0x0];let _0x33a2a9=_0x1241bd[0x1];if(!_0x26db1e)return console[_0x4f8bdf(0x1ba)](_0x4f8bdf(0x211)),0x1;_0x1cfa14[_0x4f8bdf(0x1ad)]&&(console[_0x4f8bdf(0x1ba)](_0x4f8bdf(0x178)+_0x26db1e),_0x33a2a9&&console[_0x4f8bdf(0x1ba)](_0x4f8bdf(0x165)+_0x33a2a9));const _0x3f06f7=await withSpinner(_0x4f8bdf(0x206),()=>_0x3e42a4['workflow']['logFiles'](_0x26db1e,_0x33a2a9),{'verbose':_0x1cfa14['verbose']}),_0x3e32d0=_0x3f06f7[_0x4f8bdf(0x19d)];if(_0x3e32d0[_0x4f8bdf(0x292)]===0x0)return console[_0x4f8bdf(0x1ba)](_0x4f8bdf(0x11a)),0x0;if(!_0x33a2a9&&(_0x1cfa14['json']||_0x1cfa14[_0x4f8bdf(0x245)]))return await handleSDKOutput(_0x3e32d0,_0x1cfa14),0x0;if(!_0x33a2a9){const _0x2584ca=_0x3e32d0['map'](_0x2b4952=>({'title':_0x2b4952['taskName']+'\x20('+formatBytes(_0x2b4952['fileSize'])+')','value':_0x2b4952[_0x4f8bdf(0x218)]})),_0x4ec7b2=await a54_0x29f2c3({'type':'select','name':_0x4f8bdf(0x1d5),'message':_0x4f8bdf(0x28c),'choices':_0x2584ca});if(!_0x4ec7b2[_0x4f8bdf(0x1d5)])return console[_0x4f8bdf(0x1ba)]('Cancelled'),0x0;_0x33a2a9=_0x4ec7b2['task'];}const _0x431a53=await withSpinner(_0x4f8bdf(0x13f),()=>_0x3e42a4[_0x4f8bdf(0x133)][_0x4f8bdf(0x22a)](_0x26db1e,_0x33a2a9),{'verbose':_0x1cfa14['verbose']}),_0x20a0ce=_0x431a53[_0x4f8bdf(0x19d)];return _0x20a0ce?console['log'](_0x20a0ce):console[_0x4f8bdf(0x1ba)](_0x4f8bdf(0x13c)),0x0;}}export class WorkflowKillCommand extends BaseCommand{['name']=a54_0x49055a(0x284);[a54_0x49055a(0x147)]=a54_0x49055a(0x1ea);async[a54_0x49055a(0x100)](_0x6ea63a){const _0x3f2fa1=a54_0x49055a,{options:_0x3599e8,args:_0x161a4,tdx:_0x371825}=_0x6ea63a,_0x4e3d67=_0x161a4[0x0];if(!_0x4e3d67)return console[_0x3f2fa1(0x1ba)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x28290a=_0x3599e8[_0x3f2fa1(0x18f)];_0x3599e8['verbose']&&(console[_0x3f2fa1(0x1ba)](_0x3f2fa1(0x178)+_0x4e3d67),_0x28290a&&console[_0x3f2fa1(0x1ba)](_0x3f2fa1(0x281)+_0x28290a));if(!_0x3599e8[_0x3f2fa1(0x149)]){if(!isInteractive())return console[_0x3f2fa1(0x1ba)](a54_0x4da4e1[_0x3f2fa1(0x27c)](_0x3f2fa1(0x124)),_0x3f2fa1(0x2a8)),console[_0x3f2fa1(0x1ba)](a54_0x4da4e1[_0x3f2fa1(0x2a4)](_0x3f2fa1(0x102))),0x1;const _0x323908=await confirmKey(_0x3f2fa1(0x1c9)+_0x4e3d67+'?');if(!_0x323908)return console[_0x3f2fa1(0x1ba)](a54_0x4da4e1[_0x3f2fa1(0x294)](_0x3f2fa1(0x18c))),0x1;}const _0x482e82=await withSpinner(_0x3f2fa1(0x226),()=>_0x371825['workflow'][_0x3f2fa1(0x112)](_0x4e3d67,_0x28290a),{'verbose':_0x3599e8['verbose']}),_0x23c586=_0x482e82[_0x3f2fa1(0x19d)];return console[_0x3f2fa1(0x1ba)]('✔\x20'+_0x23c586),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']='workflow:retry';['description']=a54_0x49055a(0x22f);async[a54_0x49055a(0x100)](_0x62562f){const _0x4c60a3=a54_0x49055a,{options:_0x773ff0,args:_0x33d998,tdx:_0xd9941}=_0x62562f,_0x10ecac=_0x33d998[0x0];if(!_0x10ecac)return console[_0x4c60a3(0x1ba)](_0x4c60a3(0x2a0)),console[_0x4c60a3(0x1ba)](_0x4c60a3(0x297)),0x1;let _0x230b01=![],_0x6ad9e3=_0x10ecac;if(_0x10ecac[_0x4c60a3(0x1db)](_0x4c60a3(0x295)))_0x230b01=!![],_0x6ad9e3=_0x10ecac[_0x4c60a3(0x1c4)](0x8);else{if(_0x10ecac[_0x4c60a3(0x1db)](_0x4c60a3(0x17a)))_0x230b01=![],_0x6ad9e3=_0x10ecac[_0x4c60a3(0x1c4)](0x8);else return console[_0x4c60a3(0x1ba)](_0x4c60a3(0x257)),console[_0x4c60a3(0x1ba)](_0x4c60a3(0x297)),0x1;}const _0x2da666=_0x773ff0['fromTask'],_0xee0c13=_0x773ff0['resumeFrom'],_0xabb389=_0x773ff0[_0x4c60a3(0x1de)],_0x15f776=_0x773ff0['force'];_0x773ff0[_0x4c60a3(0x1ad)]&&(console['error'](_0x4c60a3(0x1ff)+(_0x230b01?_0x4c60a3(0x1c7):_0x4c60a3(0x204))+'\x20'+_0x6ad9e3),_0x2da666&&console[_0x4c60a3(0x1ba)](_0x4c60a3(0x142)+_0x2da666),_0xee0c13&&console[_0x4c60a3(0x1ba)](_0x4c60a3(0x205)+_0xee0c13),_0xabb389&&console['error'](_0x4c60a3(0x24d)+_0xabb389),_0x15f776&&console[_0x4c60a3(0x1ba)]('Force:\x20yes'));let _0x2b18a8;if(_0xabb389)try{if(_0xabb389[_0x4c60a3(0x1db)]('@')){const _0x6f7db3=await import(_0x4c60a3(0x2a3)),_0x175205=_0xabb389[_0x4c60a3(0x1c4)](0x1),_0x2a7149=await _0x6f7db3[_0x4c60a3(0x214)](_0x175205,'utf-8');_0x2b18a8=JSON['parse'](_0x2a7149);}else _0x2b18a8=JSON['parse'](_0xabb389);}catch{return console[_0x4c60a3(0x1ba)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x773ff0[_0x4c60a3(0x149)]){if(!isInteractive())return console[_0x4c60a3(0x1ba)](a54_0x4da4e1[_0x4c60a3(0x27c)](_0x4c60a3(0x124)),_0x4c60a3(0x2a8)),console[_0x4c60a3(0x1ba)](a54_0x4da4e1['dim'](_0x4c60a3(0x102))),0x1;const _0x318a36=await confirmKey(_0x4c60a3(0x259)+(_0x230b01?_0x4c60a3(0x1c7):_0x4c60a3(0x204))+'\x20'+_0x6ad9e3+'?');if(!_0x318a36)return console[_0x4c60a3(0x1ba)](a54_0x4da4e1[_0x4c60a3(0x294)](_0x4c60a3(0x18c))),0x1;}let _0x2ab715;_0x230b01?_0x2ab715=await withSpinner(_0x4c60a3(0x26a),()=>_0xd9941['workflow'][_0x4c60a3(0x1ed)](_0x6ad9e3,{'fromTask':_0x2da666,'retryParams':_0x2b18a8}),{'verbose':_0x773ff0[_0x4c60a3(0x1ad)]}):_0x2ab715=await withSpinner(_0x4c60a3(0x16a),()=>_0xd9941[_0x4c60a3(0x133)][_0x4c60a3(0x20a)](_0x6ad9e3,{'resumeFrom':_0xee0c13,'retryParams':_0x2b18a8,'force':_0x15f776}),{'verbose':_0x773ff0[_0x4c60a3(0x1ad)]});const _0x497d62=_0x2ab715[_0x4c60a3(0x19d)];return console[_0x4c60a3(0x1ba)](_0x4c60a3(0x280)),console[_0x4c60a3(0x1ba)](_0x4c60a3(0x12b)+_0x497d62['attemptId']),console[_0x4c60a3(0x1ba)](_0x4c60a3(0x22e)+_0x497d62[_0x4c60a3(0x29d)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x49055a(0x290)]=a54_0x49055a(0x199);[a54_0x49055a(0x147)]=a54_0x49055a(0x131);async[a54_0x49055a(0x100)](_0x5a062a){const _0x5a5e3f=a54_0x49055a,{options:_0x4f89a2,args:_0x44da41,tdx:_0x23504d}=_0x5a062a;let _0x4e06ef=_0x44da41[0x0];if(!_0x4e06ef){const _0x4b5e0c=this['resolveProject']([],_0x4f89a2),_0x46bc60=await withSpinner(_0x5a5e3f(0x108),()=>_0x23504d['workflow'][_0x5a5e3f(0x1e9)](_0x4b5e0c,{'limit':_0x4f89a2[_0x5a5e3f(0x1c0)]}),{'verbose':_0x4f89a2[_0x5a5e3f(0x1ad)]}),_0x193462=_0x46bc60[_0x5a5e3f(0x19d)];if(_0x193462['length']===0x0)return console['error']('No\x20workflows\x20found'),!_0x4b5e0c&&console[_0x5a5e3f(0x1ba)](a54_0x4da4e1[_0x5a5e3f(0x2a4)](_0x5a5e3f(0x140))),0x1;const _0x66e477=_0x193462['map'](_0x4b4636=>({'title':_0x4b4636[_0x5a5e3f(0x283)]?.['name']+'.'+_0x4b4636['name'],'value':_0x4b4636[_0x5a5e3f(0x283)]?.['name']+'.'+_0x4b4636[_0x5a5e3f(0x290)],'description':_0x4b4636[_0x5a5e3f(0x2a5)]?_0x5a5e3f(0x258)+_0x4b4636[_0x5a5e3f(0x2a5)]:undefined})),_0x380bda=await a54_0x29f2c3({'type':'select','name':_0x5a5e3f(0x133),'message':_0x5a5e3f(0x23b),'choices':_0x66e477});if(!_0x380bda[_0x5a5e3f(0x133)])return 0x1;_0x4e06ef=_0x380bda[_0x5a5e3f(0x133)];}if(!_0x4e06ef[_0x5a5e3f(0x267)]('.')){const _0x4a473b=this[_0x5a5e3f(0x28d)]([],_0x4f89a2);if(_0x4a473b)_0x4e06ef=_0x4a473b+'.'+_0x4e06ef;else return console[_0x5a5e3f(0x1ba)](a54_0x4da4e1[_0x5a5e3f(0x27c)]('Error:'),_0x5a5e3f(0x23c)),console[_0x5a5e3f(0x1ba)](a54_0x4da4e1[_0x5a5e3f(0x2a4)](_0x5a5e3f(0x140))),0x1;}const _0x160c43=_0x4f89a2[_0x5a5e3f(0x12a)],_0x156d5d=_0x4f89a2['sessionTime'],_0x1a8b3c={};if(_0x160c43&&Array[_0x5a5e3f(0x221)](_0x160c43))for(const _0x43bd40 of _0x160c43){const _0x5e2546=_0x43bd40['indexOf']('=');if(_0x5e2546===-0x1)return console[_0x5a5e3f(0x1ba)](_0x5a5e3f(0x123)+_0x43bd40),console['error'](_0x5a5e3f(0x116)),0x1;const _0x4dea9f=_0x43bd40[_0x5a5e3f(0x1c4)](0x0,_0x5e2546),_0x677e54=_0x43bd40[_0x5a5e3f(0x1c4)](_0x5e2546+0x1);try{_0x1a8b3c[_0x4dea9f]=JSON['parse'](_0x677e54);}catch{_0x1a8b3c[_0x4dea9f]=_0x677e54;}}_0x4f89a2['verbose']&&(console[_0x5a5e3f(0x1ba)]('Workflow:\x20'+_0x4e06ef),Object[_0x5a5e3f(0x12d)](_0x1a8b3c)['length']>0x0&&console[_0x5a5e3f(0x1ba)](_0x5a5e3f(0x28e)+JSON[_0x5a5e3f(0x184)](_0x1a8b3c)),_0x156d5d&&console[_0x5a5e3f(0x1ba)](_0x5a5e3f(0x1a2)+_0x156d5d));const _0x524faa=await withSpinner(_0x5a5e3f(0x24b),()=>_0x23504d[_0x5a5e3f(0x133)]['run'](_0x4e06ef,_0x1a8b3c,{'sessionTime':_0x156d5d}),{'verbose':_0x4f89a2[_0x5a5e3f(0x1ad)]}),_0x514d97=_0x524faa['data'];console[_0x5a5e3f(0x1ba)](_0x5a5e3f(0x130)),console[_0x5a5e3f(0x1ba)](_0x5a5e3f(0x265)+_0x514d97['id']),console[_0x5a5e3f(0x1ba)](_0x5a5e3f(0x22e)+_0x514d97[_0x5a5e3f(0x29d)]),console[_0x5a5e3f(0x1ba)](_0x5a5e3f(0x10e)+_0x514d97[_0x5a5e3f(0x283)]?.[_0x5a5e3f(0x290)]),console['error'](_0x5a5e3f(0x152)+_0x514d97[_0x5a5e3f(0x133)]?.[_0x5a5e3f(0x290)]);if(_0x514d97['project']?.['id']&&_0x514d97['sessionId']&&_0x514d97['id']){const _0x740668=_0x4f89a2[_0x5a5e3f(0x1d3)],_0x477afd=getConsoleUrl(_0x740668,_0x5a5e3f(0x1f5)+_0x514d97[_0x5a5e3f(0x283)]['id']+_0x5a5e3f(0x137)+_0x514d97['sessionId']+'/attempt/'+_0x514d97['id']);console['error']('\x20\x20Console:\x20'+a54_0x4da4e1['cyan'](_0x477afd));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a54_0x49055a(0x290)]='workflow:download';['description']=a54_0x49055a(0x1e8);async[a54_0x49055a(0x100)](_0x16c5f0){const _0x3972ad=a54_0x49055a,{options:_0x5006f8,args:_0x47394e,tdx:_0x3242d3}=_0x16c5f0,_0x5b45ae=_0x47394e[0x0],_0x5eadd8=_0x47394e[0x1]||'.';if(!_0x5b45ae)return console['error'](_0x3972ad(0x160)),console['error'](_0x3972ad(0x247)),0x1;const _0x422adb=_0x5006f8['revision'];_0x5006f8['verbose']&&(console['error'](_0x3972ad(0x275)+_0x5b45ae),console[_0x3972ad(0x1ba)](_0x3972ad(0x216)+_0x5eadd8),_0x422adb&&console[_0x3972ad(0x1ba)]('Revision:\x20'+_0x422adb));const _0x969b2b=await withSpinner(_0x3972ad(0x285)+_0x5b45ae+_0x3972ad(0x29b),()=>_0x3242d3[_0x3972ad(0x133)]['download'](_0x5b45ae,_0x5eadd8,{'revision':_0x422adb}),{'verbose':_0x5006f8[_0x3972ad(0x1ad)]}),_0x360011=_0x969b2b[_0x3972ad(0x19d)];return console[_0x3972ad(0x1ba)](_0x3972ad(0x210)+_0x360011['projectName']),console[_0x3972ad(0x1ba)]('\x20\x20Revision:\x20'+_0x360011[_0x3972ad(0x2a5)]),console[_0x3972ad(0x1ba)](_0x3972ad(0x289)+_0x360011[_0x3972ad(0x11c)]),console[_0x3972ad(0x1ba)](_0x3972ad(0x1b9)+_0x5eadd8+'/'+_0x360011['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']='workflow:upload';[a54_0x49055a(0x147)]=a54_0x49055a(0x1b5);async['execute'](_0x1c2722){const _0x56144f=a54_0x49055a,{options:_0x1e2a43,args:_0x382395,tdx:_0x27be69}=_0x1c2722;let _0x2de6aa='.',_0x27fb2e=_0x1e2a43['name'];if(_0x382395[0x0]){const {promises:_0x30639e}=await import('fs');try{const _0x51336c=await _0x30639e[_0x56144f(0x1d6)](_0x382395[0x0]);if(_0x51336c[_0x56144f(0x1c2)]())_0x2de6aa=_0x382395[0x0];else return console[_0x56144f(0x1ba)](_0x56144f(0x119)+_0x382395[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x27fb2e=_0x382395[0x0],_0x2de6aa='.';}}const _0x39e6d6=_0x1e2a43[_0x56144f(0x2a5)],_0x3fee87=_0x1e2a43[_0x56144f(0x2aa)];_0x1e2a43[_0x56144f(0x1ad)]&&(console['error'](_0x56144f(0x114)+_0x2de6aa),_0x27fb2e&&console[_0x56144f(0x1ba)](_0x56144f(0x14f)+_0x27fb2e),_0x39e6d6&&console[_0x56144f(0x1ba)](_0x56144f(0x170)+_0x39e6d6),_0x3fee87&&console['error']('Validation:\x20skipped'));const _0x136f40=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x27be69[_0x56144f(0x133)][_0x56144f(0x1d8)](_0x2de6aa,{'projectName':_0x27fb2e,'revision':_0x39e6d6,'skipValidation':_0x3fee87}),{'verbose':_0x1e2a43[_0x56144f(0x1ad)]}),_0x418bd4=_0x136f40[_0x56144f(0x19d)];return console[_0x56144f(0x1ba)](_0x56144f(0x1b8)+_0x418bd4[_0x56144f(0x195)]),console[_0x56144f(0x1ba)](_0x56144f(0x20c)+_0x418bd4[_0x56144f(0x145)]),console['error'](_0x56144f(0x168)+_0x418bd4[_0x56144f(0x2a5)]),await this['showWorkflowConsoleUrl'](_0x27be69,_0x418bd4['projectName'],_0x1e2a43['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x49055a(0x290)]=a54_0x49055a(0x141);[a54_0x49055a(0x147)]=a54_0x49055a(0x237);async[a54_0x49055a(0x100)](_0xec32e1){const _0x16bc60=a54_0x49055a,{options:_0x573994,args:_0x340d5f,tdx:_0xebec22}=_0xec32e1,_0x4060c8=_0x340d5f[0x0],_0x18a30a=_0x340d5f[0x1];if(!_0x4060c8)return console[_0x16bc60(0x1ba)](a54_0x4da4e1[_0x16bc60(0x27c)](_0x16bc60(0x154)),'Project\x20name\x20is\x20required'),console['error'](a54_0x4da4e1['dim'](_0x16bc60(0x159))),0x1;const _0x5ef981=_0x573994[_0x16bc60(0x2a5)];_0x573994[_0x16bc60(0x1ad)]&&(console[_0x16bc60(0x1ba)]('Project:\x20'+_0x4060c8),_0x18a30a&&console[_0x16bc60(0x1ba)]('Target\x20directory:\x20'+_0x18a30a),_0x5ef981&&console[_0x16bc60(0x1ba)]('Revision:\x20'+_0x5ef981),_0x573994[_0x16bc60(0x16d)]&&console[_0x16bc60(0x1ba)](_0x16bc60(0x13a)));const _0x3def7f=await withSpinner(_0x16bc60(0x27f)+_0x4060c8+'...',()=>_0xebec22['workflow']['pullProject'](_0x4060c8,{'targetDir':_0x18a30a,'revision':_0x5ef981}),{'verbose':_0x573994['verbose']}),_0x188a9c=_0x3def7f[_0x16bc60(0x19d)];_0x188a9c[_0x16bc60(0x288)]?console[_0x16bc60(0x1ba)]('→\x20New\x20project:\x20'+_0x188a9c[_0x16bc60(0x195)]):console[_0x16bc60(0x1ba)](_0x16bc60(0x236)+_0x188a9c[_0x16bc60(0x195)]);console[_0x16bc60(0x1ba)]('\x20\x20Revision:\x20'+_0x188a9c[_0x16bc60(0x2a5)]),console[_0x16bc60(0x1ba)](_0x16bc60(0x29a)+(a54_0x2de0d1[_0x16bc60(0x243)](process['cwd'](),_0x188a9c[_0x16bc60(0x230)])||'.')),console[_0x16bc60(0x1ba)]('\x20\x20Changes:\x20'+a54_0x4da4e1['green']('+'+_0x188a9c['summary'][_0x16bc60(0x24c)]+_0x16bc60(0x1ac))+',\x20'+(a54_0x4da4e1[_0x16bc60(0x294)]('~'+_0x188a9c[_0x16bc60(0x254)][_0x16bc60(0x1f0)]+_0x16bc60(0x1c3))+',\x20')+(a54_0x4da4e1[_0x16bc60(0x27c)]('-'+_0x188a9c[_0x16bc60(0x254)][_0x16bc60(0x146)]+_0x16bc60(0x20f))+',\x20')+(''+a54_0x4da4e1['dim'](_0x188a9c[_0x16bc60(0x254)][_0x16bc60(0x194)]+_0x16bc60(0x263))));for(const _0xbb61e1 of _0x188a9c[_0x16bc60(0x1bb)]){_0xbb61e1[_0x16bc60(0x213)]===_0x16bc60(0x1f0)&&_0xbb61e1[_0x16bc60(0x172)]&&(console['error']('\x0a'+a54_0x4da4e1['cyan'](_0x16bc60(0x24f)+_0xbb61e1[_0x16bc60(0x14a)])),console[_0x16bc60(0x1ba)](_0xbb61e1[_0x16bc60(0x172)]));}if(!_0x188a9c[_0x16bc60(0x1a5)])return saveSessionContext({'workflow_project':_0x188a9c['projectName']},_0x573994[_0x16bc60(0x1c7)]),console[_0x16bc60(0x1ba)](a54_0x4da4e1[_0x16bc60(0x11d)](_0x16bc60(0x1eb))),console['error'](a54_0x4da4e1['dim']('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x188a9c[_0x16bc60(0x195)])),0x0;if(_0x573994['dryRun'])return console['error'](a54_0x4da4e1['yellow'](_0x16bc60(0x1f6))),0x0;if(!_0x573994[_0x16bc60(0x149)]){if(!isInteractive())return console[_0x16bc60(0x1ba)](a54_0x4da4e1[_0x16bc60(0x27c)](_0x16bc60(0x124)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x16bc60(0x1ba)](a54_0x4da4e1[_0x16bc60(0x2a4)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x9b5e65=await confirmKey(_0x16bc60(0x153));if(!_0x9b5e65)return console[_0x16bc60(0x1ba)](a54_0x4da4e1[_0x16bc60(0x294)](_0x16bc60(0x18c)),'-\x20no\x20files\x20written'),0x1;}await withSpinner(_0x16bc60(0x1be),()=>_0xebec22[_0x16bc60(0x133)][_0x16bc60(0x22c)](_0x188a9c,{'revision':_0x5ef981}),{'verbose':_0x573994['verbose']}),saveSessionContext({'workflow_project':_0x188a9c[_0x16bc60(0x195)]},_0x573994['session']),console[_0x16bc60(0x1ba)](a54_0x4da4e1[_0x16bc60(0x11d)]('✔\x20Pull\x20complete'));const _0x5b6865=a54_0x2de0d1['relative'](process[_0x16bc60(0x127)](),_0x188a9c['targetDir'])||'.';return console['error'](a54_0x4da4e1[_0x16bc60(0x2a4)](_0x16bc60(0x1b9)+_0x5b6865)),console[_0x16bc60(0x1ba)](a54_0x4da4e1[_0x16bc60(0x2a4)](_0x16bc60(0x266)+_0x188a9c[_0x16bc60(0x195)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a54_0x49055a(0x15d);[a54_0x49055a(0x147)]=a54_0x49055a(0xfc);async['execute'](_0x2b6f7a){const _0xdc8b54=a54_0x49055a,{options:_0x347def,args:_0x4140d9,tdx:_0x5ae78a}=_0x2b6f7a,_0xa15814=this[_0xdc8b54(0x25e)](_0x4140d9,_0x347def),_0x2963d5=_0x347def['revision'],_0xb36511=_0x347def[_0xdc8b54(0x2aa)];_0x347def['verbose']&&(_0xa15814&&console[_0xdc8b54(0x1ba)](_0xdc8b54(0x110)+_0xa15814),_0x2963d5&&console[_0xdc8b54(0x1ba)](_0xdc8b54(0x170)+_0x2963d5),_0x347def['dryRun']&&console[_0xdc8b54(0x1ba)](_0xdc8b54(0x13a)),_0xb36511&&console['error'](_0xdc8b54(0x155)));let _0x21029a;try{_0x21029a=await withSpinner(_0xdc8b54(0x278),()=>_0x5ae78a['workflow'][_0xdc8b54(0xfd)]({'sourceDir':_0xa15814,'revision':_0x2963d5,'skipValidation':_0xb36511}),{'verbose':_0x347def[_0xdc8b54(0x1ad)]});}catch(_0x3e9da3){if(_0x3e9da3 instanceof Error&&_0x3e9da3['message'][_0xdc8b54(0x267)]('No\x20workflow\x20tdx.json\x20found'))return console[_0xdc8b54(0x1ba)](a54_0x4da4e1[_0xdc8b54(0x27c)](_0xdc8b54(0x154)),_0xdc8b54(0x193)),_0x347def[_0xdc8b54(0x1b1)]?console[_0xdc8b54(0x1ba)](a54_0x4da4e1[_0xdc8b54(0x2a4)](_0xdc8b54(0x1e4)+_0x347def[_0xdc8b54(0x1b1)]+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x347def['workflowProject']+'\x27')):console[_0xdc8b54(0x1ba)](a54_0x4da4e1['dim'](_0xdc8b54(0x1d4))),0x1;throw _0x3e9da3;}const _0x25e0a8=_0x21029a['data'];console[_0xdc8b54(0x1ba)](_0xdc8b54(0x161)+_0x25e0a8['projectName']),console[_0xdc8b54(0x1ba)](_0xdc8b54(0x136)+_0x25e0a8['sourceDir']),console[_0xdc8b54(0x1ba)](_0xdc8b54(0x168)+_0x25e0a8[_0xdc8b54(0x2a5)]),console['error']('\x20\x20Changes:\x20'+a54_0x4da4e1[_0xdc8b54(0x11d)]('+'+_0x25e0a8[_0xdc8b54(0x254)]['new']+'\x20new')+',\x20'+(a54_0x4da4e1[_0xdc8b54(0x294)]('~'+_0x25e0a8['summary'][_0xdc8b54(0x1f0)]+_0xdc8b54(0x1c3))+',\x20')+(a54_0x4da4e1[_0xdc8b54(0x27c)]('-'+_0x25e0a8[_0xdc8b54(0x254)]['deleted']+_0xdc8b54(0x20f))+',\x20')+(''+a54_0x4da4e1[_0xdc8b54(0x2a4)](_0x25e0a8[_0xdc8b54(0x254)][_0xdc8b54(0x194)]+'\x20unchanged')));for(const _0x3f5d65 of _0x25e0a8['changes']){_0x3f5d65['type']===_0xdc8b54(0x1f0)&&_0x3f5d65[_0xdc8b54(0x172)]&&(console[_0xdc8b54(0x1ba)]('\x0a'+a54_0x4da4e1[_0xdc8b54(0x171)](_0xdc8b54(0x24f)+_0x3f5d65[_0xdc8b54(0x14a)])),console['error'](_0x3f5d65['diff']));}if(!_0x25e0a8['hasChanges'])return console['error'](a54_0x4da4e1[_0xdc8b54(0x11d)](_0xdc8b54(0x14d))),await this[_0xdc8b54(0x251)](_0x5ae78a,_0x25e0a8[_0xdc8b54(0x195)],_0x347def[_0xdc8b54(0x1d3)]),0x0;if(_0x347def[_0xdc8b54(0x16d)])return console[_0xdc8b54(0x1ba)](a54_0x4da4e1['yellow'](_0xdc8b54(0x1a0))),0x0;if(!_0x347def[_0xdc8b54(0x149)]){if(!isInteractive())return console[_0xdc8b54(0x1ba)](a54_0x4da4e1['red'](_0xdc8b54(0x124)),_0xdc8b54(0x2a8)),console['error'](a54_0x4da4e1['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2098ed=await confirmKey(_0xdc8b54(0x1b0));if(!_0x2098ed)return console[_0xdc8b54(0x1ba)](a54_0x4da4e1[_0xdc8b54(0x294)](_0xdc8b54(0x18c)),_0xdc8b54(0x128)),0x1;}const _0x5bd72a=await withSpinner('Pushing\x20project...',()=>_0x5ae78a[_0xdc8b54(0x133)][_0xdc8b54(0x262)](_0x25e0a8),{'verbose':_0x347def[_0xdc8b54(0x1ad)]}),_0x17a855=_0x5bd72a['data'];return console[_0xdc8b54(0x1ba)](a54_0x4da4e1['green'](_0xdc8b54(0x1c8))),console['error']('\x20\x20Project\x20ID:\x20'+_0x17a855['projectId']),console[_0xdc8b54(0x1ba)]('\x20\x20Revision:\x20'+_0x17a855[_0xdc8b54(0x2a5)]),await this['showWorkflowConsoleUrl'](_0x5ae78a,_0x17a855['projectName'],_0x347def[_0xdc8b54(0x1d3)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0x49055a(0x290)]=a54_0x49055a(0x26d);[a54_0x49055a(0x147)]=a54_0x49055a(0x174);async['execute'](_0x1c16a5){const _0x3637da=a54_0x49055a,{options:_0x5552d8,args:_0x301170,tdx:_0x1a0373}=_0x1c16a5,_0xf6b2c8=this['resolveProjectDir'](_0x301170,_0x5552d8),_0x4847f6=_0x5552d8[_0x3637da(0x290)],_0x5af1d2=_0x5552d8['revision'],_0x8a4dbf=_0x5552d8[_0x3637da(0x2aa)];if(!_0xf6b2c8)return console[_0x3637da(0x1ba)](a54_0x4da4e1[_0x3637da(0x27c)](_0x3637da(0x154)),_0x3637da(0x175)),console[_0x3637da(0x1ba)](a54_0x4da4e1[_0x3637da(0x2a4)](_0x3637da(0x1d2))),console[_0x3637da(0x1ba)](a54_0x4da4e1[_0x3637da(0x2a4)](_0x3637da(0x11e))),0x1;if(!_0x4847f6)return console['error'](a54_0x4da4e1[_0x3637da(0x27c)](_0x3637da(0x154)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console['error'](a54_0x4da4e1[_0x3637da(0x2a4)](_0x3637da(0x1d2))),0x1;_0x5552d8[_0x3637da(0x1ad)]&&(console['error'](_0x3637da(0x110)+_0xf6b2c8),console[_0x3637da(0x1ba)](_0x3637da(0x239)+_0x4847f6),_0x5af1d2&&console['error'](_0x3637da(0x170)+_0x5af1d2),_0x5552d8['dryRun']&&console[_0x3637da(0x1ba)](_0x3637da(0x13a)),_0x8a4dbf&&console[_0x3637da(0x1ba)]('Validation:\x20skipped'));const _0x4a7385=await withSpinner(_0x3637da(0x21e),()=>_0x1a0373[_0x3637da(0x133)]['prepareCloneProject'](_0xf6b2c8,_0x4847f6,{'revision':_0x5af1d2,'skipValidation':_0x8a4dbf}),{'verbose':_0x5552d8[_0x3637da(0x1ad)]}),_0x2677e4=_0x4a7385['data'];console[_0x3637da(0x1ba)](_0x3637da(0x139)+_0x2677e4[_0x3637da(0x16e)]);_0x2677e4[_0x3637da(0x134)]&&console[_0x3637da(0x1ba)]('Source\x20project:\x20'+_0x2677e4[_0x3637da(0x134)]);console[_0x3637da(0x1ba)]('New\x20project\x20name:\x20'+_0x2677e4['newProjectName']),console['error'](_0x3637da(0x170)+_0x2677e4[_0x3637da(0x2a5)]),console[_0x3637da(0x1ba)]('Files\x20to\x20upload:\x20'+_0x2677e4['fileCount']);_0x2677e4[_0x3637da(0x1cb)]&&(console[_0x3637da(0x1ba)](a54_0x4da4e1[_0x3637da(0x294)](_0x3637da(0x228)+_0x2677e4[_0x3637da(0x26e)]+_0x3637da(0x286)+_0x2677e4[_0x3637da(0x209)]+')')),console[_0x3637da(0x1ba)](a54_0x4da4e1[_0x3637da(0x294)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x5552d8[_0x3637da(0x16d)])return console[_0x3637da(0x1ba)](a54_0x4da4e1[_0x3637da(0x294)](_0x3637da(0x1e3))),0x0;if(!_0x5552d8[_0x3637da(0x149)]){if(!isInteractive())return console[_0x3637da(0x1ba)](a54_0x4da4e1['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3637da(0x1ba)](a54_0x4da4e1[_0x3637da(0x2a4)](_0x3637da(0x102))),0x1;const _0xcd1097=_0x2677e4['sourceProjectName']||a54_0x2de0d1[_0x3637da(0x201)](_0xf6b2c8),_0x26caea=_0x2677e4['targetExists']?_0x3637da(0x1a8)+_0x4847f6+'\x22\x20with\x20new\x20revision?':_0x3637da(0x277)+_0xcd1097+_0x3637da(0x135)+_0x4847f6+'\x22?',_0x4cfdda=await confirmKey(_0x26caea);if(!_0x4cfdda)return console[_0x3637da(0x1ba)](a54_0x4da4e1[_0x3637da(0x294)]('Cancelled')),0x1;}const _0x36f399=await withSpinner(_0x2677e4[_0x3637da(0x1cb)]?_0x3637da(0x11b)+_0x4847f6+'...':'Cloning\x20to\x20'+_0x4847f6+_0x3637da(0x29b),()=>_0x1a0373[_0x3637da(0x133)][_0x3637da(0x1bd)](_0x2677e4),{'verbose':_0x5552d8[_0x3637da(0x1ad)]}),_0x396309=_0x36f399[_0x3637da(0x19d)];return console[_0x3637da(0x1ba)](a54_0x4da4e1[_0x3637da(0x11d)](_0x2677e4['targetExists']?_0x3637da(0x148):'✔\x20Clone\x20complete')),console[_0x3637da(0x1ba)](_0x3637da(0x10e)+_0x396309['newProjectName']),console[_0x3637da(0x1ba)](_0x3637da(0x20c)+_0x396309[_0x3637da(0x20b)]),console['error'](_0x3637da(0x168)+_0x396309[_0x3637da(0x2a5)]),await this['showWorkflowConsoleUrl'](_0x1a0373,_0x396309[_0x3637da(0x26e)],_0x5552d8[_0x3637da(0x1d3)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x49055a(0x290)]=a54_0x49055a(0x293);[a54_0x49055a(0x147)]=a54_0x49055a(0x273);async[a54_0x49055a(0x100)](_0x3dd243){const _0x3b9ff9=a54_0x49055a,{options:_0xa4e395,args:_0x41e220,tdx:_0x4c5007}=_0x3dd243,_0x3b6b8f=_0x41e220[0x0];if(!_0x3b6b8f)return console[_0x3b9ff9(0x1ba)](_0x3b9ff9(0x1aa)),console['error']('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0xa4e395['verbose']&&console[_0x3b9ff9(0x1ba)](_0x3b9ff9(0x275)+_0x3b6b8f);if(!_0xa4e395[_0x3b9ff9(0x149)]){if(!isInteractive())return console[_0x3b9ff9(0x1ba)](a54_0x4da4e1[_0x3b9ff9(0x27c)](_0x3b9ff9(0x124)),_0x3b9ff9(0x2a8)),console[_0x3b9ff9(0x1ba)](a54_0x4da4e1['dim'](_0x3b9ff9(0x102))),0x1;const _0x292d17=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x3b6b8f+_0x3b9ff9(0x28b));if(!_0x292d17)return console[_0x3b9ff9(0x1ba)](a54_0x4da4e1[_0x3b9ff9(0x294)](_0x3b9ff9(0x18c))),0x1;}const _0x511132=await withSpinner(_0x3b9ff9(0x106)+_0x3b6b8f+_0x3b9ff9(0x29b),()=>_0x4c5007[_0x3b9ff9(0x133)]['delete'](_0x3b6b8f),{'verbose':_0xa4e395['verbose']}),_0x114e6e=_0x511132[_0x3b9ff9(0x19d)];return console[_0x3b9ff9(0x1ba)](_0x3b9ff9(0x1ef)+_0x114e6e[_0x3b9ff9(0x195)]),console[_0x3b9ff9(0x1ba)](_0x3b9ff9(0x20c)+_0x114e6e[_0x3b9ff9(0x145)]),0x0;}}export function parseKeyValue(_0x897f0e){const _0x799c28=a54_0x49055a,_0x47d3ee=_0x897f0e[_0x799c28(0x2ac)]('=');if(_0x47d3ee===-0x1)throw new Error(_0x799c28(0x101)+_0x897f0e+'.\x20Expected\x20format:\x20KEY=VALUE');const _0xe6636c=_0x897f0e['substring'](0x0,_0x47d3ee),_0x217dd7=_0x897f0e['substring'](_0x47d3ee+0x1);if(!_0xe6636c)throw new Error(_0x799c28(0x271));return{'key':_0xe6636c,'value':_0x217dd7};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']=a54_0x49055a(0x1b2);[a54_0x49055a(0x147)]=a54_0x49055a(0x21d);async['execute'](_0x48c074){const _0x5e2c2e=a54_0x49055a,{options:_0x1b791d,args:_0x16bd5c,tdx:_0x4d11e4}=_0x48c074,_0x5a1b1f=this[_0x5e2c2e(0x132)](_0x16bd5c,_0x1b791d);if(!_0x5a1b1f)return 0x1;_0x1b791d[_0x5e2c2e(0x1ad)]&&console[_0x5e2c2e(0x1ba)]('Project:\x20'+_0x5a1b1f);const _0x5f1e16=await withSpinner(_0x5e2c2e(0x16c),()=>_0x4d11e4['workflow'][_0x5e2c2e(0x207)](_0x5a1b1f),{'verbose':_0x1b791d[_0x5e2c2e(0x1ad)]}),{secrets:_0x5e44bc}=_0x5f1e16[_0x5e2c2e(0x19d)];return console[_0x5e2c2e(0x1ba)](_0x5e2c2e(0x233)+_0x5e44bc['length']+_0x5e2c2e(0x107)+(_0x5e44bc['length']!==0x1?'s':'')),await handleSDKOutput(_0x5e44bc,_0x1b791d),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x49055a(0x290)]='workflow:secrets:set';[a54_0x49055a(0x147)]=a54_0x49055a(0x1dd);async['execute'](_0x5908cc){const _0x47b1ad=a54_0x49055a,{options:_0x4a1931,args:_0x595585,tdx:_0x2db9cb}=_0x5908cc;let _0x3789fd,_0x49318c;if(_0x595585['length']>=0x1&&!_0x595585[0x0]['includes']('='))_0x3789fd=_0x595585[0x0],_0x49318c=_0x595585[_0x47b1ad(0x15f)](0x1);else{if(_0x595585['length']>=0x1&&_0x4a1931[_0x47b1ad(0x1b1)])_0x3789fd=_0x4a1931[_0x47b1ad(0x1b1)],_0x49318c=_0x595585;else return _0x595585[_0x47b1ad(0x292)]>=0x1?(console[_0x47b1ad(0x1ba)](_0x47b1ad(0x160)),console[_0x47b1ad(0x1ba)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x47b1ad(0x1ba)](_0x47b1ad(0x18a)),console[_0x47b1ad(0x1ba)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1);}if(_0x49318c[_0x47b1ad(0x292)]===0x0)return console[_0x47b1ad(0x1ba)](_0x47b1ad(0x18a)),console['error'](_0x47b1ad(0x1da)),0x1;const _0x5c7984={};try{for(const _0x4efdc2 of _0x49318c){const {key:_0xf49c77,value:_0x2267a8}=parseKeyValue(_0x4efdc2);_0x5c7984[_0xf49c77]=_0x2267a8;}}catch(_0x757976){return _0x757976 instanceof Error&&console['error'](a54_0x4da4e1[_0x47b1ad(0x27c)](_0x47b1ad(0x154)),_0x757976[_0x47b1ad(0x1fa)]),0x1;}const _0x1bfb3f=Object['keys'](_0x5c7984);_0x4a1931[_0x47b1ad(0x1ad)]&&(console[_0x47b1ad(0x1ba)](_0x47b1ad(0x275)+_0x3789fd),console[_0x47b1ad(0x1ba)](_0x47b1ad(0x1fe)+_0x1bfb3f[_0x47b1ad(0x12e)](',\x20')));const _0x124b99=await withSpinner(_0x1bfb3f[_0x47b1ad(0x292)]===0x1?_0x47b1ad(0x21b):'Setting\x20'+_0x1bfb3f['length']+_0x47b1ad(0x113),()=>_0x2db9cb[_0x47b1ad(0x133)]['setSecrets'](_0x3789fd,_0x5c7984),{'verbose':_0x4a1931['verbose']}),_0x399ff7=_0x124b99[_0x47b1ad(0x19d)];return console[_0x47b1ad(0x1ba)](_0x1bfb3f[_0x47b1ad(0x292)]===0x1?'✔\x20Secret\x20\x27'+_0x399ff7[_0x47b1ad(0x12d)][0x0]+_0x47b1ad(0x1b6)+_0x399ff7[_0x47b1ad(0x195)]+'\x27':'✔\x20'+_0x399ff7[_0x47b1ad(0x12d)][_0x47b1ad(0x292)]+_0x47b1ad(0x212)+_0x399ff7[_0x47b1ad(0x195)]+'\x27'),(_0x4a1931[_0x47b1ad(0x197)]||_0x4a1931[_0x47b1ad(0x26b)])&&await handleSingleObjectOutput(_0x399ff7,_0x4a1931),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a54_0x49055a(0x173);['description']='Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project';async[a54_0x49055a(0x100)](_0x5901ea){const _0x544b32=a54_0x49055a,{options:_0x251194,args:_0x3eac10,tdx:_0x29f32f}=_0x5901ea;let _0x1c8aa8,_0x39389a;if(_0x3eac10[_0x544b32(0x292)]>=0x2)_0x1c8aa8=_0x3eac10[0x0],_0x39389a=_0x3eac10[0x1];else{if(_0x3eac10[_0x544b32(0x292)]===0x1&&_0x251194[_0x544b32(0x1b1)])_0x1c8aa8=_0x251194[_0x544b32(0x1b1)],_0x39389a=_0x3eac10[0x0];else return _0x3eac10['length']===0x1?(console['error'](_0x544b32(0x160)),console['error'](_0x544b32(0x140)),0x1):(console[_0x544b32(0x1ba)]('Error:\x20Secret\x20key\x20is\x20required'),console['error'](_0x544b32(0x1dc)),0x1);}_0x251194['verbose']&&(console[_0x544b32(0x1ba)](_0x544b32(0x275)+_0x1c8aa8),console[_0x544b32(0x1ba)]('Key:\x20'+_0x39389a));if(!_0x251194['yes']){if(!isInteractive())return console[_0x544b32(0x1ba)](a54_0x4da4e1[_0x544b32(0x27c)]('\x0aError:'),_0x544b32(0x2a8)),console[_0x544b32(0x1ba)](a54_0x4da4e1[_0x544b32(0x2a4)](_0x544b32(0x102))),0x1;const _0x2d66b5=await confirmKey(_0x544b32(0x215)+_0x39389a+_0x544b32(0x27b)+_0x1c8aa8+'\x27?');if(!_0x2d66b5)return console[_0x544b32(0x1ba)](a54_0x4da4e1[_0x544b32(0x294)](_0x544b32(0x18c))),0x1;}const _0x3d8654=await withSpinner(_0x544b32(0x28f),()=>_0x29f32f[_0x544b32(0x133)]['deleteSecret'](_0x1c8aa8,_0x39389a),{'verbose':_0x251194[_0x544b32(0x1ad)]}),_0x473785=_0x3d8654[_0x544b32(0x19d)];return console[_0x544b32(0x1ba)](_0x544b32(0x24a)+_0x473785[_0x544b32(0x18d)]+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x473785[_0x544b32(0x195)]+'\x27'),(_0x251194[_0x544b32(0x197)]||_0x251194[_0x544b32(0x26b)])&&await handleSingleObjectOutput(_0x473785,_0x251194),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(_0xea952){const _0x3136c9=a54_0x49055a,_0x47f97e=Math[_0x3136c9(0x269)](_0xea952/0x3e8),_0x3f7584=Math[_0x3136c9(0x269)](_0x47f97e/0x3c),_0x67f66a=Math[_0x3136c9(0x269)](_0x3f7584/0x3c),_0x2e53e8=Math[_0x3136c9(0x269)](_0x67f66a/0x18);if(_0x2e53e8>0x0){const _0x4f09a3=_0x67f66a%0x18;return _0x4f09a3>0x0?_0x2e53e8+'d\x20'+_0x4f09a3+'h':_0x2e53e8+'d';}else{if(_0x67f66a>0x0){const _0x502bcd=_0x3f7584%0x3c;return _0x502bcd>0x0?_0x67f66a+'h\x20'+_0x502bcd+'m':_0x67f66a+'h';}else{if(_0x3f7584>0x0){const _0x1231da=_0x47f97e%0x3c;return _0x1231da>0x0?_0x3f7584+'m\x20'+_0x1231da+'s':_0x3f7584+'m';}else return _0x47f97e+'s';}}}function formatTimestamp(_0x3be459,_0x5cbcd4){const _0x2d70a1=a54_0x49055a,_0x383c96=new Date(_0x3be459),_0x35eb85=String(_0x383c96['getHours']())['padStart'](0x2,'0'),_0x5db851=String(_0x383c96[_0x2d70a1(0x156)]())[_0x2d70a1(0x1e0)](0x2,'0'),_0x258309=_0x35eb85+':'+_0x5db851,_0x920c52=_0x383c96['getFullYear']()===_0x5cbcd4[_0x2d70a1(0x18b)]()&&_0x383c96[_0x2d70a1(0x27e)]()===_0x5cbcd4['getMonth']()&&_0x383c96[_0x2d70a1(0x15e)]()===_0x5cbcd4[_0x2d70a1(0x15e)]();if(_0x920c52)return _0x258309;else{const _0x1c0cb8=String(_0x383c96[_0x2d70a1(0x27e)]()+0x1)[_0x2d70a1(0x1e0)](0x2,'0'),_0x204e73=String(_0x383c96[_0x2d70a1(0x15e)]())[_0x2d70a1(0x1e0)](0x2,'0');return _0x1c0cb8+'-'+_0x204e73+'\x20'+_0x258309;}}function formatDate(_0x1bbe20){const _0x3f9050=a54_0x49055a,_0x3d472f=_0x1bbe20[_0x3f9050(0x18b)](),_0xb08f00=String(_0x1bbe20[_0x3f9050(0x27e)]()+0x1)['padStart'](0x2,'0'),_0x24e5fd=String(_0x1bbe20['getDate']())[_0x3f9050(0x1e0)](0x2,'0');return _0x3d472f+'-'+_0xb08f00+'-'+_0x24e5fd;}function getTaskStateIcon(_0x5e0e25){const _0x54a9b3={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x54a9b3[_0x5e0e25]||'⚪';}function getBarChar(_0x90e0ff){const _0x2355d3=a54_0x49055a;return _0x90e0ff===_0x2355d3(0x1ba)||_0x90e0ff===_0x2355d3(0x162)?'×':'─';}function getBarColor(_0x4fc1e2){const _0x59b631=a54_0x49055a,_0x24a8f5={'success':a54_0x4da4e1[_0x59b631(0x11d)],'error':a54_0x4da4e1['red'],'group_error':a54_0x4da4e1[_0x59b631(0x27c)],'running':a54_0x4da4e1[_0x59b631(0x21f)],'blocked':a54_0x4da4e1['yellow'],'planned':a54_0x4da4e1[_0x59b631(0x2a4)],'canceling':a54_0x4da4e1[_0x59b631(0x294)]};return _0x24a8f5[_0x4fc1e2]||a54_0x4da4e1[_0x59b631(0x103)];}function parseTaskName(_0x5b7976){const _0x26c5c7=a54_0x49055a;let _0x35326e=_0x5b7976['replace'](/^\++/,'');const _0x269227=_0x35326e['split']('+'),_0x2553f1=_0x269227[_0x26c5c7(0x292)]>0x1?_0x269227[_0x26c5c7(0x292)]-0x2:0x0,_0x16eea0=_0x269227[_0x269227['length']-0x1]||_0x35326e;return{'level':_0x2553f1,'name':'+'+_0x16eea0};}function truncateTaskName(_0x20cd58,_0x369f09){const _0xc4960d=a54_0x49055a,_0x408900=stringWidth(_0x20cd58);if(_0x408900<=_0x369f09)return _0x20cd58;let _0x2ae3c0=_0x20cd58;while(stringWidth(_0x2ae3c0+'…')>_0x369f09&&_0x2ae3c0['length']>0x0){_0x2ae3c0=_0x2ae3c0[_0xc4960d(0x15f)](0x0,-0x1);}return _0x2ae3c0+'…';}function calculateTimeScale(_0x552374,_0x4db8f1){const _0x13957a=a54_0x49055a;return{'startTime':_0x552374['start'],'endTime':_0x552374['end'],'durationMs':_0x552374[_0x13957a(0x279)],'msPerChar':_0x552374['duration']/_0x4db8f1};}function timeToPosition(_0x432c28,_0x1f9357,_0x11e65d){const _0x56277f=a54_0x49055a,_0x20803c=_0x432c28-_0x1f9357[_0x56277f(0x223)],_0x13be19=Math[_0x56277f(0x269)](_0x20803c/_0x1f9357[_0x56277f(0x272)]);return Math[_0x56277f(0x1b3)](0x0,Math['min'](_0x13be19,_0x11e65d));}function renderTimeAxis(_0xfddf5,_0x5e9d16){const _0x97cc1=a54_0x49055a,_0x356782=Math['min'](TIMELINE_CONFIG[_0x97cc1(0x115)],Math[_0x97cc1(0x1b3)](TIMELINE_CONFIG[_0x97cc1(0x29f)],Math[_0x97cc1(0x269)](_0x5e9d16/TIMELINE_CONFIG[_0x97cc1(0x232)]))),_0x53d1c9=_0xfddf5['durationMs']/(_0x356782-0x1),_0xa0f42e=new Date(_0xfddf5[_0x97cc1(0x223)]),_0xfb826a=[];for(let _0x23cfe5=0x0;_0x23cfe5<_0x356782;_0x23cfe5++){const _0x3d946e=_0xfddf5[_0x97cc1(0x223)]+_0x23cfe5*_0x53d1c9,_0x458158=timeToPosition(_0x3d946e,_0xfddf5,_0x5e9d16),_0x4cf0b4=formatTimestamp(_0x3d946e,_0xa0f42e);_0xfb826a[_0x97cc1(0x1d8)]({'pos':_0x458158,'text':_0x4cf0b4});}const _0x4d0b67=new Array(_0x5e9d16)[_0x97cc1(0x17c)]('\x20');let _0x2ab5a2=-0x1;for(const {pos:_0x23f361,text:_0x32bdc2}of _0xfb826a){let _0x2ff046=Math[_0x97cc1(0x1b3)](0x0,_0x23f361-Math[_0x97cc1(0x269)](_0x32bdc2[_0x97cc1(0x292)]/0x2));_0x2ff046<=_0x2ab5a2+TIMELINE_CONFIG[_0x97cc1(0x225)]&&(_0x2ff046=_0x2ab5a2+TIMELINE_CONFIG[_0x97cc1(0x225)]+0x1);_0x2ff046+_0x32bdc2[_0x97cc1(0x292)]>_0x5e9d16&&(_0x2ff046=_0x5e9d16-_0x32bdc2[_0x97cc1(0x292)]);if(_0x2ff046>=0x0&&_0x2ff046+_0x32bdc2['length']<=_0x5e9d16&&_0x2ff046>_0x2ab5a2){for(let _0x2bafae=0x0;_0x2bafae<_0x32bdc2['length'];_0x2bafae++){_0x4d0b67[_0x2ff046+_0x2bafae]=_0x32bdc2[_0x2bafae];}_0x2ab5a2=_0x2ff046+_0x32bdc2[_0x97cc1(0x292)]-0x1;}}return _0x4d0b67['join']('');}function renderTaskRow(_0x1adf70,_0x5d5e43,_0x5ac0ad,_0x5df3c4){const _0x58d3fc=a54_0x49055a,{level:_0x2975d5,name:_0x3d5f43}=parseTaskName(_0x1adf70[_0x58d3fc(0x290)]),_0xe8b8d4='\x20'[_0x58d3fc(0x23a)](_0x2975d5),_0x4502ca=_0x1adf70[_0x58d3fc(0x248)]?'('+formatElapsed(_0x1adf70[_0x58d3fc(0x248)][_0x58d3fc(0x279)])+')':'',_0x14c466=stringWidth(_0x4502ca),_0x102212=_0x2975d5*0x1,_0xaa8803=_0x5df3c4-_0x102212-_0x14c466-0x1,_0x4ee121=truncateTaskName(_0x3d5f43,_0xaa8803),_0x780079=_0xe8b8d4+_0x4ee121,_0x59fe84=stringWidth(_0x780079),_0x5d7a51=_0x5df3c4-_0x59fe84-_0x14c466,_0x4c2963=_0x780079+'\x20'[_0x58d3fc(0x23a)](Math[_0x58d3fc(0x1b3)](0x1,_0x5d7a51))+a54_0x4da4e1[_0x58d3fc(0x2a4)](_0x4502ca),_0xf1c636=getTaskStateIcon(_0x1adf70[_0x58d3fc(0x181)]),_0x197a15=new Array(_0x5ac0ad)[_0x58d3fc(0x17c)]('\x20');if(_0x1adf70[_0x58d3fc(0x248)]){const _0x21a431=timeToPosition(_0x1adf70[_0x58d3fc(0x248)][_0x58d3fc(0x118)],_0x5d5e43,_0x5ac0ad),_0x1988c9=timeToPosition(_0x1adf70[_0x58d3fc(0x248)][_0x58d3fc(0x1d9)],_0x5d5e43,_0x5ac0ad),_0x21910c=getBarChar(_0x1adf70[_0x58d3fc(0x181)]),_0x315a07=Math[_0x58d3fc(0x1b3)](_0x21a431+0x1,_0x1988c9);for(let _0x2197b1=_0x21a431;_0x2197b1<Math[_0x58d3fc(0x23e)](_0x315a07,_0x5ac0ad);_0x2197b1++){_0x197a15[_0x2197b1]=_0x21910c;}}const _0x4da5b5=getBarColor(_0x1adf70[_0x58d3fc(0x181)]),_0xaaffa9=_0x197a15[_0x58d3fc(0x2a9)](_0x59016e=>_0x59016e==='\x20'?'\x20':_0x4da5b5(_0x59016e))[_0x58d3fc(0x12e)]('');return _0xf1c636+'\x20'+_0x4c2963+'│'+_0xaaffa9+'│';}function calculateStats(_0xc92c68){const _0x3a1be9=a54_0x49055a,_0x1c536c={'total':_0xc92c68[_0x3a1be9(0x292)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x204560 of _0xc92c68){if(_0x204560[_0x3a1be9(0x181)]==='success')_0x1c536c[_0x3a1be9(0x200)]++;else{if(_0x204560['state']===_0x3a1be9(0x1ba)||_0x204560['state']===_0x3a1be9(0x162))_0x1c536c[_0x3a1be9(0x1ba)]++;else _0x204560['state']==='running'?_0x1c536c[_0x3a1be9(0x10c)]++:_0x1c536c['pending']++;}}return _0x1c536c;}function formatStats(_0x42b0c1){const _0x26c1c7=a54_0x49055a;return['Total:\x20'+_0x42b0c1[_0x26c1c7(0x231)],'✅\x20'+_0x42b0c1[_0x26c1c7(0x200)],'❌\x20'+_0x42b0c1['error'],_0x26c1c7(0x220)+_0x42b0c1[_0x26c1c7(0x10c)],'⏳\x20'+_0x42b0c1['pending']][_0x26c1c7(0x12e)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']='workflow:timeline';[a54_0x49055a(0x147)]='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async['execute'](_0xc18e1e){const _0x310141=a54_0x49055a,{options:_0x2f617c,args:_0x430c77,tdx:_0x11f4eb}=_0xc18e1e;let _0x3ea8f3,_0xc9e0e9,_0x2dcaae=![];if(_0x430c77[0x0]){if(_0x430c77[0x0][_0x310141(0x267)]('.')){const _0xc9ea68=this[_0x310141(0x21c)](_0x430c77,_0x2f617c);if(!_0xc9ea68)return 0x1;_0x3ea8f3=_0xc9ea68['projectName'],_0xc9e0e9=_0xc9ea68[_0x310141(0x270)];}else{_0xc9e0e9=_0x430c77[0x0],_0x3ea8f3=_0x2f617c[_0x310141(0x1b1)];if(!_0x3ea8f3)return console[_0x310141(0x1ba)](a54_0x4da4e1[_0x310141(0x27c)](_0x310141(0x154)),_0x310141(0x1fc)),0x1;_0x2dcaae=!![];}}else{const _0x75b0ab=this[_0x310141(0x21c)](_0x430c77,_0x2f617c);if(!_0x75b0ab)return 0x1;_0x3ea8f3=_0x75b0ab[_0x310141(0x195)],_0xc9e0e9=_0x75b0ab[_0x310141(0x270)];}if(_0x2f617c['verbose']){if(_0x3ea8f3&&_0xc9e0e9)console['error'](_0x310141(0x1df)+_0x3ea8f3+'.'+_0xc9e0e9);else _0x3ea8f3&&console[_0x310141(0x1ba)]('Filter:\x20project='+_0x3ea8f3);}const _0x7f9f04=_0x2f617c[_0x310141(0x1f1)],_0x22599a=_0x2f617c[_0x310141(0x29d)];if(_0x7f9f04){_0x22599a&&console[_0x310141(0x1ba)](a54_0x4da4e1[_0x310141(0x294)](_0x310141(0x1e2)),_0x310141(0x282));const _0x271afc=_0x2f617c[_0x310141(0x1f9)];return _0x271afc?await this[_0x310141(0x1ee)](_0xc18e1e,_0x7f9f04):await this[_0x310141(0x18e)](_0xc18e1e,_0x7f9f04,_0x2f617c),0x0;}if(_0x22599a){const _0x295fe0=await withSpinner(_0x310141(0x16f),()=>_0x11f4eb[_0x310141(0x133)][_0x310141(0x17b)]({'projectName':_0x3ea8f3,'workflowName':_0xc9e0e9,'limit':0x64}),{'verbose':_0x2f617c[_0x310141(0x1ad)]}),_0x208f6e=_0x295fe0[_0x310141(0x19d)][_0x310141(0x1ce)](_0x4e7504=>_0x4e7504['id']===_0x22599a);if(!_0x208f6e)return console[_0x310141(0x1ba)](a54_0x4da4e1[_0x310141(0x27c)](_0x310141(0x154)),_0x310141(0x191)+_0x22599a),0x1;if(!_0x208f6e[_0x310141(0x17f)]?.['id'])return console[_0x310141(0x1ba)](a54_0x4da4e1[_0x310141(0x27c)](_0x310141(0x154)),'Session\x20'+_0x22599a+_0x310141(0x268)),0x1;const _0x4212f=_0x208f6e[_0x310141(0x17f)]['id'];_0x2f617c['verbose']&&console['error'](_0x310141(0x180)+_0x4212f+'\x20from\x20session\x20'+_0x22599a);const _0x58f6b8=_0x2f617c['follow'];return _0x58f6b8?await this[_0x310141(0x1ee)](_0xc18e1e,_0x4212f):await this[_0x310141(0x18e)](_0xc18e1e,_0x4212f,_0x2f617c),0x0;}const _0xad1479=await withSpinner('Loading\x20sessions...',()=>_0x11f4eb[_0x310141(0x133)][_0x310141(0x17b)]({'projectName':_0x3ea8f3,'workflowName':_0xc9e0e9,'limit':_0x2f617c[_0x310141(0x1c0)]||0x32}),{'verbose':_0x2f617c['verbose']}),_0x511ffe=_0xad1479[_0x310141(0x19d)];if(_0x511ffe[_0x310141(0x292)]===0x0){if(_0x3ea8f3&&_0xc9e0e9)console[_0x310141(0x1ba)]('No\x20sessions\x20found\x20for:\x20'+_0x3ea8f3+'.'+_0xc9e0e9);else _0x3ea8f3?console[_0x310141(0x1ba)](_0x310141(0x1ca)+_0x3ea8f3):(console[_0x310141(0x1ba)]('No\x20workflow\x20sessions\x20found'),console[_0x310141(0x1ba)](a54_0x4da4e1['dim']('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x511ffe[_0x310141(0x238)]((_0x3b1606,_0x38b7a3)=>{const _0x3b2e89=_0x310141,_0x859d6=_0x3b1606[_0x3b2e89(0x143)]||'',_0x2e71e0=_0x38b7a3[_0x3b2e89(0x143)]||'';return _0x2e71e0[_0x3b2e89(0x13e)](_0x859d6);});if(_0x2f617c['json']||_0x2f617c['jsonl'])return await handleSDKOutput(_0x511ffe,_0x2f617c),0x0;let _0x33fa1c;if(_0x2dcaae){const _0xdbe3eb=_0x511ffe[0x0];if(!_0xdbe3eb[_0x310141(0x17f)]?.['id'])return console[_0x310141(0x1ba)]('Latest\x20session\x20has\x20no\x20attempt'),0x0;_0x33fa1c=_0xdbe3eb[_0x310141(0x17f)]['id'],_0x2f617c['verbose']&&console[_0x310141(0x1ba)](_0x310141(0x246)+_0xdbe3eb['sessionTime']);}else{const _0x485c68=_0x511ffe['map'](_0x3caac1=>{const _0x1f76e0=_0x310141,_0x4ba8fd=getAttemptStatusDisplay(_0x3caac1['lastAttempt']);return{'title':_0x3caac1['project']?.[_0x1f76e0(0x290)]+'.'+_0x3caac1[_0x1f76e0(0x133)]?.['name']+_0x1f76e0(0x1a6)+_0x3caac1[_0x1f76e0(0x143)]+'\x20'+_0x4ba8fd[_0x1f76e0(0x1f7)],'value':_0x3caac1[_0x1f76e0(0x17f)]?.['id']||'','description':_0x4ba8fd[_0x1f76e0(0x12c)]};}),_0x13d0e=await a54_0x29f2c3({'type':'select','name':'attemptId','message':_0x310141(0x203),'choices':_0x485c68[_0x310141(0x299)](_0x5aa194=>_0x5aa194[_0x310141(0x1bc)]!=='')});if(!_0x13d0e['attemptId'])return 0x0;_0x33fa1c=_0x13d0e[_0x310141(0x1f1)];}const _0x425a24=_0x2f617c['follow'];return _0x425a24?await this[_0x310141(0x1ee)](_0xc18e1e,_0x33fa1c):await this[_0x310141(0x18e)](_0xc18e1e,_0x33fa1c,_0x2f617c),0x0;}async['renderSingleTimeline'](_0xa4f93,_0x5ca56e,_0x4762e5){const _0x4e6232=a54_0x49055a,{tdx:_0x1f6c8b}=_0xa4f93;let _0xdc2af9,_0x121a50;try{[_0xdc2af9,_0x121a50]=await Promise[_0x4e6232(0x1cd)]([_0x1f6c8b[_0x4e6232(0x133)]['attempt'](_0x5ca56e),_0x1f6c8b[_0x4e6232(0x133)]['tasks'](_0x5ca56e,![])]);}catch(_0x3b0025){console[_0x4e6232(0x1ba)](a54_0x4da4e1[_0x4e6232(0x27c)](_0x4e6232(0x117)));_0x4762e5[_0x4e6232(0x1ad)]&&console[_0x4e6232(0x1ba)](_0x3b0025);throw _0x3b0025;}if(_0x4762e5['json']||_0x4762e5[_0x4e6232(0x26b)]){const _0x2a5adc=this[_0x4e6232(0x10f)](_0xdc2af9,_0x121a50);await handleSDKOutput([_0x2a5adc],_0x4762e5);return;}const _0x172e7a=_0x1f6c8b[_0x4e6232(0x26f)][_0x4e6232(0x1d3)],_0x1bc241=this[_0x4e6232(0x150)](_0xdc2af9,_0x121a50,_0x172e7a);console[_0x4e6232(0x1ae)](_0x1bc241);}async[a54_0x49055a(0x1ee)](_0x19e3ac,_0xd1597f){const _0x5cd7a9=a54_0x49055a,{tdx:_0x4f4914}=_0x19e3ac,_0x3ba66e=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x21eade=TIMELINE_CONFIG[_0x5cd7a9(0x208)];let _0x392c21=0x0;while(_0x392c21<_0x21eade){process[_0x5cd7a9(0x24e)][_0x5cd7a9(0x25b)]&&process['stdout'][_0x5cd7a9(0x1e1)]('\x1bc');let _0x4ebddb,_0x5870c1;try{[_0x4ebddb,_0x5870c1]=await Promise[_0x5cd7a9(0x1cd)]([_0x4f4914['workflow'][_0x5cd7a9(0x204)](_0xd1597f),_0x4f4914[_0x5cd7a9(0x133)][_0x5cd7a9(0x274)](_0xd1597f,![])]);}catch(_0x8a3d51){console[_0x5cd7a9(0x1ba)](a54_0x4da4e1['red'](_0x5cd7a9(0x158)));_0x392c21>0x0&&console[_0x5cd7a9(0x1ba)](a54_0x4da4e1[_0x5cd7a9(0x2a4)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x392c21));throw _0x8a3d51;}const _0x40203c=_0x4f4914[_0x5cd7a9(0x26f)][_0x5cd7a9(0x1d3)],_0x1b85de=this[_0x5cd7a9(0x150)](_0x4ebddb,_0x5870c1,_0x40203c);console[_0x5cd7a9(0x1ae)](_0x1b85de);const _0x2cd0cf=_0x4ebddb[_0x5cd7a9(0x242)]&&_0x5870c1['every'](_0x21480e=>_0x21480e[_0x5cd7a9(0x181)]!==_0x5cd7a9(0x10c)&&_0x21480e[_0x5cd7a9(0x181)]!==_0x5cd7a9(0x1e6));if(_0x2cd0cf){console[_0x5cd7a9(0x1ba)](a54_0x4da4e1[_0x5cd7a9(0x11d)](_0x5cd7a9(0x235)));break;}console[_0x5cd7a9(0x1ba)](a54_0x4da4e1[_0x5cd7a9(0x2a4)](_0x5cd7a9(0x163)+_0x392c21*0x2+_0x5cd7a9(0x16b))),await new Promise(_0x232dc5=>setTimeout(_0x232dc5,_0x3ba66e)),_0x392c21++;}_0x392c21>=_0x21eade&&console[_0x5cd7a9(0x1ba)](a54_0x4da4e1['yellow'](_0x5cd7a9(0x29c)));}[a54_0x49055a(0x150)](_0x1edb97,_0x1edb96,_0x1116c3){const _0x5273ee=a54_0x49055a,_0x5e45e1=[],_0x3a22e7=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x5859ab=0x5,_0x19e477=process['stdout'][_0x5273ee(0x1a9)]||0x78,_0x3679c2=_0x19e477-_0x3a22e7-_0x5859ab,_0x119764=Math[_0x5273ee(0x1b3)](TIMELINE_CONFIG[_0x5273ee(0x1af)],Math['min'](_0x3679c2,TIMELINE_CONFIG[_0x5273ee(0x164)])),_0x2dcded=new Date(_0x1edb97[_0x5273ee(0x261)])[_0x5273ee(0x14c)](),_0x1b24f2=_0x1edb97[_0x5273ee(0x1cc)]?new Date(_0x1edb97['finishedAt'])['getTime']():Date[_0x5273ee(0x25d)](),_0x125b96={'start':_0x2dcded,'end':_0x1b24f2,'duration':_0x1b24f2-_0x2dcded},_0x4b57aa=new Map(),_0x171642=[];for(const _0x2e23b6 of _0x1edb96){if(_0x2e23b6[_0x5273ee(0x296)]){const _0x79176c=new Date(_0x2e23b6[_0x5273ee(0x296)])[_0x5273ee(0x14c)](),_0xe23728=_0x2e23b6[_0x5273ee(0x28a)]?new Date(_0x2e23b6[_0x5273ee(0x28a)])[_0x5273ee(0x14c)]():Date[_0x5273ee(0x25d)](),_0x219630={'start':_0x79176c,'end':_0xe23728,'duration':_0xe23728-_0x79176c};_0x4b57aa['set'](_0x2e23b6['id'],_0x219630),_0x171642[_0x5273ee(0x1d8)]({'name':_0x2e23b6[_0x5273ee(0x10d)],'state':_0x2e23b6[_0x5273ee(0x181)]||_0x5273ee(0x196),'window':_0x219630});}else _0x171642[_0x5273ee(0x1d8)]({'name':_0x2e23b6[_0x5273ee(0x10d)],'state':_0x2e23b6['state']||_0x5273ee(0x1e6),'window':undefined});}_0x171642[_0x5273ee(0x238)]((_0x1939d8,_0x2c950f)=>{const _0x5e617c=_0x5273ee;if(!_0x1939d8[_0x5e617c(0x248)])return 0x1;if(!_0x2c950f[_0x5e617c(0x248)])return-0x1;return _0x1939d8[_0x5e617c(0x248)][_0x5e617c(0x118)]-_0x2c950f[_0x5e617c(0x248)][_0x5e617c(0x118)];});const _0x274365=_0x171642[_0x5273ee(0x292)],_0x4f7ffe=_0x274365>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x4f7ffe&&_0x171642[_0x5273ee(0x169)](TIMELINE_CONFIG[_0x5273ee(0x15c)]);const _0x3f6ebe=calculateTimeScale(_0x125b96,_0x119764),_0x133c35=_0x1edb97[_0x5273ee(0x242)]?_0x1edb97[_0x5273ee(0x200)]?a54_0x4da4e1['green'](_0x5273ee(0x200)):a54_0x4da4e1[_0x5273ee(0x27c)]('error'):a54_0x4da4e1[_0x5273ee(0x21f)](_0x5273ee(0x10c)),_0x5bfee4=_0x1edb97[_0x5273ee(0x283)]?.['id'],_0x90b8a9=_0x1edb97[_0x5273ee(0x29d)];let _0x503830;if(_0x5bfee4&&_0x90b8a9){const _0x315413=getWorkflowAttemptUrl(_0x1116c3,_0x5bfee4,_0x90b8a9,_0x1edb97['id']);_0x503830=hyperlink(a54_0x4da4e1['dim'](_0x1edb97['id']),_0x315413);}else _0x503830=a54_0x4da4e1[_0x5273ee(0x2a4)](_0x1edb97['id']);_0x5e45e1[_0x5273ee(0x1d8)](_0x5273ee(0x1cf)+_0x503830+'\x20-\x20'+_0x133c35+_0x5273ee(0x1a6)+formatElapsed(_0x125b96['duration']));if(_0x171642['length']>0x0){const _0x2d1afb=renderTimeAxis(_0x3f6ebe,_0x119764),_0xe5d0dd=new Date(_0x125b96[_0x5273ee(0x118)]),_0x4c584b=formatDate(_0xe5d0dd),_0x55f0e4=TIMELINE_CONFIG[_0x5273ee(0x1e5)]+TIMELINE_CONFIG[_0x5273ee(0x1a1)]+_0x3a22e7,_0x10dc4e=_0x4c584b[_0x5273ee(0x1e0)](_0x55f0e4),_0x1855e0=a54_0x4da4e1[_0x5273ee(0x2a4)](_0x10dc4e);_0x5e45e1[_0x5273ee(0x1d8)](_0x1855e0+'\x20'+_0x2d1afb);for(const _0x1cca86 of _0x171642){_0x5e45e1[_0x5273ee(0x1d8)](renderTaskRow(_0x1cca86,_0x3f6ebe,_0x119764,_0x3a22e7));}const _0x35cfe9=calculateStats(_0x171642);_0x5e45e1[_0x5273ee(0x1d8)](formatStats(_0x35cfe9)),_0x4f7ffe&&_0x5e45e1[_0x5273ee(0x1d8)](a54_0x4da4e1[_0x5273ee(0x294)](_0x5273ee(0x111)+TIMELINE_CONFIG[_0x5273ee(0x15c)]+_0x5273ee(0x198)+_0x274365+_0x5273ee(0x12f))),_0x5e45e1[_0x5273ee(0x1d8)](''),_0x5e45e1[_0x5273ee(0x1d8)](a54_0x4da4e1[_0x5273ee(0x2a4)](_0x5273ee(0x20d))+('tdx\x20wf\x20attempt\x20'+_0x1edb97['id']+_0x5273ee(0x144))+a54_0x4da4e1['dim'](_0x5273ee(0x192)));}else _0x5e45e1['push']('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x5e45e1['join']('\x0a');}[a54_0x49055a(0x10f)](_0x255292,_0x50c395){const _0x6dd8a9=a54_0x49055a,_0x4d5f22=new Date(_0x255292[_0x6dd8a9(0x261)])[_0x6dd8a9(0x14c)](),_0x12995e=_0x255292[_0x6dd8a9(0x1cc)]?new Date(_0x255292[_0x6dd8a9(0x1cc)])[_0x6dd8a9(0x14c)]():Date[_0x6dd8a9(0x25d)](),_0x4c45b6=_0x12995e-_0x4d5f22,_0x27dcdc=[];for(const _0x196803 of _0x50c395){if(_0x196803[_0x6dd8a9(0x296)]){const _0x309f74=new Date(_0x196803['startedAt'])['getTime'](),_0x501510=_0x196803[_0x6dd8a9(0x28a)]?new Date(_0x196803['updatedAt'])[_0x6dd8a9(0x14c)]():Date[_0x6dd8a9(0x25d)]();_0x27dcdc[_0x6dd8a9(0x1d8)]({'name':_0x196803['fullName'],'state':_0x196803[_0x6dd8a9(0x181)]||_0x6dd8a9(0x196),'window':{'start':_0x309f74,'end':_0x501510,'duration':_0x501510-_0x309f74}});}else _0x27dcdc['push']({'name':_0x196803[_0x6dd8a9(0x10d)],'state':_0x196803[_0x6dd8a9(0x181)]||_0x6dd8a9(0x1e6),'window':undefined});}const _0x2256fd=calculateStats(_0x27dcdc);return{'attempt':{'id':_0x255292['id'],'status':_0x255292[_0x6dd8a9(0x242)]?_0x255292[_0x6dd8a9(0x200)]?_0x6dd8a9(0x200):_0x6dd8a9(0x1ba):_0x6dd8a9(0x10c),'createdAt':_0x255292[_0x6dd8a9(0x261)],'finishedAt':_0x255292[_0x6dd8a9(0x1cc)],'duration_ms':_0x4c45b6},'tasks':_0x27dcdc[_0x6dd8a9(0x2a9)](_0x41bcf5=>({'name':_0x41bcf5[_0x6dd8a9(0x290)],'state':_0x41bcf5[_0x6dd8a9(0x181)],'startedAt':_0x41bcf5['window']?new Date(_0x41bcf5[_0x6dd8a9(0x248)][_0x6dd8a9(0x118)])[_0x6dd8a9(0x20e)]():null,'updatedAt':_0x41bcf5[_0x6dd8a9(0x248)]?new Date(_0x41bcf5[_0x6dd8a9(0x248)][_0x6dd8a9(0x1d9)])['toISOString']():null,'duration_ms':_0x41bcf5[_0x6dd8a9(0x248)]?.[_0x6dd8a9(0x279)]||null})),'stats':_0x2256fd};}}export class WorkflowSchedulesCommand extends BaseCommand{[a54_0x49055a(0x290)]=a54_0x49055a(0x13b);[a54_0x49055a(0x147)]=a54_0x49055a(0x21a);async[a54_0x49055a(0x100)](_0x43215e){const _0x2b130f=a54_0x49055a,{options:_0x36cbd0,tdx:_0x1cf571}=_0x43215e,_0x2675b2=await withSpinner('Listing\x20schedules...',()=>_0x1cf571['workflow'][_0x2b130f(0x1c1)](),{'verbose':_0x36cbd0[_0x2b130f(0x1ad)]}),_0x1f6d3f=_0x2675b2[_0x2b130f(0x19d)];console['error'](_0x2b130f(0x233)+_0x1f6d3f['length']+_0x2b130f(0x25f)+(_0x1f6d3f['length']!==0x1?'s':''));if(isStructuredFormat(_0x36cbd0))await handleSDKOutput(_0x1f6d3f,_0x36cbd0);else{if(_0x1f6d3f[_0x2b130f(0x292)]===0x0)console[_0x2b130f(0x1ae)]('No\x20schedules\x20found');else for(const _0x428dd0 of _0x1f6d3f){const _0x3e67a9=_0x428dd0[_0x2b130f(0x179)]?a54_0x4da4e1[_0x2b130f(0x294)]('\x20(disabled)'):'',_0x23529d=_0x428dd0['project']?.[_0x2b130f(0x290)]?a54_0x4da4e1['dim']('\x20['+_0x428dd0[_0x2b130f(0x283)]['name']+']'):'',_0x41f968=_0x428dd0['nextRunTime']?a54_0x4da4e1[_0x2b130f(0x2a4)](_0x2b130f(0x176)+new Date(_0x428dd0[_0x2b130f(0x1f8)])['toLocaleString']()):'';console[_0x2b130f(0x1ae)]('📅\x20#'+_0x428dd0['id']+'\x20'+(_0x428dd0[_0x2b130f(0x133)]?.[_0x2b130f(0x290)]||_0x2b130f(0x240))+_0x23529d+_0x3e67a9+_0x41f968);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a54_0x49055a(0x290)]=a54_0x49055a(0x129);[a54_0x49055a(0x147)]='Enable\x20a\x20workflow\x20schedule';async['execute'](_0x3f6c27){const _0x21fa71=a54_0x49055a,{options:_0x593c2e,args:_0x21f895,tdx:_0x4de056}=_0x3f6c27,_0xf0f81f=_0x21f895[0x0];if(!_0xf0f81f)return console['error'](a54_0x4da4e1[_0x21fa71(0x27c)](_0x21fa71(0x154)),_0x21fa71(0x104)),console[_0x21fa71(0x1ba)](a54_0x4da4e1[_0x21fa71(0x2a4)]('Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>')),console[_0x21fa71(0x1ba)](a54_0x4da4e1[_0x21fa71(0x2a4)](_0x21fa71(0x122))),0x1;const _0x43fa31=await withSpinner(_0x21fa71(0x2a2)+_0xf0f81f+_0x21fa71(0x29b),()=>_0x4de056['workflow']['enableSchedule'](_0xf0f81f),{'verbose':_0x593c2e[_0x21fa71(0x1ad)]}),_0x55c880=_0x43fa31[_0x21fa71(0x19d)];return isStructuredFormat(_0x593c2e)?await handleSingleObjectOutput(_0x55c880,_0x593c2e):(console['log'](_0x21fa71(0x177)+_0xf0f81f+_0x21fa71(0x252)+(_0x55c880['workflow']?.[_0x21fa71(0x290)]||_0x21fa71(0x196))+')'),_0x55c880[_0x21fa71(0x1f8)]&&console[_0x21fa71(0x1ae)](a54_0x4da4e1[_0x21fa71(0x2a4)](_0x21fa71(0x1ec)+new Date(_0x55c880[_0x21fa71(0x1f8)])[_0x21fa71(0x14e)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a54_0x49055a(0x290)]='workflow:schedule:disable';[a54_0x49055a(0x147)]=a54_0x49055a(0x15a);async[a54_0x49055a(0x100)](_0x96bb9c){const _0xba8790=a54_0x49055a,{options:_0x3feca0,args:_0x26da5b,tdx:_0x9fa5df}=_0x96bb9c,_0x441b58=_0x26da5b[0x0];if(!_0x441b58)return console[_0xba8790(0x1ba)](a54_0x4da4e1['red'](_0xba8790(0x154)),_0xba8790(0x104)),console['error'](a54_0x4da4e1[_0xba8790(0x2a4)]('Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>')),console['error'](a54_0x4da4e1[_0xba8790(0x2a4)](_0xba8790(0x122))),0x1;const _0x41605b=await withSpinner(_0xba8790(0xfa)+_0x441b58+_0xba8790(0x29b),()=>_0x9fa5df['workflow'][_0xba8790(0x151)](_0x441b58),{'verbose':_0x3feca0[_0xba8790(0x1ad)]}),_0x5de85c=_0x41605b[_0xba8790(0x19d)];return isStructuredFormat(_0x3feca0)?await handleSingleObjectOutput(_0x5de85c,_0x3feca0):console[_0xba8790(0x1ae)](_0xba8790(0x177)+_0x441b58+'\x20disabled\x20('+(_0x5de85c[_0xba8790(0x133)]?.[_0xba8790(0x290)]||_0xba8790(0x196))+')'),0x0;}}
|
|
1
|
+
const a54_0xb99464=a54_0xabc4;(function(_0x5d3a78,_0x353bda){const _0x129a36=a54_0xabc4,_0x3c9c7e=_0x5d3a78();while(!![]){try{const _0x24fea4=-parseInt(_0x129a36(0x162))/0x1*(parseInt(_0x129a36(0x251))/0x2)+parseInt(_0x129a36(0x269))/0x3+-parseInt(_0x129a36(0x29c))/0x4*(-parseInt(_0x129a36(0x114))/0x5)+parseInt(_0x129a36(0x193))/0x6+-parseInt(_0x129a36(0x1c8))/0x7+parseInt(_0x129a36(0x278))/0x8+parseInt(_0x129a36(0x172))/0x9*(parseInt(_0x129a36(0x122))/0xa);if(_0x24fea4===_0x353bda)break;else _0x3c9c7e['push'](_0x3c9c7e['shift']());}catch(_0x572011){_0x3c9c7e['push'](_0x3c9c7e['shift']());}}}(a54_0x299b,0x47930));import a54_0x3265bd from'chalk';import{existsSync}from'fs';import a54_0x5df1b0 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a54_0xabc4(_0x40baa0,_0x1c70b3){_0x40baa0=_0x40baa0-0x110;const _0x299b22=a54_0x299b();let _0xabc454=_0x299b22[_0x40baa0];return _0xabc454;}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 a54_0x24334b from'prompts';function getAttemptStatusDisplay(_0x5a3470){const _0x56e9d0=a54_0xabc4;if(!_0x5a3470)return{'icon':'⏳','text':''};const {done:_0x317b19,success:_0x4caae3,cancelRequested:_0x41071a}=_0x5a3470;if(!_0x317b19)return _0x41071a?{'icon':'🛑','text':a54_0x3265bd['yellow'](_0x56e9d0(0x28b))}:{'icon':'🔄','text':a54_0x3265bd[_0x56e9d0(0x144)]('running')};if(_0x4caae3)return{'icon':'✅','text':a54_0x3265bd[_0x56e9d0(0x119)](_0x56e9d0(0x252))};return{'icon':'❌','text':a54_0x3265bd['red'](_0x56e9d0(0x274))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0xb99464(0x178)](_0x1c1c78,_0xa8f81f,_0x2916f9=0x0){return _0x1c1c78[_0x2916f9]||_0xa8f81f['workflowProject'];}[a54_0xb99464(0x1ef)](_0x140653,_0x2c27cd,_0xb262fa=0x0){const _0x2ae4b8=a54_0xb99464,_0x108f96=this[_0x2ae4b8(0x178)](_0x140653,_0x2c27cd,_0xb262fa);if(!_0x108f96)return console[_0x2ae4b8(0x274)](a54_0x3265bd['red'](_0x2ae4b8(0x1dc)),_0x2ae4b8(0x164)),console[_0x2ae4b8(0x274)](a54_0x3265bd[_0x2ae4b8(0x1a1)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x108f96;}[a54_0xb99464(0x15b)](_0x5ed73c,_0x17067e){const _0x27ae7b=a54_0xb99464;if(_0x5ed73c[0x0]){const _0x49826c=_0x5ed73c[0x0][_0x27ae7b(0x242)]('.');if(_0x49826c[_0x27ae7b(0x1b9)]===0x1)return{'projectName':_0x49826c[0x0],'workflowName':undefined};else return _0x49826c[_0x27ae7b(0x1b9)]===0x2?{'projectName':_0x49826c[0x0],'workflowName':_0x49826c[0x1]}:(console[_0x27ae7b(0x274)](a54_0x3265bd['red']('Error:'),_0x27ae7b(0x1ec)),null);}return{'projectName':_0x17067e[_0x27ae7b(0x23a)],'workflowName':undefined};}[a54_0xb99464(0x284)](_0x591f8a,_0x5414a2,_0x323af7=0x0){const _0x5da64b=a54_0xb99464;if(_0x591f8a[_0x323af7])return _0x591f8a[_0x323af7];if(_0x5414a2[_0x5da64b(0x23a)]){const _0x3e3c07=a54_0x5df1b0[_0x5da64b(0x237)](process[_0x5da64b(0x1b7)](),_0x5da64b(0x1d5),_0x5414a2[_0x5da64b(0x23a)]);if(existsSync(a54_0x5df1b0[_0x5da64b(0x237)](_0x3e3c07,_0x5da64b(0x1c2))))return _0x3e3c07;}return undefined;}async[a54_0xb99464(0x2b1)](_0x5bff1d,_0x11e777,_0x9b39aa){const _0x1b9dd6=a54_0xb99464;try{const _0x5ba007=await _0x5bff1d[_0x1b9dd6(0x229)][_0x1b9dd6(0x1d5)](_0x11e777,{'limit':0x1});if(_0x5ba007[_0x1b9dd6(0x1b9)]>0x0){const _0x13cc81=_0x5ba007[0x0]['id'],_0x202996=getWorkflowUrl(_0x9b39aa,_0x13cc81);console[_0x1b9dd6(0x274)](_0x1b9dd6(0x1b5)+a54_0x3265bd['cyan'](_0x202996));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a54_0xb99464(0x1be);[a54_0xb99464(0x13a)]=a54_0xb99464(0x24d);async['execute'](_0x58f1f9){const _0x31ef66=a54_0xb99464,{options:_0x388b1a,args:_0x3d4dc6,tdx:_0x5832e3}=_0x58f1f9,_0x26ac55=_0x3d4dc6[0x0],_0x541416=_0x388b1a[_0x31ef66(0x16d)];if(_0x541416)return saveSessionContext({'workflow_project':undefined},_0x388b1a[_0x31ef66(0x29b)]),console[_0x31ef66(0x25a)](a54_0x3265bd[_0x31ef66(0x119)](_0x31ef66(0x129))),0x0;if(!_0x26ac55)return console[_0x31ef66(0x274)](a54_0x3265bd['red'](_0x31ef66(0x1dc)),_0x31ef66(0x164)),console[_0x31ef66(0x274)](a54_0x3265bd['dim']('Usage:\x20tdx\x20wf\x20use\x20<project>')),console['error'](a54_0x3265bd['dim'](_0x31ef66(0x2b5))),0x1;const _0x3a4263=await withSpinner(_0x31ef66(0x28f)+_0x26ac55+'\x27...',()=>_0x5832e3[_0x31ef66(0x229)][_0x31ef66(0x2a8)](_0x26ac55),{'verbose':_0x388b1a[_0x31ef66(0x2a9)]}),{name:_0x1c322c}=_0x3a4263[_0x31ef66(0x149)];return saveSessionContext({'workflow_project':_0x1c322c},_0x388b1a[_0x31ef66(0x29b)]),console['log'](a54_0x3265bd[_0x31ef66(0x119)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a54_0x3265bd['cyan'](_0x1c322c))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x200);['description']='List\x20all\x20workflow\x20projects';async[a54_0xb99464(0x1e1)](_0x25cc5b){const _0x3d2d12=a54_0xb99464,{options:_0x506b18,args:_0xa2db4d,tdx:_0x1aca75}=_0x25cc5b,_0x30912f=_0xa2db4d[0x0];_0x506b18[_0x3d2d12(0x2a9)]&&_0x30912f&&console['error'](_0x3d2d12(0x205)+_0x30912f);const _0x2567fb=await withSpinner(_0x3d2d12(0x2cf),()=>_0x1aca75['workflow'][_0x3d2d12(0x230)](_0x30912f,{'limit':_0x506b18[_0x3d2d12(0x14e)]}),{'verbose':_0x506b18['verbose']});let _0x16e655=_0x2567fb['data'];_0x16e655['sort']((_0x21b355,_0x756599)=>_0x21b355[_0x3d2d12(0x2ba)][_0x3d2d12(0x1d2)](_0x756599[_0x3d2d12(0x2ba)]));const _0x17247b=_0x506b18['limit']||0x64,_0x2e6eca=_0x16e655[_0x3d2d12(0x1b9)]>=_0x17247b?a54_0x3265bd[_0x3d2d12(0x1a1)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x3d2d12(0x274)](_0x3d2d12(0x28e)+_0x16e655[_0x3d2d12(0x1b9)]+'\x20project'+(_0x16e655[_0x3d2d12(0x1b9)]!==0x1?'s':'')+_0x2e6eca);if(_0x506b18[_0x3d2d12(0x256)]===_0x3d2d12(0x279)||_0x506b18[_0x3d2d12(0x256)]===_0x3d2d12(0x197)||_0x506b18[_0x3d2d12(0x256)]===_0x3d2d12(0x1c1))await handleSDKOutput(_0x16e655,_0x506b18);else{if(_0x16e655[_0x3d2d12(0x1b9)]===0x0)_0x30912f?console[_0x3d2d12(0x25a)](_0x3d2d12(0x1fd)+_0x30912f):console[_0x3d2d12(0x25a)](_0x3d2d12(0x299));else{const _0x48135f=_0x16e655[_0x3d2d12(0x127)](_0x1671af=>{const _0x4baba9=_0x3d2d12,_0x2bb9dd=_0x1671af['metadata']?.[_0x4baba9(0x23f)](_0x3cb7b5=>_0x3cb7b5[_0x4baba9(0x132)]===_0x4baba9(0x18d)),_0x118462=_0x2bb9dd?a54_0x3265bd[_0x4baba9(0x1a1)](_0x4baba9(0x134)):'';return _0x4baba9(0x290)+_0x1671af[_0x4baba9(0x2ba)]+_0x118462;});await writeOutput(_0x48135f[_0x3d2d12(0x237)]('\x0a'),_0x506b18[_0x3d2d12(0x1b6)],_0x3d2d12(0x157));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a54_0xb99464(0x246);['description']=a54_0xb99464(0x161);async[a54_0xb99464(0x1e1)](_0x2cbfd6){const _0x10f9da=a54_0xb99464,{options:_0x1daa1e,args:_0x4da627,tdx:_0x27f77e}=_0x2cbfd6,_0x295bd3=this[_0x10f9da(0x178)](_0x4da627,_0x1daa1e);_0x1daa1e['verbose']&&_0x295bd3&&console[_0x10f9da(0x274)]('Project\x20filter:\x20'+_0x295bd3);const _0x83fd14=await withSpinner(_0x10f9da(0x1e7),()=>_0x27f77e[_0x10f9da(0x229)][_0x10f9da(0x1d5)](_0x295bd3,{'limit':_0x1daa1e[_0x10f9da(0x14e)]}),{'verbose':_0x1daa1e[_0x10f9da(0x2a9)]});let _0x1abd82=_0x83fd14[_0x10f9da(0x149)];_0x1abd82['sort']((_0x467b42,_0x462c46)=>{const _0x44c3ce=_0x10f9da,_0x1a10f4=_0x467b42[_0x44c3ce(0x2ba)][_0x44c3ce(0x1d2)](_0x462c46[_0x44c3ce(0x2ba)]);if(_0x1a10f4!==0x0)return _0x1a10f4;return(_0x467b42[_0x44c3ce(0x23d)]?.[_0x44c3ce(0x2ba)]||'')['localeCompare'](_0x462c46[_0x44c3ce(0x23d)]?.[_0x44c3ce(0x2ba)]||'');});const _0x526a80=_0x1daa1e[_0x10f9da(0x14e)]||0x64,_0x1f8ebf=_0x1abd82[_0x10f9da(0x1b9)]>=_0x526a80?a54_0x3265bd[_0x10f9da(0x1a1)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x10f9da(0x274)](_0x10f9da(0x28e)+_0x1abd82[_0x10f9da(0x1b9)]+_0x10f9da(0x20b)+(_0x1abd82[_0x10f9da(0x1b9)]!==0x1?'s':'')+_0x1f8ebf);if(_0x1daa1e['format']===_0x10f9da(0x279)||_0x1daa1e['format']===_0x10f9da(0x197)||_0x1daa1e['format']===_0x10f9da(0x1c1))await handleSDKOutput(_0x1abd82,_0x1daa1e);else{if(_0x1abd82[_0x10f9da(0x1b9)]===0x0)_0x295bd3?console['log']('No\x20workflows\x20found\x20in\x20project:\x20'+_0x295bd3):console[_0x10f9da(0x25a)]('No\x20workflows\x20found');else{const _0x3e1e5a=_0x1daa1e[_0x10f9da(0x1fa)],_0xec7be0=_0x1abd82[_0x10f9da(0x127)](_0xf0d930=>{const _0x1cff3b=_0x10f9da,_0x1ca4db=a54_0x3265bd['dim']('#'+_0xf0d930['id']),_0x417204=hyperlink(_0x1ca4db,getWorkflowUrl(_0x3e1e5a,_0xf0d930['id'])),_0x48537e=_0xf0d930['project']?.[_0x1cff3b(0x2ba)]?a54_0x3265bd[_0x1cff3b(0x1a1)]('\x20('+_0xf0d930[_0x1cff3b(0x23d)]['name']+')'):'';return _0x1cff3b(0x245)+_0x417204+'\x20'+_0xf0d930[_0x1cff3b(0x2ba)]+_0x48537e;});await writeOutput(_0xec7be0[_0x10f9da(0x237)]('\x0a'),_0x1daa1e['output'],_0x10f9da(0x157));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0xb99464(0x2ba)]='workflow:sessions';[a54_0xb99464(0x13a)]=a54_0xb99464(0x192);async[a54_0xb99464(0x1e1)](_0x1a149e){const _0x238221=a54_0xb99464,{options:_0xb39081,args:_0x3ed20a,tdx:_0x71c5bd}=_0x1a149e,_0x40412f=this[_0x238221(0x15b)](_0x3ed20a,_0xb39081);if(!_0x40412f)return 0x1;const {projectName:_0x6543dd,workflowName:_0x1dd276}=_0x40412f;if(_0xb39081[_0x238221(0x2a9)]){if(_0x6543dd&&_0x1dd276)console[_0x238221(0x274)](_0x238221(0x180)+_0x6543dd+'.'+_0x1dd276);else _0x6543dd&&console[_0x238221(0x274)]('Filter:\x20project='+_0x6543dd);const _0x47192c=_0xb39081[_0x238221(0x179)];_0x47192c&&console['error'](_0x238221(0x1e8)+_0x47192c);}let _0x878221=0x28;if(process[_0x238221(0x194)]['isTTY']&&!_0xb39081[_0x238221(0x1b6)]&&!_0xb39081['format']){const _0x13faf2=process[_0x238221(0x194)]['rows']||0x28;_0x878221=Math[_0x238221(0x2b0)](0x14,Math[_0x238221(0x1f6)](_0x13faf2*0x2/0x3));}const _0x2a9ca5=_0xb39081[_0x238221(0x14e)]||_0x878221,_0x41b69d=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x71c5bd[_0x238221(0x229)][_0x238221(0x218)]({'projectName':_0x6543dd,'workflowName':_0x1dd276,'status':_0xb39081[_0x238221(0x179)],'fromTime':_0xb39081[_0x238221(0x1d0)],'toTime':_0xb39081['to'],'limit':_0x2a9ca5}),{'verbose':_0xb39081[_0x238221(0x2a9)]}),_0x45ddbc=_0x41b69d[_0x238221(0x149)];_0x45ddbc[_0x238221(0x1bc)]((_0x313950,_0x109de9)=>{const _0x5f40db=_0x238221,_0x45cf33=_0x313950[_0x5f40db(0x2c5)]||'',_0x170f70=_0x109de9['sessionTime']||'';return _0x170f70[_0x5f40db(0x1d2)](_0x45cf33);});_0x45ddbc[_0x238221(0x1b9)]>=_0x2a9ca5?console['error'](_0x238221(0x239)+_0x45ddbc[_0x238221(0x1b9)]+_0x238221(0x271)+a54_0x3265bd[_0x238221(0x1a1)](_0x238221(0x110))):console['error'](_0x238221(0x28e)+_0x45ddbc[_0x238221(0x1b9)]+'\x20session'+(_0x45ddbc[_0x238221(0x1b9)]!==0x1?'s':''));if(_0xb39081[_0x238221(0x256)]===_0x238221(0x279)||_0xb39081[_0x238221(0x256)]===_0x238221(0x197)||_0xb39081[_0x238221(0x256)]===_0x238221(0x1c1))await handleSDKOutput(_0x45ddbc,_0xb39081);else{if(!process['stdout']['isTTY']||_0xb39081['output']){if(_0x45ddbc[_0x238221(0x1b9)]===0x0){if(_0x6543dd&&_0x1dd276)console[_0x238221(0x25a)](_0x238221(0x292)+_0x6543dd+'.'+_0x1dd276);else _0x6543dd?console[_0x238221(0x25a)](_0x238221(0x16f)+_0x6543dd):console[_0x238221(0x25a)]('No\x20sessions\x20found');}else{const _0xfe0947=_0xb39081[_0x238221(0x1fa)],_0x45c3ef=this['renderSessionsTimeline'](_0x45ddbc,_0xfe0947);_0xb39081[_0x238221(0x1b6)]?await writeOutput(_0x45c3ef,_0xb39081['output'],_0x238221(0x157)):console[_0x238221(0x25a)](_0x45c3ef);}!_0x6543dd&&(console['error'](''),console['error'](a54_0x3265bd[_0x238221(0x1a1)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x238221(0x274)](a54_0x3265bd['dim'](_0x238221(0x1ba))+'or'+a54_0x3265bd[_0x238221(0x1a1)](_0x238221(0x1f9))));}else{if(_0x45ddbc[_0x238221(0x1b9)]===0x0){if(_0x6543dd&&_0x1dd276)console[_0x238221(0x25a)](_0x238221(0x292)+_0x6543dd+'.'+_0x1dd276);else _0x6543dd?console[_0x238221(0x25a)](_0x238221(0x16f)+_0x6543dd):console[_0x238221(0x25a)]('No\x20sessions\x20found');}else await this[_0x238221(0x294)](_0x45ddbc,_0x1a149e,_0x6543dd);}}return 0x0;}['renderSessionsTimeline'](_0x419134,_0x3502eb){const _0x3dfa91=a54_0xb99464,_0x26091c=[],_0x2f93c1=new Map();let _0x2a7cd0=Infinity,_0x431f3c=-Infinity;for(const _0x119052 of _0x419134){if(_0x119052[_0x3dfa91(0x206)]?.[_0x3dfa91(0x168)]){const _0x43e954=new Date(_0x119052[_0x3dfa91(0x206)][_0x3dfa91(0x168)])[_0x3dfa91(0x21b)](),_0x414b8f=_0x119052[_0x3dfa91(0x206)][_0x3dfa91(0x1e6)]?new Date(_0x119052[_0x3dfa91(0x206)][_0x3dfa91(0x1e6)])[_0x3dfa91(0x21b)]():Date[_0x3dfa91(0x186)](),_0x5bbd75=_0x119052[_0x3dfa91(0x23d)]?.[_0x3dfa91(0x2ba)]||_0x3dfa91(0x15a);!_0x2f93c1[_0x3dfa91(0x21c)](_0x5bbd75)&&_0x2f93c1[_0x3dfa91(0x138)](_0x5bbd75,[]),_0x2f93c1[_0x3dfa91(0x118)](_0x5bbd75)[_0x3dfa91(0x2c3)]({'session':_0x119052,'startTime':_0x43e954,'endTime':_0x414b8f,'duration':_0x414b8f-_0x43e954}),_0x2a7cd0=Math[_0x3dfa91(0x2c4)](_0x2a7cd0,_0x43e954),_0x431f3c=Math[_0x3dfa91(0x2b0)](_0x431f3c,_0x414b8f);}}if(_0x2f93c1[_0x3dfa91(0x15c)]===0x0)return _0x3dfa91(0x146);const _0x50ebdc=process[_0x3dfa91(0x194)][_0x3dfa91(0x15f)]||0x78,_0x43c4c5=0x1e,_0xa5d5b=0x32,_0x3ec1c9=0x4,_0x46648d=Math[_0x3dfa91(0x2c4)](_0xa5d5b,Math[_0x3dfa91(0x2b0)](_0x43c4c5,Math[_0x3dfa91(0x1f6)](_0x50ebdc*0.3))),_0x349e96=_0x50ebdc-_0x46648d-TIMELINE_CONFIG[_0x3dfa91(0x126)]-0x3-_0x3ec1c9,_0x489946=_0x431f3c-_0x2a7cd0,_0x370862=_0x489946/_0x46648d,_0x30282f=renderTimeAxis({'startTime':_0x2a7cd0,'endTime':_0x431f3c,'durationMs':_0x489946,'msPerChar':_0x370862},_0x46648d),_0x3b1d9b=[];for(const _0x2aaa04 of _0x2f93c1['values']()){_0x3b1d9b[_0x3dfa91(0x2c3)](..._0x2aaa04);}_0x3b1d9b[_0x3dfa91(0x1bc)]((_0x59cfeb,_0x543db9)=>_0x543db9[_0x3dfa91(0x1f0)]-_0x59cfeb[_0x3dfa91(0x1f0)]);const _0x555ada=new Date(_0x2a7cd0),_0x2ee94e=formatDate(_0x555ada),_0x4fffc8=_0x3ec1c9+TIMELINE_CONFIG[_0x3dfa91(0x24e)]+TIMELINE_CONFIG['ICON_SPACING']+_0x349e96,_0x2a6f8c='\x20'[_0x3dfa91(0x155)](_0x4fffc8-_0x2ee94e[_0x3dfa91(0x1b9)]),_0x527184=_0x2a6f8c+a54_0x3265bd['dim'](_0x2ee94e)+'\x20'+_0x30282f;_0x26091c[_0x3dfa91(0x2c3)](_0x527184);const _0x3d4ac1=0x16;let _0x506b2e=0x0;for(const _0x159e2b of _0x3b1d9b){const _0x31a311=_0x159e2b[_0x3dfa91(0x29b)][_0x3dfa91(0x23d)]?.[_0x3dfa91(0x2ba)]||'?',_0x439183=Math[_0x3dfa91(0x2c4)](stringWidth(_0x31a311),_0x3d4ac1);_0x506b2e=Math[_0x3dfa91(0x2b0)](_0x506b2e,_0x439183);}for(const _0x3df239 of _0x3b1d9b){const {session:_0x5b97a3,startTime:_0x5aa7cb,endTime:_0x4c93a5,duration:_0x3fdf7b}=_0x3df239,_0x46e151=_0x5b97a3[_0x3dfa91(0x23d)]?.['id'],_0xd8025e=_0x5b97a3['id'],_0x2bcf8a=_0x5b97a3[_0x3dfa91(0x23d)]?.[_0x3dfa91(0x2ba)]||'?',_0x507ebc=_0x5b97a3[_0x3dfa91(0x229)]?.[_0x3dfa91(0x2ba)]||'?';let _0x4ce2ab,_0x589953;if(_0x5b97a3['lastAttempt']){const _0x567409=_0x5b97a3['lastAttempt'];!_0x567409[_0x3dfa91(0x1c6)]?(_0x4ce2ab=_0x567409['cancelRequested']?'🛑':'🔄',_0x589953=_0x567409[_0x3dfa91(0x11b)]?a54_0x3265bd[_0x3dfa91(0x267)]:a54_0x3265bd[_0x3dfa91(0x144)]):(_0x4ce2ab=_0x567409[_0x3dfa91(0x252)]?'✅':'❌',_0x589953=_0x567409[_0x3dfa91(0x252)]?a54_0x3265bd['green']:a54_0x3265bd[_0x3dfa91(0x2aa)]);}else _0x4ce2ab='⏳',_0x589953=a54_0x3265bd[_0x3dfa91(0x1a1)];const _0x18e667='#'+_0xd8025e,_0x53eaea=_0x46e151?hyperlink(_0x18e667,getWorkflowSessionUrl(_0x3502eb,_0x46e151,_0xd8025e)):_0x18e667;let _0xaf820f=_0x2bcf8a;stringWidth(_0x2bcf8a)>_0x3d4ac1&&(_0xaf820f=_0x2bcf8a[_0x3dfa91(0x259)](0x0,_0x3d4ac1-0x1)+'…');const _0x36611c=a54_0x3265bd[_0x3dfa91(0x1a1)](_0xaf820f),_0x270885=stringWidth(_0xaf820f),_0x42441e='\x20'[_0x3dfa91(0x155)](_0x506b2e-stringWidth(_0xaf820f)+0x2),_0x3bb25a='('+formatElapsed(_0x3fdf7b)+')',_0x19b6fc=stringWidth(_0x3bb25a),_0x2ba5dd=stringWidth(_0x18e667),_0x53292b=_0x2ba5dd+0x1+_0x270885+_0x42441e[_0x3dfa91(0x1b9)],_0x134a11=_0x349e96-_0x53292b-_0x19b6fc-0x1-0x8;let _0xffc2ec=_0x507ebc;stringWidth(_0xffc2ec)>_0x134a11&&(_0xffc2ec=_0xffc2ec[_0x3dfa91(0x259)](0x0,_0x134a11-0x1)+'…');const _0x2eeb52=_0x53eaea+'\x20'+_0x36611c+_0x42441e+_0xffc2ec,_0x212d51=stringWidth(_0x2eeb52),_0xc0ec9d=_0x349e96-_0x212d51-_0x19b6fc,_0x39f009=_0x2eeb52+'\x20'['repeat'](Math[_0x3dfa91(0x2b0)](0x1,_0xc0ec9d))+a54_0x3265bd['dim'](_0x3bb25a),_0x3df19d=Math[_0x3dfa91(0x1f6)]((_0x5aa7cb-_0x2a7cd0)/_0x370862),_0x2c8db0=Math[_0x3dfa91(0x1f6)]((_0x4c93a5-_0x2a7cd0)/_0x370862),_0x167301=Math['max'](_0x3df19d+0x1,_0x2c8db0),_0x2b46d9=new Array(_0x46648d)[_0x3dfa91(0x18b)]('\x20');for(let _0x3a7c90=_0x3df19d;_0x3a7c90<Math['min'](_0x167301,_0x46648d);_0x3a7c90++){_0x2b46d9[_0x3a7c90]='─';}const _0x2baa27=_0x2b46d9[_0x3dfa91(0x127)](_0x38e529=>_0x38e529==='\x20'?'\x20':_0x589953(_0x38e529))[_0x3dfa91(0x237)]('');_0x26091c[_0x3dfa91(0x2c3)](_0x4ce2ab+'\x20'+_0x39f009+'│'+_0x2baa27+'│');}return _0x26091c[_0x3dfa91(0x237)]('\x0a');}async[a54_0xb99464(0x294)](_0x1aee33,_0xface2a,_0x1df10f){const _0x4edc64=a54_0xb99464,{options:_0x30ee56,tdx:_0x4380ee}=_0xface2a,_0x236030=_0x30ee56[_0x4edc64(0x1fa)],{timelineRows:_0x551fd1,timeAxisHeader:_0xc0a6dc}=this[_0x4edc64(0x139)](_0x1aee33,_0x236030),_0x4c5afb=_0x551fd1[_0x4edc64(0x13f)](_0x50a3de=>_0x50a3de[_0x4edc64(0x216)]);if(_0x4c5afb[_0x4edc64(0x1b9)]===0x0){const _0x2a47ce=this['renderSessionsTimeline'](_0x1aee33,_0x236030);console[_0x4edc64(0x25a)](_0x2a47ce);!_0x1df10f&&(console[_0x4edc64(0x274)](''),console[_0x4edc64(0x274)](a54_0x3265bd[_0x4edc64(0x1a1)](_0x4edc64(0x1c5))),console[_0x4edc64(0x274)](a54_0x3265bd[_0x4edc64(0x1a1)](_0x4edc64(0x1ba))+'or'+a54_0x3265bd[_0x4edc64(0x1a1)](_0x4edc64(0x1f9))));return;}_0xc0a6dc&&console[_0x4edc64(0x25a)](_0xc0a6dc);const _0x1b940d=_0x551fd1[_0x4edc64(0x13f)](_0x118f1c=>_0x118f1c[_0x4edc64(0x216)])['map'](_0x55a7ac=>({'title':_0x55a7ac[_0x4edc64(0x1fc)],'value':_0x55a7ac[_0x4edc64(0x216)]})),_0xd9722f=process[_0x4edc64(0x194)][_0x4edc64(0x1dd)]||0x3c,_0x43dfc6=Math[_0x4edc64(0x2b0)](0x28,Math[_0x4edc64(0x1f6)](_0xd9722f*0x2/0x3)),_0x3724b9=await a54_0x24334b({'type':'autocomplete','name':_0x4edc64(0x216),'message':_0x4edc64(0x112),'choices':_0x1b940d,'initial':-0x1,'limit':_0x43dfc6,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x441899,_0x210103)=>{const _0x1fffc2=_0x4edc64;if(!_0x441899)return Promise[_0x1fffc2(0x1da)](_0x210103);const _0xa1070a=_0x210103[_0x1fffc2(0x13f)](_0x2162a4=>{const _0x3850a3=_0x1fffc2,_0x45251d=_0x2162a4;return _0x45251d[_0x3850a3(0x16a)][_0x3850a3(0x2cb)]()[_0x3850a3(0x1e0)](_0x441899['toLowerCase']());});return Promise[_0x1fffc2(0x1da)](_0xa1070a);}}),_0x5b4521=()=>{const _0x1906c2=_0x4edc64;process['stdout']['write'](_0x1906c2(0x199)),process[_0x1906c2(0x194)][_0x1906c2(0x283)](_0x1906c2(0x199)),process[_0x1906c2(0x194)][_0x1906c2(0x283)](_0x1906c2(0x199));},_0x21e5ea=_0x3724b9&&_0x3724b9['attemptId']&&_0x3724b9[_0x4edc64(0x216)]!==null&&_0x3724b9['attemptId'][_0x4edc64(0x220)]()!=='';if(!_0x21e5ea){_0x5b4521(),console['log'](a54_0x3265bd[_0x4edc64(0x1a1)](_0x4edc64(0x1af)));return;}_0x5b4521();const _0x29fe3c=_0x1aee33[_0x4edc64(0x2a2)](_0x3feab1=>_0x3feab1['lastAttempt']?.['id']===_0x3724b9['attemptId']);if(_0x29fe3c){const _0x117c0e=_0x29fe3c[_0x4edc64(0x23d)]?.[_0x4edc64(0x2ba)]||'?',_0x4d18a1=_0x29fe3c[_0x4edc64(0x229)]?.['name']||'?';console[_0x4edc64(0x25a)](_0x4edc64(0x2a6)+a54_0x3265bd[_0x4edc64(0x1a1)](_0x117c0e)+_0x4edc64(0x215)+a54_0x3265bd['dim'](_0x4d18a1));}const _0x9369d=new WorkflowTimelineCommand();await _0x9369d[_0x4edc64(0x1e1)]({'args':[],'options':{..._0x30ee56,'attemptId':_0x3724b9[_0x4edc64(0x216)]},'tdx':_0x4380ee});}['generateSessionTimelineRows'](_0x4d118c,_0x465e2f){const _0x3031c4=a54_0xb99464,_0x39aa83=new Map();for(const _0x3c4e53 of _0x4d118c){_0x3c4e53['id']&&_0x3c4e53[_0x3031c4(0x206)]?.['id']&&_0x39aa83[_0x3031c4(0x138)](_0x3c4e53['id'],_0x3c4e53[_0x3031c4(0x206)]['id']);}const _0x165888=[];let _0x1e08f6='';const _0xffb720=this[_0x3031c4(0x1e4)](_0x4d118c,_0x465e2f),_0x3f7f47=_0xffb720['split']('\x0a');for(const _0xea0615 of _0x3f7f47){if(_0xea0615[_0x3031c4(0x2d3)](_0x3031c4(0x221))||_0xea0615[_0x3031c4(0x19f)](/^\s+\d{4}-\d{2}-\d{2}/))_0x1e08f6=_0xea0615;else{if(_0xea0615[_0x3031c4(0x19f)](/^[✅❌🔄🛑⏳]/)){const _0x3c775f=_0xea0615[_0x3031c4(0x19f)](/#(\d+)/),_0x2794e7=_0x3c775f?_0x3c775f[0x1]:null,_0x5b67ff=_0x2794e7?_0x39aa83[_0x3031c4(0x118)](_0x2794e7)||null:null,_0xa250eb=_0x4d118c['find'](_0x44e0ec=>_0x44e0ec['id']===_0x2794e7),_0x39d8c2=_0xa250eb?.[_0x3031c4(0x23d)]?.[_0x3031c4(0x2ba)]||'';_0x165888['push']({'displayLine':_0xea0615,'attemptId':_0x5b67ff,'projectName':_0x39d8c2});}}}return{'timelineRows':_0x165888,'timeAxisHeader':_0x1e08f6};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x18e);['description']=a54_0xb99464(0x147);async['execute'](_0x446293){const _0x4e426b=a54_0xb99464,{options:_0x35304a,args:_0x10c18c,tdx:_0x32163c}=_0x446293,_0x35f245=this[_0x4e426b(0x15b)](_0x10c18c,_0x35304a);if(!_0x35f245)return 0x1;const {projectName:_0x57b522,workflowName:_0x3afb61}=_0x35f245,_0x106e42=_0x35304a['includeRetried'];if(_0x35304a[_0x4e426b(0x2a9)]){if(_0x57b522&&_0x3afb61)console[_0x4e426b(0x274)](_0x4e426b(0x180)+_0x57b522+'.'+_0x3afb61);else _0x57b522&&console[_0x4e426b(0x274)]('Filter:\x20project='+_0x57b522);_0x106e42&&console['error'](_0x4e426b(0x19e));}const _0x48544f=await withSpinner(_0x4e426b(0x1ea),()=>_0x32163c['workflow'][_0x4e426b(0x1a5)]({'projectName':_0x57b522,'workflowName':_0x3afb61,'includeRetried':_0x106e42,'limit':_0x35304a[_0x4e426b(0x14e)]}),{'verbose':_0x35304a[_0x4e426b(0x2a9)]}),_0x13cbf1=_0x48544f['data'],_0x5aa7b3=_0x35304a['limit']||0x64,_0x59efe2=_0x13cbf1['length']>=_0x5aa7b3?a54_0x3265bd['dim']('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x4e426b(0x274)](_0x4e426b(0x28e)+_0x13cbf1[_0x4e426b(0x1b9)]+_0x4e426b(0x1d4)+(_0x13cbf1['length']!==0x1?'s':'')+_0x59efe2);if(_0x35304a[_0x4e426b(0x256)]==='json'||_0x35304a['format']===_0x4e426b(0x197)||_0x35304a['format']==='table')await handleSDKOutput(_0x13cbf1,_0x35304a);else{if(_0x13cbf1['length']===0x0){if(_0x57b522&&_0x3afb61)console[_0x4e426b(0x25a)](_0x4e426b(0x187)+_0x57b522+'.'+_0x3afb61);else _0x57b522?console[_0x4e426b(0x25a)](_0x4e426b(0x182)+_0x57b522):console[_0x4e426b(0x25a)]('No\x20attempts\x20found');}else{const _0x1fc22d=_0x35304a[_0x4e426b(0x1fa)],_0x185673=_0x13cbf1[_0x4e426b(0x127)](_0x27dd6a=>{const _0x14e5c2=_0x4e426b,_0x2e63c9=a54_0x3265bd['dim']('#'+_0x27dd6a['id']),_0x11dd0d=_0x27dd6a[_0x14e5c2(0x23d)]?.['id'],_0x4ebe76=_0x27dd6a[_0x14e5c2(0x2d2)]||_0x27dd6a[_0x14e5c2(0x1cd)],_0x45caa1=_0x11dd0d&&_0x4ebe76?hyperlink(_0x2e63c9,getWorkflowAttemptUrl(_0x1fc22d,_0x11dd0d,_0x4ebe76,_0x27dd6a['id'])):_0x2e63c9,{icon:_0x3fd399,text:_0x4f164a}=getAttemptStatusDisplay(_0x27dd6a),_0x5b6af0=(_0x27dd6a[_0x14e5c2(0x23d)]?.['name']||'?')+'.'+(_0x27dd6a['workflow']?.['name']||'?'),_0x510517=_0x27dd6a['sessionTime']?a54_0x3265bd[_0x14e5c2(0x1a1)](_0x27dd6a[_0x14e5c2(0x2c5)]):'';return(_0x45caa1+'\x20'+_0x3fd399+(_0x4f164a?'\x20'+_0x4f164a:'')+'\x20'+_0x5b6af0+'\x20'+_0x510517)[_0x14e5c2(0x183)]();});await writeOutput(_0x185673['join']('\x0a'),_0x35304a[_0x4e426b(0x1b6)],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']='workflow:attempt';[a54_0xb99464(0x13a)]=a54_0xb99464(0x240);async['execute'](_0x21faf4){const _0x5cb40f=a54_0xb99464,{options:_0x4d022e,args:_0xb5a7f,tdx:_0x507682}=_0x21faf4,_0x2d40c5=_0xb5a7f[0x0];if(!_0x2d40c5)return console[_0x5cb40f(0x274)](_0x5cb40f(0x2ce)),0x1;_0x4d022e[_0x5cb40f(0x2a9)]&&console[_0x5cb40f(0x274)](_0x5cb40f(0x24c)+_0x2d40c5);const _0x2ffa0c=await withSpinner(_0x5cb40f(0x276),()=>_0x507682[_0x5cb40f(0x229)]['attempt'](_0x2d40c5),{'verbose':_0x4d022e[_0x5cb40f(0x2a9)]}),_0x420c59=_0x2ffa0c[_0x5cb40f(0x149)];let _0x4bace2;!_0x420c59[_0x5cb40f(0x1c6)]?_0x4bace2=_0x420c59[_0x5cb40f(0x11b)]?_0x5cb40f(0x28b):_0x5cb40f(0x148):_0x4bace2=_0x420c59[_0x5cb40f(0x252)]?_0x5cb40f(0x252):_0x5cb40f(0x274);let _0xeb132;if(_0x420c59[_0x5cb40f(0x168)]&&_0x420c59['finishedAt']){const _0x169679=new Date(_0x420c59[_0x5cb40f(0x168)])[_0x5cb40f(0x21b)](),_0x30ca58=new Date(_0x420c59['finishedAt'])[_0x5cb40f(0x21b)]();_0xeb132=Math[_0x5cb40f(0x2cc)]((_0x30ca58-_0x169679)/0x3e8);}const _0x12e788={'attempt_id':_0x420c59['id'],'status':_0x4bace2,..._0x420c59[_0x5cb40f(0x2b2)]!==undefined&&{'index':_0x420c59[_0x5cb40f(0x2b2)]},..._0x420c59[_0x5cb40f(0x23d)]&&{'project':_0x420c59[_0x5cb40f(0x23d)][_0x5cb40f(0x2ba)]},..._0x420c59[_0x5cb40f(0x229)]&&{'workflow':_0x420c59[_0x5cb40f(0x229)][_0x5cb40f(0x2ba)]},..._0x420c59[_0x5cb40f(0x1cd)]&&{'session_id':_0x420c59['sessionId']},..._0x420c59[_0x5cb40f(0x2c5)]&&{'session_time':_0x420c59[_0x5cb40f(0x2c5)]},..._0x420c59[_0x5cb40f(0x26f)]&&{'retry_attempt':_0x420c59[_0x5cb40f(0x26f)]},..._0xeb132!==undefined&&{'duration_sec':_0xeb132},..._0x420c59[_0x5cb40f(0x168)]&&{'created_at':_0x420c59[_0x5cb40f(0x168)]},..._0x420c59['finishedAt']&&{'finished_at':_0x420c59[_0x5cb40f(0x1e6)]},...Object[_0x5cb40f(0x1b8)](_0x420c59[_0x5cb40f(0x158)])['length']>0x0&&{'params':_0x420c59[_0x5cb40f(0x158)]}};return await handleSingleObjectOutput(_0x12e788,_0x4d022e),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x1fb);[a54_0xb99464(0x13a)]=a54_0xb99464(0x12d);async[a54_0xb99464(0x1e1)](_0x1808b1){const _0x12e1b4=a54_0xb99464,{options:_0x29bc41,args:_0x1446bb,tdx:_0x3f697f}=_0x1808b1,_0xa43997=_0x1446bb[0x0];if(!_0xa43997)return console[_0x12e1b4(0x274)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x841438=_0x29bc41[_0x12e1b4(0x26d)];_0x29bc41[_0x12e1b4(0x2a9)]&&(console[_0x12e1b4(0x274)](_0x12e1b4(0x24c)+_0xa43997),_0x841438&&console[_0x12e1b4(0x274)](_0x12e1b4(0x1de)));const _0x23f9f2=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x3f697f[_0x12e1b4(0x229)][_0x12e1b4(0x21f)](_0xa43997,_0x841438||![]),{'verbose':_0x29bc41[_0x12e1b4(0x2a9)]}),_0x4695d6=_0x23f9f2['data'];return console[_0x12e1b4(0x274)](_0x12e1b4(0x28e)+_0x4695d6[_0x12e1b4(0x1b9)]+_0x12e1b4(0x208)+(_0x4695d6['length']!==0x1?'s':'')),await handleSDKOutput(_0x4695d6,_0x29bc41),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x20c);['description']=a54_0xb99464(0x191);async['execute'](_0x4c0b88){const _0x3b87b3=a54_0xb99464,{options:_0x23b51f,args:_0x162302,tdx:_0x579c9b}=_0x4c0b88,_0x419065=_0x162302[0x0];let _0x549579=_0x162302[0x1];if(!_0x419065)return console['error'](_0x3b87b3(0x2ce)),0x1;_0x23b51f[_0x3b87b3(0x2a9)]&&(console['error']('Attempt\x20ID:\x20'+_0x419065),_0x549579&&console[_0x3b87b3(0x274)](_0x3b87b3(0x288)+_0x549579));const _0xe0b3f3=await withSpinner('Fetching\x20log\x20files...',()=>_0x579c9b[_0x3b87b3(0x229)][_0x3b87b3(0x21d)](_0x419065,_0x549579),{'verbose':_0x23b51f[_0x3b87b3(0x2a9)]}),_0x8d6098=_0xe0b3f3[_0x3b87b3(0x149)];if(_0x8d6098[_0x3b87b3(0x1b9)]===0x0)return console[_0x3b87b3(0x274)](_0x3b87b3(0x25f)),0x0;if(!_0x549579&&(_0x23b51f['json']||_0x23b51f[_0x3b87b3(0x256)]))return await handleSDKOutput(_0x8d6098,_0x23b51f),0x0;if(!_0x549579){const _0x44de1=_0x8d6098['map'](_0x3222db=>({'title':_0x3222db[_0x3b87b3(0x130)]+'\x20('+formatBytes(_0x3222db[_0x3b87b3(0x2ad)])+')','value':_0x3222db['taskName']})),_0x209aec=await a54_0x24334b({'type':'select','name':_0x3b87b3(0x24b),'message':_0x3b87b3(0x29a),'choices':_0x44de1});if(!_0x209aec['task'])return console[_0x3b87b3(0x274)](_0x3b87b3(0x1af)),0x0;_0x549579=_0x209aec[_0x3b87b3(0x24b)];}const _0x36d1c7=await withSpinner(_0x3b87b3(0x1f7),()=>_0x579c9b[_0x3b87b3(0x229)][_0x3b87b3(0x219)](_0x419065,_0x549579),{'verbose':_0x23b51f[_0x3b87b3(0x2a9)]}),_0x2cc68d=_0x36d1c7[_0x3b87b3(0x149)];return _0x2cc68d?console[_0x3b87b3(0x25a)](_0x2cc68d):console['error'](_0x3b87b3(0x233)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x1ab);[a54_0xb99464(0x13a)]=a54_0xb99464(0x217);async[a54_0xb99464(0x1e1)](_0x7c0d72){const _0x27b9fc=a54_0xb99464,{options:_0x3fb5a4,args:_0x4dbdea,tdx:_0x6f3e73}=_0x7c0d72,_0x346c18=_0x4dbdea[0x0];if(!_0x346c18)return console[_0x27b9fc(0x274)](_0x27b9fc(0x2ce)),0x1;const _0x34c02c=_0x3fb5a4['reason'];_0x3fb5a4[_0x27b9fc(0x2a9)]&&(console[_0x27b9fc(0x274)](_0x27b9fc(0x24c)+_0x346c18),_0x34c02c&&console[_0x27b9fc(0x274)](_0x27b9fc(0x1ae)+_0x34c02c));if(!_0x3fb5a4[_0x27b9fc(0x167)]){if(!isInteractive())return console[_0x27b9fc(0x274)](a54_0x3265bd[_0x27b9fc(0x2aa)]('\x0aError:'),_0x27b9fc(0x2c6)),console[_0x27b9fc(0x274)](a54_0x3265bd[_0x27b9fc(0x1a1)](_0x27b9fc(0x128))),0x1;const _0x4e81ba=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x346c18+'?');if(!_0x4e81ba)return console['error'](a54_0x3265bd[_0x27b9fc(0x267)](_0x27b9fc(0x1af))),0x1;}const _0x546e3d=await withSpinner(_0x27b9fc(0x214),()=>_0x6f3e73[_0x27b9fc(0x229)]['kill'](_0x346c18,_0x34c02c),{'verbose':_0x3fb5a4['verbose']}),_0x5d26fa=_0x546e3d[_0x27b9fc(0x149)];return console[_0x27b9fc(0x274)]('✔\x20'+_0x5d26fa),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x258);['description']=a54_0xb99464(0x2d4);async[a54_0xb99464(0x1e1)](_0x5aae24){const _0x3532ad=a54_0xb99464,{options:_0x595cdf,args:_0x5e39a2,tdx:_0x44aca1}=_0x5aae24,_0x1cfd35=_0x5e39a2[0x0];if(!_0x1cfd35)return console[_0x3532ad(0x274)](_0x3532ad(0x1cb)),console['error'](_0x3532ad(0x22d)),0x1;let _0x1012bf=![],_0x1ff4a4=_0x1cfd35;if(_0x1cfd35[_0x3532ad(0x2d3)](_0x3532ad(0x1aa)))_0x1012bf=!![],_0x1ff4a4=_0x1cfd35['substring'](0x8);else{if(_0x1cfd35[_0x3532ad(0x2d3)](_0x3532ad(0x19c)))_0x1012bf=![],_0x1ff4a4=_0x1cfd35[_0x3532ad(0x297)](0x8);else return console[_0x3532ad(0x274)](_0x3532ad(0x1f5)),console[_0x3532ad(0x274)](_0x3532ad(0x22d)),0x1;}const _0x430805=_0x595cdf[_0x3532ad(0x165)],_0x4cb680=_0x595cdf[_0x3532ad(0x177)],_0x230f07=_0x595cdf[_0x3532ad(0x158)],_0x270b73=_0x595cdf[_0x3532ad(0x14b)];_0x595cdf[_0x3532ad(0x2a9)]&&(console[_0x3532ad(0x274)](_0x3532ad(0x2ae)+(_0x1012bf?_0x3532ad(0x29b):_0x3532ad(0x1ca))+'\x20'+_0x1ff4a4),_0x430805&&console[_0x3532ad(0x274)](_0x3532ad(0x266)+_0x430805),_0x4cb680&&console['error'](_0x3532ad(0x11d)+_0x4cb680),_0x230f07&&console[_0x3532ad(0x274)]('Params:\x20'+_0x230f07),_0x270b73&&console[_0x3532ad(0x274)](_0x3532ad(0x25b)));let _0x40a6c5;if(_0x230f07)try{if(_0x230f07[_0x3532ad(0x2d3)]('@')){const _0x59ac24=await import(_0x3532ad(0x1d3)),_0x4e49f2=_0x230f07[_0x3532ad(0x297)](0x1),_0x5e3d9a=await _0x59ac24[_0x3532ad(0x222)](_0x4e49f2,_0x3532ad(0x140));_0x40a6c5=JSON[_0x3532ad(0x1b0)](_0x5e3d9a);}else _0x40a6c5=JSON[_0x3532ad(0x1b0)](_0x230f07);}catch{return console['error'](_0x3532ad(0x27a)),0x1;}if(!_0x595cdf['yes']){if(!isInteractive())return console['error'](a54_0x3265bd[_0x3532ad(0x2aa)](_0x3532ad(0x11a)),_0x3532ad(0x2c6)),console[_0x3532ad(0x274)](a54_0x3265bd[_0x3532ad(0x1a1)](_0x3532ad(0x128))),0x1;const _0x1d90c9=await confirmKey(_0x3532ad(0x1f1)+(_0x1012bf?_0x3532ad(0x29b):'attempt')+'\x20'+_0x1ff4a4+'?');if(!_0x1d90c9)return console['error'](a54_0x3265bd[_0x3532ad(0x267)]('Cancelled')),0x1;}let _0x4a2bab;_0x1012bf?_0x4a2bab=await withSpinner('Retrying\x20session...',()=>_0x44aca1[_0x3532ad(0x229)]['retrySession'](_0x1ff4a4,{'fromTask':_0x430805,'retryParams':_0x40a6c5}),{'verbose':_0x595cdf[_0x3532ad(0x2a9)]}):_0x4a2bab=await withSpinner('Retrying\x20attempt...',()=>_0x44aca1['workflow']['retryAttempt'](_0x1ff4a4,{'resumeFrom':_0x4cb680,'retryParams':_0x40a6c5,'force':_0x270b73}),{'verbose':_0x595cdf['verbose']});const _0x44fce2=_0x4a2bab[_0x3532ad(0x149)];return console['error'](_0x3532ad(0x235)),console[_0x3532ad(0x274)](_0x3532ad(0x13c)+_0x44fce2[_0x3532ad(0x216)]),console[_0x3532ad(0x274)]('\x20\x20Session\x20ID:\x20'+_0x44fce2[_0x3532ad(0x1cd)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x159);['description']='Start\x20a\x20workflow\x20run';async[a54_0xb99464(0x1e1)](_0x5c78c5){const _0x5c73bd=a54_0xb99464,{options:_0x6a6813,args:_0xf7d53b,tdx:_0x2f8cde}=_0x5c78c5;let _0x351b30=_0xf7d53b[0x0];if(!_0x351b30){const _0x50bf60=this[_0x5c73bd(0x178)]([],_0x6a6813),_0x6abbb2=await withSpinner(_0x5c73bd(0x21e),()=>_0x2f8cde[_0x5c73bd(0x229)][_0x5c73bd(0x1d5)](_0x50bf60,{'limit':_0x6a6813[_0x5c73bd(0x14e)]}),{'verbose':_0x6a6813[_0x5c73bd(0x2a9)]}),_0x2e0a83=_0x6abbb2[_0x5c73bd(0x149)];if(_0x2e0a83[_0x5c73bd(0x1b9)]===0x0)return console[_0x5c73bd(0x274)]('No\x20workflows\x20found'),!_0x50bf60&&console[_0x5c73bd(0x274)](a54_0x3265bd[_0x5c73bd(0x1a1)](_0x5c73bd(0x2bf))),0x1;const _0x5c800c=_0x2e0a83[_0x5c73bd(0x127)](_0x25fbc5=>({'title':_0x25fbc5[_0x5c73bd(0x23d)]?.[_0x5c73bd(0x2ba)]+'.'+_0x25fbc5[_0x5c73bd(0x2ba)],'value':_0x25fbc5[_0x5c73bd(0x23d)]?.['name']+'.'+_0x25fbc5['name'],'description':_0x25fbc5[_0x5c73bd(0x261)]?'revision:\x20'+_0x25fbc5[_0x5c73bd(0x261)]:undefined})),_0x42bda3=await a54_0x24334b({'type':_0x5c73bd(0x173),'name':_0x5c73bd(0x229),'message':_0x5c73bd(0x1a7),'choices':_0x5c800c});if(!_0x42bda3[_0x5c73bd(0x229)])return 0x1;_0x351b30=_0x42bda3[_0x5c73bd(0x229)];}if(!_0x351b30[_0x5c73bd(0x1e0)]('.')){const _0x257dbe=this[_0x5c73bd(0x178)]([],_0x6a6813);if(_0x257dbe)_0x351b30=_0x257dbe+'.'+_0x351b30;else return console[_0x5c73bd(0x274)](a54_0x3265bd['red']('Error:'),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console[_0x5c73bd(0x274)](a54_0x3265bd[_0x5c73bd(0x1a1)](_0x5c73bd(0x2bf))),0x1;}const _0x378063=_0x6a6813[_0x5c73bd(0x21a)],_0x21eed2=_0x6a6813[_0x5c73bd(0x2c5)],_0x3240e6={};if(_0x378063&&Array[_0x5c73bd(0x2ab)](_0x378063))for(const _0x4ae9a1 of _0x378063){const _0x3d6708=_0x4ae9a1[_0x5c73bd(0x1a9)]('=');if(_0x3d6708===-0x1)return console[_0x5c73bd(0x274)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x4ae9a1),console[_0x5c73bd(0x274)](_0x5c73bd(0x228)),0x1;const _0x67a7f1=_0x4ae9a1['substring'](0x0,_0x3d6708),_0x33cb36=_0x4ae9a1[_0x5c73bd(0x297)](_0x3d6708+0x1);try{_0x3240e6[_0x67a7f1]=JSON['parse'](_0x33cb36);}catch{_0x3240e6[_0x67a7f1]=_0x33cb36;}}_0x6a6813[_0x5c73bd(0x2a9)]&&(console[_0x5c73bd(0x274)](_0x5c73bd(0x17c)+_0x351b30),Object[_0x5c73bd(0x1b8)](_0x3240e6)[_0x5c73bd(0x1b9)]>0x0&&console[_0x5c73bd(0x274)](_0x5c73bd(0x154)+JSON['stringify'](_0x3240e6)),_0x21eed2&&console[_0x5c73bd(0x274)]('Session\x20time:\x20'+_0x21eed2));const _0x3daf52=await withSpinner(_0x5c73bd(0x23e),()=>_0x2f8cde[_0x5c73bd(0x229)][_0x5c73bd(0x153)](_0x351b30,_0x3240e6,{'sessionTime':_0x21eed2}),{'verbose':_0x6a6813[_0x5c73bd(0x2a9)]}),_0x529d95=_0x3daf52[_0x5c73bd(0x149)];console[_0x5c73bd(0x274)]('✔\x20Workflow\x20run\x20started'),console['error'](_0x5c73bd(0x111)+_0x529d95['id']),console[_0x5c73bd(0x274)](_0x5c73bd(0x2b7)+_0x529d95[_0x5c73bd(0x1cd)]),console[_0x5c73bd(0x274)]('\x20\x20Project:\x20'+_0x529d95[_0x5c73bd(0x23d)]?.['name']),console[_0x5c73bd(0x274)](_0x5c73bd(0x236)+_0x529d95[_0x5c73bd(0x229)]?.[_0x5c73bd(0x2ba)]);if(_0x529d95[_0x5c73bd(0x23d)]?.['id']&&_0x529d95[_0x5c73bd(0x1cd)]&&_0x529d95['id']){const _0x31fe60=_0x6a6813[_0x5c73bd(0x1fa)],_0x1b64f5=getConsoleUrl(_0x31fe60,'/app/workflows/'+_0x529d95[_0x5c73bd(0x23d)]['id']+_0x5c73bd(0x1ce)+_0x529d95[_0x5c73bd(0x1cd)]+_0x5c73bd(0x28d)+_0x529d95['id']);console[_0x5c73bd(0x274)]('\x20\x20Console:\x20'+a54_0x3265bd['cyan'](_0x1b64f5));}return 0x0;}}function a54_0x299b(){const _0x3bed1f=['buildTimelineData','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','workflow:schedule:enable','GUTTER','map','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','✔\x20Workflow\x20project\x20context\x20cleared.','LABEL_MIN_SPACING','every','padStart','Show\x20tasks\x20for\x20an\x20attempt','projectId','pullProject','taskName','getMinutes','key','-\x20no\x20files\x20written','\x20(system)','\x20deleted','MAX_TIMELINE_WIDTH','nextRunTime','set','generateSessionTimelineRows','description','type','\x20\x20New\x20attempt\x20ID:\x20','modified','→\x20Project:\x20','filter','utf-8','Project\x20directory:\x20','Source\x20project:\x20','workflow:timeline','blue','isTTY','No\x20sessions\x20with\x20timing\x20information','List\x20workflow\x20attempts','running','data','Disabling\x20schedule\x20#','force','splice','deleted','limit','---\x20','Error:\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','text','run','Parameters:\x20','repeat','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','list','params','workflow:run','(unknown)','parseProjectWorkflowPattern','size','Target\x20directory:\x20','\x20to\x20see\x20detailed\x20logs','columns','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','List\x20workflows','1zlKEdu','disableSchedule','Project\x20name\x20is\x20required','fromTask','Session\x20not\x20found:\x20','yes','createdAt','-\x20nothing\x20pushed','title','toLocaleString','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','clear','\x20logs','No\x20sessions\x20found\x20in\x20project:\x20','workflow:secrets:set','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','45tbzrvB','select','\x20\x20Project:\x20','\x20new','\x22\x20already\x20exists\x20(ID:\x20','resumeFrom','resolveProject','status','\x27\x20from\x20project\x20\x27','💡\x20Tip:\x20Use\x20','Workflow:\x20','\x20enabled\x20(','Key\x20cannot\x20be\x20empty','workflowName','Filter:\x20','Downloading\x20project\x20','No\x20attempts\x20found\x20in\x20project:\x20','trimEnd','\x0aDry\x20run\x20-\x20no\x20files\x20written','✔\x20Push\x20complete','now','No\x20attempts\x20found\x20for:\x20','Enable\x20a\x20workflow\x20schedule','\x20-\x20','\x20\x20Project\x20ID:\x20','fill','durationMs','sys','workflow:attempts','Pushing\x20project...','changes','Show\x20logs\x20for\x20a\x20workflow\x20attempt','List\x20workflow\x20execution\x20sessions','203496NzmBtJ','stdout','tdx\x20wf\x20attempt\x20','sourceProjectName','jsonl','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','\x1b[1A\x1b[2K','TASK_NAME_WIDTH','MAX_POLL_ITERATIONS','attempt:','Updating\x20','Include\x20retried:\x20yes','match','\x20\x20Revision:\x20','dim','No\x20workflow\x20sessions\x20found','\x20\x20Location:\x20','enableSchedule','attempts','Dry\x20run:\x20yes','Select\x20a\x20workflow\x20to\x20run','msPerChar','indexOf','session:','workflow:kill','cyan','Deleting\x20project\x20','Reason:\x20','Cancelled','parse','Select\x20a\x20session\x20to\x20view\x20timeline:','Revision:\x20','Listing\x20secrets...','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','\x20\x20Console:\x20','output','cwd','keys','length','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','\x20(disabled)','sort','Session\x20','workflow:use','Schedule\x20ID\x20is\x20required','message','table','tdx.json','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','startedAt','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','done','\x20from\x20session\x20','1967182NMNrhv','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','attempt','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','MAX_LABEL_COUNT','sessionId','/sessions/','hasChanges','from','\x20is\x20not\x20a\x20directory','localeCompare','fs/promises','\x20attempt','workflows','applyPullProject','LABEL_WIDTH_DIVISOR','state','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','resolve','pending','Error:','rows','Including\x20subtasks:\x20yes','targetDir','includes','execute','getDate','✔\x20Secret\x20\x27','renderSessionsTimeline','✔\x20Project\x20updated','finishedAt','Listing\x20workflows...','Status:\x20','stat','Listing\x20workflow\x20attempts...','path','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','workflow:pull','\x20of\x20','requireProject','startTime','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Tip:\x20cd\x20to\x20workflows/','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','\x20\x20Next\x20run:\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','floor','Downloading\x20logs...','Validation:\x20skipped','\x20\x20tdx\x20wf\x20use\x20<project>','site','workflow:tasks','displayLine','No\x20projects\x20match\x20pattern:\x20','unchanged','end','workflow:projects','Deleting\x20secret...','summary','planned','workflow:schedule:disable','Pattern:\x20','lastAttempt','\x20secrets\x20set\x20for\x20project\x20\x27','\x20task','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','duration','\x20workflow','workflow:logs','all','preparePushProject','pollTimeline','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Loading\x20session...','✔\x20Schedule\x20#','workflow:clone','Killing\x20attempt...',',\x20Workflow:\x20','attemptId','Kill\x20a\x20running\x20attempt','sessions','logs','param','getTime','has','logFiles','Loading\x20workflows...','tasks','trim','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','readFile','white','renderSingleTimeline','\x20schedule','📅\x20#','workflow:delete','Expected\x20format:\x20--param\x20key=value','workflow','No\x20schedules\x20found','getHours','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','✔\x20Deleted\x20project\x20','\x0a✔\x20Already\x20up\x20to\x20date','projects','group_error','listSecrets','No\x20log\x20content\x20found','Warning:','✔\x20Retry\x20started','\x20\x20Workflow:\x20','join','newProjectName','✔\x20Showing\x20','workflowProject','Failed\x20to\x20fetch\x20attempt\x20data','Secrets\x20to\x20set:\x20','project','Starting\x20workflow\x20run...','some','Show\x20specific\x20attempt\x20details','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','split','Key:\x20','Listing\x20schedules...','📋\x20','workflow:workflows','✔\x20Pull\x20complete','\x22\x20with\x20new\x20revision?','follow','Output\x20directory:\x20','task','Attempt\x20ID:\x20','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','ICON_WIDTH','basename','workflow:download','862614SyoUpJ','success','deleteSecret','getFullYear','prepareCloneProject','format','...','workflow:retry','slice','log','Force:\x20yes','value','Setting\x20secret...','Cloning\x20to\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Files\x20to\x20upload:\x20','revision','Filter:\x20project=','Using\x20attempt\x20','Error:\x20Secret\x20key\x20is\x20required','unknown','From\x20task:\x20','yellow','\x0aDry\x20run\x20-\x20no\x20project\x20created','668034wIrfkj','workflow:schedules','\x0a✔\x20No\x20changes\x20to\x20push','projectName','includeSubtasks','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','retryAttemptName','disabledAt','\x20sessions\x20','\x0aDry\x20run\x20-\x20nothing\x20pushed','\x0aPush\x20these\x20changes?','error','fullName','Getting\x20attempt\x20details...','\x0a✔\x20Attempt\x20complete','886368VRdtji','json','Error:\x20Invalid\x20JSON\x20in\x20--params','\x22\x20to\x20new\x20project\x20\x22','\x20disabled\x20(','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','updatedAt','Pull\x20workflow\x20project\x20to\x20local\x20folder','workflow:upload','\x20\x20Target:\x20','\x20secret','write','resolveProjectDir','ICON_SPACING','\x20next:\x20','\x20has\x20no\x20attempts','Task\x20name:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','\x0a⚠\x20Project\x20\x22','canceling','start','/attempt/','✔\x20Found\x20','Resolving\x20project\x20\x27','📁\x20','MAX_TASKS_DISPLAY','No\x20sessions\x20found\x20for:\x20','icon','navigateSessionsInteractive','Invalid\x20format:\x20','diff','substring','\x0aClone\x20\x22','No\x20workflow\x20projects\x20found','Select\x20a\x20task\x20to\x20view\x20logs:','session','4xCFImk','toISOString','Attempt:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','\x20tasks','find','Error:\x20Project\x20name\x20is\x20required','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Analyzing\x20project...','Project:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','resolveProjectId','verbose','red','isArray','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','fileSize','Target:\x20','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','max','showWorkflowConsoleUrl','index','dryRun','newProjectId','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','\x20\x20Session\x20ID:\x20','Source\x20directory\x20is\x20required','Total:\x20','name','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','getMonth','skipValidation','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','targetExists','sourceDir','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','push','min','sessionTime','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Setting\x20','window','delete','toLowerCase','round','context','Error:\x20Attempt\x20ID\x20is\x20required','Listing\x20workflow\x20projects...','.\x20Expected\x20format:\x20KEY=VALUE','New\x20project\x20name:\x20','session_id','startsWith','Retry\x20a\x20session\x20or\x20attempt','\x20unchanged','(use\x20--limit\x20to\x20see\x20more)','\x20\x20Attempt\x20ID:\x20','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','new','1879855nQFyCn','Latest\x20session\x20has\x20no\x20attempt','MIN_TIMELINE_WIDTH','isDirectory','get','green','\x0aError:','cancelRequested','\x20\x20Session\x20context\x20set\x20to:\x20','Resume\x20from:\x20','No\x20workflow\x20tdx.json\x20found','\x0aApply\x20these\x20changes?','relative','workflow:secrets:delete','524280UNQvkP'];a54_0x299b=function(){return _0x3bed1f;};return a54_0x299b();}export class WorkflowDownloadCommand extends BaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x250);[a54_0xb99464(0x13a)]=a54_0xb99464(0x2a4);async[a54_0xb99464(0x1e1)](_0x46c51c){const _0x32a1d2=a54_0xb99464,{options:_0x52696e,args:_0x26c995,tdx:_0x17de19}=_0x46c51c,_0x511835=_0x26c995[0x0],_0x4a4122=_0x26c995[0x1]||'.';if(!_0x511835)return console[_0x32a1d2(0x274)](_0x32a1d2(0x2a3)),console[_0x32a1d2(0x274)](_0x32a1d2(0x171)),0x1;const _0x4bc4de=_0x52696e[_0x32a1d2(0x261)];_0x52696e[_0x32a1d2(0x2a9)]&&(console[_0x32a1d2(0x274)](_0x32a1d2(0x2a6)+_0x511835),console[_0x32a1d2(0x274)](_0x32a1d2(0x24a)+_0x4a4122),_0x4bc4de&&console['error'](_0x32a1d2(0x1b2)+_0x4bc4de));const _0x3aa670=await withSpinner(_0x32a1d2(0x181)+_0x511835+'...',()=>_0x17de19[_0x32a1d2(0x229)]['download'](_0x511835,_0x4a4122,{'revision':_0x4bc4de}),{'verbose':_0x52696e[_0x32a1d2(0x2a9)]}),_0x4c756b=_0x3aa670[_0x32a1d2(0x149)];return console[_0x32a1d2(0x274)]('✔\x20Downloaded\x20'+_0x4c756b['projectName']),console[_0x32a1d2(0x274)]('\x20\x20Revision:\x20'+_0x4c756b[_0x32a1d2(0x261)]),console[_0x32a1d2(0x274)]('\x20\x20Files\x20extracted:\x20'+_0x4c756b['filesExtracted']),console[_0x32a1d2(0x274)](_0x32a1d2(0x1a3)+_0x4a4122+'/'+_0x4c756b[_0x32a1d2(0x26c)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a54_0xb99464(0x280);['description']='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async[a54_0xb99464(0x1e1)](_0x2a319e){const _0x367579=a54_0xb99464,{options:_0x23ef49,args:_0x4e5961,tdx:_0x1ba1fc}=_0x2a319e;let _0x3fe75f='.',_0x221cbc=_0x23ef49[_0x367579(0x2ba)];if(_0x4e5961[0x0]){const {promises:_0x32ca38}=await import('fs');try{const _0xf83499=await _0x32ca38[_0x367579(0x1e9)](_0x4e5961[0x0]);if(_0xf83499[_0x367579(0x117)]())_0x3fe75f=_0x4e5961[0x0];else return console[_0x367579(0x274)](_0x367579(0x150)+_0x4e5961[0x0]+_0x367579(0x1d1)),0x1;}catch{_0x221cbc=_0x4e5961[0x0],_0x3fe75f='.';}}const _0x36ac8c=_0x23ef49[_0x367579(0x261)],_0x489ef1=_0x23ef49[_0x367579(0x2bd)];_0x23ef49['verbose']&&(console['error'](_0x367579(0x141)+_0x3fe75f),_0x221cbc&&console[_0x367579(0x274)]('Project\x20name:\x20'+_0x221cbc),_0x36ac8c&&console[_0x367579(0x274)](_0x367579(0x1b2)+_0x36ac8c),_0x489ef1&&console[_0x367579(0x274)](_0x367579(0x1f8)));const _0xf65953=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x1ba1fc[_0x367579(0x229)][_0x367579(0x2c3)](_0x3fe75f,{'projectName':_0x221cbc,'revision':_0x36ac8c,'skipValidation':_0x489ef1}),{'verbose':_0x23ef49['verbose']}),_0x2a5a83=_0xf65953[_0x367579(0x149)];return console[_0x367579(0x274)]('✔\x20Pushed\x20'+_0x2a5a83['projectName']),console[_0x367579(0x274)](_0x367579(0x18a)+_0x2a5a83[_0x367579(0x12e)]),console[_0x367579(0x274)](_0x367579(0x1a0)+_0x2a5a83[_0x367579(0x261)]),await this[_0x367579(0x2b1)](_0x1ba1fc,_0x2a5a83['projectName'],_0x23ef49[_0x367579(0x1fa)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']=a54_0xb99464(0x1ed);['description']=a54_0xb99464(0x27f);async[a54_0xb99464(0x1e1)](_0x5bbb58){const _0xe53570=a54_0xb99464,{options:_0x721f6f,args:_0x3f8c5e,tdx:_0x276b6b}=_0x5bbb58,_0x26f1a7=_0x3f8c5e[0x0],_0x5df5a0=_0x3f8c5e[0x1];if(!_0x26f1a7)return console['error'](a54_0x3265bd[_0xe53570(0x2aa)](_0xe53570(0x1dc)),_0xe53570(0x164)),console[_0xe53570(0x274)](a54_0x3265bd[_0xe53570(0x1a1)]('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x2783df=_0x721f6f[_0xe53570(0x261)];_0x721f6f['verbose']&&(console[_0xe53570(0x274)](_0xe53570(0x2a6)+_0x26f1a7),_0x5df5a0&&console[_0xe53570(0x274)](_0xe53570(0x15d)+_0x5df5a0),_0x2783df&&console[_0xe53570(0x274)](_0xe53570(0x1b2)+_0x2783df),_0x721f6f[_0xe53570(0x2b3)]&&console['error']('Dry\x20run:\x20yes'));const _0x42c850=await withSpinner('Pulling\x20project\x20'+_0x26f1a7+_0xe53570(0x257),()=>_0x276b6b[_0xe53570(0x229)][_0xe53570(0x12f)](_0x26f1a7,{'targetDir':_0x5df5a0,'revision':_0x2783df}),{'verbose':_0x721f6f[_0xe53570(0x2a9)]}),_0x150a2b=_0x42c850[_0xe53570(0x149)];_0x150a2b['isNewProject']?console[_0xe53570(0x274)]('→\x20New\x20project:\x20'+_0x150a2b[_0xe53570(0x26c)]):console[_0xe53570(0x274)](_0xe53570(0x13e)+_0x150a2b[_0xe53570(0x26c)]);console[_0xe53570(0x274)](_0xe53570(0x1a0)+_0x150a2b['revision']),console['error'](_0xe53570(0x281)+(a54_0x5df1b0['relative'](process['cwd'](),_0x150a2b[_0xe53570(0x1df)])||'.')),console[_0xe53570(0x274)]('\x20\x20Changes:\x20'+a54_0x3265bd[_0xe53570(0x119)]('+'+_0x150a2b[_0xe53570(0x202)][_0xe53570(0x113)]+_0xe53570(0x175))+',\x20'+(a54_0x3265bd[_0xe53570(0x267)]('~'+_0x150a2b[_0xe53570(0x202)][_0xe53570(0x13d)]+'\x20modified')+',\x20')+(a54_0x3265bd[_0xe53570(0x2aa)]('-'+_0x150a2b['summary'][_0xe53570(0x14d)]+_0xe53570(0x135))+',\x20')+(''+a54_0x3265bd[_0xe53570(0x1a1)](_0x150a2b[_0xe53570(0x202)][_0xe53570(0x1fe)]+_0xe53570(0x2d5))));for(const _0x3fc133 of _0x150a2b['changes']){_0x3fc133[_0xe53570(0x13b)]===_0xe53570(0x13d)&&_0x3fc133['diff']&&(console[_0xe53570(0x274)]('\x0a'+a54_0x3265bd[_0xe53570(0x1ac)]('---\x20'+_0x3fc133[_0xe53570(0x1eb)])),console[_0xe53570(0x274)](_0x3fc133['diff']));}if(!_0x150a2b[_0xe53570(0x1cf)])return saveSessionContext({'workflow_project':_0x150a2b[_0xe53570(0x26c)]},_0x721f6f[_0xe53570(0x29b)]),console[_0xe53570(0x274)](a54_0x3265bd[_0xe53570(0x119)](_0xe53570(0x22f))),console[_0xe53570(0x274)](a54_0x3265bd[_0xe53570(0x1a1)](_0xe53570(0x11c)+_0x150a2b[_0xe53570(0x26c)])),0x0;if(_0x721f6f[_0xe53570(0x2b3)])return console[_0xe53570(0x274)](a54_0x3265bd[_0xe53570(0x267)](_0xe53570(0x184))),0x0;if(!_0x721f6f[_0xe53570(0x167)]){if(!isInteractive())return console['error'](a54_0x3265bd['red'](_0xe53570(0x11a)),_0xe53570(0x2c6)),console[_0xe53570(0x274)](a54_0x3265bd[_0xe53570(0x1a1)](_0xe53570(0x128))),0x1;const _0x4f3e10=await confirmKey(_0xe53570(0x11f));if(!_0x4f3e10)return console['error'](a54_0x3265bd['yellow'](_0xe53570(0x1af)),_0xe53570(0x133)),0x1;}await withSpinner('Writing\x20files...',()=>_0x276b6b[_0xe53570(0x229)][_0xe53570(0x1d6)](_0x150a2b,{'revision':_0x2783df}),{'verbose':_0x721f6f['verbose']}),saveSessionContext({'workflow_project':_0x150a2b[_0xe53570(0x26c)]},_0x721f6f[_0xe53570(0x29b)]),console[_0xe53570(0x274)](a54_0x3265bd[_0xe53570(0x119)](_0xe53570(0x247)));const _0x2c71ca=a54_0x5df1b0[_0xe53570(0x120)](process['cwd'](),_0x150a2b[_0xe53570(0x1df)])||'.';return console[_0xe53570(0x274)](a54_0x3265bd[_0xe53570(0x1a1)]('\x20\x20Location:\x20'+_0x2c71ca)),console[_0xe53570(0x274)](a54_0x3265bd[_0xe53570(0x1a1)](_0xe53570(0x11c)+_0x150a2b[_0xe53570(0x26c)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a54_0xb99464(0x2ba)]='workflow:push';['description']=a54_0xb99464(0x209);async['execute'](_0x2b468e){const _0x1bec1d=a54_0xb99464,{options:_0x45e6c1,args:_0x55246c,tdx:_0x2b29b3}=_0x2b468e,_0x214af6=this[_0x1bec1d(0x284)](_0x55246c,_0x45e6c1),_0x112555=_0x45e6c1[_0x1bec1d(0x261)],_0x3106ed=_0x45e6c1[_0x1bec1d(0x2bd)];_0x45e6c1[_0x1bec1d(0x2a9)]&&(_0x214af6&&console[_0x1bec1d(0x274)]('Source\x20directory:\x20'+_0x214af6),_0x112555&&console['error'](_0x1bec1d(0x1b2)+_0x112555),_0x45e6c1[_0x1bec1d(0x2b3)]&&console['error']('Dry\x20run:\x20yes'),_0x3106ed&&console[_0x1bec1d(0x274)]('Validation:\x20skipped'));let _0x25e1bf;try{_0x25e1bf=await withSpinner('Analyzing\x20changes...',()=>_0x2b29b3[_0x1bec1d(0x229)][_0x1bec1d(0x20e)]({'sourceDir':_0x214af6,'revision':_0x112555,'skipValidation':_0x3106ed}),{'verbose':_0x45e6c1[_0x1bec1d(0x2a9)]});}catch(_0x249a40){if(_0x249a40 instanceof Error&&_0x249a40[_0x1bec1d(0x1c0)][_0x1bec1d(0x1e0)](_0x1bec1d(0x11e)))return console['error'](a54_0x3265bd[_0x1bec1d(0x2aa)]('Error:'),_0x1bec1d(0x1b4)),_0x45e6c1[_0x1bec1d(0x23a)]?console[_0x1bec1d(0x274)](a54_0x3265bd['dim'](_0x1bec1d(0x1f2)+_0x45e6c1['workflowProject']+_0x1bec1d(0x2c2)+_0x45e6c1[_0x1bec1d(0x23a)]+'\x27')):console[_0x1bec1d(0x274)](a54_0x3265bd['dim']('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x249a40;}const _0x56cdcd=_0x25e1bf[_0x1bec1d(0x149)];console[_0x1bec1d(0x274)]('✔\x20Project:\x20'+_0x56cdcd[_0x1bec1d(0x26c)]),console[_0x1bec1d(0x274)]('\x20\x20Source:\x20'+_0x56cdcd[_0x1bec1d(0x2c1)]),console[_0x1bec1d(0x274)](_0x1bec1d(0x1a0)+_0x56cdcd['revision']),console[_0x1bec1d(0x274)]('\x20\x20Changes:\x20'+a54_0x3265bd[_0x1bec1d(0x119)]('+'+_0x56cdcd[_0x1bec1d(0x202)][_0x1bec1d(0x113)]+_0x1bec1d(0x175))+',\x20'+(a54_0x3265bd[_0x1bec1d(0x267)]('~'+_0x56cdcd['summary']['modified']+'\x20modified')+',\x20')+(a54_0x3265bd[_0x1bec1d(0x2aa)]('-'+_0x56cdcd['summary'][_0x1bec1d(0x14d)]+'\x20deleted')+',\x20')+(''+a54_0x3265bd[_0x1bec1d(0x1a1)](_0x56cdcd[_0x1bec1d(0x202)][_0x1bec1d(0x1fe)]+'\x20unchanged')));for(const _0x100a5a of _0x56cdcd[_0x1bec1d(0x190)]){_0x100a5a[_0x1bec1d(0x13b)]===_0x1bec1d(0x13d)&&_0x100a5a[_0x1bec1d(0x296)]&&(console['error']('\x0a'+a54_0x3265bd['cyan'](_0x1bec1d(0x14f)+_0x100a5a['path'])),console[_0x1bec1d(0x274)](_0x100a5a[_0x1bec1d(0x296)]));}if(!_0x56cdcd[_0x1bec1d(0x1cf)])return console[_0x1bec1d(0x274)](a54_0x3265bd[_0x1bec1d(0x119)](_0x1bec1d(0x26b))),await this[_0x1bec1d(0x2b1)](_0x2b29b3,_0x56cdcd[_0x1bec1d(0x26c)],_0x45e6c1[_0x1bec1d(0x1fa)]),0x0;if(_0x45e6c1[_0x1bec1d(0x2b3)])return console['error'](a54_0x3265bd[_0x1bec1d(0x267)](_0x1bec1d(0x272))),0x0;if(!_0x45e6c1[_0x1bec1d(0x167)]){if(!isInteractive())return console['error'](a54_0x3265bd[_0x1bec1d(0x2aa)](_0x1bec1d(0x11a)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a54_0x3265bd[_0x1bec1d(0x1a1)](_0x1bec1d(0x128))),0x1;const _0x55cc83=await confirmKey(_0x1bec1d(0x273));if(!_0x55cc83)return console[_0x1bec1d(0x274)](a54_0x3265bd[_0x1bec1d(0x267)](_0x1bec1d(0x1af)),_0x1bec1d(0x169)),0x1;}const _0x310bf2=await withSpinner(_0x1bec1d(0x18f),()=>_0x2b29b3[_0x1bec1d(0x229)]['executePushProject'](_0x56cdcd),{'verbose':_0x45e6c1[_0x1bec1d(0x2a9)]}),_0x91cce=_0x310bf2['data'];return console['error'](a54_0x3265bd[_0x1bec1d(0x119)](_0x1bec1d(0x185))),console['error']('\x20\x20Project\x20ID:\x20'+_0x91cce['projectId']),console[_0x1bec1d(0x274)](_0x1bec1d(0x1a0)+_0x91cce[_0x1bec1d(0x261)]),await this[_0x1bec1d(0x2b1)](_0x2b29b3,_0x91cce[_0x1bec1d(0x26c)],_0x45e6c1[_0x1bec1d(0x1fa)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x213);[a54_0xb99464(0x13a)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async['execute'](_0x343944){const _0xece189=a54_0xb99464,{options:_0x2ebe78,args:_0xb69c2b,tdx:_0x3cbcee}=_0x343944,_0x1b9898=this[_0xece189(0x284)](_0xb69c2b,_0x2ebe78),_0x829c58=_0x2ebe78[_0xece189(0x2ba)],_0x22cf1a=_0x2ebe78[_0xece189(0x261)],_0x2fe329=_0x2ebe78['skipValidation'];if(!_0x1b9898)return console['error'](a54_0x3265bd[_0xece189(0x2aa)]('Error:'),_0xece189(0x2b8)),console[_0xece189(0x274)](a54_0x3265bd[_0xece189(0x1a1)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console['error'](a54_0x3265bd['dim'](_0xece189(0x29f))),0x1;if(!_0x829c58)return console['error'](a54_0x3265bd['red']('Error:'),_0xece189(0x160)),console[_0xece189(0x274)](a54_0x3265bd['dim'](_0xece189(0x1d9))),0x1;_0x2ebe78[_0xece189(0x2a9)]&&(console[_0xece189(0x274)]('Source\x20directory:\x20'+_0x1b9898),console[_0xece189(0x274)](_0xece189(0x2d1)+_0x829c58),_0x22cf1a&&console['error'](_0xece189(0x1b2)+_0x22cf1a),_0x2ebe78[_0xece189(0x2b3)]&&console[_0xece189(0x274)](_0xece189(0x1a6)),_0x2fe329&&console['error'](_0xece189(0x1f8)));const _0x35b9f0=await withSpinner(_0xece189(0x2a5),()=>_0x3cbcee[_0xece189(0x229)][_0xece189(0x255)](_0x1b9898,_0x829c58,{'revision':_0x22cf1a,'skipValidation':_0x2fe329}),{'verbose':_0x2ebe78['verbose']}),_0x46c4a0=_0x35b9f0[_0xece189(0x149)];console['error']('Source:\x20'+_0x46c4a0['sourceDir']);_0x46c4a0[_0xece189(0x196)]&&console[_0xece189(0x274)](_0xece189(0x142)+_0x46c4a0[_0xece189(0x196)]);console[_0xece189(0x274)](_0xece189(0x2d1)+_0x46c4a0['newProjectName']),console['error'](_0xece189(0x1b2)+_0x46c4a0[_0xece189(0x261)]),console[_0xece189(0x274)](_0xece189(0x260)+_0x46c4a0['fileCount']);_0x46c4a0[_0xece189(0x2c0)]&&(console[_0xece189(0x274)](a54_0x3265bd['yellow'](_0xece189(0x28a)+_0x46c4a0[_0xece189(0x238)]+_0xece189(0x176)+_0x46c4a0['existingProjectId']+')')),console[_0xece189(0x274)](a54_0x3265bd[_0xece189(0x267)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x2ebe78[_0xece189(0x2b3)])return console['error'](a54_0x3265bd[_0xece189(0x267)](_0xece189(0x268))),0x0;if(!_0x2ebe78[_0xece189(0x167)]){if(!isInteractive())return console[_0xece189(0x274)](a54_0x3265bd['red']('\x0aError:'),_0xece189(0x2c6)),console['error'](a54_0x3265bd[_0xece189(0x1a1)](_0xece189(0x128))),0x1;const _0x7c2bb0=_0x46c4a0[_0xece189(0x196)]||a54_0x5df1b0[_0xece189(0x24f)](_0x1b9898),_0x431632=_0x46c4a0['targetExists']?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x829c58+_0xece189(0x248):_0xece189(0x298)+_0x7c2bb0+_0xece189(0x27b)+_0x829c58+'\x22?',_0x6da01a=await confirmKey(_0x431632);if(!_0x6da01a)return console['error'](a54_0x3265bd[_0xece189(0x267)](_0xece189(0x1af))),0x1;}const _0x4bacfc=await withSpinner(_0x46c4a0[_0xece189(0x2c0)]?_0xece189(0x19d)+_0x829c58+_0xece189(0x257):_0xece189(0x25e)+_0x829c58+_0xece189(0x257),()=>_0x3cbcee[_0xece189(0x229)]['executeCloneProject'](_0x46c4a0),{'verbose':_0x2ebe78['verbose']}),_0x3f16e1=_0x4bacfc[_0xece189(0x149)];return console[_0xece189(0x274)](a54_0x3265bd[_0xece189(0x119)](_0x46c4a0[_0xece189(0x2c0)]?_0xece189(0x1e5):'✔\x20Clone\x20complete')),console['error'](_0xece189(0x174)+_0x3f16e1[_0xece189(0x238)]),console[_0xece189(0x274)](_0xece189(0x18a)+_0x3f16e1[_0xece189(0x2b4)]),console[_0xece189(0x274)](_0xece189(0x1a0)+_0x3f16e1['revision']),await this['showWorkflowConsoleUrl'](_0x3cbcee,_0x3f16e1[_0xece189(0x238)],_0x2ebe78['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a54_0xb99464(0x227);[a54_0xb99464(0x13a)]=a54_0xb99464(0x2a7);async[a54_0xb99464(0x1e1)](_0x4d30f1){const _0x20b8f0=a54_0xb99464,{options:_0x40f212,args:_0x30fe27,tdx:_0x5069d5}=_0x4d30f1,_0x4a6d61=_0x30fe27[0x0];if(!_0x4a6d61)return console[_0x20b8f0(0x274)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x20b8f0(0x274)](_0x20b8f0(0x151)),0x1;_0x40f212['verbose']&&console[_0x20b8f0(0x274)](_0x20b8f0(0x2a6)+_0x4a6d61);if(!_0x40f212[_0x20b8f0(0x167)]){if(!isInteractive())return console[_0x20b8f0(0x274)](a54_0x3265bd[_0x20b8f0(0x2aa)](_0x20b8f0(0x11a)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x20b8f0(0x274)](a54_0x3265bd[_0x20b8f0(0x1a1)](_0x20b8f0(0x128))),0x1;const _0x47693d=await confirmKey(_0x20b8f0(0x16c)+_0x4a6d61+_0x20b8f0(0x289));if(!_0x47693d)return console[_0x20b8f0(0x274)](a54_0x3265bd[_0x20b8f0(0x267)](_0x20b8f0(0x1af))),0x1;}const _0x471056=await withSpinner(_0x20b8f0(0x1ad)+_0x4a6d61+_0x20b8f0(0x257),()=>_0x5069d5[_0x20b8f0(0x229)][_0x20b8f0(0x2ca)](_0x4a6d61),{'verbose':_0x40f212[_0x20b8f0(0x2a9)]}),_0x58a3c2=_0x471056[_0x20b8f0(0x149)];return console[_0x20b8f0(0x274)](_0x20b8f0(0x22e)+_0x58a3c2[_0x20b8f0(0x26c)]),console[_0x20b8f0(0x274)](_0x20b8f0(0x18a)+_0x58a3c2[_0x20b8f0(0x12e)]),0x0;}}export function parseKeyValue(_0x284ae2){const _0x1ff25b=a54_0xb99464,_0x1a7bfe=_0x284ae2[_0x1ff25b(0x1a9)]('=');if(_0x1a7bfe===-0x1)throw new Error(_0x1ff25b(0x295)+_0x284ae2+_0x1ff25b(0x2d0));const _0x1e11f1=_0x284ae2[_0x1ff25b(0x297)](0x0,_0x1a7bfe),_0x3012be=_0x284ae2[_0x1ff25b(0x297)](_0x1a7bfe+0x1);if(!_0x1e11f1)throw new Error(_0x1ff25b(0x17e));return{'key':_0x1e11f1,'value':_0x3012be};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0xb99464(0x2ba)]='workflow:secrets:list';[a54_0xb99464(0x13a)]=a54_0xb99464(0x26e);async['execute'](_0x304764){const _0x3e21a3=a54_0xb99464,{options:_0x1e654b,args:_0x929bfb,tdx:_0x57a8f9}=_0x304764,_0x1467ef=this[_0x3e21a3(0x1ef)](_0x929bfb,_0x1e654b);if(!_0x1467ef)return 0x1;_0x1e654b['verbose']&&console[_0x3e21a3(0x274)](_0x3e21a3(0x2a6)+_0x1467ef);const _0x54ecc1=await withSpinner(_0x3e21a3(0x1b3),()=>_0x57a8f9[_0x3e21a3(0x229)][_0x3e21a3(0x232)](_0x1467ef),{'verbose':_0x1e654b[_0x3e21a3(0x2a9)]}),{secrets:_0x20431a}=_0x54ecc1[_0x3e21a3(0x149)];return console[_0x3e21a3(0x274)](_0x3e21a3(0x28e)+_0x20431a['length']+_0x3e21a3(0x282)+(_0x20431a[_0x3e21a3(0x1b9)]!==0x1?'s':'')),await handleSDKOutput(_0x20431a,_0x1e654b),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x170);[a54_0xb99464(0x13a)]=a54_0xb99464(0x1f3);async['execute'](_0x3b3dd2){const _0xf25ad7=a54_0xb99464,{options:_0x566f19,args:_0x1481a2,tdx:_0x25d265}=_0x3b3dd2;let _0x554b4e,_0x17715a;if(_0x1481a2['length']>=0x1&&!_0x1481a2[0x0][_0xf25ad7(0x1e0)]('='))_0x554b4e=_0x1481a2[0x0],_0x17715a=_0x1481a2[_0xf25ad7(0x259)](0x1);else{if(_0x1481a2['length']>=0x1&&_0x566f19[_0xf25ad7(0x23a)])_0x554b4e=_0x566f19[_0xf25ad7(0x23a)],_0x17715a=_0x1481a2;else return _0x1481a2[_0xf25ad7(0x1b9)]>=0x1?(console[_0xf25ad7(0x274)](_0xf25ad7(0x2a3)),console['error'](_0xf25ad7(0x2bf)),0x1):(console[_0xf25ad7(0x274)](_0xf25ad7(0x27d)),console['error']('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1);}if(_0x17715a[_0xf25ad7(0x1b9)]===0x0)return console[_0xf25ad7(0x274)](_0xf25ad7(0x27d)),console['error'](_0xf25ad7(0x2b6)),0x1;const _0x1004e2={};try{for(const _0x40f1f0 of _0x17715a){const {key:_0x10a05c,value:_0x10b25b}=parseKeyValue(_0x40f1f0);_0x1004e2[_0x10a05c]=_0x10b25b;}}catch(_0x1d1484){return _0x1d1484 instanceof Error&&console['error'](a54_0x3265bd['red'](_0xf25ad7(0x1dc)),_0x1d1484[_0xf25ad7(0x1c0)]),0x1;}const _0x4800b6=Object['keys'](_0x1004e2);_0x566f19[_0xf25ad7(0x2a9)]&&(console[_0xf25ad7(0x274)](_0xf25ad7(0x2a6)+_0x554b4e),console[_0xf25ad7(0x274)](_0xf25ad7(0x23c)+_0x4800b6[_0xf25ad7(0x237)](',\x20')));const _0x149de1=await withSpinner(_0x4800b6[_0xf25ad7(0x1b9)]===0x1?_0xf25ad7(0x25d):_0xf25ad7(0x2c8)+_0x4800b6['length']+'\x20secrets...',()=>_0x25d265[_0xf25ad7(0x229)]['setSecrets'](_0x554b4e,_0x1004e2),{'verbose':_0x566f19[_0xf25ad7(0x2a9)]}),_0x12ddbe=_0x149de1[_0xf25ad7(0x149)];return console[_0xf25ad7(0x274)](_0x4800b6[_0xf25ad7(0x1b9)]===0x1?'✔\x20Secret\x20\x27'+_0x12ddbe[_0xf25ad7(0x1b8)][0x0]+_0xf25ad7(0x210)+_0x12ddbe[_0xf25ad7(0x26c)]+'\x27':'✔\x20'+_0x12ddbe[_0xf25ad7(0x1b8)][_0xf25ad7(0x1b9)]+_0xf25ad7(0x207)+_0x12ddbe[_0xf25ad7(0x26c)]+'\x27'),(_0x566f19['json']||_0x566f19['jsonl'])&&await handleSingleObjectOutput(_0x12ddbe,_0x566f19),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x121);['description']=a54_0xb99464(0x22c);async['execute'](_0x153f2b){const _0x55f145=a54_0xb99464,{options:_0x3d5fb2,args:_0xb389d4,tdx:_0xe86069}=_0x153f2b;let _0x396c95,_0x290ce3;if(_0xb389d4[_0x55f145(0x1b9)]>=0x2)_0x396c95=_0xb389d4[0x0],_0x290ce3=_0xb389d4[0x1];else{if(_0xb389d4[_0x55f145(0x1b9)]===0x1&&_0x3d5fb2[_0x55f145(0x23a)])_0x396c95=_0x3d5fb2[_0x55f145(0x23a)],_0x290ce3=_0xb389d4[0x0];else return _0xb389d4['length']===0x1?(console[_0x55f145(0x274)](_0x55f145(0x2a3)),console[_0x55f145(0x274)](_0x55f145(0x2bf)),0x1):(console[_0x55f145(0x274)](_0x55f145(0x264)),console['error'](_0x55f145(0x2af)),0x1);}_0x3d5fb2[_0x55f145(0x2a9)]&&(console[_0x55f145(0x274)](_0x55f145(0x2a6)+_0x396c95),console[_0x55f145(0x274)](_0x55f145(0x243)+_0x290ce3));if(!_0x3d5fb2[_0x55f145(0x167)]){if(!isInteractive())return console['error'](a54_0x3265bd[_0x55f145(0x2aa)]('\x0aError:'),_0x55f145(0x2c6)),console[_0x55f145(0x274)](a54_0x3265bd[_0x55f145(0x1a1)](_0x55f145(0x128))),0x1;const _0x2a28a4=await confirmKey(_0x55f145(0x198)+_0x290ce3+_0x55f145(0x17a)+_0x396c95+'\x27?');if(!_0x2a28a4)return console['error'](a54_0x3265bd[_0x55f145(0x267)]('Cancelled')),0x1;}const _0x1a5b5f=await withSpinner(_0x55f145(0x201),()=>_0xe86069[_0x55f145(0x229)][_0x55f145(0x253)](_0x396c95,_0x290ce3),{'verbose':_0x3d5fb2[_0x55f145(0x2a9)]}),_0x9d2c2b=_0x1a5b5f[_0x55f145(0x149)];return console[_0x55f145(0x274)](_0x55f145(0x1e3)+_0x9d2c2b[_0x55f145(0x132)]+_0x55f145(0x241)+_0x9d2c2b[_0x55f145(0x26c)]+'\x27'),(_0x3d5fb2[_0x55f145(0x279)]||_0x3d5fb2[_0x55f145(0x197)])&&await handleSingleObjectOutput(_0x9d2c2b,_0x3d5fb2),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(_0x30772f){const _0x37e72b=a54_0xb99464,_0x5f2c07=Math[_0x37e72b(0x1f6)](_0x30772f/0x3e8),_0x349fb9=Math[_0x37e72b(0x1f6)](_0x5f2c07/0x3c),_0x2b5392=Math['floor'](_0x349fb9/0x3c),_0x5388d9=Math[_0x37e72b(0x1f6)](_0x2b5392/0x18);if(_0x5388d9>0x0){const _0x43845e=_0x2b5392%0x18;return _0x43845e>0x0?_0x5388d9+'d\x20'+_0x43845e+'h':_0x5388d9+'d';}else{if(_0x2b5392>0x0){const _0x4aab3c=_0x349fb9%0x3c;return _0x4aab3c>0x0?_0x2b5392+'h\x20'+_0x4aab3c+'m':_0x2b5392+'h';}else{if(_0x349fb9>0x0){const _0x3bee95=_0x5f2c07%0x3c;return _0x3bee95>0x0?_0x349fb9+'m\x20'+_0x3bee95+'s':_0x349fb9+'m';}else return _0x5f2c07+'s';}}}function formatTimestamp(_0x1cfe09,_0x436700){const _0x1de0e9=a54_0xb99464,_0x380233=new Date(_0x1cfe09),_0x4d6d1d=String(_0x380233[_0x1de0e9(0x22b)]())[_0x1de0e9(0x12c)](0x2,'0'),_0x175841=String(_0x380233[_0x1de0e9(0x131)]())[_0x1de0e9(0x12c)](0x2,'0'),_0x56c258=_0x4d6d1d+':'+_0x175841,_0xc23c35=_0x380233[_0x1de0e9(0x254)]()===_0x436700[_0x1de0e9(0x254)]()&&_0x380233[_0x1de0e9(0x2bc)]()===_0x436700['getMonth']()&&_0x380233[_0x1de0e9(0x1e2)]()===_0x436700[_0x1de0e9(0x1e2)]();if(_0xc23c35)return _0x56c258;else{const _0x1626b4=String(_0x380233[_0x1de0e9(0x2bc)]()+0x1)[_0x1de0e9(0x12c)](0x2,'0'),_0x247d66=String(_0x380233['getDate']())[_0x1de0e9(0x12c)](0x2,'0');return _0x1626b4+'-'+_0x247d66+'\x20'+_0x56c258;}}function formatDate(_0x483ab8){const _0xb25606=a54_0xb99464,_0x35ab4d=_0x483ab8[_0xb25606(0x254)](),_0x44fe1a=String(_0x483ab8[_0xb25606(0x2bc)]()+0x1)['padStart'](0x2,'0'),_0x3a0116=String(_0x483ab8[_0xb25606(0x1e2)]())[_0xb25606(0x12c)](0x2,'0');return _0x35ab4d+'-'+_0x44fe1a+'-'+_0x3a0116;}function getTaskStateIcon(_0x19f3b7){const _0x43c383={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x43c383[_0x19f3b7]||'⚪';}function getBarChar(_0x3ee548){const _0x21fd01=a54_0xb99464;return _0x3ee548===_0x21fd01(0x274)||_0x3ee548===_0x21fd01(0x231)?'×':'─';}function getBarColor(_0x51b0f3){const _0x17e94c=a54_0xb99464,_0x1eeab2={'success':a54_0x3265bd[_0x17e94c(0x119)],'error':a54_0x3265bd[_0x17e94c(0x2aa)],'group_error':a54_0x3265bd[_0x17e94c(0x2aa)],'running':a54_0x3265bd[_0x17e94c(0x144)],'blocked':a54_0x3265bd[_0x17e94c(0x267)],'planned':a54_0x3265bd['dim'],'canceling':a54_0x3265bd[_0x17e94c(0x267)]};return _0x1eeab2[_0x51b0f3]||a54_0x3265bd[_0x17e94c(0x223)];}function parseTaskName(_0x1aaf1e){const _0x9ae66e=a54_0xb99464;let _0x8523ac=_0x1aaf1e['replace'](/^\++/,'');const _0x5b8dcb=_0x8523ac[_0x9ae66e(0x242)]('+'),_0x31f540=_0x5b8dcb[_0x9ae66e(0x1b9)]>0x1?_0x5b8dcb[_0x9ae66e(0x1b9)]-0x2:0x0,_0x58ae81=_0x5b8dcb[_0x5b8dcb[_0x9ae66e(0x1b9)]-0x1]||_0x8523ac;return{'level':_0x31f540,'name':'+'+_0x58ae81};}function truncateTaskName(_0x3820f7,_0x492f31){const _0x14029f=a54_0xb99464,_0x436fb3=stringWidth(_0x3820f7);if(_0x436fb3<=_0x492f31)return _0x3820f7;let _0x51c46b=_0x3820f7;while(stringWidth(_0x51c46b+'…')>_0x492f31&&_0x51c46b[_0x14029f(0x1b9)]>0x0){_0x51c46b=_0x51c46b[_0x14029f(0x259)](0x0,-0x1);}return _0x51c46b+'…';}function calculateTimeScale(_0x46d627,_0x4056fd){const _0x22c7ab=a54_0xb99464;return{'startTime':_0x46d627['start'],'endTime':_0x46d627[_0x22c7ab(0x1ff)],'durationMs':_0x46d627[_0x22c7ab(0x20a)],'msPerChar':_0x46d627[_0x22c7ab(0x20a)]/_0x4056fd};}function timeToPosition(_0x5d2a25,_0x3e1f4c,_0x45dc45){const _0x4d8c2a=a54_0xb99464,_0x27d1d4=_0x5d2a25-_0x3e1f4c[_0x4d8c2a(0x1f0)],_0x4a7c09=Math[_0x4d8c2a(0x1f6)](_0x27d1d4/_0x3e1f4c[_0x4d8c2a(0x1a8)]);return Math[_0x4d8c2a(0x2b0)](0x0,Math[_0x4d8c2a(0x2c4)](_0x4a7c09,_0x45dc45));}function renderTimeAxis(_0x57255b,_0x10f4d6){const _0x3e36f2=a54_0xb99464,_0x43cb9d=Math[_0x3e36f2(0x2c4)](TIMELINE_CONFIG[_0x3e36f2(0x1cc)],Math['max'](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math[_0x3e36f2(0x1f6)](_0x10f4d6/TIMELINE_CONFIG[_0x3e36f2(0x1d7)]))),_0x515599=_0x57255b[_0x3e36f2(0x18c)]/(_0x43cb9d-0x1),_0x1d9b83=new Date(_0x57255b['startTime']),_0x1c632e=[];for(let _0x10e9f8=0x0;_0x10e9f8<_0x43cb9d;_0x10e9f8++){const _0x84a4f6=_0x57255b[_0x3e36f2(0x1f0)]+_0x10e9f8*_0x515599,_0x43f39a=timeToPosition(_0x84a4f6,_0x57255b,_0x10f4d6),_0x3c8bd9=formatTimestamp(_0x84a4f6,_0x1d9b83);_0x1c632e['push']({'pos':_0x43f39a,'text':_0x3c8bd9});}const _0xea2678=new Array(_0x10f4d6)['fill']('\x20');let _0x1f6293=-0x1;for(const {pos:_0xe02155,text:_0x2b0e61}of _0x1c632e){let _0x39caa9=Math['max'](0x0,_0xe02155-Math[_0x3e36f2(0x1f6)](_0x2b0e61[_0x3e36f2(0x1b9)]/0x2));_0x39caa9<=_0x1f6293+TIMELINE_CONFIG[_0x3e36f2(0x12a)]&&(_0x39caa9=_0x1f6293+TIMELINE_CONFIG[_0x3e36f2(0x12a)]+0x1);_0x39caa9+_0x2b0e61[_0x3e36f2(0x1b9)]>_0x10f4d6&&(_0x39caa9=_0x10f4d6-_0x2b0e61[_0x3e36f2(0x1b9)]);if(_0x39caa9>=0x0&&_0x39caa9+_0x2b0e61[_0x3e36f2(0x1b9)]<=_0x10f4d6&&_0x39caa9>_0x1f6293){for(let _0x2051a8=0x0;_0x2051a8<_0x2b0e61[_0x3e36f2(0x1b9)];_0x2051a8++){_0xea2678[_0x39caa9+_0x2051a8]=_0x2b0e61[_0x2051a8];}_0x1f6293=_0x39caa9+_0x2b0e61['length']-0x1;}}return _0xea2678[_0x3e36f2(0x237)]('');}function renderTaskRow(_0x5e124a,_0x3cd9c5,_0x52e806,_0x16a6ce){const _0x37f157=a54_0xb99464,{level:_0x36c282,name:_0x3918da}=parseTaskName(_0x5e124a[_0x37f157(0x2ba)]),_0x13cfe7='\x20'[_0x37f157(0x155)](_0x36c282),_0x518414=_0x5e124a[_0x37f157(0x2c9)]?'('+formatElapsed(_0x5e124a[_0x37f157(0x2c9)][_0x37f157(0x20a)])+')':'',_0x172dfc=stringWidth(_0x518414),_0x27ef35=_0x36c282*0x1,_0x3a2354=_0x16a6ce-_0x27ef35-_0x172dfc-0x1,_0x92b16e=truncateTaskName(_0x3918da,_0x3a2354),_0x3fe184=_0x13cfe7+_0x92b16e,_0x706853=stringWidth(_0x3fe184),_0x2c0be1=_0x16a6ce-_0x706853-_0x172dfc,_0x228106=_0x3fe184+'\x20'[_0x37f157(0x155)](Math[_0x37f157(0x2b0)](0x1,_0x2c0be1))+a54_0x3265bd['dim'](_0x518414),_0x23aa06=getTaskStateIcon(_0x5e124a[_0x37f157(0x1d8)]),_0x5a9c7f=new Array(_0x52e806)['fill']('\x20');if(_0x5e124a['window']){const _0x1f78da=timeToPosition(_0x5e124a[_0x37f157(0x2c9)][_0x37f157(0x28c)],_0x3cd9c5,_0x52e806),_0x5eb11e=timeToPosition(_0x5e124a[_0x37f157(0x2c9)][_0x37f157(0x1ff)],_0x3cd9c5,_0x52e806),_0x35e475=getBarChar(_0x5e124a['state']),_0x1efb2d=Math['max'](_0x1f78da+0x1,_0x5eb11e);for(let _0x29f595=_0x1f78da;_0x29f595<Math['min'](_0x1efb2d,_0x52e806);_0x29f595++){_0x5a9c7f[_0x29f595]=_0x35e475;}}const _0x528a03=getBarColor(_0x5e124a[_0x37f157(0x1d8)]),_0x52edbf=_0x5a9c7f[_0x37f157(0x127)](_0x3d0caf=>_0x3d0caf==='\x20'?'\x20':_0x528a03(_0x3d0caf))[_0x37f157(0x237)]('');return _0x23aa06+'\x20'+_0x228106+'│'+_0x52edbf+'│';}function calculateStats(_0x55703f){const _0x4c2338=a54_0xb99464,_0x19f413={'total':_0x55703f[_0x4c2338(0x1b9)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x73ebf9 of _0x55703f){if(_0x73ebf9[_0x4c2338(0x1d8)]===_0x4c2338(0x252))_0x19f413[_0x4c2338(0x252)]++;else{if(_0x73ebf9[_0x4c2338(0x1d8)]===_0x4c2338(0x274)||_0x73ebf9[_0x4c2338(0x1d8)]==='group_error')_0x19f413[_0x4c2338(0x274)]++;else _0x73ebf9[_0x4c2338(0x1d8)]===_0x4c2338(0x148)?_0x19f413[_0x4c2338(0x148)]++:_0x19f413[_0x4c2338(0x1db)]++;}}return _0x19f413;}function formatStats(_0x4ee720){const _0xb51313=a54_0xb99464;return[_0xb51313(0x2b9)+_0x4ee720['total'],'✅\x20'+_0x4ee720[_0xb51313(0x252)],'❌\x20'+_0x4ee720[_0xb51313(0x274)],'🔄\x20'+_0x4ee720['running'],'⏳\x20'+_0x4ee720[_0xb51313(0x1db)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x143);['description']=a54_0xb99464(0x2a0);async[a54_0xb99464(0x1e1)](_0x41ccf6){const _0x323e0e=a54_0xb99464,{options:_0x717eee,args:_0x37b9eb,tdx:_0x57cfa3}=_0x41ccf6;let _0x13268a,_0xc4fb9c,_0x10aefb=![];if(_0x37b9eb[0x0]){if(_0x37b9eb[0x0]['includes']('.')){const _0x5a5bd9=this[_0x323e0e(0x15b)](_0x37b9eb,_0x717eee);if(!_0x5a5bd9)return 0x1;_0x13268a=_0x5a5bd9[_0x323e0e(0x26c)],_0xc4fb9c=_0x5a5bd9['workflowName'];}else{_0xc4fb9c=_0x37b9eb[0x0],_0x13268a=_0x717eee[_0x323e0e(0x23a)];if(!_0x13268a)return console['error'](a54_0x3265bd[_0x323e0e(0x2aa)](_0x323e0e(0x1dc)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x10aefb=!![];}}else{const _0x392b66=this[_0x323e0e(0x15b)](_0x37b9eb,_0x717eee);if(!_0x392b66)return 0x1;_0x13268a=_0x392b66['projectName'],_0xc4fb9c=_0x392b66[_0x323e0e(0x17f)];}if(_0x717eee['verbose']){if(_0x13268a&&_0xc4fb9c)console['error'](_0x323e0e(0x180)+_0x13268a+'.'+_0xc4fb9c);else _0x13268a&&console['error'](_0x323e0e(0x262)+_0x13268a);}const _0x59c313=_0x717eee[_0x323e0e(0x216)],_0x3715c3=_0x717eee[_0x323e0e(0x1cd)];if(_0x59c313){_0x3715c3&&console[_0x323e0e(0x274)](a54_0x3265bd[_0x323e0e(0x267)](_0x323e0e(0x234)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0xd758fb=_0x717eee[_0x323e0e(0x249)];return _0xd758fb?await this[_0x323e0e(0x20f)](_0x41ccf6,_0x59c313):await this[_0x323e0e(0x224)](_0x41ccf6,_0x59c313,_0x717eee),0x0;}if(_0x3715c3){const _0x336d74=await withSpinner(_0x323e0e(0x211),()=>_0x57cfa3[_0x323e0e(0x229)][_0x323e0e(0x218)]({'projectName':_0x13268a,'workflowName':_0xc4fb9c,'limit':0x64}),{'verbose':_0x717eee[_0x323e0e(0x2a9)]}),_0x2f4e3a=_0x336d74['data'][_0x323e0e(0x2a2)](_0x5224b2=>_0x5224b2['id']===_0x3715c3);if(!_0x2f4e3a)return console['error'](a54_0x3265bd[_0x323e0e(0x2aa)](_0x323e0e(0x1dc)),_0x323e0e(0x166)+_0x3715c3),0x1;if(!_0x2f4e3a[_0x323e0e(0x206)]?.['id'])return console[_0x323e0e(0x274)](a54_0x3265bd[_0x323e0e(0x2aa)](_0x323e0e(0x1dc)),_0x323e0e(0x1bd)+_0x3715c3+_0x323e0e(0x287)),0x1;const _0x445270=_0x2f4e3a[_0x323e0e(0x206)]['id'];_0x717eee[_0x323e0e(0x2a9)]&&console[_0x323e0e(0x274)](_0x323e0e(0x263)+_0x445270+_0x323e0e(0x1c7)+_0x3715c3);const _0x243df1=_0x717eee['follow'];return _0x243df1?await this[_0x323e0e(0x20f)](_0x41ccf6,_0x445270):await this[_0x323e0e(0x224)](_0x41ccf6,_0x445270,_0x717eee),0x0;}const _0x26c459=await withSpinner('Loading\x20sessions...',()=>_0x57cfa3[_0x323e0e(0x229)]['sessions']({'projectName':_0x13268a,'workflowName':_0xc4fb9c,'limit':_0x717eee['limit']||0x32}),{'verbose':_0x717eee[_0x323e0e(0x2a9)]}),_0x1223ed=_0x26c459[_0x323e0e(0x149)];if(_0x1223ed[_0x323e0e(0x1b9)]===0x0){if(_0x13268a&&_0xc4fb9c)console['error']('No\x20sessions\x20found\x20for:\x20'+_0x13268a+'.'+_0xc4fb9c);else _0x13268a?console[_0x323e0e(0x274)](_0x323e0e(0x16f)+_0x13268a):(console[_0x323e0e(0x274)](_0x323e0e(0x1a2)),console[_0x323e0e(0x274)](a54_0x3265bd[_0x323e0e(0x1a1)](_0x323e0e(0x156))));return 0x0;}_0x1223ed[_0x323e0e(0x1bc)]((_0x411d8d,_0x28122c)=>{const _0x4473a4=_0x323e0e,_0x127355=_0x411d8d[_0x4473a4(0x2c5)]||'',_0x561c98=_0x28122c[_0x4473a4(0x2c5)]||'';return _0x561c98[_0x4473a4(0x1d2)](_0x127355);});if(_0x717eee[_0x323e0e(0x279)]||_0x717eee['jsonl'])return await handleSDKOutput(_0x1223ed,_0x717eee),0x0;let _0x421d49;if(_0x10aefb){const _0x1e6d37=_0x1223ed[0x0];if(!_0x1e6d37[_0x323e0e(0x206)]?.['id'])return console[_0x323e0e(0x274)](_0x323e0e(0x115)),0x0;_0x421d49=_0x1e6d37['lastAttempt']['id'],_0x717eee[_0x323e0e(0x2a9)]&&console[_0x323e0e(0x274)]('Auto-selected\x20latest\x20session:\x20'+_0x1e6d37['sessionTime']);}else{const _0x3817e5=_0x1223ed['map'](_0x3dd9bb=>{const _0x160293=_0x323e0e,_0xbb1046=getAttemptStatusDisplay(_0x3dd9bb['lastAttempt']);return{'title':_0x3dd9bb[_0x160293(0x23d)]?.[_0x160293(0x2ba)]+'.'+_0x3dd9bb[_0x160293(0x229)]?.[_0x160293(0x2ba)]+_0x160293(0x189)+_0x3dd9bb[_0x160293(0x2c5)]+'\x20'+_0xbb1046[_0x160293(0x293)],'value':_0x3dd9bb[_0x160293(0x206)]?.['id']||'','description':_0xbb1046[_0x160293(0x152)]};}),_0xc554ef=await a54_0x24334b({'type':_0x323e0e(0x173),'name':'attemptId','message':_0x323e0e(0x1b1),'choices':_0x3817e5[_0x323e0e(0x13f)](_0x2f5137=>_0x2f5137[_0x323e0e(0x25c)]!=='')});if(!_0xc554ef[_0x323e0e(0x216)])return 0x0;_0x421d49=_0xc554ef[_0x323e0e(0x216)];}const _0x26cbfd=_0x717eee[_0x323e0e(0x249)];return _0x26cbfd?await this[_0x323e0e(0x20f)](_0x41ccf6,_0x421d49):await this[_0x323e0e(0x224)](_0x41ccf6,_0x421d49,_0x717eee),0x0;}async[a54_0xb99464(0x224)](_0x10d123,_0x27c1c6,_0x4c6534){const _0x181452=a54_0xb99464,{tdx:_0x2533eb}=_0x10d123;let _0x5b0b4c,_0x1f646e;try{[_0x5b0b4c,_0x1f646e]=await Promise[_0x181452(0x20d)]([_0x2533eb[_0x181452(0x229)][_0x181452(0x1ca)](_0x27c1c6),_0x2533eb[_0x181452(0x229)]['tasks'](_0x27c1c6,![])]);}catch(_0x5677e0){console[_0x181452(0x274)](a54_0x3265bd[_0x181452(0x2aa)](_0x181452(0x23b)));_0x4c6534[_0x181452(0x2a9)]&&console[_0x181452(0x274)](_0x5677e0);throw _0x5677e0;}if(_0x4c6534['json']||_0x4c6534[_0x181452(0x197)]){const _0x4aec8=this['buildTimelineData'](_0x5b0b4c,_0x1f646e);await handleSDKOutput([_0x4aec8],_0x4c6534);return;}const _0x535ce5=_0x2533eb['context'][_0x181452(0x1fa)],_0x6d20cf=this['renderTimeline'](_0x5b0b4c,_0x1f646e,_0x535ce5);console[_0x181452(0x25a)](_0x6d20cf);}async[a54_0xb99464(0x20f)](_0x5e3d03,_0x218a6f){const _0x53fc96=a54_0xb99464,{tdx:_0x2fb7c1}=_0x5e3d03,_0x465d91=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x1cdd1d=TIMELINE_CONFIG[_0x53fc96(0x19b)];let _0x31f375=0x0;while(_0x31f375<_0x1cdd1d){process[_0x53fc96(0x194)][_0x53fc96(0x145)]&&process['stdout'][_0x53fc96(0x283)]('\x1bc');let _0x17047c,_0x5bc8fd;try{[_0x17047c,_0x5bc8fd]=await Promise['all']([_0x2fb7c1['workflow'][_0x53fc96(0x1ca)](_0x218a6f),_0x2fb7c1['workflow'][_0x53fc96(0x21f)](_0x218a6f,![])]);}catch(_0x215bc7){console[_0x53fc96(0x274)](a54_0x3265bd[_0x53fc96(0x2aa)]('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x31f375>0x0&&console[_0x53fc96(0x274)](a54_0x3265bd[_0x53fc96(0x1a1)](_0x53fc96(0x2ac)+_0x31f375));throw _0x215bc7;}const _0x3dc588=_0x2fb7c1[_0x53fc96(0x2cd)][_0x53fc96(0x1fa)],_0x1418dd=this['renderTimeline'](_0x17047c,_0x5bc8fd,_0x3dc588);console[_0x53fc96(0x25a)](_0x1418dd);const _0xbbcb93=_0x17047c[_0x53fc96(0x1c6)]&&_0x5bc8fd[_0x53fc96(0x12b)](_0x393781=>_0x393781[_0x53fc96(0x1d8)]!==_0x53fc96(0x148)&&_0x393781[_0x53fc96(0x1d8)]!=='planned');if(_0xbbcb93){console[_0x53fc96(0x274)](a54_0x3265bd[_0x53fc96(0x119)](_0x53fc96(0x277)));break;}console[_0x53fc96(0x274)](a54_0x3265bd[_0x53fc96(0x1a1)]('\x0aPolling...\x20('+_0x31f375*0x2+_0x53fc96(0x2c7))),await new Promise(_0x1b2d98=>setTimeout(_0x1b2d98,_0x465d91)),_0x31f375++;}_0x31f375>=_0x1cdd1d&&console['error'](a54_0x3265bd[_0x53fc96(0x267)](_0x53fc96(0x2be)));}['renderTimeline'](_0xe0f52a,_0x200fd7,_0x5826f9){const _0x1ad1cd=a54_0xb99464,_0x37a903=[],_0x26cef7=TIMELINE_CONFIG[_0x1ad1cd(0x19a)],_0x470080=0x5,_0x2a734b=process[_0x1ad1cd(0x194)][_0x1ad1cd(0x15f)]||0x78,_0x18685f=_0x2a734b-_0x26cef7-_0x470080,_0x10da8f=Math[_0x1ad1cd(0x2b0)](TIMELINE_CONFIG[_0x1ad1cd(0x116)],Math[_0x1ad1cd(0x2c4)](_0x18685f,TIMELINE_CONFIG[_0x1ad1cd(0x136)])),_0x310537=new Date(_0xe0f52a[_0x1ad1cd(0x168)])[_0x1ad1cd(0x21b)](),_0x47de92=_0xe0f52a[_0x1ad1cd(0x1e6)]?new Date(_0xe0f52a[_0x1ad1cd(0x1e6)])[_0x1ad1cd(0x21b)]():Date['now'](),_0x27a7b1={'start':_0x310537,'end':_0x47de92,'duration':_0x47de92-_0x310537},_0x23a67d=new Map(),_0xfcf30c=[];for(const _0x378455 of _0x200fd7){if(_0x378455[_0x1ad1cd(0x1c4)]){const _0x2da3a0=new Date(_0x378455[_0x1ad1cd(0x1c4)])[_0x1ad1cd(0x21b)](),_0x3165eb=_0x378455['updatedAt']?new Date(_0x378455['updatedAt'])[_0x1ad1cd(0x21b)]():Date['now'](),_0x240595={'start':_0x2da3a0,'end':_0x3165eb,'duration':_0x3165eb-_0x2da3a0};_0x23a67d['set'](_0x378455['id'],_0x240595),_0xfcf30c[_0x1ad1cd(0x2c3)]({'name':_0x378455['fullName'],'state':_0x378455[_0x1ad1cd(0x1d8)]||_0x1ad1cd(0x265),'window':_0x240595});}else _0xfcf30c['push']({'name':_0x378455[_0x1ad1cd(0x275)],'state':_0x378455[_0x1ad1cd(0x1d8)]||_0x1ad1cd(0x203),'window':undefined});}_0xfcf30c[_0x1ad1cd(0x1bc)]((_0x55cbf2,_0x1b7559)=>{const _0x36664b=_0x1ad1cd;if(!_0x55cbf2['window'])return 0x1;if(!_0x1b7559[_0x36664b(0x2c9)])return-0x1;return _0x55cbf2['window'][_0x36664b(0x28c)]-_0x1b7559['window'][_0x36664b(0x28c)];});const _0x3a994d=_0xfcf30c[_0x1ad1cd(0x1b9)],_0x4a75f8=_0x3a994d>TIMELINE_CONFIG[_0x1ad1cd(0x291)];_0x4a75f8&&_0xfcf30c[_0x1ad1cd(0x14c)](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x1a4258=calculateTimeScale(_0x27a7b1,_0x10da8f),_0x315ced=_0xe0f52a[_0x1ad1cd(0x1c6)]?_0xe0f52a['success']?a54_0x3265bd[_0x1ad1cd(0x119)](_0x1ad1cd(0x252)):a54_0x3265bd[_0x1ad1cd(0x2aa)](_0x1ad1cd(0x274)):a54_0x3265bd['blue'](_0x1ad1cd(0x148)),_0x29fc15=_0xe0f52a[_0x1ad1cd(0x23d)]?.['id'],_0x5bef46=_0xe0f52a['sessionId'];let _0x484e45;if(_0x29fc15&&_0x5bef46){const _0x29c9c2=getWorkflowAttemptUrl(_0x5826f9,_0x29fc15,_0x5bef46,_0xe0f52a['id']);_0x484e45=hyperlink(a54_0x3265bd[_0x1ad1cd(0x1a1)](_0xe0f52a['id']),_0x29c9c2);}else _0x484e45=a54_0x3265bd['dim'](_0xe0f52a['id']);_0x37a903[_0x1ad1cd(0x2c3)](_0x1ad1cd(0x29e)+_0x484e45+_0x1ad1cd(0x189)+_0x315ced+_0x1ad1cd(0x189)+formatElapsed(_0x27a7b1[_0x1ad1cd(0x20a)]));if(_0xfcf30c[_0x1ad1cd(0x1b9)]>0x0){const _0x23531e=renderTimeAxis(_0x1a4258,_0x10da8f),_0x3a54c9=new Date(_0x27a7b1[_0x1ad1cd(0x28c)]),_0x46ac84=formatDate(_0x3a54c9),_0x3cfa42=TIMELINE_CONFIG[_0x1ad1cd(0x24e)]+TIMELINE_CONFIG[_0x1ad1cd(0x285)]+_0x26cef7,_0x3c8310=_0x46ac84[_0x1ad1cd(0x12c)](_0x3cfa42),_0xd38f25=a54_0x3265bd[_0x1ad1cd(0x1a1)](_0x3c8310);_0x37a903['push'](_0xd38f25+'\x20'+_0x23531e);for(const _0x363215 of _0xfcf30c){_0x37a903['push'](renderTaskRow(_0x363215,_0x1a4258,_0x10da8f,_0x26cef7));}const _0x22cbe5=calculateStats(_0xfcf30c);_0x37a903[_0x1ad1cd(0x2c3)](formatStats(_0x22cbe5)),_0x4a75f8&&_0x37a903[_0x1ad1cd(0x2c3)](a54_0x3265bd[_0x1ad1cd(0x267)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x1ad1cd(0x1ee)+_0x3a994d+_0x1ad1cd(0x2a1))),_0x37a903[_0x1ad1cd(0x2c3)](''),_0x37a903[_0x1ad1cd(0x2c3)](a54_0x3265bd['dim'](_0x1ad1cd(0x17b))+(_0x1ad1cd(0x195)+_0xe0f52a['id']+_0x1ad1cd(0x16e))+a54_0x3265bd[_0x1ad1cd(0x1a1)](_0x1ad1cd(0x15e)));}else _0x37a903[_0x1ad1cd(0x2c3)](_0x1ad1cd(0x2bb));return _0x37a903['join']('\x0a');}[a54_0xb99464(0x123)](_0x46937d,_0xea610b){const _0x31a076=a54_0xb99464,_0x3fda57=new Date(_0x46937d['createdAt'])[_0x31a076(0x21b)](),_0x423fa8=_0x46937d[_0x31a076(0x1e6)]?new Date(_0x46937d[_0x31a076(0x1e6)])[_0x31a076(0x21b)]():Date[_0x31a076(0x186)](),_0x543d4c=_0x423fa8-_0x3fda57,_0xc42ea4=[];for(const _0x588c13 of _0xea610b){if(_0x588c13[_0x31a076(0x1c4)]){const _0x18f144=new Date(_0x588c13[_0x31a076(0x1c4)])[_0x31a076(0x21b)](),_0x28096f=_0x588c13[_0x31a076(0x27e)]?new Date(_0x588c13[_0x31a076(0x27e)])['getTime']():Date['now']();_0xc42ea4[_0x31a076(0x2c3)]({'name':_0x588c13[_0x31a076(0x275)],'state':_0x588c13[_0x31a076(0x1d8)]||'unknown','window':{'start':_0x18f144,'end':_0x28096f,'duration':_0x28096f-_0x18f144}});}else _0xc42ea4[_0x31a076(0x2c3)]({'name':_0x588c13['fullName'],'state':_0x588c13[_0x31a076(0x1d8)]||_0x31a076(0x203),'window':undefined});}const _0x1ff226=calculateStats(_0xc42ea4);return{'attempt':{'id':_0x46937d['id'],'status':_0x46937d[_0x31a076(0x1c6)]?_0x46937d['success']?_0x31a076(0x252):_0x31a076(0x274):'running','createdAt':_0x46937d[_0x31a076(0x168)],'finishedAt':_0x46937d[_0x31a076(0x1e6)],'duration_ms':_0x543d4c},'tasks':_0xc42ea4[_0x31a076(0x127)](_0x4d44e9=>({'name':_0x4d44e9['name'],'state':_0x4d44e9[_0x31a076(0x1d8)],'startedAt':_0x4d44e9['window']?new Date(_0x4d44e9[_0x31a076(0x2c9)][_0x31a076(0x28c)])[_0x31a076(0x29d)]():null,'updatedAt':_0x4d44e9[_0x31a076(0x2c9)]?new Date(_0x4d44e9['window'][_0x31a076(0x1ff)])[_0x31a076(0x29d)]():null,'duration_ms':_0x4d44e9[_0x31a076(0x2c9)]?.['duration']||null})),'stats':_0x1ff226};}}export class WorkflowSchedulesCommand extends BaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x26a);['description']='List\x20workflow\x20schedules';async[a54_0xb99464(0x1e1)](_0x4f5bc4){const _0x188afd=a54_0xb99464,{options:_0x3df03a,tdx:_0x284f50}=_0x4f5bc4,_0x4048f8=await withSpinner(_0x188afd(0x244),()=>_0x284f50['workflow']['listSchedules'](),{'verbose':_0x3df03a[_0x188afd(0x2a9)]}),_0x5f01ec=_0x4048f8[_0x188afd(0x149)];console['error'](_0x188afd(0x28e)+_0x5f01ec[_0x188afd(0x1b9)]+_0x188afd(0x225)+(_0x5f01ec[_0x188afd(0x1b9)]!==0x1?'s':''));if(isStructuredFormat(_0x3df03a))await handleSDKOutput(_0x5f01ec,_0x3df03a);else{if(_0x5f01ec[_0x188afd(0x1b9)]===0x0)console[_0x188afd(0x25a)](_0x188afd(0x22a));else for(const _0x350e81 of _0x5f01ec){const _0x5e728a=_0x350e81[_0x188afd(0x270)]?a54_0x3265bd['yellow'](_0x188afd(0x1bb)):'',_0xfe2fdc=_0x350e81[_0x188afd(0x23d)]?.[_0x188afd(0x2ba)]?a54_0x3265bd[_0x188afd(0x1a1)]('\x20['+_0x350e81[_0x188afd(0x23d)][_0x188afd(0x2ba)]+']'):'',_0x5d72ef=_0x350e81[_0x188afd(0x137)]?a54_0x3265bd[_0x188afd(0x1a1)](_0x188afd(0x286)+new Date(_0x350e81[_0x188afd(0x137)])[_0x188afd(0x16b)]()):'';console['log'](_0x188afd(0x226)+_0x350e81['id']+'\x20'+(_0x350e81['workflow']?.[_0x188afd(0x2ba)]||_0x188afd(0x15a))+_0xfe2fdc+_0x5e728a+_0x5d72ef);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x125);['description']=a54_0xb99464(0x188);async[a54_0xb99464(0x1e1)](_0x1e9cc9){const _0x71d30d=a54_0xb99464,{options:_0x59b466,args:_0x56ab4e,tdx:_0x3fbf1e}=_0x1e9cc9,_0x5c2aaf=_0x56ab4e[0x0];if(!_0x5c2aaf)return console[_0x71d30d(0x274)](a54_0x3265bd[_0x71d30d(0x2aa)](_0x71d30d(0x1dc)),_0x71d30d(0x1bf)),console[_0x71d30d(0x274)](a54_0x3265bd[_0x71d30d(0x1a1)](_0x71d30d(0x124))),console['error'](a54_0x3265bd[_0x71d30d(0x1a1)](_0x71d30d(0x1c9))),0x1;const _0x1b4c9e=await withSpinner('Enabling\x20schedule\x20#'+_0x5c2aaf+_0x71d30d(0x257),()=>_0x3fbf1e[_0x71d30d(0x229)][_0x71d30d(0x1a4)](_0x5c2aaf),{'verbose':_0x59b466[_0x71d30d(0x2a9)]}),_0x24680c=_0x1b4c9e[_0x71d30d(0x149)];return isStructuredFormat(_0x59b466)?await handleSingleObjectOutput(_0x24680c,_0x59b466):(console[_0x71d30d(0x25a)](_0x71d30d(0x212)+_0x5c2aaf+_0x71d30d(0x17d)+(_0x24680c[_0x71d30d(0x229)]?.[_0x71d30d(0x2ba)]||_0x71d30d(0x265))+')'),_0x24680c[_0x71d30d(0x137)]&&console['log'](a54_0x3265bd[_0x71d30d(0x1a1)](_0x71d30d(0x1f4)+new Date(_0x24680c['nextRunTime'])[_0x71d30d(0x16b)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x204);[a54_0xb99464(0x13a)]='Disable\x20a\x20workflow\x20schedule';async[a54_0xb99464(0x1e1)](_0x2c5c5c){const _0x50c577=a54_0xb99464,{options:_0x482d95,args:_0x271959,tdx:_0x26f80f}=_0x2c5c5c,_0x1ea008=_0x271959[0x0];if(!_0x1ea008)return console[_0x50c577(0x274)](a54_0x3265bd['red']('Error:'),_0x50c577(0x1bf)),console[_0x50c577(0x274)](a54_0x3265bd[_0x50c577(0x1a1)](_0x50c577(0x1c3))),console['error'](a54_0x3265bd[_0x50c577(0x1a1)](_0x50c577(0x1c9))),0x1;const _0x29f4a7=await withSpinner(_0x50c577(0x14a)+_0x1ea008+'...',()=>_0x26f80f[_0x50c577(0x229)][_0x50c577(0x163)](_0x1ea008),{'verbose':_0x482d95[_0x50c577(0x2a9)]}),_0x4c8fa4=_0x29f4a7[_0x50c577(0x149)];return isStructuredFormat(_0x482d95)?await handleSingleObjectOutput(_0x4c8fa4,_0x482d95):console[_0x50c577(0x25a)]('✔\x20Schedule\x20#'+_0x1ea008+_0x50c577(0x27c)+(_0x4c8fa4['workflow']?.[_0x50c577(0x2ba)]||'unknown')+')'),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x484523,_0x7e44cf){const _0x1fba05=a55_0xe9e5,_0x1a1ec5=_0x484523();while(!![]){try{const _0x37b8ca=parseInt(_0x1fba05(0x1ce))/0x1+-parseInt(_0x1fba05(0x1dd))/0x2+parseInt(_0x1fba05(0x1db))/0x3+-parseInt(_0x1fba05(0x1cf))/0x4+-parseInt(_0x1fba05(0x1d6))/0x5+-parseInt(_0x1fba05(0x1d5))/0x6+parseInt(_0x1fba05(0x1da))/0x7;if(_0x37b8ca===_0x7e44cf)break;else _0x1a1ec5['push'](_0x1a1ec5['shift']());}catch(_0x4b676b){_0x1a1ec5['push'](_0x1a1ec5['shift']());}}}(a55_0x48be,0xe74cb));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a55_0xe9e5(_0x34024a,_0x2193c5){_0x34024a=_0x34024a-0x1ce;const _0x48be0b=a55_0x48be();let _0xe9e53c=_0x48be0b[_0x34024a];return _0xe9e53c;}export function getUserAgent(){const _0xdba427=a55_0xe9e5,_0x356330=getVersion(),_0x49e6cf=platform(),_0x285d42=process[_0xdba427(0x1d0)][_0xdba427(0x1d1)]('v','');return _0xdba427(0x1d4)+_0x356330+'\x20('+_0x49e6cf+_0xdba427(0x1de)+_0x285d42+')';}export function getAuthHeaders(_0x45ce03,_0xc30027,_0x6b63b9){const _0x214fae=a55_0xe9e5,_0x4e1586=getVersion(),_0x4603ac={'User-Agent':getUserAgent(),'X-TD-Client':_0x214fae(0x1d3),'X-TD-Client-Version':_0x4e1586};if(_0x6b63b9)_0x4603ac[_0x214fae(0x1d9)]=_0x214fae(0x1d7)+_0x6b63b9;else _0xc30027&&(_0x4603ac[_0x214fae(0x1d9)]='TD1\x20'+_0xc30027);return _0x4603ac;}export function toHeaderRecord(_0x1e45e5){const _0x34480c=a55_0xe9e5,_0x1635a8={};for(const [_0x3a2f1a,_0x76e91c]of Object[_0x34480c(0x1d2)](_0x1e45e5)){_0x76e91c!==undefined&&(_0x1635a8[_0x3a2f1a]=_0x76e91c);}return _0x1635a8;}function a55_0x48be(){const _0x5a26ad=['1324306eNuZRe',';\x20node/','928922XRCuAW','1875196bGQOjE','version','replace','entries','tdx','tdx/','2227860yIdqug','7319615iQxcGN','Bearer\x20','X-Trino-User','Authorization','15986488DDOfAz','2102646hWRFeE','length'];a55_0x48be=function(){return _0x5a26ad;};return a55_0x48be();}export function getTrinoHeaders(_0x15088a,_0x27d4c4,_0x5be0ce){const _0x35488a=a55_0xe9e5,_0x39e7b9=getAuthHeaders(_0x15088a),_0x243438=toHeaderRecord(_0x39e7b9);if(_0x5be0ce)_0x243438[_0x35488a(0x1d9)]='Bearer\x20'+_0x5be0ce;else _0x27d4c4&&(_0x243438[_0x35488a(0x1d8)]=_0x27d4c4);return _0x243438;}export function hasAPIKey(_0x287e87){const _0x15d7cd=a55_0xe9e5,_0x123d1d=getAPIKey();return _0x123d1d!==undefined&&_0x123d1d[_0x15d7cd(0x1dc)]>0x0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x110cb0,_0x37e211){const _0x3335b0=a56_0x2f8d,_0x3c0a07=_0x110cb0();while(!![]){try{const _0x507b1f=-parseInt(_0x3335b0(0xbc))/0x1*(parseInt(_0x3335b0(0xa5))/0x2)+-parseInt(_0x3335b0(0xda))/0x3+-parseInt(_0x3335b0(0xe3))/0x4+parseInt(_0x3335b0(0xb3))/0x5*(-parseInt(_0x3335b0(0xce))/0x6)+-parseInt(_0x3335b0(0xc5))/0x7*(parseInt(_0x3335b0(0xa8))/0x8)+parseInt(_0x3335b0(0xa1))/0x9+parseInt(_0x3335b0(0xa4))/0xa;if(_0x507b1f===_0x37e211)break;else _0x3c0a07['push'](_0x3c0a07['shift']());}catch(_0x18c01d){_0x3c0a07['push'](_0x3c0a07['shift']());}}}(a56_0x8b25,0xdfd42));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';function a56_0x8b25(){const _0x1c7804=['53492020KMhvor','2849662aXtcrD','format','noColor','8EFoUTC','[Object]','FINISHED','tsv','inherit','varchar','limit','repeat','bold','table','padEnd','235jgaozb','less','output','number','entries','blue','data','debug','[logs]','1lsyEpu','[params]','limitStructuredFormats','spawn','[error]','-FXRSn','push','map','color','7246729AgCMfs','keys','cmdout','stringify','error','─┴─','max','boolean','list','174978sYsymE','[query]','jsonl','log','query','pipe','stderr','trim','slice','json','write','end','3106743IZRqaz','forEach','stdin','bigint','rule','─┬─','close','magenta','No\x20data','2594620MVkXVx','isFinite','object','split','length','Results\x20saved\x20to\x20','9743175NFuGis','join','red'];a56_0x8b25=function(){return _0x1c7804;};return a56_0x8b25();}import a56_0x442bf0 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x10415c){const _0x2e1d95=a56_0x2f8d;return _0x10415c['format']===_0x2e1d95(0xd7)||_0x10415c[_0x2e1d95(0xa6)]===_0x2e1d95(0xd0)||_0x10415c[_0x2e1d95(0xa6)]===_0x2e1d95(0xab)||_0x10415c[_0x2e1d95(0xa6)]==='table'||_0x10415c[_0x2e1d95(0xd7)]===!![]||_0x10415c[_0x2e1d95(0xd0)]===!![]||_0x10415c['tsv']===!![]||_0x10415c[_0x2e1d95(0xb1)]===!![];}export function parseOutputOptions(_0x229eb2){const _0x1433b5=a56_0x2f8d;return{'format':_0x229eb2['format']||_0x1433b5(0xb1),'output':_0x229eb2[_0x1433b5(0xb5)]||'','limit':_0x229eb2[_0x1433b5(0xae)],'limitStructuredFormats':_0x229eb2[_0x1433b5(0xbe)],'color':_0x229eb2['color'],'noColor':_0x229eb2[_0x1433b5(0xa7)]};}function convertSDKResultToQueryResult(_0x5dacc4){const _0xf51600=a56_0x2f8d,_0x2f040c=[];if(_0x5dacc4[_0xf51600(0x9f)]>0x0){const _0x2969b3=_0x5dacc4[0x0];for(const [_0x5320de,_0x432d3f]of Object[_0xf51600(0xb7)](_0x2969b3)){let _0x588de7=_0xf51600(0xad);if(typeof _0x432d3f===_0xf51600(0xb6))_0x588de7=Number['isInteger'](_0x432d3f)?_0xf51600(0xdd):'double';else{if(typeof _0x432d3f===_0xf51600(0xcc))_0x588de7=_0xf51600(0xcc);else _0x432d3f===null&&(_0x588de7='varchar');}_0x2f040c[_0xf51600(0xc2)]({'name':_0x5320de,'type':_0x588de7});}}return{'queryId':'sdk-result','columns':_0x2f040c,'data':_0x5dacc4,'stats':{'state':_0xf51600(0xaa),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x5dacc4[_0xf51600(0x9f)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x42728f,_0x10a058){const _0x126acb=convertSDKResultToQueryResult(_0x42728f);return formatQueryOutput(_0x126acb,_0x10a058);}export async function formatQueryOutput(_0x543a40,_0x577505){const _0x81cdab=a56_0x2f8d,{format:_0x2f6ab7,limit:_0x5064a5,output:_0x51299c,color:_0x29628c,noColor:_0x5402c1,limitStructuredFormats:_0x13af2f}=_0x577505,_0xb1c8ce=Boolean(_0x51299c)&&!_0x29628c,_0x366579={'color':_0x29628c,'noColor':_0x5402c1||_0xb1c8ce};if(_0x2f6ab7===_0x81cdab(0xb1)){const _0x10411a=shouldUseLess(_0x2f6ab7,_0x51299c);return formatAsTable(_0x543a40,_0x5064a5,_0x10411a,_0x366579);}const _0xef7536=_0x13af2f&&Number[_0x81cdab(0xe4)](_0x5064a5)&&_0x543a40[_0x81cdab(0xb9)][_0x81cdab(0x9f)]>_0x5064a5?{..._0x543a40,'data':_0x543a40['data'][_0x81cdab(0xd6)](0x0,_0x5064a5)}:_0x543a40;if(_0x2f6ab7===_0x81cdab(0xd7))return formatAsJSON(_0xef7536,_0x366579);else return _0x2f6ab7===_0x81cdab(0xd0)?formatAsJSONL(_0xef7536,_0x366579):formatQueryResult(_0xef7536,_0x2f6ab7);}function shouldUseLess(_0x10251a,_0x5b4033){const _0x3e7066=a56_0x2f8d;return(_0x10251a===_0x3e7066(0xb1)||_0x10251a===_0x3e7066(0xcd))&&process['stdout']['isTTY']&&!_0x5b4033;}export function resolveOutputOptions(_0x3f08aa){const _0x32901e=a56_0x2f8d,_0xa5c7fe=_0x3f08aa['output']||'',_0x4cccf5=resolveOutputFormat(_0x3f08aa[_0x32901e(0xa6)],_0xa5c7fe,_0x32901e(0xb1));let _0x51336a=typeof _0x3f08aa['limit']===_0x32901e(0xb6)?_0x3f08aa[_0x32901e(0xae)]:parseInt(_0x3f08aa[_0x32901e(0xae)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x3f08aa[_0x32901e(0xae)]===undefined&&shouldUseLess(_0x4cccf5,_0xa5c7fe)&&(_0x51336a=Infinity),{'format':_0x4cccf5,'output':_0xa5c7fe,'limit':_0x51336a,'limitStructuredFormats':_0x3f08aa[_0x32901e(0xbe)],'color':_0x3f08aa[_0x32901e(0xc4)],'noColor':_0x3f08aa['noColor']};}export function writeOutput(_0x3418ab,_0x20a231,_0x3ad4a8){const _0x9c3ff7=a56_0x2f8d;return _0x20a231?(writeFileSync(_0x20a231,_0x3418ab),console[_0x9c3ff7(0xc9)](_0x9c3ff7(0xa0)+_0x20a231),Promise['resolve']()):shouldUseLess(_0x3ad4a8||'','')?new Promise(_0x5894e3=>{const _0x450640=_0x9c3ff7,_0x20bba9=spawn(_0x450640(0xb4),[_0x450640(0xc1)],{'stdio':[_0x450640(0xd3),_0x450640(0xac),_0x450640(0xac)]});let _0x213e43=![];_0x20bba9['on']('error',()=>{const _0x116075=_0x450640;!_0x213e43&&(_0x213e43=!![],console[_0x116075(0xd1)](_0x3418ab),_0x5894e3());}),_0x20bba9['on'](_0x450640(0xe0),()=>{!_0x213e43&&(_0x213e43=!![],_0x5894e3());}),_0x20bba9['on'](_0x450640(0xbf),()=>{const _0xf28024=_0x450640;!_0x213e43&&_0x20bba9['stdin']&&(_0x20bba9[_0xf28024(0xdc)]['on'](_0xf28024(0xc9),()=>{}),_0x20bba9['stdin'][_0xf28024(0xd8)](_0x3418ab),_0x20bba9[_0xf28024(0xdc)][_0xf28024(0xd9)]());}),!_0x20bba9[_0x450640(0xdc)]&&(!_0x213e43&&(_0x213e43=!![],console['log'](_0x3418ab),_0x5894e3()));}):(console[_0x9c3ff7(0xd1)](_0x3418ab),Promise['resolve']());}function a56_0x2f8d(_0x2f4324,_0x4a3f22){_0x2f4324=_0x2f4324-0x9e;const _0x8b25b5=a56_0x8b25();let _0x2f8ddf=_0x8b25b5[_0x2f4324];return _0x2f8ddf;}export async function handleSDKOutput(_0x49ebeb,_0x5b397b){const _0x39d395=a56_0x2f8d,_0x35ea71=resolveOutputOptions(_0x5b397b),_0x2cd952=await formatSDKOutput(_0x49ebeb,_0x35ea71);await writeOutput(_0x2cd952,_0x35ea71[_0x39d395(0xb5)]||undefined,_0x35ea71[_0x39d395(0xa6)]);}export async function handleQueryOutput(_0x320ec8,_0x19948f){const _0x5787c5=a56_0x2f8d,_0x119952=resolveOutputOptions(_0x19948f),_0x2f0cbc=await formatQueryOutput(_0x320ec8,_0x119952);await writeOutput(_0x2f0cbc,_0x119952[_0x5787c5(0xb5)]||undefined,_0x119952[_0x5787c5(0xa6)]);}async function formatSingleObject(_0x589bb4,_0x693548){const _0x14647b=a56_0x2f8d,{format:_0x411409,color:_0x41825f,noColor:_0xb117fe}=_0x693548,_0x203612={'color':_0x41825f,'noColor':_0xb117fe};if(_0x411409===_0x14647b(0xd7)){if(shouldUseColor(_0x203612))return colorizeJSON(_0x589bb4,_0x203612);return JSON[_0x14647b(0xc8)](_0x589bb4,null,0x2);}else{if(_0x411409==='jsonl'){if(shouldUseColor(_0x203612))return colorizeJSONCompact(_0x589bb4,_0x203612);return JSON[_0x14647b(0xc8)](_0x589bb4);}else{if(_0x411409==='tsv')return Object[_0x14647b(0xb7)](_0x589bb4)['map'](([_0x5e6291,_0x90e0e])=>_0x5e6291+'\x09'+_0x90e0e)['join']('\x0a');else{const _0x56b92e=Object[_0x14647b(0xb7)](_0x589bb4);if(_0x56b92e[_0x14647b(0x9f)]===0x0)return _0x14647b(0xe2);const _0x4054ca=_0x589bb4['debug'],_0x291e9a=_0x589bb4[_0x14647b(0xd2)],_0x14ba75=_0x589bb4['params'],_0x328424=_0x589bb4[_0x14647b(0xde)],_0x56703c=_0x291e9a?typeof _0x291e9a==='string'?_0x291e9a:JSON['stringify'](_0x291e9a,null,0x2):undefined,_0x48add1=_0x14ba75&&Object['keys'](_0x14ba75)[_0x14647b(0x9f)]>0x0?JSON[_0x14647b(0xc8)](_0x14ba75,null,0x2):undefined,_0x239d14=_0x328424&&Object[_0x14647b(0xc6)](_0x328424)[_0x14647b(0x9f)]>0x0?JSON['stringify'](_0x328424,null,0x2):undefined,_0x104e0a=_0x56b92e['filter'](([_0x2bbc50])=>_0x2bbc50!==_0x14647b(0xba)&&_0x2bbc50!==_0x14647b(0xd2)&&_0x2bbc50!=='params'&&_0x2bbc50!==_0x14647b(0xde)),_0x5c1c06=Math[_0x14647b(0xcb)](..._0x104e0a[_0x14647b(0xc3)](([_0x2f9f0e])=>_0x2f9f0e[_0x14647b(0x9f)])),_0x5ad614=Math[_0x14647b(0xcb)](..._0x104e0a[_0x14647b(0xc3)](([,_0x293978])=>{const _0x5ba714=_0x14647b;try{const _0x1c0ee1=_0x293978===null||_0x293978===undefined?'':typeof _0x293978===_0x5ba714(0xe5)?JSON[_0x5ba714(0xc8)](_0x293978):String(_0x293978),_0x272b4c=_0x1c0ee1[_0x5ba714(0x9e)]('\x0a');return Math['max'](..._0x272b4c[_0x5ba714(0xc3)](_0x8ffc3a=>_0x8ffc3a[_0x5ba714(0x9f)]),0x0);}catch{return 0x0;}}),0x14),_0x4dcc23=[];_0x4dcc23[_0x14647b(0xc2)](colorBorder('┌─'+'─'[_0x14647b(0xaf)](_0x5c1c06)+_0x14647b(0xdf)+'─'[_0x14647b(0xaf)](_0x5ad614)+'─┐',_0x203612)),_0x104e0a[_0x14647b(0xdb)](([_0x2cf5b0,_0x27a6d3])=>{const _0x125d56=_0x14647b;let _0x1c99f8;try{_0x1c99f8=_0x27a6d3===null||_0x27a6d3===undefined?'':typeof _0x27a6d3===_0x125d56(0xe5)?JSON[_0x125d56(0xc8)](_0x27a6d3):String(_0x27a6d3);}catch{_0x1c99f8=_0x125d56(0xa9);}const _0x19c1b6=_0x2cf5b0[_0x125d56(0xb2)](_0x5c1c06),_0x31b092=_0x1c99f8[_0x125d56(0x9e)]('\x0a');_0x31b092[_0x125d56(0xdb)]((_0x59adb7,_0x4629e1)=>{const _0x2b2a22=_0x125d56,_0x2b6f74=colorBorder('│',_0x203612);_0x4629e1===0x0?_0x4dcc23['push'](_0x2b6f74+'\x20'+_0x19c1b6+'\x20'+_0x2b6f74+'\x20'+_0x59adb7[_0x2b2a22(0xb2)](_0x5ad614)+'\x20'+_0x2b6f74):_0x4dcc23[_0x2b2a22(0xc2)](_0x2b6f74+'\x20'+'\x20'[_0x2b2a22(0xaf)](_0x5c1c06)+'\x20'+_0x2b6f74+'\x20'+_0x59adb7[_0x2b2a22(0xb2)](_0x5ad614)+'\x20'+_0x2b6f74);});}),_0x4dcc23[_0x14647b(0xc2)](colorBorder('└─'+'─'[_0x14647b(0xaf)](_0x5c1c06)+_0x14647b(0xca)+'─'[_0x14647b(0xaf)](_0x5ad614)+'─┘',_0x203612));_0x56703c&&(_0x4dcc23[_0x14647b(0xc2)](''),_0x4dcc23['push'](String(a56_0x442bf0['yellow'][_0x14647b(0xb0)](_0x14647b(0xcf)))),_0x4dcc23[_0x14647b(0xc2)](_0x56703c));_0x48add1&&(_0x4dcc23[_0x14647b(0xc2)](''),_0x4dcc23['push'](String(a56_0x442bf0[_0x14647b(0xb8)][_0x14647b(0xb0)](_0x14647b(0xbd)))),_0x4dcc23[_0x14647b(0xc2)](_0x48add1));_0x239d14&&(_0x4dcc23[_0x14647b(0xc2)](''),_0x4dcc23[_0x14647b(0xc2)](String(a56_0x442bf0[_0x14647b(0xe1)]['bold']('[rule]'))),_0x4dcc23[_0x14647b(0xc2)](_0x239d14));if(_0x4054ca){if(_0x4054ca[_0x14647b(0xd4)]){_0x4dcc23[_0x14647b(0xc2)](''),_0x4dcc23['push'](String(a56_0x442bf0[_0x14647b(0xa3)][_0x14647b(0xb0)](_0x14647b(0xc0))));const _0x4d84d0=_0x4054ca[_0x14647b(0xd4)][_0x14647b(0x9e)]('\x0a');_0x4d84d0[_0x14647b(0xdb)](_0x570bc=>{const _0x50b1fe=_0x14647b;_0x570bc[_0x50b1fe(0xd5)]()&&_0x4dcc23[_0x50b1fe(0xc2)](_0x570bc);});}if(_0x4054ca[_0x14647b(0xc7)]){_0x4dcc23['push'](''),_0x4dcc23[_0x14647b(0xc2)](String(a56_0x442bf0['cyan']['bold'](_0x14647b(0xbb))));const _0x151ced=_0x4054ca[_0x14647b(0xc7)][_0x14647b(0x9e)]('\x0a');_0x151ced[_0x14647b(0xdb)](_0xda7552=>{const _0x13004c=_0x14647b;_0xda7552[_0x13004c(0xd5)]()&&_0x4dcc23[_0x13004c(0xc2)](_0xda7552);});}}return _0x4dcc23[_0x14647b(0xa2)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x2bbbc2,_0x315d2b){const _0x142fe2=a56_0x2f8d;if(_0x315d2b[_0x142fe2(0xa6)]===_0x142fe2(0xb1)){await handleSDKOutput([_0x2bbbc2],_0x315d2b);return;}const _0x3f22c9=resolveOutputOptions(_0x315d2b),_0xaa0bf6=await formatSingleObject(_0x2bbbc2,_0x3f22c9);await writeOutput(_0xaa0bf6,_0x3f22c9[_0x142fe2(0xb5)]||undefined,_0x3f22c9[_0x142fe2(0xa6)]);}
|
|
1
|
+
(function(_0x5e41ab,_0x46117f){const _0x1a8e79=a56_0x582d,_0x2c9335=_0x5e41ab();while(!![]){try{const _0xca8c17=parseInt(_0x1a8e79(0x1f9))/0x1+parseInt(_0x1a8e79(0x1e4))/0x2*(-parseInt(_0x1a8e79(0x1ec))/0x3)+-parseInt(_0x1a8e79(0x1cd))/0x4+parseInt(_0x1a8e79(0x1e1))/0x5*(parseInt(_0x1a8e79(0x1cc))/0x6)+parseInt(_0x1a8e79(0x1c9))/0x7+parseInt(_0x1a8e79(0x1f3))/0x8+-parseInt(_0x1a8e79(0x1f2))/0x9;if(_0xca8c17===_0x46117f)break;else _0x2c9335['push'](_0x2c9335['shift']());}catch(_0x985eb5){_0x2c9335['push'](_0x2c9335['shift']());}}}(a56_0xb90e,0xb34fa));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 a56_0x1434dd from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';function a56_0xb90e(){const _0x5b86c4=['[query]','json','─┴─','format','─┬─','forEach','varchar','stringify','object','push','bigint','slice','bold','params','trim','pipe','split','stdout','[rule]','spawn','1022518MvYzsH','entries','cmdout','888318hZxLcM','2081972zDDbKb','padEnd','map','boolean','resolve','stdin','less','repeat','number','filter','jsonl','FINISHED','limit','list','limitStructuredFormats','double','debug','table','length','isTTY','5djaLAp','end','color','2mxzvjQ','keys','error','sdk-result','max','data','stderr','log','1940997ShKpPr','red','tsv','inherit','[logs]','join','2565072thulLl','7504256qZAzrm','[Object]','output','cyan','rule','query','954799KrbqfG','[error]','magenta','-FXRSn','[params]','noColor','Results\x20saved\x20to\x20'];a56_0xb90e=function(){return _0x5b86c4;};return a56_0xb90e();}import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x1d703d){const _0x183ae5=a56_0x582d;return _0x1d703d['format']==='json'||_0x1d703d[_0x183ae5(0x203)]==='jsonl'||_0x1d703d[_0x183ae5(0x203)]===_0x183ae5(0x1ee)||_0x1d703d[_0x183ae5(0x203)]==='table'||_0x1d703d['json']===!![]||_0x1d703d['jsonl']===!![]||_0x1d703d[_0x183ae5(0x1ee)]===!![]||_0x1d703d[_0x183ae5(0x1de)]===!![];}export function parseOutputOptions(_0x59e186){const _0x47efb9=a56_0x582d;return{'format':_0x59e186[_0x47efb9(0x203)]||'table','output':_0x59e186[_0x47efb9(0x1f5)]||'','limit':_0x59e186[_0x47efb9(0x1d9)],'limitStructuredFormats':_0x59e186[_0x47efb9(0x1db)],'color':_0x59e186[_0x47efb9(0x1e3)],'noColor':_0x59e186[_0x47efb9(0x1fe)]};}function convertSDKResultToQueryResult(_0x4b5ab9){const _0xdecf69=a56_0x582d,_0x306d1f=[];if(_0x4b5ab9[_0xdecf69(0x1df)]>0x0){const _0x1c861f=_0x4b5ab9[0x0];for(const [_0x41c7b6,_0x49cdb8]of Object[_0xdecf69(0x1ca)](_0x1c861f)){let _0x1a3a9f='varchar';if(typeof _0x49cdb8===_0xdecf69(0x1d5))_0x1a3a9f=Number['isInteger'](_0x49cdb8)?_0xdecf69(0x1bf):_0xdecf69(0x1dc);else{if(typeof _0x49cdb8===_0xdecf69(0x1d0))_0x1a3a9f=_0xdecf69(0x1d0);else _0x49cdb8===null&&(_0x1a3a9f=_0xdecf69(0x1bb));}_0x306d1f[_0xdecf69(0x1be)]({'name':_0x41c7b6,'type':_0x1a3a9f});}}return{'queryId':_0xdecf69(0x1e7),'columns':_0x306d1f,'data':_0x4b5ab9,'stats':{'state':_0xdecf69(0x1d8),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x4b5ab9[_0xdecf69(0x1df)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x50a3b0,_0x4f0171){const _0x3ecf9b=convertSDKResultToQueryResult(_0x50a3b0);return formatQueryOutput(_0x3ecf9b,_0x4f0171);}export async function formatQueryOutput(_0x408d10,_0x87e693){const _0x4e3d36=a56_0x582d,{format:_0x427430,limit:_0x10e013,output:_0x3eaf58,color:_0x121ec9,noColor:_0x3bf4f7,limitStructuredFormats:_0x31034b}=_0x87e693,_0x5247a0=Boolean(_0x3eaf58)&&!_0x121ec9,_0xfc8a98={'color':_0x121ec9,'noColor':_0x3bf4f7||_0x5247a0};if(_0x427430===_0x4e3d36(0x1de)){const _0x399a11=shouldUseLess(_0x427430,_0x3eaf58);return formatAsTable(_0x408d10,_0x10e013,_0x399a11,_0xfc8a98);}const _0x1a31b5=_0x31034b&&Number['isFinite'](_0x10e013)&&_0x408d10[_0x4e3d36(0x1e9)][_0x4e3d36(0x1df)]>_0x10e013?{..._0x408d10,'data':_0x408d10[_0x4e3d36(0x1e9)][_0x4e3d36(0x1c0)](0x0,_0x10e013)}:_0x408d10;if(_0x427430===_0x4e3d36(0x201))return formatAsJSON(_0x1a31b5,_0xfc8a98);else return _0x427430===_0x4e3d36(0x1d7)?formatAsJSONL(_0x1a31b5,_0xfc8a98):formatQueryResult(_0x1a31b5,_0x427430);}function shouldUseLess(_0x228a21,_0x54ac5d){const _0x229075=a56_0x582d;return(_0x228a21==='table'||_0x228a21===_0x229075(0x1da))&&process[_0x229075(0x1c6)][_0x229075(0x1e0)]&&!_0x54ac5d;}export function resolveOutputOptions(_0x1fda88){const _0x121bed=a56_0x582d,_0x50abba=_0x1fda88[_0x121bed(0x1f5)]||'',_0x4e9e31=resolveOutputFormat(_0x1fda88[_0x121bed(0x203)],_0x50abba,_0x121bed(0x1de));let _0x3b2fd1=typeof _0x1fda88[_0x121bed(0x1d9)]==='number'?_0x1fda88[_0x121bed(0x1d9)]:parseInt(_0x1fda88['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x1fda88['limit']===undefined&&shouldUseLess(_0x4e9e31,_0x50abba)&&(_0x3b2fd1=Infinity),{'format':_0x4e9e31,'output':_0x50abba,'limit':_0x3b2fd1,'limitStructuredFormats':_0x1fda88['limitStructuredFormats'],'color':_0x1fda88['color'],'noColor':_0x1fda88['noColor']};}function a56_0x582d(_0x5e591f,_0x12c6b2){_0x5e591f=_0x5e591f-0x1b9;const _0xb90e2d=a56_0xb90e();let _0x582d2e=_0xb90e2d[_0x5e591f];return _0x582d2e;}export function writeOutput(_0x4ce5af,_0x56fd10,_0xcae416){const _0x399c13=a56_0x582d;return _0x56fd10?(writeFileSync(_0x56fd10,_0x4ce5af),console['error'](_0x399c13(0x1ff)+_0x56fd10),Promise[_0x399c13(0x1d1)]()):shouldUseLess(_0xcae416||'','')?new Promise(_0xbddbea=>{const _0x29a730=_0x399c13,_0x4065ea=spawn(_0x29a730(0x1d3),[_0x29a730(0x1fc)],{'stdio':[_0x29a730(0x1c4),'inherit',_0x29a730(0x1ef)]});let _0x3b586d=![];_0x4065ea['on']('error',()=>{const _0x559fb1=_0x29a730;!_0x3b586d&&(_0x3b586d=!![],console[_0x559fb1(0x1eb)](_0x4ce5af),_0xbddbea());}),_0x4065ea['on']('close',()=>{!_0x3b586d&&(_0x3b586d=!![],_0xbddbea());}),_0x4065ea['on'](_0x29a730(0x1c8),()=>{const _0x3358d9=_0x29a730;!_0x3b586d&&_0x4065ea[_0x3358d9(0x1d2)]&&(_0x4065ea[_0x3358d9(0x1d2)]['on'](_0x3358d9(0x1e6),()=>{}),_0x4065ea[_0x3358d9(0x1d2)]['write'](_0x4ce5af),_0x4065ea[_0x3358d9(0x1d2)][_0x3358d9(0x1e2)]());}),!_0x4065ea[_0x29a730(0x1d2)]&&(!_0x3b586d&&(_0x3b586d=!![],console[_0x29a730(0x1eb)](_0x4ce5af),_0xbddbea()));}):(console[_0x399c13(0x1eb)](_0x4ce5af),Promise[_0x399c13(0x1d1)]());}export async function handleSDKOutput(_0x20917f,_0x53157b){const _0x18929a=a56_0x582d,_0x3973c5=resolveOutputOptions(_0x53157b),_0x211b6f=await formatSDKOutput(_0x20917f,_0x3973c5);await writeOutput(_0x211b6f,_0x3973c5[_0x18929a(0x1f5)]||undefined,_0x3973c5['format']);}export async function handleQueryOutput(_0x7c11d5,_0x102f9d){const _0x360391=a56_0x582d,_0x47baef=resolveOutputOptions(_0x102f9d),_0x56138a=await formatQueryOutput(_0x7c11d5,_0x47baef);await writeOutput(_0x56138a,_0x47baef[_0x360391(0x1f5)]||undefined,_0x47baef['format']);}async function formatSingleObject(_0xcef170,_0x2cc748){const _0x519622=a56_0x582d,{format:_0x5527cd,color:_0x1d3cd8,noColor:_0x38c347}=_0x2cc748,_0x388c9d={'color':_0x1d3cd8,'noColor':_0x38c347};if(_0x5527cd===_0x519622(0x201)){if(shouldUseColor(_0x388c9d))return colorizeJSON(_0xcef170,_0x388c9d);return JSON[_0x519622(0x1bc)](_0xcef170,null,0x2);}else{if(_0x5527cd===_0x519622(0x1d7)){if(shouldUseColor(_0x388c9d))return colorizeJSONCompact(_0xcef170,_0x388c9d);return JSON['stringify'](_0xcef170);}else{if(_0x5527cd===_0x519622(0x1ee))return Object[_0x519622(0x1ca)](_0xcef170)[_0x519622(0x1cf)](([_0x46c50f,_0x4f3553])=>_0x46c50f+'\x09'+_0x4f3553)[_0x519622(0x1f1)]('\x0a');else{const _0x28559e=Object[_0x519622(0x1ca)](_0xcef170);if(_0x28559e[_0x519622(0x1df)]===0x0)return'No\x20data';const _0x495736=_0xcef170[_0x519622(0x1dd)],_0x39eff3=_0xcef170[_0x519622(0x1f8)],_0x16ac6b=_0xcef170[_0x519622(0x1c2)],_0x4cccda=_0xcef170[_0x519622(0x1f7)],_0x23d6c9=_0x39eff3?typeof _0x39eff3==='string'?_0x39eff3:JSON[_0x519622(0x1bc)](_0x39eff3,null,0x2):undefined,_0xbff1fd=_0x16ac6b&&Object[_0x519622(0x1e5)](_0x16ac6b)[_0x519622(0x1df)]>0x0?JSON[_0x519622(0x1bc)](_0x16ac6b,null,0x2):undefined,_0x509a43=_0x4cccda&&Object[_0x519622(0x1e5)](_0x4cccda)[_0x519622(0x1df)]>0x0?JSON[_0x519622(0x1bc)](_0x4cccda,null,0x2):undefined,_0x4e4ed2=_0x28559e[_0x519622(0x1d6)](([_0x23730b])=>_0x23730b!==_0x519622(0x1dd)&&_0x23730b!==_0x519622(0x1f8)&&_0x23730b!==_0x519622(0x1c2)&&_0x23730b!==_0x519622(0x1f7)),_0x37751a=Math[_0x519622(0x1e8)](..._0x4e4ed2['map'](([_0x4a5474])=>_0x4a5474[_0x519622(0x1df)])),_0x563e0a=Math[_0x519622(0x1e8)](..._0x4e4ed2[_0x519622(0x1cf)](([,_0x479e2b])=>{const _0xe62e82=_0x519622;try{const _0x532698=_0x479e2b===null||_0x479e2b===undefined?'':typeof _0x479e2b===_0xe62e82(0x1bd)?JSON['stringify'](_0x479e2b):String(_0x479e2b),_0x3e372a=_0x532698[_0xe62e82(0x1c5)]('\x0a');return Math[_0xe62e82(0x1e8)](..._0x3e372a[_0xe62e82(0x1cf)](_0x3514a6=>_0x3514a6[_0xe62e82(0x1df)]),0x0);}catch{return 0x0;}}),0x14),_0x1ed58b=[];_0x1ed58b[_0x519622(0x1be)](colorBorder('┌─'+'─'[_0x519622(0x1d4)](_0x37751a)+_0x519622(0x1b9)+'─'[_0x519622(0x1d4)](_0x563e0a)+'─┐',_0x388c9d)),_0x4e4ed2['forEach'](([_0x12cbf3,_0x3f8f98])=>{const _0x4c1dff=_0x519622;let _0x99ea8;try{_0x99ea8=_0x3f8f98===null||_0x3f8f98===undefined?'':typeof _0x3f8f98===_0x4c1dff(0x1bd)?JSON['stringify'](_0x3f8f98):String(_0x3f8f98);}catch{_0x99ea8=_0x4c1dff(0x1f4);}const _0x529f39=_0x12cbf3['padEnd'](_0x37751a),_0x536aa6=_0x99ea8[_0x4c1dff(0x1c5)]('\x0a');_0x536aa6[_0x4c1dff(0x1ba)]((_0x4b7a48,_0x507494)=>{const _0x4e746c=_0x4c1dff,_0x1e2200=colorBorder('│',_0x388c9d);_0x507494===0x0?_0x1ed58b[_0x4e746c(0x1be)](_0x1e2200+'\x20'+_0x529f39+'\x20'+_0x1e2200+'\x20'+_0x4b7a48[_0x4e746c(0x1ce)](_0x563e0a)+'\x20'+_0x1e2200):_0x1ed58b[_0x4e746c(0x1be)](_0x1e2200+'\x20'+'\x20'['repeat'](_0x37751a)+'\x20'+_0x1e2200+'\x20'+_0x4b7a48[_0x4e746c(0x1ce)](_0x563e0a)+'\x20'+_0x1e2200);});}),_0x1ed58b[_0x519622(0x1be)](colorBorder('└─'+'─'['repeat'](_0x37751a)+_0x519622(0x202)+'─'[_0x519622(0x1d4)](_0x563e0a)+'─┘',_0x388c9d));_0x23d6c9&&(_0x1ed58b['push'](''),_0x1ed58b[_0x519622(0x1be)](String(a56_0x1434dd['yellow']['bold'](_0x519622(0x200)))),_0x1ed58b[_0x519622(0x1be)](_0x23d6c9));_0xbff1fd&&(_0x1ed58b[_0x519622(0x1be)](''),_0x1ed58b[_0x519622(0x1be)](String(a56_0x1434dd['blue']['bold'](_0x519622(0x1fd)))),_0x1ed58b[_0x519622(0x1be)](_0xbff1fd));_0x509a43&&(_0x1ed58b[_0x519622(0x1be)](''),_0x1ed58b[_0x519622(0x1be)](String(a56_0x1434dd[_0x519622(0x1fb)][_0x519622(0x1c1)](_0x519622(0x1c7)))),_0x1ed58b[_0x519622(0x1be)](_0x509a43));if(_0x495736){if(_0x495736['stderr']){_0x1ed58b[_0x519622(0x1be)](''),_0x1ed58b[_0x519622(0x1be)](String(a56_0x1434dd[_0x519622(0x1ed)]['bold'](_0x519622(0x1fa))));const _0x440641=_0x495736[_0x519622(0x1ea)][_0x519622(0x1c5)]('\x0a');_0x440641[_0x519622(0x1ba)](_0xb95e7f=>{const _0x32e0f9=_0x519622;_0xb95e7f[_0x32e0f9(0x1c3)]()&&_0x1ed58b[_0x32e0f9(0x1be)](_0xb95e7f);});}if(_0x495736[_0x519622(0x1cb)]){_0x1ed58b[_0x519622(0x1be)](''),_0x1ed58b[_0x519622(0x1be)](String(a56_0x1434dd[_0x519622(0x1f6)][_0x519622(0x1c1)](_0x519622(0x1f0))));const _0x396858=_0x495736[_0x519622(0x1cb)][_0x519622(0x1c5)]('\x0a');_0x396858[_0x519622(0x1ba)](_0x464cc4=>{const _0x547599=_0x519622;_0x464cc4[_0x547599(0x1c3)]()&&_0x1ed58b[_0x547599(0x1be)](_0x464cc4);});}}return _0x1ed58b[_0x519622(0x1f1)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x7bf098,_0x14c670){const _0x5b30b5=a56_0x582d;if(_0x14c670[_0x5b30b5(0x203)]==='table'){await handleSDKOutput([_0x7bf098],_0x14c670);return;}const _0x55ca26=resolveOutputOptions(_0x14c670),_0x3a7a24=await formatSingleObject(_0x7bf098,_0x55ca26);await writeOutput(_0x3a7a24,_0x55ca26[_0x5b30b5(0x1f5)]||undefined,_0x55ca26['format']);}
|