@treasuredata/tdx 0.14.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/api-command.js.map +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts +1 -0
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/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/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.d.ts +3 -4
- package/dist/commands/profile-command.d.ts.map +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profile-command.js.map +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/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/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.d.ts +2 -0
- package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.d.ts +86 -0
- package/dist/proxy/passthrough-server.d.ts.map +1 -0
- package/dist/proxy/passthrough-server.js +1 -0
- package/dist/proxy/passthrough-server.js.map +1 -0
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.d.ts +99 -0
- package/dist/proxy/sse-usage-parser.d.ts.map +1 -0
- package/dist/proxy/sse-usage-parser.js +1 -0
- package/dist/proxy/sse-usage-parser.js.map +1 -0
- 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/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.d.ts +5 -0
- package/dist/sdk/client/endpoints.d.ts.map +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/endpoints.js.map +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.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.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/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 a38_0x3dc27b=a38_0xa343;(function(_0x46d9ab,_0x5efa91){const _0x590d99=a38_0xa343,_0x38b4c6=_0x46d9ab();while(!![]){try{const _0x284399=-parseInt(_0x590d99(0x143))/0x1*(parseInt(_0x590d99(0x198))/0x2)+-parseInt(_0x590d99(0x9e))/0x3*(-parseInt(_0x590d99(0x23f))/0x4)+-parseInt(_0x590d99(0x1df))/0x5*(-parseInt(_0x590d99(0x118))/0x6)+-parseInt(_0x590d99(0x1a2))/0x7+parseInt(_0x590d99(0x1ca))/0x8+parseInt(_0x590d99(0xb9))/0x9*(parseInt(_0x590d99(0x1a5))/0xa)+parseInt(_0x590d99(0xa3))/0xb*(-parseInt(_0x590d99(0x193))/0xc);if(_0x284399===_0x5efa91)break;else _0x38b4c6['push'](_0x38b4c6['shift']());}catch(_0x4e7ee9){_0x38b4c6['push'](_0x38b4c6['shift']());}}}(a38_0x3456,0xe0510));import a38_0x4e5599 from'chalk';import{existsSync}from'fs';function a38_0xa343(_0x9def2d,_0x3dc05a){_0x9def2d=_0x9def2d-0x9e;const _0x3456ab=a38_0x3456();let _0xa343e4=_0x3456ab[_0x9def2d];return _0xa343e4;}import a38_0x514e72 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 a38_0x1916d9 from'prompts';function getAttemptStatusDisplay(_0x55a65e){const _0x20fccb=a38_0xa343;if(!_0x55a65e)return{'icon':'⏳','text':''};const {done:_0x1e1f6b,success:_0x1f3895,cancelRequested:_0x426e50}=_0x55a65e;if(!_0x1e1f6b)return _0x426e50?{'icon':'🛑','text':a38_0x4e5599[_0x20fccb(0x1d6)](_0x20fccb(0x186))}:{'icon':'🔄','text':a38_0x4e5599[_0x20fccb(0xc7)](_0x20fccb(0xbf))};if(_0x1f3895)return{'icon':'✅','text':a38_0x4e5599['green'](_0x20fccb(0xd6))};return{'icon':'❌','text':a38_0x4e5599[_0x20fccb(0x1a1)](_0x20fccb(0xfa))};}export class WorkflowBaseCommand extends BaseCommand{[a38_0x3dc27b(0x1fa)](_0x28877b,_0x4f7155,_0x33cf87=0x0){return _0x28877b[_0x33cf87]||_0x4f7155['workflowProject'];}['requireProject'](_0x344f1c,_0x277d5c,_0x3aae39=0x0){const _0x417682=a38_0x3dc27b,_0x45babb=this['resolveProject'](_0x344f1c,_0x277d5c,_0x3aae39);if(!_0x45babb)return console[_0x417682(0xfa)](a38_0x4e5599[_0x417682(0x1a1)]('Error:'),_0x417682(0xdf)),console[_0x417682(0xfa)](a38_0x4e5599[_0x417682(0x18c)](_0x417682(0x18d))),null;return _0x45babb;}[a38_0x3dc27b(0x1be)](_0x10ad99,_0x5d0579){const _0x3f88f0=a38_0x3dc27b;if(_0x10ad99[0x0]){const _0x33f81c=_0x10ad99[0x0][_0x3f88f0(0x1cf)]('.');if(_0x33f81c[_0x3f88f0(0x1f2)]===0x1)return{'projectName':_0x33f81c[0x0],'workflowName':undefined};else return _0x33f81c[_0x3f88f0(0x1f2)]===0x2?{'projectName':_0x33f81c[0x0],'workflowName':_0x33f81c[0x1]}:(console[_0x3f88f0(0xfa)](a38_0x4e5599[_0x3f88f0(0x1a1)](_0x3f88f0(0xbe)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x5d0579[_0x3f88f0(0x22b)],'workflowName':undefined};}[a38_0x3dc27b(0x202)](_0x2ea5e4,_0x141590,_0x3a5c28=0x0){const _0x29765c=a38_0x3dc27b;if(_0x2ea5e4[_0x3a5c28])return _0x2ea5e4[_0x3a5c28];if(_0x141590[_0x29765c(0x22b)]){const _0x76ed96=a38_0x514e72[_0x29765c(0x1d4)](process['cwd'](),'workflows',_0x141590[_0x29765c(0x22b)]);if(existsSync(a38_0x514e72['join'](_0x76ed96,'tdx.json')))return _0x76ed96;}return undefined;}async[a38_0x3dc27b(0x107)](_0x25e856,_0xa4363f,_0xe322b5){const _0x581fad=a38_0x3dc27b;try{const _0x31b163=await _0x25e856[_0x581fad(0xa1)][_0x581fad(0x21c)](_0xa4363f,{'limit':0x1});if(_0x31b163['length']>0x0){const _0x55ec8e=_0x31b163[0x0]['id'],_0x343c2d=getWorkflowUrl(_0xe322b5,_0x55ec8e);console[_0x581fad(0xfa)](_0x581fad(0x1f0)+a38_0x4e5599[_0x581fad(0x12d)](_0x343c2d));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']='workflow:use';[a38_0x3dc27b(0x144)]=a38_0x3dc27b(0x21a);async['execute'](_0x2d0c4d){const _0x23da29=a38_0x3dc27b,{options:_0x1dd032,args:_0x5bfd04,tdx:_0xe1b646}=_0x2d0c4d,_0x2820c9=_0x5bfd04[0x0],_0x306ef7=_0x1dd032['clear'];if(_0x306ef7)return saveSessionContext({'workflow_project':undefined},_0x1dd032['session']),console[_0x23da29(0x184)](a38_0x4e5599[_0x23da29(0x11a)](_0x23da29(0xef))),0x0;if(!_0x2820c9)return console[_0x23da29(0xfa)](a38_0x4e5599['red'](_0x23da29(0xbe)),_0x23da29(0xdf)),console[_0x23da29(0xfa)](a38_0x4e5599[_0x23da29(0x18c)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console['error'](a38_0x4e5599[_0x23da29(0x18c)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x58a97e=await withSpinner(_0x23da29(0x158)+_0x2820c9+_0x23da29(0xf6),()=>_0xe1b646[_0x23da29(0xa1)][_0x23da29(0x20e)](_0x2820c9),{'verbose':_0x1dd032[_0x23da29(0x12f)]}),{name:_0x377fe}=_0x58a97e[_0x23da29(0x15a)];return saveSessionContext({'workflow_project':_0x377fe},_0x1dd032[_0x23da29(0xf4)]),console['log'](a38_0x4e5599['green'](_0x23da29(0xea)+a38_0x4e5599[_0x23da29(0x12d)](_0x377fe))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a38_0x3dc27b(0x159)]=a38_0x3dc27b(0x236);[a38_0x3dc27b(0x144)]=a38_0x3dc27b(0x113);async['execute'](_0x3ece0b){const _0x2fddf4=a38_0x3dc27b,{options:_0x1f2ddd,args:_0x27aba2,tdx:_0x413f7e}=_0x3ece0b,_0x465eea=_0x27aba2[0x0];_0x1f2ddd['verbose']&&_0x465eea&&console[_0x2fddf4(0xfa)](_0x2fddf4(0x1d2)+_0x465eea);const _0x2aefaf=await withSpinner(_0x2fddf4(0xb3),()=>_0x413f7e[_0x2fddf4(0xa1)]['projects'](_0x465eea,{'limit':_0x1f2ddd[_0x2fddf4(0x121)]}),{'verbose':_0x1f2ddd['verbose']});let _0x11aaa4=_0x2aefaf[_0x2fddf4(0x15a)];_0x11aaa4[_0x2fddf4(0x223)]((_0x21f5f3,_0x327ea8)=>_0x21f5f3[_0x2fddf4(0x159)]['localeCompare'](_0x327ea8['name']));const _0x1e03aa=_0x1f2ddd[_0x2fddf4(0x121)]||0x64,_0x367e87=_0x11aaa4[_0x2fddf4(0x1f2)]>=_0x1e03aa?a38_0x4e5599['dim']('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x2fddf4(0xfa)](_0x2fddf4(0xd5)+_0x11aaa4[_0x2fddf4(0x1f2)]+_0x2fddf4(0xd3)+(_0x11aaa4[_0x2fddf4(0x1f2)]!==0x1?'s':'')+_0x367e87);if(_0x1f2ddd['format']===_0x2fddf4(0x130)||_0x1f2ddd[_0x2fddf4(0x1b0)]===_0x2fddf4(0x241)||_0x1f2ddd[_0x2fddf4(0x1b0)]===_0x2fddf4(0xfe))await handleSDKOutput(_0x11aaa4,_0x1f2ddd);else{if(_0x11aaa4[_0x2fddf4(0x1f2)]===0x0)_0x465eea?console[_0x2fddf4(0x184)](_0x2fddf4(0x15d)+_0x465eea):console[_0x2fddf4(0x184)]('No\x20workflow\x20projects\x20found');else{const _0x5bd7e2=_0x11aaa4[_0x2fddf4(0x142)](_0x4e3d73=>{const _0xfe2ec1=_0x2fddf4,_0x29c142=_0x4e3d73['metadata']?.[_0xfe2ec1(0x103)](_0x7e2d5=>_0x7e2d5[_0xfe2ec1(0x21f)]===_0xfe2ec1(0x106)),_0x188b07=_0x29c142?a38_0x4e5599[_0xfe2ec1(0x18c)]('\x20(system)'):'';return'📁\x20'+_0x4e3d73[_0xfe2ec1(0x159)]+_0x188b07;});await writeOutput(_0x5bd7e2[_0x2fddf4(0x1d4)]('\x0a'),_0x1f2ddd[_0x2fddf4(0x1f6)],_0x2fddf4(0xe2));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a38_0x3dc27b(0x159)]=a38_0x3dc27b(0x19a);[a38_0x3dc27b(0x144)]=a38_0x3dc27b(0x243);async[a38_0x3dc27b(0x10e)](_0x1b6482){const _0x21cdb5=a38_0x3dc27b,{options:_0x2e79cf,args:_0x2003f5,tdx:_0x20403f}=_0x1b6482,_0x13e907=this[_0x21cdb5(0x1fa)](_0x2003f5,_0x2e79cf);_0x2e79cf[_0x21cdb5(0x12f)]&&_0x13e907&&console[_0x21cdb5(0xfa)](_0x21cdb5(0x217)+_0x13e907);const _0x2b0881=await withSpinner(_0x21cdb5(0x1ad),()=>_0x20403f[_0x21cdb5(0xa1)][_0x21cdb5(0x21c)](_0x13e907,{'limit':_0x2e79cf['limit']}),{'verbose':_0x2e79cf[_0x21cdb5(0x12f)]});let _0x10b869=_0x2b0881['data'];_0x10b869[_0x21cdb5(0x223)]((_0x37acbf,_0x32bf77)=>{const _0xff87c7=_0x21cdb5,_0x14568f=_0x37acbf[_0xff87c7(0x159)][_0xff87c7(0x173)](_0x32bf77['name']);if(_0x14568f!==0x0)return _0x14568f;return(_0x37acbf[_0xff87c7(0x218)]?.['name']||'')[_0xff87c7(0x173)](_0x32bf77[_0xff87c7(0x218)]?.[_0xff87c7(0x159)]||'');});const _0x505741=_0x2e79cf[_0x21cdb5(0x121)]||0x64,_0xec85a8=_0x10b869['length']>=_0x505741?a38_0x4e5599[_0x21cdb5(0x18c)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console['error'](_0x21cdb5(0xd5)+_0x10b869['length']+'\x20workflow'+(_0x10b869[_0x21cdb5(0x1f2)]!==0x1?'s':'')+_0xec85a8);if(_0x2e79cf[_0x21cdb5(0x1b0)]===_0x21cdb5(0x130)||_0x2e79cf[_0x21cdb5(0x1b0)]===_0x21cdb5(0x241)||_0x2e79cf[_0x21cdb5(0x1b0)]===_0x21cdb5(0xfe))await handleSDKOutput(_0x10b869,_0x2e79cf);else{if(_0x10b869[_0x21cdb5(0x1f2)]===0x0)_0x13e907?console[_0x21cdb5(0x184)](_0x21cdb5(0x138)+_0x13e907):console[_0x21cdb5(0x184)](_0x21cdb5(0x12c));else{const _0xd32f23=_0x2e79cf[_0x21cdb5(0x1fe)],_0x357967=_0x10b869[_0x21cdb5(0x142)](_0x59c2ed=>{const _0x458da3=_0x21cdb5,_0x3e2a5a=a38_0x4e5599[_0x458da3(0x18c)]('#'+_0x59c2ed['id']),_0x46ff68=hyperlink(_0x3e2a5a,getWorkflowUrl(_0xd32f23,_0x59c2ed['id'])),_0x4570bf=_0x59c2ed['project']?.[_0x458da3(0x159)]?a38_0x4e5599[_0x458da3(0x18c)]('\x20('+_0x59c2ed['project'][_0x458da3(0x159)]+')'):'';return _0x458da3(0x156)+_0x46ff68+'\x20'+_0x59c2ed['name']+_0x4570bf;});await writeOutput(_0x357967[_0x21cdb5(0x1d4)]('\x0a'),_0x2e79cf[_0x21cdb5(0x1f6)],_0x21cdb5(0xe2));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a38_0x3dc27b(0x159)]='workflow:sessions';[a38_0x3dc27b(0x144)]='List\x20workflow\x20execution\x20sessions';async[a38_0x3dc27b(0x10e)](_0x28b65a){const _0x1cd8be=a38_0x3dc27b,{options:_0x39d66c,args:_0x1f043d,tdx:_0x35c35c}=_0x28b65a,_0x222b0b=this[_0x1cd8be(0x1be)](_0x1f043d,_0x39d66c);if(!_0x222b0b)return 0x1;const {projectName:_0x5e6213,workflowName:_0x3b6938}=_0x222b0b;if(_0x39d66c[_0x1cd8be(0x12f)]){if(_0x5e6213&&_0x3b6938)console[_0x1cd8be(0xfa)](_0x1cd8be(0x17d)+_0x5e6213+'.'+_0x3b6938);else _0x5e6213&&console[_0x1cd8be(0xfa)](_0x1cd8be(0x220)+_0x5e6213);const _0x4b445f=_0x39d66c['status'];_0x4b445f&&console['error']('Status:\x20'+_0x4b445f);}let _0x18ab69=0x28;if(process[_0x1cd8be(0x115)]['isTTY']&&!_0x39d66c['output']&&!_0x39d66c[_0x1cd8be(0x1b0)]){const _0x2dff1=process['stdout'][_0x1cd8be(0x23a)]||0x28;_0x18ab69=Math[_0x1cd8be(0x1d7)](0x14,Math[_0x1cd8be(0x1c1)](_0x2dff1*0x2/0x3));}const _0x59a1f2=_0x39d66c['limit']||_0x18ab69,_0x562b0e=await withSpinner(_0x1cd8be(0xc6),()=>_0x35c35c[_0x1cd8be(0xa1)][_0x1cd8be(0x23b)]({'projectName':_0x5e6213,'workflowName':_0x3b6938,'status':_0x39d66c[_0x1cd8be(0x167)],'fromTime':_0x39d66c[_0x1cd8be(0x211)],'toTime':_0x39d66c['to'],'limit':_0x59a1f2}),{'verbose':_0x39d66c['verbose']}),_0x1828af=_0x562b0e[_0x1cd8be(0x15a)];_0x1828af['sort']((_0x2d7b37,_0x2c4f20)=>{const _0x2795b6=_0x1cd8be,_0x3fdd13=_0x2d7b37[_0x2795b6(0x1e4)]||'',_0x121cfc=_0x2c4f20[_0x2795b6(0x1e4)]||'';return _0x121cfc['localeCompare'](_0x3fdd13);});_0x1828af[_0x1cd8be(0x1f2)]>=_0x59a1f2?console[_0x1cd8be(0xfa)](_0x1cd8be(0x145)+_0x1828af[_0x1cd8be(0x1f2)]+_0x1cd8be(0xfb)+a38_0x4e5599[_0x1cd8be(0x18c)]('(use\x20--limit\x20to\x20see\x20more)')):console[_0x1cd8be(0xfa)]('✔\x20Found\x20'+_0x1828af['length']+_0x1cd8be(0xb4)+(_0x1828af[_0x1cd8be(0x1f2)]!==0x1?'s':''));if(_0x39d66c[_0x1cd8be(0x1b0)]===_0x1cd8be(0x130)||_0x39d66c[_0x1cd8be(0x1b0)]===_0x1cd8be(0x241)||_0x39d66c[_0x1cd8be(0x1b0)]===_0x1cd8be(0xfe))await handleSDKOutput(_0x1828af,_0x39d66c);else{if(!process['stdout'][_0x1cd8be(0x18b)]||_0x39d66c[_0x1cd8be(0x1f6)]){if(_0x1828af[_0x1cd8be(0x1f2)]===0x0){if(_0x5e6213&&_0x3b6938)console[_0x1cd8be(0x184)](_0x1cd8be(0x129)+_0x5e6213+'.'+_0x3b6938);else _0x5e6213?console[_0x1cd8be(0x184)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x5e6213):console[_0x1cd8be(0x184)](_0x1cd8be(0x13b));}else{const _0x2d0cc8=_0x39d66c[_0x1cd8be(0x1fe)],_0x37e784=this[_0x1cd8be(0x1d9)](_0x1828af,_0x2d0cc8);_0x39d66c[_0x1cd8be(0x1f6)]?await writeOutput(_0x37e784,_0x39d66c[_0x1cd8be(0x1f6)],_0x1cd8be(0xe2)):console[_0x1cd8be(0x184)](_0x37e784);}!_0x5e6213&&(console[_0x1cd8be(0xfa)](''),console[_0x1cd8be(0xfa)](a38_0x4e5599[_0x1cd8be(0x18c)](_0x1cd8be(0x19c))),console[_0x1cd8be(0xfa)](a38_0x4e5599[_0x1cd8be(0x18c)](_0x1cd8be(0x1de))+'or'+a38_0x4e5599['dim']('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x1828af[_0x1cd8be(0x1f2)]===0x0){if(_0x5e6213&&_0x3b6938)console['log'](_0x1cd8be(0x129)+_0x5e6213+'.'+_0x3b6938);else _0x5e6213?console[_0x1cd8be(0x184)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x5e6213):console[_0x1cd8be(0x184)]('No\x20sessions\x20found');}else await this[_0x1cd8be(0x1ba)](_0x1828af,_0x28b65a,_0x5e6213);}}return 0x0;}[a38_0x3dc27b(0x1d9)](_0x25b53c,_0x10fc46){const _0x30036b=a38_0x3dc27b,_0x327f38=[],_0x4940dd=new Map();let _0x2ae125=Infinity,_0x2304ab=-Infinity;for(const _0x913173 of _0x25b53c){if(_0x913173[_0x30036b(0x189)]?.[_0x30036b(0x1ee)]){const _0x24a47d=new Date(_0x913173[_0x30036b(0x189)][_0x30036b(0x1ee)])[_0x30036b(0x1eb)](),_0x398918=_0x913173[_0x30036b(0x189)][_0x30036b(0x242)]?new Date(_0x913173[_0x30036b(0x189)][_0x30036b(0x242)])[_0x30036b(0x1eb)]():Date[_0x30036b(0x1e5)](),_0x53a77a=_0x913173[_0x30036b(0x218)]?.['name']||_0x30036b(0x19f);!_0x4940dd[_0x30036b(0x139)](_0x53a77a)&&_0x4940dd[_0x30036b(0xfd)](_0x53a77a,[]),_0x4940dd[_0x30036b(0x195)](_0x53a77a)['push']({'session':_0x913173,'startTime':_0x24a47d,'endTime':_0x398918,'duration':_0x398918-_0x24a47d}),_0x2ae125=Math['min'](_0x2ae125,_0x24a47d),_0x2304ab=Math['max'](_0x2304ab,_0x398918);}}if(_0x4940dd[_0x30036b(0x215)]===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x970b7d=process['stdout'][_0x30036b(0x150)]||0x78,_0x3e12e1=0x1e,_0x359a46=0x32,_0x29b633=0x4,_0x363dfc=Math['min'](_0x359a46,Math[_0x30036b(0x1d7)](_0x3e12e1,Math[_0x30036b(0x1c1)](_0x970b7d*0.3))),_0x16a822=_0x970b7d-_0x363dfc-TIMELINE_CONFIG[_0x30036b(0x213)]-0x3-_0x29b633,_0x15c71c=_0x2304ab-_0x2ae125,_0x1bae80=_0x15c71c/_0x363dfc,_0x5266ce=renderTimeAxis({'startTime':_0x2ae125,'endTime':_0x2304ab,'durationMs':_0x15c71c,'msPerChar':_0x1bae80},_0x363dfc),_0x28bedf=[];for(const _0x289bc0 of _0x4940dd['values']()){_0x28bedf[_0x30036b(0x133)](..._0x289bc0);}_0x28bedf[_0x30036b(0x223)]((_0x16fc82,_0x168ec3)=>_0x168ec3['startTime']-_0x16fc82[_0x30036b(0xee)]);const _0x13512b=new Date(_0x2ae125),_0x2e39a4=formatDate(_0x13512b),_0x3d784d=_0x29b633+TIMELINE_CONFIG[_0x30036b(0x224)]+TIMELINE_CONFIG[_0x30036b(0x235)]+_0x16a822,_0x11bd0e='\x20'['repeat'](_0x3d784d-_0x2e39a4[_0x30036b(0x1f2)]),_0x82b145=_0x11bd0e+a38_0x4e5599[_0x30036b(0x18c)](_0x2e39a4)+'\x20'+_0x5266ce;_0x327f38[_0x30036b(0x133)](_0x82b145);const _0x47410c=0x16;let _0x1d8a79=0x0;for(const _0x1eb82c of _0x28bedf){const _0x32a05f=_0x1eb82c[_0x30036b(0xf4)][_0x30036b(0x218)]?.['name']||'?',_0x3644f4=Math['min'](stringWidth(_0x32a05f),_0x47410c);_0x1d8a79=Math[_0x30036b(0x1d7)](_0x1d8a79,_0x3644f4);}for(const _0x31e568 of _0x28bedf){const {session:_0x14f189,startTime:_0x40c71d,endTime:_0x4627b9,duration:_0x5f20c4}=_0x31e568,_0x444c42=_0x14f189[_0x30036b(0x218)]?.['id'],_0x3eb701=_0x14f189['id'],_0x4dbade=_0x14f189[_0x30036b(0x218)]?.[_0x30036b(0x159)]||'?',_0x38879c=_0x14f189[_0x30036b(0xa1)]?.['name']||'?';let _0x51daa8,_0x3d7fdb;if(_0x14f189[_0x30036b(0x189)]){const _0x4a6792=_0x14f189[_0x30036b(0x189)];!_0x4a6792['done']?(_0x51daa8=_0x4a6792[_0x30036b(0x112)]?'🛑':'🔄',_0x3d7fdb=_0x4a6792['cancelRequested']?a38_0x4e5599[_0x30036b(0x1d6)]:a38_0x4e5599[_0x30036b(0xc7)]):(_0x51daa8=_0x4a6792[_0x30036b(0xd6)]?'✅':'❌',_0x3d7fdb=_0x4a6792[_0x30036b(0xd6)]?a38_0x4e5599[_0x30036b(0x11a)]:a38_0x4e5599[_0x30036b(0x1a1)]);}else _0x51daa8='⏳',_0x3d7fdb=a38_0x4e5599[_0x30036b(0x18c)];const _0x2f70fd='#'+_0x3eb701,_0x3c6a16=_0x444c42?hyperlink(_0x2f70fd,getWorkflowSessionUrl(_0x10fc46,_0x444c42,_0x3eb701)):_0x2f70fd;let _0x312212=_0x4dbade;stringWidth(_0x4dbade)>_0x47410c&&(_0x312212=_0x4dbade[_0x30036b(0x228)](0x0,_0x47410c-0x1)+'…');const _0xec2f14=a38_0x4e5599[_0x30036b(0x18c)](_0x312212),_0x289961=stringWidth(_0x312212),_0x2cca34='\x20'[_0x30036b(0x1ac)](_0x1d8a79-stringWidth(_0x312212)+0x2),_0x3af4b9='('+formatElapsed(_0x5f20c4)+')',_0x15cf8b=stringWidth(_0x3af4b9),_0x48d352=stringWidth(_0x2f70fd),_0x2b0da5=_0x48d352+0x1+_0x289961+_0x2cca34[_0x30036b(0x1f2)],_0x55c589=_0x16a822-_0x2b0da5-_0x15cf8b-0x1-0x8;let _0x4eaa17=_0x38879c;stringWidth(_0x4eaa17)>_0x55c589&&(_0x4eaa17=_0x4eaa17[_0x30036b(0x228)](0x0,_0x55c589-0x1)+'…');const _0x9121b0=_0x3c6a16+'\x20'+_0xec2f14+_0x2cca34+_0x4eaa17,_0x37a6eb=stringWidth(_0x9121b0),_0x2481e2=_0x16a822-_0x37a6eb-_0x15cf8b,_0x3e46d7=_0x9121b0+'\x20'[_0x30036b(0x1ac)](Math[_0x30036b(0x1d7)](0x1,_0x2481e2))+a38_0x4e5599[_0x30036b(0x18c)](_0x3af4b9),_0x1ef19c=Math['floor']((_0x40c71d-_0x2ae125)/_0x1bae80),_0x3131ad=Math['floor']((_0x4627b9-_0x2ae125)/_0x1bae80),_0x35ccfb=Math[_0x30036b(0x1d7)](_0x1ef19c+0x1,_0x3131ad),_0x1da71b=new Array(_0x363dfc)[_0x30036b(0x13a)]('\x20');for(let _0x4e1a16=_0x1ef19c;_0x4e1a16<Math['min'](_0x35ccfb,_0x363dfc);_0x4e1a16++){_0x1da71b[_0x4e1a16]='─';}const _0xb2f2ec=_0x1da71b[_0x30036b(0x142)](_0x8f5fbb=>_0x8f5fbb==='\x20'?'\x20':_0x3d7fdb(_0x8f5fbb))[_0x30036b(0x1d4)]('');_0x327f38['push'](_0x51daa8+'\x20'+_0x3e46d7+'│'+_0xb2f2ec+'│');}return _0x327f38[_0x30036b(0x1d4)]('\x0a');}async[a38_0x3dc27b(0x1ba)](_0x5d259a,_0x3e1b1a,_0x5c6613){const _0x4f4ca5=a38_0x3dc27b,{options:_0x57623a,tdx:_0x294c18}=_0x3e1b1a,_0x2ab858=_0x57623a['site'],{timelineRows:_0xb1a262,timeAxisHeader:_0x422511}=this[_0x4f4ca5(0x233)](_0x5d259a,_0x2ab858),_0x5b6b16=_0xb1a262['filter'](_0x31f92e=>_0x31f92e[_0x4f4ca5(0x1c8)]);if(_0x5b6b16[_0x4f4ca5(0x1f2)]===0x0){const _0x4245aa=this['renderSessionsTimeline'](_0x5d259a,_0x2ab858);console[_0x4f4ca5(0x184)](_0x4245aa);!_0x5c6613&&(console[_0x4f4ca5(0xfa)](''),console['error'](a38_0x4e5599[_0x4f4ca5(0x18c)](_0x4f4ca5(0x19c))),console[_0x4f4ca5(0xfa)](a38_0x4e5599[_0x4f4ca5(0x18c)](_0x4f4ca5(0x1de))+'or'+a38_0x4e5599['dim']('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0x422511&&console[_0x4f4ca5(0x184)](_0x422511);const _0x268d2f=_0xb1a262['filter'](_0x3945c5=>_0x3945c5['attemptId'])[_0x4f4ca5(0x142)](_0x190992=>({'title':_0x190992[_0x4f4ca5(0xe4)],'value':_0x190992[_0x4f4ca5(0x1c8)]})),_0x4d144a=process[_0x4f4ca5(0x115)]['rows']||0x3c,_0x16f8dd=Math['max'](0x28,Math[_0x4f4ca5(0x1c1)](_0x4d144a*0x2/0x3)),_0xf38cec=await a38_0x1916d9({'type':'autocomplete','name':'attemptId','message':_0x4f4ca5(0x101),'choices':_0x268d2f,'initial':-0x1,'limit':_0x16f8dd,'clearFirst':!![],'fallback':{'title':_0x4f4ca5(0x164),'value':null},'suggest':(_0x23ffa6,_0x31ea69)=>{const _0x1f823d=_0x4f4ca5;if(!_0x23ffa6)return Promise[_0x1f823d(0x194)](_0x31ea69);const _0x2b1562=_0x31ea69['filter'](_0x39c80e=>{const _0x973685=_0x1f823d,_0x3216e0=_0x39c80e;return _0x3216e0[_0x973685(0x1a9)][_0x973685(0x1d3)]()[_0x973685(0xdd)](_0x23ffa6[_0x973685(0x1d3)]());});return Promise[_0x1f823d(0x194)](_0x2b1562);}}),_0x5710dd=()=>{const _0x167bdf=_0x4f4ca5;process[_0x167bdf(0x115)][_0x167bdf(0x168)](_0x167bdf(0x1e6)),process[_0x167bdf(0x115)][_0x167bdf(0x168)]('\x1b[1A\x1b[2K'),process[_0x167bdf(0x115)][_0x167bdf(0x168)](_0x167bdf(0x1e6));},_0x43c71e=_0xf38cec&&_0xf38cec['attemptId']&&_0xf38cec[_0x4f4ca5(0x1c8)]!==null&&_0xf38cec[_0x4f4ca5(0x1c8)][_0x4f4ca5(0xb2)]()!=='';if(!_0x43c71e){_0x5710dd(),console[_0x4f4ca5(0x184)](a38_0x4e5599[_0x4f4ca5(0x18c)]('Cancelled'));return;}_0x5710dd();const _0x7b1d76=_0x5d259a[_0x4f4ca5(0x1dc)](_0x56295e=>_0x56295e[_0x4f4ca5(0x189)]?.['id']===_0xf38cec[_0x4f4ca5(0x1c8)]);if(_0x7b1d76){const _0x215721=_0x7b1d76[_0x4f4ca5(0x218)]?.['name']||'?',_0x59fe5d=_0x7b1d76[_0x4f4ca5(0xa1)]?.[_0x4f4ca5(0x159)]||'?';console['log'](_0x4f4ca5(0x185)+a38_0x4e5599['dim'](_0x215721)+_0x4f4ca5(0x100)+a38_0x4e5599[_0x4f4ca5(0x18c)](_0x59fe5d));}const _0x508ccd=new WorkflowTimelineCommand();await _0x508ccd['execute']({'args':[],'options':{..._0x57623a,'attemptId':_0xf38cec[_0x4f4ca5(0x1c8)]},'tdx':_0x294c18});}['generateSessionTimelineRows'](_0x209ef7,_0x476473){const _0x4f2adb=a38_0x3dc27b,_0x881979=new Map();for(const _0x226f7a of _0x209ef7){_0x226f7a['id']&&_0x226f7a[_0x4f2adb(0x189)]?.['id']&&_0x881979[_0x4f2adb(0xfd)](_0x226f7a['id'],_0x226f7a[_0x4f2adb(0x189)]['id']);}const _0x5dedaa=[];let _0x194a3d='';const _0x510ed8=this[_0x4f2adb(0x1d9)](_0x209ef7,_0x476473),_0x5d2be9=_0x510ed8['split']('\x0a');for(const _0x2dad69 of _0x5d2be9){if(_0x2dad69[_0x4f2adb(0x23d)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x2dad69[_0x4f2adb(0x1fc)](/^\s+\d{4}-\d{2}-\d{2}/))_0x194a3d=_0x2dad69;else{if(_0x2dad69[_0x4f2adb(0x1fc)](/^[✅❌🔄🛑⏳]/)){const _0x468903=_0x2dad69['match'](/#(\d+)/),_0xce0716=_0x468903?_0x468903[0x1]:null,_0x11c84a=_0xce0716?_0x881979[_0x4f2adb(0x195)](_0xce0716)||null:null,_0x1cfbbc=_0x209ef7[_0x4f2adb(0x1dc)](_0x15626a=>_0x15626a['id']===_0xce0716),_0xbdb9d9=_0x1cfbbc?.[_0x4f2adb(0x218)]?.[_0x4f2adb(0x159)]||'';_0x5dedaa['push']({'displayLine':_0x2dad69,'attemptId':_0x11c84a,'projectName':_0xbdb9d9});}}}return{'timelineRows':_0x5dedaa,'timeAxisHeader':_0x194a3d};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a38_0x3dc27b(0x159)]='workflow:attempts';[a38_0x3dc27b(0x144)]=a38_0x3dc27b(0x116);async[a38_0x3dc27b(0x10e)](_0x4e4cb6){const _0x43b469=a38_0x3dc27b,{options:_0x5e6bec,args:_0x341ae2,tdx:_0x360938}=_0x4e4cb6,_0x22792a=this[_0x43b469(0x1be)](_0x341ae2,_0x5e6bec);if(!_0x22792a)return 0x1;const {projectName:_0x5db421,workflowName:_0x4d3844}=_0x22792a,_0x5cacaa=_0x5e6bec[_0x43b469(0xdc)];if(_0x5e6bec[_0x43b469(0x12f)]){if(_0x5db421&&_0x4d3844)console[_0x43b469(0xfa)](_0x43b469(0x17d)+_0x5db421+'.'+_0x4d3844);else _0x5db421&&console['error'](_0x43b469(0x220)+_0x5db421);_0x5cacaa&&console[_0x43b469(0xfa)](_0x43b469(0xbd));}const _0x2901c3=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x360938['workflow'][_0x43b469(0x1b7)]({'projectName':_0x5db421,'workflowName':_0x4d3844,'includeRetried':_0x5cacaa,'limit':_0x5e6bec['limit']}),{'verbose':_0x5e6bec[_0x43b469(0x12f)]}),_0x2ae089=_0x2901c3[_0x43b469(0x15a)],_0xb91121=_0x5e6bec[_0x43b469(0x121)]||0x64,_0xdc876c=_0x2ae089[_0x43b469(0x1f2)]>=_0xb91121?a38_0x4e5599[_0x43b469(0x18c)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console['error']('✔\x20Found\x20'+_0x2ae089[_0x43b469(0x1f2)]+'\x20attempt'+(_0x2ae089[_0x43b469(0x1f2)]!==0x1?'s':'')+_0xdc876c);if(_0x5e6bec[_0x43b469(0x1b0)]==='json'||_0x5e6bec[_0x43b469(0x1b0)]==='jsonl'||_0x5e6bec['format']===_0x43b469(0xfe))await handleSDKOutput(_0x2ae089,_0x5e6bec);else{if(_0x2ae089[_0x43b469(0x1f2)]===0x0){if(_0x5db421&&_0x4d3844)console['log']('No\x20attempts\x20found\x20for:\x20'+_0x5db421+'.'+_0x4d3844);else _0x5db421?console['log']('No\x20attempts\x20found\x20in\x20project:\x20'+_0x5db421):console[_0x43b469(0x184)](_0x43b469(0xb6));}else{const _0x5d5c4b=_0x5e6bec[_0x43b469(0x1fe)],_0x3ec1e7=_0x2ae089[_0x43b469(0x142)](_0xdb7cb4=>{const _0x31fa0f=_0x43b469,_0x7b2a91=a38_0x4e5599['dim']('#'+_0xdb7cb4['id']),_0x5363ee=_0xdb7cb4[_0x31fa0f(0x218)]?.['id'],_0x171738=_0xdb7cb4[_0x31fa0f(0xe7)]||_0xdb7cb4[_0x31fa0f(0x14b)],_0x535c14=_0x5363ee&&_0x171738?hyperlink(_0x7b2a91,getWorkflowAttemptUrl(_0x5d5c4b,_0x5363ee,_0x171738,_0xdb7cb4['id'])):_0x7b2a91,{icon:_0x3052aa,text:_0x19dc60}=getAttemptStatusDisplay(_0xdb7cb4),_0x25c512=(_0xdb7cb4[_0x31fa0f(0x218)]?.[_0x31fa0f(0x159)]||'?')+'.'+(_0xdb7cb4[_0x31fa0f(0xa1)]?.['name']||'?'),_0x39b976=_0xdb7cb4[_0x31fa0f(0x1e4)]?a38_0x4e5599[_0x31fa0f(0x18c)](_0xdb7cb4[_0x31fa0f(0x1e4)]):'';return(_0x535c14+'\x20'+_0x3052aa+(_0x19dc60?'\x20'+_0x19dc60:'')+'\x20'+_0x25c512+'\x20'+_0x39b976)['trimEnd']();});await writeOutput(_0x3ec1e7['join']('\x0a'),_0x5e6bec[_0x43b469(0x1f6)],_0x43b469(0xe2));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a38_0x3dc27b(0xa5);['description']=a38_0x3dc27b(0x157);async[a38_0x3dc27b(0x10e)](_0x2ff38a){const _0x9ce56e=a38_0x3dc27b,{options:_0x5e47d6,args:_0x2566cf,tdx:_0x456a5d}=_0x2ff38a,_0x48dc4b=_0x2566cf[0x0];if(!_0x48dc4b)return console[_0x9ce56e(0xfa)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x5e47d6[_0x9ce56e(0x12f)]&&console[_0x9ce56e(0xfa)](_0x9ce56e(0x126)+_0x48dc4b);const _0x6728ca=await withSpinner(_0x9ce56e(0x132),()=>_0x456a5d[_0x9ce56e(0xa1)][_0x9ce56e(0x1fd)](_0x48dc4b),{'verbose':_0x5e47d6[_0x9ce56e(0x12f)]}),_0x526c04=_0x6728ca[_0x9ce56e(0x15a)];let _0x40a176;!_0x526c04[_0x9ce56e(0x1c9)]?_0x40a176=_0x526c04[_0x9ce56e(0x112)]?_0x9ce56e(0x186):_0x9ce56e(0xbf):_0x40a176=_0x526c04[_0x9ce56e(0xd6)]?'success':'error';let _0x1d46c3;if(_0x526c04[_0x9ce56e(0x1ee)]&&_0x526c04[_0x9ce56e(0x242)]){const _0x2ee395=new Date(_0x526c04[_0x9ce56e(0x1ee)])['getTime'](),_0x22ff13=new Date(_0x526c04[_0x9ce56e(0x242)])[_0x9ce56e(0x1eb)]();_0x1d46c3=Math['round']((_0x22ff13-_0x2ee395)/0x3e8);}const _0x4262d1={'attempt_id':_0x526c04['id'],'status':_0x40a176,..._0x526c04['index']!==undefined&&{'index':_0x526c04[_0x9ce56e(0xf2)]},..._0x526c04['project']&&{'project':_0x526c04['project'][_0x9ce56e(0x159)]},..._0x526c04[_0x9ce56e(0xa1)]&&{'workflow':_0x526c04[_0x9ce56e(0xa1)][_0x9ce56e(0x159)]},..._0x526c04[_0x9ce56e(0x14b)]&&{'session_id':_0x526c04[_0x9ce56e(0x14b)]},..._0x526c04[_0x9ce56e(0x1e4)]&&{'session_time':_0x526c04[_0x9ce56e(0x1e4)]},..._0x526c04[_0x9ce56e(0x1cc)]&&{'retry_attempt':_0x526c04[_0x9ce56e(0x1cc)]},..._0x1d46c3!==undefined&&{'duration_sec':_0x1d46c3},..._0x526c04[_0x9ce56e(0x1ee)]&&{'created_at':_0x526c04['createdAt']},..._0x526c04[_0x9ce56e(0x242)]&&{'finished_at':_0x526c04['finishedAt']},...Object[_0x9ce56e(0x1d1)](_0x526c04[_0x9ce56e(0x187)])['length']>0x0&&{'params':_0x526c04[_0x9ce56e(0x187)]}};return await handleSingleObjectOutput(_0x4262d1,_0x5e47d6),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a38_0x3dc27b(0xb8);[a38_0x3dc27b(0x144)]=a38_0x3dc27b(0x199);async['execute'](_0x3c1834){const _0x5e0d8b=a38_0x3dc27b,{options:_0x4c051a,args:_0x2299ce,tdx:_0x1ec1e6}=_0x3c1834,_0xb9bfd3=_0x2299ce[0x0];if(!_0xb9bfd3)return console[_0x5e0d8b(0xfa)](_0x5e0d8b(0x16f)),0x1;const _0x37f719=_0x4c051a[_0x5e0d8b(0x18a)];_0x4c051a[_0x5e0d8b(0x12f)]&&(console[_0x5e0d8b(0xfa)]('Attempt\x20ID:\x20'+_0xb9bfd3),_0x37f719&&console[_0x5e0d8b(0xfa)](_0x5e0d8b(0x154)));const _0x5921c5=await withSpinner(_0x5e0d8b(0x1ab),()=>_0x1ec1e6['workflow']['tasks'](_0xb9bfd3,_0x37f719||![]),{'verbose':_0x4c051a[_0x5e0d8b(0x12f)]}),_0x51573d=_0x5921c5['data'];return console[_0x5e0d8b(0xfa)](_0x5e0d8b(0xd5)+_0x51573d[_0x5e0d8b(0x1f2)]+_0x5e0d8b(0x14e)+(_0x51573d[_0x5e0d8b(0x1f2)]!==0x1?'s':'')),await handleSDKOutput(_0x51573d,_0x4c051a),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a38_0x3dc27b(0x159)]=a38_0x3dc27b(0x160);[a38_0x3dc27b(0x144)]=a38_0x3dc27b(0xf8);async['execute'](_0x46c4fe){const _0x463350=a38_0x3dc27b,{options:_0x4dd845,args:_0x5db9ca,tdx:_0x52770a}=_0x46c4fe,_0xd4c0dc=_0x5db9ca[0x0];let _0x5006b3=_0x5db9ca[0x1];if(!_0xd4c0dc)return console['error'](_0x463350(0x16f)),0x1;_0x4dd845[_0x463350(0x12f)]&&(console['error'](_0x463350(0x126)+_0xd4c0dc),_0x5006b3&&console[_0x463350(0xfa)](_0x463350(0x171)+_0x5006b3));const _0x1f1db8=await withSpinner(_0x463350(0xb1),()=>_0x52770a[_0x463350(0xa1)][_0x463350(0x1c3)](_0xd4c0dc,_0x5006b3),{'verbose':_0x4dd845[_0x463350(0x12f)]}),_0x194eaf=_0x1f1db8[_0x463350(0x15a)];if(_0x194eaf[_0x463350(0x1f2)]===0x0)return console[_0x463350(0xfa)](_0x463350(0x123)),0x0;if(!_0x5006b3&&(_0x4dd845[_0x463350(0x130)]||_0x4dd845[_0x463350(0x1b0)]))return await handleSDKOutput(_0x194eaf,_0x4dd845),0x0;if(!_0x5006b3){const _0x4360c7=_0x194eaf[_0x463350(0x142)](_0x278d29=>({'title':_0x278d29['taskName']+'\x20('+formatBytes(_0x278d29[_0x463350(0xec)])+')','value':_0x278d29[_0x463350(0x1b5)]})),_0x3cd857=await a38_0x1916d9({'type':_0x463350(0x15e),'name':_0x463350(0xda),'message':_0x463350(0xc0),'choices':_0x4360c7});if(!_0x3cd857['task'])return console[_0x463350(0xfa)](_0x463350(0x18e)),0x0;_0x5006b3=_0x3cd857[_0x463350(0xda)];}const _0x392c7b=await withSpinner(_0x463350(0x1cb),()=>_0x52770a[_0x463350(0xa1)][_0x463350(0x188)](_0xd4c0dc,_0x5006b3),{'verbose':_0x4dd845['verbose']}),_0x4bc9c3=_0x392c7b[_0x463350(0x15a)];return _0x4bc9c3?console[_0x463350(0x184)](_0x4bc9c3):console['error'](_0x463350(0x109)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a38_0x3dc27b(0x159)]=a38_0x3dc27b(0x131);[a38_0x3dc27b(0x144)]=a38_0x3dc27b(0x1da);async['execute'](_0x127dd1){const _0x9860fa=a38_0x3dc27b,{options:_0x3f85f7,args:_0x3f70f5,tdx:_0x5b8c18}=_0x127dd1,_0x1a25e2=_0x3f70f5[0x0];if(!_0x1a25e2)return console[_0x9860fa(0xfa)](_0x9860fa(0x16f)),0x1;const _0x3d2772=_0x3f85f7[_0x9860fa(0x1bc)];_0x3f85f7[_0x9860fa(0x12f)]&&(console[_0x9860fa(0xfa)](_0x9860fa(0x126)+_0x1a25e2),_0x3d2772&&console[_0x9860fa(0xfa)]('Reason:\x20'+_0x3d2772));if(!_0x3f85f7['yes']){const _0x2ee9dd=await confirmKey(_0x9860fa(0x16b)+_0x1a25e2+'?');if(!_0x2ee9dd)return console[_0x9860fa(0xfa)](_0x9860fa(0x18e)),0x0;}const _0x275420=await withSpinner(_0x9860fa(0xd8),()=>_0x5b8c18[_0x9860fa(0xa1)][_0x9860fa(0x124)](_0x1a25e2,_0x3d2772),{'verbose':_0x3f85f7[_0x9860fa(0x12f)]}),_0x2c0194=_0x275420['data'];return console[_0x9860fa(0xfa)]('✔\x20'+_0x2c0194),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a38_0x3dc27b(0x159)]=a38_0x3dc27b(0xed);[a38_0x3dc27b(0x144)]=a38_0x3dc27b(0x1bd);async[a38_0x3dc27b(0x10e)](_0x19b439){const _0x1835ba=a38_0x3dc27b,{options:_0x549e23,args:_0x5f0243,tdx:_0x18fd92}=_0x19b439,_0x227803=_0x5f0243[0x0];if(!_0x227803)return console[_0x1835ba(0xfa)](_0x1835ba(0x245)),console[_0x1835ba(0xfa)](_0x1835ba(0x105)),0x1;let _0x58d47b=![],_0x3986=_0x227803;if(_0x227803['startsWith']('session:'))_0x58d47b=!![],_0x3986=_0x227803[_0x1835ba(0x204)](0x8);else{if(_0x227803['startsWith']('attempt:'))_0x58d47b=![],_0x3986=_0x227803['substring'](0x8);else return console['error'](_0x1835ba(0x206)),console[_0x1835ba(0xfa)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x53d0b0=_0x549e23[_0x1835ba(0xc4)],_0x2a3a70=_0x549e23[_0x1835ba(0x1bf)],_0x339529=_0x549e23['params'],_0x1634c9=_0x549e23[_0x1835ba(0xe3)];_0x549e23[_0x1835ba(0x12f)]&&(console['error'](_0x1835ba(0x155)+(_0x58d47b?_0x1835ba(0xf4):_0x1835ba(0x1fd))+'\x20'+_0x3986),_0x53d0b0&&console[_0x1835ba(0xfa)](_0x1835ba(0x174)+_0x53d0b0),_0x2a3a70&&console[_0x1835ba(0xfa)](_0x1835ba(0x191)+_0x2a3a70),_0x339529&&console[_0x1835ba(0xfa)](_0x1835ba(0x21b)+_0x339529),_0x1634c9&&console[_0x1835ba(0xfa)](_0x1835ba(0x179)));let _0x261392;if(_0x339529)try{if(_0x339529[_0x1835ba(0x23d)]('@')){const _0x2bd8ae=await import(_0x1835ba(0xa4)),_0x4fdf98=_0x339529['substring'](0x1),_0x573e33=await _0x2bd8ae[_0x1835ba(0x22a)](_0x4fdf98,_0x1835ba(0x247));_0x261392=JSON[_0x1835ba(0xe8)](_0x573e33);}else _0x261392=JSON['parse'](_0x339529);}catch{return console['error']('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x549e23[_0x1835ba(0x1db)]){const _0x2c895f=await confirmKey(_0x1835ba(0x19b)+(_0x58d47b?_0x1835ba(0xf4):'attempt')+'\x20'+_0x3986+'?');if(!_0x2c895f)return console[_0x1835ba(0xfa)](_0x1835ba(0x18e)),0x0;}let _0x556d3e;_0x58d47b?_0x556d3e=await withSpinner(_0x1835ba(0x1f4),()=>_0x18fd92[_0x1835ba(0xa1)][_0x1835ba(0x1b9)](_0x3986,{'fromTask':_0x53d0b0,'retryParams':_0x261392}),{'verbose':_0x549e23[_0x1835ba(0x12f)]}):_0x556d3e=await withSpinner(_0x1835ba(0x1f3),()=>_0x18fd92[_0x1835ba(0xa1)][_0x1835ba(0x1e8)](_0x3986,{'resumeFrom':_0x2a3a70,'retryParams':_0x261392,'force':_0x1634c9}),{'verbose':_0x549e23[_0x1835ba(0x12f)]});const _0x3808d0=_0x556d3e[_0x1835ba(0x15a)];return console[_0x1835ba(0xfa)]('✔\x20Retry\x20started'),console[_0x1835ba(0xfa)](_0x1835ba(0x1e0)+_0x3808d0['attemptId']),console[_0x1835ba(0xfa)](_0x1835ba(0x246)+_0x3808d0[_0x1835ba(0x14b)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a38_0x3dc27b(0x159)]=a38_0x3dc27b(0xe0);['description']='Start\x20a\x20workflow\x20run';async[a38_0x3dc27b(0x10e)](_0x1b6090){const _0x2e7384=a38_0x3dc27b,{options:_0x46081c,args:_0x1cbd08,tdx:_0x1f9ca6}=_0x1b6090;let _0x57ba11=_0x1cbd08[0x0];if(!_0x57ba11){const _0x245ac4=this[_0x2e7384(0x1fa)]([],_0x46081c),_0x3c4551=await withSpinner(_0x2e7384(0x136),()=>_0x1f9ca6[_0x2e7384(0xa1)][_0x2e7384(0x21c)](_0x245ac4,{'limit':_0x46081c['limit']}),{'verbose':_0x46081c['verbose']}),_0x13f347=_0x3c4551[_0x2e7384(0x15a)];if(_0x13f347[_0x2e7384(0x1f2)]===0x0)return console[_0x2e7384(0xfa)](_0x2e7384(0x12c)),!_0x245ac4&&console[_0x2e7384(0xfa)](a38_0x4e5599['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x35373f=_0x13f347[_0x2e7384(0x142)](_0x22a5d6=>({'title':_0x22a5d6['project']?.[_0x2e7384(0x159)]+'.'+_0x22a5d6['name'],'value':_0x22a5d6[_0x2e7384(0x218)]?.['name']+'.'+_0x22a5d6[_0x2e7384(0x159)],'description':_0x22a5d6[_0x2e7384(0xe9)]?_0x2e7384(0x1f7)+_0x22a5d6['revision']:undefined})),_0x265419=await a38_0x1916d9({'type':_0x2e7384(0x15e),'name':_0x2e7384(0xa1),'message':_0x2e7384(0x20c),'choices':_0x35373f});if(!_0x265419[_0x2e7384(0xa1)])return 0x1;_0x57ba11=_0x265419[_0x2e7384(0xa1)];}if(!_0x57ba11[_0x2e7384(0xdd)]('.')){const _0x4d551c=this['resolveProject']([],_0x46081c);if(_0x4d551c)_0x57ba11=_0x4d551c+'.'+_0x57ba11;else return console['error'](a38_0x4e5599[_0x2e7384(0x1a1)](_0x2e7384(0xbe)),_0x2e7384(0x16d)),console[_0x2e7384(0xfa)](a38_0x4e5599[_0x2e7384(0x18c)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0xd9f895=_0x46081c['param'],_0x121a7e=_0x46081c[_0x2e7384(0x1e4)],_0x49aca9={};if(_0xd9f895&&Array[_0x2e7384(0x11d)](_0xd9f895))for(const _0x876870 of _0xd9f895){const _0x2bf432=_0x876870[_0x2e7384(0x1c7)]('=');if(_0x2bf432===-0x1)return console[_0x2e7384(0xfa)](_0x2e7384(0x20d)+_0x876870),console[_0x2e7384(0xfa)](_0x2e7384(0x1dd)),0x1;const _0xa011d=_0x876870[_0x2e7384(0x204)](0x0,_0x2bf432),_0x135416=_0x876870[_0x2e7384(0x204)](_0x2bf432+0x1);try{_0x49aca9[_0xa011d]=JSON['parse'](_0x135416);}catch{_0x49aca9[_0xa011d]=_0x135416;}}_0x46081c[_0x2e7384(0x12f)]&&(console[_0x2e7384(0xfa)](_0x2e7384(0x1e2)+_0x57ba11),Object[_0x2e7384(0x1d1)](_0x49aca9)[_0x2e7384(0x1f2)]>0x0&&console[_0x2e7384(0xfa)]('Parameters:\x20'+JSON['stringify'](_0x49aca9)),_0x121a7e&&console[_0x2e7384(0xfa)](_0x2e7384(0x178)+_0x121a7e));const _0x2eb608=await withSpinner(_0x2e7384(0x1ce),()=>_0x1f9ca6[_0x2e7384(0xa1)]['run'](_0x57ba11,_0x49aca9,{'sessionTime':_0x121a7e}),{'verbose':_0x46081c[_0x2e7384(0x12f)]}),_0x4f22b8=_0x2eb608[_0x2e7384(0x15a)];console[_0x2e7384(0xfa)](_0x2e7384(0xc1)),console['error'](_0x2e7384(0x1f1)+_0x4f22b8['id']),console[_0x2e7384(0xfa)](_0x2e7384(0x246)+_0x4f22b8[_0x2e7384(0x14b)]),console['error'](_0x2e7384(0x237)+_0x4f22b8['project']?.['name']),console['error']('\x20\x20Workflow:\x20'+_0x4f22b8[_0x2e7384(0xa1)]?.[_0x2e7384(0x159)]);if(_0x4f22b8[_0x2e7384(0x218)]?.['id']&&_0x4f22b8[_0x2e7384(0x14b)]&&_0x4f22b8['id']){const _0x2b8d9e=_0x46081c[_0x2e7384(0x1fe)],_0x3d1186=getConsoleUrl(_0x2b8d9e,_0x2e7384(0x114)+_0x4f22b8['project']['id']+_0x2e7384(0x14c)+_0x4f22b8['sessionId']+_0x2e7384(0x23c)+_0x4f22b8['id']);console[_0x2e7384(0xfa)](_0x2e7384(0x1f0)+a38_0x4e5599[_0x2e7384(0x12d)](_0x3d1186));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a38_0x3dc27b(0x159)]=a38_0x3dc27b(0x1cd);[a38_0x3dc27b(0x144)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a38_0x3dc27b(0x10e)](_0x50cb81){const _0x53506a=a38_0x3dc27b,{options:_0x52f20e,args:_0x4ff590,tdx:_0x21597f}=_0x50cb81,_0x1ca063=_0x4ff590[0x0],_0x4384b6=_0x4ff590[0x1]||'.';if(!_0x1ca063)return console['error'](_0x53506a(0x1ed)),console[_0x53506a(0xfa)](_0x53506a(0x1ae)),0x1;const _0x1217d3=_0x52f20e[_0x53506a(0xe9)];_0x52f20e['verbose']&&(console['error'](_0x53506a(0x185)+_0x1ca063),console[_0x53506a(0xfa)](_0x53506a(0x192)+_0x4384b6),_0x1217d3&&console['error']('Revision:\x20'+_0x1217d3));const _0x5b5a72=await withSpinner(_0x53506a(0xbc)+_0x1ca063+_0x53506a(0xae),()=>_0x21597f[_0x53506a(0xa1)][_0x53506a(0x1c0)](_0x1ca063,_0x4384b6,{'revision':_0x1217d3}),{'verbose':_0x52f20e[_0x53506a(0x12f)]}),_0x72399f=_0x5b5a72[_0x53506a(0x15a)];return console[_0x53506a(0xfa)](_0x53506a(0x108)+_0x72399f[_0x53506a(0x172)]),console['error'](_0x53506a(0x11c)+_0x72399f[_0x53506a(0xe9)]),console[_0x53506a(0xfa)](_0x53506a(0x1b4)+_0x72399f[_0x53506a(0x12a)]),console[_0x53506a(0xfa)](_0x53506a(0xa2)+_0x4384b6+'/'+_0x72399f[_0x53506a(0x172)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a38_0x3dc27b(0x146);['description']=a38_0x3dc27b(0x1af);async['execute'](_0x1a92aa){const _0x23d6c3=a38_0x3dc27b,{options:_0x1a6d0c,args:_0x418a2e,tdx:_0x32072f}=_0x1a92aa;let _0x2478ba='.',_0x52b1d4=_0x1a6d0c[_0x23d6c3(0x159)];if(_0x418a2e[0x0]){const {promises:_0x3341cb}=await import('fs');try{const _0x171d78=await _0x3341cb[_0x23d6c3(0x216)](_0x418a2e[0x0]);if(_0x171d78[_0x23d6c3(0x128)]())_0x2478ba=_0x418a2e[0x0];else return console[_0x23d6c3(0xfa)](_0x23d6c3(0x1b3)+_0x418a2e[0x0]+_0x23d6c3(0xaf)),0x1;}catch{_0x52b1d4=_0x418a2e[0x0],_0x2478ba='.';}}const _0x36ff15=_0x1a6d0c[_0x23d6c3(0xe9)],_0x349fdd=_0x1a6d0c[_0x23d6c3(0xc9)];_0x1a6d0c['verbose']&&(console[_0x23d6c3(0xfa)](_0x23d6c3(0x1a0)+_0x2478ba),_0x52b1d4&&console[_0x23d6c3(0xfa)]('Project\x20name:\x20'+_0x52b1d4),_0x36ff15&&console['error'](_0x23d6c3(0xcc)+_0x36ff15),_0x349fdd&&console['error'](_0x23d6c3(0xab)));const _0x473472=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x32072f['workflow'][_0x23d6c3(0x133)](_0x2478ba,{'projectName':_0x52b1d4,'revision':_0x36ff15,'skipValidation':_0x349fdd}),{'verbose':_0x1a6d0c[_0x23d6c3(0x12f)]}),_0xa34b67=_0x473472['data'];return console[_0x23d6c3(0xfa)](_0x23d6c3(0x1e7)+_0xa34b67[_0x23d6c3(0x172)]),console[_0x23d6c3(0xfa)]('\x20\x20Project\x20ID:\x20'+_0xa34b67[_0x23d6c3(0x15f)]),console[_0x23d6c3(0xfa)](_0x23d6c3(0x11c)+_0xa34b67[_0x23d6c3(0xe9)]),await this[_0x23d6c3(0x107)](_0x32072f,_0xa34b67['projectName'],_0x1a6d0c[_0x23d6c3(0x1fe)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a38_0x3dc27b(0x159)]='workflow:pull';[a38_0x3dc27b(0x144)]=a38_0x3dc27b(0xde);async[a38_0x3dc27b(0x10e)](_0x292c77){const _0x44311b=a38_0x3dc27b,{options:_0xaff301,args:_0x45ed66,tdx:_0x2458b4}=_0x292c77,_0x752e1a=_0x45ed66[0x0],_0xcd8ce9=_0x45ed66[0x1];if(!_0x752e1a)return console[_0x44311b(0xfa)](a38_0x4e5599['red'](_0x44311b(0xbe)),_0x44311b(0xdf)),console['error'](a38_0x4e5599[_0x44311b(0x18c)](_0x44311b(0x1f5))),0x1;const _0x5aea9e=_0xaff301[_0x44311b(0xe9)];_0xaff301['verbose']&&(console['error'](_0x44311b(0x185)+_0x752e1a),_0xcd8ce9&&console[_0x44311b(0xfa)](_0x44311b(0x15c)+_0xcd8ce9),_0x5aea9e&&console[_0x44311b(0xfa)](_0x44311b(0xcc)+_0x5aea9e),_0xaff301['dryRun']&&console['error'](_0x44311b(0x248)));const _0x1b3921=await withSpinner(_0x44311b(0x1b6)+_0x752e1a+_0x44311b(0xae),()=>_0x2458b4[_0x44311b(0xa1)][_0x44311b(0x190)](_0x752e1a,{'targetDir':_0xcd8ce9,'revision':_0x5aea9e}),{'verbose':_0xaff301['verbose']}),_0x84afa3=_0x1b3921['data'];_0x84afa3[_0x44311b(0x196)]?console['error']('✔\x20New\x20project:\x20'+_0x84afa3[_0x44311b(0x172)]):console[_0x44311b(0xfa)](_0x44311b(0x162)+_0x84afa3[_0x44311b(0x172)]);console['error'](_0x44311b(0x11c)+_0x84afa3[_0x44311b(0xe9)]),console['error']('\x20\x20Target:\x20'+(a38_0x514e72[_0x44311b(0x1b8)](process[_0x44311b(0x17b)](),_0x84afa3['targetDir'])||'.')),console['error']('\x20\x20Changes:\x20'+a38_0x4e5599[_0x44311b(0x11a)]('+'+_0x84afa3[_0x44311b(0xbb)]['new']+'\x20new')+',\x20'+(a38_0x4e5599[_0x44311b(0x1d6)]('~'+_0x84afa3[_0x44311b(0xbb)][_0x44311b(0x19e)]+_0x44311b(0x120))+',\x20')+(a38_0x4e5599['red']('-'+_0x84afa3[_0x44311b(0xbb)][_0x44311b(0xc2)]+_0x44311b(0x111))+',\x20')+(''+a38_0x4e5599['dim'](_0x84afa3['summary']['unchanged']+_0x44311b(0x209))));for(const _0x4663a0 of _0x84afa3[_0x44311b(0xe5)]){_0x4663a0[_0x44311b(0xa9)]===_0x44311b(0x19e)&&_0x4663a0[_0x44311b(0x22e)]&&(console[_0x44311b(0xfa)]('\x0a'+a38_0x4e5599[_0x44311b(0x12d)]('---\x20'+_0x4663a0[_0x44311b(0xb5)])),console[_0x44311b(0xfa)](_0x4663a0[_0x44311b(0x22e)]));}if(!_0x84afa3[_0x44311b(0x15b)])return saveSessionContext({'workflow_project':_0x84afa3[_0x44311b(0x172)]},_0xaff301['session']),console[_0x44311b(0xfa)](a38_0x4e5599['green'](_0x44311b(0x11f))),console[_0x44311b(0xfa)](a38_0x4e5599[_0x44311b(0x18c)](_0x44311b(0x227)+_0x84afa3[_0x44311b(0x172)])),0x0;if(_0xaff301[_0x44311b(0x17a)])return console[_0x44311b(0xfa)](a38_0x4e5599[_0x44311b(0x1d6)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0xaff301[_0x44311b(0x1db)]){const _0x3ffa74=await confirmKey(_0x44311b(0x238));if(!_0x3ffa74)return console['error'](_0x44311b(0x18e)),0x0;}await withSpinner('Writing\x20files...',()=>_0x2458b4[_0x44311b(0xa1)][_0x44311b(0x19d)](_0x84afa3,{'revision':_0x5aea9e}),{'verbose':_0xaff301['verbose']}),saveSessionContext({'workflow_project':_0x84afa3[_0x44311b(0x172)]},_0xaff301[_0x44311b(0xf4)]),console[_0x44311b(0xfa)](a38_0x4e5599[_0x44311b(0x11a)](_0x44311b(0x240)));const _0x290b46=a38_0x514e72[_0x44311b(0x1b8)](process[_0x44311b(0x17b)](),_0x84afa3['targetDir'])||'.';return console[_0x44311b(0xfa)](a38_0x4e5599[_0x44311b(0x18c)](_0x44311b(0xa2)+_0x290b46)),console['error'](a38_0x4e5599['dim']('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x84afa3[_0x44311b(0x172)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a38_0x3dc27b(0x159)]='workflow:push';['description']=a38_0x3dc27b(0x176);async[a38_0x3dc27b(0x10e)](_0x50c2b5){const _0x52f621=a38_0x3dc27b,{options:_0x21776b,args:_0x40b118,tdx:_0x560b70}=_0x50c2b5,_0x38f121=this[_0x52f621(0x202)](_0x40b118,_0x21776b),_0x3c3e85=_0x21776b[_0x52f621(0xe9)],_0x14342d=_0x21776b[_0x52f621(0xc9)];_0x21776b[_0x52f621(0x12f)]&&(_0x38f121&&console['error']('Source\x20directory:\x20'+_0x38f121),_0x3c3e85&&console[_0x52f621(0xfa)](_0x52f621(0xcc)+_0x3c3e85),_0x21776b[_0x52f621(0x17a)]&&console[_0x52f621(0xfa)]('Dry\x20run:\x20yes'),_0x14342d&&console['error'](_0x52f621(0xab)));let _0x49c547;try{_0x49c547=await withSpinner(_0x52f621(0x212),()=>_0x560b70[_0x52f621(0xa1)]['preparePushProject']({'sourceDir':_0x38f121,'revision':_0x3c3e85,'skipValidation':_0x14342d}),{'verbose':_0x21776b[_0x52f621(0x12f)]});}catch(_0x5c4d90){if(_0x5c4d90 instanceof Error&&_0x5c4d90[_0x52f621(0x1fb)][_0x52f621(0xdd)](_0x52f621(0x231)))return console[_0x52f621(0xfa)](a38_0x4e5599[_0x52f621(0x1a1)]('Error:'),_0x52f621(0xd7)),_0x21776b[_0x52f621(0x22b)]?console[_0x52f621(0xfa)](a38_0x4e5599[_0x52f621(0x18c)](_0x52f621(0x1c6)+_0x21776b[_0x52f621(0x22b)]+_0x52f621(0x222)+_0x21776b[_0x52f621(0x22b)]+'\x27')):console[_0x52f621(0xfa)](a38_0x4e5599['dim'](_0x52f621(0xff))),0x1;throw _0x5c4d90;}const _0x1cf401=_0x49c547['data'];console['error'](_0x52f621(0x162)+_0x1cf401['projectName']),console[_0x52f621(0xfa)](_0x52f621(0x1d8)+_0x1cf401[_0x52f621(0x1a8)]),console[_0x52f621(0xfa)](_0x52f621(0x11c)+_0x1cf401[_0x52f621(0xe9)]),console[_0x52f621(0xfa)](_0x52f621(0x1b1)+a38_0x4e5599[_0x52f621(0x11a)]('+'+_0x1cf401[_0x52f621(0xbb)][_0x52f621(0xad)]+_0x52f621(0x177))+',\x20'+(a38_0x4e5599['yellow']('~'+_0x1cf401['summary'][_0x52f621(0x19e)]+_0x52f621(0x120))+',\x20')+(a38_0x4e5599[_0x52f621(0x1a1)]('-'+_0x1cf401[_0x52f621(0xbb)][_0x52f621(0xc2)]+_0x52f621(0x111))+',\x20')+(''+a38_0x4e5599[_0x52f621(0x18c)](_0x1cf401[_0x52f621(0xbb)][_0x52f621(0x208)]+_0x52f621(0x209))));for(const _0x4cdd8e of _0x1cf401['changes']){_0x4cdd8e[_0x52f621(0xa9)]===_0x52f621(0x19e)&&_0x4cdd8e[_0x52f621(0x22e)]&&(console['error']('\x0a'+a38_0x4e5599[_0x52f621(0x12d)](_0x52f621(0x203)+_0x4cdd8e[_0x52f621(0xb5)])),console['error'](_0x4cdd8e[_0x52f621(0x22e)]));}if(!_0x1cf401['hasChanges'])return console[_0x52f621(0xfa)](a38_0x4e5599[_0x52f621(0x11a)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x52f621(0x107)](_0x560b70,_0x1cf401[_0x52f621(0x172)],_0x21776b['site']),0x0;if(_0x21776b[_0x52f621(0x17a)])return console[_0x52f621(0xfa)](a38_0x4e5599[_0x52f621(0x1d6)](_0x52f621(0x163))),0x0;if(!_0x21776b[_0x52f621(0x1db)]){const _0x24480f=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x24480f)return console[_0x52f621(0xfa)](_0x52f621(0x18e)),0x0;}const _0x31ca98=await withSpinner('Pushing\x20project...',()=>_0x560b70[_0x52f621(0xa1)][_0x52f621(0xd2)](_0x1cf401),{'verbose':_0x21776b['verbose']}),_0x25835a=_0x31ca98[_0x52f621(0x15a)];return console[_0x52f621(0xfa)](a38_0x4e5599['green']('✔\x20Push\x20complete')),console['error'](_0x52f621(0x110)+_0x25835a['projectId']),console[_0x52f621(0xfa)](_0x52f621(0x11c)+_0x25835a[_0x52f621(0xe9)]),await this[_0x52f621(0x107)](_0x560b70,_0x25835a[_0x52f621(0x172)],_0x21776b[_0x52f621(0x1fe)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a38_0x3dc27b(0x159)]=a38_0x3dc27b(0x229);[a38_0x3dc27b(0x144)]=a38_0x3dc27b(0xf9);async[a38_0x3dc27b(0x10e)](_0x556f8e){const _0x4b3b30=a38_0x3dc27b,{options:_0x38f4cb,args:_0x16a81b,tdx:_0xc74420}=_0x556f8e,_0x59387b=this['resolveProjectDir'](_0x16a81b,_0x38f4cb),_0x333582=_0x38f4cb[_0x4b3b30(0x159)],_0x5d6005=_0x38f4cb[_0x4b3b30(0xe9)],_0x56be68=_0x38f4cb[_0x4b3b30(0xc9)];if(!_0x59387b)return console[_0x4b3b30(0xfa)](a38_0x4e5599[_0x4b3b30(0x1a1)](_0x4b3b30(0xbe)),_0x4b3b30(0x1c5)),console[_0x4b3b30(0xfa)](a38_0x4e5599[_0x4b3b30(0x18c)](_0x4b3b30(0x21e))),console['error'](a38_0x4e5599[_0x4b3b30(0x18c)](_0x4b3b30(0x169))),0x1;if(!_0x333582)return console['error'](a38_0x4e5599[_0x4b3b30(0x1a1)](_0x4b3b30(0xbe)),_0x4b3b30(0x200)),console['error'](a38_0x4e5599[_0x4b3b30(0x18c)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x38f4cb[_0x4b3b30(0x12f)]&&(console[_0x4b3b30(0xfa)]('Source\x20directory:\x20'+_0x59387b),console['error'](_0x4b3b30(0xe1)+_0x333582),_0x5d6005&&console[_0x4b3b30(0xfa)]('Revision:\x20'+_0x5d6005),_0x38f4cb['dryRun']&&console[_0x4b3b30(0xfa)](_0x4b3b30(0x248)),_0x56be68&&console['error'](_0x4b3b30(0xab)));const _0x4b8390=await withSpinner('Analyzing\x20project...',()=>_0xc74420[_0x4b3b30(0xa1)]['prepareCloneProject'](_0x59387b,_0x333582,{'revision':_0x5d6005,'skipValidation':_0x56be68}),{'verbose':_0x38f4cb[_0x4b3b30(0x12f)]}),_0x5121b6=_0x4b8390[_0x4b3b30(0x15a)];console[_0x4b3b30(0xfa)](_0x4b3b30(0xf0)+_0x5121b6[_0x4b3b30(0x1a8)]);_0x5121b6['sourceProjectName']&&console[_0x4b3b30(0xfa)](_0x4b3b30(0x181)+_0x5121b6[_0x4b3b30(0x17c)]);console[_0x4b3b30(0xfa)](_0x4b3b30(0xe1)+_0x5121b6['newProjectName']),console['error'](_0x4b3b30(0xcc)+_0x5121b6[_0x4b3b30(0xe9)]),console[_0x4b3b30(0xfa)]('Files\x20to\x20upload:\x20'+_0x5121b6[_0x4b3b30(0xba)]);_0x5121b6[_0x4b3b30(0xcf)]&&(console['error'](a38_0x4e5599[_0x4b3b30(0x1d6)]('\x0a⚠\x20Project\x20\x22'+_0x5121b6[_0x4b3b30(0x226)]+_0x4b3b30(0x137)+_0x5121b6[_0x4b3b30(0x1a4)]+')')),console['error'](a38_0x4e5599[_0x4b3b30(0x1d6)](_0x4b3b30(0x151))));if(_0x38f4cb[_0x4b3b30(0x17a)])return console[_0x4b3b30(0xfa)](a38_0x4e5599[_0x4b3b30(0x1d6)](_0x4b3b30(0x234))),0x0;if(!_0x38f4cb['yes']){const _0x124dc3=_0x5121b6[_0x4b3b30(0x17c)]||a38_0x514e72[_0x4b3b30(0x20a)](_0x59387b),_0x539efb=_0x5121b6['targetExists']?_0x4b3b30(0xf7)+_0x333582+'\x22\x20with\x20new\x20revision?':_0x4b3b30(0x197)+_0x124dc3+_0x4b3b30(0x1bb)+_0x333582+'\x22?',_0x29324e=await confirmKey(_0x539efb);if(!_0x29324e)return console[_0x4b3b30(0xfa)](_0x4b3b30(0x18e)),0x0;}const _0x57143b=await withSpinner(_0x5121b6['targetExists']?_0x4b3b30(0xa7)+_0x333582+'...':'Cloning\x20to\x20'+_0x333582+_0x4b3b30(0xae),()=>_0xc74420[_0x4b3b30(0xa1)]['executeCloneProject'](_0x5121b6),{'verbose':_0x38f4cb[_0x4b3b30(0x12f)]}),_0x3b333b=_0x57143b[_0x4b3b30(0x15a)];return console[_0x4b3b30(0xfa)](a38_0x4e5599[_0x4b3b30(0x11a)](_0x5121b6['targetExists']?_0x4b3b30(0x1a7):'✔\x20Clone\x20complete')),console['error'](_0x4b3b30(0x237)+_0x3b333b[_0x4b3b30(0x226)]),console[_0x4b3b30(0xfa)](_0x4b3b30(0x110)+_0x3b333b[_0x4b3b30(0x147)]),console[_0x4b3b30(0xfa)](_0x4b3b30(0x11c)+_0x3b333b[_0x4b3b30(0xe9)]),await this[_0x4b3b30(0x107)](_0xc74420,_0x3b333b['newProjectName'],_0x38f4cb[_0x4b3b30(0x1fe)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a38_0x3dc27b(0x159)]=a38_0x3dc27b(0x119);[a38_0x3dc27b(0x144)]=a38_0x3dc27b(0x14d);async['execute'](_0x2844ff){const _0x2c78b9=a38_0x3dc27b,{options:_0x3b416f,args:_0x26c949,tdx:_0x4a7c47}=_0x2844ff,_0x40aa4d=_0x26c949[0x0];if(!_0x40aa4d)return console[_0x2c78b9(0xfa)](_0x2c78b9(0x1f9)),console[_0x2c78b9(0xfa)](_0x2c78b9(0x135)),0x1;_0x3b416f[_0x2c78b9(0x12f)]&&console['error'](_0x2c78b9(0x185)+_0x40aa4d);if(!_0x3b416f['yes']){const _0x4fde9c=await confirmKey(_0x2c78b9(0x214)+_0x40aa4d+_0x2c78b9(0x117));if(!_0x4fde9c)return console[_0x2c78b9(0xfa)](_0x2c78b9(0x18e)),0x0;}const _0x1d4412=await withSpinner(_0x2c78b9(0x207)+_0x40aa4d+_0x2c78b9(0xae),()=>_0x4a7c47[_0x2c78b9(0xa1)][_0x2c78b9(0xf5)](_0x40aa4d),{'verbose':_0x3b416f[_0x2c78b9(0x12f)]}),_0x46793c=_0x1d4412[_0x2c78b9(0x15a)];return console[_0x2c78b9(0xfa)](_0x2c78b9(0x249)+_0x46793c['projectName']),console[_0x2c78b9(0xfa)](_0x2c78b9(0x110)+_0x46793c[_0x2c78b9(0x15f)]),0x0;}}export function parseKeyValue(_0x41208e){const _0x4517ac=a38_0x3dc27b,_0x18a200=_0x41208e[_0x4517ac(0x1c7)]('=');if(_0x18a200===-0x1)throw new Error(_0x4517ac(0x1f8)+_0x41208e+_0x4517ac(0xa8));const _0x4bc6e8=_0x41208e[_0x4517ac(0x204)](0x0,_0x18a200),_0x2957ff=_0x41208e[_0x4517ac(0x204)](_0x18a200+0x1);if(!_0x4bc6e8)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x4bc6e8,'value':_0x2957ff};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']=a38_0x3dc27b(0x16a);[a38_0x3dc27b(0x144)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a38_0x3dc27b(0x10e)](_0x371701){const _0x16e6d3=a38_0x3dc27b,{options:_0x311326,args:_0x17c239,tdx:_0x5cc174}=_0x371701,_0x5ec8b8=this[_0x16e6d3(0x12e)](_0x17c239,_0x311326);if(!_0x5ec8b8)return 0x1;_0x311326[_0x16e6d3(0x12f)]&&console[_0x16e6d3(0xfa)]('Project:\x20'+_0x5ec8b8);const _0x574a59=await withSpinner(_0x16e6d3(0x149),()=>_0x5cc174['workflow']['listSecrets'](_0x5ec8b8),{'verbose':_0x311326[_0x16e6d3(0x12f)]}),{secrets:_0x2e630f}=_0x574a59[_0x16e6d3(0x15a)];return console[_0x16e6d3(0xfa)](_0x16e6d3(0xd5)+_0x2e630f[_0x16e6d3(0x1f2)]+_0x16e6d3(0x175)+(_0x2e630f[_0x16e6d3(0x1f2)]!==0x1?'s':'')),await handleSDKOutput(_0x2e630f,_0x311326),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a38_0x3dc27b(0x159)]=a38_0x3dc27b(0x1b2);[a38_0x3dc27b(0x144)]=a38_0x3dc27b(0xd4);async['execute'](_0x479857){const _0x363208=a38_0x3dc27b,{options:_0x3d083e,args:_0xcc966e,tdx:_0x44bba0}=_0x479857;let _0xb399ca,_0x1b9039;if(_0xcc966e['length']>=0x2)_0xb399ca=_0xcc966e[0x0],_0x1b9039=_0xcc966e[0x1];else{if(_0xcc966e[_0x363208(0x1f2)]===0x1&&_0x3d083e[_0x363208(0x22b)])_0xb399ca=_0x3d083e[_0x363208(0x22b)],_0x1b9039=_0xcc966e[0x0];else return _0xcc966e['length']===0x1?(console[_0x363208(0xfa)](_0x363208(0x1ed)),console[_0x363208(0xfa)](_0x363208(0x18d)),0x1):(console[_0x363208(0xfa)](_0x363208(0x1ea)),console[_0x363208(0xfa)](_0x363208(0xd1)),0x1);}let _0x8d4a07,_0x2583fe;try{({key:_0x8d4a07,value:_0x2583fe}=parseKeyValue(_0x1b9039));}catch(_0x2a5a71){return _0x2a5a71 instanceof Error&&console['error'](a38_0x4e5599['red']('Error:'),_0x2a5a71['message']),0x1;}_0x3d083e['verbose']&&(console['error'](_0x363208(0x185)+_0xb399ca),console['error']('Key:\x20'+_0x8d4a07));const _0xa403bc=await withSpinner(_0x363208(0xb0),()=>_0x44bba0[_0x363208(0xa1)][_0x363208(0x122)](_0xb399ca,_0x8d4a07,_0x2583fe),{'verbose':_0x3d083e[_0x363208(0x12f)]}),_0x3f07ff=_0xa403bc[_0x363208(0x15a)];return console[_0x363208(0xfa)]('✔\x20Secret\x20\x27'+_0x3f07ff[_0x363208(0x21f)]+_0x363208(0xac)+_0x3f07ff[_0x363208(0x172)]+'\x27'),(_0x3d083e[_0x363208(0x130)]||_0x3d083e[_0x363208(0x241)])&&await handleSingleObjectOutput(_0x3f07ff,_0x3d083e),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a38_0x3dc27b(0x1ef);[a38_0x3dc27b(0x144)]=a38_0x3dc27b(0x9f);async[a38_0x3dc27b(0x10e)](_0xb569e1){const _0x1fd8b2=a38_0x3dc27b,{options:_0x2f72c1,args:_0x224063,tdx:_0x3196f9}=_0xb569e1;let _0x2e069d,_0x12ffbc;if(_0x224063[_0x1fd8b2(0x1f2)]>=0x2)_0x2e069d=_0x224063[0x0],_0x12ffbc=_0x224063[0x1];else{if(_0x224063[_0x1fd8b2(0x1f2)]===0x1&&_0x2f72c1['workflowProject'])_0x2e069d=_0x2f72c1[_0x1fd8b2(0x22b)],_0x12ffbc=_0x224063[0x0];else return _0x224063[_0x1fd8b2(0x1f2)]===0x1?(console[_0x1fd8b2(0xfa)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x1fd8b2(0xfa)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console['error'](_0x1fd8b2(0xeb)),console['error']('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x2f72c1[_0x1fd8b2(0x12f)]&&(console[_0x1fd8b2(0xfa)]('Project:\x20'+_0x2e069d),console['error'](_0x1fd8b2(0x165)+_0x12ffbc));if(!_0x2f72c1[_0x1fd8b2(0x1db)]){const _0xda20ca=await confirmKey(_0x1fd8b2(0x12b)+_0x12ffbc+_0x1fd8b2(0x1a3)+_0x2e069d+'\x27?');if(!_0xda20ca)return console[_0x1fd8b2(0xfa)](_0x1fd8b2(0x18e)),0x0;}const _0x18e100=await withSpinner(_0x1fd8b2(0xe6),()=>_0x3196f9[_0x1fd8b2(0xa1)][_0x1fd8b2(0x17e)](_0x2e069d,_0x12ffbc),{'verbose':_0x2f72c1['verbose']}),_0x39808d=_0x18e100[_0x1fd8b2(0x15a)];return console['error'](_0x1fd8b2(0xc8)+_0x39808d[_0x1fd8b2(0x21f)]+_0x1fd8b2(0x20b)+_0x39808d[_0x1fd8b2(0x172)]+'\x27'),(_0x2f72c1[_0x1fd8b2(0x130)]||_0x2f72c1[_0x1fd8b2(0x241)])&&await handleSingleObjectOutput(_0x39808d,_0x2f72c1),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 a38_0x3456(){const _0x2ae05a=['New\x20project\x20name:\x20','list','force','displayLine','changes','Deleting\x20secret...','session_id','parse','revision','✔\x20Workflow\x20project\x20set\x20to:\x20','Error:\x20Secret\x20key\x20is\x20required','fileSize','workflow:retry','startTime','✔\x20Workflow\x20project\x20context\x20cleared.','Source:\x20','Warning:','index','pollTimeline','session','delete','\x27...','\x0aUpdate\x20existing\x20project\x20\x22','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','error','\x20sessions\x20','LABEL_MIN_SPACING','set','table','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.',',\x20Workflow:\x20','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','state','some','Latest\x20session\x20has\x20no\x20attempt','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','sys','showWorkflowConsoleUrl','✔\x20Downloaded\x20','No\x20log\x20content\x20found','duration','TASK_NAME_WIDTH','\x20of\x20','POLL_INTERVAL_MS','execute','context','\x20\x20Project\x20ID:\x20','\x20deleted','cancelRequested','List\x20all\x20workflow\x20projects','/app/workflows/','stdout','List\x20workflow\x20attempts','\x22?\x20This\x20cannot\x20be\x20undone.','342NxhSHg','workflow:delete','green','renderSingleTimeline','\x20\x20Revision:\x20','isArray','replace','\x0a✔\x20Already\x20up\x20to\x20date','\x20modified','limit','setSecret','No\x20log\x20files\x20found\x20for\x20this\x20attempt','kill','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Attempt\x20ID:\x20','\x0a✔\x20Attempt\x20complete','isDirectory','No\x20sessions\x20found\x20for:\x20','filesExtracted','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','No\x20workflows\x20found','cyan','requireProject','verbose','json','workflow:kill','Getting\x20attempt\x20details...','push','renderTimeline','Usage:\x20workflow:delete\x20<project-name-or-id>','Loading\x20workflows...','\x22\x20already\x20exists\x20(ID:\x20','No\x20workflows\x20found\x20in\x20project:\x20','has','fill','No\x20sessions\x20found','pending','MAX_LABEL_COUNT','startedAt','getFullYear','padStart','\x20-\x20','map','489sFICIl','description','✔\x20Showing\x20','workflow:upload','newProjectId','toISOString','Listing\x20secrets...','getHours','sessionId','/sessions/','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','\x20task','tdx\x20wf\x20attempt\x20','columns','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','min','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Including\x20subtasks:\x20yes','Target:\x20','📋\x20','Show\x20specific\x20attempt\x20details','Resolving\x20project\x20\x27','name','data','hasChanges','Target\x20directory:\x20','No\x20projects\x20match\x20pattern:\x20','select','projectId','workflow:logs','group_error','✔\x20Project:\x20','\x0aDry\x20run\x20-\x20nothing\x20pushed','No\x20matching\x20sessions\x20found','Key:\x20','start','status','write','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','workflow:secrets:list','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','text','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','getDate','Error:\x20Attempt\x20ID\x20is\x20required','end','Task\x20name:\x20','projectName','localeCompare','From\x20task:\x20','\x20secret','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','\x20new','Session\x20time:\x20','Force:\x20yes','dryRun','cwd','sourceProjectName','Filter:\x20','deleteSecret','Failed\x20to\x20fetch\x20attempt\x20data','MAX_TASKS_DISPLAY','Source\x20project:\x20','No\x20sessions\x20found\x20in\x20project:\x20','\x20has\x20no\x20attempts','log','Project:\x20','canceling','params','logs','lastAttempt','includeSubtasks','isTTY','dim','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Cancelled','🔄\x20','pullProject','Resume\x20from:\x20','Output\x20directory:\x20','8100meDUPJ','resolve','get','isNewProject','\x0aClone\x20\x22','7358LStyUi','Show\x20tasks\x20for\x20an\x20attempt','workflow:workflows','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','applyPullProject','modified','(unknown)','Project\x20directory:\x20','red','5231765rvmHgH','\x27\x20from\x20project\x20\x27','existingProjectId','403230VEUlAX','icon','✔\x20Project\x20updated','sourceDir','title','durationMs','Getting\x20attempt\x20tasks...','repeat','Listing\x20workflows...','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','format','\x20\x20Changes:\x20','workflow:secrets:set','Error:\x20','\x20\x20Files\x20extracted:\x20','taskName','Pulling\x20project\x20','attempts','relative','retrySession','navigateSessionsInteractive','\x22\x20to\x20new\x20project\x20\x22','reason','Retry\x20a\x20session\x20or\x20attempt','parseProjectWorkflowPattern','resumeFrom','download','floor','MAX_TIMELINE_WIDTH','logFiles','filter','Source\x20directory\x20is\x20required','Tip:\x20cd\x20to\x20workflows/','indexOf','attemptId','done','1976408HivjSj','Downloading\x20logs...','retryAttemptName','workflow:download','Starting\x20workflow\x20run...','split','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','keys','Pattern:\x20','toLowerCase','join','MIN_LABEL_COUNT','yellow','max','\x20\x20Source:\x20','renderSessionsTimeline','Kill\x20a\x20running\x20attempt','yes','find','Expected\x20format:\x20--param\x20key=value','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','22255iAivhB','\x20\x20New\x20attempt\x20ID:\x20','all','Workflow:\x20','\x20to\x20see\x20detailed\x20logs','sessionTime','now','\x1b[1A\x1b[2K','✔\x20Pushed\x20','retryAttempt','total','Error:\x20KEY=VALUE\x20is\x20required','getTime','workflowName','Error:\x20Project\x20name\x20is\x20required','createdAt','workflow:secrets:delete','\x20\x20Console:\x20','\x20\x20Attempt\x20ID:\x20','length','Retrying\x20attempt...','Retrying\x20session...','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','output','revision:\x20','Invalid\x20format:\x20','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','resolveProject','message','match','attempt','site','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','LABEL_WIDTH_DIVISOR','resolveProjectDir','---\x20','substring','workflow:timeline','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Deleting\x20project\x20','unchanged','\x20unchanged','basename','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Select\x20a\x20workflow\x20to\x20run','Error:\x20Invalid\x20parameter\x20format:\x20','resolveProjectId','Attempt:\x20','follow','from','Analyzing\x20changes...','GUTTER','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','size','stat','Project\x20filter:\x20','project','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Params:\x20','workflows','\x20logs','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','key','Filter:\x20project=','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','sort','ICON_WIDTH','window','newProjectName','\x20\x20Session\x20context\x20set\x20to:\x20','slice','workflow:clone','readFile','workflowProject','msPerChar','getMinutes','diff','⚠\x20Showing\x20first\x20','MAX_POLL_ITERATIONS','No\x20workflow\x20tdx.json\x20found','updatedAt','generateSessionTimelineRows','\x0aDry\x20run\x20-\x20no\x20project\x20created','ICON_SPACING','workflow:projects','\x20\x20Project:\x20','\x0aApply\x20these\x20changes?','unknown','rows','sessions','/attempt/','startsWith','splice','10848DfdKNr','✔\x20Pull\x20complete','jsonl','finishedAt','List\x20workflows','Using\x20attempt\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','\x20\x20Session\x20ID:\x20','utf-8','Dry\x20run:\x20yes','✔\x20Deleted\x20project\x20','1773ZWLlhK','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','No\x20workflow\x20sessions\x20found','workflow','\x20\x20Location:\x20','2123pDfOeQ','fs/promises','workflow:attempt','getMonth','Updating\x20','.\x20Expected\x20format:\x20KEY=VALUE','type','💡\x20Tip:\x20Use\x20','Validation:\x20skipped','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','new','...','\x20is\x20not\x20a\x20directory','Setting\x20secret...','Fetching\x20log\x20files...','trim','Listing\x20workflow\x20projects...','\x20session','path','No\x20attempts\x20found','Session\x20','workflow:tasks','333rPbQFd','fileCount','summary','Downloading\x20project\x20','Include\x20retried:\x20yes','Error:','running','Select\x20a\x20task\x20to\x20view\x20logs:','✔\x20Workflow\x20run\x20started','deleted','Session\x20not\x20found:\x20','fromTask','planned','Listing\x20workflow\x20sessions...','blue','✔\x20Secret\x20\x27','skipValidation','Select\x20a\x20session\x20to\x20view\x20timeline:','\x0aPolling...\x20(','Revision:\x20','\x20tasks','fullName','targetExists','tasks','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','executePushProject','\x20project','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','✔\x20Found\x20','success','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Killing\x20attempt...','Loading\x20sessions...','task','buildTimelineData','includeRetried','includes','Pull\x20workflow\x20project\x20to\x20local\x20folder','Project\x20name\x20is\x20required','workflow:run'];a38_0x3456=function(){return _0x2ae05a;};return a38_0x3456();}function formatElapsed(_0x523530){const _0x502ecb=a38_0x3dc27b,_0x3c0d9c=Math[_0x502ecb(0x1c1)](_0x523530/0x3e8),_0x3162d2=Math[_0x502ecb(0x1c1)](_0x3c0d9c/0x3c),_0x178deb=Math[_0x502ecb(0x1c1)](_0x3162d2/0x3c),_0xd1aeeb=Math[_0x502ecb(0x1c1)](_0x178deb/0x18);if(_0xd1aeeb>0x0){const _0xa8b431=_0x178deb%0x18;return _0xa8b431>0x0?_0xd1aeeb+'d\x20'+_0xa8b431+'h':_0xd1aeeb+'d';}else{if(_0x178deb>0x0){const _0x714a91=_0x3162d2%0x3c;return _0x714a91>0x0?_0x178deb+'h\x20'+_0x714a91+'m':_0x178deb+'h';}else{if(_0x3162d2>0x0){const _0x2d675e=_0x3c0d9c%0x3c;return _0x2d675e>0x0?_0x3162d2+'m\x20'+_0x2d675e+'s':_0x3162d2+'m';}else return _0x3c0d9c+'s';}}}function formatTimestamp(_0x555012,_0x5713b8){const _0x3b3936=a38_0x3dc27b,_0x579653=new Date(_0x555012),_0x1afa2e=String(_0x579653[_0x3b3936(0x14a)]())[_0x3b3936(0x140)](0x2,'0'),_0x2ad721=String(_0x579653[_0x3b3936(0x22d)]())[_0x3b3936(0x140)](0x2,'0'),_0x1ef371=_0x1afa2e+':'+_0x2ad721,_0x13667b=_0x579653[_0x3b3936(0x13f)]()===_0x5713b8['getFullYear']()&&_0x579653['getMonth']()===_0x5713b8[_0x3b3936(0xa6)]()&&_0x579653[_0x3b3936(0x16e)]()===_0x5713b8[_0x3b3936(0x16e)]();if(_0x13667b)return _0x1ef371;else{const _0xc9c604=String(_0x579653['getMonth']()+0x1)[_0x3b3936(0x140)](0x2,'0'),_0x28c669=String(_0x579653[_0x3b3936(0x16e)]())['padStart'](0x2,'0');return _0xc9c604+'-'+_0x28c669+'\x20'+_0x1ef371;}}function formatDate(_0x5a4965){const _0x1f93e9=a38_0x3dc27b,_0x5a81b6=_0x5a4965[_0x1f93e9(0x13f)](),_0x4a8f98=String(_0x5a4965[_0x1f93e9(0xa6)]()+0x1)['padStart'](0x2,'0'),_0x3c2eca=String(_0x5a4965[_0x1f93e9(0x16e)]())[_0x1f93e9(0x140)](0x2,'0');return _0x5a81b6+'-'+_0x4a8f98+'-'+_0x3c2eca;}function getTaskStateIcon(_0x210983){const _0x102408={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x102408[_0x210983]||'⚪';}function getBarChar(_0x551e49){return _0x551e49==='error'||_0x551e49==='group_error'?'×':'─';}function getBarColor(_0x472ed2){const _0x4ae063=a38_0x3dc27b,_0x10f201={'success':a38_0x4e5599['green'],'error':a38_0x4e5599[_0x4ae063(0x1a1)],'group_error':a38_0x4e5599[_0x4ae063(0x1a1)],'running':a38_0x4e5599[_0x4ae063(0xc7)],'blocked':a38_0x4e5599[_0x4ae063(0x1d6)],'planned':a38_0x4e5599[_0x4ae063(0x18c)],'canceling':a38_0x4e5599[_0x4ae063(0x1d6)]};return _0x10f201[_0x472ed2]||a38_0x4e5599['white'];}function parseTaskName(_0x3d5e3d){const _0x2df10c=a38_0x3dc27b;let _0x4a2459=_0x3d5e3d[_0x2df10c(0x11e)](/^\++/,'');const _0x45c27b=_0x4a2459['split']('+'),_0x5d528f=_0x45c27b[_0x2df10c(0x1f2)]>0x1?_0x45c27b[_0x2df10c(0x1f2)]-0x2:0x0,_0x2c8a9d=_0x45c27b[_0x45c27b[_0x2df10c(0x1f2)]-0x1]||_0x4a2459;return{'level':_0x5d528f,'name':'+'+_0x2c8a9d};}function truncateTaskName(_0xe8eb30,_0x851622){const _0x449367=a38_0x3dc27b,_0x196339=stringWidth(_0xe8eb30);if(_0x196339<=_0x851622)return _0xe8eb30;let _0x671af0=_0xe8eb30;while(stringWidth(_0x671af0+'…')>_0x851622&&_0x671af0[_0x449367(0x1f2)]>0x0){_0x671af0=_0x671af0[_0x449367(0x228)](0x0,-0x1);}return _0x671af0+'…';}function calculateTimeScale(_0x153207,_0x2bea06){const _0x1ecbb9=a38_0x3dc27b;return{'startTime':_0x153207[_0x1ecbb9(0x166)],'endTime':_0x153207[_0x1ecbb9(0x170)],'durationMs':_0x153207['duration'],'msPerChar':_0x153207[_0x1ecbb9(0x10a)]/_0x2bea06};}function timeToPosition(_0x1a68d5,_0xda10f4,_0x45ac3d){const _0x11a857=a38_0x3dc27b,_0x33af60=_0x1a68d5-_0xda10f4[_0x11a857(0xee)],_0x39fccb=Math[_0x11a857(0x1c1)](_0x33af60/_0xda10f4[_0x11a857(0x22c)]);return Math[_0x11a857(0x1d7)](0x0,Math[_0x11a857(0x152)](_0x39fccb,_0x45ac3d));}function renderTimeAxis(_0x2fdf54,_0xe87bbb){const _0x11e925=a38_0x3dc27b,_0xf0c29a=Math[_0x11e925(0x152)](TIMELINE_CONFIG[_0x11e925(0x13d)],Math[_0x11e925(0x1d7)](TIMELINE_CONFIG[_0x11e925(0x1d5)],Math[_0x11e925(0x1c1)](_0xe87bbb/TIMELINE_CONFIG[_0x11e925(0x201)]))),_0x2e792f=_0x2fdf54[_0x11e925(0x1aa)]/(_0xf0c29a-0x1),_0x3a56c1=new Date(_0x2fdf54[_0x11e925(0xee)]),_0x5e4285=[];for(let _0x4af032=0x0;_0x4af032<_0xf0c29a;_0x4af032++){const _0x1edcf4=_0x2fdf54[_0x11e925(0xee)]+_0x4af032*_0x2e792f,_0x28d53e=timeToPosition(_0x1edcf4,_0x2fdf54,_0xe87bbb),_0x3762e0=formatTimestamp(_0x1edcf4,_0x3a56c1);_0x5e4285[_0x11e925(0x133)]({'pos':_0x28d53e,'text':_0x3762e0});}const _0x99755c=new Array(_0xe87bbb)['fill']('\x20');let _0xa851e1=-0x1;for(const {pos:_0x4747e9,text:_0x3e6028}of _0x5e4285){let _0x379b44=Math[_0x11e925(0x1d7)](0x0,_0x4747e9-Math[_0x11e925(0x1c1)](_0x3e6028[_0x11e925(0x1f2)]/0x2));_0x379b44<=_0xa851e1+TIMELINE_CONFIG[_0x11e925(0xfc)]&&(_0x379b44=_0xa851e1+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x379b44+_0x3e6028[_0x11e925(0x1f2)]>_0xe87bbb&&(_0x379b44=_0xe87bbb-_0x3e6028['length']);if(_0x379b44>=0x0&&_0x379b44+_0x3e6028[_0x11e925(0x1f2)]<=_0xe87bbb&&_0x379b44>_0xa851e1){for(let _0x1d100a=0x0;_0x1d100a<_0x3e6028[_0x11e925(0x1f2)];_0x1d100a++){_0x99755c[_0x379b44+_0x1d100a]=_0x3e6028[_0x1d100a];}_0xa851e1=_0x379b44+_0x3e6028['length']-0x1;}}return _0x99755c[_0x11e925(0x1d4)]('');}function renderTaskRow(_0x3cbf16,_0x2e6e83,_0x113228,_0x50bc8e){const _0x489049=a38_0x3dc27b,{level:_0x4415e4,name:_0x1a8cd1}=parseTaskName(_0x3cbf16[_0x489049(0x159)]),_0x21c476='\x20'[_0x489049(0x1ac)](_0x4415e4),_0x391cae=_0x3cbf16['window']?'('+formatElapsed(_0x3cbf16[_0x489049(0x225)][_0x489049(0x10a)])+')':'',_0x152940=stringWidth(_0x391cae),_0x383095=_0x4415e4*0x1,_0x27e580=_0x50bc8e-_0x383095-_0x152940-0x1,_0x41960d=truncateTaskName(_0x1a8cd1,_0x27e580),_0x1e22ed=_0x21c476+_0x41960d,_0x5c7e36=stringWidth(_0x1e22ed),_0x55bd57=_0x50bc8e-_0x5c7e36-_0x152940,_0x27ab1d=_0x1e22ed+'\x20'['repeat'](Math['max'](0x1,_0x55bd57))+a38_0x4e5599[_0x489049(0x18c)](_0x391cae),_0x539020=getTaskStateIcon(_0x3cbf16[_0x489049(0x102)]),_0x148332=new Array(_0x113228)['fill']('\x20');if(_0x3cbf16['window']){const _0x245c39=timeToPosition(_0x3cbf16[_0x489049(0x225)][_0x489049(0x166)],_0x2e6e83,_0x113228),_0xec93b7=timeToPosition(_0x3cbf16[_0x489049(0x225)]['end'],_0x2e6e83,_0x113228),_0x5ad9d9=getBarChar(_0x3cbf16['state']),_0x2ed9d2=Math[_0x489049(0x1d7)](_0x245c39+0x1,_0xec93b7);for(let _0x561be8=_0x245c39;_0x561be8<Math[_0x489049(0x152)](_0x2ed9d2,_0x113228);_0x561be8++){_0x148332[_0x561be8]=_0x5ad9d9;}}const _0x246e1c=getBarColor(_0x3cbf16[_0x489049(0x102)]),_0x1fe838=_0x148332[_0x489049(0x142)](_0x1a8c53=>_0x1a8c53==='\x20'?'\x20':_0x246e1c(_0x1a8c53))[_0x489049(0x1d4)]('');return _0x539020+'\x20'+_0x27ab1d+'│'+_0x1fe838+'│';}function calculateStats(_0x52210c){const _0xb31897=a38_0x3dc27b,_0x27e60b={'total':_0x52210c['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x444848 of _0x52210c){if(_0x444848['state']===_0xb31897(0xd6))_0x27e60b['success']++;else{if(_0x444848['state']==='error'||_0x444848['state']===_0xb31897(0x161))_0x27e60b[_0xb31897(0xfa)]++;else _0x444848[_0xb31897(0x102)]===_0xb31897(0xbf)?_0x27e60b[_0xb31897(0xbf)]++:_0x27e60b[_0xb31897(0x13c)]++;}}return _0x27e60b;}function formatStats(_0x194904){const _0x57ae5d=a38_0x3dc27b;return['Total:\x20'+_0x194904[_0x57ae5d(0x1e9)],'✅\x20'+_0x194904[_0x57ae5d(0xd6)],'❌\x20'+_0x194904[_0x57ae5d(0xfa)],_0x57ae5d(0x18f)+_0x194904[_0x57ae5d(0xbf)],'⏳\x20'+_0x194904[_0x57ae5d(0x13c)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a38_0x3dc27b(0x159)]=a38_0x3dc27b(0x205);[a38_0x3dc27b(0x144)]='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a38_0x3dc27b(0x10e)](_0x2b517b){const _0x1cd028=a38_0x3dc27b,{options:_0x306126,args:_0xcae8d1,tdx:_0x163d7d}=_0x2b517b;let _0x184e18,_0x24d08a,_0xade2fd=![];if(_0xcae8d1[0x0]){if(_0xcae8d1[0x0][_0x1cd028(0xdd)]('.')){const _0x49d7c8=this[_0x1cd028(0x1be)](_0xcae8d1,_0x306126);if(!_0x49d7c8)return 0x1;_0x184e18=_0x49d7c8[_0x1cd028(0x172)],_0x24d08a=_0x49d7c8['workflowName'];}else{_0x24d08a=_0xcae8d1[0x0],_0x184e18=_0x306126[_0x1cd028(0x22b)];if(!_0x184e18)return console[_0x1cd028(0xfa)](a38_0x4e5599[_0x1cd028(0x1a1)]('Error:'),_0x1cd028(0x125)),0x1;_0xade2fd=!![];}}else{const _0xaff4d9=this[_0x1cd028(0x1be)](_0xcae8d1,_0x306126);if(!_0xaff4d9)return 0x1;_0x184e18=_0xaff4d9['projectName'],_0x24d08a=_0xaff4d9[_0x1cd028(0x1ec)];}if(_0x306126['verbose']){if(_0x184e18&&_0x24d08a)console[_0x1cd028(0xfa)]('Filter:\x20'+_0x184e18+'.'+_0x24d08a);else _0x184e18&&console[_0x1cd028(0xfa)](_0x1cd028(0x220)+_0x184e18);}const _0x571bcc=_0x306126[_0x1cd028(0x1c8)],_0x1430bd=_0x306126[_0x1cd028(0x14b)];if(_0x571bcc){_0x1430bd&&console[_0x1cd028(0xfa)](a38_0x4e5599[_0x1cd028(0x1d6)](_0x1cd028(0xf1)),_0x1cd028(0x1ff));const _0x1c6aa5=_0x306126[_0x1cd028(0x210)];return _0x1c6aa5?await this[_0x1cd028(0xf3)](_0x2b517b,_0x571bcc):await this[_0x1cd028(0x11b)](_0x2b517b,_0x571bcc,_0x306126),0x0;}if(_0x1430bd){const _0x12149c=await withSpinner('Loading\x20session...',()=>_0x163d7d['workflow'][_0x1cd028(0x23b)]({'projectName':_0x184e18,'workflowName':_0x24d08a,'limit':0x64}),{'verbose':_0x306126['verbose']}),_0x41e9bb=_0x12149c[_0x1cd028(0x15a)][_0x1cd028(0x1dc)](_0x369adf=>_0x369adf['id']===_0x1430bd);if(!_0x41e9bb)return console['error'](a38_0x4e5599[_0x1cd028(0x1a1)]('Error:'),_0x1cd028(0xc3)+_0x1430bd),0x1;if(!_0x41e9bb[_0x1cd028(0x189)]?.['id'])return console[_0x1cd028(0xfa)](a38_0x4e5599[_0x1cd028(0x1a1)](_0x1cd028(0xbe)),_0x1cd028(0xb7)+_0x1430bd+_0x1cd028(0x183)),0x1;const _0x9fa727=_0x41e9bb[_0x1cd028(0x189)]['id'];_0x306126['verbose']&&console[_0x1cd028(0xfa)](_0x1cd028(0x244)+_0x9fa727+'\x20from\x20session\x20'+_0x1430bd);const _0x2952a4=_0x306126['follow'];return _0x2952a4?await this[_0x1cd028(0xf3)](_0x2b517b,_0x9fa727):await this[_0x1cd028(0x11b)](_0x2b517b,_0x9fa727,_0x306126),0x0;}const _0x447888=await withSpinner(_0x1cd028(0xd9),()=>_0x163d7d[_0x1cd028(0xa1)]['sessions']({'projectName':_0x184e18,'workflowName':_0x24d08a,'limit':_0x306126['limit']||0x32}),{'verbose':_0x306126[_0x1cd028(0x12f)]}),_0x4b1387=_0x447888[_0x1cd028(0x15a)];if(_0x4b1387[_0x1cd028(0x1f2)]===0x0){if(_0x184e18&&_0x24d08a)console['error'](_0x1cd028(0x129)+_0x184e18+'.'+_0x24d08a);else _0x184e18?console['error'](_0x1cd028(0x182)+_0x184e18):(console['error'](_0x1cd028(0xa0)),console[_0x1cd028(0xfa)](a38_0x4e5599[_0x1cd028(0x18c)](_0x1cd028(0x221))));return 0x0;}_0x4b1387['sort']((_0x3d73e2,_0x4f1477)=>{const _0x1b8ada=_0x1cd028,_0x3b4e79=_0x3d73e2[_0x1b8ada(0x1e4)]||'',_0x4b05d8=_0x4f1477[_0x1b8ada(0x1e4)]||'';return _0x4b05d8[_0x1b8ada(0x173)](_0x3b4e79);});if(_0x306126[_0x1cd028(0x130)]||_0x306126[_0x1cd028(0x241)])return await handleSDKOutput(_0x4b1387,_0x306126),0x0;let _0x454d1b;if(_0xade2fd){const _0x4fb0a4=_0x4b1387[0x0];if(!_0x4fb0a4[_0x1cd028(0x189)]?.['id'])return console[_0x1cd028(0xfa)](_0x1cd028(0x104)),0x0;_0x454d1b=_0x4fb0a4[_0x1cd028(0x189)]['id'],_0x306126['verbose']&&console[_0x1cd028(0xfa)]('Auto-selected\x20latest\x20session:\x20'+_0x4fb0a4[_0x1cd028(0x1e4)]);}else{const _0x2b2eec=_0x4b1387[_0x1cd028(0x142)](_0x3d2ec8=>{const _0x5af1db=_0x1cd028,_0x5cb487=getAttemptStatusDisplay(_0x3d2ec8[_0x5af1db(0x189)]);return{'title':_0x3d2ec8[_0x5af1db(0x218)]?.['name']+'.'+_0x3d2ec8['workflow']?.[_0x5af1db(0x159)]+_0x5af1db(0x141)+_0x3d2ec8[_0x5af1db(0x1e4)]+'\x20'+_0x5cb487[_0x5af1db(0x1a6)],'value':_0x3d2ec8['lastAttempt']?.['id']||'','description':_0x5cb487[_0x5af1db(0x16c)]};}),_0x4b7cc0=await a38_0x1916d9({'type':_0x1cd028(0x15e),'name':_0x1cd028(0x1c8),'message':_0x1cd028(0xca),'choices':_0x2b2eec[_0x1cd028(0x1c4)](_0x672d04=>_0x672d04['value']!=='')});if(!_0x4b7cc0['attemptId'])return 0x0;_0x454d1b=_0x4b7cc0['attemptId'];}const _0x389b26=_0x306126[_0x1cd028(0x210)];return _0x389b26?await this[_0x1cd028(0xf3)](_0x2b517b,_0x454d1b):await this[_0x1cd028(0x11b)](_0x2b517b,_0x454d1b,_0x306126),0x0;}async[a38_0x3dc27b(0x11b)](_0x27492c,_0x193688,_0x45dd92){const _0x52aa06=a38_0x3dc27b,{tdx:_0x537d08}=_0x27492c;let _0x7c33c3,_0x157992;try{[_0x7c33c3,_0x157992]=await Promise[_0x52aa06(0x1e1)]([_0x537d08[_0x52aa06(0xa1)][_0x52aa06(0x1fd)](_0x193688),_0x537d08[_0x52aa06(0xa1)][_0x52aa06(0xd0)](_0x193688,![])]);}catch(_0x3c685f){console[_0x52aa06(0xfa)](a38_0x4e5599['red'](_0x52aa06(0x17f)));_0x45dd92[_0x52aa06(0x12f)]&&console[_0x52aa06(0xfa)](_0x3c685f);throw _0x3c685f;}if(_0x45dd92[_0x52aa06(0x130)]||_0x45dd92[_0x52aa06(0x241)]){const _0x101fc3=this['buildTimelineData'](_0x7c33c3,_0x157992);await handleSDKOutput([_0x101fc3],_0x45dd92);return;}const _0x27db84=_0x537d08[_0x52aa06(0x10f)][_0x52aa06(0x1fe)],_0x339758=this[_0x52aa06(0x134)](_0x7c33c3,_0x157992,_0x27db84);console[_0x52aa06(0x184)](_0x339758);}async[a38_0x3dc27b(0xf3)](_0x1acf28,_0x2dac2e){const _0x14e623=a38_0x3dc27b,{tdx:_0x5a9185}=_0x1acf28,_0x3dbc08=TIMELINE_CONFIG[_0x14e623(0x10d)],_0x265f08=TIMELINE_CONFIG[_0x14e623(0x230)];let _0xde80cc=0x0;while(_0xde80cc<_0x265f08){process[_0x14e623(0x115)][_0x14e623(0x18b)]&&process[_0x14e623(0x115)][_0x14e623(0x168)]('\x1bc');let _0x28a25b,_0x45a6ba;try{[_0x28a25b,_0x45a6ba]=await Promise[_0x14e623(0x1e1)]([_0x5a9185[_0x14e623(0xa1)]['attempt'](_0x2dac2e),_0x5a9185[_0x14e623(0xa1)][_0x14e623(0xd0)](_0x2dac2e,![])]);}catch(_0xedc902){console[_0x14e623(0xfa)](a38_0x4e5599[_0x14e623(0x1a1)](_0x14e623(0x153)));_0xde80cc>0x0&&console['error'](a38_0x4e5599[_0x14e623(0x18c)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0xde80cc));throw _0xedc902;}const _0x52700f=_0x5a9185[_0x14e623(0x10f)][_0x14e623(0x1fe)],_0x4915b4=this[_0x14e623(0x134)](_0x28a25b,_0x45a6ba,_0x52700f);console['log'](_0x4915b4);const _0x504f99=_0x28a25b[_0x14e623(0x1c9)]&&_0x45a6ba['every'](_0x31814a=>_0x31814a[_0x14e623(0x102)]!==_0x14e623(0xbf)&&_0x31814a[_0x14e623(0x102)]!=='planned');if(_0x504f99){console['error'](a38_0x4e5599[_0x14e623(0x11a)](_0x14e623(0x127)));break;}console[_0x14e623(0xfa)](a38_0x4e5599[_0x14e623(0x18c)](_0x14e623(0xcb)+_0xde80cc*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x1426ec=>setTimeout(_0x1426ec,_0x3dbc08)),_0xde80cc++;}_0xde80cc>=_0x265f08&&console[_0x14e623(0xfa)](a38_0x4e5599[_0x14e623(0x1d6)](_0x14e623(0x1d0)));}[a38_0x3dc27b(0x134)](_0x1569c4,_0x2b9a27,_0x40315a){const _0x29f51d=a38_0x3dc27b,_0x428913=[],_0x583313=TIMELINE_CONFIG[_0x29f51d(0x10b)],_0x19561a=0x5,_0x313348=process[_0x29f51d(0x115)]['columns']||0x78,_0x4c224f=_0x313348-_0x583313-_0x19561a,_0x2c6e54=Math['max'](TIMELINE_CONFIG['MIN_TIMELINE_WIDTH'],Math[_0x29f51d(0x152)](_0x4c224f,TIMELINE_CONFIG[_0x29f51d(0x1c2)])),_0x464e3e=new Date(_0x1569c4[_0x29f51d(0x1ee)])[_0x29f51d(0x1eb)](),_0x28d6cb=_0x1569c4['finishedAt']?new Date(_0x1569c4[_0x29f51d(0x242)])[_0x29f51d(0x1eb)]():Date['now'](),_0x3712f8={'start':_0x464e3e,'end':_0x28d6cb,'duration':_0x28d6cb-_0x464e3e},_0x53a481=new Map(),_0x193728=[];for(const _0x106b41 of _0x2b9a27){if(_0x106b41['startedAt']){const _0x3294f3=new Date(_0x106b41['startedAt'])[_0x29f51d(0x1eb)](),_0x276c82=_0x106b41[_0x29f51d(0x232)]?new Date(_0x106b41[_0x29f51d(0x232)])['getTime']():Date[_0x29f51d(0x1e5)](),_0x3f0f49={'start':_0x3294f3,'end':_0x276c82,'duration':_0x276c82-_0x3294f3};_0x53a481[_0x29f51d(0xfd)](_0x106b41['id'],_0x3f0f49),_0x193728[_0x29f51d(0x133)]({'name':_0x106b41['fullName'],'state':_0x106b41[_0x29f51d(0x102)]||_0x29f51d(0x239),'window':_0x3f0f49});}else _0x193728['push']({'name':_0x106b41[_0x29f51d(0xce)],'state':_0x106b41[_0x29f51d(0x102)]||_0x29f51d(0xc5),'window':undefined});}_0x193728['sort']((_0x4ae434,_0x5e1d19)=>{const _0x4d3758=_0x29f51d;if(!_0x4ae434[_0x4d3758(0x225)])return 0x1;if(!_0x5e1d19[_0x4d3758(0x225)])return-0x1;return _0x4ae434[_0x4d3758(0x225)]['start']-_0x5e1d19['window']['start'];});const _0x248817=_0x193728[_0x29f51d(0x1f2)],_0x5caa18=_0x248817>TIMELINE_CONFIG[_0x29f51d(0x180)];_0x5caa18&&_0x193728[_0x29f51d(0x23e)](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x3d2487=calculateTimeScale(_0x3712f8,_0x2c6e54),_0x826fe6=_0x1569c4[_0x29f51d(0x1c9)]?_0x1569c4[_0x29f51d(0xd6)]?a38_0x4e5599[_0x29f51d(0x11a)](_0x29f51d(0xd6)):a38_0x4e5599[_0x29f51d(0x1a1)](_0x29f51d(0xfa)):a38_0x4e5599[_0x29f51d(0xc7)](_0x29f51d(0xbf)),_0x3ef4c5=_0x1569c4['project']?.['id'],_0x52cd4a=_0x1569c4['sessionId'];let _0x4a855c;if(_0x3ef4c5&&_0x52cd4a){const _0x33ffef=getWorkflowAttemptUrl(_0x40315a,_0x3ef4c5,_0x52cd4a,_0x1569c4['id']);_0x4a855c=hyperlink(a38_0x4e5599[_0x29f51d(0x18c)](_0x1569c4['id']),_0x33ffef);}else _0x4a855c=a38_0x4e5599[_0x29f51d(0x18c)](_0x1569c4['id']);_0x428913[_0x29f51d(0x133)](_0x29f51d(0x20f)+_0x4a855c+_0x29f51d(0x141)+_0x826fe6+_0x29f51d(0x141)+formatElapsed(_0x3712f8['duration']));if(_0x193728[_0x29f51d(0x1f2)]>0x0){const _0x100abb=renderTimeAxis(_0x3d2487,_0x2c6e54),_0x55ca0d=new Date(_0x3712f8[_0x29f51d(0x166)]),_0x5df0a9=formatDate(_0x55ca0d),_0x3487b4=TIMELINE_CONFIG[_0x29f51d(0x224)]+TIMELINE_CONFIG[_0x29f51d(0x235)]+_0x583313,_0x5b0690=_0x5df0a9[_0x29f51d(0x140)](_0x3487b4),_0x5b216c=a38_0x4e5599[_0x29f51d(0x18c)](_0x5b0690);_0x428913['push'](_0x5b216c+'\x20'+_0x100abb);for(const _0x5da74e of _0x193728){_0x428913[_0x29f51d(0x133)](renderTaskRow(_0x5da74e,_0x3d2487,_0x2c6e54,_0x583313));}const _0x24ad09=calculateStats(_0x193728);_0x428913[_0x29f51d(0x133)](formatStats(_0x24ad09)),_0x5caa18&&_0x428913[_0x29f51d(0x133)](a38_0x4e5599['yellow'](_0x29f51d(0x22f)+TIMELINE_CONFIG[_0x29f51d(0x180)]+_0x29f51d(0x10c)+_0x248817+_0x29f51d(0xcd))),_0x428913[_0x29f51d(0x133)](''),_0x428913[_0x29f51d(0x133)](a38_0x4e5599['dim'](_0x29f51d(0xaa))+(_0x29f51d(0x14f)+_0x1569c4['id']+_0x29f51d(0x21d))+a38_0x4e5599['dim'](_0x29f51d(0x1e3)));}else _0x428913[_0x29f51d(0x133)](_0x29f51d(0x219));return _0x428913[_0x29f51d(0x1d4)]('\x0a');}[a38_0x3dc27b(0xdb)](_0xe5215,_0x1997c6){const _0x2738b6=a38_0x3dc27b,_0x39420d=new Date(_0xe5215['createdAt'])[_0x2738b6(0x1eb)](),_0x53768f=_0xe5215[_0x2738b6(0x242)]?new Date(_0xe5215[_0x2738b6(0x242)])['getTime']():Date[_0x2738b6(0x1e5)](),_0x3086c1=_0x53768f-_0x39420d,_0x57fa93=[];for(const _0x528b1c of _0x1997c6){if(_0x528b1c[_0x2738b6(0x13e)]){const _0xe7ec0=new Date(_0x528b1c[_0x2738b6(0x13e)])[_0x2738b6(0x1eb)](),_0x13cfc5=_0x528b1c[_0x2738b6(0x232)]?new Date(_0x528b1c['updatedAt'])[_0x2738b6(0x1eb)]():Date[_0x2738b6(0x1e5)]();_0x57fa93[_0x2738b6(0x133)]({'name':_0x528b1c[_0x2738b6(0xce)],'state':_0x528b1c[_0x2738b6(0x102)]||_0x2738b6(0x239),'window':{'start':_0xe7ec0,'end':_0x13cfc5,'duration':_0x13cfc5-_0xe7ec0}});}else _0x57fa93['push']({'name':_0x528b1c['fullName'],'state':_0x528b1c[_0x2738b6(0x102)]||'planned','window':undefined});}const _0x50e7df=calculateStats(_0x57fa93);return{'attempt':{'id':_0xe5215['id'],'status':_0xe5215['done']?_0xe5215[_0x2738b6(0xd6)]?'success':'error':_0x2738b6(0xbf),'createdAt':_0xe5215[_0x2738b6(0x1ee)],'finishedAt':_0xe5215[_0x2738b6(0x242)],'duration_ms':_0x3086c1},'tasks':_0x57fa93[_0x2738b6(0x142)](_0x2809e0=>({'name':_0x2809e0[_0x2738b6(0x159)],'state':_0x2809e0[_0x2738b6(0x102)],'startedAt':_0x2809e0[_0x2738b6(0x225)]?new Date(_0x2809e0[_0x2738b6(0x225)]['start'])[_0x2738b6(0x148)]():null,'updatedAt':_0x2809e0[_0x2738b6(0x225)]?new Date(_0x2809e0[_0x2738b6(0x225)][_0x2738b6(0x170)])['toISOString']():null,'duration_ms':_0x2809e0['window']?.['duration']||null})),'stats':_0x50e7df};}}
|
|
1
|
+
const a38_0x2ddcbc=a38_0x3990;(function(_0x148981,_0x5f3ce1){const _0x542c7d=a38_0x3990,_0x194f47=_0x148981();while(!![]){try{const _0x681482=-parseInt(_0x542c7d(0x1c4))/0x1+parseInt(_0x542c7d(0x1ae))/0x2+-parseInt(_0x542c7d(0x174))/0x3*(parseInt(_0x542c7d(0x123))/0x4)+-parseInt(_0x542c7d(0x247))/0x5+parseInt(_0x542c7d(0x136))/0x6+parseInt(_0x542c7d(0x22c))/0x7+parseInt(_0x542c7d(0x246))/0x8;if(_0x681482===_0x5f3ce1)break;else _0x194f47['push'](_0x194f47['shift']());}catch(_0x451368){_0x194f47['push'](_0x194f47['shift']());}}}(a38_0x2d55,0x9b27b));import a38_0x4a6f04 from'chalk';import{existsSync}from'fs';import a38_0x32c9ce 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 a38_0xe1c4 from'prompts';function getAttemptStatusDisplay(_0x2c7006){const _0x2f0e00=a38_0x3990;if(!_0x2c7006)return{'icon':'⏳','text':''};const {done:_0x4f9f0e,success:_0x30b780,cancelRequested:_0x5c90ba}=_0x2c7006;if(!_0x4f9f0e)return _0x5c90ba?{'icon':'🛑','text':a38_0x4a6f04[_0x2f0e00(0x17e)]('canceling')}:{'icon':'🔄','text':a38_0x4a6f04[_0x2f0e00(0x1f4)](_0x2f0e00(0x253))};if(_0x30b780)return{'icon':'✅','text':a38_0x4a6f04[_0x2f0e00(0x240)]('success')};return{'icon':'❌','text':a38_0x4a6f04[_0x2f0e00(0x170)]('error')};}export class WorkflowBaseCommand extends BaseCommand{[a38_0x2ddcbc(0x1d7)](_0x4202f9,_0xca796d,_0x30c15b=0x0){const _0x47866a=a38_0x2ddcbc;return _0x4202f9[_0x30c15b]||_0xca796d[_0x47866a(0x128)];}[a38_0x2ddcbc(0x23e)](_0x41226f,_0x3b07ab,_0x3f71c2=0x0){const _0x3ceb66=a38_0x2ddcbc,_0x267da0=this[_0x3ceb66(0x1d7)](_0x41226f,_0x3b07ab,_0x3f71c2);if(!_0x267da0)return console[_0x3ceb66(0x248)](a38_0x4a6f04[_0x3ceb66(0x170)](_0x3ceb66(0x1ac)),_0x3ceb66(0x28b)),console[_0x3ceb66(0x248)](a38_0x4a6f04[_0x3ceb66(0x25f)](_0x3ceb66(0x24f))),null;return _0x267da0;}['parseProjectWorkflowPattern'](_0x3c590e,_0x415b66){const _0x23d27b=a38_0x2ddcbc;if(_0x3c590e[0x0]){const _0x5a55cc=_0x3c590e[0x0]['split']('.');if(_0x5a55cc[_0x23d27b(0x29c)]===0x1)return{'projectName':_0x5a55cc[0x0],'workflowName':undefined};else return _0x5a55cc[_0x23d27b(0x29c)]===0x2?{'projectName':_0x5a55cc[0x0],'workflowName':_0x5a55cc[0x1]}:(console[_0x23d27b(0x248)](a38_0x4a6f04[_0x23d27b(0x170)]('Error:'),_0x23d27b(0x1b5)),null);}return{'projectName':_0x415b66[_0x23d27b(0x128)],'workflowName':undefined};}[a38_0x2ddcbc(0x2c6)](_0x1353f4,_0x4691da,_0x350797=0x0){const _0x5ea507=a38_0x2ddcbc;if(_0x1353f4[_0x350797])return _0x1353f4[_0x350797];if(_0x4691da[_0x5ea507(0x128)]){const _0x178899=a38_0x32c9ce[_0x5ea507(0x12e)](process[_0x5ea507(0x274)](),_0x5ea507(0x27d),_0x4691da[_0x5ea507(0x128)]);if(existsSync(a38_0x32c9ce[_0x5ea507(0x12e)](_0x178899,_0x5ea507(0x252))))return _0x178899;}return undefined;}async['showWorkflowConsoleUrl'](_0x20725c,_0x5c4418,_0x5f2397){const _0x252e8c=a38_0x2ddcbc;try{const _0x450c2a=await _0x20725c[_0x252e8c(0x21c)]['workflows'](_0x5c4418,{'limit':0x1});if(_0x450c2a[_0x252e8c(0x29c)]>0x0){const _0x5e4b60=_0x450c2a[0x0]['id'],_0x26f4ba=getWorkflowUrl(_0x5f2397,_0x5e4b60);console[_0x252e8c(0x248)](_0x252e8c(0x207)+a38_0x4a6f04[_0x252e8c(0x23b)](_0x26f4ba));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a38_0x2ddcbc(0x28a)]=a38_0x2ddcbc(0x1ce);[a38_0x2ddcbc(0x17d)]=a38_0x2ddcbc(0x211);async[a38_0x2ddcbc(0x249)](_0x25d3d6){const _0x55d414=a38_0x2ddcbc,{options:_0x105cd3,args:_0x4944e1,tdx:_0x504a30}=_0x25d3d6,_0x40fe3a=_0x4944e1[0x0],_0x4e0b0b=_0x105cd3[_0x55d414(0x1fc)];if(_0x4e0b0b)return saveSessionContext({'workflow_project':undefined},_0x105cd3[_0x55d414(0x1aa)]),console[_0x55d414(0x273)](a38_0x4a6f04[_0x55d414(0x240)](_0x55d414(0x190))),0x0;if(!_0x40fe3a)return console[_0x55d414(0x248)](a38_0x4a6f04[_0x55d414(0x170)]('Error:'),_0x55d414(0x28b)),console[_0x55d414(0x248)](a38_0x4a6f04[_0x55d414(0x25f)](_0x55d414(0x297))),console[_0x55d414(0x248)](a38_0x4a6f04['dim'](_0x55d414(0x15d))),0x1;const _0x22c0f7=await withSpinner(_0x55d414(0x1c2)+_0x40fe3a+'\x27...',()=>_0x504a30[_0x55d414(0x21c)][_0x55d414(0x195)](_0x40fe3a),{'verbose':_0x105cd3[_0x55d414(0x11b)]}),{name:_0x643b46}=_0x22c0f7[_0x55d414(0x155)];return saveSessionContext({'workflow_project':_0x643b46},_0x105cd3['session']),console[_0x55d414(0x273)](a38_0x4a6f04[_0x55d414(0x240)](_0x55d414(0x18c)+a38_0x4a6f04[_0x55d414(0x23b)](_0x643b46))),0x0;}}function a38_0x2d55(){const _0x414586=['round','get','Session\x20','\x20\x20Workflow:\x20','/sessions/','from','hasChanges','✔\x20Found\x20','stdout','Analyzing\x20changes...','Using\x20attempt\x20','getTime','message','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','revision','Error:\x20Invalid\x20parameter\x20format:\x20','max','No\x20sessions\x20found\x20in\x20project:\x20','substring','data','fileCount','No\x20matching\x20sessions\x20found','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','sessions','json','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','\x20sessions\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Updating\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x0aUpdate\x20existing\x20project\x20\x22','\x20\x20Session\x20context\x20set\x20to:\x20','kill','relative','MIN_TIMELINE_WIDTH','\x20\x20Files\x20extracted:\x20','value','\x20\x20Source:\x20','map','pullProject','split','Expected\x20format:\x20--param\x20key=value','Error:\x20Invalid\x20JSON\x20in\x20--params','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','workflow:timeline','isNewProject','red','✔\x20Project:\x20','Total:\x20','executeCloneProject','2215749drtLnl','Listing\x20workflow\x20attempts...','workflow:secrets:set','\x20deleted','rows','Dry\x20run:\x20yes','Attempt:\x20','\x22\x20to\x20new\x20project\x20\x22','set','description','yellow','getMinutes','workflow:run','revision:\x20','Loading\x20session...','targetExists','No\x20workflows\x20found\x20in\x20project:\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','toLowerCase','Session\x20time:\x20','\x20\x20Changes:\x20','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','\x20from\x20session\x20','---\x20','✔\x20Workflow\x20project\x20set\x20to:\x20','Source\x20directory\x20is\x20required','some','state','✔\x20Workflow\x20project\x20context\x20cleared.','summary','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Cancelled','Key:\x20','resolveProjectId','isDirectory','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','No\x20workflow\x20sessions\x20found','tdx\x20wf\x20attempt\x20','planned','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','\x22\x20with\x20new\x20revision?','Retrying\x20session...','text','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','No\x20attempts\x20found\x20in\x20project:\x20','\x20has\x20no\x20attempts','session:','icon','\x0aDry\x20run\x20-\x20no\x20files\x20written','done','retryAttempt','Getting\x20attempt\x20details...','workflow:push','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','session','select','Error:','workflow:upload','687646iYAlLE','✔\x20Downloaded\x20','projects','\x20project','run','\x20attempt','MAX_LABEL_COUNT','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Retry\x20a\x20session\x20or\x20attempt','indexOf','ICON_WIDTH','\x0aDry\x20run\x20-\x20nothing\x20pushed','workflow:kill','projectName','MAX_TASKS_DISPLAY','\x0a✔\x20Attempt\x20complete','✔\x20Secret\x20\x27','workflow:pull','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','localeCompare','Resolving\x20project\x20\x27','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','754372wSpejK','sourceProjectName','existingProjectId','prepareCloneProject','status','buildTimelineData','attempt:','session_id','tasks','\x0aDry\x20run\x20-\x20no\x20project\x20created','workflow:use','Listing\x20workflows...','sourceDir','push','floor','Select\x20a\x20session\x20to\x20view\x20timeline:','Attempt\x20ID:\x20','jsonl','fill','resolveProject','\x22?\x20This\x20cannot\x20be\x20undone.','resolve','\x0aApply\x20these\x20changes?','newProjectName','limit','splice','💡\x20Tip:\x20Use\x20','attempts','Task\x20name:\x20','start','\x0a✔\x20Already\x20up\x20to\x20date','basename','resumeFrom','title','follow','retrySession','Resume\x20from:\x20','Failed\x20to\x20fetch\x20attempt\x20data','Select\x20a\x20workflow\x20to\x20run','\x27\x20from\x20project\x20\x27','Project\x20filter:\x20','parse','updatedAt','Pushing\x20workflow\x20project...','Setting\x20secret...','total','Invalid\x20format:\x20','🔄\x20','blue','write','workflow:logs','Files\x20to\x20upload:\x20','Latest\x20session\x20has\x20no\x20attempt','List\x20workflow\x20execution\x20sessions','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','includes','clear','Kill\x20a\x20running\x20attempt','stat','startedAt','slice',',\x20Workflow:\x20','✔\x20Retry\x20started','Filter:\x20project=','canceling','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Output\x20directory:\x20','\x20\x20Console:\x20','LABEL_MIN_SPACING','changes','generateSessionTimelineRows','params','Params:\x20','taskName','Include\x20retried:\x20yes','List\x20workflows','\x0a✔\x20No\x20changes\x20to\x20push','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Target:\x20','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Error:\x20','targetDir','isTTY','task','\x20\x20tdx\x20wf\x20use\x20<project>','workflow:projects','\x20is\x20not\x20a\x20directory','Writing\x20files...','workflow','list','modified','executePushProject','📁\x20','\x20-\x20','match','createdAt','\x20secret','cancelRequested','\x20tasks','workflowName','\x20\x20Project\x20ID:\x20','end','From\x20task:\x20','✔\x20Push\x20complete','3051979zyEtdX','No\x20workflow\x20tdx.json\x20found','getHours','readFile','POLL_INTERVAL_MS','MIN_LABEL_COUNT','\x20\x20Session\x20ID:\x20','Downloading\x20logs...','MAX_TIMELINE_WIDTH','finishedAt','Warning:','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','all','\x20new','cyan','No\x20log\x20files\x20found\x20for\x20this\x20attempt','padStart','requireProject','\x20\x20Attempt\x20ID:\x20','green','includeRetried','setSecret','yes','workflow:tasks','workflow:download','12670896JeAGfF','2195425NTlPkp','error','execute','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','trimEnd','workflow:clone','No\x20workflows\x20found','\x20(use\x20--limit\x20to\x20show\x20more)','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','displayLine','✔\x20Workflow\x20run\x20started','tdx.json','running','filter','new','lastAttempt','dryRun','Loading\x20workflows...','path','skipValidation','Revision:\x20','index','\x20(system)','\x20\x20Project:\x20','dim','Deleting\x20secret...','Project:\x20','toISOString','showWorkflowConsoleUrl','attemptId','sort','Project\x20directory:\x20','\x20\x20New\x20attempt\x20ID:\x20','logFiles','output','\x0aPolling...\x20(','getMonth','✔\x20Pull\x20complete','TASK_NAME_WIDTH','Parameters:\x20','deleteSecret','\x20session','Retrying\x20attempt...','\x20unchanged','log','cwd','table','startTime','Cloning\x20to\x20','Key\x20cannot\x20be\x20empty','columns','type','workflow:workflows','filesExtracted','workflows','diff','\x20of\x20','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','Session\x20not\x20found:\x20','getDate','Error:\x20Secret\x20key\x20is\x20required','applyPullProject','repeat','fullName','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','workflow:delete','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','name','Project\x20name\x20is\x20required','\x20logs','fileSize','has','duration','\x0aFailed\x20to\x20fetch\x20attempt\x20data','MAX_POLL_ITERATIONS','fs/promises','success','✔\x20Project\x20updated','logs','download','Usage:\x20tdx\x20wf\x20use\x20<project>','Analyzing\x20project...','Tip:\x20cd\x20to\x20workflows/','durationMs','Including\x20subtasks:\x20yes','length','Getting\x20attempt\x20tasks...','\x20task','List\x20all\x20workflow\x20projects','New\x20project\x20name:\x20','Fetching\x20log\x20files...','deleted','Status:\x20','projectId','Listing\x20workflow\x20sessions...','No\x20sessions\x20found\x20for:\x20','\x20modified','delete','key','replace','window','context','Select\x20a\x20task\x20to\x20view\x20logs:','\x0aClone\x20\x22','renderTimeline','renderSessionsTimeline','fromTask','List\x20workflow\x20attempts','...','Start\x20a\x20workflow\x20run','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','workflow:sessions','Downloading\x20project\x20','project','(unknown)','group_error','Error:\x20Project\x20name\x20is\x20required','workflow:secrets:list','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','\x1b[1A\x1b[2K','format','Error:\x20Attempt\x20ID\x20is\x20required','Validation:\x20skipped','Pulling\x20project\x20','navigateSessionsInteractive','workflow:attempts','site','resolveProjectDir','size','Source:\x20','verbose','pollTimeline','Force:\x20yes','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','✔\x20Showing\x20','ICON_SPACING','parseProjectWorkflowPattern','min','4gFudGI','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','keys','Loading\x20sessions...','Listing\x20secrets...','workflowProject','find','Source\x20directory:\x20','now','unchanged','Error:\x20KEY=VALUE\x20is\x20required','join','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','Starting\x20workflow\x20run...','force','\x20\x20Revision:\x20','No\x20sessions\x20found','No\x20attempts\x20found','Show\x20tasks\x20for\x20an\x20attempt','1223238Hmsaov','sessionTime','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','startsWith','renderSingleTimeline','\x20\x20Location:\x20','attempt','Source\x20project:\x20','sessionId','pending','No\x20attempts\x20found\x20for:\x20'];a38_0x2d55=function(){return _0x414586;};return a38_0x2d55();}export class WorkflowProjectsCommand extends BaseCommand{[a38_0x2ddcbc(0x28a)]=a38_0x2ddcbc(0x219);[a38_0x2ddcbc(0x17d)]=a38_0x2ddcbc(0x29f);async[a38_0x2ddcbc(0x249)](_0x26032e){const _0x1eff30=a38_0x2ddcbc,{options:_0x12c2ee,args:_0x551737,tdx:_0x1cbc03}=_0x26032e,_0x1fd746=_0x551737[0x0];_0x12c2ee[_0x1eff30(0x11b)]&&_0x1fd746&&console[_0x1eff30(0x248)]('Pattern:\x20'+_0x1fd746);const _0x5a0d74=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x1cbc03[_0x1eff30(0x21c)][_0x1eff30(0x1b0)](_0x1fd746,{'limit':_0x12c2ee['limit']}),{'verbose':_0x12c2ee[_0x1eff30(0x11b)]});let _0x27be92=_0x5a0d74['data'];_0x27be92[_0x1eff30(0x265)]((_0x204de6,_0x5aa377)=>_0x204de6[_0x1eff30(0x28a)][_0x1eff30(0x1c1)](_0x5aa377[_0x1eff30(0x28a)]));const _0x25128c=_0x12c2ee[_0x1eff30(0x1dc)]||0x64,_0x527c0a=_0x27be92[_0x1eff30(0x29c)]>=_0x25128c?a38_0x4a6f04[_0x1eff30(0x25f)](_0x1eff30(0x24e)):'';console[_0x1eff30(0x248)](_0x1eff30(0x148)+_0x27be92[_0x1eff30(0x29c)]+_0x1eff30(0x1b1)+(_0x27be92[_0x1eff30(0x29c)]!==0x1?'s':'')+_0x527c0a);if(_0x12c2ee['format']===_0x1eff30(0x15a)||_0x12c2ee['format']==='jsonl'||_0x12c2ee[_0x1eff30(0x2bf)]===_0x1eff30(0x275))await handleSDKOutput(_0x27be92,_0x12c2ee);else{if(_0x27be92[_0x1eff30(0x29c)]===0x0)_0x1fd746?console[_0x1eff30(0x273)]('No\x20projects\x20match\x20pattern:\x20'+_0x1fd746):console['log']('No\x20workflow\x20projects\x20found');else{const _0x1fd054=_0x27be92[_0x1eff30(0x168)](_0x1d74af=>{const _0xcb8d8=_0x1eff30,_0x1761aa=_0x1d74af['metadata']?.[_0xcb8d8(0x18e)](_0x5e9840=>_0x5e9840[_0xcb8d8(0x2a9)]==='sys'),_0x1282e5=_0x1761aa?a38_0x4a6f04[_0xcb8d8(0x25f)](_0xcb8d8(0x25d)):'';return _0xcb8d8(0x220)+_0x1d74af[_0xcb8d8(0x28a)]+_0x1282e5;});await writeOutput(_0x1fd054[_0x1eff30(0x12e)]('\x0a'),_0x12c2ee['output'],_0x1eff30(0x21d));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a38_0x2ddcbc(0x28a)]=a38_0x2ddcbc(0x27b);[a38_0x2ddcbc(0x17d)]=a38_0x2ddcbc(0x20f);async[a38_0x2ddcbc(0x249)](_0x478bd0){const _0x23a508=a38_0x2ddcbc,{options:_0x8d4dfb,args:_0x250e2b,tdx:_0x28295a}=_0x478bd0,_0x2d3d11=this[_0x23a508(0x1d7)](_0x250e2b,_0x8d4dfb);_0x8d4dfb['verbose']&&_0x2d3d11&&console['error'](_0x23a508(0x1ec)+_0x2d3d11);const _0x64729e=await withSpinner(_0x23a508(0x1cf),()=>_0x28295a[_0x23a508(0x21c)][_0x23a508(0x27d)](_0x2d3d11,{'limit':_0x8d4dfb[_0x23a508(0x1dc)]}),{'verbose':_0x8d4dfb[_0x23a508(0x11b)]});let _0x20ff92=_0x64729e[_0x23a508(0x155)];_0x20ff92['sort']((_0x3a3d23,_0x27c6ab)=>{const _0x2ed351=_0x23a508,_0x73a610=_0x3a3d23[_0x2ed351(0x28a)][_0x2ed351(0x1c1)](_0x27c6ab['name']);if(_0x73a610!==0x0)return _0x73a610;return(_0x3a3d23[_0x2ed351(0x2b8)]?.[_0x2ed351(0x28a)]||'')[_0x2ed351(0x1c1)](_0x27c6ab[_0x2ed351(0x2b8)]?.['name']||'');});const _0x17ea3a=_0x8d4dfb[_0x23a508(0x1dc)]||0x64,_0x25e708=_0x20ff92['length']>=_0x17ea3a?a38_0x4a6f04[_0x23a508(0x25f)](_0x23a508(0x24e)):'';console[_0x23a508(0x248)]('✔\x20Found\x20'+_0x20ff92['length']+'\x20workflow'+(_0x20ff92[_0x23a508(0x29c)]!==0x1?'s':'')+_0x25e708);if(_0x8d4dfb[_0x23a508(0x2bf)]===_0x23a508(0x15a)||_0x8d4dfb[_0x23a508(0x2bf)]===_0x23a508(0x1d5)||_0x8d4dfb[_0x23a508(0x2bf)]===_0x23a508(0x275))await handleSDKOutput(_0x20ff92,_0x8d4dfb);else{if(_0x20ff92[_0x23a508(0x29c)]===0x0)_0x2d3d11?console[_0x23a508(0x273)](_0x23a508(0x184)+_0x2d3d11):console[_0x23a508(0x273)](_0x23a508(0x24d));else{const _0x2fca3e=_0x8d4dfb[_0x23a508(0x2c5)],_0x473aa3=_0x20ff92['map'](_0x493789=>{const _0x4f9563=_0x23a508,_0x3720e1=a38_0x4a6f04[_0x4f9563(0x25f)]('#'+_0x493789['id']),_0x40d255=hyperlink(_0x3720e1,getWorkflowUrl(_0x2fca3e,_0x493789['id'])),_0x12dcfe=_0x493789[_0x4f9563(0x2b8)]?.['name']?a38_0x4a6f04['dim']('\x20('+_0x493789[_0x4f9563(0x2b8)][_0x4f9563(0x28a)]+')'):'';return'📋\x20'+_0x40d255+'\x20'+_0x493789['name']+_0x12dcfe;});await writeOutput(_0x473aa3[_0x23a508(0x12e)]('\x0a'),_0x8d4dfb['output'],_0x23a508(0x21d));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a38_0x2ddcbc(0x28a)]=a38_0x2ddcbc(0x2b6);[a38_0x2ddcbc(0x17d)]=a38_0x2ddcbc(0x1f9);async['execute'](_0x3c379a){const _0x1eaa67=a38_0x2ddcbc,{options:_0x5b1601,args:_0x3d2f80,tdx:_0x3a386d}=_0x3c379a,_0x25a4dc=this[_0x1eaa67(0x121)](_0x3d2f80,_0x5b1601);if(!_0x25a4dc)return 0x1;const {projectName:_0x5a5df7,workflowName:_0x411592}=_0x25a4dc;if(_0x5b1601[_0x1eaa67(0x11b)]){if(_0x5a5df7&&_0x411592)console[_0x1eaa67(0x248)]('Filter:\x20'+_0x5a5df7+'.'+_0x411592);else _0x5a5df7&&console[_0x1eaa67(0x248)](_0x1eaa67(0x203)+_0x5a5df7);const _0x606d88=_0x5b1601['status'];_0x606d88&&console[_0x1eaa67(0x248)](_0x1eaa67(0x2a3)+_0x606d88);}let _0x47dbd7=0x28;if(process[_0x1eaa67(0x149)][_0x1eaa67(0x216)]&&!_0x5b1601[_0x1eaa67(0x269)]&&!_0x5b1601[_0x1eaa67(0x2bf)]){const _0x2da8d2=process['stdout'][_0x1eaa67(0x178)]||0x28;_0x47dbd7=Math[_0x1eaa67(0x152)](0x14,Math[_0x1eaa67(0x1d2)](_0x2da8d2*0x2/0x3));}const _0x1cf72c=_0x5b1601[_0x1eaa67(0x1dc)]||_0x47dbd7,_0xea3838=await withSpinner(_0x1eaa67(0x2a5),()=>_0x3a386d[_0x1eaa67(0x21c)][_0x1eaa67(0x159)]({'projectName':_0x5a5df7,'workflowName':_0x411592,'status':_0x5b1601[_0x1eaa67(0x1c8)],'fromTime':_0x5b1601[_0x1eaa67(0x146)],'toTime':_0x5b1601['to'],'limit':_0x1cf72c}),{'verbose':_0x5b1601[_0x1eaa67(0x11b)]}),_0xb41a5=_0xea3838[_0x1eaa67(0x155)];_0xb41a5['sort']((_0x2c35d8,_0x5eee64)=>{const _0x194396=_0x1eaa67,_0x539ccb=_0x2c35d8[_0x194396(0x137)]||'',_0x10da4c=_0x5eee64[_0x194396(0x137)]||'';return _0x10da4c['localeCompare'](_0x539ccb);});_0xb41a5[_0x1eaa67(0x29c)]>=_0x1cf72c?console[_0x1eaa67(0x248)](_0x1eaa67(0x11f)+_0xb41a5[_0x1eaa67(0x29c)]+_0x1eaa67(0x15c)+a38_0x4a6f04[_0x1eaa67(0x25f)]('(use\x20--limit\x20to\x20see\x20more)')):console['error'](_0x1eaa67(0x148)+_0xb41a5[_0x1eaa67(0x29c)]+_0x1eaa67(0x270)+(_0xb41a5['length']!==0x1?'s':''));if(_0x5b1601[_0x1eaa67(0x2bf)]==='json'||_0x5b1601[_0x1eaa67(0x2bf)]===_0x1eaa67(0x1d5)||_0x5b1601['format']==='table')await handleSDKOutput(_0xb41a5,_0x5b1601);else{if(!process[_0x1eaa67(0x149)][_0x1eaa67(0x216)]||_0x5b1601[_0x1eaa67(0x269)]){if(_0xb41a5[_0x1eaa67(0x29c)]===0x0){if(_0x5a5df7&&_0x411592)console['log'](_0x1eaa67(0x2a6)+_0x5a5df7+'.'+_0x411592);else _0x5a5df7?console[_0x1eaa67(0x273)](_0x1eaa67(0x153)+_0x5a5df7):console[_0x1eaa67(0x273)]('No\x20sessions\x20found');}else{const _0xbc7345=_0x5b1601[_0x1eaa67(0x2c5)],_0x4f9617=this[_0x1eaa67(0x2b0)](_0xb41a5,_0xbc7345);_0x5b1601[_0x1eaa67(0x269)]?await writeOutput(_0x4f9617,_0x5b1601[_0x1eaa67(0x269)],_0x1eaa67(0x21d)):console[_0x1eaa67(0x273)](_0x4f9617);}!_0x5a5df7&&(console[_0x1eaa67(0x248)](''),console[_0x1eaa67(0x248)](a38_0x4a6f04[_0x1eaa67(0x25f)](_0x1eaa67(0x14f))),console[_0x1eaa67(0x248)](a38_0x4a6f04[_0x1eaa67(0x25f)](_0x1eaa67(0x138))+'or'+a38_0x4a6f04[_0x1eaa67(0x25f)](_0x1eaa67(0x218))));}else{if(_0xb41a5[_0x1eaa67(0x29c)]===0x0){if(_0x5a5df7&&_0x411592)console['log'](_0x1eaa67(0x2a6)+_0x5a5df7+'.'+_0x411592);else _0x5a5df7?console[_0x1eaa67(0x273)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x5a5df7):console[_0x1eaa67(0x273)](_0x1eaa67(0x133));}else await this['navigateSessionsInteractive'](_0xb41a5,_0x3c379a,_0x5a5df7);}}return 0x0;}[a38_0x2ddcbc(0x2b0)](_0x5ed4f0,_0x425973){const _0x20525c=a38_0x2ddcbc,_0x5a6898=[],_0x2e1cde=new Map();let _0x21f7a9=Infinity,_0x1656fe=-Infinity;for(const _0x49afaf of _0x5ed4f0){if(_0x49afaf['lastAttempt']?.['createdAt']){const _0x3380eb=new Date(_0x49afaf[_0x20525c(0x256)][_0x20525c(0x223)])[_0x20525c(0x14c)](),_0x4240b2=_0x49afaf[_0x20525c(0x256)]['finishedAt']?new Date(_0x49afaf['lastAttempt'][_0x20525c(0x235)])[_0x20525c(0x14c)]():Date['now'](),_0x1384b0=_0x49afaf[_0x20525c(0x2b8)]?.['name']||_0x20525c(0x2b9);!_0x2e1cde[_0x20525c(0x28e)](_0x1384b0)&&_0x2e1cde[_0x20525c(0x17c)](_0x1384b0,[]),_0x2e1cde[_0x20525c(0x142)](_0x1384b0)['push']({'session':_0x49afaf,'startTime':_0x3380eb,'endTime':_0x4240b2,'duration':_0x4240b2-_0x3380eb}),_0x21f7a9=Math[_0x20525c(0x122)](_0x21f7a9,_0x3380eb),_0x1656fe=Math[_0x20525c(0x152)](_0x1656fe,_0x4240b2);}}if(_0x2e1cde[_0x20525c(0x2c7)]===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0xca15ea=process[_0x20525c(0x149)][_0x20525c(0x279)]||0x78,_0x2cc07b=0x1e,_0x410400=0x32,_0x3009b7=0x4,_0x333f8e=Math[_0x20525c(0x122)](_0x410400,Math['max'](_0x2cc07b,Math[_0x20525c(0x1d2)](_0xca15ea*0.3))),_0x3fc483=_0xca15ea-_0x333f8e-TIMELINE_CONFIG['GUTTER']-0x3-_0x3009b7,_0x171689=_0x1656fe-_0x21f7a9,_0x1101bf=_0x171689/_0x333f8e,_0x1f40e7=renderTimeAxis({'startTime':_0x21f7a9,'endTime':_0x1656fe,'durationMs':_0x171689,'msPerChar':_0x1101bf},_0x333f8e),_0x58cb0a=[];for(const _0xa55269 of _0x2e1cde['values']()){_0x58cb0a[_0x20525c(0x1d1)](..._0xa55269);}_0x58cb0a[_0x20525c(0x265)]((_0x584917,_0x34bfd1)=>_0x34bfd1['startTime']-_0x584917[_0x20525c(0x276)]);const _0x133516=new Date(_0x21f7a9),_0x1ea2df=formatDate(_0x133516),_0x4c7923=_0x3009b7+TIMELINE_CONFIG[_0x20525c(0x1b8)]+TIMELINE_CONFIG[_0x20525c(0x120)]+_0x3fc483,_0x1717d6='\x20'[_0x20525c(0x285)](_0x4c7923-_0x1ea2df['length']),_0x1bad3e=_0x1717d6+a38_0x4a6f04['dim'](_0x1ea2df)+'\x20'+_0x1f40e7;_0x5a6898['push'](_0x1bad3e);const _0x2fd3bb=0x16;let _0x528799=0x0;for(const _0x163626 of _0x58cb0a){const _0x53b04a=_0x163626['session'][_0x20525c(0x2b8)]?.[_0x20525c(0x28a)]||'?',_0xf700c6=Math[_0x20525c(0x122)](stringWidth(_0x53b04a),_0x2fd3bb);_0x528799=Math[_0x20525c(0x152)](_0x528799,_0xf700c6);}for(const _0x350e49 of _0x58cb0a){const {session:_0x1e8d8a,startTime:_0x4a79d9,endTime:_0x32eae1,duration:_0xcb79fd}=_0x350e49,_0x3dc598=_0x1e8d8a[_0x20525c(0x2b8)]?.['id'],_0x5e5356=_0x1e8d8a['id'],_0x10bcdf=_0x1e8d8a[_0x20525c(0x2b8)]?.[_0x20525c(0x28a)]||'?',_0x427a0c=_0x1e8d8a[_0x20525c(0x21c)]?.['name']||'?';let _0x3f9ac4,_0x53b564;if(_0x1e8d8a[_0x20525c(0x256)]){const _0x47c89c=_0x1e8d8a[_0x20525c(0x256)];!_0x47c89c[_0x20525c(0x1a5)]?(_0x3f9ac4=_0x47c89c[_0x20525c(0x225)]?'🛑':'🔄',_0x53b564=_0x47c89c[_0x20525c(0x225)]?a38_0x4a6f04[_0x20525c(0x17e)]:a38_0x4a6f04['blue']):(_0x3f9ac4=_0x47c89c['success']?'✅':'❌',_0x53b564=_0x47c89c[_0x20525c(0x293)]?a38_0x4a6f04[_0x20525c(0x240)]:a38_0x4a6f04[_0x20525c(0x170)]);}else _0x3f9ac4='⏳',_0x53b564=a38_0x4a6f04[_0x20525c(0x25f)];const _0x5389b3='#'+_0x5e5356,_0x296308=_0x3dc598?hyperlink(_0x5389b3,getWorkflowSessionUrl(_0x425973,_0x3dc598,_0x5e5356)):_0x5389b3;let _0x1b9c66=_0x10bcdf;stringWidth(_0x10bcdf)>_0x2fd3bb&&(_0x1b9c66=_0x10bcdf['slice'](0x0,_0x2fd3bb-0x1)+'…');const _0x5a7d3c=a38_0x4a6f04[_0x20525c(0x25f)](_0x1b9c66),_0x633c3e=stringWidth(_0x1b9c66),_0x39d280='\x20'['repeat'](_0x528799-stringWidth(_0x1b9c66)+0x2),_0x38b9dc='('+formatElapsed(_0xcb79fd)+')',_0x9f1dd6=stringWidth(_0x38b9dc),_0x2b960f=stringWidth(_0x5389b3),_0x457ab1=_0x2b960f+0x1+_0x633c3e+_0x39d280[_0x20525c(0x29c)],_0x4c1dda=_0x3fc483-_0x457ab1-_0x9f1dd6-0x1-0x8;let _0x4a92f7=_0x427a0c;stringWidth(_0x4a92f7)>_0x4c1dda&&(_0x4a92f7=_0x4a92f7[_0x20525c(0x200)](0x0,_0x4c1dda-0x1)+'…');const _0x5f00aa=_0x296308+'\x20'+_0x5a7d3c+_0x39d280+_0x4a92f7,_0x13e31e=stringWidth(_0x5f00aa),_0x5d582b=_0x3fc483-_0x13e31e-_0x9f1dd6,_0x35c769=_0x5f00aa+'\x20'[_0x20525c(0x285)](Math['max'](0x1,_0x5d582b))+a38_0x4a6f04[_0x20525c(0x25f)](_0x38b9dc),_0x12d54e=Math[_0x20525c(0x1d2)]((_0x4a79d9-_0x21f7a9)/_0x1101bf),_0x493438=Math['floor']((_0x32eae1-_0x21f7a9)/_0x1101bf),_0x3b78aa=Math[_0x20525c(0x152)](_0x12d54e+0x1,_0x493438),_0x81c76c=new Array(_0x333f8e)[_0x20525c(0x1d6)]('\x20');for(let _0x2ff7f8=_0x12d54e;_0x2ff7f8<Math[_0x20525c(0x122)](_0x3b78aa,_0x333f8e);_0x2ff7f8++){_0x81c76c[_0x2ff7f8]='─';}const _0x4035d4=_0x81c76c[_0x20525c(0x168)](_0x2a17a0=>_0x2a17a0==='\x20'?'\x20':_0x53b564(_0x2a17a0))['join']('');_0x5a6898['push'](_0x3f9ac4+'\x20'+_0x35c769+'│'+_0x4035d4+'│');}return _0x5a6898[_0x20525c(0x12e)]('\x0a');}async[a38_0x2ddcbc(0x2c3)](_0x51349b,_0x58cdb6,_0x5b4601){const _0x28f846=a38_0x2ddcbc,{options:_0x5a9b69,tdx:_0x5d9192}=_0x58cdb6,_0x1a2033=_0x5a9b69['site'],{timelineRows:_0x398055,timeAxisHeader:_0x4516cf}=this[_0x28f846(0x20a)](_0x51349b,_0x1a2033),_0x303be1=_0x398055['filter'](_0xef5453=>_0xef5453[_0x28f846(0x264)]);if(_0x303be1[_0x28f846(0x29c)]===0x0){const _0x37b0d1=this[_0x28f846(0x2b0)](_0x51349b,_0x1a2033);console[_0x28f846(0x273)](_0x37b0d1);!_0x5b4601&&(console[_0x28f846(0x248)](''),console[_0x28f846(0x248)](a38_0x4a6f04[_0x28f846(0x25f)](_0x28f846(0x14f))),console[_0x28f846(0x248)](a38_0x4a6f04[_0x28f846(0x25f)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a38_0x4a6f04[_0x28f846(0x25f)](_0x28f846(0x218))));return;}_0x4516cf&&console['log'](_0x4516cf);const _0x3d6bb8=_0x398055[_0x28f846(0x254)](_0x38f1ba=>_0x38f1ba[_0x28f846(0x264)])['map'](_0x5ccc9c=>({'title':_0x5ccc9c[_0x28f846(0x250)],'value':_0x5ccc9c[_0x28f846(0x264)]})),_0x46a53c=process[_0x28f846(0x149)][_0x28f846(0x178)]||0x3c,_0x40ad92=Math[_0x28f846(0x152)](0x28,Math['floor'](_0x46a53c*0x2/0x3)),_0x4c4ca7=await a38_0xe1c4({'type':'autocomplete','name':_0x28f846(0x264),'message':_0x28f846(0x2bd),'choices':_0x3d6bb8,'initial':-0x1,'limit':_0x40ad92,'clearFirst':!![],'fallback':{'title':_0x28f846(0x157),'value':null},'suggest':(_0x51eb43,_0x64ae8)=>{const _0x4bd625=_0x28f846;if(!_0x51eb43)return Promise[_0x4bd625(0x1d9)](_0x64ae8);const _0x377a6f=_0x64ae8[_0x4bd625(0x254)](_0x434b42=>{const _0x221458=_0x4bd625,_0x41544c=_0x434b42;return _0x41544c[_0x221458(0x1e5)]['toLowerCase']()[_0x221458(0x1fb)](_0x51eb43[_0x221458(0x186)]());});return Promise[_0x4bd625(0x1d9)](_0x377a6f);}}),_0x23826d=()=>{const _0x27606a=_0x28f846;process['stdout'][_0x27606a(0x1f5)](_0x27606a(0x2be)),process[_0x27606a(0x149)]['write']('\x1b[1A\x1b[2K'),process[_0x27606a(0x149)][_0x27606a(0x1f5)](_0x27606a(0x2be));},_0x11b90b=_0x4c4ca7&&_0x4c4ca7[_0x28f846(0x264)]&&_0x4c4ca7[_0x28f846(0x264)]!==null&&_0x4c4ca7[_0x28f846(0x264)]['trim']()!=='';if(!_0x11b90b){_0x23826d(),console[_0x28f846(0x273)](a38_0x4a6f04['dim'](_0x28f846(0x193)));return;}_0x23826d();const _0x16852c=_0x51349b['find'](_0x3659c5=>_0x3659c5[_0x28f846(0x256)]?.['id']===_0x4c4ca7[_0x28f846(0x264)]);if(_0x16852c){const _0x1282ff=_0x16852c[_0x28f846(0x2b8)]?.['name']||'?',_0x56cfd0=_0x16852c[_0x28f846(0x21c)]?.['name']||'?';console[_0x28f846(0x273)](_0x28f846(0x261)+a38_0x4a6f04['dim'](_0x1282ff)+_0x28f846(0x201)+a38_0x4a6f04[_0x28f846(0x25f)](_0x56cfd0));}const _0x110469=new WorkflowTimelineCommand();await _0x110469[_0x28f846(0x249)]({'args':[],'options':{..._0x5a9b69,'attemptId':_0x4c4ca7['attemptId']},'tdx':_0x5d9192});}[a38_0x2ddcbc(0x20a)](_0x4b93ea,_0x447203){const _0x110aab=a38_0x2ddcbc,_0x4ea194=new Map();for(const _0x75d94a of _0x4b93ea){_0x75d94a['id']&&_0x75d94a['lastAttempt']?.['id']&&_0x4ea194[_0x110aab(0x17c)](_0x75d94a['id'],_0x75d94a[_0x110aab(0x256)]['id']);}const _0x5b6f3d=[];let _0x352440='';const _0xaf4ff4=this[_0x110aab(0x2b0)](_0x4b93ea,_0x447203),_0x24ac95=_0xaf4ff4[_0x110aab(0x16a)]('\x0a');for(const _0xf081e3 of _0x24ac95){if(_0xf081e3[_0x110aab(0x139)](_0x110aab(0x158))||_0xf081e3[_0x110aab(0x222)](/^\s+\d{4}-\d{2}-\d{2}/))_0x352440=_0xf081e3;else{if(_0xf081e3[_0x110aab(0x222)](/^[✅❌🔄🛑⏳]/)){const _0x258f88=_0xf081e3[_0x110aab(0x222)](/#(\d+)/),_0x219b9e=_0x258f88?_0x258f88[0x1]:null,_0x3e97f5=_0x219b9e?_0x4ea194['get'](_0x219b9e)||null:null,_0xa0bfcc=_0x4b93ea[_0x110aab(0x129)](_0x315d02=>_0x315d02['id']===_0x219b9e),_0x5c70b1=_0xa0bfcc?.[_0x110aab(0x2b8)]?.[_0x110aab(0x28a)]||'';_0x5b6f3d[_0x110aab(0x1d1)]({'displayLine':_0xf081e3,'attemptId':_0x3e97f5,'projectName':_0x5c70b1});}}}return{'timelineRows':_0x5b6f3d,'timeAxisHeader':_0x352440};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']=a38_0x2ddcbc(0x2c4);[a38_0x2ddcbc(0x17d)]=a38_0x2ddcbc(0x2b2);async[a38_0x2ddcbc(0x249)](_0x392f12){const _0x3ae764=a38_0x2ddcbc,{options:_0x42c11c,args:_0x59bf80,tdx:_0x422893}=_0x392f12,_0x3b123d=this['parseProjectWorkflowPattern'](_0x59bf80,_0x42c11c);if(!_0x3b123d)return 0x1;const {projectName:_0x16273c,workflowName:_0x5b6c44}=_0x3b123d,_0xd457a8=_0x42c11c[_0x3ae764(0x241)];if(_0x42c11c['verbose']){if(_0x16273c&&_0x5b6c44)console[_0x3ae764(0x248)]('Filter:\x20'+_0x16273c+'.'+_0x5b6c44);else _0x16273c&&console['error'](_0x3ae764(0x203)+_0x16273c);_0xd457a8&&console[_0x3ae764(0x248)](_0x3ae764(0x20e));}const _0x4bb4ee=await withSpinner(_0x3ae764(0x175),()=>_0x422893[_0x3ae764(0x21c)][_0x3ae764(0x1df)]({'projectName':_0x16273c,'workflowName':_0x5b6c44,'includeRetried':_0xd457a8,'limit':_0x42c11c['limit']}),{'verbose':_0x42c11c[_0x3ae764(0x11b)]}),_0x2177f3=_0x4bb4ee[_0x3ae764(0x155)],_0xa93309=_0x42c11c[_0x3ae764(0x1dc)]||0x64,_0x11fd6a=_0x2177f3[_0x3ae764(0x29c)]>=_0xa93309?a38_0x4a6f04['dim'](_0x3ae764(0x24e)):'';console['error']('✔\x20Found\x20'+_0x2177f3[_0x3ae764(0x29c)]+_0x3ae764(0x1b3)+(_0x2177f3[_0x3ae764(0x29c)]!==0x1?'s':'')+_0x11fd6a);if(_0x42c11c['format']==='json'||_0x42c11c[_0x3ae764(0x2bf)]===_0x3ae764(0x1d5)||_0x42c11c[_0x3ae764(0x2bf)]==='table')await handleSDKOutput(_0x2177f3,_0x42c11c);else{if(_0x2177f3['length']===0x0){if(_0x16273c&&_0x5b6c44)console[_0x3ae764(0x273)](_0x3ae764(0x140)+_0x16273c+'.'+_0x5b6c44);else _0x16273c?console[_0x3ae764(0x273)](_0x3ae764(0x1a0)+_0x16273c):console[_0x3ae764(0x273)](_0x3ae764(0x134));}else{const _0x55b9e2=_0x42c11c[_0x3ae764(0x2c5)],_0xf321b7=_0x2177f3[_0x3ae764(0x168)](_0x3ba29e=>{const _0x1a92a7=_0x3ae764,_0x4ed145=a38_0x4a6f04[_0x1a92a7(0x25f)]('#'+_0x3ba29e['id']),_0x3a0ee6=_0x3ba29e['project']?.['id'],_0x26fcab=_0x3ba29e[_0x1a92a7(0x1cb)]||_0x3ba29e[_0x1a92a7(0x13e)],_0x12c970=_0x3a0ee6&&_0x26fcab?hyperlink(_0x4ed145,getWorkflowAttemptUrl(_0x55b9e2,_0x3a0ee6,_0x26fcab,_0x3ba29e['id'])):_0x4ed145,{icon:_0x2df710,text:_0x2a5d40}=getAttemptStatusDisplay(_0x3ba29e),_0x39d0=(_0x3ba29e[_0x1a92a7(0x2b8)]?.[_0x1a92a7(0x28a)]||'?')+'.'+(_0x3ba29e['workflow']?.[_0x1a92a7(0x28a)]||'?'),_0x152fac=_0x3ba29e[_0x1a92a7(0x137)]?a38_0x4a6f04['dim'](_0x3ba29e[_0x1a92a7(0x137)]):'';return(_0x12c970+'\x20'+_0x2df710+(_0x2a5d40?'\x20'+_0x2a5d40:'')+'\x20'+_0x39d0+'\x20'+_0x152fac)[_0x1a92a7(0x24b)]();});await writeOutput(_0xf321b7[_0x3ae764(0x12e)]('\x0a'),_0x42c11c['output'],_0x3ae764(0x21d));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']='workflow:attempt';[a38_0x2ddcbc(0x17d)]='Show\x20specific\x20attempt\x20details';async[a38_0x2ddcbc(0x249)](_0x243300){const _0x7efee2=a38_0x2ddcbc,{options:_0x453a0b,args:_0x3615f9,tdx:_0x59edda}=_0x243300,_0x2e399f=_0x3615f9[0x0];if(!_0x2e399f)return console['error'](_0x7efee2(0x2c0)),0x1;_0x453a0b[_0x7efee2(0x11b)]&&console['error'](_0x7efee2(0x1d4)+_0x2e399f);const _0x72d236=await withSpinner(_0x7efee2(0x1a7),()=>_0x59edda[_0x7efee2(0x21c)]['attempt'](_0x2e399f),{'verbose':_0x453a0b[_0x7efee2(0x11b)]}),_0x533e98=_0x72d236[_0x7efee2(0x155)];let _0x15cd55;!_0x533e98[_0x7efee2(0x1a5)]?_0x15cd55=_0x533e98['cancelRequested']?_0x7efee2(0x204):_0x7efee2(0x253):_0x15cd55=_0x533e98[_0x7efee2(0x293)]?_0x7efee2(0x293):_0x7efee2(0x248);let _0x5107d0;if(_0x533e98[_0x7efee2(0x223)]&&_0x533e98[_0x7efee2(0x235)]){const _0x19eecf=new Date(_0x533e98[_0x7efee2(0x223)])[_0x7efee2(0x14c)](),_0x5a0482=new Date(_0x533e98['finishedAt'])[_0x7efee2(0x14c)]();_0x5107d0=Math[_0x7efee2(0x141)]((_0x5a0482-_0x19eecf)/0x3e8);}const _0x4a44b5={'attempt_id':_0x533e98['id'],'status':_0x15cd55,..._0x533e98[_0x7efee2(0x25c)]!==undefined&&{'index':_0x533e98[_0x7efee2(0x25c)]},..._0x533e98[_0x7efee2(0x2b8)]&&{'project':_0x533e98[_0x7efee2(0x2b8)][_0x7efee2(0x28a)]},..._0x533e98[_0x7efee2(0x21c)]&&{'workflow':_0x533e98[_0x7efee2(0x21c)][_0x7efee2(0x28a)]},..._0x533e98[_0x7efee2(0x13e)]&&{'session_id':_0x533e98[_0x7efee2(0x13e)]},..._0x533e98['sessionTime']&&{'session_time':_0x533e98[_0x7efee2(0x137)]},..._0x533e98['retryAttemptName']&&{'retry_attempt':_0x533e98['retryAttemptName']},..._0x5107d0!==undefined&&{'duration_sec':_0x5107d0},..._0x533e98[_0x7efee2(0x223)]&&{'created_at':_0x533e98['createdAt']},..._0x533e98['finishedAt']&&{'finished_at':_0x533e98[_0x7efee2(0x235)]},...Object[_0x7efee2(0x125)](_0x533e98[_0x7efee2(0x20b)])[_0x7efee2(0x29c)]>0x0&&{'params':_0x533e98[_0x7efee2(0x20b)]}};return await handleSingleObjectOutput(_0x4a44b5,_0x453a0b),0x0;}}function a38_0x3990(_0x8cb4da,_0x366c48){_0x8cb4da=_0x8cb4da-0x11b;const _0x2d5586=a38_0x2d55();let _0x399014=_0x2d5586[_0x8cb4da];return _0x399014;}export class WorkflowTasksCommand extends BaseCommand{[a38_0x2ddcbc(0x28a)]=a38_0x2ddcbc(0x244);[a38_0x2ddcbc(0x17d)]=a38_0x2ddcbc(0x135);async[a38_0x2ddcbc(0x249)](_0xf68976){const _0x5b2456=a38_0x2ddcbc,{options:_0x35ca3c,args:_0x55c919,tdx:_0x11d580}=_0xf68976,_0x5cb866=_0x55c919[0x0];if(!_0x5cb866)return console[_0x5b2456(0x248)](_0x5b2456(0x2c0)),0x1;const _0x499d51=_0x35ca3c['includeSubtasks'];_0x35ca3c[_0x5b2456(0x11b)]&&(console[_0x5b2456(0x248)](_0x5b2456(0x1d4)+_0x5cb866),_0x499d51&&console[_0x5b2456(0x248)](_0x5b2456(0x29b)));const _0x4d8714=await withSpinner(_0x5b2456(0x29d),()=>_0x11d580[_0x5b2456(0x21c)][_0x5b2456(0x1cc)](_0x5cb866,_0x499d51||![]),{'verbose':_0x35ca3c[_0x5b2456(0x11b)]}),_0x1a6f01=_0x4d8714['data'];return console[_0x5b2456(0x248)](_0x5b2456(0x148)+_0x1a6f01[_0x5b2456(0x29c)]+_0x5b2456(0x29e)+(_0x1a6f01[_0x5b2456(0x29c)]!==0x1?'s':'')),await handleSDKOutput(_0x1a6f01,_0x35ca3c),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a38_0x2ddcbc(0x28a)]=a38_0x2ddcbc(0x1f6);['description']='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async['execute'](_0x1fca6e){const _0x23b5e7=a38_0x2ddcbc,{options:_0x2ea93e,args:_0x3b369f,tdx:_0x2fb363}=_0x1fca6e,_0x4e4b4a=_0x3b369f[0x0];let _0xef69f8=_0x3b369f[0x1];if(!_0x4e4b4a)return console['error'](_0x23b5e7(0x2c0)),0x1;_0x2ea93e[_0x23b5e7(0x11b)]&&(console['error']('Attempt\x20ID:\x20'+_0x4e4b4a),_0xef69f8&&console[_0x23b5e7(0x248)](_0x23b5e7(0x1e0)+_0xef69f8));const _0x344287=await withSpinner(_0x23b5e7(0x2a1),()=>_0x2fb363[_0x23b5e7(0x21c)][_0x23b5e7(0x268)](_0x4e4b4a,_0xef69f8),{'verbose':_0x2ea93e[_0x23b5e7(0x11b)]}),_0x3d8aa9=_0x344287[_0x23b5e7(0x155)];if(_0x3d8aa9[_0x23b5e7(0x29c)]===0x0)return console[_0x23b5e7(0x248)](_0x23b5e7(0x23c)),0x0;if(!_0xef69f8&&(_0x2ea93e[_0x23b5e7(0x15a)]||_0x2ea93e[_0x23b5e7(0x2bf)]))return await handleSDKOutput(_0x3d8aa9,_0x2ea93e),0x0;if(!_0xef69f8){const _0xf34e8=_0x3d8aa9['map'](_0x2d4b65=>({'title':_0x2d4b65[_0x23b5e7(0x20d)]+'\x20('+formatBytes(_0x2d4b65[_0x23b5e7(0x28d)])+')','value':_0x2d4b65[_0x23b5e7(0x20d)]})),_0x1ab746=await a38_0xe1c4({'type':'select','name':_0x23b5e7(0x217),'message':_0x23b5e7(0x2ad),'choices':_0xf34e8});if(!_0x1ab746[_0x23b5e7(0x217)])return console['error']('Cancelled'),0x0;_0xef69f8=_0x1ab746[_0x23b5e7(0x217)];}const _0x4ed79f=await withSpinner(_0x23b5e7(0x233),()=>_0x2fb363[_0x23b5e7(0x21c)][_0x23b5e7(0x295)](_0x4e4b4a,_0xef69f8),{'verbose':_0x2ea93e[_0x23b5e7(0x11b)]}),_0x441377=_0x4ed79f['data'];return _0x441377?console[_0x23b5e7(0x273)](_0x441377):console[_0x23b5e7(0x248)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{['name']=a38_0x2ddcbc(0x1ba);['description']=a38_0x2ddcbc(0x1fd);async[a38_0x2ddcbc(0x249)](_0x527ad7){const _0x4d762a=a38_0x2ddcbc,{options:_0x25bd4e,args:_0x3a2b53,tdx:_0x3acdbe}=_0x527ad7,_0x5ca346=_0x3a2b53[0x0];if(!_0x5ca346)return console[_0x4d762a(0x248)](_0x4d762a(0x2c0)),0x1;const _0x209bb1=_0x25bd4e['reason'];_0x25bd4e[_0x4d762a(0x11b)]&&(console[_0x4d762a(0x248)](_0x4d762a(0x1d4)+_0x5ca346),_0x209bb1&&console[_0x4d762a(0x248)]('Reason:\x20'+_0x209bb1));if(!_0x25bd4e['yes']){const _0xfe80d2=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x5ca346+'?');if(!_0xfe80d2)return console[_0x4d762a(0x248)](_0x4d762a(0x193)),0x0;}const _0x4f5262=await withSpinner('Killing\x20attempt...',()=>_0x3acdbe['workflow'][_0x4d762a(0x162)](_0x5ca346,_0x209bb1),{'verbose':_0x25bd4e[_0x4d762a(0x11b)]}),_0x51d758=_0x4f5262['data'];return console[_0x4d762a(0x248)]('✔\x20'+_0x51d758),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a38_0x2ddcbc(0x28a)]='workflow:retry';['description']=a38_0x2ddcbc(0x1b6);async[a38_0x2ddcbc(0x249)](_0x22be46){const _0x292086=a38_0x2ddcbc,{options:_0x54cc1d,args:_0x895a9f,tdx:_0x19d249}=_0x22be46,_0x204a1b=_0x895a9f[0x0];if(!_0x204a1b)return console[_0x292086(0x248)](_0x292086(0x19b)),console[_0x292086(0x248)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x3dc8b=![],_0x513207=_0x204a1b;if(_0x204a1b[_0x292086(0x139)](_0x292086(0x1a2)))_0x3dc8b=!![],_0x513207=_0x204a1b[_0x292086(0x154)](0x8);else{if(_0x204a1b[_0x292086(0x139)](_0x292086(0x1ca)))_0x3dc8b=![],_0x513207=_0x204a1b['substring'](0x8);else return console[_0x292086(0x248)](_0x292086(0x15f)),console[_0x292086(0x248)](_0x292086(0x1fa)),0x1;}const _0x27f37a=_0x54cc1d[_0x292086(0x2b1)],_0x472d79=_0x54cc1d[_0x292086(0x1e4)],_0xf50f16=_0x54cc1d[_0x292086(0x20b)],_0x5b3076=_0x54cc1d[_0x292086(0x131)];_0x54cc1d[_0x292086(0x11b)]&&(console[_0x292086(0x248)](_0x292086(0x212)+(_0x3dc8b?_0x292086(0x1aa):_0x292086(0x13c))+'\x20'+_0x513207),_0x27f37a&&console[_0x292086(0x248)](_0x292086(0x22a)+_0x27f37a),_0x472d79&&console[_0x292086(0x248)](_0x292086(0x1e8)+_0x472d79),_0xf50f16&&console[_0x292086(0x248)](_0x292086(0x20c)+_0xf50f16),_0x5b3076&&console[_0x292086(0x248)](_0x292086(0x11d)));let _0x337a02;if(_0xf50f16)try{if(_0xf50f16['startsWith']('@')){const _0x5c9dae=await import(_0x292086(0x292)),_0x20cfa2=_0xf50f16['substring'](0x1),_0x176f00=await _0x5c9dae[_0x292086(0x22f)](_0x20cfa2,'utf-8');_0x337a02=JSON[_0x292086(0x1ed)](_0x176f00);}else _0x337a02=JSON[_0x292086(0x1ed)](_0xf50f16);}catch{return console['error'](_0x292086(0x16c)),0x1;}if(!_0x54cc1d[_0x292086(0x243)]){const _0x246ea6=await confirmKey(_0x292086(0x197)+(_0x3dc8b?_0x292086(0x1aa):_0x292086(0x13c))+'\x20'+_0x513207+'?');if(!_0x246ea6)return console['error']('Cancelled'),0x0;}let _0x14786c;_0x3dc8b?_0x14786c=await withSpinner(_0x292086(0x19d),()=>_0x19d249[_0x292086(0x21c)][_0x292086(0x1e7)](_0x513207,{'fromTask':_0x27f37a,'retryParams':_0x337a02}),{'verbose':_0x54cc1d[_0x292086(0x11b)]}):_0x14786c=await withSpinner(_0x292086(0x271),()=>_0x19d249['workflow'][_0x292086(0x1a6)](_0x513207,{'resumeFrom':_0x472d79,'retryParams':_0x337a02,'force':_0x5b3076}),{'verbose':_0x54cc1d[_0x292086(0x11b)]});const _0x4e8408=_0x14786c[_0x292086(0x155)];return console[_0x292086(0x248)](_0x292086(0x202)),console['error'](_0x292086(0x267)+_0x4e8408[_0x292086(0x264)]),console[_0x292086(0x248)](_0x292086(0x232)+_0x4e8408[_0x292086(0x13e)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a38_0x2ddcbc(0x180);['description']=a38_0x2ddcbc(0x2b4);async[a38_0x2ddcbc(0x249)](_0x46db46){const _0xba8c3c=a38_0x2ddcbc,{options:_0x12a9be,args:_0x354c96,tdx:_0xe8a9ce}=_0x46db46;let _0x2cfc0d=_0x354c96[0x0];if(!_0x2cfc0d){const _0x30fcb4=this[_0xba8c3c(0x1d7)]([],_0x12a9be),_0x57891d=await withSpinner(_0xba8c3c(0x258),()=>_0xe8a9ce['workflow'][_0xba8c3c(0x27d)](_0x30fcb4,{'limit':_0x12a9be['limit']}),{'verbose':_0x12a9be[_0xba8c3c(0x11b)]}),_0x5bb227=_0x57891d[_0xba8c3c(0x155)];if(_0x5bb227[_0xba8c3c(0x29c)]===0x0)return console['error'](_0xba8c3c(0x24d)),!_0x30fcb4&&console['error'](a38_0x4a6f04[_0xba8c3c(0x25f)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x43597e=_0x5bb227[_0xba8c3c(0x168)](_0x59a396=>({'title':_0x59a396[_0xba8c3c(0x2b8)]?.[_0xba8c3c(0x28a)]+'.'+_0x59a396['name'],'value':_0x59a396[_0xba8c3c(0x2b8)]?.[_0xba8c3c(0x28a)]+'.'+_0x59a396[_0xba8c3c(0x28a)],'description':_0x59a396[_0xba8c3c(0x150)]?_0xba8c3c(0x181)+_0x59a396[_0xba8c3c(0x150)]:undefined})),_0x519bd4=await a38_0xe1c4({'type':_0xba8c3c(0x1ab),'name':_0xba8c3c(0x21c),'message':_0xba8c3c(0x1ea),'choices':_0x43597e});if(!_0x519bd4[_0xba8c3c(0x21c)])return 0x1;_0x2cfc0d=_0x519bd4[_0xba8c3c(0x21c)];}if(!_0x2cfc0d['includes']('.')){const _0xf7a889=this[_0xba8c3c(0x1d7)]([],_0x12a9be);if(_0xf7a889)_0x2cfc0d=_0xf7a889+'.'+_0x2cfc0d;else return console[_0xba8c3c(0x248)](a38_0x4a6f04[_0xba8c3c(0x170)](_0xba8c3c(0x1ac)),_0xba8c3c(0x287)),console['error'](a38_0x4a6f04[_0xba8c3c(0x25f)](_0xba8c3c(0x24f))),0x1;}const _0x317d7a=_0x12a9be['param'],_0xcc5bff=_0x12a9be['sessionTime'],_0x55a0a7={};if(_0x317d7a&&Array['isArray'](_0x317d7a))for(const _0x243c93 of _0x317d7a){const _0x361e4c=_0x243c93['indexOf']('=');if(_0x361e4c===-0x1)return console['error'](_0xba8c3c(0x151)+_0x243c93),console['error'](_0xba8c3c(0x16b)),0x1;const _0x11babc=_0x243c93['substring'](0x0,_0x361e4c),_0x4117e0=_0x243c93[_0xba8c3c(0x154)](_0x361e4c+0x1);try{_0x55a0a7[_0x11babc]=JSON['parse'](_0x4117e0);}catch{_0x55a0a7[_0x11babc]=_0x4117e0;}}_0x12a9be[_0xba8c3c(0x11b)]&&(console[_0xba8c3c(0x248)]('Workflow:\x20'+_0x2cfc0d),Object['keys'](_0x55a0a7)['length']>0x0&&console['error'](_0xba8c3c(0x26e)+JSON['stringify'](_0x55a0a7)),_0xcc5bff&&console[_0xba8c3c(0x248)](_0xba8c3c(0x187)+_0xcc5bff));const _0x2f7fa1=await withSpinner(_0xba8c3c(0x130),()=>_0xe8a9ce[_0xba8c3c(0x21c)][_0xba8c3c(0x1b2)](_0x2cfc0d,_0x55a0a7,{'sessionTime':_0xcc5bff}),{'verbose':_0x12a9be[_0xba8c3c(0x11b)]}),_0x5374a=_0x2f7fa1[_0xba8c3c(0x155)];console[_0xba8c3c(0x248)](_0xba8c3c(0x251)),console[_0xba8c3c(0x248)](_0xba8c3c(0x23f)+_0x5374a['id']),console[_0xba8c3c(0x248)](_0xba8c3c(0x232)+_0x5374a['sessionId']),console[_0xba8c3c(0x248)](_0xba8c3c(0x25e)+_0x5374a[_0xba8c3c(0x2b8)]?.[_0xba8c3c(0x28a)]),console[_0xba8c3c(0x248)](_0xba8c3c(0x144)+_0x5374a[_0xba8c3c(0x21c)]?.[_0xba8c3c(0x28a)]);if(_0x5374a[_0xba8c3c(0x2b8)]?.['id']&&_0x5374a[_0xba8c3c(0x13e)]&&_0x5374a['id']){const _0x48359f=_0x12a9be[_0xba8c3c(0x2c5)],_0x143345=getConsoleUrl(_0x48359f,'/app/workflows/'+_0x5374a[_0xba8c3c(0x2b8)]['id']+_0xba8c3c(0x145)+_0x5374a[_0xba8c3c(0x13e)]+'/attempt/'+_0x5374a['id']);console[_0xba8c3c(0x248)]('\x20\x20Console:\x20'+a38_0x4a6f04['cyan'](_0x143345));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a38_0x2ddcbc(0x28a)]=a38_0x2ddcbc(0x245);['description']=a38_0x2ddcbc(0x185);async[a38_0x2ddcbc(0x249)](_0x14d715){const _0x466a25=a38_0x2ddcbc,{options:_0x28eacb,args:_0xccae9e,tdx:_0xd5a23f}=_0x14d715,_0x7875b8=_0xccae9e[0x0],_0x5327c8=_0xccae9e[0x1]||'.';if(!_0x7875b8)return console[_0x466a25(0x248)](_0x466a25(0x2bb)),console['error'](_0x466a25(0x237)),0x1;const _0x4b2b45=_0x28eacb[_0x466a25(0x150)];_0x28eacb[_0x466a25(0x11b)]&&(console[_0x466a25(0x248)](_0x466a25(0x261)+_0x7875b8),console[_0x466a25(0x248)](_0x466a25(0x206)+_0x5327c8),_0x4b2b45&&console[_0x466a25(0x248)](_0x466a25(0x25b)+_0x4b2b45));const _0x358775=await withSpinner(_0x466a25(0x2b7)+_0x7875b8+'...',()=>_0xd5a23f[_0x466a25(0x21c)][_0x466a25(0x296)](_0x7875b8,_0x5327c8,{'revision':_0x4b2b45}),{'verbose':_0x28eacb['verbose']}),_0x1c6391=_0x358775[_0x466a25(0x155)];return console['error'](_0x466a25(0x1af)+_0x1c6391[_0x466a25(0x1bb)]),console[_0x466a25(0x248)](_0x466a25(0x132)+_0x1c6391[_0x466a25(0x150)]),console['error'](_0x466a25(0x165)+_0x1c6391[_0x466a25(0x27c)]),console[_0x466a25(0x248)]('\x20\x20Location:\x20'+_0x5327c8+'/'+_0x1c6391[_0x466a25(0x1bb)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a38_0x2ddcbc(0x28a)]=a38_0x2ddcbc(0x1ad);[a38_0x2ddcbc(0x17d)]=a38_0x2ddcbc(0x14e);async[a38_0x2ddcbc(0x249)](_0xbb09f9){const _0x3a359b=a38_0x2ddcbc,{options:_0x1eec4c,args:_0x4a4c36,tdx:_0x291558}=_0xbb09f9;let _0x29d51f='.',_0x4e36dd=_0x1eec4c[_0x3a359b(0x28a)];if(_0x4a4c36[0x0]){const {promises:_0x14e000}=await import('fs');try{const _0x9e4726=await _0x14e000[_0x3a359b(0x1fe)](_0x4a4c36[0x0]);if(_0x9e4726[_0x3a359b(0x196)]())_0x29d51f=_0x4a4c36[0x0];else return console['error'](_0x3a359b(0x214)+_0x4a4c36[0x0]+_0x3a359b(0x21a)),0x1;}catch{_0x4e36dd=_0x4a4c36[0x0],_0x29d51f='.';}}const _0x57bd24=_0x1eec4c['revision'],_0x2e25b8=_0x1eec4c[_0x3a359b(0x25a)];_0x1eec4c['verbose']&&(console[_0x3a359b(0x248)](_0x3a359b(0x266)+_0x29d51f),_0x4e36dd&&console[_0x3a359b(0x248)]('Project\x20name:\x20'+_0x4e36dd),_0x57bd24&&console[_0x3a359b(0x248)]('Revision:\x20'+_0x57bd24),_0x2e25b8&&console[_0x3a359b(0x248)]('Validation:\x20skipped'));const _0x4ee6e2=await withSpinner(_0x3a359b(0x1ef),()=>_0x291558[_0x3a359b(0x21c)][_0x3a359b(0x1d1)](_0x29d51f,{'projectName':_0x4e36dd,'revision':_0x57bd24,'skipValidation':_0x2e25b8}),{'verbose':_0x1eec4c[_0x3a359b(0x11b)]}),_0x1b19c3=_0x4ee6e2[_0x3a359b(0x155)];return console[_0x3a359b(0x248)]('✔\x20Pushed\x20'+_0x1b19c3[_0x3a359b(0x1bb)]),console[_0x3a359b(0x248)](_0x3a359b(0x228)+_0x1b19c3[_0x3a359b(0x2a4)]),console[_0x3a359b(0x248)]('\x20\x20Revision:\x20'+_0x1b19c3['revision']),await this[_0x3a359b(0x263)](_0x291558,_0x1b19c3['projectName'],_0x1eec4c[_0x3a359b(0x2c5)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']=a38_0x2ddcbc(0x1bf);['description']='Pull\x20workflow\x20project\x20to\x20local\x20folder';async[a38_0x2ddcbc(0x249)](_0x1387b2){const _0x444644=a38_0x2ddcbc,{options:_0x32384f,args:_0x4452aa,tdx:_0x224bbc}=_0x1387b2,_0x47920b=_0x4452aa[0x0],_0x461a0e=_0x4452aa[0x1];if(!_0x47920b)return console[_0x444644(0x248)](a38_0x4a6f04['red'](_0x444644(0x1ac)),'Project\x20name\x20is\x20required'),console[_0x444644(0x248)](a38_0x4a6f04[_0x444644(0x25f)](_0x444644(0x15b))),0x1;const _0x4a9c82=_0x32384f[_0x444644(0x150)];_0x32384f[_0x444644(0x11b)]&&(console[_0x444644(0x248)](_0x444644(0x261)+_0x47920b),_0x461a0e&&console[_0x444644(0x248)]('Target\x20directory:\x20'+_0x461a0e),_0x4a9c82&&console[_0x444644(0x248)](_0x444644(0x25b)+_0x4a9c82),_0x32384f[_0x444644(0x257)]&&console[_0x444644(0x248)](_0x444644(0x179)));const _0x4fd287=await withSpinner(_0x444644(0x2c2)+_0x47920b+'...',()=>_0x224bbc[_0x444644(0x21c)][_0x444644(0x169)](_0x47920b,{'targetDir':_0x461a0e,'revision':_0x4a9c82}),{'verbose':_0x32384f[_0x444644(0x11b)]}),_0x464deb=_0x4fd287[_0x444644(0x155)];_0x464deb[_0x444644(0x16f)]?console[_0x444644(0x248)]('✔\x20New\x20project:\x20'+_0x464deb['projectName']):console['error'](_0x444644(0x171)+_0x464deb['projectName']);console[_0x444644(0x248)](_0x444644(0x132)+_0x464deb[_0x444644(0x150)]),console[_0x444644(0x248)]('\x20\x20Target:\x20'+(a38_0x32c9ce['relative'](process[_0x444644(0x274)](),_0x464deb['targetDir'])||'.')),console[_0x444644(0x248)](_0x444644(0x188)+a38_0x4a6f04[_0x444644(0x240)]('+'+_0x464deb[_0x444644(0x191)][_0x444644(0x255)]+'\x20new')+',\x20'+(a38_0x4a6f04[_0x444644(0x17e)]('~'+_0x464deb[_0x444644(0x191)][_0x444644(0x21e)]+_0x444644(0x2a7))+',\x20')+(a38_0x4a6f04[_0x444644(0x170)]('-'+_0x464deb[_0x444644(0x191)][_0x444644(0x2a2)]+_0x444644(0x177))+',\x20')+(''+a38_0x4a6f04['dim'](_0x464deb[_0x444644(0x191)][_0x444644(0x12c)]+_0x444644(0x272))));for(const _0x28b897 of _0x464deb[_0x444644(0x209)]){_0x28b897[_0x444644(0x27a)]===_0x444644(0x21e)&&_0x28b897[_0x444644(0x27e)]&&(console['error']('\x0a'+a38_0x4a6f04[_0x444644(0x23b)]('---\x20'+_0x28b897[_0x444644(0x259)])),console[_0x444644(0x248)](_0x28b897[_0x444644(0x27e)]));}if(!_0x464deb[_0x444644(0x147)])return saveSessionContext({'workflow_project':_0x464deb[_0x444644(0x1bb)]},_0x32384f[_0x444644(0x1aa)]),console[_0x444644(0x248)](a38_0x4a6f04[_0x444644(0x240)](_0x444644(0x1e2))),console['error'](a38_0x4a6f04[_0x444644(0x25f)](_0x444644(0x161)+_0x464deb['projectName'])),0x0;if(_0x32384f['dryRun'])return console['error'](a38_0x4a6f04[_0x444644(0x17e)](_0x444644(0x1a4))),0x0;if(!_0x32384f[_0x444644(0x243)]){const _0x3467ab=await confirmKey(_0x444644(0x1da));if(!_0x3467ab)return console[_0x444644(0x248)](_0x444644(0x193)),0x0;}await withSpinner(_0x444644(0x21b),()=>_0x224bbc[_0x444644(0x21c)][_0x444644(0x284)](_0x464deb,{'revision':_0x4a9c82}),{'verbose':_0x32384f[_0x444644(0x11b)]}),saveSessionContext({'workflow_project':_0x464deb['projectName']},_0x32384f[_0x444644(0x1aa)]),console[_0x444644(0x248)](a38_0x4a6f04[_0x444644(0x240)](_0x444644(0x26c)));const _0x1f762c=a38_0x32c9ce[_0x444644(0x163)](process[_0x444644(0x274)](),_0x464deb[_0x444644(0x215)])||'.';return console[_0x444644(0x248)](a38_0x4a6f04[_0x444644(0x25f)](_0x444644(0x13b)+_0x1f762c)),console[_0x444644(0x248)](a38_0x4a6f04[_0x444644(0x25f)](_0x444644(0x161)+_0x464deb[_0x444644(0x1bb)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a38_0x2ddcbc(0x28a)]=a38_0x2ddcbc(0x1a8);[a38_0x2ddcbc(0x17d)]=a38_0x2ddcbc(0x1c0);async[a38_0x2ddcbc(0x249)](_0x3237aa){const _0x181ac4=a38_0x2ddcbc,{options:_0x11dc3c,args:_0x532873,tdx:_0x445387}=_0x3237aa,_0x37c9fc=this[_0x181ac4(0x2c6)](_0x532873,_0x11dc3c),_0x5c440e=_0x11dc3c['revision'],_0x5cf377=_0x11dc3c[_0x181ac4(0x25a)];_0x11dc3c[_0x181ac4(0x11b)]&&(_0x37c9fc&&console[_0x181ac4(0x248)](_0x181ac4(0x12a)+_0x37c9fc),_0x5c440e&&console['error']('Revision:\x20'+_0x5c440e),_0x11dc3c['dryRun']&&console[_0x181ac4(0x248)]('Dry\x20run:\x20yes'),_0x5cf377&&console[_0x181ac4(0x248)](_0x181ac4(0x2c1)));let _0x3489c9;try{_0x3489c9=await withSpinner(_0x181ac4(0x14a),()=>_0x445387['workflow']['preparePushProject']({'sourceDir':_0x37c9fc,'revision':_0x5c440e,'skipValidation':_0x5cf377}),{'verbose':_0x11dc3c[_0x181ac4(0x11b)]});}catch(_0x4cbae5){if(_0x4cbae5 instanceof Error&&_0x4cbae5[_0x181ac4(0x14d)][_0x181ac4(0x1fb)](_0x181ac4(0x22d)))return console[_0x181ac4(0x248)](a38_0x4a6f04[_0x181ac4(0x170)](_0x181ac4(0x1ac)),_0x181ac4(0x1a9)),_0x11dc3c[_0x181ac4(0x128)]?console[_0x181ac4(0x248)](a38_0x4a6f04[_0x181ac4(0x25f)](_0x181ac4(0x299)+_0x11dc3c['workflowProject']+_0x181ac4(0x1c3)+_0x11dc3c[_0x181ac4(0x128)]+'\x27')):console[_0x181ac4(0x248)](a38_0x4a6f04[_0x181ac4(0x25f)](_0x181ac4(0x12f))),0x1;throw _0x4cbae5;}const _0x500e07=_0x3489c9['data'];console[_0x181ac4(0x248)](_0x181ac4(0x171)+_0x500e07[_0x181ac4(0x1bb)]),console[_0x181ac4(0x248)](_0x181ac4(0x167)+_0x500e07[_0x181ac4(0x1d0)]),console[_0x181ac4(0x248)](_0x181ac4(0x132)+_0x500e07[_0x181ac4(0x150)]),console[_0x181ac4(0x248)]('\x20\x20Changes:\x20'+a38_0x4a6f04['green']('+'+_0x500e07[_0x181ac4(0x191)][_0x181ac4(0x255)]+_0x181ac4(0x23a))+',\x20'+(a38_0x4a6f04[_0x181ac4(0x17e)]('~'+_0x500e07[_0x181ac4(0x191)][_0x181ac4(0x21e)]+_0x181ac4(0x2a7))+',\x20')+(a38_0x4a6f04[_0x181ac4(0x170)]('-'+_0x500e07['summary'][_0x181ac4(0x2a2)]+_0x181ac4(0x177))+',\x20')+(''+a38_0x4a6f04[_0x181ac4(0x25f)](_0x500e07[_0x181ac4(0x191)][_0x181ac4(0x12c)]+_0x181ac4(0x272))));for(const _0x1c5a30 of _0x500e07[_0x181ac4(0x209)]){_0x1c5a30['type']===_0x181ac4(0x21e)&&_0x1c5a30['diff']&&(console['error']('\x0a'+a38_0x4a6f04[_0x181ac4(0x23b)](_0x181ac4(0x18b)+_0x1c5a30['path'])),console[_0x181ac4(0x248)](_0x1c5a30[_0x181ac4(0x27e)]));}if(!_0x500e07[_0x181ac4(0x147)])return console[_0x181ac4(0x248)](a38_0x4a6f04['green'](_0x181ac4(0x210))),await this[_0x181ac4(0x263)](_0x445387,_0x500e07['projectName'],_0x11dc3c['site']),0x0;if(_0x11dc3c[_0x181ac4(0x257)])return console[_0x181ac4(0x248)](a38_0x4a6f04[_0x181ac4(0x17e)](_0x181ac4(0x1b9))),0x0;if(!_0x11dc3c[_0x181ac4(0x243)]){const _0x5d03df=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x5d03df)return console[_0x181ac4(0x248)]('Cancelled'),0x0;}const _0x260ea3=await withSpinner('Pushing\x20project...',()=>_0x445387[_0x181ac4(0x21c)][_0x181ac4(0x21f)](_0x500e07),{'verbose':_0x11dc3c[_0x181ac4(0x11b)]}),_0x52e010=_0x260ea3['data'];return console[_0x181ac4(0x248)](a38_0x4a6f04['green'](_0x181ac4(0x22b))),console[_0x181ac4(0x248)](_0x181ac4(0x228)+_0x52e010[_0x181ac4(0x2a4)]),console[_0x181ac4(0x248)](_0x181ac4(0x132)+_0x52e010[_0x181ac4(0x150)]),await this['showWorkflowConsoleUrl'](_0x445387,_0x52e010[_0x181ac4(0x1bb)],_0x11dc3c[_0x181ac4(0x2c5)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a38_0x2ddcbc(0x28a)]=a38_0x2ddcbc(0x24c);['description']=a38_0x2ddcbc(0x280);async['execute'](_0x1e8e52){const _0x53e6e6=a38_0x2ddcbc,{options:_0x22d34a,args:_0x11ef8b,tdx:_0x1ba546}=_0x1e8e52,_0x1777ed=this[_0x53e6e6(0x2c6)](_0x11ef8b,_0x22d34a),_0x22a214=_0x22d34a[_0x53e6e6(0x28a)],_0x6a2ca9=_0x22d34a[_0x53e6e6(0x150)],_0x4003e1=_0x22d34a[_0x53e6e6(0x25a)];if(!_0x1777ed)return console[_0x53e6e6(0x248)](a38_0x4a6f04[_0x53e6e6(0x170)](_0x53e6e6(0x1ac)),_0x53e6e6(0x18d)),console[_0x53e6e6(0x248)](a38_0x4a6f04[_0x53e6e6(0x25f)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x53e6e6(0x248)](a38_0x4a6f04['dim']('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x22a214)return console[_0x53e6e6(0x248)](a38_0x4a6f04['red'](_0x53e6e6(0x1ac)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console['error'](a38_0x4a6f04[_0x53e6e6(0x25f)](_0x53e6e6(0x11e))),0x1;_0x22d34a[_0x53e6e6(0x11b)]&&(console['error']('Source\x20directory:\x20'+_0x1777ed),console['error'](_0x53e6e6(0x2a0)+_0x22a214),_0x6a2ca9&&console[_0x53e6e6(0x248)](_0x53e6e6(0x25b)+_0x6a2ca9),_0x22d34a[_0x53e6e6(0x257)]&&console[_0x53e6e6(0x248)](_0x53e6e6(0x179)),_0x4003e1&&console[_0x53e6e6(0x248)]('Validation:\x20skipped'));const _0x40468f=await withSpinner(_0x53e6e6(0x298),()=>_0x1ba546[_0x53e6e6(0x21c)][_0x53e6e6(0x1c7)](_0x1777ed,_0x22a214,{'revision':_0x6a2ca9,'skipValidation':_0x4003e1}),{'verbose':_0x22d34a['verbose']}),_0x38da5b=_0x40468f[_0x53e6e6(0x155)];console[_0x53e6e6(0x248)](_0x53e6e6(0x2c8)+_0x38da5b[_0x53e6e6(0x1d0)]);_0x38da5b['sourceProjectName']&&console[_0x53e6e6(0x248)](_0x53e6e6(0x13d)+_0x38da5b[_0x53e6e6(0x1c5)]);console[_0x53e6e6(0x248)]('New\x20project\x20name:\x20'+_0x38da5b['newProjectName']),console[_0x53e6e6(0x248)](_0x53e6e6(0x25b)+_0x38da5b[_0x53e6e6(0x150)]),console[_0x53e6e6(0x248)](_0x53e6e6(0x1f7)+_0x38da5b[_0x53e6e6(0x156)]);_0x38da5b['targetExists']&&(console[_0x53e6e6(0x248)](a38_0x4a6f04[_0x53e6e6(0x17e)]('\x0a⚠\x20Project\x20\x22'+_0x38da5b['newProjectName']+'\x22\x20already\x20exists\x20(ID:\x20'+_0x38da5b[_0x53e6e6(0x1c6)]+')')),console[_0x53e6e6(0x248)](a38_0x4a6f04[_0x53e6e6(0x17e)](_0x53e6e6(0x16d))));if(_0x22d34a[_0x53e6e6(0x257)])return console[_0x53e6e6(0x248)](a38_0x4a6f04[_0x53e6e6(0x17e)](_0x53e6e6(0x1cd))),0x0;if(!_0x22d34a[_0x53e6e6(0x243)]){const _0x5be728=_0x38da5b[_0x53e6e6(0x1c5)]||a38_0x32c9ce[_0x53e6e6(0x1e3)](_0x1777ed),_0x1d08c9=_0x38da5b[_0x53e6e6(0x183)]?_0x53e6e6(0x160)+_0x22a214+_0x53e6e6(0x19c):_0x53e6e6(0x2ae)+_0x5be728+_0x53e6e6(0x17b)+_0x22a214+'\x22?',_0x20c2ed=await confirmKey(_0x1d08c9);if(!_0x20c2ed)return console['error'](_0x53e6e6(0x193)),0x0;}const _0x39f85b=await withSpinner(_0x38da5b['targetExists']?_0x53e6e6(0x15e)+_0x22a214+'...':_0x53e6e6(0x277)+_0x22a214+'...',()=>_0x1ba546['workflow'][_0x53e6e6(0x173)](_0x38da5b),{'verbose':_0x22d34a[_0x53e6e6(0x11b)]}),_0x547199=_0x39f85b[_0x53e6e6(0x155)];return console[_0x53e6e6(0x248)](a38_0x4a6f04[_0x53e6e6(0x240)](_0x38da5b['targetExists']?_0x53e6e6(0x294):'✔\x20Clone\x20complete')),console[_0x53e6e6(0x248)](_0x53e6e6(0x25e)+_0x547199[_0x53e6e6(0x1db)]),console['error'](_0x53e6e6(0x228)+_0x547199['newProjectId']),console[_0x53e6e6(0x248)]('\x20\x20Revision:\x20'+_0x547199[_0x53e6e6(0x150)]),await this[_0x53e6e6(0x263)](_0x1ba546,_0x547199[_0x53e6e6(0x1db)],_0x22d34a['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a38_0x2ddcbc(0x28a)]=a38_0x2ddcbc(0x288);['description']=a38_0x2ddcbc(0x2b5);async[a38_0x2ddcbc(0x249)](_0x1bcdb2){const _0x2649ea=a38_0x2ddcbc,{options:_0x1e96e4,args:_0x162455,tdx:_0x3f5489}=_0x1bcdb2,_0x48393b=_0x162455[0x0];if(!_0x48393b)return console[_0x2649ea(0x248)](_0x2649ea(0x213)),console[_0x2649ea(0x248)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x1e96e4[_0x2649ea(0x11b)]&&console[_0x2649ea(0x248)](_0x2649ea(0x261)+_0x48393b);if(!_0x1e96e4[_0x2649ea(0x243)]){const _0x4c2fdc=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x48393b+_0x2649ea(0x1d8));if(!_0x4c2fdc)return console[_0x2649ea(0x248)](_0x2649ea(0x193)),0x0;}const _0x267629=await withSpinner('Deleting\x20project\x20'+_0x48393b+_0x2649ea(0x2b3),()=>_0x3f5489[_0x2649ea(0x21c)][_0x2649ea(0x2a8)](_0x48393b),{'verbose':_0x1e96e4[_0x2649ea(0x11b)]}),_0x35f772=_0x267629['data'];return console[_0x2649ea(0x248)]('✔\x20Deleted\x20project\x20'+_0x35f772[_0x2649ea(0x1bb)]),console[_0x2649ea(0x248)](_0x2649ea(0x228)+_0x35f772[_0x2649ea(0x2a4)]),0x0;}}export function parseKeyValue(_0x16d59d){const _0x4b5542=a38_0x2ddcbc,_0x2b8953=_0x16d59d[_0x4b5542(0x1b7)]('=');if(_0x2b8953===-0x1)throw new Error(_0x4b5542(0x1f2)+_0x16d59d+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x3990a3=_0x16d59d[_0x4b5542(0x154)](0x0,_0x2b8953),_0x4b9929=_0x16d59d[_0x4b5542(0x154)](_0x2b8953+0x1);if(!_0x3990a3)throw new Error(_0x4b5542(0x278));return{'key':_0x3990a3,'value':_0x4b9929};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a38_0x2ddcbc(0x28a)]=a38_0x2ddcbc(0x2bc);[a38_0x2ddcbc(0x17d)]=a38_0x2ddcbc(0x124);async[a38_0x2ddcbc(0x249)](_0x21dcda){const _0x4dbedf=a38_0x2ddcbc,{options:_0x91f7ae,args:_0x41b9d9,tdx:_0x16d1b}=_0x21dcda,_0x211dba=this['requireProject'](_0x41b9d9,_0x91f7ae);if(!_0x211dba)return 0x1;_0x91f7ae[_0x4dbedf(0x11b)]&&console[_0x4dbedf(0x248)]('Project:\x20'+_0x211dba);const _0x148249=await withSpinner(_0x4dbedf(0x127),()=>_0x16d1b[_0x4dbedf(0x21c)]['listSecrets'](_0x211dba),{'verbose':_0x91f7ae[_0x4dbedf(0x11b)]}),{secrets:_0x4e7edd}=_0x148249[_0x4dbedf(0x155)];return console[_0x4dbedf(0x248)](_0x4dbedf(0x148)+_0x4e7edd[_0x4dbedf(0x29c)]+_0x4dbedf(0x224)+(_0x4e7edd[_0x4dbedf(0x29c)]!==0x1?'s':'')),await handleSDKOutput(_0x4e7edd,_0x91f7ae),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a38_0x2ddcbc(0x176);[a38_0x2ddcbc(0x17d)]=a38_0x2ddcbc(0x192);async['execute'](_0x5368fe){const _0x3c0ad8=a38_0x2ddcbc,{options:_0x487b02,args:_0xd33342,tdx:_0x3e194f}=_0x5368fe;let _0x36189d,_0xa7ef96;if(_0xd33342[_0x3c0ad8(0x29c)]>=0x2)_0x36189d=_0xd33342[0x0],_0xa7ef96=_0xd33342[0x1];else{if(_0xd33342[_0x3c0ad8(0x29c)]===0x1&&_0x487b02[_0x3c0ad8(0x128)])_0x36189d=_0x487b02[_0x3c0ad8(0x128)],_0xa7ef96=_0xd33342[0x0];else return _0xd33342[_0x3c0ad8(0x29c)]===0x1?(console['error'](_0x3c0ad8(0x2bb)),console[_0x3c0ad8(0x248)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x3c0ad8(0x248)](_0x3c0ad8(0x12d)),console['error']('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE'),0x1);}let _0x19612e,_0x3ff255;try{({key:_0x19612e,value:_0x3ff255}=parseKeyValue(_0xa7ef96));}catch(_0x3f733b){return _0x3f733b instanceof Error&&console[_0x3c0ad8(0x248)](a38_0x4a6f04[_0x3c0ad8(0x170)](_0x3c0ad8(0x1ac)),_0x3f733b['message']),0x1;}_0x487b02['verbose']&&(console['error']('Project:\x20'+_0x36189d),console['error'](_0x3c0ad8(0x194)+_0x19612e));const _0x254ff0=await withSpinner(_0x3c0ad8(0x1f0),()=>_0x3e194f['workflow'][_0x3c0ad8(0x242)](_0x36189d,_0x19612e,_0x3ff255),{'verbose':_0x487b02['verbose']}),_0x960abc=_0x254ff0[_0x3c0ad8(0x155)];return console[_0x3c0ad8(0x248)](_0x3c0ad8(0x1be)+_0x960abc[_0x3c0ad8(0x2a9)]+_0x3c0ad8(0x19f)+_0x960abc[_0x3c0ad8(0x1bb)]+'\x27'),(_0x487b02[_0x3c0ad8(0x15a)]||_0x487b02[_0x3c0ad8(0x1d5)])&&await handleSingleObjectOutput(_0x960abc,_0x487b02),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a38_0x2ddcbc(0x28a)]='workflow:secrets:delete';[a38_0x2ddcbc(0x17d)]='Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project';async['execute'](_0x4c674c){const _0xec2401=a38_0x2ddcbc,{options:_0x207835,args:_0xf7a941,tdx:_0x15cdbd}=_0x4c674c;let _0x27ea64,_0x34085c;if(_0xf7a941['length']>=0x2)_0x27ea64=_0xf7a941[0x0],_0x34085c=_0xf7a941[0x1];else{if(_0xf7a941[_0xec2401(0x29c)]===0x1&&_0x207835[_0xec2401(0x128)])_0x27ea64=_0x207835[_0xec2401(0x128)],_0x34085c=_0xf7a941[0x0];else return _0xf7a941[_0xec2401(0x29c)]===0x1?(console['error'](_0xec2401(0x2bb)),console[_0xec2401(0x248)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console['error'](_0xec2401(0x283)),console['error'](_0xec2401(0x189)),0x1);}_0x207835[_0xec2401(0x11b)]&&(console[_0xec2401(0x248)](_0xec2401(0x261)+_0x27ea64),console[_0xec2401(0x248)](_0xec2401(0x194)+_0x34085c));if(!_0x207835[_0xec2401(0x243)]){const _0x33336b=await confirmKey(_0xec2401(0x205)+_0x34085c+_0xec2401(0x1eb)+_0x27ea64+'\x27?');if(!_0x33336b)return console[_0xec2401(0x248)](_0xec2401(0x193)),0x0;}const _0x482bc9=await withSpinner(_0xec2401(0x260),()=>_0x15cdbd[_0xec2401(0x21c)][_0xec2401(0x26f)](_0x27ea64,_0x34085c),{'verbose':_0x207835['verbose']}),_0x1d2a27=_0x482bc9[_0xec2401(0x155)];return console[_0xec2401(0x248)](_0xec2401(0x1be)+_0x1d2a27[_0xec2401(0x2a9)]+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x1d2a27[_0xec2401(0x1bb)]+'\x27'),(_0x207835['json']||_0x207835[_0xec2401(0x1d5)])&&await handleSingleObjectOutput(_0x1d2a27,_0x207835),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(_0x2ecf68){const _0x3a29a7=a38_0x2ddcbc,_0x29c592=Math[_0x3a29a7(0x1d2)](_0x2ecf68/0x3e8),_0x11430c=Math[_0x3a29a7(0x1d2)](_0x29c592/0x3c),_0x33370b=Math[_0x3a29a7(0x1d2)](_0x11430c/0x3c),_0x1b1033=Math[_0x3a29a7(0x1d2)](_0x33370b/0x18);if(_0x1b1033>0x0){const _0x3c75c7=_0x33370b%0x18;return _0x3c75c7>0x0?_0x1b1033+'d\x20'+_0x3c75c7+'h':_0x1b1033+'d';}else{if(_0x33370b>0x0){const _0x40cfbb=_0x11430c%0x3c;return _0x40cfbb>0x0?_0x33370b+'h\x20'+_0x40cfbb+'m':_0x33370b+'h';}else{if(_0x11430c>0x0){const _0x14ac9c=_0x29c592%0x3c;return _0x14ac9c>0x0?_0x11430c+'m\x20'+_0x14ac9c+'s':_0x11430c+'m';}else return _0x29c592+'s';}}}function formatTimestamp(_0xa15973,_0x314a02){const _0x59143f=a38_0x2ddcbc,_0x3264eb=new Date(_0xa15973),_0x505dc2=String(_0x3264eb[_0x59143f(0x22e)]())[_0x59143f(0x23d)](0x2,'0'),_0x4a0d3c=String(_0x3264eb[_0x59143f(0x17f)]())[_0x59143f(0x23d)](0x2,'0'),_0x4ec689=_0x505dc2+':'+_0x4a0d3c,_0x1395e1=_0x3264eb['getFullYear']()===_0x314a02['getFullYear']()&&_0x3264eb[_0x59143f(0x26b)]()===_0x314a02['getMonth']()&&_0x3264eb['getDate']()===_0x314a02[_0x59143f(0x282)]();if(_0x1395e1)return _0x4ec689;else{const _0x1d8b2f=String(_0x3264eb[_0x59143f(0x26b)]()+0x1)[_0x59143f(0x23d)](0x2,'0'),_0x2b1fae=String(_0x3264eb[_0x59143f(0x282)]())['padStart'](0x2,'0');return _0x1d8b2f+'-'+_0x2b1fae+'\x20'+_0x4ec689;}}function formatDate(_0x5a7b29){const _0xe86402=a38_0x2ddcbc,_0x25bf91=_0x5a7b29['getFullYear'](),_0x37ac79=String(_0x5a7b29['getMonth']()+0x1)[_0xe86402(0x23d)](0x2,'0'),_0x49801f=String(_0x5a7b29[_0xe86402(0x282)]())['padStart'](0x2,'0');return _0x25bf91+'-'+_0x37ac79+'-'+_0x49801f;}function getTaskStateIcon(_0x5ee526){const _0x262753={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x262753[_0x5ee526]||'⚪';}function getBarChar(_0x614ad2){const _0x40c0ea=a38_0x2ddcbc;return _0x614ad2==='error'||_0x614ad2===_0x40c0ea(0x2ba)?'×':'─';}function getBarColor(_0x397e04){const _0x1a1e88=a38_0x2ddcbc,_0x1b41d1={'success':a38_0x4a6f04['green'],'error':a38_0x4a6f04[_0x1a1e88(0x170)],'group_error':a38_0x4a6f04[_0x1a1e88(0x170)],'running':a38_0x4a6f04[_0x1a1e88(0x1f4)],'blocked':a38_0x4a6f04[_0x1a1e88(0x17e)],'planned':a38_0x4a6f04['dim'],'canceling':a38_0x4a6f04['yellow']};return _0x1b41d1[_0x397e04]||a38_0x4a6f04['white'];}function parseTaskName(_0x3ba44b){const _0x2ef640=a38_0x2ddcbc;let _0x3e47bd=_0x3ba44b[_0x2ef640(0x2aa)](/^\++/,'');const _0x2ee8e=_0x3e47bd[_0x2ef640(0x16a)]('+'),_0x555210=_0x2ee8e[_0x2ef640(0x29c)]>0x1?_0x2ee8e['length']-0x2:0x0,_0x97d6fe=_0x2ee8e[_0x2ee8e[_0x2ef640(0x29c)]-0x1]||_0x3e47bd;return{'level':_0x555210,'name':'+'+_0x97d6fe};}function truncateTaskName(_0x1287d8,_0x4df350){const _0x5eb5bd=a38_0x2ddcbc,_0x50b2ac=stringWidth(_0x1287d8);if(_0x50b2ac<=_0x4df350)return _0x1287d8;let _0x4caa7e=_0x1287d8;while(stringWidth(_0x4caa7e+'…')>_0x4df350&&_0x4caa7e[_0x5eb5bd(0x29c)]>0x0){_0x4caa7e=_0x4caa7e['slice'](0x0,-0x1);}return _0x4caa7e+'…';}function calculateTimeScale(_0x428bb9,_0x30c319){const _0x38e0d4=a38_0x2ddcbc;return{'startTime':_0x428bb9[_0x38e0d4(0x1e1)],'endTime':_0x428bb9['end'],'durationMs':_0x428bb9[_0x38e0d4(0x28f)],'msPerChar':_0x428bb9[_0x38e0d4(0x28f)]/_0x30c319};}function timeToPosition(_0x23ee9a,_0x302438,_0x31cb6c){const _0x21b545=a38_0x2ddcbc,_0x64540c=_0x23ee9a-_0x302438[_0x21b545(0x276)],_0x400615=Math[_0x21b545(0x1d2)](_0x64540c/_0x302438['msPerChar']);return Math[_0x21b545(0x152)](0x0,Math[_0x21b545(0x122)](_0x400615,_0x31cb6c));}function renderTimeAxis(_0xe19596,_0x213875){const _0x1a0a6f=a38_0x2ddcbc,_0x30fe08=Math[_0x1a0a6f(0x122)](TIMELINE_CONFIG[_0x1a0a6f(0x1b4)],Math[_0x1a0a6f(0x152)](TIMELINE_CONFIG[_0x1a0a6f(0x231)],Math[_0x1a0a6f(0x1d2)](_0x213875/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x45dca9=_0xe19596[_0x1a0a6f(0x29a)]/(_0x30fe08-0x1),_0x1a280b=new Date(_0xe19596['startTime']),_0x4cb9e7=[];for(let _0x45df00=0x0;_0x45df00<_0x30fe08;_0x45df00++){const _0x5d0b87=_0xe19596[_0x1a0a6f(0x276)]+_0x45df00*_0x45dca9,_0x44c54a=timeToPosition(_0x5d0b87,_0xe19596,_0x213875),_0x3c45c6=formatTimestamp(_0x5d0b87,_0x1a280b);_0x4cb9e7[_0x1a0a6f(0x1d1)]({'pos':_0x44c54a,'text':_0x3c45c6});}const _0xd0f952=new Array(_0x213875)[_0x1a0a6f(0x1d6)]('\x20');let _0x4a2d62=-0x1;for(const {pos:_0x127031,text:_0x22bd5b}of _0x4cb9e7){let _0x3e71f4=Math['max'](0x0,_0x127031-Math[_0x1a0a6f(0x1d2)](_0x22bd5b[_0x1a0a6f(0x29c)]/0x2));_0x3e71f4<=_0x4a2d62+TIMELINE_CONFIG[_0x1a0a6f(0x208)]&&(_0x3e71f4=_0x4a2d62+TIMELINE_CONFIG[_0x1a0a6f(0x208)]+0x1);_0x3e71f4+_0x22bd5b[_0x1a0a6f(0x29c)]>_0x213875&&(_0x3e71f4=_0x213875-_0x22bd5b['length']);if(_0x3e71f4>=0x0&&_0x3e71f4+_0x22bd5b[_0x1a0a6f(0x29c)]<=_0x213875&&_0x3e71f4>_0x4a2d62){for(let _0x58ee2c=0x0;_0x58ee2c<_0x22bd5b[_0x1a0a6f(0x29c)];_0x58ee2c++){_0xd0f952[_0x3e71f4+_0x58ee2c]=_0x22bd5b[_0x58ee2c];}_0x4a2d62=_0x3e71f4+_0x22bd5b[_0x1a0a6f(0x29c)]-0x1;}}return _0xd0f952[_0x1a0a6f(0x12e)]('');}function renderTaskRow(_0xaa6bb3,_0x564172,_0x520626,_0x4d0b96){const _0x468573=a38_0x2ddcbc,{level:_0x2aa258,name:_0x354068}=parseTaskName(_0xaa6bb3['name']),_0x2c0d2f='\x20'['repeat'](_0x2aa258),_0x38a4b8=_0xaa6bb3[_0x468573(0x2ab)]?'('+formatElapsed(_0xaa6bb3[_0x468573(0x2ab)]['duration'])+')':'',_0x5ccf97=stringWidth(_0x38a4b8),_0x15aa02=_0x2aa258*0x1,_0x311be0=_0x4d0b96-_0x15aa02-_0x5ccf97-0x1,_0x417b4b=truncateTaskName(_0x354068,_0x311be0),_0x45e9f8=_0x2c0d2f+_0x417b4b,_0x3e4d55=stringWidth(_0x45e9f8),_0x8b5ed8=_0x4d0b96-_0x3e4d55-_0x5ccf97,_0x2ca989=_0x45e9f8+'\x20'['repeat'](Math[_0x468573(0x152)](0x1,_0x8b5ed8))+a38_0x4a6f04[_0x468573(0x25f)](_0x38a4b8),_0x30d395=getTaskStateIcon(_0xaa6bb3[_0x468573(0x18f)]),_0x5e821e=new Array(_0x520626)[_0x468573(0x1d6)]('\x20');if(_0xaa6bb3['window']){const _0x5db269=timeToPosition(_0xaa6bb3[_0x468573(0x2ab)][_0x468573(0x1e1)],_0x564172,_0x520626),_0x31c609=timeToPosition(_0xaa6bb3['window'][_0x468573(0x229)],_0x564172,_0x520626),_0x355054=getBarChar(_0xaa6bb3[_0x468573(0x18f)]),_0x20ec72=Math[_0x468573(0x152)](_0x5db269+0x1,_0x31c609);for(let _0x1681f9=_0x5db269;_0x1681f9<Math['min'](_0x20ec72,_0x520626);_0x1681f9++){_0x5e821e[_0x1681f9]=_0x355054;}}const _0x3ab3c2=getBarColor(_0xaa6bb3[_0x468573(0x18f)]),_0x419ed0=_0x5e821e[_0x468573(0x168)](_0x112983=>_0x112983==='\x20'?'\x20':_0x3ab3c2(_0x112983))[_0x468573(0x12e)]('');return _0x30d395+'\x20'+_0x2ca989+'│'+_0x419ed0+'│';}function calculateStats(_0x28d469){const _0x472c54=a38_0x2ddcbc,_0x534470={'total':_0x28d469[_0x472c54(0x29c)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x4045ab of _0x28d469){if(_0x4045ab[_0x472c54(0x18f)]===_0x472c54(0x293))_0x534470[_0x472c54(0x293)]++;else{if(_0x4045ab[_0x472c54(0x18f)]===_0x472c54(0x248)||_0x4045ab[_0x472c54(0x18f)]===_0x472c54(0x2ba))_0x534470['error']++;else _0x4045ab[_0x472c54(0x18f)]===_0x472c54(0x253)?_0x534470[_0x472c54(0x253)]++:_0x534470[_0x472c54(0x13f)]++;}}return _0x534470;}function formatStats(_0xd2716c){const _0x188647=a38_0x2ddcbc;return[_0x188647(0x172)+_0xd2716c[_0x188647(0x1f1)],'✅\x20'+_0xd2716c[_0x188647(0x293)],'❌\x20'+_0xd2716c[_0x188647(0x248)],_0x188647(0x1f3)+_0xd2716c[_0x188647(0x253)],'⏳\x20'+_0xd2716c[_0x188647(0x13f)]][_0x188647(0x12e)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a38_0x2ddcbc(0x28a)]=a38_0x2ddcbc(0x16e);[a38_0x2ddcbc(0x17d)]=a38_0x2ddcbc(0x24a);async[a38_0x2ddcbc(0x249)](_0x55af48){const _0x4e0aa0=a38_0x2ddcbc,{options:_0x63628d,args:_0x2b94b8,tdx:_0x2b8626}=_0x55af48;let _0x248a85,_0x5b1ab6,_0x5babd0=![];if(_0x2b94b8[0x0]){if(_0x2b94b8[0x0]['includes']('.')){const _0x178b14=this[_0x4e0aa0(0x121)](_0x2b94b8,_0x63628d);if(!_0x178b14)return 0x1;_0x248a85=_0x178b14[_0x4e0aa0(0x1bb)],_0x5b1ab6=_0x178b14[_0x4e0aa0(0x227)];}else{_0x5b1ab6=_0x2b94b8[0x0],_0x248a85=_0x63628d[_0x4e0aa0(0x128)];if(!_0x248a85)return console[_0x4e0aa0(0x248)](a38_0x4a6f04[_0x4e0aa0(0x170)]('Error:'),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x5babd0=!![];}}else{const _0x4efc50=this[_0x4e0aa0(0x121)](_0x2b94b8,_0x63628d);if(!_0x4efc50)return 0x1;_0x248a85=_0x4efc50['projectName'],_0x5b1ab6=_0x4efc50[_0x4e0aa0(0x227)];}if(_0x63628d['verbose']){if(_0x248a85&&_0x5b1ab6)console[_0x4e0aa0(0x248)]('Filter:\x20'+_0x248a85+'.'+_0x5b1ab6);else _0x248a85&&console[_0x4e0aa0(0x248)]('Filter:\x20project='+_0x248a85);}const _0x5f3f85=_0x63628d[_0x4e0aa0(0x264)],_0x15f77f=_0x63628d[_0x4e0aa0(0x13e)];if(_0x5f3f85){_0x15f77f&&console[_0x4e0aa0(0x248)](a38_0x4a6f04[_0x4e0aa0(0x17e)](_0x4e0aa0(0x236)),_0x4e0aa0(0x238));const _0x3d92d2=_0x63628d['follow'];return _0x3d92d2?await this[_0x4e0aa0(0x11c)](_0x55af48,_0x5f3f85):await this[_0x4e0aa0(0x13a)](_0x55af48,_0x5f3f85,_0x63628d),0x0;}if(_0x15f77f){const _0x588252=await withSpinner(_0x4e0aa0(0x182),()=>_0x2b8626[_0x4e0aa0(0x21c)][_0x4e0aa0(0x159)]({'projectName':_0x248a85,'workflowName':_0x5b1ab6,'limit':0x64}),{'verbose':_0x63628d[_0x4e0aa0(0x11b)]}),_0x99bd28=_0x588252[_0x4e0aa0(0x155)]['find'](_0x676256=>_0x676256['id']===_0x15f77f);if(!_0x99bd28)return console['error'](a38_0x4a6f04['red'](_0x4e0aa0(0x1ac)),_0x4e0aa0(0x281)+_0x15f77f),0x1;if(!_0x99bd28['lastAttempt']?.['id'])return console[_0x4e0aa0(0x248)](a38_0x4a6f04[_0x4e0aa0(0x170)](_0x4e0aa0(0x1ac)),_0x4e0aa0(0x143)+_0x15f77f+_0x4e0aa0(0x1a1)),0x1;const _0xe6514d=_0x99bd28[_0x4e0aa0(0x256)]['id'];_0x63628d['verbose']&&console['error'](_0x4e0aa0(0x14b)+_0xe6514d+_0x4e0aa0(0x18a)+_0x15f77f);const _0x2b5dcd=_0x63628d['follow'];return _0x2b5dcd?await this[_0x4e0aa0(0x11c)](_0x55af48,_0xe6514d):await this[_0x4e0aa0(0x13a)](_0x55af48,_0xe6514d,_0x63628d),0x0;}const _0x8dda6e=await withSpinner(_0x4e0aa0(0x126),()=>_0x2b8626[_0x4e0aa0(0x21c)]['sessions']({'projectName':_0x248a85,'workflowName':_0x5b1ab6,'limit':_0x63628d[_0x4e0aa0(0x1dc)]||0x32}),{'verbose':_0x63628d[_0x4e0aa0(0x11b)]}),_0x59e7ac=_0x8dda6e[_0x4e0aa0(0x155)];if(_0x59e7ac[_0x4e0aa0(0x29c)]===0x0){if(_0x248a85&&_0x5b1ab6)console[_0x4e0aa0(0x248)](_0x4e0aa0(0x2a6)+_0x248a85+'.'+_0x5b1ab6);else _0x248a85?console[_0x4e0aa0(0x248)](_0x4e0aa0(0x153)+_0x248a85):(console[_0x4e0aa0(0x248)](_0x4e0aa0(0x198)),console['error'](a38_0x4a6f04[_0x4e0aa0(0x25f)]('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x59e7ac[_0x4e0aa0(0x265)]((_0x241785,_0x1cabfe)=>{const _0x11fe8c=_0x4e0aa0,_0x368615=_0x241785[_0x11fe8c(0x137)]||'',_0x429c9c=_0x1cabfe['sessionTime']||'';return _0x429c9c[_0x11fe8c(0x1c1)](_0x368615);});if(_0x63628d[_0x4e0aa0(0x15a)]||_0x63628d[_0x4e0aa0(0x1d5)])return await handleSDKOutput(_0x59e7ac,_0x63628d),0x0;let _0x5b0e25;if(_0x5babd0){const _0x20fd7e=_0x59e7ac[0x0];if(!_0x20fd7e[_0x4e0aa0(0x256)]?.['id'])return console[_0x4e0aa0(0x248)](_0x4e0aa0(0x1f8)),0x0;_0x5b0e25=_0x20fd7e[_0x4e0aa0(0x256)]['id'],_0x63628d[_0x4e0aa0(0x11b)]&&console[_0x4e0aa0(0x248)]('Auto-selected\x20latest\x20session:\x20'+_0x20fd7e[_0x4e0aa0(0x137)]);}else{const _0xc374a=_0x59e7ac['map'](_0x4ba9d7=>{const _0x52a6c6=_0x4e0aa0,_0x18f9c4=getAttemptStatusDisplay(_0x4ba9d7[_0x52a6c6(0x256)]);return{'title':_0x4ba9d7['project']?.[_0x52a6c6(0x28a)]+'.'+_0x4ba9d7['workflow']?.[_0x52a6c6(0x28a)]+_0x52a6c6(0x221)+_0x4ba9d7[_0x52a6c6(0x137)]+'\x20'+_0x18f9c4[_0x52a6c6(0x1a3)],'value':_0x4ba9d7['lastAttempt']?.['id']||'','description':_0x18f9c4[_0x52a6c6(0x19e)]};}),_0x4c70bb=await a38_0xe1c4({'type':_0x4e0aa0(0x1ab),'name':_0x4e0aa0(0x264),'message':_0x4e0aa0(0x1d3),'choices':_0xc374a[_0x4e0aa0(0x254)](_0x6f545e=>_0x6f545e[_0x4e0aa0(0x166)]!=='')});if(!_0x4c70bb[_0x4e0aa0(0x264)])return 0x0;_0x5b0e25=_0x4c70bb[_0x4e0aa0(0x264)];}const _0x47a29d=_0x63628d[_0x4e0aa0(0x1e6)];return _0x47a29d?await this[_0x4e0aa0(0x11c)](_0x55af48,_0x5b0e25):await this[_0x4e0aa0(0x13a)](_0x55af48,_0x5b0e25,_0x63628d),0x0;}async[a38_0x2ddcbc(0x13a)](_0x49749c,_0x5aca1f,_0x41edf8){const _0x179dfd=a38_0x2ddcbc,{tdx:_0x4accac}=_0x49749c;let _0x4a2dfa,_0x584fdb;try{[_0x4a2dfa,_0x584fdb]=await Promise['all']([_0x4accac[_0x179dfd(0x21c)][_0x179dfd(0x13c)](_0x5aca1f),_0x4accac[_0x179dfd(0x21c)][_0x179dfd(0x1cc)](_0x5aca1f,![])]);}catch(_0x59b03b){console[_0x179dfd(0x248)](a38_0x4a6f04[_0x179dfd(0x170)](_0x179dfd(0x1e9)));_0x41edf8[_0x179dfd(0x11b)]&&console['error'](_0x59b03b);throw _0x59b03b;}if(_0x41edf8['json']||_0x41edf8[_0x179dfd(0x1d5)]){const _0x4d726e=this[_0x179dfd(0x1c9)](_0x4a2dfa,_0x584fdb);await handleSDKOutput([_0x4d726e],_0x41edf8);return;}const _0x303a0d=_0x4accac[_0x179dfd(0x2ac)][_0x179dfd(0x2c5)],_0x228373=this[_0x179dfd(0x2af)](_0x4a2dfa,_0x584fdb,_0x303a0d);console[_0x179dfd(0x273)](_0x228373);}async[a38_0x2ddcbc(0x11c)](_0x1191b4,_0x453d9c){const _0x21042d=a38_0x2ddcbc,{tdx:_0xde4eb4}=_0x1191b4,_0x2ba5d6=TIMELINE_CONFIG[_0x21042d(0x230)],_0x4de691=TIMELINE_CONFIG[_0x21042d(0x291)];let _0x12484c=0x0;while(_0x12484c<_0x4de691){process[_0x21042d(0x149)][_0x21042d(0x216)]&&process[_0x21042d(0x149)]['write']('\x1bc');let _0x4b763e,_0x3d30eb;try{[_0x4b763e,_0x3d30eb]=await Promise[_0x21042d(0x239)]([_0xde4eb4[_0x21042d(0x21c)][_0x21042d(0x13c)](_0x453d9c),_0xde4eb4['workflow'][_0x21042d(0x1cc)](_0x453d9c,![])]);}catch(_0x5ce598){console[_0x21042d(0x248)](a38_0x4a6f04[_0x21042d(0x170)](_0x21042d(0x290)));_0x12484c>0x0&&console[_0x21042d(0x248)](a38_0x4a6f04[_0x21042d(0x25f)](_0x21042d(0x289)+_0x12484c));throw _0x5ce598;}const _0x538495=_0xde4eb4[_0x21042d(0x2ac)][_0x21042d(0x2c5)],_0x2498df=this[_0x21042d(0x2af)](_0x4b763e,_0x3d30eb,_0x538495);console[_0x21042d(0x273)](_0x2498df);const _0x4fc929=_0x4b763e[_0x21042d(0x1a5)]&&_0x3d30eb['every'](_0x341c8c=>_0x341c8c['state']!=='running'&&_0x341c8c[_0x21042d(0x18f)]!==_0x21042d(0x19a));if(_0x4fc929){console['error'](a38_0x4a6f04[_0x21042d(0x240)](_0x21042d(0x1bd)));break;}console['error'](a38_0x4a6f04[_0x21042d(0x25f)](_0x21042d(0x26a)+_0x12484c*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x4a8b7b=>setTimeout(_0x4a8b7b,_0x2ba5d6)),_0x12484c++;}_0x12484c>=_0x4de691&&console[_0x21042d(0x248)](a38_0x4a6f04[_0x21042d(0x17e)]('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a38_0x2ddcbc(0x2af)](_0x4e5587,_0x3bd663,_0x4c7470){const _0x2be5d6=a38_0x2ddcbc,_0x5c9fa1=[],_0x2bbb6d=TIMELINE_CONFIG[_0x2be5d6(0x26d)],_0xfa5b3=0x5,_0xca81ce=process['stdout']['columns']||0x78,_0x4fdfe0=_0xca81ce-_0x2bbb6d-_0xfa5b3,_0x433128=Math['max'](TIMELINE_CONFIG[_0x2be5d6(0x164)],Math[_0x2be5d6(0x122)](_0x4fdfe0,TIMELINE_CONFIG[_0x2be5d6(0x234)])),_0x56c33a=new Date(_0x4e5587[_0x2be5d6(0x223)])[_0x2be5d6(0x14c)](),_0x305b2e=_0x4e5587[_0x2be5d6(0x235)]?new Date(_0x4e5587['finishedAt'])[_0x2be5d6(0x14c)]():Date[_0x2be5d6(0x12b)](),_0x372cab={'start':_0x56c33a,'end':_0x305b2e,'duration':_0x305b2e-_0x56c33a},_0x20c9cb=new Map(),_0xd0a626=[];for(const _0x1fe315 of _0x3bd663){if(_0x1fe315['startedAt']){const _0x31c276=new Date(_0x1fe315[_0x2be5d6(0x1ff)])['getTime'](),_0x244b23=_0x1fe315['updatedAt']?new Date(_0x1fe315[_0x2be5d6(0x1ee)])[_0x2be5d6(0x14c)]():Date[_0x2be5d6(0x12b)](),_0x30852b={'start':_0x31c276,'end':_0x244b23,'duration':_0x244b23-_0x31c276};_0x20c9cb[_0x2be5d6(0x17c)](_0x1fe315['id'],_0x30852b),_0xd0a626[_0x2be5d6(0x1d1)]({'name':_0x1fe315['fullName'],'state':_0x1fe315['state']||'unknown','window':_0x30852b});}else _0xd0a626[_0x2be5d6(0x1d1)]({'name':_0x1fe315['fullName'],'state':_0x1fe315[_0x2be5d6(0x18f)]||'planned','window':undefined});}_0xd0a626[_0x2be5d6(0x265)]((_0x1bac26,_0x5aa2e0)=>{const _0x3ba14e=_0x2be5d6;if(!_0x1bac26[_0x3ba14e(0x2ab)])return 0x1;if(!_0x5aa2e0[_0x3ba14e(0x2ab)])return-0x1;return _0x1bac26[_0x3ba14e(0x2ab)][_0x3ba14e(0x1e1)]-_0x5aa2e0[_0x3ba14e(0x2ab)]['start'];});const _0x47d999=_0xd0a626[_0x2be5d6(0x29c)],_0xaad469=_0x47d999>TIMELINE_CONFIG[_0x2be5d6(0x1bc)];_0xaad469&&_0xd0a626[_0x2be5d6(0x1dd)](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x33575e=calculateTimeScale(_0x372cab,_0x433128),_0x2c0bbd=_0x4e5587[_0x2be5d6(0x1a5)]?_0x4e5587[_0x2be5d6(0x293)]?a38_0x4a6f04['green'](_0x2be5d6(0x293)):a38_0x4a6f04[_0x2be5d6(0x170)](_0x2be5d6(0x248)):a38_0x4a6f04[_0x2be5d6(0x1f4)]('running'),_0x5641b4=_0x4e5587[_0x2be5d6(0x2b8)]?.['id'],_0x33c547=_0x4e5587[_0x2be5d6(0x13e)];let _0x18a3bf;if(_0x5641b4&&_0x33c547){const _0x388e52=getWorkflowAttemptUrl(_0x4c7470,_0x5641b4,_0x33c547,_0x4e5587['id']);_0x18a3bf=hyperlink(a38_0x4a6f04[_0x2be5d6(0x25f)](_0x4e5587['id']),_0x388e52);}else _0x18a3bf=a38_0x4a6f04[_0x2be5d6(0x25f)](_0x4e5587['id']);_0x5c9fa1['push'](_0x2be5d6(0x17a)+_0x18a3bf+'\x20-\x20'+_0x2c0bbd+_0x2be5d6(0x221)+formatElapsed(_0x372cab[_0x2be5d6(0x28f)]));if(_0xd0a626['length']>0x0){const _0x260465=renderTimeAxis(_0x33575e,_0x433128),_0x28e947=new Date(_0x372cab[_0x2be5d6(0x1e1)]),_0x55f983=formatDate(_0x28e947),_0x45b9a0=TIMELINE_CONFIG[_0x2be5d6(0x1b8)]+TIMELINE_CONFIG[_0x2be5d6(0x120)]+_0x2bbb6d,_0x409485=_0x55f983[_0x2be5d6(0x23d)](_0x45b9a0),_0x2085d4=a38_0x4a6f04[_0x2be5d6(0x25f)](_0x409485);_0x5c9fa1[_0x2be5d6(0x1d1)](_0x2085d4+'\x20'+_0x260465);for(const _0x3d14f3 of _0xd0a626){_0x5c9fa1[_0x2be5d6(0x1d1)](renderTaskRow(_0x3d14f3,_0x33575e,_0x433128,_0x2bbb6d));}const _0x34f8b8=calculateStats(_0xd0a626);_0x5c9fa1[_0x2be5d6(0x1d1)](formatStats(_0x34f8b8)),_0xaad469&&_0x5c9fa1['push'](a38_0x4a6f04[_0x2be5d6(0x17e)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0x2be5d6(0x1bc)]+_0x2be5d6(0x27f)+_0x47d999+_0x2be5d6(0x226))),_0x5c9fa1[_0x2be5d6(0x1d1)](''),_0x5c9fa1['push'](a38_0x4a6f04[_0x2be5d6(0x25f)](_0x2be5d6(0x1de))+(_0x2be5d6(0x199)+_0x4e5587['id']+_0x2be5d6(0x28c))+a38_0x4a6f04[_0x2be5d6(0x25f)]('\x20to\x20see\x20detailed\x20logs'));}else _0x5c9fa1[_0x2be5d6(0x1d1)]('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x5c9fa1[_0x2be5d6(0x12e)]('\x0a');}[a38_0x2ddcbc(0x1c9)](_0x340fbb,_0x2751b3){const _0x1acc1b=a38_0x2ddcbc,_0xc26a95=new Date(_0x340fbb[_0x1acc1b(0x223)])[_0x1acc1b(0x14c)](),_0x649c31=_0x340fbb['finishedAt']?new Date(_0x340fbb[_0x1acc1b(0x235)])['getTime']():Date['now'](),_0x28911e=_0x649c31-_0xc26a95,_0x45122c=[];for(const _0x5bc910 of _0x2751b3){if(_0x5bc910[_0x1acc1b(0x1ff)]){const _0x4a6be8=new Date(_0x5bc910['startedAt'])[_0x1acc1b(0x14c)](),_0x16b88c=_0x5bc910[_0x1acc1b(0x1ee)]?new Date(_0x5bc910['updatedAt'])[_0x1acc1b(0x14c)]():Date[_0x1acc1b(0x12b)]();_0x45122c[_0x1acc1b(0x1d1)]({'name':_0x5bc910[_0x1acc1b(0x286)],'state':_0x5bc910[_0x1acc1b(0x18f)]||'unknown','window':{'start':_0x4a6be8,'end':_0x16b88c,'duration':_0x16b88c-_0x4a6be8}});}else _0x45122c[_0x1acc1b(0x1d1)]({'name':_0x5bc910['fullName'],'state':_0x5bc910['state']||_0x1acc1b(0x19a),'window':undefined});}const _0x3cd06c=calculateStats(_0x45122c);return{'attempt':{'id':_0x340fbb['id'],'status':_0x340fbb[_0x1acc1b(0x1a5)]?_0x340fbb[_0x1acc1b(0x293)]?_0x1acc1b(0x293):_0x1acc1b(0x248):'running','createdAt':_0x340fbb['createdAt'],'finishedAt':_0x340fbb[_0x1acc1b(0x235)],'duration_ms':_0x28911e},'tasks':_0x45122c['map'](_0x596a86=>({'name':_0x596a86['name'],'state':_0x596a86['state'],'startedAt':_0x596a86[_0x1acc1b(0x2ab)]?new Date(_0x596a86[_0x1acc1b(0x2ab)][_0x1acc1b(0x1e1)])[_0x1acc1b(0x262)]():null,'updatedAt':_0x596a86['window']?new Date(_0x596a86[_0x1acc1b(0x2ab)][_0x1acc1b(0x229)])['toISOString']():null,'duration_ms':_0x596a86['window']?.[_0x1acc1b(0x28f)]||null})),'stats':_0x3cd06c};}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5b367e,_0x132b34){const _0x3f39df=a39_0x4fe1,_0x89526c=_0x5b367e();while(!![]){try{const _0x5d8495=-parseInt(_0x3f39df(0xe8))/0x1+parseInt(_0x3f39df(0xf1))/0x2*(parseInt(_0x3f39df(0xf2))/0x3)+-parseInt(_0x3f39df(0xef))/0x4+parseInt(_0x3f39df(0xf6))/0x5*(-parseInt(_0x3f39df(0xe5))/0x6)+-parseInt(_0x3f39df(0xea))/0x7*(-parseInt(_0x3f39df(0xe7))/0x8)+parseInt(_0x3f39df(0xeb))/0x9+parseInt(_0x3f39df(0xe6))/0xa*(-parseInt(_0x3f39df(0xf0))/0xb);if(_0x5d8495===_0x132b34)break;else _0x89526c['push'](_0x89526c['shift']());}catch(_0x2cdedf){_0x89526c['push'](_0x89526c['shift']());}}}(a39_0x6485,0x625e6));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x2d6eec=a39_0x4fe1,_0x2af942=getVersion(),_0x2add75=platform(),_0x1eac6b=process[_0x2d6eec(0xf5)][_0x2d6eec(0xe9)]('v','');return _0x2d6eec(0xf3)+_0x2af942+'\x20('+_0x2add75+';\x20node/'+_0x1eac6b+')';}function a39_0x6485(){const _0x3884a2=['6WkYZof','tdx/','X-Trino-User','version','10HAxxgQ','2309064SezXjv','40110Wdojbn','1752xEHuAd','324974yotsta','replace','25459ncSjUI','5157549fpEKKA','tdx','entries','Authorization','201580HYHZhE','583otGsrG','390994nTjJTw'];a39_0x6485=function(){return _0x3884a2;};return a39_0x6485();}export function getAuthHeaders(_0x4d7b5d,_0x2d3a1c){const _0x39b692=a39_0x4fe1,_0x3aa9a7=getVersion(),_0x2a3018={'User-Agent':getUserAgent(),'X-TD-Client':_0x39b692(0xec),'X-TD-Client-Version':_0x3aa9a7};return _0x2d3a1c&&(_0x2a3018[_0x39b692(0xee)]='TD1\x20'+_0x2d3a1c),_0x2a3018;}export function toHeaderRecord(_0xed9cca){const _0x133ded=a39_0x4fe1,_0x1127aa={};for(const [_0x24de29,_0x353030]of Object[_0x133ded(0xed)](_0xed9cca)){_0x353030!==undefined&&(_0x1127aa[_0x24de29]=_0x353030);}return _0x1127aa;}function a39_0x4fe1(_0x2137a7,_0x138520){_0x2137a7=_0x2137a7-0xe5;const _0x6485ae=a39_0x6485();let _0x4fe1ce=_0x6485ae[_0x2137a7];return _0x4fe1ce;}export function getTrinoHeaders(_0x4f7313,_0x420249){const _0x53e35f=a39_0x4fe1,_0x135ff6=getAuthHeaders(_0x4f7313,_0x420249),_0x47b57c=toHeaderRecord(_0x135ff6);return delete _0x47b57c[_0x53e35f(0xee)],_0x420249&&(_0x47b57c[_0x53e35f(0xf4)]=_0x420249),_0x47b57c;}export function hasAPIKey(_0x3b00ec){const _0x3f3221=getAPIKey(_0x3b00ec);return _0x3f3221!==undefined&&_0x3f3221['length']>0x0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x245708,_0x405c53){const _0x587a6d=a40_0x2c0e,_0x129ab9=_0x245708();while(!![]){try{const _0x17d0e2=-parseInt(_0x587a6d(0x163))/0x1+parseInt(_0x587a6d(0x15e))/0x2*(parseInt(_0x587a6d(0x160))/0x3)+parseInt(_0x587a6d(0x14a))/0x4*(-parseInt(_0x587a6d(0x149))/0x5)+parseInt(_0x587a6d(0x14d))/0x6+-parseInt(_0x587a6d(0x127))/0x7*(-parseInt(_0x587a6d(0x12d))/0x8)+-parseInt(_0x587a6d(0x138))/0x9+parseInt(_0x587a6d(0x148))/0xa;if(_0x17d0e2===_0x405c53)break;else _0x129ab9['push'](_0x129ab9['shift']());}catch(_0xc9d955){_0x129ab9['push'](_0x129ab9['shift']());}}}(a40_0x2940,0xe079c));function a40_0x2c0e(_0x553b40,_0x63d9dc){_0x553b40=_0x553b40-0x127;const _0x2940a2=a40_0x2940();let _0x2c0e1d=_0x2940a2[_0x553b40];return _0x2c0e1d;}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';function a40_0x2940(){const _0x258966=['stdout','params','filter','10600DNzmub','-FXRSn','format','sdk-result','color','jsonl','bold','[logs]','push','debug','trim','16222410MwVywq','blue','[params]','─┴─','map','write','isTTY','entries','string','repeat','keys','stdin','output','max','resolve','query','32284370rpzhnE','1528775xTXPAe','4KWMdvd','yellow','boolean','5109228Xejjmb','list','object','less','rule','padEnd','limit','red','[query]','close','isInteger','tsv','log','double','varchar','split','─┬─','308xFtjnf','noColor','6987cPbjVh','json','spawn','1784594sQuAxg','cyan','stderr','table','end','forEach','length','error','1974Liuhgq','pipe','stringify'];a40_0x2940=function(){return _0x258966;};return a40_0x2940();}import a40_0x394472 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x4e62cd){const _0x33ccc7=a40_0x2c0e;return _0x4e62cd[_0x33ccc7(0x12f)]===_0x33ccc7(0x161)||_0x4e62cd[_0x33ccc7(0x12f)]===_0x33ccc7(0x132)||_0x4e62cd[_0x33ccc7(0x12f)]==='tsv'||_0x4e62cd['format']===_0x33ccc7(0x166)||_0x4e62cd['json']===!![]||_0x4e62cd[_0x33ccc7(0x132)]===!![]||_0x4e62cd[_0x33ccc7(0x158)]===!![]||_0x4e62cd[_0x33ccc7(0x166)]===!![];}export function parseOutputOptions(_0x33cf6e){const _0x24ca35=a40_0x2c0e;return{'format':_0x33cf6e[_0x24ca35(0x12f)]||'table','output':_0x33cf6e[_0x24ca35(0x144)]||'','limit':_0x33cf6e[_0x24ca35(0x153)],'color':_0x33cf6e[_0x24ca35(0x131)],'noColor':_0x33cf6e['noColor']};}function convertSDKResultToQueryResult(_0x5a4c7f){const _0x1bd0d7=a40_0x2c0e,_0x1cd5ba=[];if(_0x5a4c7f[_0x1bd0d7(0x169)]>0x0){const _0x1294e3=_0x5a4c7f[0x0];for(const [_0x5ce0a8,_0x43071a]of Object['entries'](_0x1294e3)){let _0x3768a=_0x1bd0d7(0x15b);if(typeof _0x43071a==='number')_0x3768a=Number[_0x1bd0d7(0x157)](_0x43071a)?'bigint':_0x1bd0d7(0x15a);else{if(typeof _0x43071a===_0x1bd0d7(0x14c))_0x3768a=_0x1bd0d7(0x14c);else _0x43071a===null&&(_0x3768a='varchar');}_0x1cd5ba['push']({'name':_0x5ce0a8,'type':_0x3768a});}}return{'queryId':_0x1bd0d7(0x130),'columns':_0x1cd5ba,'data':_0x5a4c7f,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x5a4c7f['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x299065,_0xa5a55f){const _0x34ddc=convertSDKResultToQueryResult(_0x299065);return formatQueryOutput(_0x34ddc,_0xa5a55f);}export async function formatQueryOutput(_0x68152,_0x7eb963){const _0x3294d4=a40_0x2c0e,{format:_0x4daddd,limit:_0x1a6413,output:_0x2194e0,color:_0x101e2a,noColor:_0x4b3f47}=_0x7eb963,_0x574642=Boolean(_0x2194e0)&&!_0x101e2a,_0x3e6753={'color':_0x101e2a,'noColor':_0x4b3f47||_0x574642};if(_0x4daddd===_0x3294d4(0x166)){const _0x457954=shouldUseLess(_0x4daddd,_0x2194e0);return formatAsTable(_0x68152,_0x1a6413,_0x457954,_0x3e6753);}else{if(_0x4daddd===_0x3294d4(0x161))return formatAsJSON(_0x68152,_0x3e6753);else return _0x4daddd===_0x3294d4(0x132)?formatAsJSONL(_0x68152,_0x3e6753):formatQueryResult(_0x68152,_0x4daddd);}}function shouldUseLess(_0x124414,_0x51a932){const _0xa4eda=a40_0x2c0e;return(_0x124414===_0xa4eda(0x166)||_0x124414===_0xa4eda(0x14e))&&process[_0xa4eda(0x12a)][_0xa4eda(0x13e)]&&!_0x51a932;}export function resolveOutputOptions(_0x587084){const _0x470ce3=a40_0x2c0e,_0x22b457=resolveOutputFormat(_0x587084['format'],_0x587084[_0x470ce3(0x144)],_0x470ce3(0x166));let _0x88c8fb=typeof _0x587084[_0x470ce3(0x153)]==='number'?_0x587084[_0x470ce3(0x153)]:parseInt(_0x587084[_0x470ce3(0x153)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x16602a=_0x587084[_0x470ce3(0x144)]||'';return shouldUseLess(_0x22b457,_0x16602a)&&(_0x88c8fb=Infinity),{'format':_0x22b457,'output':_0x16602a,'limit':_0x88c8fb,'color':_0x587084[_0x470ce3(0x131)],'noColor':_0x587084[_0x470ce3(0x15f)]};}export function writeOutput(_0x20250a,_0x2b5b82,_0x291b98){const _0x3a65f2=a40_0x2c0e;return _0x2b5b82?(writeFileSync(_0x2b5b82,_0x20250a),console['error']('Results\x20saved\x20to\x20'+_0x2b5b82),Promise[_0x3a65f2(0x146)]()):shouldUseLess(_0x291b98||'','')?new Promise(_0x31ef44=>{const _0x569098=_0x3a65f2,_0x26784a=spawn(_0x569098(0x150),[_0x569098(0x12e)],{'stdio':[_0x569098(0x128),'inherit','inherit']});let _0xc42a11=![];_0x26784a['on'](_0x569098(0x16a),()=>{const _0x874388=_0x569098;!_0xc42a11&&(_0xc42a11=!![],console[_0x874388(0x159)](_0x20250a),_0x31ef44());}),_0x26784a['on'](_0x569098(0x156),()=>{!_0xc42a11&&(_0xc42a11=!![],_0x31ef44());}),_0x26784a['on'](_0x569098(0x162),()=>{const _0x4a7a4c=_0x569098;!_0xc42a11&&_0x26784a['stdin']&&(_0x26784a[_0x4a7a4c(0x143)]['on'](_0x4a7a4c(0x16a),()=>{}),_0x26784a[_0x4a7a4c(0x143)][_0x4a7a4c(0x13d)](_0x20250a),_0x26784a[_0x4a7a4c(0x143)][_0x4a7a4c(0x167)]());}),!_0x26784a[_0x569098(0x143)]&&(!_0xc42a11&&(_0xc42a11=!![],console[_0x569098(0x159)](_0x20250a),_0x31ef44()));}):(console[_0x3a65f2(0x159)](_0x20250a),Promise['resolve']());}export async function handleSDKOutput(_0xb119f6,_0x1fe20f){const _0x4f5a40=a40_0x2c0e,_0x296499=resolveOutputOptions(_0x1fe20f),_0x490d07=await formatSDKOutput(_0xb119f6,_0x296499);await writeOutput(_0x490d07,_0x296499['output']||undefined,_0x296499[_0x4f5a40(0x12f)]);}export async function handleQueryOutput(_0x3d0a80,_0x1ae72c){const _0x384d62=a40_0x2c0e,_0x581aa9=resolveOutputOptions(_0x1ae72c),_0x5ae611=await formatQueryOutput(_0x3d0a80,_0x581aa9);await writeOutput(_0x5ae611,_0x581aa9['output']||undefined,_0x581aa9[_0x384d62(0x12f)]);}async function formatSingleObject(_0x1c0f8e,_0x102dee){const _0x25bc7d=a40_0x2c0e,{format:_0x5abe69,color:_0x3684f4,noColor:_0x3c0d2d}=_0x102dee,_0x5aa02a={'color':_0x3684f4,'noColor':_0x3c0d2d};if(_0x5abe69===_0x25bc7d(0x161)){if(shouldUseColor(_0x5aa02a))return colorizeJSON(_0x1c0f8e,_0x5aa02a);return JSON[_0x25bc7d(0x129)](_0x1c0f8e,null,0x2);}else{if(_0x5abe69==='jsonl'){if(shouldUseColor(_0x5aa02a))return colorizeJSONCompact(_0x1c0f8e,_0x5aa02a);return JSON[_0x25bc7d(0x129)](_0x1c0f8e);}else{if(_0x5abe69===_0x25bc7d(0x158))return Object[_0x25bc7d(0x13f)](_0x1c0f8e)[_0x25bc7d(0x13c)](([_0x3a76b4,_0x19097f])=>_0x3a76b4+'\x09'+_0x19097f)['join']('\x0a');else{const _0x5f3b78=Object['entries'](_0x1c0f8e);if(_0x5f3b78[_0x25bc7d(0x169)]===0x0)return'No\x20data';const _0x45d01f=_0x1c0f8e[_0x25bc7d(0x136)],_0x7f2016=_0x1c0f8e[_0x25bc7d(0x147)],_0x4c5580=_0x1c0f8e[_0x25bc7d(0x12b)],_0x332ab1=_0x1c0f8e[_0x25bc7d(0x151)],_0x3e3334=_0x7f2016?typeof _0x7f2016===_0x25bc7d(0x140)?_0x7f2016:JSON[_0x25bc7d(0x129)](_0x7f2016,null,0x2):undefined,_0x5755eb=_0x4c5580&&Object['keys'](_0x4c5580)['length']>0x0?JSON[_0x25bc7d(0x129)](_0x4c5580,null,0x2):undefined,_0x407815=_0x332ab1&&Object[_0x25bc7d(0x142)](_0x332ab1)[_0x25bc7d(0x169)]>0x0?JSON['stringify'](_0x332ab1,null,0x2):undefined,_0x45f9c1=_0x5f3b78[_0x25bc7d(0x12c)](([_0x4e080d])=>_0x4e080d!==_0x25bc7d(0x136)&&_0x4e080d!=='query'&&_0x4e080d!==_0x25bc7d(0x12b)&&_0x4e080d!=='rule'),_0x262fa1=Math[_0x25bc7d(0x145)](..._0x45f9c1[_0x25bc7d(0x13c)](([_0x570522])=>_0x570522[_0x25bc7d(0x169)])),_0x283347=Math[_0x25bc7d(0x145)](..._0x45f9c1[_0x25bc7d(0x13c)](([,_0x36ea31])=>{const _0x3c1336=_0x25bc7d;try{const _0x50ac4f=_0x36ea31===null||_0x36ea31===undefined?'':typeof _0x36ea31===_0x3c1336(0x14f)?JSON[_0x3c1336(0x129)](_0x36ea31):String(_0x36ea31),_0x337dab=_0x50ac4f[_0x3c1336(0x15c)]('\x0a');return Math[_0x3c1336(0x145)](..._0x337dab[_0x3c1336(0x13c)](_0x15ffd4=>_0x15ffd4[_0x3c1336(0x169)]),0x0);}catch{return 0x0;}}),0x14),_0x37bfd5=[];_0x37bfd5[_0x25bc7d(0x135)](colorBorder('┌─'+'─'[_0x25bc7d(0x141)](_0x262fa1)+_0x25bc7d(0x15d)+'─'[_0x25bc7d(0x141)](_0x283347)+'─┐',_0x5aa02a)),_0x45f9c1[_0x25bc7d(0x168)](([_0x380c0c,_0x284b58])=>{const _0x3232fa=_0x25bc7d;let _0x41d08f;try{_0x41d08f=_0x284b58===null||_0x284b58===undefined?'':typeof _0x284b58===_0x3232fa(0x14f)?JSON[_0x3232fa(0x129)](_0x284b58):String(_0x284b58);}catch{_0x41d08f='[Object]';}const _0x58674e=_0x380c0c['padEnd'](_0x262fa1),_0x28b7e4=_0x41d08f[_0x3232fa(0x15c)]('\x0a');_0x28b7e4['forEach']((_0x486027,_0x5a6ffd)=>{const _0x315902=_0x3232fa,_0x3872ae=colorBorder('│',_0x5aa02a);_0x5a6ffd===0x0?_0x37bfd5[_0x315902(0x135)](_0x3872ae+'\x20'+_0x58674e+'\x20'+_0x3872ae+'\x20'+_0x486027[_0x315902(0x152)](_0x283347)+'\x20'+_0x3872ae):_0x37bfd5[_0x315902(0x135)](_0x3872ae+'\x20'+'\x20'['repeat'](_0x262fa1)+'\x20'+_0x3872ae+'\x20'+_0x486027['padEnd'](_0x283347)+'\x20'+_0x3872ae);});}),_0x37bfd5[_0x25bc7d(0x135)](colorBorder('└─'+'─'[_0x25bc7d(0x141)](_0x262fa1)+_0x25bc7d(0x13b)+'─'[_0x25bc7d(0x141)](_0x283347)+'─┘',_0x5aa02a));_0x3e3334&&(_0x37bfd5[_0x25bc7d(0x135)](''),_0x37bfd5[_0x25bc7d(0x135)](String(a40_0x394472[_0x25bc7d(0x14b)][_0x25bc7d(0x133)](_0x25bc7d(0x155)))),_0x37bfd5['push'](_0x3e3334));_0x5755eb&&(_0x37bfd5[_0x25bc7d(0x135)](''),_0x37bfd5[_0x25bc7d(0x135)](String(a40_0x394472[_0x25bc7d(0x139)]['bold'](_0x25bc7d(0x13a)))),_0x37bfd5[_0x25bc7d(0x135)](_0x5755eb));_0x407815&&(_0x37bfd5[_0x25bc7d(0x135)](''),_0x37bfd5['push'](String(a40_0x394472['magenta'][_0x25bc7d(0x133)]('[rule]'))),_0x37bfd5[_0x25bc7d(0x135)](_0x407815));if(_0x45d01f){if(_0x45d01f[_0x25bc7d(0x165)]){_0x37bfd5['push'](''),_0x37bfd5[_0x25bc7d(0x135)](String(a40_0x394472[_0x25bc7d(0x154)]['bold']('[error]')));const _0xab632=_0x45d01f['stderr'][_0x25bc7d(0x15c)]('\x0a');_0xab632[_0x25bc7d(0x168)](_0x3fe421=>{const _0x20d6bf=_0x25bc7d;_0x3fe421[_0x20d6bf(0x137)]()&&_0x37bfd5[_0x20d6bf(0x135)](_0x3fe421);});}if(_0x45d01f['cmdout']){_0x37bfd5['push'](''),_0x37bfd5[_0x25bc7d(0x135)](String(a40_0x394472[_0x25bc7d(0x164)][_0x25bc7d(0x133)](_0x25bc7d(0x134))));const _0xb079e4=_0x45d01f['cmdout'][_0x25bc7d(0x15c)]('\x0a');_0xb079e4[_0x25bc7d(0x168)](_0x370cd1=>{const _0x286ef5=_0x25bc7d;_0x370cd1['trim']()&&_0x37bfd5[_0x286ef5(0x135)](_0x370cd1);});}}return _0x37bfd5['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x47b2d7,_0x513549){const _0x1d045d=a40_0x2c0e;if(_0x513549[_0x1d045d(0x12f)]===_0x1d045d(0x166)){await handleSDKOutput([_0x47b2d7],_0x513549);return;}const _0x2f541f=resolveOutputOptions(_0x513549),_0x43c1b0=await formatSingleObject(_0x47b2d7,_0x2f541f);await writeOutput(_0x43c1b0,_0x2f541f[_0x1d045d(0x144)]||undefined,_0x2f541f[_0x1d045d(0x12f)]);}
|
|
1
|
+
(function(_0x46e15b,_0x3b58e4){const _0x1c289a=a40_0x20f0,_0x496ca5=_0x46e15b();while(!![]){try{const _0x5d119c=-parseInt(_0x1c289a(0xa2))/0x1+-parseInt(_0x1c289a(0xc5))/0x2*(-parseInt(_0x1c289a(0xac))/0x3)+-parseInt(_0x1c289a(0xa6))/0x4*(-parseInt(_0x1c289a(0xa5))/0x5)+parseInt(_0x1c289a(0xab))/0x6*(-parseInt(_0x1c289a(0x93))/0x7)+parseInt(_0x1c289a(0x96))/0x8+-parseInt(_0x1c289a(0x91))/0x9+parseInt(_0x1c289a(0xb1))/0xa;if(_0x5d119c===_0x3b58e4)break;else _0x496ca5['push'](_0x496ca5['shift']());}catch(_0x1710df){_0x496ca5['push'](_0x496ca5['shift']());}}}(a40_0x346a,0xdc642));function a40_0x346a(){const _0xfc70a0=['forEach','varchar','push','rule','jsonl','error','color','object','sdk-result','less','181790zFLfQk','[Object]','isTTY','720EiyVzz','42200QTcgGi','length','debug','Results\x20saved\x20to\x20','repeat','6RTIJeC','66eTVMmd','stringify','boolean','write','json','4149450vhlTKZ','cyan','pipe','bigint','spawn','format','split','padEnd','keys','max','[query]','noColor','stdin','limit','end','map','tsv','yellow','filter','stderr','161862BywthJ','params','─┴─','magenta','table','[error]','red','close','[logs]','-FXRSn','number','resolve','bold','entries','trim','stdout','log','isInteger','output','10562913eoJZOC','double','12066796FbBUPa','inherit','join','2138960tNifbi','query'];a40_0x346a=function(){return _0xfc70a0;};return a40_0x346a();}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 a40_0x43f7ee from'chalk';function a40_0x20f0(_0xdb3271,_0x4f5f06){_0xdb3271=_0xdb3271-0x87;const _0x346a1b=a40_0x346a();let _0x20f0f3=_0x346a1b[_0xdb3271];return _0x20f0f3;}import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x18a85f){const _0xa77ddf=a40_0x20f0;return _0x18a85f[_0xa77ddf(0xb6)]===_0xa77ddf(0xb0)||_0x18a85f['format']===_0xa77ddf(0x9c)||_0x18a85f['format']===_0xa77ddf(0xc1)||_0x18a85f[_0xa77ddf(0xb6)]===_0xa77ddf(0xc9)||_0x18a85f['json']===!![]||_0x18a85f['jsonl']===!![]||_0x18a85f[_0xa77ddf(0xc1)]===!![]||_0x18a85f[_0xa77ddf(0xc9)]===!![];}export function parseOutputOptions(_0x43ea5f){const _0x3bb1c0=a40_0x20f0;return{'format':_0x43ea5f[_0x3bb1c0(0xb6)]||_0x3bb1c0(0xc9),'output':_0x43ea5f[_0x3bb1c0(0x90)]||'','limit':_0x43ea5f['limit'],'color':_0x43ea5f[_0x3bb1c0(0x9e)],'noColor':_0x43ea5f[_0x3bb1c0(0xbc)]};}function convertSDKResultToQueryResult(_0x5c1416){const _0x1953c4=a40_0x20f0,_0x3f43b2=[];if(_0x5c1416[_0x1953c4(0xa7)]>0x0){const _0x172b20=_0x5c1416[0x0];for(const [_0x440315,_0x2cafbc]of Object['entries'](_0x172b20)){let _0x2aff18='varchar';if(typeof _0x2cafbc===_0x1953c4(0x88))_0x2aff18=Number[_0x1953c4(0x8f)](_0x2cafbc)?_0x1953c4(0xb4):_0x1953c4(0x92);else{if(typeof _0x2cafbc==='boolean')_0x2aff18=_0x1953c4(0xae);else _0x2cafbc===null&&(_0x2aff18=_0x1953c4(0x99));}_0x3f43b2[_0x1953c4(0x9a)]({'name':_0x440315,'type':_0x2aff18});}}return{'queryId':_0x1953c4(0xa0),'columns':_0x3f43b2,'data':_0x5c1416,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x5c1416[_0x1953c4(0xa7)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x1ca577,_0x51ef62){const _0x261be2=convertSDKResultToQueryResult(_0x1ca577);return formatQueryOutput(_0x261be2,_0x51ef62);}export async function formatQueryOutput(_0x10c020,_0x261ee2){const _0x59c786=a40_0x20f0,{format:_0x13986c,limit:_0x14ceec,output:_0x17568b,color:_0x4fd70f,noColor:_0x5d1927}=_0x261ee2,_0x4f2e79=Boolean(_0x17568b)&&!_0x4fd70f,_0x1e6113={'color':_0x4fd70f,'noColor':_0x5d1927||_0x4f2e79};if(_0x13986c===_0x59c786(0xc9)){const _0xbe5de8=shouldUseLess(_0x13986c,_0x17568b);return formatAsTable(_0x10c020,_0x14ceec,_0xbe5de8,_0x1e6113);}else{if(_0x13986c===_0x59c786(0xb0))return formatAsJSON(_0x10c020,_0x1e6113);else return _0x13986c===_0x59c786(0x9c)?formatAsJSONL(_0x10c020,_0x1e6113):formatQueryResult(_0x10c020,_0x13986c);}}function shouldUseLess(_0x2ae66e,_0x47a56f){const _0xdfc5b5=a40_0x20f0;return(_0x2ae66e==='table'||_0x2ae66e==='list')&&process[_0xdfc5b5(0x8d)][_0xdfc5b5(0xa4)]&&!_0x47a56f;}export function resolveOutputOptions(_0x336bfe){const _0x275c2d=a40_0x20f0,_0x757271=resolveOutputFormat(_0x336bfe[_0x275c2d(0xb6)],_0x336bfe[_0x275c2d(0x90)],'table');let _0x3840a0=typeof _0x336bfe[_0x275c2d(0xbe)]===_0x275c2d(0x88)?_0x336bfe[_0x275c2d(0xbe)]:parseInt(_0x336bfe[_0x275c2d(0xbe)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0xb685db=_0x336bfe[_0x275c2d(0x90)]||'';return shouldUseLess(_0x757271,_0xb685db)&&(_0x3840a0=Infinity),{'format':_0x757271,'output':_0xb685db,'limit':_0x3840a0,'color':_0x336bfe[_0x275c2d(0x9e)],'noColor':_0x336bfe[_0x275c2d(0xbc)]};}export function writeOutput(_0x614b0,_0x38bcb3,_0x270812){const _0x5774ef=a40_0x20f0;return _0x38bcb3?(writeFileSync(_0x38bcb3,_0x614b0),console[_0x5774ef(0x9d)](_0x5774ef(0xa9)+_0x38bcb3),Promise['resolve']()):shouldUseLess(_0x270812||'','')?new Promise(_0x5bd6fb=>{const _0x239989=_0x5774ef,_0x8ed16b=spawn(_0x239989(0xa1),[_0x239989(0x87)],{'stdio':[_0x239989(0xb3),'inherit',_0x239989(0x94)]});let _0x1ac476=![];_0x8ed16b['on'](_0x239989(0x9d),()=>{const _0x142bcc=_0x239989;!_0x1ac476&&(_0x1ac476=!![],console[_0x142bcc(0x8e)](_0x614b0),_0x5bd6fb());}),_0x8ed16b['on'](_0x239989(0xcc),()=>{!_0x1ac476&&(_0x1ac476=!![],_0x5bd6fb());}),_0x8ed16b['on'](_0x239989(0xb5),()=>{const _0x356cf2=_0x239989;!_0x1ac476&&_0x8ed16b[_0x356cf2(0xbd)]&&(_0x8ed16b['stdin']['on'](_0x356cf2(0x9d),()=>{}),_0x8ed16b[_0x356cf2(0xbd)][_0x356cf2(0xaf)](_0x614b0),_0x8ed16b[_0x356cf2(0xbd)][_0x356cf2(0xbf)]());}),!_0x8ed16b['stdin']&&(!_0x1ac476&&(_0x1ac476=!![],console[_0x239989(0x8e)](_0x614b0),_0x5bd6fb()));}):(console[_0x5774ef(0x8e)](_0x614b0),Promise[_0x5774ef(0x89)]());}export async function handleSDKOutput(_0x30d900,_0x29d743){const _0x5702e3=a40_0x20f0,_0x3aa666=resolveOutputOptions(_0x29d743),_0x4cb938=await formatSDKOutput(_0x30d900,_0x3aa666);await writeOutput(_0x4cb938,_0x3aa666[_0x5702e3(0x90)]||undefined,_0x3aa666['format']);}export async function handleQueryOutput(_0x58975c,_0x352177){const _0x2dddf1=a40_0x20f0,_0x89e436=resolveOutputOptions(_0x352177),_0x72228e=await formatQueryOutput(_0x58975c,_0x89e436);await writeOutput(_0x72228e,_0x89e436[_0x2dddf1(0x90)]||undefined,_0x89e436['format']);}async function formatSingleObject(_0x1b7343,_0xe83150){const _0x3ce7d3=a40_0x20f0,{format:_0x2cfa50,color:_0x3c2d41,noColor:_0x2b3f4b}=_0xe83150,_0x39aeab={'color':_0x3c2d41,'noColor':_0x2b3f4b};if(_0x2cfa50==='json'){if(shouldUseColor(_0x39aeab))return colorizeJSON(_0x1b7343,_0x39aeab);return JSON['stringify'](_0x1b7343,null,0x2);}else{if(_0x2cfa50===_0x3ce7d3(0x9c)){if(shouldUseColor(_0x39aeab))return colorizeJSONCompact(_0x1b7343,_0x39aeab);return JSON[_0x3ce7d3(0xad)](_0x1b7343);}else{if(_0x2cfa50===_0x3ce7d3(0xc1))return Object[_0x3ce7d3(0x8b)](_0x1b7343)[_0x3ce7d3(0xc0)](([_0x51e81c,_0x3f2d5c])=>_0x51e81c+'\x09'+_0x3f2d5c)[_0x3ce7d3(0x95)]('\x0a');else{const _0x249682=Object[_0x3ce7d3(0x8b)](_0x1b7343);if(_0x249682['length']===0x0)return'No\x20data';const _0x2b93e5=_0x1b7343[_0x3ce7d3(0xa8)],_0xe0ae79=_0x1b7343[_0x3ce7d3(0x97)],_0x7b0bc3=_0x1b7343[_0x3ce7d3(0xc6)],_0x29ce2e=_0x1b7343['rule'],_0x2dd952=_0xe0ae79?typeof _0xe0ae79==='string'?_0xe0ae79:JSON['stringify'](_0xe0ae79,null,0x2):undefined,_0x2379e1=_0x7b0bc3&&Object[_0x3ce7d3(0xb9)](_0x7b0bc3)[_0x3ce7d3(0xa7)]>0x0?JSON['stringify'](_0x7b0bc3,null,0x2):undefined,_0x231baf=_0x29ce2e&&Object[_0x3ce7d3(0xb9)](_0x29ce2e)[_0x3ce7d3(0xa7)]>0x0?JSON[_0x3ce7d3(0xad)](_0x29ce2e,null,0x2):undefined,_0x1c2ef0=_0x249682[_0x3ce7d3(0xc3)](([_0xa4d827])=>_0xa4d827!=='debug'&&_0xa4d827!==_0x3ce7d3(0x97)&&_0xa4d827!==_0x3ce7d3(0xc6)&&_0xa4d827!==_0x3ce7d3(0x9b)),_0x25780c=Math['max'](..._0x1c2ef0[_0x3ce7d3(0xc0)](([_0x47b89e])=>_0x47b89e[_0x3ce7d3(0xa7)])),_0x375356=Math[_0x3ce7d3(0xba)](..._0x1c2ef0[_0x3ce7d3(0xc0)](([,_0x4f7b04])=>{const _0x182e0e=_0x3ce7d3;try{const _0x2f5b05=_0x4f7b04===null||_0x4f7b04===undefined?'':typeof _0x4f7b04===_0x182e0e(0x9f)?JSON[_0x182e0e(0xad)](_0x4f7b04):String(_0x4f7b04),_0x3a6175=_0x2f5b05[_0x182e0e(0xb7)]('\x0a');return Math[_0x182e0e(0xba)](..._0x3a6175[_0x182e0e(0xc0)](_0x41f51c=>_0x41f51c[_0x182e0e(0xa7)]),0x0);}catch{return 0x0;}}),0x14),_0x21ab92=[];_0x21ab92[_0x3ce7d3(0x9a)](colorBorder('┌─'+'─'['repeat'](_0x25780c)+'─┬─'+'─'[_0x3ce7d3(0xaa)](_0x375356)+'─┐',_0x39aeab)),_0x1c2ef0[_0x3ce7d3(0x98)](([_0x4412c5,_0x32f838])=>{const _0x14b769=_0x3ce7d3;let _0xd16e5d;try{_0xd16e5d=_0x32f838===null||_0x32f838===undefined?'':typeof _0x32f838===_0x14b769(0x9f)?JSON[_0x14b769(0xad)](_0x32f838):String(_0x32f838);}catch{_0xd16e5d=_0x14b769(0xa3);}const _0xfd90d8=_0x4412c5[_0x14b769(0xb8)](_0x25780c),_0x834d6c=_0xd16e5d[_0x14b769(0xb7)]('\x0a');_0x834d6c['forEach']((_0x19cd8f,_0x3034b2)=>{const _0x5ee3c9=_0x14b769,_0x5be572=colorBorder('│',_0x39aeab);_0x3034b2===0x0?_0x21ab92['push'](_0x5be572+'\x20'+_0xfd90d8+'\x20'+_0x5be572+'\x20'+_0x19cd8f['padEnd'](_0x375356)+'\x20'+_0x5be572):_0x21ab92[_0x5ee3c9(0x9a)](_0x5be572+'\x20'+'\x20'[_0x5ee3c9(0xaa)](_0x25780c)+'\x20'+_0x5be572+'\x20'+_0x19cd8f[_0x5ee3c9(0xb8)](_0x375356)+'\x20'+_0x5be572);});}),_0x21ab92[_0x3ce7d3(0x9a)](colorBorder('└─'+'─'['repeat'](_0x25780c)+_0x3ce7d3(0xc7)+'─'[_0x3ce7d3(0xaa)](_0x375356)+'─┘',_0x39aeab));_0x2dd952&&(_0x21ab92[_0x3ce7d3(0x9a)](''),_0x21ab92[_0x3ce7d3(0x9a)](String(a40_0x43f7ee[_0x3ce7d3(0xc2)][_0x3ce7d3(0x8a)](_0x3ce7d3(0xbb)))),_0x21ab92[_0x3ce7d3(0x9a)](_0x2dd952));_0x2379e1&&(_0x21ab92[_0x3ce7d3(0x9a)](''),_0x21ab92[_0x3ce7d3(0x9a)](String(a40_0x43f7ee['blue'][_0x3ce7d3(0x8a)]('[params]'))),_0x21ab92['push'](_0x2379e1));_0x231baf&&(_0x21ab92['push'](''),_0x21ab92[_0x3ce7d3(0x9a)](String(a40_0x43f7ee[_0x3ce7d3(0xc8)][_0x3ce7d3(0x8a)]('[rule]'))),_0x21ab92[_0x3ce7d3(0x9a)](_0x231baf));if(_0x2b93e5){if(_0x2b93e5['stderr']){_0x21ab92[_0x3ce7d3(0x9a)](''),_0x21ab92[_0x3ce7d3(0x9a)](String(a40_0x43f7ee[_0x3ce7d3(0xcb)][_0x3ce7d3(0x8a)](_0x3ce7d3(0xca))));const _0x422a4b=_0x2b93e5[_0x3ce7d3(0xc4)][_0x3ce7d3(0xb7)]('\x0a');_0x422a4b['forEach'](_0x14d2dd=>{const _0x53614a=_0x3ce7d3;_0x14d2dd[_0x53614a(0x8c)]()&&_0x21ab92[_0x53614a(0x9a)](_0x14d2dd);});}if(_0x2b93e5['cmdout']){_0x21ab92['push'](''),_0x21ab92[_0x3ce7d3(0x9a)](String(a40_0x43f7ee[_0x3ce7d3(0xb2)][_0x3ce7d3(0x8a)](_0x3ce7d3(0xcd))));const _0x245cd7=_0x2b93e5['cmdout']['split']('\x0a');_0x245cd7[_0x3ce7d3(0x98)](_0x559993=>{const _0x11f113=_0x3ce7d3;_0x559993['trim']()&&_0x21ab92[_0x11f113(0x9a)](_0x559993);});}}return _0x21ab92[_0x3ce7d3(0x95)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x57ac9c,_0x58090f){const _0x15900f=a40_0x20f0;if(_0x58090f['format']==='table'){await handleSDKOutput([_0x57ac9c],_0x58090f);return;}const _0x373f0b=resolveOutputOptions(_0x58090f),_0x47dab4=await formatSingleObject(_0x57ac9c,_0x373f0b);await writeOutput(_0x47dab4,_0x373f0b[_0x15900f(0x90)]||undefined,_0x373f0b[_0x15900f(0xb6)]);}
|