@treasuredata/tdx 2026.3.29 → 2026.3.30
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/auth-login-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/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/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/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/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/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.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a52_0x525f16=a52_0x2963;(function(_0x3816e9,_0x22db26){const _0x441664=a52_0x2963,_0xcca20a=_0x3816e9();while(!![]){try{const _0x12cb74=parseInt(_0x441664(0x161))/0x1*(-parseInt(_0x441664(0x17c))/0x2)+-parseInt(_0x441664(0x185))/0x3*(parseInt(_0x441664(0x1ec))/0x4)+-parseInt(_0x441664(0x1f2))/0x5*(parseInt(_0x441664(0x168))/0x6)+-parseInt(_0x441664(0x21e))/0x7+parseInt(_0x441664(0x121))/0x8*(-parseInt(_0x441664(0x2b7))/0x9)+parseInt(_0x441664(0x211))/0xa+-parseInt(_0x441664(0x1bd))/0xb*(-parseInt(_0x441664(0x154))/0xc);if(_0x12cb74===_0x22db26)break;else _0xcca20a['push'](_0xcca20a['shift']());}catch(_0x3b1165){_0xcca20a['push'](_0xcca20a['shift']());}}}(a52_0x1eb1,0xd096b));import a52_0x5c395f from'chalk';function a52_0x1eb1(){const _0x46af4d=['values','✔\x20Pull\x20complete','jsonl','Workflow:\x20','No\x20sessions\x20found\x20in\x20project:\x20','getMinutes','metadata','⚠\x20Showing\x20first\x20','\x0aClone\x20\x22','workflowProject','No\x20sessions\x20found\x20for:\x20','attempt','workflow','state','\x20secret','Attempt\x20ID:\x20','Usage:\x20tdx\x20wf\x20use\x20<project>','Listing\x20workflows...','Listing\x20workflow\x20sessions...','dim','Error:\x20Project\x20name\x20is\x20required','stdout','4208810RRzsjo','Retry\x20a\x20session\x20or\x20attempt','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','\x20\x20Session\x20context\x20set\x20to:\x20','💡\x20Tip:\x20Use\x20','ICON_WIDTH','✔\x20Clone\x20complete','No\x20attempts\x20found\x20for:\x20','✔\x20Secret\x20\x27','push','getMonth','Starting\x20workflow\x20run...','Retrying\x20session...','8681645EsTUvn','session','group_error','execute','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','param','workflow:timeline','Latest\x20session\x20has\x20no\x20attempt','workflowName','\x20(use\x20--limit\x20to\x20show\x20more)','\x22\x20to\x20new\x20project\x20\x22','MAX_POLL_ITERATIONS','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Project\x20filter:\x20','createdAt','Project\x20name:\x20','Getting\x20attempt\x20details...','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Key:\x20','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','\x20new','Show\x20specific\x20attempt\x20details','\x20\x20tdx\x20wf\x20use\x20<project>','Downloading\x20logs...','Error:\x20Attempt\x20ID\x20is\x20required','getHours','New\x20project\x20name:\x20','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','(use\x20--limit\x20to\x20see\x20more)','dryRun','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','-\x20no\x20files\x20written','newProjectName','No\x20workflow\x20sessions\x20found','session_id','Listing\x20workflow\x20projects...','executePushProject','cyan','\x20attempt','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Session\x20not\x20found:\x20','tdx.json','stringify','List\x20workflow\x20execution\x20sessions','canceling','slice','params','🔄\x20','indexOf','Warning:','json','sessionId','stat','✔\x20Workflow\x20project\x20context\x20cleared.','No\x20matching\x20sessions\x20found','Start\x20a\x20workflow\x20run','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','summary','resolveProjectDir','✔\x20Found\x20','Setting\x20secret...','match','keys','Analyzing\x20project...','Pushing\x20project...','resumeFrom','window','buildTimelineData','parseProjectWorkflowPattern','fullName','✔\x20Push\x20complete','targetExists','unknown','\x22?\x20This\x20cannot\x20be\x20undone.','GUTTER','Downloading\x20project\x20','list','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','workflow:upload','MAX_TASKS_DISPLAY','\x20deleted','deleteSecret','/attempt/','Kill\x20a\x20running\x20attempt','renderTimeline','No\x20sessions\x20found','No\x20log\x20files\x20found\x20for\x20this\x20attempt','POLL_INTERVAL_MS','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','\x0a⚠\x20Project\x20\x22','Dry\x20run:\x20yes','Output\x20directory:\x20','Source\x20project:\x20','TASK_NAME_WIDTH','icon','padStart','\x20\x20Source:\x20','select','✔\x20Pushed\x20','startsWith','workflows','Project\x20name\x20is\x20required','\x20\x20Location:\x20','workflow:delete','\x0a✔\x20Already\x20up\x20to\x20date','setSecrets','verbose','Include\x20retried:\x20yes','Reason:\x20','List\x20all\x20workflow\x20projects','getDate','skipValidation','Error:','\x20modified','preparePushProject','attempts','green','context','\x20is\x20not\x20a\x20directory','Updating\x20','Attempt:\x20','Pushing\x20workflow\x20project...','site','📋\x20','red','renderSessionsTimeline','MAX_LABEL_COUNT','name','\x1b[1A\x1b[2K','success','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','No\x20log\x20content\x20found','Show\x20logs\x20for\x20a\x20workflow\x20attempt','includes','\x0aFailed\x20to\x20fetch\x20attempt\x20data','✔\x20Retry\x20started','duration','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Fetching\x20log\x20files...','resolveProject','\x0aDry\x20run\x20-\x20nothing\x20pushed','...','tdx\x20wf\x20attempt\x20','Key\x20cannot\x20be\x20empty','attempt:','text','\x20\x20Target:\x20','filter','Loading\x20workflows...','No\x20attempts\x20found','Filter:\x20project=','startTime','3708FZzjTK','sys','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','project','No\x20workflow\x20projects\x20found','sort','Listing\x20workflow\x20attempts...','📁\x20','rows','projectId','Target:\x20','\x20tasks','workflow:kill','includeRetried','from','Task\x20name:\x20','Deleting\x20project\x20','LABEL_MIN_SPACING','\x27...','start','MIN_LABEL_COUNT','No\x20attempts\x20found\x20in\x20project:\x20','workflow:run','workflow:clone','reason','repeat','new','substring','fs/promises','16152XKQkba','Cancelled','retrySession','workflow:projects','\x20\x20Files\x20extracted:\x20','write','\x20\x20Changes:\x20','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','status','Force:\x20yes','description','parse','.\x20Expected\x20format:\x20KEY=VALUE','filesExtracted','List\x20workflow\x20attempts','message','→\x20New\x20project:\x20','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','format','workflow:secrets:list','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','localeCompare','Invalid\x20format:\x20','Show\x20tasks\x20for\x20an\x20attempt','sessionTime','yes','join','Expected\x20format:\x20--param\x20key=value','sessions','Parameters:\x20','tasks','projectName','min','every','→\x20Project:\x20','Cloning\x20to\x20','Getting\x20attempt\x20tasks...','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','size','diff','Listing\x20secrets...','taskName','follow','set','log','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','isTTY','requireProject','kill','running','targetDir','19737372BXVrVo','cancelRequested','/sessions/','renderSingleTimeline','error','columns','Resume\x20from:\x20','isDirectory','prepareCloneProject','floor','\x0a✔\x20Attempt\x20complete','toLowerCase',',\x20Workflow:\x20','1hgICGo','Error:\x20Invalid\x20JSON\x20in\x20--params','lastAttempt','\x20\x20Console:\x20','Status:\x20','Revision:\x20','logFiles','2109948VFHnrN','toISOString','getTime','attemptId','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','total','\x20secrets\x20set\x20for\x20project\x20\x27','revision','has','-\x20nothing\x20pushed','unchanged','updatedAt','map','pullProject','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Validation:\x20skipped','---\x20','Error:\x20','Total:\x20','yellow','2082608qBqxYo','Loading\x20sessions...','\x20\x20Attempt\x20ID:\x20','Params:\x20','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','\x20-\x20','workflow:secrets:set','\x20\x20Project\x20ID:\x20','round','60WuqNkv','\x0aUpdate\x20existing\x20project\x20\x22','key','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','\x20(system)','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Project:\x20','fileSize','workflow:workflows','Writing\x20files...','trimEnd','executeCloneProject','\x20of\x20','fromTask','basename','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Pull\x20workflow\x20project\x20to\x20local\x20folder','download','✔\x20Showing\x20','find','workflow:push','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','now','replace','limit','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','\x20\x20New\x20attempt\x20ID:\x20','\x20unchanged','\x20\x20Session\x20ID:\x20','resolveProjectId','max','showWorkflowConsoleUrl','✔\x20Project:\x20','task','No\x20sessions\x20with\x20timing\x20information','hasChanges','isArray','planned','durationMs','get','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','changes','Files\x20to\x20upload:\x20','table','\x20project','Killing\x20attempt...','\x20\x20Revision:\x20','ICON_SPACING','Setting\x20','Source\x20directory:\x20','\x20to\x20see\x20detailed\x20logs','\x20\x20Project:\x20','type','relative','pollTimeline','No\x20projects\x20match\x20pattern:\x20','33ixSiQa','\x20session','\x20logs','Failed\x20to\x20fetch\x20attempt\x20data','finishedAt','workflow:secrets:delete','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','sourceDir','path','navigateSessionsInteractive','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','modified','Deleting\x20secret...','sourceProjectName','\x0aError:','workflow:pull','Filter:\x20','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','length','done','fill','\x20sessions\x20','Auto-selected\x20latest\x20session:\x20','split','output','Session\x20time:\x20','\x0a✔\x20No\x20changes\x20to\x20push','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','some','workflow:use','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','startedAt','workflow:tasks','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','pending','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','getFullYear','Source\x20directory\x20is\x20required','cwd','generateSessionTimelineRows','newProjectId','retryAttemptName','/app/workflows/','data','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Using\x20attempt\x20','207164quxDHb','fileCount','blue','end','workflow:logs','resolve','5voriBx','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','index','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','value','all','workflow:retry','existingProjectId','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'];a52_0x1eb1=function(){return _0x46af4d;};return a52_0x1eb1();}import{existsSync}from'fs';import a52_0x2c88cd from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a52_0x5682a4 from'prompts';function getAttemptStatusDisplay(_0x47898b){const _0x9dc0da=a52_0x2963;if(!_0x47898b)return{'icon':'⏳','text':''};const {done:_0xf4770b,success:_0x3b23d7,cancelRequested:_0x477b4d}=_0x47898b;if(!_0xf4770b)return _0x477b4d?{'icon':'🛑','text':a52_0x5c395f[_0x9dc0da(0x17b)](_0x9dc0da(0x24b))}:{'icon':'🔄','text':a52_0x5c395f[_0x9dc0da(0x1ee)](_0x9dc0da(0x152))};if(_0x3b23d7)return{'icon':'✅','text':a52_0x5c395f[_0x9dc0da(0x293)]('success')};return{'icon':'❌','text':a52_0x5c395f['red'](_0x9dc0da(0x158))};}export class WorkflowBaseCommand extends BaseCommand{[a52_0x525f16(0x2aa)](_0x4f643f,_0x30df8d,_0xfd804=0x0){const _0x731a06=a52_0x525f16;return _0x4f643f[_0xfd804]||_0x30df8d[_0x731a06(0x204)];}[a52_0x525f16(0x150)](_0x2a80a8,_0x3dcaee,_0x5a9e95=0x0){const _0x3ddb62=a52_0x525f16,_0x18fc3f=this[_0x3ddb62(0x2aa)](_0x2a80a8,_0x3dcaee,_0x5a9e95);if(!_0x18fc3f)return console['error'](a52_0x5c395f['red'](_0x3ddb62(0x28f)),_0x3ddb62(0x284)),console[_0x3ddb62(0x158)](a52_0x5c395f[_0x3ddb62(0x20e)](_0x3ddb62(0x257))),null;return _0x18fc3f;}['parseProjectWorkflowPattern'](_0xf0efec,_0xcb3381){const _0x3984b7=a52_0x525f16;if(_0xf0efec[0x0]){const _0x408894=_0xf0efec[0x0][_0x3984b7(0x1d4)]('.');if(_0x408894[_0x3984b7(0x1cf)]===0x1)return{'projectName':_0x408894[0x0],'workflowName':undefined};else return _0x408894[_0x3984b7(0x1cf)]===0x2?{'projectName':_0x408894[0x0],'workflowName':_0x408894[0x1]}:(console[_0x3984b7(0x158)](a52_0x5c395f['red'](_0x3984b7(0x28f)),_0x3984b7(0x1ad)),null);}return{'projectName':_0xcb3381[_0x3984b7(0x204)],'workflowName':undefined};}[a52_0x525f16(0x259)](_0x4ce5ad,_0x3a3163,_0x31e6dc=0x0){const _0xf9c05f=a52_0x525f16;if(_0x4ce5ad[_0x31e6dc])return _0x4ce5ad[_0x31e6dc];if(_0x3a3163[_0xf9c05f(0x204)]){const _0x7a7a8e=a52_0x2c88cd[_0xf9c05f(0x13b)](process[_0xf9c05f(0x1e4)](),_0xf9c05f(0x283),_0x3a3163[_0xf9c05f(0x204)]);if(existsSync(a52_0x2c88cd['join'](_0x7a7a8e,_0xf9c05f(0x248))))return _0x7a7a8e;}return undefined;}async[a52_0x525f16(0x1a4)](_0x5383f6,_0x36d7b4,_0x155f35){const _0x1eed7b=a52_0x525f16;try{const _0x26ce41=await _0x5383f6[_0x1eed7b(0x207)]['workflows'](_0x36d7b4,{'limit':0x1});if(_0x26ce41[_0x1eed7b(0x1cf)]>0x0){const _0xb20764=_0x26ce41[0x0]['id'],_0x47ec49=getWorkflowUrl(_0x155f35,_0xb20764);console[_0x1eed7b(0x158)](_0x1eed7b(0x164)+a52_0x5c395f[_0x1eed7b(0x244)](_0x47ec49));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a52_0x525f16(0x29e)]=a52_0x525f16(0x1db);['description']=a52_0x525f16(0x239);async['execute'](_0xac9a4e){const _0x5c6c83=a52_0x525f16,{options:_0x1d4fea,args:_0x31825c,tdx:_0x558e8e}=_0xac9a4e,_0x16cc00=_0x31825c[0x0],_0x248b4a=_0x1d4fea['clear'];if(_0x248b4a)return saveSessionContext({'workflow_project':undefined},_0x1d4fea[_0x5c6c83(0x21f)]),console['log'](a52_0x5c395f[_0x5c6c83(0x293)](_0x5c6c83(0x254))),0x0;if(!_0x16cc00)return console[_0x5c6c83(0x158)](a52_0x5c395f[_0x5c6c83(0x29b)](_0x5c6c83(0x28f)),_0x5c6c83(0x284)),console['error'](a52_0x5c395f[_0x5c6c83(0x20e)](_0x5c6c83(0x20b))),console[_0x5c6c83(0x158)](a52_0x5c395f['dim'](_0x5c6c83(0x16c))),0x1;const _0x471e0c=await withSpinner('Resolving\x20project\x20\x27'+_0x16cc00+_0x5c6c83(0x2c9),()=>_0x558e8e[_0x5c6c83(0x207)][_0x5c6c83(0x1a2)](_0x16cc00),{'verbose':_0x1d4fea[_0x5c6c83(0x289)]}),{name:_0x9257ac}=_0x471e0c[_0x5c6c83(0x1e9)];return saveSessionContext({'workflow_project':_0x9257ac},_0x1d4fea[_0x5c6c83(0x21f)]),console[_0x5c6c83(0x14d)](a52_0x5c395f['green']('✔\x20Workflow\x20project\x20set\x20to:\x20'+a52_0x5c395f['cyan'](_0x9257ac))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a52_0x525f16(0x29e)]=a52_0x525f16(0x124);['description']=a52_0x525f16(0x28c);async[a52_0x525f16(0x221)](_0x39e430){const _0x48f397=a52_0x525f16,{options:_0x4bce35,args:_0x2937ee,tdx:_0x3969e7}=_0x39e430,_0x524360=_0x2937ee[0x0];_0x4bce35[_0x48f397(0x289)]&&_0x524360&&console[_0x48f397(0x158)]('Pattern:\x20'+_0x524360);const _0x1bc35c=await withSpinner(_0x48f397(0x242),()=>_0x3969e7[_0x48f397(0x207)]['projects'](_0x524360,{'limit':_0x4bce35[_0x48f397(0x19d)]}),{'verbose':_0x4bce35[_0x48f397(0x289)]});let _0xb68515=_0x1bc35c[_0x48f397(0x1e9)];_0xb68515[_0x48f397(0x2bc)]((_0x5f6e04,_0x2c81d7)=>_0x5f6e04[_0x48f397(0x29e)]['localeCompare'](_0x2c81d7['name']));const _0x22ff7a=_0x4bce35[_0x48f397(0x19d)]||0x64,_0x2a0347=_0xb68515['length']>=_0x22ff7a?a52_0x5c395f[_0x48f397(0x20e)](_0x48f397(0x227)):'';console[_0x48f397(0x158)]('✔\x20Found\x20'+_0xb68515[_0x48f397(0x1cf)]+_0x48f397(0x1b1)+(_0xb68515[_0x48f397(0x1cf)]!==0x1?'s':'')+_0x2a0347);if(_0x4bce35['format']===_0x48f397(0x251)||_0x4bce35[_0x48f397(0x133)]===_0x48f397(0x1fd)||_0x4bce35['format']==='table')await handleSDKOutput(_0xb68515,_0x4bce35);else{if(_0xb68515['length']===0x0)_0x524360?console[_0x48f397(0x14d)](_0x48f397(0x1bc)+_0x524360):console[_0x48f397(0x14d)](_0x48f397(0x2bb));else{const _0x16d60e=_0xb68515[_0x48f397(0x174)](_0xa49854=>{const _0x4476c5=_0x48f397,_0x935309=_0xa49854[_0x4476c5(0x201)]?.[_0x4476c5(0x1da)](_0x132fc2=>_0x132fc2[_0x4476c5(0x187)]===_0x4476c5(0x2b8)),_0x51eda9=_0x935309?a52_0x5c395f[_0x4476c5(0x20e)](_0x4476c5(0x189)):'';return _0x4476c5(0x2be)+_0xa49854['name']+_0x51eda9;});await writeOutput(_0x16d60e['join']('\x0a'),_0x4bce35['output'],_0x48f397(0x26b));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a52_0x525f16(0x18d);[a52_0x525f16(0x12b)]='List\x20workflows';async[a52_0x525f16(0x221)](_0x22a76a){const _0x59e5c2=a52_0x525f16,{options:_0x29f2e5,args:_0x483ff6,tdx:_0x2ebbf7}=_0x22a76a,_0x5cfcfc=this['resolveProject'](_0x483ff6,_0x29f2e5);_0x29f2e5[_0x59e5c2(0x289)]&&_0x5cfcfc&&console['error'](_0x59e5c2(0x22b)+_0x5cfcfc);const _0x44b427=await withSpinner(_0x59e5c2(0x20c),()=>_0x2ebbf7[_0x59e5c2(0x207)][_0x59e5c2(0x283)](_0x5cfcfc,{'limit':_0x29f2e5[_0x59e5c2(0x19d)]}),{'verbose':_0x29f2e5['verbose']});let _0x3e918a=_0x44b427[_0x59e5c2(0x1e9)];_0x3e918a[_0x59e5c2(0x2bc)]((_0x1cffbd,_0x402508)=>{const _0xb2c725=_0x59e5c2,_0x46d137=_0x1cffbd[_0xb2c725(0x29e)][_0xb2c725(0x136)](_0x402508['name']);if(_0x46d137!==0x0)return _0x46d137;return(_0x1cffbd[_0xb2c725(0x2ba)]?.[_0xb2c725(0x29e)]||'')[_0xb2c725(0x136)](_0x402508['project']?.[_0xb2c725(0x29e)]||'');});const _0x43e222=_0x29f2e5[_0x59e5c2(0x19d)]||0x64,_0x568b49=_0x3e918a['length']>=_0x43e222?a52_0x5c395f[_0x59e5c2(0x20e)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console['error'](_0x59e5c2(0x25a)+_0x3e918a['length']+'\x20workflow'+(_0x3e918a[_0x59e5c2(0x1cf)]!==0x1?'s':'')+_0x568b49);if(_0x29f2e5[_0x59e5c2(0x133)]===_0x59e5c2(0x251)||_0x29f2e5[_0x59e5c2(0x133)]==='jsonl'||_0x29f2e5[_0x59e5c2(0x133)]===_0x59e5c2(0x1b0))await handleSDKOutput(_0x3e918a,_0x29f2e5);else{if(_0x3e918a['length']===0x0)_0x5cfcfc?console['log']('No\x20workflows\x20found\x20in\x20project:\x20'+_0x5cfcfc):console['log']('No\x20workflows\x20found');else{const _0x282b0f=_0x29f2e5['site'],_0x336230=_0x3e918a['map'](_0x1a765f=>{const _0x51d7e5=_0x59e5c2,_0x35988e=a52_0x5c395f[_0x51d7e5(0x20e)]('#'+_0x1a765f['id']),_0x24c1b1=hyperlink(_0x35988e,getWorkflowUrl(_0x282b0f,_0x1a765f['id'])),_0x492a9e=_0x1a765f['project']?.[_0x51d7e5(0x29e)]?a52_0x5c395f['dim']('\x20('+_0x1a765f['project'][_0x51d7e5(0x29e)]+')'):'';return _0x51d7e5(0x29a)+_0x24c1b1+'\x20'+_0x1a765f['name']+_0x492a9e;});await writeOutput(_0x336230[_0x59e5c2(0x13b)]('\x0a'),_0x29f2e5[_0x59e5c2(0x1d5)],_0x59e5c2(0x26b));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a52_0x525f16(0x29e)]='workflow:sessions';[a52_0x525f16(0x12b)]=a52_0x525f16(0x24a);async[a52_0x525f16(0x221)](_0x45ec42){const _0x4a2b47=a52_0x525f16,{options:_0x398a34,args:_0x160e43,tdx:_0x584959}=_0x45ec42,_0x507764=this[_0x4a2b47(0x263)](_0x160e43,_0x398a34);if(!_0x507764)return 0x1;const {projectName:_0x245d25,workflowName:_0x52b7b9}=_0x507764;if(_0x398a34[_0x4a2b47(0x289)]){if(_0x245d25&&_0x52b7b9)console['error']('Filter:\x20'+_0x245d25+'.'+_0x52b7b9);else _0x245d25&&console[_0x4a2b47(0x158)](_0x4a2b47(0x2b5)+_0x245d25);const _0xfd52ad=_0x398a34[_0x4a2b47(0x129)];_0xfd52ad&&console[_0x4a2b47(0x158)](_0x4a2b47(0x165)+_0xfd52ad);}let _0x933e69=0x28;if(process['stdout'][_0x4a2b47(0x14f)]&&!_0x398a34['output']&&!_0x398a34['format']){const _0x1a5627=process[_0x4a2b47(0x210)][_0x4a2b47(0x2bf)]||0x28;_0x933e69=Math[_0x4a2b47(0x1a3)](0x14,Math[_0x4a2b47(0x15d)](_0x1a5627*0x2/0x3));}const _0x4e012a=_0x398a34[_0x4a2b47(0x19d)]||_0x933e69,_0x223415=await withSpinner(_0x4a2b47(0x20d),()=>_0x584959['workflow'][_0x4a2b47(0x13d)]({'projectName':_0x245d25,'workflowName':_0x52b7b9,'status':_0x398a34[_0x4a2b47(0x129)],'fromTime':_0x398a34[_0x4a2b47(0x2c5)],'toTime':_0x398a34['to'],'limit':_0x4e012a}),{'verbose':_0x398a34['verbose']}),_0x56d3a9=_0x223415[_0x4a2b47(0x1e9)];_0x56d3a9[_0x4a2b47(0x2bc)]((_0x1db6c7,_0xa66ac1)=>{const _0x1d9417=_0x4a2b47,_0x5b5aaa=_0x1db6c7[_0x1d9417(0x139)]||'',_0x1ff492=_0xa66ac1[_0x1d9417(0x139)]||'';return _0x1ff492[_0x1d9417(0x136)](_0x5b5aaa);});_0x56d3a9[_0x4a2b47(0x1cf)]>=_0x4e012a?console[_0x4a2b47(0x158)](_0x4a2b47(0x197)+_0x56d3a9[_0x4a2b47(0x1cf)]+_0x4a2b47(0x1d2)+a52_0x5c395f['dim'](_0x4a2b47(0x23a))):console[_0x4a2b47(0x158)]('✔\x20Found\x20'+_0x56d3a9[_0x4a2b47(0x1cf)]+_0x4a2b47(0x1be)+(_0x56d3a9['length']!==0x1?'s':''));if(_0x398a34[_0x4a2b47(0x133)]===_0x4a2b47(0x251)||_0x398a34['format']===_0x4a2b47(0x1fd)||_0x398a34['format']===_0x4a2b47(0x1b0))await handleSDKOutput(_0x56d3a9,_0x398a34);else{if(!process['stdout'][_0x4a2b47(0x14f)]||_0x398a34[_0x4a2b47(0x1d5)]){if(_0x56d3a9[_0x4a2b47(0x1cf)]===0x0){if(_0x245d25&&_0x52b7b9)console[_0x4a2b47(0x14d)]('No\x20sessions\x20found\x20for:\x20'+_0x245d25+'.'+_0x52b7b9);else _0x245d25?console['log']('No\x20sessions\x20found\x20in\x20project:\x20'+_0x245d25):console['log'](_0x4a2b47(0x274));}else{const _0x2721cc=_0x398a34[_0x4a2b47(0x299)],_0xdd7c67=this[_0x4a2b47(0x29c)](_0x56d3a9,_0x2721cc);_0x398a34[_0x4a2b47(0x1d5)]?await writeOutput(_0xdd7c67,_0x398a34[_0x4a2b47(0x1d5)],_0x4a2b47(0x26b)):console['log'](_0xdd7c67);}!_0x245d25&&(console['error'](''),console['error'](a52_0x5c395f[_0x4a2b47(0x20e)](_0x4a2b47(0x231))),console[_0x4a2b47(0x158)](a52_0x5c395f[_0x4a2b47(0x20e)](_0x4a2b47(0x22a))+'or'+a52_0x5c395f[_0x4a2b47(0x20e)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x56d3a9[_0x4a2b47(0x1cf)]===0x0){if(_0x245d25&&_0x52b7b9)console[_0x4a2b47(0x14d)](_0x4a2b47(0x205)+_0x245d25+'.'+_0x52b7b9);else _0x245d25?console[_0x4a2b47(0x14d)](_0x4a2b47(0x1ff)+_0x245d25):console[_0x4a2b47(0x14d)](_0x4a2b47(0x274));}else await this[_0x4a2b47(0x1c6)](_0x56d3a9,_0x45ec42,_0x245d25);}}return 0x0;}['renderSessionsTimeline'](_0x4f6f77,_0x6bfa0c){const _0x461115=a52_0x525f16,_0x1580d9=[],_0x27f468=new Map();let _0x362271=Infinity,_0x49ba47=-Infinity;for(const _0x3fdecf of _0x4f6f77){if(_0x3fdecf[_0x461115(0x163)]?.[_0x461115(0x22c)]){const _0xbeffbd=new Date(_0x3fdecf['lastAttempt'][_0x461115(0x22c)])[_0x461115(0x16a)](),_0x104dff=_0x3fdecf[_0x461115(0x163)][_0x461115(0x1c1)]?new Date(_0x3fdecf[_0x461115(0x163)][_0x461115(0x1c1)])[_0x461115(0x16a)]():Date['now'](),_0x1ee256=_0x3fdecf[_0x461115(0x2ba)]?.[_0x461115(0x29e)]||'(unknown)';!_0x27f468[_0x461115(0x170)](_0x1ee256)&&_0x27f468['set'](_0x1ee256,[]),_0x27f468['get'](_0x1ee256)[_0x461115(0x21a)]({'session':_0x3fdecf,'startTime':_0xbeffbd,'endTime':_0x104dff,'duration':_0x104dff-_0xbeffbd}),_0x362271=Math[_0x461115(0x141)](_0x362271,_0xbeffbd),_0x49ba47=Math['max'](_0x49ba47,_0x104dff);}}if(_0x27f468[_0x461115(0x147)]===0x0)return _0x461115(0x1a7);const _0x51200a=process['stdout'][_0x461115(0x159)]||0x78,_0x18992a=0x1e,_0x29568a=0x32,_0x1585b0=0x4,_0x40254f=Math[_0x461115(0x141)](_0x29568a,Math[_0x461115(0x1a3)](_0x18992a,Math['floor'](_0x51200a*0.3))),_0xcbc726=_0x51200a-_0x40254f-TIMELINE_CONFIG[_0x461115(0x269)]-0x3-_0x1585b0,_0x39d9c9=_0x49ba47-_0x362271,_0x1eb75d=_0x39d9c9/_0x40254f,_0x121397=renderTimeAxis({'startTime':_0x362271,'endTime':_0x49ba47,'durationMs':_0x39d9c9,'msPerChar':_0x1eb75d},_0x40254f),_0x4a5f1c=[];for(const _0x1f39ba of _0x27f468[_0x461115(0x1fb)]()){_0x4a5f1c['push'](..._0x1f39ba);}_0x4a5f1c[_0x461115(0x2bc)]((_0x41ac88,_0x3e8b5c)=>_0x3e8b5c[_0x461115(0x2b6)]-_0x41ac88['startTime']);const _0x1a84da=new Date(_0x362271),_0x40a4b7=formatDate(_0x1a84da),_0x3287f0=_0x1585b0+TIMELINE_CONFIG[_0x461115(0x216)]+TIMELINE_CONFIG[_0x461115(0x1b4)]+_0xcbc726,_0x2c1672='\x20'[_0x461115(0x11d)](_0x3287f0-_0x40a4b7['length']),_0xc0cb9a=_0x2c1672+a52_0x5c395f[_0x461115(0x20e)](_0x40a4b7)+'\x20'+_0x121397;_0x1580d9[_0x461115(0x21a)](_0xc0cb9a);const _0x40f9d8=0x16;let _0x38b48f=0x0;for(const _0x5b46db of _0x4a5f1c){const _0x39ea62=_0x5b46db[_0x461115(0x21f)][_0x461115(0x2ba)]?.['name']||'?',_0x5b68b0=Math[_0x461115(0x141)](stringWidth(_0x39ea62),_0x40f9d8);_0x38b48f=Math['max'](_0x38b48f,_0x5b68b0);}for(const _0xc46601 of _0x4a5f1c){const {session:_0x1cd69d,startTime:_0x33adec,endTime:_0x3a05c2,duration:_0x184a49}=_0xc46601,_0x28b303=_0x1cd69d[_0x461115(0x2ba)]?.['id'],_0x325aef=_0x1cd69d['id'],_0x1de738=_0x1cd69d[_0x461115(0x2ba)]?.[_0x461115(0x29e)]||'?',_0x30c421=_0x1cd69d[_0x461115(0x207)]?.['name']||'?';let _0x21d2f4,_0x45994e;if(_0x1cd69d['lastAttempt']){const _0x28445f=_0x1cd69d['lastAttempt'];!_0x28445f[_0x461115(0x1d0)]?(_0x21d2f4=_0x28445f[_0x461115(0x155)]?'🛑':'🔄',_0x45994e=_0x28445f['cancelRequested']?a52_0x5c395f['yellow']:a52_0x5c395f[_0x461115(0x1ee)]):(_0x21d2f4=_0x28445f[_0x461115(0x2a0)]?'✅':'❌',_0x45994e=_0x28445f[_0x461115(0x2a0)]?a52_0x5c395f[_0x461115(0x293)]:a52_0x5c395f['red']);}else _0x21d2f4='⏳',_0x45994e=a52_0x5c395f[_0x461115(0x20e)];const _0x3d3244='#'+_0x325aef,_0x30bd48=_0x28b303?hyperlink(_0x3d3244,getWorkflowSessionUrl(_0x6bfa0c,_0x28b303,_0x325aef)):_0x3d3244;let _0x13b2f4=_0x1de738;stringWidth(_0x1de738)>_0x40f9d8&&(_0x13b2f4=_0x1de738[_0x461115(0x24c)](0x0,_0x40f9d8-0x1)+'…');const _0x18a7e2=a52_0x5c395f[_0x461115(0x20e)](_0x13b2f4),_0x366af6=stringWidth(_0x13b2f4),_0x5da5e9='\x20'[_0x461115(0x11d)](_0x38b48f-stringWidth(_0x13b2f4)+0x2),_0x16744d='('+formatElapsed(_0x184a49)+')',_0x43d65e=stringWidth(_0x16744d),_0x33cc50=stringWidth(_0x3d3244),_0x4ae864=_0x33cc50+0x1+_0x366af6+_0x5da5e9['length'],_0x57692a=_0xcbc726-_0x4ae864-_0x43d65e-0x1-0x8;let _0x453d26=_0x30c421;stringWidth(_0x453d26)>_0x57692a&&(_0x453d26=_0x453d26[_0x461115(0x24c)](0x0,_0x57692a-0x1)+'…');const _0xf12949=_0x30bd48+'\x20'+_0x18a7e2+_0x5da5e9+_0x453d26,_0x48b9b0=stringWidth(_0xf12949),_0x2019d3=_0xcbc726-_0x48b9b0-_0x43d65e,_0x41b1f7=_0xf12949+'\x20'[_0x461115(0x11d)](Math[_0x461115(0x1a3)](0x1,_0x2019d3))+a52_0x5c395f[_0x461115(0x20e)](_0x16744d),_0x181132=Math[_0x461115(0x15d)]((_0x33adec-_0x362271)/_0x1eb75d),_0x4d4287=Math[_0x461115(0x15d)]((_0x3a05c2-_0x362271)/_0x1eb75d),_0x16c97a=Math[_0x461115(0x1a3)](_0x181132+0x1,_0x4d4287),_0xe02af2=new Array(_0x40254f)[_0x461115(0x1d1)]('\x20');for(let _0x33af18=_0x181132;_0x33af18<Math[_0x461115(0x141)](_0x16c97a,_0x40254f);_0x33af18++){_0xe02af2[_0x33af18]='─';}const _0x16eb34=_0xe02af2[_0x461115(0x174)](_0x24a529=>_0x24a529==='\x20'?'\x20':_0x45994e(_0x24a529))[_0x461115(0x13b)]('');_0x1580d9[_0x461115(0x21a)](_0x21d2f4+'\x20'+_0x41b1f7+'│'+_0x16eb34+'│');}return _0x1580d9[_0x461115(0x13b)]('\x0a');}async[a52_0x525f16(0x1c6)](_0x11dc88,_0x41103d,_0x58f261){const _0x61ed74=a52_0x525f16,{options:_0x1b14fb,tdx:_0x46d79e}=_0x41103d,_0x2d766f=_0x1b14fb['site'],{timelineRows:_0x4595d3,timeAxisHeader:_0x51f013}=this[_0x61ed74(0x1e5)](_0x11dc88,_0x2d766f),_0x21a028=_0x4595d3[_0x61ed74(0x2b2)](_0x340b8d=>_0x340b8d['attemptId']);if(_0x21a028[_0x61ed74(0x1cf)]===0x0){const _0x3ae2f3=this['renderSessionsTimeline'](_0x11dc88,_0x2d766f);console[_0x61ed74(0x14d)](_0x3ae2f3);!_0x58f261&&(console[_0x61ed74(0x158)](''),console[_0x61ed74(0x158)](a52_0x5c395f['dim'](_0x61ed74(0x231))),console[_0x61ed74(0x158)](a52_0x5c395f[_0x61ed74(0x20e)](_0x61ed74(0x22a))+'or'+a52_0x5c395f[_0x61ed74(0x20e)](_0x61ed74(0x234))));return;}_0x51f013&&console[_0x61ed74(0x14d)](_0x51f013);const _0x56d721=_0x4595d3[_0x61ed74(0x2b2)](_0x21e0d0=>_0x21e0d0[_0x61ed74(0x16b)])[_0x61ed74(0x174)](_0x4566b0=>({'title':_0x4566b0['displayLine'],'value':_0x4566b0[_0x61ed74(0x16b)]})),_0x24d2f6=process['stdout'][_0x61ed74(0x2bf)]||0x3c,_0xf8ba07=Math[_0x61ed74(0x1a3)](0x28,Math[_0x61ed74(0x15d)](_0x24d2f6*0x2/0x3)),_0x162a1e=await a52_0x5682a4({'type':'autocomplete','name':_0x61ed74(0x16b),'message':_0x61ed74(0x23c),'choices':_0x56d721,'initial':-0x1,'limit':_0xf8ba07,'clearFirst':!![],'fallback':{'title':_0x61ed74(0x255),'value':null},'suggest':(_0x30518d,_0x249f86)=>{const _0x52562a=_0x61ed74;if(!_0x30518d)return Promise[_0x52562a(0x1f1)](_0x249f86);const _0x150767=_0x249f86[_0x52562a(0x2b2)](_0x480d11=>{const _0x193e41=_0x52562a,_0x3d306b=_0x480d11;return _0x3d306b['title'][_0x193e41(0x15f)]()[_0x193e41(0x2a4)](_0x30518d[_0x193e41(0x15f)]());});return Promise[_0x52562a(0x1f1)](_0x150767);}}),_0x2b9ba2=()=>{const _0x397f9e=_0x61ed74;process[_0x397f9e(0x210)][_0x397f9e(0x126)](_0x397f9e(0x29f)),process[_0x397f9e(0x210)][_0x397f9e(0x126)](_0x397f9e(0x29f)),process['stdout']['write']('\x1b[1A\x1b[2K');},_0x3a37e0=_0x162a1e&&_0x162a1e[_0x61ed74(0x16b)]&&_0x162a1e[_0x61ed74(0x16b)]!==null&&_0x162a1e[_0x61ed74(0x16b)]['trim']()!=='';if(!_0x3a37e0){_0x2b9ba2(),console[_0x61ed74(0x14d)](a52_0x5c395f[_0x61ed74(0x20e)](_0x61ed74(0x122)));return;}_0x2b9ba2();const _0x4187ad=_0x11dc88[_0x61ed74(0x198)](_0x2a9220=>_0x2a9220[_0x61ed74(0x163)]?.['id']===_0x162a1e[_0x61ed74(0x16b)]);if(_0x4187ad){const _0x4c408b=_0x4187ad['project']?.[_0x61ed74(0x29e)]||'?',_0x25d82a=_0x4187ad[_0x61ed74(0x207)]?.[_0x61ed74(0x29e)]||'?';console[_0x61ed74(0x14d)](_0x61ed74(0x18b)+a52_0x5c395f[_0x61ed74(0x20e)](_0x4c408b)+_0x61ed74(0x160)+a52_0x5c395f[_0x61ed74(0x20e)](_0x25d82a));}const _0x36fad7=new WorkflowTimelineCommand();await _0x36fad7[_0x61ed74(0x221)]({'args':[],'options':{..._0x1b14fb,'attemptId':_0x162a1e[_0x61ed74(0x16b)]},'tdx':_0x46d79e});}[a52_0x525f16(0x1e5)](_0x14a4fd,_0x165eb2){const _0x78863a=a52_0x525f16,_0x2c6f0b=new Map();for(const _0x35c0c6 of _0x14a4fd){_0x35c0c6['id']&&_0x35c0c6['lastAttempt']?.['id']&&_0x2c6f0b[_0x78863a(0x14c)](_0x35c0c6['id'],_0x35c0c6[_0x78863a(0x163)]['id']);}const _0x1c25d3=[];let _0x3bc67b='';const _0x1af407=this[_0x78863a(0x29c)](_0x14a4fd,_0x165eb2),_0x5805c4=_0x1af407['split']('\x0a');for(const _0x5e8afe of _0x5805c4){if(_0x5e8afe[_0x78863a(0x282)](_0x78863a(0x1df))||_0x5e8afe[_0x78863a(0x25c)](/^\s+\d{4}-\d{2}-\d{2}/))_0x3bc67b=_0x5e8afe;else{if(_0x5e8afe[_0x78863a(0x25c)](/^[✅❌🔄🛑⏳]/)){const _0x2afd3a=_0x5e8afe['match'](/#(\d+)/),_0x2b793e=_0x2afd3a?_0x2afd3a[0x1]:null,_0x27d0a8=_0x2b793e?_0x2c6f0b[_0x78863a(0x1ac)](_0x2b793e)||null:null,_0xa8ec5f=_0x14a4fd[_0x78863a(0x198)](_0x6e6194=>_0x6e6194['id']===_0x2b793e),_0x5f4b2b=_0xa8ec5f?.[_0x78863a(0x2ba)]?.[_0x78863a(0x29e)]||'';_0x1c25d3['push']({'displayLine':_0x5e8afe,'attemptId':_0x27d0a8,'projectName':_0x5f4b2b});}}}return{'timelineRows':_0x1c25d3,'timeAxisHeader':_0x3bc67b};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a52_0x525f16(0x29e)]='workflow:attempts';['description']=a52_0x525f16(0x12f);async[a52_0x525f16(0x221)](_0x20b5ef){const _0x227a5f=a52_0x525f16,{options:_0x5baf3f,args:_0x3c7fdd,tdx:_0x526e19}=_0x20b5ef,_0x58b81d=this[_0x227a5f(0x263)](_0x3c7fdd,_0x5baf3f);if(!_0x58b81d)return 0x1;const {projectName:_0x183848,workflowName:_0x1971ce}=_0x58b81d,_0x3bf3f2=_0x5baf3f[_0x227a5f(0x2c4)];if(_0x5baf3f[_0x227a5f(0x289)]){if(_0x183848&&_0x1971ce)console[_0x227a5f(0x158)](_0x227a5f(0x1cd)+_0x183848+'.'+_0x1971ce);else _0x183848&&console[_0x227a5f(0x158)](_0x227a5f(0x2b5)+_0x183848);_0x3bf3f2&&console[_0x227a5f(0x158)](_0x227a5f(0x28a));}const _0x300cce=await withSpinner(_0x227a5f(0x2bd),()=>_0x526e19[_0x227a5f(0x207)][_0x227a5f(0x292)]({'projectName':_0x183848,'workflowName':_0x1971ce,'includeRetried':_0x3bf3f2,'limit':_0x5baf3f[_0x227a5f(0x19d)]}),{'verbose':_0x5baf3f[_0x227a5f(0x289)]}),_0x1af45f=_0x300cce[_0x227a5f(0x1e9)],_0x546d21=_0x5baf3f[_0x227a5f(0x19d)]||0x64,_0x50ccb5=_0x1af45f['length']>=_0x546d21?a52_0x5c395f[_0x227a5f(0x20e)](_0x227a5f(0x227)):'';console[_0x227a5f(0x158)](_0x227a5f(0x25a)+_0x1af45f[_0x227a5f(0x1cf)]+_0x227a5f(0x245)+(_0x1af45f[_0x227a5f(0x1cf)]!==0x1?'s':'')+_0x50ccb5);if(_0x5baf3f[_0x227a5f(0x133)]==='json'||_0x5baf3f[_0x227a5f(0x133)]==='jsonl'||_0x5baf3f[_0x227a5f(0x133)]==='table')await handleSDKOutput(_0x1af45f,_0x5baf3f);else{if(_0x1af45f['length']===0x0){if(_0x183848&&_0x1971ce)console[_0x227a5f(0x14d)](_0x227a5f(0x218)+_0x183848+'.'+_0x1971ce);else _0x183848?console[_0x227a5f(0x14d)](_0x227a5f(0x119)+_0x183848):console[_0x227a5f(0x14d)](_0x227a5f(0x2b4));}else{const _0x3861b6=_0x5baf3f[_0x227a5f(0x299)],_0x5740bd=_0x1af45f[_0x227a5f(0x174)](_0x22ce02=>{const _0x59cf76=_0x227a5f,_0x338f9e=a52_0x5c395f[_0x59cf76(0x20e)]('#'+_0x22ce02['id']),_0x322345=_0x22ce02['project']?.['id'],_0xdb2039=_0x22ce02[_0x59cf76(0x241)]||_0x22ce02[_0x59cf76(0x252)],_0x37fb76=_0x322345&&_0xdb2039?hyperlink(_0x338f9e,getWorkflowAttemptUrl(_0x3861b6,_0x322345,_0xdb2039,_0x22ce02['id'])):_0x338f9e,{icon:_0x252b93,text:_0x3cb0d1}=getAttemptStatusDisplay(_0x22ce02),_0x100a64=(_0x22ce02[_0x59cf76(0x2ba)]?.[_0x59cf76(0x29e)]||'?')+'.'+(_0x22ce02[_0x59cf76(0x207)]?.[_0x59cf76(0x29e)]||'?'),_0x5d2903=_0x22ce02['sessionTime']?a52_0x5c395f[_0x59cf76(0x20e)](_0x22ce02[_0x59cf76(0x139)]):'';return(_0x37fb76+'\x20'+_0x252b93+(_0x3cb0d1?'\x20'+_0x3cb0d1:'')+'\x20'+_0x100a64+'\x20'+_0x5d2903)[_0x59cf76(0x18f)]();});await writeOutput(_0x5740bd[_0x227a5f(0x13b)]('\x0a'),_0x5baf3f[_0x227a5f(0x1d5)],_0x227a5f(0x26b));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a52_0x525f16(0x29e)]='workflow:attempt';[a52_0x525f16(0x12b)]=a52_0x525f16(0x233);async[a52_0x525f16(0x221)](_0x4d3c7d){const _0x5c1724=a52_0x525f16,{options:_0x31c68c,args:_0x3e08bd,tdx:_0x587699}=_0x4d3c7d,_0x56baf4=_0x3e08bd[0x0];if(!_0x56baf4)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x31c68c['verbose']&&console['error']('Attempt\x20ID:\x20'+_0x56baf4);const _0x1af877=await withSpinner(_0x5c1724(0x22e),()=>_0x587699['workflow'][_0x5c1724(0x206)](_0x56baf4),{'verbose':_0x31c68c[_0x5c1724(0x289)]}),_0x51a21f=_0x1af877[_0x5c1724(0x1e9)];let _0x2f5e93;!_0x51a21f['done']?_0x2f5e93=_0x51a21f[_0x5c1724(0x155)]?_0x5c1724(0x24b):'running':_0x2f5e93=_0x51a21f[_0x5c1724(0x2a0)]?_0x5c1724(0x2a0):'error';let _0x23efb2;if(_0x51a21f['createdAt']&&_0x51a21f[_0x5c1724(0x1c1)]){const _0x226475=new Date(_0x51a21f['createdAt'])['getTime'](),_0x45ee8c=new Date(_0x51a21f[_0x5c1724(0x1c1)])[_0x5c1724(0x16a)]();_0x23efb2=Math[_0x5c1724(0x184)]((_0x45ee8c-_0x226475)/0x3e8);}const _0x14119c={'attempt_id':_0x51a21f['id'],'status':_0x2f5e93,..._0x51a21f[_0x5c1724(0x1f4)]!==undefined&&{'index':_0x51a21f[_0x5c1724(0x1f4)]},..._0x51a21f[_0x5c1724(0x2ba)]&&{'project':_0x51a21f[_0x5c1724(0x2ba)]['name']},..._0x51a21f[_0x5c1724(0x207)]&&{'workflow':_0x51a21f['workflow'][_0x5c1724(0x29e)]},..._0x51a21f[_0x5c1724(0x252)]&&{'session_id':_0x51a21f[_0x5c1724(0x252)]},..._0x51a21f['sessionTime']&&{'session_time':_0x51a21f['sessionTime']},..._0x51a21f[_0x5c1724(0x1e7)]&&{'retry_attempt':_0x51a21f[_0x5c1724(0x1e7)]},..._0x23efb2!==undefined&&{'duration_sec':_0x23efb2},..._0x51a21f['createdAt']&&{'created_at':_0x51a21f['createdAt']},..._0x51a21f[_0x5c1724(0x1c1)]&&{'finished_at':_0x51a21f['finishedAt']},...Object[_0x5c1724(0x25d)](_0x51a21f[_0x5c1724(0x24d)])[_0x5c1724(0x1cf)]>0x0&&{'params':_0x51a21f['params']}};return await handleSingleObjectOutput(_0x14119c,_0x31c68c),0x0;}}function a52_0x2963(_0x1bcb7d,_0x247a5c){_0x1bcb7d=_0x1bcb7d-0x119;const _0x1eb166=a52_0x1eb1();let _0x2963ac=_0x1eb166[_0x1bcb7d];return _0x2963ac;}export class WorkflowTasksCommand extends BaseCommand{[a52_0x525f16(0x29e)]=a52_0x525f16(0x1de);[a52_0x525f16(0x12b)]=a52_0x525f16(0x138);async['execute'](_0x2d8ea9){const _0x1045ca=a52_0x525f16,{options:_0x4e4801,args:_0x535313,tdx:_0x3a449a}=_0x2d8ea9,_0x450421=_0x535313[0x0];if(!_0x450421)return console[_0x1045ca(0x158)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x4f153f=_0x4e4801['includeSubtasks'];_0x4e4801[_0x1045ca(0x289)]&&(console[_0x1045ca(0x158)](_0x1045ca(0x20a)+_0x450421),_0x4f153f&&console[_0x1045ca(0x158)]('Including\x20subtasks:\x20yes'));const _0xe875a9=await withSpinner(_0x1045ca(0x145),()=>_0x3a449a[_0x1045ca(0x207)]['tasks'](_0x450421,_0x4f153f||![]),{'verbose':_0x4e4801[_0x1045ca(0x289)]}),_0x1bb646=_0xe875a9[_0x1045ca(0x1e9)];return console[_0x1045ca(0x158)](_0x1045ca(0x25a)+_0x1bb646['length']+'\x20task'+(_0x1bb646['length']!==0x1?'s':'')),await handleSDKOutput(_0x1bb646,_0x4e4801),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a52_0x525f16(0x29e)]=a52_0x525f16(0x1f0);[a52_0x525f16(0x12b)]=a52_0x525f16(0x2a3);async['execute'](_0x233a2b){const _0x40e962=a52_0x525f16,{options:_0x340fa2,args:_0x31c31a,tdx:_0x3cb8a8}=_0x233a2b,_0x103647=_0x31c31a[0x0];let _0x41b9cb=_0x31c31a[0x1];if(!_0x103647)return console[_0x40e962(0x158)](_0x40e962(0x236)),0x1;_0x340fa2[_0x40e962(0x289)]&&(console[_0x40e962(0x158)](_0x40e962(0x20a)+_0x103647),_0x41b9cb&&console[_0x40e962(0x158)](_0x40e962(0x2c6)+_0x41b9cb));const _0x4f42c4=await withSpinner(_0x40e962(0x2a9),()=>_0x3cb8a8[_0x40e962(0x207)][_0x40e962(0x167)](_0x103647,_0x41b9cb),{'verbose':_0x340fa2[_0x40e962(0x289)]}),_0x1d97f3=_0x4f42c4['data'];if(_0x1d97f3[_0x40e962(0x1cf)]===0x0)return console[_0x40e962(0x158)](_0x40e962(0x275)),0x0;if(!_0x41b9cb&&(_0x340fa2['json']||_0x340fa2[_0x40e962(0x133)]))return await handleSDKOutput(_0x1d97f3,_0x340fa2),0x0;if(!_0x41b9cb){const _0x311c05=_0x1d97f3[_0x40e962(0x174)](_0x17edc9=>({'title':_0x17edc9[_0x40e962(0x14a)]+'\x20('+formatBytes(_0x17edc9[_0x40e962(0x18c)])+')','value':_0x17edc9['taskName']})),_0x4e3c9a=await a52_0x5682a4({'type':_0x40e962(0x280),'name':_0x40e962(0x1a6),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x311c05});if(!_0x4e3c9a[_0x40e962(0x1a6)])return console['error']('Cancelled'),0x0;_0x41b9cb=_0x4e3c9a[_0x40e962(0x1a6)];}const _0x25f518=await withSpinner(_0x40e962(0x235),()=>_0x3cb8a8[_0x40e962(0x207)]['logs'](_0x103647,_0x41b9cb),{'verbose':_0x340fa2[_0x40e962(0x289)]}),_0xf3ffec=_0x25f518['data'];return _0xf3ffec?console[_0x40e962(0x14d)](_0xf3ffec):console['error'](_0x40e962(0x2a2)),0x0;}}export class WorkflowKillCommand extends BaseCommand{['name']=a52_0x525f16(0x2c3);[a52_0x525f16(0x12b)]=a52_0x525f16(0x272);async[a52_0x525f16(0x221)](_0x3d8c23){const _0x454aba=a52_0x525f16,{options:_0x2e6da0,args:_0x33987d,tdx:_0x14e02a}=_0x3d8c23,_0x5ab8ff=_0x33987d[0x0];if(!_0x5ab8ff)return console[_0x454aba(0x158)](_0x454aba(0x236)),0x1;const _0x2327c2=_0x2e6da0[_0x454aba(0x11c)];_0x2e6da0[_0x454aba(0x289)]&&(console[_0x454aba(0x158)]('Attempt\x20ID:\x20'+_0x5ab8ff),_0x2327c2&&console['error'](_0x454aba(0x28b)+_0x2327c2));if(!_0x2e6da0['yes']){if(!isInteractive())return console[_0x454aba(0x158)](a52_0x5c395f[_0x454aba(0x29b)]('\x0aError:'),_0x454aba(0x1ea)),console['error'](a52_0x5c395f['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4cba4f=await confirmKey(_0x454aba(0x18a)+_0x5ab8ff+'?');if(!_0x4cba4f)return console['error'](a52_0x5c395f[_0x454aba(0x17b)](_0x454aba(0x122))),0x1;}const _0x4e7343=await withSpinner(_0x454aba(0x1b2),()=>_0x14e02a[_0x454aba(0x207)][_0x454aba(0x151)](_0x5ab8ff,_0x2327c2),{'verbose':_0x2e6da0['verbose']}),_0xf981ca=_0x4e7343['data'];return console['error']('✔\x20'+_0xf981ca),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a52_0x525f16(0x29e)]=a52_0x525f16(0x1f8);['description']=a52_0x525f16(0x212);async['execute'](_0x1fe879){const _0x397849=a52_0x525f16,{options:_0x3078b8,args:_0x324c7a,tdx:_0x18150d}=_0x1fe879,_0x325931=_0x324c7a[0x0];if(!_0x325931)return console[_0x397849(0x158)](_0x397849(0x1dc)),console['error'](_0x397849(0x2a1)),0x1;let _0x4a5807=![],_0x281ca7=_0x325931;if(_0x325931['startsWith']('session:'))_0x4a5807=!![],_0x281ca7=_0x325931[_0x397849(0x11f)](0x8);else{if(_0x325931[_0x397849(0x282)](_0x397849(0x2af)))_0x4a5807=![],_0x281ca7=_0x325931[_0x397849(0x11f)](0x8);else return console['error'](_0x397849(0x222)),console[_0x397849(0x158)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x4a4de1=_0x3078b8[_0x397849(0x192)],_0x19b56a=_0x3078b8[_0x397849(0x260)],_0x2e24ee=_0x3078b8[_0x397849(0x24d)],_0x58f144=_0x3078b8['force'];_0x3078b8[_0x397849(0x289)]&&(console[_0x397849(0x158)](_0x397849(0x2c1)+(_0x4a5807?'session':'attempt')+'\x20'+_0x281ca7),_0x4a4de1&&console['error']('From\x20task:\x20'+_0x4a4de1),_0x19b56a&&console[_0x397849(0x158)](_0x397849(0x15a)+_0x19b56a),_0x2e24ee&&console[_0x397849(0x158)](_0x397849(0x17f)+_0x2e24ee),_0x58f144&&console[_0x397849(0x158)](_0x397849(0x12a)));let _0x5a8eb2;if(_0x2e24ee)try{if(_0x2e24ee[_0x397849(0x282)]('@')){const _0x3770fa=await import(_0x397849(0x120)),_0x5ac1e4=_0x2e24ee['substring'](0x1),_0x4cecbf=await _0x3770fa['readFile'](_0x5ac1e4,'utf-8');_0x5a8eb2=JSON[_0x397849(0x12c)](_0x4cecbf);}else _0x5a8eb2=JSON[_0x397849(0x12c)](_0x2e24ee);}catch{return console['error'](_0x397849(0x162)),0x1;}if(!_0x3078b8[_0x397849(0x13a)]){if(!isInteractive())return console['error'](a52_0x5c395f['red'](_0x397849(0x1cb)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a52_0x5c395f[_0x397849(0x20e)](_0x397849(0x2b9))),0x1;const _0x15676e=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x4a5807?_0x397849(0x21f):_0x397849(0x206))+'\x20'+_0x281ca7+'?');if(!_0x15676e)return console[_0x397849(0x158)](a52_0x5c395f[_0x397849(0x17b)](_0x397849(0x122))),0x1;}let _0x738fc0;_0x4a5807?_0x738fc0=await withSpinner(_0x397849(0x21d),()=>_0x18150d[_0x397849(0x207)][_0x397849(0x123)](_0x281ca7,{'fromTask':_0x4a4de1,'retryParams':_0x5a8eb2}),{'verbose':_0x3078b8['verbose']}):_0x738fc0=await withSpinner('Retrying\x20attempt...',()=>_0x18150d[_0x397849(0x207)]['retryAttempt'](_0x281ca7,{'resumeFrom':_0x19b56a,'retryParams':_0x5a8eb2,'force':_0x58f144}),{'verbose':_0x3078b8['verbose']});const _0x25ff51=_0x738fc0[_0x397849(0x1e9)];return console[_0x397849(0x158)](_0x397849(0x2a6)),console[_0x397849(0x158)](_0x397849(0x19f)+_0x25ff51[_0x397849(0x16b)]),console[_0x397849(0x158)](_0x397849(0x1a1)+_0x25ff51[_0x397849(0x252)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a52_0x525f16(0x29e)]=a52_0x525f16(0x11a);[a52_0x525f16(0x12b)]=a52_0x525f16(0x256);async[a52_0x525f16(0x221)](_0x263939){const _0x1bff83=a52_0x525f16,{options:_0x507f46,args:_0x18c25c,tdx:_0x5344ef}=_0x263939;let _0x318dff=_0x18c25c[0x0];if(!_0x318dff){const _0x2f3565=this[_0x1bff83(0x2aa)]([],_0x507f46),_0x42efa3=await withSpinner(_0x1bff83(0x2b3),()=>_0x5344ef[_0x1bff83(0x207)][_0x1bff83(0x283)](_0x2f3565,{'limit':_0x507f46[_0x1bff83(0x19d)]}),{'verbose':_0x507f46[_0x1bff83(0x289)]}),_0xb6d130=_0x42efa3[_0x1bff83(0x1e9)];if(_0xb6d130[_0x1bff83(0x1cf)]===0x0)return console[_0x1bff83(0x158)]('No\x20workflows\x20found'),!_0x2f3565&&console['error'](a52_0x5c395f[_0x1bff83(0x20e)](_0x1bff83(0x257))),0x1;const _0x312200=_0xb6d130['map'](_0x5b1929=>({'title':_0x5b1929[_0x1bff83(0x2ba)]?.[_0x1bff83(0x29e)]+'.'+_0x5b1929[_0x1bff83(0x29e)],'value':_0x5b1929['project']?.[_0x1bff83(0x29e)]+'.'+_0x5b1929['name'],'description':_0x5b1929['revision']?'revision:\x20'+_0x5b1929['revision']:undefined})),_0xa8d6e4=await a52_0x5682a4({'type':_0x1bff83(0x280),'name':_0x1bff83(0x207),'message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x312200});if(!_0xa8d6e4[_0x1bff83(0x207)])return 0x1;_0x318dff=_0xa8d6e4[_0x1bff83(0x207)];}if(!_0x318dff[_0x1bff83(0x2a4)]('.')){const _0x2f2a91=this['resolveProject']([],_0x507f46);if(_0x2f2a91)_0x318dff=_0x2f2a91+'.'+_0x318dff;else return console[_0x1bff83(0x158)](a52_0x5c395f['red'](_0x1bff83(0x28f)),_0x1bff83(0x1d9)),console[_0x1bff83(0x158)](a52_0x5c395f[_0x1bff83(0x20e)](_0x1bff83(0x257))),0x1;}const _0x2b0c4d=_0x507f46[_0x1bff83(0x223)],_0x228478=_0x507f46[_0x1bff83(0x139)],_0x54133a={};if(_0x2b0c4d&&Array[_0x1bff83(0x1a9)](_0x2b0c4d))for(const _0x2c9d79 of _0x2b0c4d){const _0x214dcc=_0x2c9d79[_0x1bff83(0x24f)]('=');if(_0x214dcc===-0x1)return console['error']('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x2c9d79),console[_0x1bff83(0x158)](_0x1bff83(0x13c)),0x1;const _0x39a05c=_0x2c9d79['substring'](0x0,_0x214dcc),_0x17cd29=_0x2c9d79[_0x1bff83(0x11f)](_0x214dcc+0x1);try{_0x54133a[_0x39a05c]=JSON[_0x1bff83(0x12c)](_0x17cd29);}catch{_0x54133a[_0x39a05c]=_0x17cd29;}}_0x507f46[_0x1bff83(0x289)]&&(console[_0x1bff83(0x158)](_0x1bff83(0x1fe)+_0x318dff),Object['keys'](_0x54133a)[_0x1bff83(0x1cf)]>0x0&&console[_0x1bff83(0x158)](_0x1bff83(0x13e)+JSON[_0x1bff83(0x249)](_0x54133a)),_0x228478&&console['error'](_0x1bff83(0x1d6)+_0x228478));const _0x35a0ce=await withSpinner(_0x1bff83(0x21c),()=>_0x5344ef['workflow']['run'](_0x318dff,_0x54133a,{'sessionTime':_0x228478}),{'verbose':_0x507f46[_0x1bff83(0x289)]}),_0x2f4b1f=_0x35a0ce[_0x1bff83(0x1e9)];console['error']('✔\x20Workflow\x20run\x20started'),console[_0x1bff83(0x158)](_0x1bff83(0x17e)+_0x2f4b1f['id']),console[_0x1bff83(0x158)]('\x20\x20Session\x20ID:\x20'+_0x2f4b1f[_0x1bff83(0x252)]),console[_0x1bff83(0x158)](_0x1bff83(0x1b8)+_0x2f4b1f[_0x1bff83(0x2ba)]?.[_0x1bff83(0x29e)]),console[_0x1bff83(0x158)]('\x20\x20Workflow:\x20'+_0x2f4b1f[_0x1bff83(0x207)]?.['name']);if(_0x2f4b1f[_0x1bff83(0x2ba)]?.['id']&&_0x2f4b1f[_0x1bff83(0x252)]&&_0x2f4b1f['id']){const _0x23f668=_0x507f46[_0x1bff83(0x299)],_0x3aa07d=getConsoleUrl(_0x23f668,_0x1bff83(0x1e8)+_0x2f4b1f[_0x1bff83(0x2ba)]['id']+_0x1bff83(0x156)+_0x2f4b1f['sessionId']+_0x1bff83(0x271)+_0x2f4b1f['id']);console[_0x1bff83(0x158)](_0x1bff83(0x164)+a52_0x5c395f['cyan'](_0x3aa07d));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']='workflow:download';[a52_0x525f16(0x12b)]=a52_0x525f16(0x26c);async[a52_0x525f16(0x221)](_0x432b89){const _0x1237f0=a52_0x525f16,{options:_0x60e3f5,args:_0x166c87,tdx:_0x419568}=_0x432b89,_0x2baa97=_0x166c87[0x0],_0x3965a7=_0x166c87[0x1]||'.';if(!_0x2baa97)return console['error']('Error:\x20Project\x20name\x20is\x20required'),console[_0x1237f0(0x158)](_0x1237f0(0x23d)),0x1;const _0x405773=_0x60e3f5['revision'];_0x60e3f5[_0x1237f0(0x289)]&&(console[_0x1237f0(0x158)]('Project:\x20'+_0x2baa97),console[_0x1237f0(0x158)](_0x1237f0(0x27a)+_0x3965a7),_0x405773&&console[_0x1237f0(0x158)]('Revision:\x20'+_0x405773));const _0x2620e3=await withSpinner(_0x1237f0(0x26a)+_0x2baa97+'...',()=>_0x419568[_0x1237f0(0x207)][_0x1237f0(0x196)](_0x2baa97,_0x3965a7,{'revision':_0x405773}),{'verbose':_0x60e3f5[_0x1237f0(0x289)]}),_0x4b577c=_0x2620e3['data'];return console[_0x1237f0(0x158)]('✔\x20Downloaded\x20'+_0x4b577c['projectName']),console[_0x1237f0(0x158)]('\x20\x20Revision:\x20'+_0x4b577c[_0x1237f0(0x16f)]),console[_0x1237f0(0x158)](_0x1237f0(0x125)+_0x4b577c[_0x1237f0(0x12e)]),console[_0x1237f0(0x158)](_0x1237f0(0x285)+_0x3965a7+'/'+_0x4b577c['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a52_0x525f16(0x29e)]=a52_0x525f16(0x26d);[a52_0x525f16(0x12b)]=a52_0x525f16(0x176);async['execute'](_0x3fd42b){const _0x38737e=a52_0x525f16,{options:_0x121bea,args:_0x4b936d,tdx:_0x9ec042}=_0x3fd42b;let _0x30a885='.',_0x5a46b5=_0x121bea['name'];if(_0x4b936d[0x0]){const {promises:_0x43b27a}=await import('fs');try{const _0x16bd94=await _0x43b27a[_0x38737e(0x253)](_0x4b936d[0x0]);if(_0x16bd94[_0x38737e(0x15b)]())_0x30a885=_0x4b936d[0x0];else return console[_0x38737e(0x158)](_0x38737e(0x179)+_0x4b936d[0x0]+_0x38737e(0x295)),0x1;}catch{_0x5a46b5=_0x4b936d[0x0],_0x30a885='.';}}const _0x22978e=_0x121bea[_0x38737e(0x16f)],_0x349ce4=_0x121bea[_0x38737e(0x28e)];_0x121bea[_0x38737e(0x289)]&&(console[_0x38737e(0x158)]('Project\x20directory:\x20'+_0x30a885),_0x5a46b5&&console[_0x38737e(0x158)](_0x38737e(0x22d)+_0x5a46b5),_0x22978e&&console[_0x38737e(0x158)]('Revision:\x20'+_0x22978e),_0x349ce4&&console[_0x38737e(0x158)](_0x38737e(0x177)));const _0xf19f54=await withSpinner(_0x38737e(0x298),()=>_0x9ec042[_0x38737e(0x207)][_0x38737e(0x21a)](_0x30a885,{'projectName':_0x5a46b5,'revision':_0x22978e,'skipValidation':_0x349ce4}),{'verbose':_0x121bea[_0x38737e(0x289)]}),_0x5dcefb=_0xf19f54[_0x38737e(0x1e9)];return console[_0x38737e(0x158)](_0x38737e(0x281)+_0x5dcefb[_0x38737e(0x140)]),console['error'](_0x38737e(0x183)+_0x5dcefb['projectId']),console[_0x38737e(0x158)](_0x38737e(0x1b3)+_0x5dcefb[_0x38737e(0x16f)]),await this['showWorkflowConsoleUrl'](_0x9ec042,_0x5dcefb['projectName'],_0x121bea[_0x38737e(0x299)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a52_0x525f16(0x29e)]=a52_0x525f16(0x1cc);[a52_0x525f16(0x12b)]=a52_0x525f16(0x195);async[a52_0x525f16(0x221)](_0x158d23){const _0x4a4dc4=a52_0x525f16,{options:_0x26ef84,args:_0x369640,tdx:_0x1011c8}=_0x158d23,_0x489dc8=_0x369640[0x0],_0x35f452=_0x369640[0x1];if(!_0x489dc8)return console['error'](a52_0x5c395f[_0x4a4dc4(0x29b)](_0x4a4dc4(0x28f)),_0x4a4dc4(0x284)),console['error'](a52_0x5c395f[_0x4a4dc4(0x20e)]('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x48465d=_0x26ef84[_0x4a4dc4(0x16f)];_0x26ef84['verbose']&&(console[_0x4a4dc4(0x158)](_0x4a4dc4(0x18b)+_0x489dc8),_0x35f452&&console[_0x4a4dc4(0x158)]('Target\x20directory:\x20'+_0x35f452),_0x48465d&&console[_0x4a4dc4(0x158)](_0x4a4dc4(0x166)+_0x48465d),_0x26ef84['dryRun']&&console[_0x4a4dc4(0x158)](_0x4a4dc4(0x279)));const _0x595c61=await withSpinner('Pulling\x20project\x20'+_0x489dc8+_0x4a4dc4(0x2ac),()=>_0x1011c8[_0x4a4dc4(0x207)][_0x4a4dc4(0x175)](_0x489dc8,{'targetDir':_0x35f452,'revision':_0x48465d}),{'verbose':_0x26ef84[_0x4a4dc4(0x289)]}),_0x5e8858=_0x595c61[_0x4a4dc4(0x1e9)];_0x5e8858['isNewProject']?console[_0x4a4dc4(0x158)](_0x4a4dc4(0x131)+_0x5e8858[_0x4a4dc4(0x140)]):console[_0x4a4dc4(0x158)](_0x4a4dc4(0x143)+_0x5e8858[_0x4a4dc4(0x140)]);console[_0x4a4dc4(0x158)]('\x20\x20Revision:\x20'+_0x5e8858[_0x4a4dc4(0x16f)]),console[_0x4a4dc4(0x158)](_0x4a4dc4(0x2b1)+(a52_0x2c88cd['relative'](process[_0x4a4dc4(0x1e4)](),_0x5e8858[_0x4a4dc4(0x153)])||'.')),console[_0x4a4dc4(0x158)](_0x4a4dc4(0x127)+a52_0x5c395f[_0x4a4dc4(0x293)]('+'+_0x5e8858[_0x4a4dc4(0x258)]['new']+_0x4a4dc4(0x232))+',\x20'+(a52_0x5c395f[_0x4a4dc4(0x17b)]('~'+_0x5e8858[_0x4a4dc4(0x258)]['modified']+_0x4a4dc4(0x290))+',\x20')+(a52_0x5c395f['red']('-'+_0x5e8858[_0x4a4dc4(0x258)]['deleted']+'\x20deleted')+',\x20')+(''+a52_0x5c395f[_0x4a4dc4(0x20e)](_0x5e8858['summary'][_0x4a4dc4(0x172)]+_0x4a4dc4(0x1a0))));for(const _0x1c7419 of _0x5e8858[_0x4a4dc4(0x1ae)]){_0x1c7419[_0x4a4dc4(0x1b9)]===_0x4a4dc4(0x1c8)&&_0x1c7419[_0x4a4dc4(0x148)]&&(console[_0x4a4dc4(0x158)]('\x0a'+a52_0x5c395f[_0x4a4dc4(0x244)](_0x4a4dc4(0x178)+_0x1c7419[_0x4a4dc4(0x1c5)])),console[_0x4a4dc4(0x158)](_0x1c7419[_0x4a4dc4(0x148)]));}if(!_0x5e8858['hasChanges'])return saveSessionContext({'workflow_project':_0x5e8858[_0x4a4dc4(0x140)]},_0x26ef84[_0x4a4dc4(0x21f)]),console['error'](a52_0x5c395f[_0x4a4dc4(0x293)](_0x4a4dc4(0x287))),console[_0x4a4dc4(0x158)](a52_0x5c395f['dim'](_0x4a4dc4(0x214)+_0x5e8858[_0x4a4dc4(0x140)])),0x0;if(_0x26ef84[_0x4a4dc4(0x23b)])return console[_0x4a4dc4(0x158)](a52_0x5c395f['yellow']('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x26ef84['yes']){if(!isInteractive())return console[_0x4a4dc4(0x158)](a52_0x5c395f[_0x4a4dc4(0x29b)](_0x4a4dc4(0x1cb)),_0x4a4dc4(0x1ea)),console[_0x4a4dc4(0x158)](a52_0x5c395f[_0x4a4dc4(0x20e)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1884ec=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x1884ec)return console['error'](a52_0x5c395f['yellow'](_0x4a4dc4(0x122)),_0x4a4dc4(0x23e)),0x1;}await withSpinner(_0x4a4dc4(0x18e),()=>_0x1011c8['workflow']['applyPullProject'](_0x5e8858,{'revision':_0x48465d}),{'verbose':_0x26ef84[_0x4a4dc4(0x289)]}),saveSessionContext({'workflow_project':_0x5e8858[_0x4a4dc4(0x140)]},_0x26ef84[_0x4a4dc4(0x21f)]),console['error'](a52_0x5c395f[_0x4a4dc4(0x293)](_0x4a4dc4(0x1fc)));const _0x3cdc7c=a52_0x2c88cd[_0x4a4dc4(0x1ba)](process[_0x4a4dc4(0x1e4)](),_0x5e8858[_0x4a4dc4(0x153)])||'.';return console[_0x4a4dc4(0x158)](a52_0x5c395f[_0x4a4dc4(0x20e)](_0x4a4dc4(0x285)+_0x3cdc7c)),console[_0x4a4dc4(0x158)](a52_0x5c395f[_0x4a4dc4(0x20e)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x5e8858[_0x4a4dc4(0x140)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a52_0x525f16(0x199);[a52_0x525f16(0x12b)]=a52_0x525f16(0x19a);async[a52_0x525f16(0x221)](_0x58ee1d){const _0x58a69e=a52_0x525f16,{options:_0x16ebee,args:_0x167bc9,tdx:_0x32896d}=_0x58ee1d,_0x270d13=this[_0x58a69e(0x259)](_0x167bc9,_0x16ebee),_0xaaa8b9=_0x16ebee['revision'],_0x98309b=_0x16ebee[_0x58a69e(0x28e)];_0x16ebee['verbose']&&(_0x270d13&&console['error']('Source\x20directory:\x20'+_0x270d13),_0xaaa8b9&&console[_0x58a69e(0x158)](_0x58a69e(0x166)+_0xaaa8b9),_0x16ebee[_0x58a69e(0x23b)]&&console[_0x58a69e(0x158)](_0x58a69e(0x279)),_0x98309b&&console[_0x58a69e(0x158)](_0x58a69e(0x177)));let _0x5b2d08;try{_0x5b2d08=await withSpinner('Analyzing\x20changes...',()=>_0x32896d[_0x58a69e(0x207)][_0x58a69e(0x291)]({'sourceDir':_0x270d13,'revision':_0xaaa8b9,'skipValidation':_0x98309b}),{'verbose':_0x16ebee[_0x58a69e(0x289)]});}catch(_0x3554ad){if(_0x3554ad instanceof Error&&_0x3554ad[_0x58a69e(0x130)][_0x58a69e(0x2a4)]('No\x20workflow\x20tdx.json\x20found'))return console['error'](a52_0x5c395f[_0x58a69e(0x29b)](_0x58a69e(0x28f)),_0x58a69e(0x1d8)),_0x16ebee[_0x58a69e(0x204)]?console['error'](a52_0x5c395f[_0x58a69e(0x20e)]('Tip:\x20cd\x20to\x20workflows/'+_0x16ebee[_0x58a69e(0x204)]+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x16ebee[_0x58a69e(0x204)]+'\x27')):console[_0x58a69e(0x158)](a52_0x5c395f[_0x58a69e(0x20e)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x3554ad;}const _0x225879=_0x5b2d08['data'];console[_0x58a69e(0x158)](_0x58a69e(0x1a5)+_0x225879[_0x58a69e(0x140)]),console[_0x58a69e(0x158)](_0x58a69e(0x27f)+_0x225879['sourceDir']),console[_0x58a69e(0x158)](_0x58a69e(0x1b3)+_0x225879[_0x58a69e(0x16f)]),console[_0x58a69e(0x158)]('\x20\x20Changes:\x20'+a52_0x5c395f['green']('+'+_0x225879[_0x58a69e(0x258)][_0x58a69e(0x11e)]+_0x58a69e(0x232))+',\x20'+(a52_0x5c395f['yellow']('~'+_0x225879[_0x58a69e(0x258)][_0x58a69e(0x1c8)]+_0x58a69e(0x290))+',\x20')+(a52_0x5c395f[_0x58a69e(0x29b)]('-'+_0x225879['summary']['deleted']+_0x58a69e(0x26f))+',\x20')+(''+a52_0x5c395f[_0x58a69e(0x20e)](_0x225879[_0x58a69e(0x258)][_0x58a69e(0x172)]+'\x20unchanged')));for(const _0x31fe3a of _0x225879['changes']){_0x31fe3a[_0x58a69e(0x1b9)]===_0x58a69e(0x1c8)&&_0x31fe3a[_0x58a69e(0x148)]&&(console['error']('\x0a'+a52_0x5c395f['cyan'](_0x58a69e(0x178)+_0x31fe3a['path'])),console[_0x58a69e(0x158)](_0x31fe3a['diff']));}if(!_0x225879[_0x58a69e(0x1a8)])return console[_0x58a69e(0x158)](a52_0x5c395f[_0x58a69e(0x293)](_0x58a69e(0x1d7))),await this[_0x58a69e(0x1a4)](_0x32896d,_0x225879[_0x58a69e(0x140)],_0x16ebee['site']),0x0;if(_0x16ebee['dryRun'])return console[_0x58a69e(0x158)](a52_0x5c395f['yellow'](_0x58a69e(0x2ab))),0x0;if(!_0x16ebee[_0x58a69e(0x13a)]){if(!isInteractive())return console['error'](a52_0x5c395f[_0x58a69e(0x29b)]('\x0aError:'),_0x58a69e(0x1ea)),console[_0x58a69e(0x158)](a52_0x5c395f[_0x58a69e(0x20e)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2c0ab2=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x2c0ab2)return console[_0x58a69e(0x158)](a52_0x5c395f[_0x58a69e(0x17b)](_0x58a69e(0x122)),_0x58a69e(0x171)),0x1;}const _0x5ab6f9=await withSpinner(_0x58a69e(0x25f),()=>_0x32896d[_0x58a69e(0x207)][_0x58a69e(0x243)](_0x225879),{'verbose':_0x16ebee['verbose']}),_0x23cb0b=_0x5ab6f9[_0x58a69e(0x1e9)];return console[_0x58a69e(0x158)](a52_0x5c395f[_0x58a69e(0x293)](_0x58a69e(0x265))),console[_0x58a69e(0x158)](_0x58a69e(0x183)+_0x23cb0b[_0x58a69e(0x2c0)]),console[_0x58a69e(0x158)](_0x58a69e(0x1b3)+_0x23cb0b[_0x58a69e(0x16f)]),await this[_0x58a69e(0x1a4)](_0x32896d,_0x23cb0b[_0x58a69e(0x140)],_0x16ebee[_0x58a69e(0x299)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a52_0x525f16(0x29e)]=a52_0x525f16(0x11b);['description']=a52_0x525f16(0x1ce);async[a52_0x525f16(0x221)](_0x3d0bea){const _0x29f49f=a52_0x525f16,{options:_0xba9e44,args:_0x26beeb,tdx:_0x4a0b84}=_0x3d0bea,_0xdab4a7=this[_0x29f49f(0x259)](_0x26beeb,_0xba9e44),_0x2f7e9b=_0xba9e44[_0x29f49f(0x29e)],_0x460360=_0xba9e44[_0x29f49f(0x16f)],_0x532555=_0xba9e44[_0x29f49f(0x28e)];if(!_0xdab4a7)return console[_0x29f49f(0x158)](a52_0x5c395f[_0x29f49f(0x29b)]('Error:'),_0x29f49f(0x1e3)),console['error'](a52_0x5c395f['dim'](_0x29f49f(0x277))),console['error'](a52_0x5c395f[_0x29f49f(0x20e)](_0x29f49f(0x146))),0x1;if(!_0x2f7e9b)return console[_0x29f49f(0x158)](a52_0x5c395f[_0x29f49f(0x29b)](_0x29f49f(0x28f)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console['error'](a52_0x5c395f['dim'](_0x29f49f(0x277))),0x1;_0xba9e44['verbose']&&(console[_0x29f49f(0x158)](_0x29f49f(0x1b6)+_0xdab4a7),console[_0x29f49f(0x158)](_0x29f49f(0x238)+_0x2f7e9b),_0x460360&&console[_0x29f49f(0x158)](_0x29f49f(0x166)+_0x460360),_0xba9e44['dryRun']&&console[_0x29f49f(0x158)](_0x29f49f(0x279)),_0x532555&&console[_0x29f49f(0x158)](_0x29f49f(0x177)));const _0x39db31=await withSpinner(_0x29f49f(0x25e),()=>_0x4a0b84[_0x29f49f(0x207)][_0x29f49f(0x15c)](_0xdab4a7,_0x2f7e9b,{'revision':_0x460360,'skipValidation':_0x532555}),{'verbose':_0xba9e44['verbose']}),_0x2821b0=_0x39db31[_0x29f49f(0x1e9)];console['error']('Source:\x20'+_0x2821b0[_0x29f49f(0x1c4)]);_0x2821b0[_0x29f49f(0x1ca)]&&console['error'](_0x29f49f(0x27b)+_0x2821b0[_0x29f49f(0x1ca)]);console[_0x29f49f(0x158)](_0x29f49f(0x238)+_0x2821b0[_0x29f49f(0x23f)]),console[_0x29f49f(0x158)](_0x29f49f(0x166)+_0x2821b0[_0x29f49f(0x16f)]),console['error'](_0x29f49f(0x1af)+_0x2821b0[_0x29f49f(0x1ed)]);_0x2821b0['targetExists']&&(console[_0x29f49f(0x158)](a52_0x5c395f[_0x29f49f(0x17b)](_0x29f49f(0x278)+_0x2821b0['newProjectName']+'\x22\x20already\x20exists\x20(ID:\x20'+_0x2821b0[_0x29f49f(0x1f9)]+')')),console[_0x29f49f(0x158)](a52_0x5c395f[_0x29f49f(0x17b)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0xba9e44[_0x29f49f(0x23b)])return console[_0x29f49f(0x158)](a52_0x5c395f[_0x29f49f(0x17b)]('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0xba9e44[_0x29f49f(0x13a)]){if(!isInteractive())return console['error'](a52_0x5c395f[_0x29f49f(0x29b)](_0x29f49f(0x1cb)),_0x29f49f(0x1ea)),console[_0x29f49f(0x158)](a52_0x5c395f[_0x29f49f(0x20e)](_0x29f49f(0x2b9))),0x1;const _0x10d4f3=_0x2821b0[_0x29f49f(0x1ca)]||a52_0x2c88cd[_0x29f49f(0x193)](_0xdab4a7),_0x4cfccf=_0x2821b0[_0x29f49f(0x266)]?_0x29f49f(0x186)+_0x2f7e9b+'\x22\x20with\x20new\x20revision?':_0x29f49f(0x203)+_0x10d4f3+_0x29f49f(0x228)+_0x2f7e9b+'\x22?',_0x2c680c=await confirmKey(_0x4cfccf);if(!_0x2c680c)return console[_0x29f49f(0x158)](a52_0x5c395f['yellow'](_0x29f49f(0x122))),0x1;}const _0x1283cd=await withSpinner(_0x2821b0['targetExists']?_0x29f49f(0x296)+_0x2f7e9b+_0x29f49f(0x2ac):_0x29f49f(0x144)+_0x2f7e9b+'...',()=>_0x4a0b84[_0x29f49f(0x207)][_0x29f49f(0x190)](_0x2821b0),{'verbose':_0xba9e44[_0x29f49f(0x289)]}),_0x30171c=_0x1283cd[_0x29f49f(0x1e9)];return console[_0x29f49f(0x158)](a52_0x5c395f[_0x29f49f(0x293)](_0x2821b0[_0x29f49f(0x266)]?'✔\x20Project\x20updated':_0x29f49f(0x217))),console[_0x29f49f(0x158)](_0x29f49f(0x1b8)+_0x30171c[_0x29f49f(0x23f)]),console[_0x29f49f(0x158)](_0x29f49f(0x183)+_0x30171c[_0x29f49f(0x1e6)]),console[_0x29f49f(0x158)](_0x29f49f(0x1b3)+_0x30171c[_0x29f49f(0x16f)]),await this[_0x29f49f(0x1a4)](_0x4a0b84,_0x30171c[_0x29f49f(0x23f)],_0xba9e44['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a52_0x525f16(0x286);[a52_0x525f16(0x12b)]=a52_0x525f16(0x1c7);async[a52_0x525f16(0x221)](_0x38a144){const _0x56c340=a52_0x525f16,{options:_0x29a934,args:_0x1ec371,tdx:_0x1d1255}=_0x38a144,_0x1076d0=_0x1ec371[0x0];if(!_0x1076d0)return console['error'](_0x56c340(0x22f)),console[_0x56c340(0x158)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x29a934[_0x56c340(0x289)]&&console[_0x56c340(0x158)](_0x56c340(0x18b)+_0x1076d0);if(!_0x29a934[_0x56c340(0x13a)]){if(!isInteractive())return console[_0x56c340(0x158)](a52_0x5c395f['red'](_0x56c340(0x1cb)),_0x56c340(0x1ea)),console[_0x56c340(0x158)](a52_0x5c395f[_0x56c340(0x20e)](_0x56c340(0x2b9))),0x1;const _0xbfb962=await confirmKey(_0x56c340(0x19e)+_0x1076d0+_0x56c340(0x268));if(!_0xbfb962)return console[_0x56c340(0x158)](a52_0x5c395f[_0x56c340(0x17b)]('Cancelled')),0x1;}const _0x248693=await withSpinner(_0x56c340(0x2c7)+_0x1076d0+_0x56c340(0x2ac),()=>_0x1d1255['workflow']['delete'](_0x1076d0),{'verbose':_0x29a934[_0x56c340(0x289)]}),_0x3db8f9=_0x248693[_0x56c340(0x1e9)];return console['error']('✔\x20Deleted\x20project\x20'+_0x3db8f9[_0x56c340(0x140)]),console['error'](_0x56c340(0x183)+_0x3db8f9[_0x56c340(0x2c0)]),0x0;}}export function parseKeyValue(_0x4b2f17){const _0x5b1e66=a52_0x525f16,_0x4b5385=_0x4b2f17[_0x5b1e66(0x24f)]('=');if(_0x4b5385===-0x1)throw new Error(_0x5b1e66(0x137)+_0x4b2f17+_0x5b1e66(0x12d));const _0x183ea0=_0x4b2f17['substring'](0x0,_0x4b5385),_0xe6382b=_0x4b2f17[_0x5b1e66(0x11f)](_0x4b5385+0x1);if(!_0x183ea0)throw new Error(_0x5b1e66(0x2ae));return{'key':_0x183ea0,'value':_0xe6382b};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a52_0x525f16(0x29e)]=a52_0x525f16(0x134);['description']=a52_0x525f16(0x1f5);async[a52_0x525f16(0x221)](_0x1bdcd1){const _0x2692dc=a52_0x525f16,{options:_0x510e78,args:_0x5ddd88,tdx:_0x137c3d}=_0x1bdcd1,_0xcc5a8f=this[_0x2692dc(0x150)](_0x5ddd88,_0x510e78);if(!_0xcc5a8f)return 0x1;_0x510e78[_0x2692dc(0x289)]&&console['error'](_0x2692dc(0x18b)+_0xcc5a8f);const _0x2eac63=await withSpinner(_0x2692dc(0x149),()=>_0x137c3d['workflow']['listSecrets'](_0xcc5a8f),{'verbose':_0x510e78[_0x2692dc(0x289)]}),{secrets:_0x23f974}=_0x2eac63[_0x2692dc(0x1e9)];return console[_0x2692dc(0x158)](_0x2692dc(0x25a)+_0x23f974[_0x2692dc(0x1cf)]+_0x2692dc(0x209)+(_0x23f974[_0x2692dc(0x1cf)]!==0x1?'s':'')),await handleSDKOutput(_0x23f974,_0x510e78),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a52_0x525f16(0x29e)]=a52_0x525f16(0x182);[a52_0x525f16(0x12b)]='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async[a52_0x525f16(0x221)](_0x47108e){const _0x160d20=a52_0x525f16,{options:_0x238963,args:_0xa3d843,tdx:_0x5dec1f}=_0x47108e;let _0x183bb8,_0x334f72;if(_0xa3d843[_0x160d20(0x1cf)]>=0x1&&!_0xa3d843[0x0][_0x160d20(0x2a4)]('='))_0x183bb8=_0xa3d843[0x0],_0x334f72=_0xa3d843[_0x160d20(0x24c)](0x1);else{if(_0xa3d843[_0x160d20(0x1cf)]>=0x1&&_0x238963[_0x160d20(0x204)])_0x183bb8=_0x238963['workflowProject'],_0x334f72=_0xa3d843;else return _0xa3d843[_0x160d20(0x1cf)]>=0x1?(console[_0x160d20(0x158)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x160d20(0x158)](_0x160d20(0x257)),0x1):(console[_0x160d20(0x158)](_0x160d20(0x128)),console[_0x160d20(0x158)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1);}if(_0x334f72[_0x160d20(0x1cf)]===0x0)return console[_0x160d20(0x158)](_0x160d20(0x128)),console[_0x160d20(0x158)](_0x160d20(0x213)),0x1;const _0x364d4f={};try{for(const _0x33bd44 of _0x334f72){const {key:_0x243442,value:_0x421899}=parseKeyValue(_0x33bd44);_0x364d4f[_0x243442]=_0x421899;}}catch(_0x59c2ea){return _0x59c2ea instanceof Error&&console['error'](a52_0x5c395f[_0x160d20(0x29b)](_0x160d20(0x28f)),_0x59c2ea['message']),0x1;}const _0x4491c0=Object[_0x160d20(0x25d)](_0x364d4f);_0x238963[_0x160d20(0x289)]&&(console['error'](_0x160d20(0x18b)+_0x183bb8),console[_0x160d20(0x158)]('Secrets\x20to\x20set:\x20'+_0x4491c0[_0x160d20(0x13b)](',\x20')));const _0x3133e9=await withSpinner(_0x4491c0['length']===0x1?_0x160d20(0x25b):_0x160d20(0x1b5)+_0x4491c0[_0x160d20(0x1cf)]+'\x20secrets...',()=>_0x5dec1f[_0x160d20(0x207)][_0x160d20(0x288)](_0x183bb8,_0x364d4f),{'verbose':_0x238963[_0x160d20(0x289)]}),_0x4ae71d=_0x3133e9[_0x160d20(0x1e9)];return console[_0x160d20(0x158)](_0x4491c0[_0x160d20(0x1cf)]===0x1?_0x160d20(0x219)+_0x4ae71d[_0x160d20(0x25d)][0x0]+_0x160d20(0x135)+_0x4ae71d[_0x160d20(0x140)]+'\x27':'✔\x20'+_0x4ae71d[_0x160d20(0x25d)][_0x160d20(0x1cf)]+_0x160d20(0x16e)+_0x4ae71d[_0x160d20(0x140)]+'\x27'),(_0x238963[_0x160d20(0x251)]||_0x238963[_0x160d20(0x1fd)])&&await handleSingleObjectOutput(_0x4ae71d,_0x238963),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a52_0x525f16(0x29e)]=a52_0x525f16(0x1c2);['description']=a52_0x525f16(0x132);async[a52_0x525f16(0x221)](_0x17da0f){const _0x4ffcf2=a52_0x525f16,{options:_0x2b3e28,args:_0x481f95,tdx:_0x39c013}=_0x17da0f;let _0x135c90,_0x5a14b2;if(_0x481f95['length']>=0x2)_0x135c90=_0x481f95[0x0],_0x5a14b2=_0x481f95[0x1];else{if(_0x481f95[_0x4ffcf2(0x1cf)]===0x1&&_0x2b3e28[_0x4ffcf2(0x204)])_0x135c90=_0x2b3e28[_0x4ffcf2(0x204)],_0x5a14b2=_0x481f95[0x0];else return _0x481f95[_0x4ffcf2(0x1cf)]===0x1?(console[_0x4ffcf2(0x158)](_0x4ffcf2(0x20f)),console[_0x4ffcf2(0x158)](_0x4ffcf2(0x257)),0x1):(console[_0x4ffcf2(0x158)]('Error:\x20Secret\x20key\x20is\x20required'),console[_0x4ffcf2(0x158)](_0x4ffcf2(0x1f3)),0x1);}_0x2b3e28[_0x4ffcf2(0x289)]&&(console['error'](_0x4ffcf2(0x18b)+_0x135c90),console[_0x4ffcf2(0x158)](_0x4ffcf2(0x230)+_0x5a14b2));if(!_0x2b3e28[_0x4ffcf2(0x13a)]){if(!isInteractive())return console[_0x4ffcf2(0x158)](a52_0x5c395f[_0x4ffcf2(0x29b)](_0x4ffcf2(0x1cb)),_0x4ffcf2(0x1ea)),console[_0x4ffcf2(0x158)](a52_0x5c395f['dim'](_0x4ffcf2(0x2b9))),0x1;const _0x3f9266=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x5a14b2+'\x27\x20from\x20project\x20\x27'+_0x135c90+'\x27?');if(!_0x3f9266)return console[_0x4ffcf2(0x158)](a52_0x5c395f[_0x4ffcf2(0x17b)](_0x4ffcf2(0x122))),0x1;}const _0x46f43a=await withSpinner(_0x4ffcf2(0x1c9),()=>_0x39c013['workflow'][_0x4ffcf2(0x270)](_0x135c90,_0x5a14b2),{'verbose':_0x2b3e28[_0x4ffcf2(0x289)]}),_0x3fbb15=_0x46f43a[_0x4ffcf2(0x1e9)];return console[_0x4ffcf2(0x158)](_0x4ffcf2(0x219)+_0x3fbb15[_0x4ffcf2(0x187)]+_0x4ffcf2(0x1fa)+_0x3fbb15['projectName']+'\x27'),(_0x2b3e28['json']||_0x2b3e28[_0x4ffcf2(0x1fd)])&&await handleSingleObjectOutput(_0x3fbb15,_0x2b3e28),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(_0x5833f3){const _0x254484=a52_0x525f16,_0x22e8cc=Math[_0x254484(0x15d)](_0x5833f3/0x3e8),_0xcf5e5a=Math[_0x254484(0x15d)](_0x22e8cc/0x3c),_0x1f623f=Math[_0x254484(0x15d)](_0xcf5e5a/0x3c),_0x16403f=Math[_0x254484(0x15d)](_0x1f623f/0x18);if(_0x16403f>0x0){const _0x40308e=_0x1f623f%0x18;return _0x40308e>0x0?_0x16403f+'d\x20'+_0x40308e+'h':_0x16403f+'d';}else{if(_0x1f623f>0x0){const _0x5e32b3=_0xcf5e5a%0x3c;return _0x5e32b3>0x0?_0x1f623f+'h\x20'+_0x5e32b3+'m':_0x1f623f+'h';}else{if(_0xcf5e5a>0x0){const _0x1ff4e4=_0x22e8cc%0x3c;return _0x1ff4e4>0x0?_0xcf5e5a+'m\x20'+_0x1ff4e4+'s':_0xcf5e5a+'m';}else return _0x22e8cc+'s';}}}function formatTimestamp(_0x541060,_0x436408){const _0x458d20=a52_0x525f16,_0x4ae25a=new Date(_0x541060),_0x248188=String(_0x4ae25a[_0x458d20(0x237)]())['padStart'](0x2,'0'),_0x57ed91=String(_0x4ae25a[_0x458d20(0x200)]())['padStart'](0x2,'0'),_0x4f264e=_0x248188+':'+_0x57ed91,_0x29e4f3=_0x4ae25a[_0x458d20(0x1e2)]()===_0x436408['getFullYear']()&&_0x4ae25a[_0x458d20(0x21b)]()===_0x436408[_0x458d20(0x21b)]()&&_0x4ae25a[_0x458d20(0x28d)]()===_0x436408['getDate']();if(_0x29e4f3)return _0x4f264e;else{const _0x273756=String(_0x4ae25a[_0x458d20(0x21b)]()+0x1)[_0x458d20(0x27e)](0x2,'0'),_0x42e50f=String(_0x4ae25a[_0x458d20(0x28d)]())[_0x458d20(0x27e)](0x2,'0');return _0x273756+'-'+_0x42e50f+'\x20'+_0x4f264e;}}function formatDate(_0xf12d12){const _0x18c984=a52_0x525f16,_0x556de8=_0xf12d12[_0x18c984(0x1e2)](),_0x1b1ca5=String(_0xf12d12['getMonth']()+0x1)[_0x18c984(0x27e)](0x2,'0'),_0x4887e4=String(_0xf12d12[_0x18c984(0x28d)]())[_0x18c984(0x27e)](0x2,'0');return _0x556de8+'-'+_0x1b1ca5+'-'+_0x4887e4;}function getTaskStateIcon(_0x350b58){const _0x219961={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x219961[_0x350b58]||'⚪';}function getBarChar(_0x5e25b5){const _0x34de20=a52_0x525f16;return _0x5e25b5===_0x34de20(0x158)||_0x5e25b5===_0x34de20(0x220)?'×':'─';}function getBarColor(_0x23406f){const _0x1c4961=a52_0x525f16,_0x2e0aee={'success':a52_0x5c395f[_0x1c4961(0x293)],'error':a52_0x5c395f['red'],'group_error':a52_0x5c395f[_0x1c4961(0x29b)],'running':a52_0x5c395f[_0x1c4961(0x1ee)],'blocked':a52_0x5c395f['yellow'],'planned':a52_0x5c395f['dim'],'canceling':a52_0x5c395f[_0x1c4961(0x17b)]};return _0x2e0aee[_0x23406f]||a52_0x5c395f['white'];}function parseTaskName(_0x549d66){const _0x210a37=a52_0x525f16;let _0x4df725=_0x549d66[_0x210a37(0x19c)](/^\++/,'');const _0x5b8d40=_0x4df725[_0x210a37(0x1d4)]('+'),_0x5bac19=_0x5b8d40[_0x210a37(0x1cf)]>0x1?_0x5b8d40[_0x210a37(0x1cf)]-0x2:0x0,_0x1d60a1=_0x5b8d40[_0x5b8d40['length']-0x1]||_0x4df725;return{'level':_0x5bac19,'name':'+'+_0x1d60a1};}function truncateTaskName(_0xebacdf,_0x52ad1f){const _0x558d98=a52_0x525f16,_0x401abc=stringWidth(_0xebacdf);if(_0x401abc<=_0x52ad1f)return _0xebacdf;let _0x1824b9=_0xebacdf;while(stringWidth(_0x1824b9+'…')>_0x52ad1f&&_0x1824b9[_0x558d98(0x1cf)]>0x0){_0x1824b9=_0x1824b9[_0x558d98(0x24c)](0x0,-0x1);}return _0x1824b9+'…';}function calculateTimeScale(_0x2fef19,_0x488dc4){const _0x49e51a=a52_0x525f16;return{'startTime':_0x2fef19[_0x49e51a(0x2ca)],'endTime':_0x2fef19[_0x49e51a(0x1ef)],'durationMs':_0x2fef19[_0x49e51a(0x2a7)],'msPerChar':_0x2fef19[_0x49e51a(0x2a7)]/_0x488dc4};}function timeToPosition(_0x51ff0c,_0x5ac92b,_0x47d611){const _0x2eee45=a52_0x525f16,_0x1c7fdf=_0x51ff0c-_0x5ac92b[_0x2eee45(0x2b6)],_0x437eff=Math['floor'](_0x1c7fdf/_0x5ac92b['msPerChar']);return Math[_0x2eee45(0x1a3)](0x0,Math[_0x2eee45(0x141)](_0x437eff,_0x47d611));}function renderTimeAxis(_0x5a3b4d,_0x7b21f8){const _0x2e9e1b=a52_0x525f16,_0x58ea34=Math[_0x2e9e1b(0x141)](TIMELINE_CONFIG[_0x2e9e1b(0x29d)],Math[_0x2e9e1b(0x1a3)](TIMELINE_CONFIG[_0x2e9e1b(0x2cb)],Math['floor'](_0x7b21f8/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x3cc540=_0x5a3b4d[_0x2e9e1b(0x1ab)]/(_0x58ea34-0x1),_0x2f13e7=new Date(_0x5a3b4d[_0x2e9e1b(0x2b6)]),_0x40f16b=[];for(let _0x1bd68a=0x0;_0x1bd68a<_0x58ea34;_0x1bd68a++){const _0x4edbe3=_0x5a3b4d[_0x2e9e1b(0x2b6)]+_0x1bd68a*_0x3cc540,_0x12b626=timeToPosition(_0x4edbe3,_0x5a3b4d,_0x7b21f8),_0x5070ea=formatTimestamp(_0x4edbe3,_0x2f13e7);_0x40f16b[_0x2e9e1b(0x21a)]({'pos':_0x12b626,'text':_0x5070ea});}const _0x519a08=new Array(_0x7b21f8)[_0x2e9e1b(0x1d1)]('\x20');let _0x40afe5=-0x1;for(const {pos:_0x3a062a,text:_0x221331}of _0x40f16b){let _0x27f68f=Math[_0x2e9e1b(0x1a3)](0x0,_0x3a062a-Math[_0x2e9e1b(0x15d)](_0x221331[_0x2e9e1b(0x1cf)]/0x2));_0x27f68f<=_0x40afe5+TIMELINE_CONFIG[_0x2e9e1b(0x2c8)]&&(_0x27f68f=_0x40afe5+TIMELINE_CONFIG[_0x2e9e1b(0x2c8)]+0x1);_0x27f68f+_0x221331['length']>_0x7b21f8&&(_0x27f68f=_0x7b21f8-_0x221331[_0x2e9e1b(0x1cf)]);if(_0x27f68f>=0x0&&_0x27f68f+_0x221331[_0x2e9e1b(0x1cf)]<=_0x7b21f8&&_0x27f68f>_0x40afe5){for(let _0x203544=0x0;_0x203544<_0x221331['length'];_0x203544++){_0x519a08[_0x27f68f+_0x203544]=_0x221331[_0x203544];}_0x40afe5=_0x27f68f+_0x221331[_0x2e9e1b(0x1cf)]-0x1;}}return _0x519a08[_0x2e9e1b(0x13b)]('');}function renderTaskRow(_0xb906f,_0x20ba23,_0x5cf449,_0x24ee5e){const _0xc66d88=a52_0x525f16,{level:_0xad3fd9,name:_0x2bb27e}=parseTaskName(_0xb906f[_0xc66d88(0x29e)]),_0x203d83='\x20'['repeat'](_0xad3fd9),_0x31d80f=_0xb906f['window']?'('+formatElapsed(_0xb906f[_0xc66d88(0x261)][_0xc66d88(0x2a7)])+')':'',_0x537a3d=stringWidth(_0x31d80f),_0x36c2d1=_0xad3fd9*0x1,_0xd3d005=_0x24ee5e-_0x36c2d1-_0x537a3d-0x1,_0x39b4cc=truncateTaskName(_0x2bb27e,_0xd3d005),_0x538ccb=_0x203d83+_0x39b4cc,_0x216e73=stringWidth(_0x538ccb),_0x43d9ab=_0x24ee5e-_0x216e73-_0x537a3d,_0x1ceea4=_0x538ccb+'\x20'[_0xc66d88(0x11d)](Math[_0xc66d88(0x1a3)](0x1,_0x43d9ab))+a52_0x5c395f[_0xc66d88(0x20e)](_0x31d80f),_0x4d9f44=getTaskStateIcon(_0xb906f[_0xc66d88(0x208)]),_0x376916=new Array(_0x5cf449)['fill']('\x20');if(_0xb906f[_0xc66d88(0x261)]){const _0x3fa88b=timeToPosition(_0xb906f[_0xc66d88(0x261)][_0xc66d88(0x2ca)],_0x20ba23,_0x5cf449),_0x1d5b4d=timeToPosition(_0xb906f[_0xc66d88(0x261)][_0xc66d88(0x1ef)],_0x20ba23,_0x5cf449),_0x41766c=getBarChar(_0xb906f[_0xc66d88(0x208)]),_0x52fbc3=Math[_0xc66d88(0x1a3)](_0x3fa88b+0x1,_0x1d5b4d);for(let _0x3584e8=_0x3fa88b;_0x3584e8<Math[_0xc66d88(0x141)](_0x52fbc3,_0x5cf449);_0x3584e8++){_0x376916[_0x3584e8]=_0x41766c;}}const _0x26e1b9=getBarColor(_0xb906f['state']),_0x386906=_0x376916[_0xc66d88(0x174)](_0x2dbc4d=>_0x2dbc4d==='\x20'?'\x20':_0x26e1b9(_0x2dbc4d))[_0xc66d88(0x13b)]('');return _0x4d9f44+'\x20'+_0x1ceea4+'│'+_0x386906+'│';}function calculateStats(_0xbd5532){const _0x1bfe02=a52_0x525f16,_0xed68e3={'total':_0xbd5532[_0x1bfe02(0x1cf)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x5111d4 of _0xbd5532){if(_0x5111d4[_0x1bfe02(0x208)]==='success')_0xed68e3[_0x1bfe02(0x2a0)]++;else{if(_0x5111d4['state']===_0x1bfe02(0x158)||_0x5111d4[_0x1bfe02(0x208)]==='group_error')_0xed68e3[_0x1bfe02(0x158)]++;else _0x5111d4['state']==='running'?_0xed68e3[_0x1bfe02(0x152)]++:_0xed68e3[_0x1bfe02(0x1e0)]++;}}return _0xed68e3;}function formatStats(_0x844ad4){const _0x5aebf0=a52_0x525f16;return[_0x5aebf0(0x17a)+_0x844ad4[_0x5aebf0(0x16d)],'✅\x20'+_0x844ad4[_0x5aebf0(0x2a0)],'❌\x20'+_0x844ad4['error'],_0x5aebf0(0x24e)+_0x844ad4[_0x5aebf0(0x152)],'⏳\x20'+_0x844ad4[_0x5aebf0(0x1e0)]][_0x5aebf0(0x13b)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a52_0x525f16(0x224);[a52_0x525f16(0x12b)]=a52_0x525f16(0x14e);async['execute'](_0x23fd51){const _0x58d3bc=a52_0x525f16,{options:_0x4810ce,args:_0x25048a,tdx:_0x2afe1e}=_0x23fd51;let _0x5deb3a,_0x2ea4ed,_0x2ee41d=![];if(_0x25048a[0x0]){if(_0x25048a[0x0][_0x58d3bc(0x2a4)]('.')){const _0x19577a=this[_0x58d3bc(0x263)](_0x25048a,_0x4810ce);if(!_0x19577a)return 0x1;_0x5deb3a=_0x19577a['projectName'],_0x2ea4ed=_0x19577a['workflowName'];}else{_0x2ea4ed=_0x25048a[0x0],_0x5deb3a=_0x4810ce['workflowProject'];if(!_0x5deb3a)return console[_0x58d3bc(0x158)](a52_0x5c395f[_0x58d3bc(0x29b)](_0x58d3bc(0x28f)),_0x58d3bc(0x246)),0x1;_0x2ee41d=!![];}}else{const _0x532ddd=this[_0x58d3bc(0x263)](_0x25048a,_0x4810ce);if(!_0x532ddd)return 0x1;_0x5deb3a=_0x532ddd[_0x58d3bc(0x140)],_0x2ea4ed=_0x532ddd[_0x58d3bc(0x226)];}if(_0x4810ce['verbose']){if(_0x5deb3a&&_0x2ea4ed)console['error'](_0x58d3bc(0x1cd)+_0x5deb3a+'.'+_0x2ea4ed);else _0x5deb3a&&console[_0x58d3bc(0x158)](_0x58d3bc(0x2b5)+_0x5deb3a);}const _0x260d52=_0x4810ce[_0x58d3bc(0x16b)],_0x35e171=_0x4810ce['sessionId'];if(_0x260d52){_0x35e171&&console['error'](a52_0x5c395f[_0x58d3bc(0x17b)](_0x58d3bc(0x250)),_0x58d3bc(0x1e1));const _0x3ebf9c=_0x4810ce[_0x58d3bc(0x14b)];return _0x3ebf9c?await this[_0x58d3bc(0x1bb)](_0x23fd51,_0x260d52):await this[_0x58d3bc(0x157)](_0x23fd51,_0x260d52,_0x4810ce),0x0;}if(_0x35e171){const _0x3183c4=await withSpinner('Loading\x20session...',()=>_0x2afe1e['workflow'][_0x58d3bc(0x13d)]({'projectName':_0x5deb3a,'workflowName':_0x2ea4ed,'limit':0x64}),{'verbose':_0x4810ce['verbose']}),_0x329b6a=_0x3183c4['data'][_0x58d3bc(0x198)](_0x4f14d7=>_0x4f14d7['id']===_0x35e171);if(!_0x329b6a)return console[_0x58d3bc(0x158)](a52_0x5c395f['red']('Error:'),_0x58d3bc(0x247)+_0x35e171),0x1;if(!_0x329b6a[_0x58d3bc(0x163)]?.['id'])return console[_0x58d3bc(0x158)](a52_0x5c395f['red'](_0x58d3bc(0x28f)),'Session\x20'+_0x35e171+'\x20has\x20no\x20attempts'),0x1;const _0x3c3e17=_0x329b6a['lastAttempt']['id'];_0x4810ce[_0x58d3bc(0x289)]&&console[_0x58d3bc(0x158)](_0x58d3bc(0x1eb)+_0x3c3e17+'\x20from\x20session\x20'+_0x35e171);const _0x28c060=_0x4810ce[_0x58d3bc(0x14b)];return _0x28c060?await this[_0x58d3bc(0x1bb)](_0x23fd51,_0x3c3e17):await this[_0x58d3bc(0x157)](_0x23fd51,_0x3c3e17,_0x4810ce),0x0;}const _0x4bbee7=await withSpinner(_0x58d3bc(0x17d),()=>_0x2afe1e[_0x58d3bc(0x207)][_0x58d3bc(0x13d)]({'projectName':_0x5deb3a,'workflowName':_0x2ea4ed,'limit':_0x4810ce[_0x58d3bc(0x19d)]||0x32}),{'verbose':_0x4810ce['verbose']}),_0x1caaed=_0x4bbee7[_0x58d3bc(0x1e9)];if(_0x1caaed[_0x58d3bc(0x1cf)]===0x0){if(_0x5deb3a&&_0x2ea4ed)console['error']('No\x20sessions\x20found\x20for:\x20'+_0x5deb3a+'.'+_0x2ea4ed);else _0x5deb3a?console[_0x58d3bc(0x158)](_0x58d3bc(0x1ff)+_0x5deb3a):(console[_0x58d3bc(0x158)](_0x58d3bc(0x240)),console[_0x58d3bc(0x158)](a52_0x5c395f[_0x58d3bc(0x20e)](_0x58d3bc(0x180))));return 0x0;}_0x1caaed[_0x58d3bc(0x2bc)]((_0x325dd7,_0x5bff88)=>{const _0x3b99c9=_0x58d3bc,_0x2e559e=_0x325dd7[_0x3b99c9(0x139)]||'',_0x332929=_0x5bff88['sessionTime']||'';return _0x332929[_0x3b99c9(0x136)](_0x2e559e);});if(_0x4810ce[_0x58d3bc(0x251)]||_0x4810ce[_0x58d3bc(0x1fd)])return await handleSDKOutput(_0x1caaed,_0x4810ce),0x0;let _0x255dd2;if(_0x2ee41d){const _0x1507cb=_0x1caaed[0x0];if(!_0x1507cb['lastAttempt']?.['id'])return console[_0x58d3bc(0x158)](_0x58d3bc(0x225)),0x0;_0x255dd2=_0x1507cb[_0x58d3bc(0x163)]['id'],_0x4810ce[_0x58d3bc(0x289)]&&console[_0x58d3bc(0x158)](_0x58d3bc(0x1d3)+_0x1507cb['sessionTime']);}else{const _0x1babec=_0x1caaed['map'](_0x552ece=>{const _0x276eaf=_0x58d3bc,_0x49a1a5=getAttemptStatusDisplay(_0x552ece[_0x276eaf(0x163)]);return{'title':_0x552ece[_0x276eaf(0x2ba)]?.[_0x276eaf(0x29e)]+'.'+_0x552ece['workflow']?.[_0x276eaf(0x29e)]+'\x20-\x20'+_0x552ece['sessionTime']+'\x20'+_0x49a1a5[_0x276eaf(0x27d)],'value':_0x552ece[_0x276eaf(0x163)]?.['id']||'','description':_0x49a1a5[_0x276eaf(0x2b0)]};}),_0x171155=await a52_0x5682a4({'type':_0x58d3bc(0x280),'name':_0x58d3bc(0x16b),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x1babec[_0x58d3bc(0x2b2)](_0x2b77d2=>_0x2b77d2[_0x58d3bc(0x1f6)]!=='')});if(!_0x171155[_0x58d3bc(0x16b)])return 0x0;_0x255dd2=_0x171155[_0x58d3bc(0x16b)];}const _0x2d58e2=_0x4810ce[_0x58d3bc(0x14b)];return _0x2d58e2?await this['pollTimeline'](_0x23fd51,_0x255dd2):await this[_0x58d3bc(0x157)](_0x23fd51,_0x255dd2,_0x4810ce),0x0;}async[a52_0x525f16(0x157)](_0x476cb4,_0x4e1bfe,_0x33126c){const _0x5caca8=a52_0x525f16,{tdx:_0x4a6d74}=_0x476cb4;let _0x11c5bf,_0x113e56;try{[_0x11c5bf,_0x113e56]=await Promise[_0x5caca8(0x1f7)]([_0x4a6d74[_0x5caca8(0x207)]['attempt'](_0x4e1bfe),_0x4a6d74[_0x5caca8(0x207)][_0x5caca8(0x13f)](_0x4e1bfe,![])]);}catch(_0xc02e6b){console[_0x5caca8(0x158)](a52_0x5c395f[_0x5caca8(0x29b)](_0x5caca8(0x1c0)));_0x33126c['verbose']&&console[_0x5caca8(0x158)](_0xc02e6b);throw _0xc02e6b;}if(_0x33126c[_0x5caca8(0x251)]||_0x33126c[_0x5caca8(0x1fd)]){const _0x505998=this[_0x5caca8(0x262)](_0x11c5bf,_0x113e56);await handleSDKOutput([_0x505998],_0x33126c);return;}const _0x4276d6=_0x4a6d74[_0x5caca8(0x294)][_0x5caca8(0x299)],_0x2c6b23=this['renderTimeline'](_0x11c5bf,_0x113e56,_0x4276d6);console[_0x5caca8(0x14d)](_0x2c6b23);}async[a52_0x525f16(0x1bb)](_0x258ce3,_0xb2c6bc){const _0x573dcd=a52_0x525f16,{tdx:_0x510292}=_0x258ce3,_0x17b60c=TIMELINE_CONFIG[_0x573dcd(0x276)],_0x4846d2=TIMELINE_CONFIG[_0x573dcd(0x229)];let _0x599499=0x0;while(_0x599499<_0x4846d2){process[_0x573dcd(0x210)][_0x573dcd(0x14f)]&&process[_0x573dcd(0x210)][_0x573dcd(0x126)]('\x1bc');let _0x3a5e14,_0x23fe4b;try{[_0x3a5e14,_0x23fe4b]=await Promise[_0x573dcd(0x1f7)]([_0x510292[_0x573dcd(0x207)][_0x573dcd(0x206)](_0xb2c6bc),_0x510292[_0x573dcd(0x207)][_0x573dcd(0x13f)](_0xb2c6bc,![])]);}catch(_0x2d44e5){console[_0x573dcd(0x158)](a52_0x5c395f[_0x573dcd(0x29b)](_0x573dcd(0x2a5)));_0x599499>0x0&&console['error'](a52_0x5c395f[_0x573dcd(0x20e)](_0x573dcd(0x1c3)+_0x599499));throw _0x2d44e5;}const _0x1b1e5c=_0x510292[_0x573dcd(0x294)]['site'],_0x12d966=this[_0x573dcd(0x273)](_0x3a5e14,_0x23fe4b,_0x1b1e5c);console[_0x573dcd(0x14d)](_0x12d966);const _0x197bf8=_0x3a5e14[_0x573dcd(0x1d0)]&&_0x23fe4b[_0x573dcd(0x142)](_0x17ab00=>_0x17ab00[_0x573dcd(0x208)]!==_0x573dcd(0x152)&&_0x17ab00[_0x573dcd(0x208)]!=='planned');if(_0x197bf8){console[_0x573dcd(0x158)](a52_0x5c395f[_0x573dcd(0x293)](_0x573dcd(0x15e)));break;}console['error'](a52_0x5c395f[_0x573dcd(0x20e)]('\x0aPolling...\x20('+_0x599499*0x2+_0x573dcd(0x2a8))),await new Promise(_0x323c69=>setTimeout(_0x323c69,_0x17b60c)),_0x599499++;}_0x599499>=_0x4846d2&&console[_0x573dcd(0x158)](a52_0x5c395f[_0x573dcd(0x17b)](_0x573dcd(0x194)));}[a52_0x525f16(0x273)](_0x2a8a43,_0x1e26ec,_0x5b8d3c){const _0x31bdf1=a52_0x525f16,_0x3e3460=[],_0xaf5bba=TIMELINE_CONFIG[_0x31bdf1(0x27c)],_0x523925=0x5,_0x2dd66a=process[_0x31bdf1(0x210)]['columns']||0x78,_0x16a1bf=_0x2dd66a-_0xaf5bba-_0x523925,_0x39b17c=Math['max'](TIMELINE_CONFIG['MIN_TIMELINE_WIDTH'],Math[_0x31bdf1(0x141)](_0x16a1bf,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x1391e6=new Date(_0x2a8a43[_0x31bdf1(0x22c)])['getTime'](),_0x56dac1=_0x2a8a43['finishedAt']?new Date(_0x2a8a43[_0x31bdf1(0x1c1)])[_0x31bdf1(0x16a)]():Date[_0x31bdf1(0x19b)](),_0x364a71={'start':_0x1391e6,'end':_0x56dac1,'duration':_0x56dac1-_0x1391e6},_0x4ca0df=new Map(),_0x563bc4=[];for(const _0x18f788 of _0x1e26ec){if(_0x18f788[_0x31bdf1(0x1dd)]){const _0x5712a0=new Date(_0x18f788[_0x31bdf1(0x1dd)])[_0x31bdf1(0x16a)](),_0x5ba3c3=_0x18f788[_0x31bdf1(0x173)]?new Date(_0x18f788[_0x31bdf1(0x173)])[_0x31bdf1(0x16a)]():Date['now'](),_0x37277a={'start':_0x5712a0,'end':_0x5ba3c3,'duration':_0x5ba3c3-_0x5712a0};_0x4ca0df['set'](_0x18f788['id'],_0x37277a),_0x563bc4[_0x31bdf1(0x21a)]({'name':_0x18f788[_0x31bdf1(0x264)],'state':_0x18f788[_0x31bdf1(0x208)]||'unknown','window':_0x37277a});}else _0x563bc4[_0x31bdf1(0x21a)]({'name':_0x18f788[_0x31bdf1(0x264)],'state':_0x18f788[_0x31bdf1(0x208)]||'planned','window':undefined});}_0x563bc4[_0x31bdf1(0x2bc)]((_0x3af75d,_0x5be7e8)=>{const _0x533337=_0x31bdf1;if(!_0x3af75d[_0x533337(0x261)])return 0x1;if(!_0x5be7e8[_0x533337(0x261)])return-0x1;return _0x3af75d[_0x533337(0x261)]['start']-_0x5be7e8[_0x533337(0x261)][_0x533337(0x2ca)];});const _0x31e2df=_0x563bc4[_0x31bdf1(0x1cf)],_0x3aeb23=_0x31e2df>TIMELINE_CONFIG[_0x31bdf1(0x26e)];_0x3aeb23&&_0x563bc4['splice'](TIMELINE_CONFIG[_0x31bdf1(0x26e)]);const _0x166ca2=calculateTimeScale(_0x364a71,_0x39b17c),_0x906646=_0x2a8a43['done']?_0x2a8a43[_0x31bdf1(0x2a0)]?a52_0x5c395f[_0x31bdf1(0x293)](_0x31bdf1(0x2a0)):a52_0x5c395f[_0x31bdf1(0x29b)](_0x31bdf1(0x158)):a52_0x5c395f[_0x31bdf1(0x1ee)](_0x31bdf1(0x152)),_0x5c56b6=_0x2a8a43[_0x31bdf1(0x2ba)]?.['id'],_0x23d5ef=_0x2a8a43[_0x31bdf1(0x252)];let _0x5b6f01;if(_0x5c56b6&&_0x23d5ef){const _0x5c98e6=getWorkflowAttemptUrl(_0x5b8d3c,_0x5c56b6,_0x23d5ef,_0x2a8a43['id']);_0x5b6f01=hyperlink(a52_0x5c395f[_0x31bdf1(0x20e)](_0x2a8a43['id']),_0x5c98e6);}else _0x5b6f01=a52_0x5c395f[_0x31bdf1(0x20e)](_0x2a8a43['id']);_0x3e3460[_0x31bdf1(0x21a)](_0x31bdf1(0x297)+_0x5b6f01+_0x31bdf1(0x181)+_0x906646+'\x20-\x20'+formatElapsed(_0x364a71[_0x31bdf1(0x2a7)]));if(_0x563bc4[_0x31bdf1(0x1cf)]>0x0){const _0x5ece64=renderTimeAxis(_0x166ca2,_0x39b17c),_0x51962f=new Date(_0x364a71['start']),_0x41172b=formatDate(_0x51962f),_0x2e9612=TIMELINE_CONFIG[_0x31bdf1(0x216)]+TIMELINE_CONFIG['ICON_SPACING']+_0xaf5bba,_0x5b02d4=_0x41172b[_0x31bdf1(0x27e)](_0x2e9612),_0x3501b3=a52_0x5c395f[_0x31bdf1(0x20e)](_0x5b02d4);_0x3e3460[_0x31bdf1(0x21a)](_0x3501b3+'\x20'+_0x5ece64);for(const _0x1f976c of _0x563bc4){_0x3e3460[_0x31bdf1(0x21a)](renderTaskRow(_0x1f976c,_0x166ca2,_0x39b17c,_0xaf5bba));}const _0x537a90=calculateStats(_0x563bc4);_0x3e3460[_0x31bdf1(0x21a)](formatStats(_0x537a90)),_0x3aeb23&&_0x3e3460[_0x31bdf1(0x21a)](a52_0x5c395f[_0x31bdf1(0x17b)](_0x31bdf1(0x202)+TIMELINE_CONFIG[_0x31bdf1(0x26e)]+_0x31bdf1(0x191)+_0x31e2df+_0x31bdf1(0x2c2))),_0x3e3460[_0x31bdf1(0x21a)](''),_0x3e3460['push'](a52_0x5c395f[_0x31bdf1(0x20e)](_0x31bdf1(0x215))+(_0x31bdf1(0x2ad)+_0x2a8a43['id']+_0x31bdf1(0x1bf))+a52_0x5c395f['dim'](_0x31bdf1(0x1b7)));}else _0x3e3460['push'](_0x31bdf1(0x188));return _0x3e3460[_0x31bdf1(0x13b)]('\x0a');}[a52_0x525f16(0x262)](_0x5d18c7,_0x3e48a1){const _0x2351a0=a52_0x525f16,_0xe51f95=new Date(_0x5d18c7['createdAt'])[_0x2351a0(0x16a)](),_0x246480=_0x5d18c7[_0x2351a0(0x1c1)]?new Date(_0x5d18c7[_0x2351a0(0x1c1)])[_0x2351a0(0x16a)]():Date[_0x2351a0(0x19b)](),_0x127250=_0x246480-_0xe51f95,_0x80be59=[];for(const _0x311176 of _0x3e48a1){if(_0x311176[_0x2351a0(0x1dd)]){const _0xdfed32=new Date(_0x311176[_0x2351a0(0x1dd)])[_0x2351a0(0x16a)](),_0x1578e8=_0x311176['updatedAt']?new Date(_0x311176['updatedAt'])[_0x2351a0(0x16a)]():Date[_0x2351a0(0x19b)]();_0x80be59[_0x2351a0(0x21a)]({'name':_0x311176[_0x2351a0(0x264)],'state':_0x311176[_0x2351a0(0x208)]||_0x2351a0(0x267),'window':{'start':_0xdfed32,'end':_0x1578e8,'duration':_0x1578e8-_0xdfed32}});}else _0x80be59[_0x2351a0(0x21a)]({'name':_0x311176[_0x2351a0(0x264)],'state':_0x311176[_0x2351a0(0x208)]||_0x2351a0(0x1aa),'window':undefined});}const _0x230c40=calculateStats(_0x80be59);return{'attempt':{'id':_0x5d18c7['id'],'status':_0x5d18c7[_0x2351a0(0x1d0)]?_0x5d18c7[_0x2351a0(0x2a0)]?_0x2351a0(0x2a0):'error':_0x2351a0(0x152),'createdAt':_0x5d18c7['createdAt'],'finishedAt':_0x5d18c7[_0x2351a0(0x1c1)],'duration_ms':_0x127250},'tasks':_0x80be59[_0x2351a0(0x174)](_0x16b0d0=>({'name':_0x16b0d0[_0x2351a0(0x29e)],'state':_0x16b0d0['state'],'startedAt':_0x16b0d0[_0x2351a0(0x261)]?new Date(_0x16b0d0[_0x2351a0(0x261)][_0x2351a0(0x2ca)])[_0x2351a0(0x169)]():null,'updatedAt':_0x16b0d0[_0x2351a0(0x261)]?new Date(_0x16b0d0[_0x2351a0(0x261)][_0x2351a0(0x1ef)])[_0x2351a0(0x169)]():null,'duration_ms':_0x16b0d0[_0x2351a0(0x261)]?.['duration']||null})),'stats':_0x230c40};}}
|
|
1
|
+
const a52_0x56e132=a52_0x3e35;(function(_0x34b21f,_0x32494e){const _0x27ce6d=a52_0x3e35,_0x373570=_0x34b21f();while(!![]){try{const _0x33de18=-parseInt(_0x27ce6d(0x282))/0x1+parseInt(_0x27ce6d(0x16c))/0x2+-parseInt(_0x27ce6d(0x1d0))/0x3+parseInt(_0x27ce6d(0x26d))/0x4*(parseInt(_0x27ce6d(0x2c2))/0x5)+-parseInt(_0x27ce6d(0x2c8))/0x6+parseInt(_0x27ce6d(0x156))/0x7*(parseInt(_0x27ce6d(0x246))/0x8)+-parseInt(_0x27ce6d(0x1f9))/0x9*(-parseInt(_0x27ce6d(0x213))/0xa);if(_0x33de18===_0x32494e)break;else _0x373570['push'](_0x373570['shift']());}catch(_0x252995){_0x373570['push'](_0x373570['shift']());}}}(a52_0x1698,0x7299c));import a52_0x141979 from'chalk';import{existsSync}from'fs';import a52_0x2e86af from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a52_0x39c28f from'prompts';function getAttemptStatusDisplay(_0x1b469a){const _0x3293e2=a52_0x3e35;if(!_0x1b469a)return{'icon':'⏳','text':''};const {done:_0x1d7fc9,success:_0x4661dc,cancelRequested:_0x5757d1}=_0x1b469a;if(!_0x1d7fc9)return _0x5757d1?{'icon':'🛑','text':a52_0x141979[_0x3293e2(0x1cd)](_0x3293e2(0x19f))}:{'icon':'🔄','text':a52_0x141979[_0x3293e2(0x178)](_0x3293e2(0x1ee))};if(_0x4661dc)return{'icon':'✅','text':a52_0x141979['green'](_0x3293e2(0x29f))};return{'icon':'❌','text':a52_0x141979[_0x3293e2(0x258)](_0x3293e2(0x2b7))};}export class WorkflowBaseCommand extends BaseCommand{[a52_0x56e132(0x247)](_0x386398,_0x5c0dfb,_0x4587cf=0x0){const _0x254c7f=a52_0x56e132;return _0x386398[_0x4587cf]||_0x5c0dfb[_0x254c7f(0x135)];}[a52_0x56e132(0x214)](_0x1655f5,_0x56bc37,_0x33d6b2=0x0){const _0x2e89ef=a52_0x56e132,_0x58910d=this[_0x2e89ef(0x247)](_0x1655f5,_0x56bc37,_0x33d6b2);if(!_0x58910d)return console[_0x2e89ef(0x2b7)](a52_0x141979[_0x2e89ef(0x258)](_0x2e89ef(0x2bf)),_0x2e89ef(0x1ec)),console['error'](a52_0x141979['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x58910d;}[a52_0x56e132(0x130)](_0x17a269,_0x3412b7){const _0x3f68d3=a52_0x56e132;if(_0x17a269[0x0]){const _0x2ffc84=_0x17a269[0x0][_0x3f68d3(0x17a)]('.');if(_0x2ffc84[_0x3f68d3(0x18c)]===0x1)return{'projectName':_0x2ffc84[0x0],'workflowName':undefined};else return _0x2ffc84[_0x3f68d3(0x18c)]===0x2?{'projectName':_0x2ffc84[0x0],'workflowName':_0x2ffc84[0x1]}:(console[_0x3f68d3(0x2b7)](a52_0x141979[_0x3f68d3(0x258)](_0x3f68d3(0x2bf)),_0x3f68d3(0x2a7)),null);}return{'projectName':_0x3412b7[_0x3f68d3(0x135)],'workflowName':undefined};}[a52_0x56e132(0x1a6)](_0xd830b4,_0xee1fe3,_0x487a04=0x0){const _0x4b36e2=a52_0x56e132;if(_0xd830b4[_0x487a04])return _0xd830b4[_0x487a04];if(_0xee1fe3['workflowProject']){const _0x182fea=a52_0x2e86af['join'](process['cwd'](),_0x4b36e2(0x2b1),_0xee1fe3['workflowProject']);if(existsSync(a52_0x2e86af['join'](_0x182fea,_0x4b36e2(0x206))))return _0x182fea;}return undefined;}async[a52_0x56e132(0x238)](_0x4debaa,_0x34d65d,_0x316f37){const _0xc52596=a52_0x56e132;try{const _0x1bb582=await _0x4debaa['workflow'][_0xc52596(0x2b1)](_0x34d65d,{'limit':0x1});if(_0x1bb582['length']>0x0){const _0x2abd06=_0x1bb582[0x0]['id'],_0x7fbf6b=getWorkflowUrl(_0x316f37,_0x2abd06);console[_0xc52596(0x2b7)](_0xc52596(0x263)+a52_0x141979[_0xc52596(0x222)](_0x7fbf6b));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a52_0x56e132(0x1c1);[a52_0x56e132(0x2b0)]=a52_0x56e132(0x2c9);async[a52_0x56e132(0x234)](_0x47fefe){const _0x473c03=a52_0x56e132,{options:_0x122a87,args:_0x577f6f,tdx:_0x2eb5b7}=_0x47fefe,_0x190290=_0x577f6f[0x0],_0x547142=_0x122a87[_0x473c03(0x183)];if(_0x547142)return saveSessionContext({'workflow_project':undefined},_0x122a87[_0x473c03(0x2c4)]),console[_0x473c03(0x235)](a52_0x141979['green'](_0x473c03(0x260))),0x0;if(!_0x190290)return console[_0x473c03(0x2b7)](a52_0x141979[_0x473c03(0x258)](_0x473c03(0x2bf)),_0x473c03(0x1ec)),console['error'](a52_0x141979[_0x473c03(0x140)](_0x473c03(0x1f7))),console[_0x473c03(0x2b7)](a52_0x141979['dim'](_0x473c03(0x1a9))),0x1;const _0x3137df=await withSpinner(_0x473c03(0x131)+_0x190290+'\x27...',()=>_0x2eb5b7[_0x473c03(0x151)][_0x473c03(0x2bb)](_0x190290),{'verbose':_0x122a87['verbose']}),{name:_0x17ec30}=_0x3137df[_0x473c03(0x267)];return saveSessionContext({'workflow_project':_0x17ec30},_0x122a87[_0x473c03(0x2c4)]),console[_0x473c03(0x235)](a52_0x141979['green'](_0x473c03(0x29c)+a52_0x141979[_0x473c03(0x222)](_0x17ec30))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a52_0x56e132(0x1db)]=a52_0x56e132(0x229);[a52_0x56e132(0x2b0)]=a52_0x56e132(0x1df);async[a52_0x56e132(0x234)](_0xd4ba11){const _0x2945c9=a52_0x56e132,{options:_0x781d1e,args:_0x387790,tdx:_0x2bd470}=_0xd4ba11,_0x26a934=_0x387790[0x0];_0x781d1e[_0x2945c9(0x152)]&&_0x26a934&&console[_0x2945c9(0x2b7)](_0x2945c9(0x227)+_0x26a934);const _0x104eb0=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x2bd470[_0x2945c9(0x151)]['projects'](_0x26a934,{'limit':_0x781d1e[_0x2945c9(0x147)]}),{'verbose':_0x781d1e[_0x2945c9(0x152)]});let _0x266c2a=_0x104eb0[_0x2945c9(0x267)];_0x266c2a[_0x2945c9(0x1d5)]((_0x50d1d0,_0x593272)=>_0x50d1d0[_0x2945c9(0x1db)][_0x2945c9(0x262)](_0x593272[_0x2945c9(0x1db)]));const _0x3226ef=_0x781d1e['limit']||0x64,_0xe2140b=_0x266c2a[_0x2945c9(0x18c)]>=_0x3226ef?a52_0x141979[_0x2945c9(0x140)](_0x2945c9(0x288)):'';console[_0x2945c9(0x2b7)]('✔\x20Found\x20'+_0x266c2a['length']+_0x2945c9(0x150)+(_0x266c2a[_0x2945c9(0x18c)]!==0x1?'s':'')+_0xe2140b);if(_0x781d1e[_0x2945c9(0x24c)]===_0x2945c9(0x298)||_0x781d1e[_0x2945c9(0x24c)]==='jsonl'||_0x781d1e['format']===_0x2945c9(0x280))await handleSDKOutput(_0x266c2a,_0x781d1e);else{if(_0x266c2a['length']===0x0)_0x26a934?console[_0x2945c9(0x235)]('No\x20projects\x20match\x20pattern:\x20'+_0x26a934):console[_0x2945c9(0x235)](_0x2945c9(0x2b6));else{const _0x8627a8=_0x266c2a[_0x2945c9(0x17c)](_0x548085=>{const _0x4f8e63=_0x2945c9,_0x2e0555=_0x548085['metadata']?.[_0x4f8e63(0x1ae)](_0x563c32=>_0x563c32[_0x4f8e63(0x215)]===_0x4f8e63(0x136)),_0x4f8579=_0x2e0555?a52_0x141979[_0x4f8e63(0x140)]('\x20(system)'):'';return _0x4f8e63(0x205)+_0x548085[_0x4f8e63(0x1db)]+_0x4f8579;});await writeOutput(_0x8627a8[_0x2945c9(0x17d)]('\x0a'),_0x781d1e[_0x2945c9(0x138)],'list');}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a52_0x56e132(0x1db)]=a52_0x56e132(0x1dc);['description']=a52_0x56e132(0x1a1);async[a52_0x56e132(0x234)](_0x5db66b){const _0x422ddd=a52_0x56e132,{options:_0x4eafa,args:_0x322831,tdx:_0x54f4d0}=_0x5db66b,_0x1786bd=this[_0x422ddd(0x247)](_0x322831,_0x4eafa);_0x4eafa[_0x422ddd(0x152)]&&_0x1786bd&&console[_0x422ddd(0x2b7)](_0x422ddd(0x242)+_0x1786bd);const _0x16f559=await withSpinner('Listing\x20workflows...',()=>_0x54f4d0[_0x422ddd(0x151)][_0x422ddd(0x2b1)](_0x1786bd,{'limit':_0x4eafa['limit']}),{'verbose':_0x4eafa[_0x422ddd(0x152)]});let _0x2377da=_0x16f559[_0x422ddd(0x267)];_0x2377da[_0x422ddd(0x1d5)]((_0x2cd355,_0x186557)=>{const _0x3acc16=_0x422ddd,_0x38d74a=_0x2cd355[_0x3acc16(0x1db)][_0x3acc16(0x262)](_0x186557[_0x3acc16(0x1db)]);if(_0x38d74a!==0x0)return _0x38d74a;return(_0x2cd355[_0x3acc16(0x1e2)]?.['name']||'')[_0x3acc16(0x262)](_0x186557[_0x3acc16(0x1e2)]?.[_0x3acc16(0x1db)]||'');});const _0x42c569=_0x4eafa['limit']||0x64,_0x188dec=_0x2377da[_0x422ddd(0x18c)]>=_0x42c569?a52_0x141979[_0x422ddd(0x140)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x422ddd(0x2b7)](_0x422ddd(0x14b)+_0x2377da[_0x422ddd(0x18c)]+_0x422ddd(0x189)+(_0x2377da[_0x422ddd(0x18c)]!==0x1?'s':'')+_0x188dec);if(_0x4eafa[_0x422ddd(0x24c)]==='json'||_0x4eafa['format']===_0x422ddd(0x19e)||_0x4eafa[_0x422ddd(0x24c)]===_0x422ddd(0x280))await handleSDKOutput(_0x2377da,_0x4eafa);else{if(_0x2377da[_0x422ddd(0x18c)]===0x0)_0x1786bd?console[_0x422ddd(0x235)]('No\x20workflows\x20found\x20in\x20project:\x20'+_0x1786bd):console[_0x422ddd(0x235)](_0x422ddd(0x155));else{const _0x51874d=_0x4eafa[_0x422ddd(0x2c5)],_0x4b626f=_0x2377da[_0x422ddd(0x17c)](_0x388e3e=>{const _0x5c4bfc=_0x422ddd,_0x55b532=a52_0x141979[_0x5c4bfc(0x140)]('#'+_0x388e3e['id']),_0xde7b12=hyperlink(_0x55b532,getWorkflowUrl(_0x51874d,_0x388e3e['id'])),_0x5de356=_0x388e3e['project']?.['name']?a52_0x141979[_0x5c4bfc(0x140)]('\x20('+_0x388e3e['project'][_0x5c4bfc(0x1db)]+')'):'';return _0x5c4bfc(0x129)+_0xde7b12+'\x20'+_0x388e3e[_0x5c4bfc(0x1db)]+_0x5de356;});await writeOutput(_0x4b626f['join']('\x0a'),_0x4eafa[_0x422ddd(0x138)],_0x422ddd(0x1ba));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a52_0x56e132(0x1db)]='workflow:sessions';['description']=a52_0x56e132(0x197);async[a52_0x56e132(0x234)](_0x192322){const _0x33c0c7=a52_0x56e132,{options:_0x30f72d,args:_0x25ea87,tdx:_0x4f2c10}=_0x192322,_0x15cd0f=this[_0x33c0c7(0x130)](_0x25ea87,_0x30f72d);if(!_0x15cd0f)return 0x1;const {projectName:_0x4b3fb2,workflowName:_0x425dc4}=_0x15cd0f;if(_0x30f72d[_0x33c0c7(0x152)]){if(_0x4b3fb2&&_0x425dc4)console[_0x33c0c7(0x2b7)]('Filter:\x20'+_0x4b3fb2+'.'+_0x425dc4);else _0x4b3fb2&&console['error'](_0x33c0c7(0x1f4)+_0x4b3fb2);const _0x5f13db=_0x30f72d['status'];_0x5f13db&&console[_0x33c0c7(0x2b7)](_0x33c0c7(0x20d)+_0x5f13db);}let _0x589f4b=0x28;if(process['stdout']['isTTY']&&!_0x30f72d['output']&&!_0x30f72d[_0x33c0c7(0x24c)]){const _0x45df3d=process[_0x33c0c7(0x127)][_0x33c0c7(0x249)]||0x28;_0x589f4b=Math[_0x33c0c7(0x29d)](0x14,Math[_0x33c0c7(0x1be)](_0x45df3d*0x2/0x3));}const _0x11aca7=_0x30f72d[_0x33c0c7(0x147)]||_0x589f4b,_0x133d5f=await withSpinner(_0x33c0c7(0x1d2),()=>_0x4f2c10[_0x33c0c7(0x151)][_0x33c0c7(0x12d)]({'projectName':_0x4b3fb2,'workflowName':_0x425dc4,'status':_0x30f72d[_0x33c0c7(0x208)],'fromTime':_0x30f72d['from'],'toTime':_0x30f72d['to'],'limit':_0x11aca7}),{'verbose':_0x30f72d[_0x33c0c7(0x152)]}),_0x45e9f6=_0x133d5f[_0x33c0c7(0x267)];_0x45e9f6[_0x33c0c7(0x1d5)]((_0x4e43a6,_0x5cfe0f)=>{const _0x541e4c=_0x33c0c7,_0x3794c8=_0x4e43a6[_0x541e4c(0x289)]||'',_0x38c06f=_0x5cfe0f['sessionTime']||'';return _0x38c06f[_0x541e4c(0x262)](_0x3794c8);});_0x45e9f6[_0x33c0c7(0x18c)]>=_0x11aca7?console[_0x33c0c7(0x2b7)]('✔\x20Showing\x20'+_0x45e9f6['length']+'\x20sessions\x20'+a52_0x141979[_0x33c0c7(0x140)]('(use\x20--limit\x20to\x20see\x20more)')):console[_0x33c0c7(0x2b7)](_0x33c0c7(0x14b)+_0x45e9f6[_0x33c0c7(0x18c)]+'\x20session'+(_0x45e9f6['length']!==0x1?'s':''));if(_0x30f72d[_0x33c0c7(0x24c)]===_0x33c0c7(0x298)||_0x30f72d[_0x33c0c7(0x24c)]===_0x33c0c7(0x19e)||_0x30f72d[_0x33c0c7(0x24c)]===_0x33c0c7(0x280))await handleSDKOutput(_0x45e9f6,_0x30f72d);else{if(!process[_0x33c0c7(0x127)][_0x33c0c7(0x2cd)]||_0x30f72d[_0x33c0c7(0x138)]){if(_0x45e9f6[_0x33c0c7(0x18c)]===0x0){if(_0x4b3fb2&&_0x425dc4)console[_0x33c0c7(0x235)](_0x33c0c7(0x236)+_0x4b3fb2+'.'+_0x425dc4);else _0x4b3fb2?console['log'](_0x33c0c7(0x191)+_0x4b3fb2):console[_0x33c0c7(0x235)]('No\x20sessions\x20found');}else{const _0x2684e0=_0x30f72d[_0x33c0c7(0x2c5)],_0x319b83=this[_0x33c0c7(0x20f)](_0x45e9f6,_0x2684e0);_0x30f72d[_0x33c0c7(0x138)]?await writeOutput(_0x319b83,_0x30f72d[_0x33c0c7(0x138)],_0x33c0c7(0x1ba)):console[_0x33c0c7(0x235)](_0x319b83);}!_0x4b3fb2&&(console[_0x33c0c7(0x2b7)](''),console['error'](a52_0x141979[_0x33c0c7(0x140)](_0x33c0c7(0x24b))),console[_0x33c0c7(0x2b7)](a52_0x141979[_0x33c0c7(0x140)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a52_0x141979[_0x33c0c7(0x140)](_0x33c0c7(0x17e))));}else{if(_0x45e9f6[_0x33c0c7(0x18c)]===0x0){if(_0x4b3fb2&&_0x425dc4)console['log'](_0x33c0c7(0x236)+_0x4b3fb2+'.'+_0x425dc4);else _0x4b3fb2?console[_0x33c0c7(0x235)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x4b3fb2):console['log']('No\x20sessions\x20found');}else await this[_0x33c0c7(0x1a2)](_0x45e9f6,_0x192322,_0x4b3fb2);}}return 0x0;}['renderSessionsTimeline'](_0x3d6dd8,_0x2b74d3){const _0x179607=a52_0x56e132,_0x24d747=[],_0x3eaabc=new Map();let _0x593b13=Infinity,_0x1bd960=-Infinity;for(const _0x38c8a7 of _0x3d6dd8){if(_0x38c8a7[_0x179607(0x1d6)]?.[_0x179607(0x1ac)]){const _0x51cfe2=new Date(_0x38c8a7[_0x179607(0x1d6)][_0x179607(0x1ac)])[_0x179607(0x169)](),_0x26374d=_0x38c8a7[_0x179607(0x1d6)][_0x179607(0x162)]?new Date(_0x38c8a7[_0x179607(0x1d6)][_0x179607(0x162)])[_0x179607(0x169)]():Date[_0x179607(0x134)](),_0x55b208=_0x38c8a7['project']?.[_0x179607(0x1db)]||'(unknown)';!_0x3eaabc[_0x179607(0x1d8)](_0x55b208)&&_0x3eaabc[_0x179607(0x160)](_0x55b208,[]),_0x3eaabc[_0x179607(0x192)](_0x55b208)['push']({'session':_0x38c8a7,'startTime':_0x51cfe2,'endTime':_0x26374d,'duration':_0x26374d-_0x51cfe2}),_0x593b13=Math[_0x179607(0x193)](_0x593b13,_0x51cfe2),_0x1bd960=Math[_0x179607(0x29d)](_0x1bd960,_0x26374d);}}if(_0x3eaabc[_0x179607(0x18f)]===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x3b8405=process['stdout'][_0x179607(0x14e)]||0x78,_0x32de86=0x1e,_0x3ac43a=0x32,_0x5d6aa1=0x4,_0x4e64c8=Math['min'](_0x3ac43a,Math[_0x179607(0x29d)](_0x32de86,Math['floor'](_0x3b8405*0.3))),_0x257551=_0x3b8405-_0x4e64c8-TIMELINE_CONFIG[_0x179607(0x149)]-0x3-_0x5d6aa1,_0x27306e=_0x1bd960-_0x593b13,_0x10282e=_0x27306e/_0x4e64c8,_0x3186c9=renderTimeAxis({'startTime':_0x593b13,'endTime':_0x1bd960,'durationMs':_0x27306e,'msPerChar':_0x10282e},_0x4e64c8),_0x5bb1f5=[];for(const _0x135572 of _0x3eaabc[_0x179607(0x27d)]()){_0x5bb1f5[_0x179607(0x237)](..._0x135572);}_0x5bb1f5['sort']((_0x41d63c,_0x2135ce)=>_0x2135ce['startTime']-_0x41d63c[_0x179607(0x19a)]);const _0x5584fb=new Date(_0x593b13),_0x134a02=formatDate(_0x5584fb),_0x3b23b5=_0x5d6aa1+TIMELINE_CONFIG[_0x179607(0x2af)]+TIMELINE_CONFIG[_0x179607(0x1b1)]+_0x257551,_0x43ea00='\x20'['repeat'](_0x3b23b5-_0x134a02[_0x179607(0x18c)]),_0x48db3f=_0x43ea00+a52_0x141979[_0x179607(0x140)](_0x134a02)+'\x20'+_0x3186c9;_0x24d747[_0x179607(0x237)](_0x48db3f);const _0x399db1=0x16;let _0x3c85d5=0x0;for(const _0x9c79ae of _0x5bb1f5){const _0x33a3bc=_0x9c79ae[_0x179607(0x2c4)]['project']?.[_0x179607(0x1db)]||'?',_0xd7179c=Math[_0x179607(0x193)](stringWidth(_0x33a3bc),_0x399db1);_0x3c85d5=Math[_0x179607(0x29d)](_0x3c85d5,_0xd7179c);}for(const _0x2d2714 of _0x5bb1f5){const {session:_0x557e3b,startTime:_0x1d39f2,endTime:_0x23d5bf,duration:_0x4142b0}=_0x2d2714,_0x21341c=_0x557e3b['project']?.['id'],_0x51cc07=_0x557e3b['id'],_0x20d200=_0x557e3b[_0x179607(0x1e2)]?.[_0x179607(0x1db)]||'?',_0x24d81c=_0x557e3b[_0x179607(0x151)]?.['name']||'?';let _0x147664,_0x290e12;if(_0x557e3b[_0x179607(0x1d6)]){const _0x2c3a56=_0x557e3b[_0x179607(0x1d6)];!_0x2c3a56[_0x179607(0x159)]?(_0x147664=_0x2c3a56['cancelRequested']?'🛑':'🔄',_0x290e12=_0x2c3a56[_0x179607(0x164)]?a52_0x141979['yellow']:a52_0x141979[_0x179607(0x178)]):(_0x147664=_0x2c3a56[_0x179607(0x29f)]?'✅':'❌',_0x290e12=_0x2c3a56[_0x179607(0x29f)]?a52_0x141979[_0x179607(0x24f)]:a52_0x141979[_0x179607(0x258)]);}else _0x147664='⏳',_0x290e12=a52_0x141979[_0x179607(0x140)];const _0x380808='#'+_0x51cc07,_0x35a7e0=_0x21341c?hyperlink(_0x380808,getWorkflowSessionUrl(_0x2b74d3,_0x21341c,_0x51cc07)):_0x380808;let _0x27d169=_0x20d200;stringWidth(_0x20d200)>_0x399db1&&(_0x27d169=_0x20d200[_0x179607(0x20a)](0x0,_0x399db1-0x1)+'…');const _0x26cfe7=a52_0x141979[_0x179607(0x140)](_0x27d169),_0x3f768b=stringWidth(_0x27d169),_0xadc824='\x20'['repeat'](_0x3c85d5-stringWidth(_0x27d169)+0x2),_0x1fc70e='('+formatElapsed(_0x4142b0)+')',_0x47b84b=stringWidth(_0x1fc70e),_0xacd757=stringWidth(_0x380808),_0x4a969a=_0xacd757+0x1+_0x3f768b+_0xadc824[_0x179607(0x18c)],_0x22d030=_0x257551-_0x4a969a-_0x47b84b-0x1-0x8;let _0x173633=_0x24d81c;stringWidth(_0x173633)>_0x22d030&&(_0x173633=_0x173633[_0x179607(0x20a)](0x0,_0x22d030-0x1)+'…');const _0x52a777=_0x35a7e0+'\x20'+_0x26cfe7+_0xadc824+_0x173633,_0x232376=stringWidth(_0x52a777),_0x522f10=_0x257551-_0x232376-_0x47b84b,_0x2ae38f=_0x52a777+'\x20'['repeat'](Math['max'](0x1,_0x522f10))+a52_0x141979[_0x179607(0x140)](_0x1fc70e),_0x343392=Math['floor']((_0x1d39f2-_0x593b13)/_0x10282e),_0x2410b2=Math[_0x179607(0x1be)]((_0x23d5bf-_0x593b13)/_0x10282e),_0x3fa7fc=Math['max'](_0x343392+0x1,_0x2410b2),_0x5bd477=new Array(_0x4e64c8)['fill']('\x20');for(let _0x60b436=_0x343392;_0x60b436<Math[_0x179607(0x193)](_0x3fa7fc,_0x4e64c8);_0x60b436++){_0x5bd477[_0x60b436]='─';}const _0x9333ce=_0x5bd477[_0x179607(0x17c)](_0xf41c34=>_0xf41c34==='\x20'?'\x20':_0x290e12(_0xf41c34))[_0x179607(0x17d)]('');_0x24d747[_0x179607(0x237)](_0x147664+'\x20'+_0x2ae38f+'│'+_0x9333ce+'│');}return _0x24d747[_0x179607(0x17d)]('\x0a');}async[a52_0x56e132(0x1a2)](_0x496b61,_0xb24665,_0x4e8629){const _0x364e73=a52_0x56e132,{options:_0x19770d,tdx:_0x6f7675}=_0xb24665,_0x14fb59=_0x19770d[_0x364e73(0x2c5)],{timelineRows:_0x404a98,timeAxisHeader:_0x52535e}=this[_0x364e73(0x2ad)](_0x496b61,_0x14fb59),_0xa90238=_0x404a98['filter'](_0x1caba3=>_0x1caba3['attemptId']);if(_0xa90238['length']===0x0){const _0x179e1e=this[_0x364e73(0x20f)](_0x496b61,_0x14fb59);console[_0x364e73(0x235)](_0x179e1e);!_0x4e8629&&(console['error'](''),console[_0x364e73(0x2b7)](a52_0x141979['dim'](_0x364e73(0x24b))),console[_0x364e73(0x2b7)](a52_0x141979[_0x364e73(0x140)](_0x364e73(0x284))+'or'+a52_0x141979[_0x364e73(0x140)](_0x364e73(0x17e))));return;}_0x52535e&&console[_0x364e73(0x235)](_0x52535e);const _0x9433c9=_0x404a98[_0x364e73(0x1d7)](_0x5899b2=>_0x5899b2[_0x364e73(0x1d1)])[_0x364e73(0x17c)](_0x14c581=>({'title':_0x14c581[_0x364e73(0x1de)],'value':_0x14c581[_0x364e73(0x1d1)]})),_0x35d94d=process[_0x364e73(0x127)][_0x364e73(0x249)]||0x3c,_0x522a14=Math[_0x364e73(0x29d)](0x28,Math[_0x364e73(0x1be)](_0x35d94d*0x2/0x3)),_0x1a4425=await a52_0x39c28f({'type':_0x364e73(0x255),'name':'attemptId','message':_0x364e73(0x126),'choices':_0x9433c9,'initial':-0x1,'limit':_0x522a14,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x1b55dd,_0x2a6c97)=>{const _0x8da370=_0x364e73;if(!_0x1b55dd)return Promise['resolve'](_0x2a6c97);const _0x85f435=_0x2a6c97[_0x8da370(0x1d7)](_0x5dd835=>{const _0x3e0189=_0x8da370,_0x501c4d=_0x5dd835;return _0x501c4d['title'][_0x3e0189(0x121)]()[_0x3e0189(0x274)](_0x1b55dd[_0x3e0189(0x121)]());});return Promise[_0x8da370(0x146)](_0x85f435);}}),_0x2582e0=()=>{const _0x50914c=_0x364e73;process['stdout'][_0x50914c(0x1f1)]('\x1b[1A\x1b[2K'),process[_0x50914c(0x127)]['write'](_0x50914c(0x12e)),process['stdout']['write'](_0x50914c(0x12e));},_0x21276f=_0x1a4425&&_0x1a4425[_0x364e73(0x1d1)]&&_0x1a4425[_0x364e73(0x1d1)]!==null&&_0x1a4425[_0x364e73(0x1d1)][_0x364e73(0x15e)]()!=='';if(!_0x21276f){_0x2582e0(),console[_0x364e73(0x235)](a52_0x141979[_0x364e73(0x140)](_0x364e73(0x181)));return;}_0x2582e0();const _0x65d857=_0x496b61['find'](_0x5ec7e1=>_0x5ec7e1[_0x364e73(0x1d6)]?.['id']===_0x1a4425[_0x364e73(0x1d1)]);if(_0x65d857){const _0x2716a0=_0x65d857[_0x364e73(0x1e2)]?.[_0x364e73(0x1db)]||'?',_0x30faae=_0x65d857[_0x364e73(0x151)]?.['name']||'?';console['log'](_0x364e73(0x158)+a52_0x141979[_0x364e73(0x140)](_0x2716a0)+',\x20Workflow:\x20'+a52_0x141979[_0x364e73(0x140)](_0x30faae));}const _0x34c13d=new WorkflowTimelineCommand();await _0x34c13d['execute']({'args':[],'options':{..._0x19770d,'attemptId':_0x1a4425[_0x364e73(0x1d1)]},'tdx':_0x6f7675});}['generateSessionTimelineRows'](_0x22e052,_0x2be9f9){const _0x553175=a52_0x56e132,_0x441eb3=new Map();for(const _0x1ee64a of _0x22e052){_0x1ee64a['id']&&_0x1ee64a['lastAttempt']?.['id']&&_0x441eb3[_0x553175(0x160)](_0x1ee64a['id'],_0x1ee64a[_0x553175(0x1d6)]['id']);}const _0x32ccf5=[];let _0x14e25c='';const _0x2a4be3=this[_0x553175(0x20f)](_0x22e052,_0x2be9f9),_0x145996=_0x2a4be3['split']('\x0a');for(const _0x30e603 of _0x145996){if(_0x30e603[_0x553175(0x212)](_0x553175(0x29b))||_0x30e603[_0x553175(0x186)](/^\s+\d{4}-\d{2}-\d{2}/))_0x14e25c=_0x30e603;else{if(_0x30e603[_0x553175(0x186)](/^[✅❌🔄🛑⏳]/)){const _0x1e1213=_0x30e603[_0x553175(0x186)](/#(\d+)/),_0x576fc2=_0x1e1213?_0x1e1213[0x1]:null,_0x1224c5=_0x576fc2?_0x441eb3[_0x553175(0x192)](_0x576fc2)||null:null,_0x3b49ab=_0x22e052[_0x553175(0x182)](_0x5aea57=>_0x5aea57['id']===_0x576fc2),_0x180d48=_0x3b49ab?.['project']?.['name']||'';_0x32ccf5[_0x553175(0x237)]({'displayLine':_0x30e603,'attemptId':_0x1224c5,'projectName':_0x180d48});}}}return{'timelineRows':_0x32ccf5,'timeAxisHeader':_0x14e25c};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a52_0x56e132(0x1db)]=a52_0x56e132(0x1bd);[a52_0x56e132(0x2b0)]=a52_0x56e132(0x163);async['execute'](_0x5d97bb){const _0x180cdb=a52_0x56e132,{options:_0x2b574a,args:_0x4a2502,tdx:_0x480622}=_0x5d97bb,_0x373dd0=this[_0x180cdb(0x130)](_0x4a2502,_0x2b574a);if(!_0x373dd0)return 0x1;const {projectName:_0x54a64e,workflowName:_0x251b46}=_0x373dd0,_0x490361=_0x2b574a[_0x180cdb(0x1b6)];if(_0x2b574a[_0x180cdb(0x152)]){if(_0x54a64e&&_0x251b46)console[_0x180cdb(0x2b7)]('Filter:\x20'+_0x54a64e+'.'+_0x251b46);else _0x54a64e&&console[_0x180cdb(0x2b7)](_0x180cdb(0x1f4)+_0x54a64e);_0x490361&&console[_0x180cdb(0x2b7)]('Include\x20retried:\x20yes');}const _0x5f0836=await withSpinner(_0x180cdb(0x28c),()=>_0x480622[_0x180cdb(0x151)]['attempts']({'projectName':_0x54a64e,'workflowName':_0x251b46,'includeRetried':_0x490361,'limit':_0x2b574a[_0x180cdb(0x147)]}),{'verbose':_0x2b574a[_0x180cdb(0x152)]}),_0x4ff7d0=_0x5f0836[_0x180cdb(0x267)],_0x1707e7=_0x2b574a[_0x180cdb(0x147)]||0x64,_0x2c0a28=_0x4ff7d0[_0x180cdb(0x18c)]>=_0x1707e7?a52_0x141979[_0x180cdb(0x140)](_0x180cdb(0x288)):'';console['error']('✔\x20Found\x20'+_0x4ff7d0[_0x180cdb(0x18c)]+_0x180cdb(0x278)+(_0x4ff7d0['length']!==0x1?'s':'')+_0x2c0a28);if(_0x2b574a[_0x180cdb(0x24c)]===_0x180cdb(0x298)||_0x2b574a[_0x180cdb(0x24c)]===_0x180cdb(0x19e)||_0x2b574a[_0x180cdb(0x24c)]==='table')await handleSDKOutput(_0x4ff7d0,_0x2b574a);else{if(_0x4ff7d0[_0x180cdb(0x18c)]===0x0){if(_0x54a64e&&_0x251b46)console['log']('No\x20attempts\x20found\x20for:\x20'+_0x54a64e+'.'+_0x251b46);else _0x54a64e?console[_0x180cdb(0x235)](_0x180cdb(0x290)+_0x54a64e):console['log'](_0x180cdb(0x18a));}else{const _0x359c60=_0x2b574a[_0x180cdb(0x2c5)],_0x2b736f=_0x4ff7d0[_0x180cdb(0x17c)](_0x4525fc=>{const _0x5a07aa=_0x180cdb,_0x8b39fc=a52_0x141979[_0x5a07aa(0x140)]('#'+_0x4525fc['id']),_0x2d689f=_0x4525fc[_0x5a07aa(0x1e2)]?.['id'],_0x54d347=_0x4525fc[_0x5a07aa(0x11d)]||_0x4525fc[_0x5a07aa(0x179)],_0x27e93f=_0x2d689f&&_0x54d347?hyperlink(_0x8b39fc,getWorkflowAttemptUrl(_0x359c60,_0x2d689f,_0x54d347,_0x4525fc['id'])):_0x8b39fc,{icon:_0x1942bf,text:_0x1bcb14}=getAttemptStatusDisplay(_0x4525fc),_0x38b0a3=(_0x4525fc[_0x5a07aa(0x1e2)]?.[_0x5a07aa(0x1db)]||'?')+'.'+(_0x4525fc[_0x5a07aa(0x151)]?.['name']||'?'),_0x246728=_0x4525fc[_0x5a07aa(0x289)]?a52_0x141979[_0x5a07aa(0x140)](_0x4525fc[_0x5a07aa(0x289)]):'';return(_0x27e93f+'\x20'+_0x1942bf+(_0x1bcb14?'\x20'+_0x1bcb14:'')+'\x20'+_0x38b0a3+'\x20'+_0x246728)['trimEnd']();});await writeOutput(_0x2b736f[_0x180cdb(0x17d)]('\x0a'),_0x2b574a['output'],_0x180cdb(0x1ba));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a52_0x56e132(0x1db)]='workflow:attempt';['description']=a52_0x56e132(0x20c);async[a52_0x56e132(0x234)](_0x58aaf8){const _0x34dee3=a52_0x56e132,{options:_0x3d1ae9,args:_0x5584ae,tdx:_0x66f00b}=_0x58aaf8,_0x454318=_0x5584ae[0x0];if(!_0x454318)return console[_0x34dee3(0x2b7)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x3d1ae9[_0x34dee3(0x152)]&&console[_0x34dee3(0x2b7)](_0x34dee3(0x250)+_0x454318);const _0x340b7c=await withSpinner(_0x34dee3(0x1ca),()=>_0x66f00b[_0x34dee3(0x151)]['attempt'](_0x454318),{'verbose':_0x3d1ae9['verbose']}),_0x18b463=_0x340b7c['data'];let _0x4cb91a;!_0x18b463['done']?_0x4cb91a=_0x18b463[_0x34dee3(0x164)]?'canceling':_0x34dee3(0x1ee):_0x4cb91a=_0x18b463['success']?_0x34dee3(0x29f):_0x34dee3(0x2b7);let _0x2630a5;if(_0x18b463[_0x34dee3(0x1ac)]&&_0x18b463[_0x34dee3(0x162)]){const _0x2499e8=new Date(_0x18b463['createdAt'])[_0x34dee3(0x169)](),_0x5708a8=new Date(_0x18b463[_0x34dee3(0x162)])[_0x34dee3(0x169)]();_0x2630a5=Math[_0x34dee3(0x24d)]((_0x5708a8-_0x2499e8)/0x3e8);}const _0x59d799={'attempt_id':_0x18b463['id'],'status':_0x4cb91a,..._0x18b463[_0x34dee3(0x185)]!==undefined&&{'index':_0x18b463[_0x34dee3(0x185)]},..._0x18b463['project']&&{'project':_0x18b463[_0x34dee3(0x1e2)][_0x34dee3(0x1db)]},..._0x18b463[_0x34dee3(0x151)]&&{'workflow':_0x18b463[_0x34dee3(0x151)][_0x34dee3(0x1db)]},..._0x18b463[_0x34dee3(0x179)]&&{'session_id':_0x18b463[_0x34dee3(0x179)]},..._0x18b463['sessionTime']&&{'session_time':_0x18b463[_0x34dee3(0x289)]},..._0x18b463[_0x34dee3(0x1e5)]&&{'retry_attempt':_0x18b463['retryAttemptName']},..._0x2630a5!==undefined&&{'duration_sec':_0x2630a5},..._0x18b463[_0x34dee3(0x1ac)]&&{'created_at':_0x18b463[_0x34dee3(0x1ac)]},..._0x18b463['finishedAt']&&{'finished_at':_0x18b463[_0x34dee3(0x162)]},...Object[_0x34dee3(0x223)](_0x18b463[_0x34dee3(0x1cb)])['length']>0x0&&{'params':_0x18b463[_0x34dee3(0x1cb)]}};return await handleSingleObjectOutput(_0x59d799,_0x3d1ae9),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a52_0x56e132(0x1db)]=a52_0x56e132(0x2a8);['description']=a52_0x56e132(0x1f0);async[a52_0x56e132(0x234)](_0xb00c70){const _0x11809e=a52_0x56e132,{options:_0x27e3ef,args:_0x354238,tdx:_0x437134}=_0xb00c70,_0xb7b0ac=_0x354238[0x0];if(!_0xb7b0ac)return console[_0x11809e(0x2b7)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x51a838=_0x27e3ef[_0x11809e(0x210)];_0x27e3ef[_0x11809e(0x152)]&&(console['error'](_0x11809e(0x250)+_0xb7b0ac),_0x51a838&&console[_0x11809e(0x2b7)]('Including\x20subtasks:\x20yes'));const _0x39f504=await withSpinner(_0x11809e(0x190),()=>_0x437134[_0x11809e(0x151)][_0x11809e(0x2b2)](_0xb7b0ac,_0x51a838||![]),{'verbose':_0x27e3ef[_0x11809e(0x152)]}),_0x37b7ca=_0x39f504[_0x11809e(0x267)];return console[_0x11809e(0x2b7)]('✔\x20Found\x20'+_0x37b7ca[_0x11809e(0x18c)]+_0x11809e(0x148)+(_0x37b7ca[_0x11809e(0x18c)]!==0x1?'s':'')),await handleSDKOutput(_0x37b7ca,_0x27e3ef),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a52_0x56e132(0x1d4);[a52_0x56e132(0x2b0)]=a52_0x56e132(0x21a);async['execute'](_0x18714c){const _0x2874f4=a52_0x56e132,{options:_0x502316,args:_0xc0b187,tdx:_0x3ed934}=_0x18714c,_0x5ba78b=_0xc0b187[0x0];let _0x5007ae=_0xc0b187[0x1];if(!_0x5ba78b)return console[_0x2874f4(0x2b7)](_0x2874f4(0x1dd)),0x1;_0x502316['verbose']&&(console[_0x2874f4(0x2b7)]('Attempt\x20ID:\x20'+_0x5ba78b),_0x5007ae&&console[_0x2874f4(0x2b7)](_0x2874f4(0x2ae)+_0x5007ae));const _0x175d32=await withSpinner('Fetching\x20log\x20files...',()=>_0x3ed934['workflow'][_0x2874f4(0x19c)](_0x5ba78b,_0x5007ae),{'verbose':_0x502316[_0x2874f4(0x152)]}),_0x52e061=_0x175d32[_0x2874f4(0x267)];if(_0x52e061[_0x2874f4(0x18c)]===0x0)return console['error'](_0x2874f4(0x15c)),0x0;if(!_0x5007ae&&(_0x502316['json']||_0x502316['format']))return await handleSDKOutput(_0x52e061,_0x502316),0x0;if(!_0x5007ae){const _0x546051=_0x52e061[_0x2874f4(0x17c)](_0x3fea46=>({'title':_0x3fea46[_0x2874f4(0x198)]+'\x20('+formatBytes(_0x3fea46[_0x2874f4(0x295)])+')','value':_0x3fea46[_0x2874f4(0x198)]})),_0x516660=await a52_0x39c28f({'type':'select','name':_0x2874f4(0x231),'message':_0x2874f4(0x1c2),'choices':_0x546051});if(!_0x516660[_0x2874f4(0x231)])return console[_0x2874f4(0x2b7)](_0x2874f4(0x181)),0x0;_0x5007ae=_0x516660[_0x2874f4(0x231)];}const _0x4fdc4d=await withSpinner(_0x2874f4(0x11f),()=>_0x3ed934[_0x2874f4(0x151)][_0x2874f4(0x170)](_0x5ba78b,_0x5007ae),{'verbose':_0x502316[_0x2874f4(0x152)]}),_0x28deaf=_0x4fdc4d[_0x2874f4(0x267)];return _0x28deaf?console['log'](_0x28deaf):console['error'](_0x2874f4(0x2a0)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a52_0x56e132(0x1db)]=a52_0x56e132(0x13f);['description']=a52_0x56e132(0x202);async['execute'](_0xcdde4){const _0x3aaf64=a52_0x56e132,{options:_0x59185a,args:_0x57ebf3,tdx:_0x461643}=_0xcdde4,_0xad3d92=_0x57ebf3[0x0];if(!_0xad3d92)return console[_0x3aaf64(0x2b7)](_0x3aaf64(0x1dd)),0x1;const _0x1dd918=_0x59185a[_0x3aaf64(0x18e)];_0x59185a['verbose']&&(console[_0x3aaf64(0x2b7)](_0x3aaf64(0x250)+_0xad3d92),_0x1dd918&&console[_0x3aaf64(0x2b7)]('Reason:\x20'+_0x1dd918));if(!_0x59185a[_0x3aaf64(0x296)]){if(!isInteractive())return console['error'](a52_0x141979[_0x3aaf64(0x258)](_0x3aaf64(0x21b)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3aaf64(0x2b7)](a52_0x141979[_0x3aaf64(0x140)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x486fee=await confirmKey(_0x3aaf64(0x1b2)+_0xad3d92+'?');if(!_0x486fee)return console[_0x3aaf64(0x2b7)](a52_0x141979['yellow'](_0x3aaf64(0x181))),0x1;}const _0xaa80=await withSpinner(_0x3aaf64(0x143),()=>_0x461643[_0x3aaf64(0x151)]['kill'](_0xad3d92,_0x1dd918),{'verbose':_0x59185a['verbose']}),_0x48260a=_0xaa80[_0x3aaf64(0x267)];return console['error']('✔\x20'+_0x48260a),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a52_0x56e132(0x1f5);[a52_0x56e132(0x2b0)]='Retry\x20a\x20session\x20or\x20attempt';async[a52_0x56e132(0x234)](_0x569744){const _0x186dbc=a52_0x56e132,{options:_0x3bf209,args:_0x56aa46,tdx:_0x3f73f3}=_0x569744,_0x465343=_0x56aa46[0x0];if(!_0x465343)return console[_0x186dbc(0x2b7)](_0x186dbc(0x1a3)),console[_0x186dbc(0x2b7)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x222da7=![],_0x141117=_0x465343;if(_0x465343[_0x186dbc(0x212)]('session:'))_0x222da7=!![],_0x141117=_0x465343[_0x186dbc(0x256)](0x8);else{if(_0x465343['startsWith']('attempt:'))_0x222da7=![],_0x141117=_0x465343[_0x186dbc(0x256)](0x8);else return console[_0x186dbc(0x2b7)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0x186dbc(0x2b7)](_0x186dbc(0x248)),0x1;}const _0x234bae=_0x3bf209[_0x186dbc(0x16e)],_0x3006ab=_0x3bf209[_0x186dbc(0x226)],_0x548cfb=_0x3bf209[_0x186dbc(0x1cb)],_0x58bc41=_0x3bf209[_0x186dbc(0x196)];_0x3bf209[_0x186dbc(0x152)]&&(console[_0x186dbc(0x2b7)]('Target:\x20'+(_0x222da7?'session':'attempt')+'\x20'+_0x141117),_0x234bae&&console[_0x186dbc(0x2b7)]('From\x20task:\x20'+_0x234bae),_0x3006ab&&console[_0x186dbc(0x2b7)](_0x186dbc(0x209)+_0x3006ab),_0x548cfb&&console[_0x186dbc(0x2b7)](_0x186dbc(0x188)+_0x548cfb),_0x58bc41&&console[_0x186dbc(0x2b7)](_0x186dbc(0x1c9)));let _0x334277;if(_0x548cfb)try{if(_0x548cfb[_0x186dbc(0x212)]('@')){const _0x2e95f0=await import(_0x186dbc(0x171)),_0x4bb238=_0x548cfb[_0x186dbc(0x256)](0x1),_0xd5be3a=await _0x2e95f0[_0x186dbc(0x2ac)](_0x4bb238,_0x186dbc(0x2cc));_0x334277=JSON[_0x186dbc(0x1bf)](_0xd5be3a);}else _0x334277=JSON[_0x186dbc(0x1bf)](_0x548cfb);}catch{return console[_0x186dbc(0x2b7)](_0x186dbc(0x157)),0x1;}if(!_0x3bf209['yes']){if(!isInteractive())return console[_0x186dbc(0x2b7)](a52_0x141979[_0x186dbc(0x258)](_0x186dbc(0x21b)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a52_0x141979['dim'](_0x186dbc(0x23e))),0x1;const _0x335250=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x222da7?_0x186dbc(0x2c4):_0x186dbc(0x2c3))+'\x20'+_0x141117+'?');if(!_0x335250)return console['error'](a52_0x141979[_0x186dbc(0x1cd)](_0x186dbc(0x181))),0x1;}let _0x445fc1;_0x222da7?_0x445fc1=await withSpinner(_0x186dbc(0x286),()=>_0x3f73f3[_0x186dbc(0x151)]['retrySession'](_0x141117,{'fromTask':_0x234bae,'retryParams':_0x334277}),{'verbose':_0x3bf209[_0x186dbc(0x152)]}):_0x445fc1=await withSpinner(_0x186dbc(0x28d),()=>_0x3f73f3['workflow'][_0x186dbc(0x1aa)](_0x141117,{'resumeFrom':_0x3006ab,'retryParams':_0x334277,'force':_0x58bc41}),{'verbose':_0x3bf209[_0x186dbc(0x152)]});const _0x52d383=_0x445fc1[_0x186dbc(0x267)];return console[_0x186dbc(0x2b7)](_0x186dbc(0x243)),console['error'](_0x186dbc(0x287)+_0x52d383[_0x186dbc(0x1d1)]),console[_0x186dbc(0x2b7)]('\x20\x20Session\x20ID:\x20'+_0x52d383[_0x186dbc(0x179)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']='workflow:run';[a52_0x56e132(0x2b0)]=a52_0x56e132(0x22b);async[a52_0x56e132(0x234)](_0x29dfb9){const _0x2e1f42=a52_0x56e132,{options:_0x39a119,args:_0x64ecdc,tdx:_0x43be32}=_0x29dfb9;let _0x4c8bb4=_0x64ecdc[0x0];if(!_0x4c8bb4){const _0x4d6053=this['resolveProject']([],_0x39a119),_0x3fbd85=await withSpinner('Loading\x20workflows...',()=>_0x43be32['workflow']['workflows'](_0x4d6053,{'limit':_0x39a119[_0x2e1f42(0x147)]}),{'verbose':_0x39a119[_0x2e1f42(0x152)]}),_0x4ca995=_0x3fbd85[_0x2e1f42(0x267)];if(_0x4ca995[_0x2e1f42(0x18c)]===0x0)return console[_0x2e1f42(0x2b7)]('No\x20workflows\x20found'),!_0x4d6053&&console['error'](a52_0x141979[_0x2e1f42(0x140)](_0x2e1f42(0x1b3))),0x1;const _0xec8338=_0x4ca995[_0x2e1f42(0x17c)](_0x5492c3=>({'title':_0x5492c3[_0x2e1f42(0x1e2)]?.[_0x2e1f42(0x1db)]+'.'+_0x5492c3[_0x2e1f42(0x1db)],'value':_0x5492c3[_0x2e1f42(0x1e2)]?.['name']+'.'+_0x5492c3[_0x2e1f42(0x1db)],'description':_0x5492c3[_0x2e1f42(0x241)]?_0x2e1f42(0x1f3)+_0x5492c3['revision']:undefined})),_0x30ff2a=await a52_0x39c28f({'type':'select','name':'workflow','message':'Select\x20a\x20workflow\x20to\x20run','choices':_0xec8338});if(!_0x30ff2a[_0x2e1f42(0x151)])return 0x1;_0x4c8bb4=_0x30ff2a[_0x2e1f42(0x151)];}if(!_0x4c8bb4[_0x2e1f42(0x274)]('.')){const _0x378fdc=this[_0x2e1f42(0x247)]([],_0x39a119);if(_0x378fdc)_0x4c8bb4=_0x378fdc+'.'+_0x4c8bb4;else return console[_0x2e1f42(0x2b7)](a52_0x141979[_0x2e1f42(0x258)]('Error:'),_0x2e1f42(0x277)),console['error'](a52_0x141979[_0x2e1f42(0x140)](_0x2e1f42(0x1b3))),0x1;}const _0x4f1e45=_0x39a119[_0x2e1f42(0x1a0)],_0x160bad=_0x39a119[_0x2e1f42(0x289)],_0x59d31a={};if(_0x4f1e45&&Array['isArray'](_0x4f1e45))for(const _0x829870 of _0x4f1e45){const _0x3acdf8=_0x829870[_0x2e1f42(0x1fe)]('=');if(_0x3acdf8===-0x1)return console[_0x2e1f42(0x2b7)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x829870),console[_0x2e1f42(0x2b7)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x14bb8a=_0x829870[_0x2e1f42(0x256)](0x0,_0x3acdf8),_0x554c27=_0x829870[_0x2e1f42(0x256)](_0x3acdf8+0x1);try{_0x59d31a[_0x14bb8a]=JSON[_0x2e1f42(0x1bf)](_0x554c27);}catch{_0x59d31a[_0x14bb8a]=_0x554c27;}}_0x39a119['verbose']&&(console[_0x2e1f42(0x2b7)](_0x2e1f42(0x1b8)+_0x4c8bb4),Object['keys'](_0x59d31a)['length']>0x0&&console['error']('Parameters:\x20'+JSON['stringify'](_0x59d31a)),_0x160bad&&console['error'](_0x2e1f42(0x166)+_0x160bad));const _0xfc3a1=await withSpinner(_0x2e1f42(0x1e7),()=>_0x43be32[_0x2e1f42(0x151)][_0x2e1f42(0x24e)](_0x4c8bb4,_0x59d31a,{'sessionTime':_0x160bad}),{'verbose':_0x39a119[_0x2e1f42(0x152)]}),_0x3354d7=_0xfc3a1['data'];console[_0x2e1f42(0x2b7)](_0x2e1f42(0x285)),console[_0x2e1f42(0x2b7)]('\x20\x20Attempt\x20ID:\x20'+_0x3354d7['id']),console[_0x2e1f42(0x2b7)](_0x2e1f42(0x239)+_0x3354d7['sessionId']),console[_0x2e1f42(0x2b7)](_0x2e1f42(0x29e)+_0x3354d7[_0x2e1f42(0x1e2)]?.[_0x2e1f42(0x1db)]),console[_0x2e1f42(0x2b7)](_0x2e1f42(0x297)+_0x3354d7[_0x2e1f42(0x151)]?.[_0x2e1f42(0x1db)]);if(_0x3354d7[_0x2e1f42(0x1e2)]?.['id']&&_0x3354d7[_0x2e1f42(0x179)]&&_0x3354d7['id']){const _0x179150=_0x39a119[_0x2e1f42(0x2c5)],_0x86d4df=getConsoleUrl(_0x179150,_0x2e1f42(0x2aa)+_0x3354d7[_0x2e1f42(0x1e2)]['id']+_0x2e1f42(0x173)+_0x3354d7[_0x2e1f42(0x179)]+'/attempt/'+_0x3354d7['id']);console['error'](_0x2e1f42(0x263)+a52_0x141979['cyan'](_0x86d4df));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']='workflow:download';[a52_0x56e132(0x2b0)]=a52_0x56e132(0x26b);async[a52_0x56e132(0x234)](_0x87409){const _0x298a59=a52_0x56e132,{options:_0xbb8486,args:_0x469da4,tdx:_0xe667be}=_0x87409,_0x531815=_0x469da4[0x0],_0x566fa3=_0x469da4[0x1]||'.';if(!_0x531815)return console[_0x298a59(0x2b7)](_0x298a59(0x26f)),console[_0x298a59(0x2b7)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x308cb2=_0xbb8486['revision'];_0xbb8486[_0x298a59(0x152)]&&(console[_0x298a59(0x2b7)](_0x298a59(0x158)+_0x531815),console[_0x298a59(0x2b7)](_0x298a59(0x245)+_0x566fa3),_0x308cb2&&console[_0x298a59(0x2b7)](_0x298a59(0x233)+_0x308cb2));const _0x1104a2=await withSpinner(_0x298a59(0x2bc)+_0x531815+_0x298a59(0x1ad),()=>_0xe667be[_0x298a59(0x151)]['download'](_0x531815,_0x566fa3,{'revision':_0x308cb2}),{'verbose':_0xbb8486[_0x298a59(0x152)]}),_0x56ff79=_0x1104a2[_0x298a59(0x267)];return console[_0x298a59(0x2b7)](_0x298a59(0x23b)+_0x56ff79[_0x298a59(0x293)]),console[_0x298a59(0x2b7)](_0x298a59(0x1a5)+_0x56ff79[_0x298a59(0x241)]),console[_0x298a59(0x2b7)]('\x20\x20Files\x20extracted:\x20'+_0x56ff79[_0x298a59(0x22e)]),console[_0x298a59(0x2b7)](_0x298a59(0x22d)+_0x566fa3+'/'+_0x56ff79[_0x298a59(0x293)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a52_0x56e132(0x1db)]='workflow:upload';[a52_0x56e132(0x2b0)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async[a52_0x56e132(0x234)](_0x43ce65){const _0x2f68b4=a52_0x56e132,{options:_0x114aa4,args:_0x3a2624,tdx:_0x33e36b}=_0x43ce65;let _0x22a52f='.',_0x5d100a=_0x114aa4['name'];if(_0x3a2624[0x0]){const {promises:_0x1d686a}=await import('fs');try{const _0x66a8d4=await _0x1d686a[_0x2f68b4(0x257)](_0x3a2624[0x0]);if(_0x66a8d4[_0x2f68b4(0x1ff)]())_0x22a52f=_0x3a2624[0x0];else return console['error'](_0x2f68b4(0x1ed)+_0x3a2624[0x0]+_0x2f68b4(0x1f6)),0x1;}catch{_0x5d100a=_0x3a2624[0x0],_0x22a52f='.';}}const _0x3b3496=_0x114aa4['revision'],_0x154aa7=_0x114aa4[_0x2f68b4(0x23f)];_0x114aa4[_0x2f68b4(0x152)]&&(console[_0x2f68b4(0x2b7)]('Project\x20directory:\x20'+_0x22a52f),_0x5d100a&&console['error'](_0x2f68b4(0x174)+_0x5d100a),_0x3b3496&&console[_0x2f68b4(0x2b7)]('Revision:\x20'+_0x3b3496),_0x154aa7&&console[_0x2f68b4(0x2b7)](_0x2f68b4(0x13c)));const _0x33ee1b=await withSpinner(_0x2f68b4(0x2b5),()=>_0x33e36b[_0x2f68b4(0x151)][_0x2f68b4(0x237)](_0x22a52f,{'projectName':_0x5d100a,'revision':_0x3b3496,'skipValidation':_0x154aa7}),{'verbose':_0x114aa4[_0x2f68b4(0x152)]}),_0x981ac9=_0x33ee1b[_0x2f68b4(0x267)];return console['error'](_0x2f68b4(0x25d)+_0x981ac9[_0x2f68b4(0x293)]),console[_0x2f68b4(0x2b7)](_0x2f68b4(0x26e)+_0x981ac9['projectId']),console['error'](_0x2f68b4(0x1a5)+_0x981ac9[_0x2f68b4(0x241)]),await this[_0x2f68b4(0x238)](_0x33e36b,_0x981ac9[_0x2f68b4(0x293)],_0x114aa4['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']=a52_0x56e132(0x25a);[a52_0x56e132(0x2b0)]=a52_0x56e132(0x12a);async[a52_0x56e132(0x234)](_0x10af76){const _0x3a5d8c=a52_0x56e132,{options:_0x24bab6,args:_0x2065e1,tdx:_0x5ec040}=_0x10af76,_0xd34059=_0x2065e1[0x0],_0x247e8f=_0x2065e1[0x1];if(!_0xd34059)return console[_0x3a5d8c(0x2b7)](a52_0x141979['red'](_0x3a5d8c(0x2bf)),_0x3a5d8c(0x1ec)),console[_0x3a5d8c(0x2b7)](a52_0x141979['dim'](_0x3a5d8c(0x1e1))),0x1;const _0x309bf8=_0x24bab6[_0x3a5d8c(0x241)];_0x24bab6[_0x3a5d8c(0x152)]&&(console[_0x3a5d8c(0x2b7)]('Project:\x20'+_0xd34059),_0x247e8f&&console[_0x3a5d8c(0x2b7)]('Target\x20directory:\x20'+_0x247e8f),_0x309bf8&&console[_0x3a5d8c(0x2b7)]('Revision:\x20'+_0x309bf8),_0x24bab6[_0x3a5d8c(0x271)]&&console[_0x3a5d8c(0x2b7)](_0x3a5d8c(0x25b)));const _0xdd811c=await withSpinner(_0x3a5d8c(0x195)+_0xd34059+_0x3a5d8c(0x1ad),()=>_0x5ec040['workflow'][_0x3a5d8c(0x132)](_0xd34059,{'targetDir':_0x247e8f,'revision':_0x309bf8}),{'verbose':_0x24bab6[_0x3a5d8c(0x152)]}),_0x3af967=_0xdd811c[_0x3a5d8c(0x267)];_0x3af967[_0x3a5d8c(0x21e)]?console[_0x3a5d8c(0x2b7)](_0x3a5d8c(0x261)+_0x3af967[_0x3a5d8c(0x293)]):console[_0x3a5d8c(0x2b7)]('→\x20Project:\x20'+_0x3af967[_0x3a5d8c(0x293)]);console[_0x3a5d8c(0x2b7)]('\x20\x20Revision:\x20'+_0x3af967[_0x3a5d8c(0x241)]),console['error'](_0x3a5d8c(0x1fa)+(a52_0x2e86af[_0x3a5d8c(0x273)](process[_0x3a5d8c(0x2a6)](),_0x3af967[_0x3a5d8c(0x2b8)])||'.')),console[_0x3a5d8c(0x2b7)](_0x3a5d8c(0x1e6)+a52_0x141979[_0x3a5d8c(0x24f)]('+'+_0x3af967[_0x3a5d8c(0x2c1)]['new']+'\x20new')+',\x20'+(a52_0x141979[_0x3a5d8c(0x1cd)]('~'+_0x3af967[_0x3a5d8c(0x2c1)]['modified']+'\x20modified')+',\x20')+(a52_0x141979[_0x3a5d8c(0x258)]('-'+_0x3af967['summary'][_0x3a5d8c(0x1c0)]+'\x20deleted')+',\x20')+(''+a52_0x141979[_0x3a5d8c(0x140)](_0x3af967[_0x3a5d8c(0x2c1)]['unchanged']+'\x20unchanged')));for(const _0x19678a of _0x3af967[_0x3a5d8c(0x172)]){_0x19678a['type']===_0x3a5d8c(0x1da)&&_0x19678a[_0x3a5d8c(0x2b3)]&&(console['error']('\x0a'+a52_0x141979[_0x3a5d8c(0x222)]('---\x20'+_0x19678a[_0x3a5d8c(0x28e)])),console['error'](_0x19678a[_0x3a5d8c(0x2b3)]));}if(!_0x3af967['hasChanges'])return saveSessionContext({'workflow_project':_0x3af967['projectName']},_0x24bab6[_0x3a5d8c(0x2c4)]),console[_0x3a5d8c(0x2b7)](a52_0x141979[_0x3a5d8c(0x24f)](_0x3a5d8c(0x13a))),console[_0x3a5d8c(0x2b7)](a52_0x141979['dim'](_0x3a5d8c(0x1ce)+_0x3af967[_0x3a5d8c(0x293)])),0x0;if(_0x24bab6[_0x3a5d8c(0x271)])return console['error'](a52_0x141979[_0x3a5d8c(0x1cd)](_0x3a5d8c(0x204))),0x0;if(!_0x24bab6[_0x3a5d8c(0x296)]){if(!isInteractive())return console['error'](a52_0x141979['red'](_0x3a5d8c(0x21b)),_0x3a5d8c(0x165)),console[_0x3a5d8c(0x2b7)](a52_0x141979[_0x3a5d8c(0x140)](_0x3a5d8c(0x23e))),0x1;const _0x59e889=await confirmKey(_0x3a5d8c(0x1bc));if(!_0x59e889)return console[_0x3a5d8c(0x2b7)](a52_0x141979['yellow'](_0x3a5d8c(0x181)),_0x3a5d8c(0x200)),0x1;}await withSpinner(_0x3a5d8c(0x2a9),()=>_0x5ec040['workflow'][_0x3a5d8c(0x12f)](_0x3af967,{'revision':_0x309bf8}),{'verbose':_0x24bab6[_0x3a5d8c(0x152)]}),saveSessionContext({'workflow_project':_0x3af967[_0x3a5d8c(0x293)]},_0x24bab6[_0x3a5d8c(0x2c4)]),console[_0x3a5d8c(0x2b7)](a52_0x141979['green'](_0x3a5d8c(0x139)));const _0x37d67f=a52_0x2e86af['relative'](process[_0x3a5d8c(0x2a6)](),_0x3af967[_0x3a5d8c(0x2b8)])||'.';return console[_0x3a5d8c(0x2b7)](a52_0x141979[_0x3a5d8c(0x140)](_0x3a5d8c(0x22d)+_0x37d67f)),console[_0x3a5d8c(0x2b7)](a52_0x141979[_0x3a5d8c(0x140)](_0x3a5d8c(0x1ce)+_0x3af967[_0x3a5d8c(0x293)])),0x0;}}function a52_0x3e35(_0x104f98,_0x899197){_0x104f98=_0x104f98-0x11d;const _0x1698df=a52_0x1698();let _0x3e356f=_0x1698df[_0x104f98];return _0x3e356f;}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a52_0x56e132(0x1c3);[a52_0x56e132(0x2b0)]='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async[a52_0x56e132(0x234)](_0x378e02){const _0x45ac3e=a52_0x56e132,{options:_0x103564,args:_0x586f89,tdx:_0x4bd807}=_0x378e02,_0x5f0e06=this[_0x45ac3e(0x1a6)](_0x586f89,_0x103564),_0x13b7a5=_0x103564['revision'],_0x504c4e=_0x103564[_0x45ac3e(0x23f)];_0x103564[_0x45ac3e(0x152)]&&(_0x5f0e06&&console[_0x45ac3e(0x2b7)](_0x45ac3e(0x16f)+_0x5f0e06),_0x13b7a5&&console[_0x45ac3e(0x2b7)](_0x45ac3e(0x233)+_0x13b7a5),_0x103564['dryRun']&&console[_0x45ac3e(0x2b7)](_0x45ac3e(0x25b)),_0x504c4e&&console['error']('Validation:\x20skipped'));let _0x51d1f1;try{_0x51d1f1=await withSpinner(_0x45ac3e(0x27c),()=>_0x4bd807[_0x45ac3e(0x151)][_0x45ac3e(0x12b)]({'sourceDir':_0x5f0e06,'revision':_0x13b7a5,'skipValidation':_0x504c4e}),{'verbose':_0x103564['verbose']});}catch(_0x2c190b){if(_0x2c190b instanceof Error&&_0x2c190b[_0x45ac3e(0x1b0)][_0x45ac3e(0x274)](_0x45ac3e(0x128)))return console[_0x45ac3e(0x2b7)](a52_0x141979[_0x45ac3e(0x258)](_0x45ac3e(0x2bf)),_0x45ac3e(0x1c8)),_0x103564['workflowProject']?console[_0x45ac3e(0x2b7)](a52_0x141979[_0x45ac3e(0x140)](_0x45ac3e(0x1cf)+_0x103564['workflowProject']+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x103564[_0x45ac3e(0x135)]+'\x27')):console[_0x45ac3e(0x2b7)](a52_0x141979['dim'](_0x45ac3e(0x14c))),0x1;throw _0x2c190b;}const _0x4d875c=_0x51d1f1[_0x45ac3e(0x267)];console['error'](_0x45ac3e(0x266)+_0x4d875c['projectName']),console[_0x45ac3e(0x2b7)](_0x45ac3e(0x1f8)+_0x4d875c['sourceDir']),console[_0x45ac3e(0x2b7)](_0x45ac3e(0x1a5)+_0x4d875c[_0x45ac3e(0x241)]),console[_0x45ac3e(0x2b7)](_0x45ac3e(0x1e6)+a52_0x141979[_0x45ac3e(0x24f)]('+'+_0x4d875c[_0x45ac3e(0x2c1)][_0x45ac3e(0x1b7)]+_0x45ac3e(0x11e))+',\x20'+(a52_0x141979[_0x45ac3e(0x1cd)]('~'+_0x4d875c['summary'][_0x45ac3e(0x1da)]+_0x45ac3e(0x141))+',\x20')+(a52_0x141979[_0x45ac3e(0x258)]('-'+_0x4d875c[_0x45ac3e(0x2c1)]['deleted']+_0x45ac3e(0x15a))+',\x20')+(''+a52_0x141979['dim'](_0x4d875c[_0x45ac3e(0x2c1)][_0x45ac3e(0x230)]+_0x45ac3e(0x1d3))));for(const _0x51f048 of _0x4d875c[_0x45ac3e(0x172)]){_0x51f048['type']===_0x45ac3e(0x1da)&&_0x51f048['diff']&&(console[_0x45ac3e(0x2b7)]('\x0a'+a52_0x141979[_0x45ac3e(0x222)]('---\x20'+_0x51f048[_0x45ac3e(0x28e)])),console[_0x45ac3e(0x2b7)](_0x51f048[_0x45ac3e(0x2b3)]));}if(!_0x4d875c[_0x45ac3e(0x1eb)])return console[_0x45ac3e(0x2b7)](a52_0x141979[_0x45ac3e(0x24f)](_0x45ac3e(0x1c6))),await this[_0x45ac3e(0x238)](_0x4bd807,_0x4d875c['projectName'],_0x103564['site']),0x0;if(_0x103564[_0x45ac3e(0x271)])return console[_0x45ac3e(0x2b7)](a52_0x141979['yellow'](_0x45ac3e(0x1d9))),0x0;if(!_0x103564[_0x45ac3e(0x296)]){if(!isInteractive())return console[_0x45ac3e(0x2b7)](a52_0x141979['red']('\x0aError:'),_0x45ac3e(0x165)),console[_0x45ac3e(0x2b7)](a52_0x141979[_0x45ac3e(0x140)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x45690a=await confirmKey(_0x45ac3e(0x16d));if(!_0x45690a)return console['error'](a52_0x141979[_0x45ac3e(0x1cd)]('Cancelled'),_0x45ac3e(0x16a)),0x1;}const _0x218902=await withSpinner(_0x45ac3e(0x1fb),()=>_0x4bd807[_0x45ac3e(0x151)][_0x45ac3e(0x25e)](_0x4d875c),{'verbose':_0x103564[_0x45ac3e(0x152)]}),_0x47f245=_0x218902[_0x45ac3e(0x267)];return console[_0x45ac3e(0x2b7)](a52_0x141979[_0x45ac3e(0x24f)](_0x45ac3e(0x1bb))),console[_0x45ac3e(0x2b7)](_0x45ac3e(0x26e)+_0x47f245[_0x45ac3e(0x28b)]),console['error']('\x20\x20Revision:\x20'+_0x47f245[_0x45ac3e(0x241)]),await this['showWorkflowConsoleUrl'](_0x4bd807,_0x47f245[_0x45ac3e(0x293)],_0x103564['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a52_0x56e132(0x2ab);['description']=a52_0x56e132(0x142);async['execute'](_0x143860){const _0x99c379=a52_0x56e132,{options:_0x5d385a,args:_0x4a4673,tdx:_0xec0cf3}=_0x143860,_0x5e08f3=this[_0x99c379(0x1a6)](_0x4a4673,_0x5d385a),_0x47c32e=_0x5d385a['name'],_0x51b6b=_0x5d385a[_0x99c379(0x241)],_0x5e9080=_0x5d385a[_0x99c379(0x23f)];if(!_0x5e08f3)return console[_0x99c379(0x2b7)](a52_0x141979[_0x99c379(0x258)](_0x99c379(0x2bf)),'Source\x20directory\x20is\x20required'),console[_0x99c379(0x2b7)](a52_0x141979[_0x99c379(0x140)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x99c379(0x2b7)](a52_0x141979['dim'](_0x99c379(0x1e4))),0x1;if(!_0x47c32e)return console['error'](a52_0x141979[_0x99c379(0x258)](_0x99c379(0x2bf)),_0x99c379(0x1e8)),console[_0x99c379(0x2b7)](a52_0x141979[_0x99c379(0x140)](_0x99c379(0x220))),0x1;_0x5d385a[_0x99c379(0x152)]&&(console[_0x99c379(0x2b7)](_0x99c379(0x16f)+_0x5e08f3),console['error']('New\x20project\x20name:\x20'+_0x47c32e),_0x51b6b&&console[_0x99c379(0x2b7)]('Revision:\x20'+_0x51b6b),_0x5d385a[_0x99c379(0x271)]&&console[_0x99c379(0x2b7)](_0x99c379(0x25b)),_0x5e9080&&console[_0x99c379(0x2b7)](_0x99c379(0x13c)));const _0x413c09=await withSpinner('Analyzing\x20project...',()=>_0xec0cf3[_0x99c379(0x151)][_0x99c379(0x199)](_0x5e08f3,_0x47c32e,{'revision':_0x51b6b,'skipValidation':_0x5e9080}),{'verbose':_0x5d385a[_0x99c379(0x152)]}),_0x45726a=_0x413c09[_0x99c379(0x267)];console[_0x99c379(0x2b7)](_0x99c379(0x14a)+_0x45726a[_0x99c379(0x23d)]);_0x45726a['sourceProjectName']&&console[_0x99c379(0x2b7)](_0x99c379(0x153)+_0x45726a[_0x99c379(0x299)]);console['error'](_0x99c379(0x26c)+_0x45726a[_0x99c379(0x26a)]),console['error'](_0x99c379(0x233)+_0x45726a['revision']),console['error'](_0x99c379(0x2c7)+_0x45726a['fileCount']);_0x45726a['targetExists']&&(console['error'](a52_0x141979['yellow'](_0x99c379(0x1b4)+_0x45726a[_0x99c379(0x26a)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x45726a[_0x99c379(0x279)]+')')),console['error'](a52_0x141979[_0x99c379(0x1cd)](_0x99c379(0x15f))));if(_0x5d385a['dryRun'])return console[_0x99c379(0x2b7)](a52_0x141979[_0x99c379(0x1cd)]('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x5d385a[_0x99c379(0x296)]){if(!isInteractive())return console[_0x99c379(0x2b7)](a52_0x141979[_0x99c379(0x258)](_0x99c379(0x21b)),_0x99c379(0x165)),console[_0x99c379(0x2b7)](a52_0x141979['dim'](_0x99c379(0x23e))),0x1;const _0x56c498=_0x45726a[_0x99c379(0x299)]||a52_0x2e86af[_0x99c379(0x22c)](_0x5e08f3),_0x718782=_0x45726a[_0x99c379(0x137)]?_0x99c379(0x28f)+_0x47c32e+_0x99c379(0x244):_0x99c379(0x20e)+_0x56c498+'\x22\x20to\x20new\x20project\x20\x22'+_0x47c32e+'\x22?',_0x119460=await confirmKey(_0x718782);if(!_0x119460)return console['error'](a52_0x141979[_0x99c379(0x1cd)](_0x99c379(0x181))),0x1;}const _0x32f8c9=await withSpinner(_0x45726a[_0x99c379(0x137)]?_0x99c379(0x120)+_0x47c32e+_0x99c379(0x1ad):_0x99c379(0x1ef)+_0x47c32e+'...',()=>_0xec0cf3[_0x99c379(0x151)][_0x99c379(0x184)](_0x45726a),{'verbose':_0x5d385a['verbose']}),_0x50615e=_0x32f8c9[_0x99c379(0x267)];return console[_0x99c379(0x2b7)](a52_0x141979[_0x99c379(0x24f)](_0x45726a[_0x99c379(0x137)]?_0x99c379(0x122):_0x99c379(0x133))),console[_0x99c379(0x2b7)](_0x99c379(0x29e)+_0x50615e[_0x99c379(0x26a)]),console[_0x99c379(0x2b7)](_0x99c379(0x26e)+_0x50615e[_0x99c379(0x201)]),console[_0x99c379(0x2b7)](_0x99c379(0x1a5)+_0x50615e[_0x99c379(0x241)]),await this[_0x99c379(0x238)](_0xec0cf3,_0x50615e[_0x99c379(0x26a)],_0x5d385a[_0x99c379(0x2c5)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a52_0x56e132(0x2b9);[a52_0x56e132(0x2b0)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a52_0x56e132(0x234)](_0x2dfaa3){const _0x45ef38=a52_0x56e132,{options:_0x341c45,args:_0x3aa1f2,tdx:_0x10dbd6}=_0x2dfaa3,_0x4a26fb=_0x3aa1f2[0x0];if(!_0x4a26fb)return console[_0x45ef38(0x2b7)](_0x45ef38(0x2a3)),console[_0x45ef38(0x2b7)](_0x45ef38(0x19d)),0x1;_0x341c45[_0x45ef38(0x152)]&&console['error'](_0x45ef38(0x158)+_0x4a26fb);if(!_0x341c45[_0x45ef38(0x296)]){if(!isInteractive())return console['error'](a52_0x141979['red'](_0x45ef38(0x21b)),_0x45ef38(0x165)),console[_0x45ef38(0x2b7)](a52_0x141979['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1c7899=await confirmKey(_0x45ef38(0x1a8)+_0x4a26fb+_0x45ef38(0x2c0));if(!_0x1c7899)return console[_0x45ef38(0x2b7)](a52_0x141979[_0x45ef38(0x1cd)](_0x45ef38(0x181))),0x1;}const _0x2095de=await withSpinner('Deleting\x20project\x20'+_0x4a26fb+_0x45ef38(0x1ad),()=>_0x10dbd6[_0x45ef38(0x151)]['delete'](_0x4a26fb),{'verbose':_0x341c45['verbose']}),_0x425102=_0x2095de[_0x45ef38(0x267)];return console[_0x45ef38(0x2b7)](_0x45ef38(0x203)+_0x425102[_0x45ef38(0x293)]),console[_0x45ef38(0x2b7)](_0x45ef38(0x26e)+_0x425102[_0x45ef38(0x28b)]),0x0;}}export function parseKeyValue(_0x3941ec){const _0x51ae70=a52_0x56e132,_0xa0051c=_0x3941ec[_0x51ae70(0x1fe)]('=');if(_0xa0051c===-0x1)throw new Error(_0x51ae70(0x125)+_0x3941ec+_0x51ae70(0x1a7));const _0x3d46ed=_0x3941ec[_0x51ae70(0x256)](0x0,_0xa0051c),_0x5956fe=_0x3941ec['substring'](_0xa0051c+0x1);if(!_0x3d46ed)throw new Error(_0x51ae70(0x1b5));return{'key':_0x3d46ed,'value':_0x5956fe};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a52_0x56e132(0x1db)]=a52_0x56e132(0x2a1);['description']=a52_0x56e132(0x1c4);async['execute'](_0x30c112){const _0x4bce1c=a52_0x56e132,{options:_0x3048b9,args:_0x3ff355,tdx:_0x58a661}=_0x30c112,_0xad0093=this[_0x4bce1c(0x214)](_0x3ff355,_0x3048b9);if(!_0xad0093)return 0x1;_0x3048b9[_0x4bce1c(0x152)]&&console[_0x4bce1c(0x2b7)]('Project:\x20'+_0xad0093);const _0x19a195=await withSpinner(_0x4bce1c(0x23a),()=>_0x58a661['workflow'][_0x4bce1c(0x180)](_0xad0093),{'verbose':_0x3048b9['verbose']}),{secrets:_0x3a0a3d}=_0x19a195['data'];return console[_0x4bce1c(0x2b7)](_0x4bce1c(0x14b)+_0x3a0a3d[_0x4bce1c(0x18c)]+_0x4bce1c(0x211)+(_0x3a0a3d['length']!==0x1?'s':'')),await handleSDKOutput(_0x3a0a3d,_0x3048b9),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a52_0x56e132(0x1db)]=a52_0x56e132(0x1e9);[a52_0x56e132(0x2b0)]=a52_0x56e132(0x1ea);async[a52_0x56e132(0x234)](_0xeb247a){const _0x549c7c=a52_0x56e132,{options:_0x4eadc9,args:_0x18ef53,tdx:_0x1fbe76}=_0xeb247a;let _0x122e9c,_0x417ec1;if(_0x18ef53[_0x549c7c(0x18c)]>=0x1&&!_0x18ef53[0x0][_0x549c7c(0x274)]('='))_0x122e9c=_0x18ef53[0x0],_0x417ec1=_0x18ef53['slice'](0x1);else{if(_0x18ef53[_0x549c7c(0x18c)]>=0x1&&_0x4eadc9[_0x549c7c(0x135)])_0x122e9c=_0x4eadc9['workflowProject'],_0x417ec1=_0x18ef53;else return _0x18ef53[_0x549c7c(0x18c)]>=0x1?(console['error'](_0x549c7c(0x26f)),console[_0x549c7c(0x2b7)](_0x549c7c(0x1b3)),0x1):(console[_0x549c7c(0x2b7)](_0x549c7c(0x27e)),console[_0x549c7c(0x2b7)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1);}if(_0x417ec1[_0x549c7c(0x18c)]===0x0)return console['error']('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console['error'](_0x549c7c(0x18d)),0x1;const _0x2fee9a={};try{for(const _0x46b87f of _0x417ec1){const {key:_0x5858d8,value:_0x5d3034}=parseKeyValue(_0x46b87f);_0x2fee9a[_0x5858d8]=_0x5d3034;}}catch(_0x4018f7){return _0x4018f7 instanceof Error&&console[_0x549c7c(0x2b7)](a52_0x141979['red'](_0x549c7c(0x2bf)),_0x4018f7[_0x549c7c(0x1b0)]),0x1;}const _0x14689f=Object[_0x549c7c(0x223)](_0x2fee9a);_0x4eadc9[_0x549c7c(0x152)]&&(console[_0x549c7c(0x2b7)]('Project:\x20'+_0x122e9c),console[_0x549c7c(0x2b7)](_0x549c7c(0x14d)+_0x14689f['join'](',\x20')));const _0x92355e=await withSpinner(_0x14689f[_0x549c7c(0x18c)]===0x1?_0x549c7c(0x1cc):_0x549c7c(0x1e3)+_0x14689f[_0x549c7c(0x18c)]+_0x549c7c(0x259),()=>_0x1fbe76[_0x549c7c(0x151)][_0x549c7c(0x1ab)](_0x122e9c,_0x2fee9a),{'verbose':_0x4eadc9[_0x549c7c(0x152)]}),_0x20d10e=_0x92355e[_0x549c7c(0x267)];return console[_0x549c7c(0x2b7)](_0x14689f[_0x549c7c(0x18c)]===0x1?_0x549c7c(0x264)+_0x20d10e[_0x549c7c(0x223)][0x0]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x20d10e[_0x549c7c(0x293)]+'\x27':'✔\x20'+_0x20d10e['keys'][_0x549c7c(0x18c)]+_0x549c7c(0x145)+_0x20d10e[_0x549c7c(0x293)]+'\x27'),(_0x4eadc9['json']||_0x4eadc9[_0x549c7c(0x19e)])&&await handleSingleObjectOutput(_0x20d10e,_0x4eadc9),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a52_0x56e132(0x22a);[a52_0x56e132(0x2b0)]=a52_0x56e132(0x27f);async[a52_0x56e132(0x234)](_0xfb347b){const _0x46ab58=a52_0x56e132,{options:_0x5126a3,args:_0x134b48,tdx:_0x3c6127}=_0xfb347b;let _0x4b1ac1,_0x348a33;if(_0x134b48[_0x46ab58(0x18c)]>=0x2)_0x4b1ac1=_0x134b48[0x0],_0x348a33=_0x134b48[0x1];else{if(_0x134b48[_0x46ab58(0x18c)]===0x1&&_0x5126a3[_0x46ab58(0x135)])_0x4b1ac1=_0x5126a3[_0x46ab58(0x135)],_0x348a33=_0x134b48[0x0];else return _0x134b48['length']===0x1?(console['error'](_0x46ab58(0x26f)),console[_0x46ab58(0x2b7)](_0x46ab58(0x1b3)),0x1):(console[_0x46ab58(0x2b7)](_0x46ab58(0x294)),console[_0x46ab58(0x2b7)]('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x5126a3['verbose']&&(console[_0x46ab58(0x2b7)](_0x46ab58(0x158)+_0x4b1ac1),console[_0x46ab58(0x2b7)](_0x46ab58(0x1c7)+_0x348a33));if(!_0x5126a3[_0x46ab58(0x296)]){if(!isInteractive())return console[_0x46ab58(0x2b7)](a52_0x141979[_0x46ab58(0x258)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x46ab58(0x2b7)](a52_0x141979[_0x46ab58(0x140)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3cbcaf=await confirmKey(_0x46ab58(0x2a4)+_0x348a33+_0x46ab58(0x13b)+_0x4b1ac1+'\x27?');if(!_0x3cbcaf)return console[_0x46ab58(0x2b7)](a52_0x141979['yellow'](_0x46ab58(0x181))),0x1;}const _0x2b1e66=await withSpinner(_0x46ab58(0x217),()=>_0x3c6127[_0x46ab58(0x151)][_0x46ab58(0x175)](_0x4b1ac1,_0x348a33),{'verbose':_0x5126a3[_0x46ab58(0x152)]}),_0x44e31c=_0x2b1e66[_0x46ab58(0x267)];return console[_0x46ab58(0x2b7)](_0x46ab58(0x264)+_0x44e31c[_0x46ab58(0x215)]+_0x46ab58(0x224)+_0x44e31c['projectName']+'\x27'),(_0x5126a3['json']||_0x5126a3[_0x46ab58(0x19e)])&&await handleSingleObjectOutput(_0x44e31c,_0x5126a3),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(_0x3f4f70){const _0x352d84=a52_0x56e132,_0xc4f582=Math[_0x352d84(0x1be)](_0x3f4f70/0x3e8),_0x5f13fd=Math[_0x352d84(0x1be)](_0xc4f582/0x3c),_0x265f89=Math[_0x352d84(0x1be)](_0x5f13fd/0x3c),_0x64a740=Math['floor'](_0x265f89/0x18);if(_0x64a740>0x0){const _0x35ab78=_0x265f89%0x18;return _0x35ab78>0x0?_0x64a740+'d\x20'+_0x35ab78+'h':_0x64a740+'d';}else{if(_0x265f89>0x0){const _0x4b4f0a=_0x5f13fd%0x3c;return _0x4b4f0a>0x0?_0x265f89+'h\x20'+_0x4b4f0a+'m':_0x265f89+'h';}else{if(_0x5f13fd>0x0){const _0x416ff3=_0xc4f582%0x3c;return _0x416ff3>0x0?_0x5f13fd+'m\x20'+_0x416ff3+'s':_0x5f13fd+'m';}else return _0xc4f582+'s';}}}function formatTimestamp(_0x124195,_0x4eccdd){const _0x4b4d09=a52_0x56e132,_0x122618=new Date(_0x124195),_0x5abf54=String(_0x122618[_0x4b4d09(0x25c)]())[_0x4b4d09(0x167)](0x2,'0'),_0x262cf3=String(_0x122618['getMinutes']())[_0x4b4d09(0x167)](0x2,'0'),_0x177055=_0x5abf54+':'+_0x262cf3,_0x2f1108=_0x122618[_0x4b4d09(0x1c5)]()===_0x4eccdd[_0x4b4d09(0x1c5)]()&&_0x122618[_0x4b4d09(0x1a4)]()===_0x4eccdd[_0x4b4d09(0x1a4)]()&&_0x122618[_0x4b4d09(0x2c6)]()===_0x4eccdd[_0x4b4d09(0x2c6)]();if(_0x2f1108)return _0x177055;else{const _0xea0b7a=String(_0x122618[_0x4b4d09(0x1a4)]()+0x1)[_0x4b4d09(0x167)](0x2,'0'),_0x5211fb=String(_0x122618[_0x4b4d09(0x2c6)]())[_0x4b4d09(0x167)](0x2,'0');return _0xea0b7a+'-'+_0x5211fb+'\x20'+_0x177055;}}function formatDate(_0x20f03d){const _0x2e8ebb=a52_0x56e132,_0x1de6e1=_0x20f03d[_0x2e8ebb(0x1c5)](),_0x3fa582=String(_0x20f03d['getMonth']()+0x1)['padStart'](0x2,'0'),_0x2d8044=String(_0x20f03d[_0x2e8ebb(0x2c6)]())['padStart'](0x2,'0');return _0x1de6e1+'-'+_0x3fa582+'-'+_0x2d8044;}function getTaskStateIcon(_0x65ce65){const _0x76eea2={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x76eea2[_0x65ce65]||'⚪';}function getBarChar(_0x37fd17){const _0x121113=a52_0x56e132;return _0x37fd17===_0x121113(0x2b7)||_0x37fd17===_0x121113(0x176)?'×':'─';}function getBarColor(_0x2b67ff){const _0x23a74f=a52_0x56e132,_0x45d41d={'success':a52_0x141979[_0x23a74f(0x24f)],'error':a52_0x141979[_0x23a74f(0x258)],'group_error':a52_0x141979[_0x23a74f(0x258)],'running':a52_0x141979[_0x23a74f(0x178)],'blocked':a52_0x141979[_0x23a74f(0x1cd)],'planned':a52_0x141979[_0x23a74f(0x140)],'canceling':a52_0x141979[_0x23a74f(0x1cd)]};return _0x45d41d[_0x2b67ff]||a52_0x141979['white'];}function parseTaskName(_0x4c93c1){const _0x157ecd=a52_0x56e132;let _0x101f52=_0x4c93c1[_0x157ecd(0x283)](/^\++/,'');const _0x2f0712=_0x101f52['split']('+'),_0x8df7b0=_0x2f0712[_0x157ecd(0x18c)]>0x1?_0x2f0712['length']-0x2:0x0,_0x1209ed=_0x2f0712[_0x2f0712['length']-0x1]||_0x101f52;return{'level':_0x8df7b0,'name':'+'+_0x1209ed};}function truncateTaskName(_0x3ff736,_0x4c5cf2){const _0x11399f=a52_0x56e132,_0x54b163=stringWidth(_0x3ff736);if(_0x54b163<=_0x4c5cf2)return _0x3ff736;let _0xc86458=_0x3ff736;while(stringWidth(_0xc86458+'…')>_0x4c5cf2&&_0xc86458[_0x11399f(0x18c)]>0x0){_0xc86458=_0xc86458[_0x11399f(0x20a)](0x0,-0x1);}return _0xc86458+'…';}function calculateTimeScale(_0x4838fa,_0x1fa97c){const _0x1b7eba=a52_0x56e132;return{'startTime':_0x4838fa[_0x1b7eba(0x272)],'endTime':_0x4838fa[_0x1b7eba(0x207)],'durationMs':_0x4838fa[_0x1b7eba(0x15b)],'msPerChar':_0x4838fa['duration']/_0x1fa97c};}function timeToPosition(_0x39f37e,_0x27789a,_0x4a7fc0){const _0x5cdff3=a52_0x56e132,_0x574ed5=_0x39f37e-_0x27789a[_0x5cdff3(0x19a)],_0x325d95=Math[_0x5cdff3(0x1be)](_0x574ed5/_0x27789a[_0x5cdff3(0x14f)]);return Math[_0x5cdff3(0x29d)](0x0,Math[_0x5cdff3(0x193)](_0x325d95,_0x4a7fc0));}function renderTimeAxis(_0x7cb4db,_0xead31d){const _0x423af4=a52_0x56e132,_0x55bc2a=Math[_0x423af4(0x193)](TIMELINE_CONFIG[_0x423af4(0x225)],Math[_0x423af4(0x29d)](TIMELINE_CONFIG[_0x423af4(0x1fd)],Math[_0x423af4(0x1be)](_0xead31d/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x36d8f5=_0x7cb4db[_0x423af4(0x219)]/(_0x55bc2a-0x1),_0x29dc2d=new Date(_0x7cb4db['startTime']),_0x45fb24=[];for(let _0x5827e2=0x0;_0x5827e2<_0x55bc2a;_0x5827e2++){const _0x58d500=_0x7cb4db[_0x423af4(0x19a)]+_0x5827e2*_0x36d8f5,_0x57e259=timeToPosition(_0x58d500,_0x7cb4db,_0xead31d),_0x112c3a=formatTimestamp(_0x58d500,_0x29dc2d);_0x45fb24[_0x423af4(0x237)]({'pos':_0x57e259,'text':_0x112c3a});}const _0x2c5241=new Array(_0xead31d)['fill']('\x20');let _0x11c1b2=-0x1;for(const {pos:_0x3c09c6,text:_0x59bc55}of _0x45fb24){let _0x426e1b=Math[_0x423af4(0x29d)](0x0,_0x3c09c6-Math[_0x423af4(0x1be)](_0x59bc55['length']/0x2));_0x426e1b<=_0x11c1b2+TIMELINE_CONFIG[_0x423af4(0x27a)]&&(_0x426e1b=_0x11c1b2+TIMELINE_CONFIG[_0x423af4(0x27a)]+0x1);_0x426e1b+_0x59bc55[_0x423af4(0x18c)]>_0xead31d&&(_0x426e1b=_0xead31d-_0x59bc55[_0x423af4(0x18c)]);if(_0x426e1b>=0x0&&_0x426e1b+_0x59bc55['length']<=_0xead31d&&_0x426e1b>_0x11c1b2){for(let _0x5426e3=0x0;_0x5426e3<_0x59bc55[_0x423af4(0x18c)];_0x5426e3++){_0x2c5241[_0x426e1b+_0x5426e3]=_0x59bc55[_0x5426e3];}_0x11c1b2=_0x426e1b+_0x59bc55[_0x423af4(0x18c)]-0x1;}}return _0x2c5241[_0x423af4(0x17d)]('');}function renderTaskRow(_0x28db9f,_0x44b9fb,_0x36a1c7,_0x5af8ad){const _0x542ca5=a52_0x56e132,{level:_0x320371,name:_0x41f970}=parseTaskName(_0x28db9f[_0x542ca5(0x1db)]),_0x5cbb88='\x20'['repeat'](_0x320371),_0x27c377=_0x28db9f[_0x542ca5(0x194)]?'('+formatElapsed(_0x28db9f[_0x542ca5(0x194)][_0x542ca5(0x15b)])+')':'',_0xf4e44=stringWidth(_0x27c377),_0xf12940=_0x320371*0x1,_0x45f5b0=_0x5af8ad-_0xf12940-_0xf4e44-0x1,_0x3ba518=truncateTaskName(_0x41f970,_0x45f5b0),_0x1bb9c9=_0x5cbb88+_0x3ba518,_0x5519fb=stringWidth(_0x1bb9c9),_0x139423=_0x5af8ad-_0x5519fb-_0xf4e44,_0x2abf0f=_0x1bb9c9+'\x20'[_0x542ca5(0x276)](Math[_0x542ca5(0x29d)](0x1,_0x139423))+a52_0x141979[_0x542ca5(0x140)](_0x27c377),_0x232502=getTaskStateIcon(_0x28db9f[_0x542ca5(0x2cb)]),_0x3ed1a5=new Array(_0x36a1c7)[_0x542ca5(0x1e0)]('\x20');if(_0x28db9f[_0x542ca5(0x194)]){const _0x287e44=timeToPosition(_0x28db9f['window']['start'],_0x44b9fb,_0x36a1c7),_0x1f01e2=timeToPosition(_0x28db9f[_0x542ca5(0x194)]['end'],_0x44b9fb,_0x36a1c7),_0x4bd98b=getBarChar(_0x28db9f[_0x542ca5(0x2cb)]),_0x5aba1b=Math[_0x542ca5(0x29d)](_0x287e44+0x1,_0x1f01e2);for(let _0x109402=_0x287e44;_0x109402<Math[_0x542ca5(0x193)](_0x5aba1b,_0x36a1c7);_0x109402++){_0x3ed1a5[_0x109402]=_0x4bd98b;}}const _0x1468de=getBarColor(_0x28db9f[_0x542ca5(0x2cb)]),_0x3b285c=_0x3ed1a5[_0x542ca5(0x17c)](_0x3e698d=>_0x3e698d==='\x20'?'\x20':_0x1468de(_0x3e698d))[_0x542ca5(0x17d)]('');return _0x232502+'\x20'+_0x2abf0f+'│'+_0x3b285c+'│';}function calculateStats(_0x4c02d9){const _0x924c06=a52_0x56e132,_0x1939f7={'total':_0x4c02d9['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x41d5bc of _0x4c02d9){if(_0x41d5bc[_0x924c06(0x2cb)]===_0x924c06(0x29f))_0x1939f7[_0x924c06(0x29f)]++;else{if(_0x41d5bc[_0x924c06(0x2cb)]===_0x924c06(0x2b7)||_0x41d5bc[_0x924c06(0x2cb)]==='group_error')_0x1939f7[_0x924c06(0x2b7)]++;else _0x41d5bc['state']===_0x924c06(0x1ee)?_0x1939f7[_0x924c06(0x1ee)]++:_0x1939f7['pending']++;}}return _0x1939f7;}function formatStats(_0x5693bd){const _0x33cfd7=a52_0x56e132;return['Total:\x20'+_0x5693bd[_0x33cfd7(0x265)],'✅\x20'+_0x5693bd[_0x33cfd7(0x29f)],'❌\x20'+_0x5693bd['error'],_0x33cfd7(0x218)+_0x5693bd['running'],'⏳\x20'+_0x5693bd[_0x33cfd7(0x2be)]]['join']('\x20\x20');}function a52_0x1698(){const _0xc41183=['targetDir','workflow:delete','\x20logs','resolveProjectId','Downloading\x20project\x20','renderSingleTimeline','pending','Error:','\x22?\x20This\x20cannot\x20be\x20undone.','summary','209245tKnWnE','attempt','session','site','getDate','Files\x20to\x20upload:\x20','2694444WjFsYb','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','planned','state','utf-8','isTTY','session_id','\x20new','Downloading\x20logs...','Updating\x20','toLowerCase','✔\x20Project\x20updated','Warning:','\x0aPolling...\x20(','Invalid\x20format:\x20','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','stdout','No\x20workflow\x20tdx.json\x20found','📋\x20','Pull\x20workflow\x20project\x20to\x20local\x20folder','preparePushProject','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','sessions','\x1b[1A\x1b[2K','applyPullProject','parseProjectWorkflowPattern','Resolving\x20project\x20\x27','pullProject','✔\x20Clone\x20complete','now','workflowProject','sys','targetExists','output','✔\x20Pull\x20complete','\x0a✔\x20Already\x20up\x20to\x20date','\x27\x20from\x20project\x20\x27','Validation:\x20skipped','value','MAX_TIMELINE_WIDTH','workflow:kill','dim','\x20modified','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','Killing\x20attempt...','fullName','\x20secrets\x20set\x20for\x20project\x20\x27','resolve','limit','\x20task','GUTTER','Source:\x20','✔\x20Found\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','Secrets\x20to\x20set:\x20','columns','msPerChar','\x20project','workflow','verbose','Source\x20project:\x20','\x20of\x20','No\x20workflows\x20found','3029467OalmSL','Error:\x20Invalid\x20JSON\x20in\x20--params','Project:\x20','done','\x20deleted','duration','No\x20log\x20files\x20found\x20for\x20this\x20attempt','MAX_POLL_ITERATIONS','trim','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','set','Session\x20','finishedAt','List\x20workflow\x20attempts','cancelRequested','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Session\x20time:\x20','padStart','💡\x20Tip:\x20Use\x20','getTime','-\x20nothing\x20pushed','text','325690yxwnVz','\x0aPush\x20these\x20changes?','fromTask','Source\x20directory:\x20','logs','fs/promises','changes','/sessions/','Project\x20name:\x20','deleteSecret','group_error','tdx\x20wf\x20attempt\x20','blue','sessionId','split','Auto-selected\x20latest\x20session:\x20','map','join','\x20\x20tdx\x20wf\x20use\x20<project>','Loading\x20session...','listSecrets','Cancelled','find','clear','executeCloneProject','index','match','splice','Params:\x20','\x20workflow','No\x20attempts\x20found','toISOString','length','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','reason','size','Getting\x20attempt\x20tasks...','No\x20sessions\x20found\x20in\x20project:\x20','get','min','window','Pulling\x20project\x20','force','List\x20workflow\x20execution\x20sessions','taskName','prepareCloneProject','startTime','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','logFiles','Usage:\x20workflow:delete\x20<project-name-or-id>','jsonl','canceling','param','List\x20workflows','navigateSessionsInteractive','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','getMonth','\x20\x20Revision:\x20','resolveProjectDir','.\x20Expected\x20format:\x20KEY=VALUE','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','retryAttempt','setSecrets','createdAt','...','some','No\x20workflow\x20sessions\x20found','message','ICON_SPACING','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','\x0a⚠\x20Project\x20\x22','Key\x20cannot\x20be\x20empty','includeRetried','new','Workflow:\x20','Latest\x20session\x20has\x20no\x20attempt','list','✔\x20Push\x20complete','\x0aApply\x20these\x20changes?','workflow:attempts','floor','parse','deleted','workflow:use','Select\x20a\x20task\x20to\x20view\x20logs:','workflow:push','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','getFullYear','\x0a✔\x20No\x20changes\x20to\x20push','Key:\x20','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Force:\x20yes','Getting\x20attempt\x20details...','params','Setting\x20secret...','yellow','\x20\x20Session\x20context\x20set\x20to:\x20','Tip:\x20cd\x20to\x20workflows/','2800647IpSSSr','attemptId','Listing\x20workflow\x20sessions...','\x20unchanged','workflow:logs','sort','lastAttempt','filter','has','\x0aDry\x20run\x20-\x20nothing\x20pushed','modified','name','workflow:workflows','Error:\x20Attempt\x20ID\x20is\x20required','displayLine','List\x20all\x20workflow\x20projects','fill','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','project','Setting\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','retryAttemptName','\x20\x20Changes:\x20','Starting\x20workflow\x20run...','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','workflow:secrets:set','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','hasChanges','Project\x20name\x20is\x20required','Error:\x20','running','Cloning\x20to\x20','Show\x20tasks\x20for\x20an\x20attempt','write','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','revision:\x20','Filter:\x20project=','workflow:retry','\x20is\x20not\x20a\x20directory','Usage:\x20tdx\x20wf\x20use\x20<project>','\x20\x20Source:\x20','6635619OfcZWG','\x20\x20Target:\x20','Pushing\x20project...','Select\x20a\x20session\x20to\x20view\x20timeline:','MIN_LABEL_COUNT','indexOf','isDirectory','-\x20no\x20files\x20written','newProjectId','Kill\x20a\x20running\x20attempt','✔\x20Deleted\x20project\x20','\x0aDry\x20run\x20-\x20no\x20files\x20written','📁\x20','tdx.json','end','status','Resume\x20from:\x20','slice','Attempt:\x20','Show\x20specific\x20attempt\x20details','Status:\x20','\x0aClone\x20\x22','renderSessionsTimeline','includeSubtasks','\x20secret','startsWith','20wRpsnK','requireProject','key','all','Deleting\x20secret...','🔄\x20','durationMs','Show\x20logs\x20for\x20a\x20workflow\x20attempt','\x0aError:','select','renderTimeline','isNewProject','unknown','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','every','cyan','keys','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','MAX_LABEL_COUNT','resumeFrom','Pattern:\x20','icon','workflow:projects','workflow:secrets:delete','Start\x20a\x20workflow\x20run','basename','\x20\x20Location:\x20','filesExtracted','MIN_TIMELINE_WIDTH','unchanged','task','Filter:\x20','Revision:\x20','execute','log','No\x20sessions\x20found\x20for:\x20','push','showWorkflowConsoleUrl','\x20\x20Session\x20ID:\x20','Listing\x20secrets...','✔\x20Downloaded\x20','\x20to\x20see\x20detailed\x20logs','sourceDir','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','skipValidation','follow','revision','Project\x20filter:\x20','✔\x20Retry\x20started','\x22\x20with\x20new\x20revision?','Output\x20directory:\x20','8kKwnWn','resolveProject','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','rows','Session\x20not\x20found:\x20','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','format','round','run','green','Attempt\x20ID:\x20','updatedAt','buildTimelineData','Using\x20attempt\x20','\x0a✔\x20Attempt\x20complete','autocomplete','substring','stat','red','\x20secrets...','workflow:pull','Dry\x20run:\x20yes','getHours','✔\x20Pushed\x20','executePushProject','\x20-\x20','✔\x20Workflow\x20project\x20context\x20cleared.','→\x20New\x20project:\x20','localeCompare','\x20\x20Console:\x20','✔\x20Secret\x20\x27','total','✔\x20Project:\x20','data','startedAt','Failed\x20to\x20fetch\x20attempt\x20data','newProjectName','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','New\x20project\x20name:\x20','12eUVPtb','\x20\x20Project\x20ID:\x20','Error:\x20Project\x20name\x20is\x20required','\x20has\x20no\x20attempts','dryRun','start','relative','includes','⚠\x20Showing\x20first\x20','repeat','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','\x20attempt','existingProjectId','LABEL_MIN_SPACING','workflowName','Analyzing\x20changes...','values','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','table','MAX_TASKS_DISPLAY','343728LKiacn','replace','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','✔\x20Workflow\x20run\x20started','Retrying\x20session...','\x20\x20New\x20attempt\x20ID:\x20','\x20(use\x20--limit\x20to\x20show\x20more)','sessionTime','context','projectId','Listing\x20workflow\x20attempts...','Retrying\x20attempt...','path','\x0aUpdate\x20existing\x20project\x20\x22','No\x20attempts\x20found\x20in\x20project:\x20','pollTimeline','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','projectName','Error:\x20Secret\x20key\x20is\x20required','fileSize','yes','\x20\x20Workflow:\x20','json','sourceProjectName','POLL_INTERVAL_MS','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','✔\x20Workflow\x20project\x20set\x20to:\x20','max','\x20\x20Project:\x20','success','No\x20log\x20content\x20found','workflow:secrets:list','Loading\x20sessions...','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','cwd','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','workflow:tasks','Writing\x20files...','/app/workflows/','workflow:clone','readFile','generateSessionTimelineRows','Task\x20name:\x20','ICON_WIDTH','description','workflows','tasks','diff','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Pushing\x20workflow\x20project...','No\x20workflow\x20projects\x20found','error'];a52_0x1698=function(){return _0xc41183;};return a52_0x1698();}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']='workflow:timeline';[a52_0x56e132(0x2b0)]='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a52_0x56e132(0x234)](_0x156c67){const _0x2b2069=a52_0x56e132,{options:_0x5e3686,args:_0x3379c7,tdx:_0x4e653c}=_0x156c67;let _0x2ddc03,_0x100793,_0xf52060=![];if(_0x3379c7[0x0]){if(_0x3379c7[0x0][_0x2b2069(0x274)]('.')){const _0x7719d=this['parseProjectWorkflowPattern'](_0x3379c7,_0x5e3686);if(!_0x7719d)return 0x1;_0x2ddc03=_0x7719d['projectName'],_0x100793=_0x7719d[_0x2b2069(0x27b)];}else{_0x100793=_0x3379c7[0x0],_0x2ddc03=_0x5e3686[_0x2b2069(0x135)];if(!_0x2ddc03)return console[_0x2b2069(0x2b7)](a52_0x141979[_0x2b2069(0x258)](_0x2b2069(0x2bf)),_0x2b2069(0x2b4)),0x1;_0xf52060=!![];}}else{const _0x4f297d=this['parseProjectWorkflowPattern'](_0x3379c7,_0x5e3686);if(!_0x4f297d)return 0x1;_0x2ddc03=_0x4f297d[_0x2b2069(0x293)],_0x100793=_0x4f297d['workflowName'];}if(_0x5e3686[_0x2b2069(0x152)]){if(_0x2ddc03&&_0x100793)console['error'](_0x2b2069(0x232)+_0x2ddc03+'.'+_0x100793);else _0x2ddc03&&console['error']('Filter:\x20project='+_0x2ddc03);}const _0x1469d6=_0x5e3686['attemptId'],_0x76ac25=_0x5e3686[_0x2b2069(0x179)];if(_0x1469d6){_0x76ac25&&console[_0x2b2069(0x2b7)](a52_0x141979[_0x2b2069(0x1cd)](_0x2b2069(0x123)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x560685=_0x5e3686[_0x2b2069(0x240)];return _0x560685?await this[_0x2b2069(0x291)](_0x156c67,_0x1469d6):await this[_0x2b2069(0x2bd)](_0x156c67,_0x1469d6,_0x5e3686),0x0;}if(_0x76ac25){const _0x77f270=await withSpinner(_0x2b2069(0x17f),()=>_0x4e653c[_0x2b2069(0x151)][_0x2b2069(0x12d)]({'projectName':_0x2ddc03,'workflowName':_0x100793,'limit':0x64}),{'verbose':_0x5e3686['verbose']}),_0x4dd0f8=_0x77f270[_0x2b2069(0x267)]['find'](_0xe22076=>_0xe22076['id']===_0x76ac25);if(!_0x4dd0f8)return console[_0x2b2069(0x2b7)](a52_0x141979[_0x2b2069(0x258)]('Error:'),_0x2b2069(0x24a)+_0x76ac25),0x1;if(!_0x4dd0f8[_0x2b2069(0x1d6)]?.['id'])return console['error'](a52_0x141979[_0x2b2069(0x258)]('Error:'),_0x2b2069(0x161)+_0x76ac25+_0x2b2069(0x270)),0x1;const _0x36124c=_0x4dd0f8['lastAttempt']['id'];_0x5e3686['verbose']&&console[_0x2b2069(0x2b7)](_0x2b2069(0x253)+_0x36124c+'\x20from\x20session\x20'+_0x76ac25);const _0x24f201=_0x5e3686['follow'];return _0x24f201?await this[_0x2b2069(0x291)](_0x156c67,_0x36124c):await this[_0x2b2069(0x2bd)](_0x156c67,_0x36124c,_0x5e3686),0x0;}const _0x30f631=await withSpinner(_0x2b2069(0x2a2),()=>_0x4e653c[_0x2b2069(0x151)][_0x2b2069(0x12d)]({'projectName':_0x2ddc03,'workflowName':_0x100793,'limit':_0x5e3686[_0x2b2069(0x147)]||0x32}),{'verbose':_0x5e3686['verbose']}),_0x3dc835=_0x30f631['data'];if(_0x3dc835[_0x2b2069(0x18c)]===0x0){if(_0x2ddc03&&_0x100793)console[_0x2b2069(0x2b7)](_0x2b2069(0x236)+_0x2ddc03+'.'+_0x100793);else _0x2ddc03?console[_0x2b2069(0x2b7)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x2ddc03):(console[_0x2b2069(0x2b7)](_0x2b2069(0x1af)),console[_0x2b2069(0x2b7)](a52_0x141979['dim'](_0x2b2069(0x19b))));return 0x0;}_0x3dc835[_0x2b2069(0x1d5)]((_0xfa3cc8,_0x446e07)=>{const _0x12daff=_0x2b2069,_0x15aed9=_0xfa3cc8[_0x12daff(0x289)]||'',_0x1c5ec3=_0x446e07[_0x12daff(0x289)]||'';return _0x1c5ec3[_0x12daff(0x262)](_0x15aed9);});if(_0x5e3686[_0x2b2069(0x298)]||_0x5e3686[_0x2b2069(0x19e)])return await handleSDKOutput(_0x3dc835,_0x5e3686),0x0;let _0x12ef90;if(_0xf52060){const _0x1479de=_0x3dc835[0x0];if(!_0x1479de[_0x2b2069(0x1d6)]?.['id'])return console['error'](_0x2b2069(0x1b9)),0x0;_0x12ef90=_0x1479de[_0x2b2069(0x1d6)]['id'],_0x5e3686[_0x2b2069(0x152)]&&console[_0x2b2069(0x2b7)](_0x2b2069(0x17b)+_0x1479de[_0x2b2069(0x289)]);}else{const _0x400f3c=_0x3dc835[_0x2b2069(0x17c)](_0x24224e=>{const _0x5b1435=_0x2b2069,_0x5dcbed=getAttemptStatusDisplay(_0x24224e['lastAttempt']);return{'title':_0x24224e[_0x5b1435(0x1e2)]?.['name']+'.'+_0x24224e[_0x5b1435(0x151)]?.[_0x5b1435(0x1db)]+_0x5b1435(0x25f)+_0x24224e[_0x5b1435(0x289)]+'\x20'+_0x5dcbed[_0x5b1435(0x228)],'value':_0x24224e[_0x5b1435(0x1d6)]?.['id']||'','description':_0x5dcbed[_0x5b1435(0x16b)]};}),_0x2ceae8=await a52_0x39c28f({'type':_0x2b2069(0x21c),'name':_0x2b2069(0x1d1),'message':_0x2b2069(0x1fc),'choices':_0x400f3c['filter'](_0x118752=>_0x118752[_0x2b2069(0x13d)]!=='')});if(!_0x2ceae8[_0x2b2069(0x1d1)])return 0x0;_0x12ef90=_0x2ceae8[_0x2b2069(0x1d1)];}const _0x4c56a0=_0x5e3686[_0x2b2069(0x240)];return _0x4c56a0?await this['pollTimeline'](_0x156c67,_0x12ef90):await this[_0x2b2069(0x2bd)](_0x156c67,_0x12ef90,_0x5e3686),0x0;}async[a52_0x56e132(0x2bd)](_0x886464,_0x53f769,_0x5f242d){const _0x5e0f8f=a52_0x56e132,{tdx:_0x37a43f}=_0x886464;let _0x3d6251,_0x1748be;try{[_0x3d6251,_0x1748be]=await Promise[_0x5e0f8f(0x216)]([_0x37a43f[_0x5e0f8f(0x151)][_0x5e0f8f(0x2c3)](_0x53f769),_0x37a43f[_0x5e0f8f(0x151)][_0x5e0f8f(0x2b2)](_0x53f769,![])]);}catch(_0x59294d){console[_0x5e0f8f(0x2b7)](a52_0x141979['red'](_0x5e0f8f(0x269)));_0x5f242d['verbose']&&console[_0x5e0f8f(0x2b7)](_0x59294d);throw _0x59294d;}if(_0x5f242d['json']||_0x5f242d[_0x5e0f8f(0x19e)]){const _0xd5c7ff=this[_0x5e0f8f(0x252)](_0x3d6251,_0x1748be);await handleSDKOutput([_0xd5c7ff],_0x5f242d);return;}const _0x4522cd=_0x37a43f[_0x5e0f8f(0x28a)][_0x5e0f8f(0x2c5)],_0x1ce7ae=this[_0x5e0f8f(0x21d)](_0x3d6251,_0x1748be,_0x4522cd);console[_0x5e0f8f(0x235)](_0x1ce7ae);}async[a52_0x56e132(0x291)](_0x20464b,_0x12b466){const _0x534a52=a52_0x56e132,{tdx:_0x9cecb}=_0x20464b,_0x4759e8=TIMELINE_CONFIG[_0x534a52(0x29a)],_0x3322dc=TIMELINE_CONFIG[_0x534a52(0x15d)];let _0x405682=0x0;while(_0x405682<_0x3322dc){process[_0x534a52(0x127)]['isTTY']&&process['stdout']['write']('\x1bc');let _0x41d065,_0x3ba539;try{[_0x41d065,_0x3ba539]=await Promise['all']([_0x9cecb[_0x534a52(0x151)][_0x534a52(0x2c3)](_0x12b466),_0x9cecb[_0x534a52(0x151)][_0x534a52(0x2b2)](_0x12b466,![])]);}catch(_0x16d4a4){console[_0x534a52(0x2b7)](a52_0x141979[_0x534a52(0x258)]('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x405682>0x0&&console['error'](a52_0x141979[_0x534a52(0x140)](_0x534a52(0x12c)+_0x405682));throw _0x16d4a4;}const _0x50fd8c=_0x9cecb[_0x534a52(0x28a)][_0x534a52(0x2c5)],_0x1981fb=this[_0x534a52(0x21d)](_0x41d065,_0x3ba539,_0x50fd8c);console[_0x534a52(0x235)](_0x1981fb);const _0x3370a3=_0x41d065['done']&&_0x3ba539[_0x534a52(0x221)](_0x3bb1eb=>_0x3bb1eb[_0x534a52(0x2cb)]!==_0x534a52(0x1ee)&&_0x3bb1eb[_0x534a52(0x2cb)]!==_0x534a52(0x2ca));if(_0x3370a3){console[_0x534a52(0x2b7)](a52_0x141979[_0x534a52(0x24f)](_0x534a52(0x254)));break;}console['error'](a52_0x141979[_0x534a52(0x140)](_0x534a52(0x124)+_0x405682*0x2+_0x534a52(0x1f2))),await new Promise(_0x4a944e=>setTimeout(_0x4a944e,_0x4759e8)),_0x405682++;}_0x405682>=_0x3322dc&&console[_0x534a52(0x2b7)](a52_0x141979[_0x534a52(0x1cd)](_0x534a52(0x2a5)));}['renderTimeline'](_0x244874,_0x50d4cb,_0x4e6d80){const _0x22ccf6=a52_0x56e132,_0x334508=[],_0x3ca19f=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x78db1a=0x5,_0xbddc33=process[_0x22ccf6(0x127)]['columns']||0x78,_0x7f7b4=_0xbddc33-_0x3ca19f-_0x78db1a,_0x382eda=Math[_0x22ccf6(0x29d)](TIMELINE_CONFIG[_0x22ccf6(0x22f)],Math[_0x22ccf6(0x193)](_0x7f7b4,TIMELINE_CONFIG[_0x22ccf6(0x13e)])),_0x3bf0f1=new Date(_0x244874[_0x22ccf6(0x1ac)])[_0x22ccf6(0x169)](),_0x226277=_0x244874[_0x22ccf6(0x162)]?new Date(_0x244874[_0x22ccf6(0x162)])['getTime']():Date[_0x22ccf6(0x134)](),_0x21cf3a={'start':_0x3bf0f1,'end':_0x226277,'duration':_0x226277-_0x3bf0f1},_0x160f2d=new Map(),_0x49017b=[];for(const _0x3c06b3 of _0x50d4cb){if(_0x3c06b3[_0x22ccf6(0x268)]){const _0x4fed61=new Date(_0x3c06b3[_0x22ccf6(0x268)])[_0x22ccf6(0x169)](),_0x5deb9e=_0x3c06b3[_0x22ccf6(0x251)]?new Date(_0x3c06b3['updatedAt'])[_0x22ccf6(0x169)]():Date[_0x22ccf6(0x134)](),_0x49a0c1={'start':_0x4fed61,'end':_0x5deb9e,'duration':_0x5deb9e-_0x4fed61};_0x160f2d[_0x22ccf6(0x160)](_0x3c06b3['id'],_0x49a0c1),_0x49017b[_0x22ccf6(0x237)]({'name':_0x3c06b3[_0x22ccf6(0x144)],'state':_0x3c06b3[_0x22ccf6(0x2cb)]||_0x22ccf6(0x21f),'window':_0x49a0c1});}else _0x49017b[_0x22ccf6(0x237)]({'name':_0x3c06b3[_0x22ccf6(0x144)],'state':_0x3c06b3['state']||_0x22ccf6(0x2ca),'window':undefined});}_0x49017b[_0x22ccf6(0x1d5)]((_0x41bd3d,_0x22c5d3)=>{const _0x318bf6=_0x22ccf6;if(!_0x41bd3d[_0x318bf6(0x194)])return 0x1;if(!_0x22c5d3[_0x318bf6(0x194)])return-0x1;return _0x41bd3d['window'][_0x318bf6(0x272)]-_0x22c5d3[_0x318bf6(0x194)][_0x318bf6(0x272)];});const _0x4743bf=_0x49017b[_0x22ccf6(0x18c)],_0x28ce3c=_0x4743bf>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x28ce3c&&_0x49017b[_0x22ccf6(0x187)](TIMELINE_CONFIG[_0x22ccf6(0x281)]);const _0x5cc1be=calculateTimeScale(_0x21cf3a,_0x382eda),_0x714ef6=_0x244874[_0x22ccf6(0x159)]?_0x244874[_0x22ccf6(0x29f)]?a52_0x141979[_0x22ccf6(0x24f)]('success'):a52_0x141979[_0x22ccf6(0x258)](_0x22ccf6(0x2b7)):a52_0x141979[_0x22ccf6(0x178)](_0x22ccf6(0x1ee)),_0x3eb48b=_0x244874[_0x22ccf6(0x1e2)]?.['id'],_0x58e79c=_0x244874[_0x22ccf6(0x179)];let _0x44009d;if(_0x3eb48b&&_0x58e79c){const _0x4a9c36=getWorkflowAttemptUrl(_0x4e6d80,_0x3eb48b,_0x58e79c,_0x244874['id']);_0x44009d=hyperlink(a52_0x141979[_0x22ccf6(0x140)](_0x244874['id']),_0x4a9c36);}else _0x44009d=a52_0x141979[_0x22ccf6(0x140)](_0x244874['id']);_0x334508[_0x22ccf6(0x237)](_0x22ccf6(0x20b)+_0x44009d+'\x20-\x20'+_0x714ef6+_0x22ccf6(0x25f)+formatElapsed(_0x21cf3a[_0x22ccf6(0x15b)]));if(_0x49017b[_0x22ccf6(0x18c)]>0x0){const _0xe0071f=renderTimeAxis(_0x5cc1be,_0x382eda),_0x49c561=new Date(_0x21cf3a[_0x22ccf6(0x272)]),_0x21d203=formatDate(_0x49c561),_0xe5ca2a=TIMELINE_CONFIG[_0x22ccf6(0x2af)]+TIMELINE_CONFIG[_0x22ccf6(0x1b1)]+_0x3ca19f,_0x3ee5ef=_0x21d203[_0x22ccf6(0x167)](_0xe5ca2a),_0x4bf55f=a52_0x141979[_0x22ccf6(0x140)](_0x3ee5ef);_0x334508[_0x22ccf6(0x237)](_0x4bf55f+'\x20'+_0xe0071f);for(const _0x345f4b of _0x49017b){_0x334508[_0x22ccf6(0x237)](renderTaskRow(_0x345f4b,_0x5cc1be,_0x382eda,_0x3ca19f));}const _0x5d5dc0=calculateStats(_0x49017b);_0x334508[_0x22ccf6(0x237)](formatStats(_0x5d5dc0)),_0x28ce3c&&_0x334508['push'](a52_0x141979['yellow'](_0x22ccf6(0x275)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x22ccf6(0x154)+_0x4743bf+'\x20tasks')),_0x334508[_0x22ccf6(0x237)](''),_0x334508['push'](a52_0x141979[_0x22ccf6(0x140)](_0x22ccf6(0x168))+(_0x22ccf6(0x177)+_0x244874['id']+_0x22ccf6(0x2ba))+a52_0x141979['dim'](_0x22ccf6(0x23c)));}else _0x334508[_0x22ccf6(0x237)](_0x22ccf6(0x292));return _0x334508[_0x22ccf6(0x17d)]('\x0a');}[a52_0x56e132(0x252)](_0x11102a,_0x4bffbc){const _0x405ce9=a52_0x56e132,_0x512d3f=new Date(_0x11102a[_0x405ce9(0x1ac)])[_0x405ce9(0x169)](),_0x118fa3=_0x11102a['finishedAt']?new Date(_0x11102a[_0x405ce9(0x162)])[_0x405ce9(0x169)]():Date[_0x405ce9(0x134)](),_0x1240ce=_0x118fa3-_0x512d3f,_0x269146=[];for(const _0x475538 of _0x4bffbc){if(_0x475538[_0x405ce9(0x268)]){const _0x2b3b7a=new Date(_0x475538[_0x405ce9(0x268)])[_0x405ce9(0x169)](),_0x32e7ba=_0x475538['updatedAt']?new Date(_0x475538[_0x405ce9(0x251)])[_0x405ce9(0x169)]():Date[_0x405ce9(0x134)]();_0x269146[_0x405ce9(0x237)]({'name':_0x475538['fullName'],'state':_0x475538[_0x405ce9(0x2cb)]||_0x405ce9(0x21f),'window':{'start':_0x2b3b7a,'end':_0x32e7ba,'duration':_0x32e7ba-_0x2b3b7a}});}else _0x269146['push']({'name':_0x475538[_0x405ce9(0x144)],'state':_0x475538[_0x405ce9(0x2cb)]||'planned','window':undefined});}const _0x467db4=calculateStats(_0x269146);return{'attempt':{'id':_0x11102a['id'],'status':_0x11102a[_0x405ce9(0x159)]?_0x11102a[_0x405ce9(0x29f)]?_0x405ce9(0x29f):'error':_0x405ce9(0x1ee),'createdAt':_0x11102a[_0x405ce9(0x1ac)],'finishedAt':_0x11102a['finishedAt'],'duration_ms':_0x1240ce},'tasks':_0x269146[_0x405ce9(0x17c)](_0x58776f=>({'name':_0x58776f[_0x405ce9(0x1db)],'state':_0x58776f[_0x405ce9(0x2cb)],'startedAt':_0x58776f['window']?new Date(_0x58776f['window'][_0x405ce9(0x272)])[_0x405ce9(0x18b)]():null,'updatedAt':_0x58776f['window']?new Date(_0x58776f['window'][_0x405ce9(0x207)])[_0x405ce9(0x18b)]():null,'duration_ms':_0x58776f['window']?.[_0x405ce9(0x15b)]||null})),'stats':_0x467db4};}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3d66b4,_0x398d31){const _0x2a1a58=a53_0x3bd6,_0x20ef24=_0x3d66b4();while(!![]){try{const _0x1a0d39=-parseInt(_0x2a1a58(0x79))/0x1*(-parseInt(_0x2a1a58(0x6d))/0x2)+-parseInt(_0x2a1a58(0x73))/0x3*(-parseInt(_0x2a1a58(0x72))/0x4)+parseInt(_0x2a1a58(0x7d))/0x5+parseInt(_0x2a1a58(0x76))/0x6+parseInt(_0x2a1a58(0x7a))/0x7+-parseInt(_0x2a1a58(0x71))/0x8+-parseInt(_0x2a1a58(0x77))/0x9*(parseInt(_0x2a1a58(0x78))/0xa);if(_0x1a0d39===_0x398d31)break;else _0x20ef24['push'](_0x20ef24['shift']());}catch(_0x35db24){_0x20ef24['push'](_0x20ef24['shift']());}}}(a53_0x1b9d,0xcf50a));function a53_0x1b9d(){const _0x529f1f=['Bearer\x20','entries','3310805PpZkvm','Authorization','35054eiORnd','tdx/','replace','tdx','12390568zHIekB','3428SOJPWS','5349dunnJL','version','length','854310eLDiez','11222892azbJTK','10auOICT','32fxIJlw','5260710vnTqSv'];a53_0x1b9d=function(){return _0x529f1f;};return a53_0x1b9d();}import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x4ad2da=a53_0x3bd6,_0x352d7f=getVersion(),_0x214035=platform(),_0x39edc0=process[_0x4ad2da(0x74)][_0x4ad2da(0x6f)]('v','');return _0x4ad2da(0x6e)+_0x352d7f+'\x20('+_0x214035+';\x20node/'+_0x39edc0+')';}export function getAuthHeaders(_0xe330d2,_0x182bde,_0x471199){const _0xa8b2e3=a53_0x3bd6,_0xb2cba5=getVersion(),_0x101ea9={'User-Agent':getUserAgent(),'X-TD-Client':_0xa8b2e3(0x70),'X-TD-Client-Version':_0xb2cba5};if(_0x471199)_0x101ea9[_0xa8b2e3(0x7e)]=_0xa8b2e3(0x7b)+_0x471199;else _0x182bde&&(_0x101ea9[_0xa8b2e3(0x7e)]='TD1\x20'+_0x182bde);return _0x101ea9;}function a53_0x3bd6(_0xa126e3,_0x2b7e2b){_0xa126e3=_0xa126e3-0x6d;const _0x1b9d41=a53_0x1b9d();let _0x3bd627=_0x1b9d41[_0xa126e3];return _0x3bd627;}export function toHeaderRecord(_0x43ad26){const _0x25d0ab=a53_0x3bd6,_0x5e7bb5={};for(const [_0x5dc2d4,_0x402b42]of Object[_0x25d0ab(0x7c)](_0x43ad26)){_0x402b42!==undefined&&(_0x5e7bb5[_0x5dc2d4]=_0x402b42);}return _0x5e7bb5;}export function getTrinoHeaders(_0x99a32d,_0x4e3b9f,_0x3f4204){const _0x8ed606=a53_0x3bd6,_0x2a1ff1=getAuthHeaders(_0x99a32d),_0x2454a4=toHeaderRecord(_0x2a1ff1);if(_0x3f4204)_0x2454a4['Authorization']=_0x8ed606(0x7b)+_0x3f4204;else _0x4e3b9f&&(_0x2454a4['X-Trino-User']=_0x4e3b9f);return _0x2454a4;}export function hasAPIKey(_0x38e959){const _0xc0629a=a53_0x3bd6,_0x457d13=getAPIKey();return _0x457d13!==undefined&&_0x457d13[_0xc0629a(0x75)]>0x0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1bf121,_0xbb6588){const _0x4fc4ad=a54_0x4be8,_0x490460=_0x1bf121();while(!![]){try{const _0x54e41c=parseInt(_0x4fc4ad(0xd0))/0x1+-parseInt(_0x4fc4ad(0xe5))/0x2+parseInt(_0x4fc4ad(0xd7))/0x3+parseInt(_0x4fc4ad(0xca))/0x4*(parseInt(_0x4fc4ad(0xff))/0x5)+-parseInt(_0x4fc4ad(0xdd))/0x6+parseInt(_0x4fc4ad(0xbe))/0x7*(parseInt(_0x4fc4ad(0xcf))/0x8)+-parseInt(_0x4fc4ad(0xe8))/0x9;if(_0x54e41c===_0xbb6588)break;else _0x490460['push'](_0x490460['shift']());}catch(_0x427e22){_0x490460['push'](_0x490460['shift']());}}}(a54_0x576b,0xddf9d));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 a54_0x4cfb6e from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';function a54_0x4be8(_0x2bfc22,_0x322de5){_0x2bfc22=_0x2bfc22-0xbd;const _0x576b83=a54_0x576b();let _0x4be834=_0x576b83[_0x2bfc22];return _0x4be834;}import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x9202e9){const _0x1519b5=a54_0x4be8;return _0x9202e9[_0x1519b5(0xfe)]===_0x1519b5(0xc1)||_0x9202e9[_0x1519b5(0xfe)]===_0x1519b5(0xd9)||_0x9202e9[_0x1519b5(0xfe)]==='tsv'||_0x9202e9['format']===_0x1519b5(0xe4)||_0x9202e9[_0x1519b5(0xc1)]===!![]||_0x9202e9[_0x1519b5(0xd9)]===!![]||_0x9202e9['tsv']===!![]||_0x9202e9['table']===!![];}export function parseOutputOptions(_0x194d97){const _0x3cfc85=a54_0x4be8;return{'format':_0x194d97[_0x3cfc85(0xfe)]||_0x3cfc85(0xe4),'output':_0x194d97[_0x3cfc85(0xc9)]||'','limit':_0x194d97[_0x3cfc85(0xd5)],'limitStructuredFormats':_0x194d97[_0x3cfc85(0xcb)],'color':_0x194d97[_0x3cfc85(0xf9)],'noColor':_0x194d97[_0x3cfc85(0xc8)]};}function convertSDKResultToQueryResult(_0x502c60){const _0x4912b2=a54_0x4be8,_0x2032be=[];if(_0x502c60[_0x4912b2(0xe6)]>0x0){const _0x2eee19=_0x502c60[0x0];for(const [_0x2bf399,_0x1a45d2]of Object['entries'](_0x2eee19)){let _0x182869=_0x4912b2(0xdf);if(typeof _0x1a45d2===_0x4912b2(0xde))_0x182869=Number[_0x4912b2(0xe7)](_0x1a45d2)?'bigint':_0x4912b2(0xbf);else{if(typeof _0x1a45d2===_0x4912b2(0x101))_0x182869=_0x4912b2(0x101);else _0x1a45d2===null&&(_0x182869=_0x4912b2(0xdf));}_0x2032be[_0x4912b2(0xbd)]({'name':_0x2bf399,'type':_0x182869});}}return{'queryId':_0x4912b2(0xc0),'columns':_0x2032be,'data':_0x502c60,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x502c60['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x4114d1,_0x8423e6){const _0x5e3451=convertSDKResultToQueryResult(_0x4114d1);return formatQueryOutput(_0x5e3451,_0x8423e6);}export async function formatQueryOutput(_0x379c2a,_0xf7ea1d){const _0x2a3fce=a54_0x4be8,{format:_0xf3d52e,limit:_0x53900c,output:_0x1caa95,color:_0x14a527,noColor:_0x36e9f4,limitStructuredFormats:_0x4ff9ac}=_0xf7ea1d,_0x40212e=Boolean(_0x1caa95)&&!_0x14a527,_0x2ee149={'color':_0x14a527,'noColor':_0x36e9f4||_0x40212e};if(_0xf3d52e==='table'){const _0x340e9f=shouldUseLess(_0xf3d52e,_0x1caa95);return formatAsTable(_0x379c2a,_0x53900c,_0x340e9f,_0x2ee149);}const _0x2dc47a=_0x4ff9ac&&Number[_0x2a3fce(0xe0)](_0x53900c)&&_0x379c2a['data'][_0x2a3fce(0xe6)]>_0x53900c?{..._0x379c2a,'data':_0x379c2a[_0x2a3fce(0xd1)][_0x2a3fce(0xed)](0x0,_0x53900c)}:_0x379c2a;if(_0xf3d52e===_0x2a3fce(0xc1))return formatAsJSON(_0x2dc47a,_0x2ee149);else return _0xf3d52e===_0x2a3fce(0xd9)?formatAsJSONL(_0x2dc47a,_0x2ee149):formatQueryResult(_0x2dc47a,_0xf3d52e);}function shouldUseLess(_0x56964d,_0xd789f0){const _0x25e157=a54_0x4be8;return(_0x56964d===_0x25e157(0xe4)||_0x56964d===_0x25e157(0xf5))&&process[_0x25e157(0xfa)]['isTTY']&&!_0xd789f0;}export function resolveOutputOptions(_0x2cd0a1){const _0x458ea2=a54_0x4be8,_0x9b0fbe=_0x2cd0a1[_0x458ea2(0xc9)]||'',_0x48ea61=resolveOutputFormat(_0x2cd0a1['format'],_0x9b0fbe,_0x458ea2(0xe4));let _0x37ece8=typeof _0x2cd0a1['limit']===_0x458ea2(0xde)?_0x2cd0a1[_0x458ea2(0xd5)]:parseInt(_0x2cd0a1[_0x458ea2(0xd5)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x2cd0a1[_0x458ea2(0xd5)]===undefined&&shouldUseLess(_0x48ea61,_0x9b0fbe)&&(_0x37ece8=Infinity),{'format':_0x48ea61,'output':_0x9b0fbe,'limit':_0x37ece8,'limitStructuredFormats':_0x2cd0a1[_0x458ea2(0xcb)],'color':_0x2cd0a1['color'],'noColor':_0x2cd0a1['noColor']};}function a54_0x576b(){const _0xab52c3=['entries','[rule]','limit','debug','3060309QzsSis','map','jsonl','rule','forEach','cmdout','10310700KSPnwz','number','varchar','isFinite','stringify','magenta','─┬─','table','179072wYgDIb','length','isInteger','13563648wopdbK','pipe','tsv','write','error','slice','join','trim','[params]','inherit','stderr','padEnd','bold','list','-FXRSn','stdin','split','color','stdout','[error]','[logs]','blue','format','5WQDTua','cyan','boolean','push','1553811UuEOkH','double','sdk-result','json','─┴─','object','string','params','resolve','query','noColor','output','6611036tmmuve','limitStructuredFormats','repeat','close','max','16HrtkeK','1107463epbsAB','data','keys'];a54_0x576b=function(){return _0xab52c3;};return a54_0x576b();}export function writeOutput(_0x581382,_0x12e3e3,_0x39819c){const _0x387cea=a54_0x4be8;return _0x12e3e3?(writeFileSync(_0x12e3e3,_0x581382),console[_0x387cea(0xec)]('Results\x20saved\x20to\x20'+_0x12e3e3),Promise[_0x387cea(0xc6)]()):shouldUseLess(_0x39819c||'','')?new Promise(_0x10ae85=>{const _0x388108=_0x387cea,_0x189b83=spawn('less',[_0x388108(0xf6)],{'stdio':[_0x388108(0xe9),_0x388108(0xf1),_0x388108(0xf1)]});let _0x1a9477=![];_0x189b83['on'](_0x388108(0xec),()=>{!_0x1a9477&&(_0x1a9477=!![],console['log'](_0x581382),_0x10ae85());}),_0x189b83['on'](_0x388108(0xcd),()=>{!_0x1a9477&&(_0x1a9477=!![],_0x10ae85());}),_0x189b83['on']('spawn',()=>{const _0x189dac=_0x388108;!_0x1a9477&&_0x189b83[_0x189dac(0xf7)]&&(_0x189b83[_0x189dac(0xf7)]['on'](_0x189dac(0xec),()=>{}),_0x189b83['stdin'][_0x189dac(0xeb)](_0x581382),_0x189b83[_0x189dac(0xf7)]['end']());}),!_0x189b83['stdin']&&(!_0x1a9477&&(_0x1a9477=!![],console['log'](_0x581382),_0x10ae85()));}):(console['log'](_0x581382),Promise[_0x387cea(0xc6)]());}export async function handleSDKOutput(_0x33aaef,_0x5f273d){const _0x1f7a75=a54_0x4be8,_0x4d0434=resolveOutputOptions(_0x5f273d),_0x4ba37c=await formatSDKOutput(_0x33aaef,_0x4d0434);await writeOutput(_0x4ba37c,_0x4d0434[_0x1f7a75(0xc9)]||undefined,_0x4d0434[_0x1f7a75(0xfe)]);}export async function handleQueryOutput(_0x1ee869,_0x319ebc){const _0x19fe72=a54_0x4be8,_0x480a26=resolveOutputOptions(_0x319ebc),_0x1946b0=await formatQueryOutput(_0x1ee869,_0x480a26);await writeOutput(_0x1946b0,_0x480a26[_0x19fe72(0xc9)]||undefined,_0x480a26[_0x19fe72(0xfe)]);}async function formatSingleObject(_0xed8501,_0x5196d2){const _0x58ec96=a54_0x4be8,{format:_0x54c99f,color:_0x17cff7,noColor:_0x292b9e}=_0x5196d2,_0x56c4dc={'color':_0x17cff7,'noColor':_0x292b9e};if(_0x54c99f===_0x58ec96(0xc1)){if(shouldUseColor(_0x56c4dc))return colorizeJSON(_0xed8501,_0x56c4dc);return JSON[_0x58ec96(0xe1)](_0xed8501,null,0x2);}else{if(_0x54c99f===_0x58ec96(0xd9)){if(shouldUseColor(_0x56c4dc))return colorizeJSONCompact(_0xed8501,_0x56c4dc);return JSON[_0x58ec96(0xe1)](_0xed8501);}else{if(_0x54c99f===_0x58ec96(0xea))return Object[_0x58ec96(0xd3)](_0xed8501)['map'](([_0x3f2995,_0x50028e])=>_0x3f2995+'\x09'+_0x50028e)[_0x58ec96(0xee)]('\x0a');else{const _0x83a827=Object[_0x58ec96(0xd3)](_0xed8501);if(_0x83a827['length']===0x0)return'No\x20data';const _0x2529a6=_0xed8501[_0x58ec96(0xd6)],_0x4a5500=_0xed8501[_0x58ec96(0xc7)],_0x420d22=_0xed8501[_0x58ec96(0xc5)],_0x26efcd=_0xed8501[_0x58ec96(0xda)],_0x57c312=_0x4a5500?typeof _0x4a5500===_0x58ec96(0xc4)?_0x4a5500:JSON[_0x58ec96(0xe1)](_0x4a5500,null,0x2):undefined,_0x5b1c1d=_0x420d22&&Object[_0x58ec96(0xd2)](_0x420d22)[_0x58ec96(0xe6)]>0x0?JSON[_0x58ec96(0xe1)](_0x420d22,null,0x2):undefined,_0xf26406=_0x26efcd&&Object[_0x58ec96(0xd2)](_0x26efcd)[_0x58ec96(0xe6)]>0x0?JSON['stringify'](_0x26efcd,null,0x2):undefined,_0xeebdf1=_0x83a827['filter'](([_0x422fcb])=>_0x422fcb!==_0x58ec96(0xd6)&&_0x422fcb!==_0x58ec96(0xc7)&&_0x422fcb!=='params'&&_0x422fcb!=='rule'),_0x788495=Math['max'](..._0xeebdf1[_0x58ec96(0xd8)](([_0x16279e])=>_0x16279e[_0x58ec96(0xe6)])),_0x39a7a9=Math[_0x58ec96(0xce)](..._0xeebdf1[_0x58ec96(0xd8)](([,_0x5d9518])=>{const _0x397991=_0x58ec96;try{const _0x4c0919=_0x5d9518===null||_0x5d9518===undefined?'':typeof _0x5d9518===_0x397991(0xc3)?JSON[_0x397991(0xe1)](_0x5d9518):String(_0x5d9518),_0xdb0bac=_0x4c0919['split']('\x0a');return Math[_0x397991(0xce)](..._0xdb0bac[_0x397991(0xd8)](_0x3f87a0=>_0x3f87a0['length']),0x0);}catch{return 0x0;}}),0x14),_0x5a1f7e=[];_0x5a1f7e['push'](colorBorder('┌─'+'─'[_0x58ec96(0xcc)](_0x788495)+_0x58ec96(0xe3)+'─'[_0x58ec96(0xcc)](_0x39a7a9)+'─┐',_0x56c4dc)),_0xeebdf1['forEach'](([_0x3a291a,_0x77c5c3])=>{const _0xac142c=_0x58ec96;let _0x42ecaa;try{_0x42ecaa=_0x77c5c3===null||_0x77c5c3===undefined?'':typeof _0x77c5c3===_0xac142c(0xc3)?JSON[_0xac142c(0xe1)](_0x77c5c3):String(_0x77c5c3);}catch{_0x42ecaa='[Object]';}const _0x548b74=_0x3a291a[_0xac142c(0xf3)](_0x788495),_0x557dac=_0x42ecaa[_0xac142c(0xf8)]('\x0a');_0x557dac[_0xac142c(0xdb)]((_0x31e1d9,_0x20c334)=>{const _0x57ab74=_0xac142c,_0x55c8be=colorBorder('│',_0x56c4dc);_0x20c334===0x0?_0x5a1f7e['push'](_0x55c8be+'\x20'+_0x548b74+'\x20'+_0x55c8be+'\x20'+_0x31e1d9[_0x57ab74(0xf3)](_0x39a7a9)+'\x20'+_0x55c8be):_0x5a1f7e[_0x57ab74(0xbd)](_0x55c8be+'\x20'+'\x20'['repeat'](_0x788495)+'\x20'+_0x55c8be+'\x20'+_0x31e1d9['padEnd'](_0x39a7a9)+'\x20'+_0x55c8be);});}),_0x5a1f7e['push'](colorBorder('└─'+'─'[_0x58ec96(0xcc)](_0x788495)+_0x58ec96(0xc2)+'─'['repeat'](_0x39a7a9)+'─┘',_0x56c4dc));_0x57c312&&(_0x5a1f7e['push'](''),_0x5a1f7e['push'](String(a54_0x4cfb6e['yellow'][_0x58ec96(0xf4)]('[query]'))),_0x5a1f7e[_0x58ec96(0xbd)](_0x57c312));_0x5b1c1d&&(_0x5a1f7e[_0x58ec96(0xbd)](''),_0x5a1f7e[_0x58ec96(0xbd)](String(a54_0x4cfb6e[_0x58ec96(0xfd)][_0x58ec96(0xf4)](_0x58ec96(0xf0)))),_0x5a1f7e[_0x58ec96(0xbd)](_0x5b1c1d));_0xf26406&&(_0x5a1f7e[_0x58ec96(0xbd)](''),_0x5a1f7e['push'](String(a54_0x4cfb6e[_0x58ec96(0xe2)]['bold'](_0x58ec96(0xd4)))),_0x5a1f7e[_0x58ec96(0xbd)](_0xf26406));if(_0x2529a6){if(_0x2529a6['stderr']){_0x5a1f7e[_0x58ec96(0xbd)](''),_0x5a1f7e[_0x58ec96(0xbd)](String(a54_0x4cfb6e['red']['bold'](_0x58ec96(0xfb))));const _0x558c7e=_0x2529a6[_0x58ec96(0xf2)][_0x58ec96(0xf8)]('\x0a');_0x558c7e[_0x58ec96(0xdb)](_0x197f19=>{const _0x1f2c1b=_0x58ec96;_0x197f19[_0x1f2c1b(0xef)]()&&_0x5a1f7e[_0x1f2c1b(0xbd)](_0x197f19);});}if(_0x2529a6[_0x58ec96(0xdc)]){_0x5a1f7e['push'](''),_0x5a1f7e[_0x58ec96(0xbd)](String(a54_0x4cfb6e[_0x58ec96(0x100)][_0x58ec96(0xf4)](_0x58ec96(0xfc))));const _0x5ef0c6=_0x2529a6[_0x58ec96(0xdc)][_0x58ec96(0xf8)]('\x0a');_0x5ef0c6[_0x58ec96(0xdb)](_0x4c6393=>{const _0x325ebf=_0x58ec96;_0x4c6393[_0x325ebf(0xef)]()&&_0x5a1f7e['push'](_0x4c6393);});}}return _0x5a1f7e['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x2dd864,_0x29845b){const _0x5a8a64=a54_0x4be8;if(_0x29845b['format']===_0x5a8a64(0xe4)){await handleSDKOutput([_0x2dd864],_0x29845b);return;}const _0x4bfbb9=resolveOutputOptions(_0x29845b),_0x3607f9=await formatSingleObject(_0x2dd864,_0x4bfbb9);await writeOutput(_0x3607f9,_0x4bfbb9['output']||undefined,_0x4bfbb9[_0x5a8a64(0xfe)]);}
|
|
1
|
+
(function(_0x501e11,_0x59cc09){const _0x45748f=a54_0x1d83,_0x8a5d66=_0x501e11();while(!![]){try{const _0x4826ba=-parseInt(_0x45748f(0x1b8))/0x1+parseInt(_0x45748f(0x1b6))/0x2*(parseInt(_0x45748f(0x17f))/0x3)+parseInt(_0x45748f(0x1b0))/0x4*(parseInt(_0x45748f(0x19e))/0x5)+-parseInt(_0x45748f(0x178))/0x6+parseInt(_0x45748f(0x179))/0x7+parseInt(_0x45748f(0x1ae))/0x8+parseInt(_0x45748f(0x189))/0x9*(parseInt(_0x45748f(0x17d))/0xa);if(_0x4826ba===_0x59cc09)break;else _0x8a5d66['push'](_0x8a5d66['shift']());}catch(_0x44ea37){_0x8a5d66['push'](_0x8a5d66['shift']());}}}(a54_0x412c,0x58ddb));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 a54_0x258ebf from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';function a54_0x1d83(_0x5b3861,_0x18be41){_0x5b3861=_0x5b3861-0x174;const _0x412c79=a54_0x412c();let _0x1d83d4=_0x412c79[_0x5b3861];return _0x1d83d4;}import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x47cc82){const _0x150183=a54_0x1d83;return _0x47cc82[_0x150183(0x1b7)]===_0x150183(0x180)||_0x47cc82[_0x150183(0x1b7)]===_0x150183(0x19b)||_0x47cc82[_0x150183(0x1b7)]===_0x150183(0x18b)||_0x47cc82[_0x150183(0x1b7)]===_0x150183(0x1b1)||_0x47cc82[_0x150183(0x180)]===!![]||_0x47cc82[_0x150183(0x19b)]===!![]||_0x47cc82['tsv']===!![]||_0x47cc82['table']===!![];}export function parseOutputOptions(_0x6c1259){const _0x5d9c49=a54_0x1d83;return{'format':_0x6c1259[_0x5d9c49(0x1b7)]||_0x5d9c49(0x1b1),'output':_0x6c1259[_0x5d9c49(0x185)]||'','limit':_0x6c1259[_0x5d9c49(0x19c)],'limitStructuredFormats':_0x6c1259[_0x5d9c49(0x1a6)],'color':_0x6c1259[_0x5d9c49(0x196)],'noColor':_0x6c1259[_0x5d9c49(0x1b5)]};}function convertSDKResultToQueryResult(_0x4ae752){const _0x48fbd1=a54_0x1d83,_0x10a22d=[];if(_0x4ae752['length']>0x0){const _0x4e03ec=_0x4ae752[0x0];for(const [_0x567fc7,_0x3847e3]of Object['entries'](_0x4e03ec)){let _0x2c41da=_0x48fbd1(0x183);if(typeof _0x3847e3===_0x48fbd1(0x1bd))_0x2c41da=Number[_0x48fbd1(0x1a3)](_0x3847e3)?_0x48fbd1(0x18e):'double';else{if(typeof _0x3847e3===_0x48fbd1(0x1aa))_0x2c41da='boolean';else _0x3847e3===null&&(_0x2c41da=_0x48fbd1(0x183));}_0x10a22d['push']({'name':_0x567fc7,'type':_0x2c41da});}}return{'queryId':_0x48fbd1(0x194),'columns':_0x10a22d,'data':_0x4ae752,'stats':{'state':_0x48fbd1(0x1a9),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x4ae752[_0x48fbd1(0x181)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x464736,_0x26542a){const _0x577ef3=convertSDKResultToQueryResult(_0x464736);return formatQueryOutput(_0x577ef3,_0x26542a);}export async function formatQueryOutput(_0x243f4a,_0x4aca3c){const _0x4de668=a54_0x1d83,{format:_0xb884c8,limit:_0x1339e5,output:_0x504e8c,color:_0x427ad1,noColor:_0x38f190,limitStructuredFormats:_0x394191}=_0x4aca3c,_0x1f4582=Boolean(_0x504e8c)&&!_0x427ad1,_0x311328={'color':_0x427ad1,'noColor':_0x38f190||_0x1f4582};if(_0xb884c8===_0x4de668(0x1b1)){const _0x9c27b4=shouldUseLess(_0xb884c8,_0x504e8c);return formatAsTable(_0x243f4a,_0x1339e5,_0x9c27b4,_0x311328);}const _0x5af401=_0x394191&&Number[_0x4de668(0x1b2)](_0x1339e5)&&_0x243f4a['data']['length']>_0x1339e5?{..._0x243f4a,'data':_0x243f4a[_0x4de668(0x175)]['slice'](0x0,_0x1339e5)}:_0x243f4a;if(_0xb884c8===_0x4de668(0x180))return formatAsJSON(_0x5af401,_0x311328);else return _0xb884c8===_0x4de668(0x19b)?formatAsJSONL(_0x5af401,_0x311328):formatQueryResult(_0x5af401,_0xb884c8);}function shouldUseLess(_0x49d7e3,_0x2d90ce){const _0x45d35c=a54_0x1d83;return(_0x49d7e3===_0x45d35c(0x1b1)||_0x49d7e3===_0x45d35c(0x1af))&&process[_0x45d35c(0x188)][_0x45d35c(0x199)]&&!_0x2d90ce;}export function resolveOutputOptions(_0x493781){const _0x3ddccd=a54_0x1d83,_0xb6f537=_0x493781[_0x3ddccd(0x185)]||'',_0x4ed67a=resolveOutputFormat(_0x493781[_0x3ddccd(0x1b7)],_0xb6f537,_0x3ddccd(0x1b1));let _0x212854=typeof _0x493781[_0x3ddccd(0x19c)]===_0x3ddccd(0x1bd)?_0x493781['limit']:parseInt(_0x493781[_0x3ddccd(0x19c)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x493781[_0x3ddccd(0x19c)]===undefined&&shouldUseLess(_0x4ed67a,_0xb6f537)&&(_0x212854=Infinity),{'format':_0x4ed67a,'output':_0xb6f537,'limit':_0x212854,'limitStructuredFormats':_0x493781['limitStructuredFormats'],'color':_0x493781['color'],'noColor':_0x493781[_0x3ddccd(0x1b5)]};}export function writeOutput(_0x2ee198,_0x4ed850,_0x11c7af){const _0x297084=a54_0x1d83;return _0x4ed850?(writeFileSync(_0x4ed850,_0x2ee198),console[_0x297084(0x18c)](_0x297084(0x191)+_0x4ed850),Promise[_0x297084(0x1b3)]()):shouldUseLess(_0x11c7af||'','')?new Promise(_0x684b0a=>{const _0xbcdd0e=_0x297084,_0x2ac7ba=spawn(_0xbcdd0e(0x176),['-FXRSn'],{'stdio':['pipe','inherit','inherit']});let _0x5c970a=![];_0x2ac7ba['on']('error',()=>{const _0x4d34e1=_0xbcdd0e;!_0x5c970a&&(_0x5c970a=!![],console[_0x4d34e1(0x1a1)](_0x2ee198),_0x684b0a());}),_0x2ac7ba['on'](_0xbcdd0e(0x1bc),()=>{!_0x5c970a&&(_0x5c970a=!![],_0x684b0a());}),_0x2ac7ba['on']('spawn',()=>{const _0x32b1ef=_0xbcdd0e;!_0x5c970a&&_0x2ac7ba[_0x32b1ef(0x17e)]&&(_0x2ac7ba['stdin']['on'](_0x32b1ef(0x18c),()=>{}),_0x2ac7ba[_0x32b1ef(0x17e)][_0x32b1ef(0x19a)](_0x2ee198),_0x2ac7ba[_0x32b1ef(0x17e)][_0x32b1ef(0x182)]());}),!_0x2ac7ba[_0xbcdd0e(0x17e)]&&(!_0x5c970a&&(_0x5c970a=!![],console[_0xbcdd0e(0x1a1)](_0x2ee198),_0x684b0a()));}):(console[_0x297084(0x1a1)](_0x2ee198),Promise[_0x297084(0x1b3)]());}export async function handleSDKOutput(_0x18d2f2,_0x2747ce){const _0x155d0f=a54_0x1d83,_0x3f59e4=resolveOutputOptions(_0x2747ce),_0x443ac7=await formatSDKOutput(_0x18d2f2,_0x3f59e4);await writeOutput(_0x443ac7,_0x3f59e4[_0x155d0f(0x185)]||undefined,_0x3f59e4[_0x155d0f(0x1b7)]);}export async function handleQueryOutput(_0x6e7c27,_0x3966a8){const _0x4794de=a54_0x1d83,_0x20b3b8=resolveOutputOptions(_0x3966a8),_0x152f0a=await formatQueryOutput(_0x6e7c27,_0x20b3b8);await writeOutput(_0x152f0a,_0x20b3b8[_0x4794de(0x185)]||undefined,_0x20b3b8['format']);}async function formatSingleObject(_0x39fa1c,_0x38f5fa){const _0x5127fe=a54_0x1d83,{format:_0x2fe2b3,color:_0x38d71f,noColor:_0x4102ea}=_0x38f5fa,_0x84fd86={'color':_0x38d71f,'noColor':_0x4102ea};if(_0x2fe2b3===_0x5127fe(0x180)){if(shouldUseColor(_0x84fd86))return colorizeJSON(_0x39fa1c,_0x84fd86);return JSON['stringify'](_0x39fa1c,null,0x2);}else{if(_0x2fe2b3===_0x5127fe(0x19b)){if(shouldUseColor(_0x84fd86))return colorizeJSONCompact(_0x39fa1c,_0x84fd86);return JSON['stringify'](_0x39fa1c);}else{if(_0x2fe2b3===_0x5127fe(0x18b))return Object[_0x5127fe(0x187)](_0x39fa1c)[_0x5127fe(0x184)](([_0x41cbf9,_0x4267e9])=>_0x41cbf9+'\x09'+_0x4267e9)['join']('\x0a');else{const _0x66877a=Object[_0x5127fe(0x187)](_0x39fa1c);if(_0x66877a[_0x5127fe(0x181)]===0x0)return _0x5127fe(0x1be);const _0x2a393f=_0x39fa1c[_0x5127fe(0x18f)],_0x166c37=_0x39fa1c[_0x5127fe(0x19d)],_0x2d4b6b=_0x39fa1c[_0x5127fe(0x186)],_0x5aff25=_0x39fa1c[_0x5127fe(0x193)],_0x3a5071=_0x166c37?typeof _0x166c37===_0x5127fe(0x18d)?_0x166c37:JSON[_0x5127fe(0x1ac)](_0x166c37,null,0x2):undefined,_0xa7522d=_0x2d4b6b&&Object['keys'](_0x2d4b6b)[_0x5127fe(0x181)]>0x0?JSON[_0x5127fe(0x1ac)](_0x2d4b6b,null,0x2):undefined,_0x4da823=_0x5aff25&&Object[_0x5127fe(0x195)](_0x5aff25)[_0x5127fe(0x181)]>0x0?JSON[_0x5127fe(0x1ac)](_0x5aff25,null,0x2):undefined,_0xe37890=_0x66877a[_0x5127fe(0x190)](([_0x14c3c5])=>_0x14c3c5!=='debug'&&_0x14c3c5!==_0x5127fe(0x19d)&&_0x14c3c5!==_0x5127fe(0x186)&&_0x14c3c5!==_0x5127fe(0x193)),_0x532341=Math[_0x5127fe(0x1ad)](..._0xe37890[_0x5127fe(0x184)](([_0x3995c4])=>_0x3995c4[_0x5127fe(0x181)])),_0x550904=Math[_0x5127fe(0x1ad)](..._0xe37890[_0x5127fe(0x184)](([,_0xe9272e])=>{const _0x5636c6=_0x5127fe;try{const _0x1b2d4b=_0xe9272e===null||_0xe9272e===undefined?'':typeof _0xe9272e===_0x5636c6(0x1bb)?JSON[_0x5636c6(0x1ac)](_0xe9272e):String(_0xe9272e),_0xeed5f8=_0x1b2d4b[_0x5636c6(0x1a0)]('\x0a');return Math[_0x5636c6(0x1ad)](..._0xeed5f8[_0x5636c6(0x184)](_0x28975e=>_0x28975e[_0x5636c6(0x181)]),0x0);}catch{return 0x0;}}),0x14),_0x5bef13=[];_0x5bef13[_0x5127fe(0x17a)](colorBorder('┌─'+'─'[_0x5127fe(0x17b)](_0x532341)+'─┬─'+'─'['repeat'](_0x550904)+'─┐',_0x84fd86)),_0xe37890[_0x5127fe(0x177)](([_0x22c309,_0x15901b])=>{const _0x4bbfdd=_0x5127fe;let _0x1fd7ee;try{_0x1fd7ee=_0x15901b===null||_0x15901b===undefined?'':typeof _0x15901b===_0x4bbfdd(0x1bb)?JSON[_0x4bbfdd(0x1ac)](_0x15901b):String(_0x15901b);}catch{_0x1fd7ee='[Object]';}const _0x171a94=_0x22c309['padEnd'](_0x532341),_0x9119e1=_0x1fd7ee['split']('\x0a');_0x9119e1['forEach']((_0x40e627,_0x2b370b)=>{const _0x3305fd=_0x4bbfdd,_0x152aae=colorBorder('│',_0x84fd86);_0x2b370b===0x0?_0x5bef13[_0x3305fd(0x17a)](_0x152aae+'\x20'+_0x171a94+'\x20'+_0x152aae+'\x20'+_0x40e627[_0x3305fd(0x1b9)](_0x550904)+'\x20'+_0x152aae):_0x5bef13[_0x3305fd(0x17a)](_0x152aae+'\x20'+'\x20'['repeat'](_0x532341)+'\x20'+_0x152aae+'\x20'+_0x40e627[_0x3305fd(0x1b9)](_0x550904)+'\x20'+_0x152aae);});}),_0x5bef13['push'](colorBorder('└─'+'─'[_0x5127fe(0x17b)](_0x532341)+_0x5127fe(0x174)+'─'[_0x5127fe(0x17b)](_0x550904)+'─┘',_0x84fd86));_0x3a5071&&(_0x5bef13['push'](''),_0x5bef13[_0x5127fe(0x17a)](String(a54_0x258ebf[_0x5127fe(0x197)][_0x5127fe(0x1b4)](_0x5127fe(0x1ba)))),_0x5bef13[_0x5127fe(0x17a)](_0x3a5071));_0xa7522d&&(_0x5bef13[_0x5127fe(0x17a)](''),_0x5bef13[_0x5127fe(0x17a)](String(a54_0x258ebf['blue']['bold'](_0x5127fe(0x1a2)))),_0x5bef13[_0x5127fe(0x17a)](_0xa7522d));_0x4da823&&(_0x5bef13[_0x5127fe(0x17a)](''),_0x5bef13[_0x5127fe(0x17a)](String(a54_0x258ebf[_0x5127fe(0x1a8)][_0x5127fe(0x1b4)](_0x5127fe(0x17c)))),_0x5bef13[_0x5127fe(0x17a)](_0x4da823));if(_0x2a393f){if(_0x2a393f[_0x5127fe(0x1ab)]){_0x5bef13[_0x5127fe(0x17a)](''),_0x5bef13[_0x5127fe(0x17a)](String(a54_0x258ebf[_0x5127fe(0x19f)][_0x5127fe(0x1b4)](_0x5127fe(0x1a7))));const _0x251083=_0x2a393f[_0x5127fe(0x1ab)][_0x5127fe(0x1a0)]('\x0a');_0x251083[_0x5127fe(0x177)](_0x353e07=>{const _0x16efd8=_0x5127fe;_0x353e07[_0x16efd8(0x1a5)]()&&_0x5bef13['push'](_0x353e07);});}if(_0x2a393f[_0x5127fe(0x18a)]){_0x5bef13[_0x5127fe(0x17a)](''),_0x5bef13[_0x5127fe(0x17a)](String(a54_0x258ebf[_0x5127fe(0x192)][_0x5127fe(0x1b4)](_0x5127fe(0x198))));const _0x467d6d=_0x2a393f['cmdout'][_0x5127fe(0x1a0)]('\x0a');_0x467d6d[_0x5127fe(0x177)](_0x56f98a=>{const _0x3d0755=_0x5127fe;_0x56f98a[_0x3d0755(0x1a5)]()&&_0x5bef13[_0x3d0755(0x17a)](_0x56f98a);});}}return _0x5bef13[_0x5127fe(0x1a4)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x3448ab,_0xd287c){const _0x540878=a54_0x1d83;if(_0xd287c[_0x540878(0x1b7)]==='table'){await handleSDKOutput([_0x3448ab],_0xd287c);return;}const _0x33fad8=resolveOutputOptions(_0xd287c),_0x5ad138=await formatSingleObject(_0x3448ab,_0x33fad8);await writeOutput(_0x5ad138,_0x33fad8[_0x540878(0x185)]||undefined,_0x33fad8[_0x540878(0x1b7)]);}function a54_0x412c(){const _0x4758b6=['table','isFinite','resolve','bold','noColor','2nDlNgI','format','669114uSitXX','padEnd','[query]','object','close','number','No\x20data','─┴─','data','less','forEach','2306922mTEtof','3351194bqkCLl','push','repeat','[rule]','270gRBRWG','stdin','1511952LJQfrG','json','length','end','varchar','map','output','params','entries','stdout','30924Uenlur','cmdout','tsv','error','string','bigint','debug','filter','Results\x20saved\x20to\x20','cyan','rule','sdk-result','keys','color','yellow','[logs]','isTTY','write','jsonl','limit','query','5FtJICW','red','split','log','[params]','isInteger','join','trim','limitStructuredFormats','[error]','magenta','FINISHED','boolean','stderr','stringify','max','500272SsqYee','list','1118256BnvPkW'];a54_0x412c=function(){return _0x4758b6;};return a54_0x412c();}
|