@treasuredata/tdx 2026.8.0 → 2026.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.d.ts +9 -0
- package/dist/commands/auth-command.d.ts.map +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-command.js.map +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts +10 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-always-on-campaign-pull-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-move-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/table-deleted.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/site-mismatch.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/auth-token.d.ts +23 -0
- package/dist/sdk/auth-token.d.ts.map +1 -0
- package/dist/sdk/auth-token.js +1 -0
- package/dist/sdk/auth-token.js.map +1 -0
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.js +1 -1
- package/dist/sdk/cas/cas-audience-validator.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/cas/validate-files.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
- package/dist/sdk/engage/always-on-campaign-push.js +1 -1
- package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
- package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/user-settings.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/util/tree-search.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/claude-code-state.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/proxy-fetch.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a59_0x5f4ff5=a59_0x47c9;(function(_0x1bd117,_0x10894){const _0x234eef=a59_0x47c9,_0x2df622=_0x1bd117();while(!![]){try{const _0x3b576d=-parseInt(_0x234eef(0x1b5))/0x1*(parseInt(_0x234eef(0x27f))/0x2)+-parseInt(_0x234eef(0x11b))/0x3+parseInt(_0x234eef(0x149))/0x4*(parseInt(_0x234eef(0x274))/0x5)+parseInt(_0x234eef(0x181))/0x6+parseInt(_0x234eef(0x14a))/0x7*(-parseInt(_0x234eef(0x124))/0x8)+parseInt(_0x234eef(0x1d3))/0x9*(parseInt(_0x234eef(0x266))/0xa)+-parseInt(_0x234eef(0x24e))/0xb;if(_0x3b576d===_0x10894)break;else _0x2df622['push'](_0x2df622['shift']());}catch(_0x1b9ff2){_0x2df622['push'](_0x2df622['shift']());}}}(a59_0x5f4b,0xcd576));import a59_0xc31aad from'chalk';import{existsSync}from'fs';import a59_0x532ea4 from'path';import{BaseCommand}from'./command.js';function a59_0x5f4b(){const _0x1b0907=['Fetching\x20workflow\x20','\x20(use\x20a\x20larger\x20--limit\x20to\x20show\x20more)','workflow:attempts','Resume\x20from:\x20','MAX_LABEL_COUNT','Listing\x20workflow\x20projects...','yes','resolveProjectId','join','Auto-selected\x20latest\x20session:\x20','success','No\x20attempts\x20found','trimEnd','Enabling\x20schedule\x20#','blue','Tip:\x20cd\x20to\x20workflows/','title','5343836OPxkVd','312004GcoFDn','Loading\x20sessions...','(use\x20--limit\x20to\x20see\x20more)','sessionTime','indexOf','Listing\x20schedules\x20for\x20','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','\x20\x20(no\x20tasks\x20found\x20in\x20workflow\x20definition)','→\x20Project:\x20','Source\x20directory\x20is\x20required','unknown','Download\x20workflow\x20project\x20from\x20Treasure\x20AI','limit','Session\x20not\x20found:\x20','sys','pullProject','\x20has\x20no\x20attempts','✔\x20Secret\x20\x27','workflow:push','existingProjectId','Usage:\x20tdx\x20wf\x20schedule\x20list\x20[project[.workflow]]\x20|\x20--schedule-id\x20<id>','newProjectId','kill','Pull\x20workflow\x20project\x20to\x20local\x20folder','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Retrying\x20session...','\x20\x20Changes:\x20','sessionId','context','Workflow:\x20','dryRun','Error:\x20Project\x20name\x20is\x20required','isTTY','planned','log','tdx.json','No\x20workflow\x20tdx.json\x20found','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','setSecrets','applyPullProject','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','updatedAt','Disabling\x20schedule\x20#','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','get','includes','split','index','workflow:timeline','List\x20workflow\x20execution\x20sessions','attempts','executeCloneProject','state','generateSessionTimelineRows','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','2638518zSlAzi','→\x20New\x20project:\x20','navigateSessionsInteractive','fileCount','workflow:upload','data','\x20enabled\x20(','Listing\x20secrets...','Enable\x20a\x20workflow\x20schedule','task','No\x20sessions\x20found\x20for:\x20','ICON_WIDTH','workflow:schedule:enable','modified','\x20is\x20not\x20a\x20directory','all','workflow:secrets:list','Cloning\x20to\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','revision:\x20','write','\x20(use\x20--limit\x20to\x20show\x20more)','group_error','Analyzing\x20project...','No\x20workflow\x20sessions\x20found','\x20tasks','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Using\x20attempt\x20','✔\x20Clone\x20complete','stringify','filter','params','MAX_POLL_ITERATIONS','yellow','\x20\x20Project\x20ID:\x20','fullName','\x22\x20with\x20new\x20revision?','finishedAt','toISOString','attempt','workflow:use','workflowProject','Schedule:\x20backfill\x20runs\x20enabled\x20(--backfill)','message','running','Listing\x20workflow\x20sessions...','Retry\x20a\x20session\x20or\x20attempt','executeDryRun','min','workflow:projects','workflow:pull','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','558jiNqAK','status','targetDir','disableSchedule','✔\x20Workflow\x20project\x20context\x20cleared.','Key:\x20','New\x20project\x20name:\x20','showWorkflowConsoleUrl','config','Session\x20time:','getHours','duration','Delete\x20workflow\x20project\x20from\x20Treasure\x20AI','resolveProjectDir','every','MIN_LABEL_COUNT','stat','projectName','tasks','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','✔\x20Retry\x20started','text','✔\x20Push\x20complete','Warning:','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','...','\x20\x20Location:\x20','enableSchedule','List\x20workflows','getTime','18THkKnb','includeRetried','Invalid\x20format:\x20','LABEL_MIN_SPACING','workflow:sessions','workflow:delete','slice','now','\x20from\x20session\x20','skipSchedule','\x22\x20already\x20exists\x20(ID:\x20','GUTTER','jsonl','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','new',',\x20Workflow:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','🔄\x20','dim','length','resumeFrom','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','getSchedule','Retrying\x20attempt...','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','\x20\x20Session\x20context\x20set\x20to:\x20','Updating\x20','\x20-\x20','\x20next:\x20','Workflow:','values','workflow:download','pollTimeline','Schedule\x20ID\x20is\x20required','window','Source:\x20','✔\x20Downloaded\x20','✔\x20Project:\x20','\x20sessions\x20','Downloading\x20logs...','isDirectory','cancelRequested','Validation:\x20skipped','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','bold','✔\x20Workflow\x20project\x20set\x20to:\x20','listProjectSchedules','workflow','Project:\x20','reason','type','workflowName','✔\x20Deleted\x20project\x20','List\x20all\x20workflow\x20projects','red','listSchedules','\x0aFailed\x20to\x20fetch\x20attempt\x20data','table','\x20deleted','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','replace','createdAt','Include\x20retried:\x20yes','No\x20matching\x20sessions\x20found','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','download','Loading\x20session...','set','--schedule-id\x20cannot\x20be\x20combined\x20with\x20a\x20project.workflow\x20filter','buildTimelineData','msPerChar','Error:\x20Invalid\x20JSON\x20in\x20--params','readFile','MAX_TASKS_DISPLAY','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','prepareCloneProject','nextRunTime','workflow:logs','summary','Deleting\x20project\x20','\x20\x20Console:\x20','parse','repeat','Params:\x20','floor','description','Error:','\x0aDry\x20run\x20-\x20no\x20files\x20written','\x22\x20to\x20new\x20project\x20\x22','📁\x20','from','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','getWorkflow','Fetching\x20schedule\x20#','Target\x20directory:\x20','canceling','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','Expected\x20format:\x20--param\x20key=value','preparePushProject','✔\x20Workflow\x20run\x20started','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','logFiles','\x20(disabled)','\x20secrets\x20set\x20for\x20project\x20\x27','💡\x20Tip:\x20Use\x20','\x0a[Dry\x20run]\x20Workflow\x20was\x20NOT\x20executed.','Filter:\x20project=','attempt:','nextTime','cwd','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','workflow:tasks','relative','No\x20sessions\x20found\x20in\x20project:\x20','Target:\x20','\x20disabled\x20(','⚠\x20Showing\x20first\x20','Attempt:\x20','\x20\x20Session\x20ID:\x20','session','\x0aPolling...\x20(','keys','6927844UPWGiq','Pushing\x20project...','Pattern:\x20','match','\x0a✔\x20Attempt\x20complete','\x20\x20tdx\x20wf\x20use\x20<project>','Show\x20tasks\x20for\x20an\x20attempt','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','\x20schedule','sort','No\x20log\x20content\x20found','\x1b[1A\x1b[2K','Failed\x20to\x20fetch\x20attempt\x20data','Total:\x20','getDate','Task\x20graph:','Attempt\x20ID:\x20','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','push','Resolving\x20project\x20\x27','Project\x20directory:\x20','fill','substring','Listing\x20workflows...','7283500Tvxxft','✔\x20Found\x20','projects','verbose','---\x20','renderSingleTimeline','Kill\x20a\x20running\x20attempt','Source\x20directory:\x20','-\x20nothing\x20pushed','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','Project\x20name:\x20','Session\x20time:\x20','startedAt','splice','5UhsUDj','\x0aClone\x20\x22','Writing\x20files...','json','Project\x20name\x20is\x20required','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','TASK_NAME_WIDTH','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','parseProjectWorkflowPattern','targetExists','2812BQazuL','Deleting\x20secret...','force','name','\x20\x20Revision:\x20','isArray','some','path','icon','Parameters:','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','changes','session_id','run','Files\x20to\x20upload:\x20','MIN_TIMELINE_WIDTH','✔\x20Schedule\x20#','\x0aError:','Pushing\x20workflow\x20project...','\x20unchanged','Select\x20a\x20workflow\x20to\x20run','utf-8','requireProject','resolve','tdx\x20wf\x20attempt\x20','resolveProject','Error:\x20Attempt\x20ID\x20is\x20required','autocomplete','workflow:secrets:delete','Revision:\x20','unchanged','startTime','No\x20attempts\x20found\x20in\x20project:\x20','\x27\x20from\x20project\x20\x27','toLowerCase','fs/promises','POLL_INTERVAL_MS','end','\x20\x20Project:\x20','📅\x20#','Analyzing\x20changes...','includeSubtasks','find','\x22?\x20This\x20cannot\x20be\x20undone.','start','Setting\x20secret...','Cancelled','Dry\x20run:\x20yes','Including\x20subtasks:\x20yes','listSecrets','sessions','logs','/sessions/','done','newProjectName','\x20task','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','follow','workflow:workflows','📋\x20','map','taskName','deleted','\x0a⚠\x20Project\x20\x22','max','durationMs','output','retryAttemptName','\x20\x20Attempt\x20ID:\x20','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','has','project','Output\x20directory:\x20','stdout','list','\x20new','projectId','\x20secret','renderSessionsTimeline','startsWith','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20AI','Listing\x20workflow\x20attempts...','sourceDir','Upload\x20workflow\x20project\x20to\x20Treasure\x20AI\x20(digdag-style)','Usage:\x20tdx\x20wf\x20use\x20<project>','No\x20workflows\x20found\x20in\x20project:\x20','retryAttempt','Show\x20specific\x20attempt\x20details','workflow:run','LABEL_WIDTH_DIVISOR','.\x20Expected\x20format:\x20KEY=VALUE','clear','workflow:clone','Select\x20a\x20session\x20to\x20view\x20timeline:','No\x20sessions\x20with\x20timing\x20information','\x20of\x20','renderTimeline','sourceProjectName','getMinutes','Listing\x20schedules...','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Killing\x20attempt...','error','✔\x20Showing\x20','fromTask','Force:\x20yes','Loading\x20workflows...','metadata','padStart','\x20project','Getting\x20attempt\x20details...','cyan','diff','\x20\x20Workflow:\x20','select','green','hasChanges','\x0aApply\x20these\x20changes?','2529798gkwFGT','No\x20attempts\x20found\x20for:\x20','workflow:secrets:set','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','getMonth','Filter:\x20','\x20modified','pending','List\x20workflow\x20schedules','24sOHonw','attemptId','getFullYear','param','No\x20workflow\x20projects\x20found','columns','execute','localeCompare','delete','\x0a✔\x20Already\x20up\x20to\x20date','lastAttempt','format','site','toLocaleString','Select\x20a\x20task\x20to\x20view\x20logs:','ICON_SPACING','/app/workflows/','revision','workflows','Disable\x20a\x20workflow\x20schedule'];a59_0x5f4b=function(){return _0x1b0907;};return a59_0x5f4b();}import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';function a59_0x47c9(_0x20e1d4,_0x2e9bb4){_0x20e1d4=_0x20e1d4-0xd4;const _0x5f4bc9=a59_0x5f4b();let _0x47c9fb=_0x5f4bc9[_0x20e1d4];return _0x47c9fb;}import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import{parseTaskGraph,formatTaskGraph,summarizeTaskGraph,formatWarningSummary}from'../sdk/workflow/task-graph.js';import a59_0x42cf4e from'prompts';function getAttemptStatusDisplay(_0x2e2989){const _0x326bbd=a59_0x47c9;if(!_0x2e2989)return{'icon':'⏳','text':''};const {done:_0x24641e,success:_0x50d5fe,cancelRequested:_0x344f29}=_0x2e2989;if(!_0x24641e)return _0x344f29?{'icon':'🛑','text':a59_0xc31aad[_0x326bbd(0x1a2)]('canceling')}:{'icon':'🔄','text':a59_0xc31aad[_0x326bbd(0x146)](_0x326bbd(0x1ad))};if(_0x50d5fe)return{'icon':'✅','text':a59_0xc31aad[_0x326bbd(0x118)]('success')};return{'icon':'❌','text':a59_0xc31aad[_0x326bbd(0x209)](_0x326bbd(0x10b))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x2fe86c,_0xb7250b,_0x4b568e=0x0){const _0x1a5701=a59_0x47c9;return _0x2fe86c[_0x4b568e]||_0xb7250b[_0x1a5701(0x1aa)];}[a59_0x5f4ff5(0x295)](_0x1e37e8,_0x2d3786,_0x40883c=0x0){const _0x276a48=a59_0x5f4ff5,_0x5a15ee=this[_0x276a48(0x298)](_0x1e37e8,_0x2d3786,_0x40883c);if(!_0x5a15ee)return console[_0x276a48(0x10b)](a59_0xc31aad[_0x276a48(0x209)](_0x276a48(0x229)),_0x276a48(0x278)),console[_0x276a48(0x10b)](a59_0xc31aad[_0x276a48(0x1e5)](_0x276a48(0x289))),null;return _0x5a15ee;}[a59_0x5f4ff5(0x27d)](_0x22a348,_0x2343ea){const _0x2d4dd0=a59_0x5f4ff5;if(_0x22a348[0x0]){const _0xcc61dc=_0x22a348[0x0][_0x2d4dd0(0x178)]('.');if(_0xcc61dc[_0x2d4dd0(0x1e6)]===0x1)return{'projectName':_0xcc61dc[0x0],'workflowName':undefined};else return _0xcc61dc[_0x2d4dd0(0x1e6)]===0x2?{'projectName':_0xcc61dc[0x0],'workflowName':_0xcc61dc[0x1]}:(console[_0x2d4dd0(0x10b)](a59_0xc31aad[_0x2d4dd0(0x209)](_0x2d4dd0(0x229)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x2343ea[_0x2d4dd0(0x1aa)],'workflowName':undefined};}[a59_0x5f4ff5(0x1c2)](_0x8c5ec8,_0x3e55ec,_0x30e89f=0x0){const _0x1129ed=a59_0x5f4ff5;if(_0x8c5ec8[_0x30e89f])return _0x8c5ec8[_0x30e89f];if(_0x3e55ec[_0x1129ed(0x1aa)]){const _0x337acf=a59_0x532ea4['join'](process[_0x1129ed(0x240)](),'workflows',_0x3e55ec[_0x1129ed(0x1aa)]);if(existsSync(a59_0x532ea4[_0x1129ed(0x140)](_0x337acf,_0x1129ed(0x16d))))return _0x337acf;}return undefined;}async[a59_0x5f4ff5(0x1bc)](_0x3612fc,_0x56a7c9,_0x31986d){const _0x3dbca6=a59_0x5f4ff5;try{const _0x4bb075=await _0x3612fc[_0x3dbca6(0x202)][_0x3dbca6(0x136)](_0x56a7c9,{'limit':0x1});if(_0x4bb075[_0x3dbca6(0x1e6)]>0x0){const _0x236a14=_0x4bb075[0x0]['id'],_0x2649da=getWorkflowUrl(_0x31986d,_0x236a14);console['error']('\x20\x20Console:\x20'+a59_0xc31aad[_0x3dbca6(0x114)](_0x2649da));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a59_0x5f4ff5(0x282)]=a59_0x5f4ff5(0x1a9);[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0x16f);async[a59_0x5f4ff5(0x12a)](_0xa93355){const _0xd13d8=a59_0x5f4ff5,{options:_0x5214fb,args:_0x5da045,tdx:_0xdf60b4}=_0xa93355,_0x48c771=_0x5da045[0x0],_0x520378=_0x5214fb[_0xd13d8(0x100)];if(_0x520378)return saveSessionContext({'workflow_project':undefined},_0x5214fb['session']),console[_0xd13d8(0x16c)](a59_0xc31aad[_0xd13d8(0x118)](_0xd13d8(0x1b9))),0x0;if(!_0x48c771)return console['error'](a59_0xc31aad[_0xd13d8(0x209)](_0xd13d8(0x229)),_0xd13d8(0x278)),console[_0xd13d8(0x10b)](a59_0xc31aad[_0xd13d8(0x1e5)](_0xd13d8(0xf9))),console['error'](a59_0xc31aad[_0xd13d8(0x1e5)](_0xd13d8(0x180))),0x1;const _0x267de4=await withSpinner(_0xd13d8(0x261)+_0x48c771+'\x27...',()=>_0xdf60b4[_0xd13d8(0x202)][_0xd13d8(0x13f)](_0x48c771),{'verbose':_0x5214fb[_0xd13d8(0x269)]}),{name:_0x1aceac}=_0x267de4[_0xd13d8(0x186)];return saveSessionContext({'workflow_project':_0x1aceac},_0x5214fb['session']),console['log'](a59_0xc31aad[_0xd13d8(0x118)](_0xd13d8(0x200)+a59_0xc31aad[_0xd13d8(0x114)](_0x1aceac))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a59_0x5f4ff5(0x282)]=a59_0x5f4ff5(0x1b2);['description']=a59_0x5f4ff5(0x208);async[a59_0x5f4ff5(0x12a)](_0x1a704e){const _0xe75703=a59_0x5f4ff5,{options:_0x669611,args:_0x3bdbdc,tdx:_0x515c40}=_0x1a704e,_0x597733=_0x3bdbdc[0x0];_0x669611[_0xe75703(0x269)]&&_0x597733&&console[_0xe75703(0x10b)](_0xe75703(0x250)+_0x597733);const _0x31baf1=await withSpinner(_0xe75703(0x13d),()=>_0x515c40['workflow'][_0xe75703(0x268)](_0x597733,{'limit':_0x669611[_0xe75703(0x156)]}),{'verbose':_0x669611[_0xe75703(0x269)]});let _0x33b2f3=_0x31baf1[_0xe75703(0x186)];_0x33b2f3[_0xe75703(0x257)]((_0xf3fd6,_0x51b46d)=>_0xf3fd6['name'][_0xe75703(0x12b)](_0x51b46d[_0xe75703(0x282)]));const _0x2c5afe=_0x669611[_0xe75703(0x156)]&&_0x33b2f3[_0xe75703(0x1e6)]>=_0x669611[_0xe75703(0x156)]?a59_0xc31aad[_0xe75703(0x1e5)](_0xe75703(0x196)):'';console['error'](_0xe75703(0x267)+_0x33b2f3[_0xe75703(0x1e6)]+_0xe75703(0x112)+(_0x33b2f3[_0xe75703(0x1e6)]!==0x1?'s':'')+_0x2c5afe);if(_0x669611['format']==='json'||_0x669611[_0xe75703(0x12f)]==='jsonl'||_0x669611[_0xe75703(0x12f)]===_0xe75703(0x20c))await handleSDKOutput(_0x33b2f3,_0x669611);else{if(_0x33b2f3[_0xe75703(0x1e6)]===0x0)_0x597733?console[_0xe75703(0x16c)]('No\x20projects\x20match\x20pattern:\x20'+_0x597733):console[_0xe75703(0x16c)](_0xe75703(0x128));else{const _0x27e4d8=_0x33b2f3[_0xe75703(0xe1)](_0x3f221b=>{const _0x59e830=_0xe75703,_0x56ed29=_0x3f221b[_0x59e830(0x110)]?.[_0x59e830(0x285)](_0x38849c=>_0x38849c['key']===_0x59e830(0x158)),_0x34bc41=_0x56ed29?a59_0xc31aad[_0x59e830(0x1e5)]('\x20(system)'):'';return _0x59e830(0x22c)+_0x3f221b[_0x59e830(0x282)]+_0x34bc41;});await writeOutput(_0x27e4d8[_0xe75703(0x140)]('\x0a'),_0x669611[_0xe75703(0xe7)],_0xe75703(0xef));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a59_0x5f4ff5(0x282)]=a59_0x5f4ff5(0xdf);[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0x1d1);async[a59_0x5f4ff5(0x12a)](_0x3d31ea){const _0x9ff395=a59_0x5f4ff5,{options:_0x3198a0,args:_0x498e32,tdx:_0x2c08c5}=_0x3d31ea,_0x5df1fc=this[_0x9ff395(0x298)](_0x498e32,_0x3198a0);_0x3198a0[_0x9ff395(0x269)]&&_0x5df1fc&&console[_0x9ff395(0x10b)]('Project\x20filter:\x20'+_0x5df1fc);const _0x24f3bb=await withSpinner(_0x9ff395(0x265),()=>_0x2c08c5[_0x9ff395(0x202)][_0x9ff395(0x136)](_0x5df1fc,{'limit':_0x3198a0[_0x9ff395(0x156)]}),{'verbose':_0x3198a0[_0x9ff395(0x269)]});let _0x164a77=_0x24f3bb['data'];_0x164a77['sort']((_0x57804a,_0x4ed626)=>{const _0x162930=_0x9ff395,_0xe5325c=_0x57804a[_0x162930(0x282)][_0x162930(0x12b)](_0x4ed626['name']);if(_0xe5325c!==0x0)return _0xe5325c;return(_0x57804a[_0x162930(0xec)]?.[_0x162930(0x282)]||'')['localeCompare'](_0x4ed626[_0x162930(0xec)]?.[_0x162930(0x282)]||'');});const _0x19948d=_0x3198a0[_0x9ff395(0x156)]&&_0x164a77[_0x9ff395(0x1e6)]>=_0x3198a0[_0x9ff395(0x156)]?a59_0xc31aad['dim'](_0x9ff395(0x196)):'';console[_0x9ff395(0x10b)](_0x9ff395(0x267)+_0x164a77[_0x9ff395(0x1e6)]+'\x20workflow'+(_0x164a77[_0x9ff395(0x1e6)]!==0x1?'s':'')+_0x19948d);if(_0x3198a0[_0x9ff395(0x12f)]===_0x9ff395(0x277)||_0x3198a0[_0x9ff395(0x12f)]===_0x9ff395(0x1df)||_0x3198a0[_0x9ff395(0x12f)]===_0x9ff395(0x20c))await handleSDKOutput(_0x164a77,_0x3198a0);else{if(_0x164a77[_0x9ff395(0x1e6)]===0x0)_0x5df1fc?console[_0x9ff395(0x16c)](_0x9ff395(0xfa)+_0x5df1fc):console[_0x9ff395(0x16c)]('No\x20workflows\x20found');else{const _0x47c1ad=_0x3198a0['site'],_0x99cf0a=_0x164a77[_0x9ff395(0xe1)](_0x2469f5=>{const _0x323eb8=_0x9ff395,_0x5139a0=a59_0xc31aad[_0x323eb8(0x1e5)]('#'+_0x2469f5['id']),_0x28b109=hyperlink(_0x5139a0,getWorkflowUrl(_0x47c1ad,_0x2469f5['id'])),_0x1f8f71=_0x2469f5[_0x323eb8(0xec)]?.[_0x323eb8(0x282)]?a59_0xc31aad[_0x323eb8(0x1e5)]('\x20('+_0x2469f5[_0x323eb8(0xec)][_0x323eb8(0x282)]+')'):'';return _0x323eb8(0xe0)+_0x28b109+'\x20'+_0x2469f5[_0x323eb8(0x282)]+_0x1f8f71;});await writeOutput(_0x99cf0a[_0x9ff395(0x140)]('\x0a'),_0x3198a0['output'],_0x9ff395(0xef));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']=a59_0x5f4ff5(0x1d7);[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0x17b);async[a59_0x5f4ff5(0x12a)](_0x49740f){const _0x1db014=a59_0x5f4ff5,{options:_0x3cf857,args:_0x19a05d,tdx:_0x1cc5b4}=_0x49740f,_0x435794=this[_0x1db014(0x27d)](_0x19a05d,_0x3cf857);if(!_0x435794)return 0x1;const {projectName:_0x23ef41,workflowName:_0x20c95e}=_0x435794;if(_0x3cf857[_0x1db014(0x269)]){if(_0x23ef41&&_0x20c95e)console[_0x1db014(0x10b)]('Filter:\x20'+_0x23ef41+'.'+_0x20c95e);else _0x23ef41&&console[_0x1db014(0x10b)]('Filter:\x20project='+_0x23ef41);const _0x58233c=_0x3cf857[_0x1db014(0x1b6)];_0x58233c&&console['error']('Status:\x20'+_0x58233c);}let _0xa95d16=0x28;if(process[_0x1db014(0xee)][_0x1db014(0x16a)]&&!_0x3cf857[_0x1db014(0xe7)]&&!_0x3cf857[_0x1db014(0x12f)]){const _0x5b02a0=process['stdout']['rows']||0x28;_0xa95d16=Math['max'](0x14,Math[_0x1db014(0x227)](_0x5b02a0*0x2/0x3));}const _0x457f30=_0x3cf857[_0x1db014(0x156)]||_0xa95d16,_0x287fae=await withSpinner(_0x1db014(0x1ae),()=>_0x1cc5b4[_0x1db014(0x202)]['sessions']({'projectName':_0x23ef41,'workflowName':_0x20c95e,'status':_0x3cf857[_0x1db014(0x1b6)],'fromTime':_0x3cf857[_0x1db014(0x22d)],'toTime':_0x3cf857['to'],'limit':_0x457f30}),{'verbose':_0x3cf857[_0x1db014(0x269)]}),_0x3597c7=_0x287fae['data'];_0x3597c7[_0x1db014(0x257)]((_0x4f3b8a,_0x268357)=>{const _0x4498a8=_0x1db014,_0x3b39bd=_0x4f3b8a[_0x4498a8(0x14d)]||'',_0x375214=_0x268357[_0x4498a8(0x14d)]||'';return _0x375214['localeCompare'](_0x3b39bd);});_0x3597c7[_0x1db014(0x1e6)]>=_0x457f30?console[_0x1db014(0x10b)](_0x1db014(0x10c)+_0x3597c7[_0x1db014(0x1e6)]+_0x1db014(0x1f9)+a59_0xc31aad[_0x1db014(0x1e5)](_0x1db014(0x14c))):console[_0x1db014(0x10b)](_0x1db014(0x267)+_0x3597c7['length']+'\x20session'+(_0x3597c7[_0x1db014(0x1e6)]!==0x1?'s':''));if(_0x3cf857[_0x1db014(0x12f)]===_0x1db014(0x277)||_0x3cf857[_0x1db014(0x12f)]===_0x1db014(0x1df)||_0x3cf857['format']===_0x1db014(0x20c))await handleSDKOutput(_0x3597c7,_0x3cf857);else{if(!process[_0x1db014(0xee)]['isTTY']||_0x3cf857[_0x1db014(0xe7)]){if(_0x3597c7[_0x1db014(0x1e6)]===0x0){if(_0x23ef41&&_0x20c95e)console[_0x1db014(0x16c)]('No\x20sessions\x20found\x20for:\x20'+_0x23ef41+'.'+_0x20c95e);else _0x23ef41?console[_0x1db014(0x16c)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x23ef41):console[_0x1db014(0x16c)]('No\x20sessions\x20found');}else{const _0x4646c7=_0x3cf857[_0x1db014(0x130)],_0x59d184=this[_0x1db014(0xf3)](_0x3597c7,_0x4646c7);_0x3cf857[_0x1db014(0xe7)]?await writeOutput(_0x59d184,_0x3cf857[_0x1db014(0xe7)],'list'):console['log'](_0x59d184);}!_0x23ef41&&(console['error'](''),console[_0x1db014(0x10b)](a59_0xc31aad[_0x1db014(0x1e5)](_0x1db014(0x11e))),console['error'](a59_0xc31aad['dim']('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a59_0xc31aad[_0x1db014(0x1e5)](_0x1db014(0x253))));}else{if(_0x3597c7[_0x1db014(0x1e6)]===0x0){if(_0x23ef41&&_0x20c95e)console[_0x1db014(0x16c)](_0x1db014(0x18b)+_0x23ef41+'.'+_0x20c95e);else _0x23ef41?console[_0x1db014(0x16c)](_0x1db014(0x245)+_0x23ef41):console['log']('No\x20sessions\x20found');}else await this[_0x1db014(0x183)](_0x3597c7,_0x49740f,_0x23ef41);}}return 0x0;}[a59_0x5f4ff5(0xf3)](_0x56b98b,_0x57e75b){const _0x19e167=a59_0x5f4ff5,_0x44a387=[],_0x3cca60=new Map();let _0xba1564=Infinity,_0x458270=-Infinity;for(const _0x577b58 of _0x56b98b){if(_0x577b58['lastAttempt']?.[_0x19e167(0x210)]){const _0x3a606c=new Date(_0x577b58[_0x19e167(0x12e)][_0x19e167(0x210)])[_0x19e167(0x1d2)](),_0x14c884=_0x577b58[_0x19e167(0x12e)][_0x19e167(0x1a6)]?new Date(_0x577b58[_0x19e167(0x12e)]['finishedAt'])[_0x19e167(0x1d2)]():Date[_0x19e167(0x1da)](),_0x76bc13=_0x577b58[_0x19e167(0xec)]?.[_0x19e167(0x282)]||'(unknown)';!_0x3cca60[_0x19e167(0xeb)](_0x76bc13)&&_0x3cca60[_0x19e167(0x216)](_0x76bc13,[]),_0x3cca60[_0x19e167(0x176)](_0x76bc13)[_0x19e167(0x260)]({'session':_0x577b58,'startTime':_0x3a606c,'endTime':_0x14c884,'duration':_0x14c884-_0x3a606c}),_0xba1564=Math[_0x19e167(0x1b1)](_0xba1564,_0x3a606c),_0x458270=Math[_0x19e167(0xe5)](_0x458270,_0x14c884);}}if(_0x3cca60['size']===0x0)return _0x19e167(0x103);const _0x495352=process[_0x19e167(0xee)]['columns']||0x78,_0x11bec8=0x1e,_0x7e257b=0x32,_0x5b47b7=0x4,_0x58a539=Math[_0x19e167(0x1b1)](_0x7e257b,Math[_0x19e167(0xe5)](_0x11bec8,Math[_0x19e167(0x227)](_0x495352*0.3))),_0x4819c8=_0x495352-_0x58a539-TIMELINE_CONFIG[_0x19e167(0x1de)]-0x3-_0x5b47b7,_0x2b35e5=_0x458270-_0xba1564,_0x4c1587=_0x2b35e5/_0x58a539,_0x1428d1=renderTimeAxis({'startTime':_0xba1564,'endTime':_0x458270,'durationMs':_0x2b35e5,'msPerChar':_0x4c1587},_0x58a539),_0x1db7c7=[];for(const _0x4cf6d7 of _0x3cca60[_0x19e167(0x1f1)]()){_0x1db7c7[_0x19e167(0x260)](..._0x4cf6d7);}_0x1db7c7[_0x19e167(0x257)]((_0x2bcc27,_0x2a29ee)=>_0x2a29ee[_0x19e167(0x29e)]-_0x2bcc27[_0x19e167(0x29e)]);const _0x333547=new Date(_0xba1564),_0x1c4b1a=formatDate(_0x333547),_0xa3b33b=_0x5b47b7+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x19e167(0x133)]+_0x4819c8,_0x3c4d3a='\x20'[_0x19e167(0x225)](_0xa3b33b-_0x1c4b1a['length']),_0x1008bd=_0x3c4d3a+a59_0xc31aad[_0x19e167(0x1e5)](_0x1c4b1a)+'\x20'+_0x1428d1;_0x44a387['push'](_0x1008bd);const _0x475e3c=0x16;let _0x5a819a=0x0;for(const _0x3e0dc4 of _0x1db7c7){const _0x510413=_0x3e0dc4[_0x19e167(0x24b)][_0x19e167(0xec)]?.[_0x19e167(0x282)]||'?',_0x589e2f=Math[_0x19e167(0x1b1)](stringWidth(_0x510413),_0x475e3c);_0x5a819a=Math[_0x19e167(0xe5)](_0x5a819a,_0x589e2f);}for(const _0x184fb5 of _0x1db7c7){const {session:_0x34180b,startTime:_0x570d03,endTime:_0x58badf,duration:_0x48194a}=_0x184fb5,_0x452727=_0x34180b['project']?.['id'],_0x7db8f8=_0x34180b['id'],_0x4fc8b5=_0x34180b[_0x19e167(0xec)]?.[_0x19e167(0x282)]||'?',_0x592d64=_0x34180b[_0x19e167(0x202)]?.[_0x19e167(0x282)]||'?';let _0x553d7,_0x59846f;if(_0x34180b[_0x19e167(0x12e)]){const _0x18f3bb=_0x34180b[_0x19e167(0x12e)];!_0x18f3bb[_0x19e167(0xda)]?(_0x553d7=_0x18f3bb[_0x19e167(0x1fc)]?'🛑':'🔄',_0x59846f=_0x18f3bb[_0x19e167(0x1fc)]?a59_0xc31aad[_0x19e167(0x1a2)]:a59_0xc31aad[_0x19e167(0x146)]):(_0x553d7=_0x18f3bb[_0x19e167(0x142)]?'✅':'❌',_0x59846f=_0x18f3bb[_0x19e167(0x142)]?a59_0xc31aad[_0x19e167(0x118)]:a59_0xc31aad[_0x19e167(0x209)]);}else _0x553d7='⏳',_0x59846f=a59_0xc31aad[_0x19e167(0x1e5)];const _0x5cb13a='#'+_0x7db8f8,_0x4ce9ee=_0x452727?hyperlink(_0x5cb13a,getWorkflowSessionUrl(_0x57e75b,_0x452727,_0x7db8f8)):_0x5cb13a;let _0x346a90=_0x4fc8b5;stringWidth(_0x4fc8b5)>_0x475e3c&&(_0x346a90=_0x4fc8b5['slice'](0x0,_0x475e3c-0x1)+'…');const _0x5507c7=a59_0xc31aad[_0x19e167(0x1e5)](_0x346a90),_0x44764a=stringWidth(_0x346a90),_0x2592ee='\x20'[_0x19e167(0x225)](_0x5a819a-stringWidth(_0x346a90)+0x2),_0x27ba0c='('+formatElapsed(_0x48194a)+')',_0x292a65=stringWidth(_0x27ba0c),_0x34d18f=stringWidth(_0x5cb13a),_0x2b519c=_0x34d18f+0x1+_0x44764a+_0x2592ee[_0x19e167(0x1e6)],_0x15a914=_0x4819c8-_0x2b519c-_0x292a65-0x1-0x8;let _0x5a7f6d=_0x592d64;stringWidth(_0x5a7f6d)>_0x15a914&&(_0x5a7f6d=_0x5a7f6d[_0x19e167(0x1d9)](0x0,_0x15a914-0x1)+'…');const _0x50fee4=_0x4ce9ee+'\x20'+_0x5507c7+_0x2592ee+_0x5a7f6d,_0x518444=stringWidth(_0x50fee4),_0x5ace35=_0x4819c8-_0x518444-_0x292a65,_0x21c29f=_0x50fee4+'\x20'[_0x19e167(0x225)](Math[_0x19e167(0xe5)](0x1,_0x5ace35))+a59_0xc31aad[_0x19e167(0x1e5)](_0x27ba0c),_0x522697=Math[_0x19e167(0x227)]((_0x570d03-_0xba1564)/_0x4c1587),_0x21e5de=Math[_0x19e167(0x227)]((_0x58badf-_0xba1564)/_0x4c1587),_0x28eba0=Math[_0x19e167(0xe5)](_0x522697+0x1,_0x21e5de),_0x241006=new Array(_0x58a539)[_0x19e167(0x263)]('\x20');for(let _0x38a548=_0x522697;_0x38a548<Math[_0x19e167(0x1b1)](_0x28eba0,_0x58a539);_0x38a548++){_0x241006[_0x38a548]='─';}const _0x5d35b6=_0x241006[_0x19e167(0xe1)](_0x4030a3=>_0x4030a3==='\x20'?'\x20':_0x59846f(_0x4030a3))[_0x19e167(0x140)]('');_0x44a387['push'](_0x553d7+'\x20'+_0x21c29f+'│'+_0x5d35b6+'│');}return _0x44a387[_0x19e167(0x140)]('\x0a');}async[a59_0x5f4ff5(0x183)](_0x4e46bd,_0x40c3eb,_0x2d4f70){const _0x5162be=a59_0x5f4ff5,{options:_0x3adbbc,tdx:_0x2cdf0d}=_0x40c3eb,_0x444af4=_0x3adbbc[_0x5162be(0x130)],{timelineRows:_0x5dcc7c,timeAxisHeader:_0x560c19}=this['generateSessionTimelineRows'](_0x4e46bd,_0x444af4),_0x3c9c0d=_0x5dcc7c[_0x5162be(0x19f)](_0xfb9097=>_0xfb9097['attemptId']);if(_0x3c9c0d[_0x5162be(0x1e6)]===0x0){const _0x49dc97=this['renderSessionsTimeline'](_0x4e46bd,_0x444af4);console[_0x5162be(0x16c)](_0x49dc97);!_0x2d4f70&&(console[_0x5162be(0x10b)](''),console[_0x5162be(0x10b)](a59_0xc31aad[_0x5162be(0x1e5)](_0x5162be(0x11e))),console[_0x5162be(0x10b)](a59_0xc31aad[_0x5162be(0x1e5)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a59_0xc31aad[_0x5162be(0x1e5)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0x560c19&&console[_0x5162be(0x16c)](_0x560c19);const _0x3bfa6a=_0x5dcc7c[_0x5162be(0x19f)](_0x5551ee=>_0x5551ee[_0x5162be(0x125)])[_0x5162be(0xe1)](_0x53572f=>({'title':_0x53572f['displayLine'],'value':_0x53572f[_0x5162be(0x125)]})),_0x4cd9bb=process[_0x5162be(0xee)]['rows']||0x3c,_0x16c279=Math[_0x5162be(0xe5)](0x28,Math[_0x5162be(0x227)](_0x4cd9bb*0x2/0x3)),_0x2c13b1=await a59_0x42cf4e({'type':_0x5162be(0x29a),'name':_0x5162be(0x125),'message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x3bfa6a,'initial':-0x1,'limit':_0x16c279,'clearFirst':!![],'fallback':{'title':_0x5162be(0x212),'value':null},'suggest':(_0x85a47c,_0x202c89)=>{const _0x2ecd24=_0x5162be;if(!_0x85a47c)return Promise[_0x2ecd24(0x296)](_0x202c89);const _0x592672=_0x202c89[_0x2ecd24(0x19f)](_0x1d920c=>{const _0x570ebf=_0x2ecd24,_0x3334e7=_0x1d920c;return _0x3334e7[_0x570ebf(0x148)]['toLowerCase']()[_0x570ebf(0x177)](_0x85a47c[_0x570ebf(0x2a1)]());});return Promise[_0x2ecd24(0x296)](_0x592672);}}),_0x30f20b=()=>{const _0x2d2543=_0x5162be;process[_0x2d2543(0xee)]['write'](_0x2d2543(0x259)),process[_0x2d2543(0xee)][_0x2d2543(0x195)](_0x2d2543(0x259)),process[_0x2d2543(0xee)][_0x2d2543(0x195)](_0x2d2543(0x259));},_0x527b58=_0x2c13b1&&_0x2c13b1[_0x5162be(0x125)]&&_0x2c13b1[_0x5162be(0x125)]!==null&&_0x2c13b1[_0x5162be(0x125)]['trim']()!=='';if(!_0x527b58){_0x30f20b(),console[_0x5162be(0x16c)](a59_0xc31aad[_0x5162be(0x1e5)](_0x5162be(0x2ad)));return;}_0x30f20b();const _0x2f8a18=_0x4e46bd['find'](_0x181d9e=>_0x181d9e[_0x5162be(0x12e)]?.['id']===_0x2c13b1['attemptId']);if(_0x2f8a18){const _0x363d1a=_0x2f8a18[_0x5162be(0xec)]?.[_0x5162be(0x282)]||'?',_0x1618d8=_0x2f8a18[_0x5162be(0x202)]?.[_0x5162be(0x282)]||'?';console['log'](_0x5162be(0x203)+a59_0xc31aad[_0x5162be(0x1e5)](_0x363d1a)+_0x5162be(0x1e2)+a59_0xc31aad['dim'](_0x1618d8));}const _0x235b2f=new WorkflowTimelineCommand();await _0x235b2f[_0x5162be(0x12a)]({'args':[],'options':{..._0x3adbbc,'attemptId':_0x2c13b1[_0x5162be(0x125)]},'tdx':_0x2cdf0d});}[a59_0x5f4ff5(0x17f)](_0x49d9c9,_0x39b5a2){const _0x578f2c=a59_0x5f4ff5,_0x3ed69f=new Map();for(const _0x14d493 of _0x49d9c9){_0x14d493['id']&&_0x14d493[_0x578f2c(0x12e)]?.['id']&&_0x3ed69f[_0x578f2c(0x216)](_0x14d493['id'],_0x14d493[_0x578f2c(0x12e)]['id']);}const _0x59c146=[];let _0x1e66f5='';const _0x344ad7=this[_0x578f2c(0xf3)](_0x49d9c9,_0x39b5a2),_0xdb8d41=_0x344ad7[_0x578f2c(0x178)]('\x0a');for(const _0x49ee54 of _0xdb8d41){if(_0x49ee54[_0x578f2c(0xf4)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x49ee54[_0x578f2c(0x251)](/^\s+\d{4}-\d{2}-\d{2}/))_0x1e66f5=_0x49ee54;else{if(_0x49ee54[_0x578f2c(0x251)](/^[✅❌🔄🛑⏳]/)){const _0x4526ac=_0x49ee54['match'](/#(\d+)/),_0xb1da48=_0x4526ac?_0x4526ac[0x1]:null,_0x520e52=_0xb1da48?_0x3ed69f['get'](_0xb1da48)||null:null,_0x246274=_0x49d9c9[_0x578f2c(0x2a9)](_0x516032=>_0x516032['id']===_0xb1da48),_0x4f1057=_0x246274?.['project']?.[_0x578f2c(0x282)]||'';_0x59c146['push']({'displayLine':_0x49ee54,'attemptId':_0x520e52,'projectName':_0x4f1057});}}}return{'timelineRows':_0x59c146,'timeAxisHeader':_0x1e66f5};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']=a59_0x5f4ff5(0x13a);['description']='List\x20workflow\x20attempts';async[a59_0x5f4ff5(0x12a)](_0x476166){const _0x11429f=a59_0x5f4ff5,{options:_0x1674de,args:_0x2c2e49,tdx:_0x13f3ed}=_0x476166,_0x22dc16=this['parseProjectWorkflowPattern'](_0x2c2e49,_0x1674de);if(!_0x22dc16)return 0x1;const {projectName:_0x45aa3c,workflowName:_0x326074}=_0x22dc16,_0x16c2cc=_0x1674de[_0x11429f(0x1d4)];if(_0x1674de[_0x11429f(0x269)]){if(_0x45aa3c&&_0x326074)console[_0x11429f(0x10b)](_0x11429f(0x120)+_0x45aa3c+'.'+_0x326074);else _0x45aa3c&&console['error']('Filter:\x20project='+_0x45aa3c);_0x16c2cc&&console[_0x11429f(0x10b)](_0x11429f(0x211));}const _0x532f51=await withSpinner(_0x11429f(0xf6),()=>_0x13f3ed[_0x11429f(0x202)][_0x11429f(0x17c)]({'projectName':_0x45aa3c,'workflowName':_0x326074,'includeRetried':_0x16c2cc,'limit':_0x1674de[_0x11429f(0x156)]}),{'verbose':_0x1674de[_0x11429f(0x269)]}),_0x3cc05d=_0x532f51[_0x11429f(0x186)],_0x2e68db=_0x1674de[_0x11429f(0x156)]||0x64,_0x5a152d=_0x3cc05d[_0x11429f(0x1e6)]>=_0x2e68db?a59_0xc31aad[_0x11429f(0x1e5)](_0x11429f(0x196)):'';console['error'](_0x11429f(0x267)+_0x3cc05d[_0x11429f(0x1e6)]+'\x20attempt'+(_0x3cc05d[_0x11429f(0x1e6)]!==0x1?'s':'')+_0x5a152d);if(_0x1674de[_0x11429f(0x12f)]===_0x11429f(0x277)||_0x1674de['format']==='jsonl'||_0x1674de['format']==='table')await handleSDKOutput(_0x3cc05d,_0x1674de);else{if(_0x3cc05d[_0x11429f(0x1e6)]===0x0){if(_0x45aa3c&&_0x326074)console[_0x11429f(0x16c)](_0x11429f(0x11c)+_0x45aa3c+'.'+_0x326074);else _0x45aa3c?console[_0x11429f(0x16c)](_0x11429f(0x29f)+_0x45aa3c):console[_0x11429f(0x16c)](_0x11429f(0x143));}else{const _0x990c9c=_0x1674de[_0x11429f(0x130)],_0x5eb37d=_0x3cc05d[_0x11429f(0xe1)](_0x4264ae=>{const _0x1bbfd5=_0x11429f,_0x59fbb3=a59_0xc31aad['dim']('#'+_0x4264ae['id']),_0x550afc=_0x4264ae['project']?.['id'],_0x4e8ebe=_0x4264ae[_0x1bbfd5(0x28b)]||_0x4264ae[_0x1bbfd5(0x165)],_0x4ef7aa=_0x550afc&&_0x4e8ebe?hyperlink(_0x59fbb3,getWorkflowAttemptUrl(_0x990c9c,_0x550afc,_0x4e8ebe,_0x4264ae['id'])):_0x59fbb3,{icon:_0x210609,text:_0x28b70c}=getAttemptStatusDisplay(_0x4264ae),_0x53de3d=(_0x4264ae['project']?.[_0x1bbfd5(0x282)]||'?')+'.'+(_0x4264ae[_0x1bbfd5(0x202)]?.[_0x1bbfd5(0x282)]||'?'),_0x4fb246=_0x4264ae['sessionTime']?a59_0xc31aad[_0x1bbfd5(0x1e5)](_0x4264ae[_0x1bbfd5(0x14d)]):'';return(_0x4ef7aa+'\x20'+_0x210609+(_0x28b70c?'\x20'+_0x28b70c:'')+'\x20'+_0x53de3d+'\x20'+_0x4fb246)[_0x1bbfd5(0x144)]();});await writeOutput(_0x5eb37d[_0x11429f(0x140)]('\x0a'),_0x1674de[_0x11429f(0xe7)],_0x11429f(0xef));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a59_0x5f4ff5(0x282)]='workflow:attempt';['description']=a59_0x5f4ff5(0xfc);async['execute'](_0x295dd5){const _0x12ab7f=a59_0x5f4ff5,{options:_0x1c51b2,args:_0x59931d,tdx:_0x350970}=_0x295dd5,_0x434dd5=_0x59931d[0x0];if(!_0x434dd5)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x1c51b2[_0x12ab7f(0x269)]&&console[_0x12ab7f(0x10b)](_0x12ab7f(0x25e)+_0x434dd5);const _0x249729=await withSpinner(_0x12ab7f(0x113),()=>_0x350970[_0x12ab7f(0x202)]['attempt'](_0x434dd5),{'verbose':_0x1c51b2[_0x12ab7f(0x269)]}),_0x2ccf3f=_0x249729[_0x12ab7f(0x186)];let _0x5a2738;!_0x2ccf3f[_0x12ab7f(0xda)]?_0x5a2738=_0x2ccf3f['cancelRequested']?_0x12ab7f(0x232):_0x12ab7f(0x1ad):_0x5a2738=_0x2ccf3f[_0x12ab7f(0x142)]?_0x12ab7f(0x142):_0x12ab7f(0x10b);let _0x3ac6e5;if(_0x2ccf3f['createdAt']&&_0x2ccf3f[_0x12ab7f(0x1a6)]){const _0x363360=new Date(_0x2ccf3f[_0x12ab7f(0x210)])[_0x12ab7f(0x1d2)](),_0x2c38a5=new Date(_0x2ccf3f[_0x12ab7f(0x1a6)])['getTime']();_0x3ac6e5=Math['round']((_0x2c38a5-_0x363360)/0x3e8);}const _0x2f3c88={'attempt_id':_0x2ccf3f['id'],'status':_0x5a2738,..._0x2ccf3f[_0x12ab7f(0x179)]!==undefined&&{'index':_0x2ccf3f[_0x12ab7f(0x179)]},..._0x2ccf3f[_0x12ab7f(0xec)]&&{'project':_0x2ccf3f[_0x12ab7f(0xec)][_0x12ab7f(0x282)]},..._0x2ccf3f['workflow']&&{'workflow':_0x2ccf3f['workflow']['name']},..._0x2ccf3f[_0x12ab7f(0x165)]&&{'session_id':_0x2ccf3f[_0x12ab7f(0x165)]},..._0x2ccf3f[_0x12ab7f(0x14d)]&&{'session_time':_0x2ccf3f[_0x12ab7f(0x14d)]},..._0x2ccf3f['retryAttemptName']&&{'retry_attempt':_0x2ccf3f[_0x12ab7f(0xe8)]},..._0x3ac6e5!==undefined&&{'duration_sec':_0x3ac6e5},..._0x2ccf3f[_0x12ab7f(0x210)]&&{'created_at':_0x2ccf3f[_0x12ab7f(0x210)]},..._0x2ccf3f[_0x12ab7f(0x1a6)]&&{'finished_at':_0x2ccf3f[_0x12ab7f(0x1a6)]},...Object[_0x12ab7f(0x24d)](_0x2ccf3f[_0x12ab7f(0x1a0)])['length']>0x0&&{'params':_0x2ccf3f['params']}};return await handleSingleObjectOutput(_0x2f3c88,_0x1c51b2),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a59_0x5f4ff5(0x282)]=a59_0x5f4ff5(0x243);[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0x254);async['execute'](_0x5e933c){const _0x1f1019=a59_0x5f4ff5,{options:_0xda08db,args:_0x277dd2,tdx:_0x14fd68}=_0x5e933c,_0x2c5d07=_0x277dd2[0x0];if(!_0x2c5d07)return console[_0x1f1019(0x10b)](_0x1f1019(0x299)),0x1;const _0x43053b=_0xda08db[_0x1f1019(0x2a8)];_0xda08db['verbose']&&(console[_0x1f1019(0x10b)]('Attempt\x20ID:\x20'+_0x2c5d07),_0x43053b&&console['error'](_0x1f1019(0xd5)));const _0x492110=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x14fd68[_0x1f1019(0x202)][_0x1f1019(0x1c7)](_0x2c5d07,_0x43053b||![]),{'verbose':_0xda08db['verbose']}),_0x2dd148=_0x492110[_0x1f1019(0x186)];return console[_0x1f1019(0x10b)]('✔\x20Found\x20'+_0x2dd148[_0x1f1019(0x1e6)]+_0x1f1019(0xdc)+(_0x2dd148[_0x1f1019(0x1e6)]!==0x1?'s':'')),await handleSDKOutput(_0x2dd148,_0xda08db),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a59_0x5f4ff5(0x220);[a59_0x5f4ff5(0x228)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async['execute'](_0x4c95ba){const _0x2ef21d=a59_0x5f4ff5,{options:_0x3e18d9,args:_0x4310e5,tdx:_0x2504c6}=_0x4c95ba,_0x18ede8=_0x4310e5[0x0];let _0x554e09=_0x4310e5[0x1];if(!_0x18ede8)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x3e18d9[_0x2ef21d(0x269)]&&(console[_0x2ef21d(0x10b)](_0x2ef21d(0x25e)+_0x18ede8),_0x554e09&&console['error']('Task\x20name:\x20'+_0x554e09));const _0x36d967=await withSpinner('Fetching\x20log\x20files...',()=>_0x2504c6[_0x2ef21d(0x202)][_0x2ef21d(0x238)](_0x18ede8,_0x554e09),{'verbose':_0x3e18d9[_0x2ef21d(0x269)]}),_0x2c3cbc=_0x36d967[_0x2ef21d(0x186)];if(_0x2c3cbc['length']===0x0)return console['error']('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x554e09&&(_0x3e18d9[_0x2ef21d(0x277)]||_0x3e18d9[_0x2ef21d(0x12f)]))return await handleSDKOutput(_0x2c3cbc,_0x3e18d9),0x0;if(!_0x554e09){const _0x528225=_0x2c3cbc[_0x2ef21d(0xe1)](_0x2a1eb8=>({'title':_0x2a1eb8[_0x2ef21d(0xe2)]+'\x20('+formatBytes(_0x2a1eb8['fileSize'])+')','value':_0x2a1eb8[_0x2ef21d(0xe2)]})),_0x219d2e=await a59_0x42cf4e({'type':_0x2ef21d(0x117),'name':_0x2ef21d(0x18a),'message':_0x2ef21d(0x132),'choices':_0x528225});if(!_0x219d2e[_0x2ef21d(0x18a)])return console['error']('Cancelled'),0x0;_0x554e09=_0x219d2e['task'];}const _0x69861b=await withSpinner(_0x2ef21d(0x1fa),()=>_0x2504c6[_0x2ef21d(0x202)][_0x2ef21d(0xd8)](_0x18ede8,_0x554e09),{'verbose':_0x3e18d9[_0x2ef21d(0x269)]}),_0x537ab7=_0x69861b['data'];return _0x537ab7?console['log'](_0x537ab7):console[_0x2ef21d(0x10b)](_0x2ef21d(0x258)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a59_0x5f4ff5(0x282)]='workflow:kill';[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0x26c);async[a59_0x5f4ff5(0x12a)](_0x56d7b3){const _0xfe0543=a59_0x5f4ff5,{options:_0x16c7de,args:_0xf288f4,tdx:_0x2005c6}=_0x56d7b3,_0x5f0f04=_0xf288f4[0x0];if(!_0x5f0f04)return console[_0xfe0543(0x10b)](_0xfe0543(0x299)),0x1;const _0x111990=_0x16c7de[_0xfe0543(0x204)];_0x16c7de['verbose']&&(console[_0xfe0543(0x10b)]('Attempt\x20ID:\x20'+_0x5f0f04),_0x111990&&console['error']('Reason:\x20'+_0x111990));if(!_0x16c7de['yes']){if(!isInteractive())return console[_0xfe0543(0x10b)](a59_0xc31aad['red'](_0xfe0543(0x290)),_0xfe0543(0x241)),console[_0xfe0543(0x10b)](a59_0xc31aad[_0xfe0543(0x1e5)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1b9d28=await confirmKey(_0xfe0543(0x162)+_0x5f0f04+'?');if(!_0x1b9d28)return console[_0xfe0543(0x10b)](a59_0xc31aad['yellow']('Cancelled')),0x1;}const _0x4a0df9=await withSpinner(_0xfe0543(0x10a),()=>_0x2005c6[_0xfe0543(0x202)][_0xfe0543(0x160)](_0x5f0f04,_0x111990),{'verbose':_0x16c7de[_0xfe0543(0x269)]}),_0x6e049c=_0x4a0df9[_0xfe0543(0x186)];return console[_0xfe0543(0x10b)]('✔\x20'+_0x6e049c),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a59_0x5f4ff5(0x282)]='workflow:retry';[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0x1af);async[a59_0x5f4ff5(0x12a)](_0x5b3473){const _0x39511d=a59_0x5f4ff5,{options:_0x584ad3,args:_0x4f944c,tdx:_0x3c5d59}=_0x5b3473,_0x4274b6=_0x4f944c[0x0];if(!_0x4274b6)return console[_0x39511d(0x10b)](_0x39511d(0x1cd)),console[_0x39511d(0x10b)](_0x39511d(0x1eb)),0x1;let _0xf78b4b=![],_0x153436=_0x4274b6;if(_0x4274b6[_0x39511d(0xf4)]('session:'))_0xf78b4b=!![],_0x153436=_0x4274b6[_0x39511d(0x264)](0x8);else{if(_0x4274b6[_0x39511d(0xf4)](_0x39511d(0x23e)))_0xf78b4b=![],_0x153436=_0x4274b6[_0x39511d(0x264)](0x8);else return console['error'](_0x39511d(0x193)),console[_0x39511d(0x10b)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x45ee73=_0x584ad3[_0x39511d(0x10d)],_0x1772af=_0x584ad3[_0x39511d(0x1e7)],_0x49d1aa=_0x584ad3[_0x39511d(0x1a0)],_0x58d591=_0x584ad3[_0x39511d(0x281)];_0x584ad3[_0x39511d(0x269)]&&(console['error'](_0x39511d(0x246)+(_0xf78b4b?'session':_0x39511d(0x1a8))+'\x20'+_0x153436),_0x45ee73&&console[_0x39511d(0x10b)]('From\x20task:\x20'+_0x45ee73),_0x1772af&&console['error'](_0x39511d(0x13b)+_0x1772af),_0x49d1aa&&console[_0x39511d(0x10b)](_0x39511d(0x226)+_0x49d1aa),_0x58d591&&console[_0x39511d(0x10b)](_0x39511d(0x10e)));let _0x54144b;if(_0x49d1aa)try{if(_0x49d1aa[_0x39511d(0xf4)]('@')){const _0x4ec7b3=await import(_0x39511d(0x2a2)),_0x8503fa=_0x49d1aa[_0x39511d(0x264)](0x1),_0x2740a4=await _0x4ec7b3[_0x39511d(0x21b)](_0x8503fa,_0x39511d(0x294));_0x54144b=JSON[_0x39511d(0x224)](_0x2740a4);}else _0x54144b=JSON[_0x39511d(0x224)](_0x49d1aa);}catch{return console[_0x39511d(0x10b)](_0x39511d(0x21a)),0x1;}if(!_0x584ad3[_0x39511d(0x13e)]){if(!isInteractive())return console['error'](a59_0xc31aad[_0x39511d(0x209)](_0x39511d(0x290)),_0x39511d(0x241)),console[_0x39511d(0x10b)](a59_0xc31aad[_0x39511d(0x1e5)](_0x39511d(0x27c))),0x1;const _0x10153b=await confirmKey(_0x39511d(0x1b4)+(_0xf78b4b?_0x39511d(0x24b):_0x39511d(0x1a8))+'\x20'+_0x153436+'?');if(!_0x10153b)return console[_0x39511d(0x10b)](a59_0xc31aad[_0x39511d(0x1a2)](_0x39511d(0x2ad))),0x1;}let _0x4c616b;_0xf78b4b?_0x4c616b=await withSpinner(_0x39511d(0x163),()=>_0x3c5d59[_0x39511d(0x202)]['retrySession'](_0x153436,{'fromTask':_0x45ee73,'retryParams':_0x54144b}),{'verbose':_0x584ad3[_0x39511d(0x269)]}):_0x4c616b=await withSpinner(_0x39511d(0x1ea),()=>_0x3c5d59[_0x39511d(0x202)][_0x39511d(0xfb)](_0x153436,{'resumeFrom':_0x1772af,'retryParams':_0x54144b,'force':_0x58d591}),{'verbose':_0x584ad3[_0x39511d(0x269)]});const _0x2c103e=_0x4c616b[_0x39511d(0x186)];return console[_0x39511d(0x10b)](_0x39511d(0x1c9)),console[_0x39511d(0x10b)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x2c103e[_0x39511d(0x125)]),console[_0x39511d(0x10b)](_0x39511d(0x24a)+_0x2c103e[_0x39511d(0x165)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a59_0x5f4ff5(0x282)]=a59_0x5f4ff5(0xfd);[a59_0x5f4ff5(0x228)]='Start\x20a\x20workflow\x20run';async[a59_0x5f4ff5(0x12a)](_0x16a590){const _0x313171=a59_0x5f4ff5,{options:_0x445b54,args:_0x461326,tdx:_0x3bdf33}=_0x16a590;let _0x4e2fb1=_0x461326[0x0];if(!_0x4e2fb1){const _0x2eebdf=this['resolveProject']([],_0x445b54),_0x3d4fde=await withSpinner(_0x313171(0x10f),()=>_0x3bdf33[_0x313171(0x202)]['workflows'](_0x2eebdf,{'limit':_0x445b54[_0x313171(0x156)]}),{'verbose':_0x445b54[_0x313171(0x269)]}),_0x195c7d=_0x3d4fde[_0x313171(0x186)];if(_0x195c7d[_0x313171(0x1e6)]===0x0)return console['error']('No\x20workflows\x20found'),!_0x2eebdf&&console[_0x313171(0x10b)](a59_0xc31aad[_0x313171(0x1e5)](_0x313171(0x289))),0x1;const _0x55aa9d=_0x195c7d['map'](_0x5e5660=>({'title':_0x5e5660[_0x313171(0xec)]?.[_0x313171(0x282)]+'.'+_0x5e5660[_0x313171(0x282)],'value':_0x5e5660[_0x313171(0xec)]?.[_0x313171(0x282)]+'.'+_0x5e5660[_0x313171(0x282)],'description':_0x5e5660[_0x313171(0x135)]?_0x313171(0x194)+_0x5e5660['revision']:undefined})),_0x5c937b=await a59_0x42cf4e({'type':_0x313171(0x117),'name':'workflow','message':_0x313171(0x293),'choices':_0x55aa9d});if(!_0x5c937b['workflow'])return 0x1;_0x4e2fb1=_0x5c937b[_0x313171(0x202)];}if(!_0x4e2fb1[_0x313171(0x177)]('.')){const _0x11fad7=this['resolveProject']([],_0x445b54);if(_0x11fad7)_0x4e2fb1=_0x11fad7+'.'+_0x4e2fb1;else return console[_0x313171(0x10b)](a59_0xc31aad['red'](_0x313171(0x229)),_0x313171(0x242)),console[_0x313171(0x10b)](a59_0xc31aad[_0x313171(0x1e5)](_0x313171(0x289))),0x1;}const _0x13fb58=_0x445b54[_0x313171(0x127)],_0x517723=_0x445b54[_0x313171(0x14d)],_0x59f33b={};if(_0x13fb58&&Array[_0x313171(0x284)](_0x13fb58))for(const _0x30dcfe of _0x13fb58){const _0x2f8fba=_0x30dcfe[_0x313171(0x14e)]('=');if(_0x2f8fba===-0x1)return console[_0x313171(0x10b)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x30dcfe),console[_0x313171(0x10b)](_0x313171(0x234)),0x1;const _0x445855=_0x30dcfe[_0x313171(0x264)](0x0,_0x2f8fba),_0x447bf1=_0x30dcfe[_0x313171(0x264)](_0x2f8fba+0x1);try{_0x59f33b[_0x445855]=JSON[_0x313171(0x224)](_0x447bf1);}catch{_0x59f33b[_0x445855]=_0x447bf1;}}_0x445b54[_0x313171(0x269)]&&(console[_0x313171(0x10b)](_0x313171(0x167)+_0x4e2fb1),Object['keys'](_0x59f33b)[_0x313171(0x1e6)]>0x0&&console[_0x313171(0x10b)]('Parameters:\x20'+JSON[_0x313171(0x19e)](_0x59f33b)),_0x517723&&console[_0x313171(0x10b)](_0x313171(0x271)+_0x517723));if(_0x445b54[_0x313171(0x168)])return await this[_0x313171(0x1b0)](_0x16a590,_0x4e2fb1,_0x59f33b,_0x517723);const _0x3c97ea=await withSpinner('Starting\x20workflow\x20run...',()=>_0x3bdf33[_0x313171(0x202)][_0x313171(0x28c)](_0x4e2fb1,_0x59f33b,{'sessionTime':_0x517723}),{'verbose':_0x445b54[_0x313171(0x269)]}),_0x433508=_0x3c97ea[_0x313171(0x186)];console[_0x313171(0x10b)](_0x313171(0x236)),console[_0x313171(0x10b)](_0x313171(0xe9)+_0x433508['id']),console['error'](_0x313171(0x24a)+_0x433508['sessionId']),console[_0x313171(0x10b)](_0x313171(0x2a5)+_0x433508[_0x313171(0xec)]?.[_0x313171(0x282)]),console[_0x313171(0x10b)](_0x313171(0x116)+_0x433508[_0x313171(0x202)]?.['name']);if(_0x433508[_0x313171(0xec)]?.['id']&&_0x433508[_0x313171(0x165)]&&_0x433508['id']){const _0x1053e5=_0x445b54['site'],_0x5dc6e4=getConsoleUrl(_0x1053e5,_0x313171(0x134)+_0x433508['project']['id']+_0x313171(0xd9)+_0x433508[_0x313171(0x165)]+'/attempt/'+_0x433508['id']);console['error'](_0x313171(0x223)+a59_0xc31aad[_0x313171(0x114)](_0x5dc6e4));}return 0x0;}async['executeDryRun'](_0x1e31cc,_0x41584b,_0x50e9ba,_0x138021){const _0x2786e2=a59_0x5f4ff5,{options:_0x219cb9,tdx:_0x5f1837}=_0x1e31cc,_0x3887f6=await withSpinner(_0x2786e2(0x138)+_0x41584b+_0x2786e2(0x1ce),()=>_0x5f1837['workflow'][_0x2786e2(0x22f)](_0x41584b),{'verbose':_0x219cb9[_0x2786e2(0x269)]}),_0x2aa421=_0x3887f6['data'],_0x4c7f4f=_0x138021??new Date()['toISOString']();console['log'](a59_0xc31aad[_0x2786e2(0x1ff)](_0x2786e2(0x1f0)),_0x41584b),console[_0x2786e2(0x16c)](a59_0xc31aad[_0x2786e2(0x1ff)](_0x2786e2(0x1be)),_0x4c7f4f),console[_0x2786e2(0x16c)](a59_0xc31aad['bold'](_0x2786e2(0x288)),JSON[_0x2786e2(0x19e)](_0x50e9ba)),console[_0x2786e2(0x16c)](''),console['log'](a59_0xc31aad[_0x2786e2(0x1ff)](_0x2786e2(0x25d)));const _0x199a5b=parseTaskGraph(_0x2aa421[_0x2786e2(0x1bd)]??null);if(_0x199a5b[_0x2786e2(0x1e6)]===0x0)console[_0x2786e2(0x16c)](a59_0xc31aad['dim'](_0x2786e2(0x151)));else for(const _0x3bea39 of formatTaskGraph(_0x199a5b)){console[_0x2786e2(0x16c)](_0x3bea39);}const _0x437744=summarizeTaskGraph(_0x199a5b),_0x5c21df=formatWarningSummary(_0x437744);return _0x5c21df&&(console[_0x2786e2(0x16c)](''),console['log'](a59_0xc31aad[_0x2786e2(0x1a2)](_0x5c21df))),console[_0x2786e2(0x16c)](a59_0xc31aad[_0x2786e2(0x1a2)](_0x2786e2(0x23c))),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a59_0x5f4ff5(0x1f2);['description']=a59_0x5f4ff5(0x155);async['execute'](_0x4af2f7){const _0xaaed6c=a59_0x5f4ff5,{options:_0x32b804,args:_0x54ee1b,tdx:_0x3aa64e}=_0x4af2f7,_0x1160f2=_0x54ee1b[0x0],_0x224592=_0x54ee1b[0x1]||'.';if(!_0x1160f2)return console['error'](_0xaaed6c(0x169)),console[_0xaaed6c(0x10b)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x52aa2b=_0x32b804[_0xaaed6c(0x135)];_0x32b804[_0xaaed6c(0x269)]&&(console[_0xaaed6c(0x10b)](_0xaaed6c(0x203)+_0x1160f2),console[_0xaaed6c(0x10b)](_0xaaed6c(0xed)+_0x224592),_0x52aa2b&&console['error'](_0xaaed6c(0x29c)+_0x52aa2b));const _0x36cb6d=await withSpinner('Downloading\x20project\x20'+_0x1160f2+_0xaaed6c(0x1ce),()=>_0x3aa64e[_0xaaed6c(0x202)][_0xaaed6c(0x214)](_0x1160f2,_0x224592,{'revision':_0x52aa2b}),{'verbose':_0x32b804[_0xaaed6c(0x269)]}),_0x600a05=_0x36cb6d['data'];return console[_0xaaed6c(0x10b)](_0xaaed6c(0x1f7)+_0x600a05[_0xaaed6c(0x1c6)]),console[_0xaaed6c(0x10b)](_0xaaed6c(0x283)+_0x600a05[_0xaaed6c(0x135)]),console[_0xaaed6c(0x10b)]('\x20\x20Files\x20extracted:\x20'+_0x600a05['filesExtracted']),console['error'](_0xaaed6c(0x1cf)+_0x224592+'/'+_0x600a05[_0xaaed6c(0x1c6)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a59_0x5f4ff5(0x282)]=a59_0x5f4ff5(0x185);[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0xf8);async[a59_0x5f4ff5(0x12a)](_0x33cb69){const _0x5ddbca=a59_0x5f4ff5,{options:_0x41d8d9,args:_0x3e290d,tdx:_0x56b0d8}=_0x33cb69;let _0x2dfe67='.',_0xb9dfca=_0x41d8d9[_0x5ddbca(0x282)];if(_0x3e290d[0x0]){const {promises:_0x2a46ed}=await import('fs');try{const _0x43c3b9=await _0x2a46ed[_0x5ddbca(0x1c5)](_0x3e290d[0x0]);if(_0x43c3b9[_0x5ddbca(0x1fb)]())_0x2dfe67=_0x3e290d[0x0];else return console[_0x5ddbca(0x10b)]('Error:\x20'+_0x3e290d[0x0]+_0x5ddbca(0x18f)),0x1;}catch{_0xb9dfca=_0x3e290d[0x0],_0x2dfe67='.';}}const _0x139912=_0x41d8d9['revision'],_0x230499=_0x41d8d9['skipValidation'];_0x41d8d9['verbose']&&(console[_0x5ddbca(0x10b)](_0x5ddbca(0x262)+_0x2dfe67),_0xb9dfca&&console[_0x5ddbca(0x10b)](_0x5ddbca(0x270)+_0xb9dfca),_0x139912&&console[_0x5ddbca(0x10b)](_0x5ddbca(0x29c)+_0x139912),_0x230499&&console[_0x5ddbca(0x10b)](_0x5ddbca(0x1fd)));const _0x130038=await withSpinner(_0x5ddbca(0x291),()=>_0x56b0d8[_0x5ddbca(0x202)][_0x5ddbca(0x260)](_0x2dfe67,{'projectName':_0xb9dfca,'revision':_0x139912,'skipValidation':_0x230499}),{'verbose':_0x41d8d9[_0x5ddbca(0x269)]}),_0x149092=_0x130038[_0x5ddbca(0x186)];return console[_0x5ddbca(0x10b)]('✔\x20Pushed\x20'+_0x149092[_0x5ddbca(0x1c6)]),console[_0x5ddbca(0x10b)](_0x5ddbca(0x1a3)+_0x149092[_0x5ddbca(0xf1)]),console[_0x5ddbca(0x10b)]('\x20\x20Revision:\x20'+_0x149092[_0x5ddbca(0x135)]),await this['showWorkflowConsoleUrl'](_0x56b0d8,_0x149092[_0x5ddbca(0x1c6)],_0x41d8d9[_0x5ddbca(0x130)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a59_0x5f4ff5(0x282)]=a59_0x5f4ff5(0x1b3);[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0x161);async[a59_0x5f4ff5(0x12a)](_0x1cbf34){const _0x5972f7=a59_0x5f4ff5,{options:_0x1eb3ca,args:_0x40030b,tdx:_0x35f9fa}=_0x1cbf34,_0x4eb6d1=_0x40030b[0x0],_0x2f325d=_0x40030b[0x1];if(!_0x4eb6d1)return console[_0x5972f7(0x10b)](a59_0xc31aad[_0x5972f7(0x209)](_0x5972f7(0x229)),'Project\x20name\x20is\x20required'),console[_0x5972f7(0x10b)](a59_0xc31aad[_0x5972f7(0x1e5)]('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0xc7367d=_0x1eb3ca[_0x5972f7(0x135)];_0x1eb3ca[_0x5972f7(0x269)]&&(console[_0x5972f7(0x10b)](_0x5972f7(0x203)+_0x4eb6d1),_0x2f325d&&console['error'](_0x5972f7(0x231)+_0x2f325d),_0xc7367d&&console[_0x5972f7(0x10b)](_0x5972f7(0x29c)+_0xc7367d),_0x1eb3ca['dryRun']&&console[_0x5972f7(0x10b)](_0x5972f7(0xd4)));const _0x148470=await withSpinner('Pulling\x20project\x20'+_0x4eb6d1+_0x5972f7(0x1ce),()=>_0x35f9fa[_0x5972f7(0x202)][_0x5972f7(0x159)](_0x4eb6d1,{'targetDir':_0x2f325d,'revision':_0xc7367d}),{'verbose':_0x1eb3ca[_0x5972f7(0x269)]}),_0x149b9e=_0x148470['data'];_0x149b9e['isNewProject']?console[_0x5972f7(0x10b)](_0x5972f7(0x182)+_0x149b9e[_0x5972f7(0x1c6)]):console['error'](_0x5972f7(0x152)+_0x149b9e[_0x5972f7(0x1c6)]);console[_0x5972f7(0x10b)]('\x20\x20Revision:\x20'+_0x149b9e[_0x5972f7(0x135)]),console[_0x5972f7(0x10b)]('\x20\x20Target:\x20'+(a59_0x532ea4[_0x5972f7(0x244)](process['cwd'](),_0x149b9e[_0x5972f7(0x1b7)])||'.')),console[_0x5972f7(0x10b)](_0x5972f7(0x164)+a59_0xc31aad[_0x5972f7(0x118)]('+'+_0x149b9e[_0x5972f7(0x221)]['new']+'\x20new')+',\x20'+(a59_0xc31aad[_0x5972f7(0x1a2)]('~'+_0x149b9e[_0x5972f7(0x221)][_0x5972f7(0x18e)]+_0x5972f7(0x121))+',\x20')+(a59_0xc31aad[_0x5972f7(0x209)]('-'+_0x149b9e['summary'][_0x5972f7(0xe3)]+_0x5972f7(0x20d))+',\x20')+(''+a59_0xc31aad[_0x5972f7(0x1e5)](_0x149b9e[_0x5972f7(0x221)][_0x5972f7(0x29d)]+'\x20unchanged')));for(const _0x3cf46f of _0x149b9e[_0x5972f7(0x28a)]){_0x3cf46f[_0x5972f7(0x205)]===_0x5972f7(0x18e)&&_0x3cf46f[_0x5972f7(0x115)]&&(console[_0x5972f7(0x10b)]('\x0a'+a59_0xc31aad[_0x5972f7(0x114)](_0x5972f7(0x26a)+_0x3cf46f['path'])),console[_0x5972f7(0x10b)](_0x3cf46f[_0x5972f7(0x115)]));}if(!_0x149b9e[_0x5972f7(0x119)])return saveSessionContext({'workflow_project':_0x149b9e['projectName']},_0x1eb3ca['session']),console[_0x5972f7(0x10b)](a59_0xc31aad[_0x5972f7(0x118)](_0x5972f7(0x12d))),console[_0x5972f7(0x10b)](a59_0xc31aad[_0x5972f7(0x1e5)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x149b9e['projectName'])),0x0;if(_0x1eb3ca[_0x5972f7(0x168)])return console[_0x5972f7(0x10b)](a59_0xc31aad['yellow'](_0x5972f7(0x22a))),0x0;if(!_0x1eb3ca[_0x5972f7(0x13e)]){if(!isInteractive())return console['error'](a59_0xc31aad[_0x5972f7(0x209)](_0x5972f7(0x290)),_0x5972f7(0x241)),console[_0x5972f7(0x10b)](a59_0xc31aad[_0x5972f7(0x1e5)](_0x5972f7(0x27c))),0x1;const _0x1c8f63=await confirmKey(_0x5972f7(0x11a));if(!_0x1c8f63)return console['error'](a59_0xc31aad[_0x5972f7(0x1a2)]('Cancelled'),'-\x20no\x20files\x20written'),0x1;}await withSpinner(_0x5972f7(0x276),()=>_0x35f9fa['workflow'][_0x5972f7(0x171)](_0x149b9e,{'revision':_0xc7367d}),{'verbose':_0x1eb3ca[_0x5972f7(0x269)]}),saveSessionContext({'workflow_project':_0x149b9e['projectName']},_0x1eb3ca[_0x5972f7(0x24b)]),console[_0x5972f7(0x10b)](a59_0xc31aad[_0x5972f7(0x118)]('✔\x20Pull\x20complete'));const _0x4d7229=a59_0x532ea4['relative'](process[_0x5972f7(0x240)](),_0x149b9e[_0x5972f7(0x1b7)])||'.';return console['error'](a59_0xc31aad['dim'](_0x5972f7(0x1cf)+_0x4d7229)),console['error'](a59_0xc31aad[_0x5972f7(0x1e5)](_0x5972f7(0x1ec)+_0x149b9e[_0x5972f7(0x1c6)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a59_0x5f4ff5(0x282)]=a59_0x5f4ff5(0x15c);[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0xf5);async[a59_0x5f4ff5(0x12a)](_0x13adcd){const _0x1e7453=a59_0x5f4ff5,{options:_0x56cddc,args:_0x4d6b89,tdx:_0x250852}=_0x13adcd,_0x332df8=this['resolveProjectDir'](_0x4d6b89,_0x56cddc),_0x1da114=_0x56cddc,{revision:_0x49b1da,skipValidation:_0x595b67,backfill:_0x1079ef}=_0x1da114,_0x4d8fd4=_0x1079ef===undefined?undefined:!_0x1079ef;_0x56cddc[_0x1e7453(0x269)]&&(_0x332df8&&console['error'](_0x1e7453(0x26d)+_0x332df8),_0x49b1da&&console[_0x1e7453(0x10b)]('Revision:\x20'+_0x49b1da),_0x56cddc['dryRun']&&console[_0x1e7453(0x10b)]('Dry\x20run:\x20yes'),_0x595b67&&console[_0x1e7453(0x10b)](_0x1e7453(0x1fd)),_0x1079ef&&console[_0x1e7453(0x10b)](_0x1e7453(0x1ab)));let _0x5b2d70;try{_0x5b2d70=await withSpinner(_0x1e7453(0x2a7),()=>_0x250852[_0x1e7453(0x202)][_0x1e7453(0x235)]({'sourceDir':_0x332df8,'revision':_0x49b1da,'skipValidation':_0x595b67,'skipSchedule':_0x4d8fd4}),{'verbose':_0x56cddc['verbose']});}catch(_0x14cc14){if(_0x14cc14 instanceof Error&&_0x14cc14[_0x1e7453(0x1ac)][_0x1e7453(0x177)](_0x1e7453(0x16e)))return console[_0x1e7453(0x10b)](a59_0xc31aad[_0x1e7453(0x209)](_0x1e7453(0x229)),_0x1e7453(0x20e)),_0x56cddc[_0x1e7453(0x1aa)]?console[_0x1e7453(0x10b)](a59_0xc31aad[_0x1e7453(0x1e5)](_0x1e7453(0x147)+_0x56cddc[_0x1e7453(0x1aa)]+_0x1e7453(0x25f)+_0x56cddc[_0x1e7453(0x1aa)]+'\x27')):console[_0x1e7453(0x10b)](a59_0xc31aad[_0x1e7453(0x1e5)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x14cc14;}const _0x4f3044=_0x5b2d70['data'];console['error'](_0x1e7453(0x1f8)+_0x4f3044[_0x1e7453(0x1c6)]),console[_0x1e7453(0x10b)]('\x20\x20Source:\x20'+_0x4f3044[_0x1e7453(0xf7)]),console[_0x1e7453(0x10b)]('\x20\x20Revision:\x20'+_0x4f3044[_0x1e7453(0x135)]),console[_0x1e7453(0x10b)](_0x1e7453(0x164)+a59_0xc31aad[_0x1e7453(0x118)]('+'+_0x4f3044[_0x1e7453(0x221)][_0x1e7453(0x1e1)]+_0x1e7453(0xf0))+',\x20'+(a59_0xc31aad['yellow']('~'+_0x4f3044['summary'][_0x1e7453(0x18e)]+'\x20modified')+',\x20')+(a59_0xc31aad['red']('-'+_0x4f3044[_0x1e7453(0x221)][_0x1e7453(0xe3)]+_0x1e7453(0x20d))+',\x20')+(''+a59_0xc31aad[_0x1e7453(0x1e5)](_0x4f3044[_0x1e7453(0x221)][_0x1e7453(0x29d)]+_0x1e7453(0x292))));for(const _0x1826b8 of _0x4f3044['changes']){_0x1826b8[_0x1e7453(0x205)]===_0x1e7453(0x18e)&&_0x1826b8[_0x1e7453(0x115)]&&(console[_0x1e7453(0x10b)]('\x0a'+a59_0xc31aad[_0x1e7453(0x114)]('---\x20'+_0x1826b8[_0x1e7453(0x286)])),console['error'](_0x1826b8[_0x1e7453(0x115)]));}if(!_0x4f3044[_0x1e7453(0x119)])return console[_0x1e7453(0x10b)](a59_0xc31aad['green']('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x1e7453(0x1bc)](_0x250852,_0x4f3044['projectName'],_0x56cddc[_0x1e7453(0x130)]),0x0;if(_0x56cddc[_0x1e7453(0x168)])return console['error'](a59_0xc31aad[_0x1e7453(0x1a2)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x56cddc[_0x1e7453(0x13e)]){if(!isInteractive())return console[_0x1e7453(0x10b)](a59_0xc31aad[_0x1e7453(0x209)](_0x1e7453(0x290)),_0x1e7453(0x241)),console['error'](a59_0xc31aad[_0x1e7453(0x1e5)](_0x1e7453(0x27c))),0x1;const _0x4e498c=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x4e498c)return console[_0x1e7453(0x10b)](a59_0xc31aad[_0x1e7453(0x1a2)](_0x1e7453(0x2ad)),_0x1e7453(0x26e)),0x1;}const _0x71da4d=await withSpinner(_0x1e7453(0x24f),()=>_0x250852[_0x1e7453(0x202)]['executePushProject'](_0x4f3044),{'verbose':_0x56cddc[_0x1e7453(0x269)]}),_0x232971=_0x71da4d[_0x1e7453(0x186)];return console[_0x1e7453(0x10b)](a59_0xc31aad[_0x1e7453(0x118)](_0x1e7453(0x1cb))),console[_0x1e7453(0x10b)](_0x1e7453(0x1a3)+_0x232971[_0x1e7453(0xf1)]),console[_0x1e7453(0x10b)](_0x1e7453(0x283)+_0x232971[_0x1e7453(0x135)]),await this[_0x1e7453(0x1bc)](_0x250852,_0x232971['projectName'],_0x56cddc['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a59_0x5f4ff5(0x282)]=a59_0x5f4ff5(0x101);[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0x21d);async[a59_0x5f4ff5(0x12a)](_0x4358fe){const _0x153153=a59_0x5f4ff5,{options:_0x2fc2d6,args:_0x560ebf,tdx:_0x1cfc12}=_0x4358fe,_0x1a7b32=this[_0x153153(0x1c2)](_0x560ebf,_0x2fc2d6),_0x4cdc0b=_0x2fc2d6[_0x153153(0x282)],_0x3a9ef7=_0x2fc2d6[_0x153153(0x135)],_0x2d5599=_0x2fc2d6['skipValidation'];if(!_0x1a7b32)return console[_0x153153(0x10b)](a59_0xc31aad['red']('Error:'),_0x153153(0x153)),console[_0x153153(0x10b)](a59_0xc31aad[_0x153153(0x1e5)](_0x153153(0x175))),console[_0x153153(0x10b)](a59_0xc31aad[_0x153153(0x1e5)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x4cdc0b)return console[_0x153153(0x10b)](a59_0xc31aad[_0x153153(0x209)](_0x153153(0x229)),_0x153153(0x1fe)),console[_0x153153(0x10b)](a59_0xc31aad[_0x153153(0x1e5)](_0x153153(0x175))),0x1;_0x2fc2d6[_0x153153(0x269)]&&(console[_0x153153(0x10b)]('Source\x20directory:\x20'+_0x1a7b32),console[_0x153153(0x10b)](_0x153153(0x1bb)+_0x4cdc0b),_0x3a9ef7&&console[_0x153153(0x10b)]('Revision:\x20'+_0x3a9ef7),_0x2fc2d6[_0x153153(0x168)]&&console['error'](_0x153153(0xd4)),_0x2d5599&&console['error'](_0x153153(0x1fd)));const _0x49d71d=await withSpinner(_0x153153(0x198),()=>_0x1cfc12[_0x153153(0x202)][_0x153153(0x21e)](_0x1a7b32,_0x4cdc0b,{'revision':_0x3a9ef7,'skipValidation':_0x2d5599}),{'verbose':_0x2fc2d6[_0x153153(0x269)]}),_0x1596d0=_0x49d71d[_0x153153(0x186)];console[_0x153153(0x10b)](_0x153153(0x1f6)+_0x1596d0[_0x153153(0xf7)]);_0x1596d0[_0x153153(0x106)]&&console[_0x153153(0x10b)]('Source\x20project:\x20'+_0x1596d0[_0x153153(0x106)]);console[_0x153153(0x10b)]('New\x20project\x20name:\x20'+_0x1596d0[_0x153153(0xdb)]),console[_0x153153(0x10b)](_0x153153(0x29c)+_0x1596d0[_0x153153(0x135)]),console[_0x153153(0x10b)](_0x153153(0x28d)+_0x1596d0[_0x153153(0x184)]);_0x1596d0[_0x153153(0x27e)]&&(console[_0x153153(0x10b)](a59_0xc31aad[_0x153153(0x1a2)](_0x153153(0xe4)+_0x1596d0[_0x153153(0xdb)]+_0x153153(0x1dd)+_0x1596d0[_0x153153(0x15d)]+')')),console[_0x153153(0x10b)](a59_0xc31aad[_0x153153(0x1a2)](_0x153153(0xdd))));if(_0x2fc2d6[_0x153153(0x168)])return console['error'](a59_0xc31aad[_0x153153(0x1a2)]('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x2fc2d6[_0x153153(0x13e)]){if(!isInteractive())return console[_0x153153(0x10b)](a59_0xc31aad[_0x153153(0x209)](_0x153153(0x290)),_0x153153(0x241)),console[_0x153153(0x10b)](a59_0xc31aad['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4b15de=_0x1596d0['sourceProjectName']||a59_0x532ea4['basename'](_0x1a7b32),_0x1be22b=_0x1596d0[_0x153153(0x27e)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x4cdc0b+_0x153153(0x1a5):_0x153153(0x275)+_0x4b15de+_0x153153(0x22b)+_0x4cdc0b+'\x22?',_0x1789f4=await confirmKey(_0x1be22b);if(!_0x1789f4)return console[_0x153153(0x10b)](a59_0xc31aad['yellow'](_0x153153(0x2ad))),0x1;}const _0x46f84d=await withSpinner(_0x1596d0[_0x153153(0x27e)]?_0x153153(0x1ed)+_0x4cdc0b+_0x153153(0x1ce):_0x153153(0x192)+_0x4cdc0b+_0x153153(0x1ce),()=>_0x1cfc12['workflow'][_0x153153(0x17d)](_0x1596d0),{'verbose':_0x2fc2d6['verbose']}),_0x40043e=_0x46f84d[_0x153153(0x186)];return console[_0x153153(0x10b)](a59_0xc31aad[_0x153153(0x118)](_0x1596d0['targetExists']?'✔\x20Project\x20updated':_0x153153(0x19d))),console['error'](_0x153153(0x2a5)+_0x40043e[_0x153153(0xdb)]),console[_0x153153(0x10b)]('\x20\x20Project\x20ID:\x20'+_0x40043e[_0x153153(0x15f)]),console[_0x153153(0x10b)](_0x153153(0x283)+_0x40043e['revision']),await this[_0x153153(0x1bc)](_0x1cfc12,_0x40043e['newProjectName'],_0x2fc2d6[_0x153153(0x130)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a59_0x5f4ff5(0x1d8);[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0x1c1);async['execute'](_0x156b08){const _0x1d877b=a59_0x5f4ff5,{options:_0x3f6d33,args:_0x3c13af,tdx:_0x5ef661}=_0x156b08,_0xc24648=_0x3c13af[0x0];if(!_0xc24648)return console['error'](_0x1d877b(0x255)),console[_0x1d877b(0x10b)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x3f6d33[_0x1d877b(0x269)]&&console['error']('Project:\x20'+_0xc24648);if(!_0x3f6d33[_0x1d877b(0x13e)]){if(!isInteractive())return console['error'](a59_0xc31aad[_0x1d877b(0x209)]('\x0aError:'),_0x1d877b(0x241)),console['error'](a59_0xc31aad[_0x1d877b(0x1e5)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5b45ec=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0xc24648+_0x1d877b(0x2aa));if(!_0x5b45ec)return console[_0x1d877b(0x10b)](a59_0xc31aad[_0x1d877b(0x1a2)](_0x1d877b(0x2ad))),0x1;}const _0x6d432e=await withSpinner(_0x1d877b(0x222)+_0xc24648+_0x1d877b(0x1ce),()=>_0x5ef661[_0x1d877b(0x202)][_0x1d877b(0x12c)](_0xc24648),{'verbose':_0x3f6d33['verbose']}),_0x56fbd5=_0x6d432e['data'];return console[_0x1d877b(0x10b)](_0x1d877b(0x207)+_0x56fbd5[_0x1d877b(0x1c6)]),console['error'](_0x1d877b(0x1a3)+_0x56fbd5[_0x1d877b(0xf1)]),0x0;}}export function parseKeyValue(_0x16b266){const _0x1c4bb7=a59_0x5f4ff5,_0x1f3e18=_0x16b266['indexOf']('=');if(_0x1f3e18===-0x1)throw new Error(_0x1c4bb7(0x1d5)+_0x16b266+_0x1c4bb7(0xff));const _0x5c1623=_0x16b266['substring'](0x0,_0x1f3e18),_0x468cf2=_0x16b266[_0x1c4bb7(0x264)](_0x1f3e18+0x1);if(!_0x5c1623)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x5c1623,'value':_0x468cf2};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a59_0x5f4ff5(0x282)]=a59_0x5f4ff5(0x191);[a59_0x5f4ff5(0x228)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a59_0x5f4ff5(0x12a)](_0x426eeb){const _0x590346=a59_0x5f4ff5,{options:_0x386674,args:_0x40eb66,tdx:_0x32f602}=_0x426eeb,_0xed86fa=this['requireProject'](_0x40eb66,_0x386674);if(!_0xed86fa)return 0x1;_0x386674['verbose']&&console[_0x590346(0x10b)](_0x590346(0x203)+_0xed86fa);const _0x4bd195=await withSpinner(_0x590346(0x188),()=>_0x32f602[_0x590346(0x202)][_0x590346(0xd6)](_0xed86fa),{'verbose':_0x386674[_0x590346(0x269)]}),{secrets:_0x5f3203}=_0x4bd195['data'];return console[_0x590346(0x10b)](_0x590346(0x267)+_0x5f3203[_0x590346(0x1e6)]+_0x590346(0xf2)+(_0x5f3203[_0x590346(0x1e6)]!==0x1?'s':'')),await handleSDKOutput(_0x5f3203,_0x386674),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a59_0x5f4ff5(0x282)]=a59_0x5f4ff5(0x11d);[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0xea);async['execute'](_0x1e1f47){const _0x1e4679=a59_0x5f4ff5,{options:_0x2e21e4,args:_0x5001f6,tdx:_0x280055}=_0x1e1f47;let _0x273963,_0x2d39f9;if(_0x5001f6[_0x1e4679(0x1e6)]>=0x1&&!_0x5001f6[0x0]['includes']('='))_0x273963=_0x5001f6[0x0],_0x2d39f9=_0x5001f6[_0x1e4679(0x1d9)](0x1);else{if(_0x5001f6[_0x1e4679(0x1e6)]>=0x1&&_0x2e21e4[_0x1e4679(0x1aa)])_0x273963=_0x2e21e4[_0x1e4679(0x1aa)],_0x2d39f9=_0x5001f6;else return _0x5001f6[_0x1e4679(0x1e6)]>=0x1?(console[_0x1e4679(0x10b)](_0x1e4679(0x169)),console[_0x1e4679(0x10b)](_0x1e4679(0x289)),0x1):(console[_0x1e4679(0x10b)](_0x1e4679(0x233)),console[_0x1e4679(0x10b)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1);}if(_0x2d39f9[_0x1e4679(0x1e6)]===0x0)return console[_0x1e4679(0x10b)](_0x1e4679(0x233)),console[_0x1e4679(0x10b)](_0x1e4679(0x237)),0x1;const _0x3eb654={};try{for(const _0xadfcfc of _0x2d39f9){const {key:_0x491e2d,value:_0x1e940e}=parseKeyValue(_0xadfcfc);_0x3eb654[_0x491e2d]=_0x1e940e;}}catch(_0x5b890c){return _0x5b890c instanceof Error&&console[_0x1e4679(0x10b)](a59_0xc31aad[_0x1e4679(0x209)]('Error:'),_0x5b890c[_0x1e4679(0x1ac)]),0x1;}const _0x38cbed=Object[_0x1e4679(0x24d)](_0x3eb654);_0x2e21e4[_0x1e4679(0x269)]&&(console[_0x1e4679(0x10b)](_0x1e4679(0x203)+_0x273963),console[_0x1e4679(0x10b)]('Secrets\x20to\x20set:\x20'+_0x38cbed[_0x1e4679(0x140)](',\x20')));const _0x181e17=await withSpinner(_0x38cbed[_0x1e4679(0x1e6)]===0x1?_0x1e4679(0x2ac):'Setting\x20'+_0x38cbed['length']+'\x20secrets...',()=>_0x280055[_0x1e4679(0x202)][_0x1e4679(0x170)](_0x273963,_0x3eb654),{'verbose':_0x2e21e4[_0x1e4679(0x269)]}),_0x3b8ec2=_0x181e17[_0x1e4679(0x186)];return console[_0x1e4679(0x10b)](_0x38cbed[_0x1e4679(0x1e6)]===0x1?_0x1e4679(0x15b)+_0x3b8ec2[_0x1e4679(0x24d)][0x0]+_0x1e4679(0x109)+_0x3b8ec2[_0x1e4679(0x1c6)]+'\x27':'✔\x20'+_0x3b8ec2[_0x1e4679(0x24d)][_0x1e4679(0x1e6)]+_0x1e4679(0x23a)+_0x3b8ec2['projectName']+'\x27'),(_0x2e21e4[_0x1e4679(0x277)]||_0x2e21e4[_0x1e4679(0x1df)])&&await handleSingleObjectOutput(_0x3b8ec2,_0x2e21e4),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a59_0x5f4ff5(0x282)]=a59_0x5f4ff5(0x29b);[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0x27a);async[a59_0x5f4ff5(0x12a)](_0xf8804d){const _0x41837d=a59_0x5f4ff5,{options:_0x412695,args:_0x56854b,tdx:_0x553560}=_0xf8804d;let _0x2176b5,_0x42ebc2;if(_0x56854b[_0x41837d(0x1e6)]>=0x2)_0x2176b5=_0x56854b[0x0],_0x42ebc2=_0x56854b[0x1];else{if(_0x56854b[_0x41837d(0x1e6)]===0x1&&_0x412695[_0x41837d(0x1aa)])_0x2176b5=_0x412695['workflowProject'],_0x42ebc2=_0x56854b[0x0];else return _0x56854b[_0x41837d(0x1e6)]===0x1?(console['error'](_0x41837d(0x169)),console[_0x41837d(0x10b)](_0x41837d(0x289)),0x1):(console['error']('Error:\x20Secret\x20key\x20is\x20required'),console['error'](_0x41837d(0x213)),0x1);}_0x412695['verbose']&&(console[_0x41837d(0x10b)]('Project:\x20'+_0x2176b5),console[_0x41837d(0x10b)](_0x41837d(0x1ba)+_0x42ebc2));if(!_0x412695[_0x41837d(0x13e)]){if(!isInteractive())return console['error'](a59_0xc31aad[_0x41837d(0x209)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x41837d(0x10b)](a59_0xc31aad[_0x41837d(0x1e5)](_0x41837d(0x27c))),0x1;const _0x125be5=await confirmKey(_0x41837d(0x1e3)+_0x42ebc2+_0x41837d(0x2a0)+_0x2176b5+'\x27?');if(!_0x125be5)return console[_0x41837d(0x10b)](a59_0xc31aad['yellow']('Cancelled')),0x1;}const _0x40cfc8=await withSpinner(_0x41837d(0x280),()=>_0x553560[_0x41837d(0x202)]['deleteSecret'](_0x2176b5,_0x42ebc2),{'verbose':_0x412695['verbose']}),_0x53daeb=_0x40cfc8[_0x41837d(0x186)];return console[_0x41837d(0x10b)]('✔\x20Secret\x20\x27'+_0x53daeb['key']+_0x41837d(0x1c8)+_0x53daeb['projectName']+'\x27'),(_0x412695[_0x41837d(0x277)]||_0x412695[_0x41837d(0x1df)])&&await handleSingleObjectOutput(_0x53daeb,_0x412695),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(_0x1f0a89){const _0x36c1aa=a59_0x5f4ff5,_0x5821da=Math[_0x36c1aa(0x227)](_0x1f0a89/0x3e8),_0x36e73f=Math[_0x36c1aa(0x227)](_0x5821da/0x3c),_0x270c8a=Math[_0x36c1aa(0x227)](_0x36e73f/0x3c),_0x5ec872=Math[_0x36c1aa(0x227)](_0x270c8a/0x18);if(_0x5ec872>0x0){const _0x4811c1=_0x270c8a%0x18;return _0x4811c1>0x0?_0x5ec872+'d\x20'+_0x4811c1+'h':_0x5ec872+'d';}else{if(_0x270c8a>0x0){const _0xac4235=_0x36e73f%0x3c;return _0xac4235>0x0?_0x270c8a+'h\x20'+_0xac4235+'m':_0x270c8a+'h';}else{if(_0x36e73f>0x0){const _0x160c05=_0x5821da%0x3c;return _0x160c05>0x0?_0x36e73f+'m\x20'+_0x160c05+'s':_0x36e73f+'m';}else return _0x5821da+'s';}}}function formatTimestamp(_0x405000,_0x141ac9){const _0x58a5e4=a59_0x5f4ff5,_0xc70559=new Date(_0x405000),_0x1cfa97=String(_0xc70559[_0x58a5e4(0x1bf)]())[_0x58a5e4(0x111)](0x2,'0'),_0x3ba575=String(_0xc70559[_0x58a5e4(0x107)]())[_0x58a5e4(0x111)](0x2,'0'),_0x3798b6=_0x1cfa97+':'+_0x3ba575,_0x416681=_0xc70559[_0x58a5e4(0x126)]()===_0x141ac9[_0x58a5e4(0x126)]()&&_0xc70559[_0x58a5e4(0x11f)]()===_0x141ac9['getMonth']()&&_0xc70559[_0x58a5e4(0x25c)]()===_0x141ac9[_0x58a5e4(0x25c)]();if(_0x416681)return _0x3798b6;else{const _0x2eceab=String(_0xc70559[_0x58a5e4(0x11f)]()+0x1)[_0x58a5e4(0x111)](0x2,'0'),_0x326a59=String(_0xc70559[_0x58a5e4(0x25c)]())[_0x58a5e4(0x111)](0x2,'0');return _0x2eceab+'-'+_0x326a59+'\x20'+_0x3798b6;}}function formatDate(_0xd33625){const _0x4def6c=a59_0x5f4ff5,_0x44bdb4=_0xd33625[_0x4def6c(0x126)](),_0x23ea0f=String(_0xd33625[_0x4def6c(0x11f)]()+0x1)[_0x4def6c(0x111)](0x2,'0'),_0x22f965=String(_0xd33625[_0x4def6c(0x25c)]())['padStart'](0x2,'0');return _0x44bdb4+'-'+_0x23ea0f+'-'+_0x22f965;}function getTaskStateIcon(_0xc1eef2){const _0x7e1d1f={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x7e1d1f[_0xc1eef2]||'⚪';}function getBarChar(_0x23b936){const _0x1c3d30=a59_0x5f4ff5;return _0x23b936===_0x1c3d30(0x10b)||_0x23b936===_0x1c3d30(0x197)?'×':'─';}function getBarColor(_0x38c961){const _0x197769=a59_0x5f4ff5,_0xe34d34={'success':a59_0xc31aad[_0x197769(0x118)],'error':a59_0xc31aad[_0x197769(0x209)],'group_error':a59_0xc31aad[_0x197769(0x209)],'running':a59_0xc31aad[_0x197769(0x146)],'blocked':a59_0xc31aad[_0x197769(0x1a2)],'planned':a59_0xc31aad['dim'],'canceling':a59_0xc31aad[_0x197769(0x1a2)]};return _0xe34d34[_0x38c961]||a59_0xc31aad['white'];}function parseTaskName(_0x20e279){const _0xef0df9=a59_0x5f4ff5;let _0x13b2f7=_0x20e279[_0xef0df9(0x20f)](/^\++/,'');const _0x435f62=_0x13b2f7[_0xef0df9(0x178)]('+'),_0x39b3bf=_0x435f62[_0xef0df9(0x1e6)]>0x1?_0x435f62[_0xef0df9(0x1e6)]-0x2:0x0,_0x36c96d=_0x435f62[_0x435f62['length']-0x1]||_0x13b2f7;return{'level':_0x39b3bf,'name':'+'+_0x36c96d};}function truncateTaskName(_0x45c2a2,_0xf57156){const _0x16b094=a59_0x5f4ff5,_0x1c0121=stringWidth(_0x45c2a2);if(_0x1c0121<=_0xf57156)return _0x45c2a2;let _0x4d0a66=_0x45c2a2;while(stringWidth(_0x4d0a66+'…')>_0xf57156&&_0x4d0a66[_0x16b094(0x1e6)]>0x0){_0x4d0a66=_0x4d0a66[_0x16b094(0x1d9)](0x0,-0x1);}return _0x4d0a66+'…';}function calculateTimeScale(_0x116980,_0x478cc1){const _0x287f3c=a59_0x5f4ff5;return{'startTime':_0x116980[_0x287f3c(0x2ab)],'endTime':_0x116980[_0x287f3c(0x2a4)],'durationMs':_0x116980[_0x287f3c(0x1c0)],'msPerChar':_0x116980[_0x287f3c(0x1c0)]/_0x478cc1};}function timeToPosition(_0xeaa145,_0x384d1c,_0x544ded){const _0x346c22=a59_0x5f4ff5,_0x3282f1=_0xeaa145-_0x384d1c[_0x346c22(0x29e)],_0x474fa2=Math['floor'](_0x3282f1/_0x384d1c[_0x346c22(0x219)]);return Math[_0x346c22(0xe5)](0x0,Math['min'](_0x474fa2,_0x544ded));}function renderTimeAxis(_0x15f63e,_0xd743bc){const _0x1cc041=a59_0x5f4ff5,_0x25bbd1=Math['min'](TIMELINE_CONFIG[_0x1cc041(0x13c)],Math[_0x1cc041(0xe5)](TIMELINE_CONFIG[_0x1cc041(0x1c4)],Math['floor'](_0xd743bc/TIMELINE_CONFIG[_0x1cc041(0xfe)]))),_0x1b2432=_0x15f63e[_0x1cc041(0xe6)]/(_0x25bbd1-0x1),_0x4595ae=new Date(_0x15f63e['startTime']),_0x3594ed=[];for(let _0x3211ce=0x0;_0x3211ce<_0x25bbd1;_0x3211ce++){const _0x2b98aa=_0x15f63e[_0x1cc041(0x29e)]+_0x3211ce*_0x1b2432,_0x286ff9=timeToPosition(_0x2b98aa,_0x15f63e,_0xd743bc),_0x4618bb=formatTimestamp(_0x2b98aa,_0x4595ae);_0x3594ed[_0x1cc041(0x260)]({'pos':_0x286ff9,'text':_0x4618bb});}const _0xce1263=new Array(_0xd743bc)[_0x1cc041(0x263)]('\x20');let _0xe08428=-0x1;for(const {pos:_0x5502f3,text:_0x37fa40}of _0x3594ed){let _0x8be841=Math[_0x1cc041(0xe5)](0x0,_0x5502f3-Math['floor'](_0x37fa40['length']/0x2));_0x8be841<=_0xe08428+TIMELINE_CONFIG[_0x1cc041(0x1d6)]&&(_0x8be841=_0xe08428+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x8be841+_0x37fa40[_0x1cc041(0x1e6)]>_0xd743bc&&(_0x8be841=_0xd743bc-_0x37fa40[_0x1cc041(0x1e6)]);if(_0x8be841>=0x0&&_0x8be841+_0x37fa40['length']<=_0xd743bc&&_0x8be841>_0xe08428){for(let _0x51509d=0x0;_0x51509d<_0x37fa40[_0x1cc041(0x1e6)];_0x51509d++){_0xce1263[_0x8be841+_0x51509d]=_0x37fa40[_0x51509d];}_0xe08428=_0x8be841+_0x37fa40[_0x1cc041(0x1e6)]-0x1;}}return _0xce1263[_0x1cc041(0x140)]('');}function renderTaskRow(_0x1595c5,_0x1586d3,_0x4be00f,_0x5257e){const _0x1e4aac=a59_0x5f4ff5,{level:_0x121db4,name:_0x17faf6}=parseTaskName(_0x1595c5[_0x1e4aac(0x282)]),_0x101e57='\x20'[_0x1e4aac(0x225)](_0x121db4),_0x47cfff=_0x1595c5[_0x1e4aac(0x1f5)]?'('+formatElapsed(_0x1595c5[_0x1e4aac(0x1f5)][_0x1e4aac(0x1c0)])+')':'',_0x1bda2b=stringWidth(_0x47cfff),_0x3b015b=_0x121db4*0x1,_0x32e37c=_0x5257e-_0x3b015b-_0x1bda2b-0x1,_0x5efb3c=truncateTaskName(_0x17faf6,_0x32e37c),_0x3888ab=_0x101e57+_0x5efb3c,_0x3bf000=stringWidth(_0x3888ab),_0x5def5f=_0x5257e-_0x3bf000-_0x1bda2b,_0xe6da30=_0x3888ab+'\x20'['repeat'](Math[_0x1e4aac(0xe5)](0x1,_0x5def5f))+a59_0xc31aad['dim'](_0x47cfff),_0x4010cc=getTaskStateIcon(_0x1595c5['state']),_0x2a6c1a=new Array(_0x4be00f)[_0x1e4aac(0x263)]('\x20');if(_0x1595c5[_0x1e4aac(0x1f5)]){const _0x6b7375=timeToPosition(_0x1595c5[_0x1e4aac(0x1f5)]['start'],_0x1586d3,_0x4be00f),_0x5d7453=timeToPosition(_0x1595c5[_0x1e4aac(0x1f5)][_0x1e4aac(0x2a4)],_0x1586d3,_0x4be00f),_0x35edb3=getBarChar(_0x1595c5[_0x1e4aac(0x17e)]),_0x5c51fc=Math[_0x1e4aac(0xe5)](_0x6b7375+0x1,_0x5d7453);for(let _0x234670=_0x6b7375;_0x234670<Math['min'](_0x5c51fc,_0x4be00f);_0x234670++){_0x2a6c1a[_0x234670]=_0x35edb3;}}const _0x5548b1=getBarColor(_0x1595c5['state']),_0x33a7db=_0x2a6c1a[_0x1e4aac(0xe1)](_0x446157=>_0x446157==='\x20'?'\x20':_0x5548b1(_0x446157))['join']('');return _0x4010cc+'\x20'+_0xe6da30+'│'+_0x33a7db+'│';}function calculateStats(_0x4816f9){const _0x3f5ff7=a59_0x5f4ff5,_0xb0a6e={'total':_0x4816f9['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x392196 of _0x4816f9){if(_0x392196[_0x3f5ff7(0x17e)]===_0x3f5ff7(0x142))_0xb0a6e[_0x3f5ff7(0x142)]++;else{if(_0x392196[_0x3f5ff7(0x17e)]==='error'||_0x392196[_0x3f5ff7(0x17e)]===_0x3f5ff7(0x197))_0xb0a6e[_0x3f5ff7(0x10b)]++;else _0x392196[_0x3f5ff7(0x17e)]===_0x3f5ff7(0x1ad)?_0xb0a6e[_0x3f5ff7(0x1ad)]++:_0xb0a6e[_0x3f5ff7(0x122)]++;}}return _0xb0a6e;}function formatStats(_0x1cef11){const _0x584024=a59_0x5f4ff5;return[_0x584024(0x25b)+_0x1cef11['total'],'✅\x20'+_0x1cef11[_0x584024(0x142)],'❌\x20'+_0x1cef11['error'],_0x584024(0x1e4)+_0x1cef11[_0x584024(0x1ad)],'⏳\x20'+_0x1cef11[_0x584024(0x122)]][_0x584024(0x140)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a59_0x5f4ff5(0x17a);['description']='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async['execute'](_0xa13eed){const _0x4411ff=a59_0x5f4ff5,{options:_0x3b9b7c,args:_0x501aae,tdx:_0x41aad3}=_0xa13eed;let _0x330b12,_0x35c57e,_0x49050b=![];if(_0x501aae[0x0]){if(_0x501aae[0x0][_0x4411ff(0x177)]('.')){const _0xc98f11=this['parseProjectWorkflowPattern'](_0x501aae,_0x3b9b7c);if(!_0xc98f11)return 0x1;_0x330b12=_0xc98f11[_0x4411ff(0x1c6)],_0x35c57e=_0xc98f11[_0x4411ff(0x206)];}else{_0x35c57e=_0x501aae[0x0],_0x330b12=_0x3b9b7c[_0x4411ff(0x1aa)];if(!_0x330b12)return console['error'](a59_0xc31aad[_0x4411ff(0x209)]('Error:'),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x49050b=!![];}}else{const _0x3f93e0=this['parseProjectWorkflowPattern'](_0x501aae,_0x3b9b7c);if(!_0x3f93e0)return 0x1;_0x330b12=_0x3f93e0['projectName'],_0x35c57e=_0x3f93e0['workflowName'];}if(_0x3b9b7c[_0x4411ff(0x269)]){if(_0x330b12&&_0x35c57e)console['error']('Filter:\x20'+_0x330b12+'.'+_0x35c57e);else _0x330b12&&console[_0x4411ff(0x10b)](_0x4411ff(0x23d)+_0x330b12);}const _0x2a504a=_0x3b9b7c[_0x4411ff(0x125)],_0xecd417=_0x3b9b7c[_0x4411ff(0x165)];if(_0x2a504a){_0xecd417&&console[_0x4411ff(0x10b)](a59_0xc31aad[_0x4411ff(0x1a2)](_0x4411ff(0x1cc)),_0x4411ff(0x26f));const _0x204f2f=_0x3b9b7c['follow'];return _0x204f2f?await this[_0x4411ff(0x1f3)](_0xa13eed,_0x2a504a):await this[_0x4411ff(0x26b)](_0xa13eed,_0x2a504a,_0x3b9b7c),0x0;}if(_0xecd417){const _0x2ea164=await withSpinner(_0x4411ff(0x215),()=>_0x41aad3['workflow'][_0x4411ff(0xd7)]({'projectName':_0x330b12,'workflowName':_0x35c57e,'limit':0x64}),{'verbose':_0x3b9b7c[_0x4411ff(0x269)]}),_0x76f0cc=_0x2ea164[_0x4411ff(0x186)][_0x4411ff(0x2a9)](_0x3ffeb6=>_0x3ffeb6['id']===_0xecd417);if(!_0x76f0cc)return console[_0x4411ff(0x10b)](a59_0xc31aad[_0x4411ff(0x209)](_0x4411ff(0x229)),_0x4411ff(0x157)+_0xecd417),0x1;if(!_0x76f0cc[_0x4411ff(0x12e)]?.['id'])return console[_0x4411ff(0x10b)](a59_0xc31aad['red'](_0x4411ff(0x229)),'Session\x20'+_0xecd417+_0x4411ff(0x15a)),0x1;const _0x4bc44e=_0x76f0cc[_0x4411ff(0x12e)]['id'];_0x3b9b7c[_0x4411ff(0x269)]&&console[_0x4411ff(0x10b)](_0x4411ff(0x19c)+_0x4bc44e+_0x4411ff(0x1db)+_0xecd417);const _0x17d5b3=_0x3b9b7c[_0x4411ff(0xde)];return _0x17d5b3?await this[_0x4411ff(0x1f3)](_0xa13eed,_0x4bc44e):await this[_0x4411ff(0x26b)](_0xa13eed,_0x4bc44e,_0x3b9b7c),0x0;}const _0x1e7e5d=await withSpinner(_0x4411ff(0x14b),()=>_0x41aad3[_0x4411ff(0x202)][_0x4411ff(0xd7)]({'projectName':_0x330b12,'workflowName':_0x35c57e,'limit':_0x3b9b7c[_0x4411ff(0x156)]||0x32}),{'verbose':_0x3b9b7c[_0x4411ff(0x269)]}),_0x2458e5=_0x1e7e5d[_0x4411ff(0x186)];if(_0x2458e5[_0x4411ff(0x1e6)]===0x0){if(_0x330b12&&_0x35c57e)console['error']('No\x20sessions\x20found\x20for:\x20'+_0x330b12+'.'+_0x35c57e);else _0x330b12?console['error']('No\x20sessions\x20found\x20in\x20project:\x20'+_0x330b12):(console[_0x4411ff(0x10b)](_0x4411ff(0x199)),console[_0x4411ff(0x10b)](a59_0xc31aad[_0x4411ff(0x1e5)](_0x4411ff(0x1e0))));return 0x0;}_0x2458e5[_0x4411ff(0x257)]((_0x482a28,_0x598aa5)=>{const _0x2aca53=_0x4411ff,_0x3fb9c3=_0x482a28['sessionTime']||'',_0x309bf1=_0x598aa5[_0x2aca53(0x14d)]||'';return _0x309bf1[_0x2aca53(0x12b)](_0x3fb9c3);});if(_0x3b9b7c[_0x4411ff(0x277)]||_0x3b9b7c[_0x4411ff(0x1df)])return await handleSDKOutput(_0x2458e5,_0x3b9b7c),0x0;let _0x1e143c;if(_0x49050b){const _0x466b84=_0x2458e5[0x0];if(!_0x466b84[_0x4411ff(0x12e)]?.['id'])return console[_0x4411ff(0x10b)]('Latest\x20session\x20has\x20no\x20attempt'),0x0;_0x1e143c=_0x466b84['lastAttempt']['id'],_0x3b9b7c[_0x4411ff(0x269)]&&console[_0x4411ff(0x10b)](_0x4411ff(0x141)+_0x466b84[_0x4411ff(0x14d)]);}else{const _0x3d6478=_0x2458e5[_0x4411ff(0xe1)](_0x241797=>{const _0xa00aaa=_0x4411ff,_0x18a601=getAttemptStatusDisplay(_0x241797[_0xa00aaa(0x12e)]);return{'title':_0x241797['project']?.[_0xa00aaa(0x282)]+'.'+_0x241797[_0xa00aaa(0x202)]?.[_0xa00aaa(0x282)]+'\x20-\x20'+_0x241797['sessionTime']+'\x20'+_0x18a601[_0xa00aaa(0x287)],'value':_0x241797[_0xa00aaa(0x12e)]?.['id']||'','description':_0x18a601[_0xa00aaa(0x1ca)]};}),_0x291d0a=await a59_0x42cf4e({'type':'select','name':_0x4411ff(0x125),'message':_0x4411ff(0x102),'choices':_0x3d6478[_0x4411ff(0x19f)](_0x41473b=>_0x41473b['value']!=='')});if(!_0x291d0a['attemptId'])return 0x0;_0x1e143c=_0x291d0a[_0x4411ff(0x125)];}const _0xf53001=_0x3b9b7c[_0x4411ff(0xde)];return _0xf53001?await this['pollTimeline'](_0xa13eed,_0x1e143c):await this[_0x4411ff(0x26b)](_0xa13eed,_0x1e143c,_0x3b9b7c),0x0;}async['renderSingleTimeline'](_0x21c712,_0x1221fb,_0x166d24){const _0xfeff53=a59_0x5f4ff5,{tdx:_0xe7c4fe}=_0x21c712;let _0xa07a3c,_0x399d36;try{[_0xa07a3c,_0x399d36]=await Promise[_0xfeff53(0x190)]([_0xe7c4fe['workflow'][_0xfeff53(0x1a8)](_0x1221fb),_0xe7c4fe[_0xfeff53(0x202)][_0xfeff53(0x1c7)](_0x1221fb,![])]);}catch(_0x24b5d8){console['error'](a59_0xc31aad['red'](_0xfeff53(0x25a)));_0x166d24['verbose']&&console['error'](_0x24b5d8);throw _0x24b5d8;}if(_0x166d24[_0xfeff53(0x277)]||_0x166d24[_0xfeff53(0x1df)]){const _0x48700a=this[_0xfeff53(0x218)](_0xa07a3c,_0x399d36);await handleSDKOutput([_0x48700a],_0x166d24);return;}const _0x4665d5=_0xe7c4fe[_0xfeff53(0x166)][_0xfeff53(0x130)],_0x107bc7=this[_0xfeff53(0x105)](_0xa07a3c,_0x399d36,_0x4665d5);console[_0xfeff53(0x16c)](_0x107bc7);}async['pollTimeline'](_0x43e520,_0xfa92e7){const _0x3f63da=a59_0x5f4ff5,{tdx:_0x113120}=_0x43e520,_0x1e5bc8=TIMELINE_CONFIG[_0x3f63da(0x2a3)],_0x173a61=TIMELINE_CONFIG[_0x3f63da(0x1a1)];let _0x2c4018=0x0;while(_0x2c4018<_0x173a61){process['stdout'][_0x3f63da(0x16a)]&&process[_0x3f63da(0xee)]['write']('\x1Bc');let _0x480e20,_0x3fb40b;try{[_0x480e20,_0x3fb40b]=await Promise[_0x3f63da(0x190)]([_0x113120[_0x3f63da(0x202)][_0x3f63da(0x1a8)](_0xfa92e7),_0x113120['workflow'][_0x3f63da(0x1c7)](_0xfa92e7,![])]);}catch(_0x82dbfa){console[_0x3f63da(0x10b)](a59_0xc31aad[_0x3f63da(0x209)](_0x3f63da(0x20b)));_0x2c4018>0x0&&console[_0x3f63da(0x10b)](a59_0xc31aad[_0x3f63da(0x1e5)](_0x3f63da(0x172)+_0x2c4018));throw _0x82dbfa;}const _0x5465d7=_0x113120[_0x3f63da(0x166)]['site'],_0x2ce442=this[_0x3f63da(0x105)](_0x480e20,_0x3fb40b,_0x5465d7);console['log'](_0x2ce442);const _0x1a81c0=_0x480e20[_0x3f63da(0xda)]&&_0x3fb40b[_0x3f63da(0x1c3)](_0x3ad078=>_0x3ad078[_0x3f63da(0x17e)]!==_0x3f63da(0x1ad)&&_0x3ad078['state']!==_0x3f63da(0x16b));if(_0x1a81c0){console[_0x3f63da(0x10b)](a59_0xc31aad[_0x3f63da(0x118)](_0x3f63da(0x252)));break;}console[_0x3f63da(0x10b)](a59_0xc31aad[_0x3f63da(0x1e5)](_0x3f63da(0x24c)+_0x2c4018*0x2+_0x3f63da(0x19b))),await new Promise(_0x4a5f9d=>setTimeout(_0x4a5f9d,_0x1e5bc8)),_0x2c4018++;}_0x2c4018>=_0x173a61&&console[_0x3f63da(0x10b)](a59_0xc31aad[_0x3f63da(0x1a2)](_0x3f63da(0x279)));}['renderTimeline'](_0x22005a,_0x5ed1ff,_0x502bf0){const _0x555d20=a59_0x5f4ff5,_0x1d98b9=[],_0x3a2c62=TIMELINE_CONFIG[_0x555d20(0x27b)],_0x101ec6=0x5,_0x28bd87=process[_0x555d20(0xee)][_0x555d20(0x129)]||0x78,_0x19e054=_0x28bd87-_0x3a2c62-_0x101ec6,_0x83b605=Math[_0x555d20(0xe5)](TIMELINE_CONFIG[_0x555d20(0x28e)],Math[_0x555d20(0x1b1)](_0x19e054,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0xee0e2a=new Date(_0x22005a[_0x555d20(0x210)])[_0x555d20(0x1d2)](),_0x4fee70=_0x22005a['finishedAt']?new Date(_0x22005a[_0x555d20(0x1a6)])['getTime']():Date[_0x555d20(0x1da)](),_0x55a8a2={'start':_0xee0e2a,'end':_0x4fee70,'duration':_0x4fee70-_0xee0e2a},_0x120814=new Map(),_0x50c31f=[];for(const _0x437ea4 of _0x5ed1ff){if(_0x437ea4[_0x555d20(0x272)]){const _0x34bb1b=new Date(_0x437ea4['startedAt'])[_0x555d20(0x1d2)](),_0x1ee22d=_0x437ea4['updatedAt']?new Date(_0x437ea4['updatedAt'])[_0x555d20(0x1d2)]():Date[_0x555d20(0x1da)](),_0x30c69e={'start':_0x34bb1b,'end':_0x1ee22d,'duration':_0x1ee22d-_0x34bb1b};_0x120814['set'](_0x437ea4['id'],_0x30c69e),_0x50c31f[_0x555d20(0x260)]({'name':_0x437ea4['fullName'],'state':_0x437ea4['state']||_0x555d20(0x154),'window':_0x30c69e});}else _0x50c31f[_0x555d20(0x260)]({'name':_0x437ea4[_0x555d20(0x1a4)],'state':_0x437ea4[_0x555d20(0x17e)]||_0x555d20(0x16b),'window':undefined});}_0x50c31f[_0x555d20(0x257)]((_0xd2e9f1,_0x2b8a28)=>{const _0x34ed37=_0x555d20;if(!_0xd2e9f1[_0x34ed37(0x1f5)])return 0x1;if(!_0x2b8a28['window'])return-0x1;return _0xd2e9f1[_0x34ed37(0x1f5)][_0x34ed37(0x2ab)]-_0x2b8a28[_0x34ed37(0x1f5)][_0x34ed37(0x2ab)];});const _0x2a6485=_0x50c31f[_0x555d20(0x1e6)],_0x26de87=_0x2a6485>TIMELINE_CONFIG[_0x555d20(0x21c)];_0x26de87&&_0x50c31f[_0x555d20(0x273)](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x4c36fa=calculateTimeScale(_0x55a8a2,_0x83b605),_0x308240=_0x22005a['done']?_0x22005a[_0x555d20(0x142)]?a59_0xc31aad[_0x555d20(0x118)]('success'):a59_0xc31aad[_0x555d20(0x209)](_0x555d20(0x10b)):a59_0xc31aad[_0x555d20(0x146)](_0x555d20(0x1ad)),_0x247820=_0x22005a[_0x555d20(0xec)]?.['id'],_0x3e07ac=_0x22005a[_0x555d20(0x165)];let _0x58d30c;if(_0x247820&&_0x3e07ac){const _0x530ccb=getWorkflowAttemptUrl(_0x502bf0,_0x247820,_0x3e07ac,_0x22005a['id']);_0x58d30c=hyperlink(a59_0xc31aad[_0x555d20(0x1e5)](_0x22005a['id']),_0x530ccb);}else _0x58d30c=a59_0xc31aad[_0x555d20(0x1e5)](_0x22005a['id']);_0x1d98b9[_0x555d20(0x260)](_0x555d20(0x249)+_0x58d30c+'\x20-\x20'+_0x308240+_0x555d20(0x1ee)+formatElapsed(_0x55a8a2['duration']));if(_0x50c31f[_0x555d20(0x1e6)]>0x0){const _0x56f286=renderTimeAxis(_0x4c36fa,_0x83b605),_0x5e9694=new Date(_0x55a8a2[_0x555d20(0x2ab)]),_0x1b2abb=formatDate(_0x5e9694),_0x28e26c=TIMELINE_CONFIG[_0x555d20(0x18c)]+TIMELINE_CONFIG[_0x555d20(0x133)]+_0x3a2c62,_0x2382b3=_0x1b2abb['padStart'](_0x28e26c),_0xadd105=a59_0xc31aad[_0x555d20(0x1e5)](_0x2382b3);_0x1d98b9[_0x555d20(0x260)](_0xadd105+'\x20'+_0x56f286);for(const _0x331796 of _0x50c31f){_0x1d98b9['push'](renderTaskRow(_0x331796,_0x4c36fa,_0x83b605,_0x3a2c62));}const _0x9bb2b6=calculateStats(_0x50c31f);_0x1d98b9[_0x555d20(0x260)](formatStats(_0x9bb2b6)),_0x26de87&&_0x1d98b9['push'](a59_0xc31aad[_0x555d20(0x1a2)](_0x555d20(0x248)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x555d20(0x104)+_0x2a6485+_0x555d20(0x19a))),_0x1d98b9[_0x555d20(0x260)](''),_0x1d98b9[_0x555d20(0x260)](a59_0xc31aad[_0x555d20(0x1e5)](_0x555d20(0x23b))+(_0x555d20(0x297)+_0x22005a['id']+'\x20logs')+a59_0xc31aad[_0x555d20(0x1e5)]('\x20to\x20see\x20detailed\x20logs'));}else _0x1d98b9[_0x555d20(0x260)](_0x555d20(0x22e));return _0x1d98b9[_0x555d20(0x140)]('\x0a');}[a59_0x5f4ff5(0x218)](_0x22ac16,_0x24c123){const _0x4f0ac1=a59_0x5f4ff5,_0x2df42c=new Date(_0x22ac16['createdAt'])[_0x4f0ac1(0x1d2)](),_0x3985a0=_0x22ac16['finishedAt']?new Date(_0x22ac16[_0x4f0ac1(0x1a6)])[_0x4f0ac1(0x1d2)]():Date[_0x4f0ac1(0x1da)](),_0x50a349=_0x3985a0-_0x2df42c,_0x24d768=[];for(const _0x25fac9 of _0x24c123){if(_0x25fac9[_0x4f0ac1(0x272)]){const _0x3cf536=new Date(_0x25fac9[_0x4f0ac1(0x272)])['getTime'](),_0x40140f=_0x25fac9[_0x4f0ac1(0x173)]?new Date(_0x25fac9['updatedAt'])[_0x4f0ac1(0x1d2)]():Date['now']();_0x24d768[_0x4f0ac1(0x260)]({'name':_0x25fac9[_0x4f0ac1(0x1a4)],'state':_0x25fac9['state']||_0x4f0ac1(0x154),'window':{'start':_0x3cf536,'end':_0x40140f,'duration':_0x40140f-_0x3cf536}});}else _0x24d768[_0x4f0ac1(0x260)]({'name':_0x25fac9[_0x4f0ac1(0x1a4)],'state':_0x25fac9[_0x4f0ac1(0x17e)]||'planned','window':undefined});}const _0x59ae44=calculateStats(_0x24d768);return{'attempt':{'id':_0x22ac16['id'],'status':_0x22ac16[_0x4f0ac1(0xda)]?_0x22ac16[_0x4f0ac1(0x142)]?_0x4f0ac1(0x142):'error':_0x4f0ac1(0x1ad),'createdAt':_0x22ac16[_0x4f0ac1(0x210)],'finishedAt':_0x22ac16['finishedAt'],'duration_ms':_0x50a349},'tasks':_0x24d768[_0x4f0ac1(0xe1)](_0x593b4d=>({'name':_0x593b4d[_0x4f0ac1(0x282)],'state':_0x593b4d[_0x4f0ac1(0x17e)],'startedAt':_0x593b4d['window']?new Date(_0x593b4d[_0x4f0ac1(0x1f5)]['start'])[_0x4f0ac1(0x1a7)]():null,'updatedAt':_0x593b4d[_0x4f0ac1(0x1f5)]?new Date(_0x593b4d[_0x4f0ac1(0x1f5)][_0x4f0ac1(0x2a4)])[_0x4f0ac1(0x1a7)]():null,'duration_ms':_0x593b4d['window']?.[_0x4f0ac1(0x1c0)]||null})),'stats':_0x59ae44};}}function formatScheduleLine(_0x4a7c81){const _0x385e66=a59_0x5f4ff5,_0x58f09d=_0x4a7c81['disabledAt']?a59_0xc31aad['yellow'](_0x385e66(0x239)):'',_0x313d0a=_0x4a7c81[_0x385e66(0xec)]?.['name']?a59_0xc31aad['dim']('\x20['+_0x4a7c81['project'][_0x385e66(0x282)]+']'):'',_0x14aaa6=_0x4a7c81[_0x385e66(0x21f)]?a59_0xc31aad['dim'](_0x385e66(0x1ef)+new Date(_0x4a7c81[_0x385e66(0x21f)])[_0x385e66(0x131)]()):'';return _0x385e66(0x2a6)+_0x4a7c81['id']+'\x20'+(_0x4a7c81[_0x385e66(0x202)]?.[_0x385e66(0x282)]||'(unknown)')+_0x313d0a+_0x58f09d+_0x14aaa6;}export class WorkflowSchedulesCommand extends WorkflowBaseCommand{['name']='workflow:schedules';[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0x123);async[a59_0x5f4ff5(0x12a)](_0x4adc1b){const _0x3cbbbf=a59_0x5f4ff5,{options:_0x54e4e0,args:_0x3b58a8,tdx:_0x37e30f}=_0x4adc1b,{scheduleId:_0x5cf54d}=_0x54e4e0;if(_0x5cf54d&&_0x3b58a8[0x0])return console[_0x3cbbbf(0x10b)](a59_0xc31aad[_0x3cbbbf(0x209)]('Error:'),_0x3cbbbf(0x217)),console[_0x3cbbbf(0x10b)](a59_0xc31aad['dim'](_0x3cbbbf(0x15e))),0x1;if(_0x5cf54d){const _0x1b3743=await withSpinner(_0x3cbbbf(0x230)+_0x5cf54d+_0x3cbbbf(0x1ce),()=>_0x37e30f[_0x3cbbbf(0x202)][_0x3cbbbf(0x1e9)](_0x5cf54d),{'verbose':_0x54e4e0[_0x3cbbbf(0x269)]}),_0x35b24d=_0x1b3743[_0x3cbbbf(0x186)];return isStructuredFormat(_0x54e4e0)?await handleSingleObjectOutput(_0x35b24d,_0x54e4e0):(console['error']('✔\x20Schedule\x20found'),console['log'](formatScheduleLine(_0x35b24d))),0x0;}const _0x3cd11a=this[_0x3cbbbf(0x27d)](_0x3b58a8,_0x54e4e0);if(!_0x3cd11a)return 0x1;const {projectName:_0x22ac33,workflowName:_0x5f4dc1}=_0x3cd11a,_0x23c252=_0x22ac33?'\x27'+_0x22ac33+(_0x5f4dc1?'.'+_0x5f4dc1:'')+'\x27':undefined,_0x142f44=await withSpinner(_0x23c252?_0x3cbbbf(0x14f)+_0x23c252+_0x3cbbbf(0x1ce):_0x3cbbbf(0x108),()=>_0x22ac33?_0x37e30f['workflow'][_0x3cbbbf(0x201)](_0x22ac33,{'workflow':_0x5f4dc1,'limit':_0x54e4e0[_0x3cbbbf(0x156)]}):_0x37e30f['workflow'][_0x3cbbbf(0x20a)]({'limit':_0x54e4e0['limit']}),{'verbose':_0x54e4e0['verbose']}),_0x1cb997=_0x142f44[_0x3cbbbf(0x186)],_0x4c2b3c=_0x54e4e0[_0x3cbbbf(0x156)]&&_0x1cb997[_0x3cbbbf(0x1e6)]>=_0x54e4e0[_0x3cbbbf(0x156)]?a59_0xc31aad[_0x3cbbbf(0x1e5)](_0x3cbbbf(0x139)):'';console[_0x3cbbbf(0x10b)](_0x3cbbbf(0x267)+_0x1cb997['length']+_0x3cbbbf(0x256)+(_0x1cb997[_0x3cbbbf(0x1e6)]!==0x1?'s':'')+_0x4c2b3c);if(isStructuredFormat(_0x54e4e0))await handleSDKOutput(_0x1cb997,_0x54e4e0);else{if(_0x1cb997[_0x3cbbbf(0x1e6)]===0x0)console[_0x3cbbbf(0x16c)]('No\x20schedules\x20found');else for(const _0x1ec5e3 of _0x1cb997){console[_0x3cbbbf(0x16c)](formatScheduleLine(_0x1ec5e3));}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{['name']=a59_0x5f4ff5(0x18d);['description']=a59_0x5f4ff5(0x189);async[a59_0x5f4ff5(0x12a)](_0x4951c){const _0x3dfd41=a59_0x5f4ff5,{options:_0x1a86de,args:_0xe7ee83,tdx:_0x57bce7}=_0x4951c,_0x19de2b=_0xe7ee83[0x0];if(!_0x19de2b)return console[_0x3dfd41(0x10b)](a59_0xc31aad[_0x3dfd41(0x209)](_0x3dfd41(0x229)),_0x3dfd41(0x1f4)),console[_0x3dfd41(0x10b)](a59_0xc31aad[_0x3dfd41(0x1e5)]('Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>')),console[_0x3dfd41(0x10b)](a59_0xc31aad[_0x3dfd41(0x1e5)](_0x3dfd41(0x1e8))),0x1;const {backfill:_0x2ed280,nextTime:_0x455b63}=_0x1a86de,_0x34ac99={};if(_0x2ed280!==undefined)_0x34ac99[_0x3dfd41(0x1dc)]=!_0x2ed280;if(_0x455b63!==undefined)_0x34ac99[_0x3dfd41(0x23f)]=_0x455b63;const _0x3d3f6a=await withSpinner(_0x3dfd41(0x145)+_0x19de2b+_0x3dfd41(0x1ce),()=>_0x57bce7[_0x3dfd41(0x202)][_0x3dfd41(0x1d0)](_0x19de2b,_0x34ac99),{'verbose':_0x1a86de[_0x3dfd41(0x269)]}),_0x40f6f1=_0x3d3f6a['data'];return isStructuredFormat(_0x1a86de)?await handleSingleObjectOutput(_0x40f6f1,_0x1a86de):(console[_0x3dfd41(0x16c)](_0x3dfd41(0x28f)+_0x19de2b+_0x3dfd41(0x187)+(_0x40f6f1[_0x3dfd41(0x202)]?.[_0x3dfd41(0x282)]||_0x3dfd41(0x154))+')'),_0x40f6f1['nextRunTime']&&console[_0x3dfd41(0x16c)](a59_0xc31aad[_0x3dfd41(0x1e5)]('\x20\x20Next\x20run:\x20'+new Date(_0x40f6f1[_0x3dfd41(0x21f)])[_0x3dfd41(0x131)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a59_0x5f4ff5(0x282)]='workflow:schedule:disable';[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0x137);async['execute'](_0x57b743){const _0x520d7f=a59_0x5f4ff5,{options:_0x3902f2,args:_0x8cdeb1,tdx:_0x82a7b9}=_0x57b743,_0xbfe409=_0x8cdeb1[0x0];if(!_0xbfe409)return console[_0x520d7f(0x10b)](a59_0xc31aad[_0x520d7f(0x209)](_0x520d7f(0x229)),'Schedule\x20ID\x20is\x20required'),console[_0x520d7f(0x10b)](a59_0xc31aad[_0x520d7f(0x1e5)](_0x520d7f(0x150))),console['error'](a59_0xc31aad['dim'](_0x520d7f(0x1e8))),0x1;const _0x514324=await withSpinner(_0x520d7f(0x174)+_0xbfe409+_0x520d7f(0x1ce),()=>_0x82a7b9[_0x520d7f(0x202)][_0x520d7f(0x1b8)](_0xbfe409),{'verbose':_0x3902f2[_0x520d7f(0x269)]}),_0x3ca560=_0x514324['data'];return isStructuredFormat(_0x3902f2)?await handleSingleObjectOutput(_0x3ca560,_0x3902f2):console['log'](_0x520d7f(0x28f)+_0xbfe409+_0x520d7f(0x247)+(_0x3ca560[_0x520d7f(0x202)]?.[_0x520d7f(0x282)]||_0x520d7f(0x154))+')'),0x0;}}
|
|
1
|
+
const a59_0x69291=a59_0x2c40;(function(_0x3104cd,_0x18a381){const _0x416807=a59_0x2c40,_0x244bc0=_0x3104cd();while(!![]){try{const _0x3d9900=-parseInt(_0x416807(0x28c))/0x1+-parseInt(_0x416807(0x14c))/0x2*(parseInt(_0x416807(0x2e8))/0x3)+parseInt(_0x416807(0x22d))/0x4+parseInt(_0x416807(0x252))/0x5*(parseInt(_0x416807(0x1b4))/0x6)+parseInt(_0x416807(0x219))/0x7+parseInt(_0x416807(0x291))/0x8+parseInt(_0x416807(0x17c))/0x9*(-parseInt(_0x416807(0x299))/0xa);if(_0x3d9900===_0x18a381)break;else _0x244bc0['push'](_0x244bc0['shift']());}catch(_0x10cd94){_0x244bc0['push'](_0x244bc0['shift']());}}}(a59_0x5020,0x7a173));import a59_0x34c7bd from'chalk';import{existsSync}from'fs';import a59_0x28ffa6 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import{parseTaskGraph,formatTaskGraph,summarizeTaskGraph,formatWarningSummary}from'../sdk/workflow/task-graph.js';import a59_0x3da1fb from'prompts';function getAttemptStatusDisplay(_0x3eb3d8){const _0x1feb40=a59_0x2c40;if(!_0x3eb3d8)return{'icon':'⏳','text':''};const {done:_0x438da3,success:_0x2d8a42,cancelRequested:_0x5a232e}=_0x3eb3d8;if(!_0x438da3)return _0x5a232e?{'icon':'🛑','text':a59_0x34c7bd[_0x1feb40(0x196)](_0x1feb40(0x173))}:{'icon':'🔄','text':a59_0x34c7bd[_0x1feb40(0x269)](_0x1feb40(0x152))};if(_0x2d8a42)return{'icon':'✅','text':a59_0x34c7bd[_0x1feb40(0x2d5)](_0x1feb40(0x210))};return{'icon':'❌','text':a59_0x34c7bd['red'](_0x1feb40(0x274))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x24db61,_0x715640,_0x4218c8=0x0){return _0x24db61[_0x4218c8]||_0x715640['workflowProject'];}[a59_0x69291(0x1ee)](_0x48911c,_0x327868,_0x3e3d55=0x0){const _0x193590=a59_0x69291,_0x3be884=this[_0x193590(0x1f1)](_0x48911c,_0x327868,_0x3e3d55);if(!_0x3be884)return console['error'](a59_0x34c7bd[_0x193590(0x2f8)](_0x193590(0x287)),'Project\x20name\x20is\x20required'),console[_0x193590(0x274)](a59_0x34c7bd[_0x193590(0x27d)](_0x193590(0x298))),null;return _0x3be884;}[a59_0x69291(0x1a5)](_0x4db037,_0x250812){const _0x57f768=a59_0x69291;if(_0x4db037[0x0]){const _0x1814bc=_0x4db037[0x0][_0x57f768(0x1cc)]('.');if(_0x1814bc[_0x57f768(0x204)]===0x1)return{'projectName':_0x1814bc[0x0],'workflowName':undefined};else return _0x1814bc[_0x57f768(0x204)]===0x2?{'projectName':_0x1814bc[0x0],'workflowName':_0x1814bc[0x1]}:(console[_0x57f768(0x274)](a59_0x34c7bd[_0x57f768(0x2f8)](_0x57f768(0x287)),_0x57f768(0x238)),null);}return{'projectName':_0x250812[_0x57f768(0x19c)],'workflowName':undefined};}['resolveProjectDir'](_0x340960,_0x23dc02,_0x1c1123=0x0){const _0x123f77=a59_0x69291;if(_0x340960[_0x1c1123])return _0x340960[_0x1c1123];if(_0x23dc02[_0x123f77(0x19c)]){const _0x43528a=a59_0x28ffa6['join'](process[_0x123f77(0x2e3)](),_0x123f77(0x1cb),_0x23dc02['workflowProject']);if(existsSync(a59_0x28ffa6['join'](_0x43528a,_0x123f77(0x1cd))))return _0x43528a;}return undefined;}async[a59_0x69291(0x264)](_0x365bf0,_0x5ae966,_0x529c66){const _0x1eb6a0=a59_0x69291;try{const _0x2dde83=await _0x365bf0[_0x1eb6a0(0x19a)][_0x1eb6a0(0x1cb)](_0x5ae966,{'limit':0x1});if(_0x2dde83[_0x1eb6a0(0x204)]>0x0){const _0x57ea28=_0x2dde83[0x0]['id'],_0x262a3b=getWorkflowUrl(_0x529c66,_0x57ea28);console['error'](_0x1eb6a0(0x13d)+a59_0x34c7bd[_0x1eb6a0(0x251)](_0x262a3b));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a59_0x69291(0x1c9);[a59_0x69291(0x134)]=a59_0x69291(0x22a);async[a59_0x69291(0x2fa)](_0x5416fd){const _0x1f0993=a59_0x69291,{options:_0x5b346c,args:_0x370638,tdx:_0x53c14b}=_0x5416fd,_0x52ee43=_0x370638[0x0],_0x2f6443=_0x5b346c[_0x1f0993(0x2ba)];if(_0x2f6443)return saveSessionContext({'workflow_project':undefined},_0x5b346c['session']),console[_0x1f0993(0x296)](a59_0x34c7bd[_0x1f0993(0x2d5)](_0x1f0993(0x22c))),0x0;if(!_0x52ee43)return console[_0x1f0993(0x274)](a59_0x34c7bd['red']('Error:'),_0x1f0993(0x2be)),console[_0x1f0993(0x274)](a59_0x34c7bd[_0x1f0993(0x27d)](_0x1f0993(0x14a))),console[_0x1f0993(0x274)](a59_0x34c7bd[_0x1f0993(0x27d)](_0x1f0993(0x16e))),0x1;const _0x3865a1=await withSpinner(_0x1f0993(0x1da)+_0x52ee43+'\x27...',()=>_0x53c14b[_0x1f0993(0x19a)][_0x1f0993(0x1ec)](_0x52ee43),{'verbose':_0x5b346c['verbose']}),{name:_0x448fa8}=_0x3865a1[_0x1f0993(0x162)];return saveSessionContext({'workflow_project':_0x448fa8},_0x5b346c['session']),console[_0x1f0993(0x296)](a59_0x34c7bd[_0x1f0993(0x2d5)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a59_0x34c7bd[_0x1f0993(0x251)](_0x448fa8))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a59_0x69291(0x297);[a59_0x69291(0x134)]='List\x20all\x20workflow\x20projects';async[a59_0x69291(0x2fa)](_0x1f9dcc){const _0x1309c7=a59_0x69291,{options:_0x31a5d4,args:_0x174f5b,tdx:_0x4639bc}=_0x1f9dcc,_0x3bcd8e=_0x174f5b[0x0];_0x31a5d4[_0x1309c7(0x151)]&&_0x3bcd8e&&console[_0x1309c7(0x274)]('Pattern:\x20'+_0x3bcd8e);const _0x28a4a4=await withSpinner(_0x1309c7(0x20d),()=>_0x4639bc[_0x1309c7(0x19a)]['projects'](_0x3bcd8e,{'limit':_0x31a5d4['limit']}),{'verbose':_0x31a5d4[_0x1309c7(0x151)]});let _0x3120a9=_0x28a4a4[_0x1309c7(0x162)];_0x3120a9[_0x1309c7(0x279)]((_0x2687b3,_0x20dc46)=>_0x2687b3[_0x1309c7(0x268)][_0x1309c7(0x286)](_0x20dc46['name']));const _0x1e6c2d=_0x31a5d4[_0x1309c7(0x2db)]&&_0x3120a9[_0x1309c7(0x204)]>=_0x31a5d4[_0x1309c7(0x2db)]?a59_0x34c7bd['dim'](_0x1309c7(0x188)):'';console['error']('✔\x20Found\x20'+_0x3120a9['length']+_0x1309c7(0x24d)+(_0x3120a9[_0x1309c7(0x204)]!==0x1?'s':'')+_0x1e6c2d);if(_0x31a5d4[_0x1309c7(0x2ad)]==='json'||_0x31a5d4['format']===_0x1309c7(0x1d8)||_0x31a5d4[_0x1309c7(0x2ad)]===_0x1309c7(0x1dd))await handleSDKOutput(_0x3120a9,_0x31a5d4);else{if(_0x3120a9[_0x1309c7(0x204)]===0x0)_0x3bcd8e?console['log'](_0x1309c7(0x141)+_0x3bcd8e):console[_0x1309c7(0x296)]('No\x20workflow\x20projects\x20found');else{const _0x5ae2a2=_0x3120a9[_0x1309c7(0x1b8)](_0x2f0d6f=>{const _0x2c517a=_0x1309c7,_0x373cf8=_0x2f0d6f[_0x2c517a(0x1b6)]?.[_0x2c517a(0x2ef)](_0x3d6ecd=>_0x3d6ecd[_0x2c517a(0x243)]===_0x2c517a(0x1d7)),_0x4a39d7=_0x373cf8?a59_0x34c7bd['dim'](_0x2c517a(0x167)):'';return'📁\x20'+_0x2f0d6f[_0x2c517a(0x268)]+_0x4a39d7;});await writeOutput(_0x5ae2a2[_0x1309c7(0x19d)]('\x0a'),_0x31a5d4[_0x1309c7(0x207)],_0x1309c7(0x2e9));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x256);[a59_0x69291(0x134)]=a59_0x69291(0x174);async[a59_0x69291(0x2fa)](_0x30ed41){const _0x56d6d9=a59_0x69291,{options:_0x17b559,args:_0x18b873,tdx:_0x506afe}=_0x30ed41,_0x397af7=this[_0x56d6d9(0x1f1)](_0x18b873,_0x17b559);_0x17b559[_0x56d6d9(0x151)]&&_0x397af7&&console[_0x56d6d9(0x274)]('Project\x20filter:\x20'+_0x397af7);const _0x1eb321=await withSpinner(_0x56d6d9(0x2ea),()=>_0x506afe[_0x56d6d9(0x19a)][_0x56d6d9(0x1cb)](_0x397af7,{'limit':_0x17b559[_0x56d6d9(0x2db)]}),{'verbose':_0x17b559['verbose']});let _0x717b58=_0x1eb321['data'];_0x717b58[_0x56d6d9(0x279)]((_0x3abe2d,_0xed1127)=>{const _0x157c98=_0x56d6d9,_0x4f4952=_0x3abe2d[_0x157c98(0x268)][_0x157c98(0x286)](_0xed1127[_0x157c98(0x268)]);if(_0x4f4952!==0x0)return _0x4f4952;return(_0x3abe2d['project']?.[_0x157c98(0x268)]||'')[_0x157c98(0x286)](_0xed1127['project']?.[_0x157c98(0x268)]||'');});const _0x67d008=_0x17b559['limit']&&_0x717b58['length']>=_0x17b559['limit']?a59_0x34c7bd[_0x56d6d9(0x27d)](_0x56d6d9(0x188)):'';console['error'](_0x56d6d9(0x164)+_0x717b58[_0x56d6d9(0x204)]+_0x56d6d9(0x236)+(_0x717b58[_0x56d6d9(0x204)]!==0x1?'s':'')+_0x67d008);if(_0x17b559[_0x56d6d9(0x2ad)]==='json'||_0x17b559['format']==='jsonl'||_0x17b559[_0x56d6d9(0x2ad)]==='table')await handleSDKOutput(_0x717b58,_0x17b559);else{if(_0x717b58[_0x56d6d9(0x204)]===0x0)_0x397af7?console[_0x56d6d9(0x296)](_0x56d6d9(0x227)+_0x397af7):console['log'](_0x56d6d9(0x282));else{const _0x4f7656=_0x17b559[_0x56d6d9(0x2bf)],_0x37c601=_0x717b58[_0x56d6d9(0x1b8)](_0x14bde4=>{const _0xd216f6=_0x56d6d9,_0x1bd1f3=a59_0x34c7bd[_0xd216f6(0x27d)]('#'+_0x14bde4['id']),_0x2ff341=hyperlink(_0x1bd1f3,getWorkflowUrl(_0x4f7656,_0x14bde4['id'])),_0x51ec44=_0x14bde4['project']?.[_0xd216f6(0x268)]?a59_0x34c7bd[_0xd216f6(0x27d)]('\x20('+_0x14bde4['project']['name']+')'):'';return _0xd216f6(0x224)+_0x2ff341+'\x20'+_0x14bde4[_0xd216f6(0x268)]+_0x51ec44;});await writeOutput(_0x37c601[_0x56d6d9(0x19d)]('\x0a'),_0x17b559[_0x56d6d9(0x207)],_0x56d6d9(0x2e9));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]='workflow:sessions';[a59_0x69291(0x134)]=a59_0x69291(0x1d6);async[a59_0x69291(0x2fa)](_0x120fb7){const _0x4eb721=a59_0x69291,{options:_0x6403d9,args:_0x7591b7,tdx:_0x3282c8}=_0x120fb7,_0xa85f02=this[_0x4eb721(0x1a5)](_0x7591b7,_0x6403d9);if(!_0xa85f02)return 0x1;const {projectName:_0x4270d6,workflowName:_0x18c642}=_0xa85f02;if(_0x6403d9[_0x4eb721(0x151)]){if(_0x4270d6&&_0x18c642)console[_0x4eb721(0x274)](_0x4eb721(0x21a)+_0x4270d6+'.'+_0x18c642);else _0x4270d6&&console[_0x4eb721(0x274)](_0x4eb721(0x161)+_0x4270d6);const _0x3bc565=_0x6403d9[_0x4eb721(0x21f)];_0x3bc565&&console[_0x4eb721(0x274)](_0x4eb721(0x137)+_0x3bc565);}let _0x34b544=0x28;if(process[_0x4eb721(0x2a5)][_0x4eb721(0x206)]&&!_0x6403d9[_0x4eb721(0x207)]&&!_0x6403d9['format']){const _0x28dfe6=process[_0x4eb721(0x2a5)][_0x4eb721(0x2a8)]||0x28;_0x34b544=Math[_0x4eb721(0x14f)](0x14,Math[_0x4eb721(0x2c1)](_0x28dfe6*0x2/0x3));}const _0xa7b779=_0x6403d9['limit']||_0x34b544,_0x247d09=await withSpinner(_0x4eb721(0x17b),()=>_0x3282c8['workflow']['sessions']({'projectName':_0x4270d6,'workflowName':_0x18c642,'status':_0x6403d9[_0x4eb721(0x21f)],'fromTime':_0x6403d9[_0x4eb721(0x2de)],'toTime':_0x6403d9['to'],'limit':_0xa7b779}),{'verbose':_0x6403d9['verbose']}),_0x419f0b=_0x247d09[_0x4eb721(0x162)];_0x419f0b['sort']((_0xa1b5aa,_0x15db41)=>{const _0x1fe3f2=_0x4eb721,_0x31f7d4=_0xa1b5aa[_0x1fe3f2(0x155)]||'',_0x384003=_0x15db41[_0x1fe3f2(0x155)]||'';return _0x384003['localeCompare'](_0x31f7d4);});_0x419f0b['length']>=_0xa7b779?console['error']('✔\x20Showing\x20'+_0x419f0b[_0x4eb721(0x204)]+_0x4eb721(0x2bc)+a59_0x34c7bd[_0x4eb721(0x27d)](_0x4eb721(0x2e1))):console['error'](_0x4eb721(0x164)+_0x419f0b['length']+_0x4eb721(0x21d)+(_0x419f0b[_0x4eb721(0x204)]!==0x1?'s':''));if(_0x6403d9[_0x4eb721(0x2ad)]===_0x4eb721(0x18b)||_0x6403d9[_0x4eb721(0x2ad)]===_0x4eb721(0x1d8)||_0x6403d9['format']==='table')await handleSDKOutput(_0x419f0b,_0x6403d9);else{if(!process['stdout'][_0x4eb721(0x206)]||_0x6403d9[_0x4eb721(0x207)]){if(_0x419f0b[_0x4eb721(0x204)]===0x0){if(_0x4270d6&&_0x18c642)console['log'](_0x4eb721(0x2ce)+_0x4270d6+'.'+_0x18c642);else _0x4270d6?console['log'](_0x4eb721(0x23c)+_0x4270d6):console[_0x4eb721(0x296)](_0x4eb721(0x190));}else{const _0x4dae33=_0x6403d9[_0x4eb721(0x2bf)],_0x556b2c=this['renderSessionsTimeline'](_0x419f0b,_0x4dae33);_0x6403d9['output']?await writeOutput(_0x556b2c,_0x6403d9['output'],_0x4eb721(0x2e9)):console[_0x4eb721(0x296)](_0x556b2c);}!_0x4270d6&&(console['error'](''),console['error'](a59_0x34c7bd[_0x4eb721(0x27d)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x4eb721(0x274)](a59_0x34c7bd[_0x4eb721(0x27d)](_0x4eb721(0x1ac))+'or'+a59_0x34c7bd[_0x4eb721(0x27d)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x419f0b[_0x4eb721(0x204)]===0x0){if(_0x4270d6&&_0x18c642)console[_0x4eb721(0x296)](_0x4eb721(0x2ce)+_0x4270d6+'.'+_0x18c642);else _0x4270d6?console[_0x4eb721(0x296)](_0x4eb721(0x23c)+_0x4270d6):console[_0x4eb721(0x296)](_0x4eb721(0x190));}else await this[_0x4eb721(0x149)](_0x419f0b,_0x120fb7,_0x4270d6);}}return 0x0;}[a59_0x69291(0x1d9)](_0x12ed45,_0x52dbd8){const _0x7c8158=a59_0x69291,_0x5867e0=[],_0x5cab20=new Map();let _0x2a0012=Infinity,_0x531f0e=-Infinity;for(const _0x1333a1 of _0x12ed45){if(_0x1333a1[_0x7c8158(0x29f)]?.[_0x7c8158(0x1f8)]){const _0x22b382=new Date(_0x1333a1['lastAttempt']['createdAt'])['getTime'](),_0x54f409=_0x1333a1[_0x7c8158(0x29f)][_0x7c8158(0x265)]?new Date(_0x1333a1['lastAttempt'][_0x7c8158(0x265)])[_0x7c8158(0x1b3)]():Date[_0x7c8158(0x14d)](),_0x44fb4f=_0x1333a1[_0x7c8158(0x235)]?.[_0x7c8158(0x268)]||_0x7c8158(0x159);!_0x5cab20[_0x7c8158(0x230)](_0x44fb4f)&&_0x5cab20['set'](_0x44fb4f,[]),_0x5cab20[_0x7c8158(0x248)](_0x44fb4f)['push']({'session':_0x1333a1,'startTime':_0x22b382,'endTime':_0x54f409,'duration':_0x54f409-_0x22b382}),_0x2a0012=Math[_0x7c8158(0x1f9)](_0x2a0012,_0x22b382),_0x531f0e=Math[_0x7c8158(0x14f)](_0x531f0e,_0x54f409);}}if(_0x5cab20[_0x7c8158(0x2dd)]===0x0)return _0x7c8158(0x304);const _0x4f6199=process[_0x7c8158(0x2a5)][_0x7c8158(0x1b9)]||0x78,_0x26b7a9=0x1e,_0x4dfe15=0x32,_0x21ed27=0x4,_0x1e7a6b=Math[_0x7c8158(0x1f9)](_0x4dfe15,Math['max'](_0x26b7a9,Math[_0x7c8158(0x2c1)](_0x4f6199*0.3))),_0x2848f5=_0x4f6199-_0x1e7a6b-TIMELINE_CONFIG['GUTTER']-0x3-_0x21ed27,_0x14e8ce=_0x531f0e-_0x2a0012,_0x4234d1=_0x14e8ce/_0x1e7a6b,_0x65de8a=renderTimeAxis({'startTime':_0x2a0012,'endTime':_0x531f0e,'durationMs':_0x14e8ce,'msPerChar':_0x4234d1},_0x1e7a6b),_0x1492fe=[];for(const _0x33b781 of _0x5cab20[_0x7c8158(0x2eb)]()){_0x1492fe[_0x7c8158(0x2ec)](..._0x33b781);}_0x1492fe[_0x7c8158(0x279)]((_0x4523d9,_0x1f6554)=>_0x1f6554[_0x7c8158(0x153)]-_0x4523d9[_0x7c8158(0x153)]);const _0x338460=new Date(_0x2a0012),_0x5161f1=formatDate(_0x338460),_0x3ef842=_0x21ed27+TIMELINE_CONFIG[_0x7c8158(0x2fd)]+TIMELINE_CONFIG['ICON_SPACING']+_0x2848f5,_0x34b763='\x20'['repeat'](_0x3ef842-_0x5161f1[_0x7c8158(0x204)]),_0x2bf568=_0x34b763+a59_0x34c7bd['dim'](_0x5161f1)+'\x20'+_0x65de8a;_0x5867e0[_0x7c8158(0x2ec)](_0x2bf568);const _0x238aed=0x16;let _0x61af2c=0x0;for(const _0x4c4d2b of _0x1492fe){const _0xe9c4e2=_0x4c4d2b[_0x7c8158(0x28a)]['project']?.[_0x7c8158(0x268)]||'?',_0x497d34=Math[_0x7c8158(0x1f9)](stringWidth(_0xe9c4e2),_0x238aed);_0x61af2c=Math['max'](_0x61af2c,_0x497d34);}for(const _0x426fa7 of _0x1492fe){const {session:_0x5ac445,startTime:_0x1e5361,endTime:_0x21afce,duration:_0x3a6b13}=_0x426fa7,_0x5b98a6=_0x5ac445[_0x7c8158(0x235)]?.['id'],_0x23e355=_0x5ac445['id'],_0x22176b=_0x5ac445[_0x7c8158(0x235)]?.['name']||'?',_0x4c4ba0=_0x5ac445[_0x7c8158(0x19a)]?.['name']||'?';let _0x186c2d,_0x3af3ae;if(_0x5ac445[_0x7c8158(0x29f)]){const _0x5256f0=_0x5ac445[_0x7c8158(0x29f)];!_0x5256f0[_0x7c8158(0x28b)]?(_0x186c2d=_0x5256f0[_0x7c8158(0x266)]?'🛑':'🔄',_0x3af3ae=_0x5256f0[_0x7c8158(0x266)]?a59_0x34c7bd[_0x7c8158(0x196)]:a59_0x34c7bd['blue']):(_0x186c2d=_0x5256f0['success']?'✅':'❌',_0x3af3ae=_0x5256f0[_0x7c8158(0x210)]?a59_0x34c7bd[_0x7c8158(0x2d5)]:a59_0x34c7bd['red']);}else _0x186c2d='⏳',_0x3af3ae=a59_0x34c7bd[_0x7c8158(0x27d)];const _0x2ae64b='#'+_0x23e355,_0x2c7599=_0x5b98a6?hyperlink(_0x2ae64b,getWorkflowSessionUrl(_0x52dbd8,_0x5b98a6,_0x23e355)):_0x2ae64b;let _0x5f4bb3=_0x22176b;stringWidth(_0x22176b)>_0x238aed&&(_0x5f4bb3=_0x22176b[_0x7c8158(0x2ee)](0x0,_0x238aed-0x1)+'…');const _0x168494=a59_0x34c7bd[_0x7c8158(0x27d)](_0x5f4bb3),_0x4651cf=stringWidth(_0x5f4bb3),_0x57eb11='\x20'[_0x7c8158(0x181)](_0x61af2c-stringWidth(_0x5f4bb3)+0x2),_0x1171c4='('+formatElapsed(_0x3a6b13)+')',_0x3a1859=stringWidth(_0x1171c4),_0x246512=stringWidth(_0x2ae64b),_0x24f3db=_0x246512+0x1+_0x4651cf+_0x57eb11['length'],_0x2ea2fd=_0x2848f5-_0x24f3db-_0x3a1859-0x1-0x8;let _0x1350e9=_0x4c4ba0;stringWidth(_0x1350e9)>_0x2ea2fd&&(_0x1350e9=_0x1350e9[_0x7c8158(0x2ee)](0x0,_0x2ea2fd-0x1)+'…');const _0x551014=_0x2c7599+'\x20'+_0x168494+_0x57eb11+_0x1350e9,_0x5c1b3b=stringWidth(_0x551014),_0x28751b=_0x2848f5-_0x5c1b3b-_0x3a1859,_0x537ac7=_0x551014+'\x20'[_0x7c8158(0x181)](Math[_0x7c8158(0x14f)](0x1,_0x28751b))+a59_0x34c7bd[_0x7c8158(0x27d)](_0x1171c4),_0x45d8d2=Math[_0x7c8158(0x2c1)]((_0x1e5361-_0x2a0012)/_0x4234d1),_0xea4ea6=Math['floor']((_0x21afce-_0x2a0012)/_0x4234d1),_0x413d04=Math[_0x7c8158(0x14f)](_0x45d8d2+0x1,_0xea4ea6),_0x40f7b1=new Array(_0x1e7a6b)[_0x7c8158(0x1e6)]('\x20');for(let _0x16de9c=_0x45d8d2;_0x16de9c<Math['min'](_0x413d04,_0x1e7a6b);_0x16de9c++){_0x40f7b1[_0x16de9c]='─';}const _0x4658c2=_0x40f7b1[_0x7c8158(0x1b8)](_0x119083=>_0x119083==='\x20'?'\x20':_0x3af3ae(_0x119083))['join']('');_0x5867e0['push'](_0x186c2d+'\x20'+_0x537ac7+'│'+_0x4658c2+'│');}return _0x5867e0[_0x7c8158(0x19d)]('\x0a');}async[a59_0x69291(0x149)](_0x186196,_0x3a17d1,_0xfecb4f){const _0x115946=a59_0x69291,{options:_0x425f2a,tdx:_0x3e3c4c}=_0x3a17d1,_0x4ac038=_0x425f2a[_0x115946(0x2bf)],{timelineRows:_0x561775,timeAxisHeader:_0x2c25c3}=this[_0x115946(0x2f1)](_0x186196,_0x4ac038),_0x36b517=_0x561775[_0x115946(0x1b7)](_0x30d964=>_0x30d964[_0x115946(0x21b)]);if(_0x36b517[_0x115946(0x204)]===0x0){const _0x379473=this[_0x115946(0x1d9)](_0x186196,_0x4ac038);console[_0x115946(0x296)](_0x379473);!_0xfecb4f&&(console[_0x115946(0x274)](''),console['error'](a59_0x34c7bd[_0x115946(0x27d)](_0x115946(0x2c7))),console[_0x115946(0x274)](a59_0x34c7bd[_0x115946(0x27d)](_0x115946(0x1ac))+'or'+a59_0x34c7bd[_0x115946(0x27d)](_0x115946(0x2d9))));return;}_0x2c25c3&&console[_0x115946(0x296)](_0x2c25c3);const _0x54f1bc=_0x561775[_0x115946(0x1b7)](_0x11f85c=>_0x11f85c['attemptId'])[_0x115946(0x1b8)](_0x4cddf0=>({'title':_0x4cddf0[_0x115946(0x240)],'value':_0x4cddf0[_0x115946(0x21b)]})),_0x141118=process[_0x115946(0x2a5)][_0x115946(0x2a8)]||0x3c,_0x182ae0=Math[_0x115946(0x14f)](0x28,Math[_0x115946(0x2c1)](_0x141118*0x2/0x3)),_0x216bc2=await a59_0x3da1fb({'type':_0x115946(0x29a),'name':'attemptId','message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x54f1bc,'initial':-0x1,'limit':_0x182ae0,'clearFirst':!![],'fallback':{'title':_0x115946(0x26f),'value':null},'suggest':(_0x594b1f,_0x2df09b)=>{const _0x2ddd8f=_0x115946;if(!_0x594b1f)return Promise['resolve'](_0x2df09b);const _0x4ca5f3=_0x2df09b[_0x2ddd8f(0x1b7)](_0x78a9d2=>{const _0x4019d0=_0x2ddd8f,_0x24b646=_0x78a9d2;return _0x24b646[_0x4019d0(0x222)][_0x4019d0(0x231)]()[_0x4019d0(0x302)](_0x594b1f['toLowerCase']());});return Promise['resolve'](_0x4ca5f3);}}),_0x4f310a=()=>{const _0x204ea7=_0x115946;process[_0x204ea7(0x2a5)][_0x204ea7(0x29c)]('\x1b[1A\x1b[2K'),process[_0x204ea7(0x2a5)][_0x204ea7(0x29c)]('\x1b[1A\x1b[2K'),process[_0x204ea7(0x2a5)][_0x204ea7(0x29c)]('\x1b[1A\x1b[2K');},_0xd0db53=_0x216bc2&&_0x216bc2[_0x115946(0x21b)]&&_0x216bc2['attemptId']!==null&&_0x216bc2[_0x115946(0x21b)][_0x115946(0x202)]()!=='';if(!_0xd0db53){_0x4f310a(),console[_0x115946(0x296)](a59_0x34c7bd['dim'](_0x115946(0x292)));return;}_0x4f310a();const _0x4a876a=_0x186196[_0x115946(0x172)](_0x5a05b0=>_0x5a05b0[_0x115946(0x29f)]?.['id']===_0x216bc2[_0x115946(0x21b)]);if(_0x4a876a){const _0x2cb05d=_0x4a876a[_0x115946(0x235)]?.[_0x115946(0x268)]||'?',_0x3c6f0c=_0x4a876a[_0x115946(0x19a)]?.[_0x115946(0x268)]||'?';console['log']('Project:\x20'+a59_0x34c7bd[_0x115946(0x27d)](_0x2cb05d)+_0x115946(0x189)+a59_0x34c7bd['dim'](_0x3c6f0c));}const _0x28c75a=new WorkflowTimelineCommand();await _0x28c75a['execute']({'args':[],'options':{..._0x425f2a,'attemptId':_0x216bc2['attemptId']},'tdx':_0x3e3c4c});}[a59_0x69291(0x2f1)](_0x2469a4,_0x1e6965){const _0x44a4b4=a59_0x69291,_0x2c67cd=new Map();for(const _0x80f831 of _0x2469a4){_0x80f831['id']&&_0x80f831[_0x44a4b4(0x29f)]?.['id']&&_0x2c67cd[_0x44a4b4(0x1d0)](_0x80f831['id'],_0x80f831['lastAttempt']['id']);}const _0x5225be=[];let _0x46b889='';const _0x218815=this[_0x44a4b4(0x1d9)](_0x2469a4,_0x1e6965),_0x5512ae=_0x218815[_0x44a4b4(0x1cc)]('\x0a');for(const _0x420db3 of _0x5512ae){if(_0x420db3[_0x44a4b4(0x22e)](_0x44a4b4(0x1ff))||_0x420db3[_0x44a4b4(0x1f4)](/^\s+\d{4}-\d{2}-\d{2}/))_0x46b889=_0x420db3;else{if(_0x420db3[_0x44a4b4(0x1f4)](/^[✅❌🔄🛑⏳]/)){const _0x2879d1=_0x420db3[_0x44a4b4(0x1f4)](/#(\d+)/),_0xd5d4a0=_0x2879d1?_0x2879d1[0x1]:null,_0x1c4ff5=_0xd5d4a0?_0x2c67cd[_0x44a4b4(0x248)](_0xd5d4a0)||null:null,_0x377a4b=_0x2469a4['find'](_0x23903c=>_0x23903c['id']===_0xd5d4a0),_0x2114f6=_0x377a4b?.[_0x44a4b4(0x235)]?.[_0x44a4b4(0x268)]||'';_0x5225be[_0x44a4b4(0x2ec)]({'displayLine':_0x420db3,'attemptId':_0x1c4ff5,'projectName':_0x2114f6});}}}return{'timelineRows':_0x5225be,'timeAxisHeader':_0x46b889};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x1ad);[a59_0x69291(0x134)]=a59_0x69291(0x2a1);async['execute'](_0x1c603c){const _0x17eb7d=a59_0x69291,{options:_0xda1e62,args:_0x312f06,tdx:_0x5658c1}=_0x1c603c,_0x194e2d=this[_0x17eb7d(0x1a5)](_0x312f06,_0xda1e62);if(!_0x194e2d)return 0x1;const {projectName:_0x46f5ba,workflowName:_0x56ede6}=_0x194e2d,_0x32c2b2=_0xda1e62[_0x17eb7d(0x1e5)];if(_0xda1e62[_0x17eb7d(0x151)]){if(_0x46f5ba&&_0x56ede6)console[_0x17eb7d(0x274)](_0x17eb7d(0x21a)+_0x46f5ba+'.'+_0x56ede6);else _0x46f5ba&&console[_0x17eb7d(0x274)](_0x17eb7d(0x161)+_0x46f5ba);_0x32c2b2&&console[_0x17eb7d(0x274)](_0x17eb7d(0x14e));}const _0x546b5d=await withSpinner(_0x17eb7d(0x1fa),()=>_0x5658c1[_0x17eb7d(0x19a)]['attempts']({'projectName':_0x46f5ba,'workflowName':_0x56ede6,'includeRetried':_0x32c2b2,'limit':_0xda1e62['limit']}),{'verbose':_0xda1e62[_0x17eb7d(0x151)]}),_0x2d7a59=_0x546b5d[_0x17eb7d(0x162)],_0x17aedd=_0xda1e62[_0x17eb7d(0x2db)]||0x64,_0x4caeb8=_0x2d7a59[_0x17eb7d(0x204)]>=_0x17aedd?a59_0x34c7bd[_0x17eb7d(0x27d)](_0x17eb7d(0x188)):'';console[_0x17eb7d(0x274)](_0x17eb7d(0x164)+_0x2d7a59[_0x17eb7d(0x204)]+_0x17eb7d(0x244)+(_0x2d7a59[_0x17eb7d(0x204)]!==0x1?'s':'')+_0x4caeb8);if(_0xda1e62[_0x17eb7d(0x2ad)]===_0x17eb7d(0x18b)||_0xda1e62[_0x17eb7d(0x2ad)]==='jsonl'||_0xda1e62[_0x17eb7d(0x2ad)]===_0x17eb7d(0x1dd))await handleSDKOutput(_0x2d7a59,_0xda1e62);else{if(_0x2d7a59[_0x17eb7d(0x204)]===0x0){if(_0x46f5ba&&_0x56ede6)console['log']('No\x20attempts\x20found\x20for:\x20'+_0x46f5ba+'.'+_0x56ede6);else _0x46f5ba?console[_0x17eb7d(0x296)](_0x17eb7d(0x21c)+_0x46f5ba):console[_0x17eb7d(0x296)](_0x17eb7d(0x170));}else{const _0x40b79a=_0xda1e62[_0x17eb7d(0x2bf)],_0x55ece2=_0x2d7a59[_0x17eb7d(0x1b8)](_0x4c0891=>{const _0x204f0d=_0x17eb7d,_0x39bd00=a59_0x34c7bd['dim']('#'+_0x4c0891['id']),_0x5c7d95=_0x4c0891[_0x204f0d(0x235)]?.['id'],_0x5312ba=_0x4c0891[_0x204f0d(0x2e2)]||_0x4c0891[_0x204f0d(0x220)],_0x3a8fe1=_0x5c7d95&&_0x5312ba?hyperlink(_0x39bd00,getWorkflowAttemptUrl(_0x40b79a,_0x5c7d95,_0x5312ba,_0x4c0891['id'])):_0x39bd00,{icon:_0x1a2f66,text:_0x5e8c3c}=getAttemptStatusDisplay(_0x4c0891),_0x43146f=(_0x4c0891[_0x204f0d(0x235)]?.['name']||'?')+'.'+(_0x4c0891[_0x204f0d(0x19a)]?.['name']||'?'),_0x5c312b=_0x4c0891[_0x204f0d(0x155)]?a59_0x34c7bd['dim'](_0x4c0891[_0x204f0d(0x155)]):'';return(_0x3a8fe1+'\x20'+_0x1a2f66+(_0x5e8c3c?'\x20'+_0x5e8c3c:'')+'\x20'+_0x43146f+'\x20'+_0x5c312b)['trimEnd']();});await writeOutput(_0x55ece2[_0x17eb7d(0x19d)]('\x0a'),_0xda1e62['output'],_0x17eb7d(0x2e9));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a59_0x69291(0x183);[a59_0x69291(0x134)]=a59_0x69291(0x1c6);async[a59_0x69291(0x2fa)](_0x2b47bb){const _0x5c9271=a59_0x69291,{options:_0x3b05e5,args:_0x4850b0,tdx:_0x369a8e}=_0x2b47bb,_0x291cf0=_0x4850b0[0x0];if(!_0x291cf0)return console[_0x5c9271(0x274)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x3b05e5['verbose']&&console[_0x5c9271(0x274)](_0x5c9271(0x270)+_0x291cf0);const _0x4a9c7f=await withSpinner('Getting\x20attempt\x20details...',()=>_0x369a8e[_0x5c9271(0x19a)]['attempt'](_0x291cf0),{'verbose':_0x3b05e5[_0x5c9271(0x151)]}),_0xf3e84d=_0x4a9c7f[_0x5c9271(0x162)];let _0x57bb96;!_0xf3e84d[_0x5c9271(0x28b)]?_0x57bb96=_0xf3e84d['cancelRequested']?_0x5c9271(0x173):_0x5c9271(0x152):_0x57bb96=_0xf3e84d[_0x5c9271(0x210)]?_0x5c9271(0x210):_0x5c9271(0x274);let _0x43e041;if(_0xf3e84d[_0x5c9271(0x1f8)]&&_0xf3e84d[_0x5c9271(0x265)]){const _0x5f1d21=new Date(_0xf3e84d[_0x5c9271(0x1f8)])[_0x5c9271(0x1b3)](),_0x62f98=new Date(_0xf3e84d[_0x5c9271(0x265)])[_0x5c9271(0x1b3)]();_0x43e041=Math[_0x5c9271(0x13a)]((_0x62f98-_0x5f1d21)/0x3e8);}const _0x47849a={'attempt_id':_0xf3e84d['id'],'status':_0x57bb96,..._0xf3e84d[_0x5c9271(0x1f7)]!==undefined&&{'index':_0xf3e84d[_0x5c9271(0x1f7)]},..._0xf3e84d[_0x5c9271(0x235)]&&{'project':_0xf3e84d[_0x5c9271(0x235)][_0x5c9271(0x268)]},..._0xf3e84d[_0x5c9271(0x19a)]&&{'workflow':_0xf3e84d[_0x5c9271(0x19a)]['name']},..._0xf3e84d[_0x5c9271(0x220)]&&{'session_id':_0xf3e84d[_0x5c9271(0x220)]},..._0xf3e84d[_0x5c9271(0x155)]&&{'session_time':_0xf3e84d['sessionTime']},..._0xf3e84d[_0x5c9271(0x1a2)]&&{'retry_attempt':_0xf3e84d[_0x5c9271(0x1a2)]},..._0x43e041!==undefined&&{'duration_sec':_0x43e041},..._0xf3e84d[_0x5c9271(0x1f8)]&&{'created_at':_0xf3e84d['createdAt']},..._0xf3e84d['finishedAt']&&{'finished_at':_0xf3e84d[_0x5c9271(0x265)]},...Object['keys'](_0xf3e84d[_0x5c9271(0x25d)])[_0x5c9271(0x204)]>0x0&&{'params':_0xf3e84d[_0x5c9271(0x25d)]}};return await handleSingleObjectOutput(_0x47849a,_0x3b05e5),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x27e);['description']=a59_0x69291(0x2ae);async['execute'](_0x24081d){const _0x4576f8=a59_0x69291,{options:_0x30be20,args:_0x2b1b0d,tdx:_0x3db675}=_0x24081d,_0x9003da=_0x2b1b0d[0x0];if(!_0x9003da)return console[_0x4576f8(0x274)](_0x4576f8(0x138)),0x1;const _0x97658f=_0x30be20['includeSubtasks'];_0x30be20[_0x4576f8(0x151)]&&(console[_0x4576f8(0x274)](_0x4576f8(0x270)+_0x9003da),_0x97658f&&console['error'](_0x4576f8(0x20b)));const _0x2a574f=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x3db675[_0x4576f8(0x19a)][_0x4576f8(0x184)](_0x9003da,_0x97658f||![]),{'verbose':_0x30be20['verbose']}),_0x3b3f0b=_0x2a574f[_0x4576f8(0x162)];return console[_0x4576f8(0x274)](_0x4576f8(0x164)+_0x3b3f0b['length']+_0x4576f8(0x278)+(_0x3b3f0b[_0x4576f8(0x204)]!==0x1?'s':'')),await handleSDKOutput(_0x3b3f0b,_0x30be20),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x245);[a59_0x69291(0x134)]=a59_0x69291(0x148);async['execute'](_0x203f28){const _0x4f7eaf=a59_0x69291,{options:_0x2a40f2,args:_0x3ce88f,tdx:_0x5c1384}=_0x203f28,_0x5586af=_0x3ce88f[0x0];let _0x405657=_0x3ce88f[0x1];if(!_0x5586af)return console[_0x4f7eaf(0x274)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x2a40f2[_0x4f7eaf(0x151)]&&(console[_0x4f7eaf(0x274)]('Attempt\x20ID:\x20'+_0x5586af),_0x405657&&console[_0x4f7eaf(0x274)](_0x4f7eaf(0x166)+_0x405657));const _0x53e3f7=await withSpinner(_0x4f7eaf(0x185),()=>_0x5c1384[_0x4f7eaf(0x19a)][_0x4f7eaf(0x24a)](_0x5586af,_0x405657),{'verbose':_0x2a40f2[_0x4f7eaf(0x151)]}),_0x1b08bb=_0x53e3f7[_0x4f7eaf(0x162)];if(_0x1b08bb[_0x4f7eaf(0x204)]===0x0)return console[_0x4f7eaf(0x274)](_0x4f7eaf(0x246)),0x0;if(!_0x405657&&(_0x2a40f2['json']||_0x2a40f2[_0x4f7eaf(0x2ad)]))return await handleSDKOutput(_0x1b08bb,_0x2a40f2),0x0;if(!_0x405657){const _0x50abe8=_0x1b08bb[_0x4f7eaf(0x1b8)](_0x16e344=>({'title':_0x16e344['taskName']+'\x20('+formatBytes(_0x16e344[_0x4f7eaf(0x2b1)])+')','value':_0x16e344[_0x4f7eaf(0x2e4)]})),_0x58106d=await a59_0x3da1fb({'type':'select','name':_0x4f7eaf(0x2fb),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x50abe8});if(!_0x58106d['task'])return console[_0x4f7eaf(0x274)](_0x4f7eaf(0x292)),0x0;_0x405657=_0x58106d['task'];}const _0x549137=await withSpinner(_0x4f7eaf(0x194),()=>_0x5c1384[_0x4f7eaf(0x19a)][_0x4f7eaf(0x2cf)](_0x5586af,_0x405657),{'verbose':_0x2a40f2['verbose']}),_0x515d58=_0x549137[_0x4f7eaf(0x162)];return _0x515d58?console[_0x4f7eaf(0x296)](_0x515d58):console[_0x4f7eaf(0x274)](_0x4f7eaf(0x1a4)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x1c2);[a59_0x69291(0x134)]=a59_0x69291(0x1de);async[a59_0x69291(0x2fa)](_0x51fcec){const _0x5a9ae0=a59_0x69291,{options:_0x26d4b6,args:_0x48b612,tdx:_0x5e3f43}=_0x51fcec,_0x33a816=_0x48b612[0x0];if(!_0x33a816)return console[_0x5a9ae0(0x274)](_0x5a9ae0(0x138)),0x1;const _0x224db3=_0x26d4b6['reason'];_0x26d4b6['verbose']&&(console['error'](_0x5a9ae0(0x270)+_0x33a816),_0x224db3&&console['error']('Reason:\x20'+_0x224db3));if(!_0x26d4b6[_0x5a9ae0(0x1ae)]){if(!isInteractive())return console[_0x5a9ae0(0x274)](a59_0x34c7bd[_0x5a9ae0(0x2f8)](_0x5a9ae0(0x2f6)),_0x5a9ae0(0x2d1)),console[_0x5a9ae0(0x274)](a59_0x34c7bd['dim'](_0x5a9ae0(0x275))),0x1;const _0x52414b=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x33a816+'?');if(!_0x52414b)return console[_0x5a9ae0(0x274)](a59_0x34c7bd[_0x5a9ae0(0x196)](_0x5a9ae0(0x292))),0x1;}const _0x332042=await withSpinner(_0x5a9ae0(0x199),()=>_0x5e3f43[_0x5a9ae0(0x19a)][_0x5a9ae0(0x234)](_0x33a816,_0x224db3),{'verbose':_0x26d4b6['verbose']}),_0x58d284=_0x332042[_0x5a9ae0(0x162)];return console[_0x5a9ae0(0x274)]('✔\x20'+_0x58d284),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x1be);[a59_0x69291(0x134)]=a59_0x69291(0x1ea);async[a59_0x69291(0x2fa)](_0xda9ee1){const _0x21f8cf=a59_0x69291,{options:_0x55a961,args:_0x1b64f4,tdx:_0x42dbd7}=_0xda9ee1,_0x140332=_0x1b64f4[0x0];if(!_0x140332)return console[_0x21f8cf(0x274)](_0x21f8cf(0x2a7)),console[_0x21f8cf(0x274)](_0x21f8cf(0x2d0)),0x1;let _0x1f7e81=![],_0x32a09f=_0x140332;if(_0x140332[_0x21f8cf(0x22e)](_0x21f8cf(0x193)))_0x1f7e81=!![],_0x32a09f=_0x140332[_0x21f8cf(0x1a3)](0x8);else{if(_0x140332[_0x21f8cf(0x22e)](_0x21f8cf(0x2df)))_0x1f7e81=![],_0x32a09f=_0x140332[_0x21f8cf(0x1a3)](0x8);else return console[_0x21f8cf(0x274)](_0x21f8cf(0x27f)),console[_0x21f8cf(0x274)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x264557=_0x55a961[_0x21f8cf(0x1b1)],_0x2964eb=_0x55a961[_0x21f8cf(0x175)],_0x49f4a9=_0x55a961[_0x21f8cf(0x25d)],_0x59fd10=_0x55a961[_0x21f8cf(0x180)];_0x55a961[_0x21f8cf(0x151)]&&(console[_0x21f8cf(0x274)](_0x21f8cf(0x1ef)+(_0x1f7e81?_0x21f8cf(0x28a):'attempt')+'\x20'+_0x32a09f),_0x264557&&console[_0x21f8cf(0x274)]('From\x20task:\x20'+_0x264557),_0x2964eb&&console['error'](_0x21f8cf(0x16f)+_0x2964eb),_0x49f4a9&&console[_0x21f8cf(0x274)](_0x21f8cf(0x250)+_0x49f4a9),_0x59fd10&&console[_0x21f8cf(0x274)](_0x21f8cf(0x168)));let _0x2dcc51;if(_0x49f4a9)try{if(_0x49f4a9['startsWith']('@')){const _0x4f230d=await import(_0x21f8cf(0x131)),_0x4664dc=_0x49f4a9[_0x21f8cf(0x1a3)](0x1),_0x39b821=await _0x4f230d[_0x21f8cf(0x285)](_0x4664dc,_0x21f8cf(0x1ca));_0x2dcc51=JSON['parse'](_0x39b821);}else _0x2dcc51=JSON[_0x21f8cf(0x233)](_0x49f4a9);}catch{return console[_0x21f8cf(0x274)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x55a961['yes']){if(!isInteractive())return console[_0x21f8cf(0x274)](a59_0x34c7bd['red'](_0x21f8cf(0x2f6)),_0x21f8cf(0x2d1)),console['error'](a59_0x34c7bd[_0x21f8cf(0x27d)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x517e0c=await confirmKey(_0x21f8cf(0x2a4)+(_0x1f7e81?_0x21f8cf(0x28a):_0x21f8cf(0x217))+'\x20'+_0x32a09f+'?');if(!_0x517e0c)return console[_0x21f8cf(0x274)](a59_0x34c7bd[_0x21f8cf(0x196)](_0x21f8cf(0x292))),0x1;}let _0x523f43;_0x1f7e81?_0x523f43=await withSpinner(_0x21f8cf(0x28e),()=>_0x42dbd7[_0x21f8cf(0x19a)][_0x21f8cf(0x200)](_0x32a09f,{'fromTask':_0x264557,'retryParams':_0x2dcc51}),{'verbose':_0x55a961[_0x21f8cf(0x151)]}):_0x523f43=await withSpinner(_0x21f8cf(0x218),()=>_0x42dbd7['workflow']['retryAttempt'](_0x32a09f,{'resumeFrom':_0x2964eb,'retryParams':_0x2dcc51,'force':_0x59fd10}),{'verbose':_0x55a961[_0x21f8cf(0x151)]});const _0x619a60=_0x523f43[_0x21f8cf(0x162)];return console[_0x21f8cf(0x274)](_0x21f8cf(0x24c)),console[_0x21f8cf(0x274)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x619a60['attemptId']),console['error'](_0x21f8cf(0x191)+_0x619a60['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]='workflow:run';[a59_0x69291(0x134)]='Start\x20a\x20workflow\x20run';async[a59_0x69291(0x2fa)](_0x5b7fa0){const _0x30b8fb=a59_0x69291,{options:_0x3bd086,args:_0x5bf2f9,tdx:_0x490dd2}=_0x5b7fa0;let _0x9f1e32=_0x5bf2f9[0x0];if(!_0x9f1e32){const _0x3e7ea4=this[_0x30b8fb(0x1f1)]([],_0x3bd086),_0x23171e=await withSpinner(_0x30b8fb(0x139),()=>_0x490dd2[_0x30b8fb(0x19a)][_0x30b8fb(0x1cb)](_0x3e7ea4,{'limit':_0x3bd086[_0x30b8fb(0x2db)]}),{'verbose':_0x3bd086[_0x30b8fb(0x151)]}),_0x153303=_0x23171e['data'];if(_0x153303[_0x30b8fb(0x204)]===0x0)return console[_0x30b8fb(0x274)](_0x30b8fb(0x282)),!_0x3e7ea4&&console[_0x30b8fb(0x274)](a59_0x34c7bd[_0x30b8fb(0x27d)](_0x30b8fb(0x298))),0x1;const _0xa30fb1=_0x153303[_0x30b8fb(0x1b8)](_0x5915f0=>({'title':_0x5915f0[_0x30b8fb(0x235)]?.[_0x30b8fb(0x268)]+'.'+_0x5915f0[_0x30b8fb(0x268)],'value':_0x5915f0[_0x30b8fb(0x235)]?.[_0x30b8fb(0x268)]+'.'+_0x5915f0[_0x30b8fb(0x268)],'description':_0x5915f0['revision']?_0x30b8fb(0x187)+_0x5915f0[_0x30b8fb(0x1db)]:undefined})),_0xd57187=await a59_0x3da1fb({'type':'select','name':_0x30b8fb(0x19a),'message':_0x30b8fb(0x228),'choices':_0xa30fb1});if(!_0xd57187[_0x30b8fb(0x19a)])return 0x1;_0x9f1e32=_0xd57187['workflow'];}if(!_0x9f1e32[_0x30b8fb(0x302)]('.')){const _0x48123d=this[_0x30b8fb(0x1f1)]([],_0x3bd086);if(_0x48123d)_0x9f1e32=_0x48123d+'.'+_0x9f1e32;else return console[_0x30b8fb(0x274)](a59_0x34c7bd[_0x30b8fb(0x2f8)](_0x30b8fb(0x287)),_0x30b8fb(0x23f)),console[_0x30b8fb(0x274)](a59_0x34c7bd[_0x30b8fb(0x27d)](_0x30b8fb(0x298))),0x1;}const _0x550940=_0x3bd086[_0x30b8fb(0x1a7)],_0x2046ff=_0x3bd086[_0x30b8fb(0x155)],_0x279fd5={};if(_0x550940&&Array['isArray'](_0x550940))for(const _0x4c0353 of _0x550940){const _0x13074e=_0x4c0353[_0x30b8fb(0x295)]('=');if(_0x13074e===-0x1)return console[_0x30b8fb(0x274)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x4c0353),console[_0x30b8fb(0x274)](_0x30b8fb(0x277)),0x1;const _0x4cd327=_0x4c0353[_0x30b8fb(0x1a3)](0x0,_0x13074e),_0x48ab3b=_0x4c0353[_0x30b8fb(0x1a3)](_0x13074e+0x1);try{_0x279fd5[_0x4cd327]=JSON[_0x30b8fb(0x233)](_0x48ab3b);}catch{_0x279fd5[_0x4cd327]=_0x48ab3b;}}_0x3bd086[_0x30b8fb(0x151)]&&(console[_0x30b8fb(0x274)](_0x30b8fb(0x280)+_0x9f1e32),Object[_0x30b8fb(0x20a)](_0x279fd5)['length']>0x0&&console[_0x30b8fb(0x274)]('Parameters:\x20'+JSON[_0x30b8fb(0x288)](_0x279fd5)),_0x2046ff&&console[_0x30b8fb(0x274)](_0x30b8fb(0x1d5)+_0x2046ff));if(_0x3bd086[_0x30b8fb(0x255)])return await this[_0x30b8fb(0x2b8)](_0x5b7fa0,_0x9f1e32,_0x279fd5,_0x2046ff);const _0x3095e3=await withSpinner(_0x30b8fb(0x242),()=>_0x490dd2[_0x30b8fb(0x19a)][_0x30b8fb(0x2b7)](_0x9f1e32,_0x279fd5,{'sessionTime':_0x2046ff}),{'verbose':_0x3bd086['verbose']}),_0x114109=_0x3095e3[_0x30b8fb(0x162)];console[_0x30b8fb(0x274)]('✔\x20Workflow\x20run\x20started'),console['error'](_0x30b8fb(0x215)+_0x114109['id']),console[_0x30b8fb(0x274)](_0x30b8fb(0x191)+_0x114109[_0x30b8fb(0x220)]),console[_0x30b8fb(0x274)](_0x30b8fb(0x223)+_0x114109[_0x30b8fb(0x235)]?.['name']),console[_0x30b8fb(0x274)](_0x30b8fb(0x2cd)+_0x114109[_0x30b8fb(0x19a)]?.[_0x30b8fb(0x268)]);if(_0x114109[_0x30b8fb(0x235)]?.['id']&&_0x114109['sessionId']&&_0x114109['id']){const _0x57e565=_0x3bd086[_0x30b8fb(0x2bf)],_0x2a4bd0=getConsoleUrl(_0x57e565,'/app/workflows/'+_0x114109[_0x30b8fb(0x235)]['id']+_0x30b8fb(0x146)+_0x114109[_0x30b8fb(0x220)]+'/attempt/'+_0x114109['id']);console[_0x30b8fb(0x274)](_0x30b8fb(0x13d)+a59_0x34c7bd['cyan'](_0x2a4bd0));}return 0x0;}async[a59_0x69291(0x2b8)](_0x14af8c,_0x579615,_0x53a96a,_0xa42084){const _0x1616fd=a59_0x69291,{options:_0xb6ed3c,tdx:_0x3780ed}=_0x14af8c,_0x5602d4=await withSpinner('Fetching\x20workflow\x20'+_0x579615+'...',()=>_0x3780ed[_0x1616fd(0x19a)][_0x1616fd(0x2af)](_0x579615),{'verbose':_0xb6ed3c['verbose']}),_0x1de57e=_0x5602d4[_0x1616fd(0x162)],_0x2a3783=_0xa42084??new Date()[_0x1616fd(0x1bb)]();console[_0x1616fd(0x296)](a59_0x34c7bd[_0x1616fd(0x1d1)](_0x1616fd(0x1df)),_0x579615),console[_0x1616fd(0x296)](a59_0x34c7bd[_0x1616fd(0x1d1)](_0x1616fd(0x1fe)),_0x2a3783),console[_0x1616fd(0x296)](a59_0x34c7bd[_0x1616fd(0x1d1)]('Parameters:'),JSON['stringify'](_0x53a96a)),console['log'](''),console[_0x1616fd(0x296)](a59_0x34c7bd[_0x1616fd(0x1d1)](_0x1616fd(0x2d6)));const _0x2d37d7=parseTaskGraph(_0x1de57e[_0x1616fd(0x176)]??null);if(_0x2d37d7[_0x1616fd(0x204)]===0x0)console[_0x1616fd(0x296)](a59_0x34c7bd[_0x1616fd(0x27d)](_0x1616fd(0x2cc)));else for(const _0x17c5ba of formatTaskGraph(_0x2d37d7)){console[_0x1616fd(0x296)](_0x17c5ba);}const _0x4d7af6=summarizeTaskGraph(_0x2d37d7),_0x49dd78=formatWarningSummary(_0x4d7af6);return _0x49dd78&&(console['log'](''),console[_0x1616fd(0x296)](a59_0x34c7bd[_0x1616fd(0x196)](_0x49dd78))),console[_0x1616fd(0x296)](a59_0x34c7bd[_0x1616fd(0x196)](_0x1616fd(0x212))),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x254);[a59_0x69291(0x134)]=a59_0x69291(0x27b);async['execute'](_0x4403b5){const _0x26be27=a59_0x69291,{options:_0x31aafe,args:_0x55b208,tdx:_0x462c47}=_0x4403b5,_0x1ad2de=_0x55b208[0x0],_0x3b2745=_0x55b208[0x1]||'.';if(!_0x1ad2de)return console['error'](_0x26be27(0x261)),console[_0x26be27(0x274)](_0x26be27(0x22f)),0x1;const _0x486ab4=_0x31aafe[_0x26be27(0x1db)];_0x31aafe[_0x26be27(0x151)]&&(console['error']('Project:\x20'+_0x1ad2de),console[_0x26be27(0x274)](_0x26be27(0x1b2)+_0x3b2745),_0x486ab4&&console[_0x26be27(0x274)]('Revision:\x20'+_0x486ab4));const _0xdb24ea=await withSpinner(_0x26be27(0x165)+_0x1ad2de+_0x26be27(0x1c3),()=>_0x462c47[_0x26be27(0x19a)][_0x26be27(0x177)](_0x1ad2de,_0x3b2745,{'revision':_0x486ab4}),{'verbose':_0x31aafe[_0x26be27(0x151)]}),_0x221eba=_0xdb24ea[_0x26be27(0x162)];return console[_0x26be27(0x274)](_0x26be27(0x1bd)+_0x221eba[_0x26be27(0x26c)]),console[_0x26be27(0x274)]('\x20\x20Revision:\x20'+_0x221eba[_0x26be27(0x1db)]),console['error']('\x20\x20Files\x20extracted:\x20'+_0x221eba['filesExtracted']),console['error'](_0x26be27(0x209)+_0x3b2745+'/'+_0x221eba[_0x26be27(0x26c)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x1a6);[a59_0x69291(0x134)]=a59_0x69291(0x186);async[a59_0x69291(0x2fa)](_0x4b3dad){const _0x178120=a59_0x69291,{options:_0x21268a,args:_0x38fe96,tdx:_0x18acf1}=_0x4b3dad;let _0x1f53dd='.',_0x187c37=_0x21268a[_0x178120(0x268)];if(_0x38fe96[0x0]){const {promises:_0x2ad5d0}=await import('fs');try{const _0x5ec94a=await _0x2ad5d0['stat'](_0x38fe96[0x0]);if(_0x5ec94a['isDirectory']())_0x1f53dd=_0x38fe96[0x0];else return console[_0x178120(0x274)](_0x178120(0x2b4)+_0x38fe96[0x0]+_0x178120(0x2d8)),0x1;}catch{_0x187c37=_0x38fe96[0x0],_0x1f53dd='.';}}const _0x55cb65=_0x21268a[_0x178120(0x1db)],_0xb85ec9=_0x21268a[_0x178120(0x2aa)];_0x21268a[_0x178120(0x151)]&&(console['error'](_0x178120(0x198)+_0x1f53dd),_0x187c37&&console[_0x178120(0x274)](_0x178120(0x23a)+_0x187c37),_0x55cb65&&console[_0x178120(0x274)](_0x178120(0x216)+_0x55cb65),_0xb85ec9&&console[_0x178120(0x274)]('Validation:\x20skipped'));const _0x325f28=await withSpinner(_0x178120(0x24e),()=>_0x18acf1['workflow']['push'](_0x1f53dd,{'projectName':_0x187c37,'revision':_0x55cb65,'skipValidation':_0xb85ec9}),{'verbose':_0x21268a['verbose']}),_0x28e595=_0x325f28['data'];return console['error'](_0x178120(0x2fe)+_0x28e595[_0x178120(0x26c)]),console[_0x178120(0x274)](_0x178120(0x1bc)+_0x28e595[_0x178120(0x2c2)]),console['error'](_0x178120(0x1e4)+_0x28e595[_0x178120(0x1db)]),await this['showWorkflowConsoleUrl'](_0x18acf1,_0x28e595[_0x178120(0x26c)],_0x21268a[_0x178120(0x2bf)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x201);[a59_0x69291(0x134)]=a59_0x69291(0x16b);async[a59_0x69291(0x2fa)](_0x4eeccb){const _0x51416f=a59_0x69291,{options:_0x28637d,args:_0x4179ba,tdx:_0x212ca3}=_0x4eeccb,_0x52e0ae=_0x4179ba[0x0],_0x2cbe84=_0x4179ba[0x1];if(!_0x52e0ae)return console[_0x51416f(0x274)](a59_0x34c7bd[_0x51416f(0x2f8)](_0x51416f(0x287)),_0x51416f(0x2be)),console[_0x51416f(0x274)](a59_0x34c7bd[_0x51416f(0x27d)](_0x51416f(0x15a))),0x1;const _0x585cb9=_0x28637d[_0x51416f(0x1db)];_0x28637d[_0x51416f(0x151)]&&(console[_0x51416f(0x274)](_0x51416f(0x17e)+_0x52e0ae),_0x2cbe84&&console[_0x51416f(0x274)](_0x51416f(0x29b)+_0x2cbe84),_0x585cb9&&console[_0x51416f(0x274)](_0x51416f(0x216)+_0x585cb9),_0x28637d[_0x51416f(0x255)]&&console[_0x51416f(0x274)]('Dry\x20run:\x20yes'));const _0x3095f8=await withSpinner('Pulling\x20project\x20'+_0x52e0ae+_0x51416f(0x1c3),()=>_0x212ca3[_0x51416f(0x19a)][_0x51416f(0x130)](_0x52e0ae,{'targetDir':_0x2cbe84,'revision':_0x585cb9}),{'verbose':_0x28637d['verbose']}),_0x4162c8=_0x3095f8[_0x51416f(0x162)];_0x4162c8[_0x51416f(0x301)]?console[_0x51416f(0x274)](_0x51416f(0x276)+_0x4162c8[_0x51416f(0x26c)]):console[_0x51416f(0x274)]('→\x20Project:\x20'+_0x4162c8['projectName']);console[_0x51416f(0x274)](_0x51416f(0x1e4)+_0x4162c8['revision']),console['error'](_0x51416f(0x25a)+(a59_0x28ffa6['relative'](process[_0x51416f(0x2e3)](),_0x4162c8[_0x51416f(0x1e1)])||'.')),console['error']('\x20\x20Changes:\x20'+a59_0x34c7bd[_0x51416f(0x2d5)]('+'+_0x4162c8['summary'][_0x51416f(0x267)]+_0x51416f(0x17f))+',\x20'+(a59_0x34c7bd['yellow']('~'+_0x4162c8[_0x51416f(0x2c8)]['modified']+_0x51416f(0x12d))+',\x20')+(a59_0x34c7bd[_0x51416f(0x2f8)]('-'+_0x4162c8[_0x51416f(0x2c8)][_0x51416f(0x23b)]+'\x20deleted')+',\x20')+(''+a59_0x34c7bd[_0x51416f(0x27d)](_0x4162c8[_0x51416f(0x2c8)][_0x51416f(0x241)]+'\x20unchanged')));for(const _0x59d491 of _0x4162c8[_0x51416f(0x1e8)]){_0x59d491[_0x51416f(0x29d)]===_0x51416f(0x26b)&&_0x59d491[_0x51416f(0x205)]&&(console[_0x51416f(0x274)]('\x0a'+a59_0x34c7bd[_0x51416f(0x251)](_0x51416f(0x1ba)+_0x59d491['path'])),console['error'](_0x59d491['diff']));}if(!_0x4162c8['hasChanges'])return saveSessionContext({'workflow_project':_0x4162c8[_0x51416f(0x26c)]},_0x28637d['session']),console[_0x51416f(0x274)](a59_0x34c7bd[_0x51416f(0x2d5)](_0x51416f(0x211))),console[_0x51416f(0x274)](a59_0x34c7bd['dim']('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x4162c8[_0x51416f(0x26c)])),0x0;if(_0x28637d['dryRun'])return console[_0x51416f(0x274)](a59_0x34c7bd[_0x51416f(0x196)](_0x51416f(0x24f))),0x0;if(!_0x28637d[_0x51416f(0x1ae)]){if(!isInteractive())return console['error'](a59_0x34c7bd[_0x51416f(0x2f8)](_0x51416f(0x2f6)),_0x51416f(0x2d1)),console['error'](a59_0x34c7bd[_0x51416f(0x27d)](_0x51416f(0x275))),0x1;const _0x501d7a=await confirmKey(_0x51416f(0x18e));if(!_0x501d7a)return console['error'](a59_0x34c7bd[_0x51416f(0x196)](_0x51416f(0x292)),_0x51416f(0x2b3)),0x1;}await withSpinner('Writing\x20files...',()=>_0x212ca3[_0x51416f(0x19a)][_0x51416f(0x25b)](_0x4162c8,{'revision':_0x585cb9}),{'verbose':_0x28637d[_0x51416f(0x151)]}),saveSessionContext({'workflow_project':_0x4162c8['projectName']},_0x28637d['session']),console[_0x51416f(0x274)](a59_0x34c7bd[_0x51416f(0x2d5)](_0x51416f(0x2a3)));const _0x4565f5=a59_0x28ffa6[_0x51416f(0x1e0)](process[_0x51416f(0x2e3)](),_0x4162c8['targetDir'])||'.';return console[_0x51416f(0x274)](a59_0x34c7bd[_0x51416f(0x27d)](_0x51416f(0x209)+_0x4565f5)),console[_0x51416f(0x274)](a59_0x34c7bd['dim'](_0x51416f(0x1a0)+_0x4162c8[_0x51416f(0x26c)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x272);['description']=a59_0x69291(0x17a);async['execute'](_0x40e182){const _0x4ac6e3=a59_0x69291,{options:_0x2a3134,args:_0x11f908,tdx:_0x4dece6}=_0x40e182,_0x35b8d3=this[_0x4ac6e3(0x1fd)](_0x11f908,_0x2a3134),_0x5925db=_0x2a3134,{revision:_0x3689e1,skipValidation:_0x2c7c64,backfill:_0x5aa654}=_0x5925db,_0x4692ac=_0x5aa654===undefined?undefined:!_0x5aa654;_0x2a3134[_0x4ac6e3(0x151)]&&(_0x35b8d3&&console[_0x4ac6e3(0x274)](_0x4ac6e3(0x260)+_0x35b8d3),_0x3689e1&&console[_0x4ac6e3(0x274)](_0x4ac6e3(0x216)+_0x3689e1),_0x2a3134[_0x4ac6e3(0x255)]&&console['error']('Dry\x20run:\x20yes'),_0x2c7c64&&console[_0x4ac6e3(0x274)]('Validation:\x20skipped'),_0x5aa654&&console[_0x4ac6e3(0x274)](_0x4ac6e3(0x15c)));let _0x7d3cf4;try{_0x7d3cf4=await withSpinner(_0x4ac6e3(0x1e9),()=>_0x4dece6['workflow'][_0x4ac6e3(0x12f)]({'sourceDir':_0x35b8d3,'revision':_0x3689e1,'skipValidation':_0x2c7c64,'skipSchedule':_0x4692ac}),{'verbose':_0x2a3134[_0x4ac6e3(0x151)]});}catch(_0xa3b52b){if(_0xa3b52b instanceof Error&&_0xa3b52b['message'][_0x4ac6e3(0x302)](_0x4ac6e3(0x2dc)))return console[_0x4ac6e3(0x274)](a59_0x34c7bd[_0x4ac6e3(0x2f8)](_0x4ac6e3(0x287)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x2a3134[_0x4ac6e3(0x19c)]?console['error'](a59_0x34c7bd['dim'](_0x4ac6e3(0x1e7)+_0x2a3134[_0x4ac6e3(0x19c)]+_0x4ac6e3(0x15e)+_0x2a3134[_0x4ac6e3(0x19c)]+'\x27')):console[_0x4ac6e3(0x274)](a59_0x34c7bd[_0x4ac6e3(0x27d)](_0x4ac6e3(0x2c6))),0x1;throw _0xa3b52b;}const _0x4cd3e5=_0x7d3cf4[_0x4ac6e3(0x162)];console[_0x4ac6e3(0x274)](_0x4ac6e3(0x247)+_0x4cd3e5[_0x4ac6e3(0x26c)]),console[_0x4ac6e3(0x274)](_0x4ac6e3(0x221)+_0x4cd3e5[_0x4ac6e3(0x213)]),console[_0x4ac6e3(0x274)]('\x20\x20Revision:\x20'+_0x4cd3e5[_0x4ac6e3(0x1db)]),console[_0x4ac6e3(0x274)]('\x20\x20Changes:\x20'+a59_0x34c7bd['green']('+'+_0x4cd3e5[_0x4ac6e3(0x2c8)][_0x4ac6e3(0x267)]+'\x20new')+',\x20'+(a59_0x34c7bd['yellow']('~'+_0x4cd3e5[_0x4ac6e3(0x2c8)][_0x4ac6e3(0x26b)]+_0x4ac6e3(0x12d))+',\x20')+(a59_0x34c7bd['red']('-'+_0x4cd3e5[_0x4ac6e3(0x2c8)]['deleted']+_0x4ac6e3(0x2bb))+',\x20')+(''+a59_0x34c7bd['dim'](_0x4cd3e5['summary'][_0x4ac6e3(0x241)]+_0x4ac6e3(0x1f0))));for(const _0x57de2f of _0x4cd3e5['changes']){_0x57de2f[_0x4ac6e3(0x29d)]===_0x4ac6e3(0x26b)&&_0x57de2f[_0x4ac6e3(0x205)]&&(console['error']('\x0a'+a59_0x34c7bd[_0x4ac6e3(0x251)](_0x4ac6e3(0x1ba)+_0x57de2f[_0x4ac6e3(0x2f0)])),console[_0x4ac6e3(0x274)](_0x57de2f['diff']));}if(!_0x4cd3e5['hasChanges'])return console[_0x4ac6e3(0x274)](a59_0x34c7bd[_0x4ac6e3(0x2d5)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x4ac6e3(0x264)](_0x4dece6,_0x4cd3e5[_0x4ac6e3(0x26c)],_0x2a3134[_0x4ac6e3(0x2bf)]),0x0;if(_0x2a3134[_0x4ac6e3(0x255)])return console[_0x4ac6e3(0x274)](a59_0x34c7bd['yellow']('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x2a3134['yes']){if(!isInteractive())return console[_0x4ac6e3(0x274)](a59_0x34c7bd['red'](_0x4ac6e3(0x2f6)),_0x4ac6e3(0x2d1)),console['error'](a59_0x34c7bd[_0x4ac6e3(0x27d)](_0x4ac6e3(0x275))),0x1;const _0x2933cc=await confirmKey(_0x4ac6e3(0x1e3));if(!_0x2933cc)return console[_0x4ac6e3(0x274)](a59_0x34c7bd['yellow'](_0x4ac6e3(0x292)),_0x4ac6e3(0x249)),0x1;}const _0x236ea5=await withSpinner(_0x4ac6e3(0x182),()=>_0x4dece6['workflow'][_0x4ac6e3(0x16d)](_0x4cd3e5),{'verbose':_0x2a3134[_0x4ac6e3(0x151)]}),_0x3237a0=_0x236ea5[_0x4ac6e3(0x162)];return console[_0x4ac6e3(0x274)](a59_0x34c7bd[_0x4ac6e3(0x2d5)](_0x4ac6e3(0x273))),console['error'](_0x4ac6e3(0x1bc)+_0x3237a0[_0x4ac6e3(0x2c2)]),console[_0x4ac6e3(0x274)](_0x4ac6e3(0x1e4)+_0x3237a0['revision']),await this['showWorkflowConsoleUrl'](_0x4dece6,_0x3237a0['projectName'],_0x2a3134[_0x4ac6e3(0x2bf)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a59_0x69291(0x2ac);[a59_0x69291(0x134)]=a59_0x69291(0x1c7);async[a59_0x69291(0x2fa)](_0x547fd6){const _0x6a6319=a59_0x69291,{options:_0x53bcd8,args:_0x4fb42a,tdx:_0xce07bd}=_0x547fd6,_0x4768ba=this['resolveProjectDir'](_0x4fb42a,_0x53bcd8),_0x2f96f6=_0x53bcd8['name'],_0x236063=_0x53bcd8[_0x6a6319(0x1db)],_0x566e92=_0x53bcd8[_0x6a6319(0x2aa)];if(!_0x4768ba)return console['error'](a59_0x34c7bd['red'](_0x6a6319(0x287)),'Source\x20directory\x20is\x20required'),console[_0x6a6319(0x274)](a59_0x34c7bd[_0x6a6319(0x27d)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x6a6319(0x274)](a59_0x34c7bd['dim'](_0x6a6319(0x192))),0x1;if(!_0x2f96f6)return console[_0x6a6319(0x274)](a59_0x34c7bd[_0x6a6319(0x2f8)]('Error:'),_0x6a6319(0x2e6)),console['error'](a59_0x34c7bd[_0x6a6319(0x27d)](_0x6a6319(0x1c0))),0x1;_0x53bcd8[_0x6a6319(0x151)]&&(console[_0x6a6319(0x274)](_0x6a6319(0x260)+_0x4768ba),console[_0x6a6319(0x274)](_0x6a6319(0x259)+_0x2f96f6),_0x236063&&console[_0x6a6319(0x274)](_0x6a6319(0x216)+_0x236063),_0x53bcd8[_0x6a6319(0x255)]&&console['error'](_0x6a6319(0x178)),_0x566e92&&console[_0x6a6319(0x274)](_0x6a6319(0x1b0)));const _0x440a9c=await withSpinner('Analyzing\x20project...',()=>_0xce07bd[_0x6a6319(0x19a)]['prepareCloneProject'](_0x4768ba,_0x2f96f6,{'revision':_0x236063,'skipValidation':_0x566e92}),{'verbose':_0x53bcd8['verbose']}),_0x157c86=_0x440a9c['data'];console[_0x6a6319(0x274)]('Source:\x20'+_0x157c86[_0x6a6319(0x213)]);_0x157c86[_0x6a6319(0x27c)]&&console['error'](_0x6a6319(0x15d)+_0x157c86[_0x6a6319(0x27c)]);console['error'](_0x6a6319(0x259)+_0x157c86[_0x6a6319(0x214)]),console[_0x6a6319(0x274)]('Revision:\x20'+_0x157c86[_0x6a6319(0x1db)]),console[_0x6a6319(0x274)](_0x6a6319(0x1c8)+_0x157c86[_0x6a6319(0x18f)]);_0x157c86[_0x6a6319(0x226)]&&(console[_0x6a6319(0x274)](a59_0x34c7bd[_0x6a6319(0x196)](_0x6a6319(0x2c9)+_0x157c86[_0x6a6319(0x214)]+_0x6a6319(0x20e)+_0x157c86[_0x6a6319(0x2f2)]+')')),console['error'](a59_0x34c7bd[_0x6a6319(0x196)](_0x6a6319(0x2cb))));if(_0x53bcd8[_0x6a6319(0x255)])return console[_0x6a6319(0x274)](a59_0x34c7bd[_0x6a6319(0x196)](_0x6a6319(0x2f5))),0x0;if(!_0x53bcd8[_0x6a6319(0x1ae)]){if(!isInteractive())return console['error'](a59_0x34c7bd[_0x6a6319(0x2f8)](_0x6a6319(0x2f6)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x6a6319(0x274)](a59_0x34c7bd['dim'](_0x6a6319(0x275))),0x1;const _0x3d80f5=_0x157c86['sourceProjectName']||a59_0x28ffa6['basename'](_0x4768ba),_0x2be6d8=_0x157c86[_0x6a6319(0x226)]?_0x6a6319(0x2d4)+_0x2f96f6+_0x6a6319(0x160):_0x6a6319(0x140)+_0x3d80f5+_0x6a6319(0x2e5)+_0x2f96f6+'\x22?',_0x3751e8=await confirmKey(_0x2be6d8);if(!_0x3751e8)return console[_0x6a6319(0x274)](a59_0x34c7bd[_0x6a6319(0x196)](_0x6a6319(0x292))),0x1;}const _0x58316f=await withSpinner(_0x157c86[_0x6a6319(0x226)]?_0x6a6319(0x1dc)+_0x2f96f6+_0x6a6319(0x1c3):_0x6a6319(0x19e)+_0x2f96f6+_0x6a6319(0x1c3),()=>_0xce07bd['workflow']['executeCloneProject'](_0x157c86),{'verbose':_0x53bcd8[_0x6a6319(0x151)]}),_0x12b9d9=_0x58316f[_0x6a6319(0x162)];return console['error'](a59_0x34c7bd['green'](_0x157c86[_0x6a6319(0x226)]?_0x6a6319(0x283):'✔\x20Clone\x20complete')),console[_0x6a6319(0x274)](_0x6a6319(0x223)+_0x12b9d9[_0x6a6319(0x214)]),console[_0x6a6319(0x274)](_0x6a6319(0x1bc)+_0x12b9d9[_0x6a6319(0x289)]),console[_0x6a6319(0x274)]('\x20\x20Revision:\x20'+_0x12b9d9[_0x6a6319(0x1db)]),await this['showWorkflowConsoleUrl'](_0xce07bd,_0x12b9d9['newProjectName'],_0x53bcd8[_0x6a6319(0x2bf)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a59_0x69291(0x268)]='workflow:delete';[a59_0x69291(0x134)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20AI';async['execute'](_0x414ce5){const _0x56b8f7=a59_0x69291,{options:_0x82744d,args:_0x4af2cb,tdx:_0xb70637}=_0x414ce5,_0x4b91c1=_0x4af2cb[0x0];if(!_0x4b91c1)return console[_0x56b8f7(0x274)](_0x56b8f7(0x294)),console[_0x56b8f7(0x274)](_0x56b8f7(0x197)),0x1;_0x82744d[_0x56b8f7(0x151)]&&console[_0x56b8f7(0x274)]('Project:\x20'+_0x4b91c1);if(!_0x82744d[_0x56b8f7(0x1ae)]){if(!isInteractive())return console[_0x56b8f7(0x274)](a59_0x34c7bd[_0x56b8f7(0x2f8)](_0x56b8f7(0x2f6)),_0x56b8f7(0x2d1)),console[_0x56b8f7(0x274)](a59_0x34c7bd[_0x56b8f7(0x27d)](_0x56b8f7(0x275))),0x1;const _0x10c540=await confirmKey(_0x56b8f7(0x18c)+_0x4b91c1+_0x56b8f7(0x1a9));if(!_0x10c540)return console[_0x56b8f7(0x274)](a59_0x34c7bd['yellow']('Cancelled')),0x1;}const _0x3b85c9=await withSpinner(_0x56b8f7(0x2fc)+_0x4b91c1+_0x56b8f7(0x1c3),()=>_0xb70637[_0x56b8f7(0x19a)][_0x56b8f7(0x290)](_0x4b91c1),{'verbose':_0x82744d[_0x56b8f7(0x151)]}),_0x5cc28b=_0x3b85c9[_0x56b8f7(0x162)];return console[_0x56b8f7(0x274)]('✔\x20Deleted\x20project\x20'+_0x5cc28b[_0x56b8f7(0x26c)]),console[_0x56b8f7(0x274)]('\x20\x20Project\x20ID:\x20'+_0x5cc28b[_0x56b8f7(0x2c2)]),0x0;}}export function parseKeyValue(_0x3eb392){const _0x38b767=a59_0x69291,_0x2bb173=_0x3eb392[_0x38b767(0x295)]('=');if(_0x2bb173===-0x1)throw new Error(_0x38b767(0x19b)+_0x3eb392+_0x38b767(0x2ab));const _0x153d4f=_0x3eb392['substring'](0x0,_0x2bb173),_0x510c02=_0x3eb392[_0x38b767(0x1a3)](_0x2bb173+0x1);if(!_0x153d4f)throw new Error(_0x38b767(0x23e));return{'key':_0x153d4f,'value':_0x510c02};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']=a59_0x69291(0x20c);[a59_0x69291(0x134)]=a59_0x69291(0x13c);async[a59_0x69291(0x2fa)](_0x5e93ab){const _0x775529=a59_0x69291,{options:_0x3f414d,args:_0x3d2922,tdx:_0x8037bd}=_0x5e93ab,_0x2fa2bd=this[_0x775529(0x1ee)](_0x3d2922,_0x3f414d);if(!_0x2fa2bd)return 0x1;_0x3f414d[_0x775529(0x151)]&&console['error']('Project:\x20'+_0x2fa2bd);const _0x32efc2=await withSpinner('Listing\x20secrets...',()=>_0x8037bd[_0x775529(0x19a)][_0x775529(0x16a)](_0x2fa2bd),{'verbose':_0x3f414d[_0x775529(0x151)]}),{secrets:_0x15f42b}=_0x32efc2[_0x775529(0x162)];return console[_0x775529(0x274)]('✔\x20Found\x20'+_0x15f42b[_0x775529(0x204)]+'\x20secret'+(_0x15f42b['length']!==0x1?'s':'')),await handleSDKOutput(_0x15f42b,_0x3f414d),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x28d);[a59_0x69291(0x134)]=a59_0x69291(0x2b5);async[a59_0x69291(0x2fa)](_0x5880e6){const _0xa1a332=a59_0x69291,{options:_0x4f272e,args:_0x2c81f2,tdx:_0x4beba7}=_0x5880e6;let _0x3c9ab6,_0x387e0e;if(_0x2c81f2[_0xa1a332(0x204)]>=0x1&&!_0x2c81f2[0x0][_0xa1a332(0x302)]('='))_0x3c9ab6=_0x2c81f2[0x0],_0x387e0e=_0x2c81f2['slice'](0x1);else{if(_0x2c81f2[_0xa1a332(0x204)]>=0x1&&_0x4f272e['workflowProject'])_0x3c9ab6=_0x4f272e[_0xa1a332(0x19c)],_0x387e0e=_0x2c81f2;else return _0x2c81f2['length']>=0x1?(console['error'](_0xa1a332(0x261)),console[_0xa1a332(0x274)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0xa1a332(0x274)](_0xa1a332(0x15b)),console[_0xa1a332(0x274)](_0xa1a332(0x1cf)),0x1);}if(_0x387e0e[_0xa1a332(0x204)]===0x0)return console['error'](_0xa1a332(0x15b)),console[_0xa1a332(0x274)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1;const _0x1548e8={};try{for(const _0x3b4ffd of _0x387e0e){const {key:_0x18ad4a,value:_0x31c404}=parseKeyValue(_0x3b4ffd);_0x1548e8[_0x18ad4a]=_0x31c404;}}catch(_0x223ef4){return _0x223ef4 instanceof Error&&console[_0xa1a332(0x274)](a59_0x34c7bd[_0xa1a332(0x2f8)]('Error:'),_0x223ef4['message']),0x1;}const _0x284011=Object[_0xa1a332(0x20a)](_0x1548e8);_0x4f272e[_0xa1a332(0x151)]&&(console[_0xa1a332(0x274)]('Project:\x20'+_0x3c9ab6),console['error']('Secrets\x20to\x20set:\x20'+_0x284011[_0xa1a332(0x19d)](',\x20')));const _0x848f1d=await withSpinner(_0x284011[_0xa1a332(0x204)]===0x1?_0xa1a332(0x13b):'Setting\x20'+_0x284011[_0xa1a332(0x204)]+_0xa1a332(0x18d),()=>_0x4beba7[_0xa1a332(0x19a)][_0xa1a332(0x203)](_0x3c9ab6,_0x1548e8),{'verbose':_0x4f272e[_0xa1a332(0x151)]}),_0x1a69d8=_0x848f1d[_0xa1a332(0x162)];return console[_0xa1a332(0x274)](_0x284011[_0xa1a332(0x204)]===0x1?_0xa1a332(0x26d)+_0x1a69d8[_0xa1a332(0x20a)][0x0]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x1a69d8[_0xa1a332(0x26c)]+'\x27':'✔\x20'+_0x1a69d8['keys'][_0xa1a332(0x204)]+'\x20secrets\x20set\x20for\x20project\x20\x27'+_0x1a69d8[_0xa1a332(0x26c)]+'\x27'),(_0x4f272e[_0xa1a332(0x18b)]||_0x4f272e['jsonl'])&&await handleSingleObjectOutput(_0x1a69d8,_0x4f272e),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x229);[a59_0x69291(0x134)]=a59_0x69291(0x2c5);async[a59_0x69291(0x2fa)](_0x3208fa){const _0x43304a=a59_0x69291,{options:_0xbfb41a,args:_0x5ef52d,tdx:_0x55fde2}=_0x3208fa;let _0x2d1af2,_0x359fcf;if(_0x5ef52d['length']>=0x2)_0x2d1af2=_0x5ef52d[0x0],_0x359fcf=_0x5ef52d[0x1];else{if(_0x5ef52d['length']===0x1&&_0xbfb41a[_0x43304a(0x19c)])_0x2d1af2=_0xbfb41a[_0x43304a(0x19c)],_0x359fcf=_0x5ef52d[0x0];else return _0x5ef52d[_0x43304a(0x204)]===0x1?(console[_0x43304a(0x274)](_0x43304a(0x261)),console[_0x43304a(0x274)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console['error']('Error:\x20Secret\x20key\x20is\x20required'),console[_0x43304a(0x274)]('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0xbfb41a['verbose']&&(console['error']('Project:\x20'+_0x2d1af2),console['error'](_0x43304a(0x2f9)+_0x359fcf));if(!_0xbfb41a[_0x43304a(0x1ae)]){if(!isInteractive())return console[_0x43304a(0x274)](a59_0x34c7bd[_0x43304a(0x2f8)](_0x43304a(0x2f6)),_0x43304a(0x2d1)),console[_0x43304a(0x274)](a59_0x34c7bd[_0x43304a(0x27d)](_0x43304a(0x275))),0x1;const _0x39fd22=await confirmKey(_0x43304a(0x14b)+_0x359fcf+_0x43304a(0x1b5)+_0x2d1af2+'\x27?');if(!_0x39fd22)return console[_0x43304a(0x274)](a59_0x34c7bd[_0x43304a(0x196)]('Cancelled')),0x1;}const _0x50ace8=await withSpinner(_0x43304a(0x163),()=>_0x55fde2[_0x43304a(0x19a)][_0x43304a(0x281)](_0x2d1af2,_0x359fcf),{'verbose':_0xbfb41a[_0x43304a(0x151)]}),_0xaffddc=_0x50ace8[_0x43304a(0x162)];return console[_0x43304a(0x274)](_0x43304a(0x26d)+_0xaffddc[_0x43304a(0x243)]+_0x43304a(0x1d4)+_0xaffddc[_0x43304a(0x26c)]+'\x27'),(_0xbfb41a[_0x43304a(0x18b)]||_0xbfb41a[_0x43304a(0x1d8)])&&await handleSingleObjectOutput(_0xaffddc,_0xbfb41a),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 a59_0x5020(){const _0x13b5f9=['jsonl','renderSessionsTimeline','Resolving\x20project\x20\x27','revision','Updating\x20','table','Kill\x20a\x20running\x20attempt','Workflow:','relative','targetDir','buildTimelineData','\x0aPush\x20these\x20changes?','\x20\x20Revision:\x20','includeRetried','fill','Tip:\x20cd\x20to\x20workflows/','changes','Analyzing\x20changes...','Retry\x20a\x20session\x20or\x20attempt','all','resolveProjectId','\x20enabled\x20(','requireProject','Target:\x20','\x20unchanged','resolveProject','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','Using\x20attempt\x20','match','\x0aPolling...\x20(','LABEL_WIDTH_DIVISOR','index','createdAt','min','Listing\x20workflow\x20attempts...','durationMs','MAX_TASKS_DISPLAY','resolveProjectDir','Session\x20time:','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','retrySession','workflow:pull','trim','setSecrets','length','diff','isTTY','output','skipSchedule','\x20\x20Location:\x20','keys','Including\x20subtasks:\x20yes','workflow:secrets:list','Listing\x20workflow\x20projects...','\x22\x20already\x20exists\x20(ID:\x20','✔\x20Schedule\x20#','success','\x0a✔\x20Already\x20up\x20to\x20date','\x0a[Dry\x20run]\x20Workflow\x20was\x20NOT\x20executed.','sourceDir','newProjectName','\x20\x20Attempt\x20ID:\x20','Revision:\x20','attempt','Retrying\x20attempt...','6312747RpMHaJ','Filter:\x20','attemptId','No\x20attempts\x20found\x20in\x20project:\x20','\x20session','renderSingleTimeline','status','sessionId','\x20\x20Source:\x20','title','\x20\x20Project:\x20','📋\x20','workflow:schedules','targetExists','No\x20workflows\x20found\x20in\x20project:\x20','Select\x20a\x20workflow\x20to\x20run','workflow:secrets:delete','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','MAX_LABEL_COUNT','✔\x20Workflow\x20project\x20context\x20cleared.','3418840EzgxXJ','startsWith','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','has','toLowerCase','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','parse','kill','project','\x20workflow','group_error','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','nextRunTime','Project\x20name:\x20','deleted','No\x20sessions\x20found\x20in\x20project:\x20','Listing\x20schedules...','Key\x20cannot\x20be\x20empty','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','displayLine','unchanged','Starting\x20workflow\x20run...','key','\x20attempt','workflow:logs','No\x20log\x20files\x20found\x20for\x20this\x20attempt','✔\x20Project:\x20','get','-\x20nothing\x20pushed','logFiles','icon','✔\x20Retry\x20started','\x20project','Pushing\x20workflow\x20project...','\x0aDry\x20run\x20-\x20no\x20files\x20written','Params:\x20','cyan','12695rTKvth','unknown','workflow:download','dryRun','workflow:workflows','No\x20schedules\x20found','getHours','New\x20project\x20name:\x20','\x20\x20Target:\x20','applyPullProject','msPerChar','params','padStart','💡\x20Tip:\x20Use\x20','Source\x20directory:\x20','Error:\x20Project\x20name\x20is\x20required','POLL_INTERVAL_MS','\x20(use\x20a\x20larger\x20--limit\x20to\x20show\x20more)','showWorkflowConsoleUrl','finishedAt','cancelRequested','new','name','blue','pending','modified','projectName','✔\x20Secret\x20\x27','startedAt','No\x20matching\x20sessions\x20found','Attempt\x20ID:\x20','⚠\x20Showing\x20first\x20','workflow:push','✔\x20Push\x20complete','error','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','→\x20New\x20project:\x20','Expected\x20format:\x20--param\x20key=value','\x20task','sort','MIN_LABEL_COUNT','Download\x20workflow\x20project\x20from\x20Treasure\x20AI','sourceProjectName','dim','workflow:tasks','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Workflow:\x20','deleteSecret','No\x20workflows\x20found','✔\x20Project\x20updated','pollTimeline','readFile','localeCompare','Error:','stringify','newProjectId','session','done','614453TNuqaK','workflow:secrets:set','Retrying\x20session...','🔄\x20','delete','5908608gBLDyQ','Cancelled','end','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','indexOf','log','workflow:projects','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','1630qxfcFz','autocomplete','Target\x20directory:\x20','write','type','\x20has\x20no\x20attempts','lastAttempt','disableSchedule','List\x20workflow\x20attempts','start','✔\x20Pull\x20complete','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','stdout','Total:\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','rows','getFullYear','skipValidation','.\x20Expected\x20format:\x20KEY=VALUE','workflow:clone','format','Show\x20tasks\x20for\x20an\x20attempt','getWorkflow','context','fileSize','renderTimeline','-\x20no\x20files\x20written','Error:\x20','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Usage:\x20tdx\x20wf\x20schedule\x20list\x20[project[.workflow]]\x20|\x20--schedule-id\x20<id>','run','executeDryRun','white','clear','\x20deleted','\x20sessions\x20','\x0a✔\x20Attempt\x20complete','Project\x20name\x20is\x20required','site','\x20disabled\x20(','floor','projectId','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','every','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','summary','\x0a⚠\x20Project\x20\x22','\x20from\x20session\x20','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','\x20\x20(no\x20tasks\x20found\x20in\x20workflow\x20definition)','\x20\x20Workflow:\x20','No\x20sessions\x20found\x20for:\x20','logs','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20-\x20','total','\x0aUpdate\x20existing\x20project\x20\x22','green','Task\x20graph:','planned','\x20is\x20not\x20a\x20directory','\x20\x20tdx\x20wf\x20use\x20<project>','getMinutes','limit','No\x20workflow\x20tdx.json\x20found','size','from','attempt:','workflow:timeline','(use\x20--limit\x20to\x20see\x20more)','session_id','cwd','taskName','\x22\x20to\x20new\x20project\x20\x22','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','Loading\x20sessions...','93210IQiXrC','list','Listing\x20workflows...','values','push','✔\x20Schedule\x20found','slice','some','path','generateSessionTimelineRows','existingProjectId','getSchedule','List\x20workflow\x20schedules','\x0aDry\x20run\x20-\x20no\x20project\x20created','\x0aError:','getDate','red','Key:\x20','execute','task','Deleting\x20project\x20','ICON_WIDTH','✔\x20Pushed\x20','fullName','window','isNewProject','includes','Disabling\x20schedule\x20#','No\x20sessions\x20with\x20timing\x20information','\x20modified','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','preparePushProject','pullProject','fs/promises','disabledAt','\x20next:\x20','description','Select\x20a\x20session\x20to\x20view\x20timeline:','workflow:schedule:disable','Status:\x20','Error:\x20Attempt\x20ID\x20is\x20required','Loading\x20workflows...','round','Setting\x20secret...','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','\x20\x20Console:\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','follow','\x0aClone\x20\x22','No\x20projects\x20match\x20pattern:\x20','Failed\x20to\x20fetch\x20attempt\x20data','updatedAt','workflow:schedule:enable','sessions','/sessions/','Loading\x20session...','Show\x20logs\x20for\x20a\x20workflow\x20attempt','navigateSessionsInteractive','Usage:\x20tdx\x20wf\x20use\x20<project>','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','22WEqGWO','now','Include\x20retried:\x20yes','max','Auto-selected\x20latest\x20session:\x20','verbose','running','startTime','enableSchedule','sessionTime','Fetching\x20schedule\x20#','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','(unknown)','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','Schedule:\x20backfill\x20runs\x20enabled\x20(--backfill)','Source\x20project:\x20','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','\x20\x20Next\x20run:\x20','\x22\x20with\x20new\x20revision?','Filter:\x20project=','data','Deleting\x20secret...','✔\x20Found\x20','Downloading\x20project\x20','Task\x20name:\x20','\x20(system)','Force:\x20yes','getMonth','listSecrets','Pull\x20workflow\x20project\x20to\x20local\x20folder','Attempt:\x20','executePushProject','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Resume\x20from:\x20','No\x20attempts\x20found','TASK_NAME_WIDTH','find','canceling','List\x20workflows','resumeFrom','config','download','Dry\x20run:\x20yes','MAX_TIMELINE_WIDTH','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20AI','Listing\x20workflow\x20sessions...','110349TBDYjP','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Project:\x20','\x20new','force','repeat','Pushing\x20project...','workflow:attempt','tasks','Fetching\x20log\x20files...','Upload\x20workflow\x20project\x20to\x20Treasure\x20AI\x20(digdag-style)','revision:\x20','\x20(use\x20--limit\x20to\x20show\x20more)',',\x20Workflow:\x20','Session\x20','json','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','\x20secrets...','\x0aApply\x20these\x20changes?','fileCount','No\x20sessions\x20found','\x20\x20Session\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','session:','Downloading\x20logs...','duration','yellow','Usage:\x20workflow:delete\x20<project-name-or-id>','Project\x20directory:\x20','Killing\x20attempt...','workflow','Invalid\x20format:\x20','workflowProject','join','Cloning\x20to\x20','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','\x20\x20Session\x20context\x20set\x20to:\x20','replace','retryAttemptName','substring','No\x20log\x20content\x20found','parseProjectWorkflowPattern','workflow:upload','param','Enabling\x20schedule\x20#','\x22?\x20This\x20cannot\x20be\x20undone.','state','workflowName','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','workflow:attempts','yes','listSchedules','Validation:\x20skipped','fromTask','Output\x20directory:\x20','getTime','2268fjSsIu','\x27\x20from\x20project\x20\x27','metadata','filter','map','columns','---\x20','toISOString','\x20\x20Project\x20ID:\x20','✔\x20Downloaded\x20','workflow:retry','LABEL_MIN_SPACING','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','tdx\x20wf\x20attempt\x20','workflow:kill','...','toLocaleString','📅\x20#','Show\x20specific\x20attempt\x20details','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','Files\x20to\x20upload:\x20','workflow:use','utf-8','workflows','split','tdx.json','Schedule\x20ID\x20is\x20required','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','set','bold','text','--schedule-id\x20cannot\x20be\x20combined\x20with\x20a\x20project.workflow\x20filter','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Session\x20time:\x20','List\x20workflow\x20execution\x20sessions','sys'];a59_0x5020=function(){return _0x13b5f9;};return a59_0x5020();}function formatElapsed(_0x5ef5d2){const _0x1651cb=a59_0x69291,_0x2b1c72=Math['floor'](_0x5ef5d2/0x3e8),_0x4bb6fd=Math[_0x1651cb(0x2c1)](_0x2b1c72/0x3c),_0xaee7d4=Math['floor'](_0x4bb6fd/0x3c),_0x423d61=Math[_0x1651cb(0x2c1)](_0xaee7d4/0x18);if(_0x423d61>0x0){const _0x4d6b9f=_0xaee7d4%0x18;return _0x4d6b9f>0x0?_0x423d61+'d\x20'+_0x4d6b9f+'h':_0x423d61+'d';}else{if(_0xaee7d4>0x0){const _0x475615=_0x4bb6fd%0x3c;return _0x475615>0x0?_0xaee7d4+'h\x20'+_0x475615+'m':_0xaee7d4+'h';}else{if(_0x4bb6fd>0x0){const _0x3cd501=_0x2b1c72%0x3c;return _0x3cd501>0x0?_0x4bb6fd+'m\x20'+_0x3cd501+'s':_0x4bb6fd+'m';}else return _0x2b1c72+'s';}}}function formatTimestamp(_0x48bfcf,_0x2bd311){const _0x113d22=a59_0x69291,_0x2d577e=new Date(_0x48bfcf),_0x2790c5=String(_0x2d577e[_0x113d22(0x258)]())['padStart'](0x2,'0'),_0x538b10=String(_0x2d577e[_0x113d22(0x2da)]())[_0x113d22(0x25e)](0x2,'0'),_0x174b72=_0x2790c5+':'+_0x538b10,_0x18f580=_0x2d577e[_0x113d22(0x2a9)]()===_0x2bd311[_0x113d22(0x2a9)]()&&_0x2d577e['getMonth']()===_0x2bd311[_0x113d22(0x169)]()&&_0x2d577e[_0x113d22(0x2f7)]()===_0x2bd311[_0x113d22(0x2f7)]();if(_0x18f580)return _0x174b72;else{const _0x43d334=String(_0x2d577e[_0x113d22(0x169)]()+0x1)[_0x113d22(0x25e)](0x2,'0'),_0x386e16=String(_0x2d577e[_0x113d22(0x2f7)]())[_0x113d22(0x25e)](0x2,'0');return _0x43d334+'-'+_0x386e16+'\x20'+_0x174b72;}}function formatDate(_0x9117d7){const _0x231352=a59_0x69291,_0x4651de=_0x9117d7[_0x231352(0x2a9)](),_0x2ae579=String(_0x9117d7[_0x231352(0x169)]()+0x1)[_0x231352(0x25e)](0x2,'0'),_0x5e29bd=String(_0x9117d7['getDate']())[_0x231352(0x25e)](0x2,'0');return _0x4651de+'-'+_0x2ae579+'-'+_0x5e29bd;}function getTaskStateIcon(_0x3464d5){const _0x582665={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x582665[_0x3464d5]||'⚪';}function getBarChar(_0x386942){const _0x39921f=a59_0x69291;return _0x386942===_0x39921f(0x274)||_0x386942===_0x39921f(0x237)?'×':'─';}function getBarColor(_0x4c0c88){const _0x22314d=a59_0x69291,_0x5e7ff1={'success':a59_0x34c7bd['green'],'error':a59_0x34c7bd[_0x22314d(0x2f8)],'group_error':a59_0x34c7bd[_0x22314d(0x2f8)],'running':a59_0x34c7bd[_0x22314d(0x269)],'blocked':a59_0x34c7bd[_0x22314d(0x196)],'planned':a59_0x34c7bd[_0x22314d(0x27d)],'canceling':a59_0x34c7bd[_0x22314d(0x196)]};return _0x5e7ff1[_0x4c0c88]||a59_0x34c7bd[_0x22314d(0x2b9)];}function parseTaskName(_0x495347){const _0x2cf043=a59_0x69291;let _0xea9f4e=_0x495347[_0x2cf043(0x1a1)](/^\++/,'');const _0x42fb74=_0xea9f4e[_0x2cf043(0x1cc)]('+'),_0x4d4071=_0x42fb74[_0x2cf043(0x204)]>0x1?_0x42fb74[_0x2cf043(0x204)]-0x2:0x0,_0x320ae4=_0x42fb74[_0x42fb74[_0x2cf043(0x204)]-0x1]||_0xea9f4e;return{'level':_0x4d4071,'name':'+'+_0x320ae4};}function a59_0x2c40(_0x2bac8e,_0x3d9b57){_0x2bac8e=_0x2bac8e-0x12d;const _0x50204f=a59_0x5020();let _0x2c4051=_0x50204f[_0x2bac8e];return _0x2c4051;}function truncateTaskName(_0xf25174,_0x5560c1){const _0x4c91f9=a59_0x69291,_0x2ee9bf=stringWidth(_0xf25174);if(_0x2ee9bf<=_0x5560c1)return _0xf25174;let _0x5d889e=_0xf25174;while(stringWidth(_0x5d889e+'…')>_0x5560c1&&_0x5d889e[_0x4c91f9(0x204)]>0x0){_0x5d889e=_0x5d889e[_0x4c91f9(0x2ee)](0x0,-0x1);}return _0x5d889e+'…';}function calculateTimeScale(_0x486b4f,_0x48ce43){const _0x3217ce=a59_0x69291;return{'startTime':_0x486b4f[_0x3217ce(0x2a2)],'endTime':_0x486b4f[_0x3217ce(0x293)],'durationMs':_0x486b4f[_0x3217ce(0x195)],'msPerChar':_0x486b4f[_0x3217ce(0x195)]/_0x48ce43};}function timeToPosition(_0x227710,_0x2aea15,_0x4a29eb){const _0xa204bf=a59_0x69291,_0x3cd907=_0x227710-_0x2aea15['startTime'],_0x3a2a86=Math['floor'](_0x3cd907/_0x2aea15[_0xa204bf(0x25c)]);return Math[_0xa204bf(0x14f)](0x0,Math[_0xa204bf(0x1f9)](_0x3a2a86,_0x4a29eb));}function renderTimeAxis(_0x29cd11,_0x5c7c6e){const _0x2129e1=a59_0x69291,_0x5c38d9=Math[_0x2129e1(0x1f9)](TIMELINE_CONFIG[_0x2129e1(0x22b)],Math[_0x2129e1(0x14f)](TIMELINE_CONFIG[_0x2129e1(0x27a)],Math[_0x2129e1(0x2c1)](_0x5c7c6e/TIMELINE_CONFIG[_0x2129e1(0x1f6)]))),_0x253855=_0x29cd11[_0x2129e1(0x1fb)]/(_0x5c38d9-0x1),_0x2e87ed=new Date(_0x29cd11[_0x2129e1(0x153)]),_0x22cc78=[];for(let _0x1e0c4a=0x0;_0x1e0c4a<_0x5c38d9;_0x1e0c4a++){const _0x29a585=_0x29cd11[_0x2129e1(0x153)]+_0x1e0c4a*_0x253855,_0x48a779=timeToPosition(_0x29a585,_0x29cd11,_0x5c7c6e),_0x1d496d=formatTimestamp(_0x29a585,_0x2e87ed);_0x22cc78[_0x2129e1(0x2ec)]({'pos':_0x48a779,'text':_0x1d496d});}const _0x2f8e15=new Array(_0x5c7c6e)[_0x2129e1(0x1e6)]('\x20');let _0x51b30c=-0x1;for(const {pos:_0x5f5bc2,text:_0x354a5}of _0x22cc78){let _0x5abb7e=Math[_0x2129e1(0x14f)](0x0,_0x5f5bc2-Math[_0x2129e1(0x2c1)](_0x354a5[_0x2129e1(0x204)]/0x2));_0x5abb7e<=_0x51b30c+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x5abb7e=_0x51b30c+TIMELINE_CONFIG[_0x2129e1(0x1bf)]+0x1);_0x5abb7e+_0x354a5[_0x2129e1(0x204)]>_0x5c7c6e&&(_0x5abb7e=_0x5c7c6e-_0x354a5[_0x2129e1(0x204)]);if(_0x5abb7e>=0x0&&_0x5abb7e+_0x354a5[_0x2129e1(0x204)]<=_0x5c7c6e&&_0x5abb7e>_0x51b30c){for(let _0x51479e=0x0;_0x51479e<_0x354a5[_0x2129e1(0x204)];_0x51479e++){_0x2f8e15[_0x5abb7e+_0x51479e]=_0x354a5[_0x51479e];}_0x51b30c=_0x5abb7e+_0x354a5[_0x2129e1(0x204)]-0x1;}}return _0x2f8e15[_0x2129e1(0x19d)]('');}function renderTaskRow(_0x5475b5,_0x4375c5,_0x455b9f,_0x2d8fce){const _0x41e62f=a59_0x69291,{level:_0x994f6e,name:_0x545de4}=parseTaskName(_0x5475b5[_0x41e62f(0x268)]),_0x324d05='\x20'[_0x41e62f(0x181)](_0x994f6e),_0x1ccb30=_0x5475b5['window']?'('+formatElapsed(_0x5475b5[_0x41e62f(0x300)][_0x41e62f(0x195)])+')':'',_0x1501d7=stringWidth(_0x1ccb30),_0x313beb=_0x994f6e*0x1,_0x45320e=_0x2d8fce-_0x313beb-_0x1501d7-0x1,_0x2edfeb=truncateTaskName(_0x545de4,_0x45320e),_0x2cc5e2=_0x324d05+_0x2edfeb,_0x75e6fc=stringWidth(_0x2cc5e2),_0x143441=_0x2d8fce-_0x75e6fc-_0x1501d7,_0x1772d1=_0x2cc5e2+'\x20'[_0x41e62f(0x181)](Math[_0x41e62f(0x14f)](0x1,_0x143441))+a59_0x34c7bd[_0x41e62f(0x27d)](_0x1ccb30),_0x291991=getTaskStateIcon(_0x5475b5[_0x41e62f(0x1aa)]),_0x47868a=new Array(_0x455b9f)[_0x41e62f(0x1e6)]('\x20');if(_0x5475b5[_0x41e62f(0x300)]){const _0xb6248b=timeToPosition(_0x5475b5[_0x41e62f(0x300)][_0x41e62f(0x2a2)],_0x4375c5,_0x455b9f),_0x42e72c=timeToPosition(_0x5475b5[_0x41e62f(0x300)][_0x41e62f(0x293)],_0x4375c5,_0x455b9f),_0x5bd1b8=getBarChar(_0x5475b5[_0x41e62f(0x1aa)]),_0x56a2fb=Math[_0x41e62f(0x14f)](_0xb6248b+0x1,_0x42e72c);for(let _0x59a410=_0xb6248b;_0x59a410<Math[_0x41e62f(0x1f9)](_0x56a2fb,_0x455b9f);_0x59a410++){_0x47868a[_0x59a410]=_0x5bd1b8;}}const _0x19cb9a=getBarColor(_0x5475b5[_0x41e62f(0x1aa)]),_0x7eab6a=_0x47868a['map'](_0x24730c=>_0x24730c==='\x20'?'\x20':_0x19cb9a(_0x24730c))[_0x41e62f(0x19d)]('');return _0x291991+'\x20'+_0x1772d1+'│'+_0x7eab6a+'│';}function calculateStats(_0xfdb242){const _0x2f1aaf=a59_0x69291,_0x165184={'total':_0xfdb242[_0x2f1aaf(0x204)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0xe7beb0 of _0xfdb242){if(_0xe7beb0[_0x2f1aaf(0x1aa)]===_0x2f1aaf(0x210))_0x165184['success']++;else{if(_0xe7beb0[_0x2f1aaf(0x1aa)]==='error'||_0xe7beb0[_0x2f1aaf(0x1aa)]===_0x2f1aaf(0x237))_0x165184[_0x2f1aaf(0x274)]++;else _0xe7beb0['state']===_0x2f1aaf(0x152)?_0x165184['running']++:_0x165184[_0x2f1aaf(0x26a)]++;}}return _0x165184;}function formatStats(_0x5b0bea){const _0xa78f45=a59_0x69291;return[_0xa78f45(0x2a6)+_0x5b0bea[_0xa78f45(0x2d3)],'✅\x20'+_0x5b0bea[_0xa78f45(0x210)],'❌\x20'+_0x5b0bea['error'],_0xa78f45(0x28f)+_0x5b0bea[_0xa78f45(0x152)],'⏳\x20'+_0x5b0bea[_0xa78f45(0x26a)]][_0xa78f45(0x19d)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x2e0);[a59_0x69291(0x134)]=a59_0x69291(0x158);async[a59_0x69291(0x2fa)](_0x599ad7){const _0x1b79dc=a59_0x69291,{options:_0x402932,args:_0x497baf,tdx:_0x4db04b}=_0x599ad7;let _0x36188b,_0x503e4c,_0x54b5ba=![];if(_0x497baf[0x0]){if(_0x497baf[0x0][_0x1b79dc(0x302)]('.')){const _0x5d11f8=this[_0x1b79dc(0x1a5)](_0x497baf,_0x402932);if(!_0x5d11f8)return 0x1;_0x36188b=_0x5d11f8[_0x1b79dc(0x26c)],_0x503e4c=_0x5d11f8[_0x1b79dc(0x1ab)];}else{_0x503e4c=_0x497baf[0x0],_0x36188b=_0x402932['workflowProject'];if(!_0x36188b)return console[_0x1b79dc(0x274)](a59_0x34c7bd[_0x1b79dc(0x2f8)](_0x1b79dc(0x287)),_0x1b79dc(0x232)),0x1;_0x54b5ba=!![];}}else{const _0x9e6889=this[_0x1b79dc(0x1a5)](_0x497baf,_0x402932);if(!_0x9e6889)return 0x1;_0x36188b=_0x9e6889[_0x1b79dc(0x26c)],_0x503e4c=_0x9e6889[_0x1b79dc(0x1ab)];}if(_0x402932['verbose']){if(_0x36188b&&_0x503e4c)console['error'](_0x1b79dc(0x21a)+_0x36188b+'.'+_0x503e4c);else _0x36188b&&console[_0x1b79dc(0x274)](_0x1b79dc(0x161)+_0x36188b);}const _0x7aeef0=_0x402932[_0x1b79dc(0x21b)],_0x213a85=_0x402932['sessionId'];if(_0x7aeef0){_0x213a85&&console['error'](a59_0x34c7bd[_0x1b79dc(0x196)]('Warning:'),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x14dcb9=_0x402932[_0x1b79dc(0x13f)];return _0x14dcb9?await this[_0x1b79dc(0x284)](_0x599ad7,_0x7aeef0):await this['renderSingleTimeline'](_0x599ad7,_0x7aeef0,_0x402932),0x0;}if(_0x213a85){const _0x5e0a8a=await withSpinner(_0x1b79dc(0x147),()=>_0x4db04b[_0x1b79dc(0x19a)]['sessions']({'projectName':_0x36188b,'workflowName':_0x503e4c,'limit':0x64}),{'verbose':_0x402932[_0x1b79dc(0x151)]}),_0x1907e1=_0x5e0a8a['data'][_0x1b79dc(0x172)](_0x288ca5=>_0x288ca5['id']===_0x213a85);if(!_0x1907e1)return console['error'](a59_0x34c7bd[_0x1b79dc(0x2f8)](_0x1b79dc(0x287)),'Session\x20not\x20found:\x20'+_0x213a85),0x1;if(!_0x1907e1['lastAttempt']?.['id'])return console[_0x1b79dc(0x274)](a59_0x34c7bd[_0x1b79dc(0x2f8)]('Error:'),_0x1b79dc(0x18a)+_0x213a85+_0x1b79dc(0x29e)),0x1;const _0xb6f395=_0x1907e1['lastAttempt']['id'];_0x402932['verbose']&&console[_0x1b79dc(0x274)](_0x1b79dc(0x1f3)+_0xb6f395+_0x1b79dc(0x2ca)+_0x213a85);const _0x7c4511=_0x402932[_0x1b79dc(0x13f)];return _0x7c4511?await this[_0x1b79dc(0x284)](_0x599ad7,_0xb6f395):await this['renderSingleTimeline'](_0x599ad7,_0xb6f395,_0x402932),0x0;}const _0x6d3c83=await withSpinner(_0x1b79dc(0x2e7),()=>_0x4db04b[_0x1b79dc(0x19a)][_0x1b79dc(0x145)]({'projectName':_0x36188b,'workflowName':_0x503e4c,'limit':_0x402932[_0x1b79dc(0x2db)]||0x32}),{'verbose':_0x402932['verbose']}),_0x1d7cd7=_0x6d3c83['data'];if(_0x1d7cd7[_0x1b79dc(0x204)]===0x0){if(_0x36188b&&_0x503e4c)console[_0x1b79dc(0x274)]('No\x20sessions\x20found\x20for:\x20'+_0x36188b+'.'+_0x503e4c);else _0x36188b?console[_0x1b79dc(0x274)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x36188b):(console['error']('No\x20workflow\x20sessions\x20found'),console[_0x1b79dc(0x274)](a59_0x34c7bd[_0x1b79dc(0x27d)]('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x1d7cd7[_0x1b79dc(0x279)]((_0x231d52,_0x4dca1c)=>{const _0x137b1c=_0x1b79dc,_0x196fd6=_0x231d52['sessionTime']||'',_0x54740d=_0x4dca1c['sessionTime']||'';return _0x54740d[_0x137b1c(0x286)](_0x196fd6);});if(_0x402932[_0x1b79dc(0x18b)]||_0x402932[_0x1b79dc(0x1d8)])return await handleSDKOutput(_0x1d7cd7,_0x402932),0x0;let _0x19c5f9;if(_0x54b5ba){const _0x480557=_0x1d7cd7[0x0];if(!_0x480557[_0x1b79dc(0x29f)]?.['id'])return console['error']('Latest\x20session\x20has\x20no\x20attempt'),0x0;_0x19c5f9=_0x480557[_0x1b79dc(0x29f)]['id'],_0x402932[_0x1b79dc(0x151)]&&console[_0x1b79dc(0x274)](_0x1b79dc(0x150)+_0x480557[_0x1b79dc(0x155)]);}else{const _0x12d6c2=_0x1d7cd7[_0x1b79dc(0x1b8)](_0x1295b7=>{const _0x12989c=_0x1b79dc,_0x3d2af9=getAttemptStatusDisplay(_0x1295b7[_0x12989c(0x29f)]);return{'title':_0x1295b7[_0x12989c(0x235)]?.[_0x12989c(0x268)]+'.'+_0x1295b7[_0x12989c(0x19a)]?.[_0x12989c(0x268)]+'\x20-\x20'+_0x1295b7[_0x12989c(0x155)]+'\x20'+_0x3d2af9[_0x12989c(0x24b)],'value':_0x1295b7[_0x12989c(0x29f)]?.['id']||'','description':_0x3d2af9[_0x12989c(0x1d2)]};}),_0xd2b8a8=await a59_0x3da1fb({'type':'select','name':_0x1b79dc(0x21b),'message':_0x1b79dc(0x135),'choices':_0x12d6c2['filter'](_0x134930=>_0x134930['value']!=='')});if(!_0xd2b8a8[_0x1b79dc(0x21b)])return 0x0;_0x19c5f9=_0xd2b8a8['attemptId'];}const _0x36a6dc=_0x402932[_0x1b79dc(0x13f)];return _0x36a6dc?await this['pollTimeline'](_0x599ad7,_0x19c5f9):await this[_0x1b79dc(0x21e)](_0x599ad7,_0x19c5f9,_0x402932),0x0;}async[a59_0x69291(0x21e)](_0x1b28cd,_0x292d76,_0x25f7ea){const _0x36ad24=a59_0x69291,{tdx:_0x4b00ac}=_0x1b28cd;let _0x512ea9,_0x101041;try{[_0x512ea9,_0x101041]=await Promise[_0x36ad24(0x1eb)]([_0x4b00ac[_0x36ad24(0x19a)][_0x36ad24(0x217)](_0x292d76),_0x4b00ac['workflow'][_0x36ad24(0x184)](_0x292d76,![])]);}catch(_0x4fcd85){console[_0x36ad24(0x274)](a59_0x34c7bd['red'](_0x36ad24(0x142)));_0x25f7ea[_0x36ad24(0x151)]&&console[_0x36ad24(0x274)](_0x4fcd85);throw _0x4fcd85;}if(_0x25f7ea[_0x36ad24(0x18b)]||_0x25f7ea[_0x36ad24(0x1d8)]){const _0x1f66ed=this[_0x36ad24(0x1e2)](_0x512ea9,_0x101041);await handleSDKOutput([_0x1f66ed],_0x25f7ea);return;}const _0x88fcb1=_0x4b00ac[_0x36ad24(0x2b0)][_0x36ad24(0x2bf)],_0x40c53a=this[_0x36ad24(0x2b2)](_0x512ea9,_0x101041,_0x88fcb1);console[_0x36ad24(0x296)](_0x40c53a);}async[a59_0x69291(0x284)](_0x58080a,_0x3844b5){const _0x3eafac=a59_0x69291,{tdx:_0x3d8904}=_0x58080a,_0x3775f6=TIMELINE_CONFIG[_0x3eafac(0x262)],_0x588449=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x308301=0x0;while(_0x308301<_0x588449){process['stdout']['isTTY']&&process[_0x3eafac(0x2a5)]['write']('\x1Bc');let _0x1e8467,_0x1c83d3;try{[_0x1e8467,_0x1c83d3]=await Promise[_0x3eafac(0x1eb)]([_0x3d8904[_0x3eafac(0x19a)][_0x3eafac(0x217)](_0x3844b5),_0x3d8904[_0x3eafac(0x19a)][_0x3eafac(0x184)](_0x3844b5,![])]);}catch(_0x3c6946){console[_0x3eafac(0x274)](a59_0x34c7bd[_0x3eafac(0x2f8)](_0x3eafac(0x157)));_0x308301>0x0&&console[_0x3eafac(0x274)](a59_0x34c7bd[_0x3eafac(0x27d)](_0x3eafac(0x19f)+_0x308301));throw _0x3c6946;}const _0x6bcddd=_0x3d8904[_0x3eafac(0x2b0)]['site'],_0x2e4926=this[_0x3eafac(0x2b2)](_0x1e8467,_0x1c83d3,_0x6bcddd);console[_0x3eafac(0x296)](_0x2e4926);const _0x29df27=_0x1e8467[_0x3eafac(0x28b)]&&_0x1c83d3[_0x3eafac(0x2c4)](_0x54db7c=>_0x54db7c['state']!=='running'&&_0x54db7c[_0x3eafac(0x1aa)]!==_0x3eafac(0x2d7));if(_0x29df27){console['error'](a59_0x34c7bd[_0x3eafac(0x2d5)](_0x3eafac(0x2bd)));break;}console[_0x3eafac(0x274)](a59_0x34c7bd[_0x3eafac(0x27d)](_0x3eafac(0x1f5)+_0x308301*0x2+_0x3eafac(0x13e))),await new Promise(_0x42cd26=>setTimeout(_0x42cd26,_0x3775f6)),_0x308301++;}_0x308301>=_0x588449&&console['error'](a59_0x34c7bd[_0x3eafac(0x196)](_0x3eafac(0x17d)));}[a59_0x69291(0x2b2)](_0x10d42a,_0x3d47e7,_0x5ee4e3){const _0x293ddb=a59_0x69291,_0x11a09d=[],_0x1f47a8=TIMELINE_CONFIG[_0x293ddb(0x171)],_0x414696=0x5,_0x29a79d=process['stdout'][_0x293ddb(0x1b9)]||0x78,_0x3f19b3=_0x29a79d-_0x1f47a8-_0x414696,_0x14ce3c=Math[_0x293ddb(0x14f)](TIMELINE_CONFIG['MIN_TIMELINE_WIDTH'],Math[_0x293ddb(0x1f9)](_0x3f19b3,TIMELINE_CONFIG[_0x293ddb(0x179)])),_0x147219=new Date(_0x10d42a[_0x293ddb(0x1f8)])['getTime'](),_0x3effe8=_0x10d42a['finishedAt']?new Date(_0x10d42a['finishedAt'])[_0x293ddb(0x1b3)]():Date[_0x293ddb(0x14d)](),_0x1b1d5d={'start':_0x147219,'end':_0x3effe8,'duration':_0x3effe8-_0x147219},_0xf7752e=new Map(),_0x4aaec4=[];for(const _0x530942 of _0x3d47e7){if(_0x530942['startedAt']){const _0x4e05a0=new Date(_0x530942[_0x293ddb(0x26e)])['getTime'](),_0x410d80=_0x530942['updatedAt']?new Date(_0x530942[_0x293ddb(0x143)])['getTime']():Date[_0x293ddb(0x14d)](),_0x2f351d={'start':_0x4e05a0,'end':_0x410d80,'duration':_0x410d80-_0x4e05a0};_0xf7752e[_0x293ddb(0x1d0)](_0x530942['id'],_0x2f351d),_0x4aaec4[_0x293ddb(0x2ec)]({'name':_0x530942['fullName'],'state':_0x530942['state']||'unknown','window':_0x2f351d});}else _0x4aaec4['push']({'name':_0x530942['fullName'],'state':_0x530942[_0x293ddb(0x1aa)]||_0x293ddb(0x2d7),'window':undefined});}_0x4aaec4[_0x293ddb(0x279)]((_0x5890c9,_0x585b8a)=>{const _0x23687d=_0x293ddb;if(!_0x5890c9['window'])return 0x1;if(!_0x585b8a['window'])return-0x1;return _0x5890c9[_0x23687d(0x300)][_0x23687d(0x2a2)]-_0x585b8a[_0x23687d(0x300)][_0x23687d(0x2a2)];});const _0x1907cb=_0x4aaec4[_0x293ddb(0x204)],_0x417db8=_0x1907cb>TIMELINE_CONFIG[_0x293ddb(0x1fc)];_0x417db8&&_0x4aaec4['splice'](TIMELINE_CONFIG[_0x293ddb(0x1fc)]);const _0x24f952=calculateTimeScale(_0x1b1d5d,_0x14ce3c),_0x379f19=_0x10d42a[_0x293ddb(0x28b)]?_0x10d42a[_0x293ddb(0x210)]?a59_0x34c7bd[_0x293ddb(0x2d5)](_0x293ddb(0x210)):a59_0x34c7bd['red'](_0x293ddb(0x274)):a59_0x34c7bd[_0x293ddb(0x269)](_0x293ddb(0x152)),_0x327d97=_0x10d42a['project']?.['id'],_0x276888=_0x10d42a[_0x293ddb(0x220)];let _0x1a8bf6;if(_0x327d97&&_0x276888){const _0x1b1635=getWorkflowAttemptUrl(_0x5ee4e3,_0x327d97,_0x276888,_0x10d42a['id']);_0x1a8bf6=hyperlink(a59_0x34c7bd[_0x293ddb(0x27d)](_0x10d42a['id']),_0x1b1635);}else _0x1a8bf6=a59_0x34c7bd['dim'](_0x10d42a['id']);_0x11a09d[_0x293ddb(0x2ec)](_0x293ddb(0x16c)+_0x1a8bf6+_0x293ddb(0x2d2)+_0x379f19+'\x20-\x20'+formatElapsed(_0x1b1d5d['duration']));if(_0x4aaec4[_0x293ddb(0x204)]>0x0){const _0x497403=renderTimeAxis(_0x24f952,_0x14ce3c),_0x41ccfe=new Date(_0x1b1d5d[_0x293ddb(0x2a2)]),_0x47e2dc=formatDate(_0x41ccfe),_0x132e43=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG['ICON_SPACING']+_0x1f47a8,_0x57c976=_0x47e2dc['padStart'](_0x132e43),_0x5803be=a59_0x34c7bd[_0x293ddb(0x27d)](_0x57c976);_0x11a09d[_0x293ddb(0x2ec)](_0x5803be+'\x20'+_0x497403);for(const _0x18b938 of _0x4aaec4){_0x11a09d[_0x293ddb(0x2ec)](renderTaskRow(_0x18b938,_0x24f952,_0x14ce3c,_0x1f47a8));}const _0x35e4e3=calculateStats(_0x4aaec4);_0x11a09d[_0x293ddb(0x2ec)](formatStats(_0x35e4e3)),_0x417db8&&_0x11a09d[_0x293ddb(0x2ec)](a59_0x34c7bd['yellow'](_0x293ddb(0x271)+TIMELINE_CONFIG[_0x293ddb(0x1fc)]+'\x20of\x20'+_0x1907cb+'\x20tasks')),_0x11a09d[_0x293ddb(0x2ec)](''),_0x11a09d[_0x293ddb(0x2ec)](a59_0x34c7bd[_0x293ddb(0x27d)](_0x293ddb(0x25f))+(_0x293ddb(0x1c1)+_0x10d42a['id']+'\x20logs')+a59_0x34c7bd[_0x293ddb(0x27d)]('\x20to\x20see\x20detailed\x20logs'));}else _0x11a09d['push']('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x11a09d[_0x293ddb(0x19d)]('\x0a');}[a59_0x69291(0x1e2)](_0x3dd9bb,_0x5010d3){const _0x4a0e97=a59_0x69291,_0x1968d1=new Date(_0x3dd9bb[_0x4a0e97(0x1f8)])['getTime'](),_0x4acc90=_0x3dd9bb['finishedAt']?new Date(_0x3dd9bb[_0x4a0e97(0x265)])[_0x4a0e97(0x1b3)]():Date[_0x4a0e97(0x14d)](),_0x20bae9=_0x4acc90-_0x1968d1,_0x5ba3ef=[];for(const _0x258d77 of _0x5010d3){if(_0x258d77[_0x4a0e97(0x26e)]){const _0x1fde96=new Date(_0x258d77[_0x4a0e97(0x26e)])[_0x4a0e97(0x1b3)](),_0x42eb15=_0x258d77[_0x4a0e97(0x143)]?new Date(_0x258d77[_0x4a0e97(0x143)])[_0x4a0e97(0x1b3)]():Date['now']();_0x5ba3ef[_0x4a0e97(0x2ec)]({'name':_0x258d77['fullName'],'state':_0x258d77[_0x4a0e97(0x1aa)]||'unknown','window':{'start':_0x1fde96,'end':_0x42eb15,'duration':_0x42eb15-_0x1fde96}});}else _0x5ba3ef['push']({'name':_0x258d77[_0x4a0e97(0x2ff)],'state':_0x258d77[_0x4a0e97(0x1aa)]||_0x4a0e97(0x2d7),'window':undefined});}const _0x23e821=calculateStats(_0x5ba3ef);return{'attempt':{'id':_0x3dd9bb['id'],'status':_0x3dd9bb['done']?_0x3dd9bb[_0x4a0e97(0x210)]?_0x4a0e97(0x210):_0x4a0e97(0x274):_0x4a0e97(0x152),'createdAt':_0x3dd9bb[_0x4a0e97(0x1f8)],'finishedAt':_0x3dd9bb[_0x4a0e97(0x265)],'duration_ms':_0x20bae9},'tasks':_0x5ba3ef[_0x4a0e97(0x1b8)](_0x5d1c8e=>({'name':_0x5d1c8e['name'],'state':_0x5d1c8e[_0x4a0e97(0x1aa)],'startedAt':_0x5d1c8e[_0x4a0e97(0x300)]?new Date(_0x5d1c8e[_0x4a0e97(0x300)][_0x4a0e97(0x2a2)])['toISOString']():null,'updatedAt':_0x5d1c8e[_0x4a0e97(0x300)]?new Date(_0x5d1c8e[_0x4a0e97(0x300)]['end'])['toISOString']():null,'duration_ms':_0x5d1c8e['window']?.['duration']||null})),'stats':_0x23e821};}}function formatScheduleLine(_0x47f96c){const _0x1fe9fb=a59_0x69291,_0x4195eb=_0x47f96c[_0x1fe9fb(0x132)]?a59_0x34c7bd['yellow']('\x20(disabled)'):'',_0x5cd6df=_0x47f96c['project']?.['name']?a59_0x34c7bd[_0x1fe9fb(0x27d)]('\x20['+_0x47f96c[_0x1fe9fb(0x235)][_0x1fe9fb(0x268)]+']'):'',_0x3d7c93=_0x47f96c[_0x1fe9fb(0x239)]?a59_0x34c7bd[_0x1fe9fb(0x27d)](_0x1fe9fb(0x133)+new Date(_0x47f96c[_0x1fe9fb(0x239)])[_0x1fe9fb(0x1c4)]()):'';return _0x1fe9fb(0x1c5)+_0x47f96c['id']+'\x20'+(_0x47f96c['workflow']?.[_0x1fe9fb(0x268)]||_0x1fe9fb(0x159))+_0x5cd6df+_0x4195eb+_0x3d7c93;}export class WorkflowSchedulesCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x225);[a59_0x69291(0x134)]=a59_0x69291(0x2f4);async[a59_0x69291(0x2fa)](_0x3ce257){const _0x455f5c=a59_0x69291,{options:_0x254bee,args:_0x33d165,tdx:_0x139874}=_0x3ce257,{scheduleId:_0xa021c2}=_0x254bee;if(_0xa021c2&&_0x33d165[0x0])return console[_0x455f5c(0x274)](a59_0x34c7bd[_0x455f5c(0x2f8)](_0x455f5c(0x287)),_0x455f5c(0x1d3)),console[_0x455f5c(0x274)](a59_0x34c7bd[_0x455f5c(0x27d)](_0x455f5c(0x2b6))),0x1;if(_0xa021c2){const _0x4fa854=await withSpinner(_0x455f5c(0x156)+_0xa021c2+'...',()=>_0x139874[_0x455f5c(0x19a)][_0x455f5c(0x2f3)](_0xa021c2),{'verbose':_0x254bee[_0x455f5c(0x151)]}),_0xc446cc=_0x4fa854['data'];return isStructuredFormat(_0x254bee)?await handleSingleObjectOutput(_0xc446cc,_0x254bee):(console[_0x455f5c(0x274)](_0x455f5c(0x2ed)),console[_0x455f5c(0x296)](formatScheduleLine(_0xc446cc))),0x0;}const _0x3291a2=this[_0x455f5c(0x1a5)](_0x33d165,_0x254bee);if(!_0x3291a2)return 0x1;const {projectName:_0x55fb78,workflowName:_0x46f3dc}=_0x3291a2,_0x11adb4=_0x55fb78?'\x27'+_0x55fb78+(_0x46f3dc?'.'+_0x46f3dc:'')+'\x27':undefined,_0x249f38=await withSpinner(_0x11adb4?'Listing\x20schedules\x20for\x20'+_0x11adb4+_0x455f5c(0x1c3):_0x455f5c(0x23d),()=>_0x55fb78?_0x139874['workflow']['listProjectSchedules'](_0x55fb78,{'workflow':_0x46f3dc,'limit':_0x254bee[_0x455f5c(0x2db)]}):_0x139874[_0x455f5c(0x19a)][_0x455f5c(0x1af)]({'limit':_0x254bee[_0x455f5c(0x2db)]}),{'verbose':_0x254bee[_0x455f5c(0x151)]}),_0x45f1d1=_0x249f38['data'],_0x95bccb=_0x254bee[_0x455f5c(0x2db)]&&_0x45f1d1[_0x455f5c(0x204)]>=_0x254bee[_0x455f5c(0x2db)]?a59_0x34c7bd[_0x455f5c(0x27d)](_0x455f5c(0x263)):'';console[_0x455f5c(0x274)](_0x455f5c(0x164)+_0x45f1d1[_0x455f5c(0x204)]+'\x20schedule'+(_0x45f1d1[_0x455f5c(0x204)]!==0x1?'s':'')+_0x95bccb);if(isStructuredFormat(_0x254bee))await handleSDKOutput(_0x45f1d1,_0x254bee);else{if(_0x45f1d1['length']===0x0)console[_0x455f5c(0x296)](_0x455f5c(0x257));else for(const _0x5cf9b1 of _0x45f1d1){console[_0x455f5c(0x296)](formatScheduleLine(_0x5cf9b1));}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x144);[a59_0x69291(0x134)]='Enable\x20a\x20workflow\x20schedule';async[a59_0x69291(0x2fa)](_0x5407c2){const _0x530b5e=a59_0x69291,{options:_0xc3e534,args:_0xd5ddb3,tdx:_0x4091cc}=_0x5407c2,_0x47b98d=_0xd5ddb3[0x0];if(!_0x47b98d)return console[_0x530b5e(0x274)](a59_0x34c7bd['red'](_0x530b5e(0x287)),_0x530b5e(0x1ce)),console[_0x530b5e(0x274)](a59_0x34c7bd['dim'](_0x530b5e(0x12e))),console[_0x530b5e(0x274)](a59_0x34c7bd[_0x530b5e(0x27d)](_0x530b5e(0x1f2))),0x1;const {backfill:_0x555b7c,nextTime:_0x42321e}=_0xc3e534,_0x1f78af={};if(_0x555b7c!==undefined)_0x1f78af[_0x530b5e(0x208)]=!_0x555b7c;if(_0x42321e!==undefined)_0x1f78af['nextTime']=_0x42321e;const _0x21d8ee=await withSpinner(_0x530b5e(0x1a8)+_0x47b98d+_0x530b5e(0x1c3),()=>_0x4091cc[_0x530b5e(0x19a)][_0x530b5e(0x154)](_0x47b98d,_0x1f78af),{'verbose':_0xc3e534[_0x530b5e(0x151)]}),_0x48ae01=_0x21d8ee[_0x530b5e(0x162)];return isStructuredFormat(_0xc3e534)?await handleSingleObjectOutput(_0x48ae01,_0xc3e534):(console[_0x530b5e(0x296)](_0x530b5e(0x20f)+_0x47b98d+_0x530b5e(0x1ed)+(_0x48ae01[_0x530b5e(0x19a)]?.[_0x530b5e(0x268)]||'unknown')+')'),_0x48ae01[_0x530b5e(0x239)]&&console[_0x530b5e(0x296)](a59_0x34c7bd[_0x530b5e(0x27d)](_0x530b5e(0x15f)+new Date(_0x48ae01[_0x530b5e(0x239)])[_0x530b5e(0x1c4)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x136);[a59_0x69291(0x134)]='Disable\x20a\x20workflow\x20schedule';async[a59_0x69291(0x2fa)](_0xb3313a){const _0x2c1892=a59_0x69291,{options:_0x4e33a4,args:_0x46ff91,tdx:_0x1408e6}=_0xb3313a,_0x136442=_0x46ff91[0x0];if(!_0x136442)return console[_0x2c1892(0x274)](a59_0x34c7bd[_0x2c1892(0x2f8)]('Error:'),'Schedule\x20ID\x20is\x20required'),console[_0x2c1892(0x274)](a59_0x34c7bd['dim'](_0x2c1892(0x2c3))),console['error'](a59_0x34c7bd[_0x2c1892(0x27d)](_0x2c1892(0x1f2))),0x1;const _0x4004fa=await withSpinner(_0x2c1892(0x303)+_0x136442+_0x2c1892(0x1c3),()=>_0x1408e6[_0x2c1892(0x19a)][_0x2c1892(0x2a0)](_0x136442),{'verbose':_0x4e33a4[_0x2c1892(0x151)]}),_0x1830ac=_0x4004fa[_0x2c1892(0x162)];return isStructuredFormat(_0x4e33a4)?await handleSingleObjectOutput(_0x1830ac,_0x4e33a4):console[_0x2c1892(0x296)]('✔\x20Schedule\x20#'+_0x136442+_0x2c1892(0x2c0)+(_0x1830ac[_0x2c1892(0x19a)]?.[_0x2c1892(0x268)]||_0x2c1892(0x253))+')'),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1d67c0,_0x4bf81f){const _0x637e4a=a60_0xd125,_0x5487ae=_0x1d67c0();while(!![]){try{const _0xff6d9e=-parseInt(_0x637e4a(0x163))/0x1+-parseInt(_0x637e4a(0x159))/0x2*(-parseInt(_0x637e4a(0x15b))/0x3)+parseInt(_0x637e4a(0x168))/0x4*(-parseInt(_0x637e4a(0x15d))/0x5)+-parseInt(_0x637e4a(0x15f))/0x6*(-parseInt(_0x637e4a(0x15a))/0x7)+-parseInt(_0x637e4a(0x165))/0x8+parseInt(_0x637e4a(0x15e))/0x9*(-parseInt(_0x637e4a(0x158))/0xa)+-parseInt(_0x637e4a(0x161))/0xb*(-parseInt(_0x637e4a(0x16a))/0xc);if(_0xff6d9e===_0x4bf81f)break;else _0x5487ae['push'](_0x5487ae['shift']());}catch(_0x39ff8b){_0x5487ae['push'](_0x5487ae['shift']());}}}(a60_0x3cb4,0xb7a0a));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x5b4e2d=a60_0xd125,_0x47d06f=getVersion(),_0x43fe26=platform(),_0x5bb0f6=process[_0x5b4e2d(0x166)][_0x5b4e2d(0x16b)]('v','');return _0x5b4e2d(0x160)+_0x47d06f+'\x20('+_0x43fe26+_0x5b4e2d(0x167)+_0x5bb0f6+')';}export function getAuthHeaders(_0x55fe59,_0x15007a,_0x1b9620){const _0xbff96d=a60_0xd125,_0x2b9d94=getVersion(),_0x57ef43={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x2b9d94};if(_0x1b9620)_0x57ef43['Authorization']=_0xbff96d(0x169)+_0x1b9620;else _0x15007a&&(_0x57ef43['Authorization']=_0xbff96d(0x157)+_0x15007a);return _0x57ef43;}export function toHeaderRecord(_0xf683a2){const _0x453832=a60_0xd125,_0x5f49db={};for(const [_0x18e477,_0x219230]of Object[_0x453832(0x164)](_0xf683a2)){_0x219230!==undefined&&(_0x5f49db[_0x18e477]=_0x219230);}return _0x5f49db;}export function getTrinoHeaders(_0x4e63ef,_0x2ec458,_0x127bbb){const _0x1f3265=a60_0xd125,_0x508318=getAuthHeaders(_0x4e63ef),_0x56bf1e=toHeaderRecord(_0x508318);if(_0x127bbb)_0x56bf1e[_0x1f3265(0x162)]=_0x1f3265(0x169)+_0x127bbb;else _0x2ec458&&(_0x56bf1e[_0x1f3265(0x15c)]=_0x2ec458);return _0x56bf1e;}function a60_0xd125(_0x19de45,_0x5b847f){_0x19de45=_0x19de45-0x157;const _0x3cb4e3=a60_0x3cb4();let _0xd1250b=_0x3cb4e3[_0x19de45];return _0xd1250b;}export function hasAPIKey(_0x18cfdd){const _0x54c19=a60_0xd125,_0x32d86a=getAPIKey();return _0x32d86a!==undefined&&_0x32d86a[_0x54c19(0x16c)]>0x0;}function a60_0x3cb4(){const _0x330443=['35001696kAjjPP','replace','length','TD1\x20','20qCnNvq','34tijlaZ','7zYscUG','107634cGInWR','X-Trino-User','5DPNlES','6603345UlXrom','2783142yArtxY','tdx/','11XZjzRX','Authorization','736649jMjxYI','entries','5055200MmoaSL','version',';\x20node/','1609976jKmuUS','Bearer\x20'];a60_0x3cb4=function(){return _0x330443;};return a60_0x3cb4();}
|