@treasuredata/tdx 0.16.2 → 0.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/mcp-command.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/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js.map +1 -1
- package/dist/sdk/claude-agent/environment.d.ts +9 -0
- package/dist/sdk/claude-agent/environment.d.ts.map +1 -1
- package/dist/sdk/claude-agent/environment.js +1 -1
- package/dist/sdk/claude-agent/environment.js.map +1 -1
- package/dist/sdk/claude-agent/index.js +1 -1
- package/dist/sdk/claude-agent/system-prompts.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.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.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a41_0x41ef9d=a41_0x7e35;(function(_0x133be8,_0x57d99b){const _0x20f578=a41_0x7e35,_0x29984a=_0x133be8();while(!![]){try{const _0x48d857=-parseInt(_0x20f578(0x1e3))/0x1*(parseInt(_0x20f578(0x13c))/0x2)+-parseInt(_0x20f578(0x8d))/0x3+-parseInt(_0x20f578(0x9e))/0x4*(-parseInt(_0x20f578(0xad))/0x5)+parseInt(_0x20f578(0xb9))/0x6+parseInt(_0x20f578(0x198))/0x7*(-parseInt(_0x20f578(0xaa))/0x8)+-parseInt(_0x20f578(0x21a))/0x9*(-parseInt(_0x20f578(0x93))/0xa)+parseInt(_0x20f578(0x1c6))/0xb*(parseInt(_0x20f578(0x14c))/0xc);if(_0x48d857===_0x57d99b)break;else _0x29984a['push'](_0x29984a['shift']());}catch(_0x4e21d0){_0x29984a['push'](_0x29984a['shift']());}}}(a41_0x5824,0x74b45));import a41_0x49e604 from'chalk';import{existsSync}from'fs';import a41_0x25e51c from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a41_0x5636da from'prompts';function getAttemptStatusDisplay(_0x22f629){const _0x54a1b6=a41_0x7e35;if(!_0x22f629)return{'icon':'⏳','text':''};const {done:_0x2fffe4,success:_0x1de245,cancelRequested:_0x5a45bd}=_0x22f629;if(!_0x2fffe4)return _0x5a45bd?{'icon':'🛑','text':a41_0x49e604['yellow'](_0x54a1b6(0x1a5))}:{'icon':'🔄','text':a41_0x49e604[_0x54a1b6(0xfe)](_0x54a1b6(0x1d0))};if(_0x1de245)return{'icon':'✅','text':a41_0x49e604['green'](_0x54a1b6(0x185))};return{'icon':'❌','text':a41_0x49e604[_0x54a1b6(0x8b)]('error')};}export class WorkflowBaseCommand extends BaseCommand{[a41_0x41ef9d(0xcb)](_0x331b16,_0xe02a1e,_0xd0c2c4=0x0){const _0x24599d=a41_0x41ef9d;return _0x331b16[_0xd0c2c4]||_0xe02a1e[_0x24599d(0x1ab)];}[a41_0x41ef9d(0x16a)](_0x5c5043,_0x5acf84,_0x219301=0x0){const _0x2e2983=a41_0x41ef9d,_0xf5fcd5=this['resolveProject'](_0x5c5043,_0x5acf84,_0x219301);if(!_0xf5fcd5)return console['error'](a41_0x49e604[_0x2e2983(0x8b)](_0x2e2983(0x154)),_0x2e2983(0x217)),console[_0x2e2983(0xf0)](a41_0x49e604[_0x2e2983(0xcd)](_0x2e2983(0xd8))),null;return _0xf5fcd5;}[a41_0x41ef9d(0x124)](_0x5ca481,_0x4eb1e4){const _0x30bda2=a41_0x41ef9d;if(_0x5ca481[0x0]){const _0x24c7e4=_0x5ca481[0x0][_0x30bda2(0xd4)]('.');if(_0x24c7e4[_0x30bda2(0x218)]===0x1)return{'projectName':_0x24c7e4[0x0],'workflowName':undefined};else return _0x24c7e4[_0x30bda2(0x218)]===0x2?{'projectName':_0x24c7e4[0x0],'workflowName':_0x24c7e4[0x1]}:(console[_0x30bda2(0xf0)](a41_0x49e604[_0x30bda2(0x8b)](_0x30bda2(0x154)),_0x30bda2(0x1de)),null);}return{'projectName':_0x4eb1e4[_0x30bda2(0x1ab)],'workflowName':undefined};}[a41_0x41ef9d(0xba)](_0x2badbc,_0x1839eb,_0x3b44e6=0x0){const _0x49b371=a41_0x41ef9d;if(_0x2badbc[_0x3b44e6])return _0x2badbc[_0x3b44e6];if(_0x1839eb['workflowProject']){const _0x71b4f5=a41_0x25e51c[_0x49b371(0x116)](process[_0x49b371(0x126)](),_0x49b371(0x1bc),_0x1839eb[_0x49b371(0x1ab)]);if(existsSync(a41_0x25e51c[_0x49b371(0x116)](_0x71b4f5,_0x49b371(0x1ae))))return _0x71b4f5;}return undefined;}async[a41_0x41ef9d(0x191)](_0x113c3a,_0x22424f,_0x1902f9){const _0x201f56=a41_0x41ef9d;try{const _0x571c66=await _0x113c3a[_0x201f56(0x165)][_0x201f56(0x1bc)](_0x22424f,{'limit':0x1});if(_0x571c66[_0x201f56(0x218)]>0x0){const _0x488265=_0x571c66[0x0]['id'],_0x407c23=getWorkflowUrl(_0x1902f9,_0x488265);console[_0x201f56(0xf0)](_0x201f56(0x11e)+a41_0x49e604[_0x201f56(0xdf)](_0x407c23));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a41_0x41ef9d(0x10d)]=a41_0x41ef9d(0xe5);[a41_0x41ef9d(0x1ff)]=a41_0x41ef9d(0x1b6);async[a41_0x41ef9d(0x182)](_0x5ee277){const _0xc3ec93=a41_0x41ef9d,{options:_0x5f0887,args:_0x2b717a,tdx:_0x652aed}=_0x5ee277,_0x257968=_0x2b717a[0x0],_0x57755c=_0x5f0887[_0xc3ec93(0xa8)];if(_0x57755c)return saveSessionContext({'workflow_project':undefined},_0x5f0887[_0xc3ec93(0x1db)]),console[_0xc3ec93(0x111)](a41_0x49e604[_0xc3ec93(0x17c)](_0xc3ec93(0x133))),0x0;if(!_0x257968)return console[_0xc3ec93(0xf0)](a41_0x49e604[_0xc3ec93(0x8b)](_0xc3ec93(0x154)),_0xc3ec93(0x217)),console['error'](a41_0x49e604[_0xc3ec93(0xcd)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0xc3ec93(0xf0)](a41_0x49e604[_0xc3ec93(0xcd)](_0xc3ec93(0x211))),0x1;const _0x5d0e26=await withSpinner('Resolving\x20project\x20\x27'+_0x257968+_0xc3ec93(0x104),()=>_0x652aed[_0xc3ec93(0x165)][_0xc3ec93(0x223)](_0x257968),{'verbose':_0x5f0887[_0xc3ec93(0x1d8)]}),{name:_0x3e909c}=_0x5d0e26[_0xc3ec93(0x203)];return saveSessionContext({'workflow_project':_0x3e909c},_0x5f0887[_0xc3ec93(0x1db)]),console[_0xc3ec93(0x111)](a41_0x49e604[_0xc3ec93(0x17c)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a41_0x49e604[_0xc3ec93(0xdf)](_0x3e909c))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a41_0x41ef9d(0x10d)]=a41_0x41ef9d(0xdd);[a41_0x41ef9d(0x1ff)]=a41_0x41ef9d(0x14e);async[a41_0x41ef9d(0x182)](_0x2e25bb){const _0x533b0f=a41_0x41ef9d,{options:_0x54e406,args:_0x90da73,tdx:_0x4feb1d}=_0x2e25bb,_0x434630=_0x90da73[0x0];_0x54e406[_0x533b0f(0x1d8)]&&_0x434630&&console[_0x533b0f(0xf0)]('Pattern:\x20'+_0x434630);const _0x532fd1=await withSpinner(_0x533b0f(0x138),()=>_0x4feb1d['workflow']['projects'](_0x434630,{'limit':_0x54e406[_0x533b0f(0xe0)]}),{'verbose':_0x54e406[_0x533b0f(0x1d8)]});let _0xcd696a=_0x532fd1[_0x533b0f(0x203)];_0xcd696a[_0x533b0f(0x83)]((_0x41c3b8,_0x19f131)=>_0x41c3b8['name'][_0x533b0f(0xb2)](_0x19f131['name']));const _0x18ae3a=_0x54e406['limit']||0x64,_0x19df6b=_0xcd696a[_0x533b0f(0x218)]>=_0x18ae3a?a41_0x49e604[_0x533b0f(0xcd)](_0x533b0f(0x21b)):'';console[_0x533b0f(0xf0)](_0x533b0f(0x213)+_0xcd696a[_0x533b0f(0x218)]+'\x20project'+(_0xcd696a[_0x533b0f(0x218)]!==0x1?'s':'')+_0x19df6b);if(_0x54e406[_0x533b0f(0x153)]===_0x533b0f(0xfc)||_0x54e406[_0x533b0f(0x153)]==='jsonl'||_0x54e406[_0x533b0f(0x153)]===_0x533b0f(0x181))await handleSDKOutput(_0xcd696a,_0x54e406);else{if(_0xcd696a['length']===0x0)_0x434630?console[_0x533b0f(0x111)](_0x533b0f(0x121)+_0x434630):console['log'](_0x533b0f(0x128));else{const _0x31956c=_0xcd696a['map'](_0x1eb1d5=>{const _0x57b307=_0x533b0f,_0x1a3fb5=_0x1eb1d5[_0x57b307(0x132)]?.[_0x57b307(0x190)](_0x233652=>_0x233652[_0x57b307(0xfb)]===_0x57b307(0x21d)),_0x1c4147=_0x1a3fb5?a41_0x49e604['dim'](_0x57b307(0x1dc)):'';return'📁\x20'+_0x1eb1d5[_0x57b307(0x10d)]+_0x1c4147;});await writeOutput(_0x31956c[_0x533b0f(0x116)]('\x0a'),_0x54e406['output'],_0x533b0f(0x1a0));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']='workflow:workflows';['description']=a41_0x41ef9d(0x156);async[a41_0x41ef9d(0x182)](_0x3a9d10){const _0x1a9c79=a41_0x41ef9d,{options:_0x509de4,args:_0x46a637,tdx:_0x9ef9f0}=_0x3a9d10,_0x3c6af2=this[_0x1a9c79(0xcb)](_0x46a637,_0x509de4);_0x509de4[_0x1a9c79(0x1d8)]&&_0x3c6af2&&console[_0x1a9c79(0xf0)](_0x1a9c79(0xb5)+_0x3c6af2);const _0x358f78=await withSpinner('Listing\x20workflows...',()=>_0x9ef9f0['workflow'][_0x1a9c79(0x1bc)](_0x3c6af2,{'limit':_0x509de4[_0x1a9c79(0xe0)]}),{'verbose':_0x509de4[_0x1a9c79(0x1d8)]});let _0x1d6fca=_0x358f78[_0x1a9c79(0x203)];_0x1d6fca[_0x1a9c79(0x83)]((_0x5d09ef,_0x5ab497)=>{const _0x43c0bf=_0x1a9c79,_0x223fa9=_0x5d09ef[_0x43c0bf(0x10d)][_0x43c0bf(0xb2)](_0x5ab497[_0x43c0bf(0x10d)]);if(_0x223fa9!==0x0)return _0x223fa9;return(_0x5d09ef[_0x43c0bf(0xf2)]?.[_0x43c0bf(0x10d)]||'')[_0x43c0bf(0xb2)](_0x5ab497['project']?.['name']||'');});const _0x3788a7=_0x509de4[_0x1a9c79(0xe0)]||0x64,_0x96adde=_0x1d6fca['length']>=_0x3788a7?a41_0x49e604[_0x1a9c79(0xcd)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console['error']('✔\x20Found\x20'+_0x1d6fca['length']+_0x1a9c79(0x189)+(_0x1d6fca[_0x1a9c79(0x218)]!==0x1?'s':'')+_0x96adde);if(_0x509de4[_0x1a9c79(0x153)]===_0x1a9c79(0xfc)||_0x509de4[_0x1a9c79(0x153)]===_0x1a9c79(0xb7)||_0x509de4[_0x1a9c79(0x153)]===_0x1a9c79(0x181))await handleSDKOutput(_0x1d6fca,_0x509de4);else{if(_0x1d6fca[_0x1a9c79(0x218)]===0x0)_0x3c6af2?console['log'](_0x1a9c79(0x196)+_0x3c6af2):console[_0x1a9c79(0x111)](_0x1a9c79(0x142));else{const _0x291b9e=_0x509de4['site'],_0x17c8c=_0x1d6fca[_0x1a9c79(0x205)](_0x4a4c43=>{const _0x31e27a=_0x1a9c79,_0x2271e4=a41_0x49e604[_0x31e27a(0xcd)]('#'+_0x4a4c43['id']),_0x118e4a=hyperlink(_0x2271e4,getWorkflowUrl(_0x291b9e,_0x4a4c43['id'])),_0x461a9c=_0x4a4c43[_0x31e27a(0xf2)]?.[_0x31e27a(0x10d)]?a41_0x49e604[_0x31e27a(0xcd)]('\x20('+_0x4a4c43[_0x31e27a(0xf2)][_0x31e27a(0x10d)]+')'):'';return'📋\x20'+_0x118e4a+'\x20'+_0x4a4c43[_0x31e27a(0x10d)]+_0x461a9c;});await writeOutput(_0x17c8c['join']('\x0a'),_0x509de4[_0x1a9c79(0xe6)],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a41_0x41ef9d(0x10d)]=a41_0x41ef9d(0x168);[a41_0x41ef9d(0x1ff)]='List\x20workflow\x20execution\x20sessions';async[a41_0x41ef9d(0x182)](_0x17bb4a){const _0x144668=a41_0x41ef9d,{options:_0x501b36,args:_0x5f34d1,tdx:_0x5a829d}=_0x17bb4a,_0x5d72fc=this['parseProjectWorkflowPattern'](_0x5f34d1,_0x501b36);if(!_0x5d72fc)return 0x1;const {projectName:_0x1d8804,workflowName:_0x200ba6}=_0x5d72fc;if(_0x501b36['verbose']){if(_0x1d8804&&_0x200ba6)console['error'](_0x144668(0xbf)+_0x1d8804+'.'+_0x200ba6);else _0x1d8804&&console[_0x144668(0xf0)](_0x144668(0x15b)+_0x1d8804);const _0x55b4c0=_0x501b36[_0x144668(0x210)];_0x55b4c0&&console[_0x144668(0xf0)](_0x144668(0xb4)+_0x55b4c0);}let _0x4e8a0c=0x28;if(process[_0x144668(0xd7)][_0x144668(0xa1)]&&!_0x501b36[_0x144668(0xe6)]&&!_0x501b36[_0x144668(0x153)]){const _0x3e0fdc=process['stdout'][_0x144668(0x130)]||0x28;_0x4e8a0c=Math[_0x144668(0x17d)](0x14,Math[_0x144668(0x204)](_0x3e0fdc*0x2/0x3));}const _0xf64c34=_0x501b36[_0x144668(0xe0)]||_0x4e8a0c,_0x5353cc=await withSpinner(_0x144668(0x13b),()=>_0x5a829d[_0x144668(0x165)][_0x144668(0x95)]({'projectName':_0x1d8804,'workflowName':_0x200ba6,'status':_0x501b36[_0x144668(0x210)],'fromTime':_0x501b36[_0x144668(0x214)],'toTime':_0x501b36['to'],'limit':_0xf64c34}),{'verbose':_0x501b36[_0x144668(0x1d8)]}),_0x48ca75=_0x5353cc[_0x144668(0x203)];_0x48ca75[_0x144668(0x83)]((_0x15e726,_0x199cf0)=>{const _0x2e1a09=_0x144668,_0x2e2124=_0x15e726['sessionTime']||'',_0x2b4b14=_0x199cf0[_0x2e1a09(0xe3)]||'';return _0x2b4b14['localeCompare'](_0x2e2124);});_0x48ca75['length']>=_0xf64c34?console[_0x144668(0xf0)](_0x144668(0x1ee)+_0x48ca75['length']+'\x20sessions\x20'+a41_0x49e604['dim']('(use\x20--limit\x20to\x20see\x20more)')):console[_0x144668(0xf0)](_0x144668(0x213)+_0x48ca75[_0x144668(0x218)]+_0x144668(0x9d)+(_0x48ca75[_0x144668(0x218)]!==0x1?'s':''));if(_0x501b36[_0x144668(0x153)]===_0x144668(0xfc)||_0x501b36[_0x144668(0x153)]===_0x144668(0xb7)||_0x501b36[_0x144668(0x153)]==='table')await handleSDKOutput(_0x48ca75,_0x501b36);else{if(!process[_0x144668(0xd7)][_0x144668(0xa1)]||_0x501b36['output']){if(_0x48ca75[_0x144668(0x218)]===0x0){if(_0x1d8804&&_0x200ba6)console['log'](_0x144668(0x201)+_0x1d8804+'.'+_0x200ba6);else _0x1d8804?console[_0x144668(0x111)](_0x144668(0xf7)+_0x1d8804):console[_0x144668(0x111)](_0x144668(0x222));}else{const _0x98bbce=_0x501b36[_0x144668(0x1b5)],_0x26f02f=this['renderSessionsTimeline'](_0x48ca75,_0x98bbce);_0x501b36[_0x144668(0xe6)]?await writeOutput(_0x26f02f,_0x501b36[_0x144668(0xe6)],_0x144668(0x1a0)):console['log'](_0x26f02f);}!_0x1d8804&&(console[_0x144668(0xf0)](''),console[_0x144668(0xf0)](a41_0x49e604[_0x144668(0xcd)](_0x144668(0x166))),console[_0x144668(0xf0)](a41_0x49e604[_0x144668(0xcd)](_0x144668(0x225))+'or'+a41_0x49e604[_0x144668(0xcd)](_0x144668(0x8a))));}else{if(_0x48ca75[_0x144668(0x218)]===0x0){if(_0x1d8804&&_0x200ba6)console[_0x144668(0x111)](_0x144668(0x201)+_0x1d8804+'.'+_0x200ba6);else _0x1d8804?console[_0x144668(0x111)](_0x144668(0xf7)+_0x1d8804):console[_0x144668(0x111)](_0x144668(0x222));}else await this[_0x144668(0xc0)](_0x48ca75,_0x17bb4a,_0x1d8804);}}return 0x0;}[a41_0x41ef9d(0x85)](_0x3f7de3,_0x5a189c){const _0x5a8bcb=a41_0x41ef9d,_0x38f2dc=[],_0x38c96c=new Map();let _0x397c21=Infinity,_0x2267e8=-Infinity;for(const _0x58cccb of _0x3f7de3){if(_0x58cccb[_0x5a8bcb(0x167)]?.[_0x5a8bcb(0x15e)]){const _0x13cc3c=new Date(_0x58cccb['lastAttempt'][_0x5a8bcb(0x15e)])[_0x5a8bcb(0xe4)](),_0x3ffa03=_0x58cccb['lastAttempt'][_0x5a8bcb(0x188)]?new Date(_0x58cccb[_0x5a8bcb(0x167)]['finishedAt'])[_0x5a8bcb(0xe4)]():Date['now'](),_0x15e8a4=_0x58cccb[_0x5a8bcb(0xf2)]?.[_0x5a8bcb(0x10d)]||'(unknown)';!_0x38c96c[_0x5a8bcb(0xc4)](_0x15e8a4)&&_0x38c96c[_0x5a8bcb(0x13f)](_0x15e8a4,[]),_0x38c96c[_0x5a8bcb(0x180)](_0x15e8a4)[_0x5a8bcb(0x11b)]({'session':_0x58cccb,'startTime':_0x13cc3c,'endTime':_0x3ffa03,'duration':_0x3ffa03-_0x13cc3c}),_0x397c21=Math[_0x5a8bcb(0x21f)](_0x397c21,_0x13cc3c),_0x2267e8=Math[_0x5a8bcb(0x17d)](_0x2267e8,_0x3ffa03);}}if(_0x38c96c['size']===0x0)return _0x5a8bcb(0x14b);const _0x1436af=process['stdout'][_0x5a8bcb(0x1dd)]||0x78,_0x21c3b2=0x1e,_0x8bfebd=0x32,_0x5a05c1=0x4,_0x1ad751=Math['min'](_0x8bfebd,Math[_0x5a8bcb(0x17d)](_0x21c3b2,Math['floor'](_0x1436af*0.3))),_0x2ed757=_0x1436af-_0x1ad751-TIMELINE_CONFIG['GUTTER']-0x3-_0x5a05c1,_0x5b8214=_0x2267e8-_0x397c21,_0x47c18e=_0x5b8214/_0x1ad751,_0x4821c5=renderTimeAxis({'startTime':_0x397c21,'endTime':_0x2267e8,'durationMs':_0x5b8214,'msPerChar':_0x47c18e},_0x1ad751),_0x3394a5=[];for(const _0x1366f0 of _0x38c96c['values']()){_0x3394a5[_0x5a8bcb(0x11b)](..._0x1366f0);}_0x3394a5[_0x5a8bcb(0x83)]((_0x33c456,_0x5dbc06)=>_0x5dbc06['startTime']-_0x33c456['startTime']);const _0x4de0c7=new Date(_0x397c21),_0x3fd3d8=formatDate(_0x4de0c7),_0x28bcd2=_0x5a05c1+TIMELINE_CONFIG[_0x5a8bcb(0x1c3)]+TIMELINE_CONFIG[_0x5a8bcb(0x17e)]+_0x2ed757,_0x424495='\x20'[_0x5a8bcb(0x14f)](_0x28bcd2-_0x3fd3d8[_0x5a8bcb(0x218)]),_0x21e394=_0x424495+a41_0x49e604[_0x5a8bcb(0xcd)](_0x3fd3d8)+'\x20'+_0x4821c5;_0x38f2dc[_0x5a8bcb(0x11b)](_0x21e394);const _0x12bfff=0x16;let _0x375f8a=0x0;for(const _0x2499bc of _0x3394a5){const _0x1f4c57=_0x2499bc[_0x5a8bcb(0x1db)]['project']?.[_0x5a8bcb(0x10d)]||'?',_0x3b7499=Math['min'](stringWidth(_0x1f4c57),_0x12bfff);_0x375f8a=Math[_0x5a8bcb(0x17d)](_0x375f8a,_0x3b7499);}for(const _0x3a5b47 of _0x3394a5){const {session:_0x3f74de,startTime:_0x4a9aa3,endTime:_0x43d7c2,duration:_0x1b81bb}=_0x3a5b47,_0x491789=_0x3f74de[_0x5a8bcb(0xf2)]?.['id'],_0x638ceb=_0x3f74de['id'],_0x3d3e15=_0x3f74de[_0x5a8bcb(0xf2)]?.['name']||'?',_0x307b45=_0x3f74de[_0x5a8bcb(0x165)]?.['name']||'?';let _0x432533,_0x6384ee;if(_0x3f74de[_0x5a8bcb(0x167)]){const _0x15a4bd=_0x3f74de[_0x5a8bcb(0x167)];!_0x15a4bd['done']?(_0x432533=_0x15a4bd[_0x5a8bcb(0x1fb)]?'🛑':'🔄',_0x6384ee=_0x15a4bd[_0x5a8bcb(0x1fb)]?a41_0x49e604[_0x5a8bcb(0xae)]:a41_0x49e604[_0x5a8bcb(0xfe)]):(_0x432533=_0x15a4bd[_0x5a8bcb(0x185)]?'✅':'❌',_0x6384ee=_0x15a4bd[_0x5a8bcb(0x185)]?a41_0x49e604['green']:a41_0x49e604['red']);}else _0x432533='⏳',_0x6384ee=a41_0x49e604[_0x5a8bcb(0xcd)];const _0x543a3d='#'+_0x638ceb,_0x3f5caf=_0x491789?hyperlink(_0x543a3d,getWorkflowSessionUrl(_0x5a189c,_0x491789,_0x638ceb)):_0x543a3d;let _0x21775e=_0x3d3e15;stringWidth(_0x3d3e15)>_0x12bfff&&(_0x21775e=_0x3d3e15[_0x5a8bcb(0xff)](0x0,_0x12bfff-0x1)+'…');const _0x5cb6d7=a41_0x49e604['dim'](_0x21775e),_0x1a9f91=stringWidth(_0x21775e),_0x200b0d='\x20'[_0x5a8bcb(0x14f)](_0x375f8a-stringWidth(_0x21775e)+0x2),_0x1c9571='('+formatElapsed(_0x1b81bb)+')',_0xa09a22=stringWidth(_0x1c9571),_0x20e42c=stringWidth(_0x543a3d),_0x2f9f30=_0x20e42c+0x1+_0x1a9f91+_0x200b0d[_0x5a8bcb(0x218)],_0x2aa51b=_0x2ed757-_0x2f9f30-_0xa09a22-0x1-0x8;let _0xe2ead4=_0x307b45;stringWidth(_0xe2ead4)>_0x2aa51b&&(_0xe2ead4=_0xe2ead4[_0x5a8bcb(0xff)](0x0,_0x2aa51b-0x1)+'…');const _0x3088e1=_0x3f5caf+'\x20'+_0x5cb6d7+_0x200b0d+_0xe2ead4,_0x289cc6=stringWidth(_0x3088e1),_0x53b716=_0x2ed757-_0x289cc6-_0xa09a22,_0x1748f3=_0x3088e1+'\x20'[_0x5a8bcb(0x14f)](Math['max'](0x1,_0x53b716))+a41_0x49e604[_0x5a8bcb(0xcd)](_0x1c9571),_0x56b623=Math[_0x5a8bcb(0x204)]((_0x4a9aa3-_0x397c21)/_0x47c18e),_0x4e3736=Math[_0x5a8bcb(0x204)]((_0x43d7c2-_0x397c21)/_0x47c18e),_0x3490b4=Math[_0x5a8bcb(0x17d)](_0x56b623+0x1,_0x4e3736),_0x4b6a09=new Array(_0x1ad751)[_0x5a8bcb(0x11a)]('\x20');for(let _0x404573=_0x56b623;_0x404573<Math[_0x5a8bcb(0x21f)](_0x3490b4,_0x1ad751);_0x404573++){_0x4b6a09[_0x404573]='─';}const _0x2d805a=_0x4b6a09[_0x5a8bcb(0x205)](_0x14b2e5=>_0x14b2e5==='\x20'?'\x20':_0x6384ee(_0x14b2e5))[_0x5a8bcb(0x116)]('');_0x38f2dc[_0x5a8bcb(0x11b)](_0x432533+'\x20'+_0x1748f3+'│'+_0x2d805a+'│');}return _0x38f2dc[_0x5a8bcb(0x116)]('\x0a');}async['navigateSessionsInteractive'](_0x485a66,_0x5adb58,_0x538397){const _0x1943e4=a41_0x41ef9d,{options:_0x3c3a5e,tdx:_0x2beb30}=_0x5adb58,_0x246a21=_0x3c3a5e[_0x1943e4(0x1b5)],{timelineRows:_0x3103df,timeAxisHeader:_0x575702}=this[_0x1943e4(0x1b8)](_0x485a66,_0x246a21),_0x5231e8=_0x3103df[_0x1943e4(0x177)](_0xe75da0=>_0xe75da0[_0x1943e4(0x1e6)]);if(_0x5231e8[_0x1943e4(0x218)]===0x0){const _0x1267d9=this['renderSessionsTimeline'](_0x485a66,_0x246a21);console[_0x1943e4(0x111)](_0x1267d9);!_0x538397&&(console[_0x1943e4(0xf0)](''),console['error'](a41_0x49e604[_0x1943e4(0xcd)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x1943e4(0xf0)](a41_0x49e604[_0x1943e4(0xcd)](_0x1943e4(0x225))+'or'+a41_0x49e604['dim'](_0x1943e4(0x8a))));return;}_0x575702&&console['log'](_0x575702);const _0xe7f43e=_0x3103df[_0x1943e4(0x177)](_0x41e98c=>_0x41e98c[_0x1943e4(0x1e6)])[_0x1943e4(0x205)](_0x197b9f=>({'title':_0x197b9f[_0x1943e4(0xe9)],'value':_0x197b9f[_0x1943e4(0x1e6)]})),_0x23c1c4=process['stdout'][_0x1943e4(0x130)]||0x3c,_0x4db5b2=Math[_0x1943e4(0x17d)](0x28,Math[_0x1943e4(0x204)](_0x23c1c4*0x2/0x3)),_0xd567c1=await a41_0x5636da({'type':_0x1943e4(0x1f7),'name':_0x1943e4(0x1e6),'message':_0x1943e4(0xea),'choices':_0xe7f43e,'initial':-0x1,'limit':_0x4db5b2,'clearFirst':!![],'fallback':{'title':_0x1943e4(0xf9),'value':null},'suggest':(_0x4bbead,_0x5a74c7)=>{const _0x41b72c=_0x1943e4;if(!_0x4bbead)return Promise[_0x41b72c(0x101)](_0x5a74c7);const _0x3533f0=_0x5a74c7['filter'](_0x4b9e63=>{const _0x15fbd4=_0x41b72c,_0x44066b=_0x4b9e63;return _0x44066b[_0x15fbd4(0x18a)][_0x15fbd4(0x9f)]()['includes'](_0x4bbead[_0x15fbd4(0x9f)]());});return Promise[_0x41b72c(0x101)](_0x3533f0);}}),_0x586766=()=>{const _0x3c8cd4=_0x1943e4;process[_0x3c8cd4(0xd7)][_0x3c8cd4(0x18b)](_0x3c8cd4(0x19e)),process[_0x3c8cd4(0xd7)][_0x3c8cd4(0x18b)](_0x3c8cd4(0x19e)),process[_0x3c8cd4(0xd7)]['write']('\x1b[1A\x1b[2K');},_0x1f1a5e=_0xd567c1&&_0xd567c1[_0x1943e4(0x1e6)]&&_0xd567c1[_0x1943e4(0x1e6)]!==null&&_0xd567c1[_0x1943e4(0x1e6)][_0x1943e4(0x112)]()!=='';if(!_0x1f1a5e){_0x586766(),console[_0x1943e4(0x111)](a41_0x49e604[_0x1943e4(0xcd)](_0x1943e4(0xd2)));return;}_0x586766();const _0x3560f4=_0x485a66['find'](_0x309fbe=>_0x309fbe[_0x1943e4(0x167)]?.['id']===_0xd567c1[_0x1943e4(0x1e6)]);if(_0x3560f4){const _0x4851e=_0x3560f4[_0x1943e4(0xf2)]?.[_0x1943e4(0x10d)]||'?',_0x2bcd16=_0x3560f4[_0x1943e4(0x165)]?.['name']||'?';console[_0x1943e4(0x111)](_0x1943e4(0xeb)+a41_0x49e604[_0x1943e4(0xcd)](_0x4851e)+_0x1943e4(0xf5)+a41_0x49e604[_0x1943e4(0xcd)](_0x2bcd16));}const _0x547693=new WorkflowTimelineCommand();await _0x547693[_0x1943e4(0x182)]({'args':[],'options':{..._0x3c3a5e,'attemptId':_0xd567c1[_0x1943e4(0x1e6)]},'tdx':_0x2beb30});}[a41_0x41ef9d(0x1b8)](_0x4c42a7,_0x47183d){const _0x3540ce=a41_0x41ef9d,_0x1831e1=new Map();for(const _0x18a7e0 of _0x4c42a7){_0x18a7e0['id']&&_0x18a7e0[_0x3540ce(0x167)]?.['id']&&_0x1831e1['set'](_0x18a7e0['id'],_0x18a7e0[_0x3540ce(0x167)]['id']);}const _0x4ddb31=[];let _0x5ed0bf='';const _0x2652ff=this[_0x3540ce(0x85)](_0x4c42a7,_0x47183d),_0x87239c=_0x2652ff[_0x3540ce(0xd4)]('\x0a');for(const _0xb86673 of _0x87239c){if(_0xb86673['startsWith'](_0x3540ce(0x1d1))||_0xb86673[_0x3540ce(0x183)](/^\s+\d{4}-\d{2}-\d{2}/))_0x5ed0bf=_0xb86673;else{if(_0xb86673[_0x3540ce(0x183)](/^[✅❌🔄🛑⏳]/)){const _0x2e955e=_0xb86673['match'](/#(\d+)/),_0x4f7a7d=_0x2e955e?_0x2e955e[0x1]:null,_0x2f7303=_0x4f7a7d?_0x1831e1[_0x3540ce(0x180)](_0x4f7a7d)||null:null,_0x20d88c=_0x4c42a7[_0x3540ce(0xd3)](_0xd1b973=>_0xd1b973['id']===_0x4f7a7d),_0x5b88f7=_0x20d88c?.[_0x3540ce(0xf2)]?.[_0x3540ce(0x10d)]||'';_0x4ddb31[_0x3540ce(0x11b)]({'displayLine':_0xb86673,'attemptId':_0x2f7303,'projectName':_0x5b88f7});}}}return{'timelineRows':_0x4ddb31,'timeAxisHeader':_0x5ed0bf};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']='workflow:attempts';[a41_0x41ef9d(0x1ff)]='List\x20workflow\x20attempts';async['execute'](_0x33e6af){const _0x11d0a6=a41_0x41ef9d,{options:_0x11ad15,args:_0x4eeb1e,tdx:_0x4a6891}=_0x33e6af,_0x187e10=this[_0x11d0a6(0x124)](_0x4eeb1e,_0x11ad15);if(!_0x187e10)return 0x1;const {projectName:_0x2b9dd7,workflowName:_0x524245}=_0x187e10,_0x54e3a3=_0x11ad15[_0x11d0a6(0xc3)];if(_0x11ad15['verbose']){if(_0x2b9dd7&&_0x524245)console[_0x11d0a6(0xf0)]('Filter:\x20'+_0x2b9dd7+'.'+_0x524245);else _0x2b9dd7&&console['error'](_0x11d0a6(0x15b)+_0x2b9dd7);_0x54e3a3&&console[_0x11d0a6(0xf0)](_0x11d0a6(0xc1));}const _0xb999f4=await withSpinner(_0x11d0a6(0xdb),()=>_0x4a6891[_0x11d0a6(0x165)]['attempts']({'projectName':_0x2b9dd7,'workflowName':_0x524245,'includeRetried':_0x54e3a3,'limit':_0x11ad15[_0x11d0a6(0xe0)]}),{'verbose':_0x11ad15['verbose']}),_0x588257=_0xb999f4[_0x11d0a6(0x203)],_0xb1c7cd=_0x11ad15['limit']||0x64,_0x23a130=_0x588257[_0x11d0a6(0x218)]>=_0xb1c7cd?a41_0x49e604[_0x11d0a6(0xcd)](_0x11d0a6(0x21b)):'';console[_0x11d0a6(0xf0)](_0x11d0a6(0x213)+_0x588257[_0x11d0a6(0x218)]+'\x20attempt'+(_0x588257['length']!==0x1?'s':'')+_0x23a130);if(_0x11ad15[_0x11d0a6(0x153)]===_0x11d0a6(0xfc)||_0x11ad15[_0x11d0a6(0x153)]===_0x11d0a6(0xb7)||_0x11ad15[_0x11d0a6(0x153)]===_0x11d0a6(0x181))await handleSDKOutput(_0x588257,_0x11ad15);else{if(_0x588257[_0x11d0a6(0x218)]===0x0){if(_0x2b9dd7&&_0x524245)console[_0x11d0a6(0x111)]('No\x20attempts\x20found\x20for:\x20'+_0x2b9dd7+'.'+_0x524245);else _0x2b9dd7?console[_0x11d0a6(0x111)](_0x11d0a6(0x219)+_0x2b9dd7):console[_0x11d0a6(0x111)](_0x11d0a6(0x21e));}else{const _0xe8beac=_0x11ad15[_0x11d0a6(0x1b5)],_0x3c988a=_0x588257[_0x11d0a6(0x205)](_0x5a7618=>{const _0x4d6304=_0x11d0a6,_0x4c889f=a41_0x49e604[_0x4d6304(0xcd)]('#'+_0x5a7618['id']),_0x5017fe=_0x5a7618[_0x4d6304(0xf2)]?.['id'],_0x271bc8=_0x5a7618[_0x4d6304(0x9c)]||_0x5a7618[_0x4d6304(0x90)],_0xea5375=_0x5017fe&&_0x271bc8?hyperlink(_0x4c889f,getWorkflowAttemptUrl(_0xe8beac,_0x5017fe,_0x271bc8,_0x5a7618['id'])):_0x4c889f,{icon:_0x5baa9d,text:_0x5d1ec4}=getAttemptStatusDisplay(_0x5a7618),_0x2f3d2d=(_0x5a7618[_0x4d6304(0xf2)]?.[_0x4d6304(0x10d)]||'?')+'.'+(_0x5a7618['workflow']?.[_0x4d6304(0x10d)]||'?'),_0x4e2221=_0x5a7618[_0x4d6304(0xe3)]?a41_0x49e604[_0x4d6304(0xcd)](_0x5a7618[_0x4d6304(0xe3)]):'';return(_0xea5375+'\x20'+_0x5baa9d+(_0x5d1ec4?'\x20'+_0x5d1ec4:'')+'\x20'+_0x2f3d2d+'\x20'+_0x4e2221)['trimEnd']();});await writeOutput(_0x3c988a[_0x11d0a6(0x116)]('\x0a'),_0x11ad15[_0x11d0a6(0xe6)],_0x11d0a6(0x1a0));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a41_0x41ef9d(0x10d)]=a41_0x41ef9d(0x13e);['description']=a41_0x41ef9d(0x1ad);async['execute'](_0x1f1616){const _0x5603a4=a41_0x41ef9d,{options:_0x2e6d29,args:_0x4a9c7e,tdx:_0x418098}=_0x1f1616,_0x1f4401=_0x4a9c7e[0x0];if(!_0x1f4401)return console[_0x5603a4(0xf0)](_0x5603a4(0x1e2)),0x1;_0x2e6d29[_0x5603a4(0x1d8)]&&console[_0x5603a4(0xf0)](_0x5603a4(0x123)+_0x1f4401);const _0x2cc0ba=await withSpinner(_0x5603a4(0x17f),()=>_0x418098['workflow']['attempt'](_0x1f4401),{'verbose':_0x2e6d29[_0x5603a4(0x1d8)]}),_0x5f4cde=_0x2cc0ba['data'];let _0x4b34b5;!_0x5f4cde['done']?_0x4b34b5=_0x5f4cde[_0x5603a4(0x1fb)]?_0x5603a4(0x1a5):'running':_0x4b34b5=_0x5f4cde['success']?_0x5603a4(0x185):_0x5603a4(0xf0);let _0x19650a;if(_0x5f4cde[_0x5603a4(0x15e)]&&_0x5f4cde[_0x5603a4(0x188)]){const _0x51ec39=new Date(_0x5f4cde[_0x5603a4(0x15e)])[_0x5603a4(0xe4)](),_0x54b8a5=new Date(_0x5f4cde[_0x5603a4(0x188)])[_0x5603a4(0xe4)]();_0x19650a=Math[_0x5603a4(0xec)]((_0x54b8a5-_0x51ec39)/0x3e8);}const _0xba8f6c={'attempt_id':_0x5f4cde['id'],'status':_0x4b34b5,..._0x5f4cde['index']!==undefined&&{'index':_0x5f4cde[_0x5603a4(0xfa)]},..._0x5f4cde['project']&&{'project':_0x5f4cde[_0x5603a4(0xf2)]['name']},..._0x5f4cde['workflow']&&{'workflow':_0x5f4cde[_0x5603a4(0x165)][_0x5603a4(0x10d)]},..._0x5f4cde[_0x5603a4(0x90)]&&{'session_id':_0x5f4cde[_0x5603a4(0x90)]},..._0x5f4cde[_0x5603a4(0xe3)]&&{'session_time':_0x5f4cde[_0x5603a4(0xe3)]},..._0x5f4cde[_0x5603a4(0xd6)]&&{'retry_attempt':_0x5f4cde[_0x5603a4(0xd6)]},..._0x19650a!==undefined&&{'duration_sec':_0x19650a},..._0x5f4cde[_0x5603a4(0x15e)]&&{'created_at':_0x5f4cde[_0x5603a4(0x15e)]},..._0x5f4cde['finishedAt']&&{'finished_at':_0x5f4cde[_0x5603a4(0x188)]},...Object[_0x5603a4(0x89)](_0x5f4cde['params'])['length']>0x0&&{'params':_0x5f4cde['params']}};return await handleSingleObjectOutput(_0xba8f6c,_0x2e6d29),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a41_0x41ef9d(0x10d)]='workflow:tasks';[a41_0x41ef9d(0x1ff)]=a41_0x41ef9d(0x1c5);async[a41_0x41ef9d(0x182)](_0x562b6f){const _0x398ff1=a41_0x41ef9d,{options:_0x4a3c4c,args:_0x343a84,tdx:_0xb07b9c}=_0x562b6f,_0x1419d2=_0x343a84[0x0];if(!_0x1419d2)return console[_0x398ff1(0xf0)](_0x398ff1(0x1e2)),0x1;const _0x3398da=_0x4a3c4c[_0x398ff1(0x13d)];_0x4a3c4c['verbose']&&(console['error'](_0x398ff1(0x123)+_0x1419d2),_0x3398da&&console[_0x398ff1(0xf0)](_0x398ff1(0x155)));const _0x2db8cd=await withSpinner(_0x398ff1(0x20d),()=>_0xb07b9c[_0x398ff1(0x165)][_0x398ff1(0x10b)](_0x1419d2,_0x3398da||![]),{'verbose':_0x4a3c4c['verbose']}),_0x17238c=_0x2db8cd[_0x398ff1(0x203)];return console['error']('✔\x20Found\x20'+_0x17238c[_0x398ff1(0x218)]+_0x398ff1(0x12f)+(_0x17238c['length']!==0x1?'s':'')),await handleSDKOutput(_0x17238c,_0x4a3c4c),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a41_0x41ef9d(0x10d)]=a41_0x41ef9d(0x86);[a41_0x41ef9d(0x1ff)]=a41_0x41ef9d(0x151);async[a41_0x41ef9d(0x182)](_0x4237e7){const _0x3d493b=a41_0x41ef9d,{options:_0x5f10aa,args:_0x1e13b2,tdx:_0x2e76a7}=_0x4237e7,_0x72bc67=_0x1e13b2[0x0];let _0x32fbca=_0x1e13b2[0x1];if(!_0x72bc67)return console[_0x3d493b(0xf0)](_0x3d493b(0x1e2)),0x1;_0x5f10aa[_0x3d493b(0x1d8)]&&(console[_0x3d493b(0xf0)](_0x3d493b(0x123)+_0x72bc67),_0x32fbca&&console[_0x3d493b(0xf0)]('Task\x20name:\x20'+_0x32fbca));const _0x5eba8f=await withSpinner('Fetching\x20log\x20files...',()=>_0x2e76a7['workflow']['logFiles'](_0x72bc67,_0x32fbca),{'verbose':_0x5f10aa[_0x3d493b(0x1d8)]}),_0xd4a014=_0x5eba8f[_0x3d493b(0x203)];if(_0xd4a014['length']===0x0)return console['error'](_0x3d493b(0x1fe)),0x0;if(!_0x32fbca&&(_0x5f10aa['json']||_0x5f10aa['format']))return await handleSDKOutput(_0xd4a014,_0x5f10aa),0x0;if(!_0x32fbca){const _0x17b246=_0xd4a014[_0x3d493b(0x205)](_0xe973ba=>({'title':_0xe973ba[_0x3d493b(0x18f)]+'\x20('+formatBytes(_0xe973ba[_0x3d493b(0x1d5)])+')','value':_0xe973ba['taskName']})),_0xb3ff12=await a41_0x5636da({'type':'select','name':_0x3d493b(0x141),'message':_0x3d493b(0x1a8),'choices':_0x17b246});if(!_0xb3ff12['task'])return console['error'](_0x3d493b(0xd2)),0x0;_0x32fbca=_0xb3ff12[_0x3d493b(0x141)];}const _0x23c594=await withSpinner('Downloading\x20logs...',()=>_0x2e76a7[_0x3d493b(0x165)][_0x3d493b(0x1cd)](_0x72bc67,_0x32fbca),{'verbose':_0x5f10aa[_0x3d493b(0x1d8)]}),_0x11dfad=_0x23c594['data'];return _0x11dfad?console[_0x3d493b(0x111)](_0x11dfad):console[_0x3d493b(0xf0)](_0x3d493b(0x9a)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a41_0x41ef9d(0x10d)]='workflow:kill';['description']=a41_0x41ef9d(0x1c1);async[a41_0x41ef9d(0x182)](_0x52bb15){const _0x215e57=a41_0x41ef9d,{options:_0x411dd4,args:_0x17b819,tdx:_0x4a5f45}=_0x52bb15,_0x3dc6e6=_0x17b819[0x0];if(!_0x3dc6e6)return console[_0x215e57(0xf0)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x36f60e=_0x411dd4[_0x215e57(0x208)];_0x411dd4[_0x215e57(0x1d8)]&&(console[_0x215e57(0xf0)](_0x215e57(0x123)+_0x3dc6e6),_0x36f60e&&console[_0x215e57(0xf0)](_0x215e57(0x1b0)+_0x36f60e));if(!_0x411dd4[_0x215e57(0xd9)]){const _0x3655ab=await confirmKey(_0x215e57(0x158)+_0x3dc6e6+'?');if(!_0x3655ab)return console[_0x215e57(0xf0)]('Cancelled'),0x0;}const _0x2a318e=await withSpinner(_0x215e57(0xca),()=>_0x4a5f45[_0x215e57(0x165)][_0x215e57(0x1ef)](_0x3dc6e6,_0x36f60e),{'verbose':_0x411dd4['verbose']}),_0x2439f3=_0x2a318e['data'];return console[_0x215e57(0xf0)]('✔\x20'+_0x2439f3),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a41_0x41ef9d(0x10d)]=a41_0x41ef9d(0x212);[a41_0x41ef9d(0x1ff)]=a41_0x41ef9d(0x1e7);async[a41_0x41ef9d(0x182)](_0x379cee){const _0x63b9cc=a41_0x41ef9d,{options:_0x1b96f8,args:_0x122c9b,tdx:_0x5aed4d}=_0x379cee,_0x4971ef=_0x122c9b[0x0];if(!_0x4971ef)return console[_0x63b9cc(0xf0)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console['error'](_0x63b9cc(0x216)),0x1;let _0x332533=![],_0x5d09f2=_0x4971ef;if(_0x4971ef['startsWith'](_0x63b9cc(0x84)))_0x332533=!![],_0x5d09f2=_0x4971ef[_0x63b9cc(0x1ea)](0x8);else{if(_0x4971ef[_0x63b9cc(0x1f5)]('attempt:'))_0x332533=![],_0x5d09f2=_0x4971ef[_0x63b9cc(0x1ea)](0x8);else return console['error']('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0x63b9cc(0xf0)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x1c31c9=_0x1b96f8[_0x63b9cc(0x226)],_0x1a7efe=_0x1b96f8['resumeFrom'],_0x113b09=_0x1b96f8[_0x63b9cc(0xc8)],_0x1b7657=_0x1b96f8[_0x63b9cc(0x173)];_0x1b96f8[_0x63b9cc(0x1d8)]&&(console[_0x63b9cc(0xf0)](_0x63b9cc(0x1f8)+(_0x332533?_0x63b9cc(0x1db):'attempt')+'\x20'+_0x5d09f2),_0x1c31c9&&console['error'](_0x63b9cc(0x1a7)+_0x1c31c9),_0x1a7efe&&console[_0x63b9cc(0xf0)]('Resume\x20from:\x20'+_0x1a7efe),_0x113b09&&console[_0x63b9cc(0xf0)]('Params:\x20'+_0x113b09),_0x1b7657&&console['error'](_0x63b9cc(0xf6)));let _0x1c3dd1;if(_0x113b09)try{if(_0x113b09['startsWith']('@')){const _0x51342d=await import('fs/promises'),_0x4b99d4=_0x113b09[_0x63b9cc(0x1ea)](0x1),_0x235ada=await _0x51342d[_0x63b9cc(0xe8)](_0x4b99d4,_0x63b9cc(0xde));_0x1c3dd1=JSON[_0x63b9cc(0x175)](_0x235ada);}else _0x1c3dd1=JSON['parse'](_0x113b09);}catch{return console[_0x63b9cc(0xf0)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x1b96f8[_0x63b9cc(0xd9)]){const _0x2508f3=await confirmKey(_0x63b9cc(0x197)+(_0x332533?_0x63b9cc(0x1db):_0x63b9cc(0x94))+'\x20'+_0x5d09f2+'?');if(!_0x2508f3)return console[_0x63b9cc(0xf0)]('Cancelled'),0x0;}let _0x4ba813;_0x332533?_0x4ba813=await withSpinner('Retrying\x20session...',()=>_0x5aed4d[_0x63b9cc(0x165)]['retrySession'](_0x5d09f2,{'fromTask':_0x1c31c9,'retryParams':_0x1c3dd1}),{'verbose':_0x1b96f8['verbose']}):_0x4ba813=await withSpinner(_0x63b9cc(0x145),()=>_0x5aed4d[_0x63b9cc(0x165)]['retryAttempt'](_0x5d09f2,{'resumeFrom':_0x1a7efe,'retryParams':_0x1c3dd1,'force':_0x1b7657}),{'verbose':_0x1b96f8[_0x63b9cc(0x1d8)]});const _0x5a5574=_0x4ba813['data'];return console[_0x63b9cc(0xf0)](_0x63b9cc(0xc5)),console[_0x63b9cc(0xf0)](_0x63b9cc(0x11f)+_0x5a5574[_0x63b9cc(0x1e6)]),console[_0x63b9cc(0xf0)](_0x63b9cc(0xa7)+_0x5a5574[_0x63b9cc(0x90)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a41_0x41ef9d(0x1be);[a41_0x41ef9d(0x1ff)]='Start\x20a\x20workflow\x20run';async['execute'](_0x5b1c71){const _0x45be9e=a41_0x41ef9d,{options:_0x59dd59,args:_0x1da814,tdx:_0x1fd2de}=_0x5b1c71;let _0x12b5c1=_0x1da814[0x0];if(!_0x12b5c1){const _0x55f10d=this['resolveProject']([],_0x59dd59),_0x563b4d=await withSpinner('Loading\x20workflows...',()=>_0x1fd2de['workflow'][_0x45be9e(0x1bc)](_0x55f10d,{'limit':_0x59dd59[_0x45be9e(0xe0)]}),{'verbose':_0x59dd59[_0x45be9e(0x1d8)]}),_0x122046=_0x563b4d['data'];if(_0x122046[_0x45be9e(0x218)]===0x0)return console[_0x45be9e(0xf0)](_0x45be9e(0x142)),!_0x55f10d&&console['error'](a41_0x49e604[_0x45be9e(0xcd)](_0x45be9e(0xd8))),0x1;const _0x4d4a69=_0x122046['map'](_0x4b0cf4=>({'title':_0x4b0cf4[_0x45be9e(0xf2)]?.[_0x45be9e(0x10d)]+'.'+_0x4b0cf4[_0x45be9e(0x10d)],'value':_0x4b0cf4[_0x45be9e(0xf2)]?.[_0x45be9e(0x10d)]+'.'+_0x4b0cf4[_0x45be9e(0x10d)],'description':_0x4b0cf4[_0x45be9e(0x15c)]?_0x45be9e(0x159)+_0x4b0cf4['revision']:undefined})),_0x18bd93=await a41_0x5636da({'type':_0x45be9e(0x18e),'name':'workflow','message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x4d4a69});if(!_0x18bd93['workflow'])return 0x1;_0x12b5c1=_0x18bd93[_0x45be9e(0x165)];}if(!_0x12b5c1[_0x45be9e(0xc6)]('.')){const _0x36183f=this['resolveProject']([],_0x59dd59);if(_0x36183f)_0x12b5c1=_0x36183f+'.'+_0x12b5c1;else return console['error'](a41_0x49e604[_0x45be9e(0x8b)]('Error:'),_0x45be9e(0x19d)),console['error'](a41_0x49e604[_0x45be9e(0xcd)](_0x45be9e(0xd8))),0x1;}const _0xd3ad2f=_0x59dd59['param'],_0x437e95=_0x59dd59[_0x45be9e(0xe3)],_0x4a71c8={};if(_0xd3ad2f&&Array[_0x45be9e(0x1ed)](_0xd3ad2f))for(const _0x19b8cb of _0xd3ad2f){const _0x23d34e=_0x19b8cb[_0x45be9e(0x21c)]('=');if(_0x23d34e===-0x1)return console[_0x45be9e(0xf0)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x19b8cb),console[_0x45be9e(0xf0)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x17a2ad=_0x19b8cb['substring'](0x0,_0x23d34e),_0x1b6dcd=_0x19b8cb[_0x45be9e(0x1ea)](_0x23d34e+0x1);try{_0x4a71c8[_0x17a2ad]=JSON[_0x45be9e(0x175)](_0x1b6dcd);}catch{_0x4a71c8[_0x17a2ad]=_0x1b6dcd;}}_0x59dd59[_0x45be9e(0x1d8)]&&(console[_0x45be9e(0xf0)](_0x45be9e(0x1e4)+_0x12b5c1),Object[_0x45be9e(0x89)](_0x4a71c8)[_0x45be9e(0x218)]>0x0&&console[_0x45be9e(0xf0)]('Parameters:\x20'+JSON[_0x45be9e(0x14d)](_0x4a71c8)),_0x437e95&&console['error'](_0x45be9e(0x1e8)+_0x437e95));const _0x5e8da1=await withSpinner(_0x45be9e(0x18c),()=>_0x1fd2de['workflow'][_0x45be9e(0x20f)](_0x12b5c1,_0x4a71c8,{'sessionTime':_0x437e95}),{'verbose':_0x59dd59[_0x45be9e(0x1d8)]}),_0x142b03=_0x5e8da1['data'];console[_0x45be9e(0xf0)](_0x45be9e(0x127)),console[_0x45be9e(0xf0)]('\x20\x20Attempt\x20ID:\x20'+_0x142b03['id']),console[_0x45be9e(0xf0)](_0x45be9e(0xa7)+_0x142b03['sessionId']),console[_0x45be9e(0xf0)](_0x45be9e(0xbe)+_0x142b03[_0x45be9e(0xf2)]?.[_0x45be9e(0x10d)]),console[_0x45be9e(0xf0)](_0x45be9e(0x202)+_0x142b03[_0x45be9e(0x165)]?.['name']);if(_0x142b03[_0x45be9e(0xf2)]?.['id']&&_0x142b03['sessionId']&&_0x142b03['id']){const _0xb36099=_0x59dd59['site'],_0x12f18d=getConsoleUrl(_0xb36099,'/app/workflows/'+_0x142b03[_0x45be9e(0xf2)]['id']+_0x45be9e(0x88)+_0x142b03[_0x45be9e(0x90)]+_0x45be9e(0x11d)+_0x142b03['id']);console[_0x45be9e(0xf0)]('\x20\x20Console:\x20'+a41_0x49e604['cyan'](_0x12f18d));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a41_0x41ef9d(0x10d)]='workflow:download';[a41_0x41ef9d(0x1ff)]=a41_0x41ef9d(0x171);async['execute'](_0x67f8d1){const _0x2cd9ae=a41_0x41ef9d,{options:_0x111231,args:_0x347622,tdx:_0x38b110}=_0x67f8d1,_0x4f41ca=_0x347622[0x0],_0x454348=_0x347622[0x1]||'.';if(!_0x4f41ca)return console['error'](_0x2cd9ae(0x1f2)),console[_0x2cd9ae(0xf0)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x43cd9f=_0x111231['revision'];_0x111231['verbose']&&(console[_0x2cd9ae(0xf0)]('Project:\x20'+_0x4f41ca),console[_0x2cd9ae(0xf0)]('Output\x20directory:\x20'+_0x454348),_0x43cd9f&&console[_0x2cd9ae(0xf0)](_0x2cd9ae(0x1e9)+_0x43cd9f));const _0x4a0e1b=await withSpinner(_0x2cd9ae(0x16e)+_0x4f41ca+'...',()=>_0x38b110[_0x2cd9ae(0x165)][_0x2cd9ae(0x107)](_0x4f41ca,_0x454348,{'revision':_0x43cd9f}),{'verbose':_0x111231[_0x2cd9ae(0x1d8)]}),_0x486a1f=_0x4a0e1b[_0x2cd9ae(0x203)];return console[_0x2cd9ae(0xf0)](_0x2cd9ae(0x139)+_0x486a1f['projectName']),console['error'](_0x2cd9ae(0x1a3)+_0x486a1f[_0x2cd9ae(0x15c)]),console['error'](_0x2cd9ae(0x15f)+_0x486a1f[_0x2cd9ae(0x1b2)]),console[_0x2cd9ae(0xf0)](_0x2cd9ae(0x1d6)+_0x454348+'/'+_0x486a1f[_0x2cd9ae(0x109)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']='workflow:upload';['description']='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async['execute'](_0x417142){const _0x3b4c33=a41_0x41ef9d,{options:_0x4770e7,args:_0x1e7034,tdx:_0x509e0c}=_0x417142;let _0x2f85dc='.',_0x51ac2d=_0x4770e7[_0x3b4c33(0x10d)];if(_0x1e7034[0x0]){const {promises:_0x315633}=await import('fs');try{const _0x2dfb33=await _0x315633['stat'](_0x1e7034[0x0]);if(_0x2dfb33['isDirectory']())_0x2f85dc=_0x1e7034[0x0];else return console[_0x3b4c33(0xf0)](_0x3b4c33(0x1ac)+_0x1e7034[0x0]+_0x3b4c33(0x1ca)),0x1;}catch{_0x51ac2d=_0x1e7034[0x0],_0x2f85dc='.';}}const _0x32347d=_0x4770e7[_0x3b4c33(0x15c)],_0x3d38df=_0x4770e7[_0x3b4c33(0x1cc)];_0x4770e7[_0x3b4c33(0x1d8)]&&(console[_0x3b4c33(0xf0)](_0x3b4c33(0xdc)+_0x2f85dc),_0x51ac2d&&console[_0x3b4c33(0xf0)](_0x3b4c33(0xc7)+_0x51ac2d),_0x32347d&&console[_0x3b4c33(0xf0)](_0x3b4c33(0x1e9)+_0x32347d),_0x3d38df&&console[_0x3b4c33(0xf0)](_0x3b4c33(0x1a1)));const _0x427fbc=await withSpinner(_0x3b4c33(0x227),()=>_0x509e0c[_0x3b4c33(0x165)]['push'](_0x2f85dc,{'projectName':_0x51ac2d,'revision':_0x32347d,'skipValidation':_0x3d38df}),{'verbose':_0x4770e7['verbose']}),_0x14aec0=_0x427fbc[_0x3b4c33(0x203)];return console[_0x3b4c33(0xf0)]('✔\x20Pushed\x20'+_0x14aec0[_0x3b4c33(0x109)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x14aec0[_0x3b4c33(0x136)]),console[_0x3b4c33(0xf0)](_0x3b4c33(0x1a3)+_0x14aec0[_0x3b4c33(0x15c)]),await this[_0x3b4c33(0x191)](_0x509e0c,_0x14aec0['projectName'],_0x4770e7[_0x3b4c33(0x1b5)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a41_0x41ef9d(0x10d)]=a41_0x41ef9d(0xe1);['description']=a41_0x41ef9d(0xa3);async['execute'](_0x3feb7e){const _0x58b872=a41_0x41ef9d,{options:_0xb395b2,args:_0x356781,tdx:_0x6bde20}=_0x3feb7e,_0x30c100=_0x356781[0x0],_0x40b114=_0x356781[0x1];if(!_0x30c100)return console[_0x58b872(0xf0)](a41_0x49e604[_0x58b872(0x8b)](_0x58b872(0x154)),'Project\x20name\x20is\x20required'),console[_0x58b872(0xf0)](a41_0x49e604['dim'](_0x58b872(0x157))),0x1;const _0x4b0d53=_0xb395b2[_0x58b872(0x15c)];_0xb395b2[_0x58b872(0x1d8)]&&(console['error'](_0x58b872(0xeb)+_0x30c100),_0x40b114&&console[_0x58b872(0xf0)](_0x58b872(0x1aa)+_0x40b114),_0x4b0d53&&console[_0x58b872(0xf0)](_0x58b872(0x1e9)+_0x4b0d53),_0xb395b2[_0x58b872(0x16d)]&&console[_0x58b872(0xf0)]('Dry\x20run:\x20yes'));const _0x192a19=await withSpinner('Pulling\x20project\x20'+_0x30c100+'...',()=>_0x6bde20['workflow']['pullProject'](_0x30c100,{'targetDir':_0x40b114,'revision':_0x4b0d53}),{'verbose':_0xb395b2[_0x58b872(0x1d8)]}),_0x5ca5c9=_0x192a19[_0x58b872(0x203)];_0x5ca5c9[_0x58b872(0xa0)]?console[_0x58b872(0xf0)](_0x58b872(0x146)+_0x5ca5c9['projectName']):console[_0x58b872(0xf0)]('✔\x20Project:\x20'+_0x5ca5c9[_0x58b872(0x109)]);console[_0x58b872(0xf0)]('\x20\x20Revision:\x20'+_0x5ca5c9['revision']),console[_0x58b872(0xf0)](_0x58b872(0x176)+(a41_0x25e51c[_0x58b872(0x1c9)](process['cwd'](),_0x5ca5c9[_0x58b872(0x1e5)])||'.')),console[_0x58b872(0xf0)](_0x58b872(0x115)+a41_0x49e604[_0x58b872(0x17c)]('+'+_0x5ca5c9[_0x58b872(0x143)][_0x58b872(0x144)]+_0x58b872(0x1f0))+',\x20'+(a41_0x49e604[_0x58b872(0xae)]('~'+_0x5ca5c9[_0x58b872(0x143)]['modified']+_0x58b872(0x193))+',\x20')+(a41_0x49e604[_0x58b872(0x8b)]('-'+_0x5ca5c9[_0x58b872(0x143)][_0x58b872(0xa9)]+'\x20deleted')+',\x20')+(''+a41_0x49e604[_0x58b872(0xcd)](_0x5ca5c9['summary']['unchanged']+_0x58b872(0xb8))));for(const _0x55266e of _0x5ca5c9[_0x58b872(0x1f6)]){_0x55266e[_0x58b872(0x118)]===_0x58b872(0x164)&&_0x55266e[_0x58b872(0x1fc)]&&(console[_0x58b872(0xf0)]('\x0a'+a41_0x49e604['cyan'](_0x58b872(0x1e1)+_0x55266e[_0x58b872(0xb1)])),console['error'](_0x55266e[_0x58b872(0x1fc)]));}if(!_0x5ca5c9[_0x58b872(0xd5)])return saveSessionContext({'workflow_project':_0x5ca5c9[_0x58b872(0x109)]},_0xb395b2[_0x58b872(0x1db)]),console[_0x58b872(0xf0)](a41_0x49e604[_0x58b872(0x17c)](_0x58b872(0x150))),console[_0x58b872(0xf0)](a41_0x49e604[_0x58b872(0xcd)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x5ca5c9[_0x58b872(0x109)])),0x0;if(_0xb395b2[_0x58b872(0x16d)])return console[_0x58b872(0xf0)](a41_0x49e604[_0x58b872(0xae)](_0x58b872(0xce))),0x0;if(!_0xb395b2[_0x58b872(0xd9)]){const _0x160386=await confirmKey(_0x58b872(0xab));if(!_0x160386)return console['error'](_0x58b872(0xd2)),0x0;}await withSpinner(_0x58b872(0x14a),()=>_0x6bde20[_0x58b872(0x165)]['applyPullProject'](_0x5ca5c9,{'revision':_0x4b0d53}),{'verbose':_0xb395b2[_0x58b872(0x1d8)]}),saveSessionContext({'workflow_project':_0x5ca5c9[_0x58b872(0x109)]},_0xb395b2[_0x58b872(0x1db)]),console['error'](a41_0x49e604[_0x58b872(0x17c)](_0x58b872(0x113)));const _0x4d0b4d=a41_0x25e51c[_0x58b872(0x1c9)](process[_0x58b872(0x126)](),_0x5ca5c9[_0x58b872(0x1e5)])||'.';return console[_0x58b872(0xf0)](a41_0x49e604[_0x58b872(0xcd)]('\x20\x20Location:\x20'+_0x4d0b4d)),console[_0x58b872(0xf0)](a41_0x49e604['dim'](_0x58b872(0x1cb)+_0x5ca5c9[_0x58b872(0x109)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a41_0x41ef9d(0x16b);['description']=a41_0x41ef9d(0x98);async[a41_0x41ef9d(0x182)](_0x4b3a75){const _0x82c3af=a41_0x41ef9d,{options:_0x33f7be,args:_0x589b94,tdx:_0x4b705d}=_0x4b3a75,_0x209668=this[_0x82c3af(0xba)](_0x589b94,_0x33f7be),_0x2ee041=_0x33f7be[_0x82c3af(0x15c)],_0x51edd4=_0x33f7be[_0x82c3af(0x1cc)];_0x33f7be[_0x82c3af(0x1d8)]&&(_0x209668&&console[_0x82c3af(0xf0)](_0x82c3af(0x105)+_0x209668),_0x2ee041&&console[_0x82c3af(0xf0)]('Revision:\x20'+_0x2ee041),_0x33f7be['dryRun']&&console[_0x82c3af(0xf0)](_0x82c3af(0x19a)),_0x51edd4&&console[_0x82c3af(0xf0)](_0x82c3af(0x1a1)));let _0xac084e;try{_0xac084e=await withSpinner(_0x82c3af(0x152),()=>_0x4b705d[_0x82c3af(0x165)]['preparePushProject']({'sourceDir':_0x209668,'revision':_0x2ee041,'skipValidation':_0x51edd4}),{'verbose':_0x33f7be[_0x82c3af(0x1d8)]});}catch(_0x330f3d){if(_0x330f3d instanceof Error&&_0x330f3d[_0x82c3af(0x1c0)][_0x82c3af(0xc6)](_0x82c3af(0x1eb)))return console[_0x82c3af(0xf0)](a41_0x49e604[_0x82c3af(0x8b)](_0x82c3af(0x154)),_0x82c3af(0x1a2)),_0x33f7be['workflowProject']?console[_0x82c3af(0xf0)](a41_0x49e604[_0x82c3af(0xcd)](_0x82c3af(0x19b)+_0x33f7be[_0x82c3af(0x1ab)]+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x33f7be[_0x82c3af(0x1ab)]+'\x27')):console[_0x82c3af(0xf0)](a41_0x49e604[_0x82c3af(0xcd)](_0x82c3af(0xc2))),0x1;throw _0x330f3d;}const _0x16096f=_0xac084e[_0x82c3af(0x203)];console[_0x82c3af(0xf0)](_0x82c3af(0xa2)+_0x16096f[_0x82c3af(0x109)]),console[_0x82c3af(0xf0)](_0x82c3af(0x1a9)+_0x16096f[_0x82c3af(0xf3)]),console[_0x82c3af(0xf0)](_0x82c3af(0x1a3)+_0x16096f[_0x82c3af(0x15c)]),console[_0x82c3af(0xf0)](_0x82c3af(0x115)+a41_0x49e604[_0x82c3af(0x17c)]('+'+_0x16096f[_0x82c3af(0x143)][_0x82c3af(0x144)]+_0x82c3af(0x1f0))+',\x20'+(a41_0x49e604[_0x82c3af(0xae)]('~'+_0x16096f[_0x82c3af(0x143)][_0x82c3af(0x164)]+_0x82c3af(0x193))+',\x20')+(a41_0x49e604[_0x82c3af(0x8b)]('-'+_0x16096f[_0x82c3af(0x143)][_0x82c3af(0xa9)]+_0x82c3af(0x178))+',\x20')+(''+a41_0x49e604[_0x82c3af(0xcd)](_0x16096f[_0x82c3af(0x143)][_0x82c3af(0x163)]+_0x82c3af(0xb8))));for(const _0x17198d of _0x16096f[_0x82c3af(0x1f6)]){_0x17198d[_0x82c3af(0x118)]===_0x82c3af(0x164)&&_0x17198d[_0x82c3af(0x1fc)]&&(console['error']('\x0a'+a41_0x49e604[_0x82c3af(0xdf)](_0x82c3af(0x1e1)+_0x17198d[_0x82c3af(0xb1)])),console[_0x82c3af(0xf0)](_0x17198d['diff']));}if(!_0x16096f['hasChanges'])return console['error'](a41_0x49e604[_0x82c3af(0x17c)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x82c3af(0x191)](_0x4b705d,_0x16096f['projectName'],_0x33f7be[_0x82c3af(0x1b5)]),0x0;if(_0x33f7be[_0x82c3af(0x16d)])return console[_0x82c3af(0xf0)](a41_0x49e604[_0x82c3af(0xae)](_0x82c3af(0x17b))),0x0;if(!_0x33f7be['yes']){const _0x1825dd=await confirmKey(_0x82c3af(0x199));if(!_0x1825dd)return console[_0x82c3af(0xf0)](_0x82c3af(0xd2)),0x0;}const _0x515c03=await withSpinner(_0x82c3af(0x19c),()=>_0x4b705d['workflow'][_0x82c3af(0x1d4)](_0x16096f),{'verbose':_0x33f7be[_0x82c3af(0x1d8)]}),_0x598d8d=_0x515c03[_0x82c3af(0x203)];return console[_0x82c3af(0xf0)](a41_0x49e604[_0x82c3af(0x17c)](_0x82c3af(0x10e))),console[_0x82c3af(0xf0)]('\x20\x20Project\x20ID:\x20'+_0x598d8d['projectId']),console['error']('\x20\x20Revision:\x20'+_0x598d8d['revision']),await this['showWorkflowConsoleUrl'](_0x4b705d,_0x598d8d[_0x82c3af(0x109)],_0x33f7be['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a41_0x41ef9d(0x10d)]=a41_0x41ef9d(0x137);['description']=a41_0x41ef9d(0x96);async[a41_0x41ef9d(0x182)](_0xebe5fa){const _0x2ef32b=a41_0x41ef9d,{options:_0x30335a,args:_0x3e529d,tdx:_0x39dd0b}=_0xebe5fa,_0x3cf973=this['resolveProjectDir'](_0x3e529d,_0x30335a),_0x331286=_0x30335a[_0x2ef32b(0x10d)],_0x153262=_0x30335a[_0x2ef32b(0x15c)],_0x29d89f=_0x30335a[_0x2ef32b(0x1cc)];if(!_0x3cf973)return console[_0x2ef32b(0xf0)](a41_0x49e604[_0x2ef32b(0x8b)](_0x2ef32b(0x154)),_0x2ef32b(0x1ce)),console[_0x2ef32b(0xf0)](a41_0x49e604['dim'](_0x2ef32b(0x20e))),console[_0x2ef32b(0xf0)](a41_0x49e604[_0x2ef32b(0xcd)](_0x2ef32b(0xa6))),0x1;if(!_0x331286)return console[_0x2ef32b(0xf0)](a41_0x49e604['red'](_0x2ef32b(0x154)),_0x2ef32b(0xf1)),console[_0x2ef32b(0xf0)](a41_0x49e604[_0x2ef32b(0xcd)](_0x2ef32b(0x20e))),0x1;_0x30335a[_0x2ef32b(0x1d8)]&&(console[_0x2ef32b(0xf0)](_0x2ef32b(0x105)+_0x3cf973),console[_0x2ef32b(0xf0)](_0x2ef32b(0x135)+_0x331286),_0x153262&&console[_0x2ef32b(0xf0)]('Revision:\x20'+_0x153262),_0x30335a[_0x2ef32b(0x16d)]&&console[_0x2ef32b(0xf0)](_0x2ef32b(0x19a)),_0x29d89f&&console[_0x2ef32b(0xf0)](_0x2ef32b(0x1a1)));const _0xf69a5d=await withSpinner(_0x2ef32b(0x170),()=>_0x39dd0b[_0x2ef32b(0x165)][_0x2ef32b(0x192)](_0x3cf973,_0x331286,{'revision':_0x153262,'skipValidation':_0x29d89f}),{'verbose':_0x30335a[_0x2ef32b(0x1d8)]}),_0x5353bc=_0xf69a5d[_0x2ef32b(0x203)];console['error'](_0x2ef32b(0x1f3)+_0x5353bc[_0x2ef32b(0xf3)]);_0x5353bc['sourceProjectName']&&console['error'](_0x2ef32b(0x1ec)+_0x5353bc[_0x2ef32b(0x207)]);console[_0x2ef32b(0xf0)](_0x2ef32b(0x135)+_0x5353bc['newProjectName']),console[_0x2ef32b(0xf0)](_0x2ef32b(0x1e9)+_0x5353bc['revision']),console[_0x2ef32b(0xf0)](_0x2ef32b(0x15d)+_0x5353bc['fileCount']);_0x5353bc[_0x2ef32b(0x9b)]&&(console['error'](a41_0x49e604[_0x2ef32b(0xae)](_0x2ef32b(0x108)+_0x5353bc[_0x2ef32b(0x1d3)]+_0x2ef32b(0x1a6)+_0x5353bc[_0x2ef32b(0xa4)]+')')),console[_0x2ef32b(0xf0)](a41_0x49e604[_0x2ef32b(0xae)](_0x2ef32b(0x195))));if(_0x30335a[_0x2ef32b(0x16d)])return console[_0x2ef32b(0xf0)](a41_0x49e604[_0x2ef32b(0xae)](_0x2ef32b(0x1fd))),0x0;if(!_0x30335a['yes']){const _0x2446f9=_0x5353bc[_0x2ef32b(0x207)]||a41_0x25e51c[_0x2ef32b(0x129)](_0x3cf973),_0x3b50d7=_0x5353bc['targetExists']?_0x2ef32b(0x125)+_0x331286+_0x2ef32b(0xed):_0x2ef32b(0x209)+_0x2446f9+_0x2ef32b(0x221)+_0x331286+'\x22?',_0x393b90=await confirmKey(_0x3b50d7);if(!_0x393b90)return console[_0x2ef32b(0xf0)](_0x2ef32b(0xd2)),0x0;}const _0x1b77d8=await withSpinner(_0x5353bc[_0x2ef32b(0x9b)]?_0x2ef32b(0x1bb)+_0x331286+_0x2ef32b(0xe7):_0x2ef32b(0x1fa)+_0x331286+_0x2ef32b(0xe7),()=>_0x39dd0b[_0x2ef32b(0x165)][_0x2ef32b(0x179)](_0x5353bc),{'verbose':_0x30335a[_0x2ef32b(0x1d8)]}),_0x10566e=_0x1b77d8[_0x2ef32b(0x203)];return console['error'](a41_0x49e604['green'](_0x5353bc[_0x2ef32b(0x9b)]?_0x2ef32b(0x148):_0x2ef32b(0x1b4))),console['error']('\x20\x20Project:\x20'+_0x10566e[_0x2ef32b(0x1d3)]),console[_0x2ef32b(0xf0)](_0x2ef32b(0x8c)+_0x10566e[_0x2ef32b(0x1d7)]),console['error'](_0x2ef32b(0x1a3)+_0x10566e[_0x2ef32b(0x15c)]),await this[_0x2ef32b(0x191)](_0x39dd0b,_0x10566e['newProjectName'],_0x30335a[_0x2ef32b(0x1b5)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a41_0x41ef9d(0xfd);[a41_0x41ef9d(0x1ff)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a41_0x41ef9d(0x182)](_0x44af76){const _0x14a35e=a41_0x41ef9d,{options:_0xcb9df3,args:_0x56d00a,tdx:_0x3ed951}=_0x44af76,_0x5989de=_0x56d00a[0x0];if(!_0x5989de)return console[_0x14a35e(0xf0)](_0x14a35e(0x1f9)),console[_0x14a35e(0xf0)](_0x14a35e(0xb0)),0x1;_0xcb9df3[_0x14a35e(0x1d8)]&&console[_0x14a35e(0xf0)](_0x14a35e(0xeb)+_0x5989de);if(!_0xcb9df3[_0x14a35e(0xd9)]){const _0x59aada=await confirmKey(_0x14a35e(0x160)+_0x5989de+_0x14a35e(0xe2));if(!_0x59aada)return console[_0x14a35e(0xf0)](_0x14a35e(0xd2)),0x0;}const _0x4ffd7e=await withSpinner(_0x14a35e(0xaf)+_0x5989de+_0x14a35e(0xe7),()=>_0x3ed951['workflow']['delete'](_0x5989de),{'verbose':_0xcb9df3[_0x14a35e(0x1d8)]}),_0x5fd952=_0x4ffd7e['data'];return console[_0x14a35e(0xf0)]('✔\x20Deleted\x20project\x20'+_0x5fd952['projectName']),console[_0x14a35e(0xf0)](_0x14a35e(0x8c)+_0x5fd952[_0x14a35e(0x136)]),0x0;}}export function parseKeyValue(_0x510828){const _0x868c50=a41_0x41ef9d,_0x2465f9=_0x510828[_0x868c50(0x21c)]('=');if(_0x2465f9===-0x1)throw new Error(_0x868c50(0x147)+_0x510828+_0x868c50(0x1bf));const _0x5b6369=_0x510828['substring'](0x0,_0x2465f9),_0x189a78=_0x510828['substring'](_0x2465f9+0x1);if(!_0x5b6369)throw new Error(_0x868c50(0x120));return{'key':_0x5b6369,'value':_0x189a78};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a41_0x41ef9d(0x10d)]=a41_0x41ef9d(0x1b9);[a41_0x41ef9d(0x1ff)]=a41_0x41ef9d(0x8e);async[a41_0x41ef9d(0x182)](_0x3a2dfb){const _0x347492=a41_0x41ef9d,{options:_0x1594cc,args:_0x365eac,tdx:_0x494c02}=_0x3a2dfb,_0x4e0e75=this['requireProject'](_0x365eac,_0x1594cc);if(!_0x4e0e75)return 0x1;_0x1594cc[_0x347492(0x1d8)]&&console[_0x347492(0xf0)](_0x347492(0xeb)+_0x4e0e75);const _0x3dbd96=await withSpinner(_0x347492(0x184),()=>_0x494c02[_0x347492(0x165)]['listSecrets'](_0x4e0e75),{'verbose':_0x1594cc['verbose']}),{secrets:_0x4c16a8}=_0x3dbd96[_0x347492(0x203)];return console['error'](_0x347492(0x213)+_0x4c16a8['length']+_0x347492(0x1f1)+(_0x4c16a8[_0x347492(0x218)]!==0x1?'s':'')),await handleSDKOutput(_0x4c16a8,_0x1594cc),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a41_0x41ef9d(0x10d)]=a41_0x41ef9d(0xf8);[a41_0x41ef9d(0x1ff)]=a41_0x41ef9d(0x102);async[a41_0x41ef9d(0x182)](_0x4b4ea2){const _0x4aee28=a41_0x41ef9d,{options:_0x1ee4bf,args:_0x3f182c,tdx:_0x433a28}=_0x4b4ea2;let _0x12e33d,_0x53ac1c;if(_0x3f182c[_0x4aee28(0x218)]>=0x2)_0x12e33d=_0x3f182c[0x0],_0x53ac1c=_0x3f182c[0x1];else{if(_0x3f182c[_0x4aee28(0x218)]===0x1&&_0x1ee4bf[_0x4aee28(0x1ab)])_0x12e33d=_0x1ee4bf[_0x4aee28(0x1ab)],_0x53ac1c=_0x3f182c[0x0];else return _0x3f182c['length']===0x1?(console[_0x4aee28(0xf0)](_0x4aee28(0x1f2)),console[_0x4aee28(0xf0)](_0x4aee28(0xd8)),0x1):(console[_0x4aee28(0xf0)](_0x4aee28(0x1d9)),console['error'](_0x4aee28(0x97)),0x1);}let _0x508f7e,_0x395f1c;try{({key:_0x508f7e,value:_0x395f1c}=parseKeyValue(_0x53ac1c));}catch(_0x2b5fa4){return _0x2b5fa4 instanceof Error&&console[_0x4aee28(0xf0)](a41_0x49e604['red'](_0x4aee28(0x154)),_0x2b5fa4['message']),0x1;}_0x1ee4bf['verbose']&&(console[_0x4aee28(0xf0)](_0x4aee28(0xeb)+_0x12e33d),console[_0x4aee28(0xf0)](_0x4aee28(0xb6)+_0x508f7e));const _0x3bcec1=await withSpinner(_0x4aee28(0x187),()=>_0x433a28[_0x4aee28(0x165)][_0x4aee28(0xc9)](_0x12e33d,_0x508f7e,_0x395f1c),{'verbose':_0x1ee4bf[_0x4aee28(0x1d8)]}),_0x2261b7=_0x3bcec1[_0x4aee28(0x203)];return console[_0x4aee28(0xf0)]('✔\x20Secret\x20\x27'+_0x2261b7[_0x4aee28(0xfb)]+_0x4aee28(0x12a)+_0x2261b7['projectName']+'\x27'),(_0x1ee4bf[_0x4aee28(0xfc)]||_0x1ee4bf[_0x4aee28(0xb7)])&&await handleSingleObjectOutput(_0x2261b7,_0x1ee4bf),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a41_0x41ef9d(0x10d)]=a41_0x41ef9d(0xbc);['description']='Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project';async[a41_0x41ef9d(0x182)](_0x508a6c){const _0x3b655b=a41_0x41ef9d,{options:_0x174383,args:_0x15ee8f,tdx:_0x2119d4}=_0x508a6c;let _0x2f5c52,_0x4fe706;if(_0x15ee8f['length']>=0x2)_0x2f5c52=_0x15ee8f[0x0],_0x4fe706=_0x15ee8f[0x1];else{if(_0x15ee8f[_0x3b655b(0x218)]===0x1&&_0x174383[_0x3b655b(0x1ab)])_0x2f5c52=_0x174383[_0x3b655b(0x1ab)],_0x4fe706=_0x15ee8f[0x0];else return _0x15ee8f[_0x3b655b(0x218)]===0x1?(console['error'](_0x3b655b(0x1f2)),console['error'](_0x3b655b(0xd8)),0x1):(console[_0x3b655b(0xf0)](_0x3b655b(0x18d)),console[_0x3b655b(0xf0)](_0x3b655b(0x12b)),0x1);}_0x174383[_0x3b655b(0x1d8)]&&(console[_0x3b655b(0xf0)](_0x3b655b(0xeb)+_0x2f5c52),console[_0x3b655b(0xf0)](_0x3b655b(0xb6)+_0x4fe706));if(!_0x174383[_0x3b655b(0xd9)]){const _0x2ad22b=await confirmKey(_0x3b655b(0x1af)+_0x4fe706+'\x27\x20from\x20project\x20\x27'+_0x2f5c52+'\x27?');if(!_0x2ad22b)return console[_0x3b655b(0xf0)](_0x3b655b(0xd2)),0x0;}const _0x1c8400=await withSpinner(_0x3b655b(0x172),()=>_0x2119d4['workflow'][_0x3b655b(0xd0)](_0x2f5c52,_0x4fe706),{'verbose':_0x174383[_0x3b655b(0x1d8)]}),_0x12d1e3=_0x1c8400[_0x3b655b(0x203)];return console['error']('✔\x20Secret\x20\x27'+_0x12d1e3[_0x3b655b(0xfb)]+_0x3b655b(0x161)+_0x12d1e3[_0x3b655b(0x109)]+'\x27'),(_0x174383[_0x3b655b(0xfc)]||_0x174383[_0x3b655b(0xb7)])&&await handleSingleObjectOutput(_0x12d1e3,_0x174383),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(_0x2514b6){const _0x5ce2d1=a41_0x41ef9d,_0x2e96de=Math['floor'](_0x2514b6/0x3e8),_0x1dd9c=Math['floor'](_0x2e96de/0x3c),_0x3d660c=Math[_0x5ce2d1(0x204)](_0x1dd9c/0x3c),_0x5868e0=Math[_0x5ce2d1(0x204)](_0x3d660c/0x18);if(_0x5868e0>0x0){const _0x11cc1f=_0x3d660c%0x18;return _0x11cc1f>0x0?_0x5868e0+'d\x20'+_0x11cc1f+'h':_0x5868e0+'d';}else{if(_0x3d660c>0x0){const _0xdbb045=_0x1dd9c%0x3c;return _0xdbb045>0x0?_0x3d660c+'h\x20'+_0xdbb045+'m':_0x3d660c+'h';}else{if(_0x1dd9c>0x0){const _0x506c3d=_0x2e96de%0x3c;return _0x506c3d>0x0?_0x1dd9c+'m\x20'+_0x506c3d+'s':_0x1dd9c+'m';}else return _0x2e96de+'s';}}}function formatTimestamp(_0x120db4,_0x2900c9){const _0xec710f=a41_0x41ef9d,_0x477104=new Date(_0x120db4),_0x2aab04=String(_0x477104[_0xec710f(0x220)]())[_0xec710f(0x140)](0x2,'0'),_0x426ed2=String(_0x477104[_0xec710f(0x174)]())[_0xec710f(0x140)](0x2,'0'),_0x14a4c4=_0x2aab04+':'+_0x426ed2,_0x52f504=_0x477104[_0xec710f(0x1b7)]()===_0x2900c9[_0xec710f(0x1b7)]()&&_0x477104[_0xec710f(0x19f)]()===_0x2900c9['getMonth']()&&_0x477104[_0xec710f(0x8f)]()===_0x2900c9[_0xec710f(0x8f)]();if(_0x52f504)return _0x14a4c4;else{const _0x2bc397=String(_0x477104[_0xec710f(0x19f)]()+0x1)[_0xec710f(0x140)](0x2,'0'),_0x11f5cc=String(_0x477104[_0xec710f(0x8f)]())['padStart'](0x2,'0');return _0x2bc397+'-'+_0x11f5cc+'\x20'+_0x14a4c4;}}function formatDate(_0x404204){const _0x910a5d=a41_0x41ef9d,_0x4d44ce=_0x404204[_0x910a5d(0x1b7)](),_0x23c35c=String(_0x404204[_0x910a5d(0x19f)]()+0x1)[_0x910a5d(0x140)](0x2,'0'),_0x4d7ca3=String(_0x404204[_0x910a5d(0x8f)]())[_0x910a5d(0x140)](0x2,'0');return _0x4d44ce+'-'+_0x23c35c+'-'+_0x4d7ca3;}function a41_0x5824(){const _0x2437e4=['map','\x20logs','sourceProjectName','reason','\x0aClone\x20\x22','Latest\x20session\x20has\x20no\x20attempt','toISOString','\x0aPolling...\x20(','Getting\x20attempt\x20tasks...','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','run','status','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','workflow:retry','✔\x20Found\x20','from','\x20of\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Project\x20name\x20is\x20required','length','No\x20attempts\x20found\x20in\x20project:\x20','2213973EgeUMp','\x20(use\x20--limit\x20to\x20show\x20more)','indexOf','sys','No\x20attempts\x20found','min','getHours','\x22\x20to\x20new\x20project\x20\x22','No\x20sessions\x20found','resolveProjectId','workflow:timeline','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','fromTask','Pushing\x20workflow\x20project...','\x20from\x20session\x20','sort','session:','renderSessionsTimeline','workflow:logs','follow','/sessions/','keys','\x20\x20tdx\x20wf\x20use\x20<project>','red','\x20\x20Project\x20ID:\x20','1683147MSixgI','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','getDate','sessionId','value','updatedAt','10rgwnOa','attempt','sessions','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Session\x20','No\x20log\x20content\x20found','targetExists','session_id','\x20session','409328oDcZVt','toLowerCase','isNewProject','isTTY','✔\x20Project:\x20','Pull\x20workflow\x20project\x20to\x20local\x20folder','existingProjectId','state','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','\x20\x20Session\x20ID:\x20','clear','deleted','1304htmkRC','\x0aApply\x20these\x20changes?','MIN_TIMELINE_WIDTH','45ksJeRE','yellow','Deleting\x20project\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','path','localeCompare','pending','Status:\x20','Project\x20filter:\x20','Key:\x20','jsonl','\x20unchanged','1769226VzsXtb','resolveProjectDir','buildTimelineData','workflow:secrets:delete','context','\x20\x20Project:\x20','Filter:\x20','navigateSessionsInteractive','Include\x20retried:\x20yes','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','includeRetried','has','✔\x20Retry\x20started','includes','Project\x20name:\x20','params','setSecret','Killing\x20attempt...','resolveProject','splice','dim','\x0aDry\x20run\x20-\x20no\x20files\x20written','Loading\x20sessions...','deleteSecret','durationMs','Cancelled','find','split','hasChanges','retryAttemptName','stdout','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','yes','done','Listing\x20workflow\x20attempts...','Project\x20directory:\x20','workflow:projects','utf-8','cyan','limit','workflow:pull','\x22?\x20This\x20cannot\x20be\x20undone.','sessionTime','getTime','workflow:use','output','...','readFile','displayLine','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','Project:\x20','round','\x22\x20with\x20new\x20revision?','tdx\x20wf\x20attempt\x20','all','error','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','project','sourceDir','replace',',\x20Workflow:\x20','Force:\x20yes','No\x20sessions\x20found\x20in\x20project:\x20','workflow:secrets:set','No\x20matching\x20sessions\x20found','index','key','json','workflow:delete','blue','slice','end','resolve','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Session\x20not\x20found:\x20','\x27...','Source\x20directory:\x20','\x20has\x20no\x20attempts','download','\x0a⚠\x20Project\x20\x22','projectName','startTime','tasks','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','name','✔\x20Push\x20complete','Total:\x20','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','log','trim','✔\x20Pull\x20complete','MAX_LABEL_COUNT','\x20\x20Changes:\x20','join','Failed\x20to\x20fetch\x20attempt\x20data','type','MIN_LABEL_COUNT','fill','push','renderSingleTimeline','/attempt/','\x20\x20Console:\x20','\x20\x20New\x20attempt\x20ID:\x20','Key\x20cannot\x20be\x20empty','No\x20projects\x20match\x20pattern:\x20','Loading\x20session...','Attempt\x20ID:\x20','parseProjectWorkflowPattern','\x0aUpdate\x20existing\x20project\x20\x22','cwd','✔\x20Workflow\x20run\x20started','No\x20workflow\x20projects\x20found','basename','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','duration','unknown','startedAt','\x20task','rows','window','metadata','✔\x20Workflow\x20project\x20context\x20cleared.','🔄\x20','New\x20project\x20name:\x20','projectId','workflow:clone','Listing\x20workflow\x20projects...','✔\x20Downloaded\x20','POLL_INTERVAL_MS','Listing\x20workflow\x20sessions...','2xSAYDj','includeSubtasks','workflow:attempt','set','padStart','task','No\x20workflows\x20found','summary','new','Retrying\x20attempt...','✔\x20New\x20project:\x20','Invalid\x20format:\x20','✔\x20Project\x20updated','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Writing\x20files...','No\x20sessions\x20with\x20timing\x20information','2988giDeps','stringify','List\x20all\x20workflow\x20projects','repeat','\x0a✔\x20Already\x20up\x20to\x20date','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Analyzing\x20changes...','format','Error:','Including\x20subtasks:\x20yes','List\x20workflows','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','revision:\x20','planned','Filter:\x20project=','revision','Files\x20to\x20upload:\x20','createdAt','\x20\x20Files\x20extracted:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','renderTimeline','unchanged','modified','workflow','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','lastAttempt','workflow:sessions','No\x20workflow\x20sessions\x20found','requireProject','workflow:push','\x0a✔\x20Attempt\x20complete','dryRun','Downloading\x20project\x20','LABEL_WIDTH_DIVISOR','Analyzing\x20project...','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Deleting\x20secret...','force','getMinutes','parse','\x20\x20Target:\x20','filter','\x20deleted','executeCloneProject','fullName','\x0aDry\x20run\x20-\x20nothing\x20pushed','green','max','ICON_SPACING','Getting\x20attempt\x20details...','get','table','execute','match','Listing\x20secrets...','success','pollTimeline','Setting\x20secret...','finishedAt','\x20workflow','title','write','Starting\x20workflow\x20run...','Error:\x20Secret\x20key\x20is\x20required','select','taskName','some','showWorkflowConsoleUrl','prepareCloneProject','\x20modified','MAX_TIMELINE_WIDTH','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','No\x20workflows\x20found\x20in\x20project:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','15946oHJuSi','\x0aPush\x20these\x20changes?','Dry\x20run:\x20yes','Tip:\x20cd\x20to\x20workflows/','Pushing\x20project...','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','\x1b[1A\x1b[2K','getMonth','list','Validation:\x20skipped','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','\x20\x20Revision:\x20','workflowName','canceling','\x22\x20already\x20exists\x20(ID:\x20','From\x20task:\x20','Select\x20a\x20task\x20to\x20view\x20logs:','\x20\x20Source:\x20','Target\x20directory:\x20','workflowProject','Error:\x20','Show\x20specific\x20attempt\x20details','tdx.json','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Reason:\x20','icon','filesExtracted','every','✔\x20Clone\x20complete','site','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','getFullYear','generateSessionTimelineRows','workflow:secrets:list','\x20-\x20','Updating\x20','workflows','💡\x20Tip:\x20Use\x20','workflow:run','.\x20Expected\x20format:\x20KEY=VALUE','message','Kill\x20a\x20running\x20attempt','white','ICON_WIDTH','start','Show\x20tasks\x20for\x20an\x20attempt','12133YHtZRk','group_error','Select\x20a\x20session\x20to\x20view\x20timeline:','relative','\x20is\x20not\x20a\x20directory','\x20\x20Session\x20context\x20set\x20to:\x20','skipValidation','logs','Source\x20directory\x20is\x20required','MAX_TASKS_DISPLAY','running','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20to\x20see\x20detailed\x20logs','newProjectName','executePushProject','fileSize','\x20\x20Location:\x20','newProjectId','verbose','Error:\x20KEY=VALUE\x20is\x20required','now','session','\x20(system)','columns','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','---\x20','Error:\x20Attempt\x20ID\x20is\x20required','326119ugOvJH','Workflow:\x20','targetDir','attemptId','Retry\x20a\x20session\x20or\x20attempt','Session\x20time:\x20','Revision:\x20','substring','No\x20workflow\x20tdx.json\x20found','Source\x20project:\x20','isArray','✔\x20Showing\x20','kill','\x20new','\x20secret','Error:\x20Project\x20name\x20is\x20required','Source:\x20','\x20tasks','startsWith','changes','autocomplete','Target:\x20','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Cloning\x20to\x20','cancelRequested','diff','\x0aDry\x20run\x20-\x20no\x20project\x20created','No\x20log\x20files\x20found\x20for\x20this\x20attempt','description','Warning:','No\x20sessions\x20found\x20for:\x20','\x20\x20Workflow:\x20','data','floor'];a41_0x5824=function(){return _0x2437e4;};return a41_0x5824();}function getTaskStateIcon(_0x49f91f){const _0x463a58={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x463a58[_0x49f91f]||'⚪';}function getBarChar(_0x7b1c8d){const _0x5911a8=a41_0x41ef9d;return _0x7b1c8d==='error'||_0x7b1c8d===_0x5911a8(0x1c7)?'×':'─';}function getBarColor(_0x3546f7){const _0x1e7579=a41_0x41ef9d,_0x5d6375={'success':a41_0x49e604[_0x1e7579(0x17c)],'error':a41_0x49e604[_0x1e7579(0x8b)],'group_error':a41_0x49e604[_0x1e7579(0x8b)],'running':a41_0x49e604[_0x1e7579(0xfe)],'blocked':a41_0x49e604['yellow'],'planned':a41_0x49e604['dim'],'canceling':a41_0x49e604[_0x1e7579(0xae)]};return _0x5d6375[_0x3546f7]||a41_0x49e604[_0x1e7579(0x1c2)];}function parseTaskName(_0x4d9122){const _0x35685a=a41_0x41ef9d;let _0x43b69a=_0x4d9122[_0x35685a(0xf4)](/^\++/,'');const _0x6646d=_0x43b69a[_0x35685a(0xd4)]('+'),_0x3d341b=_0x6646d['length']>0x1?_0x6646d[_0x35685a(0x218)]-0x2:0x0,_0x141ccb=_0x6646d[_0x6646d[_0x35685a(0x218)]-0x1]||_0x43b69a;return{'level':_0x3d341b,'name':'+'+_0x141ccb};}function truncateTaskName(_0x2aa8f8,_0x5e15ab){const _0x2cbf08=a41_0x41ef9d,_0x2e7343=stringWidth(_0x2aa8f8);if(_0x2e7343<=_0x5e15ab)return _0x2aa8f8;let _0x41b252=_0x2aa8f8;while(stringWidth(_0x41b252+'…')>_0x5e15ab&&_0x41b252['length']>0x0){_0x41b252=_0x41b252[_0x2cbf08(0xff)](0x0,-0x1);}return _0x41b252+'…';}function calculateTimeScale(_0x2d0cbb,_0x3934ba){const _0x48def0=a41_0x41ef9d;return{'startTime':_0x2d0cbb['start'],'endTime':_0x2d0cbb[_0x48def0(0x100)],'durationMs':_0x2d0cbb[_0x48def0(0x12c)],'msPerChar':_0x2d0cbb[_0x48def0(0x12c)]/_0x3934ba};}function timeToPosition(_0x38596f,_0x128db1,_0x495177){const _0x4208ce=a41_0x41ef9d,_0x102b1b=_0x38596f-_0x128db1['startTime'],_0x5713ba=Math[_0x4208ce(0x204)](_0x102b1b/_0x128db1['msPerChar']);return Math['max'](0x0,Math['min'](_0x5713ba,_0x495177));}function renderTimeAxis(_0x308c10,_0x2e96c5){const _0x420c8b=a41_0x41ef9d,_0x242e3c=Math[_0x420c8b(0x21f)](TIMELINE_CONFIG[_0x420c8b(0x114)],Math['max'](TIMELINE_CONFIG[_0x420c8b(0x119)],Math['floor'](_0x2e96c5/TIMELINE_CONFIG[_0x420c8b(0x16f)]))),_0x547168=_0x308c10[_0x420c8b(0xd1)]/(_0x242e3c-0x1),_0x559f52=new Date(_0x308c10[_0x420c8b(0x10a)]),_0x3691a3=[];for(let _0x2598e7=0x0;_0x2598e7<_0x242e3c;_0x2598e7++){const _0x5a9298=_0x308c10[_0x420c8b(0x10a)]+_0x2598e7*_0x547168,_0x6b2f0c=timeToPosition(_0x5a9298,_0x308c10,_0x2e96c5),_0x1274d2=formatTimestamp(_0x5a9298,_0x559f52);_0x3691a3[_0x420c8b(0x11b)]({'pos':_0x6b2f0c,'text':_0x1274d2});}const _0x267593=new Array(_0x2e96c5)[_0x420c8b(0x11a)]('\x20');let _0x587caa=-0x1;for(const {pos:_0x56c277,text:_0xde6fca}of _0x3691a3){let _0x26e1b4=Math[_0x420c8b(0x17d)](0x0,_0x56c277-Math[_0x420c8b(0x204)](_0xde6fca[_0x420c8b(0x218)]/0x2));_0x26e1b4<=_0x587caa+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x26e1b4=_0x587caa+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x26e1b4+_0xde6fca[_0x420c8b(0x218)]>_0x2e96c5&&(_0x26e1b4=_0x2e96c5-_0xde6fca[_0x420c8b(0x218)]);if(_0x26e1b4>=0x0&&_0x26e1b4+_0xde6fca[_0x420c8b(0x218)]<=_0x2e96c5&&_0x26e1b4>_0x587caa){for(let _0x5822c1=0x0;_0x5822c1<_0xde6fca[_0x420c8b(0x218)];_0x5822c1++){_0x267593[_0x26e1b4+_0x5822c1]=_0xde6fca[_0x5822c1];}_0x587caa=_0x26e1b4+_0xde6fca['length']-0x1;}}return _0x267593['join']('');}function renderTaskRow(_0x2827eb,_0x1c515c,_0x2b1875,_0xd0ef5f){const _0x4221e2=a41_0x41ef9d,{level:_0x494c10,name:_0x439881}=parseTaskName(_0x2827eb[_0x4221e2(0x10d)]),_0x551cc2='\x20'[_0x4221e2(0x14f)](_0x494c10),_0x49788d=_0x2827eb[_0x4221e2(0x131)]?'('+formatElapsed(_0x2827eb[_0x4221e2(0x131)][_0x4221e2(0x12c)])+')':'',_0x127f79=stringWidth(_0x49788d),_0x2e4b1=_0x494c10*0x1,_0x5f21bb=_0xd0ef5f-_0x2e4b1-_0x127f79-0x1,_0x389697=truncateTaskName(_0x439881,_0x5f21bb),_0x1dc5d6=_0x551cc2+_0x389697,_0x804ca6=stringWidth(_0x1dc5d6),_0x5f12c5=_0xd0ef5f-_0x804ca6-_0x127f79,_0x38b374=_0x1dc5d6+'\x20'['repeat'](Math[_0x4221e2(0x17d)](0x1,_0x5f12c5))+a41_0x49e604[_0x4221e2(0xcd)](_0x49788d),_0x2d5d02=getTaskStateIcon(_0x2827eb[_0x4221e2(0xa5)]),_0x22a91b=new Array(_0x2b1875)[_0x4221e2(0x11a)]('\x20');if(_0x2827eb['window']){const _0x4606a7=timeToPosition(_0x2827eb[_0x4221e2(0x131)][_0x4221e2(0x1c4)],_0x1c515c,_0x2b1875),_0x213224=timeToPosition(_0x2827eb[_0x4221e2(0x131)][_0x4221e2(0x100)],_0x1c515c,_0x2b1875),_0x2eca62=getBarChar(_0x2827eb[_0x4221e2(0xa5)]),_0x2ca168=Math[_0x4221e2(0x17d)](_0x4606a7+0x1,_0x213224);for(let _0x1b4d11=_0x4606a7;_0x1b4d11<Math['min'](_0x2ca168,_0x2b1875);_0x1b4d11++){_0x22a91b[_0x1b4d11]=_0x2eca62;}}const _0x52399c=getBarColor(_0x2827eb[_0x4221e2(0xa5)]),_0x18142e=_0x22a91b[_0x4221e2(0x205)](_0x34a3d7=>_0x34a3d7==='\x20'?'\x20':_0x52399c(_0x34a3d7))[_0x4221e2(0x116)]('');return _0x2d5d02+'\x20'+_0x38b374+'│'+_0x18142e+'│';}function a41_0x7e35(_0x290bcd,_0x430c63){_0x290bcd=_0x290bcd-0x82;const _0x582429=a41_0x5824();let _0x7e3520=_0x582429[_0x290bcd];return _0x7e3520;}function calculateStats(_0x19908a){const _0x2aa4fe=a41_0x41ef9d,_0x243c77={'total':_0x19908a[_0x2aa4fe(0x218)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x7b0376 of _0x19908a){if(_0x7b0376[_0x2aa4fe(0xa5)]===_0x2aa4fe(0x185))_0x243c77[_0x2aa4fe(0x185)]++;else{if(_0x7b0376[_0x2aa4fe(0xa5)]===_0x2aa4fe(0xf0)||_0x7b0376[_0x2aa4fe(0xa5)]===_0x2aa4fe(0x1c7))_0x243c77[_0x2aa4fe(0xf0)]++;else _0x7b0376['state']===_0x2aa4fe(0x1d0)?_0x243c77['running']++:_0x243c77['pending']++;}}return _0x243c77;}function formatStats(_0x26e6eb){const _0x1c1e46=a41_0x41ef9d;return[_0x1c1e46(0x10f)+_0x26e6eb['total'],'✅\x20'+_0x26e6eb[_0x1c1e46(0x185)],'❌\x20'+_0x26e6eb[_0x1c1e46(0xf0)],_0x1c1e46(0x134)+_0x26e6eb['running'],'⏳\x20'+_0x26e6eb[_0x1c1e46(0xb3)]][_0x1c1e46(0x116)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a41_0x41ef9d(0x10d)]=a41_0x41ef9d(0x224);['description']='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async['execute'](_0xe4bd37){const _0x24fbbb=a41_0x41ef9d,{options:_0x2ac03c,args:_0x316229,tdx:_0x3a8329}=_0xe4bd37;let _0xb75f5b,_0x85ccd0,_0x76627e=![];if(_0x316229[0x0]){if(_0x316229[0x0][_0x24fbbb(0xc6)]('.')){const _0x168234=this[_0x24fbbb(0x124)](_0x316229,_0x2ac03c);if(!_0x168234)return 0x1;_0xb75f5b=_0x168234[_0x24fbbb(0x109)],_0x85ccd0=_0x168234['workflowName'];}else{_0x85ccd0=_0x316229[0x0],_0xb75f5b=_0x2ac03c['workflowProject'];if(!_0xb75f5b)return console[_0x24fbbb(0xf0)](a41_0x49e604[_0x24fbbb(0x8b)](_0x24fbbb(0x154)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x76627e=!![];}}else{const _0x16951e=this[_0x24fbbb(0x124)](_0x316229,_0x2ac03c);if(!_0x16951e)return 0x1;_0xb75f5b=_0x16951e[_0x24fbbb(0x109)],_0x85ccd0=_0x16951e[_0x24fbbb(0x1a4)];}if(_0x2ac03c[_0x24fbbb(0x1d8)]){if(_0xb75f5b&&_0x85ccd0)console[_0x24fbbb(0xf0)](_0x24fbbb(0xbf)+_0xb75f5b+'.'+_0x85ccd0);else _0xb75f5b&&console[_0x24fbbb(0xf0)]('Filter:\x20project='+_0xb75f5b);}const _0x1670eb=_0x2ac03c['attemptId'],_0x20d51e=_0x2ac03c[_0x24fbbb(0x90)];if(_0x1670eb){_0x20d51e&&console[_0x24fbbb(0xf0)](a41_0x49e604[_0x24fbbb(0xae)](_0x24fbbb(0x200)),_0x24fbbb(0x1e0));const _0x5cad54=_0x2ac03c[_0x24fbbb(0x87)];return _0x5cad54?await this[_0x24fbbb(0x186)](_0xe4bd37,_0x1670eb):await this[_0x24fbbb(0x11c)](_0xe4bd37,_0x1670eb,_0x2ac03c),0x0;}if(_0x20d51e){const _0x1e0ff5=await withSpinner(_0x24fbbb(0x122),()=>_0x3a8329[_0x24fbbb(0x165)][_0x24fbbb(0x95)]({'projectName':_0xb75f5b,'workflowName':_0x85ccd0,'limit':0x64}),{'verbose':_0x2ac03c[_0x24fbbb(0x1d8)]}),_0x3244a4=_0x1e0ff5[_0x24fbbb(0x203)][_0x24fbbb(0xd3)](_0x314a30=>_0x314a30['id']===_0x20d51e);if(!_0x3244a4)return console[_0x24fbbb(0xf0)](a41_0x49e604[_0x24fbbb(0x8b)]('Error:'),_0x24fbbb(0x103)+_0x20d51e),0x1;if(!_0x3244a4['lastAttempt']?.['id'])return console[_0x24fbbb(0xf0)](a41_0x49e604['red']('Error:'),_0x24fbbb(0x99)+_0x20d51e+_0x24fbbb(0x106)),0x1;const _0x158ee8=_0x3244a4[_0x24fbbb(0x167)]['id'];_0x2ac03c['verbose']&&console[_0x24fbbb(0xf0)]('Using\x20attempt\x20'+_0x158ee8+_0x24fbbb(0x82)+_0x20d51e);const _0xc22221=_0x2ac03c[_0x24fbbb(0x87)];return _0xc22221?await this[_0x24fbbb(0x186)](_0xe4bd37,_0x158ee8):await this[_0x24fbbb(0x11c)](_0xe4bd37,_0x158ee8,_0x2ac03c),0x0;}const _0x2ad580=await withSpinner(_0x24fbbb(0xcf),()=>_0x3a8329['workflow'][_0x24fbbb(0x95)]({'projectName':_0xb75f5b,'workflowName':_0x85ccd0,'limit':_0x2ac03c[_0x24fbbb(0xe0)]||0x32}),{'verbose':_0x2ac03c[_0x24fbbb(0x1d8)]}),_0x508fd3=_0x2ad580[_0x24fbbb(0x203)];if(_0x508fd3[_0x24fbbb(0x218)]===0x0){if(_0xb75f5b&&_0x85ccd0)console['error'](_0x24fbbb(0x201)+_0xb75f5b+'.'+_0x85ccd0);else _0xb75f5b?console[_0x24fbbb(0xf0)](_0x24fbbb(0xf7)+_0xb75f5b):(console[_0x24fbbb(0xf0)](_0x24fbbb(0x169)),console[_0x24fbbb(0xf0)](a41_0x49e604[_0x24fbbb(0xcd)](_0x24fbbb(0x149))));return 0x0;}_0x508fd3[_0x24fbbb(0x83)]((_0x40d53f,_0x5731c3)=>{const _0x4ac2b4=_0x24fbbb,_0x4d1d88=_0x40d53f[_0x4ac2b4(0xe3)]||'',_0x86a3a=_0x5731c3[_0x4ac2b4(0xe3)]||'';return _0x86a3a[_0x4ac2b4(0xb2)](_0x4d1d88);});if(_0x2ac03c[_0x24fbbb(0xfc)]||_0x2ac03c[_0x24fbbb(0xb7)])return await handleSDKOutput(_0x508fd3,_0x2ac03c),0x0;let _0x2cb362;if(_0x76627e){const _0x13ccc0=_0x508fd3[0x0];if(!_0x13ccc0['lastAttempt']?.['id'])return console[_0x24fbbb(0xf0)](_0x24fbbb(0x20a)),0x0;_0x2cb362=_0x13ccc0['lastAttempt']['id'],_0x2ac03c[_0x24fbbb(0x1d8)]&&console[_0x24fbbb(0xf0)]('Auto-selected\x20latest\x20session:\x20'+_0x13ccc0[_0x24fbbb(0xe3)]);}else{const _0x32d6aa=_0x508fd3[_0x24fbbb(0x205)](_0x472a55=>{const _0x4c93c4=_0x24fbbb,_0x5f5073=getAttemptStatusDisplay(_0x472a55[_0x4c93c4(0x167)]);return{'title':_0x472a55['project']?.['name']+'.'+_0x472a55['workflow']?.['name']+_0x4c93c4(0x1ba)+_0x472a55['sessionTime']+'\x20'+_0x5f5073[_0x4c93c4(0x1b1)],'value':_0x472a55['lastAttempt']?.['id']||'','description':_0x5f5073['text']};}),_0x1fd35b=await a41_0x5636da({'type':_0x24fbbb(0x18e),'name':_0x24fbbb(0x1e6),'message':_0x24fbbb(0x1c8),'choices':_0x32d6aa['filter'](_0x75bf90=>_0x75bf90[_0x24fbbb(0x91)]!=='')});if(!_0x1fd35b['attemptId'])return 0x0;_0x2cb362=_0x1fd35b['attemptId'];}const _0x2b01bc=_0x2ac03c[_0x24fbbb(0x87)];return _0x2b01bc?await this['pollTimeline'](_0xe4bd37,_0x2cb362):await this[_0x24fbbb(0x11c)](_0xe4bd37,_0x2cb362,_0x2ac03c),0x0;}async[a41_0x41ef9d(0x11c)](_0x2b558b,_0x352b88,_0x280d77){const _0x5861c2=a41_0x41ef9d,{tdx:_0x442fde}=_0x2b558b;let _0x49ccab,_0x50e69a;try{[_0x49ccab,_0x50e69a]=await Promise['all']([_0x442fde[_0x5861c2(0x165)][_0x5861c2(0x94)](_0x352b88),_0x442fde[_0x5861c2(0x165)][_0x5861c2(0x10b)](_0x352b88,![])]);}catch(_0x3f2907){console[_0x5861c2(0xf0)](a41_0x49e604['red'](_0x5861c2(0x117)));_0x280d77['verbose']&&console[_0x5861c2(0xf0)](_0x3f2907);throw _0x3f2907;}if(_0x280d77[_0x5861c2(0xfc)]||_0x280d77[_0x5861c2(0xb7)]){const _0x239fa8=this[_0x5861c2(0xbb)](_0x49ccab,_0x50e69a);await handleSDKOutput([_0x239fa8],_0x280d77);return;}const _0x9ab892=_0x442fde[_0x5861c2(0xbd)][_0x5861c2(0x1b5)],_0x4c58c7=this['renderTimeline'](_0x49ccab,_0x50e69a,_0x9ab892);console[_0x5861c2(0x111)](_0x4c58c7);}async['pollTimeline'](_0x219f38,_0x41876b){const _0x17125b=a41_0x41ef9d,{tdx:_0x5dad79}=_0x219f38,_0x2fba60=TIMELINE_CONFIG[_0x17125b(0x13a)],_0x26fb6d=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x4591a7=0x0;while(_0x4591a7<_0x26fb6d){process[_0x17125b(0xd7)][_0x17125b(0xa1)]&&process['stdout'][_0x17125b(0x18b)]('\x1bc');let _0xea36ee,_0x91c445;try{[_0xea36ee,_0x91c445]=await Promise[_0x17125b(0xef)]([_0x5dad79[_0x17125b(0x165)][_0x17125b(0x94)](_0x41876b),_0x5dad79['workflow'][_0x17125b(0x10b)](_0x41876b,![])]);}catch(_0x5716dd){console[_0x17125b(0xf0)](a41_0x49e604[_0x17125b(0x8b)]('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x4591a7>0x0&&console[_0x17125b(0xf0)](a41_0x49e604[_0x17125b(0xcd)](_0x17125b(0x110)+_0x4591a7));throw _0x5716dd;}const _0x23157d=_0x5dad79['context'][_0x17125b(0x1b5)],_0x316f2a=this['renderTimeline'](_0xea36ee,_0x91c445,_0x23157d);console['log'](_0x316f2a);const _0x278843=_0xea36ee[_0x17125b(0xda)]&&_0x91c445[_0x17125b(0x1b3)](_0x4d7635=>_0x4d7635[_0x17125b(0xa5)]!==_0x17125b(0x1d0)&&_0x4d7635[_0x17125b(0xa5)]!==_0x17125b(0x15a));if(_0x278843){console['error'](a41_0x49e604[_0x17125b(0x17c)](_0x17125b(0x16c)));break;}console[_0x17125b(0xf0)](a41_0x49e604[_0x17125b(0xcd)](_0x17125b(0x20c)+_0x4591a7*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x4c5a5d=>setTimeout(_0x4c5a5d,_0x2fba60)),_0x4591a7++;}_0x4591a7>=_0x26fb6d&&console['error'](a41_0x49e604[_0x17125b(0xae)](_0x17125b(0x1df)));}[a41_0x41ef9d(0x162)](_0x289493,_0x2c083c,_0x53a4ce){const _0x1f2031=a41_0x41ef9d,_0x236f7b=[],_0x20b51b=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x5b08c3=0x5,_0x1941ee=process[_0x1f2031(0xd7)][_0x1f2031(0x1dd)]||0x78,_0x407026=_0x1941ee-_0x20b51b-_0x5b08c3,_0x2bb58c=Math[_0x1f2031(0x17d)](TIMELINE_CONFIG[_0x1f2031(0xac)],Math[_0x1f2031(0x21f)](_0x407026,TIMELINE_CONFIG[_0x1f2031(0x194)])),_0x27ca65=new Date(_0x289493[_0x1f2031(0x15e)])[_0x1f2031(0xe4)](),_0x38cb8f=_0x289493['finishedAt']?new Date(_0x289493[_0x1f2031(0x188)])[_0x1f2031(0xe4)]():Date[_0x1f2031(0x1da)](),_0xc39cdb={'start':_0x27ca65,'end':_0x38cb8f,'duration':_0x38cb8f-_0x27ca65},_0x6b7092=new Map(),_0x270b1c=[];for(const _0x1452c2 of _0x2c083c){if(_0x1452c2['startedAt']){const _0x521e4e=new Date(_0x1452c2[_0x1f2031(0x12e)])[_0x1f2031(0xe4)](),_0x3a4547=_0x1452c2[_0x1f2031(0x92)]?new Date(_0x1452c2['updatedAt'])[_0x1f2031(0xe4)]():Date[_0x1f2031(0x1da)](),_0x3ab5b6={'start':_0x521e4e,'end':_0x3a4547,'duration':_0x3a4547-_0x521e4e};_0x6b7092[_0x1f2031(0x13f)](_0x1452c2['id'],_0x3ab5b6),_0x270b1c[_0x1f2031(0x11b)]({'name':_0x1452c2[_0x1f2031(0x17a)],'state':_0x1452c2[_0x1f2031(0xa5)]||_0x1f2031(0x12d),'window':_0x3ab5b6});}else _0x270b1c[_0x1f2031(0x11b)]({'name':_0x1452c2[_0x1f2031(0x17a)],'state':_0x1452c2['state']||_0x1f2031(0x15a),'window':undefined});}_0x270b1c[_0x1f2031(0x83)]((_0x37bf3d,_0x519dd6)=>{const _0x1d1692=_0x1f2031;if(!_0x37bf3d[_0x1d1692(0x131)])return 0x1;if(!_0x519dd6[_0x1d1692(0x131)])return-0x1;return _0x37bf3d[_0x1d1692(0x131)][_0x1d1692(0x1c4)]-_0x519dd6[_0x1d1692(0x131)]['start'];});const _0x167428=_0x270b1c[_0x1f2031(0x218)],_0x339631=_0x167428>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x339631&&_0x270b1c[_0x1f2031(0xcc)](TIMELINE_CONFIG[_0x1f2031(0x1cf)]);const _0x235cf2=calculateTimeScale(_0xc39cdb,_0x2bb58c),_0x78749b=_0x289493['done']?_0x289493[_0x1f2031(0x185)]?a41_0x49e604[_0x1f2031(0x17c)](_0x1f2031(0x185)):a41_0x49e604[_0x1f2031(0x8b)](_0x1f2031(0xf0)):a41_0x49e604[_0x1f2031(0xfe)]('running'),_0x2d4ca1=_0x289493[_0x1f2031(0xf2)]?.['id'],_0xb6b163=_0x289493[_0x1f2031(0x90)];let _0x1708b2;if(_0x2d4ca1&&_0xb6b163){const _0x57be24=getWorkflowAttemptUrl(_0x53a4ce,_0x2d4ca1,_0xb6b163,_0x289493['id']);_0x1708b2=hyperlink(a41_0x49e604[_0x1f2031(0xcd)](_0x289493['id']),_0x57be24);}else _0x1708b2=a41_0x49e604['dim'](_0x289493['id']);_0x236f7b[_0x1f2031(0x11b)]('Attempt:\x20'+_0x1708b2+_0x1f2031(0x1ba)+_0x78749b+_0x1f2031(0x1ba)+formatElapsed(_0xc39cdb[_0x1f2031(0x12c)]));if(_0x270b1c[_0x1f2031(0x218)]>0x0){const _0x1bfd25=renderTimeAxis(_0x235cf2,_0x2bb58c),_0x53ef25=new Date(_0xc39cdb[_0x1f2031(0x1c4)]),_0x43e225=formatDate(_0x53ef25),_0x50f88c=TIMELINE_CONFIG[_0x1f2031(0x1c3)]+TIMELINE_CONFIG[_0x1f2031(0x17e)]+_0x20b51b,_0x3f2951=_0x43e225[_0x1f2031(0x140)](_0x50f88c),_0x31135f=a41_0x49e604[_0x1f2031(0xcd)](_0x3f2951);_0x236f7b[_0x1f2031(0x11b)](_0x31135f+'\x20'+_0x1bfd25);for(const _0x2d4e30 of _0x270b1c){_0x236f7b[_0x1f2031(0x11b)](renderTaskRow(_0x2d4e30,_0x235cf2,_0x2bb58c,_0x20b51b));}const _0x3c3e43=calculateStats(_0x270b1c);_0x236f7b['push'](formatStats(_0x3c3e43)),_0x339631&&_0x236f7b[_0x1f2031(0x11b)](a41_0x49e604[_0x1f2031(0xae)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0x1f2031(0x1cf)]+_0x1f2031(0x215)+_0x167428+_0x1f2031(0x1f4))),_0x236f7b[_0x1f2031(0x11b)](''),_0x236f7b[_0x1f2031(0x11b)](a41_0x49e604['dim'](_0x1f2031(0x1bd))+(_0x1f2031(0xee)+_0x289493['id']+_0x1f2031(0x206))+a41_0x49e604[_0x1f2031(0xcd)](_0x1f2031(0x1d2)));}else _0x236f7b[_0x1f2031(0x11b)](_0x1f2031(0x10c));return _0x236f7b[_0x1f2031(0x116)]('\x0a');}[a41_0x41ef9d(0xbb)](_0x512c18,_0x881434){const _0x2fb8c3=a41_0x41ef9d,_0x173125=new Date(_0x512c18[_0x2fb8c3(0x15e)])[_0x2fb8c3(0xe4)](),_0x36bc6b=_0x512c18[_0x2fb8c3(0x188)]?new Date(_0x512c18['finishedAt'])['getTime']():Date[_0x2fb8c3(0x1da)](),_0x4fa443=_0x36bc6b-_0x173125,_0x127765=[];for(const _0x5eab51 of _0x881434){if(_0x5eab51[_0x2fb8c3(0x12e)]){const _0x3656ee=new Date(_0x5eab51[_0x2fb8c3(0x12e)])[_0x2fb8c3(0xe4)](),_0x5d3dbb=_0x5eab51[_0x2fb8c3(0x92)]?new Date(_0x5eab51[_0x2fb8c3(0x92)])[_0x2fb8c3(0xe4)]():Date[_0x2fb8c3(0x1da)]();_0x127765['push']({'name':_0x5eab51[_0x2fb8c3(0x17a)],'state':_0x5eab51['state']||_0x2fb8c3(0x12d),'window':{'start':_0x3656ee,'end':_0x5d3dbb,'duration':_0x5d3dbb-_0x3656ee}});}else _0x127765[_0x2fb8c3(0x11b)]({'name':_0x5eab51[_0x2fb8c3(0x17a)],'state':_0x5eab51[_0x2fb8c3(0xa5)]||'planned','window':undefined});}const _0x341326=calculateStats(_0x127765);return{'attempt':{'id':_0x512c18['id'],'status':_0x512c18['done']?_0x512c18[_0x2fb8c3(0x185)]?_0x2fb8c3(0x185):_0x2fb8c3(0xf0):'running','createdAt':_0x512c18['createdAt'],'finishedAt':_0x512c18[_0x2fb8c3(0x188)],'duration_ms':_0x4fa443},'tasks':_0x127765[_0x2fb8c3(0x205)](_0x2afbb2=>({'name':_0x2afbb2['name'],'state':_0x2afbb2['state'],'startedAt':_0x2afbb2['window']?new Date(_0x2afbb2[_0x2fb8c3(0x131)][_0x2fb8c3(0x1c4)])[_0x2fb8c3(0x20b)]():null,'updatedAt':_0x2afbb2[_0x2fb8c3(0x131)]?new Date(_0x2afbb2[_0x2fb8c3(0x131)][_0x2fb8c3(0x100)])[_0x2fb8c3(0x20b)]():null,'duration_ms':_0x2afbb2['window']?.['duration']||null})),'stats':_0x341326};}}
|
|
1
|
+
const a41_0x448846=a41_0x141e;(function(_0xa10281,_0x1d701d){const _0x106aa7=a41_0x141e,_0x313f6d=_0xa10281();while(!![]){try{const _0x3e3a80=parseInt(_0x106aa7(0x199))/0x1*(parseInt(_0x106aa7(0x226))/0x2)+-parseInt(_0x106aa7(0x179))/0x3+-parseInt(_0x106aa7(0x1dc))/0x4+parseInt(_0x106aa7(0x1ef))/0x5*(-parseInt(_0x106aa7(0xc5))/0x6)+parseInt(_0x106aa7(0x1fd))/0x7*(-parseInt(_0x106aa7(0x126))/0x8)+parseInt(_0x106aa7(0x1cb))/0x9*(parseInt(_0x106aa7(0x215))/0xa)+parseInt(_0x106aa7(0xc6))/0xb*(parseInt(_0x106aa7(0x1a8))/0xc);if(_0x3e3a80===_0x1d701d)break;else _0x313f6d['push'](_0x313f6d['shift']());}catch(_0x4dee77){_0x313f6d['push'](_0x313f6d['shift']());}}}(a41_0x13e8,0x62f9d));import a41_0x402fbc from'chalk';import{existsSync}from'fs';import a41_0xf5d811 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a41_0x131ac0 from'prompts';function getAttemptStatusDisplay(_0xee5bb){const _0x7a9c23=a41_0x141e;if(!_0xee5bb)return{'icon':'⏳','text':''};const {done:_0x42a066,success:_0xd62942,cancelRequested:_0x20b3b5}=_0xee5bb;if(!_0x42a066)return _0x20b3b5?{'icon':'🛑','text':a41_0x402fbc['yellow'](_0x7a9c23(0x9c))}:{'icon':'🔄','text':a41_0x402fbc[_0x7a9c23(0x15a)](_0x7a9c23(0x1eb))};if(_0xd62942)return{'icon':'✅','text':a41_0x402fbc[_0x7a9c23(0x142)](_0x7a9c23(0xbf))};return{'icon':'❌','text':a41_0x402fbc[_0x7a9c23(0x95)]('error')};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x3a4f8c,_0x2a24f9,_0x5aa623=0x0){const _0x3934d5=a41_0x141e;return _0x3a4f8c[_0x5aa623]||_0x2a24f9[_0x3934d5(0x1b9)];}[a41_0x448846(0x9b)](_0x5cfa5c,_0x2d6e37,_0x350013=0x0){const _0x4f595a=a41_0x448846,_0x53fc81=this[_0x4f595a(0x1f5)](_0x5cfa5c,_0x2d6e37,_0x350013);if(!_0x53fc81)return console['error'](a41_0x402fbc[_0x4f595a(0x95)](_0x4f595a(0x9a)),_0x4f595a(0x21c)),console[_0x4f595a(0x154)](a41_0x402fbc[_0x4f595a(0x16c)](_0x4f595a(0xf9))),null;return _0x53fc81;}[a41_0x448846(0xea)](_0x1bd7be,_0x2d1ac3){const _0x523510=a41_0x448846;if(_0x1bd7be[0x0]){const _0x2d27b0=_0x1bd7be[0x0][_0x523510(0x19b)]('.');if(_0x2d27b0[_0x523510(0x1c5)]===0x1)return{'projectName':_0x2d27b0[0x0],'workflowName':undefined};else return _0x2d27b0[_0x523510(0x1c5)]===0x2?{'projectName':_0x2d27b0[0x0],'workflowName':_0x2d27b0[0x1]}:(console['error'](a41_0x402fbc[_0x523510(0x95)](_0x523510(0x9a)),_0x523510(0x139)),null);}return{'projectName':_0x2d1ac3[_0x523510(0x1b9)],'workflowName':undefined};}[a41_0x448846(0x10c)](_0x174d90,_0x5c0dd1,_0x5945fa=0x0){const _0x1e4b4e=a41_0x448846;if(_0x174d90[_0x5945fa])return _0x174d90[_0x5945fa];if(_0x5c0dd1['workflowProject']){const _0x25962d=a41_0xf5d811[_0x1e4b4e(0xdb)](process[_0x1e4b4e(0x191)](),_0x1e4b4e(0xfb),_0x5c0dd1[_0x1e4b4e(0x1b9)]);if(existsSync(a41_0xf5d811[_0x1e4b4e(0xdb)](_0x25962d,'tdx.json')))return _0x25962d;}return undefined;}async[a41_0x448846(0x1c6)](_0x101447,_0x5bd1e1,_0x68dd0d){const _0x5e174d=a41_0x448846;try{const _0xc0ce43=await _0x101447[_0x5e174d(0x13f)][_0x5e174d(0xfb)](_0x5bd1e1,{'limit':0x1});if(_0xc0ce43[_0x5e174d(0x1c5)]>0x0){const _0x45ac79=_0xc0ce43[0x0]['id'],_0xe748f1=getWorkflowUrl(_0x68dd0d,_0x45ac79);console[_0x5e174d(0x154)]('\x20\x20Console:\x20'+a41_0x402fbc[_0x5e174d(0x18c)](_0xe748f1));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a41_0x448846(0xb1);['description']=a41_0x448846(0xd9);async[a41_0x448846(0x1f9)](_0x34f4a8){const _0x2df43a=a41_0x448846,{options:_0x2927af,args:_0x4eeb93,tdx:_0x71d278}=_0x34f4a8,_0x2408bd=_0x4eeb93[0x0],_0x18cce2=_0x2927af[_0x2df43a(0x1d1)];if(_0x18cce2)return saveSessionContext({'workflow_project':undefined},_0x2927af[_0x2df43a(0x1ff)]),console[_0x2df43a(0x12f)](a41_0x402fbc[_0x2df43a(0x142)]('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x2408bd)return console[_0x2df43a(0x154)](a41_0x402fbc[_0x2df43a(0x95)](_0x2df43a(0x9a)),_0x2df43a(0x21c)),console['error'](a41_0x402fbc[_0x2df43a(0x16c)](_0x2df43a(0x1fe))),console[_0x2df43a(0x154)](a41_0x402fbc[_0x2df43a(0x16c)](_0x2df43a(0x188))),0x1;const _0x1eb14d=await withSpinner(_0x2df43a(0xa1)+_0x2408bd+_0x2df43a(0x161),()=>_0x71d278['workflow'][_0x2df43a(0x144)](_0x2408bd),{'verbose':_0x2927af[_0x2df43a(0x138)]}),{name:_0x1de996}=_0x1eb14d[_0x2df43a(0x104)];return saveSessionContext({'workflow_project':_0x1de996},_0x2927af[_0x2df43a(0x1ff)]),console[_0x2df43a(0x12f)](a41_0x402fbc['green']('✔\x20Workflow\x20project\x20set\x20to:\x20'+a41_0x402fbc['cyan'](_0x1de996))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a41_0x448846(0x18a)]='workflow:projects';['description']=a41_0x448846(0x160);async['execute'](_0x5810b3){const _0x29aaf1=a41_0x448846,{options:_0x3bbb76,args:_0x4ba405,tdx:_0x5438c9}=_0x5810b3,_0x2c818f=_0x4ba405[0x0];_0x3bbb76['verbose']&&_0x2c818f&&console['error'](_0x29aaf1(0x1ad)+_0x2c818f);const _0x317ee6=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x5438c9[_0x29aaf1(0x13f)][_0x29aaf1(0x122)](_0x2c818f,{'limit':_0x3bbb76['limit']}),{'verbose':_0x3bbb76[_0x29aaf1(0x138)]});let _0x1ac37d=_0x317ee6[_0x29aaf1(0x104)];_0x1ac37d['sort']((_0x548851,_0x37d714)=>_0x548851[_0x29aaf1(0x18a)]['localeCompare'](_0x37d714['name']));const _0x2ef1c7=_0x3bbb76['limit']||0x64,_0x41fd63=_0x1ac37d[_0x29aaf1(0x1c5)]>=_0x2ef1c7?a41_0x402fbc[_0x29aaf1(0x16c)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x29aaf1(0x154)](_0x29aaf1(0x111)+_0x1ac37d[_0x29aaf1(0x1c5)]+_0x29aaf1(0xf4)+(_0x1ac37d[_0x29aaf1(0x1c5)]!==0x1?'s':'')+_0x41fd63);if(_0x3bbb76[_0x29aaf1(0x177)]==='json'||_0x3bbb76[_0x29aaf1(0x177)]===_0x29aaf1(0x168)||_0x3bbb76['format']===_0x29aaf1(0x221))await handleSDKOutput(_0x1ac37d,_0x3bbb76);else{if(_0x1ac37d[_0x29aaf1(0x1c5)]===0x0)_0x2c818f?console['log'](_0x29aaf1(0xab)+_0x2c818f):console[_0x29aaf1(0x12f)](_0x29aaf1(0x210));else{const _0x5900da=_0x1ac37d[_0x29aaf1(0x1bc)](_0x2cbc12=>{const _0x59345b=_0x29aaf1,_0x1c16eb=_0x2cbc12[_0x59345b(0x207)]?.[_0x59345b(0x189)](_0x283ecf=>_0x283ecf[_0x59345b(0x218)]==='sys'),_0x21f96b=_0x1c16eb?a41_0x402fbc[_0x59345b(0x16c)](_0x59345b(0xf8)):'';return _0x59345b(0xd3)+_0x2cbc12[_0x59345b(0x18a)]+_0x21f96b;});await writeOutput(_0x5900da[_0x29aaf1(0xdb)]('\x0a'),_0x3bbb76[_0x29aaf1(0xbb)],_0x29aaf1(0x1d8));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a41_0x448846(0x18a)]='workflow:workflows';[a41_0x448846(0xd0)]=a41_0x448846(0xff);async['execute'](_0x5303d8){const _0x13cad6=a41_0x448846,{options:_0x31b178,args:_0x30a214,tdx:_0x55a6bd}=_0x5303d8,_0x4b08bd=this[_0x13cad6(0x1f5)](_0x30a214,_0x31b178);_0x31b178[_0x13cad6(0x138)]&&_0x4b08bd&&console[_0x13cad6(0x154)]('Project\x20filter:\x20'+_0x4b08bd);const _0x4e0455=await withSpinner(_0x13cad6(0x11d),()=>_0x55a6bd[_0x13cad6(0x13f)][_0x13cad6(0xfb)](_0x4b08bd,{'limit':_0x31b178['limit']}),{'verbose':_0x31b178[_0x13cad6(0x138)]});let _0x3fa504=_0x4e0455[_0x13cad6(0x104)];_0x3fa504['sort']((_0x3926c0,_0x4cc502)=>{const _0x1a349f=_0x13cad6,_0x338ecd=_0x3926c0[_0x1a349f(0x18a)][_0x1a349f(0x170)](_0x4cc502[_0x1a349f(0x18a)]);if(_0x338ecd!==0x0)return _0x338ecd;return(_0x3926c0[_0x1a349f(0x1b2)]?.[_0x1a349f(0x18a)]||'')['localeCompare'](_0x4cc502['project']?.[_0x1a349f(0x18a)]||'');});const _0x25f4a3=_0x31b178[_0x13cad6(0x222)]||0x64,_0x297e66=_0x3fa504[_0x13cad6(0x1c5)]>=_0x25f4a3?a41_0x402fbc['dim'](_0x13cad6(0x101)):'';console[_0x13cad6(0x154)](_0x13cad6(0x111)+_0x3fa504[_0x13cad6(0x1c5)]+_0x13cad6(0x10f)+(_0x3fa504[_0x13cad6(0x1c5)]!==0x1?'s':'')+_0x297e66);if(_0x31b178[_0x13cad6(0x177)]===_0x13cad6(0x143)||_0x31b178[_0x13cad6(0x177)]===_0x13cad6(0x168)||_0x31b178['format']===_0x13cad6(0x221))await handleSDKOutput(_0x3fa504,_0x31b178);else{if(_0x3fa504[_0x13cad6(0x1c5)]===0x0)_0x4b08bd?console[_0x13cad6(0x12f)](_0x13cad6(0x8e)+_0x4b08bd):console[_0x13cad6(0x12f)](_0x13cad6(0x1d7));else{const _0x3c7e17=_0x31b178[_0x13cad6(0x91)],_0x471a23=_0x3fa504['map'](_0x3c148a=>{const _0x5b42b3=_0x13cad6,_0x2d31f9=a41_0x402fbc[_0x5b42b3(0x16c)]('#'+_0x3c148a['id']),_0x482655=hyperlink(_0x2d31f9,getWorkflowUrl(_0x3c7e17,_0x3c148a['id'])),_0xa75a38=_0x3c148a[_0x5b42b3(0x1b2)]?.[_0x5b42b3(0x18a)]?a41_0x402fbc[_0x5b42b3(0x16c)]('\x20('+_0x3c148a[_0x5b42b3(0x1b2)][_0x5b42b3(0x18a)]+')'):'';return _0x5b42b3(0x22d)+_0x482655+'\x20'+_0x3c148a[_0x5b42b3(0x18a)]+_0xa75a38;});await writeOutput(_0x471a23[_0x13cad6(0xdb)]('\x0a'),_0x31b178[_0x13cad6(0xbb)],_0x13cad6(0x1d8));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a41_0x448846(0x18a)]=a41_0x448846(0xa8);[a41_0x448846(0xd0)]=a41_0x448846(0xe0);async[a41_0x448846(0x1f9)](_0x3dd673){const _0x2a2369=a41_0x448846,{options:_0x20ccc8,args:_0xcef21f,tdx:_0x55610b}=_0x3dd673,_0x5edfe6=this[_0x2a2369(0xea)](_0xcef21f,_0x20ccc8);if(!_0x5edfe6)return 0x1;const {projectName:_0x20a104,workflowName:_0x4cbfc7}=_0x5edfe6;if(_0x20ccc8['verbose']){if(_0x20a104&&_0x4cbfc7)console[_0x2a2369(0x154)](_0x2a2369(0x12d)+_0x20a104+'.'+_0x4cbfc7);else _0x20a104&&console['error']('Filter:\x20project='+_0x20a104);const _0x43745d=_0x20ccc8[_0x2a2369(0xa9)];_0x43745d&&console[_0x2a2369(0x154)]('Status:\x20'+_0x43745d);}let _0x183bd3=0x28;if(process[_0x2a2369(0x163)][_0x2a2369(0x148)]&&!_0x20ccc8[_0x2a2369(0xbb)]&&!_0x20ccc8[_0x2a2369(0x177)]){const _0x2c4585=process[_0x2a2369(0x163)][_0x2a2369(0x1a5)]||0x28;_0x183bd3=Math[_0x2a2369(0x11f)](0x14,Math[_0x2a2369(0x123)](_0x2c4585*0x2/0x3));}const _0x4e8bd5=_0x20ccc8[_0x2a2369(0x222)]||_0x183bd3,_0x9d25b=await withSpinner(_0x2a2369(0xcd),()=>_0x55610b[_0x2a2369(0x13f)][_0x2a2369(0xb9)]({'projectName':_0x20a104,'workflowName':_0x4cbfc7,'status':_0x20ccc8[_0x2a2369(0xa9)],'fromTime':_0x20ccc8[_0x2a2369(0x220)],'toTime':_0x20ccc8['to'],'limit':_0x4e8bd5}),{'verbose':_0x20ccc8[_0x2a2369(0x138)]}),_0x1c77dd=_0x9d25b[_0x2a2369(0x104)];_0x1c77dd[_0x2a2369(0x205)]((_0x383361,_0x12ac9e)=>{const _0xbbaf3d=_0x2a2369,_0x1d7b61=_0x383361[_0xbbaf3d(0x1ce)]||'',_0x266b62=_0x12ac9e[_0xbbaf3d(0x1ce)]||'';return _0x266b62[_0xbbaf3d(0x170)](_0x1d7b61);});_0x1c77dd[_0x2a2369(0x1c5)]>=_0x4e8bd5?console[_0x2a2369(0x154)]('✔\x20Showing\x20'+_0x1c77dd[_0x2a2369(0x1c5)]+_0x2a2369(0xe9)+a41_0x402fbc['dim']('(use\x20--limit\x20to\x20see\x20more)')):console['error'](_0x2a2369(0x111)+_0x1c77dd[_0x2a2369(0x1c5)]+'\x20session'+(_0x1c77dd[_0x2a2369(0x1c5)]!==0x1?'s':''));if(_0x20ccc8[_0x2a2369(0x177)]==='json'||_0x20ccc8['format']==='jsonl'||_0x20ccc8[_0x2a2369(0x177)]===_0x2a2369(0x221))await handleSDKOutput(_0x1c77dd,_0x20ccc8);else{if(!process[_0x2a2369(0x163)][_0x2a2369(0x148)]||_0x20ccc8['output']){if(_0x1c77dd[_0x2a2369(0x1c5)]===0x0){if(_0x20a104&&_0x4cbfc7)console['log'](_0x2a2369(0x176)+_0x20a104+'.'+_0x4cbfc7);else _0x20a104?console[_0x2a2369(0x12f)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x20a104):console['log']('No\x20sessions\x20found');}else{const _0x2a37e3=_0x20ccc8[_0x2a2369(0x91)],_0x4c4b29=this[_0x2a2369(0xc1)](_0x1c77dd,_0x2a37e3);_0x20ccc8[_0x2a2369(0xbb)]?await writeOutput(_0x4c4b29,_0x20ccc8['output'],_0x2a2369(0x1d8)):console[_0x2a2369(0x12f)](_0x4c4b29);}!_0x20a104&&(console[_0x2a2369(0x154)](''),console[_0x2a2369(0x154)](a41_0x402fbc[_0x2a2369(0x16c)](_0x2a2369(0x223))),console['error'](a41_0x402fbc['dim'](_0x2a2369(0x225))+'or'+a41_0x402fbc[_0x2a2369(0x16c)](_0x2a2369(0x1aa))));}else{if(_0x1c77dd['length']===0x0){if(_0x20a104&&_0x4cbfc7)console[_0x2a2369(0x12f)](_0x2a2369(0x176)+_0x20a104+'.'+_0x4cbfc7);else _0x20a104?console[_0x2a2369(0x12f)](_0x2a2369(0x118)+_0x20a104):console[_0x2a2369(0x12f)]('No\x20sessions\x20found');}else await this[_0x2a2369(0xb4)](_0x1c77dd,_0x3dd673,_0x20a104);}}return 0x0;}[a41_0x448846(0xc1)](_0x2c0ba0,_0x2e0b41){const _0x3ee455=a41_0x448846,_0x351d73=[],_0x5b76bb=new Map();let _0x5c16d6=Infinity,_0xa60a01=-Infinity;for(const _0x467e30 of _0x2c0ba0){if(_0x467e30[_0x3ee455(0x190)]?.[_0x3ee455(0x97)]){const _0x5340ab=new Date(_0x467e30[_0x3ee455(0x190)][_0x3ee455(0x97)])['getTime'](),_0x5f3946=_0x467e30[_0x3ee455(0x190)][_0x3ee455(0xb7)]?new Date(_0x467e30[_0x3ee455(0x190)][_0x3ee455(0xb7)])['getTime']():Date['now'](),_0x4c9fa4=_0x467e30[_0x3ee455(0x1b2)]?.[_0x3ee455(0x18a)]||_0x3ee455(0x227);!_0x5b76bb[_0x3ee455(0x147)](_0x4c9fa4)&&_0x5b76bb['set'](_0x4c9fa4,[]),_0x5b76bb['get'](_0x4c9fa4)[_0x3ee455(0x194)]({'session':_0x467e30,'startTime':_0x5340ab,'endTime':_0x5f3946,'duration':_0x5f3946-_0x5340ab}),_0x5c16d6=Math[_0x3ee455(0x121)](_0x5c16d6,_0x5340ab),_0xa60a01=Math[_0x3ee455(0x11f)](_0xa60a01,_0x5f3946);}}if(_0x5b76bb[_0x3ee455(0x22e)]===0x0)return _0x3ee455(0x175);const _0x133b04=process['stdout']['columns']||0x78,_0x2885ff=0x1e,_0x4078d3=0x32,_0x288085=0x4,_0xc7e45a=Math['min'](_0x4078d3,Math[_0x3ee455(0x11f)](_0x2885ff,Math[_0x3ee455(0x123)](_0x133b04*0.3))),_0x1f30f6=_0x133b04-_0xc7e45a-TIMELINE_CONFIG[_0x3ee455(0xf0)]-0x3-_0x288085,_0x3396aa=_0xa60a01-_0x5c16d6,_0x2d1524=_0x3396aa/_0xc7e45a,_0x24c438=renderTimeAxis({'startTime':_0x5c16d6,'endTime':_0xa60a01,'durationMs':_0x3396aa,'msPerChar':_0x2d1524},_0xc7e45a),_0xedd448=[];for(const _0x1d6f3a of _0x5b76bb[_0x3ee455(0x202)]()){_0xedd448[_0x3ee455(0x194)](..._0x1d6f3a);}_0xedd448[_0x3ee455(0x205)]((_0x6ef863,_0x84e85d)=>_0x84e85d[_0x3ee455(0x151)]-_0x6ef863[_0x3ee455(0x151)]);const _0x23bb3b=new Date(_0x5c16d6),_0x2c36b2=formatDate(_0x23bb3b),_0x44ccca=_0x288085+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x3ee455(0xc9)]+_0x1f30f6,_0x16f345='\x20'[_0x3ee455(0xb3)](_0x44ccca-_0x2c36b2[_0x3ee455(0x1c5)]),_0x421ea0=_0x16f345+a41_0x402fbc[_0x3ee455(0x16c)](_0x2c36b2)+'\x20'+_0x24c438;_0x351d73['push'](_0x421ea0);const _0x50b51d=0x16;let _0x205302=0x0;for(const _0x1311fc of _0xedd448){const _0x22c0cb=_0x1311fc[_0x3ee455(0x1ff)][_0x3ee455(0x1b2)]?.[_0x3ee455(0x18a)]||'?',_0x1a4559=Math['min'](stringWidth(_0x22c0cb),_0x50b51d);_0x205302=Math[_0x3ee455(0x11f)](_0x205302,_0x1a4559);}for(const _0x43d0c2 of _0xedd448){const {session:_0x4eb0ee,startTime:_0x274867,endTime:_0x1e2a0a,duration:_0x2a32df}=_0x43d0c2,_0x8e8975=_0x4eb0ee[_0x3ee455(0x1b2)]?.['id'],_0x2cbd06=_0x4eb0ee['id'],_0x14e530=_0x4eb0ee[_0x3ee455(0x1b2)]?.['name']||'?',_0x4ec558=_0x4eb0ee['workflow']?.[_0x3ee455(0x18a)]||'?';let _0x5a37a7,_0x5e75d7;if(_0x4eb0ee[_0x3ee455(0x190)]){const _0x80888=_0x4eb0ee['lastAttempt'];!_0x80888[_0x3ee455(0x186)]?(_0x5a37a7=_0x80888[_0x3ee455(0x185)]?'🛑':'🔄',_0x5e75d7=_0x80888[_0x3ee455(0x185)]?a41_0x402fbc[_0x3ee455(0x1f6)]:a41_0x402fbc[_0x3ee455(0x15a)]):(_0x5a37a7=_0x80888['success']?'✅':'❌',_0x5e75d7=_0x80888[_0x3ee455(0xbf)]?a41_0x402fbc['green']:a41_0x402fbc[_0x3ee455(0x95)]);}else _0x5a37a7='⏳',_0x5e75d7=a41_0x402fbc[_0x3ee455(0x16c)];const _0x5d6bba='#'+_0x2cbd06,_0x41330c=_0x8e8975?hyperlink(_0x5d6bba,getWorkflowSessionUrl(_0x2e0b41,_0x8e8975,_0x2cbd06)):_0x5d6bba;let _0x760f2c=_0x14e530;stringWidth(_0x14e530)>_0x50b51d&&(_0x760f2c=_0x14e530[_0x3ee455(0x1ea)](0x0,_0x50b51d-0x1)+'…');const _0x2c9d32=a41_0x402fbc[_0x3ee455(0x16c)](_0x760f2c),_0x1f5fb4=stringWidth(_0x760f2c),_0x46c60b='\x20'[_0x3ee455(0xb3)](_0x205302-stringWidth(_0x760f2c)+0x2),_0x1b91ed='('+formatElapsed(_0x2a32df)+')',_0x5d301f=stringWidth(_0x1b91ed),_0x10ec51=stringWidth(_0x5d6bba),_0x798178=_0x10ec51+0x1+_0x1f5fb4+_0x46c60b[_0x3ee455(0x1c5)],_0x5a590d=_0x1f30f6-_0x798178-_0x5d301f-0x1-0x8;let _0x18aea4=_0x4ec558;stringWidth(_0x18aea4)>_0x5a590d&&(_0x18aea4=_0x18aea4['slice'](0x0,_0x5a590d-0x1)+'…');const _0x329310=_0x41330c+'\x20'+_0x2c9d32+_0x46c60b+_0x18aea4,_0x284b08=stringWidth(_0x329310),_0x5dda6c=_0x1f30f6-_0x284b08-_0x5d301f,_0x575f3c=_0x329310+'\x20'[_0x3ee455(0xb3)](Math[_0x3ee455(0x11f)](0x1,_0x5dda6c))+a41_0x402fbc[_0x3ee455(0x16c)](_0x1b91ed),_0x461f20=Math[_0x3ee455(0x123)]((_0x274867-_0x5c16d6)/_0x2d1524),_0x46f700=Math[_0x3ee455(0x123)]((_0x1e2a0a-_0x5c16d6)/_0x2d1524),_0x4233bb=Math[_0x3ee455(0x11f)](_0x461f20+0x1,_0x46f700),_0x54a008=new Array(_0xc7e45a)[_0x3ee455(0x15c)]('\x20');for(let _0x540671=_0x461f20;_0x540671<Math[_0x3ee455(0x121)](_0x4233bb,_0xc7e45a);_0x540671++){_0x54a008[_0x540671]='─';}const _0x413fe2=_0x54a008['map'](_0x6080c5=>_0x6080c5==='\x20'?'\x20':_0x5e75d7(_0x6080c5))[_0x3ee455(0xdb)]('');_0x351d73[_0x3ee455(0x194)](_0x5a37a7+'\x20'+_0x575f3c+'│'+_0x413fe2+'│');}return _0x351d73[_0x3ee455(0xdb)]('\x0a');}async[a41_0x448846(0xb4)](_0x1cfe7d,_0x3dbb6d,_0xe24907){const _0x336862=a41_0x448846,{options:_0x3d1002,tdx:_0x71a447}=_0x3dbb6d,_0x48e1f9=_0x3d1002[_0x336862(0x91)],{timelineRows:_0x2dddbf,timeAxisHeader:_0x28122d}=this[_0x336862(0x136)](_0x1cfe7d,_0x48e1f9),_0x3e9d0a=_0x2dddbf['filter'](_0xc0b944=>_0xc0b944[_0x336862(0xce)]);if(_0x3e9d0a[_0x336862(0x1c5)]===0x0){const _0x4b801a=this[_0x336862(0xc1)](_0x1cfe7d,_0x48e1f9);console[_0x336862(0x12f)](_0x4b801a);!_0xe24907&&(console['error'](''),console[_0x336862(0x154)](a41_0x402fbc[_0x336862(0x16c)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x336862(0x154)](a41_0x402fbc[_0x336862(0x16c)](_0x336862(0x225))+'or'+a41_0x402fbc[_0x336862(0x16c)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0x28122d&&console[_0x336862(0x12f)](_0x28122d);const _0x58aab1=_0x2dddbf[_0x336862(0x183)](_0x2aa5fc=>_0x2aa5fc[_0x336862(0xce)])[_0x336862(0x1bc)](_0xb22f2e=>({'title':_0xb22f2e[_0x336862(0x1f3)],'value':_0xb22f2e[_0x336862(0xce)]})),_0x50ec32=process[_0x336862(0x163)][_0x336862(0x1a5)]||0x3c,_0x1c2373=Math['max'](0x28,Math[_0x336862(0x123)](_0x50ec32*0x2/0x3)),_0xcea6d4=await a41_0x131ac0({'type':_0x336862(0x1c7),'name':_0x336862(0xce),'message':_0x336862(0xc7),'choices':_0x58aab1,'initial':-0x1,'limit':_0x1c2373,'clearFirst':!![],'fallback':{'title':_0x336862(0x146),'value':null},'suggest':(_0x3590fc,_0x39ca78)=>{const _0x36c350=_0x336862;if(!_0x3590fc)return Promise[_0x36c350(0x1d5)](_0x39ca78);const _0xd32b3b=_0x39ca78[_0x36c350(0x183)](_0x532cfd=>{const _0x5d70ef=_0x36c350,_0x1ffd35=_0x532cfd;return _0x1ffd35[_0x5d70ef(0x22b)][_0x5d70ef(0x1d6)]()['includes'](_0x3590fc[_0x5d70ef(0x1d6)]());});return Promise[_0x36c350(0x1d5)](_0xd32b3b);}}),_0x475ed7=()=>{const _0x1b57df=_0x336862;process[_0x1b57df(0x163)][_0x1b57df(0x22a)](_0x1b57df(0x1d3)),process[_0x1b57df(0x163)][_0x1b57df(0x22a)]('\x1b[1A\x1b[2K'),process[_0x1b57df(0x163)][_0x1b57df(0x22a)]('\x1b[1A\x1b[2K');},_0x49d18c=_0xcea6d4&&_0xcea6d4[_0x336862(0xce)]&&_0xcea6d4['attemptId']!==null&&_0xcea6d4['attemptId']['trim']()!=='';if(!_0x49d18c){_0x475ed7(),console[_0x336862(0x12f)](a41_0x402fbc[_0x336862(0x16c)](_0x336862(0x165)));return;}_0x475ed7();const _0xdac7cd=_0x1cfe7d[_0x336862(0x16b)](_0x5a6068=>_0x5a6068[_0x336862(0x190)]?.['id']===_0xcea6d4[_0x336862(0xce)]);if(_0xdac7cd){const _0x46d84e=_0xdac7cd['project']?.[_0x336862(0x18a)]||'?',_0x26cbf7=_0xdac7cd[_0x336862(0x13f)]?.['name']||'?';console[_0x336862(0x12f)](_0x336862(0x108)+a41_0x402fbc['dim'](_0x46d84e)+_0x336862(0x1d9)+a41_0x402fbc[_0x336862(0x16c)](_0x26cbf7));}const _0x15dd50=new WorkflowTimelineCommand();await _0x15dd50['execute']({'args':[],'options':{..._0x3d1002,'attemptId':_0xcea6d4[_0x336862(0xce)]},'tdx':_0x71a447});}[a41_0x448846(0x136)](_0x1a018a,_0x3ae393){const _0x5ac66c=a41_0x448846,_0x2c677b=new Map();for(const _0x3f1f64 of _0x1a018a){_0x3f1f64['id']&&_0x3f1f64[_0x5ac66c(0x190)]?.['id']&&_0x2c677b['set'](_0x3f1f64['id'],_0x3f1f64[_0x5ac66c(0x190)]['id']);}const _0x4a72fe=[];let _0xe138a7='';const _0x2d02ad=this[_0x5ac66c(0xc1)](_0x1a018a,_0x3ae393),_0x5999b8=_0x2d02ad[_0x5ac66c(0x19b)]('\x0a');for(const _0x52ffd4 of _0x5999b8){if(_0x52ffd4['startsWith']('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x52ffd4[_0x5ac66c(0x208)](/^\s+\d{4}-\d{2}-\d{2}/))_0xe138a7=_0x52ffd4;else{if(_0x52ffd4[_0x5ac66c(0x208)](/^[✅❌🔄🛑⏳]/)){const _0x4403c0=_0x52ffd4[_0x5ac66c(0x208)](/#(\d+)/),_0x2b5569=_0x4403c0?_0x4403c0[0x1]:null,_0x164bc9=_0x2b5569?_0x2c677b[_0x5ac66c(0x16d)](_0x2b5569)||null:null,_0x1274d4=_0x1a018a['find'](_0x1f7c2e=>_0x1f7c2e['id']===_0x2b5569),_0x4a0d88=_0x1274d4?.[_0x5ac66c(0x1b2)]?.['name']||'';_0x4a72fe[_0x5ac66c(0x194)]({'displayLine':_0x52ffd4,'attemptId':_0x164bc9,'projectName':_0x4a0d88});}}}return{'timelineRows':_0x4a72fe,'timeAxisHeader':_0xe138a7};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a41_0x448846(0x18a)]=a41_0x448846(0x1bb);[a41_0x448846(0xd0)]=a41_0x448846(0x145);async[a41_0x448846(0x1f9)](_0x188577){const _0x1707bc=a41_0x448846,{options:_0x5a3444,args:_0x569f77,tdx:_0x1171ac}=_0x188577,_0x3d4ad8=this[_0x1707bc(0xea)](_0x569f77,_0x5a3444);if(!_0x3d4ad8)return 0x1;const {projectName:_0x577b9a,workflowName:_0x5306de}=_0x3d4ad8,_0x159bea=_0x5a3444['includeRetried'];if(_0x5a3444[_0x1707bc(0x138)]){if(_0x577b9a&&_0x5306de)console['error']('Filter:\x20'+_0x577b9a+'.'+_0x5306de);else _0x577b9a&&console[_0x1707bc(0x154)](_0x1707bc(0x1fa)+_0x577b9a);_0x159bea&&console[_0x1707bc(0x154)]('Include\x20retried:\x20yes');}const _0x1074d2=await withSpinner(_0x1707bc(0x20e),()=>_0x1171ac[_0x1707bc(0x13f)]['attempts']({'projectName':_0x577b9a,'workflowName':_0x5306de,'includeRetried':_0x159bea,'limit':_0x5a3444['limit']}),{'verbose':_0x5a3444['verbose']}),_0x45efcf=_0x1074d2[_0x1707bc(0x104)],_0x2859f2=_0x5a3444[_0x1707bc(0x222)]||0x64,_0x249f5f=_0x45efcf[_0x1707bc(0x1c5)]>=_0x2859f2?a41_0x402fbc[_0x1707bc(0x16c)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console['error']('✔\x20Found\x20'+_0x45efcf[_0x1707bc(0x1c5)]+'\x20attempt'+(_0x45efcf[_0x1707bc(0x1c5)]!==0x1?'s':'')+_0x249f5f);if(_0x5a3444[_0x1707bc(0x177)]===_0x1707bc(0x143)||_0x5a3444[_0x1707bc(0x177)]===_0x1707bc(0x168)||_0x5a3444[_0x1707bc(0x177)]===_0x1707bc(0x221))await handleSDKOutput(_0x45efcf,_0x5a3444);else{if(_0x45efcf[_0x1707bc(0x1c5)]===0x0){if(_0x577b9a&&_0x5306de)console[_0x1707bc(0x12f)](_0x1707bc(0xa6)+_0x577b9a+'.'+_0x5306de);else _0x577b9a?console[_0x1707bc(0x12f)]('No\x20attempts\x20found\x20in\x20project:\x20'+_0x577b9a):console[_0x1707bc(0x12f)]('No\x20attempts\x20found');}else{const _0x81932b=_0x5a3444[_0x1707bc(0x91)],_0x2a78d5=_0x45efcf[_0x1707bc(0x1bc)](_0x15e5d7=>{const _0x3567d6=_0x1707bc,_0x4b23fe=a41_0x402fbc[_0x3567d6(0x16c)]('#'+_0x15e5d7['id']),_0x36c322=_0x15e5d7['project']?.['id'],_0xdcac2e=_0x15e5d7[_0x3567d6(0xe1)]||_0x15e5d7[_0x3567d6(0x13b)],_0x4eaaef=_0x36c322&&_0xdcac2e?hyperlink(_0x4b23fe,getWorkflowAttemptUrl(_0x81932b,_0x36c322,_0xdcac2e,_0x15e5d7['id'])):_0x4b23fe,{icon:_0x54d303,text:_0x419c7b}=getAttemptStatusDisplay(_0x15e5d7),_0x4a699c=(_0x15e5d7[_0x3567d6(0x1b2)]?.[_0x3567d6(0x18a)]||'?')+'.'+(_0x15e5d7[_0x3567d6(0x13f)]?.[_0x3567d6(0x18a)]||'?'),_0x5151d2=_0x15e5d7[_0x3567d6(0x1ce)]?a41_0x402fbc[_0x3567d6(0x16c)](_0x15e5d7['sessionTime']):'';return(_0x4eaaef+'\x20'+_0x54d303+(_0x419c7b?'\x20'+_0x419c7b:'')+'\x20'+_0x4a699c+'\x20'+_0x5151d2)[_0x3567d6(0x18f)]();});await writeOutput(_0x2a78d5[_0x1707bc(0xdb)]('\x0a'),_0x5a3444[_0x1707bc(0xbb)],_0x1707bc(0x1d8));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a41_0x448846(0x1e5);[a41_0x448846(0xd0)]=a41_0x448846(0x1f0);async[a41_0x448846(0x1f9)](_0xbb38bc){const _0x29ec14=a41_0x448846,{options:_0x58cdae,args:_0x1b11fb,tdx:_0x283d00}=_0xbb38bc,_0x504c6a=_0x1b11fb[0x0];if(!_0x504c6a)return console[_0x29ec14(0x154)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x58cdae['verbose']&&console[_0x29ec14(0x154)]('Attempt\x20ID:\x20'+_0x504c6a);const _0x40051b=await withSpinner('Getting\x20attempt\x20details...',()=>_0x283d00[_0x29ec14(0x13f)]['attempt'](_0x504c6a),{'verbose':_0x58cdae[_0x29ec14(0x138)]}),_0x49389e=_0x40051b['data'];let _0xafb3e5;!_0x49389e['done']?_0xafb3e5=_0x49389e['cancelRequested']?_0x29ec14(0x9c):'running':_0xafb3e5=_0x49389e[_0x29ec14(0xbf)]?_0x29ec14(0xbf):'error';let _0x17be56;if(_0x49389e[_0x29ec14(0x97)]&&_0x49389e[_0x29ec14(0xb7)]){const _0x5d7786=new Date(_0x49389e[_0x29ec14(0x97)])['getTime'](),_0x2ed547=new Date(_0x49389e['finishedAt'])[_0x29ec14(0x1a9)]();_0x17be56=Math[_0x29ec14(0x1fc)]((_0x2ed547-_0x5d7786)/0x3e8);}const _0x2ac434={'attempt_id':_0x49389e['id'],'status':_0xafb3e5,..._0x49389e[_0x29ec14(0x10e)]!==undefined&&{'index':_0x49389e[_0x29ec14(0x10e)]},..._0x49389e['project']&&{'project':_0x49389e['project'][_0x29ec14(0x18a)]},..._0x49389e[_0x29ec14(0x13f)]&&{'workflow':_0x49389e['workflow'][_0x29ec14(0x18a)]},..._0x49389e[_0x29ec14(0x13b)]&&{'session_id':_0x49389e[_0x29ec14(0x13b)]},..._0x49389e[_0x29ec14(0x1ce)]&&{'session_time':_0x49389e[_0x29ec14(0x1ce)]},..._0x49389e[_0x29ec14(0x1b1)]&&{'retry_attempt':_0x49389e[_0x29ec14(0x1b1)]},..._0x17be56!==undefined&&{'duration_sec':_0x17be56},..._0x49389e[_0x29ec14(0x97)]&&{'created_at':_0x49389e[_0x29ec14(0x97)]},..._0x49389e['finishedAt']&&{'finished_at':_0x49389e[_0x29ec14(0xb7)]},...Object[_0x29ec14(0xd2)](_0x49389e['params'])['length']>0x0&&{'params':_0x49389e['params']}};return await handleSingleObjectOutput(_0x2ac434,_0x58cdae),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a41_0x448846(0x18a)]='workflow:tasks';[a41_0x448846(0xd0)]=a41_0x448846(0x197);async[a41_0x448846(0x1f9)](_0x1703b9){const _0x4ba2fe=a41_0x448846,{options:_0x56c3ce,args:_0x17e964,tdx:_0x1ad09e}=_0x1703b9,_0x12005a=_0x17e964[0x0];if(!_0x12005a)return console[_0x4ba2fe(0x154)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x1c9556=_0x56c3ce[_0x4ba2fe(0xfe)];_0x56c3ce['verbose']&&(console[_0x4ba2fe(0x154)](_0x4ba2fe(0x1ac)+_0x12005a),_0x1c9556&&console[_0x4ba2fe(0x154)](_0x4ba2fe(0x12a)));const _0x21bf6a=await withSpinner(_0x4ba2fe(0xb2),()=>_0x1ad09e[_0x4ba2fe(0x13f)][_0x4ba2fe(0x113)](_0x12005a,_0x1c9556||![]),{'verbose':_0x56c3ce['verbose']}),_0x12424f=_0x21bf6a[_0x4ba2fe(0x104)];return console['error'](_0x4ba2fe(0x111)+_0x12424f['length']+_0x4ba2fe(0x1fb)+(_0x12424f[_0x4ba2fe(0x1c5)]!==0x1?'s':'')),await handleSDKOutput(_0x12424f,_0x56c3ce),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a41_0x448846(0x18a)]='workflow:logs';[a41_0x448846(0xd0)]=a41_0x448846(0x209);async[a41_0x448846(0x1f9)](_0x397a0f){const _0x3b4529=a41_0x448846,{options:_0x188cd6,args:_0x4fff39,tdx:_0x3a21e3}=_0x397a0f,_0x4e1fff=_0x4fff39[0x0];let _0xcb9209=_0x4fff39[0x1];if(!_0x4e1fff)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x188cd6[_0x3b4529(0x138)]&&(console[_0x3b4529(0x154)]('Attempt\x20ID:\x20'+_0x4e1fff),_0xcb9209&&console[_0x3b4529(0x154)](_0x3b4529(0x1e0)+_0xcb9209));const _0x44cd88=await withSpinner('Fetching\x20log\x20files...',()=>_0x3a21e3[_0x3b4529(0x13f)]['logFiles'](_0x4e1fff,_0xcb9209),{'verbose':_0x188cd6['verbose']}),_0x596299=_0x44cd88[_0x3b4529(0x104)];if(_0x596299[_0x3b4529(0x1c5)]===0x0)return console[_0x3b4529(0x154)](_0x3b4529(0xe8)),0x0;if(!_0xcb9209&&(_0x188cd6[_0x3b4529(0x143)]||_0x188cd6[_0x3b4529(0x177)]))return await handleSDKOutput(_0x596299,_0x188cd6),0x0;if(!_0xcb9209){const _0x4ad1bb=_0x596299[_0x3b4529(0x1bc)](_0x1e16a5=>({'title':_0x1e16a5[_0x3b4529(0x203)]+'\x20('+formatBytes(_0x1e16a5[_0x3b4529(0x117)])+')','value':_0x1e16a5[_0x3b4529(0x203)]})),_0x4980de=await a41_0x131ac0({'type':_0x3b4529(0x21d),'name':'task','message':_0x3b4529(0x1df),'choices':_0x4ad1bb});if(!_0x4980de['task'])return console[_0x3b4529(0x154)](_0x3b4529(0x165)),0x0;_0xcb9209=_0x4980de['task'];}const _0x1bfb05=await withSpinner(_0x3b4529(0x20a),()=>_0x3a21e3[_0x3b4529(0x13f)][_0x3b4529(0x125)](_0x4e1fff,_0xcb9209),{'verbose':_0x188cd6[_0x3b4529(0x138)]}),_0x395c5b=_0x1bfb05['data'];return _0x395c5b?console[_0x3b4529(0x12f)](_0x395c5b):console['error'](_0x3b4529(0x11c)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a41_0x448846(0x18a)]=a41_0x448846(0xcc);['description']=a41_0x448846(0x19a);async[a41_0x448846(0x1f9)](_0x278474){const _0xa61a0=a41_0x448846,{options:_0x4eaa29,args:_0x13f2b4,tdx:_0x58c27b}=_0x278474,_0x139648=_0x13f2b4[0x0];if(!_0x139648)return console[_0xa61a0(0x154)](_0xa61a0(0xba)),0x1;const _0xfe41f5=_0x4eaa29[_0xa61a0(0x13a)];_0x4eaa29[_0xa61a0(0x138)]&&(console[_0xa61a0(0x154)](_0xa61a0(0x1ac)+_0x139648),_0xfe41f5&&console[_0xa61a0(0x154)]('Reason:\x20'+_0xfe41f5));if(!_0x4eaa29[_0xa61a0(0x228)]){const _0x14757e=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x139648+'?');if(!_0x14757e)return console['error']('Cancelled'),0x0;}const _0x194635=await withSpinner(_0xa61a0(0xfa),()=>_0x58c27b[_0xa61a0(0x13f)][_0xa61a0(0x8f)](_0x139648,_0xfe41f5),{'verbose':_0x4eaa29[_0xa61a0(0x138)]}),_0x384645=_0x194635[_0xa61a0(0x104)];return console[_0xa61a0(0x154)]('✔\x20'+_0x384645),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a41_0x448846(0x18a)]='workflow:retry';['description']=a41_0x448846(0xb8);async[a41_0x448846(0x1f9)](_0x2f4945){const _0x511ad1=a41_0x448846,{options:_0x45eb0b,args:_0x4ed404,tdx:_0x78ccfb}=_0x2f4945,_0x18747a=_0x4ed404[0x0];if(!_0x18747a)return console['error'](_0x511ad1(0x1f2)),console[_0x511ad1(0x154)](_0x511ad1(0xd8)),0x1;let _0x4ad834=![],_0x5810c8=_0x18747a;if(_0x18747a[_0x511ad1(0x1bf)](_0x511ad1(0x162)))_0x4ad834=!![],_0x5810c8=_0x18747a[_0x511ad1(0x14c)](0x8);else{if(_0x18747a[_0x511ad1(0x1bf)](_0x511ad1(0x1ee)))_0x4ad834=![],_0x5810c8=_0x18747a[_0x511ad1(0x14c)](0x8);else return console[_0x511ad1(0x154)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0x511ad1(0x154)](_0x511ad1(0xd8)),0x1;}const _0x510b01=_0x45eb0b[_0x511ad1(0x99)],_0xf512c7=_0x45eb0b[_0x511ad1(0x169)],_0x9120ef=_0x45eb0b[_0x511ad1(0x229)],_0x4dd049=_0x45eb0b[_0x511ad1(0xa5)];_0x45eb0b[_0x511ad1(0x138)]&&(console[_0x511ad1(0x154)](_0x511ad1(0xd4)+(_0x4ad834?_0x511ad1(0x1ff):'attempt')+'\x20'+_0x5810c8),_0x510b01&&console[_0x511ad1(0x154)]('From\x20task:\x20'+_0x510b01),_0xf512c7&&console[_0x511ad1(0x154)]('Resume\x20from:\x20'+_0xf512c7),_0x9120ef&&console[_0x511ad1(0x154)](_0x511ad1(0x1c0)+_0x9120ef),_0x4dd049&&console[_0x511ad1(0x154)](_0x511ad1(0x21a)));let _0x5e7656;if(_0x9120ef)try{if(_0x9120ef[_0x511ad1(0x1bf)]('@')){const _0x82ecf0=await import(_0x511ad1(0x15d)),_0x5c8ab3=_0x9120ef[_0x511ad1(0x14c)](0x1),_0x110679=await _0x82ecf0['readFile'](_0x5c8ab3,_0x511ad1(0x15b));_0x5e7656=JSON[_0x511ad1(0xed)](_0x110679);}else _0x5e7656=JSON[_0x511ad1(0xed)](_0x9120ef);}catch{return console[_0x511ad1(0x154)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x45eb0b[_0x511ad1(0x228)]){const _0x304f7d=await confirmKey(_0x511ad1(0x16a)+(_0x4ad834?_0x511ad1(0x1ff):'attempt')+'\x20'+_0x5810c8+'?');if(!_0x304f7d)return console[_0x511ad1(0x154)](_0x511ad1(0x165)),0x0;}let _0x200ed4;_0x4ad834?_0x200ed4=await withSpinner(_0x511ad1(0x141),()=>_0x78ccfb['workflow'][_0x511ad1(0xfc)](_0x5810c8,{'fromTask':_0x510b01,'retryParams':_0x5e7656}),{'verbose':_0x45eb0b[_0x511ad1(0x138)]}):_0x200ed4=await withSpinner(_0x511ad1(0x18d),()=>_0x78ccfb[_0x511ad1(0x13f)][_0x511ad1(0x19d)](_0x5810c8,{'resumeFrom':_0xf512c7,'retryParams':_0x5e7656,'force':_0x4dd049}),{'verbose':_0x45eb0b[_0x511ad1(0x138)]});const _0xa1909=_0x200ed4[_0x511ad1(0x104)];return console[_0x511ad1(0x154)](_0x511ad1(0xc3)),console['error'](_0x511ad1(0xcb)+_0xa1909[_0x511ad1(0xce)]),console[_0x511ad1(0x154)](_0x511ad1(0x224)+_0xa1909[_0x511ad1(0x13b)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a41_0x448846(0x18a)]=a41_0x448846(0x11b);[a41_0x448846(0xd0)]=a41_0x448846(0x1ed);async['execute'](_0x51e6d5){const _0x5b5ef8=a41_0x448846,{options:_0x3f48c9,args:_0x4e0778,tdx:_0x4a9cf2}=_0x51e6d5;let _0x46d076=_0x4e0778[0x0];if(!_0x46d076){const _0x5695eb=this[_0x5b5ef8(0x1f5)]([],_0x3f48c9),_0x57b779=await withSpinner(_0x5b5ef8(0x20b),()=>_0x4a9cf2[_0x5b5ef8(0x13f)]['workflows'](_0x5695eb,{'limit':_0x3f48c9[_0x5b5ef8(0x222)]}),{'verbose':_0x3f48c9[_0x5b5ef8(0x138)]}),_0x2de15f=_0x57b779[_0x5b5ef8(0x104)];if(_0x2de15f[_0x5b5ef8(0x1c5)]===0x0)return console[_0x5b5ef8(0x154)](_0x5b5ef8(0x1d7)),!_0x5695eb&&console[_0x5b5ef8(0x154)](a41_0x402fbc[_0x5b5ef8(0x16c)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x5bc8e2=_0x2de15f[_0x5b5ef8(0x1bc)](_0x914be7=>({'title':_0x914be7['project']?.['name']+'.'+_0x914be7[_0x5b5ef8(0x18a)],'value':_0x914be7[_0x5b5ef8(0x1b2)]?.['name']+'.'+_0x914be7['name'],'description':_0x914be7[_0x5b5ef8(0x124)]?'revision:\x20'+_0x914be7['revision']:undefined})),_0x58c2fb=await a41_0x131ac0({'type':_0x5b5ef8(0x21d),'name':_0x5b5ef8(0x13f),'message':_0x5b5ef8(0xef),'choices':_0x5bc8e2});if(!_0x58c2fb['workflow'])return 0x1;_0x46d076=_0x58c2fb['workflow'];}if(!_0x46d076[_0x5b5ef8(0x14b)]('.')){const _0x300d92=this['resolveProject']([],_0x3f48c9);if(_0x300d92)_0x46d076=_0x300d92+'.'+_0x46d076;else return console['error'](a41_0x402fbc[_0x5b5ef8(0x95)](_0x5b5ef8(0x9a)),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console[_0x5b5ef8(0x154)](a41_0x402fbc[_0x5b5ef8(0x16c)](_0x5b5ef8(0xf9))),0x1;}const _0x457168=_0x3f48c9[_0x5b5ef8(0x10d)],_0x1aa785=_0x3f48c9[_0x5b5ef8(0x1ce)],_0x5be559={};if(_0x457168&&Array[_0x5b5ef8(0x1b0)](_0x457168))for(const _0x3f8228 of _0x457168){const _0x459b12=_0x3f8228[_0x5b5ef8(0x15e)]('=');if(_0x459b12===-0x1)return console['error'](_0x5b5ef8(0x1b8)+_0x3f8228),console[_0x5b5ef8(0x154)](_0x5b5ef8(0x1d2)),0x1;const _0x14f61d=_0x3f8228[_0x5b5ef8(0x14c)](0x0,_0x459b12),_0x18cfa7=_0x3f8228[_0x5b5ef8(0x14c)](_0x459b12+0x1);try{_0x5be559[_0x14f61d]=JSON['parse'](_0x18cfa7);}catch{_0x5be559[_0x14f61d]=_0x18cfa7;}}_0x3f48c9[_0x5b5ef8(0x138)]&&(console[_0x5b5ef8(0x154)](_0x5b5ef8(0xb0)+_0x46d076),Object[_0x5b5ef8(0xd2)](_0x5be559)['length']>0x0&&console[_0x5b5ef8(0x154)]('Parameters:\x20'+JSON['stringify'](_0x5be559)),_0x1aa785&&console[_0x5b5ef8(0x154)](_0x5b5ef8(0x94)+_0x1aa785));const _0x54beb9=await withSpinner('Starting\x20workflow\x20run...',()=>_0x4a9cf2['workflow'][_0x5b5ef8(0x18e)](_0x46d076,_0x5be559,{'sessionTime':_0x1aa785}),{'verbose':_0x3f48c9[_0x5b5ef8(0x138)]}),_0x20c644=_0x54beb9['data'];console['error'](_0x5b5ef8(0x171)),console['error'](_0x5b5ef8(0xe4)+_0x20c644['id']),console[_0x5b5ef8(0x154)](_0x5b5ef8(0x224)+_0x20c644[_0x5b5ef8(0x13b)]),console[_0x5b5ef8(0x154)](_0x5b5ef8(0x1b5)+_0x20c644[_0x5b5ef8(0x1b2)]?.[_0x5b5ef8(0x18a)]),console['error'](_0x5b5ef8(0x137)+_0x20c644[_0x5b5ef8(0x13f)]?.[_0x5b5ef8(0x18a)]);if(_0x20c644[_0x5b5ef8(0x1b2)]?.['id']&&_0x20c644[_0x5b5ef8(0x13b)]&&_0x20c644['id']){const _0x23593d=_0x3f48c9[_0x5b5ef8(0x91)],_0x112d94=getConsoleUrl(_0x23593d,_0x5b5ef8(0x112)+_0x20c644[_0x5b5ef8(0x1b2)]['id']+'/sessions/'+_0x20c644[_0x5b5ef8(0x13b)]+_0x5b5ef8(0x133)+_0x20c644['id']);console[_0x5b5ef8(0x154)](_0x5b5ef8(0x17c)+a41_0x402fbc[_0x5b5ef8(0x18c)](_0x112d94));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']='workflow:download';[a41_0x448846(0xd0)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a41_0x448846(0x1f9)](_0x122b24){const _0x39fa9a=a41_0x448846,{options:_0x5364e5,args:_0x208a84,tdx:_0x505252}=_0x122b24,_0x59fcd2=_0x208a84[0x0],_0x34e7bc=_0x208a84[0x1]||'.';if(!_0x59fcd2)return console[_0x39fa9a(0x154)](_0x39fa9a(0x14a)),console[_0x39fa9a(0x154)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x33ace8=_0x5364e5[_0x39fa9a(0x124)];_0x5364e5[_0x39fa9a(0x138)]&&(console[_0x39fa9a(0x154)]('Project:\x20'+_0x59fcd2),console[_0x39fa9a(0x154)]('Output\x20directory:\x20'+_0x34e7bc),_0x33ace8&&console[_0x39fa9a(0x154)](_0x39fa9a(0x1c3)+_0x33ace8));const _0x4c16f8=await withSpinner('Downloading\x20project\x20'+_0x59fcd2+_0x39fa9a(0xeb),()=>_0x505252[_0x39fa9a(0x13f)][_0x39fa9a(0x109)](_0x59fcd2,_0x34e7bc,{'revision':_0x33ace8}),{'verbose':_0x5364e5[_0x39fa9a(0x138)]}),_0xce6550=_0x4c16f8['data'];return console[_0x39fa9a(0x154)](_0x39fa9a(0x1be)+_0xce6550[_0x39fa9a(0x9e)]),console['error'](_0x39fa9a(0x201)+_0xce6550[_0x39fa9a(0x124)]),console[_0x39fa9a(0x154)](_0x39fa9a(0x18b)+_0xce6550[_0x39fa9a(0x9f)]),console[_0x39fa9a(0x154)]('\x20\x20Location:\x20'+_0x34e7bc+'/'+_0xce6550[_0x39fa9a(0x9e)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a41_0x448846(0x18a)]=a41_0x448846(0x15f);[a41_0x448846(0xd0)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async['execute'](_0x27e257){const _0x196018=a41_0x448846,{options:_0x2dcf45,args:_0x3f6a87,tdx:_0x3d7b91}=_0x27e257;let _0x23cbd0='.',_0x175a17=_0x2dcf45[_0x196018(0x18a)];if(_0x3f6a87[0x0]){const {promises:_0x8d31c7}=await import('fs');try{const _0x47da2a=await _0x8d31c7['stat'](_0x3f6a87[0x0]);if(_0x47da2a['isDirectory']())_0x23cbd0=_0x3f6a87[0x0];else return console[_0x196018(0x154)]('Error:\x20'+_0x3f6a87[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x175a17=_0x3f6a87[0x0],_0x23cbd0='.';}}const _0x24d734=_0x2dcf45[_0x196018(0x124)],_0x5952c2=_0x2dcf45[_0x196018(0x129)];_0x2dcf45[_0x196018(0x138)]&&(console[_0x196018(0x154)](_0x196018(0x140)+_0x23cbd0),_0x175a17&&console[_0x196018(0x154)]('Project\x20name:\x20'+_0x175a17),_0x24d734&&console['error'](_0x196018(0x1c3)+_0x24d734),_0x5952c2&&console[_0x196018(0x154)](_0x196018(0x173)));const _0x5d7ddd=await withSpinner(_0x196018(0x1d0),()=>_0x3d7b91[_0x196018(0x13f)][_0x196018(0x194)](_0x23cbd0,{'projectName':_0x175a17,'revision':_0x24d734,'skipValidation':_0x5952c2}),{'verbose':_0x2dcf45[_0x196018(0x138)]}),_0x5e66c1=_0x5d7ddd[_0x196018(0x104)];return console[_0x196018(0x154)](_0x196018(0x119)+_0x5e66c1['projectName']),console['error']('\x20\x20Project\x20ID:\x20'+_0x5e66c1[_0x196018(0xbe)]),console[_0x196018(0x154)](_0x196018(0x201)+_0x5e66c1[_0x196018(0x124)]),await this[_0x196018(0x1c6)](_0x3d7b91,_0x5e66c1[_0x196018(0x9e)],_0x2dcf45['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']=a41_0x448846(0x1dd);[a41_0x448846(0xd0)]=a41_0x448846(0x164);async[a41_0x448846(0x1f9)](_0x17ee99){const _0xd7720c=a41_0x448846,{options:_0x5574d4,args:_0x83adf6,tdx:_0x4ce241}=_0x17ee99,_0x4829f4=_0x83adf6[0x0],_0x140899=_0x83adf6[0x1];if(!_0x4829f4)return console['error'](a41_0x402fbc[_0xd7720c(0x95)]('Error:'),'Project\x20name\x20is\x20required'),console[_0xd7720c(0x154)](a41_0x402fbc[_0xd7720c(0x16c)]('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x30a42d=_0x5574d4[_0xd7720c(0x124)];_0x5574d4['verbose']&&(console[_0xd7720c(0x154)](_0xd7720c(0x108)+_0x4829f4),_0x140899&&console[_0xd7720c(0x154)](_0xd7720c(0x21f)+_0x140899),_0x30a42d&&console[_0xd7720c(0x154)](_0xd7720c(0x1c3)+_0x30a42d),_0x5574d4[_0xd7720c(0x22c)]&&console['error'](_0xd7720c(0x178)));const _0x4eb63d=await withSpinner(_0xd7720c(0x11e)+_0x4829f4+_0xd7720c(0xeb),()=>_0x4ce241[_0xd7720c(0x13f)][_0xd7720c(0x127)](_0x4829f4,{'targetDir':_0x140899,'revision':_0x30a42d}),{'verbose':_0x5574d4[_0xd7720c(0x138)]}),_0x55d1f7=_0x4eb63d[_0xd7720c(0x104)];_0x55d1f7[_0xd7720c(0x153)]?console[_0xd7720c(0x154)](_0xd7720c(0x1ec)+_0x55d1f7[_0xd7720c(0x9e)]):console['error'](_0xd7720c(0xd6)+_0x55d1f7[_0xd7720c(0x9e)]);console['error']('\x20\x20Revision:\x20'+_0x55d1f7['revision']),console[_0xd7720c(0x154)]('\x20\x20Target:\x20'+(a41_0xf5d811['relative'](process['cwd'](),_0x55d1f7[_0xd7720c(0x107)])||'.')),console[_0xd7720c(0x154)](_0xd7720c(0x1e7)+a41_0x402fbc['green']('+'+_0x55d1f7[_0xd7720c(0x1f7)][_0xd7720c(0x20c)]+_0xd7720c(0xc0))+',\x20'+(a41_0x402fbc['yellow']('~'+_0x55d1f7[_0xd7720c(0x1f7)]['modified']+_0xd7720c(0x1cc))+',\x20')+(a41_0x402fbc['red']('-'+_0x55d1f7[_0xd7720c(0x1f7)][_0xd7720c(0x114)]+'\x20deleted')+',\x20')+(''+a41_0x402fbc['dim'](_0x55d1f7[_0xd7720c(0x1f7)][_0xd7720c(0xd7)]+_0xd7720c(0x1e2))));for(const _0x3e2709 of _0x55d1f7[_0xd7720c(0x17e)]){_0x3e2709[_0xd7720c(0x128)]===_0xd7720c(0x1d4)&&_0x3e2709[_0xd7720c(0x1e8)]&&(console[_0xd7720c(0x154)]('\x0a'+a41_0x402fbc['cyan'](_0xd7720c(0x150)+_0x3e2709[_0xd7720c(0x192)])),console['error'](_0x3e2709[_0xd7720c(0x1e8)]));}if(!_0x55d1f7[_0xd7720c(0x213)])return saveSessionContext({'workflow_project':_0x55d1f7['projectName']},_0x5574d4[_0xd7720c(0x1ff)]),console['error'](a41_0x402fbc[_0xd7720c(0x142)](_0xd7720c(0x131))),console[_0xd7720c(0x154)](a41_0x402fbc[_0xd7720c(0x16c)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x55d1f7['projectName'])),0x0;if(_0x5574d4[_0xd7720c(0x22c)])return console['error'](a41_0x402fbc[_0xd7720c(0x1f6)](_0xd7720c(0xec))),0x0;if(!_0x5574d4['yes']){const _0x49c765=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x49c765)return console[_0xd7720c(0x154)](_0xd7720c(0x165)),0x0;}await withSpinner(_0xd7720c(0x166),()=>_0x4ce241[_0xd7720c(0x13f)][_0xd7720c(0x1e9)](_0x55d1f7,{'revision':_0x30a42d}),{'verbose':_0x5574d4[_0xd7720c(0x138)]}),saveSessionContext({'workflow_project':_0x55d1f7['projectName']},_0x5574d4[_0xd7720c(0x1ff)]),console[_0xd7720c(0x154)](a41_0x402fbc['green'](_0xd7720c(0xa4)));const _0x2dca7f=a41_0xf5d811[_0xd7720c(0x217)](process[_0xd7720c(0x191)](),_0x55d1f7[_0xd7720c(0x107)])||'.';return console[_0xd7720c(0x154)](a41_0x402fbc[_0xd7720c(0x16c)](_0xd7720c(0xad)+_0x2dca7f)),console[_0xd7720c(0x154)](a41_0x402fbc[_0xd7720c(0x16c)](_0xd7720c(0x13d)+_0x55d1f7[_0xd7720c(0x9e)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a41_0x448846(0x18a)]=a41_0x448846(0xfd);[a41_0x448846(0xd0)]=a41_0x448846(0x13c);async[a41_0x448846(0x1f9)](_0x8dc4ba){const _0x3457ba=a41_0x448846,{options:_0x3dc68a,args:_0x5a698d,tdx:_0x1c790b}=_0x8dc4ba,_0x5ce5bc=this[_0x3457ba(0x10c)](_0x5a698d,_0x3dc68a),_0x5e52c0=_0x3dc68a['revision'],_0x4c9dbd=_0x3dc68a[_0x3457ba(0x129)];_0x3dc68a['verbose']&&(_0x5ce5bc&&console[_0x3457ba(0x154)]('Source\x20directory:\x20'+_0x5ce5bc),_0x5e52c0&&console['error'](_0x3457ba(0x1c3)+_0x5e52c0),_0x3dc68a[_0x3457ba(0x22c)]&&console['error']('Dry\x20run:\x20yes'),_0x4c9dbd&&console['error']('Validation:\x20skipped'));let _0x205640;try{_0x205640=await withSpinner(_0x3457ba(0xaa),()=>_0x1c790b['workflow'][_0x3457ba(0x120)]({'sourceDir':_0x5ce5bc,'revision':_0x5e52c0,'skipValidation':_0x4c9dbd}),{'verbose':_0x3dc68a['verbose']});}catch(_0x3b5f60){if(_0x3b5f60 instanceof Error&&_0x3b5f60['message'][_0x3457ba(0x14b)](_0x3457ba(0xbd)))return console['error'](a41_0x402fbc[_0x3457ba(0x95)](_0x3457ba(0x9a)),_0x3457ba(0x90)),_0x3dc68a[_0x3457ba(0x1b9)]?console[_0x3457ba(0x154)](a41_0x402fbc[_0x3457ba(0x16c)]('Tip:\x20cd\x20to\x20workflows/'+_0x3dc68a[_0x3457ba(0x1b9)]+_0x3457ba(0x1a7)+_0x3dc68a[_0x3457ba(0x1b9)]+'\x27')):console[_0x3457ba(0x154)](a41_0x402fbc[_0x3457ba(0x16c)](_0x3457ba(0x206))),0x1;throw _0x3b5f60;}const _0x1bd393=_0x205640[_0x3457ba(0x104)];console['error'](_0x3457ba(0xd6)+_0x1bd393[_0x3457ba(0x9e)]),console[_0x3457ba(0x154)]('\x20\x20Source:\x20'+_0x1bd393[_0x3457ba(0x134)]),console[_0x3457ba(0x154)](_0x3457ba(0x201)+_0x1bd393[_0x3457ba(0x124)]),console[_0x3457ba(0x154)]('\x20\x20Changes:\x20'+a41_0x402fbc[_0x3457ba(0x142)]('+'+_0x1bd393['summary'][_0x3457ba(0x20c)]+_0x3457ba(0xc0))+',\x20'+(a41_0x402fbc[_0x3457ba(0x1f6)]('~'+_0x1bd393['summary'][_0x3457ba(0x1d4)]+_0x3457ba(0x1cc))+',\x20')+(a41_0x402fbc[_0x3457ba(0x95)]('-'+_0x1bd393[_0x3457ba(0x1f7)][_0x3457ba(0x114)]+_0x3457ba(0xb6))+',\x20')+(''+a41_0x402fbc[_0x3457ba(0x16c)](_0x1bd393[_0x3457ba(0x1f7)]['unchanged']+_0x3457ba(0x1e2))));for(const _0x59c529 of _0x1bd393[_0x3457ba(0x17e)]){_0x59c529[_0x3457ba(0x128)]===_0x3457ba(0x1d4)&&_0x59c529[_0x3457ba(0x1e8)]&&(console[_0x3457ba(0x154)]('\x0a'+a41_0x402fbc['cyan']('---\x20'+_0x59c529['path'])),console[_0x3457ba(0x154)](_0x59c529[_0x3457ba(0x1e8)]));}if(!_0x1bd393['hasChanges'])return console[_0x3457ba(0x154)](a41_0x402fbc[_0x3457ba(0x142)](_0x3457ba(0x1b7))),await this[_0x3457ba(0x1c6)](_0x1c790b,_0x1bd393[_0x3457ba(0x9e)],_0x3dc68a['site']),0x0;if(_0x3dc68a['dryRun'])return console[_0x3457ba(0x154)](a41_0x402fbc[_0x3457ba(0x1f6)](_0x3457ba(0x1db))),0x0;if(!_0x3dc68a['yes']){const _0x4cec8d=await confirmKey(_0x3457ba(0x1de));if(!_0x4cec8d)return console[_0x3457ba(0x154)](_0x3457ba(0x165)),0x0;}const _0x22482d=await withSpinner('Pushing\x20project...',()=>_0x1c790b[_0x3457ba(0x13f)][_0x3457ba(0x9d)](_0x1bd393),{'verbose':_0x3dc68a[_0x3457ba(0x138)]}),_0x4a7dbf=_0x22482d[_0x3457ba(0x104)];return console[_0x3457ba(0x154)](a41_0x402fbc[_0x3457ba(0x142)](_0x3457ba(0x98))),console[_0x3457ba(0x154)]('\x20\x20Project\x20ID:\x20'+_0x4a7dbf['projectId']),console[_0x3457ba(0x154)]('\x20\x20Revision:\x20'+_0x4a7dbf[_0x3457ba(0x124)]),await this['showWorkflowConsoleUrl'](_0x1c790b,_0x4a7dbf['projectName'],_0x3dc68a[_0x3457ba(0x91)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a41_0x448846(0x18a)]=a41_0x448846(0x1e1);[a41_0x448846(0xd0)]=a41_0x448846(0xc4);async['execute'](_0x1cb587){const _0x5af8c9=a41_0x448846,{options:_0xfcd070,args:_0x44d45b,tdx:_0x27e05a}=_0x1cb587,_0x3fe29b=this[_0x5af8c9(0x10c)](_0x44d45b,_0xfcd070),_0x1655ed=_0xfcd070[_0x5af8c9(0x18a)],_0x3e2cd7=_0xfcd070[_0x5af8c9(0x124)],_0x156d5f=_0xfcd070['skipValidation'];if(!_0x3fe29b)return console[_0x5af8c9(0x154)](a41_0x402fbc[_0x5af8c9(0x95)](_0x5af8c9(0x9a)),_0x5af8c9(0x211)),console[_0x5af8c9(0x154)](a41_0x402fbc[_0x5af8c9(0x16c)](_0x5af8c9(0x159))),console[_0x5af8c9(0x154)](a41_0x402fbc['dim']('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x1655ed)return console['error'](a41_0x402fbc[_0x5af8c9(0x95)](_0x5af8c9(0x9a)),_0x5af8c9(0x167)),console['error'](a41_0x402fbc[_0x5af8c9(0x16c)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0xfcd070[_0x5af8c9(0x138)]&&(console['error'](_0x5af8c9(0x1e4)+_0x3fe29b),console['error'](_0x5af8c9(0x106)+_0x1655ed),_0x3e2cd7&&console['error'](_0x5af8c9(0x1c3)+_0x3e2cd7),_0xfcd070['dryRun']&&console[_0x5af8c9(0x154)](_0x5af8c9(0x178)),_0x156d5f&&console[_0x5af8c9(0x154)](_0x5af8c9(0x173)));const _0x15c46e=await withSpinner(_0x5af8c9(0x17d),()=>_0x27e05a['workflow']['prepareCloneProject'](_0x3fe29b,_0x1655ed,{'revision':_0x3e2cd7,'skipValidation':_0x156d5f}),{'verbose':_0xfcd070[_0x5af8c9(0x138)]}),_0x2f910f=_0x15c46e[_0x5af8c9(0x104)];console[_0x5af8c9(0x154)](_0x5af8c9(0x1cf)+_0x2f910f[_0x5af8c9(0x134)]);_0x2f910f[_0x5af8c9(0xc8)]&&console[_0x5af8c9(0x154)](_0x5af8c9(0x12c)+_0x2f910f[_0x5af8c9(0xc8)]);console[_0x5af8c9(0x154)](_0x5af8c9(0x106)+_0x2f910f[_0x5af8c9(0x214)]),console[_0x5af8c9(0x154)]('Revision:\x20'+_0x2f910f[_0x5af8c9(0x124)]),console[_0x5af8c9(0x154)](_0x5af8c9(0x132)+_0x2f910f['fileCount']);_0x2f910f['targetExists']&&(console[_0x5af8c9(0x154)](a41_0x402fbc[_0x5af8c9(0x1f6)](_0x5af8c9(0x1a1)+_0x2f910f[_0x5af8c9(0x214)]+_0x5af8c9(0x17f)+_0x2f910f[_0x5af8c9(0x1e6)]+')')),console[_0x5af8c9(0x154)](a41_0x402fbc[_0x5af8c9(0x1f6)](_0x5af8c9(0x1c2))));if(_0xfcd070['dryRun'])return console['error'](a41_0x402fbc[_0x5af8c9(0x1f6)](_0x5af8c9(0xf2))),0x0;if(!_0xfcd070[_0x5af8c9(0x228)]){const _0x57c3bc=_0x2f910f[_0x5af8c9(0xc8)]||a41_0xf5d811[_0x5af8c9(0x105)](_0x3fe29b),_0x5a0f38=_0x2f910f[_0x5af8c9(0x182)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x1655ed+_0x5af8c9(0x1c4):_0x5af8c9(0x181)+_0x57c3bc+_0x5af8c9(0x1b6)+_0x1655ed+'\x22?',_0x3462cf=await confirmKey(_0x5a0f38);if(!_0x3462cf)return console[_0x5af8c9(0x154)]('Cancelled'),0x0;}const _0x5123de=await withSpinner(_0x2f910f[_0x5af8c9(0x182)]?'Updating\x20'+_0x1655ed+'...':_0x5af8c9(0x115)+_0x1655ed+_0x5af8c9(0xeb),()=>_0x27e05a[_0x5af8c9(0x13f)][_0x5af8c9(0xbc)](_0x2f910f),{'verbose':_0xfcd070[_0x5af8c9(0x138)]}),_0x269c92=_0x5123de[_0x5af8c9(0x104)];return console[_0x5af8c9(0x154)](a41_0x402fbc['green'](_0x2f910f[_0x5af8c9(0x182)]?_0x5af8c9(0x1c9):'✔\x20Clone\x20complete')),console['error'](_0x5af8c9(0x1b5)+_0x269c92[_0x5af8c9(0x214)]),console[_0x5af8c9(0x154)](_0x5af8c9(0xe3)+_0x269c92[_0x5af8c9(0x152)]),console[_0x5af8c9(0x154)](_0x5af8c9(0x201)+_0x269c92['revision']),await this[_0x5af8c9(0x1c6)](_0x27e05a,_0x269c92[_0x5af8c9(0x214)],_0xfcd070['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a41_0x448846(0x18a)]=a41_0x448846(0x20f);[a41_0x448846(0xd0)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async['execute'](_0xe82962){const _0x4e06f5=a41_0x448846,{options:_0x17056b,args:_0x5c1668,tdx:_0x2454bc}=_0xe82962,_0x314647=_0x5c1668[0x0];if(!_0x314647)return console[_0x4e06f5(0x154)](_0x4e06f5(0x195)),console[_0x4e06f5(0x154)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x17056b[_0x4e06f5(0x138)]&&console[_0x4e06f5(0x154)]('Project:\x20'+_0x314647);if(!_0x17056b[_0x4e06f5(0x228)]){const _0x31f055=await confirmKey(_0x4e06f5(0x17b)+_0x314647+_0x4e06f5(0x158));if(!_0x31f055)return console[_0x4e06f5(0x154)](_0x4e06f5(0x165)),0x0;}const _0x8a26ae=await withSpinner('Deleting\x20project\x20'+_0x314647+_0x4e06f5(0xeb),()=>_0x2454bc['workflow']['delete'](_0x314647),{'verbose':_0x17056b[_0x4e06f5(0x138)]}),_0x3c0988=_0x8a26ae['data'];return console[_0x4e06f5(0x154)](_0x4e06f5(0x193)+_0x3c0988[_0x4e06f5(0x9e)]),console[_0x4e06f5(0x154)](_0x4e06f5(0xe3)+_0x3c0988[_0x4e06f5(0xbe)]),0x0;}}export function parseKeyValue(_0x4d0c84){const _0x2bf9b3=a41_0x448846,_0x4d1094=_0x4d0c84['indexOf']('=');if(_0x4d1094===-0x1)throw new Error(_0x2bf9b3(0x1a4)+_0x4d0c84+_0x2bf9b3(0x174));const _0x410877=_0x4d0c84[_0x2bf9b3(0x14c)](0x0,_0x4d1094),_0xeaa1cf=_0x4d0c84[_0x2bf9b3(0x14c)](_0x4d1094+0x1);if(!_0x410877)throw new Error(_0x2bf9b3(0x100));return{'key':_0x410877,'value':_0xeaa1cf};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a41_0x448846(0x18a)]=a41_0x448846(0x180);[a41_0x448846(0xd0)]=a41_0x448846(0x198);async[a41_0x448846(0x1f9)](_0x3ff918){const _0x2fb773=a41_0x448846,{options:_0x4126ab,args:_0x4c04f9,tdx:_0x5a3856}=_0x3ff918,_0xa53bc3=this[_0x2fb773(0x9b)](_0x4c04f9,_0x4126ab);if(!_0xa53bc3)return 0x1;_0x4126ab[_0x2fb773(0x138)]&&console[_0x2fb773(0x154)](_0x2fb773(0x108)+_0xa53bc3);const _0x536570=await withSpinner(_0x2fb773(0xf6),()=>_0x5a3856[_0x2fb773(0x13f)][_0x2fb773(0x200)](_0xa53bc3),{'verbose':_0x4126ab[_0x2fb773(0x138)]}),{secrets:_0x53fffd}=_0x536570[_0x2fb773(0x104)];return console[_0x2fb773(0x154)](_0x2fb773(0x111)+_0x53fffd[_0x2fb773(0x1c5)]+'\x20secret'+(_0x53fffd['length']!==0x1?'s':'')),await handleSDKOutput(_0x53fffd,_0x4126ab),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a41_0x448846(0x18a)]='workflow:secrets:set';['description']=a41_0x448846(0x1e3);async[a41_0x448846(0x1f9)](_0x1187c1){const _0x10c8cc=a41_0x448846,{options:_0xafdc52,args:_0xea600,tdx:_0x4741a8}=_0x1187c1;let _0x265b3c,_0x418b1e;if(_0xea600[_0x10c8cc(0x1c5)]>=0x2)_0x265b3c=_0xea600[0x0],_0x418b1e=_0xea600[0x1];else{if(_0xea600['length']===0x1&&_0xafdc52[_0x10c8cc(0x1b9)])_0x265b3c=_0xafdc52[_0x10c8cc(0x1b9)],_0x418b1e=_0xea600[0x0];else return _0xea600[_0x10c8cc(0x1c5)]===0x1?(console[_0x10c8cc(0x154)](_0x10c8cc(0x14a)),console['error'](_0x10c8cc(0xf9)),0x1):(console[_0x10c8cc(0x154)](_0x10c8cc(0xee)),console['error']('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE'),0x1);}let _0x5e3656,_0x4dfd96;try{({key:_0x5e3656,value:_0x4dfd96}=parseKeyValue(_0x418b1e));}catch(_0x33b9b1){return _0x33b9b1 instanceof Error&&console[_0x10c8cc(0x154)](a41_0x402fbc[_0x10c8cc(0x95)](_0x10c8cc(0x9a)),_0x33b9b1[_0x10c8cc(0x19f)]),0x1;}_0xafdc52['verbose']&&(console[_0x10c8cc(0x154)](_0x10c8cc(0x108)+_0x265b3c),console[_0x10c8cc(0x154)](_0x10c8cc(0x19c)+_0x5e3656));const _0x18d645=await withSpinner(_0x10c8cc(0x1da),()=>_0x4741a8['workflow']['setSecret'](_0x265b3c,_0x5e3656,_0x4dfd96),{'verbose':_0xafdc52[_0x10c8cc(0x138)]}),_0x188cc3=_0x18d645[_0x10c8cc(0x104)];return console[_0x10c8cc(0x154)](_0x10c8cc(0x16e)+_0x188cc3[_0x10c8cc(0x218)]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x188cc3['projectName']+'\x27'),(_0xafdc52[_0x10c8cc(0x143)]||_0xafdc52[_0x10c8cc(0x168)])&&await handleSingleObjectOutput(_0x188cc3,_0xafdc52),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a41_0x448846(0x18a)]='workflow:secrets:delete';['description']=a41_0x448846(0x1a3);async[a41_0x448846(0x1f9)](_0x104fab){const _0xccc1ca=a41_0x448846,{options:_0x50483b,args:_0x7fe3c7,tdx:_0x3e3951}=_0x104fab;let _0x5bf1dd,_0x4f2761;if(_0x7fe3c7[_0xccc1ca(0x1c5)]>=0x2)_0x5bf1dd=_0x7fe3c7[0x0],_0x4f2761=_0x7fe3c7[0x1];else{if(_0x7fe3c7[_0xccc1ca(0x1c5)]===0x1&&_0x50483b[_0xccc1ca(0x1b9)])_0x5bf1dd=_0x50483b[_0xccc1ca(0x1b9)],_0x4f2761=_0x7fe3c7[0x0];else return _0x7fe3c7[_0xccc1ca(0x1c5)]===0x1?(console[_0xccc1ca(0x154)](_0xccc1ca(0x14a)),console[_0xccc1ca(0x154)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console['error'](_0xccc1ca(0x1af)),console[_0xccc1ca(0x154)](_0xccc1ca(0xa0)),0x1);}_0x50483b[_0xccc1ca(0x138)]&&(console[_0xccc1ca(0x154)](_0xccc1ca(0x108)+_0x5bf1dd),console[_0xccc1ca(0x154)](_0xccc1ca(0x19c)+_0x4f2761));if(!_0x50483b[_0xccc1ca(0x228)]){const _0x112a93=await confirmKey(_0xccc1ca(0xca)+_0x4f2761+'\x27\x20from\x20project\x20\x27'+_0x5bf1dd+'\x27?');if(!_0x112a93)return console[_0xccc1ca(0x154)]('Cancelled'),0x0;}const _0x473561=await withSpinner(_0xccc1ca(0x12b),()=>_0x3e3951['workflow'][_0xccc1ca(0x21e)](_0x5bf1dd,_0x4f2761),{'verbose':_0x50483b[_0xccc1ca(0x138)]}),_0xddb3f2=_0x473561[_0xccc1ca(0x104)];return console['error']('✔\x20Secret\x20\x27'+_0xddb3f2[_0xccc1ca(0x218)]+_0xccc1ca(0x14d)+_0xddb3f2[_0xccc1ca(0x9e)]+'\x27'),(_0x50483b[_0xccc1ca(0x143)]||_0x50483b[_0xccc1ca(0x168)])&&await handleSingleObjectOutput(_0xddb3f2,_0x50483b),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(_0x41e7d6){const _0x32c223=a41_0x448846,_0x46ccae=Math[_0x32c223(0x123)](_0x41e7d6/0x3e8),_0x264ec6=Math[_0x32c223(0x123)](_0x46ccae/0x3c),_0x45cbfa=Math[_0x32c223(0x123)](_0x264ec6/0x3c),_0x49ca82=Math[_0x32c223(0x123)](_0x45cbfa/0x18);if(_0x49ca82>0x0){const _0xe977cb=_0x45cbfa%0x18;return _0xe977cb>0x0?_0x49ca82+'d\x20'+_0xe977cb+'h':_0x49ca82+'d';}else{if(_0x45cbfa>0x0){const _0x483f1e=_0x264ec6%0x3c;return _0x483f1e>0x0?_0x45cbfa+'h\x20'+_0x483f1e+'m':_0x45cbfa+'h';}else{if(_0x264ec6>0x0){const _0x3de81b=_0x46ccae%0x3c;return _0x3de81b>0x0?_0x264ec6+'m\x20'+_0x3de81b+'s':_0x264ec6+'m';}else return _0x46ccae+'s';}}}function formatTimestamp(_0x48bcee,_0x83374b){const _0x12a850=a41_0x448846,_0x2b28db=new Date(_0x48bcee),_0x494d9e=String(_0x2b28db[_0x12a850(0xde)]())[_0x12a850(0x1b4)](0x2,'0'),_0x20f75b=String(_0x2b28db[_0x12a850(0x1ae)]())['padStart'](0x2,'0'),_0x18f4bc=_0x494d9e+':'+_0x20f75b,_0x15555f=_0x2b28db[_0x12a850(0xd1)]()===_0x83374b['getFullYear']()&&_0x2b28db[_0x12a850(0x130)]()===_0x83374b['getMonth']()&&_0x2b28db[_0x12a850(0x1a2)]()===_0x83374b[_0x12a850(0x1a2)]();if(_0x15555f)return _0x18f4bc;else{const _0x1ef9fc=String(_0x2b28db[_0x12a850(0x130)]()+0x1)[_0x12a850(0x1b4)](0x2,'0'),_0x3e5e59=String(_0x2b28db['getDate']())['padStart'](0x2,'0');return _0x1ef9fc+'-'+_0x3e5e59+'\x20'+_0x18f4bc;}}function formatDate(_0x587899){const _0xcf851=a41_0x448846,_0x2f34ce=_0x587899['getFullYear'](),_0x41ffe7=String(_0x587899[_0xcf851(0x130)]()+0x1)[_0xcf851(0x1b4)](0x2,'0'),_0x191d47=String(_0x587899[_0xcf851(0x1a2)]())['padStart'](0x2,'0');return _0x2f34ce+'-'+_0x41ffe7+'-'+_0x191d47;}function getTaskStateIcon(_0x17c5ff){const _0x2e5563={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x2e5563[_0x17c5ff]||'⚪';}function a41_0x13e8(){const _0x5c87ca=['No\x20log\x20files\x20found\x20for\x20this\x20attempt','\x20sessions\x20','parseProjectWorkflowPattern','...','\x0aDry\x20run\x20-\x20no\x20files\x20written','parse','Error:\x20KEY=VALUE\x20is\x20required','Select\x20a\x20workflow\x20to\x20run','GUTTER','No\x20workflow\x20sessions\x20found','\x0aDry\x20run\x20-\x20no\x20project\x20created','context','\x20project','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Listing\x20secrets...','\x0aPolling...\x20(','\x20(system)','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Killing\x20attempt...','workflows','retrySession','workflow:push','includeSubtasks','List\x20workflows','Key\x20cannot\x20be\x20empty','\x20(use\x20--limit\x20to\x20show\x20more)','msPerChar','window','data','basename','New\x20project\x20name:\x20','targetDir','Project:\x20','download','MAX_LABEL_COUNT','renderTimeline','resolveProjectDir','param','index','\x20workflow','MAX_POLL_ITERATIONS','✔\x20Found\x20','/app/workflows/','tasks','deleted','Cloning\x20to\x20','splice','fileSize','No\x20sessions\x20found\x20in\x20project:\x20','✔\x20Pushed\x20','Select\x20a\x20session\x20to\x20view\x20timeline:','workflow:run','No\x20log\x20content\x20found','Listing\x20workflows...','Pulling\x20project\x20','max','preparePushProject','min','projects','floor','revision','logs','144qZFKYS','pullProject','type','skipValidation','Including\x20subtasks:\x20yes','Deleting\x20secret...','Source\x20project:\x20','Filter:\x20','white','log','getMonth','\x0a✔\x20Already\x20up\x20to\x20date','Files\x20to\x20upload:\x20','/attempt/','sourceDir','⚠\x20Showing\x20first\x20','generateSessionTimelineRows','\x20\x20Workflow:\x20','verbose','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','reason','sessionId','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','\x20\x20Session\x20context\x20set\x20to:\x20','now','workflow','Project\x20directory:\x20','Retrying\x20session...','green','json','resolveProjectId','List\x20workflow\x20attempts','No\x20matching\x20sessions\x20found','has','isTTY','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Error:\x20Project\x20name\x20is\x20required','includes','substring','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Auto-selected\x20latest\x20session:\x20','---\x20','startTime','newProjectId','isNewProject','error','icon','Total:\x20','state','\x22?\x20This\x20cannot\x20be\x20undone.','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','blue','utf-8','fill','fs/promises','indexOf','workflow:upload','List\x20all\x20workflow\x20projects','\x27...','session:','stdout','Pull\x20workflow\x20project\x20to\x20local\x20folder','Cancelled','Writing\x20files...','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','jsonl','resumeFrom','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','find','dim','get','✔\x20Secret\x20\x27','\x0a✔\x20Attempt\x20complete','localeCompare','✔\x20Workflow\x20run\x20started','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','Validation:\x20skipped','.\x20Expected\x20format:\x20KEY=VALUE','No\x20sessions\x20with\x20timing\x20information','No\x20sessions\x20found\x20for:\x20','format','Dry\x20run:\x20yes','48357rdpjkz','tdx\x20wf\x20attempt\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','\x20\x20Console:\x20','Analyzing\x20project...','changes','\x22\x20already\x20exists\x20(ID:\x20','workflow:secrets:list','\x0aClone\x20\x22','targetExists','filter','MAX_TASKS_DISPLAY','cancelRequested','done','start','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','some','name','\x20\x20Files\x20extracted:\x20','cyan','Retrying\x20attempt...','run','trimEnd','lastAttempt','cwd','path','✔\x20Deleted\x20project\x20','push','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','unknown','Show\x20tasks\x20for\x20an\x20attempt','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','1369vSbzsW','Kill\x20a\x20running\x20attempt','split','Key:\x20','retryAttempt','POLL_INTERVAL_MS','message','every','\x0a⚠\x20Project\x20\x22','getDate','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Invalid\x20format:\x20','rows','duration','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','12354084GhtIHL','getTime','\x20\x20tdx\x20wf\x20use\x20<project>','workflowName','Attempt\x20ID:\x20','Pattern:\x20','getMinutes','Error:\x20Secret\x20key\x20is\x20required','isArray','retryAttemptName','project','set','padStart','\x20\x20Project:\x20','\x22\x20to\x20new\x20project\x20\x22','\x0a✔\x20No\x20changes\x20to\x20push','Error:\x20Invalid\x20parameter\x20format:\x20','workflowProject','group_error','workflow:attempts','map','text','✔\x20Downloaded\x20','startsWith','Params:\x20','end','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','Revision:\x20','\x22\x20with\x20new\x20revision?','length','showWorkflowConsoleUrl','autocomplete','columns','✔\x20Project\x20updated','durationMs','1244934njXhzJ','\x20modified','Warning:','sessionTime','Source:\x20','Pushing\x20workflow\x20project...','clear','Expected\x20format:\x20--param\x20key=value','\x1b[1A\x1b[2K','modified','resolve','toLowerCase','No\x20workflows\x20found','list',',\x20Workflow:\x20','Setting\x20secret...','\x0aDry\x20run\x20-\x20nothing\x20pushed','2541076HNwjjS','workflow:pull','\x0aPush\x20these\x20changes?','Select\x20a\x20task\x20to\x20view\x20logs:','Task\x20name:\x20','workflow:clone','\x20unchanged','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Source\x20directory:\x20','workflow:attempt','existingProjectId','\x20\x20Changes:\x20','diff','applyPullProject','slice','running','✔\x20New\x20project:\x20','Start\x20a\x20workflow\x20run','attempt:','2656175AMKUvh','Show\x20specific\x20attempt\x20details','MIN_TIMELINE_WIDTH','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','displayLine','Failed\x20to\x20fetch\x20attempt\x20data','resolveProject','yellow','summary','total','execute','Filter:\x20project=','\x20task','round','93779RMRGCD','Usage:\x20tdx\x20wf\x20use\x20<project>','session','listSecrets','\x20\x20Revision:\x20','values','taskName','\x20to\x20see\x20detailed\x20logs','sort','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','metadata','match','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Downloading\x20logs...','Loading\x20workflows...','new','follow','Listing\x20workflow\x20attempts...','workflow:delete','No\x20workflow\x20projects\x20found','Source\x20directory\x20is\x20required','workflow:timeline','hasChanges','newProjectName','30JfDinL','🔄\x20','relative','key','💡\x20Tip:\x20Use\x20','Force:\x20yes','Using\x20attempt\x20','Project\x20name\x20is\x20required','select','deleteSecret','Target\x20directory:\x20','from','table','limit','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','\x20\x20Session\x20ID:\x20','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','562dNoHTS','(unknown)','yes','params','write','title','dryRun','📋\x20','size','renderSingleTimeline','No\x20workflows\x20found\x20in\x20project:\x20','kill','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','site','ICON_WIDTH','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','Session\x20time:\x20','red','Loading\x20sessions...','createdAt','✔\x20Push\x20complete','fromTask','Error:','requireProject','canceling','executePushProject','projectName','filesExtracted','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','Resolving\x20project\x20\x27','pollTimeline','LABEL_MIN_SPACING','✔\x20Pull\x20complete','force','No\x20attempts\x20found\x20for:\x20','Latest\x20session\x20has\x20no\x20attempt','workflow:sessions','status','Analyzing\x20changes...','No\x20projects\x20match\x20pattern:\x20','pending','\x20\x20Location:\x20','fullName','toISOString','Workflow:\x20','workflow:use','Getting\x20attempt\x20tasks...','repeat','navigateSessionsInteractive','updatedAt','\x20deleted','finishedAt','Retry\x20a\x20session\x20or\x20attempt','sessions','Error:\x20Attempt\x20ID\x20is\x20required','output','executeCloneProject','No\x20workflow\x20tdx.json\x20found','projectId','success','\x20new','renderSessionsTimeline','\x20from\x20session\x20','✔\x20Retry\x20started','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','6HsebWY','11UbaUNq','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','sourceProjectName','ICON_SPACING','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','\x20\x20New\x20attempt\x20ID:\x20','workflow:kill','Listing\x20workflow\x20sessions...','attemptId','startedAt','description','getFullYear','keys','📁\x20','Target:\x20','MIN_LABEL_COUNT','✔\x20Project:\x20','unchanged','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Session\x20','join','\x20-\x20','Attempt:\x20','getHours','buildTimelineData','List\x20workflow\x20execution\x20sessions','session_id','planned','\x20\x20Project\x20ID:\x20','\x20\x20Attempt\x20ID:\x20','Session\x20not\x20found:\x20','\x20logs','TASK_NAME_WIDTH'];a41_0x13e8=function(){return _0x5c87ca;};return a41_0x13e8();}function getBarChar(_0x4d0b91){const _0x245056=a41_0x448846;return _0x4d0b91===_0x245056(0x154)||_0x4d0b91===_0x245056(0x1ba)?'×':'─';}function a41_0x141e(_0x5365b0,_0x2e2e18){_0x5365b0=_0x5365b0-0x8e;const _0x13e8a0=a41_0x13e8();let _0x141e30=_0x13e8a0[_0x5365b0];return _0x141e30;}function getBarColor(_0x5373f0){const _0x4fb77e=a41_0x448846,_0x479c7d={'success':a41_0x402fbc[_0x4fb77e(0x142)],'error':a41_0x402fbc[_0x4fb77e(0x95)],'group_error':a41_0x402fbc[_0x4fb77e(0x95)],'running':a41_0x402fbc[_0x4fb77e(0x15a)],'blocked':a41_0x402fbc[_0x4fb77e(0x1f6)],'planned':a41_0x402fbc[_0x4fb77e(0x16c)],'canceling':a41_0x402fbc[_0x4fb77e(0x1f6)]};return _0x479c7d[_0x5373f0]||a41_0x402fbc[_0x4fb77e(0x12e)];}function parseTaskName(_0x5b9b04){const _0x4d1ad9=a41_0x448846;let _0xbb26ef=_0x5b9b04['replace'](/^\++/,'');const _0x49841f=_0xbb26ef[_0x4d1ad9(0x19b)]('+'),_0x545e79=_0x49841f[_0x4d1ad9(0x1c5)]>0x1?_0x49841f[_0x4d1ad9(0x1c5)]-0x2:0x0,_0x3ef90c=_0x49841f[_0x49841f[_0x4d1ad9(0x1c5)]-0x1]||_0xbb26ef;return{'level':_0x545e79,'name':'+'+_0x3ef90c};}function truncateTaskName(_0x57e0dc,_0x1eb727){const _0x1a8140=a41_0x448846,_0x10a160=stringWidth(_0x57e0dc);if(_0x10a160<=_0x1eb727)return _0x57e0dc;let _0x278d70=_0x57e0dc;while(stringWidth(_0x278d70+'…')>_0x1eb727&&_0x278d70[_0x1a8140(0x1c5)]>0x0){_0x278d70=_0x278d70[_0x1a8140(0x1ea)](0x0,-0x1);}return _0x278d70+'…';}function calculateTimeScale(_0x13be7b,_0xe1d805){const _0x336f2f=a41_0x448846;return{'startTime':_0x13be7b[_0x336f2f(0x187)],'endTime':_0x13be7b[_0x336f2f(0x1c1)],'durationMs':_0x13be7b[_0x336f2f(0x1a6)],'msPerChar':_0x13be7b[_0x336f2f(0x1a6)]/_0xe1d805};}function timeToPosition(_0x4c5c74,_0x1ae5b9,_0x142cdc){const _0x53bee1=a41_0x448846,_0x542e51=_0x4c5c74-_0x1ae5b9[_0x53bee1(0x151)],_0x36520a=Math[_0x53bee1(0x123)](_0x542e51/_0x1ae5b9[_0x53bee1(0x102)]);return Math[_0x53bee1(0x11f)](0x0,Math['min'](_0x36520a,_0x142cdc));}function renderTimeAxis(_0x48ec9a,_0x3fbf75){const _0x55ecd8=a41_0x448846,_0x48a99a=Math['min'](TIMELINE_CONFIG[_0x55ecd8(0x10a)],Math[_0x55ecd8(0x11f)](TIMELINE_CONFIG[_0x55ecd8(0xd5)],Math[_0x55ecd8(0x123)](_0x3fbf75/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x4ed722=_0x48ec9a[_0x55ecd8(0x1ca)]/(_0x48a99a-0x1),_0x3c5bf5=new Date(_0x48ec9a[_0x55ecd8(0x151)]),_0x932b87=[];for(let _0x25b73e=0x0;_0x25b73e<_0x48a99a;_0x25b73e++){const _0x36f62d=_0x48ec9a['startTime']+_0x25b73e*_0x4ed722,_0x497069=timeToPosition(_0x36f62d,_0x48ec9a,_0x3fbf75),_0x197f7b=formatTimestamp(_0x36f62d,_0x3c5bf5);_0x932b87[_0x55ecd8(0x194)]({'pos':_0x497069,'text':_0x197f7b});}const _0xa0c04c=new Array(_0x3fbf75)[_0x55ecd8(0x15c)]('\x20');let _0x1ec28c=-0x1;for(const {pos:_0x50872b,text:_0x3f17d8}of _0x932b87){let _0x4536c8=Math[_0x55ecd8(0x11f)](0x0,_0x50872b-Math[_0x55ecd8(0x123)](_0x3f17d8[_0x55ecd8(0x1c5)]/0x2));_0x4536c8<=_0x1ec28c+TIMELINE_CONFIG[_0x55ecd8(0xa3)]&&(_0x4536c8=_0x1ec28c+TIMELINE_CONFIG[_0x55ecd8(0xa3)]+0x1);_0x4536c8+_0x3f17d8[_0x55ecd8(0x1c5)]>_0x3fbf75&&(_0x4536c8=_0x3fbf75-_0x3f17d8[_0x55ecd8(0x1c5)]);if(_0x4536c8>=0x0&&_0x4536c8+_0x3f17d8[_0x55ecd8(0x1c5)]<=_0x3fbf75&&_0x4536c8>_0x1ec28c){for(let _0x3e4270=0x0;_0x3e4270<_0x3f17d8[_0x55ecd8(0x1c5)];_0x3e4270++){_0xa0c04c[_0x4536c8+_0x3e4270]=_0x3f17d8[_0x3e4270];}_0x1ec28c=_0x4536c8+_0x3f17d8[_0x55ecd8(0x1c5)]-0x1;}}return _0xa0c04c[_0x55ecd8(0xdb)]('');}function renderTaskRow(_0x24e25f,_0x4387a9,_0x6c203d,_0x4473d3){const _0x4689cd=a41_0x448846,{level:_0x5a7897,name:_0x438da8}=parseTaskName(_0x24e25f[_0x4689cd(0x18a)]),_0x3416d3='\x20'[_0x4689cd(0xb3)](_0x5a7897),_0x33a0cc=_0x24e25f[_0x4689cd(0x103)]?'('+formatElapsed(_0x24e25f['window'][_0x4689cd(0x1a6)])+')':'',_0x5aad5d=stringWidth(_0x33a0cc),_0x311741=_0x5a7897*0x1,_0x9d8d4e=_0x4473d3-_0x311741-_0x5aad5d-0x1,_0x968d30=truncateTaskName(_0x438da8,_0x9d8d4e),_0x4c6ec5=_0x3416d3+_0x968d30,_0x39c9ed=stringWidth(_0x4c6ec5),_0x5a84ce=_0x4473d3-_0x39c9ed-_0x5aad5d,_0x206e4d=_0x4c6ec5+'\x20'[_0x4689cd(0xb3)](Math[_0x4689cd(0x11f)](0x1,_0x5a84ce))+a41_0x402fbc[_0x4689cd(0x16c)](_0x33a0cc),_0x4a7f0a=getTaskStateIcon(_0x24e25f[_0x4689cd(0x157)]),_0x70409b=new Array(_0x6c203d)[_0x4689cd(0x15c)]('\x20');if(_0x24e25f[_0x4689cd(0x103)]){const _0x32fffe=timeToPosition(_0x24e25f[_0x4689cd(0x103)]['start'],_0x4387a9,_0x6c203d),_0x5c9c92=timeToPosition(_0x24e25f[_0x4689cd(0x103)][_0x4689cd(0x1c1)],_0x4387a9,_0x6c203d),_0x29928a=getBarChar(_0x24e25f[_0x4689cd(0x157)]),_0x5511e5=Math[_0x4689cd(0x11f)](_0x32fffe+0x1,_0x5c9c92);for(let _0xaae1d3=_0x32fffe;_0xaae1d3<Math['min'](_0x5511e5,_0x6c203d);_0xaae1d3++){_0x70409b[_0xaae1d3]=_0x29928a;}}const _0x4da351=getBarColor(_0x24e25f['state']),_0x65e7ff=_0x70409b['map'](_0x5d4664=>_0x5d4664==='\x20'?'\x20':_0x4da351(_0x5d4664))['join']('');return _0x4a7f0a+'\x20'+_0x206e4d+'│'+_0x65e7ff+'│';}function calculateStats(_0x5de29e){const _0x5efe45=a41_0x448846,_0x309189={'total':_0x5de29e['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x4f1191 of _0x5de29e){if(_0x4f1191[_0x5efe45(0x157)]===_0x5efe45(0xbf))_0x309189['success']++;else{if(_0x4f1191['state']===_0x5efe45(0x154)||_0x4f1191['state']===_0x5efe45(0x1ba))_0x309189['error']++;else _0x4f1191['state']===_0x5efe45(0x1eb)?_0x309189[_0x5efe45(0x1eb)]++:_0x309189[_0x5efe45(0xac)]++;}}return _0x309189;}function formatStats(_0x13d91a){const _0x5bceb8=a41_0x448846;return[_0x5bceb8(0x156)+_0x13d91a[_0x5bceb8(0x1f8)],'✅\x20'+_0x13d91a[_0x5bceb8(0xbf)],'❌\x20'+_0x13d91a['error'],_0x5bceb8(0x216)+_0x13d91a[_0x5bceb8(0x1eb)],'⏳\x20'+_0x13d91a[_0x5bceb8(0xac)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a41_0x448846(0x18a)]=a41_0x448846(0x212);[a41_0x448846(0xd0)]='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a41_0x448846(0x1f9)](_0x1fb4ba){const _0x2d2927=a41_0x448846,{options:_0x26d387,args:_0x572214,tdx:_0x18d964}=_0x1fb4ba;let _0x6b2a51,_0x3e4e92,_0xf1e515=![];if(_0x572214[0x0]){if(_0x572214[0x0]['includes']('.')){const _0x4c52c3=this[_0x2d2927(0xea)](_0x572214,_0x26d387);if(!_0x4c52c3)return 0x1;_0x6b2a51=_0x4c52c3['projectName'],_0x3e4e92=_0x4c52c3['workflowName'];}else{_0x3e4e92=_0x572214[0x0],_0x6b2a51=_0x26d387[_0x2d2927(0x1b9)];if(!_0x6b2a51)return console['error'](a41_0x402fbc[_0x2d2927(0x95)](_0x2d2927(0x9a)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0xf1e515=!![];}}else{const _0x4f7a7d=this['parseProjectWorkflowPattern'](_0x572214,_0x26d387);if(!_0x4f7a7d)return 0x1;_0x6b2a51=_0x4f7a7d[_0x2d2927(0x9e)],_0x3e4e92=_0x4f7a7d[_0x2d2927(0x1ab)];}if(_0x26d387[_0x2d2927(0x138)]){if(_0x6b2a51&&_0x3e4e92)console[_0x2d2927(0x154)](_0x2d2927(0x12d)+_0x6b2a51+'.'+_0x3e4e92);else _0x6b2a51&&console[_0x2d2927(0x154)](_0x2d2927(0x1fa)+_0x6b2a51);}const _0x2622db=_0x26d387[_0x2d2927(0xce)],_0x39a72e=_0x26d387[_0x2d2927(0x13b)];if(_0x2622db){_0x39a72e&&console[_0x2d2927(0x154)](a41_0x402fbc[_0x2d2927(0x1f6)](_0x2d2927(0x1cd)),_0x2d2927(0x172));const _0x2491f0=_0x26d387[_0x2d2927(0x20d)];return _0x2491f0?await this[_0x2d2927(0xa2)](_0x1fb4ba,_0x2622db):await this[_0x2d2927(0x22f)](_0x1fb4ba,_0x2622db,_0x26d387),0x0;}if(_0x39a72e){const _0x200576=await withSpinner('Loading\x20session...',()=>_0x18d964['workflow'][_0x2d2927(0xb9)]({'projectName':_0x6b2a51,'workflowName':_0x3e4e92,'limit':0x64}),{'verbose':_0x26d387[_0x2d2927(0x138)]}),_0x59c021=_0x200576['data'][_0x2d2927(0x16b)](_0x5774e1=>_0x5774e1['id']===_0x39a72e);if(!_0x59c021)return console[_0x2d2927(0x154)](a41_0x402fbc[_0x2d2927(0x95)](_0x2d2927(0x9a)),_0x2d2927(0xe5)+_0x39a72e),0x1;if(!_0x59c021['lastAttempt']?.['id'])return console[_0x2d2927(0x154)](a41_0x402fbc[_0x2d2927(0x95)](_0x2d2927(0x9a)),_0x2d2927(0xda)+_0x39a72e+'\x20has\x20no\x20attempts'),0x1;const _0x48695c=_0x59c021[_0x2d2927(0x190)]['id'];_0x26d387[_0x2d2927(0x138)]&&console[_0x2d2927(0x154)](_0x2d2927(0x21b)+_0x48695c+_0x2d2927(0xc2)+_0x39a72e);const _0xb67e25=_0x26d387[_0x2d2927(0x20d)];return _0xb67e25?await this[_0x2d2927(0xa2)](_0x1fb4ba,_0x48695c):await this[_0x2d2927(0x22f)](_0x1fb4ba,_0x48695c,_0x26d387),0x0;}const _0x4b6de2=await withSpinner(_0x2d2927(0x96),()=>_0x18d964[_0x2d2927(0x13f)][_0x2d2927(0xb9)]({'projectName':_0x6b2a51,'workflowName':_0x3e4e92,'limit':_0x26d387[_0x2d2927(0x222)]||0x32}),{'verbose':_0x26d387[_0x2d2927(0x138)]}),_0x53844b=_0x4b6de2[_0x2d2927(0x104)];if(_0x53844b[_0x2d2927(0x1c5)]===0x0){if(_0x6b2a51&&_0x3e4e92)console[_0x2d2927(0x154)](_0x2d2927(0x176)+_0x6b2a51+'.'+_0x3e4e92);else _0x6b2a51?console[_0x2d2927(0x154)](_0x2d2927(0x118)+_0x6b2a51):(console[_0x2d2927(0x154)](_0x2d2927(0xf1)),console[_0x2d2927(0x154)](a41_0x402fbc[_0x2d2927(0x16c)]('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x53844b[_0x2d2927(0x205)]((_0x547119,_0x3d329f)=>{const _0x331aff=_0x2d2927,_0x269509=_0x547119[_0x331aff(0x1ce)]||'',_0x34e0ce=_0x3d329f[_0x331aff(0x1ce)]||'';return _0x34e0ce[_0x331aff(0x170)](_0x269509);});if(_0x26d387[_0x2d2927(0x143)]||_0x26d387[_0x2d2927(0x168)])return await handleSDKOutput(_0x53844b,_0x26d387),0x0;let _0x5dff07;if(_0xf1e515){const _0x599d5d=_0x53844b[0x0];if(!_0x599d5d[_0x2d2927(0x190)]?.['id'])return console[_0x2d2927(0x154)](_0x2d2927(0xa7)),0x0;_0x5dff07=_0x599d5d[_0x2d2927(0x190)]['id'],_0x26d387[_0x2d2927(0x138)]&&console['error'](_0x2d2927(0x14f)+_0x599d5d[_0x2d2927(0x1ce)]);}else{const _0x214525=_0x53844b['map'](_0x4e0c94=>{const _0x3fea4f=_0x2d2927,_0x5c74c9=getAttemptStatusDisplay(_0x4e0c94[_0x3fea4f(0x190)]);return{'title':_0x4e0c94[_0x3fea4f(0x1b2)]?.['name']+'.'+_0x4e0c94['workflow']?.[_0x3fea4f(0x18a)]+_0x3fea4f(0xdc)+_0x4e0c94[_0x3fea4f(0x1ce)]+'\x20'+_0x5c74c9[_0x3fea4f(0x155)],'value':_0x4e0c94[_0x3fea4f(0x190)]?.['id']||'','description':_0x5c74c9[_0x3fea4f(0x1bd)]};}),_0x5defc8=await a41_0x131ac0({'type':_0x2d2927(0x21d),'name':_0x2d2927(0xce),'message':_0x2d2927(0x11a),'choices':_0x214525[_0x2d2927(0x183)](_0x1d75e3=>_0x1d75e3['value']!=='')});if(!_0x5defc8[_0x2d2927(0xce)])return 0x0;_0x5dff07=_0x5defc8[_0x2d2927(0xce)];}const _0x1d52fc=_0x26d387['follow'];return _0x1d52fc?await this[_0x2d2927(0xa2)](_0x1fb4ba,_0x5dff07):await this[_0x2d2927(0x22f)](_0x1fb4ba,_0x5dff07,_0x26d387),0x0;}async['renderSingleTimeline'](_0x4cdc8a,_0x175c2e,_0x23b86a){const _0x5dc0d5=a41_0x448846,{tdx:_0x2059a3}=_0x4cdc8a;let _0x1a8a67,_0x47d9c8;try{[_0x1a8a67,_0x47d9c8]=await Promise['all']([_0x2059a3[_0x5dc0d5(0x13f)]['attempt'](_0x175c2e),_0x2059a3['workflow'][_0x5dc0d5(0x113)](_0x175c2e,![])]);}catch(_0x4bb1d4){console[_0x5dc0d5(0x154)](a41_0x402fbc['red'](_0x5dc0d5(0x1f4)));_0x23b86a[_0x5dc0d5(0x138)]&&console[_0x5dc0d5(0x154)](_0x4bb1d4);throw _0x4bb1d4;}if(_0x23b86a[_0x5dc0d5(0x143)]||_0x23b86a[_0x5dc0d5(0x168)]){const _0x5b2208=this[_0x5dc0d5(0xdf)](_0x1a8a67,_0x47d9c8);await handleSDKOutput([_0x5b2208],_0x23b86a);return;}const _0x949eb3=_0x2059a3['context']['site'],_0x436ecc=this['renderTimeline'](_0x1a8a67,_0x47d9c8,_0x949eb3);console['log'](_0x436ecc);}async[a41_0x448846(0xa2)](_0x3fa035,_0x45e283){const _0x4cbab3=a41_0x448846,{tdx:_0x1415b8}=_0x3fa035,_0x282893=TIMELINE_CONFIG[_0x4cbab3(0x19e)],_0x4b5275=TIMELINE_CONFIG[_0x4cbab3(0x110)];let _0x48855c=0x0;while(_0x48855c<_0x4b5275){process['stdout']['isTTY']&&process[_0x4cbab3(0x163)][_0x4cbab3(0x22a)]('\x1bc');let _0x2fcc97,_0x5ad939;try{[_0x2fcc97,_0x5ad939]=await Promise['all']([_0x1415b8[_0x4cbab3(0x13f)]['attempt'](_0x45e283),_0x1415b8[_0x4cbab3(0x13f)][_0x4cbab3(0x113)](_0x45e283,![])]);}catch(_0x3be08f){console['error'](a41_0x402fbc[_0x4cbab3(0x95)](_0x4cbab3(0xf5)));_0x48855c>0x0&&console['error'](a41_0x402fbc['dim'](_0x4cbab3(0x93)+_0x48855c));throw _0x3be08f;}const _0x34f79c=_0x1415b8[_0x4cbab3(0xf3)][_0x4cbab3(0x91)],_0x24ab3a=this[_0x4cbab3(0x10b)](_0x2fcc97,_0x5ad939,_0x34f79c);console[_0x4cbab3(0x12f)](_0x24ab3a);const _0x48a94f=_0x2fcc97[_0x4cbab3(0x186)]&&_0x5ad939[_0x4cbab3(0x1a0)](_0x3db636=>_0x3db636[_0x4cbab3(0x157)]!==_0x4cbab3(0x1eb)&&_0x3db636['state']!=='planned');if(_0x48a94f){console[_0x4cbab3(0x154)](a41_0x402fbc[_0x4cbab3(0x142)](_0x4cbab3(0x16f)));break;}console['error'](a41_0x402fbc[_0x4cbab3(0x16c)](_0x4cbab3(0xf7)+_0x48855c*0x2+_0x4cbab3(0x149))),await new Promise(_0x179488=>setTimeout(_0x179488,_0x282893)),_0x48855c++;}_0x48855c>=_0x4b5275&&console['error'](a41_0x402fbc[_0x4cbab3(0x1f6)](_0x4cbab3(0x14e)));}[a41_0x448846(0x10b)](_0x4f64e5,_0x2fb282,_0x334e3a){const _0x5b42db=a41_0x448846,_0x55c331=[],_0x59ee45=TIMELINE_CONFIG[_0x5b42db(0xe7)],_0x319971=0x5,_0x257348=process['stdout'][_0x5b42db(0x1c8)]||0x78,_0x1cac53=_0x257348-_0x59ee45-_0x319971,_0xb67f78=Math[_0x5b42db(0x11f)](TIMELINE_CONFIG[_0x5b42db(0x1f1)],Math[_0x5b42db(0x121)](_0x1cac53,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0xdc4a51=new Date(_0x4f64e5['createdAt'])[_0x5b42db(0x1a9)](),_0x2bf4af=_0x4f64e5[_0x5b42db(0xb7)]?new Date(_0x4f64e5[_0x5b42db(0xb7)])[_0x5b42db(0x1a9)]():Date[_0x5b42db(0x13e)](),_0x4cfa5f={'start':_0xdc4a51,'end':_0x2bf4af,'duration':_0x2bf4af-_0xdc4a51},_0x1b8db3=new Map(),_0x371b80=[];for(const _0x4cb12a of _0x2fb282){if(_0x4cb12a[_0x5b42db(0xcf)]){const _0x5cd331=new Date(_0x4cb12a[_0x5b42db(0xcf)])[_0x5b42db(0x1a9)](),_0x396c51=_0x4cb12a['updatedAt']?new Date(_0x4cb12a[_0x5b42db(0xb5)])[_0x5b42db(0x1a9)]():Date[_0x5b42db(0x13e)](),_0x18f4e5={'start':_0x5cd331,'end':_0x396c51,'duration':_0x396c51-_0x5cd331};_0x1b8db3[_0x5b42db(0x1b3)](_0x4cb12a['id'],_0x18f4e5),_0x371b80['push']({'name':_0x4cb12a[_0x5b42db(0xae)],'state':_0x4cb12a['state']||_0x5b42db(0x196),'window':_0x18f4e5});}else _0x371b80[_0x5b42db(0x194)]({'name':_0x4cb12a[_0x5b42db(0xae)],'state':_0x4cb12a['state']||_0x5b42db(0xe2),'window':undefined});}_0x371b80['sort']((_0x4daac9,_0x39f0f6)=>{const _0x5a927d=_0x5b42db;if(!_0x4daac9[_0x5a927d(0x103)])return 0x1;if(!_0x39f0f6[_0x5a927d(0x103)])return-0x1;return _0x4daac9[_0x5a927d(0x103)][_0x5a927d(0x187)]-_0x39f0f6[_0x5a927d(0x103)][_0x5a927d(0x187)];});const _0x5ab1b5=_0x371b80['length'],_0x153d04=_0x5ab1b5>TIMELINE_CONFIG[_0x5b42db(0x184)];_0x153d04&&_0x371b80[_0x5b42db(0x116)](TIMELINE_CONFIG[_0x5b42db(0x184)]);const _0xc17d5e=calculateTimeScale(_0x4cfa5f,_0xb67f78),_0x1bd0b0=_0x4f64e5[_0x5b42db(0x186)]?_0x4f64e5[_0x5b42db(0xbf)]?a41_0x402fbc['green'](_0x5b42db(0xbf)):a41_0x402fbc['red']('error'):a41_0x402fbc['blue'](_0x5b42db(0x1eb)),_0x18dbd4=_0x4f64e5['project']?.['id'],_0x4ec49c=_0x4f64e5[_0x5b42db(0x13b)];let _0x5b1214;if(_0x18dbd4&&_0x4ec49c){const _0x3fef56=getWorkflowAttemptUrl(_0x334e3a,_0x18dbd4,_0x4ec49c,_0x4f64e5['id']);_0x5b1214=hyperlink(a41_0x402fbc['dim'](_0x4f64e5['id']),_0x3fef56);}else _0x5b1214=a41_0x402fbc[_0x5b42db(0x16c)](_0x4f64e5['id']);_0x55c331[_0x5b42db(0x194)](_0x5b42db(0xdd)+_0x5b1214+'\x20-\x20'+_0x1bd0b0+_0x5b42db(0xdc)+formatElapsed(_0x4cfa5f[_0x5b42db(0x1a6)]));if(_0x371b80[_0x5b42db(0x1c5)]>0x0){const _0x6c7f5b=renderTimeAxis(_0xc17d5e,_0xb67f78),_0x3d0150=new Date(_0x4cfa5f['start']),_0x43806c=formatDate(_0x3d0150),_0x25fcbf=TIMELINE_CONFIG[_0x5b42db(0x92)]+TIMELINE_CONFIG[_0x5b42db(0xc9)]+_0x59ee45,_0x367812=_0x43806c[_0x5b42db(0x1b4)](_0x25fcbf),_0x4b3189=a41_0x402fbc['dim'](_0x367812);_0x55c331[_0x5b42db(0x194)](_0x4b3189+'\x20'+_0x6c7f5b);for(const _0x5f456f of _0x371b80){_0x55c331[_0x5b42db(0x194)](renderTaskRow(_0x5f456f,_0xc17d5e,_0xb67f78,_0x59ee45));}const _0x5518a1=calculateStats(_0x371b80);_0x55c331[_0x5b42db(0x194)](formatStats(_0x5518a1)),_0x153d04&&_0x55c331[_0x5b42db(0x194)](a41_0x402fbc[_0x5b42db(0x1f6)](_0x5b42db(0x135)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+'\x20of\x20'+_0x5ab1b5+'\x20tasks')),_0x55c331[_0x5b42db(0x194)](''),_0x55c331[_0x5b42db(0x194)](a41_0x402fbc['dim'](_0x5b42db(0x219))+(_0x5b42db(0x17a)+_0x4f64e5['id']+_0x5b42db(0xe6))+a41_0x402fbc['dim'](_0x5b42db(0x204)));}else _0x55c331[_0x5b42db(0x194)]('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x55c331[_0x5b42db(0xdb)]('\x0a');}['buildTimelineData'](_0x2ff160,_0x1952b1){const _0x58415f=a41_0x448846,_0x46ed0a=new Date(_0x2ff160[_0x58415f(0x97)])['getTime'](),_0x3ba542=_0x2ff160[_0x58415f(0xb7)]?new Date(_0x2ff160['finishedAt'])[_0x58415f(0x1a9)]():Date['now'](),_0x3e8884=_0x3ba542-_0x46ed0a,_0x4ee3f7=[];for(const _0x21fa25 of _0x1952b1){if(_0x21fa25['startedAt']){const _0x7f83e0=new Date(_0x21fa25[_0x58415f(0xcf)])[_0x58415f(0x1a9)](),_0x210f58=_0x21fa25[_0x58415f(0xb5)]?new Date(_0x21fa25[_0x58415f(0xb5)])[_0x58415f(0x1a9)]():Date[_0x58415f(0x13e)]();_0x4ee3f7['push']({'name':_0x21fa25['fullName'],'state':_0x21fa25[_0x58415f(0x157)]||_0x58415f(0x196),'window':{'start':_0x7f83e0,'end':_0x210f58,'duration':_0x210f58-_0x7f83e0}});}else _0x4ee3f7[_0x58415f(0x194)]({'name':_0x21fa25['fullName'],'state':_0x21fa25[_0x58415f(0x157)]||'planned','window':undefined});}const _0x19c9ee=calculateStats(_0x4ee3f7);return{'attempt':{'id':_0x2ff160['id'],'status':_0x2ff160[_0x58415f(0x186)]?_0x2ff160[_0x58415f(0xbf)]?_0x58415f(0xbf):_0x58415f(0x154):_0x58415f(0x1eb),'createdAt':_0x2ff160[_0x58415f(0x97)],'finishedAt':_0x2ff160['finishedAt'],'duration_ms':_0x3e8884},'tasks':_0x4ee3f7[_0x58415f(0x1bc)](_0xec408a=>({'name':_0xec408a[_0x58415f(0x18a)],'state':_0xec408a[_0x58415f(0x157)],'startedAt':_0xec408a[_0x58415f(0x103)]?new Date(_0xec408a[_0x58415f(0x103)][_0x58415f(0x187)])[_0x58415f(0xaf)]():null,'updatedAt':_0xec408a[_0x58415f(0x103)]?new Date(_0xec408a[_0x58415f(0x103)]['end'])[_0x58415f(0xaf)]():null,'duration_ms':_0xec408a[_0x58415f(0x103)]?.['duration']||null})),'stats':_0x19c9ee};}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x564775,_0x4cb27d){const _0xcd1734=a42_0x2418,_0x53c9f7=_0x564775();while(!![]){try{const _0x46e592=parseInt(_0xcd1734(0x1b7))/0x1*(parseInt(_0xcd1734(0x1b0))/0x2)+-parseInt(_0xcd1734(0x1ba))/0x3+-parseInt(_0xcd1734(0x1b1))/0x4+-parseInt(_0xcd1734(0x1b5))/0x5+-parseInt(_0xcd1734(0x1af))/0x6+-parseInt(_0xcd1734(0x1bc))/0x7+parseInt(_0xcd1734(0x1b8))/0x8;if(_0x46e592===_0x4cb27d)break;else _0x53c9f7['push'](_0x53c9f7['shift']());}catch(_0x19773a){_0x53c9f7['push'](_0x53c9f7['shift']());}}}(a42_0x5dbf,0x20775));function a42_0x2418(_0x5e2992,_0x5f5032){_0x5e2992=_0x5e2992-0x1ad;const _0x5dbf21=a42_0x5dbf();let _0x241823=_0x5dbf21[_0x5e2992];return _0x241823;}import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a42_0x5dbf(){const _0x4e124f=['Authorization','738670TTQpGl',';\x20node/','191uMNZMd','5773736pMOAOL','TD1\x20','355128ucRnxi','version','1170127atvtOi','replace','entries','tdx/','298704FjvIjf','1486fesBeo','990376FzJDep','length','X-Trino-User'];a42_0x5dbf=function(){return _0x4e124f;};return a42_0x5dbf();}export function getUserAgent(){const _0x92cff9=a42_0x2418,_0x2d9c54=getVersion(),_0x2bf8c9=platform(),_0x3f1b10=process[_0x92cff9(0x1bb)][_0x92cff9(0x1bd)]('v','');return _0x92cff9(0x1ae)+_0x2d9c54+'\x20('+_0x2bf8c9+_0x92cff9(0x1b6)+_0x3f1b10+')';}export function getAuthHeaders(_0x3085a3,_0x524a9d){const _0x348176=a42_0x2418,_0x16c342=getVersion(),_0xf9132={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x16c342};return _0x524a9d&&(_0xf9132[_0x348176(0x1b4)]=_0x348176(0x1b9)+_0x524a9d),_0xf9132;}export function toHeaderRecord(_0x4350fd){const _0x559726=a42_0x2418,_0x5ddb43={};for(const [_0x31d031,_0x3a94b0]of Object[_0x559726(0x1ad)](_0x4350fd)){_0x3a94b0!==undefined&&(_0x5ddb43[_0x31d031]=_0x3a94b0);}return _0x5ddb43;}export function getTrinoHeaders(_0x482804,_0x58457c){const _0x31e190=a42_0x2418,_0x54b9f8=getAuthHeaders(_0x482804,_0x58457c),_0x10ab8d=toHeaderRecord(_0x54b9f8);return delete _0x10ab8d[_0x31e190(0x1b4)],_0x58457c&&(_0x10ab8d[_0x31e190(0x1b3)]=_0x58457c),_0x10ab8d;}export function hasAPIKey(_0x313f79){const _0x52d03e=a42_0x2418,_0x29fa56=getAPIKey(_0x313f79);return _0x29fa56!==undefined&&_0x29fa56[_0x52d03e(0x1b2)]>0x0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x2e805e,_0x57c8f4){const _0x42cae3=a43_0x5ec0,_0x25132b=_0x2e805e();while(!![]){try{const _0x2194b6=parseInt(_0x42cae3(0x205))/0x1+-parseInt(_0x42cae3(0x1dc))/0x2*(-parseInt(_0x42cae3(0x1d7))/0x3)+-parseInt(_0x42cae3(0x206))/0x4+parseInt(_0x42cae3(0x214))/0x5+parseInt(_0x42cae3(0x20d))/0x6*(parseInt(_0x42cae3(0x1f3))/0x7)+-parseInt(_0x42cae3(0x1df))/0x8+-parseInt(_0x42cae3(0x1f2))/0x9;if(_0x2194b6===_0x57c8f4)break;else _0x25132b['push'](_0x25132b['shift']());}catch(_0x5da31d){_0x25132b['push'](_0x25132b['shift']());}}}(a43_0x4e9a,0x2e112));import{writeFileSync}from'fs';function a43_0x5ec0(_0x39d3a0,_0x2d9d9c){_0x39d3a0=_0x39d3a0-0x1d6;const _0x4e9a1f=a43_0x4e9a();let _0x5ec0e6=_0x4e9a1f[_0x39d3a0];return _0x5ec0e6;}import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a43_0x50ce7d from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x5db93b){const _0x42746b=a43_0x5ec0;return _0x5db93b[_0x42746b(0x215)]===_0x42746b(0x1fc)||_0x5db93b[_0x42746b(0x215)]===_0x42746b(0x1e7)||_0x5db93b['format']===_0x42746b(0x1ff)||_0x5db93b[_0x42746b(0x215)]===_0x42746b(0x1ea)||_0x5db93b[_0x42746b(0x1fc)]===!![]||_0x5db93b[_0x42746b(0x1e7)]===!![]||_0x5db93b['tsv']===!![]||_0x5db93b[_0x42746b(0x1ea)]===!![];}export function parseOutputOptions(_0x3ed570){const _0x5f519b=a43_0x5ec0;return{'format':_0x3ed570[_0x5f519b(0x215)]||_0x5f519b(0x1ea),'output':_0x3ed570[_0x5f519b(0x200)]||'','limit':_0x3ed570[_0x5f519b(0x201)],'color':_0x3ed570[_0x5f519b(0x1e6)],'noColor':_0x3ed570[_0x5f519b(0x1e8)]};}function convertSDKResultToQueryResult(_0x3b679f){const _0x184c13=a43_0x5ec0,_0x2c4428=[];if(_0x3b679f[_0x184c13(0x1e1)]>0x0){const _0x2cdfe7=_0x3b679f[0x0];for(const [_0x1100e4,_0x3caee6]of Object[_0x184c13(0x1f8)](_0x2cdfe7)){let _0x416e6f=_0x184c13(0x1fa);if(typeof _0x3caee6===_0x184c13(0x1e9))_0x416e6f=Number[_0x184c13(0x1f0)](_0x3caee6)?_0x184c13(0x1db):_0x184c13(0x204);else{if(typeof _0x3caee6===_0x184c13(0x203))_0x416e6f=_0x184c13(0x203);else _0x3caee6===null&&(_0x416e6f=_0x184c13(0x1fa));}_0x2c4428[_0x184c13(0x1fd)]({'name':_0x1100e4,'type':_0x416e6f});}}return{'queryId':_0x184c13(0x1f1),'columns':_0x2c4428,'data':_0x3b679f,'stats':{'state':_0x184c13(0x1ec),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3b679f[_0x184c13(0x1e1)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x3d1765,_0x375de2){const _0x14c803=convertSDKResultToQueryResult(_0x3d1765);return formatQueryOutput(_0x14c803,_0x375de2);}export async function formatQueryOutput(_0x5096f8,_0x3042d9){const _0x39421b=a43_0x5ec0,{format:_0x27ee14,limit:_0x54471e,output:_0x2a1410,color:_0x211966,noColor:_0x327cb8}=_0x3042d9,_0x25f7c1=Boolean(_0x2a1410)&&!_0x211966,_0x21cf40={'color':_0x211966,'noColor':_0x327cb8||_0x25f7c1};if(_0x27ee14===_0x39421b(0x1ea)){const _0x4d51d0=shouldUseLess(_0x27ee14,_0x2a1410);return formatAsTable(_0x5096f8,_0x54471e,_0x4d51d0,_0x21cf40);}else{if(_0x27ee14===_0x39421b(0x1fc))return formatAsJSON(_0x5096f8,_0x21cf40);else return _0x27ee14===_0x39421b(0x1e7)?formatAsJSONL(_0x5096f8,_0x21cf40):formatQueryResult(_0x5096f8,_0x27ee14);}}function shouldUseLess(_0x4e6d1e,_0x341a5){const _0xaf068f=a43_0x5ec0;return(_0x4e6d1e===_0xaf068f(0x1ea)||_0x4e6d1e===_0xaf068f(0x1e3))&&process['stdout'][_0xaf068f(0x1e2)]&&!_0x341a5;}export function resolveOutputOptions(_0x4316d3){const _0xb2eaec=a43_0x5ec0,_0x5f5d3a=resolveOutputFormat(_0x4316d3['format'],_0x4316d3[_0xb2eaec(0x200)],_0xb2eaec(0x1ea));let _0x1b603c=typeof _0x4316d3[_0xb2eaec(0x201)]===_0xb2eaec(0x1e9)?_0x4316d3[_0xb2eaec(0x201)]:parseInt(_0x4316d3['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x196073=_0x4316d3['output']||'';return shouldUseLess(_0x5f5d3a,_0x196073)&&(_0x1b603c=Infinity),{'format':_0x5f5d3a,'output':_0x196073,'limit':_0x1b603c,'color':_0x4316d3[_0xb2eaec(0x1e6)],'noColor':_0x4316d3['noColor']};}export function writeOutput(_0x3fa5b1,_0x673f1,_0x4672cb){const _0x35daff=a43_0x5ec0;return _0x673f1?(writeFileSync(_0x673f1,_0x3fa5b1),console[_0x35daff(0x1fb)](_0x35daff(0x1ef)+_0x673f1),Promise[_0x35daff(0x207)]()):shouldUseLess(_0x4672cb||'','')?new Promise(_0x5e2972=>{const _0x55a0d1=_0x35daff,_0x260392=spawn('less',['-FXRSn'],{'stdio':['pipe',_0x55a0d1(0x1f9),'inherit']});let _0x55019f=![];_0x260392['on']('error',()=>{const _0xf0b719=_0x55a0d1;!_0x55019f&&(_0x55019f=!![],console[_0xf0b719(0x1f5)](_0x3fa5b1),_0x5e2972());}),_0x260392['on'](_0x55a0d1(0x202),()=>{!_0x55019f&&(_0x55019f=!![],_0x5e2972());}),_0x260392['on']('spawn',()=>{const _0x22fda9=_0x55a0d1;!_0x55019f&&_0x260392['stdin']&&(_0x260392['stdin']['on'](_0x22fda9(0x1fb),()=>{}),_0x260392[_0x22fda9(0x20c)]['write'](_0x3fa5b1),_0x260392[_0x22fda9(0x20c)][_0x22fda9(0x20b)]());}),!_0x260392[_0x55a0d1(0x20c)]&&(!_0x55019f&&(_0x55019f=!![],console[_0x55a0d1(0x1f5)](_0x3fa5b1),_0x5e2972()));}):(console[_0x35daff(0x1f5)](_0x3fa5b1),Promise[_0x35daff(0x207)]());}export async function handleSDKOutput(_0x37b488,_0x59ed29){const _0x339933=a43_0x5ec0,_0xbe863b=resolveOutputOptions(_0x59ed29),_0x45e6cc=await formatSDKOutput(_0x37b488,_0xbe863b);await writeOutput(_0x45e6cc,_0xbe863b['output']||undefined,_0xbe863b[_0x339933(0x215)]);}export async function handleQueryOutput(_0x42ae09,_0x5a0a64){const _0xe44bf=a43_0x5ec0,_0x417008=resolveOutputOptions(_0x5a0a64),_0x1abcaf=await formatQueryOutput(_0x42ae09,_0x417008);await writeOutput(_0x1abcaf,_0x417008[_0xe44bf(0x200)]||undefined,_0x417008[_0xe44bf(0x215)]);}async function formatSingleObject(_0x2966a4,_0x3aee87){const _0x35e3be=a43_0x5ec0,{format:_0x29bec2,color:_0x1b7ca7,noColor:_0x1742b2}=_0x3aee87,_0xb197fd={'color':_0x1b7ca7,'noColor':_0x1742b2};if(_0x29bec2==='json'){if(shouldUseColor(_0xb197fd))return colorizeJSON(_0x2966a4,_0xb197fd);return JSON[_0x35e3be(0x1ee)](_0x2966a4,null,0x2);}else{if(_0x29bec2===_0x35e3be(0x1e7)){if(shouldUseColor(_0xb197fd))return colorizeJSONCompact(_0x2966a4,_0xb197fd);return JSON[_0x35e3be(0x1ee)](_0x2966a4);}else{if(_0x29bec2===_0x35e3be(0x1ff))return Object[_0x35e3be(0x1f8)](_0x2966a4)[_0x35e3be(0x1e5)](([_0x2e1980,_0x3fc716])=>_0x2e1980+'\x09'+_0x3fc716)[_0x35e3be(0x1da)]('\x0a');else{const _0xa247fa=Object[_0x35e3be(0x1f8)](_0x2966a4);if(_0xa247fa[_0x35e3be(0x1e1)]===0x0)return'No\x20data';const _0x559d5f=_0x2966a4[_0x35e3be(0x1eb)],_0x5863bb=_0x2966a4[_0x35e3be(0x1ed)],_0x129fa8=_0x2966a4[_0x35e3be(0x1d6)],_0x27af1c=_0x2966a4[_0x35e3be(0x20a)],_0x5ed0f3=_0x5863bb?typeof _0x5863bb==='string'?_0x5863bb:JSON[_0x35e3be(0x1ee)](_0x5863bb,null,0x2):undefined,_0x125170=_0x129fa8&&Object[_0x35e3be(0x1d8)](_0x129fa8)[_0x35e3be(0x1e1)]>0x0?JSON[_0x35e3be(0x1ee)](_0x129fa8,null,0x2):undefined,_0x5b883e=_0x27af1c&&Object[_0x35e3be(0x1d8)](_0x27af1c)[_0x35e3be(0x1e1)]>0x0?JSON[_0x35e3be(0x1ee)](_0x27af1c,null,0x2):undefined,_0x76b055=_0xa247fa['filter'](([_0x387c40])=>_0x387c40!==_0x35e3be(0x1eb)&&_0x387c40!==_0x35e3be(0x1ed)&&_0x387c40!==_0x35e3be(0x1d6)&&_0x387c40!==_0x35e3be(0x20a)),_0x133777=Math[_0x35e3be(0x1fe)](..._0x76b055[_0x35e3be(0x1e5)](([_0x3fa2a8])=>_0x3fa2a8[_0x35e3be(0x1e1)])),_0x5c9978=Math[_0x35e3be(0x1fe)](..._0x76b055[_0x35e3be(0x1e5)](([,_0x591e2f])=>{const _0x18670b=_0x35e3be;try{const _0x518191=_0x591e2f===null||_0x591e2f===undefined?'':typeof _0x591e2f===_0x18670b(0x210)?JSON[_0x18670b(0x1ee)](_0x591e2f):String(_0x591e2f),_0x1c70eb=_0x518191[_0x18670b(0x1e0)]('\x0a');return Math[_0x18670b(0x1fe)](..._0x1c70eb[_0x18670b(0x1e5)](_0x45dc11=>_0x45dc11[_0x18670b(0x1e1)]),0x0);}catch{return 0x0;}}),0x14),_0x2b049b=[];_0x2b049b[_0x35e3be(0x1fd)](colorBorder('┌─'+'─'[_0x35e3be(0x1f6)](_0x133777)+_0x35e3be(0x1dd)+'─'['repeat'](_0x5c9978)+'─┐',_0xb197fd)),_0x76b055[_0x35e3be(0x212)](([_0x5541a1,_0x338b1a])=>{const _0x54843d=_0x35e3be;let _0x5c84fb;try{_0x5c84fb=_0x338b1a===null||_0x338b1a===undefined?'':typeof _0x338b1a===_0x54843d(0x210)?JSON[_0x54843d(0x1ee)](_0x338b1a):String(_0x338b1a);}catch{_0x5c84fb=_0x54843d(0x211);}const _0x3cb537=_0x5541a1[_0x54843d(0x1f7)](_0x133777),_0x4b2947=_0x5c84fb[_0x54843d(0x1e0)]('\x0a');_0x4b2947[_0x54843d(0x212)]((_0x1124d0,_0x4d3320)=>{const _0x10f060=_0x54843d,_0x535ec5=colorBorder('│',_0xb197fd);_0x4d3320===0x0?_0x2b049b[_0x10f060(0x1fd)](_0x535ec5+'\x20'+_0x3cb537+'\x20'+_0x535ec5+'\x20'+_0x1124d0[_0x10f060(0x1f7)](_0x5c9978)+'\x20'+_0x535ec5):_0x2b049b['push'](_0x535ec5+'\x20'+'\x20'[_0x10f060(0x1f6)](_0x133777)+'\x20'+_0x535ec5+'\x20'+_0x1124d0[_0x10f060(0x1f7)](_0x5c9978)+'\x20'+_0x535ec5);});}),_0x2b049b[_0x35e3be(0x1fd)](colorBorder('└─'+'─'[_0x35e3be(0x1f6)](_0x133777)+_0x35e3be(0x209)+'─'[_0x35e3be(0x1f6)](_0x5c9978)+'─┘',_0xb197fd));_0x5ed0f3&&(_0x2b049b['push'](''),_0x2b049b['push'](String(a43_0x50ce7d[_0x35e3be(0x208)][_0x35e3be(0x213)]('[query]'))),_0x2b049b['push'](_0x5ed0f3));_0x125170&&(_0x2b049b['push'](''),_0x2b049b['push'](String(a43_0x50ce7d['blue'][_0x35e3be(0x213)](_0x35e3be(0x1e4)))),_0x2b049b['push'](_0x125170));_0x5b883e&&(_0x2b049b['push'](''),_0x2b049b[_0x35e3be(0x1fd)](String(a43_0x50ce7d['magenta'][_0x35e3be(0x213)]('[rule]'))),_0x2b049b['push'](_0x5b883e));if(_0x559d5f){if(_0x559d5f[_0x35e3be(0x1d9)]){_0x2b049b[_0x35e3be(0x1fd)](''),_0x2b049b['push'](String(a43_0x50ce7d['red'][_0x35e3be(0x213)](_0x35e3be(0x20e))));const _0x3f13a2=_0x559d5f[_0x35e3be(0x1d9)][_0x35e3be(0x1e0)]('\x0a');_0x3f13a2['forEach'](_0x18d7b9=>{_0x18d7b9['trim']()&&_0x2b049b['push'](_0x18d7b9);});}if(_0x559d5f[_0x35e3be(0x20f)]){_0x2b049b[_0x35e3be(0x1fd)](''),_0x2b049b[_0x35e3be(0x1fd)](String(a43_0x50ce7d[_0x35e3be(0x1f4)][_0x35e3be(0x213)]('[logs]')));const _0x374b64=_0x559d5f[_0x35e3be(0x20f)][_0x35e3be(0x1e0)]('\x0a');_0x374b64[_0x35e3be(0x212)](_0x404af8=>{const _0x5b75ab=_0x35e3be;_0x404af8[_0x5b75ab(0x1de)]()&&_0x2b049b[_0x5b75ab(0x1fd)](_0x404af8);});}}return _0x2b049b[_0x35e3be(0x1da)]('\x0a');}}}}function a43_0x4e9a(){const _0x44d371=['inherit','varchar','error','json','push','max','tsv','output','limit','close','boolean','double','57891dkIXrV','1193044YjDgvL','resolve','yellow','─┴─','rule','end','stdin','11898eWhzJM','[error]','cmdout','object','[Object]','forEach','bold','568660OvNRpw','format','params','936213kGTVjs','keys','stderr','join','bigint','2ytRiPH','─┬─','trim','234040beyBTc','split','length','isTTY','list','[params]','map','color','jsonl','noColor','number','table','debug','FINISHED','query','stringify','Results\x20saved\x20to\x20','isInteger','sdk-result','2866311VdtjQT','1239ljTKOs','cyan','log','repeat','padEnd','entries'];a43_0x4e9a=function(){return _0x44d371;};return a43_0x4e9a();}export async function handleSingleObjectOutput(_0x1dd8ee,_0x461db6){const _0x844546=a43_0x5ec0;if(_0x461db6[_0x844546(0x215)]===_0x844546(0x1ea)){await handleSDKOutput([_0x1dd8ee],_0x461db6);return;}const _0x18d0d3=resolveOutputOptions(_0x461db6),_0x2d933e=await formatSingleObject(_0x1dd8ee,_0x18d0d3);await writeOutput(_0x2d933e,_0x18d0d3[_0x844546(0x200)]||undefined,_0x18d0d3[_0x844546(0x215)]);}
|
|
1
|
+
(function(_0x5bcb31,_0x202c51){const _0xffca70=a43_0x32a3,_0x2c9693=_0x5bcb31();while(!![]){try{const _0x4569b5=parseInt(_0xffca70(0xa0))/0x1+parseInt(_0xffca70(0x8e))/0x2+-parseInt(_0xffca70(0xad))/0x3*(parseInt(_0xffca70(0x92))/0x4)+-parseInt(_0xffca70(0x94))/0x5+parseInt(_0xffca70(0xb3))/0x6+parseInt(_0xffca70(0xa3))/0x7+parseInt(_0xffca70(0x85))/0x8*(-parseInt(_0xffca70(0x90))/0x9);if(_0x4569b5===_0x202c51)break;else _0x2c9693['push'](_0x2c9693['shift']());}catch(_0x547a2d){_0x2c9693['push'](_0x2c9693['shift']());}}}(a43_0x398e,0x878c3));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 a43_0x2e6788 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x3cedb5){const _0x2e727d=a43_0x32a3;return _0x3cedb5[_0x2e727d(0xb8)]===_0x2e727d(0xa5)||_0x3cedb5[_0x2e727d(0xb8)]==='jsonl'||_0x3cedb5['format']===_0x2e727d(0x78)||_0x3cedb5[_0x2e727d(0xb8)]===_0x2e727d(0x9d)||_0x3cedb5['json']===!![]||_0x3cedb5['jsonl']===!![]||_0x3cedb5[_0x2e727d(0x78)]===!![]||_0x3cedb5[_0x2e727d(0x9d)]===!![];}export function parseOutputOptions(_0x479080){const _0x33ec64=a43_0x32a3;return{'format':_0x479080['format']||'table','output':_0x479080[_0x33ec64(0xa4)]||'','limit':_0x479080[_0x33ec64(0x86)],'color':_0x479080['color'],'noColor':_0x479080[_0x33ec64(0x7a)]};}function convertSDKResultToQueryResult(_0x13b674){const _0x1047a9=a43_0x32a3,_0x407036=[];if(_0x13b674['length']>0x0){const _0x43e6af=_0x13b674[0x0];for(const [_0x44ec00,_0xeb3a05]of Object[_0x1047a9(0x7d)](_0x43e6af)){let _0x37f5f4='varchar';if(typeof _0xeb3a05===_0x1047a9(0xb6))_0x37f5f4=Number[_0x1047a9(0xaf)](_0xeb3a05)?_0x1047a9(0x79):_0x1047a9(0x89);else{if(typeof _0xeb3a05===_0x1047a9(0x9c))_0x37f5f4='boolean';else _0xeb3a05===null&&(_0x37f5f4=_0x1047a9(0xae));}_0x407036['push']({'name':_0x44ec00,'type':_0x37f5f4});}}return{'queryId':_0x1047a9(0x87),'columns':_0x407036,'data':_0x13b674,'stats':{'state':_0x1047a9(0xa8),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x13b674[_0x1047a9(0xaa)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x50b668,_0x17d915){const _0x3c5247=convertSDKResultToQueryResult(_0x50b668);return formatQueryOutput(_0x3c5247,_0x17d915);}export async function formatQueryOutput(_0x5804f4,_0x44eed0){const _0x473ad2=a43_0x32a3,{format:_0x1393e4,limit:_0x50cf31,output:_0x182a0c,color:_0x2f7369,noColor:_0x41f3ae}=_0x44eed0,_0x26f11b=Boolean(_0x182a0c)&&!_0x2f7369,_0x54e4f3={'color':_0x2f7369,'noColor':_0x41f3ae||_0x26f11b};if(_0x1393e4===_0x473ad2(0x9d)){const _0x320108=shouldUseLess(_0x1393e4,_0x182a0c);return formatAsTable(_0x5804f4,_0x50cf31,_0x320108,_0x54e4f3);}else{if(_0x1393e4==='json')return formatAsJSON(_0x5804f4,_0x54e4f3);else return _0x1393e4===_0x473ad2(0xb9)?formatAsJSONL(_0x5804f4,_0x54e4f3):formatQueryResult(_0x5804f4,_0x1393e4);}}function shouldUseLess(_0x1c98d5,_0x4e86c6){const _0x16b926=a43_0x32a3;return(_0x1c98d5===_0x16b926(0x9d)||_0x1c98d5==='list')&&process['stdout'][_0x16b926(0x8f)]&&!_0x4e86c6;}export function resolveOutputOptions(_0x7e99f9){const _0x1d54ef=a43_0x32a3,_0x34273a=resolveOutputFormat(_0x7e99f9[_0x1d54ef(0xb8)],_0x7e99f9[_0x1d54ef(0xa4)],_0x1d54ef(0x9d));let _0x345391=typeof _0x7e99f9[_0x1d54ef(0x86)]==='number'?_0x7e99f9[_0x1d54ef(0x86)]:parseInt(_0x7e99f9[_0x1d54ef(0x86)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0xfbaaa6=_0x7e99f9[_0x1d54ef(0xa4)]||'';return shouldUseLess(_0x34273a,_0xfbaaa6)&&(_0x345391=Infinity),{'format':_0x34273a,'output':_0xfbaaa6,'limit':_0x345391,'color':_0x7e99f9['color'],'noColor':_0x7e99f9[_0x1d54ef(0x7a)]};}export function writeOutput(_0x4a06d6,_0x22917a,_0x3a855c){const _0x20f106=a43_0x32a3;return _0x22917a?(writeFileSync(_0x22917a,_0x4a06d6),console[_0x20f106(0xb7)]('Results\x20saved\x20to\x20'+_0x22917a),Promise[_0x20f106(0x98)]()):shouldUseLess(_0x3a855c||'','')?new Promise(_0x1020d0=>{const _0x27a093=_0x20f106,_0x502751=spawn('less',[_0x27a093(0xb2)],{'stdio':[_0x27a093(0x8b),'inherit','inherit']});let _0x3d4d27=![];_0x502751['on'](_0x27a093(0xb7),()=>{const _0x56eb58=_0x27a093;!_0x3d4d27&&(_0x3d4d27=!![],console[_0x56eb58(0xb5)](_0x4a06d6),_0x1020d0());}),_0x502751['on']('close',()=>{!_0x3d4d27&&(_0x3d4d27=!![],_0x1020d0());}),_0x502751['on'](_0x27a093(0xa2),()=>{const _0x16e90f=_0x27a093;!_0x3d4d27&&_0x502751[_0x16e90f(0x97)]&&(_0x502751[_0x16e90f(0x97)]['on']('error',()=>{}),_0x502751[_0x16e90f(0x97)]['write'](_0x4a06d6),_0x502751[_0x16e90f(0x97)][_0x16e90f(0x91)]());}),!_0x502751[_0x27a093(0x97)]&&(!_0x3d4d27&&(_0x3d4d27=!![],console[_0x27a093(0xb5)](_0x4a06d6),_0x1020d0()));}):(console['log'](_0x4a06d6),Promise[_0x20f106(0x98)]());}export async function handleSDKOutput(_0x9f3596,_0xa70c1e){const _0x3fffda=a43_0x32a3,_0x409afe=resolveOutputOptions(_0xa70c1e),_0x1343e8=await formatSDKOutput(_0x9f3596,_0x409afe);await writeOutput(_0x1343e8,_0x409afe[_0x3fffda(0xa4)]||undefined,_0x409afe[_0x3fffda(0xb8)]);}function a43_0x32a3(_0x58a222,_0x3f73af){_0x58a222=_0x58a222-0x77;const _0x398eb8=a43_0x398e();let _0x32a395=_0x398eb8[_0x58a222];return _0x32a395;}export async function handleQueryOutput(_0x3d2f7e,_0x3c0de2){const _0x10f7cc=a43_0x32a3,_0x13ae4a=resolveOutputOptions(_0x3c0de2),_0x3d396b=await formatQueryOutput(_0x3d2f7e,_0x13ae4a);await writeOutput(_0x3d396b,_0x13ae4a['output']||undefined,_0x13ae4a[_0x10f7cc(0xb8)]);}async function formatSingleObject(_0x2956bc,_0x330e9d){const _0x42cb7b=a43_0x32a3,{format:_0x52ad3e,color:_0x1a9eed,noColor:_0x196da8}=_0x330e9d,_0x5bda4e={'color':_0x1a9eed,'noColor':_0x196da8};if(_0x52ad3e===_0x42cb7b(0xa5)){if(shouldUseColor(_0x5bda4e))return colorizeJSON(_0x2956bc,_0x5bda4e);return JSON[_0x42cb7b(0x9b)](_0x2956bc,null,0x2);}else{if(_0x52ad3e===_0x42cb7b(0xb9)){if(shouldUseColor(_0x5bda4e))return colorizeJSONCompact(_0x2956bc,_0x5bda4e);return JSON[_0x42cb7b(0x9b)](_0x2956bc);}else{if(_0x52ad3e===_0x42cb7b(0x78))return Object[_0x42cb7b(0x7d)](_0x2956bc)[_0x42cb7b(0x9a)](([_0x47ae61,_0x20d5d8])=>_0x47ae61+'\x09'+_0x20d5d8)[_0x42cb7b(0x8a)]('\x0a');else{const _0x4c3e33=Object[_0x42cb7b(0x7d)](_0x2956bc);if(_0x4c3e33[_0x42cb7b(0xaa)]===0x0)return _0x42cb7b(0xa6);const _0xbc6eef=_0x2956bc[_0x42cb7b(0x7f)],_0x587671=_0x2956bc[_0x42cb7b(0x7b)],_0x26ce00=_0x2956bc[_0x42cb7b(0xa7)],_0x144bdc=_0x2956bc['rule'],_0x1448d8=_0x587671?typeof _0x587671===_0x42cb7b(0xa9)?_0x587671:JSON[_0x42cb7b(0x9b)](_0x587671,null,0x2):undefined,_0x56a3b1=_0x26ce00&&Object[_0x42cb7b(0x8c)](_0x26ce00)['length']>0x0?JSON['stringify'](_0x26ce00,null,0x2):undefined,_0x4d23eb=_0x144bdc&&Object['keys'](_0x144bdc)[_0x42cb7b(0xaa)]>0x0?JSON[_0x42cb7b(0x9b)](_0x144bdc,null,0x2):undefined,_0x4c35d8=_0x4c3e33[_0x42cb7b(0x84)](([_0x75ad80])=>_0x75ad80!=='debug'&&_0x75ad80!==_0x42cb7b(0x7b)&&_0x75ad80!==_0x42cb7b(0xa7)&&_0x75ad80!==_0x42cb7b(0x7e)),_0x373efa=Math[_0x42cb7b(0x77)](..._0x4c35d8['map'](([_0x1ad2a5])=>_0x1ad2a5[_0x42cb7b(0xaa)])),_0x36c940=Math[_0x42cb7b(0x77)](..._0x4c35d8[_0x42cb7b(0x9a)](([,_0x1d3292])=>{const _0x34a695=_0x42cb7b;try{const _0x311a34=_0x1d3292===null||_0x1d3292===undefined?'':typeof _0x1d3292===_0x34a695(0x7c)?JSON['stringify'](_0x1d3292):String(_0x1d3292),_0x393489=_0x311a34[_0x34a695(0x82)]('\x0a');return Math['max'](..._0x393489[_0x34a695(0x9a)](_0x5e4fb6=>_0x5e4fb6[_0x34a695(0xaa)]),0x0);}catch{return 0x0;}}),0x14),_0x5b6993=[];_0x5b6993[_0x42cb7b(0xb1)](colorBorder('┌─'+'─'[_0x42cb7b(0xac)](_0x373efa)+_0x42cb7b(0x96)+'─'['repeat'](_0x36c940)+'─┐',_0x5bda4e)),_0x4c35d8['forEach'](([_0x2a8a01,_0x51f2c9])=>{const _0x36d12a=_0x42cb7b;let _0x6372c5;try{_0x6372c5=_0x51f2c9===null||_0x51f2c9===undefined?'':typeof _0x51f2c9==='object'?JSON[_0x36d12a(0x9b)](_0x51f2c9):String(_0x51f2c9);}catch{_0x6372c5=_0x36d12a(0x9e);}const _0x58010b=_0x2a8a01[_0x36d12a(0x80)](_0x373efa),_0x110e32=_0x6372c5[_0x36d12a(0x82)]('\x0a');_0x110e32['forEach']((_0x158285,_0x3356d4)=>{const _0x519fe4=_0x36d12a,_0x44533d=colorBorder('│',_0x5bda4e);_0x3356d4===0x0?_0x5b6993[_0x519fe4(0xb1)](_0x44533d+'\x20'+_0x58010b+'\x20'+_0x44533d+'\x20'+_0x158285['padEnd'](_0x36c940)+'\x20'+_0x44533d):_0x5b6993[_0x519fe4(0xb1)](_0x44533d+'\x20'+'\x20'[_0x519fe4(0xac)](_0x373efa)+'\x20'+_0x44533d+'\x20'+_0x158285[_0x519fe4(0x80)](_0x36c940)+'\x20'+_0x44533d);});}),_0x5b6993[_0x42cb7b(0xb1)](colorBorder('└─'+'─'['repeat'](_0x373efa)+'─┴─'+'─'['repeat'](_0x36c940)+'─┘',_0x5bda4e));_0x1448d8&&(_0x5b6993['push'](''),_0x5b6993[_0x42cb7b(0xb1)](String(a43_0x2e6788[_0x42cb7b(0x99)][_0x42cb7b(0x9f)](_0x42cb7b(0x95)))),_0x5b6993[_0x42cb7b(0xb1)](_0x1448d8));_0x56a3b1&&(_0x5b6993[_0x42cb7b(0xb1)](''),_0x5b6993['push'](String(a43_0x2e6788[_0x42cb7b(0xa1)][_0x42cb7b(0x9f)](_0x42cb7b(0xab)))),_0x5b6993[_0x42cb7b(0xb1)](_0x56a3b1));_0x4d23eb&&(_0x5b6993[_0x42cb7b(0xb1)](''),_0x5b6993[_0x42cb7b(0xb1)](String(a43_0x2e6788[_0x42cb7b(0x93)]['bold'](_0x42cb7b(0xb0)))),_0x5b6993[_0x42cb7b(0xb1)](_0x4d23eb));if(_0xbc6eef){if(_0xbc6eef[_0x42cb7b(0x88)]){_0x5b6993[_0x42cb7b(0xb1)](''),_0x5b6993[_0x42cb7b(0xb1)](String(a43_0x2e6788[_0x42cb7b(0x8d)][_0x42cb7b(0x9f)]('[error]')));const _0x409f97=_0xbc6eef[_0x42cb7b(0x88)]['split']('\x0a');_0x409f97[_0x42cb7b(0xb4)](_0x4b4ccc=>{const _0x503a36=_0x42cb7b;_0x4b4ccc[_0x503a36(0x83)]()&&_0x5b6993[_0x503a36(0xb1)](_0x4b4ccc);});}if(_0xbc6eef['cmdout']){_0x5b6993[_0x42cb7b(0xb1)](''),_0x5b6993[_0x42cb7b(0xb1)](String(a43_0x2e6788['cyan'][_0x42cb7b(0x9f)](_0x42cb7b(0x81))));const _0x4677da=_0xbc6eef['cmdout'][_0x42cb7b(0x82)]('\x0a');_0x4677da['forEach'](_0x520607=>{const _0x497342=_0x42cb7b;_0x520607[_0x497342(0x83)]()&&_0x5b6993['push'](_0x520607);});}}return _0x5b6993['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0xc9e4cf,_0x2c9cf4){const _0x2eb6b5=a43_0x32a3;if(_0x2c9cf4[_0x2eb6b5(0xb8)]===_0x2eb6b5(0x9d)){await handleSDKOutput([_0xc9e4cf],_0x2c9cf4);return;}const _0x1cb434=resolveOutputOptions(_0x2c9cf4),_0x23540b=await formatSingleObject(_0xc9e4cf,_0x1cb434);await writeOutput(_0x23540b,_0x1cb434[_0x2eb6b5(0xa4)]||undefined,_0x1cb434[_0x2eb6b5(0xb8)]);}function a43_0x398e(){const _0x2c4f09=['bigint','noColor','query','object','entries','rule','debug','padEnd','[logs]','split','trim','filter','12911504PCqfNu','limit','sdk-result','stderr','double','join','pipe','keys','red','1865868XkCvpw','isTTY','9lDZird','end','941444CgectM','magenta','3371685fRvuem','[query]','─┬─','stdin','resolve','yellow','map','stringify','boolean','table','[Object]','bold','1037772evypGH','blue','spawn','3356521bcluLn','output','json','No\x20data','params','FINISHED','string','length','[params]','repeat','3XHSGrc','varchar','isInteger','[rule]','push','-FXRSn','3771780FKOfUe','forEach','log','number','error','format','jsonl','max','tsv'];a43_0x398e=function(){return _0x2c4f09;};return a43_0x398e();}
|