@treasuredata/tdx 0.17.0 → 0.18.0
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.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.d.ts.map +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-command.js.map +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.d.ts.map +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-command.js.map +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.d.ts.map +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/parent-segment-command.js.map +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.d.ts.map +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-pull-command.js.map +1 -1
- package/dist/commands/segment-push-command.d.ts.map +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-push-command.js.map +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.d.ts +9 -0
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.d.ts +8 -8
- package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.d.ts.map +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/client/workflow-client.js.map +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.d.ts +2 -0
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.d.ts +44 -20
- package/dist/sdk/llm/model-factors.d.ts.map +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/model-factors.js.map +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.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-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.d.ts +35 -0
- package/dist/sdk/workflow/archive-validation.d.ts.map +1 -0
- package/dist/sdk/workflow/archive-validation.js +1 -0
- package/dist/sdk/workflow/archive-validation.js.map +1 -0
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.d.ts.map +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js.map +1 -1
- package/dist/sdk/workflow/push-workflow.d.ts.map +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js.map +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.d.ts +4 -0
- package/dist/utils/prompt.d.ts.map +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/prompt.js.map +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a43_0x282876=a43_0x2c2a;(function(_0x31ae98,_0x39e42e){const _0x11ad96=a43_0x2c2a,_0x3dc90f=_0x31ae98();while(!![]){try{const _0x137bc0=parseInt(_0x11ad96(0x15b))/0x1+parseInt(_0x11ad96(0x112))/0x2+parseInt(_0x11ad96(0x136))/0x3+-parseInt(_0x11ad96(0x8f))/0x4*(-parseInt(_0x11ad96(0xd8))/0x5)+-parseInt(_0x11ad96(0x151))/0x6*(parseInt(_0x11ad96(0x200))/0x7)+parseInt(_0x11ad96(0x1d0))/0x8+-parseInt(_0x11ad96(0xb5))/0x9;if(_0x137bc0===_0x39e42e)break;else _0x3dc90f['push'](_0x3dc90f['shift']());}catch(_0x25e542){_0x3dc90f['push'](_0x3dc90f['shift']());}}}(a43_0x4d0e,0xdf7ab));import a43_0x2be135 from'chalk';import{existsSync}from'fs';import a43_0x3af4c2 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';function a43_0x4d0e(){const _0x450ac3=['Files\x20to\x20upload:\x20','workflow:push','Status:\x20','name','cwd','\x20to\x20see\x20detailed\x20logs','toISOString','param','Error:\x20Invalid\x20parameter\x20format:\x20','format','Killing\x20attempt...','filesExtracted','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','workflow:run','\x20sessions\x20','context','2795891DAYjIQ','\x20is\x20not\x20a\x20directory','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','\x20project','error','Loading\x20workflows...','Target:\x20','Source\x20project:\x20','\x0aPush\x20these\x20changes?','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','workflow:projects','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','No\x20workflow\x20tdx.json\x20found','Attempt\x20ID:\x20','repeat','createdAt','(unknown)','task','ICON_SPACING','Loading\x20sessions...','Error:\x20Invalid\x20JSON\x20in\x20--params','.\x20Expected\x20format:\x20KEY=VALUE','Include\x20retried:\x20yes','json','max','\x20\x20Console:\x20','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','resolveProject','Cancelled','set','✔\x20Clone\x20complete','Analyzing\x20project...','deleteSecret','fs/promises','executePushProject','description','min','Listing\x20secrets...','startedAt','✔\x20Push\x20complete','60748QUWgqJ','map','tdx\x20wf\x20attempt\x20','running','\x0aApply\x20these\x20changes?','No\x20attempts\x20found','workflow:pull','table','site','join','\x20secret','TASK_NAME_WIDTH','filter','attempt:','columns','deleted','Fetching\x20log\x20files...','Force:\x20yes','getDate','No\x20projects\x20match\x20pattern:\x20','workflow:secrets:delete','Revision:\x20','renderSessionsTimeline','Failed\x20to\x20fetch\x20attempt\x20data','session','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','\x20\x20Workflow:\x20','projectId','length','retryAttemptName','targetDir','finishedAt','LABEL_WIDTH_DIVISOR','Project:\x20','duration','Key\x20cannot\x20be\x20empty','\x20\x20New\x20attempt\x20ID:\x20','11786931nDRkat','verbose','Show\x20tasks\x20for\x20an\x20attempt','session:','navigateSessionsInteractive','No\x20sessions\x20with\x20timing\x20information','parse','changes','fill','preparePushProject','\x20\x20Project\x20ID:\x20','follow','workflow:download','split','relative','fromTask','\x20(use\x20--limit\x20to\x20show\x20more)','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','key','Expected\x20format:\x20--param\x20key=value','includes','index','params','\x1b[1A\x1b[2K','Cloning\x20to\x20','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','push','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','✔\x20New\x20project:\x20','substring','success','get','Listing\x20workflows...','dryRun','list','55PlTEmb','GUTTER','✔\x20Found\x20','Pull\x20workflow\x20project\x20to\x20local\x20folder','Listing\x20workflow\x20sessions...','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','reason','listSecrets','\x20task','\x20\x20Changes:\x20','output','newProjectId','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','Select\x20a\x20workflow\x20to\x20run','\x20deleted','✔\x20Deleted\x20project\x20','Workflow:\x20','Resume\x20from:\x20','execute','List\x20workflows','\x22?\x20This\x20cannot\x20be\x20undone.','padStart','Usage:\x20tdx\x20wf\x20use\x20<project>','status','\x20from\x20session\x20','✔\x20Pushed\x20','green','No\x20attempts\x20found\x20for:\x20','revision:\x20','getHours','new','window','Project\x20filter:\x20','✔\x20Showing\x20','Invalid\x20format:\x20','Starting\x20workflow\x20run...','isTTY','localeCompare','Writing\x20files...','getMonth','Including\x20subtasks:\x20yes','white','sourceProjectName','Source\x20directory:\x20','resumeFrom','workflow:secrets:set','\x20-\x20','canceling','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','sort','Dry\x20run:\x20yes','planned','Deleting\x20secret...','\x20\x20Location:\x20','stat','Pushing\x20project...','Usage:\x20workflow:delete\x20<project-name-or-id>','run','2103210fjdqZl','workflow:use','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','yellow',',\x20Workflow:\x20','workflow:logs','💡\x20Tip:\x20Use\x20','Error:\x20KEY=VALUE\x20is\x20required','Output\x20directory:\x20','Tip:\x20cd\x20to\x20workflows/','size','tdx.json','\x20\x20Revision:\x20','\x20unchanged','parseProjectWorkflowPattern','/app/workflows/','workflow:attempts','/attempt/','workflow','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','includeSubtasks','Project\x20name:\x20','Auto-selected\x20latest\x20session:\x20','\x20of\x20','renderTimeline','match','Parameters:\x20','session_id','Error:\x20Attempt\x20ID\x20is\x20required','workflowProject','stringify','summary','unchanged','showWorkflowConsoleUrl','\x20\x20Session\x20ID:\x20','replace','3805005HsLtVH','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','Error:','value','Start\x20a\x20workflow\x20run','pollTimeline','targetExists','No\x20sessions\x20found','prepareCloneProject','attempt','ICON_WIDTH','utf-8','updatedAt','⚠\x20Showing\x20first\x20','lastAttempt','No\x20workflows\x20found\x20in\x20project:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','diff','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','\x20has\x20no\x20attempts','startsWith','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','now','includeRetried','Project\x20directory:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','\x0aDry\x20run\x20-\x20nothing\x20pushed','24eEaqjg','MIN_TIMELINE_WIDTH','modified','MAX_POLL_ITERATIONS','Project\x20name\x20is\x20required','metadata','Deleting\x20project\x20','🔄\x20','Params:\x20','sourceDir','767025Ksdsah','---\x20','Analyzing\x20changes...','LABEL_MIN_SPACING','\x20workflow','sessionTime','Session\x20','project','all','jsonl','state','\x27...','Source:\x20','\x20\x20Project:\x20','red','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','stdout','\x22\x20to\x20new\x20project\x20\x22','No\x20workflow\x20sessions\x20found','workflow:attempt','select','tasks','taskName','getFullYear','resolve','\x20\x20Target:\x20','No\x20sessions\x20found\x20for:\x20','workflows','limit','startTime','✔\x20Workflow\x20project\x20context\x20cleared.','Target\x20directory:\x20','Latest\x20session\x20has\x20no\x20attempt','workflowName','Resolving\x20project\x20\x27','\x20\x20Source:\x20','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','\x0a✔\x20No\x20changes\x20to\x20push','Warning:','New\x20project\x20name:\x20','attempts','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','type','Filter:\x20project=','total','📁\x20','projects','keys','buildTimelineData','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','...','log','MAX_TASKS_DISPLAY','data','Error:\x20Secret\x20key\x20is\x20required','fullName','yes','workflow:timeline','write','group_error','isArray','retryAttempt','revision','sessions','existingProjectId','executeCloneProject','workflow:delete','unknown','isNewProject','sessionId','toLowerCase','Key:\x20','\x20(system)','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Session\x20not\x20found:\x20','Pulling\x20project\x20','\x20new','\x20\x20tdx\x20wf\x20use\x20<project>','hasChanges','attemptId','every','sys','readFile','generateSessionTimelineRows','\x20modified','\x22\x20with\x20new\x20revision?','message','\x0aClone\x20\x22','cyan','cancelRequested','floor','pending','getTime','From\x20task:\x20','Pattern:\x20','resolveProjectDir','done','force','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','\x0a⚠\x20Project\x20\x22','\x0a✔\x20Already\x20up\x20to\x20date','Error:\x20Project\x20name\x20is\x20required','dim','requireProject','Validation:\x20skipped','Downloading\x20project\x20','List\x20workflow\x20execution\x20sessions','fileSize','\x22\x20already\x20exists\x20(ID:\x20','autocomplete','slice','end','blue','Using\x20attempt\x20','No\x20log\x20content\x20found','✔\x20Secret\x20\x27','projectName','4549280bGxzLD','path','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Setting\x20secret...','indexOf','find','No\x20sessions\x20found\x20in\x20project:\x20','newProjectName','durationMs','\x20\x20Session\x20context\x20set\x20to:\x20','start','Reason:\x20','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','MAX_TIMELINE_WIDTH','splice','basename','logs','round','Source\x20directory\x20is\x20required','POLL_INTERVAL_MS','has','workflow:workflows','renderSingleTimeline','text','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','rows','from','✔\x20Project\x20updated','\x0aPolling...\x20(','No\x20workflow\x20projects\x20found','skipValidation'];a43_0x4d0e=function(){return _0x450ac3;};return a43_0x4d0e();}import{confirmKey}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a43_0x32446c from'prompts';function getAttemptStatusDisplay(_0x57f69a){const _0x549e68=a43_0x2c2a;if(!_0x57f69a)return{'icon':'⏳','text':''};const {done:_0x227d4e,success:_0xc5f0aa,cancelRequested:_0x3895d8}=_0x57f69a;if(!_0x227d4e)return _0x3895d8?{'icon':'🛑','text':a43_0x2be135[_0x549e68(0x115)]('canceling')}:{'icon':'🔄','text':a43_0x2be135[_0x549e68(0x1cb)]('running')};if(_0xc5f0aa)return{'icon':'✅','text':a43_0x2be135['green'](_0x549e68(0xd3))};return{'icon':'❌','text':a43_0x2be135[_0x549e68(0x169)](_0x549e68(0x204))};}export class WorkflowBaseCommand extends BaseCommand{[a43_0x282876(0x82)](_0x1d7a0f,_0x143731,_0x5934ce=0x0){return _0x1d7a0f[_0x5934ce]||_0x143731['workflowProject'];}['requireProject'](_0x3c6428,_0x54b7a1,_0x5cd51a=0x0){const _0xa3e88d=a43_0x282876,_0x2ffced=this['resolveProject'](_0x3c6428,_0x54b7a1,_0x5cd51a);if(!_0x2ffced)return console[_0xa3e88d(0x204)](a43_0x2be135[_0xa3e88d(0x169)](_0xa3e88d(0x138)),_0xa3e88d(0x155)),console[_0xa3e88d(0x204)](a43_0x2be135[_0xa3e88d(0x1c1)](_0xa3e88d(0xa9))),null;return _0x2ffced;}['parseProjectWorkflowPattern'](_0x351988,_0x5bc33d){const _0x484357=a43_0x282876;if(_0x351988[0x0]){const _0x36dfc8=_0x351988[0x0][_0x484357(0xc2)]('.');if(_0x36dfc8[_0x484357(0xac)]===0x1)return{'projectName':_0x36dfc8[0x0],'workflowName':undefined};else return _0x36dfc8['length']===0x2?{'projectName':_0x36dfc8[0x0],'workflowName':_0x36dfc8[0x1]}:(console['error'](a43_0x2be135[_0x484357(0x169)](_0x484357(0x138)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x5bc33d[_0x484357(0x12f)],'workflowName':undefined};}[a43_0x282876(0x1ba)](_0x141c1c,_0x379b52,_0x92056a=0x0){const _0x3d73fd=a43_0x282876;if(_0x141c1c[_0x92056a])return _0x141c1c[_0x92056a];if(_0x379b52[_0x3d73fd(0x12f)]){const _0x5f2b2c=a43_0x3af4c2['join'](process['cwd'](),_0x3d73fd(0x176),_0x379b52[_0x3d73fd(0x12f)]);if(existsSync(a43_0x3af4c2['join'](_0x5f2b2c,_0x3d73fd(0x11d))))return _0x5f2b2c;}return undefined;}async[a43_0x282876(0x133)](_0x2b3861,_0x252387,_0x4697b8){const _0x3dece1=a43_0x282876;try{const _0x363481=await _0x2b3861[_0x3dece1(0x124)]['workflows'](_0x252387,{'limit':0x1});if(_0x363481[_0x3dece1(0xac)]>0x0){const _0x5df92a=_0x363481[0x0]['id'],_0x5c081a=getWorkflowUrl(_0x4697b8,_0x5df92a);console['error'](_0x3dece1(0x21a)+a43_0x2be135[_0x3dece1(0x1b3)](_0x5c081a));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a43_0x282876(0x1f2)]=a43_0x282876(0x113);[a43_0x282876(0x8a)]=a43_0x282876(0x18c);async[a43_0x282876(0xea)](_0xb624cd){const _0x19a472=a43_0x282876,{options:_0x1242b9,args:_0x1c2c27,tdx:_0x41afd6}=_0xb624cd,_0xfa9893=_0x1c2c27[0x0],_0x3609d0=_0x1242b9['clear'];if(_0x3609d0)return saveSessionContext({'workflow_project':undefined},_0x1242b9[_0x19a472(0xa7)]),console[_0x19a472(0x18e)](a43_0x2be135[_0x19a472(0xf2)](_0x19a472(0x179))),0x0;if(!_0xfa9893)return console[_0x19a472(0x204)](a43_0x2be135[_0x19a472(0x169)](_0x19a472(0x138)),_0x19a472(0x155)),console[_0x19a472(0x204)](a43_0x2be135[_0x19a472(0x1c1)](_0x19a472(0xee))),console[_0x19a472(0x204)](a43_0x2be135['dim'](_0x19a472(0x114))),0x1;const _0x91a25=await withSpinner(_0x19a472(0x17d)+_0xfa9893+_0x19a472(0x166),()=>_0x41afd6['workflow']['resolveProjectId'](_0xfa9893),{'verbose':_0x1242b9[_0x19a472(0xb6)]}),{name:_0xfcd79a}=_0x91a25['data'];return saveSessionContext({'workflow_project':_0xfcd79a},_0x1242b9[_0x19a472(0xa7)]),console[_0x19a472(0x18e)](a43_0x2be135[_0x19a472(0xf2)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a43_0x2be135[_0x19a472(0x1b3)](_0xfcd79a))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a43_0x282876(0x1f2)]=a43_0x282876(0x20a);[a43_0x282876(0x8a)]='List\x20all\x20workflow\x20projects';async[a43_0x282876(0xea)](_0x322d8e){const _0x4469f0=a43_0x282876,{options:_0x5a6c6c,args:_0x5e2b53,tdx:_0x5a3fe2}=_0x322d8e,_0x5505a0=_0x5e2b53[0x0];_0x5a6c6c[_0x4469f0(0xb6)]&&_0x5505a0&&console[_0x4469f0(0x204)](_0x4469f0(0x1b9)+_0x5505a0);const _0x2254a6=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x5a3fe2[_0x4469f0(0x124)][_0x4469f0(0x189)](_0x5505a0,{'limit':_0x5a6c6c['limit']}),{'verbose':_0x5a6c6c[_0x4469f0(0xb6)]});let _0x33e6c4=_0x2254a6[_0x4469f0(0x190)];_0x33e6c4[_0x4469f0(0x109)]((_0x286b59,_0x22217b)=>_0x286b59[_0x4469f0(0x1f2)][_0x4469f0(0xfd)](_0x22217b[_0x4469f0(0x1f2)]));const _0x12da87=_0x5a6c6c[_0x4469f0(0x177)]||0x64,_0x5775b0=_0x33e6c4[_0x4469f0(0xac)]>=_0x12da87?a43_0x2be135[_0x4469f0(0x1c1)](_0x4469f0(0xc5)):'';console[_0x4469f0(0x204)](_0x4469f0(0xda)+_0x33e6c4['length']+_0x4469f0(0x203)+(_0x33e6c4[_0x4469f0(0xac)]!==0x1?'s':'')+_0x5775b0);if(_0x5a6c6c[_0x4469f0(0x1f8)]===_0x4469f0(0x218)||_0x5a6c6c[_0x4469f0(0x1f8)]===_0x4469f0(0x164)||_0x5a6c6c[_0x4469f0(0x1f8)]===_0x4469f0(0x96))await handleSDKOutput(_0x33e6c4,_0x5a6c6c);else{if(_0x33e6c4[_0x4469f0(0xac)]===0x0)_0x5505a0?console[_0x4469f0(0x18e)](_0x4469f0(0xa2)+_0x5505a0):console[_0x4469f0(0x18e)](_0x4469f0(0x1ed));else{const _0x4fb811=_0x33e6c4[_0x4469f0(0x90)](_0x752f5e=>{const _0x21dd8a=_0x4469f0,_0x7b3278=_0x752f5e[_0x21dd8a(0x156)]?.['some'](_0x150233=>_0x150233[_0x21dd8a(0xc7)]===_0x21dd8a(0x1ac)),_0x4f9481=_0x7b3278?a43_0x2be135['dim'](_0x21dd8a(0x1a3)):'';return _0x21dd8a(0x188)+_0x752f5e[_0x21dd8a(0x1f2)]+_0x4f9481;});await writeOutput(_0x4fb811['join']('\x0a'),_0x5a6c6c[_0x4469f0(0xe2)],'list');}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a43_0x282876(0x1f2)]=a43_0x282876(0x1e5);[a43_0x282876(0x8a)]=a43_0x282876(0xeb);async[a43_0x282876(0xea)](_0x513545){const _0x39bcea=a43_0x282876,{options:_0x258f61,args:_0x36ed91,tdx:_0x28546a}=_0x513545,_0x441bd3=this[_0x39bcea(0x82)](_0x36ed91,_0x258f61);_0x258f61['verbose']&&_0x441bd3&&console[_0x39bcea(0x204)](_0x39bcea(0xf8)+_0x441bd3);const _0x27a802=await withSpinner(_0x39bcea(0xd5),()=>_0x28546a['workflow'][_0x39bcea(0x176)](_0x441bd3,{'limit':_0x258f61[_0x39bcea(0x177)]}),{'verbose':_0x258f61[_0x39bcea(0xb6)]});let _0x34ea37=_0x27a802[_0x39bcea(0x190)];_0x34ea37[_0x39bcea(0x109)]((_0x5160a4,_0x1a91b4)=>{const _0xf78a51=_0x39bcea,_0x50376d=_0x5160a4[_0xf78a51(0x1f2)]['localeCompare'](_0x1a91b4[_0xf78a51(0x1f2)]);if(_0x50376d!==0x0)return _0x50376d;return(_0x5160a4[_0xf78a51(0x162)]?.['name']||'')[_0xf78a51(0xfd)](_0x1a91b4[_0xf78a51(0x162)]?.[_0xf78a51(0x1f2)]||'');});const _0x573d10=_0x258f61[_0x39bcea(0x177)]||0x64,_0x4854fb=_0x34ea37[_0x39bcea(0xac)]>=_0x573d10?a43_0x2be135['dim'](_0x39bcea(0xc5)):'';console[_0x39bcea(0x204)](_0x39bcea(0xda)+_0x34ea37[_0x39bcea(0xac)]+_0x39bcea(0x15f)+(_0x34ea37[_0x39bcea(0xac)]!==0x1?'s':'')+_0x4854fb);if(_0x258f61['format']===_0x39bcea(0x218)||_0x258f61[_0x39bcea(0x1f8)]===_0x39bcea(0x164)||_0x258f61[_0x39bcea(0x1f8)]===_0x39bcea(0x96))await handleSDKOutput(_0x34ea37,_0x258f61);else{if(_0x34ea37[_0x39bcea(0xac)]===0x0)_0x441bd3?console['log'](_0x39bcea(0x145)+_0x441bd3):console['log']('No\x20workflows\x20found');else{const _0x451f15=_0x258f61[_0x39bcea(0x97)],_0x1f1043=_0x34ea37[_0x39bcea(0x90)](_0x179789=>{const _0x417b04=_0x39bcea,_0x10dd2e=a43_0x2be135[_0x417b04(0x1c1)]('#'+_0x179789['id']),_0x3a5f90=hyperlink(_0x10dd2e,getWorkflowUrl(_0x451f15,_0x179789['id'])),_0x2d278e=_0x179789['project']?.['name']?a43_0x2be135[_0x417b04(0x1c1)]('\x20('+_0x179789[_0x417b04(0x162)][_0x417b04(0x1f2)]+')'):'';return'📋\x20'+_0x3a5f90+'\x20'+_0x179789[_0x417b04(0x1f2)]+_0x2d278e;});await writeOutput(_0x1f1043[_0x39bcea(0x98)]('\x0a'),_0x258f61[_0x39bcea(0xe2)],_0x39bcea(0xd7));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a43_0x282876(0x1f2)]='workflow:sessions';[a43_0x282876(0x8a)]=a43_0x282876(0x1c5);async[a43_0x282876(0xea)](_0x19e68f){const _0x4ce46c=a43_0x282876,{options:_0x1ba18d,args:_0x19c814,tdx:_0x4ecd6c}=_0x19e68f,_0x542617=this[_0x4ce46c(0x120)](_0x19c814,_0x1ba18d);if(!_0x542617)return 0x1;const {projectName:_0x16713f,workflowName:_0x5bc85d}=_0x542617;if(_0x1ba18d[_0x4ce46c(0xb6)]){if(_0x16713f&&_0x5bc85d)console[_0x4ce46c(0x204)]('Filter:\x20'+_0x16713f+'.'+_0x5bc85d);else _0x16713f&&console['error'](_0x4ce46c(0x186)+_0x16713f);const _0x589ac6=_0x1ba18d[_0x4ce46c(0xef)];_0x589ac6&&console['error'](_0x4ce46c(0x1f1)+_0x589ac6);}let _0x196d3d=0x28;if(process[_0x4ce46c(0x16b)]['isTTY']&&!_0x1ba18d[_0x4ce46c(0xe2)]&&!_0x1ba18d[_0x4ce46c(0x1f8)]){const _0x391b37=process[_0x4ce46c(0x16b)][_0x4ce46c(0x1e9)]||0x28;_0x196d3d=Math[_0x4ce46c(0x219)](0x14,Math[_0x4ce46c(0x1b5)](_0x391b37*0x2/0x3));}const _0x2b037a=_0x1ba18d[_0x4ce46c(0x177)]||_0x196d3d,_0x1ed1fc=await withSpinner(_0x4ce46c(0xdc),()=>_0x4ecd6c['workflow'][_0x4ce46c(0x19a)]({'projectName':_0x16713f,'workflowName':_0x5bc85d,'status':_0x1ba18d[_0x4ce46c(0xef)],'fromTime':_0x1ba18d[_0x4ce46c(0x1ea)],'toTime':_0x1ba18d['to'],'limit':_0x2b037a}),{'verbose':_0x1ba18d[_0x4ce46c(0xb6)]}),_0x1d9d51=_0x1ed1fc[_0x4ce46c(0x190)];_0x1d9d51[_0x4ce46c(0x109)]((_0x1ce8e5,_0x38f1fc)=>{const _0x498b52=_0x4ce46c,_0x1d2978=_0x1ce8e5[_0x498b52(0x160)]||'',_0x485b64=_0x38f1fc['sessionTime']||'';return _0x485b64[_0x498b52(0xfd)](_0x1d2978);});_0x1d9d51[_0x4ce46c(0xac)]>=_0x2b037a?console['error'](_0x4ce46c(0xf9)+_0x1d9d51[_0x4ce46c(0xac)]+_0x4ce46c(0x1fe)+a43_0x2be135['dim']('(use\x20--limit\x20to\x20see\x20more)')):console[_0x4ce46c(0x204)](_0x4ce46c(0xda)+_0x1d9d51[_0x4ce46c(0xac)]+'\x20session'+(_0x1d9d51[_0x4ce46c(0xac)]!==0x1?'s':''));if(_0x1ba18d[_0x4ce46c(0x1f8)]===_0x4ce46c(0x218)||_0x1ba18d[_0x4ce46c(0x1f8)]==='jsonl'||_0x1ba18d[_0x4ce46c(0x1f8)]===_0x4ce46c(0x96))await handleSDKOutput(_0x1d9d51,_0x1ba18d);else{if(!process[_0x4ce46c(0x16b)][_0x4ce46c(0xfc)]||_0x1ba18d[_0x4ce46c(0xe2)]){if(_0x1d9d51[_0x4ce46c(0xac)]===0x0){if(_0x16713f&&_0x5bc85d)console[_0x4ce46c(0x18e)](_0x4ce46c(0x175)+_0x16713f+'.'+_0x5bc85d);else _0x16713f?console[_0x4ce46c(0x18e)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x16713f):console[_0x4ce46c(0x18e)](_0x4ce46c(0x13d));}else{const _0x4d4e5b=_0x1ba18d[_0x4ce46c(0x97)],_0x3529b2=this[_0x4ce46c(0xa5)](_0x1d9d51,_0x4d4e5b);_0x1ba18d['output']?await writeOutput(_0x3529b2,_0x1ba18d['output'],_0x4ce46c(0xd7)):console[_0x4ce46c(0x18e)](_0x3529b2);}!_0x16713f&&(console[_0x4ce46c(0x204)](''),console[_0x4ce46c(0x204)](a43_0x2be135[_0x4ce46c(0x1c1)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x4ce46c(0x204)](a43_0x2be135[_0x4ce46c(0x1c1)](_0x4ce46c(0x20b))+'or'+a43_0x2be135[_0x4ce46c(0x1c1)](_0x4ce46c(0x1a8))));}else{if(_0x1d9d51[_0x4ce46c(0xac)]===0x0){if(_0x16713f&&_0x5bc85d)console[_0x4ce46c(0x18e)]('No\x20sessions\x20found\x20for:\x20'+_0x16713f+'.'+_0x5bc85d);else _0x16713f?console[_0x4ce46c(0x18e)](_0x4ce46c(0x1d6)+_0x16713f):console[_0x4ce46c(0x18e)](_0x4ce46c(0x13d));}else await this[_0x4ce46c(0xb9)](_0x1d9d51,_0x19e68f,_0x16713f);}}return 0x0;}[a43_0x282876(0xa5)](_0x5e5ef1,_0x3b139d){const _0x33642c=a43_0x282876,_0x476ff9=[],_0x5db51b=new Map();let _0x12b208=Infinity,_0x4dd487=-Infinity;for(const _0x389694 of _0x5e5ef1){if(_0x389694[_0x33642c(0x144)]?.[_0x33642c(0x210)]){const _0x51cb4f=new Date(_0x389694[_0x33642c(0x144)][_0x33642c(0x210)])[_0x33642c(0x1b7)](),_0x20acd7=_0x389694[_0x33642c(0x144)][_0x33642c(0xaf)]?new Date(_0x389694[_0x33642c(0x144)][_0x33642c(0xaf)])[_0x33642c(0x1b7)]():Date[_0x33642c(0x14c)](),_0x83c8ba=_0x389694['project']?.[_0x33642c(0x1f2)]||_0x33642c(0x211);!_0x5db51b[_0x33642c(0x1e4)](_0x83c8ba)&&_0x5db51b['set'](_0x83c8ba,[]),_0x5db51b[_0x33642c(0xd4)](_0x83c8ba)[_0x33642c(0xcf)]({'session':_0x389694,'startTime':_0x51cb4f,'endTime':_0x20acd7,'duration':_0x20acd7-_0x51cb4f}),_0x12b208=Math['min'](_0x12b208,_0x51cb4f),_0x4dd487=Math[_0x33642c(0x219)](_0x4dd487,_0x20acd7);}}if(_0x5db51b[_0x33642c(0x11c)]===0x0)return _0x33642c(0xba);const _0x5c8d52=process[_0x33642c(0x16b)][_0x33642c(0x9d)]||0x78,_0xddb315=0x1e,_0x53eb84=0x32,_0x9fef32=0x4,_0x2a3602=Math[_0x33642c(0x8b)](_0x53eb84,Math[_0x33642c(0x219)](_0xddb315,Math['floor'](_0x5c8d52*0.3))),_0x167671=_0x5c8d52-_0x2a3602-TIMELINE_CONFIG[_0x33642c(0xd9)]-0x3-_0x9fef32,_0x5929f7=_0x4dd487-_0x12b208,_0x5d26ea=_0x5929f7/_0x2a3602,_0x53c5e2=renderTimeAxis({'startTime':_0x12b208,'endTime':_0x4dd487,'durationMs':_0x5929f7,'msPerChar':_0x5d26ea},_0x2a3602),_0x349cf0=[];for(const _0x3f8ee6 of _0x5db51b['values']()){_0x349cf0[_0x33642c(0xcf)](..._0x3f8ee6);}_0x349cf0['sort']((_0x4d78ad,_0x414c4c)=>_0x414c4c['startTime']-_0x4d78ad[_0x33642c(0x178)]);const _0x2b0bb6=new Date(_0x12b208),_0x5ab57b=formatDate(_0x2b0bb6),_0x9d7915=_0x9fef32+TIMELINE_CONFIG[_0x33642c(0x140)]+TIMELINE_CONFIG['ICON_SPACING']+_0x167671,_0x4545dd='\x20'['repeat'](_0x9d7915-_0x5ab57b[_0x33642c(0xac)]),_0x1dfd6d=_0x4545dd+a43_0x2be135[_0x33642c(0x1c1)](_0x5ab57b)+'\x20'+_0x53c5e2;_0x476ff9[_0x33642c(0xcf)](_0x1dfd6d);const _0x28399b=0x16;let _0x4898f0=0x0;for(const _0x19a167 of _0x349cf0){const _0x4aa3a6=_0x19a167[_0x33642c(0xa7)][_0x33642c(0x162)]?.['name']||'?',_0x58d4e6=Math[_0x33642c(0x8b)](stringWidth(_0x4aa3a6),_0x28399b);_0x4898f0=Math[_0x33642c(0x219)](_0x4898f0,_0x58d4e6);}for(const _0x1814d9 of _0x349cf0){const {session:_0x2d2017,startTime:_0x14c7e7,endTime:_0x2b6c9a,duration:_0x13654d}=_0x1814d9,_0x1d92bb=_0x2d2017[_0x33642c(0x162)]?.['id'],_0x2959c1=_0x2d2017['id'],_0x2c4637=_0x2d2017[_0x33642c(0x162)]?.[_0x33642c(0x1f2)]||'?',_0x4fc6b6=_0x2d2017[_0x33642c(0x124)]?.[_0x33642c(0x1f2)]||'?';let _0x27dea3,_0x265a0d;if(_0x2d2017[_0x33642c(0x144)]){const _0x11acbf=_0x2d2017['lastAttempt'];!_0x11acbf[_0x33642c(0x1bb)]?(_0x27dea3=_0x11acbf[_0x33642c(0x1b4)]?'🛑':'🔄',_0x265a0d=_0x11acbf['cancelRequested']?a43_0x2be135['yellow']:a43_0x2be135['blue']):(_0x27dea3=_0x11acbf[_0x33642c(0xd3)]?'✅':'❌',_0x265a0d=_0x11acbf[_0x33642c(0xd3)]?a43_0x2be135['green']:a43_0x2be135[_0x33642c(0x169)]);}else _0x27dea3='⏳',_0x265a0d=a43_0x2be135['dim'];const _0x163d90='#'+_0x2959c1,_0x41353a=_0x1d92bb?hyperlink(_0x163d90,getWorkflowSessionUrl(_0x3b139d,_0x1d92bb,_0x2959c1)):_0x163d90;let _0x5cead6=_0x2c4637;stringWidth(_0x2c4637)>_0x28399b&&(_0x5cead6=_0x2c4637['slice'](0x0,_0x28399b-0x1)+'…');const _0x2deb82=a43_0x2be135[_0x33642c(0x1c1)](_0x5cead6),_0x57579c=stringWidth(_0x5cead6),_0x413613='\x20'[_0x33642c(0x20f)](_0x4898f0-stringWidth(_0x5cead6)+0x2),_0x3d1ac5='('+formatElapsed(_0x13654d)+')',_0x33c741=stringWidth(_0x3d1ac5),_0x3fca63=stringWidth(_0x163d90),_0x3a3a22=_0x3fca63+0x1+_0x57579c+_0x413613[_0x33642c(0xac)],_0x238311=_0x167671-_0x3a3a22-_0x33c741-0x1-0x8;let _0x570b34=_0x4fc6b6;stringWidth(_0x570b34)>_0x238311&&(_0x570b34=_0x570b34['slice'](0x0,_0x238311-0x1)+'…');const _0xeadf44=_0x41353a+'\x20'+_0x2deb82+_0x413613+_0x570b34,_0x3fe7f1=stringWidth(_0xeadf44),_0x3a8f44=_0x167671-_0x3fe7f1-_0x33c741,_0xbb386f=_0xeadf44+'\x20'[_0x33642c(0x20f)](Math[_0x33642c(0x219)](0x1,_0x3a8f44))+a43_0x2be135[_0x33642c(0x1c1)](_0x3d1ac5),_0x4e0dd1=Math[_0x33642c(0x1b5)]((_0x14c7e7-_0x12b208)/_0x5d26ea),_0x143cb6=Math[_0x33642c(0x1b5)]((_0x2b6c9a-_0x12b208)/_0x5d26ea),_0x2d2dff=Math[_0x33642c(0x219)](_0x4e0dd1+0x1,_0x143cb6),_0x190c3d=new Array(_0x2a3602)[_0x33642c(0xbd)]('\x20');for(let _0xd6a6eb=_0x4e0dd1;_0xd6a6eb<Math[_0x33642c(0x8b)](_0x2d2dff,_0x2a3602);_0xd6a6eb++){_0x190c3d[_0xd6a6eb]='─';}const _0xfc703b=_0x190c3d['map'](_0x9761bb=>_0x9761bb==='\x20'?'\x20':_0x265a0d(_0x9761bb))[_0x33642c(0x98)]('');_0x476ff9[_0x33642c(0xcf)](_0x27dea3+'\x20'+_0xbb386f+'│'+_0xfc703b+'│');}return _0x476ff9[_0x33642c(0x98)]('\x0a');}async[a43_0x282876(0xb9)](_0x4a5485,_0x14e336,_0x4c1a9e){const _0x2bfca6=a43_0x282876,{options:_0x33984a,tdx:_0x27af97}=_0x14e336,_0x5d75cc=_0x33984a[_0x2bfca6(0x97)],{timelineRows:_0x1ffad8,timeAxisHeader:_0x446de0}=this['generateSessionTimelineRows'](_0x4a5485,_0x5d75cc),_0x4c29bc=_0x1ffad8[_0x2bfca6(0x9b)](_0x502f25=>_0x502f25[_0x2bfca6(0x1aa)]);if(_0x4c29bc[_0x2bfca6(0xac)]===0x0){const _0xb9c4c0=this[_0x2bfca6(0xa5)](_0x4a5485,_0x5d75cc);console[_0x2bfca6(0x18e)](_0xb9c4c0);!_0x4c1a9e&&(console[_0x2bfca6(0x204)](''),console[_0x2bfca6(0x204)](a43_0x2be135[_0x2bfca6(0x1c1)](_0x2bfca6(0x1fb))),console[_0x2bfca6(0x204)](a43_0x2be135['dim'](_0x2bfca6(0x20b))+'or'+a43_0x2be135[_0x2bfca6(0x1c1)](_0x2bfca6(0x1a8))));return;}_0x446de0&&console[_0x2bfca6(0x18e)](_0x446de0);const _0xd9d29d=_0x1ffad8[_0x2bfca6(0x9b)](_0x5681e9=>_0x5681e9[_0x2bfca6(0x1aa)])['map'](_0x39afa0=>({'title':_0x39afa0['displayLine'],'value':_0x39afa0['attemptId']})),_0x575a2e=process[_0x2bfca6(0x16b)][_0x2bfca6(0x1e9)]||0x3c,_0x106803=Math['max'](0x28,Math['floor'](_0x575a2e*0x2/0x3)),_0x4b1ec4=await a43_0x32446c({'type':_0x2bfca6(0x1c8),'name':_0x2bfca6(0x1aa),'message':_0x2bfca6(0x202),'choices':_0xd9d29d,'initial':-0x1,'limit':_0x106803,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x131ec0,_0x26e981)=>{const _0x428173=_0x2bfca6;if(!_0x131ec0)return Promise['resolve'](_0x26e981);const _0x300184=_0x26e981[_0x428173(0x9b)](_0x26f634=>{const _0x419ad9=_0x428173,_0x274356=_0x26f634;return _0x274356['title'][_0x419ad9(0x1a1)]()[_0x419ad9(0xc9)](_0x131ec0[_0x419ad9(0x1a1)]());});return Promise[_0x428173(0x173)](_0x300184);}}),_0x450048=()=>{const _0x1d5443=_0x2bfca6;process[_0x1d5443(0x16b)][_0x1d5443(0x195)]('\x1b[1A\x1b[2K'),process['stdout'][_0x1d5443(0x195)](_0x1d5443(0xcc)),process[_0x1d5443(0x16b)]['write'](_0x1d5443(0xcc));},_0xb50949=_0x4b1ec4&&_0x4b1ec4[_0x2bfca6(0x1aa)]&&_0x4b1ec4[_0x2bfca6(0x1aa)]!==null&&_0x4b1ec4[_0x2bfca6(0x1aa)]['trim']()!=='';if(!_0xb50949){_0x450048(),console[_0x2bfca6(0x18e)](a43_0x2be135[_0x2bfca6(0x1c1)]('Cancelled'));return;}_0x450048();const _0xca654b=_0x4a5485[_0x2bfca6(0x1d5)](_0x37020c=>_0x37020c['lastAttempt']?.['id']===_0x4b1ec4[_0x2bfca6(0x1aa)]);if(_0xca654b){const _0x224e06=_0xca654b[_0x2bfca6(0x162)]?.[_0x2bfca6(0x1f2)]||'?',_0x34421d=_0xca654b[_0x2bfca6(0x124)]?.['name']||'?';console[_0x2bfca6(0x18e)]('Project:\x20'+a43_0x2be135['dim'](_0x224e06)+_0x2bfca6(0x116)+a43_0x2be135[_0x2bfca6(0x1c1)](_0x34421d));}const _0x3d63e2=new WorkflowTimelineCommand();await _0x3d63e2[_0x2bfca6(0xea)]({'args':[],'options':{..._0x33984a,'attemptId':_0x4b1ec4[_0x2bfca6(0x1aa)]},'tdx':_0x27af97});}[a43_0x282876(0x1ae)](_0x1785e0,_0x1eeccb){const _0x1b5360=a43_0x282876,_0x3b2ce0=new Map();for(const _0x56c97f of _0x1785e0){_0x56c97f['id']&&_0x56c97f[_0x1b5360(0x144)]?.['id']&&_0x3b2ce0[_0x1b5360(0x84)](_0x56c97f['id'],_0x56c97f[_0x1b5360(0x144)]['id']);}const _0x4e0f62=[];let _0xf728d7='';const _0x43e0c1=this[_0x1b5360(0xa5)](_0x1785e0,_0x1eeccb),_0x5833de=_0x43e0c1[_0x1b5360(0xc2)]('\x0a');for(const _0x1eaff1 of _0x5833de){if(_0x1eaff1['startsWith']('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x1eaff1[_0x1b5360(0x12b)](/^\s+\d{4}-\d{2}-\d{2}/))_0xf728d7=_0x1eaff1;else{if(_0x1eaff1['match'](/^[✅❌🔄🛑⏳]/)){const _0x36ec37=_0x1eaff1[_0x1b5360(0x12b)](/#(\d+)/),_0x87c61b=_0x36ec37?_0x36ec37[0x1]:null,_0x16bce6=_0x87c61b?_0x3b2ce0[_0x1b5360(0xd4)](_0x87c61b)||null:null,_0x5554a8=_0x1785e0[_0x1b5360(0x1d5)](_0xc41966=>_0xc41966['id']===_0x87c61b),_0x24ab8d=_0x5554a8?.['project']?.[_0x1b5360(0x1f2)]||'';_0x4e0f62[_0x1b5360(0xcf)]({'displayLine':_0x1eaff1,'attemptId':_0x16bce6,'projectName':_0x24ab8d});}}}return{'timelineRows':_0x4e0f62,'timeAxisHeader':_0xf728d7};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a43_0x282876(0x1f2)]=a43_0x282876(0x122);[a43_0x282876(0x8a)]='List\x20workflow\x20attempts';async[a43_0x282876(0xea)](_0x45526b){const _0x1a07f3=a43_0x282876,{options:_0x38f27f,args:_0x2af03c,tdx:_0x1934c2}=_0x45526b,_0x168266=this[_0x1a07f3(0x120)](_0x2af03c,_0x38f27f);if(!_0x168266)return 0x1;const {projectName:_0x1a4125,workflowName:_0x759067}=_0x168266,_0xc3c454=_0x38f27f[_0x1a07f3(0x14d)];if(_0x38f27f[_0x1a07f3(0xb6)]){if(_0x1a4125&&_0x759067)console[_0x1a07f3(0x204)]('Filter:\x20'+_0x1a4125+'.'+_0x759067);else _0x1a4125&&console['error'](_0x1a07f3(0x186)+_0x1a4125);_0xc3c454&&console['error'](_0x1a07f3(0x217));}const _0x15eac3=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x1934c2[_0x1a07f3(0x124)][_0x1a07f3(0x183)]({'projectName':_0x1a4125,'workflowName':_0x759067,'includeRetried':_0xc3c454,'limit':_0x38f27f[_0x1a07f3(0x177)]}),{'verbose':_0x38f27f[_0x1a07f3(0xb6)]}),_0x2b0b93=_0x15eac3['data'],_0x51a035=_0x38f27f['limit']||0x64,_0x54766f=_0x2b0b93[_0x1a07f3(0xac)]>=_0x51a035?a43_0x2be135[_0x1a07f3(0x1c1)](_0x1a07f3(0xc5)):'';console[_0x1a07f3(0x204)](_0x1a07f3(0xda)+_0x2b0b93[_0x1a07f3(0xac)]+'\x20attempt'+(_0x2b0b93[_0x1a07f3(0xac)]!==0x1?'s':'')+_0x54766f);if(_0x38f27f[_0x1a07f3(0x1f8)]===_0x1a07f3(0x218)||_0x38f27f[_0x1a07f3(0x1f8)]==='jsonl'||_0x38f27f[_0x1a07f3(0x1f8)]===_0x1a07f3(0x96))await handleSDKOutput(_0x2b0b93,_0x38f27f);else{if(_0x2b0b93[_0x1a07f3(0xac)]===0x0){if(_0x1a4125&&_0x759067)console[_0x1a07f3(0x18e)](_0x1a07f3(0xf3)+_0x1a4125+'.'+_0x759067);else _0x1a4125?console[_0x1a07f3(0x18e)]('No\x20attempts\x20found\x20in\x20project:\x20'+_0x1a4125):console[_0x1a07f3(0x18e)](_0x1a07f3(0x94));}else{const _0x33dba4=_0x38f27f[_0x1a07f3(0x97)],_0x33f19b=_0x2b0b93[_0x1a07f3(0x90)](_0x296bdc=>{const _0x11078b=_0x1a07f3,_0x39c3b1=a43_0x2be135[_0x11078b(0x1c1)]('#'+_0x296bdc['id']),_0x71f6a=_0x296bdc[_0x11078b(0x162)]?.['id'],_0x44b3f8=_0x296bdc[_0x11078b(0x12d)]||_0x296bdc[_0x11078b(0x1a0)],_0x42b364=_0x71f6a&&_0x44b3f8?hyperlink(_0x39c3b1,getWorkflowAttemptUrl(_0x33dba4,_0x71f6a,_0x44b3f8,_0x296bdc['id'])):_0x39c3b1,{icon:_0x2dd225,text:_0x598bd1}=getAttemptStatusDisplay(_0x296bdc),_0x24100e=(_0x296bdc[_0x11078b(0x162)]?.['name']||'?')+'.'+(_0x296bdc[_0x11078b(0x124)]?.[_0x11078b(0x1f2)]||'?'),_0x1d0b2a=_0x296bdc[_0x11078b(0x160)]?a43_0x2be135[_0x11078b(0x1c1)](_0x296bdc[_0x11078b(0x160)]):'';return(_0x42b364+'\x20'+_0x2dd225+(_0x598bd1?'\x20'+_0x598bd1:'')+'\x20'+_0x24100e+'\x20'+_0x1d0b2a)['trimEnd']();});await writeOutput(_0x33f19b['join']('\x0a'),_0x38f27f[_0x1a07f3(0xe2)],_0x1a07f3(0xd7));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a43_0x282876(0x1f2)]=a43_0x282876(0x16e);['description']='Show\x20specific\x20attempt\x20details';async['execute'](_0x503382){const _0x86d6c9=a43_0x282876,{options:_0x2dba5a,args:_0x1473f9,tdx:_0x40a1ee}=_0x503382,_0x4e7742=_0x1473f9[0x0];if(!_0x4e7742)return console[_0x86d6c9(0x204)](_0x86d6c9(0x12e)),0x1;_0x2dba5a[_0x86d6c9(0xb6)]&&console['error'](_0x86d6c9(0x20e)+_0x4e7742);const _0x1813fc=await withSpinner('Getting\x20attempt\x20details...',()=>_0x40a1ee[_0x86d6c9(0x124)][_0x86d6c9(0x13f)](_0x4e7742),{'verbose':_0x2dba5a[_0x86d6c9(0xb6)]}),_0x44c8a3=_0x1813fc[_0x86d6c9(0x190)];let _0x421014;!_0x44c8a3[_0x86d6c9(0x1bb)]?_0x421014=_0x44c8a3[_0x86d6c9(0x1b4)]?_0x86d6c9(0x107):_0x86d6c9(0x92):_0x421014=_0x44c8a3['success']?_0x86d6c9(0xd3):'error';let _0x174eeb;if(_0x44c8a3[_0x86d6c9(0x210)]&&_0x44c8a3[_0x86d6c9(0xaf)]){const _0x5582db=new Date(_0x44c8a3[_0x86d6c9(0x210)])[_0x86d6c9(0x1b7)](),_0x18e77a=new Date(_0x44c8a3['finishedAt'])['getTime']();_0x174eeb=Math[_0x86d6c9(0x1e1)]((_0x18e77a-_0x5582db)/0x3e8);}const _0x591c73={'attempt_id':_0x44c8a3['id'],'status':_0x421014,..._0x44c8a3[_0x86d6c9(0xca)]!==undefined&&{'index':_0x44c8a3[_0x86d6c9(0xca)]},..._0x44c8a3[_0x86d6c9(0x162)]&&{'project':_0x44c8a3[_0x86d6c9(0x162)][_0x86d6c9(0x1f2)]},..._0x44c8a3[_0x86d6c9(0x124)]&&{'workflow':_0x44c8a3[_0x86d6c9(0x124)][_0x86d6c9(0x1f2)]},..._0x44c8a3[_0x86d6c9(0x1a0)]&&{'session_id':_0x44c8a3[_0x86d6c9(0x1a0)]},..._0x44c8a3[_0x86d6c9(0x160)]&&{'session_time':_0x44c8a3[_0x86d6c9(0x160)]},..._0x44c8a3[_0x86d6c9(0xad)]&&{'retry_attempt':_0x44c8a3['retryAttemptName']},..._0x174eeb!==undefined&&{'duration_sec':_0x174eeb},..._0x44c8a3['createdAt']&&{'created_at':_0x44c8a3[_0x86d6c9(0x210)]},..._0x44c8a3[_0x86d6c9(0xaf)]&&{'finished_at':_0x44c8a3['finishedAt']},...Object[_0x86d6c9(0x18a)](_0x44c8a3[_0x86d6c9(0xcb)])[_0x86d6c9(0xac)]>0x0&&{'params':_0x44c8a3[_0x86d6c9(0xcb)]}};return await handleSingleObjectOutput(_0x591c73,_0x2dba5a),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a43_0x282876(0x1f2)]='workflow:tasks';[a43_0x282876(0x8a)]=a43_0x282876(0xb7);async[a43_0x282876(0xea)](_0x5ed0dc){const _0x28c9ed=a43_0x282876,{options:_0x30291b,args:_0x4e3381,tdx:_0x2274ca}=_0x5ed0dc,_0x22f9e0=_0x4e3381[0x0];if(!_0x22f9e0)return console[_0x28c9ed(0x204)](_0x28c9ed(0x12e)),0x1;const _0x2df5fb=_0x30291b[_0x28c9ed(0x126)];_0x30291b[_0x28c9ed(0xb6)]&&(console['error'](_0x28c9ed(0x20e)+_0x22f9e0),_0x2df5fb&&console[_0x28c9ed(0x204)](_0x28c9ed(0x100)));const _0x350ba4=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x2274ca['workflow'][_0x28c9ed(0x170)](_0x22f9e0,_0x2df5fb||![]),{'verbose':_0x30291b[_0x28c9ed(0xb6)]}),_0x51fbbe=_0x350ba4[_0x28c9ed(0x190)];return console[_0x28c9ed(0x204)](_0x28c9ed(0xda)+_0x51fbbe[_0x28c9ed(0xac)]+_0x28c9ed(0xe0)+(_0x51fbbe[_0x28c9ed(0xac)]!==0x1?'s':'')),await handleSDKOutput(_0x51fbbe,_0x30291b),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a43_0x282876(0x1f2)]=a43_0x282876(0x117);['description']='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a43_0x282876(0xea)](_0x451cca){const _0x44aabf=a43_0x282876,{options:_0x14de2d,args:_0x569e2d,tdx:_0x337828}=_0x451cca,_0x27188b=_0x569e2d[0x0];let _0x3f23ef=_0x569e2d[0x1];if(!_0x27188b)return console[_0x44aabf(0x204)](_0x44aabf(0x12e)),0x1;_0x14de2d['verbose']&&(console[_0x44aabf(0x204)](_0x44aabf(0x20e)+_0x27188b),_0x3f23ef&&console['error']('Task\x20name:\x20'+_0x3f23ef));const _0x19fda7=await withSpinner(_0x44aabf(0x9f),()=>_0x337828[_0x44aabf(0x124)]['logFiles'](_0x27188b,_0x3f23ef),{'verbose':_0x14de2d[_0x44aabf(0xb6)]}),_0x280d3e=_0x19fda7[_0x44aabf(0x190)];if(_0x280d3e[_0x44aabf(0xac)]===0x0)return console['error']('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x3f23ef&&(_0x14de2d[_0x44aabf(0x218)]||_0x14de2d[_0x44aabf(0x1f8)]))return await handleSDKOutput(_0x280d3e,_0x14de2d),0x0;if(!_0x3f23ef){const _0x2e2bda=_0x280d3e[_0x44aabf(0x90)](_0x246403=>({'title':_0x246403[_0x44aabf(0x171)]+'\x20('+formatBytes(_0x246403[_0x44aabf(0x1c6)])+')','value':_0x246403[_0x44aabf(0x171)]})),_0x596f2f=await a43_0x32446c({'type':'select','name':'task','message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x2e2bda});if(!_0x596f2f['task'])return console['error'](_0x44aabf(0x83)),0x0;_0x3f23ef=_0x596f2f[_0x44aabf(0x212)];}const _0x469993=await withSpinner('Downloading\x20logs...',()=>_0x337828[_0x44aabf(0x124)][_0x44aabf(0x1e0)](_0x27188b,_0x3f23ef),{'verbose':_0x14de2d[_0x44aabf(0xb6)]}),_0x5a5675=_0x469993[_0x44aabf(0x190)];return _0x5a5675?console['log'](_0x5a5675):console[_0x44aabf(0x204)](_0x44aabf(0x1cd)),0x0;}}export class WorkflowKillCommand extends BaseCommand{['name']='workflow:kill';[a43_0x282876(0x8a)]='Kill\x20a\x20running\x20attempt';async[a43_0x282876(0xea)](_0x41e9d3){const _0x46406b=a43_0x282876,{options:_0x6df125,args:_0x4766f6,tdx:_0x4c143a}=_0x41e9d3,_0x207074=_0x4766f6[0x0];if(!_0x207074)return console[_0x46406b(0x204)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x4732e5=_0x6df125[_0x46406b(0xde)];_0x6df125['verbose']&&(console[_0x46406b(0x204)]('Attempt\x20ID:\x20'+_0x207074),_0x4732e5&&console[_0x46406b(0x204)](_0x46406b(0x1db)+_0x4732e5));if(!_0x6df125[_0x46406b(0x193)]){const _0x2ecbd1=await confirmKey(_0x46406b(0x14f)+_0x207074+'?');if(!_0x2ecbd1)return console['error'](_0x46406b(0x83)),0x0;}const _0x1ee6da=await withSpinner(_0x46406b(0x1f9),()=>_0x4c143a['workflow']['kill'](_0x207074,_0x4732e5),{'verbose':_0x6df125[_0x46406b(0xb6)]}),_0x3e6990=_0x1ee6da['data'];return console[_0x46406b(0x204)]('✔\x20'+_0x3e6990),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a43_0x282876(0x1f2)]='workflow:retry';[a43_0x282876(0x8a)]='Retry\x20a\x20session\x20or\x20attempt';async['execute'](_0x4e385f){const _0x6bc5f3=a43_0x282876,{options:_0x46bff0,args:_0x13094c,tdx:_0x5cf56e}=_0x4e385f,_0x5e6ae4=_0x13094c[0x0];if(!_0x5e6ae4)return console[_0x6bc5f3(0x204)](_0x6bc5f3(0x209)),console[_0x6bc5f3(0x204)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x2df662=![],_0x42c824=_0x5e6ae4;if(_0x5e6ae4[_0x6bc5f3(0x14a)](_0x6bc5f3(0xb8)))_0x2df662=!![],_0x42c824=_0x5e6ae4[_0x6bc5f3(0xd2)](0x8);else{if(_0x5e6ae4[_0x6bc5f3(0x14a)](_0x6bc5f3(0x9c)))_0x2df662=![],_0x42c824=_0x5e6ae4[_0x6bc5f3(0xd2)](0x8);else return console['error']('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0x6bc5f3(0x204)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x1e2636=_0x46bff0[_0x6bc5f3(0xc4)],_0x2cca85=_0x46bff0[_0x6bc5f3(0x104)],_0x3b52bb=_0x46bff0[_0x6bc5f3(0xcb)],_0x1904cd=_0x46bff0[_0x6bc5f3(0x1bc)];_0x46bff0[_0x6bc5f3(0xb6)]&&(console[_0x6bc5f3(0x204)](_0x6bc5f3(0x206)+(_0x2df662?'session':'attempt')+'\x20'+_0x42c824),_0x1e2636&&console['error'](_0x6bc5f3(0x1b8)+_0x1e2636),_0x2cca85&&console['error'](_0x6bc5f3(0xe9)+_0x2cca85),_0x3b52bb&&console[_0x6bc5f3(0x204)](_0x6bc5f3(0x159)+_0x3b52bb),_0x1904cd&&console['error'](_0x6bc5f3(0xa0)));let _0x1710a0;if(_0x3b52bb)try{if(_0x3b52bb[_0x6bc5f3(0x14a)]('@')){const _0x1954cb=await import(_0x6bc5f3(0x88)),_0x1916df=_0x3b52bb[_0x6bc5f3(0xd2)](0x1),_0x407630=await _0x1954cb[_0x6bc5f3(0x1ad)](_0x1916df,_0x6bc5f3(0x141));_0x1710a0=JSON[_0x6bc5f3(0xbb)](_0x407630);}else _0x1710a0=JSON[_0x6bc5f3(0xbb)](_0x3b52bb);}catch{return console[_0x6bc5f3(0x204)](_0x6bc5f3(0x215)),0x1;}if(!_0x46bff0[_0x6bc5f3(0x193)]){const _0x27b4d4=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x2df662?'session':'attempt')+'\x20'+_0x42c824+'?');if(!_0x27b4d4)return console[_0x6bc5f3(0x204)](_0x6bc5f3(0x83)),0x0;}let _0x268b1b;_0x2df662?_0x268b1b=await withSpinner('Retrying\x20session...',()=>_0x5cf56e[_0x6bc5f3(0x124)]['retrySession'](_0x42c824,{'fromTask':_0x1e2636,'retryParams':_0x1710a0}),{'verbose':_0x46bff0[_0x6bc5f3(0xb6)]}):_0x268b1b=await withSpinner('Retrying\x20attempt...',()=>_0x5cf56e['workflow'][_0x6bc5f3(0x198)](_0x42c824,{'resumeFrom':_0x2cca85,'retryParams':_0x1710a0,'force':_0x1904cd}),{'verbose':_0x46bff0[_0x6bc5f3(0xb6)]});const _0x54bafe=_0x268b1b[_0x6bc5f3(0x190)];return console[_0x6bc5f3(0x204)]('✔\x20Retry\x20started'),console[_0x6bc5f3(0x204)](_0x6bc5f3(0xb4)+_0x54bafe[_0x6bc5f3(0x1aa)]),console[_0x6bc5f3(0x204)](_0x6bc5f3(0x134)+_0x54bafe[_0x6bc5f3(0x1a0)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a43_0x282876(0x1f2)]=a43_0x282876(0x1fd);[a43_0x282876(0x8a)]=a43_0x282876(0x13a);async[a43_0x282876(0xea)](_0x54fc0a){const _0x980c90=a43_0x282876,{options:_0x152006,args:_0x16b6cc,tdx:_0x5d5f55}=_0x54fc0a;let _0x2074e4=_0x16b6cc[0x0];if(!_0x2074e4){const _0x5b8df1=this['resolveProject']([],_0x152006),_0x4ff882=await withSpinner(_0x980c90(0x205),()=>_0x5d5f55[_0x980c90(0x124)][_0x980c90(0x176)](_0x5b8df1,{'limit':_0x152006[_0x980c90(0x177)]}),{'verbose':_0x152006[_0x980c90(0xb6)]}),_0x474057=_0x4ff882['data'];if(_0x474057[_0x980c90(0xac)]===0x0)return console['error']('No\x20workflows\x20found'),!_0x5b8df1&&console[_0x980c90(0x204)](a43_0x2be135[_0x980c90(0x1c1)](_0x980c90(0xa9))),0x1;const _0x491bbf=_0x474057[_0x980c90(0x90)](_0x3c2365=>({'title':_0x3c2365['project']?.[_0x980c90(0x1f2)]+'.'+_0x3c2365[_0x980c90(0x1f2)],'value':_0x3c2365[_0x980c90(0x162)]?.[_0x980c90(0x1f2)]+'.'+_0x3c2365['name'],'description':_0x3c2365[_0x980c90(0x199)]?_0x980c90(0xf4)+_0x3c2365[_0x980c90(0x199)]:undefined})),_0x2fa90c=await a43_0x32446c({'type':_0x980c90(0x16f),'name':_0x980c90(0x124),'message':_0x980c90(0xe5),'choices':_0x491bbf});if(!_0x2fa90c['workflow'])return 0x1;_0x2074e4=_0x2fa90c[_0x980c90(0x124)];}if(!_0x2074e4['includes']('.')){const _0x11530c=this['resolveProject']([],_0x152006);if(_0x11530c)_0x2074e4=_0x11530c+'.'+_0x2074e4;else return console[_0x980c90(0x204)](a43_0x2be135[_0x980c90(0x169)](_0x980c90(0x138)),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console[_0x980c90(0x204)](a43_0x2be135[_0x980c90(0x1c1)](_0x980c90(0xa9))),0x1;}const _0xbd3b6a=_0x152006[_0x980c90(0x1f6)],_0x25a52b=_0x152006[_0x980c90(0x160)],_0x24e4fd={};if(_0xbd3b6a&&Array[_0x980c90(0x197)](_0xbd3b6a))for(const _0x39e425 of _0xbd3b6a){const _0x528574=_0x39e425[_0x980c90(0x1d4)]('=');if(_0x528574===-0x1)return console[_0x980c90(0x204)](_0x980c90(0x1f7)+_0x39e425),console['error'](_0x980c90(0xc8)),0x1;const _0x12aafd=_0x39e425[_0x980c90(0xd2)](0x0,_0x528574),_0x41588c=_0x39e425[_0x980c90(0xd2)](_0x528574+0x1);try{_0x24e4fd[_0x12aafd]=JSON['parse'](_0x41588c);}catch{_0x24e4fd[_0x12aafd]=_0x41588c;}}_0x152006[_0x980c90(0xb6)]&&(console[_0x980c90(0x204)](_0x980c90(0xe8)+_0x2074e4),Object[_0x980c90(0x18a)](_0x24e4fd)['length']>0x0&&console[_0x980c90(0x204)](_0x980c90(0x12c)+JSON[_0x980c90(0x130)](_0x24e4fd)),_0x25a52b&&console[_0x980c90(0x204)]('Session\x20time:\x20'+_0x25a52b));const _0x284e23=await withSpinner(_0x980c90(0xfb),()=>_0x5d5f55[_0x980c90(0x124)][_0x980c90(0x111)](_0x2074e4,_0x24e4fd,{'sessionTime':_0x25a52b}),{'verbose':_0x152006['verbose']}),_0x2207ef=_0x284e23['data'];console[_0x980c90(0x204)]('✔\x20Workflow\x20run\x20started'),console[_0x980c90(0x204)]('\x20\x20Attempt\x20ID:\x20'+_0x2207ef['id']),console[_0x980c90(0x204)](_0x980c90(0x134)+_0x2207ef['sessionId']),console[_0x980c90(0x204)]('\x20\x20Project:\x20'+_0x2207ef[_0x980c90(0x162)]?.['name']),console[_0x980c90(0x204)](_0x980c90(0xaa)+_0x2207ef[_0x980c90(0x124)]?.['name']);if(_0x2207ef['project']?.['id']&&_0x2207ef[_0x980c90(0x1a0)]&&_0x2207ef['id']){const _0xfbaa64=_0x152006[_0x980c90(0x97)],_0x4b4e52=getConsoleUrl(_0xfbaa64,_0x980c90(0x121)+_0x2207ef[_0x980c90(0x162)]['id']+'/sessions/'+_0x2207ef['sessionId']+_0x980c90(0x123)+_0x2207ef['id']);console[_0x980c90(0x204)]('\x20\x20Console:\x20'+a43_0x2be135[_0x980c90(0x1b3)](_0x4b4e52));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a43_0x282876(0x1f2)]=a43_0x282876(0xc1);[a43_0x282876(0x8a)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a43_0x282876(0xea)](_0x3f8a9c){const _0xb9ea92=a43_0x282876,{options:_0x2e5a03,args:_0x8fdcd,tdx:_0x2fbbb6}=_0x3f8a9c,_0x4b6ac3=_0x8fdcd[0x0],_0x2ec427=_0x8fdcd[0x1]||'.';if(!_0x4b6ac3)return console['error'](_0xb9ea92(0x1c0)),console[_0xb9ea92(0x204)](_0xb9ea92(0x20c)),0x1;const _0x3743f0=_0x2e5a03['revision'];_0x2e5a03[_0xb9ea92(0xb6)]&&(console[_0xb9ea92(0x204)](_0xb9ea92(0xb1)+_0x4b6ac3),console[_0xb9ea92(0x204)](_0xb9ea92(0x11a)+_0x2ec427),_0x3743f0&&console[_0xb9ea92(0x204)](_0xb9ea92(0xa4)+_0x3743f0));const _0x5f1665=await withSpinner(_0xb9ea92(0x1c4)+_0x4b6ac3+'...',()=>_0x2fbbb6[_0xb9ea92(0x124)]['download'](_0x4b6ac3,_0x2ec427,{'revision':_0x3743f0}),{'verbose':_0x2e5a03[_0xb9ea92(0xb6)]}),_0x5775cf=_0x5f1665[_0xb9ea92(0x190)];return console[_0xb9ea92(0x204)]('✔\x20Downloaded\x20'+_0x5775cf['projectName']),console['error']('\x20\x20Revision:\x20'+_0x5775cf['revision']),console[_0xb9ea92(0x204)]('\x20\x20Files\x20extracted:\x20'+_0x5775cf[_0xb9ea92(0x1fa)]),console[_0xb9ea92(0x204)](_0xb9ea92(0x10d)+_0x2ec427+'/'+_0x5775cf[_0xb9ea92(0x1cf)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a43_0x282876(0x1f2)]='workflow:upload';['description']=a43_0x282876(0xc6);async[a43_0x282876(0xea)](_0x35087b){const _0x438f07=a43_0x282876,{options:_0x2f22eb,args:_0x17db07,tdx:_0x4d2bfb}=_0x35087b;let _0x27ce8d='.',_0x5be15f=_0x2f22eb[_0x438f07(0x1f2)];if(_0x17db07[0x0]){const {promises:_0x51d5a7}=await import('fs');try{const _0x3f2953=await _0x51d5a7[_0x438f07(0x10e)](_0x17db07[0x0]);if(_0x3f2953['isDirectory']())_0x27ce8d=_0x17db07[0x0];else return console['error']('Error:\x20'+_0x17db07[0x0]+_0x438f07(0x201)),0x1;}catch{_0x5be15f=_0x17db07[0x0],_0x27ce8d='.';}}const _0x124ed5=_0x2f22eb['revision'],_0xc50253=_0x2f22eb[_0x438f07(0x1ee)];_0x2f22eb[_0x438f07(0xb6)]&&(console[_0x438f07(0x204)](_0x438f07(0x14e)+_0x27ce8d),_0x5be15f&&console[_0x438f07(0x204)](_0x438f07(0x127)+_0x5be15f),_0x124ed5&&console['error'](_0x438f07(0xa4)+_0x124ed5),_0xc50253&&console['error'](_0x438f07(0x1c3)));const _0x3fcc4b=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x4d2bfb[_0x438f07(0x124)][_0x438f07(0xcf)](_0x27ce8d,{'projectName':_0x5be15f,'revision':_0x124ed5,'skipValidation':_0xc50253}),{'verbose':_0x2f22eb[_0x438f07(0xb6)]}),_0x3dbfcf=_0x3fcc4b['data'];return console[_0x438f07(0x204)](_0x438f07(0xf1)+_0x3dbfcf[_0x438f07(0x1cf)]),console['error'](_0x438f07(0xbf)+_0x3dbfcf[_0x438f07(0xab)]),console[_0x438f07(0x204)]('\x20\x20Revision:\x20'+_0x3dbfcf[_0x438f07(0x199)]),await this[_0x438f07(0x133)](_0x4d2bfb,_0x3dbfcf[_0x438f07(0x1cf)],_0x2f22eb[_0x438f07(0x97)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']=a43_0x282876(0x95);[a43_0x282876(0x8a)]=a43_0x282876(0xdb);async[a43_0x282876(0xea)](_0x2ab6c9){const _0x526747=a43_0x282876,{options:_0x26367f,args:_0x5a4a52,tdx:_0x3dc97c}=_0x2ab6c9,_0x1d80dc=_0x5a4a52[0x0],_0x10f3f7=_0x5a4a52[0x1];if(!_0x1d80dc)return console[_0x526747(0x204)](a43_0x2be135[_0x526747(0x169)]('Error:'),_0x526747(0x155)),console['error'](a43_0x2be135[_0x526747(0x1c1)](_0x526747(0x148))),0x1;const _0x6a7b4d=_0x26367f['revision'];_0x26367f[_0x526747(0xb6)]&&(console[_0x526747(0x204)](_0x526747(0xb1)+_0x1d80dc),_0x10f3f7&&console[_0x526747(0x204)](_0x526747(0x17a)+_0x10f3f7),_0x6a7b4d&&console[_0x526747(0x204)](_0x526747(0xa4)+_0x6a7b4d),_0x26367f[_0x526747(0xd6)]&&console[_0x526747(0x204)](_0x526747(0x10a)));const _0x18d840=await withSpinner(_0x526747(0x1a6)+_0x1d80dc+'...',()=>_0x3dc97c[_0x526747(0x124)]['pullProject'](_0x1d80dc,{'targetDir':_0x10f3f7,'revision':_0x6a7b4d}),{'verbose':_0x26367f[_0x526747(0xb6)]}),_0x19468d=_0x18d840[_0x526747(0x190)];_0x19468d[_0x526747(0x19f)]?console['error'](_0x526747(0xd1)+_0x19468d['projectName']):console['error']('✔\x20Project:\x20'+_0x19468d[_0x526747(0x1cf)]);console[_0x526747(0x204)](_0x526747(0x11e)+_0x19468d[_0x526747(0x199)]),console[_0x526747(0x204)](_0x526747(0x174)+(a43_0x3af4c2['relative'](process[_0x526747(0x1f3)](),_0x19468d[_0x526747(0xae)])||'.')),console[_0x526747(0x204)](_0x526747(0xe1)+a43_0x2be135[_0x526747(0xf2)]('+'+_0x19468d[_0x526747(0x131)][_0x526747(0xf6)]+_0x526747(0x1a7))+',\x20'+(a43_0x2be135[_0x526747(0x115)]('~'+_0x19468d[_0x526747(0x131)][_0x526747(0x153)]+_0x526747(0x1af))+',\x20')+(a43_0x2be135[_0x526747(0x169)]('-'+_0x19468d[_0x526747(0x131)][_0x526747(0x9e)]+_0x526747(0xe6))+',\x20')+(''+a43_0x2be135[_0x526747(0x1c1)](_0x19468d['summary'][_0x526747(0x132)]+'\x20unchanged')));for(const _0x5d4503 of _0x19468d['changes']){_0x5d4503[_0x526747(0x185)]===_0x526747(0x153)&&_0x5d4503[_0x526747(0x147)]&&(console[_0x526747(0x204)]('\x0a'+a43_0x2be135[_0x526747(0x1b3)](_0x526747(0x15c)+_0x5d4503[_0x526747(0x1d1)])),console[_0x526747(0x204)](_0x5d4503[_0x526747(0x147)]));}if(!_0x19468d[_0x526747(0x1a9)])return saveSessionContext({'workflow_project':_0x19468d[_0x526747(0x1cf)]},_0x26367f['session']),console[_0x526747(0x204)](a43_0x2be135[_0x526747(0xf2)](_0x526747(0x1bf))),console[_0x526747(0x204)](a43_0x2be135[_0x526747(0x1c1)](_0x526747(0x1d9)+_0x19468d[_0x526747(0x1cf)])),0x0;if(_0x26367f[_0x526747(0xd6)])return console[_0x526747(0x204)](a43_0x2be135[_0x526747(0x115)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x26367f['yes']){const _0x349a3c=await confirmKey(_0x526747(0x93));if(!_0x349a3c)return console[_0x526747(0x204)]('Cancelled'),0x0;}await withSpinner(_0x526747(0xfe),()=>_0x3dc97c[_0x526747(0x124)]['applyPullProject'](_0x19468d,{'revision':_0x6a7b4d}),{'verbose':_0x26367f[_0x526747(0xb6)]}),saveSessionContext({'workflow_project':_0x19468d['projectName']},_0x26367f[_0x526747(0xa7)]),console['error'](a43_0x2be135[_0x526747(0xf2)]('✔\x20Pull\x20complete'));const _0x2a7c02=a43_0x3af4c2[_0x526747(0xc3)](process[_0x526747(0x1f3)](),_0x19468d[_0x526747(0xae)])||'.';return console[_0x526747(0x204)](a43_0x2be135[_0x526747(0x1c1)](_0x526747(0x10d)+_0x2a7c02)),console[_0x526747(0x204)](a43_0x2be135[_0x526747(0x1c1)](_0x526747(0x1d9)+_0x19468d[_0x526747(0x1cf)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a43_0x282876(0x1f2)]=a43_0x282876(0x1f0);[a43_0x282876(0x8a)]=a43_0x282876(0x14b);async[a43_0x282876(0xea)](_0x4df75d){const _0x32510d=a43_0x282876,{options:_0x46cbf1,args:_0x2ed44a,tdx:_0x36cf90}=_0x4df75d,_0x4a8e60=this[_0x32510d(0x1ba)](_0x2ed44a,_0x46cbf1),_0x181781=_0x46cbf1[_0x32510d(0x199)],_0x27f302=_0x46cbf1['skipValidation'];_0x46cbf1['verbose']&&(_0x4a8e60&&console[_0x32510d(0x204)](_0x32510d(0x103)+_0x4a8e60),_0x181781&&console[_0x32510d(0x204)]('Revision:\x20'+_0x181781),_0x46cbf1['dryRun']&&console[_0x32510d(0x204)]('Dry\x20run:\x20yes'),_0x27f302&&console[_0x32510d(0x204)](_0x32510d(0x1c3)));let _0x4facb7;try{_0x4facb7=await withSpinner(_0x32510d(0x15d),()=>_0x36cf90[_0x32510d(0x124)][_0x32510d(0xbe)]({'sourceDir':_0x4a8e60,'revision':_0x181781,'skipValidation':_0x27f302}),{'verbose':_0x46cbf1[_0x32510d(0xb6)]});}catch(_0x23aca0){if(_0x23aca0 instanceof Error&&_0x23aca0[_0x32510d(0x1b1)][_0x32510d(0xc9)](_0x32510d(0x20d)))return console[_0x32510d(0x204)](a43_0x2be135[_0x32510d(0x169)](_0x32510d(0x138)),_0x32510d(0x1a4)),_0x46cbf1[_0x32510d(0x12f)]?console[_0x32510d(0x204)](a43_0x2be135[_0x32510d(0x1c1)](_0x32510d(0x11b)+_0x46cbf1[_0x32510d(0x12f)]+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x46cbf1[_0x32510d(0x12f)]+'\x27')):console[_0x32510d(0x204)](a43_0x2be135[_0x32510d(0x1c1)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x23aca0;}const _0x39faf2=_0x4facb7[_0x32510d(0x190)];console['error']('✔\x20Project:\x20'+_0x39faf2[_0x32510d(0x1cf)]),console[_0x32510d(0x204)](_0x32510d(0x17e)+_0x39faf2[_0x32510d(0x15a)]),console[_0x32510d(0x204)]('\x20\x20Revision:\x20'+_0x39faf2[_0x32510d(0x199)]),console[_0x32510d(0x204)](_0x32510d(0xe1)+a43_0x2be135[_0x32510d(0xf2)]('+'+_0x39faf2[_0x32510d(0x131)][_0x32510d(0xf6)]+_0x32510d(0x1a7))+',\x20'+(a43_0x2be135[_0x32510d(0x115)]('~'+_0x39faf2[_0x32510d(0x131)][_0x32510d(0x153)]+'\x20modified')+',\x20')+(a43_0x2be135[_0x32510d(0x169)]('-'+_0x39faf2['summary'][_0x32510d(0x9e)]+_0x32510d(0xe6))+',\x20')+(''+a43_0x2be135[_0x32510d(0x1c1)](_0x39faf2['summary'][_0x32510d(0x132)]+_0x32510d(0x11f))));for(const _0x124fe4 of _0x39faf2[_0x32510d(0xbc)]){_0x124fe4[_0x32510d(0x185)]===_0x32510d(0x153)&&_0x124fe4[_0x32510d(0x147)]&&(console[_0x32510d(0x204)]('\x0a'+a43_0x2be135[_0x32510d(0x1b3)](_0x32510d(0x15c)+_0x124fe4[_0x32510d(0x1d1)])),console[_0x32510d(0x204)](_0x124fe4['diff']));}if(!_0x39faf2['hasChanges'])return console[_0x32510d(0x204)](a43_0x2be135[_0x32510d(0xf2)](_0x32510d(0x180))),await this[_0x32510d(0x133)](_0x36cf90,_0x39faf2[_0x32510d(0x1cf)],_0x46cbf1[_0x32510d(0x97)]),0x0;if(_0x46cbf1[_0x32510d(0xd6)])return console[_0x32510d(0x204)](a43_0x2be135[_0x32510d(0x115)](_0x32510d(0x150))),0x0;if(!_0x46cbf1[_0x32510d(0x193)]){const _0x374c2b=await confirmKey(_0x32510d(0x208));if(!_0x374c2b)return console['error'](_0x32510d(0x83)),0x0;}const _0x373705=await withSpinner(_0x32510d(0x10f),()=>_0x36cf90[_0x32510d(0x124)][_0x32510d(0x89)](_0x39faf2),{'verbose':_0x46cbf1[_0x32510d(0xb6)]}),_0x42a66c=_0x373705[_0x32510d(0x190)];return console[_0x32510d(0x204)](a43_0x2be135[_0x32510d(0xf2)](_0x32510d(0x8e))),console[_0x32510d(0x204)](_0x32510d(0xbf)+_0x42a66c['projectId']),console['error'](_0x32510d(0x11e)+_0x42a66c[_0x32510d(0x199)]),await this[_0x32510d(0x133)](_0x36cf90,_0x42a66c[_0x32510d(0x1cf)],_0x46cbf1['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']='workflow:clone';[a43_0x282876(0x8a)]=a43_0x282876(0x108);async['execute'](_0x5c747e){const _0x5f1e67=a43_0x282876,{options:_0x122b62,args:_0x505165,tdx:_0x5b9261}=_0x5c747e,_0xe9873e=this[_0x5f1e67(0x1ba)](_0x505165,_0x122b62),_0x29b2e6=_0x122b62[_0x5f1e67(0x1f2)],_0x57aecc=_0x122b62[_0x5f1e67(0x199)],_0x148bc9=_0x122b62[_0x5f1e67(0x1ee)];if(!_0xe9873e)return console[_0x5f1e67(0x204)](a43_0x2be135['red'](_0x5f1e67(0x138)),_0x5f1e67(0x1e2)),console[_0x5f1e67(0x204)](a43_0x2be135[_0x5f1e67(0x1c1)](_0x5f1e67(0x1bd))),console[_0x5f1e67(0x204)](a43_0x2be135[_0x5f1e67(0x1c1)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x29b2e6)return console[_0x5f1e67(0x204)](a43_0x2be135['red'](_0x5f1e67(0x138)),_0x5f1e67(0x137)),console[_0x5f1e67(0x204)](a43_0x2be135['dim'](_0x5f1e67(0x1bd))),0x1;_0x122b62[_0x5f1e67(0xb6)]&&(console['error']('Source\x20directory:\x20'+_0xe9873e),console['error'](_0x5f1e67(0x182)+_0x29b2e6),_0x57aecc&&console[_0x5f1e67(0x204)](_0x5f1e67(0xa4)+_0x57aecc),_0x122b62[_0x5f1e67(0xd6)]&&console[_0x5f1e67(0x204)](_0x5f1e67(0x10a)),_0x148bc9&&console['error'](_0x5f1e67(0x1c3)));const _0x4375a6=await withSpinner(_0x5f1e67(0x86),()=>_0x5b9261[_0x5f1e67(0x124)][_0x5f1e67(0x13e)](_0xe9873e,_0x29b2e6,{'revision':_0x57aecc,'skipValidation':_0x148bc9}),{'verbose':_0x122b62[_0x5f1e67(0xb6)]}),_0x43c504=_0x4375a6[_0x5f1e67(0x190)];console[_0x5f1e67(0x204)](_0x5f1e67(0x167)+_0x43c504[_0x5f1e67(0x15a)]);_0x43c504[_0x5f1e67(0x102)]&&console[_0x5f1e67(0x204)](_0x5f1e67(0x207)+_0x43c504[_0x5f1e67(0x102)]);console['error'](_0x5f1e67(0x182)+_0x43c504[_0x5f1e67(0x1d7)]),console['error'](_0x5f1e67(0xa4)+_0x43c504[_0x5f1e67(0x199)]),console[_0x5f1e67(0x204)](_0x5f1e67(0x1ef)+_0x43c504['fileCount']);_0x43c504[_0x5f1e67(0x13c)]&&(console[_0x5f1e67(0x204)](a43_0x2be135['yellow'](_0x5f1e67(0x1be)+_0x43c504[_0x5f1e67(0x1d7)]+_0x5f1e67(0x1c7)+_0x43c504[_0x5f1e67(0x19b)]+')')),console[_0x5f1e67(0x204)](a43_0x2be135[_0x5f1e67(0x115)](_0x5f1e67(0xce))));if(_0x122b62[_0x5f1e67(0xd6)])return console[_0x5f1e67(0x204)](a43_0x2be135['yellow']('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x122b62[_0x5f1e67(0x193)]){const _0x352fff=_0x43c504[_0x5f1e67(0x102)]||a43_0x3af4c2[_0x5f1e67(0x1df)](_0xe9873e),_0x26a7b5=_0x43c504[_0x5f1e67(0x13c)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x29b2e6+_0x5f1e67(0x1b0):_0x5f1e67(0x1b2)+_0x352fff+_0x5f1e67(0x16c)+_0x29b2e6+'\x22?',_0x4e79b3=await confirmKey(_0x26a7b5);if(!_0x4e79b3)return console['error']('Cancelled'),0x0;}const _0x59bcf0=await withSpinner(_0x43c504[_0x5f1e67(0x13c)]?'Updating\x20'+_0x29b2e6+_0x5f1e67(0x18d):_0x5f1e67(0xcd)+_0x29b2e6+_0x5f1e67(0x18d),()=>_0x5b9261['workflow'][_0x5f1e67(0x19c)](_0x43c504),{'verbose':_0x122b62[_0x5f1e67(0xb6)]}),_0x220375=_0x59bcf0[_0x5f1e67(0x190)];return console[_0x5f1e67(0x204)](a43_0x2be135['green'](_0x43c504[_0x5f1e67(0x13c)]?_0x5f1e67(0x1eb):_0x5f1e67(0x85))),console[_0x5f1e67(0x204)](_0x5f1e67(0x168)+_0x220375[_0x5f1e67(0x1d7)]),console[_0x5f1e67(0x204)](_0x5f1e67(0xbf)+_0x220375[_0x5f1e67(0xe3)]),console[_0x5f1e67(0x204)](_0x5f1e67(0x11e)+_0x220375[_0x5f1e67(0x199)]),await this[_0x5f1e67(0x133)](_0x5b9261,_0x220375[_0x5f1e67(0x1d7)],_0x122b62['site']),0x0;}}function a43_0x2c2a(_0x2c745d,_0x3a804c){_0x2c745d=_0x2c745d-0x81;const _0x4d0e00=a43_0x4d0e();let _0x2c2afc=_0x4d0e00[_0x2c745d];return _0x2c2afc;}export class WorkflowDeleteCommand extends BaseCommand{[a43_0x282876(0x1f2)]=a43_0x282876(0x19d);['description']='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a43_0x282876(0xea)](_0x56b16f){const _0x5f845d=a43_0x282876,{options:_0x1dd8ba,args:_0x49d40a,tdx:_0x594960}=_0x56b16f,_0x1d9122=_0x49d40a[0x0];if(!_0x1d9122)return console[_0x5f845d(0x204)](_0x5f845d(0x1e8)),console[_0x5f845d(0x204)](_0x5f845d(0x110)),0x1;_0x1dd8ba[_0x5f845d(0xb6)]&&console['error'](_0x5f845d(0xb1)+_0x1d9122);if(!_0x1dd8ba[_0x5f845d(0x193)]){const _0x45f2a6=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x1d9122+_0x5f845d(0xec));if(!_0x45f2a6)return console[_0x5f845d(0x204)](_0x5f845d(0x83)),0x0;}const _0x3f8dd1=await withSpinner(_0x5f845d(0x157)+_0x1d9122+_0x5f845d(0x18d),()=>_0x594960[_0x5f845d(0x124)]['delete'](_0x1d9122),{'verbose':_0x1dd8ba[_0x5f845d(0xb6)]}),_0x1255f9=_0x3f8dd1['data'];return console[_0x5f845d(0x204)](_0x5f845d(0xe7)+_0x1255f9['projectName']),console['error'](_0x5f845d(0xbf)+_0x1255f9[_0x5f845d(0xab)]),0x0;}}export function parseKeyValue(_0x28fab4){const _0xb21f8e=a43_0x282876,_0x1c11b2=_0x28fab4[_0xb21f8e(0x1d4)]('=');if(_0x1c11b2===-0x1)throw new Error(_0xb21f8e(0xfa)+_0x28fab4+_0xb21f8e(0x216));const _0x25c07e=_0x28fab4[_0xb21f8e(0xd2)](0x0,_0x1c11b2),_0x4db4ca=_0x28fab4[_0xb21f8e(0xd2)](_0x1c11b2+0x1);if(!_0x25c07e)throw new Error(_0xb21f8e(0xb3));return{'key':_0x25c07e,'value':_0x4db4ca};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a43_0x282876(0x1f2)]='workflow:secrets:list';['description']=a43_0x282876(0x1d2);async[a43_0x282876(0xea)](_0x45ffda){const _0x471b4f=a43_0x282876,{options:_0x1c3310,args:_0x1f5be7,tdx:_0x11ab61}=_0x45ffda,_0x30882=this[_0x471b4f(0x1c2)](_0x1f5be7,_0x1c3310);if(!_0x30882)return 0x1;_0x1c3310[_0x471b4f(0xb6)]&&console[_0x471b4f(0x204)](_0x471b4f(0xb1)+_0x30882);const _0x46f58a=await withSpinner(_0x471b4f(0x8c),()=>_0x11ab61[_0x471b4f(0x124)][_0x471b4f(0xdf)](_0x30882),{'verbose':_0x1c3310[_0x471b4f(0xb6)]}),{secrets:_0x3c7b81}=_0x46f58a['data'];return console[_0x471b4f(0x204)](_0x471b4f(0xda)+_0x3c7b81['length']+_0x471b4f(0x99)+(_0x3c7b81[_0x471b4f(0xac)]!==0x1?'s':'')),await handleSDKOutput(_0x3c7b81,_0x1c3310),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a43_0x282876(0x1f2)]=a43_0x282876(0x105);[a43_0x282876(0x8a)]=a43_0x282876(0x17f);async[a43_0x282876(0xea)](_0x28b8fd){const _0x370688=a43_0x282876,{options:_0x253dab,args:_0x39cfad,tdx:_0x145724}=_0x28b8fd;let _0x5f8d54,_0x5000ff;if(_0x39cfad['length']>=0x2)_0x5f8d54=_0x39cfad[0x0],_0x5000ff=_0x39cfad[0x1];else{if(_0x39cfad[_0x370688(0xac)]===0x1&&_0x253dab[_0x370688(0x12f)])_0x5f8d54=_0x253dab[_0x370688(0x12f)],_0x5000ff=_0x39cfad[0x0];else return _0x39cfad[_0x370688(0xac)]===0x1?(console['error'](_0x370688(0x1c0)),console[_0x370688(0x204)](_0x370688(0xa9)),0x1):(console[_0x370688(0x204)](_0x370688(0x119)),console['error']('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE'),0x1);}let _0x12cc2d,_0x5a243f;try{({key:_0x12cc2d,value:_0x5a243f}=parseKeyValue(_0x5000ff));}catch(_0x37d6d1){return _0x37d6d1 instanceof Error&&console[_0x370688(0x204)](a43_0x2be135[_0x370688(0x169)](_0x370688(0x138)),_0x37d6d1['message']),0x1;}_0x253dab[_0x370688(0xb6)]&&(console[_0x370688(0x204)](_0x370688(0xb1)+_0x5f8d54),console[_0x370688(0x204)](_0x370688(0x1a2)+_0x12cc2d));const _0x9f578d=await withSpinner(_0x370688(0x1d3),()=>_0x145724['workflow']['setSecret'](_0x5f8d54,_0x12cc2d,_0x5a243f),{'verbose':_0x253dab[_0x370688(0xb6)]}),_0x2ebe24=_0x9f578d[_0x370688(0x190)];return console[_0x370688(0x204)](_0x370688(0x1ce)+_0x2ebe24[_0x370688(0xc7)]+_0x370688(0x125)+_0x2ebe24[_0x370688(0x1cf)]+'\x27'),(_0x253dab[_0x370688(0x218)]||_0x253dab[_0x370688(0x164)])&&await handleSingleObjectOutput(_0x2ebe24,_0x253dab),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a43_0x282876(0x1f2)]=a43_0x282876(0xa3);[a43_0x282876(0x8a)]=a43_0x282876(0x1fc);async['execute'](_0x1759d7){const _0x2b0801=a43_0x282876,{options:_0x24cfde,args:_0x17d5ac,tdx:_0x405339}=_0x1759d7;let _0x3d2e21,_0x8a9c38;if(_0x17d5ac[_0x2b0801(0xac)]>=0x2)_0x3d2e21=_0x17d5ac[0x0],_0x8a9c38=_0x17d5ac[0x1];else{if(_0x17d5ac[_0x2b0801(0xac)]===0x1&&_0x24cfde[_0x2b0801(0x12f)])_0x3d2e21=_0x24cfde[_0x2b0801(0x12f)],_0x8a9c38=_0x17d5ac[0x0];else return _0x17d5ac[_0x2b0801(0xac)]===0x1?(console[_0x2b0801(0x204)](_0x2b0801(0x1c0)),console[_0x2b0801(0x204)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x2b0801(0x204)](_0x2b0801(0x191)),console['error'](_0x2b0801(0xe4)),0x1);}_0x24cfde['verbose']&&(console[_0x2b0801(0x204)](_0x2b0801(0xb1)+_0x3d2e21),console[_0x2b0801(0x204)](_0x2b0801(0x1a2)+_0x8a9c38));if(!_0x24cfde[_0x2b0801(0x193)]){const _0x1cb9ed=await confirmKey(_0x2b0801(0x146)+_0x8a9c38+'\x27\x20from\x20project\x20\x27'+_0x3d2e21+'\x27?');if(!_0x1cb9ed)return console[_0x2b0801(0x204)](_0x2b0801(0x83)),0x0;}const _0xa592f4=await withSpinner(_0x2b0801(0x10c),()=>_0x405339[_0x2b0801(0x124)][_0x2b0801(0x87)](_0x3d2e21,_0x8a9c38),{'verbose':_0x24cfde['verbose']}),_0x40bdaa=_0xa592f4['data'];return console[_0x2b0801(0x204)]('✔\x20Secret\x20\x27'+_0x40bdaa[_0x2b0801(0xc7)]+_0x2b0801(0x1dc)+_0x40bdaa[_0x2b0801(0x1cf)]+'\x27'),(_0x24cfde[_0x2b0801(0x218)]||_0x24cfde[_0x2b0801(0x164)])&&await handleSingleObjectOutput(_0x40bdaa,_0x24cfde),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(_0xcd6f23){const _0x22627a=a43_0x282876,_0x25997c=Math[_0x22627a(0x1b5)](_0xcd6f23/0x3e8),_0x7252bc=Math[_0x22627a(0x1b5)](_0x25997c/0x3c),_0x5a8292=Math[_0x22627a(0x1b5)](_0x7252bc/0x3c),_0x1d3961=Math[_0x22627a(0x1b5)](_0x5a8292/0x18);if(_0x1d3961>0x0){const _0x5a4dc8=_0x5a8292%0x18;return _0x5a4dc8>0x0?_0x1d3961+'d\x20'+_0x5a4dc8+'h':_0x1d3961+'d';}else{if(_0x5a8292>0x0){const _0xcef260=_0x7252bc%0x3c;return _0xcef260>0x0?_0x5a8292+'h\x20'+_0xcef260+'m':_0x5a8292+'h';}else{if(_0x7252bc>0x0){const _0x168f26=_0x25997c%0x3c;return _0x168f26>0x0?_0x7252bc+'m\x20'+_0x168f26+'s':_0x7252bc+'m';}else return _0x25997c+'s';}}}function formatTimestamp(_0x21414b,_0x34d707){const _0x3d56ad=a43_0x282876,_0x30f2d8=new Date(_0x21414b),_0x812d2e=String(_0x30f2d8[_0x3d56ad(0xf5)]())['padStart'](0x2,'0'),_0xf5c9e2=String(_0x30f2d8['getMinutes']())['padStart'](0x2,'0'),_0x64b7b8=_0x812d2e+':'+_0xf5c9e2,_0x3b4597=_0x30f2d8[_0x3d56ad(0x172)]()===_0x34d707['getFullYear']()&&_0x30f2d8[_0x3d56ad(0xff)]()===_0x34d707[_0x3d56ad(0xff)]()&&_0x30f2d8[_0x3d56ad(0xa1)]()===_0x34d707[_0x3d56ad(0xa1)]();if(_0x3b4597)return _0x64b7b8;else{const _0x51504d=String(_0x30f2d8[_0x3d56ad(0xff)]()+0x1)[_0x3d56ad(0xed)](0x2,'0'),_0x2b7b6b=String(_0x30f2d8[_0x3d56ad(0xa1)]())[_0x3d56ad(0xed)](0x2,'0');return _0x51504d+'-'+_0x2b7b6b+'\x20'+_0x64b7b8;}}function formatDate(_0x1dea3a){const _0x5d6b0f=a43_0x282876,_0x38147d=_0x1dea3a[_0x5d6b0f(0x172)](),_0x822261=String(_0x1dea3a[_0x5d6b0f(0xff)]()+0x1)[_0x5d6b0f(0xed)](0x2,'0'),_0x36aecd=String(_0x1dea3a[_0x5d6b0f(0xa1)]())[_0x5d6b0f(0xed)](0x2,'0');return _0x38147d+'-'+_0x822261+'-'+_0x36aecd;}function getTaskStateIcon(_0x37fcb8){const _0x37b7a6={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x37b7a6[_0x37fcb8]||'⚪';}function getBarChar(_0x28bdfb){const _0x314bef=a43_0x282876;return _0x28bdfb===_0x314bef(0x204)||_0x28bdfb===_0x314bef(0x196)?'×':'─';}function getBarColor(_0x4871f5){const _0x2fa5c8=a43_0x282876,_0x1e9a40={'success':a43_0x2be135[_0x2fa5c8(0xf2)],'error':a43_0x2be135[_0x2fa5c8(0x169)],'group_error':a43_0x2be135[_0x2fa5c8(0x169)],'running':a43_0x2be135[_0x2fa5c8(0x1cb)],'blocked':a43_0x2be135[_0x2fa5c8(0x115)],'planned':a43_0x2be135[_0x2fa5c8(0x1c1)],'canceling':a43_0x2be135[_0x2fa5c8(0x115)]};return _0x1e9a40[_0x4871f5]||a43_0x2be135[_0x2fa5c8(0x101)];}function parseTaskName(_0x5017b2){const _0x30f6bd=a43_0x282876;let _0x1b83e2=_0x5017b2[_0x30f6bd(0x135)](/^\++/,'');const _0x25c35f=_0x1b83e2[_0x30f6bd(0xc2)]('+'),_0x5fe194=_0x25c35f[_0x30f6bd(0xac)]>0x1?_0x25c35f[_0x30f6bd(0xac)]-0x2:0x0,_0x343741=_0x25c35f[_0x25c35f['length']-0x1]||_0x1b83e2;return{'level':_0x5fe194,'name':'+'+_0x343741};}function truncateTaskName(_0x18e06b,_0x52f834){const _0x15fe54=a43_0x282876,_0x141dcc=stringWidth(_0x18e06b);if(_0x141dcc<=_0x52f834)return _0x18e06b;let _0x1d1f0a=_0x18e06b;while(stringWidth(_0x1d1f0a+'…')>_0x52f834&&_0x1d1f0a['length']>0x0){_0x1d1f0a=_0x1d1f0a[_0x15fe54(0x1c9)](0x0,-0x1);}return _0x1d1f0a+'…';}function calculateTimeScale(_0x4aadf5,_0xb8abc8){const _0xbd57f6=a43_0x282876;return{'startTime':_0x4aadf5['start'],'endTime':_0x4aadf5[_0xbd57f6(0x1ca)],'durationMs':_0x4aadf5['duration'],'msPerChar':_0x4aadf5[_0xbd57f6(0xb2)]/_0xb8abc8};}function timeToPosition(_0x2b5901,_0x45e15c,_0x267034){const _0x488c50=a43_0x282876,_0x5d57c0=_0x2b5901-_0x45e15c[_0x488c50(0x178)],_0x389d57=Math[_0x488c50(0x1b5)](_0x5d57c0/_0x45e15c['msPerChar']);return Math[_0x488c50(0x219)](0x0,Math[_0x488c50(0x8b)](_0x389d57,_0x267034));}function renderTimeAxis(_0x58b28e,_0x1b6c5c){const _0x2a2b02=a43_0x282876,_0x1c4d27=Math[_0x2a2b02(0x8b)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x2a2b02(0x219)](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math['floor'](_0x1b6c5c/TIMELINE_CONFIG[_0x2a2b02(0xb0)]))),_0x1465bb=_0x58b28e[_0x2a2b02(0x1d8)]/(_0x1c4d27-0x1),_0x4297df=new Date(_0x58b28e[_0x2a2b02(0x178)]),_0x1eea72=[];for(let _0x1d0ed7=0x0;_0x1d0ed7<_0x1c4d27;_0x1d0ed7++){const _0x1732d4=_0x58b28e['startTime']+_0x1d0ed7*_0x1465bb,_0x449f4c=timeToPosition(_0x1732d4,_0x58b28e,_0x1b6c5c),_0x500c84=formatTimestamp(_0x1732d4,_0x4297df);_0x1eea72[_0x2a2b02(0xcf)]({'pos':_0x449f4c,'text':_0x500c84});}const _0x364ef1=new Array(_0x1b6c5c)['fill']('\x20');let _0x22d50c=-0x1;for(const {pos:_0x347899,text:_0x28ca32}of _0x1eea72){let _0x5c5ee3=Math[_0x2a2b02(0x219)](0x0,_0x347899-Math[_0x2a2b02(0x1b5)](_0x28ca32[_0x2a2b02(0xac)]/0x2));_0x5c5ee3<=_0x22d50c+TIMELINE_CONFIG[_0x2a2b02(0x15e)]&&(_0x5c5ee3=_0x22d50c+TIMELINE_CONFIG[_0x2a2b02(0x15e)]+0x1);_0x5c5ee3+_0x28ca32[_0x2a2b02(0xac)]>_0x1b6c5c&&(_0x5c5ee3=_0x1b6c5c-_0x28ca32[_0x2a2b02(0xac)]);if(_0x5c5ee3>=0x0&&_0x5c5ee3+_0x28ca32[_0x2a2b02(0xac)]<=_0x1b6c5c&&_0x5c5ee3>_0x22d50c){for(let _0x1efe72=0x0;_0x1efe72<_0x28ca32[_0x2a2b02(0xac)];_0x1efe72++){_0x364ef1[_0x5c5ee3+_0x1efe72]=_0x28ca32[_0x1efe72];}_0x22d50c=_0x5c5ee3+_0x28ca32['length']-0x1;}}return _0x364ef1['join']('');}function renderTaskRow(_0x2b38fe,_0x35a094,_0x5b48f3,_0x4089ad){const _0x553441=a43_0x282876,{level:_0x30bcd7,name:_0x13f9a7}=parseTaskName(_0x2b38fe['name']),_0x1fd310='\x20'[_0x553441(0x20f)](_0x30bcd7),_0x4ee784=_0x2b38fe[_0x553441(0xf7)]?'('+formatElapsed(_0x2b38fe[_0x553441(0xf7)]['duration'])+')':'',_0x25ce06=stringWidth(_0x4ee784),_0x169dd7=_0x30bcd7*0x1,_0x158fd2=_0x4089ad-_0x169dd7-_0x25ce06-0x1,_0x250e36=truncateTaskName(_0x13f9a7,_0x158fd2),_0x222f03=_0x1fd310+_0x250e36,_0x4e21c6=stringWidth(_0x222f03),_0x1fa981=_0x4089ad-_0x4e21c6-_0x25ce06,_0x4dac0e=_0x222f03+'\x20'['repeat'](Math[_0x553441(0x219)](0x1,_0x1fa981))+a43_0x2be135['dim'](_0x4ee784),_0x55caf9=getTaskStateIcon(_0x2b38fe[_0x553441(0x165)]),_0x1bab9f=new Array(_0x5b48f3)[_0x553441(0xbd)]('\x20');if(_0x2b38fe[_0x553441(0xf7)]){const _0x304d90=timeToPosition(_0x2b38fe[_0x553441(0xf7)][_0x553441(0x1da)],_0x35a094,_0x5b48f3),_0x4683d8=timeToPosition(_0x2b38fe[_0x553441(0xf7)][_0x553441(0x1ca)],_0x35a094,_0x5b48f3),_0x1f5378=getBarChar(_0x2b38fe['state']),_0x5d3c9a=Math['max'](_0x304d90+0x1,_0x4683d8);for(let _0x18e9a8=_0x304d90;_0x18e9a8<Math[_0x553441(0x8b)](_0x5d3c9a,_0x5b48f3);_0x18e9a8++){_0x1bab9f[_0x18e9a8]=_0x1f5378;}}const _0x26f781=getBarColor(_0x2b38fe[_0x553441(0x165)]),_0x39c065=_0x1bab9f['map'](_0x449d48=>_0x449d48==='\x20'?'\x20':_0x26f781(_0x449d48))['join']('');return _0x55caf9+'\x20'+_0x4dac0e+'│'+_0x39c065+'│';}function calculateStats(_0x252736){const _0x4db8e0=a43_0x282876,_0x18f3fc={'total':_0x252736[_0x4db8e0(0xac)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x34f59a of _0x252736){if(_0x34f59a['state']===_0x4db8e0(0xd3))_0x18f3fc['success']++;else{if(_0x34f59a[_0x4db8e0(0x165)]===_0x4db8e0(0x204)||_0x34f59a[_0x4db8e0(0x165)]===_0x4db8e0(0x196))_0x18f3fc[_0x4db8e0(0x204)]++;else _0x34f59a[_0x4db8e0(0x165)]===_0x4db8e0(0x92)?_0x18f3fc[_0x4db8e0(0x92)]++:_0x18f3fc[_0x4db8e0(0x1b6)]++;}}return _0x18f3fc;}function formatStats(_0x4043aa){const _0x1fe695=a43_0x282876;return['Total:\x20'+_0x4043aa[_0x1fe695(0x187)],'✅\x20'+_0x4043aa[_0x1fe695(0xd3)],'❌\x20'+_0x4043aa[_0x1fe695(0x204)],_0x1fe695(0x158)+_0x4043aa['running'],'⏳\x20'+_0x4043aa['pending']]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a43_0x282876(0x1f2)]=a43_0x282876(0x194);[a43_0x282876(0x8a)]=a43_0x282876(0xd0);async[a43_0x282876(0xea)](_0x3fa9a6){const _0x3cd9f9=a43_0x282876,{options:_0x2e2c56,args:_0x44ff2f,tdx:_0x1ddfa7}=_0x3fa9a6;let _0x2d2483,_0x18629c,_0x33b61f=![];if(_0x44ff2f[0x0]){if(_0x44ff2f[0x0][_0x3cd9f9(0xc9)]('.')){const _0x5b493e=this[_0x3cd9f9(0x120)](_0x44ff2f,_0x2e2c56);if(!_0x5b493e)return 0x1;_0x2d2483=_0x5b493e[_0x3cd9f9(0x1cf)],_0x18629c=_0x5b493e[_0x3cd9f9(0x17c)];}else{_0x18629c=_0x44ff2f[0x0],_0x2d2483=_0x2e2c56['workflowProject'];if(!_0x2d2483)return console[_0x3cd9f9(0x204)](a43_0x2be135[_0x3cd9f9(0x169)]('Error:'),_0x3cd9f9(0x81)),0x1;_0x33b61f=!![];}}else{const _0x17cc8e=this['parseProjectWorkflowPattern'](_0x44ff2f,_0x2e2c56);if(!_0x17cc8e)return 0x1;_0x2d2483=_0x17cc8e[_0x3cd9f9(0x1cf)],_0x18629c=_0x17cc8e[_0x3cd9f9(0x17c)];}if(_0x2e2c56[_0x3cd9f9(0xb6)]){if(_0x2d2483&&_0x18629c)console[_0x3cd9f9(0x204)]('Filter:\x20'+_0x2d2483+'.'+_0x18629c);else _0x2d2483&&console[_0x3cd9f9(0x204)](_0x3cd9f9(0x186)+_0x2d2483);}const _0x2a98ea=_0x2e2c56[_0x3cd9f9(0x1aa)],_0x23b14c=_0x2e2c56[_0x3cd9f9(0x1a0)];if(_0x2a98ea){_0x23b14c&&console[_0x3cd9f9(0x204)](a43_0x2be135[_0x3cd9f9(0x115)](_0x3cd9f9(0x181)),_0x3cd9f9(0xdd));const _0x3bb037=_0x2e2c56['follow'];return _0x3bb037?await this[_0x3cd9f9(0x13b)](_0x3fa9a6,_0x2a98ea):await this[_0x3cd9f9(0x1e6)](_0x3fa9a6,_0x2a98ea,_0x2e2c56),0x0;}if(_0x23b14c){const _0x3c23=await withSpinner('Loading\x20session...',()=>_0x1ddfa7[_0x3cd9f9(0x124)][_0x3cd9f9(0x19a)]({'projectName':_0x2d2483,'workflowName':_0x18629c,'limit':0x64}),{'verbose':_0x2e2c56[_0x3cd9f9(0xb6)]}),_0x2780ec=_0x3c23[_0x3cd9f9(0x190)][_0x3cd9f9(0x1d5)](_0x163aa9=>_0x163aa9['id']===_0x23b14c);if(!_0x2780ec)return console[_0x3cd9f9(0x204)](a43_0x2be135[_0x3cd9f9(0x169)](_0x3cd9f9(0x138)),_0x3cd9f9(0x1a5)+_0x23b14c),0x1;if(!_0x2780ec['lastAttempt']?.['id'])return console[_0x3cd9f9(0x204)](a43_0x2be135['red'](_0x3cd9f9(0x138)),_0x3cd9f9(0x161)+_0x23b14c+_0x3cd9f9(0x149)),0x1;const _0x39607b=_0x2780ec[_0x3cd9f9(0x144)]['id'];_0x2e2c56['verbose']&&console[_0x3cd9f9(0x204)](_0x3cd9f9(0x1cc)+_0x39607b+_0x3cd9f9(0xf0)+_0x23b14c);const _0x20009b=_0x2e2c56[_0x3cd9f9(0xc0)];return _0x20009b?await this['pollTimeline'](_0x3fa9a6,_0x39607b):await this[_0x3cd9f9(0x1e6)](_0x3fa9a6,_0x39607b,_0x2e2c56),0x0;}const _0x55ca37=await withSpinner(_0x3cd9f9(0x214),()=>_0x1ddfa7[_0x3cd9f9(0x124)][_0x3cd9f9(0x19a)]({'projectName':_0x2d2483,'workflowName':_0x18629c,'limit':_0x2e2c56[_0x3cd9f9(0x177)]||0x32}),{'verbose':_0x2e2c56['verbose']}),_0x150c10=_0x55ca37[_0x3cd9f9(0x190)];if(_0x150c10[_0x3cd9f9(0xac)]===0x0){if(_0x2d2483&&_0x18629c)console[_0x3cd9f9(0x204)](_0x3cd9f9(0x175)+_0x2d2483+'.'+_0x18629c);else _0x2d2483?console[_0x3cd9f9(0x204)](_0x3cd9f9(0x1d6)+_0x2d2483):(console['error'](_0x3cd9f9(0x16d)),console['error'](a43_0x2be135[_0x3cd9f9(0x1c1)]('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x150c10[_0x3cd9f9(0x109)]((_0x1c1dcd,_0x2e7ae4)=>{const _0x21325b=_0x3cd9f9,_0x2b4ed1=_0x1c1dcd[_0x21325b(0x160)]||'',_0x398b50=_0x2e7ae4[_0x21325b(0x160)]||'';return _0x398b50[_0x21325b(0xfd)](_0x2b4ed1);});if(_0x2e2c56[_0x3cd9f9(0x218)]||_0x2e2c56[_0x3cd9f9(0x164)])return await handleSDKOutput(_0x150c10,_0x2e2c56),0x0;let _0x250aaa;if(_0x33b61f){const _0x18ea74=_0x150c10[0x0];if(!_0x18ea74[_0x3cd9f9(0x144)]?.['id'])return console[_0x3cd9f9(0x204)](_0x3cd9f9(0x17b)),0x0;_0x250aaa=_0x18ea74['lastAttempt']['id'],_0x2e2c56[_0x3cd9f9(0xb6)]&&console[_0x3cd9f9(0x204)](_0x3cd9f9(0x128)+_0x18ea74[_0x3cd9f9(0x160)]);}else{const _0x1b0d6a=_0x150c10[_0x3cd9f9(0x90)](_0x38a474=>{const _0x19b9c8=_0x3cd9f9,_0x212b07=getAttemptStatusDisplay(_0x38a474['lastAttempt']);return{'title':_0x38a474[_0x19b9c8(0x162)]?.[_0x19b9c8(0x1f2)]+'.'+_0x38a474[_0x19b9c8(0x124)]?.[_0x19b9c8(0x1f2)]+_0x19b9c8(0x106)+_0x38a474[_0x19b9c8(0x160)]+'\x20'+_0x212b07['icon'],'value':_0x38a474[_0x19b9c8(0x144)]?.['id']||'','description':_0x212b07[_0x19b9c8(0x1e7)]};}),_0x4bda74=await a43_0x32446c({'type':_0x3cd9f9(0x16f),'name':'attemptId','message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x1b0d6a[_0x3cd9f9(0x9b)](_0x7c79d8=>_0x7c79d8[_0x3cd9f9(0x139)]!=='')});if(!_0x4bda74[_0x3cd9f9(0x1aa)])return 0x0;_0x250aaa=_0x4bda74['attemptId'];}const _0x2e2da9=_0x2e2c56['follow'];return _0x2e2da9?await this[_0x3cd9f9(0x13b)](_0x3fa9a6,_0x250aaa):await this[_0x3cd9f9(0x1e6)](_0x3fa9a6,_0x250aaa,_0x2e2c56),0x0;}async[a43_0x282876(0x1e6)](_0x40a3f0,_0x1bd5a5,_0x43746b){const _0x24878d=a43_0x282876,{tdx:_0x5072c5}=_0x40a3f0;let _0x2be8b0,_0x17e9e6;try{[_0x2be8b0,_0x17e9e6]=await Promise[_0x24878d(0x163)]([_0x5072c5[_0x24878d(0x124)][_0x24878d(0x13f)](_0x1bd5a5),_0x5072c5[_0x24878d(0x124)][_0x24878d(0x170)](_0x1bd5a5,![])]);}catch(_0xb52b05){console['error'](a43_0x2be135[_0x24878d(0x169)](_0x24878d(0xa6)));_0x43746b[_0x24878d(0xb6)]&&console[_0x24878d(0x204)](_0xb52b05);throw _0xb52b05;}if(_0x43746b[_0x24878d(0x218)]||_0x43746b[_0x24878d(0x164)]){const _0x49a1a0=this[_0x24878d(0x18b)](_0x2be8b0,_0x17e9e6);await handleSDKOutput([_0x49a1a0],_0x43746b);return;}const _0x12293a=_0x5072c5[_0x24878d(0x1ff)][_0x24878d(0x97)],_0x37a215=this[_0x24878d(0x12a)](_0x2be8b0,_0x17e9e6,_0x12293a);console['log'](_0x37a215);}async[a43_0x282876(0x13b)](_0x471d17,_0xa4cae8){const _0x3c1257=a43_0x282876,{tdx:_0x53e5d8}=_0x471d17,_0x2233d7=TIMELINE_CONFIG[_0x3c1257(0x1e3)],_0x1b7ec3=TIMELINE_CONFIG[_0x3c1257(0x154)];let _0xeb9bd7=0x0;while(_0xeb9bd7<_0x1b7ec3){process[_0x3c1257(0x16b)][_0x3c1257(0xfc)]&&process[_0x3c1257(0x16b)][_0x3c1257(0x195)]('\x1bc');let _0x1fa482,_0x4a828a;try{[_0x1fa482,_0x4a828a]=await Promise[_0x3c1257(0x163)]([_0x53e5d8[_0x3c1257(0x124)][_0x3c1257(0x13f)](_0xa4cae8),_0x53e5d8['workflow'][_0x3c1257(0x170)](_0xa4cae8,![])]);}catch(_0x2443aa){console[_0x3c1257(0x204)](a43_0x2be135['red'](_0x3c1257(0x21b)));_0xeb9bd7>0x0&&console[_0x3c1257(0x204)](a43_0x2be135['dim'](_0x3c1257(0x16a)+_0xeb9bd7));throw _0x2443aa;}const _0x2d01a0=_0x53e5d8['context']['site'],_0x27e62c=this[_0x3c1257(0x12a)](_0x1fa482,_0x4a828a,_0x2d01a0);console[_0x3c1257(0x18e)](_0x27e62c);const _0x23d7a9=_0x1fa482[_0x3c1257(0x1bb)]&&_0x4a828a[_0x3c1257(0x1ab)](_0x59d7f2=>_0x59d7f2['state']!=='running'&&_0x59d7f2[_0x3c1257(0x165)]!==_0x3c1257(0x10b));if(_0x23d7a9){console[_0x3c1257(0x204)](a43_0x2be135[_0x3c1257(0xf2)]('\x0a✔\x20Attempt\x20complete'));break;}console['error'](a43_0x2be135[_0x3c1257(0x1c1)](_0x3c1257(0x1ec)+_0xeb9bd7*0x2+_0x3c1257(0x184))),await new Promise(_0x51a183=>setTimeout(_0x51a183,_0x2233d7)),_0xeb9bd7++;}_0xeb9bd7>=_0x1b7ec3&&console[_0x3c1257(0x204)](a43_0x2be135[_0x3c1257(0x115)](_0x3c1257(0xa8)));}[a43_0x282876(0x12a)](_0xc6c91,_0x34b176,_0x467228){const _0x50d0da=a43_0x282876,_0x2d0414=[],_0x42cd6d=TIMELINE_CONFIG[_0x50d0da(0x9a)],_0x1d39e7=0x5,_0x179bc1=process[_0x50d0da(0x16b)][_0x50d0da(0x9d)]||0x78,_0x1c61d1=_0x179bc1-_0x42cd6d-_0x1d39e7,_0x151c92=Math[_0x50d0da(0x219)](TIMELINE_CONFIG[_0x50d0da(0x152)],Math[_0x50d0da(0x8b)](_0x1c61d1,TIMELINE_CONFIG[_0x50d0da(0x1dd)])),_0x36232c=new Date(_0xc6c91[_0x50d0da(0x210)])[_0x50d0da(0x1b7)](),_0x18993a=_0xc6c91[_0x50d0da(0xaf)]?new Date(_0xc6c91[_0x50d0da(0xaf)])[_0x50d0da(0x1b7)]():Date['now'](),_0x2decd3={'start':_0x36232c,'end':_0x18993a,'duration':_0x18993a-_0x36232c},_0x3ac8e4=new Map(),_0x3035d6=[];for(const _0x3afe56 of _0x34b176){if(_0x3afe56[_0x50d0da(0x8d)]){const _0xfe2bff=new Date(_0x3afe56[_0x50d0da(0x8d)])[_0x50d0da(0x1b7)](),_0x1b6e39=_0x3afe56['updatedAt']?new Date(_0x3afe56[_0x50d0da(0x142)])[_0x50d0da(0x1b7)]():Date[_0x50d0da(0x14c)](),_0x83eb8d={'start':_0xfe2bff,'end':_0x1b6e39,'duration':_0x1b6e39-_0xfe2bff};_0x3ac8e4[_0x50d0da(0x84)](_0x3afe56['id'],_0x83eb8d),_0x3035d6[_0x50d0da(0xcf)]({'name':_0x3afe56[_0x50d0da(0x192)],'state':_0x3afe56[_0x50d0da(0x165)]||_0x50d0da(0x19e),'window':_0x83eb8d});}else _0x3035d6['push']({'name':_0x3afe56[_0x50d0da(0x192)],'state':_0x3afe56[_0x50d0da(0x165)]||_0x50d0da(0x10b),'window':undefined});}_0x3035d6['sort']((_0x152c62,_0x19f5da)=>{const _0x288525=_0x50d0da;if(!_0x152c62[_0x288525(0xf7)])return 0x1;if(!_0x19f5da[_0x288525(0xf7)])return-0x1;return _0x152c62['window']['start']-_0x19f5da['window']['start'];});const _0x583435=_0x3035d6[_0x50d0da(0xac)],_0x2a3e33=_0x583435>TIMELINE_CONFIG[_0x50d0da(0x18f)];_0x2a3e33&&_0x3035d6[_0x50d0da(0x1de)](TIMELINE_CONFIG[_0x50d0da(0x18f)]);const _0x5cd084=calculateTimeScale(_0x2decd3,_0x151c92),_0x3052ac=_0xc6c91[_0x50d0da(0x1bb)]?_0xc6c91['success']?a43_0x2be135['green'](_0x50d0da(0xd3)):a43_0x2be135[_0x50d0da(0x169)]('error'):a43_0x2be135[_0x50d0da(0x1cb)]('running'),_0x535fa5=_0xc6c91[_0x50d0da(0x162)]?.['id'],_0x2cf09a=_0xc6c91[_0x50d0da(0x1a0)];let _0x50fd12;if(_0x535fa5&&_0x2cf09a){const _0x2c9f09=getWorkflowAttemptUrl(_0x467228,_0x535fa5,_0x2cf09a,_0xc6c91['id']);_0x50fd12=hyperlink(a43_0x2be135[_0x50d0da(0x1c1)](_0xc6c91['id']),_0x2c9f09);}else _0x50fd12=a43_0x2be135['dim'](_0xc6c91['id']);_0x2d0414['push']('Attempt:\x20'+_0x50fd12+_0x50d0da(0x106)+_0x3052ac+_0x50d0da(0x106)+formatElapsed(_0x2decd3[_0x50d0da(0xb2)]));if(_0x3035d6[_0x50d0da(0xac)]>0x0){const _0x1ef14d=renderTimeAxis(_0x5cd084,_0x151c92),_0x39c785=new Date(_0x2decd3['start']),_0x2050d3=formatDate(_0x39c785),_0x4b80a2=TIMELINE_CONFIG[_0x50d0da(0x140)]+TIMELINE_CONFIG[_0x50d0da(0x213)]+_0x42cd6d,_0x33ebd2=_0x2050d3[_0x50d0da(0xed)](_0x4b80a2),_0x59b63b=a43_0x2be135[_0x50d0da(0x1c1)](_0x33ebd2);_0x2d0414[_0x50d0da(0xcf)](_0x59b63b+'\x20'+_0x1ef14d);for(const _0x15f266 of _0x3035d6){_0x2d0414[_0x50d0da(0xcf)](renderTaskRow(_0x15f266,_0x5cd084,_0x151c92,_0x42cd6d));}const _0x7923e7=calculateStats(_0x3035d6);_0x2d0414['push'](formatStats(_0x7923e7)),_0x2a3e33&&_0x2d0414[_0x50d0da(0xcf)](a43_0x2be135[_0x50d0da(0x115)](_0x50d0da(0x143)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x50d0da(0x129)+_0x583435+'\x20tasks')),_0x2d0414[_0x50d0da(0xcf)](''),_0x2d0414[_0x50d0da(0xcf)](a43_0x2be135[_0x50d0da(0x1c1)](_0x50d0da(0x118))+(_0x50d0da(0x91)+_0xc6c91['id']+'\x20logs')+a43_0x2be135[_0x50d0da(0x1c1)](_0x50d0da(0x1f4)));}else _0x2d0414[_0x50d0da(0xcf)]('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x2d0414[_0x50d0da(0x98)]('\x0a');}[a43_0x282876(0x18b)](_0x1cec67,_0xb47849){const _0x3e2415=a43_0x282876,_0x1ddfef=new Date(_0x1cec67[_0x3e2415(0x210)])[_0x3e2415(0x1b7)](),_0x440f81=_0x1cec67['finishedAt']?new Date(_0x1cec67[_0x3e2415(0xaf)])[_0x3e2415(0x1b7)]():Date[_0x3e2415(0x14c)](),_0x46bdfa=_0x440f81-_0x1ddfef,_0x2f3838=[];for(const _0x3ca18d of _0xb47849){if(_0x3ca18d[_0x3e2415(0x8d)]){const _0xb74703=new Date(_0x3ca18d['startedAt'])[_0x3e2415(0x1b7)](),_0x5baf94=_0x3ca18d[_0x3e2415(0x142)]?new Date(_0x3ca18d[_0x3e2415(0x142)])[_0x3e2415(0x1b7)]():Date[_0x3e2415(0x14c)]();_0x2f3838[_0x3e2415(0xcf)]({'name':_0x3ca18d[_0x3e2415(0x192)],'state':_0x3ca18d[_0x3e2415(0x165)]||_0x3e2415(0x19e),'window':{'start':_0xb74703,'end':_0x5baf94,'duration':_0x5baf94-_0xb74703}});}else _0x2f3838[_0x3e2415(0xcf)]({'name':_0x3ca18d[_0x3e2415(0x192)],'state':_0x3ca18d['state']||_0x3e2415(0x10b),'window':undefined});}const _0x29f9d3=calculateStats(_0x2f3838);return{'attempt':{'id':_0x1cec67['id'],'status':_0x1cec67[_0x3e2415(0x1bb)]?_0x1cec67['success']?_0x3e2415(0xd3):'error':_0x3e2415(0x92),'createdAt':_0x1cec67[_0x3e2415(0x210)],'finishedAt':_0x1cec67[_0x3e2415(0xaf)],'duration_ms':_0x46bdfa},'tasks':_0x2f3838['map'](_0x51a546=>({'name':_0x51a546[_0x3e2415(0x1f2)],'state':_0x51a546['state'],'startedAt':_0x51a546[_0x3e2415(0xf7)]?new Date(_0x51a546['window'][_0x3e2415(0x1da)])['toISOString']():null,'updatedAt':_0x51a546[_0x3e2415(0xf7)]?new Date(_0x51a546[_0x3e2415(0xf7)][_0x3e2415(0x1ca)])[_0x3e2415(0x1f5)]():null,'duration_ms':_0x51a546[_0x3e2415(0xf7)]?.[_0x3e2415(0xb2)]||null})),'stats':_0x29f9d3};}}
|
|
1
|
+
const a43_0x457206=a43_0x4a9e;(function(_0x4059c7,_0x470c02){const _0xf90ff8=a43_0x4a9e,_0x2a312e=_0x4059c7();while(!![]){try{const _0x4ca372=parseInt(_0xf90ff8(0x139))/0x1+parseInt(_0xf90ff8(0x20e))/0x2*(parseInt(_0xf90ff8(0x1df))/0x3)+-parseInt(_0xf90ff8(0x1a5))/0x4+parseInt(_0xf90ff8(0xe2))/0x5*(parseInt(_0xf90ff8(0x110))/0x6)+-parseInt(_0xf90ff8(0x1b0))/0x7*(parseInt(_0xf90ff8(0xb6))/0x8)+parseInt(_0xf90ff8(0x1d9))/0x9+-parseInt(_0xf90ff8(0x1d2))/0xa*(-parseInt(_0xf90ff8(0x142))/0xb);if(_0x4ca372===_0x470c02)break;else _0x2a312e['push'](_0x2a312e['shift']());}catch(_0x11116e){_0x2a312e['push'](_0x2a312e['shift']());}}}(a43_0x17e5,0x9f4e8));import a43_0x1f625e from'chalk';import{existsSync}from'fs';import a43_0x2ca821 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a43_0x24b3dc from'prompts';function getAttemptStatusDisplay(_0x21117b){const _0x2fb753=a43_0x4a9e;if(!_0x21117b)return{'icon':'⏳','text':''};const {done:_0x199b74,success:_0x5b0ea3,cancelRequested:_0x1ba60e}=_0x21117b;if(!_0x199b74)return _0x1ba60e?{'icon':'🛑','text':a43_0x1f625e[_0x2fb753(0x19f)]('canceling')}:{'icon':'🔄','text':a43_0x1f625e['blue']('running')};if(_0x5b0ea3)return{'icon':'✅','text':a43_0x1f625e['green']('success')};return{'icon':'❌','text':a43_0x1f625e[_0x2fb753(0x124)](_0x2fb753(0x21b))};}export class WorkflowBaseCommand extends BaseCommand{[a43_0x457206(0x12c)](_0x16ba5b,_0x511333,_0x2ab89f=0x0){const _0x2809e8=a43_0x457206;return _0x16ba5b[_0x2ab89f]||_0x511333[_0x2809e8(0x199)];}[a43_0x457206(0x20f)](_0x145779,_0x48f3ad,_0x491f30=0x0){const _0x5a5769=a43_0x457206,_0x3b99a7=this[_0x5a5769(0x12c)](_0x145779,_0x48f3ad,_0x491f30);if(!_0x3b99a7)return console[_0x5a5769(0x21b)](a43_0x1f625e[_0x5a5769(0x124)](_0x5a5769(0x1ab)),_0x5a5769(0x8c)),console['error'](a43_0x1f625e[_0x5a5769(0x185)](_0x5a5769(0x10f))),null;return _0x3b99a7;}[a43_0x457206(0x11a)](_0x1f91b7,_0x2bbd3f){const _0x409548=a43_0x457206;if(_0x1f91b7[0x0]){const _0x4be047=_0x1f91b7[0x0][_0x409548(0xcf)]('.');if(_0x4be047[_0x409548(0xc4)]===0x1)return{'projectName':_0x4be047[0x0],'workflowName':undefined};else return _0x4be047[_0x409548(0xc4)]===0x2?{'projectName':_0x4be047[0x0],'workflowName':_0x4be047[0x1]}:(console[_0x409548(0x21b)](a43_0x1f625e[_0x409548(0x124)](_0x409548(0x1ab)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x2bbd3f[_0x409548(0x199)],'workflowName':undefined};}[a43_0x457206(0x18a)](_0x3b04bc,_0x1e7148,_0x37ee8d=0x0){const _0x355c78=a43_0x457206;if(_0x3b04bc[_0x37ee8d])return _0x3b04bc[_0x37ee8d];if(_0x1e7148[_0x355c78(0x199)]){const _0x2de611=a43_0x2ca821[_0x355c78(0x1aa)](process['cwd'](),_0x355c78(0x147),_0x1e7148['workflowProject']);if(existsSync(a43_0x2ca821[_0x355c78(0x1aa)](_0x2de611,_0x355c78(0xb5))))return _0x2de611;}return undefined;}async['showWorkflowConsoleUrl'](_0x44237d,_0x316b8d,_0x87ae56){const _0x4ef772=a43_0x457206;try{const _0x8402c1=await _0x44237d[_0x4ef772(0x152)][_0x4ef772(0x147)](_0x316b8d,{'limit':0x1});if(_0x8402c1[_0x4ef772(0xc4)]>0x0){const _0x427b0f=_0x8402c1[0x0]['id'],_0x993e08=getWorkflowUrl(_0x87ae56,_0x427b0f);console['error'](_0x4ef772(0xa0)+a43_0x1f625e['cyan'](_0x993e08));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']='workflow:use';['description']=a43_0x457206(0xeb);async[a43_0x457206(0x1f7)](_0x5b4e9c){const _0x5175bd=a43_0x457206,{options:_0x551583,args:_0x5b0d2c,tdx:_0xa5eca9}=_0x5b4e9c,_0x2995a8=_0x5b0d2c[0x0],_0x2104fc=_0x551583[_0x5175bd(0xc9)];if(_0x2104fc)return saveSessionContext({'workflow_project':undefined},_0x551583[_0x5175bd(0x1ce)]),console[_0x5175bd(0x195)](a43_0x1f625e[_0x5175bd(0x107)]('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x2995a8)return console[_0x5175bd(0x21b)](a43_0x1f625e[_0x5175bd(0x124)]('Error:'),_0x5175bd(0x8c)),console[_0x5175bd(0x21b)](a43_0x1f625e[_0x5175bd(0x185)](_0x5175bd(0x122))),console[_0x5175bd(0x21b)](a43_0x1f625e['dim'](_0x5175bd(0x1b2))),0x1;const _0x1999a0=await withSpinner(_0x5175bd(0x1dc)+_0x2995a8+_0x5175bd(0x186),()=>_0xa5eca9[_0x5175bd(0x152)]['resolveProjectId'](_0x2995a8),{'verbose':_0x551583['verbose']}),{name:_0x905e81}=_0x1999a0['data'];return saveSessionContext({'workflow_project':_0x905e81},_0x551583[_0x5175bd(0x1ce)]),console[_0x5175bd(0x195)](a43_0x1f625e[_0x5175bd(0x107)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a43_0x1f625e[_0x5175bd(0x171)](_0x905e81))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a43_0x457206(0xf9)]=a43_0x457206(0x1c9);[a43_0x457206(0x160)]=a43_0x457206(0x14d);async[a43_0x457206(0x1f7)](_0x3d65aa){const _0x2435c1=a43_0x457206,{options:_0x9c6b2f,args:_0xc44e4,tdx:_0x250836}=_0x3d65aa,_0x3a70e6=_0xc44e4[0x0];_0x9c6b2f[_0x2435c1(0xcc)]&&_0x3a70e6&&console['error'](_0x2435c1(0x82)+_0x3a70e6);const _0x495c8b=await withSpinner(_0x2435c1(0x17f),()=>_0x250836[_0x2435c1(0x152)][_0x2435c1(0x9e)](_0x3a70e6,{'limit':_0x9c6b2f[_0x2435c1(0x135)]}),{'verbose':_0x9c6b2f[_0x2435c1(0xcc)]});let _0x54bb0c=_0x495c8b['data'];_0x54bb0c[_0x2435c1(0x96)]((_0x460f50,_0x4df77b)=>_0x460f50['name'][_0x2435c1(0x120)](_0x4df77b[_0x2435c1(0xf9)]));const _0x75fff8=_0x9c6b2f[_0x2435c1(0x135)]||0x64,_0x4067cc=_0x54bb0c['length']>=_0x75fff8?a43_0x1f625e[_0x2435c1(0x185)](_0x2435c1(0x9f)):'';console[_0x2435c1(0x21b)](_0x2435c1(0x20a)+_0x54bb0c[_0x2435c1(0xc4)]+_0x2435c1(0x1fe)+(_0x54bb0c[_0x2435c1(0xc4)]!==0x1?'s':'')+_0x4067cc);if(_0x9c6b2f[_0x2435c1(0xd9)]===_0x2435c1(0x141)||_0x9c6b2f[_0x2435c1(0xd9)]===_0x2435c1(0x7d)||_0x9c6b2f[_0x2435c1(0xd9)]===_0x2435c1(0x167))await handleSDKOutput(_0x54bb0c,_0x9c6b2f);else{if(_0x54bb0c[_0x2435c1(0xc4)]===0x0)_0x3a70e6?console['log'](_0x2435c1(0x173)+_0x3a70e6):console['log']('No\x20workflow\x20projects\x20found');else{const _0x213191=_0x54bb0c[_0x2435c1(0x194)](_0x5eb3ae=>{const _0x306970=_0x2435c1,_0x38db01=_0x5eb3ae[_0x306970(0x184)]?.['some'](_0x3d8dfc=>_0x3d8dfc[_0x306970(0x188)]===_0x306970(0x189)),_0x433209=_0x38db01?a43_0x1f625e[_0x306970(0x185)](_0x306970(0x9a)):'';return'📁\x20'+_0x5eb3ae[_0x306970(0xf9)]+_0x433209;});await writeOutput(_0x213191['join']('\x0a'),_0x9c6b2f[_0x2435c1(0x1b6)],'list');}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a43_0x457206(0xf9)]=a43_0x457206(0x217);['description']=a43_0x457206(0x105);async[a43_0x457206(0x1f7)](_0x13d399){const _0x1b4179=a43_0x457206,{options:_0x324e35,args:_0x12c046,tdx:_0x146e01}=_0x13d399,_0x433608=this[_0x1b4179(0x12c)](_0x12c046,_0x324e35);_0x324e35[_0x1b4179(0xcc)]&&_0x433608&&console[_0x1b4179(0x21b)]('Project\x20filter:\x20'+_0x433608);const _0x89448a=await withSpinner(_0x1b4179(0xbc),()=>_0x146e01['workflow'][_0x1b4179(0x147)](_0x433608,{'limit':_0x324e35[_0x1b4179(0x135)]}),{'verbose':_0x324e35[_0x1b4179(0xcc)]});let _0x42870b=_0x89448a[_0x1b4179(0x1f6)];_0x42870b[_0x1b4179(0x96)]((_0x421ec0,_0x5cf04e)=>{const _0x3fe8ee=_0x1b4179,_0x2dd0b7=_0x421ec0[_0x3fe8ee(0xf9)][_0x3fe8ee(0x120)](_0x5cf04e['name']);if(_0x2dd0b7!==0x0)return _0x2dd0b7;return(_0x421ec0[_0x3fe8ee(0x161)]?.['name']||'')[_0x3fe8ee(0x120)](_0x5cf04e[_0x3fe8ee(0x161)]?.[_0x3fe8ee(0xf9)]||'');});const _0x42124e=_0x324e35[_0x1b4179(0x135)]||0x64,_0x42478b=_0x42870b[_0x1b4179(0xc4)]>=_0x42124e?a43_0x1f625e[_0x1b4179(0x185)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x1b4179(0x21b)](_0x1b4179(0x20a)+_0x42870b[_0x1b4179(0xc4)]+_0x1b4179(0xc5)+(_0x42870b[_0x1b4179(0xc4)]!==0x1?'s':'')+_0x42478b);if(_0x324e35[_0x1b4179(0xd9)]===_0x1b4179(0x141)||_0x324e35[_0x1b4179(0xd9)]==='jsonl'||_0x324e35[_0x1b4179(0xd9)]===_0x1b4179(0x167))await handleSDKOutput(_0x42870b,_0x324e35);else{if(_0x42870b['length']===0x0)_0x433608?console[_0x1b4179(0x195)](_0x1b4179(0x198)+_0x433608):console['log'](_0x1b4179(0x10e));else{const _0x3245f9=_0x324e35['site'],_0x86fbe1=_0x42870b['map'](_0x47a13c=>{const _0x9f8991=_0x1b4179,_0x6d215b=a43_0x1f625e[_0x9f8991(0x185)]('#'+_0x47a13c['id']),_0x145c19=hyperlink(_0x6d215b,getWorkflowUrl(_0x3245f9,_0x47a13c['id'])),_0x503f31=_0x47a13c[_0x9f8991(0x161)]?.[_0x9f8991(0xf9)]?a43_0x1f625e[_0x9f8991(0x185)]('\x20('+_0x47a13c['project'][_0x9f8991(0xf9)]+')'):'';return _0x9f8991(0xf4)+_0x145c19+'\x20'+_0x47a13c[_0x9f8991(0xf9)]+_0x503f31;});await writeOutput(_0x86fbe1['join']('\x0a'),_0x324e35[_0x1b4179(0x1b6)],_0x1b4179(0x1f1));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a43_0x457206(0xf9)]=a43_0x457206(0x179);[a43_0x457206(0x160)]=a43_0x457206(0x99);async[a43_0x457206(0x1f7)](_0x2ee42a){const _0x38bacf=a43_0x457206,{options:_0x38cc5e,args:_0x1b5ee1,tdx:_0xd83bb9}=_0x2ee42a,_0x3563f2=this[_0x38bacf(0x11a)](_0x1b5ee1,_0x38cc5e);if(!_0x3563f2)return 0x1;const {projectName:_0x4339da,workflowName:_0x3a7983}=_0x3563f2;if(_0x38cc5e[_0x38bacf(0xcc)]){if(_0x4339da&&_0x3a7983)console['error'](_0x38bacf(0x1fa)+_0x4339da+'.'+_0x3a7983);else _0x4339da&&console['error'](_0x38bacf(0x15e)+_0x4339da);const _0x2e72c8=_0x38cc5e[_0x38bacf(0x91)];_0x2e72c8&&console['error']('Status:\x20'+_0x2e72c8);}let _0x5d4ba1=0x28;if(process[_0x38bacf(0x221)][_0x38bacf(0x15b)]&&!_0x38cc5e[_0x38bacf(0x1b6)]&&!_0x38cc5e[_0x38bacf(0xd9)]){const _0x1c63e2=process['stdout']['rows']||0x28;_0x5d4ba1=Math[_0x38bacf(0x81)](0x14,Math[_0x38bacf(0x13e)](_0x1c63e2*0x2/0x3));}const _0x30b1f5=_0x38cc5e[_0x38bacf(0x135)]||_0x5d4ba1,_0x381939=await withSpinner(_0x38bacf(0x1a2),()=>_0xd83bb9['workflow']['sessions']({'projectName':_0x4339da,'workflowName':_0x3a7983,'status':_0x38cc5e['status'],'fromTime':_0x38cc5e[_0x38bacf(0xaa)],'toTime':_0x38cc5e['to'],'limit':_0x30b1f5}),{'verbose':_0x38cc5e[_0x38bacf(0xcc)]}),_0x315152=_0x381939['data'];_0x315152['sort']((_0x2e51ea,_0xa93ff2)=>{const _0x3362f4=_0x38bacf,_0x240d3c=_0x2e51ea[_0x3362f4(0x143)]||'',_0x1064fa=_0xa93ff2[_0x3362f4(0x143)]||'';return _0x1064fa[_0x3362f4(0x120)](_0x240d3c);});_0x315152[_0x38bacf(0xc4)]>=_0x30b1f5?console[_0x38bacf(0x21b)](_0x38bacf(0x156)+_0x315152[_0x38bacf(0xc4)]+_0x38bacf(0x17e)+a43_0x1f625e['dim'](_0x38bacf(0xcd))):console[_0x38bacf(0x21b)](_0x38bacf(0x20a)+_0x315152[_0x38bacf(0xc4)]+_0x38bacf(0x90)+(_0x315152[_0x38bacf(0xc4)]!==0x1?'s':''));if(_0x38cc5e[_0x38bacf(0xd9)]==='json'||_0x38cc5e['format']===_0x38bacf(0x7d)||_0x38cc5e[_0x38bacf(0xd9)]===_0x38bacf(0x167))await handleSDKOutput(_0x315152,_0x38cc5e);else{if(!process[_0x38bacf(0x221)][_0x38bacf(0x15b)]||_0x38cc5e[_0x38bacf(0x1b6)]){if(_0x315152[_0x38bacf(0xc4)]===0x0){if(_0x4339da&&_0x3a7983)console[_0x38bacf(0x195)](_0x38bacf(0x1a0)+_0x4339da+'.'+_0x3a7983);else _0x4339da?console[_0x38bacf(0x195)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x4339da):console[_0x38bacf(0x195)](_0x38bacf(0x19a));}else{const _0x44fda0=_0x38cc5e[_0x38bacf(0x14f)],_0x3ca987=this['renderSessionsTimeline'](_0x315152,_0x44fda0);_0x38cc5e[_0x38bacf(0x1b6)]?await writeOutput(_0x3ca987,_0x38cc5e[_0x38bacf(0x1b6)],_0x38bacf(0x1f1)):console[_0x38bacf(0x195)](_0x3ca987);}!_0x4339da&&(console[_0x38bacf(0x21b)](''),console[_0x38bacf(0x21b)](a43_0x1f625e[_0x38bacf(0x185)](_0x38bacf(0x1ff))),console[_0x38bacf(0x21b)](a43_0x1f625e[_0x38bacf(0x185)](_0x38bacf(0x84))+'or'+a43_0x1f625e[_0x38bacf(0x185)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x315152[_0x38bacf(0xc4)]===0x0){if(_0x4339da&&_0x3a7983)console[_0x38bacf(0x195)](_0x38bacf(0x1a0)+_0x4339da+'.'+_0x3a7983);else _0x4339da?console['log'](_0x38bacf(0x1a4)+_0x4339da):console[_0x38bacf(0x195)](_0x38bacf(0x19a));}else await this[_0x38bacf(0x20b)](_0x315152,_0x2ee42a,_0x4339da);}}return 0x0;}['renderSessionsTimeline'](_0x44b428,_0x4104d8){const _0xa4179d=a43_0x457206,_0x2268b1=[],_0x43f349=new Map();let _0x2de2ab=Infinity,_0x113e68=-Infinity;for(const _0x141899 of _0x44b428){if(_0x141899['lastAttempt']?.[_0xa4179d(0x116)]){const _0x1c3312=new Date(_0x141899[_0xa4179d(0xfb)][_0xa4179d(0x116)])[_0xa4179d(0xd2)](),_0x587c1f=_0x141899[_0xa4179d(0xfb)][_0xa4179d(0xe1)]?new Date(_0x141899[_0xa4179d(0xfb)][_0xa4179d(0xe1)])['getTime']():Date[_0xa4179d(0x10a)](),_0x128353=_0x141899[_0xa4179d(0x161)]?.[_0xa4179d(0xf9)]||'(unknown)';!_0x43f349[_0xa4179d(0x13d)](_0x128353)&&_0x43f349[_0xa4179d(0x1f5)](_0x128353,[]),_0x43f349[_0xa4179d(0x19b)](_0x128353)[_0xa4179d(0x1b8)]({'session':_0x141899,'startTime':_0x1c3312,'endTime':_0x587c1f,'duration':_0x587c1f-_0x1c3312}),_0x2de2ab=Math[_0xa4179d(0x170)](_0x2de2ab,_0x1c3312),_0x113e68=Math[_0xa4179d(0x81)](_0x113e68,_0x587c1f);}}if(_0x43f349['size']===0x0)return _0xa4179d(0xb1);const _0x11de34=process[_0xa4179d(0x221)][_0xa4179d(0x1da)]||0x78,_0x3075df=0x1e,_0x36b45a=0x32,_0x59519d=0x4,_0x5226e9=Math[_0xa4179d(0x170)](_0x36b45a,Math[_0xa4179d(0x81)](_0x3075df,Math[_0xa4179d(0x13e)](_0x11de34*0.3))),_0x1cfd7a=_0x11de34-_0x5226e9-TIMELINE_CONFIG[_0xa4179d(0xaf)]-0x3-_0x59519d,_0x2f3fe9=_0x113e68-_0x2de2ab,_0x105252=_0x2f3fe9/_0x5226e9,_0x23698e=renderTimeAxis({'startTime':_0x2de2ab,'endTime':_0x113e68,'durationMs':_0x2f3fe9,'msPerChar':_0x105252},_0x5226e9),_0x1ded13=[];for(const _0x301874 of _0x43f349[_0xa4179d(0x190)]()){_0x1ded13[_0xa4179d(0x1b8)](..._0x301874);}_0x1ded13[_0xa4179d(0x96)]((_0x3fe296,_0x27d68e)=>_0x27d68e[_0xa4179d(0x1c0)]-_0x3fe296[_0xa4179d(0x1c0)]);const _0x4eeed9=new Date(_0x2de2ab),_0x6af267=formatDate(_0x4eeed9),_0x897b06=_0x59519d+TIMELINE_CONFIG[_0xa4179d(0xd1)]+TIMELINE_CONFIG[_0xa4179d(0x212)]+_0x1cfd7a,_0x226dfc='\x20'['repeat'](_0x897b06-_0x6af267['length']),_0x4b7f6a=_0x226dfc+a43_0x1f625e[_0xa4179d(0x185)](_0x6af267)+'\x20'+_0x23698e;_0x2268b1[_0xa4179d(0x1b8)](_0x4b7f6a);const _0x47e801=0x16;let _0x5aaa9a=0x0;for(const _0x21775c of _0x1ded13){const _0x5427ec=_0x21775c[_0xa4179d(0x1ce)][_0xa4179d(0x161)]?.[_0xa4179d(0xf9)]||'?',_0x5f53ca=Math['min'](stringWidth(_0x5427ec),_0x47e801);_0x5aaa9a=Math['max'](_0x5aaa9a,_0x5f53ca);}for(const _0x538ae5 of _0x1ded13){const {session:_0xe42464,startTime:_0x15c723,endTime:_0x2a03f1,duration:_0x1d01f0}=_0x538ae5,_0x3d4a5c=_0xe42464[_0xa4179d(0x161)]?.['id'],_0x7847e5=_0xe42464['id'],_0x268949=_0xe42464[_0xa4179d(0x161)]?.[_0xa4179d(0xf9)]||'?',_0xdb60c2=_0xe42464[_0xa4179d(0x152)]?.['name']||'?';let _0x16d143,_0x2c5fad;if(_0xe42464[_0xa4179d(0xfb)]){const _0xf83688=_0xe42464[_0xa4179d(0xfb)];!_0xf83688[_0xa4179d(0x106)]?(_0x16d143=_0xf83688[_0xa4179d(0xc1)]?'🛑':'🔄',_0x2c5fad=_0xf83688[_0xa4179d(0xc1)]?a43_0x1f625e['yellow']:a43_0x1f625e['blue']):(_0x16d143=_0xf83688[_0xa4179d(0xad)]?'✅':'❌',_0x2c5fad=_0xf83688[_0xa4179d(0xad)]?a43_0x1f625e[_0xa4179d(0x107)]:a43_0x1f625e['red']);}else _0x16d143='⏳',_0x2c5fad=a43_0x1f625e[_0xa4179d(0x185)];const _0xf00bf4='#'+_0x7847e5,_0x55dc5e=_0x3d4a5c?hyperlink(_0xf00bf4,getWorkflowSessionUrl(_0x4104d8,_0x3d4a5c,_0x7847e5)):_0xf00bf4;let _0x40341d=_0x268949;stringWidth(_0x268949)>_0x47e801&&(_0x40341d=_0x268949[_0xa4179d(0x168)](0x0,_0x47e801-0x1)+'…');const _0xd77a40=a43_0x1f625e[_0xa4179d(0x185)](_0x40341d),_0x1e8ac6=stringWidth(_0x40341d),_0x5678ff='\x20'[_0xa4179d(0x197)](_0x5aaa9a-stringWidth(_0x40341d)+0x2),_0x74f7e8='('+formatElapsed(_0x1d01f0)+')',_0x4667f8=stringWidth(_0x74f7e8),_0x20830f=stringWidth(_0xf00bf4),_0x4b7954=_0x20830f+0x1+_0x1e8ac6+_0x5678ff[_0xa4179d(0xc4)],_0x33894c=_0x1cfd7a-_0x4b7954-_0x4667f8-0x1-0x8;let _0x567738=_0xdb60c2;stringWidth(_0x567738)>_0x33894c&&(_0x567738=_0x567738[_0xa4179d(0x168)](0x0,_0x33894c-0x1)+'…');const _0x36401e=_0x55dc5e+'\x20'+_0xd77a40+_0x5678ff+_0x567738,_0x2c8b76=stringWidth(_0x36401e),_0x233603=_0x1cfd7a-_0x2c8b76-_0x4667f8,_0x1533b2=_0x36401e+'\x20'['repeat'](Math[_0xa4179d(0x81)](0x1,_0x233603))+a43_0x1f625e[_0xa4179d(0x185)](_0x74f7e8),_0x255ff5=Math[_0xa4179d(0x13e)]((_0x15c723-_0x2de2ab)/_0x105252),_0x41cc1a=Math['floor']((_0x2a03f1-_0x2de2ab)/_0x105252),_0x7d79de=Math[_0xa4179d(0x81)](_0x255ff5+0x1,_0x41cc1a),_0x1376ac=new Array(_0x5226e9)[_0xa4179d(0xf7)]('\x20');for(let _0x17c9ef=_0x255ff5;_0x17c9ef<Math[_0xa4179d(0x170)](_0x7d79de,_0x5226e9);_0x17c9ef++){_0x1376ac[_0x17c9ef]='─';}const _0x879f31=_0x1376ac[_0xa4179d(0x194)](_0x511338=>_0x511338==='\x20'?'\x20':_0x2c5fad(_0x511338))[_0xa4179d(0x1aa)]('');_0x2268b1['push'](_0x16d143+'\x20'+_0x1533b2+'│'+_0x879f31+'│');}return _0x2268b1[_0xa4179d(0x1aa)]('\x0a');}async['navigateSessionsInteractive'](_0x3b0a9f,_0x3f1df3,_0x8ebb40){const _0x548a47=a43_0x457206,{options:_0x512c82,tdx:_0x193cc0}=_0x3f1df3,_0x4fae08=_0x512c82['site'],{timelineRows:_0x47e9bb,timeAxisHeader:_0x5af1c9}=this[_0x548a47(0xb9)](_0x3b0a9f,_0x4fae08),_0x4d953b=_0x47e9bb['filter'](_0x2c5937=>_0x2c5937[_0x548a47(0xdc)]);if(_0x4d953b[_0x548a47(0xc4)]===0x0){const _0x146f5c=this[_0x548a47(0x177)](_0x3b0a9f,_0x4fae08);console['log'](_0x146f5c);!_0x8ebb40&&(console[_0x548a47(0x21b)](''),console['error'](a43_0x1f625e[_0x548a47(0x185)](_0x548a47(0x1ff))),console[_0x548a47(0x21b)](a43_0x1f625e['dim'](_0x548a47(0x84))+'or'+a43_0x1f625e[_0x548a47(0x185)](_0x548a47(0xd6))));return;}_0x5af1c9&&console[_0x548a47(0x195)](_0x5af1c9);const _0x10f43a=_0x47e9bb[_0x548a47(0x1f0)](_0x55f2a1=>_0x55f2a1['attemptId'])[_0x548a47(0x194)](_0x6ca7=>({'title':_0x6ca7['displayLine'],'value':_0x6ca7['attemptId']})),_0x15db13=process[_0x548a47(0x221)][_0x548a47(0x1e4)]||0x3c,_0x4570bc=Math[_0x548a47(0x81)](0x28,Math['floor'](_0x15db13*0x2/0x3)),_0x12b985=await a43_0x24b3dc({'type':_0x548a47(0x1b7),'name':'attemptId','message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x10f43a,'initial':-0x1,'limit':_0x4570bc,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x479c80,_0x46cac9)=>{const _0x342c22=_0x548a47;if(!_0x479c80)return Promise['resolve'](_0x46cac9);const _0x4ca584=_0x46cac9[_0x342c22(0x1f0)](_0x420808=>{const _0x2b58be=_0x342c22,_0x54670f=_0x420808;return _0x54670f['title'][_0x2b58be(0x15c)]()[_0x2b58be(0x1d0)](_0x479c80[_0x2b58be(0x15c)]());});return Promise[_0x342c22(0x14b)](_0x4ca584);}}),_0x4bcd62=()=>{const _0x249011=_0x548a47;process[_0x249011(0x221)][_0x249011(0x7a)](_0x249011(0x1e1)),process[_0x249011(0x221)][_0x249011(0x7a)](_0x249011(0x1e1)),process['stdout'][_0x249011(0x7a)](_0x249011(0x1e1));},_0x504ef0=_0x12b985&&_0x12b985[_0x548a47(0xdc)]&&_0x12b985['attemptId']!==null&&_0x12b985[_0x548a47(0xdc)][_0x548a47(0x1a6)]()!=='';if(!_0x504ef0){_0x4bcd62(),console['log'](a43_0x1f625e[_0x548a47(0x185)](_0x548a47(0xf8)));return;}_0x4bcd62();const _0x424ea9=_0x3b0a9f[_0x548a47(0xb2)](_0x2e8ab4=>_0x2e8ab4['lastAttempt']?.['id']===_0x12b985[_0x548a47(0xdc)]);if(_0x424ea9){const _0xca67b5=_0x424ea9['project']?.[_0x548a47(0xf9)]||'?',_0x79ad51=_0x424ea9[_0x548a47(0x152)]?.[_0x548a47(0xf9)]||'?';console[_0x548a47(0x195)](_0x548a47(0x182)+a43_0x1f625e[_0x548a47(0x185)](_0xca67b5)+_0x548a47(0xb4)+a43_0x1f625e[_0x548a47(0x185)](_0x79ad51));}const _0x374e6a=new WorkflowTimelineCommand();await _0x374e6a[_0x548a47(0x1f7)]({'args':[],'options':{..._0x512c82,'attemptId':_0x12b985[_0x548a47(0xdc)]},'tdx':_0x193cc0});}[a43_0x457206(0xb9)](_0x18d710,_0x29e24d){const _0x2fd826=a43_0x457206,_0x99a0e9=new Map();for(const _0x27546c of _0x18d710){_0x27546c['id']&&_0x27546c[_0x2fd826(0xfb)]?.['id']&&_0x99a0e9[_0x2fd826(0x1f5)](_0x27546c['id'],_0x27546c[_0x2fd826(0xfb)]['id']);}const _0x50365c=[];let _0x2a727c='';const _0x523588=this['renderSessionsTimeline'](_0x18d710,_0x29e24d),_0x540ea9=_0x523588['split']('\x0a');for(const _0x423439 of _0x540ea9){if(_0x423439[_0x2fd826(0x215)](_0x2fd826(0x93))||_0x423439[_0x2fd826(0xe6)](/^\s+\d{4}-\d{2}-\d{2}/))_0x2a727c=_0x423439;else{if(_0x423439[_0x2fd826(0xe6)](/^[✅❌🔄🛑⏳]/)){const _0xeb1555=_0x423439[_0x2fd826(0xe6)](/#(\d+)/),_0x43d933=_0xeb1555?_0xeb1555[0x1]:null,_0x3ac967=_0x43d933?_0x99a0e9[_0x2fd826(0x19b)](_0x43d933)||null:null,_0x502cdb=_0x18d710[_0x2fd826(0xb2)](_0x5660f0=>_0x5660f0['id']===_0x43d933),_0x588e3e=_0x502cdb?.['project']?.[_0x2fd826(0xf9)]||'';_0x50365c[_0x2fd826(0x1b8)]({'displayLine':_0x423439,'attemptId':_0x3ac967,'projectName':_0x588e3e});}}}return{'timelineRows':_0x50365c,'timeAxisHeader':_0x2a727c};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']='workflow:attempts';[a43_0x457206(0x160)]='List\x20workflow\x20attempts';async[a43_0x457206(0x1f7)](_0x28aacb){const _0x83fdeb=a43_0x457206,{options:_0x5e4949,args:_0x1ac760,tdx:_0xd036c4}=_0x28aacb,_0x513e61=this['parseProjectWorkflowPattern'](_0x1ac760,_0x5e4949);if(!_0x513e61)return 0x1;const {projectName:_0x86ced4,workflowName:_0x4f5382}=_0x513e61,_0xdfb78=_0x5e4949[_0x83fdeb(0x126)];if(_0x5e4949[_0x83fdeb(0xcc)]){if(_0x86ced4&&_0x4f5382)console[_0x83fdeb(0x21b)]('Filter:\x20'+_0x86ced4+'.'+_0x4f5382);else _0x86ced4&&console[_0x83fdeb(0x21b)]('Filter:\x20project='+_0x86ced4);_0xdfb78&&console[_0x83fdeb(0x21b)](_0x83fdeb(0x1bb));}const _0xf131f=await withSpinner(_0x83fdeb(0x1d3),()=>_0xd036c4[_0x83fdeb(0x152)]['attempts']({'projectName':_0x86ced4,'workflowName':_0x4f5382,'includeRetried':_0xdfb78,'limit':_0x5e4949['limit']}),{'verbose':_0x5e4949['verbose']}),_0x503259=_0xf131f[_0x83fdeb(0x1f6)],_0x43b67e=_0x5e4949[_0x83fdeb(0x135)]||0x64,_0x1a89e5=_0x503259[_0x83fdeb(0xc4)]>=_0x43b67e?a43_0x1f625e[_0x83fdeb(0x185)](_0x83fdeb(0x9f)):'';console[_0x83fdeb(0x21b)](_0x83fdeb(0x20a)+_0x503259[_0x83fdeb(0xc4)]+'\x20attempt'+(_0x503259['length']!==0x1?'s':'')+_0x1a89e5);if(_0x5e4949[_0x83fdeb(0xd9)]===_0x83fdeb(0x141)||_0x5e4949[_0x83fdeb(0xd9)]===_0x83fdeb(0x7d)||_0x5e4949[_0x83fdeb(0xd9)]==='table')await handleSDKOutput(_0x503259,_0x5e4949);else{if(_0x503259['length']===0x0){if(_0x86ced4&&_0x4f5382)console[_0x83fdeb(0x195)](_0x83fdeb(0x1e9)+_0x86ced4+'.'+_0x4f5382);else _0x86ced4?console[_0x83fdeb(0x195)]('No\x20attempts\x20found\x20in\x20project:\x20'+_0x86ced4):console[_0x83fdeb(0x195)]('No\x20attempts\x20found');}else{const _0x5f152e=_0x5e4949['site'],_0x5bf543=_0x503259[_0x83fdeb(0x194)](_0x24571e=>{const _0x53b79c=_0x83fdeb,_0x5cca9e=a43_0x1f625e['dim']('#'+_0x24571e['id']),_0x2a0322=_0x24571e[_0x53b79c(0x161)]?.['id'],_0x57fb2a=_0x24571e[_0x53b79c(0x140)]||_0x24571e[_0x53b79c(0x8a)],_0x578970=_0x2a0322&&_0x57fb2a?hyperlink(_0x5cca9e,getWorkflowAttemptUrl(_0x5f152e,_0x2a0322,_0x57fb2a,_0x24571e['id'])):_0x5cca9e,{icon:_0x6a6eb4,text:_0x217f3b}=getAttemptStatusDisplay(_0x24571e),_0x230c2f=(_0x24571e[_0x53b79c(0x161)]?.[_0x53b79c(0xf9)]||'?')+'.'+(_0x24571e[_0x53b79c(0x152)]?.[_0x53b79c(0xf9)]||'?'),_0x1b0847=_0x24571e['sessionTime']?a43_0x1f625e[_0x53b79c(0x185)](_0x24571e[_0x53b79c(0x143)]):'';return(_0x578970+'\x20'+_0x6a6eb4+(_0x217f3b?'\x20'+_0x217f3b:'')+'\x20'+_0x230c2f+'\x20'+_0x1b0847)[_0x53b79c(0x11e)]();});await writeOutput(_0x5bf543[_0x83fdeb(0x1aa)]('\x0a'),_0x5e4949[_0x83fdeb(0x1b6)],_0x83fdeb(0x1f1));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a43_0x457206(0x151);['description']='Show\x20specific\x20attempt\x20details';async[a43_0x457206(0x1f7)](_0x41823c){const _0x47a65b=a43_0x457206,{options:_0x3ffe1e,args:_0x2287ff,tdx:_0x2c6c6d}=_0x41823c,_0x294312=_0x2287ff[0x0];if(!_0x294312)return console[_0x47a65b(0x21b)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x3ffe1e['verbose']&&console['error'](_0x47a65b(0x15f)+_0x294312);const _0x13b7d3=await withSpinner(_0x47a65b(0x1c5),()=>_0x2c6c6d[_0x47a65b(0x152)][_0x47a65b(0x1ee)](_0x294312),{'verbose':_0x3ffe1e[_0x47a65b(0xcc)]}),_0x15a5fe=_0x13b7d3[_0x47a65b(0x1f6)];let _0x40dc6a;!_0x15a5fe['done']?_0x40dc6a=_0x15a5fe[_0x47a65b(0xc1)]?_0x47a65b(0x1cf):_0x47a65b(0x155):_0x40dc6a=_0x15a5fe['success']?'success':_0x47a65b(0x21b);let _0x38d466;if(_0x15a5fe[_0x47a65b(0x116)]&&_0x15a5fe[_0x47a65b(0xe1)]){const _0x3fc655=new Date(_0x15a5fe[_0x47a65b(0x116)])[_0x47a65b(0xd2)](),_0x561a8e=new Date(_0x15a5fe[_0x47a65b(0xe1)])[_0x47a65b(0xd2)]();_0x38d466=Math[_0x47a65b(0x1b5)]((_0x561a8e-_0x3fc655)/0x3e8);}const _0x4d4fac={'attempt_id':_0x15a5fe['id'],'status':_0x40dc6a,..._0x15a5fe[_0x47a65b(0x114)]!==undefined&&{'index':_0x15a5fe[_0x47a65b(0x114)]},..._0x15a5fe[_0x47a65b(0x161)]&&{'project':_0x15a5fe[_0x47a65b(0x161)][_0x47a65b(0xf9)]},..._0x15a5fe[_0x47a65b(0x152)]&&{'workflow':_0x15a5fe[_0x47a65b(0x152)]['name']},..._0x15a5fe[_0x47a65b(0x8a)]&&{'session_id':_0x15a5fe[_0x47a65b(0x8a)]},..._0x15a5fe[_0x47a65b(0x143)]&&{'session_time':_0x15a5fe[_0x47a65b(0x143)]},..._0x15a5fe['retryAttemptName']&&{'retry_attempt':_0x15a5fe['retryAttemptName']},..._0x38d466!==undefined&&{'duration_sec':_0x38d466},..._0x15a5fe['createdAt']&&{'created_at':_0x15a5fe[_0x47a65b(0x116)]},..._0x15a5fe[_0x47a65b(0xe1)]&&{'finished_at':_0x15a5fe[_0x47a65b(0xe1)]},...Object[_0x47a65b(0x1ca)](_0x15a5fe['params'])[_0x47a65b(0xc4)]>0x0&&{'params':_0x15a5fe[_0x47a65b(0x7b)]}};return await handleSingleObjectOutput(_0x4d4fac,_0x3ffe1e),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a43_0x457206(0x146);[a43_0x457206(0x160)]=a43_0x457206(0x207);async[a43_0x457206(0x1f7)](_0x265b19){const _0x1f9e74=a43_0x457206,{options:_0x1695ca,args:_0x6041ed,tdx:_0x1c6ba1}=_0x265b19,_0x3cdabe=_0x6041ed[0x0];if(!_0x3cdabe)return console['error'](_0x1f9e74(0x136)),0x1;const _0x8575f6=_0x1695ca[_0x1f9e74(0x1ec)];_0x1695ca['verbose']&&(console['error'](_0x1f9e74(0x15f)+_0x3cdabe),_0x8575f6&&console[_0x1f9e74(0x21b)]('Including\x20subtasks:\x20yes'));const _0x49e420=await withSpinner(_0x1f9e74(0xd7),()=>_0x1c6ba1[_0x1f9e74(0x152)][_0x1f9e74(0xa6)](_0x3cdabe,_0x8575f6||![]),{'verbose':_0x1695ca[_0x1f9e74(0xcc)]}),_0x143efc=_0x49e420['data'];return console['error']('✔\x20Found\x20'+_0x143efc['length']+_0x1f9e74(0xf1)+(_0x143efc[_0x1f9e74(0xc4)]!==0x1?'s':'')),await handleSDKOutput(_0x143efc,_0x1695ca),0x0;}}function a43_0x4a9e(_0x43f0de,_0x4e5995){_0x43f0de=_0x43f0de-0x77;const _0x17e57f=a43_0x17e5();let _0x4a9ea7=_0x17e57f[_0x43f0de];return _0x4a9ea7;}export class WorkflowLogsCommand extends BaseCommand{[a43_0x457206(0xf9)]=a43_0x457206(0x15a);['description']=a43_0x457206(0x210);async[a43_0x457206(0x1f7)](_0x2fb99c){const _0x4fd70c=a43_0x457206,{options:_0x4de5cb,args:_0x320f82,tdx:_0x4b3874}=_0x2fb99c,_0x58d21c=_0x320f82[0x0];let _0x442d8f=_0x320f82[0x1];if(!_0x58d21c)return console['error'](_0x4fd70c(0x136)),0x1;_0x4de5cb[_0x4fd70c(0xcc)]&&(console[_0x4fd70c(0x21b)]('Attempt\x20ID:\x20'+_0x58d21c),_0x442d8f&&console[_0x4fd70c(0x21b)](_0x4fd70c(0x219)+_0x442d8f));const _0x2f1f5e=await withSpinner(_0x4fd70c(0x1e0),()=>_0x4b3874[_0x4fd70c(0x152)][_0x4fd70c(0x148)](_0x58d21c,_0x442d8f),{'verbose':_0x4de5cb['verbose']}),_0x59fae8=_0x2f1f5e[_0x4fd70c(0x1f6)];if(_0x59fae8['length']===0x0)return console[_0x4fd70c(0x21b)](_0x4fd70c(0x13a)),0x0;if(!_0x442d8f&&(_0x4de5cb['json']||_0x4de5cb[_0x4fd70c(0xd9)]))return await handleSDKOutput(_0x59fae8,_0x4de5cb),0x0;if(!_0x442d8f){const _0x55701e=_0x59fae8[_0x4fd70c(0x194)](_0x1961a3=>({'title':_0x1961a3[_0x4fd70c(0xd5)]+'\x20('+formatBytes(_0x1961a3[_0x4fd70c(0x1ef)])+')','value':_0x1961a3['taskName']})),_0x2d11d2=await a43_0x24b3dc({'type':_0x4fd70c(0x16a),'name':_0x4fd70c(0xc0),'message':_0x4fd70c(0x1c7),'choices':_0x55701e});if(!_0x2d11d2['task'])return console[_0x4fd70c(0x21b)]('Cancelled'),0x0;_0x442d8f=_0x2d11d2[_0x4fd70c(0xc0)];}const _0x2eeb80=await withSpinner(_0x4fd70c(0x103),()=>_0x4b3874[_0x4fd70c(0x152)]['logs'](_0x58d21c,_0x442d8f),{'verbose':_0x4de5cb['verbose']}),_0x5c4c1b=_0x2eeb80[_0x4fd70c(0x1f6)];return _0x5c4c1b?console[_0x4fd70c(0x195)](_0x5c4c1b):console[_0x4fd70c(0x21b)](_0x4fd70c(0x21e)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a43_0x457206(0xf9)]=a43_0x457206(0x16f);[a43_0x457206(0x160)]=a43_0x457206(0xb0);async[a43_0x457206(0x1f7)](_0x1092e4){const _0x4a8227=a43_0x457206,{options:_0x409de,args:_0x2cd66f,tdx:_0x29062a}=_0x1092e4,_0x250001=_0x2cd66f[0x0];if(!_0x250001)return console[_0x4a8227(0x21b)](_0x4a8227(0x136)),0x1;const _0x515bf7=_0x409de[_0x4a8227(0xbd)];_0x409de[_0x4a8227(0xcc)]&&(console['error']('Attempt\x20ID:\x20'+_0x250001),_0x515bf7&&console['error'](_0x4a8227(0x145)+_0x515bf7));if(!_0x409de[_0x4a8227(0x1ae)]){if(!isInteractive())return console[_0x4a8227(0x21b)](a43_0x1f625e['red'](_0x4a8227(0x17c)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4a8227(0x21b)](a43_0x1f625e[_0x4a8227(0x185)](_0x4a8227(0xae))),0x1;const _0x524ab=await confirmKey(_0x4a8227(0x1ac)+_0x250001+'?');if(!_0x524ab)return console[_0x4a8227(0x21b)](a43_0x1f625e[_0x4a8227(0x19f)](_0x4a8227(0xf8))),0x1;}const _0xbcebe9=await withSpinner('Killing\x20attempt...',()=>_0x29062a[_0x4a8227(0x152)][_0x4a8227(0xa8)](_0x250001,_0x515bf7),{'verbose':_0x409de[_0x4a8227(0xcc)]}),_0x346dde=_0xbcebe9[_0x4a8227(0x1f6)];return console['error']('✔\x20'+_0x346dde),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a43_0x457206(0xfe);[a43_0x457206(0x160)]=a43_0x457206(0x20d);async['execute'](_0x6ad177){const _0xd3975b=a43_0x457206,{options:_0x2022fd,args:_0x3a4982,tdx:_0x1407df}=_0x6ad177,_0x5627e8=_0x3a4982[0x0];if(!_0x5627e8)return console['error'](_0xd3975b(0x1a8)),console[_0xd3975b(0x21b)](_0xd3975b(0xfa)),0x1;let _0x5232f5=![],_0x128068=_0x5627e8;if(_0x5627e8[_0xd3975b(0x215)](_0xd3975b(0xba)))_0x5232f5=!![],_0x128068=_0x5627e8[_0xd3975b(0x100)](0x8);else{if(_0x5627e8[_0xd3975b(0x215)](_0xd3975b(0x1dd)))_0x5232f5=![],_0x128068=_0x5627e8[_0xd3975b(0x100)](0x8);else return console[_0xd3975b(0x21b)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console['error'](_0xd3975b(0xfa)),0x1;}const _0x59997a=_0x2022fd[_0xd3975b(0x16c)],_0x4093d6=_0x2022fd[_0xd3975b(0x1cd)],_0x10186e=_0x2022fd[_0xd3975b(0x7b)],_0x1a267b=_0x2022fd['force'];_0x2022fd[_0xd3975b(0xcc)]&&(console[_0xd3975b(0x21b)](_0xd3975b(0x18e)+(_0x5232f5?_0xd3975b(0x1ce):_0xd3975b(0x1ee))+'\x20'+_0x128068),_0x59997a&&console[_0xd3975b(0x21b)](_0xd3975b(0x94)+_0x59997a),_0x4093d6&&console[_0xd3975b(0x21b)](_0xd3975b(0x17d)+_0x4093d6),_0x10186e&&console[_0xd3975b(0x21b)](_0xd3975b(0x15d)+_0x10186e),_0x1a267b&&console[_0xd3975b(0x21b)](_0xd3975b(0xc3)));let _0x40f64;if(_0x10186e)try{if(_0x10186e['startsWith']('@')){const _0x14d8ce=await import(_0xd3975b(0xe4)),_0x22c0e0=_0x10186e['substring'](0x1),_0x48bda1=await _0x14d8ce[_0xd3975b(0x77)](_0x22c0e0,'utf-8');_0x40f64=JSON[_0xd3975b(0x18c)](_0x48bda1);}else _0x40f64=JSON[_0xd3975b(0x18c)](_0x10186e);}catch{return console[_0xd3975b(0x21b)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x2022fd['yes']){if(!isInteractive())return console['error'](a43_0x1f625e['red'](_0xd3975b(0x17c)),_0xd3975b(0xe9)),console[_0xd3975b(0x21b)](a43_0x1f625e[_0xd3975b(0x185)](_0xd3975b(0xae))),0x1;const _0x3e9627=await confirmKey(_0xd3975b(0x169)+(_0x5232f5?_0xd3975b(0x1ce):_0xd3975b(0x1ee))+'\x20'+_0x128068+'?');if(!_0x3e9627)return console['error'](a43_0x1f625e[_0xd3975b(0x19f)](_0xd3975b(0xf8))),0x1;}let _0x42dbce;_0x5232f5?_0x42dbce=await withSpinner(_0xd3975b(0x1d7),()=>_0x1407df['workflow']['retrySession'](_0x128068,{'fromTask':_0x59997a,'retryParams':_0x40f64}),{'verbose':_0x2022fd['verbose']}):_0x42dbce=await withSpinner(_0xd3975b(0x11b),()=>_0x1407df[_0xd3975b(0x152)]['retryAttempt'](_0x128068,{'resumeFrom':_0x4093d6,'retryParams':_0x40f64,'force':_0x1a267b}),{'verbose':_0x2022fd[_0xd3975b(0xcc)]});const _0x457a4c=_0x42dbce[_0xd3975b(0x1f6)];return console['error'](_0xd3975b(0x134)),console[_0xd3975b(0x21b)](_0xd3975b(0x8e)+_0x457a4c[_0xd3975b(0xdc)]),console[_0xd3975b(0x21b)](_0xd3975b(0x8b)+_0x457a4c['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a43_0x457206(0xf9)]=a43_0x457206(0x9d);['description']='Start\x20a\x20workflow\x20run';async[a43_0x457206(0x1f7)](_0xf9c0f4){const _0x559606=a43_0x457206,{options:_0x4d2c57,args:_0x57e946,tdx:_0x2d753c}=_0xf9c0f4;let _0x58b798=_0x57e946[0x0];if(!_0x58b798){const _0x19bf1f=this[_0x559606(0x12c)]([],_0x4d2c57),_0x48bb97=await withSpinner(_0x559606(0x1e7),()=>_0x2d753c[_0x559606(0x152)][_0x559606(0x147)](_0x19bf1f,{'limit':_0x4d2c57[_0x559606(0x135)]}),{'verbose':_0x4d2c57[_0x559606(0xcc)]}),_0x23764f=_0x48bb97[_0x559606(0x1f6)];if(_0x23764f['length']===0x0)return console['error'](_0x559606(0x10e)),!_0x19bf1f&&console[_0x559606(0x21b)](a43_0x1f625e[_0x559606(0x185)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x1eee74=_0x23764f['map'](_0x18f738=>({'title':_0x18f738['project']?.[_0x559606(0xf9)]+'.'+_0x18f738[_0x559606(0xf9)],'value':_0x18f738[_0x559606(0x161)]?.[_0x559606(0xf9)]+'.'+_0x18f738[_0x559606(0xf9)],'description':_0x18f738['revision']?_0x559606(0x1d5)+_0x18f738['revision']:undefined})),_0x28677f=await a43_0x24b3dc({'type':_0x559606(0x16a),'name':_0x559606(0x152),'message':_0x559606(0xb3),'choices':_0x1eee74});if(!_0x28677f[_0x559606(0x152)])return 0x1;_0x58b798=_0x28677f['workflow'];}if(!_0x58b798[_0x559606(0x1d0)]('.')){const _0xe72fb1=this[_0x559606(0x12c)]([],_0x4d2c57);if(_0xe72fb1)_0x58b798=_0xe72fb1+'.'+_0x58b798;else return console['error'](a43_0x1f625e[_0x559606(0x124)](_0x559606(0x1ab)),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console['error'](a43_0x1f625e[_0x559606(0x185)](_0x559606(0x10f))),0x1;}const _0x314e35=_0x4d2c57[_0x559606(0x183)],_0x58140e=_0x4d2c57['sessionTime'],_0x286845={};if(_0x314e35&&Array[_0x559606(0x222)](_0x314e35))for(const _0x2afc98 of _0x314e35){const _0x409cf6=_0x2afc98[_0x559606(0x132)]('=');if(_0x409cf6===-0x1)return console['error']('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x2afc98),console[_0x559606(0x21b)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x2676e8=_0x2afc98[_0x559606(0x100)](0x0,_0x409cf6),_0x53f9a5=_0x2afc98[_0x559606(0x100)](_0x409cf6+0x1);try{_0x286845[_0x2676e8]=JSON[_0x559606(0x18c)](_0x53f9a5);}catch{_0x286845[_0x2676e8]=_0x53f9a5;}}_0x4d2c57[_0x559606(0xcc)]&&(console[_0x559606(0x21b)]('Workflow:\x20'+_0x58b798),Object[_0x559606(0x1ca)](_0x286845)['length']>0x0&&console[_0x559606(0x21b)](_0x559606(0x209)+JSON[_0x559606(0xd0)](_0x286845)),_0x58140e&&console[_0x559606(0x21b)](_0x559606(0x10b)+_0x58140e));const _0x1b03e2=await withSpinner(_0x559606(0x129),()=>_0x2d753c['workflow'][_0x559606(0x80)](_0x58b798,_0x286845,{'sessionTime':_0x58140e}),{'verbose':_0x4d2c57['verbose']}),_0x511da6=_0x1b03e2[_0x559606(0x1f6)];console['error']('✔\x20Workflow\x20run\x20started'),console[_0x559606(0x21b)](_0x559606(0xee)+_0x511da6['id']),console[_0x559606(0x21b)](_0x559606(0x8b)+_0x511da6[_0x559606(0x8a)]),console[_0x559606(0x21b)](_0x559606(0xbf)+_0x511da6[_0x559606(0x161)]?.['name']),console[_0x559606(0x21b)](_0x559606(0xab)+_0x511da6[_0x559606(0x152)]?.['name']);if(_0x511da6[_0x559606(0x161)]?.['id']&&_0x511da6[_0x559606(0x8a)]&&_0x511da6['id']){const _0x3c9ea3=_0x4d2c57[_0x559606(0x14f)],_0x3e85f0=getConsoleUrl(_0x3c9ea3,_0x559606(0x16b)+_0x511da6['project']['id']+_0x559606(0x1c4)+_0x511da6[_0x559606(0x8a)]+_0x559606(0xe5)+_0x511da6['id']);console[_0x559606(0x21b)](_0x559606(0xa0)+a43_0x1f625e['cyan'](_0x3e85f0));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a43_0x457206(0xf9)]='workflow:download';['description']='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a43_0x457206(0x1f7)](_0x752d93){const _0x17aa00=a43_0x457206,{options:_0x58e506,args:_0x164666,tdx:_0x5aa168}=_0x752d93,_0x414032=_0x164666[0x0],_0x315f47=_0x164666[0x1]||'.';if(!_0x414032)return console['error'](_0x17aa00(0x13b)),console[_0x17aa00(0x21b)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x260ed3=_0x58e506[_0x17aa00(0x138)];_0x58e506['verbose']&&(console[_0x17aa00(0x21b)](_0x17aa00(0x182)+_0x414032),console['error'](_0x17aa00(0xff)+_0x315f47),_0x260ed3&&console['error'](_0x17aa00(0x206)+_0x260ed3));const _0x4c0b49=await withSpinner(_0x17aa00(0x7f)+_0x414032+_0x17aa00(0x17b),()=>_0x5aa168[_0x17aa00(0x152)][_0x17aa00(0x113)](_0x414032,_0x315f47,{'revision':_0x260ed3}),{'verbose':_0x58e506[_0x17aa00(0xcc)]}),_0x1c4dfd=_0x4c0b49[_0x17aa00(0x1f6)];return console['error'](_0x17aa00(0xdb)+_0x1c4dfd['projectName']),console[_0x17aa00(0x21b)](_0x17aa00(0x154)+_0x1c4dfd[_0x17aa00(0x138)]),console[_0x17aa00(0x21b)]('\x20\x20Files\x20extracted:\x20'+_0x1c4dfd[_0x17aa00(0xcb)]),console[_0x17aa00(0x21b)](_0x17aa00(0xa5)+_0x315f47+'/'+_0x1c4dfd[_0x17aa00(0xca)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a43_0x457206(0xf9)]='workflow:upload';[a43_0x457206(0x160)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async['execute'](_0x21d335){const _0xdae99e=a43_0x457206,{options:_0x396e2a,args:_0x36b6cf,tdx:_0x2d538b}=_0x21d335;let _0x31f19f='.',_0x502319=_0x396e2a[_0xdae99e(0xf9)];if(_0x36b6cf[0x0]){const {promises:_0x238a3c}=await import('fs');try{const _0x4d6195=await _0x238a3c['stat'](_0x36b6cf[0x0]);if(_0x4d6195[_0xdae99e(0x101)]())_0x31f19f=_0x36b6cf[0x0];else return console[_0xdae99e(0x21b)](_0xdae99e(0x128)+_0x36b6cf[0x0]+_0xdae99e(0x117)),0x1;}catch{_0x502319=_0x36b6cf[0x0],_0x31f19f='.';}}const _0x56950a=_0x396e2a[_0xdae99e(0x138)],_0x3b980c=_0x396e2a[_0xdae99e(0x213)];_0x396e2a[_0xdae99e(0xcc)]&&(console[_0xdae99e(0x21b)](_0xdae99e(0xa2)+_0x31f19f),_0x502319&&console[_0xdae99e(0x21b)](_0xdae99e(0xbe)+_0x502319),_0x56950a&&console['error']('Revision:\x20'+_0x56950a),_0x3b980c&&console[_0xdae99e(0x21b)](_0xdae99e(0x12b)));const _0x55056e=await withSpinner(_0xdae99e(0x95),()=>_0x2d538b[_0xdae99e(0x152)]['push'](_0x31f19f,{'projectName':_0x502319,'revision':_0x56950a,'skipValidation':_0x3b980c}),{'verbose':_0x396e2a[_0xdae99e(0xcc)]}),_0x5b28e3=_0x55056e[_0xdae99e(0x1f6)];return console[_0xdae99e(0x21b)](_0xdae99e(0xa4)+_0x5b28e3[_0xdae99e(0xca)]),console['error'](_0xdae99e(0x88)+_0x5b28e3[_0xdae99e(0x174)]),console['error']('\x20\x20Revision:\x20'+_0x5b28e3[_0xdae99e(0x138)]),await this[_0xdae99e(0x178)](_0x2d538b,_0x5b28e3[_0xdae99e(0xca)],_0x396e2a[_0xdae99e(0x14f)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']=a43_0x457206(0x1f9);[a43_0x457206(0x160)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async[a43_0x457206(0x1f7)](_0x1bd08a){const _0x23935f=a43_0x457206,{options:_0x48733a,args:_0x49bd7b,tdx:_0x5d238f}=_0x1bd08a,_0x20c104=_0x49bd7b[0x0],_0x36e3db=_0x49bd7b[0x1];if(!_0x20c104)return console[_0x23935f(0x21b)](a43_0x1f625e[_0x23935f(0x124)]('Error:'),_0x23935f(0x8c)),console[_0x23935f(0x21b)](a43_0x1f625e[_0x23935f(0x185)](_0x23935f(0x8d))),0x1;const _0x1e3185=_0x48733a[_0x23935f(0x138)];_0x48733a[_0x23935f(0xcc)]&&(console[_0x23935f(0x21b)]('Project:\x20'+_0x20c104),_0x36e3db&&console['error'](_0x23935f(0x137)+_0x36e3db),_0x1e3185&&console['error'](_0x23935f(0x206)+_0x1e3185),_0x48733a['dryRun']&&console[_0x23935f(0x21b)](_0x23935f(0x157)));const _0x1871fa=await withSpinner(_0x23935f(0x203)+_0x20c104+'...',()=>_0x5d238f['workflow'][_0x23935f(0x1e3)](_0x20c104,{'targetDir':_0x36e3db,'revision':_0x1e3185}),{'verbose':_0x48733a[_0x23935f(0xcc)]}),_0x3aa871=_0x1871fa[_0x23935f(0x1f6)];_0x3aa871[_0x23935f(0x1fb)]?console[_0x23935f(0x21b)](_0x23935f(0x224)+_0x3aa871[_0x23935f(0xca)]):console['error']('→\x20Project:\x20'+_0x3aa871['projectName']);console[_0x23935f(0x21b)]('\x20\x20Revision:\x20'+_0x3aa871[_0x23935f(0x138)]),console[_0x23935f(0x21b)](_0x23935f(0x1b3)+(a43_0x2ca821[_0x23935f(0xa9)](process[_0x23935f(0x133)](),_0x3aa871['targetDir'])||'.')),console[_0x23935f(0x21b)](_0x23935f(0x98)+a43_0x1f625e[_0x23935f(0x107)]('+'+_0x3aa871[_0x23935f(0x1ed)][_0x23935f(0x214)]+_0x23935f(0xf3))+',\x20'+(a43_0x1f625e[_0x23935f(0x19f)]('~'+_0x3aa871[_0x23935f(0x1ed)]['modified']+_0x23935f(0x1ad))+',\x20')+(a43_0x1f625e[_0x23935f(0x124)]('-'+_0x3aa871[_0x23935f(0x1ed)][_0x23935f(0x1e6)]+_0x23935f(0x89))+',\x20')+(''+a43_0x1f625e[_0x23935f(0x185)](_0x3aa871[_0x23935f(0x1ed)][_0x23935f(0xc6)]+_0x23935f(0x1bc))));for(const _0x53bdab of _0x3aa871[_0x23935f(0x1db)]){_0x53bdab['type']===_0x23935f(0x159)&&_0x53bdab['diff']&&(console[_0x23935f(0x21b)]('\x0a'+a43_0x1f625e[_0x23935f(0x171)](_0x23935f(0x153)+_0x53bdab[_0x23935f(0xea)])),console[_0x23935f(0x21b)](_0x53bdab[_0x23935f(0x1eb)]));}if(!_0x3aa871[_0x23935f(0x16e)])return saveSessionContext({'workflow_project':_0x3aa871['projectName']},_0x48733a[_0x23935f(0x1ce)]),console[_0x23935f(0x21b)](a43_0x1f625e['green'](_0x23935f(0xfc))),console['error'](a43_0x1f625e[_0x23935f(0x185)](_0x23935f(0xdd)+_0x3aa871[_0x23935f(0xca)])),0x0;if(_0x48733a[_0x23935f(0xda)])return console['error'](a43_0x1f625e[_0x23935f(0x19f)](_0x23935f(0x204))),0x0;if(!_0x48733a[_0x23935f(0x1ae)]){if(!isInteractive())return console[_0x23935f(0x21b)](a43_0x1f625e[_0x23935f(0x124)]('\x0aError:'),_0x23935f(0xe9)),console[_0x23935f(0x21b)](a43_0x1f625e['dim'](_0x23935f(0xae))),0x1;const _0x4f74de=await confirmKey(_0x23935f(0x1cb));if(!_0x4f74de)return console[_0x23935f(0x21b)](a43_0x1f625e[_0x23935f(0x19f)]('Cancelled'),_0x23935f(0x14e)),0x1;}await withSpinner(_0x23935f(0xc8),()=>_0x5d238f[_0x23935f(0x152)][_0x23935f(0x1a7)](_0x3aa871,{'revision':_0x1e3185}),{'verbose':_0x48733a[_0x23935f(0xcc)]}),saveSessionContext({'workflow_project':_0x3aa871['projectName']},_0x48733a[_0x23935f(0x1ce)]),console[_0x23935f(0x21b)](a43_0x1f625e[_0x23935f(0x107)](_0x23935f(0x78)));const _0x4701cb=a43_0x2ca821[_0x23935f(0xa9)](process[_0x23935f(0x133)](),_0x3aa871[_0x23935f(0x149)])||'.';return console[_0x23935f(0x21b)](a43_0x1f625e[_0x23935f(0x185)](_0x23935f(0xa5)+_0x4701cb)),console[_0x23935f(0x21b)](a43_0x1f625e[_0x23935f(0x185)](_0x23935f(0xdd)+_0x3aa871[_0x23935f(0xca)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a43_0x457206(0xf9)]=a43_0x457206(0x181);[a43_0x457206(0x160)]=a43_0x457206(0x112);async[a43_0x457206(0x1f7)](_0x17104f){const _0x3d9def=a43_0x457206,{options:_0x4ce639,args:_0xfb5e18,tdx:_0x9394c4}=_0x17104f,_0x4b3a66=this[_0x3d9def(0x18a)](_0xfb5e18,_0x4ce639),_0x45ca5b=_0x4ce639['revision'],_0x441ed9=_0x4ce639[_0x3d9def(0x213)];_0x4ce639['verbose']&&(_0x4b3a66&&console[_0x3d9def(0x21b)](_0x3d9def(0xc7)+_0x4b3a66),_0x45ca5b&&console['error'](_0x3d9def(0x206)+_0x45ca5b),_0x4ce639[_0x3d9def(0xda)]&&console[_0x3d9def(0x21b)](_0x3d9def(0x157)),_0x441ed9&&console[_0x3d9def(0x21b)](_0x3d9def(0x12b)));let _0x5cdfa4;try{_0x5cdfa4=await withSpinner(_0x3d9def(0x19d),()=>_0x9394c4[_0x3d9def(0x152)]['preparePushProject']({'sourceDir':_0x4b3a66,'revision':_0x45ca5b,'skipValidation':_0x441ed9}),{'verbose':_0x4ce639[_0x3d9def(0xcc)]});}catch(_0x2b04af){if(_0x2b04af instanceof Error&&_0x2b04af[_0x3d9def(0x208)][_0x3d9def(0x1d0)](_0x3d9def(0x1a9)))return console[_0x3d9def(0x21b)](a43_0x1f625e[_0x3d9def(0x124)](_0x3d9def(0x1ab)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x4ce639[_0x3d9def(0x199)]?console[_0x3d9def(0x21b)](a43_0x1f625e['dim']('Tip:\x20cd\x20to\x20workflows/'+_0x4ce639[_0x3d9def(0x199)]+_0x3d9def(0x18f)+_0x4ce639['workflowProject']+'\x27')):console[_0x3d9def(0x21b)](a43_0x1f625e[_0x3d9def(0x185)](_0x3d9def(0xfd))),0x1;throw _0x2b04af;}const _0x516b56=_0x5cdfa4[_0x3d9def(0x1f6)];console[_0x3d9def(0x21b)]('✔\x20Project:\x20'+_0x516b56[_0x3d9def(0xca)]),console[_0x3d9def(0x21b)](_0x3d9def(0x1d4)+_0x516b56['sourceDir']),console[_0x3d9def(0x21b)](_0x3d9def(0x154)+_0x516b56[_0x3d9def(0x138)]),console[_0x3d9def(0x21b)](_0x3d9def(0x98)+a43_0x1f625e['green']('+'+_0x516b56[_0x3d9def(0x1ed)]['new']+'\x20new')+',\x20'+(a43_0x1f625e['yellow']('~'+_0x516b56['summary'][_0x3d9def(0x159)]+_0x3d9def(0x1ad))+',\x20')+(a43_0x1f625e[_0x3d9def(0x124)]('-'+_0x516b56['summary'][_0x3d9def(0x1e6)]+_0x3d9def(0x89))+',\x20')+(''+a43_0x1f625e[_0x3d9def(0x185)](_0x516b56[_0x3d9def(0x1ed)]['unchanged']+_0x3d9def(0x1bc))));for(const _0x26b2d7 of _0x516b56[_0x3d9def(0x1db)]){_0x26b2d7[_0x3d9def(0x127)]===_0x3d9def(0x159)&&_0x26b2d7[_0x3d9def(0x1eb)]&&(console[_0x3d9def(0x21b)]('\x0a'+a43_0x1f625e[_0x3d9def(0x171)](_0x3d9def(0x153)+_0x26b2d7[_0x3d9def(0xea)])),console[_0x3d9def(0x21b)](_0x26b2d7['diff']));}if(!_0x516b56['hasChanges'])return console[_0x3d9def(0x21b)](a43_0x1f625e['green']('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x3d9def(0x178)](_0x9394c4,_0x516b56[_0x3d9def(0xca)],_0x4ce639['site']),0x0;if(_0x4ce639[_0x3d9def(0xda)])return console[_0x3d9def(0x21b)](a43_0x1f625e[_0x3d9def(0x19f)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x4ce639['yes']){if(!isInteractive())return console[_0x3d9def(0x21b)](a43_0x1f625e[_0x3d9def(0x124)](_0x3d9def(0x17c)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3d9def(0x21b)](a43_0x1f625e[_0x3d9def(0x185)](_0x3d9def(0xae))),0x1;const _0x55c878=await confirmKey(_0x3d9def(0xd3));if(!_0x55c878)return console['error'](a43_0x1f625e[_0x3d9def(0x19f)](_0x3d9def(0xf8)),_0x3d9def(0x1fc)),0x1;}const _0x2d58ff=await withSpinner(_0x3d9def(0x163),()=>_0x9394c4['workflow'][_0x3d9def(0x123)](_0x516b56),{'verbose':_0x4ce639['verbose']}),_0x92b04e=_0x2d58ff['data'];return console['error'](a43_0x1f625e[_0x3d9def(0x107)](_0x3d9def(0x192))),console[_0x3d9def(0x21b)](_0x3d9def(0x88)+_0x92b04e[_0x3d9def(0x174)]),console['error'](_0x3d9def(0x154)+_0x92b04e[_0x3d9def(0x138)]),await this['showWorkflowConsoleUrl'](_0x9394c4,_0x92b04e[_0x3d9def(0xca)],_0x4ce639[_0x3d9def(0x14f)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a43_0x457206(0xf9)]=a43_0x457206(0x12d);['description']=a43_0x457206(0x1f8);async[a43_0x457206(0x1f7)](_0x3466ea){const _0x4c89ba=a43_0x457206,{options:_0x1d3245,args:_0x1059f0,tdx:_0x5753da}=_0x3466ea,_0x530ee2=this[_0x4c89ba(0x18a)](_0x1059f0,_0x1d3245),_0x48aef9=_0x1d3245['name'],_0x221e01=_0x1d3245['revision'],_0xd281e3=_0x1d3245[_0x4c89ba(0x213)];if(!_0x530ee2)return console['error'](a43_0x1f625e[_0x4c89ba(0x124)](_0x4c89ba(0x1ab)),_0x4c89ba(0x7e)),console['error'](a43_0x1f625e[_0x4c89ba(0x185)](_0x4c89ba(0xe0))),console['error'](a43_0x1f625e[_0x4c89ba(0x185)](_0x4c89ba(0x1e8))),0x1;if(!_0x48aef9)return console['error'](a43_0x1f625e['red'](_0x4c89ba(0x1ab)),_0x4c89ba(0x1b1)),console['error'](a43_0x1f625e[_0x4c89ba(0x185)](_0x4c89ba(0xe0))),0x1;_0x1d3245[_0x4c89ba(0xcc)]&&(console[_0x4c89ba(0x21b)](_0x4c89ba(0xc7)+_0x530ee2),console[_0x4c89ba(0x21b)]('New\x20project\x20name:\x20'+_0x48aef9),_0x221e01&&console[_0x4c89ba(0x21b)](_0x4c89ba(0x206)+_0x221e01),_0x1d3245[_0x4c89ba(0xda)]&&console[_0x4c89ba(0x21b)](_0x4c89ba(0x157)),_0xd281e3&&console[_0x4c89ba(0x21b)](_0x4c89ba(0x12b)));const _0x104436=await withSpinner(_0x4c89ba(0x108),()=>_0x5753da[_0x4c89ba(0x152)]['prepareCloneProject'](_0x530ee2,_0x48aef9,{'revision':_0x221e01,'skipValidation':_0xd281e3}),{'verbose':_0x1d3245['verbose']}),_0x29d504=_0x104436['data'];console[_0x4c89ba(0x21b)](_0x4c89ba(0x13f)+_0x29d504[_0x4c89ba(0x97)]);_0x29d504['sourceProjectName']&&console[_0x4c89ba(0x21b)]('Source\x20project:\x20'+_0x29d504[_0x4c89ba(0x220)]);console[_0x4c89ba(0x21b)](_0x4c89ba(0x12f)+_0x29d504[_0x4c89ba(0x125)]),console[_0x4c89ba(0x21b)](_0x4c89ba(0x206)+_0x29d504[_0x4c89ba(0x138)]),console[_0x4c89ba(0x21b)](_0x4c89ba(0x1e2)+_0x29d504[_0x4c89ba(0x118)]);_0x29d504['targetExists']&&(console[_0x4c89ba(0x21b)](a43_0x1f625e[_0x4c89ba(0x19f)](_0x4c89ba(0x83)+_0x29d504['newProjectName']+'\x22\x20already\x20exists\x20(ID:\x20'+_0x29d504[_0x4c89ba(0x11c)]+')')),console[_0x4c89ba(0x21b)](a43_0x1f625e[_0x4c89ba(0x19f)](_0x4c89ba(0x19e))));if(_0x1d3245['dryRun'])return console[_0x4c89ba(0x21b)](a43_0x1f625e[_0x4c89ba(0x19f)](_0x4c89ba(0x158))),0x0;if(!_0x1d3245[_0x4c89ba(0x1ae)]){if(!isInteractive())return console[_0x4c89ba(0x21b)](a43_0x1f625e['red'](_0x4c89ba(0x17c)),_0x4c89ba(0xe9)),console[_0x4c89ba(0x21b)](a43_0x1f625e['dim'](_0x4c89ba(0xae))),0x1;const _0x2365a6=_0x29d504[_0x4c89ba(0x220)]||a43_0x2ca821[_0x4c89ba(0xb8)](_0x530ee2),_0xcdf8ab=_0x29d504['targetExists']?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x48aef9+_0x4c89ba(0x16d):'\x0aClone\x20\x22'+_0x2365a6+'\x22\x20to\x20new\x20project\x20\x22'+_0x48aef9+'\x22?',_0x49b51a=await confirmKey(_0xcdf8ab);if(!_0x49b51a)return console[_0x4c89ba(0x21b)](a43_0x1f625e[_0x4c89ba(0x19f)](_0x4c89ba(0xf8))),0x1;}const _0x396693=await withSpinner(_0x29d504[_0x4c89ba(0x1f4)]?'Updating\x20'+_0x48aef9+_0x4c89ba(0x17b):_0x4c89ba(0x21d)+_0x48aef9+_0x4c89ba(0x17b),()=>_0x5753da[_0x4c89ba(0x152)][_0x4c89ba(0xed)](_0x29d504),{'verbose':_0x1d3245[_0x4c89ba(0xcc)]}),_0x827913=_0x396693[_0x4c89ba(0x1f6)];return console['error'](a43_0x1f625e['green'](_0x29d504['targetExists']?_0x4c89ba(0x196):_0x4c89ba(0x131))),console['error'](_0x4c89ba(0xbf)+_0x827913[_0x4c89ba(0x125)]),console['error'](_0x4c89ba(0x88)+_0x827913['newProjectId']),console[_0x4c89ba(0x21b)]('\x20\x20Revision:\x20'+_0x827913[_0x4c89ba(0x138)]),await this['showWorkflowConsoleUrl'](_0x5753da,_0x827913[_0x4c89ba(0x125)],_0x1d3245['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a43_0x457206(0xf9)]=a43_0x457206(0x1a3);['description']=a43_0x457206(0x10d);async[a43_0x457206(0x1f7)](_0x3ff8f5){const _0xe4508c=a43_0x457206,{options:_0x442d05,args:_0x3a9b77,tdx:_0x6385c8}=_0x3ff8f5,_0x13ee59=_0x3a9b77[0x0];if(!_0x13ee59)return console[_0xe4508c(0x21b)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0xe4508c(0x21b)](_0xe4508c(0x172)),0x1;_0x442d05['verbose']&&console[_0xe4508c(0x21b)]('Project:\x20'+_0x13ee59);if(!_0x442d05[_0xe4508c(0x1ae)]){if(!isInteractive())return console[_0xe4508c(0x21b)](a43_0x1f625e[_0xe4508c(0x124)]('\x0aError:'),_0xe4508c(0xe9)),console[_0xe4508c(0x21b)](a43_0x1f625e[_0xe4508c(0x185)](_0xe4508c(0xae))),0x1;const _0x2d5f85=await confirmKey(_0xe4508c(0xf0)+_0x13ee59+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x2d5f85)return console[_0xe4508c(0x21b)](a43_0x1f625e[_0xe4508c(0x19f)]('Cancelled')),0x1;}const _0x4e9b2f=await withSpinner(_0xe4508c(0x165)+_0x13ee59+_0xe4508c(0x17b),()=>_0x6385c8[_0xe4508c(0x152)][_0xe4508c(0x119)](_0x13ee59),{'verbose':_0x442d05['verbose']}),_0x46f6ca=_0x4e9b2f['data'];return console[_0xe4508c(0x21b)](_0xe4508c(0x19c)+_0x46f6ca[_0xe4508c(0xca)]),console[_0xe4508c(0x21b)](_0xe4508c(0x88)+_0x46f6ca[_0xe4508c(0x174)]),0x0;}}export function parseKeyValue(_0x34d616){const _0x323212=a43_0x457206,_0xc17024=_0x34d616[_0x323212(0x132)]('=');if(_0xc17024===-0x1)throw new Error('Invalid\x20format:\x20'+_0x34d616+_0x323212(0x1a1));const _0x3f7bf2=_0x34d616[_0x323212(0x100)](0x0,_0xc17024),_0x337e68=_0x34d616[_0x323212(0x100)](_0xc17024+0x1);if(!_0x3f7bf2)throw new Error(_0x323212(0x109));return{'key':_0x3f7bf2,'value':_0x337e68};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a43_0x457206(0xf9)]=a43_0x457206(0xe3);[a43_0x457206(0x160)]=a43_0x457206(0x1c3);async[a43_0x457206(0x1f7)](_0x246a77){const _0x4c58cc=a43_0x457206,{options:_0x1f07e6,args:_0x297f4a,tdx:_0x329b69}=_0x246a77,_0x29f2c8=this['requireProject'](_0x297f4a,_0x1f07e6);if(!_0x29f2c8)return 0x1;_0x1f07e6['verbose']&&console[_0x4c58cc(0x21b)]('Project:\x20'+_0x29f2c8);const _0x316fee=await withSpinner(_0x4c58cc(0xa7),()=>_0x329b69[_0x4c58cc(0x152)]['listSecrets'](_0x29f2c8),{'verbose':_0x1f07e6['verbose']}),{secrets:_0x383397}=_0x316fee[_0x4c58cc(0x1f6)];return console['error'](_0x4c58cc(0x20a)+_0x383397[_0x4c58cc(0xc4)]+_0x4c58cc(0xf6)+(_0x383397[_0x4c58cc(0xc4)]!==0x1?'s':'')),await handleSDKOutput(_0x383397,_0x1f07e6),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a43_0x457206(0xf9)]=a43_0x457206(0x1c1);[a43_0x457206(0x160)]=a43_0x457206(0x21a);async[a43_0x457206(0x1f7)](_0x3a2639){const _0x5c2a58=a43_0x457206,{options:_0x38d4e2,args:_0xf8b294,tdx:_0x1cb7e0}=_0x3a2639;let _0x1c9346,_0x134e5b;if(_0xf8b294[_0x5c2a58(0xc4)]>=0x2)_0x1c9346=_0xf8b294[0x0],_0x134e5b=_0xf8b294[0x1];else{if(_0xf8b294['length']===0x1&&_0x38d4e2[_0x5c2a58(0x199)])_0x1c9346=_0x38d4e2['workflowProject'],_0x134e5b=_0xf8b294[0x0];else return _0xf8b294[_0x5c2a58(0xc4)]===0x1?(console[_0x5c2a58(0x21b)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x5c2a58(0x10f)),0x1):(console[_0x5c2a58(0x21b)](_0x5c2a58(0x1ea)),console[_0x5c2a58(0x21b)](_0x5c2a58(0x115)),0x1);}let _0x46394b,_0x585807;try{({key:_0x46394b,value:_0x585807}=parseKeyValue(_0x134e5b));}catch(_0x2c572c){return _0x2c572c instanceof Error&&console[_0x5c2a58(0x21b)](a43_0x1f625e[_0x5c2a58(0x124)](_0x5c2a58(0x1ab)),_0x2c572c[_0x5c2a58(0x208)]),0x1;}_0x38d4e2[_0x5c2a58(0xcc)]&&(console[_0x5c2a58(0x21b)](_0x5c2a58(0x182)+_0x1c9346),console[_0x5c2a58(0x21b)](_0x5c2a58(0xa1)+_0x46394b));const _0xd35b2d=await withSpinner(_0x5c2a58(0xd4),()=>_0x1cb7e0[_0x5c2a58(0x152)]['setSecret'](_0x1c9346,_0x46394b,_0x585807),{'verbose':_0x38d4e2[_0x5c2a58(0xcc)]}),_0x708a7f=_0xd35b2d[_0x5c2a58(0x1f6)];return console[_0x5c2a58(0x21b)](_0x5c2a58(0x10c)+_0x708a7f[_0x5c2a58(0x188)]+_0x5c2a58(0x1b9)+_0x708a7f[_0x5c2a58(0xca)]+'\x27'),(_0x38d4e2[_0x5c2a58(0x141)]||_0x38d4e2[_0x5c2a58(0x7d)])&&await handleSingleObjectOutput(_0x708a7f,_0x38d4e2),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a43_0x457206(0xf5);[a43_0x457206(0x160)]=a43_0x457206(0x1c2);async['execute'](_0x83ca1b){const _0x44a40d=a43_0x457206,{options:_0x50dae4,args:_0x483b65,tdx:_0x4211fd}=_0x83ca1b;let _0x2ace9d,_0x447bf4;if(_0x483b65[_0x44a40d(0xc4)]>=0x2)_0x2ace9d=_0x483b65[0x0],_0x447bf4=_0x483b65[0x1];else{if(_0x483b65[_0x44a40d(0xc4)]===0x1&&_0x50dae4[_0x44a40d(0x199)])_0x2ace9d=_0x50dae4[_0x44a40d(0x199)],_0x447bf4=_0x483b65[0x0];else return _0x483b65[_0x44a40d(0xc4)]===0x1?(console[_0x44a40d(0x21b)](_0x44a40d(0x13b)),console['error'](_0x44a40d(0x10f)),0x1):(console[_0x44a40d(0x21b)](_0x44a40d(0x187)),console[_0x44a40d(0x21b)](_0x44a40d(0x9b)),0x1);}_0x50dae4[_0x44a40d(0xcc)]&&(console[_0x44a40d(0x21b)](_0x44a40d(0x182)+_0x2ace9d),console[_0x44a40d(0x21b)]('Key:\x20'+_0x447bf4));if(!_0x50dae4[_0x44a40d(0x1ae)]){if(!isInteractive())return console['error'](a43_0x1f625e[_0x44a40d(0x124)](_0x44a40d(0x17c)),_0x44a40d(0xe9)),console[_0x44a40d(0x21b)](a43_0x1f625e[_0x44a40d(0x185)](_0x44a40d(0xae))),0x1;const _0x5801a1=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x447bf4+_0x44a40d(0x92)+_0x2ace9d+'\x27?');if(!_0x5801a1)return console[_0x44a40d(0x21b)](a43_0x1f625e[_0x44a40d(0x19f)](_0x44a40d(0xf8))),0x1;}const _0x4127c8=await withSpinner(_0x44a40d(0x1f2),()=>_0x4211fd[_0x44a40d(0x152)][_0x44a40d(0x166)](_0x2ace9d,_0x447bf4),{'verbose':_0x50dae4['verbose']}),_0x75d52c=_0x4127c8[_0x44a40d(0x1f6)];return console[_0x44a40d(0x21b)]('✔\x20Secret\x20\x27'+_0x75d52c[_0x44a40d(0x188)]+_0x44a40d(0xd8)+_0x75d52c['projectName']+'\x27'),(_0x50dae4['json']||_0x50dae4[_0x44a40d(0x7d)])&&await handleSingleObjectOutput(_0x75d52c,_0x50dae4),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(_0x3d563e){const _0x4cab37=a43_0x457206,_0x29e6c8=Math[_0x4cab37(0x13e)](_0x3d563e/0x3e8),_0x58acee=Math[_0x4cab37(0x13e)](_0x29e6c8/0x3c),_0x5e8e01=Math['floor'](_0x58acee/0x3c),_0x434069=Math['floor'](_0x5e8e01/0x18);if(_0x434069>0x0){const _0x33924e=_0x5e8e01%0x18;return _0x33924e>0x0?_0x434069+'d\x20'+_0x33924e+'h':_0x434069+'d';}else{if(_0x5e8e01>0x0){const _0x3e7809=_0x58acee%0x3c;return _0x3e7809>0x0?_0x5e8e01+'h\x20'+_0x3e7809+'m':_0x5e8e01+'h';}else{if(_0x58acee>0x0){const _0x39fb1c=_0x29e6c8%0x3c;return _0x39fb1c>0x0?_0x58acee+'m\x20'+_0x39fb1c+'s':_0x58acee+'m';}else return _0x29e6c8+'s';}}}function formatTimestamp(_0x1808c3,_0x36dd5f){const _0x8ae746=a43_0x457206,_0x30a439=new Date(_0x1808c3),_0x5f2a38=String(_0x30a439[_0x8ae746(0xce)]())['padStart'](0x2,'0'),_0x312027=String(_0x30a439[_0x8ae746(0x200)]())[_0x8ae746(0xde)](0x2,'0'),_0x2b7959=_0x5f2a38+':'+_0x312027,_0x2796ca=_0x30a439[_0x8ae746(0x216)]()===_0x36dd5f['getFullYear']()&&_0x30a439[_0x8ae746(0xbb)]()===_0x36dd5f[_0x8ae746(0xbb)]()&&_0x30a439['getDate']()===_0x36dd5f[_0x8ae746(0x150)]();if(_0x2796ca)return _0x2b7959;else{const _0x469e03=String(_0x30a439[_0x8ae746(0xbb)]()+0x1)['padStart'](0x2,'0'),_0x277cb0=String(_0x30a439[_0x8ae746(0x150)]())[_0x8ae746(0xde)](0x2,'0');return _0x469e03+'-'+_0x277cb0+'\x20'+_0x2b7959;}}function formatDate(_0x813be8){const _0x4f383b=a43_0x457206,_0x513599=_0x813be8[_0x4f383b(0x216)](),_0x534f93=String(_0x813be8[_0x4f383b(0xbb)]()+0x1)[_0x4f383b(0xde)](0x2,'0'),_0x1f7cf8=String(_0x813be8[_0x4f383b(0x150)]())['padStart'](0x2,'0');return _0x513599+'-'+_0x534f93+'-'+_0x1f7cf8;}function getTaskStateIcon(_0x4279e7){const _0x23e716={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x23e716[_0x4279e7]||'⚪';}function getBarChar(_0x1f385b){const _0x13d9fa=a43_0x457206;return _0x1f385b===_0x13d9fa(0x21b)||_0x1f385b===_0x13d9fa(0x18b)?'×':'─';}function getBarColor(_0x113d13){const _0x4bd906=a43_0x457206,_0x2695a5={'success':a43_0x1f625e[_0x4bd906(0x107)],'error':a43_0x1f625e[_0x4bd906(0x124)],'group_error':a43_0x1f625e[_0x4bd906(0x124)],'running':a43_0x1f625e[_0x4bd906(0x18d)],'blocked':a43_0x1f625e[_0x4bd906(0x19f)],'planned':a43_0x1f625e[_0x4bd906(0x185)],'canceling':a43_0x1f625e[_0x4bd906(0x19f)]};return _0x2695a5[_0x113d13]||a43_0x1f625e[_0x4bd906(0x1e5)];}function parseTaskName(_0x320d97){const _0x32cd79=a43_0x457206;let _0x418111=_0x320d97[_0x32cd79(0x1f3)](/^\++/,'');const _0x38d845=_0x418111[_0x32cd79(0xcf)]('+'),_0x3d5b1a=_0x38d845[_0x32cd79(0xc4)]>0x1?_0x38d845[_0x32cd79(0xc4)]-0x2:0x0,_0x2d586d=_0x38d845[_0x38d845['length']-0x1]||_0x418111;return{'level':_0x3d5b1a,'name':'+'+_0x2d586d};}function truncateTaskName(_0xd191a5,_0x4e8c1b){const _0x5d91be=a43_0x457206,_0x423553=stringWidth(_0xd191a5);if(_0x423553<=_0x4e8c1b)return _0xd191a5;let _0xff3f0d=_0xd191a5;while(stringWidth(_0xff3f0d+'…')>_0x4e8c1b&&_0xff3f0d[_0x5d91be(0xc4)]>0x0){_0xff3f0d=_0xff3f0d[_0x5d91be(0x168)](0x0,-0x1);}return _0xff3f0d+'…';}function calculateTimeScale(_0x230346,_0x2bd36e){const _0x2d7f0d=a43_0x457206;return{'startTime':_0x230346[_0x2d7f0d(0x144)],'endTime':_0x230346[_0x2d7f0d(0x13c)],'durationMs':_0x230346[_0x2d7f0d(0xe7)],'msPerChar':_0x230346['duration']/_0x2bd36e};}function timeToPosition(_0x1f89ef,_0x1b313a,_0x28c26b){const _0x226c23=a43_0x457206,_0x5233d9=_0x1f89ef-_0x1b313a['startTime'],_0x538480=Math['floor'](_0x5233d9/_0x1b313a[_0x226c23(0x86)]);return Math[_0x226c23(0x81)](0x0,Math['min'](_0x538480,_0x28c26b));}function a43_0x17e5(){const _0x31824f=['Session\x20not\x20found:\x20','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','finishedAt','1095oMxgmn','workflow:secrets:list','fs/promises','/attempt/','match','duration','LABEL_MIN_SPACING','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','path','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Warning:','executeCloneProject','\x20\x20Attempt\x20ID:\x20','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','\x20task','\x0aFailed\x20to\x20fetch\x20attempt\x20data','\x20new','📋\x20','workflow:secrets:delete','\x20secret','fill','Cancelled','name','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','lastAttempt','\x0a✔\x20Already\x20up\x20to\x20date','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','workflow:retry','Output\x20directory:\x20','substring','isDirectory','startedAt','Downloading\x20logs...','\x20logs','List\x20workflows','done','green','Analyzing\x20project...','Key\x20cannot\x20be\x20empty','now','Session\x20time:\x20','✔\x20Secret\x20\x27','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','No\x20workflows\x20found','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','11802ivLaws','unknown','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','download','index','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','createdAt','\x20is\x20not\x20a\x20directory','fileCount','delete','parseProjectWorkflowPattern','Retrying\x20attempt...','existingProjectId','MIN_LABEL_COUNT','trimEnd','\x20of\x20','localeCompare','Using\x20attempt\x20','Usage:\x20tdx\x20wf\x20use\x20<project>','executePushProject','red','newProjectName','includeRetried','type','Error:\x20','Starting\x20workflow\x20run...','Select\x20a\x20session\x20to\x20view\x20timeline:','Validation:\x20skipped','resolveProject','workflow:clone','all','New\x20project\x20name:\x20','Loading\x20sessions...','✔\x20Clone\x20complete','indexOf','cwd','✔\x20Retry\x20started','limit','Error:\x20Attempt\x20ID\x20is\x20required','Target\x20directory:\x20','revision','934932QVQyxG','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Error:\x20Project\x20name\x20is\x20required','end','has','floor','Source:\x20','session_id','json','1419VBCfWM','sessionTime','start','Reason:\x20','workflow:tasks','workflows','logFiles','targetDir','\x0aPolling...\x20(','resolve','total','List\x20all\x20workflow\x20projects','-\x20no\x20files\x20written','site','getDate','workflow:attempt','workflow','---\x20','\x20\x20Revision:\x20','running','✔\x20Showing\x20','Dry\x20run:\x20yes','\x0aDry\x20run\x20-\x20no\x20project\x20created','modified','workflow:logs','isTTY','toLowerCase','Params:\x20','Filter:\x20project=','Attempt\x20ID:\x20','description','project','state','Pushing\x20project...','value','Deleting\x20project\x20','deleteSecret','table','slice','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','select','/app/workflows/','fromTask','\x22\x20with\x20new\x20revision?','hasChanges','workflow:kill','min','cyan','Usage:\x20workflow:delete\x20<project-name-or-id>','No\x20projects\x20match\x20pattern:\x20','projectId','every','workflowName','renderSessionsTimeline','showWorkflowConsoleUrl','workflow:sessions','Loading\x20session...','...','\x0aError:','Resume\x20from:\x20','\x20sessions\x20','Listing\x20workflow\x20projects...','🔄\x20','workflow:push','Project:\x20','param','metadata','dim','\x27...','Error:\x20Secret\x20key\x20is\x20required','key','sys','resolveProjectDir','group_error','parse','blue','Target:\x20','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','values','context','✔\x20Push\x20complete','renderSingleTimeline','map','log','✔\x20Project\x20updated','repeat','No\x20workflows\x20found\x20in\x20project:\x20','workflowProject','No\x20sessions\x20found','get','✔\x20Deleted\x20project\x20','Analyzing\x20changes...','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','yellow','No\x20sessions\x20found\x20for:\x20','.\x20Expected\x20format:\x20KEY=VALUE','Listing\x20workflow\x20sessions...','workflow:delete','No\x20sessions\x20found\x20in\x20project:\x20','3361028nXHVUn','trim','applyPullProject','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','No\x20workflow\x20tdx.json\x20found','join','Error:','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','\x20modified','yes','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','3451QyAOru','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','\x20\x20Target:\x20','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','round','output','autocomplete','push','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Auto-selected\x20latest\x20session:\x20','Include\x20retried:\x20yes','\x20unchanged','text','💡\x20Tip:\x20Use\x20','pending','startTime','workflow:secrets:set','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','/sessions/','Getting\x20attempt\x20details...','LABEL_WIDTH_DIVISOR','Select\x20a\x20task\x20to\x20view\x20logs:','Latest\x20session\x20has\x20no\x20attempt','workflow:projects','keys','\x0aApply\x20these\x20changes?','window','resumeFrom','session','canceling','includes','workflow:timeline','46210AbJlEH','Listing\x20workflow\x20attempts...','\x20\x20Source:\x20','revision:\x20','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Retrying\x20session...','renderTimeline','1541367mKjvPZ','columns','changes','Resolving\x20project\x20\x27','attempt:','pollTimeline','591921sNjjKg','Fetching\x20log\x20files...','\x1b[1A\x1b[2K','Files\x20to\x20upload:\x20','pullProject','rows','white','deleted','Loading\x20workflows...','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','No\x20attempts\x20found\x20for:\x20','Error:\x20KEY=VALUE\x20is\x20required','diff','includeSubtasks','summary','attempt','fileSize','filter','list','Deleting\x20secret...','replace','targetExists','set','data','execute','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','workflow:pull','Filter:\x20','isNewProject','-\x20nothing\x20pushed','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','\x20project','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','getMinutes','follow','toISOString','Pulling\x20project\x20','\x0aDry\x20run\x20-\x20no\x20files\x20written','updatedAt','Revision:\x20','Show\x20tasks\x20for\x20an\x20attempt','message','Parameters:\x20','✔\x20Found\x20','navigateSessionsInteractive','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Retry\x20a\x20session\x20or\x20attempt','2kJrmhE','requireProject','Show\x20logs\x20for\x20a\x20workflow\x20attempt','\x20-\x20','ICON_SPACING','skipValidation','new','startsWith','getFullYear','workflow:workflows','MAX_POLL_ITERATIONS','Task\x20name:\x20','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','error','splice','Cloning\x20to\x20','No\x20log\x20content\x20found','Total:\x20','sourceProjectName','stdout','isArray','Attempt:\x20','→\x20New\x20project:\x20','readFile','✔\x20Pull\x20complete','⚠\x20Showing\x20first\x20','write','params','fullName','jsonl','Source\x20directory\x20is\x20required','Downloading\x20project\x20','run','max','Pattern:\x20','\x0a⚠\x20Project\x20\x22','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','buildTimelineData','msPerChar','planned','\x20\x20Project\x20ID:\x20','\x20deleted','sessionId','\x20\x20Session\x20ID:\x20','Project\x20name\x20is\x20required','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','\x20\x20New\x20attempt\x20ID:\x20','\x20tasks','\x20session','status','\x27\x20from\x20project\x20\x27','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','From\x20task:\x20','Pushing\x20workflow\x20project...','sort','sourceDir','\x20\x20Changes:\x20','List\x20workflow\x20execution\x20sessions','\x20(system)','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','MAX_TIMELINE_WIDTH','workflow:run','projects','\x20(use\x20--limit\x20to\x20show\x20more)','\x20\x20Console:\x20','Key:\x20','Project\x20directory:\x20','\x20to\x20see\x20detailed\x20logs','✔\x20Pushed\x20','\x20\x20Location:\x20','tasks','Listing\x20secrets...','kill','relative','from','\x20\x20Workflow:\x20','MAX_TASKS_DISPLAY','success','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','GUTTER','Kill\x20a\x20running\x20attempt','No\x20sessions\x20with\x20timing\x20information','find','Select\x20a\x20workflow\x20to\x20run',',\x20Workflow:\x20','tdx.json','13592OaKXsW','MIN_TIMELINE_WIDTH','basename','generateSessionTimelineRows','session:','getMonth','Listing\x20workflows...','reason','Project\x20name:\x20','\x20\x20Project:\x20','task','cancelRequested','sessions','Force:\x20yes','length','\x20workflow','unchanged','Source\x20directory:\x20','Writing\x20files...','clear','projectName','filesExtracted','verbose','(use\x20--limit\x20to\x20see\x20more)','getHours','split','stringify','ICON_WIDTH','getTime','\x0aPush\x20these\x20changes?','Setting\x20secret...','taskName','\x20\x20tdx\x20wf\x20use\x20<project>','Getting\x20attempt\x20tasks...','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','format','dryRun','✔\x20Downloaded\x20','attemptId','\x20\x20Session\x20context\x20set\x20to:\x20','padStart'];a43_0x17e5=function(){return _0x31824f;};return a43_0x17e5();}function renderTimeAxis(_0x6cc2fe,_0x17f24e){const _0xa8cab0=a43_0x457206,_0x15c1b8=Math[_0xa8cab0(0x170)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0xa8cab0(0x81)](TIMELINE_CONFIG[_0xa8cab0(0x11d)],Math[_0xa8cab0(0x13e)](_0x17f24e/TIMELINE_CONFIG[_0xa8cab0(0x1c6)]))),_0x5ea951=_0x6cc2fe['durationMs']/(_0x15c1b8-0x1),_0x2d6f0c=new Date(_0x6cc2fe[_0xa8cab0(0x1c0)]),_0x2a5e6b=[];for(let _0x796bc9=0x0;_0x796bc9<_0x15c1b8;_0x796bc9++){const _0x22ef19=_0x6cc2fe['startTime']+_0x796bc9*_0x5ea951,_0x317f5a=timeToPosition(_0x22ef19,_0x6cc2fe,_0x17f24e),_0x5deb82=formatTimestamp(_0x22ef19,_0x2d6f0c);_0x2a5e6b[_0xa8cab0(0x1b8)]({'pos':_0x317f5a,'text':_0x5deb82});}const _0x29ffc4=new Array(_0x17f24e)[_0xa8cab0(0xf7)]('\x20');let _0x41bff1=-0x1;for(const {pos:_0x33f7f1,text:_0x1f8f21}of _0x2a5e6b){let _0x3af29b=Math['max'](0x0,_0x33f7f1-Math[_0xa8cab0(0x13e)](_0x1f8f21[_0xa8cab0(0xc4)]/0x2));_0x3af29b<=_0x41bff1+TIMELINE_CONFIG[_0xa8cab0(0xe8)]&&(_0x3af29b=_0x41bff1+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x3af29b+_0x1f8f21[_0xa8cab0(0xc4)]>_0x17f24e&&(_0x3af29b=_0x17f24e-_0x1f8f21['length']);if(_0x3af29b>=0x0&&_0x3af29b+_0x1f8f21[_0xa8cab0(0xc4)]<=_0x17f24e&&_0x3af29b>_0x41bff1){for(let _0x2b5451=0x0;_0x2b5451<_0x1f8f21[_0xa8cab0(0xc4)];_0x2b5451++){_0x29ffc4[_0x3af29b+_0x2b5451]=_0x1f8f21[_0x2b5451];}_0x41bff1=_0x3af29b+_0x1f8f21['length']-0x1;}}return _0x29ffc4[_0xa8cab0(0x1aa)]('');}function renderTaskRow(_0x1d773f,_0x367fc6,_0x15b673,_0xe23ebd){const _0x52beb0=a43_0x457206,{level:_0x19ada9,name:_0x56c736}=parseTaskName(_0x1d773f[_0x52beb0(0xf9)]),_0x18c44c='\x20'[_0x52beb0(0x197)](_0x19ada9),_0x2ad119=_0x1d773f['window']?'('+formatElapsed(_0x1d773f['window'][_0x52beb0(0xe7)])+')':'',_0x19f90f=stringWidth(_0x2ad119),_0x3e2e62=_0x19ada9*0x1,_0x488cba=_0xe23ebd-_0x3e2e62-_0x19f90f-0x1,_0x118d5d=truncateTaskName(_0x56c736,_0x488cba),_0x846f75=_0x18c44c+_0x118d5d,_0x5e0cec=stringWidth(_0x846f75),_0x58a1ac=_0xe23ebd-_0x5e0cec-_0x19f90f,_0x527de4=_0x846f75+'\x20'['repeat'](Math[_0x52beb0(0x81)](0x1,_0x58a1ac))+a43_0x1f625e['dim'](_0x2ad119),_0x501de9=getTaskStateIcon(_0x1d773f['state']),_0x839ec2=new Array(_0x15b673)[_0x52beb0(0xf7)]('\x20');if(_0x1d773f[_0x52beb0(0x1cc)]){const _0x31749d=timeToPosition(_0x1d773f[_0x52beb0(0x1cc)][_0x52beb0(0x144)],_0x367fc6,_0x15b673),_0x24ea72=timeToPosition(_0x1d773f[_0x52beb0(0x1cc)][_0x52beb0(0x13c)],_0x367fc6,_0x15b673),_0x4a70d3=getBarChar(_0x1d773f[_0x52beb0(0x162)]),_0x3d3ab6=Math['max'](_0x31749d+0x1,_0x24ea72);for(let _0x38dc77=_0x31749d;_0x38dc77<Math[_0x52beb0(0x170)](_0x3d3ab6,_0x15b673);_0x38dc77++){_0x839ec2[_0x38dc77]=_0x4a70d3;}}const _0x1b2877=getBarColor(_0x1d773f[_0x52beb0(0x162)]),_0x5ceb89=_0x839ec2['map'](_0x5e3cbb=>_0x5e3cbb==='\x20'?'\x20':_0x1b2877(_0x5e3cbb))[_0x52beb0(0x1aa)]('');return _0x501de9+'\x20'+_0x527de4+'│'+_0x5ceb89+'│';}function calculateStats(_0x549879){const _0x57b2b6=a43_0x457206,_0x143585={'total':_0x549879[_0x57b2b6(0xc4)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x2a580c of _0x549879){if(_0x2a580c[_0x57b2b6(0x162)]===_0x57b2b6(0xad))_0x143585['success']++;else{if(_0x2a580c[_0x57b2b6(0x162)]===_0x57b2b6(0x21b)||_0x2a580c[_0x57b2b6(0x162)]===_0x57b2b6(0x18b))_0x143585[_0x57b2b6(0x21b)]++;else _0x2a580c[_0x57b2b6(0x162)]===_0x57b2b6(0x155)?_0x143585[_0x57b2b6(0x155)]++:_0x143585[_0x57b2b6(0x1bf)]++;}}return _0x143585;}function formatStats(_0x2eaab4){const _0x399825=a43_0x457206;return[_0x399825(0x21f)+_0x2eaab4[_0x399825(0x14c)],'✅\x20'+_0x2eaab4[_0x399825(0xad)],'❌\x20'+_0x2eaab4[_0x399825(0x21b)],_0x399825(0x180)+_0x2eaab4['running'],'⏳\x20'+_0x2eaab4[_0x399825(0x1bf)]][_0x399825(0x1aa)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a43_0x457206(0x1d1);[a43_0x457206(0x160)]=a43_0x457206(0xef);async['execute'](_0x4057bc){const _0x15c106=a43_0x457206,{options:_0x2544b3,args:_0x2172dc,tdx:_0x234af1}=_0x4057bc;let _0x5120a0,_0xf4fdb0,_0x4db4ca=![];if(_0x2172dc[0x0]){if(_0x2172dc[0x0][_0x15c106(0x1d0)]('.')){const _0x421a52=this[_0x15c106(0x11a)](_0x2172dc,_0x2544b3);if(!_0x421a52)return 0x1;_0x5120a0=_0x421a52[_0x15c106(0xca)],_0xf4fdb0=_0x421a52[_0x15c106(0x176)];}else{_0xf4fdb0=_0x2172dc[0x0],_0x5120a0=_0x2544b3[_0x15c106(0x199)];if(!_0x5120a0)return console['error'](a43_0x1f625e[_0x15c106(0x124)](_0x15c106(0x1ab)),_0x15c106(0x1b4)),0x1;_0x4db4ca=!![];}}else{const _0x57e950=this[_0x15c106(0x11a)](_0x2172dc,_0x2544b3);if(!_0x57e950)return 0x1;_0x5120a0=_0x57e950[_0x15c106(0xca)],_0xf4fdb0=_0x57e950[_0x15c106(0x176)];}if(_0x2544b3['verbose']){if(_0x5120a0&&_0xf4fdb0)console[_0x15c106(0x21b)](_0x15c106(0x1fa)+_0x5120a0+'.'+_0xf4fdb0);else _0x5120a0&&console[_0x15c106(0x21b)](_0x15c106(0x15e)+_0x5120a0);}const _0x1e5ccb=_0x2544b3['attemptId'],_0x103997=_0x2544b3['sessionId'];if(_0x1e5ccb){_0x103997&&console[_0x15c106(0x21b)](a43_0x1f625e[_0x15c106(0x19f)](_0x15c106(0xec)),_0x15c106(0x1fd));const _0x4ba58d=_0x2544b3[_0x15c106(0x201)];return _0x4ba58d?await this[_0x15c106(0x1de)](_0x4057bc,_0x1e5ccb):await this[_0x15c106(0x193)](_0x4057bc,_0x1e5ccb,_0x2544b3),0x0;}if(_0x103997){const _0x40c101=await withSpinner(_0x15c106(0x17a),()=>_0x234af1[_0x15c106(0x152)][_0x15c106(0xc2)]({'projectName':_0x5120a0,'workflowName':_0xf4fdb0,'limit':0x64}),{'verbose':_0x2544b3[_0x15c106(0xcc)]}),_0x4a498b=_0x40c101['data'][_0x15c106(0xb2)](_0x380db4=>_0x380db4['id']===_0x103997);if(!_0x4a498b)return console[_0x15c106(0x21b)](a43_0x1f625e['red'](_0x15c106(0x1ab)),_0x15c106(0xdf)+_0x103997),0x1;if(!_0x4a498b[_0x15c106(0xfb)]?.['id'])return console[_0x15c106(0x21b)](a43_0x1f625e[_0x15c106(0x124)]('Error:'),'Session\x20'+_0x103997+'\x20has\x20no\x20attempts'),0x1;const _0xddf547=_0x4a498b[_0x15c106(0xfb)]['id'];_0x2544b3[_0x15c106(0xcc)]&&console['error'](_0x15c106(0x121)+_0xddf547+'\x20from\x20session\x20'+_0x103997);const _0x39c879=_0x2544b3[_0x15c106(0x201)];return _0x39c879?await this[_0x15c106(0x1de)](_0x4057bc,_0xddf547):await this['renderSingleTimeline'](_0x4057bc,_0xddf547,_0x2544b3),0x0;}const _0x5a7daa=await withSpinner(_0x15c106(0x130),()=>_0x234af1['workflow'][_0x15c106(0xc2)]({'projectName':_0x5120a0,'workflowName':_0xf4fdb0,'limit':_0x2544b3[_0x15c106(0x135)]||0x32}),{'verbose':_0x2544b3['verbose']}),_0x1c58e1=_0x5a7daa['data'];if(_0x1c58e1['length']===0x0){if(_0x5120a0&&_0xf4fdb0)console['error'](_0x15c106(0x1a0)+_0x5120a0+'.'+_0xf4fdb0);else _0x5120a0?console[_0x15c106(0x21b)](_0x15c106(0x1a4)+_0x5120a0):(console[_0x15c106(0x21b)]('No\x20workflow\x20sessions\x20found'),console[_0x15c106(0x21b)](a43_0x1f625e[_0x15c106(0x185)](_0x15c106(0x20c))));return 0x0;}_0x1c58e1['sort']((_0x58adcc,_0x45f60d)=>{const _0x2b0179=_0x15c106,_0x115cf7=_0x58adcc['sessionTime']||'',_0x3d4750=_0x45f60d[_0x2b0179(0x143)]||'';return _0x3d4750[_0x2b0179(0x120)](_0x115cf7);});if(_0x2544b3[_0x15c106(0x141)]||_0x2544b3[_0x15c106(0x7d)])return await handleSDKOutput(_0x1c58e1,_0x2544b3),0x0;let _0x2c3c2a;if(_0x4db4ca){const _0x785857=_0x1c58e1[0x0];if(!_0x785857[_0x15c106(0xfb)]?.['id'])return console[_0x15c106(0x21b)](_0x15c106(0x1c8)),0x0;_0x2c3c2a=_0x785857[_0x15c106(0xfb)]['id'],_0x2544b3[_0x15c106(0xcc)]&&console[_0x15c106(0x21b)](_0x15c106(0x1ba)+_0x785857[_0x15c106(0x143)]);}else{const _0x579cdd=_0x1c58e1['map'](_0x511274=>{const _0x2c1b4e=_0x15c106,_0xa7aa04=getAttemptStatusDisplay(_0x511274[_0x2c1b4e(0xfb)]);return{'title':_0x511274['project']?.['name']+'.'+_0x511274['workflow']?.[_0x2c1b4e(0xf9)]+'\x20-\x20'+_0x511274[_0x2c1b4e(0x143)]+'\x20'+_0xa7aa04['icon'],'value':_0x511274[_0x2c1b4e(0xfb)]?.['id']||'','description':_0xa7aa04[_0x2c1b4e(0x1bd)]};}),_0xbc09b5=await a43_0x24b3dc({'type':'select','name':_0x15c106(0xdc),'message':_0x15c106(0x12a),'choices':_0x579cdd['filter'](_0x94ae54=>_0x94ae54[_0x15c106(0x164)]!=='')});if(!_0xbc09b5['attemptId'])return 0x0;_0x2c3c2a=_0xbc09b5[_0x15c106(0xdc)];}const _0x233581=_0x2544b3[_0x15c106(0x201)];return _0x233581?await this['pollTimeline'](_0x4057bc,_0x2c3c2a):await this[_0x15c106(0x193)](_0x4057bc,_0x2c3c2a,_0x2544b3),0x0;}async[a43_0x457206(0x193)](_0x48ced8,_0x5844bb,_0x4e4a6f){const _0x12d9bc=a43_0x457206,{tdx:_0x5d2b4a}=_0x48ced8;let _0x5ae733,_0x4ef144;try{[_0x5ae733,_0x4ef144]=await Promise[_0x12d9bc(0x12e)]([_0x5d2b4a['workflow']['attempt'](_0x5844bb),_0x5d2b4a[_0x12d9bc(0x152)][_0x12d9bc(0xa6)](_0x5844bb,![])]);}catch(_0x295218){console[_0x12d9bc(0x21b)](a43_0x1f625e[_0x12d9bc(0x124)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x4e4a6f[_0x12d9bc(0xcc)]&&console[_0x12d9bc(0x21b)](_0x295218);throw _0x295218;}if(_0x4e4a6f['json']||_0x4e4a6f['jsonl']){const _0x514ad6=this['buildTimelineData'](_0x5ae733,_0x4ef144);await handleSDKOutput([_0x514ad6],_0x4e4a6f);return;}const _0x4dfd13=_0x5d2b4a[_0x12d9bc(0x191)][_0x12d9bc(0x14f)],_0x4cfa48=this[_0x12d9bc(0x1d8)](_0x5ae733,_0x4ef144,_0x4dfd13);console[_0x12d9bc(0x195)](_0x4cfa48);}async[a43_0x457206(0x1de)](_0x22599e,_0x192d91){const _0x8770c5=a43_0x457206,{tdx:_0x749f72}=_0x22599e,_0x104659=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x50486c=TIMELINE_CONFIG[_0x8770c5(0x218)];let _0x28ad66=0x0;while(_0x28ad66<_0x50486c){process[_0x8770c5(0x221)][_0x8770c5(0x15b)]&&process[_0x8770c5(0x221)][_0x8770c5(0x7a)]('\x1bc');let _0x1429d8,_0xa1f358;try{[_0x1429d8,_0xa1f358]=await Promise['all']([_0x749f72[_0x8770c5(0x152)][_0x8770c5(0x1ee)](_0x192d91),_0x749f72[_0x8770c5(0x152)][_0x8770c5(0xa6)](_0x192d91,![])]);}catch(_0xe106f3){console[_0x8770c5(0x21b)](a43_0x1f625e[_0x8770c5(0x124)](_0x8770c5(0xf2)));_0x28ad66>0x0&&console[_0x8770c5(0x21b)](a43_0x1f625e['dim']('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x28ad66));throw _0xe106f3;}const _0x41df39=_0x749f72['context'][_0x8770c5(0x14f)],_0x455549=this[_0x8770c5(0x1d8)](_0x1429d8,_0xa1f358,_0x41df39);console[_0x8770c5(0x195)](_0x455549);const _0x240da6=_0x1429d8['done']&&_0xa1f358[_0x8770c5(0x175)](_0x3b484b=>_0x3b484b[_0x8770c5(0x162)]!==_0x8770c5(0x155)&&_0x3b484b[_0x8770c5(0x162)]!==_0x8770c5(0x87));if(_0x240da6){console['error'](a43_0x1f625e[_0x8770c5(0x107)]('\x0a✔\x20Attempt\x20complete'));break;}console[_0x8770c5(0x21b)](a43_0x1f625e[_0x8770c5(0x185)](_0x8770c5(0x14a)+_0x28ad66*0x2+_0x8770c5(0x1af))),await new Promise(_0x5b596a=>setTimeout(_0x5b596a,_0x104659)),_0x28ad66++;}_0x28ad66>=_0x50486c&&console[_0x8770c5(0x21b)](a43_0x1f625e['yellow']('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a43_0x457206(0x1d8)](_0x1ae9fa,_0x55442a,_0x3f880b){const _0x2f5918=a43_0x457206,_0x1e6f7b=[],_0x381735=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x3a34c3=0x5,_0x4f8e7b=process[_0x2f5918(0x221)][_0x2f5918(0x1da)]||0x78,_0x29231f=_0x4f8e7b-_0x381735-_0x3a34c3,_0x2d288e=Math[_0x2f5918(0x81)](TIMELINE_CONFIG[_0x2f5918(0xb7)],Math['min'](_0x29231f,TIMELINE_CONFIG[_0x2f5918(0x9c)])),_0x4a53c4=new Date(_0x1ae9fa['createdAt'])[_0x2f5918(0xd2)](),_0x22424d=_0x1ae9fa[_0x2f5918(0xe1)]?new Date(_0x1ae9fa[_0x2f5918(0xe1)])[_0x2f5918(0xd2)]():Date[_0x2f5918(0x10a)](),_0x5758cb={'start':_0x4a53c4,'end':_0x22424d,'duration':_0x22424d-_0x4a53c4},_0x28754f=new Map(),_0x2d76c0=[];for(const _0x4a7db1 of _0x55442a){if(_0x4a7db1[_0x2f5918(0x102)]){const _0x38033c=new Date(_0x4a7db1[_0x2f5918(0x102)])[_0x2f5918(0xd2)](),_0x5ee37c=_0x4a7db1[_0x2f5918(0x205)]?new Date(_0x4a7db1['updatedAt'])[_0x2f5918(0xd2)]():Date[_0x2f5918(0x10a)](),_0x1362c5={'start':_0x38033c,'end':_0x5ee37c,'duration':_0x5ee37c-_0x38033c};_0x28754f['set'](_0x4a7db1['id'],_0x1362c5),_0x2d76c0['push']({'name':_0x4a7db1[_0x2f5918(0x7c)],'state':_0x4a7db1[_0x2f5918(0x162)]||_0x2f5918(0x111),'window':_0x1362c5});}else _0x2d76c0['push']({'name':_0x4a7db1[_0x2f5918(0x7c)],'state':_0x4a7db1['state']||_0x2f5918(0x87),'window':undefined});}_0x2d76c0[_0x2f5918(0x96)]((_0x3d87c5,_0x15a234)=>{const _0xb7bd24=_0x2f5918;if(!_0x3d87c5[_0xb7bd24(0x1cc)])return 0x1;if(!_0x15a234[_0xb7bd24(0x1cc)])return-0x1;return _0x3d87c5['window'][_0xb7bd24(0x144)]-_0x15a234[_0xb7bd24(0x1cc)][_0xb7bd24(0x144)];});const _0x39798=_0x2d76c0[_0x2f5918(0xc4)],_0x47aa99=_0x39798>TIMELINE_CONFIG[_0x2f5918(0xac)];_0x47aa99&&_0x2d76c0[_0x2f5918(0x21c)](TIMELINE_CONFIG[_0x2f5918(0xac)]);const _0x8645ee=calculateTimeScale(_0x5758cb,_0x2d288e),_0x434410=_0x1ae9fa[_0x2f5918(0x106)]?_0x1ae9fa[_0x2f5918(0xad)]?a43_0x1f625e[_0x2f5918(0x107)](_0x2f5918(0xad)):a43_0x1f625e['red']('error'):a43_0x1f625e[_0x2f5918(0x18d)](_0x2f5918(0x155)),_0x72e45d=_0x1ae9fa['project']?.['id'],_0x144e62=_0x1ae9fa[_0x2f5918(0x8a)];let _0x3483d5;if(_0x72e45d&&_0x144e62){const _0x45775f=getWorkflowAttemptUrl(_0x3f880b,_0x72e45d,_0x144e62,_0x1ae9fa['id']);_0x3483d5=hyperlink(a43_0x1f625e[_0x2f5918(0x185)](_0x1ae9fa['id']),_0x45775f);}else _0x3483d5=a43_0x1f625e['dim'](_0x1ae9fa['id']);_0x1e6f7b[_0x2f5918(0x1b8)](_0x2f5918(0x223)+_0x3483d5+'\x20-\x20'+_0x434410+_0x2f5918(0x211)+formatElapsed(_0x5758cb[_0x2f5918(0xe7)]));if(_0x2d76c0['length']>0x0){const _0x22bafe=renderTimeAxis(_0x8645ee,_0x2d288e),_0x1c481b=new Date(_0x5758cb[_0x2f5918(0x144)]),_0x2c483b=formatDate(_0x1c481b),_0x176ec1=TIMELINE_CONFIG[_0x2f5918(0xd1)]+TIMELINE_CONFIG[_0x2f5918(0x212)]+_0x381735,_0x3e0411=_0x2c483b[_0x2f5918(0xde)](_0x176ec1),_0x1afc59=a43_0x1f625e['dim'](_0x3e0411);_0x1e6f7b['push'](_0x1afc59+'\x20'+_0x22bafe);for(const _0x2d6d31 of _0x2d76c0){_0x1e6f7b[_0x2f5918(0x1b8)](renderTaskRow(_0x2d6d31,_0x8645ee,_0x2d288e,_0x381735));}const _0x54bb03=calculateStats(_0x2d76c0);_0x1e6f7b[_0x2f5918(0x1b8)](formatStats(_0x54bb03)),_0x47aa99&&_0x1e6f7b['push'](a43_0x1f625e[_0x2f5918(0x19f)](_0x2f5918(0x79)+TIMELINE_CONFIG[_0x2f5918(0xac)]+_0x2f5918(0x11f)+_0x39798+_0x2f5918(0x8f))),_0x1e6f7b[_0x2f5918(0x1b8)](''),_0x1e6f7b['push'](a43_0x1f625e[_0x2f5918(0x185)](_0x2f5918(0x1be))+('tdx\x20wf\x20attempt\x20'+_0x1ae9fa['id']+_0x2f5918(0x104))+a43_0x1f625e[_0x2f5918(0x185)](_0x2f5918(0xa3)));}else _0x1e6f7b[_0x2f5918(0x1b8)](_0x2f5918(0x1d6));return _0x1e6f7b[_0x2f5918(0x1aa)]('\x0a');}[a43_0x457206(0x85)](_0x731387,_0x3cb50d){const _0x5daab8=a43_0x457206,_0x411526=new Date(_0x731387['createdAt'])[_0x5daab8(0xd2)](),_0x50d2b0=_0x731387[_0x5daab8(0xe1)]?new Date(_0x731387[_0x5daab8(0xe1)])[_0x5daab8(0xd2)]():Date[_0x5daab8(0x10a)](),_0x249e33=_0x50d2b0-_0x411526,_0x55cbb2=[];for(const _0x5bb63d of _0x3cb50d){if(_0x5bb63d[_0x5daab8(0x102)]){const _0x1a9b42=new Date(_0x5bb63d['startedAt'])['getTime'](),_0x3bcf57=_0x5bb63d[_0x5daab8(0x205)]?new Date(_0x5bb63d[_0x5daab8(0x205)])[_0x5daab8(0xd2)]():Date['now']();_0x55cbb2[_0x5daab8(0x1b8)]({'name':_0x5bb63d[_0x5daab8(0x7c)],'state':_0x5bb63d[_0x5daab8(0x162)]||_0x5daab8(0x111),'window':{'start':_0x1a9b42,'end':_0x3bcf57,'duration':_0x3bcf57-_0x1a9b42}});}else _0x55cbb2[_0x5daab8(0x1b8)]({'name':_0x5bb63d[_0x5daab8(0x7c)],'state':_0x5bb63d[_0x5daab8(0x162)]||_0x5daab8(0x87),'window':undefined});}const _0x36aedc=calculateStats(_0x55cbb2);return{'attempt':{'id':_0x731387['id'],'status':_0x731387[_0x5daab8(0x106)]?_0x731387[_0x5daab8(0xad)]?_0x5daab8(0xad):_0x5daab8(0x21b):_0x5daab8(0x155),'createdAt':_0x731387[_0x5daab8(0x116)],'finishedAt':_0x731387[_0x5daab8(0xe1)],'duration_ms':_0x249e33},'tasks':_0x55cbb2['map'](_0x3adf35=>({'name':_0x3adf35[_0x5daab8(0xf9)],'state':_0x3adf35['state'],'startedAt':_0x3adf35['window']?new Date(_0x3adf35[_0x5daab8(0x1cc)][_0x5daab8(0x144)])[_0x5daab8(0x202)]():null,'updatedAt':_0x3adf35[_0x5daab8(0x1cc)]?new Date(_0x3adf35[_0x5daab8(0x1cc)][_0x5daab8(0x13c)])[_0x5daab8(0x202)]():null,'duration_ms':_0x3adf35[_0x5daab8(0x1cc)]?.[_0x5daab8(0xe7)]||null})),'stats':_0x36aedc};}}
|