@treasuredata/tdx 2026.4.13 → 2026.4.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.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
|
-
function a54_0x5540(){const _0x2075e3=['sort','resolve','pollTimeline','workflow:download','List\x20workflow\x20attempts','duration','\x20of\x20','length','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','attempt','attemptId','Using\x20attempt\x20','new','toISOString','Include\x20retried:\x20yes','force','workflow:logs','📋\x20','73742LvbHOx','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','green','name','attempts','follow','Params:\x20','isArray','Invalid\x20format:\x20','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','max','Cloning\x20to\x20','join','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Listing\x20workflow\x20sessions...','Select\x20a\x20task\x20to\x20view\x20logs:','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Workflow:\x20','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','.\x20Expected\x20format:\x20KEY=VALUE','listSecrets','taskName','5862626DqAZbn','data','✔\x20Secret\x20\x27','Output\x20directory:\x20','Listing\x20workflows...','size','\x20\x20Attempt\x20ID:\x20','startsWith','revision','workflow:run','slice','white','fs/promises','\x20\x20Target:\x20','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','projects','807dEbRyQ','deleteSecret','Analyzing\x20project...','isNewProject','Failed\x20to\x20fetch\x20attempt\x20data','\x27\x20from\x20project\x20\x27','Downloading\x20logs...','status','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Listing\x20workflow\x20attempts...','Listing\x20workflow\x20projects...','\x1b[1A\x1b[2K','Tip:\x20cd\x20to\x20workflows/','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','yes','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','fromTask','TASK_NAME_WIDTH','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','params','map','workflow:schedule:disable','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','List\x20workflows','Secrets\x20to\x20set:\x20','💡\x20Tip:\x20Use\x20','projectName','rows','Pulling\x20project\x20','\x20-\x20','getMonth','Force:\x20yes','⚠\x20Showing\x20first\x20','start','\x22\x20with\x20new\x20revision?','includeSubtasks','/attempt/','resumeFrom','diff','✔\x20Retry\x20started','✔\x20Workflow\x20project\x20context\x20cleared.','Retry\x20a\x20session\x20or\x20attempt','sessions','now','\x20modified','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','renderSingleTimeline','workflow','workflows','blue','trim','✔\x20Project\x20updated','GUTTER','→\x20Project:\x20','done','\x20\x20Workflow:\x20','renderSessionsTimeline','split','\x20next:\x20','6wzXffz','100460UeFsdR','getHours','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','LABEL_WIDTH_DIVISOR','No\x20sessions\x20found','List\x20workflow\x20schedules','Project\x20directory:\x20','reason','MAX_TIMELINE_WIDTH','Enable\x20a\x20workflow\x20schedule','getMinutes','\x20\x20Files\x20extracted:\x20','Error:\x20Invalid\x20JSON\x20in\x20--params','\x20is\x20not\x20a\x20directory','workflowProject','retrySession','No\x20workflow\x20tdx.json\x20found','summary','\x20\x20Changes:\x20','Writing\x20files...','Attempt:\x20','session','resolveProject','\x20\x20Revision:\x20','session_id','Attempt\x20ID:\x20','preparePushProject','executePushProject','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','tdx.json','match','workflow:attempt','updatedAt','repeat','navigateSessionsInteractive','Deleting\x20project\x20','→\x20New\x20project:\x20','Resolving\x20project\x20\x27','createdAt','Downloading\x20project\x20','Files\x20to\x20upload:\x20','startedAt','✔\x20Found\x20','(use\x20--limit\x20to\x20see\x20more)','filter','Loading\x20session...','getDate','fill','No\x20sessions\x20found\x20in\x20project:\x20','LABEL_MIN_SPACING','ICON_WIDTH','Error:','targetExists','\x20session','disabledAt','existingProjectId','running','Starting\x20workflow\x20run...','generateSessionTimelineRows','\x0aUpdate\x20existing\x20project\x20\x22','Retrying\x20session...','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','/sessions/','Parameters:\x20','✔\x20Pushed\x20','Target\x20directory:\x20','workflow:schedule:enable','Revision:\x20','Deleting\x20secret...','Error:\x20Project\x20name\x20is\x20required','No\x20workflows\x20found\x20in\x20project:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','...','dryRun','Source\x20directory:\x20','No\x20log\x20content\x20found','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','end','set','\x0aClone\x20\x22','\x0aError:','state','\x20new','list','workflow:delete','splice','retryAttemptName','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','replace','tdx\x20wf\x20attempt\x20','context','Session\x20time:\x20','workflow:kill','Listing\x20schedules...','cancelRequested','Task\x20name:\x20','\x20task','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Pattern:\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','\x20enabled\x20(','394555ZxnhNn','No\x20attempts\x20found\x20in\x20project:\x20','includeRetried','\x0a✔\x20No\x20changes\x20to\x20push','path','table','\x20(use\x20--limit\x20to\x20show\x20more)','write','Select\x20a\x20workflow\x20to\x20run','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Cancelled','planned','Retrying\x20attempt...','stat','cwd','\x20\x20Location:\x20','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','tasks','trimEnd','retryAttempt','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','workflow:upload','session:','text','project','red','Fetching\x20log\x20files...','setSecrets','Pull\x20workflow\x20project\x20to\x20local\x20folder','yellow','newProjectName','\x22\x20to\x20new\x20project\x20\x22','\x0aFailed\x20to\x20fetch\x20attempt\x20data','\x0aPush\x20these\x20changes?','keys','success','Kill\x20a\x20running\x20attempt','json','\x20unchanged','getFullYear','\x20workflow','verbose','limit','pending','12268mSuvFy','toLocaleString','MAX_TASKS_DISPLAY','output','site','newProjectId','execute','MAX_LABEL_COUNT','\x20project','index','unknown','log','Usage:\x20workflow:delete\x20<project-name-or-id>','durationMs','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','type','sourceProjectName','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','workflowName','✔\x20Workflow\x20project\x20set\x20to:\x20','resolveProjectId','error','dim','Filter:\x20','columns','value','\x20(disabled)','\x20secrets...','localeCompare','2072945ilzoij','skipValidation','Loading\x20workflows...','every','No\x20attempts\x20found\x20for:\x20','download','relative','Project\x20name\x20is\x20required','sessionTime','message','group_error','Getting\x20attempt\x20tasks...','sourceDir','isTTY','\x20secrets\x20set\x20for\x20project\x20\x27','No\x20attempts\x20found','canceling','resolveProjectDir','workflow:secrets:list','ICON_SPACING','jsonl','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','✔\x20Project:\x20','indexOf','Killing\x20attempt...','cyan','prepareCloneProject','substring','✔\x20Downloaded\x20','Key:\x20','MIN_TIMELINE_WIDTH','MIN_LABEL_COUNT','2529dCWDVi','attempt:','Analyzing\x20changes...','workflow:timeline','Schedule\x20ID\x20is\x20required','min','✔\x20Pull\x20complete','renderTimeline','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','-\x20nothing\x20pushed','No\x20log\x20files\x20found\x20for\x20this\x20attempt','No\x20workflow\x20projects\x20found','\x20attempt','kill','\x20sessions\x20','Error:\x20','workflow:push','workflow:use','find','(unknown)','select','title','\x20\x20tdx\x20wf\x20use\x20<project>','Listing\x20secrets...','sessionId','hasChanges','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','changes','getTime','requireProject','Updating\x20','displayLine','fileCount','Show\x20logs\x20for\x20a\x20workflow\x20attempt','startTime','Loading\x20sessions...','\x20tasks','\x20schedule','Target:\x20','disableSchedule','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','✔\x20Showing\x20','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','filesExtracted','Latest\x20session\x20has\x20no\x20attempt','Getting\x20attempt\x20details...','Select\x20a\x20session\x20to\x20view\x20timeline:','Warning:','key','Dry\x20run:\x20yes','\x20logs','task','Source:\x20','Error:\x20Secret\x20key\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Session\x20context\x20set\x20to:\x20','get','deleted','delete','Show\x20tasks\x20for\x20an\x20attempt','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','autocomplete','basename','projectId','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','Project:\x20','Resume\x20from:\x20','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','\x20\x20New\x20attempt\x20ID:\x20','parse','description','logFiles','\x20disabled\x20(','includes','\x20\x20Project:\x20','format','lastAttempt','stringify','fullName','📅\x20#','Filter:\x20project=','No\x20workflows\x20found','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','\x20from\x20session\x20','/app/workflows/','Total:\x20','✔\x20Schedule\x20#','\x0aApply\x20these\x20changes?','---\x20','pullProject','Reason:\x20','has','toLowerCase','No\x20projects\x20match\x20pattern:\x20','5911832ywGkGp','from','No\x20workflow\x20sessions\x20found','\x20(system)','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Validation:\x20skipped','buildTimelineData','floor','round','showWorkflowConsoleUrl','workflow:secrets:set','nextRunTime','-\x20no\x20files\x20written','✔\x20Clone\x20complete','Disable\x20a\x20workflow\x20schedule','\x20\x20Console:\x20','\x20\x20Source:\x20','targetDir','\x20\x20Session\x20ID:\x20','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','workflow:pull','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','push','stdout','\x0a✔\x20Attempt\x20complete','parseProjectWorkflowPattern','Session\x20','Status:\x20','padStart','Error:\x20Attempt\x20ID\x20is\x20required','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','window','unchanged','finishedAt','run','total','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','New\x20project\x20name:\x20','\x20\x20Project\x20ID:\x20','Pushing\x20project...','workflow:tasks','Expected\x20format:\x20--param\x20key=value','modified'];a54_0x5540=function(){return _0x2075e3;};return a54_0x5540();}const a54_0x1fa737=a54_0x6007;(function(_0x566793,_0x3710c7){const _0x3d12cb=a54_0x6007,_0x4b2e85=_0x566793();while(!![]){try{const _0x348bf3=parseInt(_0x3d12cb(0x147))/0x1+parseInt(_0x3d12cb(0x24b))/0x2+parseInt(_0x3d12cb(0x271))/0x3*(-parseInt(_0x3d12cb(0x173))/0x4)+parseInt(_0x3d12cb(0x190))/0x5*(-parseInt(_0x3d12cb(0x2ac))/0x6)+-parseInt(_0x3d12cb(0x261))/0x7+-parseInt(_0x3d12cb(0x20e))/0x8+parseInt(_0x3d12cb(0x1b0))/0x9*(parseInt(_0x3d12cb(0x2ad))/0xa);if(_0x348bf3===_0x3710c7)break;else _0x4b2e85['push'](_0x4b2e85['shift']());}catch(_0x27300a){_0x4b2e85['push'](_0x4b2e85['shift']());}}}(a54_0x5540,0x6afe3));function a54_0x6007(_0x1b5b29,_0x41caa1){_0x1b5b29=_0x1b5b29-0x12a;const _0x55402d=a54_0x5540();let _0x60070=_0x55402d[_0x1b5b29];return _0x60070;}import a54_0x3b7b49 from'chalk';import{existsSync}from'fs';import a54_0x2cd77d from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a54_0x49b152 from'prompts';function getAttemptStatusDisplay(_0x31c614){const _0x2fb178=a54_0x6007;if(!_0x31c614)return{'icon':'⏳','text':''};const {done:_0x5b45d7,success:_0x36baf1,cancelRequested:_0x797b4f}=_0x31c614;if(!_0x5b45d7)return _0x797b4f?{'icon':'🛑','text':a54_0x3b7b49[_0x2fb178(0x164)](_0x2fb178(0x1a0))}:{'icon':'🔄','text':a54_0x3b7b49[_0x2fb178(0x2a2)](_0x2fb178(0x2e5))};if(_0x36baf1)return{'icon':'✅','text':a54_0x3b7b49[_0x2fb178(0x24d)](_0x2fb178(0x16a))};return{'icon':'❌','text':a54_0x3b7b49['red'](_0x2fb178(0x188))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x1fa737(0x2c3)](_0x19a695,_0x4b1d1a,_0x58d0f8=0x0){const _0x3b36e9=a54_0x1fa737;return _0x19a695[_0x58d0f8]||_0x4b1d1a[_0x3b36e9(0x2bb)];}[a54_0x1fa737(0x1cd)](_0x4010fb,_0x1721e3,_0x5c91ee=0x0){const _0x1f67f5=a54_0x1fa737,_0x23205f=this[_0x1f67f5(0x2c3)](_0x4010fb,_0x1721e3,_0x5c91ee);if(!_0x23205f)return console[_0x1f67f5(0x188)](a54_0x3b7b49[_0x1f67f5(0x160)](_0x1f67f5(0x2e0)),_0x1f67f5(0x197)),console[_0x1f67f5(0x188)](a54_0x3b7b49[_0x1f67f5(0x189)](_0x1f67f5(0x2ea))),null;return _0x23205f;}[a54_0x1fa737(0x227)](_0x32b508,_0x17228b){const _0x20078a=a54_0x1fa737;if(_0x32b508[0x0]){const _0x376d74=_0x32b508[0x0][_0x20078a(0x2aa)]('.');if(_0x376d74[_0x20078a(0x240)]===0x1)return{'projectName':_0x376d74[0x0],'workflowName':undefined};else return _0x376d74[_0x20078a(0x240)]===0x2?{'projectName':_0x376d74[0x0],'workflowName':_0x376d74[0x1]}:(console[_0x20078a(0x188)](a54_0x3b7b49[_0x20078a(0x160)](_0x20078a(0x2e0)),_0x20078a(0x29e)),null);}return{'projectName':_0x17228b['workflowProject'],'workflowName':undefined};}[a54_0x1fa737(0x1a1)](_0x1f465b,_0x55458d,_0xdf639b=0x0){const _0x47aebc=a54_0x1fa737;if(_0x1f465b[_0xdf639b])return _0x1f465b[_0xdf639b];if(_0x55458d[_0x47aebc(0x2bb)]){const _0x4239e8=a54_0x2cd77d[_0x47aebc(0x257)](process['cwd'](),'workflows',_0x55458d['workflowProject']);if(existsSync(a54_0x2cd77d[_0x47aebc(0x257)](_0x4239e8,_0x47aebc(0x2ca))))return _0x4239e8;}return undefined;}async[a54_0x1fa737(0x217)](_0x19c73a,_0x4a9c59,_0x8fb821){const _0x5ab0f9=a54_0x1fa737;try{const _0x8e1afa=await _0x19c73a['workflow']['workflows'](_0x4a9c59,{'limit':0x1});if(_0x8e1afa[_0x5ab0f9(0x240)]>0x0){const _0x30fdf7=_0x8e1afa[0x0]['id'],_0x3fca0f=getWorkflowUrl(_0x8fb821,_0x30fdf7);console[_0x5ab0f9(0x188)](_0x5ab0f9(0x21d)+a54_0x3b7b49[_0x5ab0f9(0x1a9)](_0x3fca0f));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a54_0x1fa737(0x24e)]=a54_0x1fa737(0x1c1);[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x1d8);async[a54_0x1fa737(0x179)](_0x56faf2){const _0x4db829=a54_0x1fa737,{options:_0x41dd30,args:_0x53f4b5,tdx:_0x48ee31}=_0x56faf2,_0x1b54ac=_0x53f4b5[0x0],_0x29d018=_0x41dd30['clear'];if(_0x29d018)return saveSessionContext({'workflow_project':undefined},_0x41dd30[_0x4db829(0x2c2)]),console[_0x4db829(0x17e)](a54_0x3b7b49[_0x4db829(0x24d)](_0x4db829(0x299))),0x0;if(!_0x1b54ac)return console[_0x4db829(0x188)](a54_0x3b7b49['red'](_0x4db829(0x2e0)),'Project\x20name\x20is\x20required'),console[_0x4db829(0x188)](a54_0x3b7b49[_0x4db829(0x189)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x4db829(0x188)](a54_0x3b7b49[_0x4db829(0x189)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x48fd4=await withSpinner(_0x4db829(0x2d2)+_0x1b54ac+'\x27...',()=>_0x48ee31['workflow'][_0x4db829(0x187)](_0x1b54ac),{'verbose':_0x41dd30[_0x4db829(0x170)]}),{name:_0x4d3dc7}=_0x48fd4[_0x4db829(0x262)];return saveSessionContext({'workflow_project':_0x4d3dc7},_0x41dd30[_0x4db829(0x2c2)]),console[_0x4db829(0x17e)](a54_0x3b7b49[_0x4db829(0x24d)](_0x4db829(0x186)+a54_0x3b7b49[_0x4db829(0x1a9)](_0x4d3dc7))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x1fa737(0x24e)]='workflow:projects';[a54_0x1fa737(0x1f6)]='List\x20all\x20workflow\x20projects';async[a54_0x1fa737(0x179)](_0x44c2c1){const _0x553fb9=a54_0x1fa737,{options:_0x39b9ef,args:_0x18fc5f,tdx:_0x40416f}=_0x44c2c1,_0xa04e16=_0x18fc5f[0x0];_0x39b9ef[_0x553fb9(0x170)]&&_0xa04e16&&console[_0x553fb9(0x188)](_0x553fb9(0x144)+_0xa04e16);const _0x1d9121=await withSpinner(_0x553fb9(0x27b),()=>_0x40416f[_0x553fb9(0x2a0)][_0x553fb9(0x270)](_0xa04e16,{'limit':_0x39b9ef[_0x553fb9(0x171)]}),{'verbose':_0x39b9ef[_0x553fb9(0x170)]});let _0x600bc1=_0x1d9121[_0x553fb9(0x262)];_0x600bc1['sort']((_0x480a9e,_0x23fc29)=>_0x480a9e[_0x553fb9(0x24e)]['localeCompare'](_0x23fc29[_0x553fb9(0x24e)]));const _0x3a990e=_0x39b9ef[_0x553fb9(0x171)]||0x64,_0x51bedd=_0x600bc1[_0x553fb9(0x240)]>=_0x3a990e?a54_0x3b7b49[_0x553fb9(0x189)](_0x553fb9(0x14d)):'';console['error']('✔\x20Found\x20'+_0x600bc1['length']+_0x553fb9(0x17b)+(_0x600bc1['length']!==0x1?'s':'')+_0x51bedd);if(_0x39b9ef[_0x553fb9(0x1fb)]===_0x553fb9(0x16c)||_0x39b9ef[_0x553fb9(0x1fb)]==='jsonl'||_0x39b9ef[_0x553fb9(0x1fb)]==='table')await handleSDKOutput(_0x600bc1,_0x39b9ef);else{if(_0x600bc1[_0x553fb9(0x240)]===0x0)_0xa04e16?console[_0x553fb9(0x17e)](_0x553fb9(0x20d)+_0xa04e16):console[_0x553fb9(0x17e)](_0x553fb9(0x1bb));else{const _0xd67626=_0x600bc1[_0x553fb9(0x285)](_0x4c809=>{const _0x97f0dd=_0x553fb9,_0x182bb2=_0x4c809['metadata']?.['some'](_0x301013=>_0x301013['key']==='sys'),_0x5227eb=_0x182bb2?a54_0x3b7b49['dim'](_0x97f0dd(0x211)):'';return'📁\x20'+_0x4c809[_0x97f0dd(0x24e)]+_0x5227eb;});await writeOutput(_0xd67626['join']('\x0a'),_0x39b9ef[_0x553fb9(0x176)],_0x553fb9(0x135));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x1fa737(0x24e)]='workflow:workflows';[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x288);async[a54_0x1fa737(0x179)](_0x481970){const _0x21985e=a54_0x1fa737,{options:_0x241b5e,args:_0x56a408,tdx:_0x37aa6d}=_0x481970,_0x102291=this[_0x21985e(0x2c3)](_0x56a408,_0x241b5e);_0x241b5e[_0x21985e(0x170)]&&_0x102291&&console[_0x21985e(0x188)]('Project\x20filter:\x20'+_0x102291);const _0x298135=await withSpinner(_0x21985e(0x265),()=>_0x37aa6d[_0x21985e(0x2a0)][_0x21985e(0x2a1)](_0x102291,{'limit':_0x241b5e[_0x21985e(0x171)]}),{'verbose':_0x241b5e[_0x21985e(0x170)]});let _0x2af1d2=_0x298135[_0x21985e(0x262)];_0x2af1d2[_0x21985e(0x239)]((_0x219704,_0x70beff)=>{const _0x595d14=_0x21985e,_0x1de101=_0x219704[_0x595d14(0x24e)][_0x595d14(0x18f)](_0x70beff[_0x595d14(0x24e)]);if(_0x1de101!==0x0)return _0x1de101;return(_0x219704['project']?.[_0x595d14(0x24e)]||'')[_0x595d14(0x18f)](_0x70beff[_0x595d14(0x15f)]?.[_0x595d14(0x24e)]||'');});const _0x189282=_0x241b5e['limit']||0x64,_0x514fff=_0x2af1d2[_0x21985e(0x240)]>=_0x189282?a54_0x3b7b49[_0x21985e(0x189)](_0x21985e(0x14d)):'';console['error'](_0x21985e(0x2d7)+_0x2af1d2[_0x21985e(0x240)]+_0x21985e(0x16f)+(_0x2af1d2[_0x21985e(0x240)]!==0x1?'s':'')+_0x514fff);if(_0x241b5e['format']===_0x21985e(0x16c)||_0x241b5e[_0x21985e(0x1fb)]===_0x21985e(0x1a4)||_0x241b5e[_0x21985e(0x1fb)]===_0x21985e(0x14c))await handleSDKOutput(_0x2af1d2,_0x241b5e);else{if(_0x2af1d2[_0x21985e(0x240)]===0x0)_0x102291?console['log'](_0x21985e(0x2f3)+_0x102291):console[_0x21985e(0x17e)](_0x21985e(0x201));else{const _0x2a02bf=_0x241b5e[_0x21985e(0x177)],_0x5f09b1=_0x2af1d2['map'](_0x1981d2=>{const _0x278dbd=_0x21985e,_0xed6633=a54_0x3b7b49[_0x278dbd(0x189)]('#'+_0x1981d2['id']),_0x33a4e4=hyperlink(_0xed6633,getWorkflowUrl(_0x2a02bf,_0x1981d2['id'])),_0x393639=_0x1981d2[_0x278dbd(0x15f)]?.['name']?a54_0x3b7b49[_0x278dbd(0x189)]('\x20('+_0x1981d2[_0x278dbd(0x15f)]['name']+')'):'';return _0x278dbd(0x24a)+_0x33a4e4+'\x20'+_0x1981d2[_0x278dbd(0x24e)]+_0x393639;});await writeOutput(_0x5f09b1['join']('\x0a'),_0x241b5e[_0x21985e(0x176)],_0x21985e(0x135));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x1fa737(0x24e)]='workflow:sessions';['description']='List\x20workflow\x20execution\x20sessions';async[a54_0x1fa737(0x179)](_0x2798ca){const _0x4c18ad=a54_0x1fa737,{options:_0x363e95,args:_0x23b190,tdx:_0x7ed50a}=_0x2798ca,_0x149127=this[_0x4c18ad(0x227)](_0x23b190,_0x363e95);if(!_0x149127)return 0x1;const {projectName:_0x2ca9f5,workflowName:_0x154e17}=_0x149127;if(_0x363e95[_0x4c18ad(0x170)]){if(_0x2ca9f5&&_0x154e17)console[_0x4c18ad(0x188)]('Filter:\x20'+_0x2ca9f5+'.'+_0x154e17);else _0x2ca9f5&&console[_0x4c18ad(0x188)](_0x4c18ad(0x200)+_0x2ca9f5);const _0x45c3e6=_0x363e95[_0x4c18ad(0x278)];_0x45c3e6&&console[_0x4c18ad(0x188)](_0x4c18ad(0x229)+_0x45c3e6);}let _0x4173ca=0x28;if(process['stdout'][_0x4c18ad(0x19d)]&&!_0x363e95[_0x4c18ad(0x176)]&&!_0x363e95[_0x4c18ad(0x1fb)]){const _0x502a93=process[_0x4c18ad(0x225)][_0x4c18ad(0x28c)]||0x28;_0x4173ca=Math['max'](0x14,Math['floor'](_0x502a93*0x2/0x3));}const _0x569368=_0x363e95[_0x4c18ad(0x171)]||_0x4173ca,_0x98cd2a=await withSpinner(_0x4c18ad(0x259),()=>_0x7ed50a[_0x4c18ad(0x2a0)]['sessions']({'projectName':_0x2ca9f5,'workflowName':_0x154e17,'status':_0x363e95[_0x4c18ad(0x278)],'fromTime':_0x363e95[_0x4c18ad(0x20f)],'toTime':_0x363e95['to'],'limit':_0x569368}),{'verbose':_0x363e95[_0x4c18ad(0x170)]}),_0x190242=_0x98cd2a['data'];_0x190242[_0x4c18ad(0x239)]((_0x4967b5,_0x16ee11)=>{const _0x13e6d1=_0x4c18ad,_0x5c04ba=_0x4967b5[_0x13e6d1(0x198)]||'',_0x4b8c4c=_0x16ee11[_0x13e6d1(0x198)]||'';return _0x4b8c4c[_0x13e6d1(0x18f)](_0x5c04ba);});_0x190242['length']>=_0x569368?console[_0x4c18ad(0x188)](_0x4c18ad(0x1d9)+_0x190242[_0x4c18ad(0x240)]+_0x4c18ad(0x1be)+a54_0x3b7b49[_0x4c18ad(0x189)](_0x4c18ad(0x2d8))):console[_0x4c18ad(0x188)](_0x4c18ad(0x2d7)+_0x190242[_0x4c18ad(0x240)]+_0x4c18ad(0x2e2)+(_0x190242[_0x4c18ad(0x240)]!==0x1?'s':''));if(_0x363e95[_0x4c18ad(0x1fb)]===_0x4c18ad(0x16c)||_0x363e95[_0x4c18ad(0x1fb)]===_0x4c18ad(0x1a4)||_0x363e95[_0x4c18ad(0x1fb)]==='table')await handleSDKOutput(_0x190242,_0x363e95);else{if(!process[_0x4c18ad(0x225)]['isTTY']||_0x363e95['output']){if(_0x190242[_0x4c18ad(0x240)]===0x0){if(_0x2ca9f5&&_0x154e17)console[_0x4c18ad(0x17e)]('No\x20sessions\x20found\x20for:\x20'+_0x2ca9f5+'.'+_0x154e17);else _0x2ca9f5?console['log'](_0x4c18ad(0x2dd)+_0x2ca9f5):console[_0x4c18ad(0x17e)](_0x4c18ad(0x2b1));}else{const _0x511bca=_0x363e95[_0x4c18ad(0x177)],_0x3038a3=this['renderSessionsTimeline'](_0x190242,_0x511bca);_0x363e95[_0x4c18ad(0x176)]?await writeOutput(_0x3038a3,_0x363e95[_0x4c18ad(0x176)],_0x4c18ad(0x135)):console[_0x4c18ad(0x17e)](_0x3038a3);}!_0x2ca9f5&&(console['error'](''),console[_0x4c18ad(0x188)](a54_0x3b7b49[_0x4c18ad(0x189)](_0x4c18ad(0x150))),console[_0x4c18ad(0x188)](a54_0x3b7b49[_0x4c18ad(0x189)](_0x4c18ad(0x258))+'or'+a54_0x3b7b49[_0x4c18ad(0x189)](_0x4c18ad(0x1c6))));}else{if(_0x190242[_0x4c18ad(0x240)]===0x0){if(_0x2ca9f5&&_0x154e17)console[_0x4c18ad(0x17e)]('No\x20sessions\x20found\x20for:\x20'+_0x2ca9f5+'.'+_0x154e17);else _0x2ca9f5?console[_0x4c18ad(0x17e)](_0x4c18ad(0x2dd)+_0x2ca9f5):console['log'](_0x4c18ad(0x2b1));}else await this[_0x4c18ad(0x2cf)](_0x190242,_0x2798ca,_0x2ca9f5);}}return 0x0;}[a54_0x1fa737(0x2a9)](_0x5af120,_0x2a8ccd){const _0x46a1e0=a54_0x1fa737,_0x379c23=[],_0x3b468e=new Map();let _0x10a2cb=Infinity,_0x4f4454=-Infinity;for(const _0x6eb24d of _0x5af120){if(_0x6eb24d[_0x46a1e0(0x1fc)]?.[_0x46a1e0(0x2d3)]){const _0x539632=new Date(_0x6eb24d[_0x46a1e0(0x1fc)]['createdAt'])[_0x46a1e0(0x1cc)](),_0x1a3937=_0x6eb24d[_0x46a1e0(0x1fc)]['finishedAt']?new Date(_0x6eb24d[_0x46a1e0(0x1fc)]['finishedAt'])['getTime']():Date[_0x46a1e0(0x29c)](),_0x395da9=_0x6eb24d[_0x46a1e0(0x15f)]?.[_0x46a1e0(0x24e)]||_0x46a1e0(0x1c3);!_0x3b468e[_0x46a1e0(0x20b)](_0x395da9)&&_0x3b468e[_0x46a1e0(0x130)](_0x395da9,[]),_0x3b468e[_0x46a1e0(0x1e8)](_0x395da9)[_0x46a1e0(0x224)]({'session':_0x6eb24d,'startTime':_0x539632,'endTime':_0x1a3937,'duration':_0x1a3937-_0x539632}),_0x10a2cb=Math['min'](_0x10a2cb,_0x539632),_0x4f4454=Math[_0x46a1e0(0x255)](_0x4f4454,_0x1a3937);}}if(_0x3b468e[_0x46a1e0(0x266)]===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x31387c=process['stdout'][_0x46a1e0(0x18b)]||0x78,_0x40fd3d=0x1e,_0x585b35=0x32,_0x271140=0x4,_0x26c7f1=Math[_0x46a1e0(0x1b5)](_0x585b35,Math[_0x46a1e0(0x255)](_0x40fd3d,Math[_0x46a1e0(0x215)](_0x31387c*0.3))),_0x69d843=_0x31387c-_0x26c7f1-TIMELINE_CONFIG[_0x46a1e0(0x2a5)]-0x3-_0x271140,_0x5ca525=_0x4f4454-_0x10a2cb,_0x242c3f=_0x5ca525/_0x26c7f1,_0x5ad510=renderTimeAxis({'startTime':_0x10a2cb,'endTime':_0x4f4454,'durationMs':_0x5ca525,'msPerChar':_0x242c3f},_0x26c7f1),_0x291d7c=[];for(const _0x17068d of _0x3b468e['values']()){_0x291d7c[_0x46a1e0(0x224)](..._0x17068d);}_0x291d7c[_0x46a1e0(0x239)]((_0x49d18d,_0xab9290)=>_0xab9290['startTime']-_0x49d18d['startTime']);const _0x9ff9f8=new Date(_0x10a2cb),_0x3e1d62=formatDate(_0x9ff9f8),_0x21a1e9=_0x271140+TIMELINE_CONFIG[_0x46a1e0(0x2df)]+TIMELINE_CONFIG[_0x46a1e0(0x1a3)]+_0x69d843,_0x21484c='\x20'[_0x46a1e0(0x2ce)](_0x21a1e9-_0x3e1d62[_0x46a1e0(0x240)]),_0x54ce6d=_0x21484c+a54_0x3b7b49['dim'](_0x3e1d62)+'\x20'+_0x5ad510;_0x379c23[_0x46a1e0(0x224)](_0x54ce6d);const _0x11672c=0x16;let _0x9bca25=0x0;for(const _0x56056d of _0x291d7c){const _0x36d37f=_0x56056d[_0x46a1e0(0x2c2)]['project']?.[_0x46a1e0(0x24e)]||'?',_0x355f1f=Math[_0x46a1e0(0x1b5)](stringWidth(_0x36d37f),_0x11672c);_0x9bca25=Math[_0x46a1e0(0x255)](_0x9bca25,_0x355f1f);}for(const _0x4acacf of _0x291d7c){const {session:_0x57c07f,startTime:_0x5e8df1,endTime:_0x122890,duration:_0x14f94a}=_0x4acacf,_0x1e2fa8=_0x57c07f['project']?.['id'],_0x4b797c=_0x57c07f['id'],_0x3a0c52=_0x57c07f[_0x46a1e0(0x15f)]?.[_0x46a1e0(0x24e)]||'?',_0x22f4d7=_0x57c07f[_0x46a1e0(0x2a0)]?.['name']||'?';let _0x3a4ec4,_0x375b65;if(_0x57c07f[_0x46a1e0(0x1fc)]){const _0x858464=_0x57c07f[_0x46a1e0(0x1fc)];!_0x858464[_0x46a1e0(0x2a7)]?(_0x3a4ec4=_0x858464['cancelRequested']?'🛑':'🔄',_0x375b65=_0x858464['cancelRequested']?a54_0x3b7b49[_0x46a1e0(0x164)]:a54_0x3b7b49[_0x46a1e0(0x2a2)]):(_0x3a4ec4=_0x858464['success']?'✅':'❌',_0x375b65=_0x858464[_0x46a1e0(0x16a)]?a54_0x3b7b49[_0x46a1e0(0x24d)]:a54_0x3b7b49[_0x46a1e0(0x160)]);}else _0x3a4ec4='⏳',_0x375b65=a54_0x3b7b49[_0x46a1e0(0x189)];const _0x23daee='#'+_0x4b797c,_0x18c0a4=_0x1e2fa8?hyperlink(_0x23daee,getWorkflowSessionUrl(_0x2a8ccd,_0x1e2fa8,_0x4b797c)):_0x23daee;let _0x556d35=_0x3a0c52;stringWidth(_0x3a0c52)>_0x11672c&&(_0x556d35=_0x3a0c52[_0x46a1e0(0x26b)](0x0,_0x11672c-0x1)+'…');const _0x9b2742=a54_0x3b7b49[_0x46a1e0(0x189)](_0x556d35),_0x1fea57=stringWidth(_0x556d35),_0x23c61b='\x20'['repeat'](_0x9bca25-stringWidth(_0x556d35)+0x2),_0x54284a='('+formatElapsed(_0x14f94a)+')',_0x2b647e=stringWidth(_0x54284a),_0x219fd5=stringWidth(_0x23daee),_0x4bda82=_0x219fd5+0x1+_0x1fea57+_0x23c61b[_0x46a1e0(0x240)],_0x1bae1c=_0x69d843-_0x4bda82-_0x2b647e-0x1-0x8;let _0x8bc76b=_0x22f4d7;stringWidth(_0x8bc76b)>_0x1bae1c&&(_0x8bc76b=_0x8bc76b['slice'](0x0,_0x1bae1c-0x1)+'…');const _0x3d3d60=_0x18c0a4+'\x20'+_0x9b2742+_0x23c61b+_0x8bc76b,_0x142ac6=stringWidth(_0x3d3d60),_0x4ead22=_0x69d843-_0x142ac6-_0x2b647e,_0x273f15=_0x3d3d60+'\x20'[_0x46a1e0(0x2ce)](Math['max'](0x1,_0x4ead22))+a54_0x3b7b49[_0x46a1e0(0x189)](_0x54284a),_0x4ac4cf=Math[_0x46a1e0(0x215)]((_0x5e8df1-_0x10a2cb)/_0x242c3f),_0x57bb8a=Math[_0x46a1e0(0x215)]((_0x122890-_0x10a2cb)/_0x242c3f),_0x253ab7=Math[_0x46a1e0(0x255)](_0x4ac4cf+0x1,_0x57bb8a),_0xd9b629=new Array(_0x26c7f1)['fill']('\x20');for(let _0x4ba968=_0x4ac4cf;_0x4ba968<Math[_0x46a1e0(0x1b5)](_0x253ab7,_0x26c7f1);_0x4ba968++){_0xd9b629[_0x4ba968]='─';}const _0x36e7c3=_0xd9b629[_0x46a1e0(0x285)](_0x1ec78f=>_0x1ec78f==='\x20'?'\x20':_0x375b65(_0x1ec78f))['join']('');_0x379c23[_0x46a1e0(0x224)](_0x3a4ec4+'\x20'+_0x273f15+'│'+_0x36e7c3+'│');}return _0x379c23[_0x46a1e0(0x257)]('\x0a');}async[a54_0x1fa737(0x2cf)](_0x4c8ad9,_0x491745,_0x47abfb){const _0xf016d6=a54_0x1fa737,{options:_0xa3f7bd,tdx:_0x5a513b}=_0x491745,_0x57d023=_0xa3f7bd['site'],{timelineRows:_0xab174d,timeAxisHeader:_0x2c34e2}=this[_0xf016d6(0x2e7)](_0x4c8ad9,_0x57d023),_0x429cbe=_0xab174d[_0xf016d6(0x2d9)](_0x954fea=>_0x954fea[_0xf016d6(0x243)]);if(_0x429cbe[_0xf016d6(0x240)]===0x0){const _0x433d74=this[_0xf016d6(0x2a9)](_0x4c8ad9,_0x57d023);console['log'](_0x433d74);!_0x47abfb&&(console[_0xf016d6(0x188)](''),console[_0xf016d6(0x188)](a54_0x3b7b49[_0xf016d6(0x189)](_0xf016d6(0x150))),console[_0xf016d6(0x188)](a54_0x3b7b49['dim']('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a54_0x3b7b49[_0xf016d6(0x189)](_0xf016d6(0x1c6))));return;}_0x2c34e2&&console[_0xf016d6(0x17e)](_0x2c34e2);const _0xd9ba79=_0xab174d['filter'](_0x478c7d=>_0x478c7d[_0xf016d6(0x243)])['map'](_0x72aec6=>({'title':_0x72aec6[_0xf016d6(0x1cf)],'value':_0x72aec6[_0xf016d6(0x243)]})),_0x5243ba=process[_0xf016d6(0x225)][_0xf016d6(0x28c)]||0x3c,_0x2eb04d=Math[_0xf016d6(0x255)](0x28,Math[_0xf016d6(0x215)](_0x5243ba*0x2/0x3)),_0x496964=await a54_0x49b152({'type':_0xf016d6(0x1ed),'name':_0xf016d6(0x243),'message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0xd9ba79,'initial':-0x1,'limit':_0x2eb04d,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x59c048,_0x482adc)=>{const _0x24fdee=_0xf016d6;if(!_0x59c048)return Promise[_0x24fdee(0x23a)](_0x482adc);const _0x2e0ba0=_0x482adc[_0x24fdee(0x2d9)](_0x5fc6cf=>{const _0x392cf0=_0x24fdee,_0x424db6=_0x5fc6cf;return _0x424db6[_0x392cf0(0x1c5)][_0x392cf0(0x20c)]()['includes'](_0x59c048[_0x392cf0(0x20c)]());});return Promise[_0x24fdee(0x23a)](_0x2e0ba0);}}),_0x2ed005=()=>{const _0x13db09=_0xf016d6;process[_0x13db09(0x225)][_0x13db09(0x14e)](_0x13db09(0x27c)),process[_0x13db09(0x225)]['write'](_0x13db09(0x27c)),process['stdout'][_0x13db09(0x14e)](_0x13db09(0x27c));},_0x3c652d=_0x496964&&_0x496964[_0xf016d6(0x243)]&&_0x496964['attemptId']!==null&&_0x496964[_0xf016d6(0x243)][_0xf016d6(0x2a3)]()!=='';if(!_0x3c652d){_0x2ed005(),console[_0xf016d6(0x17e)](a54_0x3b7b49[_0xf016d6(0x189)]('Cancelled'));return;}_0x2ed005();const _0x319202=_0x4c8ad9['find'](_0x2e9091=>_0x2e9091[_0xf016d6(0x1fc)]?.['id']===_0x496964[_0xf016d6(0x243)]);if(_0x319202){const _0x5e002a=_0x319202[_0xf016d6(0x15f)]?.['name']||'?',_0x274f00=_0x319202['workflow']?.[_0xf016d6(0x24e)]||'?';console[_0xf016d6(0x17e)]('Project:\x20'+a54_0x3b7b49['dim'](_0x5e002a)+',\x20Workflow:\x20'+a54_0x3b7b49[_0xf016d6(0x189)](_0x274f00));}const _0x261b01=new WorkflowTimelineCommand();await _0x261b01[_0xf016d6(0x179)]({'args':[],'options':{..._0xa3f7bd,'attemptId':_0x496964[_0xf016d6(0x243)]},'tdx':_0x5a513b});}['generateSessionTimelineRows'](_0x35731c,_0xd01f1c){const _0x2e5487=a54_0x1fa737,_0x15e659=new Map();for(const _0x24741c of _0x35731c){_0x24741c['id']&&_0x24741c['lastAttempt']?.['id']&&_0x15e659[_0x2e5487(0x130)](_0x24741c['id'],_0x24741c[_0x2e5487(0x1fc)]['id']);}const _0x29d5d1=[];let _0x3952ae='';const _0x46e43c=this['renderSessionsTimeline'](_0x35731c,_0xd01f1c),_0x140700=_0x46e43c[_0x2e5487(0x2aa)]('\x0a');for(const _0x4a297c of _0x140700){if(_0x4a297c['startsWith'](_0x2e5487(0x1e6))||_0x4a297c[_0x2e5487(0x2cb)](/^\s+\d{4}-\d{2}-\d{2}/))_0x3952ae=_0x4a297c;else{if(_0x4a297c[_0x2e5487(0x2cb)](/^[✅❌🔄🛑⏳]/)){const _0x2c239d=_0x4a297c['match'](/#(\d+)/),_0x4abf8c=_0x2c239d?_0x2c239d[0x1]:null,_0x21a910=_0x4abf8c?_0x15e659[_0x2e5487(0x1e8)](_0x4abf8c)||null:null,_0x57b99e=_0x35731c[_0x2e5487(0x1c2)](_0x698a6d=>_0x698a6d['id']===_0x4abf8c),_0x3ec4c5=_0x57b99e?.['project']?.['name']||'';_0x29d5d1[_0x2e5487(0x224)]({'displayLine':_0x4a297c,'attemptId':_0x21a910,'projectName':_0x3ec4c5});}}}return{'timelineRows':_0x29d5d1,'timeAxisHeader':_0x3952ae};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']='workflow:attempts';[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x23d);async['execute'](_0x23e92f){const _0x3788f6=a54_0x1fa737,{options:_0x40a899,args:_0x10f2a3,tdx:_0x36887c}=_0x23e92f,_0x5f05f1=this[_0x3788f6(0x227)](_0x10f2a3,_0x40a899);if(!_0x5f05f1)return 0x1;const {projectName:_0x454ee6,workflowName:_0x366bd9}=_0x5f05f1,_0x5cebba=_0x40a899[_0x3788f6(0x149)];if(_0x40a899[_0x3788f6(0x170)]){if(_0x454ee6&&_0x366bd9)console[_0x3788f6(0x188)](_0x3788f6(0x18a)+_0x454ee6+'.'+_0x366bd9);else _0x454ee6&&console['error'](_0x3788f6(0x200)+_0x454ee6);_0x5cebba&&console[_0x3788f6(0x188)](_0x3788f6(0x247));}const _0x3f11a7=await withSpinner(_0x3788f6(0x27a),()=>_0x36887c[_0x3788f6(0x2a0)][_0x3788f6(0x24f)]({'projectName':_0x454ee6,'workflowName':_0x366bd9,'includeRetried':_0x5cebba,'limit':_0x40a899['limit']}),{'verbose':_0x40a899['verbose']}),_0x3bc9b5=_0x3f11a7[_0x3788f6(0x262)],_0x292954=_0x40a899[_0x3788f6(0x171)]||0x64,_0x57d353=_0x3bc9b5[_0x3788f6(0x240)]>=_0x292954?a54_0x3b7b49[_0x3788f6(0x189)](_0x3788f6(0x14d)):'';console[_0x3788f6(0x188)](_0x3788f6(0x2d7)+_0x3bc9b5[_0x3788f6(0x240)]+_0x3788f6(0x1bc)+(_0x3bc9b5[_0x3788f6(0x240)]!==0x1?'s':'')+_0x57d353);if(_0x40a899[_0x3788f6(0x1fb)]===_0x3788f6(0x16c)||_0x40a899[_0x3788f6(0x1fb)]==='jsonl'||_0x40a899[_0x3788f6(0x1fb)]==='table')await handleSDKOutput(_0x3bc9b5,_0x40a899);else{if(_0x3bc9b5[_0x3788f6(0x240)]===0x0){if(_0x454ee6&&_0x366bd9)console['log'](_0x3788f6(0x194)+_0x454ee6+'.'+_0x366bd9);else _0x454ee6?console[_0x3788f6(0x17e)](_0x3788f6(0x148)+_0x454ee6):console[_0x3788f6(0x17e)](_0x3788f6(0x19f));}else{const _0x40b6db=_0x40a899[_0x3788f6(0x177)],_0x5c34a4=_0x3bc9b5[_0x3788f6(0x285)](_0xe6451b=>{const _0x6fe108=_0x3788f6,_0x4dc2d6=a54_0x3b7b49[_0x6fe108(0x189)]('#'+_0xe6451b['id']),_0x20d8fd=_0xe6451b['project']?.['id'],_0x3a2a90=_0xe6451b[_0x6fe108(0x2c5)]||_0xe6451b['sessionId'],_0xda51e2=_0x20d8fd&&_0x3a2a90?hyperlink(_0x4dc2d6,getWorkflowAttemptUrl(_0x40b6db,_0x20d8fd,_0x3a2a90,_0xe6451b['id'])):_0x4dc2d6,{icon:_0x49e6f1,text:_0x57c1b0}=getAttemptStatusDisplay(_0xe6451b),_0x2be812=(_0xe6451b[_0x6fe108(0x15f)]?.[_0x6fe108(0x24e)]||'?')+'.'+(_0xe6451b[_0x6fe108(0x2a0)]?.[_0x6fe108(0x24e)]||'?'),_0x572bbe=_0xe6451b[_0x6fe108(0x198)]?a54_0x3b7b49[_0x6fe108(0x189)](_0xe6451b[_0x6fe108(0x198)]):'';return(_0xda51e2+'\x20'+_0x49e6f1+(_0x57c1b0?'\x20'+_0x57c1b0:'')+'\x20'+_0x2be812+'\x20'+_0x572bbe)[_0x6fe108(0x159)]();});await writeOutput(_0x5c34a4[_0x3788f6(0x257)]('\x0a'),_0x40a899[_0x3788f6(0x176)],_0x3788f6(0x135));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a54_0x1fa737(0x2cc);[a54_0x1fa737(0x1f6)]='Show\x20specific\x20attempt\x20details';async[a54_0x1fa737(0x179)](_0x3de35e){const _0x33d350=a54_0x1fa737,{options:_0x11b651,args:_0x525f66,tdx:_0x3000aa}=_0x3de35e,_0x23cfc9=_0x525f66[0x0];if(!_0x23cfc9)return console[_0x33d350(0x188)](_0x33d350(0x22b)),0x1;_0x11b651['verbose']&&console['error'](_0x33d350(0x2c6)+_0x23cfc9);const _0x6e46f6=await withSpinner(_0x33d350(0x1dd),()=>_0x3000aa['workflow']['attempt'](_0x23cfc9),{'verbose':_0x11b651[_0x33d350(0x170)]}),_0x2d1e5b=_0x6e46f6[_0x33d350(0x262)];let _0x2e24d0;!_0x2d1e5b[_0x33d350(0x2a7)]?_0x2e24d0=_0x2d1e5b[_0x33d350(0x140)]?_0x33d350(0x1a0):_0x33d350(0x2e5):_0x2e24d0=_0x2d1e5b[_0x33d350(0x16a)]?_0x33d350(0x16a):_0x33d350(0x188);let _0x34dbae;if(_0x2d1e5b[_0x33d350(0x2d3)]&&_0x2d1e5b[_0x33d350(0x22f)]){const _0x3f4326=new Date(_0x2d1e5b[_0x33d350(0x2d3)])[_0x33d350(0x1cc)](),_0x31240a=new Date(_0x2d1e5b['finishedAt'])['getTime']();_0x34dbae=Math[_0x33d350(0x216)]((_0x31240a-_0x3f4326)/0x3e8);}const _0x178ef1={'attempt_id':_0x2d1e5b['id'],'status':_0x2e24d0,..._0x2d1e5b[_0x33d350(0x17c)]!==undefined&&{'index':_0x2d1e5b[_0x33d350(0x17c)]},..._0x2d1e5b[_0x33d350(0x15f)]&&{'project':_0x2d1e5b[_0x33d350(0x15f)][_0x33d350(0x24e)]},..._0x2d1e5b['workflow']&&{'workflow':_0x2d1e5b['workflow'][_0x33d350(0x24e)]},..._0x2d1e5b[_0x33d350(0x1c8)]&&{'session_id':_0x2d1e5b[_0x33d350(0x1c8)]},..._0x2d1e5b[_0x33d350(0x198)]&&{'session_time':_0x2d1e5b[_0x33d350(0x198)]},..._0x2d1e5b[_0x33d350(0x138)]&&{'retry_attempt':_0x2d1e5b[_0x33d350(0x138)]},..._0x34dbae!==undefined&&{'duration_sec':_0x34dbae},..._0x2d1e5b[_0x33d350(0x2d3)]&&{'created_at':_0x2d1e5b[_0x33d350(0x2d3)]},..._0x2d1e5b[_0x33d350(0x22f)]&&{'finished_at':_0x2d1e5b[_0x33d350(0x22f)]},...Object[_0x33d350(0x169)](_0x2d1e5b[_0x33d350(0x284)])[_0x33d350(0x240)]>0x0&&{'params':_0x2d1e5b['params']}};return await handleSingleObjectOutput(_0x178ef1,_0x11b651),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a54_0x1fa737(0x236);['description']=a54_0x1fa737(0x1eb);async[a54_0x1fa737(0x179)](_0x595c53){const _0x1f23ec=a54_0x1fa737,{options:_0x1058df,args:_0x57806f,tdx:_0x591a8d}=_0x595c53,_0x4982ef=_0x57806f[0x0];if(!_0x4982ef)return console[_0x1f23ec(0x188)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x235d7f=_0x1058df[_0x1f23ec(0x294)];_0x1058df['verbose']&&(console[_0x1f23ec(0x188)](_0x1f23ec(0x2c6)+_0x4982ef),_0x235d7f&&console[_0x1f23ec(0x188)]('Including\x20subtasks:\x20yes'));const _0x2d3460=await withSpinner(_0x1f23ec(0x19b),()=>_0x591a8d['workflow'][_0x1f23ec(0x158)](_0x4982ef,_0x235d7f||![]),{'verbose':_0x1058df['verbose']}),_0x4fa37d=_0x2d3460[_0x1f23ec(0x262)];return console[_0x1f23ec(0x188)](_0x1f23ec(0x2d7)+_0x4fa37d[_0x1f23ec(0x240)]+_0x1f23ec(0x142)+(_0x4fa37d['length']!==0x1?'s':'')),await handleSDKOutput(_0x4fa37d,_0x1058df),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0x1fa737(0x24e)]=a54_0x1fa737(0x249);[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x1d1);async[a54_0x1fa737(0x179)](_0x1e4b57){const _0x28b2e9=a54_0x1fa737,{options:_0x3b9fdf,args:_0x2f7abe,tdx:_0x261b17}=_0x1e4b57,_0x34acda=_0x2f7abe[0x0];let _0xe21a55=_0x2f7abe[0x1];if(!_0x34acda)return console[_0x28b2e9(0x188)](_0x28b2e9(0x22b)),0x1;_0x3b9fdf[_0x28b2e9(0x170)]&&(console[_0x28b2e9(0x188)]('Attempt\x20ID:\x20'+_0x34acda),_0xe21a55&&console['error'](_0x28b2e9(0x141)+_0xe21a55));const _0x41427d=await withSpinner(_0x28b2e9(0x161),()=>_0x261b17[_0x28b2e9(0x2a0)][_0x28b2e9(0x1f7)](_0x34acda,_0xe21a55),{'verbose':_0x3b9fdf[_0x28b2e9(0x170)]}),_0x4eaa2f=_0x41427d['data'];if(_0x4eaa2f[_0x28b2e9(0x240)]===0x0)return console['error'](_0x28b2e9(0x1ba)),0x0;if(!_0xe21a55&&(_0x3b9fdf['json']||_0x3b9fdf[_0x28b2e9(0x1fb)]))return await handleSDKOutput(_0x4eaa2f,_0x3b9fdf),0x0;if(!_0xe21a55){const _0x262dc2=_0x4eaa2f[_0x28b2e9(0x285)](_0x60f54a=>({'title':_0x60f54a[_0x28b2e9(0x260)]+'\x20('+formatBytes(_0x60f54a['fileSize'])+')','value':_0x60f54a[_0x28b2e9(0x260)]})),_0x44bc45=await a54_0x49b152({'type':_0x28b2e9(0x1c4),'name':_0x28b2e9(0x1e3),'message':_0x28b2e9(0x25a),'choices':_0x262dc2});if(!_0x44bc45[_0x28b2e9(0x1e3)])return console['error'](_0x28b2e9(0x151)),0x0;_0xe21a55=_0x44bc45[_0x28b2e9(0x1e3)];}const _0x360c41=await withSpinner(_0x28b2e9(0x277),()=>_0x261b17[_0x28b2e9(0x2a0)]['logs'](_0x34acda,_0xe21a55),{'verbose':_0x3b9fdf[_0x28b2e9(0x170)]}),_0x4a94cc=_0x360c41[_0x28b2e9(0x262)];return _0x4a94cc?console['log'](_0x4a94cc):console['error'](_0x28b2e9(0x12d)),0x0;}}export class WorkflowKillCommand extends BaseCommand{['name']=a54_0x1fa737(0x13e);[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x16b);async[a54_0x1fa737(0x179)](_0x123b8d){const _0x1bd957=a54_0x1fa737,{options:_0x475b41,args:_0x19452a,tdx:_0x237745}=_0x123b8d,_0x2f0b9e=_0x19452a[0x0];if(!_0x2f0b9e)return console[_0x1bd957(0x188)](_0x1bd957(0x22b)),0x1;const _0x1c1631=_0x475b41[_0x1bd957(0x2b4)];_0x475b41[_0x1bd957(0x170)]&&(console[_0x1bd957(0x188)](_0x1bd957(0x2c6)+_0x2f0b9e),_0x1c1631&&console[_0x1bd957(0x188)](_0x1bd957(0x20a)+_0x1c1631));if(!_0x475b41['yes']){if(!isInteractive())return console[_0x1bd957(0x188)](a54_0x3b7b49[_0x1bd957(0x160)](_0x1bd957(0x132)),_0x1bd957(0x223)),console['error'](a54_0x3b7b49[_0x1bd957(0x189)](_0x1bd957(0x283))),0x1;const _0x364bb2=await confirmKey(_0x1bd957(0x232)+_0x2f0b9e+'?');if(!_0x364bb2)return console[_0x1bd957(0x188)](a54_0x3b7b49[_0x1bd957(0x164)](_0x1bd957(0x151))),0x1;}const _0x194bc=await withSpinner(_0x1bd957(0x1a8),()=>_0x237745[_0x1bd957(0x2a0)][_0x1bd957(0x1bd)](_0x2f0b9e,_0x1c1631),{'verbose':_0x475b41['verbose']}),_0x12edfa=_0x194bc[_0x1bd957(0x262)];return console['error']('✔\x20'+_0x12edfa),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x1fa737(0x24e)]='workflow:retry';[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x29a);async['execute'](_0x418006){const _0xd37217=a54_0x1fa737,{options:_0x2d3a0c,args:_0x82b132,tdx:_0x170255}=_0x418006,_0x340301=_0x82b132[0x0];if(!_0x340301)return console['error']('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0xd37217(0x188)](_0xd37217(0x143)),0x1;let _0x2fbeee=![],_0x36380d=_0x340301;if(_0x340301[_0xd37217(0x268)](_0xd37217(0x15d)))_0x2fbeee=!![],_0x36380d=_0x340301[_0xd37217(0x1ab)](0x8);else{if(_0x340301[_0xd37217(0x268)](_0xd37217(0x1b1)))_0x2fbeee=![],_0x36380d=_0x340301[_0xd37217(0x1ab)](0x8);else return console[_0xd37217(0x188)](_0xd37217(0x241)),console['error'](_0xd37217(0x143)),0x1;}const _0x2d0aa3=_0x2d3a0c[_0xd37217(0x281)],_0xb39192=_0x2d3a0c[_0xd37217(0x296)],_0x55d17a=_0x2d3a0c['params'],_0x3cfa37=_0x2d3a0c[_0xd37217(0x248)];_0x2d3a0c[_0xd37217(0x170)]&&(console[_0xd37217(0x188)](_0xd37217(0x1d6)+(_0x2fbeee?_0xd37217(0x2c2):_0xd37217(0x242))+'\x20'+_0x36380d),_0x2d0aa3&&console['error']('From\x20task:\x20'+_0x2d0aa3),_0xb39192&&console[_0xd37217(0x188)](_0xd37217(0x1f2)+_0xb39192),_0x55d17a&&console[_0xd37217(0x188)](_0xd37217(0x251)+_0x55d17a),_0x3cfa37&&console[_0xd37217(0x188)](_0xd37217(0x290)));let _0x5708cc;if(_0x55d17a)try{if(_0x55d17a[_0xd37217(0x268)]('@')){const _0x48a810=await import(_0xd37217(0x26d)),_0x57de3f=_0x55d17a[_0xd37217(0x1ab)](0x1),_0x34f81b=await _0x48a810['readFile'](_0x57de3f,'utf-8');_0x5708cc=JSON[_0xd37217(0x1f5)](_0x34f81b);}else _0x5708cc=JSON[_0xd37217(0x1f5)](_0x55d17a);}catch{return console[_0xd37217(0x188)](_0xd37217(0x2b9)),0x1;}if(!_0x2d3a0c[_0xd37217(0x27f)]){if(!isInteractive())return console[_0xd37217(0x188)](a54_0x3b7b49['red'](_0xd37217(0x132)),_0xd37217(0x223)),console['error'](a54_0x3b7b49[_0xd37217(0x189)](_0xd37217(0x283))),0x1;const _0x1082c6=await confirmKey(_0xd37217(0x212)+(_0x2fbeee?_0xd37217(0x2c2):_0xd37217(0x242))+'\x20'+_0x36380d+'?');if(!_0x1082c6)return console[_0xd37217(0x188)](a54_0x3b7b49[_0xd37217(0x164)](_0xd37217(0x151))),0x1;}let _0x3bdf15;_0x2fbeee?_0x3bdf15=await withSpinner(_0xd37217(0x2e9),()=>_0x170255['workflow'][_0xd37217(0x2bc)](_0x36380d,{'fromTask':_0x2d0aa3,'retryParams':_0x5708cc}),{'verbose':_0x2d3a0c[_0xd37217(0x170)]}):_0x3bdf15=await withSpinner(_0xd37217(0x153),()=>_0x170255[_0xd37217(0x2a0)][_0xd37217(0x15a)](_0x36380d,{'resumeFrom':_0xb39192,'retryParams':_0x5708cc,'force':_0x3cfa37}),{'verbose':_0x2d3a0c[_0xd37217(0x170)]});const _0x3afd46=_0x3bdf15[_0xd37217(0x262)];return console['error'](_0xd37217(0x298)),console[_0xd37217(0x188)](_0xd37217(0x1f4)+_0x3afd46[_0xd37217(0x243)]),console[_0xd37217(0x188)](_0xd37217(0x220)+_0x3afd46['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x1fa737(0x24e)]=a54_0x1fa737(0x26a);[a54_0x1fa737(0x1f6)]='Start\x20a\x20workflow\x20run';async[a54_0x1fa737(0x179)](_0x225910){const _0x2b2d71=a54_0x1fa737,{options:_0x88c799,args:_0x3b28ef,tdx:_0x1cce4a}=_0x225910;let _0x15f3eb=_0x3b28ef[0x0];if(!_0x15f3eb){const _0x264332=this[_0x2b2d71(0x2c3)]([],_0x88c799),_0x585b2e=await withSpinner(_0x2b2d71(0x192),()=>_0x1cce4a['workflow'][_0x2b2d71(0x2a1)](_0x264332,{'limit':_0x88c799['limit']}),{'verbose':_0x88c799['verbose']}),_0x1261f2=_0x585b2e[_0x2b2d71(0x262)];if(_0x1261f2[_0x2b2d71(0x240)]===0x0)return console[_0x2b2d71(0x188)](_0x2b2d71(0x201)),!_0x264332&&console[_0x2b2d71(0x188)](a54_0x3b7b49[_0x2b2d71(0x189)](_0x2b2d71(0x2ea))),0x1;const _0x575328=_0x1261f2[_0x2b2d71(0x285)](_0x3ba72f=>({'title':_0x3ba72f[_0x2b2d71(0x15f)]?.[_0x2b2d71(0x24e)]+'.'+_0x3ba72f[_0x2b2d71(0x24e)],'value':_0x3ba72f['project']?.[_0x2b2d71(0x24e)]+'.'+_0x3ba72f[_0x2b2d71(0x24e)],'description':_0x3ba72f['revision']?'revision:\x20'+_0x3ba72f[_0x2b2d71(0x269)]:undefined})),_0x20b659=await a54_0x49b152({'type':_0x2b2d71(0x1c4),'name':'workflow','message':_0x2b2d71(0x14f),'choices':_0x575328});if(!_0x20b659[_0x2b2d71(0x2a0)])return 0x1;_0x15f3eb=_0x20b659[_0x2b2d71(0x2a0)];}if(!_0x15f3eb[_0x2b2d71(0x1f9)]('.')){const _0x52b047=this['resolveProject']([],_0x88c799);if(_0x52b047)_0x15f3eb=_0x52b047+'.'+_0x15f3eb;else return console[_0x2b2d71(0x188)](a54_0x3b7b49[_0x2b2d71(0x160)]('Error:'),_0x2b2d71(0x1da)),console[_0x2b2d71(0x188)](a54_0x3b7b49['dim'](_0x2b2d71(0x2ea))),0x1;}const _0x2ecad0=_0x88c799['param'],_0x5857cc=_0x88c799[_0x2b2d71(0x198)],_0x624563={};if(_0x2ecad0&&Array[_0x2b2d71(0x252)](_0x2ecad0))for(const _0x278564 of _0x2ecad0){const _0x599334=_0x278564[_0x2b2d71(0x1a7)]('=');if(_0x599334===-0x1)return console[_0x2b2d71(0x188)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x278564),console[_0x2b2d71(0x188)](_0x2b2d71(0x237)),0x1;const _0x4e3d5e=_0x278564['substring'](0x0,_0x599334),_0x5a078e=_0x278564[_0x2b2d71(0x1ab)](_0x599334+0x1);try{_0x624563[_0x4e3d5e]=JSON[_0x2b2d71(0x1f5)](_0x5a078e);}catch{_0x624563[_0x4e3d5e]=_0x5a078e;}}_0x88c799[_0x2b2d71(0x170)]&&(console[_0x2b2d71(0x188)](_0x2b2d71(0x25c)+_0x15f3eb),Object[_0x2b2d71(0x169)](_0x624563)[_0x2b2d71(0x240)]>0x0&&console[_0x2b2d71(0x188)](_0x2b2d71(0x2ec)+JSON[_0x2b2d71(0x1fd)](_0x624563)),_0x5857cc&&console[_0x2b2d71(0x188)](_0x2b2d71(0x13d)+_0x5857cc));const _0x5b2f6b=await withSpinner(_0x2b2d71(0x2e6),()=>_0x1cce4a[_0x2b2d71(0x2a0)][_0x2b2d71(0x230)](_0x15f3eb,_0x624563,{'sessionTime':_0x5857cc}),{'verbose':_0x88c799[_0x2b2d71(0x170)]}),_0x2e08de=_0x5b2f6b[_0x2b2d71(0x262)];console[_0x2b2d71(0x188)]('✔\x20Workflow\x20run\x20started'),console[_0x2b2d71(0x188)](_0x2b2d71(0x267)+_0x2e08de['id']),console[_0x2b2d71(0x188)]('\x20\x20Session\x20ID:\x20'+_0x2e08de[_0x2b2d71(0x1c8)]),console[_0x2b2d71(0x188)]('\x20\x20Project:\x20'+_0x2e08de[_0x2b2d71(0x15f)]?.[_0x2b2d71(0x24e)]),console[_0x2b2d71(0x188)](_0x2b2d71(0x2a8)+_0x2e08de['workflow']?.[_0x2b2d71(0x24e)]);if(_0x2e08de[_0x2b2d71(0x15f)]?.['id']&&_0x2e08de['sessionId']&&_0x2e08de['id']){const _0xdc6ddc=_0x88c799[_0x2b2d71(0x177)],_0xabe0d9=getConsoleUrl(_0xdc6ddc,_0x2b2d71(0x204)+_0x2e08de['project']['id']+_0x2b2d71(0x2eb)+_0x2e08de['sessionId']+_0x2b2d71(0x295)+_0x2e08de['id']);console['error'](_0x2b2d71(0x21d)+a54_0x3b7b49['cyan'](_0xabe0d9));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a54_0x1fa737(0x24e)]=a54_0x1fa737(0x23c);[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x22c);async['execute'](_0x12ff5a){const _0xa6009d=a54_0x1fa737,{options:_0x75eb20,args:_0x472157,tdx:_0x403bad}=_0x12ff5a,_0x4f42c0=_0x472157[0x0],_0x2a903f=_0x472157[0x1]||'.';if(!_0x4f42c0)return console['error'](_0xa6009d(0x2f2)),console[_0xa6009d(0x188)](_0xa6009d(0x12e)),0x1;const _0x2b3b3d=_0x75eb20[_0xa6009d(0x269)];_0x75eb20['verbose']&&(console['error']('Project:\x20'+_0x4f42c0),console[_0xa6009d(0x188)](_0xa6009d(0x264)+_0x2a903f),_0x2b3b3d&&console['error'](_0xa6009d(0x2f0)+_0x2b3b3d));const _0x31cfa3=await withSpinner(_0xa6009d(0x2d4)+_0x4f42c0+_0xa6009d(0x12a),()=>_0x403bad[_0xa6009d(0x2a0)][_0xa6009d(0x195)](_0x4f42c0,_0x2a903f,{'revision':_0x2b3b3d}),{'verbose':_0x75eb20[_0xa6009d(0x170)]}),_0x2affde=_0x31cfa3['data'];return console[_0xa6009d(0x188)](_0xa6009d(0x1ac)+_0x2affde[_0xa6009d(0x28b)]),console[_0xa6009d(0x188)]('\x20\x20Revision:\x20'+_0x2affde['revision']),console[_0xa6009d(0x188)](_0xa6009d(0x2b8)+_0x2affde[_0xa6009d(0x1db)]),console['error']('\x20\x20Location:\x20'+_0x2a903f+'/'+_0x2affde[_0xa6009d(0x28b)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x1fa737(0x24e)]=a54_0x1fa737(0x15c);['description']=a54_0x1fa737(0x139);async[a54_0x1fa737(0x179)](_0x1f1816){const _0x3e85c5=a54_0x1fa737,{options:_0x4263fa,args:_0xae389b,tdx:_0x56ed3d}=_0x1f1816;let _0x1324a7='.',_0x422da7=_0x4263fa[_0x3e85c5(0x24e)];if(_0xae389b[0x0]){const {promises:_0x3e5914}=await import('fs');try{const _0x2ea308=await _0x3e5914[_0x3e85c5(0x154)](_0xae389b[0x0]);if(_0x2ea308['isDirectory']())_0x1324a7=_0xae389b[0x0];else return console['error'](_0x3e85c5(0x1bf)+_0xae389b[0x0]+_0x3e85c5(0x2ba)),0x1;}catch{_0x422da7=_0xae389b[0x0],_0x1324a7='.';}}const _0x3e35ef=_0x4263fa[_0x3e85c5(0x269)],_0x506dc5=_0x4263fa[_0x3e85c5(0x191)];_0x4263fa[_0x3e85c5(0x170)]&&(console[_0x3e85c5(0x188)](_0x3e85c5(0x2b3)+_0x1324a7),_0x422da7&&console[_0x3e85c5(0x188)]('Project\x20name:\x20'+_0x422da7),_0x3e35ef&&console['error']('Revision:\x20'+_0x3e35ef),_0x506dc5&&console[_0x3e85c5(0x188)](_0x3e85c5(0x213)));const _0x37d9b6=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x56ed3d[_0x3e85c5(0x2a0)]['push'](_0x1324a7,{'projectName':_0x422da7,'revision':_0x3e35ef,'skipValidation':_0x506dc5}),{'verbose':_0x4263fa[_0x3e85c5(0x170)]}),_0x2e5de5=_0x37d9b6[_0x3e85c5(0x262)];return console[_0x3e85c5(0x188)](_0x3e85c5(0x2ed)+_0x2e5de5[_0x3e85c5(0x28b)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x2e5de5[_0x3e85c5(0x1ef)]),console[_0x3e85c5(0x188)](_0x3e85c5(0x2c4)+_0x2e5de5[_0x3e85c5(0x269)]),await this[_0x3e85c5(0x217)](_0x56ed3d,_0x2e5de5['projectName'],_0x4263fa[_0x3e85c5(0x177)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x1fa737(0x24e)]=a54_0x1fa737(0x222);[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x163);async[a54_0x1fa737(0x179)](_0xf9408b){const _0x185165=a54_0x1fa737,{options:_0x1feb98,args:_0x5199bb,tdx:_0x3a2eed}=_0xf9408b,_0x5455e0=_0x5199bb[0x0],_0x3b65e3=_0x5199bb[0x1];if(!_0x5455e0)return console[_0x185165(0x188)](a54_0x3b7b49[_0x185165(0x160)](_0x185165(0x2e0)),_0x185165(0x197)),console[_0x185165(0x188)](a54_0x3b7b49['dim']('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x7808ae=_0x1feb98[_0x185165(0x269)];_0x1feb98['verbose']&&(console[_0x185165(0x188)](_0x185165(0x1f1)+_0x5455e0),_0x3b65e3&&console['error'](_0x185165(0x2ee)+_0x3b65e3),_0x7808ae&&console['error'](_0x185165(0x2f0)+_0x7808ae),_0x1feb98['dryRun']&&console[_0x185165(0x188)](_0x185165(0x1e1)));const _0x1f38d0=await withSpinner(_0x185165(0x28d)+_0x5455e0+'...',()=>_0x3a2eed[_0x185165(0x2a0)][_0x185165(0x209)](_0x5455e0,{'targetDir':_0x3b65e3,'revision':_0x7808ae}),{'verbose':_0x1feb98['verbose']}),_0x157ea7=_0x1f38d0[_0x185165(0x262)];_0x157ea7[_0x185165(0x274)]?console['error'](_0x185165(0x2d1)+_0x157ea7[_0x185165(0x28b)]):console['error'](_0x185165(0x2a6)+_0x157ea7[_0x185165(0x28b)]);console[_0x185165(0x188)](_0x185165(0x2c4)+_0x157ea7[_0x185165(0x269)]),console[_0x185165(0x188)](_0x185165(0x26e)+(a54_0x2cd77d[_0x185165(0x196)](process[_0x185165(0x155)](),_0x157ea7[_0x185165(0x21f)])||'.')),console[_0x185165(0x188)]('\x20\x20Changes:\x20'+a54_0x3b7b49[_0x185165(0x24d)]('+'+_0x157ea7[_0x185165(0x2be)]['new']+_0x185165(0x134))+',\x20'+(a54_0x3b7b49[_0x185165(0x164)]('~'+_0x157ea7[_0x185165(0x2be)]['modified']+_0x185165(0x29d))+',\x20')+(a54_0x3b7b49[_0x185165(0x160)]('-'+_0x157ea7[_0x185165(0x2be)][_0x185165(0x1e9)]+'\x20deleted')+',\x20')+(''+a54_0x3b7b49[_0x185165(0x189)](_0x157ea7[_0x185165(0x2be)][_0x185165(0x22e)]+_0x185165(0x16d))));for(const _0x1f5ad0 of _0x157ea7[_0x185165(0x1cb)]){_0x1f5ad0['type']===_0x185165(0x238)&&_0x1f5ad0[_0x185165(0x297)]&&(console[_0x185165(0x188)]('\x0a'+a54_0x3b7b49[_0x185165(0x1a9)](_0x185165(0x208)+_0x1f5ad0[_0x185165(0x14b)])),console[_0x185165(0x188)](_0x1f5ad0['diff']));}if(!_0x157ea7[_0x185165(0x1c9)])return saveSessionContext({'workflow_project':_0x157ea7['projectName']},_0x1feb98['session']),console[_0x185165(0x188)](a54_0x3b7b49[_0x185165(0x24d)]('\x0a✔\x20Already\x20up\x20to\x20date')),console['error'](a54_0x3b7b49['dim'](_0x185165(0x1e7)+_0x157ea7[_0x185165(0x28b)])),0x0;if(_0x1feb98[_0x185165(0x12b)])return console['error'](a54_0x3b7b49['yellow']('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x1feb98[_0x185165(0x27f)]){if(!isInteractive())return console[_0x185165(0x188)](a54_0x3b7b49['red'](_0x185165(0x132)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x185165(0x188)](a54_0x3b7b49[_0x185165(0x189)](_0x185165(0x283))),0x1;const _0x1fc312=await confirmKey(_0x185165(0x207));if(!_0x1fc312)return console[_0x185165(0x188)](a54_0x3b7b49['yellow'](_0x185165(0x151)),_0x185165(0x21a)),0x1;}await withSpinner(_0x185165(0x2c0),()=>_0x3a2eed['workflow']['applyPullProject'](_0x157ea7,{'revision':_0x7808ae}),{'verbose':_0x1feb98[_0x185165(0x170)]}),saveSessionContext({'workflow_project':_0x157ea7[_0x185165(0x28b)]},_0x1feb98[_0x185165(0x2c2)]),console[_0x185165(0x188)](a54_0x3b7b49[_0x185165(0x24d)](_0x185165(0x1b6)));const _0x2bc9db=a54_0x2cd77d['relative'](process[_0x185165(0x155)](),_0x157ea7[_0x185165(0x21f)])||'.';return console[_0x185165(0x188)](a54_0x3b7b49[_0x185165(0x189)](_0x185165(0x156)+_0x2bc9db)),console[_0x185165(0x188)](a54_0x3b7b49['dim'](_0x185165(0x1e7)+_0x157ea7[_0x185165(0x28b)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a54_0x1fa737(0x24e)]=a54_0x1fa737(0x1c0);[a54_0x1fa737(0x1f6)]='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async[a54_0x1fa737(0x179)](_0x30b2d5){const _0x386648=a54_0x1fa737,{options:_0x37bcbb,args:_0x446b00,tdx:_0x1309d7}=_0x30b2d5,_0x292c71=this[_0x386648(0x1a1)](_0x446b00,_0x37bcbb),_0x4b9613=_0x37bcbb['revision'],_0x49c4b1=_0x37bcbb['skipValidation'];_0x37bcbb[_0x386648(0x170)]&&(_0x292c71&&console[_0x386648(0x188)](_0x386648(0x12c)+_0x292c71),_0x4b9613&&console[_0x386648(0x188)](_0x386648(0x2f0)+_0x4b9613),_0x37bcbb[_0x386648(0x12b)]&&console[_0x386648(0x188)](_0x386648(0x1e1)),_0x49c4b1&&console['error'](_0x386648(0x213)));let _0x2ac813;try{_0x2ac813=await withSpinner(_0x386648(0x1b2),()=>_0x1309d7[_0x386648(0x2a0)][_0x386648(0x2c7)]({'sourceDir':_0x292c71,'revision':_0x4b9613,'skipValidation':_0x49c4b1}),{'verbose':_0x37bcbb[_0x386648(0x170)]});}catch(_0x8e98e8){if(_0x8e98e8 instanceof Error&&_0x8e98e8[_0x386648(0x199)]['includes'](_0x386648(0x2bd)))return console[_0x386648(0x188)](a54_0x3b7b49[_0x386648(0x160)]('Error:'),_0x386648(0x2af)),_0x37bcbb[_0x386648(0x2bb)]?console[_0x386648(0x188)](a54_0x3b7b49[_0x386648(0x189)](_0x386648(0x27d)+_0x37bcbb['workflowProject']+_0x386648(0x2c9)+_0x37bcbb[_0x386648(0x2bb)]+'\x27')):console[_0x386648(0x188)](a54_0x3b7b49[_0x386648(0x189)](_0x386648(0x145))),0x1;throw _0x8e98e8;}const _0x2bb9ad=_0x2ac813[_0x386648(0x262)];console[_0x386648(0x188)](_0x386648(0x1a6)+_0x2bb9ad[_0x386648(0x28b)]),console[_0x386648(0x188)](_0x386648(0x21e)+_0x2bb9ad[_0x386648(0x19c)]),console[_0x386648(0x188)](_0x386648(0x2c4)+_0x2bb9ad[_0x386648(0x269)]),console[_0x386648(0x188)](_0x386648(0x2bf)+a54_0x3b7b49[_0x386648(0x24d)]('+'+_0x2bb9ad['summary'][_0x386648(0x245)]+_0x386648(0x134))+',\x20'+(a54_0x3b7b49[_0x386648(0x164)]('~'+_0x2bb9ad['summary'][_0x386648(0x238)]+_0x386648(0x29d))+',\x20')+(a54_0x3b7b49[_0x386648(0x160)]('-'+_0x2bb9ad[_0x386648(0x2be)]['deleted']+'\x20deleted')+',\x20')+(''+a54_0x3b7b49[_0x386648(0x189)](_0x2bb9ad[_0x386648(0x2be)][_0x386648(0x22e)]+_0x386648(0x16d))));for(const _0x42d51c of _0x2bb9ad[_0x386648(0x1cb)]){_0x42d51c[_0x386648(0x182)]==='modified'&&_0x42d51c[_0x386648(0x297)]&&(console['error']('\x0a'+a54_0x3b7b49[_0x386648(0x1a9)](_0x386648(0x208)+_0x42d51c[_0x386648(0x14b)])),console[_0x386648(0x188)](_0x42d51c['diff']));}if(!_0x2bb9ad[_0x386648(0x1c9)])return console[_0x386648(0x188)](a54_0x3b7b49[_0x386648(0x24d)](_0x386648(0x14a))),await this[_0x386648(0x217)](_0x1309d7,_0x2bb9ad[_0x386648(0x28b)],_0x37bcbb[_0x386648(0x177)]),0x0;if(_0x37bcbb['dryRun'])return console[_0x386648(0x188)](a54_0x3b7b49[_0x386648(0x164)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x37bcbb[_0x386648(0x27f)]){if(!isInteractive())return console['error'](a54_0x3b7b49[_0x386648(0x160)](_0x386648(0x132)),_0x386648(0x223)),console[_0x386648(0x188)](a54_0x3b7b49['dim'](_0x386648(0x283))),0x1;const _0x1df4dc=await confirmKey(_0x386648(0x168));if(!_0x1df4dc)return console[_0x386648(0x188)](a54_0x3b7b49[_0x386648(0x164)](_0x386648(0x151)),_0x386648(0x1b9)),0x1;}const _0x25d227=await withSpinner(_0x386648(0x235),()=>_0x1309d7[_0x386648(0x2a0)][_0x386648(0x2c8)](_0x2bb9ad),{'verbose':_0x37bcbb[_0x386648(0x170)]}),_0x3cc4d4=_0x25d227['data'];return console['error'](a54_0x3b7b49[_0x386648(0x24d)]('✔\x20Push\x20complete')),console['error'](_0x386648(0x234)+_0x3cc4d4[_0x386648(0x1ef)]),console['error'](_0x386648(0x2c4)+_0x3cc4d4[_0x386648(0x269)]),await this['showWorkflowConsoleUrl'](_0x1309d7,_0x3cc4d4[_0x386648(0x28b)],_0x37bcbb[_0x386648(0x177)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0x1fa737(0x24e)]='workflow:clone';[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x24c);async[a54_0x1fa737(0x179)](_0x3f18cb){const _0x3a8f7f=a54_0x1fa737,{options:_0x10fc70,args:_0x5996a5,tdx:_0x128d85}=_0x3f18cb,_0xca2655=this[_0x3a8f7f(0x1a1)](_0x5996a5,_0x10fc70),_0x1baa9f=_0x10fc70[_0x3a8f7f(0x24e)],_0x19a42d=_0x10fc70[_0x3a8f7f(0x269)],_0x5d0b5b=_0x10fc70[_0x3a8f7f(0x191)];if(!_0xca2655)return console['error'](a54_0x3b7b49[_0x3a8f7f(0x160)](_0x3a8f7f(0x2e0)),'Source\x20directory\x20is\x20required'),console[_0x3a8f7f(0x188)](a54_0x3b7b49[_0x3a8f7f(0x189)](_0x3a8f7f(0x221))),console[_0x3a8f7f(0x188)](a54_0x3b7b49[_0x3a8f7f(0x189)](_0x3a8f7f(0x184))),0x1;if(!_0x1baa9f)return console['error'](a54_0x3b7b49['red'](_0x3a8f7f(0x2e0)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x3a8f7f(0x188)](a54_0x3b7b49[_0x3a8f7f(0x189)](_0x3a8f7f(0x221))),0x1;_0x10fc70[_0x3a8f7f(0x170)]&&(console[_0x3a8f7f(0x188)](_0x3a8f7f(0x12c)+_0xca2655),console[_0x3a8f7f(0x188)](_0x3a8f7f(0x233)+_0x1baa9f),_0x19a42d&&console[_0x3a8f7f(0x188)](_0x3a8f7f(0x2f0)+_0x19a42d),_0x10fc70[_0x3a8f7f(0x12b)]&&console['error'](_0x3a8f7f(0x1e1)),_0x5d0b5b&&console[_0x3a8f7f(0x188)](_0x3a8f7f(0x213)));const _0x287fc6=await withSpinner(_0x3a8f7f(0x273),()=>_0x128d85[_0x3a8f7f(0x2a0)][_0x3a8f7f(0x1aa)](_0xca2655,_0x1baa9f,{'revision':_0x19a42d,'skipValidation':_0x5d0b5b}),{'verbose':_0x10fc70[_0x3a8f7f(0x170)]}),_0x4567be=_0x287fc6[_0x3a8f7f(0x262)];console[_0x3a8f7f(0x188)](_0x3a8f7f(0x1e4)+_0x4567be[_0x3a8f7f(0x19c)]);_0x4567be[_0x3a8f7f(0x183)]&&console[_0x3a8f7f(0x188)]('Source\x20project:\x20'+_0x4567be[_0x3a8f7f(0x183)]);console['error'](_0x3a8f7f(0x233)+_0x4567be[_0x3a8f7f(0x165)]),console[_0x3a8f7f(0x188)](_0x3a8f7f(0x2f0)+_0x4567be[_0x3a8f7f(0x269)]),console[_0x3a8f7f(0x188)](_0x3a8f7f(0x2d5)+_0x4567be[_0x3a8f7f(0x1d0)]);_0x4567be['targetExists']&&(console[_0x3a8f7f(0x188)](a54_0x3b7b49[_0x3a8f7f(0x164)]('\x0a⚠\x20Project\x20\x22'+_0x4567be[_0x3a8f7f(0x165)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x4567be[_0x3a8f7f(0x2e4)]+')')),console['error'](a54_0x3b7b49[_0x3a8f7f(0x164)](_0x3a8f7f(0x1a5))));if(_0x10fc70[_0x3a8f7f(0x12b)])return console[_0x3a8f7f(0x188)](a54_0x3b7b49[_0x3a8f7f(0x164)]('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x10fc70[_0x3a8f7f(0x27f)]){if(!isInteractive())return console['error'](a54_0x3b7b49['red'](_0x3a8f7f(0x132)),_0x3a8f7f(0x223)),console[_0x3a8f7f(0x188)](a54_0x3b7b49[_0x3a8f7f(0x189)](_0x3a8f7f(0x283))),0x1;const _0x3d3ff2=_0x4567be[_0x3a8f7f(0x183)]||a54_0x2cd77d[_0x3a8f7f(0x1ee)](_0xca2655),_0x555fc7=_0x4567be['targetExists']?_0x3a8f7f(0x2e8)+_0x1baa9f+_0x3a8f7f(0x293):_0x3a8f7f(0x131)+_0x3d3ff2+_0x3a8f7f(0x166)+_0x1baa9f+'\x22?',_0x291daa=await confirmKey(_0x555fc7);if(!_0x291daa)return console['error'](a54_0x3b7b49[_0x3a8f7f(0x164)](_0x3a8f7f(0x151))),0x1;}const _0x2419b9=await withSpinner(_0x4567be[_0x3a8f7f(0x2e1)]?_0x3a8f7f(0x1ce)+_0x1baa9f+_0x3a8f7f(0x12a):_0x3a8f7f(0x256)+_0x1baa9f+_0x3a8f7f(0x12a),()=>_0x128d85[_0x3a8f7f(0x2a0)]['executeCloneProject'](_0x4567be),{'verbose':_0x10fc70[_0x3a8f7f(0x170)]}),_0x100c37=_0x2419b9['data'];return console[_0x3a8f7f(0x188)](a54_0x3b7b49[_0x3a8f7f(0x24d)](_0x4567be[_0x3a8f7f(0x2e1)]?_0x3a8f7f(0x2a4):_0x3a8f7f(0x21b))),console[_0x3a8f7f(0x188)](_0x3a8f7f(0x1fa)+_0x100c37[_0x3a8f7f(0x165)]),console[_0x3a8f7f(0x188)](_0x3a8f7f(0x234)+_0x100c37[_0x3a8f7f(0x178)]),console[_0x3a8f7f(0x188)](_0x3a8f7f(0x2c4)+_0x100c37[_0x3a8f7f(0x269)]),await this[_0x3a8f7f(0x217)](_0x128d85,_0x100c37[_0x3a8f7f(0x165)],_0x10fc70['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x1fa737(0x24e)]=a54_0x1fa737(0x136);[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x1b8);async['execute'](_0x1c4244){const _0x17c3ef=a54_0x1fa737,{options:_0x52f93d,args:_0x8ba991,tdx:_0x1295a5}=_0x1c4244,_0x4d7de8=_0x8ba991[0x0];if(!_0x4d7de8)return console[_0x17c3ef(0x188)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x17c3ef(0x17f)),0x1;_0x52f93d[_0x17c3ef(0x170)]&&console[_0x17c3ef(0x188)]('Project:\x20'+_0x4d7de8);if(!_0x52f93d[_0x17c3ef(0x27f)]){if(!isInteractive())return console['error'](a54_0x3b7b49['red'](_0x17c3ef(0x132)),_0x17c3ef(0x223)),console[_0x17c3ef(0x188)](a54_0x3b7b49[_0x17c3ef(0x189)](_0x17c3ef(0x283))),0x1;const _0x41c8bb=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x4d7de8+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x41c8bb)return console[_0x17c3ef(0x188)](a54_0x3b7b49['yellow'](_0x17c3ef(0x151))),0x1;}const _0x573cd4=await withSpinner(_0x17c3ef(0x2d0)+_0x4d7de8+_0x17c3ef(0x12a),()=>_0x1295a5[_0x17c3ef(0x2a0)][_0x17c3ef(0x1ea)](_0x4d7de8),{'verbose':_0x52f93d[_0x17c3ef(0x170)]}),_0x16ddf2=_0x573cd4['data'];return console[_0x17c3ef(0x188)]('✔\x20Deleted\x20project\x20'+_0x16ddf2[_0x17c3ef(0x28b)]),console[_0x17c3ef(0x188)](_0x17c3ef(0x234)+_0x16ddf2[_0x17c3ef(0x1ef)]),0x0;}}export function parseKeyValue(_0x916885){const _0x18160f=a54_0x1fa737,_0x2e91d1=_0x916885['indexOf']('=');if(_0x2e91d1===-0x1)throw new Error(_0x18160f(0x253)+_0x916885+_0x18160f(0x25e));const _0x36284e=_0x916885[_0x18160f(0x1ab)](0x0,_0x2e91d1),_0x53333b=_0x916885[_0x18160f(0x1ab)](_0x2e91d1+0x1);if(!_0x36284e)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x36284e,'value':_0x53333b};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x1fa737(0x24e)]=a54_0x1fa737(0x1a2);['description']=a54_0x1fa737(0x280);async[a54_0x1fa737(0x179)](_0x856b9f){const _0x4ee046=a54_0x1fa737,{options:_0x6fd84b,args:_0x5d0931,tdx:_0x217b1f}=_0x856b9f,_0x1ed6fb=this[_0x4ee046(0x1cd)](_0x5d0931,_0x6fd84b);if(!_0x1ed6fb)return 0x1;_0x6fd84b['verbose']&&console['error'](_0x4ee046(0x1f1)+_0x1ed6fb);const _0x9d8b6d=await withSpinner(_0x4ee046(0x1c7),()=>_0x217b1f[_0x4ee046(0x2a0)][_0x4ee046(0x25f)](_0x1ed6fb),{'verbose':_0x6fd84b[_0x4ee046(0x170)]}),{secrets:_0x5bd196}=_0x9d8b6d[_0x4ee046(0x262)];return console[_0x4ee046(0x188)](_0x4ee046(0x2d7)+_0x5bd196[_0x4ee046(0x240)]+'\x20secret'+(_0x5bd196['length']!==0x1?'s':'')),await handleSDKOutput(_0x5bd196,_0x6fd84b),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x1fa737(0x24e)]=a54_0x1fa737(0x218);[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x279);async[a54_0x1fa737(0x179)](_0x350d0e){const _0x3f4b39=a54_0x1fa737,{options:_0x24a1b5,args:_0xfe7f3e,tdx:_0x8295e5}=_0x350d0e;let _0x41a4f,_0x4bd227;if(_0xfe7f3e['length']>=0x1&&!_0xfe7f3e[0x0][_0x3f4b39(0x1f9)]('='))_0x41a4f=_0xfe7f3e[0x0],_0x4bd227=_0xfe7f3e[_0x3f4b39(0x26b)](0x1);else{if(_0xfe7f3e['length']>=0x1&&_0x24a1b5[_0x3f4b39(0x2bb)])_0x41a4f=_0x24a1b5[_0x3f4b39(0x2bb)],_0x4bd227=_0xfe7f3e;else return _0xfe7f3e[_0x3f4b39(0x240)]>=0x1?(console[_0x3f4b39(0x188)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x3f4b39(0x188)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x3f4b39(0x188)](_0x3f4b39(0x181)),console[_0x3f4b39(0x188)](_0x3f4b39(0x25d)),0x1);}if(_0x4bd227[_0x3f4b39(0x240)]===0x0)return console[_0x3f4b39(0x188)](_0x3f4b39(0x181)),console['error'](_0x3f4b39(0x25d)),0x1;const _0x4ba5cb={};try{for(const _0x3b482c of _0x4bd227){const {key:_0x4ac0b3,value:_0x1d1aed}=parseKeyValue(_0x3b482c);_0x4ba5cb[_0x4ac0b3]=_0x1d1aed;}}catch(_0x44b1ae){return _0x44b1ae instanceof Error&&console[_0x3f4b39(0x188)](a54_0x3b7b49['red'](_0x3f4b39(0x2e0)),_0x44b1ae['message']),0x1;}const _0x543813=Object['keys'](_0x4ba5cb);_0x24a1b5[_0x3f4b39(0x170)]&&(console['error'](_0x3f4b39(0x1f1)+_0x41a4f),console[_0x3f4b39(0x188)](_0x3f4b39(0x289)+_0x543813['join'](',\x20')));const _0xb887aa=await withSpinner(_0x543813[_0x3f4b39(0x240)]===0x1?'Setting\x20secret...':'Setting\x20'+_0x543813['length']+_0x3f4b39(0x18e),()=>_0x8295e5['workflow'][_0x3f4b39(0x162)](_0x41a4f,_0x4ba5cb),{'verbose':_0x24a1b5[_0x3f4b39(0x170)]}),_0xd0d116=_0xb887aa[_0x3f4b39(0x262)];return console[_0x3f4b39(0x188)](_0x543813[_0x3f4b39(0x240)]===0x1?'✔\x20Secret\x20\x27'+_0xd0d116[_0x3f4b39(0x169)][0x0]+_0x3f4b39(0x202)+_0xd0d116[_0x3f4b39(0x28b)]+'\x27':'✔\x20'+_0xd0d116[_0x3f4b39(0x169)]['length']+_0x3f4b39(0x19e)+_0xd0d116[_0x3f4b39(0x28b)]+'\x27'),(_0x24a1b5[_0x3f4b39(0x16c)]||_0x24a1b5[_0x3f4b39(0x1a4)])&&await handleSingleObjectOutput(_0xd0d116,_0x24a1b5),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0x1fa737(0x24e)]='workflow:secrets:delete';[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x15b);async[a54_0x1fa737(0x179)](_0x4a8689){const _0x240d0d=a54_0x1fa737,{options:_0x369ebb,args:_0x4b08f5,tdx:_0x37e909}=_0x4a8689;let _0x397dd1,_0x1cfd33;if(_0x4b08f5[_0x240d0d(0x240)]>=0x2)_0x397dd1=_0x4b08f5[0x0],_0x1cfd33=_0x4b08f5[0x1];else{if(_0x4b08f5[_0x240d0d(0x240)]===0x1&&_0x369ebb[_0x240d0d(0x2bb)])_0x397dd1=_0x369ebb[_0x240d0d(0x2bb)],_0x1cfd33=_0x4b08f5[0x0];else return _0x4b08f5[_0x240d0d(0x240)]===0x1?(console['error'](_0x240d0d(0x2f2)),console['error']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x240d0d(0x188)](_0x240d0d(0x1e5)),console[_0x240d0d(0x188)](_0x240d0d(0x26f)),0x1);}_0x369ebb[_0x240d0d(0x170)]&&(console[_0x240d0d(0x188)](_0x240d0d(0x1f1)+_0x397dd1),console['error'](_0x240d0d(0x1ad)+_0x1cfd33));if(!_0x369ebb['yes']){if(!isInteractive())return console['error'](a54_0x3b7b49[_0x240d0d(0x160)](_0x240d0d(0x132)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x240d0d(0x188)](a54_0x3b7b49[_0x240d0d(0x189)](_0x240d0d(0x283))),0x1;const _0x58f37e=await confirmKey(_0x240d0d(0x2f4)+_0x1cfd33+_0x240d0d(0x276)+_0x397dd1+'\x27?');if(!_0x58f37e)return console[_0x240d0d(0x188)](a54_0x3b7b49['yellow'](_0x240d0d(0x151))),0x1;}const _0x5bb7ff=await withSpinner(_0x240d0d(0x2f1),()=>_0x37e909[_0x240d0d(0x2a0)][_0x240d0d(0x272)](_0x397dd1,_0x1cfd33),{'verbose':_0x369ebb[_0x240d0d(0x170)]}),_0x8f508b=_0x5bb7ff[_0x240d0d(0x262)];return console[_0x240d0d(0x188)](_0x240d0d(0x263)+_0x8f508b[_0x240d0d(0x1e0)]+_0x240d0d(0x157)+_0x8f508b[_0x240d0d(0x28b)]+'\x27'),(_0x369ebb[_0x240d0d(0x16c)]||_0x369ebb[_0x240d0d(0x1a4)])&&await handleSingleObjectOutput(_0x8f508b,_0x369ebb),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(_0x1dbbc7){const _0x1aab00=a54_0x1fa737,_0x816b48=Math[_0x1aab00(0x215)](_0x1dbbc7/0x3e8),_0x2e81d0=Math[_0x1aab00(0x215)](_0x816b48/0x3c),_0xce6316=Math[_0x1aab00(0x215)](_0x2e81d0/0x3c),_0x2ed597=Math[_0x1aab00(0x215)](_0xce6316/0x18);if(_0x2ed597>0x0){const _0xfb401b=_0xce6316%0x18;return _0xfb401b>0x0?_0x2ed597+'d\x20'+_0xfb401b+'h':_0x2ed597+'d';}else{if(_0xce6316>0x0){const _0x30c5c5=_0x2e81d0%0x3c;return _0x30c5c5>0x0?_0xce6316+'h\x20'+_0x30c5c5+'m':_0xce6316+'h';}else{if(_0x2e81d0>0x0){const _0x314b39=_0x816b48%0x3c;return _0x314b39>0x0?_0x2e81d0+'m\x20'+_0x314b39+'s':_0x2e81d0+'m';}else return _0x816b48+'s';}}}function formatTimestamp(_0x1c7030,_0xb1042f){const _0x5b24f8=a54_0x1fa737,_0x55203f=new Date(_0x1c7030),_0x12ac5d=String(_0x55203f[_0x5b24f8(0x2ae)]())['padStart'](0x2,'0'),_0x545df0=String(_0x55203f[_0x5b24f8(0x2b7)]())[_0x5b24f8(0x22a)](0x2,'0'),_0x349d54=_0x12ac5d+':'+_0x545df0,_0x2dc689=_0x55203f['getFullYear']()===_0xb1042f[_0x5b24f8(0x16e)]()&&_0x55203f[_0x5b24f8(0x28f)]()===_0xb1042f[_0x5b24f8(0x28f)]()&&_0x55203f['getDate']()===_0xb1042f['getDate']();if(_0x2dc689)return _0x349d54;else{const _0x200410=String(_0x55203f['getMonth']()+0x1)[_0x5b24f8(0x22a)](0x2,'0'),_0x3cd426=String(_0x55203f[_0x5b24f8(0x2db)]())[_0x5b24f8(0x22a)](0x2,'0');return _0x200410+'-'+_0x3cd426+'\x20'+_0x349d54;}}function formatDate(_0x34570e){const _0x304208=a54_0x1fa737,_0x54ea93=_0x34570e[_0x304208(0x16e)](),_0x475a57=String(_0x34570e[_0x304208(0x28f)]()+0x1)[_0x304208(0x22a)](0x2,'0'),_0x3933a5=String(_0x34570e['getDate']())[_0x304208(0x22a)](0x2,'0');return _0x54ea93+'-'+_0x475a57+'-'+_0x3933a5;}function getTaskStateIcon(_0xf18b4c){const _0x44b7da={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x44b7da[_0xf18b4c]||'⚪';}function getBarChar(_0x1127e5){const _0x475271=a54_0x1fa737;return _0x1127e5===_0x475271(0x188)||_0x1127e5==='group_error'?'×':'─';}function getBarColor(_0x223fb4){const _0x598595=a54_0x1fa737,_0x97bc3={'success':a54_0x3b7b49[_0x598595(0x24d)],'error':a54_0x3b7b49[_0x598595(0x160)],'group_error':a54_0x3b7b49[_0x598595(0x160)],'running':a54_0x3b7b49[_0x598595(0x2a2)],'blocked':a54_0x3b7b49['yellow'],'planned':a54_0x3b7b49[_0x598595(0x189)],'canceling':a54_0x3b7b49[_0x598595(0x164)]};return _0x97bc3[_0x223fb4]||a54_0x3b7b49[_0x598595(0x26c)];}function parseTaskName(_0x1dce6a){const _0x3d2a97=a54_0x1fa737;let _0x18c27a=_0x1dce6a[_0x3d2a97(0x13a)](/^\++/,'');const _0x12f40f=_0x18c27a[_0x3d2a97(0x2aa)]('+'),_0x94026a=_0x12f40f[_0x3d2a97(0x240)]>0x1?_0x12f40f[_0x3d2a97(0x240)]-0x2:0x0,_0x3f863e=_0x12f40f[_0x12f40f[_0x3d2a97(0x240)]-0x1]||_0x18c27a;return{'level':_0x94026a,'name':'+'+_0x3f863e};}function truncateTaskName(_0x50393e,_0x12bd08){const _0x9e56e9=a54_0x1fa737,_0xe56769=stringWidth(_0x50393e);if(_0xe56769<=_0x12bd08)return _0x50393e;let _0xa03ba1=_0x50393e;while(stringWidth(_0xa03ba1+'…')>_0x12bd08&&_0xa03ba1[_0x9e56e9(0x240)]>0x0){_0xa03ba1=_0xa03ba1[_0x9e56e9(0x26b)](0x0,-0x1);}return _0xa03ba1+'…';}function calculateTimeScale(_0x554478,_0x40aa83){const _0x341cfa=a54_0x1fa737;return{'startTime':_0x554478['start'],'endTime':_0x554478[_0x341cfa(0x12f)],'durationMs':_0x554478[_0x341cfa(0x23e)],'msPerChar':_0x554478['duration']/_0x40aa83};}function timeToPosition(_0x3b51d2,_0x2f9ea9,_0x5bef03){const _0x3b4941=a54_0x1fa737,_0x288f62=_0x3b51d2-_0x2f9ea9[_0x3b4941(0x1d2)],_0x559511=Math['floor'](_0x288f62/_0x2f9ea9['msPerChar']);return Math['max'](0x0,Math[_0x3b4941(0x1b5)](_0x559511,_0x5bef03));}function renderTimeAxis(_0xc0f44c,_0x1919b1){const _0x492224=a54_0x1fa737,_0x24fe99=Math[_0x492224(0x1b5)](TIMELINE_CONFIG[_0x492224(0x17a)],Math[_0x492224(0x255)](TIMELINE_CONFIG[_0x492224(0x1af)],Math[_0x492224(0x215)](_0x1919b1/TIMELINE_CONFIG[_0x492224(0x2b0)]))),_0x20ac21=_0xc0f44c[_0x492224(0x180)]/(_0x24fe99-0x1),_0x846aa6=new Date(_0xc0f44c[_0x492224(0x1d2)]),_0x599815=[];for(let _0x2669b8=0x0;_0x2669b8<_0x24fe99;_0x2669b8++){const _0x4f9c14=_0xc0f44c[_0x492224(0x1d2)]+_0x2669b8*_0x20ac21,_0x588f7e=timeToPosition(_0x4f9c14,_0xc0f44c,_0x1919b1),_0x38f2b8=formatTimestamp(_0x4f9c14,_0x846aa6);_0x599815['push']({'pos':_0x588f7e,'text':_0x38f2b8});}const _0x92ccfa=new Array(_0x1919b1)[_0x492224(0x2dc)]('\x20');let _0x215328=-0x1;for(const {pos:_0x276a46,text:_0x1fb756}of _0x599815){let _0x716e8b=Math[_0x492224(0x255)](0x0,_0x276a46-Math[_0x492224(0x215)](_0x1fb756[_0x492224(0x240)]/0x2));_0x716e8b<=_0x215328+TIMELINE_CONFIG[_0x492224(0x2de)]&&(_0x716e8b=_0x215328+TIMELINE_CONFIG[_0x492224(0x2de)]+0x1);_0x716e8b+_0x1fb756[_0x492224(0x240)]>_0x1919b1&&(_0x716e8b=_0x1919b1-_0x1fb756[_0x492224(0x240)]);if(_0x716e8b>=0x0&&_0x716e8b+_0x1fb756['length']<=_0x1919b1&&_0x716e8b>_0x215328){for(let _0x49f007=0x0;_0x49f007<_0x1fb756[_0x492224(0x240)];_0x49f007++){_0x92ccfa[_0x716e8b+_0x49f007]=_0x1fb756[_0x49f007];}_0x215328=_0x716e8b+_0x1fb756[_0x492224(0x240)]-0x1;}}return _0x92ccfa['join']('');}function renderTaskRow(_0x2d45f0,_0x27b425,_0x4dcc83,_0x5bbe12){const _0x445a2a=a54_0x1fa737,{level:_0x5e256f,name:_0x4fdb11}=parseTaskName(_0x2d45f0[_0x445a2a(0x24e)]),_0x147f6a='\x20'[_0x445a2a(0x2ce)](_0x5e256f),_0x193afc=_0x2d45f0[_0x445a2a(0x22d)]?'('+formatElapsed(_0x2d45f0[_0x445a2a(0x22d)][_0x445a2a(0x23e)])+')':'',_0x19e10a=stringWidth(_0x193afc),_0x2b800f=_0x5e256f*0x1,_0x55a04e=_0x5bbe12-_0x2b800f-_0x19e10a-0x1,_0x45ffa5=truncateTaskName(_0x4fdb11,_0x55a04e),_0x2ed331=_0x147f6a+_0x45ffa5,_0x15e3c7=stringWidth(_0x2ed331),_0x32b902=_0x5bbe12-_0x15e3c7-_0x19e10a,_0x1af525=_0x2ed331+'\x20'[_0x445a2a(0x2ce)](Math[_0x445a2a(0x255)](0x1,_0x32b902))+a54_0x3b7b49['dim'](_0x193afc),_0x35df21=getTaskStateIcon(_0x2d45f0[_0x445a2a(0x133)]),_0x1655c0=new Array(_0x4dcc83)[_0x445a2a(0x2dc)]('\x20');if(_0x2d45f0[_0x445a2a(0x22d)]){const _0x350556=timeToPosition(_0x2d45f0['window'][_0x445a2a(0x292)],_0x27b425,_0x4dcc83),_0x3b5f22=timeToPosition(_0x2d45f0[_0x445a2a(0x22d)][_0x445a2a(0x12f)],_0x27b425,_0x4dcc83),_0x4cc656=getBarChar(_0x2d45f0[_0x445a2a(0x133)]),_0x391176=Math[_0x445a2a(0x255)](_0x350556+0x1,_0x3b5f22);for(let _0x25e946=_0x350556;_0x25e946<Math[_0x445a2a(0x1b5)](_0x391176,_0x4dcc83);_0x25e946++){_0x1655c0[_0x25e946]=_0x4cc656;}}const _0x1add9c=getBarColor(_0x2d45f0['state']),_0x1e8eb7=_0x1655c0[_0x445a2a(0x285)](_0x35783e=>_0x35783e==='\x20'?'\x20':_0x1add9c(_0x35783e))[_0x445a2a(0x257)]('');return _0x35df21+'\x20'+_0x1af525+'│'+_0x1e8eb7+'│';}function calculateStats(_0x3fd6bb){const _0x50129a=a54_0x1fa737,_0xe27de8={'total':_0x3fd6bb[_0x50129a(0x240)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x35bcee of _0x3fd6bb){if(_0x35bcee[_0x50129a(0x133)]===_0x50129a(0x16a))_0xe27de8['success']++;else{if(_0x35bcee[_0x50129a(0x133)]==='error'||_0x35bcee[_0x50129a(0x133)]===_0x50129a(0x19a))_0xe27de8[_0x50129a(0x188)]++;else _0x35bcee[_0x50129a(0x133)]==='running'?_0xe27de8[_0x50129a(0x2e5)]++:_0xe27de8[_0x50129a(0x172)]++;}}return _0xe27de8;}function formatStats(_0x4e3b93){const _0x4a9d6f=a54_0x1fa737;return[_0x4a9d6f(0x205)+_0x4e3b93[_0x4a9d6f(0x231)],'✅\x20'+_0x4e3b93[_0x4a9d6f(0x16a)],'❌\x20'+_0x4e3b93[_0x4a9d6f(0x188)],'🔄\x20'+_0x4e3b93[_0x4a9d6f(0x2e5)],'⏳\x20'+_0x4e3b93[_0x4a9d6f(0x172)]][_0x4a9d6f(0x257)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a54_0x1fa737(0x1b3);[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x1ca);async[a54_0x1fa737(0x179)](_0x2ae232){const _0x116f5e=a54_0x1fa737,{options:_0x4479f6,args:_0x21beb3,tdx:_0x4bef6c}=_0x2ae232;let _0x628c0,_0x33ab3e,_0xae45ac=![];if(_0x21beb3[0x0]){if(_0x21beb3[0x0][_0x116f5e(0x1f9)]('.')){const _0x514eb6=this[_0x116f5e(0x227)](_0x21beb3,_0x4479f6);if(!_0x514eb6)return 0x1;_0x628c0=_0x514eb6[_0x116f5e(0x28b)],_0x33ab3e=_0x514eb6[_0x116f5e(0x185)];}else{_0x33ab3e=_0x21beb3[0x0],_0x628c0=_0x4479f6[_0x116f5e(0x2bb)];if(!_0x628c0)return console['error'](a54_0x3b7b49[_0x116f5e(0x160)]('Error:'),_0x116f5e(0x254)),0x1;_0xae45ac=!![];}}else{const _0x3339f8=this[_0x116f5e(0x227)](_0x21beb3,_0x4479f6);if(!_0x3339f8)return 0x1;_0x628c0=_0x3339f8['projectName'],_0x33ab3e=_0x3339f8['workflowName'];}if(_0x4479f6[_0x116f5e(0x170)]){if(_0x628c0&&_0x33ab3e)console[_0x116f5e(0x188)](_0x116f5e(0x18a)+_0x628c0+'.'+_0x33ab3e);else _0x628c0&&console[_0x116f5e(0x188)]('Filter:\x20project='+_0x628c0);}const _0xc53c8e=_0x4479f6['attemptId'],_0x329144=_0x4479f6[_0x116f5e(0x1c8)];if(_0xc53c8e){_0x329144&&console['error'](a54_0x3b7b49[_0x116f5e(0x164)](_0x116f5e(0x1df)),_0x116f5e(0x287));const _0x4457ea=_0x4479f6[_0x116f5e(0x250)];return _0x4457ea?await this[_0x116f5e(0x23b)](_0x2ae232,_0xc53c8e):await this[_0x116f5e(0x29f)](_0x2ae232,_0xc53c8e,_0x4479f6),0x0;}if(_0x329144){const _0x29a6af=await withSpinner(_0x116f5e(0x2da),()=>_0x4bef6c[_0x116f5e(0x2a0)][_0x116f5e(0x29b)]({'projectName':_0x628c0,'workflowName':_0x33ab3e,'limit':0x64}),{'verbose':_0x4479f6[_0x116f5e(0x170)]}),_0x27996f=_0x29a6af[_0x116f5e(0x262)][_0x116f5e(0x1c2)](_0x51543b=>_0x51543b['id']===_0x329144);if(!_0x27996f)return console[_0x116f5e(0x188)](a54_0x3b7b49[_0x116f5e(0x160)](_0x116f5e(0x2e0)),'Session\x20not\x20found:\x20'+_0x329144),0x1;if(!_0x27996f['lastAttempt']?.['id'])return console[_0x116f5e(0x188)](a54_0x3b7b49['red']('Error:'),_0x116f5e(0x228)+_0x329144+'\x20has\x20no\x20attempts'),0x1;const _0x23bcc7=_0x27996f[_0x116f5e(0x1fc)]['id'];_0x4479f6[_0x116f5e(0x170)]&&console[_0x116f5e(0x188)](_0x116f5e(0x244)+_0x23bcc7+_0x116f5e(0x203)+_0x329144);const _0x5b5d11=_0x4479f6['follow'];return _0x5b5d11?await this[_0x116f5e(0x23b)](_0x2ae232,_0x23bcc7):await this[_0x116f5e(0x29f)](_0x2ae232,_0x23bcc7,_0x4479f6),0x0;}const _0x3952f9=await withSpinner(_0x116f5e(0x1d3),()=>_0x4bef6c[_0x116f5e(0x2a0)][_0x116f5e(0x29b)]({'projectName':_0x628c0,'workflowName':_0x33ab3e,'limit':_0x4479f6['limit']||0x32}),{'verbose':_0x4479f6[_0x116f5e(0x170)]}),_0x470e10=_0x3952f9[_0x116f5e(0x262)];if(_0x470e10[_0x116f5e(0x240)]===0x0){if(_0x628c0&&_0x33ab3e)console[_0x116f5e(0x188)]('No\x20sessions\x20found\x20for:\x20'+_0x628c0+'.'+_0x33ab3e);else _0x628c0?console[_0x116f5e(0x188)](_0x116f5e(0x2dd)+_0x628c0):(console['error'](_0x116f5e(0x210)),console[_0x116f5e(0x188)](a54_0x3b7b49[_0x116f5e(0x189)](_0x116f5e(0x25b))));return 0x0;}_0x470e10[_0x116f5e(0x239)]((_0x31c876,_0xd46c37)=>{const _0x146a3a=_0x116f5e,_0xe62c47=_0x31c876[_0x146a3a(0x198)]||'',_0x395d57=_0xd46c37[_0x146a3a(0x198)]||'';return _0x395d57[_0x146a3a(0x18f)](_0xe62c47);});if(_0x4479f6[_0x116f5e(0x16c)]||_0x4479f6[_0x116f5e(0x1a4)])return await handleSDKOutput(_0x470e10,_0x4479f6),0x0;let _0x275177;if(_0xae45ac){const _0x503248=_0x470e10[0x0];if(!_0x503248['lastAttempt']?.['id'])return console[_0x116f5e(0x188)](_0x116f5e(0x1dc)),0x0;_0x275177=_0x503248[_0x116f5e(0x1fc)]['id'],_0x4479f6[_0x116f5e(0x170)]&&console[_0x116f5e(0x188)]('Auto-selected\x20latest\x20session:\x20'+_0x503248[_0x116f5e(0x198)]);}else{const _0x2a93ae=_0x470e10[_0x116f5e(0x285)](_0x2edf4=>{const _0x4c3f76=_0x116f5e,_0x39651e=getAttemptStatusDisplay(_0x2edf4[_0x4c3f76(0x1fc)]);return{'title':_0x2edf4[_0x4c3f76(0x15f)]?.[_0x4c3f76(0x24e)]+'.'+_0x2edf4[_0x4c3f76(0x2a0)]?.[_0x4c3f76(0x24e)]+_0x4c3f76(0x28e)+_0x2edf4[_0x4c3f76(0x198)]+'\x20'+_0x39651e['icon'],'value':_0x2edf4[_0x4c3f76(0x1fc)]?.['id']||'','description':_0x39651e[_0x4c3f76(0x15e)]};}),_0x25d2aa=await a54_0x49b152({'type':'select','name':_0x116f5e(0x243),'message':_0x116f5e(0x1de),'choices':_0x2a93ae[_0x116f5e(0x2d9)](_0x579365=>_0x579365[_0x116f5e(0x18c)]!=='')});if(!_0x25d2aa[_0x116f5e(0x243)])return 0x0;_0x275177=_0x25d2aa[_0x116f5e(0x243)];}const _0x187bd4=_0x4479f6['follow'];return _0x187bd4?await this[_0x116f5e(0x23b)](_0x2ae232,_0x275177):await this['renderSingleTimeline'](_0x2ae232,_0x275177,_0x4479f6),0x0;}async['renderSingleTimeline'](_0x17b8ff,_0x35375d,_0x5e0bae){const _0x3988cf=a54_0x1fa737,{tdx:_0x32aefa}=_0x17b8ff;let _0x1e0b83,_0x214087;try{[_0x1e0b83,_0x214087]=await Promise['all']([_0x32aefa['workflow']['attempt'](_0x35375d),_0x32aefa[_0x3988cf(0x2a0)][_0x3988cf(0x158)](_0x35375d,![])]);}catch(_0x284ec4){console[_0x3988cf(0x188)](a54_0x3b7b49[_0x3988cf(0x160)](_0x3988cf(0x275)));_0x5e0bae[_0x3988cf(0x170)]&&console['error'](_0x284ec4);throw _0x284ec4;}if(_0x5e0bae[_0x3988cf(0x16c)]||_0x5e0bae[_0x3988cf(0x1a4)]){const _0xc2fb62=this[_0x3988cf(0x214)](_0x1e0b83,_0x214087);await handleSDKOutput([_0xc2fb62],_0x5e0bae);return;}const _0x3fbc72=_0x32aefa[_0x3988cf(0x13c)][_0x3988cf(0x177)],_0x2c5e0d=this[_0x3988cf(0x1b7)](_0x1e0b83,_0x214087,_0x3fbc72);console[_0x3988cf(0x17e)](_0x2c5e0d);}async[a54_0x1fa737(0x23b)](_0x2f7ac5,_0x52b7b3){const _0x5435eb=a54_0x1fa737,{tdx:_0xd46f87}=_0x2f7ac5,_0xf68b8c=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x2db855=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x4cefe3=0x0;while(_0x4cefe3<_0x2db855){process[_0x5435eb(0x225)][_0x5435eb(0x19d)]&&process[_0x5435eb(0x225)]['write']('\x1bc');let _0x391f03,_0x3320e5;try{[_0x391f03,_0x3320e5]=await Promise['all']([_0xd46f87[_0x5435eb(0x2a0)][_0x5435eb(0x242)](_0x52b7b3),_0xd46f87['workflow'][_0x5435eb(0x158)](_0x52b7b3,![])]);}catch(_0x4bb172){console[_0x5435eb(0x188)](a54_0x3b7b49[_0x5435eb(0x160)](_0x5435eb(0x167)));_0x4cefe3>0x0&&console[_0x5435eb(0x188)](a54_0x3b7b49[_0x5435eb(0x189)](_0x5435eb(0x1f3)+_0x4cefe3));throw _0x4bb172;}const _0x3e3724=_0xd46f87['context'][_0x5435eb(0x177)],_0x22cdea=this[_0x5435eb(0x1b7)](_0x391f03,_0x3320e5,_0x3e3724);console[_0x5435eb(0x17e)](_0x22cdea);const _0x11256b=_0x391f03[_0x5435eb(0x2a7)]&&_0x3320e5[_0x5435eb(0x193)](_0x1f4344=>_0x1f4344[_0x5435eb(0x133)]!==_0x5435eb(0x2e5)&&_0x1f4344[_0x5435eb(0x133)]!==_0x5435eb(0x152));if(_0x11256b){console['error'](a54_0x3b7b49['green'](_0x5435eb(0x226)));break;}console[_0x5435eb(0x188)](a54_0x3b7b49['dim']('\x0aPolling...\x20('+_0x4cefe3*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x1d417d=>setTimeout(_0x1d417d,_0xf68b8c)),_0x4cefe3++;}_0x4cefe3>=_0x2db855&&console[_0x5435eb(0x188)](a54_0x3b7b49['yellow']('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a54_0x1fa737(0x1b7)](_0x175a3b,_0x3176b2,_0x28f2d4){const _0x2b9c16=a54_0x1fa737,_0x1a92cc=[],_0x5eaa41=TIMELINE_CONFIG[_0x2b9c16(0x282)],_0x491d08=0x5,_0x5cc73b=process[_0x2b9c16(0x225)][_0x2b9c16(0x18b)]||0x78,_0x1cc8c7=_0x5cc73b-_0x5eaa41-_0x491d08,_0x2b53fa=Math[_0x2b9c16(0x255)](TIMELINE_CONFIG[_0x2b9c16(0x1ae)],Math[_0x2b9c16(0x1b5)](_0x1cc8c7,TIMELINE_CONFIG[_0x2b9c16(0x2b5)])),_0x3a3a34=new Date(_0x175a3b[_0x2b9c16(0x2d3)])['getTime'](),_0x475d14=_0x175a3b[_0x2b9c16(0x22f)]?new Date(_0x175a3b[_0x2b9c16(0x22f)])[_0x2b9c16(0x1cc)]():Date['now'](),_0x5e4440={'start':_0x3a3a34,'end':_0x475d14,'duration':_0x475d14-_0x3a3a34},_0x4245e4=new Map(),_0xa38232=[];for(const _0x42b1e2 of _0x3176b2){if(_0x42b1e2[_0x2b9c16(0x2d6)]){const _0x50b6f9=new Date(_0x42b1e2['startedAt'])[_0x2b9c16(0x1cc)](),_0x55659f=_0x42b1e2['updatedAt']?new Date(_0x42b1e2['updatedAt'])[_0x2b9c16(0x1cc)]():Date[_0x2b9c16(0x29c)](),_0x24fb2c={'start':_0x50b6f9,'end':_0x55659f,'duration':_0x55659f-_0x50b6f9};_0x4245e4['set'](_0x42b1e2['id'],_0x24fb2c),_0xa38232[_0x2b9c16(0x224)]({'name':_0x42b1e2[_0x2b9c16(0x1fe)],'state':_0x42b1e2[_0x2b9c16(0x133)]||_0x2b9c16(0x17d),'window':_0x24fb2c});}else _0xa38232[_0x2b9c16(0x224)]({'name':_0x42b1e2[_0x2b9c16(0x1fe)],'state':_0x42b1e2[_0x2b9c16(0x133)]||'planned','window':undefined});}_0xa38232[_0x2b9c16(0x239)]((_0x593d6a,_0x279385)=>{const _0x5b93ea=_0x2b9c16;if(!_0x593d6a['window'])return 0x1;if(!_0x279385[_0x5b93ea(0x22d)])return-0x1;return _0x593d6a[_0x5b93ea(0x22d)][_0x5b93ea(0x292)]-_0x279385[_0x5b93ea(0x22d)]['start'];});const _0x2a24e7=_0xa38232[_0x2b9c16(0x240)],_0x75a0d=_0x2a24e7>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x75a0d&&_0xa38232[_0x2b9c16(0x137)](TIMELINE_CONFIG[_0x2b9c16(0x175)]);const _0xb379=calculateTimeScale(_0x5e4440,_0x2b53fa),_0x46a27b=_0x175a3b[_0x2b9c16(0x2a7)]?_0x175a3b[_0x2b9c16(0x16a)]?a54_0x3b7b49[_0x2b9c16(0x24d)](_0x2b9c16(0x16a)):a54_0x3b7b49[_0x2b9c16(0x160)]('error'):a54_0x3b7b49[_0x2b9c16(0x2a2)]('running'),_0x2673d5=_0x175a3b['project']?.['id'],_0x1466cb=_0x175a3b['sessionId'];let _0x1e97a9;if(_0x2673d5&&_0x1466cb){const _0x553d62=getWorkflowAttemptUrl(_0x28f2d4,_0x2673d5,_0x1466cb,_0x175a3b['id']);_0x1e97a9=hyperlink(a54_0x3b7b49['dim'](_0x175a3b['id']),_0x553d62);}else _0x1e97a9=a54_0x3b7b49[_0x2b9c16(0x189)](_0x175a3b['id']);_0x1a92cc['push'](_0x2b9c16(0x2c1)+_0x1e97a9+'\x20-\x20'+_0x46a27b+_0x2b9c16(0x28e)+formatElapsed(_0x5e4440[_0x2b9c16(0x23e)]));if(_0xa38232[_0x2b9c16(0x240)]>0x0){const _0x2821a6=renderTimeAxis(_0xb379,_0x2b53fa),_0x2ec35d=new Date(_0x5e4440[_0x2b9c16(0x292)]),_0x511f1a=formatDate(_0x2ec35d),_0x2f2470=TIMELINE_CONFIG[_0x2b9c16(0x2df)]+TIMELINE_CONFIG['ICON_SPACING']+_0x5eaa41,_0x38f7b1=_0x511f1a[_0x2b9c16(0x22a)](_0x2f2470),_0x2708c2=a54_0x3b7b49[_0x2b9c16(0x189)](_0x38f7b1);_0x1a92cc[_0x2b9c16(0x224)](_0x2708c2+'\x20'+_0x2821a6);for(const _0x3405a6 of _0xa38232){_0x1a92cc[_0x2b9c16(0x224)](renderTaskRow(_0x3405a6,_0xb379,_0x2b53fa,_0x5eaa41));}const _0x186ecb=calculateStats(_0xa38232);_0x1a92cc[_0x2b9c16(0x224)](formatStats(_0x186ecb)),_0x75a0d&&_0x1a92cc[_0x2b9c16(0x224)](a54_0x3b7b49[_0x2b9c16(0x164)](_0x2b9c16(0x291)+TIMELINE_CONFIG[_0x2b9c16(0x175)]+_0x2b9c16(0x23f)+_0x2a24e7+_0x2b9c16(0x1d4))),_0x1a92cc[_0x2b9c16(0x224)](''),_0x1a92cc[_0x2b9c16(0x224)](a54_0x3b7b49[_0x2b9c16(0x189)](_0x2b9c16(0x28a))+(_0x2b9c16(0x13b)+_0x175a3b['id']+_0x2b9c16(0x1e2))+a54_0x3b7b49['dim']('\x20to\x20see\x20detailed\x20logs'));}else _0x1a92cc[_0x2b9c16(0x224)]('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x1a92cc['join']('\x0a');}[a54_0x1fa737(0x214)](_0x172901,_0x2b42c6){const _0x1e01d4=a54_0x1fa737,_0x1d9e3b=new Date(_0x172901[_0x1e01d4(0x2d3)])[_0x1e01d4(0x1cc)](),_0x1d0a34=_0x172901[_0x1e01d4(0x22f)]?new Date(_0x172901['finishedAt'])[_0x1e01d4(0x1cc)]():Date[_0x1e01d4(0x29c)](),_0x562140=_0x1d0a34-_0x1d9e3b,_0x45ceb2=[];for(const _0xe3f684 of _0x2b42c6){if(_0xe3f684[_0x1e01d4(0x2d6)]){const _0x565509=new Date(_0xe3f684['startedAt'])[_0x1e01d4(0x1cc)](),_0x3d7262=_0xe3f684['updatedAt']?new Date(_0xe3f684[_0x1e01d4(0x2cd)])[_0x1e01d4(0x1cc)]():Date[_0x1e01d4(0x29c)]();_0x45ceb2['push']({'name':_0xe3f684[_0x1e01d4(0x1fe)],'state':_0xe3f684['state']||_0x1e01d4(0x17d),'window':{'start':_0x565509,'end':_0x3d7262,'duration':_0x3d7262-_0x565509}});}else _0x45ceb2[_0x1e01d4(0x224)]({'name':_0xe3f684[_0x1e01d4(0x1fe)],'state':_0xe3f684[_0x1e01d4(0x133)]||_0x1e01d4(0x152),'window':undefined});}const _0x4a55ad=calculateStats(_0x45ceb2);return{'attempt':{'id':_0x172901['id'],'status':_0x172901[_0x1e01d4(0x2a7)]?_0x172901[_0x1e01d4(0x16a)]?_0x1e01d4(0x16a):_0x1e01d4(0x188):'running','createdAt':_0x172901['createdAt'],'finishedAt':_0x172901[_0x1e01d4(0x22f)],'duration_ms':_0x562140},'tasks':_0x45ceb2[_0x1e01d4(0x285)](_0x38cbb2=>({'name':_0x38cbb2[_0x1e01d4(0x24e)],'state':_0x38cbb2[_0x1e01d4(0x133)],'startedAt':_0x38cbb2[_0x1e01d4(0x22d)]?new Date(_0x38cbb2[_0x1e01d4(0x22d)][_0x1e01d4(0x292)])[_0x1e01d4(0x246)]():null,'updatedAt':_0x38cbb2[_0x1e01d4(0x22d)]?new Date(_0x38cbb2['window'][_0x1e01d4(0x12f)])[_0x1e01d4(0x246)]():null,'duration_ms':_0x38cbb2[_0x1e01d4(0x22d)]?.['duration']||null})),'stats':_0x4a55ad};}}export class WorkflowSchedulesCommand extends BaseCommand{[a54_0x1fa737(0x24e)]='workflow:schedules';[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x2b2);async[a54_0x1fa737(0x179)](_0x18a4be){const _0x281a7e=a54_0x1fa737,{options:_0x583068,tdx:_0x808e35}=_0x18a4be,_0x4c7b12=await withSpinner(_0x281a7e(0x13f),()=>_0x808e35[_0x281a7e(0x2a0)]['listSchedules'](),{'verbose':_0x583068['verbose']}),_0x5dd7db=_0x4c7b12[_0x281a7e(0x262)];console['error'](_0x281a7e(0x2d7)+_0x5dd7db[_0x281a7e(0x240)]+_0x281a7e(0x1d5)+(_0x5dd7db[_0x281a7e(0x240)]!==0x1?'s':''));if(isStructuredFormat(_0x583068))await handleSDKOutput(_0x5dd7db,_0x583068);else{if(_0x5dd7db[_0x281a7e(0x240)]===0x0)console[_0x281a7e(0x17e)]('No\x20schedules\x20found');else for(const _0x1ff443 of _0x5dd7db){const _0x8de5f7=_0x1ff443[_0x281a7e(0x2e3)]?a54_0x3b7b49[_0x281a7e(0x164)](_0x281a7e(0x18d)):'',_0x378527=_0x1ff443['project']?.['name']?a54_0x3b7b49[_0x281a7e(0x189)]('\x20['+_0x1ff443['project'][_0x281a7e(0x24e)]+']'):'',_0x1e27fb=_0x1ff443[_0x281a7e(0x219)]?a54_0x3b7b49[_0x281a7e(0x189)](_0x281a7e(0x2ab)+new Date(_0x1ff443[_0x281a7e(0x219)])[_0x281a7e(0x174)]()):'';console[_0x281a7e(0x17e)](_0x281a7e(0x1ff)+_0x1ff443['id']+'\x20'+(_0x1ff443[_0x281a7e(0x2a0)]?.[_0x281a7e(0x24e)]||_0x281a7e(0x1c3))+_0x378527+_0x8de5f7+_0x1e27fb);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a54_0x1fa737(0x24e)]=a54_0x1fa737(0x2ef);[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x2b6);async['execute'](_0x370546){const _0x5ecdc8=a54_0x1fa737,{options:_0x5ddf66,args:_0x411362,tdx:_0xbf23b2}=_0x370546,_0x31bc6a=_0x411362[0x0];if(!_0x31bc6a)return console[_0x5ecdc8(0x188)](a54_0x3b7b49['red'](_0x5ecdc8(0x2e0)),_0x5ecdc8(0x1b4)),console[_0x5ecdc8(0x188)](a54_0x3b7b49[_0x5ecdc8(0x189)](_0x5ecdc8(0x1ec))),console[_0x5ecdc8(0x188)](a54_0x3b7b49[_0x5ecdc8(0x189)]('Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs')),0x1;const _0x542294=await withSpinner('Enabling\x20schedule\x20#'+_0x31bc6a+_0x5ecdc8(0x12a),()=>_0xbf23b2['workflow']['enableSchedule'](_0x31bc6a),{'verbose':_0x5ddf66[_0x5ecdc8(0x170)]}),_0x5f2ac9=_0x542294[_0x5ecdc8(0x262)];return isStructuredFormat(_0x5ddf66)?await handleSingleObjectOutput(_0x5f2ac9,_0x5ddf66):(console[_0x5ecdc8(0x17e)](_0x5ecdc8(0x206)+_0x31bc6a+_0x5ecdc8(0x146)+(_0x5f2ac9[_0x5ecdc8(0x2a0)]?.[_0x5ecdc8(0x24e)]||_0x5ecdc8(0x17d))+')'),_0x5f2ac9[_0x5ecdc8(0x219)]&&console[_0x5ecdc8(0x17e)](a54_0x3b7b49[_0x5ecdc8(0x189)]('\x20\x20Next\x20run:\x20'+new Date(_0x5f2ac9['nextRunTime'])[_0x5ecdc8(0x174)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a54_0x1fa737(0x24e)]=a54_0x1fa737(0x286);[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x21c);async['execute'](_0x1a64a1){const _0x347837=a54_0x1fa737,{options:_0x14e451,args:_0x27324c,tdx:_0x13d8a2}=_0x1a64a1,_0x26bc3d=_0x27324c[0x0];if(!_0x26bc3d)return console[_0x347837(0x188)](a54_0x3b7b49[_0x347837(0x160)](_0x347837(0x2e0)),_0x347837(0x1b4)),console[_0x347837(0x188)](a54_0x3b7b49[_0x347837(0x189)](_0x347837(0x1f0))),console[_0x347837(0x188)](a54_0x3b7b49[_0x347837(0x189)](_0x347837(0x27e))),0x1;const _0x23b847=await withSpinner('Disabling\x20schedule\x20#'+_0x26bc3d+_0x347837(0x12a),()=>_0x13d8a2[_0x347837(0x2a0)][_0x347837(0x1d7)](_0x26bc3d),{'verbose':_0x14e451[_0x347837(0x170)]}),_0x1a7be9=_0x23b847[_0x347837(0x262)];return isStructuredFormat(_0x14e451)?await handleSingleObjectOutput(_0x1a7be9,_0x14e451):console[_0x347837(0x17e)](_0x347837(0x206)+_0x26bc3d+_0x347837(0x1f8)+(_0x1a7be9[_0x347837(0x2a0)]?.[_0x347837(0x24e)]||_0x347837(0x17d))+')'),0x0;}}
|
|
1
|
+
const a54_0x1b534b=a54_0x1eec;(function(_0x52d8bf,_0x48f1e2){const _0x375ad3=a54_0x1eec,_0x1125f0=_0x52d8bf();while(!![]){try{const _0x536b2a=parseInt(_0x375ad3(0x19a))/0x1+-parseInt(_0x375ad3(0x20a))/0x2+parseInt(_0x375ad3(0x1b7))/0x3*(parseInt(_0x375ad3(0x242))/0x4)+parseInt(_0x375ad3(0x1af))/0x5*(-parseInt(_0x375ad3(0x17b))/0x6)+parseInt(_0x375ad3(0x18d))/0x7*(parseInt(_0x375ad3(0x1f5))/0x8)+-parseInt(_0x375ad3(0x1d4))/0x9*(parseInt(_0x375ad3(0x1b6))/0xa)+parseInt(_0x375ad3(0x24c))/0xb;if(_0x536b2a===_0x48f1e2)break;else _0x1125f0['push'](_0x1125f0['shift']());}catch(_0x2acf8a){_0x1125f0['push'](_0x1125f0['shift']());}}}(a54_0x2d23,0xdbfe1));import a54_0x371dc7 from'chalk';import{existsSync}from'fs';import a54_0x46b3f9 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a54_0x547977 from'prompts';function getAttemptStatusDisplay(_0xc1986e){const _0x4b8822=a54_0x1eec;if(!_0xc1986e)return{'icon':'⏳','text':''};const {done:_0x2c29d3,success:_0x24fa13,cancelRequested:_0x445c0f}=_0xc1986e;if(!_0x2c29d3)return _0x445c0f?{'icon':'🛑','text':a54_0x371dc7[_0x4b8822(0x27e)]('canceling')}:{'icon':'🔄','text':a54_0x371dc7[_0x4b8822(0x202)](_0x4b8822(0x104))};if(_0x24fa13)return{'icon':'✅','text':a54_0x371dc7[_0x4b8822(0x1cb)](_0x4b8822(0x1df))};return{'icon':'❌','text':a54_0x371dc7[_0x4b8822(0x16b)](_0x4b8822(0x289))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x1b534b(0x13d)](_0x55f71b,_0x5b7015,_0xe3d25c=0x0){const _0x26d85a=a54_0x1b534b;return _0x55f71b[_0xe3d25c]||_0x5b7015[_0x26d85a(0xf7)];}[a54_0x1b534b(0x28b)](_0x298ce4,_0x5a606f,_0xefaaa1=0x0){const _0x4eb149=a54_0x1b534b,_0x5117dc=this[_0x4eb149(0x13d)](_0x298ce4,_0x5a606f,_0xefaaa1);if(!_0x5117dc)return console['error'](a54_0x371dc7[_0x4eb149(0x16b)](_0x4eb149(0x1c8)),'Project\x20name\x20is\x20required'),console[_0x4eb149(0x289)](a54_0x371dc7[_0x4eb149(0x290)](_0x4eb149(0x26d))),null;return _0x5117dc;}['parseProjectWorkflowPattern'](_0xa96ba8,_0x33c876){const _0x31a461=a54_0x1b534b;if(_0xa96ba8[0x0]){const _0x46b7d6=_0xa96ba8[0x0][_0x31a461(0x1a4)]('.');if(_0x46b7d6['length']===0x1)return{'projectName':_0x46b7d6[0x0],'workflowName':undefined};else return _0x46b7d6['length']===0x2?{'projectName':_0x46b7d6[0x0],'workflowName':_0x46b7d6[0x1]}:(console[_0x31a461(0x289)](a54_0x371dc7[_0x31a461(0x16b)]('Error:'),_0x31a461(0x283)),null);}return{'projectName':_0x33c876['workflowProject'],'workflowName':undefined};}[a54_0x1b534b(0x221)](_0x44b314,_0x1d511f,_0x2665da=0x0){const _0x5b5fd3=a54_0x1b534b;if(_0x44b314[_0x2665da])return _0x44b314[_0x2665da];if(_0x1d511f[_0x5b5fd3(0xf7)]){const _0xe7c1a2=a54_0x46b3f9[_0x5b5fd3(0x133)](process['cwd'](),_0x5b5fd3(0x1ff),_0x1d511f[_0x5b5fd3(0xf7)]);if(existsSync(a54_0x46b3f9['join'](_0xe7c1a2,_0x5b5fd3(0x287))))return _0xe7c1a2;}return undefined;}async['showWorkflowConsoleUrl'](_0x2670c6,_0x214524,_0x1ccdca){const _0x5e6fde=a54_0x1b534b;try{const _0x5c4ac8=await _0x2670c6[_0x5e6fde(0x1ed)][_0x5e6fde(0x1ff)](_0x214524,{'limit':0x1});if(_0x5c4ac8[_0x5e6fde(0xfd)]>0x0){const _0x14973d=_0x5c4ac8[0x0]['id'],_0x41b51c=getWorkflowUrl(_0x1ccdca,_0x14973d);console[_0x5e6fde(0x289)]('\x20\x20Console:\x20'+a54_0x371dc7[_0x5e6fde(0x2a3)](_0x41b51c));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x26a);[a54_0x1b534b(0x128)]=a54_0x1b534b(0x1e9);async[a54_0x1b534b(0x18a)](_0x1a1925){const _0x208dbe=a54_0x1b534b,{options:_0x11e932,args:_0xefb8c8,tdx:_0xccda3f}=_0x1a1925,_0x3cd725=_0xefb8c8[0x0],_0x39598f=_0x11e932[_0x208dbe(0x24b)];if(_0x39598f)return saveSessionContext({'workflow_project':undefined},_0x11e932[_0x208dbe(0x1a9)]),console[_0x208dbe(0x156)](a54_0x371dc7['green'](_0x208dbe(0x214))),0x0;if(!_0x3cd725)return console['error'](a54_0x371dc7[_0x208dbe(0x16b)]('Error:'),'Project\x20name\x20is\x20required'),console[_0x208dbe(0x289)](a54_0x371dc7[_0x208dbe(0x290)](_0x208dbe(0x1c1))),console['error'](a54_0x371dc7[_0x208dbe(0x290)](_0x208dbe(0x105))),0x1;const _0x47b78a=await withSpinner(_0x208dbe(0x10e)+_0x3cd725+'\x27...',()=>_0xccda3f[_0x208dbe(0x1ed)][_0x208dbe(0x267)](_0x3cd725),{'verbose':_0x11e932[_0x208dbe(0x24a)]}),{name:_0x4765bc}=_0x47b78a['data'];return saveSessionContext({'workflow_project':_0x4765bc},_0x11e932[_0x208dbe(0x1a9)]),console[_0x208dbe(0x156)](a54_0x371dc7[_0x208dbe(0x1cb)](_0x208dbe(0x14f)+a54_0x371dc7[_0x208dbe(0x2a3)](_0x4765bc))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x1b534b(0x196)]='workflow:projects';[a54_0x1b534b(0x128)]='List\x20all\x20workflow\x20projects';async[a54_0x1b534b(0x18a)](_0x2fe697){const _0x1f9ac8=a54_0x1b534b,{options:_0x231edb,args:_0x1d6d94,tdx:_0x14d5af}=_0x2fe697,_0x25cf94=_0x1d6d94[0x0];_0x231edb[_0x1f9ac8(0x24a)]&&_0x25cf94&&console[_0x1f9ac8(0x289)]('Pattern:\x20'+_0x25cf94);const _0x1bc3ed=await withSpinner(_0x1f9ac8(0x147),()=>_0x14d5af[_0x1f9ac8(0x1ed)][_0x1f9ac8(0x1ef)](_0x25cf94,{'limit':_0x231edb['limit']}),{'verbose':_0x231edb['verbose']});let _0x131ae2=_0x1bc3ed['data'];_0x131ae2[_0x1f9ac8(0x136)]((_0x2d1458,_0x1c8bc0)=>_0x2d1458[_0x1f9ac8(0x196)][_0x1f9ac8(0x124)](_0x1c8bc0['name']));const _0xf28662=_0x231edb[_0x1f9ac8(0x12b)]||0x64,_0x4f7535=_0x131ae2['length']>=_0xf28662?a54_0x371dc7[_0x1f9ac8(0x290)](_0x1f9ac8(0x10a)):'';console[_0x1f9ac8(0x289)](_0x1f9ac8(0x27d)+_0x131ae2['length']+_0x1f9ac8(0x102)+(_0x131ae2[_0x1f9ac8(0xfd)]!==0x1?'s':'')+_0x4f7535);if(_0x231edb['format']===_0x1f9ac8(0x210)||_0x231edb[_0x1f9ac8(0x23a)]===_0x1f9ac8(0x118)||_0x231edb[_0x1f9ac8(0x23a)]===_0x1f9ac8(0x12c))await handleSDKOutput(_0x131ae2,_0x231edb);else{if(_0x131ae2[_0x1f9ac8(0xfd)]===0x0)_0x25cf94?console[_0x1f9ac8(0x156)]('No\x20projects\x20match\x20pattern:\x20'+_0x25cf94):console[_0x1f9ac8(0x156)]('No\x20workflow\x20projects\x20found');else{const _0x4571bb=_0x131ae2['map'](_0xf745e4=>{const _0x51698e=_0x1f9ac8,_0x2d2190=_0xf745e4[_0x51698e(0x27b)]?.['some'](_0x34b759=>_0x34b759['key']==='sys'),_0x2ad9c4=_0x2d2190?a54_0x371dc7[_0x51698e(0x290)]('\x20(system)'):'';return _0x51698e(0x174)+_0xf745e4[_0x51698e(0x196)]+_0x2ad9c4;});await writeOutput(_0x4571bb[_0x1f9ac8(0x133)]('\x0a'),_0x231edb[_0x1f9ac8(0x114)],_0x1f9ac8(0x154));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x297);[a54_0x1b534b(0x128)]=a54_0x1b534b(0x27a);async[a54_0x1b534b(0x18a)](_0x532280){const _0x352141=a54_0x1b534b,{options:_0xa5a54,args:_0x2ce570,tdx:_0x180599}=_0x532280,_0x1e4029=this[_0x352141(0x13d)](_0x2ce570,_0xa5a54);_0xa5a54['verbose']&&_0x1e4029&&console['error'](_0x352141(0x1c4)+_0x1e4029);const _0x48b52b=await withSpinner(_0x352141(0x20e),()=>_0x180599[_0x352141(0x1ed)][_0x352141(0x1ff)](_0x1e4029,{'limit':_0xa5a54['limit']}),{'verbose':_0xa5a54['verbose']});let _0x14aed2=_0x48b52b['data'];_0x14aed2['sort']((_0x1dc49b,_0x4460b0)=>{const _0x3fe042=_0x352141,_0x5a82d4=_0x1dc49b['name']['localeCompare'](_0x4460b0[_0x3fe042(0x196)]);if(_0x5a82d4!==0x0)return _0x5a82d4;return(_0x1dc49b[_0x3fe042(0x13c)]?.[_0x3fe042(0x196)]||'')['localeCompare'](_0x4460b0['project']?.['name']||'');});const _0x23d0aa=_0xa5a54[_0x352141(0x12b)]||0x64,_0x5d2f9a=_0x14aed2[_0x352141(0xfd)]>=_0x23d0aa?a54_0x371dc7[_0x352141(0x290)](_0x352141(0x10a)):'';console[_0x352141(0x289)](_0x352141(0x27d)+_0x14aed2[_0x352141(0xfd)]+_0x352141(0x12e)+(_0x14aed2[_0x352141(0xfd)]!==0x1?'s':'')+_0x5d2f9a);if(_0xa5a54[_0x352141(0x23a)]===_0x352141(0x210)||_0xa5a54['format']===_0x352141(0x118)||_0xa5a54[_0x352141(0x23a)]===_0x352141(0x12c))await handleSDKOutput(_0x14aed2,_0xa5a54);else{if(_0x14aed2[_0x352141(0xfd)]===0x0)_0x1e4029?console['log'](_0x352141(0x220)+_0x1e4029):console[_0x352141(0x156)](_0x352141(0x1bc));else{const _0x330f50=_0xa5a54['site'],_0x51b34c=_0x14aed2[_0x352141(0x284)](_0x59d34b=>{const _0x2e1b89=_0x352141,_0x519f08=a54_0x371dc7[_0x2e1b89(0x290)]('#'+_0x59d34b['id']),_0x54ad60=hyperlink(_0x519f08,getWorkflowUrl(_0x330f50,_0x59d34b['id'])),_0x57485b=_0x59d34b[_0x2e1b89(0x13c)]?.[_0x2e1b89(0x196)]?a54_0x371dc7[_0x2e1b89(0x290)]('\x20('+_0x59d34b[_0x2e1b89(0x13c)][_0x2e1b89(0x196)]+')'):'';return _0x2e1b89(0x25e)+_0x54ad60+'\x20'+_0x59d34b[_0x2e1b89(0x196)]+_0x57485b;});await writeOutput(_0x51b34c['join']('\x0a'),_0xa5a54['output'],'list');}}return 0x0;}}function a54_0x2d23(){const _0xd09536=['param','toLocaleString','\x20secrets...','workflow:sessions','workflowProject','summary','min','✔\x20Deleted\x20project\x20','New\x20project\x20name:\x20','deleteSecret','length','Select\x20a\x20workflow\x20to\x20run','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','displayLine','\x20unchanged','\x20project','values','running','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Error:\x20Project\x20name\x20is\x20required','\x20\x20Session\x20context\x20set\x20to:\x20','basename','yes','\x20(use\x20--limit\x20to\x20show\x20more)','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','setSecrets','startTime','Resolving\x20project\x20\x27','Key\x20cannot\x20be\x20empty','find','Project\x20directory:\x20','Retrying\x20attempt...','\x0a✔\x20Already\x20up\x20to\x20date','output','workflow:push','Show\x20specific\x20attempt\x20details','\x20\x20Project:\x20','jsonl','fullName','Dry\x20run:\x20yes','end','Disable\x20a\x20workflow\x20schedule','Fetching\x20log\x20files...','\x20\x20Console:\x20','Getting\x20attempt\x20tasks...','includeSubtasks','.\x20Expected\x20format:\x20KEY=VALUE','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','Listing\x20workflow\x20attempts...','localeCompare','run','...','getTime','description','taskName','Downloading\x20logs...','limit','table','\x22?\x20This\x20cannot\x20be\x20undone.','\x20workflow','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','renderSessionsTimeline','---\x20','stdout','join','enableSchedule','-\x20nothing\x20pushed','sort','size','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Params:\x20','Enable\x20a\x20workflow\x20schedule','List\x20workflow\x20execution\x20sessions','project','resolveProject','Getting\x20attempt\x20details...','✔\x20Project:\x20','buildTimelineData','Enabling\x20schedule\x20#','type','fromTask','(use\x20--limit\x20to\x20see\x20more)','Project:\x20','Analyzing\x20project...','Listing\x20workflow\x20projects...','trimEnd','existingProjectId','site','workflow:timeline','session_id','session:','\x27\x20from\x20project\x20\x27','✔\x20Workflow\x20project\x20set\x20to:\x20','workflow:attempt','No\x20sessions\x20found\x20in\x20project:\x20','Pushing\x20workflow\x20project...','From\x20task:\x20','list','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','log','List\x20workflow\x20attempts','Loading\x20session...','index','Attempt:\x20','Latest\x20session\x20has\x20no\x20attempt','Pull\x20workflow\x20project\x20to\x20local\x20folder','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','\x0aDry\x20run\x20-\x20no\x20files\x20written','getMonth','context','generateSessionTimelineRows','\x20\x20Changes:\x20','\x20\x20Session\x20ID:\x20','Analyzing\x20changes...','Listing\x20secrets...','Secrets\x20to\x20set:\x20','ICON_SPACING','Including\x20subtasks:\x20yes','💡\x20Tip:\x20Use\x20','GUTTER','red','floor','targetExists','logFiles','round','push','\x20enabled\x20(','message','\x20logs','📁\x20','Source\x20directory:\x20','No\x20workflow\x20sessions\x20found','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','workflow:pull','\x20from\x20session\x20','startedAt','18YBMZVY','includes','\x20session','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','retryAttemptName','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','max','MAX_LABEL_COUNT','unchanged','start','Source\x20project:\x20','preparePushProject','✔\x20Secret\x20\x27','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','⚠\x20Showing\x20first\x20','execute','autocomplete','workflow:run','124663eQTlKb','finishedAt','slice','MAX_POLL_ITERATIONS','\x20secrets\x20set\x20for\x20project\x20\x27','Project\x20name:\x20','✔\x20Project\x20updated','Deleting\x20project\x20','\x20modified','name','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','readFile','Reason:\x20','135821bXDnjC','pending','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','data','rows','delete',',\x20Workflow:\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','applyPullProject','split','\x20\x20Location:\x20','state','projectName','No\x20sessions\x20with\x20timing\x20information','session','showWorkflowConsoleUrl','isTTY','\x0a✔\x20Attempt\x20complete','Downloading\x20project\x20','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','1294395prRYHz','attemptId','padStart','group_error','Updating\x20','renderTimeline','isDirectory','1250xaMqIz','356121EXNRPg','trim','filesExtracted','pullProject','\x0aUpdate\x20existing\x20project\x20\x22','No\x20workflows\x20found','Setting\x20secret...','Writing\x20files...','columns','\x20-\x20','Usage:\x20tdx\x20wf\x20use\x20<project>','Error:\x20Invalid\x20parameter\x20format:\x20','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','Project\x20filter:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','planned','window','Error:','Filter:\x20project=','\x20deleted','green','msPerChar','attempt:','\x20schedule','✔\x20Downloaded\x20','set','→\x20New\x20project:\x20','No\x20attempts\x20found\x20in\x20project:\x20','all','19755LSkHNS','→\x20Project:\x20','Start\x20a\x20workflow\x20run','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','\x0aError:','Schedule\x20ID\x20is\x20required','listSchedules','kill','Session\x20not\x20found:\x20','status','navigateSessionsInteractive','success','workflow:clone','hasChanges','dryRun','unknown','key','params','Tip:\x20cd\x20to\x20workflows/','Filter:\x20','Warning:','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','skipValidation','Retrying\x20session...','follow','workflow','\x20\x20tdx\x20wf\x20use\x20<project>','projects','getFullYear','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','pollTimeline','disableSchedule','Pushing\x20project...','296EtoGSo','Killing\x20attempt...','createdAt','modified','white','✔\x20Showing\x20','Select\x20a\x20session\x20to\x20view\x20timeline:','Revision:\x20','Loading\x20sessions...','workflow:delete','workflows','workflow:retry','\x20\x20Attempt\x20ID:\x20','blue','Show\x20tasks\x20for\x20an\x20attempt','lastAttempt','write','Target\x20directory:\x20','get','TASK_NAME_WIDTH','🔄\x20','1170674yeGkrC','repeat','✔\x20Schedule\x20#','text','Listing\x20workflows...','fill','json','\x0a⚠\x20Project\x20\x22','\x20new','\x20next:\x20','✔\x20Workflow\x20project\x20context\x20cleared.','keys','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','cancelRequested','\x20\x20Source:\x20','resumeFrom','sessionTime','workflow:logs','sessionId','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','/app/workflows/','No\x20workflows\x20found\x20in\x20project:\x20','resolveProjectDir','path','tdx\x20wf\x20attempt\x20','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','\x0aPush\x20these\x20changes?','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','No\x20log\x20content\x20found','stat','nextRunTime','✔\x20Pushed\x20','getDate','\x20tasks','executePushProject','select','(unknown)','\x0aPolling...\x20(','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','workflow:attempts','\x20disabled\x20(','\x20\x20Project\x20ID:\x20','sourceDir','\x22\x20already\x20exists\x20(ID:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Setting\x20','format','Using\x20attempt\x20','\x0aClone\x20\x22','No\x20log\x20files\x20found\x20for\x20this\x20attempt','workflow:kill','toLowerCase','toISOString','projectId','20wgIOJK','workflow:schedule:disable','workflow:tasks','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Cancelled','updatedAt','revision','substring','verbose','clear','12640639sbMygT','Retry\x20a\x20session\x20or\x20attempt','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','No\x20attempts\x20found\x20for:\x20','attempts','match','MAX_TASKS_DISPLAY','Validation:\x20skipped','relative','sourceProjectName','Listing\x20workflow\x20sessions...','renderSingleTimeline','/attempt/','fileSize','\x20\x20New\x20attempt\x20ID:\x20','title','✔\x20Pull\x20complete','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','📋\x20','durationMs','tasks','force','icon','Files\x20to\x20upload:\x20','targetDir','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','sessions','resolveProjectId','attempt','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','workflow:use','revision:\x20','No\x20sessions\x20found','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','getHours','No\x20workflow\x20tdx.json\x20found','\x22\x20with\x20new\x20revision?','total','ICON_WIDTH','Usage:\x20workflow:delete\x20<project-name-or-id>','Total:\x20','\x0aDry\x20run\x20-\x20nothing\x20pushed','No\x20sessions\x20found\x20for:\x20','\x0aFailed\x20to\x20fetch\x20attempt\x20data','isArray','Task\x20name:\x20','List\x20workflows','metadata','startsWith','✔\x20Found\x20','yellow','\x20to\x20see\x20detailed\x20logs','deleted','\x20attempt','now','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','map','task','\x20(disabled)','tdx.json','\x20\x20Revision:\x20','error','resolve','requireProject','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Loading\x20workflows...','diff','newProjectName','dim','\x20sessions\x20','parse','disabledAt','Auto-selected\x20latest\x20session:\x20','Kill\x20a\x20running\x20attempt','\x20\x20Files\x20extracted:\x20','workflow:workflows','MAX_TIMELINE_WIDTH','workflow:schedules','fs/promises','MIN_TIMELINE_WIDTH','prepareCloneProject','parseProjectWorkflowPattern','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','changes','done','Output\x20directory:\x20','\x1b[1A\x1b[2K','cyan','Attempt\x20ID:\x20','listSecrets','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Parameters:\x20','Expected\x20format:\x20--param\x20key=value','executeCloneProject','canceling','Error:\x20Attempt\x20ID\x20is\x20required','/sessions/','includeRetried','\x22\x20to\x20new\x20project\x20\x22','LABEL_MIN_SPACING','filter','Listing\x20schedules...','duration','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','workflowName'];a54_0x2d23=function(){return _0xd09536;};return a54_0x2d23();}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0xf6);[a54_0x1b534b(0x128)]=a54_0x1b534b(0x13b);async[a54_0x1b534b(0x18a)](_0x48bd52){const _0x33433a=a54_0x1b534b,{options:_0x406d80,args:_0x2bf66f,tdx:_0x3b5ad5}=_0x48bd52,_0x2e1b50=this[_0x33433a(0x29d)](_0x2bf66f,_0x406d80);if(!_0x2e1b50)return 0x1;const {projectName:_0x2ee20f,workflowName:_0x56bc80}=_0x2e1b50;if(_0x406d80[_0x33433a(0x24a)]){if(_0x2ee20f&&_0x56bc80)console[_0x33433a(0x289)](_0x33433a(0x1e7)+_0x2ee20f+'.'+_0x56bc80);else _0x2ee20f&&console['error']('Filter:\x20project='+_0x2ee20f);const _0x514430=_0x406d80[_0x33433a(0x1dd)];_0x514430&&console[_0x33433a(0x289)]('Status:\x20'+_0x514430);}let _0xa885bd=0x28;if(process[_0x33433a(0x132)][_0x33433a(0x1ab)]&&!_0x406d80[_0x33433a(0x114)]&&!_0x406d80[_0x33433a(0x23a)]){const _0x3b8261=process[_0x33433a(0x132)]['rows']||0x28;_0xa885bd=Math[_0x33433a(0x181)](0x14,Math[_0x33433a(0x16c)](_0x3b8261*0x2/0x3));}const _0x5aa56d=_0x406d80['limit']||_0xa885bd,_0x12e0ab=await withSpinner(_0x33433a(0x256),()=>_0x3b5ad5[_0x33433a(0x1ed)]['sessions']({'projectName':_0x2ee20f,'workflowName':_0x56bc80,'status':_0x406d80[_0x33433a(0x1dd)],'fromTime':_0x406d80['from'],'toTime':_0x406d80['to'],'limit':_0x5aa56d}),{'verbose':_0x406d80[_0x33433a(0x24a)]}),_0x5875c1=_0x12e0ab[_0x33433a(0x19d)];_0x5875c1[_0x33433a(0x136)]((_0x31f499,_0x7355fb)=>{const _0x42ea1e=_0x33433a,_0x4daac8=_0x31f499[_0x42ea1e(0x21b)]||'',_0x52626b=_0x7355fb[_0x42ea1e(0x21b)]||'';return _0x52626b[_0x42ea1e(0x124)](_0x4daac8);});_0x5875c1[_0x33433a(0xfd)]>=_0x5aa56d?console[_0x33433a(0x289)](_0x33433a(0x1fa)+_0x5875c1[_0x33433a(0xfd)]+_0x33433a(0x291)+a54_0x371dc7['dim'](_0x33433a(0x144))):console[_0x33433a(0x289)]('✔\x20Found\x20'+_0x5875c1['length']+_0x33433a(0x17d)+(_0x5875c1[_0x33433a(0xfd)]!==0x1?'s':''));if(_0x406d80[_0x33433a(0x23a)]===_0x33433a(0x210)||_0x406d80[_0x33433a(0x23a)]===_0x33433a(0x118)||_0x406d80['format']==='table')await handleSDKOutput(_0x5875c1,_0x406d80);else{if(!process['stdout'][_0x33433a(0x1ab)]||_0x406d80[_0x33433a(0x114)]){if(_0x5875c1[_0x33433a(0xfd)]===0x0){if(_0x2ee20f&&_0x56bc80)console[_0x33433a(0x156)]('No\x20sessions\x20found\x20for:\x20'+_0x2ee20f+'.'+_0x56bc80);else _0x2ee20f?console[_0x33433a(0x156)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x2ee20f):console[_0x33433a(0x156)](_0x33433a(0x26c));}else{const _0x2daf6b=_0x406d80[_0x33433a(0x14a)],_0x318613=this[_0x33433a(0x130)](_0x5875c1,_0x2daf6b);_0x406d80[_0x33433a(0x114)]?await writeOutput(_0x318613,_0x406d80[_0x33433a(0x114)],_0x33433a(0x154)):console[_0x33433a(0x156)](_0x318613);}!_0x2ee20f&&(console[_0x33433a(0x289)](''),console['error'](a54_0x371dc7[_0x33433a(0x290)](_0x33433a(0x1d7))),console[_0x33433a(0x289)](a54_0x371dc7['dim'](_0x33433a(0x25d))+'or'+a54_0x371dc7[_0x33433a(0x290)](_0x33433a(0x1ee))));}else{if(_0x5875c1[_0x33433a(0xfd)]===0x0){if(_0x2ee20f&&_0x56bc80)console['log']('No\x20sessions\x20found\x20for:\x20'+_0x2ee20f+'.'+_0x56bc80);else _0x2ee20f?console[_0x33433a(0x156)](_0x33433a(0x151)+_0x2ee20f):console['log'](_0x33433a(0x26c));}else await this[_0x33433a(0x1de)](_0x5875c1,_0x48bd52,_0x2ee20f);}}return 0x0;}[a54_0x1b534b(0x130)](_0x42fae0,_0x1af110){const _0x4f8ef6=a54_0x1b534b,_0x4ae9b7=[],_0x6fff9e=new Map();let _0xd937a2=Infinity,_0x322dd9=-Infinity;for(const _0x450f40 of _0x42fae0){if(_0x450f40[_0x4f8ef6(0x204)]?.[_0x4f8ef6(0x1f7)]){const _0x3c2a7b=new Date(_0x450f40[_0x4f8ef6(0x204)][_0x4f8ef6(0x1f7)])[_0x4f8ef6(0x127)](),_0x15c602=_0x450f40[_0x4f8ef6(0x204)][_0x4f8ef6(0x18e)]?new Date(_0x450f40[_0x4f8ef6(0x204)][_0x4f8ef6(0x18e)])[_0x4f8ef6(0x127)]():Date[_0x4f8ef6(0x282)](),_0x6319ac=_0x450f40['project']?.[_0x4f8ef6(0x196)]||_0x4f8ef6(0x22f);!_0x6fff9e['has'](_0x6319ac)&&_0x6fff9e[_0x4f8ef6(0x1d0)](_0x6319ac,[]),_0x6fff9e[_0x4f8ef6(0x207)](_0x6319ac)[_0x4f8ef6(0x170)]({'session':_0x450f40,'startTime':_0x3c2a7b,'endTime':_0x15c602,'duration':_0x15c602-_0x3c2a7b}),_0xd937a2=Math[_0x4f8ef6(0xf9)](_0xd937a2,_0x3c2a7b),_0x322dd9=Math[_0x4f8ef6(0x181)](_0x322dd9,_0x15c602);}}if(_0x6fff9e[_0x4f8ef6(0x137)]===0x0)return _0x4f8ef6(0x1a8);const _0x2d8245=process[_0x4f8ef6(0x132)][_0x4f8ef6(0x1bf)]||0x78,_0x19d16b=0x1e,_0x385979=0x32,_0x429db1=0x4,_0x112ba8=Math[_0x4f8ef6(0xf9)](_0x385979,Math[_0x4f8ef6(0x181)](_0x19d16b,Math[_0x4f8ef6(0x16c)](_0x2d8245*0.3))),_0x1462e9=_0x2d8245-_0x112ba8-TIMELINE_CONFIG[_0x4f8ef6(0x16a)]-0x3-_0x429db1,_0x4e16ce=_0x322dd9-_0xd937a2,_0x1d5680=_0x4e16ce/_0x112ba8,_0x102858=renderTimeAxis({'startTime':_0xd937a2,'endTime':_0x322dd9,'durationMs':_0x4e16ce,'msPerChar':_0x1d5680},_0x112ba8),_0x525bb6=[];for(const _0x4ac200 of _0x6fff9e[_0x4f8ef6(0x103)]()){_0x525bb6[_0x4f8ef6(0x170)](..._0x4ac200);}_0x525bb6[_0x4f8ef6(0x136)]((_0x3fa962,_0x341e5a)=>_0x341e5a['startTime']-_0x3fa962[_0x4f8ef6(0x10d)]);const _0x2c1dd2=new Date(_0xd937a2),_0x286d4e=formatDate(_0x2c1dd2),_0x28d533=_0x429db1+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x4f8ef6(0x167)]+_0x1462e9,_0x5f3ed9='\x20'[_0x4f8ef6(0x20b)](_0x28d533-_0x286d4e[_0x4f8ef6(0xfd)]),_0x438e94=_0x5f3ed9+a54_0x371dc7[_0x4f8ef6(0x290)](_0x286d4e)+'\x20'+_0x102858;_0x4ae9b7['push'](_0x438e94);const _0xa8147f=0x16;let _0x38a8b5=0x0;for(const _0x4a71d1 of _0x525bb6){const _0x267372=_0x4a71d1[_0x4f8ef6(0x1a9)][_0x4f8ef6(0x13c)]?.[_0x4f8ef6(0x196)]||'?',_0x532cd6=Math['min'](stringWidth(_0x267372),_0xa8147f);_0x38a8b5=Math[_0x4f8ef6(0x181)](_0x38a8b5,_0x532cd6);}for(const _0x24d27a of _0x525bb6){const {session:_0x178aa4,startTime:_0x34e145,endTime:_0x2855d0,duration:_0x1893b7}=_0x24d27a,_0x4ffcfd=_0x178aa4['project']?.['id'],_0x472974=_0x178aa4['id'],_0x3661ac=_0x178aa4['project']?.[_0x4f8ef6(0x196)]||'?',_0x474fec=_0x178aa4[_0x4f8ef6(0x1ed)]?.[_0x4f8ef6(0x196)]||'?';let _0x3ad554,_0x1a5e35;if(_0x178aa4[_0x4f8ef6(0x204)]){const _0x4bd2a3=_0x178aa4[_0x4f8ef6(0x204)];!_0x4bd2a3[_0x4f8ef6(0x2a0)]?(_0x3ad554=_0x4bd2a3['cancelRequested']?'🛑':'🔄',_0x1a5e35=_0x4bd2a3[_0x4f8ef6(0x218)]?a54_0x371dc7[_0x4f8ef6(0x27e)]:a54_0x371dc7[_0x4f8ef6(0x202)]):(_0x3ad554=_0x4bd2a3['success']?'✅':'❌',_0x1a5e35=_0x4bd2a3['success']?a54_0x371dc7[_0x4f8ef6(0x1cb)]:a54_0x371dc7[_0x4f8ef6(0x16b)]);}else _0x3ad554='⏳',_0x1a5e35=a54_0x371dc7['dim'];const _0x5b1162='#'+_0x472974,_0x47b189=_0x4ffcfd?hyperlink(_0x5b1162,getWorkflowSessionUrl(_0x1af110,_0x4ffcfd,_0x472974)):_0x5b1162;let _0x1aeaf0=_0x3661ac;stringWidth(_0x3661ac)>_0xa8147f&&(_0x1aeaf0=_0x3661ac[_0x4f8ef6(0x18f)](0x0,_0xa8147f-0x1)+'…');const _0x429443=a54_0x371dc7['dim'](_0x1aeaf0),_0x584f41=stringWidth(_0x1aeaf0),_0x698a65='\x20'['repeat'](_0x38a8b5-stringWidth(_0x1aeaf0)+0x2),_0x4c0887='('+formatElapsed(_0x1893b7)+')',_0x5b4899=stringWidth(_0x4c0887),_0x1bdbcd=stringWidth(_0x5b1162),_0x21de34=_0x1bdbcd+0x1+_0x584f41+_0x698a65[_0x4f8ef6(0xfd)],_0x39e555=_0x1462e9-_0x21de34-_0x5b4899-0x1-0x8;let _0x47d169=_0x474fec;stringWidth(_0x47d169)>_0x39e555&&(_0x47d169=_0x47d169[_0x4f8ef6(0x18f)](0x0,_0x39e555-0x1)+'…');const _0x23f90e=_0x47b189+'\x20'+_0x429443+_0x698a65+_0x47d169,_0x3cdec6=stringWidth(_0x23f90e),_0x3b4e4b=_0x1462e9-_0x3cdec6-_0x5b4899,_0xab9997=_0x23f90e+'\x20'[_0x4f8ef6(0x20b)](Math['max'](0x1,_0x3b4e4b))+a54_0x371dc7[_0x4f8ef6(0x290)](_0x4c0887),_0x4c1ff9=Math[_0x4f8ef6(0x16c)]((_0x34e145-_0xd937a2)/_0x1d5680),_0x224ba0=Math['floor']((_0x2855d0-_0xd937a2)/_0x1d5680),_0xf76343=Math[_0x4f8ef6(0x181)](_0x4c1ff9+0x1,_0x224ba0),_0x295ce2=new Array(_0x112ba8)[_0x4f8ef6(0x20f)]('\x20');for(let _0x4d084c=_0x4c1ff9;_0x4d084c<Math['min'](_0xf76343,_0x112ba8);_0x4d084c++){_0x295ce2[_0x4d084c]='─';}const _0x22d6fc=_0x295ce2[_0x4f8ef6(0x284)](_0x379217=>_0x379217==='\x20'?'\x20':_0x1a5e35(_0x379217))[_0x4f8ef6(0x133)]('');_0x4ae9b7[_0x4f8ef6(0x170)](_0x3ad554+'\x20'+_0xab9997+'│'+_0x22d6fc+'│');}return _0x4ae9b7['join']('\x0a');}async[a54_0x1b534b(0x1de)](_0x1060b5,_0x57616a,_0x1946fc){const _0x45fb03=a54_0x1b534b,{options:_0x298e99,tdx:_0x5e3b79}=_0x57616a,_0x459287=_0x298e99['site'],{timelineRows:_0x32adcb,timeAxisHeader:_0x14f687}=this['generateSessionTimelineRows'](_0x1060b5,_0x459287),_0x3f564d=_0x32adcb[_0x45fb03(0xee)](_0x3238b8=>_0x3238b8[_0x45fb03(0x1b0)]);if(_0x3f564d[_0x45fb03(0xfd)]===0x0){const _0x38024a=this[_0x45fb03(0x130)](_0x1060b5,_0x459287);console[_0x45fb03(0x156)](_0x38024a);!_0x1946fc&&(console[_0x45fb03(0x289)](''),console[_0x45fb03(0x289)](a54_0x371dc7['dim'](_0x45fb03(0x1d7))),console[_0x45fb03(0x289)](a54_0x371dc7['dim'](_0x45fb03(0x25d))+'or'+a54_0x371dc7[_0x45fb03(0x290)](_0x45fb03(0x1ee))));return;}_0x14f687&&console[_0x45fb03(0x156)](_0x14f687);const _0x32f373=_0x32adcb[_0x45fb03(0xee)](_0x19ba75=>_0x19ba75['attemptId'])['map'](_0x218f0f=>({'title':_0x218f0f[_0x45fb03(0x100)],'value':_0x218f0f['attemptId']})),_0x111f8b=process[_0x45fb03(0x132)][_0x45fb03(0x19e)]||0x3c,_0x4a96e5=Math[_0x45fb03(0x181)](0x28,Math[_0x45fb03(0x16c)](_0x111f8b*0x2/0x3)),_0x251710=await a54_0x547977({'type':_0x45fb03(0x18b),'name':_0x45fb03(0x1b0),'message':_0x45fb03(0x224),'choices':_0x32f373,'initial':-0x1,'limit':_0x4a96e5,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x366d67,_0x8ec23b)=>{const _0x4ec2f7=_0x45fb03;if(!_0x366d67)return Promise[_0x4ec2f7(0x28a)](_0x8ec23b);const _0x5eefe0=_0x8ec23b[_0x4ec2f7(0xee)](_0x80a430=>{const _0x476637=_0x4ec2f7,_0x3c24d9=_0x80a430;return _0x3c24d9[_0x476637(0x25b)]['toLowerCase']()[_0x476637(0x17c)](_0x366d67[_0x476637(0x23f)]());});return Promise[_0x4ec2f7(0x28a)](_0x5eefe0);}}),_0x18bf06=()=>{const _0x222761=_0x45fb03;process[_0x222761(0x132)][_0x222761(0x205)](_0x222761(0x2a2)),process[_0x222761(0x132)]['write'](_0x222761(0x2a2)),process['stdout'][_0x222761(0x205)](_0x222761(0x2a2));},_0x1f3af1=_0x251710&&_0x251710[_0x45fb03(0x1b0)]&&_0x251710[_0x45fb03(0x1b0)]!==null&&_0x251710[_0x45fb03(0x1b0)][_0x45fb03(0x1b8)]()!=='';if(!_0x1f3af1){_0x18bf06(),console[_0x45fb03(0x156)](a54_0x371dc7['dim']('Cancelled'));return;}_0x18bf06();const _0x453b33=_0x1060b5[_0x45fb03(0x110)](_0x157f6f=>_0x157f6f['lastAttempt']?.['id']===_0x251710[_0x45fb03(0x1b0)]);if(_0x453b33){const _0x373424=_0x453b33[_0x45fb03(0x13c)]?.[_0x45fb03(0x196)]||'?',_0x1972ce=_0x453b33[_0x45fb03(0x1ed)]?.[_0x45fb03(0x196)]||'?';console['log']('Project:\x20'+a54_0x371dc7[_0x45fb03(0x290)](_0x373424)+_0x45fb03(0x1a0)+a54_0x371dc7[_0x45fb03(0x290)](_0x1972ce));}const _0x142105=new WorkflowTimelineCommand();await _0x142105['execute']({'args':[],'options':{..._0x298e99,'attemptId':_0x251710[_0x45fb03(0x1b0)]},'tdx':_0x5e3b79});}[a54_0x1b534b(0x161)](_0x59f35b,_0x63f4b3){const _0x19709f=a54_0x1b534b,_0x35b0c4=new Map();for(const _0x1f86b9 of _0x59f35b){_0x1f86b9['id']&&_0x1f86b9[_0x19709f(0x204)]?.['id']&&_0x35b0c4[_0x19709f(0x1d0)](_0x1f86b9['id'],_0x1f86b9[_0x19709f(0x204)]['id']);}const _0x3700b9=[];let _0x17a0a4='';const _0x2c5414=this[_0x19709f(0x130)](_0x59f35b,_0x63f4b3),_0x2f1b65=_0x2c5414[_0x19709f(0x1a4)]('\x0a');for(const _0x1dfa77 of _0x2f1b65){if(_0x1dfa77['startsWith']('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x1dfa77[_0x19709f(0x251)](/^\s+\d{4}-\d{2}-\d{2}/))_0x17a0a4=_0x1dfa77;else{if(_0x1dfa77['match'](/^[✅❌🔄🛑⏳]/)){const _0x5a4889=_0x1dfa77[_0x19709f(0x251)](/#(\d+)/),_0x1d2cae=_0x5a4889?_0x5a4889[0x1]:null,_0x31dbf4=_0x1d2cae?_0x35b0c4[_0x19709f(0x207)](_0x1d2cae)||null:null,_0x38c47e=_0x59f35b[_0x19709f(0x110)](_0x4f2075=>_0x4f2075['id']===_0x1d2cae),_0x263b83=_0x38c47e?.['project']?.[_0x19709f(0x196)]||'';_0x3700b9[_0x19709f(0x170)]({'displayLine':_0x1dfa77,'attemptId':_0x31dbf4,'projectName':_0x263b83});}}}return{'timelineRows':_0x3700b9,'timeAxisHeader':_0x17a0a4};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x232);[a54_0x1b534b(0x128)]=a54_0x1b534b(0x157);async[a54_0x1b534b(0x18a)](_0x3d8726){const _0x4eb552=a54_0x1b534b,{options:_0x2407ac,args:_0xa58ea3,tdx:_0x37210b}=_0x3d8726,_0x4e527e=this[_0x4eb552(0x29d)](_0xa58ea3,_0x2407ac);if(!_0x4e527e)return 0x1;const {projectName:_0x5a3914,workflowName:_0x46eed1}=_0x4e527e,_0x1ac7a2=_0x2407ac[_0x4eb552(0xeb)];if(_0x2407ac[_0x4eb552(0x24a)]){if(_0x5a3914&&_0x46eed1)console[_0x4eb552(0x289)]('Filter:\x20'+_0x5a3914+'.'+_0x46eed1);else _0x5a3914&&console[_0x4eb552(0x289)](_0x4eb552(0x1c9)+_0x5a3914);_0x1ac7a2&&console[_0x4eb552(0x289)]('Include\x20retried:\x20yes');}const _0x488528=await withSpinner(_0x4eb552(0x123),()=>_0x37210b[_0x4eb552(0x1ed)][_0x4eb552(0x250)]({'projectName':_0x5a3914,'workflowName':_0x46eed1,'includeRetried':_0x1ac7a2,'limit':_0x2407ac[_0x4eb552(0x12b)]}),{'verbose':_0x2407ac[_0x4eb552(0x24a)]}),_0x20f3af=_0x488528['data'],_0xc77821=_0x2407ac[_0x4eb552(0x12b)]||0x64,_0x5ab0b1=_0x20f3af[_0x4eb552(0xfd)]>=_0xc77821?a54_0x371dc7['dim']('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x4eb552(0x289)](_0x4eb552(0x27d)+_0x20f3af[_0x4eb552(0xfd)]+_0x4eb552(0x281)+(_0x20f3af[_0x4eb552(0xfd)]!==0x1?'s':'')+_0x5ab0b1);if(_0x2407ac[_0x4eb552(0x23a)]===_0x4eb552(0x210)||_0x2407ac['format']==='jsonl'||_0x2407ac[_0x4eb552(0x23a)]==='table')await handleSDKOutput(_0x20f3af,_0x2407ac);else{if(_0x20f3af['length']===0x0){if(_0x5a3914&&_0x46eed1)console[_0x4eb552(0x156)](_0x4eb552(0x24f)+_0x5a3914+'.'+_0x46eed1);else _0x5a3914?console['log'](_0x4eb552(0x1d2)+_0x5a3914):console[_0x4eb552(0x156)]('No\x20attempts\x20found');}else{const _0x32860e=_0x2407ac[_0x4eb552(0x14a)],_0x33fcd4=_0x20f3af[_0x4eb552(0x284)](_0x2f3bcf=>{const _0x309bd8=_0x4eb552,_0x58657f=a54_0x371dc7['dim']('#'+_0x2f3bcf['id']),_0x2b9fa3=_0x2f3bcf[_0x309bd8(0x13c)]?.['id'],_0x3ffcac=_0x2f3bcf[_0x309bd8(0x14c)]||_0x2f3bcf[_0x309bd8(0x21d)],_0x5b9d32=_0x2b9fa3&&_0x3ffcac?hyperlink(_0x58657f,getWorkflowAttemptUrl(_0x32860e,_0x2b9fa3,_0x3ffcac,_0x2f3bcf['id'])):_0x58657f,{icon:_0x2d2a81,text:_0x44e79e}=getAttemptStatusDisplay(_0x2f3bcf),_0x3d4105=(_0x2f3bcf[_0x309bd8(0x13c)]?.['name']||'?')+'.'+(_0x2f3bcf['workflow']?.[_0x309bd8(0x196)]||'?'),_0x47e844=_0x2f3bcf[_0x309bd8(0x21b)]?a54_0x371dc7[_0x309bd8(0x290)](_0x2f3bcf[_0x309bd8(0x21b)]):'';return(_0x5b9d32+'\x20'+_0x2d2a81+(_0x44e79e?'\x20'+_0x44e79e:'')+'\x20'+_0x3d4105+'\x20'+_0x47e844)[_0x309bd8(0x148)]();});await writeOutput(_0x33fcd4['join']('\x0a'),_0x2407ac[_0x4eb552(0x114)],_0x4eb552(0x154));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x150);[a54_0x1b534b(0x128)]=a54_0x1b534b(0x116);async[a54_0x1b534b(0x18a)](_0x536af5){const _0x93be39=a54_0x1b534b,{options:_0x4767ba,args:_0x162635,tdx:_0x35997b}=_0x536af5,_0x4518e4=_0x162635[0x0];if(!_0x4518e4)return console[_0x93be39(0x289)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x4767ba['verbose']&&console[_0x93be39(0x289)](_0x93be39(0x2a4)+_0x4518e4);const _0x27f80c=await withSpinner(_0x93be39(0x13e),()=>_0x35997b[_0x93be39(0x1ed)]['attempt'](_0x4518e4),{'verbose':_0x4767ba['verbose']}),_0x507597=_0x27f80c[_0x93be39(0x19d)];let _0x4d3726;!_0x507597[_0x93be39(0x2a0)]?_0x4d3726=_0x507597[_0x93be39(0x218)]?_0x93be39(0x2aa):_0x93be39(0x104):_0x4d3726=_0x507597[_0x93be39(0x1df)]?_0x93be39(0x1df):'error';let _0x2b4f37;if(_0x507597[_0x93be39(0x1f7)]&&_0x507597[_0x93be39(0x18e)]){const _0x298574=new Date(_0x507597[_0x93be39(0x1f7)])[_0x93be39(0x127)](),_0x8fd5ab=new Date(_0x507597[_0x93be39(0x18e)])[_0x93be39(0x127)]();_0x2b4f37=Math[_0x93be39(0x16f)]((_0x8fd5ab-_0x298574)/0x3e8);}const _0x456e83={'attempt_id':_0x507597['id'],'status':_0x4d3726,..._0x507597[_0x93be39(0x159)]!==undefined&&{'index':_0x507597[_0x93be39(0x159)]},..._0x507597[_0x93be39(0x13c)]&&{'project':_0x507597['project'][_0x93be39(0x196)]},..._0x507597[_0x93be39(0x1ed)]&&{'workflow':_0x507597['workflow'][_0x93be39(0x196)]},..._0x507597[_0x93be39(0x21d)]&&{'session_id':_0x507597[_0x93be39(0x21d)]},..._0x507597[_0x93be39(0x21b)]&&{'session_time':_0x507597[_0x93be39(0x21b)]},..._0x507597[_0x93be39(0x17f)]&&{'retry_attempt':_0x507597[_0x93be39(0x17f)]},..._0x2b4f37!==undefined&&{'duration_sec':_0x2b4f37},..._0x507597[_0x93be39(0x1f7)]&&{'created_at':_0x507597['createdAt']},..._0x507597[_0x93be39(0x18e)]&&{'finished_at':_0x507597[_0x93be39(0x18e)]},...Object['keys'](_0x507597[_0x93be39(0x1e5)])[_0x93be39(0xfd)]>0x0&&{'params':_0x507597[_0x93be39(0x1e5)]}};return await handleSingleObjectOutput(_0x456e83,_0x4767ba),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x244);[a54_0x1b534b(0x128)]=a54_0x1b534b(0x203);async[a54_0x1b534b(0x18a)](_0x3969ec){const _0x356eb9=a54_0x1b534b,{options:_0x377746,args:_0x5a162a,tdx:_0x445b94}=_0x3969ec,_0x580781=_0x5a162a[0x0];if(!_0x580781)return console[_0x356eb9(0x289)](_0x356eb9(0x2ab)),0x1;const _0x2d150e=_0x377746[_0x356eb9(0x120)];_0x377746[_0x356eb9(0x24a)]&&(console[_0x356eb9(0x289)](_0x356eb9(0x2a4)+_0x580781),_0x2d150e&&console['error'](_0x356eb9(0x168)));const _0x330040=await withSpinner(_0x356eb9(0x11f),()=>_0x445b94[_0x356eb9(0x1ed)][_0x356eb9(0x260)](_0x580781,_0x2d150e||![]),{'verbose':_0x377746[_0x356eb9(0x24a)]}),_0x59ee8b=_0x330040[_0x356eb9(0x19d)];return console['error'](_0x356eb9(0x27d)+_0x59ee8b[_0x356eb9(0xfd)]+'\x20task'+(_0x59ee8b[_0x356eb9(0xfd)]!==0x1?'s':'')),await handleSDKOutput(_0x59ee8b,_0x377746),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a54_0x1b534b(0x21c);[a54_0x1b534b(0x128)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a54_0x1b534b(0x18a)](_0x51c3ed){const _0x5d1bdc=a54_0x1b534b,{options:_0x4a156f,args:_0x4ef064,tdx:_0xc9f51d}=_0x51c3ed,_0x4ec788=_0x4ef064[0x0];let _0x4eb7f6=_0x4ef064[0x1];if(!_0x4ec788)return console[_0x5d1bdc(0x289)](_0x5d1bdc(0x2ab)),0x1;_0x4a156f['verbose']&&(console[_0x5d1bdc(0x289)](_0x5d1bdc(0x2a4)+_0x4ec788),_0x4eb7f6&&console['error'](_0x5d1bdc(0x279)+_0x4eb7f6));const _0x40e601=await withSpinner(_0x5d1bdc(0x11d),()=>_0xc9f51d[_0x5d1bdc(0x1ed)][_0x5d1bdc(0x16e)](_0x4ec788,_0x4eb7f6),{'verbose':_0x4a156f['verbose']}),_0x2ee1d5=_0x40e601[_0x5d1bdc(0x19d)];if(_0x2ee1d5[_0x5d1bdc(0xfd)]===0x0)return console[_0x5d1bdc(0x289)](_0x5d1bdc(0x23d)),0x0;if(!_0x4eb7f6&&(_0x4a156f[_0x5d1bdc(0x210)]||_0x4a156f[_0x5d1bdc(0x23a)]))return await handleSDKOutput(_0x2ee1d5,_0x4a156f),0x0;if(!_0x4eb7f6){const _0x4ff67e=_0x2ee1d5[_0x5d1bdc(0x284)](_0x15e0c9=>({'title':_0x15e0c9[_0x5d1bdc(0x129)]+'\x20('+formatBytes(_0x15e0c9[_0x5d1bdc(0x259)])+')','value':_0x15e0c9[_0x5d1bdc(0x129)]})),_0x5937a1=await a54_0x547977({'type':_0x5d1bdc(0x22e),'name':'task','message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x4ff67e});if(!_0x5937a1[_0x5d1bdc(0x285)])return console[_0x5d1bdc(0x289)](_0x5d1bdc(0x246)),0x0;_0x4eb7f6=_0x5937a1[_0x5d1bdc(0x285)];}const _0x4e6a26=await withSpinner(_0x5d1bdc(0x12a),()=>_0xc9f51d[_0x5d1bdc(0x1ed)]['logs'](_0x4ec788,_0x4eb7f6),{'verbose':_0x4a156f[_0x5d1bdc(0x24a)]}),_0x4c67ce=_0x4e6a26['data'];return _0x4c67ce?console['log'](_0x4c67ce):console[_0x5d1bdc(0x289)](_0x5d1bdc(0x227)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x23e);[a54_0x1b534b(0x128)]=a54_0x1b534b(0x295);async[a54_0x1b534b(0x18a)](_0x507298){const _0x3213ce=a54_0x1b534b,{options:_0x1dae83,args:_0x1c1cd6,tdx:_0x42d2b9}=_0x507298,_0x44f8b7=_0x1c1cd6[0x0];if(!_0x44f8b7)return console['error'](_0x3213ce(0x2ab)),0x1;const _0x7c57bc=_0x1dae83['reason'];_0x1dae83[_0x3213ce(0x24a)]&&(console[_0x3213ce(0x289)](_0x3213ce(0x2a4)+_0x44f8b7),_0x7c57bc&&console[_0x3213ce(0x289)](_0x3213ce(0x199)+_0x7c57bc));if(!_0x1dae83['yes']){if(!isInteractive())return console[_0x3213ce(0x289)](a54_0x371dc7['red'](_0x3213ce(0x1d8)),_0x3213ce(0x1c5)),console[_0x3213ce(0x289)](a54_0x371dc7[_0x3213ce(0x290)](_0x3213ce(0x138))),0x1;const _0x4f73fc=await confirmKey(_0x3213ce(0x238)+_0x44f8b7+'?');if(!_0x4f73fc)return console['error'](a54_0x371dc7[_0x3213ce(0x27e)](_0x3213ce(0x246))),0x1;}const _0x2bb434=await withSpinner(_0x3213ce(0x1f6),()=>_0x42d2b9[_0x3213ce(0x1ed)][_0x3213ce(0x1db)](_0x44f8b7,_0x7c57bc),{'verbose':_0x1dae83[_0x3213ce(0x24a)]}),_0x8662d8=_0x2bb434[_0x3213ce(0x19d)];return console[_0x3213ce(0x289)]('✔\x20'+_0x8662d8),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x200);[a54_0x1b534b(0x128)]=a54_0x1b534b(0x24d);async[a54_0x1b534b(0x18a)](_0x26c728){const _0x28a724=a54_0x1b534b,{options:_0x4bab63,args:_0x51fceb,tdx:_0x41348d}=_0x26c728,_0x95ef06=_0x51fceb[0x0];if(!_0x95ef06)return console[_0x28a724(0x289)](_0x28a724(0x17e)),console['error'](_0x28a724(0x237)),0x1;let _0x1853dc=![],_0x55f5a1=_0x95ef06;if(_0x95ef06['startsWith'](_0x28a724(0x14d)))_0x1853dc=!![],_0x55f5a1=_0x95ef06[_0x28a724(0x249)](0x8);else{if(_0x95ef06[_0x28a724(0x27c)](_0x28a724(0x1cd)))_0x1853dc=![],_0x55f5a1=_0x95ef06['substring'](0x8);else return console[_0x28a724(0x289)](_0x28a724(0x265)),console[_0x28a724(0x289)](_0x28a724(0x237)),0x1;}const _0x6f21af=_0x4bab63[_0x28a724(0x143)],_0x224765=_0x4bab63[_0x28a724(0x21a)],_0x21a3c0=_0x4bab63['params'],_0x3dc465=_0x4bab63[_0x28a724(0x261)];_0x4bab63[_0x28a724(0x24a)]&&(console[_0x28a724(0x289)]('Target:\x20'+(_0x1853dc?'session':_0x28a724(0x268))+'\x20'+_0x55f5a1),_0x6f21af&&console['error'](_0x28a724(0x153)+_0x6f21af),_0x224765&&console[_0x28a724(0x289)]('Resume\x20from:\x20'+_0x224765),_0x21a3c0&&console[_0x28a724(0x289)](_0x28a724(0x139)+_0x21a3c0),_0x3dc465&&console[_0x28a724(0x289)]('Force:\x20yes'));let _0x5d69b4;if(_0x21a3c0)try{if(_0x21a3c0[_0x28a724(0x27c)]('@')){const _0x331639=await import(_0x28a724(0x29a)),_0x24f6e4=_0x21a3c0[_0x28a724(0x249)](0x1),_0x9b46d2=await _0x331639[_0x28a724(0x198)](_0x24f6e4,'utf-8');_0x5d69b4=JSON['parse'](_0x9b46d2);}else _0x5d69b4=JSON[_0x28a724(0x292)](_0x21a3c0);}catch{return console[_0x28a724(0x289)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x4bab63[_0x28a724(0x109)]){if(!isInteractive())return console['error'](a54_0x371dc7[_0x28a724(0x16b)]('\x0aError:'),_0x28a724(0x1c5)),console[_0x28a724(0x289)](a54_0x371dc7['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x40d8dc=await confirmKey(_0x28a724(0x177)+(_0x1853dc?_0x28a724(0x1a9):_0x28a724(0x268))+'\x20'+_0x55f5a1+'?');if(!_0x40d8dc)return console[_0x28a724(0x289)](a54_0x371dc7['yellow']('Cancelled')),0x1;}let _0x1329d8;_0x1853dc?_0x1329d8=await withSpinner(_0x28a724(0x1eb),()=>_0x41348d[_0x28a724(0x1ed)]['retrySession'](_0x55f5a1,{'fromTask':_0x6f21af,'retryParams':_0x5d69b4}),{'verbose':_0x4bab63[_0x28a724(0x24a)]}):_0x1329d8=await withSpinner(_0x28a724(0x112),()=>_0x41348d[_0x28a724(0x1ed)]['retryAttempt'](_0x55f5a1,{'resumeFrom':_0x224765,'retryParams':_0x5d69b4,'force':_0x3dc465}),{'verbose':_0x4bab63['verbose']});const _0x38f42a=_0x1329d8[_0x28a724(0x19d)];return console[_0x28a724(0x289)]('✔\x20Retry\x20started'),console[_0x28a724(0x289)](_0x28a724(0x25a)+_0x38f42a[_0x28a724(0x1b0)]),console['error']('\x20\x20Session\x20ID:\x20'+_0x38f42a[_0x28a724(0x21d)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x18c);[a54_0x1b534b(0x128)]=a54_0x1b534b(0x1d6);async[a54_0x1b534b(0x18a)](_0x208e0f){const _0x17c9ca=a54_0x1b534b,{options:_0x168ded,args:_0x12fe88,tdx:_0x1b2d65}=_0x208e0f;let _0x50735a=_0x12fe88[0x0];if(!_0x50735a){const _0x17ddc2=this[_0x17c9ca(0x13d)]([],_0x168ded),_0x4d4b7c=await withSpinner(_0x17c9ca(0x28d),()=>_0x1b2d65['workflow']['workflows'](_0x17ddc2,{'limit':_0x168ded[_0x17c9ca(0x12b)]}),{'verbose':_0x168ded['verbose']}),_0x287e74=_0x4d4b7c['data'];if(_0x287e74['length']===0x0)return console['error']('No\x20workflows\x20found'),!_0x17ddc2&&console[_0x17c9ca(0x289)](a54_0x371dc7[_0x17c9ca(0x290)](_0x17c9ca(0x26d))),0x1;const _0x30714e=_0x287e74[_0x17c9ca(0x284)](_0x5463ba=>({'title':_0x5463ba['project']?.[_0x17c9ca(0x196)]+'.'+_0x5463ba[_0x17c9ca(0x196)],'value':_0x5463ba[_0x17c9ca(0x13c)]?.['name']+'.'+_0x5463ba['name'],'description':_0x5463ba['revision']?_0x17c9ca(0x26b)+_0x5463ba[_0x17c9ca(0x248)]:undefined})),_0x4c42c8=await a54_0x547977({'type':_0x17c9ca(0x22e),'name':_0x17c9ca(0x1ed),'message':_0x17c9ca(0xfe),'choices':_0x30714e});if(!_0x4c42c8[_0x17c9ca(0x1ed)])return 0x1;_0x50735a=_0x4c42c8[_0x17c9ca(0x1ed)];}if(!_0x50735a[_0x17c9ca(0x17c)]('.')){const _0x29738c=this[_0x17c9ca(0x13d)]([],_0x168ded);if(_0x29738c)_0x50735a=_0x29738c+'.'+_0x50735a;else return console[_0x17c9ca(0x289)](a54_0x371dc7[_0x17c9ca(0x16b)](_0x17c9ca(0x1c8)),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console[_0x17c9ca(0x289)](a54_0x371dc7[_0x17c9ca(0x290)](_0x17c9ca(0x26d))),0x1;}const _0x152d44=_0x168ded[_0x17c9ca(0xf3)],_0x568265=_0x168ded[_0x17c9ca(0x21b)],_0x261487={};if(_0x152d44&&Array[_0x17c9ca(0x278)](_0x152d44))for(const _0x112731 of _0x152d44){const _0x242696=_0x112731['indexOf']('=');if(_0x242696===-0x1)return console[_0x17c9ca(0x289)](_0x17c9ca(0x1c2)+_0x112731),console[_0x17c9ca(0x289)](_0x17c9ca(0x2a8)),0x1;const _0x49b892=_0x112731[_0x17c9ca(0x249)](0x0,_0x242696),_0x5ebf14=_0x112731[_0x17c9ca(0x249)](_0x242696+0x1);try{_0x261487[_0x49b892]=JSON[_0x17c9ca(0x292)](_0x5ebf14);}catch{_0x261487[_0x49b892]=_0x5ebf14;}}_0x168ded[_0x17c9ca(0x24a)]&&(console['error']('Workflow:\x20'+_0x50735a),Object['keys'](_0x261487)[_0x17c9ca(0xfd)]>0x0&&console['error'](_0x17c9ca(0x2a7)+JSON['stringify'](_0x261487)),_0x568265&&console[_0x17c9ca(0x289)]('Session\x20time:\x20'+_0x568265));const _0x1438e3=await withSpinner('Starting\x20workflow\x20run...',()=>_0x1b2d65['workflow'][_0x17c9ca(0x125)](_0x50735a,_0x261487,{'sessionTime':_0x568265}),{'verbose':_0x168ded[_0x17c9ca(0x24a)]}),_0x1477f4=_0x1438e3[_0x17c9ca(0x19d)];console[_0x17c9ca(0x289)]('✔\x20Workflow\x20run\x20started'),console[_0x17c9ca(0x289)](_0x17c9ca(0x201)+_0x1477f4['id']),console[_0x17c9ca(0x289)](_0x17c9ca(0x163)+_0x1477f4['sessionId']),console[_0x17c9ca(0x289)](_0x17c9ca(0x117)+_0x1477f4[_0x17c9ca(0x13c)]?.[_0x17c9ca(0x196)]),console['error']('\x20\x20Workflow:\x20'+_0x1477f4[_0x17c9ca(0x1ed)]?.[_0x17c9ca(0x196)]);if(_0x1477f4['project']?.['id']&&_0x1477f4[_0x17c9ca(0x21d)]&&_0x1477f4['id']){const _0x13cf05=_0x168ded[_0x17c9ca(0x14a)],_0x5b0320=getConsoleUrl(_0x13cf05,_0x17c9ca(0x21f)+_0x1477f4[_0x17c9ca(0x13c)]['id']+_0x17c9ca(0xea)+_0x1477f4[_0x17c9ca(0x21d)]+_0x17c9ca(0x258)+_0x1477f4['id']);console[_0x17c9ca(0x289)](_0x17c9ca(0x11e)+a54_0x371dc7[_0x17c9ca(0x2a3)](_0x5b0320));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a54_0x1b534b(0x196)]='workflow:download';[a54_0x1b534b(0x128)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async['execute'](_0x4090b1){const _0x3bd0bf=a54_0x1b534b,{options:_0x57012f,args:_0x27aa0b,tdx:_0x54f62b}=_0x4090b1,_0x77d04d=_0x27aa0b[0x0],_0x1c2a53=_0x27aa0b[0x1]||'.';if(!_0x77d04d)return console[_0x3bd0bf(0x289)](_0x3bd0bf(0x106)),console[_0x3bd0bf(0x289)](_0x3bd0bf(0x245)),0x1;const _0x491260=_0x57012f[_0x3bd0bf(0x248)];_0x57012f[_0x3bd0bf(0x24a)]&&(console[_0x3bd0bf(0x289)]('Project:\x20'+_0x77d04d),console['error'](_0x3bd0bf(0x2a1)+_0x1c2a53),_0x491260&&console[_0x3bd0bf(0x289)]('Revision:\x20'+_0x491260));const _0x265bb1=await withSpinner(_0x3bd0bf(0x1ad)+_0x77d04d+'...',()=>_0x54f62b[_0x3bd0bf(0x1ed)]['download'](_0x77d04d,_0x1c2a53,{'revision':_0x491260}),{'verbose':_0x57012f[_0x3bd0bf(0x24a)]}),_0x5e065a=_0x265bb1[_0x3bd0bf(0x19d)];return console[_0x3bd0bf(0x289)](_0x3bd0bf(0x1cf)+_0x5e065a[_0x3bd0bf(0x1a7)]),console['error'](_0x3bd0bf(0x288)+_0x5e065a[_0x3bd0bf(0x248)]),console[_0x3bd0bf(0x289)](_0x3bd0bf(0x296)+_0x5e065a[_0x3bd0bf(0x1b9)]),console[_0x3bd0bf(0x289)](_0x3bd0bf(0x1a5)+_0x1c2a53+'/'+_0x5e065a[_0x3bd0bf(0x1a7)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x1b534b(0x196)]='workflow:upload';[a54_0x1b534b(0x128)]=a54_0x1b534b(0x231);async[a54_0x1b534b(0x18a)](_0x456644){const _0x53f5fa=a54_0x1b534b,{options:_0x5a82c3,args:_0xc22463,tdx:_0x127886}=_0x456644;let _0x25259f='.',_0x5109a6=_0x5a82c3[_0x53f5fa(0x196)];if(_0xc22463[0x0]){const {promises:_0x52e672}=await import('fs');try{const _0x51eb49=await _0x52e672[_0x53f5fa(0x228)](_0xc22463[0x0]);if(_0x51eb49[_0x53f5fa(0x1b5)]())_0x25259f=_0xc22463[0x0];else return console[_0x53f5fa(0x289)]('Error:\x20'+_0xc22463[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x5109a6=_0xc22463[0x0],_0x25259f='.';}}const _0x3ccf89=_0x5a82c3[_0x53f5fa(0x248)],_0xada135=_0x5a82c3[_0x53f5fa(0x1ea)];_0x5a82c3['verbose']&&(console['error'](_0x53f5fa(0x111)+_0x25259f),_0x5109a6&&console[_0x53f5fa(0x289)](_0x53f5fa(0x192)+_0x5109a6),_0x3ccf89&&console[_0x53f5fa(0x289)](_0x53f5fa(0x1fc)+_0x3ccf89),_0xada135&&console[_0x53f5fa(0x289)]('Validation:\x20skipped'));const _0x56f66c=await withSpinner(_0x53f5fa(0x152),()=>_0x127886[_0x53f5fa(0x1ed)][_0x53f5fa(0x170)](_0x25259f,{'projectName':_0x5109a6,'revision':_0x3ccf89,'skipValidation':_0xada135}),{'verbose':_0x5a82c3[_0x53f5fa(0x24a)]}),_0x7f760b=_0x56f66c[_0x53f5fa(0x19d)];return console[_0x53f5fa(0x289)](_0x53f5fa(0x22a)+_0x7f760b['projectName']),console[_0x53f5fa(0x289)](_0x53f5fa(0x234)+_0x7f760b[_0x53f5fa(0x241)]),console[_0x53f5fa(0x289)]('\x20\x20Revision:\x20'+_0x7f760b[_0x53f5fa(0x248)]),await this[_0x53f5fa(0x1aa)](_0x127886,_0x7f760b[_0x53f5fa(0x1a7)],_0x5a82c3[_0x53f5fa(0x14a)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x178);[a54_0x1b534b(0x128)]=a54_0x1b534b(0x15c);async[a54_0x1b534b(0x18a)](_0x726491){const _0x24ca11=a54_0x1b534b,{options:_0x1ca05d,args:_0x36230f,tdx:_0x5c182e}=_0x726491,_0x3816e7=_0x36230f[0x0],_0x32e29b=_0x36230f[0x1];if(!_0x3816e7)return console[_0x24ca11(0x289)](a54_0x371dc7[_0x24ca11(0x16b)](_0x24ca11(0x1c8)),'Project\x20name\x20is\x20required'),console[_0x24ca11(0x289)](a54_0x371dc7[_0x24ca11(0x290)](_0x24ca11(0x21e))),0x1;const _0x4f0216=_0x1ca05d[_0x24ca11(0x248)];_0x1ca05d[_0x24ca11(0x24a)]&&(console[_0x24ca11(0x289)](_0x24ca11(0x145)+_0x3816e7),_0x32e29b&&console[_0x24ca11(0x289)](_0x24ca11(0x206)+_0x32e29b),_0x4f0216&&console[_0x24ca11(0x289)]('Revision:\x20'+_0x4f0216),_0x1ca05d[_0x24ca11(0x1e2)]&&console[_0x24ca11(0x289)](_0x24ca11(0x11a)));const _0x38f65b=await withSpinner('Pulling\x20project\x20'+_0x3816e7+_0x24ca11(0x126),()=>_0x5c182e[_0x24ca11(0x1ed)][_0x24ca11(0x1ba)](_0x3816e7,{'targetDir':_0x32e29b,'revision':_0x4f0216}),{'verbose':_0x1ca05d[_0x24ca11(0x24a)]}),_0x22f923=_0x38f65b[_0x24ca11(0x19d)];_0x22f923['isNewProject']?console[_0x24ca11(0x289)](_0x24ca11(0x1d1)+_0x22f923[_0x24ca11(0x1a7)]):console[_0x24ca11(0x289)](_0x24ca11(0x1d5)+_0x22f923[_0x24ca11(0x1a7)]);console[_0x24ca11(0x289)](_0x24ca11(0x288)+_0x22f923['revision']),console[_0x24ca11(0x289)]('\x20\x20Target:\x20'+(a54_0x46b3f9[_0x24ca11(0x254)](process['cwd'](),_0x22f923['targetDir'])||'.')),console[_0x24ca11(0x289)](_0x24ca11(0x162)+a54_0x371dc7[_0x24ca11(0x1cb)]('+'+_0x22f923[_0x24ca11(0xf8)]['new']+_0x24ca11(0x212))+',\x20'+(a54_0x371dc7[_0x24ca11(0x27e)]('~'+_0x22f923['summary'][_0x24ca11(0x1f8)]+_0x24ca11(0x195))+',\x20')+(a54_0x371dc7[_0x24ca11(0x16b)]('-'+_0x22f923[_0x24ca11(0xf8)]['deleted']+_0x24ca11(0x1ca))+',\x20')+(''+a54_0x371dc7[_0x24ca11(0x290)](_0x22f923[_0x24ca11(0xf8)][_0x24ca11(0x183)]+_0x24ca11(0x101))));for(const _0x10cb46 of _0x22f923[_0x24ca11(0x29f)]){_0x10cb46[_0x24ca11(0x142)]===_0x24ca11(0x1f8)&&_0x10cb46['diff']&&(console[_0x24ca11(0x289)]('\x0a'+a54_0x371dc7[_0x24ca11(0x2a3)](_0x24ca11(0x131)+_0x10cb46[_0x24ca11(0x222)])),console[_0x24ca11(0x289)](_0x10cb46['diff']));}if(!_0x22f923['hasChanges'])return saveSessionContext({'workflow_project':_0x22f923[_0x24ca11(0x1a7)]},_0x1ca05d[_0x24ca11(0x1a9)]),console[_0x24ca11(0x289)](a54_0x371dc7[_0x24ca11(0x1cb)](_0x24ca11(0x113))),console[_0x24ca11(0x289)](a54_0x371dc7['dim'](_0x24ca11(0x107)+_0x22f923[_0x24ca11(0x1a7)])),0x0;if(_0x1ca05d[_0x24ca11(0x1e2)])return console[_0x24ca11(0x289)](a54_0x371dc7[_0x24ca11(0x27e)](_0x24ca11(0x15e))),0x0;if(!_0x1ca05d[_0x24ca11(0x109)]){if(!isInteractive())return console[_0x24ca11(0x289)](a54_0x371dc7[_0x24ca11(0x16b)]('\x0aError:'),_0x24ca11(0x1c5)),console[_0x24ca11(0x289)](a54_0x371dc7[_0x24ca11(0x290)](_0x24ca11(0x138))),0x1;const _0x13a639=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x13a639)return console[_0x24ca11(0x289)](a54_0x371dc7['yellow'](_0x24ca11(0x246)),'-\x20no\x20files\x20written'),0x1;}await withSpinner(_0x24ca11(0x1be),()=>_0x5c182e[_0x24ca11(0x1ed)][_0x24ca11(0x1a3)](_0x22f923,{'revision':_0x4f0216}),{'verbose':_0x1ca05d[_0x24ca11(0x24a)]}),saveSessionContext({'workflow_project':_0x22f923[_0x24ca11(0x1a7)]},_0x1ca05d[_0x24ca11(0x1a9)]),console['error'](a54_0x371dc7['green'](_0x24ca11(0x25c)));const _0xde0bb7=a54_0x46b3f9[_0x24ca11(0x254)](process['cwd'](),_0x22f923[_0x24ca11(0x264)])||'.';return console[_0x24ca11(0x289)](a54_0x371dc7[_0x24ca11(0x290)](_0x24ca11(0x1a5)+_0xde0bb7)),console['error'](a54_0x371dc7[_0x24ca11(0x290)](_0x24ca11(0x107)+_0x22f923[_0x24ca11(0x1a7)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x115);[a54_0x1b534b(0x128)]=a54_0x1b534b(0x28c);async[a54_0x1b534b(0x18a)](_0x43dfbb){const _0x1eb6f=a54_0x1b534b,{options:_0x1eb2d2,args:_0x22b0b8,tdx:_0x53f74f}=_0x43dfbb,_0x5923ba=this[_0x1eb6f(0x221)](_0x22b0b8,_0x1eb2d2),_0x40f89d=_0x1eb2d2[_0x1eb6f(0x248)],_0x4af083=_0x1eb2d2['skipValidation'];_0x1eb2d2[_0x1eb6f(0x24a)]&&(_0x5923ba&&console[_0x1eb6f(0x289)](_0x1eb6f(0x175)+_0x5923ba),_0x40f89d&&console[_0x1eb6f(0x289)](_0x1eb6f(0x1fc)+_0x40f89d),_0x1eb2d2['dryRun']&&console[_0x1eb6f(0x289)](_0x1eb6f(0x11a)),_0x4af083&&console['error'](_0x1eb6f(0x253)));let _0x49301b;try{_0x49301b=await withSpinner(_0x1eb6f(0x164),()=>_0x53f74f[_0x1eb6f(0x1ed)][_0x1eb6f(0x186)]({'sourceDir':_0x5923ba,'revision':_0x40f89d,'skipValidation':_0x4af083}),{'verbose':_0x1eb2d2[_0x1eb6f(0x24a)]});}catch(_0x1c18c2){if(_0x1c18c2 instanceof Error&&_0x1c18c2[_0x1eb6f(0x172)][_0x1eb6f(0x17c)](_0x1eb6f(0x26f)))return console['error'](a54_0x371dc7[_0x1eb6f(0x16b)](_0x1eb6f(0x1c8)),_0x1eb6f(0x197)),_0x1eb2d2[_0x1eb6f(0xf7)]?console[_0x1eb6f(0x289)](a54_0x371dc7[_0x1eb6f(0x290)](_0x1eb6f(0x1e6)+_0x1eb2d2['workflowProject']+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x1eb2d2[_0x1eb6f(0xf7)]+'\x27')):console[_0x1eb6f(0x289)](a54_0x371dc7['dim']('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x1c18c2;}const _0xcbe483=_0x49301b[_0x1eb6f(0x19d)];console[_0x1eb6f(0x289)](_0x1eb6f(0x13f)+_0xcbe483[_0x1eb6f(0x1a7)]),console[_0x1eb6f(0x289)](_0x1eb6f(0x219)+_0xcbe483[_0x1eb6f(0x235)]),console[_0x1eb6f(0x289)](_0x1eb6f(0x288)+_0xcbe483['revision']),console[_0x1eb6f(0x289)](_0x1eb6f(0x162)+a54_0x371dc7[_0x1eb6f(0x1cb)]('+'+_0xcbe483['summary']['new']+'\x20new')+',\x20'+(a54_0x371dc7[_0x1eb6f(0x27e)]('~'+_0xcbe483[_0x1eb6f(0xf8)][_0x1eb6f(0x1f8)]+'\x20modified')+',\x20')+(a54_0x371dc7[_0x1eb6f(0x16b)]('-'+_0xcbe483['summary'][_0x1eb6f(0x280)]+'\x20deleted')+',\x20')+(''+a54_0x371dc7[_0x1eb6f(0x290)](_0xcbe483['summary'][_0x1eb6f(0x183)]+'\x20unchanged')));for(const _0xafe75d of _0xcbe483['changes']){_0xafe75d[_0x1eb6f(0x142)]===_0x1eb6f(0x1f8)&&_0xafe75d[_0x1eb6f(0x28e)]&&(console[_0x1eb6f(0x289)]('\x0a'+a54_0x371dc7[_0x1eb6f(0x2a3)](_0x1eb6f(0x131)+_0xafe75d['path'])),console[_0x1eb6f(0x289)](_0xafe75d[_0x1eb6f(0x28e)]));}if(!_0xcbe483[_0x1eb6f(0x1e1)])return console[_0x1eb6f(0x289)](a54_0x371dc7[_0x1eb6f(0x1cb)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x1eb6f(0x1aa)](_0x53f74f,_0xcbe483[_0x1eb6f(0x1a7)],_0x1eb2d2[_0x1eb6f(0x14a)]),0x0;if(_0x1eb2d2[_0x1eb6f(0x1e2)])return console[_0x1eb6f(0x289)](a54_0x371dc7['yellow'](_0x1eb6f(0x275))),0x0;if(!_0x1eb2d2[_0x1eb6f(0x109)]){if(!isInteractive())return console[_0x1eb6f(0x289)](a54_0x371dc7[_0x1eb6f(0x16b)](_0x1eb6f(0x1d8)),_0x1eb6f(0x1c5)),console[_0x1eb6f(0x289)](a54_0x371dc7['dim'](_0x1eb6f(0x138))),0x1;const _0x2ea676=await confirmKey(_0x1eb6f(0x225));if(!_0x2ea676)return console['error'](a54_0x371dc7[_0x1eb6f(0x27e)](_0x1eb6f(0x246)),_0x1eb6f(0x135)),0x1;}const _0x5d1453=await withSpinner(_0x1eb6f(0x1f4),()=>_0x53f74f[_0x1eb6f(0x1ed)][_0x1eb6f(0x22d)](_0xcbe483),{'verbose':_0x1eb2d2['verbose']}),_0xffd7fb=_0x5d1453[_0x1eb6f(0x19d)];return console[_0x1eb6f(0x289)](a54_0x371dc7[_0x1eb6f(0x1cb)]('✔\x20Push\x20complete')),console['error'](_0x1eb6f(0x234)+_0xffd7fb[_0x1eb6f(0x241)]),console[_0x1eb6f(0x289)]('\x20\x20Revision:\x20'+_0xffd7fb['revision']),await this['showWorkflowConsoleUrl'](_0x53f74f,_0xffd7fb[_0x1eb6f(0x1a7)],_0x1eb2d2[_0x1eb6f(0x14a)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x1e0);['description']=a54_0x1b534b(0x24e);async['execute'](_0x19090b){const _0xb33739=a54_0x1b534b,{options:_0x368191,args:_0x9b073e,tdx:_0x325622}=_0x19090b,_0x327cec=this[_0xb33739(0x221)](_0x9b073e,_0x368191),_0x3aae63=_0x368191[_0xb33739(0x196)],_0x261de8=_0x368191[_0xb33739(0x248)],_0x34e9ea=_0x368191['skipValidation'];if(!_0x327cec)return console[_0xb33739(0x289)](a54_0x371dc7[_0xb33739(0x16b)]('Error:'),'Source\x20directory\x20is\x20required'),console['error'](a54_0x371dc7[_0xb33739(0x290)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console['error'](a54_0x371dc7[_0xb33739(0x290)](_0xb33739(0x19c))),0x1;if(!_0x3aae63)return console[_0xb33739(0x289)](a54_0x371dc7[_0xb33739(0x16b)]('Error:'),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0xb33739(0x289)](a54_0x371dc7[_0xb33739(0x290)](_0xb33739(0x29e))),0x1;_0x368191[_0xb33739(0x24a)]&&(console[_0xb33739(0x289)](_0xb33739(0x175)+_0x327cec),console[_0xb33739(0x289)](_0xb33739(0xfb)+_0x3aae63),_0x261de8&&console[_0xb33739(0x289)](_0xb33739(0x1fc)+_0x261de8),_0x368191[_0xb33739(0x1e2)]&&console[_0xb33739(0x289)](_0xb33739(0x11a)),_0x34e9ea&&console['error']('Validation:\x20skipped'));const _0x2ea8f7=await withSpinner(_0xb33739(0x146),()=>_0x325622[_0xb33739(0x1ed)][_0xb33739(0x29c)](_0x327cec,_0x3aae63,{'revision':_0x261de8,'skipValidation':_0x34e9ea}),{'verbose':_0x368191[_0xb33739(0x24a)]}),_0x3f5a06=_0x2ea8f7[_0xb33739(0x19d)];console[_0xb33739(0x289)]('Source:\x20'+_0x3f5a06[_0xb33739(0x235)]);_0x3f5a06[_0xb33739(0x255)]&&console[_0xb33739(0x289)](_0xb33739(0x185)+_0x3f5a06[_0xb33739(0x255)]);console[_0xb33739(0x289)](_0xb33739(0xfb)+_0x3f5a06[_0xb33739(0x28f)]),console[_0xb33739(0x289)](_0xb33739(0x1fc)+_0x3f5a06[_0xb33739(0x248)]),console[_0xb33739(0x289)](_0xb33739(0x263)+_0x3f5a06['fileCount']);_0x3f5a06[_0xb33739(0x16d)]&&(console['error'](a54_0x371dc7[_0xb33739(0x27e)](_0xb33739(0x211)+_0x3f5a06['newProjectName']+_0xb33739(0x236)+_0x3f5a06[_0xb33739(0x149)]+')')),console['error'](a54_0x371dc7[_0xb33739(0x27e)](_0xb33739(0x269))));if(_0x368191['dryRun'])return console['error'](a54_0x371dc7[_0xb33739(0x27e)]('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x368191[_0xb33739(0x109)]){if(!isInteractive())return console[_0xb33739(0x289)](a54_0x371dc7[_0xb33739(0x16b)]('\x0aError:'),_0xb33739(0x1c5)),console[_0xb33739(0x289)](a54_0x371dc7[_0xb33739(0x290)](_0xb33739(0x138))),0x1;const _0x545a55=_0x3f5a06[_0xb33739(0x255)]||a54_0x46b3f9[_0xb33739(0x108)](_0x327cec),_0x40a997=_0x3f5a06[_0xb33739(0x16d)]?_0xb33739(0x1bb)+_0x3aae63+_0xb33739(0x270):_0xb33739(0x23c)+_0x545a55+_0xb33739(0xec)+_0x3aae63+'\x22?',_0x57253d=await confirmKey(_0x40a997);if(!_0x57253d)return console[_0xb33739(0x289)](a54_0x371dc7[_0xb33739(0x27e)](_0xb33739(0x246))),0x1;}const _0x1bde30=await withSpinner(_0x3f5a06[_0xb33739(0x16d)]?_0xb33739(0x1b3)+_0x3aae63+_0xb33739(0x126):'Cloning\x20to\x20'+_0x3aae63+_0xb33739(0x126),()=>_0x325622['workflow'][_0xb33739(0x2a9)](_0x3f5a06),{'verbose':_0x368191[_0xb33739(0x24a)]}),_0x331c83=_0x1bde30[_0xb33739(0x19d)];return console['error'](a54_0x371dc7[_0xb33739(0x1cb)](_0x3f5a06['targetExists']?_0xb33739(0x193):'✔\x20Clone\x20complete')),console[_0xb33739(0x289)]('\x20\x20Project:\x20'+_0x331c83[_0xb33739(0x28f)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x331c83['newProjectId']),console[_0xb33739(0x289)](_0xb33739(0x288)+_0x331c83[_0xb33739(0x248)]),await this[_0xb33739(0x1aa)](_0x325622,_0x331c83[_0xb33739(0x28f)],_0x368191[_0xb33739(0x14a)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x1fe);[a54_0x1b534b(0x128)]=a54_0x1b534b(0x180);async[a54_0x1b534b(0x18a)](_0x4115a4){const _0x38211c=a54_0x1b534b,{options:_0x30056e,args:_0x32e420,tdx:_0x2cf559}=_0x4115a4,_0x2afd3d=_0x32e420[0x0];if(!_0x2afd3d)return console[_0x38211c(0x289)](_0x38211c(0x10b)),console[_0x38211c(0x289)](_0x38211c(0x273)),0x1;_0x30056e[_0x38211c(0x24a)]&&console[_0x38211c(0x289)](_0x38211c(0x145)+_0x2afd3d);if(!_0x30056e[_0x38211c(0x109)]){if(!isInteractive())return console[_0x38211c(0x289)](a54_0x371dc7[_0x38211c(0x16b)]('\x0aError:'),_0x38211c(0x1c5)),console[_0x38211c(0x289)](a54_0x371dc7[_0x38211c(0x290)](_0x38211c(0x138))),0x1;const _0x7164fa=await confirmKey(_0x38211c(0x1a2)+_0x2afd3d+_0x38211c(0x12d));if(!_0x7164fa)return console['error'](a54_0x371dc7[_0x38211c(0x27e)]('Cancelled')),0x1;}const _0x48a5fb=await withSpinner(_0x38211c(0x194)+_0x2afd3d+_0x38211c(0x126),()=>_0x2cf559['workflow'][_0x38211c(0x19f)](_0x2afd3d),{'verbose':_0x30056e[_0x38211c(0x24a)]}),_0x4ccd09=_0x48a5fb[_0x38211c(0x19d)];return console[_0x38211c(0x289)](_0x38211c(0xfa)+_0x4ccd09[_0x38211c(0x1a7)]),console[_0x38211c(0x289)]('\x20\x20Project\x20ID:\x20'+_0x4ccd09[_0x38211c(0x241)]),0x0;}}export function parseKeyValue(_0x5e2e5b){const _0x433501=a54_0x1b534b,_0x3171d2=_0x5e2e5b['indexOf']('=');if(_0x3171d2===-0x1)throw new Error('Invalid\x20format:\x20'+_0x5e2e5b+_0x433501(0x121));const _0x42ce5c=_0x5e2e5b[_0x433501(0x249)](0x0,_0x3171d2),_0x4ae5de=_0x5e2e5b[_0x433501(0x249)](_0x3171d2+0x1);if(!_0x42ce5c)throw new Error(_0x433501(0x10f));return{'key':_0x42ce5c,'value':_0x4ae5de};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x1b534b(0x196)]='workflow:secrets:list';[a54_0x1b534b(0x128)]=a54_0x1b534b(0x15d);async[a54_0x1b534b(0x18a)](_0xdfdd2c){const _0x419a3f=a54_0x1b534b,{options:_0x3d450a,args:_0x5abbe6,tdx:_0x3cace6}=_0xdfdd2c,_0x263b8f=this['requireProject'](_0x5abbe6,_0x3d450a);if(!_0x263b8f)return 0x1;_0x3d450a[_0x419a3f(0x24a)]&&console[_0x419a3f(0x289)](_0x419a3f(0x145)+_0x263b8f);const _0x537579=await withSpinner(_0x419a3f(0x165),()=>_0x3cace6[_0x419a3f(0x1ed)][_0x419a3f(0x2a5)](_0x263b8f),{'verbose':_0x3d450a['verbose']}),{secrets:_0x4dd03a}=_0x537579[_0x419a3f(0x19d)];return console[_0x419a3f(0x289)](_0x419a3f(0x27d)+_0x4dd03a['length']+'\x20secret'+(_0x4dd03a[_0x419a3f(0xfd)]!==0x1?'s':'')),await handleSDKOutput(_0x4dd03a,_0x3d450a),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x1b534b(0x196)]='workflow:secrets:set';[a54_0x1b534b(0x128)]=a54_0x1b534b(0x217);async[a54_0x1b534b(0x18a)](_0x5c4257){const _0x46e5af=a54_0x1b534b,{options:_0xd80eee,args:_0x37fc27,tdx:_0x1169f4}=_0x5c4257;let _0xce662e,_0x14c914;if(_0x37fc27[_0x46e5af(0xfd)]>=0x1&&!_0x37fc27[0x0][_0x46e5af(0x17c)]('='))_0xce662e=_0x37fc27[0x0],_0x14c914=_0x37fc27[_0x46e5af(0x18f)](0x1);else{if(_0x37fc27['length']>=0x1&&_0xd80eee[_0x46e5af(0xf7)])_0xce662e=_0xd80eee['workflowProject'],_0x14c914=_0x37fc27;else return _0x37fc27[_0x46e5af(0xfd)]>=0x1?(console[_0x46e5af(0x289)](_0x46e5af(0x106)),console[_0x46e5af(0x289)](_0x46e5af(0x26d)),0x1):(console[_0x46e5af(0x289)](_0x46e5af(0x188)),console[_0x46e5af(0x289)](_0x46e5af(0x1c3)),0x1);}if(_0x14c914[_0x46e5af(0xfd)]===0x0)return console[_0x46e5af(0x289)](_0x46e5af(0x188)),console[_0x46e5af(0x289)](_0x46e5af(0x1c3)),0x1;const _0x47c323={};try{for(const _0x4718d6 of _0x14c914){const {key:_0x346c5b,value:_0x4241f0}=parseKeyValue(_0x4718d6);_0x47c323[_0x346c5b]=_0x4241f0;}}catch(_0xe56b2a){return _0xe56b2a instanceof Error&&console['error'](a54_0x371dc7[_0x46e5af(0x16b)]('Error:'),_0xe56b2a[_0x46e5af(0x172)]),0x1;}const _0x4bae21=Object[_0x46e5af(0x215)](_0x47c323);_0xd80eee['verbose']&&(console[_0x46e5af(0x289)]('Project:\x20'+_0xce662e),console[_0x46e5af(0x289)](_0x46e5af(0x166)+_0x4bae21[_0x46e5af(0x133)](',\x20')));const _0xde51e2=await withSpinner(_0x4bae21['length']===0x1?_0x46e5af(0x1bd):_0x46e5af(0x239)+_0x4bae21['length']+_0x46e5af(0xf5),()=>_0x1169f4['workflow'][_0x46e5af(0x10c)](_0xce662e,_0x47c323),{'verbose':_0xd80eee[_0x46e5af(0x24a)]}),_0x31490d=_0xde51e2['data'];return console[_0x46e5af(0x289)](_0x4bae21[_0x46e5af(0xfd)]===0x1?_0x46e5af(0x187)+_0x31490d['keys'][0x0]+_0x46e5af(0xf1)+_0x31490d['projectName']+'\x27':'✔\x20'+_0x31490d[_0x46e5af(0x215)][_0x46e5af(0xfd)]+_0x46e5af(0x191)+_0x31490d[_0x46e5af(0x1a7)]+'\x27'),(_0xd80eee['json']||_0xd80eee[_0x46e5af(0x118)])&&await handleSingleObjectOutput(_0x31490d,_0xd80eee),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']='workflow:secrets:delete';[a54_0x1b534b(0x128)]='Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project';async[a54_0x1b534b(0x18a)](_0x512b60){const _0x464fc6=a54_0x1b534b,{options:_0x4d8617,args:_0x3c20ee,tdx:_0x44e00d}=_0x512b60;let _0x1e97ee,_0x4c5488;if(_0x3c20ee[_0x464fc6(0xfd)]>=0x2)_0x1e97ee=_0x3c20ee[0x0],_0x4c5488=_0x3c20ee[0x1];else{if(_0x3c20ee[_0x464fc6(0xfd)]===0x1&&_0x4d8617[_0x464fc6(0xf7)])_0x1e97ee=_0x4d8617[_0x464fc6(0xf7)],_0x4c5488=_0x3c20ee[0x0];else return _0x3c20ee[_0x464fc6(0xfd)]===0x1?(console['error']('Error:\x20Project\x20name\x20is\x20required'),console[_0x464fc6(0x289)](_0x464fc6(0x26d)),0x1):(console['error']('Error:\x20Secret\x20key\x20is\x20required'),console['error'](_0x464fc6(0x1f1)),0x1);}_0x4d8617[_0x464fc6(0x24a)]&&(console[_0x464fc6(0x289)](_0x464fc6(0x145)+_0x1e97ee),console['error']('Key:\x20'+_0x4c5488));if(!_0x4d8617[_0x464fc6(0x109)]){if(!isInteractive())return console[_0x464fc6(0x289)](a54_0x371dc7[_0x464fc6(0x16b)](_0x464fc6(0x1d8)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x464fc6(0x289)](a54_0x371dc7['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4c4cfc=await confirmKey(_0x464fc6(0x216)+_0x4c5488+_0x464fc6(0x14e)+_0x1e97ee+'\x27?');if(!_0x4c4cfc)return console[_0x464fc6(0x289)](a54_0x371dc7['yellow'](_0x464fc6(0x246))),0x1;}const _0x1699af=await withSpinner('Deleting\x20secret...',()=>_0x44e00d[_0x464fc6(0x1ed)][_0x464fc6(0xfc)](_0x1e97ee,_0x4c5488),{'verbose':_0x4d8617[_0x464fc6(0x24a)]}),_0x5863a1=_0x1699af['data'];return console[_0x464fc6(0x289)](_0x464fc6(0x187)+_0x5863a1[_0x464fc6(0x1e4)]+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x5863a1['projectName']+'\x27'),(_0x4d8617['json']||_0x4d8617[_0x464fc6(0x118)])&&await handleSingleObjectOutput(_0x5863a1,_0x4d8617),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(_0x4817cd){const _0x2f59fd=a54_0x1b534b,_0x56a4d8=Math['floor'](_0x4817cd/0x3e8),_0x3c4075=Math[_0x2f59fd(0x16c)](_0x56a4d8/0x3c),_0xef565a=Math[_0x2f59fd(0x16c)](_0x3c4075/0x3c),_0x597689=Math['floor'](_0xef565a/0x18);if(_0x597689>0x0){const _0x74e058=_0xef565a%0x18;return _0x74e058>0x0?_0x597689+'d\x20'+_0x74e058+'h':_0x597689+'d';}else{if(_0xef565a>0x0){const _0x5244bb=_0x3c4075%0x3c;return _0x5244bb>0x0?_0xef565a+'h\x20'+_0x5244bb+'m':_0xef565a+'h';}else{if(_0x3c4075>0x0){const _0x5eaad3=_0x56a4d8%0x3c;return _0x5eaad3>0x0?_0x3c4075+'m\x20'+_0x5eaad3+'s':_0x3c4075+'m';}else return _0x56a4d8+'s';}}}function formatTimestamp(_0x10d63f,_0x2adcc7){const _0x58b939=a54_0x1b534b,_0x33eead=new Date(_0x10d63f),_0x338629=String(_0x33eead[_0x58b939(0x26e)]())[_0x58b939(0x1b1)](0x2,'0'),_0x5c6072=String(_0x33eead['getMinutes']())[_0x58b939(0x1b1)](0x2,'0'),_0x5e2288=_0x338629+':'+_0x5c6072,_0x2022fe=_0x33eead['getFullYear']()===_0x2adcc7[_0x58b939(0x1f0)]()&&_0x33eead[_0x58b939(0x15f)]()===_0x2adcc7[_0x58b939(0x15f)]()&&_0x33eead['getDate']()===_0x2adcc7[_0x58b939(0x22b)]();if(_0x2022fe)return _0x5e2288;else{const _0x9603f8=String(_0x33eead[_0x58b939(0x15f)]()+0x1)[_0x58b939(0x1b1)](0x2,'0'),_0x3f2eea=String(_0x33eead[_0x58b939(0x22b)]())['padStart'](0x2,'0');return _0x9603f8+'-'+_0x3f2eea+'\x20'+_0x5e2288;}}function formatDate(_0x49bbf1){const _0x20d0ae=a54_0x1b534b,_0x17d5a0=_0x49bbf1[_0x20d0ae(0x1f0)](),_0x1f8fdd=String(_0x49bbf1['getMonth']()+0x1)[_0x20d0ae(0x1b1)](0x2,'0'),_0x628387=String(_0x49bbf1[_0x20d0ae(0x22b)]())[_0x20d0ae(0x1b1)](0x2,'0');return _0x17d5a0+'-'+_0x1f8fdd+'-'+_0x628387;}function getTaskStateIcon(_0x1983f3){const _0x10a2e9={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x10a2e9[_0x1983f3]||'⚪';}function getBarChar(_0x4641e8){const _0x2ee9e2=a54_0x1b534b;return _0x4641e8===_0x2ee9e2(0x289)||_0x4641e8===_0x2ee9e2(0x1b2)?'×':'─';}function getBarColor(_0x5a3658){const _0x40ca4f=a54_0x1b534b,_0x1e0ab5={'success':a54_0x371dc7['green'],'error':a54_0x371dc7[_0x40ca4f(0x16b)],'group_error':a54_0x371dc7['red'],'running':a54_0x371dc7[_0x40ca4f(0x202)],'blocked':a54_0x371dc7[_0x40ca4f(0x27e)],'planned':a54_0x371dc7[_0x40ca4f(0x290)],'canceling':a54_0x371dc7[_0x40ca4f(0x27e)]};return _0x1e0ab5[_0x5a3658]||a54_0x371dc7[_0x40ca4f(0x1f9)];}function parseTaskName(_0x5ef1c4){const _0x5bf98d=a54_0x1b534b;let _0x22cc8e=_0x5ef1c4['replace'](/^\++/,'');const _0x3d2bb6=_0x22cc8e['split']('+'),_0xf6e28b=_0x3d2bb6['length']>0x1?_0x3d2bb6[_0x5bf98d(0xfd)]-0x2:0x0,_0x5ccae6=_0x3d2bb6[_0x3d2bb6[_0x5bf98d(0xfd)]-0x1]||_0x22cc8e;return{'level':_0xf6e28b,'name':'+'+_0x5ccae6};}function truncateTaskName(_0x483434,_0x3747ce){const _0x44111d=a54_0x1b534b,_0x11796a=stringWidth(_0x483434);if(_0x11796a<=_0x3747ce)return _0x483434;let _0x428698=_0x483434;while(stringWidth(_0x428698+'…')>_0x3747ce&&_0x428698[_0x44111d(0xfd)]>0x0){_0x428698=_0x428698['slice'](0x0,-0x1);}return _0x428698+'…';}function a54_0x1eec(_0x259604,_0x25cfc2){_0x259604=_0x259604-0xea;const _0x2d23dd=a54_0x2d23();let _0x1eec4c=_0x2d23dd[_0x259604];return _0x1eec4c;}function calculateTimeScale(_0x29de71,_0x106e26){const _0x564b0d=a54_0x1b534b;return{'startTime':_0x29de71[_0x564b0d(0x184)],'endTime':_0x29de71[_0x564b0d(0x11b)],'durationMs':_0x29de71[_0x564b0d(0xf0)],'msPerChar':_0x29de71[_0x564b0d(0xf0)]/_0x106e26};}function timeToPosition(_0x14665b,_0xd158f4,_0x43bd8e){const _0x124710=a54_0x1b534b,_0x325010=_0x14665b-_0xd158f4[_0x124710(0x10d)],_0x597002=Math[_0x124710(0x16c)](_0x325010/_0xd158f4[_0x124710(0x1cc)]);return Math[_0x124710(0x181)](0x0,Math['min'](_0x597002,_0x43bd8e));}function renderTimeAxis(_0x8b00ba,_0x31e6a1){const _0x54e790=a54_0x1b534b,_0x2b98bc=Math[_0x54e790(0xf9)](TIMELINE_CONFIG[_0x54e790(0x182)],Math[_0x54e790(0x181)](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math[_0x54e790(0x16c)](_0x31e6a1/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x5916ee=_0x8b00ba[_0x54e790(0x25f)]/(_0x2b98bc-0x1),_0x353d46=new Date(_0x8b00ba['startTime']),_0x58efba=[];for(let _0x44d854=0x0;_0x44d854<_0x2b98bc;_0x44d854++){const _0x193004=_0x8b00ba['startTime']+_0x44d854*_0x5916ee,_0x376acf=timeToPosition(_0x193004,_0x8b00ba,_0x31e6a1),_0x5aa1f1=formatTimestamp(_0x193004,_0x353d46);_0x58efba[_0x54e790(0x170)]({'pos':_0x376acf,'text':_0x5aa1f1});}const _0x50914e=new Array(_0x31e6a1)[_0x54e790(0x20f)]('\x20');let _0x32ec2f=-0x1;for(const {pos:_0xb6ad5d,text:_0x54561b}of _0x58efba){let _0x1dbcee=Math[_0x54e790(0x181)](0x0,_0xb6ad5d-Math['floor'](_0x54561b['length']/0x2));_0x1dbcee<=_0x32ec2f+TIMELINE_CONFIG[_0x54e790(0xed)]&&(_0x1dbcee=_0x32ec2f+TIMELINE_CONFIG[_0x54e790(0xed)]+0x1);_0x1dbcee+_0x54561b[_0x54e790(0xfd)]>_0x31e6a1&&(_0x1dbcee=_0x31e6a1-_0x54561b[_0x54e790(0xfd)]);if(_0x1dbcee>=0x0&&_0x1dbcee+_0x54561b[_0x54e790(0xfd)]<=_0x31e6a1&&_0x1dbcee>_0x32ec2f){for(let _0x150615=0x0;_0x150615<_0x54561b[_0x54e790(0xfd)];_0x150615++){_0x50914e[_0x1dbcee+_0x150615]=_0x54561b[_0x150615];}_0x32ec2f=_0x1dbcee+_0x54561b[_0x54e790(0xfd)]-0x1;}}return _0x50914e['join']('');}function renderTaskRow(_0x1887ef,_0x1f3aea,_0x2d6032,_0xc1a1a4){const _0x37251c=a54_0x1b534b,{level:_0x5ec66f,name:_0xe66b5b}=parseTaskName(_0x1887ef[_0x37251c(0x196)]),_0x29997b='\x20'['repeat'](_0x5ec66f),_0x15f2bb=_0x1887ef[_0x37251c(0x1c7)]?'('+formatElapsed(_0x1887ef[_0x37251c(0x1c7)][_0x37251c(0xf0)])+')':'',_0x211ee9=stringWidth(_0x15f2bb),_0x3a5350=_0x5ec66f*0x1,_0x582645=_0xc1a1a4-_0x3a5350-_0x211ee9-0x1,_0x3a7668=truncateTaskName(_0xe66b5b,_0x582645),_0x44cfe6=_0x29997b+_0x3a7668,_0x47f51f=stringWidth(_0x44cfe6),_0x55ab9c=_0xc1a1a4-_0x47f51f-_0x211ee9,_0x17c6d0=_0x44cfe6+'\x20'[_0x37251c(0x20b)](Math[_0x37251c(0x181)](0x1,_0x55ab9c))+a54_0x371dc7[_0x37251c(0x290)](_0x15f2bb),_0x43919e=getTaskStateIcon(_0x1887ef['state']),_0x3e4cd6=new Array(_0x2d6032)['fill']('\x20');if(_0x1887ef[_0x37251c(0x1c7)]){const _0x12d8c5=timeToPosition(_0x1887ef[_0x37251c(0x1c7)]['start'],_0x1f3aea,_0x2d6032),_0x141383=timeToPosition(_0x1887ef[_0x37251c(0x1c7)][_0x37251c(0x11b)],_0x1f3aea,_0x2d6032),_0x33e737=getBarChar(_0x1887ef[_0x37251c(0x1a6)]),_0x14d2a=Math[_0x37251c(0x181)](_0x12d8c5+0x1,_0x141383);for(let _0x4181df=_0x12d8c5;_0x4181df<Math['min'](_0x14d2a,_0x2d6032);_0x4181df++){_0x3e4cd6[_0x4181df]=_0x33e737;}}const _0x979b0c=getBarColor(_0x1887ef['state']),_0x39911c=_0x3e4cd6['map'](_0x5da0ac=>_0x5da0ac==='\x20'?'\x20':_0x979b0c(_0x5da0ac))['join']('');return _0x43919e+'\x20'+_0x17c6d0+'│'+_0x39911c+'│';}function calculateStats(_0x2e1810){const _0x4ce964=a54_0x1b534b,_0x522fe8={'total':_0x2e1810[_0x4ce964(0xfd)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x4c9f82 of _0x2e1810){if(_0x4c9f82[_0x4ce964(0x1a6)]===_0x4ce964(0x1df))_0x522fe8[_0x4ce964(0x1df)]++;else{if(_0x4c9f82['state']===_0x4ce964(0x289)||_0x4c9f82[_0x4ce964(0x1a6)]===_0x4ce964(0x1b2))_0x522fe8[_0x4ce964(0x289)]++;else _0x4c9f82[_0x4ce964(0x1a6)]==='running'?_0x522fe8[_0x4ce964(0x104)]++:_0x522fe8['pending']++;}}return _0x522fe8;}function formatStats(_0x353af4){const _0x2e6762=a54_0x1b534b;return[_0x2e6762(0x274)+_0x353af4[_0x2e6762(0x271)],'✅\x20'+_0x353af4['success'],'❌\x20'+_0x353af4[_0x2e6762(0x289)],_0x2e6762(0x209)+_0x353af4[_0x2e6762(0x104)],'⏳\x20'+_0x353af4[_0x2e6762(0x19b)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x14b);['description']='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a54_0x1b534b(0x18a)](_0x1fdb69){const _0x1ec420=a54_0x1b534b,{options:_0x26c747,args:_0x43aabd,tdx:_0x26e11c}=_0x1fdb69;let _0x399713,_0x4c0889,_0x148dab=![];if(_0x43aabd[0x0]){if(_0x43aabd[0x0][_0x1ec420(0x17c)]('.')){const _0x261901=this[_0x1ec420(0x29d)](_0x43aabd,_0x26c747);if(!_0x261901)return 0x1;_0x399713=_0x261901[_0x1ec420(0x1a7)],_0x4c0889=_0x261901[_0x1ec420(0xf2)];}else{_0x4c0889=_0x43aabd[0x0],_0x399713=_0x26c747['workflowProject'];if(!_0x399713)return console[_0x1ec420(0x289)](a54_0x371dc7[_0x1ec420(0x16b)]('Error:'),_0x1ec420(0xff)),0x1;_0x148dab=!![];}}else{const _0x454c3=this['parseProjectWorkflowPattern'](_0x43aabd,_0x26c747);if(!_0x454c3)return 0x1;_0x399713=_0x454c3[_0x1ec420(0x1a7)],_0x4c0889=_0x454c3[_0x1ec420(0xf2)];}if(_0x26c747[_0x1ec420(0x24a)]){if(_0x399713&&_0x4c0889)console[_0x1ec420(0x289)](_0x1ec420(0x1e7)+_0x399713+'.'+_0x4c0889);else _0x399713&&console['error'](_0x1ec420(0x1c9)+_0x399713);}const _0x100361=_0x26c747['attemptId'],_0x4fc054=_0x26c747['sessionId'];if(_0x100361){_0x4fc054&&console[_0x1ec420(0x289)](a54_0x371dc7[_0x1ec420(0x27e)](_0x1ec420(0x1e8)),_0x1ec420(0x226));const _0x35f807=_0x26c747[_0x1ec420(0x1ec)];return _0x35f807?await this['pollTimeline'](_0x1fdb69,_0x100361):await this[_0x1ec420(0x257)](_0x1fdb69,_0x100361,_0x26c747),0x0;}if(_0x4fc054){const _0x34af6b=await withSpinner(_0x1ec420(0x158),()=>_0x26e11c[_0x1ec420(0x1ed)][_0x1ec420(0x266)]({'projectName':_0x399713,'workflowName':_0x4c0889,'limit':0x64}),{'verbose':_0x26c747[_0x1ec420(0x24a)]}),_0x498264=_0x34af6b['data']['find'](_0x2e632a=>_0x2e632a['id']===_0x4fc054);if(!_0x498264)return console['error'](a54_0x371dc7[_0x1ec420(0x16b)](_0x1ec420(0x1c8)),_0x1ec420(0x1dc)+_0x4fc054),0x1;if(!_0x498264[_0x1ec420(0x204)]?.['id'])return console[_0x1ec420(0x289)](a54_0x371dc7[_0x1ec420(0x16b)](_0x1ec420(0x1c8)),'Session\x20'+_0x4fc054+'\x20has\x20no\x20attempts'),0x1;const _0x8b5008=_0x498264['lastAttempt']['id'];_0x26c747[_0x1ec420(0x24a)]&&console[_0x1ec420(0x289)](_0x1ec420(0x23b)+_0x8b5008+_0x1ec420(0x179)+_0x4fc054);const _0x75a5b2=_0x26c747['follow'];return _0x75a5b2?await this['pollTimeline'](_0x1fdb69,_0x8b5008):await this[_0x1ec420(0x257)](_0x1fdb69,_0x8b5008,_0x26c747),0x0;}const _0x45cb53=await withSpinner(_0x1ec420(0x1fd),()=>_0x26e11c[_0x1ec420(0x1ed)][_0x1ec420(0x266)]({'projectName':_0x399713,'workflowName':_0x4c0889,'limit':_0x26c747[_0x1ec420(0x12b)]||0x32}),{'verbose':_0x26c747[_0x1ec420(0x24a)]}),_0x43feb2=_0x45cb53[_0x1ec420(0x19d)];if(_0x43feb2[_0x1ec420(0xfd)]===0x0){if(_0x399713&&_0x4c0889)console[_0x1ec420(0x289)](_0x1ec420(0x276)+_0x399713+'.'+_0x4c0889);else _0x399713?console[_0x1ec420(0x289)](_0x1ec420(0x151)+_0x399713):(console[_0x1ec420(0x289)](_0x1ec420(0x176)),console[_0x1ec420(0x289)](a54_0x371dc7['dim']('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x43feb2[_0x1ec420(0x136)]((_0x151f91,_0x3ba96d)=>{const _0x462255=_0x1ec420,_0x250494=_0x151f91['sessionTime']||'',_0x40a06f=_0x3ba96d['sessionTime']||'';return _0x40a06f[_0x462255(0x124)](_0x250494);});if(_0x26c747['json']||_0x26c747[_0x1ec420(0x118)])return await handleSDKOutput(_0x43feb2,_0x26c747),0x0;let _0x27d395;if(_0x148dab){const _0x40107e=_0x43feb2[0x0];if(!_0x40107e[_0x1ec420(0x204)]?.['id'])return console[_0x1ec420(0x289)](_0x1ec420(0x15b)),0x0;_0x27d395=_0x40107e['lastAttempt']['id'],_0x26c747['verbose']&&console[_0x1ec420(0x289)](_0x1ec420(0x294)+_0x40107e[_0x1ec420(0x21b)]);}else{const _0x1c186e=_0x43feb2['map'](_0x2a0336=>{const _0x472b4b=_0x1ec420,_0x14ea47=getAttemptStatusDisplay(_0x2a0336['lastAttempt']);return{'title':_0x2a0336['project']?.['name']+'.'+_0x2a0336[_0x472b4b(0x1ed)]?.[_0x472b4b(0x196)]+_0x472b4b(0x1c0)+_0x2a0336[_0x472b4b(0x21b)]+'\x20'+_0x14ea47[_0x472b4b(0x262)],'value':_0x2a0336[_0x472b4b(0x204)]?.['id']||'','description':_0x14ea47[_0x472b4b(0x20d)]};}),_0x1fe435=await a54_0x547977({'type':_0x1ec420(0x22e),'name':_0x1ec420(0x1b0),'message':_0x1ec420(0x1fb),'choices':_0x1c186e[_0x1ec420(0xee)](_0xd6ca75=>_0xd6ca75['value']!=='')});if(!_0x1fe435['attemptId'])return 0x0;_0x27d395=_0x1fe435['attemptId'];}const _0x5ec799=_0x26c747[_0x1ec420(0x1ec)];return _0x5ec799?await this[_0x1ec420(0x1f2)](_0x1fdb69,_0x27d395):await this['renderSingleTimeline'](_0x1fdb69,_0x27d395,_0x26c747),0x0;}async[a54_0x1b534b(0x257)](_0x5a210f,_0x480c33,_0x40422a){const _0x72ae80=a54_0x1b534b,{tdx:_0x9ac133}=_0x5a210f;let _0x15cddb,_0x2896c1;try{[_0x15cddb,_0x2896c1]=await Promise[_0x72ae80(0x1d3)]([_0x9ac133[_0x72ae80(0x1ed)][_0x72ae80(0x268)](_0x480c33),_0x9ac133['workflow'][_0x72ae80(0x260)](_0x480c33,![])]);}catch(_0x266c4a){console['error'](a54_0x371dc7[_0x72ae80(0x16b)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x40422a[_0x72ae80(0x24a)]&&console[_0x72ae80(0x289)](_0x266c4a);throw _0x266c4a;}if(_0x40422a[_0x72ae80(0x210)]||_0x40422a[_0x72ae80(0x118)]){const _0x3a667c=this[_0x72ae80(0x140)](_0x15cddb,_0x2896c1);await handleSDKOutput([_0x3a667c],_0x40422a);return;}const _0x425fb5=_0x9ac133['context'][_0x72ae80(0x14a)],_0x47d40a=this[_0x72ae80(0x1b4)](_0x15cddb,_0x2896c1,_0x425fb5);console[_0x72ae80(0x156)](_0x47d40a);}async['pollTimeline'](_0x552d57,_0x2bc16d){const _0x3b03f5=a54_0x1b534b,{tdx:_0x3c2751}=_0x552d57,_0x2c8534=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x28d76d=TIMELINE_CONFIG[_0x3b03f5(0x190)];let _0x34d4ae=0x0;while(_0x34d4ae<_0x28d76d){process[_0x3b03f5(0x132)][_0x3b03f5(0x1ab)]&&process[_0x3b03f5(0x132)]['write']('\x1bc');let _0x339cd2,_0x30e21a;try{[_0x339cd2,_0x30e21a]=await Promise[_0x3b03f5(0x1d3)]([_0x3c2751['workflow'][_0x3b03f5(0x268)](_0x2bc16d),_0x3c2751[_0x3b03f5(0x1ed)]['tasks'](_0x2bc16d,![])]);}catch(_0x400c88){console[_0x3b03f5(0x289)](a54_0x371dc7[_0x3b03f5(0x16b)](_0x3b03f5(0x277)));_0x34d4ae>0x0&&console['error'](a54_0x371dc7[_0x3b03f5(0x290)](_0x3b03f5(0x122)+_0x34d4ae));throw _0x400c88;}const _0x25c408=_0x3c2751[_0x3b03f5(0x160)][_0x3b03f5(0x14a)],_0x8538d0=this['renderTimeline'](_0x339cd2,_0x30e21a,_0x25c408);console[_0x3b03f5(0x156)](_0x8538d0);const _0x207d93=_0x339cd2['done']&&_0x30e21a['every'](_0x34ec63=>_0x34ec63[_0x3b03f5(0x1a6)]!=='running'&&_0x34ec63['state']!==_0x3b03f5(0x1c6));if(_0x207d93){console['error'](a54_0x371dc7[_0x3b03f5(0x1cb)](_0x3b03f5(0x1ac)));break;}console[_0x3b03f5(0x289)](a54_0x371dc7[_0x3b03f5(0x290)](_0x3b03f5(0x230)+_0x34d4ae*0x2+_0x3b03f5(0x1a1))),await new Promise(_0x59878d=>setTimeout(_0x59878d,_0x2c8534)),_0x34d4ae++;}_0x34d4ae>=_0x28d76d&&console[_0x3b03f5(0x289)](a54_0x371dc7[_0x3b03f5(0x27e)](_0x3b03f5(0x2a6)));}['renderTimeline'](_0x442bf2,_0x4eeeb0,_0x5f30c5){const _0x3bb9ff=a54_0x1b534b,_0xead01a=[],_0x828f63=TIMELINE_CONFIG[_0x3bb9ff(0x208)],_0x5284b6=0x5,_0x3e0fa5=process[_0x3bb9ff(0x132)][_0x3bb9ff(0x1bf)]||0x78,_0x33212e=_0x3e0fa5-_0x828f63-_0x5284b6,_0x2e08ba=Math[_0x3bb9ff(0x181)](TIMELINE_CONFIG[_0x3bb9ff(0x29b)],Math[_0x3bb9ff(0xf9)](_0x33212e,TIMELINE_CONFIG[_0x3bb9ff(0x298)])),_0x25a55a=new Date(_0x442bf2[_0x3bb9ff(0x1f7)])[_0x3bb9ff(0x127)](),_0x26c947=_0x442bf2[_0x3bb9ff(0x18e)]?new Date(_0x442bf2[_0x3bb9ff(0x18e)])['getTime']():Date['now'](),_0x4ed2d9={'start':_0x25a55a,'end':_0x26c947,'duration':_0x26c947-_0x25a55a},_0x1fddad=new Map(),_0x4eb06d=[];for(const _0x465b81 of _0x4eeeb0){if(_0x465b81[_0x3bb9ff(0x17a)]){const _0x5d63d1=new Date(_0x465b81['startedAt'])[_0x3bb9ff(0x127)](),_0x30e6c0=_0x465b81['updatedAt']?new Date(_0x465b81[_0x3bb9ff(0x247)])[_0x3bb9ff(0x127)]():Date[_0x3bb9ff(0x282)](),_0x59de7b={'start':_0x5d63d1,'end':_0x30e6c0,'duration':_0x30e6c0-_0x5d63d1};_0x1fddad[_0x3bb9ff(0x1d0)](_0x465b81['id'],_0x59de7b),_0x4eb06d[_0x3bb9ff(0x170)]({'name':_0x465b81[_0x3bb9ff(0x119)],'state':_0x465b81[_0x3bb9ff(0x1a6)]||'unknown','window':_0x59de7b});}else _0x4eb06d[_0x3bb9ff(0x170)]({'name':_0x465b81[_0x3bb9ff(0x119)],'state':_0x465b81['state']||_0x3bb9ff(0x1c6),'window':undefined});}_0x4eb06d[_0x3bb9ff(0x136)]((_0x52e140,_0x129b3d)=>{const _0xc5fe17=_0x3bb9ff;if(!_0x52e140[_0xc5fe17(0x1c7)])return 0x1;if(!_0x129b3d['window'])return-0x1;return _0x52e140[_0xc5fe17(0x1c7)]['start']-_0x129b3d['window']['start'];});const _0x59c7ee=_0x4eb06d[_0x3bb9ff(0xfd)],_0x5566c7=_0x59c7ee>TIMELINE_CONFIG[_0x3bb9ff(0x252)];_0x5566c7&&_0x4eb06d['splice'](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0xdfb55f=calculateTimeScale(_0x4ed2d9,_0x2e08ba),_0x2069fd=_0x442bf2['done']?_0x442bf2[_0x3bb9ff(0x1df)]?a54_0x371dc7[_0x3bb9ff(0x1cb)](_0x3bb9ff(0x1df)):a54_0x371dc7['red'](_0x3bb9ff(0x289)):a54_0x371dc7[_0x3bb9ff(0x202)](_0x3bb9ff(0x104)),_0x294fe7=_0x442bf2[_0x3bb9ff(0x13c)]?.['id'],_0x5872c0=_0x442bf2['sessionId'];let _0x38e8d1;if(_0x294fe7&&_0x5872c0){const _0x5bfafe=getWorkflowAttemptUrl(_0x5f30c5,_0x294fe7,_0x5872c0,_0x442bf2['id']);_0x38e8d1=hyperlink(a54_0x371dc7[_0x3bb9ff(0x290)](_0x442bf2['id']),_0x5bfafe);}else _0x38e8d1=a54_0x371dc7[_0x3bb9ff(0x290)](_0x442bf2['id']);_0xead01a[_0x3bb9ff(0x170)](_0x3bb9ff(0x15a)+_0x38e8d1+_0x3bb9ff(0x1c0)+_0x2069fd+_0x3bb9ff(0x1c0)+formatElapsed(_0x4ed2d9[_0x3bb9ff(0xf0)]));if(_0x4eb06d[_0x3bb9ff(0xfd)]>0x0){const _0x3d206c=renderTimeAxis(_0xdfb55f,_0x2e08ba),_0x2c8d51=new Date(_0x4ed2d9[_0x3bb9ff(0x184)]),_0x2b9899=formatDate(_0x2c8d51),_0x280379=TIMELINE_CONFIG[_0x3bb9ff(0x272)]+TIMELINE_CONFIG[_0x3bb9ff(0x167)]+_0x828f63,_0x1a2eb7=_0x2b9899[_0x3bb9ff(0x1b1)](_0x280379),_0x42cca5=a54_0x371dc7['dim'](_0x1a2eb7);_0xead01a['push'](_0x42cca5+'\x20'+_0x3d206c);for(const _0x45c561 of _0x4eb06d){_0xead01a['push'](renderTaskRow(_0x45c561,_0xdfb55f,_0x2e08ba,_0x828f63));}const _0x2b8fac=calculateStats(_0x4eb06d);_0xead01a['push'](formatStats(_0x2b8fac)),_0x5566c7&&_0xead01a[_0x3bb9ff(0x170)](a54_0x371dc7['yellow'](_0x3bb9ff(0x189)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+'\x20of\x20'+_0x59c7ee+_0x3bb9ff(0x22c))),_0xead01a['push'](''),_0xead01a[_0x3bb9ff(0x170)](a54_0x371dc7[_0x3bb9ff(0x290)](_0x3bb9ff(0x169))+(_0x3bb9ff(0x223)+_0x442bf2['id']+_0x3bb9ff(0x173))+a54_0x371dc7[_0x3bb9ff(0x290)](_0x3bb9ff(0x27f)));}else _0xead01a[_0x3bb9ff(0x170)](_0x3bb9ff(0x1ae));return _0xead01a[_0x3bb9ff(0x133)]('\x0a');}[a54_0x1b534b(0x140)](_0x42c304,_0x144574){const _0x5bd517=a54_0x1b534b,_0x1fb4b9=new Date(_0x42c304['createdAt'])[_0x5bd517(0x127)](),_0x1740d7=_0x42c304[_0x5bd517(0x18e)]?new Date(_0x42c304[_0x5bd517(0x18e)])[_0x5bd517(0x127)]():Date[_0x5bd517(0x282)](),_0x23ab30=_0x1740d7-_0x1fb4b9,_0x3a11f5=[];for(const _0x157ac3 of _0x144574){if(_0x157ac3['startedAt']){const _0x47a22d=new Date(_0x157ac3[_0x5bd517(0x17a)])[_0x5bd517(0x127)](),_0x5d3176=_0x157ac3['updatedAt']?new Date(_0x157ac3[_0x5bd517(0x247)])[_0x5bd517(0x127)]():Date[_0x5bd517(0x282)]();_0x3a11f5[_0x5bd517(0x170)]({'name':_0x157ac3[_0x5bd517(0x119)],'state':_0x157ac3['state']||'unknown','window':{'start':_0x47a22d,'end':_0x5d3176,'duration':_0x5d3176-_0x47a22d}});}else _0x3a11f5[_0x5bd517(0x170)]({'name':_0x157ac3[_0x5bd517(0x119)],'state':_0x157ac3[_0x5bd517(0x1a6)]||_0x5bd517(0x1c6),'window':undefined});}const _0x4fa85e=calculateStats(_0x3a11f5);return{'attempt':{'id':_0x42c304['id'],'status':_0x42c304[_0x5bd517(0x2a0)]?_0x42c304[_0x5bd517(0x1df)]?'success':_0x5bd517(0x289):_0x5bd517(0x104),'createdAt':_0x42c304[_0x5bd517(0x1f7)],'finishedAt':_0x42c304['finishedAt'],'duration_ms':_0x23ab30},'tasks':_0x3a11f5[_0x5bd517(0x284)](_0x209bf6=>({'name':_0x209bf6['name'],'state':_0x209bf6[_0x5bd517(0x1a6)],'startedAt':_0x209bf6[_0x5bd517(0x1c7)]?new Date(_0x209bf6[_0x5bd517(0x1c7)][_0x5bd517(0x184)])[_0x5bd517(0x240)]():null,'updatedAt':_0x209bf6['window']?new Date(_0x209bf6['window'][_0x5bd517(0x11b)])[_0x5bd517(0x240)]():null,'duration_ms':_0x209bf6[_0x5bd517(0x1c7)]?.[_0x5bd517(0xf0)]||null})),'stats':_0x4fa85e};}}export class WorkflowSchedulesCommand extends BaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x299);['description']='List\x20workflow\x20schedules';async['execute'](_0x59459e){const _0x517b1e=a54_0x1b534b,{options:_0x3aa74a,tdx:_0x504f78}=_0x59459e,_0x26b5a7=await withSpinner(_0x517b1e(0xef),()=>_0x504f78[_0x517b1e(0x1ed)][_0x517b1e(0x1da)](),{'verbose':_0x3aa74a[_0x517b1e(0x24a)]}),_0x7c67fc=_0x26b5a7['data'];console[_0x517b1e(0x289)](_0x517b1e(0x27d)+_0x7c67fc[_0x517b1e(0xfd)]+_0x517b1e(0x1ce)+(_0x7c67fc['length']!==0x1?'s':''));if(isStructuredFormat(_0x3aa74a))await handleSDKOutput(_0x7c67fc,_0x3aa74a);else{if(_0x7c67fc[_0x517b1e(0xfd)]===0x0)console[_0x517b1e(0x156)]('No\x20schedules\x20found');else for(const _0x4afdaa of _0x7c67fc){const _0x19f7e5=_0x4afdaa[_0x517b1e(0x293)]?a54_0x371dc7['yellow'](_0x517b1e(0x286)):'',_0xfbb29=_0x4afdaa['project']?.[_0x517b1e(0x196)]?a54_0x371dc7['dim']('\x20['+_0x4afdaa[_0x517b1e(0x13c)]['name']+']'):'',_0xb3a5f=_0x4afdaa['nextRunTime']?a54_0x371dc7[_0x517b1e(0x290)](_0x517b1e(0x213)+new Date(_0x4afdaa['nextRunTime'])[_0x517b1e(0xf4)]()):'';console['log']('📅\x20#'+_0x4afdaa['id']+'\x20'+(_0x4afdaa['workflow']?.[_0x517b1e(0x196)]||_0x517b1e(0x22f))+_0xfbb29+_0x19f7e5+_0xb3a5f);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a54_0x1b534b(0x196)]='workflow:schedule:enable';[a54_0x1b534b(0x128)]=a54_0x1b534b(0x13a);async[a54_0x1b534b(0x18a)](_0x170429){const _0x476cca=a54_0x1b534b,{options:_0x1ee34c,args:_0x4bcf78,tdx:_0x29ad5a}=_0x170429,_0x426b12=_0x4bcf78[0x0];if(!_0x426b12)return console[_0x476cca(0x289)](a54_0x371dc7[_0x476cca(0x16b)]('Error:'),'Schedule\x20ID\x20is\x20required'),console[_0x476cca(0x289)](a54_0x371dc7[_0x476cca(0x290)](_0x476cca(0x12f))),console[_0x476cca(0x289)](a54_0x371dc7[_0x476cca(0x290)](_0x476cca(0x155))),0x1;const _0x4841f2=await withSpinner(_0x476cca(0x141)+_0x426b12+_0x476cca(0x126),()=>_0x29ad5a[_0x476cca(0x1ed)][_0x476cca(0x134)](_0x426b12),{'verbose':_0x1ee34c[_0x476cca(0x24a)]}),_0x544ece=_0x4841f2['data'];return isStructuredFormat(_0x1ee34c)?await handleSingleObjectOutput(_0x544ece,_0x1ee34c):(console['log'](_0x476cca(0x20c)+_0x426b12+_0x476cca(0x171)+(_0x544ece['workflow']?.[_0x476cca(0x196)]||'unknown')+')'),_0x544ece[_0x476cca(0x229)]&&console[_0x476cca(0x156)](a54_0x371dc7['dim']('\x20\x20Next\x20run:\x20'+new Date(_0x544ece[_0x476cca(0x229)])['toLocaleString']()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{['name']=a54_0x1b534b(0x243);['description']=a54_0x1b534b(0x11c);async[a54_0x1b534b(0x18a)](_0x53b9f3){const _0x5c2033=a54_0x1b534b,{options:_0x2d69ec,args:_0x5d998d,tdx:_0x31314c}=_0x53b9f3,_0x3b2459=_0x5d998d[0x0];if(!_0x3b2459)return console['error'](a54_0x371dc7[_0x5c2033(0x16b)](_0x5c2033(0x1c8)),_0x5c2033(0x1d9)),console[_0x5c2033(0x289)](a54_0x371dc7[_0x5c2033(0x290)]('Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>')),console[_0x5c2033(0x289)](a54_0x371dc7['dim']('Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs')),0x1;const _0x3c3947=await withSpinner('Disabling\x20schedule\x20#'+_0x3b2459+_0x5c2033(0x126),()=>_0x31314c[_0x5c2033(0x1ed)][_0x5c2033(0x1f3)](_0x3b2459),{'verbose':_0x2d69ec[_0x5c2033(0x24a)]}),_0x8851a1=_0x3c3947[_0x5c2033(0x19d)];return isStructuredFormat(_0x2d69ec)?await handleSingleObjectOutput(_0x8851a1,_0x2d69ec):console['log'](_0x5c2033(0x20c)+_0x3b2459+_0x5c2033(0x233)+(_0x8851a1['workflow']?.[_0x5c2033(0x196)]||_0x5c2033(0x1e3))+')'),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2b738e,_0x22dc27){const _0x39c3c0=a55_0x48b3,_0x50ff02=_0x2b738e();while(!![]){try{const _0x7225ff=parseInt(_0x39c3c0(0x91))/0x1*(-parseInt(_0x39c3c0(0x8b))/0x2)+parseInt(_0x39c3c0(0x90))/0x3*(parseInt(_0x39c3c0(0x85))/0x4)+parseInt(_0x39c3c0(0x97))/0x5*(parseInt(_0x39c3c0(0x8f))/0x6)+parseInt(_0x39c3c0(0x8a))/0x7*(-parseInt(_0x39c3c0(0x87))/0x8)+parseInt(_0x39c3c0(0x8e))/0x9+-parseInt(_0x39c3c0(0x86))/0xa+parseInt(_0x39c3c0(0x89))/0xb*(parseInt(_0x39c3c0(0x8d))/0xc);if(_0x7225ff===_0x22dc27)break;else _0x50ff02['push'](_0x50ff02['shift']());}catch(_0x1880cc){_0x50ff02['push'](_0x50ff02['shift']());}}}(a55_0x3c7f,0x52ea3));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 _0x2f15e8=a55_0x48b3,_0x272e28=getVersion(),_0xa37af7=platform(),_0x42125c=process[_0x2f15e8(0x98)][_0x2f15e8(0x93)]('v','');return'tdx/'+_0x272e28+'\x20('+_0xa37af7+_0x2f15e8(0x92)+_0x42125c+')';}export function getAuthHeaders(_0x3c012f,_0x18cccc,_0x168a9f){const _0x2c5dea=a55_0x48b3,_0x2a5a58=getVersion(),_0x8d7b3={'User-Agent':getUserAgent(),'X-TD-Client':_0x2c5dea(0x88),'X-TD-Client-Version':_0x2a5a58};if(_0x168a9f)_0x8d7b3[_0x2c5dea(0x99)]='Bearer\x20'+_0x168a9f;else _0x18cccc&&(_0x8d7b3[_0x2c5dea(0x99)]=_0x2c5dea(0x96)+_0x18cccc);return _0x8d7b3;}function a55_0x48b3(_0x41751c,_0x2c1c00){_0x41751c=_0x41751c-0x85;const _0x3c7f50=a55_0x3c7f();let _0x48b3bb=_0x3c7f50[_0x41751c];return _0x48b3bb;}function a55_0x3c7f(){const _0x2311ec=['11nXkhOx','7nhuFwn','482zZBSCW','X-Trino-User','6209364qXIbaz','5529834EHVxWE','12MVxoWd','253971dXSnTP','2091PwEvAo',';\x20node/','replace','length','entries','TD1\x20','535615DCQXPG','version','Authorization','8fEnIbx','6625860ifaGkF','74376ruPoYA','tdx'];a55_0x3c7f=function(){return _0x2311ec;};return a55_0x3c7f();}export function toHeaderRecord(_0x2fe788){const _0x123212=a55_0x48b3,_0x4e42e4={};for(const [_0x19eed9,_0x25578c]of Object[_0x123212(0x95)](_0x2fe788)){_0x25578c!==undefined&&(_0x4e42e4[_0x19eed9]=_0x25578c);}return _0x4e42e4;}export function getTrinoHeaders(_0x18d688,_0xf702f7,_0x450ee6){const _0x4fbd38=a55_0x48b3,_0x265ed8=getAuthHeaders(_0x18d688),_0x897a44=toHeaderRecord(_0x265ed8);if(_0x450ee6)_0x897a44[_0x4fbd38(0x99)]='Bearer\x20'+_0x450ee6;else _0xf702f7&&(_0x897a44[_0x4fbd38(0x8c)]=_0xf702f7);return _0x897a44;}export function hasAPIKey(_0x5b9427){const _0x1f5731=a55_0x48b3,_0x11e110=getAPIKey();return _0x11e110!==undefined&&_0x11e110[_0x1f5731(0x94)]>0x0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x52cc88,_0x5942d2){const _0x46b0d2=a56_0x4084,_0x21772a=_0x52cc88();while(!![]){try{const _0x3750f2=-parseInt(_0x46b0d2(0x117))/0x1*(parseInt(_0x46b0d2(0x11b))/0x2)+parseInt(_0x46b0d2(0x123))/0x3+-parseInt(_0x46b0d2(0x10a))/0x4+-parseInt(_0x46b0d2(0x12c))/0x5+-parseInt(_0x46b0d2(0xf8))/0x6+-parseInt(_0x46b0d2(0x132))/0x7+parseInt(_0x46b0d2(0x105))/0x8;if(_0x3750f2===_0x5942d2)break;else _0x21772a['push'](_0x21772a['shift']());}catch(_0x5a3700){_0x21772a['push'](_0x21772a['shift']());}}}(a56_0x6e21,0xcb353));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';function a56_0x4084(_0x185fcf,_0x1ff167){_0x185fcf=_0x185fcf-0xf4;const _0x6e219=a56_0x6e21();let _0x40845c=_0x6e219[_0x185fcf];return _0x40845c;}import a56_0x59d8d5 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x7e7b7e){const _0x12683c=a56_0x4084;return _0x7e7b7e[_0x12683c(0xfc)]===_0x12683c(0x10c)||_0x7e7b7e[_0x12683c(0xfc)]==='jsonl'||_0x7e7b7e[_0x12683c(0xfc)]===_0x12683c(0x10d)||_0x7e7b7e['format']===_0x12683c(0x136)||_0x7e7b7e[_0x12683c(0x10c)]===!![]||_0x7e7b7e[_0x12683c(0x126)]===!![]||_0x7e7b7e['tsv']===!![]||_0x7e7b7e[_0x12683c(0x136)]===!![];}export function parseOutputOptions(_0x2a102b){const _0x2308bb=a56_0x4084;return{'format':_0x2a102b[_0x2308bb(0xfc)]||_0x2308bb(0x136),'output':_0x2a102b[_0x2308bb(0x135)]||'','limit':_0x2a102b[_0x2308bb(0x115)],'limitStructuredFormats':_0x2a102b['limitStructuredFormats'],'color':_0x2a102b[_0x2308bb(0x10f)],'noColor':_0x2a102b[_0x2308bb(0x134)]};}function convertSDKResultToQueryResult(_0x5b6be3){const _0x3738b8=a56_0x4084,_0x5388ca=[];if(_0x5b6be3['length']>0x0){const _0x2dc6a1=_0x5b6be3[0x0];for(const [_0x298440,_0x1a7fe1]of Object[_0x3738b8(0x11c)](_0x2dc6a1)){let _0x668b8f=_0x3738b8(0xff);if(typeof _0x1a7fe1===_0x3738b8(0x111))_0x668b8f=Number[_0x3738b8(0xfb)](_0x1a7fe1)?_0x3738b8(0xf4):_0x3738b8(0x104);else{if(typeof _0x1a7fe1===_0x3738b8(0x116))_0x668b8f=_0x3738b8(0x116);else _0x1a7fe1===null&&(_0x668b8f='varchar');}_0x5388ca[_0x3738b8(0x133)]({'name':_0x298440,'type':_0x668b8f});}}return{'queryId':_0x3738b8(0x12a),'columns':_0x5388ca,'data':_0x5b6be3,'stats':{'state':_0x3738b8(0x12f),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x5b6be3['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x529991,_0x6a5900){const _0xcade7b=convertSDKResultToQueryResult(_0x529991);return formatQueryOutput(_0xcade7b,_0x6a5900);}export async function formatQueryOutput(_0x3c80ca,_0xff10dd){const _0x1f6d2c=a56_0x4084,{format:_0x445416,limit:_0x2ba552,output:_0x589814,color:_0x1c97dc,noColor:_0x410e2e,limitStructuredFormats:_0x20214c}=_0xff10dd,_0x36e57e=Boolean(_0x589814)&&!_0x1c97dc,_0x442451={'color':_0x1c97dc,'noColor':_0x410e2e||_0x36e57e};if(_0x445416===_0x1f6d2c(0x136)){const _0x49700e=shouldUseLess(_0x445416,_0x589814);return formatAsTable(_0x3c80ca,_0x2ba552,_0x49700e,_0x442451);}const _0x5d7e53=_0x20214c&&Number['isFinite'](_0x2ba552)&&_0x3c80ca[_0x1f6d2c(0x11f)]['length']>_0x2ba552?{..._0x3c80ca,'data':_0x3c80ca[_0x1f6d2c(0x11f)]['slice'](0x0,_0x2ba552)}:_0x3c80ca;if(_0x445416==='json')return formatAsJSON(_0x5d7e53,_0x442451);else return _0x445416===_0x1f6d2c(0x126)?formatAsJSONL(_0x5d7e53,_0x442451):formatQueryResult(_0x5d7e53,_0x445416);}function shouldUseLess(_0x57809e,_0x53872e){const _0x29d6c9=a56_0x4084;return(_0x57809e==='table'||_0x57809e===_0x29d6c9(0x125))&&process[_0x29d6c9(0x137)][_0x29d6c9(0x108)]&&!_0x53872e;}export function resolveOutputOptions(_0x538343){const _0x50dfee=a56_0x4084,_0x154af0=_0x538343[_0x50dfee(0x135)]||'',_0x260cea=resolveOutputFormat(_0x538343['format'],_0x154af0,'table');let _0x384931=typeof _0x538343[_0x50dfee(0x115)]===_0x50dfee(0x111)?_0x538343['limit']:parseInt(_0x538343[_0x50dfee(0x115)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x538343[_0x50dfee(0x115)]===undefined&&shouldUseLess(_0x260cea,_0x154af0)&&(_0x384931=Infinity),{'format':_0x260cea,'output':_0x154af0,'limit':_0x384931,'limitStructuredFormats':_0x538343[_0x50dfee(0x122)],'color':_0x538343['color'],'noColor':_0x538343['noColor']};}export function writeOutput(_0x3d157a,_0x3379dd,_0x514d08){const _0x7bf3a=a56_0x4084;return _0x3379dd?(writeFileSync(_0x3379dd,_0x3d157a),console[_0x7bf3a(0x10e)](_0x7bf3a(0x131)+_0x3379dd),Promise[_0x7bf3a(0x12d)]()):shouldUseLess(_0x514d08||'','')?new Promise(_0x29ce71=>{const _0x3d47ed=_0x7bf3a,_0x555b53=spawn(_0x3d47ed(0x11d),['-FXRSn'],{'stdio':[_0x3d47ed(0x109),_0x3d47ed(0x113),_0x3d47ed(0x113)]});let _0x2c70ee=![];_0x555b53['on']('error',()=>{const _0x5cf3e5=_0x3d47ed;!_0x2c70ee&&(_0x2c70ee=!![],console[_0x5cf3e5(0xfa)](_0x3d157a),_0x29ce71());}),_0x555b53['on'](_0x3d47ed(0x114),()=>{!_0x2c70ee&&(_0x2c70ee=!![],_0x29ce71());}),_0x555b53['on']('spawn',()=>{const _0x2cb10d=_0x3d47ed;!_0x2c70ee&&_0x555b53[_0x2cb10d(0x101)]&&(_0x555b53[_0x2cb10d(0x101)]['on'](_0x2cb10d(0x10e),()=>{}),_0x555b53[_0x2cb10d(0x101)]['write'](_0x3d157a),_0x555b53[_0x2cb10d(0x101)][_0x2cb10d(0x107)]());}),!_0x555b53[_0x3d47ed(0x101)]&&(!_0x2c70ee&&(_0x2c70ee=!![],console['log'](_0x3d157a),_0x29ce71()));}):(console[_0x7bf3a(0xfa)](_0x3d157a),Promise[_0x7bf3a(0x12d)]());}export async function handleSDKOutput(_0x585552,_0x4922bd){const _0x40d6c1=a56_0x4084,_0x158972=resolveOutputOptions(_0x4922bd),_0x2c125b=await formatSDKOutput(_0x585552,_0x158972);await writeOutput(_0x2c125b,_0x158972[_0x40d6c1(0x135)]||undefined,_0x158972['format']);}export async function handleQueryOutput(_0xd7cff0,_0x6737a9){const _0x5aa1fe=a56_0x4084,_0x5854db=resolveOutputOptions(_0x6737a9),_0x43e85e=await formatQueryOutput(_0xd7cff0,_0x5854db);await writeOutput(_0x43e85e,_0x5854db[_0x5aa1fe(0x135)]||undefined,_0x5854db[_0x5aa1fe(0xfc)]);}async function formatSingleObject(_0x3d348b,_0x3c9496){const _0x10cc74=a56_0x4084,{format:_0x497382,color:_0x3e64b5,noColor:_0x3f5c11}=_0x3c9496,_0x452ca1={'color':_0x3e64b5,'noColor':_0x3f5c11};if(_0x497382===_0x10cc74(0x10c)){if(shouldUseColor(_0x452ca1))return colorizeJSON(_0x3d348b,_0x452ca1);return JSON[_0x10cc74(0x138)](_0x3d348b,null,0x2);}else{if(_0x497382===_0x10cc74(0x126)){if(shouldUseColor(_0x452ca1))return colorizeJSONCompact(_0x3d348b,_0x452ca1);return JSON[_0x10cc74(0x138)](_0x3d348b);}else{if(_0x497382==='tsv')return Object[_0x10cc74(0x11c)](_0x3d348b)['map'](([_0x494619,_0x3912ae])=>_0x494619+'\x09'+_0x3912ae)[_0x10cc74(0x139)]('\x0a');else{const _0x4ae87f=Object[_0x10cc74(0x11c)](_0x3d348b);if(_0x4ae87f[_0x10cc74(0xf6)]===0x0)return _0x10cc74(0x110);const _0x2e2e3a=_0x3d348b['debug'],_0x39bbf6=_0x3d348b[_0x10cc74(0x129)],_0x48cc33=_0x3d348b['params'],_0x271590=_0x3d348b[_0x10cc74(0x11e)],_0x13c154=_0x39bbf6?typeof _0x39bbf6===_0x10cc74(0x130)?_0x39bbf6:JSON[_0x10cc74(0x138)](_0x39bbf6,null,0x2):undefined,_0x514e2c=_0x48cc33&&Object[_0x10cc74(0x120)](_0x48cc33)[_0x10cc74(0xf6)]>0x0?JSON[_0x10cc74(0x138)](_0x48cc33,null,0x2):undefined,_0x19e873=_0x271590&&Object[_0x10cc74(0x120)](_0x271590)[_0x10cc74(0xf6)]>0x0?JSON['stringify'](_0x271590,null,0x2):undefined,_0x45a19d=_0x4ae87f[_0x10cc74(0x119)](([_0x35ba16])=>_0x35ba16!==_0x10cc74(0x124)&&_0x35ba16!==_0x10cc74(0x129)&&_0x35ba16!==_0x10cc74(0x10b)&&_0x35ba16!==_0x10cc74(0x11e)),_0x361c99=Math['max'](..._0x45a19d[_0x10cc74(0x103)](([_0x5562f6])=>_0x5562f6['length'])),_0x9db5ef=Math[_0x10cc74(0xf9)](..._0x45a19d[_0x10cc74(0x103)](([,_0x412777])=>{const _0x5c0e93=_0x10cc74;try{const _0x3317b2=_0x412777===null||_0x412777===undefined?'':typeof _0x412777==='object'?JSON[_0x5c0e93(0x138)](_0x412777):String(_0x412777),_0x297265=_0x3317b2[_0x5c0e93(0x112)]('\x0a');return Math[_0x5c0e93(0xf9)](..._0x297265['map'](_0x484434=>_0x484434[_0x5c0e93(0xf6)]),0x0);}catch{return 0x0;}}),0x14),_0x91fa09=[];_0x91fa09[_0x10cc74(0x133)](colorBorder('┌─'+'─'[_0x10cc74(0x127)](_0x361c99)+_0x10cc74(0x121)+'─'[_0x10cc74(0x127)](_0x9db5ef)+'─┐',_0x452ca1)),_0x45a19d[_0x10cc74(0xf5)](([_0x127145,_0x20cd49])=>{const _0x242e01=_0x10cc74;let _0x643cd4;try{_0x643cd4=_0x20cd49===null||_0x20cd49===undefined?'':typeof _0x20cd49==='object'?JSON['stringify'](_0x20cd49):String(_0x20cd49);}catch{_0x643cd4='[Object]';}const _0x47215d=_0x127145['padEnd'](_0x361c99),_0x1dc913=_0x643cd4[_0x242e01(0x112)]('\x0a');_0x1dc913[_0x242e01(0xf5)]((_0x5272ed,_0x2dc541)=>{const _0x2ae1d6=_0x242e01,_0x588ca3=colorBorder('│',_0x452ca1);_0x2dc541===0x0?_0x91fa09[_0x2ae1d6(0x133)](_0x588ca3+'\x20'+_0x47215d+'\x20'+_0x588ca3+'\x20'+_0x5272ed['padEnd'](_0x9db5ef)+'\x20'+_0x588ca3):_0x91fa09[_0x2ae1d6(0x133)](_0x588ca3+'\x20'+'\x20'[_0x2ae1d6(0x127)](_0x361c99)+'\x20'+_0x588ca3+'\x20'+_0x5272ed['padEnd'](_0x9db5ef)+'\x20'+_0x588ca3);});}),_0x91fa09[_0x10cc74(0x133)](colorBorder('└─'+'─'['repeat'](_0x361c99)+_0x10cc74(0x100)+'─'['repeat'](_0x9db5ef)+'─┘',_0x452ca1));_0x13c154&&(_0x91fa09['push'](''),_0x91fa09['push'](String(a56_0x59d8d5[_0x10cc74(0x118)][_0x10cc74(0x106)](_0x10cc74(0x12e)))),_0x91fa09[_0x10cc74(0x133)](_0x13c154));_0x514e2c&&(_0x91fa09[_0x10cc74(0x133)](''),_0x91fa09[_0x10cc74(0x133)](String(a56_0x59d8d5[_0x10cc74(0xfd)][_0x10cc74(0x106)](_0x10cc74(0xfe)))),_0x91fa09[_0x10cc74(0x133)](_0x514e2c));_0x19e873&&(_0x91fa09[_0x10cc74(0x133)](''),_0x91fa09[_0x10cc74(0x133)](String(a56_0x59d8d5[_0x10cc74(0x12b)][_0x10cc74(0x106)]('[rule]'))),_0x91fa09[_0x10cc74(0x133)](_0x19e873));if(_0x2e2e3a){if(_0x2e2e3a['stderr']){_0x91fa09[_0x10cc74(0x133)](''),_0x91fa09[_0x10cc74(0x133)](String(a56_0x59d8d5['red'][_0x10cc74(0x106)](_0x10cc74(0xf7))));const _0x4df0a0=_0x2e2e3a[_0x10cc74(0x102)][_0x10cc74(0x112)]('\x0a');_0x4df0a0[_0x10cc74(0xf5)](_0x1e310b=>{const _0x40af53=_0x10cc74;_0x1e310b[_0x40af53(0x11a)]()&&_0x91fa09['push'](_0x1e310b);});}if(_0x2e2e3a[_0x10cc74(0x128)]){_0x91fa09[_0x10cc74(0x133)](''),_0x91fa09['push'](String(a56_0x59d8d5['cyan'][_0x10cc74(0x106)]('[logs]')));const _0x5002a5=_0x2e2e3a[_0x10cc74(0x128)][_0x10cc74(0x112)]('\x0a');_0x5002a5[_0x10cc74(0xf5)](_0x424118=>{const _0x3b1bdc=_0x10cc74;_0x424118[_0x3b1bdc(0x11a)]()&&_0x91fa09[_0x3b1bdc(0x133)](_0x424118);});}}return _0x91fa09[_0x10cc74(0x139)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x154ce7,_0x588e7f){const _0xb69e8=a56_0x4084;if(_0x588e7f[_0xb69e8(0xfc)]===_0xb69e8(0x136)){await handleSDKOutput([_0x154ce7],_0x588e7f);return;}const _0x5781f5=resolveOutputOptions(_0x588e7f),_0x85283=await formatSingleObject(_0x154ce7,_0x5781f5);await writeOutput(_0x85283,_0x5781f5['output']||undefined,_0x5781f5[_0xb69e8(0xfc)]);}function a56_0x6e21(){const _0x1d3b97=['blue','[params]','varchar','─┴─','stdin','stderr','map','double','19156072UJOZxr','bold','end','isTTY','pipe','3559936gmYlkZ','params','json','tsv','error','color','No\x20data','number','split','inherit','close','limit','boolean','9290dmtZCu','yellow','filter','trim','8ioiBhC','entries','less','rule','data','keys','─┬─','limitStructuredFormats','3128388GslPfG','debug','list','jsonl','repeat','cmdout','query','sdk-result','magenta','9160QxasHC','resolve','[query]','FINISHED','string','Results\x20saved\x20to\x20','6190254hYtFjm','push','noColor','output','table','stdout','stringify','join','bigint','forEach','length','[error]','4750008vJHJVH','max','log','isInteger','format'];a56_0x6e21=function(){return _0x1d3b97;};return a56_0x6e21();}
|
|
1
|
+
(function(_0x30682f,_0x5d7574){const _0x220d00=a56_0x1b51,_0x245845=_0x30682f();while(!![]){try{const _0x337de7=-parseInt(_0x220d00(0x17f))/0x1*(-parseInt(_0x220d00(0x199))/0x2)+parseInt(_0x220d00(0x1ab))/0x3+-parseInt(_0x220d00(0x183))/0x4*(-parseInt(_0x220d00(0x19e))/0x5)+-parseInt(_0x220d00(0x198))/0x6*(parseInt(_0x220d00(0x191))/0x7)+-parseInt(_0x220d00(0x1c5))/0x8*(parseInt(_0x220d00(0x18e))/0x9)+-parseInt(_0x220d00(0x1be))/0xa*(parseInt(_0x220d00(0x1b7))/0xb)+parseInt(_0x220d00(0x195))/0xc*(-parseInt(_0x220d00(0x184))/0xd);if(_0x337de7===_0x5d7574)break;else _0x245845['push'](_0x245845['shift']());}catch(_0x7be254){_0x245845['push'](_0x245845['shift']());}}}(a56_0x6b42,0x3fa05));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a56_0x5b6478 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';function a56_0x1b51(_0x1febfa,_0x3b988b){_0x1febfa=_0x1febfa-0x177;const _0x6b429d=a56_0x6b42();let _0x1b51bf=_0x6b429d[_0x1febfa];return _0x1b51bf;}export function isStructuredFormat(_0x42af43){const _0xbe1567=a56_0x1b51;return _0x42af43[_0xbe1567(0x18b)]===_0xbe1567(0x192)||_0x42af43[_0xbe1567(0x18b)]===_0xbe1567(0x1aa)||_0x42af43[_0xbe1567(0x18b)]==='tsv'||_0x42af43[_0xbe1567(0x18b)]==='table'||_0x42af43[_0xbe1567(0x192)]===!![]||_0x42af43['jsonl']===!![]||_0x42af43[_0xbe1567(0x1a1)]===!![]||_0x42af43[_0xbe1567(0x1a0)]===!![];}export function parseOutputOptions(_0x13eff0){const _0x27eddd=a56_0x1b51;return{'format':_0x13eff0['format']||'table','output':_0x13eff0[_0x27eddd(0x177)]||'','limit':_0x13eff0['limit'],'limitStructuredFormats':_0x13eff0[_0x27eddd(0x19d)],'color':_0x13eff0['color'],'noColor':_0x13eff0['noColor']};}function convertSDKResultToQueryResult(_0x7c6d8e){const _0x2b317a=a56_0x1b51,_0x2cd185=[];if(_0x7c6d8e[_0x2b317a(0x1a8)]>0x0){const _0x484ac8=_0x7c6d8e[0x0];for(const [_0x2e46d4,_0x3cc9ac]of Object['entries'](_0x484ac8)){let _0x41824d=_0x2b317a(0x1a9);if(typeof _0x3cc9ac==='number')_0x41824d=Number[_0x2b317a(0x1bd)](_0x3cc9ac)?_0x2b317a(0x194):_0x2b317a(0x17d);else{if(typeof _0x3cc9ac===_0x2b317a(0x180))_0x41824d=_0x2b317a(0x180);else _0x3cc9ac===null&&(_0x41824d=_0x2b317a(0x1a9));}_0x2cd185[_0x2b317a(0x1b1)]({'name':_0x2e46d4,'type':_0x41824d});}}return{'queryId':_0x2b317a(0x19a),'columns':_0x2cd185,'data':_0x7c6d8e,'stats':{'state':_0x2b317a(0x17b),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x7c6d8e['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x1b86be,_0x1f48fb){const _0x962c5c=convertSDKResultToQueryResult(_0x1b86be);return formatQueryOutput(_0x962c5c,_0x1f48fb);}export async function formatQueryOutput(_0x1426f5,_0x2db9f3){const _0x3343dc=a56_0x1b51,{format:_0x29cd9e,limit:_0x355f3f,output:_0x553cba,color:_0x48d2e7,noColor:_0x15e9e,limitStructuredFormats:_0x43db2c}=_0x2db9f3,_0x5d1cac=Boolean(_0x553cba)&&!_0x48d2e7,_0x20a20d={'color':_0x48d2e7,'noColor':_0x15e9e||_0x5d1cac};if(_0x29cd9e===_0x3343dc(0x1a0)){const _0x464e81=shouldUseLess(_0x29cd9e,_0x553cba);return formatAsTable(_0x1426f5,_0x355f3f,_0x464e81,_0x20a20d);}const _0x58a972=_0x43db2c&&Number[_0x3343dc(0x182)](_0x355f3f)&&_0x1426f5[_0x3343dc(0x189)][_0x3343dc(0x1a8)]>_0x355f3f?{..._0x1426f5,'data':_0x1426f5[_0x3343dc(0x189)]['slice'](0x0,_0x355f3f)}:_0x1426f5;if(_0x29cd9e==='json')return formatAsJSON(_0x58a972,_0x20a20d);else return _0x29cd9e===_0x3343dc(0x1aa)?formatAsJSONL(_0x58a972,_0x20a20d):formatQueryResult(_0x58a972,_0x29cd9e);}function shouldUseLess(_0xfbf8f0,_0x1e4260){const _0x5dcc67=a56_0x1b51;return(_0xfbf8f0==='table'||_0xfbf8f0===_0x5dcc67(0x18f))&&process[_0x5dcc67(0x17a)][_0x5dcc67(0x1a2)]&&!_0x1e4260;}export function resolveOutputOptions(_0x1ec37b){const _0x17f1d8=a56_0x1b51,_0x5d6d4b=_0x1ec37b[_0x17f1d8(0x177)]||'',_0x1c2713=resolveOutputFormat(_0x1ec37b[_0x17f1d8(0x18b)],_0x5d6d4b,_0x17f1d8(0x1a0));let _0x30bcc5=typeof _0x1ec37b['limit']===_0x17f1d8(0x193)?_0x1ec37b['limit']:parseInt(_0x1ec37b[_0x17f1d8(0x188)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x1ec37b['limit']===undefined&&shouldUseLess(_0x1c2713,_0x5d6d4b)&&(_0x30bcc5=Infinity),{'format':_0x1c2713,'output':_0x5d6d4b,'limit':_0x30bcc5,'limitStructuredFormats':_0x1ec37b[_0x17f1d8(0x19d)],'color':_0x1ec37b[_0x17f1d8(0x17e)],'noColor':_0x1ec37b[_0x17f1d8(0x1bf)]};}function a56_0x6b42(){const _0x16fb03=['3675951FPZHOr','list','query','238LxEYSh','json','number','bigint','447324HvCggT','write','stringify','1722QGnMAw','70plOnQJ','sdk-result','bold','entries','limitStructuredFormats','205xksQrH','less','table','tsv','isTTY','[error]','stdin','[query]','params','max','length','varchar','jsonl','1510509vZSSYj','keys','trim','join','padEnd','No\x20data','push','log','end','forEach','cmdout','─┴─','3718LUENqX','Results\x20saved\x20to\x20','[logs]','debug','blue','-FXRSn','isInteger','2090pBwuiF','noColor','error','[rule]','close','inherit','─┬─','8JXDmGa','output','repeat','split','stdout','FINISHED','cyan','double','color','4639wvFaMb','boolean','stderr','isFinite','33612PXKdbM','91FuOjgH','rule','magenta','red','limit','data','map','format','pipe','filter'];a56_0x6b42=function(){return _0x16fb03;};return a56_0x6b42();}export function writeOutput(_0x2814dc,_0x386c36,_0x57ff1c){const _0x33ae05=a56_0x1b51;return _0x386c36?(writeFileSync(_0x386c36,_0x2814dc),console[_0x33ae05(0x1c0)](_0x33ae05(0x1b8)+_0x386c36),Promise['resolve']()):shouldUseLess(_0x57ff1c||'','')?new Promise(_0x120fed=>{const _0x117fa3=_0x33ae05,_0xea0868=spawn(_0x117fa3(0x19f),[_0x117fa3(0x1bc)],{'stdio':[_0x117fa3(0x18c),_0x117fa3(0x1c3),_0x117fa3(0x1c3)]});let _0x528952=![];_0xea0868['on']('error',()=>{const _0x1dd688=_0x117fa3;!_0x528952&&(_0x528952=!![],console[_0x1dd688(0x1b2)](_0x2814dc),_0x120fed());}),_0xea0868['on'](_0x117fa3(0x1c2),()=>{!_0x528952&&(_0x528952=!![],_0x120fed());}),_0xea0868['on']('spawn',()=>{const _0x3ae71d=_0x117fa3;!_0x528952&&_0xea0868[_0x3ae71d(0x1a4)]&&(_0xea0868[_0x3ae71d(0x1a4)]['on'](_0x3ae71d(0x1c0),()=>{}),_0xea0868[_0x3ae71d(0x1a4)][_0x3ae71d(0x196)](_0x2814dc),_0xea0868[_0x3ae71d(0x1a4)][_0x3ae71d(0x1b3)]());}),!_0xea0868[_0x117fa3(0x1a4)]&&(!_0x528952&&(_0x528952=!![],console[_0x117fa3(0x1b2)](_0x2814dc),_0x120fed()));}):(console[_0x33ae05(0x1b2)](_0x2814dc),Promise['resolve']());}export async function handleSDKOutput(_0x282090,_0xc83c07){const _0xfaf114=a56_0x1b51,_0x31c303=resolveOutputOptions(_0xc83c07),_0x270444=await formatSDKOutput(_0x282090,_0x31c303);await writeOutput(_0x270444,_0x31c303[_0xfaf114(0x177)]||undefined,_0x31c303[_0xfaf114(0x18b)]);}export async function handleQueryOutput(_0x52071b,_0xe00e6f){const _0x531659=a56_0x1b51,_0x2222b8=resolveOutputOptions(_0xe00e6f),_0x5404c1=await formatQueryOutput(_0x52071b,_0x2222b8);await writeOutput(_0x5404c1,_0x2222b8[_0x531659(0x177)]||undefined,_0x2222b8[_0x531659(0x18b)]);}async function formatSingleObject(_0x1661e4,_0x1b8d60){const _0x20bb66=a56_0x1b51,{format:_0x445438,color:_0xd7ae8c,noColor:_0x58795}=_0x1b8d60,_0x5a913c={'color':_0xd7ae8c,'noColor':_0x58795};if(_0x445438==='json'){if(shouldUseColor(_0x5a913c))return colorizeJSON(_0x1661e4,_0x5a913c);return JSON['stringify'](_0x1661e4,null,0x2);}else{if(_0x445438===_0x20bb66(0x1aa)){if(shouldUseColor(_0x5a913c))return colorizeJSONCompact(_0x1661e4,_0x5a913c);return JSON[_0x20bb66(0x197)](_0x1661e4);}else{if(_0x445438===_0x20bb66(0x1a1))return Object['entries'](_0x1661e4)[_0x20bb66(0x18a)](([_0x37b179,_0x327d1f])=>_0x37b179+'\x09'+_0x327d1f)[_0x20bb66(0x1ae)]('\x0a');else{const _0x1d1dae=Object[_0x20bb66(0x19c)](_0x1661e4);if(_0x1d1dae[_0x20bb66(0x1a8)]===0x0)return _0x20bb66(0x1b0);const _0x335ccf=_0x1661e4[_0x20bb66(0x1ba)],_0x315a06=_0x1661e4[_0x20bb66(0x190)],_0x88a131=_0x1661e4[_0x20bb66(0x1a6)],_0x3cd7db=_0x1661e4[_0x20bb66(0x185)],_0x1bb998=_0x315a06?typeof _0x315a06==='string'?_0x315a06:JSON[_0x20bb66(0x197)](_0x315a06,null,0x2):undefined,_0xd92a1c=_0x88a131&&Object[_0x20bb66(0x1ac)](_0x88a131)['length']>0x0?JSON[_0x20bb66(0x197)](_0x88a131,null,0x2):undefined,_0x10b870=_0x3cd7db&&Object[_0x20bb66(0x1ac)](_0x3cd7db)['length']>0x0?JSON[_0x20bb66(0x197)](_0x3cd7db,null,0x2):undefined,_0x58dfe7=_0x1d1dae[_0x20bb66(0x18d)](([_0x470f87])=>_0x470f87!==_0x20bb66(0x1ba)&&_0x470f87!==_0x20bb66(0x190)&&_0x470f87!==_0x20bb66(0x1a6)&&_0x470f87!==_0x20bb66(0x185)),_0x4acefa=Math[_0x20bb66(0x1a7)](..._0x58dfe7[_0x20bb66(0x18a)](([_0x2df35f])=>_0x2df35f['length'])),_0x366bea=Math[_0x20bb66(0x1a7)](..._0x58dfe7['map'](([,_0x547208])=>{const _0x8184f=_0x20bb66;try{const _0x18e419=_0x547208===null||_0x547208===undefined?'':typeof _0x547208==='object'?JSON[_0x8184f(0x197)](_0x547208):String(_0x547208),_0x3d0425=_0x18e419[_0x8184f(0x179)]('\x0a');return Math[_0x8184f(0x1a7)](..._0x3d0425[_0x8184f(0x18a)](_0x5a4583=>_0x5a4583[_0x8184f(0x1a8)]),0x0);}catch{return 0x0;}}),0x14),_0x5a5434=[];_0x5a5434['push'](colorBorder('┌─'+'─'['repeat'](_0x4acefa)+_0x20bb66(0x1c4)+'─'['repeat'](_0x366bea)+'─┐',_0x5a913c)),_0x58dfe7['forEach'](([_0x235464,_0x52187b])=>{const _0x449b3a=_0x20bb66;let _0x333c63;try{_0x333c63=_0x52187b===null||_0x52187b===undefined?'':typeof _0x52187b==='object'?JSON[_0x449b3a(0x197)](_0x52187b):String(_0x52187b);}catch{_0x333c63='[Object]';}const _0x2eb28f=_0x235464[_0x449b3a(0x1af)](_0x4acefa),_0x4ff12c=_0x333c63[_0x449b3a(0x179)]('\x0a');_0x4ff12c[_0x449b3a(0x1b4)]((_0xb3c4c4,_0x528b06)=>{const _0x18e55e=_0x449b3a,_0xf54eaf=colorBorder('│',_0x5a913c);_0x528b06===0x0?_0x5a5434[_0x18e55e(0x1b1)](_0xf54eaf+'\x20'+_0x2eb28f+'\x20'+_0xf54eaf+'\x20'+_0xb3c4c4['padEnd'](_0x366bea)+'\x20'+_0xf54eaf):_0x5a5434[_0x18e55e(0x1b1)](_0xf54eaf+'\x20'+'\x20'[_0x18e55e(0x178)](_0x4acefa)+'\x20'+_0xf54eaf+'\x20'+_0xb3c4c4[_0x18e55e(0x1af)](_0x366bea)+'\x20'+_0xf54eaf);});}),_0x5a5434[_0x20bb66(0x1b1)](colorBorder('└─'+'─'[_0x20bb66(0x178)](_0x4acefa)+_0x20bb66(0x1b6)+'─'[_0x20bb66(0x178)](_0x366bea)+'─┘',_0x5a913c));_0x1bb998&&(_0x5a5434[_0x20bb66(0x1b1)](''),_0x5a5434[_0x20bb66(0x1b1)](String(a56_0x5b6478['yellow'][_0x20bb66(0x19b)](_0x20bb66(0x1a5)))),_0x5a5434[_0x20bb66(0x1b1)](_0x1bb998));_0xd92a1c&&(_0x5a5434[_0x20bb66(0x1b1)](''),_0x5a5434[_0x20bb66(0x1b1)](String(a56_0x5b6478[_0x20bb66(0x1bb)][_0x20bb66(0x19b)]('[params]'))),_0x5a5434[_0x20bb66(0x1b1)](_0xd92a1c));_0x10b870&&(_0x5a5434[_0x20bb66(0x1b1)](''),_0x5a5434[_0x20bb66(0x1b1)](String(a56_0x5b6478[_0x20bb66(0x186)]['bold'](_0x20bb66(0x1c1)))),_0x5a5434['push'](_0x10b870));if(_0x335ccf){if(_0x335ccf[_0x20bb66(0x181)]){_0x5a5434[_0x20bb66(0x1b1)](''),_0x5a5434[_0x20bb66(0x1b1)](String(a56_0x5b6478[_0x20bb66(0x187)][_0x20bb66(0x19b)](_0x20bb66(0x1a3))));const _0x2a0f3e=_0x335ccf[_0x20bb66(0x181)][_0x20bb66(0x179)]('\x0a');_0x2a0f3e[_0x20bb66(0x1b4)](_0xfd301d=>{const _0x553b9e=_0x20bb66;_0xfd301d[_0x553b9e(0x1ad)]()&&_0x5a5434[_0x553b9e(0x1b1)](_0xfd301d);});}if(_0x335ccf[_0x20bb66(0x1b5)]){_0x5a5434[_0x20bb66(0x1b1)](''),_0x5a5434[_0x20bb66(0x1b1)](String(a56_0x5b6478[_0x20bb66(0x17c)][_0x20bb66(0x19b)](_0x20bb66(0x1b9))));const _0x2d97d2=_0x335ccf[_0x20bb66(0x1b5)][_0x20bb66(0x179)]('\x0a');_0x2d97d2[_0x20bb66(0x1b4)](_0x1150d6=>{const _0x1fbfe4=_0x20bb66;_0x1150d6[_0x1fbfe4(0x1ad)]()&&_0x5a5434[_0x1fbfe4(0x1b1)](_0x1150d6);});}}return _0x5a5434[_0x20bb66(0x1ae)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x2d6101,_0x505f45){const _0x228431=a56_0x1b51;if(_0x505f45[_0x228431(0x18b)]==='table'){await handleSDKOutput([_0x2d6101],_0x505f45);return;}const _0x3484ad=resolveOutputOptions(_0x505f45),_0x23c145=await formatSingleObject(_0x2d6101,_0x3484ad);await writeOutput(_0x23c145,_0x3484ad['output']||undefined,_0x3484ad[_0x228431(0x18b)]);}
|