@treasuredata/tdx 0.14.0 → 0.14.2
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.d.ts.map +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js.map +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.d.ts +60 -0
- package/dist/sdk/workflow/workflow-utils.d.ts.map +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js.map +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 +2 -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_0x11e0cd=a38_0x2afe;(function(_0x58e279,_0xc79215){const _0x4775b5=a38_0x2afe,_0x443456=_0x58e279();while(!![]){try{const _0x39bb9f=parseInt(_0x4775b5(0x302))/0x1+-parseInt(_0x4775b5(0x1fc))/0x2*(parseInt(_0x4775b5(0x2d9))/0x3)+parseInt(_0x4775b5(0x1ec))/0x4+parseInt(_0x4775b5(0x22f))/0x5+parseInt(_0x4775b5(0x303))/0x6*(-parseInt(_0x4775b5(0x2a4))/0x7)+parseInt(_0x4775b5(0x337))/0x8*(parseInt(_0x4775b5(0x21d))/0x9)+-parseInt(_0x4775b5(0x1cc))/0xa;if(_0x39bb9f===_0xc79215)break;else _0x443456['push'](_0x443456['shift']());}catch(_0xf18969){_0x443456['push'](_0x443456['shift']());}}}(a38_0xba68,0xef8fb));import a38_0x123249 from'chalk';import{existsSync}from'fs';import a38_0x1d077e 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';function a38_0x2afe(_0x9c9e8e,_0x5b8f9b){_0x9c9e8e=_0x9c9e8e-0x1b2;const _0xba68ef=a38_0xba68();let _0x2afe05=_0xba68ef[_0x9c9e8e];return _0x2afe05;}import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a38_0x396379 from'prompts';function getAttemptStatusDisplay(_0x15bc82){const _0x187f33=a38_0x2afe;if(!_0x15bc82)return{'icon':'⏳','text':''};const {done:_0x1592a8,success:_0x2923fd,cancelRequested:_0x54cf37}=_0x15bc82;if(!_0x1592a8)return _0x54cf37?{'icon':'🛑','text':a38_0x123249[_0x187f33(0x2e2)](_0x187f33(0x1c0))}:{'icon':'🔄','text':a38_0x123249[_0x187f33(0x20e)](_0x187f33(0x2b7))};if(_0x2923fd)return{'icon':'✅','text':a38_0x123249[_0x187f33(0x340)](_0x187f33(0x309))};return{'icon':'❌','text':a38_0x123249[_0x187f33(0x1d1)](_0x187f33(0x290))};}export class WorkflowBaseCommand extends BaseCommand{[a38_0x11e0cd(0x350)](_0x414c28,_0x588a95,_0x5b309d=0x0){const _0x383429=a38_0x11e0cd;return _0x414c28[_0x5b309d]||_0x588a95[_0x383429(0x280)];}[a38_0x11e0cd(0x1f5)](_0x5b2503,_0x35035f,_0x579037=0x0){const _0x1bdb60=a38_0x11e0cd,_0x423fcc=this['resolveProject'](_0x5b2503,_0x35035f,_0x579037);if(!_0x423fcc)return console[_0x1bdb60(0x290)](a38_0x123249[_0x1bdb60(0x1d1)](_0x1bdb60(0x26c)),_0x1bdb60(0x330)),console[_0x1bdb60(0x290)](a38_0x123249[_0x1bdb60(0x2ba)](_0x1bdb60(0x208))),null;return _0x423fcc;}[a38_0x11e0cd(0x22e)](_0x4ee6ad,_0x14380f){const _0x4710a8=a38_0x11e0cd;if(_0x4ee6ad[0x0]){const _0x11e83a=_0x4ee6ad[0x0][_0x4710a8(0x30e)]('.');if(_0x11e83a[_0x4710a8(0x279)]===0x1)return{'projectName':_0x11e83a[0x0],'workflowName':undefined};else return _0x11e83a[_0x4710a8(0x279)]===0x2?{'projectName':_0x11e83a[0x0],'workflowName':_0x11e83a[0x1]}:(console[_0x4710a8(0x290)](a38_0x123249['red'](_0x4710a8(0x26c)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x14380f[_0x4710a8(0x280)],'workflowName':undefined};}[a38_0x11e0cd(0x1f6)](_0x5b7a69,_0x1aad02,_0x14141c=0x0){const _0x422746=a38_0x11e0cd;if(_0x5b7a69[_0x14141c])return _0x5b7a69[_0x14141c];if(_0x1aad02['workflowProject']){const _0x5d895e=a38_0x1d077e[_0x422746(0x2dc)](process[_0x422746(0x228)](),'workflows',_0x1aad02[_0x422746(0x280)]);if(existsSync(a38_0x1d077e[_0x422746(0x2dc)](_0x5d895e,_0x422746(0x2fc))))return _0x5d895e;}return undefined;}async[a38_0x11e0cd(0x2f4)](_0x572520,_0xd39bd2,_0x6396af){const _0x4aa16d=a38_0x11e0cd;try{const _0x28ef5e=await _0x572520[_0x4aa16d(0x2a2)][_0x4aa16d(0x2c9)](_0xd39bd2,{'limit':0x1});if(_0x28ef5e[_0x4aa16d(0x279)]>0x0){const _0x42b36c=_0x28ef5e[0x0]['id'],_0x3ff947=getWorkflowUrl(_0x6396af,_0x42b36c);console[_0x4aa16d(0x290)](_0x4aa16d(0x317)+a38_0x123249['cyan'](_0x3ff947));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a38_0x11e0cd(0x2d4);['description']='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async[a38_0x11e0cd(0x35c)](_0x289274){const _0x40f1b9=a38_0x11e0cd,{options:_0x127d59,args:_0x343379,tdx:_0x44a919}=_0x289274,_0x3350ad=_0x343379[0x0],_0x16aeed=_0x127d59[_0x40f1b9(0x323)];if(_0x16aeed)return saveSessionContext({'workflow_project':undefined},_0x127d59[_0x40f1b9(0x1bf)]),console['log'](a38_0x123249['green'](_0x40f1b9(0x2e9))),0x0;if(!_0x3350ad)return console[_0x40f1b9(0x290)](a38_0x123249['red'](_0x40f1b9(0x26c)),_0x40f1b9(0x330)),console[_0x40f1b9(0x290)](a38_0x123249[_0x40f1b9(0x2ba)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x40f1b9(0x290)](a38_0x123249[_0x40f1b9(0x2ba)](_0x40f1b9(0x1b8))),0x1;const _0x242c9e=await withSpinner('Resolving\x20project\x20\x27'+_0x3350ad+_0x40f1b9(0x261),()=>_0x44a919['workflow'][_0x40f1b9(0x1de)](_0x3350ad),{'verbose':_0x127d59['verbose']}),{name:_0xe8b2f9}=_0x242c9e[_0x40f1b9(0x35a)];return saveSessionContext({'workflow_project':_0xe8b2f9},_0x127d59[_0x40f1b9(0x1bf)]),console[_0x40f1b9(0x24c)](a38_0x123249[_0x40f1b9(0x340)](_0x40f1b9(0x1b5)+a38_0x123249[_0x40f1b9(0x1f8)](_0xe8b2f9))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a38_0x11e0cd(0x21a)]=a38_0x11e0cd(0x1ff);[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x2bc);async[a38_0x11e0cd(0x35c)](_0x1aa985){const _0x3c2be2=a38_0x11e0cd,{options:_0x3c700a,args:_0x591bdb,tdx:_0x2ae55b}=_0x1aa985,_0x56daec=_0x591bdb[0x0];_0x3c700a[_0x3c2be2(0x293)]&&_0x56daec&&console['error'](_0x3c2be2(0x311)+_0x56daec);const _0x422af6=await withSpinner(_0x3c2be2(0x331),()=>_0x2ae55b['workflow'][_0x3c2be2(0x1b3)](_0x56daec,{'limit':_0x3c700a[_0x3c2be2(0x1d2)]}),{'verbose':_0x3c700a[_0x3c2be2(0x293)]});let _0x221a80=_0x422af6[_0x3c2be2(0x35a)];_0x221a80[_0x3c2be2(0x2da)]((_0x2097fc,_0x4f2c96)=>_0x2097fc[_0x3c2be2(0x21a)][_0x3c2be2(0x1cd)](_0x4f2c96[_0x3c2be2(0x21a)]));const _0x43b55f=_0x3c700a[_0x3c2be2(0x1d2)]||0x64,_0x126e33=_0x221a80[_0x3c2be2(0x279)]>=_0x43b55f?a38_0x123249['dim'](_0x3c2be2(0x264)):'';console['error'](_0x3c2be2(0x265)+_0x221a80[_0x3c2be2(0x279)]+_0x3c2be2(0x353)+(_0x221a80[_0x3c2be2(0x279)]!==0x1?'s':'')+_0x126e33);if(_0x3c700a[_0x3c2be2(0x220)]==='json'||_0x3c700a[_0x3c2be2(0x220)]===_0x3c2be2(0x200)||_0x3c700a[_0x3c2be2(0x220)]===_0x3c2be2(0x234))await handleSDKOutput(_0x221a80,_0x3c700a);else{if(_0x221a80[_0x3c2be2(0x279)]===0x0)_0x56daec?console['log']('No\x20projects\x20match\x20pattern:\x20'+_0x56daec):console[_0x3c2be2(0x24c)]('No\x20workflow\x20projects\x20found');else{const _0x1f943c=_0x221a80[_0x3c2be2(0x2a3)](_0x3e0a74=>{const _0x3c68cf=_0x3c2be2,_0x16b7a4=_0x3e0a74[_0x3c68cf(0x25a)]?.[_0x3c68cf(0x2f3)](_0x2d6e3f=>_0x2d6e3f['key']===_0x3c68cf(0x1c1)),_0x1676aa=_0x16b7a4?a38_0x123249[_0x3c68cf(0x2ba)](_0x3c68cf(0x33d)):'';return _0x3c68cf(0x1ed)+_0x3e0a74[_0x3c68cf(0x21a)]+_0x1676aa;});await writeOutput(_0x1f943c['join']('\x0a'),_0x3c700a[_0x3c2be2(0x232)],_0x3c2be2(0x282));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']='workflow:workflows';[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x2ee);async[a38_0x11e0cd(0x35c)](_0x1cb07f){const _0x477dd7=a38_0x11e0cd,{options:_0x2fc50a,args:_0x505e3b,tdx:_0x6aa43c}=_0x1cb07f,_0x560725=this['resolveProject'](_0x505e3b,_0x2fc50a);_0x2fc50a['verbose']&&_0x560725&&console[_0x477dd7(0x290)](_0x477dd7(0x1f0)+_0x560725);const _0xe5266=await withSpinner(_0x477dd7(0x33b),()=>_0x6aa43c[_0x477dd7(0x2a2)][_0x477dd7(0x2c9)](_0x560725,{'limit':_0x2fc50a[_0x477dd7(0x1d2)]}),{'verbose':_0x2fc50a[_0x477dd7(0x293)]});let _0x2cb814=_0xe5266[_0x477dd7(0x35a)];_0x2cb814['sort']((_0x3c6df4,_0x2a2ffc)=>{const _0x4951b2=_0x477dd7,_0x4b500f=_0x3c6df4['name'][_0x4951b2(0x1cd)](_0x2a2ffc[_0x4951b2(0x21a)]);if(_0x4b500f!==0x0)return _0x4b500f;return(_0x3c6df4[_0x4951b2(0x238)]?.[_0x4951b2(0x21a)]||'')[_0x4951b2(0x1cd)](_0x2a2ffc['project']?.[_0x4951b2(0x21a)]||'');});const _0x52c063=_0x2fc50a[_0x477dd7(0x1d2)]||0x64,_0x2b1969=_0x2cb814['length']>=_0x52c063?a38_0x123249[_0x477dd7(0x2ba)](_0x477dd7(0x264)):'';console[_0x477dd7(0x290)](_0x477dd7(0x265)+_0x2cb814[_0x477dd7(0x279)]+_0x477dd7(0x216)+(_0x2cb814[_0x477dd7(0x279)]!==0x1?'s':'')+_0x2b1969);if(_0x2fc50a[_0x477dd7(0x220)]===_0x477dd7(0x344)||_0x2fc50a[_0x477dd7(0x220)]===_0x477dd7(0x200)||_0x2fc50a[_0x477dd7(0x220)]==='table')await handleSDKOutput(_0x2cb814,_0x2fc50a);else{if(_0x2cb814[_0x477dd7(0x279)]===0x0)_0x560725?console[_0x477dd7(0x24c)](_0x477dd7(0x204)+_0x560725):console[_0x477dd7(0x24c)](_0x477dd7(0x308));else{const _0x568675=_0x2fc50a['site'],_0x556732=_0x2cb814['map'](_0x54ecb8=>{const _0x46a454=_0x477dd7,_0x150190=a38_0x123249[_0x46a454(0x2ba)]('#'+_0x54ecb8['id']),_0xb73c7b=hyperlink(_0x150190,getWorkflowUrl(_0x568675,_0x54ecb8['id'])),_0x228389=_0x54ecb8[_0x46a454(0x238)]?.[_0x46a454(0x21a)]?a38_0x123249[_0x46a454(0x2ba)]('\x20('+_0x54ecb8[_0x46a454(0x238)]['name']+')'):'';return'📋\x20'+_0xb73c7b+'\x20'+_0x54ecb8[_0x46a454(0x21a)]+_0x228389;});await writeOutput(_0x556732[_0x477dd7(0x2dc)]('\x0a'),_0x2fc50a['output'],_0x477dd7(0x282));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a38_0x11e0cd(0x21a)]=a38_0x11e0cd(0x230);[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x277);async[a38_0x11e0cd(0x35c)](_0x15aa42){const _0x3127cc=a38_0x11e0cd,{options:_0x3b5319,args:_0x4075f1,tdx:_0x54cf08}=_0x15aa42,_0x5831e7=this['parseProjectWorkflowPattern'](_0x4075f1,_0x3b5319);if(!_0x5831e7)return 0x1;const {projectName:_0x43aa71,workflowName:_0x5abad0}=_0x5831e7;if(_0x3b5319[_0x3127cc(0x293)]){if(_0x43aa71&&_0x5abad0)console['error'](_0x3127cc(0x1c2)+_0x43aa71+'.'+_0x5abad0);else _0x43aa71&&console[_0x3127cc(0x290)](_0x3127cc(0x1b6)+_0x43aa71);const _0x5e4dc3=_0x3b5319[_0x3127cc(0x296)];_0x5e4dc3&&console['error'](_0x3127cc(0x2dd)+_0x5e4dc3);}let _0x175698=0x28;if(process[_0x3127cc(0x2ab)][_0x3127cc(0x209)]&&!_0x3b5319['output']&&!_0x3b5319[_0x3127cc(0x220)]){const _0x3a2653=process[_0x3127cc(0x2ab)]['rows']||0x28;_0x175698=Math[_0x3127cc(0x258)](0x14,Math[_0x3127cc(0x1d8)](_0x3a2653*0x2/0x3));}const _0x540870=_0x3b5319[_0x3127cc(0x1d2)]||_0x175698,_0x5aaf20=await withSpinner(_0x3127cc(0x1cf),()=>_0x54cf08[_0x3127cc(0x2a2)][_0x3127cc(0x328)]({'projectName':_0x43aa71,'workflowName':_0x5abad0,'status':_0x3b5319['status'],'fromTime':_0x3b5319[_0x3127cc(0x23c)],'toTime':_0x3b5319['to'],'limit':_0x540870}),{'verbose':_0x3b5319[_0x3127cc(0x293)]}),_0x3afd19=_0x5aaf20[_0x3127cc(0x35a)];_0x3afd19[_0x3127cc(0x2da)]((_0x3d5ec0,_0x411fd7)=>{const _0x22e215=_0x3127cc,_0x4e706c=_0x3d5ec0[_0x22e215(0x271)]||'',_0x2bcd9f=_0x411fd7[_0x22e215(0x271)]||'';return _0x2bcd9f['localeCompare'](_0x4e706c);});_0x3afd19['length']>=_0x540870?console[_0x3127cc(0x290)]('✔\x20Showing\x20'+_0x3afd19[_0x3127cc(0x279)]+_0x3127cc(0x2cc)+a38_0x123249[_0x3127cc(0x2ba)](_0x3127cc(0x1d0))):console[_0x3127cc(0x290)]('✔\x20Found\x20'+_0x3afd19[_0x3127cc(0x279)]+'\x20session'+(_0x3afd19['length']!==0x1?'s':''));if(_0x3b5319[_0x3127cc(0x220)]===_0x3127cc(0x344)||_0x3b5319[_0x3127cc(0x220)]==='jsonl'||_0x3b5319[_0x3127cc(0x220)]===_0x3127cc(0x234))await handleSDKOutput(_0x3afd19,_0x3b5319);else{if(!process[_0x3127cc(0x2ab)][_0x3127cc(0x209)]||_0x3b5319['output']){if(_0x3afd19[_0x3127cc(0x279)]===0x0){if(_0x43aa71&&_0x5abad0)console[_0x3127cc(0x24c)](_0x3127cc(0x2f0)+_0x43aa71+'.'+_0x5abad0);else _0x43aa71?console['log'](_0x3127cc(0x2bf)+_0x43aa71):console[_0x3127cc(0x24c)](_0x3127cc(0x357));}else{const _0x1c3098=_0x3b5319['site'],_0x3fbd61=this[_0x3127cc(0x28f)](_0x3afd19,_0x1c3098);_0x3b5319[_0x3127cc(0x232)]?await writeOutput(_0x3fbd61,_0x3b5319[_0x3127cc(0x232)],_0x3127cc(0x282)):console[_0x3127cc(0x24c)](_0x3fbd61);}!_0x43aa71&&(console[_0x3127cc(0x290)](''),console[_0x3127cc(0x290)](a38_0x123249[_0x3127cc(0x2ba)](_0x3127cc(0x255))),console[_0x3127cc(0x290)](a38_0x123249[_0x3127cc(0x2ba)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a38_0x123249[_0x3127cc(0x2ba)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x3afd19[_0x3127cc(0x279)]===0x0){if(_0x43aa71&&_0x5abad0)console[_0x3127cc(0x24c)](_0x3127cc(0x2f0)+_0x43aa71+'.'+_0x5abad0);else _0x43aa71?console[_0x3127cc(0x24c)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x43aa71):console['log'](_0x3127cc(0x357));}else await this[_0x3127cc(0x2ef)](_0x3afd19,_0x15aa42,_0x43aa71);}}return 0x0;}[a38_0x11e0cd(0x28f)](_0x73f762,_0x108a76){const _0x5c0baa=a38_0x11e0cd,_0x130a05=[],_0x527bad=new Map();let _0x538121=Infinity,_0x49725f=-Infinity;for(const _0x12cd69 of _0x73f762){if(_0x12cd69[_0x5c0baa(0x329)]?.[_0x5c0baa(0x1e4)]){const _0x4e043e=new Date(_0x12cd69[_0x5c0baa(0x329)][_0x5c0baa(0x1e4)])[_0x5c0baa(0x2d5)](),_0x489dde=_0x12cd69[_0x5c0baa(0x329)][_0x5c0baa(0x23f)]?new Date(_0x12cd69[_0x5c0baa(0x329)][_0x5c0baa(0x23f)])[_0x5c0baa(0x2d5)]():Date[_0x5c0baa(0x30f)](),_0x18931d=_0x12cd69['project']?.[_0x5c0baa(0x21a)]||_0x5c0baa(0x2ce);!_0x527bad[_0x5c0baa(0x2f6)](_0x18931d)&&_0x527bad[_0x5c0baa(0x27f)](_0x18931d,[]),_0x527bad[_0x5c0baa(0x2d3)](_0x18931d)[_0x5c0baa(0x1ba)]({'session':_0x12cd69,'startTime':_0x4e043e,'endTime':_0x489dde,'duration':_0x489dde-_0x4e043e}),_0x538121=Math['min'](_0x538121,_0x4e043e),_0x49725f=Math[_0x5c0baa(0x258)](_0x49725f,_0x489dde);}}if(_0x527bad['size']===0x0)return _0x5c0baa(0x278);const _0x48c7ce=process['stdout'][_0x5c0baa(0x352)]||0x78,_0x4ba57d=0x1e,_0x50b745=0x32,_0x257ef7=0x4,_0x378480=Math[_0x5c0baa(0x342)](_0x50b745,Math[_0x5c0baa(0x258)](_0x4ba57d,Math['floor'](_0x48c7ce*0.3))),_0x45c462=_0x48c7ce-_0x378480-TIMELINE_CONFIG[_0x5c0baa(0x285)]-0x3-_0x257ef7,_0x32da63=_0x49725f-_0x538121,_0x2eb674=_0x32da63/_0x378480,_0x1a5b83=renderTimeAxis({'startTime':_0x538121,'endTime':_0x49725f,'durationMs':_0x32da63,'msPerChar':_0x2eb674},_0x378480),_0x2f6ba2=[];for(const _0x717d03 of _0x527bad[_0x5c0baa(0x222)]()){_0x2f6ba2[_0x5c0baa(0x1ba)](..._0x717d03);}_0x2f6ba2[_0x5c0baa(0x2da)]((_0x5928cb,_0x3d20c5)=>_0x3d20c5[_0x5c0baa(0x240)]-_0x5928cb[_0x5c0baa(0x240)]);const _0xad377b=new Date(_0x538121),_0x107999=formatDate(_0xad377b),_0x324adf=_0x257ef7+TIMELINE_CONFIG[_0x5c0baa(0x267)]+TIMELINE_CONFIG[_0x5c0baa(0x2be)]+_0x45c462,_0x47fce2='\x20'[_0x5c0baa(0x1eb)](_0x324adf-_0x107999[_0x5c0baa(0x279)]),_0x310f93=_0x47fce2+a38_0x123249[_0x5c0baa(0x2ba)](_0x107999)+'\x20'+_0x1a5b83;_0x130a05[_0x5c0baa(0x1ba)](_0x310f93);const _0xfd1dfd=0x16;let _0x4c4d17=0x0;for(const _0x5b12cb of _0x2f6ba2){const _0x4f9845=_0x5b12cb[_0x5c0baa(0x1bf)][_0x5c0baa(0x238)]?.[_0x5c0baa(0x21a)]||'?',_0x369fb4=Math['min'](stringWidth(_0x4f9845),_0xfd1dfd);_0x4c4d17=Math['max'](_0x4c4d17,_0x369fb4);}for(const _0x583c23 of _0x2f6ba2){const {session:_0x1e2d2e,startTime:_0x3f14c4,endTime:_0x5864bb,duration:_0x4873e6}=_0x583c23,_0x59e9f1=_0x1e2d2e['project']?.['id'],_0x25a1ba=_0x1e2d2e['id'],_0x3a928a=_0x1e2d2e[_0x5c0baa(0x238)]?.[_0x5c0baa(0x21a)]||'?',_0x1eead3=_0x1e2d2e['workflow']?.[_0x5c0baa(0x21a)]||'?';let _0x4b1375,_0x25ec82;if(_0x1e2d2e[_0x5c0baa(0x329)]){const _0x4d0ddb=_0x1e2d2e[_0x5c0baa(0x329)];!_0x4d0ddb['done']?(_0x4b1375=_0x4d0ddb[_0x5c0baa(0x1da)]?'🛑':'🔄',_0x25ec82=_0x4d0ddb['cancelRequested']?a38_0x123249['yellow']:a38_0x123249[_0x5c0baa(0x20e)]):(_0x4b1375=_0x4d0ddb[_0x5c0baa(0x309)]?'✅':'❌',_0x25ec82=_0x4d0ddb[_0x5c0baa(0x309)]?a38_0x123249[_0x5c0baa(0x340)]:a38_0x123249['red']);}else _0x4b1375='⏳',_0x25ec82=a38_0x123249[_0x5c0baa(0x2ba)];const _0x59f02e='#'+_0x25a1ba,_0x377638=_0x59e9f1?hyperlink(_0x59f02e,getWorkflowSessionUrl(_0x108a76,_0x59e9f1,_0x25a1ba)):_0x59f02e;let _0x2a4214=_0x3a928a;stringWidth(_0x3a928a)>_0xfd1dfd&&(_0x2a4214=_0x3a928a[_0x5c0baa(0x30a)](0x0,_0xfd1dfd-0x1)+'…');const _0x2bba4e=a38_0x123249[_0x5c0baa(0x2ba)](_0x2a4214),_0xe6fe51=stringWidth(_0x2a4214),_0x406473='\x20'['repeat'](_0x4c4d17-stringWidth(_0x2a4214)+0x2),_0xa7aef7='('+formatElapsed(_0x4873e6)+')',_0x95f36c=stringWidth(_0xa7aef7),_0x13a149=stringWidth(_0x59f02e),_0x1875c8=_0x13a149+0x1+_0xe6fe51+_0x406473[_0x5c0baa(0x279)],_0x4c6e1c=_0x45c462-_0x1875c8-_0x95f36c-0x1-0x8;let _0x5331c0=_0x1eead3;stringWidth(_0x5331c0)>_0x4c6e1c&&(_0x5331c0=_0x5331c0[_0x5c0baa(0x30a)](0x0,_0x4c6e1c-0x1)+'…');const _0x482e77=_0x377638+'\x20'+_0x2bba4e+_0x406473+_0x5331c0,_0x8d7801=stringWidth(_0x482e77),_0x65622a=_0x45c462-_0x8d7801-_0x95f36c,_0x34a6b6=_0x482e77+'\x20'[_0x5c0baa(0x1eb)](Math[_0x5c0baa(0x258)](0x1,_0x65622a))+a38_0x123249[_0x5c0baa(0x2ba)](_0xa7aef7),_0x26123f=Math[_0x5c0baa(0x1d8)]((_0x3f14c4-_0x538121)/_0x2eb674),_0x131adc=Math[_0x5c0baa(0x1d8)]((_0x5864bb-_0x538121)/_0x2eb674),_0x5bb023=Math[_0x5c0baa(0x258)](_0x26123f+0x1,_0x131adc),_0xacb043=new Array(_0x378480)[_0x5c0baa(0x310)]('\x20');for(let _0x59f950=_0x26123f;_0x59f950<Math[_0x5c0baa(0x342)](_0x5bb023,_0x378480);_0x59f950++){_0xacb043[_0x59f950]='─';}const _0xa7ba2b=_0xacb043[_0x5c0baa(0x2a3)](_0x2b2d52=>_0x2b2d52==='\x20'?'\x20':_0x25ec82(_0x2b2d52))[_0x5c0baa(0x2dc)]('');_0x130a05['push'](_0x4b1375+'\x20'+_0x34a6b6+'│'+_0xa7ba2b+'│');}return _0x130a05[_0x5c0baa(0x2dc)]('\x0a');}async[a38_0x11e0cd(0x2ef)](_0x4b482a,_0x4252ad,_0x271cd8){const _0x5a8e3a=a38_0x11e0cd,{options:_0x44b7cd,tdx:_0x41910a}=_0x4252ad,_0x3e6663=_0x44b7cd[_0x5a8e3a(0x1ca)],{timelineRows:_0x5e776b,timeAxisHeader:_0x12e807}=this[_0x5a8e3a(0x2b3)](_0x4b482a,_0x3e6663),_0x44b0cb=_0x5e776b[_0x5a8e3a(0x291)](_0x187e36=>_0x187e36[_0x5a8e3a(0x354)]);if(_0x44b0cb[_0x5a8e3a(0x279)]===0x0){const _0x24ce1f=this[_0x5a8e3a(0x28f)](_0x4b482a,_0x3e6663);console[_0x5a8e3a(0x24c)](_0x24ce1f);!_0x271cd8&&(console[_0x5a8e3a(0x290)](''),console[_0x5a8e3a(0x290)](a38_0x123249[_0x5a8e3a(0x2ba)](_0x5a8e3a(0x255))),console['error'](a38_0x123249[_0x5a8e3a(0x2ba)](_0x5a8e3a(0x236))+'or'+a38_0x123249[_0x5a8e3a(0x2ba)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0x12e807&&console[_0x5a8e3a(0x24c)](_0x12e807);const _0x114c80=_0x5e776b[_0x5a8e3a(0x291)](_0x57294c=>_0x57294c['attemptId'])[_0x5a8e3a(0x2a3)](_0x585b28=>({'title':_0x585b28[_0x5a8e3a(0x2c8)],'value':_0x585b28['attemptId']})),_0x418af6=process[_0x5a8e3a(0x2ab)][_0x5a8e3a(0x283)]||0x3c,_0x2c5549=Math[_0x5a8e3a(0x258)](0x28,Math[_0x5a8e3a(0x1d8)](_0x418af6*0x2/0x3)),_0x491632=await a38_0x396379({'type':_0x5a8e3a(0x316),'name':'attemptId','message':_0x5a8e3a(0x2f1),'choices':_0x114c80,'initial':-0x1,'limit':_0x2c5549,'clearFirst':!![],'fallback':{'title':_0x5a8e3a(0x22d),'value':null},'suggest':(_0x474b82,_0x2944ae)=>{const _0x14b663=_0x5a8e3a;if(!_0x474b82)return Promise[_0x14b663(0x1ee)](_0x2944ae);const _0x382b51=_0x2944ae[_0x14b663(0x291)](_0x1972cd=>{const _0x21ff96=_0x14b663,_0x174ef7=_0x1972cd;return _0x174ef7['title'][_0x21ff96(0x28a)]()[_0x21ff96(0x205)](_0x474b82[_0x21ff96(0x28a)]());});return Promise['resolve'](_0x382b51);}}),_0x3f2758=()=>{const _0x3ae39b=_0x5a8e3a;process[_0x3ae39b(0x2ab)][_0x3ae39b(0x1f4)]('\x1b[1A\x1b[2K'),process[_0x3ae39b(0x2ab)][_0x3ae39b(0x1f4)](_0x3ae39b(0x1e7)),process[_0x3ae39b(0x2ab)]['write'](_0x3ae39b(0x1e7));},_0x4c35ee=_0x491632&&_0x491632[_0x5a8e3a(0x354)]&&_0x491632[_0x5a8e3a(0x354)]!==null&&_0x491632[_0x5a8e3a(0x354)][_0x5a8e3a(0x1d9)]()!=='';if(!_0x4c35ee){_0x3f2758(),console[_0x5a8e3a(0x24c)](a38_0x123249[_0x5a8e3a(0x2ba)]('Cancelled'));return;}_0x3f2758();const _0x4dc1f7=_0x4b482a[_0x5a8e3a(0x1f7)](_0x1a8754=>_0x1a8754[_0x5a8e3a(0x329)]?.['id']===_0x491632[_0x5a8e3a(0x354)]);if(_0x4dc1f7){const _0x448cdd=_0x4dc1f7[_0x5a8e3a(0x238)]?.[_0x5a8e3a(0x21a)]||'?',_0x73f245=_0x4dc1f7[_0x5a8e3a(0x2a2)]?.[_0x5a8e3a(0x21a)]||'?';console[_0x5a8e3a(0x24c)]('Project:\x20'+a38_0x123249['dim'](_0x448cdd)+',\x20Workflow:\x20'+a38_0x123249[_0x5a8e3a(0x2ba)](_0x73f245));}const _0x3db629=new WorkflowTimelineCommand();await _0x3db629[_0x5a8e3a(0x35c)]({'args':[],'options':{..._0x44b7cd,'attemptId':_0x491632[_0x5a8e3a(0x354)]},'tdx':_0x41910a});}[a38_0x11e0cd(0x2b3)](_0xce7a21,_0x4a2c0a){const _0x44e3f7=a38_0x11e0cd,_0x3b22b1=new Map();for(const _0x4e7243 of _0xce7a21){_0x4e7243['id']&&_0x4e7243[_0x44e3f7(0x329)]?.['id']&&_0x3b22b1[_0x44e3f7(0x27f)](_0x4e7243['id'],_0x4e7243[_0x44e3f7(0x329)]['id']);}const _0x482381=[];let _0x154742='';const _0x1e4452=this[_0x44e3f7(0x28f)](_0xce7a21,_0x4a2c0a),_0x204145=_0x1e4452[_0x44e3f7(0x30e)]('\x0a');for(const _0x8b29c of _0x204145){if(_0x8b29c[_0x44e3f7(0x26a)](_0x44e3f7(0x262))||_0x8b29c[_0x44e3f7(0x281)](/^\s+\d{4}-\d{2}-\d{2}/))_0x154742=_0x8b29c;else{if(_0x8b29c[_0x44e3f7(0x281)](/^[✅❌🔄🛑⏳]/)){const _0x5022de=_0x8b29c['match'](/#(\d+)/),_0x599a4d=_0x5022de?_0x5022de[0x1]:null,_0x5ebfc3=_0x599a4d?_0x3b22b1['get'](_0x599a4d)||null:null,_0x2e8c74=_0xce7a21['find'](_0x3c912e=>_0x3c912e['id']===_0x599a4d),_0xfcd7e0=_0x2e8c74?.['project']?.[_0x44e3f7(0x21a)]||'';_0x482381[_0x44e3f7(0x1ba)]({'displayLine':_0x8b29c,'attemptId':_0x5ebfc3,'projectName':_0xfcd7e0});}}}return{'timelineRows':_0x482381,'timeAxisHeader':_0x154742};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a38_0x11e0cd(0x21a)]=a38_0x11e0cd(0x202);[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x284);async[a38_0x11e0cd(0x35c)](_0x4f5cf0){const _0x3a7733=a38_0x11e0cd,{options:_0x43fa56,args:_0x3d62e2,tdx:_0x315ec3}=_0x4f5cf0,_0x3c1ca1=this['parseProjectWorkflowPattern'](_0x3d62e2,_0x43fa56);if(!_0x3c1ca1)return 0x1;const {projectName:_0x9e5965,workflowName:_0x48fd63}=_0x3c1ca1,_0x275f4e=_0x43fa56[_0x3a7733(0x2aa)];if(_0x43fa56[_0x3a7733(0x293)]){if(_0x9e5965&&_0x48fd63)console[_0x3a7733(0x290)]('Filter:\x20'+_0x9e5965+'.'+_0x48fd63);else _0x9e5965&&console['error']('Filter:\x20project='+_0x9e5965);_0x275f4e&&console[_0x3a7733(0x290)](_0x3a7733(0x346));}const _0x17641c=await withSpinner(_0x3a7733(0x1bb),()=>_0x315ec3[_0x3a7733(0x2a2)]['attempts']({'projectName':_0x9e5965,'workflowName':_0x48fd63,'includeRetried':_0x275f4e,'limit':_0x43fa56[_0x3a7733(0x1d2)]}),{'verbose':_0x43fa56[_0x3a7733(0x293)]}),_0x169970=_0x17641c['data'],_0x4ca5e2=_0x43fa56[_0x3a7733(0x1d2)]||0x64,_0x56f36f=_0x169970['length']>=_0x4ca5e2?a38_0x123249[_0x3a7733(0x2ba)](_0x3a7733(0x264)):'';console[_0x3a7733(0x290)](_0x3a7733(0x265)+_0x169970[_0x3a7733(0x279)]+_0x3a7733(0x29b)+(_0x169970['length']!==0x1?'s':'')+_0x56f36f);if(_0x43fa56[_0x3a7733(0x220)]===_0x3a7733(0x344)||_0x43fa56[_0x3a7733(0x220)]===_0x3a7733(0x200)||_0x43fa56[_0x3a7733(0x220)]===_0x3a7733(0x234))await handleSDKOutput(_0x169970,_0x43fa56);else{if(_0x169970[_0x3a7733(0x279)]===0x0){if(_0x9e5965&&_0x48fd63)console[_0x3a7733(0x24c)](_0x3a7733(0x213)+_0x9e5965+'.'+_0x48fd63);else _0x9e5965?console[_0x3a7733(0x24c)]('No\x20attempts\x20found\x20in\x20project:\x20'+_0x9e5965):console[_0x3a7733(0x24c)](_0x3a7733(0x322));}else{const _0x15bf93=_0x43fa56[_0x3a7733(0x1ca)],_0x726239=_0x169970[_0x3a7733(0x2a3)](_0x10facd=>{const _0x89d4ab=_0x3a7733,_0x19909c=a38_0x123249[_0x89d4ab(0x2ba)]('#'+_0x10facd['id']),_0x18ede2=_0x10facd[_0x89d4ab(0x238)]?.['id'],_0x48e8bf=_0x10facd[_0x89d4ab(0x2cb)]||_0x10facd[_0x89d4ab(0x259)],_0x1ce731=_0x18ede2&&_0x48e8bf?hyperlink(_0x19909c,getWorkflowAttemptUrl(_0x15bf93,_0x18ede2,_0x48e8bf,_0x10facd['id'])):_0x19909c,{icon:_0x2769fd,text:_0x59040c}=getAttemptStatusDisplay(_0x10facd),_0x26ea9f=(_0x10facd['project']?.['name']||'?')+'.'+(_0x10facd[_0x89d4ab(0x2a2)]?.[_0x89d4ab(0x21a)]||'?'),_0x47cf9f=_0x10facd['sessionTime']?a38_0x123249[_0x89d4ab(0x2ba)](_0x10facd['sessionTime']):'';return(_0x1ce731+'\x20'+_0x2769fd+(_0x59040c?'\x20'+_0x59040c:'')+'\x20'+_0x26ea9f+'\x20'+_0x47cf9f)['trimEnd']();});await writeOutput(_0x726239[_0x3a7733(0x2dc)]('\x0a'),_0x43fa56[_0x3a7733(0x232)],_0x3a7733(0x282));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a38_0x11e0cd(0x21a)]='workflow:attempt';[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x2f2);async[a38_0x11e0cd(0x35c)](_0x11b11e){const _0x5b01e1=a38_0x11e0cd,{options:_0x53594e,args:_0x2aa977,tdx:_0x546689}=_0x11b11e,_0x486e96=_0x2aa977[0x0];if(!_0x486e96)return console[_0x5b01e1(0x290)](_0x5b01e1(0x206)),0x1;_0x53594e[_0x5b01e1(0x293)]&&console[_0x5b01e1(0x290)](_0x5b01e1(0x22b)+_0x486e96);const _0x357f9c=await withSpinner(_0x5b01e1(0x2db),()=>_0x546689['workflow']['attempt'](_0x486e96),{'verbose':_0x53594e['verbose']}),_0x3862d8=_0x357f9c['data'];let _0x550020;!_0x3862d8[_0x5b01e1(0x244)]?_0x550020=_0x3862d8['cancelRequested']?'canceling':'running':_0x550020=_0x3862d8[_0x5b01e1(0x309)]?_0x5b01e1(0x309):'error';let _0x24aa84;if(_0x3862d8[_0x5b01e1(0x1e4)]&&_0x3862d8[_0x5b01e1(0x23f)]){const _0xf8b6c=new Date(_0x3862d8[_0x5b01e1(0x1e4)])[_0x5b01e1(0x2d5)](),_0x36bb50=new Date(_0x3862d8[_0x5b01e1(0x23f)])[_0x5b01e1(0x2d5)]();_0x24aa84=Math[_0x5b01e1(0x2d1)]((_0x36bb50-_0xf8b6c)/0x3e8);}const _0x342eee={'attempt_id':_0x3862d8['id'],'status':_0x550020,..._0x3862d8[_0x5b01e1(0x20c)]!==undefined&&{'index':_0x3862d8[_0x5b01e1(0x20c)]},..._0x3862d8[_0x5b01e1(0x238)]&&{'project':_0x3862d8[_0x5b01e1(0x238)]['name']},..._0x3862d8['workflow']&&{'workflow':_0x3862d8[_0x5b01e1(0x2a2)][_0x5b01e1(0x21a)]},..._0x3862d8['sessionId']&&{'session_id':_0x3862d8['sessionId']},..._0x3862d8[_0x5b01e1(0x271)]&&{'session_time':_0x3862d8['sessionTime']},..._0x3862d8[_0x5b01e1(0x2f9)]&&{'retry_attempt':_0x3862d8[_0x5b01e1(0x2f9)]},..._0x24aa84!==undefined&&{'duration_sec':_0x24aa84},..._0x3862d8['createdAt']&&{'created_at':_0x3862d8['createdAt']},..._0x3862d8['finishedAt']&&{'finished_at':_0x3862d8[_0x5b01e1(0x23f)]},...Object[_0x5b01e1(0x294)](_0x3862d8[_0x5b01e1(0x239)])[_0x5b01e1(0x279)]>0x0&&{'params':_0x3862d8['params']}};return await handleSingleObjectOutput(_0x342eee,_0x53594e),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a38_0x11e0cd(0x289);[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x21c);async[a38_0x11e0cd(0x35c)](_0x205940){const _0x4d2107=a38_0x11e0cd,{options:_0x2f9acc,args:_0x531906,tdx:_0x4729ea}=_0x205940,_0xa9895e=_0x531906[0x0];if(!_0xa9895e)return console['error'](_0x4d2107(0x206)),0x1;const _0x599dbe=_0x2f9acc[_0x4d2107(0x25d)];_0x2f9acc[_0x4d2107(0x293)]&&(console[_0x4d2107(0x290)]('Attempt\x20ID:\x20'+_0xa9895e),_0x599dbe&&console[_0x4d2107(0x290)](_0x4d2107(0x1c8)));const _0xe83e7f=await withSpinner(_0x4d2107(0x272),()=>_0x4729ea[_0x4d2107(0x2a2)][_0x4d2107(0x20f)](_0xa9895e,_0x599dbe||![]),{'verbose':_0x2f9acc['verbose']}),_0x94dc37=_0xe83e7f[_0x4d2107(0x35a)];return console[_0x4d2107(0x290)]('✔\x20Found\x20'+_0x94dc37[_0x4d2107(0x279)]+_0x4d2107(0x237)+(_0x94dc37[_0x4d2107(0x279)]!==0x1?'s':'')),await handleSDKOutput(_0x94dc37,_0x2f9acc),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a38_0x11e0cd(0x21a)]=a38_0x11e0cd(0x2c7);[a38_0x11e0cd(0x218)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async['execute'](_0x1b11be){const _0x37bb7e=a38_0x11e0cd,{options:_0x54adde,args:_0x3c381a,tdx:_0x180feb}=_0x1b11be,_0x49c33f=_0x3c381a[0x0];let _0x444f18=_0x3c381a[0x1];if(!_0x49c33f)return console[_0x37bb7e(0x290)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x54adde[_0x37bb7e(0x293)]&&(console[_0x37bb7e(0x290)](_0x37bb7e(0x22b)+_0x49c33f),_0x444f18&&console[_0x37bb7e(0x290)](_0x37bb7e(0x27d)+_0x444f18));const _0x3641fa=await withSpinner(_0x37bb7e(0x2bd),()=>_0x180feb[_0x37bb7e(0x2a2)][_0x37bb7e(0x1bc)](_0x49c33f,_0x444f18),{'verbose':_0x54adde['verbose']}),_0x506402=_0x3641fa[_0x37bb7e(0x35a)];if(_0x506402[_0x37bb7e(0x279)]===0x0)return console[_0x37bb7e(0x290)](_0x37bb7e(0x32d)),0x0;if(!_0x444f18&&(_0x54adde[_0x37bb7e(0x344)]||_0x54adde[_0x37bb7e(0x220)]))return await handleSDKOutput(_0x506402,_0x54adde),0x0;if(!_0x444f18){const _0x469b99=_0x506402[_0x37bb7e(0x2a3)](_0x24395b=>({'title':_0x24395b['taskName']+'\x20('+formatBytes(_0x24395b[_0x37bb7e(0x324)])+')','value':_0x24395b[_0x37bb7e(0x1f9)]})),_0x1c8da2=await a38_0x396379({'type':'select','name':_0x37bb7e(0x32f),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x469b99});if(!_0x1c8da2['task'])return console['error'](_0x37bb7e(0x1e3)),0x0;_0x444f18=_0x1c8da2[_0x37bb7e(0x32f)];}const _0x50a24a=await withSpinner(_0x37bb7e(0x27b),()=>_0x180feb['workflow']['logs'](_0x49c33f,_0x444f18),{'verbose':_0x54adde[_0x37bb7e(0x293)]}),_0x2d778e=_0x50a24a['data'];return _0x2d778e?console['log'](_0x2d778e):console[_0x37bb7e(0x290)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a38_0x11e0cd(0x21a)]='workflow:kill';[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x1e8);async[a38_0x11e0cd(0x35c)](_0x1d77b0){const _0x2e408a=a38_0x11e0cd,{options:_0x1247d0,args:_0xc6218,tdx:_0x42538c}=_0x1d77b0,_0x3628ed=_0xc6218[0x0];if(!_0x3628ed)return console['error'](_0x2e408a(0x206)),0x1;const _0x3ddfb5=_0x1247d0['reason'];_0x1247d0[_0x2e408a(0x293)]&&(console['error'](_0x2e408a(0x22b)+_0x3628ed),_0x3ddfb5&&console['error']('Reason:\x20'+_0x3ddfb5));if(!_0x1247d0[_0x2e408a(0x31b)]){const _0x486972=await confirmKey(_0x2e408a(0x297)+_0x3628ed+'?');if(!_0x486972)return console['error'](_0x2e408a(0x1e3)),0x0;}const _0x859273=await withSpinner(_0x2e408a(0x25c),()=>_0x42538c[_0x2e408a(0x2a2)][_0x2e408a(0x24d)](_0x3628ed,_0x3ddfb5),{'verbose':_0x1247d0['verbose']}),_0x4c0ca3=_0x859273['data'];return console[_0x2e408a(0x290)]('✔\x20'+_0x4c0ca3),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a38_0x11e0cd(0x251);[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x1e2);async[a38_0x11e0cd(0x35c)](_0x48fbf6){const _0x521fb5=a38_0x11e0cd,{options:_0x130ac5,args:_0x4e2fff,tdx:_0x57e95c}=_0x48fbf6,_0x336b10=_0x4e2fff[0x0];if(!_0x336b10)return console[_0x521fb5(0x290)](_0x521fb5(0x273)),console['error'](_0x521fb5(0x321)),0x1;let _0x5d0e40=![],_0x6269e=_0x336b10;if(_0x336b10[_0x521fb5(0x26a)](_0x521fb5(0x2c0)))_0x5d0e40=!![],_0x6269e=_0x336b10['substring'](0x8);else{if(_0x336b10[_0x521fb5(0x26a)]('attempt:'))_0x5d0e40=![],_0x6269e=_0x336b10[_0x521fb5(0x29a)](0x8);else return console[_0x521fb5(0x290)](_0x521fb5(0x2f5)),console[_0x521fb5(0x290)](_0x521fb5(0x321)),0x1;}const _0x55a167=_0x130ac5['fromTask'],_0x1077d3=_0x130ac5[_0x521fb5(0x1cb)],_0x5c7fe3=_0x130ac5[_0x521fb5(0x239)],_0x15fc14=_0x130ac5[_0x521fb5(0x2a7)];_0x130ac5['verbose']&&(console[_0x521fb5(0x290)]('Target:\x20'+(_0x5d0e40?_0x521fb5(0x1bf):'attempt')+'\x20'+_0x6269e),_0x55a167&&console[_0x521fb5(0x290)](_0x521fb5(0x2a0)+_0x55a167),_0x1077d3&&console[_0x521fb5(0x290)](_0x521fb5(0x219)+_0x1077d3),_0x5c7fe3&&console[_0x521fb5(0x290)](_0x521fb5(0x1f1)+_0x5c7fe3),_0x15fc14&&console['error'](_0x521fb5(0x1e1)));let _0x45ba68;if(_0x5c7fe3)try{if(_0x5c7fe3['startsWith']('@')){const _0x12bf94=await import(_0x521fb5(0x2b1)),_0x5cd6eb=_0x5c7fe3[_0x521fb5(0x29a)](0x1),_0x3a223b=await _0x12bf94['readFile'](_0x5cd6eb,_0x521fb5(0x21b));_0x45ba68=JSON[_0x521fb5(0x246)](_0x3a223b);}else _0x45ba68=JSON['parse'](_0x5c7fe3);}catch{return console[_0x521fb5(0x290)](_0x521fb5(0x2cf)),0x1;}if(!_0x130ac5[_0x521fb5(0x31b)]){const _0x59620c=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x5d0e40?'session':'attempt')+'\x20'+_0x6269e+'?');if(!_0x59620c)return console[_0x521fb5(0x290)]('Cancelled'),0x0;}let _0xb5b242;_0x5d0e40?_0xb5b242=await withSpinner(_0x521fb5(0x335),()=>_0x57e95c[_0x521fb5(0x2a2)][_0x521fb5(0x2ec)](_0x6269e,{'fromTask':_0x55a167,'retryParams':_0x45ba68}),{'verbose':_0x130ac5['verbose']}):_0xb5b242=await withSpinner(_0x521fb5(0x326),()=>_0x57e95c['workflow'][_0x521fb5(0x1b2)](_0x6269e,{'resumeFrom':_0x1077d3,'retryParams':_0x45ba68,'force':_0x15fc14}),{'verbose':_0x130ac5[_0x521fb5(0x293)]});const _0xb240c5=_0xb5b242[_0x521fb5(0x35a)];return console['error'](_0x521fb5(0x2d2)),console['error']('\x20\x20New\x20attempt\x20ID:\x20'+_0xb240c5[_0x521fb5(0x354)]),console[_0x521fb5(0x290)](_0x521fb5(0x2e3)+_0xb240c5[_0x521fb5(0x259)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a38_0x11e0cd(0x28c);[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x276);async[a38_0x11e0cd(0x35c)](_0x14c104){const _0x9dfcb8=a38_0x11e0cd,{options:_0x6648a,args:_0x473eb8,tdx:_0x3825da}=_0x14c104;let _0x3d957a=_0x473eb8[0x0];if(!_0x3d957a){const _0x2a5d6c=this[_0x9dfcb8(0x350)]([],_0x6648a),_0x1e03f1=await withSpinner(_0x9dfcb8(0x356),()=>_0x3825da[_0x9dfcb8(0x2a2)][_0x9dfcb8(0x2c9)](_0x2a5d6c,{'limit':_0x6648a[_0x9dfcb8(0x1d2)]}),{'verbose':_0x6648a[_0x9dfcb8(0x293)]}),_0x357c87=_0x1e03f1[_0x9dfcb8(0x35a)];if(_0x357c87[_0x9dfcb8(0x279)]===0x0)return console[_0x9dfcb8(0x290)](_0x9dfcb8(0x308)),!_0x2a5d6c&&console[_0x9dfcb8(0x290)](a38_0x123249[_0x9dfcb8(0x2ba)](_0x9dfcb8(0x208))),0x1;const _0x183986=_0x357c87['map'](_0x4ac186=>({'title':_0x4ac186[_0x9dfcb8(0x238)]?.[_0x9dfcb8(0x21a)]+'.'+_0x4ac186['name'],'value':_0x4ac186[_0x9dfcb8(0x238)]?.[_0x9dfcb8(0x21a)]+'.'+_0x4ac186[_0x9dfcb8(0x21a)],'description':_0x4ac186[_0x9dfcb8(0x2b2)]?_0x9dfcb8(0x301)+_0x4ac186['revision']:undefined})),_0x129958=await a38_0x396379({'type':_0x9dfcb8(0x1c9),'name':'workflow','message':_0x9dfcb8(0x1ea),'choices':_0x183986});if(!_0x129958[_0x9dfcb8(0x2a2)])return 0x1;_0x3d957a=_0x129958[_0x9dfcb8(0x2a2)];}if(!_0x3d957a[_0x9dfcb8(0x205)]('.')){const _0x53d60f=this['resolveProject']([],_0x6648a);if(_0x53d60f)_0x3d957a=_0x53d60f+'.'+_0x3d957a;else return console['error'](a38_0x123249['red'](_0x9dfcb8(0x26c)),_0x9dfcb8(0x28e)),console[_0x9dfcb8(0x290)](a38_0x123249[_0x9dfcb8(0x2ba)](_0x9dfcb8(0x208))),0x1;}const _0x381ccc=_0x6648a[_0x9dfcb8(0x2e7)],_0x280fde=_0x6648a[_0x9dfcb8(0x271)],_0x5283d9={};if(_0x381ccc&&Array[_0x9dfcb8(0x318)](_0x381ccc))for(const _0x559c4d of _0x381ccc){const _0x5d32b2=_0x559c4d[_0x9dfcb8(0x2d6)]('=');if(_0x5d32b2===-0x1)return console[_0x9dfcb8(0x290)](_0x9dfcb8(0x2b5)+_0x559c4d),console[_0x9dfcb8(0x290)](_0x9dfcb8(0x263)),0x1;const _0x1fa087=_0x559c4d[_0x9dfcb8(0x29a)](0x0,_0x5d32b2),_0x355627=_0x559c4d[_0x9dfcb8(0x29a)](_0x5d32b2+0x1);try{_0x5283d9[_0x1fa087]=JSON['parse'](_0x355627);}catch{_0x5283d9[_0x1fa087]=_0x355627;}}_0x6648a['verbose']&&(console[_0x9dfcb8(0x290)](_0x9dfcb8(0x1fe)+_0x3d957a),Object[_0x9dfcb8(0x294)](_0x5283d9)[_0x9dfcb8(0x279)]>0x0&&console['error'](_0x9dfcb8(0x25e)+JSON[_0x9dfcb8(0x1e6)](_0x5283d9)),_0x280fde&&console[_0x9dfcb8(0x290)]('Session\x20time:\x20'+_0x280fde));const _0x376123=await withSpinner(_0x9dfcb8(0x300),()=>_0x3825da[_0x9dfcb8(0x2a2)]['run'](_0x3d957a,_0x5283d9,{'sessionTime':_0x280fde}),{'verbose':_0x6648a['verbose']}),_0x44a2bf=_0x376123[_0x9dfcb8(0x35a)];console[_0x9dfcb8(0x290)](_0x9dfcb8(0x233)),console[_0x9dfcb8(0x290)]('\x20\x20Attempt\x20ID:\x20'+_0x44a2bf['id']),console[_0x9dfcb8(0x290)](_0x9dfcb8(0x2e3)+_0x44a2bf[_0x9dfcb8(0x259)]),console[_0x9dfcb8(0x290)](_0x9dfcb8(0x1ef)+_0x44a2bf[_0x9dfcb8(0x238)]?.['name']),console[_0x9dfcb8(0x290)](_0x9dfcb8(0x1bd)+_0x44a2bf['workflow']?.[_0x9dfcb8(0x21a)]);if(_0x44a2bf[_0x9dfcb8(0x238)]?.['id']&&_0x44a2bf['sessionId']&&_0x44a2bf['id']){const _0x100d32=_0x6648a[_0x9dfcb8(0x1ca)],_0x15b808=getConsoleUrl(_0x100d32,_0x9dfcb8(0x26b)+_0x44a2bf[_0x9dfcb8(0x238)]['id']+'/sessions/'+_0x44a2bf['sessionId']+'/attempt/'+_0x44a2bf['id']);console['error'](_0x9dfcb8(0x317)+a38_0x123249[_0x9dfcb8(0x1f8)](_0x15b808));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a38_0x11e0cd(0x2e1);[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x2de);async[a38_0x11e0cd(0x35c)](_0x51ec63){const _0x1368f4=a38_0x11e0cd,{options:_0x729702,args:_0x14a7a7,tdx:_0xed1a22}=_0x51ec63,_0x4bbe9e=_0x14a7a7[0x0],_0x9fc94c=_0x14a7a7[0x1]||'.';if(!_0x4bbe9e)return console[_0x1368f4(0x290)](_0x1368f4(0x2c4)),console[_0x1368f4(0x290)](_0x1368f4(0x243)),0x1;const _0x2e800c=_0x729702[_0x1368f4(0x2b2)];_0x729702[_0x1368f4(0x293)]&&(console['error'](_0x1368f4(0x2e0)+_0x4bbe9e),console[_0x1368f4(0x290)](_0x1368f4(0x2cd)+_0x9fc94c),_0x2e800c&&console['error']('Revision:\x20'+_0x2e800c));const _0x54cf22=await withSpinner('Downloading\x20project\x20'+_0x4bbe9e+_0x1368f4(0x24b),()=>_0xed1a22[_0x1368f4(0x2a2)]['download'](_0x4bbe9e,_0x9fc94c,{'revision':_0x2e800c}),{'verbose':_0x729702[_0x1368f4(0x293)]}),_0x210617=_0x54cf22[_0x1368f4(0x35a)];return console[_0x1368f4(0x290)](_0x1368f4(0x242)+_0x210617[_0x1368f4(0x1df)]),console[_0x1368f4(0x290)](_0x1368f4(0x2ad)+_0x210617[_0x1368f4(0x2b2)]),console['error'](_0x1368f4(0x275)+_0x210617[_0x1368f4(0x26f)]),console[_0x1368f4(0x290)](_0x1368f4(0x343)+_0x9fc94c+'/'+_0x210617[_0x1368f4(0x1df)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a38_0x11e0cd(0x21a)]=a38_0x11e0cd(0x269);[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x30d);async[a38_0x11e0cd(0x35c)](_0x249e34){const _0x3bba2f=a38_0x11e0cd,{options:_0x1946da,args:_0x3c822e,tdx:_0x17543f}=_0x249e34;let _0x5a370e='.',_0x4ce4b0=_0x1946da['name'];if(_0x3c822e[0x0]){const {promises:_0x32c302}=await import('fs');try{const _0x2d3d19=await _0x32c302[_0x3bba2f(0x207)](_0x3c822e[0x0]);if(_0x2d3d19['isDirectory']())_0x5a370e=_0x3c822e[0x0];else return console[_0x3bba2f(0x290)](_0x3bba2f(0x2ca)+_0x3c822e[0x0]+_0x3bba2f(0x29c)),0x1;}catch{_0x4ce4b0=_0x3c822e[0x0],_0x5a370e='.';}}const _0x1a5462=_0x1946da[_0x3bba2f(0x2b2)],_0x2eb908=_0x1946da[_0x3bba2f(0x34d)];_0x1946da[_0x3bba2f(0x293)]&&(console['error'](_0x3bba2f(0x2ea)+_0x5a370e),_0x4ce4b0&&console[_0x3bba2f(0x290)](_0x3bba2f(0x223)+_0x4ce4b0),_0x1a5462&&console[_0x3bba2f(0x290)](_0x3bba2f(0x229)+_0x1a5462),_0x2eb908&&console[_0x3bba2f(0x290)](_0x3bba2f(0x2e5)));const _0x5359a6=await withSpinner(_0x3bba2f(0x254),()=>_0x17543f[_0x3bba2f(0x2a2)]['push'](_0x5a370e,{'projectName':_0x4ce4b0,'revision':_0x1a5462,'skipValidation':_0x2eb908}),{'verbose':_0x1946da[_0x3bba2f(0x293)]}),_0x4f4710=_0x5359a6[_0x3bba2f(0x35a)];return console[_0x3bba2f(0x290)](_0x3bba2f(0x359)+_0x4f4710[_0x3bba2f(0x1df)]),console[_0x3bba2f(0x290)]('\x20\x20Project\x20ID:\x20'+_0x4f4710[_0x3bba2f(0x2df)]),console[_0x3bba2f(0x290)](_0x3bba2f(0x2ad)+_0x4f4710[_0x3bba2f(0x2b2)]),await this[_0x3bba2f(0x2f4)](_0x17543f,_0x4f4710[_0x3bba2f(0x1df)],_0x1946da[_0x3bba2f(0x1ca)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a38_0x11e0cd(0x21a)]='workflow:pull';[a38_0x11e0cd(0x218)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async['execute'](_0x2ece5c){const _0x320517=a38_0x11e0cd,{options:_0xe256b7,args:_0x3f336c,tdx:_0x102970}=_0x2ece5c,_0x33297b=_0x3f336c[0x0],_0x288e8a=_0x3f336c[0x1];if(!_0x33297b)return console[_0x320517(0x290)](a38_0x123249[_0x320517(0x1d1)]('Error:'),_0x320517(0x330)),console[_0x320517(0x290)](a38_0x123249[_0x320517(0x2ba)]('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x549f40=_0xe256b7[_0x320517(0x2b2)];_0xe256b7[_0x320517(0x293)]&&(console[_0x320517(0x290)](_0x320517(0x2e0)+_0x33297b),_0x288e8a&&console[_0x320517(0x290)]('Target\x20directory:\x20'+_0x288e8a),_0x549f40&&console[_0x320517(0x290)](_0x320517(0x229)+_0x549f40),_0xe256b7[_0x320517(0x34a)]&&console['error'](_0x320517(0x341)));const _0x26475e=await withSpinner('Pulling\x20project\x20'+_0x33297b+'...',()=>_0x102970['workflow']['pullProject'](_0x33297b,{'targetDir':_0x288e8a,'revision':_0x549f40}),{'verbose':_0xe256b7[_0x320517(0x293)]}),_0x1df9db=_0x26475e[_0x320517(0x35a)];_0x1df9db[_0x320517(0x26d)]?console['error'](_0x320517(0x31e)+_0x1df9db[_0x320517(0x1df)]):console['error']('✔\x20Project:\x20'+_0x1df9db['projectName']);console[_0x320517(0x290)](_0x320517(0x2ad)+_0x1df9db[_0x320517(0x2b2)]),console[_0x320517(0x290)](_0x320517(0x268)+(a38_0x1d077e[_0x320517(0x338)](process['cwd'](),_0x1df9db['targetDir'])||'.')),console['error'](_0x320517(0x1e5)+a38_0x123249[_0x320517(0x340)]('+'+_0x1df9db['summary']['new']+_0x320517(0x1c7))+',\x20'+(a38_0x123249[_0x320517(0x2e2)]('~'+_0x1df9db['summary'][_0x320517(0x2e8)]+'\x20modified')+',\x20')+(a38_0x123249[_0x320517(0x1d1)]('-'+_0x1df9db[_0x320517(0x21f)][_0x320517(0x231)]+'\x20deleted')+',\x20')+(''+a38_0x123249['dim'](_0x1df9db['summary'][_0x320517(0x24e)]+'\x20unchanged')));for(const _0x4a8014 of _0x1df9db['changes']){_0x4a8014[_0x320517(0x34c)]==='modified'&&_0x4a8014[_0x320517(0x2b4)]&&(console[_0x320517(0x290)]('\x0a'+a38_0x123249[_0x320517(0x1f8)]('---\x20'+_0x4a8014['path'])),console[_0x320517(0x290)](_0x4a8014[_0x320517(0x2b4)]));}if(!_0x1df9db[_0x320517(0x225)])return saveSessionContext({'workflow_project':_0x1df9db[_0x320517(0x1df)]},_0xe256b7['session']),console[_0x320517(0x290)](a38_0x123249[_0x320517(0x340)](_0x320517(0x305))),console[_0x320517(0x290)](a38_0x123249[_0x320517(0x2ba)](_0x320517(0x30b)+_0x1df9db[_0x320517(0x1df)])),0x0;if(_0xe256b7[_0x320517(0x34a)])return console[_0x320517(0x290)](a38_0x123249[_0x320517(0x2e2)](_0x320517(0x22a))),0x0;if(!_0xe256b7['yes']){const _0xae7930=await confirmKey(_0x320517(0x33a));if(!_0xae7930)return console[_0x320517(0x290)](_0x320517(0x1e3)),0x0;}await withSpinner(_0x320517(0x312),()=>_0x102970['workflow']['applyPullProject'](_0x1df9db,{'revision':_0x549f40}),{'verbose':_0xe256b7[_0x320517(0x293)]}),saveSessionContext({'workflow_project':_0x1df9db[_0x320517(0x1df)]},_0xe256b7['session']),console[_0x320517(0x290)](a38_0x123249[_0x320517(0x340)](_0x320517(0x1d6)));const _0x92a578=a38_0x1d077e['relative'](process['cwd'](),_0x1df9db[_0x320517(0x1d7)])||'.';return console['error'](a38_0x123249[_0x320517(0x2ba)](_0x320517(0x343)+_0x92a578)),console[_0x320517(0x290)](a38_0x123249[_0x320517(0x2ba)](_0x320517(0x30b)+_0x1df9db[_0x320517(0x1df)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a38_0x11e0cd(0x21a)]=a38_0x11e0cd(0x314);[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x34f);async[a38_0x11e0cd(0x35c)](_0x264c03){const _0x59fd76=a38_0x11e0cd,{options:_0x2c2dd0,args:_0x5881c3,tdx:_0x16192c}=_0x264c03,_0x51bd98=this['resolveProjectDir'](_0x5881c3,_0x2c2dd0),_0x2a1685=_0x2c2dd0[_0x59fd76(0x2b2)],_0x3aa88a=_0x2c2dd0['skipValidation'];_0x2c2dd0[_0x59fd76(0x293)]&&(_0x51bd98&&console[_0x59fd76(0x290)]('Source\x20directory:\x20'+_0x51bd98),_0x2a1685&&console[_0x59fd76(0x290)](_0x59fd76(0x229)+_0x2a1685),_0x2c2dd0['dryRun']&&console['error']('Dry\x20run:\x20yes'),_0x3aa88a&&console['error'](_0x59fd76(0x2e5)));let _0x31662e;try{_0x31662e=await withSpinner(_0x59fd76(0x210),()=>_0x16192c[_0x59fd76(0x2a2)][_0x59fd76(0x35b)]({'sourceDir':_0x51bd98,'revision':_0x2a1685,'skipValidation':_0x3aa88a}),{'verbose':_0x2c2dd0[_0x59fd76(0x293)]});}catch(_0x5d6b08){if(_0x5d6b08 instanceof Error&&_0x5d6b08[_0x59fd76(0x1b9)]['includes']('No\x20workflow\x20tdx.json\x20found'))return console[_0x59fd76(0x290)](a38_0x123249[_0x59fd76(0x1d1)](_0x59fd76(0x26c)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x2c2dd0[_0x59fd76(0x280)]?console[_0x59fd76(0x290)](a38_0x123249[_0x59fd76(0x2ba)](_0x59fd76(0x21e)+_0x2c2dd0[_0x59fd76(0x280)]+_0x59fd76(0x20b)+_0x2c2dd0['workflowProject']+'\x27')):console['error'](a38_0x123249['dim'](_0x59fd76(0x1dd))),0x1;throw _0x5d6b08;}const _0x259f31=_0x31662e[_0x59fd76(0x35a)];console[_0x59fd76(0x290)]('✔\x20Project:\x20'+_0x259f31[_0x59fd76(0x1df)]),console[_0x59fd76(0x290)](_0x59fd76(0x31c)+_0x259f31[_0x59fd76(0x327)]),console[_0x59fd76(0x290)](_0x59fd76(0x2ad)+_0x259f31[_0x59fd76(0x2b2)]),console[_0x59fd76(0x290)](_0x59fd76(0x1e5)+a38_0x123249[_0x59fd76(0x340)]('+'+_0x259f31[_0x59fd76(0x21f)][_0x59fd76(0x347)]+_0x59fd76(0x1c7))+',\x20'+(a38_0x123249['yellow']('~'+_0x259f31[_0x59fd76(0x21f)][_0x59fd76(0x2e8)]+'\x20modified')+',\x20')+(a38_0x123249[_0x59fd76(0x1d1)]('-'+_0x259f31[_0x59fd76(0x21f)][_0x59fd76(0x231)]+_0x59fd76(0x211))+',\x20')+(''+a38_0x123249[_0x59fd76(0x2ba)](_0x259f31[_0x59fd76(0x21f)][_0x59fd76(0x24e)]+_0x59fd76(0x33c))));for(const _0x46092f of _0x259f31[_0x59fd76(0x315)]){_0x46092f[_0x59fd76(0x34c)]==='modified'&&_0x46092f[_0x59fd76(0x2b4)]&&(console[_0x59fd76(0x290)]('\x0a'+a38_0x123249[_0x59fd76(0x1f8)](_0x59fd76(0x25f)+_0x46092f[_0x59fd76(0x249)])),console[_0x59fd76(0x290)](_0x46092f[_0x59fd76(0x2b4)]));}if(!_0x259f31['hasChanges'])return console[_0x59fd76(0x290)](a38_0x123249[_0x59fd76(0x340)](_0x59fd76(0x298))),await this[_0x59fd76(0x2f4)](_0x16192c,_0x259f31[_0x59fd76(0x1df)],_0x2c2dd0[_0x59fd76(0x1ca)]),0x0;if(_0x2c2dd0['dryRun'])return console['error'](a38_0x123249[_0x59fd76(0x2e2)](_0x59fd76(0x215))),0x0;if(!_0x2c2dd0[_0x59fd76(0x31b)]){const _0x448bdb=await confirmKey(_0x59fd76(0x2a8));if(!_0x448bdb)return console['error'](_0x59fd76(0x1e3)),0x0;}const _0x3fea1b=await withSpinner(_0x59fd76(0x307),()=>_0x16192c[_0x59fd76(0x2a2)][_0x59fd76(0x332)](_0x259f31),{'verbose':_0x2c2dd0[_0x59fd76(0x293)]}),_0x42fbd1=_0x3fea1b[_0x59fd76(0x35a)];return console[_0x59fd76(0x290)](a38_0x123249[_0x59fd76(0x340)]('✔\x20Push\x20complete')),console['error'](_0x59fd76(0x201)+_0x42fbd1['projectId']),console['error'](_0x59fd76(0x2ad)+_0x42fbd1['revision']),await this[_0x59fd76(0x2f4)](_0x16192c,_0x42fbd1['projectName'],_0x2c2dd0[_0x59fd76(0x1ca)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a38_0x11e0cd(0x21a)]=a38_0x11e0cd(0x252);['description']=a38_0x11e0cd(0x2fe);async[a38_0x11e0cd(0x35c)](_0x21c913){const _0x668254=a38_0x11e0cd,{options:_0x40147d,args:_0x3ac15f,tdx:_0x15cb4c}=_0x21c913,_0x230a35=this['resolveProjectDir'](_0x3ac15f,_0x40147d),_0x4710d8=_0x40147d[_0x668254(0x21a)],_0x5bc1c1=_0x40147d[_0x668254(0x2b2)],_0x5df733=_0x40147d['skipValidation'];if(!_0x230a35)return console[_0x668254(0x290)](a38_0x123249['red']('Error:'),'Source\x20directory\x20is\x20required'),console[_0x668254(0x290)](a38_0x123249[_0x668254(0x2ba)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x668254(0x290)](a38_0x123249['dim'](_0x668254(0x319))),0x1;if(!_0x4710d8)return console[_0x668254(0x290)](a38_0x123249[_0x668254(0x1d1)](_0x668254(0x26c)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x668254(0x290)](a38_0x123249[_0x668254(0x2ba)](_0x668254(0x32c))),0x1;_0x40147d[_0x668254(0x293)]&&(console[_0x668254(0x290)](_0x668254(0x34b)+_0x230a35),console[_0x668254(0x290)](_0x668254(0x2fa)+_0x4710d8),_0x5bc1c1&&console[_0x668254(0x290)](_0x668254(0x229)+_0x5bc1c1),_0x40147d[_0x668254(0x34a)]&&console[_0x668254(0x290)](_0x668254(0x341)),_0x5df733&&console[_0x668254(0x290)](_0x668254(0x2e5)));const _0x1a6bfd=await withSpinner(_0x668254(0x1b7),()=>_0x15cb4c[_0x668254(0x2a2)][_0x668254(0x34e)](_0x230a35,_0x4710d8,{'revision':_0x5bc1c1,'skipValidation':_0x5df733}),{'verbose':_0x40147d[_0x668254(0x293)]}),_0x28595e=_0x1a6bfd[_0x668254(0x35a)];console[_0x668254(0x290)](_0x668254(0x1f2)+_0x28595e[_0x668254(0x327)]);_0x28595e[_0x668254(0x1e0)]&&console[_0x668254(0x290)]('Source\x20project:\x20'+_0x28595e[_0x668254(0x1e0)]);console[_0x668254(0x290)](_0x668254(0x2fa)+_0x28595e['newProjectName']),console[_0x668254(0x290)](_0x668254(0x229)+_0x28595e[_0x668254(0x2b2)]),console[_0x668254(0x290)](_0x668254(0x248)+_0x28595e[_0x668254(0x295)]);_0x28595e['targetExists']&&(console['error'](a38_0x123249[_0x668254(0x2e2)](_0x668254(0x266)+_0x28595e['newProjectName']+_0x668254(0x221)+_0x28595e[_0x668254(0x31d)]+')')),console['error'](a38_0x123249[_0x668254(0x2e2)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x40147d[_0x668254(0x34a)])return console[_0x668254(0x290)](a38_0x123249[_0x668254(0x2e2)]('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x40147d[_0x668254(0x31b)]){const _0x1630d0=_0x28595e['sourceProjectName']||a38_0x1d077e['basename'](_0x230a35),_0x564412=_0x28595e[_0x668254(0x348)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x4710d8+_0x668254(0x292):_0x668254(0x2c5)+_0x1630d0+_0x668254(0x32a)+_0x4710d8+'\x22?',_0xe548fa=await confirmKey(_0x564412);if(!_0xe548fa)return console[_0x668254(0x290)](_0x668254(0x1e3)),0x0;}const _0x3bf3ec=await withSpinner(_0x28595e[_0x668254(0x348)]?_0x668254(0x325)+_0x4710d8+_0x668254(0x24b):_0x668254(0x349)+_0x4710d8+_0x668254(0x24b),()=>_0x15cb4c[_0x668254(0x2a2)][_0x668254(0x1fa)](_0x28595e),{'verbose':_0x40147d['verbose']}),_0x48c330=_0x3bf3ec[_0x668254(0x35a)];return console[_0x668254(0x290)](a38_0x123249['green'](_0x28595e[_0x668254(0x348)]?_0x668254(0x250):_0x668254(0x23b))),console[_0x668254(0x290)](_0x668254(0x1ef)+_0x48c330[_0x668254(0x1b4)]),console[_0x668254(0x290)](_0x668254(0x201)+_0x48c330[_0x668254(0x203)]),console[_0x668254(0x290)](_0x668254(0x2ad)+_0x48c330['revision']),await this[_0x668254(0x2f4)](_0x15cb4c,_0x48c330['newProjectName'],_0x40147d[_0x668254(0x1ca)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a38_0x11e0cd(0x21a)]='workflow:delete';[a38_0x11e0cd(0x218)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a38_0x11e0cd(0x35c)](_0x47d1d1){const _0x3d9ccb=a38_0x11e0cd,{options:_0x29769a,args:_0x5e3633,tdx:_0x55f90f}=_0x47d1d1,_0x47fa41=_0x5e3633[0x0];if(!_0x47fa41)return console[_0x3d9ccb(0x290)](_0x3d9ccb(0x235)),console['error'](_0x3d9ccb(0x333)),0x1;_0x29769a[_0x3d9ccb(0x293)]&&console[_0x3d9ccb(0x290)](_0x3d9ccb(0x2e0)+_0x47fa41);if(!_0x29769a[_0x3d9ccb(0x31b)]){const _0x46db45=await confirmKey(_0x3d9ccb(0x227)+_0x47fa41+_0x3d9ccb(0x2ac));if(!_0x46db45)return console[_0x3d9ccb(0x290)]('Cancelled'),0x0;}const _0x46a3d8=await withSpinner(_0x3d9ccb(0x1c4)+_0x47fa41+_0x3d9ccb(0x24b),()=>_0x55f90f[_0x3d9ccb(0x2a2)]['delete'](_0x47fa41),{'verbose':_0x29769a['verbose']}),_0x494338=_0x46a3d8[_0x3d9ccb(0x35a)];return console[_0x3d9ccb(0x290)](_0x3d9ccb(0x1d5)+_0x494338[_0x3d9ccb(0x1df)]),console[_0x3d9ccb(0x290)](_0x3d9ccb(0x201)+_0x494338[_0x3d9ccb(0x2df)]),0x0;}}export function parseKeyValue(_0x240e51){const _0x255dfd=a38_0x11e0cd,_0x3f65df=_0x240e51[_0x255dfd(0x2d6)]('=');if(_0x3f65df===-0x1)throw new Error(_0x255dfd(0x313)+_0x240e51+_0x255dfd(0x1d3));const _0x251574=_0x240e51['substring'](0x0,_0x3f65df),_0x5258c4=_0x240e51[_0x255dfd(0x29a)](_0x3f65df+0x1);if(!_0x251574)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x251574,'value':_0x5258c4};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a38_0x11e0cd(0x21a)]=a38_0x11e0cd(0x30c);[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x1be);async[a38_0x11e0cd(0x35c)](_0x229115){const _0x242f45=a38_0x11e0cd,{options:_0x355534,args:_0x348889,tdx:_0x5cdb80}=_0x229115,_0x3446d5=this['requireProject'](_0x348889,_0x355534);if(!_0x3446d5)return 0x1;_0x355534[_0x242f45(0x293)]&&console[_0x242f45(0x290)](_0x242f45(0x2e0)+_0x3446d5);const _0x370eb5=await withSpinner(_0x242f45(0x2c1),()=>_0x5cdb80['workflow'][_0x242f45(0x2ed)](_0x3446d5),{'verbose':_0x355534[_0x242f45(0x293)]}),{secrets:_0x294d5d}=_0x370eb5[_0x242f45(0x35a)];return console[_0x242f45(0x290)](_0x242f45(0x265)+_0x294d5d[_0x242f45(0x279)]+_0x242f45(0x2ff)+(_0x294d5d['length']!==0x1?'s':'')),await handleSDKOutput(_0x294d5d,_0x355534),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a38_0x11e0cd(0x21a)]=a38_0x11e0cd(0x2e6);['description']=a38_0x11e0cd(0x27c);async['execute'](_0x2ba54f){const _0x2462ba=a38_0x11e0cd,{options:_0x283430,args:_0x1cd0d5,tdx:_0x21465b}=_0x2ba54f;let _0x53d074,_0x1ca1c5;if(_0x1cd0d5[_0x2462ba(0x279)]>=0x2)_0x53d074=_0x1cd0d5[0x0],_0x1ca1c5=_0x1cd0d5[0x1];else{if(_0x1cd0d5[_0x2462ba(0x279)]===0x1&&_0x283430[_0x2462ba(0x280)])_0x53d074=_0x283430[_0x2462ba(0x280)],_0x1ca1c5=_0x1cd0d5[0x0];else return _0x1cd0d5[_0x2462ba(0x279)]===0x1?(console[_0x2462ba(0x290)](_0x2462ba(0x2c4)),console[_0x2462ba(0x290)](_0x2462ba(0x208)),0x1):(console[_0x2462ba(0x290)](_0x2462ba(0x2bb)),console[_0x2462ba(0x290)](_0x2462ba(0x351)),0x1);}let _0x173dd2,_0x4fdec7;try{({key:_0x173dd2,value:_0x4fdec7}=parseKeyValue(_0x1ca1c5));}catch(_0x420097){return _0x420097 instanceof Error&&console[_0x2462ba(0x290)](a38_0x123249[_0x2462ba(0x1d1)](_0x2462ba(0x26c)),_0x420097[_0x2462ba(0x1b9)]),0x1;}_0x283430[_0x2462ba(0x293)]&&(console[_0x2462ba(0x290)](_0x2462ba(0x2e0)+_0x53d074),console[_0x2462ba(0x290)](_0x2462ba(0x245)+_0x173dd2));const _0x4b55c6=await withSpinner(_0x2462ba(0x20a),()=>_0x21465b[_0x2462ba(0x2a2)][_0x2462ba(0x257)](_0x53d074,_0x173dd2,_0x4fdec7),{'verbose':_0x283430[_0x2462ba(0x293)]}),_0x3842fd=_0x4b55c6['data'];return console[_0x2462ba(0x290)](_0x2462ba(0x226)+_0x3842fd[_0x2462ba(0x287)]+_0x2462ba(0x26e)+_0x3842fd[_0x2462ba(0x1df)]+'\x27'),(_0x283430[_0x2462ba(0x344)]||_0x283430['jsonl'])&&await handleSingleObjectOutput(_0x3842fd,_0x283430),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a38_0x11e0cd(0x1db);[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x217);async[a38_0x11e0cd(0x35c)](_0x4a8a47){const _0x414f28=a38_0x11e0cd,{options:_0x323284,args:_0x5f1604,tdx:_0x37bc2e}=_0x4a8a47;let _0x2d5734,_0x45fe50;if(_0x5f1604[_0x414f28(0x279)]>=0x2)_0x2d5734=_0x5f1604[0x0],_0x45fe50=_0x5f1604[0x1];else{if(_0x5f1604[_0x414f28(0x279)]===0x1&&_0x323284[_0x414f28(0x280)])_0x2d5734=_0x323284[_0x414f28(0x280)],_0x45fe50=_0x5f1604[0x0];else return _0x5f1604['length']===0x1?(console['error'](_0x414f28(0x2c4)),console[_0x414f28(0x290)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x414f28(0x290)](_0x414f28(0x27e)),console['error']('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x323284[_0x414f28(0x293)]&&(console['error']('Project:\x20'+_0x2d5734),console[_0x414f28(0x290)](_0x414f28(0x245)+_0x45fe50));if(!_0x323284[_0x414f28(0x31b)]){const _0xf87fae=await confirmKey(_0x414f28(0x29e)+_0x45fe50+_0x414f28(0x23d)+_0x2d5734+'\x27?');if(!_0xf87fae)return console[_0x414f28(0x290)](_0x414f28(0x1e3)),0x0;}const _0x3d11e4=await withSpinner('Deleting\x20secret...',()=>_0x37bc2e[_0x414f28(0x2a2)][_0x414f28(0x2b0)](_0x2d5734,_0x45fe50),{'verbose':_0x323284[_0x414f28(0x293)]}),_0x16035f=_0x3d11e4[_0x414f28(0x35a)];return console['error'](_0x414f28(0x226)+_0x16035f[_0x414f28(0x287)]+_0x414f28(0x2c6)+_0x16035f[_0x414f28(0x1df)]+'\x27'),(_0x323284[_0x414f28(0x344)]||_0x323284[_0x414f28(0x200)])&&await handleSingleObjectOutput(_0x16035f,_0x323284),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(_0x220230){const _0x5a3db7=a38_0x11e0cd,_0x25fbc7=Math[_0x5a3db7(0x1d8)](_0x220230/0x3e8),_0x180053=Math[_0x5a3db7(0x1d8)](_0x25fbc7/0x3c),_0x18dd56=Math[_0x5a3db7(0x1d8)](_0x180053/0x3c),_0x2d9a33=Math[_0x5a3db7(0x1d8)](_0x18dd56/0x18);if(_0x2d9a33>0x0){const _0x1e40ce=_0x18dd56%0x18;return _0x1e40ce>0x0?_0x2d9a33+'d\x20'+_0x1e40ce+'h':_0x2d9a33+'d';}else{if(_0x18dd56>0x0){const _0x5b83df=_0x180053%0x3c;return _0x5b83df>0x0?_0x18dd56+'h\x20'+_0x5b83df+'m':_0x18dd56+'h';}else{if(_0x180053>0x0){const _0x346015=_0x25fbc7%0x3c;return _0x346015>0x0?_0x180053+'m\x20'+_0x346015+'s':_0x180053+'m';}else return _0x25fbc7+'s';}}}function formatTimestamp(_0x46e1ff,_0x14d787){const _0x29b55b=a38_0x11e0cd,_0x558177=new Date(_0x46e1ff),_0x4daa92=String(_0x558177[_0x29b55b(0x304)]())[_0x29b55b(0x1c3)](0x2,'0'),_0x22507e=String(_0x558177[_0x29b55b(0x1c5)]())['padStart'](0x2,'0'),_0x43fe0a=_0x4daa92+':'+_0x22507e,_0x1fad8f=_0x558177['getFullYear']()===_0x14d787[_0x29b55b(0x2e4)]()&&_0x558177[_0x29b55b(0x2a6)]()===_0x14d787[_0x29b55b(0x2a6)]()&&_0x558177[_0x29b55b(0x2f7)]()===_0x14d787[_0x29b55b(0x2f7)]();if(_0x1fad8f)return _0x43fe0a;else{const _0x245c03=String(_0x558177[_0x29b55b(0x2a6)]()+0x1)['padStart'](0x2,'0'),_0x1723ab=String(_0x558177['getDate']())[_0x29b55b(0x1c3)](0x2,'0');return _0x245c03+'-'+_0x1723ab+'\x20'+_0x43fe0a;}}function formatDate(_0x5cdc85){const _0x2f6202=a38_0x11e0cd,_0x1dd0b1=_0x5cdc85[_0x2f6202(0x2e4)](),_0x5ef2c9=String(_0x5cdc85[_0x2f6202(0x2a6)]()+0x1)['padStart'](0x2,'0'),_0x15e197=String(_0x5cdc85[_0x2f6202(0x2f7)]())[_0x2f6202(0x1c3)](0x2,'0');return _0x1dd0b1+'-'+_0x5ef2c9+'-'+_0x15e197;}function getTaskStateIcon(_0x2709cf){const _0x4dc53e={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x4dc53e[_0x2709cf]||'⚪';}function getBarChar(_0x33b919){const _0x4574e9=a38_0x11e0cd;return _0x33b919===_0x4574e9(0x290)||_0x33b919===_0x4574e9(0x2d7)?'×':'─';}function getBarColor(_0x3e5b2e){const _0x532119=a38_0x11e0cd,_0x402544={'success':a38_0x123249[_0x532119(0x340)],'error':a38_0x123249[_0x532119(0x1d1)],'group_error':a38_0x123249['red'],'running':a38_0x123249[_0x532119(0x20e)],'blocked':a38_0x123249[_0x532119(0x2e2)],'planned':a38_0x123249[_0x532119(0x2ba)],'canceling':a38_0x123249['yellow']};return _0x402544[_0x3e5b2e]||a38_0x123249[_0x532119(0x27a)];}function parseTaskName(_0xc6ab76){const _0x31a301=a38_0x11e0cd;let _0x2eb1e5=_0xc6ab76[_0x31a301(0x2c3)](/^\++/,'');const _0x50c538=_0x2eb1e5[_0x31a301(0x30e)]('+'),_0x2d2e97=_0x50c538['length']>0x1?_0x50c538[_0x31a301(0x279)]-0x2:0x0,_0x4c28f8=_0x50c538[_0x50c538['length']-0x1]||_0x2eb1e5;return{'level':_0x2d2e97,'name':'+'+_0x4c28f8};}function truncateTaskName(_0x284d48,_0x3f0b88){const _0x1afed6=a38_0x11e0cd,_0x51ac84=stringWidth(_0x284d48);if(_0x51ac84<=_0x3f0b88)return _0x284d48;let _0x161f65=_0x284d48;while(stringWidth(_0x161f65+'…')>_0x3f0b88&&_0x161f65['length']>0x0){_0x161f65=_0x161f65[_0x1afed6(0x30a)](0x0,-0x1);}return _0x161f65+'…';}function calculateTimeScale(_0x393b8d,_0x1a3df7){const _0x5d7308=a38_0x11e0cd;return{'startTime':_0x393b8d[_0x5d7308(0x2a5)],'endTime':_0x393b8d[_0x5d7308(0x2b6)],'durationMs':_0x393b8d[_0x5d7308(0x339)],'msPerChar':_0x393b8d[_0x5d7308(0x339)]/_0x1a3df7};}function timeToPosition(_0x2e20c4,_0x184dc4,_0x43a355){const _0x48cfb9=a38_0x11e0cd,_0x45917d=_0x2e20c4-_0x184dc4[_0x48cfb9(0x240)],_0x54309f=Math[_0x48cfb9(0x1d8)](_0x45917d/_0x184dc4['msPerChar']);return Math[_0x48cfb9(0x258)](0x0,Math[_0x48cfb9(0x342)](_0x54309f,_0x43a355));}function renderTimeAxis(_0x3eafaa,_0x2b1914){const _0x11bd90=a38_0x11e0cd,_0x2699eb=Math['min'](TIMELINE_CONFIG[_0x11bd90(0x334)],Math[_0x11bd90(0x258)](TIMELINE_CONFIG[_0x11bd90(0x1f3)],Math[_0x11bd90(0x1d8)](_0x2b1914/TIMELINE_CONFIG[_0x11bd90(0x256)]))),_0x5eb05f=_0x3eafaa[_0x11bd90(0x2a9)]/(_0x2699eb-0x1),_0x595162=new Date(_0x3eafaa[_0x11bd90(0x240)]),_0x242a45=[];for(let _0x389649=0x0;_0x389649<_0x2699eb;_0x389649++){const _0x2c9bbd=_0x3eafaa['startTime']+_0x389649*_0x5eb05f,_0x194544=timeToPosition(_0x2c9bbd,_0x3eafaa,_0x2b1914),_0x7866e6=formatTimestamp(_0x2c9bbd,_0x595162);_0x242a45[_0x11bd90(0x1ba)]({'pos':_0x194544,'text':_0x7866e6});}const _0x1ed3c5=new Array(_0x2b1914)['fill']('\x20');let _0x743fae=-0x1;for(const {pos:_0x4f1542,text:_0x5cd099}of _0x242a45){let _0x51a0fa=Math['max'](0x0,_0x4f1542-Math[_0x11bd90(0x1d8)](_0x5cd099[_0x11bd90(0x279)]/0x2));_0x51a0fa<=_0x743fae+TIMELINE_CONFIG[_0x11bd90(0x23a)]&&(_0x51a0fa=_0x743fae+TIMELINE_CONFIG[_0x11bd90(0x23a)]+0x1);_0x51a0fa+_0x5cd099[_0x11bd90(0x279)]>_0x2b1914&&(_0x51a0fa=_0x2b1914-_0x5cd099[_0x11bd90(0x279)]);if(_0x51a0fa>=0x0&&_0x51a0fa+_0x5cd099['length']<=_0x2b1914&&_0x51a0fa>_0x743fae){for(let _0x4f2f4e=0x0;_0x4f2f4e<_0x5cd099[_0x11bd90(0x279)];_0x4f2f4e++){_0x1ed3c5[_0x51a0fa+_0x4f2f4e]=_0x5cd099[_0x4f2f4e];}_0x743fae=_0x51a0fa+_0x5cd099[_0x11bd90(0x279)]-0x1;}}return _0x1ed3c5[_0x11bd90(0x2dc)]('');}function renderTaskRow(_0x997586,_0x217661,_0x5ebb1d,_0x121d7c){const _0xfc93cf=a38_0x11e0cd,{level:_0xde1030,name:_0x17d81e}=parseTaskName(_0x997586[_0xfc93cf(0x21a)]),_0xec8b63='\x20'[_0xfc93cf(0x1eb)](_0xde1030),_0x159026=_0x997586[_0xfc93cf(0x23e)]?'('+formatElapsed(_0x997586['window'][_0xfc93cf(0x339)])+')':'',_0x1b32c6=stringWidth(_0x159026),_0x1612af=_0xde1030*0x1,_0x266694=_0x121d7c-_0x1612af-_0x1b32c6-0x1,_0x508c2a=truncateTaskName(_0x17d81e,_0x266694),_0x17e2cb=_0xec8b63+_0x508c2a,_0x49dbf9=stringWidth(_0x17e2cb),_0x3120e0=_0x121d7c-_0x49dbf9-_0x1b32c6,_0x23f468=_0x17e2cb+'\x20'[_0xfc93cf(0x1eb)](Math[_0xfc93cf(0x258)](0x1,_0x3120e0))+a38_0x123249[_0xfc93cf(0x2ba)](_0x159026),_0x373374=getTaskStateIcon(_0x997586[_0xfc93cf(0x320)]),_0x4a3be0=new Array(_0x5ebb1d)[_0xfc93cf(0x310)]('\x20');if(_0x997586['window']){const _0x9d5a45=timeToPosition(_0x997586[_0xfc93cf(0x23e)][_0xfc93cf(0x2a5)],_0x217661,_0x5ebb1d),_0x4ea3ee=timeToPosition(_0x997586[_0xfc93cf(0x23e)][_0xfc93cf(0x2b6)],_0x217661,_0x5ebb1d),_0x4ec6bd=getBarChar(_0x997586[_0xfc93cf(0x320)]),_0x55c766=Math[_0xfc93cf(0x258)](_0x9d5a45+0x1,_0x4ea3ee);for(let _0x4ee34b=_0x9d5a45;_0x4ee34b<Math[_0xfc93cf(0x342)](_0x55c766,_0x5ebb1d);_0x4ee34b++){_0x4a3be0[_0x4ee34b]=_0x4ec6bd;}}const _0x2e3cd5=getBarColor(_0x997586[_0xfc93cf(0x320)]),_0x4510b3=_0x4a3be0[_0xfc93cf(0x2a3)](_0x1201ac=>_0x1201ac==='\x20'?'\x20':_0x2e3cd5(_0x1201ac))[_0xfc93cf(0x2dc)]('');return _0x373374+'\x20'+_0x23f468+'│'+_0x4510b3+'│';}function calculateStats(_0x5ead5d){const _0x3dc1c5=a38_0x11e0cd,_0x50c542={'total':_0x5ead5d[_0x3dc1c5(0x279)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x32f4c5 of _0x5ead5d){if(_0x32f4c5['state']==='success')_0x50c542[_0x3dc1c5(0x309)]++;else{if(_0x32f4c5[_0x3dc1c5(0x320)]==='error'||_0x32f4c5['state']===_0x3dc1c5(0x2d7))_0x50c542[_0x3dc1c5(0x290)]++;else _0x32f4c5['state']===_0x3dc1c5(0x2b7)?_0x50c542[_0x3dc1c5(0x2b7)]++:_0x50c542[_0x3dc1c5(0x2d0)]++;}}return _0x50c542;}function formatStats(_0x1fe4bb){const _0x2be2ad=a38_0x11e0cd;return['Total:\x20'+_0x1fe4bb[_0x2be2ad(0x260)],'✅\x20'+_0x1fe4bb[_0x2be2ad(0x309)],'❌\x20'+_0x1fe4bb[_0x2be2ad(0x290)],_0x2be2ad(0x22c)+_0x1fe4bb[_0x2be2ad(0x2b7)],'⏳\x20'+_0x1fe4bb[_0x2be2ad(0x2d0)]][_0x2be2ad(0x2dc)]('\x20\x20');}function a38_0xba68(){const _0x444b07=['✔\x20Workflow\x20run\x20started','table','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','\x20task','project','params','LABEL_MIN_SPACING','✔\x20Clone\x20complete','from','\x27\x20from\x20project\x20\x27','window','finishedAt','startTime','\x20to\x20see\x20detailed\x20logs','✔\x20Downloaded\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','done','Key:\x20','parse','Warning:','Files\x20to\x20upload:\x20','path','\x20-\x20','...','log','kill','unchanged','workflowName','✔\x20Project\x20updated','workflow:retry','workflow:clone','POLL_INTERVAL_MS','Pushing\x20workflow\x20project...','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','LABEL_WIDTH_DIVISOR','setSecret','max','sessionId','metadata','\x20tasks','Killing\x20attempt...','includeSubtasks','Parameters:\x20','---\x20','total','\x27...','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Expected\x20format:\x20--param\x20key=value','\x20(use\x20--limit\x20to\x20show\x20more)','✔\x20Found\x20','\x0a⚠\x20Project\x20\x22','ICON_WIDTH','\x20\x20Target:\x20','workflow:upload','startsWith','/app/workflows/','Error:','isNewProject','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','filesExtracted','Select\x20a\x20session\x20to\x20view\x20timeline:','sessionTime','Getting\x20attempt\x20tasks...','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','workflow:timeline','\x20\x20Files\x20extracted:\x20','Start\x20a\x20workflow\x20run','List\x20workflow\x20execution\x20sessions','No\x20sessions\x20with\x20timing\x20information','length','white','Downloading\x20logs...','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Task\x20name:\x20','Error:\x20Secret\x20key\x20is\x20required','set','workflowProject','match','list','rows','List\x20workflow\x20attempts','GUTTER','\x20of\x20','key','every','workflow:tasks','toLowerCase','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','workflow:run','buildTimelineData','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','renderSessionsTimeline','error','filter','\x22\x20with\x20new\x20revision?','verbose','keys','fileCount','status','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','\x0a✔\x20No\x20changes\x20to\x20push','TASK_NAME_WIDTH','substring','\x20attempt','\x20is\x20not\x20a\x20directory','startedAt','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','\x20from\x20session\x20','From\x20task:\x20','updatedAt','workflow','map','119flTcIo','start','getMonth','force','\x0aPush\x20these\x20changes?','durationMs','includeRetried','stdout','\x22?\x20This\x20cannot\x20be\x20undone.','\x20\x20Revision:\x20','Latest\x20session\x20has\x20no\x20attempt','splice','deleteSecret','fs/promises','revision','generateSessionTimelineRows','diff','Error:\x20Invalid\x20parameter\x20format:\x20','end','running','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','MIN_TIMELINE_WIDTH','dim','Error:\x20KEY=VALUE\x20is\x20required','List\x20all\x20workflow\x20projects','Fetching\x20log\x20files...','ICON_SPACING','No\x20sessions\x20found\x20in\x20project:\x20','session:','Listing\x20secrets...','unknown','replace','Error:\x20Project\x20name\x20is\x20required','\x0aClone\x20\x22','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','workflow:logs','displayLine','workflows','Error:\x20','session_id','\x20sessions\x20','Output\x20directory:\x20','(unknown)','Error:\x20Invalid\x20JSON\x20in\x20--params','pending','round','✔\x20Retry\x20started','get','workflow:use','getTime','indexOf','group_error','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','249ypCLyk','sort','Getting\x20attempt\x20details...','join','Status:\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','projectId','Project:\x20','workflow:download','yellow','\x20\x20Session\x20ID:\x20','getFullYear','Validation:\x20skipped','workflow:secrets:set','param','modified','✔\x20Workflow\x20project\x20context\x20cleared.','Project\x20directory:\x20','MAX_TASKS_DISPLAY','retrySession','listSecrets','List\x20workflows','navigateSessionsInteractive','No\x20sessions\x20found\x20for:\x20','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','Show\x20specific\x20attempt\x20details','some','showWorkflowConsoleUrl','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','has','getDate','pollTimeline','retryAttemptName','New\x20project\x20name:\x20','text','tdx.json','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','\x20secret','Starting\x20workflow\x20run...','revision:\x20','1833852EghWwu','341490WJTTvD','getHours','\x0a✔\x20Already\x20up\x20to\x20date','toISOString','Pushing\x20project...','No\x20workflows\x20found','success','slice','\x20\x20Session\x20context\x20set\x20to:\x20','workflow:secrets:list','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','split','now','fill','Pattern:\x20','Writing\x20files...','Invalid\x20format:\x20','workflow:push','changes','autocomplete','\x20\x20Console:\x20','isArray','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','follow','yes','\x20\x20Source:\x20','existingProjectId','✔\x20New\x20project:\x20','💡\x20Tip:\x20Use\x20','state','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','No\x20attempts\x20found','clear','fileSize','Updating\x20','Retrying\x20attempt...','sourceDir','sessions','lastAttempt','\x22\x20to\x20new\x20project\x20\x22','MAX_POLL_ITERATIONS','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','No\x20log\x20files\x20found\x20for\x20this\x20attempt','all','task','Project\x20name\x20is\x20required','Listing\x20workflow\x20projects...','executePushProject','Usage:\x20workflow:delete\x20<project-name-or-id>','MAX_LABEL_COUNT','Retrying\x20session...','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','8tPbHPf','relative','duration','\x0aApply\x20these\x20changes?','Listing\x20workflows...','\x20unchanged','\x20(system)','tdx\x20wf\x20attempt\x20','Loading\x20sessions...','green','Dry\x20run:\x20yes','min','\x20\x20Location:\x20','json','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Include\x20retried:\x20yes','new','targetExists','Cloning\x20to\x20','dryRun','Source\x20directory:\x20','type','skipValidation','prepareCloneProject','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','resolveProject','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','columns','\x20project','attemptId','Using\x20attempt\x20','Loading\x20workflows...','No\x20sessions\x20found','icon','✔\x20Pushed\x20','data','preparePushProject','execute','retryAttempt','projects','newProjectName','✔\x20Workflow\x20project\x20set\x20to:\x20','Filter:\x20project=','Analyzing\x20project...','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','message','push','Listing\x20workflow\x20attempts...','logFiles','\x20\x20Workflow:\x20','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','session','canceling','sys','Filter:\x20','padStart','Deleting\x20project\x20','getMinutes','fullName','\x20new','Including\x20subtasks:\x20yes','select','site','resumeFrom','12429740DnKIJG','localeCompare','value','Listing\x20workflow\x20sessions...','(use\x20--limit\x20to\x20see\x20more)','red','limit','.\x20Expected\x20format:\x20KEY=VALUE','attempt','✔\x20Deleted\x20project\x20','✔\x20Pull\x20complete','targetDir','floor','trim','cancelRequested','workflow:secrets:delete','planned','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','resolveProjectId','projectName','sourceProjectName','Force:\x20yes','Retry\x20a\x20session\x20or\x20attempt','Cancelled','createdAt','\x20\x20Changes:\x20','stringify','\x1b[1A\x1b[2K','Kill\x20a\x20running\x20attempt','renderTimeline','Select\x20a\x20workflow\x20to\x20run','repeat','1227048NspMpf','📁\x20','resolve','\x20\x20Project:\x20','Project\x20filter:\x20','Params:\x20','Source:\x20','MIN_LABEL_COUNT','write','requireProject','resolveProjectDir','find','cyan','taskName','executeCloneProject','No\x20workflow\x20sessions\x20found','45718rztSdS','Session\x20','Workflow:\x20','workflow:projects','jsonl','\x20\x20Project\x20ID:\x20','workflow:attempts','newProjectId','No\x20workflows\x20found\x20in\x20project:\x20','includes','Error:\x20Attempt\x20ID\x20is\x20required','stat','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','isTTY','Setting\x20secret...','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','index','Attempt:\x20','blue','tasks','Analyzing\x20changes...','\x20deleted','context','No\x20attempts\x20found\x20for:\x20','renderSingleTimeline','\x0aDry\x20run\x20-\x20nothing\x20pushed','\x20workflow','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','description','Resume\x20from:\x20','name','utf-8','Show\x20tasks\x20for\x20an\x20attempt','9223848xfNabG','Tip:\x20cd\x20to\x20workflows/','summary','format','\x22\x20already\x20exists\x20(ID:\x20','values','Project\x20name:\x20','\x20has\x20no\x20attempts','hasChanges','✔\x20Secret\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','cwd','Revision:\x20','\x0aDry\x20run\x20-\x20no\x20files\x20written','Attempt\x20ID:\x20','🔄\x20','No\x20matching\x20sessions\x20found','parseProjectWorkflowPattern','9617915jDgMUo','workflow:sessions','deleted','output'];a38_0xba68=function(){return _0x444b07;};return a38_0xba68();}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a38_0x11e0cd(0x21a)]=a38_0x11e0cd(0x274);[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x28b);async[a38_0x11e0cd(0x35c)](_0x36fa72){const _0x245673=a38_0x11e0cd,{options:_0xd76e5e,args:_0x12d0ca,tdx:_0x2081ec}=_0x36fa72;let _0x5d45f1,_0x3f64d1,_0x585896=![];if(_0x12d0ca[0x0]){if(_0x12d0ca[0x0][_0x245673(0x205)]('.')){const _0x5647ea=this[_0x245673(0x22e)](_0x12d0ca,_0xd76e5e);if(!_0x5647ea)return 0x1;_0x5d45f1=_0x5647ea['projectName'],_0x3f64d1=_0x5647ea[_0x245673(0x24f)];}else{_0x3f64d1=_0x12d0ca[0x0],_0x5d45f1=_0xd76e5e[_0x245673(0x280)];if(!_0x5d45f1)return console[_0x245673(0x290)](a38_0x123249['red'](_0x245673(0x26c)),_0x245673(0x2d8)),0x1;_0x585896=!![];}}else{const _0x112a85=this[_0x245673(0x22e)](_0x12d0ca,_0xd76e5e);if(!_0x112a85)return 0x1;_0x5d45f1=_0x112a85['projectName'],_0x3f64d1=_0x112a85[_0x245673(0x24f)];}if(_0xd76e5e[_0x245673(0x293)]){if(_0x5d45f1&&_0x3f64d1)console[_0x245673(0x290)]('Filter:\x20'+_0x5d45f1+'.'+_0x3f64d1);else _0x5d45f1&&console[_0x245673(0x290)](_0x245673(0x1b6)+_0x5d45f1);}const _0x4c4693=_0xd76e5e[_0x245673(0x354)],_0x597d8f=_0xd76e5e[_0x245673(0x259)];if(_0x4c4693){_0x597d8f&&console['error'](a38_0x123249[_0x245673(0x2e2)](_0x245673(0x247)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x44bb08=_0xd76e5e[_0x245673(0x31a)];return _0x44bb08?await this[_0x245673(0x2f8)](_0x36fa72,_0x4c4693):await this[_0x245673(0x214)](_0x36fa72,_0x4c4693,_0xd76e5e),0x0;}if(_0x597d8f){const _0x4b4355=await withSpinner('Loading\x20session...',()=>_0x2081ec['workflow'][_0x245673(0x328)]({'projectName':_0x5d45f1,'workflowName':_0x3f64d1,'limit':0x64}),{'verbose':_0xd76e5e[_0x245673(0x293)]}),_0x1db13d=_0x4b4355[_0x245673(0x35a)]['find'](_0x2e4fac=>_0x2e4fac['id']===_0x597d8f);if(!_0x1db13d)return console[_0x245673(0x290)](a38_0x123249[_0x245673(0x1d1)](_0x245673(0x26c)),'Session\x20not\x20found:\x20'+_0x597d8f),0x1;if(!_0x1db13d[_0x245673(0x329)]?.['id'])return console[_0x245673(0x290)](a38_0x123249[_0x245673(0x1d1)]('Error:'),_0x245673(0x1fd)+_0x597d8f+_0x245673(0x224)),0x1;const _0x11a891=_0x1db13d[_0x245673(0x329)]['id'];_0xd76e5e[_0x245673(0x293)]&&console['error'](_0x245673(0x355)+_0x11a891+_0x245673(0x29f)+_0x597d8f);const _0x32fcd2=_0xd76e5e[_0x245673(0x31a)];return _0x32fcd2?await this['pollTimeline'](_0x36fa72,_0x11a891):await this[_0x245673(0x214)](_0x36fa72,_0x11a891,_0xd76e5e),0x0;}const _0x52b795=await withSpinner(_0x245673(0x33f),()=>_0x2081ec[_0x245673(0x2a2)][_0x245673(0x328)]({'projectName':_0x5d45f1,'workflowName':_0x3f64d1,'limit':_0xd76e5e[_0x245673(0x1d2)]||0x32}),{'verbose':_0xd76e5e[_0x245673(0x293)]}),_0x958a6e=_0x52b795[_0x245673(0x35a)];if(_0x958a6e['length']===0x0){if(_0x5d45f1&&_0x3f64d1)console[_0x245673(0x290)](_0x245673(0x2f0)+_0x5d45f1+'.'+_0x3f64d1);else _0x5d45f1?console[_0x245673(0x290)](_0x245673(0x2bf)+_0x5d45f1):(console['error'](_0x245673(0x1fb)),console['error'](a38_0x123249[_0x245673(0x2ba)]('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x958a6e[_0x245673(0x2da)]((_0x185c68,_0x465532)=>{const _0x330271=_0x245673,_0x9aaf7c=_0x185c68[_0x330271(0x271)]||'',_0x12a328=_0x465532['sessionTime']||'';return _0x12a328['localeCompare'](_0x9aaf7c);});if(_0xd76e5e[_0x245673(0x344)]||_0xd76e5e[_0x245673(0x200)])return await handleSDKOutput(_0x958a6e,_0xd76e5e),0x0;let _0x30a59c;if(_0x585896){const _0x524168=_0x958a6e[0x0];if(!_0x524168['lastAttempt']?.['id'])return console[_0x245673(0x290)](_0x245673(0x2ae)),0x0;_0x30a59c=_0x524168[_0x245673(0x329)]['id'],_0xd76e5e[_0x245673(0x293)]&&console[_0x245673(0x290)]('Auto-selected\x20latest\x20session:\x20'+_0x524168[_0x245673(0x271)]);}else{const _0x20b1c5=_0x958a6e[_0x245673(0x2a3)](_0x3e8e6a=>{const _0x1efc8d=_0x245673,_0x2387e1=getAttemptStatusDisplay(_0x3e8e6a[_0x1efc8d(0x329)]);return{'title':_0x3e8e6a[_0x1efc8d(0x238)]?.[_0x1efc8d(0x21a)]+'.'+_0x3e8e6a[_0x1efc8d(0x2a2)]?.[_0x1efc8d(0x21a)]+_0x1efc8d(0x24a)+_0x3e8e6a[_0x1efc8d(0x271)]+'\x20'+_0x2387e1[_0x1efc8d(0x358)],'value':_0x3e8e6a['lastAttempt']?.['id']||'','description':_0x2387e1[_0x1efc8d(0x2fb)]};}),_0x17c021=await a38_0x396379({'type':_0x245673(0x1c9),'name':_0x245673(0x354),'message':_0x245673(0x270),'choices':_0x20b1c5[_0x245673(0x291)](_0xa2fbbe=>_0xa2fbbe[_0x245673(0x1ce)]!=='')});if(!_0x17c021[_0x245673(0x354)])return 0x0;_0x30a59c=_0x17c021[_0x245673(0x354)];}const _0x3aa1a1=_0xd76e5e['follow'];return _0x3aa1a1?await this[_0x245673(0x2f8)](_0x36fa72,_0x30a59c):await this['renderSingleTimeline'](_0x36fa72,_0x30a59c,_0xd76e5e),0x0;}async['renderSingleTimeline'](_0x13012c,_0x3f6a73,_0x505a3c){const _0x3fb868=a38_0x11e0cd,{tdx:_0x38a4c2}=_0x13012c;let _0x4b074e,_0x92ae1a;try{[_0x4b074e,_0x92ae1a]=await Promise[_0x3fb868(0x32e)]([_0x38a4c2[_0x3fb868(0x2a2)][_0x3fb868(0x1d4)](_0x3f6a73),_0x38a4c2[_0x3fb868(0x2a2)]['tasks'](_0x3f6a73,![])]);}catch(_0x49b8d0){console[_0x3fb868(0x290)](a38_0x123249[_0x3fb868(0x1d1)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x505a3c['verbose']&&console['error'](_0x49b8d0);throw _0x49b8d0;}if(_0x505a3c['json']||_0x505a3c[_0x3fb868(0x200)]){const _0x46740a=this[_0x3fb868(0x28d)](_0x4b074e,_0x92ae1a);await handleSDKOutput([_0x46740a],_0x505a3c);return;}const _0x209f18=_0x38a4c2[_0x3fb868(0x212)][_0x3fb868(0x1ca)],_0x47ae7d=this['renderTimeline'](_0x4b074e,_0x92ae1a,_0x209f18);console[_0x3fb868(0x24c)](_0x47ae7d);}async[a38_0x11e0cd(0x2f8)](_0x501fda,_0x24a4e9){const _0x489ca0=a38_0x11e0cd,{tdx:_0x4b50da}=_0x501fda,_0x3d41ea=TIMELINE_CONFIG[_0x489ca0(0x253)],_0x53691a=TIMELINE_CONFIG[_0x489ca0(0x32b)];let _0x1fadbf=0x0;while(_0x1fadbf<_0x53691a){process[_0x489ca0(0x2ab)][_0x489ca0(0x209)]&&process[_0x489ca0(0x2ab)][_0x489ca0(0x1f4)]('\x1bc');let _0xa93bc9,_0x4e5cc8;try{[_0xa93bc9,_0x4e5cc8]=await Promise['all']([_0x4b50da[_0x489ca0(0x2a2)][_0x489ca0(0x1d4)](_0x24a4e9),_0x4b50da[_0x489ca0(0x2a2)]['tasks'](_0x24a4e9,![])]);}catch(_0x25cca2){console[_0x489ca0(0x290)](a38_0x123249[_0x489ca0(0x1d1)]('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x1fadbf>0x0&&console[_0x489ca0(0x290)](a38_0x123249['dim'](_0x489ca0(0x336)+_0x1fadbf));throw _0x25cca2;}const _0x2c08df=_0x4b50da[_0x489ca0(0x212)][_0x489ca0(0x1ca)],_0x10591b=this[_0x489ca0(0x1e9)](_0xa93bc9,_0x4e5cc8,_0x2c08df);console[_0x489ca0(0x24c)](_0x10591b);const _0x2e2819=_0xa93bc9['done']&&_0x4e5cc8[_0x489ca0(0x288)](_0x2b4119=>_0x2b4119[_0x489ca0(0x320)]!=='running'&&_0x2b4119[_0x489ca0(0x320)]!==_0x489ca0(0x1dc));if(_0x2e2819){console[_0x489ca0(0x290)](a38_0x123249[_0x489ca0(0x340)]('\x0a✔\x20Attempt\x20complete'));break;}console[_0x489ca0(0x290)](a38_0x123249[_0x489ca0(0x2ba)]('\x0aPolling...\x20('+_0x1fadbf*0x2+_0x489ca0(0x2b8))),await new Promise(_0x2f4e87=>setTimeout(_0x2f4e87,_0x3d41ea)),_0x1fadbf++;}_0x1fadbf>=_0x53691a&&console[_0x489ca0(0x290)](a38_0x123249[_0x489ca0(0x2e2)](_0x489ca0(0x345)));}[a38_0x11e0cd(0x1e9)](_0x3e8200,_0x5602ba,_0x2306ee){const _0xddb7fa=a38_0x11e0cd,_0xb28ce6=[],_0x578b9c=TIMELINE_CONFIG[_0xddb7fa(0x299)],_0x3a26ae=0x5,_0x2b2e32=process[_0xddb7fa(0x2ab)][_0xddb7fa(0x352)]||0x78,_0x11d852=_0x2b2e32-_0x578b9c-_0x3a26ae,_0x7342b1=Math[_0xddb7fa(0x258)](TIMELINE_CONFIG[_0xddb7fa(0x2b9)],Math['min'](_0x11d852,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x592b01=new Date(_0x3e8200[_0xddb7fa(0x1e4)])[_0xddb7fa(0x2d5)](),_0x4a7607=_0x3e8200[_0xddb7fa(0x23f)]?new Date(_0x3e8200['finishedAt'])['getTime']():Date[_0xddb7fa(0x30f)](),_0x343ebd={'start':_0x592b01,'end':_0x4a7607,'duration':_0x4a7607-_0x592b01},_0x26acef=new Map(),_0x267ddf=[];for(const _0x472c34 of _0x5602ba){if(_0x472c34[_0xddb7fa(0x29d)]){const _0x267a87=new Date(_0x472c34[_0xddb7fa(0x29d)])['getTime'](),_0x5cec46=_0x472c34[_0xddb7fa(0x2a1)]?new Date(_0x472c34[_0xddb7fa(0x2a1)])[_0xddb7fa(0x2d5)]():Date['now'](),_0x21d97a={'start':_0x267a87,'end':_0x5cec46,'duration':_0x5cec46-_0x267a87};_0x26acef[_0xddb7fa(0x27f)](_0x472c34['id'],_0x21d97a),_0x267ddf['push']({'name':_0x472c34[_0xddb7fa(0x1c6)],'state':_0x472c34['state']||'unknown','window':_0x21d97a});}else _0x267ddf[_0xddb7fa(0x1ba)]({'name':_0x472c34['fullName'],'state':_0x472c34['state']||_0xddb7fa(0x1dc),'window':undefined});}_0x267ddf[_0xddb7fa(0x2da)]((_0x1a86dc,_0x50e5ef)=>{const _0x478feb=_0xddb7fa;if(!_0x1a86dc[_0x478feb(0x23e)])return 0x1;if(!_0x50e5ef[_0x478feb(0x23e)])return-0x1;return _0x1a86dc[_0x478feb(0x23e)]['start']-_0x50e5ef['window'][_0x478feb(0x2a5)];});const _0x45cbe5=_0x267ddf[_0xddb7fa(0x279)],_0x20d93d=_0x45cbe5>TIMELINE_CONFIG[_0xddb7fa(0x2eb)];_0x20d93d&&_0x267ddf[_0xddb7fa(0x2af)](TIMELINE_CONFIG[_0xddb7fa(0x2eb)]);const _0x5cc551=calculateTimeScale(_0x343ebd,_0x7342b1),_0x1ea058=_0x3e8200['done']?_0x3e8200[_0xddb7fa(0x309)]?a38_0x123249[_0xddb7fa(0x340)]('success'):a38_0x123249['red'](_0xddb7fa(0x290)):a38_0x123249[_0xddb7fa(0x20e)](_0xddb7fa(0x2b7)),_0x21f7e5=_0x3e8200[_0xddb7fa(0x238)]?.['id'],_0x2094c9=_0x3e8200['sessionId'];let _0x31adee;if(_0x21f7e5&&_0x2094c9){const _0x46738d=getWorkflowAttemptUrl(_0x2306ee,_0x21f7e5,_0x2094c9,_0x3e8200['id']);_0x31adee=hyperlink(a38_0x123249[_0xddb7fa(0x2ba)](_0x3e8200['id']),_0x46738d);}else _0x31adee=a38_0x123249[_0xddb7fa(0x2ba)](_0x3e8200['id']);_0xb28ce6[_0xddb7fa(0x1ba)](_0xddb7fa(0x20d)+_0x31adee+_0xddb7fa(0x24a)+_0x1ea058+_0xddb7fa(0x24a)+formatElapsed(_0x343ebd[_0xddb7fa(0x339)]));if(_0x267ddf['length']>0x0){const _0xd80446=renderTimeAxis(_0x5cc551,_0x7342b1),_0x54615a=new Date(_0x343ebd[_0xddb7fa(0x2a5)]),_0x125fb1=formatDate(_0x54615a),_0x13a661=TIMELINE_CONFIG[_0xddb7fa(0x267)]+TIMELINE_CONFIG[_0xddb7fa(0x2be)]+_0x578b9c,_0x41eb7c=_0x125fb1[_0xddb7fa(0x1c3)](_0x13a661),_0x5dd640=a38_0x123249[_0xddb7fa(0x2ba)](_0x41eb7c);_0xb28ce6[_0xddb7fa(0x1ba)](_0x5dd640+'\x20'+_0xd80446);for(const _0x2b2a4a of _0x267ddf){_0xb28ce6['push'](renderTaskRow(_0x2b2a4a,_0x5cc551,_0x7342b1,_0x578b9c));}const _0x4fd347=calculateStats(_0x267ddf);_0xb28ce6[_0xddb7fa(0x1ba)](formatStats(_0x4fd347)),_0x20d93d&&_0xb28ce6[_0xddb7fa(0x1ba)](a38_0x123249[_0xddb7fa(0x2e2)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0xddb7fa(0x2eb)]+_0xddb7fa(0x286)+_0x45cbe5+_0xddb7fa(0x25b))),_0xb28ce6['push'](''),_0xb28ce6[_0xddb7fa(0x1ba)](a38_0x123249[_0xddb7fa(0x2ba)](_0xddb7fa(0x31f))+(_0xddb7fa(0x33e)+_0x3e8200['id']+'\x20logs')+a38_0x123249[_0xddb7fa(0x2ba)](_0xddb7fa(0x241)));}else _0xb28ce6[_0xddb7fa(0x1ba)](_0xddb7fa(0x2fd));return _0xb28ce6[_0xddb7fa(0x2dc)]('\x0a');}[a38_0x11e0cd(0x28d)](_0x206ed3,_0x1b1ced){const _0x27bce0=a38_0x11e0cd,_0x22f389=new Date(_0x206ed3[_0x27bce0(0x1e4)])[_0x27bce0(0x2d5)](),_0x2f04a4=_0x206ed3['finishedAt']?new Date(_0x206ed3[_0x27bce0(0x23f)])['getTime']():Date[_0x27bce0(0x30f)](),_0x5ddc9d=_0x2f04a4-_0x22f389,_0x1dc459=[];for(const _0x45a14a of _0x1b1ced){if(_0x45a14a[_0x27bce0(0x29d)]){const _0x3ba6d8=new Date(_0x45a14a['startedAt'])[_0x27bce0(0x2d5)](),_0x24bc3b=_0x45a14a[_0x27bce0(0x2a1)]?new Date(_0x45a14a[_0x27bce0(0x2a1)])[_0x27bce0(0x2d5)]():Date[_0x27bce0(0x30f)]();_0x1dc459['push']({'name':_0x45a14a['fullName'],'state':_0x45a14a[_0x27bce0(0x320)]||_0x27bce0(0x2c2),'window':{'start':_0x3ba6d8,'end':_0x24bc3b,'duration':_0x24bc3b-_0x3ba6d8}});}else _0x1dc459['push']({'name':_0x45a14a[_0x27bce0(0x1c6)],'state':_0x45a14a[_0x27bce0(0x320)]||_0x27bce0(0x1dc),'window':undefined});}const _0x598462=calculateStats(_0x1dc459);return{'attempt':{'id':_0x206ed3['id'],'status':_0x206ed3['done']?_0x206ed3[_0x27bce0(0x309)]?_0x27bce0(0x309):_0x27bce0(0x290):_0x27bce0(0x2b7),'createdAt':_0x206ed3[_0x27bce0(0x1e4)],'finishedAt':_0x206ed3['finishedAt'],'duration_ms':_0x5ddc9d},'tasks':_0x1dc459[_0x27bce0(0x2a3)](_0x1fc054=>({'name':_0x1fc054['name'],'state':_0x1fc054[_0x27bce0(0x320)],'startedAt':_0x1fc054[_0x27bce0(0x23e)]?new Date(_0x1fc054[_0x27bce0(0x23e)][_0x27bce0(0x2a5)])[_0x27bce0(0x306)]():null,'updatedAt':_0x1fc054['window']?new Date(_0x1fc054[_0x27bce0(0x23e)][_0x27bce0(0x2b6)])[_0x27bce0(0x306)]():null,'duration_ms':_0x1fc054['window']?.[_0x27bce0(0x339)]||null})),'stats':_0x598462};}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x13f553,_0x40dbc2){const _0xea3308=a39_0x3ee2,_0x2dd872=_0x13f553();while(!![]){try{const _0x4b6fc5=parseInt(_0xea3308(0x181))/0x1+-parseInt(_0xea3308(0x17d))/0x2+-parseInt(_0xea3308(0x185))/0x3+-parseInt(_0xea3308(0x17e))/0x4*(-parseInt(_0xea3308(0x177))/0x5)+parseInt(_0xea3308(0x179))/0x6*(-parseInt(_0xea3308(0x17c))/0x7)+parseInt(_0xea3308(0x17b))/0x8+-parseInt(_0xea3308(0x186))/0x9*(parseInt(_0xea3308(0x17a))/0xa);if(_0x4b6fc5===_0x40dbc2)break;else _0x2dd872['push'](_0x2dd872['shift']());}catch(_0x5c0776){_0x2dd872['push'](_0x2dd872['shift']());}}}(a39_0xaf1f,0x2320e));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 _0x3d93fd=a39_0x3ee2,_0x4a0689=getVersion(),_0x44af7a=platform(),_0x53a900=process[_0x3d93fd(0x183)]['replace']('v','');return _0x3d93fd(0x17f)+_0x4a0689+'\x20('+_0x44af7a+_0x3d93fd(0x176)+_0x53a900+')';}export function getAuthHeaders(_0x4caac5,_0x14523e){const _0x18644f=a39_0x3ee2,_0x2d3b69=getVersion(),_0x288632={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x2d3b69};return _0x14523e&&(_0x288632['Authorization']=_0x18644f(0x184)+_0x14523e),_0x288632;}export function toHeaderRecord(_0x4979b3){const _0x850f91=a39_0x3ee2,_0x38897c={};for(const [_0x1016c8,_0x28db0f]of Object[_0x850f91(0x180)](_0x4979b3)){_0x28db0f!==undefined&&(_0x38897c[_0x1016c8]=_0x28db0f);}return _0x38897c;}function a39_0xaf1f(){const _0x4b96aa=['39486anqmPF','10cqvBJZ','2301808MaDFnP','21HnyxXi','87704LSxeVB','11356uJIhpT','tdx/','entries','197265WIHCNE','length','version','TD1\x20','515469AacHOy','1589958VuyQod',';\x20node/','125DiwlZl','Authorization'];a39_0xaf1f=function(){return _0x4b96aa;};return a39_0xaf1f();}function a39_0x3ee2(_0x3015a6,_0xf937af){_0x3015a6=_0x3015a6-0x176;const _0xaf1fe3=a39_0xaf1f();let _0x3ee24d=_0xaf1fe3[_0x3015a6];return _0x3ee24d;}export function getTrinoHeaders(_0x257803,_0x36344c){const _0x1e03dc=a39_0x3ee2,_0x364ea6=getAuthHeaders(_0x257803,_0x36344c),_0x2cce57=toHeaderRecord(_0x364ea6);return delete _0x2cce57[_0x1e03dc(0x178)],_0x36344c&&(_0x2cce57['X-Trino-User']=_0x36344c),_0x2cce57;}export function hasAPIKey(_0x55e2e6){const _0x24445d=a39_0x3ee2,_0x4c159a=getAPIKey(_0x55e2e6);return _0x4c159a!==undefined&&_0x4c159a[_0x24445d(0x182)]>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(_0x347dfe,_0x3e41f8){const _0x3ca41d=a40_0x3358,_0x417dc7=_0x347dfe();while(!![]){try{const _0x2fd88e=parseInt(_0x3ca41d(0x1f8))/0x1*(parseInt(_0x3ca41d(0x1c6))/0x2)+parseInt(_0x3ca41d(0x1db))/0x3*(parseInt(_0x3ca41d(0x1fe))/0x4)+parseInt(_0x3ca41d(0x1dd))/0x5*(parseInt(_0x3ca41d(0x1e4))/0x6)+-parseInt(_0x3ca41d(0x1ff))/0x7*(parseInt(_0x3ca41d(0x1e6))/0x8)+-parseInt(_0x3ca41d(0x1cd))/0x9*(parseInt(_0x3ca41d(0x1d1))/0xa)+-parseInt(_0x3ca41d(0x1c1))/0xb+parseInt(_0x3ca41d(0x1f4))/0xc;if(_0x2fd88e===_0x3e41f8)break;else _0x417dc7['push'](_0x417dc7['shift']());}catch(_0x4d0194){_0x417dc7['push'](_0x417dc7['shift']());}}}(a40_0x1433,0xa60fe));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';function a40_0x1433(){const _0x5a390b=['[Object]','tsv','forEach','cyan','2876tfdceU','1362634LGoaPk','max','jsonl','filter','noColor','rule','debug','format','[logs]','log','inherit','6322987DkQAbN','blue','number','end','keys','2404hAmdWG','Results\x20saved\x20to\x20','spawn','map','write','-FXRSn','stdout','846caNgrv','magenta','push','─┬─','109660aXYdHT','entries','error','params','bold','stderr','[error]','object','resolve','isInteger','2940vvoXtV','cmdout','5RXKeLq','padEnd','limit','yellow','stringify','pipe','double','7897380yLyoWd','string','32zDWGbe','list','varchar','[rule]','trim','json','[query]','color','FINISHED','red','output','No\x20data','repeat','split','11499204tqfjHB','length','table','stdin','71VSYdXG','query'];a40_0x1433=function(){return _0x5a390b;};return a40_0x1433();}import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a40_0x964203 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x7b1801){const _0x47eb3b=a40_0x3358;return _0x7b1801[_0x47eb3b(0x206)]===_0x47eb3b(0x1eb)||_0x7b1801[_0x47eb3b(0x206)]===_0x47eb3b(0x201)||_0x7b1801[_0x47eb3b(0x206)]==='tsv'||_0x7b1801['format']===_0x47eb3b(0x1f6)||_0x7b1801[_0x47eb3b(0x1eb)]===!![]||_0x7b1801[_0x47eb3b(0x201)]===!![]||_0x7b1801[_0x47eb3b(0x1fb)]===!![]||_0x7b1801[_0x47eb3b(0x1f6)]===!![];}export function parseOutputOptions(_0x2ca8d4){const _0x1da80a=a40_0x3358;return{'format':_0x2ca8d4[_0x1da80a(0x206)]||_0x1da80a(0x1f6),'output':_0x2ca8d4[_0x1da80a(0x1f0)]||'','limit':_0x2ca8d4[_0x1da80a(0x1df)],'color':_0x2ca8d4[_0x1da80a(0x1ed)],'noColor':_0x2ca8d4[_0x1da80a(0x203)]};}function convertSDKResultToQueryResult(_0x146946){const _0x500a15=a40_0x3358,_0x1ccba1=[];if(_0x146946['length']>0x0){const _0x39c172=_0x146946[0x0];for(const [_0x2153c2,_0x534514]of Object[_0x500a15(0x1d2)](_0x39c172)){let _0x31d31b=_0x500a15(0x1e8);if(typeof _0x534514===_0x500a15(0x1c3))_0x31d31b=Number[_0x500a15(0x1da)](_0x534514)?'bigint':_0x500a15(0x1e3);else{if(typeof _0x534514==='boolean')_0x31d31b='boolean';else _0x534514===null&&(_0x31d31b=_0x500a15(0x1e8));}_0x1ccba1[_0x500a15(0x1cf)]({'name':_0x2153c2,'type':_0x31d31b});}}return{'queryId':'sdk-result','columns':_0x1ccba1,'data':_0x146946,'stats':{'state':_0x500a15(0x1ee),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x146946['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x332daa,_0x4397b3){const _0x45b66a=convertSDKResultToQueryResult(_0x332daa);return formatQueryOutput(_0x45b66a,_0x4397b3);}export async function formatQueryOutput(_0x455073,_0x39fb94){const _0x450068=a40_0x3358,{format:_0x53e623,limit:_0x339c16,output:_0x32a093,color:_0xcce3ab,noColor:_0x442599}=_0x39fb94,_0x55daad=Boolean(_0x32a093)&&!_0xcce3ab,_0x8f5a47={'color':_0xcce3ab,'noColor':_0x442599||_0x55daad};if(_0x53e623==='table'){const _0x1c828a=shouldUseLess(_0x53e623,_0x32a093);return formatAsTable(_0x455073,_0x339c16,_0x1c828a,_0x8f5a47);}else{if(_0x53e623===_0x450068(0x1eb))return formatAsJSON(_0x455073,_0x8f5a47);else return _0x53e623===_0x450068(0x201)?formatAsJSONL(_0x455073,_0x8f5a47):formatQueryResult(_0x455073,_0x53e623);}}function a40_0x3358(_0x5f4e0d,_0x433176){_0x5f4e0d=_0x5f4e0d-0x1bf;const _0x14339b=a40_0x1433();let _0x335860=_0x14339b[_0x5f4e0d];return _0x335860;}function shouldUseLess(_0x52610e,_0x1f8b1a){const _0xe4b420=a40_0x3358;return(_0x52610e===_0xe4b420(0x1f6)||_0x52610e===_0xe4b420(0x1e7))&&process[_0xe4b420(0x1cc)]['isTTY']&&!_0x1f8b1a;}export function resolveOutputOptions(_0x1643df){const _0x129991=a40_0x3358,_0x445431=resolveOutputFormat(_0x1643df[_0x129991(0x206)],_0x1643df['output'],_0x129991(0x1f6));let _0x5b713d=typeof _0x1643df[_0x129991(0x1df)]===_0x129991(0x1c3)?_0x1643df[_0x129991(0x1df)]:parseInt(_0x1643df[_0x129991(0x1df)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x5b6c6f=_0x1643df[_0x129991(0x1f0)]||'';return shouldUseLess(_0x445431,_0x5b6c6f)&&(_0x5b713d=Infinity),{'format':_0x445431,'output':_0x5b6c6f,'limit':_0x5b713d,'color':_0x1643df[_0x129991(0x1ed)],'noColor':_0x1643df[_0x129991(0x203)]};}export function writeOutput(_0x19bc8b,_0x114fc7,_0x2d271f){const _0x13a0be=a40_0x3358;return _0x114fc7?(writeFileSync(_0x114fc7,_0x19bc8b),console[_0x13a0be(0x1d3)](_0x13a0be(0x1c7)+_0x114fc7),Promise[_0x13a0be(0x1d9)]()):shouldUseLess(_0x2d271f||'','')?new Promise(_0x441991=>{const _0x361749=_0x13a0be,_0x1241c5=spawn('less',[_0x361749(0x1cb)],{'stdio':[_0x361749(0x1e2),_0x361749(0x1c0),_0x361749(0x1c0)]});let _0x466953=![];_0x1241c5['on'](_0x361749(0x1d3),()=>{const _0x3e8cdb=_0x361749;!_0x466953&&(_0x466953=!![],console[_0x3e8cdb(0x1bf)](_0x19bc8b),_0x441991());}),_0x1241c5['on']('close',()=>{!_0x466953&&(_0x466953=!![],_0x441991());}),_0x1241c5['on'](_0x361749(0x1c8),()=>{const _0x516161=_0x361749;!_0x466953&&_0x1241c5[_0x516161(0x1f7)]&&(_0x1241c5[_0x516161(0x1f7)]['on'](_0x516161(0x1d3),()=>{}),_0x1241c5[_0x516161(0x1f7)][_0x516161(0x1ca)](_0x19bc8b),_0x1241c5[_0x516161(0x1f7)][_0x516161(0x1c4)]());}),!_0x1241c5[_0x361749(0x1f7)]&&(!_0x466953&&(_0x466953=!![],console[_0x361749(0x1bf)](_0x19bc8b),_0x441991()));}):(console[_0x13a0be(0x1bf)](_0x19bc8b),Promise[_0x13a0be(0x1d9)]());}export async function handleSDKOutput(_0x26a263,_0xdb4523){const _0x4e6a73=a40_0x3358,_0x253c03=resolveOutputOptions(_0xdb4523),_0x30d5a1=await formatSDKOutput(_0x26a263,_0x253c03);await writeOutput(_0x30d5a1,_0x253c03[_0x4e6a73(0x1f0)]||undefined,_0x253c03[_0x4e6a73(0x206)]);}export async function handleQueryOutput(_0x1fa65e,_0x2db3da){const _0x164d6f=a40_0x3358,_0x3d8af1=resolveOutputOptions(_0x2db3da),_0x2c7505=await formatQueryOutput(_0x1fa65e,_0x3d8af1);await writeOutput(_0x2c7505,_0x3d8af1['output']||undefined,_0x3d8af1[_0x164d6f(0x206)]);}async function formatSingleObject(_0x2056ae,_0x154dae){const _0x3fb5f6=a40_0x3358,{format:_0x9d6286,color:_0x29152a,noColor:_0x376fd4}=_0x154dae,_0x58491e={'color':_0x29152a,'noColor':_0x376fd4};if(_0x9d6286==='json'){if(shouldUseColor(_0x58491e))return colorizeJSON(_0x2056ae,_0x58491e);return JSON[_0x3fb5f6(0x1e1)](_0x2056ae,null,0x2);}else{if(_0x9d6286===_0x3fb5f6(0x201)){if(shouldUseColor(_0x58491e))return colorizeJSONCompact(_0x2056ae,_0x58491e);return JSON[_0x3fb5f6(0x1e1)](_0x2056ae);}else{if(_0x9d6286===_0x3fb5f6(0x1fb))return Object[_0x3fb5f6(0x1d2)](_0x2056ae)[_0x3fb5f6(0x1c9)](([_0xe7a6de,_0xd2a17])=>_0xe7a6de+'\x09'+_0xd2a17)['join']('\x0a');else{const _0x414396=Object[_0x3fb5f6(0x1d2)](_0x2056ae);if(_0x414396['length']===0x0)return _0x3fb5f6(0x1f1);const _0x3e72f3=_0x2056ae[_0x3fb5f6(0x205)],_0x8d927a=_0x2056ae[_0x3fb5f6(0x1f9)],_0xcf07a8=_0x2056ae['params'],_0x5a50b6=_0x2056ae[_0x3fb5f6(0x204)],_0x1cfc95=_0x8d927a?typeof _0x8d927a===_0x3fb5f6(0x1e5)?_0x8d927a:JSON[_0x3fb5f6(0x1e1)](_0x8d927a,null,0x2):undefined,_0x4de2a0=_0xcf07a8&&Object[_0x3fb5f6(0x1c5)](_0xcf07a8)[_0x3fb5f6(0x1f5)]>0x0?JSON[_0x3fb5f6(0x1e1)](_0xcf07a8,null,0x2):undefined,_0x2f3aee=_0x5a50b6&&Object[_0x3fb5f6(0x1c5)](_0x5a50b6)[_0x3fb5f6(0x1f5)]>0x0?JSON[_0x3fb5f6(0x1e1)](_0x5a50b6,null,0x2):undefined,_0xddeef7=_0x414396[_0x3fb5f6(0x202)](([_0x573e2b])=>_0x573e2b!==_0x3fb5f6(0x205)&&_0x573e2b!==_0x3fb5f6(0x1f9)&&_0x573e2b!==_0x3fb5f6(0x1d4)&&_0x573e2b!==_0x3fb5f6(0x204)),_0x1db12e=Math['max'](..._0xddeef7[_0x3fb5f6(0x1c9)](([_0x5b781f])=>_0x5b781f[_0x3fb5f6(0x1f5)])),_0x39e9cb=Math[_0x3fb5f6(0x200)](..._0xddeef7[_0x3fb5f6(0x1c9)](([,_0x8811b5])=>{const _0x2e4ae7=_0x3fb5f6;try{const _0xfd5993=_0x8811b5===null||_0x8811b5===undefined?'':typeof _0x8811b5===_0x2e4ae7(0x1d8)?JSON[_0x2e4ae7(0x1e1)](_0x8811b5):String(_0x8811b5),_0x5c2522=_0xfd5993['split']('\x0a');return Math[_0x2e4ae7(0x200)](..._0x5c2522['map'](_0x26fd50=>_0x26fd50['length']),0x0);}catch{return 0x0;}}),0x14),_0x45f95a=[];_0x45f95a[_0x3fb5f6(0x1cf)](colorBorder('┌─'+'─'[_0x3fb5f6(0x1f2)](_0x1db12e)+_0x3fb5f6(0x1d0)+'─'[_0x3fb5f6(0x1f2)](_0x39e9cb)+'─┐',_0x58491e)),_0xddeef7[_0x3fb5f6(0x1fc)](([_0x2a1c3e,_0x5133ef])=>{const _0x15e3ab=_0x3fb5f6;let _0x59c268;try{_0x59c268=_0x5133ef===null||_0x5133ef===undefined?'':typeof _0x5133ef==='object'?JSON[_0x15e3ab(0x1e1)](_0x5133ef):String(_0x5133ef);}catch{_0x59c268=_0x15e3ab(0x1fa);}const _0x4c19e5=_0x2a1c3e[_0x15e3ab(0x1de)](_0x1db12e),_0x5a7e83=_0x59c268[_0x15e3ab(0x1f3)]('\x0a');_0x5a7e83[_0x15e3ab(0x1fc)]((_0x4babca,_0x3d4436)=>{const _0x488faa=_0x15e3ab,_0x5d0855=colorBorder('│',_0x58491e);_0x3d4436===0x0?_0x45f95a['push'](_0x5d0855+'\x20'+_0x4c19e5+'\x20'+_0x5d0855+'\x20'+_0x4babca['padEnd'](_0x39e9cb)+'\x20'+_0x5d0855):_0x45f95a[_0x488faa(0x1cf)](_0x5d0855+'\x20'+'\x20'[_0x488faa(0x1f2)](_0x1db12e)+'\x20'+_0x5d0855+'\x20'+_0x4babca[_0x488faa(0x1de)](_0x39e9cb)+'\x20'+_0x5d0855);});}),_0x45f95a[_0x3fb5f6(0x1cf)](colorBorder('└─'+'─'['repeat'](_0x1db12e)+'─┴─'+'─'['repeat'](_0x39e9cb)+'─┘',_0x58491e));_0x1cfc95&&(_0x45f95a[_0x3fb5f6(0x1cf)](''),_0x45f95a[_0x3fb5f6(0x1cf)](String(a40_0x964203[_0x3fb5f6(0x1e0)][_0x3fb5f6(0x1d5)](_0x3fb5f6(0x1ec)))),_0x45f95a[_0x3fb5f6(0x1cf)](_0x1cfc95));_0x4de2a0&&(_0x45f95a[_0x3fb5f6(0x1cf)](''),_0x45f95a['push'](String(a40_0x964203[_0x3fb5f6(0x1c2)][_0x3fb5f6(0x1d5)]('[params]'))),_0x45f95a[_0x3fb5f6(0x1cf)](_0x4de2a0));_0x2f3aee&&(_0x45f95a[_0x3fb5f6(0x1cf)](''),_0x45f95a[_0x3fb5f6(0x1cf)](String(a40_0x964203[_0x3fb5f6(0x1ce)]['bold'](_0x3fb5f6(0x1e9)))),_0x45f95a[_0x3fb5f6(0x1cf)](_0x2f3aee));if(_0x3e72f3){if(_0x3e72f3[_0x3fb5f6(0x1d6)]){_0x45f95a[_0x3fb5f6(0x1cf)](''),_0x45f95a[_0x3fb5f6(0x1cf)](String(a40_0x964203[_0x3fb5f6(0x1ef)]['bold'](_0x3fb5f6(0x1d7))));const _0x38af68=_0x3e72f3[_0x3fb5f6(0x1d6)][_0x3fb5f6(0x1f3)]('\x0a');_0x38af68[_0x3fb5f6(0x1fc)](_0x43729e=>{const _0x2c0812=_0x3fb5f6;_0x43729e[_0x2c0812(0x1ea)]()&&_0x45f95a[_0x2c0812(0x1cf)](_0x43729e);});}if(_0x3e72f3[_0x3fb5f6(0x1dc)]){_0x45f95a[_0x3fb5f6(0x1cf)](''),_0x45f95a[_0x3fb5f6(0x1cf)](String(a40_0x964203[_0x3fb5f6(0x1fd)][_0x3fb5f6(0x1d5)](_0x3fb5f6(0x207))));const _0x11847e=_0x3e72f3[_0x3fb5f6(0x1dc)][_0x3fb5f6(0x1f3)]('\x0a');_0x11847e[_0x3fb5f6(0x1fc)](_0x5d9d32=>{const _0x3369eb=_0x3fb5f6;_0x5d9d32['trim']()&&_0x45f95a[_0x3369eb(0x1cf)](_0x5d9d32);});}}return _0x45f95a['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x11c84b,_0x1c914b){const _0x3029fb=a40_0x3358;if(_0x1c914b['format']===_0x3029fb(0x1f6)){await handleSDKOutput([_0x11c84b],_0x1c914b);return;}const _0x50c28a=resolveOutputOptions(_0x1c914b),_0x2ff088=await formatSingleObject(_0x11c84b,_0x50c28a);await writeOutput(_0x2ff088,_0x50c28a[_0x3029fb(0x1f0)]||undefined,_0x50c28a[_0x3029fb(0x206)]);}
|