@treasuredata/tdx 0.26.6 → 0.26.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.d.ts.map +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/job-command.js.map +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.d.ts +14 -37
- package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/agent-yaml.js.map +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.d.ts +82 -0
- package/dist/sdk/agent/tool-target-registry.d.ts.map +1 -0
- package/dist/sdk/agent/tool-target-registry.js +1 -0
- package/dist/sdk/agent/tool-target-registry.js.map +1 -0
- package/dist/sdk/agent/types/agent-def.d.ts +3 -2
- package/dist/sdk/agent/types/agent-def.d.ts.map +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.d.ts +20 -0
- package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js.map +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.d.ts +2 -2
- package/dist/sdk/client/td-api-client.d.ts.map +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/td-api-client.js.map +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.d.ts +1 -1
- package/dist/sdk/job.d.ts.map +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/job.js.map +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.d.ts.map +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/index.js.map +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a42_0x4e63f2=a42_0x201d;(function(_0x430084,_0x518a3d){const _0x2ff94c=a42_0x201d,_0x47ba27=_0x430084();while(!![]){try{const _0xc8eb3=-parseInt(_0x2ff94c(0x169))/0x1+parseInt(_0x2ff94c(0x109))/0x2*(parseInt(_0x2ff94c(0x171))/0x3)+-parseInt(_0x2ff94c(0x118))/0x4*(-parseInt(_0x2ff94c(0x214))/0x5)+-parseInt(_0x2ff94c(0xd8))/0x6*(-parseInt(_0x2ff94c(0xf1))/0x7)+-parseInt(_0x2ff94c(0xc5))/0x8*(parseInt(_0x2ff94c(0x146))/0x9)+parseInt(_0x2ff94c(0x1bf))/0xa+parseInt(_0x2ff94c(0x133))/0xb*(-parseInt(_0x2ff94c(0x16b))/0xc);if(_0xc8eb3===_0x518a3d)break;else _0x47ba27['push'](_0x47ba27['shift']());}catch(_0x1ef4b8){_0x47ba27['push'](_0x47ba27['shift']());}}}(a42_0x2b0f,0x37607));import a42_0x438ef3 from'chalk';import{existsSync}from'fs';import a42_0x28ae41 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a42_0x30fad8 from'prompts';function getAttemptStatusDisplay(_0x196cb8){const _0xb1cd91=a42_0x201d;if(!_0x196cb8)return{'icon':'⏳','text':''};const {done:_0x3e8349,success:_0x46dc7c,cancelRequested:_0x27582a}=_0x196cb8;if(!_0x3e8349)return _0x27582a?{'icon':'🛑','text':a42_0x438ef3[_0xb1cd91(0x1ce)](_0xb1cd91(0x167))}:{'icon':'🔄','text':a42_0x438ef3[_0xb1cd91(0x18c)](_0xb1cd91(0x14a))};if(_0x46dc7c)return{'icon':'✅','text':a42_0x438ef3[_0xb1cd91(0x248)](_0xb1cd91(0x154))};return{'icon':'❌','text':a42_0x438ef3[_0xb1cd91(0x1b1)]('error')};}export class WorkflowBaseCommand extends BaseCommand{[a42_0x4e63f2(0xf9)](_0x480e29,_0x56cbf5,_0x26141f=0x0){const _0x4ebbb1=a42_0x4e63f2;return _0x480e29[_0x26141f]||_0x56cbf5[_0x4ebbb1(0x1ea)];}[a42_0x4e63f2(0x1de)](_0x38278d,_0x161d87,_0x35f0e5=0x0){const _0x11e08f=a42_0x4e63f2,_0x1c2c0c=this[_0x11e08f(0xf9)](_0x38278d,_0x161d87,_0x35f0e5);if(!_0x1c2c0c)return console[_0x11e08f(0x197)](a42_0x438ef3[_0x11e08f(0x1b1)]('Error:'),_0x11e08f(0x1f4)),console[_0x11e08f(0x197)](a42_0x438ef3[_0x11e08f(0x22f)](_0x11e08f(0x210))),null;return _0x1c2c0c;}[a42_0x4e63f2(0x1e3)](_0x3c31df,_0x5e96f9){const _0x278c2b=a42_0x4e63f2;if(_0x3c31df[0x0]){const _0x3450c1=_0x3c31df[0x0][_0x278c2b(0x1d6)]('.');if(_0x3450c1[_0x278c2b(0x220)]===0x1)return{'projectName':_0x3450c1[0x0],'workflowName':undefined};else return _0x3450c1['length']===0x2?{'projectName':_0x3450c1[0x0],'workflowName':_0x3450c1[0x1]}:(console['error'](a42_0x438ef3['red'](_0x278c2b(0x1dc)),_0x278c2b(0x119)),null);}return{'projectName':_0x5e96f9[_0x278c2b(0x1ea)],'workflowName':undefined};}[a42_0x4e63f2(0x17b)](_0x1fcde1,_0x4b2474,_0x4abe89=0x0){const _0x42ebb4=a42_0x4e63f2;if(_0x1fcde1[_0x4abe89])return _0x1fcde1[_0x4abe89];if(_0x4b2474[_0x42ebb4(0x1ea)]){const _0x33c05c=a42_0x28ae41[_0x42ebb4(0x1a3)](process[_0x42ebb4(0xda)](),_0x42ebb4(0x14d),_0x4b2474[_0x42ebb4(0x1ea)]);if(existsSync(a42_0x28ae41['join'](_0x33c05c,_0x42ebb4(0x110))))return _0x33c05c;}return undefined;}async['showWorkflowConsoleUrl'](_0x476a3f,_0x2d53b5,_0x22d79){const _0x4a5ee0=a42_0x4e63f2;try{const _0x4e425c=await _0x476a3f[_0x4a5ee0(0xeb)][_0x4a5ee0(0x14d)](_0x2d53b5,{'limit':0x1});if(_0x4e425c[_0x4a5ee0(0x220)]>0x0){const _0x50e06c=_0x4e425c[0x0]['id'],_0x1352e0=getWorkflowUrl(_0x22d79,_0x50e06c);console['error'](_0x4a5ee0(0xd4)+a42_0x438ef3[_0x4a5ee0(0x175)](_0x1352e0));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a42_0x4e63f2(0x231)]='workflow:use';[a42_0x4e63f2(0x222)]=a42_0x4e63f2(0x1c5);async[a42_0x4e63f2(0x159)](_0x224432){const _0x1d148b=a42_0x4e63f2,{options:_0x579fbd,args:_0xa472b9,tdx:_0x1d8d04}=_0x224432,_0x2283bb=_0xa472b9[0x0],_0x2ea501=_0x579fbd[_0x1d148b(0x10c)];if(_0x2ea501)return saveSessionContext({'workflow_project':undefined},_0x579fbd[_0x1d148b(0x15f)]),console[_0x1d148b(0x1bb)](a42_0x438ef3[_0x1d148b(0x248)](_0x1d148b(0xc4))),0x0;if(!_0x2283bb)return console['error'](a42_0x438ef3[_0x1d148b(0x1b1)](_0x1d148b(0x1dc)),'Project\x20name\x20is\x20required'),console['error'](a42_0x438ef3['dim']('Usage:\x20tdx\x20wf\x20use\x20<project>')),console['error'](a42_0x438ef3[_0x1d148b(0x22f)](_0x1d148b(0x158))),0x1;const _0x277f7b=await withSpinner(_0x1d148b(0x140)+_0x2283bb+_0x1d148b(0x218),()=>_0x1d8d04[_0x1d148b(0xeb)][_0x1d148b(0x168)](_0x2283bb),{'verbose':_0x579fbd[_0x1d148b(0x245)]}),{name:_0x2718ef}=_0x277f7b[_0x1d148b(0xf3)];return saveSessionContext({'workflow_project':_0x2718ef},_0x579fbd[_0x1d148b(0x15f)]),console[_0x1d148b(0x1bb)](a42_0x438ef3['green'](_0x1d148b(0xd1)+a42_0x438ef3[_0x1d148b(0x175)](_0x2718ef))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a42_0x4e63f2(0x231)]=a42_0x4e63f2(0x14f);[a42_0x4e63f2(0x222)]=a42_0x4e63f2(0x19d);async[a42_0x4e63f2(0x159)](_0x3c9a00){const _0xc2a6c3=a42_0x4e63f2,{options:_0x5c41c6,args:_0x532b1c,tdx:_0x4d6b14}=_0x3c9a00,_0x36ed1c=_0x532b1c[0x0];_0x5c41c6[_0xc2a6c3(0x245)]&&_0x36ed1c&&console[_0xc2a6c3(0x197)](_0xc2a6c3(0x1a1)+_0x36ed1c);const _0x5ec782=await withSpinner(_0xc2a6c3(0x233),()=>_0x4d6b14[_0xc2a6c3(0xeb)][_0xc2a6c3(0x228)](_0x36ed1c,{'limit':_0x5c41c6['limit']}),{'verbose':_0x5c41c6[_0xc2a6c3(0x245)]});let _0x198843=_0x5ec782[_0xc2a6c3(0xf3)];_0x198843[_0xc2a6c3(0x180)]((_0x32bd21,_0x278599)=>_0x32bd21['name'][_0xc2a6c3(0xb6)](_0x278599['name']));const _0x7aec93=_0x5c41c6[_0xc2a6c3(0x239)]||0x64,_0x12edb7=_0x198843['length']>=_0x7aec93?a42_0x438ef3['dim'](_0xc2a6c3(0x211)):'';console['error'](_0xc2a6c3(0x215)+_0x198843[_0xc2a6c3(0x220)]+_0xc2a6c3(0x1f6)+(_0x198843[_0xc2a6c3(0x220)]!==0x1?'s':'')+_0x12edb7);if(_0x5c41c6[_0xc2a6c3(0x1d8)]===_0xc2a6c3(0x23f)||_0x5c41c6[_0xc2a6c3(0x1d8)]===_0xc2a6c3(0x148)||_0x5c41c6['format']===_0xc2a6c3(0x193))await handleSDKOutput(_0x198843,_0x5c41c6);else{if(_0x198843[_0xc2a6c3(0x220)]===0x0)_0x36ed1c?console['log'](_0xc2a6c3(0x217)+_0x36ed1c):console[_0xc2a6c3(0x1bb)](_0xc2a6c3(0x20e));else{const _0x3ddebc=_0x198843[_0xc2a6c3(0x1d7)](_0x2f285e=>{const _0x308aec=_0xc2a6c3,_0x57f810=_0x2f285e['metadata']?.[_0x308aec(0xed)](_0x1af314=>_0x1af314[_0x308aec(0x11f)]==='sys'),_0x36ef7e=_0x57f810?a42_0x438ef3[_0x308aec(0x22f)]('\x20(system)'):'';return _0x308aec(0x111)+_0x2f285e[_0x308aec(0x231)]+_0x36ef7e;});await writeOutput(_0x3ddebc[_0xc2a6c3(0x1a3)]('\x0a'),_0x5c41c6['output'],_0xc2a6c3(0xfe));}}return 0x0;}}function a42_0x201d(_0x21f735,_0x7da8bc){_0x21f735=_0x21f735-0x9e;const _0x2b0ff5=a42_0x2b0f();let _0x201db0=_0x2b0ff5[_0x21f735];return _0x201db0;}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']='workflow:workflows';['description']=a42_0x4e63f2(0x1d3);async['execute'](_0x1fdac2){const _0x1bc5a6=a42_0x4e63f2,{options:_0x40523e,args:_0x273d38,tdx:_0x53ac9e}=_0x1fdac2,_0x42b323=this[_0x1bc5a6(0xf9)](_0x273d38,_0x40523e);_0x40523e['verbose']&&_0x42b323&&console['error'](_0x1bc5a6(0x12e)+_0x42b323);const _0x4a2fd9=await withSpinner(_0x1bc5a6(0xe4),()=>_0x53ac9e[_0x1bc5a6(0xeb)]['workflows'](_0x42b323,{'limit':_0x40523e[_0x1bc5a6(0x239)]}),{'verbose':_0x40523e[_0x1bc5a6(0x245)]});let _0x2ab227=_0x4a2fd9[_0x1bc5a6(0xf3)];_0x2ab227[_0x1bc5a6(0x180)]((_0x1f8f78,_0x5de954)=>{const _0x2ad300=_0x1bc5a6,_0x13782b=_0x1f8f78[_0x2ad300(0x231)][_0x2ad300(0xb6)](_0x5de954['name']);if(_0x13782b!==0x0)return _0x13782b;return(_0x1f8f78[_0x2ad300(0x1a4)]?.[_0x2ad300(0x231)]||'')[_0x2ad300(0xb6)](_0x5de954['project']?.[_0x2ad300(0x231)]||'');});const _0x47a692=_0x40523e[_0x1bc5a6(0x239)]||0x64,_0x3faea2=_0x2ab227[_0x1bc5a6(0x220)]>=_0x47a692?a42_0x438ef3[_0x1bc5a6(0x22f)](_0x1bc5a6(0x211)):'';console[_0x1bc5a6(0x197)](_0x1bc5a6(0x215)+_0x2ab227['length']+_0x1bc5a6(0xce)+(_0x2ab227['length']!==0x1?'s':'')+_0x3faea2);if(_0x40523e['format']===_0x1bc5a6(0x23f)||_0x40523e[_0x1bc5a6(0x1d8)]===_0x1bc5a6(0x148)||_0x40523e['format']==='table')await handleSDKOutput(_0x2ab227,_0x40523e);else{if(_0x2ab227['length']===0x0)_0x42b323?console[_0x1bc5a6(0x1bb)](_0x1bc5a6(0x1a2)+_0x42b323):console[_0x1bc5a6(0x1bb)](_0x1bc5a6(0x123));else{const _0x228695=_0x40523e['site'],_0x553f31=_0x2ab227[_0x1bc5a6(0x1d7)](_0x40b5a0=>{const _0x5e4d64=_0x1bc5a6,_0x13409e=a42_0x438ef3[_0x5e4d64(0x22f)]('#'+_0x40b5a0['id']),_0x247860=hyperlink(_0x13409e,getWorkflowUrl(_0x228695,_0x40b5a0['id'])),_0x3ddb30=_0x40b5a0[_0x5e4d64(0x1a4)]?.['name']?a42_0x438ef3[_0x5e4d64(0x22f)]('\x20('+_0x40b5a0[_0x5e4d64(0x1a4)][_0x5e4d64(0x231)]+')'):'';return'📋\x20'+_0x247860+'\x20'+_0x40b5a0[_0x5e4d64(0x231)]+_0x3ddb30;});await writeOutput(_0x553f31[_0x1bc5a6(0x1a3)]('\x0a'),_0x40523e[_0x1bc5a6(0x1ca)],_0x1bc5a6(0xfe));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a42_0x4e63f2(0x231)]='workflow:sessions';[a42_0x4e63f2(0x222)]=a42_0x4e63f2(0x1ee);async[a42_0x4e63f2(0x159)](_0x3fd16c){const _0x2fb093=a42_0x4e63f2,{options:_0x3d4521,args:_0x251d11,tdx:_0x302b3e}=_0x3fd16c,_0x342687=this[_0x2fb093(0x1e3)](_0x251d11,_0x3d4521);if(!_0x342687)return 0x1;const {projectName:_0x4e611a,workflowName:_0x31748c}=_0x342687;if(_0x3d4521['verbose']){if(_0x4e611a&&_0x31748c)console[_0x2fb093(0x197)](_0x2fb093(0x1b9)+_0x4e611a+'.'+_0x31748c);else _0x4e611a&&console[_0x2fb093(0x197)](_0x2fb093(0x127)+_0x4e611a);const _0x1529d0=_0x3d4521[_0x2fb093(0x13e)];_0x1529d0&&console[_0x2fb093(0x197)](_0x2fb093(0xad)+_0x1529d0);}let _0x5b924f=0x28;if(process[_0x2fb093(0x237)][_0x2fb093(0x1e2)]&&!_0x3d4521[_0x2fb093(0x1ca)]&&!_0x3d4521[_0x2fb093(0x1d8)]){const _0x403446=process[_0x2fb093(0x237)][_0x2fb093(0xc0)]||0x28;_0x5b924f=Math[_0x2fb093(0x1fe)](0x14,Math['floor'](_0x403446*0x2/0x3));}const _0x134661=_0x3d4521[_0x2fb093(0x239)]||_0x5b924f,_0x370268=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x302b3e[_0x2fb093(0xeb)][_0x2fb093(0x1f1)]({'projectName':_0x4e611a,'workflowName':_0x31748c,'status':_0x3d4521['status'],'fromTime':_0x3d4521['from'],'toTime':_0x3d4521['to'],'limit':_0x134661}),{'verbose':_0x3d4521[_0x2fb093(0x245)]}),_0x14e4b5=_0x370268[_0x2fb093(0xf3)];_0x14e4b5[_0x2fb093(0x180)]((_0x36b565,_0x2a7e70)=>{const _0x4a1559=_0x2fb093,_0x95ed1b=_0x36b565[_0x4a1559(0xec)]||'',_0x8831b9=_0x2a7e70[_0x4a1559(0xec)]||'';return _0x8831b9[_0x4a1559(0xb6)](_0x95ed1b);});_0x14e4b5[_0x2fb093(0x220)]>=_0x134661?console[_0x2fb093(0x197)](_0x2fb093(0x1f2)+_0x14e4b5[_0x2fb093(0x220)]+_0x2fb093(0x177)+a42_0x438ef3[_0x2fb093(0x22f)]('(use\x20--limit\x20to\x20see\x20more)')):console[_0x2fb093(0x197)](_0x2fb093(0x215)+_0x14e4b5[_0x2fb093(0x220)]+_0x2fb093(0x1ac)+(_0x14e4b5[_0x2fb093(0x220)]!==0x1?'s':''));if(_0x3d4521['format']===_0x2fb093(0x23f)||_0x3d4521['format']==='jsonl'||_0x3d4521['format']===_0x2fb093(0x193))await handleSDKOutput(_0x14e4b5,_0x3d4521);else{if(!process[_0x2fb093(0x237)][_0x2fb093(0x1e2)]||_0x3d4521[_0x2fb093(0x1ca)]){if(_0x14e4b5[_0x2fb093(0x220)]===0x0){if(_0x4e611a&&_0x31748c)console[_0x2fb093(0x1bb)](_0x2fb093(0x1ad)+_0x4e611a+'.'+_0x31748c);else _0x4e611a?console['log'](_0x2fb093(0x147)+_0x4e611a):console[_0x2fb093(0x1bb)](_0x2fb093(0x149));}else{const _0x3f7d21=_0x3d4521[_0x2fb093(0x179)],_0x92f82f=this[_0x2fb093(0x184)](_0x14e4b5,_0x3f7d21);_0x3d4521[_0x2fb093(0x1ca)]?await writeOutput(_0x92f82f,_0x3d4521[_0x2fb093(0x1ca)],_0x2fb093(0xfe)):console[_0x2fb093(0x1bb)](_0x92f82f);}!_0x4e611a&&(console['error'](''),console['error'](a42_0x438ef3[_0x2fb093(0x22f)](_0x2fb093(0x18d))),console[_0x2fb093(0x197)](a42_0x438ef3[_0x2fb093(0x22f)](_0x2fb093(0x236))+'or'+a42_0x438ef3[_0x2fb093(0x22f)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x14e4b5[_0x2fb093(0x220)]===0x0){if(_0x4e611a&&_0x31748c)console[_0x2fb093(0x1bb)](_0x2fb093(0x1ad)+_0x4e611a+'.'+_0x31748c);else _0x4e611a?console[_0x2fb093(0x1bb)](_0x2fb093(0x147)+_0x4e611a):console[_0x2fb093(0x1bb)](_0x2fb093(0x149));}else await this[_0x2fb093(0x199)](_0x14e4b5,_0x3fd16c,_0x4e611a);}}return 0x0;}[a42_0x4e63f2(0x184)](_0xa61a7e,_0x507795){const _0x1f2196=a42_0x4e63f2,_0x2943dc=[],_0x56fa45=new Map();let _0x2b631d=Infinity,_0x5a1b57=-Infinity;for(const _0x1b2d6b of _0xa61a7e){if(_0x1b2d6b[_0x1f2196(0xa0)]?.[_0x1f2196(0x1c9)]){const _0x44cc0a=new Date(_0x1b2d6b[_0x1f2196(0xa0)]['createdAt'])[_0x1f2196(0x194)](),_0x4b411c=_0x1b2d6b[_0x1f2196(0xa0)]['finishedAt']?new Date(_0x1b2d6b[_0x1f2196(0xa0)][_0x1f2196(0x221)])['getTime']():Date[_0x1f2196(0x152)](),_0x52c50e=_0x1b2d6b[_0x1f2196(0x1a4)]?.[_0x1f2196(0x231)]||_0x1f2196(0x10e);!_0x56fa45['has'](_0x52c50e)&&_0x56fa45[_0x1f2196(0x1b8)](_0x52c50e,[]),_0x56fa45['get'](_0x52c50e)[_0x1f2196(0xf7)]({'session':_0x1b2d6b,'startTime':_0x44cc0a,'endTime':_0x4b411c,'duration':_0x4b411c-_0x44cc0a}),_0x2b631d=Math[_0x1f2196(0x155)](_0x2b631d,_0x44cc0a),_0x5a1b57=Math['max'](_0x5a1b57,_0x4b411c);}}if(_0x56fa45['size']===0x0)return _0x1f2196(0x144);const _0x3df684=process['stdout'][_0x1f2196(0x115)]||0x78,_0x1a4501=0x1e,_0x834941=0x32,_0x3e6dc5=0x4,_0x21c4f8=Math[_0x1f2196(0x155)](_0x834941,Math['max'](_0x1a4501,Math[_0x1f2196(0x187)](_0x3df684*0.3))),_0x28e2ce=_0x3df684-_0x21c4f8-TIMELINE_CONFIG[_0x1f2196(0x11c)]-0x3-_0x3e6dc5,_0x512ecc=_0x5a1b57-_0x2b631d,_0x34146f=_0x512ecc/_0x21c4f8,_0x197e43=renderTimeAxis({'startTime':_0x2b631d,'endTime':_0x5a1b57,'durationMs':_0x512ecc,'msPerChar':_0x34146f},_0x21c4f8),_0x1885a9=[];for(const _0x2ab85d of _0x56fa45[_0x1f2196(0x15e)]()){_0x1885a9[_0x1f2196(0xf7)](..._0x2ab85d);}_0x1885a9[_0x1f2196(0x180)]((_0x4c749b,_0x3980a0)=>_0x3980a0[_0x1f2196(0x142)]-_0x4c749b[_0x1f2196(0x142)]);const _0x54da42=new Date(_0x2b631d),_0x1cc167=formatDate(_0x54da42),_0x369085=_0x3e6dc5+TIMELINE_CONFIG[_0x1f2196(0x212)]+TIMELINE_CONFIG['ICON_SPACING']+_0x28e2ce,_0xba5c35='\x20'['repeat'](_0x369085-_0x1cc167[_0x1f2196(0x220)]),_0x13c98f=_0xba5c35+a42_0x438ef3['dim'](_0x1cc167)+'\x20'+_0x197e43;_0x2943dc[_0x1f2196(0xf7)](_0x13c98f);const _0x33cc2e=0x16;let _0x1de5d7=0x0;for(const _0x455ce1 of _0x1885a9){const _0x27b2dd=_0x455ce1[_0x1f2196(0x15f)]['project']?.[_0x1f2196(0x231)]||'?',_0x454f30=Math[_0x1f2196(0x155)](stringWidth(_0x27b2dd),_0x33cc2e);_0x1de5d7=Math[_0x1f2196(0x1fe)](_0x1de5d7,_0x454f30);}for(const _0xcca0ce of _0x1885a9){const {session:_0x264178,startTime:_0x470aaa,endTime:_0x35e4f5,duration:_0x27cb00}=_0xcca0ce,_0x5dd4ee=_0x264178[_0x1f2196(0x1a4)]?.['id'],_0x3b3c86=_0x264178['id'],_0x5a8521=_0x264178['project']?.[_0x1f2196(0x231)]||'?',_0x1304f0=_0x264178['workflow']?.['name']||'?';let _0xdb98f3,_0x20d5d9;if(_0x264178[_0x1f2196(0xa0)]){const _0x133f34=_0x264178[_0x1f2196(0xa0)];!_0x133f34[_0x1f2196(0x10f)]?(_0xdb98f3=_0x133f34[_0x1f2196(0xbc)]?'🛑':'🔄',_0x20d5d9=_0x133f34[_0x1f2196(0xbc)]?a42_0x438ef3[_0x1f2196(0x1ce)]:a42_0x438ef3['blue']):(_0xdb98f3=_0x133f34['success']?'✅':'❌',_0x20d5d9=_0x133f34[_0x1f2196(0x154)]?a42_0x438ef3[_0x1f2196(0x248)]:a42_0x438ef3[_0x1f2196(0x1b1)]);}else _0xdb98f3='⏳',_0x20d5d9=a42_0x438ef3[_0x1f2196(0x22f)];const _0x1510f7='#'+_0x3b3c86,_0x5d4387=_0x5dd4ee?hyperlink(_0x1510f7,getWorkflowSessionUrl(_0x507795,_0x5dd4ee,_0x3b3c86)):_0x1510f7;let _0x1c4f6=_0x5a8521;stringWidth(_0x5a8521)>_0x33cc2e&&(_0x1c4f6=_0x5a8521[_0x1f2196(0x1e5)](0x0,_0x33cc2e-0x1)+'…');const _0x14e4b7=a42_0x438ef3[_0x1f2196(0x22f)](_0x1c4f6),_0x380cb1=stringWidth(_0x1c4f6),_0x498431='\x20'[_0x1f2196(0x202)](_0x1de5d7-stringWidth(_0x1c4f6)+0x2),_0x39ed54='('+formatElapsed(_0x27cb00)+')',_0x153494=stringWidth(_0x39ed54),_0x4b0878=stringWidth(_0x1510f7),_0x59ec03=_0x4b0878+0x1+_0x380cb1+_0x498431['length'],_0x23760c=_0x28e2ce-_0x59ec03-_0x153494-0x1-0x8;let _0x255470=_0x1304f0;stringWidth(_0x255470)>_0x23760c&&(_0x255470=_0x255470[_0x1f2196(0x1e5)](0x0,_0x23760c-0x1)+'…');const _0x3076a0=_0x5d4387+'\x20'+_0x14e4b7+_0x498431+_0x255470,_0x5b5521=stringWidth(_0x3076a0),_0xbb3d95=_0x28e2ce-_0x5b5521-_0x153494,_0x166720=_0x3076a0+'\x20'[_0x1f2196(0x202)](Math[_0x1f2196(0x1fe)](0x1,_0xbb3d95))+a42_0x438ef3['dim'](_0x39ed54),_0x478595=Math[_0x1f2196(0x187)]((_0x470aaa-_0x2b631d)/_0x34146f),_0x3d2120=Math[_0x1f2196(0x187)]((_0x35e4f5-_0x2b631d)/_0x34146f),_0x405a6c=Math['max'](_0x478595+0x1,_0x3d2120),_0x3e16ce=new Array(_0x21c4f8)[_0x1f2196(0x21c)]('\x20');for(let _0x1f84e9=_0x478595;_0x1f84e9<Math['min'](_0x405a6c,_0x21c4f8);_0x1f84e9++){_0x3e16ce[_0x1f84e9]='─';}const _0x314881=_0x3e16ce[_0x1f2196(0x1d7)](_0x120063=>_0x120063==='\x20'?'\x20':_0x20d5d9(_0x120063))[_0x1f2196(0x1a3)]('');_0x2943dc[_0x1f2196(0xf7)](_0xdb98f3+'\x20'+_0x166720+'│'+_0x314881+'│');}return _0x2943dc[_0x1f2196(0x1a3)]('\x0a');}async['navigateSessionsInteractive'](_0x1a84b9,_0x59b00f,_0xee0f1c){const _0x127fbc=a42_0x4e63f2,{options:_0x297dfc,tdx:_0x4370ca}=_0x59b00f,_0x42c2ec=_0x297dfc[_0x127fbc(0x179)],{timelineRows:_0x26684d,timeAxisHeader:_0x23d34d}=this[_0x127fbc(0x230)](_0x1a84b9,_0x42c2ec),_0x2b77c0=_0x26684d[_0x127fbc(0x15a)](_0x1926f8=>_0x1926f8['attemptId']);if(_0x2b77c0['length']===0x0){const _0xd64a6f=this['renderSessionsTimeline'](_0x1a84b9,_0x42c2ec);console['log'](_0xd64a6f);!_0xee0f1c&&(console[_0x127fbc(0x197)](''),console['error'](a42_0x438ef3[_0x127fbc(0x22f)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console['error'](a42_0x438ef3[_0x127fbc(0x22f)](_0x127fbc(0x236))+'or'+a42_0x438ef3[_0x127fbc(0x22f)](_0x127fbc(0x15d))));return;}_0x23d34d&&console[_0x127fbc(0x1bb)](_0x23d34d);const _0x2d7072=_0x26684d['filter'](_0x2e20f0=>_0x2e20f0[_0x127fbc(0xb3)])['map'](_0x4a4fa6=>({'title':_0x4a4fa6[_0x127fbc(0x14b)],'value':_0x4a4fa6['attemptId']})),_0x4329c2=process[_0x127fbc(0x237)][_0x127fbc(0xc0)]||0x3c,_0x5ac268=Math['max'](0x28,Math[_0x127fbc(0x187)](_0x4329c2*0x2/0x3)),_0x25bb37=await a42_0x30fad8({'type':_0x127fbc(0x1cb),'name':'attemptId','message':_0x127fbc(0xcb),'choices':_0x2d7072,'initial':-0x1,'limit':_0x5ac268,'clearFirst':!![],'fallback':{'title':_0x127fbc(0xac),'value':null},'suggest':(_0x2da877,_0x22ee45)=>{if(!_0x2da877)return Promise['resolve'](_0x22ee45);const _0x49e1fd=_0x22ee45['filter'](_0x5295ed=>{const _0x3c9be4=a42_0x201d,_0x4649cc=_0x5295ed;return _0x4649cc[_0x3c9be4(0x20d)][_0x3c9be4(0xa1)]()['includes'](_0x2da877[_0x3c9be4(0xa1)]());});return Promise['resolve'](_0x49e1fd);}}),_0xaa260d=()=>{const _0x2bdc71=_0x127fbc;process[_0x2bdc71(0x237)][_0x2bdc71(0x19c)](_0x2bdc71(0x1ff)),process[_0x2bdc71(0x237)][_0x2bdc71(0x19c)](_0x2bdc71(0x1ff)),process[_0x2bdc71(0x237)]['write']('\x1b[1A\x1b[2K');},_0x10d413=_0x25bb37&&_0x25bb37[_0x127fbc(0xb3)]&&_0x25bb37[_0x127fbc(0xb3)]!==null&&_0x25bb37[_0x127fbc(0xb3)][_0x127fbc(0x19f)]()!=='';if(!_0x10d413){_0xaa260d(),console[_0x127fbc(0x1bb)](a42_0x438ef3[_0x127fbc(0x22f)](_0x127fbc(0x1cc)));return;}_0xaa260d();const _0x15aa5d=_0x1a84b9[_0x127fbc(0x1a9)](_0x1325ce=>_0x1325ce['lastAttempt']?.['id']===_0x25bb37[_0x127fbc(0xb3)]);if(_0x15aa5d){const _0x1f09d9=_0x15aa5d[_0x127fbc(0x1a4)]?.[_0x127fbc(0x231)]||'?',_0x3a3db5=_0x15aa5d[_0x127fbc(0xeb)]?.[_0x127fbc(0x231)]||'?';console[_0x127fbc(0x1bb)](_0x127fbc(0x246)+a42_0x438ef3[_0x127fbc(0x22f)](_0x1f09d9)+_0x127fbc(0x126)+a42_0x438ef3['dim'](_0x3a3db5));}const _0x4b26e5=new WorkflowTimelineCommand();await _0x4b26e5['execute']({'args':[],'options':{..._0x297dfc,'attemptId':_0x25bb37['attemptId']},'tdx':_0x4370ca});}[a42_0x4e63f2(0x230)](_0x8e97be,_0x25b837){const _0x301a92=a42_0x4e63f2,_0x76e968=new Map();for(const _0x18f0a9 of _0x8e97be){_0x18f0a9['id']&&_0x18f0a9['lastAttempt']?.['id']&&_0x76e968['set'](_0x18f0a9['id'],_0x18f0a9[_0x301a92(0xa0)]['id']);}const _0x58fa0e=[];let _0x2919dc='';const _0x509cec=this['renderSessionsTimeline'](_0x8e97be,_0x25b837),_0x39ad61=_0x509cec['split']('\x0a');for(const _0x1415f9 of _0x39ad61){if(_0x1415f9['startsWith']('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x1415f9[_0x301a92(0x1cf)](/^\s+\d{4}-\d{2}-\d{2}/))_0x2919dc=_0x1415f9;else{if(_0x1415f9[_0x301a92(0x1cf)](/^[✅❌🔄🛑⏳]/)){const _0x1284b0=_0x1415f9[_0x301a92(0x1cf)](/#(\d+)/),_0x4dcac4=_0x1284b0?_0x1284b0[0x1]:null,_0x3a49f1=_0x4dcac4?_0x76e968['get'](_0x4dcac4)||null:null,_0x3df27f=_0x8e97be[_0x301a92(0x1a9)](_0x40fd93=>_0x40fd93['id']===_0x4dcac4),_0x527b0b=_0x3df27f?.[_0x301a92(0x1a4)]?.['name']||'';_0x58fa0e[_0x301a92(0xf7)]({'displayLine':_0x1415f9,'attemptId':_0x3a49f1,'projectName':_0x527b0b});}}}return{'timelineRows':_0x58fa0e,'timeAxisHeader':_0x2919dc};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a42_0x4e63f2(0x231)]=a42_0x4e63f2(0x229);['description']=a42_0x4e63f2(0x134);async['execute'](_0x253c51){const _0x6d5fc1=a42_0x4e63f2,{options:_0x3fb48e,args:_0x2023b3,tdx:_0x59c478}=_0x253c51,_0x33767c=this[_0x6d5fc1(0x1e3)](_0x2023b3,_0x3fb48e);if(!_0x33767c)return 0x1;const {projectName:_0x45d317,workflowName:_0x11ff13}=_0x33767c,_0x5dd3f2=_0x3fb48e[_0x6d5fc1(0x22c)];if(_0x3fb48e['verbose']){if(_0x45d317&&_0x11ff13)console[_0x6d5fc1(0x197)](_0x6d5fc1(0x1b9)+_0x45d317+'.'+_0x11ff13);else _0x45d317&&console['error'](_0x6d5fc1(0x127)+_0x45d317);_0x5dd3f2&&console['error'](_0x6d5fc1(0xab));}const _0x2c4d2b=await withSpinner(_0x6d5fc1(0x164),()=>_0x59c478[_0x6d5fc1(0xeb)]['attempts']({'projectName':_0x45d317,'workflowName':_0x11ff13,'includeRetried':_0x5dd3f2,'limit':_0x3fb48e['limit']}),{'verbose':_0x3fb48e[_0x6d5fc1(0x245)]}),_0x25f8f8=_0x2c4d2b[_0x6d5fc1(0xf3)],_0x245c18=_0x3fb48e['limit']||0x64,_0x3145a9=_0x25f8f8['length']>=_0x245c18?a42_0x438ef3[_0x6d5fc1(0x22f)](_0x6d5fc1(0x211)):'';console[_0x6d5fc1(0x197)]('✔\x20Found\x20'+_0x25f8f8[_0x6d5fc1(0x220)]+_0x6d5fc1(0x1d2)+(_0x25f8f8[_0x6d5fc1(0x220)]!==0x1?'s':'')+_0x3145a9);if(_0x3fb48e[_0x6d5fc1(0x1d8)]===_0x6d5fc1(0x23f)||_0x3fb48e['format']===_0x6d5fc1(0x148)||_0x3fb48e[_0x6d5fc1(0x1d8)]===_0x6d5fc1(0x193))await handleSDKOutput(_0x25f8f8,_0x3fb48e);else{if(_0x25f8f8[_0x6d5fc1(0x220)]===0x0){if(_0x45d317&&_0x11ff13)console[_0x6d5fc1(0x1bb)](_0x6d5fc1(0x240)+_0x45d317+'.'+_0x11ff13);else _0x45d317?console['log'](_0x6d5fc1(0xb0)+_0x45d317):console[_0x6d5fc1(0x1bb)](_0x6d5fc1(0xa3));}else{const _0x584bdc=_0x3fb48e['site'],_0x3d1124=_0x25f8f8[_0x6d5fc1(0x1d7)](_0x8fd209=>{const _0x56e2c0=_0x6d5fc1,_0x53f88a=a42_0x438ef3[_0x56e2c0(0x22f)]('#'+_0x8fd209['id']),_0x313787=_0x8fd209[_0x56e2c0(0x1a4)]?.['id'],_0x5b02ed=_0x8fd209['session_id']||_0x8fd209[_0x56e2c0(0x1c4)],_0x471b65=_0x313787&&_0x5b02ed?hyperlink(_0x53f88a,getWorkflowAttemptUrl(_0x584bdc,_0x313787,_0x5b02ed,_0x8fd209['id'])):_0x53f88a,{icon:_0x3e5559,text:_0x2d5812}=getAttemptStatusDisplay(_0x8fd209),_0x5b7dc8=(_0x8fd209['project']?.[_0x56e2c0(0x231)]||'?')+'.'+(_0x8fd209[_0x56e2c0(0xeb)]?.[_0x56e2c0(0x231)]||'?'),_0x545b52=_0x8fd209['sessionTime']?a42_0x438ef3[_0x56e2c0(0x22f)](_0x8fd209[_0x56e2c0(0xec)]):'';return(_0x471b65+'\x20'+_0x3e5559+(_0x2d5812?'\x20'+_0x2d5812:'')+'\x20'+_0x5b7dc8+'\x20'+_0x545b52)['trimEnd']();});await writeOutput(_0x3d1124['join']('\x0a'),_0x3fb48e[_0x6d5fc1(0x1ca)],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a42_0x4e63f2(0x1ef);[a42_0x4e63f2(0x222)]=a42_0x4e63f2(0xe0);async[a42_0x4e63f2(0x159)](_0x40a61b){const _0x593322=a42_0x4e63f2,{options:_0x462685,args:_0x51f6a3,tdx:_0x49204c}=_0x40a61b,_0x3ac86b=_0x51f6a3[0x0];if(!_0x3ac86b)return console[_0x593322(0x197)](_0x593322(0x1db)),0x1;_0x462685['verbose']&&console[_0x593322(0x197)](_0x593322(0x120)+_0x3ac86b);const _0x434b10=await withSpinner(_0x593322(0xd9),()=>_0x49204c[_0x593322(0xeb)][_0x593322(0x1ed)](_0x3ac86b),{'verbose':_0x462685[_0x593322(0x245)]}),_0x1a8a64=_0x434b10[_0x593322(0xf3)];let _0x55daa4;!_0x1a8a64[_0x593322(0x10f)]?_0x55daa4=_0x1a8a64[_0x593322(0xbc)]?_0x593322(0x167):_0x593322(0x14a):_0x55daa4=_0x1a8a64[_0x593322(0x154)]?_0x593322(0x154):'error';let _0x3bba31;if(_0x1a8a64[_0x593322(0x1c9)]&&_0x1a8a64['finishedAt']){const _0x46e270=new Date(_0x1a8a64['createdAt'])[_0x593322(0x194)](),_0x143145=new Date(_0x1a8a64[_0x593322(0x221)])[_0x593322(0x194)]();_0x3bba31=Math['round']((_0x143145-_0x46e270)/0x3e8);}const _0x52fa4d={'attempt_id':_0x1a8a64['id'],'status':_0x55daa4,..._0x1a8a64['index']!==undefined&&{'index':_0x1a8a64[_0x593322(0x1c6)]},..._0x1a8a64[_0x593322(0x1a4)]&&{'project':_0x1a8a64['project'][_0x593322(0x231)]},..._0x1a8a64[_0x593322(0xeb)]&&{'workflow':_0x1a8a64[_0x593322(0xeb)][_0x593322(0x231)]},..._0x1a8a64[_0x593322(0x1c4)]&&{'session_id':_0x1a8a64['sessionId']},..._0x1a8a64[_0x593322(0xec)]&&{'session_time':_0x1a8a64['sessionTime']},..._0x1a8a64['retryAttemptName']&&{'retry_attempt':_0x1a8a64['retryAttemptName']},..._0x3bba31!==undefined&&{'duration_sec':_0x3bba31},..._0x1a8a64[_0x593322(0x1c9)]&&{'created_at':_0x1a8a64['createdAt']},..._0x1a8a64[_0x593322(0x221)]&&{'finished_at':_0x1a8a64[_0x593322(0x221)]},...Object[_0x593322(0x22b)](_0x1a8a64['params'])[_0x593322(0x220)]>0x0&&{'params':_0x1a8a64[_0x593322(0x16d)]}};return await handleSingleObjectOutput(_0x52fa4d,_0x462685),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a42_0x4e63f2(0x231)]=a42_0x4e63f2(0xc1);[a42_0x4e63f2(0x222)]=a42_0x4e63f2(0x1dd);async['execute'](_0x51d3d3){const _0x3053ed=a42_0x4e63f2,{options:_0x5a32b3,args:_0x4b2124,tdx:_0x11edcb}=_0x51d3d3,_0x2047ea=_0x4b2124[0x0];if(!_0x2047ea)return console[_0x3053ed(0x197)](_0x3053ed(0x1db)),0x1;const _0xbb5ce5=_0x5a32b3['includeSubtasks'];_0x5a32b3[_0x3053ed(0x245)]&&(console[_0x3053ed(0x197)](_0x3053ed(0x120)+_0x2047ea),_0xbb5ce5&&console[_0x3053ed(0x197)](_0x3053ed(0x1e4)));const _0x2a030e=await withSpinner(_0x3053ed(0x9f),()=>_0x11edcb[_0x3053ed(0xeb)]['tasks'](_0x2047ea,_0xbb5ce5||![]),{'verbose':_0x5a32b3[_0x3053ed(0x245)]}),_0x3309f9=_0x2a030e[_0x3053ed(0xf3)];return console[_0x3053ed(0x197)](_0x3053ed(0x215)+_0x3309f9[_0x3053ed(0x220)]+_0x3053ed(0x16c)+(_0x3309f9['length']!==0x1?'s':'')),await handleSDKOutput(_0x3309f9,_0x5a32b3),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a42_0x4e63f2(0x231)]=a42_0x4e63f2(0xd5);['description']=a42_0x4e63f2(0x132);async['execute'](_0x421a94){const _0x450d3a=a42_0x4e63f2,{options:_0x4e505e,args:_0x5b9375,tdx:_0x190f7e}=_0x421a94,_0x3b4fdb=_0x5b9375[0x0];let _0x3c228f=_0x5b9375[0x1];if(!_0x3b4fdb)return console[_0x450d3a(0x197)](_0x450d3a(0x1db)),0x1;_0x4e505e[_0x450d3a(0x245)]&&(console[_0x450d3a(0x197)](_0x450d3a(0x120)+_0x3b4fdb),_0x3c228f&&console[_0x450d3a(0x197)](_0x450d3a(0x156)+_0x3c228f));const _0x239a88=await withSpinner(_0x450d3a(0xe8),()=>_0x190f7e[_0x450d3a(0xeb)][_0x450d3a(0x153)](_0x3b4fdb,_0x3c228f),{'verbose':_0x4e505e['verbose']}),_0x3f1943=_0x239a88[_0x450d3a(0xf3)];if(_0x3f1943[_0x450d3a(0x220)]===0x0)return console[_0x450d3a(0x197)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x3c228f&&(_0x4e505e[_0x450d3a(0x23f)]||_0x4e505e[_0x450d3a(0x1d8)]))return await handleSDKOutput(_0x3f1943,_0x4e505e),0x0;if(!_0x3c228f){const _0x157e5f=_0x3f1943[_0x450d3a(0x1d7)](_0x28d6c3=>({'title':_0x28d6c3[_0x450d3a(0x1bc)]+'\x20('+formatBytes(_0x28d6c3[_0x450d3a(0x200)])+')','value':_0x28d6c3[_0x450d3a(0x1bc)]})),_0x21cb88=await a42_0x30fad8({'type':_0x450d3a(0x195),'name':_0x450d3a(0xbb),'message':_0x450d3a(0x11a),'choices':_0x157e5f});if(!_0x21cb88['task'])return console[_0x450d3a(0x197)](_0x450d3a(0x1cc)),0x0;_0x3c228f=_0x21cb88[_0x450d3a(0xbb)];}const _0x29ca80=await withSpinner(_0x450d3a(0x1b0),()=>_0x190f7e['workflow']['logs'](_0x3b4fdb,_0x3c228f),{'verbose':_0x4e505e[_0x450d3a(0x245)]}),_0x5a7dd0=_0x29ca80[_0x450d3a(0xf3)];return _0x5a7dd0?console[_0x450d3a(0x1bb)](_0x5a7dd0):console[_0x450d3a(0x197)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a42_0x4e63f2(0x231)]='workflow:kill';[a42_0x4e63f2(0x222)]=a42_0x4e63f2(0xb8);async['execute'](_0x1c8bd4){const _0xc4d3e0=a42_0x4e63f2,{options:_0xbb4397,args:_0x338ca1,tdx:_0x16cfc9}=_0x1c8bd4,_0x47ec35=_0x338ca1[0x0];if(!_0x47ec35)return console[_0xc4d3e0(0x197)](_0xc4d3e0(0x1db)),0x1;const _0x21bc4e=_0xbb4397['reason'];_0xbb4397['verbose']&&(console['error'](_0xc4d3e0(0x120)+_0x47ec35),_0x21bc4e&&console[_0xc4d3e0(0x197)]('Reason:\x20'+_0x21bc4e));if(!_0xbb4397[_0xc4d3e0(0x21d)]){if(!isInteractive())return console[_0xc4d3e0(0x197)](a42_0x438ef3[_0xc4d3e0(0x1b1)](_0xc4d3e0(0xa7)),_0xc4d3e0(0x1fb)),console[_0xc4d3e0(0x197)](a42_0x438ef3['dim'](_0xc4d3e0(0x23e))),0x1;const _0x5ea9c3=await confirmKey(_0xc4d3e0(0x145)+_0x47ec35+'?');if(!_0x5ea9c3)return console[_0xc4d3e0(0x197)](a42_0x438ef3['yellow'](_0xc4d3e0(0x1cc))),0x1;}const _0x31db77=await withSpinner(_0xc4d3e0(0xee),()=>_0x16cfc9['workflow'][_0xc4d3e0(0x128)](_0x47ec35,_0x21bc4e),{'verbose':_0xbb4397[_0xc4d3e0(0x245)]}),_0x77a556=_0x31db77[_0xc4d3e0(0xf3)];return console[_0xc4d3e0(0x197)]('✔\x20'+_0x77a556),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a42_0x4e63f2(0x231)]=a42_0x4e63f2(0x125);[a42_0x4e63f2(0x222)]=a42_0x4e63f2(0x1ae);async[a42_0x4e63f2(0x159)](_0x27102f){const _0x190078=a42_0x4e63f2,{options:_0x2f1c88,args:_0x3440ea,tdx:_0x1394f5}=_0x27102f,_0x105f60=_0x3440ea[0x0];if(!_0x105f60)return console[_0x190078(0x197)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console['error']('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x4b1ee7=![],_0x2aee7d=_0x105f60;if(_0x105f60['startsWith'](_0x190078(0xc9)))_0x4b1ee7=!![],_0x2aee7d=_0x105f60[_0x190078(0x161)](0x8);else{if(_0x105f60[_0x190078(0xa4)]('attempt:'))_0x4b1ee7=![],_0x2aee7d=_0x105f60[_0x190078(0x161)](0x8);else return console[_0x190078(0x197)](_0x190078(0x112)),console['error'](_0x190078(0x12d)),0x1;}const _0x5093c4=_0x2f1c88[_0x190078(0x207)],_0x399f63=_0x2f1c88[_0x190078(0x1a5)],_0xfe3c6c=_0x2f1c88[_0x190078(0x16d)],_0x270c30=_0x2f1c88['force'];_0x2f1c88['verbose']&&(console['error'](_0x190078(0x1a8)+(_0x4b1ee7?_0x190078(0x15f):_0x190078(0x1ed))+'\x20'+_0x2aee7d),_0x5093c4&&console[_0x190078(0x197)](_0x190078(0xef)+_0x5093c4),_0x399f63&&console['error']('Resume\x20from:\x20'+_0x399f63),_0xfe3c6c&&console[_0x190078(0x197)]('Params:\x20'+_0xfe3c6c),_0x270c30&&console['error'](_0x190078(0xbe)));let _0x34088d;if(_0xfe3c6c)try{if(_0xfe3c6c[_0x190078(0xa4)]('@')){const _0x30f2a7=await import(_0x190078(0x1fc)),_0x1144b1=_0xfe3c6c['substring'](0x1),_0x1bbc79=await _0x30f2a7['readFile'](_0x1144b1,_0x190078(0x13c));_0x34088d=JSON[_0x190078(0xd0)](_0x1bbc79);}else _0x34088d=JSON[_0x190078(0xd0)](_0xfe3c6c);}catch{return console[_0x190078(0x197)](_0x190078(0x244)),0x1;}if(!_0x2f1c88[_0x190078(0x21d)]){if(!isInteractive())return console[_0x190078(0x197)](a42_0x438ef3[_0x190078(0x1b1)](_0x190078(0xa7)),_0x190078(0x1fb)),console[_0x190078(0x197)](a42_0x438ef3[_0x190078(0x22f)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x215776=await confirmKey(_0x190078(0x189)+(_0x4b1ee7?_0x190078(0x15f):_0x190078(0x1ed))+'\x20'+_0x2aee7d+'?');if(!_0x215776)return console[_0x190078(0x197)](a42_0x438ef3[_0x190078(0x1ce)](_0x190078(0x1cc))),0x1;}let _0xba9369;_0x4b1ee7?_0xba9369=await withSpinner(_0x190078(0xe2),()=>_0x1394f5[_0x190078(0xeb)][_0x190078(0xc8)](_0x2aee7d,{'fromTask':_0x5093c4,'retryParams':_0x34088d}),{'verbose':_0x2f1c88[_0x190078(0x245)]}):_0xba9369=await withSpinner(_0x190078(0xe6),()=>_0x1394f5[_0x190078(0xeb)][_0x190078(0x249)](_0x2aee7d,{'resumeFrom':_0x399f63,'retryParams':_0x34088d,'force':_0x270c30}),{'verbose':_0x2f1c88[_0x190078(0x245)]});const _0x3193eb=_0xba9369[_0x190078(0xf3)];return console['error'](_0x190078(0x1f3)),console[_0x190078(0x197)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x3193eb[_0x190078(0xb3)]),console['error'](_0x190078(0x1c7)+_0x3193eb[_0x190078(0x1c4)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a42_0x4e63f2(0x226);[a42_0x4e63f2(0x222)]=a42_0x4e63f2(0x1e9);async['execute'](_0x56d563){const _0xe4b9b8=a42_0x4e63f2,{options:_0x296461,args:_0x1b283f,tdx:_0x6add65}=_0x56d563;let _0xb6ed35=_0x1b283f[0x0];if(!_0xb6ed35){const _0x244eab=this[_0xe4b9b8(0xf9)]([],_0x296461),_0xfc0536=await withSpinner(_0xe4b9b8(0x1da),()=>_0x6add65[_0xe4b9b8(0xeb)]['workflows'](_0x244eab,{'limit':_0x296461[_0xe4b9b8(0x239)]}),{'verbose':_0x296461[_0xe4b9b8(0x245)]}),_0x466110=_0xfc0536['data'];if(_0x466110['length']===0x0)return console[_0xe4b9b8(0x197)](_0xe4b9b8(0x123)),!_0x244eab&&console[_0xe4b9b8(0x197)](a42_0x438ef3['dim'](_0xe4b9b8(0x210))),0x1;const _0x1bcb39=_0x466110[_0xe4b9b8(0x1d7)](_0x27c793=>({'title':_0x27c793['project']?.[_0xe4b9b8(0x231)]+'.'+_0x27c793['name'],'value':_0x27c793[_0xe4b9b8(0x1a4)]?.[_0xe4b9b8(0x231)]+'.'+_0x27c793[_0xe4b9b8(0x231)],'description':_0x27c793[_0xe4b9b8(0x19e)]?_0xe4b9b8(0x232)+_0x27c793[_0xe4b9b8(0x19e)]:undefined})),_0x201d0f=await a42_0x30fad8({'type':_0xe4b9b8(0x195),'name':_0xe4b9b8(0xeb),'message':_0xe4b9b8(0xc2),'choices':_0x1bcb39});if(!_0x201d0f[_0xe4b9b8(0xeb)])return 0x1;_0xb6ed35=_0x201d0f[_0xe4b9b8(0xeb)];}if(!_0xb6ed35['includes']('.')){const _0x14ecf7=this[_0xe4b9b8(0xf9)]([],_0x296461);if(_0x14ecf7)_0xb6ed35=_0x14ecf7+'.'+_0xb6ed35;else return console[_0xe4b9b8(0x197)](a42_0x438ef3[_0xe4b9b8(0x1b1)](_0xe4b9b8(0x1dc)),_0xe4b9b8(0x219)),console[_0xe4b9b8(0x197)](a42_0x438ef3[_0xe4b9b8(0x22f)](_0xe4b9b8(0x210))),0x1;}const _0x4bcde2=_0x296461[_0xe4b9b8(0x1d4)],_0x6e16f9=_0x296461[_0xe4b9b8(0xec)],_0x10d8a6={};if(_0x4bcde2&&Array['isArray'](_0x4bcde2))for(const _0x2c319a of _0x4bcde2){const _0x47efac=_0x2c319a[_0xe4b9b8(0x121)]('=');if(_0x47efac===-0x1)return console['error'](_0xe4b9b8(0x1e0)+_0x2c319a),console[_0xe4b9b8(0x197)](_0xe4b9b8(0x10a)),0x1;const _0x4ad954=_0x2c319a['substring'](0x0,_0x47efac),_0x5c3bcf=_0x2c319a[_0xe4b9b8(0x161)](_0x47efac+0x1);try{_0x10d8a6[_0x4ad954]=JSON[_0xe4b9b8(0xd0)](_0x5c3bcf);}catch{_0x10d8a6[_0x4ad954]=_0x5c3bcf;}}_0x296461[_0xe4b9b8(0x245)]&&(console[_0xe4b9b8(0x197)](_0xe4b9b8(0x23d)+_0xb6ed35),Object[_0xe4b9b8(0x22b)](_0x10d8a6)[_0xe4b9b8(0x220)]>0x0&&console[_0xe4b9b8(0x197)](_0xe4b9b8(0x1cd)+JSON[_0xe4b9b8(0x100)](_0x10d8a6)),_0x6e16f9&&console[_0xe4b9b8(0x197)]('Session\x20time:\x20'+_0x6e16f9));const _0x2ce4a9=await withSpinner(_0xe4b9b8(0x15b),()=>_0x6add65[_0xe4b9b8(0xeb)][_0xe4b9b8(0x11b)](_0xb6ed35,_0x10d8a6,{'sessionTime':_0x6e16f9}),{'verbose':_0x296461[_0xe4b9b8(0x245)]}),_0x22fa4a=_0x2ce4a9[_0xe4b9b8(0xf3)];console[_0xe4b9b8(0x197)](_0xe4b9b8(0x13a)),console[_0xe4b9b8(0x197)](_0xe4b9b8(0x13b)+_0x22fa4a['id']),console[_0xe4b9b8(0x197)](_0xe4b9b8(0x1c7)+_0x22fa4a[_0xe4b9b8(0x1c4)]),console[_0xe4b9b8(0x197)](_0xe4b9b8(0x15c)+_0x22fa4a[_0xe4b9b8(0x1a4)]?.[_0xe4b9b8(0x231)]),console['error'](_0xe4b9b8(0xd3)+_0x22fa4a[_0xe4b9b8(0xeb)]?.[_0xe4b9b8(0x231)]);if(_0x22fa4a[_0xe4b9b8(0x1a4)]?.['id']&&_0x22fa4a[_0xe4b9b8(0x1c4)]&&_0x22fa4a['id']){const _0x795dec=_0x296461[_0xe4b9b8(0x179)],_0x203aa1=getConsoleUrl(_0x795dec,_0xe4b9b8(0x17e)+_0x22fa4a[_0xe4b9b8(0x1a4)]['id']+'/sessions/'+_0x22fa4a[_0xe4b9b8(0x1c4)]+'/attempt/'+_0x22fa4a['id']);console[_0xe4b9b8(0x197)]('\x20\x20Console:\x20'+a42_0x438ef3[_0xe4b9b8(0x175)](_0x203aa1));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a42_0x4e63f2(0x231)]=a42_0x4e63f2(0x186);['description']=a42_0x4e63f2(0x1ba);async[a42_0x4e63f2(0x159)](_0x355f2b){const _0x447c68=a42_0x4e63f2,{options:_0x2f1ce7,args:_0x307dc6,tdx:_0x4703ff}=_0x355f2b,_0x31ef59=_0x307dc6[0x0],_0x18178b=_0x307dc6[0x1]||'.';if(!_0x31ef59)return console['error']('Error:\x20Project\x20name\x20is\x20required'),console[_0x447c68(0x197)](_0x447c68(0x1f8)),0x1;const _0xdd3d53=_0x2f1ce7[_0x447c68(0x19e)];_0x2f1ce7[_0x447c68(0x245)]&&(console['error']('Project:\x20'+_0x31ef59),console[_0x447c68(0x197)](_0x447c68(0xaa)+_0x18178b),_0xdd3d53&&console[_0x447c68(0x197)](_0x447c68(0xb1)+_0xdd3d53));const _0x4e15c3=await withSpinner(_0x447c68(0x1e8)+_0x31ef59+_0x447c68(0x21f),()=>_0x4703ff['workflow'][_0x447c68(0x11d)](_0x31ef59,_0x18178b,{'revision':_0xdd3d53}),{'verbose':_0x2f1ce7['verbose']}),_0x56b7e3=_0x4e15c3[_0x447c68(0xf3)];return console[_0x447c68(0x197)](_0x447c68(0x1e7)+_0x56b7e3[_0x447c68(0xcd)]),console[_0x447c68(0x197)](_0x447c68(0x163)+_0x56b7e3[_0x447c68(0x19e)]),console[_0x447c68(0x197)](_0x447c68(0xcc)+_0x56b7e3[_0x447c68(0x143)]),console[_0x447c68(0x197)]('\x20\x20Location:\x20'+_0x18178b+'/'+_0x56b7e3[_0x447c68(0xcd)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a42_0x4e63f2(0x234);[a42_0x4e63f2(0x222)]=a42_0x4e63f2(0x181);async[a42_0x4e63f2(0x159)](_0x36e71d){const _0x5f44f2=a42_0x4e63f2,{options:_0x34371f,args:_0x2dbe15,tdx:_0x17f647}=_0x36e71d;let _0xa1bfc7='.',_0x108266=_0x34371f[_0x5f44f2(0x231)];if(_0x2dbe15[0x0]){const {promises:_0x3d8c62}=await import('fs');try{const _0x4492b3=await _0x3d8c62[_0x5f44f2(0x116)](_0x2dbe15[0x0]);if(_0x4492b3[_0x5f44f2(0xff)]())_0xa1bfc7=_0x2dbe15[0x0];else return console[_0x5f44f2(0x197)](_0x5f44f2(0x1b6)+_0x2dbe15[0x0]+_0x5f44f2(0xf2)),0x1;}catch{_0x108266=_0x2dbe15[0x0],_0xa1bfc7='.';}}const _0x35b8a5=_0x34371f[_0x5f44f2(0x19e)],_0x4d702b=_0x34371f[_0x5f44f2(0x1f7)];_0x34371f[_0x5f44f2(0x245)]&&(console['error'](_0x5f44f2(0xc3)+_0xa1bfc7),_0x108266&&console[_0x5f44f2(0x197)](_0x5f44f2(0x12c)+_0x108266),_0x35b8a5&&console['error'](_0x5f44f2(0xb1)+_0x35b8a5),_0x4d702b&&console[_0x5f44f2(0x197)](_0x5f44f2(0x9e)));const _0x429f5f=await withSpinner(_0x5f44f2(0x1fa),()=>_0x17f647['workflow'][_0x5f44f2(0xf7)](_0xa1bfc7,{'projectName':_0x108266,'revision':_0x35b8a5,'skipValidation':_0x4d702b}),{'verbose':_0x34371f[_0x5f44f2(0x245)]}),_0x556299=_0x429f5f[_0x5f44f2(0xf3)];return console[_0x5f44f2(0x197)](_0x5f44f2(0x213)+_0x556299['projectName']),console[_0x5f44f2(0x197)](_0x5f44f2(0x1f5)+_0x556299[_0x5f44f2(0x198)]),console['error'](_0x5f44f2(0x163)+_0x556299[_0x5f44f2(0x19e)]),await this[_0x5f44f2(0x205)](_0x17f647,_0x556299[_0x5f44f2(0xcd)],_0x34371f[_0x5f44f2(0x179)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a42_0x4e63f2(0x231)]='workflow:pull';[a42_0x4e63f2(0x222)]=a42_0x4e63f2(0x1f9);async[a42_0x4e63f2(0x159)](_0x4f6a33){const _0x3f7af1=a42_0x4e63f2,{options:_0x1c77a3,args:_0x86b308,tdx:_0x11be9e}=_0x4f6a33,_0x2eaf95=_0x86b308[0x0],_0x1ada31=_0x86b308[0x1];if(!_0x2eaf95)return console['error'](a42_0x438ef3[_0x3f7af1(0x1b1)](_0x3f7af1(0x1dc)),'Project\x20name\x20is\x20required'),console[_0x3f7af1(0x197)](a42_0x438ef3['dim'](_0x3f7af1(0x208))),0x1;const _0x4aa986=_0x1c77a3[_0x3f7af1(0x19e)];_0x1c77a3[_0x3f7af1(0x245)]&&(console[_0x3f7af1(0x197)]('Project:\x20'+_0x2eaf95),_0x1ada31&&console[_0x3f7af1(0x197)]('Target\x20directory:\x20'+_0x1ada31),_0x4aa986&&console[_0x3f7af1(0x197)](_0x3f7af1(0xb1)+_0x4aa986),_0x1c77a3[_0x3f7af1(0xa8)]&&console[_0x3f7af1(0x197)](_0x3f7af1(0xbd)));const _0x424ed0=await withSpinner(_0x3f7af1(0x157)+_0x2eaf95+'...',()=>_0x11be9e[_0x3f7af1(0xeb)][_0x3f7af1(0x129)](_0x2eaf95,{'targetDir':_0x1ada31,'revision':_0x4aa986}),{'verbose':_0x1c77a3['verbose']}),_0x52e99c=_0x424ed0['data'];_0x52e99c['isNewProject']?console[_0x3f7af1(0x197)]('→\x20New\x20project:\x20'+_0x52e99c[_0x3f7af1(0xcd)]):console['error'](_0x3f7af1(0xde)+_0x52e99c[_0x3f7af1(0xcd)]);console[_0x3f7af1(0x197)](_0x3f7af1(0x163)+_0x52e99c[_0x3f7af1(0x19e)]),console['error'](_0x3f7af1(0x1ec)+(a42_0x28ae41[_0x3f7af1(0x10d)](process[_0x3f7af1(0xda)](),_0x52e99c[_0x3f7af1(0x23a)])||'.')),console[_0x3f7af1(0x197)](_0x3f7af1(0x160)+a42_0x438ef3[_0x3f7af1(0x248)]('+'+_0x52e99c[_0x3f7af1(0x20f)][_0x3f7af1(0x196)]+'\x20new')+',\x20'+(a42_0x438ef3[_0x3f7af1(0x1ce)]('~'+_0x52e99c[_0x3f7af1(0x20f)]['modified']+_0x3f7af1(0xe9))+',\x20')+(a42_0x438ef3['red']('-'+_0x52e99c[_0x3f7af1(0x20f)][_0x3f7af1(0xdb)]+_0x3f7af1(0x18a))+',\x20')+(''+a42_0x438ef3[_0x3f7af1(0x22f)](_0x52e99c[_0x3f7af1(0x20f)]['unchanged']+_0x3f7af1(0xfc))));for(const _0x4ed0f5 of _0x52e99c[_0x3f7af1(0xa5)]){_0x4ed0f5[_0x3f7af1(0x1b4)]===_0x3f7af1(0x20b)&&_0x4ed0f5[_0x3f7af1(0x1a7)]&&(console[_0x3f7af1(0x197)]('\x0a'+a42_0x438ef3[_0x3f7af1(0x175)]('---\x20'+_0x4ed0f5[_0x3f7af1(0x1b7)])),console[_0x3f7af1(0x197)](_0x4ed0f5['diff']));}if(!_0x52e99c[_0x3f7af1(0x192)])return saveSessionContext({'workflow_project':_0x52e99c[_0x3f7af1(0xcd)]},_0x1c77a3[_0x3f7af1(0x15f)]),console[_0x3f7af1(0x197)](a42_0x438ef3[_0x3f7af1(0x248)](_0x3f7af1(0x247))),console[_0x3f7af1(0x197)](a42_0x438ef3[_0x3f7af1(0x22f)](_0x3f7af1(0x223)+_0x52e99c['projectName'])),0x0;if(_0x1c77a3[_0x3f7af1(0xa8)])return console['error'](a42_0x438ef3[_0x3f7af1(0x1ce)](_0x3f7af1(0x10b))),0x0;if(!_0x1c77a3[_0x3f7af1(0x21d)]){if(!isInteractive())return console['error'](a42_0x438ef3[_0x3f7af1(0x1b1)](_0x3f7af1(0xa7)),_0x3f7af1(0x1fb)),console[_0x3f7af1(0x197)](a42_0x438ef3[_0x3f7af1(0x22f)](_0x3f7af1(0x23e))),0x1;const _0x41700f=await confirmKey(_0x3f7af1(0xb4));if(!_0x41700f)return console[_0x3f7af1(0x197)](a42_0x438ef3[_0x3f7af1(0x1ce)](_0x3f7af1(0x1cc)),_0x3f7af1(0x17d)),0x1;}await withSpinner(_0x3f7af1(0x191),()=>_0x11be9e[_0x3f7af1(0xeb)]['applyPullProject'](_0x52e99c,{'revision':_0x4aa986}),{'verbose':_0x1c77a3[_0x3f7af1(0x245)]}),saveSessionContext({'workflow_project':_0x52e99c[_0x3f7af1(0xcd)]},_0x1c77a3[_0x3f7af1(0x15f)]),console[_0x3f7af1(0x197)](a42_0x438ef3[_0x3f7af1(0x248)](_0x3f7af1(0x102)));const _0x194f42=a42_0x28ae41['relative'](process[_0x3f7af1(0xda)](),_0x52e99c['targetDir'])||'.';return console[_0x3f7af1(0x197)](a42_0x438ef3['dim']('\x20\x20Location:\x20'+_0x194f42)),console['error'](a42_0x438ef3[_0x3f7af1(0x22f)](_0x3f7af1(0x223)+_0x52e99c[_0x3f7af1(0xcd)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a42_0x4e63f2(0x231)]=a42_0x4e63f2(0x201);[a42_0x4e63f2(0x222)]=a42_0x4e63f2(0xf5);async[a42_0x4e63f2(0x159)](_0x39cbea){const _0x4f3a5b=a42_0x4e63f2,{options:_0x4b16d3,args:_0x4c2e63,tdx:_0x4cfd71}=_0x39cbea,_0x2150e8=this[_0x4f3a5b(0x17b)](_0x4c2e63,_0x4b16d3),_0x21dcdb=_0x4b16d3[_0x4f3a5b(0x19e)],_0xd770dc=_0x4b16d3[_0x4f3a5b(0x1f7)];_0x4b16d3[_0x4f3a5b(0x245)]&&(_0x2150e8&&console[_0x4f3a5b(0x197)](_0x4f3a5b(0x1d1)+_0x2150e8),_0x21dcdb&&console[_0x4f3a5b(0x197)]('Revision:\x20'+_0x21dcdb),_0x4b16d3[_0x4f3a5b(0xa8)]&&console['error'](_0x4f3a5b(0xbd)),_0xd770dc&&console[_0x4f3a5b(0x197)](_0x4f3a5b(0x9e)));let _0x26a4b2;try{_0x26a4b2=await withSpinner(_0x4f3a5b(0x117),()=>_0x4cfd71[_0x4f3a5b(0xeb)][_0x4f3a5b(0x20a)]({'sourceDir':_0x2150e8,'revision':_0x21dcdb,'skipValidation':_0xd770dc}),{'verbose':_0x4b16d3[_0x4f3a5b(0x245)]});}catch(_0x5ca8c8){if(_0x5ca8c8 instanceof Error&&_0x5ca8c8[_0x4f3a5b(0x165)]['includes']('No\x20workflow\x20tdx.json\x20found'))return console[_0x4f3a5b(0x197)](a42_0x438ef3['red'](_0x4f3a5b(0x1dc)),_0x4f3a5b(0x224)),_0x4b16d3['workflowProject']?console[_0x4f3a5b(0x197)](a42_0x438ef3[_0x4f3a5b(0x22f)](_0x4f3a5b(0x22d)+_0x4b16d3[_0x4f3a5b(0x1ea)]+_0x4f3a5b(0x105)+_0x4b16d3['workflowProject']+'\x27')):console[_0x4f3a5b(0x197)](a42_0x438ef3[_0x4f3a5b(0x22f)](_0x4f3a5b(0x13d))),0x1;throw _0x5ca8c8;}const _0x28401b=_0x26a4b2[_0x4f3a5b(0xf3)];console[_0x4f3a5b(0x197)](_0x4f3a5b(0x1b3)+_0x28401b[_0x4f3a5b(0xcd)]),console[_0x4f3a5b(0x197)](_0x4f3a5b(0x173)+_0x28401b[_0x4f3a5b(0xbf)]),console['error'](_0x4f3a5b(0x163)+_0x28401b[_0x4f3a5b(0x19e)]),console[_0x4f3a5b(0x197)]('\x20\x20Changes:\x20'+a42_0x438ef3['green']('+'+_0x28401b[_0x4f3a5b(0x20f)]['new']+'\x20new')+',\x20'+(a42_0x438ef3[_0x4f3a5b(0x1ce)]('~'+_0x28401b[_0x4f3a5b(0x20f)][_0x4f3a5b(0x20b)]+_0x4f3a5b(0xe9))+',\x20')+(a42_0x438ef3[_0x4f3a5b(0x1b1)]('-'+_0x28401b['summary'][_0x4f3a5b(0xdb)]+_0x4f3a5b(0x18a))+',\x20')+(''+a42_0x438ef3[_0x4f3a5b(0x22f)](_0x28401b[_0x4f3a5b(0x20f)][_0x4f3a5b(0xfa)]+_0x4f3a5b(0xfc))));for(const _0x4e6259 of _0x28401b[_0x4f3a5b(0xa5)]){_0x4e6259['type']==='modified'&&_0x4e6259['diff']&&(console['error']('\x0a'+a42_0x438ef3[_0x4f3a5b(0x175)](_0x4f3a5b(0xae)+_0x4e6259[_0x4f3a5b(0x1b7)])),console['error'](_0x4e6259[_0x4f3a5b(0x1a7)]));}if(!_0x28401b[_0x4f3a5b(0x192)])return console[_0x4f3a5b(0x197)](a42_0x438ef3[_0x4f3a5b(0x248)](_0x4f3a5b(0x106))),await this[_0x4f3a5b(0x205)](_0x4cfd71,_0x28401b[_0x4f3a5b(0xcd)],_0x4b16d3['site']),0x0;if(_0x4b16d3['dryRun'])return console[_0x4f3a5b(0x197)](a42_0x438ef3[_0x4f3a5b(0x1ce)](_0x4f3a5b(0x150))),0x0;if(!_0x4b16d3[_0x4f3a5b(0x21d)]){if(!isInteractive())return console[_0x4f3a5b(0x197)](a42_0x438ef3['red'](_0x4f3a5b(0xa7)),_0x4f3a5b(0x1fb)),console[_0x4f3a5b(0x197)](a42_0x438ef3['dim'](_0x4f3a5b(0x23e))),0x1;const _0x1d6089=await confirmKey(_0x4f3a5b(0x1eb));if(!_0x1d6089)return console[_0x4f3a5b(0x197)](a42_0x438ef3[_0x4f3a5b(0x1ce)](_0x4f3a5b(0x1cc)),'-\x20nothing\x20pushed'),0x1;}const _0x4d1620=await withSpinner(_0x4f3a5b(0x19a),()=>_0x4cfd71[_0x4f3a5b(0xeb)][_0x4f3a5b(0x242)](_0x28401b),{'verbose':_0x4b16d3[_0x4f3a5b(0x245)]}),_0x389ace=_0x4d1620[_0x4f3a5b(0xf3)];return console[_0x4f3a5b(0x197)](a42_0x438ef3['green'](_0x4f3a5b(0x104))),console[_0x4f3a5b(0x197)](_0x4f3a5b(0x1f5)+_0x389ace['projectId']),console['error'](_0x4f3a5b(0x163)+_0x389ace[_0x4f3a5b(0x19e)]),await this[_0x4f3a5b(0x205)](_0x4cfd71,_0x389ace[_0x4f3a5b(0xcd)],_0x4b16d3[_0x4f3a5b(0x179)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a42_0x4e63f2(0x231)]=a42_0x4e63f2(0x1fd);['description']=a42_0x4e63f2(0xa9);async['execute'](_0x68ac7d){const _0x3cb50b=a42_0x4e63f2,{options:_0x3948e2,args:_0x8813dd,tdx:_0x14bd4a}=_0x68ac7d,_0x47fdfc=this[_0x3cb50b(0x17b)](_0x8813dd,_0x3948e2),_0x1c3a31=_0x3948e2[_0x3cb50b(0x231)],_0x343884=_0x3948e2[_0x3cb50b(0x19e)],_0x1acb5e=_0x3948e2[_0x3cb50b(0x1f7)];if(!_0x47fdfc)return console[_0x3cb50b(0x197)](a42_0x438ef3[_0x3cb50b(0x1b1)](_0x3cb50b(0x1dc)),'Source\x20directory\x20is\x20required'),console[_0x3cb50b(0x197)](a42_0x438ef3[_0x3cb50b(0x22f)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x3cb50b(0x197)](a42_0x438ef3['dim']('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x1c3a31)return console[_0x3cb50b(0x197)](a42_0x438ef3[_0x3cb50b(0x1b1)]('Error:'),_0x3cb50b(0x151)),console[_0x3cb50b(0x197)](a42_0x438ef3['dim'](_0x3cb50b(0x1d0))),0x1;_0x3948e2[_0x3cb50b(0x245)]&&(console['error'](_0x3cb50b(0x1d1)+_0x47fdfc),console[_0x3cb50b(0x197)](_0x3cb50b(0x141)+_0x1c3a31),_0x343884&&console[_0x3cb50b(0x197)](_0x3cb50b(0xb1)+_0x343884),_0x3948e2[_0x3cb50b(0xa8)]&&console[_0x3cb50b(0x197)](_0x3cb50b(0xbd)),_0x1acb5e&&console[_0x3cb50b(0x197)](_0x3cb50b(0x9e)));const _0x31cceb=await withSpinner(_0x3cb50b(0xd6),()=>_0x14bd4a[_0x3cb50b(0xeb)]['prepareCloneProject'](_0x47fdfc,_0x1c3a31,{'revision':_0x343884,'skipValidation':_0x1acb5e}),{'verbose':_0x3948e2[_0x3cb50b(0x245)]}),_0x1efeaa=_0x31cceb[_0x3cb50b(0xf3)];console['error']('Source:\x20'+_0x1efeaa[_0x3cb50b(0xbf)]);_0x1efeaa[_0x3cb50b(0xdf)]&&console[_0x3cb50b(0x197)](_0x3cb50b(0x166)+_0x1efeaa[_0x3cb50b(0xdf)]);console[_0x3cb50b(0x197)](_0x3cb50b(0x141)+_0x1efeaa[_0x3cb50b(0x18b)]),console[_0x3cb50b(0x197)](_0x3cb50b(0xb1)+_0x1efeaa[_0x3cb50b(0x19e)]),console['error']('Files\x20to\x20upload:\x20'+_0x1efeaa['fileCount']);_0x1efeaa[_0x3cb50b(0x209)]&&(console[_0x3cb50b(0x197)](a42_0x438ef3[_0x3cb50b(0x1ce)](_0x3cb50b(0x21e)+_0x1efeaa['newProjectName']+_0x3cb50b(0xca)+_0x1efeaa[_0x3cb50b(0x101)]+')')),console[_0x3cb50b(0x197)](a42_0x438ef3[_0x3cb50b(0x1ce)](_0x3cb50b(0x243))));if(_0x3948e2[_0x3cb50b(0xa8)])return console[_0x3cb50b(0x197)](a42_0x438ef3[_0x3cb50b(0x1ce)](_0x3cb50b(0x170))),0x0;if(!_0x3948e2[_0x3cb50b(0x21d)]){if(!isInteractive())return console['error'](a42_0x438ef3['red'](_0x3cb50b(0xa7)),_0x3cb50b(0x1fb)),console[_0x3cb50b(0x197)](a42_0x438ef3[_0x3cb50b(0x22f)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2ed1c0=_0x1efeaa[_0x3cb50b(0xdf)]||a42_0x28ae41[_0x3cb50b(0x1d5)](_0x47fdfc),_0x419570=_0x1efeaa['targetExists']?_0x3cb50b(0xe3)+_0x1c3a31+_0x3cb50b(0x107):_0x3cb50b(0x1c2)+_0x2ed1c0+_0x3cb50b(0xba)+_0x1c3a31+'\x22?',_0x347f37=await confirmKey(_0x419570);if(!_0x347f37)return console[_0x3cb50b(0x197)](a42_0x438ef3[_0x3cb50b(0x1ce)]('Cancelled')),0x1;}const _0xe217dc=await withSpinner(_0x1efeaa['targetExists']?_0x3cb50b(0x16a)+_0x1c3a31+_0x3cb50b(0x21f):_0x3cb50b(0xb2)+_0x1c3a31+_0x3cb50b(0x21f),()=>_0x14bd4a[_0x3cb50b(0xeb)]['executeCloneProject'](_0x1efeaa),{'verbose':_0x3948e2[_0x3cb50b(0x245)]}),_0x4fe8ca=_0xe217dc['data'];return console['error'](a42_0x438ef3[_0x3cb50b(0x248)](_0x1efeaa['targetExists']?'✔\x20Project\x20updated':'✔\x20Clone\x20complete')),console[_0x3cb50b(0x197)](_0x3cb50b(0x15c)+_0x4fe8ca[_0x3cb50b(0x18b)]),console[_0x3cb50b(0x197)](_0x3cb50b(0x1f5)+_0x4fe8ca[_0x3cb50b(0x176)]),console[_0x3cb50b(0x197)]('\x20\x20Revision:\x20'+_0x4fe8ca['revision']),await this[_0x3cb50b(0x205)](_0x14bd4a,_0x4fe8ca['newProjectName'],_0x3948e2[_0x3cb50b(0x179)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a42_0x4e63f2(0x231)]=a42_0x4e63f2(0x178);[a42_0x4e63f2(0x222)]=a42_0x4e63f2(0xd7);async[a42_0x4e63f2(0x159)](_0x5d7dc6){const _0x3c575f=a42_0x4e63f2,{options:_0x9cdf6,args:_0x3932a4,tdx:_0x3e0981}=_0x5d7dc6,_0x2664bb=_0x3932a4[0x0];if(!_0x2664bb)return console['error'](_0x3c575f(0x11e)),console[_0x3c575f(0x197)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x9cdf6['verbose']&&console['error'](_0x3c575f(0x246)+_0x2664bb);if(!_0x9cdf6[_0x3c575f(0x21d)]){if(!isInteractive())return console[_0x3c575f(0x197)](a42_0x438ef3[_0x3c575f(0x1b1)]('\x0aError:'),_0x3c575f(0x1fb)),console[_0x3c575f(0x197)](a42_0x438ef3[_0x3c575f(0x22f)](_0x3c575f(0x23e))),0x1;const _0xaaac82=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x2664bb+_0x3c575f(0xf8));if(!_0xaaac82)return console[_0x3c575f(0x197)](a42_0x438ef3[_0x3c575f(0x1ce)](_0x3c575f(0x1cc))),0x1;}const _0x5eff4b=await withSpinner(_0x3c575f(0x188)+_0x2664bb+_0x3c575f(0x21f),()=>_0x3e0981[_0x3c575f(0xeb)][_0x3c575f(0xe7)](_0x2664bb),{'verbose':_0x9cdf6[_0x3c575f(0x245)]}),_0x155eef=_0x5eff4b[_0x3c575f(0xf3)];return console[_0x3c575f(0x197)](_0x3c575f(0xb9)+_0x155eef['projectName']),console['error'](_0x3c575f(0x1f5)+_0x155eef['projectId']),0x0;}}export function parseKeyValue(_0x20ab18){const _0x3ac3ec=a42_0x4e63f2,_0x58a88f=_0x20ab18[_0x3ac3ec(0x121)]('=');if(_0x58a88f===-0x1)throw new Error(_0x3ac3ec(0x182)+_0x20ab18+_0x3ac3ec(0x18e));const _0x195c93=_0x20ab18['substring'](0x0,_0x58a88f),_0x8979cf=_0x20ab18[_0x3ac3ec(0x161)](_0x58a88f+0x1);if(!_0x195c93)throw new Error(_0x3ac3ec(0x12f));return{'key':_0x195c93,'value':_0x8979cf};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a42_0x4e63f2(0x231)]='workflow:secrets:list';[a42_0x4e63f2(0x222)]=a42_0x4e63f2(0x21b);async[a42_0x4e63f2(0x159)](_0x8a5a9c){const _0x551d00=a42_0x4e63f2,{options:_0x33c4ce,args:_0x5a4776,tdx:_0x362ab3}=_0x8a5a9c,_0x32fa58=this[_0x551d00(0x1de)](_0x5a4776,_0x33c4ce);if(!_0x32fa58)return 0x1;_0x33c4ce['verbose']&&console[_0x551d00(0x197)](_0x551d00(0x246)+_0x32fa58);const _0x18e411=await withSpinner(_0x551d00(0xf4),()=>_0x362ab3[_0x551d00(0xeb)]['listSecrets'](_0x32fa58),{'verbose':_0x33c4ce[_0x551d00(0x245)]}),{secrets:_0x16006b}=_0x18e411[_0x551d00(0xf3)];return console[_0x551d00(0x197)](_0x551d00(0x215)+_0x16006b[_0x551d00(0x220)]+_0x551d00(0xe1)+(_0x16006b['length']!==0x1?'s':'')),await handleSDKOutput(_0x16006b,_0x33c4ce),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a42_0x4e63f2(0x231)]=a42_0x4e63f2(0x238);[a42_0x4e63f2(0x222)]=a42_0x4e63f2(0x1f0);async[a42_0x4e63f2(0x159)](_0x496b36){const _0x543527=a42_0x4e63f2,{options:_0x313078,args:_0xb9ada2,tdx:_0x7af3aa}=_0x496b36;let _0x3eee83,_0x5cc5d5;if(_0xb9ada2[_0x543527(0x220)]>=0x2)_0x3eee83=_0xb9ada2[0x0],_0x5cc5d5=_0xb9ada2[0x1];else{if(_0xb9ada2[_0x543527(0x220)]===0x1&&_0x313078[_0x543527(0x1ea)])_0x3eee83=_0x313078[_0x543527(0x1ea)],_0x5cc5d5=_0xb9ada2[0x0];else return _0xb9ada2[_0x543527(0x220)]===0x1?(console[_0x543527(0x197)](_0x543527(0xdc)),console[_0x543527(0x197)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x543527(0x197)](_0x543527(0x23c)),console[_0x543527(0x197)](_0x543527(0xb5)),0x1);}let _0xcc2b53,_0x51cbff;try{({key:_0xcc2b53,value:_0x51cbff}=parseKeyValue(_0x5cc5d5));}catch(_0x1eb7e7){return _0x1eb7e7 instanceof Error&&console[_0x543527(0x197)](a42_0x438ef3[_0x543527(0x1b1)](_0x543527(0x1dc)),_0x1eb7e7[_0x543527(0x165)]),0x1;}_0x313078['verbose']&&(console['error'](_0x543527(0x246)+_0x3eee83),console[_0x543527(0x197)](_0x543527(0x162)+_0xcc2b53));const _0x2c47ac=await withSpinner(_0x543527(0x174),()=>_0x7af3aa[_0x543527(0xeb)][_0x543527(0x203)](_0x3eee83,_0xcc2b53,_0x51cbff),{'verbose':_0x313078[_0x543527(0x245)]}),_0x2328e3=_0x2c47ac[_0x543527(0xf3)];return console[_0x543527(0x197)]('✔\x20Secret\x20\x27'+_0x2328e3['key']+_0x543527(0x12b)+_0x2328e3['projectName']+'\x27'),(_0x313078['json']||_0x313078[_0x543527(0x148)])&&await handleSingleObjectOutput(_0x2328e3,_0x313078),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a42_0x4e63f2(0x231)]=a42_0x4e63f2(0x1a0);[a42_0x4e63f2(0x222)]=a42_0x4e63f2(0xb7);async[a42_0x4e63f2(0x159)](_0x35ea2b){const _0x552170=a42_0x4e63f2,{options:_0x570d0c,args:_0x2f76db,tdx:_0x1fba66}=_0x35ea2b;let _0x537672,_0x48fb43;if(_0x2f76db[_0x552170(0x220)]>=0x2)_0x537672=_0x2f76db[0x0],_0x48fb43=_0x2f76db[0x1];else{if(_0x2f76db[_0x552170(0x220)]===0x1&&_0x570d0c[_0x552170(0x1ea)])_0x537672=_0x570d0c['workflowProject'],_0x48fb43=_0x2f76db[0x0];else return _0x2f76db[_0x552170(0x220)]===0x1?(console['error']('Error:\x20Project\x20name\x20is\x20required'),console[_0x552170(0x197)](_0x552170(0x210)),0x1):(console['error'](_0x552170(0x21a)),console[_0x552170(0x197)]('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x570d0c[_0x552170(0x245)]&&(console[_0x552170(0x197)]('Project:\x20'+_0x537672),console[_0x552170(0x197)]('Key:\x20'+_0x48fb43));if(!_0x570d0c['yes']){if(!isInteractive())return console[_0x552170(0x197)](a42_0x438ef3[_0x552170(0x1b1)](_0x552170(0xa7)),_0x552170(0x1fb)),console[_0x552170(0x197)](a42_0x438ef3[_0x552170(0x22f)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x538404=await confirmKey(_0x552170(0x14e)+_0x48fb43+_0x552170(0x1b5)+_0x537672+'\x27?');if(!_0x538404)return console[_0x552170(0x197)](a42_0x438ef3[_0x552170(0x1ce)](_0x552170(0x1cc))),0x1;}const _0x41616b=await withSpinner(_0x552170(0x23b),()=>_0x1fba66[_0x552170(0xeb)][_0x552170(0xa6)](_0x537672,_0x48fb43),{'verbose':_0x570d0c[_0x552170(0x245)]}),_0x443416=_0x41616b['data'];return console[_0x552170(0x197)](_0x552170(0x172)+_0x443416[_0x552170(0x11f)]+_0x552170(0xea)+_0x443416[_0x552170(0xcd)]+'\x27'),(_0x570d0c[_0x552170(0x23f)]||_0x570d0c[_0x552170(0x148)])&&await handleSingleObjectOutput(_0x443416,_0x570d0c),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(_0x4442be){const _0x4ce5eb=a42_0x4e63f2,_0x211aaa=Math['floor'](_0x4442be/0x3e8),_0x26f982=Math[_0x4ce5eb(0x187)](_0x211aaa/0x3c),_0x5a834f=Math[_0x4ce5eb(0x187)](_0x26f982/0x3c),_0x2abbd2=Math[_0x4ce5eb(0x187)](_0x5a834f/0x18);if(_0x2abbd2>0x0){const _0xfb9abb=_0x5a834f%0x18;return _0xfb9abb>0x0?_0x2abbd2+'d\x20'+_0xfb9abb+'h':_0x2abbd2+'d';}else{if(_0x5a834f>0x0){const _0x1f1343=_0x26f982%0x3c;return _0x1f1343>0x0?_0x5a834f+'h\x20'+_0x1f1343+'m':_0x5a834f+'h';}else{if(_0x26f982>0x0){const _0x272544=_0x211aaa%0x3c;return _0x272544>0x0?_0x26f982+'m\x20'+_0x272544+'s':_0x26f982+'m';}else return _0x211aaa+'s';}}}function formatTimestamp(_0x348f18,_0x3b31ae){const _0x3b0623=a42_0x4e63f2,_0x7dcc38=new Date(_0x348f18),_0x8fa4db=String(_0x7dcc38[_0x3b0623(0x1e6)]())[_0x3b0623(0x16e)](0x2,'0'),_0x4a69e9=String(_0x7dcc38['getMinutes']())[_0x3b0623(0x16e)](0x2,'0'),_0xa648ce=_0x8fa4db+':'+_0x4a69e9,_0x3ef16d=_0x7dcc38['getFullYear']()===_0x3b31ae[_0x3b0623(0x235)]()&&_0x7dcc38[_0x3b0623(0xdd)]()===_0x3b31ae[_0x3b0623(0xdd)]()&&_0x7dcc38[_0x3b0623(0x13f)]()===_0x3b31ae[_0x3b0623(0x13f)]();if(_0x3ef16d)return _0xa648ce;else{const _0x38bb9e=String(_0x7dcc38['getMonth']()+0x1)[_0x3b0623(0x16e)](0x2,'0'),_0xb9e45d=String(_0x7dcc38['getDate']())[_0x3b0623(0x16e)](0x2,'0');return _0x38bb9e+'-'+_0xb9e45d+'\x20'+_0xa648ce;}}function formatDate(_0x3ea285){const _0x32ce80=a42_0x4e63f2,_0x24c58c=_0x3ea285[_0x32ce80(0x235)](),_0x3dd83d=String(_0x3ea285['getMonth']()+0x1)[_0x32ce80(0x16e)](0x2,'0'),_0x1bdfa9=String(_0x3ea285[_0x32ce80(0x13f)]())['padStart'](0x2,'0');return _0x24c58c+'-'+_0x3dd83d+'-'+_0x1bdfa9;}function getTaskStateIcon(_0x481fa8){const _0x195a9b={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x195a9b[_0x481fa8]||'⚪';}function getBarChar(_0x18a249){const _0x3ff2ae=a42_0x4e63f2;return _0x18a249==='error'||_0x18a249===_0x3ff2ae(0xd2)?'×':'─';}function getBarColor(_0x50e8f4){const _0x29b492=a42_0x4e63f2,_0x24f4b6={'success':a42_0x438ef3[_0x29b492(0x248)],'error':a42_0x438ef3['red'],'group_error':a42_0x438ef3[_0x29b492(0x1b1)],'running':a42_0x438ef3[_0x29b492(0x18c)],'blocked':a42_0x438ef3[_0x29b492(0x1ce)],'planned':a42_0x438ef3[_0x29b492(0x22f)],'canceling':a42_0x438ef3['yellow']};return _0x24f4b6[_0x50e8f4]||a42_0x438ef3[_0x29b492(0x1a6)];}function parseTaskName(_0x57c287){const _0x541844=a42_0x4e63f2;let _0x208dbe=_0x57c287[_0x541844(0x137)](/^\++/,'');const _0x494436=_0x208dbe[_0x541844(0x1d6)]('+'),_0xb281a4=_0x494436[_0x541844(0x220)]>0x1?_0x494436[_0x541844(0x220)]-0x2:0x0,_0x5c4cbf=_0x494436[_0x494436['length']-0x1]||_0x208dbe;return{'level':_0xb281a4,'name':'+'+_0x5c4cbf};}function a42_0x2b0f(){const _0x3c3b3a=['navigateSessionsInteractive','Pushing\x20project...','follow','write','List\x20all\x20workflow\x20projects','revision','trim','workflow:secrets:delete','Pattern:\x20','No\x20workflows\x20found\x20in\x20project:\x20','join','project','resumeFrom','white','diff','Target:\x20','find','splice','LABEL_WIDTH_DIVISOR','\x20session','No\x20sessions\x20found\x20for:\x20','Retry\x20a\x20session\x20or\x20attempt','LABEL_MIN_SPACING','Downloading\x20logs...','red','🔄\x20','✔\x20Project:\x20','type','\x27\x20from\x20project\x20\x27','Error:\x20','path','set','Filter:\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','log','taskName','\x0aPolling...\x20(','Session\x20','4513740BYUUzM','\x20logs','text','\x0aClone\x20\x22','MIN_TIMELINE_WIDTH','sessionId','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','index','\x20\x20Session\x20ID:\x20','planned','createdAt','output','autocomplete','Cancelled','Parameters:\x20','yellow','match','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Source\x20directory:\x20','\x20attempt','List\x20workflows','param','basename','split','map','format','unknown','Loading\x20workflows...','Error:\x20Attempt\x20ID\x20is\x20required','Error:','Show\x20tasks\x20for\x20an\x20attempt','requireProject','workflow:timeline','Error:\x20Invalid\x20parameter\x20format:\x20','updatedAt','isTTY','parseProjectWorkflowPattern','Including\x20subtasks:\x20yes','slice','getHours','✔\x20Downloaded\x20','Downloading\x20project\x20','Start\x20a\x20workflow\x20run','workflowProject','\x0aPush\x20these\x20changes?','\x20\x20Target:\x20','attempt','List\x20workflow\x20execution\x20sessions','workflow:attempt','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','sessions','✔\x20Showing\x20','✔\x20Retry\x20started','Project\x20name\x20is\x20required','\x20\x20Project\x20ID:\x20','\x20project','skipValidation','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Pull\x20workflow\x20project\x20to\x20local\x20folder','Pushing\x20workflow\x20project...','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','fs/promises','workflow:clone','max','\x1b[1A\x1b[2K','fileSize','workflow:push','repeat','setSecret','tdx\x20wf\x20attempt\x20','showWorkflowConsoleUrl','pollTimeline','fromTask','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','targetExists','preparePushProject','modified','Attempt:\x20','title','No\x20workflow\x20projects\x20found','summary','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','\x20(use\x20--limit\x20to\x20show\x20more)','ICON_WIDTH','✔\x20Pushed\x20','5XACzbs','✔\x20Found\x20','Loading\x20sessions...','No\x20projects\x20match\x20pattern:\x20','\x27...','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','Error:\x20Secret\x20key\x20is\x20required','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','fill','yes','\x0a⚠\x20Project\x20\x22','...','length','finishedAt','description','\x20\x20Session\x20context\x20set\x20to:\x20','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','tasks','workflow:run','startedAt','projects','workflow:attempts','Latest\x20session\x20has\x20no\x20attempt','keys','includeRetried','Tip:\x20cd\x20to\x20workflows/','includes','dim','generateSessionTimelineRows','name','revision:\x20','Listing\x20workflow\x20projects...','workflow:upload','getFullYear','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','stdout','workflow:secrets:set','limit','targetDir','Deleting\x20secret...','Error:\x20KEY=VALUE\x20is\x20required','Workflow:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','json','No\x20attempts\x20found\x20for:\x20','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','executePushProject','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','Error:\x20Invalid\x20JSON\x20in\x20--params','verbose','Project:\x20','\x0a✔\x20Already\x20up\x20to\x20date','green','retryAttempt','Validation:\x20skipped','Getting\x20attempt\x20tasks...','lastAttempt','toLowerCase','\x20of\x20','No\x20attempts\x20found','startsWith','changes','deleteSecret','\x0aError:','dryRun','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','Output\x20directory:\x20','Include\x20retried:\x20yes','No\x20matching\x20sessions\x20found','Status:\x20','---\x20','\x20to\x20see\x20detailed\x20logs','No\x20attempts\x20found\x20in\x20project:\x20','Revision:\x20','Cloning\x20to\x20','attemptId','\x0aApply\x20these\x20changes?','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','localeCompare','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Kill\x20a\x20running\x20attempt','✔\x20Deleted\x20project\x20','\x22\x20to\x20new\x20project\x20\x22','task','cancelRequested','Dry\x20run:\x20yes','Force:\x20yes','sourceDir','rows','workflow:tasks','Select\x20a\x20workflow\x20to\x20run','Project\x20directory:\x20','✔\x20Workflow\x20project\x20context\x20cleared.','70136yiyLYF','every','Session\x20not\x20found:\x20','retrySession','session:','\x22\x20already\x20exists\x20(ID:\x20','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','\x20\x20Files\x20extracted:\x20','projectName','\x20workflow','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','parse','✔\x20Workflow\x20project\x20set\x20to:\x20','group_error','\x20\x20Workflow:\x20','\x20\x20Console:\x20','workflow:logs','Analyzing\x20project...','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','6PBoqxp','Getting\x20attempt\x20details...','cwd','deleted','Error:\x20Project\x20name\x20is\x20required','getMonth','→\x20Project:\x20','sourceProjectName','Show\x20specific\x20attempt\x20details','\x20secret','Retrying\x20session...','\x0aUpdate\x20existing\x20project\x20\x22','Listing\x20workflows...','state','Retrying\x20attempt...','delete','Fetching\x20log\x20files...','\x20modified','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','workflow','sessionTime','some','Killing\x20attempt...','From\x20task:\x20','msPerChar','2180787QCzYls','\x20is\x20not\x20a\x20directory','data','Listing\x20secrets...','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','duration','push','\x22?\x20This\x20cannot\x20be\x20undone.','resolveProject','unchanged','window','\x20unchanged','renderSingleTimeline','list','isDirectory','stringify','existingProjectId','✔\x20Pull\x20complete','\x20tasks','✔\x20Push\x20complete','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','\x0a✔\x20No\x20changes\x20to\x20push','\x22\x20with\x20new\x20revision?','\x0a✔\x20Attempt\x20complete','7466KegEMy','Expected\x20format:\x20--param\x20key=value','\x0aDry\x20run\x20-\x20no\x20files\x20written','clear','relative','(unknown)','done','tdx.json','📁\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','POLL_INTERVAL_MS','all','columns','stat','Analyzing\x20changes...','597716kdzQGT','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Select\x20a\x20task\x20to\x20view\x20logs:','run','GUTTER','download','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','key','Attempt\x20ID:\x20','indexOf','context','No\x20workflows\x20found','toISOString','workflow:retry',',\x20Workflow:\x20','Filter:\x20project=','kill','pullProject','MAX_TASKS_DISPLAY','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Project\x20name:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Project\x20filter:\x20','Key\x20cannot\x20be\x20empty','TASK_NAME_WIDTH','workflowName','Show\x20logs\x20for\x20a\x20workflow\x20attempt','9559tovkDs','List\x20workflow\x20attempts','\x20from\x20session\x20','end','replace','\x20has\x20no\x20attempts','renderTimeline','✔\x20Workflow\x20run\x20started','\x20\x20Attempt\x20ID:\x20','utf-8','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','status','getDate','Resolving\x20project\x20\x27','New\x20project\x20name:\x20','startTime','filesExtracted','No\x20sessions\x20with\x20timing\x20information','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','144SpzSFk','No\x20sessions\x20found\x20in\x20project:\x20','jsonl','No\x20sessions\x20found','running','displayLine','icon','workflows','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','workflow:projects','\x0aDry\x20run\x20-\x20nothing\x20pushed','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','now','logFiles','success','min','Task\x20name:\x20','Pulling\x20project\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','execute','filter','Starting\x20workflow\x20run...','\x20\x20Project:\x20','\x20\x20tdx\x20wf\x20use\x20<project>','values','session','\x20\x20Changes:\x20','substring','Key:\x20','\x20\x20Revision:\x20','Listing\x20workflow\x20attempts...','message','Source\x20project:\x20','canceling','resolveProjectId','228197cmiTIQ','Updating\x20','7368eWGyyq','\x20task','params','padStart','buildTimelineData','\x0aDry\x20run\x20-\x20no\x20project\x20created','174ucOeca','✔\x20Secret\x20\x27','\x20\x20Source:\x20','Setting\x20secret...','cyan','newProjectId','\x20sessions\x20','workflow:delete','site','Failed\x20to\x20fetch\x20attempt\x20data','resolveProjectDir','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','-\x20no\x20files\x20written','/app/workflows/','start','sort','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Invalid\x20format:\x20','pending','renderSessionsTimeline','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','workflow:download','floor','Deleting\x20project\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','\x20deleted','newProjectName','blue','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','.\x20Expected\x20format:\x20KEY=VALUE','fullName','\x20-\x20','Writing\x20files...','hasChanges','table','getTime','select','new','error','projectId'];a42_0x2b0f=function(){return _0x3c3b3a;};return a42_0x2b0f();}function truncateTaskName(_0x4fab14,_0xc95e36){const _0x219409=a42_0x4e63f2,_0x577331=stringWidth(_0x4fab14);if(_0x577331<=_0xc95e36)return _0x4fab14;let _0x5d2dae=_0x4fab14;while(stringWidth(_0x5d2dae+'…')>_0xc95e36&&_0x5d2dae[_0x219409(0x220)]>0x0){_0x5d2dae=_0x5d2dae[_0x219409(0x1e5)](0x0,-0x1);}return _0x5d2dae+'…';}function calculateTimeScale(_0x45b79e,_0x3ff39d){const _0x2af8f3=a42_0x4e63f2;return{'startTime':_0x45b79e[_0x2af8f3(0x17f)],'endTime':_0x45b79e[_0x2af8f3(0x136)],'durationMs':_0x45b79e[_0x2af8f3(0xf6)],'msPerChar':_0x45b79e['duration']/_0x3ff39d};}function timeToPosition(_0x3fc9b0,_0x2590f0,_0x20fe60){const _0x19190f=a42_0x4e63f2,_0x48fdbc=_0x3fc9b0-_0x2590f0[_0x19190f(0x142)],_0x2ca115=Math[_0x19190f(0x187)](_0x48fdbc/_0x2590f0[_0x19190f(0xf0)]);return Math['max'](0x0,Math[_0x19190f(0x155)](_0x2ca115,_0x20fe60));}function renderTimeAxis(_0x3fe41b,_0x23677d){const _0x5a396c=a42_0x4e63f2,_0x2cab9c=Math[_0x5a396c(0x155)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x5a396c(0x1fe)](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math[_0x5a396c(0x187)](_0x23677d/TIMELINE_CONFIG[_0x5a396c(0x1ab)]))),_0x855a54=_0x3fe41b['durationMs']/(_0x2cab9c-0x1),_0x359e1a=new Date(_0x3fe41b[_0x5a396c(0x142)]),_0x29169c=[];for(let _0x32eb1e=0x0;_0x32eb1e<_0x2cab9c;_0x32eb1e++){const _0x52e47a=_0x3fe41b[_0x5a396c(0x142)]+_0x32eb1e*_0x855a54,_0x29177b=timeToPosition(_0x52e47a,_0x3fe41b,_0x23677d),_0x596f7d=formatTimestamp(_0x52e47a,_0x359e1a);_0x29169c[_0x5a396c(0xf7)]({'pos':_0x29177b,'text':_0x596f7d});}const _0x3d1486=new Array(_0x23677d)[_0x5a396c(0x21c)]('\x20');let _0x2a5488=-0x1;for(const {pos:_0xba3bea,text:_0x2322a6}of _0x29169c){let _0x34a385=Math[_0x5a396c(0x1fe)](0x0,_0xba3bea-Math[_0x5a396c(0x187)](_0x2322a6[_0x5a396c(0x220)]/0x2));_0x34a385<=_0x2a5488+TIMELINE_CONFIG[_0x5a396c(0x1af)]&&(_0x34a385=_0x2a5488+TIMELINE_CONFIG[_0x5a396c(0x1af)]+0x1);_0x34a385+_0x2322a6[_0x5a396c(0x220)]>_0x23677d&&(_0x34a385=_0x23677d-_0x2322a6[_0x5a396c(0x220)]);if(_0x34a385>=0x0&&_0x34a385+_0x2322a6[_0x5a396c(0x220)]<=_0x23677d&&_0x34a385>_0x2a5488){for(let _0x37a36e=0x0;_0x37a36e<_0x2322a6[_0x5a396c(0x220)];_0x37a36e++){_0x3d1486[_0x34a385+_0x37a36e]=_0x2322a6[_0x37a36e];}_0x2a5488=_0x34a385+_0x2322a6['length']-0x1;}}return _0x3d1486[_0x5a396c(0x1a3)]('');}function renderTaskRow(_0x591b60,_0x230c34,_0x524a38,_0x8d444b){const _0x273036=a42_0x4e63f2,{level:_0x1341b9,name:_0x10ec0c}=parseTaskName(_0x591b60[_0x273036(0x231)]),_0x51b3f1='\x20'[_0x273036(0x202)](_0x1341b9),_0x97f659=_0x591b60[_0x273036(0xfb)]?'('+formatElapsed(_0x591b60['window'][_0x273036(0xf6)])+')':'',_0x47cce0=stringWidth(_0x97f659),_0x4e6e14=_0x1341b9*0x1,_0x280459=_0x8d444b-_0x4e6e14-_0x47cce0-0x1,_0x531699=truncateTaskName(_0x10ec0c,_0x280459),_0x5d5fb5=_0x51b3f1+_0x531699,_0x473f89=stringWidth(_0x5d5fb5),_0x117a5c=_0x8d444b-_0x473f89-_0x47cce0,_0x5f7547=_0x5d5fb5+'\x20'[_0x273036(0x202)](Math[_0x273036(0x1fe)](0x1,_0x117a5c))+a42_0x438ef3[_0x273036(0x22f)](_0x97f659),_0x4f4704=getTaskStateIcon(_0x591b60[_0x273036(0xe5)]),_0x398051=new Array(_0x524a38)[_0x273036(0x21c)]('\x20');if(_0x591b60[_0x273036(0xfb)]){const _0xabf310=timeToPosition(_0x591b60[_0x273036(0xfb)][_0x273036(0x17f)],_0x230c34,_0x524a38),_0x5a7532=timeToPosition(_0x591b60[_0x273036(0xfb)]['end'],_0x230c34,_0x524a38),_0x151c7c=getBarChar(_0x591b60[_0x273036(0xe5)]),_0x47f1ae=Math['max'](_0xabf310+0x1,_0x5a7532);for(let _0x5cd680=_0xabf310;_0x5cd680<Math[_0x273036(0x155)](_0x47f1ae,_0x524a38);_0x5cd680++){_0x398051[_0x5cd680]=_0x151c7c;}}const _0xd0a8d6=getBarColor(_0x591b60[_0x273036(0xe5)]),_0xef9fa8=_0x398051[_0x273036(0x1d7)](_0x41fc3d=>_0x41fc3d==='\x20'?'\x20':_0xd0a8d6(_0x41fc3d))[_0x273036(0x1a3)]('');return _0x4f4704+'\x20'+_0x5f7547+'│'+_0xef9fa8+'│';}function calculateStats(_0x2d8fab){const _0x58db18=a42_0x4e63f2,_0x32b780={'total':_0x2d8fab[_0x58db18(0x220)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x4c3581 of _0x2d8fab){if(_0x4c3581['state']==='success')_0x32b780['success']++;else{if(_0x4c3581[_0x58db18(0xe5)]===_0x58db18(0x197)||_0x4c3581[_0x58db18(0xe5)]===_0x58db18(0xd2))_0x32b780[_0x58db18(0x197)]++;else _0x4c3581[_0x58db18(0xe5)]===_0x58db18(0x14a)?_0x32b780[_0x58db18(0x14a)]++:_0x32b780[_0x58db18(0x183)]++;}}return _0x32b780;}function formatStats(_0x422bbf){const _0x583e92=a42_0x4e63f2;return['Total:\x20'+_0x422bbf['total'],'✅\x20'+_0x422bbf[_0x583e92(0x154)],'❌\x20'+_0x422bbf['error'],_0x583e92(0x1b2)+_0x422bbf[_0x583e92(0x14a)],'⏳\x20'+_0x422bbf['pending']][_0x583e92(0x1a3)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a42_0x4e63f2(0x1df);['description']='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a42_0x4e63f2(0x159)](_0xe3e630){const _0x22e0b0=a42_0x4e63f2,{options:_0x365a40,args:_0x2896d6,tdx:_0x5a1cb6}=_0xe3e630;let _0x1d9af0,_0x30515e,_0x53c839=![];if(_0x2896d6[0x0]){if(_0x2896d6[0x0][_0x22e0b0(0x22e)]('.')){const _0x3a31bf=this[_0x22e0b0(0x1e3)](_0x2896d6,_0x365a40);if(!_0x3a31bf)return 0x1;_0x1d9af0=_0x3a31bf['projectName'],_0x30515e=_0x3a31bf[_0x22e0b0(0x131)];}else{_0x30515e=_0x2896d6[0x0],_0x1d9af0=_0x365a40[_0x22e0b0(0x1ea)];if(!_0x1d9af0)return console['error'](a42_0x438ef3[_0x22e0b0(0x1b1)](_0x22e0b0(0x1dc)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x53c839=!![];}}else{const _0x3411ff=this[_0x22e0b0(0x1e3)](_0x2896d6,_0x365a40);if(!_0x3411ff)return 0x1;_0x1d9af0=_0x3411ff[_0x22e0b0(0xcd)],_0x30515e=_0x3411ff[_0x22e0b0(0x131)];}if(_0x365a40[_0x22e0b0(0x245)]){if(_0x1d9af0&&_0x30515e)console[_0x22e0b0(0x197)](_0x22e0b0(0x1b9)+_0x1d9af0+'.'+_0x30515e);else _0x1d9af0&&console['error'](_0x22e0b0(0x127)+_0x1d9af0);}const _0x2d3cb3=_0x365a40['attemptId'],_0x45b926=_0x365a40[_0x22e0b0(0x1c4)];if(_0x2d3cb3){_0x45b926&&console[_0x22e0b0(0x197)](a42_0x438ef3[_0x22e0b0(0x1ce)]('Warning:'),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0xd9ca69=_0x365a40[_0x22e0b0(0x19b)];return _0xd9ca69?await this['pollTimeline'](_0xe3e630,_0x2d3cb3):await this[_0x22e0b0(0xfd)](_0xe3e630,_0x2d3cb3,_0x365a40),0x0;}if(_0x45b926){const _0x326dcd=await withSpinner('Loading\x20session...',()=>_0x5a1cb6[_0x22e0b0(0xeb)][_0x22e0b0(0x1f1)]({'projectName':_0x1d9af0,'workflowName':_0x30515e,'limit':0x64}),{'verbose':_0x365a40['verbose']}),_0x4f863b=_0x326dcd[_0x22e0b0(0xf3)][_0x22e0b0(0x1a9)](_0x225f47=>_0x225f47['id']===_0x45b926);if(!_0x4f863b)return console[_0x22e0b0(0x197)](a42_0x438ef3[_0x22e0b0(0x1b1)](_0x22e0b0(0x1dc)),_0x22e0b0(0xc7)+_0x45b926),0x1;if(!_0x4f863b['lastAttempt']?.['id'])return console['error'](a42_0x438ef3[_0x22e0b0(0x1b1)]('Error:'),_0x22e0b0(0x1be)+_0x45b926+_0x22e0b0(0x138)),0x1;const _0x364e8b=_0x4f863b[_0x22e0b0(0xa0)]['id'];_0x365a40[_0x22e0b0(0x245)]&&console['error']('Using\x20attempt\x20'+_0x364e8b+_0x22e0b0(0x135)+_0x45b926);const _0x16f50f=_0x365a40['follow'];return _0x16f50f?await this[_0x22e0b0(0x206)](_0xe3e630,_0x364e8b):await this['renderSingleTimeline'](_0xe3e630,_0x364e8b,_0x365a40),0x0;}const _0x1d682a=await withSpinner(_0x22e0b0(0x216),()=>_0x5a1cb6[_0x22e0b0(0xeb)]['sessions']({'projectName':_0x1d9af0,'workflowName':_0x30515e,'limit':_0x365a40[_0x22e0b0(0x239)]||0x32}),{'verbose':_0x365a40[_0x22e0b0(0x245)]}),_0x417967=_0x1d682a[_0x22e0b0(0xf3)];if(_0x417967[_0x22e0b0(0x220)]===0x0){if(_0x1d9af0&&_0x30515e)console['error'](_0x22e0b0(0x1ad)+_0x1d9af0+'.'+_0x30515e);else _0x1d9af0?console[_0x22e0b0(0x197)](_0x22e0b0(0x147)+_0x1d9af0):(console[_0x22e0b0(0x197)]('No\x20workflow\x20sessions\x20found'),console[_0x22e0b0(0x197)](a42_0x438ef3[_0x22e0b0(0x22f)](_0x22e0b0(0x241))));return 0x0;}_0x417967[_0x22e0b0(0x180)]((_0x311f39,_0x49ab6b)=>{const _0x40480c=_0x22e0b0,_0x1367e9=_0x311f39[_0x40480c(0xec)]||'',_0x169938=_0x49ab6b[_0x40480c(0xec)]||'';return _0x169938['localeCompare'](_0x1367e9);});if(_0x365a40[_0x22e0b0(0x23f)]||_0x365a40[_0x22e0b0(0x148)])return await handleSDKOutput(_0x417967,_0x365a40),0x0;let _0x2f27e5;if(_0x53c839){const _0x2b8480=_0x417967[0x0];if(!_0x2b8480[_0x22e0b0(0xa0)]?.['id'])return console[_0x22e0b0(0x197)](_0x22e0b0(0x22a)),0x0;_0x2f27e5=_0x2b8480['lastAttempt']['id'],_0x365a40['verbose']&&console[_0x22e0b0(0x197)]('Auto-selected\x20latest\x20session:\x20'+_0x2b8480[_0x22e0b0(0xec)]);}else{const _0x2d63f2=_0x417967[_0x22e0b0(0x1d7)](_0x5b49a2=>{const _0xf674ba=_0x22e0b0,_0x143d68=getAttemptStatusDisplay(_0x5b49a2['lastAttempt']);return{'title':_0x5b49a2[_0xf674ba(0x1a4)]?.['name']+'.'+_0x5b49a2[_0xf674ba(0xeb)]?.['name']+_0xf674ba(0x190)+_0x5b49a2[_0xf674ba(0xec)]+'\x20'+_0x143d68[_0xf674ba(0x14c)],'value':_0x5b49a2[_0xf674ba(0xa0)]?.['id']||'','description':_0x143d68[_0xf674ba(0x1c1)]};}),_0x5167e6=await a42_0x30fad8({'type':_0x22e0b0(0x195),'name':_0x22e0b0(0xb3),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x2d63f2[_0x22e0b0(0x15a)](_0x469c30=>_0x469c30['value']!=='')});if(!_0x5167e6[_0x22e0b0(0xb3)])return 0x0;_0x2f27e5=_0x5167e6[_0x22e0b0(0xb3)];}const _0x1942d7=_0x365a40[_0x22e0b0(0x19b)];return _0x1942d7?await this[_0x22e0b0(0x206)](_0xe3e630,_0x2f27e5):await this[_0x22e0b0(0xfd)](_0xe3e630,_0x2f27e5,_0x365a40),0x0;}async[a42_0x4e63f2(0xfd)](_0x4db708,_0x1dc257,_0x49d033){const _0x459134=a42_0x4e63f2,{tdx:_0x1391cd}=_0x4db708;let _0x33e158,_0x48080b;try{[_0x33e158,_0x48080b]=await Promise[_0x459134(0x114)]([_0x1391cd[_0x459134(0xeb)][_0x459134(0x1ed)](_0x1dc257),_0x1391cd[_0x459134(0xeb)][_0x459134(0x225)](_0x1dc257,![])]);}catch(_0x2c415f){console[_0x459134(0x197)](a42_0x438ef3['red'](_0x459134(0x17a)));_0x49d033[_0x459134(0x245)]&&console[_0x459134(0x197)](_0x2c415f);throw _0x2c415f;}if(_0x49d033['json']||_0x49d033[_0x459134(0x148)]){const _0x527cf0=this[_0x459134(0x16f)](_0x33e158,_0x48080b);await handleSDKOutput([_0x527cf0],_0x49d033);return;}const _0x191c07=_0x1391cd[_0x459134(0x122)][_0x459134(0x179)],_0x5a2a35=this[_0x459134(0x139)](_0x33e158,_0x48080b,_0x191c07);console[_0x459134(0x1bb)](_0x5a2a35);}async[a42_0x4e63f2(0x206)](_0x331da4,_0x19bf4e){const _0x3df46c=a42_0x4e63f2,{tdx:_0x490d9e}=_0x331da4,_0x1c4282=TIMELINE_CONFIG[_0x3df46c(0x113)],_0x196f91=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x46d613=0x0;while(_0x46d613<_0x196f91){process[_0x3df46c(0x237)]['isTTY']&&process[_0x3df46c(0x237)][_0x3df46c(0x19c)]('\x1bc');let _0x4a17a1,_0x16df53;try{[_0x4a17a1,_0x16df53]=await Promise[_0x3df46c(0x114)]([_0x490d9e[_0x3df46c(0xeb)]['attempt'](_0x19bf4e),_0x490d9e[_0x3df46c(0xeb)][_0x3df46c(0x225)](_0x19bf4e,![])]);}catch(_0x1a511f){console[_0x3df46c(0x197)](a42_0x438ef3[_0x3df46c(0x1b1)]('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x46d613>0x0&&console['error'](a42_0x438ef3[_0x3df46c(0x22f)](_0x3df46c(0xcf)+_0x46d613));throw _0x1a511f;}const _0x3255bc=_0x490d9e[_0x3df46c(0x122)][_0x3df46c(0x179)],_0x29759b=this[_0x3df46c(0x139)](_0x4a17a1,_0x16df53,_0x3255bc);console['log'](_0x29759b);const _0x19cc83=_0x4a17a1[_0x3df46c(0x10f)]&&_0x16df53[_0x3df46c(0xc6)](_0x212607=>_0x212607[_0x3df46c(0xe5)]!==_0x3df46c(0x14a)&&_0x212607[_0x3df46c(0xe5)]!==_0x3df46c(0x1c8));if(_0x19cc83){console[_0x3df46c(0x197)](a42_0x438ef3['green'](_0x3df46c(0x108)));break;}console[_0x3df46c(0x197)](a42_0x438ef3['dim'](_0x3df46c(0x1bd)+_0x46d613*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x82a833=>setTimeout(_0x82a833,_0x1c4282)),_0x46d613++;}_0x46d613>=_0x196f91&&console[_0x3df46c(0x197)](a42_0x438ef3[_0x3df46c(0x1ce)](_0x3df46c(0x185)));}[a42_0x4e63f2(0x139)](_0x1f4d36,_0x12ee55,_0xb66b39){const _0x5849c5=a42_0x4e63f2,_0x3b5011=[],_0x10da7f=TIMELINE_CONFIG[_0x5849c5(0x130)],_0x1ed2e3=0x5,_0x1bf399=process[_0x5849c5(0x237)][_0x5849c5(0x115)]||0x78,_0x1ca822=_0x1bf399-_0x10da7f-_0x1ed2e3,_0x22f07f=Math[_0x5849c5(0x1fe)](TIMELINE_CONFIG[_0x5849c5(0x1c3)],Math[_0x5849c5(0x155)](_0x1ca822,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x2f501f=new Date(_0x1f4d36['createdAt'])['getTime'](),_0x3f5de4=_0x1f4d36['finishedAt']?new Date(_0x1f4d36[_0x5849c5(0x221)])[_0x5849c5(0x194)]():Date[_0x5849c5(0x152)](),_0xefc008={'start':_0x2f501f,'end':_0x3f5de4,'duration':_0x3f5de4-_0x2f501f},_0x4ec0fc=new Map(),_0xff92e4=[];for(const _0x4c8687 of _0x12ee55){if(_0x4c8687[_0x5849c5(0x227)]){const _0x2bce91=new Date(_0x4c8687[_0x5849c5(0x227)])[_0x5849c5(0x194)](),_0x5223b7=_0x4c8687[_0x5849c5(0x1e1)]?new Date(_0x4c8687[_0x5849c5(0x1e1)])[_0x5849c5(0x194)]():Date['now'](),_0x25d772={'start':_0x2bce91,'end':_0x5223b7,'duration':_0x5223b7-_0x2bce91};_0x4ec0fc[_0x5849c5(0x1b8)](_0x4c8687['id'],_0x25d772),_0xff92e4[_0x5849c5(0xf7)]({'name':_0x4c8687['fullName'],'state':_0x4c8687[_0x5849c5(0xe5)]||_0x5849c5(0x1d9),'window':_0x25d772});}else _0xff92e4[_0x5849c5(0xf7)]({'name':_0x4c8687[_0x5849c5(0x18f)],'state':_0x4c8687[_0x5849c5(0xe5)]||'planned','window':undefined});}_0xff92e4[_0x5849c5(0x180)]((_0x226925,_0x4ee14f)=>{const _0x38ae95=_0x5849c5;if(!_0x226925['window'])return 0x1;if(!_0x4ee14f[_0x38ae95(0xfb)])return-0x1;return _0x226925[_0x38ae95(0xfb)][_0x38ae95(0x17f)]-_0x4ee14f[_0x38ae95(0xfb)][_0x38ae95(0x17f)];});const _0x37918d=_0xff92e4[_0x5849c5(0x220)],_0x37e285=_0x37918d>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x37e285&&_0xff92e4[_0x5849c5(0x1aa)](TIMELINE_CONFIG[_0x5849c5(0x12a)]);const _0x2e9658=calculateTimeScale(_0xefc008,_0x22f07f),_0x37a16d=_0x1f4d36['done']?_0x1f4d36['success']?a42_0x438ef3[_0x5849c5(0x248)](_0x5849c5(0x154)):a42_0x438ef3[_0x5849c5(0x1b1)](_0x5849c5(0x197)):a42_0x438ef3[_0x5849c5(0x18c)](_0x5849c5(0x14a)),_0x206d30=_0x1f4d36['project']?.['id'],_0x3ce833=_0x1f4d36['sessionId'];let _0x4299be;if(_0x206d30&&_0x3ce833){const _0x1849bd=getWorkflowAttemptUrl(_0xb66b39,_0x206d30,_0x3ce833,_0x1f4d36['id']);_0x4299be=hyperlink(a42_0x438ef3[_0x5849c5(0x22f)](_0x1f4d36['id']),_0x1849bd);}else _0x4299be=a42_0x438ef3[_0x5849c5(0x22f)](_0x1f4d36['id']);_0x3b5011[_0x5849c5(0xf7)](_0x5849c5(0x20c)+_0x4299be+_0x5849c5(0x190)+_0x37a16d+_0x5849c5(0x190)+formatElapsed(_0xefc008[_0x5849c5(0xf6)]));if(_0xff92e4[_0x5849c5(0x220)]>0x0){const _0x55656f=renderTimeAxis(_0x2e9658,_0x22f07f),_0x240f3d=new Date(_0xefc008['start']),_0xf15c51=formatDate(_0x240f3d),_0x3d5ea2=TIMELINE_CONFIG[_0x5849c5(0x212)]+TIMELINE_CONFIG['ICON_SPACING']+_0x10da7f,_0x45ae89=_0xf15c51[_0x5849c5(0x16e)](_0x3d5ea2),_0x27cae4=a42_0x438ef3[_0x5849c5(0x22f)](_0x45ae89);_0x3b5011['push'](_0x27cae4+'\x20'+_0x55656f);for(const _0x509294 of _0xff92e4){_0x3b5011[_0x5849c5(0xf7)](renderTaskRow(_0x509294,_0x2e9658,_0x22f07f,_0x10da7f));}const _0x3fa0f0=calculateStats(_0xff92e4);_0x3b5011[_0x5849c5(0xf7)](formatStats(_0x3fa0f0)),_0x37e285&&_0x3b5011[_0x5849c5(0xf7)](a42_0x438ef3[_0x5849c5(0x1ce)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0x5849c5(0x12a)]+_0x5849c5(0xa2)+_0x37918d+_0x5849c5(0x103))),_0x3b5011[_0x5849c5(0xf7)](''),_0x3b5011[_0x5849c5(0xf7)](a42_0x438ef3['dim']('💡\x20Tip:\x20Use\x20')+(_0x5849c5(0x204)+_0x1f4d36['id']+_0x5849c5(0x1c0))+a42_0x438ef3['dim'](_0x5849c5(0xaf)));}else _0x3b5011[_0x5849c5(0xf7)](_0x5849c5(0x17c));return _0x3b5011[_0x5849c5(0x1a3)]('\x0a');}[a42_0x4e63f2(0x16f)](_0x46b176,_0x5e26bf){const _0x2cf005=a42_0x4e63f2,_0x34c1b8=new Date(_0x46b176[_0x2cf005(0x1c9)])[_0x2cf005(0x194)](),_0x1b5e7f=_0x46b176[_0x2cf005(0x221)]?new Date(_0x46b176['finishedAt'])[_0x2cf005(0x194)]():Date['now'](),_0x3ffa65=_0x1b5e7f-_0x34c1b8,_0x2aec83=[];for(const _0x134134 of _0x5e26bf){if(_0x134134[_0x2cf005(0x227)]){const _0xbaef3d=new Date(_0x134134[_0x2cf005(0x227)])['getTime'](),_0x14a176=_0x134134[_0x2cf005(0x1e1)]?new Date(_0x134134['updatedAt'])['getTime']():Date[_0x2cf005(0x152)]();_0x2aec83[_0x2cf005(0xf7)]({'name':_0x134134[_0x2cf005(0x18f)],'state':_0x134134['state']||_0x2cf005(0x1d9),'window':{'start':_0xbaef3d,'end':_0x14a176,'duration':_0x14a176-_0xbaef3d}});}else _0x2aec83[_0x2cf005(0xf7)]({'name':_0x134134[_0x2cf005(0x18f)],'state':_0x134134['state']||_0x2cf005(0x1c8),'window':undefined});}const _0x161541=calculateStats(_0x2aec83);return{'attempt':{'id':_0x46b176['id'],'status':_0x46b176[_0x2cf005(0x10f)]?_0x46b176['success']?_0x2cf005(0x154):_0x2cf005(0x197):_0x2cf005(0x14a),'createdAt':_0x46b176[_0x2cf005(0x1c9)],'finishedAt':_0x46b176[_0x2cf005(0x221)],'duration_ms':_0x3ffa65},'tasks':_0x2aec83[_0x2cf005(0x1d7)](_0x55844e=>({'name':_0x55844e[_0x2cf005(0x231)],'state':_0x55844e[_0x2cf005(0xe5)],'startedAt':_0x55844e[_0x2cf005(0xfb)]?new Date(_0x55844e[_0x2cf005(0xfb)][_0x2cf005(0x17f)])[_0x2cf005(0x124)]():null,'updatedAt':_0x55844e[_0x2cf005(0xfb)]?new Date(_0x55844e['window'][_0x2cf005(0x136)])[_0x2cf005(0x124)]():null,'duration_ms':_0x55844e[_0x2cf005(0xfb)]?.[_0x2cf005(0xf6)]||null})),'stats':_0x161541};}}
|
|
1
|
+
const a42_0xc57567=a42_0x15e8;(function(_0x308154,_0x339c18){const _0x209f40=a42_0x15e8,_0x291026=_0x308154();while(!![]){try{const _0x41cc86=-parseInt(_0x209f40(0x291))/0x1+parseInt(_0x209f40(0x33e))/0x2*(parseInt(_0x209f40(0x28a))/0x3)+parseInt(_0x209f40(0x35a))/0x4+-parseInt(_0x209f40(0x2c0))/0x5+parseInt(_0x209f40(0x246))/0x6+-parseInt(_0x209f40(0x288))/0x7*(-parseInt(_0x209f40(0x2e3))/0x8)+-parseInt(_0x209f40(0x373))/0x9*(parseInt(_0x209f40(0x393))/0xa);if(_0x41cc86===_0x339c18)break;else _0x291026['push'](_0x291026['shift']());}catch(_0x374fce){_0x291026['push'](_0x291026['shift']());}}}(a42_0x4a1f,0x6f2d1));import a42_0x28d120 from'chalk';import{existsSync}from'fs';import a42_0x4c5f63 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a42_0x4fae from'prompts';function getAttemptStatusDisplay(_0x4588ce){const _0x4ed782=a42_0x15e8;if(!_0x4588ce)return{'icon':'⏳','text':''};const {done:_0x52bc50,success:_0x4e838e,cancelRequested:_0x2e643a}=_0x4588ce;if(!_0x52bc50)return _0x2e643a?{'icon':'🛑','text':a42_0x28d120[_0x4ed782(0x2a1)]('canceling')}:{'icon':'🔄','text':a42_0x28d120[_0x4ed782(0x1fd)](_0x4ed782(0x272))};if(_0x4e838e)return{'icon':'✅','text':a42_0x28d120[_0x4ed782(0x382)](_0x4ed782(0x32b))};return{'icon':'❌','text':a42_0x28d120['red'](_0x4ed782(0x343))};}export class WorkflowBaseCommand extends BaseCommand{[a42_0xc57567(0x247)](_0x2789ef,_0x334e97,_0x4a7f31=0x0){const _0x2ce1d6=a42_0xc57567;return _0x2789ef[_0x4a7f31]||_0x334e97[_0x2ce1d6(0x220)];}[a42_0xc57567(0x2e6)](_0x273415,_0x52586c,_0x5a329d=0x0){const _0x50dbfb=a42_0xc57567,_0x443f0e=this[_0x50dbfb(0x247)](_0x273415,_0x52586c,_0x5a329d);if(!_0x443f0e)return console['error'](a42_0x28d120['red'](_0x50dbfb(0x2c8)),_0x50dbfb(0x383)),console[_0x50dbfb(0x343)](a42_0x28d120[_0x50dbfb(0x307)](_0x50dbfb(0x2e9))),null;return _0x443f0e;}[a42_0xc57567(0x323)](_0x36a559,_0x24411d){const _0x3722c8=a42_0xc57567;if(_0x36a559[0x0]){const _0x2154ad=_0x36a559[0x0][_0x3722c8(0x294)]('.');if(_0x2154ad[_0x3722c8(0x22b)]===0x1)return{'projectName':_0x2154ad[0x0],'workflowName':undefined};else return _0x2154ad[_0x3722c8(0x22b)]===0x2?{'projectName':_0x2154ad[0x0],'workflowName':_0x2154ad[0x1]}:(console['error'](a42_0x28d120[_0x3722c8(0x356)](_0x3722c8(0x2c8)),_0x3722c8(0x224)),null);}return{'projectName':_0x24411d[_0x3722c8(0x220)],'workflowName':undefined};}[a42_0xc57567(0x2de)](_0x309399,_0x138e0c,_0x48c265=0x0){const _0x5e9624=a42_0xc57567;if(_0x309399[_0x48c265])return _0x309399[_0x48c265];if(_0x138e0c[_0x5e9624(0x220)]){const _0x43bae4=a42_0x4c5f63['join'](process['cwd'](),_0x5e9624(0x34d),_0x138e0c[_0x5e9624(0x220)]);if(existsSync(a42_0x4c5f63['join'](_0x43bae4,_0x5e9624(0x2c6))))return _0x43bae4;}return undefined;}async[a42_0xc57567(0x2be)](_0x187d5f,_0x48b26f,_0x3c084d){const _0xc9c78f=a42_0xc57567;try{const _0x5c82bc=await _0x187d5f[_0xc9c78f(0x2da)][_0xc9c78f(0x34d)](_0x48b26f,{'limit':0x1});if(_0x5c82bc[_0xc9c78f(0x22b)]>0x0){const _0x5d821c=_0x5c82bc[0x0]['id'],_0x3f3afe=getWorkflowUrl(_0x3c084d,_0x5d821c);console[_0xc9c78f(0x343)](_0xc9c78f(0x2c4)+a42_0x28d120['cyan'](_0x3f3afe));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x244);[a42_0xc57567(0x371)]=a42_0xc57567(0x257);async[a42_0xc57567(0x2dc)](_0x1b3c80){const _0x1cfd22=a42_0xc57567,{options:_0x454575,args:_0x333ddc,tdx:_0x2823cf}=_0x1b3c80,_0x123607=_0x333ddc[0x0],_0x1499b8=_0x454575[_0x1cfd22(0x298)];if(_0x1499b8)return saveSessionContext({'workflow_project':undefined},_0x454575['session']),console['log'](a42_0x28d120[_0x1cfd22(0x382)](_0x1cfd22(0x23e))),0x0;if(!_0x123607)return console[_0x1cfd22(0x343)](a42_0x28d120['red'](_0x1cfd22(0x2c8)),'Project\x20name\x20is\x20required'),console[_0x1cfd22(0x343)](a42_0x28d120['dim'](_0x1cfd22(0x2e4))),console['error'](a42_0x28d120[_0x1cfd22(0x307)](_0x1cfd22(0x1ff))),0x1;const _0x1aabb6=await withSpinner(_0x1cfd22(0x23b)+_0x123607+'\x27...',()=>_0x2823cf[_0x1cfd22(0x2da)][_0x1cfd22(0x27b)](_0x123607),{'verbose':_0x454575[_0x1cfd22(0x250)]}),{name:_0x1f5516}=_0x1aabb6[_0x1cfd22(0x201)];return saveSessionContext({'workflow_project':_0x1f5516},_0x454575[_0x1cfd22(0x317)]),console['log'](a42_0x28d120[_0x1cfd22(0x382)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a42_0x28d120['cyan'](_0x1f5516))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a42_0xc57567(0x2ce);['description']=a42_0xc57567(0x275);async[a42_0xc57567(0x2dc)](_0xcd6c65){const _0xae4642=a42_0xc57567,{options:_0x3650de,args:_0x45ee93,tdx:_0x421495}=_0xcd6c65,_0x11657a=_0x45ee93[0x0];_0x3650de[_0xae4642(0x250)]&&_0x11657a&&console[_0xae4642(0x343)]('Pattern:\x20'+_0x11657a);const _0x3572a9=await withSpinner(_0xae4642(0x217),()=>_0x421495[_0xae4642(0x2da)][_0xae4642(0x2ed)](_0x11657a,{'limit':_0x3650de[_0xae4642(0x22d)]}),{'verbose':_0x3650de[_0xae4642(0x250)]});let _0x37fffc=_0x3572a9['data'];_0x37fffc['sort']((_0x50348e,_0x130049)=>_0x50348e['name'][_0xae4642(0x2f1)](_0x130049[_0xae4642(0x331)]));const _0x29c81a=_0x3650de[_0xae4642(0x22d)]||0x64,_0x3a178d=_0x37fffc['length']>=_0x29c81a?a42_0x28d120['dim'](_0xae4642(0x301)):'';console[_0xae4642(0x343)](_0xae4642(0x36f)+_0x37fffc[_0xae4642(0x22b)]+_0xae4642(0x221)+(_0x37fffc[_0xae4642(0x22b)]!==0x1?'s':'')+_0x3a178d);if(_0x3650de[_0xae4642(0x24b)]===_0xae4642(0x1fc)||_0x3650de[_0xae4642(0x24b)]===_0xae4642(0x39a)||_0x3650de[_0xae4642(0x24b)]===_0xae4642(0x39e))await handleSDKOutput(_0x37fffc,_0x3650de);else{if(_0x37fffc[_0xae4642(0x22b)]===0x0)_0x11657a?console[_0xae4642(0x385)](_0xae4642(0x303)+_0x11657a):console[_0xae4642(0x385)]('No\x20workflow\x20projects\x20found');else{const _0x3386b0=_0x37fffc[_0xae4642(0x27a)](_0x1844b9=>{const _0x61694c=_0xae4642,_0x2adc19=_0x1844b9[_0x61694c(0x286)]?.['some'](_0x203029=>_0x203029['key']===_0x61694c(0x228)),_0x55c5f1=_0x2adc19?a42_0x28d120[_0x61694c(0x307)](_0x61694c(0x314)):'';return'📁\x20'+_0x1844b9[_0x61694c(0x331)]+_0x55c5f1;});await writeOutput(_0x3386b0[_0xae4642(0x238)]('\x0a'),_0x3650de[_0xae4642(0x209)],_0xae4642(0x233));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x397);['description']='List\x20workflows';async['execute'](_0x2f01f3){const _0x146346=a42_0xc57567,{options:_0x41a009,args:_0x52bed3,tdx:_0x1bf77d}=_0x2f01f3,_0x484a79=this[_0x146346(0x247)](_0x52bed3,_0x41a009);_0x41a009['verbose']&&_0x484a79&&console[_0x146346(0x343)]('Project\x20filter:\x20'+_0x484a79);const _0x55848d=await withSpinner(_0x146346(0x254),()=>_0x1bf77d[_0x146346(0x2da)][_0x146346(0x34d)](_0x484a79,{'limit':_0x41a009[_0x146346(0x22d)]}),{'verbose':_0x41a009[_0x146346(0x250)]});let _0x3cb024=_0x55848d[_0x146346(0x201)];_0x3cb024[_0x146346(0x208)]((_0x5abb14,_0x2127c4)=>{const _0x3ae55e=_0x146346,_0x43177a=_0x5abb14['name'][_0x3ae55e(0x2f1)](_0x2127c4[_0x3ae55e(0x331)]);if(_0x43177a!==0x0)return _0x43177a;return(_0x5abb14[_0x3ae55e(0x296)]?.['name']||'')[_0x3ae55e(0x2f1)](_0x2127c4[_0x3ae55e(0x296)]?.[_0x3ae55e(0x331)]||'');});const _0x1b38cb=_0x41a009[_0x146346(0x22d)]||0x64,_0x4a491f=_0x3cb024[_0x146346(0x22b)]>=_0x1b38cb?a42_0x28d120[_0x146346(0x307)](_0x146346(0x301)):'';console['error'](_0x146346(0x36f)+_0x3cb024[_0x146346(0x22b)]+_0x146346(0x2dd)+(_0x3cb024['length']!==0x1?'s':'')+_0x4a491f);if(_0x41a009[_0x146346(0x24b)]===_0x146346(0x1fc)||_0x41a009['format']===_0x146346(0x39a)||_0x41a009['format']==='table')await handleSDKOutput(_0x3cb024,_0x41a009);else{if(_0x3cb024['length']===0x0)_0x484a79?console[_0x146346(0x385)](_0x146346(0x35b)+_0x484a79):console['log'](_0x146346(0x26b));else{const _0x5222cc=_0x41a009[_0x146346(0x31d)],_0x52ebbe=_0x3cb024[_0x146346(0x27a)](_0x11d599=>{const _0x1f01da=_0x146346,_0x47b307=a42_0x28d120[_0x1f01da(0x307)]('#'+_0x11d599['id']),_0xf457a3=hyperlink(_0x47b307,getWorkflowUrl(_0x5222cc,_0x11d599['id'])),_0x44d407=_0x11d599[_0x1f01da(0x296)]?.[_0x1f01da(0x331)]?a42_0x28d120[_0x1f01da(0x307)]('\x20('+_0x11d599[_0x1f01da(0x296)][_0x1f01da(0x331)]+')'):'';return _0x1f01da(0x2d9)+_0xf457a3+'\x20'+_0x11d599[_0x1f01da(0x331)]+_0x44d407;});await writeOutput(_0x52ebbe[_0x146346(0x238)]('\x0a'),_0x41a009[_0x146346(0x209)],_0x146346(0x233));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x2b0);[a42_0xc57567(0x371)]=a42_0xc57567(0x292);async[a42_0xc57567(0x2dc)](_0x22a5ac){const _0x20800d=a42_0xc57567,{options:_0x15d702,args:_0x5ee259,tdx:_0x296883}=_0x22a5ac,_0x34fe89=this['parseProjectWorkflowPattern'](_0x5ee259,_0x15d702);if(!_0x34fe89)return 0x1;const {projectName:_0x45d7c8,workflowName:_0x514e98}=_0x34fe89;if(_0x15d702[_0x20800d(0x250)]){if(_0x45d7c8&&_0x514e98)console['error'](_0x20800d(0x2ef)+_0x45d7c8+'.'+_0x514e98);else _0x45d7c8&&console[_0x20800d(0x343)](_0x20800d(0x2b4)+_0x45d7c8);const _0x384196=_0x15d702[_0x20800d(0x2ea)];_0x384196&&console['error']('Status:\x20'+_0x384196);}let _0x12d373=0x28;if(process[_0x20800d(0x297)][_0x20800d(0x24d)]&&!_0x15d702[_0x20800d(0x209)]&&!_0x15d702[_0x20800d(0x24b)]){const _0x1f1fc6=process[_0x20800d(0x297)][_0x20800d(0x218)]||0x28;_0x12d373=Math[_0x20800d(0x30f)](0x14,Math[_0x20800d(0x347)](_0x1f1fc6*0x2/0x3));}const _0x2b2264=_0x15d702[_0x20800d(0x22d)]||_0x12d373,_0x338edb=await withSpinner(_0x20800d(0x211),()=>_0x296883[_0x20800d(0x2da)][_0x20800d(0x2d4)]({'projectName':_0x45d7c8,'workflowName':_0x514e98,'status':_0x15d702[_0x20800d(0x2ea)],'fromTime':_0x15d702['from'],'toTime':_0x15d702['to'],'limit':_0x2b2264}),{'verbose':_0x15d702[_0x20800d(0x250)]}),_0x5698af=_0x338edb[_0x20800d(0x201)];_0x5698af[_0x20800d(0x208)]((_0x37070c,_0x5ce3e1)=>{const _0x1dd0b1=_0x20800d,_0x4773d4=_0x37070c[_0x1dd0b1(0x24f)]||'',_0x18a78b=_0x5ce3e1[_0x1dd0b1(0x24f)]||'';return _0x18a78b[_0x1dd0b1(0x2f1)](_0x4773d4);});_0x5698af[_0x20800d(0x22b)]>=_0x2b2264?console[_0x20800d(0x343)]('✔\x20Showing\x20'+_0x5698af['length']+'\x20sessions\x20'+a42_0x28d120['dim'](_0x20800d(0x339))):console['error'](_0x20800d(0x36f)+_0x5698af[_0x20800d(0x22b)]+'\x20session'+(_0x5698af['length']!==0x1?'s':''));if(_0x15d702[_0x20800d(0x24b)]===_0x20800d(0x1fc)||_0x15d702['format']===_0x20800d(0x39a)||_0x15d702[_0x20800d(0x24b)]===_0x20800d(0x39e))await handleSDKOutput(_0x5698af,_0x15d702);else{if(!process[_0x20800d(0x297)]['isTTY']||_0x15d702[_0x20800d(0x209)]){if(_0x5698af[_0x20800d(0x22b)]===0x0){if(_0x45d7c8&&_0x514e98)console[_0x20800d(0x385)]('No\x20sessions\x20found\x20for:\x20'+_0x45d7c8+'.'+_0x514e98);else _0x45d7c8?console[_0x20800d(0x385)](_0x20800d(0x32a)+_0x45d7c8):console[_0x20800d(0x385)](_0x20800d(0x243));}else{const _0x1161d9=_0x15d702[_0x20800d(0x31d)],_0x3e8ff7=this[_0x20800d(0x23a)](_0x5698af,_0x1161d9);_0x15d702[_0x20800d(0x209)]?await writeOutput(_0x3e8ff7,_0x15d702[_0x20800d(0x209)],_0x20800d(0x233)):console[_0x20800d(0x385)](_0x3e8ff7);}!_0x45d7c8&&(console[_0x20800d(0x343)](''),console[_0x20800d(0x343)](a42_0x28d120[_0x20800d(0x307)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console['error'](a42_0x28d120[_0x20800d(0x307)](_0x20800d(0x34e))+'or'+a42_0x28d120[_0x20800d(0x307)](_0x20800d(0x37c))));}else{if(_0x5698af[_0x20800d(0x22b)]===0x0){if(_0x45d7c8&&_0x514e98)console[_0x20800d(0x385)](_0x20800d(0x269)+_0x45d7c8+'.'+_0x514e98);else _0x45d7c8?console[_0x20800d(0x385)](_0x20800d(0x32a)+_0x45d7c8):console['log'](_0x20800d(0x243));}else await this['navigateSessionsInteractive'](_0x5698af,_0x22a5ac,_0x45d7c8);}}return 0x0;}[a42_0xc57567(0x23a)](_0x1373bd,_0x4ae897){const _0x21cacf=a42_0xc57567,_0x4356b3=[],_0x1d2144=new Map();let _0x4842c5=Infinity,_0x1b85f9=-Infinity;for(const _0xa4101 of _0x1373bd){if(_0xa4101['lastAttempt']?.[_0x21cacf(0x2ac)]){const _0xf5af27=new Date(_0xa4101[_0x21cacf(0x2a9)][_0x21cacf(0x2ac)])['getTime'](),_0x5f3c4a=_0xa4101[_0x21cacf(0x2a9)][_0x21cacf(0x23f)]?new Date(_0xa4101[_0x21cacf(0x2a9)][_0x21cacf(0x23f)])[_0x21cacf(0x2e8)]():Date[_0x21cacf(0x2c1)](),_0x2c395e=_0xa4101[_0x21cacf(0x296)]?.[_0x21cacf(0x331)]||_0x21cacf(0x2df);!_0x1d2144[_0x21cacf(0x34a)](_0x2c395e)&&_0x1d2144[_0x21cacf(0x25a)](_0x2c395e,[]),_0x1d2144[_0x21cacf(0x2c3)](_0x2c395e)['push']({'session':_0xa4101,'startTime':_0xf5af27,'endTime':_0x5f3c4a,'duration':_0x5f3c4a-_0xf5af27}),_0x4842c5=Math[_0x21cacf(0x232)](_0x4842c5,_0xf5af27),_0x1b85f9=Math[_0x21cacf(0x30f)](_0x1b85f9,_0x5f3c4a);}}if(_0x1d2144[_0x21cacf(0x33d)]===0x0)return _0x21cacf(0x2ec);const _0x1cbafa=process[_0x21cacf(0x297)][_0x21cacf(0x350)]||0x78,_0x9dd6aa=0x1e,_0x370faa=0x32,_0x38fcc=0x4,_0x5d8269=Math[_0x21cacf(0x232)](_0x370faa,Math[_0x21cacf(0x30f)](_0x9dd6aa,Math[_0x21cacf(0x347)](_0x1cbafa*0.3))),_0x43ab95=_0x1cbafa-_0x5d8269-TIMELINE_CONFIG['GUTTER']-0x3-_0x38fcc,_0x4363f3=_0x1b85f9-_0x4842c5,_0x29adf9=_0x4363f3/_0x5d8269,_0x259153=renderTimeAxis({'startTime':_0x4842c5,'endTime':_0x1b85f9,'durationMs':_0x4363f3,'msPerChar':_0x29adf9},_0x5d8269),_0x3c73e5=[];for(const _0x49e645 of _0x1d2144[_0x21cacf(0x387)]()){_0x3c73e5[_0x21cacf(0x2c5)](..._0x49e645);}_0x3c73e5['sort']((_0x4656c2,_0x477adf)=>_0x477adf['startTime']-_0x4656c2[_0x21cacf(0x205)]);const _0x6eea9d=new Date(_0x4842c5),_0x1a1630=formatDate(_0x6eea9d),_0xd507f7=_0x38fcc+TIMELINE_CONFIG[_0x21cacf(0x360)]+TIMELINE_CONFIG[_0x21cacf(0x27e)]+_0x43ab95,_0x248fd0='\x20'[_0x21cacf(0x335)](_0xd507f7-_0x1a1630[_0x21cacf(0x22b)]),_0x401460=_0x248fd0+a42_0x28d120[_0x21cacf(0x307)](_0x1a1630)+'\x20'+_0x259153;_0x4356b3['push'](_0x401460);const _0x1bb44c=0x16;let _0x2c6262=0x0;for(const _0x55be63 of _0x3c73e5){const _0x34d730=_0x55be63[_0x21cacf(0x317)][_0x21cacf(0x296)]?.[_0x21cacf(0x331)]||'?',_0x22d543=Math[_0x21cacf(0x232)](stringWidth(_0x34d730),_0x1bb44c);_0x2c6262=Math[_0x21cacf(0x30f)](_0x2c6262,_0x22d543);}for(const _0x17444a of _0x3c73e5){const {session:_0x5888cd,startTime:_0x170225,endTime:_0xedeed1,duration:_0x121e79}=_0x17444a,_0x1532ed=_0x5888cd[_0x21cacf(0x296)]?.['id'],_0x57dfb4=_0x5888cd['id'],_0x2c9e69=_0x5888cd[_0x21cacf(0x296)]?.[_0x21cacf(0x331)]||'?',_0x812677=_0x5888cd[_0x21cacf(0x2da)]?.[_0x21cacf(0x331)]||'?';let _0x3536de,_0x1bc776;if(_0x5888cd[_0x21cacf(0x2a9)]){const _0x17ef38=_0x5888cd[_0x21cacf(0x2a9)];!_0x17ef38['done']?(_0x3536de=_0x17ef38[_0x21cacf(0x398)]?'🛑':'🔄',_0x1bc776=_0x17ef38[_0x21cacf(0x398)]?a42_0x28d120[_0x21cacf(0x2a1)]:a42_0x28d120[_0x21cacf(0x1fd)]):(_0x3536de=_0x17ef38[_0x21cacf(0x32b)]?'✅':'❌',_0x1bc776=_0x17ef38[_0x21cacf(0x32b)]?a42_0x28d120[_0x21cacf(0x382)]:a42_0x28d120[_0x21cacf(0x356)]);}else _0x3536de='⏳',_0x1bc776=a42_0x28d120['dim'];const _0x246f67='#'+_0x57dfb4,_0x1f116d=_0x1532ed?hyperlink(_0x246f67,getWorkflowSessionUrl(_0x4ae897,_0x1532ed,_0x57dfb4)):_0x246f67;let _0x409c13=_0x2c9e69;stringWidth(_0x2c9e69)>_0x1bb44c&&(_0x409c13=_0x2c9e69[_0x21cacf(0x273)](0x0,_0x1bb44c-0x1)+'…');const _0x513870=a42_0x28d120[_0x21cacf(0x307)](_0x409c13),_0x58d08d=stringWidth(_0x409c13),_0x2b2246='\x20'[_0x21cacf(0x335)](_0x2c6262-stringWidth(_0x409c13)+0x2),_0x4160d8='('+formatElapsed(_0x121e79)+')',_0x5f472d=stringWidth(_0x4160d8),_0x2063f5=stringWidth(_0x246f67),_0x4cf9a7=_0x2063f5+0x1+_0x58d08d+_0x2b2246[_0x21cacf(0x22b)],_0x9e273a=_0x43ab95-_0x4cf9a7-_0x5f472d-0x1-0x8;let _0x391a76=_0x812677;stringWidth(_0x391a76)>_0x9e273a&&(_0x391a76=_0x391a76['slice'](0x0,_0x9e273a-0x1)+'…');const _0x4602f5=_0x1f116d+'\x20'+_0x513870+_0x2b2246+_0x391a76,_0x8b58f2=stringWidth(_0x4602f5),_0x326f91=_0x43ab95-_0x8b58f2-_0x5f472d,_0x23cd2d=_0x4602f5+'\x20'[_0x21cacf(0x335)](Math[_0x21cacf(0x30f)](0x1,_0x326f91))+a42_0x28d120['dim'](_0x4160d8),_0x5ccdeb=Math[_0x21cacf(0x347)]((_0x170225-_0x4842c5)/_0x29adf9),_0x3ca8ce=Math['floor']((_0xedeed1-_0x4842c5)/_0x29adf9),_0x3b4927=Math[_0x21cacf(0x30f)](_0x5ccdeb+0x1,_0x3ca8ce),_0x5ce6bd=new Array(_0x5d8269)[_0x21cacf(0x261)]('\x20');for(let _0x10b69a=_0x5ccdeb;_0x10b69a<Math[_0x21cacf(0x232)](_0x3b4927,_0x5d8269);_0x10b69a++){_0x5ce6bd[_0x10b69a]='─';}const _0x1ff4f2=_0x5ce6bd[_0x21cacf(0x27a)](_0x37c886=>_0x37c886==='\x20'?'\x20':_0x1bc776(_0x37c886))[_0x21cacf(0x238)]('');_0x4356b3[_0x21cacf(0x2c5)](_0x3536de+'\x20'+_0x23cd2d+'│'+_0x1ff4f2+'│');}return _0x4356b3[_0x21cacf(0x238)]('\x0a');}async[a42_0xc57567(0x32f)](_0x681e71,_0x579721,_0x2f4ed3){const _0x451bc2=a42_0xc57567,{options:_0x3db90a,tdx:_0x2d8ebb}=_0x579721,_0x43d305=_0x3db90a['site'],{timelineRows:_0x27970e,timeAxisHeader:_0x239c75}=this[_0x451bc2(0x2ee)](_0x681e71,_0x43d305),_0x155fd0=_0x27970e[_0x451bc2(0x36b)](_0xc83e16=>_0xc83e16[_0x451bc2(0x270)]);if(_0x155fd0['length']===0x0){const _0x354113=this[_0x451bc2(0x23a)](_0x681e71,_0x43d305);console[_0x451bc2(0x385)](_0x354113);!_0x2f4ed3&&(console[_0x451bc2(0x343)](''),console[_0x451bc2(0x343)](a42_0x28d120[_0x451bc2(0x307)](_0x451bc2(0x1fe))),console[_0x451bc2(0x343)](a42_0x28d120[_0x451bc2(0x307)](_0x451bc2(0x34e))+'or'+a42_0x28d120[_0x451bc2(0x307)](_0x451bc2(0x37c))));return;}_0x239c75&&console['log'](_0x239c75);const _0x2f5fe5=_0x27970e[_0x451bc2(0x36b)](_0x2b9f79=>_0x2b9f79[_0x451bc2(0x270)])[_0x451bc2(0x27a)](_0x228772=>({'title':_0x228772[_0x451bc2(0x372)],'value':_0x228772[_0x451bc2(0x270)]})),_0x11bb02=process[_0x451bc2(0x297)][_0x451bc2(0x218)]||0x3c,_0xc42a1f=Math[_0x451bc2(0x30f)](0x28,Math['floor'](_0x11bb02*0x2/0x3)),_0x5b1d4a=await a42_0x4fae({'type':_0x451bc2(0x352),'name':_0x451bc2(0x270),'message':_0x451bc2(0x2d1),'choices':_0x2f5fe5,'initial':-0x1,'limit':_0xc42a1f,'clearFirst':!![],'fallback':{'title':_0x451bc2(0x2a6),'value':null},'suggest':(_0x5e704b,_0x5f07dc)=>{const _0x510758=_0x451bc2;if(!_0x5e704b)return Promise[_0x510758(0x310)](_0x5f07dc);const _0x50e8a0=_0x5f07dc[_0x510758(0x36b)](_0xfebec2=>{const _0x148200=_0x510758,_0x38a0bf=_0xfebec2;return _0x38a0bf[_0x148200(0x334)][_0x148200(0x279)]()[_0x148200(0x26d)](_0x5e704b[_0x148200(0x279)]());});return Promise[_0x510758(0x310)](_0x50e8a0);}}),_0x1255aa=()=>{const _0x1f7812=_0x451bc2;process[_0x1f7812(0x297)][_0x1f7812(0x268)](_0x1f7812(0x289)),process['stdout'][_0x1f7812(0x268)](_0x1f7812(0x289)),process['stdout'][_0x1f7812(0x268)](_0x1f7812(0x289));},_0x26affe=_0x5b1d4a&&_0x5b1d4a['attemptId']&&_0x5b1d4a[_0x451bc2(0x270)]!==null&&_0x5b1d4a[_0x451bc2(0x270)]['trim']()!=='';if(!_0x26affe){_0x1255aa(),console[_0x451bc2(0x385)](a42_0x28d120[_0x451bc2(0x307)]('Cancelled'));return;}_0x1255aa();const _0x155605=_0x681e71['find'](_0x1dc7fa=>_0x1dc7fa[_0x451bc2(0x2a9)]?.['id']===_0x5b1d4a[_0x451bc2(0x270)]);if(_0x155605){const _0x1a2488=_0x155605[_0x451bc2(0x296)]?.['name']||'?',_0x20c989=_0x155605[_0x451bc2(0x2da)]?.[_0x451bc2(0x331)]||'?';console[_0x451bc2(0x385)]('Project:\x20'+a42_0x28d120[_0x451bc2(0x307)](_0x1a2488)+_0x451bc2(0x306)+a42_0x28d120[_0x451bc2(0x307)](_0x20c989));}const _0x3575f1=new WorkflowTimelineCommand();await _0x3575f1[_0x451bc2(0x2dc)]({'args':[],'options':{..._0x3db90a,'attemptId':_0x5b1d4a[_0x451bc2(0x270)]},'tdx':_0x2d8ebb});}['generateSessionTimelineRows'](_0x42b057,_0xdc6967){const _0x4ec773=a42_0xc57567,_0x3ac66d=new Map();for(const _0x317ffa of _0x42b057){_0x317ffa['id']&&_0x317ffa[_0x4ec773(0x2a9)]?.['id']&&_0x3ac66d[_0x4ec773(0x25a)](_0x317ffa['id'],_0x317ffa[_0x4ec773(0x2a9)]['id']);}const _0x202e24=[];let _0x10f2f9='';const _0x1c0877=this[_0x4ec773(0x23a)](_0x42b057,_0xdc6967),_0x58c9ce=_0x1c0877[_0x4ec773(0x294)]('\x0a');for(const _0x1db360 of _0x58c9ce){if(_0x1db360['startsWith'](_0x4ec773(0x348))||_0x1db360[_0x4ec773(0x353)](/^\s+\d{4}-\d{2}-\d{2}/))_0x10f2f9=_0x1db360;else{if(_0x1db360['match'](/^[✅❌🔄🛑⏳]/)){const _0x1e5e7b=_0x1db360['match'](/#(\d+)/),_0x4a97f0=_0x1e5e7b?_0x1e5e7b[0x1]:null,_0x1959c6=_0x4a97f0?_0x3ac66d[_0x4ec773(0x2c3)](_0x4a97f0)||null:null,_0x3d2e2a=_0x42b057[_0x4ec773(0x386)](_0x94204=>_0x94204['id']===_0x4a97f0),_0x66518e=_0x3d2e2a?.[_0x4ec773(0x296)]?.[_0x4ec773(0x331)]||'';_0x202e24['push']({'displayLine':_0x1db360,'attemptId':_0x1959c6,'projectName':_0x66518e});}}}return{'timelineRows':_0x202e24,'timeAxisHeader':_0x10f2f9};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x290);[a42_0xc57567(0x371)]=a42_0xc57567(0x258);async[a42_0xc57567(0x2dc)](_0xb6ba71){const _0x4428b8=a42_0xc57567,{options:_0x245951,args:_0x42bf9e,tdx:_0x5a84ab}=_0xb6ba71,_0x480b94=this['parseProjectWorkflowPattern'](_0x42bf9e,_0x245951);if(!_0x480b94)return 0x1;const {projectName:_0x436580,workflowName:_0x4ef2ec}=_0x480b94,_0x1b9c17=_0x245951['includeRetried'];if(_0x245951['verbose']){if(_0x436580&&_0x4ef2ec)console['error'](_0x4428b8(0x2ef)+_0x436580+'.'+_0x4ef2ec);else _0x436580&&console[_0x4428b8(0x343)](_0x4428b8(0x2b4)+_0x436580);_0x1b9c17&&console[_0x4428b8(0x343)](_0x4428b8(0x35d));}const _0x2cd774=await withSpinner(_0x4428b8(0x1f7),()=>_0x5a84ab['workflow']['attempts']({'projectName':_0x436580,'workflowName':_0x4ef2ec,'includeRetried':_0x1b9c17,'limit':_0x245951[_0x4428b8(0x22d)]}),{'verbose':_0x245951[_0x4428b8(0x250)]}),_0x2d6c56=_0x2cd774[_0x4428b8(0x201)],_0x182d4d=_0x245951[_0x4428b8(0x22d)]||0x64,_0x5e091=_0x2d6c56[_0x4428b8(0x22b)]>=_0x182d4d?a42_0x28d120[_0x4428b8(0x307)](_0x4428b8(0x301)):'';console[_0x4428b8(0x343)](_0x4428b8(0x36f)+_0x2d6c56[_0x4428b8(0x22b)]+_0x4428b8(0x22f)+(_0x2d6c56[_0x4428b8(0x22b)]!==0x1?'s':'')+_0x5e091);if(_0x245951[_0x4428b8(0x24b)]===_0x4428b8(0x1fc)||_0x245951['format']==='jsonl'||_0x245951[_0x4428b8(0x24b)]===_0x4428b8(0x39e))await handleSDKOutput(_0x2d6c56,_0x245951);else{if(_0x2d6c56[_0x4428b8(0x22b)]===0x0){if(_0x436580&&_0x4ef2ec)console['log']('No\x20attempts\x20found\x20for:\x20'+_0x436580+'.'+_0x4ef2ec);else _0x436580?console['log'](_0x4428b8(0x322)+_0x436580):console['log'](_0x4428b8(0x22c));}else{const _0x2312b7=_0x245951[_0x4428b8(0x31d)],_0x382d69=_0x2d6c56[_0x4428b8(0x27a)](_0x4266ea=>{const _0x203016=_0x4428b8,_0x1ee06a=a42_0x28d120['dim']('#'+_0x4266ea['id']),_0xe8dd53=_0x4266ea[_0x203016(0x296)]?.['id'],_0x566d95=_0x4266ea[_0x203016(0x300)]||_0x4266ea[_0x203016(0x1f6)],_0x24878f=_0xe8dd53&&_0x566d95?hyperlink(_0x1ee06a,getWorkflowAttemptUrl(_0x2312b7,_0xe8dd53,_0x566d95,_0x4266ea['id'])):_0x1ee06a,{icon:_0x49b6d7,text:_0x23de87}=getAttemptStatusDisplay(_0x4266ea),_0x266e39=(_0x4266ea[_0x203016(0x296)]?.[_0x203016(0x331)]||'?')+'.'+(_0x4266ea['workflow']?.[_0x203016(0x331)]||'?'),_0x2a94f9=_0x4266ea['sessionTime']?a42_0x28d120[_0x203016(0x307)](_0x4266ea[_0x203016(0x24f)]):'';return(_0x24878f+'\x20'+_0x49b6d7+(_0x23de87?'\x20'+_0x23de87:'')+'\x20'+_0x266e39+'\x20'+_0x2a94f9)[_0x203016(0x2a0)]();});await writeOutput(_0x382d69[_0x4428b8(0x238)]('\x0a'),_0x245951[_0x4428b8(0x209)],_0x4428b8(0x233));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x35c);[a42_0xc57567(0x371)]=a42_0xc57567(0x23c);async[a42_0xc57567(0x2dc)](_0x51857a){const _0x106a21=a42_0xc57567,{options:_0x1cb89e,args:_0x5686f9,tdx:_0x1cb342}=_0x51857a,_0x5cb2f7=_0x5686f9[0x0];if(!_0x5cb2f7)return console[_0x106a21(0x343)](_0x106a21(0x392)),0x1;_0x1cb89e[_0x106a21(0x250)]&&console['error'](_0x106a21(0x2b2)+_0x5cb2f7);const _0x50d4fd=await withSpinner(_0x106a21(0x32d),()=>_0x1cb342['workflow'][_0x106a21(0x320)](_0x5cb2f7),{'verbose':_0x1cb89e[_0x106a21(0x250)]}),_0x47b612=_0x50d4fd[_0x106a21(0x201)];let _0x28aac5;!_0x47b612[_0x106a21(0x21e)]?_0x28aac5=_0x47b612[_0x106a21(0x398)]?_0x106a21(0x28d):_0x106a21(0x272):_0x28aac5=_0x47b612[_0x106a21(0x32b)]?_0x106a21(0x32b):_0x106a21(0x343);let _0x3a59a9;if(_0x47b612[_0x106a21(0x2ac)]&&_0x47b612[_0x106a21(0x23f)]){const _0x2446b1=new Date(_0x47b612[_0x106a21(0x2ac)])[_0x106a21(0x2e8)](),_0x58e78d=new Date(_0x47b612[_0x106a21(0x23f)])['getTime']();_0x3a59a9=Math['round']((_0x58e78d-_0x2446b1)/0x3e8);}const _0x104452={'attempt_id':_0x47b612['id'],'status':_0x28aac5,..._0x47b612[_0x106a21(0x28b)]!==undefined&&{'index':_0x47b612['index']},..._0x47b612[_0x106a21(0x296)]&&{'project':_0x47b612[_0x106a21(0x296)][_0x106a21(0x331)]},..._0x47b612['workflow']&&{'workflow':_0x47b612[_0x106a21(0x2da)][_0x106a21(0x331)]},..._0x47b612['sessionId']&&{'session_id':_0x47b612['sessionId']},..._0x47b612[_0x106a21(0x24f)]&&{'session_time':_0x47b612[_0x106a21(0x24f)]},..._0x47b612['retryAttemptName']&&{'retry_attempt':_0x47b612[_0x106a21(0x349)]},..._0x3a59a9!==undefined&&{'duration_sec':_0x3a59a9},..._0x47b612[_0x106a21(0x2ac)]&&{'created_at':_0x47b612[_0x106a21(0x2ac)]},..._0x47b612[_0x106a21(0x23f)]&&{'finished_at':_0x47b612[_0x106a21(0x23f)]},...Object[_0x106a21(0x377)](_0x47b612['params'])[_0x106a21(0x22b)]>0x0&&{'params':_0x47b612[_0x106a21(0x2f6)]}};return await handleSingleObjectOutput(_0x104452,_0x1cb89e),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x2d2);['description']=a42_0xc57567(0x2fd);async[a42_0xc57567(0x2dc)](_0xc3f3b9){const _0x3bef86=a42_0xc57567,{options:_0x29a7f7,args:_0x5d9fa5,tdx:_0xd05b3b}=_0xc3f3b9,_0x1872f6=_0x5d9fa5[0x0];if(!_0x1872f6)return console[_0x3bef86(0x343)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x3ce004=_0x29a7f7[_0x3bef86(0x338)];_0x29a7f7[_0x3bef86(0x250)]&&(console[_0x3bef86(0x343)](_0x3bef86(0x2b2)+_0x1872f6),_0x3ce004&&console['error'](_0x3bef86(0x280)));const _0x28e594=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0xd05b3b[_0x3bef86(0x2da)][_0x3bef86(0x332)](_0x1872f6,_0x3ce004||![]),{'verbose':_0x29a7f7[_0x3bef86(0x250)]}),_0x181535=_0x28e594['data'];return console['error'](_0x3bef86(0x36f)+_0x181535[_0x3bef86(0x22b)]+_0x3bef86(0x389)+(_0x181535[_0x3bef86(0x22b)]!==0x1?'s':'')),await handleSDKOutput(_0x181535,_0x29a7f7),0x0;}}function a42_0x4a1f(){const _0x3949d8=['\x0aDry\x20run\x20-\x20nothing\x20pushed','Filter:\x20project=','renderSingleTimeline','\x0aPolling...\x20(','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','Fetching\x20log\x20files...','utf-8','revision','Select\x20a\x20task\x20to\x20view\x20logs:','param','workflow:upload','showWorkflowConsoleUrl','unchanged','1353900aARBFW','now','\x20\x20Project:\x20','get','\x20\x20Console:\x20','push','tdx.json','Usage:\x20workflow:delete\x20<project-name-or-id>','Error:','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','projectId','✔\x20Pushed\x20','context','pollTimeline','workflow:projects','\x0aClone\x20\x22','TASK_NAME_WIDTH','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','workflow:tasks','projectName','sessions','Target:\x20','getFullYear','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','targetExists','📋\x20','workflow','startsWith','execute','\x20workflow','resolveProjectDir','(unknown)','preparePushProject','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','\x20\x20Location:\x20','1576JvXilJ','Usage:\x20tdx\x20wf\x20use\x20<project>','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','requireProject','\x0aPush\x20these\x20changes?','getTime','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','status','✔\x20Clone\x20complete','No\x20sessions\x20with\x20timing\x20information','projects','generateSessionTimelineRows','Filter:\x20','Killing\x20attempt...','localeCompare','\x20new','\x22?\x20This\x20cannot\x20be\x20undone.','POLL_INTERVAL_MS','No\x20workflow\x20sessions\x20found','params','path','duration','\x0aUpdate\x20existing\x20project\x20\x22','Invalid\x20format:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Show\x20tasks\x20for\x20an\x20attempt','replace','select','session_id','\x20(use\x20--limit\x20to\x20show\x20more)','group_error','No\x20projects\x20match\x20pattern:\x20','Files\x20to\x20upload:\x20','workflow:retry',',\x20Workflow:\x20','dim','all','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','dryRun','\x0aFailed\x20to\x20fetch\x20attempt\x20data','session:','workflow:secrets:list','task','max','resolve','\x20deleted','✔\x20Deleted\x20project\x20','prepareCloneProject','\x20(system)','Tip:\x20cd\x20to\x20workflows/','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','session','New\x20project\x20name:\x20','\x20\x20Changes:\x20','Project\x20directory:\x20','newProjectName','\x20logs','site','workflowName','Setting\x20secret...','attempt','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','No\x20attempts\x20found\x20in\x20project:\x20','parseProjectWorkflowPattern','Resume\x20from:\x20','diff','\x20to\x20see\x20detailed\x20logs','Session\x20not\x20found:\x20','existingProjectId','Source:\x20','No\x20sessions\x20found\x20in\x20project:\x20','success','Writing\x20files...','Getting\x20attempt\x20details...','---\x20','navigateSessionsInteractive','\x22\x20with\x20new\x20revision?','name','tasks','\x20\x20Session\x20context\x20set\x20to:\x20','title','repeat','Cloning\x20to\x20','getMinutes','includeSubtasks','(use\x20--limit\x20to\x20see\x20more)','applyPullProject','getHours','workflow:download','size','2DxYMnE','\x0a✔\x20Attempt\x20complete','splice','white','Source\x20directory:\x20','error','Total:\x20','Downloading\x20project\x20','Deleting\x20project\x20','floor','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','retryAttemptName','has','end','updatedAt','workflows','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','\x20secret','columns','modified','autocomplete','match','Output\x20directory:\x20','workflow:run','red','Kill\x20a\x20running\x20attempt','reason','Validation:\x20skipped','690424uUIdhS','No\x20workflows\x20found\x20in\x20project:\x20','workflow:attempt','Include\x20retried:\x20yes','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','summary','ICON_WIDTH','indexOf','Pull\x20workflow\x20project\x20to\x20local\x20folder','-\x20nothing\x20pushed','Retry\x20a\x20session\x20or\x20attempt','MIN_TIMELINE_WIDTH','taskName','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','fullName','isNewProject','filter','Target\x20directory:\x20','type','Error:\x20','✔\x20Found\x20','fromTask','description','displayLine','806805sxVbfZ','\x0a⚠\x20Project\x20\x22','\x20\x20Project\x20ID:\x20','✔\x20Downloaded\x20','keys','Latest\x20session\x20has\x20no\x20attempt','\x20-\x20','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','MIN_LABEL_COUNT','\x20\x20tdx\x20wf\x20use\x20<project>','Retrying\x20session...','start','\x20\x20Revision:\x20','\x22\x20to\x20new\x20project\x20\x22','Revision:\x20','green','Project\x20name\x20is\x20required','Task\x20name:\x20','log','find','values','From\x20task:\x20','\x20task','run','fs/promises','Project\x20name:\x20','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','✔\x20Project:\x20','\x20modified','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','executeCloneProject','Error:\x20Attempt\x20ID\x20is\x20required','30IGfvDi','Parameters:\x20','skipValidation','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','workflow:workflows','cancelRequested','→\x20New\x20project:\x20','jsonl','delete','new','\x0aError:','table','stringify','text','sessionId','Listing\x20workflow\x20attempts...','\x20from\x20session\x20','\x0aApply\x20these\x20changes?','msPerChar','sourceProjectName','json','blue','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Pulling\x20project\x20','data','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','buildTimelineData','Attempt:\x20','startTime','newProjectId','✔\x20Retry\x20started','sort','output','💡\x20Tip:\x20Use\x20','Analyzing\x20changes...','Pushing\x20workflow\x20project...','retrySession','Workflow:\x20','\x22\x20already\x20exists\x20(ID:\x20','MAX_TASKS_DISPLAY','Listing\x20workflow\x20sessions...','parse','readFile','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','window','cwd','Listing\x20workflow\x20projects...','rows','✔\x20Pull\x20complete','/attempt/','substring','state','basename','done','\x20unchanged','workflowProject','\x20project','Error:\x20KEY=VALUE\x20is\x20required','MAX_POLL_ITERATIONS','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Start\x20a\x20workflow\x20run','Dry\x20run:\x20yes','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','sys','workflow:push','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','length','No\x20attempts\x20found','limit','kill','\x20attempt','padStart','unknown','min','list','revision:\x20','Updating\x20','\x0aDry\x20run\x20-\x20no\x20project\x20created','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','join','stat','renderSessionsTimeline','Resolving\x20project\x20\x27','Show\x20specific\x20attempt\x20details','workflow:pull','✔\x20Workflow\x20project\x20context\x20cleared.','finishedAt','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','\x20\x20Session\x20ID:\x20','follow','No\x20sessions\x20found','workflow:use','🔄\x20','3714996icddzr','resolveProject','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Pushing\x20project...','deleteSecret','format','icon','isTTY','fileCount','sessionTime','verbose','→\x20Project:\x20','download','yes','Listing\x20workflows...','Error:\x20Project\x20name\x20is\x20required','Using\x20attempt\x20','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','List\x20workflow\x20attempts','Loading\x20sessions...','set','\x20\x20New\x20attempt\x20ID:\x20','Auto-selected\x20latest\x20session:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','logs','.\x20Expected\x20format:\x20KEY=VALUE','cyan','fill','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','renderTimeline','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','pullProject','✔\x20Push\x20complete','Key:\x20','write','No\x20sessions\x20found\x20for:\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','No\x20workflows\x20found','\x20\x20Files\x20extracted:\x20','includes','\x20\x20Attempt\x20ID:\x20','planned','attemptId','retryAttempt','running','slice','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','List\x20all\x20workflow\x20projects','isArray','getDate','deleted','toLowerCase','map','resolveProjectId','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','fileSize','ICON_SPACING','Session\x20','Including\x20subtasks:\x20yes','...','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','hasChanges','/sessions/','Error:\x20Invalid\x20JSON\x20in\x20--params','metadata','resumeFrom','6587cUoUfn','\x1b[1A\x1b[2K','861633BFTxof','index','toISOString','canceling','startedAt','\x0aDry\x20run\x20-\x20no\x20files\x20written','workflow:attempts','269268MuFkXU','List\x20workflow\x20execution\x20sessions','sourceDir','split','message','project','stdout','clear','workflow:secrets:delete','pending','attempt:','getMonth','Downloading\x20logs...','changes','Project:\x20','trimEnd','yellow','Failed\x20to\x20fetch\x20attempt\x20data','Session\x20time:\x20','Listing\x20secrets...','listSecrets','No\x20matching\x20sessions\x20found','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Show\x20logs\x20for\x20a\x20workflow\x20attempt','lastAttempt','workflow:secrets:set','Params:\x20','createdAt','workflow:clone','Cancelled','LABEL_MIN_SPACING','workflow:sessions','executePushProject','Attempt\x20ID:\x20'];a42_0x4a1f=function(){return _0x3949d8;};return a42_0x4a1f();}export class WorkflowLogsCommand extends BaseCommand{[a42_0xc57567(0x331)]='workflow:logs';[a42_0xc57567(0x371)]=a42_0xc57567(0x2a8);async['execute'](_0x1e15d4){const _0x48220f=a42_0xc57567,{options:_0xac30ee,args:_0x37e05a,tdx:_0x20895c}=_0x1e15d4,_0x66eded=_0x37e05a[0x0];let _0x16eb36=_0x37e05a[0x1];if(!_0x66eded)return console[_0x48220f(0x343)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0xac30ee['verbose']&&(console['error']('Attempt\x20ID:\x20'+_0x66eded),_0x16eb36&&console['error'](_0x48220f(0x384)+_0x16eb36));const _0x456cac=await withSpinner(_0x48220f(0x2b8),()=>_0x20895c[_0x48220f(0x2da)]['logFiles'](_0x66eded,_0x16eb36),{'verbose':_0xac30ee[_0x48220f(0x250)]}),_0x5c60ed=_0x456cac[_0x48220f(0x201)];if(_0x5c60ed[_0x48220f(0x22b)]===0x0)return console[_0x48220f(0x343)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x16eb36&&(_0xac30ee[_0x48220f(0x1fc)]||_0xac30ee['format']))return await handleSDKOutput(_0x5c60ed,_0xac30ee),0x0;if(!_0x16eb36){const _0x467cbe=_0x5c60ed[_0x48220f(0x27a)](_0x30cc54=>({'title':_0x30cc54[_0x48220f(0x366)]+'\x20('+formatBytes(_0x30cc54[_0x48220f(0x27d)])+')','value':_0x30cc54[_0x48220f(0x366)]})),_0x244e89=await a42_0x4fae({'type':_0x48220f(0x2ff),'name':_0x48220f(0x30e),'message':_0x48220f(0x2bb),'choices':_0x467cbe});if(!_0x244e89[_0x48220f(0x30e)])return console[_0x48220f(0x343)](_0x48220f(0x2ae)),0x0;_0x16eb36=_0x244e89[_0x48220f(0x30e)];}const _0x163f68=await withSpinner(_0x48220f(0x29d),()=>_0x20895c[_0x48220f(0x2da)][_0x48220f(0x25e)](_0x66eded,_0x16eb36),{'verbose':_0xac30ee['verbose']}),_0x3b83f3=_0x163f68[_0x48220f(0x201)];return _0x3b83f3?console[_0x48220f(0x385)](_0x3b83f3):console[_0x48220f(0x343)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{['name']='workflow:kill';[a42_0xc57567(0x371)]=a42_0xc57567(0x357);async[a42_0xc57567(0x2dc)](_0xaf5da4){const _0x1b0363=a42_0xc57567,{options:_0x2f6646,args:_0x53a455,tdx:_0x2c3155}=_0xaf5da4,_0x206dcf=_0x53a455[0x0];if(!_0x206dcf)return console[_0x1b0363(0x343)](_0x1b0363(0x392)),0x1;const _0x77c632=_0x2f6646[_0x1b0363(0x358)];_0x2f6646[_0x1b0363(0x250)]&&(console[_0x1b0363(0x343)](_0x1b0363(0x2b2)+_0x206dcf),_0x77c632&&console[_0x1b0363(0x343)]('Reason:\x20'+_0x77c632));if(!_0x2f6646['yes']){if(!isInteractive())return console[_0x1b0363(0x343)](a42_0x28d120[_0x1b0363(0x356)]('\x0aError:'),_0x1b0363(0x2e5)),console['error'](a42_0x28d120[_0x1b0363(0x307)](_0x1b0363(0x25d))),0x1;const _0xb1c46e=await confirmKey(_0x1b0363(0x2fc)+_0x206dcf+'?');if(!_0xb1c46e)return console[_0x1b0363(0x343)](a42_0x28d120[_0x1b0363(0x2a1)](_0x1b0363(0x2ae))),0x1;}const _0x27170e=await withSpinner(_0x1b0363(0x2f0),()=>_0x2c3155['workflow'][_0x1b0363(0x22e)](_0x206dcf,_0x77c632),{'verbose':_0x2f6646[_0x1b0363(0x250)]}),_0x61b350=_0x27170e[_0x1b0363(0x201)];return console[_0x1b0363(0x343)]('✔\x20'+_0x61b350),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x305);[a42_0xc57567(0x371)]=a42_0xc57567(0x364);async[a42_0xc57567(0x2dc)](_0x2ba04c){const _0x59bbd0=a42_0xc57567,{options:_0x5f36c2,args:_0x7c6935,tdx:_0x38c457}=_0x2ba04c,_0x48d247=_0x7c6935[0x0];if(!_0x48d247)return console[_0x59bbd0(0x343)](_0x59bbd0(0x27c)),console[_0x59bbd0(0x343)](_0x59bbd0(0x2fb)),0x1;let _0x477f6c=![],_0x57b842=_0x48d247;if(_0x48d247[_0x59bbd0(0x2db)](_0x59bbd0(0x30c)))_0x477f6c=!![],_0x57b842=_0x48d247['substring'](0x8);else{if(_0x48d247[_0x59bbd0(0x2db)](_0x59bbd0(0x29b)))_0x477f6c=![],_0x57b842=_0x48d247[_0x59bbd0(0x21b)](0x8);else return console[_0x59bbd0(0x343)](_0x59bbd0(0x2a7)),console[_0x59bbd0(0x343)](_0x59bbd0(0x2fb)),0x1;}const _0x2d2070=_0x5f36c2[_0x59bbd0(0x370)],_0x103d88=_0x5f36c2[_0x59bbd0(0x287)],_0x47dbcb=_0x5f36c2[_0x59bbd0(0x2f6)],_0x3ea512=_0x5f36c2['force'];_0x5f36c2[_0x59bbd0(0x250)]&&(console[_0x59bbd0(0x343)](_0x59bbd0(0x2d5)+(_0x477f6c?_0x59bbd0(0x317):_0x59bbd0(0x320))+'\x20'+_0x57b842),_0x2d2070&&console[_0x59bbd0(0x343)](_0x59bbd0(0x388)+_0x2d2070),_0x103d88&&console[_0x59bbd0(0x343)](_0x59bbd0(0x324)+_0x103d88),_0x47dbcb&&console[_0x59bbd0(0x343)](_0x59bbd0(0x2ab)+_0x47dbcb),_0x3ea512&&console['error']('Force:\x20yes'));let _0x505f8c;if(_0x47dbcb)try{if(_0x47dbcb[_0x59bbd0(0x2db)]('@')){const _0x4e778b=await import(_0x59bbd0(0x38b)),_0x3a4de3=_0x47dbcb['substring'](0x1),_0x4cbedb=await _0x4e778b[_0x59bbd0(0x213)](_0x3a4de3,_0x59bbd0(0x2b9));_0x505f8c=JSON[_0x59bbd0(0x212)](_0x4cbedb);}else _0x505f8c=JSON[_0x59bbd0(0x212)](_0x47dbcb);}catch{return console[_0x59bbd0(0x343)](_0x59bbd0(0x285)),0x1;}if(!_0x5f36c2[_0x59bbd0(0x253)]){if(!isInteractive())return console[_0x59bbd0(0x343)](a42_0x28d120[_0x59bbd0(0x356)](_0x59bbd0(0x39d)),_0x59bbd0(0x2e5)),console[_0x59bbd0(0x343)](a42_0x28d120[_0x59bbd0(0x307)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x32a5f5=await confirmKey(_0x59bbd0(0x237)+(_0x477f6c?_0x59bbd0(0x317):_0x59bbd0(0x320))+'\x20'+_0x57b842+'?');if(!_0x32a5f5)return console[_0x59bbd0(0x343)](a42_0x28d120[_0x59bbd0(0x2a1)](_0x59bbd0(0x2ae))),0x1;}let _0x23a80a;_0x477f6c?_0x23a80a=await withSpinner(_0x59bbd0(0x37d),()=>_0x38c457[_0x59bbd0(0x2da)][_0x59bbd0(0x20d)](_0x57b842,{'fromTask':_0x2d2070,'retryParams':_0x505f8c}),{'verbose':_0x5f36c2[_0x59bbd0(0x250)]}):_0x23a80a=await withSpinner('Retrying\x20attempt...',()=>_0x38c457[_0x59bbd0(0x2da)][_0x59bbd0(0x271)](_0x57b842,{'resumeFrom':_0x103d88,'retryParams':_0x505f8c,'force':_0x3ea512}),{'verbose':_0x5f36c2[_0x59bbd0(0x250)]});const _0x1a22df=_0x23a80a[_0x59bbd0(0x201)];return console['error'](_0x59bbd0(0x207)),console['error'](_0x59bbd0(0x25b)+_0x1a22df['attemptId']),console[_0x59bbd0(0x343)](_0x59bbd0(0x241)+_0x1a22df['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x355);[a42_0xc57567(0x371)]=a42_0xc57567(0x225);async[a42_0xc57567(0x2dc)](_0x4707e4){const _0x4eb7f3=a42_0xc57567,{options:_0x5db6cb,args:_0x2c1c3a,tdx:_0x2526b8}=_0x4707e4;let _0x3394a9=_0x2c1c3a[0x0];if(!_0x3394a9){const _0x2dceed=this[_0x4eb7f3(0x247)]([],_0x5db6cb),_0x4c97b7=await withSpinner('Loading\x20workflows...',()=>_0x2526b8[_0x4eb7f3(0x2da)][_0x4eb7f3(0x34d)](_0x2dceed,{'limit':_0x5db6cb[_0x4eb7f3(0x22d)]}),{'verbose':_0x5db6cb[_0x4eb7f3(0x250)]}),_0x4a1ed5=_0x4c97b7[_0x4eb7f3(0x201)];if(_0x4a1ed5['length']===0x0)return console[_0x4eb7f3(0x343)]('No\x20workflows\x20found'),!_0x2dceed&&console['error'](a42_0x28d120[_0x4eb7f3(0x307)](_0x4eb7f3(0x2e9))),0x1;const _0x110c40=_0x4a1ed5[_0x4eb7f3(0x27a)](_0x377a25=>({'title':_0x377a25['project']?.[_0x4eb7f3(0x331)]+'.'+_0x377a25[_0x4eb7f3(0x331)],'value':_0x377a25['project']?.[_0x4eb7f3(0x331)]+'.'+_0x377a25['name'],'description':_0x377a25[_0x4eb7f3(0x2ba)]?_0x4eb7f3(0x234)+_0x377a25[_0x4eb7f3(0x2ba)]:undefined})),_0x44209=await a42_0x4fae({'type':_0x4eb7f3(0x2ff),'name':'workflow','message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x110c40});if(!_0x44209[_0x4eb7f3(0x2da)])return 0x1;_0x3394a9=_0x44209[_0x4eb7f3(0x2da)];}if(!_0x3394a9[_0x4eb7f3(0x26d)]('.')){const _0x1794b=this[_0x4eb7f3(0x247)]([],_0x5db6cb);if(_0x1794b)_0x3394a9=_0x1794b+'.'+_0x3394a9;else return console[_0x4eb7f3(0x343)](a42_0x28d120[_0x4eb7f3(0x356)]('Error:'),_0x4eb7f3(0x316)),console[_0x4eb7f3(0x343)](a42_0x28d120['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x92fd8a=_0x5db6cb[_0x4eb7f3(0x2bc)],_0x47b3c1=_0x5db6cb[_0x4eb7f3(0x24f)],_0x21e0af={};if(_0x92fd8a&&Array[_0x4eb7f3(0x276)](_0x92fd8a))for(const _0x20d3f0 of _0x92fd8a){const _0xb4bb54=_0x20d3f0[_0x4eb7f3(0x361)]('=');if(_0xb4bb54===-0x1)return console[_0x4eb7f3(0x343)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x20d3f0),console[_0x4eb7f3(0x343)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x29fc2d=_0x20d3f0[_0x4eb7f3(0x21b)](0x0,_0xb4bb54),_0xf2ada9=_0x20d3f0[_0x4eb7f3(0x21b)](_0xb4bb54+0x1);try{_0x21e0af[_0x29fc2d]=JSON['parse'](_0xf2ada9);}catch{_0x21e0af[_0x29fc2d]=_0xf2ada9;}}_0x5db6cb[_0x4eb7f3(0x250)]&&(console['error'](_0x4eb7f3(0x20e)+_0x3394a9),Object[_0x4eb7f3(0x377)](_0x21e0af)[_0x4eb7f3(0x22b)]>0x0&&console[_0x4eb7f3(0x343)](_0x4eb7f3(0x394)+JSON[_0x4eb7f3(0x1f4)](_0x21e0af)),_0x47b3c1&&console[_0x4eb7f3(0x343)](_0x4eb7f3(0x2a3)+_0x47b3c1));const _0xd6d334=await withSpinner('Starting\x20workflow\x20run...',()=>_0x2526b8[_0x4eb7f3(0x2da)][_0x4eb7f3(0x38a)](_0x3394a9,_0x21e0af,{'sessionTime':_0x47b3c1}),{'verbose':_0x5db6cb[_0x4eb7f3(0x250)]}),_0x104b1f=_0xd6d334[_0x4eb7f3(0x201)];console[_0x4eb7f3(0x343)]('✔\x20Workflow\x20run\x20started'),console[_0x4eb7f3(0x343)](_0x4eb7f3(0x26e)+_0x104b1f['id']),console[_0x4eb7f3(0x343)](_0x4eb7f3(0x241)+_0x104b1f[_0x4eb7f3(0x1f6)]),console[_0x4eb7f3(0x343)](_0x4eb7f3(0x2c2)+_0x104b1f[_0x4eb7f3(0x296)]?.[_0x4eb7f3(0x331)]),console[_0x4eb7f3(0x343)]('\x20\x20Workflow:\x20'+_0x104b1f[_0x4eb7f3(0x2da)]?.[_0x4eb7f3(0x331)]);if(_0x104b1f[_0x4eb7f3(0x296)]?.['id']&&_0x104b1f[_0x4eb7f3(0x1f6)]&&_0x104b1f['id']){const _0x772a3f=_0x5db6cb[_0x4eb7f3(0x31d)],_0x4ae94f=getConsoleUrl(_0x772a3f,'/app/workflows/'+_0x104b1f['project']['id']+_0x4eb7f3(0x284)+_0x104b1f['sessionId']+_0x4eb7f3(0x21a)+_0x104b1f['id']);console[_0x4eb7f3(0x343)](_0x4eb7f3(0x2c4)+a42_0x28d120[_0x4eb7f3(0x260)](_0x4ae94f));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a42_0xc57567(0x33c);['description']=a42_0xc57567(0x309);async[a42_0xc57567(0x2dc)](_0x37e8e8){const _0x50c4c9=a42_0xc57567,{options:_0x3dd296,args:_0x6373bf,tdx:_0x4d835a}=_0x37e8e8,_0x265ecb=_0x6373bf[0x0],_0xf55b3b=_0x6373bf[0x1]||'.';if(!_0x265ecb)return console[_0x50c4c9(0x343)](_0x50c4c9(0x255)),console[_0x50c4c9(0x343)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0xb4397b=_0x3dd296[_0x50c4c9(0x2ba)];_0x3dd296[_0x50c4c9(0x250)]&&(console['error'](_0x50c4c9(0x29f)+_0x265ecb),console[_0x50c4c9(0x343)](_0x50c4c9(0x354)+_0xf55b3b),_0xb4397b&&console[_0x50c4c9(0x343)](_0x50c4c9(0x381)+_0xb4397b));const _0x31ef7a=await withSpinner(_0x50c4c9(0x345)+_0x265ecb+_0x50c4c9(0x281),()=>_0x4d835a['workflow'][_0x50c4c9(0x252)](_0x265ecb,_0xf55b3b,{'revision':_0xb4397b}),{'verbose':_0x3dd296[_0x50c4c9(0x250)]}),_0x447e8b=_0x31ef7a[_0x50c4c9(0x201)];return console['error'](_0x50c4c9(0x376)+_0x447e8b[_0x50c4c9(0x2d3)]),console[_0x50c4c9(0x343)](_0x50c4c9(0x37f)+_0x447e8b[_0x50c4c9(0x2ba)]),console['error'](_0x50c4c9(0x26c)+_0x447e8b['filesExtracted']),console['error'](_0x50c4c9(0x2e2)+_0xf55b3b+'/'+_0x447e8b[_0x50c4c9(0x2d3)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x2bd);[a42_0xc57567(0x371)]=a42_0xc57567(0x2c9);async['execute'](_0x4d0f57){const _0x2e95a6=a42_0xc57567,{options:_0x33d5f3,args:_0x5a4862,tdx:_0x52fdbf}=_0x4d0f57;let _0x1aaada='.',_0x57682e=_0x33d5f3[_0x2e95a6(0x331)];if(_0x5a4862[0x0]){const {promises:_0x1ec962}=await import('fs');try{const _0x2fd465=await _0x1ec962[_0x2e95a6(0x239)](_0x5a4862[0x0]);if(_0x2fd465['isDirectory']())_0x1aaada=_0x5a4862[0x0];else return console[_0x2e95a6(0x343)](_0x2e95a6(0x36e)+_0x5a4862[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x57682e=_0x5a4862[0x0],_0x1aaada='.';}}const _0x238db1=_0x33d5f3[_0x2e95a6(0x2ba)],_0xed205c=_0x33d5f3[_0x2e95a6(0x395)];_0x33d5f3[_0x2e95a6(0x250)]&&(console[_0x2e95a6(0x343)](_0x2e95a6(0x31a)+_0x1aaada),_0x57682e&&console[_0x2e95a6(0x343)](_0x2e95a6(0x38c)+_0x57682e),_0x238db1&&console['error'](_0x2e95a6(0x381)+_0x238db1),_0xed205c&&console['error']('Validation:\x20skipped'));const _0x3a34dd=await withSpinner(_0x2e95a6(0x20c),()=>_0x52fdbf[_0x2e95a6(0x2da)]['push'](_0x1aaada,{'projectName':_0x57682e,'revision':_0x238db1,'skipValidation':_0xed205c}),{'verbose':_0x33d5f3[_0x2e95a6(0x250)]}),_0x47246e=_0x3a34dd[_0x2e95a6(0x201)];return console[_0x2e95a6(0x343)](_0x2e95a6(0x2cb)+_0x47246e[_0x2e95a6(0x2d3)]),console['error'](_0x2e95a6(0x375)+_0x47246e['projectId']),console[_0x2e95a6(0x343)](_0x2e95a6(0x37f)+_0x47246e['revision']),await this['showWorkflowConsoleUrl'](_0x52fdbf,_0x47246e['projectName'],_0x33d5f3[_0x2e95a6(0x31d)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x23d);[a42_0xc57567(0x371)]=a42_0xc57567(0x362);async[a42_0xc57567(0x2dc)](_0x21270f){const _0x566f77=a42_0xc57567,{options:_0x220fd5,args:_0x373230,tdx:_0x4246c9}=_0x21270f,_0x1296de=_0x373230[0x0],_0x580163=_0x373230[0x1];if(!_0x1296de)return console['error'](a42_0x28d120[_0x566f77(0x356)](_0x566f77(0x2c8)),'Project\x20name\x20is\x20required'),console['error'](a42_0x28d120[_0x566f77(0x307)](_0x566f77(0x37a))),0x1;const _0x4a93d9=_0x220fd5[_0x566f77(0x2ba)];_0x220fd5['verbose']&&(console[_0x566f77(0x343)](_0x566f77(0x29f)+_0x1296de),_0x580163&&console[_0x566f77(0x343)](_0x566f77(0x36c)+_0x580163),_0x4a93d9&&console[_0x566f77(0x343)](_0x566f77(0x381)+_0x4a93d9),_0x220fd5['dryRun']&&console['error'](_0x566f77(0x226)));const _0x180718=await withSpinner(_0x566f77(0x200)+_0x1296de+'...',()=>_0x4246c9[_0x566f77(0x2da)][_0x566f77(0x265)](_0x1296de,{'targetDir':_0x580163,'revision':_0x4a93d9}),{'verbose':_0x220fd5[_0x566f77(0x250)]}),_0x3e090c=_0x180718['data'];_0x3e090c[_0x566f77(0x36a)]?console[_0x566f77(0x343)](_0x566f77(0x399)+_0x3e090c[_0x566f77(0x2d3)]):console['error'](_0x566f77(0x251)+_0x3e090c['projectName']);console[_0x566f77(0x343)]('\x20\x20Revision:\x20'+_0x3e090c['revision']),console['error']('\x20\x20Target:\x20'+(a42_0x4c5f63['relative'](process[_0x566f77(0x216)](),_0x3e090c['targetDir'])||'.')),console[_0x566f77(0x343)](_0x566f77(0x319)+a42_0x28d120[_0x566f77(0x382)]('+'+_0x3e090c[_0x566f77(0x35f)][_0x566f77(0x39c)]+_0x566f77(0x2f2))+',\x20'+(a42_0x28d120['yellow']('~'+_0x3e090c[_0x566f77(0x35f)][_0x566f77(0x351)]+_0x566f77(0x38f))+',\x20')+(a42_0x28d120['red']('-'+_0x3e090c[_0x566f77(0x35f)][_0x566f77(0x278)]+_0x566f77(0x311))+',\x20')+(''+a42_0x28d120[_0x566f77(0x307)](_0x3e090c[_0x566f77(0x35f)][_0x566f77(0x2bf)]+_0x566f77(0x21f))));for(const _0x56875c of _0x3e090c[_0x566f77(0x29e)]){_0x56875c[_0x566f77(0x36d)]===_0x566f77(0x351)&&_0x56875c[_0x566f77(0x325)]&&(console[_0x566f77(0x343)]('\x0a'+a42_0x28d120['cyan'](_0x566f77(0x32e)+_0x56875c[_0x566f77(0x2f7)])),console['error'](_0x56875c[_0x566f77(0x325)]));}if(!_0x3e090c[_0x566f77(0x283)])return saveSessionContext({'workflow_project':_0x3e090c['projectName']},_0x220fd5[_0x566f77(0x317)]),console[_0x566f77(0x343)](a42_0x28d120[_0x566f77(0x382)]('\x0a✔\x20Already\x20up\x20to\x20date')),console['error'](a42_0x28d120[_0x566f77(0x307)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x3e090c[_0x566f77(0x2d3)])),0x0;if(_0x220fd5['dryRun'])return console[_0x566f77(0x343)](a42_0x28d120[_0x566f77(0x2a1)](_0x566f77(0x28f))),0x0;if(!_0x220fd5['yes']){if(!isInteractive())return console['error'](a42_0x28d120[_0x566f77(0x356)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x566f77(0x343)](a42_0x28d120[_0x566f77(0x307)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4c10c2=await confirmKey(_0x566f77(0x1f9));if(!_0x4c10c2)return console[_0x566f77(0x343)](a42_0x28d120[_0x566f77(0x2a1)](_0x566f77(0x2ae)),'-\x20no\x20files\x20written'),0x1;}await withSpinner(_0x566f77(0x32c),()=>_0x4246c9[_0x566f77(0x2da)][_0x566f77(0x33a)](_0x3e090c,{'revision':_0x4a93d9}),{'verbose':_0x220fd5[_0x566f77(0x250)]}),saveSessionContext({'workflow_project':_0x3e090c[_0x566f77(0x2d3)]},_0x220fd5[_0x566f77(0x317)]),console[_0x566f77(0x343)](a42_0x28d120[_0x566f77(0x382)](_0x566f77(0x219)));const _0x3548b2=a42_0x4c5f63['relative'](process[_0x566f77(0x216)](),_0x3e090c['targetDir'])||'.';return console[_0x566f77(0x343)](a42_0x28d120['dim'](_0x566f77(0x2e2)+_0x3548b2)),console['error'](a42_0x28d120[_0x566f77(0x307)](_0x566f77(0x333)+_0x3e090c[_0x566f77(0x2d3)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x229);[a42_0xc57567(0x371)]=a42_0xc57567(0x2d7);async[a42_0xc57567(0x2dc)](_0x557227){const _0x52f75b=a42_0xc57567,{options:_0x41dda1,args:_0x17c134,tdx:_0xf71735}=_0x557227,_0x15d9d6=this[_0x52f75b(0x2de)](_0x17c134,_0x41dda1),_0x16c6ab=_0x41dda1[_0x52f75b(0x2ba)],_0x16be2d=_0x41dda1[_0x52f75b(0x395)];_0x41dda1['verbose']&&(_0x15d9d6&&console['error'](_0x52f75b(0x342)+_0x15d9d6),_0x16c6ab&&console[_0x52f75b(0x343)](_0x52f75b(0x381)+_0x16c6ab),_0x41dda1['dryRun']&&console[_0x52f75b(0x343)](_0x52f75b(0x226)),_0x16be2d&&console[_0x52f75b(0x343)](_0x52f75b(0x359)));let _0x377757;try{_0x377757=await withSpinner(_0x52f75b(0x20b),()=>_0xf71735[_0x52f75b(0x2da)][_0x52f75b(0x2e0)]({'sourceDir':_0x15d9d6,'revision':_0x16c6ab,'skipValidation':_0x16be2d}),{'verbose':_0x41dda1[_0x52f75b(0x250)]});}catch(_0xa6523b){if(_0xa6523b instanceof Error&&_0xa6523b[_0x52f75b(0x295)][_0x52f75b(0x26d)]('No\x20workflow\x20tdx.json\x20found'))return console['error'](a42_0x28d120[_0x52f75b(0x356)](_0x52f75b(0x2c8)),_0x52f75b(0x202)),_0x41dda1[_0x52f75b(0x220)]?console['error'](a42_0x28d120['dim'](_0x52f75b(0x315)+_0x41dda1['workflowProject']+_0x52f75b(0x368)+_0x41dda1[_0x52f75b(0x220)]+'\x27')):console[_0x52f75b(0x343)](a42_0x28d120[_0x52f75b(0x307)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0xa6523b;}const _0x1b6b33=_0x377757['data'];console['error'](_0x52f75b(0x38e)+_0x1b6b33[_0x52f75b(0x2d3)]),console['error']('\x20\x20Source:\x20'+_0x1b6b33[_0x52f75b(0x293)]),console[_0x52f75b(0x343)](_0x52f75b(0x37f)+_0x1b6b33['revision']),console[_0x52f75b(0x343)](_0x52f75b(0x319)+a42_0x28d120[_0x52f75b(0x382)]('+'+_0x1b6b33['summary'][_0x52f75b(0x39c)]+'\x20new')+',\x20'+(a42_0x28d120[_0x52f75b(0x2a1)]('~'+_0x1b6b33[_0x52f75b(0x35f)][_0x52f75b(0x351)]+_0x52f75b(0x38f))+',\x20')+(a42_0x28d120[_0x52f75b(0x356)]('-'+_0x1b6b33[_0x52f75b(0x35f)][_0x52f75b(0x278)]+'\x20deleted')+',\x20')+(''+a42_0x28d120[_0x52f75b(0x307)](_0x1b6b33[_0x52f75b(0x35f)][_0x52f75b(0x2bf)]+_0x52f75b(0x21f))));for(const _0x3d6e29 of _0x1b6b33[_0x52f75b(0x29e)]){_0x3d6e29[_0x52f75b(0x36d)]==='modified'&&_0x3d6e29[_0x52f75b(0x325)]&&(console[_0x52f75b(0x343)]('\x0a'+a42_0x28d120[_0x52f75b(0x260)](_0x52f75b(0x32e)+_0x3d6e29[_0x52f75b(0x2f7)])),console[_0x52f75b(0x343)](_0x3d6e29[_0x52f75b(0x325)]));}if(!_0x1b6b33[_0x52f75b(0x283)])return console[_0x52f75b(0x343)](a42_0x28d120[_0x52f75b(0x382)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x52f75b(0x2be)](_0xf71735,_0x1b6b33['projectName'],_0x41dda1[_0x52f75b(0x31d)]),0x0;if(_0x41dda1[_0x52f75b(0x30a)])return console[_0x52f75b(0x343)](a42_0x28d120['yellow'](_0x52f75b(0x2b3))),0x0;if(!_0x41dda1['yes']){if(!isInteractive())return console[_0x52f75b(0x343)](a42_0x28d120['red'](_0x52f75b(0x39d)),_0x52f75b(0x2e5)),console['error'](a42_0x28d120[_0x52f75b(0x307)](_0x52f75b(0x25d))),0x1;const _0x126e3c=await confirmKey(_0x52f75b(0x2e7));if(!_0x126e3c)return console[_0x52f75b(0x343)](a42_0x28d120['yellow']('Cancelled'),_0x52f75b(0x363)),0x1;}const _0x1e57a9=await withSpinner(_0x52f75b(0x249),()=>_0xf71735[_0x52f75b(0x2da)][_0x52f75b(0x2b1)](_0x1b6b33),{'verbose':_0x41dda1[_0x52f75b(0x250)]}),_0x36f75a=_0x1e57a9[_0x52f75b(0x201)];return console['error'](a42_0x28d120[_0x52f75b(0x382)](_0x52f75b(0x266))),console[_0x52f75b(0x343)](_0x52f75b(0x375)+_0x36f75a['projectId']),console[_0x52f75b(0x343)]('\x20\x20Revision:\x20'+_0x36f75a[_0x52f75b(0x2ba)]),await this[_0x52f75b(0x2be)](_0xf71735,_0x36f75a[_0x52f75b(0x2d3)],_0x41dda1[_0x52f75b(0x31d)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x2ad);[a42_0xc57567(0x371)]=a42_0xc57567(0x321);async[a42_0xc57567(0x2dc)](_0x5d0f9a){const _0x271c7c=a42_0xc57567,{options:_0x1a8b27,args:_0x19b312,tdx:_0x518d49}=_0x5d0f9a,_0x31b8af=this[_0x271c7c(0x2de)](_0x19b312,_0x1a8b27),_0x2e0dbd=_0x1a8b27['name'],_0x340bfa=_0x1a8b27['revision'],_0x1d2e89=_0x1a8b27[_0x271c7c(0x395)];if(!_0x31b8af)return console[_0x271c7c(0x343)](a42_0x28d120[_0x271c7c(0x356)](_0x271c7c(0x2c8)),'Source\x20directory\x20is\x20required'),console['error'](a42_0x28d120[_0x271c7c(0x307)](_0x271c7c(0x22a))),console['error'](a42_0x28d120[_0x271c7c(0x307)](_0x271c7c(0x274))),0x1;if(!_0x2e0dbd)return console[_0x271c7c(0x343)](a42_0x28d120[_0x271c7c(0x356)]('Error:'),_0x271c7c(0x2b7)),console[_0x271c7c(0x343)](a42_0x28d120[_0x271c7c(0x307)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x1a8b27['verbose']&&(console['error'](_0x271c7c(0x342)+_0x31b8af),console[_0x271c7c(0x343)](_0x271c7c(0x318)+_0x2e0dbd),_0x340bfa&&console['error'](_0x271c7c(0x381)+_0x340bfa),_0x1a8b27[_0x271c7c(0x30a)]&&console[_0x271c7c(0x343)]('Dry\x20run:\x20yes'),_0x1d2e89&&console[_0x271c7c(0x343)](_0x271c7c(0x359)));const _0x3527fe=await withSpinner('Analyzing\x20project...',()=>_0x518d49[_0x271c7c(0x2da)][_0x271c7c(0x313)](_0x31b8af,_0x2e0dbd,{'revision':_0x340bfa,'skipValidation':_0x1d2e89}),{'verbose':_0x1a8b27[_0x271c7c(0x250)]}),_0x5688e7=_0x3527fe[_0x271c7c(0x201)];console[_0x271c7c(0x343)](_0x271c7c(0x329)+_0x5688e7[_0x271c7c(0x293)]);_0x5688e7['sourceProjectName']&&console[_0x271c7c(0x343)]('Source\x20project:\x20'+_0x5688e7[_0x271c7c(0x1fb)]);console['error'](_0x271c7c(0x318)+_0x5688e7[_0x271c7c(0x31b)]),console['error'](_0x271c7c(0x381)+_0x5688e7[_0x271c7c(0x2ba)]),console['error'](_0x271c7c(0x304)+_0x5688e7[_0x271c7c(0x24e)]);_0x5688e7[_0x271c7c(0x2d8)]&&(console['error'](a42_0x28d120['yellow'](_0x271c7c(0x374)+_0x5688e7[_0x271c7c(0x31b)]+_0x271c7c(0x20f)+_0x5688e7[_0x271c7c(0x328)]+')')),console[_0x271c7c(0x343)](a42_0x28d120[_0x271c7c(0x2a1)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x1a8b27['dryRun'])return console[_0x271c7c(0x343)](a42_0x28d120[_0x271c7c(0x2a1)](_0x271c7c(0x236))),0x0;if(!_0x1a8b27[_0x271c7c(0x253)]){if(!isInteractive())return console[_0x271c7c(0x343)](a42_0x28d120[_0x271c7c(0x356)](_0x271c7c(0x39d)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x271c7c(0x343)](a42_0x28d120[_0x271c7c(0x307)](_0x271c7c(0x25d))),0x1;const _0x3e69e3=_0x5688e7[_0x271c7c(0x1fb)]||a42_0x4c5f63[_0x271c7c(0x21d)](_0x31b8af),_0x1c2011=_0x5688e7[_0x271c7c(0x2d8)]?_0x271c7c(0x2f9)+_0x2e0dbd+_0x271c7c(0x330):_0x271c7c(0x2cf)+_0x3e69e3+_0x271c7c(0x380)+_0x2e0dbd+'\x22?',_0x5ac55f=await confirmKey(_0x1c2011);if(!_0x5ac55f)return console[_0x271c7c(0x343)](a42_0x28d120[_0x271c7c(0x2a1)](_0x271c7c(0x2ae))),0x1;}const _0x1173f2=await withSpinner(_0x5688e7[_0x271c7c(0x2d8)]?_0x271c7c(0x235)+_0x2e0dbd+_0x271c7c(0x281):_0x271c7c(0x336)+_0x2e0dbd+'...',()=>_0x518d49[_0x271c7c(0x2da)][_0x271c7c(0x391)](_0x5688e7),{'verbose':_0x1a8b27[_0x271c7c(0x250)]}),_0x43cc71=_0x1173f2[_0x271c7c(0x201)];return console[_0x271c7c(0x343)](a42_0x28d120[_0x271c7c(0x382)](_0x5688e7['targetExists']?'✔\x20Project\x20updated':_0x271c7c(0x2eb))),console[_0x271c7c(0x343)](_0x271c7c(0x2c2)+_0x43cc71[_0x271c7c(0x31b)]),console[_0x271c7c(0x343)]('\x20\x20Project\x20ID:\x20'+_0x43cc71[_0x271c7c(0x206)]),console[_0x271c7c(0x343)](_0x271c7c(0x37f)+_0x43cc71[_0x271c7c(0x2ba)]),await this[_0x271c7c(0x2be)](_0x518d49,_0x43cc71[_0x271c7c(0x31b)],_0x1a8b27[_0x271c7c(0x31d)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a42_0xc57567(0x331)]='workflow:delete';[a42_0xc57567(0x371)]=a42_0xc57567(0x282);async[a42_0xc57567(0x2dc)](_0x11c68f){const _0x2b112c=a42_0xc57567,{options:_0x2b9d04,args:_0x1833c6,tdx:_0x38c1fe}=_0x11c68f,_0x506b54=_0x1833c6[0x0];if(!_0x506b54)return console[_0x2b112c(0x343)](_0x2b112c(0x396)),console[_0x2b112c(0x343)](_0x2b112c(0x2c7)),0x1;_0x2b9d04['verbose']&&console[_0x2b112c(0x343)](_0x2b112c(0x29f)+_0x506b54);if(!_0x2b9d04[_0x2b112c(0x253)]){if(!isInteractive())return console['error'](a42_0x28d120[_0x2b112c(0x356)](_0x2b112c(0x39d)),_0x2b112c(0x2e5)),console[_0x2b112c(0x343)](a42_0x28d120[_0x2b112c(0x307)](_0x2b112c(0x25d))),0x1;const _0x54c57a=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x506b54+_0x2b112c(0x2f3));if(!_0x54c57a)return console[_0x2b112c(0x343)](a42_0x28d120['yellow']('Cancelled')),0x1;}const _0x47a07f=await withSpinner(_0x2b112c(0x346)+_0x506b54+'...',()=>_0x38c1fe[_0x2b112c(0x2da)][_0x2b112c(0x39b)](_0x506b54),{'verbose':_0x2b9d04[_0x2b112c(0x250)]}),_0x5ee97a=_0x47a07f[_0x2b112c(0x201)];return console[_0x2b112c(0x343)](_0x2b112c(0x312)+_0x5ee97a[_0x2b112c(0x2d3)]),console[_0x2b112c(0x343)](_0x2b112c(0x375)+_0x5ee97a[_0x2b112c(0x2ca)]),0x0;}}export function parseKeyValue(_0x377d82){const _0x37821e=a42_0xc57567,_0x1a5964=_0x377d82[_0x37821e(0x361)]('=');if(_0x1a5964===-0x1)throw new Error(_0x37821e(0x2fa)+_0x377d82+_0x37821e(0x25f));const _0x56f770=_0x377d82[_0x37821e(0x21b)](0x0,_0x1a5964),_0x4f8ec6=_0x377d82[_0x37821e(0x21b)](_0x1a5964+0x1);if(!_0x56f770)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x56f770,'value':_0x4f8ec6};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x30d);[a42_0xc57567(0x371)]=a42_0xc57567(0x262);async['execute'](_0x3e539a){const _0x3d296c=a42_0xc57567,{options:_0x35af96,args:_0x4270b7,tdx:_0x1a48da}=_0x3e539a,_0x504e14=this[_0x3d296c(0x2e6)](_0x4270b7,_0x35af96);if(!_0x504e14)return 0x1;_0x35af96[_0x3d296c(0x250)]&&console[_0x3d296c(0x343)](_0x3d296c(0x29f)+_0x504e14);const _0x3b38fe=await withSpinner(_0x3d296c(0x2a4),()=>_0x1a48da[_0x3d296c(0x2da)][_0x3d296c(0x2a5)](_0x504e14),{'verbose':_0x35af96[_0x3d296c(0x250)]}),{secrets:_0x7f6a75}=_0x3b38fe[_0x3d296c(0x201)];return console[_0x3d296c(0x343)](_0x3d296c(0x36f)+_0x7f6a75[_0x3d296c(0x22b)]+_0x3d296c(0x34f)+(_0x7f6a75['length']!==0x1?'s':'')),await handleSDKOutput(_0x7f6a75,_0x35af96),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a42_0xc57567(0x2aa);[a42_0xc57567(0x371)]='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async[a42_0xc57567(0x2dc)](_0x4a9fe8){const _0x5eec8d=a42_0xc57567,{options:_0x570e32,args:_0x408a4f,tdx:_0x4a9234}=_0x4a9fe8;let _0x42f162,_0x402d28;if(_0x408a4f['length']>=0x2)_0x42f162=_0x408a4f[0x0],_0x402d28=_0x408a4f[0x1];else{if(_0x408a4f['length']===0x1&&_0x570e32[_0x5eec8d(0x220)])_0x42f162=_0x570e32[_0x5eec8d(0x220)],_0x402d28=_0x408a4f[0x0];else return _0x408a4f[_0x5eec8d(0x22b)]===0x1?(console[_0x5eec8d(0x343)](_0x5eec8d(0x255)),console[_0x5eec8d(0x343)](_0x5eec8d(0x2e9)),0x1):(console[_0x5eec8d(0x343)](_0x5eec8d(0x222)),console[_0x5eec8d(0x343)](_0x5eec8d(0x227)),0x1);}let _0x2f1ff8,_0x32c267;try{({key:_0x2f1ff8,value:_0x32c267}=parseKeyValue(_0x402d28));}catch(_0x2cd053){return _0x2cd053 instanceof Error&&console[_0x5eec8d(0x343)](a42_0x28d120[_0x5eec8d(0x356)](_0x5eec8d(0x2c8)),_0x2cd053[_0x5eec8d(0x295)]),0x1;}_0x570e32[_0x5eec8d(0x250)]&&(console['error'](_0x5eec8d(0x29f)+_0x42f162),console[_0x5eec8d(0x343)](_0x5eec8d(0x267)+_0x2f1ff8));const _0x3fd258=await withSpinner(_0x5eec8d(0x31f),()=>_0x4a9234[_0x5eec8d(0x2da)]['setSecret'](_0x42f162,_0x2f1ff8,_0x32c267),{'verbose':_0x570e32['verbose']}),_0x11c0da=_0x3fd258[_0x5eec8d(0x201)];return console[_0x5eec8d(0x343)]('✔\x20Secret\x20\x27'+_0x11c0da['key']+_0x5eec8d(0x248)+_0x11c0da[_0x5eec8d(0x2d3)]+'\x27'),(_0x570e32[_0x5eec8d(0x1fc)]||_0x570e32[_0x5eec8d(0x39a)])&&await handleSingleObjectOutput(_0x11c0da,_0x570e32),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a42_0xc57567(0x331)]=a42_0xc57567(0x299);['description']=a42_0xc57567(0x390);async[a42_0xc57567(0x2dc)](_0x40395c){const _0x306b5a=a42_0xc57567,{options:_0x1b130e,args:_0x475cd9,tdx:_0x47be3e}=_0x40395c;let _0x563da8,_0x5339f8;if(_0x475cd9['length']>=0x2)_0x563da8=_0x475cd9[0x0],_0x5339f8=_0x475cd9[0x1];else{if(_0x475cd9[_0x306b5a(0x22b)]===0x1&&_0x1b130e[_0x306b5a(0x220)])_0x563da8=_0x1b130e[_0x306b5a(0x220)],_0x5339f8=_0x475cd9[0x0];else return _0x475cd9[_0x306b5a(0x22b)]===0x1?(console[_0x306b5a(0x343)](_0x306b5a(0x255)),console[_0x306b5a(0x343)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x306b5a(0x343)]('Error:\x20Secret\x20key\x20is\x20required'),console[_0x306b5a(0x343)]('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x1b130e[_0x306b5a(0x250)]&&(console[_0x306b5a(0x343)]('Project:\x20'+_0x563da8),console['error'](_0x306b5a(0x267)+_0x5339f8));if(!_0x1b130e[_0x306b5a(0x253)]){if(!isInteractive())return console[_0x306b5a(0x343)](a42_0x28d120[_0x306b5a(0x356)](_0x306b5a(0x39d)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x306b5a(0x343)](a42_0x28d120[_0x306b5a(0x307)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1690c4=await confirmKey(_0x306b5a(0x240)+_0x5339f8+'\x27\x20from\x20project\x20\x27'+_0x563da8+'\x27?');if(!_0x1690c4)return console[_0x306b5a(0x343)](a42_0x28d120[_0x306b5a(0x2a1)](_0x306b5a(0x2ae))),0x1;}const _0x2a9460=await withSpinner('Deleting\x20secret...',()=>_0x47be3e['workflow'][_0x306b5a(0x24a)](_0x563da8,_0x5339f8),{'verbose':_0x1b130e[_0x306b5a(0x250)]}),_0x427642=_0x2a9460[_0x306b5a(0x201)];return console['error']('✔\x20Secret\x20\x27'+_0x427642['key']+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x427642[_0x306b5a(0x2d3)]+'\x27'),(_0x1b130e[_0x306b5a(0x1fc)]||_0x1b130e[_0x306b5a(0x39a)])&&await handleSingleObjectOutput(_0x427642,_0x1b130e),0x0;}}const TIMELINE_CONFIG={'TASK_NAME_WIDTH':0x28,'ICON_WIDTH':0x2,'ICON_SPACING':0x1,'GUTTER':0x5,'MIN_TIMELINE_WIDTH':0x28,'MAX_TIMELINE_WIDTH':0x50,'LABEL_MIN_SPACING':0x2,'POLL_INTERVAL_MS':0x7d0,'MAX_POLL_TIME_MS':0x36ee80,'MAX_POLL_ITERATIONS':0x708,'MAX_TASKS_DISPLAY':0x64,'MIN_LABEL_COUNT':0x3,'MAX_LABEL_COUNT':0x6,'LABEL_WIDTH_DIVISOR':0xf};function formatElapsed(_0x293cf2){const _0x19c598=a42_0xc57567,_0x7adb8f=Math[_0x19c598(0x347)](_0x293cf2/0x3e8),_0x36d3db=Math['floor'](_0x7adb8f/0x3c),_0x1860d7=Math[_0x19c598(0x347)](_0x36d3db/0x3c),_0x30d076=Math[_0x19c598(0x347)](_0x1860d7/0x18);if(_0x30d076>0x0){const _0x1dbb59=_0x1860d7%0x18;return _0x1dbb59>0x0?_0x30d076+'d\x20'+_0x1dbb59+'h':_0x30d076+'d';}else{if(_0x1860d7>0x0){const _0x3f162a=_0x36d3db%0x3c;return _0x3f162a>0x0?_0x1860d7+'h\x20'+_0x3f162a+'m':_0x1860d7+'h';}else{if(_0x36d3db>0x0){const _0x427c4a=_0x7adb8f%0x3c;return _0x427c4a>0x0?_0x36d3db+'m\x20'+_0x427c4a+'s':_0x36d3db+'m';}else return _0x7adb8f+'s';}}}function a42_0x15e8(_0x32b26b,_0x38622b){_0x32b26b=_0x32b26b-0x1f4;const _0x4a1f13=a42_0x4a1f();let _0x15e8b6=_0x4a1f13[_0x32b26b];return _0x15e8b6;}function formatTimestamp(_0x17ee6b,_0x569a25){const _0x329e13=a42_0xc57567,_0x5c2e48=new Date(_0x17ee6b),_0x11f13b=String(_0x5c2e48[_0x329e13(0x33b)]())[_0x329e13(0x230)](0x2,'0'),_0x1f108b=String(_0x5c2e48[_0x329e13(0x337)]())[_0x329e13(0x230)](0x2,'0'),_0x49aa17=_0x11f13b+':'+_0x1f108b,_0x45178a=_0x5c2e48[_0x329e13(0x2d6)]()===_0x569a25[_0x329e13(0x2d6)]()&&_0x5c2e48['getMonth']()===_0x569a25[_0x329e13(0x29c)]()&&_0x5c2e48['getDate']()===_0x569a25['getDate']();if(_0x45178a)return _0x49aa17;else{const _0x2d3984=String(_0x5c2e48[_0x329e13(0x29c)]()+0x1)[_0x329e13(0x230)](0x2,'0'),_0x5c15f4=String(_0x5c2e48[_0x329e13(0x277)]())[_0x329e13(0x230)](0x2,'0');return _0x2d3984+'-'+_0x5c15f4+'\x20'+_0x49aa17;}}function formatDate(_0x3ffce4){const _0x12272e=a42_0xc57567,_0x3e7f73=_0x3ffce4['getFullYear'](),_0xb418cc=String(_0x3ffce4[_0x12272e(0x29c)]()+0x1)[_0x12272e(0x230)](0x2,'0'),_0x51876a=String(_0x3ffce4['getDate']())[_0x12272e(0x230)](0x2,'0');return _0x3e7f73+'-'+_0xb418cc+'-'+_0x51876a;}function getTaskStateIcon(_0x4c7064){const _0x5e9046={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x5e9046[_0x4c7064]||'⚪';}function getBarChar(_0x43bdeb){const _0x1af28a=a42_0xc57567;return _0x43bdeb===_0x1af28a(0x343)||_0x43bdeb===_0x1af28a(0x302)?'×':'─';}function getBarColor(_0x53ced5){const _0x322bf7=a42_0xc57567,_0xa1fd30={'success':a42_0x28d120[_0x322bf7(0x382)],'error':a42_0x28d120[_0x322bf7(0x356)],'group_error':a42_0x28d120[_0x322bf7(0x356)],'running':a42_0x28d120[_0x322bf7(0x1fd)],'blocked':a42_0x28d120['yellow'],'planned':a42_0x28d120[_0x322bf7(0x307)],'canceling':a42_0x28d120[_0x322bf7(0x2a1)]};return _0xa1fd30[_0x53ced5]||a42_0x28d120[_0x322bf7(0x341)];}function parseTaskName(_0x4aff2e){const _0x37ae8e=a42_0xc57567;let _0x406dfa=_0x4aff2e[_0x37ae8e(0x2fe)](/^\++/,'');const _0x5532b4=_0x406dfa[_0x37ae8e(0x294)]('+'),_0x4b5790=_0x5532b4[_0x37ae8e(0x22b)]>0x1?_0x5532b4['length']-0x2:0x0,_0x10d53b=_0x5532b4[_0x5532b4[_0x37ae8e(0x22b)]-0x1]||_0x406dfa;return{'level':_0x4b5790,'name':'+'+_0x10d53b};}function truncateTaskName(_0xbda6bb,_0x22cf0a){const _0x795a5e=a42_0xc57567,_0x48a0d4=stringWidth(_0xbda6bb);if(_0x48a0d4<=_0x22cf0a)return _0xbda6bb;let _0x1c5e81=_0xbda6bb;while(stringWidth(_0x1c5e81+'…')>_0x22cf0a&&_0x1c5e81[_0x795a5e(0x22b)]>0x0){_0x1c5e81=_0x1c5e81[_0x795a5e(0x273)](0x0,-0x1);}return _0x1c5e81+'…';}function calculateTimeScale(_0x2600fe,_0x378896){const _0x212a0c=a42_0xc57567;return{'startTime':_0x2600fe[_0x212a0c(0x37e)],'endTime':_0x2600fe['end'],'durationMs':_0x2600fe['duration'],'msPerChar':_0x2600fe[_0x212a0c(0x2f8)]/_0x378896};}function timeToPosition(_0x577238,_0x2ae3b9,_0x4a83b7){const _0x496ded=a42_0xc57567,_0x14d22d=_0x577238-_0x2ae3b9[_0x496ded(0x205)],_0x17d278=Math['floor'](_0x14d22d/_0x2ae3b9[_0x496ded(0x1fa)]);return Math[_0x496ded(0x30f)](0x0,Math['min'](_0x17d278,_0x4a83b7));}function renderTimeAxis(_0x423a88,_0x4a84ec){const _0x1fd693=a42_0xc57567,_0x3e6f41=Math[_0x1fd693(0x232)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x1fd693(0x30f)](TIMELINE_CONFIG[_0x1fd693(0x37b)],Math[_0x1fd693(0x347)](_0x4a84ec/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x2563cf=_0x423a88['durationMs']/(_0x3e6f41-0x1),_0x2a5bfb=new Date(_0x423a88[_0x1fd693(0x205)]),_0x46fa26=[];for(let _0x42a5a0=0x0;_0x42a5a0<_0x3e6f41;_0x42a5a0++){const _0x1745c9=_0x423a88[_0x1fd693(0x205)]+_0x42a5a0*_0x2563cf,_0x3fcd92=timeToPosition(_0x1745c9,_0x423a88,_0x4a84ec),_0x47777c=formatTimestamp(_0x1745c9,_0x2a5bfb);_0x46fa26[_0x1fd693(0x2c5)]({'pos':_0x3fcd92,'text':_0x47777c});}const _0x253554=new Array(_0x4a84ec)[_0x1fd693(0x261)]('\x20');let _0x5ca6ca=-0x1;for(const {pos:_0x2078f4,text:_0x553c9d}of _0x46fa26){let _0x32ee7e=Math['max'](0x0,_0x2078f4-Math['floor'](_0x553c9d[_0x1fd693(0x22b)]/0x2));_0x32ee7e<=_0x5ca6ca+TIMELINE_CONFIG[_0x1fd693(0x2af)]&&(_0x32ee7e=_0x5ca6ca+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x32ee7e+_0x553c9d[_0x1fd693(0x22b)]>_0x4a84ec&&(_0x32ee7e=_0x4a84ec-_0x553c9d[_0x1fd693(0x22b)]);if(_0x32ee7e>=0x0&&_0x32ee7e+_0x553c9d[_0x1fd693(0x22b)]<=_0x4a84ec&&_0x32ee7e>_0x5ca6ca){for(let _0xa2b5d4=0x0;_0xa2b5d4<_0x553c9d['length'];_0xa2b5d4++){_0x253554[_0x32ee7e+_0xa2b5d4]=_0x553c9d[_0xa2b5d4];}_0x5ca6ca=_0x32ee7e+_0x553c9d['length']-0x1;}}return _0x253554[_0x1fd693(0x238)]('');}function renderTaskRow(_0x201b52,_0x5277eb,_0x5385e2,_0x496ffa){const _0x2f6592=a42_0xc57567,{level:_0x34d3c4,name:_0x41336a}=parseTaskName(_0x201b52[_0x2f6592(0x331)]),_0x5da872='\x20'['repeat'](_0x34d3c4),_0x11236d=_0x201b52[_0x2f6592(0x215)]?'('+formatElapsed(_0x201b52[_0x2f6592(0x215)][_0x2f6592(0x2f8)])+')':'',_0x3e2bae=stringWidth(_0x11236d),_0x4a9ba1=_0x34d3c4*0x1,_0x400b6d=_0x496ffa-_0x4a9ba1-_0x3e2bae-0x1,_0x3b9fb1=truncateTaskName(_0x41336a,_0x400b6d),_0x3ce738=_0x5da872+_0x3b9fb1,_0x5582e1=stringWidth(_0x3ce738),_0x2bb3bf=_0x496ffa-_0x5582e1-_0x3e2bae,_0x37edfe=_0x3ce738+'\x20'[_0x2f6592(0x335)](Math[_0x2f6592(0x30f)](0x1,_0x2bb3bf))+a42_0x28d120[_0x2f6592(0x307)](_0x11236d),_0x510856=getTaskStateIcon(_0x201b52['state']),_0x58e869=new Array(_0x5385e2)['fill']('\x20');if(_0x201b52['window']){const _0xb92581=timeToPosition(_0x201b52[_0x2f6592(0x215)]['start'],_0x5277eb,_0x5385e2),_0x3dd670=timeToPosition(_0x201b52[_0x2f6592(0x215)][_0x2f6592(0x34b)],_0x5277eb,_0x5385e2),_0x27b16f=getBarChar(_0x201b52[_0x2f6592(0x21c)]),_0x1c3cb5=Math[_0x2f6592(0x30f)](_0xb92581+0x1,_0x3dd670);for(let _0x1c0e0a=_0xb92581;_0x1c0e0a<Math[_0x2f6592(0x232)](_0x1c3cb5,_0x5385e2);_0x1c0e0a++){_0x58e869[_0x1c0e0a]=_0x27b16f;}}const _0x305132=getBarColor(_0x201b52[_0x2f6592(0x21c)]),_0x215f13=_0x58e869[_0x2f6592(0x27a)](_0x1e244a=>_0x1e244a==='\x20'?'\x20':_0x305132(_0x1e244a))[_0x2f6592(0x238)]('');return _0x510856+'\x20'+_0x37edfe+'│'+_0x215f13+'│';}function calculateStats(_0x34b0f2){const _0x54ecf3=a42_0xc57567,_0x62fe07={'total':_0x34b0f2[_0x54ecf3(0x22b)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0xdc6723 of _0x34b0f2){if(_0xdc6723[_0x54ecf3(0x21c)]===_0x54ecf3(0x32b))_0x62fe07[_0x54ecf3(0x32b)]++;else{if(_0xdc6723[_0x54ecf3(0x21c)]===_0x54ecf3(0x343)||_0xdc6723[_0x54ecf3(0x21c)]==='group_error')_0x62fe07[_0x54ecf3(0x343)]++;else _0xdc6723[_0x54ecf3(0x21c)]===_0x54ecf3(0x272)?_0x62fe07[_0x54ecf3(0x272)]++:_0x62fe07[_0x54ecf3(0x29a)]++;}}return _0x62fe07;}function formatStats(_0x330136){const _0x263d6d=a42_0xc57567;return[_0x263d6d(0x344)+_0x330136['total'],'✅\x20'+_0x330136[_0x263d6d(0x32b)],'❌\x20'+_0x330136[_0x263d6d(0x343)],_0x263d6d(0x245)+_0x330136['running'],'⏳\x20'+_0x330136['pending']]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']='workflow:timeline';[a42_0xc57567(0x371)]=a42_0xc57567(0x214);async[a42_0xc57567(0x2dc)](_0x3e88d7){const _0x509f8d=a42_0xc57567,{options:_0x141796,args:_0x8f2c0e,tdx:_0x21e2f4}=_0x3e88d7;let _0x554ddf,_0x13767c,_0x4acf7c=![];if(_0x8f2c0e[0x0]){if(_0x8f2c0e[0x0]['includes']('.')){const _0x56162a=this[_0x509f8d(0x323)](_0x8f2c0e,_0x141796);if(!_0x56162a)return 0x1;_0x554ddf=_0x56162a['projectName'],_0x13767c=_0x56162a[_0x509f8d(0x31e)];}else{_0x13767c=_0x8f2c0e[0x0],_0x554ddf=_0x141796[_0x509f8d(0x220)];if(!_0x554ddf)return console['error'](a42_0x28d120[_0x509f8d(0x356)](_0x509f8d(0x2c8)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x4acf7c=!![];}}else{const _0x2c8be5=this[_0x509f8d(0x323)](_0x8f2c0e,_0x141796);if(!_0x2c8be5)return 0x1;_0x554ddf=_0x2c8be5[_0x509f8d(0x2d3)],_0x13767c=_0x2c8be5[_0x509f8d(0x31e)];}if(_0x141796[_0x509f8d(0x250)]){if(_0x554ddf&&_0x13767c)console['error'](_0x509f8d(0x2ef)+_0x554ddf+'.'+_0x13767c);else _0x554ddf&&console['error']('Filter:\x20project='+_0x554ddf);}const _0x528864=_0x141796[_0x509f8d(0x270)],_0x2c1180=_0x141796[_0x509f8d(0x1f6)];if(_0x528864){_0x2c1180&&console['error'](a42_0x28d120[_0x509f8d(0x2a1)]('Warning:'),_0x509f8d(0x2e1));const _0x4501ca=_0x141796[_0x509f8d(0x242)];return _0x4501ca?await this['pollTimeline'](_0x3e88d7,_0x528864):await this[_0x509f8d(0x2b5)](_0x3e88d7,_0x528864,_0x141796),0x0;}if(_0x2c1180){const _0xedc3ca=await withSpinner('Loading\x20session...',()=>_0x21e2f4[_0x509f8d(0x2da)]['sessions']({'projectName':_0x554ddf,'workflowName':_0x13767c,'limit':0x64}),{'verbose':_0x141796[_0x509f8d(0x250)]}),_0x397413=_0xedc3ca[_0x509f8d(0x201)]['find'](_0x518a33=>_0x518a33['id']===_0x2c1180);if(!_0x397413)return console['error'](a42_0x28d120['red'](_0x509f8d(0x2c8)),_0x509f8d(0x327)+_0x2c1180),0x1;if(!_0x397413['lastAttempt']?.['id'])return console['error'](a42_0x28d120[_0x509f8d(0x356)](_0x509f8d(0x2c8)),_0x509f8d(0x27f)+_0x2c1180+'\x20has\x20no\x20attempts'),0x1;const _0x4617a5=_0x397413['lastAttempt']['id'];_0x141796[_0x509f8d(0x250)]&&console[_0x509f8d(0x343)](_0x509f8d(0x256)+_0x4617a5+_0x509f8d(0x1f8)+_0x2c1180);const _0x303242=_0x141796[_0x509f8d(0x242)];return _0x303242?await this['pollTimeline'](_0x3e88d7,_0x4617a5):await this[_0x509f8d(0x2b5)](_0x3e88d7,_0x4617a5,_0x141796),0x0;}const _0x3a1777=await withSpinner(_0x509f8d(0x259),()=>_0x21e2f4[_0x509f8d(0x2da)][_0x509f8d(0x2d4)]({'projectName':_0x554ddf,'workflowName':_0x13767c,'limit':_0x141796[_0x509f8d(0x22d)]||0x32}),{'verbose':_0x141796[_0x509f8d(0x250)]}),_0x51456d=_0x3a1777[_0x509f8d(0x201)];if(_0x51456d[_0x509f8d(0x22b)]===0x0){if(_0x554ddf&&_0x13767c)console['error'](_0x509f8d(0x269)+_0x554ddf+'.'+_0x13767c);else _0x554ddf?console[_0x509f8d(0x343)](_0x509f8d(0x32a)+_0x554ddf):(console[_0x509f8d(0x343)](_0x509f8d(0x2f5)),console[_0x509f8d(0x343)](a42_0x28d120['dim'](_0x509f8d(0x38d))));return 0x0;}_0x51456d['sort']((_0x4b3906,_0x592228)=>{const _0x4ab3ba=_0x509f8d,_0x1b934e=_0x4b3906['sessionTime']||'',_0x10c28c=_0x592228[_0x4ab3ba(0x24f)]||'';return _0x10c28c[_0x4ab3ba(0x2f1)](_0x1b934e);});if(_0x141796['json']||_0x141796[_0x509f8d(0x39a)])return await handleSDKOutput(_0x51456d,_0x141796),0x0;let _0x3d1e49;if(_0x4acf7c){const _0x10ff7d=_0x51456d[0x0];if(!_0x10ff7d[_0x509f8d(0x2a9)]?.['id'])return console[_0x509f8d(0x343)](_0x509f8d(0x378)),0x0;_0x3d1e49=_0x10ff7d[_0x509f8d(0x2a9)]['id'],_0x141796[_0x509f8d(0x250)]&&console[_0x509f8d(0x343)](_0x509f8d(0x25c)+_0x10ff7d[_0x509f8d(0x24f)]);}else{const _0x449043=_0x51456d[_0x509f8d(0x27a)](_0xf32003=>{const _0x414d71=_0x509f8d,_0xb893af=getAttemptStatusDisplay(_0xf32003[_0x414d71(0x2a9)]);return{'title':_0xf32003[_0x414d71(0x296)]?.[_0x414d71(0x331)]+'.'+_0xf32003[_0x414d71(0x2da)]?.[_0x414d71(0x331)]+_0x414d71(0x379)+_0xf32003[_0x414d71(0x24f)]+'\x20'+_0xb893af[_0x414d71(0x24c)],'value':_0xf32003[_0x414d71(0x2a9)]?.['id']||'','description':_0xb893af[_0x414d71(0x1f5)]};}),_0x345a7b=await a42_0x4fae({'type':_0x509f8d(0x2ff),'name':_0x509f8d(0x270),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x449043[_0x509f8d(0x36b)](_0x4a446e=>_0x4a446e['value']!=='')});if(!_0x345a7b['attemptId'])return 0x0;_0x3d1e49=_0x345a7b[_0x509f8d(0x270)];}const _0x8e5725=_0x141796[_0x509f8d(0x242)];return _0x8e5725?await this[_0x509f8d(0x2cd)](_0x3e88d7,_0x3d1e49):await this['renderSingleTimeline'](_0x3e88d7,_0x3d1e49,_0x141796),0x0;}async[a42_0xc57567(0x2b5)](_0x3660e9,_0x49d0c,_0xcb2d63){const _0x31ab6a=a42_0xc57567,{tdx:_0x401bf7}=_0x3660e9;let _0x112719,_0x473061;try{[_0x112719,_0x473061]=await Promise[_0x31ab6a(0x308)]([_0x401bf7[_0x31ab6a(0x2da)]['attempt'](_0x49d0c),_0x401bf7[_0x31ab6a(0x2da)][_0x31ab6a(0x332)](_0x49d0c,![])]);}catch(_0x5ddd77){console['error'](a42_0x28d120[_0x31ab6a(0x356)](_0x31ab6a(0x2a2)));_0xcb2d63[_0x31ab6a(0x250)]&&console[_0x31ab6a(0x343)](_0x5ddd77);throw _0x5ddd77;}if(_0xcb2d63[_0x31ab6a(0x1fc)]||_0xcb2d63[_0x31ab6a(0x39a)]){const _0xd45372=this['buildTimelineData'](_0x112719,_0x473061);await handleSDKOutput([_0xd45372],_0xcb2d63);return;}const _0x564efd=_0x401bf7[_0x31ab6a(0x2cc)][_0x31ab6a(0x31d)],_0x135820=this['renderTimeline'](_0x112719,_0x473061,_0x564efd);console['log'](_0x135820);}async['pollTimeline'](_0x3283c0,_0x174071){const _0x3b1f65=a42_0xc57567,{tdx:_0x244cf4}=_0x3283c0,_0x4e68ad=TIMELINE_CONFIG[_0x3b1f65(0x2f4)],_0x4a4c86=TIMELINE_CONFIG[_0x3b1f65(0x223)];let _0x174704=0x0;while(_0x174704<_0x4a4c86){process['stdout'][_0x3b1f65(0x24d)]&&process[_0x3b1f65(0x297)][_0x3b1f65(0x268)]('\x1bc');let _0x1ee991,_0x36cf6e;try{[_0x1ee991,_0x36cf6e]=await Promise[_0x3b1f65(0x308)]([_0x244cf4[_0x3b1f65(0x2da)][_0x3b1f65(0x320)](_0x174071),_0x244cf4['workflow'][_0x3b1f65(0x332)](_0x174071,![])]);}catch(_0x3b1bb0){console['error'](a42_0x28d120[_0x3b1f65(0x356)](_0x3b1f65(0x30b)));_0x174704>0x0&&console[_0x3b1f65(0x343)](a42_0x28d120['dim'](_0x3b1f65(0x35e)+_0x174704));throw _0x3b1bb0;}const _0x38e3bd=_0x244cf4[_0x3b1f65(0x2cc)]['site'],_0x4cfd73=this[_0x3b1f65(0x263)](_0x1ee991,_0x36cf6e,_0x38e3bd);console[_0x3b1f65(0x385)](_0x4cfd73);const _0x1bfa96=_0x1ee991[_0x3b1f65(0x21e)]&&_0x36cf6e['every'](_0xa9b058=>_0xa9b058[_0x3b1f65(0x21c)]!==_0x3b1f65(0x272)&&_0xa9b058[_0x3b1f65(0x21c)]!==_0x3b1f65(0x26f));if(_0x1bfa96){console[_0x3b1f65(0x343)](a42_0x28d120[_0x3b1f65(0x382)](_0x3b1f65(0x33f)));break;}console[_0x3b1f65(0x343)](a42_0x28d120['dim'](_0x3b1f65(0x2b6)+_0x174704*0x2+_0x3b1f65(0x26a))),await new Promise(_0x401853=>setTimeout(_0x401853,_0x4e68ad)),_0x174704++;}_0x174704>=_0x4a4c86&&console['error'](a42_0x28d120[_0x3b1f65(0x2a1)](_0x3b1f65(0x367)));}['renderTimeline'](_0x5e3b8f,_0x413423,_0x89d09f){const _0x2f4df7=a42_0xc57567,_0x118eae=[],_0x3b01aa=TIMELINE_CONFIG[_0x2f4df7(0x2d0)],_0x7333b6=0x5,_0xe394f0=process[_0x2f4df7(0x297)][_0x2f4df7(0x350)]||0x78,_0x486a08=_0xe394f0-_0x3b01aa-_0x7333b6,_0x66b25d=Math[_0x2f4df7(0x30f)](TIMELINE_CONFIG[_0x2f4df7(0x365)],Math[_0x2f4df7(0x232)](_0x486a08,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x162c1e=new Date(_0x5e3b8f[_0x2f4df7(0x2ac)])[_0x2f4df7(0x2e8)](),_0x16e11e=_0x5e3b8f[_0x2f4df7(0x23f)]?new Date(_0x5e3b8f[_0x2f4df7(0x23f)])['getTime']():Date[_0x2f4df7(0x2c1)](),_0x410ed9={'start':_0x162c1e,'end':_0x16e11e,'duration':_0x16e11e-_0x162c1e},_0x4e67cc=new Map(),_0x1f06f3=[];for(const _0x485045 of _0x413423){if(_0x485045[_0x2f4df7(0x28e)]){const _0x3a2869=new Date(_0x485045[_0x2f4df7(0x28e)])['getTime'](),_0xc1eedd=_0x485045['updatedAt']?new Date(_0x485045[_0x2f4df7(0x34c)])[_0x2f4df7(0x2e8)]():Date[_0x2f4df7(0x2c1)](),_0x190fcc={'start':_0x3a2869,'end':_0xc1eedd,'duration':_0xc1eedd-_0x3a2869};_0x4e67cc[_0x2f4df7(0x25a)](_0x485045['id'],_0x190fcc),_0x1f06f3[_0x2f4df7(0x2c5)]({'name':_0x485045[_0x2f4df7(0x369)],'state':_0x485045[_0x2f4df7(0x21c)]||'unknown','window':_0x190fcc});}else _0x1f06f3['push']({'name':_0x485045[_0x2f4df7(0x369)],'state':_0x485045[_0x2f4df7(0x21c)]||_0x2f4df7(0x26f),'window':undefined});}_0x1f06f3[_0x2f4df7(0x208)]((_0x46241a,_0x5972f6)=>{const _0x565dd7=_0x2f4df7;if(!_0x46241a[_0x565dd7(0x215)])return 0x1;if(!_0x5972f6['window'])return-0x1;return _0x46241a[_0x565dd7(0x215)][_0x565dd7(0x37e)]-_0x5972f6['window'][_0x565dd7(0x37e)];});const _0x13bc23=_0x1f06f3[_0x2f4df7(0x22b)],_0x2b7fb5=_0x13bc23>TIMELINE_CONFIG[_0x2f4df7(0x210)];_0x2b7fb5&&_0x1f06f3[_0x2f4df7(0x340)](TIMELINE_CONFIG[_0x2f4df7(0x210)]);const _0x55da35=calculateTimeScale(_0x410ed9,_0x66b25d),_0x3c8994=_0x5e3b8f[_0x2f4df7(0x21e)]?_0x5e3b8f[_0x2f4df7(0x32b)]?a42_0x28d120[_0x2f4df7(0x382)](_0x2f4df7(0x32b)):a42_0x28d120['red'](_0x2f4df7(0x343)):a42_0x28d120['blue'](_0x2f4df7(0x272)),_0x36c250=_0x5e3b8f['project']?.['id'],_0x2c338a=_0x5e3b8f[_0x2f4df7(0x1f6)];let _0x3e46b3;if(_0x36c250&&_0x2c338a){const _0x2e408e=getWorkflowAttemptUrl(_0x89d09f,_0x36c250,_0x2c338a,_0x5e3b8f['id']);_0x3e46b3=hyperlink(a42_0x28d120[_0x2f4df7(0x307)](_0x5e3b8f['id']),_0x2e408e);}else _0x3e46b3=a42_0x28d120[_0x2f4df7(0x307)](_0x5e3b8f['id']);_0x118eae[_0x2f4df7(0x2c5)](_0x2f4df7(0x204)+_0x3e46b3+'\x20-\x20'+_0x3c8994+_0x2f4df7(0x379)+formatElapsed(_0x410ed9[_0x2f4df7(0x2f8)]));if(_0x1f06f3['length']>0x0){const _0x2be27f=renderTimeAxis(_0x55da35,_0x66b25d),_0x4eb712=new Date(_0x410ed9[_0x2f4df7(0x37e)]),_0x21f8c2=formatDate(_0x4eb712),_0x2f0bdd=TIMELINE_CONFIG[_0x2f4df7(0x360)]+TIMELINE_CONFIG[_0x2f4df7(0x27e)]+_0x3b01aa,_0x1da3dc=_0x21f8c2['padStart'](_0x2f0bdd),_0x2a79f6=a42_0x28d120[_0x2f4df7(0x307)](_0x1da3dc);_0x118eae[_0x2f4df7(0x2c5)](_0x2a79f6+'\x20'+_0x2be27f);for(const _0x4bdc58 of _0x1f06f3){_0x118eae['push'](renderTaskRow(_0x4bdc58,_0x55da35,_0x66b25d,_0x3b01aa));}const _0x49c635=calculateStats(_0x1f06f3);_0x118eae[_0x2f4df7(0x2c5)](formatStats(_0x49c635)),_0x2b7fb5&&_0x118eae['push'](a42_0x28d120[_0x2f4df7(0x2a1)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0x2f4df7(0x210)]+'\x20of\x20'+_0x13bc23+'\x20tasks')),_0x118eae[_0x2f4df7(0x2c5)](''),_0x118eae[_0x2f4df7(0x2c5)](a42_0x28d120[_0x2f4df7(0x307)](_0x2f4df7(0x20a))+('tdx\x20wf\x20attempt\x20'+_0x5e3b8f['id']+_0x2f4df7(0x31c))+a42_0x28d120['dim'](_0x2f4df7(0x326)));}else _0x118eae[_0x2f4df7(0x2c5)](_0x2f4df7(0x264));return _0x118eae[_0x2f4df7(0x238)]('\x0a');}[a42_0xc57567(0x203)](_0x55ef5b,_0x2e4833){const _0x52b31d=a42_0xc57567,_0x5e5654=new Date(_0x55ef5b[_0x52b31d(0x2ac)])[_0x52b31d(0x2e8)](),_0x1fcc3d=_0x55ef5b[_0x52b31d(0x23f)]?new Date(_0x55ef5b[_0x52b31d(0x23f)])[_0x52b31d(0x2e8)]():Date[_0x52b31d(0x2c1)](),_0x641b80=_0x1fcc3d-_0x5e5654,_0x449c8d=[];for(const _0x1e97e2 of _0x2e4833){if(_0x1e97e2[_0x52b31d(0x28e)]){const _0x3f1e73=new Date(_0x1e97e2['startedAt'])[_0x52b31d(0x2e8)](),_0xcddebc=_0x1e97e2[_0x52b31d(0x34c)]?new Date(_0x1e97e2[_0x52b31d(0x34c)])[_0x52b31d(0x2e8)]():Date[_0x52b31d(0x2c1)]();_0x449c8d[_0x52b31d(0x2c5)]({'name':_0x1e97e2[_0x52b31d(0x369)],'state':_0x1e97e2['state']||_0x52b31d(0x231),'window':{'start':_0x3f1e73,'end':_0xcddebc,'duration':_0xcddebc-_0x3f1e73}});}else _0x449c8d[_0x52b31d(0x2c5)]({'name':_0x1e97e2[_0x52b31d(0x369)],'state':_0x1e97e2[_0x52b31d(0x21c)]||_0x52b31d(0x26f),'window':undefined});}const _0x4d2437=calculateStats(_0x449c8d);return{'attempt':{'id':_0x55ef5b['id'],'status':_0x55ef5b['done']?_0x55ef5b[_0x52b31d(0x32b)]?_0x52b31d(0x32b):_0x52b31d(0x343):_0x52b31d(0x272),'createdAt':_0x55ef5b[_0x52b31d(0x2ac)],'finishedAt':_0x55ef5b[_0x52b31d(0x23f)],'duration_ms':_0x641b80},'tasks':_0x449c8d[_0x52b31d(0x27a)](_0x1fa5ab=>({'name':_0x1fa5ab[_0x52b31d(0x331)],'state':_0x1fa5ab[_0x52b31d(0x21c)],'startedAt':_0x1fa5ab[_0x52b31d(0x215)]?new Date(_0x1fa5ab[_0x52b31d(0x215)]['start'])[_0x52b31d(0x28c)]():null,'updatedAt':_0x1fa5ab[_0x52b31d(0x215)]?new Date(_0x1fa5ab[_0x52b31d(0x215)][_0x52b31d(0x34b)])[_0x52b31d(0x28c)]():null,'duration_ms':_0x1fa5ab[_0x52b31d(0x215)]?.[_0x52b31d(0x2f8)]||null})),'stats':_0x4d2437};}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a43_0x1e61(_0x590877,_0x59f26a){_0x590877=_0x590877-0x160;const _0x44b142=a43_0x44b1();let _0x1e61b0=_0x44b142[_0x590877];return _0x1e61b0;}(function(_0x460718,_0x469b3c){const _0x11e9c0=a43_0x1e61,_0x3af544=_0x460718();while(!![]){try{const _0x16ee1f=-parseInt(_0x11e9c0(0x164))/0x1+-parseInt(_0x11e9c0(0x172))/0x2*(parseInt(_0x11e9c0(0x16f))/0x3)+parseInt(_0x11e9c0(0x167))/0x4*(-parseInt(_0x11e9c0(0x168))/0x5)+-parseInt(_0x11e9c0(0x163))/0x6+parseInt(_0x11e9c0(0x160))/0x7+parseInt(_0x11e9c0(0x165))/0x8*(-parseInt(_0x11e9c0(0x16e))/0x9)+parseInt(_0x11e9c0(0x16d))/0xa;if(_0x16ee1f===_0x469b3c)break;else _0x3af544['push'](_0x3af544['shift']());}catch(_0x4ce7b8){_0x3af544['push'](_0x3af544['shift']());}}}(a43_0x44b1,0x408a4));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 _0x1b6a0d=a43_0x1e61,_0x130966=getVersion(),_0x34d256=platform(),_0x1af5f2=process[_0x1b6a0d(0x162)][_0x1b6a0d(0x16c)]('v','');return _0x1b6a0d(0x169)+_0x130966+'\x20('+_0x34d256+_0x1b6a0d(0x16a)+_0x1af5f2+')';}export function getAuthHeaders(_0x500645,_0x53af4c){const _0x4b590f=a43_0x1e61,_0x3575e7=getVersion(),_0x2800ad={'User-Agent':getUserAgent(),'X-TD-Client':_0x4b590f(0x161),'X-TD-Client-Version':_0x3575e7};return _0x53af4c&&(_0x2800ad['Authorization']=_0x4b590f(0x170)+_0x53af4c),_0x2800ad;}export function toHeaderRecord(_0x3a81c8){const _0x10cb4e=a43_0x1e61,_0x99d48a={};for(const [_0x3241cb,_0x7d0f0c]of Object[_0x10cb4e(0x166)](_0x3a81c8)){_0x7d0f0c!==undefined&&(_0x99d48a[_0x3241cb]=_0x7d0f0c);}return _0x99d48a;}function a43_0x44b1(){const _0x2b51b9=['3030210IuPloj','194459QMZhaz','88MqnpoW','entries','601736XJSdIG','10nNKzLg','tdx/',';\x20node/','Authorization','replace','16757160qHIspi','191502HvYETw','715461HJFcph','TD1\x20','X-Trino-User','2WVKhIE','430829ttcnKO','tdx','version'];a43_0x44b1=function(){return _0x2b51b9;};return a43_0x44b1();}export function getTrinoHeaders(_0x371ea0,_0xeef7c5){const _0x27222f=a43_0x1e61,_0x33e9ca=getAuthHeaders(_0x371ea0,_0xeef7c5),_0x40c3e2=toHeaderRecord(_0x33e9ca);return delete _0x40c3e2[_0x27222f(0x16b)],_0xeef7c5&&(_0x40c3e2[_0x27222f(0x171)]=_0xeef7c5),_0x40c3e2;}export function hasAPIKey(_0x4955f6){const _0x3fb07e=getAPIKey();return _0x3fb07e!==undefined&&_0x3fb07e['length']>0x0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x400253,_0x121b9e){const _0x47dd4f=a44_0x445d,_0x37a370=_0x400253();while(!![]){try{const _0x53ea11=-parseInt(_0x47dd4f(0x103))/0x1*(parseInt(_0x47dd4f(0x129))/0x2)+parseInt(_0x47dd4f(0x135))/0x3+parseInt(_0x47dd4f(0x138))/0x4+parseInt(_0x47dd4f(0x133))/0x5*(parseInt(_0x47dd4f(0xf7))/0x6)+parseInt(_0x47dd4f(0x105))/0x7+-parseInt(_0x47dd4f(0x116))/0x8*(parseInt(_0x47dd4f(0x134))/0x9)+parseInt(_0x47dd4f(0xfd))/0xa*(parseInt(_0x47dd4f(0x101))/0xb);if(_0x53ea11===_0x121b9e)break;else _0x37a370['push'](_0x37a370['shift']());}catch(_0x16f423){_0x37a370['push'](_0x37a370['shift']());}}}(a44_0x36dd,0x3f78d));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a44_0x536345 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';function a44_0x445d(_0x2c3e8f,_0x3843e6){_0x2c3e8f=_0x2c3e8f-0xf4;const _0x36dd06=a44_0x36dd();let _0x445db1=_0x36dd06[_0x2c3e8f];return _0x445db1;}export function isStructuredFormat(_0x4406bd){const _0x1ff3f1=a44_0x445d;return _0x4406bd['format']===_0x1ff3f1(0x10a)||_0x4406bd[_0x1ff3f1(0x12a)]==='jsonl'||_0x4406bd['format']===_0x1ff3f1(0x11b)||_0x4406bd['format']===_0x1ff3f1(0xfa)||_0x4406bd[_0x1ff3f1(0x10a)]===!![]||_0x4406bd[_0x1ff3f1(0x12f)]===!![]||_0x4406bd[_0x1ff3f1(0x11b)]===!![]||_0x4406bd[_0x1ff3f1(0xfa)]===!![];}export function parseOutputOptions(_0x3ba962){const _0x1d953c=a44_0x445d;return{'format':_0x3ba962['format']||_0x1d953c(0xfa),'output':_0x3ba962[_0x1d953c(0x123)]||'','limit':_0x3ba962[_0x1d953c(0xf5)],'color':_0x3ba962[_0x1d953c(0x118)],'noColor':_0x3ba962['noColor']};}function convertSDKResultToQueryResult(_0x8b4542){const _0x2241a4=a44_0x445d,_0x56b30a=[];if(_0x8b4542['length']>0x0){const _0x3db39d=_0x8b4542[0x0];for(const [_0x196223,_0xcb9839]of Object[_0x2241a4(0x130)](_0x3db39d)){let _0x2786f5=_0x2241a4(0xfe);if(typeof _0xcb9839==='number')_0x2786f5=Number['isInteger'](_0xcb9839)?_0x2241a4(0x108):_0x2241a4(0xf4);else{if(typeof _0xcb9839===_0x2241a4(0x137))_0x2786f5=_0x2241a4(0x137);else _0xcb9839===null&&(_0x2786f5=_0x2241a4(0xfe));}_0x56b30a[_0x2241a4(0x132)]({'name':_0x196223,'type':_0x2786f5});}}return{'queryId':'sdk-result','columns':_0x56b30a,'data':_0x8b4542,'stats':{'state':_0x2241a4(0x10b),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x8b4542[_0x2241a4(0x113)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x502353,_0x3707f2){const _0x47fc09=convertSDKResultToQueryResult(_0x502353);return formatQueryOutput(_0x47fc09,_0x3707f2);}export async function formatQueryOutput(_0x1d0bb0,_0x4bb41b){const _0x20ed06=a44_0x445d,{format:_0xf63eb6,limit:_0x53ec17,output:_0x3ad1f8,color:_0xe58a2a,noColor:_0x3df7b1}=_0x4bb41b,_0x3a9d94=Boolean(_0x3ad1f8)&&!_0xe58a2a,_0x5a5555={'color':_0xe58a2a,'noColor':_0x3df7b1||_0x3a9d94};if(_0xf63eb6==='table'){const _0x23894e=shouldUseLess(_0xf63eb6,_0x3ad1f8);return formatAsTable(_0x1d0bb0,_0x53ec17,_0x23894e,_0x5a5555);}else{if(_0xf63eb6===_0x20ed06(0x10a))return formatAsJSON(_0x1d0bb0,_0x5a5555);else return _0xf63eb6==='jsonl'?formatAsJSONL(_0x1d0bb0,_0x5a5555):formatQueryResult(_0x1d0bb0,_0xf63eb6);}}function shouldUseLess(_0x328c66,_0x4daabe){const _0x428b85=a44_0x445d;return(_0x328c66==='table'||_0x328c66===_0x428b85(0x107))&&process[_0x428b85(0x136)][_0x428b85(0x128)]&&!_0x4daabe;}export function resolveOutputOptions(_0x1565f6){const _0x2525a1=a44_0x445d,_0x19f900=resolveOutputFormat(_0x1565f6[_0x2525a1(0x12a)],_0x1565f6[_0x2525a1(0x123)],_0x2525a1(0xfa));let _0x1ad275=typeof _0x1565f6[_0x2525a1(0xf5)]===_0x2525a1(0x10c)?_0x1565f6[_0x2525a1(0xf5)]:parseInt(_0x1565f6['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x433e79=_0x1565f6[_0x2525a1(0x123)]||'';return shouldUseLess(_0x19f900,_0x433e79)&&(_0x1ad275=Infinity),{'format':_0x19f900,'output':_0x433e79,'limit':_0x1ad275,'color':_0x1565f6[_0x2525a1(0x118)],'noColor':_0x1565f6[_0x2525a1(0x10f)]};}export function writeOutput(_0x1bdbc3,_0x84d85f,_0x25f63c){const _0x49eda8=a44_0x445d;return _0x84d85f?(writeFileSync(_0x84d85f,_0x1bdbc3),console[_0x49eda8(0x114)]('Results\x20saved\x20to\x20'+_0x84d85f),Promise[_0x49eda8(0x11c)]()):shouldUseLess(_0x25f63c||'','')?new Promise(_0x4e6940=>{const _0x5d19b5=_0x49eda8,_0x42e3cf=spawn('less',[_0x5d19b5(0x10e)],{'stdio':['pipe','inherit','inherit']});let _0x129715=![];_0x42e3cf['on']('error',()=>{const _0x4ba726=_0x5d19b5;!_0x129715&&(_0x129715=!![],console[_0x4ba726(0x117)](_0x1bdbc3),_0x4e6940());}),_0x42e3cf['on'](_0x5d19b5(0x11f),()=>{!_0x129715&&(_0x129715=!![],_0x4e6940());}),_0x42e3cf['on'](_0x5d19b5(0x102),()=>{const _0x585965=_0x5d19b5;!_0x129715&&_0x42e3cf[_0x585965(0x104)]&&(_0x42e3cf['stdin']['on'](_0x585965(0x114),()=>{}),_0x42e3cf['stdin']['write'](_0x1bdbc3),_0x42e3cf[_0x585965(0x104)][_0x585965(0x110)]());}),!_0x42e3cf['stdin']&&(!_0x129715&&(_0x129715=!![],console[_0x5d19b5(0x117)](_0x1bdbc3),_0x4e6940()));}):(console[_0x49eda8(0x117)](_0x1bdbc3),Promise[_0x49eda8(0x11c)]());}export async function handleSDKOutput(_0x129890,_0x2c5da5){const _0x4ab58c=a44_0x445d,_0x16e99d=resolveOutputOptions(_0x2c5da5),_0x3db552=await formatSDKOutput(_0x129890,_0x16e99d);await writeOutput(_0x3db552,_0x16e99d['output']||undefined,_0x16e99d[_0x4ab58c(0x12a)]);}export async function handleQueryOutput(_0x1f799d,_0x3f3883){const _0x431c29=a44_0x445d,_0x7dc539=resolveOutputOptions(_0x3f3883),_0x1043c2=await formatQueryOutput(_0x1f799d,_0x7dc539);await writeOutput(_0x1043c2,_0x7dc539[_0x431c29(0x123)]||undefined,_0x7dc539[_0x431c29(0x12a)]);}async function formatSingleObject(_0x3afc5a,_0x31ea12){const _0x33f71a=a44_0x445d,{format:_0x17a7b5,color:_0x2de9db,noColor:_0x19a135}=_0x31ea12,_0x10ee3e={'color':_0x2de9db,'noColor':_0x19a135};if(_0x17a7b5===_0x33f71a(0x10a)){if(shouldUseColor(_0x10ee3e))return colorizeJSON(_0x3afc5a,_0x10ee3e);return JSON[_0x33f71a(0x121)](_0x3afc5a,null,0x2);}else{if(_0x17a7b5==='jsonl'){if(shouldUseColor(_0x10ee3e))return colorizeJSONCompact(_0x3afc5a,_0x10ee3e);return JSON[_0x33f71a(0x121)](_0x3afc5a);}else{if(_0x17a7b5===_0x33f71a(0x11b))return Object[_0x33f71a(0x130)](_0x3afc5a)[_0x33f71a(0x115)](([_0x5f3c05,_0x2fc88f])=>_0x5f3c05+'\x09'+_0x2fc88f)[_0x33f71a(0x11d)]('\x0a');else{const _0xcba284=Object[_0x33f71a(0x130)](_0x3afc5a);if(_0xcba284[_0x33f71a(0x113)]===0x0)return'No\x20data';const _0x3a136e=_0x3afc5a[_0x33f71a(0xfc)],_0x16535e=_0x3afc5a['query'],_0x33313f=_0x3afc5a['params'],_0x551240=_0x3afc5a[_0x33f71a(0x12c)],_0x273a44=_0x16535e?typeof _0x16535e===_0x33f71a(0xf8)?_0x16535e:JSON[_0x33f71a(0x121)](_0x16535e,null,0x2):undefined,_0x6ead5e=_0x33313f&&Object['keys'](_0x33313f)[_0x33f71a(0x113)]>0x0?JSON[_0x33f71a(0x121)](_0x33313f,null,0x2):undefined,_0x318c6e=_0x551240&&Object[_0x33f71a(0xfb)](_0x551240)[_0x33f71a(0x113)]>0x0?JSON[_0x33f71a(0x121)](_0x551240,null,0x2):undefined,_0x4e1563=_0xcba284[_0x33f71a(0x120)](([_0x446333])=>_0x446333!=='debug'&&_0x446333!==_0x33f71a(0x122)&&_0x446333!==_0x33f71a(0x100)&&_0x446333!=='rule'),_0x28c0d7=Math[_0x33f71a(0x126)](..._0x4e1563[_0x33f71a(0x115)](([_0x5a1002])=>_0x5a1002[_0x33f71a(0x113)])),_0x13c56b=Math[_0x33f71a(0x126)](..._0x4e1563[_0x33f71a(0x115)](([,_0x4658e0])=>{const _0x168550=_0x33f71a;try{const _0x4e5ea2=_0x4658e0===null||_0x4658e0===undefined?'':typeof _0x4658e0===_0x168550(0xf9)?JSON['stringify'](_0x4658e0):String(_0x4658e0),_0x1d9d8b=_0x4e5ea2[_0x168550(0x11a)]('\x0a');return Math[_0x168550(0x126)](..._0x1d9d8b['map'](_0x7f8cc1=>_0x7f8cc1['length']),0x0);}catch{return 0x0;}}),0x14),_0x5a5a42=[];_0x5a5a42[_0x33f71a(0x132)](colorBorder('┌─'+'─'[_0x33f71a(0xf6)](_0x28c0d7)+_0x33f71a(0x12e)+'─'[_0x33f71a(0xf6)](_0x13c56b)+'─┐',_0x10ee3e)),_0x4e1563['forEach'](([_0xf6cdfc,_0x5c0471])=>{const _0x28d4de=_0x33f71a;let _0x1317a5;try{_0x1317a5=_0x5c0471===null||_0x5c0471===undefined?'':typeof _0x5c0471===_0x28d4de(0xf9)?JSON['stringify'](_0x5c0471):String(_0x5c0471);}catch{_0x1317a5='[Object]';}const _0x2cb23a=_0xf6cdfc[_0x28d4de(0x124)](_0x28c0d7),_0xb31f37=_0x1317a5[_0x28d4de(0x11a)]('\x0a');_0xb31f37[_0x28d4de(0x10d)]((_0x336222,_0x4fabcf)=>{const _0x1e1c10=_0x28d4de,_0x26f061=colorBorder('│',_0x10ee3e);_0x4fabcf===0x0?_0x5a5a42['push'](_0x26f061+'\x20'+_0x2cb23a+'\x20'+_0x26f061+'\x20'+_0x336222['padEnd'](_0x13c56b)+'\x20'+_0x26f061):_0x5a5a42[_0x1e1c10(0x132)](_0x26f061+'\x20'+'\x20'['repeat'](_0x28c0d7)+'\x20'+_0x26f061+'\x20'+_0x336222[_0x1e1c10(0x124)](_0x13c56b)+'\x20'+_0x26f061);});}),_0x5a5a42[_0x33f71a(0x132)](colorBorder('└─'+'─'[_0x33f71a(0xf6)](_0x28c0d7)+'─┴─'+'─'[_0x33f71a(0xf6)](_0x13c56b)+'─┘',_0x10ee3e));_0x273a44&&(_0x5a5a42[_0x33f71a(0x132)](''),_0x5a5a42[_0x33f71a(0x132)](String(a44_0x536345[_0x33f71a(0x11e)]['bold'](_0x33f71a(0x12b)))),_0x5a5a42[_0x33f71a(0x132)](_0x273a44));_0x6ead5e&&(_0x5a5a42[_0x33f71a(0x132)](''),_0x5a5a42[_0x33f71a(0x132)](String(a44_0x536345[_0x33f71a(0x109)][_0x33f71a(0x125)]('[params]'))),_0x5a5a42[_0x33f71a(0x132)](_0x6ead5e));_0x318c6e&&(_0x5a5a42['push'](''),_0x5a5a42[_0x33f71a(0x132)](String(a44_0x536345[_0x33f71a(0xff)][_0x33f71a(0x125)]('[rule]'))),_0x5a5a42[_0x33f71a(0x132)](_0x318c6e));if(_0x3a136e){if(_0x3a136e[_0x33f71a(0x12d)]){_0x5a5a42[_0x33f71a(0x132)](''),_0x5a5a42[_0x33f71a(0x132)](String(a44_0x536345[_0x33f71a(0x112)][_0x33f71a(0x125)](_0x33f71a(0x131))));const _0x55fdc3=_0x3a136e[_0x33f71a(0x12d)][_0x33f71a(0x11a)]('\x0a');_0x55fdc3[_0x33f71a(0x10d)](_0x32fbd8=>{const _0x391396=_0x33f71a;_0x32fbd8[_0x391396(0x119)]()&&_0x5a5a42[_0x391396(0x132)](_0x32fbd8);});}if(_0x3a136e[_0x33f71a(0x111)]){_0x5a5a42[_0x33f71a(0x132)](''),_0x5a5a42['push'](String(a44_0x536345[_0x33f71a(0x127)][_0x33f71a(0x125)](_0x33f71a(0x106))));const _0x53fd82=_0x3a136e[_0x33f71a(0x111)]['split']('\x0a');_0x53fd82[_0x33f71a(0x10d)](_0x3564d1=>{const _0x2c0ca1=_0x33f71a;_0x3564d1[_0x2c0ca1(0x119)]()&&_0x5a5a42['push'](_0x3564d1);});}}return _0x5a5a42[_0x33f71a(0x11d)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x356c3e,_0x5186c4){const _0x3944c6=a44_0x445d;if(_0x5186c4['format']===_0x3944c6(0xfa)){await handleSDKOutput([_0x356c3e],_0x5186c4);return;}const _0x16ddd5=resolveOutputOptions(_0x5186c4),_0x53b84a=await formatSingleObject(_0x356c3e,_0x16ddd5);await writeOutput(_0x53b84a,_0x16ddd5[_0x3944c6(0x123)]||undefined,_0x16ddd5[_0x3944c6(0x12a)]);}function a44_0x36dd(){const _0x527788=['FINISHED','number','forEach','-FXRSn','noColor','end','cmdout','red','length','error','map','834680WpdbyG','log','color','trim','split','tsv','resolve','join','yellow','close','filter','stringify','query','output','padEnd','bold','max','cyan','isTTY','83854FDueQU','format','[query]','rule','stderr','─┬─','jsonl','entries','[error]','push','214595LGxPxN','27kDomjm','952020VaNYnb','stdout','boolean','843864NbBQFM','double','limit','repeat','42RXHhFj','string','object','table','keys','debug','10880pSTRXw','varchar','magenta','params','132Hmdvxw','spawn','9CTRNbK','stdin','759738vWgTCf','[logs]','list','bigint','blue','json'];a44_0x36dd=function(){return _0x527788;};return a44_0x36dd();}
|
|
1
|
+
(function(_0x4c8bf5,_0x682fd7){const _0x29bf60=a44_0x242b,_0x4516d2=_0x4c8bf5();while(!![]){try{const _0x153508=parseInt(_0x29bf60(0x226))/0x1+parseInt(_0x29bf60(0x212))/0x2*(parseInt(_0x29bf60(0x1f1))/0x3)+-parseInt(_0x29bf60(0x234))/0x4+parseInt(_0x29bf60(0x201))/0x5*(parseInt(_0x29bf60(0x1fb))/0x6)+-parseInt(_0x29bf60(0x207))/0x7+-parseInt(_0x29bf60(0x235))/0x8*(-parseInt(_0x29bf60(0x208))/0x9)+-parseInt(_0x29bf60(0x1fa))/0xa*(parseInt(_0x29bf60(0x202))/0xb);if(_0x153508===_0x682fd7)break;else _0x4516d2['push'](_0x4516d2['shift']());}catch(_0xdbd15f){_0x4516d2['push'](_0x4516d2['shift']());}}}(a44_0x382e,0x72550));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a44_0x2d71d9 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x29a384){const _0x46b826=a44_0x242b;return _0x29a384['format']==='json'||_0x29a384[_0x46b826(0x200)]==='jsonl'||_0x29a384['format']===_0x46b826(0x1ff)||_0x29a384['format']===_0x46b826(0x1f2)||_0x29a384[_0x46b826(0x203)]===!![]||_0x29a384['jsonl']===!![]||_0x29a384[_0x46b826(0x1ff)]===!![]||_0x29a384[_0x46b826(0x1f2)]===!![];}export function parseOutputOptions(_0x333239){const _0x440c16=a44_0x242b;return{'format':_0x333239[_0x440c16(0x200)]||_0x440c16(0x1f2),'output':_0x333239[_0x440c16(0x20e)]||'','limit':_0x333239[_0x440c16(0x220)],'color':_0x333239[_0x440c16(0x227)],'noColor':_0x333239[_0x440c16(0x217)]};}function convertSDKResultToQueryResult(_0x4ff2d6){const _0x452048=a44_0x242b,_0x4be2ea=[];if(_0x4ff2d6[_0x452048(0x232)]>0x0){const _0x5de33a=_0x4ff2d6[0x0];for(const [_0x14bd10,_0x5e97b8]of Object[_0x452048(0x1f5)](_0x5de33a)){let _0x1db992=_0x452048(0x219);if(typeof _0x5e97b8===_0x452048(0x23a))_0x1db992=Number[_0x452048(0x215)](_0x5e97b8)?_0x452048(0x218):_0x452048(0x1f6);else{if(typeof _0x5e97b8===_0x452048(0x21b))_0x1db992=_0x452048(0x21b);else _0x5e97b8===null&&(_0x1db992='varchar');}_0x4be2ea[_0x452048(0x224)]({'name':_0x14bd10,'type':_0x1db992});}}return{'queryId':_0x452048(0x223),'columns':_0x4be2ea,'data':_0x4ff2d6,'stats':{'state':_0x452048(0x231),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x4ff2d6['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x5d2d45,_0x572c27){const _0x392157=convertSDKResultToQueryResult(_0x5d2d45);return formatQueryOutput(_0x392157,_0x572c27);}export async function formatQueryOutput(_0x588b91,_0x297b3c){const _0x26f1da=a44_0x242b,{format:_0x50d383,limit:_0x53865c,output:_0x4765f4,color:_0x259a9d,noColor:_0xaf3076}=_0x297b3c,_0x2f1440=Boolean(_0x4765f4)&&!_0x259a9d,_0x289342={'color':_0x259a9d,'noColor':_0xaf3076||_0x2f1440};if(_0x50d383==='table'){const _0x19fe03=shouldUseLess(_0x50d383,_0x4765f4);return formatAsTable(_0x588b91,_0x53865c,_0x19fe03,_0x289342);}else{if(_0x50d383===_0x26f1da(0x203))return formatAsJSON(_0x588b91,_0x289342);else return _0x50d383===_0x26f1da(0x20f)?formatAsJSONL(_0x588b91,_0x289342):formatQueryResult(_0x588b91,_0x50d383);}}function shouldUseLess(_0x1a7df4,_0x4a84cc){const _0x262911=a44_0x242b;return(_0x1a7df4===_0x262911(0x1f2)||_0x1a7df4===_0x262911(0x233))&&process['stdout'][_0x262911(0x1f3)]&&!_0x4a84cc;}export function resolveOutputOptions(_0x2fe0fc){const _0x57c394=a44_0x242b,_0x1ad8e4=resolveOutputFormat(_0x2fe0fc['format'],_0x2fe0fc[_0x57c394(0x20e)],'table');let _0x3f516f=typeof _0x2fe0fc[_0x57c394(0x220)]===_0x57c394(0x23a)?_0x2fe0fc['limit']:parseInt(_0x2fe0fc[_0x57c394(0x220)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x15f9f9=_0x2fe0fc[_0x57c394(0x20e)]||'';return shouldUseLess(_0x1ad8e4,_0x15f9f9)&&(_0x3f516f=Infinity),{'format':_0x1ad8e4,'output':_0x15f9f9,'limit':_0x3f516f,'color':_0x2fe0fc[_0x57c394(0x227)],'noColor':_0x2fe0fc[_0x57c394(0x217)]};}function a44_0x242b(_0x43593c,_0x5d0e73){_0x43593c=_0x43593c-0x1f1;const _0x382e8e=a44_0x382e();let _0x242bd6=_0x382e8e[_0x43593c];return _0x242bd6;}function a44_0x382e(){const _0x25b440=['query','repeat','No\x20data','FINISHED','length','list','41028gUsRLR','6339736vCqmrE','[query]','forEach','max','padEnd','number','54195hgbyHT','table','isTTY','keys','entries','double','[error]','resolve','error','50qpzHin','6FUfhiz','split','rule','cyan','tsv','format','869605pFpQNd','2480071UaZSQt','json','pipe','[rule]','end','4035101VYWXEU','9MJiyvk','map','[params]','inherit','params','Results\x20saved\x20to\x20','output','jsonl','-FXRSn','blue','98kKMlzi','[Object]','stdin','isInteger','cmdout','noColor','bigint','varchar','trim','boolean','write','bold','stderr','yellow','limit','filter','less','sdk-result','push','object','330736ozbJRu','color','debug','─┴─','red','stringify','join','[logs]'];a44_0x382e=function(){return _0x25b440;};return a44_0x382e();}export function writeOutput(_0x535a0a,_0x3fef67,_0xef08c3){const _0x5d72d5=a44_0x242b;return _0x3fef67?(writeFileSync(_0x3fef67,_0x535a0a),console[_0x5d72d5(0x1f9)](_0x5d72d5(0x20d)+_0x3fef67),Promise['resolve']()):shouldUseLess(_0xef08c3||'','')?new Promise(_0x4be4f5=>{const _0x4888e7=_0x5d72d5,_0x32fa3e=spawn(_0x4888e7(0x222),[_0x4888e7(0x210)],{'stdio':[_0x4888e7(0x204),'inherit',_0x4888e7(0x20b)]});let _0x85a139=![];_0x32fa3e['on']('error',()=>{!_0x85a139&&(_0x85a139=!![],console['log'](_0x535a0a),_0x4be4f5());}),_0x32fa3e['on']('close',()=>{!_0x85a139&&(_0x85a139=!![],_0x4be4f5());}),_0x32fa3e['on']('spawn',()=>{const _0x1cb55a=_0x4888e7;!_0x85a139&&_0x32fa3e['stdin']&&(_0x32fa3e['stdin']['on']('error',()=>{}),_0x32fa3e[_0x1cb55a(0x214)][_0x1cb55a(0x21c)](_0x535a0a),_0x32fa3e['stdin'][_0x1cb55a(0x206)]());}),!_0x32fa3e['stdin']&&(!_0x85a139&&(_0x85a139=!![],console['log'](_0x535a0a),_0x4be4f5()));}):(console['log'](_0x535a0a),Promise[_0x5d72d5(0x1f8)]());}export async function handleSDKOutput(_0x523065,_0x4a8904){const _0x47ff9c=a44_0x242b,_0x59d929=resolveOutputOptions(_0x4a8904),_0x9dcf11=await formatSDKOutput(_0x523065,_0x59d929);await writeOutput(_0x9dcf11,_0x59d929[_0x47ff9c(0x20e)]||undefined,_0x59d929['format']);}export async function handleQueryOutput(_0xfef69f,_0x1c0d4f){const _0x1d18c2=a44_0x242b,_0x156ccd=resolveOutputOptions(_0x1c0d4f),_0xd96f4d=await formatQueryOutput(_0xfef69f,_0x156ccd);await writeOutput(_0xd96f4d,_0x156ccd[_0x1d18c2(0x20e)]||undefined,_0x156ccd[_0x1d18c2(0x200)]);}async function formatSingleObject(_0x4c4761,_0x5aea04){const _0x2d1eb6=a44_0x242b,{format:_0x5d030d,color:_0x451d02,noColor:_0x459b5d}=_0x5aea04,_0x4f9722={'color':_0x451d02,'noColor':_0x459b5d};if(_0x5d030d===_0x2d1eb6(0x203)){if(shouldUseColor(_0x4f9722))return colorizeJSON(_0x4c4761,_0x4f9722);return JSON['stringify'](_0x4c4761,null,0x2);}else{if(_0x5d030d===_0x2d1eb6(0x20f)){if(shouldUseColor(_0x4f9722))return colorizeJSONCompact(_0x4c4761,_0x4f9722);return JSON['stringify'](_0x4c4761);}else{if(_0x5d030d===_0x2d1eb6(0x1ff))return Object[_0x2d1eb6(0x1f5)](_0x4c4761)['map'](([_0x476fd5,_0x5809d8])=>_0x476fd5+'\x09'+_0x5809d8)[_0x2d1eb6(0x22c)]('\x0a');else{const _0x1b9aca=Object['entries'](_0x4c4761);if(_0x1b9aca[_0x2d1eb6(0x232)]===0x0)return _0x2d1eb6(0x230);const _0x36ce69=_0x4c4761[_0x2d1eb6(0x228)],_0x4c9346=_0x4c4761['query'],_0x107540=_0x4c4761[_0x2d1eb6(0x20c)],_0x46f4e5=_0x4c4761[_0x2d1eb6(0x1fd)],_0x53e150=_0x4c9346?typeof _0x4c9346==='string'?_0x4c9346:JSON[_0x2d1eb6(0x22b)](_0x4c9346,null,0x2):undefined,_0x28b16d=_0x107540&&Object[_0x2d1eb6(0x1f4)](_0x107540)['length']>0x0?JSON[_0x2d1eb6(0x22b)](_0x107540,null,0x2):undefined,_0x3479b0=_0x46f4e5&&Object[_0x2d1eb6(0x1f4)](_0x46f4e5)[_0x2d1eb6(0x232)]>0x0?JSON[_0x2d1eb6(0x22b)](_0x46f4e5,null,0x2):undefined,_0x219bbd=_0x1b9aca[_0x2d1eb6(0x221)](([_0x5da5c1])=>_0x5da5c1!=='debug'&&_0x5da5c1!==_0x2d1eb6(0x22e)&&_0x5da5c1!=='params'&&_0x5da5c1!==_0x2d1eb6(0x1fd)),_0x528c2e=Math[_0x2d1eb6(0x238)](..._0x219bbd['map'](([_0x3dcf7b])=>_0x3dcf7b[_0x2d1eb6(0x232)])),_0x1b26e1=Math[_0x2d1eb6(0x238)](..._0x219bbd[_0x2d1eb6(0x209)](([,_0x25e6bd])=>{const _0x5a40ea=_0x2d1eb6;try{const _0x2512f8=_0x25e6bd===null||_0x25e6bd===undefined?'':typeof _0x25e6bd===_0x5a40ea(0x225)?JSON[_0x5a40ea(0x22b)](_0x25e6bd):String(_0x25e6bd),_0x56b20a=_0x2512f8[_0x5a40ea(0x1fc)]('\x0a');return Math['max'](..._0x56b20a[_0x5a40ea(0x209)](_0x199565=>_0x199565[_0x5a40ea(0x232)]),0x0);}catch{return 0x0;}}),0x14),_0x397639=[];_0x397639[_0x2d1eb6(0x224)](colorBorder('┌─'+'─'[_0x2d1eb6(0x22f)](_0x528c2e)+'─┬─'+'─'[_0x2d1eb6(0x22f)](_0x1b26e1)+'─┐',_0x4f9722)),_0x219bbd[_0x2d1eb6(0x237)](([_0x9b5489,_0x193ec9])=>{const _0x3e917d=_0x2d1eb6;let _0x476f8d;try{_0x476f8d=_0x193ec9===null||_0x193ec9===undefined?'':typeof _0x193ec9===_0x3e917d(0x225)?JSON['stringify'](_0x193ec9):String(_0x193ec9);}catch{_0x476f8d=_0x3e917d(0x213);}const _0x106861=_0x9b5489[_0x3e917d(0x239)](_0x528c2e),_0x39c839=_0x476f8d[_0x3e917d(0x1fc)]('\x0a');_0x39c839[_0x3e917d(0x237)]((_0x4cf22d,_0x17c980)=>{const _0x4243a2=_0x3e917d,_0x91b99a=colorBorder('│',_0x4f9722);_0x17c980===0x0?_0x397639[_0x4243a2(0x224)](_0x91b99a+'\x20'+_0x106861+'\x20'+_0x91b99a+'\x20'+_0x4cf22d['padEnd'](_0x1b26e1)+'\x20'+_0x91b99a):_0x397639[_0x4243a2(0x224)](_0x91b99a+'\x20'+'\x20'[_0x4243a2(0x22f)](_0x528c2e)+'\x20'+_0x91b99a+'\x20'+_0x4cf22d[_0x4243a2(0x239)](_0x1b26e1)+'\x20'+_0x91b99a);});}),_0x397639[_0x2d1eb6(0x224)](colorBorder('└─'+'─'[_0x2d1eb6(0x22f)](_0x528c2e)+_0x2d1eb6(0x229)+'─'[_0x2d1eb6(0x22f)](_0x1b26e1)+'─┘',_0x4f9722));_0x53e150&&(_0x397639['push'](''),_0x397639['push'](String(a44_0x2d71d9[_0x2d1eb6(0x21f)]['bold'](_0x2d1eb6(0x236)))),_0x397639[_0x2d1eb6(0x224)](_0x53e150));_0x28b16d&&(_0x397639['push'](''),_0x397639[_0x2d1eb6(0x224)](String(a44_0x2d71d9[_0x2d1eb6(0x211)][_0x2d1eb6(0x21d)](_0x2d1eb6(0x20a)))),_0x397639[_0x2d1eb6(0x224)](_0x28b16d));_0x3479b0&&(_0x397639['push'](''),_0x397639[_0x2d1eb6(0x224)](String(a44_0x2d71d9['magenta'][_0x2d1eb6(0x21d)](_0x2d1eb6(0x205)))),_0x397639['push'](_0x3479b0));if(_0x36ce69){if(_0x36ce69[_0x2d1eb6(0x21e)]){_0x397639[_0x2d1eb6(0x224)](''),_0x397639[_0x2d1eb6(0x224)](String(a44_0x2d71d9[_0x2d1eb6(0x22a)][_0x2d1eb6(0x21d)](_0x2d1eb6(0x1f7))));const _0x4ab5b3=_0x36ce69['stderr'][_0x2d1eb6(0x1fc)]('\x0a');_0x4ab5b3[_0x2d1eb6(0x237)](_0x230031=>{const _0x1c255a=_0x2d1eb6;_0x230031[_0x1c255a(0x21a)]()&&_0x397639[_0x1c255a(0x224)](_0x230031);});}if(_0x36ce69['cmdout']){_0x397639[_0x2d1eb6(0x224)](''),_0x397639[_0x2d1eb6(0x224)](String(a44_0x2d71d9[_0x2d1eb6(0x1fe)][_0x2d1eb6(0x21d)](_0x2d1eb6(0x22d))));const _0x16e6a5=_0x36ce69[_0x2d1eb6(0x216)][_0x2d1eb6(0x1fc)]('\x0a');_0x16e6a5[_0x2d1eb6(0x237)](_0x14a997=>{const _0x33bf8e=_0x2d1eb6;_0x14a997[_0x33bf8e(0x21a)]()&&_0x397639[_0x33bf8e(0x224)](_0x14a997);});}}return _0x397639['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0xbff3a3,_0x505b5b){const _0x598a07=a44_0x242b;if(_0x505b5b['format']==='table'){await handleSDKOutput([_0xbff3a3],_0x505b5b);return;}const _0x45d444=resolveOutputOptions(_0x505b5b),_0x503d95=await formatSingleObject(_0xbff3a3,_0x45d444);await writeOutput(_0x503d95,_0x45d444[_0x598a07(0x20e)]||undefined,_0x45d444[_0x598a07(0x200)]);}
|