@treasuredata/tdx 2026.8.1 → 2026.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-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.js +1 -1
- package/dist/sdk/cas/cas-api-client.d.ts +9 -3
- package/dist/sdk/cas/cas-api-client.d.ts.map +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-api-client.js.map +1 -1
- package/dist/sdk/cas/cas-audience-schema.d.ts +2 -0
- package/dist/sdk/cas/cas-audience-schema.d.ts.map +1 -1
- package/dist/sdk/cas/cas-audience-schema.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.js.map +1 -1
- package/dist/sdk/cas/cas-audience-validator.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.d.ts.map +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js.map +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.d.ts +10 -0
- package/dist/sdk/cas/index.d.ts.map +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/index.js.map +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.d.ts.map +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js.map +1 -1
- package/dist/sdk/cas/types.d.ts +2 -0
- package/dist/sdk/cas/types.d.ts.map +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/cas.d.ts +4 -0
- package/dist/sdk/types/cas.d.ts.map +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_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;}}
|
|
1
|
+
const a59_0x34b1fc=a59_0x2d50;(function(_0x5518b3,_0x55a372){const _0x1f7229=a59_0x2d50,_0x4a19e9=_0x5518b3();while(!![]){try{const _0x55d555=-parseInt(_0x1f7229(0x1cb))/0x1+parseInt(_0x1f7229(0xb3))/0x2*(parseInt(_0x1f7229(0x1c9))/0x3)+-parseInt(_0x1f7229(0x231))/0x4*(-parseInt(_0x1f7229(0x1cf))/0x5)+-parseInt(_0x1f7229(0xcf))/0x6+parseInt(_0x1f7229(0x8a))/0x7+-parseInt(_0x1f7229(0x206))/0x8+parseInt(_0x1f7229(0x188))/0x9*(parseInt(_0x1f7229(0x222))/0xa);if(_0x55d555===_0x55a372)break;else _0x4a19e9['push'](_0x4a19e9['shift']());}catch(_0x54f1ca){_0x4a19e9['push'](_0x4a19e9['shift']());}}}(a59_0x314e,0x7256f));import a59_0x564dd3 from'chalk';import{existsSync}from'fs';import a59_0x156221 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_0x17b23b from'prompts';function getAttemptStatusDisplay(_0x424832){const _0x4d47d1=a59_0x2d50;if(!_0x424832)return{'icon':'⏳','text':''};const {done:_0x150e59,success:_0x840346,cancelRequested:_0x3c88ae}=_0x424832;if(!_0x150e59)return _0x3c88ae?{'icon':'🛑','text':a59_0x564dd3[_0x4d47d1(0x204)](_0x4d47d1(0x247))}:{'icon':'🔄','text':a59_0x564dd3[_0x4d47d1(0x1f6)](_0x4d47d1(0x6e))};if(_0x840346)return{'icon':'✅','text':a59_0x564dd3[_0x4d47d1(0xcd)](_0x4d47d1(0x1b7))};return{'icon':'❌','text':a59_0x564dd3[_0x4d47d1(0x1a4)](_0x4d47d1(0x23a))};}export class WorkflowBaseCommand extends BaseCommand{[a59_0x34b1fc(0xd0)](_0x28b875,_0x985310,_0xabdeb3=0x0){const _0x58bd1b=a59_0x34b1fc;return _0x28b875[_0xabdeb3]||_0x985310[_0x58bd1b(0x20b)];}[a59_0x34b1fc(0x213)](_0x1bd8f5,_0xbfc1ef,_0x30ed4e=0x0){const _0x5bd83a=a59_0x34b1fc,_0x12aa42=this[_0x5bd83a(0xd0)](_0x1bd8f5,_0xbfc1ef,_0x30ed4e);if(!_0x12aa42)return console[_0x5bd83a(0x23a)](a59_0x564dd3[_0x5bd83a(0x1a4)](_0x5bd83a(0x168)),'Project\x20name\x20is\x20required'),console[_0x5bd83a(0x23a)](a59_0x564dd3['dim'](_0x5bd83a(0x185))),null;return _0x12aa42;}[a59_0x34b1fc(0x194)](_0x553d8e,_0x130d9d){const _0x397cec=a59_0x34b1fc;if(_0x553d8e[0x0]){const _0x53f441=_0x553d8e[0x0][_0x397cec(0x101)]('.');if(_0x53f441[_0x397cec(0x217)]===0x1)return{'projectName':_0x53f441[0x0],'workflowName':undefined};else return _0x53f441[_0x397cec(0x217)]===0x2?{'projectName':_0x53f441[0x0],'workflowName':_0x53f441[0x1]}:(console[_0x397cec(0x23a)](a59_0x564dd3['red'](_0x397cec(0x168)),_0x397cec(0x7c)),null);}return{'projectName':_0x130d9d[_0x397cec(0x20b)],'workflowName':undefined};}[a59_0x34b1fc(0x14e)](_0x215518,_0x25f9dd,_0x188bf7=0x0){const _0x4e587c=a59_0x34b1fc;if(_0x215518[_0x188bf7])return _0x215518[_0x188bf7];if(_0x25f9dd[_0x4e587c(0x20b)]){const _0x44cbe1=a59_0x156221[_0x4e587c(0xf7)](process[_0x4e587c(0x154)](),_0x4e587c(0x1d0),_0x25f9dd['workflowProject']);if(existsSync(a59_0x156221['join'](_0x44cbe1,_0x4e587c(0xd9))))return _0x44cbe1;}return undefined;}async[a59_0x34b1fc(0xe2)](_0x265beb,_0x1ac3e7,_0x270f8e){const _0x14e9a5=a59_0x34b1fc;try{const _0x5cbc52=await _0x265beb['workflow']['workflows'](_0x1ac3e7,{'limit':0x1});if(_0x5cbc52[_0x14e9a5(0x217)]>0x0){const _0x2efb5c=_0x5cbc52[0x0]['id'],_0x1a3777=getWorkflowUrl(_0x270f8e,_0x2efb5c);console['error'](_0x14e9a5(0xda)+a59_0x564dd3[_0x14e9a5(0x1ae)](_0x1a3777));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0x1c7);[a59_0x34b1fc(0x229)]=a59_0x34b1fc(0x243);async[a59_0x34b1fc(0x203)](_0x52b2fe){const _0x18b899=a59_0x34b1fc,{options:_0x37ffad,args:_0x556ee6,tdx:_0x21fe54}=_0x52b2fe,_0x35b1e1=_0x556ee6[0x0],_0xdef50a=_0x37ffad[_0x18b899(0xfc)];if(_0xdef50a)return saveSessionContext({'workflow_project':undefined},_0x37ffad['session']),console[_0x18b899(0x223)](a59_0x564dd3['green'](_0x18b899(0xf2))),0x0;if(!_0x35b1e1)return console[_0x18b899(0x23a)](a59_0x564dd3['red'](_0x18b899(0x168)),_0x18b899(0x1ac)),console['error'](a59_0x564dd3[_0x18b899(0x6f)](_0x18b899(0x136))),console[_0x18b899(0x23a)](a59_0x564dd3[_0x18b899(0x6f)](_0x18b899(0x17d))),0x1;const _0x59060e=await withSpinner(_0x18b899(0xe0)+_0x35b1e1+_0x18b899(0x8f),()=>_0x21fe54['workflow'][_0x18b899(0x88)](_0x35b1e1),{'verbose':_0x37ffad[_0x18b899(0x1ab)]}),{name:_0xe62717}=_0x59060e[_0x18b899(0x138)];return saveSessionContext({'workflow_project':_0xe62717},_0x37ffad['session']),console['log'](a59_0x564dd3[_0x18b899(0xcd)](_0x18b899(0x114)+a59_0x564dd3['cyan'](_0xe62717))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a59_0x34b1fc(0x7b)]='workflow:projects';[a59_0x34b1fc(0x229)]='List\x20all\x20workflow\x20projects';async[a59_0x34b1fc(0x203)](_0x5027dd){const _0x2e85bc=a59_0x34b1fc,{options:_0xfc0f43,args:_0x38e7e5,tdx:_0x312bd4}=_0x5027dd,_0x24a7f0=_0x38e7e5[0x0];_0xfc0f43['verbose']&&_0x24a7f0&&console['error'](_0x2e85bc(0x115)+_0x24a7f0);const _0x6a4717=await withSpinner(_0x2e85bc(0x1c0),()=>_0x312bd4[_0x2e85bc(0x14b)][_0x2e85bc(0x10f)](_0x24a7f0,{'limit':_0xfc0f43[_0x2e85bc(0x7d)]}),{'verbose':_0xfc0f43['verbose']});let _0x4bd08f=_0x6a4717[_0x2e85bc(0x138)];_0x4bd08f[_0x2e85bc(0x65)]((_0x1a20fa,_0x3dde74)=>_0x1a20fa[_0x2e85bc(0x7b)][_0x2e85bc(0x16e)](_0x3dde74[_0x2e85bc(0x7b)]));const _0x40f84d=_0xfc0f43['limit']&&_0x4bd08f['length']>=_0xfc0f43['limit']?a59_0x564dd3['dim'](_0x2e85bc(0x207)):'';console[_0x2e85bc(0x23a)](_0x2e85bc(0x24a)+_0x4bd08f[_0x2e85bc(0x217)]+'\x20project'+(_0x4bd08f[_0x2e85bc(0x217)]!==0x1?'s':'')+_0x40f84d);if(_0xfc0f43[_0x2e85bc(0x197)]===_0x2e85bc(0x1e8)||_0xfc0f43[_0x2e85bc(0x197)]==='jsonl'||_0xfc0f43[_0x2e85bc(0x197)]==='table')await handleSDKOutput(_0x4bd08f,_0xfc0f43);else{if(_0x4bd08f[_0x2e85bc(0x217)]===0x0)_0x24a7f0?console[_0x2e85bc(0x223)](_0x2e85bc(0x68)+_0x24a7f0):console[_0x2e85bc(0x223)]('No\x20workflow\x20projects\x20found');else{const _0x13fc7b=_0x4bd08f[_0x2e85bc(0xb1)](_0x109bc9=>{const _0x2f0add=_0x2e85bc,_0x196382=_0x109bc9[_0x2f0add(0xc9)]?.[_0x2f0add(0xf3)](_0x4a9336=>_0x4a9336[_0x2f0add(0x24e)]==='sys'),_0x54562f=_0x196382?a59_0x564dd3['dim'](_0x2f0add(0x1d4)):'';return'📁\x20'+_0x109bc9[_0x2f0add(0x7b)]+_0x54562f;});await writeOutput(_0x13fc7b[_0x2e85bc(0xf7)]('\x0a'),_0xfc0f43['output'],_0x2e85bc(0xab));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0x1e1);[a59_0x34b1fc(0x229)]=a59_0x34b1fc(0x1c6);async[a59_0x34b1fc(0x203)](_0x4f8c77){const _0x337f21=a59_0x34b1fc,{options:_0x45b9b4,args:_0x1ac2d6,tdx:_0x485daa}=_0x4f8c77,_0x126c0b=this['resolveProject'](_0x1ac2d6,_0x45b9b4);_0x45b9b4['verbose']&&_0x126c0b&&console[_0x337f21(0x23a)](_0x337f21(0x16f)+_0x126c0b);const _0x254100=await withSpinner(_0x337f21(0x1fb),()=>_0x485daa['workflow'][_0x337f21(0x1d0)](_0x126c0b,{'limit':_0x45b9b4['limit']}),{'verbose':_0x45b9b4[_0x337f21(0x1ab)]});let _0x23b6d8=_0x254100[_0x337f21(0x138)];_0x23b6d8[_0x337f21(0x65)]((_0x232067,_0x28419a)=>{const _0x475d21=_0x337f21,_0x3f9786=_0x232067[_0x475d21(0x7b)][_0x475d21(0x16e)](_0x28419a[_0x475d21(0x7b)]);if(_0x3f9786!==0x0)return _0x3f9786;return(_0x232067['project']?.[_0x475d21(0x7b)]||'')[_0x475d21(0x16e)](_0x28419a[_0x475d21(0xc6)]?.[_0x475d21(0x7b)]||'');});const _0x4242d0=_0x45b9b4[_0x337f21(0x7d)]&&_0x23b6d8[_0x337f21(0x217)]>=_0x45b9b4[_0x337f21(0x7d)]?a59_0x564dd3[_0x337f21(0x6f)](_0x337f21(0x207)):'';console['error']('✔\x20Found\x20'+_0x23b6d8['length']+'\x20workflow'+(_0x23b6d8[_0x337f21(0x217)]!==0x1?'s':'')+_0x4242d0);if(_0x45b9b4[_0x337f21(0x197)]==='json'||_0x45b9b4[_0x337f21(0x197)]==='jsonl'||_0x45b9b4[_0x337f21(0x197)]===_0x337f21(0x13f))await handleSDKOutput(_0x23b6d8,_0x45b9b4);else{if(_0x23b6d8[_0x337f21(0x217)]===0x0)_0x126c0b?console['log'](_0x337f21(0x87)+_0x126c0b):console['log']('No\x20workflows\x20found');else{const _0x1919bd=_0x45b9b4[_0x337f21(0xc7)],_0x47fea5=_0x23b6d8['map'](_0x5392c2=>{const _0x141d0e=_0x337f21,_0x449ab6=a59_0x564dd3['dim']('#'+_0x5392c2['id']),_0x49d26b=hyperlink(_0x449ab6,getWorkflowUrl(_0x1919bd,_0x5392c2['id'])),_0x468f9b=_0x5392c2['project']?.[_0x141d0e(0x7b)]?a59_0x564dd3[_0x141d0e(0x6f)]('\x20('+_0x5392c2[_0x141d0e(0xc6)][_0x141d0e(0x7b)]+')'):'';return'📋\x20'+_0x49d26b+'\x20'+_0x5392c2['name']+_0x468f9b;});await writeOutput(_0x47fea5[_0x337f21(0xf7)]('\x0a'),_0x45b9b4['output'],_0x337f21(0xab));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a59_0x34b1fc(0x7b)]='workflow:sessions';['description']=a59_0x34b1fc(0xb7);async[a59_0x34b1fc(0x203)](_0x19c121){const _0x144370=a59_0x34b1fc,{options:_0x228540,args:_0x2e7000,tdx:_0x39df22}=_0x19c121,_0x2a63a0=this['parseProjectWorkflowPattern'](_0x2e7000,_0x228540);if(!_0x2a63a0)return 0x1;const {projectName:_0x28b21c,workflowName:_0x55dd47}=_0x2a63a0;if(_0x228540['verbose']){if(_0x28b21c&&_0x55dd47)console[_0x144370(0x23a)](_0x144370(0x1fd)+_0x28b21c+'.'+_0x55dd47);else _0x28b21c&&console[_0x144370(0x23a)](_0x144370(0x123)+_0x28b21c);const _0x396943=_0x228540[_0x144370(0x1b6)];_0x396943&&console['error']('Status:\x20'+_0x396943);}let _0x22fc39=0x28;if(process[_0x144370(0x122)][_0x144370(0x10b)]&&!_0x228540[_0x144370(0x95)]&&!_0x228540[_0x144370(0x197)]){const _0x9b8ffe=process['stdout']['rows']||0x28;_0x22fc39=Math['max'](0x14,Math['floor'](_0x9b8ffe*0x2/0x3));}const _0x130148=_0x228540[_0x144370(0x7d)]||_0x22fc39,_0x7cdbaf=await withSpinner(_0x144370(0xc8),()=>_0x39df22[_0x144370(0x14b)][_0x144370(0x1ef)]({'projectName':_0x28b21c,'workflowName':_0x55dd47,'status':_0x228540['status'],'fromTime':_0x228540[_0x144370(0xec)],'toTime':_0x228540['to'],'limit':_0x130148}),{'verbose':_0x228540[_0x144370(0x1ab)]}),_0x4f4483=_0x7cdbaf[_0x144370(0x138)];_0x4f4483[_0x144370(0x65)]((_0x4715b0,_0x2d3105)=>{const _0x2481e8=_0x144370,_0x4f57d6=_0x4715b0[_0x2481e8(0xad)]||'',_0x285f5c=_0x2d3105[_0x2481e8(0xad)]||'';return _0x285f5c[_0x2481e8(0x16e)](_0x4f57d6);});_0x4f4483[_0x144370(0x217)]>=_0x130148?console[_0x144370(0x23a)](_0x144370(0x190)+_0x4f4483['length']+_0x144370(0x79)+a59_0x564dd3[_0x144370(0x6f)](_0x144370(0x140))):console[_0x144370(0x23a)](_0x144370(0x24a)+_0x4f4483[_0x144370(0x217)]+_0x144370(0x233)+(_0x4f4483[_0x144370(0x217)]!==0x1?'s':''));if(_0x228540[_0x144370(0x197)]===_0x144370(0x1e8)||_0x228540[_0x144370(0x197)]===_0x144370(0x77)||_0x228540[_0x144370(0x197)]===_0x144370(0x13f))await handleSDKOutput(_0x4f4483,_0x228540);else{if(!process[_0x144370(0x122)]['isTTY']||_0x228540[_0x144370(0x95)]){if(_0x4f4483['length']===0x0){if(_0x28b21c&&_0x55dd47)console[_0x144370(0x223)](_0x144370(0x7f)+_0x28b21c+'.'+_0x55dd47);else _0x28b21c?console[_0x144370(0x223)](_0x144370(0xb5)+_0x28b21c):console['log'](_0x144370(0x1db));}else{const _0x3a0993=_0x228540[_0x144370(0xc7)],_0x8445c4=this[_0x144370(0x6c)](_0x4f4483,_0x3a0993);_0x228540[_0x144370(0x95)]?await writeOutput(_0x8445c4,_0x228540['output'],'list'):console[_0x144370(0x223)](_0x8445c4);}!_0x28b21c&&(console['error'](''),console['error'](a59_0x564dd3[_0x144370(0x6f)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x144370(0x23a)](a59_0x564dd3['dim'](_0x144370(0x1fe))+'or'+a59_0x564dd3[_0x144370(0x6f)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x4f4483[_0x144370(0x217)]===0x0){if(_0x28b21c&&_0x55dd47)console[_0x144370(0x223)](_0x144370(0x7f)+_0x28b21c+'.'+_0x55dd47);else _0x28b21c?console['log'](_0x144370(0xb5)+_0x28b21c):console[_0x144370(0x223)](_0x144370(0x1db));}else await this['navigateSessionsInteractive'](_0x4f4483,_0x19c121,_0x28b21c);}}return 0x0;}[a59_0x34b1fc(0x6c)](_0x390a2b,_0x2023f1){const _0x1f379c=a59_0x34b1fc,_0x4e8435=[],_0x449908=new Map();let _0x21e2b9=Infinity,_0x3f3381=-Infinity;for(const _0xf24b5 of _0x390a2b){if(_0xf24b5[_0x1f379c(0x20a)]?.[_0x1f379c(0xc0)]){const _0xf947f=new Date(_0xf24b5[_0x1f379c(0x20a)][_0x1f379c(0xc0)])[_0x1f379c(0x11a)](),_0x486cb1=_0xf24b5[_0x1f379c(0x20a)][_0x1f379c(0x10a)]?new Date(_0xf24b5['lastAttempt'][_0x1f379c(0x10a)])[_0x1f379c(0x11a)]():Date['now'](),_0x200904=_0xf24b5[_0x1f379c(0xc6)]?.[_0x1f379c(0x7b)]||'(unknown)';!_0x449908[_0x1f379c(0x1a3)](_0x200904)&&_0x449908['set'](_0x200904,[]),_0x449908['get'](_0x200904)[_0x1f379c(0x1f9)]({'session':_0xf24b5,'startTime':_0xf947f,'endTime':_0x486cb1,'duration':_0x486cb1-_0xf947f}),_0x21e2b9=Math[_0x1f379c(0x105)](_0x21e2b9,_0xf947f),_0x3f3381=Math['max'](_0x3f3381,_0x486cb1);}}if(_0x449908[_0x1f379c(0x163)]===0x0)return _0x1f379c(0xee);const _0x37dbb0=process['stdout']['columns']||0x78,_0x1bb5a4=0x1e,_0x2da799=0x32,_0xb55a45=0x4,_0x13812b=Math[_0x1f379c(0x105)](_0x2da799,Math['max'](_0x1bb5a4,Math['floor'](_0x37dbb0*0.3))),_0x317d5d=_0x37dbb0-_0x13812b-TIMELINE_CONFIG[_0x1f379c(0x113)]-0x3-_0xb55a45,_0x1813d0=_0x3f3381-_0x21e2b9,_0x390538=_0x1813d0/_0x13812b,_0x1c6145=renderTimeAxis({'startTime':_0x21e2b9,'endTime':_0x3f3381,'durationMs':_0x1813d0,'msPerChar':_0x390538},_0x13812b),_0x4dff19=[];for(const _0x271db1 of _0x449908[_0x1f379c(0x19a)]()){_0x4dff19[_0x1f379c(0x1f9)](..._0x271db1);}_0x4dff19[_0x1f379c(0x65)]((_0x179ae2,_0x48fff6)=>_0x48fff6[_0x1f379c(0x8c)]-_0x179ae2[_0x1f379c(0x8c)]);const _0x2bc6bb=new Date(_0x21e2b9),_0x5749cb=formatDate(_0x2bc6bb),_0x589788=_0xb55a45+TIMELINE_CONFIG[_0x1f379c(0x120)]+TIMELINE_CONFIG['ICON_SPACING']+_0x317d5d,_0x549c0c='\x20'[_0x1f379c(0xaf)](_0x589788-_0x5749cb[_0x1f379c(0x217)]),_0x3c8d30=_0x549c0c+a59_0x564dd3['dim'](_0x5749cb)+'\x20'+_0x1c6145;_0x4e8435[_0x1f379c(0x1f9)](_0x3c8d30);const _0x296ed0=0x16;let _0x56eccc=0x0;for(const _0x498c37 of _0x4dff19){const _0x14f299=_0x498c37[_0x1f379c(0x167)][_0x1f379c(0xc6)]?.[_0x1f379c(0x7b)]||'?',_0x2b65e7=Math[_0x1f379c(0x105)](stringWidth(_0x14f299),_0x296ed0);_0x56eccc=Math[_0x1f379c(0xc3)](_0x56eccc,_0x2b65e7);}for(const _0x271d9a of _0x4dff19){const {session:_0x2670a8,startTime:_0x1e01c2,endTime:_0x1a0c42,duration:_0x3b009a}=_0x271d9a,_0x34b941=_0x2670a8[_0x1f379c(0xc6)]?.['id'],_0xf53554=_0x2670a8['id'],_0x4909ce=_0x2670a8[_0x1f379c(0xc6)]?.[_0x1f379c(0x7b)]||'?',_0x2504fc=_0x2670a8['workflow']?.[_0x1f379c(0x7b)]||'?';let _0x19021b,_0x2ce79d;if(_0x2670a8[_0x1f379c(0x20a)]){const _0x4ccd80=_0x2670a8[_0x1f379c(0x20a)];!_0x4ccd80[_0x1f379c(0xbc)]?(_0x19021b=_0x4ccd80[_0x1f379c(0xa0)]?'🛑':'🔄',_0x2ce79d=_0x4ccd80[_0x1f379c(0xa0)]?a59_0x564dd3['yellow']:a59_0x564dd3[_0x1f379c(0x1f6)]):(_0x19021b=_0x4ccd80['success']?'✅':'❌',_0x2ce79d=_0x4ccd80[_0x1f379c(0x1b7)]?a59_0x564dd3[_0x1f379c(0xcd)]:a59_0x564dd3[_0x1f379c(0x1a4)]);}else _0x19021b='⏳',_0x2ce79d=a59_0x564dd3['dim'];const _0x24d540='#'+_0xf53554,_0x3d80dd=_0x34b941?hyperlink(_0x24d540,getWorkflowSessionUrl(_0x2023f1,_0x34b941,_0xf53554)):_0x24d540;let _0x26f24e=_0x4909ce;stringWidth(_0x4909ce)>_0x296ed0&&(_0x26f24e=_0x4909ce[_0x1f379c(0x156)](0x0,_0x296ed0-0x1)+'…');const _0x208ecd=a59_0x564dd3[_0x1f379c(0x6f)](_0x26f24e),_0x2ea3b0=stringWidth(_0x26f24e),_0x106d8f='\x20'[_0x1f379c(0xaf)](_0x56eccc-stringWidth(_0x26f24e)+0x2),_0x239a03='('+formatElapsed(_0x3b009a)+')',_0x4bdec0=stringWidth(_0x239a03),_0x38b3a7=stringWidth(_0x24d540),_0x5831ac=_0x38b3a7+0x1+_0x2ea3b0+_0x106d8f[_0x1f379c(0x217)],_0x195547=_0x317d5d-_0x5831ac-_0x4bdec0-0x1-0x8;let _0x1256c9=_0x2504fc;stringWidth(_0x1256c9)>_0x195547&&(_0x1256c9=_0x1256c9[_0x1f379c(0x156)](0x0,_0x195547-0x1)+'…');const _0x186a40=_0x3d80dd+'\x20'+_0x208ecd+_0x106d8f+_0x1256c9,_0x471cf=stringWidth(_0x186a40),_0x4089ed=_0x317d5d-_0x471cf-_0x4bdec0,_0x51ce10=_0x186a40+'\x20'[_0x1f379c(0xaf)](Math['max'](0x1,_0x4089ed))+a59_0x564dd3['dim'](_0x239a03),_0xaaa0ae=Math[_0x1f379c(0x9e)]((_0x1e01c2-_0x21e2b9)/_0x390538),_0x84322=Math[_0x1f379c(0x9e)]((_0x1a0c42-_0x21e2b9)/_0x390538),_0x3fe5ed=Math['max'](_0xaaa0ae+0x1,_0x84322),_0x2f25af=new Array(_0x13812b)[_0x1f379c(0x174)]('\x20');for(let _0x2c1c6=_0xaaa0ae;_0x2c1c6<Math[_0x1f379c(0x105)](_0x3fe5ed,_0x13812b);_0x2c1c6++){_0x2f25af[_0x2c1c6]='─';}const _0x2b33e3=_0x2f25af[_0x1f379c(0xb1)](_0x5cb686=>_0x5cb686==='\x20'?'\x20':_0x2ce79d(_0x5cb686))['join']('');_0x4e8435[_0x1f379c(0x1f9)](_0x19021b+'\x20'+_0x51ce10+'│'+_0x2b33e3+'│');}return _0x4e8435[_0x1f379c(0xf7)]('\x0a');}async[a59_0x34b1fc(0x78)](_0x42ec7f,_0x214a0a,_0xcd7960){const _0x40e030=a59_0x34b1fc,{options:_0x40a448,tdx:_0x338441}=_0x214a0a,_0x525064=_0x40a448[_0x40e030(0xc7)],{timelineRows:_0x267c16,timeAxisHeader:_0x381e97}=this[_0x40e030(0xca)](_0x42ec7f,_0x525064),_0x252ed6=_0x267c16['filter'](_0x4a70d5=>_0x4a70d5['attemptId']);if(_0x252ed6[_0x40e030(0x217)]===0x0){const _0xeb7f97=this[_0x40e030(0x6c)](_0x42ec7f,_0x525064);console[_0x40e030(0x223)](_0xeb7f97);!_0xcd7960&&(console[_0x40e030(0x23a)](''),console[_0x40e030(0x23a)](a59_0x564dd3[_0x40e030(0x6f)](_0x40e030(0x1bb))),console[_0x40e030(0x23a)](a59_0x564dd3[_0x40e030(0x6f)](_0x40e030(0x1fe))+'or'+a59_0x564dd3[_0x40e030(0x6f)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0x381e97&&console[_0x40e030(0x223)](_0x381e97);const _0x2f1414=_0x267c16[_0x40e030(0x1f1)](_0x1aaa9a=>_0x1aaa9a[_0x40e030(0x1e9)])[_0x40e030(0xb1)](_0xb7f413=>({'title':_0xb7f413[_0x40e030(0x12c)],'value':_0xb7f413[_0x40e030(0x1e9)]})),_0x27aa4f=process[_0x40e030(0x122)]['rows']||0x3c,_0x1b11ea=Math[_0x40e030(0xc3)](0x28,Math[_0x40e030(0x9e)](_0x27aa4f*0x2/0x3)),_0x2a59e4=await a59_0x17b23b({'type':'autocomplete','name':_0x40e030(0x1e9),'message':_0x40e030(0x98),'choices':_0x2f1414,'initial':-0x1,'limit':_0x1b11ea,'clearFirst':!![],'fallback':{'title':_0x40e030(0x21c),'value':null},'suggest':(_0x402a87,_0x22f170)=>{const _0x5a2300=_0x40e030;if(!_0x402a87)return Promise[_0x5a2300(0xbd)](_0x22f170);const _0x16d473=_0x22f170[_0x5a2300(0x1f1)](_0x4ad69a=>{const _0x2a32ad=_0x5a2300,_0x10260c=_0x4ad69a;return _0x10260c[_0x2a32ad(0xce)][_0x2a32ad(0x1b5)]()['includes'](_0x402a87[_0x2a32ad(0x1b5)]());});return Promise['resolve'](_0x16d473);}}),_0x49e532=()=>{const _0x4cfcd5=_0x40e030;process[_0x4cfcd5(0x122)][_0x4cfcd5(0x22f)](_0x4cfcd5(0xdc)),process[_0x4cfcd5(0x122)][_0x4cfcd5(0x22f)](_0x4cfcd5(0xdc)),process[_0x4cfcd5(0x122)][_0x4cfcd5(0x22f)](_0x4cfcd5(0xdc));},_0x41f724=_0x2a59e4&&_0x2a59e4[_0x40e030(0x1e9)]&&_0x2a59e4[_0x40e030(0x1e9)]!==null&&_0x2a59e4[_0x40e030(0x1e9)][_0x40e030(0x152)]()!=='';if(!_0x41f724){_0x49e532(),console[_0x40e030(0x223)](a59_0x564dd3[_0x40e030(0x6f)](_0x40e030(0xf4)));return;}_0x49e532();const _0x172c28=_0x42ec7f[_0x40e030(0x1b9)](_0x44d8c4=>_0x44d8c4[_0x40e030(0x20a)]?.['id']===_0x2a59e4[_0x40e030(0x1e9)]);if(_0x172c28){const _0x473156=_0x172c28['project']?.[_0x40e030(0x7b)]||'?',_0x19078b=_0x172c28[_0x40e030(0x14b)]?.[_0x40e030(0x7b)]||'?';console['log'](_0x40e030(0x124)+a59_0x564dd3[_0x40e030(0x6f)](_0x473156)+',\x20Workflow:\x20'+a59_0x564dd3[_0x40e030(0x6f)](_0x19078b));}const _0x32bdc7=new WorkflowTimelineCommand();await _0x32bdc7[_0x40e030(0x203)]({'args':[],'options':{..._0x40a448,'attemptId':_0x2a59e4[_0x40e030(0x1e9)]},'tdx':_0x338441});}[a59_0x34b1fc(0xca)](_0x539e8b,_0x392b83){const _0x141794=a59_0x34b1fc,_0xa6c6ae=new Map();for(const _0x9ee649 of _0x539e8b){_0x9ee649['id']&&_0x9ee649['lastAttempt']?.['id']&&_0xa6c6ae[_0x141794(0x20e)](_0x9ee649['id'],_0x9ee649[_0x141794(0x20a)]['id']);}const _0x3e1764=[];let _0x2fec4f='';const _0x55ec56=this[_0x141794(0x6c)](_0x539e8b,_0x392b83),_0x3d0508=_0x55ec56['split']('\x0a');for(const _0xef2a15 of _0x3d0508){if(_0xef2a15[_0x141794(0xbf)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0xef2a15[_0x141794(0x1c4)](/^\s+\d{4}-\d{2}-\d{2}/))_0x2fec4f=_0xef2a15;else{if(_0xef2a15['match'](/^[✅❌🔄🛑⏳]/)){const _0x118afe=_0xef2a15[_0x141794(0x1c4)](/#(\d+)/),_0x344f74=_0x118afe?_0x118afe[0x1]:null,_0x3a9f42=_0x344f74?_0xa6c6ae[_0x141794(0x209)](_0x344f74)||null:null,_0x4496d6=_0x539e8b[_0x141794(0x1b9)](_0x3356b0=>_0x3356b0['id']===_0x344f74),_0x409dd3=_0x4496d6?.[_0x141794(0xc6)]?.[_0x141794(0x7b)]||'';_0x3e1764['push']({'displayLine':_0xef2a15,'attemptId':_0x3a9f42,'projectName':_0x409dd3});}}}return{'timelineRows':_0x3e1764,'timeAxisHeader':_0x2fec4f};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']=a59_0x34b1fc(0x201);[a59_0x34b1fc(0x229)]=a59_0x34b1fc(0x241);async[a59_0x34b1fc(0x203)](_0x4d8a05){const _0xf76d6=a59_0x34b1fc,{options:_0x1c5c46,args:_0x4c4b59,tdx:_0x68ad69}=_0x4d8a05,_0x3b7216=this[_0xf76d6(0x194)](_0x4c4b59,_0x1c5c46);if(!_0x3b7216)return 0x1;const {projectName:_0x5c75fa,workflowName:_0x42ba2c}=_0x3b7216,_0x56881f=_0x1c5c46[_0xf76d6(0xb6)];if(_0x1c5c46['verbose']){if(_0x5c75fa&&_0x42ba2c)console[_0xf76d6(0x23a)](_0xf76d6(0x1fd)+_0x5c75fa+'.'+_0x42ba2c);else _0x5c75fa&&console[_0xf76d6(0x23a)](_0xf76d6(0x123)+_0x5c75fa);_0x56881f&&console['error']('Include\x20retried:\x20yes');}const _0x34218f=await withSpinner(_0xf76d6(0x71),()=>_0x68ad69[_0xf76d6(0x14b)][_0xf76d6(0x157)]({'projectName':_0x5c75fa,'workflowName':_0x42ba2c,'includeRetried':_0x56881f,'limit':_0x1c5c46[_0xf76d6(0x7d)]}),{'verbose':_0x1c5c46['verbose']}),_0x40f8d4=_0x34218f[_0xf76d6(0x138)],_0x182995=_0x1c5c46[_0xf76d6(0x7d)]||0x64,_0x1426fb=_0x40f8d4[_0xf76d6(0x217)]>=_0x182995?a59_0x564dd3[_0xf76d6(0x6f)](_0xf76d6(0x207)):'';console[_0xf76d6(0x23a)](_0xf76d6(0x24a)+_0x40f8d4[_0xf76d6(0x217)]+_0xf76d6(0x1f0)+(_0x40f8d4[_0xf76d6(0x217)]!==0x1?'s':'')+_0x1426fb);if(_0x1c5c46[_0xf76d6(0x197)]==='json'||_0x1c5c46[_0xf76d6(0x197)]===_0xf76d6(0x77)||_0x1c5c46[_0xf76d6(0x197)]===_0xf76d6(0x13f))await handleSDKOutput(_0x40f8d4,_0x1c5c46);else{if(_0x40f8d4['length']===0x0){if(_0x5c75fa&&_0x42ba2c)console[_0xf76d6(0x223)](_0xf76d6(0x67)+_0x5c75fa+'.'+_0x42ba2c);else _0x5c75fa?console[_0xf76d6(0x223)](_0xf76d6(0x72)+_0x5c75fa):console[_0xf76d6(0x223)](_0xf76d6(0x1e0));}else{const _0x152614=_0x1c5c46['site'],_0x131302=_0x40f8d4['map'](_0x82a3c5=>{const _0x709364=_0xf76d6,_0xafadec=a59_0x564dd3[_0x709364(0x6f)]('#'+_0x82a3c5['id']),_0x5790d4=_0x82a3c5['project']?.['id'],_0x2b6716=_0x82a3c5[_0x709364(0x121)]||_0x82a3c5['sessionId'],_0x45781a=_0x5790d4&&_0x2b6716?hyperlink(_0xafadec,getWorkflowAttemptUrl(_0x152614,_0x5790d4,_0x2b6716,_0x82a3c5['id'])):_0xafadec,{icon:_0x3c6aca,text:_0x568131}=getAttemptStatusDisplay(_0x82a3c5),_0x4f0d72=(_0x82a3c5[_0x709364(0xc6)]?.[_0x709364(0x7b)]||'?')+'.'+(_0x82a3c5['workflow']?.[_0x709364(0x7b)]||'?'),_0x267d9c=_0x82a3c5[_0x709364(0xad)]?a59_0x564dd3[_0x709364(0x6f)](_0x82a3c5[_0x709364(0xad)]):'';return(_0x45781a+'\x20'+_0x3c6aca+(_0x568131?'\x20'+_0x568131:'')+'\x20'+_0x4f0d72+'\x20'+_0x267d9c)[_0x709364(0x85)]();});await writeOutput(_0x131302[_0xf76d6(0xf7)]('\x0a'),_0x1c5c46['output'],_0xf76d6(0xab));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0x1b2);[a59_0x34b1fc(0x229)]='Show\x20specific\x20attempt\x20details';async[a59_0x34b1fc(0x203)](_0x5e84e2){const _0x13995=a59_0x34b1fc,{options:_0x3605a0,args:_0x25dc09,tdx:_0x4c6777}=_0x5e84e2,_0x2e648e=_0x25dc09[0x0];if(!_0x2e648e)return console['error'](_0x13995(0xac)),0x1;_0x3605a0[_0x13995(0x1ab)]&&console[_0x13995(0x23a)](_0x13995(0x1fa)+_0x2e648e);const _0x288678=await withSpinner(_0x13995(0xf1),()=>_0x4c6777[_0x13995(0x14b)]['attempt'](_0x2e648e),{'verbose':_0x3605a0[_0x13995(0x1ab)]}),_0x38e718=_0x288678['data'];let _0x185798;!_0x38e718[_0x13995(0xbc)]?_0x185798=_0x38e718[_0x13995(0xa0)]?_0x13995(0x247):'running':_0x185798=_0x38e718[_0x13995(0x1b7)]?_0x13995(0x1b7):'error';let _0x4bc695;if(_0x38e718['createdAt']&&_0x38e718['finishedAt']){const _0x262a58=new Date(_0x38e718['createdAt'])[_0x13995(0x11a)](),_0x34b87d=new Date(_0x38e718[_0x13995(0x10a)])[_0x13995(0x11a)]();_0x4bc695=Math[_0x13995(0x18f)]((_0x34b87d-_0x262a58)/0x3e8);}const _0x197be5={'attempt_id':_0x38e718['id'],'status':_0x185798,..._0x38e718[_0x13995(0xd4)]!==undefined&&{'index':_0x38e718['index']},..._0x38e718[_0x13995(0xc6)]&&{'project':_0x38e718[_0x13995(0xc6)]['name']},..._0x38e718['workflow']&&{'workflow':_0x38e718['workflow'][_0x13995(0x7b)]},..._0x38e718[_0x13995(0x6b)]&&{'session_id':_0x38e718['sessionId']},..._0x38e718[_0x13995(0xad)]&&{'session_time':_0x38e718['sessionTime']},..._0x38e718[_0x13995(0x210)]&&{'retry_attempt':_0x38e718[_0x13995(0x210)]},..._0x4bc695!==undefined&&{'duration_sec':_0x4bc695},..._0x38e718[_0x13995(0xc0)]&&{'created_at':_0x38e718['createdAt']},..._0x38e718[_0x13995(0x10a)]&&{'finished_at':_0x38e718['finishedAt']},...Object[_0x13995(0x1d3)](_0x38e718['params'])[_0x13995(0x217)]>0x0&&{'params':_0x38e718[_0x13995(0xe5)]}};return await handleSingleObjectOutput(_0x197be5,_0x3605a0),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0x17b);['description']=a59_0x34b1fc(0x1ed);async[a59_0x34b1fc(0x203)](_0x548d70){const _0x1f9f13=a59_0x34b1fc,{options:_0x44b1b4,args:_0x2e735e,tdx:_0x479ef5}=_0x548d70,_0x6e843f=_0x2e735e[0x0];if(!_0x6e843f)return console[_0x1f9f13(0x23a)](_0x1f9f13(0xac)),0x1;const _0x3aaa51=_0x44b1b4['includeSubtasks'];_0x44b1b4[_0x1f9f13(0x1ab)]&&(console[_0x1f9f13(0x23a)](_0x1f9f13(0x1fa)+_0x6e843f),_0x3aaa51&&console[_0x1f9f13(0x23a)](_0x1f9f13(0xd8)));const _0x566847=await withSpinner(_0x1f9f13(0xe9),()=>_0x479ef5[_0x1f9f13(0x14b)][_0x1f9f13(0x148)](_0x6e843f,_0x3aaa51||![]),{'verbose':_0x44b1b4[_0x1f9f13(0x1ab)]}),_0x5e793c=_0x566847[_0x1f9f13(0x138)];return console[_0x1f9f13(0x23a)](_0x1f9f13(0x24a)+_0x5e793c['length']+_0x1f9f13(0x155)+(_0x5e793c[_0x1f9f13(0x217)]!==0x1?'s':'')),await handleSDKOutput(_0x5e793c,_0x44b1b4),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0x1f7);[a59_0x34b1fc(0x229)]=a59_0x34b1fc(0x22b);async[a59_0x34b1fc(0x203)](_0x33cc9e){const _0xea33f8=a59_0x34b1fc,{options:_0x53f884,args:_0x41f5c4,tdx:_0x5ad3db}=_0x33cc9e,_0x2aa026=_0x41f5c4[0x0];let _0x2707cd=_0x41f5c4[0x1];if(!_0x2aa026)return console['error'](_0xea33f8(0xac)),0x1;_0x53f884[_0xea33f8(0x1ab)]&&(console[_0xea33f8(0x23a)](_0xea33f8(0x1fa)+_0x2aa026),_0x2707cd&&console[_0xea33f8(0x23a)](_0xea33f8(0x110)+_0x2707cd));const _0xe16e78=await withSpinner(_0xea33f8(0xfa),()=>_0x5ad3db[_0xea33f8(0x14b)]['logFiles'](_0x2aa026,_0x2707cd),{'verbose':_0x53f884[_0xea33f8(0x1ab)]}),_0x4cd257=_0xe16e78['data'];if(_0x4cd257[_0xea33f8(0x217)]===0x0)return console['error']('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x2707cd&&(_0x53f884[_0xea33f8(0x1e8)]||_0x53f884[_0xea33f8(0x197)]))return await handleSDKOutput(_0x4cd257,_0x53f884),0x0;if(!_0x2707cd){const _0x19cadd=_0x4cd257[_0xea33f8(0xb1)](_0x14ce8a=>({'title':_0x14ce8a[_0xea33f8(0x84)]+'\x20('+formatBytes(_0x14ce8a[_0xea33f8(0x13c)])+')','value':_0x14ce8a[_0xea33f8(0x84)]})),_0x2f8677=await a59_0x17b23b({'type':_0xea33f8(0x1fc),'name':_0xea33f8(0x8e),'message':_0xea33f8(0x94),'choices':_0x19cadd});if(!_0x2f8677['task'])return console[_0xea33f8(0x23a)](_0xea33f8(0xf4)),0x0;_0x2707cd=_0x2f8677[_0xea33f8(0x8e)];}const _0x4c08c4=await withSpinner(_0xea33f8(0x9b),()=>_0x5ad3db[_0xea33f8(0x14b)][_0xea33f8(0x9f)](_0x2aa026,_0x2707cd),{'verbose':_0x53f884[_0xea33f8(0x1ab)]}),_0x65c6dd=_0x4c08c4['data'];return _0x65c6dd?console[_0xea33f8(0x223)](_0x65c6dd):console[_0xea33f8(0x23a)](_0xea33f8(0x125)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0x1a2);[a59_0x34b1fc(0x229)]=a59_0x34b1fc(0xf9);async['execute'](_0x3deba3){const _0x188131=a59_0x34b1fc,{options:_0x34fbbe,args:_0x323e64,tdx:_0x2d4601}=_0x3deba3,_0x12e27c=_0x323e64[0x0];if(!_0x12e27c)return console[_0x188131(0x23a)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x303809=_0x34fbbe[_0x188131(0x97)];_0x34fbbe[_0x188131(0x1ab)]&&(console[_0x188131(0x23a)](_0x188131(0x1fa)+_0x12e27c),_0x303809&&console[_0x188131(0x23a)]('Reason:\x20'+_0x303809));if(!_0x34fbbe[_0x188131(0x100)]){if(!isInteractive())return console[_0x188131(0x23a)](a59_0x564dd3['red'](_0x188131(0x131)),_0x188131(0x246)),console['error'](a59_0x564dd3['dim'](_0x188131(0xbb))),0x1;const _0x34c365=await confirmKey(_0x188131(0x111)+_0x12e27c+'?');if(!_0x34c365)return console[_0x188131(0x23a)](a59_0x564dd3[_0x188131(0x204)]('Cancelled')),0x1;}const _0xed839d=await withSpinner(_0x188131(0x15c),()=>_0x2d4601['workflow'][_0x188131(0x21f)](_0x12e27c,_0x303809),{'verbose':_0x34fbbe['verbose']}),_0x2f0d21=_0xed839d['data'];return console[_0x188131(0x23a)]('✔\x20'+_0x2f0d21),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a59_0x34b1fc(0x240);[a59_0x34b1fc(0x229)]=a59_0x34b1fc(0x220);async['execute'](_0x3c390e){const _0x9d8033=a59_0x34b1fc,{options:_0x3ee760,args:_0x71511d,tdx:_0x1b2846}=_0x3c390e,_0x14c49a=_0x71511d[0x0];if(!_0x14c49a)return console[_0x9d8033(0x23a)](_0x9d8033(0x21a)),console['error'](_0x9d8033(0x177)),0x1;let _0x487e1d=![],_0x4caed0=_0x14c49a;if(_0x14c49a[_0x9d8033(0xbf)](_0x9d8033(0x1ea)))_0x487e1d=!![],_0x4caed0=_0x14c49a[_0x9d8033(0x235)](0x8);else{if(_0x14c49a[_0x9d8033(0xbf)]('attempt:'))_0x487e1d=![],_0x4caed0=_0x14c49a[_0x9d8033(0x235)](0x8);else return console[_0x9d8033(0x23a)](_0x9d8033(0x1c1)),console[_0x9d8033(0x23a)](_0x9d8033(0x177)),0x1;}const _0x447435=_0x3ee760[_0x9d8033(0x17a)],_0x4691b5=_0x3ee760[_0x9d8033(0x89)],_0x22b124=_0x3ee760[_0x9d8033(0xe5)],_0x46ef42=_0x3ee760[_0x9d8033(0x81)];_0x3ee760[_0x9d8033(0x1ab)]&&(console[_0x9d8033(0x23a)]('Target:\x20'+(_0x487e1d?'session':_0x9d8033(0x22a))+'\x20'+_0x4caed0),_0x447435&&console[_0x9d8033(0x23a)](_0x9d8033(0x182)+_0x447435),_0x4691b5&&console[_0x9d8033(0x23a)](_0x9d8033(0x12f)+_0x4691b5),_0x22b124&&console[_0x9d8033(0x23a)]('Params:\x20'+_0x22b124),_0x46ef42&&console[_0x9d8033(0x23a)](_0x9d8033(0x70)));let _0x46c633;if(_0x22b124)try{if(_0x22b124[_0x9d8033(0xbf)]('@')){const _0xc53a77=await import('fs/promises'),_0x171957=_0x22b124[_0x9d8033(0x235)](0x1),_0xebe2c5=await _0xc53a77['readFile'](_0x171957,_0x9d8033(0x80));_0x46c633=JSON['parse'](_0xebe2c5);}else _0x46c633=JSON['parse'](_0x22b124);}catch{return console[_0x9d8033(0x23a)](_0x9d8033(0x227)),0x1;}if(!_0x3ee760[_0x9d8033(0x100)]){if(!isInteractive())return console[_0x9d8033(0x23a)](a59_0x564dd3[_0x9d8033(0x1a4)](_0x9d8033(0x131)),_0x9d8033(0x246)),console[_0x9d8033(0x23a)](a59_0x564dd3[_0x9d8033(0x6f)](_0x9d8033(0xbb))),0x1;const _0x11f3f9=await confirmKey(_0x9d8033(0x132)+(_0x487e1d?_0x9d8033(0x167):_0x9d8033(0x22a))+'\x20'+_0x4caed0+'?');if(!_0x11f3f9)return console[_0x9d8033(0x23a)](a59_0x564dd3[_0x9d8033(0x204)]('Cancelled')),0x1;}let _0x4dae71;_0x487e1d?_0x4dae71=await withSpinner(_0x9d8033(0x202),()=>_0x1b2846[_0x9d8033(0x14b)]['retrySession'](_0x4caed0,{'fromTask':_0x447435,'retryParams':_0x46c633}),{'verbose':_0x3ee760[_0x9d8033(0x1ab)]}):_0x4dae71=await withSpinner('Retrying\x20attempt...',()=>_0x1b2846[_0x9d8033(0x14b)][_0x9d8033(0x8d)](_0x4caed0,{'resumeFrom':_0x4691b5,'retryParams':_0x46c633,'force':_0x46ef42}),{'verbose':_0x3ee760[_0x9d8033(0x1ab)]});const _0x5b5a12=_0x4dae71[_0x9d8033(0x138)];return console['error']('✔\x20Retry\x20started'),console[_0x9d8033(0x23a)](_0x9d8033(0x1f3)+_0x5b5a12[_0x9d8033(0x1e9)]),console[_0x9d8033(0x23a)](_0x9d8033(0x13d)+_0x5b5a12['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0xdd);[a59_0x34b1fc(0x229)]=a59_0x34b1fc(0x1da);async[a59_0x34b1fc(0x203)](_0x3ea294){const _0x41d07d=a59_0x34b1fc,{options:_0x2669d4,args:_0x426c6f,tdx:_0x3fcd4f}=_0x3ea294;let _0x276794=_0x426c6f[0x0];if(!_0x276794){const _0x2c4072=this['resolveProject']([],_0x2669d4),_0x1f13af=await withSpinner(_0x41d07d(0x143),()=>_0x3fcd4f[_0x41d07d(0x14b)][_0x41d07d(0x1d0)](_0x2c4072,{'limit':_0x2669d4['limit']}),{'verbose':_0x2669d4[_0x41d07d(0x1ab)]}),_0x4de514=_0x1f13af[_0x41d07d(0x138)];if(_0x4de514['length']===0x0)return console[_0x41d07d(0x23a)](_0x41d07d(0x92)),!_0x2c4072&&console['error'](a59_0x564dd3['dim'](_0x41d07d(0x185))),0x1;const _0x19d9ea=_0x4de514['map'](_0x141ad5=>({'title':_0x141ad5[_0x41d07d(0xc6)]?.[_0x41d07d(0x7b)]+'.'+_0x141ad5[_0x41d07d(0x7b)],'value':_0x141ad5['project']?.[_0x41d07d(0x7b)]+'.'+_0x141ad5[_0x41d07d(0x7b)],'description':_0x141ad5[_0x41d07d(0x22e)]?_0x41d07d(0x214)+_0x141ad5['revision']:undefined})),_0x990561=await a59_0x17b23b({'type':_0x41d07d(0x1fc),'name':_0x41d07d(0x14b),'message':_0x41d07d(0xe3),'choices':_0x19d9ea});if(!_0x990561[_0x41d07d(0x14b)])return 0x1;_0x276794=_0x990561[_0x41d07d(0x14b)];}if(!_0x276794[_0x41d07d(0x228)]('.')){const _0x2e6f86=this[_0x41d07d(0xd0)]([],_0x2669d4);if(_0x2e6f86)_0x276794=_0x2e6f86+'.'+_0x276794;else return console[_0x41d07d(0x23a)](a59_0x564dd3[_0x41d07d(0x1a4)]('Error:'),_0x41d07d(0x76)),console[_0x41d07d(0x23a)](a59_0x564dd3[_0x41d07d(0x6f)](_0x41d07d(0x185))),0x1;}const _0x36ac73=_0x2669d4[_0x41d07d(0x9c)],_0x4894ff=_0x2669d4[_0x41d07d(0xad)],_0x362904={};if(_0x36ac73&&Array[_0x41d07d(0x1e7)](_0x36ac73))for(const _0x54f112 of _0x36ac73){const _0x289621=_0x54f112['indexOf']('=');if(_0x289621===-0x1)return console[_0x41d07d(0x23a)](_0x41d07d(0x130)+_0x54f112),console[_0x41d07d(0x23a)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x584452=_0x54f112[_0x41d07d(0x235)](0x0,_0x289621),_0xa266c6=_0x54f112[_0x41d07d(0x235)](_0x289621+0x1);try{_0x362904[_0x584452]=JSON['parse'](_0xa266c6);}catch{_0x362904[_0x584452]=_0xa266c6;}}_0x2669d4[_0x41d07d(0x1ab)]&&(console[_0x41d07d(0x23a)](_0x41d07d(0x219)+_0x276794),Object['keys'](_0x362904)[_0x41d07d(0x217)]>0x0&&console['error'](_0x41d07d(0xe8)+JSON[_0x41d07d(0x237)](_0x362904)),_0x4894ff&&console[_0x41d07d(0x23a)](_0x41d07d(0x225)+_0x4894ff));if(_0x2669d4[_0x41d07d(0xa6)])return await this[_0x41d07d(0x1d5)](_0x3ea294,_0x276794,_0x362904,_0x4894ff);const _0x589d49=await withSpinner('Starting\x20workflow\x20run...',()=>_0x3fcd4f['workflow'][_0x41d07d(0xba)](_0x276794,_0x362904,{'sessionTime':_0x4894ff}),{'verbose':_0x2669d4[_0x41d07d(0x1ab)]}),_0x2ec36e=_0x589d49[_0x41d07d(0x138)];console[_0x41d07d(0x23a)](_0x41d07d(0xeb)),console[_0x41d07d(0x23a)](_0x41d07d(0x15a)+_0x2ec36e['id']),console[_0x41d07d(0x23a)](_0x41d07d(0x13d)+_0x2ec36e['sessionId']),console[_0x41d07d(0x23a)](_0x41d07d(0xd5)+_0x2ec36e[_0x41d07d(0xc6)]?.[_0x41d07d(0x7b)]),console[_0x41d07d(0x23a)](_0x41d07d(0x134)+_0x2ec36e['workflow']?.[_0x41d07d(0x7b)]);if(_0x2ec36e[_0x41d07d(0xc6)]?.['id']&&_0x2ec36e[_0x41d07d(0x6b)]&&_0x2ec36e['id']){const _0x58bcce=_0x2669d4['site'],_0x33df4e=getConsoleUrl(_0x58bcce,_0x41d07d(0x1cd)+_0x2ec36e[_0x41d07d(0xc6)]['id']+_0x41d07d(0xa3)+_0x2ec36e[_0x41d07d(0x6b)]+_0x41d07d(0x147)+_0x2ec36e['id']);console[_0x41d07d(0x23a)]('\x20\x20Console:\x20'+a59_0x564dd3[_0x41d07d(0x1ae)](_0x33df4e));}return 0x0;}async[a59_0x34b1fc(0x1d5)](_0x45bb18,_0x4af006,_0x128c39,_0x451411){const _0x5072da=a59_0x34b1fc,{options:_0x35f06f,tdx:_0x187efc}=_0x45bb18,_0x49be30=await withSpinner('Fetching\x20workflow\x20'+_0x4af006+_0x5072da(0x104),()=>_0x187efc[_0x5072da(0x14b)][_0x5072da(0x1bc)](_0x4af006),{'verbose':_0x35f06f[_0x5072da(0x1ab)]}),_0x41a223=_0x49be30[_0x5072da(0x138)],_0x383807=_0x451411??new Date()[_0x5072da(0x13a)]();console[_0x5072da(0x223)](a59_0x564dd3[_0x5072da(0x171)](_0x5072da(0x1de)),_0x4af006),console[_0x5072da(0x223)](a59_0x564dd3[_0x5072da(0x171)](_0x5072da(0x112)),_0x383807),console[_0x5072da(0x223)](a59_0x564dd3[_0x5072da(0x171)](_0x5072da(0x73)),JSON[_0x5072da(0x237)](_0x128c39)),console[_0x5072da(0x223)](''),console['log'](a59_0x564dd3[_0x5072da(0x171)](_0x5072da(0x19e)));const _0x3029a7=parseTaskGraph(_0x41a223[_0x5072da(0x200)]??null);if(_0x3029a7[_0x5072da(0x217)]===0x0)console[_0x5072da(0x223)](a59_0x564dd3[_0x5072da(0x6f)](_0x5072da(0x23c)));else for(const _0x16f5d0 of formatTaskGraph(_0x3029a7)){console[_0x5072da(0x223)](_0x16f5d0);}const _0x577ab8=summarizeTaskGraph(_0x3029a7),_0x52f1c1=formatWarningSummary(_0x577ab8);return _0x52f1c1&&(console[_0x5072da(0x223)](''),console['log'](a59_0x564dd3[_0x5072da(0x204)](_0x52f1c1))),console[_0x5072da(0x223)](a59_0x564dd3[_0x5072da(0x204)](_0x5072da(0x82))),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a59_0x34b1fc(0xdb);[a59_0x34b1fc(0x229)]='Download\x20workflow\x20project\x20from\x20Treasure\x20AI';async[a59_0x34b1fc(0x203)](_0x1505bd){const _0x1c4622=a59_0x34b1fc,{options:_0x4c4ab3,args:_0x426670,tdx:_0x18e28d}=_0x1505bd,_0x13d324=_0x426670[0x0],_0xb9205f=_0x426670[0x1]||'.';if(!_0x13d324)return console[_0x1c4622(0x23a)](_0x1c4622(0x129)),console[_0x1c4622(0x23a)](_0x1c4622(0x19c)),0x1;const _0x5c4ace=_0x4c4ab3[_0x1c4622(0x22e)];_0x4c4ab3[_0x1c4622(0x1ab)]&&(console[_0x1c4622(0x23a)](_0x1c4622(0x124)+_0x13d324),console[_0x1c4622(0x23a)]('Output\x20directory:\x20'+_0xb9205f),_0x5c4ace&&console[_0x1c4622(0x23a)]('Revision:\x20'+_0x5c4ace));const _0x35dd2d=await withSpinner(_0x1c4622(0xa8)+_0x13d324+_0x1c4622(0x104),()=>_0x18e28d[_0x1c4622(0x14b)][_0x1c4622(0x239)](_0x13d324,_0xb9205f,{'revision':_0x5c4ace}),{'verbose':_0x4c4ab3[_0x1c4622(0x1ab)]}),_0x467f90=_0x35dd2d['data'];return console['error'](_0x1c4622(0x1eb)+_0x467f90['projectName']),console[_0x1c4622(0x23a)]('\x20\x20Revision:\x20'+_0x467f90[_0x1c4622(0x22e)]),console['error'](_0x1c4622(0x118)+_0x467f90['filesExtracted']),console[_0x1c4622(0x23a)]('\x20\x20Location:\x20'+_0xb9205f+'/'+_0x467f90[_0x1c4622(0x179)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0x205);[a59_0x34b1fc(0x229)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20AI\x20(digdag-style)';async[a59_0x34b1fc(0x203)](_0x1aca34){const _0x12c1bc=a59_0x34b1fc,{options:_0x44bd05,args:_0x3db353,tdx:_0x21f24e}=_0x1aca34;let _0x3f8918='.',_0x1131fe=_0x44bd05[_0x12c1bc(0x7b)];if(_0x3db353[0x0]){const {promises:_0x234f36}=await import('fs');try{const _0x27265d=await _0x234f36[_0x12c1bc(0x14c)](_0x3db353[0x0]);if(_0x27265d[_0x12c1bc(0x1d2)]())_0x3f8918=_0x3db353[0x0];else return console['error']('Error:\x20'+_0x3db353[0x0]+_0x12c1bc(0x221)),0x1;}catch{_0x1131fe=_0x3db353[0x0],_0x3f8918='.';}}const _0x5b155b=_0x44bd05[_0x12c1bc(0x22e)],_0x3fdf8e=_0x44bd05['skipValidation'];_0x44bd05[_0x12c1bc(0x1ab)]&&(console['error']('Project\x20directory:\x20'+_0x3f8918),_0x1131fe&&console['error'](_0x12c1bc(0x21d)+_0x1131fe),_0x5b155b&&console[_0x12c1bc(0x23a)](_0x12c1bc(0x1a9)+_0x5b155b),_0x3fdf8e&&console[_0x12c1bc(0x23a)](_0x12c1bc(0x149)));const _0x45b03e=await withSpinner(_0x12c1bc(0x170),()=>_0x21f24e[_0x12c1bc(0x14b)][_0x12c1bc(0x1f9)](_0x3f8918,{'projectName':_0x1131fe,'revision':_0x5b155b,'skipValidation':_0x3fdf8e}),{'verbose':_0x44bd05['verbose']}),_0x3c7832=_0x45b03e['data'];return console[_0x12c1bc(0x23a)](_0x12c1bc(0x230)+_0x3c7832['projectName']),console[_0x12c1bc(0x23a)](_0x12c1bc(0x245)+_0x3c7832[_0x12c1bc(0x162)]),console[_0x12c1bc(0x23a)]('\x20\x20Revision:\x20'+_0x3c7832[_0x12c1bc(0x22e)]),await this[_0x12c1bc(0xe2)](_0x21f24e,_0x3c7832[_0x12c1bc(0x179)],_0x44bd05[_0x12c1bc(0xc7)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0x16b);[a59_0x34b1fc(0x229)]=a59_0x34b1fc(0xed);async[a59_0x34b1fc(0x203)](_0x2371fb){const _0x511d3e=a59_0x34b1fc,{options:_0x443907,args:_0x17aaab,tdx:_0x5c4ba8}=_0x2371fb,_0x1e986f=_0x17aaab[0x0],_0x65d38=_0x17aaab[0x1];if(!_0x1e986f)return console[_0x511d3e(0x23a)](a59_0x564dd3['red'](_0x511d3e(0x168)),_0x511d3e(0x1ac)),console[_0x511d3e(0x23a)](a59_0x564dd3[_0x511d3e(0x6f)](_0x511d3e(0x193))),0x1;const _0x41b16d=_0x443907[_0x511d3e(0x22e)];_0x443907['verbose']&&(console[_0x511d3e(0x23a)](_0x511d3e(0x124)+_0x1e986f),_0x65d38&&console[_0x511d3e(0x23a)](_0x511d3e(0x1bd)+_0x65d38),_0x41b16d&&console[_0x511d3e(0x23a)](_0x511d3e(0x1a9)+_0x41b16d),_0x443907[_0x511d3e(0xa6)]&&console[_0x511d3e(0x23a)](_0x511d3e(0x1d1)));const _0x46895c=await withSpinner(_0x511d3e(0x151)+_0x1e986f+_0x511d3e(0x104),()=>_0x5c4ba8[_0x511d3e(0x14b)]['pullProject'](_0x1e986f,{'targetDir':_0x65d38,'revision':_0x41b16d}),{'verbose':_0x443907[_0x511d3e(0x1ab)]}),_0x21990b=_0x46895c[_0x511d3e(0x138)];_0x21990b[_0x511d3e(0x1ce)]?console['error'](_0x511d3e(0x19b)+_0x21990b[_0x511d3e(0x179)]):console[_0x511d3e(0x23a)](_0x511d3e(0x20f)+_0x21990b[_0x511d3e(0x179)]);console['error'](_0x511d3e(0x189)+_0x21990b[_0x511d3e(0x22e)]),console[_0x511d3e(0x23a)](_0x511d3e(0x102)+(a59_0x156221['relative'](process[_0x511d3e(0x154)](),_0x21990b['targetDir'])||'.')),console[_0x511d3e(0x23a)](_0x511d3e(0x146)+a59_0x564dd3[_0x511d3e(0xcd)]('+'+_0x21990b[_0x511d3e(0x1f8)][_0x511d3e(0xb2)]+_0x511d3e(0xc2))+',\x20'+(a59_0x564dd3[_0x511d3e(0x204)]('~'+_0x21990b[_0x511d3e(0x1f8)][_0x511d3e(0xa7)]+_0x511d3e(0x232))+',\x20')+(a59_0x564dd3[_0x511d3e(0x1a4)]('-'+_0x21990b[_0x511d3e(0x1f8)][_0x511d3e(0x173)]+_0x511d3e(0x1a7))+',\x20')+(''+a59_0x564dd3[_0x511d3e(0x6f)](_0x21990b[_0x511d3e(0x1f8)][_0x511d3e(0x144)]+_0x511d3e(0xa5))));for(const _0x49c5cb of _0x21990b['changes']){_0x49c5cb[_0x511d3e(0x14a)]===_0x511d3e(0xa7)&&_0x49c5cb[_0x511d3e(0x7e)]&&(console['error']('\x0a'+a59_0x564dd3[_0x511d3e(0x1ae)](_0x511d3e(0xb8)+_0x49c5cb[_0x511d3e(0x11f)])),console['error'](_0x49c5cb['diff']));}if(!_0x21990b['hasChanges'])return saveSessionContext({'workflow_project':_0x21990b[_0x511d3e(0x179)]},_0x443907[_0x511d3e(0x167)]),console[_0x511d3e(0x23a)](a59_0x564dd3[_0x511d3e(0xcd)](_0x511d3e(0xe1))),console[_0x511d3e(0x23a)](a59_0x564dd3['dim'](_0x511d3e(0xd1)+_0x21990b[_0x511d3e(0x179)])),0x0;if(_0x443907['dryRun'])return console[_0x511d3e(0x23a)](a59_0x564dd3[_0x511d3e(0x204)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x443907['yes']){if(!isInteractive())return console[_0x511d3e(0x23a)](a59_0x564dd3['red'](_0x511d3e(0x131)),_0x511d3e(0x246)),console[_0x511d3e(0x23a)](a59_0x564dd3[_0x511d3e(0x6f)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x12aecd=await confirmKey(_0x511d3e(0x176));if(!_0x12aecd)return console[_0x511d3e(0x23a)](a59_0x564dd3['yellow'](_0x511d3e(0xf4)),_0x511d3e(0x234)),0x1;}await withSpinner(_0x511d3e(0x215),()=>_0x5c4ba8[_0x511d3e(0x14b)][_0x511d3e(0x172)](_0x21990b,{'revision':_0x41b16d}),{'verbose':_0x443907[_0x511d3e(0x1ab)]}),saveSessionContext({'workflow_project':_0x21990b['projectName']},_0x443907['session']),console[_0x511d3e(0x23a)](a59_0x564dd3[_0x511d3e(0xcd)]('✔\x20Pull\x20complete'));const _0x23ecdf=a59_0x156221[_0x511d3e(0x66)](process['cwd'](),_0x21990b[_0x511d3e(0xa4)])||'.';return console[_0x511d3e(0x23a)](a59_0x564dd3[_0x511d3e(0x6f)](_0x511d3e(0x196)+_0x23ecdf)),console['error'](a59_0x564dd3[_0x511d3e(0x6f)](_0x511d3e(0xd1)+_0x21990b['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0x16a);['description']=a59_0x34b1fc(0x17e);async['execute'](_0x344b01){const _0x48beb3=a59_0x34b1fc,{options:_0x25a3be,args:_0x30127a,tdx:_0x5c814f}=_0x344b01,_0x12b29e=this['resolveProjectDir'](_0x30127a,_0x25a3be),_0x391d6b=_0x25a3be,{revision:_0x6faee8,skipValidation:_0x2e47bc,backfill:_0x59b05d}=_0x391d6b,_0x3ca0f9=_0x59b05d===undefined?undefined:!_0x59b05d;_0x25a3be['verbose']&&(_0x12b29e&&console[_0x48beb3(0x23a)](_0x48beb3(0x1bf)+_0x12b29e),_0x6faee8&&console[_0x48beb3(0x23a)](_0x48beb3(0x1a9)+_0x6faee8),_0x25a3be[_0x48beb3(0xa6)]&&console[_0x48beb3(0x23a)](_0x48beb3(0x1d1)),_0x2e47bc&&console[_0x48beb3(0x23a)](_0x48beb3(0x149)),_0x59b05d&&console['error'](_0x48beb3(0x236)));let _0xb4f166;try{_0xb4f166=await withSpinner(_0x48beb3(0x150),()=>_0x5c814f['workflow'][_0x48beb3(0x1ec)]({'sourceDir':_0x12b29e,'revision':_0x6faee8,'skipValidation':_0x2e47bc,'skipSchedule':_0x3ca0f9}),{'verbose':_0x25a3be[_0x48beb3(0x1ab)]});}catch(_0x5674b4){if(_0x5674b4 instanceof Error&&_0x5674b4['message'][_0x48beb3(0x228)](_0x48beb3(0xe6)))return console[_0x48beb3(0x23a)](a59_0x564dd3[_0x48beb3(0x1a4)](_0x48beb3(0x168)),_0x48beb3(0xea)),_0x25a3be[_0x48beb3(0x20b)]?console[_0x48beb3(0x23a)](a59_0x564dd3[_0x48beb3(0x6f)](_0x48beb3(0x14f)+_0x25a3be[_0x48beb3(0x20b)]+_0x48beb3(0xf8)+_0x25a3be[_0x48beb3(0x20b)]+'\x27')):console[_0x48beb3(0x23a)](a59_0x564dd3[_0x48beb3(0x6f)](_0x48beb3(0x133))),0x1;throw _0x5674b4;}const _0x350cab=_0xb4f166['data'];console['error'](_0x48beb3(0x109)+_0x350cab['projectName']),console[_0x48beb3(0x23a)](_0x48beb3(0xa9)+_0x350cab['sourceDir']),console[_0x48beb3(0x23a)]('\x20\x20Revision:\x20'+_0x350cab[_0x48beb3(0x22e)]),console['error'](_0x48beb3(0x146)+a59_0x564dd3[_0x48beb3(0xcd)]('+'+_0x350cab['summary'][_0x48beb3(0xb2)]+_0x48beb3(0xc2))+',\x20'+(a59_0x564dd3[_0x48beb3(0x204)]('~'+_0x350cab[_0x48beb3(0x1f8)]['modified']+_0x48beb3(0x232))+',\x20')+(a59_0x564dd3[_0x48beb3(0x1a4)]('-'+_0x350cab[_0x48beb3(0x1f8)][_0x48beb3(0x173)]+_0x48beb3(0x1a7))+',\x20')+(''+a59_0x564dd3['dim'](_0x350cab['summary']['unchanged']+_0x48beb3(0xa5))));for(const _0x2b89db of _0x350cab[_0x48beb3(0x135)]){_0x2b89db[_0x48beb3(0x14a)]===_0x48beb3(0xa7)&&_0x2b89db['diff']&&(console[_0x48beb3(0x23a)]('\x0a'+a59_0x564dd3[_0x48beb3(0x1ae)](_0x48beb3(0xb8)+_0x2b89db[_0x48beb3(0x11f)])),console[_0x48beb3(0x23a)](_0x2b89db[_0x48beb3(0x7e)]));}if(!_0x350cab[_0x48beb3(0x10e)])return console[_0x48beb3(0x23a)](a59_0x564dd3[_0x48beb3(0xcd)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x48beb3(0xe2)](_0x5c814f,_0x350cab[_0x48beb3(0x179)],_0x25a3be[_0x48beb3(0xc7)]),0x0;if(_0x25a3be[_0x48beb3(0xa6)])return console[_0x48beb3(0x23a)](a59_0x564dd3[_0x48beb3(0x204)](_0x48beb3(0xf5))),0x0;if(!_0x25a3be[_0x48beb3(0x100)]){if(!isInteractive())return console[_0x48beb3(0x23a)](a59_0x564dd3[_0x48beb3(0x1a4)](_0x48beb3(0x131)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a59_0x564dd3[_0x48beb3(0x6f)](_0x48beb3(0xbb))),0x1;const _0x269724=await confirmKey(_0x48beb3(0x1dc));if(!_0x269724)return console['error'](a59_0x564dd3[_0x48beb3(0x204)](_0x48beb3(0xf4)),_0x48beb3(0xc4)),0x1;}const _0x1fd621=await withSpinner(_0x48beb3(0x180),()=>_0x5c814f[_0x48beb3(0x14b)][_0x48beb3(0xb4)](_0x350cab),{'verbose':_0x25a3be[_0x48beb3(0x1ab)]}),_0x3d0723=_0x1fd621[_0x48beb3(0x138)];return console[_0x48beb3(0x23a)](a59_0x564dd3[_0x48beb3(0xcd)]('✔\x20Push\x20complete')),console[_0x48beb3(0x23a)](_0x48beb3(0x245)+_0x3d0723[_0x48beb3(0x162)]),console[_0x48beb3(0x23a)](_0x48beb3(0x189)+_0x3d0723[_0x48beb3(0x22e)]),await this[_0x48beb3(0xe2)](_0x5c814f,_0x3d0723[_0x48beb3(0x179)],_0x25a3be[_0x48beb3(0xc7)]),0x0;}}function a59_0x314e(){const _0x2327d4=['disableSchedule','\x20\x20Attempt\x20ID:\x20','--schedule-id\x20cannot\x20be\x20combined\x20with\x20a\x20project.workflow\x20filter','Killing\x20attempt...','Disabling\x20schedule\x20#','.\x20Expected\x20format:\x20KEY=VALUE','TASK_NAME_WIDTH','setSecrets','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','projectId','size','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Analyzing\x20project...','Session\x20','session','Error:','Usage:\x20workflow:delete\x20<project-name-or-id>','workflow:push','workflow:pull','workflow:secrets:delete','Session\x20not\x20found:\x20','localeCompare','Project\x20filter:\x20','Pushing\x20workflow\x20project...','bold','applyPullProject','deleted','fill','Invalid\x20format:\x20','\x0aApply\x20these\x20changes?','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','\x22?\x20This\x20cannot\x20be\x20undone.','projectName','fromTask','workflow:tasks','\x0a⚠\x20Project\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20AI','start','Pushing\x20project...','Files\x20to\x20upload:\x20','From\x20task:\x20','durationMs','now','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','icon','executeCloneProject','81mYFePZ','\x20\x20Revision:\x20','\x20from\x20session\x20','Source\x20directory\x20is\x20required','workflowName','newProjectId','total','round','✔\x20Showing\x20','listSecrets','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','parseProjectWorkflowPattern','unknown','\x20\x20Location:\x20','format','nextTime','Key\x20cannot\x20be\x20empty','values','→\x20New\x20project:\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','\x20to\x20see\x20detailed\x20logs','Task\x20graph:','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','\x20schedule','padStart','workflow:kill','has','red','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','\x20deleted','sourceDir','Revision:\x20','🔄\x20','verbose','Project\x20name\x20is\x20required','getDate','cyan','✔\x20Clone\x20complete','POLL_INTERVAL_MS','Schedule\x20ID\x20is\x20required','workflow:attempt','replace','\x20(use\x20a\x20larger\x20--limit\x20to\x20show\x20more)','toLowerCase','status','success','Setting\x20','find','basename','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','getWorkflow','Target\x20directory:\x20','existingProjectId','Source\x20directory:\x20','Listing\x20workflow\x20projects...','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','MIN_TIMELINE_WIDTH','Source\x20project:\x20','match','deleteSecret','List\x20workflows','workflow:use','follow','323397MSyGvm','workflow:schedule:disable','358606AEHeTe','✔\x20Schedule\x20found','/app/workflows/','isNewProject','5WSeZwj','workflows','Dry\x20run:\x20yes','isDirectory','keys','\x20(system)','executeDryRun','Listing\x20secrets...','Deleting\x20secret...','duration','enableSchedule','Start\x20a\x20workflow\x20run','No\x20sessions\x20found','\x0aPush\x20these\x20changes?','\x0aDry\x20run\x20-\x20no\x20project\x20created','Workflow:','MAX_LABEL_COUNT','No\x20attempts\x20found','workflow:workflows','planned','Latest\x20session\x20has\x20no\x20attempt','every','Loading\x20session...','getHours','isArray','json','attemptId','session:','✔\x20Downloaded\x20','preparePushProject','Show\x20tasks\x20for\x20an\x20attempt','targetExists','sessions','\x20attempt','filter','end','\x20\x20New\x20attempt\x20ID:\x20','\x22\x20to\x20new\x20project\x20\x22','✔\x20Secret\x20\x27','blue','workflow:logs','summary','push','Attempt\x20ID:\x20','Listing\x20workflows...','select','Filter:\x20','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','config','workflow:attempts','Retrying\x20session...','execute','yellow','workflow:upload','6769104pQZXuz','\x20(use\x20--limit\x20to\x20show\x20more)','buildTimelineData','get','lastAttempt','workflowProject','startedAt','Cloning\x20to\x20','set','→\x20Project:\x20','retryAttemptName','listProjectSchedules','Enable\x20a\x20workflow\x20schedule','requireProject','revision:\x20','Writing\x20files...','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','length','List\x20workflow\x20schedules','Workflow:\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','prepareCloneProject','No\x20matching\x20sessions\x20found','Project\x20name:\x20','Setting\x20secret...','kill','Retry\x20a\x20session\x20or\x20attempt','\x20is\x20not\x20a\x20directory','721950KZqNqN','log','state','Session\x20time:\x20','MAX_POLL_ITERATIONS','Error:\x20Invalid\x20JSON\x20in\x20--params','includes','description','attempt','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Delete\x20workflow\x20project\x20from\x20Treasure\x20AI','New\x20project\x20name:\x20','revision','write','✔\x20Pushed\x20','2299876YqaXrG','\x20modified','\x20session','-\x20no\x20files\x20written','substring','Schedule:\x20backfill\x20runs\x20enabled\x20(--backfill)','stringify','ICON_SPACING','download','error','pollTimeline','\x20\x20(no\x20tasks\x20found\x20in\x20workflow\x20definition)','Key:\x20','(unknown)','📅\x20#','workflow:retry','List\x20workflow\x20attempts','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','✔\x20Deleted\x20project\x20','\x20\x20Project\x20ID:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','canceling','\x20next:\x20','Fetching\x20schedule\x20#','✔\x20Found\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','context','skipValidation','key','white','sort','relative','No\x20attempts\x20found\x20for:\x20','No\x20projects\x20match\x20pattern:\x20','Updating\x20','nextRunTime','sessionId','renderSessionsTimeline','Auto-selected\x20latest\x20session:\x20','running','dim','Force:\x20yes','Listing\x20workflow\x20attempts...','No\x20attempts\x20found\x20in\x20project:\x20','Parameters:','tdx\x20wf\x20attempt\x20','LABEL_WIDTH_DIVISOR','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','jsonl','navigateSessionsInteractive','\x20sessions\x20','getMonth','name','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','limit','diff','No\x20sessions\x20found\x20for:\x20','utf-8','force','\x0a[Dry\x20run]\x20Workflow\x20was\x20NOT\x20executed.','getFullYear','taskName','trimEnd','\x0a✔\x20Attempt\x20complete','No\x20workflows\x20found\x20in\x20project:\x20','resolveProjectId','resumeFrom','5014401vXiMvU','value','startTime','retryAttempt','task','\x27...','Select\x20a\x20session\x20to\x20view\x20timeline:','\x20enabled\x20(','No\x20workflows\x20found','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Select\x20a\x20task\x20to\x20view\x20logs:','output','skipSchedule','reason','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','Listing\x20schedules\x20for\x20','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','Downloading\x20logs...','param','\x22\x20with\x20new\x20revision?','floor','logs','cancelRequested','\x20logs','\x20of\x20','/sessions/','targetDir','\x20unchanged','dryRun','modified','Downloading\x20project\x20','\x20\x20Source:\x20','Error:\x20Secret\x20key\x20is\x20required','list','Error:\x20Attempt\x20ID\x20is\x20required','sessionTime','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','repeat','MIN_LABEL_COUNT','map','new','8CXngbg','executePushProject','No\x20sessions\x20found\x20in\x20project:\x20','includeRetried','List\x20workflow\x20execution\x20sessions','---\x20','msPerChar','run','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','done','resolve','renderTimeline','startsWith','createdAt','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','\x20new','max','-\x20nothing\x20pushed','Secrets\x20to\x20set:\x20','project','site','Listing\x20workflow\x20sessions...','metadata','generateSessionTimelineRows','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','splice','green','title','4195104jnhgxq','resolveProject','\x20\x20Session\x20context\x20set\x20to:\x20','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','\x27\x20from\x20project\x20\x27','index','\x20\x20Project:\x20','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','workflow:secrets:list','Including\x20subtasks:\x20yes','tdx.json','\x20\x20Console:\x20','workflow:download','\x1b[1A\x1b[2K','workflow:run','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Warning:','Resolving\x20project\x20\x27','\x0a✔\x20Already\x20up\x20to\x20date','showWorkflowConsoleUrl','Select\x20a\x20workflow\x20to\x20run','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','params','No\x20workflow\x20tdx.json\x20found','toLocaleString','Parameters:\x20','Getting\x20attempt\x20tasks...','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','✔\x20Workflow\x20run\x20started','from','Pull\x20workflow\x20project\x20to\x20local\x20folder','No\x20sessions\x20with\x20timing\x20information','✔\x20Schedule\x20#','updatedAt','Getting\x20attempt\x20details...','✔\x20Workflow\x20project\x20context\x20cleared.','some','Cancelled','\x0aDry\x20run\x20-\x20nothing\x20pushed','LABEL_MIN_SPACING','join','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','Kill\x20a\x20running\x20attempt','Fetching\x20log\x20files...','delete','clear','\x20(disabled)','Usage:\x20tdx\x20wf\x20schedule\x20list\x20[project[.workflow]]\x20|\x20--schedule-id\x20<id>','renderSingleTimeline','yes','split','\x20\x20Target:\x20','Failed\x20to\x20fetch\x20attempt\x20data','...','min','✔\x20Project\x20updated','\x20has\x20no\x20attempts','Using\x20attempt\x20','✔\x20Project:\x20','finishedAt','isTTY','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','\x20secrets\x20set\x20for\x20project\x20\x27','hasChanges','projects','Task\x20name:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Session\x20time:','GUTTER','✔\x20Workflow\x20project\x20set\x20to:\x20','Pattern:\x20','Attempt:\x20','columns','\x20\x20Files\x20extracted:\x20','newProjectName','getTime','Disable\x20a\x20workflow\x20schedule','workflow:schedule:enable','\x0aClone\x20\x22','fullName','path','ICON_WIDTH','session_id','stdout','Filter:\x20project=','Project:\x20','No\x20log\x20content\x20found','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Enabling\x20schedule\x20#','Error:\x20Project\x20name\x20is\x20required','all','sourceProjectName','displayLine','\x22\x20already\x20exists\x20(ID:\x20','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Resume\x20from:\x20','Error:\x20Invalid\x20parameter\x20format:\x20','\x0aError:','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','\x20\x20Workflow:\x20','changes','Usage:\x20tdx\x20wf\x20use\x20<project>','\x20secret','data','\x20\x20Next\x20run:\x20','toISOString','\x20-\x20','fileSize','\x20\x20Session\x20ID:\x20','window','table','(use\x20--limit\x20to\x20see\x20more)','\x0aFailed\x20to\x20fetch\x20attempt\x20data','listSchedules','Loading\x20workflows...','unchanged','pending','\x20\x20Changes:\x20','/attempt/','tasks','Validation:\x20skipped','type','workflow','stat','group_error','resolveProjectDir','Tip:\x20cd\x20to\x20workflows/','Analyzing\x20changes...','Pulling\x20project\x20','trim','MAX_TASKS_DISPLAY','cwd','\x20task','slice','attempts','Loading\x20sessions...'];a59_0x314e=function(){return _0x2327d4;};return a59_0x314e();}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a59_0x34b1fc(0x7b)]='workflow:clone';[a59_0x34b1fc(0x229)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a59_0x34b1fc(0x203)](_0xecdbdb){const _0x11b0bb=a59_0x34b1fc,{options:_0x379dd0,args:_0x44d631,tdx:_0x1e6499}=_0xecdbdb,_0xcda34f=this['resolveProjectDir'](_0x44d631,_0x379dd0),_0x41cf33=_0x379dd0['name'],_0xe76a31=_0x379dd0[_0x11b0bb(0x22e)],_0x591227=_0x379dd0[_0x11b0bb(0x24d)];if(!_0xcda34f)return console[_0x11b0bb(0x23a)](a59_0x564dd3[_0x11b0bb(0x1a4)](_0x11b0bb(0x168)),_0x11b0bb(0x18b)),console['error'](a59_0x564dd3[_0x11b0bb(0x6f)](_0x11b0bb(0x10c))),console['error'](a59_0x564dd3[_0x11b0bb(0x6f)](_0x11b0bb(0x1ff))),0x1;if(!_0x41cf33)return console[_0x11b0bb(0x23a)](a59_0x564dd3[_0x11b0bb(0x1a4)]('Error:'),_0x11b0bb(0x9a)),console['error'](a59_0x564dd3['dim']('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x379dd0['verbose']&&(console[_0x11b0bb(0x23a)](_0x11b0bb(0x1bf)+_0xcda34f),console['error'](_0x11b0bb(0x22d)+_0x41cf33),_0xe76a31&&console[_0x11b0bb(0x23a)](_0x11b0bb(0x1a9)+_0xe76a31),_0x379dd0[_0x11b0bb(0xa6)]&&console[_0x11b0bb(0x23a)]('Dry\x20run:\x20yes'),_0x591227&&console[_0x11b0bb(0x23a)](_0x11b0bb(0x149)));const _0x361bce=await withSpinner(_0x11b0bb(0x165),()=>_0x1e6499['workflow'][_0x11b0bb(0x21b)](_0xcda34f,_0x41cf33,{'revision':_0xe76a31,'skipValidation':_0x591227}),{'verbose':_0x379dd0[_0x11b0bb(0x1ab)]}),_0x349c3a=_0x361bce['data'];console[_0x11b0bb(0x23a)]('Source:\x20'+_0x349c3a[_0x11b0bb(0x1a8)]);_0x349c3a['sourceProjectName']&&console[_0x11b0bb(0x23a)](_0x11b0bb(0x1c3)+_0x349c3a[_0x11b0bb(0x12b)]);console[_0x11b0bb(0x23a)](_0x11b0bb(0x22d)+_0x349c3a[_0x11b0bb(0x119)]),console[_0x11b0bb(0x23a)](_0x11b0bb(0x1a9)+_0x349c3a['revision']),console[_0x11b0bb(0x23a)](_0x11b0bb(0x181)+_0x349c3a['fileCount']);_0x349c3a[_0x11b0bb(0x1ee)]&&(console[_0x11b0bb(0x23a)](a59_0x564dd3['yellow'](_0x11b0bb(0x17c)+_0x349c3a['newProjectName']+_0x11b0bb(0x12d)+_0x349c3a[_0x11b0bb(0x1be)]+')')),console['error'](a59_0x564dd3[_0x11b0bb(0x204)](_0x11b0bb(0x161))));if(_0x379dd0[_0x11b0bb(0xa6)])return console[_0x11b0bb(0x23a)](a59_0x564dd3[_0x11b0bb(0x204)](_0x11b0bb(0x1dd))),0x0;if(!_0x379dd0[_0x11b0bb(0x100)]){if(!isInteractive())return console[_0x11b0bb(0x23a)](a59_0x564dd3[_0x11b0bb(0x1a4)]('\x0aError:'),_0x11b0bb(0x246)),console[_0x11b0bb(0x23a)](a59_0x564dd3['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x10527a=_0x349c3a[_0x11b0bb(0x12b)]||a59_0x156221[_0x11b0bb(0x1ba)](_0xcda34f),_0x33bb48=_0x349c3a[_0x11b0bb(0x1ee)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x41cf33+_0x11b0bb(0x9d):_0x11b0bb(0x11d)+_0x10527a+_0x11b0bb(0x1f4)+_0x41cf33+'\x22?',_0xb4c4a4=await confirmKey(_0x33bb48);if(!_0xb4c4a4)return console['error'](a59_0x564dd3[_0x11b0bb(0x204)]('Cancelled')),0x1;}const _0x5d3968=await withSpinner(_0x349c3a[_0x11b0bb(0x1ee)]?_0x11b0bb(0x69)+_0x41cf33+_0x11b0bb(0x104):_0x11b0bb(0x20d)+_0x41cf33+'...',()=>_0x1e6499[_0x11b0bb(0x14b)][_0x11b0bb(0x187)](_0x349c3a),{'verbose':_0x379dd0['verbose']}),_0x3084d5=_0x5d3968[_0x11b0bb(0x138)];return console[_0x11b0bb(0x23a)](a59_0x564dd3['green'](_0x349c3a[_0x11b0bb(0x1ee)]?_0x11b0bb(0x106):_0x11b0bb(0x1af))),console[_0x11b0bb(0x23a)](_0x11b0bb(0xd5)+_0x3084d5[_0x11b0bb(0x119)]),console[_0x11b0bb(0x23a)](_0x11b0bb(0x245)+_0x3084d5[_0x11b0bb(0x18d)]),console[_0x11b0bb(0x23a)](_0x11b0bb(0x189)+_0x3084d5[_0x11b0bb(0x22e)]),await this[_0x11b0bb(0xe2)](_0x1e6499,_0x3084d5[_0x11b0bb(0x119)],_0x379dd0['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a59_0x34b1fc(0x7b)]='workflow:delete';[a59_0x34b1fc(0x229)]=a59_0x34b1fc(0x22c);async[a59_0x34b1fc(0x203)](_0x3fce1b){const _0x4759d3=a59_0x34b1fc,{options:_0xbd6e4f,args:_0x43e6a2,tdx:_0x372e51}=_0x3fce1b,_0x5ddb78=_0x43e6a2[0x0];if(!_0x5ddb78)return console['error'](_0x4759d3(0x12e)),console[_0x4759d3(0x23a)](_0x4759d3(0x169)),0x1;_0xbd6e4f[_0x4759d3(0x1ab)]&&console['error'](_0x4759d3(0x124)+_0x5ddb78);if(!_0xbd6e4f[_0x4759d3(0x100)]){if(!isInteractive())return console[_0x4759d3(0x23a)](a59_0x564dd3[_0x4759d3(0x1a4)](_0x4759d3(0x131)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4759d3(0x23a)](a59_0x564dd3['dim'](_0x4759d3(0xbb))),0x1;const _0x345f88=await confirmKey(_0x4759d3(0xe4)+_0x5ddb78+_0x4759d3(0x178));if(!_0x345f88)return console[_0x4759d3(0x23a)](a59_0x564dd3[_0x4759d3(0x204)](_0x4759d3(0xf4))),0x1;}const _0x156969=await withSpinner('Deleting\x20project\x20'+_0x5ddb78+'...',()=>_0x372e51['workflow'][_0x4759d3(0xfb)](_0x5ddb78),{'verbose':_0xbd6e4f[_0x4759d3(0x1ab)]}),_0x1336cb=_0x156969['data'];return console[_0x4759d3(0x23a)](_0x4759d3(0x244)+_0x1336cb[_0x4759d3(0x179)]),console[_0x4759d3(0x23a)](_0x4759d3(0x245)+_0x1336cb[_0x4759d3(0x162)]),0x0;}}export function parseKeyValue(_0x6de4ad){const _0x32a7b8=a59_0x34b1fc,_0x41044b=_0x6de4ad['indexOf']('=');if(_0x41044b===-0x1)throw new Error(_0x32a7b8(0x175)+_0x6de4ad+_0x32a7b8(0x15e));const _0x16db05=_0x6de4ad[_0x32a7b8(0x235)](0x0,_0x41044b),_0x51ada7=_0x6de4ad['substring'](_0x41044b+0x1);if(!_0x16db05)throw new Error(_0x32a7b8(0x199));return{'key':_0x16db05,'value':_0x51ada7};}function a59_0x2d50(_0x4be168,_0x591872){_0x4be168=_0x4be168-0x65;const _0x314e2e=a59_0x314e();let _0x2d5078=_0x314e2e[_0x4be168];return _0x2d5078;}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0xd7);['description']='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a59_0x34b1fc(0x203)](_0x1b3e09){const _0x10f02c=a59_0x34b1fc,{options:_0x363b12,args:_0x582f2b,tdx:_0x1e9b87}=_0x1b3e09,_0xd1ebfd=this[_0x10f02c(0x213)](_0x582f2b,_0x363b12);if(!_0xd1ebfd)return 0x1;_0x363b12['verbose']&&console[_0x10f02c(0x23a)](_0x10f02c(0x124)+_0xd1ebfd);const _0x52b2b7=await withSpinner(_0x10f02c(0x1d6),()=>_0x1e9b87[_0x10f02c(0x14b)][_0x10f02c(0x191)](_0xd1ebfd),{'verbose':_0x363b12['verbose']}),{secrets:_0xa29f93}=_0x52b2b7[_0x10f02c(0x138)];return console[_0x10f02c(0x23a)](_0x10f02c(0x24a)+_0xa29f93[_0x10f02c(0x217)]+_0x10f02c(0x137)+(_0xa29f93['length']!==0x1?'s':'')),await handleSDKOutput(_0xa29f93,_0x363b12),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a59_0x34b1fc(0x7b)]='workflow:secrets:set';[a59_0x34b1fc(0x229)]=a59_0x34b1fc(0x1a5);async['execute'](_0x3805b9){const _0x4b38f6=a59_0x34b1fc,{options:_0x35719a,args:_0x727768,tdx:_0x3d749a}=_0x3805b9;let _0x3a4352,_0x34e564;if(_0x727768[_0x4b38f6(0x217)]>=0x1&&!_0x727768[0x0][_0x4b38f6(0x228)]('='))_0x3a4352=_0x727768[0x0],_0x34e564=_0x727768[_0x4b38f6(0x156)](0x1);else{if(_0x727768[_0x4b38f6(0x217)]>=0x1&&_0x35719a[_0x4b38f6(0x20b)])_0x3a4352=_0x35719a[_0x4b38f6(0x20b)],_0x34e564=_0x727768;else return _0x727768[_0x4b38f6(0x217)]>=0x1?(console[_0x4b38f6(0x23a)](_0x4b38f6(0x129)),console['error'](_0x4b38f6(0x185)),0x1):(console['error'](_0x4b38f6(0x126)),console[_0x4b38f6(0x23a)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1);}if(_0x34e564[_0x4b38f6(0x217)]===0x0)return console['error']('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x4b38f6(0x23a)](_0x4b38f6(0x192)),0x1;const _0x22731a={};try{for(const _0xde08fd of _0x34e564){const {key:_0x328062,value:_0x1ca621}=parseKeyValue(_0xde08fd);_0x22731a[_0x328062]=_0x1ca621;}}catch(_0x228745){return _0x228745 instanceof Error&&console[_0x4b38f6(0x23a)](a59_0x564dd3[_0x4b38f6(0x1a4)]('Error:'),_0x228745['message']),0x1;}const _0x38bf50=Object[_0x4b38f6(0x1d3)](_0x22731a);_0x35719a[_0x4b38f6(0x1ab)]&&(console['error']('Project:\x20'+_0x3a4352),console['error'](_0x4b38f6(0xc5)+_0x38bf50[_0x4b38f6(0xf7)](',\x20')));const _0x315a8b=await withSpinner(_0x38bf50[_0x4b38f6(0x217)]===0x1?_0x4b38f6(0x21e):_0x4b38f6(0x1b8)+_0x38bf50[_0x4b38f6(0x217)]+'\x20secrets...',()=>_0x3d749a[_0x4b38f6(0x14b)][_0x4b38f6(0x160)](_0x3a4352,_0x22731a),{'verbose':_0x35719a[_0x4b38f6(0x1ab)]}),_0x84b7c4=_0x315a8b[_0x4b38f6(0x138)];return console[_0x4b38f6(0x23a)](_0x38bf50['length']===0x1?_0x4b38f6(0x1f5)+_0x84b7c4[_0x4b38f6(0x1d3)][0x0]+_0x4b38f6(0x93)+_0x84b7c4['projectName']+'\x27':'✔\x20'+_0x84b7c4[_0x4b38f6(0x1d3)][_0x4b38f6(0x217)]+_0x4b38f6(0x10d)+_0x84b7c4[_0x4b38f6(0x179)]+'\x27'),(_0x35719a[_0x4b38f6(0x1e8)]||_0x35719a[_0x4b38f6(0x77)])&&await handleSingleObjectOutput(_0x84b7c4,_0x35719a),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0x16c);[a59_0x34b1fc(0x229)]=a59_0x34b1fc(0xde);async[a59_0x34b1fc(0x203)](_0xf74d40){const _0x42593b=a59_0x34b1fc,{options:_0x6e080a,args:_0x458cdf,tdx:_0x162372}=_0xf74d40;let _0x3d9ca3,_0x23860d;if(_0x458cdf[_0x42593b(0x217)]>=0x2)_0x3d9ca3=_0x458cdf[0x0],_0x23860d=_0x458cdf[0x1];else{if(_0x458cdf[_0x42593b(0x217)]===0x1&&_0x6e080a[_0x42593b(0x20b)])_0x3d9ca3=_0x6e080a[_0x42593b(0x20b)],_0x23860d=_0x458cdf[0x0];else return _0x458cdf[_0x42593b(0x217)]===0x1?(console[_0x42593b(0x23a)](_0x42593b(0x129)),console[_0x42593b(0x23a)](_0x42593b(0x185)),0x1):(console[_0x42593b(0x23a)](_0x42593b(0xaa)),console[_0x42593b(0x23a)]('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x6e080a[_0x42593b(0x1ab)]&&(console[_0x42593b(0x23a)]('Project:\x20'+_0x3d9ca3),console[_0x42593b(0x23a)](_0x42593b(0x23d)+_0x23860d));if(!_0x6e080a[_0x42593b(0x100)]){if(!isInteractive())return console[_0x42593b(0x23a)](a59_0x564dd3[_0x42593b(0x1a4)](_0x42593b(0x131)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x42593b(0x23a)](a59_0x564dd3[_0x42593b(0x6f)](_0x42593b(0xbb))),0x1;const _0x1f2c21=await confirmKey(_0x42593b(0x216)+_0x23860d+_0x42593b(0xd3)+_0x3d9ca3+'\x27?');if(!_0x1f2c21)return console[_0x42593b(0x23a)](a59_0x564dd3[_0x42593b(0x204)]('Cancelled')),0x1;}const _0x5962f6=await withSpinner(_0x42593b(0x1d7),()=>_0x162372['workflow'][_0x42593b(0x1c5)](_0x3d9ca3,_0x23860d),{'verbose':_0x6e080a[_0x42593b(0x1ab)]}),_0x23776d=_0x5962f6[_0x42593b(0x138)];return console[_0x42593b(0x23a)](_0x42593b(0x1f5)+_0x23776d['key']+_0x42593b(0x1a6)+_0x23776d['projectName']+'\x27'),(_0x6e080a[_0x42593b(0x1e8)]||_0x6e080a[_0x42593b(0x77)])&&await handleSingleObjectOutput(_0x23776d,_0x6e080a),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(_0x5e51f8){const _0x2e5b40=a59_0x34b1fc,_0xd60a62=Math[_0x2e5b40(0x9e)](_0x5e51f8/0x3e8),_0x4cce52=Math[_0x2e5b40(0x9e)](_0xd60a62/0x3c),_0x1971a1=Math[_0x2e5b40(0x9e)](_0x4cce52/0x3c),_0x4ded59=Math[_0x2e5b40(0x9e)](_0x1971a1/0x18);if(_0x4ded59>0x0){const _0x5dd8b3=_0x1971a1%0x18;return _0x5dd8b3>0x0?_0x4ded59+'d\x20'+_0x5dd8b3+'h':_0x4ded59+'d';}else{if(_0x1971a1>0x0){const _0x58d962=_0x4cce52%0x3c;return _0x58d962>0x0?_0x1971a1+'h\x20'+_0x58d962+'m':_0x1971a1+'h';}else{if(_0x4cce52>0x0){const _0x5c403d=_0xd60a62%0x3c;return _0x5c403d>0x0?_0x4cce52+'m\x20'+_0x5c403d+'s':_0x4cce52+'m';}else return _0xd60a62+'s';}}}function formatTimestamp(_0x36d31a,_0x2a184){const _0x2382c7=a59_0x34b1fc,_0xdf1ca2=new Date(_0x36d31a),_0x16521e=String(_0xdf1ca2[_0x2382c7(0x1e6)]())[_0x2382c7(0x1a1)](0x2,'0'),_0x36c9d3=String(_0xdf1ca2['getMinutes']())[_0x2382c7(0x1a1)](0x2,'0'),_0x16dedc=_0x16521e+':'+_0x36c9d3,_0x18ae53=_0xdf1ca2['getFullYear']()===_0x2a184[_0x2382c7(0x83)]()&&_0xdf1ca2[_0x2382c7(0x7a)]()===_0x2a184['getMonth']()&&_0xdf1ca2[_0x2382c7(0x1ad)]()===_0x2a184['getDate']();if(_0x18ae53)return _0x16dedc;else{const _0x3aa18c=String(_0xdf1ca2[_0x2382c7(0x7a)]()+0x1)['padStart'](0x2,'0'),_0x42d15a=String(_0xdf1ca2['getDate']())[_0x2382c7(0x1a1)](0x2,'0');return _0x3aa18c+'-'+_0x42d15a+'\x20'+_0x16dedc;}}function formatDate(_0x396d49){const _0x113645=a59_0x34b1fc,_0x2d8c0d=_0x396d49['getFullYear'](),_0x40db93=String(_0x396d49[_0x113645(0x7a)]()+0x1)[_0x113645(0x1a1)](0x2,'0'),_0x4c088a=String(_0x396d49[_0x113645(0x1ad)]())[_0x113645(0x1a1)](0x2,'0');return _0x2d8c0d+'-'+_0x40db93+'-'+_0x4c088a;}function getTaskStateIcon(_0x26ed16){const _0x22db91={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x22db91[_0x26ed16]||'⚪';}function getBarChar(_0x3fdf1b){const _0x59f864=a59_0x34b1fc;return _0x3fdf1b===_0x59f864(0x23a)||_0x3fdf1b==='group_error'?'×':'─';}function getBarColor(_0x575b1d){const _0x44c235=a59_0x34b1fc,_0x36eb29={'success':a59_0x564dd3['green'],'error':a59_0x564dd3['red'],'group_error':a59_0x564dd3[_0x44c235(0x1a4)],'running':a59_0x564dd3['blue'],'blocked':a59_0x564dd3['yellow'],'planned':a59_0x564dd3[_0x44c235(0x6f)],'canceling':a59_0x564dd3['yellow']};return _0x36eb29[_0x575b1d]||a59_0x564dd3[_0x44c235(0x24f)];}function parseTaskName(_0xa1903e){const _0x561ee3=a59_0x34b1fc;let _0x220ca5=_0xa1903e[_0x561ee3(0x1b3)](/^\++/,'');const _0x3854e7=_0x220ca5[_0x561ee3(0x101)]('+'),_0x5dce92=_0x3854e7[_0x561ee3(0x217)]>0x1?_0x3854e7[_0x561ee3(0x217)]-0x2:0x0,_0x332488=_0x3854e7[_0x3854e7[_0x561ee3(0x217)]-0x1]||_0x220ca5;return{'level':_0x5dce92,'name':'+'+_0x332488};}function truncateTaskName(_0x53d2e9,_0x40e89b){const _0x2ff641=a59_0x34b1fc,_0x2695e9=stringWidth(_0x53d2e9);if(_0x2695e9<=_0x40e89b)return _0x53d2e9;let _0x5164a2=_0x53d2e9;while(stringWidth(_0x5164a2+'…')>_0x40e89b&&_0x5164a2[_0x2ff641(0x217)]>0x0){_0x5164a2=_0x5164a2['slice'](0x0,-0x1);}return _0x5164a2+'…';}function calculateTimeScale(_0x49f217,_0x1f3b3f){const _0x4bd3a8=a59_0x34b1fc;return{'startTime':_0x49f217['start'],'endTime':_0x49f217[_0x4bd3a8(0x1f2)],'durationMs':_0x49f217['duration'],'msPerChar':_0x49f217[_0x4bd3a8(0x1d8)]/_0x1f3b3f};}function timeToPosition(_0xea8af3,_0x4198b8,_0x866a7f){const _0x131859=a59_0x34b1fc,_0x31fd89=_0xea8af3-_0x4198b8['startTime'],_0x17462b=Math[_0x131859(0x9e)](_0x31fd89/_0x4198b8[_0x131859(0xb9)]);return Math['max'](0x0,Math['min'](_0x17462b,_0x866a7f));}function renderTimeAxis(_0x114611,_0x3548b5){const _0x269d05=a59_0x34b1fc,_0x4e0f49=Math['min'](TIMELINE_CONFIG[_0x269d05(0x1df)],Math[_0x269d05(0xc3)](TIMELINE_CONFIG[_0x269d05(0xb0)],Math[_0x269d05(0x9e)](_0x3548b5/TIMELINE_CONFIG[_0x269d05(0x75)]))),_0x417257=_0x114611[_0x269d05(0x183)]/(_0x4e0f49-0x1),_0x19a2b2=new Date(_0x114611[_0x269d05(0x8c)]),_0xa6dd62=[];for(let _0x3cd0bc=0x0;_0x3cd0bc<_0x4e0f49;_0x3cd0bc++){const _0x45c563=_0x114611[_0x269d05(0x8c)]+_0x3cd0bc*_0x417257,_0x45d8f3=timeToPosition(_0x45c563,_0x114611,_0x3548b5),_0x219f4f=formatTimestamp(_0x45c563,_0x19a2b2);_0xa6dd62['push']({'pos':_0x45d8f3,'text':_0x219f4f});}const _0x191cf2=new Array(_0x3548b5)[_0x269d05(0x174)]('\x20');let _0x4f424d=-0x1;for(const {pos:_0x1f1c14,text:_0x1a7d42}of _0xa6dd62){let _0x11d462=Math[_0x269d05(0xc3)](0x0,_0x1f1c14-Math[_0x269d05(0x9e)](_0x1a7d42['length']/0x2));_0x11d462<=_0x4f424d+TIMELINE_CONFIG[_0x269d05(0xf6)]&&(_0x11d462=_0x4f424d+TIMELINE_CONFIG[_0x269d05(0xf6)]+0x1);_0x11d462+_0x1a7d42['length']>_0x3548b5&&(_0x11d462=_0x3548b5-_0x1a7d42[_0x269d05(0x217)]);if(_0x11d462>=0x0&&_0x11d462+_0x1a7d42[_0x269d05(0x217)]<=_0x3548b5&&_0x11d462>_0x4f424d){for(let _0x2adf50=0x0;_0x2adf50<_0x1a7d42[_0x269d05(0x217)];_0x2adf50++){_0x191cf2[_0x11d462+_0x2adf50]=_0x1a7d42[_0x2adf50];}_0x4f424d=_0x11d462+_0x1a7d42[_0x269d05(0x217)]-0x1;}}return _0x191cf2[_0x269d05(0xf7)]('');}function renderTaskRow(_0x49503c,_0xdaf69b,_0x598071,_0x582991){const _0x5c9967=a59_0x34b1fc,{level:_0x1c38da,name:_0x1cb0bd}=parseTaskName(_0x49503c[_0x5c9967(0x7b)]),_0x28d188='\x20'[_0x5c9967(0xaf)](_0x1c38da),_0xb416e8=_0x49503c[_0x5c9967(0x13e)]?'('+formatElapsed(_0x49503c[_0x5c9967(0x13e)][_0x5c9967(0x1d8)])+')':'',_0x4199ee=stringWidth(_0xb416e8),_0x199de7=_0x1c38da*0x1,_0x4ece61=_0x582991-_0x199de7-_0x4199ee-0x1,_0x70da8=truncateTaskName(_0x1cb0bd,_0x4ece61),_0x1d99b7=_0x28d188+_0x70da8,_0x29097b=stringWidth(_0x1d99b7),_0x3271e9=_0x582991-_0x29097b-_0x4199ee,_0x5c675a=_0x1d99b7+'\x20'[_0x5c9967(0xaf)](Math['max'](0x1,_0x3271e9))+a59_0x564dd3[_0x5c9967(0x6f)](_0xb416e8),_0x1ea5c6=getTaskStateIcon(_0x49503c[_0x5c9967(0x224)]),_0x5b76b7=new Array(_0x598071)['fill']('\x20');if(_0x49503c['window']){const _0x3e9f3d=timeToPosition(_0x49503c[_0x5c9967(0x13e)][_0x5c9967(0x17f)],_0xdaf69b,_0x598071),_0x4d01de=timeToPosition(_0x49503c['window'][_0x5c9967(0x1f2)],_0xdaf69b,_0x598071),_0x3173d3=getBarChar(_0x49503c[_0x5c9967(0x224)]),_0x1ca0d5=Math[_0x5c9967(0xc3)](_0x3e9f3d+0x1,_0x4d01de);for(let _0x55a88f=_0x3e9f3d;_0x55a88f<Math['min'](_0x1ca0d5,_0x598071);_0x55a88f++){_0x5b76b7[_0x55a88f]=_0x3173d3;}}const _0x12e640=getBarColor(_0x49503c[_0x5c9967(0x224)]),_0x14f29d=_0x5b76b7[_0x5c9967(0xb1)](_0x14a53d=>_0x14a53d==='\x20'?'\x20':_0x12e640(_0x14a53d))[_0x5c9967(0xf7)]('');return _0x1ea5c6+'\x20'+_0x5c675a+'│'+_0x14f29d+'│';}function calculateStats(_0x3bdeb0){const _0x19c845=a59_0x34b1fc,_0x2565fa={'total':_0x3bdeb0['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x5ae07d of _0x3bdeb0){if(_0x5ae07d[_0x19c845(0x224)]==='success')_0x2565fa[_0x19c845(0x1b7)]++;else{if(_0x5ae07d['state']==='error'||_0x5ae07d[_0x19c845(0x224)]===_0x19c845(0x14d))_0x2565fa[_0x19c845(0x23a)]++;else _0x5ae07d[_0x19c845(0x224)]==='running'?_0x2565fa['running']++:_0x2565fa[_0x19c845(0x145)]++;}}return _0x2565fa;}function formatStats(_0x29b49e){const _0x4cd9a2=a59_0x34b1fc;return['Total:\x20'+_0x29b49e[_0x4cd9a2(0x18e)],'✅\x20'+_0x29b49e[_0x4cd9a2(0x1b7)],'❌\x20'+_0x29b49e[_0x4cd9a2(0x23a)],_0x4cd9a2(0x1aa)+_0x29b49e[_0x4cd9a2(0x6e)],'⏳\x20'+_0x29b49e[_0x4cd9a2(0x145)]][_0x4cd9a2(0xf7)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']='workflow:timeline';[a59_0x34b1fc(0x229)]=a59_0x34b1fc(0x19f);async[a59_0x34b1fc(0x203)](_0x11a530){const _0x417e2b=a59_0x34b1fc,{options:_0x1fe10c,args:_0x24934b,tdx:_0x32e27e}=_0x11a530;let _0x46e662,_0x1faa5a,_0xdbaa98=![];if(_0x24934b[0x0]){if(_0x24934b[0x0][_0x417e2b(0x228)]('.')){const _0x3cddd9=this[_0x417e2b(0x194)](_0x24934b,_0x1fe10c);if(!_0x3cddd9)return 0x1;_0x46e662=_0x3cddd9[_0x417e2b(0x179)],_0x1faa5a=_0x3cddd9['workflowName'];}else{_0x1faa5a=_0x24934b[0x0],_0x46e662=_0x1fe10c[_0x417e2b(0x20b)];if(!_0x46e662)return console[_0x417e2b(0x23a)](a59_0x564dd3[_0x417e2b(0x1a4)](_0x417e2b(0x168)),_0x417e2b(0x242)),0x1;_0xdbaa98=!![];}}else{const _0x4d7618=this[_0x417e2b(0x194)](_0x24934b,_0x1fe10c);if(!_0x4d7618)return 0x1;_0x46e662=_0x4d7618['projectName'],_0x1faa5a=_0x4d7618[_0x417e2b(0x18c)];}if(_0x1fe10c['verbose']){if(_0x46e662&&_0x1faa5a)console['error']('Filter:\x20'+_0x46e662+'.'+_0x1faa5a);else _0x46e662&&console[_0x417e2b(0x23a)]('Filter:\x20project='+_0x46e662);}const _0x50409a=_0x1fe10c[_0x417e2b(0x1e9)],_0x3fffdf=_0x1fe10c['sessionId'];if(_0x50409a){_0x3fffdf&&console[_0x417e2b(0x23a)](a59_0x564dd3[_0x417e2b(0x204)](_0x417e2b(0xdf)),_0x417e2b(0xae));const _0x1bf3e1=_0x1fe10c[_0x417e2b(0x1c8)];return _0x1bf3e1?await this[_0x417e2b(0x23b)](_0x11a530,_0x50409a):await this[_0x417e2b(0xff)](_0x11a530,_0x50409a,_0x1fe10c),0x0;}if(_0x3fffdf){const _0x23f29c=await withSpinner(_0x417e2b(0x1e5),()=>_0x32e27e[_0x417e2b(0x14b)]['sessions']({'projectName':_0x46e662,'workflowName':_0x1faa5a,'limit':0x64}),{'verbose':_0x1fe10c[_0x417e2b(0x1ab)]}),_0xdbe941=_0x23f29c[_0x417e2b(0x138)][_0x417e2b(0x1b9)](_0x5f011c=>_0x5f011c['id']===_0x3fffdf);if(!_0xdbe941)return console['error'](a59_0x564dd3[_0x417e2b(0x1a4)](_0x417e2b(0x168)),_0x417e2b(0x16d)+_0x3fffdf),0x1;if(!_0xdbe941['lastAttempt']?.['id'])return console['error'](a59_0x564dd3[_0x417e2b(0x1a4)](_0x417e2b(0x168)),_0x417e2b(0x166)+_0x3fffdf+_0x417e2b(0x107)),0x1;const _0x11146e=_0xdbe941[_0x417e2b(0x20a)]['id'];_0x1fe10c[_0x417e2b(0x1ab)]&&console['error'](_0x417e2b(0x108)+_0x11146e+_0x417e2b(0x18a)+_0x3fffdf);const _0x4a0420=_0x1fe10c['follow'];return _0x4a0420?await this[_0x417e2b(0x23b)](_0x11a530,_0x11146e):await this['renderSingleTimeline'](_0x11a530,_0x11146e,_0x1fe10c),0x0;}const _0x38e657=await withSpinner(_0x417e2b(0x158),()=>_0x32e27e[_0x417e2b(0x14b)]['sessions']({'projectName':_0x46e662,'workflowName':_0x1faa5a,'limit':_0x1fe10c[_0x417e2b(0x7d)]||0x32}),{'verbose':_0x1fe10c['verbose']}),_0x523e28=_0x38e657['data'];if(_0x523e28[_0x417e2b(0x217)]===0x0){if(_0x46e662&&_0x1faa5a)console['error'](_0x417e2b(0x7f)+_0x46e662+'.'+_0x1faa5a);else _0x46e662?console[_0x417e2b(0x23a)](_0x417e2b(0xb5)+_0x46e662):(console[_0x417e2b(0x23a)]('No\x20workflow\x20sessions\x20found'),console['error'](a59_0x564dd3[_0x417e2b(0x6f)](_0x417e2b(0x127))));return 0x0;}_0x523e28[_0x417e2b(0x65)]((_0x4b76a,_0x21fcd3)=>{const _0x10471d=_0x417e2b,_0x18b826=_0x4b76a[_0x10471d(0xad)]||'',_0x3df45b=_0x21fcd3[_0x10471d(0xad)]||'';return _0x3df45b['localeCompare'](_0x18b826);});if(_0x1fe10c[_0x417e2b(0x1e8)]||_0x1fe10c[_0x417e2b(0x77)])return await handleSDKOutput(_0x523e28,_0x1fe10c),0x0;let _0x8d7e12;if(_0xdbaa98){const _0x3e2cb7=_0x523e28[0x0];if(!_0x3e2cb7['lastAttempt']?.['id'])return console[_0x417e2b(0x23a)](_0x417e2b(0x1e3)),0x0;_0x8d7e12=_0x3e2cb7[_0x417e2b(0x20a)]['id'],_0x1fe10c['verbose']&&console[_0x417e2b(0x23a)](_0x417e2b(0x6d)+_0x3e2cb7['sessionTime']);}else{const _0x403c5e=_0x523e28['map'](_0x4086b7=>{const _0x39963b=_0x417e2b,_0x5dbab1=getAttemptStatusDisplay(_0x4086b7[_0x39963b(0x20a)]);return{'title':_0x4086b7[_0x39963b(0xc6)]?.[_0x39963b(0x7b)]+'.'+_0x4086b7[_0x39963b(0x14b)]?.[_0x39963b(0x7b)]+_0x39963b(0x13b)+_0x4086b7[_0x39963b(0xad)]+'\x20'+_0x5dbab1[_0x39963b(0x186)],'value':_0x4086b7[_0x39963b(0x20a)]?.['id']||'','description':_0x5dbab1['text']};}),_0xa7cf54=await a59_0x17b23b({'type':_0x417e2b(0x1fc),'name':_0x417e2b(0x1e9),'message':_0x417e2b(0x90),'choices':_0x403c5e['filter'](_0x22a94c=>_0x22a94c[_0x417e2b(0x8b)]!=='')});if(!_0xa7cf54[_0x417e2b(0x1e9)])return 0x0;_0x8d7e12=_0xa7cf54[_0x417e2b(0x1e9)];}const _0x39f49f=_0x1fe10c[_0x417e2b(0x1c8)];return _0x39f49f?await this[_0x417e2b(0x23b)](_0x11a530,_0x8d7e12):await this[_0x417e2b(0xff)](_0x11a530,_0x8d7e12,_0x1fe10c),0x0;}async['renderSingleTimeline'](_0x57f03e,_0x3694dd,_0x44ff2b){const _0x3d309b=a59_0x34b1fc,{tdx:_0xda87f4}=_0x57f03e;let _0x2053d4,_0x121486;try{[_0x2053d4,_0x121486]=await Promise['all']([_0xda87f4['workflow'][_0x3d309b(0x22a)](_0x3694dd),_0xda87f4[_0x3d309b(0x14b)][_0x3d309b(0x148)](_0x3694dd,![])]);}catch(_0x64e84a){console[_0x3d309b(0x23a)](a59_0x564dd3[_0x3d309b(0x1a4)](_0x3d309b(0x103)));_0x44ff2b[_0x3d309b(0x1ab)]&&console['error'](_0x64e84a);throw _0x64e84a;}if(_0x44ff2b[_0x3d309b(0x1e8)]||_0x44ff2b[_0x3d309b(0x77)]){const _0x478ffb=this[_0x3d309b(0x208)](_0x2053d4,_0x121486);await handleSDKOutput([_0x478ffb],_0x44ff2b);return;}const _0x2885fd=_0xda87f4['context'][_0x3d309b(0xc7)],_0x86433b=this[_0x3d309b(0xbe)](_0x2053d4,_0x121486,_0x2885fd);console[_0x3d309b(0x223)](_0x86433b);}async[a59_0x34b1fc(0x23b)](_0x2744ae,_0x3a4df4){const _0x472b85=a59_0x34b1fc,{tdx:_0x21c886}=_0x2744ae,_0x5a4fda=TIMELINE_CONFIG[_0x472b85(0x1b0)],_0x20317d=TIMELINE_CONFIG[_0x472b85(0x226)];let _0x39f19c=0x0;while(_0x39f19c<_0x20317d){process['stdout'][_0x472b85(0x10b)]&&process[_0x472b85(0x122)][_0x472b85(0x22f)]('\x1Bc');let _0x524eb5,_0x3ee0d9;try{[_0x524eb5,_0x3ee0d9]=await Promise[_0x472b85(0x12a)]([_0x21c886[_0x472b85(0x14b)]['attempt'](_0x3a4df4),_0x21c886[_0x472b85(0x14b)]['tasks'](_0x3a4df4,![])]);}catch(_0x335c72){console[_0x472b85(0x23a)](a59_0x564dd3[_0x472b85(0x1a4)](_0x472b85(0x141)));_0x39f19c>0x0&&console[_0x472b85(0x23a)](a59_0x564dd3[_0x472b85(0x6f)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x39f19c));throw _0x335c72;}const _0x1fb99b=_0x21c886[_0x472b85(0x24c)]['site'],_0x5e5865=this[_0x472b85(0xbe)](_0x524eb5,_0x3ee0d9,_0x1fb99b);console[_0x472b85(0x223)](_0x5e5865);const _0x4f7695=_0x524eb5[_0x472b85(0xbc)]&&_0x3ee0d9[_0x472b85(0x1e4)](_0x25238b=>_0x25238b[_0x472b85(0x224)]!==_0x472b85(0x6e)&&_0x25238b[_0x472b85(0x224)]!==_0x472b85(0x1e2));if(_0x4f7695){console[_0x472b85(0x23a)](a59_0x564dd3['green'](_0x472b85(0x86)));break;}console[_0x472b85(0x23a)](a59_0x564dd3[_0x472b85(0x6f)]('\x0aPolling...\x20('+_0x39f19c*0x2+_0x472b85(0x24b))),await new Promise(_0xcf8387=>setTimeout(_0xcf8387,_0x5a4fda)),_0x39f19c++;}_0x39f19c>=_0x20317d&&console['error'](a59_0x564dd3[_0x472b85(0x204)](_0x472b85(0x164)));}[a59_0x34b1fc(0xbe)](_0x273aec,_0x2ab67b,_0x4f2c9e){const _0x313d72=a59_0x34b1fc,_0x53d9df=[],_0xa7ac31=TIMELINE_CONFIG[_0x313d72(0x15f)],_0x95d1a3=0x5,_0x59ea05=process['stdout'][_0x313d72(0x117)]||0x78,_0x590413=_0x59ea05-_0xa7ac31-_0x95d1a3,_0x3d22e2=Math[_0x313d72(0xc3)](TIMELINE_CONFIG[_0x313d72(0x1c2)],Math['min'](_0x590413,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x1b6ab9=new Date(_0x273aec[_0x313d72(0xc0)])[_0x313d72(0x11a)](),_0x182127=_0x273aec[_0x313d72(0x10a)]?new Date(_0x273aec[_0x313d72(0x10a)])['getTime']():Date[_0x313d72(0x184)](),_0x1263ed={'start':_0x1b6ab9,'end':_0x182127,'duration':_0x182127-_0x1b6ab9},_0x45d2af=new Map(),_0x1e6c06=[];for(const _0x301686 of _0x2ab67b){if(_0x301686[_0x313d72(0x20c)]){const _0x5b39c9=new Date(_0x301686['startedAt'])['getTime'](),_0x266b66=_0x301686[_0x313d72(0xf0)]?new Date(_0x301686[_0x313d72(0xf0)])[_0x313d72(0x11a)]():Date['now'](),_0x521255={'start':_0x5b39c9,'end':_0x266b66,'duration':_0x266b66-_0x5b39c9};_0x45d2af['set'](_0x301686['id'],_0x521255),_0x1e6c06[_0x313d72(0x1f9)]({'name':_0x301686[_0x313d72(0x11e)],'state':_0x301686[_0x313d72(0x224)]||_0x313d72(0x195),'window':_0x521255});}else _0x1e6c06['push']({'name':_0x301686[_0x313d72(0x11e)],'state':_0x301686[_0x313d72(0x224)]||_0x313d72(0x1e2),'window':undefined});}_0x1e6c06['sort']((_0x516f7a,_0x3a4f73)=>{const _0xda3cd2=_0x313d72;if(!_0x516f7a[_0xda3cd2(0x13e)])return 0x1;if(!_0x3a4f73[_0xda3cd2(0x13e)])return-0x1;return _0x516f7a[_0xda3cd2(0x13e)]['start']-_0x3a4f73[_0xda3cd2(0x13e)][_0xda3cd2(0x17f)];});const _0x2e9c26=_0x1e6c06[_0x313d72(0x217)],_0x4cc2cf=_0x2e9c26>TIMELINE_CONFIG[_0x313d72(0x153)];_0x4cc2cf&&_0x1e6c06[_0x313d72(0xcc)](TIMELINE_CONFIG[_0x313d72(0x153)]);const _0x270956=calculateTimeScale(_0x1263ed,_0x3d22e2),_0x478915=_0x273aec[_0x313d72(0xbc)]?_0x273aec['success']?a59_0x564dd3[_0x313d72(0xcd)]('success'):a59_0x564dd3[_0x313d72(0x1a4)](_0x313d72(0x23a)):a59_0x564dd3['blue'](_0x313d72(0x6e)),_0x18b08b=_0x273aec[_0x313d72(0xc6)]?.['id'],_0x566caf=_0x273aec['sessionId'];let _0x22fa69;if(_0x18b08b&&_0x566caf){const _0x2151a7=getWorkflowAttemptUrl(_0x4f2c9e,_0x18b08b,_0x566caf,_0x273aec['id']);_0x22fa69=hyperlink(a59_0x564dd3[_0x313d72(0x6f)](_0x273aec['id']),_0x2151a7);}else _0x22fa69=a59_0x564dd3[_0x313d72(0x6f)](_0x273aec['id']);_0x53d9df[_0x313d72(0x1f9)](_0x313d72(0x116)+_0x22fa69+_0x313d72(0x13b)+_0x478915+_0x313d72(0x13b)+formatElapsed(_0x1263ed[_0x313d72(0x1d8)]));if(_0x1e6c06[_0x313d72(0x217)]>0x0){const _0x15a76c=renderTimeAxis(_0x270956,_0x3d22e2),_0x4a20ac=new Date(_0x1263ed[_0x313d72(0x17f)]),_0x4bcc41=formatDate(_0x4a20ac),_0x2ed9bf=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x313d72(0x238)]+_0xa7ac31,_0x5c3128=_0x4bcc41[_0x313d72(0x1a1)](_0x2ed9bf),_0x3fe4e7=a59_0x564dd3[_0x313d72(0x6f)](_0x5c3128);_0x53d9df[_0x313d72(0x1f9)](_0x3fe4e7+'\x20'+_0x15a76c);for(const _0x3de6eb of _0x1e6c06){_0x53d9df[_0x313d72(0x1f9)](renderTaskRow(_0x3de6eb,_0x270956,_0x3d22e2,_0xa7ac31));}const _0x1b60bd=calculateStats(_0x1e6c06);_0x53d9df['push'](formatStats(_0x1b60bd)),_0x4cc2cf&&_0x53d9df[_0x313d72(0x1f9)](a59_0x564dd3[_0x313d72(0x204)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x313d72(0xa2)+_0x2e9c26+'\x20tasks')),_0x53d9df[_0x313d72(0x1f9)](''),_0x53d9df[_0x313d72(0x1f9)](a59_0x564dd3[_0x313d72(0x6f)]('💡\x20Tip:\x20Use\x20')+(_0x313d72(0x74)+_0x273aec['id']+_0x313d72(0xa1))+a59_0x564dd3[_0x313d72(0x6f)](_0x313d72(0x19d)));}else _0x53d9df[_0x313d72(0x1f9)](_0x313d72(0xd6));return _0x53d9df[_0x313d72(0xf7)]('\x0a');}[a59_0x34b1fc(0x208)](_0x59103c,_0x1e9be9){const _0x1dc5db=a59_0x34b1fc,_0x86807f=new Date(_0x59103c['createdAt'])[_0x1dc5db(0x11a)](),_0x4198f9=_0x59103c[_0x1dc5db(0x10a)]?new Date(_0x59103c[_0x1dc5db(0x10a)])['getTime']():Date[_0x1dc5db(0x184)](),_0x1ecb61=_0x4198f9-_0x86807f,_0x4eff64=[];for(const _0x3967ef of _0x1e9be9){if(_0x3967ef[_0x1dc5db(0x20c)]){const _0x17a356=new Date(_0x3967ef['startedAt'])[_0x1dc5db(0x11a)](),_0x548200=_0x3967ef['updatedAt']?new Date(_0x3967ef[_0x1dc5db(0xf0)])['getTime']():Date[_0x1dc5db(0x184)]();_0x4eff64[_0x1dc5db(0x1f9)]({'name':_0x3967ef[_0x1dc5db(0x11e)],'state':_0x3967ef['state']||_0x1dc5db(0x195),'window':{'start':_0x17a356,'end':_0x548200,'duration':_0x548200-_0x17a356}});}else _0x4eff64[_0x1dc5db(0x1f9)]({'name':_0x3967ef[_0x1dc5db(0x11e)],'state':_0x3967ef[_0x1dc5db(0x224)]||_0x1dc5db(0x1e2),'window':undefined});}const _0x134b0e=calculateStats(_0x4eff64);return{'attempt':{'id':_0x59103c['id'],'status':_0x59103c['done']?_0x59103c[_0x1dc5db(0x1b7)]?'success':_0x1dc5db(0x23a):_0x1dc5db(0x6e),'createdAt':_0x59103c[_0x1dc5db(0xc0)],'finishedAt':_0x59103c['finishedAt'],'duration_ms':_0x1ecb61},'tasks':_0x4eff64['map'](_0x20f4c6=>({'name':_0x20f4c6[_0x1dc5db(0x7b)],'state':_0x20f4c6[_0x1dc5db(0x224)],'startedAt':_0x20f4c6['window']?new Date(_0x20f4c6[_0x1dc5db(0x13e)][_0x1dc5db(0x17f)])[_0x1dc5db(0x13a)]():null,'updatedAt':_0x20f4c6[_0x1dc5db(0x13e)]?new Date(_0x20f4c6[_0x1dc5db(0x13e)][_0x1dc5db(0x1f2)])[_0x1dc5db(0x13a)]():null,'duration_ms':_0x20f4c6[_0x1dc5db(0x13e)]?.[_0x1dc5db(0x1d8)]||null})),'stats':_0x134b0e};}}function formatScheduleLine(_0x43c8e5){const _0x42f4cd=a59_0x34b1fc,_0xa88a5=_0x43c8e5['disabledAt']?a59_0x564dd3['yellow'](_0x42f4cd(0xfd)):'',_0x208eac=_0x43c8e5[_0x42f4cd(0xc6)]?.['name']?a59_0x564dd3[_0x42f4cd(0x6f)]('\x20['+_0x43c8e5[_0x42f4cd(0xc6)]['name']+']'):'',_0x1ca01f=_0x43c8e5[_0x42f4cd(0x6a)]?a59_0x564dd3[_0x42f4cd(0x6f)](_0x42f4cd(0x248)+new Date(_0x43c8e5[_0x42f4cd(0x6a)])[_0x42f4cd(0xe7)]()):'';return _0x42f4cd(0x23f)+_0x43c8e5['id']+'\x20'+(_0x43c8e5[_0x42f4cd(0x14b)]?.[_0x42f4cd(0x7b)]||_0x42f4cd(0x23e))+_0x208eac+_0xa88a5+_0x1ca01f;}export class WorkflowSchedulesCommand extends WorkflowBaseCommand{[a59_0x34b1fc(0x7b)]='workflow:schedules';['description']=a59_0x34b1fc(0x218);async[a59_0x34b1fc(0x203)](_0x110ea5){const _0x4036c7=a59_0x34b1fc,{options:_0x597603,args:_0x2aabbf,tdx:_0x1581fb}=_0x110ea5,{scheduleId:_0xb48231}=_0x597603;if(_0xb48231&&_0x2aabbf[0x0])return console[_0x4036c7(0x23a)](a59_0x564dd3[_0x4036c7(0x1a4)](_0x4036c7(0x168)),_0x4036c7(0x15b)),console['error'](a59_0x564dd3[_0x4036c7(0x6f)](_0x4036c7(0xfe))),0x1;if(_0xb48231){const _0x31c5c8=await withSpinner(_0x4036c7(0x249)+_0xb48231+_0x4036c7(0x104),()=>_0x1581fb['workflow']['getSchedule'](_0xb48231),{'verbose':_0x597603['verbose']}),_0x560e5e=_0x31c5c8['data'];return isStructuredFormat(_0x597603)?await handleSingleObjectOutput(_0x560e5e,_0x597603):(console['error'](_0x4036c7(0x1cc)),console[_0x4036c7(0x223)](formatScheduleLine(_0x560e5e))),0x0;}const _0x501572=this[_0x4036c7(0x194)](_0x2aabbf,_0x597603);if(!_0x501572)return 0x1;const {projectName:_0x9d09d0,workflowName:_0x1502a2}=_0x501572,_0x35aa80=_0x9d09d0?'\x27'+_0x9d09d0+(_0x1502a2?'.'+_0x1502a2:'')+'\x27':undefined,_0x1f3372=await withSpinner(_0x35aa80?_0x4036c7(0x99)+_0x35aa80+_0x4036c7(0x104):'Listing\x20schedules...',()=>_0x9d09d0?_0x1581fb[_0x4036c7(0x14b)][_0x4036c7(0x211)](_0x9d09d0,{'workflow':_0x1502a2,'limit':_0x597603[_0x4036c7(0x7d)]}):_0x1581fb[_0x4036c7(0x14b)][_0x4036c7(0x142)]({'limit':_0x597603['limit']}),{'verbose':_0x597603[_0x4036c7(0x1ab)]}),_0x221e8a=_0x1f3372[_0x4036c7(0x138)],_0x3cae17=_0x597603[_0x4036c7(0x7d)]&&_0x221e8a['length']>=_0x597603[_0x4036c7(0x7d)]?a59_0x564dd3['dim'](_0x4036c7(0x1b4)):'';console[_0x4036c7(0x23a)](_0x4036c7(0x24a)+_0x221e8a[_0x4036c7(0x217)]+_0x4036c7(0x1a0)+(_0x221e8a['length']!==0x1?'s':'')+_0x3cae17);if(isStructuredFormat(_0x597603))await handleSDKOutput(_0x221e8a,_0x597603);else{if(_0x221e8a[_0x4036c7(0x217)]===0x0)console['log']('No\x20schedules\x20found');else for(const _0x3b4194 of _0x221e8a){console[_0x4036c7(0x223)](formatScheduleLine(_0x3b4194));}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0x11c);['description']=a59_0x34b1fc(0x212);async[a59_0x34b1fc(0x203)](_0x5c7055){const _0x5dd46e=a59_0x34b1fc,{options:_0x5c5164,args:_0x4ed410,tdx:_0x876cb0}=_0x5c7055,_0x58de5a=_0x4ed410[0x0];if(!_0x58de5a)return console['error'](a59_0x564dd3[_0x5dd46e(0x1a4)](_0x5dd46e(0x168)),_0x5dd46e(0x1b1)),console[_0x5dd46e(0x23a)](a59_0x564dd3[_0x5dd46e(0x6f)](_0x5dd46e(0xc1))),console[_0x5dd46e(0x23a)](a59_0x564dd3[_0x5dd46e(0x6f)]('Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs')),0x1;const {backfill:_0x52961f,nextTime:_0x28c762}=_0x5c5164,_0x61f0e1={};if(_0x52961f!==undefined)_0x61f0e1[_0x5dd46e(0x96)]=!_0x52961f;if(_0x28c762!==undefined)_0x61f0e1[_0x5dd46e(0x198)]=_0x28c762;const _0x46b05a=await withSpinner(_0x5dd46e(0x128)+_0x58de5a+_0x5dd46e(0x104),()=>_0x876cb0[_0x5dd46e(0x14b)][_0x5dd46e(0x1d9)](_0x58de5a,_0x61f0e1),{'verbose':_0x5c5164[_0x5dd46e(0x1ab)]}),_0x42e218=_0x46b05a[_0x5dd46e(0x138)];return isStructuredFormat(_0x5c5164)?await handleSingleObjectOutput(_0x42e218,_0x5c5164):(console[_0x5dd46e(0x223)](_0x5dd46e(0xef)+_0x58de5a+_0x5dd46e(0x91)+(_0x42e218['workflow']?.[_0x5dd46e(0x7b)]||_0x5dd46e(0x195))+')'),_0x42e218[_0x5dd46e(0x6a)]&&console[_0x5dd46e(0x223)](a59_0x564dd3[_0x5dd46e(0x6f)](_0x5dd46e(0x139)+new Date(_0x42e218[_0x5dd46e(0x6a)])[_0x5dd46e(0xe7)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0x1ca);[a59_0x34b1fc(0x229)]=a59_0x34b1fc(0x11b);async['execute'](_0x36df86){const _0x3c54aa=a59_0x34b1fc,{options:_0x5848a4,args:_0x234b40,tdx:_0xddab0}=_0x36df86,_0x285f96=_0x234b40[0x0];if(!_0x285f96)return console[_0x3c54aa(0x23a)](a59_0x564dd3[_0x3c54aa(0x1a4)](_0x3c54aa(0x168)),_0x3c54aa(0x1b1)),console['error'](a59_0x564dd3['dim'](_0x3c54aa(0xcb))),console[_0x3c54aa(0x23a)](a59_0x564dd3[_0x3c54aa(0x6f)](_0x3c54aa(0xd2))),0x1;const _0x110fdb=await withSpinner(_0x3c54aa(0x15d)+_0x285f96+_0x3c54aa(0x104),()=>_0xddab0[_0x3c54aa(0x14b)][_0x3c54aa(0x159)](_0x285f96),{'verbose':_0x5848a4['verbose']}),_0x5e9890=_0x110fdb['data'];return isStructuredFormat(_0x5848a4)?await handleSingleObjectOutput(_0x5e9890,_0x5848a4):console['log'](_0x3c54aa(0xef)+_0x285f96+'\x20disabled\x20('+(_0x5e9890[_0x3c54aa(0x14b)]?.[_0x3c54aa(0x7b)]||_0x3c54aa(0x195))+')'),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a60_0x31c6(_0x1a9c72,_0x22f1bf){_0x1a9c72=_0x1a9c72-0x1af;const _0xb7de74=a60_0xb7de();let _0x31c6da=_0xb7de74[_0x1a9c72];return _0x31c6da;}(function(_0x249039,_0x3b0941){const _0x58a96b=a60_0x31c6,_0x9df1e=_0x249039();while(!![]){try{const _0x200b87=-parseInt(_0x58a96b(0x1b3))/0x1+parseInt(_0x58a96b(0x1b5))/0x2*(parseInt(_0x58a96b(0x1b8))/0x3)+-parseInt(_0x58a96b(0x1b4))/0x4*(parseInt(_0x58a96b(0x1be))/0x5)+-parseInt(_0x58a96b(0x1b1))/0x6+parseInt(_0x58a96b(0x1ba))/0x7+parseInt(_0x58a96b(0x1bc))/0x8*(parseInt(_0x58a96b(0x1b6))/0x9)+-parseInt(_0x58a96b(0x1c1))/0xa;if(_0x200b87===_0x3b0941)break;else _0x9df1e['push'](_0x9df1e['shift']());}catch(_0x5b376c){_0x9df1e['push'](_0x9df1e['shift']());}}}(a60_0xb7de,0x1a1fc));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 _0x2aaf34=a60_0x31c6,_0x25baf4=getVersion(),_0x4fad51=platform(),_0x52ffd0=process[_0x2aaf34(0x1b2)][_0x2aaf34(0x1b0)]('v','');return _0x2aaf34(0x1b9)+_0x25baf4+'\x20('+_0x4fad51+_0x2aaf34(0x1bb)+_0x52ffd0+')';}function a60_0xb7de(){const _0x4e3765=['36PsvXpZ','66elrFZx','367839NfvqUg','entries','10929wlvQNE','tdx/','763910xKeulQ',';\x20node/','24YLoNBh','length','9635hxBMmC','X-Trino-User','Authorization','743650oCFMlh','Bearer\x20','tdx','replace','891336EHipqb','version','4694XjnpBo'];a60_0xb7de=function(){return _0x4e3765;};return a60_0xb7de();}export function getAuthHeaders(_0x17b9c4,_0x4c0294,_0x471776){const _0x4d274a=a60_0x31c6,_0x2d5181=getVersion(),_0x5826ff={'User-Agent':getUserAgent(),'X-TD-Client':_0x4d274a(0x1af),'X-TD-Client-Version':_0x2d5181};if(_0x471776)_0x5826ff['Authorization']=_0x4d274a(0x1c2)+_0x471776;else _0x4c0294&&(_0x5826ff[_0x4d274a(0x1c0)]='TD1\x20'+_0x4c0294);return _0x5826ff;}export function toHeaderRecord(_0x5ceffb){const _0x154712=a60_0x31c6,_0x239b4e={};for(const [_0x837d0d,_0x476a90]of Object[_0x154712(0x1b7)](_0x5ceffb)){_0x476a90!==undefined&&(_0x239b4e[_0x837d0d]=_0x476a90);}return _0x239b4e;}export function getTrinoHeaders(_0x27bd99,_0x2104cb,_0x5d4cf8){const _0x1eb362=a60_0x31c6,_0x535678=getAuthHeaders(_0x27bd99),_0x4e828e=toHeaderRecord(_0x535678);if(_0x5d4cf8)_0x4e828e['Authorization']=_0x1eb362(0x1c2)+_0x5d4cf8;else _0x2104cb&&(_0x4e828e[_0x1eb362(0x1bf)]=_0x2104cb);return _0x4e828e;}export function hasAPIKey(_0x36adb2){const _0xaa0b18=a60_0x31c6,_0x1ff997=getAPIKey();return _0x1ff997!==undefined&&_0x1ff997[_0xaa0b18(0x1bd)]>0x0;}
|