@treasuredata/tdx 0.26.7 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.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/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.d.ts +4 -2
- package/dist/commands/claude-statusline-command.d.ts.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-statusline-command.js.map +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.d.ts.map +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-command.js.map +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.d.ts.map +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-command.js.map +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.d.ts.map +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-push-command.js.map +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.d.ts.map +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/use-command.js.map +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.d.ts +2 -2
- package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +1 -1
- package/dist/proxy/passthrough-server.d.ts +18 -3
- package/dist/proxy/passthrough-server.d.ts.map +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/passthrough-server.js.map +1 -1
- package/dist/proxy/sse-usage-parser.d.ts +20 -2
- package/dist/proxy/sse-usage-parser.d.ts.map +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/proxy/sse-usage-parser.js.map +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/client/cdp-api-client.d.ts +9 -0
- package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.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.d.ts.map +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/journey.js.map +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.d.ts +0 -4
- package/dist/sdk/llm/model-factors.d.ts.map +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/model-factors.js.map +1 -1
- package/dist/sdk/personalization.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.d.ts +2 -2
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +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.d.ts.map +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-utils.js.map +1 -1
- package/dist/sdk/segment/journey-validator.d.ts +3 -0
- package/dist/sdk/segment/journey-validator.d.ts.map +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-validator.js.map +1 -1
- package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +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/pull-workflow.js.map +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.d.ts +8 -0
- package/dist/sdk/segment/push-workflow.d.ts.map +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js.map +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/segment-def.d.ts +10 -1
- package/dist/sdk/segment/types/segment-def.d.ts.map +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment/yaml-validator.js.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/cdp.d.ts +23 -15
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +3 -3
- package/dist/utils/port.d.ts +0 -18
- package/dist/utils/port.d.ts.map +0 -1
- package/dist/utils/port.js +0 -1
- package/dist/utils/port.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a42_0xc57567=a42_0x15e8;(function(_0x308154,_0x339c18){const _0x209f40=a42_0x15e8,_0x291026=_0x308154();while(!![]){try{const _0x41cc86=-parseInt(_0x209f40(0x291))/0x1+parseInt(_0x209f40(0x33e))/0x2*(parseInt(_0x209f40(0x28a))/0x3)+parseInt(_0x209f40(0x35a))/0x4+-parseInt(_0x209f40(0x2c0))/0x5+parseInt(_0x209f40(0x246))/0x6+-parseInt(_0x209f40(0x288))/0x7*(-parseInt(_0x209f40(0x2e3))/0x8)+-parseInt(_0x209f40(0x373))/0x9*(parseInt(_0x209f40(0x393))/0xa);if(_0x41cc86===_0x339c18)break;else _0x291026['push'](_0x291026['shift']());}catch(_0x374fce){_0x291026['push'](_0x291026['shift']());}}}(a42_0x4a1f,0x6f2d1));import a42_0x28d120 from'chalk';import{existsSync}from'fs';import a42_0x4c5f63 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a42_0x4fae from'prompts';function getAttemptStatusDisplay(_0x4588ce){const _0x4ed782=a42_0x15e8;if(!_0x4588ce)return{'icon':'⏳','text':''};const {done:_0x52bc50,success:_0x4e838e,cancelRequested:_0x2e643a}=_0x4588ce;if(!_0x52bc50)return _0x2e643a?{'icon':'🛑','text':a42_0x28d120[_0x4ed782(0x2a1)]('canceling')}:{'icon':'🔄','text':a42_0x28d120[_0x4ed782(0x1fd)](_0x4ed782(0x272))};if(_0x4e838e)return{'icon':'✅','text':a42_0x28d120[_0x4ed782(0x382)](_0x4ed782(0x32b))};return{'icon':'❌','text':a42_0x28d120['red'](_0x4ed782(0x343))};}export class WorkflowBaseCommand extends BaseCommand{[a42_0xc57567(0x247)](_0x2789ef,_0x334e97,_0x4a7f31=0x0){const _0x2ce1d6=a42_0xc57567;return _0x2789ef[_0x4a7f31]||_0x334e97[_0x2ce1d6(0x220)];}[a42_0xc57567(0x2e6)](_0x273415,_0x52586c,_0x5a329d=0x0){const _0x50dbfb=a42_0xc57567,_0x443f0e=this[_0x50dbfb(0x247)](_0x273415,_0x52586c,_0x5a329d);if(!_0x443f0e)return console['error'](a42_0x28d120['red'](_0x50dbfb(0x2c8)),_0x50dbfb(0x383)),console[_0x50dbfb(0x343)](a42_0x28d120[_0x50dbfb(0x307)](_0x50dbfb(0x2e9))),null;return _0x443f0e;}[a42_0xc57567(0x323)](_0x36a559,_0x24411d){const _0x3722c8=a42_0xc57567;if(_0x36a559[0x0]){const _0x2154ad=_0x36a559[0x0][_0x3722c8(0x294)]('.');if(_0x2154ad[_0x3722c8(0x22b)]===0x1)return{'projectName':_0x2154ad[0x0],'workflowName':undefined};else return _0x2154ad[_0x3722c8(0x22b)]===0x2?{'projectName':_0x2154ad[0x0],'workflowName':_0x2154ad[0x1]}:(console['error'](a42_0x28d120[_0x3722c8(0x356)](_0x3722c8(0x2c8)),_0x3722c8(0x224)),null);}return{'projectName':_0x24411d[_0x3722c8(0x220)],'workflowName':undefined};}[a42_0xc57567(0x2de)](_0x309399,_0x138e0c,_0x48c265=0x0){const _0x5e9624=a42_0xc57567;if(_0x309399[_0x48c265])return _0x309399[_0x48c265];if(_0x138e0c[_0x5e9624(0x220)]){const _0x43bae4=a42_0x4c5f63['join'](process['cwd'](),_0x5e9624(0x34d),_0x138e0c[_0x5e9624(0x220)]);if(existsSync(a42_0x4c5f63['join'](_0x43bae4,_0x5e9624(0x2c6))))return _0x43bae4;}return undefined;}async[a42_0xc57567(0x2be)](_0x187d5f,_0x48b26f,_0x3c084d){const _0xc9c78f=a42_0xc57567;try{const _0x5c82bc=await _0x187d5f[_0xc9c78f(0x2da)][_0xc9c78f(0x34d)](_0x48b26f,{'limit':0x1});if(_0x5c82bc[_0xc9c78f(0x22b)]>0x0){const _0x5d821c=_0x5c82bc[0x0]['id'],_0x3f3afe=getWorkflowUrl(_0x3c084d,_0x5d821c);console[_0xc9c78f(0x343)](_0xc9c78f(0x2c4)+a42_0x28d120['cyan'](_0x3f3afe));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x244);[a42_0xc57567(0x371)]=a42_0xc57567(0x257);async[a42_0xc57567(0x2dc)](_0x1b3c80){const _0x1cfd22=a42_0xc57567,{options:_0x454575,args:_0x333ddc,tdx:_0x2823cf}=_0x1b3c80,_0x123607=_0x333ddc[0x0],_0x1499b8=_0x454575[_0x1cfd22(0x298)];if(_0x1499b8)return saveSessionContext({'workflow_project':undefined},_0x454575['session']),console['log'](a42_0x28d120[_0x1cfd22(0x382)](_0x1cfd22(0x23e))),0x0;if(!_0x123607)return console[_0x1cfd22(0x343)](a42_0x28d120['red'](_0x1cfd22(0x2c8)),'Project\x20name\x20is\x20required'),console[_0x1cfd22(0x343)](a42_0x28d120['dim'](_0x1cfd22(0x2e4))),console['error'](a42_0x28d120[_0x1cfd22(0x307)](_0x1cfd22(0x1ff))),0x1;const _0x1aabb6=await withSpinner(_0x1cfd22(0x23b)+_0x123607+'\x27...',()=>_0x2823cf[_0x1cfd22(0x2da)][_0x1cfd22(0x27b)](_0x123607),{'verbose':_0x454575[_0x1cfd22(0x250)]}),{name:_0x1f5516}=_0x1aabb6[_0x1cfd22(0x201)];return saveSessionContext({'workflow_project':_0x1f5516},_0x454575[_0x1cfd22(0x317)]),console['log'](a42_0x28d120[_0x1cfd22(0x382)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a42_0x28d120['cyan'](_0x1f5516))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a42_0xc57567(0x2ce);['description']=a42_0xc57567(0x275);async[a42_0xc57567(0x2dc)](_0xcd6c65){const _0xae4642=a42_0xc57567,{options:_0x3650de,args:_0x45ee93,tdx:_0x421495}=_0xcd6c65,_0x11657a=_0x45ee93[0x0];_0x3650de[_0xae4642(0x250)]&&_0x11657a&&console[_0xae4642(0x343)]('Pattern:\x20'+_0x11657a);const _0x3572a9=await withSpinner(_0xae4642(0x217),()=>_0x421495[_0xae4642(0x2da)][_0xae4642(0x2ed)](_0x11657a,{'limit':_0x3650de[_0xae4642(0x22d)]}),{'verbose':_0x3650de[_0xae4642(0x250)]});let _0x37fffc=_0x3572a9['data'];_0x37fffc['sort']((_0x50348e,_0x130049)=>_0x50348e['name'][_0xae4642(0x2f1)](_0x130049[_0xae4642(0x331)]));const _0x29c81a=_0x3650de[_0xae4642(0x22d)]||0x64,_0x3a178d=_0x37fffc['length']>=_0x29c81a?a42_0x28d120['dim'](_0xae4642(0x301)):'';console[_0xae4642(0x343)](_0xae4642(0x36f)+_0x37fffc[_0xae4642(0x22b)]+_0xae4642(0x221)+(_0x37fffc[_0xae4642(0x22b)]!==0x1?'s':'')+_0x3a178d);if(_0x3650de[_0xae4642(0x24b)]===_0xae4642(0x1fc)||_0x3650de[_0xae4642(0x24b)]===_0xae4642(0x39a)||_0x3650de[_0xae4642(0x24b)]===_0xae4642(0x39e))await handleSDKOutput(_0x37fffc,_0x3650de);else{if(_0x37fffc[_0xae4642(0x22b)]===0x0)_0x11657a?console[_0xae4642(0x385)](_0xae4642(0x303)+_0x11657a):console[_0xae4642(0x385)]('No\x20workflow\x20projects\x20found');else{const _0x3386b0=_0x37fffc[_0xae4642(0x27a)](_0x1844b9=>{const _0x61694c=_0xae4642,_0x2adc19=_0x1844b9[_0x61694c(0x286)]?.['some'](_0x203029=>_0x203029['key']===_0x61694c(0x228)),_0x55c5f1=_0x2adc19?a42_0x28d120[_0x61694c(0x307)](_0x61694c(0x314)):'';return'📁\x20'+_0x1844b9[_0x61694c(0x331)]+_0x55c5f1;});await writeOutput(_0x3386b0[_0xae4642(0x238)]('\x0a'),_0x3650de[_0xae4642(0x209)],_0xae4642(0x233));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x397);['description']='List\x20workflows';async['execute'](_0x2f01f3){const _0x146346=a42_0xc57567,{options:_0x41a009,args:_0x52bed3,tdx:_0x1bf77d}=_0x2f01f3,_0x484a79=this[_0x146346(0x247)](_0x52bed3,_0x41a009);_0x41a009['verbose']&&_0x484a79&&console[_0x146346(0x343)]('Project\x20filter:\x20'+_0x484a79);const _0x55848d=await withSpinner(_0x146346(0x254),()=>_0x1bf77d[_0x146346(0x2da)][_0x146346(0x34d)](_0x484a79,{'limit':_0x41a009[_0x146346(0x22d)]}),{'verbose':_0x41a009[_0x146346(0x250)]});let _0x3cb024=_0x55848d[_0x146346(0x201)];_0x3cb024[_0x146346(0x208)]((_0x5abb14,_0x2127c4)=>{const _0x3ae55e=_0x146346,_0x43177a=_0x5abb14['name'][_0x3ae55e(0x2f1)](_0x2127c4[_0x3ae55e(0x331)]);if(_0x43177a!==0x0)return _0x43177a;return(_0x5abb14[_0x3ae55e(0x296)]?.['name']||'')[_0x3ae55e(0x2f1)](_0x2127c4[_0x3ae55e(0x296)]?.[_0x3ae55e(0x331)]||'');});const _0x1b38cb=_0x41a009[_0x146346(0x22d)]||0x64,_0x4a491f=_0x3cb024[_0x146346(0x22b)]>=_0x1b38cb?a42_0x28d120[_0x146346(0x307)](_0x146346(0x301)):'';console['error'](_0x146346(0x36f)+_0x3cb024[_0x146346(0x22b)]+_0x146346(0x2dd)+(_0x3cb024['length']!==0x1?'s':'')+_0x4a491f);if(_0x41a009[_0x146346(0x24b)]===_0x146346(0x1fc)||_0x41a009['format']===_0x146346(0x39a)||_0x41a009['format']==='table')await handleSDKOutput(_0x3cb024,_0x41a009);else{if(_0x3cb024['length']===0x0)_0x484a79?console[_0x146346(0x385)](_0x146346(0x35b)+_0x484a79):console['log'](_0x146346(0x26b));else{const _0x5222cc=_0x41a009[_0x146346(0x31d)],_0x52ebbe=_0x3cb024[_0x146346(0x27a)](_0x11d599=>{const _0x1f01da=_0x146346,_0x47b307=a42_0x28d120[_0x1f01da(0x307)]('#'+_0x11d599['id']),_0xf457a3=hyperlink(_0x47b307,getWorkflowUrl(_0x5222cc,_0x11d599['id'])),_0x44d407=_0x11d599[_0x1f01da(0x296)]?.[_0x1f01da(0x331)]?a42_0x28d120[_0x1f01da(0x307)]('\x20('+_0x11d599[_0x1f01da(0x296)][_0x1f01da(0x331)]+')'):'';return _0x1f01da(0x2d9)+_0xf457a3+'\x20'+_0x11d599[_0x1f01da(0x331)]+_0x44d407;});await writeOutput(_0x52ebbe[_0x146346(0x238)]('\x0a'),_0x41a009[_0x146346(0x209)],_0x146346(0x233));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x2b0);[a42_0xc57567(0x371)]=a42_0xc57567(0x292);async[a42_0xc57567(0x2dc)](_0x22a5ac){const _0x20800d=a42_0xc57567,{options:_0x15d702,args:_0x5ee259,tdx:_0x296883}=_0x22a5ac,_0x34fe89=this['parseProjectWorkflowPattern'](_0x5ee259,_0x15d702);if(!_0x34fe89)return 0x1;const {projectName:_0x45d7c8,workflowName:_0x514e98}=_0x34fe89;if(_0x15d702[_0x20800d(0x250)]){if(_0x45d7c8&&_0x514e98)console['error'](_0x20800d(0x2ef)+_0x45d7c8+'.'+_0x514e98);else _0x45d7c8&&console[_0x20800d(0x343)](_0x20800d(0x2b4)+_0x45d7c8);const _0x384196=_0x15d702[_0x20800d(0x2ea)];_0x384196&&console['error']('Status:\x20'+_0x384196);}let _0x12d373=0x28;if(process[_0x20800d(0x297)][_0x20800d(0x24d)]&&!_0x15d702[_0x20800d(0x209)]&&!_0x15d702[_0x20800d(0x24b)]){const _0x1f1fc6=process[_0x20800d(0x297)][_0x20800d(0x218)]||0x28;_0x12d373=Math[_0x20800d(0x30f)](0x14,Math[_0x20800d(0x347)](_0x1f1fc6*0x2/0x3));}const _0x2b2264=_0x15d702[_0x20800d(0x22d)]||_0x12d373,_0x338edb=await withSpinner(_0x20800d(0x211),()=>_0x296883[_0x20800d(0x2da)][_0x20800d(0x2d4)]({'projectName':_0x45d7c8,'workflowName':_0x514e98,'status':_0x15d702[_0x20800d(0x2ea)],'fromTime':_0x15d702['from'],'toTime':_0x15d702['to'],'limit':_0x2b2264}),{'verbose':_0x15d702[_0x20800d(0x250)]}),_0x5698af=_0x338edb[_0x20800d(0x201)];_0x5698af[_0x20800d(0x208)]((_0x37070c,_0x5ce3e1)=>{const _0x1dd0b1=_0x20800d,_0x4773d4=_0x37070c[_0x1dd0b1(0x24f)]||'',_0x18a78b=_0x5ce3e1[_0x1dd0b1(0x24f)]||'';return _0x18a78b[_0x1dd0b1(0x2f1)](_0x4773d4);});_0x5698af[_0x20800d(0x22b)]>=_0x2b2264?console[_0x20800d(0x343)]('✔\x20Showing\x20'+_0x5698af['length']+'\x20sessions\x20'+a42_0x28d120['dim'](_0x20800d(0x339))):console['error'](_0x20800d(0x36f)+_0x5698af[_0x20800d(0x22b)]+'\x20session'+(_0x5698af['length']!==0x1?'s':''));if(_0x15d702[_0x20800d(0x24b)]===_0x20800d(0x1fc)||_0x15d702['format']===_0x20800d(0x39a)||_0x15d702[_0x20800d(0x24b)]===_0x20800d(0x39e))await handleSDKOutput(_0x5698af,_0x15d702);else{if(!process[_0x20800d(0x297)]['isTTY']||_0x15d702[_0x20800d(0x209)]){if(_0x5698af[_0x20800d(0x22b)]===0x0){if(_0x45d7c8&&_0x514e98)console[_0x20800d(0x385)]('No\x20sessions\x20found\x20for:\x20'+_0x45d7c8+'.'+_0x514e98);else _0x45d7c8?console[_0x20800d(0x385)](_0x20800d(0x32a)+_0x45d7c8):console[_0x20800d(0x385)](_0x20800d(0x243));}else{const _0x1161d9=_0x15d702[_0x20800d(0x31d)],_0x3e8ff7=this[_0x20800d(0x23a)](_0x5698af,_0x1161d9);_0x15d702[_0x20800d(0x209)]?await writeOutput(_0x3e8ff7,_0x15d702[_0x20800d(0x209)],_0x20800d(0x233)):console[_0x20800d(0x385)](_0x3e8ff7);}!_0x45d7c8&&(console[_0x20800d(0x343)](''),console[_0x20800d(0x343)](a42_0x28d120[_0x20800d(0x307)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console['error'](a42_0x28d120[_0x20800d(0x307)](_0x20800d(0x34e))+'or'+a42_0x28d120[_0x20800d(0x307)](_0x20800d(0x37c))));}else{if(_0x5698af[_0x20800d(0x22b)]===0x0){if(_0x45d7c8&&_0x514e98)console[_0x20800d(0x385)](_0x20800d(0x269)+_0x45d7c8+'.'+_0x514e98);else _0x45d7c8?console[_0x20800d(0x385)](_0x20800d(0x32a)+_0x45d7c8):console['log'](_0x20800d(0x243));}else await this['navigateSessionsInteractive'](_0x5698af,_0x22a5ac,_0x45d7c8);}}return 0x0;}[a42_0xc57567(0x23a)](_0x1373bd,_0x4ae897){const _0x21cacf=a42_0xc57567,_0x4356b3=[],_0x1d2144=new Map();let _0x4842c5=Infinity,_0x1b85f9=-Infinity;for(const _0xa4101 of _0x1373bd){if(_0xa4101['lastAttempt']?.[_0x21cacf(0x2ac)]){const _0xf5af27=new Date(_0xa4101[_0x21cacf(0x2a9)][_0x21cacf(0x2ac)])['getTime'](),_0x5f3c4a=_0xa4101[_0x21cacf(0x2a9)][_0x21cacf(0x23f)]?new Date(_0xa4101[_0x21cacf(0x2a9)][_0x21cacf(0x23f)])[_0x21cacf(0x2e8)]():Date[_0x21cacf(0x2c1)](),_0x2c395e=_0xa4101[_0x21cacf(0x296)]?.[_0x21cacf(0x331)]||_0x21cacf(0x2df);!_0x1d2144[_0x21cacf(0x34a)](_0x2c395e)&&_0x1d2144[_0x21cacf(0x25a)](_0x2c395e,[]),_0x1d2144[_0x21cacf(0x2c3)](_0x2c395e)['push']({'session':_0xa4101,'startTime':_0xf5af27,'endTime':_0x5f3c4a,'duration':_0x5f3c4a-_0xf5af27}),_0x4842c5=Math[_0x21cacf(0x232)](_0x4842c5,_0xf5af27),_0x1b85f9=Math[_0x21cacf(0x30f)](_0x1b85f9,_0x5f3c4a);}}if(_0x1d2144[_0x21cacf(0x33d)]===0x0)return _0x21cacf(0x2ec);const _0x1cbafa=process[_0x21cacf(0x297)][_0x21cacf(0x350)]||0x78,_0x9dd6aa=0x1e,_0x370faa=0x32,_0x38fcc=0x4,_0x5d8269=Math[_0x21cacf(0x232)](_0x370faa,Math[_0x21cacf(0x30f)](_0x9dd6aa,Math[_0x21cacf(0x347)](_0x1cbafa*0.3))),_0x43ab95=_0x1cbafa-_0x5d8269-TIMELINE_CONFIG['GUTTER']-0x3-_0x38fcc,_0x4363f3=_0x1b85f9-_0x4842c5,_0x29adf9=_0x4363f3/_0x5d8269,_0x259153=renderTimeAxis({'startTime':_0x4842c5,'endTime':_0x1b85f9,'durationMs':_0x4363f3,'msPerChar':_0x29adf9},_0x5d8269),_0x3c73e5=[];for(const _0x49e645 of _0x1d2144[_0x21cacf(0x387)]()){_0x3c73e5[_0x21cacf(0x2c5)](..._0x49e645);}_0x3c73e5['sort']((_0x4656c2,_0x477adf)=>_0x477adf['startTime']-_0x4656c2[_0x21cacf(0x205)]);const _0x6eea9d=new Date(_0x4842c5),_0x1a1630=formatDate(_0x6eea9d),_0xd507f7=_0x38fcc+TIMELINE_CONFIG[_0x21cacf(0x360)]+TIMELINE_CONFIG[_0x21cacf(0x27e)]+_0x43ab95,_0x248fd0='\x20'[_0x21cacf(0x335)](_0xd507f7-_0x1a1630[_0x21cacf(0x22b)]),_0x401460=_0x248fd0+a42_0x28d120[_0x21cacf(0x307)](_0x1a1630)+'\x20'+_0x259153;_0x4356b3['push'](_0x401460);const _0x1bb44c=0x16;let _0x2c6262=0x0;for(const _0x55be63 of _0x3c73e5){const _0x34d730=_0x55be63[_0x21cacf(0x317)][_0x21cacf(0x296)]?.[_0x21cacf(0x331)]||'?',_0x22d543=Math[_0x21cacf(0x232)](stringWidth(_0x34d730),_0x1bb44c);_0x2c6262=Math[_0x21cacf(0x30f)](_0x2c6262,_0x22d543);}for(const _0x17444a of _0x3c73e5){const {session:_0x5888cd,startTime:_0x170225,endTime:_0xedeed1,duration:_0x121e79}=_0x17444a,_0x1532ed=_0x5888cd[_0x21cacf(0x296)]?.['id'],_0x57dfb4=_0x5888cd['id'],_0x2c9e69=_0x5888cd[_0x21cacf(0x296)]?.[_0x21cacf(0x331)]||'?',_0x812677=_0x5888cd[_0x21cacf(0x2da)]?.[_0x21cacf(0x331)]||'?';let _0x3536de,_0x1bc776;if(_0x5888cd[_0x21cacf(0x2a9)]){const _0x17ef38=_0x5888cd[_0x21cacf(0x2a9)];!_0x17ef38['done']?(_0x3536de=_0x17ef38[_0x21cacf(0x398)]?'🛑':'🔄',_0x1bc776=_0x17ef38[_0x21cacf(0x398)]?a42_0x28d120[_0x21cacf(0x2a1)]:a42_0x28d120[_0x21cacf(0x1fd)]):(_0x3536de=_0x17ef38[_0x21cacf(0x32b)]?'✅':'❌',_0x1bc776=_0x17ef38[_0x21cacf(0x32b)]?a42_0x28d120[_0x21cacf(0x382)]:a42_0x28d120[_0x21cacf(0x356)]);}else _0x3536de='⏳',_0x1bc776=a42_0x28d120['dim'];const _0x246f67='#'+_0x57dfb4,_0x1f116d=_0x1532ed?hyperlink(_0x246f67,getWorkflowSessionUrl(_0x4ae897,_0x1532ed,_0x57dfb4)):_0x246f67;let _0x409c13=_0x2c9e69;stringWidth(_0x2c9e69)>_0x1bb44c&&(_0x409c13=_0x2c9e69[_0x21cacf(0x273)](0x0,_0x1bb44c-0x1)+'…');const _0x513870=a42_0x28d120[_0x21cacf(0x307)](_0x409c13),_0x58d08d=stringWidth(_0x409c13),_0x2b2246='\x20'[_0x21cacf(0x335)](_0x2c6262-stringWidth(_0x409c13)+0x2),_0x4160d8='('+formatElapsed(_0x121e79)+')',_0x5f472d=stringWidth(_0x4160d8),_0x2063f5=stringWidth(_0x246f67),_0x4cf9a7=_0x2063f5+0x1+_0x58d08d+_0x2b2246[_0x21cacf(0x22b)],_0x9e273a=_0x43ab95-_0x4cf9a7-_0x5f472d-0x1-0x8;let _0x391a76=_0x812677;stringWidth(_0x391a76)>_0x9e273a&&(_0x391a76=_0x391a76['slice'](0x0,_0x9e273a-0x1)+'…');const _0x4602f5=_0x1f116d+'\x20'+_0x513870+_0x2b2246+_0x391a76,_0x8b58f2=stringWidth(_0x4602f5),_0x326f91=_0x43ab95-_0x8b58f2-_0x5f472d,_0x23cd2d=_0x4602f5+'\x20'[_0x21cacf(0x335)](Math[_0x21cacf(0x30f)](0x1,_0x326f91))+a42_0x28d120['dim'](_0x4160d8),_0x5ccdeb=Math[_0x21cacf(0x347)]((_0x170225-_0x4842c5)/_0x29adf9),_0x3ca8ce=Math['floor']((_0xedeed1-_0x4842c5)/_0x29adf9),_0x3b4927=Math[_0x21cacf(0x30f)](_0x5ccdeb+0x1,_0x3ca8ce),_0x5ce6bd=new Array(_0x5d8269)[_0x21cacf(0x261)]('\x20');for(let _0x10b69a=_0x5ccdeb;_0x10b69a<Math[_0x21cacf(0x232)](_0x3b4927,_0x5d8269);_0x10b69a++){_0x5ce6bd[_0x10b69a]='─';}const _0x1ff4f2=_0x5ce6bd[_0x21cacf(0x27a)](_0x37c886=>_0x37c886==='\x20'?'\x20':_0x1bc776(_0x37c886))[_0x21cacf(0x238)]('');_0x4356b3[_0x21cacf(0x2c5)](_0x3536de+'\x20'+_0x23cd2d+'│'+_0x1ff4f2+'│');}return _0x4356b3[_0x21cacf(0x238)]('\x0a');}async[a42_0xc57567(0x32f)](_0x681e71,_0x579721,_0x2f4ed3){const _0x451bc2=a42_0xc57567,{options:_0x3db90a,tdx:_0x2d8ebb}=_0x579721,_0x43d305=_0x3db90a['site'],{timelineRows:_0x27970e,timeAxisHeader:_0x239c75}=this[_0x451bc2(0x2ee)](_0x681e71,_0x43d305),_0x155fd0=_0x27970e[_0x451bc2(0x36b)](_0xc83e16=>_0xc83e16[_0x451bc2(0x270)]);if(_0x155fd0['length']===0x0){const _0x354113=this[_0x451bc2(0x23a)](_0x681e71,_0x43d305);console[_0x451bc2(0x385)](_0x354113);!_0x2f4ed3&&(console[_0x451bc2(0x343)](''),console[_0x451bc2(0x343)](a42_0x28d120[_0x451bc2(0x307)](_0x451bc2(0x1fe))),console[_0x451bc2(0x343)](a42_0x28d120[_0x451bc2(0x307)](_0x451bc2(0x34e))+'or'+a42_0x28d120[_0x451bc2(0x307)](_0x451bc2(0x37c))));return;}_0x239c75&&console['log'](_0x239c75);const _0x2f5fe5=_0x27970e[_0x451bc2(0x36b)](_0x2b9f79=>_0x2b9f79[_0x451bc2(0x270)])[_0x451bc2(0x27a)](_0x228772=>({'title':_0x228772[_0x451bc2(0x372)],'value':_0x228772[_0x451bc2(0x270)]})),_0x11bb02=process[_0x451bc2(0x297)][_0x451bc2(0x218)]||0x3c,_0xc42a1f=Math[_0x451bc2(0x30f)](0x28,Math['floor'](_0x11bb02*0x2/0x3)),_0x5b1d4a=await a42_0x4fae({'type':_0x451bc2(0x352),'name':_0x451bc2(0x270),'message':_0x451bc2(0x2d1),'choices':_0x2f5fe5,'initial':-0x1,'limit':_0xc42a1f,'clearFirst':!![],'fallback':{'title':_0x451bc2(0x2a6),'value':null},'suggest':(_0x5e704b,_0x5f07dc)=>{const _0x510758=_0x451bc2;if(!_0x5e704b)return Promise[_0x510758(0x310)](_0x5f07dc);const _0x50e8a0=_0x5f07dc[_0x510758(0x36b)](_0xfebec2=>{const _0x148200=_0x510758,_0x38a0bf=_0xfebec2;return _0x38a0bf[_0x148200(0x334)][_0x148200(0x279)]()[_0x148200(0x26d)](_0x5e704b[_0x148200(0x279)]());});return Promise[_0x510758(0x310)](_0x50e8a0);}}),_0x1255aa=()=>{const _0x1f7812=_0x451bc2;process[_0x1f7812(0x297)][_0x1f7812(0x268)](_0x1f7812(0x289)),process['stdout'][_0x1f7812(0x268)](_0x1f7812(0x289)),process['stdout'][_0x1f7812(0x268)](_0x1f7812(0x289));},_0x26affe=_0x5b1d4a&&_0x5b1d4a['attemptId']&&_0x5b1d4a[_0x451bc2(0x270)]!==null&&_0x5b1d4a[_0x451bc2(0x270)]['trim']()!=='';if(!_0x26affe){_0x1255aa(),console[_0x451bc2(0x385)](a42_0x28d120[_0x451bc2(0x307)]('Cancelled'));return;}_0x1255aa();const _0x155605=_0x681e71['find'](_0x1dc7fa=>_0x1dc7fa[_0x451bc2(0x2a9)]?.['id']===_0x5b1d4a[_0x451bc2(0x270)]);if(_0x155605){const _0x1a2488=_0x155605[_0x451bc2(0x296)]?.['name']||'?',_0x20c989=_0x155605[_0x451bc2(0x2da)]?.[_0x451bc2(0x331)]||'?';console[_0x451bc2(0x385)]('Project:\x20'+a42_0x28d120[_0x451bc2(0x307)](_0x1a2488)+_0x451bc2(0x306)+a42_0x28d120[_0x451bc2(0x307)](_0x20c989));}const _0x3575f1=new WorkflowTimelineCommand();await _0x3575f1[_0x451bc2(0x2dc)]({'args':[],'options':{..._0x3db90a,'attemptId':_0x5b1d4a[_0x451bc2(0x270)]},'tdx':_0x2d8ebb});}['generateSessionTimelineRows'](_0x42b057,_0xdc6967){const _0x4ec773=a42_0xc57567,_0x3ac66d=new Map();for(const _0x317ffa of _0x42b057){_0x317ffa['id']&&_0x317ffa[_0x4ec773(0x2a9)]?.['id']&&_0x3ac66d[_0x4ec773(0x25a)](_0x317ffa['id'],_0x317ffa[_0x4ec773(0x2a9)]['id']);}const _0x202e24=[];let _0x10f2f9='';const _0x1c0877=this[_0x4ec773(0x23a)](_0x42b057,_0xdc6967),_0x58c9ce=_0x1c0877[_0x4ec773(0x294)]('\x0a');for(const _0x1db360 of _0x58c9ce){if(_0x1db360['startsWith'](_0x4ec773(0x348))||_0x1db360[_0x4ec773(0x353)](/^\s+\d{4}-\d{2}-\d{2}/))_0x10f2f9=_0x1db360;else{if(_0x1db360['match'](/^[✅❌🔄🛑⏳]/)){const _0x1e5e7b=_0x1db360['match'](/#(\d+)/),_0x4a97f0=_0x1e5e7b?_0x1e5e7b[0x1]:null,_0x1959c6=_0x4a97f0?_0x3ac66d[_0x4ec773(0x2c3)](_0x4a97f0)||null:null,_0x3d2e2a=_0x42b057[_0x4ec773(0x386)](_0x94204=>_0x94204['id']===_0x4a97f0),_0x66518e=_0x3d2e2a?.[_0x4ec773(0x296)]?.[_0x4ec773(0x331)]||'';_0x202e24['push']({'displayLine':_0x1db360,'attemptId':_0x1959c6,'projectName':_0x66518e});}}}return{'timelineRows':_0x202e24,'timeAxisHeader':_0x10f2f9};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x290);[a42_0xc57567(0x371)]=a42_0xc57567(0x258);async[a42_0xc57567(0x2dc)](_0xb6ba71){const _0x4428b8=a42_0xc57567,{options:_0x245951,args:_0x42bf9e,tdx:_0x5a84ab}=_0xb6ba71,_0x480b94=this['parseProjectWorkflowPattern'](_0x42bf9e,_0x245951);if(!_0x480b94)return 0x1;const {projectName:_0x436580,workflowName:_0x4ef2ec}=_0x480b94,_0x1b9c17=_0x245951['includeRetried'];if(_0x245951['verbose']){if(_0x436580&&_0x4ef2ec)console['error'](_0x4428b8(0x2ef)+_0x436580+'.'+_0x4ef2ec);else _0x436580&&console[_0x4428b8(0x343)](_0x4428b8(0x2b4)+_0x436580);_0x1b9c17&&console[_0x4428b8(0x343)](_0x4428b8(0x35d));}const _0x2cd774=await withSpinner(_0x4428b8(0x1f7),()=>_0x5a84ab['workflow']['attempts']({'projectName':_0x436580,'workflowName':_0x4ef2ec,'includeRetried':_0x1b9c17,'limit':_0x245951[_0x4428b8(0x22d)]}),{'verbose':_0x245951[_0x4428b8(0x250)]}),_0x2d6c56=_0x2cd774[_0x4428b8(0x201)],_0x182d4d=_0x245951[_0x4428b8(0x22d)]||0x64,_0x5e091=_0x2d6c56[_0x4428b8(0x22b)]>=_0x182d4d?a42_0x28d120[_0x4428b8(0x307)](_0x4428b8(0x301)):'';console[_0x4428b8(0x343)](_0x4428b8(0x36f)+_0x2d6c56[_0x4428b8(0x22b)]+_0x4428b8(0x22f)+(_0x2d6c56[_0x4428b8(0x22b)]!==0x1?'s':'')+_0x5e091);if(_0x245951[_0x4428b8(0x24b)]===_0x4428b8(0x1fc)||_0x245951['format']==='jsonl'||_0x245951[_0x4428b8(0x24b)]===_0x4428b8(0x39e))await handleSDKOutput(_0x2d6c56,_0x245951);else{if(_0x2d6c56[_0x4428b8(0x22b)]===0x0){if(_0x436580&&_0x4ef2ec)console['log']('No\x20attempts\x20found\x20for:\x20'+_0x436580+'.'+_0x4ef2ec);else _0x436580?console['log'](_0x4428b8(0x322)+_0x436580):console['log'](_0x4428b8(0x22c));}else{const _0x2312b7=_0x245951[_0x4428b8(0x31d)],_0x382d69=_0x2d6c56[_0x4428b8(0x27a)](_0x4266ea=>{const _0x203016=_0x4428b8,_0x1ee06a=a42_0x28d120['dim']('#'+_0x4266ea['id']),_0xe8dd53=_0x4266ea[_0x203016(0x296)]?.['id'],_0x566d95=_0x4266ea[_0x203016(0x300)]||_0x4266ea[_0x203016(0x1f6)],_0x24878f=_0xe8dd53&&_0x566d95?hyperlink(_0x1ee06a,getWorkflowAttemptUrl(_0x2312b7,_0xe8dd53,_0x566d95,_0x4266ea['id'])):_0x1ee06a,{icon:_0x49b6d7,text:_0x23de87}=getAttemptStatusDisplay(_0x4266ea),_0x266e39=(_0x4266ea[_0x203016(0x296)]?.[_0x203016(0x331)]||'?')+'.'+(_0x4266ea['workflow']?.[_0x203016(0x331)]||'?'),_0x2a94f9=_0x4266ea['sessionTime']?a42_0x28d120[_0x203016(0x307)](_0x4266ea[_0x203016(0x24f)]):'';return(_0x24878f+'\x20'+_0x49b6d7+(_0x23de87?'\x20'+_0x23de87:'')+'\x20'+_0x266e39+'\x20'+_0x2a94f9)[_0x203016(0x2a0)]();});await writeOutput(_0x382d69[_0x4428b8(0x238)]('\x0a'),_0x245951[_0x4428b8(0x209)],_0x4428b8(0x233));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x35c);[a42_0xc57567(0x371)]=a42_0xc57567(0x23c);async[a42_0xc57567(0x2dc)](_0x51857a){const _0x106a21=a42_0xc57567,{options:_0x1cb89e,args:_0x5686f9,tdx:_0x1cb342}=_0x51857a,_0x5cb2f7=_0x5686f9[0x0];if(!_0x5cb2f7)return console[_0x106a21(0x343)](_0x106a21(0x392)),0x1;_0x1cb89e[_0x106a21(0x250)]&&console['error'](_0x106a21(0x2b2)+_0x5cb2f7);const _0x50d4fd=await withSpinner(_0x106a21(0x32d),()=>_0x1cb342['workflow'][_0x106a21(0x320)](_0x5cb2f7),{'verbose':_0x1cb89e[_0x106a21(0x250)]}),_0x47b612=_0x50d4fd[_0x106a21(0x201)];let _0x28aac5;!_0x47b612[_0x106a21(0x21e)]?_0x28aac5=_0x47b612[_0x106a21(0x398)]?_0x106a21(0x28d):_0x106a21(0x272):_0x28aac5=_0x47b612[_0x106a21(0x32b)]?_0x106a21(0x32b):_0x106a21(0x343);let _0x3a59a9;if(_0x47b612[_0x106a21(0x2ac)]&&_0x47b612[_0x106a21(0x23f)]){const _0x2446b1=new Date(_0x47b612[_0x106a21(0x2ac)])[_0x106a21(0x2e8)](),_0x58e78d=new Date(_0x47b612[_0x106a21(0x23f)])['getTime']();_0x3a59a9=Math['round']((_0x58e78d-_0x2446b1)/0x3e8);}const _0x104452={'attempt_id':_0x47b612['id'],'status':_0x28aac5,..._0x47b612[_0x106a21(0x28b)]!==undefined&&{'index':_0x47b612['index']},..._0x47b612[_0x106a21(0x296)]&&{'project':_0x47b612[_0x106a21(0x296)][_0x106a21(0x331)]},..._0x47b612['workflow']&&{'workflow':_0x47b612[_0x106a21(0x2da)][_0x106a21(0x331)]},..._0x47b612['sessionId']&&{'session_id':_0x47b612['sessionId']},..._0x47b612[_0x106a21(0x24f)]&&{'session_time':_0x47b612[_0x106a21(0x24f)]},..._0x47b612['retryAttemptName']&&{'retry_attempt':_0x47b612[_0x106a21(0x349)]},..._0x3a59a9!==undefined&&{'duration_sec':_0x3a59a9},..._0x47b612[_0x106a21(0x2ac)]&&{'created_at':_0x47b612[_0x106a21(0x2ac)]},..._0x47b612[_0x106a21(0x23f)]&&{'finished_at':_0x47b612[_0x106a21(0x23f)]},...Object[_0x106a21(0x377)](_0x47b612['params'])[_0x106a21(0x22b)]>0x0&&{'params':_0x47b612[_0x106a21(0x2f6)]}};return await handleSingleObjectOutput(_0x104452,_0x1cb89e),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x2d2);['description']=a42_0xc57567(0x2fd);async[a42_0xc57567(0x2dc)](_0xc3f3b9){const _0x3bef86=a42_0xc57567,{options:_0x29a7f7,args:_0x5d9fa5,tdx:_0xd05b3b}=_0xc3f3b9,_0x1872f6=_0x5d9fa5[0x0];if(!_0x1872f6)return console[_0x3bef86(0x343)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x3ce004=_0x29a7f7[_0x3bef86(0x338)];_0x29a7f7[_0x3bef86(0x250)]&&(console[_0x3bef86(0x343)](_0x3bef86(0x2b2)+_0x1872f6),_0x3ce004&&console['error'](_0x3bef86(0x280)));const _0x28e594=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0xd05b3b[_0x3bef86(0x2da)][_0x3bef86(0x332)](_0x1872f6,_0x3ce004||![]),{'verbose':_0x29a7f7[_0x3bef86(0x250)]}),_0x181535=_0x28e594['data'];return console['error'](_0x3bef86(0x36f)+_0x181535[_0x3bef86(0x22b)]+_0x3bef86(0x389)+(_0x181535[_0x3bef86(0x22b)]!==0x1?'s':'')),await handleSDKOutput(_0x181535,_0x29a7f7),0x0;}}function a42_0x4a1f(){const _0x3949d8=['\x0aDry\x20run\x20-\x20nothing\x20pushed','Filter:\x20project=','renderSingleTimeline','\x0aPolling...\x20(','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','Fetching\x20log\x20files...','utf-8','revision','Select\x20a\x20task\x20to\x20view\x20logs:','param','workflow:upload','showWorkflowConsoleUrl','unchanged','1353900aARBFW','now','\x20\x20Project:\x20','get','\x20\x20Console:\x20','push','tdx.json','Usage:\x20workflow:delete\x20<project-name-or-id>','Error:','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','projectId','✔\x20Pushed\x20','context','pollTimeline','workflow:projects','\x0aClone\x20\x22','TASK_NAME_WIDTH','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','workflow:tasks','projectName','sessions','Target:\x20','getFullYear','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','targetExists','📋\x20','workflow','startsWith','execute','\x20workflow','resolveProjectDir','(unknown)','preparePushProject','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','\x20\x20Location:\x20','1576JvXilJ','Usage:\x20tdx\x20wf\x20use\x20<project>','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','requireProject','\x0aPush\x20these\x20changes?','getTime','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','status','✔\x20Clone\x20complete','No\x20sessions\x20with\x20timing\x20information','projects','generateSessionTimelineRows','Filter:\x20','Killing\x20attempt...','localeCompare','\x20new','\x22?\x20This\x20cannot\x20be\x20undone.','POLL_INTERVAL_MS','No\x20workflow\x20sessions\x20found','params','path','duration','\x0aUpdate\x20existing\x20project\x20\x22','Invalid\x20format:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Show\x20tasks\x20for\x20an\x20attempt','replace','select','session_id','\x20(use\x20--limit\x20to\x20show\x20more)','group_error','No\x20projects\x20match\x20pattern:\x20','Files\x20to\x20upload:\x20','workflow:retry',',\x20Workflow:\x20','dim','all','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','dryRun','\x0aFailed\x20to\x20fetch\x20attempt\x20data','session:','workflow:secrets:list','task','max','resolve','\x20deleted','✔\x20Deleted\x20project\x20','prepareCloneProject','\x20(system)','Tip:\x20cd\x20to\x20workflows/','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','session','New\x20project\x20name:\x20','\x20\x20Changes:\x20','Project\x20directory:\x20','newProjectName','\x20logs','site','workflowName','Setting\x20secret...','attempt','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','No\x20attempts\x20found\x20in\x20project:\x20','parseProjectWorkflowPattern','Resume\x20from:\x20','diff','\x20to\x20see\x20detailed\x20logs','Session\x20not\x20found:\x20','existingProjectId','Source:\x20','No\x20sessions\x20found\x20in\x20project:\x20','success','Writing\x20files...','Getting\x20attempt\x20details...','---\x20','navigateSessionsInteractive','\x22\x20with\x20new\x20revision?','name','tasks','\x20\x20Session\x20context\x20set\x20to:\x20','title','repeat','Cloning\x20to\x20','getMinutes','includeSubtasks','(use\x20--limit\x20to\x20see\x20more)','applyPullProject','getHours','workflow:download','size','2DxYMnE','\x0a✔\x20Attempt\x20complete','splice','white','Source\x20directory:\x20','error','Total:\x20','Downloading\x20project\x20','Deleting\x20project\x20','floor','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','retryAttemptName','has','end','updatedAt','workflows','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','\x20secret','columns','modified','autocomplete','match','Output\x20directory:\x20','workflow:run','red','Kill\x20a\x20running\x20attempt','reason','Validation:\x20skipped','690424uUIdhS','No\x20workflows\x20found\x20in\x20project:\x20','workflow:attempt','Include\x20retried:\x20yes','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','summary','ICON_WIDTH','indexOf','Pull\x20workflow\x20project\x20to\x20local\x20folder','-\x20nothing\x20pushed','Retry\x20a\x20session\x20or\x20attempt','MIN_TIMELINE_WIDTH','taskName','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','fullName','isNewProject','filter','Target\x20directory:\x20','type','Error:\x20','✔\x20Found\x20','fromTask','description','displayLine','806805sxVbfZ','\x0a⚠\x20Project\x20\x22','\x20\x20Project\x20ID:\x20','✔\x20Downloaded\x20','keys','Latest\x20session\x20has\x20no\x20attempt','\x20-\x20','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','MIN_LABEL_COUNT','\x20\x20tdx\x20wf\x20use\x20<project>','Retrying\x20session...','start','\x20\x20Revision:\x20','\x22\x20to\x20new\x20project\x20\x22','Revision:\x20','green','Project\x20name\x20is\x20required','Task\x20name:\x20','log','find','values','From\x20task:\x20','\x20task','run','fs/promises','Project\x20name:\x20','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','✔\x20Project:\x20','\x20modified','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','executeCloneProject','Error:\x20Attempt\x20ID\x20is\x20required','30IGfvDi','Parameters:\x20','skipValidation','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','workflow:workflows','cancelRequested','→\x20New\x20project:\x20','jsonl','delete','new','\x0aError:','table','stringify','text','sessionId','Listing\x20workflow\x20attempts...','\x20from\x20session\x20','\x0aApply\x20these\x20changes?','msPerChar','sourceProjectName','json','blue','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Pulling\x20project\x20','data','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','buildTimelineData','Attempt:\x20','startTime','newProjectId','✔\x20Retry\x20started','sort','output','💡\x20Tip:\x20Use\x20','Analyzing\x20changes...','Pushing\x20workflow\x20project...','retrySession','Workflow:\x20','\x22\x20already\x20exists\x20(ID:\x20','MAX_TASKS_DISPLAY','Listing\x20workflow\x20sessions...','parse','readFile','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','window','cwd','Listing\x20workflow\x20projects...','rows','✔\x20Pull\x20complete','/attempt/','substring','state','basename','done','\x20unchanged','workflowProject','\x20project','Error:\x20KEY=VALUE\x20is\x20required','MAX_POLL_ITERATIONS','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Start\x20a\x20workflow\x20run','Dry\x20run:\x20yes','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','sys','workflow:push','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','length','No\x20attempts\x20found','limit','kill','\x20attempt','padStart','unknown','min','list','revision:\x20','Updating\x20','\x0aDry\x20run\x20-\x20no\x20project\x20created','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','join','stat','renderSessionsTimeline','Resolving\x20project\x20\x27','Show\x20specific\x20attempt\x20details','workflow:pull','✔\x20Workflow\x20project\x20context\x20cleared.','finishedAt','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','\x20\x20Session\x20ID:\x20','follow','No\x20sessions\x20found','workflow:use','🔄\x20','3714996icddzr','resolveProject','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Pushing\x20project...','deleteSecret','format','icon','isTTY','fileCount','sessionTime','verbose','→\x20Project:\x20','download','yes','Listing\x20workflows...','Error:\x20Project\x20name\x20is\x20required','Using\x20attempt\x20','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','List\x20workflow\x20attempts','Loading\x20sessions...','set','\x20\x20New\x20attempt\x20ID:\x20','Auto-selected\x20latest\x20session:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','logs','.\x20Expected\x20format:\x20KEY=VALUE','cyan','fill','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','renderTimeline','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','pullProject','✔\x20Push\x20complete','Key:\x20','write','No\x20sessions\x20found\x20for:\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','No\x20workflows\x20found','\x20\x20Files\x20extracted:\x20','includes','\x20\x20Attempt\x20ID:\x20','planned','attemptId','retryAttempt','running','slice','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','List\x20all\x20workflow\x20projects','isArray','getDate','deleted','toLowerCase','map','resolveProjectId','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','fileSize','ICON_SPACING','Session\x20','Including\x20subtasks:\x20yes','...','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','hasChanges','/sessions/','Error:\x20Invalid\x20JSON\x20in\x20--params','metadata','resumeFrom','6587cUoUfn','\x1b[1A\x1b[2K','861633BFTxof','index','toISOString','canceling','startedAt','\x0aDry\x20run\x20-\x20no\x20files\x20written','workflow:attempts','269268MuFkXU','List\x20workflow\x20execution\x20sessions','sourceDir','split','message','project','stdout','clear','workflow:secrets:delete','pending','attempt:','getMonth','Downloading\x20logs...','changes','Project:\x20','trimEnd','yellow','Failed\x20to\x20fetch\x20attempt\x20data','Session\x20time:\x20','Listing\x20secrets...','listSecrets','No\x20matching\x20sessions\x20found','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Show\x20logs\x20for\x20a\x20workflow\x20attempt','lastAttempt','workflow:secrets:set','Params:\x20','createdAt','workflow:clone','Cancelled','LABEL_MIN_SPACING','workflow:sessions','executePushProject','Attempt\x20ID:\x20'];a42_0x4a1f=function(){return _0x3949d8;};return a42_0x4a1f();}export class WorkflowLogsCommand extends BaseCommand{[a42_0xc57567(0x331)]='workflow:logs';[a42_0xc57567(0x371)]=a42_0xc57567(0x2a8);async['execute'](_0x1e15d4){const _0x48220f=a42_0xc57567,{options:_0xac30ee,args:_0x37e05a,tdx:_0x20895c}=_0x1e15d4,_0x66eded=_0x37e05a[0x0];let _0x16eb36=_0x37e05a[0x1];if(!_0x66eded)return console[_0x48220f(0x343)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0xac30ee['verbose']&&(console['error']('Attempt\x20ID:\x20'+_0x66eded),_0x16eb36&&console['error'](_0x48220f(0x384)+_0x16eb36));const _0x456cac=await withSpinner(_0x48220f(0x2b8),()=>_0x20895c[_0x48220f(0x2da)]['logFiles'](_0x66eded,_0x16eb36),{'verbose':_0xac30ee[_0x48220f(0x250)]}),_0x5c60ed=_0x456cac[_0x48220f(0x201)];if(_0x5c60ed[_0x48220f(0x22b)]===0x0)return console[_0x48220f(0x343)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x16eb36&&(_0xac30ee[_0x48220f(0x1fc)]||_0xac30ee['format']))return await handleSDKOutput(_0x5c60ed,_0xac30ee),0x0;if(!_0x16eb36){const _0x467cbe=_0x5c60ed[_0x48220f(0x27a)](_0x30cc54=>({'title':_0x30cc54[_0x48220f(0x366)]+'\x20('+formatBytes(_0x30cc54[_0x48220f(0x27d)])+')','value':_0x30cc54[_0x48220f(0x366)]})),_0x244e89=await a42_0x4fae({'type':_0x48220f(0x2ff),'name':_0x48220f(0x30e),'message':_0x48220f(0x2bb),'choices':_0x467cbe});if(!_0x244e89[_0x48220f(0x30e)])return console[_0x48220f(0x343)](_0x48220f(0x2ae)),0x0;_0x16eb36=_0x244e89[_0x48220f(0x30e)];}const _0x163f68=await withSpinner(_0x48220f(0x29d),()=>_0x20895c[_0x48220f(0x2da)][_0x48220f(0x25e)](_0x66eded,_0x16eb36),{'verbose':_0xac30ee['verbose']}),_0x3b83f3=_0x163f68[_0x48220f(0x201)];return _0x3b83f3?console[_0x48220f(0x385)](_0x3b83f3):console[_0x48220f(0x343)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{['name']='workflow:kill';[a42_0xc57567(0x371)]=a42_0xc57567(0x357);async[a42_0xc57567(0x2dc)](_0xaf5da4){const _0x1b0363=a42_0xc57567,{options:_0x2f6646,args:_0x53a455,tdx:_0x2c3155}=_0xaf5da4,_0x206dcf=_0x53a455[0x0];if(!_0x206dcf)return console[_0x1b0363(0x343)](_0x1b0363(0x392)),0x1;const _0x77c632=_0x2f6646[_0x1b0363(0x358)];_0x2f6646[_0x1b0363(0x250)]&&(console[_0x1b0363(0x343)](_0x1b0363(0x2b2)+_0x206dcf),_0x77c632&&console[_0x1b0363(0x343)]('Reason:\x20'+_0x77c632));if(!_0x2f6646['yes']){if(!isInteractive())return console[_0x1b0363(0x343)](a42_0x28d120[_0x1b0363(0x356)]('\x0aError:'),_0x1b0363(0x2e5)),console['error'](a42_0x28d120[_0x1b0363(0x307)](_0x1b0363(0x25d))),0x1;const _0xb1c46e=await confirmKey(_0x1b0363(0x2fc)+_0x206dcf+'?');if(!_0xb1c46e)return console[_0x1b0363(0x343)](a42_0x28d120[_0x1b0363(0x2a1)](_0x1b0363(0x2ae))),0x1;}const _0x27170e=await withSpinner(_0x1b0363(0x2f0),()=>_0x2c3155['workflow'][_0x1b0363(0x22e)](_0x206dcf,_0x77c632),{'verbose':_0x2f6646[_0x1b0363(0x250)]}),_0x61b350=_0x27170e[_0x1b0363(0x201)];return console[_0x1b0363(0x343)]('✔\x20'+_0x61b350),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x305);[a42_0xc57567(0x371)]=a42_0xc57567(0x364);async[a42_0xc57567(0x2dc)](_0x2ba04c){const _0x59bbd0=a42_0xc57567,{options:_0x5f36c2,args:_0x7c6935,tdx:_0x38c457}=_0x2ba04c,_0x48d247=_0x7c6935[0x0];if(!_0x48d247)return console[_0x59bbd0(0x343)](_0x59bbd0(0x27c)),console[_0x59bbd0(0x343)](_0x59bbd0(0x2fb)),0x1;let _0x477f6c=![],_0x57b842=_0x48d247;if(_0x48d247[_0x59bbd0(0x2db)](_0x59bbd0(0x30c)))_0x477f6c=!![],_0x57b842=_0x48d247['substring'](0x8);else{if(_0x48d247[_0x59bbd0(0x2db)](_0x59bbd0(0x29b)))_0x477f6c=![],_0x57b842=_0x48d247[_0x59bbd0(0x21b)](0x8);else return console[_0x59bbd0(0x343)](_0x59bbd0(0x2a7)),console[_0x59bbd0(0x343)](_0x59bbd0(0x2fb)),0x1;}const _0x2d2070=_0x5f36c2[_0x59bbd0(0x370)],_0x103d88=_0x5f36c2[_0x59bbd0(0x287)],_0x47dbcb=_0x5f36c2[_0x59bbd0(0x2f6)],_0x3ea512=_0x5f36c2['force'];_0x5f36c2[_0x59bbd0(0x250)]&&(console[_0x59bbd0(0x343)](_0x59bbd0(0x2d5)+(_0x477f6c?_0x59bbd0(0x317):_0x59bbd0(0x320))+'\x20'+_0x57b842),_0x2d2070&&console[_0x59bbd0(0x343)](_0x59bbd0(0x388)+_0x2d2070),_0x103d88&&console[_0x59bbd0(0x343)](_0x59bbd0(0x324)+_0x103d88),_0x47dbcb&&console[_0x59bbd0(0x343)](_0x59bbd0(0x2ab)+_0x47dbcb),_0x3ea512&&console['error']('Force:\x20yes'));let _0x505f8c;if(_0x47dbcb)try{if(_0x47dbcb[_0x59bbd0(0x2db)]('@')){const _0x4e778b=await import(_0x59bbd0(0x38b)),_0x3a4de3=_0x47dbcb['substring'](0x1),_0x4cbedb=await _0x4e778b[_0x59bbd0(0x213)](_0x3a4de3,_0x59bbd0(0x2b9));_0x505f8c=JSON[_0x59bbd0(0x212)](_0x4cbedb);}else _0x505f8c=JSON[_0x59bbd0(0x212)](_0x47dbcb);}catch{return console[_0x59bbd0(0x343)](_0x59bbd0(0x285)),0x1;}if(!_0x5f36c2[_0x59bbd0(0x253)]){if(!isInteractive())return console[_0x59bbd0(0x343)](a42_0x28d120[_0x59bbd0(0x356)](_0x59bbd0(0x39d)),_0x59bbd0(0x2e5)),console[_0x59bbd0(0x343)](a42_0x28d120[_0x59bbd0(0x307)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x32a5f5=await confirmKey(_0x59bbd0(0x237)+(_0x477f6c?_0x59bbd0(0x317):_0x59bbd0(0x320))+'\x20'+_0x57b842+'?');if(!_0x32a5f5)return console[_0x59bbd0(0x343)](a42_0x28d120[_0x59bbd0(0x2a1)](_0x59bbd0(0x2ae))),0x1;}let _0x23a80a;_0x477f6c?_0x23a80a=await withSpinner(_0x59bbd0(0x37d),()=>_0x38c457[_0x59bbd0(0x2da)][_0x59bbd0(0x20d)](_0x57b842,{'fromTask':_0x2d2070,'retryParams':_0x505f8c}),{'verbose':_0x5f36c2[_0x59bbd0(0x250)]}):_0x23a80a=await withSpinner('Retrying\x20attempt...',()=>_0x38c457[_0x59bbd0(0x2da)][_0x59bbd0(0x271)](_0x57b842,{'resumeFrom':_0x103d88,'retryParams':_0x505f8c,'force':_0x3ea512}),{'verbose':_0x5f36c2[_0x59bbd0(0x250)]});const _0x1a22df=_0x23a80a[_0x59bbd0(0x201)];return console['error'](_0x59bbd0(0x207)),console['error'](_0x59bbd0(0x25b)+_0x1a22df['attemptId']),console[_0x59bbd0(0x343)](_0x59bbd0(0x241)+_0x1a22df['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x355);[a42_0xc57567(0x371)]=a42_0xc57567(0x225);async[a42_0xc57567(0x2dc)](_0x4707e4){const _0x4eb7f3=a42_0xc57567,{options:_0x5db6cb,args:_0x2c1c3a,tdx:_0x2526b8}=_0x4707e4;let _0x3394a9=_0x2c1c3a[0x0];if(!_0x3394a9){const _0x2dceed=this[_0x4eb7f3(0x247)]([],_0x5db6cb),_0x4c97b7=await withSpinner('Loading\x20workflows...',()=>_0x2526b8[_0x4eb7f3(0x2da)][_0x4eb7f3(0x34d)](_0x2dceed,{'limit':_0x5db6cb[_0x4eb7f3(0x22d)]}),{'verbose':_0x5db6cb[_0x4eb7f3(0x250)]}),_0x4a1ed5=_0x4c97b7[_0x4eb7f3(0x201)];if(_0x4a1ed5['length']===0x0)return console[_0x4eb7f3(0x343)]('No\x20workflows\x20found'),!_0x2dceed&&console['error'](a42_0x28d120[_0x4eb7f3(0x307)](_0x4eb7f3(0x2e9))),0x1;const _0x110c40=_0x4a1ed5[_0x4eb7f3(0x27a)](_0x377a25=>({'title':_0x377a25['project']?.[_0x4eb7f3(0x331)]+'.'+_0x377a25[_0x4eb7f3(0x331)],'value':_0x377a25['project']?.[_0x4eb7f3(0x331)]+'.'+_0x377a25['name'],'description':_0x377a25[_0x4eb7f3(0x2ba)]?_0x4eb7f3(0x234)+_0x377a25[_0x4eb7f3(0x2ba)]:undefined})),_0x44209=await a42_0x4fae({'type':_0x4eb7f3(0x2ff),'name':'workflow','message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x110c40});if(!_0x44209[_0x4eb7f3(0x2da)])return 0x1;_0x3394a9=_0x44209[_0x4eb7f3(0x2da)];}if(!_0x3394a9[_0x4eb7f3(0x26d)]('.')){const _0x1794b=this[_0x4eb7f3(0x247)]([],_0x5db6cb);if(_0x1794b)_0x3394a9=_0x1794b+'.'+_0x3394a9;else return console[_0x4eb7f3(0x343)](a42_0x28d120[_0x4eb7f3(0x356)]('Error:'),_0x4eb7f3(0x316)),console[_0x4eb7f3(0x343)](a42_0x28d120['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x92fd8a=_0x5db6cb[_0x4eb7f3(0x2bc)],_0x47b3c1=_0x5db6cb[_0x4eb7f3(0x24f)],_0x21e0af={};if(_0x92fd8a&&Array[_0x4eb7f3(0x276)](_0x92fd8a))for(const _0x20d3f0 of _0x92fd8a){const _0xb4bb54=_0x20d3f0[_0x4eb7f3(0x361)]('=');if(_0xb4bb54===-0x1)return console[_0x4eb7f3(0x343)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x20d3f0),console[_0x4eb7f3(0x343)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x29fc2d=_0x20d3f0[_0x4eb7f3(0x21b)](0x0,_0xb4bb54),_0xf2ada9=_0x20d3f0[_0x4eb7f3(0x21b)](_0xb4bb54+0x1);try{_0x21e0af[_0x29fc2d]=JSON['parse'](_0xf2ada9);}catch{_0x21e0af[_0x29fc2d]=_0xf2ada9;}}_0x5db6cb[_0x4eb7f3(0x250)]&&(console['error'](_0x4eb7f3(0x20e)+_0x3394a9),Object[_0x4eb7f3(0x377)](_0x21e0af)[_0x4eb7f3(0x22b)]>0x0&&console[_0x4eb7f3(0x343)](_0x4eb7f3(0x394)+JSON[_0x4eb7f3(0x1f4)](_0x21e0af)),_0x47b3c1&&console[_0x4eb7f3(0x343)](_0x4eb7f3(0x2a3)+_0x47b3c1));const _0xd6d334=await withSpinner('Starting\x20workflow\x20run...',()=>_0x2526b8[_0x4eb7f3(0x2da)][_0x4eb7f3(0x38a)](_0x3394a9,_0x21e0af,{'sessionTime':_0x47b3c1}),{'verbose':_0x5db6cb[_0x4eb7f3(0x250)]}),_0x104b1f=_0xd6d334[_0x4eb7f3(0x201)];console[_0x4eb7f3(0x343)]('✔\x20Workflow\x20run\x20started'),console[_0x4eb7f3(0x343)](_0x4eb7f3(0x26e)+_0x104b1f['id']),console[_0x4eb7f3(0x343)](_0x4eb7f3(0x241)+_0x104b1f[_0x4eb7f3(0x1f6)]),console[_0x4eb7f3(0x343)](_0x4eb7f3(0x2c2)+_0x104b1f[_0x4eb7f3(0x296)]?.[_0x4eb7f3(0x331)]),console[_0x4eb7f3(0x343)]('\x20\x20Workflow:\x20'+_0x104b1f[_0x4eb7f3(0x2da)]?.[_0x4eb7f3(0x331)]);if(_0x104b1f[_0x4eb7f3(0x296)]?.['id']&&_0x104b1f[_0x4eb7f3(0x1f6)]&&_0x104b1f['id']){const _0x772a3f=_0x5db6cb[_0x4eb7f3(0x31d)],_0x4ae94f=getConsoleUrl(_0x772a3f,'/app/workflows/'+_0x104b1f['project']['id']+_0x4eb7f3(0x284)+_0x104b1f['sessionId']+_0x4eb7f3(0x21a)+_0x104b1f['id']);console[_0x4eb7f3(0x343)](_0x4eb7f3(0x2c4)+a42_0x28d120[_0x4eb7f3(0x260)](_0x4ae94f));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a42_0xc57567(0x33c);['description']=a42_0xc57567(0x309);async[a42_0xc57567(0x2dc)](_0x37e8e8){const _0x50c4c9=a42_0xc57567,{options:_0x3dd296,args:_0x6373bf,tdx:_0x4d835a}=_0x37e8e8,_0x265ecb=_0x6373bf[0x0],_0xf55b3b=_0x6373bf[0x1]||'.';if(!_0x265ecb)return console[_0x50c4c9(0x343)](_0x50c4c9(0x255)),console[_0x50c4c9(0x343)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0xb4397b=_0x3dd296[_0x50c4c9(0x2ba)];_0x3dd296[_0x50c4c9(0x250)]&&(console['error'](_0x50c4c9(0x29f)+_0x265ecb),console[_0x50c4c9(0x343)](_0x50c4c9(0x354)+_0xf55b3b),_0xb4397b&&console[_0x50c4c9(0x343)](_0x50c4c9(0x381)+_0xb4397b));const _0x31ef7a=await withSpinner(_0x50c4c9(0x345)+_0x265ecb+_0x50c4c9(0x281),()=>_0x4d835a['workflow'][_0x50c4c9(0x252)](_0x265ecb,_0xf55b3b,{'revision':_0xb4397b}),{'verbose':_0x3dd296[_0x50c4c9(0x250)]}),_0x447e8b=_0x31ef7a[_0x50c4c9(0x201)];return console['error'](_0x50c4c9(0x376)+_0x447e8b[_0x50c4c9(0x2d3)]),console[_0x50c4c9(0x343)](_0x50c4c9(0x37f)+_0x447e8b[_0x50c4c9(0x2ba)]),console['error'](_0x50c4c9(0x26c)+_0x447e8b['filesExtracted']),console['error'](_0x50c4c9(0x2e2)+_0xf55b3b+'/'+_0x447e8b[_0x50c4c9(0x2d3)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x2bd);[a42_0xc57567(0x371)]=a42_0xc57567(0x2c9);async['execute'](_0x4d0f57){const _0x2e95a6=a42_0xc57567,{options:_0x33d5f3,args:_0x5a4862,tdx:_0x52fdbf}=_0x4d0f57;let _0x1aaada='.',_0x57682e=_0x33d5f3[_0x2e95a6(0x331)];if(_0x5a4862[0x0]){const {promises:_0x1ec962}=await import('fs');try{const _0x2fd465=await _0x1ec962[_0x2e95a6(0x239)](_0x5a4862[0x0]);if(_0x2fd465['isDirectory']())_0x1aaada=_0x5a4862[0x0];else return console[_0x2e95a6(0x343)](_0x2e95a6(0x36e)+_0x5a4862[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x57682e=_0x5a4862[0x0],_0x1aaada='.';}}const _0x238db1=_0x33d5f3[_0x2e95a6(0x2ba)],_0xed205c=_0x33d5f3[_0x2e95a6(0x395)];_0x33d5f3[_0x2e95a6(0x250)]&&(console[_0x2e95a6(0x343)](_0x2e95a6(0x31a)+_0x1aaada),_0x57682e&&console[_0x2e95a6(0x343)](_0x2e95a6(0x38c)+_0x57682e),_0x238db1&&console['error'](_0x2e95a6(0x381)+_0x238db1),_0xed205c&&console['error']('Validation:\x20skipped'));const _0x3a34dd=await withSpinner(_0x2e95a6(0x20c),()=>_0x52fdbf[_0x2e95a6(0x2da)]['push'](_0x1aaada,{'projectName':_0x57682e,'revision':_0x238db1,'skipValidation':_0xed205c}),{'verbose':_0x33d5f3[_0x2e95a6(0x250)]}),_0x47246e=_0x3a34dd[_0x2e95a6(0x201)];return console[_0x2e95a6(0x343)](_0x2e95a6(0x2cb)+_0x47246e[_0x2e95a6(0x2d3)]),console['error'](_0x2e95a6(0x375)+_0x47246e['projectId']),console[_0x2e95a6(0x343)](_0x2e95a6(0x37f)+_0x47246e['revision']),await this['showWorkflowConsoleUrl'](_0x52fdbf,_0x47246e['projectName'],_0x33d5f3[_0x2e95a6(0x31d)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x23d);[a42_0xc57567(0x371)]=a42_0xc57567(0x362);async[a42_0xc57567(0x2dc)](_0x21270f){const _0x566f77=a42_0xc57567,{options:_0x220fd5,args:_0x373230,tdx:_0x4246c9}=_0x21270f,_0x1296de=_0x373230[0x0],_0x580163=_0x373230[0x1];if(!_0x1296de)return console['error'](a42_0x28d120[_0x566f77(0x356)](_0x566f77(0x2c8)),'Project\x20name\x20is\x20required'),console['error'](a42_0x28d120[_0x566f77(0x307)](_0x566f77(0x37a))),0x1;const _0x4a93d9=_0x220fd5[_0x566f77(0x2ba)];_0x220fd5['verbose']&&(console[_0x566f77(0x343)](_0x566f77(0x29f)+_0x1296de),_0x580163&&console[_0x566f77(0x343)](_0x566f77(0x36c)+_0x580163),_0x4a93d9&&console[_0x566f77(0x343)](_0x566f77(0x381)+_0x4a93d9),_0x220fd5['dryRun']&&console['error'](_0x566f77(0x226)));const _0x180718=await withSpinner(_0x566f77(0x200)+_0x1296de+'...',()=>_0x4246c9[_0x566f77(0x2da)][_0x566f77(0x265)](_0x1296de,{'targetDir':_0x580163,'revision':_0x4a93d9}),{'verbose':_0x220fd5[_0x566f77(0x250)]}),_0x3e090c=_0x180718['data'];_0x3e090c[_0x566f77(0x36a)]?console[_0x566f77(0x343)](_0x566f77(0x399)+_0x3e090c[_0x566f77(0x2d3)]):console['error'](_0x566f77(0x251)+_0x3e090c['projectName']);console[_0x566f77(0x343)]('\x20\x20Revision:\x20'+_0x3e090c['revision']),console['error']('\x20\x20Target:\x20'+(a42_0x4c5f63['relative'](process[_0x566f77(0x216)](),_0x3e090c['targetDir'])||'.')),console[_0x566f77(0x343)](_0x566f77(0x319)+a42_0x28d120[_0x566f77(0x382)]('+'+_0x3e090c[_0x566f77(0x35f)][_0x566f77(0x39c)]+_0x566f77(0x2f2))+',\x20'+(a42_0x28d120['yellow']('~'+_0x3e090c[_0x566f77(0x35f)][_0x566f77(0x351)]+_0x566f77(0x38f))+',\x20')+(a42_0x28d120['red']('-'+_0x3e090c[_0x566f77(0x35f)][_0x566f77(0x278)]+_0x566f77(0x311))+',\x20')+(''+a42_0x28d120[_0x566f77(0x307)](_0x3e090c[_0x566f77(0x35f)][_0x566f77(0x2bf)]+_0x566f77(0x21f))));for(const _0x56875c of _0x3e090c[_0x566f77(0x29e)]){_0x56875c[_0x566f77(0x36d)]===_0x566f77(0x351)&&_0x56875c[_0x566f77(0x325)]&&(console[_0x566f77(0x343)]('\x0a'+a42_0x28d120['cyan'](_0x566f77(0x32e)+_0x56875c[_0x566f77(0x2f7)])),console['error'](_0x56875c[_0x566f77(0x325)]));}if(!_0x3e090c[_0x566f77(0x283)])return saveSessionContext({'workflow_project':_0x3e090c['projectName']},_0x220fd5[_0x566f77(0x317)]),console[_0x566f77(0x343)](a42_0x28d120[_0x566f77(0x382)]('\x0a✔\x20Already\x20up\x20to\x20date')),console['error'](a42_0x28d120[_0x566f77(0x307)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x3e090c[_0x566f77(0x2d3)])),0x0;if(_0x220fd5['dryRun'])return console[_0x566f77(0x343)](a42_0x28d120[_0x566f77(0x2a1)](_0x566f77(0x28f))),0x0;if(!_0x220fd5['yes']){if(!isInteractive())return console['error'](a42_0x28d120[_0x566f77(0x356)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x566f77(0x343)](a42_0x28d120[_0x566f77(0x307)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4c10c2=await confirmKey(_0x566f77(0x1f9));if(!_0x4c10c2)return console[_0x566f77(0x343)](a42_0x28d120[_0x566f77(0x2a1)](_0x566f77(0x2ae)),'-\x20no\x20files\x20written'),0x1;}await withSpinner(_0x566f77(0x32c),()=>_0x4246c9[_0x566f77(0x2da)][_0x566f77(0x33a)](_0x3e090c,{'revision':_0x4a93d9}),{'verbose':_0x220fd5[_0x566f77(0x250)]}),saveSessionContext({'workflow_project':_0x3e090c[_0x566f77(0x2d3)]},_0x220fd5[_0x566f77(0x317)]),console[_0x566f77(0x343)](a42_0x28d120[_0x566f77(0x382)](_0x566f77(0x219)));const _0x3548b2=a42_0x4c5f63['relative'](process[_0x566f77(0x216)](),_0x3e090c['targetDir'])||'.';return console[_0x566f77(0x343)](a42_0x28d120['dim'](_0x566f77(0x2e2)+_0x3548b2)),console['error'](a42_0x28d120[_0x566f77(0x307)](_0x566f77(0x333)+_0x3e090c[_0x566f77(0x2d3)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x229);[a42_0xc57567(0x371)]=a42_0xc57567(0x2d7);async[a42_0xc57567(0x2dc)](_0x557227){const _0x52f75b=a42_0xc57567,{options:_0x41dda1,args:_0x17c134,tdx:_0xf71735}=_0x557227,_0x15d9d6=this[_0x52f75b(0x2de)](_0x17c134,_0x41dda1),_0x16c6ab=_0x41dda1[_0x52f75b(0x2ba)],_0x16be2d=_0x41dda1[_0x52f75b(0x395)];_0x41dda1['verbose']&&(_0x15d9d6&&console['error'](_0x52f75b(0x342)+_0x15d9d6),_0x16c6ab&&console[_0x52f75b(0x343)](_0x52f75b(0x381)+_0x16c6ab),_0x41dda1['dryRun']&&console[_0x52f75b(0x343)](_0x52f75b(0x226)),_0x16be2d&&console[_0x52f75b(0x343)](_0x52f75b(0x359)));let _0x377757;try{_0x377757=await withSpinner(_0x52f75b(0x20b),()=>_0xf71735[_0x52f75b(0x2da)][_0x52f75b(0x2e0)]({'sourceDir':_0x15d9d6,'revision':_0x16c6ab,'skipValidation':_0x16be2d}),{'verbose':_0x41dda1[_0x52f75b(0x250)]});}catch(_0xa6523b){if(_0xa6523b instanceof Error&&_0xa6523b[_0x52f75b(0x295)][_0x52f75b(0x26d)]('No\x20workflow\x20tdx.json\x20found'))return console['error'](a42_0x28d120[_0x52f75b(0x356)](_0x52f75b(0x2c8)),_0x52f75b(0x202)),_0x41dda1[_0x52f75b(0x220)]?console['error'](a42_0x28d120['dim'](_0x52f75b(0x315)+_0x41dda1['workflowProject']+_0x52f75b(0x368)+_0x41dda1[_0x52f75b(0x220)]+'\x27')):console[_0x52f75b(0x343)](a42_0x28d120[_0x52f75b(0x307)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0xa6523b;}const _0x1b6b33=_0x377757['data'];console['error'](_0x52f75b(0x38e)+_0x1b6b33[_0x52f75b(0x2d3)]),console['error']('\x20\x20Source:\x20'+_0x1b6b33[_0x52f75b(0x293)]),console[_0x52f75b(0x343)](_0x52f75b(0x37f)+_0x1b6b33['revision']),console[_0x52f75b(0x343)](_0x52f75b(0x319)+a42_0x28d120[_0x52f75b(0x382)]('+'+_0x1b6b33['summary'][_0x52f75b(0x39c)]+'\x20new')+',\x20'+(a42_0x28d120[_0x52f75b(0x2a1)]('~'+_0x1b6b33[_0x52f75b(0x35f)][_0x52f75b(0x351)]+_0x52f75b(0x38f))+',\x20')+(a42_0x28d120[_0x52f75b(0x356)]('-'+_0x1b6b33[_0x52f75b(0x35f)][_0x52f75b(0x278)]+'\x20deleted')+',\x20')+(''+a42_0x28d120[_0x52f75b(0x307)](_0x1b6b33[_0x52f75b(0x35f)][_0x52f75b(0x2bf)]+_0x52f75b(0x21f))));for(const _0x3d6e29 of _0x1b6b33[_0x52f75b(0x29e)]){_0x3d6e29[_0x52f75b(0x36d)]==='modified'&&_0x3d6e29[_0x52f75b(0x325)]&&(console[_0x52f75b(0x343)]('\x0a'+a42_0x28d120[_0x52f75b(0x260)](_0x52f75b(0x32e)+_0x3d6e29[_0x52f75b(0x2f7)])),console[_0x52f75b(0x343)](_0x3d6e29[_0x52f75b(0x325)]));}if(!_0x1b6b33[_0x52f75b(0x283)])return console[_0x52f75b(0x343)](a42_0x28d120[_0x52f75b(0x382)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x52f75b(0x2be)](_0xf71735,_0x1b6b33['projectName'],_0x41dda1[_0x52f75b(0x31d)]),0x0;if(_0x41dda1[_0x52f75b(0x30a)])return console[_0x52f75b(0x343)](a42_0x28d120['yellow'](_0x52f75b(0x2b3))),0x0;if(!_0x41dda1['yes']){if(!isInteractive())return console[_0x52f75b(0x343)](a42_0x28d120['red'](_0x52f75b(0x39d)),_0x52f75b(0x2e5)),console['error'](a42_0x28d120[_0x52f75b(0x307)](_0x52f75b(0x25d))),0x1;const _0x126e3c=await confirmKey(_0x52f75b(0x2e7));if(!_0x126e3c)return console[_0x52f75b(0x343)](a42_0x28d120['yellow']('Cancelled'),_0x52f75b(0x363)),0x1;}const _0x1e57a9=await withSpinner(_0x52f75b(0x249),()=>_0xf71735[_0x52f75b(0x2da)][_0x52f75b(0x2b1)](_0x1b6b33),{'verbose':_0x41dda1[_0x52f75b(0x250)]}),_0x36f75a=_0x1e57a9[_0x52f75b(0x201)];return console['error'](a42_0x28d120[_0x52f75b(0x382)](_0x52f75b(0x266))),console[_0x52f75b(0x343)](_0x52f75b(0x375)+_0x36f75a['projectId']),console[_0x52f75b(0x343)]('\x20\x20Revision:\x20'+_0x36f75a[_0x52f75b(0x2ba)]),await this[_0x52f75b(0x2be)](_0xf71735,_0x36f75a[_0x52f75b(0x2d3)],_0x41dda1[_0x52f75b(0x31d)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x2ad);[a42_0xc57567(0x371)]=a42_0xc57567(0x321);async[a42_0xc57567(0x2dc)](_0x5d0f9a){const _0x271c7c=a42_0xc57567,{options:_0x1a8b27,args:_0x19b312,tdx:_0x518d49}=_0x5d0f9a,_0x31b8af=this[_0x271c7c(0x2de)](_0x19b312,_0x1a8b27),_0x2e0dbd=_0x1a8b27['name'],_0x340bfa=_0x1a8b27['revision'],_0x1d2e89=_0x1a8b27[_0x271c7c(0x395)];if(!_0x31b8af)return console[_0x271c7c(0x343)](a42_0x28d120[_0x271c7c(0x356)](_0x271c7c(0x2c8)),'Source\x20directory\x20is\x20required'),console['error'](a42_0x28d120[_0x271c7c(0x307)](_0x271c7c(0x22a))),console['error'](a42_0x28d120[_0x271c7c(0x307)](_0x271c7c(0x274))),0x1;if(!_0x2e0dbd)return console[_0x271c7c(0x343)](a42_0x28d120[_0x271c7c(0x356)]('Error:'),_0x271c7c(0x2b7)),console[_0x271c7c(0x343)](a42_0x28d120[_0x271c7c(0x307)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x1a8b27['verbose']&&(console['error'](_0x271c7c(0x342)+_0x31b8af),console[_0x271c7c(0x343)](_0x271c7c(0x318)+_0x2e0dbd),_0x340bfa&&console['error'](_0x271c7c(0x381)+_0x340bfa),_0x1a8b27[_0x271c7c(0x30a)]&&console[_0x271c7c(0x343)]('Dry\x20run:\x20yes'),_0x1d2e89&&console[_0x271c7c(0x343)](_0x271c7c(0x359)));const _0x3527fe=await withSpinner('Analyzing\x20project...',()=>_0x518d49[_0x271c7c(0x2da)][_0x271c7c(0x313)](_0x31b8af,_0x2e0dbd,{'revision':_0x340bfa,'skipValidation':_0x1d2e89}),{'verbose':_0x1a8b27[_0x271c7c(0x250)]}),_0x5688e7=_0x3527fe[_0x271c7c(0x201)];console[_0x271c7c(0x343)](_0x271c7c(0x329)+_0x5688e7[_0x271c7c(0x293)]);_0x5688e7['sourceProjectName']&&console[_0x271c7c(0x343)]('Source\x20project:\x20'+_0x5688e7[_0x271c7c(0x1fb)]);console['error'](_0x271c7c(0x318)+_0x5688e7[_0x271c7c(0x31b)]),console['error'](_0x271c7c(0x381)+_0x5688e7[_0x271c7c(0x2ba)]),console['error'](_0x271c7c(0x304)+_0x5688e7[_0x271c7c(0x24e)]);_0x5688e7[_0x271c7c(0x2d8)]&&(console['error'](a42_0x28d120['yellow'](_0x271c7c(0x374)+_0x5688e7[_0x271c7c(0x31b)]+_0x271c7c(0x20f)+_0x5688e7[_0x271c7c(0x328)]+')')),console[_0x271c7c(0x343)](a42_0x28d120[_0x271c7c(0x2a1)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x1a8b27['dryRun'])return console[_0x271c7c(0x343)](a42_0x28d120[_0x271c7c(0x2a1)](_0x271c7c(0x236))),0x0;if(!_0x1a8b27[_0x271c7c(0x253)]){if(!isInteractive())return console[_0x271c7c(0x343)](a42_0x28d120[_0x271c7c(0x356)](_0x271c7c(0x39d)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x271c7c(0x343)](a42_0x28d120[_0x271c7c(0x307)](_0x271c7c(0x25d))),0x1;const _0x3e69e3=_0x5688e7[_0x271c7c(0x1fb)]||a42_0x4c5f63[_0x271c7c(0x21d)](_0x31b8af),_0x1c2011=_0x5688e7[_0x271c7c(0x2d8)]?_0x271c7c(0x2f9)+_0x2e0dbd+_0x271c7c(0x330):_0x271c7c(0x2cf)+_0x3e69e3+_0x271c7c(0x380)+_0x2e0dbd+'\x22?',_0x5ac55f=await confirmKey(_0x1c2011);if(!_0x5ac55f)return console[_0x271c7c(0x343)](a42_0x28d120[_0x271c7c(0x2a1)](_0x271c7c(0x2ae))),0x1;}const _0x1173f2=await withSpinner(_0x5688e7[_0x271c7c(0x2d8)]?_0x271c7c(0x235)+_0x2e0dbd+_0x271c7c(0x281):_0x271c7c(0x336)+_0x2e0dbd+'...',()=>_0x518d49[_0x271c7c(0x2da)][_0x271c7c(0x391)](_0x5688e7),{'verbose':_0x1a8b27[_0x271c7c(0x250)]}),_0x43cc71=_0x1173f2[_0x271c7c(0x201)];return console[_0x271c7c(0x343)](a42_0x28d120[_0x271c7c(0x382)](_0x5688e7['targetExists']?'✔\x20Project\x20updated':_0x271c7c(0x2eb))),console[_0x271c7c(0x343)](_0x271c7c(0x2c2)+_0x43cc71[_0x271c7c(0x31b)]),console[_0x271c7c(0x343)]('\x20\x20Project\x20ID:\x20'+_0x43cc71[_0x271c7c(0x206)]),console[_0x271c7c(0x343)](_0x271c7c(0x37f)+_0x43cc71[_0x271c7c(0x2ba)]),await this[_0x271c7c(0x2be)](_0x518d49,_0x43cc71[_0x271c7c(0x31b)],_0x1a8b27[_0x271c7c(0x31d)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a42_0xc57567(0x331)]='workflow:delete';[a42_0xc57567(0x371)]=a42_0xc57567(0x282);async[a42_0xc57567(0x2dc)](_0x11c68f){const _0x2b112c=a42_0xc57567,{options:_0x2b9d04,args:_0x1833c6,tdx:_0x38c1fe}=_0x11c68f,_0x506b54=_0x1833c6[0x0];if(!_0x506b54)return console[_0x2b112c(0x343)](_0x2b112c(0x396)),console[_0x2b112c(0x343)](_0x2b112c(0x2c7)),0x1;_0x2b9d04['verbose']&&console[_0x2b112c(0x343)](_0x2b112c(0x29f)+_0x506b54);if(!_0x2b9d04[_0x2b112c(0x253)]){if(!isInteractive())return console['error'](a42_0x28d120[_0x2b112c(0x356)](_0x2b112c(0x39d)),_0x2b112c(0x2e5)),console[_0x2b112c(0x343)](a42_0x28d120[_0x2b112c(0x307)](_0x2b112c(0x25d))),0x1;const _0x54c57a=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x506b54+_0x2b112c(0x2f3));if(!_0x54c57a)return console[_0x2b112c(0x343)](a42_0x28d120['yellow']('Cancelled')),0x1;}const _0x47a07f=await withSpinner(_0x2b112c(0x346)+_0x506b54+'...',()=>_0x38c1fe[_0x2b112c(0x2da)][_0x2b112c(0x39b)](_0x506b54),{'verbose':_0x2b9d04[_0x2b112c(0x250)]}),_0x5ee97a=_0x47a07f[_0x2b112c(0x201)];return console[_0x2b112c(0x343)](_0x2b112c(0x312)+_0x5ee97a[_0x2b112c(0x2d3)]),console[_0x2b112c(0x343)](_0x2b112c(0x375)+_0x5ee97a[_0x2b112c(0x2ca)]),0x0;}}export function parseKeyValue(_0x377d82){const _0x37821e=a42_0xc57567,_0x1a5964=_0x377d82[_0x37821e(0x361)]('=');if(_0x1a5964===-0x1)throw new Error(_0x37821e(0x2fa)+_0x377d82+_0x37821e(0x25f));const _0x56f770=_0x377d82[_0x37821e(0x21b)](0x0,_0x1a5964),_0x4f8ec6=_0x377d82[_0x37821e(0x21b)](_0x1a5964+0x1);if(!_0x56f770)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x56f770,'value':_0x4f8ec6};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x30d);[a42_0xc57567(0x371)]=a42_0xc57567(0x262);async['execute'](_0x3e539a){const _0x3d296c=a42_0xc57567,{options:_0x35af96,args:_0x4270b7,tdx:_0x1a48da}=_0x3e539a,_0x504e14=this[_0x3d296c(0x2e6)](_0x4270b7,_0x35af96);if(!_0x504e14)return 0x1;_0x35af96[_0x3d296c(0x250)]&&console[_0x3d296c(0x343)](_0x3d296c(0x29f)+_0x504e14);const _0x3b38fe=await withSpinner(_0x3d296c(0x2a4),()=>_0x1a48da[_0x3d296c(0x2da)][_0x3d296c(0x2a5)](_0x504e14),{'verbose':_0x35af96[_0x3d296c(0x250)]}),{secrets:_0x7f6a75}=_0x3b38fe[_0x3d296c(0x201)];return console[_0x3d296c(0x343)](_0x3d296c(0x36f)+_0x7f6a75[_0x3d296c(0x22b)]+_0x3d296c(0x34f)+(_0x7f6a75['length']!==0x1?'s':'')),await handleSDKOutput(_0x7f6a75,_0x35af96),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a42_0xc57567(0x2aa);[a42_0xc57567(0x371)]='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async[a42_0xc57567(0x2dc)](_0x4a9fe8){const _0x5eec8d=a42_0xc57567,{options:_0x570e32,args:_0x408a4f,tdx:_0x4a9234}=_0x4a9fe8;let _0x42f162,_0x402d28;if(_0x408a4f['length']>=0x2)_0x42f162=_0x408a4f[0x0],_0x402d28=_0x408a4f[0x1];else{if(_0x408a4f['length']===0x1&&_0x570e32[_0x5eec8d(0x220)])_0x42f162=_0x570e32[_0x5eec8d(0x220)],_0x402d28=_0x408a4f[0x0];else return _0x408a4f[_0x5eec8d(0x22b)]===0x1?(console[_0x5eec8d(0x343)](_0x5eec8d(0x255)),console[_0x5eec8d(0x343)](_0x5eec8d(0x2e9)),0x1):(console[_0x5eec8d(0x343)](_0x5eec8d(0x222)),console[_0x5eec8d(0x343)](_0x5eec8d(0x227)),0x1);}let _0x2f1ff8,_0x32c267;try{({key:_0x2f1ff8,value:_0x32c267}=parseKeyValue(_0x402d28));}catch(_0x2cd053){return _0x2cd053 instanceof Error&&console[_0x5eec8d(0x343)](a42_0x28d120[_0x5eec8d(0x356)](_0x5eec8d(0x2c8)),_0x2cd053[_0x5eec8d(0x295)]),0x1;}_0x570e32[_0x5eec8d(0x250)]&&(console['error'](_0x5eec8d(0x29f)+_0x42f162),console[_0x5eec8d(0x343)](_0x5eec8d(0x267)+_0x2f1ff8));const _0x3fd258=await withSpinner(_0x5eec8d(0x31f),()=>_0x4a9234[_0x5eec8d(0x2da)]['setSecret'](_0x42f162,_0x2f1ff8,_0x32c267),{'verbose':_0x570e32['verbose']}),_0x11c0da=_0x3fd258[_0x5eec8d(0x201)];return console[_0x5eec8d(0x343)]('✔\x20Secret\x20\x27'+_0x11c0da['key']+_0x5eec8d(0x248)+_0x11c0da[_0x5eec8d(0x2d3)]+'\x27'),(_0x570e32[_0x5eec8d(0x1fc)]||_0x570e32[_0x5eec8d(0x39a)])&&await handleSingleObjectOutput(_0x11c0da,_0x570e32),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x299);['description']=a42_0xc57567(0x390);async[a42_0xc57567(0x2dc)](_0x40395c){const _0x306b5a=a42_0xc57567,{options:_0x1b130e,args:_0x475cd9,tdx:_0x47be3e}=_0x40395c;let _0x563da8,_0x5339f8;if(_0x475cd9['length']>=0x2)_0x563da8=_0x475cd9[0x0],_0x5339f8=_0x475cd9[0x1];else{if(_0x475cd9[_0x306b5a(0x22b)]===0x1&&_0x1b130e[_0x306b5a(0x220)])_0x563da8=_0x1b130e[_0x306b5a(0x220)],_0x5339f8=_0x475cd9[0x0];else return _0x475cd9[_0x306b5a(0x22b)]===0x1?(console[_0x306b5a(0x343)](_0x306b5a(0x255)),console[_0x306b5a(0x343)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x306b5a(0x343)]('Error:\x20Secret\x20key\x20is\x20required'),console[_0x306b5a(0x343)]('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x1b130e[_0x306b5a(0x250)]&&(console[_0x306b5a(0x343)]('Project:\x20'+_0x563da8),console['error'](_0x306b5a(0x267)+_0x5339f8));if(!_0x1b130e[_0x306b5a(0x253)]){if(!isInteractive())return console[_0x306b5a(0x343)](a42_0x28d120[_0x306b5a(0x356)](_0x306b5a(0x39d)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x306b5a(0x343)](a42_0x28d120[_0x306b5a(0x307)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1690c4=await confirmKey(_0x306b5a(0x240)+_0x5339f8+'\x27\x20from\x20project\x20\x27'+_0x563da8+'\x27?');if(!_0x1690c4)return console[_0x306b5a(0x343)](a42_0x28d120[_0x306b5a(0x2a1)](_0x306b5a(0x2ae))),0x1;}const _0x2a9460=await withSpinner('Deleting\x20secret...',()=>_0x47be3e['workflow'][_0x306b5a(0x24a)](_0x563da8,_0x5339f8),{'verbose':_0x1b130e[_0x306b5a(0x250)]}),_0x427642=_0x2a9460[_0x306b5a(0x201)];return console['error']('✔\x20Secret\x20\x27'+_0x427642['key']+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x427642[_0x306b5a(0x2d3)]+'\x27'),(_0x1b130e[_0x306b5a(0x1fc)]||_0x1b130e[_0x306b5a(0x39a)])&&await handleSingleObjectOutput(_0x427642,_0x1b130e),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(_0x293cf2){const _0x19c598=a42_0xc57567,_0x7adb8f=Math[_0x19c598(0x347)](_0x293cf2/0x3e8),_0x36d3db=Math['floor'](_0x7adb8f/0x3c),_0x1860d7=Math[_0x19c598(0x347)](_0x36d3db/0x3c),_0x30d076=Math[_0x19c598(0x347)](_0x1860d7/0x18);if(_0x30d076>0x0){const _0x1dbb59=_0x1860d7%0x18;return _0x1dbb59>0x0?_0x30d076+'d\x20'+_0x1dbb59+'h':_0x30d076+'d';}else{if(_0x1860d7>0x0){const _0x3f162a=_0x36d3db%0x3c;return _0x3f162a>0x0?_0x1860d7+'h\x20'+_0x3f162a+'m':_0x1860d7+'h';}else{if(_0x36d3db>0x0){const _0x427c4a=_0x7adb8f%0x3c;return _0x427c4a>0x0?_0x36d3db+'m\x20'+_0x427c4a+'s':_0x36d3db+'m';}else return _0x7adb8f+'s';}}}function a42_0x15e8(_0x32b26b,_0x38622b){_0x32b26b=_0x32b26b-0x1f4;const _0x4a1f13=a42_0x4a1f();let _0x15e8b6=_0x4a1f13[_0x32b26b];return _0x15e8b6;}function formatTimestamp(_0x17ee6b,_0x569a25){const _0x329e13=a42_0xc57567,_0x5c2e48=new Date(_0x17ee6b),_0x11f13b=String(_0x5c2e48[_0x329e13(0x33b)]())[_0x329e13(0x230)](0x2,'0'),_0x1f108b=String(_0x5c2e48[_0x329e13(0x337)]())[_0x329e13(0x230)](0x2,'0'),_0x49aa17=_0x11f13b+':'+_0x1f108b,_0x45178a=_0x5c2e48[_0x329e13(0x2d6)]()===_0x569a25[_0x329e13(0x2d6)]()&&_0x5c2e48['getMonth']()===_0x569a25[_0x329e13(0x29c)]()&&_0x5c2e48['getDate']()===_0x569a25['getDate']();if(_0x45178a)return _0x49aa17;else{const _0x2d3984=String(_0x5c2e48[_0x329e13(0x29c)]()+0x1)[_0x329e13(0x230)](0x2,'0'),_0x5c15f4=String(_0x5c2e48[_0x329e13(0x277)]())[_0x329e13(0x230)](0x2,'0');return _0x2d3984+'-'+_0x5c15f4+'\x20'+_0x49aa17;}}function formatDate(_0x3ffce4){const _0x12272e=a42_0xc57567,_0x3e7f73=_0x3ffce4['getFullYear'](),_0xb418cc=String(_0x3ffce4[_0x12272e(0x29c)]()+0x1)[_0x12272e(0x230)](0x2,'0'),_0x51876a=String(_0x3ffce4['getDate']())[_0x12272e(0x230)](0x2,'0');return _0x3e7f73+'-'+_0xb418cc+'-'+_0x51876a;}function getTaskStateIcon(_0x4c7064){const _0x5e9046={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x5e9046[_0x4c7064]||'⚪';}function getBarChar(_0x43bdeb){const _0x1af28a=a42_0xc57567;return _0x43bdeb===_0x1af28a(0x343)||_0x43bdeb===_0x1af28a(0x302)?'×':'─';}function getBarColor(_0x53ced5){const _0x322bf7=a42_0xc57567,_0xa1fd30={'success':a42_0x28d120[_0x322bf7(0x382)],'error':a42_0x28d120[_0x322bf7(0x356)],'group_error':a42_0x28d120[_0x322bf7(0x356)],'running':a42_0x28d120[_0x322bf7(0x1fd)],'blocked':a42_0x28d120['yellow'],'planned':a42_0x28d120[_0x322bf7(0x307)],'canceling':a42_0x28d120[_0x322bf7(0x2a1)]};return _0xa1fd30[_0x53ced5]||a42_0x28d120[_0x322bf7(0x341)];}function parseTaskName(_0x4aff2e){const _0x37ae8e=a42_0xc57567;let _0x406dfa=_0x4aff2e[_0x37ae8e(0x2fe)](/^\++/,'');const _0x5532b4=_0x406dfa[_0x37ae8e(0x294)]('+'),_0x4b5790=_0x5532b4[_0x37ae8e(0x22b)]>0x1?_0x5532b4['length']-0x2:0x0,_0x10d53b=_0x5532b4[_0x5532b4[_0x37ae8e(0x22b)]-0x1]||_0x406dfa;return{'level':_0x4b5790,'name':'+'+_0x10d53b};}function truncateTaskName(_0xbda6bb,_0x22cf0a){const _0x795a5e=a42_0xc57567,_0x48a0d4=stringWidth(_0xbda6bb);if(_0x48a0d4<=_0x22cf0a)return _0xbda6bb;let _0x1c5e81=_0xbda6bb;while(stringWidth(_0x1c5e81+'…')>_0x22cf0a&&_0x1c5e81[_0x795a5e(0x22b)]>0x0){_0x1c5e81=_0x1c5e81[_0x795a5e(0x273)](0x0,-0x1);}return _0x1c5e81+'…';}function calculateTimeScale(_0x2600fe,_0x378896){const _0x212a0c=a42_0xc57567;return{'startTime':_0x2600fe[_0x212a0c(0x37e)],'endTime':_0x2600fe['end'],'durationMs':_0x2600fe['duration'],'msPerChar':_0x2600fe[_0x212a0c(0x2f8)]/_0x378896};}function timeToPosition(_0x577238,_0x2ae3b9,_0x4a83b7){const _0x496ded=a42_0xc57567,_0x14d22d=_0x577238-_0x2ae3b9[_0x496ded(0x205)],_0x17d278=Math['floor'](_0x14d22d/_0x2ae3b9[_0x496ded(0x1fa)]);return Math[_0x496ded(0x30f)](0x0,Math['min'](_0x17d278,_0x4a83b7));}function renderTimeAxis(_0x423a88,_0x4a84ec){const _0x1fd693=a42_0xc57567,_0x3e6f41=Math[_0x1fd693(0x232)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x1fd693(0x30f)](TIMELINE_CONFIG[_0x1fd693(0x37b)],Math[_0x1fd693(0x347)](_0x4a84ec/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x2563cf=_0x423a88['durationMs']/(_0x3e6f41-0x1),_0x2a5bfb=new Date(_0x423a88[_0x1fd693(0x205)]),_0x46fa26=[];for(let _0x42a5a0=0x0;_0x42a5a0<_0x3e6f41;_0x42a5a0++){const _0x1745c9=_0x423a88[_0x1fd693(0x205)]+_0x42a5a0*_0x2563cf,_0x3fcd92=timeToPosition(_0x1745c9,_0x423a88,_0x4a84ec),_0x47777c=formatTimestamp(_0x1745c9,_0x2a5bfb);_0x46fa26[_0x1fd693(0x2c5)]({'pos':_0x3fcd92,'text':_0x47777c});}const _0x253554=new Array(_0x4a84ec)[_0x1fd693(0x261)]('\x20');let _0x5ca6ca=-0x1;for(const {pos:_0x2078f4,text:_0x553c9d}of _0x46fa26){let _0x32ee7e=Math['max'](0x0,_0x2078f4-Math['floor'](_0x553c9d[_0x1fd693(0x22b)]/0x2));_0x32ee7e<=_0x5ca6ca+TIMELINE_CONFIG[_0x1fd693(0x2af)]&&(_0x32ee7e=_0x5ca6ca+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x32ee7e+_0x553c9d[_0x1fd693(0x22b)]>_0x4a84ec&&(_0x32ee7e=_0x4a84ec-_0x553c9d[_0x1fd693(0x22b)]);if(_0x32ee7e>=0x0&&_0x32ee7e+_0x553c9d[_0x1fd693(0x22b)]<=_0x4a84ec&&_0x32ee7e>_0x5ca6ca){for(let _0xa2b5d4=0x0;_0xa2b5d4<_0x553c9d['length'];_0xa2b5d4++){_0x253554[_0x32ee7e+_0xa2b5d4]=_0x553c9d[_0xa2b5d4];}_0x5ca6ca=_0x32ee7e+_0x553c9d['length']-0x1;}}return _0x253554[_0x1fd693(0x238)]('');}function renderTaskRow(_0x201b52,_0x5277eb,_0x5385e2,_0x496ffa){const _0x2f6592=a42_0xc57567,{level:_0x34d3c4,name:_0x41336a}=parseTaskName(_0x201b52[_0x2f6592(0x331)]),_0x5da872='\x20'['repeat'](_0x34d3c4),_0x11236d=_0x201b52[_0x2f6592(0x215)]?'('+formatElapsed(_0x201b52[_0x2f6592(0x215)][_0x2f6592(0x2f8)])+')':'',_0x3e2bae=stringWidth(_0x11236d),_0x4a9ba1=_0x34d3c4*0x1,_0x400b6d=_0x496ffa-_0x4a9ba1-_0x3e2bae-0x1,_0x3b9fb1=truncateTaskName(_0x41336a,_0x400b6d),_0x3ce738=_0x5da872+_0x3b9fb1,_0x5582e1=stringWidth(_0x3ce738),_0x2bb3bf=_0x496ffa-_0x5582e1-_0x3e2bae,_0x37edfe=_0x3ce738+'\x20'[_0x2f6592(0x335)](Math[_0x2f6592(0x30f)](0x1,_0x2bb3bf))+a42_0x28d120[_0x2f6592(0x307)](_0x11236d),_0x510856=getTaskStateIcon(_0x201b52['state']),_0x58e869=new Array(_0x5385e2)['fill']('\x20');if(_0x201b52['window']){const _0xb92581=timeToPosition(_0x201b52[_0x2f6592(0x215)]['start'],_0x5277eb,_0x5385e2),_0x3dd670=timeToPosition(_0x201b52[_0x2f6592(0x215)][_0x2f6592(0x34b)],_0x5277eb,_0x5385e2),_0x27b16f=getBarChar(_0x201b52[_0x2f6592(0x21c)]),_0x1c3cb5=Math[_0x2f6592(0x30f)](_0xb92581+0x1,_0x3dd670);for(let _0x1c0e0a=_0xb92581;_0x1c0e0a<Math[_0x2f6592(0x232)](_0x1c3cb5,_0x5385e2);_0x1c0e0a++){_0x58e869[_0x1c0e0a]=_0x27b16f;}}const _0x305132=getBarColor(_0x201b52[_0x2f6592(0x21c)]),_0x215f13=_0x58e869[_0x2f6592(0x27a)](_0x1e244a=>_0x1e244a==='\x20'?'\x20':_0x305132(_0x1e244a))[_0x2f6592(0x238)]('');return _0x510856+'\x20'+_0x37edfe+'│'+_0x215f13+'│';}function calculateStats(_0x34b0f2){const _0x54ecf3=a42_0xc57567,_0x62fe07={'total':_0x34b0f2[_0x54ecf3(0x22b)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0xdc6723 of _0x34b0f2){if(_0xdc6723[_0x54ecf3(0x21c)]===_0x54ecf3(0x32b))_0x62fe07[_0x54ecf3(0x32b)]++;else{if(_0xdc6723[_0x54ecf3(0x21c)]===_0x54ecf3(0x343)||_0xdc6723[_0x54ecf3(0x21c)]==='group_error')_0x62fe07[_0x54ecf3(0x343)]++;else _0xdc6723[_0x54ecf3(0x21c)]===_0x54ecf3(0x272)?_0x62fe07[_0x54ecf3(0x272)]++:_0x62fe07[_0x54ecf3(0x29a)]++;}}return _0x62fe07;}function formatStats(_0x330136){const _0x263d6d=a42_0xc57567;return[_0x263d6d(0x344)+_0x330136['total'],'✅\x20'+_0x330136[_0x263d6d(0x32b)],'❌\x20'+_0x330136[_0x263d6d(0x343)],_0x263d6d(0x245)+_0x330136['running'],'⏳\x20'+_0x330136['pending']]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']='workflow:timeline';[a42_0xc57567(0x371)]=a42_0xc57567(0x214);async[a42_0xc57567(0x2dc)](_0x3e88d7){const _0x509f8d=a42_0xc57567,{options:_0x141796,args:_0x8f2c0e,tdx:_0x21e2f4}=_0x3e88d7;let _0x554ddf,_0x13767c,_0x4acf7c=![];if(_0x8f2c0e[0x0]){if(_0x8f2c0e[0x0]['includes']('.')){const _0x56162a=this[_0x509f8d(0x323)](_0x8f2c0e,_0x141796);if(!_0x56162a)return 0x1;_0x554ddf=_0x56162a['projectName'],_0x13767c=_0x56162a[_0x509f8d(0x31e)];}else{_0x13767c=_0x8f2c0e[0x0],_0x554ddf=_0x141796[_0x509f8d(0x220)];if(!_0x554ddf)return console['error'](a42_0x28d120[_0x509f8d(0x356)](_0x509f8d(0x2c8)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x4acf7c=!![];}}else{const _0x2c8be5=this[_0x509f8d(0x323)](_0x8f2c0e,_0x141796);if(!_0x2c8be5)return 0x1;_0x554ddf=_0x2c8be5[_0x509f8d(0x2d3)],_0x13767c=_0x2c8be5[_0x509f8d(0x31e)];}if(_0x141796[_0x509f8d(0x250)]){if(_0x554ddf&&_0x13767c)console['error'](_0x509f8d(0x2ef)+_0x554ddf+'.'+_0x13767c);else _0x554ddf&&console['error']('Filter:\x20project='+_0x554ddf);}const _0x528864=_0x141796[_0x509f8d(0x270)],_0x2c1180=_0x141796[_0x509f8d(0x1f6)];if(_0x528864){_0x2c1180&&console['error'](a42_0x28d120[_0x509f8d(0x2a1)]('Warning:'),_0x509f8d(0x2e1));const _0x4501ca=_0x141796[_0x509f8d(0x242)];return _0x4501ca?await this['pollTimeline'](_0x3e88d7,_0x528864):await this[_0x509f8d(0x2b5)](_0x3e88d7,_0x528864,_0x141796),0x0;}if(_0x2c1180){const _0xedc3ca=await withSpinner('Loading\x20session...',()=>_0x21e2f4[_0x509f8d(0x2da)]['sessions']({'projectName':_0x554ddf,'workflowName':_0x13767c,'limit':0x64}),{'verbose':_0x141796[_0x509f8d(0x250)]}),_0x397413=_0xedc3ca[_0x509f8d(0x201)]['find'](_0x518a33=>_0x518a33['id']===_0x2c1180);if(!_0x397413)return console['error'](a42_0x28d120['red'](_0x509f8d(0x2c8)),_0x509f8d(0x327)+_0x2c1180),0x1;if(!_0x397413['lastAttempt']?.['id'])return console['error'](a42_0x28d120[_0x509f8d(0x356)](_0x509f8d(0x2c8)),_0x509f8d(0x27f)+_0x2c1180+'\x20has\x20no\x20attempts'),0x1;const _0x4617a5=_0x397413['lastAttempt']['id'];_0x141796[_0x509f8d(0x250)]&&console[_0x509f8d(0x343)](_0x509f8d(0x256)+_0x4617a5+_0x509f8d(0x1f8)+_0x2c1180);const _0x303242=_0x141796[_0x509f8d(0x242)];return _0x303242?await this['pollTimeline'](_0x3e88d7,_0x4617a5):await this[_0x509f8d(0x2b5)](_0x3e88d7,_0x4617a5,_0x141796),0x0;}const _0x3a1777=await withSpinner(_0x509f8d(0x259),()=>_0x21e2f4[_0x509f8d(0x2da)][_0x509f8d(0x2d4)]({'projectName':_0x554ddf,'workflowName':_0x13767c,'limit':_0x141796[_0x509f8d(0x22d)]||0x32}),{'verbose':_0x141796[_0x509f8d(0x250)]}),_0x51456d=_0x3a1777[_0x509f8d(0x201)];if(_0x51456d[_0x509f8d(0x22b)]===0x0){if(_0x554ddf&&_0x13767c)console['error'](_0x509f8d(0x269)+_0x554ddf+'.'+_0x13767c);else _0x554ddf?console[_0x509f8d(0x343)](_0x509f8d(0x32a)+_0x554ddf):(console[_0x509f8d(0x343)](_0x509f8d(0x2f5)),console[_0x509f8d(0x343)](a42_0x28d120['dim'](_0x509f8d(0x38d))));return 0x0;}_0x51456d['sort']((_0x4b3906,_0x592228)=>{const _0x4ab3ba=_0x509f8d,_0x1b934e=_0x4b3906['sessionTime']||'',_0x10c28c=_0x592228[_0x4ab3ba(0x24f)]||'';return _0x10c28c[_0x4ab3ba(0x2f1)](_0x1b934e);});if(_0x141796['json']||_0x141796[_0x509f8d(0x39a)])return await handleSDKOutput(_0x51456d,_0x141796),0x0;let _0x3d1e49;if(_0x4acf7c){const _0x10ff7d=_0x51456d[0x0];if(!_0x10ff7d[_0x509f8d(0x2a9)]?.['id'])return console[_0x509f8d(0x343)](_0x509f8d(0x378)),0x0;_0x3d1e49=_0x10ff7d[_0x509f8d(0x2a9)]['id'],_0x141796[_0x509f8d(0x250)]&&console[_0x509f8d(0x343)](_0x509f8d(0x25c)+_0x10ff7d[_0x509f8d(0x24f)]);}else{const _0x449043=_0x51456d[_0x509f8d(0x27a)](_0xf32003=>{const _0x414d71=_0x509f8d,_0xb893af=getAttemptStatusDisplay(_0xf32003[_0x414d71(0x2a9)]);return{'title':_0xf32003[_0x414d71(0x296)]?.[_0x414d71(0x331)]+'.'+_0xf32003[_0x414d71(0x2da)]?.[_0x414d71(0x331)]+_0x414d71(0x379)+_0xf32003[_0x414d71(0x24f)]+'\x20'+_0xb893af[_0x414d71(0x24c)],'value':_0xf32003[_0x414d71(0x2a9)]?.['id']||'','description':_0xb893af[_0x414d71(0x1f5)]};}),_0x345a7b=await a42_0x4fae({'type':_0x509f8d(0x2ff),'name':_0x509f8d(0x270),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x449043[_0x509f8d(0x36b)](_0x4a446e=>_0x4a446e['value']!=='')});if(!_0x345a7b['attemptId'])return 0x0;_0x3d1e49=_0x345a7b[_0x509f8d(0x270)];}const _0x8e5725=_0x141796[_0x509f8d(0x242)];return _0x8e5725?await this[_0x509f8d(0x2cd)](_0x3e88d7,_0x3d1e49):await this['renderSingleTimeline'](_0x3e88d7,_0x3d1e49,_0x141796),0x0;}async[a42_0xc57567(0x2b5)](_0x3660e9,_0x49d0c,_0xcb2d63){const _0x31ab6a=a42_0xc57567,{tdx:_0x401bf7}=_0x3660e9;let _0x112719,_0x473061;try{[_0x112719,_0x473061]=await Promise[_0x31ab6a(0x308)]([_0x401bf7[_0x31ab6a(0x2da)]['attempt'](_0x49d0c),_0x401bf7[_0x31ab6a(0x2da)][_0x31ab6a(0x332)](_0x49d0c,![])]);}catch(_0x5ddd77){console['error'](a42_0x28d120[_0x31ab6a(0x356)](_0x31ab6a(0x2a2)));_0xcb2d63[_0x31ab6a(0x250)]&&console[_0x31ab6a(0x343)](_0x5ddd77);throw _0x5ddd77;}if(_0xcb2d63[_0x31ab6a(0x1fc)]||_0xcb2d63[_0x31ab6a(0x39a)]){const _0xd45372=this['buildTimelineData'](_0x112719,_0x473061);await handleSDKOutput([_0xd45372],_0xcb2d63);return;}const _0x564efd=_0x401bf7[_0x31ab6a(0x2cc)][_0x31ab6a(0x31d)],_0x135820=this['renderTimeline'](_0x112719,_0x473061,_0x564efd);console['log'](_0x135820);}async['pollTimeline'](_0x3283c0,_0x174071){const _0x3b1f65=a42_0xc57567,{tdx:_0x244cf4}=_0x3283c0,_0x4e68ad=TIMELINE_CONFIG[_0x3b1f65(0x2f4)],_0x4a4c86=TIMELINE_CONFIG[_0x3b1f65(0x223)];let _0x174704=0x0;while(_0x174704<_0x4a4c86){process['stdout'][_0x3b1f65(0x24d)]&&process[_0x3b1f65(0x297)][_0x3b1f65(0x268)]('\x1bc');let _0x1ee991,_0x36cf6e;try{[_0x1ee991,_0x36cf6e]=await Promise[_0x3b1f65(0x308)]([_0x244cf4[_0x3b1f65(0x2da)][_0x3b1f65(0x320)](_0x174071),_0x244cf4['workflow'][_0x3b1f65(0x332)](_0x174071,![])]);}catch(_0x3b1bb0){console['error'](a42_0x28d120[_0x3b1f65(0x356)](_0x3b1f65(0x30b)));_0x174704>0x0&&console[_0x3b1f65(0x343)](a42_0x28d120['dim'](_0x3b1f65(0x35e)+_0x174704));throw _0x3b1bb0;}const _0x38e3bd=_0x244cf4[_0x3b1f65(0x2cc)]['site'],_0x4cfd73=this[_0x3b1f65(0x263)](_0x1ee991,_0x36cf6e,_0x38e3bd);console[_0x3b1f65(0x385)](_0x4cfd73);const _0x1bfa96=_0x1ee991[_0x3b1f65(0x21e)]&&_0x36cf6e['every'](_0xa9b058=>_0xa9b058[_0x3b1f65(0x21c)]!==_0x3b1f65(0x272)&&_0xa9b058[_0x3b1f65(0x21c)]!==_0x3b1f65(0x26f));if(_0x1bfa96){console[_0x3b1f65(0x343)](a42_0x28d120[_0x3b1f65(0x382)](_0x3b1f65(0x33f)));break;}console[_0x3b1f65(0x343)](a42_0x28d120['dim'](_0x3b1f65(0x2b6)+_0x174704*0x2+_0x3b1f65(0x26a))),await new Promise(_0x401853=>setTimeout(_0x401853,_0x4e68ad)),_0x174704++;}_0x174704>=_0x4a4c86&&console['error'](a42_0x28d120[_0x3b1f65(0x2a1)](_0x3b1f65(0x367)));}['renderTimeline'](_0x5e3b8f,_0x413423,_0x89d09f){const _0x2f4df7=a42_0xc57567,_0x118eae=[],_0x3b01aa=TIMELINE_CONFIG[_0x2f4df7(0x2d0)],_0x7333b6=0x5,_0xe394f0=process[_0x2f4df7(0x297)][_0x2f4df7(0x350)]||0x78,_0x486a08=_0xe394f0-_0x3b01aa-_0x7333b6,_0x66b25d=Math[_0x2f4df7(0x30f)](TIMELINE_CONFIG[_0x2f4df7(0x365)],Math[_0x2f4df7(0x232)](_0x486a08,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x162c1e=new Date(_0x5e3b8f[_0x2f4df7(0x2ac)])[_0x2f4df7(0x2e8)](),_0x16e11e=_0x5e3b8f[_0x2f4df7(0x23f)]?new Date(_0x5e3b8f[_0x2f4df7(0x23f)])['getTime']():Date[_0x2f4df7(0x2c1)](),_0x410ed9={'start':_0x162c1e,'end':_0x16e11e,'duration':_0x16e11e-_0x162c1e},_0x4e67cc=new Map(),_0x1f06f3=[];for(const _0x485045 of _0x413423){if(_0x485045[_0x2f4df7(0x28e)]){const _0x3a2869=new Date(_0x485045[_0x2f4df7(0x28e)])['getTime'](),_0xc1eedd=_0x485045['updatedAt']?new Date(_0x485045[_0x2f4df7(0x34c)])[_0x2f4df7(0x2e8)]():Date[_0x2f4df7(0x2c1)](),_0x190fcc={'start':_0x3a2869,'end':_0xc1eedd,'duration':_0xc1eedd-_0x3a2869};_0x4e67cc[_0x2f4df7(0x25a)](_0x485045['id'],_0x190fcc),_0x1f06f3[_0x2f4df7(0x2c5)]({'name':_0x485045[_0x2f4df7(0x369)],'state':_0x485045[_0x2f4df7(0x21c)]||'unknown','window':_0x190fcc});}else _0x1f06f3['push']({'name':_0x485045[_0x2f4df7(0x369)],'state':_0x485045[_0x2f4df7(0x21c)]||_0x2f4df7(0x26f),'window':undefined});}_0x1f06f3[_0x2f4df7(0x208)]((_0x46241a,_0x5972f6)=>{const _0x565dd7=_0x2f4df7;if(!_0x46241a[_0x565dd7(0x215)])return 0x1;if(!_0x5972f6['window'])return-0x1;return _0x46241a[_0x565dd7(0x215)][_0x565dd7(0x37e)]-_0x5972f6['window'][_0x565dd7(0x37e)];});const _0x13bc23=_0x1f06f3[_0x2f4df7(0x22b)],_0x2b7fb5=_0x13bc23>TIMELINE_CONFIG[_0x2f4df7(0x210)];_0x2b7fb5&&_0x1f06f3[_0x2f4df7(0x340)](TIMELINE_CONFIG[_0x2f4df7(0x210)]);const _0x55da35=calculateTimeScale(_0x410ed9,_0x66b25d),_0x3c8994=_0x5e3b8f[_0x2f4df7(0x21e)]?_0x5e3b8f[_0x2f4df7(0x32b)]?a42_0x28d120[_0x2f4df7(0x382)](_0x2f4df7(0x32b)):a42_0x28d120['red'](_0x2f4df7(0x343)):a42_0x28d120['blue'](_0x2f4df7(0x272)),_0x36c250=_0x5e3b8f['project']?.['id'],_0x2c338a=_0x5e3b8f[_0x2f4df7(0x1f6)];let _0x3e46b3;if(_0x36c250&&_0x2c338a){const _0x2e408e=getWorkflowAttemptUrl(_0x89d09f,_0x36c250,_0x2c338a,_0x5e3b8f['id']);_0x3e46b3=hyperlink(a42_0x28d120[_0x2f4df7(0x307)](_0x5e3b8f['id']),_0x2e408e);}else _0x3e46b3=a42_0x28d120[_0x2f4df7(0x307)](_0x5e3b8f['id']);_0x118eae[_0x2f4df7(0x2c5)](_0x2f4df7(0x204)+_0x3e46b3+'\x20-\x20'+_0x3c8994+_0x2f4df7(0x379)+formatElapsed(_0x410ed9[_0x2f4df7(0x2f8)]));if(_0x1f06f3['length']>0x0){const _0x2be27f=renderTimeAxis(_0x55da35,_0x66b25d),_0x4eb712=new Date(_0x410ed9[_0x2f4df7(0x37e)]),_0x21f8c2=formatDate(_0x4eb712),_0x2f0bdd=TIMELINE_CONFIG[_0x2f4df7(0x360)]+TIMELINE_CONFIG[_0x2f4df7(0x27e)]+_0x3b01aa,_0x1da3dc=_0x21f8c2['padStart'](_0x2f0bdd),_0x2a79f6=a42_0x28d120[_0x2f4df7(0x307)](_0x1da3dc);_0x118eae[_0x2f4df7(0x2c5)](_0x2a79f6+'\x20'+_0x2be27f);for(const _0x4bdc58 of _0x1f06f3){_0x118eae['push'](renderTaskRow(_0x4bdc58,_0x55da35,_0x66b25d,_0x3b01aa));}const _0x49c635=calculateStats(_0x1f06f3);_0x118eae[_0x2f4df7(0x2c5)](formatStats(_0x49c635)),_0x2b7fb5&&_0x118eae['push'](a42_0x28d120[_0x2f4df7(0x2a1)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0x2f4df7(0x210)]+'\x20of\x20'+_0x13bc23+'\x20tasks')),_0x118eae[_0x2f4df7(0x2c5)](''),_0x118eae[_0x2f4df7(0x2c5)](a42_0x28d120[_0x2f4df7(0x307)](_0x2f4df7(0x20a))+('tdx\x20wf\x20attempt\x20'+_0x5e3b8f['id']+_0x2f4df7(0x31c))+a42_0x28d120['dim'](_0x2f4df7(0x326)));}else _0x118eae[_0x2f4df7(0x2c5)](_0x2f4df7(0x264));return _0x118eae[_0x2f4df7(0x238)]('\x0a');}[a42_0xc57567(0x203)](_0x55ef5b,_0x2e4833){const _0x52b31d=a42_0xc57567,_0x5e5654=new Date(_0x55ef5b[_0x52b31d(0x2ac)])[_0x52b31d(0x2e8)](),_0x1fcc3d=_0x55ef5b[_0x52b31d(0x23f)]?new Date(_0x55ef5b[_0x52b31d(0x23f)])[_0x52b31d(0x2e8)]():Date[_0x52b31d(0x2c1)](),_0x641b80=_0x1fcc3d-_0x5e5654,_0x449c8d=[];for(const _0x1e97e2 of _0x2e4833){if(_0x1e97e2[_0x52b31d(0x28e)]){const _0x3f1e73=new Date(_0x1e97e2['startedAt'])[_0x52b31d(0x2e8)](),_0xcddebc=_0x1e97e2[_0x52b31d(0x34c)]?new Date(_0x1e97e2[_0x52b31d(0x34c)])[_0x52b31d(0x2e8)]():Date[_0x52b31d(0x2c1)]();_0x449c8d[_0x52b31d(0x2c5)]({'name':_0x1e97e2[_0x52b31d(0x369)],'state':_0x1e97e2['state']||_0x52b31d(0x231),'window':{'start':_0x3f1e73,'end':_0xcddebc,'duration':_0xcddebc-_0x3f1e73}});}else _0x449c8d[_0x52b31d(0x2c5)]({'name':_0x1e97e2[_0x52b31d(0x369)],'state':_0x1e97e2[_0x52b31d(0x21c)]||_0x52b31d(0x26f),'window':undefined});}const _0x4d2437=calculateStats(_0x449c8d);return{'attempt':{'id':_0x55ef5b['id'],'status':_0x55ef5b['done']?_0x55ef5b[_0x52b31d(0x32b)]?_0x52b31d(0x32b):_0x52b31d(0x343):_0x52b31d(0x272),'createdAt':_0x55ef5b[_0x52b31d(0x2ac)],'finishedAt':_0x55ef5b[_0x52b31d(0x23f)],'duration_ms':_0x641b80},'tasks':_0x449c8d[_0x52b31d(0x27a)](_0x1fa5ab=>({'name':_0x1fa5ab[_0x52b31d(0x331)],'state':_0x1fa5ab[_0x52b31d(0x21c)],'startedAt':_0x1fa5ab[_0x52b31d(0x215)]?new Date(_0x1fa5ab[_0x52b31d(0x215)]['start'])[_0x52b31d(0x28c)]():null,'updatedAt':_0x1fa5ab[_0x52b31d(0x215)]?new Date(_0x1fa5ab[_0x52b31d(0x215)][_0x52b31d(0x34b)])[_0x52b31d(0x28c)]():null,'duration_ms':_0x1fa5ab[_0x52b31d(0x215)]?.[_0x52b31d(0x2f8)]||null})),'stats':_0x4d2437};}}
|
|
1
|
+
const a42_0x8f79a1=a42_0x47ab;(function(_0x125f50,_0x153dba){const _0x21e125=a42_0x47ab,_0x3892b=_0x125f50();while(!![]){try{const _0x212607=-parseInt(_0x21e125(0xb8))/0x1+-parseInt(_0x21e125(0x108))/0x2*(parseInt(_0x21e125(0x150))/0x3)+-parseInt(_0x21e125(0x14d))/0x4+-parseInt(_0x21e125(0x1e5))/0x5*(-parseInt(_0x21e125(0x1b1))/0x6)+-parseInt(_0x21e125(0xbb))/0x7+-parseInt(_0x21e125(0x1ec))/0x8*(parseInt(_0x21e125(0x141))/0x9)+parseInt(_0x21e125(0x146))/0xa;if(_0x212607===_0x153dba)break;else _0x3892b['push'](_0x3892b['shift']());}catch(_0x44c1df){_0x3892b['push'](_0x3892b['shift']());}}}(a42_0x44e3,0xcf6c5));import a42_0x18b51d from'chalk';import{existsSync}from'fs';import a42_0x2f6ec0 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a42_0x3b7933 from'prompts';function getAttemptStatusDisplay(_0x57830e){const _0xcf1430=a42_0x47ab;if(!_0x57830e)return{'icon':'⏳','text':''};const {done:_0x371836,success:_0x49bcdb,cancelRequested:_0x2ff7d4}=_0x57830e;if(!_0x371836)return _0x2ff7d4?{'icon':'🛑','text':a42_0x18b51d[_0xcf1430(0x128)](_0xcf1430(0x136))}:{'icon':'🔄','text':a42_0x18b51d[_0xcf1430(0xa2)](_0xcf1430(0xcb))};if(_0x49bcdb)return{'icon':'✅','text':a42_0x18b51d[_0xcf1430(0x126)](_0xcf1430(0x207))};return{'icon':'❌','text':a42_0x18b51d[_0xcf1430(0xdf)](_0xcf1430(0x144))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x486d68,_0x2d8667,_0x20cb72=0x0){const _0x2b7d51=a42_0x47ab;return _0x486d68[_0x20cb72]||_0x2d8667[_0x2b7d51(0x20f)];}['requireProject'](_0x30449d,_0x223781,_0x1fe0c0=0x0){const _0x5daac8=a42_0x47ab,_0x23664a=this['resolveProject'](_0x30449d,_0x223781,_0x1fe0c0);if(!_0x23664a)return console[_0x5daac8(0x144)](a42_0x18b51d[_0x5daac8(0xdf)](_0x5daac8(0xa8)),_0x5daac8(0x190)),console['error'](a42_0x18b51d['dim'](_0x5daac8(0x19a))),null;return _0x23664a;}[a42_0x8f79a1(0x74)](_0xa0d8a7,_0x3af3e5){const _0x4ced78=a42_0x8f79a1;if(_0xa0d8a7[0x0]){const _0x11bb17=_0xa0d8a7[0x0][_0x4ced78(0x13e)]('.');if(_0x11bb17[_0x4ced78(0x182)]===0x1)return{'projectName':_0x11bb17[0x0],'workflowName':undefined};else return _0x11bb17[_0x4ced78(0x182)]===0x2?{'projectName':_0x11bb17[0x0],'workflowName':_0x11bb17[0x1]}:(console['error'](a42_0x18b51d[_0x4ced78(0xdf)]('Error:'),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x3af3e5['workflowProject'],'workflowName':undefined};}[a42_0x8f79a1(0x8e)](_0x1ce36b,_0x3a9b2,_0x4cb1ea=0x0){const _0x2f5f35=a42_0x8f79a1;if(_0x1ce36b[_0x4cb1ea])return _0x1ce36b[_0x4cb1ea];if(_0x3a9b2[_0x2f5f35(0x20f)]){const _0x45089e=a42_0x2f6ec0['join'](process['cwd'](),_0x2f5f35(0x1be),_0x3a9b2[_0x2f5f35(0x20f)]);if(existsSync(a42_0x2f6ec0[_0x2f5f35(0x204)](_0x45089e,_0x2f5f35(0xd8))))return _0x45089e;}return undefined;}async['showWorkflowConsoleUrl'](_0x2d0d04,_0x5bbca4,_0x5027a6){const _0x332c9b=a42_0x8f79a1;try{const _0x3ffa5d=await _0x2d0d04[_0x332c9b(0x21f)][_0x332c9b(0x1be)](_0x5bbca4,{'limit':0x1});if(_0x3ffa5d[_0x332c9b(0x182)]>0x0){const _0x210444=_0x3ffa5d[0x0]['id'],_0x3a3b3f=getWorkflowUrl(_0x5027a6,_0x210444);console[_0x332c9b(0x144)](_0x332c9b(0x12c)+a42_0x18b51d[_0x332c9b(0x1f3)](_0x3a3b3f));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a42_0x8f79a1(0x199)]=a42_0x8f79a1(0x9e);[a42_0x8f79a1(0x15e)]='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async[a42_0x8f79a1(0xa4)](_0x18dc43){const _0x586f01=a42_0x8f79a1,{options:_0x33dcaa,args:_0x55f189,tdx:_0x3d186c}=_0x18dc43,_0x41e5bd=_0x55f189[0x0],_0x41e74d=_0x33dcaa['clear'];if(_0x41e74d)return saveSessionContext({'workflow_project':undefined},_0x33dcaa[_0x586f01(0x214)]),console[_0x586f01(0x7b)](a42_0x18b51d[_0x586f01(0x126)](_0x586f01(0x84))),0x0;if(!_0x41e5bd)return console[_0x586f01(0x144)](a42_0x18b51d[_0x586f01(0xdf)](_0x586f01(0xa8)),_0x586f01(0x190)),console[_0x586f01(0x144)](a42_0x18b51d[_0x586f01(0xf3)](_0x586f01(0x12b))),console[_0x586f01(0x144)](a42_0x18b51d[_0x586f01(0xf3)](_0x586f01(0x92))),0x1;const _0x3bfdd5=await withSpinner('Resolving\x20project\x20\x27'+_0x41e5bd+_0x586f01(0xc1),()=>_0x3d186c[_0x586f01(0x21f)][_0x586f01(0x1e8)](_0x41e5bd),{'verbose':_0x33dcaa['verbose']}),{name:_0x16f1ab}=_0x3bfdd5[_0x586f01(0xfd)];return saveSessionContext({'workflow_project':_0x16f1ab},_0x33dcaa[_0x586f01(0x214)]),console[_0x586f01(0x7b)](a42_0x18b51d[_0x586f01(0x126)](_0x586f01(0x1dc)+a42_0x18b51d[_0x586f01(0x1f3)](_0x16f1ab))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a42_0x8f79a1(0x1b2);[a42_0x8f79a1(0x15e)]=a42_0x8f79a1(0x17c);async[a42_0x8f79a1(0xa4)](_0x58ec81){const _0x3e0d98=a42_0x8f79a1,{options:_0x28e5c3,args:_0x19191d,tdx:_0x774e0c}=_0x58ec81,_0x880391=_0x19191d[0x0];_0x28e5c3['verbose']&&_0x880391&&console['error'](_0x3e0d98(0xb7)+_0x880391);const _0x78cb=await withSpinner(_0x3e0d98(0x154),()=>_0x774e0c[_0x3e0d98(0x21f)][_0x3e0d98(0x1d8)](_0x880391,{'limit':_0x28e5c3['limit']}),{'verbose':_0x28e5c3['verbose']});let _0x3a37be=_0x78cb[_0x3e0d98(0xfd)];_0x3a37be[_0x3e0d98(0x1ed)]((_0x1cd20b,_0x2a42de)=>_0x1cd20b['name'][_0x3e0d98(0x10f)](_0x2a42de['name']));const _0x300ccb=_0x28e5c3[_0x3e0d98(0x135)]||0x64,_0x355f57=_0x3a37be[_0x3e0d98(0x182)]>=_0x300ccb?a42_0x18b51d[_0x3e0d98(0xf3)](_0x3e0d98(0x16e)):'';console[_0x3e0d98(0x144)]('✔\x20Found\x20'+_0x3a37be['length']+_0x3e0d98(0x212)+(_0x3a37be[_0x3e0d98(0x182)]!==0x1?'s':'')+_0x355f57);if(_0x28e5c3[_0x3e0d98(0x16d)]==='json'||_0x28e5c3[_0x3e0d98(0x16d)]===_0x3e0d98(0x161)||_0x28e5c3[_0x3e0d98(0x16d)]==='table')await handleSDKOutput(_0x3a37be,_0x28e5c3);else{if(_0x3a37be[_0x3e0d98(0x182)]===0x0)_0x880391?console['log'](_0x3e0d98(0xb1)+_0x880391):console[_0x3e0d98(0x7b)](_0x3e0d98(0x15d));else{const _0x44e288=_0x3a37be[_0x3e0d98(0x17b)](_0x4584d5=>{const _0x3c6e81=_0x3e0d98,_0x5a898d=_0x4584d5['metadata']?.[_0x3c6e81(0x1ca)](_0x68b35e=>_0x68b35e[_0x3c6e81(0x1bf)]===_0x3c6e81(0x11c)),_0x2b93d5=_0x5a898d?a42_0x18b51d[_0x3c6e81(0xf3)](_0x3c6e81(0xfc)):'';return _0x3c6e81(0xe2)+_0x4584d5[_0x3c6e81(0x199)]+_0x2b93d5;});await writeOutput(_0x44e288[_0x3e0d98(0x204)]('\x0a'),_0x28e5c3[_0x3e0d98(0x1ba)],_0x3e0d98(0x83));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a42_0x8f79a1(0x199)]=a42_0x8f79a1(0x1ab);['description']=a42_0x8f79a1(0x18d);async['execute'](_0x52a570){const _0x1a17f1=a42_0x8f79a1,{options:_0x5e3b1f,args:_0xec2ab9,tdx:_0x125c34}=_0x52a570,_0x446351=this['resolveProject'](_0xec2ab9,_0x5e3b1f);_0x5e3b1f[_0x1a17f1(0xad)]&&_0x446351&&console[_0x1a17f1(0x144)](_0x1a17f1(0x16f)+_0x446351);const _0x5eb8be=await withSpinner(_0x1a17f1(0x96),()=>_0x125c34['workflow'][_0x1a17f1(0x1be)](_0x446351,{'limit':_0x5e3b1f[_0x1a17f1(0x135)]}),{'verbose':_0x5e3b1f[_0x1a17f1(0xad)]});let _0x5a0b18=_0x5eb8be[_0x1a17f1(0xfd)];_0x5a0b18['sort']((_0x379cfa,_0x3015fa)=>{const _0x1e7a14=_0x1a17f1,_0x443bfa=_0x379cfa[_0x1e7a14(0x199)]['localeCompare'](_0x3015fa[_0x1e7a14(0x199)]);if(_0x443bfa!==0x0)return _0x443bfa;return(_0x379cfa['project']?.['name']||'')[_0x1e7a14(0x10f)](_0x3015fa[_0x1e7a14(0x1c0)]?.[_0x1e7a14(0x199)]||'');});const _0x3fed38=_0x5e3b1f['limit']||0x64,_0x1a6578=_0x5a0b18[_0x1a17f1(0x182)]>=_0x3fed38?a42_0x18b51d['dim'](_0x1a17f1(0x16e)):'';console['error']('✔\x20Found\x20'+_0x5a0b18[_0x1a17f1(0x182)]+_0x1a17f1(0x133)+(_0x5a0b18[_0x1a17f1(0x182)]!==0x1?'s':'')+_0x1a6578);if(_0x5e3b1f[_0x1a17f1(0x16d)]===_0x1a17f1(0x203)||_0x5e3b1f[_0x1a17f1(0x16d)]===_0x1a17f1(0x161)||_0x5e3b1f['format']===_0x1a17f1(0x8b))await handleSDKOutput(_0x5a0b18,_0x5e3b1f);else{if(_0x5a0b18['length']===0x0)_0x446351?console[_0x1a17f1(0x7b)](_0x1a17f1(0xe9)+_0x446351):console[_0x1a17f1(0x7b)](_0x1a17f1(0x99));else{const _0x378d86=_0x5e3b1f[_0x1a17f1(0xe8)],_0x414795=_0x5a0b18[_0x1a17f1(0x17b)](_0x51b638=>{const _0x436c96=_0x1a17f1,_0x44cd8d=a42_0x18b51d[_0x436c96(0xf3)]('#'+_0x51b638['id']),_0x44d188=hyperlink(_0x44cd8d,getWorkflowUrl(_0x378d86,_0x51b638['id'])),_0x6cf0c3=_0x51b638[_0x436c96(0x1c0)]?.[_0x436c96(0x199)]?a42_0x18b51d[_0x436c96(0xf3)]('\x20('+_0x51b638['project'][_0x436c96(0x199)]+')'):'';return _0x436c96(0x178)+_0x44d188+'\x20'+_0x51b638[_0x436c96(0x199)]+_0x6cf0c3;});await writeOutput(_0x414795[_0x1a17f1(0x204)]('\x0a'),_0x5e3b1f['output'],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']='workflow:sessions';[a42_0x8f79a1(0x15e)]=a42_0x8f79a1(0x201);async[a42_0x8f79a1(0xa4)](_0x1b41fb){const _0x473b88=a42_0x8f79a1,{options:_0x5698ad,args:_0x5664ce,tdx:_0x37dbb7}=_0x1b41fb,_0x244ff2=this[_0x473b88(0x74)](_0x5664ce,_0x5698ad);if(!_0x244ff2)return 0x1;const {projectName:_0x204b55,workflowName:_0x5bc659}=_0x244ff2;if(_0x5698ad[_0x473b88(0xad)]){if(_0x204b55&&_0x5bc659)console[_0x473b88(0x144)](_0x473b88(0x117)+_0x204b55+'.'+_0x5bc659);else _0x204b55&&console[_0x473b88(0x144)](_0x473b88(0x220)+_0x204b55);const _0x3a5805=_0x5698ad[_0x473b88(0x149)];_0x3a5805&&console[_0x473b88(0x144)]('Status:\x20'+_0x3a5805);}let _0x408f3a=0x28;if(process[_0x473b88(0x1f1)][_0x473b88(0x1bd)]&&!_0x5698ad['output']&&!_0x5698ad[_0x473b88(0x16d)]){const _0x23323f=process['stdout'][_0x473b88(0xd3)]||0x28;_0x408f3a=Math[_0x473b88(0x148)](0x14,Math['floor'](_0x23323f*0x2/0x3));}const _0x3dfcd0=_0x5698ad[_0x473b88(0x135)]||_0x408f3a,_0x171e08=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x37dbb7['workflow'][_0x473b88(0xdd)]({'projectName':_0x204b55,'workflowName':_0x5bc659,'status':_0x5698ad[_0x473b88(0x149)],'fromTime':_0x5698ad[_0x473b88(0x169)],'toTime':_0x5698ad['to'],'limit':_0x3dfcd0}),{'verbose':_0x5698ad[_0x473b88(0xad)]}),_0x3d0eba=_0x171e08['data'];_0x3d0eba[_0x473b88(0x1ed)]((_0x42bbc9,_0x58b5de)=>{const _0x3defe8=_0x473b88,_0x52c929=_0x42bbc9[_0x3defe8(0xcc)]||'',_0x548835=_0x58b5de['sessionTime']||'';return _0x548835[_0x3defe8(0x10f)](_0x52c929);});_0x3d0eba[_0x473b88(0x182)]>=_0x3dfcd0?console[_0x473b88(0x144)](_0x473b88(0x159)+_0x3d0eba[_0x473b88(0x182)]+_0x473b88(0x1db)+a42_0x18b51d['dim'](_0x473b88(0x1ad))):console['error'](_0x473b88(0x158)+_0x3d0eba[_0x473b88(0x182)]+_0x473b88(0x77)+(_0x3d0eba[_0x473b88(0x182)]!==0x1?'s':''));if(_0x5698ad['format']===_0x473b88(0x203)||_0x5698ad[_0x473b88(0x16d)]===_0x473b88(0x161)||_0x5698ad[_0x473b88(0x16d)]===_0x473b88(0x8b))await handleSDKOutput(_0x3d0eba,_0x5698ad);else{if(!process[_0x473b88(0x1f1)][_0x473b88(0x1bd)]||_0x5698ad[_0x473b88(0x1ba)]){if(_0x3d0eba[_0x473b88(0x182)]===0x0){if(_0x204b55&&_0x5bc659)console[_0x473b88(0x7b)](_0x473b88(0x1a3)+_0x204b55+'.'+_0x5bc659);else _0x204b55?console[_0x473b88(0x7b)](_0x473b88(0x1b0)+_0x204b55):console[_0x473b88(0x7b)](_0x473b88(0x1e7));}else{const _0x39fedb=_0x5698ad[_0x473b88(0xe8)],_0x4393f6=this[_0x473b88(0x131)](_0x3d0eba,_0x39fedb);_0x5698ad[_0x473b88(0x1ba)]?await writeOutput(_0x4393f6,_0x5698ad[_0x473b88(0x1ba)],_0x473b88(0x83)):console[_0x473b88(0x7b)](_0x4393f6);}!_0x204b55&&(console['error'](''),console['error'](a42_0x18b51d[_0x473b88(0xf3)](_0x473b88(0x73))),console[_0x473b88(0x144)](a42_0x18b51d[_0x473b88(0xf3)](_0x473b88(0x12e))+'or'+a42_0x18b51d[_0x473b88(0xf3)](_0x473b88(0x1fb))));}else{if(_0x3d0eba[_0x473b88(0x182)]===0x0){if(_0x204b55&&_0x5bc659)console['log']('No\x20sessions\x20found\x20for:\x20'+_0x204b55+'.'+_0x5bc659);else _0x204b55?console[_0x473b88(0x7b)](_0x473b88(0x1b0)+_0x204b55):console[_0x473b88(0x7b)](_0x473b88(0x1e7));}else await this[_0x473b88(0x19f)](_0x3d0eba,_0x1b41fb,_0x204b55);}}return 0x0;}[a42_0x8f79a1(0x131)](_0x481193,_0x2788a1){const _0x4dd29d=a42_0x8f79a1,_0x27c2de=[],_0x5bcda2=new Map();let _0x327d9a=Infinity,_0x4d0658=-Infinity;for(const _0x2a36bf of _0x481193){if(_0x2a36bf['lastAttempt']?.[_0x4dd29d(0x168)]){const _0x465056=new Date(_0x2a36bf['lastAttempt']['createdAt'])[_0x4dd29d(0x1a4)](),_0x23842d=_0x2a36bf['lastAttempt'][_0x4dd29d(0x1b4)]?new Date(_0x2a36bf[_0x4dd29d(0x1f5)][_0x4dd29d(0x1b4)])[_0x4dd29d(0x1a4)]():Date[_0x4dd29d(0x140)](),_0x4aecb7=_0x2a36bf[_0x4dd29d(0x1c0)]?.['name']||'(unknown)';!_0x5bcda2[_0x4dd29d(0x113)](_0x4aecb7)&&_0x5bcda2[_0x4dd29d(0x1de)](_0x4aecb7,[]),_0x5bcda2[_0x4dd29d(0x1df)](_0x4aecb7)['push']({'session':_0x2a36bf,'startTime':_0x465056,'endTime':_0x23842d,'duration':_0x23842d-_0x465056}),_0x327d9a=Math[_0x4dd29d(0x21e)](_0x327d9a,_0x465056),_0x4d0658=Math[_0x4dd29d(0x148)](_0x4d0658,_0x23842d);}}if(_0x5bcda2[_0x4dd29d(0x184)]===0x0)return _0x4dd29d(0x1e4);const _0x1c3c5b=process[_0x4dd29d(0x1f1)]['columns']||0x78,_0x34faf6=0x1e,_0x180057=0x32,_0x237046=0x4,_0x39af2f=Math['min'](_0x180057,Math[_0x4dd29d(0x148)](_0x34faf6,Math[_0x4dd29d(0xc8)](_0x1c3c5b*0.3))),_0x2e0c91=_0x1c3c5b-_0x39af2f-TIMELINE_CONFIG[_0x4dd29d(0x1c5)]-0x3-_0x237046,_0x16d4fc=_0x4d0658-_0x327d9a,_0x28b004=_0x16d4fc/_0x39af2f,_0x2036ad=renderTimeAxis({'startTime':_0x327d9a,'endTime':_0x4d0658,'durationMs':_0x16d4fc,'msPerChar':_0x28b004},_0x39af2f),_0x56ed26=[];for(const _0x181967 of _0x5bcda2[_0x4dd29d(0x20e)]()){_0x56ed26[_0x4dd29d(0x9b)](..._0x181967);}_0x56ed26[_0x4dd29d(0x1ed)]((_0x50c290,_0x32d2bd)=>_0x32d2bd[_0x4dd29d(0x8d)]-_0x50c290['startTime']);const _0x3b1e6f=new Date(_0x327d9a),_0x1f57be=formatDate(_0x3b1e6f),_0x48874f=_0x237046+TIMELINE_CONFIG[_0x4dd29d(0x1ff)]+TIMELINE_CONFIG[_0x4dd29d(0x1da)]+_0x2e0c91,_0x2a7c31='\x20'[_0x4dd29d(0x11b)](_0x48874f-_0x1f57be[_0x4dd29d(0x182)]),_0x50814f=_0x2a7c31+a42_0x18b51d['dim'](_0x1f57be)+'\x20'+_0x2036ad;_0x27c2de['push'](_0x50814f);const _0x5ed3f5=0x16;let _0xeb44c6=0x0;for(const _0x53d496 of _0x56ed26){const _0x323914=_0x53d496['session'][_0x4dd29d(0x1c0)]?.[_0x4dd29d(0x199)]||'?',_0x41e58b=Math[_0x4dd29d(0x21e)](stringWidth(_0x323914),_0x5ed3f5);_0xeb44c6=Math[_0x4dd29d(0x148)](_0xeb44c6,_0x41e58b);}for(const _0xc0aa24 of _0x56ed26){const {session:_0x2aeee7,startTime:_0x47b339,endTime:_0x6f06b5,duration:_0x54317f}=_0xc0aa24,_0x33ceb2=_0x2aeee7[_0x4dd29d(0x1c0)]?.['id'],_0x50b42e=_0x2aeee7['id'],_0x5c6c15=_0x2aeee7[_0x4dd29d(0x1c0)]?.[_0x4dd29d(0x199)]||'?',_0x2d8b27=_0x2aeee7[_0x4dd29d(0x21f)]?.[_0x4dd29d(0x199)]||'?';let _0x3daad5,_0x6d8652;if(_0x2aeee7[_0x4dd29d(0x1f5)]){const _0x187876=_0x2aeee7[_0x4dd29d(0x1f5)];!_0x187876[_0x4dd29d(0x13d)]?(_0x3daad5=_0x187876['cancelRequested']?'🛑':'🔄',_0x6d8652=_0x187876[_0x4dd29d(0x17f)]?a42_0x18b51d[_0x4dd29d(0x128)]:a42_0x18b51d[_0x4dd29d(0xa2)]):(_0x3daad5=_0x187876[_0x4dd29d(0x207)]?'✅':'❌',_0x6d8652=_0x187876['success']?a42_0x18b51d['green']:a42_0x18b51d['red']);}else _0x3daad5='⏳',_0x6d8652=a42_0x18b51d[_0x4dd29d(0xf3)];const _0x567f6c='#'+_0x50b42e,_0x465c36=_0x33ceb2?hyperlink(_0x567f6c,getWorkflowSessionUrl(_0x2788a1,_0x33ceb2,_0x50b42e)):_0x567f6c;let _0x29181e=_0x5c6c15;stringWidth(_0x5c6c15)>_0x5ed3f5&&(_0x29181e=_0x5c6c15[_0x4dd29d(0x12f)](0x0,_0x5ed3f5-0x1)+'…');const _0x3ca62f=a42_0x18b51d['dim'](_0x29181e),_0x5c0bb2=stringWidth(_0x29181e),_0x2d4e06='\x20'[_0x4dd29d(0x11b)](_0xeb44c6-stringWidth(_0x29181e)+0x2),_0xfec280='('+formatElapsed(_0x54317f)+')',_0x4f8a22=stringWidth(_0xfec280),_0x3cee97=stringWidth(_0x567f6c),_0x3849aa=_0x3cee97+0x1+_0x5c0bb2+_0x2d4e06[_0x4dd29d(0x182)],_0x189224=_0x2e0c91-_0x3849aa-_0x4f8a22-0x1-0x8;let _0x341b52=_0x2d8b27;stringWidth(_0x341b52)>_0x189224&&(_0x341b52=_0x341b52['slice'](0x0,_0x189224-0x1)+'…');const _0x4d7ade=_0x465c36+'\x20'+_0x3ca62f+_0x2d4e06+_0x341b52,_0xb814d3=stringWidth(_0x4d7ade),_0x5ed905=_0x2e0c91-_0xb814d3-_0x4f8a22,_0x3dc656=_0x4d7ade+'\x20'[_0x4dd29d(0x11b)](Math[_0x4dd29d(0x148)](0x1,_0x5ed905))+a42_0x18b51d[_0x4dd29d(0xf3)](_0xfec280),_0x3692ee=Math['floor']((_0x47b339-_0x327d9a)/_0x28b004),_0x1c6865=Math[_0x4dd29d(0xc8)]((_0x6f06b5-_0x327d9a)/_0x28b004),_0x23364b=Math[_0x4dd29d(0x148)](_0x3692ee+0x1,_0x1c6865),_0x14cc96=new Array(_0x39af2f)[_0x4dd29d(0xcf)]('\x20');for(let _0x51bd7f=_0x3692ee;_0x51bd7f<Math[_0x4dd29d(0x21e)](_0x23364b,_0x39af2f);_0x51bd7f++){_0x14cc96[_0x51bd7f]='─';}const _0x2622d4=_0x14cc96[_0x4dd29d(0x17b)](_0x2bf4e6=>_0x2bf4e6==='\x20'?'\x20':_0x6d8652(_0x2bf4e6))['join']('');_0x27c2de[_0x4dd29d(0x9b)](_0x3daad5+'\x20'+_0x3dc656+'│'+_0x2622d4+'│');}return _0x27c2de[_0x4dd29d(0x204)]('\x0a');}async['navigateSessionsInteractive'](_0x4487a7,_0x384c5e,_0x3f498){const _0x5c8d16=a42_0x8f79a1,{options:_0x2d8c23,tdx:_0x460bab}=_0x384c5e,_0x12732a=_0x2d8c23[_0x5c8d16(0xe8)],{timelineRows:_0x5bec16,timeAxisHeader:_0x560bdd}=this[_0x5c8d16(0xd5)](_0x4487a7,_0x12732a),_0x4b0a2c=_0x5bec16[_0x5c8d16(0xd7)](_0x14f0d0=>_0x14f0d0[_0x5c8d16(0x15c)]);if(_0x4b0a2c[_0x5c8d16(0x182)]===0x0){const _0x2d8df2=this[_0x5c8d16(0x131)](_0x4487a7,_0x12732a);console[_0x5c8d16(0x7b)](_0x2d8df2);!_0x3f498&&(console[_0x5c8d16(0x144)](''),console[_0x5c8d16(0x144)](a42_0x18b51d[_0x5c8d16(0xf3)](_0x5c8d16(0x73))),console[_0x5c8d16(0x144)](a42_0x18b51d['dim'](_0x5c8d16(0x12e))+'or'+a42_0x18b51d['dim'](_0x5c8d16(0x1fb))));return;}_0x560bdd&&console[_0x5c8d16(0x7b)](_0x560bdd);const _0x440399=_0x5bec16[_0x5c8d16(0xd7)](_0x17c0d8=>_0x17c0d8[_0x5c8d16(0x15c)])['map'](_0x401331=>({'title':_0x401331[_0x5c8d16(0x157)],'value':_0x401331[_0x5c8d16(0x15c)]})),_0xc337df=process['stdout']['rows']||0x3c,_0x298440=Math[_0x5c8d16(0x148)](0x28,Math['floor'](_0xc337df*0x2/0x3)),_0x194f8a=await a42_0x3b7933({'type':_0x5c8d16(0x1fd),'name':'attemptId','message':_0x5c8d16(0xd4),'choices':_0x440399,'initial':-0x1,'limit':_0x298440,'clearFirst':!![],'fallback':{'title':_0x5c8d16(0x14e),'value':null},'suggest':(_0x3a5a35,_0x152339)=>{const _0xad61b3=_0x5c8d16;if(!_0x3a5a35)return Promise[_0xad61b3(0x122)](_0x152339);const _0x2503a0=_0x152339['filter'](_0x32e79f=>{const _0x4b1e4b=_0xad61b3,_0x343903=_0x32e79f;return _0x343903[_0x4b1e4b(0xba)][_0x4b1e4b(0x103)]()[_0x4b1e4b(0x10e)](_0x3a5a35[_0x4b1e4b(0x103)]());});return Promise['resolve'](_0x2503a0);}}),_0x59f7d5=()=>{const _0x4f019e=_0x5c8d16;process['stdout'][_0x4f019e(0x1c2)](_0x4f019e(0x1ae)),process['stdout']['write'](_0x4f019e(0x1ae)),process[_0x4f019e(0x1f1)]['write'](_0x4f019e(0x1ae));},_0x19635a=_0x194f8a&&_0x194f8a[_0x5c8d16(0x15c)]&&_0x194f8a[_0x5c8d16(0x15c)]!==null&&_0x194f8a['attemptId'][_0x5c8d16(0x1f4)]()!=='';if(!_0x19635a){_0x59f7d5(),console[_0x5c8d16(0x7b)](a42_0x18b51d[_0x5c8d16(0xf3)](_0x5c8d16(0x20b)));return;}_0x59f7d5();const _0x477777=_0x4487a7['find'](_0x197c86=>_0x197c86[_0x5c8d16(0x1f5)]?.['id']===_0x194f8a[_0x5c8d16(0x15c)]);if(_0x477777){const _0xaf2995=_0x477777[_0x5c8d16(0x1c0)]?.['name']||'?',_0x67080d=_0x477777[_0x5c8d16(0x21f)]?.[_0x5c8d16(0x199)]||'?';console[_0x5c8d16(0x7b)](_0x5c8d16(0x197)+a42_0x18b51d[_0x5c8d16(0xf3)](_0xaf2995)+_0x5c8d16(0x21b)+a42_0x18b51d[_0x5c8d16(0xf3)](_0x67080d));}const _0x358e57=new WorkflowTimelineCommand();await _0x358e57[_0x5c8d16(0xa4)]({'args':[],'options':{..._0x2d8c23,'attemptId':_0x194f8a[_0x5c8d16(0x15c)]},'tdx':_0x460bab});}[a42_0x8f79a1(0xd5)](_0x21ca7b,_0x20f78e){const _0x5ad1d3=a42_0x8f79a1,_0x49948a=new Map();for(const _0x33c703 of _0x21ca7b){_0x33c703['id']&&_0x33c703[_0x5ad1d3(0x1f5)]?.['id']&&_0x49948a[_0x5ad1d3(0x1de)](_0x33c703['id'],_0x33c703['lastAttempt']['id']);}const _0x206cf4=[];let _0x1b5909='';const _0x134234=this['renderSessionsTimeline'](_0x21ca7b,_0x20f78e),_0x2f3c81=_0x134234[_0x5ad1d3(0x13e)]('\x0a');for(const _0x55c212 of _0x2f3c81){if(_0x55c212[_0x5ad1d3(0x1b6)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x55c212[_0x5ad1d3(0x120)](/^\s+\d{4}-\d{2}-\d{2}/))_0x1b5909=_0x55c212;else{if(_0x55c212['match'](/^[✅❌🔄🛑⏳]/)){const _0x184537=_0x55c212[_0x5ad1d3(0x120)](/#(\d+)/),_0x580945=_0x184537?_0x184537[0x1]:null,_0x56180a=_0x580945?_0x49948a[_0x5ad1d3(0x1df)](_0x580945)||null:null,_0x399bc8=_0x21ca7b[_0x5ad1d3(0x1c1)](_0x3180a4=>_0x3180a4['id']===_0x580945),_0x15b18e=_0x399bc8?.['project']?.['name']||'';_0x206cf4[_0x5ad1d3(0x9b)]({'displayLine':_0x55c212,'attemptId':_0x56180a,'projectName':_0x15b18e});}}}return{'timelineRows':_0x206cf4,'timeAxisHeader':_0x1b5909};}}function a42_0x47ab(_0x5ae63a,_0x1c4f75){_0x5ae63a=_0x5ae63a-0x6f;const _0x44e3d3=a42_0x44e3();let _0x47ab5c=_0x44e3d3[_0x5ae63a];return _0x47ab5c;}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a42_0x8f79a1(0x199)]=a42_0x8f79a1(0x177);['description']=a42_0x8f79a1(0x209);async[a42_0x8f79a1(0xa4)](_0x571209){const _0x2cbb40=a42_0x8f79a1,{options:_0x426ee1,args:_0x727039,tdx:_0x138030}=_0x571209,_0x59a894=this['parseProjectWorkflowPattern'](_0x727039,_0x426ee1);if(!_0x59a894)return 0x1;const {projectName:_0x250894,workflowName:_0x3a7ad4}=_0x59a894,_0x5a9d65=_0x426ee1[_0x2cbb40(0x1f6)];if(_0x426ee1[_0x2cbb40(0xad)]){if(_0x250894&&_0x3a7ad4)console[_0x2cbb40(0x144)]('Filter:\x20'+_0x250894+'.'+_0x3a7ad4);else _0x250894&&console[_0x2cbb40(0x144)]('Filter:\x20project='+_0x250894);_0x5a9d65&&console[_0x2cbb40(0x144)](_0x2cbb40(0xc6));}const _0x2e243a=await withSpinner(_0x2cbb40(0xe6),()=>_0x138030['workflow'][_0x2cbb40(0x164)]({'projectName':_0x250894,'workflowName':_0x3a7ad4,'includeRetried':_0x5a9d65,'limit':_0x426ee1[_0x2cbb40(0x135)]}),{'verbose':_0x426ee1[_0x2cbb40(0xad)]}),_0x4a9e55=_0x2e243a[_0x2cbb40(0xfd)],_0x7bf2b4=_0x426ee1[_0x2cbb40(0x135)]||0x64,_0xbe47ac=_0x4a9e55[_0x2cbb40(0x182)]>=_0x7bf2b4?a42_0x18b51d['dim'](_0x2cbb40(0x16e)):'';console[_0x2cbb40(0x144)]('✔\x20Found\x20'+_0x4a9e55[_0x2cbb40(0x182)]+_0x2cbb40(0x109)+(_0x4a9e55[_0x2cbb40(0x182)]!==0x1?'s':'')+_0xbe47ac);if(_0x426ee1['format']==='json'||_0x426ee1[_0x2cbb40(0x16d)]==='jsonl'||_0x426ee1['format']==='table')await handleSDKOutput(_0x4a9e55,_0x426ee1);else{if(_0x4a9e55[_0x2cbb40(0x182)]===0x0){if(_0x250894&&_0x3a7ad4)console[_0x2cbb40(0x7b)](_0x2cbb40(0xff)+_0x250894+'.'+_0x3a7ad4);else _0x250894?console[_0x2cbb40(0x7b)](_0x2cbb40(0x93)+_0x250894):console['log'](_0x2cbb40(0x8c));}else{const _0x5bb990=_0x426ee1['site'],_0x23a3e5=_0x4a9e55['map'](_0x157a27=>{const _0x307827=_0x2cbb40,_0x58364a=a42_0x18b51d[_0x307827(0xf3)]('#'+_0x157a27['id']),_0xb4fdb4=_0x157a27[_0x307827(0x1c0)]?.['id'],_0x532f14=_0x157a27[_0x307827(0x79)]||_0x157a27[_0x307827(0x7d)],_0x1023e6=_0xb4fdb4&&_0x532f14?hyperlink(_0x58364a,getWorkflowAttemptUrl(_0x5bb990,_0xb4fdb4,_0x532f14,_0x157a27['id'])):_0x58364a,{icon:_0x47f205,text:_0x538bfb}=getAttemptStatusDisplay(_0x157a27),_0x59df2b=(_0x157a27['project']?.[_0x307827(0x199)]||'?')+'.'+(_0x157a27[_0x307827(0x21f)]?.[_0x307827(0x199)]||'?'),_0x46ace5=_0x157a27[_0x307827(0xcc)]?a42_0x18b51d['dim'](_0x157a27[_0x307827(0xcc)]):'';return(_0x1023e6+'\x20'+_0x47f205+(_0x538bfb?'\x20'+_0x538bfb:'')+'\x20'+_0x59df2b+'\x20'+_0x46ace5)[_0x307827(0xea)]();});await writeOutput(_0x23a3e5[_0x2cbb40(0x204)]('\x0a'),_0x426ee1[_0x2cbb40(0x1ba)],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a42_0x8f79a1(0x1c8);[a42_0x8f79a1(0x15e)]=a42_0x8f79a1(0x12a);async['execute'](_0x1d9015){const _0x45bc5c=a42_0x8f79a1,{options:_0x482ace,args:_0x49a783,tdx:_0x52df75}=_0x1d9015,_0x1623a6=_0x49a783[0x0];if(!_0x1623a6)return console[_0x45bc5c(0x144)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x482ace['verbose']&&console[_0x45bc5c(0x144)](_0x45bc5c(0x1cb)+_0x1623a6);const _0x5b3b6b=await withSpinner(_0x45bc5c(0x193),()=>_0x52df75[_0x45bc5c(0x21f)]['attempt'](_0x1623a6),{'verbose':_0x482ace[_0x45bc5c(0xad)]}),_0x4e2305=_0x5b3b6b[_0x45bc5c(0xfd)];let _0x74201b;!_0x4e2305[_0x45bc5c(0x13d)]?_0x74201b=_0x4e2305[_0x45bc5c(0x17f)]?_0x45bc5c(0x136):_0x45bc5c(0xcb):_0x74201b=_0x4e2305[_0x45bc5c(0x207)]?_0x45bc5c(0x207):_0x45bc5c(0x144);let _0x3b331f;if(_0x4e2305[_0x45bc5c(0x168)]&&_0x4e2305['finishedAt']){const _0x2d8d48=new Date(_0x4e2305[_0x45bc5c(0x168)])[_0x45bc5c(0x1a4)](),_0x35b3a3=new Date(_0x4e2305[_0x45bc5c(0x1b4)])[_0x45bc5c(0x1a4)]();_0x3b331f=Math[_0x45bc5c(0x10b)]((_0x35b3a3-_0x2d8d48)/0x3e8);}const _0xee71b={'attempt_id':_0x4e2305['id'],'status':_0x74201b,..._0x4e2305[_0x45bc5c(0xc4)]!==undefined&&{'index':_0x4e2305[_0x45bc5c(0xc4)]},..._0x4e2305[_0x45bc5c(0x1c0)]&&{'project':_0x4e2305['project'][_0x45bc5c(0x199)]},..._0x4e2305['workflow']&&{'workflow':_0x4e2305[_0x45bc5c(0x21f)][_0x45bc5c(0x199)]},..._0x4e2305[_0x45bc5c(0x7d)]&&{'session_id':_0x4e2305[_0x45bc5c(0x7d)]},..._0x4e2305[_0x45bc5c(0xcc)]&&{'session_time':_0x4e2305[_0x45bc5c(0xcc)]},..._0x4e2305[_0x45bc5c(0x7f)]&&{'retry_attempt':_0x4e2305['retryAttemptName']},..._0x3b331f!==undefined&&{'duration_sec':_0x3b331f},..._0x4e2305[_0x45bc5c(0x168)]&&{'created_at':_0x4e2305['createdAt']},..._0x4e2305[_0x45bc5c(0x1b4)]&&{'finished_at':_0x4e2305['finishedAt']},...Object[_0x45bc5c(0x11a)](_0x4e2305[_0x45bc5c(0xb4)])[_0x45bc5c(0x182)]>0x0&&{'params':_0x4e2305[_0x45bc5c(0xb4)]}};return await handleSingleObjectOutput(_0xee71b,_0x482ace),0x0;}}function a42_0x44e3(){const _0x40bd0b=['projectName','Retrying\x20attempt...','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','green','targetExists','yellow','durationMs','Show\x20specific\x20attempt\x20details','Usage:\x20tdx\x20wf\x20use\x20<project>','\x20\x20Console:\x20','isDirectory','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','slice','white','renderSessionsTimeline','workflow:logs','\x20workflow','Pushing\x20project...','limit','canceling','indexOf','workflow:tasks','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','\x20secret','Error:\x20Invalid\x20JSON\x20in\x20--params','Attempt:\x20','done','split','\x0aDry\x20run\x20-\x20nothing\x20pushed','now','5121513nVYyIn','start','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','error','-\x20nothing\x20pushed','43831160cRDdAj','tdx\x20wf\x20attempt\x20','max','status','state','Error:\x20Project\x20name\x20is\x20required','Invalid\x20format:\x20','5519524kLiGgn','No\x20matching\x20sessions\x20found','value','3442185TUEjbK','Kill\x20a\x20running\x20attempt','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','fileCount','Listing\x20workflow\x20projects...','showWorkflowConsoleUrl','MAX_POLL_ITERATIONS','displayLine','✔\x20Found\x20','✔\x20Showing\x20','attempt','requireProject','attemptId','No\x20workflow\x20projects\x20found','description','pollTimeline','workflow:clone','jsonl','unknown','\x0a✔\x20Attempt\x20complete','attempts','getMinutes','Target\x20directory:\x20','substring','createdAt','from','\x20new','session:','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','format','\x20(use\x20--limit\x20to\x20show\x20more)','Project\x20filter:\x20','Downloading\x20logs...','Session\x20','\x20deleted','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','hasChanges','✔\x20Project:\x20','retryAttempt','workflow:attempts','📋\x20','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Show\x20logs\x20for\x20a\x20workflow\x20attempt','map','List\x20all\x20workflow\x20projects','workflow:kill','\x20\x20Session\x20ID:\x20','cancelRequested','force','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','length','\x0a✔\x20No\x20changes\x20to\x20push','size','window','Revision:\x20','No\x20workflow\x20tdx.json\x20found','updatedAt','newProjectName','parse','✔\x20Push\x20complete','every','List\x20workflows','yes','attempt:','Project\x20name\x20is\x20required','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','revision:\x20','Getting\x20attempt\x20details...','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','select','run','Project:\x20','\x20\x20Files\x20extracted:\x20','name','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','workflow:upload','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','LABEL_WIDTH_DIVISOR','fullName','navigateSessionsInteractive','Pushing\x20workflow\x20project...','Reason:\x20','revision','No\x20sessions\x20found\x20for:\x20','getTime','\x0aDry\x20run\x20-\x20no\x20files\x20written','Pull\x20workflow\x20project\x20to\x20local\x20folder','isNewProject','type','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','logFiles','workflow:workflows','path','(use\x20--limit\x20to\x20see\x20more)','\x1b[1A\x1b[2K','MAX_TIMELINE_WIDTH','No\x20sessions\x20found\x20in\x20project:\x20','7896948unamwP','workflow:projects','-\x20no\x20files\x20written','finishedAt','Select\x20a\x20task\x20to\x20view\x20logs:','startsWith','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','modified','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','output','✔\x20Project\x20updated','workflow:timeline','isTTY','workflows','key','project','find','write','✔\x20Pull\x20complete','Setting\x20secret...','GUTTER','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','\x20\x20Source:\x20','workflow:attempt','Error:\x20Attempt\x20ID\x20is\x20required','some','Attempt\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','\x20\x20Attempt\x20ID:\x20','toISOString','Updating\x20','Error:\x20Secret\x20key\x20is\x20required','Starting\x20workflow\x20run...','Show\x20tasks\x20for\x20an\x20attempt','end','Failed\x20to\x20fetch\x20attempt\x20data','changes','Analyzing\x20project...','Select\x20a\x20workflow\x20to\x20run','projects','workflow:download','ICON_SPACING','\x20sessions\x20','✔\x20Workflow\x20project\x20set\x20to:\x20','Auto-selected\x20latest\x20session:\x20','set','get','relative','msPerChar','context','new','No\x20sessions\x20with\x20timing\x20information','5qgSWES','executeCloneProject','No\x20sessions\x20found','resolveProjectId','\x20tasks','\x20has\x20no\x20attempts','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','8Gmzitv','sort','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','No\x20log\x20content\x20found','Key\x20cannot\x20be\x20empty','stdout','workflow:pull','cyan','trim','lastAttempt','includeRetried','\x20\x20Workflow:\x20','Project\x20name:\x20','renderSingleTimeline','Source\x20directory:\x20','\x20\x20tdx\x20wf\x20use\x20<project>','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','autocomplete','fs/promises','ICON_WIDTH','\x20\x20Revision:\x20','List\x20workflow\x20execution\x20sessions','filesExtracted','json','join','replace','New\x20project\x20name:\x20','success','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','List\x20workflow\x20attempts','dryRun','Cancelled','MAX_LABEL_COUNT','workflow:secrets:delete','values','workflowProject','✔\x20Downloaded\x20','\x0a✔\x20Already\x20up\x20to\x20date','\x20project','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','session','Expected\x20format:\x20--param\x20key=value','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','getHours','getMonth','sourceProjectName','\x20from\x20session\x20',',\x20Workflow:\x20','POLL_INTERVAL_MS','Cloning\x20to\x20','min','workflow','Filter:\x20project=','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','Force:\x20yes','kill','workflowName','executePushProject','isArray','.\x20Expected\x20format:\x20KEY=VALUE','\x22\x20already\x20exists\x20(ID:\x20','Parameters:\x20','\x27\x20from\x20project\x20\x27','Getting\x20attempt\x20tasks...','Retrying\x20session...','Latest\x20session\x20has\x20no\x20attempt','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','parseProjectWorkflowPattern','reason','deleteSecret','\x20session','icon','session_id','Output\x20directory:\x20','log','workflow:delete','sessionId','buildTimelineData','retryAttemptName','Deleting\x20project\x20','Dry\x20run:\x20yes','Validation:\x20skipped','list','✔\x20Workflow\x20project\x20context\x20cleared.','getDate','Listing\x20secrets...','fromTask','sourceDir','tasks','padStart','table','No\x20attempts\x20found','startTime','resolveProjectDir','From\x20task:\x20','resolveProject','Target:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','No\x20attempts\x20found\x20in\x20project:\x20','applyPullProject','\x20modified','Listing\x20workflows...','MIN_LABEL_COUNT','Key:\x20','No\x20workflows\x20found','projectId','push','duration','✔\x20Workflow\x20run\x20started','workflow:use','MIN_TIMELINE_WIDTH','Error:\x20Invalid\x20parameter\x20format:\x20','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','blue','workflow:run','execute','setSecret','Tip:\x20cd\x20to\x20workflows/','diff','Error:','Killing\x20attempt...','/sessions/','\x0aError:','\x0aFailed\x20to\x20fetch\x20attempt\x20data','verbose','\x22\x20with\x20new\x20revision?','\x22\x20to\x20new\x20project\x20\x22','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','No\x20projects\x20match\x20pattern:\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','logs','params','task','No\x20workflow\x20sessions\x20found','Pattern:\x20','1529084hPPpfW','→\x20New\x20project:\x20','title','1569764geQVDN','...','Retry\x20a\x20session\x20or\x20attempt','Start\x20a\x20workflow\x20run','✔\x20Clone\x20complete','Analyzing\x20changes...','\x27...','TASK_NAME_WIDTH','all','index','targetDir','Include\x20retried:\x20yes','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','floor','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','existingProjectId','running','sessionTime','taskName','Params:\x20','fill','Loading\x20workflows...','message','total','rows','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','generateSessionTimelineRows','renderTimeline','filter','tdx.json','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Fetching\x20log\x20files...','skipValidation','LABEL_MIN_SPACING','sessions','\x20unchanged','red','Resume\x20from:\x20','workflow:secrets:list','📁\x20','planned','Downloading\x20project\x20','preparePushProject','Listing\x20workflow\x20attempts...','getFullYear','site','No\x20workflows\x20found\x20in\x20project:\x20','trimEnd','🔄\x20','\x0aDry\x20run\x20-\x20no\x20project\x20created','Loading\x20session...','resumeFrom','summary','cwd','\x20\x20Project\x20ID:\x20','newProjectId','dim','stat','\x20-\x20','\x20\x20Changes:\x20','Task\x20name:\x20','Loading\x20sessions...','Files\x20to\x20upload:\x20','workflow:retry','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','\x20(system)','data','Session\x20time:\x20','No\x20attempts\x20found\x20for:\x20','Error:\x20','follow','retrySession','toLowerCase','---\x20','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Session\x20not\x20found:\x20','unchanged','2QmSnLI','\x20attempt','group_error','round','⚠\x20Showing\x20first\x20','MAX_TASKS_DISPLAY','includes','localeCompare','workflow:secrets:set','fileSize','\x20task','has','utf-8','includeSubtasks','Workflow:\x20','Filter:\x20','\x20\x20Session\x20context\x20set\x20to:\x20','startedAt','keys','repeat','sys','\x20\x20Project:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Using\x20attempt\x20','match','✔\x20Secret\x20\x27','resolve'];a42_0x44e3=function(){return _0x40bd0b;};return a42_0x44e3();}export class WorkflowTasksCommand extends BaseCommand{[a42_0x8f79a1(0x199)]=a42_0x8f79a1(0x138);[a42_0x8f79a1(0x15e)]=a42_0x8f79a1(0x1d2);async[a42_0x8f79a1(0xa4)](_0x2fc3af){const _0x557733=a42_0x8f79a1,{options:_0x119de5,args:_0x5bc607,tdx:_0x2e394b}=_0x2fc3af,_0x1318c8=_0x5bc607[0x0];if(!_0x1318c8)return console[_0x557733(0x144)](_0x557733(0x1c9)),0x1;const _0x327307=_0x119de5[_0x557733(0x115)];_0x119de5['verbose']&&(console['error'](_0x557733(0x1cb)+_0x1318c8),_0x327307&&console['error']('Including\x20subtasks:\x20yes'));const _0x4dd012=await withSpinner(_0x557733(0x70),()=>_0x2e394b[_0x557733(0x21f)][_0x557733(0x89)](_0x1318c8,_0x327307||![]),{'verbose':_0x119de5[_0x557733(0xad)]}),_0x94797b=_0x4dd012['data'];return console['error'](_0x557733(0x158)+_0x94797b[_0x557733(0x182)]+_0x557733(0x112)+(_0x94797b[_0x557733(0x182)]!==0x1?'s':'')),await handleSDKOutput(_0x94797b,_0x119de5),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a42_0x8f79a1(0x199)]=a42_0x8f79a1(0x132);[a42_0x8f79a1(0x15e)]=a42_0x8f79a1(0x17a);async[a42_0x8f79a1(0xa4)](_0x4c4f47){const _0x4ac16e=a42_0x8f79a1,{options:_0x294e91,args:_0x2d4e9b,tdx:_0x205586}=_0x4c4f47,_0x1339f1=_0x2d4e9b[0x0];let _0x5220a3=_0x2d4e9b[0x1];if(!_0x1339f1)return console[_0x4ac16e(0x144)](_0x4ac16e(0x1c9)),0x1;_0x294e91[_0x4ac16e(0xad)]&&(console['error']('Attempt\x20ID:\x20'+_0x1339f1),_0x5220a3&&console[_0x4ac16e(0x144)](_0x4ac16e(0xf7)+_0x5220a3));const _0x3b6038=await withSpinner(_0x4ac16e(0xda),()=>_0x205586[_0x4ac16e(0x21f)][_0x4ac16e(0x1aa)](_0x1339f1,_0x5220a3),{'verbose':_0x294e91[_0x4ac16e(0xad)]}),_0x390793=_0x3b6038[_0x4ac16e(0xfd)];if(_0x390793[_0x4ac16e(0x182)]===0x0)return console[_0x4ac16e(0x144)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x5220a3&&(_0x294e91['json']||_0x294e91['format']))return await handleSDKOutput(_0x390793,_0x294e91),0x0;if(!_0x5220a3){const _0x21f76f=_0x390793[_0x4ac16e(0x17b)](_0x27c652=>({'title':_0x27c652[_0x4ac16e(0xcd)]+'\x20('+formatBytes(_0x27c652[_0x4ac16e(0x111)])+')','value':_0x27c652[_0x4ac16e(0xcd)]})),_0x362cb5=await a42_0x3b7933({'type':_0x4ac16e(0x195),'name':_0x4ac16e(0xb5),'message':_0x4ac16e(0x1b5),'choices':_0x21f76f});if(!_0x362cb5[_0x4ac16e(0xb5)])return console[_0x4ac16e(0x144)](_0x4ac16e(0x20b)),0x0;_0x5220a3=_0x362cb5[_0x4ac16e(0xb5)];}const _0x5f582b=await withSpinner(_0x4ac16e(0x170),()=>_0x205586[_0x4ac16e(0x21f)][_0x4ac16e(0xb3)](_0x1339f1,_0x5220a3),{'verbose':_0x294e91[_0x4ac16e(0xad)]}),_0x45ebd1=_0x5f582b['data'];return _0x45ebd1?console[_0x4ac16e(0x7b)](_0x45ebd1):console[_0x4ac16e(0x144)](_0x4ac16e(0x1ef)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a42_0x8f79a1(0x199)]=a42_0x8f79a1(0x17d);['description']=a42_0x8f79a1(0x151);async[a42_0x8f79a1(0xa4)](_0x234db1){const _0x346291=a42_0x8f79a1,{options:_0xb80e97,args:_0x406d73,tdx:_0xe6f414}=_0x234db1,_0x2f1c0f=_0x406d73[0x0];if(!_0x2f1c0f)return console['error'](_0x346291(0x1c9)),0x1;const _0x4cf4a4=_0xb80e97[_0x346291(0x75)];_0xb80e97[_0x346291(0xad)]&&(console[_0x346291(0x144)](_0x346291(0x1cb)+_0x2f1c0f),_0x4cf4a4&&console['error'](_0x346291(0x1a1)+_0x4cf4a4));if(!_0xb80e97['yes']){if(!isInteractive())return console[_0x346291(0x144)](a42_0x18b51d['red']('\x0aError:'),_0x346291(0x173)),console['error'](a42_0x18b51d[_0x346291(0xf3)](_0x346291(0x16c))),0x1;const _0x503674=await confirmKey(_0x346291(0x1b7)+_0x2f1c0f+'?');if(!_0x503674)return console['error'](a42_0x18b51d[_0x346291(0x128)](_0x346291(0x20b))),0x1;}const _0x3f5a7b=await withSpinner(_0x346291(0xa9),()=>_0xe6f414[_0x346291(0x21f)][_0x346291(0x223)](_0x2f1c0f,_0x4cf4a4),{'verbose':_0xb80e97[_0x346291(0xad)]}),_0x38223d=_0x3f5a7b[_0x346291(0xfd)];return console[_0x346291(0x144)]('✔\x20'+_0x38223d),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a42_0x8f79a1(0x199)]=a42_0x8f79a1(0xfa);['description']=a42_0x8f79a1(0xbd);async[a42_0x8f79a1(0xa4)](_0x5e8ebb){const _0x1aebd6=a42_0x8f79a1,{options:_0x483e26,args:_0x58ebb9,tdx:_0x1001f1}=_0x5e8ebb,_0x5b73ba=_0x58ebb9[0x0];if(!_0x5b73ba)return console[_0x1aebd6(0x144)](_0x1aebd6(0xb2)),console[_0x1aebd6(0x144)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x2663af=![],_0x2cf9b6=_0x5b73ba;if(_0x5b73ba[_0x1aebd6(0x1b6)](_0x1aebd6(0x16b)))_0x2663af=!![],_0x2cf9b6=_0x5b73ba[_0x1aebd6(0x167)](0x8);else{if(_0x5b73ba['startsWith'](_0x1aebd6(0x18f)))_0x2663af=![],_0x2cf9b6=_0x5b73ba[_0x1aebd6(0x167)](0x8);else return console[_0x1aebd6(0x144)](_0x1aebd6(0x194)),console[_0x1aebd6(0x144)](_0x1aebd6(0x1eb)),0x1;}const _0x20824a=_0x483e26[_0x1aebd6(0x87)],_0x54df16=_0x483e26[_0x1aebd6(0xee)],_0x25aee2=_0x483e26[_0x1aebd6(0xb4)],_0x4241a1=_0x483e26[_0x1aebd6(0x180)];_0x483e26[_0x1aebd6(0xad)]&&(console[_0x1aebd6(0x144)](_0x1aebd6(0x91)+(_0x2663af?_0x1aebd6(0x214):_0x1aebd6(0x15a))+'\x20'+_0x2cf9b6),_0x20824a&&console[_0x1aebd6(0x144)](_0x1aebd6(0x8f)+_0x20824a),_0x54df16&&console[_0x1aebd6(0x144)](_0x1aebd6(0xe0)+_0x54df16),_0x25aee2&&console[_0x1aebd6(0x144)](_0x1aebd6(0xce)+_0x25aee2),_0x4241a1&&console[_0x1aebd6(0x144)](_0x1aebd6(0x222)));let _0x59cac0;if(_0x25aee2)try{if(_0x25aee2[_0x1aebd6(0x1b6)]('@')){const _0x44f1b4=await import(_0x1aebd6(0x1fe)),_0x88a47b=_0x25aee2[_0x1aebd6(0x167)](0x1),_0x847c4c=await _0x44f1b4['readFile'](_0x88a47b,_0x1aebd6(0x114));_0x59cac0=JSON[_0x1aebd6(0x18a)](_0x847c4c);}else _0x59cac0=JSON['parse'](_0x25aee2);}catch{return console['error'](_0x1aebd6(0x13b)),0x1;}if(!_0x483e26[_0x1aebd6(0x18e)]){if(!isInteractive())return console[_0x1aebd6(0x144)](a42_0x18b51d[_0x1aebd6(0xdf)](_0x1aebd6(0xab)),_0x1aebd6(0x173)),console[_0x1aebd6(0x144)](a42_0x18b51d['dim'](_0x1aebd6(0x16c))),0x1;const _0x34884e=await confirmKey(_0x1aebd6(0x1c6)+(_0x2663af?_0x1aebd6(0x214):_0x1aebd6(0x15a))+'\x20'+_0x2cf9b6+'?');if(!_0x34884e)return console['error'](a42_0x18b51d['yellow'](_0x1aebd6(0x20b))),0x1;}let _0x2166b1;_0x2663af?_0x2166b1=await withSpinner(_0x1aebd6(0x71),()=>_0x1001f1[_0x1aebd6(0x21f)][_0x1aebd6(0x102)](_0x2cf9b6,{'fromTask':_0x20824a,'retryParams':_0x59cac0}),{'verbose':_0x483e26[_0x1aebd6(0xad)]}):_0x2166b1=await withSpinner(_0x1aebd6(0x124),()=>_0x1001f1['workflow'][_0x1aebd6(0x176)](_0x2cf9b6,{'resumeFrom':_0x54df16,'retryParams':_0x59cac0,'force':_0x4241a1}),{'verbose':_0x483e26[_0x1aebd6(0xad)]});const _0x5b596e=_0x2166b1[_0x1aebd6(0xfd)];return console['error']('✔\x20Retry\x20started'),console[_0x1aebd6(0x144)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x5b596e[_0x1aebd6(0x15c)]),console['error'](_0x1aebd6(0x17e)+_0x5b596e[_0x1aebd6(0x7d)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a42_0x8f79a1(0x199)]=a42_0x8f79a1(0xa3);[a42_0x8f79a1(0x15e)]=a42_0x8f79a1(0xbe);async[a42_0x8f79a1(0xa4)](_0x4b3bcd){const _0xe70f31=a42_0x8f79a1,{options:_0x4d047c,args:_0x31f137,tdx:_0x540247}=_0x4b3bcd;let _0x3d2658=_0x31f137[0x0];if(!_0x3d2658){const _0x3d1c39=this[_0xe70f31(0x90)]([],_0x4d047c),_0x2e0c0e=await withSpinner(_0xe70f31(0xd0),()=>_0x540247[_0xe70f31(0x21f)][_0xe70f31(0x1be)](_0x3d1c39,{'limit':_0x4d047c[_0xe70f31(0x135)]}),{'verbose':_0x4d047c[_0xe70f31(0xad)]}),_0x28281a=_0x2e0c0e[_0xe70f31(0xfd)];if(_0x28281a['length']===0x0)return console['error']('No\x20workflows\x20found'),!_0x3d1c39&&console[_0xe70f31(0x144)](a42_0x18b51d['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x5a6aa7=_0x28281a[_0xe70f31(0x17b)](_0x5998ad=>({'title':_0x5998ad[_0xe70f31(0x1c0)]?.[_0xe70f31(0x199)]+'.'+_0x5998ad[_0xe70f31(0x199)],'value':_0x5998ad['project']?.[_0xe70f31(0x199)]+'.'+_0x5998ad[_0xe70f31(0x199)],'description':_0x5998ad['revision']?_0xe70f31(0x192)+_0x5998ad['revision']:undefined})),_0x1c4b77=await a42_0x3b7933({'type':_0xe70f31(0x195),'name':'workflow','message':_0xe70f31(0x1d7),'choices':_0x5a6aa7});if(!_0x1c4b77[_0xe70f31(0x21f)])return 0x1;_0x3d2658=_0x1c4b77[_0xe70f31(0x21f)];}if(!_0x3d2658[_0xe70f31(0x10e)]('.')){const _0x3943b3=this['resolveProject']([],_0x4d047c);if(_0x3943b3)_0x3d2658=_0x3943b3+'.'+_0x3d2658;else return console[_0xe70f31(0x144)](a42_0x18b51d[_0xe70f31(0xdf)](_0xe70f31(0xa8)),_0xe70f31(0xfb)),console[_0xe70f31(0x144)](a42_0x18b51d[_0xe70f31(0xf3)](_0xe70f31(0x19a))),0x1;}const _0x331045=_0x4d047c['param'],_0x4c27fd=_0x4d047c[_0xe70f31(0xcc)],_0xd8c064={};if(_0x331045&&Array[_0xe70f31(0x226)](_0x331045))for(const _0x3c98c3 of _0x331045){const _0x54d7c7=_0x3c98c3[_0xe70f31(0x137)]('=');if(_0x54d7c7===-0x1)return console['error'](_0xe70f31(0xa0)+_0x3c98c3),console[_0xe70f31(0x144)](_0xe70f31(0x215)),0x1;const _0x196e24=_0x3c98c3[_0xe70f31(0x167)](0x0,_0x54d7c7),_0x480836=_0x3c98c3[_0xe70f31(0x167)](_0x54d7c7+0x1);try{_0xd8c064[_0x196e24]=JSON[_0xe70f31(0x18a)](_0x480836);}catch{_0xd8c064[_0x196e24]=_0x480836;}}_0x4d047c[_0xe70f31(0xad)]&&(console[_0xe70f31(0x144)](_0xe70f31(0x116)+_0x3d2658),Object[_0xe70f31(0x11a)](_0xd8c064)[_0xe70f31(0x182)]>0x0&&console[_0xe70f31(0x144)](_0xe70f31(0x229)+JSON['stringify'](_0xd8c064)),_0x4c27fd&&console[_0xe70f31(0x144)](_0xe70f31(0xfe)+_0x4c27fd));const _0x291d98=await withSpinner(_0xe70f31(0x1d1),()=>_0x540247[_0xe70f31(0x21f)][_0xe70f31(0x196)](_0x3d2658,_0xd8c064,{'sessionTime':_0x4c27fd}),{'verbose':_0x4d047c[_0xe70f31(0xad)]}),_0x2a0d5d=_0x291d98['data'];console[_0xe70f31(0x144)](_0xe70f31(0x9d)),console[_0xe70f31(0x144)](_0xe70f31(0x1cd)+_0x2a0d5d['id']),console[_0xe70f31(0x144)](_0xe70f31(0x17e)+_0x2a0d5d[_0xe70f31(0x7d)]),console[_0xe70f31(0x144)]('\x20\x20Project:\x20'+_0x2a0d5d[_0xe70f31(0x1c0)]?.[_0xe70f31(0x199)]),console[_0xe70f31(0x144)](_0xe70f31(0x1f7)+_0x2a0d5d['workflow']?.[_0xe70f31(0x199)]);if(_0x2a0d5d['project']?.['id']&&_0x2a0d5d[_0xe70f31(0x7d)]&&_0x2a0d5d['id']){const _0x31c139=_0x4d047c[_0xe70f31(0xe8)],_0x2191fd=getConsoleUrl(_0x31c139,'/app/workflows/'+_0x2a0d5d[_0xe70f31(0x1c0)]['id']+_0xe70f31(0xaa)+_0x2a0d5d[_0xe70f31(0x7d)]+'/attempt/'+_0x2a0d5d['id']);console[_0xe70f31(0x144)](_0xe70f31(0x12c)+a42_0x18b51d[_0xe70f31(0x1f3)](_0x2191fd));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a42_0x8f79a1(0x199)]=a42_0x8f79a1(0x1d9);['description']=a42_0x8f79a1(0x1fc);async[a42_0x8f79a1(0xa4)](_0x3c05fb){const _0x427c7c=a42_0x8f79a1,{options:_0x5321ef,args:_0x2ae42f,tdx:_0x3bd138}=_0x3c05fb,_0x4aa13b=_0x2ae42f[0x0],_0x4ead75=_0x2ae42f[0x1]||'.';if(!_0x4aa13b)return console[_0x427c7c(0x144)](_0x427c7c(0x14b)),console['error'](_0x427c7c(0x216)),0x1;const _0x767096=_0x5321ef[_0x427c7c(0x1a2)];_0x5321ef[_0x427c7c(0xad)]&&(console[_0x427c7c(0x144)](_0x427c7c(0x197)+_0x4aa13b),console[_0x427c7c(0x144)](_0x427c7c(0x7a)+_0x4ead75),_0x767096&&console[_0x427c7c(0x144)](_0x427c7c(0x186)+_0x767096));const _0x31dbf4=await withSpinner(_0x427c7c(0xe4)+_0x4aa13b+_0x427c7c(0xbc),()=>_0x3bd138['workflow']['download'](_0x4aa13b,_0x4ead75,{'revision':_0x767096}),{'verbose':_0x5321ef[_0x427c7c(0xad)]}),_0x52c35e=_0x31dbf4[_0x427c7c(0xfd)];return console[_0x427c7c(0x144)](_0x427c7c(0x210)+_0x52c35e[_0x427c7c(0x123)]),console['error'](_0x427c7c(0x200)+_0x52c35e[_0x427c7c(0x1a2)]),console[_0x427c7c(0x144)](_0x427c7c(0x198)+_0x52c35e[_0x427c7c(0x202)]),console[_0x427c7c(0x144)]('\x20\x20Location:\x20'+_0x4ead75+'/'+_0x52c35e['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a42_0x8f79a1(0x19b);[a42_0x8f79a1(0x15e)]=a42_0x8f79a1(0x191);async['execute'](_0x4d7aac){const _0x26ab52=a42_0x8f79a1,{options:_0x5689fb,args:_0x1938ec,tdx:_0x2bc37e}=_0x4d7aac;let _0x3cc021='.',_0x1ae4ad=_0x5689fb[_0x26ab52(0x199)];if(_0x1938ec[0x0]){const {promises:_0xf806d7}=await import('fs');try{const _0x40c6ab=await _0xf806d7[_0x26ab52(0xf4)](_0x1938ec[0x0]);if(_0x40c6ab[_0x26ab52(0x12d)]())_0x3cc021=_0x1938ec[0x0];else return console['error'](_0x26ab52(0x100)+_0x1938ec[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x1ae4ad=_0x1938ec[0x0],_0x3cc021='.';}}const _0x52770a=_0x5689fb[_0x26ab52(0x1a2)],_0x4469d9=_0x5689fb[_0x26ab52(0xdb)];_0x5689fb[_0x26ab52(0xad)]&&(console[_0x26ab52(0x144)]('Project\x20directory:\x20'+_0x3cc021),_0x1ae4ad&&console[_0x26ab52(0x144)](_0x26ab52(0x1f8)+_0x1ae4ad),_0x52770a&&console[_0x26ab52(0x144)](_0x26ab52(0x186)+_0x52770a),_0x4469d9&&console[_0x26ab52(0x144)](_0x26ab52(0x82)));const _0x6b06da=await withSpinner(_0x26ab52(0x1a0),()=>_0x2bc37e[_0x26ab52(0x21f)][_0x26ab52(0x9b)](_0x3cc021,{'projectName':_0x1ae4ad,'revision':_0x52770a,'skipValidation':_0x4469d9}),{'verbose':_0x5689fb[_0x26ab52(0xad)]}),_0x3d2cc0=_0x6b06da[_0x26ab52(0xfd)];return console[_0x26ab52(0x144)]('✔\x20Pushed\x20'+_0x3d2cc0[_0x26ab52(0x123)]),console['error'](_0x26ab52(0xf1)+_0x3d2cc0[_0x26ab52(0x9a)]),console[_0x26ab52(0x144)](_0x26ab52(0x200)+_0x3d2cc0[_0x26ab52(0x1a2)]),await this[_0x26ab52(0x155)](_0x2bc37e,_0x3d2cc0['projectName'],_0x5689fb[_0x26ab52(0xe8)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a42_0x8f79a1(0x199)]=a42_0x8f79a1(0x1f2);[a42_0x8f79a1(0x15e)]=a42_0x8f79a1(0x1a6);async['execute'](_0x2ddeba){const _0x51cc7d=a42_0x8f79a1,{options:_0x57c5b5,args:_0x1545f3,tdx:_0x259a99}=_0x2ddeba,_0x261436=_0x1545f3[0x0],_0x2c990d=_0x1545f3[0x1];if(!_0x261436)return console[_0x51cc7d(0x144)](a42_0x18b51d[_0x51cc7d(0xdf)](_0x51cc7d(0xa8)),_0x51cc7d(0x190)),console[_0x51cc7d(0x144)](a42_0x18b51d['dim'](_0x51cc7d(0xb0))),0x1;const _0x270191=_0x57c5b5['revision'];_0x57c5b5[_0x51cc7d(0xad)]&&(console['error'](_0x51cc7d(0x197)+_0x261436),_0x2c990d&&console[_0x51cc7d(0x144)](_0x51cc7d(0x166)+_0x2c990d),_0x270191&&console[_0x51cc7d(0x144)]('Revision:\x20'+_0x270191),_0x57c5b5[_0x51cc7d(0x20a)]&&console['error'](_0x51cc7d(0x81)));const _0x4c4924=await withSpinner('Pulling\x20project\x20'+_0x261436+_0x51cc7d(0xbc),()=>_0x259a99[_0x51cc7d(0x21f)]['pullProject'](_0x261436,{'targetDir':_0x2c990d,'revision':_0x270191}),{'verbose':_0x57c5b5[_0x51cc7d(0xad)]}),_0x51e418=_0x4c4924[_0x51cc7d(0xfd)];_0x51e418[_0x51cc7d(0x1a7)]?console['error'](_0x51cc7d(0xb9)+_0x51e418[_0x51cc7d(0x123)]):console[_0x51cc7d(0x144)]('→\x20Project:\x20'+_0x51e418[_0x51cc7d(0x123)]);console[_0x51cc7d(0x144)](_0x51cc7d(0x200)+_0x51e418['revision']),console[_0x51cc7d(0x144)]('\x20\x20Target:\x20'+(a42_0x2f6ec0['relative'](process[_0x51cc7d(0xf0)](),_0x51e418[_0x51cc7d(0xc5)])||'.')),console[_0x51cc7d(0x144)](_0x51cc7d(0xf6)+a42_0x18b51d['green']('+'+_0x51e418[_0x51cc7d(0xef)][_0x51cc7d(0x1e3)]+_0x51cc7d(0x16a))+',\x20'+(a42_0x18b51d[_0x51cc7d(0x128)]('~'+_0x51e418[_0x51cc7d(0xef)][_0x51cc7d(0x1b8)]+_0x51cc7d(0x95))+',\x20')+(a42_0x18b51d[_0x51cc7d(0xdf)]('-'+_0x51e418[_0x51cc7d(0xef)]['deleted']+_0x51cc7d(0x172))+',\x20')+(''+a42_0x18b51d['dim'](_0x51e418[_0x51cc7d(0xef)][_0x51cc7d(0x107)]+_0x51cc7d(0xde))));for(const _0x1b2563 of _0x51e418[_0x51cc7d(0x1d5)]){_0x1b2563[_0x51cc7d(0x1a8)]===_0x51cc7d(0x1b8)&&_0x1b2563[_0x51cc7d(0xa7)]&&(console[_0x51cc7d(0x144)]('\x0a'+a42_0x18b51d[_0x51cc7d(0x1f3)](_0x51cc7d(0x104)+_0x1b2563[_0x51cc7d(0x1ac)])),console[_0x51cc7d(0x144)](_0x1b2563[_0x51cc7d(0xa7)]));}if(!_0x51e418[_0x51cc7d(0x174)])return saveSessionContext({'workflow_project':_0x51e418[_0x51cc7d(0x123)]},_0x57c5b5['session']),console[_0x51cc7d(0x144)](a42_0x18b51d[_0x51cc7d(0x126)](_0x51cc7d(0x211))),console['error'](a42_0x18b51d[_0x51cc7d(0xf3)](_0x51cc7d(0x118)+_0x51e418[_0x51cc7d(0x123)])),0x0;if(_0x57c5b5[_0x51cc7d(0x20a)])return console[_0x51cc7d(0x144)](a42_0x18b51d[_0x51cc7d(0x128)](_0x51cc7d(0x1a5))),0x0;if(!_0x57c5b5['yes']){if(!isInteractive())return console[_0x51cc7d(0x144)](a42_0x18b51d[_0x51cc7d(0xdf)](_0x51cc7d(0xab)),_0x51cc7d(0x173)),console[_0x51cc7d(0x144)](a42_0x18b51d[_0x51cc7d(0xf3)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x343b46=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x343b46)return console[_0x51cc7d(0x144)](a42_0x18b51d['yellow'](_0x51cc7d(0x20b)),_0x51cc7d(0x1b3)),0x1;}await withSpinner('Writing\x20files...',()=>_0x259a99[_0x51cc7d(0x21f)][_0x51cc7d(0x94)](_0x51e418,{'revision':_0x270191}),{'verbose':_0x57c5b5[_0x51cc7d(0xad)]}),saveSessionContext({'workflow_project':_0x51e418[_0x51cc7d(0x123)]},_0x57c5b5[_0x51cc7d(0x214)]),console[_0x51cc7d(0x144)](a42_0x18b51d['green'](_0x51cc7d(0x1c3)));const _0x19d97b=a42_0x2f6ec0[_0x51cc7d(0x1e0)](process[_0x51cc7d(0xf0)](),_0x51e418['targetDir'])||'.';return console[_0x51cc7d(0x144)](a42_0x18b51d[_0x51cc7d(0xf3)]('\x20\x20Location:\x20'+_0x19d97b)),console[_0x51cc7d(0x144)](a42_0x18b51d[_0x51cc7d(0xf3)](_0x51cc7d(0x118)+_0x51e418[_0x51cc7d(0x123)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a42_0x8f79a1(0x199)]='workflow:push';[a42_0x8f79a1(0x15e)]='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async[a42_0x8f79a1(0xa4)](_0x1b7da3){const _0x5182bf=a42_0x8f79a1,{options:_0x267125,args:_0x6cd71e,tdx:_0x4bc968}=_0x1b7da3,_0x15be8e=this[_0x5182bf(0x8e)](_0x6cd71e,_0x267125),_0x372d93=_0x267125['revision'],_0x1bed47=_0x267125[_0x5182bf(0xdb)];_0x267125[_0x5182bf(0xad)]&&(_0x15be8e&&console['error'](_0x5182bf(0x1fa)+_0x15be8e),_0x372d93&&console[_0x5182bf(0x144)](_0x5182bf(0x186)+_0x372d93),_0x267125[_0x5182bf(0x20a)]&&console['error']('Dry\x20run:\x20yes'),_0x1bed47&&console[_0x5182bf(0x144)]('Validation:\x20skipped'));let _0x5b718a;try{_0x5b718a=await withSpinner(_0x5182bf(0xc0),()=>_0x4bc968[_0x5182bf(0x21f)][_0x5182bf(0xe5)]({'sourceDir':_0x15be8e,'revision':_0x372d93,'skipValidation':_0x1bed47}),{'verbose':_0x267125[_0x5182bf(0xad)]});}catch(_0x3aa39e){if(_0x3aa39e instanceof Error&&_0x3aa39e[_0x5182bf(0xd1)][_0x5182bf(0x10e)](_0x5182bf(0x187)))return console[_0x5182bf(0x144)](a42_0x18b51d['red'](_0x5182bf(0xa8)),_0x5182bf(0x19c)),_0x267125[_0x5182bf(0x20f)]?console[_0x5182bf(0x144)](a42_0x18b51d[_0x5182bf(0xf3)](_0x5182bf(0xa6)+_0x267125[_0x5182bf(0x20f)]+_0x5182bf(0x1ee)+_0x267125[_0x5182bf(0x20f)]+'\x27')):console['error'](a42_0x18b51d[_0x5182bf(0xf3)](_0x5182bf(0xc7))),0x1;throw _0x3aa39e;}const _0x5cb817=_0x5b718a['data'];console[_0x5182bf(0x144)](_0x5182bf(0x175)+_0x5cb817[_0x5182bf(0x123)]),console[_0x5182bf(0x144)](_0x5182bf(0x1c7)+_0x5cb817['sourceDir']),console[_0x5182bf(0x144)](_0x5182bf(0x200)+_0x5cb817[_0x5182bf(0x1a2)]),console['error']('\x20\x20Changes:\x20'+a42_0x18b51d[_0x5182bf(0x126)]('+'+_0x5cb817['summary'][_0x5182bf(0x1e3)]+_0x5182bf(0x16a))+',\x20'+(a42_0x18b51d[_0x5182bf(0x128)]('~'+_0x5cb817[_0x5182bf(0xef)][_0x5182bf(0x1b8)]+'\x20modified')+',\x20')+(a42_0x18b51d[_0x5182bf(0xdf)]('-'+_0x5cb817[_0x5182bf(0xef)]['deleted']+_0x5182bf(0x172))+',\x20')+(''+a42_0x18b51d[_0x5182bf(0xf3)](_0x5cb817[_0x5182bf(0xef)]['unchanged']+'\x20unchanged')));for(const _0x29e768 of _0x5cb817['changes']){_0x29e768[_0x5182bf(0x1a8)]===_0x5182bf(0x1b8)&&_0x29e768[_0x5182bf(0xa7)]&&(console[_0x5182bf(0x144)]('\x0a'+a42_0x18b51d[_0x5182bf(0x1f3)](_0x5182bf(0x104)+_0x29e768['path'])),console[_0x5182bf(0x144)](_0x29e768[_0x5182bf(0xa7)]));}if(!_0x5cb817['hasChanges'])return console['error'](a42_0x18b51d[_0x5182bf(0x126)](_0x5182bf(0x183))),await this[_0x5182bf(0x155)](_0x4bc968,_0x5cb817['projectName'],_0x267125[_0x5182bf(0xe8)]),0x0;if(_0x267125[_0x5182bf(0x20a)])return console['error'](a42_0x18b51d['yellow'](_0x5182bf(0x13f))),0x0;if(!_0x267125['yes']){if(!isInteractive())return console[_0x5182bf(0x144)](a42_0x18b51d[_0x5182bf(0xdf)]('\x0aError:'),_0x5182bf(0x173)),console[_0x5182bf(0x144)](a42_0x18b51d['dim'](_0x5182bf(0x16c))),0x1;const _0x443ad4=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x443ad4)return console['error'](a42_0x18b51d[_0x5182bf(0x128)]('Cancelled'),_0x5182bf(0x145)),0x1;}const _0x1805a6=await withSpinner(_0x5182bf(0x134),()=>_0x4bc968['workflow'][_0x5182bf(0x225)](_0x5cb817),{'verbose':_0x267125[_0x5182bf(0xad)]}),_0xd7ed4=_0x1805a6[_0x5182bf(0xfd)];return console['error'](a42_0x18b51d['green'](_0x5182bf(0x18b))),console[_0x5182bf(0x144)](_0x5182bf(0xf1)+_0xd7ed4[_0x5182bf(0x9a)]),console[_0x5182bf(0x144)](_0x5182bf(0x200)+_0xd7ed4[_0x5182bf(0x1a2)]),await this[_0x5182bf(0x155)](_0x4bc968,_0xd7ed4[_0x5182bf(0x123)],_0x267125[_0x5182bf(0xe8)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a42_0x8f79a1(0x160);[a42_0x8f79a1(0x15e)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async['execute'](_0x2b48d8){const _0x220606=a42_0x8f79a1,{options:_0xd91538,args:_0x1f2b16,tdx:_0x2baa93}=_0x2b48d8,_0x4db817=this[_0x220606(0x8e)](_0x1f2b16,_0xd91538),_0x1ebdff=_0xd91538[_0x220606(0x199)],_0x207f26=_0xd91538[_0x220606(0x1a2)],_0x1ee33c=_0xd91538[_0x220606(0xdb)];if(!_0x4db817)return console[_0x220606(0x144)](a42_0x18b51d[_0x220606(0xdf)](_0x220606(0xa8)),'Source\x20directory\x20is\x20required'),console[_0x220606(0x144)](a42_0x18b51d[_0x220606(0xf3)](_0x220606(0xc9))),console['error'](a42_0x18b51d[_0x220606(0xf3)](_0x220606(0x1cc))),0x1;if(!_0x1ebdff)return console[_0x220606(0x144)](a42_0x18b51d[_0x220606(0xdf)](_0x220606(0xa8)),_0x220606(0x143)),console[_0x220606(0x144)](a42_0x18b51d[_0x220606(0xf3)](_0x220606(0xc9))),0x1;_0xd91538[_0x220606(0xad)]&&(console[_0x220606(0x144)](_0x220606(0x1fa)+_0x4db817),console['error'](_0x220606(0x206)+_0x1ebdff),_0x207f26&&console['error']('Revision:\x20'+_0x207f26),_0xd91538['dryRun']&&console[_0x220606(0x144)](_0x220606(0x81)),_0x1ee33c&&console[_0x220606(0x144)](_0x220606(0x82)));const _0x5ede96=await withSpinner(_0x220606(0x1d6),()=>_0x2baa93[_0x220606(0x21f)]['prepareCloneProject'](_0x4db817,_0x1ebdff,{'revision':_0x207f26,'skipValidation':_0x1ee33c}),{'verbose':_0xd91538[_0x220606(0xad)]}),_0x12d7b6=_0x5ede96[_0x220606(0xfd)];console['error']('Source:\x20'+_0x12d7b6[_0x220606(0x88)]);_0x12d7b6[_0x220606(0x219)]&&console['error']('Source\x20project:\x20'+_0x12d7b6[_0x220606(0x219)]);console[_0x220606(0x144)](_0x220606(0x206)+_0x12d7b6[_0x220606(0x189)]),console[_0x220606(0x144)](_0x220606(0x186)+_0x12d7b6[_0x220606(0x1a2)]),console[_0x220606(0x144)](_0x220606(0xf9)+_0x12d7b6[_0x220606(0x153)]);_0x12d7b6[_0x220606(0x127)]&&(console[_0x220606(0x144)](a42_0x18b51d[_0x220606(0x128)]('\x0a⚠\x20Project\x20\x22'+_0x12d7b6['newProjectName']+_0x220606(0x228)+_0x12d7b6[_0x220606(0xca)]+')')),console[_0x220606(0x144)](a42_0x18b51d[_0x220606(0x128)](_0x220606(0x221))));if(_0xd91538[_0x220606(0x20a)])return console[_0x220606(0x144)](a42_0x18b51d['yellow'](_0x220606(0xec))),0x0;if(!_0xd91538['yes']){if(!isInteractive())return console[_0x220606(0x144)](a42_0x18b51d[_0x220606(0xdf)](_0x220606(0xab)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x220606(0x144)](a42_0x18b51d[_0x220606(0xf3)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4f5c4c=_0x12d7b6[_0x220606(0x219)]||a42_0x2f6ec0['basename'](_0x4db817),_0x30690f=_0x12d7b6[_0x220606(0x127)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x1ebdff+_0x220606(0xae):'\x0aClone\x20\x22'+_0x4f5c4c+_0x220606(0xaf)+_0x1ebdff+'\x22?',_0x27bf19=await confirmKey(_0x30690f);if(!_0x27bf19)return console['error'](a42_0x18b51d[_0x220606(0x128)](_0x220606(0x20b))),0x1;}const _0x7bd8f8=await withSpinner(_0x12d7b6['targetExists']?_0x220606(0x1cf)+_0x1ebdff+'...':_0x220606(0x21d)+_0x1ebdff+'...',()=>_0x2baa93['workflow'][_0x220606(0x1e6)](_0x12d7b6),{'verbose':_0xd91538[_0x220606(0xad)]}),_0xe873c3=_0x7bd8f8[_0x220606(0xfd)];return console[_0x220606(0x144)](a42_0x18b51d['green'](_0x12d7b6['targetExists']?_0x220606(0x1bb):_0x220606(0xbf))),console[_0x220606(0x144)](_0x220606(0x11d)+_0xe873c3[_0x220606(0x189)]),console[_0x220606(0x144)]('\x20\x20Project\x20ID:\x20'+_0xe873c3[_0x220606(0xf2)]),console[_0x220606(0x144)](_0x220606(0x200)+_0xe873c3[_0x220606(0x1a2)]),await this[_0x220606(0x155)](_0x2baa93,_0xe873c3[_0x220606(0x189)],_0xd91538['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a42_0x8f79a1(0x199)]=a42_0x8f79a1(0x7c);[a42_0x8f79a1(0x15e)]=a42_0x8f79a1(0x11e);async['execute'](_0x5d6529){const _0x5b7ebf=a42_0x8f79a1,{options:_0x38e655,args:_0x3e306c,tdx:_0x184d37}=_0x5d6529,_0x33937c=_0x3e306c[0x0];if(!_0x33937c)return console[_0x5b7ebf(0x144)](_0x5b7ebf(0xa1)),console[_0x5b7ebf(0x144)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x38e655[_0x5b7ebf(0xad)]&&console[_0x5b7ebf(0x144)](_0x5b7ebf(0x197)+_0x33937c);if(!_0x38e655[_0x5b7ebf(0x18e)]){if(!isInteractive())return console[_0x5b7ebf(0x144)](a42_0x18b51d[_0x5b7ebf(0xdf)](_0x5b7ebf(0xab)),_0x5b7ebf(0x173)),console[_0x5b7ebf(0x144)](a42_0x18b51d['dim'](_0x5b7ebf(0x16c))),0x1;const _0x56e7b8=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x33937c+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x56e7b8)return console[_0x5b7ebf(0x144)](a42_0x18b51d[_0x5b7ebf(0x128)](_0x5b7ebf(0x20b))),0x1;}const _0x48d982=await withSpinner(_0x5b7ebf(0x80)+_0x33937c+_0x5b7ebf(0xbc),()=>_0x184d37[_0x5b7ebf(0x21f)]['delete'](_0x33937c),{'verbose':_0x38e655['verbose']}),_0x59e990=_0x48d982[_0x5b7ebf(0xfd)];return console['error']('✔\x20Deleted\x20project\x20'+_0x59e990[_0x5b7ebf(0x123)]),console[_0x5b7ebf(0x144)](_0x5b7ebf(0xf1)+_0x59e990[_0x5b7ebf(0x9a)]),0x0;}}export function parseKeyValue(_0x2fdcfa){const _0x9c64d1=a42_0x8f79a1,_0x273a3b=_0x2fdcfa[_0x9c64d1(0x137)]('=');if(_0x273a3b===-0x1)throw new Error(_0x9c64d1(0x14c)+_0x2fdcfa+_0x9c64d1(0x227));const _0x44377c=_0x2fdcfa[_0x9c64d1(0x167)](0x0,_0x273a3b),_0x553ebb=_0x2fdcfa[_0x9c64d1(0x167)](_0x273a3b+0x1);if(!_0x44377c)throw new Error(_0x9c64d1(0x1f0));return{'key':_0x44377c,'value':_0x553ebb};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a42_0x8f79a1(0x199)]=a42_0x8f79a1(0xe1);['description']=a42_0x8f79a1(0x105);async[a42_0x8f79a1(0xa4)](_0x9d5432){const _0x1a6652=a42_0x8f79a1,{options:_0x236ce0,args:_0x32051f,tdx:_0x46edc1}=_0x9d5432,_0x27b7ae=this[_0x1a6652(0x15b)](_0x32051f,_0x236ce0);if(!_0x27b7ae)return 0x1;_0x236ce0['verbose']&&console[_0x1a6652(0x144)](_0x1a6652(0x197)+_0x27b7ae);const _0x5c182e=await withSpinner(_0x1a6652(0x86),()=>_0x46edc1[_0x1a6652(0x21f)]['listSecrets'](_0x27b7ae),{'verbose':_0x236ce0[_0x1a6652(0xad)]}),{secrets:_0x6cfd36}=_0x5c182e[_0x1a6652(0xfd)];return console['error']('✔\x20Found\x20'+_0x6cfd36[_0x1a6652(0x182)]+_0x1a6652(0x13a)+(_0x6cfd36[_0x1a6652(0x182)]!==0x1?'s':'')),await handleSDKOutput(_0x6cfd36,_0x236ce0),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a42_0x8f79a1(0x199)]=a42_0x8f79a1(0x110);[a42_0x8f79a1(0x15e)]=a42_0x8f79a1(0x152);async['execute'](_0x1afee5){const _0x44a540=a42_0x8f79a1,{options:_0x4687ed,args:_0x3cbe95,tdx:_0x3ca795}=_0x1afee5;let _0x5ae98d,_0xacc8f4;if(_0x3cbe95[_0x44a540(0x182)]>=0x2)_0x5ae98d=_0x3cbe95[0x0],_0xacc8f4=_0x3cbe95[0x1];else{if(_0x3cbe95[_0x44a540(0x182)]===0x1&&_0x4687ed[_0x44a540(0x20f)])_0x5ae98d=_0x4687ed[_0x44a540(0x20f)],_0xacc8f4=_0x3cbe95[0x0];else return _0x3cbe95[_0x44a540(0x182)]===0x1?(console[_0x44a540(0x144)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x44a540(0x144)](_0x44a540(0x19a)),0x1):(console['error']('Error:\x20KEY=VALUE\x20is\x20required'),console[_0x44a540(0x144)](_0x44a540(0x1b9)),0x1);}let _0x29ef0e,_0x40490f;try{({key:_0x29ef0e,value:_0x40490f}=parseKeyValue(_0xacc8f4));}catch(_0x536c98){return _0x536c98 instanceof Error&&console[_0x44a540(0x144)](a42_0x18b51d['red'](_0x44a540(0xa8)),_0x536c98[_0x44a540(0xd1)]),0x1;}_0x4687ed[_0x44a540(0xad)]&&(console[_0x44a540(0x144)]('Project:\x20'+_0x5ae98d),console['error'](_0x44a540(0x98)+_0x29ef0e));const _0x3d7afa=await withSpinner(_0x44a540(0x1c4),()=>_0x3ca795[_0x44a540(0x21f)][_0x44a540(0xa5)](_0x5ae98d,_0x29ef0e,_0x40490f),{'verbose':_0x4687ed[_0x44a540(0xad)]}),_0xd721ce=_0x3d7afa['data'];return console['error'](_0x44a540(0x121)+_0xd721ce[_0x44a540(0x1bf)]+_0x44a540(0xd9)+_0xd721ce[_0x44a540(0x123)]+'\x27'),(_0x4687ed[_0x44a540(0x203)]||_0x4687ed[_0x44a540(0x161)])&&await handleSingleObjectOutput(_0xd721ce,_0x4687ed),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a42_0x8f79a1(0x199)]=a42_0x8f79a1(0x20d);[a42_0x8f79a1(0x15e)]=a42_0x8f79a1(0x179);async['execute'](_0x2195cb){const _0x187ab1=a42_0x8f79a1,{options:_0x57df3a,args:_0x541427,tdx:_0x4cb757}=_0x2195cb;let _0x11a965,_0x569965;if(_0x541427[_0x187ab1(0x182)]>=0x2)_0x11a965=_0x541427[0x0],_0x569965=_0x541427[0x1];else{if(_0x541427[_0x187ab1(0x182)]===0x1&&_0x57df3a[_0x187ab1(0x20f)])_0x11a965=_0x57df3a['workflowProject'],_0x569965=_0x541427[0x0];else return _0x541427[_0x187ab1(0x182)]===0x1?(console[_0x187ab1(0x144)](_0x187ab1(0x14b)),console[_0x187ab1(0x144)](_0x187ab1(0x19a)),0x1):(console[_0x187ab1(0x144)](_0x187ab1(0x1d0)),console['error'](_0x187ab1(0x1a9)),0x1);}_0x57df3a[_0x187ab1(0xad)]&&(console[_0x187ab1(0x144)](_0x187ab1(0x197)+_0x11a965),console[_0x187ab1(0x144)]('Key:\x20'+_0x569965));if(!_0x57df3a['yes']){if(!isInteractive())return console['error'](a42_0x18b51d[_0x187ab1(0xdf)](_0x187ab1(0xab)),_0x187ab1(0x173)),console[_0x187ab1(0x144)](a42_0x18b51d['dim'](_0x187ab1(0x16c))),0x1;const _0x5a06d7=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x569965+_0x187ab1(0x6f)+_0x11a965+'\x27?');if(!_0x5a06d7)return console['error'](a42_0x18b51d[_0x187ab1(0x128)](_0x187ab1(0x20b))),0x1;}const _0x1dc093=await withSpinner('Deleting\x20secret...',()=>_0x4cb757[_0x187ab1(0x21f)][_0x187ab1(0x76)](_0x11a965,_0x569965),{'verbose':_0x57df3a['verbose']}),_0x3db147=_0x1dc093[_0x187ab1(0xfd)];return console[_0x187ab1(0x144)](_0x187ab1(0x121)+_0x3db147['key']+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x3db147[_0x187ab1(0x123)]+'\x27'),(_0x57df3a['json']||_0x57df3a['jsonl'])&&await handleSingleObjectOutput(_0x3db147,_0x57df3a),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(_0x458456){const _0x440f40=a42_0x8f79a1,_0x536771=Math[_0x440f40(0xc8)](_0x458456/0x3e8),_0x2d7f19=Math[_0x440f40(0xc8)](_0x536771/0x3c),_0x2c1550=Math[_0x440f40(0xc8)](_0x2d7f19/0x3c),_0x271cd6=Math[_0x440f40(0xc8)](_0x2c1550/0x18);if(_0x271cd6>0x0){const _0x483644=_0x2c1550%0x18;return _0x483644>0x0?_0x271cd6+'d\x20'+_0x483644+'h':_0x271cd6+'d';}else{if(_0x2c1550>0x0){const _0x2b42e4=_0x2d7f19%0x3c;return _0x2b42e4>0x0?_0x2c1550+'h\x20'+_0x2b42e4+'m':_0x2c1550+'h';}else{if(_0x2d7f19>0x0){const _0x2e8972=_0x536771%0x3c;return _0x2e8972>0x0?_0x2d7f19+'m\x20'+_0x2e8972+'s':_0x2d7f19+'m';}else return _0x536771+'s';}}}function formatTimestamp(_0x3e26ee,_0x272081){const _0x3d3148=a42_0x8f79a1,_0x2a9aea=new Date(_0x3e26ee),_0x22b3eb=String(_0x2a9aea[_0x3d3148(0x217)]())[_0x3d3148(0x8a)](0x2,'0'),_0x3b183d=String(_0x2a9aea[_0x3d3148(0x165)]())['padStart'](0x2,'0'),_0x35d7e6=_0x22b3eb+':'+_0x3b183d,_0x3d26f1=_0x2a9aea[_0x3d3148(0xe7)]()===_0x272081[_0x3d3148(0xe7)]()&&_0x2a9aea['getMonth']()===_0x272081[_0x3d3148(0x218)]()&&_0x2a9aea[_0x3d3148(0x85)]()===_0x272081[_0x3d3148(0x85)]();if(_0x3d26f1)return _0x35d7e6;else{const _0x2e868d=String(_0x2a9aea['getMonth']()+0x1)['padStart'](0x2,'0'),_0x47b4bb=String(_0x2a9aea['getDate']())[_0x3d3148(0x8a)](0x2,'0');return _0x2e868d+'-'+_0x47b4bb+'\x20'+_0x35d7e6;}}function formatDate(_0x55a979){const _0xa05131=a42_0x8f79a1,_0x5c1a0a=_0x55a979[_0xa05131(0xe7)](),_0x44e2e3=String(_0x55a979[_0xa05131(0x218)]()+0x1)[_0xa05131(0x8a)](0x2,'0'),_0x570888=String(_0x55a979[_0xa05131(0x85)]())['padStart'](0x2,'0');return _0x5c1a0a+'-'+_0x44e2e3+'-'+_0x570888;}function getTaskStateIcon(_0x4d198f){const _0x49c1d2={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x49c1d2[_0x4d198f]||'⚪';}function getBarChar(_0x2ef9fd){const _0x44d810=a42_0x8f79a1;return _0x2ef9fd===_0x44d810(0x144)||_0x2ef9fd===_0x44d810(0x10a)?'×':'─';}function getBarColor(_0x21ce86){const _0x480386=a42_0x8f79a1,_0x317a9f={'success':a42_0x18b51d[_0x480386(0x126)],'error':a42_0x18b51d[_0x480386(0xdf)],'group_error':a42_0x18b51d[_0x480386(0xdf)],'running':a42_0x18b51d['blue'],'blocked':a42_0x18b51d[_0x480386(0x128)],'planned':a42_0x18b51d[_0x480386(0xf3)],'canceling':a42_0x18b51d['yellow']};return _0x317a9f[_0x21ce86]||a42_0x18b51d[_0x480386(0x130)];}function parseTaskName(_0x41048d){const _0x3c2a8b=a42_0x8f79a1;let _0x51588f=_0x41048d[_0x3c2a8b(0x205)](/^\++/,'');const _0xb74f91=_0x51588f[_0x3c2a8b(0x13e)]('+'),_0x1c97ea=_0xb74f91[_0x3c2a8b(0x182)]>0x1?_0xb74f91['length']-0x2:0x0,_0x439b11=_0xb74f91[_0xb74f91['length']-0x1]||_0x51588f;return{'level':_0x1c97ea,'name':'+'+_0x439b11};}function truncateTaskName(_0x209cdd,_0x3f2312){const _0x3b8387=stringWidth(_0x209cdd);if(_0x3b8387<=_0x3f2312)return _0x209cdd;let _0x1cc821=_0x209cdd;while(stringWidth(_0x1cc821+'…')>_0x3f2312&&_0x1cc821['length']>0x0){_0x1cc821=_0x1cc821['slice'](0x0,-0x1);}return _0x1cc821+'…';}function calculateTimeScale(_0x3fb065,_0x1cd685){const _0x462894=a42_0x8f79a1;return{'startTime':_0x3fb065['start'],'endTime':_0x3fb065['end'],'durationMs':_0x3fb065[_0x462894(0x9c)],'msPerChar':_0x3fb065['duration']/_0x1cd685};}function timeToPosition(_0x1d4843,_0x4642c3,_0x316bfa){const _0x194a31=a42_0x8f79a1,_0x35a338=_0x1d4843-_0x4642c3[_0x194a31(0x8d)],_0x59a6f8=Math[_0x194a31(0xc8)](_0x35a338/_0x4642c3[_0x194a31(0x1e1)]);return Math[_0x194a31(0x148)](0x0,Math[_0x194a31(0x21e)](_0x59a6f8,_0x316bfa));}function renderTimeAxis(_0x4198de,_0x347604){const _0x1ac7ad=a42_0x8f79a1,_0x5f2c3b=Math[_0x1ac7ad(0x21e)](TIMELINE_CONFIG[_0x1ac7ad(0x20c)],Math[_0x1ac7ad(0x148)](TIMELINE_CONFIG[_0x1ac7ad(0x97)],Math[_0x1ac7ad(0xc8)](_0x347604/TIMELINE_CONFIG[_0x1ac7ad(0x19d)]))),_0x1a89ab=_0x4198de[_0x1ac7ad(0x129)]/(_0x5f2c3b-0x1),_0x3d1c84=new Date(_0x4198de[_0x1ac7ad(0x8d)]),_0x45028b=[];for(let _0x127e42=0x0;_0x127e42<_0x5f2c3b;_0x127e42++){const _0x3de8fe=_0x4198de['startTime']+_0x127e42*_0x1a89ab,_0x50eea7=timeToPosition(_0x3de8fe,_0x4198de,_0x347604),_0x51b613=formatTimestamp(_0x3de8fe,_0x3d1c84);_0x45028b[_0x1ac7ad(0x9b)]({'pos':_0x50eea7,'text':_0x51b613});}const _0x3f347f=new Array(_0x347604)['fill']('\x20');let _0x4ce957=-0x1;for(const {pos:_0x11403a,text:_0x2d64fb}of _0x45028b){let _0x434ca8=Math[_0x1ac7ad(0x148)](0x0,_0x11403a-Math[_0x1ac7ad(0xc8)](_0x2d64fb[_0x1ac7ad(0x182)]/0x2));_0x434ca8<=_0x4ce957+TIMELINE_CONFIG[_0x1ac7ad(0xdc)]&&(_0x434ca8=_0x4ce957+TIMELINE_CONFIG[_0x1ac7ad(0xdc)]+0x1);_0x434ca8+_0x2d64fb['length']>_0x347604&&(_0x434ca8=_0x347604-_0x2d64fb['length']);if(_0x434ca8>=0x0&&_0x434ca8+_0x2d64fb[_0x1ac7ad(0x182)]<=_0x347604&&_0x434ca8>_0x4ce957){for(let _0x53ec79=0x0;_0x53ec79<_0x2d64fb[_0x1ac7ad(0x182)];_0x53ec79++){_0x3f347f[_0x434ca8+_0x53ec79]=_0x2d64fb[_0x53ec79];}_0x4ce957=_0x434ca8+_0x2d64fb['length']-0x1;}}return _0x3f347f[_0x1ac7ad(0x204)]('');}function renderTaskRow(_0x57caff,_0x51fbd3,_0x8a2188,_0x592d2e){const _0x2d9300=a42_0x8f79a1,{level:_0x4bd47e,name:_0x14392a}=parseTaskName(_0x57caff[_0x2d9300(0x199)]),_0x298e12='\x20'[_0x2d9300(0x11b)](_0x4bd47e),_0x529ded=_0x57caff[_0x2d9300(0x185)]?'('+formatElapsed(_0x57caff['window'][_0x2d9300(0x9c)])+')':'',_0x480394=stringWidth(_0x529ded),_0x6887c6=_0x4bd47e*0x1,_0x31b8bb=_0x592d2e-_0x6887c6-_0x480394-0x1,_0x3a53ac=truncateTaskName(_0x14392a,_0x31b8bb),_0x12fccb=_0x298e12+_0x3a53ac,_0x3ebddf=stringWidth(_0x12fccb),_0x2e794a=_0x592d2e-_0x3ebddf-_0x480394,_0x36ef2c=_0x12fccb+'\x20'['repeat'](Math['max'](0x1,_0x2e794a))+a42_0x18b51d[_0x2d9300(0xf3)](_0x529ded),_0x89c8c6=getTaskStateIcon(_0x57caff['state']),_0xefcee6=new Array(_0x8a2188)[_0x2d9300(0xcf)]('\x20');if(_0x57caff[_0x2d9300(0x185)]){const _0x5093cf=timeToPosition(_0x57caff[_0x2d9300(0x185)]['start'],_0x51fbd3,_0x8a2188),_0x51771a=timeToPosition(_0x57caff[_0x2d9300(0x185)][_0x2d9300(0x1d3)],_0x51fbd3,_0x8a2188),_0x5f488c=getBarChar(_0x57caff[_0x2d9300(0x14a)]),_0x4ab024=Math['max'](_0x5093cf+0x1,_0x51771a);for(let _0x14f980=_0x5093cf;_0x14f980<Math['min'](_0x4ab024,_0x8a2188);_0x14f980++){_0xefcee6[_0x14f980]=_0x5f488c;}}const _0x5d1547=getBarColor(_0x57caff[_0x2d9300(0x14a)]),_0x5e167b=_0xefcee6[_0x2d9300(0x17b)](_0x129a52=>_0x129a52==='\x20'?'\x20':_0x5d1547(_0x129a52))[_0x2d9300(0x204)]('');return _0x89c8c6+'\x20'+_0x36ef2c+'│'+_0x5e167b+'│';}function calculateStats(_0x3f872a){const _0x345a59=a42_0x8f79a1,_0x5a1526={'total':_0x3f872a[_0x345a59(0x182)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x1aee21 of _0x3f872a){if(_0x1aee21[_0x345a59(0x14a)]===_0x345a59(0x207))_0x5a1526[_0x345a59(0x207)]++;else{if(_0x1aee21['state']===_0x345a59(0x144)||_0x1aee21['state']===_0x345a59(0x10a))_0x5a1526[_0x345a59(0x144)]++;else _0x1aee21['state']===_0x345a59(0xcb)?_0x5a1526[_0x345a59(0xcb)]++:_0x5a1526['pending']++;}}return _0x5a1526;}function formatStats(_0x4970cf){const _0x5c65ae=a42_0x8f79a1;return['Total:\x20'+_0x4970cf[_0x5c65ae(0xd2)],'✅\x20'+_0x4970cf[_0x5c65ae(0x207)],'❌\x20'+_0x4970cf[_0x5c65ae(0x144)],_0x5c65ae(0xeb)+_0x4970cf[_0x5c65ae(0xcb)],'⏳\x20'+_0x4970cf['pending']][_0x5c65ae(0x204)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a42_0x8f79a1(0x199)]=a42_0x8f79a1(0x1bc);[a42_0x8f79a1(0x15e)]=a42_0x8f79a1(0x208);async[a42_0x8f79a1(0xa4)](_0xae0f64){const _0x5bd28f=a42_0x8f79a1,{options:_0x426113,args:_0x1aebc0,tdx:_0x36c8a1}=_0xae0f64;let _0x1d91d1,_0x3e1383,_0x8bbe5a=![];if(_0x1aebc0[0x0]){if(_0x1aebc0[0x0][_0x5bd28f(0x10e)]('.')){const _0x4fec21=this['parseProjectWorkflowPattern'](_0x1aebc0,_0x426113);if(!_0x4fec21)return 0x1;_0x1d91d1=_0x4fec21[_0x5bd28f(0x123)],_0x3e1383=_0x4fec21[_0x5bd28f(0x224)];}else{_0x3e1383=_0x1aebc0[0x0],_0x1d91d1=_0x426113['workflowProject'];if(!_0x1d91d1)return console[_0x5bd28f(0x144)](a42_0x18b51d[_0x5bd28f(0xdf)](_0x5bd28f(0xa8)),_0x5bd28f(0x181)),0x1;_0x8bbe5a=!![];}}else{const _0x207e2c=this[_0x5bd28f(0x74)](_0x1aebc0,_0x426113);if(!_0x207e2c)return 0x1;_0x1d91d1=_0x207e2c['projectName'],_0x3e1383=_0x207e2c[_0x5bd28f(0x224)];}if(_0x426113['verbose']){if(_0x1d91d1&&_0x3e1383)console['error'](_0x5bd28f(0x117)+_0x1d91d1+'.'+_0x3e1383);else _0x1d91d1&&console[_0x5bd28f(0x144)]('Filter:\x20project='+_0x1d91d1);}const _0x55e0dc=_0x426113[_0x5bd28f(0x15c)],_0x3256d5=_0x426113[_0x5bd28f(0x7d)];if(_0x55e0dc){_0x3256d5&&console['error'](a42_0x18b51d[_0x5bd28f(0x128)]('Warning:'),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x864610=_0x426113['follow'];return _0x864610?await this['pollTimeline'](_0xae0f64,_0x55e0dc):await this['renderSingleTimeline'](_0xae0f64,_0x55e0dc,_0x426113),0x0;}if(_0x3256d5){const _0x8f2da1=await withSpinner(_0x5bd28f(0xed),()=>_0x36c8a1[_0x5bd28f(0x21f)][_0x5bd28f(0xdd)]({'projectName':_0x1d91d1,'workflowName':_0x3e1383,'limit':0x64}),{'verbose':_0x426113[_0x5bd28f(0xad)]}),_0x16089c=_0x8f2da1[_0x5bd28f(0xfd)]['find'](_0x2725ad=>_0x2725ad['id']===_0x3256d5);if(!_0x16089c)return console[_0x5bd28f(0x144)](a42_0x18b51d[_0x5bd28f(0xdf)](_0x5bd28f(0xa8)),_0x5bd28f(0x106)+_0x3256d5),0x1;if(!_0x16089c['lastAttempt']?.['id'])return console[_0x5bd28f(0x144)](a42_0x18b51d[_0x5bd28f(0xdf)](_0x5bd28f(0xa8)),_0x5bd28f(0x171)+_0x3256d5+_0x5bd28f(0x1ea)),0x1;const _0xa5cba7=_0x16089c[_0x5bd28f(0x1f5)]['id'];_0x426113[_0x5bd28f(0xad)]&&console[_0x5bd28f(0x144)](_0x5bd28f(0x11f)+_0xa5cba7+_0x5bd28f(0x21a)+_0x3256d5);const _0x13f814=_0x426113['follow'];return _0x13f814?await this[_0x5bd28f(0x15f)](_0xae0f64,_0xa5cba7):await this['renderSingleTimeline'](_0xae0f64,_0xa5cba7,_0x426113),0x0;}const _0x4036d7=await withSpinner(_0x5bd28f(0xf8),()=>_0x36c8a1['workflow']['sessions']({'projectName':_0x1d91d1,'workflowName':_0x3e1383,'limit':_0x426113['limit']||0x32}),{'verbose':_0x426113['verbose']}),_0x56b9e1=_0x4036d7[_0x5bd28f(0xfd)];if(_0x56b9e1[_0x5bd28f(0x182)]===0x0){if(_0x1d91d1&&_0x3e1383)console[_0x5bd28f(0x144)]('No\x20sessions\x20found\x20for:\x20'+_0x1d91d1+'.'+_0x3e1383);else _0x1d91d1?console[_0x5bd28f(0x144)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x1d91d1):(console[_0x5bd28f(0x144)](_0x5bd28f(0xb6)),console[_0x5bd28f(0x144)](a42_0x18b51d[_0x5bd28f(0xf3)](_0x5bd28f(0x125))));return 0x0;}_0x56b9e1[_0x5bd28f(0x1ed)]((_0x1ff669,_0x1d2cb4)=>{const _0x547f07=_0x5bd28f,_0x31f5ef=_0x1ff669[_0x547f07(0xcc)]||'',_0x495178=_0x1d2cb4[_0x547f07(0xcc)]||'';return _0x495178[_0x547f07(0x10f)](_0x31f5ef);});if(_0x426113['json']||_0x426113[_0x5bd28f(0x161)])return await handleSDKOutput(_0x56b9e1,_0x426113),0x0;let _0x5263d3;if(_0x8bbe5a){const _0x4c05a7=_0x56b9e1[0x0];if(!_0x4c05a7['lastAttempt']?.['id'])return console[_0x5bd28f(0x144)](_0x5bd28f(0x72)),0x0;_0x5263d3=_0x4c05a7[_0x5bd28f(0x1f5)]['id'],_0x426113['verbose']&&console[_0x5bd28f(0x144)](_0x5bd28f(0x1dd)+_0x4c05a7['sessionTime']);}else{const _0xa35ed4=_0x56b9e1[_0x5bd28f(0x17b)](_0x5c1e9b=>{const _0x379a70=_0x5bd28f,_0x5f5a36=getAttemptStatusDisplay(_0x5c1e9b['lastAttempt']);return{'title':_0x5c1e9b[_0x379a70(0x1c0)]?.[_0x379a70(0x199)]+'.'+_0x5c1e9b[_0x379a70(0x21f)]?.['name']+_0x379a70(0xf5)+_0x5c1e9b[_0x379a70(0xcc)]+'\x20'+_0x5f5a36[_0x379a70(0x78)],'value':_0x5c1e9b[_0x379a70(0x1f5)]?.['id']||'','description':_0x5f5a36['text']};}),_0x3a7f6e=await a42_0x3b7933({'type':_0x5bd28f(0x195),'name':_0x5bd28f(0x15c),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0xa35ed4['filter'](_0x448e71=>_0x448e71[_0x5bd28f(0x14f)]!=='')});if(!_0x3a7f6e[_0x5bd28f(0x15c)])return 0x0;_0x5263d3=_0x3a7f6e[_0x5bd28f(0x15c)];}const _0x5f028d=_0x426113[_0x5bd28f(0x101)];return _0x5f028d?await this[_0x5bd28f(0x15f)](_0xae0f64,_0x5263d3):await this[_0x5bd28f(0x1f9)](_0xae0f64,_0x5263d3,_0x426113),0x0;}async[a42_0x8f79a1(0x1f9)](_0x102a76,_0x38967a,_0x2d646c){const _0x57a0c4=a42_0x8f79a1,{tdx:_0x491652}=_0x102a76;let _0x2f8c09,_0x488bb4;try{[_0x2f8c09,_0x488bb4]=await Promise[_0x57a0c4(0xc3)]([_0x491652['workflow'][_0x57a0c4(0x15a)](_0x38967a),_0x491652[_0x57a0c4(0x21f)][_0x57a0c4(0x89)](_0x38967a,![])]);}catch(_0x73c316){console['error'](a42_0x18b51d['red'](_0x57a0c4(0x1d4)));_0x2d646c[_0x57a0c4(0xad)]&&console[_0x57a0c4(0x144)](_0x73c316);throw _0x73c316;}if(_0x2d646c[_0x57a0c4(0x203)]||_0x2d646c[_0x57a0c4(0x161)]){const _0x271902=this[_0x57a0c4(0x7e)](_0x2f8c09,_0x488bb4);await handleSDKOutput([_0x271902],_0x2d646c);return;}const _0x166e5b=_0x491652[_0x57a0c4(0x1e2)]['site'],_0x18a32c=this[_0x57a0c4(0xd6)](_0x2f8c09,_0x488bb4,_0x166e5b);console['log'](_0x18a32c);}async[a42_0x8f79a1(0x15f)](_0x247a64,_0x10e9a8){const _0x433324=a42_0x8f79a1,{tdx:_0x14ec09}=_0x247a64,_0x4e4d44=TIMELINE_CONFIG[_0x433324(0x21c)],_0x5947c5=TIMELINE_CONFIG[_0x433324(0x156)];let _0x2094e2=0x0;while(_0x2094e2<_0x5947c5){process[_0x433324(0x1f1)][_0x433324(0x1bd)]&&process[_0x433324(0x1f1)]['write']('\x1bc');let _0x4975de,_0x24b73c;try{[_0x4975de,_0x24b73c]=await Promise[_0x433324(0xc3)]([_0x14ec09[_0x433324(0x21f)][_0x433324(0x15a)](_0x10e9a8),_0x14ec09[_0x433324(0x21f)][_0x433324(0x89)](_0x10e9a8,![])]);}catch(_0x1716e4){console[_0x433324(0x144)](a42_0x18b51d[_0x433324(0xdf)](_0x433324(0xac)));_0x2094e2>0x0&&console['error'](a42_0x18b51d[_0x433324(0xf3)](_0x433324(0x139)+_0x2094e2));throw _0x1716e4;}const _0x58bfa8=_0x14ec09[_0x433324(0x1e2)][_0x433324(0xe8)],_0x36dbb5=this[_0x433324(0xd6)](_0x4975de,_0x24b73c,_0x58bfa8);console[_0x433324(0x7b)](_0x36dbb5);const _0x273536=_0x4975de[_0x433324(0x13d)]&&_0x24b73c[_0x433324(0x18c)](_0x4f4ab1=>_0x4f4ab1[_0x433324(0x14a)]!=='running'&&_0x4f4ab1[_0x433324(0x14a)]!==_0x433324(0xe3));if(_0x273536){console[_0x433324(0x144)](a42_0x18b51d[_0x433324(0x126)](_0x433324(0x163)));break;}console[_0x433324(0x144)](a42_0x18b51d['dim']('\x0aPolling...\x20('+_0x2094e2*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x3138a8=>setTimeout(_0x3138a8,_0x4e4d44)),_0x2094e2++;}_0x2094e2>=_0x5947c5&&console[_0x433324(0x144)](a42_0x18b51d[_0x433324(0x128)](_0x433324(0x213)));}[a42_0x8f79a1(0xd6)](_0xece34d,_0x118343,_0x51de06){const _0x1bcaa8=a42_0x8f79a1,_0x33788c=[],_0x3e01d6=TIMELINE_CONFIG[_0x1bcaa8(0xc2)],_0x3e7d7d=0x5,_0x401c80=process[_0x1bcaa8(0x1f1)]['columns']||0x78,_0x5e8a0f=_0x401c80-_0x3e01d6-_0x3e7d7d,_0x31ec1b=Math[_0x1bcaa8(0x148)](TIMELINE_CONFIG[_0x1bcaa8(0x9f)],Math[_0x1bcaa8(0x21e)](_0x5e8a0f,TIMELINE_CONFIG[_0x1bcaa8(0x1af)])),_0x2a0a5e=new Date(_0xece34d['createdAt'])['getTime'](),_0x38f822=_0xece34d['finishedAt']?new Date(_0xece34d['finishedAt'])[_0x1bcaa8(0x1a4)]():Date[_0x1bcaa8(0x140)](),_0x262dac={'start':_0x2a0a5e,'end':_0x38f822,'duration':_0x38f822-_0x2a0a5e},_0x169b81=new Map(),_0x5089bd=[];for(const _0x36a0d3 of _0x118343){if(_0x36a0d3[_0x1bcaa8(0x119)]){const _0x428370=new Date(_0x36a0d3[_0x1bcaa8(0x119)])[_0x1bcaa8(0x1a4)](),_0x161a91=_0x36a0d3['updatedAt']?new Date(_0x36a0d3[_0x1bcaa8(0x188)])[_0x1bcaa8(0x1a4)]():Date[_0x1bcaa8(0x140)](),_0x58aa7f={'start':_0x428370,'end':_0x161a91,'duration':_0x161a91-_0x428370};_0x169b81[_0x1bcaa8(0x1de)](_0x36a0d3['id'],_0x58aa7f),_0x5089bd[_0x1bcaa8(0x9b)]({'name':_0x36a0d3['fullName'],'state':_0x36a0d3[_0x1bcaa8(0x14a)]||_0x1bcaa8(0x162),'window':_0x58aa7f});}else _0x5089bd[_0x1bcaa8(0x9b)]({'name':_0x36a0d3[_0x1bcaa8(0x19e)],'state':_0x36a0d3['state']||'planned','window':undefined});}_0x5089bd['sort']((_0x1e3060,_0x590673)=>{const _0x427557=_0x1bcaa8;if(!_0x1e3060[_0x427557(0x185)])return 0x1;if(!_0x590673['window'])return-0x1;return _0x1e3060[_0x427557(0x185)][_0x427557(0x142)]-_0x590673['window'][_0x427557(0x142)];});const _0x2c34c4=_0x5089bd['length'],_0x576854=_0x2c34c4>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x576854&&_0x5089bd['splice'](TIMELINE_CONFIG[_0x1bcaa8(0x10d)]);const _0x473b39=calculateTimeScale(_0x262dac,_0x31ec1b),_0x336a50=_0xece34d[_0x1bcaa8(0x13d)]?_0xece34d[_0x1bcaa8(0x207)]?a42_0x18b51d['green'](_0x1bcaa8(0x207)):a42_0x18b51d[_0x1bcaa8(0xdf)](_0x1bcaa8(0x144)):a42_0x18b51d[_0x1bcaa8(0xa2)](_0x1bcaa8(0xcb)),_0x460dbd=_0xece34d['project']?.['id'],_0xc04612=_0xece34d[_0x1bcaa8(0x7d)];let _0x3c7a21;if(_0x460dbd&&_0xc04612){const _0x495651=getWorkflowAttemptUrl(_0x51de06,_0x460dbd,_0xc04612,_0xece34d['id']);_0x3c7a21=hyperlink(a42_0x18b51d['dim'](_0xece34d['id']),_0x495651);}else _0x3c7a21=a42_0x18b51d[_0x1bcaa8(0xf3)](_0xece34d['id']);_0x33788c[_0x1bcaa8(0x9b)](_0x1bcaa8(0x13c)+_0x3c7a21+_0x1bcaa8(0xf5)+_0x336a50+_0x1bcaa8(0xf5)+formatElapsed(_0x262dac[_0x1bcaa8(0x9c)]));if(_0x5089bd[_0x1bcaa8(0x182)]>0x0){const _0x1683d3=renderTimeAxis(_0x473b39,_0x31ec1b),_0x1c1ef8=new Date(_0x262dac['start']),_0x5f38f3=formatDate(_0x1c1ef8),_0x3b84b5=TIMELINE_CONFIG[_0x1bcaa8(0x1ff)]+TIMELINE_CONFIG[_0x1bcaa8(0x1da)]+_0x3e01d6,_0x49cf8f=_0x5f38f3['padStart'](_0x3b84b5),_0xf40eed=a42_0x18b51d['dim'](_0x49cf8f);_0x33788c[_0x1bcaa8(0x9b)](_0xf40eed+'\x20'+_0x1683d3);for(const _0x35d007 of _0x5089bd){_0x33788c[_0x1bcaa8(0x9b)](renderTaskRow(_0x35d007,_0x473b39,_0x31ec1b,_0x3e01d6));}const _0x18a7a5=calculateStats(_0x5089bd);_0x33788c[_0x1bcaa8(0x9b)](formatStats(_0x18a7a5)),_0x576854&&_0x33788c[_0x1bcaa8(0x9b)](a42_0x18b51d['yellow'](_0x1bcaa8(0x10c)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+'\x20of\x20'+_0x2c34c4+_0x1bcaa8(0x1e9))),_0x33788c[_0x1bcaa8(0x9b)](''),_0x33788c['push'](a42_0x18b51d[_0x1bcaa8(0xf3)]('💡\x20Tip:\x20Use\x20')+(_0x1bcaa8(0x147)+_0xece34d['id']+'\x20logs')+a42_0x18b51d['dim']('\x20to\x20see\x20detailed\x20logs'));}else _0x33788c['push']('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x33788c[_0x1bcaa8(0x204)]('\x0a');}[a42_0x8f79a1(0x7e)](_0xf4d0ee,_0x484afc){const _0x932d5d=a42_0x8f79a1,_0x34a599=new Date(_0xf4d0ee['createdAt'])[_0x932d5d(0x1a4)](),_0x1ffa3b=_0xf4d0ee[_0x932d5d(0x1b4)]?new Date(_0xf4d0ee['finishedAt'])[_0x932d5d(0x1a4)]():Date[_0x932d5d(0x140)](),_0x18e710=_0x1ffa3b-_0x34a599,_0x1fd096=[];for(const _0x269442 of _0x484afc){if(_0x269442['startedAt']){const _0x1eaeb9=new Date(_0x269442['startedAt'])['getTime'](),_0x47d48c=_0x269442[_0x932d5d(0x188)]?new Date(_0x269442[_0x932d5d(0x188)])[_0x932d5d(0x1a4)]():Date['now']();_0x1fd096[_0x932d5d(0x9b)]({'name':_0x269442['fullName'],'state':_0x269442[_0x932d5d(0x14a)]||'unknown','window':{'start':_0x1eaeb9,'end':_0x47d48c,'duration':_0x47d48c-_0x1eaeb9}});}else _0x1fd096[_0x932d5d(0x9b)]({'name':_0x269442[_0x932d5d(0x19e)],'state':_0x269442['state']||_0x932d5d(0xe3),'window':undefined});}const _0x1bb873=calculateStats(_0x1fd096);return{'attempt':{'id':_0xf4d0ee['id'],'status':_0xf4d0ee['done']?_0xf4d0ee[_0x932d5d(0x207)]?_0x932d5d(0x207):_0x932d5d(0x144):_0x932d5d(0xcb),'createdAt':_0xf4d0ee[_0x932d5d(0x168)],'finishedAt':_0xf4d0ee['finishedAt'],'duration_ms':_0x18e710},'tasks':_0x1fd096[_0x932d5d(0x17b)](_0x561726=>({'name':_0x561726['name'],'state':_0x561726[_0x932d5d(0x14a)],'startedAt':_0x561726[_0x932d5d(0x185)]?new Date(_0x561726[_0x932d5d(0x185)]['start'])[_0x932d5d(0x1ce)]():null,'updatedAt':_0x561726[_0x932d5d(0x185)]?new Date(_0x561726['window'][_0x932d5d(0x1d3)])[_0x932d5d(0x1ce)]():null,'duration_ms':_0x561726[_0x932d5d(0x185)]?.[_0x932d5d(0x9c)]||null})),'stats':_0x1bb873};}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x7546f,_0x527d0b){const _0x5b28a5=a43_0x57c2,_0x49603d=_0x7546f();while(!![]){try{const _0x4b9dca=-parseInt(_0x5b28a5(0xd2))/0x1+-parseInt(_0x5b28a5(0xcf))/0x2*(-parseInt(_0x5b28a5(0xc6))/0x3)+parseInt(_0x5b28a5(0xd1))/0x4+-parseInt(_0x5b28a5(0xcd))/0x5+-parseInt(_0x5b28a5(0xd5))/0x6*(-parseInt(_0x5b28a5(0xd7))/0x7)+-parseInt(_0x5b28a5(0xc9))/0x8*(parseInt(_0x5b28a5(0xc5))/0x9)+parseInt(_0x5b28a5(0xc7))/0xa*(parseInt(_0x5b28a5(0xd0))/0xb);if(_0x4b9dca===_0x527d0b)break;else _0x49603d['push'](_0x49603d['shift']());}catch(_0x318836){_0x49603d['push'](_0x49603d['shift']());}}}(a43_0x1f30,0x3169a));import{platform}from'os';import{getAPIKey}from'./config.js';function a43_0x57c2(_0x59dc26,_0x1d9c30){_0x59dc26=_0x59dc26-0xc5;const _0x1f306f=a43_0x1f30();let _0x57c2bc=_0x1f306f[_0x59dc26];return _0x57c2bc;}import{getVersion}from'./version.js';function a43_0x1f30(){const _0x5cf249=['tdx/','152bCVxjh','replace','Authorization',';\x20node/','1503105XdGfyE','tdx','157378NOGnUy','198253VuEYST','1553032GGsTNO','217768Ipuzpq','length','version','6VqPUSa','entries','683172kWBkkZ','134847ziumvO','15tVYbiE','70DhVljl'];a43_0x1f30=function(){return _0x5cf249;};return a43_0x1f30();}export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x2baa80=a43_0x57c2,_0x3e856a=getVersion(),_0x2642cd=platform(),_0x3e6cad=process[_0x2baa80(0xd4)][_0x2baa80(0xca)]('v','');return _0x2baa80(0xc8)+_0x3e856a+'\x20('+_0x2642cd+_0x2baa80(0xcc)+_0x3e6cad+')';}export function getAuthHeaders(_0x1b8aab,_0x59cc6c){const _0x39e36a=a43_0x57c2,_0x28514d=getVersion(),_0x1aaa23={'User-Agent':getUserAgent(),'X-TD-Client':_0x39e36a(0xce),'X-TD-Client-Version':_0x28514d};return _0x59cc6c&&(_0x1aaa23[_0x39e36a(0xcb)]='TD1\x20'+_0x59cc6c),_0x1aaa23;}export function toHeaderRecord(_0x2c6fd0){const _0x31743f=a43_0x57c2,_0x424c82={};for(const [_0xf00f40,_0x2d5102]of Object[_0x31743f(0xd6)](_0x2c6fd0)){_0x2d5102!==undefined&&(_0x424c82[_0xf00f40]=_0x2d5102);}return _0x424c82;}export function getTrinoHeaders(_0x1e8348,_0x2cee48){const _0x528e53=a43_0x57c2,_0x2f86ef=getAuthHeaders(_0x1e8348,_0x2cee48),_0x62283e=toHeaderRecord(_0x2f86ef);return delete _0x62283e[_0x528e53(0xcb)],_0x2cee48&&(_0x62283e['X-Trino-User']=_0x2cee48),_0x62283e;}export function hasAPIKey(_0x5e958d){const _0x357639=a43_0x57c2,_0x44b8e4=getAPIKey();return _0x44b8e4!==undefined&&_0x44b8e4[_0x357639(0xd3)]>0x0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4c8bf5,_0x682fd7){const _0x29bf60=a44_0x242b,_0x4516d2=_0x4c8bf5();while(!![]){try{const _0x153508=parseInt(_0x29bf60(0x226))/0x1+parseInt(_0x29bf60(0x212))/0x2*(parseInt(_0x29bf60(0x1f1))/0x3)+-parseInt(_0x29bf60(0x234))/0x4+parseInt(_0x29bf60(0x201))/0x5*(parseInt(_0x29bf60(0x1fb))/0x6)+-parseInt(_0x29bf60(0x207))/0x7+-parseInt(_0x29bf60(0x235))/0x8*(-parseInt(_0x29bf60(0x208))/0x9)+-parseInt(_0x29bf60(0x1fa))/0xa*(parseInt(_0x29bf60(0x202))/0xb);if(_0x153508===_0x682fd7)break;else _0x4516d2['push'](_0x4516d2['shift']());}catch(_0xdbd15f){_0x4516d2['push'](_0x4516d2['shift']());}}}(a44_0x382e,0x72550));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a44_0x2d71d9 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x29a384){const _0x46b826=a44_0x242b;return _0x29a384['format']==='json'||_0x29a384[_0x46b826(0x200)]==='jsonl'||_0x29a384['format']===_0x46b826(0x1ff)||_0x29a384['format']===_0x46b826(0x1f2)||_0x29a384[_0x46b826(0x203)]===!![]||_0x29a384['jsonl']===!![]||_0x29a384[_0x46b826(0x1ff)]===!![]||_0x29a384[_0x46b826(0x1f2)]===!![];}export function parseOutputOptions(_0x333239){const _0x440c16=a44_0x242b;return{'format':_0x333239[_0x440c16(0x200)]||_0x440c16(0x1f2),'output':_0x333239[_0x440c16(0x20e)]||'','limit':_0x333239[_0x440c16(0x220)],'color':_0x333239[_0x440c16(0x227)],'noColor':_0x333239[_0x440c16(0x217)]};}function convertSDKResultToQueryResult(_0x4ff2d6){const _0x452048=a44_0x242b,_0x4be2ea=[];if(_0x4ff2d6[_0x452048(0x232)]>0x0){const _0x5de33a=_0x4ff2d6[0x0];for(const [_0x14bd10,_0x5e97b8]of Object[_0x452048(0x1f5)](_0x5de33a)){let _0x1db992=_0x452048(0x219);if(typeof _0x5e97b8===_0x452048(0x23a))_0x1db992=Number[_0x452048(0x215)](_0x5e97b8)?_0x452048(0x218):_0x452048(0x1f6);else{if(typeof _0x5e97b8===_0x452048(0x21b))_0x1db992=_0x452048(0x21b);else _0x5e97b8===null&&(_0x1db992='varchar');}_0x4be2ea[_0x452048(0x224)]({'name':_0x14bd10,'type':_0x1db992});}}return{'queryId':_0x452048(0x223),'columns':_0x4be2ea,'data':_0x4ff2d6,'stats':{'state':_0x452048(0x231),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x4ff2d6['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x5d2d45,_0x572c27){const _0x392157=convertSDKResultToQueryResult(_0x5d2d45);return formatQueryOutput(_0x392157,_0x572c27);}export async function formatQueryOutput(_0x588b91,_0x297b3c){const _0x26f1da=a44_0x242b,{format:_0x50d383,limit:_0x53865c,output:_0x4765f4,color:_0x259a9d,noColor:_0xaf3076}=_0x297b3c,_0x2f1440=Boolean(_0x4765f4)&&!_0x259a9d,_0x289342={'color':_0x259a9d,'noColor':_0xaf3076||_0x2f1440};if(_0x50d383==='table'){const _0x19fe03=shouldUseLess(_0x50d383,_0x4765f4);return formatAsTable(_0x588b91,_0x53865c,_0x19fe03,_0x289342);}else{if(_0x50d383===_0x26f1da(0x203))return formatAsJSON(_0x588b91,_0x289342);else return _0x50d383===_0x26f1da(0x20f)?formatAsJSONL(_0x588b91,_0x289342):formatQueryResult(_0x588b91,_0x50d383);}}function shouldUseLess(_0x1a7df4,_0x4a84cc){const _0x262911=a44_0x242b;return(_0x1a7df4===_0x262911(0x1f2)||_0x1a7df4===_0x262911(0x233))&&process['stdout'][_0x262911(0x1f3)]&&!_0x4a84cc;}export function resolveOutputOptions(_0x2fe0fc){const _0x57c394=a44_0x242b,_0x1ad8e4=resolveOutputFormat(_0x2fe0fc['format'],_0x2fe0fc[_0x57c394(0x20e)],'table');let _0x3f516f=typeof _0x2fe0fc[_0x57c394(0x220)]===_0x57c394(0x23a)?_0x2fe0fc['limit']:parseInt(_0x2fe0fc[_0x57c394(0x220)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x15f9f9=_0x2fe0fc[_0x57c394(0x20e)]||'';return shouldUseLess(_0x1ad8e4,_0x15f9f9)&&(_0x3f516f=Infinity),{'format':_0x1ad8e4,'output':_0x15f9f9,'limit':_0x3f516f,'color':_0x2fe0fc[_0x57c394(0x227)],'noColor':_0x2fe0fc[_0x57c394(0x217)]};}function a44_0x242b(_0x43593c,_0x5d0e73){_0x43593c=_0x43593c-0x1f1;const _0x382e8e=a44_0x382e();let _0x242bd6=_0x382e8e[_0x43593c];return _0x242bd6;}function a44_0x382e(){const _0x25b440=['query','repeat','No\x20data','FINISHED','length','list','41028gUsRLR','6339736vCqmrE','[query]','forEach','max','padEnd','number','54195hgbyHT','table','isTTY','keys','entries','double','[error]','resolve','error','50qpzHin','6FUfhiz','split','rule','cyan','tsv','format','869605pFpQNd','2480071UaZSQt','json','pipe','[rule]','end','4035101VYWXEU','9MJiyvk','map','[params]','inherit','params','Results\x20saved\x20to\x20','output','jsonl','-FXRSn','blue','98kKMlzi','[Object]','stdin','isInteger','cmdout','noColor','bigint','varchar','trim','boolean','write','bold','stderr','yellow','limit','filter','less','sdk-result','push','object','330736ozbJRu','color','debug','─┴─','red','stringify','join','[logs]'];a44_0x382e=function(){return _0x25b440;};return a44_0x382e();}export function writeOutput(_0x535a0a,_0x3fef67,_0xef08c3){const _0x5d72d5=a44_0x242b;return _0x3fef67?(writeFileSync(_0x3fef67,_0x535a0a),console[_0x5d72d5(0x1f9)](_0x5d72d5(0x20d)+_0x3fef67),Promise['resolve']()):shouldUseLess(_0xef08c3||'','')?new Promise(_0x4be4f5=>{const _0x4888e7=_0x5d72d5,_0x32fa3e=spawn(_0x4888e7(0x222),[_0x4888e7(0x210)],{'stdio':[_0x4888e7(0x204),'inherit',_0x4888e7(0x20b)]});let _0x85a139=![];_0x32fa3e['on']('error',()=>{!_0x85a139&&(_0x85a139=!![],console['log'](_0x535a0a),_0x4be4f5());}),_0x32fa3e['on']('close',()=>{!_0x85a139&&(_0x85a139=!![],_0x4be4f5());}),_0x32fa3e['on']('spawn',()=>{const _0x1cb55a=_0x4888e7;!_0x85a139&&_0x32fa3e['stdin']&&(_0x32fa3e['stdin']['on']('error',()=>{}),_0x32fa3e[_0x1cb55a(0x214)][_0x1cb55a(0x21c)](_0x535a0a),_0x32fa3e['stdin'][_0x1cb55a(0x206)]());}),!_0x32fa3e['stdin']&&(!_0x85a139&&(_0x85a139=!![],console['log'](_0x535a0a),_0x4be4f5()));}):(console['log'](_0x535a0a),Promise[_0x5d72d5(0x1f8)]());}export async function handleSDKOutput(_0x523065,_0x4a8904){const _0x47ff9c=a44_0x242b,_0x59d929=resolveOutputOptions(_0x4a8904),_0x9dcf11=await formatSDKOutput(_0x523065,_0x59d929);await writeOutput(_0x9dcf11,_0x59d929[_0x47ff9c(0x20e)]||undefined,_0x59d929['format']);}export async function handleQueryOutput(_0xfef69f,_0x1c0d4f){const _0x1d18c2=a44_0x242b,_0x156ccd=resolveOutputOptions(_0x1c0d4f),_0xd96f4d=await formatQueryOutput(_0xfef69f,_0x156ccd);await writeOutput(_0xd96f4d,_0x156ccd[_0x1d18c2(0x20e)]||undefined,_0x156ccd[_0x1d18c2(0x200)]);}async function formatSingleObject(_0x4c4761,_0x5aea04){const _0x2d1eb6=a44_0x242b,{format:_0x5d030d,color:_0x451d02,noColor:_0x459b5d}=_0x5aea04,_0x4f9722={'color':_0x451d02,'noColor':_0x459b5d};if(_0x5d030d===_0x2d1eb6(0x203)){if(shouldUseColor(_0x4f9722))return colorizeJSON(_0x4c4761,_0x4f9722);return JSON['stringify'](_0x4c4761,null,0x2);}else{if(_0x5d030d===_0x2d1eb6(0x20f)){if(shouldUseColor(_0x4f9722))return colorizeJSONCompact(_0x4c4761,_0x4f9722);return JSON['stringify'](_0x4c4761);}else{if(_0x5d030d===_0x2d1eb6(0x1ff))return Object[_0x2d1eb6(0x1f5)](_0x4c4761)['map'](([_0x476fd5,_0x5809d8])=>_0x476fd5+'\x09'+_0x5809d8)[_0x2d1eb6(0x22c)]('\x0a');else{const _0x1b9aca=Object['entries'](_0x4c4761);if(_0x1b9aca[_0x2d1eb6(0x232)]===0x0)return _0x2d1eb6(0x230);const _0x36ce69=_0x4c4761[_0x2d1eb6(0x228)],_0x4c9346=_0x4c4761['query'],_0x107540=_0x4c4761[_0x2d1eb6(0x20c)],_0x46f4e5=_0x4c4761[_0x2d1eb6(0x1fd)],_0x53e150=_0x4c9346?typeof _0x4c9346==='string'?_0x4c9346:JSON[_0x2d1eb6(0x22b)](_0x4c9346,null,0x2):undefined,_0x28b16d=_0x107540&&Object[_0x2d1eb6(0x1f4)](_0x107540)['length']>0x0?JSON[_0x2d1eb6(0x22b)](_0x107540,null,0x2):undefined,_0x3479b0=_0x46f4e5&&Object[_0x2d1eb6(0x1f4)](_0x46f4e5)[_0x2d1eb6(0x232)]>0x0?JSON[_0x2d1eb6(0x22b)](_0x46f4e5,null,0x2):undefined,_0x219bbd=_0x1b9aca[_0x2d1eb6(0x221)](([_0x5da5c1])=>_0x5da5c1!=='debug'&&_0x5da5c1!==_0x2d1eb6(0x22e)&&_0x5da5c1!=='params'&&_0x5da5c1!==_0x2d1eb6(0x1fd)),_0x528c2e=Math[_0x2d1eb6(0x238)](..._0x219bbd['map'](([_0x3dcf7b])=>_0x3dcf7b[_0x2d1eb6(0x232)])),_0x1b26e1=Math[_0x2d1eb6(0x238)](..._0x219bbd[_0x2d1eb6(0x209)](([,_0x25e6bd])=>{const _0x5a40ea=_0x2d1eb6;try{const _0x2512f8=_0x25e6bd===null||_0x25e6bd===undefined?'':typeof _0x25e6bd===_0x5a40ea(0x225)?JSON[_0x5a40ea(0x22b)](_0x25e6bd):String(_0x25e6bd),_0x56b20a=_0x2512f8[_0x5a40ea(0x1fc)]('\x0a');return Math['max'](..._0x56b20a[_0x5a40ea(0x209)](_0x199565=>_0x199565[_0x5a40ea(0x232)]),0x0);}catch{return 0x0;}}),0x14),_0x397639=[];_0x397639[_0x2d1eb6(0x224)](colorBorder('┌─'+'─'[_0x2d1eb6(0x22f)](_0x528c2e)+'─┬─'+'─'[_0x2d1eb6(0x22f)](_0x1b26e1)+'─┐',_0x4f9722)),_0x219bbd[_0x2d1eb6(0x237)](([_0x9b5489,_0x193ec9])=>{const _0x3e917d=_0x2d1eb6;let _0x476f8d;try{_0x476f8d=_0x193ec9===null||_0x193ec9===undefined?'':typeof _0x193ec9===_0x3e917d(0x225)?JSON['stringify'](_0x193ec9):String(_0x193ec9);}catch{_0x476f8d=_0x3e917d(0x213);}const _0x106861=_0x9b5489[_0x3e917d(0x239)](_0x528c2e),_0x39c839=_0x476f8d[_0x3e917d(0x1fc)]('\x0a');_0x39c839[_0x3e917d(0x237)]((_0x4cf22d,_0x17c980)=>{const _0x4243a2=_0x3e917d,_0x91b99a=colorBorder('│',_0x4f9722);_0x17c980===0x0?_0x397639[_0x4243a2(0x224)](_0x91b99a+'\x20'+_0x106861+'\x20'+_0x91b99a+'\x20'+_0x4cf22d['padEnd'](_0x1b26e1)+'\x20'+_0x91b99a):_0x397639[_0x4243a2(0x224)](_0x91b99a+'\x20'+'\x20'[_0x4243a2(0x22f)](_0x528c2e)+'\x20'+_0x91b99a+'\x20'+_0x4cf22d[_0x4243a2(0x239)](_0x1b26e1)+'\x20'+_0x91b99a);});}),_0x397639[_0x2d1eb6(0x224)](colorBorder('└─'+'─'[_0x2d1eb6(0x22f)](_0x528c2e)+_0x2d1eb6(0x229)+'─'[_0x2d1eb6(0x22f)](_0x1b26e1)+'─┘',_0x4f9722));_0x53e150&&(_0x397639['push'](''),_0x397639['push'](String(a44_0x2d71d9[_0x2d1eb6(0x21f)]['bold'](_0x2d1eb6(0x236)))),_0x397639[_0x2d1eb6(0x224)](_0x53e150));_0x28b16d&&(_0x397639['push'](''),_0x397639[_0x2d1eb6(0x224)](String(a44_0x2d71d9[_0x2d1eb6(0x211)][_0x2d1eb6(0x21d)](_0x2d1eb6(0x20a)))),_0x397639[_0x2d1eb6(0x224)](_0x28b16d));_0x3479b0&&(_0x397639['push'](''),_0x397639[_0x2d1eb6(0x224)](String(a44_0x2d71d9['magenta'][_0x2d1eb6(0x21d)](_0x2d1eb6(0x205)))),_0x397639['push'](_0x3479b0));if(_0x36ce69){if(_0x36ce69[_0x2d1eb6(0x21e)]){_0x397639[_0x2d1eb6(0x224)](''),_0x397639[_0x2d1eb6(0x224)](String(a44_0x2d71d9[_0x2d1eb6(0x22a)][_0x2d1eb6(0x21d)](_0x2d1eb6(0x1f7))));const _0x4ab5b3=_0x36ce69['stderr'][_0x2d1eb6(0x1fc)]('\x0a');_0x4ab5b3[_0x2d1eb6(0x237)](_0x230031=>{const _0x1c255a=_0x2d1eb6;_0x230031[_0x1c255a(0x21a)]()&&_0x397639[_0x1c255a(0x224)](_0x230031);});}if(_0x36ce69['cmdout']){_0x397639[_0x2d1eb6(0x224)](''),_0x397639[_0x2d1eb6(0x224)](String(a44_0x2d71d9[_0x2d1eb6(0x1fe)][_0x2d1eb6(0x21d)](_0x2d1eb6(0x22d))));const _0x16e6a5=_0x36ce69[_0x2d1eb6(0x216)][_0x2d1eb6(0x1fc)]('\x0a');_0x16e6a5[_0x2d1eb6(0x237)](_0x14a997=>{const _0x33bf8e=_0x2d1eb6;_0x14a997[_0x33bf8e(0x21a)]()&&_0x397639[_0x33bf8e(0x224)](_0x14a997);});}}return _0x397639['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0xbff3a3,_0x505b5b){const _0x598a07=a44_0x242b;if(_0x505b5b['format']==='table'){await handleSDKOutput([_0xbff3a3],_0x505b5b);return;}const _0x45d444=resolveOutputOptions(_0x505b5b),_0x503d95=await formatSingleObject(_0xbff3a3,_0x45d444);await writeOutput(_0x503d95,_0x45d444[_0x598a07(0x20e)]||undefined,_0x45d444[_0x598a07(0x200)]);}
|
|
1
|
+
(function(_0x3e51d0,_0x2b6c4d){const _0x3fcae4=a44_0x2f94,_0x2b046e=_0x3e51d0();while(!![]){try{const _0x2342bd=parseInt(_0x3fcae4(0x193))/0x1+-parseInt(_0x3fcae4(0x18a))/0x2*(parseInt(_0x3fcae4(0x1c3))/0x3)+-parseInt(_0x3fcae4(0x1c7))/0x4*(-parseInt(_0x3fcae4(0x197))/0x5)+-parseInt(_0x3fcae4(0x1c9))/0x6+-parseInt(_0x3fcae4(0x1bd))/0x7*(-parseInt(_0x3fcae4(0x1ac))/0x8)+-parseInt(_0x3fcae4(0x1a3))/0x9*(-parseInt(_0x3fcae4(0x1c0))/0xa)+-parseInt(_0x3fcae4(0x198))/0xb;if(_0x2342bd===_0x2b6c4d)break;else _0x2b046e['push'](_0x2b046e['shift']());}catch(_0x1de8af){_0x2b046e['push'](_0x2b046e['shift']());}}}(a44_0x5bd5,0x2d95a));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';function a44_0x2f94(_0x3c9d30,_0x494d14){_0x3c9d30=_0x3c9d30-0x18a;const _0x5bd5a8=a44_0x5bd5();let _0x2f9461=_0x5bd5a8[_0x3c9d30];return _0x2f9461;}import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a44_0x3fc7a2 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x3302ce){const _0x54994f=a44_0x2f94;return _0x3302ce[_0x54994f(0x18b)]===_0x54994f(0x1c1)||_0x3302ce[_0x54994f(0x18b)]===_0x54994f(0x1ba)||_0x3302ce[_0x54994f(0x18b)]===_0x54994f(0x1a5)||_0x3302ce['format']===_0x54994f(0x1a6)||_0x3302ce['json']===!![]||_0x3302ce[_0x54994f(0x1ba)]===!![]||_0x3302ce[_0x54994f(0x1a5)]===!![]||_0x3302ce['table']===!![];}export function parseOutputOptions(_0x21c5ed){const _0x6130a2=a44_0x2f94;return{'format':_0x21c5ed['format']||_0x6130a2(0x1a6),'output':_0x21c5ed[_0x6130a2(0x1a9)]||'','limit':_0x21c5ed[_0x6130a2(0x1b2)],'color':_0x21c5ed[_0x6130a2(0x1c5)],'noColor':_0x21c5ed['noColor']};}function a44_0x5bd5(){const _0x251fa3=['318998mgQPku','format','blue','forEach','end','─┬─','bold','less','stringify','115362cViyUc','split','query','FINISHED','854065MRXPqM','2714580HMNfzs','rule','keys','sdk-result','yellow','[error]','cmdout','params','cyan','map','push','2637PPxTGc','isInteger','tsv','table','[query]','boolean','output','padEnd','noColor','144832pegPEu','bigint','magenta','object','stdin','log','limit','spawn','join','repeat','resolve','debug','entries','trim','jsonl','─┴─','stdout','119RWWwdk','No\x20data','number','11260SYvVsd','json','[logs]','6MuJhJz','pipe','color','varchar','4JDSAAm','stderr','1028214kChVxe','max','double','isTTY','error','length','write','[params]','list','red'];a44_0x5bd5=function(){return _0x251fa3;};return a44_0x5bd5();}function convertSDKResultToQueryResult(_0x16151f){const _0xbb4d24=a44_0x2f94,_0x4606d7=[];if(_0x16151f[_0xbb4d24(0x1ce)]>0x0){const _0x4c44cd=_0x16151f[0x0];for(const [_0x2cf94a,_0x5e7e54]of Object[_0xbb4d24(0x1b8)](_0x4c44cd)){let _0x4c705f=_0xbb4d24(0x1c6);if(typeof _0x5e7e54===_0xbb4d24(0x1bf))_0x4c705f=Number[_0xbb4d24(0x1a4)](_0x5e7e54)?_0xbb4d24(0x1ad):_0xbb4d24(0x1cb);else{if(typeof _0x5e7e54===_0xbb4d24(0x1a8))_0x4c705f=_0xbb4d24(0x1a8);else _0x5e7e54===null&&(_0x4c705f=_0xbb4d24(0x1c6));}_0x4606d7[_0xbb4d24(0x1a2)]({'name':_0x2cf94a,'type':_0x4c705f});}}return{'queryId':_0xbb4d24(0x19b),'columns':_0x4606d7,'data':_0x16151f,'stats':{'state':_0xbb4d24(0x196),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x16151f[_0xbb4d24(0x1ce)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x2cb84e,_0x498455){const _0x46411d=convertSDKResultToQueryResult(_0x2cb84e);return formatQueryOutput(_0x46411d,_0x498455);}export async function formatQueryOutput(_0x296aed,_0x56d856){const _0x29d1cf=a44_0x2f94,{format:_0x25b682,limit:_0x26bf53,output:_0x361cdb,color:_0x4c77de,noColor:_0x1f8940}=_0x56d856,_0x430f0e=Boolean(_0x361cdb)&&!_0x4c77de,_0x2f0031={'color':_0x4c77de,'noColor':_0x1f8940||_0x430f0e};if(_0x25b682===_0x29d1cf(0x1a6)){const _0x5ab8fc=shouldUseLess(_0x25b682,_0x361cdb);return formatAsTable(_0x296aed,_0x26bf53,_0x5ab8fc,_0x2f0031);}else{if(_0x25b682===_0x29d1cf(0x1c1))return formatAsJSON(_0x296aed,_0x2f0031);else return _0x25b682===_0x29d1cf(0x1ba)?formatAsJSONL(_0x296aed,_0x2f0031):formatQueryResult(_0x296aed,_0x25b682);}}function shouldUseLess(_0x23d3af,_0x6bb2c6){const _0xb4c9f5=a44_0x2f94;return(_0x23d3af===_0xb4c9f5(0x1a6)||_0x23d3af===_0xb4c9f5(0x1d1))&&process[_0xb4c9f5(0x1bc)][_0xb4c9f5(0x1cc)]&&!_0x6bb2c6;}export function resolveOutputOptions(_0x233759){const _0x26e6a1=a44_0x2f94,_0x4c2b63=resolveOutputFormat(_0x233759[_0x26e6a1(0x18b)],_0x233759[_0x26e6a1(0x1a9)],_0x26e6a1(0x1a6));let _0x505d84=typeof _0x233759[_0x26e6a1(0x1b2)]===_0x26e6a1(0x1bf)?_0x233759[_0x26e6a1(0x1b2)]:parseInt(_0x233759[_0x26e6a1(0x1b2)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x254d38=_0x233759[_0x26e6a1(0x1a9)]||'';return shouldUseLess(_0x4c2b63,_0x254d38)&&(_0x505d84=Infinity),{'format':_0x4c2b63,'output':_0x254d38,'limit':_0x505d84,'color':_0x233759['color'],'noColor':_0x233759[_0x26e6a1(0x1ab)]};}export function writeOutput(_0x2776e6,_0x2efbbf,_0x255dc2){const _0x549898=a44_0x2f94;return _0x2efbbf?(writeFileSync(_0x2efbbf,_0x2776e6),console[_0x549898(0x1cd)]('Results\x20saved\x20to\x20'+_0x2efbbf),Promise[_0x549898(0x1b6)]()):shouldUseLess(_0x255dc2||'','')?new Promise(_0x387257=>{const _0x3969e0=_0x549898,_0x44c315=spawn(_0x3969e0(0x191),['-FXRSn'],{'stdio':[_0x3969e0(0x1c4),'inherit','inherit']});let _0x5c4b80=![];_0x44c315['on'](_0x3969e0(0x1cd),()=>{const _0x2442ea=_0x3969e0;!_0x5c4b80&&(_0x5c4b80=!![],console[_0x2442ea(0x1b1)](_0x2776e6),_0x387257());}),_0x44c315['on']('close',()=>{!_0x5c4b80&&(_0x5c4b80=!![],_0x387257());}),_0x44c315['on'](_0x3969e0(0x1b3),()=>{const _0x504002=_0x3969e0;!_0x5c4b80&&_0x44c315[_0x504002(0x1b0)]&&(_0x44c315[_0x504002(0x1b0)]['on'](_0x504002(0x1cd),()=>{}),_0x44c315['stdin'][_0x504002(0x1cf)](_0x2776e6),_0x44c315[_0x504002(0x1b0)][_0x504002(0x18e)]());}),!_0x44c315[_0x3969e0(0x1b0)]&&(!_0x5c4b80&&(_0x5c4b80=!![],console[_0x3969e0(0x1b1)](_0x2776e6),_0x387257()));}):(console[_0x549898(0x1b1)](_0x2776e6),Promise[_0x549898(0x1b6)]());}export async function handleSDKOutput(_0x2db993,_0x5035c9){const _0x26ced7=a44_0x2f94,_0x49651e=resolveOutputOptions(_0x5035c9),_0x417481=await formatSDKOutput(_0x2db993,_0x49651e);await writeOutput(_0x417481,_0x49651e['output']||undefined,_0x49651e[_0x26ced7(0x18b)]);}export async function handleQueryOutput(_0x45cbda,_0x416b3c){const _0x242d39=a44_0x2f94,_0x2018c2=resolveOutputOptions(_0x416b3c),_0x1a27be=await formatQueryOutput(_0x45cbda,_0x2018c2);await writeOutput(_0x1a27be,_0x2018c2[_0x242d39(0x1a9)]||undefined,_0x2018c2[_0x242d39(0x18b)]);}async function formatSingleObject(_0x3aa6a3,_0x355907){const _0x51e23b=a44_0x2f94,{format:_0x4ce5a8,color:_0x29cf4b,noColor:_0x4c5757}=_0x355907,_0x3863db={'color':_0x29cf4b,'noColor':_0x4c5757};if(_0x4ce5a8==='json'){if(shouldUseColor(_0x3863db))return colorizeJSON(_0x3aa6a3,_0x3863db);return JSON['stringify'](_0x3aa6a3,null,0x2);}else{if(_0x4ce5a8===_0x51e23b(0x1ba)){if(shouldUseColor(_0x3863db))return colorizeJSONCompact(_0x3aa6a3,_0x3863db);return JSON[_0x51e23b(0x192)](_0x3aa6a3);}else{if(_0x4ce5a8===_0x51e23b(0x1a5))return Object[_0x51e23b(0x1b8)](_0x3aa6a3)[_0x51e23b(0x1a1)](([_0x8343d8,_0x3d2053])=>_0x8343d8+'\x09'+_0x3d2053)[_0x51e23b(0x1b4)]('\x0a');else{const _0x2b9502=Object[_0x51e23b(0x1b8)](_0x3aa6a3);if(_0x2b9502['length']===0x0)return _0x51e23b(0x1be);const _0x3bdc04=_0x3aa6a3[_0x51e23b(0x1b7)],_0x1ced6f=_0x3aa6a3['query'],_0x131c9b=_0x3aa6a3[_0x51e23b(0x19f)],_0x40363a=_0x3aa6a3[_0x51e23b(0x199)],_0x457368=_0x1ced6f?typeof _0x1ced6f==='string'?_0x1ced6f:JSON[_0x51e23b(0x192)](_0x1ced6f,null,0x2):undefined,_0x519f33=_0x131c9b&&Object[_0x51e23b(0x19a)](_0x131c9b)[_0x51e23b(0x1ce)]>0x0?JSON['stringify'](_0x131c9b,null,0x2):undefined,_0x24a0c8=_0x40363a&&Object[_0x51e23b(0x19a)](_0x40363a)[_0x51e23b(0x1ce)]>0x0?JSON[_0x51e23b(0x192)](_0x40363a,null,0x2):undefined,_0x22dc53=_0x2b9502['filter'](([_0x2fa07f])=>_0x2fa07f!==_0x51e23b(0x1b7)&&_0x2fa07f!==_0x51e23b(0x195)&&_0x2fa07f!==_0x51e23b(0x19f)&&_0x2fa07f!=='rule'),_0x3f36b3=Math[_0x51e23b(0x1ca)](..._0x22dc53[_0x51e23b(0x1a1)](([_0x59c66e])=>_0x59c66e[_0x51e23b(0x1ce)])),_0x4df7c2=Math[_0x51e23b(0x1ca)](..._0x22dc53[_0x51e23b(0x1a1)](([,_0x288161])=>{const _0x50cdbd=_0x51e23b;try{const _0x27f885=_0x288161===null||_0x288161===undefined?'':typeof _0x288161===_0x50cdbd(0x1af)?JSON[_0x50cdbd(0x192)](_0x288161):String(_0x288161),_0x117581=_0x27f885[_0x50cdbd(0x194)]('\x0a');return Math['max'](..._0x117581[_0x50cdbd(0x1a1)](_0x4397de=>_0x4397de[_0x50cdbd(0x1ce)]),0x0);}catch{return 0x0;}}),0x14),_0x48636c=[];_0x48636c[_0x51e23b(0x1a2)](colorBorder('┌─'+'─'['repeat'](_0x3f36b3)+_0x51e23b(0x18f)+'─'[_0x51e23b(0x1b5)](_0x4df7c2)+'─┐',_0x3863db)),_0x22dc53[_0x51e23b(0x18d)](([_0x37a00a,_0x3ce671])=>{let _0x2f33ca;try{_0x2f33ca=_0x3ce671===null||_0x3ce671===undefined?'':typeof _0x3ce671==='object'?JSON['stringify'](_0x3ce671):String(_0x3ce671);}catch{_0x2f33ca='[Object]';}const _0x15c8b4=_0x37a00a['padEnd'](_0x3f36b3),_0x393889=_0x2f33ca['split']('\x0a');_0x393889['forEach']((_0x406cc2,_0x4bbc64)=>{const _0x1e3cc7=a44_0x2f94,_0x2c50b5=colorBorder('│',_0x3863db);_0x4bbc64===0x0?_0x48636c['push'](_0x2c50b5+'\x20'+_0x15c8b4+'\x20'+_0x2c50b5+'\x20'+_0x406cc2['padEnd'](_0x4df7c2)+'\x20'+_0x2c50b5):_0x48636c[_0x1e3cc7(0x1a2)](_0x2c50b5+'\x20'+'\x20'['repeat'](_0x3f36b3)+'\x20'+_0x2c50b5+'\x20'+_0x406cc2[_0x1e3cc7(0x1aa)](_0x4df7c2)+'\x20'+_0x2c50b5);});}),_0x48636c[_0x51e23b(0x1a2)](colorBorder('└─'+'─'[_0x51e23b(0x1b5)](_0x3f36b3)+_0x51e23b(0x1bb)+'─'[_0x51e23b(0x1b5)](_0x4df7c2)+'─┘',_0x3863db));_0x457368&&(_0x48636c[_0x51e23b(0x1a2)](''),_0x48636c['push'](String(a44_0x3fc7a2[_0x51e23b(0x19c)][_0x51e23b(0x190)](_0x51e23b(0x1a7)))),_0x48636c[_0x51e23b(0x1a2)](_0x457368));_0x519f33&&(_0x48636c[_0x51e23b(0x1a2)](''),_0x48636c['push'](String(a44_0x3fc7a2[_0x51e23b(0x18c)]['bold'](_0x51e23b(0x1d0)))),_0x48636c['push'](_0x519f33));_0x24a0c8&&(_0x48636c[_0x51e23b(0x1a2)](''),_0x48636c[_0x51e23b(0x1a2)](String(a44_0x3fc7a2[_0x51e23b(0x1ae)][_0x51e23b(0x190)]('[rule]'))),_0x48636c[_0x51e23b(0x1a2)](_0x24a0c8));if(_0x3bdc04){if(_0x3bdc04[_0x51e23b(0x1c8)]){_0x48636c[_0x51e23b(0x1a2)](''),_0x48636c['push'](String(a44_0x3fc7a2[_0x51e23b(0x1d2)][_0x51e23b(0x190)](_0x51e23b(0x19d))));const _0x20f288=_0x3bdc04[_0x51e23b(0x1c8)][_0x51e23b(0x194)]('\x0a');_0x20f288[_0x51e23b(0x18d)](_0xa2391=>{const _0x4f7020=_0x51e23b;_0xa2391[_0x4f7020(0x1b9)]()&&_0x48636c[_0x4f7020(0x1a2)](_0xa2391);});}if(_0x3bdc04[_0x51e23b(0x19e)]){_0x48636c[_0x51e23b(0x1a2)](''),_0x48636c[_0x51e23b(0x1a2)](String(a44_0x3fc7a2[_0x51e23b(0x1a0)]['bold'](_0x51e23b(0x1c2))));const _0xc095a0=_0x3bdc04[_0x51e23b(0x19e)][_0x51e23b(0x194)]('\x0a');_0xc095a0[_0x51e23b(0x18d)](_0x1f326e=>{const _0x4c618e=_0x51e23b;_0x1f326e['trim']()&&_0x48636c[_0x4c618e(0x1a2)](_0x1f326e);});}}return _0x48636c[_0x51e23b(0x1b4)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x5bc375,_0xf3c60b){const _0x59457d=a44_0x2f94;if(_0xf3c60b['format']===_0x59457d(0x1a6)){await handleSDKOutput([_0x5bc375],_0xf3c60b);return;}const _0x418c2b=resolveOutputOptions(_0xf3c60b),_0x56bc82=await formatSingleObject(_0x5bc375,_0x418c2b);await writeOutput(_0x56bc82,_0x418c2b[_0x59457d(0x1a9)]||undefined,_0x418c2b[_0x59457d(0x18b)]);}
|