@treasuredata/tdx 0.14.9 → 0.16.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.d.ts +1 -1
- package/dist/cli-categories.js +1 -1
- package/dist/cli-categories.js.map +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.d.ts +16 -0
- package/dist/commands/agent-test-command.d.ts.map +1 -0
- package/dist/commands/agent-test-command.js +1 -0
- package/dist/commands/agent-test-command.js.map +1 -0
- 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.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/mcp-command.d.ts +19 -0
- package/dist/commands/mcp-command.d.ts.map +1 -0
- package/dist/commands/mcp-command.js +1 -0
- package/dist/commands/mcp-command.js.map +1 -0
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.d.ts +31 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +1 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +10 -0
- package/dist/mcp/tools/index.d.ts.map +1 -0
- package/dist/mcp/tools/index.js +1 -0
- package/dist/mcp/tools/index.js.map +1 -0
- package/dist/mcp/tools/tdx-run.d.ts +35 -0
- package/dist/mcp/tools/tdx-run.d.ts.map +1 -0
- package/dist/mcp/tools/tdx-run.js +1 -0
- package/dist/mcp/tools/tdx-run.js.map +1 -0
- package/dist/mcp/tools/tdx-search.d.ts +42 -0
- package/dist/mcp/tools/tdx-search.d.ts.map +1 -0
- package/dist/mcp/tools/tdx-search.js +1 -0
- package/dist/mcp/tools/tdx-search.js.map +1 -0
- package/dist/mcp/utils.d.ts +35 -0
- package/dist/mcp/utils.d.ts.map +1 -0
- package/dist/mcp/utils.js +1 -0
- package/dist/mcp/utils.js.map +1 -0
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.d.ts +46 -0
- package/dist/sdk/agent/agent-config.d.ts.map +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-config.js.map +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.d.ts +44 -0
- package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/agent-yaml.js.map +1 -1
- package/dist/sdk/agent/test/evaluator.d.ts +55 -0
- package/dist/sdk/agent/test/evaluator.d.ts.map +1 -0
- package/dist/sdk/agent/test/evaluator.js +1 -0
- package/dist/sdk/agent/test/evaluator.js.map +1 -0
- package/dist/sdk/agent/test/executor.d.ts +73 -0
- package/dist/sdk/agent/test/executor.d.ts.map +1 -0
- package/dist/sdk/agent/test/executor.js +1 -0
- package/dist/sdk/agent/test/executor.js.map +1 -0
- package/dist/sdk/agent/test/index.d.ts +12 -0
- package/dist/sdk/agent/test/index.d.ts.map +1 -0
- package/dist/sdk/agent/test/index.js +1 -0
- package/dist/sdk/agent/test/index.js.map +1 -0
- package/dist/sdk/agent/test/output.d.ts +19 -0
- package/dist/sdk/agent/test/output.d.ts.map +1 -0
- package/dist/sdk/agent/test/output.js +1 -0
- package/dist/sdk/agent/test/output.js.map +1 -0
- package/dist/sdk/agent/test/parser.d.ts +55 -0
- package/dist/sdk/agent/test/parser.d.ts.map +1 -0
- package/dist/sdk/agent/test/parser.js +1 -0
- package/dist/sdk/agent/test/parser.js.map +1 -0
- package/dist/sdk/agent/test/types.d.ts +169 -0
- package/dist/sdk/agent/test/types.d.ts.map +1 -0
- package/dist/sdk/agent/test/types.js +1 -0
- package/dist/sdk/agent/test/types.js.map +1 -0
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.d.ts +42 -0
- package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +1 -0
- package/dist/sdk/claude-agent/claude-agent-client.js +1 -0
- package/dist/sdk/claude-agent/claude-agent-client.js.map +1 -0
- package/dist/sdk/claude-agent/environment.d.ts +50 -0
- package/dist/sdk/claude-agent/environment.d.ts.map +1 -0
- package/dist/sdk/claude-agent/environment.js +1 -0
- package/dist/sdk/claude-agent/environment.js.map +1 -0
- package/dist/sdk/claude-agent/index.d.ts +15 -0
- package/dist/sdk/claude-agent/index.d.ts.map +1 -0
- package/dist/sdk/claude-agent/index.js +1 -0
- package/dist/sdk/claude-agent/index.js.map +1 -0
- package/dist/sdk/claude-agent/system-prompts.d.ts +22 -0
- package/dist/sdk/claude-agent/system-prompts.d.ts.map +1 -0
- package/dist/sdk/claude-agent/system-prompts.js +1 -0
- package/dist/sdk/claude-agent/system-prompts.js.map +1 -0
- package/dist/sdk/claude-agent/types.d.ts +75 -0
- package/dist/sdk/claude-agent/types.d.ts.map +1 -0
- package/dist/sdk/claude-agent/types.js +1 -0
- package/dist/sdk/claude-agent/types.js.map +1 -0
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.d.ts +17 -0
- package/dist/sdk/client/endpoints.d.ts.map +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/endpoints.js.map +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.d.ts +6 -0
- package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js.map +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.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.d.ts +3 -1
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +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.d.ts +9 -1
- package/dist/sdk/llm/index.d.ts.map +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/index.js.map +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.d.ts +12 -1
- package/dist/utils/tdx-logger.d.ts.map +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tdx-logger.js.map +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +4 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
function a39_0x3553(){const _0xf5d26d=['hasChanges','No\x20sessions\x20with\x20timing\x20information','getTime','resumeFrom','\x20-\x20','retryAttempt','List\x20workflow\x20execution\x20sessions','tdx.json','✔\x20Workflow\x20run\x20started','workflow:use','...','Filter:\x20project=','\x20\x20Source:\x20','lastAttempt','Error:','table','padStart','\x20workflow','workflowProject','New\x20project\x20name:\x20','getMonth','done','169535ZoDyFX','No\x20workflow\x20sessions\x20found','Error:\x20Invalid\x20parameter\x20format:\x20','attemptId','attempt:','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','pollTimeline','targetDir','download','fromTask','LABEL_WIDTH_DIVISOR','Failed\x20to\x20fetch\x20attempt\x20data','\x20session','task','basename','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','No\x20log\x20files\x20found\x20for\x20this\x20attempt','pending','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','Listing\x20workflows...','write','workflow:projects','filter','146904VZrIsP','Include\x20retried:\x20yes','✔\x20New\x20project:\x20','✔\x20Project:\x20','Starting\x20workflow\x20run...','find','Source\x20directory:\x20','tasks','projects','Pulling\x20project\x20','resolve','startsWith','sessionId','sort','workflow:upload','Updating\x20','group_error','\x20\x20Workflow:\x20','list','min','Retrying\x20attempt...','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','Including\x20subtasks:\x20yes','error','\x20\x20Revision:\x20','join','workflow:kill','utf-8','map','renderSessionsTimeline','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','No\x20attempts\x20found','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','new','data','name','buildTimelineData','dim','768755WGEBOD','✔\x20Downloaded\x20','Error:\x20KEY=VALUE\x20is\x20required','status','ICON_WIDTH','keys','Attempt\x20ID:\x20','Session\x20','\x20from\x20session\x20','updatedAt','parseProjectWorkflowPattern','Pushing\x20workflow\x20project...','has','✔\x20Workflow\x20project\x20set\x20to:\x20','isArray','List\x20workflows','context','force','\x20\x20Session\x20context\x20set\x20to:\x20','diff','size','Latest\x20session\x20has\x20no\x20attempt','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','🔄\x20','No\x20sessions\x20found\x20in\x20project:\x20','Pushing\x20project...','\x22?\x20This\x20cannot\x20be\x20undone.','yellow','execute','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','site','Error:\x20Project\x20name\x20is\x20required','No\x20workflows\x20found','\x0aApply\x20these\x20changes?','TASK_NAME_WIDTH','format','\x20modified','Key:\x20','Filter:\x20','No\x20attempts\x20found\x20for:\x20','workflow:attempt','Validation:\x20skipped','from','applyPullProject','autocomplete','Getting\x20attempt\x20tasks...','\x22\x20with\x20new\x20revision?','Tip:\x20cd\x20to\x20workflows/','1629234DXpnwp','Resolving\x20project\x20\x27','showWorkflowConsoleUrl','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','\x0aFailed\x20to\x20fetch\x20attempt\x20data',',\x20Workflow:\x20','\x20\x20New\x20attempt\x20ID:\x20','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','targetExists','No\x20matching\x20sessions\x20found','green','Revision:\x20','Total:\x20','Listing\x20workflow\x20attempts...','workflow','msPerChar','MAX_TIMELINE_WIDTH','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','/app/workflows/','Downloading\x20logs...','Source:\x20','index','run','start','createdAt','Cloning\x20to\x20','description','\x20\x20Changes:\x20','displayLine','workflow:secrets:set','Listing\x20secrets...','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','max','text','Show\x20specific\x20attempt\x20details','478560KjyXfU','preparePushProject','path','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','params','finishedAt','includes','round','listSecrets','List\x20workflow\x20attempts','running','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','No\x20projects\x20match\x20pattern:\x20','sessionTime','prepareCloneProject','/attempt/','✔\x20Retry\x20started','Start\x20a\x20workflow\x20run','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','session','generateSessionTimelineRows','MIN_LABEL_COUNT','jsonl','MIN_TIMELINE_WIDTH','Target\x20directory:\x20','taskName','stat','4uNrVxY','reason','Project:\x20','planned','\x20\x20Project\x20ID:\x20','parse','duration','Expected\x20format:\x20--param\x20key=value','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','cwd','Output\x20directory:\x20','durationMs','splice','Using\x20attempt\x20','Error:\x20Invalid\x20JSON\x20in\x20--params','\x0aDry\x20run\x20-\x20nothing\x20pushed','Project\x20directory:\x20','blue','substring','Dry\x20run:\x20yes','⚠\x20Showing\x20first\x20','\x20(use\x20--limit\x20to\x20show\x20more)','set','.\x20Expected\x20format:\x20KEY=VALUE','summary','newProjectName','all','\x20unchanged','json','changes','\x0a✔\x20Attempt\x20complete','List\x20all\x20workflow\x20projects','attempts','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','retryAttemptName','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','\x20attempt','limit','projectName','LABEL_MIN_SPACING','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','relative','get','split','Target:\x20','metadata','Error:\x20Secret\x20key\x20is\x20required','Force:\x20yes','cancelRequested','Getting\x20attempt\x20details...','getMinutes','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','resolveProjectId','📁\x20','ICON_SPACING','project','workflow:timeline','Params:\x20','workflow:push','getDate','No\x20workflows\x20found\x20in\x20project:\x20','existingProjectId','Select\x20a\x20workflow\x20to\x20run','Killing\x20attempt...','logs','Analyzing\x20project...','isDirectory','/sessions/','\x20\x20Project:\x20','Resume\x20from:\x20','Key\x20cannot\x20be\x20empty','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','rows','navigateSessionsInteractive','fill','message','Workflow:\x20','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','\x20\x20Console:\x20','includeSubtasks','slice','skipValidation','kill','length','deleted','\x20sessions\x20','From\x20task:\x20','workflow:delete','fileCount','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','Select\x20a\x20session\x20to\x20view\x20timeline:','Session\x20time:\x20','newProjectId','\x20deleted','workflow:secrets:list','window','\x20secret','getFullYear','Project\x20name\x20is\x20required','No\x20workflow\x20projects\x20found','renderTimeline','Cancelled','\x20\x20Target:\x20','yes','Setting\x20secret...','icon','end','revision:\x20','push','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','modified','\x0aUpdate\x20existing\x20project\x20\x22','floor','sourceProjectName','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','\x20of\x20','isNewProject','workflow:clone','---\x20','sys','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','MAX_POLL_ITERATIONS','💡\x20Tip:\x20Use\x20','title','Session\x20not\x20found:\x20','30ATCFXY','Status:\x20','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','localeCompare','35ngDfqT','param','includeRetried','state','delete','workflow:workflows','✔\x20Found\x20','type','canceling','select','✔\x20Secret\x20\x27','dryRun','projectId','columns','Warning:','tdx\x20wf\x20attempt\x20','Show\x20tasks\x20for\x20an\x20attempt','workflows','\x20\x20Session\x20ID:\x20','Error:\x20','requireProject','\x0aClone\x20\x22','sessions','Project\x20name:\x20','session_id','workflow:logs','No\x20workflow\x20tdx.json\x20found','workflow:pull','startTime','\x20tasks','\x20logs','clear','workflow:sessions','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','✔\x20Workflow\x20project\x20context\x20cleared.','repeat','No\x20sessions\x20found','Loading\x20sessions...','\x20task','setSecret','✔\x20Showing\x20','No\x20sessions\x20found\x20for:\x20','isTTY','Deleting\x20secret...','cyan','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','2267127kATXnc','✔\x20Clone\x20complete','workflow:download','replace','follow','Listing\x20workflow\x20sessions...','executeCloneProject','output','\x22\x20already\x20exists\x20(ID:\x20','red','white','\x1b[1A\x1b[2K','unknown','key','Task\x20name:\x20','unchanged','startedAt','\x0aPush\x20these\x20changes?','some','\x0a✔\x20Already\x20up\x20to\x20date','renderSingleTimeline','\x20\x20tdx\x20wf\x20use\x20<project>','toISOString','workflow:run','Downloading\x20project\x20','executePushProject','toLowerCase','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','verbose','attempt','fullName','sourceDir','indexOf','Pull\x20workflow\x20project\x20to\x20local\x20folder','match','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','resolveProjectDir','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Listing\x20workflow\x20projects...','log','every','Select\x20a\x20task\x20to\x20view\x20logs:','Loading\x20workflows...','\x20is\x20not\x20a\x20directory','success','Error:\x20Attempt\x20ID\x20is\x20required','session:','stringify','7053020PTTePk','logFiles','workflowName','revision','\x20\x20Location:\x20','readFile','Reason:\x20','stdout','values','✔\x20Pull\x20complete','MAX_TASKS_DISPLAY','trimEnd','now','resolveProject'];a39_0x3553=function(){return _0xf5d26d;};return a39_0x3553();}const a39_0x4f7c3b=a39_0x506a;(function(_0x3e6d06,_0x70c571){const _0x3fb2b3=a39_0x506a,_0x2e5bc1=_0x3e6d06();while(!![]){try{const _0x5011ad=parseInt(_0x3fb2b3(0x144))/0x1+-parseInt(_0x3fb2b3(0x1d7))/0x2+-parseInt(_0x3fb2b3(0x2a2))/0x3*(parseInt(_0x3fb2b3(0x1f2))/0x4)+parseInt(_0x3fb2b3(0x184))/0x5*(parseInt(_0x3fb2b3(0x26f))/0x6)+-parseInt(_0x3fb2b3(0x273))/0x7*(-parseInt(_0x3fb2b3(0x15c))/0x8)+parseInt(_0x3fb2b3(0x1b4))/0x9+parseInt(_0x3fb2b3(0x2d2))/0xa;if(_0x5011ad===_0x70c571)break;else _0x2e5bc1['push'](_0x2e5bc1['shift']());}catch(_0x142fad){_0x2e5bc1['push'](_0x2e5bc1['shift']());}}}(a39_0x3553,0xe0f64));import a39_0x4c4e0a from'chalk';import{existsSync}from'fs';import a39_0x4017db from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a39_0x5cfdb3 from'prompts';function getAttemptStatusDisplay(_0x3f889f){const _0x2bca88=a39_0x506a;if(!_0x3f889f)return{'icon':'⏳','text':''};const {done:_0x31f90a,success:_0x1b0f4b,cancelRequested:_0x14bac9}=_0x3f889f;if(!_0x31f90a)return _0x14bac9?{'icon':'🛑','text':a39_0x4c4e0a[_0x2bca88(0x19f)]('canceling')}:{'icon':'🔄','text':a39_0x4c4e0a[_0x2bca88(0x203)](_0x2bca88(0x1e1))};if(_0x1b0f4b)return{'icon':'✅','text':a39_0x4c4e0a[_0x2bca88(0x1be)](_0x2bca88(0x2ce))};return{'icon':'❌','text':a39_0x4c4e0a['red'](_0x2bca88(0x173))};}function a39_0x506a(_0x143167,_0x7e26a5){_0x143167=_0x143167-0x127;const _0x3553f8=a39_0x3553();let _0x506a8d=_0x3553f8[_0x143167];return _0x506a8d;}export class WorkflowBaseCommand extends BaseCommand{[a39_0x4f7c3b(0x12d)](_0x3e7ecf,_0x12ea54,_0x555b39=0x0){const _0x38b7d2=a39_0x4f7c3b;return _0x3e7ecf[_0x555b39]||_0x12ea54[_0x38b7d2(0x140)];}[a39_0x4f7c3b(0x287)](_0x2539cd,_0x1de565,_0x54fdcb=0x0){const _0x1d037f=a39_0x4f7c3b,_0x592c87=this[_0x1d037f(0x12d)](_0x2539cd,_0x1de565,_0x54fdcb);if(!_0x592c87)return console[_0x1d037f(0x173)](a39_0x4c4e0a[_0x1d037f(0x2ab)]('Error:'),_0x1d037f(0x254)),console['error'](a39_0x4c4e0a[_0x1d037f(0x183)](_0x1d037f(0x2a0))),null;return _0x592c87;}[a39_0x4f7c3b(0x18e)](_0x19c837,_0x2b74d4){const _0x2ecc38=a39_0x4f7c3b;if(_0x19c837[0x0]){const _0x1413c1=_0x19c837[0x0][_0x2ecc38(0x21d)]('.');if(_0x1413c1[_0x2ecc38(0x245)]===0x1)return{'projectName':_0x1413c1[0x0],'workflowName':undefined};else return _0x1413c1[_0x2ecc38(0x245)]===0x2?{'projectName':_0x1413c1[0x0],'workflowName':_0x1413c1[0x1]}:(console['error'](a39_0x4c4e0a[_0x2ecc38(0x2ab)](_0x2ecc38(0x13c)),_0x2ecc38(0x1a1)),null);}return{'projectName':_0x2b74d4['workflowProject'],'workflowName':undefined};}[a39_0x4f7c3b(0x2c6)](_0x182401,_0x3103fe,_0x2224a1=0x0){const _0x3c6439=a39_0x4f7c3b;if(_0x182401[_0x2224a1])return _0x182401[_0x2224a1];if(_0x3103fe[_0x3c6439(0x140)]){const _0x4522a5=a39_0x4017db[_0x3c6439(0x175)](process[_0x3c6439(0x1fb)](),_0x3c6439(0x284),_0x3103fe[_0x3c6439(0x140)]);if(existsSync(a39_0x4017db[_0x3c6439(0x175)](_0x4522a5,_0x3c6439(0x135))))return _0x4522a5;}return undefined;}async[a39_0x4f7c3b(0x1b6)](_0xd3c31,_0x11508b,_0x177b24){const _0x1d57ba=a39_0x4f7c3b;try{const _0x357a54=await _0xd3c31[_0x1d57ba(0x1c2)]['workflows'](_0x11508b,{'limit':0x1});if(_0x357a54[_0x1d57ba(0x245)]>0x0){const _0x27140b=_0x357a54[0x0]['id'],_0xe3111c=getWorkflowUrl(_0x177b24,_0x27140b);console[_0x1d57ba(0x173)](_0x1d57ba(0x240)+a39_0x4c4e0a[_0x1d57ba(0x29f)](_0xe3111c));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a39_0x4f7c3b(0x181)]=a39_0x4f7c3b(0x137);[a39_0x4f7c3b(0x1ce)]=a39_0x4f7c3b(0x21a);async[a39_0x4f7c3b(0x1a0)](_0x5d8588){const _0x2af100=a39_0x4f7c3b,{options:_0x5a5837,args:_0x790917,tdx:_0x432b89}=_0x5d8588,_0xc9f23b=_0x790917[0x0],_0x2b96d7=_0x5a5837[_0x2af100(0x292)];if(_0x2b96d7)return saveSessionContext({'workflow_project':undefined},_0x5a5837[_0x2af100(0x1ea)]),console[_0x2af100(0x2c9)](a39_0x4c4e0a['green'](_0x2af100(0x295))),0x0;if(!_0xc9f23b)return console['error'](a39_0x4c4e0a[_0x2af100(0x2ab)](_0x2af100(0x13c)),_0x2af100(0x254)),console[_0x2af100(0x173)](a39_0x4c4e0a[_0x2af100(0x183)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x2af100(0x173)](a39_0x4c4e0a[_0x2af100(0x183)](_0x2af100(0x1b7))),0x1;const _0x3e5c19=await withSpinner(_0x2af100(0x1b5)+_0xc9f23b+'\x27...',()=>_0x432b89[_0x2af100(0x1c2)][_0x2af100(0x226)](_0xc9f23b),{'verbose':_0x5a5837['verbose']}),{name:_0x5736a3}=_0x3e5c19[_0x2af100(0x180)];return saveSessionContext({'workflow_project':_0x5736a3},_0x5a5837[_0x2af100(0x1ea)]),console[_0x2af100(0x2c9)](a39_0x4c4e0a[_0x2af100(0x1be)](_0x2af100(0x191)+a39_0x4c4e0a['cyan'](_0x5736a3))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a39_0x4f7c3b(0x181)]=a39_0x4f7c3b(0x15a);['description']=a39_0x4f7c3b(0x211);async[a39_0x4f7c3b(0x1a0)](_0x401bd8){const _0x228530=a39_0x4f7c3b,{options:_0x3b4792,args:_0x71b2d5,tdx:_0x5f45e2}=_0x401bd8,_0x29d9c0=_0x71b2d5[0x0];_0x3b4792[_0x228530(0x2be)]&&_0x29d9c0&&console['error']('Pattern:\x20'+_0x29d9c0);const _0x3c87e5=await withSpinner(_0x228530(0x2c8),()=>_0x5f45e2['workflow'][_0x228530(0x164)](_0x29d9c0,{'limit':_0x3b4792[_0x228530(0x217)]}),{'verbose':_0x3b4792[_0x228530(0x2be)]});let _0x5f17c5=_0x3c87e5[_0x228530(0x180)];_0x5f17c5['sort']((_0xe80c17,_0x49fd3b)=>_0xe80c17[_0x228530(0x181)][_0x228530(0x272)](_0x49fd3b['name']));const _0x2601f3=_0x3b4792[_0x228530(0x217)]||0x64,_0x46cc07=_0x5f17c5[_0x228530(0x245)]>=_0x2601f3?a39_0x4c4e0a[_0x228530(0x183)](_0x228530(0x207)):'';console[_0x228530(0x173)](_0x228530(0x279)+_0x5f17c5['length']+'\x20project'+(_0x5f17c5['length']!==0x1?'s':'')+_0x46cc07);if(_0x3b4792[_0x228530(0x1a7)]===_0x228530(0x20e)||_0x3b4792[_0x228530(0x1a7)]===_0x228530(0x1ed)||_0x3b4792[_0x228530(0x1a7)]===_0x228530(0x13d))await handleSDKOutput(_0x5f17c5,_0x3b4792);else{if(_0x5f17c5['length']===0x0)_0x29d9c0?console[_0x228530(0x2c9)](_0x228530(0x1e3)+_0x29d9c0):console['log'](_0x228530(0x255));else{const _0x13c3e2=_0x5f17c5[_0x228530(0x178)](_0x59c96b=>{const _0x555ed2=_0x228530,_0x5f58d9=_0x59c96b[_0x555ed2(0x21f)]?.[_0x555ed2(0x2b4)](_0x927b4a=>_0x927b4a[_0x555ed2(0x2af)]===_0x555ed2(0x269)),_0x2cd2c8=_0x5f58d9?a39_0x4c4e0a[_0x555ed2(0x183)]('\x20(system)'):'';return _0x555ed2(0x227)+_0x59c96b[_0x555ed2(0x181)]+_0x2cd2c8;});await writeOutput(_0x13c3e2['join']('\x0a'),_0x3b4792[_0x228530(0x2a9)],_0x228530(0x16e));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a39_0x4f7c3b(0x181)]=a39_0x4f7c3b(0x278);['description']=a39_0x4f7c3b(0x193);async[a39_0x4f7c3b(0x1a0)](_0x8c7d47){const _0x316657=a39_0x4f7c3b,{options:_0xfdbeb1,args:_0x134f7c,tdx:_0x1d5e3e}=_0x8c7d47,_0x548045=this['resolveProject'](_0x134f7c,_0xfdbeb1);_0xfdbeb1[_0x316657(0x2be)]&&_0x548045&&console['error']('Project\x20filter:\x20'+_0x548045);const _0x586123=await withSpinner(_0x316657(0x158),()=>_0x1d5e3e[_0x316657(0x1c2)]['workflows'](_0x548045,{'limit':_0xfdbeb1[_0x316657(0x217)]}),{'verbose':_0xfdbeb1[_0x316657(0x2be)]});let _0x1a0d2b=_0x586123[_0x316657(0x180)];_0x1a0d2b[_0x316657(0x169)]((_0x1b6d66,_0x56ddf5)=>{const _0x5b8f5a=_0x316657,_0x10dccd=_0x1b6d66[_0x5b8f5a(0x181)]['localeCompare'](_0x56ddf5[_0x5b8f5a(0x181)]);if(_0x10dccd!==0x0)return _0x10dccd;return(_0x1b6d66[_0x5b8f5a(0x229)]?.['name']||'')[_0x5b8f5a(0x272)](_0x56ddf5['project']?.[_0x5b8f5a(0x181)]||'');});const _0x4398e3=_0xfdbeb1[_0x316657(0x217)]||0x64,_0x42c1f8=_0x1a0d2b[_0x316657(0x245)]>=_0x4398e3?a39_0x4c4e0a[_0x316657(0x183)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x316657(0x173)](_0x316657(0x279)+_0x1a0d2b[_0x316657(0x245)]+_0x316657(0x13f)+(_0x1a0d2b['length']!==0x1?'s':'')+_0x42c1f8);if(_0xfdbeb1['format']===_0x316657(0x20e)||_0xfdbeb1['format']==='jsonl'||_0xfdbeb1['format']===_0x316657(0x13d))await handleSDKOutput(_0x1a0d2b,_0xfdbeb1);else{if(_0x1a0d2b['length']===0x0)_0x548045?console['log'](_0x316657(0x22e)+_0x548045):console[_0x316657(0x2c9)](_0x316657(0x1a4));else{const _0x5ad635=_0xfdbeb1[_0x316657(0x1a2)],_0x4aea88=_0x1a0d2b[_0x316657(0x178)](_0x1fb481=>{const _0x5e4cb3=_0x316657,_0x524f74=a39_0x4c4e0a[_0x5e4cb3(0x183)]('#'+_0x1fb481['id']),_0x122851=hyperlink(_0x524f74,getWorkflowUrl(_0x5ad635,_0x1fb481['id'])),_0x1c52a4=_0x1fb481[_0x5e4cb3(0x229)]?.['name']?a39_0x4c4e0a[_0x5e4cb3(0x183)]('\x20('+_0x1fb481[_0x5e4cb3(0x229)]['name']+')'):'';return'📋\x20'+_0x122851+'\x20'+_0x1fb481[_0x5e4cb3(0x181)]+_0x1c52a4;});await writeOutput(_0x4aea88['join']('\x0a'),_0xfdbeb1[_0x316657(0x2a9)],_0x316657(0x16e));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']=a39_0x4f7c3b(0x293);[a39_0x4f7c3b(0x1ce)]=a39_0x4f7c3b(0x134);async[a39_0x4f7c3b(0x1a0)](_0x1df558){const _0x28c639=a39_0x4f7c3b,{options:_0x172d22,args:_0x33319d,tdx:_0x978729}=_0x1df558,_0x52a5e9=this['parseProjectWorkflowPattern'](_0x33319d,_0x172d22);if(!_0x52a5e9)return 0x1;const {projectName:_0x371309,workflowName:_0x3785b9}=_0x52a5e9;if(_0x172d22[_0x28c639(0x2be)]){if(_0x371309&&_0x3785b9)console[_0x28c639(0x173)](_0x28c639(0x1aa)+_0x371309+'.'+_0x3785b9);else _0x371309&&console[_0x28c639(0x173)](_0x28c639(0x139)+_0x371309);const _0x3f9b61=_0x172d22[_0x28c639(0x187)];_0x3f9b61&&console['error'](_0x28c639(0x270)+_0x3f9b61);}let _0x58432d=0x28;if(process[_0x28c639(0x127)][_0x28c639(0x29d)]&&!_0x172d22['output']&&!_0x172d22['format']){const _0x3db2d9=process[_0x28c639(0x127)][_0x28c639(0x23a)]||0x28;_0x58432d=Math['max'](0x14,Math[_0x28c639(0x262)](_0x3db2d9*0x2/0x3));}const _0x35df3=_0x172d22[_0x28c639(0x217)]||_0x58432d,_0x4413f0=await withSpinner(_0x28c639(0x2a7),()=>_0x978729['workflow'][_0x28c639(0x289)]({'projectName':_0x371309,'workflowName':_0x3785b9,'status':_0x172d22[_0x28c639(0x187)],'fromTime':_0x172d22[_0x28c639(0x1ae)],'toTime':_0x172d22['to'],'limit':_0x35df3}),{'verbose':_0x172d22['verbose']}),_0x58b1ab=_0x4413f0[_0x28c639(0x180)];_0x58b1ab[_0x28c639(0x169)]((_0x226a89,_0x31834f)=>{const _0x444e36=_0x28c639,_0x30faff=_0x226a89[_0x444e36(0x1e4)]||'',_0x276237=_0x31834f[_0x444e36(0x1e4)]||'';return _0x276237[_0x444e36(0x272)](_0x30faff);});_0x58b1ab[_0x28c639(0x245)]>=_0x35df3?console[_0x28c639(0x173)](_0x28c639(0x29b)+_0x58b1ab['length']+_0x28c639(0x247)+a39_0x4c4e0a['dim']('(use\x20--limit\x20to\x20see\x20more)')):console[_0x28c639(0x173)]('✔\x20Found\x20'+_0x58b1ab[_0x28c639(0x245)]+_0x28c639(0x150)+(_0x58b1ab[_0x28c639(0x245)]!==0x1?'s':''));if(_0x172d22['format']==='json'||_0x172d22[_0x28c639(0x1a7)]==='jsonl'||_0x172d22[_0x28c639(0x1a7)]==='table')await handleSDKOutput(_0x58b1ab,_0x172d22);else{if(!process[_0x28c639(0x127)][_0x28c639(0x29d)]||_0x172d22[_0x28c639(0x2a9)]){if(_0x58b1ab[_0x28c639(0x245)]===0x0){if(_0x371309&&_0x3785b9)console[_0x28c639(0x2c9)]('No\x20sessions\x20found\x20for:\x20'+_0x371309+'.'+_0x3785b9);else _0x371309?console[_0x28c639(0x2c9)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x371309):console[_0x28c639(0x2c9)](_0x28c639(0x297));}else{const _0x3bc6fc=_0x172d22[_0x28c639(0x1a2)],_0x245a67=this['renderSessionsTimeline'](_0x58b1ab,_0x3bc6fc);_0x172d22[_0x28c639(0x2a9)]?await writeOutput(_0x245a67,_0x172d22[_0x28c639(0x2a9)],_0x28c639(0x16e)):console[_0x28c639(0x2c9)](_0x245a67);}!_0x371309&&(console[_0x28c639(0x173)](''),console[_0x28c639(0x173)](a39_0x4c4e0a[_0x28c639(0x183)](_0x28c639(0x225))),console[_0x28c639(0x173)](a39_0x4c4e0a['dim'](_0x28c639(0x2c5))+'or'+a39_0x4c4e0a['dim']('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x58b1ab[_0x28c639(0x245)]===0x0){if(_0x371309&&_0x3785b9)console[_0x28c639(0x2c9)]('No\x20sessions\x20found\x20for:\x20'+_0x371309+'.'+_0x3785b9);else _0x371309?console['log'](_0x28c639(0x19c)+_0x371309):console['log'](_0x28c639(0x297));}else await this[_0x28c639(0x23b)](_0x58b1ab,_0x1df558,_0x371309);}}return 0x0;}[a39_0x4f7c3b(0x179)](_0x1c5546,_0x2b08d7){const _0x1f6b22=a39_0x4f7c3b,_0x13d8fc=[],_0x32ce01=new Map();let _0x324875=Infinity,_0x2ccec8=-Infinity;for(const _0x213197 of _0x1c5546){if(_0x213197[_0x1f6b22(0x13b)]?.[_0x1f6b22(0x1cc)]){const _0xf7d5c0=new Date(_0x213197[_0x1f6b22(0x13b)][_0x1f6b22(0x1cc)])[_0x1f6b22(0x130)](),_0x3e7743=_0x213197['lastAttempt']['finishedAt']?new Date(_0x213197[_0x1f6b22(0x13b)][_0x1f6b22(0x1dc)])[_0x1f6b22(0x130)]():Date[_0x1f6b22(0x12c)](),_0x19d689=_0x213197[_0x1f6b22(0x229)]?.[_0x1f6b22(0x181)]||'(unknown)';!_0x32ce01[_0x1f6b22(0x190)](_0x19d689)&&_0x32ce01['set'](_0x19d689,[]),_0x32ce01[_0x1f6b22(0x21c)](_0x19d689)[_0x1f6b22(0x25e)]({'session':_0x213197,'startTime':_0xf7d5c0,'endTime':_0x3e7743,'duration':_0x3e7743-_0xf7d5c0}),_0x324875=Math[_0x1f6b22(0x16f)](_0x324875,_0xf7d5c0),_0x2ccec8=Math[_0x1f6b22(0x1d4)](_0x2ccec8,_0x3e7743);}}if(_0x32ce01[_0x1f6b22(0x198)]===0x0)return _0x1f6b22(0x12f);const _0x359ef0=process['stdout'][_0x1f6b22(0x280)]||0x78,_0x28f372=0x1e,_0x33a6f5=0x32,_0x47aea9=0x4,_0x5216a2=Math[_0x1f6b22(0x16f)](_0x33a6f5,Math[_0x1f6b22(0x1d4)](_0x28f372,Math[_0x1f6b22(0x262)](_0x359ef0*0.3))),_0x5af69d=_0x359ef0-_0x5216a2-TIMELINE_CONFIG['GUTTER']-0x3-_0x47aea9,_0x3d0c3d=_0x2ccec8-_0x324875,_0x57811b=_0x3d0c3d/_0x5216a2,_0x54af23=renderTimeAxis({'startTime':_0x324875,'endTime':_0x2ccec8,'durationMs':_0x3d0c3d,'msPerChar':_0x57811b},_0x5216a2),_0x52159e=[];for(const _0x558070 of _0x32ce01[_0x1f6b22(0x128)]()){_0x52159e[_0x1f6b22(0x25e)](..._0x558070);}_0x52159e['sort']((_0x324f24,_0x2ade24)=>_0x2ade24[_0x1f6b22(0x28f)]-_0x324f24[_0x1f6b22(0x28f)]);const _0x53c4c7=new Date(_0x324875),_0x3007f0=formatDate(_0x53c4c7),_0x4724df=_0x47aea9+TIMELINE_CONFIG[_0x1f6b22(0x188)]+TIMELINE_CONFIG[_0x1f6b22(0x228)]+_0x5af69d,_0x1f4b2a='\x20'['repeat'](_0x4724df-_0x3007f0[_0x1f6b22(0x245)]),_0x3acf33=_0x1f4b2a+a39_0x4c4e0a[_0x1f6b22(0x183)](_0x3007f0)+'\x20'+_0x54af23;_0x13d8fc[_0x1f6b22(0x25e)](_0x3acf33);const _0x571d03=0x16;let _0x5b1f31=0x0;for(const _0x312c59 of _0x52159e){const _0x241417=_0x312c59[_0x1f6b22(0x1ea)][_0x1f6b22(0x229)]?.[_0x1f6b22(0x181)]||'?',_0x1cb624=Math[_0x1f6b22(0x16f)](stringWidth(_0x241417),_0x571d03);_0x5b1f31=Math[_0x1f6b22(0x1d4)](_0x5b1f31,_0x1cb624);}for(const _0x58aeae of _0x52159e){const {session:_0x1fb062,startTime:_0x5159b0,endTime:_0x5acb3c,duration:_0x5e4262}=_0x58aeae,_0x346030=_0x1fb062['project']?.['id'],_0x2bb1c7=_0x1fb062['id'],_0x2e01d8=_0x1fb062[_0x1f6b22(0x229)]?.['name']||'?',_0x2ee35b=_0x1fb062[_0x1f6b22(0x1c2)]?.[_0x1f6b22(0x181)]||'?';let _0x3f3598,_0x449674;if(_0x1fb062[_0x1f6b22(0x13b)]){const _0x173079=_0x1fb062[_0x1f6b22(0x13b)];!_0x173079[_0x1f6b22(0x143)]?(_0x3f3598=_0x173079['cancelRequested']?'🛑':'🔄',_0x449674=_0x173079[_0x1f6b22(0x222)]?a39_0x4c4e0a[_0x1f6b22(0x19f)]:a39_0x4c4e0a[_0x1f6b22(0x203)]):(_0x3f3598=_0x173079[_0x1f6b22(0x2ce)]?'✅':'❌',_0x449674=_0x173079[_0x1f6b22(0x2ce)]?a39_0x4c4e0a[_0x1f6b22(0x1be)]:a39_0x4c4e0a[_0x1f6b22(0x2ab)]);}else _0x3f3598='⏳',_0x449674=a39_0x4c4e0a[_0x1f6b22(0x183)];const _0x3ef6de='#'+_0x2bb1c7,_0x2d5c12=_0x346030?hyperlink(_0x3ef6de,getWorkflowSessionUrl(_0x2b08d7,_0x346030,_0x2bb1c7)):_0x3ef6de;let _0xf5538a=_0x2e01d8;stringWidth(_0x2e01d8)>_0x571d03&&(_0xf5538a=_0x2e01d8[_0x1f6b22(0x242)](0x0,_0x571d03-0x1)+'…');const _0x42818f=a39_0x4c4e0a[_0x1f6b22(0x183)](_0xf5538a),_0x3b06fc=stringWidth(_0xf5538a),_0x3fc5f8='\x20'['repeat'](_0x5b1f31-stringWidth(_0xf5538a)+0x2),_0x232f06='('+formatElapsed(_0x5e4262)+')',_0x9fbbf4=stringWidth(_0x232f06),_0x11680e=stringWidth(_0x3ef6de),_0x151d86=_0x11680e+0x1+_0x3b06fc+_0x3fc5f8[_0x1f6b22(0x245)],_0x3d714c=_0x5af69d-_0x151d86-_0x9fbbf4-0x1-0x8;let _0x21d1ea=_0x2ee35b;stringWidth(_0x21d1ea)>_0x3d714c&&(_0x21d1ea=_0x21d1ea[_0x1f6b22(0x242)](0x0,_0x3d714c-0x1)+'…');const _0x51b689=_0x2d5c12+'\x20'+_0x42818f+_0x3fc5f8+_0x21d1ea,_0x536975=stringWidth(_0x51b689),_0x11d8e2=_0x5af69d-_0x536975-_0x9fbbf4,_0x10cdb5=_0x51b689+'\x20'[_0x1f6b22(0x296)](Math['max'](0x1,_0x11d8e2))+a39_0x4c4e0a[_0x1f6b22(0x183)](_0x232f06),_0x12fac8=Math[_0x1f6b22(0x262)]((_0x5159b0-_0x324875)/_0x57811b),_0x48236f=Math[_0x1f6b22(0x262)]((_0x5acb3c-_0x324875)/_0x57811b),_0x122c59=Math[_0x1f6b22(0x1d4)](_0x12fac8+0x1,_0x48236f),_0x2206a8=new Array(_0x5216a2)[_0x1f6b22(0x23c)]('\x20');for(let _0x442823=_0x12fac8;_0x442823<Math['min'](_0x122c59,_0x5216a2);_0x442823++){_0x2206a8[_0x442823]='─';}const _0x12fc34=_0x2206a8[_0x1f6b22(0x178)](_0x8fb92a=>_0x8fb92a==='\x20'?'\x20':_0x449674(_0x8fb92a))['join']('');_0x13d8fc[_0x1f6b22(0x25e)](_0x3f3598+'\x20'+_0x10cdb5+'│'+_0x12fc34+'│');}return _0x13d8fc[_0x1f6b22(0x175)]('\x0a');}async[a39_0x4f7c3b(0x23b)](_0x15b0b1,_0x4c6f5f,_0x4a950d){const _0x476200=a39_0x4f7c3b,{options:_0x13d4b8,tdx:_0x5839cc}=_0x4c6f5f,_0x33a459=_0x13d4b8['site'],{timelineRows:_0x52c082,timeAxisHeader:_0x22afbf}=this[_0x476200(0x1eb)](_0x15b0b1,_0x33a459),_0x2052bd=_0x52c082[_0x476200(0x15b)](_0x2680b8=>_0x2680b8['attemptId']);if(_0x2052bd[_0x476200(0x245)]===0x0){const _0x44e27e=this['renderSessionsTimeline'](_0x15b0b1,_0x33a459);console[_0x476200(0x2c9)](_0x44e27e);!_0x4a950d&&(console[_0x476200(0x173)](''),console[_0x476200(0x173)](a39_0x4c4e0a[_0x476200(0x183)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console['error'](a39_0x4c4e0a[_0x476200(0x183)](_0x476200(0x2c5))+'or'+a39_0x4c4e0a[_0x476200(0x183)](_0x476200(0x2b7))));return;}_0x22afbf&&console[_0x476200(0x2c9)](_0x22afbf);const _0x22a2df=_0x52c082[_0x476200(0x15b)](_0x24763f=>_0x24763f[_0x476200(0x147)])[_0x476200(0x178)](_0x186099=>({'title':_0x186099[_0x476200(0x1d0)],'value':_0x186099[_0x476200(0x147)]})),_0x7599f9=process[_0x476200(0x127)][_0x476200(0x23a)]||0x3c,_0x3742a3=Math['max'](0x28,Math['floor'](_0x7599f9*0x2/0x3)),_0x48e316=await a39_0x5cfdb3({'type':_0x476200(0x1b0),'name':'attemptId','message':_0x476200(0x23f),'choices':_0x22a2df,'initial':-0x1,'limit':_0x3742a3,'clearFirst':!![],'fallback':{'title':_0x476200(0x1bd),'value':null},'suggest':(_0x3107f3,_0x201fde)=>{const _0xb07bea=_0x476200;if(!_0x3107f3)return Promise[_0xb07bea(0x166)](_0x201fde);const _0x217db8=_0x201fde['filter'](_0x5682a3=>{const _0x4c62d6=_0xb07bea,_0x163df6=_0x5682a3;return _0x163df6[_0x4c62d6(0x26d)]['toLowerCase']()['includes'](_0x3107f3[_0x4c62d6(0x2bc)]());});return Promise[_0xb07bea(0x166)](_0x217db8);}}),_0x210ef8=()=>{const _0x11bf6a=_0x476200;process[_0x11bf6a(0x127)][_0x11bf6a(0x159)](_0x11bf6a(0x2ad)),process[_0x11bf6a(0x127)][_0x11bf6a(0x159)](_0x11bf6a(0x2ad)),process[_0x11bf6a(0x127)]['write'](_0x11bf6a(0x2ad));},_0x1d4659=_0x48e316&&_0x48e316[_0x476200(0x147)]&&_0x48e316[_0x476200(0x147)]!==null&&_0x48e316[_0x476200(0x147)]['trim']()!=='';if(!_0x1d4659){_0x210ef8(),console[_0x476200(0x2c9)](a39_0x4c4e0a[_0x476200(0x183)](_0x476200(0x257)));return;}_0x210ef8();const _0x37f7ce=_0x15b0b1[_0x476200(0x161)](_0x585451=>_0x585451[_0x476200(0x13b)]?.['id']===_0x48e316[_0x476200(0x147)]);if(_0x37f7ce){const _0x5065c0=_0x37f7ce[_0x476200(0x229)]?.['name']||'?',_0xd0e529=_0x37f7ce[_0x476200(0x1c2)]?.[_0x476200(0x181)]||'?';console['log']('Project:\x20'+a39_0x4c4e0a['dim'](_0x5065c0)+_0x476200(0x1b9)+a39_0x4c4e0a[_0x476200(0x183)](_0xd0e529));}const _0x2df43d=new WorkflowTimelineCommand();await _0x2df43d[_0x476200(0x1a0)]({'args':[],'options':{..._0x13d4b8,'attemptId':_0x48e316['attemptId']},'tdx':_0x5839cc});}[a39_0x4f7c3b(0x1eb)](_0x5c0b39,_0x3c2696){const _0x511aa9=a39_0x4f7c3b,_0x28a46a=new Map();for(const _0x3737b8 of _0x5c0b39){_0x3737b8['id']&&_0x3737b8['lastAttempt']?.['id']&&_0x28a46a[_0x511aa9(0x208)](_0x3737b8['id'],_0x3737b8[_0x511aa9(0x13b)]['id']);}const _0x230cae=[];let _0x3d707f='';const _0x360364=this[_0x511aa9(0x179)](_0x5c0b39,_0x3c2696),_0x42f322=_0x360364['split']('\x0a');for(const _0x4fff3b of _0x42f322){if(_0x4fff3b[_0x511aa9(0x167)](_0x511aa9(0x19a))||_0x4fff3b[_0x511aa9(0x2c4)](/^\s+\d{4}-\d{2}-\d{2}/))_0x3d707f=_0x4fff3b;else{if(_0x4fff3b[_0x511aa9(0x2c4)](/^[✅❌🔄🛑⏳]/)){const _0x4d1f12=_0x4fff3b[_0x511aa9(0x2c4)](/#(\d+)/),_0x3a486d=_0x4d1f12?_0x4d1f12[0x1]:null,_0x3d74ce=_0x3a486d?_0x28a46a['get'](_0x3a486d)||null:null,_0x38e098=_0x5c0b39[_0x511aa9(0x161)](_0x11ef45=>_0x11ef45['id']===_0x3a486d),_0x4d79a8=_0x38e098?.[_0x511aa9(0x229)]?.[_0x511aa9(0x181)]||'';_0x230cae[_0x511aa9(0x25e)]({'displayLine':_0x4fff3b,'attemptId':_0x3d74ce,'projectName':_0x4d79a8});}}}return{'timelineRows':_0x230cae,'timeAxisHeader':_0x3d707f};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a39_0x4f7c3b(0x181)]='workflow:attempts';[a39_0x4f7c3b(0x1ce)]=a39_0x4f7c3b(0x1e0);async[a39_0x4f7c3b(0x1a0)](_0x3425ee){const _0xdb5ee0=a39_0x4f7c3b,{options:_0x335c05,args:_0x3b6bc7,tdx:_0x2d7daf}=_0x3425ee,_0x1948ee=this[_0xdb5ee0(0x18e)](_0x3b6bc7,_0x335c05);if(!_0x1948ee)return 0x1;const {projectName:_0x4c904a,workflowName:_0x4f9e31}=_0x1948ee,_0x6b60f1=_0x335c05[_0xdb5ee0(0x275)];if(_0x335c05[_0xdb5ee0(0x2be)]){if(_0x4c904a&&_0x4f9e31)console[_0xdb5ee0(0x173)](_0xdb5ee0(0x1aa)+_0x4c904a+'.'+_0x4f9e31);else _0x4c904a&&console['error'](_0xdb5ee0(0x139)+_0x4c904a);_0x6b60f1&&console[_0xdb5ee0(0x173)](_0xdb5ee0(0x15d));}const _0x8265cd=await withSpinner(_0xdb5ee0(0x1c1),()=>_0x2d7daf[_0xdb5ee0(0x1c2)][_0xdb5ee0(0x212)]({'projectName':_0x4c904a,'workflowName':_0x4f9e31,'includeRetried':_0x6b60f1,'limit':_0x335c05[_0xdb5ee0(0x217)]}),{'verbose':_0x335c05[_0xdb5ee0(0x2be)]}),_0x48222e=_0x8265cd[_0xdb5ee0(0x180)],_0x5cbc73=_0x335c05[_0xdb5ee0(0x217)]||0x64,_0x260cff=_0x48222e['length']>=_0x5cbc73?a39_0x4c4e0a[_0xdb5ee0(0x183)](_0xdb5ee0(0x207)):'';console[_0xdb5ee0(0x173)]('✔\x20Found\x20'+_0x48222e[_0xdb5ee0(0x245)]+_0xdb5ee0(0x216)+(_0x48222e[_0xdb5ee0(0x245)]!==0x1?'s':'')+_0x260cff);if(_0x335c05[_0xdb5ee0(0x1a7)]===_0xdb5ee0(0x20e)||_0x335c05['format']==='jsonl'||_0x335c05['format']==='table')await handleSDKOutput(_0x48222e,_0x335c05);else{if(_0x48222e[_0xdb5ee0(0x245)]===0x0){if(_0x4c904a&&_0x4f9e31)console['log'](_0xdb5ee0(0x1ab)+_0x4c904a+'.'+_0x4f9e31);else _0x4c904a?console['log']('No\x20attempts\x20found\x20in\x20project:\x20'+_0x4c904a):console[_0xdb5ee0(0x2c9)](_0xdb5ee0(0x17b));}else{const _0x5cf97b=_0x335c05[_0xdb5ee0(0x1a2)],_0x55f0ed=_0x48222e[_0xdb5ee0(0x178)](_0x1469be=>{const _0x5b5b34=_0xdb5ee0,_0x363492=a39_0x4c4e0a[_0x5b5b34(0x183)]('#'+_0x1469be['id']),_0x281812=_0x1469be[_0x5b5b34(0x229)]?.['id'],_0x21b103=_0x1469be[_0x5b5b34(0x28b)]||_0x1469be[_0x5b5b34(0x168)],_0x6b8843=_0x281812&&_0x21b103?hyperlink(_0x363492,getWorkflowAttemptUrl(_0x5cf97b,_0x281812,_0x21b103,_0x1469be['id'])):_0x363492,{icon:_0xaa649d,text:_0x279efc}=getAttemptStatusDisplay(_0x1469be),_0xeb447c=(_0x1469be[_0x5b5b34(0x229)]?.[_0x5b5b34(0x181)]||'?')+'.'+(_0x1469be['workflow']?.['name']||'?'),_0x3af94f=_0x1469be['sessionTime']?a39_0x4c4e0a['dim'](_0x1469be[_0x5b5b34(0x1e4)]):'';return(_0x6b8843+'\x20'+_0xaa649d+(_0x279efc?'\x20'+_0x279efc:'')+'\x20'+_0xeb447c+'\x20'+_0x3af94f)[_0x5b5b34(0x12b)]();});await writeOutput(_0x55f0ed[_0xdb5ee0(0x175)]('\x0a'),_0x335c05[_0xdb5ee0(0x2a9)],_0xdb5ee0(0x16e));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a39_0x4f7c3b(0x1ac);[a39_0x4f7c3b(0x1ce)]=a39_0x4f7c3b(0x1d6);async[a39_0x4f7c3b(0x1a0)](_0x564789){const _0x2fb602=a39_0x4f7c3b,{options:_0x35abf5,args:_0x41dd96,tdx:_0x3053f5}=_0x564789,_0x5729dd=_0x41dd96[0x0];if(!_0x5729dd)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x35abf5[_0x2fb602(0x2be)]&&console[_0x2fb602(0x173)](_0x2fb602(0x18a)+_0x5729dd);const _0x3249c9=await withSpinner(_0x2fb602(0x223),()=>_0x3053f5[_0x2fb602(0x1c2)][_0x2fb602(0x2bf)](_0x5729dd),{'verbose':_0x35abf5[_0x2fb602(0x2be)]}),_0x8be440=_0x3249c9[_0x2fb602(0x180)];let _0x5f4656;!_0x8be440[_0x2fb602(0x143)]?_0x5f4656=_0x8be440[_0x2fb602(0x222)]?_0x2fb602(0x27b):_0x2fb602(0x1e1):_0x5f4656=_0x8be440[_0x2fb602(0x2ce)]?_0x2fb602(0x2ce):'error';let _0x11f018;if(_0x8be440[_0x2fb602(0x1cc)]&&_0x8be440[_0x2fb602(0x1dc)]){const _0x6cadbc=new Date(_0x8be440['createdAt'])[_0x2fb602(0x130)](),_0xb198fa=new Date(_0x8be440[_0x2fb602(0x1dc)])[_0x2fb602(0x130)]();_0x11f018=Math[_0x2fb602(0x1de)]((_0xb198fa-_0x6cadbc)/0x3e8);}const _0x3cdcca={'attempt_id':_0x8be440['id'],'status':_0x5f4656,..._0x8be440[_0x2fb602(0x1c9)]!==undefined&&{'index':_0x8be440[_0x2fb602(0x1c9)]},..._0x8be440['project']&&{'project':_0x8be440[_0x2fb602(0x229)][_0x2fb602(0x181)]},..._0x8be440[_0x2fb602(0x1c2)]&&{'workflow':_0x8be440['workflow'][_0x2fb602(0x181)]},..._0x8be440[_0x2fb602(0x168)]&&{'session_id':_0x8be440[_0x2fb602(0x168)]},..._0x8be440['sessionTime']&&{'session_time':_0x8be440[_0x2fb602(0x1e4)]},..._0x8be440['retryAttemptName']&&{'retry_attempt':_0x8be440[_0x2fb602(0x214)]},..._0x11f018!==undefined&&{'duration_sec':_0x11f018},..._0x8be440[_0x2fb602(0x1cc)]&&{'created_at':_0x8be440[_0x2fb602(0x1cc)]},..._0x8be440[_0x2fb602(0x1dc)]&&{'finished_at':_0x8be440['finishedAt']},...Object['keys'](_0x8be440[_0x2fb602(0x1db)])[_0x2fb602(0x245)]>0x0&&{'params':_0x8be440[_0x2fb602(0x1db)]}};return await handleSingleObjectOutput(_0x3cdcca,_0x35abf5),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']='workflow:tasks';[a39_0x4f7c3b(0x1ce)]=a39_0x4f7c3b(0x283);async[a39_0x4f7c3b(0x1a0)](_0x39a9ee){const _0x21e60d=a39_0x4f7c3b,{options:_0x4bf9b9,args:_0x548543,tdx:_0x5cbb46}=_0x39a9ee,_0x526c22=_0x548543[0x0];if(!_0x526c22)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x3d91f9=_0x4bf9b9[_0x21e60d(0x241)];_0x4bf9b9['verbose']&&(console[_0x21e60d(0x173)]('Attempt\x20ID:\x20'+_0x526c22),_0x3d91f9&&console[_0x21e60d(0x173)](_0x21e60d(0x172)));const _0xe7e008=await withSpinner(_0x21e60d(0x1b1),()=>_0x5cbb46['workflow']['tasks'](_0x526c22,_0x3d91f9||![]),{'verbose':_0x4bf9b9['verbose']}),_0x454007=_0xe7e008[_0x21e60d(0x180)];return console[_0x21e60d(0x173)](_0x21e60d(0x279)+_0x454007[_0x21e60d(0x245)]+_0x21e60d(0x299)+(_0x454007[_0x21e60d(0x245)]!==0x1?'s':'')),await handleSDKOutput(_0x454007,_0x4bf9b9),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a39_0x4f7c3b(0x181)]=a39_0x4f7c3b(0x28c);[a39_0x4f7c3b(0x1ce)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a39_0x4f7c3b(0x1a0)](_0x4ac330){const _0x239f65=a39_0x4f7c3b,{options:_0x1c7d40,args:_0x5a8331,tdx:_0x4f4508}=_0x4ac330,_0x4fc41f=_0x5a8331[0x0];let _0x264b0f=_0x5a8331[0x1];if(!_0x4fc41f)return console[_0x239f65(0x173)](_0x239f65(0x2cf)),0x1;_0x1c7d40[_0x239f65(0x2be)]&&(console['error'](_0x239f65(0x18a)+_0x4fc41f),_0x264b0f&&console['error'](_0x239f65(0x2b0)+_0x264b0f));const _0x439a04=await withSpinner('Fetching\x20log\x20files...',()=>_0x4f4508[_0x239f65(0x1c2)][_0x239f65(0x2d3)](_0x4fc41f,_0x264b0f),{'verbose':_0x1c7d40['verbose']}),_0x3b9110=_0x439a04[_0x239f65(0x180)];if(_0x3b9110['length']===0x0)return console[_0x239f65(0x173)](_0x239f65(0x155)),0x0;if(!_0x264b0f&&(_0x1c7d40['json']||_0x1c7d40['format']))return await handleSDKOutput(_0x3b9110,_0x1c7d40),0x0;if(!_0x264b0f){const _0x1f2ed3=_0x3b9110[_0x239f65(0x178)](_0x452245=>({'title':_0x452245['taskName']+'\x20('+formatBytes(_0x452245['fileSize'])+')','value':_0x452245[_0x239f65(0x1f0)]})),_0x37ce11=await a39_0x5cfdb3({'type':_0x239f65(0x27c),'name':_0x239f65(0x151),'message':_0x239f65(0x2cb),'choices':_0x1f2ed3});if(!_0x37ce11[_0x239f65(0x151)])return console[_0x239f65(0x173)](_0x239f65(0x257)),0x0;_0x264b0f=_0x37ce11[_0x239f65(0x151)];}const _0x5b93ab=await withSpinner(_0x239f65(0x1c7),()=>_0x4f4508['workflow'][_0x239f65(0x232)](_0x4fc41f,_0x264b0f),{'verbose':_0x1c7d40[_0x239f65(0x2be)]}),_0x3647b2=_0x5b93ab[_0x239f65(0x180)];return _0x3647b2?console['log'](_0x3647b2):console[_0x239f65(0x173)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a39_0x4f7c3b(0x181)]=a39_0x4f7c3b(0x176);[a39_0x4f7c3b(0x1ce)]='Kill\x20a\x20running\x20attempt';async[a39_0x4f7c3b(0x1a0)](_0x562c34){const _0x33781f=a39_0x4f7c3b,{options:_0xf68ff2,args:_0x46d47f,tdx:_0x280cdc}=_0x562c34,_0x3567e0=_0x46d47f[0x0];if(!_0x3567e0)return console[_0x33781f(0x173)](_0x33781f(0x2cf)),0x1;const _0x24fb4=_0xf68ff2[_0x33781f(0x1f3)];_0xf68ff2[_0x33781f(0x2be)]&&(console[_0x33781f(0x173)](_0x33781f(0x18a)+_0x3567e0),_0x24fb4&&console[_0x33781f(0x173)](_0x33781f(0x2d8)+_0x24fb4));if(!_0xf68ff2[_0x33781f(0x259)]){const _0x254a0f=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x3567e0+'?');if(!_0x254a0f)return console['error'](_0x33781f(0x257)),0x0;}const _0x2a65a9=await withSpinner(_0x33781f(0x231),()=>_0x280cdc[_0x33781f(0x1c2)][_0x33781f(0x244)](_0x3567e0,_0x24fb4),{'verbose':_0xf68ff2['verbose']}),_0x4d32ad=_0x2a65a9['data'];return console[_0x33781f(0x173)]('✔\x20'+_0x4d32ad),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a39_0x4f7c3b(0x181)]='workflow:retry';['description']='Retry\x20a\x20session\x20or\x20attempt';async[a39_0x4f7c3b(0x1a0)](_0x28c1be){const _0x267da5=a39_0x4f7c3b,{options:_0xcd11af,args:_0x166538,tdx:_0x24bca4}=_0x28c1be,_0x5df312=_0x166538[0x0];if(!_0x5df312)return console[_0x267da5(0x173)](_0x267da5(0x2a1)),console['error'](_0x267da5(0x1fa)),0x1;let _0x5df0e1=![],_0x12b3b2=_0x5df312;if(_0x5df312[_0x267da5(0x167)](_0x267da5(0x2d0)))_0x5df0e1=!![],_0x12b3b2=_0x5df312[_0x267da5(0x204)](0x8);else{if(_0x5df312['startsWith'](_0x267da5(0x148)))_0x5df0e1=![],_0x12b3b2=_0x5df312[_0x267da5(0x204)](0x8);else return console[_0x267da5(0x173)](_0x267da5(0x17c)),console[_0x267da5(0x173)](_0x267da5(0x1fa)),0x1;}const _0x34eab9=_0xcd11af[_0x267da5(0x14d)],_0x1a1049=_0xcd11af[_0x267da5(0x131)],_0x16d117=_0xcd11af[_0x267da5(0x1db)],_0x412b48=_0xcd11af[_0x267da5(0x195)];_0xcd11af['verbose']&&(console[_0x267da5(0x173)](_0x267da5(0x21e)+(_0x5df0e1?_0x267da5(0x1ea):'attempt')+'\x20'+_0x12b3b2),_0x34eab9&&console[_0x267da5(0x173)](_0x267da5(0x248)+_0x34eab9),_0x1a1049&&console[_0x267da5(0x173)](_0x267da5(0x237)+_0x1a1049),_0x16d117&&console['error'](_0x267da5(0x22b)+_0x16d117),_0x412b48&&console['error'](_0x267da5(0x221)));let _0x2113eb;if(_0x16d117)try{if(_0x16d117[_0x267da5(0x167)]('@')){const _0x4a4818=await import('fs/promises'),_0x27a50b=_0x16d117[_0x267da5(0x204)](0x1),_0x11d2d7=await _0x4a4818[_0x267da5(0x2d7)](_0x27a50b,_0x267da5(0x177));_0x2113eb=JSON[_0x267da5(0x1f7)](_0x11d2d7);}else _0x2113eb=JSON[_0x267da5(0x1f7)](_0x16d117);}catch{return console['error'](_0x267da5(0x200)),0x1;}if(!_0xcd11af[_0x267da5(0x259)]){const _0x1bf6ac=await confirmKey(_0x267da5(0x1e9)+(_0x5df0e1?'session':_0x267da5(0x2bf))+'\x20'+_0x12b3b2+'?');if(!_0x1bf6ac)return console[_0x267da5(0x173)](_0x267da5(0x257)),0x0;}let _0x13559d;_0x5df0e1?_0x13559d=await withSpinner('Retrying\x20session...',()=>_0x24bca4['workflow']['retrySession'](_0x12b3b2,{'fromTask':_0x34eab9,'retryParams':_0x2113eb}),{'verbose':_0xcd11af[_0x267da5(0x2be)]}):_0x13559d=await withSpinner(_0x267da5(0x170),()=>_0x24bca4[_0x267da5(0x1c2)][_0x267da5(0x133)](_0x12b3b2,{'resumeFrom':_0x1a1049,'retryParams':_0x2113eb,'force':_0x412b48}),{'verbose':_0xcd11af[_0x267da5(0x2be)]});const _0x6709c0=_0x13559d[_0x267da5(0x180)];return console[_0x267da5(0x173)](_0x267da5(0x1e7)),console[_0x267da5(0x173)](_0x267da5(0x1ba)+_0x6709c0[_0x267da5(0x147)]),console[_0x267da5(0x173)](_0x267da5(0x285)+_0x6709c0[_0x267da5(0x168)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a39_0x4f7c3b(0x181)]=a39_0x4f7c3b(0x2b9);[a39_0x4f7c3b(0x1ce)]=a39_0x4f7c3b(0x1e8);async[a39_0x4f7c3b(0x1a0)](_0x483c84){const _0x2de97c=a39_0x4f7c3b,{options:_0x7d14e9,args:_0x1c7168,tdx:_0xee1f27}=_0x483c84;let _0x43abd2=_0x1c7168[0x0];if(!_0x43abd2){const _0x5e7ed4=this[_0x2de97c(0x12d)]([],_0x7d14e9),_0x3cb205=await withSpinner(_0x2de97c(0x2cc),()=>_0xee1f27[_0x2de97c(0x1c2)][_0x2de97c(0x284)](_0x5e7ed4,{'limit':_0x7d14e9[_0x2de97c(0x217)]}),{'verbose':_0x7d14e9[_0x2de97c(0x2be)]}),_0x54e70a=_0x3cb205['data'];if(_0x54e70a[_0x2de97c(0x245)]===0x0)return console[_0x2de97c(0x173)](_0x2de97c(0x1a4)),!_0x5e7ed4&&console[_0x2de97c(0x173)](a39_0x4c4e0a[_0x2de97c(0x183)](_0x2de97c(0x2a0))),0x1;const _0x1d1e66=_0x54e70a[_0x2de97c(0x178)](_0x4629ce=>({'title':_0x4629ce[_0x2de97c(0x229)]?.[_0x2de97c(0x181)]+'.'+_0x4629ce[_0x2de97c(0x181)],'value':_0x4629ce[_0x2de97c(0x229)]?.[_0x2de97c(0x181)]+'.'+_0x4629ce[_0x2de97c(0x181)],'description':_0x4629ce[_0x2de97c(0x2d5)]?_0x2de97c(0x25d)+_0x4629ce[_0x2de97c(0x2d5)]:undefined})),_0x2cb07e=await a39_0x5cfdb3({'type':_0x2de97c(0x27c),'name':_0x2de97c(0x1c2),'message':_0x2de97c(0x230),'choices':_0x1d1e66});if(!_0x2cb07e[_0x2de97c(0x1c2)])return 0x1;_0x43abd2=_0x2cb07e[_0x2de97c(0x1c2)];}if(!_0x43abd2[_0x2de97c(0x1dd)]('.')){const _0x158582=this['resolveProject']([],_0x7d14e9);if(_0x158582)_0x43abd2=_0x158582+'.'+_0x43abd2;else return console[_0x2de97c(0x173)](a39_0x4c4e0a['red'](_0x2de97c(0x13c)),_0x2de97c(0x171)),console[_0x2de97c(0x173)](a39_0x4c4e0a['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x21dae5=_0x7d14e9[_0x2de97c(0x274)],_0x1f4603=_0x7d14e9['sessionTime'],_0x20f23e={};if(_0x21dae5&&Array[_0x2de97c(0x192)](_0x21dae5))for(const _0xf8fd18 of _0x21dae5){const _0x5d44ee=_0xf8fd18[_0x2de97c(0x2c2)]('=');if(_0x5d44ee===-0x1)return console[_0x2de97c(0x173)](_0x2de97c(0x146)+_0xf8fd18),console[_0x2de97c(0x173)](_0x2de97c(0x1f9)),0x1;const _0x5f1675=_0xf8fd18[_0x2de97c(0x204)](0x0,_0x5d44ee),_0x1626d1=_0xf8fd18[_0x2de97c(0x204)](_0x5d44ee+0x1);try{_0x20f23e[_0x5f1675]=JSON['parse'](_0x1626d1);}catch{_0x20f23e[_0x5f1675]=_0x1626d1;}}_0x7d14e9['verbose']&&(console[_0x2de97c(0x173)](_0x2de97c(0x23e)+_0x43abd2),Object[_0x2de97c(0x189)](_0x20f23e)[_0x2de97c(0x245)]>0x0&&console[_0x2de97c(0x173)]('Parameters:\x20'+JSON[_0x2de97c(0x2d1)](_0x20f23e)),_0x1f4603&&console[_0x2de97c(0x173)](_0x2de97c(0x24d)+_0x1f4603));const _0x1c206a=await withSpinner(_0x2de97c(0x160),()=>_0xee1f27[_0x2de97c(0x1c2)][_0x2de97c(0x1ca)](_0x43abd2,_0x20f23e,{'sessionTime':_0x1f4603}),{'verbose':_0x7d14e9[_0x2de97c(0x2be)]}),_0xdb2f83=_0x1c206a[_0x2de97c(0x180)];console[_0x2de97c(0x173)](_0x2de97c(0x136)),console[_0x2de97c(0x173)]('\x20\x20Attempt\x20ID:\x20'+_0xdb2f83['id']),console['error'](_0x2de97c(0x285)+_0xdb2f83[_0x2de97c(0x168)]),console['error'](_0x2de97c(0x236)+_0xdb2f83[_0x2de97c(0x229)]?.[_0x2de97c(0x181)]),console['error'](_0x2de97c(0x16d)+_0xdb2f83[_0x2de97c(0x1c2)]?.[_0x2de97c(0x181)]);if(_0xdb2f83['project']?.['id']&&_0xdb2f83[_0x2de97c(0x168)]&&_0xdb2f83['id']){const _0x5e000a=_0x7d14e9[_0x2de97c(0x1a2)],_0x41579b=getConsoleUrl(_0x5e000a,_0x2de97c(0x1c6)+_0xdb2f83[_0x2de97c(0x229)]['id']+_0x2de97c(0x235)+_0xdb2f83[_0x2de97c(0x168)]+_0x2de97c(0x1e6)+_0xdb2f83['id']);console[_0x2de97c(0x173)]('\x20\x20Console:\x20'+a39_0x4c4e0a['cyan'](_0x41579b));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a39_0x4f7c3b(0x181)]=a39_0x4f7c3b(0x2a4);[a39_0x4f7c3b(0x1ce)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async['execute'](_0x1f6f80){const _0x100259=a39_0x4f7c3b,{options:_0x10c7ba,args:_0x356470,tdx:_0x3502a3}=_0x1f6f80,_0x359ff4=_0x356470[0x0],_0x44bfc4=_0x356470[0x1]||'.';if(!_0x359ff4)return console[_0x100259(0x173)](_0x100259(0x1a3)),console['error'](_0x100259(0x2bd)),0x1;const _0x1b3fd8=_0x10c7ba['revision'];_0x10c7ba[_0x100259(0x2be)]&&(console['error'](_0x100259(0x1f4)+_0x359ff4),console[_0x100259(0x173)](_0x100259(0x1fc)+_0x44bfc4),_0x1b3fd8&&console[_0x100259(0x173)](_0x100259(0x1bf)+_0x1b3fd8));const _0x2aa365=await withSpinner(_0x100259(0x2ba)+_0x359ff4+_0x100259(0x138),()=>_0x3502a3['workflow'][_0x100259(0x14c)](_0x359ff4,_0x44bfc4,{'revision':_0x1b3fd8}),{'verbose':_0x10c7ba[_0x100259(0x2be)]}),_0x515ad5=_0x2aa365[_0x100259(0x180)];return console[_0x100259(0x173)](_0x100259(0x185)+_0x515ad5['projectName']),console['error'](_0x100259(0x174)+_0x515ad5[_0x100259(0x2d5)]),console[_0x100259(0x173)]('\x20\x20Files\x20extracted:\x20'+_0x515ad5['filesExtracted']),console['error']('\x20\x20Location:\x20'+_0x44bfc4+'/'+_0x515ad5['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a39_0x4f7c3b(0x181)]=a39_0x4f7c3b(0x16a);[a39_0x4f7c3b(0x1ce)]=a39_0x4f7c3b(0x271);async['execute'](_0x56c908){const _0x50229e=a39_0x4f7c3b,{options:_0x5b1500,args:_0x369d81,tdx:_0x30af91}=_0x56c908;let _0x3095c2='.',_0x1e5b4e=_0x5b1500['name'];if(_0x369d81[0x0]){const {promises:_0x309ca6}=await import('fs');try{const _0x2a3c66=await _0x309ca6[_0x50229e(0x1f1)](_0x369d81[0x0]);if(_0x2a3c66[_0x50229e(0x234)]())_0x3095c2=_0x369d81[0x0];else return console[_0x50229e(0x173)](_0x50229e(0x286)+_0x369d81[0x0]+_0x50229e(0x2cd)),0x1;}catch{_0x1e5b4e=_0x369d81[0x0],_0x3095c2='.';}}const _0x2b711b=_0x5b1500['revision'],_0x5e429b=_0x5b1500[_0x50229e(0x243)];_0x5b1500[_0x50229e(0x2be)]&&(console['error'](_0x50229e(0x202)+_0x3095c2),_0x1e5b4e&&console[_0x50229e(0x173)](_0x50229e(0x28a)+_0x1e5b4e),_0x2b711b&&console['error'](_0x50229e(0x1bf)+_0x2b711b),_0x5e429b&&console['error'](_0x50229e(0x1ad)));const _0x3b1745=await withSpinner(_0x50229e(0x18f),()=>_0x30af91[_0x50229e(0x1c2)][_0x50229e(0x25e)](_0x3095c2,{'projectName':_0x1e5b4e,'revision':_0x2b711b,'skipValidation':_0x5e429b}),{'verbose':_0x5b1500[_0x50229e(0x2be)]}),_0x5c96e6=_0x3b1745[_0x50229e(0x180)];return console['error']('✔\x20Pushed\x20'+_0x5c96e6['projectName']),console[_0x50229e(0x173)](_0x50229e(0x1f6)+_0x5c96e6[_0x50229e(0x27f)]),console['error']('\x20\x20Revision:\x20'+_0x5c96e6[_0x50229e(0x2d5)]),await this[_0x50229e(0x1b6)](_0x30af91,_0x5c96e6[_0x50229e(0x218)],_0x5b1500[_0x50229e(0x1a2)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']=a39_0x4f7c3b(0x28e);[a39_0x4f7c3b(0x1ce)]=a39_0x4f7c3b(0x2c3);async[a39_0x4f7c3b(0x1a0)](_0x4568b1){const _0x128b37=a39_0x4f7c3b,{options:_0x850217,args:_0x58a3cb,tdx:_0x29f716}=_0x4568b1,_0x1f05a5=_0x58a3cb[0x0],_0x26b6ba=_0x58a3cb[0x1];if(!_0x1f05a5)return console[_0x128b37(0x173)](a39_0x4c4e0a[_0x128b37(0x2ab)](_0x128b37(0x13c)),_0x128b37(0x254)),console[_0x128b37(0x173)](a39_0x4c4e0a[_0x128b37(0x183)](_0x128b37(0x1bb))),0x1;const _0x4ffc19=_0x850217['revision'];_0x850217[_0x128b37(0x2be)]&&(console[_0x128b37(0x173)](_0x128b37(0x1f4)+_0x1f05a5),_0x26b6ba&&console[_0x128b37(0x173)](_0x128b37(0x1ef)+_0x26b6ba),_0x4ffc19&&console[_0x128b37(0x173)]('Revision:\x20'+_0x4ffc19),_0x850217[_0x128b37(0x27e)]&&console[_0x128b37(0x173)](_0x128b37(0x205)));const _0x474cf1=await withSpinner(_0x128b37(0x165)+_0x1f05a5+_0x128b37(0x138),()=>_0x29f716[_0x128b37(0x1c2)]['pullProject'](_0x1f05a5,{'targetDir':_0x26b6ba,'revision':_0x4ffc19}),{'verbose':_0x850217[_0x128b37(0x2be)]}),_0x1cc330=_0x474cf1[_0x128b37(0x180)];_0x1cc330[_0x128b37(0x266)]?console[_0x128b37(0x173)](_0x128b37(0x15e)+_0x1cc330[_0x128b37(0x218)]):console[_0x128b37(0x173)](_0x128b37(0x15f)+_0x1cc330[_0x128b37(0x218)]);console['error'](_0x128b37(0x174)+_0x1cc330['revision']),console[_0x128b37(0x173)](_0x128b37(0x258)+(a39_0x4017db[_0x128b37(0x21b)](process[_0x128b37(0x1fb)](),_0x1cc330[_0x128b37(0x14b)])||'.')),console['error']('\x20\x20Changes:\x20'+a39_0x4c4e0a[_0x128b37(0x1be)]('+'+_0x1cc330[_0x128b37(0x20a)][_0x128b37(0x17f)]+'\x20new')+',\x20'+(a39_0x4c4e0a['yellow']('~'+_0x1cc330[_0x128b37(0x20a)][_0x128b37(0x260)]+_0x128b37(0x1a8))+',\x20')+(a39_0x4c4e0a[_0x128b37(0x2ab)]('-'+_0x1cc330[_0x128b37(0x20a)][_0x128b37(0x246)]+'\x20deleted')+',\x20')+(''+a39_0x4c4e0a[_0x128b37(0x183)](_0x1cc330[_0x128b37(0x20a)]['unchanged']+_0x128b37(0x20d))));for(const _0x3bdc4d of _0x1cc330[_0x128b37(0x20f)]){_0x3bdc4d[_0x128b37(0x27a)]==='modified'&&_0x3bdc4d['diff']&&(console[_0x128b37(0x173)]('\x0a'+a39_0x4c4e0a['cyan'](_0x128b37(0x268)+_0x3bdc4d['path'])),console[_0x128b37(0x173)](_0x3bdc4d[_0x128b37(0x197)]));}if(!_0x1cc330[_0x128b37(0x12e)])return saveSessionContext({'workflow_project':_0x1cc330[_0x128b37(0x218)]},_0x850217[_0x128b37(0x1ea)]),console[_0x128b37(0x173)](a39_0x4c4e0a[_0x128b37(0x1be)](_0x128b37(0x2b5))),console['error'](a39_0x4c4e0a[_0x128b37(0x183)](_0x128b37(0x196)+_0x1cc330[_0x128b37(0x218)])),0x0;if(_0x850217[_0x128b37(0x27e)])return console['error'](a39_0x4c4e0a[_0x128b37(0x19f)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x850217['yes']){const _0x2df76b=await confirmKey(_0x128b37(0x1a5));if(!_0x2df76b)return console[_0x128b37(0x173)](_0x128b37(0x257)),0x0;}await withSpinner('Writing\x20files...',()=>_0x29f716['workflow'][_0x128b37(0x1af)](_0x1cc330,{'revision':_0x4ffc19}),{'verbose':_0x850217[_0x128b37(0x2be)]}),saveSessionContext({'workflow_project':_0x1cc330[_0x128b37(0x218)]},_0x850217[_0x128b37(0x1ea)]),console[_0x128b37(0x173)](a39_0x4c4e0a[_0x128b37(0x1be)](_0x128b37(0x129)));const _0x77eb60=a39_0x4017db[_0x128b37(0x21b)](process[_0x128b37(0x1fb)](),_0x1cc330['targetDir'])||'.';return console['error'](a39_0x4c4e0a[_0x128b37(0x183)](_0x128b37(0x2d6)+_0x77eb60)),console[_0x128b37(0x173)](a39_0x4c4e0a[_0x128b37(0x183)](_0x128b37(0x196)+_0x1cc330[_0x128b37(0x218)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a39_0x4f7c3b(0x22c);[a39_0x4f7c3b(0x1ce)]='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async['execute'](_0x4d0a2f){const _0x3bd102=a39_0x4f7c3b,{options:_0x409653,args:_0x1b3368,tdx:_0x2c08c8}=_0x4d0a2f,_0x3dc974=this[_0x3bd102(0x2c6)](_0x1b3368,_0x409653),_0x2abbda=_0x409653[_0x3bd102(0x2d5)],_0x40e513=_0x409653['skipValidation'];_0x409653[_0x3bd102(0x2be)]&&(_0x3dc974&&console['error'](_0x3bd102(0x162)+_0x3dc974),_0x2abbda&&console[_0x3bd102(0x173)](_0x3bd102(0x1bf)+_0x2abbda),_0x409653[_0x3bd102(0x27e)]&&console['error'](_0x3bd102(0x205)),_0x40e513&&console[_0x3bd102(0x173)]('Validation:\x20skipped'));let _0x971c96;try{_0x971c96=await withSpinner('Analyzing\x20changes...',()=>_0x2c08c8[_0x3bd102(0x1c2)][_0x3bd102(0x1d8)]({'sourceDir':_0x3dc974,'revision':_0x2abbda,'skipValidation':_0x40e513}),{'verbose':_0x409653[_0x3bd102(0x2be)]});}catch(_0x3ff7a5){if(_0x3ff7a5 instanceof Error&&_0x3ff7a5[_0x3bd102(0x23d)][_0x3bd102(0x1dd)](_0x3bd102(0x28d)))return console['error'](a39_0x4c4e0a[_0x3bd102(0x2ab)]('Error:'),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x409653[_0x3bd102(0x140)]?console['error'](a39_0x4c4e0a[_0x3bd102(0x183)](_0x3bd102(0x1b3)+_0x409653['workflowProject']+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x409653[_0x3bd102(0x140)]+'\x27')):console['error'](a39_0x4c4e0a['dim']('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x3ff7a5;}const _0x4de007=_0x971c96[_0x3bd102(0x180)];console[_0x3bd102(0x173)](_0x3bd102(0x15f)+_0x4de007[_0x3bd102(0x218)]),console[_0x3bd102(0x173)](_0x3bd102(0x13a)+_0x4de007[_0x3bd102(0x2c1)]),console[_0x3bd102(0x173)](_0x3bd102(0x174)+_0x4de007[_0x3bd102(0x2d5)]),console['error'](_0x3bd102(0x1cf)+a39_0x4c4e0a[_0x3bd102(0x1be)]('+'+_0x4de007[_0x3bd102(0x20a)][_0x3bd102(0x17f)]+'\x20new')+',\x20'+(a39_0x4c4e0a['yellow']('~'+_0x4de007[_0x3bd102(0x20a)][_0x3bd102(0x260)]+'\x20modified')+',\x20')+(a39_0x4c4e0a['red']('-'+_0x4de007[_0x3bd102(0x20a)][_0x3bd102(0x246)]+_0x3bd102(0x24f))+',\x20')+(''+a39_0x4c4e0a['dim'](_0x4de007[_0x3bd102(0x20a)][_0x3bd102(0x2b1)]+'\x20unchanged')));for(const _0x41224b of _0x4de007[_0x3bd102(0x20f)]){_0x41224b[_0x3bd102(0x27a)]===_0x3bd102(0x260)&&_0x41224b[_0x3bd102(0x197)]&&(console['error']('\x0a'+a39_0x4c4e0a['cyan'](_0x3bd102(0x268)+_0x41224b[_0x3bd102(0x1d9)])),console[_0x3bd102(0x173)](_0x41224b['diff']));}if(!_0x4de007[_0x3bd102(0x12e)])return console[_0x3bd102(0x173)](a39_0x4c4e0a[_0x3bd102(0x1be)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x3bd102(0x1b6)](_0x2c08c8,_0x4de007[_0x3bd102(0x218)],_0x409653[_0x3bd102(0x1a2)]),0x0;if(_0x409653[_0x3bd102(0x27e)])return console[_0x3bd102(0x173)](a39_0x4c4e0a['yellow'](_0x3bd102(0x201))),0x0;if(!_0x409653[_0x3bd102(0x259)]){const _0x591eaf=await confirmKey(_0x3bd102(0x2b3));if(!_0x591eaf)return console[_0x3bd102(0x173)](_0x3bd102(0x257)),0x0;}const _0x3771e2=await withSpinner(_0x3bd102(0x19d),()=>_0x2c08c8[_0x3bd102(0x1c2)][_0x3bd102(0x2bb)](_0x4de007),{'verbose':_0x409653[_0x3bd102(0x2be)]}),_0x530ca8=_0x3771e2[_0x3bd102(0x180)];return console['error'](a39_0x4c4e0a[_0x3bd102(0x1be)]('✔\x20Push\x20complete')),console[_0x3bd102(0x173)]('\x20\x20Project\x20ID:\x20'+_0x530ca8['projectId']),console['error'](_0x3bd102(0x174)+_0x530ca8[_0x3bd102(0x2d5)]),await this['showWorkflowConsoleUrl'](_0x2c08c8,_0x530ca8[_0x3bd102(0x218)],_0x409653['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a39_0x4f7c3b(0x181)]=a39_0x4f7c3b(0x267);[a39_0x4f7c3b(0x1ce)]=a39_0x4f7c3b(0x215);async['execute'](_0x517ec7){const _0x3e2b8e=a39_0x4f7c3b,{options:_0x44c5ac,args:_0x1287f2,tdx:_0x59a494}=_0x517ec7,_0x432534=this[_0x3e2b8e(0x2c6)](_0x1287f2,_0x44c5ac),_0xf1440b=_0x44c5ac[_0x3e2b8e(0x181)],_0x137fc2=_0x44c5ac[_0x3e2b8e(0x2d5)],_0x236db8=_0x44c5ac[_0x3e2b8e(0x243)];if(!_0x432534)return console['error'](a39_0x4c4e0a[_0x3e2b8e(0x2ab)](_0x3e2b8e(0x13c)),'Source\x20directory\x20is\x20required'),console[_0x3e2b8e(0x173)](a39_0x4c4e0a[_0x3e2b8e(0x183)](_0x3e2b8e(0x294))),console[_0x3e2b8e(0x173)](a39_0x4c4e0a[_0x3e2b8e(0x183)](_0x3e2b8e(0x1da))),0x1;if(!_0xf1440b)return console[_0x3e2b8e(0x173)](a39_0x4c4e0a[_0x3e2b8e(0x2ab)](_0x3e2b8e(0x13c)),_0x3e2b8e(0x17a)),console[_0x3e2b8e(0x173)](a39_0x4c4e0a['dim'](_0x3e2b8e(0x294))),0x1;_0x44c5ac[_0x3e2b8e(0x2be)]&&(console[_0x3e2b8e(0x173)]('Source\x20directory:\x20'+_0x432534),console[_0x3e2b8e(0x173)](_0x3e2b8e(0x141)+_0xf1440b),_0x137fc2&&console[_0x3e2b8e(0x173)]('Revision:\x20'+_0x137fc2),_0x44c5ac[_0x3e2b8e(0x27e)]&&console[_0x3e2b8e(0x173)](_0x3e2b8e(0x205)),_0x236db8&&console[_0x3e2b8e(0x173)](_0x3e2b8e(0x1ad)));const _0xf2dc02=await withSpinner(_0x3e2b8e(0x233),()=>_0x59a494[_0x3e2b8e(0x1c2)][_0x3e2b8e(0x1e5)](_0x432534,_0xf1440b,{'revision':_0x137fc2,'skipValidation':_0x236db8}),{'verbose':_0x44c5ac[_0x3e2b8e(0x2be)]}),_0x23661b=_0xf2dc02[_0x3e2b8e(0x180)];console[_0x3e2b8e(0x173)](_0x3e2b8e(0x1c8)+_0x23661b[_0x3e2b8e(0x2c1)]);_0x23661b[_0x3e2b8e(0x263)]&&console[_0x3e2b8e(0x173)]('Source\x20project:\x20'+_0x23661b[_0x3e2b8e(0x263)]);console[_0x3e2b8e(0x173)](_0x3e2b8e(0x141)+_0x23661b[_0x3e2b8e(0x20b)]),console['error'](_0x3e2b8e(0x1bf)+_0x23661b['revision']),console[_0x3e2b8e(0x173)]('Files\x20to\x20upload:\x20'+_0x23661b[_0x3e2b8e(0x24a)]);_0x23661b[_0x3e2b8e(0x1bc)]&&(console[_0x3e2b8e(0x173)](a39_0x4c4e0a['yellow']('\x0a⚠\x20Project\x20\x22'+_0x23661b[_0x3e2b8e(0x20b)]+_0x3e2b8e(0x2aa)+_0x23661b[_0x3e2b8e(0x22f)]+')')),console[_0x3e2b8e(0x173)](a39_0x4c4e0a[_0x3e2b8e(0x19f)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x44c5ac[_0x3e2b8e(0x27e)])return console[_0x3e2b8e(0x173)](a39_0x4c4e0a[_0x3e2b8e(0x19f)]('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x44c5ac['yes']){const _0x533e12=_0x23661b[_0x3e2b8e(0x263)]||a39_0x4017db[_0x3e2b8e(0x152)](_0x432534),_0x1e0779=_0x23661b[_0x3e2b8e(0x1bc)]?_0x3e2b8e(0x261)+_0xf1440b+_0x3e2b8e(0x1b2):_0x3e2b8e(0x288)+_0x533e12+'\x22\x20to\x20new\x20project\x20\x22'+_0xf1440b+'\x22?',_0x337664=await confirmKey(_0x1e0779);if(!_0x337664)return console[_0x3e2b8e(0x173)](_0x3e2b8e(0x257)),0x0;}const _0x4505f4=await withSpinner(_0x23661b[_0x3e2b8e(0x1bc)]?_0x3e2b8e(0x16b)+_0xf1440b+_0x3e2b8e(0x138):_0x3e2b8e(0x1cd)+_0xf1440b+_0x3e2b8e(0x138),()=>_0x59a494[_0x3e2b8e(0x1c2)][_0x3e2b8e(0x2a8)](_0x23661b),{'verbose':_0x44c5ac['verbose']}),_0x15fa7c=_0x4505f4['data'];return console[_0x3e2b8e(0x173)](a39_0x4c4e0a[_0x3e2b8e(0x1be)](_0x23661b[_0x3e2b8e(0x1bc)]?'✔\x20Project\x20updated':_0x3e2b8e(0x2a3))),console[_0x3e2b8e(0x173)](_0x3e2b8e(0x236)+_0x15fa7c[_0x3e2b8e(0x20b)]),console[_0x3e2b8e(0x173)](_0x3e2b8e(0x1f6)+_0x15fa7c[_0x3e2b8e(0x24e)]),console[_0x3e2b8e(0x173)](_0x3e2b8e(0x174)+_0x15fa7c['revision']),await this[_0x3e2b8e(0x1b6)](_0x59a494,_0x15fa7c[_0x3e2b8e(0x20b)],_0x44c5ac['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a39_0x4f7c3b(0x181)]=a39_0x4f7c3b(0x249);[a39_0x4f7c3b(0x1ce)]=a39_0x4f7c3b(0x2c7);async[a39_0x4f7c3b(0x1a0)](_0x4c0eb1){const _0x579c79=a39_0x4f7c3b,{options:_0x34b0b7,args:_0x27a58d,tdx:_0x31fbe1}=_0x4c0eb1,_0x25894a=_0x27a58d[0x0];if(!_0x25894a)return console[_0x579c79(0x173)](_0x579c79(0x26a)),console[_0x579c79(0x173)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x34b0b7['verbose']&&console[_0x579c79(0x173)](_0x579c79(0x1f4)+_0x25894a);if(!_0x34b0b7[_0x579c79(0x259)]){const _0x5bc05f=await confirmKey(_0x579c79(0x154)+_0x25894a+_0x579c79(0x19e));if(!_0x5bc05f)return console[_0x579c79(0x173)](_0x579c79(0x257)),0x0;}const _0x46363b=await withSpinner('Deleting\x20project\x20'+_0x25894a+'...',()=>_0x31fbe1['workflow'][_0x579c79(0x277)](_0x25894a),{'verbose':_0x34b0b7[_0x579c79(0x2be)]}),_0x453e15=_0x46363b[_0x579c79(0x180)];return console['error']('✔\x20Deleted\x20project\x20'+_0x453e15[_0x579c79(0x218)]),console[_0x579c79(0x173)](_0x579c79(0x1f6)+_0x453e15[_0x579c79(0x27f)]),0x0;}}export function parseKeyValue(_0xb15027){const _0x5a13c2=a39_0x4f7c3b,_0x21abe8=_0xb15027['indexOf']('=');if(_0x21abe8===-0x1)throw new Error('Invalid\x20format:\x20'+_0xb15027+_0x5a13c2(0x209));const _0x148866=_0xb15027[_0x5a13c2(0x204)](0x0,_0x21abe8),_0xbc95bd=_0xb15027['substring'](_0x21abe8+0x1);if(!_0x148866)throw new Error(_0x5a13c2(0x238));return{'key':_0x148866,'value':_0xbc95bd};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a39_0x4f7c3b(0x181)]=a39_0x4f7c3b(0x250);[a39_0x4f7c3b(0x1ce)]=a39_0x4f7c3b(0x153);async['execute'](_0x3f2b17){const _0x1cdbea=a39_0x4f7c3b,{options:_0x3f3d9f,args:_0x4c2f79,tdx:_0x17b460}=_0x3f2b17,_0x5b0aec=this[_0x1cdbea(0x287)](_0x4c2f79,_0x3f3d9f);if(!_0x5b0aec)return 0x1;_0x3f3d9f[_0x1cdbea(0x2be)]&&console[_0x1cdbea(0x173)](_0x1cdbea(0x1f4)+_0x5b0aec);const _0x4a313f=await withSpinner(_0x1cdbea(0x1d2),()=>_0x17b460[_0x1cdbea(0x1c2)][_0x1cdbea(0x1df)](_0x5b0aec),{'verbose':_0x3f3d9f['verbose']}),{secrets:_0x4395e8}=_0x4a313f[_0x1cdbea(0x180)];return console[_0x1cdbea(0x173)](_0x1cdbea(0x279)+_0x4395e8['length']+_0x1cdbea(0x252)+(_0x4395e8['length']!==0x1?'s':'')),await handleSDKOutput(_0x4395e8,_0x3f3d9f),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a39_0x4f7c3b(0x181)]=a39_0x4f7c3b(0x1d1);[a39_0x4f7c3b(0x1ce)]=a39_0x4f7c3b(0x239);async['execute'](_0x18b603){const _0x1012df=a39_0x4f7c3b,{options:_0xc0eb6f,args:_0x445fc2,tdx:_0x5c813d}=_0x18b603;let _0x196e92,_0x51d91a;if(_0x445fc2[_0x1012df(0x245)]>=0x2)_0x196e92=_0x445fc2[0x0],_0x51d91a=_0x445fc2[0x1];else{if(_0x445fc2[_0x1012df(0x245)]===0x1&&_0xc0eb6f['workflowProject'])_0x196e92=_0xc0eb6f[_0x1012df(0x140)],_0x51d91a=_0x445fc2[0x0];else return _0x445fc2[_0x1012df(0x245)]===0x1?(console[_0x1012df(0x173)](_0x1012df(0x1a3)),console[_0x1012df(0x173)](_0x1012df(0x2a0)),0x1):(console['error'](_0x1012df(0x186)),console['error'](_0x1012df(0x25f)),0x1);}let _0x2f3269,_0x40a9e7;try{({key:_0x2f3269,value:_0x40a9e7}=parseKeyValue(_0x51d91a));}catch(_0x48b3d9){return _0x48b3d9 instanceof Error&&console['error'](a39_0x4c4e0a[_0x1012df(0x2ab)](_0x1012df(0x13c)),_0x48b3d9['message']),0x1;}_0xc0eb6f['verbose']&&(console[_0x1012df(0x173)](_0x1012df(0x1f4)+_0x196e92),console['error'](_0x1012df(0x1a9)+_0x2f3269));const _0x520ddc=await withSpinner(_0x1012df(0x25a),()=>_0x5c813d[_0x1012df(0x1c2)][_0x1012df(0x29a)](_0x196e92,_0x2f3269,_0x40a9e7),{'verbose':_0xc0eb6f['verbose']}),_0x47c2b3=_0x520ddc[_0x1012df(0x180)];return console[_0x1012df(0x173)]('✔\x20Secret\x20\x27'+_0x47c2b3[_0x1012df(0x2af)]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x47c2b3[_0x1012df(0x218)]+'\x27'),(_0xc0eb6f[_0x1012df(0x20e)]||_0xc0eb6f[_0x1012df(0x1ed)])&&await handleSingleObjectOutput(_0x47c2b3,_0xc0eb6f),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a39_0x4f7c3b(0x181)]='workflow:secrets:delete';[a39_0x4f7c3b(0x1ce)]='Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project';async[a39_0x4f7c3b(0x1a0)](_0x5eaa68){const _0x54bc94=a39_0x4f7c3b,{options:_0x32946b,args:_0x6e011,tdx:_0x1c30e3}=_0x5eaa68;let _0x571227,_0xfdb474;if(_0x6e011[_0x54bc94(0x245)]>=0x2)_0x571227=_0x6e011[0x0],_0xfdb474=_0x6e011[0x1];else{if(_0x6e011[_0x54bc94(0x245)]===0x1&&_0x32946b[_0x54bc94(0x140)])_0x571227=_0x32946b[_0x54bc94(0x140)],_0xfdb474=_0x6e011[0x0];else return _0x6e011[_0x54bc94(0x245)]===0x1?(console[_0x54bc94(0x173)](_0x54bc94(0x1a3)),console[_0x54bc94(0x173)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x54bc94(0x173)](_0x54bc94(0x220)),console['error'](_0x54bc94(0x1c5)),0x1);}_0x32946b[_0x54bc94(0x2be)]&&(console[_0x54bc94(0x173)](_0x54bc94(0x1f4)+_0x571227),console['error'](_0x54bc94(0x1a9)+_0xfdb474));if(!_0x32946b[_0x54bc94(0x259)]){const _0x336fcd=await confirmKey(_0x54bc94(0x149)+_0xfdb474+'\x27\x20from\x20project\x20\x27'+_0x571227+'\x27?');if(!_0x336fcd)return console[_0x54bc94(0x173)](_0x54bc94(0x257)),0x0;}const _0x493c23=await withSpinner(_0x54bc94(0x29e),()=>_0x1c30e3[_0x54bc94(0x1c2)]['deleteSecret'](_0x571227,_0xfdb474),{'verbose':_0x32946b[_0x54bc94(0x2be)]}),_0x130138=_0x493c23['data'];return console[_0x54bc94(0x173)](_0x54bc94(0x27d)+_0x130138[_0x54bc94(0x2af)]+_0x54bc94(0x1d3)+_0x130138[_0x54bc94(0x218)]+'\x27'),(_0x32946b[_0x54bc94(0x20e)]||_0x32946b['jsonl'])&&await handleSingleObjectOutput(_0x130138,_0x32946b),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(_0x460300){const _0x29aa1b=a39_0x4f7c3b,_0x3e5ee3=Math[_0x29aa1b(0x262)](_0x460300/0x3e8),_0x3ebc3e=Math[_0x29aa1b(0x262)](_0x3e5ee3/0x3c),_0x9ec2d1=Math['floor'](_0x3ebc3e/0x3c),_0x45cf20=Math[_0x29aa1b(0x262)](_0x9ec2d1/0x18);if(_0x45cf20>0x0){const _0x5c4f47=_0x9ec2d1%0x18;return _0x5c4f47>0x0?_0x45cf20+'d\x20'+_0x5c4f47+'h':_0x45cf20+'d';}else{if(_0x9ec2d1>0x0){const _0x2b7a05=_0x3ebc3e%0x3c;return _0x2b7a05>0x0?_0x9ec2d1+'h\x20'+_0x2b7a05+'m':_0x9ec2d1+'h';}else{if(_0x3ebc3e>0x0){const _0x2ffff9=_0x3e5ee3%0x3c;return _0x2ffff9>0x0?_0x3ebc3e+'m\x20'+_0x2ffff9+'s':_0x3ebc3e+'m';}else return _0x3e5ee3+'s';}}}function formatTimestamp(_0xb13275,_0x51f7e1){const _0x2b65ed=a39_0x4f7c3b,_0x5eefa9=new Date(_0xb13275),_0x58773c=String(_0x5eefa9['getHours']())['padStart'](0x2,'0'),_0x3e90cc=String(_0x5eefa9[_0x2b65ed(0x224)]())[_0x2b65ed(0x13e)](0x2,'0'),_0x4db50e=_0x58773c+':'+_0x3e90cc,_0x5c79d2=_0x5eefa9[_0x2b65ed(0x253)]()===_0x51f7e1[_0x2b65ed(0x253)]()&&_0x5eefa9[_0x2b65ed(0x142)]()===_0x51f7e1[_0x2b65ed(0x142)]()&&_0x5eefa9[_0x2b65ed(0x22d)]()===_0x51f7e1[_0x2b65ed(0x22d)]();if(_0x5c79d2)return _0x4db50e;else{const _0x3f0b28=String(_0x5eefa9['getMonth']()+0x1)[_0x2b65ed(0x13e)](0x2,'0'),_0x290bea=String(_0x5eefa9[_0x2b65ed(0x22d)]())[_0x2b65ed(0x13e)](0x2,'0');return _0x3f0b28+'-'+_0x290bea+'\x20'+_0x4db50e;}}function formatDate(_0x57d579){const _0x397aec=a39_0x4f7c3b,_0xeac04e=_0x57d579[_0x397aec(0x253)](),_0x2b9727=String(_0x57d579[_0x397aec(0x142)]()+0x1)[_0x397aec(0x13e)](0x2,'0'),_0x5d7afd=String(_0x57d579[_0x397aec(0x22d)]())[_0x397aec(0x13e)](0x2,'0');return _0xeac04e+'-'+_0x2b9727+'-'+_0x5d7afd;}function getTaskStateIcon(_0x1e0e89){const _0x5736d8={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x5736d8[_0x1e0e89]||'⚪';}function getBarChar(_0x2e047f){const _0x2dd11e=a39_0x4f7c3b;return _0x2e047f===_0x2dd11e(0x173)||_0x2e047f===_0x2dd11e(0x16c)?'×':'─';}function getBarColor(_0xea6681){const _0x5225e9=a39_0x4f7c3b,_0x2ce5f3={'success':a39_0x4c4e0a[_0x5225e9(0x1be)],'error':a39_0x4c4e0a[_0x5225e9(0x2ab)],'group_error':a39_0x4c4e0a['red'],'running':a39_0x4c4e0a[_0x5225e9(0x203)],'blocked':a39_0x4c4e0a[_0x5225e9(0x19f)],'planned':a39_0x4c4e0a['dim'],'canceling':a39_0x4c4e0a[_0x5225e9(0x19f)]};return _0x2ce5f3[_0xea6681]||a39_0x4c4e0a[_0x5225e9(0x2ac)];}function parseTaskName(_0x26afa4){const _0x4e9d5e=a39_0x4f7c3b;let _0x1ecd6d=_0x26afa4[_0x4e9d5e(0x2a5)](/^\++/,'');const _0x5564d6=_0x1ecd6d[_0x4e9d5e(0x21d)]('+'),_0x200f9a=_0x5564d6[_0x4e9d5e(0x245)]>0x1?_0x5564d6[_0x4e9d5e(0x245)]-0x2:0x0,_0x15a659=_0x5564d6[_0x5564d6[_0x4e9d5e(0x245)]-0x1]||_0x1ecd6d;return{'level':_0x200f9a,'name':'+'+_0x15a659};}function truncateTaskName(_0x3be54e,_0x4fb6c3){const _0x611fbf=a39_0x4f7c3b,_0x39552d=stringWidth(_0x3be54e);if(_0x39552d<=_0x4fb6c3)return _0x3be54e;let _0x3f36b8=_0x3be54e;while(stringWidth(_0x3f36b8+'…')>_0x4fb6c3&&_0x3f36b8[_0x611fbf(0x245)]>0x0){_0x3f36b8=_0x3f36b8['slice'](0x0,-0x1);}return _0x3f36b8+'…';}function calculateTimeScale(_0x538f3d,_0x49f625){const _0x4f4cb1=a39_0x4f7c3b;return{'startTime':_0x538f3d['start'],'endTime':_0x538f3d['end'],'durationMs':_0x538f3d['duration'],'msPerChar':_0x538f3d[_0x4f4cb1(0x1f8)]/_0x49f625};}function timeToPosition(_0x3b29a9,_0x5f2e21,_0x286ef4){const _0x57988e=a39_0x4f7c3b,_0xd8e6f4=_0x3b29a9-_0x5f2e21[_0x57988e(0x28f)],_0x2e09f3=Math['floor'](_0xd8e6f4/_0x5f2e21[_0x57988e(0x1c3)]);return Math['max'](0x0,Math[_0x57988e(0x16f)](_0x2e09f3,_0x286ef4));}function renderTimeAxis(_0x1baf00,_0x2bbd4a){const _0x41b3fb=a39_0x4f7c3b,_0x313163=Math[_0x41b3fb(0x16f)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x41b3fb(0x1d4)](TIMELINE_CONFIG[_0x41b3fb(0x1ec)],Math['floor'](_0x2bbd4a/TIMELINE_CONFIG[_0x41b3fb(0x14e)]))),_0x2a1e02=_0x1baf00[_0x41b3fb(0x1fd)]/(_0x313163-0x1),_0xff187b=new Date(_0x1baf00[_0x41b3fb(0x28f)]),_0x7a1519=[];for(let _0x242d92=0x0;_0x242d92<_0x313163;_0x242d92++){const _0xeefdf7=_0x1baf00['startTime']+_0x242d92*_0x2a1e02,_0x464078=timeToPosition(_0xeefdf7,_0x1baf00,_0x2bbd4a),_0x5ab0e6=formatTimestamp(_0xeefdf7,_0xff187b);_0x7a1519[_0x41b3fb(0x25e)]({'pos':_0x464078,'text':_0x5ab0e6});}const _0x2c5631=new Array(_0x2bbd4a)[_0x41b3fb(0x23c)]('\x20');let _0x56beae=-0x1;for(const {pos:_0x3a328d,text:_0x90459e}of _0x7a1519){let _0x52607b=Math[_0x41b3fb(0x1d4)](0x0,_0x3a328d-Math[_0x41b3fb(0x262)](_0x90459e[_0x41b3fb(0x245)]/0x2));_0x52607b<=_0x56beae+TIMELINE_CONFIG[_0x41b3fb(0x219)]&&(_0x52607b=_0x56beae+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x52607b+_0x90459e['length']>_0x2bbd4a&&(_0x52607b=_0x2bbd4a-_0x90459e[_0x41b3fb(0x245)]);if(_0x52607b>=0x0&&_0x52607b+_0x90459e[_0x41b3fb(0x245)]<=_0x2bbd4a&&_0x52607b>_0x56beae){for(let _0x5e5ef7=0x0;_0x5e5ef7<_0x90459e[_0x41b3fb(0x245)];_0x5e5ef7++){_0x2c5631[_0x52607b+_0x5e5ef7]=_0x90459e[_0x5e5ef7];}_0x56beae=_0x52607b+_0x90459e[_0x41b3fb(0x245)]-0x1;}}return _0x2c5631[_0x41b3fb(0x175)]('');}function renderTaskRow(_0x1a2db8,_0x5055fa,_0x3d3dfd,_0x2d9f16){const _0x376ade=a39_0x4f7c3b,{level:_0x200ff1,name:_0x17846e}=parseTaskName(_0x1a2db8[_0x376ade(0x181)]),_0x376e11='\x20'['repeat'](_0x200ff1),_0x11fc57=_0x1a2db8['window']?'('+formatElapsed(_0x1a2db8[_0x376ade(0x251)][_0x376ade(0x1f8)])+')':'',_0x23e297=stringWidth(_0x11fc57),_0x3493be=_0x200ff1*0x1,_0x555274=_0x2d9f16-_0x3493be-_0x23e297-0x1,_0x164b91=truncateTaskName(_0x17846e,_0x555274),_0x3dec0a=_0x376e11+_0x164b91,_0x16ee3b=stringWidth(_0x3dec0a),_0x28bb14=_0x2d9f16-_0x16ee3b-_0x23e297,_0x4abe90=_0x3dec0a+'\x20'['repeat'](Math['max'](0x1,_0x28bb14))+a39_0x4c4e0a[_0x376ade(0x183)](_0x11fc57),_0x2b23c6=getTaskStateIcon(_0x1a2db8[_0x376ade(0x276)]),_0x1518ae=new Array(_0x3d3dfd)[_0x376ade(0x23c)]('\x20');if(_0x1a2db8['window']){const _0x254347=timeToPosition(_0x1a2db8[_0x376ade(0x251)][_0x376ade(0x1cb)],_0x5055fa,_0x3d3dfd),_0x23ec3f=timeToPosition(_0x1a2db8['window'][_0x376ade(0x25c)],_0x5055fa,_0x3d3dfd),_0x4b0d62=getBarChar(_0x1a2db8[_0x376ade(0x276)]),_0x3a1e7e=Math[_0x376ade(0x1d4)](_0x254347+0x1,_0x23ec3f);for(let _0x5f05b2=_0x254347;_0x5f05b2<Math[_0x376ade(0x16f)](_0x3a1e7e,_0x3d3dfd);_0x5f05b2++){_0x1518ae[_0x5f05b2]=_0x4b0d62;}}const _0x451733=getBarColor(_0x1a2db8[_0x376ade(0x276)]),_0x360d24=_0x1518ae[_0x376ade(0x178)](_0x45a2e6=>_0x45a2e6==='\x20'?'\x20':_0x451733(_0x45a2e6))[_0x376ade(0x175)]('');return _0x2b23c6+'\x20'+_0x4abe90+'│'+_0x360d24+'│';}function calculateStats(_0x5d4f05){const _0x40fc36=a39_0x4f7c3b,_0x39be06={'total':_0x5d4f05[_0x40fc36(0x245)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x55b6a2 of _0x5d4f05){if(_0x55b6a2[_0x40fc36(0x276)]===_0x40fc36(0x2ce))_0x39be06['success']++;else{if(_0x55b6a2['state']===_0x40fc36(0x173)||_0x55b6a2[_0x40fc36(0x276)]===_0x40fc36(0x16c))_0x39be06[_0x40fc36(0x173)]++;else _0x55b6a2[_0x40fc36(0x276)]==='running'?_0x39be06[_0x40fc36(0x1e1)]++:_0x39be06[_0x40fc36(0x156)]++;}}return _0x39be06;}function formatStats(_0x5c8314){const _0x3dbd1b=a39_0x4f7c3b;return[_0x3dbd1b(0x1c0)+_0x5c8314['total'],'✅\x20'+_0x5c8314['success'],'❌\x20'+_0x5c8314[_0x3dbd1b(0x173)],_0x3dbd1b(0x19b)+_0x5c8314[_0x3dbd1b(0x1e1)],'⏳\x20'+_0x5c8314[_0x3dbd1b(0x156)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a39_0x4f7c3b(0x181)]=a39_0x4f7c3b(0x22a);[a39_0x4f7c3b(0x1ce)]=a39_0x4f7c3b(0x24b);async[a39_0x4f7c3b(0x1a0)](_0x1f5e6a){const _0x510e48=a39_0x4f7c3b,{options:_0x2e74c4,args:_0x608c6b,tdx:_0x163432}=_0x1f5e6a;let _0x3c910c,_0x358c0b,_0x372a3c=![];if(_0x608c6b[0x0]){if(_0x608c6b[0x0][_0x510e48(0x1dd)]('.')){const _0x1bdf31=this[_0x510e48(0x18e)](_0x608c6b,_0x2e74c4);if(!_0x1bdf31)return 0x1;_0x3c910c=_0x1bdf31[_0x510e48(0x218)],_0x358c0b=_0x1bdf31[_0x510e48(0x2d4)];}else{_0x358c0b=_0x608c6b[0x0],_0x3c910c=_0x2e74c4[_0x510e48(0x140)];if(!_0x3c910c)return console[_0x510e48(0x173)](a39_0x4c4e0a['red'](_0x510e48(0x13c)),_0x510e48(0x213)),0x1;_0x372a3c=!![];}}else{const _0x5dcb7a=this[_0x510e48(0x18e)](_0x608c6b,_0x2e74c4);if(!_0x5dcb7a)return 0x1;_0x3c910c=_0x5dcb7a[_0x510e48(0x218)],_0x358c0b=_0x5dcb7a['workflowName'];}if(_0x2e74c4[_0x510e48(0x2be)]){if(_0x3c910c&&_0x358c0b)console[_0x510e48(0x173)](_0x510e48(0x1aa)+_0x3c910c+'.'+_0x358c0b);else _0x3c910c&&console[_0x510e48(0x173)](_0x510e48(0x139)+_0x3c910c);}const _0xc64124=_0x2e74c4[_0x510e48(0x147)],_0x2f9b24=_0x2e74c4[_0x510e48(0x168)];if(_0xc64124){_0x2f9b24&&console[_0x510e48(0x173)](a39_0x4c4e0a[_0x510e48(0x19f)](_0x510e48(0x281)),_0x510e48(0x157));const _0x2f53ec=_0x2e74c4[_0x510e48(0x2a6)];return _0x2f53ec?await this[_0x510e48(0x14a)](_0x1f5e6a,_0xc64124):await this[_0x510e48(0x2b6)](_0x1f5e6a,_0xc64124,_0x2e74c4),0x0;}if(_0x2f9b24){const _0x52853b=await withSpinner('Loading\x20session...',()=>_0x163432[_0x510e48(0x1c2)][_0x510e48(0x289)]({'projectName':_0x3c910c,'workflowName':_0x358c0b,'limit':0x64}),{'verbose':_0x2e74c4[_0x510e48(0x2be)]}),_0x1ea107=_0x52853b['data'][_0x510e48(0x161)](_0x2caab4=>_0x2caab4['id']===_0x2f9b24);if(!_0x1ea107)return console[_0x510e48(0x173)](a39_0x4c4e0a[_0x510e48(0x2ab)]('Error:'),_0x510e48(0x26e)+_0x2f9b24),0x1;if(!_0x1ea107['lastAttempt']?.['id'])return console[_0x510e48(0x173)](a39_0x4c4e0a['red'](_0x510e48(0x13c)),_0x510e48(0x18b)+_0x2f9b24+'\x20has\x20no\x20attempts'),0x1;const _0x4ee441=_0x1ea107[_0x510e48(0x13b)]['id'];_0x2e74c4[_0x510e48(0x2be)]&&console[_0x510e48(0x173)](_0x510e48(0x1ff)+_0x4ee441+_0x510e48(0x18c)+_0x2f9b24);const _0x491cba=_0x2e74c4[_0x510e48(0x2a6)];return _0x491cba?await this['pollTimeline'](_0x1f5e6a,_0x4ee441):await this['renderSingleTimeline'](_0x1f5e6a,_0x4ee441,_0x2e74c4),0x0;}const _0x3b289a=await withSpinner(_0x510e48(0x298),()=>_0x163432[_0x510e48(0x1c2)]['sessions']({'projectName':_0x3c910c,'workflowName':_0x358c0b,'limit':_0x2e74c4[_0x510e48(0x217)]||0x32}),{'verbose':_0x2e74c4[_0x510e48(0x2be)]}),_0x25f31e=_0x3b289a[_0x510e48(0x180)];if(_0x25f31e['length']===0x0){if(_0x3c910c&&_0x358c0b)console[_0x510e48(0x173)](_0x510e48(0x29c)+_0x3c910c+'.'+_0x358c0b);else _0x3c910c?console[_0x510e48(0x173)](_0x510e48(0x19c)+_0x3c910c):(console[_0x510e48(0x173)](_0x510e48(0x145)),console['error'](a39_0x4c4e0a[_0x510e48(0x183)](_0x510e48(0x1e2))));return 0x0;}_0x25f31e[_0x510e48(0x169)]((_0x568624,_0x1e5046)=>{const _0x35d23c=_0x510e48,_0x48fed6=_0x568624['sessionTime']||'',_0x5a6088=_0x1e5046['sessionTime']||'';return _0x5a6088[_0x35d23c(0x272)](_0x48fed6);});if(_0x2e74c4[_0x510e48(0x20e)]||_0x2e74c4[_0x510e48(0x1ed)])return await handleSDKOutput(_0x25f31e,_0x2e74c4),0x0;let _0x29c255;if(_0x372a3c){const _0x16418c=_0x25f31e[0x0];if(!_0x16418c[_0x510e48(0x13b)]?.['id'])return console[_0x510e48(0x173)](_0x510e48(0x199)),0x0;_0x29c255=_0x16418c[_0x510e48(0x13b)]['id'],_0x2e74c4[_0x510e48(0x2be)]&&console[_0x510e48(0x173)]('Auto-selected\x20latest\x20session:\x20'+_0x16418c['sessionTime']);}else{const _0x57ea78=_0x25f31e[_0x510e48(0x178)](_0x7f1f1c=>{const _0x451cdb=_0x510e48,_0x1701cc=getAttemptStatusDisplay(_0x7f1f1c['lastAttempt']);return{'title':_0x7f1f1c['project']?.[_0x451cdb(0x181)]+'.'+_0x7f1f1c['workflow']?.[_0x451cdb(0x181)]+_0x451cdb(0x132)+_0x7f1f1c[_0x451cdb(0x1e4)]+'\x20'+_0x1701cc[_0x451cdb(0x25b)],'value':_0x7f1f1c[_0x451cdb(0x13b)]?.['id']||'','description':_0x1701cc[_0x451cdb(0x1d5)]};}),_0x3d2632=await a39_0x5cfdb3({'type':_0x510e48(0x27c),'name':_0x510e48(0x147),'message':_0x510e48(0x24c),'choices':_0x57ea78[_0x510e48(0x15b)](_0x6c0fdb=>_0x6c0fdb['value']!=='')});if(!_0x3d2632[_0x510e48(0x147)])return 0x0;_0x29c255=_0x3d2632[_0x510e48(0x147)];}const _0x6f05f3=_0x2e74c4[_0x510e48(0x2a6)];return _0x6f05f3?await this[_0x510e48(0x14a)](_0x1f5e6a,_0x29c255):await this[_0x510e48(0x2b6)](_0x1f5e6a,_0x29c255,_0x2e74c4),0x0;}async['renderSingleTimeline'](_0x5c96f0,_0x176c12,_0x1f713d){const _0x31a1fb=a39_0x4f7c3b,{tdx:_0x53c8a0}=_0x5c96f0;let _0x23d188,_0x41d208;try{[_0x23d188,_0x41d208]=await Promise[_0x31a1fb(0x20c)]([_0x53c8a0[_0x31a1fb(0x1c2)][_0x31a1fb(0x2bf)](_0x176c12),_0x53c8a0[_0x31a1fb(0x1c2)]['tasks'](_0x176c12,![])]);}catch(_0x4111ac){console[_0x31a1fb(0x173)](a39_0x4c4e0a[_0x31a1fb(0x2ab)](_0x31a1fb(0x14f)));_0x1f713d['verbose']&&console[_0x31a1fb(0x173)](_0x4111ac);throw _0x4111ac;}if(_0x1f713d['json']||_0x1f713d[_0x31a1fb(0x1ed)]){const _0x4c4df0=this[_0x31a1fb(0x182)](_0x23d188,_0x41d208);await handleSDKOutput([_0x4c4df0],_0x1f713d);return;}const _0x2597b9=_0x53c8a0[_0x31a1fb(0x194)]['site'],_0x638971=this[_0x31a1fb(0x256)](_0x23d188,_0x41d208,_0x2597b9);console[_0x31a1fb(0x2c9)](_0x638971);}async['pollTimeline'](_0x3c5ea5,_0x549b34){const _0x43ec13=a39_0x4f7c3b,{tdx:_0x1bb6da}=_0x3c5ea5,_0xdc0a17=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x55f4d6=TIMELINE_CONFIG[_0x43ec13(0x26b)];let _0x39af19=0x0;while(_0x39af19<_0x55f4d6){process[_0x43ec13(0x127)][_0x43ec13(0x29d)]&&process[_0x43ec13(0x127)][_0x43ec13(0x159)]('\x1bc');let _0x330949,_0x578bd6;try{[_0x330949,_0x578bd6]=await Promise['all']([_0x1bb6da[_0x43ec13(0x1c2)][_0x43ec13(0x2bf)](_0x549b34),_0x1bb6da['workflow'][_0x43ec13(0x163)](_0x549b34,![])]);}catch(_0x293b51){console[_0x43ec13(0x173)](a39_0x4c4e0a[_0x43ec13(0x2ab)](_0x43ec13(0x1b8)));_0x39af19>0x0&&console[_0x43ec13(0x173)](a39_0x4c4e0a['dim'](_0x43ec13(0x264)+_0x39af19));throw _0x293b51;}const _0x3d4626=_0x1bb6da[_0x43ec13(0x194)]['site'],_0x24428d=this[_0x43ec13(0x256)](_0x330949,_0x578bd6,_0x3d4626);console[_0x43ec13(0x2c9)](_0x24428d);const _0x1ff8df=_0x330949['done']&&_0x578bd6[_0x43ec13(0x2ca)](_0x460ee4=>_0x460ee4[_0x43ec13(0x276)]!==_0x43ec13(0x1e1)&&_0x460ee4[_0x43ec13(0x276)]!=='planned');if(_0x1ff8df){console[_0x43ec13(0x173)](a39_0x4c4e0a[_0x43ec13(0x1be)](_0x43ec13(0x210)));break;}console['error'](a39_0x4c4e0a[_0x43ec13(0x183)]('\x0aPolling...\x20('+_0x39af19*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x11842f=>setTimeout(_0x11842f,_0xdc0a17)),_0x39af19++;}_0x39af19>=_0x55f4d6&&console[_0x43ec13(0x173)](a39_0x4c4e0a[_0x43ec13(0x19f)](_0x43ec13(0x17d)));}['renderTimeline'](_0x1bc628,_0x4862e4,_0x22262c){const _0x1645e4=a39_0x4f7c3b,_0xc0bc9=[],_0x732605=TIMELINE_CONFIG[_0x1645e4(0x1a6)],_0x313777=0x5,_0x4e31f0=process[_0x1645e4(0x127)][_0x1645e4(0x280)]||0x78,_0x42cbcb=_0x4e31f0-_0x732605-_0x313777,_0x3874db=Math[_0x1645e4(0x1d4)](TIMELINE_CONFIG[_0x1645e4(0x1ee)],Math['min'](_0x42cbcb,TIMELINE_CONFIG[_0x1645e4(0x1c4)])),_0x3ce500=new Date(_0x1bc628[_0x1645e4(0x1cc)])['getTime'](),_0x2f76c3=_0x1bc628[_0x1645e4(0x1dc)]?new Date(_0x1bc628[_0x1645e4(0x1dc)])[_0x1645e4(0x130)]():Date[_0x1645e4(0x12c)](),_0x3f4a96={'start':_0x3ce500,'end':_0x2f76c3,'duration':_0x2f76c3-_0x3ce500},_0x83399a=new Map(),_0x11e2a3=[];for(const _0x14f17a of _0x4862e4){if(_0x14f17a['startedAt']){const _0x52db9c=new Date(_0x14f17a['startedAt'])[_0x1645e4(0x130)](),_0x21c057=_0x14f17a[_0x1645e4(0x18d)]?new Date(_0x14f17a[_0x1645e4(0x18d)])[_0x1645e4(0x130)]():Date[_0x1645e4(0x12c)](),_0x28891a={'start':_0x52db9c,'end':_0x21c057,'duration':_0x21c057-_0x52db9c};_0x83399a[_0x1645e4(0x208)](_0x14f17a['id'],_0x28891a),_0x11e2a3['push']({'name':_0x14f17a[_0x1645e4(0x2c0)],'state':_0x14f17a[_0x1645e4(0x276)]||_0x1645e4(0x2ae),'window':_0x28891a});}else _0x11e2a3['push']({'name':_0x14f17a[_0x1645e4(0x2c0)],'state':_0x14f17a[_0x1645e4(0x276)]||_0x1645e4(0x1f5),'window':undefined});}_0x11e2a3[_0x1645e4(0x169)]((_0x233975,_0x405638)=>{const _0x3d5aa4=_0x1645e4;if(!_0x233975['window'])return 0x1;if(!_0x405638[_0x3d5aa4(0x251)])return-0x1;return _0x233975[_0x3d5aa4(0x251)][_0x3d5aa4(0x1cb)]-_0x405638[_0x3d5aa4(0x251)][_0x3d5aa4(0x1cb)];});const _0x34d9cd=_0x11e2a3[_0x1645e4(0x245)],_0x44cf38=_0x34d9cd>TIMELINE_CONFIG[_0x1645e4(0x12a)];_0x44cf38&&_0x11e2a3[_0x1645e4(0x1fe)](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x4d8973=calculateTimeScale(_0x3f4a96,_0x3874db),_0xd10fcd=_0x1bc628['done']?_0x1bc628[_0x1645e4(0x2ce)]?a39_0x4c4e0a[_0x1645e4(0x1be)](_0x1645e4(0x2ce)):a39_0x4c4e0a[_0x1645e4(0x2ab)]('error'):a39_0x4c4e0a[_0x1645e4(0x203)](_0x1645e4(0x1e1)),_0x4d0de9=_0x1bc628[_0x1645e4(0x229)]?.['id'],_0x273201=_0x1bc628['sessionId'];let _0x478f0d;if(_0x4d0de9&&_0x273201){const _0x5b432c=getWorkflowAttemptUrl(_0x22262c,_0x4d0de9,_0x273201,_0x1bc628['id']);_0x478f0d=hyperlink(a39_0x4c4e0a[_0x1645e4(0x183)](_0x1bc628['id']),_0x5b432c);}else _0x478f0d=a39_0x4c4e0a[_0x1645e4(0x183)](_0x1bc628['id']);_0xc0bc9[_0x1645e4(0x25e)]('Attempt:\x20'+_0x478f0d+_0x1645e4(0x132)+_0xd10fcd+_0x1645e4(0x132)+formatElapsed(_0x3f4a96[_0x1645e4(0x1f8)]));if(_0x11e2a3[_0x1645e4(0x245)]>0x0){const _0x522f01=renderTimeAxis(_0x4d8973,_0x3874db),_0x45fb75=new Date(_0x3f4a96['start']),_0x1056f0=formatDate(_0x45fb75),_0x32d3bd=TIMELINE_CONFIG[_0x1645e4(0x188)]+TIMELINE_CONFIG[_0x1645e4(0x228)]+_0x732605,_0x4a0c19=_0x1056f0['padStart'](_0x32d3bd),_0x29b891=a39_0x4c4e0a['dim'](_0x4a0c19);_0xc0bc9[_0x1645e4(0x25e)](_0x29b891+'\x20'+_0x522f01);for(const _0x539ae3 of _0x11e2a3){_0xc0bc9['push'](renderTaskRow(_0x539ae3,_0x4d8973,_0x3874db,_0x732605));}const _0x53eb9a=calculateStats(_0x11e2a3);_0xc0bc9['push'](formatStats(_0x53eb9a)),_0x44cf38&&_0xc0bc9[_0x1645e4(0x25e)](a39_0x4c4e0a[_0x1645e4(0x19f)](_0x1645e4(0x206)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x1645e4(0x265)+_0x34d9cd+_0x1645e4(0x290))),_0xc0bc9[_0x1645e4(0x25e)](''),_0xc0bc9[_0x1645e4(0x25e)](a39_0x4c4e0a[_0x1645e4(0x183)](_0x1645e4(0x26c))+(_0x1645e4(0x282)+_0x1bc628['id']+_0x1645e4(0x291))+a39_0x4c4e0a[_0x1645e4(0x183)]('\x20to\x20see\x20detailed\x20logs'));}else _0xc0bc9[_0x1645e4(0x25e)](_0x1645e4(0x17e));return _0xc0bc9[_0x1645e4(0x175)]('\x0a');}[a39_0x4f7c3b(0x182)](_0x14d686,_0x220ef9){const _0x4ea80c=a39_0x4f7c3b,_0x5a88e6=new Date(_0x14d686[_0x4ea80c(0x1cc)])[_0x4ea80c(0x130)](),_0x1835dc=_0x14d686[_0x4ea80c(0x1dc)]?new Date(_0x14d686[_0x4ea80c(0x1dc)])[_0x4ea80c(0x130)]():Date[_0x4ea80c(0x12c)](),_0x5daad1=_0x1835dc-_0x5a88e6,_0x2e3885=[];for(const _0x110b57 of _0x220ef9){if(_0x110b57[_0x4ea80c(0x2b2)]){const _0x3f9d98=new Date(_0x110b57['startedAt'])['getTime'](),_0x1d0bd2=_0x110b57[_0x4ea80c(0x18d)]?new Date(_0x110b57[_0x4ea80c(0x18d)])['getTime']():Date['now']();_0x2e3885['push']({'name':_0x110b57[_0x4ea80c(0x2c0)],'state':_0x110b57[_0x4ea80c(0x276)]||_0x4ea80c(0x2ae),'window':{'start':_0x3f9d98,'end':_0x1d0bd2,'duration':_0x1d0bd2-_0x3f9d98}});}else _0x2e3885[_0x4ea80c(0x25e)]({'name':_0x110b57[_0x4ea80c(0x2c0)],'state':_0x110b57[_0x4ea80c(0x276)]||_0x4ea80c(0x1f5),'window':undefined});}const _0x69ab66=calculateStats(_0x2e3885);return{'attempt':{'id':_0x14d686['id'],'status':_0x14d686[_0x4ea80c(0x143)]?_0x14d686[_0x4ea80c(0x2ce)]?_0x4ea80c(0x2ce):_0x4ea80c(0x173):_0x4ea80c(0x1e1),'createdAt':_0x14d686[_0x4ea80c(0x1cc)],'finishedAt':_0x14d686[_0x4ea80c(0x1dc)],'duration_ms':_0x5daad1},'tasks':_0x2e3885['map'](_0x233141=>({'name':_0x233141[_0x4ea80c(0x181)],'state':_0x233141[_0x4ea80c(0x276)],'startedAt':_0x233141[_0x4ea80c(0x251)]?new Date(_0x233141[_0x4ea80c(0x251)][_0x4ea80c(0x1cb)])['toISOString']():null,'updatedAt':_0x233141[_0x4ea80c(0x251)]?new Date(_0x233141[_0x4ea80c(0x251)][_0x4ea80c(0x25c)])[_0x4ea80c(0x2b8)]():null,'duration_ms':_0x233141[_0x4ea80c(0x251)]?.[_0x4ea80c(0x1f8)]||null})),'stats':_0x69ab66};}}
|
|
1
|
+
const a41_0x43423c=a41_0x581e;(function(_0x596159,_0x33e8c0){const _0x50da2b=a41_0x581e,_0xde2b70=_0x596159();while(!![]){try{const _0x17314e=-parseInt(_0x50da2b(0x206))/0x1*(-parseInt(_0x50da2b(0xc5))/0x2)+parseInt(_0x50da2b(0x1eb))/0x3*(parseInt(_0x50da2b(0x248))/0x4)+parseInt(_0x50da2b(0x1db))/0x5+parseInt(_0x50da2b(0x209))/0x6+-parseInt(_0x50da2b(0x15c))/0x7*(parseInt(_0x50da2b(0x13e))/0x8)+-parseInt(_0x50da2b(0x1c3))/0x9+-parseInt(_0x50da2b(0x138))/0xa*(-parseInt(_0x50da2b(0x244))/0xb);if(_0x17314e===_0x33e8c0)break;else _0xde2b70['push'](_0xde2b70['shift']());}catch(_0x121ccf){_0xde2b70['push'](_0xde2b70['shift']());}}}(a41_0x1783,0x6cf7a));import a41_0x16ed5b from'chalk';import{existsSync}from'fs';import a41_0xd8e1c9 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a41_0x4935b9 from'prompts';function getAttemptStatusDisplay(_0x485d17){const _0x49083e=a41_0x581e;if(!_0x485d17)return{'icon':'⏳','text':''};const {done:_0x2746de,success:_0x194b71,cancelRequested:_0x3c1c4f}=_0x485d17;if(!_0x2746de)return _0x3c1c4f?{'icon':'🛑','text':a41_0x16ed5b[_0x49083e(0xb1)](_0x49083e(0xe4))}:{'icon':'🔄','text':a41_0x16ed5b[_0x49083e(0x109)](_0x49083e(0x213))};if(_0x194b71)return{'icon':'✅','text':a41_0x16ed5b[_0x49083e(0x126)](_0x49083e(0xac))};return{'icon':'❌','text':a41_0x16ed5b[_0x49083e(0x1f5)](_0x49083e(0x1bb))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x52396f,_0x4179d5,_0x5a4d8c=0x0){const _0x227e2b=a41_0x581e;return _0x52396f[_0x5a4d8c]||_0x4179d5[_0x227e2b(0x218)];}['requireProject'](_0x1b364a,_0x96e752,_0x4f0098=0x0){const _0x5d7bd2=a41_0x581e,_0x2f3f6d=this['resolveProject'](_0x1b364a,_0x96e752,_0x4f0098);if(!_0x2f3f6d)return console[_0x5d7bd2(0x1bb)](a41_0x16ed5b[_0x5d7bd2(0x1f5)](_0x5d7bd2(0x156)),_0x5d7bd2(0xb0)),console[_0x5d7bd2(0x1bb)](a41_0x16ed5b[_0x5d7bd2(0x201)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x2f3f6d;}[a41_0x43423c(0x1df)](_0x1fb571,_0x2b4593){const _0x1123f1=a41_0x43423c;if(_0x1fb571[0x0]){const _0x3e6082=_0x1fb571[0x0][_0x1123f1(0xd0)]('.');if(_0x3e6082['length']===0x1)return{'projectName':_0x3e6082[0x0],'workflowName':undefined};else return _0x3e6082['length']===0x2?{'projectName':_0x3e6082[0x0],'workflowName':_0x3e6082[0x1]}:(console['error'](a41_0x16ed5b[_0x1123f1(0x1f5)](_0x1123f1(0x156)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x2b4593['workflowProject'],'workflowName':undefined};}[a41_0x43423c(0xfc)](_0x1534ff,_0x41890f,_0x2a38a7=0x0){const _0x23477e=a41_0x43423c;if(_0x1534ff[_0x2a38a7])return _0x1534ff[_0x2a38a7];if(_0x41890f[_0x23477e(0x218)]){const _0x3009da=a41_0xd8e1c9[_0x23477e(0x222)](process[_0x23477e(0x1f0)](),_0x23477e(0x232),_0x41890f[_0x23477e(0x218)]);if(existsSync(a41_0xd8e1c9[_0x23477e(0x222)](_0x3009da,'tdx.json')))return _0x3009da;}return undefined;}async[a41_0x43423c(0x1c6)](_0x5d344e,_0x5c6835,_0x363a9b){const _0x561463=a41_0x43423c;try{const _0x2392a5=await _0x5d344e[_0x561463(0x1ab)][_0x561463(0x232)](_0x5c6835,{'limit':0x1});if(_0x2392a5['length']>0x0){const _0x40740b=_0x2392a5[0x0]['id'],_0x4feae0=getWorkflowUrl(_0x363a9b,_0x40740b);console[_0x561463(0x1bb)](_0x561463(0x133)+a41_0x16ed5b[_0x561463(0x15e)](_0x4feae0));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a41_0x43423c(0x1a6);['description']=a41_0x43423c(0x149);async[a41_0x43423c(0xd8)](_0x54619c){const _0x3a9607=a41_0x43423c,{options:_0x391324,args:_0x20bd7d,tdx:_0x4426e2}=_0x54619c,_0x211619=_0x20bd7d[0x0],_0x2c56c1=_0x391324[_0x3a9607(0xc8)];if(_0x2c56c1)return saveSessionContext({'workflow_project':undefined},_0x391324[_0x3a9607(0xdc)]),console[_0x3a9607(0x24a)](a41_0x16ed5b[_0x3a9607(0x126)]('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x211619)return console['error'](a41_0x16ed5b[_0x3a9607(0x1f5)](_0x3a9607(0x156)),_0x3a9607(0xb0)),console['error'](a41_0x16ed5b['dim']('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x3a9607(0x1bb)](a41_0x16ed5b[_0x3a9607(0x201)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x4091e4=await withSpinner('Resolving\x20project\x20\x27'+_0x211619+_0x3a9607(0x14f),()=>_0x4426e2[_0x3a9607(0x1ab)][_0x3a9607(0x1f8)](_0x211619),{'verbose':_0x391324[_0x3a9607(0xd5)]}),{name:_0x55d041}=_0x4091e4['data'];return saveSessionContext({'workflow_project':_0x55d041},_0x391324['session']),console[_0x3a9607(0x24a)](a41_0x16ed5b[_0x3a9607(0x126)](_0x3a9607(0xba)+a41_0x16ed5b[_0x3a9607(0x15e)](_0x55d041))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a41_0x43423c(0x103)]='workflow:projects';[a41_0x43423c(0x105)]='List\x20all\x20workflow\x20projects';async[a41_0x43423c(0xd8)](_0x3171b9){const _0x4ccf58=a41_0x43423c,{options:_0x395061,args:_0x2b0cc9,tdx:_0x449e4f}=_0x3171b9,_0xa17371=_0x2b0cc9[0x0];_0x395061[_0x4ccf58(0xd5)]&&_0xa17371&&console[_0x4ccf58(0x1bb)](_0x4ccf58(0x182)+_0xa17371);const _0x112d1e=await withSpinner(_0x4ccf58(0x1a2),()=>_0x449e4f[_0x4ccf58(0x1ab)][_0x4ccf58(0x104)](_0xa17371,{'limit':_0x395061['limit']}),{'verbose':_0x395061[_0x4ccf58(0xd5)]});let _0x444a1d=_0x112d1e[_0x4ccf58(0x225)];_0x444a1d[_0x4ccf58(0xe2)]((_0x488c29,_0x47cdbd)=>_0x488c29[_0x4ccf58(0x103)][_0x4ccf58(0x186)](_0x47cdbd[_0x4ccf58(0x103)]));const _0x5a92f9=_0x395061[_0x4ccf58(0x11e)]||0x64,_0xb5f2f3=_0x444a1d[_0x4ccf58(0xc4)]>=_0x5a92f9?a41_0x16ed5b[_0x4ccf58(0x201)](_0x4ccf58(0xf9)):'';console[_0x4ccf58(0x1bb)]('✔\x20Found\x20'+_0x444a1d[_0x4ccf58(0xc4)]+_0x4ccf58(0xd6)+(_0x444a1d['length']!==0x1?'s':'')+_0xb5f2f3);if(_0x395061[_0x4ccf58(0xe3)]==='json'||_0x395061[_0x4ccf58(0xe3)]===_0x4ccf58(0xcb)||_0x395061[_0x4ccf58(0xe3)]===_0x4ccf58(0x101))await handleSDKOutput(_0x444a1d,_0x395061);else{if(_0x444a1d[_0x4ccf58(0xc4)]===0x0)_0xa17371?console[_0x4ccf58(0x24a)]('No\x20projects\x20match\x20pattern:\x20'+_0xa17371):console['log'](_0x4ccf58(0x108));else{const _0x12bdd8=_0x444a1d['map'](_0x49a69d=>{const _0x40cbe0=_0x4ccf58,_0x59398f=_0x49a69d['metadata']?.[_0x40cbe0(0xf6)](_0x33ce4e=>_0x33ce4e[_0x40cbe0(0x158)]===_0x40cbe0(0x117)),_0x355fb3=_0x59398f?a41_0x16ed5b['dim'](_0x40cbe0(0xe8)):'';return _0x40cbe0(0x204)+_0x49a69d[_0x40cbe0(0x103)]+_0x355fb3;});await writeOutput(_0x12bdd8[_0x4ccf58(0x222)]('\x0a'),_0x395061[_0x4ccf58(0x1b6)],_0x4ccf58(0x1e9));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a41_0x43423c(0x103)]=a41_0x43423c(0x115);[a41_0x43423c(0x105)]=a41_0x43423c(0xcc);async[a41_0x43423c(0xd8)](_0x5f15b4){const _0x3cf6d5=a41_0x43423c,{options:_0x591aec,args:_0x30e418,tdx:_0x360b3b}=_0x5f15b4,_0x4d35e6=this[_0x3cf6d5(0x22e)](_0x30e418,_0x591aec);_0x591aec[_0x3cf6d5(0xd5)]&&_0x4d35e6&&console[_0x3cf6d5(0x1bb)](_0x3cf6d5(0x205)+_0x4d35e6);const _0x415b03=await withSpinner(_0x3cf6d5(0x110),()=>_0x360b3b[_0x3cf6d5(0x1ab)][_0x3cf6d5(0x232)](_0x4d35e6,{'limit':_0x591aec[_0x3cf6d5(0x11e)]}),{'verbose':_0x591aec[_0x3cf6d5(0xd5)]});let _0x49b4d7=_0x415b03[_0x3cf6d5(0x225)];_0x49b4d7[_0x3cf6d5(0xe2)]((_0x3c76c0,_0x304c0f)=>{const _0x5f51bf=_0x3cf6d5,_0x547bb6=_0x3c76c0[_0x5f51bf(0x103)]['localeCompare'](_0x304c0f[_0x5f51bf(0x103)]);if(_0x547bb6!==0x0)return _0x547bb6;return(_0x3c76c0[_0x5f51bf(0x1b4)]?.['name']||'')[_0x5f51bf(0x186)](_0x304c0f['project']?.[_0x5f51bf(0x103)]||'');});const _0x92b77f=_0x591aec[_0x3cf6d5(0x11e)]||0x64,_0x6eb9ca=_0x49b4d7['length']>=_0x92b77f?a41_0x16ed5b[_0x3cf6d5(0x201)](_0x3cf6d5(0xf9)):'';console[_0x3cf6d5(0x1bb)](_0x3cf6d5(0x21a)+_0x49b4d7[_0x3cf6d5(0xc4)]+'\x20workflow'+(_0x49b4d7[_0x3cf6d5(0xc4)]!==0x1?'s':'')+_0x6eb9ca);if(_0x591aec[_0x3cf6d5(0xe3)]===_0x3cf6d5(0x239)||_0x591aec[_0x3cf6d5(0xe3)]==='jsonl'||_0x591aec[_0x3cf6d5(0xe3)]===_0x3cf6d5(0x101))await handleSDKOutput(_0x49b4d7,_0x591aec);else{if(_0x49b4d7['length']===0x0)_0x4d35e6?console[_0x3cf6d5(0x24a)]('No\x20workflows\x20found\x20in\x20project:\x20'+_0x4d35e6):console[_0x3cf6d5(0x24a)](_0x3cf6d5(0x191));else{const _0x1a9109=_0x591aec['site'],_0x191d4a=_0x49b4d7[_0x3cf6d5(0x163)](_0x3e9d13=>{const _0x1138f8=_0x3cf6d5,_0x125e19=a41_0x16ed5b[_0x1138f8(0x201)]('#'+_0x3e9d13['id']),_0x184c20=hyperlink(_0x125e19,getWorkflowUrl(_0x1a9109,_0x3e9d13['id'])),_0x443c8d=_0x3e9d13[_0x1138f8(0x1b4)]?.['name']?a41_0x16ed5b['dim']('\x20('+_0x3e9d13[_0x1138f8(0x1b4)][_0x1138f8(0x103)]+')'):'';return _0x1138f8(0x130)+_0x184c20+'\x20'+_0x3e9d13[_0x1138f8(0x103)]+_0x443c8d;});await writeOutput(_0x191d4a[_0x3cf6d5(0x222)]('\x0a'),_0x591aec['output'],_0x3cf6d5(0x1e9));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a41_0x43423c(0x103)]=a41_0x43423c(0x1dc);[a41_0x43423c(0x105)]=a41_0x43423c(0x249);async[a41_0x43423c(0xd8)](_0xa7a782){const _0x264959=a41_0x43423c,{options:_0x27d707,args:_0x463224,tdx:_0x231e04}=_0xa7a782,_0x327dfc=this[_0x264959(0x1df)](_0x463224,_0x27d707);if(!_0x327dfc)return 0x1;const {projectName:_0x46a6fb,workflowName:_0x19c156}=_0x327dfc;if(_0x27d707[_0x264959(0xd5)]){if(_0x46a6fb&&_0x19c156)console[_0x264959(0x1bb)](_0x264959(0x10b)+_0x46a6fb+'.'+_0x19c156);else _0x46a6fb&&console['error']('Filter:\x20project='+_0x46a6fb);const _0x49d9f9=_0x27d707[_0x264959(0x1ac)];_0x49d9f9&&console[_0x264959(0x1bb)](_0x264959(0x12a)+_0x49d9f9);}let _0x16dc65=0x28;if(process[_0x264959(0x154)][_0x264959(0x1ce)]&&!_0x27d707['output']&&!_0x27d707[_0x264959(0xe3)]){const _0x4ad96=process[_0x264959(0x154)]['rows']||0x28;_0x16dc65=Math[_0x264959(0x187)](0x14,Math['floor'](_0x4ad96*0x2/0x3));}const _0x2a42e6=_0x27d707[_0x264959(0x11e)]||_0x16dc65,_0x365234=await withSpinner(_0x264959(0x1fc),()=>_0x231e04[_0x264959(0x1ab)][_0x264959(0xb2)]({'projectName':_0x46a6fb,'workflowName':_0x19c156,'status':_0x27d707[_0x264959(0x1ac)],'fromTime':_0x27d707[_0x264959(0x11f)],'toTime':_0x27d707['to'],'limit':_0x2a42e6}),{'verbose':_0x27d707[_0x264959(0xd5)]}),_0x945fed=_0x365234[_0x264959(0x225)];_0x945fed[_0x264959(0xe2)]((_0x1ddd88,_0x27687a)=>{const _0x41358=_0x264959,_0x142721=_0x1ddd88[_0x41358(0x1c2)]||'',_0x431efd=_0x27687a['sessionTime']||'';return _0x431efd['localeCompare'](_0x142721);});_0x945fed[_0x264959(0xc4)]>=_0x2a42e6?console[_0x264959(0x1bb)](_0x264959(0x11a)+_0x945fed['length']+_0x264959(0x19f)+a41_0x16ed5b[_0x264959(0x201)](_0x264959(0xdf))):console[_0x264959(0x1bb)](_0x264959(0x21a)+_0x945fed[_0x264959(0xc4)]+'\x20session'+(_0x945fed[_0x264959(0xc4)]!==0x1?'s':''));if(_0x27d707[_0x264959(0xe3)]===_0x264959(0x239)||_0x27d707[_0x264959(0xe3)]===_0x264959(0xcb)||_0x27d707[_0x264959(0xe3)]===_0x264959(0x101))await handleSDKOutput(_0x945fed,_0x27d707);else{if(!process[_0x264959(0x154)][_0x264959(0x1ce)]||_0x27d707[_0x264959(0x1b6)]){if(_0x945fed[_0x264959(0xc4)]===0x0){if(_0x46a6fb&&_0x19c156)console[_0x264959(0x24a)](_0x264959(0x198)+_0x46a6fb+'.'+_0x19c156);else _0x46a6fb?console[_0x264959(0x24a)](_0x264959(0x1b0)+_0x46a6fb):console[_0x264959(0x24a)](_0x264959(0x136));}else{const _0x551029=_0x27d707[_0x264959(0x24c)],_0x534772=this[_0x264959(0x13f)](_0x945fed,_0x551029);_0x27d707[_0x264959(0x1b6)]?await writeOutput(_0x534772,_0x27d707['output'],'list'):console[_0x264959(0x24a)](_0x534772);}!_0x46a6fb&&(console[_0x264959(0x1bb)](''),console[_0x264959(0x1bb)](a41_0x16ed5b['dim']('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x264959(0x1bb)](a41_0x16ed5b[_0x264959(0x201)](_0x264959(0xe0))+'or'+a41_0x16ed5b['dim'](_0x264959(0x183))));}else{if(_0x945fed[_0x264959(0xc4)]===0x0){if(_0x46a6fb&&_0x19c156)console[_0x264959(0x24a)](_0x264959(0x198)+_0x46a6fb+'.'+_0x19c156);else _0x46a6fb?console[_0x264959(0x24a)](_0x264959(0x1b0)+_0x46a6fb):console[_0x264959(0x24a)](_0x264959(0x136));}else await this[_0x264959(0xdb)](_0x945fed,_0xa7a782,_0x46a6fb);}}return 0x0;}[a41_0x43423c(0x13f)](_0x551957,_0x273cb0){const _0x365d90=a41_0x43423c,_0x38de0b=[],_0x12ea3d=new Map();let _0x95e857=Infinity,_0x5ca677=-Infinity;for(const _0x2898a7 of _0x551957){if(_0x2898a7[_0x365d90(0x16d)]?.[_0x365d90(0x12f)]){const _0x4ccb3a=new Date(_0x2898a7[_0x365d90(0x16d)][_0x365d90(0x12f)])[_0x365d90(0xad)](),_0x40a044=_0x2898a7['lastAttempt'][_0x365d90(0x1fe)]?new Date(_0x2898a7[_0x365d90(0x16d)][_0x365d90(0x1fe)])[_0x365d90(0xad)]():Date[_0x365d90(0x22a)](),_0x7e4752=_0x2898a7[_0x365d90(0x1b4)]?.['name']||'(unknown)';!_0x12ea3d[_0x365d90(0x21b)](_0x7e4752)&&_0x12ea3d[_0x365d90(0xb8)](_0x7e4752,[]),_0x12ea3d[_0x365d90(0x1d1)](_0x7e4752)['push']({'session':_0x2898a7,'startTime':_0x4ccb3a,'endTime':_0x40a044,'duration':_0x40a044-_0x4ccb3a}),_0x95e857=Math['min'](_0x95e857,_0x4ccb3a),_0x5ca677=Math['max'](_0x5ca677,_0x40a044);}}if(_0x12ea3d[_0x365d90(0xc0)]===0x0)return _0x365d90(0x131);const _0x564829=process[_0x365d90(0x154)][_0x365d90(0x19e)]||0x78,_0x38acdc=0x1e,_0x529693=0x32,_0x22f7af=0x4,_0x193766=Math[_0x365d90(0xec)](_0x529693,Math['max'](_0x38acdc,Math[_0x365d90(0x174)](_0x564829*0.3))),_0x532213=_0x564829-_0x193766-TIMELINE_CONFIG[_0x365d90(0x241)]-0x3-_0x22f7af,_0x4f70e5=_0x5ca677-_0x95e857,_0x524e84=_0x4f70e5/_0x193766,_0x3cdc00=renderTimeAxis({'startTime':_0x95e857,'endTime':_0x5ca677,'durationMs':_0x4f70e5,'msPerChar':_0x524e84},_0x193766),_0x10afd9=[];for(const _0x3f3288 of _0x12ea3d[_0x365d90(0x215)]()){_0x10afd9[_0x365d90(0x179)](..._0x3f3288);}_0x10afd9[_0x365d90(0xe2)]((_0x420a3f,_0x506066)=>_0x506066['startTime']-_0x420a3f['startTime']);const _0x4d6a6e=new Date(_0x95e857),_0x206d67=formatDate(_0x4d6a6e),_0x188f24=_0x22f7af+TIMELINE_CONFIG[_0x365d90(0x220)]+TIMELINE_CONFIG['ICON_SPACING']+_0x532213,_0x34dc6d='\x20'[_0x365d90(0x11d)](_0x188f24-_0x206d67[_0x365d90(0xc4)]),_0x58aa0b=_0x34dc6d+a41_0x16ed5b[_0x365d90(0x201)](_0x206d67)+'\x20'+_0x3cdc00;_0x38de0b[_0x365d90(0x179)](_0x58aa0b);const _0x2289fc=0x16;let _0x6c357c=0x0;for(const _0x5c1865 of _0x10afd9){const _0x8325e6=_0x5c1865['session']['project']?.[_0x365d90(0x103)]||'?',_0x54b069=Math[_0x365d90(0xec)](stringWidth(_0x8325e6),_0x2289fc);_0x6c357c=Math[_0x365d90(0x187)](_0x6c357c,_0x54b069);}for(const _0xd56f72 of _0x10afd9){const {session:_0x1e9d53,startTime:_0x1d2739,endTime:_0x4dd5ba,duration:_0xc4ea92}=_0xd56f72,_0x502c32=_0x1e9d53[_0x365d90(0x1b4)]?.['id'],_0x1a6521=_0x1e9d53['id'],_0x308d82=_0x1e9d53[_0x365d90(0x1b4)]?.[_0x365d90(0x103)]||'?',_0x4f4000=_0x1e9d53[_0x365d90(0x1ab)]?.[_0x365d90(0x103)]||'?';let _0x58d845,_0xc2ee85;if(_0x1e9d53[_0x365d90(0x16d)]){const _0x5b6ad6=_0x1e9d53[_0x365d90(0x16d)];!_0x5b6ad6[_0x365d90(0xed)]?(_0x58d845=_0x5b6ad6['cancelRequested']?'🛑':'🔄',_0xc2ee85=_0x5b6ad6['cancelRequested']?a41_0x16ed5b[_0x365d90(0xb1)]:a41_0x16ed5b[_0x365d90(0x109)]):(_0x58d845=_0x5b6ad6[_0x365d90(0xac)]?'✅':'❌',_0xc2ee85=_0x5b6ad6[_0x365d90(0xac)]?a41_0x16ed5b[_0x365d90(0x126)]:a41_0x16ed5b[_0x365d90(0x1f5)]);}else _0x58d845='⏳',_0xc2ee85=a41_0x16ed5b[_0x365d90(0x201)];const _0x12ab5e='#'+_0x1a6521,_0x21a5b6=_0x502c32?hyperlink(_0x12ab5e,getWorkflowSessionUrl(_0x273cb0,_0x502c32,_0x1a6521)):_0x12ab5e;let _0x5301ff=_0x308d82;stringWidth(_0x308d82)>_0x2289fc&&(_0x5301ff=_0x308d82['slice'](0x0,_0x2289fc-0x1)+'…');const _0x395876=a41_0x16ed5b['dim'](_0x5301ff),_0x238199=stringWidth(_0x5301ff),_0x5edc3d='\x20'[_0x365d90(0x11d)](_0x6c357c-stringWidth(_0x5301ff)+0x2),_0x34f0dc='('+formatElapsed(_0xc4ea92)+')',_0x551e15=stringWidth(_0x34f0dc),_0x40dcfa=stringWidth(_0x12ab5e),_0x2dbc5c=_0x40dcfa+0x1+_0x238199+_0x5edc3d[_0x365d90(0xc4)],_0x7f2043=_0x532213-_0x2dbc5c-_0x551e15-0x1-0x8;let _0x26134a=_0x4f4000;stringWidth(_0x26134a)>_0x7f2043&&(_0x26134a=_0x26134a[_0x365d90(0x14b)](0x0,_0x7f2043-0x1)+'…');const _0x96e920=_0x21a5b6+'\x20'+_0x395876+_0x5edc3d+_0x26134a,_0x26feed=stringWidth(_0x96e920),_0x51bb8a=_0x532213-_0x26feed-_0x551e15,_0x12d31d=_0x96e920+'\x20'[_0x365d90(0x11d)](Math[_0x365d90(0x187)](0x1,_0x51bb8a))+a41_0x16ed5b[_0x365d90(0x201)](_0x34f0dc),_0x262c69=Math[_0x365d90(0x174)]((_0x1d2739-_0x95e857)/_0x524e84),_0x3ae2cd=Math[_0x365d90(0x174)]((_0x4dd5ba-_0x95e857)/_0x524e84),_0x3424c=Math['max'](_0x262c69+0x1,_0x3ae2cd),_0x5e8145=new Array(_0x193766)[_0x365d90(0xbc)]('\x20');for(let _0x1f769d=_0x262c69;_0x1f769d<Math[_0x365d90(0xec)](_0x3424c,_0x193766);_0x1f769d++){_0x5e8145[_0x1f769d]='─';}const _0x2f07d8=_0x5e8145[_0x365d90(0x163)](_0x586bb4=>_0x586bb4==='\x20'?'\x20':_0xc2ee85(_0x586bb4))[_0x365d90(0x222)]('');_0x38de0b[_0x365d90(0x179)](_0x58d845+'\x20'+_0x12d31d+'│'+_0x2f07d8+'│');}return _0x38de0b[_0x365d90(0x222)]('\x0a');}async[a41_0x43423c(0xdb)](_0x4589f6,_0x500e7c,_0x201387){const _0xc9e80b=a41_0x43423c,{options:_0x2c5c6c,tdx:_0x982eb3}=_0x500e7c,_0x5ef5cb=_0x2c5c6c[_0xc9e80b(0x24c)],{timelineRows:_0x2a8d1b,timeAxisHeader:_0x18266e}=this[_0xc9e80b(0x116)](_0x4589f6,_0x5ef5cb),_0x44af1d=_0x2a8d1b['filter'](_0x50a202=>_0x50a202['attemptId']);if(_0x44af1d['length']===0x0){const _0x30e8e6=this[_0xc9e80b(0x13f)](_0x4589f6,_0x5ef5cb);console[_0xc9e80b(0x24a)](_0x30e8e6);!_0x201387&&(console[_0xc9e80b(0x1bb)](''),console[_0xc9e80b(0x1bb)](a41_0x16ed5b[_0xc9e80b(0x201)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0xc9e80b(0x1bb)](a41_0x16ed5b['dim'](_0xc9e80b(0xe0))+'or'+a41_0x16ed5b['dim']('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0x18266e&&console[_0xc9e80b(0x24a)](_0x18266e);const _0x33eefe=_0x2a8d1b['filter'](_0x592636=>_0x592636[_0xc9e80b(0x224)])[_0xc9e80b(0x163)](_0x21d187=>({'title':_0x21d187[_0xc9e80b(0x129)],'value':_0x21d187[_0xc9e80b(0x224)]})),_0x8e165=process[_0xc9e80b(0x154)][_0xc9e80b(0x11c)]||0x3c,_0x32c4b4=Math[_0xc9e80b(0x187)](0x28,Math['floor'](_0x8e165*0x2/0x3)),_0x5e2d1f=await a41_0x4935b9({'type':_0xc9e80b(0xf3),'name':_0xc9e80b(0x224),'message':_0xc9e80b(0x10e),'choices':_0x33eefe,'initial':-0x1,'limit':_0x32c4b4,'clearFirst':!![],'fallback':{'title':_0xc9e80b(0xcf),'value':null},'suggest':(_0x594281,_0x4373df)=>{const _0x2de9ad=_0xc9e80b;if(!_0x594281)return Promise[_0x2de9ad(0x13a)](_0x4373df);const _0x4cf8d3=_0x4373df['filter'](_0x303a2f=>{const _0x30caf3=_0x2de9ad,_0x41e184=_0x303a2f;return _0x41e184[_0x30caf3(0xa6)]['toLowerCase']()[_0x30caf3(0x159)](_0x594281['toLowerCase']());});return Promise[_0x2de9ad(0x13a)](_0x4cf8d3);}}),_0x4028ed=()=>{const _0x1aee86=_0xc9e80b;process['stdout'][_0x1aee86(0x181)](_0x1aee86(0x1ba)),process['stdout'][_0x1aee86(0x181)](_0x1aee86(0x1ba)),process[_0x1aee86(0x154)][_0x1aee86(0x181)](_0x1aee86(0x1ba));},_0x4b9e3f=_0x5e2d1f&&_0x5e2d1f[_0xc9e80b(0x224)]&&_0x5e2d1f[_0xc9e80b(0x224)]!==null&&_0x5e2d1f[_0xc9e80b(0x224)]['trim']()!=='';if(!_0x4b9e3f){_0x4028ed(),console['log'](a41_0x16ed5b[_0xc9e80b(0x201)]('Cancelled'));return;}_0x4028ed();const _0xd8948b=_0x4589f6[_0xc9e80b(0xeb)](_0x133854=>_0x133854[_0xc9e80b(0x16d)]?.['id']===_0x5e2d1f[_0xc9e80b(0x224)]);if(_0xd8948b){const _0x673739=_0xd8948b[_0xc9e80b(0x1b4)]?.[_0xc9e80b(0x103)]||'?',_0x50e750=_0xd8948b[_0xc9e80b(0x1ab)]?.[_0xc9e80b(0x103)]||'?';console[_0xc9e80b(0x24a)]('Project:\x20'+a41_0x16ed5b[_0xc9e80b(0x201)](_0x673739)+_0xc9e80b(0x175)+a41_0x16ed5b[_0xc9e80b(0x201)](_0x50e750));}const _0x39f179=new WorkflowTimelineCommand();await _0x39f179[_0xc9e80b(0xd8)]({'args':[],'options':{..._0x2c5c6c,'attemptId':_0x5e2d1f[_0xc9e80b(0x224)]},'tdx':_0x982eb3});}[a41_0x43423c(0x116)](_0x450753,_0x49ae01){const _0x3b1299=a41_0x43423c,_0x36102b=new Map();for(const _0x23fd71 of _0x450753){_0x23fd71['id']&&_0x23fd71[_0x3b1299(0x16d)]?.['id']&&_0x36102b[_0x3b1299(0xb8)](_0x23fd71['id'],_0x23fd71[_0x3b1299(0x16d)]['id']);}const _0x34bf7b=[];let _0x1061fc='';const _0x1b1021=this['renderSessionsTimeline'](_0x450753,_0x49ae01),_0x6e556a=_0x1b1021[_0x3b1299(0xd0)]('\x0a');for(const _0x411ffb of _0x6e556a){if(_0x411ffb[_0x3b1299(0xee)](_0x3b1299(0x1d9))||_0x411ffb[_0x3b1299(0x223)](/^\s+\d{4}-\d{2}-\d{2}/))_0x1061fc=_0x411ffb;else{if(_0x411ffb[_0x3b1299(0x223)](/^[✅❌🔄🛑⏳]/)){const _0x46107c=_0x411ffb['match'](/#(\d+)/),_0x4e9199=_0x46107c?_0x46107c[0x1]:null,_0x3c8dd7=_0x4e9199?_0x36102b['get'](_0x4e9199)||null:null,_0x29e75d=_0x450753[_0x3b1299(0xeb)](_0x3511fb=>_0x3511fb['id']===_0x4e9199),_0x256ab2=_0x29e75d?.[_0x3b1299(0x1b4)]?.['name']||'';_0x34bf7b[_0x3b1299(0x179)]({'displayLine':_0x411ffb,'attemptId':_0x3c8dd7,'projectName':_0x256ab2});}}}return{'timelineRows':_0x34bf7b,'timeAxisHeader':_0x1061fc};}}function a41_0x1783(){const _0x562e69=['slice','planned','workflow:upload','state','\x27...','context','targetDir','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','Writing\x20files...','stdout','white','Error:','Revision:\x20','key','includes','workflow:retry','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','1753717NZFvaf','No\x20workflow\x20tdx.json\x20found','cyan','\x20from\x20session\x20','follow','Session\x20','💡\x20Tip:\x20Use\x20','map','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','LABEL_MIN_SPACING','message','/attempt/','window','workflow:delete','Dry\x20run:\x20yes','startedAt','Deleting\x20secret...','lastAttempt','workflow:clone','Pushing\x20workflow\x20project...','\x20attempt','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Attempt\x20ID:\x20','basename','floor',',\x20Workflow:\x20','\x20task','\x22\x20already\x20exists\x20(ID:\x20','Using\x20attempt\x20','push','workflow:tasks','fromTask','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','tasks','Loading\x20sessions...','text','stringify','write','Pattern:\x20','\x20\x20tdx\x20wf\x20use\x20<project>','...','✔\x20Retry\x20started','localeCompare','max','\x20\x20Target:\x20','total','Loading\x20workflows...','padStart','Warning:','new','projectName','\x0aClone\x20\x22','changes','No\x20workflows\x20found','✔\x20Project:\x20','Project:\x20','workflow:timeline','🔄\x20','Source\x20directory:\x20','/sessions/','No\x20sessions\x20found\x20for:\x20','\x20\x20Project\x20ID:\x20','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Tip:\x20cd\x20to\x20workflows/','isNewProject','\x22\x20with\x20new\x20revision?','columns','\x20sessions\x20','\x0aDry\x20run\x20-\x20no\x20project\x20created','revision','Listing\x20workflow\x20projects...','icon','Fetching\x20log\x20files...','---\x20','workflow:use','Project\x20name:\x20','select','\x20tasks','sessionId','workflow','status','Error:\x20Invalid\x20parameter\x20format:\x20','Getting\x20attempt\x20tasks...','Starting\x20workflow\x20run...','No\x20sessions\x20found\x20in\x20project:\x20','pollTimeline','revision:\x20','\x27\x20from\x20project\x20\x27','project','No\x20attempts\x20found','output','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','toISOString','start','\x1b[1A\x1b[2K','error','Filter:\x20project=','TASK_NAME_WIDTH','tdx\x20wf\x20attempt\x20','keys','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','sessionTime','4169421uzaSbT','sourceProjectName','deleteSecret','showWorkflowConsoleUrl','renderSingleTimeline','✔\x20Deleted\x20project\x20','unchanged','MIN_TIMELINE_WIDTH','unknown','workflow:secrets:list','value','isTTY','Force:\x20yes','diff','get','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','getDate','From\x20task:\x20','end','download','Error:\x20Project\x20name\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','yes','2066100uACeiC','workflow:sessions','\x22\x20to\x20new\x20project\x20\x22','Include\x20retried:\x20yes','parseProjectWorkflowPattern','Workflow:\x20','session:','LABEL_WIDTH_DIVISOR','\x20deleted','projectId','Usage:\x20workflow:delete\x20<project-name-or-id>','fullName','\x0aPolling...\x20(','\x20has\x20no\x20attempts','list','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','3675noFFUh','getMonth','workflow:secrets:set','delete','Auto-selected\x20latest\x20session:\x20','cwd','renderTimeline','retrySession','fileSize','requireProject','red','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','MAX_TASKS_DISPLAY','resolveProjectId','buildTimelineData','fileCount','Latest\x20session\x20has\x20no\x20attempt','Listing\x20workflow\x20sessions...','durationMs','finishedAt','params','updatedAt','dim','MIN_LABEL_COUNT','readFile','📁\x20','Project\x20filter:\x20','16253OFKTIB','setSecret','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','1245750IVMlKp','Pull\x20workflow\x20project\x20to\x20local\x20folder','Select\x20a\x20workflow\x20to\x20run','Project\x20directory:\x20','\x0aDry\x20run\x20-\x20no\x20files\x20written','hasChanges','List\x20workflow\x20attempts','taskName','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','\x22?\x20This\x20cannot\x20be\x20undone.','running','\x20\x20Changes:\x20','values','parse','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','workflowProject','\x20logs','✔\x20Found\x20','has','\x20\x20Files\x20extracted:\x20','Loading\x20session...','Downloading\x20project\x20','Key\x20cannot\x20be\x20empty','ICON_WIDTH','stat','join','match','attemptId','data','skipValidation','executePushProject','retryAttemptName','\x20\x20Revision:\x20','now','MAX_POLL_ITERATIONS','path','workflow:attempt','resolveProject','Target\x20directory:\x20','Downloading\x20logs...','Pulling\x20project\x20','workflows','isArray','run','includeRetried','⚠\x20Showing\x20first\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Analyzing\x20project...','json','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Reason:\x20','newProjectName','\x0aDry\x20run\x20-\x20nothing\x20pushed','pullProject','workflow:push','relative','GUTTER','Show\x20specific\x20attempt\x20details','cancelRequested','77TPXSmT','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Parameters:\x20','Target:\x20','472yJjnGq','List\x20workflow\x20execution\x20sessions','log','✔\x20Pushed\x20','site','\x20to\x20see\x20detailed\x20logs','Params:\x20','No\x20workflow\x20sessions\x20found','startTime','getMinutes','\x20\x20Attempt\x20ID:\x20','Total:\x20','title','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','Select\x20a\x20task\x20to\x20view\x20logs:','isDirectory','\x0aFailed\x20to\x20fetch\x20attempt\x20data','filesExtracted','success','getTime','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','workflow:attempts','Project\x20name\x20is\x20required','yellow','sessions','workflow:pull','summary','Key:\x20','Cancelled','\x20modified','set','includeSubtasks','✔\x20Workflow\x20project\x20set\x20to:\x20','✔\x20Project\x20updated','fill','Deleting\x20project\x20','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','round','size','Session\x20time:\x20','Error:\x20Invalid\x20JSON\x20in\x20--params','\x20\x20Project:\x20','length','58VVSpTj','\x0a✔\x20Attempt\x20complete','group_error','clear','fs/promises','Updating\x20','jsonl','List\x20workflows','duration','newProjectId','No\x20matching\x20sessions\x20found','split','deleted','task','New\x20project\x20name:\x20','✔\x20New\x20project:\x20','verbose','\x20project','MAX_LABEL_COUNT','execute','utf-8','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','navigateSessionsInteractive','session','workflow:secrets:delete','param','(use\x20--limit\x20to\x20see\x20more)','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','\x20\x20Session\x20context\x20set\x20to:\x20','sort','format','canceling','✔\x20Pull\x20complete','executeCloneProject','dryRun','\x20(system)','Setting\x20secret...','Attempt:\x20','find','min','done','startsWith','filter','\x20-\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','applyPullProject','autocomplete','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','✔\x20Secret\x20\x27','some','\x20\x20Source:\x20','force','\x20(use\x20--limit\x20to\x20show\x20more)','\x20of\x20','Session\x20not\x20found:\x20','resolveProjectDir','trimEnd','all','\x20secret','Output\x20directory:\x20','table','retryAttempt','name','projects','description','substring','reason','No\x20workflow\x20projects\x20found','blue','Listing\x20workflow\x20attempts...','Filter:\x20','pending','Expected\x20format:\x20--param\x20key=value','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','\x20\x20New\x20attempt\x20ID:\x20','Listing\x20workflows...','\x0aApply\x20these\x20changes?','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','✔\x20Push\x20complete','Retrying\x20session...','workflow:workflows','generateSessionTimelineRows','sys','type','Show\x20logs\x20for\x20a\x20workflow\x20attempt','✔\x20Showing\x20','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','rows','repeat','limit','from','\x20\x20Session\x20ID:\x20','Select\x20a\x20session\x20to\x20view\x20timeline:','index','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','No\x20attempts\x20found\x20for:\x20','targetExists','green','splice','replace','displayLine','Status:\x20','prepareCloneProject','✔\x20Workflow\x20run\x20started','Error:\x20Attempt\x20ID\x20is\x20required','modified','createdAt','📋\x20','No\x20sessions\x20with\x20timing\x20information','.\x20Expected\x20format:\x20KEY=VALUE','\x20\x20Console:\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','No\x20sessions\x20found','Source\x20directory\x20is\x20required','248470ZgMgpr','Retry\x20a\x20session\x20or\x20attempt','resolve','attempt','sourceDir','✔\x20Downloaded\x20','16LtvwhA','renderSessionsTimeline','workflowName','Failed\x20to\x20fetch\x20attempt\x20data','\x20\x20Location:\x20','\x20unchanged','POLL_INTERVAL_MS','Error:\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','\x0a⚠\x20Project\x20\x22','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Validation:\x20skipped'];a41_0x1783=function(){return _0x562e69;};return a41_0x1783();}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a41_0x43423c(0x103)]=a41_0x43423c(0xaf);[a41_0x43423c(0x105)]=a41_0x43423c(0x20f);async[a41_0x43423c(0xd8)](_0x525329){const _0x51659c=a41_0x43423c,{options:_0x23f907,args:_0x56f369,tdx:_0x447f1e}=_0x525329,_0x42860a=this[_0x51659c(0x1df)](_0x56f369,_0x23f907);if(!_0x42860a)return 0x1;const {projectName:_0x1bb415,workflowName:_0x1529e1}=_0x42860a,_0x29e049=_0x23f907[_0x51659c(0x235)];if(_0x23f907[_0x51659c(0xd5)]){if(_0x1bb415&&_0x1529e1)console[_0x51659c(0x1bb)](_0x51659c(0x10b)+_0x1bb415+'.'+_0x1529e1);else _0x1bb415&&console['error'](_0x51659c(0x1bc)+_0x1bb415);_0x29e049&&console[_0x51659c(0x1bb)](_0x51659c(0x1de));}const _0xec2236=await withSpinner(_0x51659c(0x10a),()=>_0x447f1e[_0x51659c(0x1ab)]['attempts']({'projectName':_0x1bb415,'workflowName':_0x1529e1,'includeRetried':_0x29e049,'limit':_0x23f907[_0x51659c(0x11e)]}),{'verbose':_0x23f907['verbose']}),_0x5edef3=_0xec2236[_0x51659c(0x225)],_0x49e1bd=_0x23f907['limit']||0x64,_0x57d664=_0x5edef3[_0x51659c(0xc4)]>=_0x49e1bd?a41_0x16ed5b[_0x51659c(0x201)](_0x51659c(0xf9)):'';console[_0x51659c(0x1bb)](_0x51659c(0x21a)+_0x5edef3[_0x51659c(0xc4)]+_0x51659c(0x170)+(_0x5edef3[_0x51659c(0xc4)]!==0x1?'s':'')+_0x57d664);if(_0x23f907['format']==='json'||_0x23f907['format']==='jsonl'||_0x23f907['format']===_0x51659c(0x101))await handleSDKOutput(_0x5edef3,_0x23f907);else{if(_0x5edef3['length']===0x0){if(_0x1bb415&&_0x1529e1)console[_0x51659c(0x24a)](_0x51659c(0x124)+_0x1bb415+'.'+_0x1529e1);else _0x1bb415?console['log']('No\x20attempts\x20found\x20in\x20project:\x20'+_0x1bb415):console['log'](_0x51659c(0x1b5));}else{const _0x500e7f=_0x23f907['site'],_0x44fc4f=_0x5edef3[_0x51659c(0x163)](_0x3f3f07=>{const _0x556ada=_0x51659c,_0xd2ee8=a41_0x16ed5b[_0x556ada(0x201)]('#'+_0x3f3f07['id']),_0x405419=_0x3f3f07[_0x556ada(0x1b4)]?.['id'],_0x3cdab7=_0x3f3f07['session_id']||_0x3f3f07[_0x556ada(0x1aa)],_0x432637=_0x405419&&_0x3cdab7?hyperlink(_0xd2ee8,getWorkflowAttemptUrl(_0x500e7f,_0x405419,_0x3cdab7,_0x3f3f07['id'])):_0xd2ee8,{icon:_0x5eddd8,text:_0x99a6af}=getAttemptStatusDisplay(_0x3f3f07),_0x30562a=(_0x3f3f07[_0x556ada(0x1b4)]?.[_0x556ada(0x103)]||'?')+'.'+(_0x3f3f07['workflow']?.[_0x556ada(0x103)]||'?'),_0x22a2ad=_0x3f3f07['sessionTime']?a41_0x16ed5b[_0x556ada(0x201)](_0x3f3f07[_0x556ada(0x1c2)]):'';return(_0x432637+'\x20'+_0x5eddd8+(_0x99a6af?'\x20'+_0x99a6af:'')+'\x20'+_0x30562a+'\x20'+_0x22a2ad)[_0x556ada(0xfd)]();});await writeOutput(_0x44fc4f['join']('\x0a'),_0x23f907[_0x51659c(0x1b6)],_0x51659c(0x1e9));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a41_0x43423c(0x22d);['description']=a41_0x43423c(0x242);async[a41_0x43423c(0xd8)](_0x11050f){const _0x3a2302=a41_0x43423c,{options:_0x941e53,args:_0x4e31e5,tdx:_0xe45934}=_0x11050f,_0x29ba96=_0x4e31e5[0x0];if(!_0x29ba96)return console[_0x3a2302(0x1bb)](_0x3a2302(0x12d)),0x1;_0x941e53[_0x3a2302(0xd5)]&&console[_0x3a2302(0x1bb)](_0x3a2302(0x172)+_0x29ba96);const _0x56a73a=await withSpinner('Getting\x20attempt\x20details...',()=>_0xe45934[_0x3a2302(0x1ab)][_0x3a2302(0x13b)](_0x29ba96),{'verbose':_0x941e53[_0x3a2302(0xd5)]}),_0x3d3a01=_0x56a73a[_0x3a2302(0x225)];let _0x4a5f24;!_0x3d3a01['done']?_0x4a5f24=_0x3d3a01[_0x3a2302(0x243)]?_0x3a2302(0xe4):'running':_0x4a5f24=_0x3d3a01[_0x3a2302(0xac)]?_0x3a2302(0xac):_0x3a2302(0x1bb);let _0x1f3501;if(_0x3d3a01['createdAt']&&_0x3d3a01['finishedAt']){const _0x414a7b=new Date(_0x3d3a01[_0x3a2302(0x12f)])[_0x3a2302(0xad)](),_0x199a01=new Date(_0x3d3a01[_0x3a2302(0x1fe)])[_0x3a2302(0xad)]();_0x1f3501=Math[_0x3a2302(0xbf)]((_0x199a01-_0x414a7b)/0x3e8);}const _0x31c982={'attempt_id':_0x3d3a01['id'],'status':_0x4a5f24,..._0x3d3a01['index']!==undefined&&{'index':_0x3d3a01[_0x3a2302(0x122)]},..._0x3d3a01[_0x3a2302(0x1b4)]&&{'project':_0x3d3a01[_0x3a2302(0x1b4)][_0x3a2302(0x103)]},..._0x3d3a01[_0x3a2302(0x1ab)]&&{'workflow':_0x3d3a01[_0x3a2302(0x1ab)]['name']},..._0x3d3a01[_0x3a2302(0x1aa)]&&{'session_id':_0x3d3a01[_0x3a2302(0x1aa)]},..._0x3d3a01[_0x3a2302(0x1c2)]&&{'session_time':_0x3d3a01[_0x3a2302(0x1c2)]},..._0x3d3a01[_0x3a2302(0x228)]&&{'retry_attempt':_0x3d3a01[_0x3a2302(0x228)]},..._0x1f3501!==undefined&&{'duration_sec':_0x1f3501},..._0x3d3a01[_0x3a2302(0x12f)]&&{'created_at':_0x3d3a01['createdAt']},..._0x3d3a01['finishedAt']&&{'finished_at':_0x3d3a01['finishedAt']},...Object[_0x3a2302(0x1bf)](_0x3d3a01['params'])[_0x3a2302(0xc4)]>0x0&&{'params':_0x3d3a01[_0x3a2302(0x1ff)]}};return await handleSingleObjectOutput(_0x31c982,_0x941e53),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a41_0x43423c(0x103)]=a41_0x43423c(0x17a);[a41_0x43423c(0x105)]='Show\x20tasks\x20for\x20an\x20attempt';async[a41_0x43423c(0xd8)](_0x112910){const _0x14f751=a41_0x43423c,{options:_0x4ecb47,args:_0x141fc5,tdx:_0x13f178}=_0x112910,_0x495610=_0x141fc5[0x0];if(!_0x495610)return console[_0x14f751(0x1bb)](_0x14f751(0x12d)),0x1;const _0x4741d2=_0x4ecb47[_0x14f751(0xb9)];_0x4ecb47[_0x14f751(0xd5)]&&(console[_0x14f751(0x1bb)](_0x14f751(0x172)+_0x495610),_0x4741d2&&console[_0x14f751(0x1bb)]('Including\x20subtasks:\x20yes'));const _0x2bcc46=await withSpinner(_0x14f751(0x1ae),()=>_0x13f178[_0x14f751(0x1ab)][_0x14f751(0x17d)](_0x495610,_0x4741d2||![]),{'verbose':_0x4ecb47[_0x14f751(0xd5)]}),_0x25df4f=_0x2bcc46['data'];return console[_0x14f751(0x1bb)](_0x14f751(0x21a)+_0x25df4f['length']+_0x14f751(0x176)+(_0x25df4f[_0x14f751(0xc4)]!==0x1?'s':'')),await handleSDKOutput(_0x25df4f,_0x4ecb47),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a41_0x43423c(0x103)]='workflow:logs';[a41_0x43423c(0x105)]=a41_0x43423c(0x119);async[a41_0x43423c(0xd8)](_0x14067f){const _0x2a8f46=a41_0x43423c,{options:_0x55fc78,args:_0x220774,tdx:_0x548cc5}=_0x14067f,_0x599597=_0x220774[0x0];let _0x6b663a=_0x220774[0x1];if(!_0x599597)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x55fc78[_0x2a8f46(0xd5)]&&(console[_0x2a8f46(0x1bb)](_0x2a8f46(0x172)+_0x599597),_0x6b663a&&console[_0x2a8f46(0x1bb)]('Task\x20name:\x20'+_0x6b663a));const _0x1b46ae=await withSpinner(_0x2a8f46(0x1a4),()=>_0x548cc5[_0x2a8f46(0x1ab)]['logFiles'](_0x599597,_0x6b663a),{'verbose':_0x55fc78['verbose']}),_0x4932b9=_0x1b46ae[_0x2a8f46(0x225)];if(_0x4932b9[_0x2a8f46(0xc4)]===0x0)return console[_0x2a8f46(0x1bb)](_0x2a8f46(0x134)),0x0;if(!_0x6b663a&&(_0x55fc78[_0x2a8f46(0x239)]||_0x55fc78[_0x2a8f46(0xe3)]))return await handleSDKOutput(_0x4932b9,_0x55fc78),0x0;if(!_0x6b663a){const _0x1eb57e=_0x4932b9[_0x2a8f46(0x163)](_0x5be0d6=>({'title':_0x5be0d6[_0x2a8f46(0x210)]+'\x20('+formatBytes(_0x5be0d6[_0x2a8f46(0x1f3)])+')','value':_0x5be0d6[_0x2a8f46(0x210)]})),_0x38bd5d=await a41_0x4935b9({'type':'select','name':_0x2a8f46(0xd2),'message':_0x2a8f46(0xa8),'choices':_0x1eb57e});if(!_0x38bd5d[_0x2a8f46(0xd2)])return console[_0x2a8f46(0x1bb)](_0x2a8f46(0xb6)),0x0;_0x6b663a=_0x38bd5d[_0x2a8f46(0xd2)];}const _0x533c50=await withSpinner(_0x2a8f46(0x230),()=>_0x548cc5[_0x2a8f46(0x1ab)]['logs'](_0x599597,_0x6b663a),{'verbose':_0x55fc78[_0x2a8f46(0xd5)]}),_0x47b859=_0x533c50[_0x2a8f46(0x225)];return _0x47b859?console['log'](_0x47b859):console[_0x2a8f46(0x1bb)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a41_0x43423c(0x103)]='workflow:kill';[a41_0x43423c(0x105)]='Kill\x20a\x20running\x20attempt';async['execute'](_0x8ab74f){const _0x2b6ddc=a41_0x43423c,{options:_0x5adf8a,args:_0x14af80,tdx:_0x407214}=_0x8ab74f,_0x4e2e7d=_0x14af80[0x0];if(!_0x4e2e7d)return console[_0x2b6ddc(0x1bb)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x153c70=_0x5adf8a[_0x2b6ddc(0x107)];_0x5adf8a[_0x2b6ddc(0xd5)]&&(console[_0x2b6ddc(0x1bb)](_0x2b6ddc(0x172)+_0x4e2e7d),_0x153c70&&console[_0x2b6ddc(0x1bb)](_0x2b6ddc(0x23b)+_0x153c70));if(!_0x5adf8a[_0x2b6ddc(0x1da)]){const _0x47024b=await confirmKey(_0x2b6ddc(0x171)+_0x4e2e7d+'?');if(!_0x47024b)return console[_0x2b6ddc(0x1bb)](_0x2b6ddc(0xb6)),0x0;}const _0x7f9552=await withSpinner('Killing\x20attempt...',()=>_0x407214[_0x2b6ddc(0x1ab)]['kill'](_0x4e2e7d,_0x153c70),{'verbose':_0x5adf8a['verbose']}),_0xe8416a=_0x7f9552[_0x2b6ddc(0x225)];return console[_0x2b6ddc(0x1bb)]('✔\x20'+_0xe8416a),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a41_0x43423c(0x15a);[a41_0x43423c(0x105)]=a41_0x43423c(0x139);async[a41_0x43423c(0xd8)](_0x14377f){const _0x1f1aca=a41_0x43423c,{options:_0x45ac63,args:_0x9d7877,tdx:_0x416d12}=_0x14377f,_0x212bb8=_0x9d7877[0x0];if(!_0x212bb8)return console['error'](_0x1f1aca(0x147)),console[_0x1f1aca(0x1bb)](_0x1f1aca(0x17c)),0x1;let _0x5d0425=![],_0x22191e=_0x212bb8;if(_0x212bb8[_0x1f1aca(0xee)](_0x1f1aca(0x1e1)))_0x5d0425=!![],_0x22191e=_0x212bb8[_0x1f1aca(0x106)](0x8);else{if(_0x212bb8['startsWith']('attempt:'))_0x5d0425=![],_0x22191e=_0x212bb8[_0x1f1aca(0x106)](0x8);else return console[_0x1f1aca(0x1bb)](_0x1f1aca(0x1c1)),console[_0x1f1aca(0x1bb)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x313bed=_0x45ac63[_0x1f1aca(0x17b)],_0x1b6966=_0x45ac63['resumeFrom'],_0x33c8cd=_0x45ac63[_0x1f1aca(0x1ff)],_0x4e5914=_0x45ac63[_0x1f1aca(0xf8)];_0x45ac63[_0x1f1aca(0xd5)]&&(console[_0x1f1aca(0x1bb)](_0x1f1aca(0x247)+(_0x5d0425?_0x1f1aca(0xdc):_0x1f1aca(0x13b))+'\x20'+_0x22191e),_0x313bed&&console[_0x1f1aca(0x1bb)](_0x1f1aca(0x1d5)+_0x313bed),_0x1b6966&&console[_0x1f1aca(0x1bb)]('Resume\x20from:\x20'+_0x1b6966),_0x33c8cd&&console['error'](_0x1f1aca(0x24e)+_0x33c8cd),_0x4e5914&&console[_0x1f1aca(0x1bb)](_0x1f1aca(0x1cf)));let _0x1a1556;if(_0x33c8cd)try{if(_0x33c8cd[_0x1f1aca(0xee)]('@')){const _0x164765=await import(_0x1f1aca(0xc9)),_0x206035=_0x33c8cd[_0x1f1aca(0x106)](0x1),_0x3d9fc3=await _0x164765[_0x1f1aca(0x203)](_0x206035,_0x1f1aca(0xd9));_0x1a1556=JSON['parse'](_0x3d9fc3);}else _0x1a1556=JSON[_0x1f1aca(0x216)](_0x33c8cd);}catch{return console[_0x1f1aca(0x1bb)](_0x1f1aca(0xc2)),0x1;}if(!_0x45ac63[_0x1f1aca(0x1da)]){const _0xabc982=await confirmKey(_0x1f1aca(0x1ea)+(_0x5d0425?_0x1f1aca(0xdc):'attempt')+'\x20'+_0x22191e+'?');if(!_0xabc982)return console[_0x1f1aca(0x1bb)](_0x1f1aca(0xb6)),0x0;}let _0x4412ab;_0x5d0425?_0x4412ab=await withSpinner(_0x1f1aca(0x114),()=>_0x416d12[_0x1f1aca(0x1ab)][_0x1f1aca(0x1f2)](_0x22191e,{'fromTask':_0x313bed,'retryParams':_0x1a1556}),{'verbose':_0x45ac63[_0x1f1aca(0xd5)]}):_0x4412ab=await withSpinner('Retrying\x20attempt...',()=>_0x416d12[_0x1f1aca(0x1ab)][_0x1f1aca(0x102)](_0x22191e,{'resumeFrom':_0x1b6966,'retryParams':_0x1a1556,'force':_0x4e5914}),{'verbose':_0x45ac63[_0x1f1aca(0xd5)]});const _0x132d04=_0x4412ab[_0x1f1aca(0x225)];return console[_0x1f1aca(0x1bb)](_0x1f1aca(0x185)),console[_0x1f1aca(0x1bb)](_0x1f1aca(0x10f)+_0x132d04[_0x1f1aca(0x224)]),console[_0x1f1aca(0x1bb)](_0x1f1aca(0x120)+_0x132d04[_0x1f1aca(0x1aa)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a41_0x43423c(0x103)]='workflow:run';[a41_0x43423c(0x105)]='Start\x20a\x20workflow\x20run';async['execute'](_0x2d70dc){const _0x304b3f=a41_0x43423c,{options:_0x214d27,args:_0x3c55c1,tdx:_0x27bda0}=_0x2d70dc;let _0x31a53a=_0x3c55c1[0x0];if(!_0x31a53a){const _0x46d31a=this[_0x304b3f(0x22e)]([],_0x214d27),_0x32fda3=await withSpinner(_0x304b3f(0x18a),()=>_0x27bda0[_0x304b3f(0x1ab)][_0x304b3f(0x232)](_0x46d31a,{'limit':_0x214d27['limit']}),{'verbose':_0x214d27['verbose']}),_0x168ba4=_0x32fda3[_0x304b3f(0x225)];if(_0x168ba4[_0x304b3f(0xc4)]===0x0)return console['error'](_0x304b3f(0x191)),!_0x46d31a&&console[_0x304b3f(0x1bb)](a41_0x16ed5b[_0x304b3f(0x201)](_0x304b3f(0x164))),0x1;const _0xe6c7d4=_0x168ba4[_0x304b3f(0x163)](_0x236a3b=>({'title':_0x236a3b[_0x304b3f(0x1b4)]?.[_0x304b3f(0x103)]+'.'+_0x236a3b[_0x304b3f(0x103)],'value':_0x236a3b[_0x304b3f(0x1b4)]?.['name']+'.'+_0x236a3b[_0x304b3f(0x103)],'description':_0x236a3b['revision']?_0x304b3f(0x1b2)+_0x236a3b[_0x304b3f(0x1a1)]:undefined})),_0x54db25=await a41_0x4935b9({'type':'select','name':_0x304b3f(0x1ab),'message':_0x304b3f(0x20b),'choices':_0xe6c7d4});if(!_0x54db25[_0x304b3f(0x1ab)])return 0x1;_0x31a53a=_0x54db25['workflow'];}if(!_0x31a53a[_0x304b3f(0x159)]('.')){const _0x4ba1c9=this['resolveProject']([],_0x214d27);if(_0x4ba1c9)_0x31a53a=_0x4ba1c9+'.'+_0x31a53a;else return console[_0x304b3f(0x1bb)](a41_0x16ed5b[_0x304b3f(0x1f5)](_0x304b3f(0x156)),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console['error'](a41_0x16ed5b[_0x304b3f(0x201)](_0x304b3f(0x164))),0x1;}const _0x565bbb=_0x214d27[_0x304b3f(0xde)],_0x3f4971=_0x214d27['sessionTime'],_0x537c85={};if(_0x565bbb&&Array[_0x304b3f(0x233)](_0x565bbb))for(const _0x9f5acd of _0x565bbb){const _0x687620=_0x9f5acd['indexOf']('=');if(_0x687620===-0x1)return console[_0x304b3f(0x1bb)](_0x304b3f(0x1ad)+_0x9f5acd),console[_0x304b3f(0x1bb)](_0x304b3f(0x10d)),0x1;const _0x590260=_0x9f5acd[_0x304b3f(0x106)](0x0,_0x687620),_0x558037=_0x9f5acd['substring'](_0x687620+0x1);try{_0x537c85[_0x590260]=JSON['parse'](_0x558037);}catch{_0x537c85[_0x590260]=_0x558037;}}_0x214d27[_0x304b3f(0xd5)]&&(console['error'](_0x304b3f(0x1e0)+_0x31a53a),Object[_0x304b3f(0x1bf)](_0x537c85)['length']>0x0&&console[_0x304b3f(0x1bb)](_0x304b3f(0x246)+JSON[_0x304b3f(0x180)](_0x537c85)),_0x3f4971&&console[_0x304b3f(0x1bb)](_0x304b3f(0xc1)+_0x3f4971));const _0x452778=await withSpinner(_0x304b3f(0x1af),()=>_0x27bda0['workflow'][_0x304b3f(0x234)](_0x31a53a,_0x537c85,{'sessionTime':_0x3f4971}),{'verbose':_0x214d27['verbose']}),_0x454a2c=_0x452778[_0x304b3f(0x225)];console[_0x304b3f(0x1bb)](_0x304b3f(0x12c)),console[_0x304b3f(0x1bb)](_0x304b3f(0x252)+_0x454a2c['id']),console['error'](_0x304b3f(0x120)+_0x454a2c[_0x304b3f(0x1aa)]),console[_0x304b3f(0x1bb)](_0x304b3f(0xc3)+_0x454a2c[_0x304b3f(0x1b4)]?.[_0x304b3f(0x103)]),console['error']('\x20\x20Workflow:\x20'+_0x454a2c[_0x304b3f(0x1ab)]?.['name']);if(_0x454a2c[_0x304b3f(0x1b4)]?.['id']&&_0x454a2c['sessionId']&&_0x454a2c['id']){const _0x9c5609=_0x214d27[_0x304b3f(0x24c)],_0x348792=getConsoleUrl(_0x9c5609,'/app/workflows/'+_0x454a2c['project']['id']+_0x304b3f(0x197)+_0x454a2c[_0x304b3f(0x1aa)]+_0x304b3f(0x167)+_0x454a2c['id']);console[_0x304b3f(0x1bb)](_0x304b3f(0x133)+a41_0x16ed5b[_0x304b3f(0x15e)](_0x348792));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a41_0x43423c(0x103)]='workflow:download';[a41_0x43423c(0x105)]=a41_0x43423c(0x146);async[a41_0x43423c(0xd8)](_0x2a1771){const _0x53f970=a41_0x43423c,{options:_0xf471ed,args:_0x45880b,tdx:_0x51c450}=_0x2a1771,_0x10740c=_0x45880b[0x0],_0x3bbec5=_0x45880b[0x1]||'.';if(!_0x10740c)return console[_0x53f970(0x1bb)](_0x53f970(0x1d8)),console[_0x53f970(0x1bb)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x14a9ee=_0xf471ed[_0x53f970(0x1a1)];_0xf471ed[_0x53f970(0xd5)]&&(console[_0x53f970(0x1bb)](_0x53f970(0x193)+_0x10740c),console['error'](_0x53f970(0x100)+_0x3bbec5),_0x14a9ee&&console[_0x53f970(0x1bb)](_0x53f970(0x157)+_0x14a9ee));const _0x37e6c1=await withSpinner(_0x53f970(0x21e)+_0x10740c+_0x53f970(0x184),()=>_0x51c450[_0x53f970(0x1ab)][_0x53f970(0x1d7)](_0x10740c,_0x3bbec5,{'revision':_0x14a9ee}),{'verbose':_0xf471ed['verbose']}),_0x589567=_0x37e6c1[_0x53f970(0x225)];return console[_0x53f970(0x1bb)](_0x53f970(0x13d)+_0x589567['projectName']),console[_0x53f970(0x1bb)](_0x53f970(0x229)+_0x589567[_0x53f970(0x1a1)]),console[_0x53f970(0x1bb)](_0x53f970(0x21c)+_0x589567[_0x53f970(0xab)]),console[_0x53f970(0x1bb)](_0x53f970(0x142)+_0x3bbec5+'/'+_0x589567[_0x53f970(0x18e)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a41_0x43423c(0x103)]=a41_0x43423c(0x14d);[a41_0x43423c(0x105)]=a41_0x43423c(0x1d2);async[a41_0x43423c(0xd8)](_0x3da3d0){const _0x8b475e=a41_0x43423c,{options:_0x569c1c,args:_0xe0a16a,tdx:_0x1059b4}=_0x3da3d0;let _0x4c9256='.',_0x5f2fc3=_0x569c1c[_0x8b475e(0x103)];if(_0xe0a16a[0x0]){const {promises:_0x2271bb}=await import('fs');try{const _0x232589=await _0x2271bb[_0x8b475e(0x221)](_0xe0a16a[0x0]);if(_0x232589[_0x8b475e(0xa9)]())_0x4c9256=_0xe0a16a[0x0];else return console['error'](_0x8b475e(0x145)+_0xe0a16a[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x5f2fc3=_0xe0a16a[0x0],_0x4c9256='.';}}const _0x3f0cdf=_0x569c1c['revision'],_0x10d56b=_0x569c1c[_0x8b475e(0x226)];_0x569c1c['verbose']&&(console[_0x8b475e(0x1bb)](_0x8b475e(0x20c)+_0x4c9256),_0x5f2fc3&&console[_0x8b475e(0x1bb)](_0x8b475e(0x1a7)+_0x5f2fc3),_0x3f0cdf&&console[_0x8b475e(0x1bb)](_0x8b475e(0x157)+_0x3f0cdf),_0x10d56b&&console[_0x8b475e(0x1bb)](_0x8b475e(0x14a)));const _0x25970c=await withSpinner(_0x8b475e(0x16f),()=>_0x1059b4[_0x8b475e(0x1ab)]['push'](_0x4c9256,{'projectName':_0x5f2fc3,'revision':_0x3f0cdf,'skipValidation':_0x10d56b}),{'verbose':_0x569c1c[_0x8b475e(0xd5)]}),_0x5377e8=_0x25970c[_0x8b475e(0x225)];return console['error'](_0x8b475e(0x24b)+_0x5377e8['projectName']),console['error']('\x20\x20Project\x20ID:\x20'+_0x5377e8[_0x8b475e(0x1e4)]),console['error'](_0x8b475e(0x229)+_0x5377e8[_0x8b475e(0x1a1)]),await this['showWorkflowConsoleUrl'](_0x1059b4,_0x5377e8[_0x8b475e(0x18e)],_0x569c1c[_0x8b475e(0x24c)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a41_0x43423c(0x103)]=a41_0x43423c(0xb3);[a41_0x43423c(0x105)]=a41_0x43423c(0x20a);async[a41_0x43423c(0xd8)](_0x46fd17){const _0x2fde4d=a41_0x43423c,{options:_0x12bcd9,args:_0x4936a5,tdx:_0x36d885}=_0x46fd17,_0x5b1501=_0x4936a5[0x0],_0x52a416=_0x4936a5[0x1];if(!_0x5b1501)return console['error'](a41_0x16ed5b[_0x2fde4d(0x1f5)](_0x2fde4d(0x156)),_0x2fde4d(0xb0)),console['error'](a41_0x16ed5b[_0x2fde4d(0x201)](_0x2fde4d(0xda))),0x1;const _0x267377=_0x12bcd9[_0x2fde4d(0x1a1)];_0x12bcd9[_0x2fde4d(0xd5)]&&(console['error'](_0x2fde4d(0x193)+_0x5b1501),_0x52a416&&console['error'](_0x2fde4d(0x22f)+_0x52a416),_0x267377&&console[_0x2fde4d(0x1bb)](_0x2fde4d(0x157)+_0x267377),_0x12bcd9[_0x2fde4d(0xe7)]&&console[_0x2fde4d(0x1bb)](_0x2fde4d(0x16a)));const _0x38fccf=await withSpinner(_0x2fde4d(0x231)+_0x5b1501+_0x2fde4d(0x184),()=>_0x36d885[_0x2fde4d(0x1ab)][_0x2fde4d(0x23e)](_0x5b1501,{'targetDir':_0x52a416,'revision':_0x267377}),{'verbose':_0x12bcd9[_0x2fde4d(0xd5)]}),_0x5de46f=_0x38fccf[_0x2fde4d(0x225)];_0x5de46f[_0x2fde4d(0x19c)]?console[_0x2fde4d(0x1bb)](_0x2fde4d(0xd4)+_0x5de46f[_0x2fde4d(0x18e)]):console[_0x2fde4d(0x1bb)](_0x2fde4d(0x192)+_0x5de46f[_0x2fde4d(0x18e)]);console[_0x2fde4d(0x1bb)](_0x2fde4d(0x229)+_0x5de46f[_0x2fde4d(0x1a1)]),console[_0x2fde4d(0x1bb)](_0x2fde4d(0x188)+(a41_0xd8e1c9[_0x2fde4d(0x240)](process['cwd'](),_0x5de46f[_0x2fde4d(0x151)])||'.')),console[_0x2fde4d(0x1bb)](_0x2fde4d(0x214)+a41_0x16ed5b[_0x2fde4d(0x126)]('+'+_0x5de46f[_0x2fde4d(0xb4)][_0x2fde4d(0x18d)]+'\x20new')+',\x20'+(a41_0x16ed5b[_0x2fde4d(0xb1)]('~'+_0x5de46f['summary'][_0x2fde4d(0x12e)]+_0x2fde4d(0xb7))+',\x20')+(a41_0x16ed5b[_0x2fde4d(0x1f5)]('-'+_0x5de46f[_0x2fde4d(0xb4)][_0x2fde4d(0xd1)]+_0x2fde4d(0x1e3))+',\x20')+(''+a41_0x16ed5b[_0x2fde4d(0x201)](_0x5de46f[_0x2fde4d(0xb4)][_0x2fde4d(0x1c9)]+'\x20unchanged')));for(const _0x575617 of _0x5de46f['changes']){_0x575617[_0x2fde4d(0x118)]==='modified'&&_0x575617['diff']&&(console[_0x2fde4d(0x1bb)]('\x0a'+a41_0x16ed5b[_0x2fde4d(0x15e)]('---\x20'+_0x575617[_0x2fde4d(0x22c)])),console[_0x2fde4d(0x1bb)](_0x575617[_0x2fde4d(0x1d0)]));}if(!_0x5de46f['hasChanges'])return saveSessionContext({'workflow_project':_0x5de46f[_0x2fde4d(0x18e)]},_0x12bcd9[_0x2fde4d(0xdc)]),console[_0x2fde4d(0x1bb)](a41_0x16ed5b[_0x2fde4d(0x126)]('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x2fde4d(0x1bb)](a41_0x16ed5b[_0x2fde4d(0x201)](_0x2fde4d(0xe1)+_0x5de46f[_0x2fde4d(0x18e)])),0x0;if(_0x12bcd9['dryRun'])return console['error'](a41_0x16ed5b[_0x2fde4d(0xb1)](_0x2fde4d(0x20d))),0x0;if(!_0x12bcd9[_0x2fde4d(0x1da)]){const _0x193e59=await confirmKey(_0x2fde4d(0x111));if(!_0x193e59)return console[_0x2fde4d(0x1bb)](_0x2fde4d(0xb6)),0x0;}await withSpinner(_0x2fde4d(0x153),()=>_0x36d885['workflow'][_0x2fde4d(0xf2)](_0x5de46f,{'revision':_0x267377}),{'verbose':_0x12bcd9[_0x2fde4d(0xd5)]}),saveSessionContext({'workflow_project':_0x5de46f[_0x2fde4d(0x18e)]},_0x12bcd9['session']),console[_0x2fde4d(0x1bb)](a41_0x16ed5b[_0x2fde4d(0x126)](_0x2fde4d(0xe5)));const _0x262137=a41_0xd8e1c9['relative'](process['cwd'](),_0x5de46f[_0x2fde4d(0x151)])||'.';return console[_0x2fde4d(0x1bb)](a41_0x16ed5b[_0x2fde4d(0x201)](_0x2fde4d(0x142)+_0x262137)),console[_0x2fde4d(0x1bb)](a41_0x16ed5b['dim'](_0x2fde4d(0xe1)+_0x5de46f[_0x2fde4d(0x18e)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a41_0x43423c(0x103)]=a41_0x43423c(0x23f);[a41_0x43423c(0x105)]=a41_0x43423c(0xbe);async[a41_0x43423c(0xd8)](_0x1a3561){const _0x3ecc11=a41_0x43423c,{options:_0x108ee0,args:_0x222faf,tdx:_0x2a2157}=_0x1a3561,_0x24f3ae=this['resolveProjectDir'](_0x222faf,_0x108ee0),_0x2c54d9=_0x108ee0[_0x3ecc11(0x1a1)],_0x2efcd0=_0x108ee0[_0x3ecc11(0x226)];_0x108ee0['verbose']&&(_0x24f3ae&&console[_0x3ecc11(0x1bb)](_0x3ecc11(0x196)+_0x24f3ae),_0x2c54d9&&console[_0x3ecc11(0x1bb)](_0x3ecc11(0x157)+_0x2c54d9),_0x108ee0[_0x3ecc11(0xe7)]&&console[_0x3ecc11(0x1bb)](_0x3ecc11(0x16a)),_0x2efcd0&&console[_0x3ecc11(0x1bb)](_0x3ecc11(0x14a)));let _0x18b89d;try{_0x18b89d=await withSpinner('Analyzing\x20changes...',()=>_0x2a2157[_0x3ecc11(0x1ab)]['preparePushProject']({'sourceDir':_0x24f3ae,'revision':_0x2c54d9,'skipValidation':_0x2efcd0}),{'verbose':_0x108ee0['verbose']});}catch(_0x3435be){if(_0x3435be instanceof Error&&_0x3435be[_0x3ecc11(0x166)][_0x3ecc11(0x159)](_0x3ecc11(0x15d)))return console[_0x3ecc11(0x1bb)](a41_0x16ed5b['red'](_0x3ecc11(0x156)),_0x3ecc11(0x1b7)),_0x108ee0[_0x3ecc11(0x218)]?console[_0x3ecc11(0x1bb)](a41_0x16ed5b[_0x3ecc11(0x201)](_0x3ecc11(0x19b)+_0x108ee0[_0x3ecc11(0x218)]+_0x3ecc11(0x152)+_0x108ee0[_0x3ecc11(0x218)]+'\x27')):console['error'](a41_0x16ed5b['dim'](_0x3ecc11(0xf1))),0x1;throw _0x3435be;}const _0x5762d6=_0x18b89d['data'];console[_0x3ecc11(0x1bb)]('✔\x20Project:\x20'+_0x5762d6['projectName']),console['error'](_0x3ecc11(0xf7)+_0x5762d6[_0x3ecc11(0x13c)]),console['error'](_0x3ecc11(0x229)+_0x5762d6[_0x3ecc11(0x1a1)]),console['error'](_0x3ecc11(0x214)+a41_0x16ed5b[_0x3ecc11(0x126)]('+'+_0x5762d6['summary'][_0x3ecc11(0x18d)]+'\x20new')+',\x20'+(a41_0x16ed5b[_0x3ecc11(0xb1)]('~'+_0x5762d6[_0x3ecc11(0xb4)][_0x3ecc11(0x12e)]+_0x3ecc11(0xb7))+',\x20')+(a41_0x16ed5b[_0x3ecc11(0x1f5)]('-'+_0x5762d6[_0x3ecc11(0xb4)][_0x3ecc11(0xd1)]+_0x3ecc11(0x1e3))+',\x20')+(''+a41_0x16ed5b[_0x3ecc11(0x201)](_0x5762d6[_0x3ecc11(0xb4)][_0x3ecc11(0x1c9)]+_0x3ecc11(0x143))));for(const _0x55fe3c of _0x5762d6[_0x3ecc11(0x190)]){_0x55fe3c[_0x3ecc11(0x118)]==='modified'&&_0x55fe3c[_0x3ecc11(0x1d0)]&&(console[_0x3ecc11(0x1bb)]('\x0a'+a41_0x16ed5b['cyan'](_0x3ecc11(0x1a5)+_0x55fe3c[_0x3ecc11(0x22c)])),console[_0x3ecc11(0x1bb)](_0x55fe3c[_0x3ecc11(0x1d0)]));}if(!_0x5762d6[_0x3ecc11(0x20e)])return console[_0x3ecc11(0x1bb)](a41_0x16ed5b[_0x3ecc11(0x126)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x3ecc11(0x1c6)](_0x2a2157,_0x5762d6[_0x3ecc11(0x18e)],_0x108ee0['site']),0x0;if(_0x108ee0['dryRun'])return console[_0x3ecc11(0x1bb)](a41_0x16ed5b['yellow'](_0x3ecc11(0x23d))),0x0;if(!_0x108ee0[_0x3ecc11(0x1da)]){const _0xf63c9e=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0xf63c9e)return console[_0x3ecc11(0x1bb)](_0x3ecc11(0xb6)),0x0;}const _0x1eb176=await withSpinner('Pushing\x20project...',()=>_0x2a2157[_0x3ecc11(0x1ab)][_0x3ecc11(0x227)](_0x5762d6),{'verbose':_0x108ee0[_0x3ecc11(0xd5)]}),_0x2d8428=_0x1eb176[_0x3ecc11(0x225)];return console['error'](a41_0x16ed5b[_0x3ecc11(0x126)](_0x3ecc11(0x113))),console[_0x3ecc11(0x1bb)]('\x20\x20Project\x20ID:\x20'+_0x2d8428[_0x3ecc11(0x1e4)]),console[_0x3ecc11(0x1bb)]('\x20\x20Revision:\x20'+_0x2d8428[_0x3ecc11(0x1a1)]),await this[_0x3ecc11(0x1c6)](_0x2a2157,_0x2d8428[_0x3ecc11(0x18e)],_0x108ee0[_0x3ecc11(0x24c)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a41_0x43423c(0x16e);[a41_0x43423c(0x105)]=a41_0x43423c(0x15b);async[a41_0x43423c(0xd8)](_0x95dbd0){const _0x4f6b55=a41_0x43423c,{options:_0x4605ca,args:_0x49438b,tdx:_0xd57c88}=_0x95dbd0,_0x280358=this[_0x4f6b55(0xfc)](_0x49438b,_0x4605ca),_0x60c7f6=_0x4605ca[_0x4f6b55(0x103)],_0x2c3665=_0x4605ca['revision'],_0x358c71=_0x4605ca['skipValidation'];if(!_0x280358)return console['error'](a41_0x16ed5b[_0x4f6b55(0x1f5)](_0x4f6b55(0x156)),_0x4f6b55(0x137)),console[_0x4f6b55(0x1bb)](a41_0x16ed5b[_0x4f6b55(0x201)](_0x4f6b55(0x1f6))),console[_0x4f6b55(0x1bb)](a41_0x16ed5b[_0x4f6b55(0x201)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x60c7f6)return console['error'](a41_0x16ed5b[_0x4f6b55(0x1f5)]('Error:'),_0x4f6b55(0xae)),console[_0x4f6b55(0x1bb)](a41_0x16ed5b[_0x4f6b55(0x201)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x4605ca[_0x4f6b55(0xd5)]&&(console[_0x4f6b55(0x1bb)](_0x4f6b55(0x196)+_0x280358),console[_0x4f6b55(0x1bb)](_0x4f6b55(0xd3)+_0x60c7f6),_0x2c3665&&console[_0x4f6b55(0x1bb)]('Revision:\x20'+_0x2c3665),_0x4605ca[_0x4f6b55(0xe7)]&&console['error']('Dry\x20run:\x20yes'),_0x358c71&&console[_0x4f6b55(0x1bb)](_0x4f6b55(0x14a)));const _0xecf573=await withSpinner(_0x4f6b55(0x238),()=>_0xd57c88['workflow'][_0x4f6b55(0x12b)](_0x280358,_0x60c7f6,{'revision':_0x2c3665,'skipValidation':_0x358c71}),{'verbose':_0x4605ca[_0x4f6b55(0xd5)]}),_0xfe44b0=_0xecf573[_0x4f6b55(0x225)];console['error']('Source:\x20'+_0xfe44b0['sourceDir']);_0xfe44b0[_0x4f6b55(0x1c4)]&&console[_0x4f6b55(0x1bb)]('Source\x20project:\x20'+_0xfe44b0[_0x4f6b55(0x1c4)]);console['error'](_0x4f6b55(0xd3)+_0xfe44b0[_0x4f6b55(0x23c)]),console['error'](_0x4f6b55(0x157)+_0xfe44b0[_0x4f6b55(0x1a1)]),console[_0x4f6b55(0x1bb)]('Files\x20to\x20upload:\x20'+_0xfe44b0[_0x4f6b55(0x1fa)]);_0xfe44b0[_0x4f6b55(0x125)]&&(console[_0x4f6b55(0x1bb)](a41_0x16ed5b[_0x4f6b55(0xb1)](_0x4f6b55(0x148)+_0xfe44b0['newProjectName']+_0x4f6b55(0x177)+_0xfe44b0['existingProjectId']+')')),console[_0x4f6b55(0x1bb)](a41_0x16ed5b[_0x4f6b55(0xb1)](_0x4f6b55(0x208))));if(_0x4605ca[_0x4f6b55(0xe7)])return console['error'](a41_0x16ed5b[_0x4f6b55(0xb1)](_0x4f6b55(0x1a0))),0x0;if(!_0x4605ca[_0x4f6b55(0x1da)]){const _0x37f816=_0xfe44b0[_0x4f6b55(0x1c4)]||a41_0xd8e1c9[_0x4f6b55(0x173)](_0x280358),_0x45b664=_0xfe44b0[_0x4f6b55(0x125)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x60c7f6+_0x4f6b55(0x19d):_0x4f6b55(0x18f)+_0x37f816+_0x4f6b55(0x1dd)+_0x60c7f6+'\x22?',_0x3618bb=await confirmKey(_0x45b664);if(!_0x3618bb)return console[_0x4f6b55(0x1bb)](_0x4f6b55(0xb6)),0x0;}const _0xad0cd1=await withSpinner(_0xfe44b0['targetExists']?_0x4f6b55(0xca)+_0x60c7f6+_0x4f6b55(0x184):'Cloning\x20to\x20'+_0x60c7f6+'...',()=>_0xd57c88[_0x4f6b55(0x1ab)][_0x4f6b55(0xe6)](_0xfe44b0),{'verbose':_0x4605ca[_0x4f6b55(0xd5)]}),_0x1b1d4c=_0xad0cd1[_0x4f6b55(0x225)];return console[_0x4f6b55(0x1bb)](a41_0x16ed5b[_0x4f6b55(0x126)](_0xfe44b0[_0x4f6b55(0x125)]?_0x4f6b55(0xbb):'✔\x20Clone\x20complete')),console[_0x4f6b55(0x1bb)](_0x4f6b55(0xc3)+_0x1b1d4c[_0x4f6b55(0x23c)]),console['error'](_0x4f6b55(0x199)+_0x1b1d4c[_0x4f6b55(0xce)]),console[_0x4f6b55(0x1bb)](_0x4f6b55(0x229)+_0x1b1d4c['revision']),await this[_0x4f6b55(0x1c6)](_0xd57c88,_0x1b1d4c[_0x4f6b55(0x23c)],_0x4605ca[_0x4f6b55(0x24c)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a41_0x43423c(0x103)]=a41_0x43423c(0x169);[a41_0x43423c(0x105)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async['execute'](_0x25ff6c){const _0x178e80=a41_0x43423c,{options:_0x22a103,args:_0x2beed4,tdx:_0x30b6db}=_0x25ff6c,_0xac5866=_0x2beed4[0x0];if(!_0xac5866)return console[_0x178e80(0x1bb)](_0x178e80(0xf4)),console[_0x178e80(0x1bb)](_0x178e80(0x1e5)),0x1;_0x22a103[_0x178e80(0xd5)]&&console[_0x178e80(0x1bb)]('Project:\x20'+_0xac5866);if(!_0x22a103[_0x178e80(0x1da)]){const _0x1bf85f=await confirmKey(_0x178e80(0x237)+_0xac5866+_0x178e80(0x212));if(!_0x1bf85f)return console[_0x178e80(0x1bb)](_0x178e80(0xb6)),0x0;}const _0x3ece0c=await withSpinner(_0x178e80(0xbd)+_0xac5866+_0x178e80(0x184),()=>_0x30b6db[_0x178e80(0x1ab)][_0x178e80(0x1ee)](_0xac5866),{'verbose':_0x22a103[_0x178e80(0xd5)]}),_0x34c9b6=_0x3ece0c[_0x178e80(0x225)];return console[_0x178e80(0x1bb)](_0x178e80(0x1c8)+_0x34c9b6[_0x178e80(0x18e)]),console[_0x178e80(0x1bb)]('\x20\x20Project\x20ID:\x20'+_0x34c9b6[_0x178e80(0x1e4)]),0x0;}}export function parseKeyValue(_0x354f45){const _0x1137ca=a41_0x43423c,_0xf4caea=_0x354f45['indexOf']('=');if(_0xf4caea===-0x1)throw new Error('Invalid\x20format:\x20'+_0x354f45+_0x1137ca(0x132));const _0x59be87=_0x354f45[_0x1137ca(0x106)](0x0,_0xf4caea),_0x3a6272=_0x354f45[_0x1137ca(0x106)](_0xf4caea+0x1);if(!_0x59be87)throw new Error(_0x1137ca(0x21f));return{'key':_0x59be87,'value':_0x3a6272};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a41_0x43423c(0x103)]=a41_0x43423c(0x1cc);[a41_0x43423c(0x105)]=a41_0x43423c(0x123);async[a41_0x43423c(0xd8)](_0xd566c1){const _0x4d05cf=a41_0x43423c,{options:_0x11fb88,args:_0x1fcf78,tdx:_0x2be465}=_0xd566c1,_0x52b221=this[_0x4d05cf(0x1f4)](_0x1fcf78,_0x11fb88);if(!_0x52b221)return 0x1;_0x11fb88[_0x4d05cf(0xd5)]&&console[_0x4d05cf(0x1bb)](_0x4d05cf(0x193)+_0x52b221);const _0x4cb6e7=await withSpinner('Listing\x20secrets...',()=>_0x2be465[_0x4d05cf(0x1ab)]['listSecrets'](_0x52b221),{'verbose':_0x11fb88[_0x4d05cf(0xd5)]}),{secrets:_0x3cd644}=_0x4cb6e7[_0x4d05cf(0x225)];return console[_0x4d05cf(0x1bb)](_0x4d05cf(0x21a)+_0x3cd644[_0x4d05cf(0xc4)]+_0x4d05cf(0xff)+(_0x3cd644[_0x4d05cf(0xc4)]!==0x1?'s':'')),await handleSDKOutput(_0x3cd644,_0x11fb88),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a41_0x43423c(0x103)]=a41_0x43423c(0x1ed);[a41_0x43423c(0x105)]=a41_0x43423c(0x217);async[a41_0x43423c(0xd8)](_0xf3508f){const _0x7c01f7=a41_0x43423c,{options:_0x595bc7,args:_0x234375,tdx:_0x4efdd6}=_0xf3508f;let _0x5676e3,_0xa8f5b3;if(_0x234375['length']>=0x2)_0x5676e3=_0x234375[0x0],_0xa8f5b3=_0x234375[0x1];else{if(_0x234375[_0x7c01f7(0xc4)]===0x1&&_0x595bc7['workflowProject'])_0x5676e3=_0x595bc7['workflowProject'],_0xa8f5b3=_0x234375[0x0];else return _0x234375[_0x7c01f7(0xc4)]===0x1?(console[_0x7c01f7(0x1bb)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x7c01f7(0x1bb)](_0x7c01f7(0x164)),0x1):(console[_0x7c01f7(0x1bb)]('Error:\x20KEY=VALUE\x20is\x20required'),console[_0x7c01f7(0x1bb)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE'),0x1);}let _0x42f4f8,_0x4dc7e7;try{({key:_0x42f4f8,value:_0x4dc7e7}=parseKeyValue(_0xa8f5b3));}catch(_0x375eaa){return _0x375eaa instanceof Error&&console['error'](a41_0x16ed5b[_0x7c01f7(0x1f5)](_0x7c01f7(0x156)),_0x375eaa[_0x7c01f7(0x166)]),0x1;}_0x595bc7[_0x7c01f7(0xd5)]&&(console[_0x7c01f7(0x1bb)](_0x7c01f7(0x193)+_0x5676e3),console['error'](_0x7c01f7(0xb5)+_0x42f4f8));const _0x45f7b6=await withSpinner(_0x7c01f7(0xe9),()=>_0x4efdd6[_0x7c01f7(0x1ab)][_0x7c01f7(0x207)](_0x5676e3,_0x42f4f8,_0x4dc7e7),{'verbose':_0x595bc7['verbose']}),_0x23eeb6=_0x45f7b6[_0x7c01f7(0x225)];return console[_0x7c01f7(0x1bb)](_0x7c01f7(0xf5)+_0x23eeb6['key']+_0x7c01f7(0x19a)+_0x23eeb6[_0x7c01f7(0x18e)]+'\x27'),(_0x595bc7[_0x7c01f7(0x239)]||_0x595bc7[_0x7c01f7(0xcb)])&&await handleSingleObjectOutput(_0x23eeb6,_0x595bc7),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a41_0x43423c(0x103)]=a41_0x43423c(0xdd);[a41_0x43423c(0x105)]='Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project';async[a41_0x43423c(0xd8)](_0x1acccc){const _0x300f95=a41_0x43423c,{options:_0x54a9ad,args:_0x1ed192,tdx:_0x5df73c}=_0x1acccc;let _0x559fce,_0x4bb92d;if(_0x1ed192[_0x300f95(0xc4)]>=0x2)_0x559fce=_0x1ed192[0x0],_0x4bb92d=_0x1ed192[0x1];else{if(_0x1ed192[_0x300f95(0xc4)]===0x1&&_0x54a9ad['workflowProject'])_0x559fce=_0x54a9ad['workflowProject'],_0x4bb92d=_0x1ed192[0x0];else return _0x1ed192['length']===0x1?(console[_0x300f95(0x1bb)](_0x300f95(0x1d8)),console[_0x300f95(0x1bb)](_0x300f95(0x164)),0x1):(console[_0x300f95(0x1bb)]('Error:\x20Secret\x20key\x20is\x20required'),console['error'](_0x300f95(0xa7)),0x1);}_0x54a9ad[_0x300f95(0xd5)]&&(console[_0x300f95(0x1bb)](_0x300f95(0x193)+_0x559fce),console[_0x300f95(0x1bb)]('Key:\x20'+_0x4bb92d));if(!_0x54a9ad['yes']){const _0x27888e=await confirmKey(_0x300f95(0x135)+_0x4bb92d+_0x300f95(0x1b3)+_0x559fce+'\x27?');if(!_0x27888e)return console[_0x300f95(0x1bb)](_0x300f95(0xb6)),0x0;}const _0x58b1e0=await withSpinner(_0x300f95(0x16c),()=>_0x5df73c['workflow'][_0x300f95(0x1c5)](_0x559fce,_0x4bb92d),{'verbose':_0x54a9ad[_0x300f95(0xd5)]}),_0x5623a3=_0x58b1e0[_0x300f95(0x225)];return console[_0x300f95(0x1bb)]('✔\x20Secret\x20\x27'+_0x5623a3[_0x300f95(0x158)]+_0x300f95(0x23a)+_0x5623a3[_0x300f95(0x18e)]+'\x27'),(_0x54a9ad['json']||_0x54a9ad[_0x300f95(0xcb)])&&await handleSingleObjectOutput(_0x5623a3,_0x54a9ad),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(_0x2ddda8){const _0x24e0e7=a41_0x43423c,_0x1e94a8=Math[_0x24e0e7(0x174)](_0x2ddda8/0x3e8),_0xa5734f=Math['floor'](_0x1e94a8/0x3c),_0x51f28b=Math[_0x24e0e7(0x174)](_0xa5734f/0x3c),_0x86384d=Math[_0x24e0e7(0x174)](_0x51f28b/0x18);if(_0x86384d>0x0){const _0x42c848=_0x51f28b%0x18;return _0x42c848>0x0?_0x86384d+'d\x20'+_0x42c848+'h':_0x86384d+'d';}else{if(_0x51f28b>0x0){const _0x13f740=_0xa5734f%0x3c;return _0x13f740>0x0?_0x51f28b+'h\x20'+_0x13f740+'m':_0x51f28b+'h';}else{if(_0xa5734f>0x0){const _0x39ebf4=_0x1e94a8%0x3c;return _0x39ebf4>0x0?_0xa5734f+'m\x20'+_0x39ebf4+'s':_0xa5734f+'m';}else return _0x1e94a8+'s';}}}function formatTimestamp(_0x3d0e21,_0x16d029){const _0x290067=a41_0x43423c,_0x1aa441=new Date(_0x3d0e21),_0x3acf77=String(_0x1aa441['getHours']())[_0x290067(0x18b)](0x2,'0'),_0x3a5b87=String(_0x1aa441[_0x290067(0x251)]())[_0x290067(0x18b)](0x2,'0'),_0x49bca2=_0x3acf77+':'+_0x3a5b87,_0xf8b6ac=_0x1aa441['getFullYear']()===_0x16d029['getFullYear']()&&_0x1aa441['getMonth']()===_0x16d029[_0x290067(0x1ec)]()&&_0x1aa441[_0x290067(0x1d4)]()===_0x16d029['getDate']();if(_0xf8b6ac)return _0x49bca2;else{const _0x552eb4=String(_0x1aa441[_0x290067(0x1ec)]()+0x1)[_0x290067(0x18b)](0x2,'0'),_0x261c60=String(_0x1aa441[_0x290067(0x1d4)]())[_0x290067(0x18b)](0x2,'0');return _0x552eb4+'-'+_0x261c60+'\x20'+_0x49bca2;}}function formatDate(_0x1929ea){const _0xafbdde=a41_0x43423c,_0x366205=_0x1929ea['getFullYear'](),_0x5a67c2=String(_0x1929ea[_0xafbdde(0x1ec)]()+0x1)[_0xafbdde(0x18b)](0x2,'0'),_0x21ec59=String(_0x1929ea[_0xafbdde(0x1d4)]())[_0xafbdde(0x18b)](0x2,'0');return _0x366205+'-'+_0x5a67c2+'-'+_0x21ec59;}function getTaskStateIcon(_0x5620ae){const _0x4680e6={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x4680e6[_0x5620ae]||'⚪';}function getBarChar(_0xee1d90){const _0x4349f3=a41_0x43423c;return _0xee1d90===_0x4349f3(0x1bb)||_0xee1d90===_0x4349f3(0xc7)?'×':'─';}function getBarColor(_0x3f88e2){const _0xc831a6=a41_0x43423c,_0x29fdc1={'success':a41_0x16ed5b[_0xc831a6(0x126)],'error':a41_0x16ed5b[_0xc831a6(0x1f5)],'group_error':a41_0x16ed5b[_0xc831a6(0x1f5)],'running':a41_0x16ed5b[_0xc831a6(0x109)],'blocked':a41_0x16ed5b[_0xc831a6(0xb1)],'planned':a41_0x16ed5b[_0xc831a6(0x201)],'canceling':a41_0x16ed5b['yellow']};return _0x29fdc1[_0x3f88e2]||a41_0x16ed5b[_0xc831a6(0x155)];}function parseTaskName(_0x265e92){const _0x26a462=a41_0x43423c;let _0x4ad55d=_0x265e92[_0x26a462(0x128)](/^\++/,'');const _0x317c16=_0x4ad55d[_0x26a462(0xd0)]('+'),_0x5556c9=_0x317c16['length']>0x1?_0x317c16['length']-0x2:0x0,_0x5d5bc9=_0x317c16[_0x317c16[_0x26a462(0xc4)]-0x1]||_0x4ad55d;return{'level':_0x5556c9,'name':'+'+_0x5d5bc9};}function truncateTaskName(_0x5a83b9,_0x5224bf){const _0x533220=a41_0x43423c,_0x548bcd=stringWidth(_0x5a83b9);if(_0x548bcd<=_0x5224bf)return _0x5a83b9;let _0xeaecc6=_0x5a83b9;while(stringWidth(_0xeaecc6+'…')>_0x5224bf&&_0xeaecc6[_0x533220(0xc4)]>0x0){_0xeaecc6=_0xeaecc6[_0x533220(0x14b)](0x0,-0x1);}return _0xeaecc6+'…';}function calculateTimeScale(_0x94512,_0x3a6183){const _0x2a8d82=a41_0x43423c;return{'startTime':_0x94512[_0x2a8d82(0x1b9)],'endTime':_0x94512[_0x2a8d82(0x1d6)],'durationMs':_0x94512['duration'],'msPerChar':_0x94512[_0x2a8d82(0xcd)]/_0x3a6183};}function timeToPosition(_0x3170c0,_0x3c232e,_0x3456b7){const _0x26bd99=a41_0x43423c,_0x5d9d0d=_0x3170c0-_0x3c232e[_0x26bd99(0x250)],_0x39ca36=Math['floor'](_0x5d9d0d/_0x3c232e['msPerChar']);return Math[_0x26bd99(0x187)](0x0,Math[_0x26bd99(0xec)](_0x39ca36,_0x3456b7));}function a41_0x581e(_0x6b8bb7,_0x531261){_0x6b8bb7=_0x6b8bb7-0xa5;const _0x17837f=a41_0x1783();let _0x581ef8=_0x17837f[_0x6b8bb7];return _0x581ef8;}function renderTimeAxis(_0x101025,_0x2f8d7a){const _0x295694=a41_0x43423c,_0x11b886=Math[_0x295694(0xec)](TIMELINE_CONFIG[_0x295694(0xd7)],Math[_0x295694(0x187)](TIMELINE_CONFIG[_0x295694(0x202)],Math['floor'](_0x2f8d7a/TIMELINE_CONFIG[_0x295694(0x1e2)]))),_0xdbcc3f=_0x101025[_0x295694(0x1fd)]/(_0x11b886-0x1),_0x199304=new Date(_0x101025[_0x295694(0x250)]),_0x406790=[];for(let _0x9186e=0x0;_0x9186e<_0x11b886;_0x9186e++){const _0x1a21e3=_0x101025[_0x295694(0x250)]+_0x9186e*_0xdbcc3f,_0x29dba9=timeToPosition(_0x1a21e3,_0x101025,_0x2f8d7a),_0x2fcd78=formatTimestamp(_0x1a21e3,_0x199304);_0x406790['push']({'pos':_0x29dba9,'text':_0x2fcd78});}const _0x26330c=new Array(_0x2f8d7a)[_0x295694(0xbc)]('\x20');let _0x5da35e=-0x1;for(const {pos:_0x3e8da0,text:_0xb5c5e7}of _0x406790){let _0x15a309=Math[_0x295694(0x187)](0x0,_0x3e8da0-Math[_0x295694(0x174)](_0xb5c5e7[_0x295694(0xc4)]/0x2));_0x15a309<=_0x5da35e+TIMELINE_CONFIG[_0x295694(0x165)]&&(_0x15a309=_0x5da35e+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x15a309+_0xb5c5e7[_0x295694(0xc4)]>_0x2f8d7a&&(_0x15a309=_0x2f8d7a-_0xb5c5e7['length']);if(_0x15a309>=0x0&&_0x15a309+_0xb5c5e7['length']<=_0x2f8d7a&&_0x15a309>_0x5da35e){for(let _0x3c7e57=0x0;_0x3c7e57<_0xb5c5e7[_0x295694(0xc4)];_0x3c7e57++){_0x26330c[_0x15a309+_0x3c7e57]=_0xb5c5e7[_0x3c7e57];}_0x5da35e=_0x15a309+_0xb5c5e7[_0x295694(0xc4)]-0x1;}}return _0x26330c['join']('');}function renderTaskRow(_0x5490d2,_0x1e3b24,_0x26112d,_0x53de2b){const _0x145526=a41_0x43423c,{level:_0x1e488e,name:_0x317d79}=parseTaskName(_0x5490d2['name']),_0x154b8a='\x20'[_0x145526(0x11d)](_0x1e488e),_0x2ba27d=_0x5490d2[_0x145526(0x168)]?'('+formatElapsed(_0x5490d2[_0x145526(0x168)][_0x145526(0xcd)])+')':'',_0x281c32=stringWidth(_0x2ba27d),_0x3e1839=_0x1e488e*0x1,_0x26783c=_0x53de2b-_0x3e1839-_0x281c32-0x1,_0x2c1eab=truncateTaskName(_0x317d79,_0x26783c),_0x354028=_0x154b8a+_0x2c1eab,_0x351b5c=stringWidth(_0x354028),_0x4bb01b=_0x53de2b-_0x351b5c-_0x281c32,_0x245447=_0x354028+'\x20'[_0x145526(0x11d)](Math[_0x145526(0x187)](0x1,_0x4bb01b))+a41_0x16ed5b[_0x145526(0x201)](_0x2ba27d),_0x35097e=getTaskStateIcon(_0x5490d2[_0x145526(0x14e)]),_0x788e3d=new Array(_0x26112d)['fill']('\x20');if(_0x5490d2['window']){const _0x59e078=timeToPosition(_0x5490d2['window'][_0x145526(0x1b9)],_0x1e3b24,_0x26112d),_0x5f4ca8=timeToPosition(_0x5490d2['window']['end'],_0x1e3b24,_0x26112d),_0x1b0481=getBarChar(_0x5490d2['state']),_0x56c3c7=Math[_0x145526(0x187)](_0x59e078+0x1,_0x5f4ca8);for(let _0x2f7f50=_0x59e078;_0x2f7f50<Math[_0x145526(0xec)](_0x56c3c7,_0x26112d);_0x2f7f50++){_0x788e3d[_0x2f7f50]=_0x1b0481;}}const _0x5969ce=getBarColor(_0x5490d2[_0x145526(0x14e)]),_0x8880ed=_0x788e3d['map'](_0x384d20=>_0x384d20==='\x20'?'\x20':_0x5969ce(_0x384d20))['join']('');return _0x35097e+'\x20'+_0x245447+'│'+_0x8880ed+'│';}function calculateStats(_0x152cf3){const _0x9e27dc=a41_0x43423c,_0x580914={'total':_0x152cf3[_0x9e27dc(0xc4)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x549210 of _0x152cf3){if(_0x549210[_0x9e27dc(0x14e)]===_0x9e27dc(0xac))_0x580914[_0x9e27dc(0xac)]++;else{if(_0x549210[_0x9e27dc(0x14e)]==='error'||_0x549210[_0x9e27dc(0x14e)]===_0x9e27dc(0xc7))_0x580914['error']++;else _0x549210[_0x9e27dc(0x14e)]==='running'?_0x580914[_0x9e27dc(0x213)]++:_0x580914['pending']++;}}return _0x580914;}function formatStats(_0x42c8eb){const _0x462319=a41_0x43423c;return[_0x462319(0xa5)+_0x42c8eb[_0x462319(0x189)],'✅\x20'+_0x42c8eb['success'],'❌\x20'+_0x42c8eb[_0x462319(0x1bb)],_0x462319(0x195)+_0x42c8eb['running'],'⏳\x20'+_0x42c8eb[_0x462319(0x10c)]][_0x462319(0x222)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a41_0x43423c(0x103)]=a41_0x43423c(0x194);[a41_0x43423c(0x105)]=a41_0x43423c(0x211);async[a41_0x43423c(0xd8)](_0x1749dc){const _0x29c5ab=a41_0x43423c,{options:_0x5bb306,args:_0x5537cf,tdx:_0x50c357}=_0x1749dc;let _0x1cb54d,_0x12bf41,_0x59f348=![];if(_0x5537cf[0x0]){if(_0x5537cf[0x0][_0x29c5ab(0x159)]('.')){const _0x285941=this[_0x29c5ab(0x1df)](_0x5537cf,_0x5bb306);if(!_0x285941)return 0x1;_0x1cb54d=_0x285941[_0x29c5ab(0x18e)],_0x12bf41=_0x285941[_0x29c5ab(0x140)];}else{_0x12bf41=_0x5537cf[0x0],_0x1cb54d=_0x5bb306['workflowProject'];if(!_0x1cb54d)return console[_0x29c5ab(0x1bb)](a41_0x16ed5b[_0x29c5ab(0x1f5)](_0x29c5ab(0x156)),_0x29c5ab(0x1c0)),0x1;_0x59f348=!![];}}else{const _0x5e589b=this[_0x29c5ab(0x1df)](_0x5537cf,_0x5bb306);if(!_0x5e589b)return 0x1;_0x1cb54d=_0x5e589b[_0x29c5ab(0x18e)],_0x12bf41=_0x5e589b[_0x29c5ab(0x140)];}if(_0x5bb306[_0x29c5ab(0xd5)]){if(_0x1cb54d&&_0x12bf41)console[_0x29c5ab(0x1bb)]('Filter:\x20'+_0x1cb54d+'.'+_0x12bf41);else _0x1cb54d&&console[_0x29c5ab(0x1bb)](_0x29c5ab(0x1bc)+_0x1cb54d);}const _0x42e572=_0x5bb306[_0x29c5ab(0x224)],_0x488f71=_0x5bb306[_0x29c5ab(0x1aa)];if(_0x42e572){_0x488f71&&console[_0x29c5ab(0x1bb)](a41_0x16ed5b[_0x29c5ab(0xb1)](_0x29c5ab(0x18c)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x1adc07=_0x5bb306[_0x29c5ab(0x160)];return _0x1adc07?await this['pollTimeline'](_0x1749dc,_0x42e572):await this[_0x29c5ab(0x1c7)](_0x1749dc,_0x42e572,_0x5bb306),0x0;}if(_0x488f71){const _0x3da45c=await withSpinner(_0x29c5ab(0x21d),()=>_0x50c357[_0x29c5ab(0x1ab)]['sessions']({'projectName':_0x1cb54d,'workflowName':_0x12bf41,'limit':0x64}),{'verbose':_0x5bb306['verbose']}),_0x344c83=_0x3da45c[_0x29c5ab(0x225)][_0x29c5ab(0xeb)](_0x2ef562=>_0x2ef562['id']===_0x488f71);if(!_0x344c83)return console[_0x29c5ab(0x1bb)](a41_0x16ed5b[_0x29c5ab(0x1f5)](_0x29c5ab(0x156)),_0x29c5ab(0xfb)+_0x488f71),0x1;if(!_0x344c83[_0x29c5ab(0x16d)]?.['id'])return console['error'](a41_0x16ed5b[_0x29c5ab(0x1f5)]('Error:'),_0x29c5ab(0x161)+_0x488f71+_0x29c5ab(0x1e8)),0x1;const _0x35bc97=_0x344c83[_0x29c5ab(0x16d)]['id'];_0x5bb306[_0x29c5ab(0xd5)]&&console[_0x29c5ab(0x1bb)](_0x29c5ab(0x178)+_0x35bc97+_0x29c5ab(0x15f)+_0x488f71);const _0x3808c4=_0x5bb306['follow'];return _0x3808c4?await this[_0x29c5ab(0x1b1)](_0x1749dc,_0x35bc97):await this['renderSingleTimeline'](_0x1749dc,_0x35bc97,_0x5bb306),0x0;}const _0xc543b2=await withSpinner(_0x29c5ab(0x17e),()=>_0x50c357[_0x29c5ab(0x1ab)][_0x29c5ab(0xb2)]({'projectName':_0x1cb54d,'workflowName':_0x12bf41,'limit':_0x5bb306[_0x29c5ab(0x11e)]||0x32}),{'verbose':_0x5bb306[_0x29c5ab(0xd5)]}),_0x866a47=_0xc543b2[_0x29c5ab(0x225)];if(_0x866a47[_0x29c5ab(0xc4)]===0x0){if(_0x1cb54d&&_0x12bf41)console[_0x29c5ab(0x1bb)](_0x29c5ab(0x198)+_0x1cb54d+'.'+_0x12bf41);else _0x1cb54d?console[_0x29c5ab(0x1bb)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x1cb54d):(console[_0x29c5ab(0x1bb)](_0x29c5ab(0x24f)),console['error'](a41_0x16ed5b[_0x29c5ab(0x201)](_0x29c5ab(0x11b))));return 0x0;}_0x866a47[_0x29c5ab(0xe2)]((_0x572ea1,_0x511420)=>{const _0x42cdde=_0x29c5ab,_0x3c5d4c=_0x572ea1[_0x42cdde(0x1c2)]||'',_0x491e19=_0x511420['sessionTime']||'';return _0x491e19[_0x42cdde(0x186)](_0x3c5d4c);});if(_0x5bb306[_0x29c5ab(0x239)]||_0x5bb306[_0x29c5ab(0xcb)])return await handleSDKOutput(_0x866a47,_0x5bb306),0x0;let _0x305a45;if(_0x59f348){const _0x37c917=_0x866a47[0x0];if(!_0x37c917[_0x29c5ab(0x16d)]?.['id'])return console['error'](_0x29c5ab(0x1fb)),0x0;_0x305a45=_0x37c917[_0x29c5ab(0x16d)]['id'],_0x5bb306[_0x29c5ab(0xd5)]&&console[_0x29c5ab(0x1bb)](_0x29c5ab(0x1ef)+_0x37c917[_0x29c5ab(0x1c2)]);}else{const _0x2f3b20=_0x866a47[_0x29c5ab(0x163)](_0x21db71=>{const _0xf746d5=_0x29c5ab,_0x1cf9ab=getAttemptStatusDisplay(_0x21db71['lastAttempt']);return{'title':_0x21db71[_0xf746d5(0x1b4)]?.['name']+'.'+_0x21db71[_0xf746d5(0x1ab)]?.[_0xf746d5(0x103)]+'\x20-\x20'+_0x21db71[_0xf746d5(0x1c2)]+'\x20'+_0x1cf9ab[_0xf746d5(0x1a3)],'value':_0x21db71[_0xf746d5(0x16d)]?.['id']||'','description':_0x1cf9ab[_0xf746d5(0x17f)]};}),_0x3ded65=await a41_0x4935b9({'type':_0x29c5ab(0x1a8),'name':'attemptId','message':_0x29c5ab(0x121),'choices':_0x2f3b20[_0x29c5ab(0xef)](_0x597110=>_0x597110[_0x29c5ab(0x1cd)]!=='')});if(!_0x3ded65[_0x29c5ab(0x224)])return 0x0;_0x305a45=_0x3ded65[_0x29c5ab(0x224)];}const _0x4c2b67=_0x5bb306['follow'];return _0x4c2b67?await this[_0x29c5ab(0x1b1)](_0x1749dc,_0x305a45):await this[_0x29c5ab(0x1c7)](_0x1749dc,_0x305a45,_0x5bb306),0x0;}async['renderSingleTimeline'](_0x25df65,_0x523265,_0x4172ef){const _0xe5309c=a41_0x43423c,{tdx:_0x59f9a7}=_0x25df65;let _0xd8a60b,_0x517404;try{[_0xd8a60b,_0x517404]=await Promise[_0xe5309c(0xfe)]([_0x59f9a7[_0xe5309c(0x1ab)]['attempt'](_0x523265),_0x59f9a7['workflow'][_0xe5309c(0x17d)](_0x523265,![])]);}catch(_0x4eaf8f){console[_0xe5309c(0x1bb)](a41_0x16ed5b[_0xe5309c(0x1f5)](_0xe5309c(0x141)));_0x4172ef[_0xe5309c(0xd5)]&&console[_0xe5309c(0x1bb)](_0x4eaf8f);throw _0x4eaf8f;}if(_0x4172ef['json']||_0x4172ef[_0xe5309c(0xcb)]){const _0x12a482=this[_0xe5309c(0x1f9)](_0xd8a60b,_0x517404);await handleSDKOutput([_0x12a482],_0x4172ef);return;}const _0x22f1cc=_0x59f9a7['context'][_0xe5309c(0x24c)],_0x3fa423=this[_0xe5309c(0x1f1)](_0xd8a60b,_0x517404,_0x22f1cc);console[_0xe5309c(0x24a)](_0x3fa423);}async[a41_0x43423c(0x1b1)](_0x55b5ad,_0x31feee){const _0x2b5f26=a41_0x43423c,{tdx:_0x53cbdc}=_0x55b5ad,_0x3f332b=TIMELINE_CONFIG[_0x2b5f26(0x144)],_0x5bc5a7=TIMELINE_CONFIG[_0x2b5f26(0x22b)];let _0x11d8fa=0x0;while(_0x11d8fa<_0x5bc5a7){process['stdout']['isTTY']&&process[_0x2b5f26(0x154)][_0x2b5f26(0x181)]('\x1bc');let _0x3b1651,_0x182e24;try{[_0x3b1651,_0x182e24]=await Promise['all']([_0x53cbdc[_0x2b5f26(0x1ab)][_0x2b5f26(0x13b)](_0x31feee),_0x53cbdc[_0x2b5f26(0x1ab)][_0x2b5f26(0x17d)](_0x31feee,![])]);}catch(_0x38234f){console[_0x2b5f26(0x1bb)](a41_0x16ed5b[_0x2b5f26(0x1f5)](_0x2b5f26(0xaa)));_0x11d8fa>0x0&&console[_0x2b5f26(0x1bb)](a41_0x16ed5b['dim'](_0x2b5f26(0x1d3)+_0x11d8fa));throw _0x38234f;}const _0x5086e3=_0x53cbdc[_0x2b5f26(0x150)][_0x2b5f26(0x24c)],_0x5eeb1b=this[_0x2b5f26(0x1f1)](_0x3b1651,_0x182e24,_0x5086e3);console['log'](_0x5eeb1b);const _0x10c741=_0x3b1651['done']&&_0x182e24['every'](_0x566e8e=>_0x566e8e[_0x2b5f26(0x14e)]!==_0x2b5f26(0x213)&&_0x566e8e[_0x2b5f26(0x14e)]!==_0x2b5f26(0x14c));if(_0x10c741){console[_0x2b5f26(0x1bb)](a41_0x16ed5b[_0x2b5f26(0x126)](_0x2b5f26(0xc6)));break;}console['error'](a41_0x16ed5b[_0x2b5f26(0x201)](_0x2b5f26(0x1e7)+_0x11d8fa*0x2+_0x2b5f26(0x112))),await new Promise(_0x4dac20=>setTimeout(_0x4dac20,_0x3f332b)),_0x11d8fa++;}_0x11d8fa>=_0x5bc5a7&&console[_0x2b5f26(0x1bb)](a41_0x16ed5b[_0x2b5f26(0xb1)]('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}['renderTimeline'](_0x52346d,_0x59f043,_0x1495c8){const _0x41af1f=a41_0x43423c,_0xcd80c8=[],_0x104fa8=TIMELINE_CONFIG[_0x41af1f(0x1bd)],_0x382298=0x5,_0x1a4ae1=process['stdout'][_0x41af1f(0x19e)]||0x78,_0x4343ad=_0x1a4ae1-_0x104fa8-_0x382298,_0x316db9=Math[_0x41af1f(0x187)](TIMELINE_CONFIG[_0x41af1f(0x1ca)],Math['min'](_0x4343ad,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x4e24eb=new Date(_0x52346d[_0x41af1f(0x12f)])[_0x41af1f(0xad)](),_0x55ff46=_0x52346d[_0x41af1f(0x1fe)]?new Date(_0x52346d[_0x41af1f(0x1fe)])[_0x41af1f(0xad)]():Date[_0x41af1f(0x22a)](),_0x10c63f={'start':_0x4e24eb,'end':_0x55ff46,'duration':_0x55ff46-_0x4e24eb},_0x4b60c4=new Map(),_0x567401=[];for(const _0xf6bc2c of _0x59f043){if(_0xf6bc2c[_0x41af1f(0x16b)]){const _0x563b24=new Date(_0xf6bc2c['startedAt'])[_0x41af1f(0xad)](),_0x1fea30=_0xf6bc2c[_0x41af1f(0x200)]?new Date(_0xf6bc2c['updatedAt'])[_0x41af1f(0xad)]():Date[_0x41af1f(0x22a)](),_0x5260e7={'start':_0x563b24,'end':_0x1fea30,'duration':_0x1fea30-_0x563b24};_0x4b60c4[_0x41af1f(0xb8)](_0xf6bc2c['id'],_0x5260e7),_0x567401['push']({'name':_0xf6bc2c['fullName'],'state':_0xf6bc2c['state']||_0x41af1f(0x1cb),'window':_0x5260e7});}else _0x567401['push']({'name':_0xf6bc2c['fullName'],'state':_0xf6bc2c['state']||'planned','window':undefined});}_0x567401[_0x41af1f(0xe2)]((_0x4b7f30,_0x3c2cbc)=>{const _0x58ae09=_0x41af1f;if(!_0x4b7f30[_0x58ae09(0x168)])return 0x1;if(!_0x3c2cbc[_0x58ae09(0x168)])return-0x1;return _0x4b7f30[_0x58ae09(0x168)]['start']-_0x3c2cbc[_0x58ae09(0x168)][_0x58ae09(0x1b9)];});const _0x29a916=_0x567401[_0x41af1f(0xc4)],_0x5f5567=_0x29a916>TIMELINE_CONFIG[_0x41af1f(0x1f7)];_0x5f5567&&_0x567401[_0x41af1f(0x127)](TIMELINE_CONFIG[_0x41af1f(0x1f7)]);const _0xb4cfec=calculateTimeScale(_0x10c63f,_0x316db9),_0x1628ed=_0x52346d['done']?_0x52346d[_0x41af1f(0xac)]?a41_0x16ed5b[_0x41af1f(0x126)](_0x41af1f(0xac)):a41_0x16ed5b[_0x41af1f(0x1f5)](_0x41af1f(0x1bb)):a41_0x16ed5b[_0x41af1f(0x109)]('running'),_0x499d03=_0x52346d[_0x41af1f(0x1b4)]?.['id'],_0x3efdf8=_0x52346d['sessionId'];let _0x4b2a81;if(_0x499d03&&_0x3efdf8){const _0x4e048f=getWorkflowAttemptUrl(_0x1495c8,_0x499d03,_0x3efdf8,_0x52346d['id']);_0x4b2a81=hyperlink(a41_0x16ed5b['dim'](_0x52346d['id']),_0x4e048f);}else _0x4b2a81=a41_0x16ed5b[_0x41af1f(0x201)](_0x52346d['id']);_0xcd80c8[_0x41af1f(0x179)](_0x41af1f(0xea)+_0x4b2a81+_0x41af1f(0xf0)+_0x1628ed+_0x41af1f(0xf0)+formatElapsed(_0x10c63f[_0x41af1f(0xcd)]));if(_0x567401[_0x41af1f(0xc4)]>0x0){const _0x11ad4d=renderTimeAxis(_0xb4cfec,_0x316db9),_0x358c09=new Date(_0x10c63f[_0x41af1f(0x1b9)]),_0xdad71e=formatDate(_0x358c09),_0x38877d=TIMELINE_CONFIG[_0x41af1f(0x220)]+TIMELINE_CONFIG['ICON_SPACING']+_0x104fa8,_0x3e5efd=_0xdad71e[_0x41af1f(0x18b)](_0x38877d),_0x125354=a41_0x16ed5b['dim'](_0x3e5efd);_0xcd80c8[_0x41af1f(0x179)](_0x125354+'\x20'+_0x11ad4d);for(const _0x4c787e of _0x567401){_0xcd80c8['push'](renderTaskRow(_0x4c787e,_0xb4cfec,_0x316db9,_0x104fa8));}const _0x55e4ed=calculateStats(_0x567401);_0xcd80c8[_0x41af1f(0x179)](formatStats(_0x55e4ed)),_0x5f5567&&_0xcd80c8['push'](a41_0x16ed5b[_0x41af1f(0xb1)](_0x41af1f(0x236)+TIMELINE_CONFIG[_0x41af1f(0x1f7)]+_0x41af1f(0xfa)+_0x29a916+_0x41af1f(0x1a9))),_0xcd80c8[_0x41af1f(0x179)](''),_0xcd80c8[_0x41af1f(0x179)](a41_0x16ed5b[_0x41af1f(0x201)](_0x41af1f(0x162))+(_0x41af1f(0x1be)+_0x52346d['id']+_0x41af1f(0x219))+a41_0x16ed5b['dim'](_0x41af1f(0x24d)));}else _0xcd80c8[_0x41af1f(0x179)](_0x41af1f(0x245));return _0xcd80c8['join']('\x0a');}[a41_0x43423c(0x1f9)](_0x25cbb8,_0x4127f3){const _0x401513=a41_0x43423c,_0x555a54=new Date(_0x25cbb8[_0x401513(0x12f)])[_0x401513(0xad)](),_0x59711f=_0x25cbb8['finishedAt']?new Date(_0x25cbb8[_0x401513(0x1fe)])['getTime']():Date['now'](),_0xa7be9b=_0x59711f-_0x555a54,_0x348bb6=[];for(const _0x857770 of _0x4127f3){if(_0x857770['startedAt']){const _0x5e60b7=new Date(_0x857770[_0x401513(0x16b)])[_0x401513(0xad)](),_0x28d939=_0x857770[_0x401513(0x200)]?new Date(_0x857770[_0x401513(0x200)])['getTime']():Date[_0x401513(0x22a)]();_0x348bb6[_0x401513(0x179)]({'name':_0x857770[_0x401513(0x1e6)],'state':_0x857770[_0x401513(0x14e)]||_0x401513(0x1cb),'window':{'start':_0x5e60b7,'end':_0x28d939,'duration':_0x28d939-_0x5e60b7}});}else _0x348bb6[_0x401513(0x179)]({'name':_0x857770[_0x401513(0x1e6)],'state':_0x857770[_0x401513(0x14e)]||_0x401513(0x14c),'window':undefined});}const _0x2ce680=calculateStats(_0x348bb6);return{'attempt':{'id':_0x25cbb8['id'],'status':_0x25cbb8['done']?_0x25cbb8[_0x401513(0xac)]?'success':_0x401513(0x1bb):_0x401513(0x213),'createdAt':_0x25cbb8[_0x401513(0x12f)],'finishedAt':_0x25cbb8['finishedAt'],'duration_ms':_0xa7be9b},'tasks':_0x348bb6['map'](_0x2d32bc=>({'name':_0x2d32bc[_0x401513(0x103)],'state':_0x2d32bc['state'],'startedAt':_0x2d32bc[_0x401513(0x168)]?new Date(_0x2d32bc[_0x401513(0x168)][_0x401513(0x1b9)])[_0x401513(0x1b8)]():null,'updatedAt':_0x2d32bc['window']?new Date(_0x2d32bc['window'][_0x401513(0x1d6)])['toISOString']():null,'duration_ms':_0x2d32bc['window']?.['duration']||null})),'stats':_0x2ce680};}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3708af,_0x1ca15d){const _0x1877ce=a42_0x5241,_0x392d47=_0x3708af();while(!![]){try{const _0x9b3d61=-parseInt(_0x1877ce(0x123))/0x1+-parseInt(_0x1877ce(0x12e))/0x2*(-parseInt(_0x1877ce(0x12c))/0x3)+parseInt(_0x1877ce(0x134))/0x4*(-parseInt(_0x1877ce(0x128))/0x5)+parseInt(_0x1877ce(0x129))/0x6*(parseInt(_0x1877ce(0x122))/0x7)+parseInt(_0x1877ce(0x127))/0x8*(parseInt(_0x1877ce(0x12d))/0x9)+parseInt(_0x1877ce(0x12f))/0xa*(-parseInt(_0x1877ce(0x135))/0xb)+parseInt(_0x1877ce(0x12b))/0xc*(parseInt(_0x1877ce(0x133))/0xd);if(_0x9b3d61===_0x1ca15d)break;else _0x392d47['push'](_0x392d47['shift']());}catch(_0x226994){_0x392d47['push'](_0x392d47['shift']());}}}(a42_0x4902,0xad294));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a42_0x4902(){const _0x155260=['261842AiewWr','TD1\x20','tdx','Authorization','612368sqRQsO','8510nvFUED','210ahQOPQ','replace','12jsqkPP','324MqjBak','81bsbGCS','1974IdYWKJ','23960sjUtGh','X-Trino-User','version','length','8565869YdoVhi','1864uuxWyf','891xQjtKv',';\x20node/','100779zXWDfP'];a42_0x4902=function(){return _0x155260;};return a42_0x4902();}export function getUserAgent(){const _0x470179=a42_0x5241,_0x3e8500=getVersion(),_0x1f2854=platform(),_0x11a4ec=process[_0x470179(0x131)][_0x470179(0x12a)]('v','');return'tdx/'+_0x3e8500+'\x20('+_0x1f2854+_0x470179(0x121)+_0x11a4ec+')';}export function getAuthHeaders(_0x136cbf,_0x31535f){const _0x438b19=a42_0x5241,_0x47ad3f=getVersion(),_0x1dd13a={'User-Agent':getUserAgent(),'X-TD-Client':_0x438b19(0x125),'X-TD-Client-Version':_0x47ad3f};return _0x31535f&&(_0x1dd13a[_0x438b19(0x126)]=_0x438b19(0x124)+_0x31535f),_0x1dd13a;}export function toHeaderRecord(_0x338686){const _0x1e3b19={};for(const [_0x5dac83,_0x1e43b2]of Object['entries'](_0x338686)){_0x1e43b2!==undefined&&(_0x1e3b19[_0x5dac83]=_0x1e43b2);}return _0x1e3b19;}export function getTrinoHeaders(_0x511d6a,_0x3f0147){const _0x419d36=a42_0x5241,_0x1b5155=getAuthHeaders(_0x511d6a,_0x3f0147),_0x2da98d=toHeaderRecord(_0x1b5155);return delete _0x2da98d[_0x419d36(0x126)],_0x3f0147&&(_0x2da98d[_0x419d36(0x130)]=_0x3f0147),_0x2da98d;}function a42_0x5241(_0x548646,_0x473d35){_0x548646=_0x548646-0x121;const _0x4902ec=a42_0x4902();let _0x5241d7=_0x4902ec[_0x548646];return _0x5241d7;}export function hasAPIKey(_0xeb54ea){const _0x14554=a42_0x5241,_0x1843a9=getAPIKey(_0xeb54ea);return _0x1843a9!==undefined&&_0x1843a9[_0x14554(0x132)]>0x0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x2cc4fd,_0x45873f){const _0x2fb389=a41_0x394f,_0x3d5b2d=_0x2cc4fd();while(!![]){try{const _0x4fedb2=-parseInt(_0x2fb389(0x1a8))/0x1*(parseInt(_0x2fb389(0x199))/0x2)+-parseInt(_0x2fb389(0x1c2))/0x3+-parseInt(_0x2fb389(0x1be))/0x4+parseInt(_0x2fb389(0x19c))/0x5+-parseInt(_0x2fb389(0x1aa))/0x6+-parseInt(_0x2fb389(0x1a9))/0x7*(parseInt(_0x2fb389(0x1b2))/0x8)+-parseInt(_0x2fb389(0x1c4))/0x9*(-parseInt(_0x2fb389(0x1c3))/0xa);if(_0x4fedb2===_0x45873f)break;else _0x3d5b2d['push'](_0x3d5b2d['shift']());}catch(_0x1fd7f5){_0x3d5b2d['push'](_0x3d5b2d['shift']());}}}(a41_0x43f3,0x28510));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a41_0x534289 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';function a41_0x43f3(){const _0x2dcd72=['81DlmOrd','varchar','map','list','[query]','keys','sdk-result','[rule]','filter','spawn','stringify','noColor','forEach','[Object]','log','push','params','length','padEnd','[error]','end','debug','object','Results\x20saved\x20to\x20','cmdout','boolean','double','116KPpBNa','-FXRSn','json','1056415EUYXWS','[params]','isInteger','repeat','─┴─','bold','table','tsv','max','rule','stderr','limit','3958ghSlon','11263Kjthyx','1936974qEgEpK','color','format','inherit','resolve','trim','magenta','write','520BmXojI','─┬─','output','red','blue','string','error','stdin','stdout','[logs]','jsonl','less','896552AExeGL','query','number','entries','653742lbvRvx','1169870lvSuga'];a41_0x43f3=function(){return _0x2dcd72;};return a41_0x43f3();}export function isStructuredFormat(_0x658e53){const _0x5ae4c5=a41_0x394f;return _0x658e53[_0x5ae4c5(0x1ac)]===_0x5ae4c5(0x19b)||_0x658e53['format']===_0x5ae4c5(0x1bc)||_0x658e53[_0x5ae4c5(0x1ac)]==='tsv'||_0x658e53[_0x5ae4c5(0x1ac)]===_0x5ae4c5(0x1a2)||_0x658e53[_0x5ae4c5(0x19b)]===!![]||_0x658e53[_0x5ae4c5(0x1bc)]===!![]||_0x658e53[_0x5ae4c5(0x1a3)]===!![]||_0x658e53['table']===!![];}export function parseOutputOptions(_0xf66f6d){const _0x54e1b6=a41_0x394f;return{'format':_0xf66f6d[_0x54e1b6(0x1ac)]||'table','output':_0xf66f6d[_0x54e1b6(0x1b4)]||'','limit':_0xf66f6d['limit'],'color':_0xf66f6d[_0x54e1b6(0x1ab)],'noColor':_0xf66f6d[_0x54e1b6(0x1cf)]};}function convertSDKResultToQueryResult(_0x237951){const _0xa5fe4c=a41_0x394f,_0x3a1b06=[];if(_0x237951[_0xa5fe4c(0x1d5)]>0x0){const _0x4f1807=_0x237951[0x0];for(const [_0x308b4a,_0x4f5c48]of Object[_0xa5fe4c(0x1c1)](_0x4f1807)){let _0x1dd294=_0xa5fe4c(0x1c5);if(typeof _0x4f5c48===_0xa5fe4c(0x1c0))_0x1dd294=Number[_0xa5fe4c(0x19e)](_0x4f5c48)?'bigint':_0xa5fe4c(0x198);else{if(typeof _0x4f5c48==='boolean')_0x1dd294=_0xa5fe4c(0x197);else _0x4f5c48===null&&(_0x1dd294=_0xa5fe4c(0x1c5));}_0x3a1b06['push']({'name':_0x308b4a,'type':_0x1dd294});}}return{'queryId':_0xa5fe4c(0x1ca),'columns':_0x3a1b06,'data':_0x237951,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x237951['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x58ae3f,_0x4108e2){const _0x29a004=convertSDKResultToQueryResult(_0x58ae3f);return formatQueryOutput(_0x29a004,_0x4108e2);}export async function formatQueryOutput(_0x3a0bbb,_0x3830c7){const _0x49c064=a41_0x394f,{format:_0x2596ca,limit:_0x151494,output:_0x1152e6,color:_0x330f8a,noColor:_0x25594c}=_0x3830c7,_0x18aded=Boolean(_0x1152e6)&&!_0x330f8a,_0x3b300f={'color':_0x330f8a,'noColor':_0x25594c||_0x18aded};if(_0x2596ca==='table'){const _0x4320b3=shouldUseLess(_0x2596ca,_0x1152e6);return formatAsTable(_0x3a0bbb,_0x151494,_0x4320b3,_0x3b300f);}else{if(_0x2596ca==='json')return formatAsJSON(_0x3a0bbb,_0x3b300f);else return _0x2596ca===_0x49c064(0x1bc)?formatAsJSONL(_0x3a0bbb,_0x3b300f):formatQueryResult(_0x3a0bbb,_0x2596ca);}}function a41_0x394f(_0x39f9ef,_0x51ef8e){_0x39f9ef=_0x39f9ef-0x193;const _0x43f3c9=a41_0x43f3();let _0x394f8f=_0x43f3c9[_0x39f9ef];return _0x394f8f;}function shouldUseLess(_0x44b8e6,_0x3f7b33){const _0x157654=a41_0x394f;return(_0x44b8e6==='table'||_0x44b8e6===_0x157654(0x1c7))&&process[_0x157654(0x1ba)]['isTTY']&&!_0x3f7b33;}export function resolveOutputOptions(_0x3ead5f){const _0x51871e=a41_0x394f,_0x34dc60=resolveOutputFormat(_0x3ead5f[_0x51871e(0x1ac)],_0x3ead5f[_0x51871e(0x1b4)],_0x51871e(0x1a2));let _0x2f9574=typeof _0x3ead5f[_0x51871e(0x1a7)]===_0x51871e(0x1c0)?_0x3ead5f[_0x51871e(0x1a7)]:parseInt(_0x3ead5f[_0x51871e(0x1a7)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0xcdf9e9=_0x3ead5f[_0x51871e(0x1b4)]||'';return shouldUseLess(_0x34dc60,_0xcdf9e9)&&(_0x2f9574=Infinity),{'format':_0x34dc60,'output':_0xcdf9e9,'limit':_0x2f9574,'color':_0x3ead5f[_0x51871e(0x1ab)],'noColor':_0x3ead5f['noColor']};}export function writeOutput(_0x3217ac,_0x105d5a,_0x466f32){const _0x1d03e2=a41_0x394f;return _0x105d5a?(writeFileSync(_0x105d5a,_0x3217ac),console[_0x1d03e2(0x1b8)](_0x1d03e2(0x195)+_0x105d5a),Promise[_0x1d03e2(0x1ae)]()):shouldUseLess(_0x466f32||'','')?new Promise(_0x2d628b=>{const _0x11e9b2=_0x1d03e2,_0x3d02ca=spawn(_0x11e9b2(0x1bd),[_0x11e9b2(0x19a)],{'stdio':['pipe',_0x11e9b2(0x1ad),_0x11e9b2(0x1ad)]});let _0x231369=![];_0x3d02ca['on'](_0x11e9b2(0x1b8),()=>{const _0x2e1750=_0x11e9b2;!_0x231369&&(_0x231369=!![],console[_0x2e1750(0x1d2)](_0x3217ac),_0x2d628b());}),_0x3d02ca['on']('close',()=>{!_0x231369&&(_0x231369=!![],_0x2d628b());}),_0x3d02ca['on'](_0x11e9b2(0x1cd),()=>{const _0x30b63f=_0x11e9b2;!_0x231369&&_0x3d02ca[_0x30b63f(0x1b9)]&&(_0x3d02ca['stdin']['on'](_0x30b63f(0x1b8),()=>{}),_0x3d02ca[_0x30b63f(0x1b9)][_0x30b63f(0x1b1)](_0x3217ac),_0x3d02ca['stdin'][_0x30b63f(0x1d8)]());}),!_0x3d02ca[_0x11e9b2(0x1b9)]&&(!_0x231369&&(_0x231369=!![],console[_0x11e9b2(0x1d2)](_0x3217ac),_0x2d628b()));}):(console[_0x1d03e2(0x1d2)](_0x3217ac),Promise[_0x1d03e2(0x1ae)]());}export async function handleSDKOutput(_0x1a8382,_0x2d801d){const _0xe5a3f9=a41_0x394f,_0x22ced9=resolveOutputOptions(_0x2d801d),_0x46c89a=await formatSDKOutput(_0x1a8382,_0x22ced9);await writeOutput(_0x46c89a,_0x22ced9['output']||undefined,_0x22ced9[_0xe5a3f9(0x1ac)]);}export async function handleQueryOutput(_0x5ca2ce,_0x570d04){const _0x64e4dc=a41_0x394f,_0x2a7057=resolveOutputOptions(_0x570d04),_0xe944fd=await formatQueryOutput(_0x5ca2ce,_0x2a7057);await writeOutput(_0xe944fd,_0x2a7057[_0x64e4dc(0x1b4)]||undefined,_0x2a7057['format']);}async function formatSingleObject(_0x502637,_0x162357){const _0x41b95d=a41_0x394f,{format:_0x48d2b1,color:_0x551440,noColor:_0x190f75}=_0x162357,_0x3a045e={'color':_0x551440,'noColor':_0x190f75};if(_0x48d2b1===_0x41b95d(0x19b)){if(shouldUseColor(_0x3a045e))return colorizeJSON(_0x502637,_0x3a045e);return JSON[_0x41b95d(0x1ce)](_0x502637,null,0x2);}else{if(_0x48d2b1===_0x41b95d(0x1bc)){if(shouldUseColor(_0x3a045e))return colorizeJSONCompact(_0x502637,_0x3a045e);return JSON['stringify'](_0x502637);}else{if(_0x48d2b1===_0x41b95d(0x1a3))return Object['entries'](_0x502637)[_0x41b95d(0x1c6)](([_0x5cf371,_0x1ee10c])=>_0x5cf371+'\x09'+_0x1ee10c)['join']('\x0a');else{const _0x272972=Object[_0x41b95d(0x1c1)](_0x502637);if(_0x272972['length']===0x0)return'No\x20data';const _0x55ea7b=_0x502637['debug'],_0x52f0ad=_0x502637[_0x41b95d(0x1bf)],_0x942344=_0x502637[_0x41b95d(0x1d4)],_0x4cdd84=_0x502637[_0x41b95d(0x1a5)],_0xb5797a=_0x52f0ad?typeof _0x52f0ad===_0x41b95d(0x1b7)?_0x52f0ad:JSON[_0x41b95d(0x1ce)](_0x52f0ad,null,0x2):undefined,_0x26d91a=_0x942344&&Object['keys'](_0x942344)[_0x41b95d(0x1d5)]>0x0?JSON[_0x41b95d(0x1ce)](_0x942344,null,0x2):undefined,_0x6a44cd=_0x4cdd84&&Object[_0x41b95d(0x1c9)](_0x4cdd84)[_0x41b95d(0x1d5)]>0x0?JSON[_0x41b95d(0x1ce)](_0x4cdd84,null,0x2):undefined,_0x528670=_0x272972[_0x41b95d(0x1cc)](([_0xf2c406])=>_0xf2c406!==_0x41b95d(0x193)&&_0xf2c406!==_0x41b95d(0x1bf)&&_0xf2c406!=='params'&&_0xf2c406!==_0x41b95d(0x1a5)),_0x216404=Math['max'](..._0x528670[_0x41b95d(0x1c6)](([_0x2a7458])=>_0x2a7458[_0x41b95d(0x1d5)])),_0x3c8317=Math['max'](..._0x528670[_0x41b95d(0x1c6)](([,_0x455bda])=>{const _0x5a4631=_0x41b95d;try{const _0x2ea140=_0x455bda===null||_0x455bda===undefined?'':typeof _0x455bda===_0x5a4631(0x194)?JSON[_0x5a4631(0x1ce)](_0x455bda):String(_0x455bda),_0x2b765e=_0x2ea140['split']('\x0a');return Math[_0x5a4631(0x1a4)](..._0x2b765e[_0x5a4631(0x1c6)](_0x5672d5=>_0x5672d5[_0x5a4631(0x1d5)]),0x0);}catch{return 0x0;}}),0x14),_0x4d3483=[];_0x4d3483[_0x41b95d(0x1d3)](colorBorder('┌─'+'─'[_0x41b95d(0x19f)](_0x216404)+_0x41b95d(0x1b3)+'─'['repeat'](_0x3c8317)+'─┐',_0x3a045e)),_0x528670['forEach'](([_0x16fb5b,_0x3f8fa6])=>{const _0x32e907=_0x41b95d;let _0x679a1e;try{_0x679a1e=_0x3f8fa6===null||_0x3f8fa6===undefined?'':typeof _0x3f8fa6===_0x32e907(0x194)?JSON[_0x32e907(0x1ce)](_0x3f8fa6):String(_0x3f8fa6);}catch{_0x679a1e=_0x32e907(0x1d1);}const _0x46f59a=_0x16fb5b[_0x32e907(0x1d6)](_0x216404),_0x183d30=_0x679a1e['split']('\x0a');_0x183d30['forEach']((_0x329854,_0x87ec3b)=>{const _0x52a6f8=_0x32e907,_0x27c64d=colorBorder('│',_0x3a045e);_0x87ec3b===0x0?_0x4d3483[_0x52a6f8(0x1d3)](_0x27c64d+'\x20'+_0x46f59a+'\x20'+_0x27c64d+'\x20'+_0x329854['padEnd'](_0x3c8317)+'\x20'+_0x27c64d):_0x4d3483['push'](_0x27c64d+'\x20'+'\x20'[_0x52a6f8(0x19f)](_0x216404)+'\x20'+_0x27c64d+'\x20'+_0x329854[_0x52a6f8(0x1d6)](_0x3c8317)+'\x20'+_0x27c64d);});}),_0x4d3483[_0x41b95d(0x1d3)](colorBorder('└─'+'─'[_0x41b95d(0x19f)](_0x216404)+_0x41b95d(0x1a0)+'─'[_0x41b95d(0x19f)](_0x3c8317)+'─┘',_0x3a045e));_0xb5797a&&(_0x4d3483['push'](''),_0x4d3483[_0x41b95d(0x1d3)](String(a41_0x534289['yellow'][_0x41b95d(0x1a1)](_0x41b95d(0x1c8)))),_0x4d3483['push'](_0xb5797a));_0x26d91a&&(_0x4d3483[_0x41b95d(0x1d3)](''),_0x4d3483[_0x41b95d(0x1d3)](String(a41_0x534289[_0x41b95d(0x1b6)]['bold'](_0x41b95d(0x19d)))),_0x4d3483['push'](_0x26d91a));_0x6a44cd&&(_0x4d3483[_0x41b95d(0x1d3)](''),_0x4d3483[_0x41b95d(0x1d3)](String(a41_0x534289[_0x41b95d(0x1b0)][_0x41b95d(0x1a1)](_0x41b95d(0x1cb)))),_0x4d3483['push'](_0x6a44cd));if(_0x55ea7b){if(_0x55ea7b[_0x41b95d(0x1a6)]){_0x4d3483[_0x41b95d(0x1d3)](''),_0x4d3483['push'](String(a41_0x534289[_0x41b95d(0x1b5)][_0x41b95d(0x1a1)](_0x41b95d(0x1d7))));const _0x2f21c1=_0x55ea7b['stderr']['split']('\x0a');_0x2f21c1[_0x41b95d(0x1d0)](_0x166161=>{const _0x5a2e3a=_0x41b95d;_0x166161[_0x5a2e3a(0x1af)]()&&_0x4d3483[_0x5a2e3a(0x1d3)](_0x166161);});}if(_0x55ea7b[_0x41b95d(0x196)]){_0x4d3483[_0x41b95d(0x1d3)](''),_0x4d3483[_0x41b95d(0x1d3)](String(a41_0x534289['cyan'][_0x41b95d(0x1a1)](_0x41b95d(0x1bb))));const _0x4a4802=_0x55ea7b[_0x41b95d(0x196)]['split']('\x0a');_0x4a4802[_0x41b95d(0x1d0)](_0x592fe2=>{const _0x38c532=_0x41b95d;_0x592fe2[_0x38c532(0x1af)]()&&_0x4d3483[_0x38c532(0x1d3)](_0x592fe2);});}}return _0x4d3483['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0xa16b5a,_0x3e131d){const _0x1fba61=a41_0x394f;if(_0x3e131d[_0x1fba61(0x1ac)]===_0x1fba61(0x1a2)){await handleSDKOutput([_0xa16b5a],_0x3e131d);return;}const _0x3c1ae4=resolveOutputOptions(_0x3e131d),_0x8ce851=await formatSingleObject(_0xa16b5a,_0x3c1ae4);await writeOutput(_0x8ce851,_0x3c1ae4['output']||undefined,_0x3c1ae4[_0x1fba61(0x1ac)]);}
|
|
1
|
+
(function(_0x1d7afe,_0x46e997){const _0x49b6a2=a43_0x4c95,_0xe5b69a=_0x1d7afe();while(!![]){try{const _0x5d39f6=parseInt(_0x49b6a2(0x94))/0x1+parseInt(_0x49b6a2(0x86))/0x2+parseInt(_0x49b6a2(0xad))/0x3*(-parseInt(_0x49b6a2(0x79))/0x4)+parseInt(_0x49b6a2(0x95))/0x5*(parseInt(_0x49b6a2(0x71))/0x6)+-parseInt(_0x49b6a2(0x75))/0x7*(parseInt(_0x49b6a2(0x7f))/0x8)+-parseInt(_0x49b6a2(0x8f))/0x9*(parseInt(_0x49b6a2(0x8b))/0xa)+parseInt(_0x49b6a2(0xa2))/0xb;if(_0x5d39f6===_0x46e997)break;else _0xe5b69a['push'](_0xe5b69a['shift']());}catch(_0x54a99e){_0xe5b69a['push'](_0xe5b69a['shift']());}}}(a43_0xe9d6,0xcd87d));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';function a43_0x4c95(_0x248f05,_0x45cb2a){_0x248f05=_0x248f05-0x70;const _0xe9d6b9=a43_0xe9d6();let _0x4c9577=_0xe9d6b9[_0x248f05];return _0x4c9577;}import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a43_0x4c0838 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x506211){const _0x1346ae=a43_0x4c95;return _0x506211[_0x1346ae(0x81)]==='json'||_0x506211[_0x1346ae(0x81)]===_0x1346ae(0x9b)||_0x506211[_0x1346ae(0x81)]==='tsv'||_0x506211[_0x1346ae(0x81)]==='table'||_0x506211[_0x1346ae(0x78)]===!![]||_0x506211[_0x1346ae(0x9b)]===!![]||_0x506211[_0x1346ae(0x73)]===!![]||_0x506211[_0x1346ae(0xa3)]===!![];}export function parseOutputOptions(_0x20180b){const _0x3e05d7=a43_0x4c95;return{'format':_0x20180b['format']||_0x3e05d7(0xa3),'output':_0x20180b['output']||'','limit':_0x20180b['limit'],'color':_0x20180b[_0x3e05d7(0xa5)],'noColor':_0x20180b[_0x3e05d7(0xa9)]};}function convertSDKResultToQueryResult(_0x275b20){const _0x3d4c7f=a43_0x4c95,_0x4b52f1=[];if(_0x275b20[_0x3d4c7f(0x8e)]>0x0){const _0x71aea6=_0x275b20[0x0];for(const [_0x5778c9,_0x3c8561]of Object['entries'](_0x71aea6)){let _0x4aec40=_0x3d4c7f(0x87);if(typeof _0x3c8561===_0x3d4c7f(0xa8))_0x4aec40=Number['isInteger'](_0x3c8561)?_0x3d4c7f(0xa4):_0x3d4c7f(0x89);else{if(typeof _0x3c8561==='boolean')_0x4aec40=_0x3d4c7f(0x96);else _0x3c8561===null&&(_0x4aec40=_0x3d4c7f(0x87));}_0x4b52f1[_0x3d4c7f(0x77)]({'name':_0x5778c9,'type':_0x4aec40});}}return{'queryId':_0x3d4c7f(0xae),'columns':_0x4b52f1,'data':_0x275b20,'stats':{'state':_0x3d4c7f(0xa1),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x275b20[_0x3d4c7f(0x8e)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x3b9637,_0x1b8948){const _0x237d96=convertSDKResultToQueryResult(_0x3b9637);return formatQueryOutput(_0x237d96,_0x1b8948);}export async function formatQueryOutput(_0x4c47c0,_0x1eda9f){const _0x59c5ed=a43_0x4c95,{format:_0xf5bcfa,limit:_0x44956c,output:_0x336251,color:_0x4c169e,noColor:_0x48158a}=_0x1eda9f,_0xf48bf2=Boolean(_0x336251)&&!_0x4c169e,_0x42314a={'color':_0x4c169e,'noColor':_0x48158a||_0xf48bf2};if(_0xf5bcfa==='table'){const _0x3a2e7d=shouldUseLess(_0xf5bcfa,_0x336251);return formatAsTable(_0x4c47c0,_0x44956c,_0x3a2e7d,_0x42314a);}else{if(_0xf5bcfa===_0x59c5ed(0x78))return formatAsJSON(_0x4c47c0,_0x42314a);else return _0xf5bcfa===_0x59c5ed(0x9b)?formatAsJSONL(_0x4c47c0,_0x42314a):formatQueryResult(_0x4c47c0,_0xf5bcfa);}}function shouldUseLess(_0x3934ab,_0x2e2cae){const _0x2e7cbf=a43_0x4c95;return(_0x3934ab===_0x2e7cbf(0xa3)||_0x3934ab===_0x2e7cbf(0xac))&&process['stdout'][_0x2e7cbf(0x9c)]&&!_0x2e2cae;}export function resolveOutputOptions(_0x348537){const _0x1b7a7c=a43_0x4c95,_0x2bcb1d=resolveOutputFormat(_0x348537[_0x1b7a7c(0x81)],_0x348537[_0x1b7a7c(0x93)],'table');let _0x24e16c=typeof _0x348537[_0x1b7a7c(0x85)]===_0x1b7a7c(0xa8)?_0x348537['limit']:parseInt(_0x348537['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x24b002=_0x348537['output']||'';return shouldUseLess(_0x2bcb1d,_0x24b002)&&(_0x24e16c=Infinity),{'format':_0x2bcb1d,'output':_0x24b002,'limit':_0x24e16c,'color':_0x348537[_0x1b7a7c(0xa5)],'noColor':_0x348537[_0x1b7a7c(0xa9)]};}export function writeOutput(_0x33b1c3,_0x22404d,_0x3ebbb9){const _0x3710a2=a43_0x4c95;return _0x22404d?(writeFileSync(_0x22404d,_0x33b1c3),console['error'](_0x3710a2(0xab)+_0x22404d),Promise[_0x3710a2(0x7c)]()):shouldUseLess(_0x3ebbb9||'','')?new Promise(_0x569303=>{const _0x3ebde0=_0x3710a2,_0x2e9fbd=spawn(_0x3ebde0(0x90),[_0x3ebde0(0x72)],{'stdio':['pipe',_0x3ebde0(0x99),'inherit']});let _0x207c3c=![];_0x2e9fbd['on'](_0x3ebde0(0xaf),()=>{!_0x207c3c&&(_0x207c3c=!![],console['log'](_0x33b1c3),_0x569303());}),_0x2e9fbd['on'](_0x3ebde0(0x98),()=>{!_0x207c3c&&(_0x207c3c=!![],_0x569303());}),_0x2e9fbd['on']('spawn',()=>{const _0x1969de=_0x3ebde0;!_0x207c3c&&_0x2e9fbd['stdin']&&(_0x2e9fbd[_0x1969de(0x80)]['on'](_0x1969de(0xaf),()=>{}),_0x2e9fbd[_0x1969de(0x80)][_0x1969de(0x7e)](_0x33b1c3),_0x2e9fbd[_0x1969de(0x80)]['end']());}),!_0x2e9fbd[_0x3ebde0(0x80)]&&(!_0x207c3c&&(_0x207c3c=!![],console[_0x3ebde0(0x91)](_0x33b1c3),_0x569303()));}):(console[_0x3710a2(0x91)](_0x33b1c3),Promise['resolve']());}export async function handleSDKOutput(_0x4f8687,_0x438399){const _0x55d196=a43_0x4c95,_0x530a0a=resolveOutputOptions(_0x438399),_0x5620dd=await formatSDKOutput(_0x4f8687,_0x530a0a);await writeOutput(_0x5620dd,_0x530a0a[_0x55d196(0x93)]||undefined,_0x530a0a['format']);}export async function handleQueryOutput(_0x165a91,_0x32582){const _0x2eefd7=a43_0x4c95,_0x72177b=resolveOutputOptions(_0x32582),_0x16da92=await formatQueryOutput(_0x165a91,_0x72177b);await writeOutput(_0x16da92,_0x72177b[_0x2eefd7(0x93)]||undefined,_0x72177b[_0x2eefd7(0x81)]);}async function formatSingleObject(_0x14f5b6,_0xb45384){const _0x3f83aa=a43_0x4c95,{format:_0x539e44,color:_0x462082,noColor:_0x295c8e}=_0xb45384,_0x8f4e7={'color':_0x462082,'noColor':_0x295c8e};if(_0x539e44===_0x3f83aa(0x78)){if(shouldUseColor(_0x8f4e7))return colorizeJSON(_0x14f5b6,_0x8f4e7);return JSON[_0x3f83aa(0x8a)](_0x14f5b6,null,0x2);}else{if(_0x539e44===_0x3f83aa(0x9b)){if(shouldUseColor(_0x8f4e7))return colorizeJSONCompact(_0x14f5b6,_0x8f4e7);return JSON[_0x3f83aa(0x8a)](_0x14f5b6);}else{if(_0x539e44===_0x3f83aa(0x73))return Object[_0x3f83aa(0xaa)](_0x14f5b6)['map'](([_0x2672a5,_0x21e195])=>_0x2672a5+'\x09'+_0x21e195)[_0x3f83aa(0xa7)]('\x0a');else{const _0x5abb2e=Object[_0x3f83aa(0xaa)](_0x14f5b6);if(_0x5abb2e['length']===0x0)return'No\x20data';const _0x4e2d5e=_0x14f5b6[_0x3f83aa(0xa6)],_0x4c49c8=_0x14f5b6[_0x3f83aa(0x70)],_0x14fea1=_0x14f5b6[_0x3f83aa(0x8d)],_0x240b25=_0x14f5b6[_0x3f83aa(0x83)],_0x5eb58f=_0x4c49c8?typeof _0x4c49c8===_0x3f83aa(0xb0)?_0x4c49c8:JSON['stringify'](_0x4c49c8,null,0x2):undefined,_0x560ab4=_0x14fea1&&Object['keys'](_0x14fea1)[_0x3f83aa(0x8e)]>0x0?JSON[_0x3f83aa(0x8a)](_0x14fea1,null,0x2):undefined,_0x268c72=_0x240b25&&Object['keys'](_0x240b25)[_0x3f83aa(0x8e)]>0x0?JSON[_0x3f83aa(0x8a)](_0x240b25,null,0x2):undefined,_0xe14435=_0x5abb2e[_0x3f83aa(0x82)](([_0x2f4bf7])=>_0x2f4bf7!=='debug'&&_0x2f4bf7!=='query'&&_0x2f4bf7!==_0x3f83aa(0x8d)&&_0x2f4bf7!==_0x3f83aa(0x83)),_0x1eadd3=Math[_0x3f83aa(0x8c)](..._0xe14435[_0x3f83aa(0x74)](([_0x35e013])=>_0x35e013[_0x3f83aa(0x8e)])),_0x3f173c=Math['max'](..._0xe14435[_0x3f83aa(0x74)](([,_0x5ceabe])=>{const _0x225b38=_0x3f83aa;try{const _0x4735e5=_0x5ceabe===null||_0x5ceabe===undefined?'':typeof _0x5ceabe===_0x225b38(0x76)?JSON[_0x225b38(0x8a)](_0x5ceabe):String(_0x5ceabe),_0x1dc38d=_0x4735e5[_0x225b38(0x92)]('\x0a');return Math[_0x225b38(0x8c)](..._0x1dc38d[_0x225b38(0x74)](_0x3c51ce=>_0x3c51ce[_0x225b38(0x8e)]),0x0);}catch{return 0x0;}}),0x14),_0x16b25b=[];_0x16b25b[_0x3f83aa(0x77)](colorBorder('┌─'+'─'[_0x3f83aa(0xb1)](_0x1eadd3)+'─┬─'+'─'[_0x3f83aa(0xb1)](_0x3f173c)+'─┐',_0x8f4e7)),_0xe14435[_0x3f83aa(0x84)](([_0x7c3cbb,_0x98195e])=>{const _0x344d54=_0x3f83aa;let _0x16e54a;try{_0x16e54a=_0x98195e===null||_0x98195e===undefined?'':typeof _0x98195e===_0x344d54(0x76)?JSON['stringify'](_0x98195e):String(_0x98195e);}catch{_0x16e54a=_0x344d54(0x9d);}const _0x1b4079=_0x7c3cbb[_0x344d54(0x7b)](_0x1eadd3),_0x2b094e=_0x16e54a[_0x344d54(0x92)]('\x0a');_0x2b094e[_0x344d54(0x84)]((_0x959189,_0x2b649c)=>{const _0x152b5e=_0x344d54,_0x3622e5=colorBorder('│',_0x8f4e7);_0x2b649c===0x0?_0x16b25b[_0x152b5e(0x77)](_0x3622e5+'\x20'+_0x1b4079+'\x20'+_0x3622e5+'\x20'+_0x959189[_0x152b5e(0x7b)](_0x3f173c)+'\x20'+_0x3622e5):_0x16b25b[_0x152b5e(0x77)](_0x3622e5+'\x20'+'\x20'[_0x152b5e(0xb1)](_0x1eadd3)+'\x20'+_0x3622e5+'\x20'+_0x959189[_0x152b5e(0x7b)](_0x3f173c)+'\x20'+_0x3622e5);});}),_0x16b25b[_0x3f83aa(0x77)](colorBorder('└─'+'─'[_0x3f83aa(0xb1)](_0x1eadd3)+'─┴─'+'─'[_0x3f83aa(0xb1)](_0x3f173c)+'─┘',_0x8f4e7));_0x5eb58f&&(_0x16b25b[_0x3f83aa(0x77)](''),_0x16b25b[_0x3f83aa(0x77)](String(a43_0x4c0838[_0x3f83aa(0x7a)][_0x3f83aa(0x9e)](_0x3f83aa(0x9f)))),_0x16b25b[_0x3f83aa(0x77)](_0x5eb58f));_0x560ab4&&(_0x16b25b[_0x3f83aa(0x77)](''),_0x16b25b[_0x3f83aa(0x77)](String(a43_0x4c0838['blue']['bold']('[params]'))),_0x16b25b['push'](_0x560ab4));_0x268c72&&(_0x16b25b[_0x3f83aa(0x77)](''),_0x16b25b[_0x3f83aa(0x77)](String(a43_0x4c0838[_0x3f83aa(0x9a)]['bold']('[rule]'))),_0x16b25b[_0x3f83aa(0x77)](_0x268c72));if(_0x4e2d5e){if(_0x4e2d5e[_0x3f83aa(0x7d)]){_0x16b25b[_0x3f83aa(0x77)](''),_0x16b25b[_0x3f83aa(0x77)](String(a43_0x4c0838[_0x3f83aa(0x88)][_0x3f83aa(0x9e)]('[error]')));const _0x117c93=_0x4e2d5e[_0x3f83aa(0x7d)][_0x3f83aa(0x92)]('\x0a');_0x117c93['forEach'](_0x1a0961=>{const _0x430074=_0x3f83aa;_0x1a0961['trim']()&&_0x16b25b[_0x430074(0x77)](_0x1a0961);});}if(_0x4e2d5e['cmdout']){_0x16b25b[_0x3f83aa(0x77)](''),_0x16b25b['push'](String(a43_0x4c0838[_0x3f83aa(0x97)][_0x3f83aa(0x9e)](_0x3f83aa(0xa0))));const _0x2d6507=_0x4e2d5e['cmdout'][_0x3f83aa(0x92)]('\x0a');_0x2d6507[_0x3f83aa(0x84)](_0x2659ad=>{const _0x3d9322=_0x3f83aa;_0x2659ad['trim']()&&_0x16b25b[_0x3d9322(0x77)](_0x2659ad);});}}return _0x16b25b[_0x3f83aa(0xa7)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x2229ae,_0x4a1424){const _0xf8e452=a43_0x4c95;if(_0x4a1424[_0xf8e452(0x81)]===_0xf8e452(0xa3)){await handleSDKOutput([_0x2229ae],_0x4a1424);return;}const _0x1f95e1=resolveOutputOptions(_0x4a1424),_0x69e2d6=await formatSingleObject(_0x2229ae,_0x1f95e1);await writeOutput(_0x69e2d6,_0x1f95e1[_0xf8e452(0x93)]||undefined,_0x1f95e1[_0xf8e452(0x81)]);}function a43_0xe9d6(){const _0x2eaff4=['close','inherit','magenta','jsonl','isTTY','[Object]','bold','[query]','[logs]','FINISHED','3168374Ngzjtk','table','bigint','color','debug','join','number','noColor','entries','Results\x20saved\x20to\x20','list','6fgdbHK','sdk-result','error','string','repeat','query','372kWKIVG','-FXRSn','tsv','map','686546SfyAiw','object','push','json','1536888wcuZEQ','yellow','padEnd','resolve','stderr','write','136vOVNbK','stdin','format','filter','rule','forEach','limit','3366964DLUClp','varchar','red','double','stringify','207710PkkqkJ','max','params','length','153VQsLey','less','log','split','output','1052544toqeBw','48925KXwxKH','boolean','cyan'];a43_0xe9d6=function(){return _0x2eaff4;};return a43_0xe9d6();}
|