@treasuredata/tdx 2026.3.14 → 2026.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-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/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/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/upgrade-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/oauth-keychain.js +1 -1
- package/dist/core/oauth.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.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-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/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.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/paginate.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/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a51_0x64d48f=a51_0x483a;(function(_0x40e429,_0xaa7b4f){const _0x2464d3=a51_0x483a,_0x10ec11=_0x40e429();while(!![]){try{const _0x3bbc89=parseInt(_0x2464d3(0x18e))/0x1+-parseInt(_0x2464d3(0x195))/0x2*(-parseInt(_0x2464d3(0x221))/0x3)+parseInt(_0x2464d3(0x2e4))/0x4*(-parseInt(_0x2464d3(0x1c7))/0x5)+parseInt(_0x2464d3(0x1be))/0x6+-parseInt(_0x2464d3(0x2f9))/0x7+parseInt(_0x2464d3(0x26f))/0x8+parseInt(_0x2464d3(0x2b5))/0x9*(-parseInt(_0x2464d3(0x1ec))/0xa);if(_0x3bbc89===_0xaa7b4f)break;else _0x10ec11['push'](_0x10ec11['shift']());}catch(_0x33ae17){_0x10ec11['push'](_0x10ec11['shift']());}}}(a51_0x5dbb,0xe2666));import a51_0x5af198 from'chalk';import{existsSync}from'fs';import a51_0x2409f9 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 a51_0x396bfc from'prompts';function a51_0x483a(_0x5afd5c,_0x397b0c){_0x5afd5c=_0x5afd5c-0x16e;const _0x5dbbd0=a51_0x5dbb();let _0x483a04=_0x5dbbd0[_0x5afd5c];return _0x483a04;}function getAttemptStatusDisplay(_0x2fab74){const _0x439378=a51_0x483a;if(!_0x2fab74)return{'icon':'⏳','text':''};const {done:_0x2f67f1,success:_0x2d96f7,cancelRequested:_0x223918}=_0x2fab74;if(!_0x2f67f1)return _0x223918?{'icon':'🛑','text':a51_0x5af198[_0x439378(0x1f4)]('canceling')}:{'icon':'🔄','text':a51_0x5af198[_0x439378(0x1ef)](_0x439378(0x25a))};if(_0x2d96f7)return{'icon':'✅','text':a51_0x5af198[_0x439378(0x2ef)](_0x439378(0x27f))};return{'icon':'❌','text':a51_0x5af198['red']('error')};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x48cf63,_0x1a6e9c,_0x27ff26=0x0){const _0x48f588=a51_0x483a;return _0x48cf63[_0x27ff26]||_0x1a6e9c[_0x48f588(0x307)];}['requireProject'](_0x1b028d,_0x26ae5f,_0x31592a=0x0){const _0x121fa4=a51_0x483a,_0x23e845=this[_0x121fa4(0x1e6)](_0x1b028d,_0x26ae5f,_0x31592a);if(!_0x23e845)return console[_0x121fa4(0x2a9)](a51_0x5af198['red'](_0x121fa4(0x18c)),'Project\x20name\x20is\x20required'),console[_0x121fa4(0x2a9)](a51_0x5af198[_0x121fa4(0x278)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x23e845;}[a51_0x64d48f(0x2b6)](_0x74cecd,_0x174abc){const _0x50f272=a51_0x64d48f;if(_0x74cecd[0x0]){const _0x2b97c8=_0x74cecd[0x0][_0x50f272(0x283)]('.');if(_0x2b97c8[_0x50f272(0x1d8)]===0x1)return{'projectName':_0x2b97c8[0x0],'workflowName':undefined};else return _0x2b97c8['length']===0x2?{'projectName':_0x2b97c8[0x0],'workflowName':_0x2b97c8[0x1]}:(console['error'](a51_0x5af198[_0x50f272(0x23d)]('Error:'),_0x50f272(0x1c8)),null);}return{'projectName':_0x174abc['workflowProject'],'workflowName':undefined};}[a51_0x64d48f(0x17e)](_0x343ccf,_0x23b66d,_0x1e8ff5=0x0){const _0x58001e=a51_0x64d48f;if(_0x343ccf[_0x1e8ff5])return _0x343ccf[_0x1e8ff5];if(_0x23b66d['workflowProject']){const _0x51844e=a51_0x2409f9[_0x58001e(0x1eb)](process[_0x58001e(0x1ab)](),_0x58001e(0x173),_0x23b66d[_0x58001e(0x307)]);if(existsSync(a51_0x2409f9[_0x58001e(0x1eb)](_0x51844e,_0x58001e(0x2a5))))return _0x51844e;}return undefined;}async[a51_0x64d48f(0x284)](_0x3ed677,_0x983ea8,_0x155bbe){const _0x234b0b=a51_0x64d48f;try{const _0xfebef1=await _0x3ed677[_0x234b0b(0x237)][_0x234b0b(0x173)](_0x983ea8,{'limit':0x1});if(_0xfebef1[_0x234b0b(0x1d8)]>0x0){const _0x410960=_0xfebef1[0x0]['id'],_0x208c76=getWorkflowUrl(_0x155bbe,_0x410960);console[_0x234b0b(0x2a9)](_0x234b0b(0x26d)+a51_0x5af198[_0x234b0b(0x1fe)](_0x208c76));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a51_0x64d48f(0x2f2);[a51_0x64d48f(0x252)]=a51_0x64d48f(0x1ce);async[a51_0x64d48f(0x1fb)](_0x457131){const _0x45a1e7=a51_0x64d48f,{options:_0x18f0d7,args:_0x454a3d,tdx:_0x2478be}=_0x457131,_0x4a8c52=_0x454a3d[0x0],_0x53519f=_0x18f0d7[_0x45a1e7(0x21c)];if(_0x53519f)return saveSessionContext({'workflow_project':undefined},_0x18f0d7[_0x45a1e7(0x201)]),console[_0x45a1e7(0x2a7)](a51_0x5af198[_0x45a1e7(0x2ef)](_0x45a1e7(0x294))),0x0;if(!_0x4a8c52)return console[_0x45a1e7(0x2a9)](a51_0x5af198[_0x45a1e7(0x23d)](_0x45a1e7(0x18c)),_0x45a1e7(0x182)),console[_0x45a1e7(0x2a9)](a51_0x5af198[_0x45a1e7(0x278)](_0x45a1e7(0x2ff))),console[_0x45a1e7(0x2a9)](a51_0x5af198[_0x45a1e7(0x278)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x5de74d=await withSpinner('Resolving\x20project\x20\x27'+_0x4a8c52+_0x45a1e7(0x301),()=>_0x2478be[_0x45a1e7(0x237)][_0x45a1e7(0x25f)](_0x4a8c52),{'verbose':_0x18f0d7[_0x45a1e7(0x210)]}),{name:_0x35b1e0}=_0x5de74d[_0x45a1e7(0x1aa)];return saveSessionContext({'workflow_project':_0x35b1e0},_0x18f0d7['session']),console[_0x45a1e7(0x2a7)](a51_0x5af198[_0x45a1e7(0x2ef)](_0x45a1e7(0x1c3)+a51_0x5af198['cyan'](_0x35b1e0))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x1a7);[a51_0x64d48f(0x252)]='List\x20all\x20workflow\x20projects';async[a51_0x64d48f(0x1fb)](_0x18a70f){const _0x4145c6=a51_0x64d48f,{options:_0x525db5,args:_0x1e9971,tdx:_0x5d443f}=_0x18a70f,_0x243534=_0x1e9971[0x0];_0x525db5[_0x4145c6(0x210)]&&_0x243534&&console[_0x4145c6(0x2a9)](_0x4145c6(0x26e)+_0x243534);const _0xea5fe4=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x5d443f['workflow'][_0x4145c6(0x22a)](_0x243534,{'limit':_0x525db5[_0x4145c6(0x1c4)]}),{'verbose':_0x525db5[_0x4145c6(0x210)]});let _0x2bf4a1=_0xea5fe4[_0x4145c6(0x1aa)];_0x2bf4a1[_0x4145c6(0x19c)]((_0x2078e3,_0x5657ca)=>_0x2078e3[_0x4145c6(0x246)][_0x4145c6(0x2fa)](_0x5657ca[_0x4145c6(0x246)]));const _0x387c4e=_0x525db5['limit']||0x64,_0x3b21f2=_0x2bf4a1[_0x4145c6(0x1d8)]>=_0x387c4e?a51_0x5af198['dim'](_0x4145c6(0x2e7)):'';console[_0x4145c6(0x2a9)](_0x4145c6(0x28d)+_0x2bf4a1[_0x4145c6(0x1d8)]+'\x20project'+(_0x2bf4a1[_0x4145c6(0x1d8)]!==0x1?'s':'')+_0x3b21f2);if(_0x525db5[_0x4145c6(0x227)]===_0x4145c6(0x1c1)||_0x525db5[_0x4145c6(0x227)]==='jsonl'||_0x525db5[_0x4145c6(0x227)]===_0x4145c6(0x236))await handleSDKOutput(_0x2bf4a1,_0x525db5);else{if(_0x2bf4a1[_0x4145c6(0x1d8)]===0x0)_0x243534?console['log'](_0x4145c6(0x1e5)+_0x243534):console[_0x4145c6(0x2a7)]('No\x20workflow\x20projects\x20found');else{const _0x468d1c=_0x2bf4a1['map'](_0x1ce6ab=>{const _0xbf4276=_0x4145c6,_0xccf6bf=_0x1ce6ab[_0xbf4276(0x25d)]?.[_0xbf4276(0x1d2)](_0x48de33=>_0x48de33[_0xbf4276(0x2be)]===_0xbf4276(0x2c1)),_0x8baa6=_0xccf6bf?a51_0x5af198[_0xbf4276(0x278)]('\x20(system)'):'';return _0xbf4276(0x230)+_0x1ce6ab['name']+_0x8baa6;});await writeOutput(_0x468d1c[_0x4145c6(0x1eb)]('\x0a'),_0x525db5['output'],'list');}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x22e);[a51_0x64d48f(0x252)]=a51_0x64d48f(0x18b);async[a51_0x64d48f(0x1fb)](_0x5634e7){const _0x227db1=a51_0x64d48f,{options:_0x145451,args:_0x35a9e5,tdx:_0x53b8c1}=_0x5634e7,_0x46070b=this[_0x227db1(0x1e6)](_0x35a9e5,_0x145451);_0x145451[_0x227db1(0x210)]&&_0x46070b&&console[_0x227db1(0x2a9)](_0x227db1(0x2a1)+_0x46070b);const _0x16b56d=await withSpinner(_0x227db1(0x21e),()=>_0x53b8c1[_0x227db1(0x237)][_0x227db1(0x173)](_0x46070b,{'limit':_0x145451[_0x227db1(0x1c4)]}),{'verbose':_0x145451['verbose']});let _0x5596dc=_0x16b56d['data'];_0x5596dc[_0x227db1(0x19c)]((_0x290635,_0x176a7c)=>{const _0x53696e=_0x227db1,_0x1b9909=_0x290635[_0x53696e(0x246)][_0x53696e(0x2fa)](_0x176a7c[_0x53696e(0x246)]);if(_0x1b9909!==0x0)return _0x1b9909;return(_0x290635[_0x53696e(0x29e)]?.[_0x53696e(0x246)]||'')[_0x53696e(0x2fa)](_0x176a7c['project']?.[_0x53696e(0x246)]||'');});const _0xe7bbb3=_0x145451[_0x227db1(0x1c4)]||0x64,_0x5da02b=_0x5596dc['length']>=_0xe7bbb3?a51_0x5af198[_0x227db1(0x278)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x227db1(0x2a9)](_0x227db1(0x28d)+_0x5596dc['length']+_0x227db1(0x1bc)+(_0x5596dc[_0x227db1(0x1d8)]!==0x1?'s':'')+_0x5da02b);if(_0x145451['format']==='json'||_0x145451[_0x227db1(0x227)]==='jsonl'||_0x145451[_0x227db1(0x227)]===_0x227db1(0x236))await handleSDKOutput(_0x5596dc,_0x145451);else{if(_0x5596dc[_0x227db1(0x1d8)]===0x0)_0x46070b?console[_0x227db1(0x2a7)]('No\x20workflows\x20found\x20in\x20project:\x20'+_0x46070b):console['log'](_0x227db1(0x285));else{const _0x14d5f7=_0x145451[_0x227db1(0x1a4)],_0x316b70=_0x5596dc['map'](_0x5ca997=>{const _0x5b97e3=_0x227db1,_0x4df686=a51_0x5af198['dim']('#'+_0x5ca997['id']),_0x263325=hyperlink(_0x4df686,getWorkflowUrl(_0x14d5f7,_0x5ca997['id'])),_0x4f4251=_0x5ca997[_0x5b97e3(0x29e)]?.[_0x5b97e3(0x246)]?a51_0x5af198[_0x5b97e3(0x278)]('\x20('+_0x5ca997['project']['name']+')'):'';return'📋\x20'+_0x263325+'\x20'+_0x5ca997['name']+_0x4f4251;});await writeOutput(_0x316b70[_0x227db1(0x1eb)]('\x0a'),_0x145451['output'],_0x227db1(0x209));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]='workflow:sessions';['description']=a51_0x64d48f(0x22f);async['execute'](_0x549501){const _0x41d8da=a51_0x64d48f,{options:_0x2a2167,args:_0x567ff9,tdx:_0x16608b}=_0x549501,_0x54b634=this[_0x41d8da(0x2b6)](_0x567ff9,_0x2a2167);if(!_0x54b634)return 0x1;const {projectName:_0x3d8246,workflowName:_0x131e07}=_0x54b634;if(_0x2a2167['verbose']){if(_0x3d8246&&_0x131e07)console[_0x41d8da(0x2a9)]('Filter:\x20'+_0x3d8246+'.'+_0x131e07);else _0x3d8246&&console[_0x41d8da(0x2a9)](_0x41d8da(0x2d6)+_0x3d8246);const _0x968ee=_0x2a2167[_0x41d8da(0x2f1)];_0x968ee&&console[_0x41d8da(0x2a9)](_0x41d8da(0x17d)+_0x968ee);}let _0x29e87b=0x28;if(process[_0x41d8da(0x289)]['isTTY']&&!_0x2a2167[_0x41d8da(0x172)]&&!_0x2a2167[_0x41d8da(0x227)]){const _0x4bd7db=process['stdout']['rows']||0x28;_0x29e87b=Math[_0x41d8da(0x2d8)](0x14,Math['floor'](_0x4bd7db*0x2/0x3));}const _0x543d78=_0x2a2167[_0x41d8da(0x1c4)]||_0x29e87b,_0x206d03=await withSpinner(_0x41d8da(0x240),()=>_0x16608b['workflow'][_0x41d8da(0x2d0)]({'projectName':_0x3d8246,'workflowName':_0x131e07,'status':_0x2a2167[_0x41d8da(0x2f1)],'fromTime':_0x2a2167[_0x41d8da(0x197)],'toTime':_0x2a2167['to'],'limit':_0x543d78}),{'verbose':_0x2a2167[_0x41d8da(0x210)]}),_0xf4c024=_0x206d03[_0x41d8da(0x1aa)];_0xf4c024[_0x41d8da(0x19c)]((_0x58d909,_0x593b0)=>{const _0x2aa61a=_0x41d8da,_0x530152=_0x58d909[_0x2aa61a(0x200)]||'',_0x3874ce=_0x593b0[_0x2aa61a(0x200)]||'';return _0x3874ce['localeCompare'](_0x530152);});_0xf4c024[_0x41d8da(0x1d8)]>=_0x543d78?console[_0x41d8da(0x2a9)](_0x41d8da(0x1b9)+_0xf4c024[_0x41d8da(0x1d8)]+'\x20sessions\x20'+a51_0x5af198[_0x41d8da(0x278)](_0x41d8da(0x1b1))):console['error'](_0x41d8da(0x28d)+_0xf4c024['length']+_0x41d8da(0x203)+(_0xf4c024[_0x41d8da(0x1d8)]!==0x1?'s':''));if(_0x2a2167[_0x41d8da(0x227)]==='json'||_0x2a2167[_0x41d8da(0x227)]===_0x41d8da(0x18f)||_0x2a2167[_0x41d8da(0x227)]===_0x41d8da(0x236))await handleSDKOutput(_0xf4c024,_0x2a2167);else{if(!process[_0x41d8da(0x289)][_0x41d8da(0x295)]||_0x2a2167[_0x41d8da(0x172)]){if(_0xf4c024[_0x41d8da(0x1d8)]===0x0){if(_0x3d8246&&_0x131e07)console[_0x41d8da(0x2a7)]('No\x20sessions\x20found\x20for:\x20'+_0x3d8246+'.'+_0x131e07);else _0x3d8246?console[_0x41d8da(0x2a7)](_0x41d8da(0x315)+_0x3d8246):console['log'](_0x41d8da(0x261));}else{const _0x14475c=_0x2a2167['site'],_0x2a36ee=this[_0x41d8da(0x1b0)](_0xf4c024,_0x14475c);_0x2a2167[_0x41d8da(0x172)]?await writeOutput(_0x2a36ee,_0x2a2167[_0x41d8da(0x172)],'list'):console[_0x41d8da(0x2a7)](_0x2a36ee);}!_0x3d8246&&(console[_0x41d8da(0x2a9)](''),console[_0x41d8da(0x2a9)](a51_0x5af198[_0x41d8da(0x278)](_0x41d8da(0x1a3))),console[_0x41d8da(0x2a9)](a51_0x5af198[_0x41d8da(0x278)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a51_0x5af198['dim'](_0x41d8da(0x175))));}else{if(_0xf4c024['length']===0x0){if(_0x3d8246&&_0x131e07)console[_0x41d8da(0x2a7)](_0x41d8da(0x300)+_0x3d8246+'.'+_0x131e07);else _0x3d8246?console[_0x41d8da(0x2a7)](_0x41d8da(0x315)+_0x3d8246):console[_0x41d8da(0x2a7)](_0x41d8da(0x261));}else await this['navigateSessionsInteractive'](_0xf4c024,_0x549501,_0x3d8246);}}return 0x0;}[a51_0x64d48f(0x1b0)](_0x4e70c6,_0x319666){const _0x2a8a79=a51_0x64d48f,_0x592721=[],_0x587ff2=new Map();let _0x36ef4=Infinity,_0x43d89b=-Infinity;for(const _0x509e92 of _0x4e70c6){if(_0x509e92[_0x2a8a79(0x296)]?.[_0x2a8a79(0x2e3)]){const _0x1d21c0=new Date(_0x509e92[_0x2a8a79(0x296)]['createdAt'])['getTime'](),_0x1fe9b0=_0x509e92[_0x2a8a79(0x296)][_0x2a8a79(0x2d5)]?new Date(_0x509e92['lastAttempt'][_0x2a8a79(0x2d5)])['getTime']():Date['now'](),_0xaa5e11=_0x509e92[_0x2a8a79(0x29e)]?.['name']||_0x2a8a79(0x299);!_0x587ff2[_0x2a8a79(0x286)](_0xaa5e11)&&_0x587ff2['set'](_0xaa5e11,[]),_0x587ff2['get'](_0xaa5e11)[_0x2a8a79(0x235)]({'session':_0x509e92,'startTime':_0x1d21c0,'endTime':_0x1fe9b0,'duration':_0x1fe9b0-_0x1d21c0}),_0x36ef4=Math[_0x2a8a79(0x254)](_0x36ef4,_0x1d21c0),_0x43d89b=Math['max'](_0x43d89b,_0x1fe9b0);}}if(_0x587ff2['size']===0x0)return _0x2a8a79(0x1a2);const _0x4b04be=process[_0x2a8a79(0x289)][_0x2a8a79(0x29a)]||0x78,_0x5b4407=0x1e,_0x573c0b=0x32,_0x53cb75=0x4,_0x47d4da=Math['min'](_0x573c0b,Math[_0x2a8a79(0x2d8)](_0x5b4407,Math[_0x2a8a79(0x23b)](_0x4b04be*0.3))),_0x2273fc=_0x4b04be-_0x47d4da-TIMELINE_CONFIG[_0x2a8a79(0x267)]-0x3-_0x53cb75,_0x56e229=_0x43d89b-_0x36ef4,_0x37dd66=_0x56e229/_0x47d4da,_0x308b11=renderTimeAxis({'startTime':_0x36ef4,'endTime':_0x43d89b,'durationMs':_0x56e229,'msPerChar':_0x37dd66},_0x47d4da),_0xd7836a=[];for(const _0x218fe3 of _0x587ff2[_0x2a8a79(0x2fc)]()){_0xd7836a[_0x2a8a79(0x235)](..._0x218fe3);}_0xd7836a[_0x2a8a79(0x19c)]((_0x460b51,_0x1a91ba)=>_0x1a91ba['startTime']-_0x460b51[_0x2a8a79(0x180)]);const _0x16036c=new Date(_0x36ef4),_0x5dd253=formatDate(_0x16036c),_0x5c63c1=_0x53cb75+TIMELINE_CONFIG[_0x2a8a79(0x23c)]+TIMELINE_CONFIG[_0x2a8a79(0x274)]+_0x2273fc,_0x372cb2='\x20'['repeat'](_0x5c63c1-_0x5dd253['length']),_0x3b960f=_0x372cb2+a51_0x5af198[_0x2a8a79(0x278)](_0x5dd253)+'\x20'+_0x308b11;_0x592721[_0x2a8a79(0x235)](_0x3b960f);const _0x13e4a9=0x16;let _0x3cd4de=0x0;for(const _0x39477b of _0xd7836a){const _0x167974=_0x39477b[_0x2a8a79(0x201)][_0x2a8a79(0x29e)]?.[_0x2a8a79(0x246)]||'?',_0x36a4e7=Math[_0x2a8a79(0x254)](stringWidth(_0x167974),_0x13e4a9);_0x3cd4de=Math[_0x2a8a79(0x2d8)](_0x3cd4de,_0x36a4e7);}for(const _0xebf499 of _0xd7836a){const {session:_0xd1ae4,startTime:_0x17db7a,endTime:_0x2f1444,duration:_0x53296a}=_0xebf499,_0x5c5202=_0xd1ae4[_0x2a8a79(0x29e)]?.['id'],_0x55af63=_0xd1ae4['id'],_0x17090e=_0xd1ae4['project']?.[_0x2a8a79(0x246)]||'?',_0x5a6aad=_0xd1ae4[_0x2a8a79(0x237)]?.[_0x2a8a79(0x246)]||'?';let _0x2d1c0b,_0x1b099d;if(_0xd1ae4[_0x2a8a79(0x296)]){const _0xbf6a9a=_0xd1ae4[_0x2a8a79(0x296)];!_0xbf6a9a[_0x2a8a79(0x2bf)]?(_0x2d1c0b=_0xbf6a9a[_0x2a8a79(0x30b)]?'🛑':'🔄',_0x1b099d=_0xbf6a9a[_0x2a8a79(0x30b)]?a51_0x5af198[_0x2a8a79(0x1f4)]:a51_0x5af198[_0x2a8a79(0x1ef)]):(_0x2d1c0b=_0xbf6a9a[_0x2a8a79(0x27f)]?'✅':'❌',_0x1b099d=_0xbf6a9a[_0x2a8a79(0x27f)]?a51_0x5af198['green']:a51_0x5af198[_0x2a8a79(0x23d)]);}else _0x2d1c0b='⏳',_0x1b099d=a51_0x5af198[_0x2a8a79(0x278)];const _0x364e28='#'+_0x55af63,_0x56db5d=_0x5c5202?hyperlink(_0x364e28,getWorkflowSessionUrl(_0x319666,_0x5c5202,_0x55af63)):_0x364e28;let _0x40ab7d=_0x17090e;stringWidth(_0x17090e)>_0x13e4a9&&(_0x40ab7d=_0x17090e[_0x2a8a79(0x22b)](0x0,_0x13e4a9-0x1)+'…');const _0x1167ac=a51_0x5af198[_0x2a8a79(0x278)](_0x40ab7d),_0x2f285c=stringWidth(_0x40ab7d),_0x3f47f8='\x20'[_0x2a8a79(0x2dc)](_0x3cd4de-stringWidth(_0x40ab7d)+0x2),_0x28127e='('+formatElapsed(_0x53296a)+')',_0x52f0f8=stringWidth(_0x28127e),_0x3b4691=stringWidth(_0x364e28),_0x3d5781=_0x3b4691+0x1+_0x2f285c+_0x3f47f8['length'],_0x3a8d0a=_0x2273fc-_0x3d5781-_0x52f0f8-0x1-0x8;let _0x4f86fa=_0x5a6aad;stringWidth(_0x4f86fa)>_0x3a8d0a&&(_0x4f86fa=_0x4f86fa['slice'](0x0,_0x3a8d0a-0x1)+'…');const _0x578315=_0x56db5d+'\x20'+_0x1167ac+_0x3f47f8+_0x4f86fa,_0x1922b3=stringWidth(_0x578315),_0x36fabb=_0x2273fc-_0x1922b3-_0x52f0f8,_0x1cc456=_0x578315+'\x20'[_0x2a8a79(0x2dc)](Math[_0x2a8a79(0x2d8)](0x1,_0x36fabb))+a51_0x5af198['dim'](_0x28127e),_0x3b865f=Math[_0x2a8a79(0x23b)]((_0x17db7a-_0x36ef4)/_0x37dd66),_0xdbd6a=Math[_0x2a8a79(0x23b)]((_0x2f1444-_0x36ef4)/_0x37dd66),_0x3f5d81=Math['max'](_0x3b865f+0x1,_0xdbd6a),_0xf514ea=new Array(_0x47d4da)[_0x2a8a79(0x184)]('\x20');for(let _0x45ef27=_0x3b865f;_0x45ef27<Math['min'](_0x3f5d81,_0x47d4da);_0x45ef27++){_0xf514ea[_0x45ef27]='─';}const _0x3706e1=_0xf514ea[_0x2a8a79(0x2b9)](_0x238c3b=>_0x238c3b==='\x20'?'\x20':_0x1b099d(_0x238c3b))[_0x2a8a79(0x1eb)]('');_0x592721[_0x2a8a79(0x235)](_0x2d1c0b+'\x20'+_0x1cc456+'│'+_0x3706e1+'│');}return _0x592721[_0x2a8a79(0x1eb)]('\x0a');}async[a51_0x64d48f(0x21a)](_0x273890,_0x8bd827,_0x32b070){const _0x558d72=a51_0x64d48f,{options:_0x4c908e,tdx:_0x409aa}=_0x8bd827,_0x20db77=_0x4c908e[_0x558d72(0x1a4)],{timelineRows:_0x34d10f,timeAxisHeader:_0x2769f3}=this[_0x558d72(0x1ac)](_0x273890,_0x20db77),_0x1aabcc=_0x34d10f[_0x558d72(0x1f7)](_0x563666=>_0x563666[_0x558d72(0x2b1)]);if(_0x1aabcc[_0x558d72(0x1d8)]===0x0){const _0x24bd6b=this[_0x558d72(0x1b0)](_0x273890,_0x20db77);console[_0x558d72(0x2a7)](_0x24bd6b);!_0x32b070&&(console[_0x558d72(0x2a9)](''),console[_0x558d72(0x2a9)](a51_0x5af198[_0x558d72(0x278)](_0x558d72(0x1a3))),console['error'](a51_0x5af198[_0x558d72(0x278)](_0x558d72(0x293))+'or'+a51_0x5af198[_0x558d72(0x278)](_0x558d72(0x175))));return;}_0x2769f3&&console['log'](_0x2769f3);const _0x38af77=_0x34d10f[_0x558d72(0x1f7)](_0x38021c=>_0x38021c[_0x558d72(0x2b1)])['map'](_0x51b780=>({'title':_0x51b780[_0x558d72(0x2bb)],'value':_0x51b780['attemptId']})),_0x1a2d9d=process[_0x558d72(0x289)][_0x558d72(0x26b)]||0x3c,_0x360c82=Math[_0x558d72(0x2d8)](0x28,Math[_0x558d72(0x23b)](_0x1a2d9d*0x2/0x3)),_0x45d272=await a51_0x396bfc({'type':'autocomplete','name':'attemptId','message':_0x558d72(0x1d6),'choices':_0x38af77,'initial':-0x1,'limit':_0x360c82,'clearFirst':!![],'fallback':{'title':_0x558d72(0x2df),'value':null},'suggest':(_0x2fafee,_0x31b083)=>{const _0x1d0012=_0x558d72;if(!_0x2fafee)return Promise[_0x1d0012(0x2ac)](_0x31b083);const _0xfad743=_0x31b083['filter'](_0x19dec7=>{const _0x4300a8=_0x1d0012,_0x8357cd=_0x19dec7;return _0x8357cd[_0x4300a8(0x1bf)][_0x4300a8(0x1af)]()[_0x4300a8(0x248)](_0x2fafee[_0x4300a8(0x1af)]());});return Promise[_0x1d0012(0x2ac)](_0xfad743);}}),_0x5f111d=()=>{const _0x5340ef=_0x558d72;process[_0x5340ef(0x289)]['write'](_0x5340ef(0x27e)),process[_0x5340ef(0x289)]['write'](_0x5340ef(0x27e)),process[_0x5340ef(0x289)]['write'](_0x5340ef(0x27e));},_0x45a584=_0x45d272&&_0x45d272[_0x558d72(0x2b1)]&&_0x45d272[_0x558d72(0x2b1)]!==null&&_0x45d272[_0x558d72(0x2b1)][_0x558d72(0x26c)]()!=='';if(!_0x45a584){_0x5f111d(),console[_0x558d72(0x2a7)](a51_0x5af198['dim']('Cancelled'));return;}_0x5f111d();const _0x163929=_0x273890[_0x558d72(0x305)](_0x1245bd=>_0x1245bd['lastAttempt']?.['id']===_0x45d272['attemptId']);if(_0x163929){const _0x321e8=_0x163929[_0x558d72(0x29e)]?.[_0x558d72(0x246)]||'?',_0x35d4a7=_0x163929['workflow']?.[_0x558d72(0x246)]||'?';console['log'](_0x558d72(0x198)+a51_0x5af198[_0x558d72(0x278)](_0x321e8)+_0x558d72(0x24a)+a51_0x5af198[_0x558d72(0x278)](_0x35d4a7));}const _0x28eecf=new WorkflowTimelineCommand();await _0x28eecf['execute']({'args':[],'options':{..._0x4c908e,'attemptId':_0x45d272[_0x558d72(0x2b1)]},'tdx':_0x409aa});}[a51_0x64d48f(0x1ac)](_0x46dcc9,_0x343f3f){const _0x5730c5=a51_0x64d48f,_0x3598d7=new Map();for(const _0x3e2806 of _0x46dcc9){_0x3e2806['id']&&_0x3e2806['lastAttempt']?.['id']&&_0x3598d7[_0x5730c5(0x2a0)](_0x3e2806['id'],_0x3e2806[_0x5730c5(0x296)]['id']);}const _0x49be2e=[];let _0x11c06e='';const _0x58ea23=this[_0x5730c5(0x1b0)](_0x46dcc9,_0x343f3f),_0x4ff878=_0x58ea23['split']('\x0a');for(const _0xd7b3e0 of _0x4ff878){if(_0xd7b3e0['startsWith'](_0x5730c5(0x276))||_0xd7b3e0[_0x5730c5(0x20c)](/^\s+\d{4}-\d{2}-\d{2}/))_0x11c06e=_0xd7b3e0;else{if(_0xd7b3e0[_0x5730c5(0x20c)](/^[✅❌🔄🛑⏳]/)){const _0x1409fa=_0xd7b3e0[_0x5730c5(0x20c)](/#(\d+)/),_0x49077d=_0x1409fa?_0x1409fa[0x1]:null,_0x48e31e=_0x49077d?_0x3598d7[_0x5730c5(0x247)](_0x49077d)||null:null,_0x4239bf=_0x46dcc9['find'](_0x8bf2c5=>_0x8bf2c5['id']===_0x49077d),_0x123432=_0x4239bf?.['project']?.['name']||'';_0x49be2e[_0x5730c5(0x235)]({'displayLine':_0xd7b3e0,'attemptId':_0x48e31e,'projectName':_0x123432});}}}return{'timelineRows':_0x49be2e,'timeAxisHeader':_0x11c06e};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x1b4);[a51_0x64d48f(0x252)]=a51_0x64d48f(0x2fe);async[a51_0x64d48f(0x1fb)](_0x560329){const _0x1b5410=a51_0x64d48f,{options:_0x2acdf0,args:_0x276d49,tdx:_0x26e401}=_0x560329,_0x58cea7=this[_0x1b5410(0x2b6)](_0x276d49,_0x2acdf0);if(!_0x58cea7)return 0x1;const {projectName:_0x4c3407,workflowName:_0x1faa0b}=_0x58cea7,_0x591d67=_0x2acdf0[_0x1b5410(0x1f2)];if(_0x2acdf0[_0x1b5410(0x210)]){if(_0x4c3407&&_0x1faa0b)console[_0x1b5410(0x2a9)](_0x1b5410(0x242)+_0x4c3407+'.'+_0x1faa0b);else _0x4c3407&&console[_0x1b5410(0x2a9)]('Filter:\x20project='+_0x4c3407);_0x591d67&&console[_0x1b5410(0x2a9)](_0x1b5410(0x232));}const _0x3ab4d8=await withSpinner(_0x1b5410(0x268),()=>_0x26e401[_0x1b5410(0x237)][_0x1b5410(0x204)]({'projectName':_0x4c3407,'workflowName':_0x1faa0b,'includeRetried':_0x591d67,'limit':_0x2acdf0[_0x1b5410(0x1c4)]}),{'verbose':_0x2acdf0[_0x1b5410(0x210)]}),_0x3d4618=_0x3ab4d8[_0x1b5410(0x1aa)],_0x1e6c8f=_0x2acdf0[_0x1b5410(0x1c4)]||0x64,_0x44dd26=_0x3d4618[_0x1b5410(0x1d8)]>=_0x1e6c8f?a51_0x5af198[_0x1b5410(0x278)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x1b5410(0x2a9)]('✔\x20Found\x20'+_0x3d4618['length']+'\x20attempt'+(_0x3d4618['length']!==0x1?'s':'')+_0x44dd26);if(_0x2acdf0[_0x1b5410(0x227)]===_0x1b5410(0x1c1)||_0x2acdf0[_0x1b5410(0x227)]===_0x1b5410(0x18f)||_0x2acdf0[_0x1b5410(0x227)]===_0x1b5410(0x236))await handleSDKOutput(_0x3d4618,_0x2acdf0);else{if(_0x3d4618[_0x1b5410(0x1d8)]===0x0){if(_0x4c3407&&_0x1faa0b)console['log']('No\x20attempts\x20found\x20for:\x20'+_0x4c3407+'.'+_0x1faa0b);else _0x4c3407?console[_0x1b5410(0x2a7)](_0x1b5410(0x253)+_0x4c3407):console[_0x1b5410(0x2a7)]('No\x20attempts\x20found');}else{const _0x55e19a=_0x2acdf0[_0x1b5410(0x1a4)],_0x3f8cbe=_0x3d4618[_0x1b5410(0x2b9)](_0x4745c9=>{const _0x370607=_0x1b5410,_0x40a357=a51_0x5af198['dim']('#'+_0x4745c9['id']),_0x476f34=_0x4745c9[_0x370607(0x29e)]?.['id'],_0x424517=_0x4745c9['session_id']||_0x4745c9[_0x370607(0x17c)],_0x6301c9=_0x476f34&&_0x424517?hyperlink(_0x40a357,getWorkflowAttemptUrl(_0x55e19a,_0x476f34,_0x424517,_0x4745c9['id'])):_0x40a357,{icon:_0x593ecb,text:_0x5d7c83}=getAttemptStatusDisplay(_0x4745c9),_0x1ce929=(_0x4745c9[_0x370607(0x29e)]?.[_0x370607(0x246)]||'?')+'.'+(_0x4745c9['workflow']?.[_0x370607(0x246)]||'?'),_0x82c5a6=_0x4745c9[_0x370607(0x200)]?a51_0x5af198[_0x370607(0x278)](_0x4745c9[_0x370607(0x200)]):'';return(_0x6301c9+'\x20'+_0x593ecb+(_0x5d7c83?'\x20'+_0x5d7c83:'')+'\x20'+_0x1ce929+'\x20'+_0x82c5a6)[_0x370607(0x24e)]();});await writeOutput(_0x3f8cbe[_0x1b5410(0x1eb)]('\x0a'),_0x2acdf0['output'],_0x1b5410(0x209));}}return 0x0;}}function a51_0x5dbb(){const _0x101345=['fileSize','Error:\x20Invalid\x20parameter\x20format:\x20','\x20has\x20no\x20attempts','join','611930zFBeqx','\x20\x20Changes:\x20','existingProjectId','blue','Key\x20cannot\x20be\x20empty','path','includeRetried','utf-8','yellow','diff','\x20\x20Files\x20extracted:\x20','filter','Listing\x20secrets...','changes','state','execute','getMonth','group_error','cyan','Failed\x20to\x20fetch\x20attempt\x20data','sessionTime','session','fs/promises','\x20session','attempts','isArray','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','MAX_POLL_ITERATIONS','executeCloneProject','list','LABEL_WIDTH_DIVISOR','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','match','fromTask','end','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','verbose','projectName','✔\x20Clone\x20complete','newProjectId','Loading\x20session...','Warning:','yes','\x20\x20Revision:\x20','unknown','workflow:download','navigateSessionsInteractive','Pushing\x20workflow\x20project...','clear','Total:\x20','Listing\x20workflows...','No\x20workflow\x20sessions\x20found','\x0aClone\x20\x22','3Yatgtf','workflow:tasks','run','→\x20New\x20project:\x20','Select\x20a\x20session\x20to\x20view\x20timeline:','Usage:\x20workflow:delete\x20<project-name-or-id>','format','requireProject','\x20\x20Workflow:\x20','projects','slice','delete','indexOf','workflow:workflows','List\x20workflow\x20execution\x20sessions','📁\x20','...','Include\x20retried:\x20yes','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','push','table','workflow','Attempt:\x20','Downloading\x20project\x20','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','floor','ICON_WIDTH','red','index','revision','Listing\x20workflow\x20sessions...','planned','Filter:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','\x0aPolling...\x20(','workflow:attempt','name','get','includes','\x20\x20Attempt\x20ID:\x20',',\x20Workflow:\x20','listSecrets','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Resume\x20from:\x20','trimEnd','MAX_LABEL_COUNT','\x20\x20Session\x20ID:\x20','Fetching\x20log\x20files...','description','No\x20attempts\x20found\x20in\x20project:\x20','min','isDirectory','applyPullProject','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','attempt:','logs','running','🔄\x20','\x20\x20Source:\x20','metadata','Source\x20directory:\x20','resolveProjectId','\x20new','No\x20sessions\x20found','context','basename','workflow:kill','Task\x20name:\x20','projectId','GUTTER','Listing\x20workflow\x20attempts...','Updating\x20','\x20modified','rows','trim','\x20\x20Console:\x20','Pattern:\x20','7623816pFAUmO','splice','targetDir','\x0aApply\x20these\x20changes?','\x20to\x20see\x20detailed\x20logs','ICON_SPACING','Including\x20subtasks:\x20yes','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','renderSingleTimeline','dim','\x0aError:','modified','-\x20no\x20files\x20written','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','\x1b[1A\x1b[2K','success','tdx\x20wf\x20attempt\x20','MAX_TIMELINE_WIDTH','download','split','showWorkflowConsoleUrl','No\x20workflows\x20found','has','preparePushProject','text','stdout','pullProject','Using\x20attempt\x20','Files\x20to\x20upload:\x20','✔\x20Found\x20','Session\x20','Revision:\x20','dryRun','keys','\x0aUpdate\x20existing\x20project\x20\x22','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','✔\x20Workflow\x20project\x20context\x20cleared.','isTTY','lastAttempt','MIN_LABEL_COUNT','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','(unknown)','columns','fileCount','Kill\x20a\x20running\x20attempt','Setting\x20secret...','project','Output\x20directory:\x20','set','Project\x20filter:\x20','parse','Show\x20tasks\x20for\x20an\x20attempt','\x22\x20already\x20exists\x20(ID:\x20','tdx.json','\x20\x20New\x20attempt\x20ID:\x20','log','msPerChar','error','follow','\x20\x20Project\x20ID:\x20','resolve','renderTimeline','\x20\x20Session\x20context\x20set\x20to:\x20','readFile','\x20from\x20session\x20','attemptId','Retrying\x20attempt...','MAX_TASKS_DISPLAY','pollTimeline','198bPhDPo','parseProjectWorkflowPattern','workflow:secrets:set','MIN_TIMELINE_WIDTH','map','\x22\x20with\x20new\x20revision?','displayLine','substring','getTime','key','done','workflow:pull','sys','\x0a✔\x20Attempt\x20complete','resumeFrom','select','POLL_INTERVAL_MS','toISOString','now','Dry\x20run:\x20yes','Cloning\x20to\x20','Params:\x20','workflow:logs','sourceProjectName','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','buildTimelineData','sessions','✔\x20Downloaded\x20','Expected\x20format:\x20--param\x20key=value','Deleting\x20secret...','Source:\x20','finishedAt','Filter:\x20project=','param','max','✔\x20Project\x20updated','skipValidation','session:','repeat','Show\x20specific\x20attempt\x20details','startsWith','No\x20matching\x20sessions\x20found','\x20deleted','retryAttemptName','\x0a✔\x20Already\x20up\x20to\x20date','createdAt','12268DKjqmk','✔\x20Pull\x20complete','Error:\x20Project\x20name\x20is\x20required','\x20(use\x20--limit\x20to\x20show\x20more)','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','value','\x0aDry\x20run\x20-\x20no\x20project\x20created','/attempt/','pending','Analyzing\x20changes...','every','green','setSecrets','status','workflow:use','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','getDate','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','✔\x20Deleted\x20project\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','TASK_NAME_WIDTH','3021333cNYKEm','localeCompare','Loading\x20workflows...','values','taskName','List\x20workflow\x20attempts','Usage:\x20tdx\x20wf\x20use\x20<project>','No\x20sessions\x20found\x20for:\x20','\x27...','hasChanges','Killing\x20attempt...','Select\x20a\x20task\x20to\x20view\x20logs:','find','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','workflowProject','Source\x20directory\x20is\x20required','Setting\x20','workflow:secrets:delete','cancelRequested','sourceDir','task','\x20logs','LABEL_MIN_SPACING','\x27\x20from\x20project\x20\x27','getMinutes','\x20unchanged','⚠\x20Showing\x20first\x20','Error:\x20Invalid\x20JSON\x20in\x20--params','No\x20sessions\x20found\x20in\x20project:\x20','padStart','Latest\x20session\x20has\x20no\x20attempt','params','Attempt\x20ID:\x20','output','workflows','kill','\x20\x20tdx\x20wf\x20use\x20<project>','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','summary','start','\x0aDry\x20run\x20-\x20nothing\x20pushed','Analyzing\x20project...','\x20\x20Project:\x20','sessionId','Status:\x20','resolveProjectDir','Error:\x20Attempt\x20ID\x20is\x20required','startTime','new','Project\x20name\x20is\x20required','Target\x20directory:\x20','fill','✔\x20Workflow\x20run\x20started','duration','✔\x20Pushed\x20','canceling','revision:\x20','Error:\x20Secret\x20key\x20is\x20required','List\x20workflows','Error:','\x20secrets...','815218ExEaeu','jsonl','getHours','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','getFullYear','\x20-\x20','fullName','2296064SXheJM','prepareCloneProject','from','Project:\x20','Project\x20name:\x20','newProjectName','deleted','sort','✔\x20Project:\x20','relative','Auto-selected\x20latest\x20session:\x20','window','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','No\x20sessions\x20with\x20timing\x20information','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','site','Workflow:\x20','message','workflow:projects','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','Getting\x20attempt\x20tasks...','data','cwd','generateSessionTimelineRows','workflow:run','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','toLowerCase','renderSessionsTimeline','(use\x20--limit\x20to\x20see\x20more)','retrySession','Source\x20project:\x20','workflow:attempts','No\x20log\x20content\x20found','✔\x20Secret\x20\x27','Key:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','✔\x20Showing\x20','attempt','workflow:retry','\x20workflow','Tip:\x20cd\x20to\x20workflows/','2616654gyMawE','title','startedAt','json','\x0a⚠\x20Project\x20\x22','✔\x20Workflow\x20project\x20set\x20to:\x20','limit','includeSubtasks','Validation:\x20skipped','1055xkYDOJ','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','targetExists','updatedAt','Getting\x20attempt\x20details...','Error:\x20','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Cancelled','all','\x20\x20Location:\x20','some','\x0a✔\x20No\x20changes\x20to\x20push','executePushProject','New\x20project\x20name:\x20','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','force','length','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','round','/app/workflows/','Session\x20not\x20found:\x20','No\x20workflow\x20tdx.json\x20found','💡\x20Tip:\x20Use\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Retrying\x20session...','\x22\x20to\x20new\x20project\x20\x22','Target:\x20','Start\x20a\x20workflow\x20run','No\x20projects\x20match\x20pattern:\x20','resolveProject','---\x20'];a51_0x5dbb=function(){return _0x101345;};return a51_0x5dbb();}export class WorkflowAttemptCommand extends BaseCommand{['name']=a51_0x64d48f(0x245);[a51_0x64d48f(0x252)]=a51_0x64d48f(0x2dd);async[a51_0x64d48f(0x1fb)](_0x3c4f91){const _0x49be43=a51_0x64d48f,{options:_0x23db0f,args:_0x11a0bb,tdx:_0x116106}=_0x3c4f91,_0x45abf2=_0x11a0bb[0x0];if(!_0x45abf2)return console[_0x49be43(0x2a9)](_0x49be43(0x17f)),0x1;_0x23db0f['verbose']&&console[_0x49be43(0x2a9)](_0x49be43(0x171)+_0x45abf2);const _0xcd5df2=await withSpinner(_0x49be43(0x1cb),()=>_0x116106[_0x49be43(0x237)][_0x49be43(0x1ba)](_0x45abf2),{'verbose':_0x23db0f[_0x49be43(0x210)]}),_0x333d00=_0xcd5df2[_0x49be43(0x1aa)];let _0x1d282c;!_0x333d00[_0x49be43(0x2bf)]?_0x1d282c=_0x333d00['cancelRequested']?_0x49be43(0x188):_0x49be43(0x25a):_0x1d282c=_0x333d00['success']?_0x49be43(0x27f):_0x49be43(0x2a9);let _0x124514;if(_0x333d00[_0x49be43(0x2e3)]&&_0x333d00[_0x49be43(0x2d5)]){const _0x1b3e24=new Date(_0x333d00[_0x49be43(0x2e3)])[_0x49be43(0x2bd)](),_0x2e99b5=new Date(_0x333d00[_0x49be43(0x2d5)])[_0x49be43(0x2bd)]();_0x124514=Math[_0x49be43(0x1db)]((_0x2e99b5-_0x1b3e24)/0x3e8);}const _0x139656={'attempt_id':_0x333d00['id'],'status':_0x1d282c,..._0x333d00[_0x49be43(0x23e)]!==undefined&&{'index':_0x333d00[_0x49be43(0x23e)]},..._0x333d00[_0x49be43(0x29e)]&&{'project':_0x333d00['project'][_0x49be43(0x246)]},..._0x333d00[_0x49be43(0x237)]&&{'workflow':_0x333d00[_0x49be43(0x237)][_0x49be43(0x246)]},..._0x333d00[_0x49be43(0x17c)]&&{'session_id':_0x333d00[_0x49be43(0x17c)]},..._0x333d00[_0x49be43(0x200)]&&{'session_time':_0x333d00['sessionTime']},..._0x333d00[_0x49be43(0x2e1)]&&{'retry_attempt':_0x333d00['retryAttemptName']},..._0x124514!==undefined&&{'duration_sec':_0x124514},..._0x333d00[_0x49be43(0x2e3)]&&{'created_at':_0x333d00['createdAt']},..._0x333d00[_0x49be43(0x2d5)]&&{'finished_at':_0x333d00[_0x49be43(0x2d5)]},...Object[_0x49be43(0x291)](_0x333d00[_0x49be43(0x170)])['length']>0x0&&{'params':_0x333d00[_0x49be43(0x170)]}};return await handleSingleObjectOutput(_0x139656,_0x23db0f),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x222);['description']=a51_0x64d48f(0x2a3);async[a51_0x64d48f(0x1fb)](_0x5039c1){const _0x1dc2cb=a51_0x64d48f,{options:_0x3db338,args:_0x374e79,tdx:_0x5bd11f}=_0x5039c1,_0xe924d8=_0x374e79[0x0];if(!_0xe924d8)return console['error'](_0x1dc2cb(0x17f)),0x1;const _0x5a866f=_0x3db338[_0x1dc2cb(0x1c5)];_0x3db338['verbose']&&(console[_0x1dc2cb(0x2a9)]('Attempt\x20ID:\x20'+_0xe924d8),_0x5a866f&&console[_0x1dc2cb(0x2a9)](_0x1dc2cb(0x275)));const _0x42723d=await withSpinner(_0x1dc2cb(0x1a9),()=>_0x5bd11f[_0x1dc2cb(0x237)]['tasks'](_0xe924d8,_0x5a866f||![]),{'verbose':_0x3db338[_0x1dc2cb(0x210)]}),_0xa7bba=_0x42723d['data'];return console['error'](_0x1dc2cb(0x28d)+_0xa7bba[_0x1dc2cb(0x1d8)]+'\x20task'+(_0xa7bba[_0x1dc2cb(0x1d8)]!==0x1?'s':'')),await handleSDKOutput(_0xa7bba,_0x3db338),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a51_0x64d48f(0x2cb);[a51_0x64d48f(0x252)]=a51_0x64d48f(0x2cd);async[a51_0x64d48f(0x1fb)](_0x18fa4f){const _0x585928=a51_0x64d48f,{options:_0x338854,args:_0x4213b8,tdx:_0x951695}=_0x18fa4f,_0x5a3143=_0x4213b8[0x0];let _0xccc752=_0x4213b8[0x1];if(!_0x5a3143)return console['error'](_0x585928(0x17f)),0x1;_0x338854[_0x585928(0x210)]&&(console[_0x585928(0x2a9)](_0x585928(0x171)+_0x5a3143),_0xccc752&&console[_0x585928(0x2a9)](_0x585928(0x265)+_0xccc752));const _0x557141=await withSpinner(_0x585928(0x251),()=>_0x951695[_0x585928(0x237)]['logFiles'](_0x5a3143,_0xccc752),{'verbose':_0x338854[_0x585928(0x210)]}),_0x37c937=_0x557141[_0x585928(0x1aa)];if(_0x37c937[_0x585928(0x1d8)]===0x0)return console[_0x585928(0x2a9)](_0x585928(0x24c)),0x0;if(!_0xccc752&&(_0x338854[_0x585928(0x1c1)]||_0x338854[_0x585928(0x227)]))return await handleSDKOutput(_0x37c937,_0x338854),0x0;if(!_0xccc752){const _0x12577b=_0x37c937['map'](_0x27e44d=>({'title':_0x27e44d['taskName']+'\x20('+formatBytes(_0x27e44d[_0x585928(0x1e8)])+')','value':_0x27e44d[_0x585928(0x2fd)]})),_0x31cb3c=await a51_0x396bfc({'type':_0x585928(0x2c4),'name':'task','message':_0x585928(0x304),'choices':_0x12577b});if(!_0x31cb3c[_0x585928(0x30d)])return console[_0x585928(0x2a9)](_0x585928(0x1cf)),0x0;_0xccc752=_0x31cb3c[_0x585928(0x30d)];}const _0x47bb7b=await withSpinner('Downloading\x20logs...',()=>_0x951695['workflow'][_0x585928(0x259)](_0x5a3143,_0xccc752),{'verbose':_0x338854[_0x585928(0x210)]}),_0x4d6dbb=_0x47bb7b[_0x585928(0x1aa)];return _0x4d6dbb?console[_0x585928(0x2a7)](_0x4d6dbb):console['error'](_0x585928(0x1b5)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x264);[a51_0x64d48f(0x252)]=a51_0x64d48f(0x29c);async[a51_0x64d48f(0x1fb)](_0x442731){const _0x264cec=a51_0x64d48f,{options:_0x1ed680,args:_0x489cf6,tdx:_0x4fb182}=_0x442731,_0x3e8a43=_0x489cf6[0x0];if(!_0x3e8a43)return console[_0x264cec(0x2a9)](_0x264cec(0x17f)),0x1;const _0x359c62=_0x1ed680['reason'];_0x1ed680[_0x264cec(0x210)]&&(console['error']('Attempt\x20ID:\x20'+_0x3e8a43),_0x359c62&&console[_0x264cec(0x2a9)]('Reason:\x20'+_0x359c62));if(!_0x1ed680[_0x264cec(0x216)]){if(!isInteractive())return console[_0x264cec(0x2a9)](a51_0x5af198[_0x264cec(0x23d)](_0x264cec(0x279)),_0x264cec(0x257)),console[_0x264cec(0x2a9)](a51_0x5af198[_0x264cec(0x278)](_0x264cec(0x2f3))),0x1;const _0x659c2c=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x3e8a43+'?');if(!_0x659c2c)return console[_0x264cec(0x2a9)](a51_0x5af198[_0x264cec(0x1f4)](_0x264cec(0x1cf))),0x1;}const _0x5af2e2=await withSpinner(_0x264cec(0x303),()=>_0x4fb182['workflow'][_0x264cec(0x174)](_0x3e8a43,_0x359c62),{'verbose':_0x1ed680[_0x264cec(0x210)]}),_0x1fd97e=_0x5af2e2['data'];return console[_0x264cec(0x2a9)]('✔\x20'+_0x1fd97e),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x1bb);[a51_0x64d48f(0x252)]='Retry\x20a\x20session\x20or\x20attempt';async[a51_0x64d48f(0x1fb)](_0x132ad1){const _0x175c81=a51_0x64d48f,{options:_0x165d3a,args:_0x296050,tdx:_0x5eae28}=_0x132ad1,_0x4059d4=_0x296050[0x0];if(!_0x4059d4)return console[_0x175c81(0x2a9)](_0x175c81(0x2f7)),console[_0x175c81(0x2a9)](_0x175c81(0x191)),0x1;let _0x2d4d95=![],_0x451f2b=_0x4059d4;if(_0x4059d4[_0x175c81(0x2de)](_0x175c81(0x2db)))_0x2d4d95=!![],_0x451f2b=_0x4059d4[_0x175c81(0x2bc)](0x8);else{if(_0x4059d4[_0x175c81(0x2de)](_0x175c81(0x258)))_0x2d4d95=![],_0x451f2b=_0x4059d4[_0x175c81(0x2bc)](0x8);else return console[_0x175c81(0x2a9)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console['error'](_0x175c81(0x191)),0x1;}const _0x443e13=_0x165d3a[_0x175c81(0x20d)],_0x45e859=_0x165d3a[_0x175c81(0x2c3)],_0x480d4b=_0x165d3a['params'],_0x377e56=_0x165d3a[_0x175c81(0x1d7)];_0x165d3a['verbose']&&(console[_0x175c81(0x2a9)](_0x175c81(0x1e3)+(_0x2d4d95?_0x175c81(0x201):_0x175c81(0x1ba))+'\x20'+_0x451f2b),_0x443e13&&console[_0x175c81(0x2a9)]('From\x20task:\x20'+_0x443e13),_0x45e859&&console[_0x175c81(0x2a9)](_0x175c81(0x24d)+_0x45e859),_0x480d4b&&console[_0x175c81(0x2a9)](_0x175c81(0x2ca)+_0x480d4b),_0x377e56&&console[_0x175c81(0x2a9)]('Force:\x20yes'));let _0x2e7503;if(_0x480d4b)try{if(_0x480d4b[_0x175c81(0x2de)]('@')){const _0x188fc4=await import(_0x175c81(0x202)),_0x277ef7=_0x480d4b[_0x175c81(0x2bc)](0x1),_0x165918=await _0x188fc4[_0x175c81(0x2af)](_0x277ef7,_0x175c81(0x1f3));_0x2e7503=JSON[_0x175c81(0x2a2)](_0x165918);}else _0x2e7503=JSON['parse'](_0x480d4b);}catch{return console[_0x175c81(0x2a9)](_0x175c81(0x314)),0x1;}if(!_0x165d3a[_0x175c81(0x216)]){if(!isInteractive())return console[_0x175c81(0x2a9)](a51_0x5af198[_0x175c81(0x23d)](_0x175c81(0x279)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x175c81(0x2a9)](a51_0x5af198['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3c4e96=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x2d4d95?_0x175c81(0x201):_0x175c81(0x1ba))+'\x20'+_0x451f2b+'?');if(!_0x3c4e96)return console[_0x175c81(0x2a9)](a51_0x5af198[_0x175c81(0x1f4)](_0x175c81(0x1cf))),0x1;}let _0x5624c3;_0x2d4d95?_0x5624c3=await withSpinner(_0x175c81(0x1e1),()=>_0x5eae28[_0x175c81(0x237)][_0x175c81(0x1b2)](_0x451f2b,{'fromTask':_0x443e13,'retryParams':_0x2e7503}),{'verbose':_0x165d3a['verbose']}):_0x5624c3=await withSpinner(_0x175c81(0x2b2),()=>_0x5eae28[_0x175c81(0x237)]['retryAttempt'](_0x451f2b,{'resumeFrom':_0x45e859,'retryParams':_0x2e7503,'force':_0x377e56}),{'verbose':_0x165d3a[_0x175c81(0x210)]});const _0x185255=_0x5624c3[_0x175c81(0x1aa)];return console[_0x175c81(0x2a9)]('✔\x20Retry\x20started'),console[_0x175c81(0x2a9)](_0x175c81(0x2a6)+_0x185255[_0x175c81(0x2b1)]),console[_0x175c81(0x2a9)](_0x175c81(0x250)+_0x185255[_0x175c81(0x17c)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a51_0x64d48f(0x1ad);[a51_0x64d48f(0x252)]=a51_0x64d48f(0x1e4);async['execute'](_0xbb1981){const _0x3b0f77=a51_0x64d48f,{options:_0x21477e,args:_0x2534d0,tdx:_0x1a6219}=_0xbb1981;let _0x551019=_0x2534d0[0x0];if(!_0x551019){const _0x1bde3d=this[_0x3b0f77(0x1e6)]([],_0x21477e),_0x536ec6=await withSpinner(_0x3b0f77(0x2fb),()=>_0x1a6219[_0x3b0f77(0x237)][_0x3b0f77(0x173)](_0x1bde3d,{'limit':_0x21477e[_0x3b0f77(0x1c4)]}),{'verbose':_0x21477e['verbose']}),_0x24e585=_0x536ec6[_0x3b0f77(0x1aa)];if(_0x24e585[_0x3b0f77(0x1d8)]===0x0)return console[_0x3b0f77(0x2a9)]('No\x20workflows\x20found'),!_0x1bde3d&&console[_0x3b0f77(0x2a9)](a51_0x5af198['dim'](_0x3b0f77(0x206))),0x1;const _0x5eab6b=_0x24e585[_0x3b0f77(0x2b9)](_0x17d350=>({'title':_0x17d350[_0x3b0f77(0x29e)]?.[_0x3b0f77(0x246)]+'.'+_0x17d350[_0x3b0f77(0x246)],'value':_0x17d350[_0x3b0f77(0x29e)]?.['name']+'.'+_0x17d350[_0x3b0f77(0x246)],'description':_0x17d350[_0x3b0f77(0x23f)]?_0x3b0f77(0x189)+_0x17d350['revision']:undefined})),_0x149cc4=await a51_0x396bfc({'type':'select','name':'workflow','message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x5eab6b});if(!_0x149cc4[_0x3b0f77(0x237)])return 0x1;_0x551019=_0x149cc4[_0x3b0f77(0x237)];}if(!_0x551019[_0x3b0f77(0x248)]('.')){const _0x1d0b86=this[_0x3b0f77(0x1e6)]([],_0x21477e);if(_0x1d0b86)_0x551019=_0x1d0b86+'.'+_0x551019;else return console['error'](a51_0x5af198[_0x3b0f77(0x23d)](_0x3b0f77(0x18c)),_0x3b0f77(0x23a)),console['error'](a51_0x5af198[_0x3b0f77(0x278)](_0x3b0f77(0x206))),0x1;}const _0x3a3e2c=_0x21477e[_0x3b0f77(0x2d7)],_0x53970d=_0x21477e[_0x3b0f77(0x200)],_0x58b46d={};if(_0x3a3e2c&&Array[_0x3b0f77(0x205)](_0x3a3e2c))for(const _0x42ad72 of _0x3a3e2c){const _0x2377c1=_0x42ad72[_0x3b0f77(0x22d)]('=');if(_0x2377c1===-0x1)return console[_0x3b0f77(0x2a9)](_0x3b0f77(0x1e9)+_0x42ad72),console[_0x3b0f77(0x2a9)](_0x3b0f77(0x2d2)),0x1;const _0x43bd8e=_0x42ad72[_0x3b0f77(0x2bc)](0x0,_0x2377c1),_0x5c7d7b=_0x42ad72[_0x3b0f77(0x2bc)](_0x2377c1+0x1);try{_0x58b46d[_0x43bd8e]=JSON[_0x3b0f77(0x2a2)](_0x5c7d7b);}catch{_0x58b46d[_0x43bd8e]=_0x5c7d7b;}}_0x21477e[_0x3b0f77(0x210)]&&(console[_0x3b0f77(0x2a9)](_0x3b0f77(0x1a5)+_0x551019),Object[_0x3b0f77(0x291)](_0x58b46d)[_0x3b0f77(0x1d8)]>0x0&&console['error']('Parameters:\x20'+JSON['stringify'](_0x58b46d)),_0x53970d&&console[_0x3b0f77(0x2a9)]('Session\x20time:\x20'+_0x53970d));const _0x377bb9=await withSpinner('Starting\x20workflow\x20run...',()=>_0x1a6219['workflow'][_0x3b0f77(0x223)](_0x551019,_0x58b46d,{'sessionTime':_0x53970d}),{'verbose':_0x21477e[_0x3b0f77(0x210)]}),_0x197834=_0x377bb9[_0x3b0f77(0x1aa)];console['error'](_0x3b0f77(0x185)),console[_0x3b0f77(0x2a9)](_0x3b0f77(0x249)+_0x197834['id']),console[_0x3b0f77(0x2a9)]('\x20\x20Session\x20ID:\x20'+_0x197834[_0x3b0f77(0x17c)]),console[_0x3b0f77(0x2a9)](_0x3b0f77(0x17b)+_0x197834[_0x3b0f77(0x29e)]?.['name']),console[_0x3b0f77(0x2a9)](_0x3b0f77(0x229)+_0x197834[_0x3b0f77(0x237)]?.[_0x3b0f77(0x246)]);if(_0x197834[_0x3b0f77(0x29e)]?.['id']&&_0x197834[_0x3b0f77(0x17c)]&&_0x197834['id']){const _0x205cf3=_0x21477e[_0x3b0f77(0x1a4)],_0x4e54ce=getConsoleUrl(_0x205cf3,_0x3b0f77(0x1dc)+_0x197834[_0x3b0f77(0x29e)]['id']+'/sessions/'+_0x197834['sessionId']+_0x3b0f77(0x2eb)+_0x197834['id']);console[_0x3b0f77(0x2a9)](_0x3b0f77(0x26d)+a51_0x5af198[_0x3b0f77(0x1fe)](_0x4e54ce));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x219);['description']=a51_0x64d48f(0x1da);async[a51_0x64d48f(0x1fb)](_0x510bd9){const _0x25cda1=a51_0x64d48f,{options:_0x33ffdc,args:_0x5935ab,tdx:_0x3927af}=_0x510bd9,_0x3ce454=_0x5935ab[0x0],_0x3539ae=_0x5935ab[0x1]||'.';if(!_0x3ce454)return console['error'](_0x25cda1(0x2e6)),console[_0x25cda1(0x2a9)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x119f61=_0x33ffdc[_0x25cda1(0x23f)];_0x33ffdc[_0x25cda1(0x210)]&&(console[_0x25cda1(0x2a9)]('Project:\x20'+_0x3ce454),console[_0x25cda1(0x2a9)](_0x25cda1(0x29f)+_0x3539ae),_0x119f61&&console[_0x25cda1(0x2a9)](_0x25cda1(0x28f)+_0x119f61));const _0x44d46d=await withSpinner(_0x25cda1(0x239)+_0x3ce454+_0x25cda1(0x231),()=>_0x3927af[_0x25cda1(0x237)][_0x25cda1(0x282)](_0x3ce454,_0x3539ae,{'revision':_0x119f61}),{'verbose':_0x33ffdc['verbose']}),_0xc0e6ec=_0x44d46d[_0x25cda1(0x1aa)];return console[_0x25cda1(0x2a9)](_0x25cda1(0x2d1)+_0xc0e6ec[_0x25cda1(0x211)]),console['error'](_0x25cda1(0x217)+_0xc0e6ec[_0x25cda1(0x23f)]),console['error'](_0x25cda1(0x1f6)+_0xc0e6ec['filesExtracted']),console['error'](_0x25cda1(0x1d1)+_0x3539ae+'/'+_0xc0e6ec[_0x25cda1(0x211)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]='workflow:upload';[a51_0x64d48f(0x252)]=a51_0x64d48f(0x1cd);async['execute'](_0x5cd949){const _0x22922f=a51_0x64d48f,{options:_0xe359c1,args:_0x215db2,tdx:_0x383d10}=_0x5cd949;let _0x14ba1d='.',_0x6c2e13=_0xe359c1[_0x22922f(0x246)];if(_0x215db2[0x0]){const {promises:_0x2e78bd}=await import('fs');try{const _0x373aaf=await _0x2e78bd['stat'](_0x215db2[0x0]);if(_0x373aaf[_0x22922f(0x255)]())_0x14ba1d=_0x215db2[0x0];else return console[_0x22922f(0x2a9)](_0x22922f(0x1cc)+_0x215db2[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x6c2e13=_0x215db2[0x0],_0x14ba1d='.';}}const _0x8d9743=_0xe359c1[_0x22922f(0x23f)],_0x1cb16e=_0xe359c1[_0x22922f(0x2da)];_0xe359c1['verbose']&&(console[_0x22922f(0x2a9)]('Project\x20directory:\x20'+_0x14ba1d),_0x6c2e13&&console[_0x22922f(0x2a9)](_0x22922f(0x199)+_0x6c2e13),_0x8d9743&&console['error']('Revision:\x20'+_0x8d9743),_0x1cb16e&&console[_0x22922f(0x2a9)](_0x22922f(0x1c6)));const _0x5f0a12=await withSpinner(_0x22922f(0x21b),()=>_0x383d10[_0x22922f(0x237)]['push'](_0x14ba1d,{'projectName':_0x6c2e13,'revision':_0x8d9743,'skipValidation':_0x1cb16e}),{'verbose':_0xe359c1['verbose']}),_0xbacc73=_0x5f0a12[_0x22922f(0x1aa)];return console[_0x22922f(0x2a9)](_0x22922f(0x187)+_0xbacc73[_0x22922f(0x211)]),console[_0x22922f(0x2a9)](_0x22922f(0x2ab)+_0xbacc73[_0x22922f(0x266)]),console['error'](_0x22922f(0x217)+_0xbacc73[_0x22922f(0x23f)]),await this[_0x22922f(0x284)](_0x383d10,_0xbacc73[_0x22922f(0x211)],_0xe359c1[_0x22922f(0x1a4)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x2c0);[a51_0x64d48f(0x252)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async['execute'](_0x4833a7){const _0x4dbc06=a51_0x64d48f,{options:_0x4e070b,args:_0x3412fe,tdx:_0x47c6da}=_0x4833a7,_0x1f6f58=_0x3412fe[0x0],_0x35f535=_0x3412fe[0x1];if(!_0x1f6f58)return console['error'](a51_0x5af198[_0x4dbc06(0x23d)](_0x4dbc06(0x18c)),'Project\x20name\x20is\x20required'),console[_0x4dbc06(0x2a9)](a51_0x5af198[_0x4dbc06(0x278)](_0x4dbc06(0x298))),0x1;const _0x2fc5a8=_0x4e070b[_0x4dbc06(0x23f)];_0x4e070b[_0x4dbc06(0x210)]&&(console[_0x4dbc06(0x2a9)](_0x4dbc06(0x198)+_0x1f6f58),_0x35f535&&console[_0x4dbc06(0x2a9)](_0x4dbc06(0x183)+_0x35f535),_0x2fc5a8&&console[_0x4dbc06(0x2a9)](_0x4dbc06(0x28f)+_0x2fc5a8),_0x4e070b[_0x4dbc06(0x290)]&&console[_0x4dbc06(0x2a9)](_0x4dbc06(0x2c8)));const _0x5e0f2a=await withSpinner('Pulling\x20project\x20'+_0x1f6f58+_0x4dbc06(0x231),()=>_0x47c6da['workflow'][_0x4dbc06(0x28a)](_0x1f6f58,{'targetDir':_0x35f535,'revision':_0x2fc5a8}),{'verbose':_0x4e070b[_0x4dbc06(0x210)]}),_0x2d5382=_0x5e0f2a[_0x4dbc06(0x1aa)];_0x2d5382['isNewProject']?console['error'](_0x4dbc06(0x224)+_0x2d5382[_0x4dbc06(0x211)]):console[_0x4dbc06(0x2a9)]('→\x20Project:\x20'+_0x2d5382[_0x4dbc06(0x211)]);console[_0x4dbc06(0x2a9)](_0x4dbc06(0x217)+_0x2d5382[_0x4dbc06(0x23f)]),console[_0x4dbc06(0x2a9)]('\x20\x20Target:\x20'+(a51_0x2409f9[_0x4dbc06(0x19e)](process[_0x4dbc06(0x1ab)](),_0x2d5382[_0x4dbc06(0x271)])||'.')),console[_0x4dbc06(0x2a9)]('\x20\x20Changes:\x20'+a51_0x5af198['green']('+'+_0x2d5382[_0x4dbc06(0x177)][_0x4dbc06(0x181)]+_0x4dbc06(0x260))+',\x20'+(a51_0x5af198['yellow']('~'+_0x2d5382['summary']['modified']+_0x4dbc06(0x26a))+',\x20')+(a51_0x5af198[_0x4dbc06(0x23d)]('-'+_0x2d5382['summary'][_0x4dbc06(0x19b)]+_0x4dbc06(0x2e0))+',\x20')+(''+a51_0x5af198['dim'](_0x2d5382[_0x4dbc06(0x177)]['unchanged']+_0x4dbc06(0x312))));for(const _0x2f10f5 of _0x2d5382['changes']){_0x2f10f5['type']===_0x4dbc06(0x27a)&&_0x2f10f5[_0x4dbc06(0x1f5)]&&(console['error']('\x0a'+a51_0x5af198[_0x4dbc06(0x1fe)](_0x4dbc06(0x1e7)+_0x2f10f5[_0x4dbc06(0x1f1)])),console[_0x4dbc06(0x2a9)](_0x2f10f5[_0x4dbc06(0x1f5)]));}if(!_0x2d5382['hasChanges'])return saveSessionContext({'workflow_project':_0x2d5382[_0x4dbc06(0x211)]},_0x4e070b[_0x4dbc06(0x201)]),console['error'](a51_0x5af198[_0x4dbc06(0x2ef)](_0x4dbc06(0x2e2))),console[_0x4dbc06(0x2a9)](a51_0x5af198[_0x4dbc06(0x278)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x2d5382[_0x4dbc06(0x211)])),0x0;if(_0x4e070b[_0x4dbc06(0x290)])return console[_0x4dbc06(0x2a9)](a51_0x5af198[_0x4dbc06(0x1f4)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x4e070b['yes']){if(!isInteractive())return console[_0x4dbc06(0x2a9)](a51_0x5af198['red'](_0x4dbc06(0x279)),_0x4dbc06(0x257)),console[_0x4dbc06(0x2a9)](a51_0x5af198[_0x4dbc06(0x278)](_0x4dbc06(0x2f3))),0x1;const _0x499aca=await confirmKey(_0x4dbc06(0x272));if(!_0x499aca)return console[_0x4dbc06(0x2a9)](a51_0x5af198[_0x4dbc06(0x1f4)](_0x4dbc06(0x1cf)),_0x4dbc06(0x27b)),0x1;}await withSpinner('Writing\x20files...',()=>_0x47c6da[_0x4dbc06(0x237)][_0x4dbc06(0x256)](_0x2d5382,{'revision':_0x2fc5a8}),{'verbose':_0x4e070b[_0x4dbc06(0x210)]}),saveSessionContext({'workflow_project':_0x2d5382[_0x4dbc06(0x211)]},_0x4e070b[_0x4dbc06(0x201)]),console[_0x4dbc06(0x2a9)](a51_0x5af198[_0x4dbc06(0x2ef)](_0x4dbc06(0x2e5)));const _0x37e743=a51_0x2409f9['relative'](process['cwd'](),_0x2d5382['targetDir'])||'.';return console[_0x4dbc06(0x2a9)](a51_0x5af198[_0x4dbc06(0x278)](_0x4dbc06(0x1d1)+_0x37e743)),console[_0x4dbc06(0x2a9)](a51_0x5af198['dim'](_0x4dbc06(0x2ae)+_0x2d5382[_0x4dbc06(0x211)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]='workflow:push';[a51_0x64d48f(0x252)]='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async['execute'](_0x1c2af7){const _0x28fe7=a51_0x64d48f,{options:_0x1617be,args:_0x136267,tdx:_0x554aeb}=_0x1c2af7,_0x53a914=this[_0x28fe7(0x17e)](_0x136267,_0x1617be),_0x56e871=_0x1617be[_0x28fe7(0x23f)],_0x5b8247=_0x1617be[_0x28fe7(0x2da)];_0x1617be['verbose']&&(_0x53a914&&console[_0x28fe7(0x2a9)]('Source\x20directory:\x20'+_0x53a914),_0x56e871&&console[_0x28fe7(0x2a9)](_0x28fe7(0x28f)+_0x56e871),_0x1617be[_0x28fe7(0x290)]&&console['error'](_0x28fe7(0x2c8)),_0x5b8247&&console['error'](_0x28fe7(0x1c6)));let _0x5c3626;try{_0x5c3626=await withSpinner(_0x28fe7(0x2ed),()=>_0x554aeb['workflow'][_0x28fe7(0x287)]({'sourceDir':_0x53a914,'revision':_0x56e871,'skipValidation':_0x5b8247}),{'verbose':_0x1617be[_0x28fe7(0x210)]});}catch(_0x1acdcd){if(_0x1acdcd instanceof Error&&_0x1acdcd[_0x28fe7(0x1a6)][_0x28fe7(0x248)](_0x28fe7(0x1de)))return console['error'](a51_0x5af198['red'](_0x28fe7(0x18c)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x1617be[_0x28fe7(0x307)]?console['error'](a51_0x5af198[_0x28fe7(0x278)](_0x28fe7(0x1bd)+_0x1617be[_0x28fe7(0x307)]+_0x28fe7(0x20b)+_0x1617be[_0x28fe7(0x307)]+'\x27')):console[_0x28fe7(0x2a9)](a51_0x5af198[_0x28fe7(0x278)](_0x28fe7(0x1a8))),0x1;throw _0x1acdcd;}const _0x3917c1=_0x5c3626[_0x28fe7(0x1aa)];console['error'](_0x28fe7(0x19d)+_0x3917c1['projectName']),console[_0x28fe7(0x2a9)](_0x28fe7(0x25c)+_0x3917c1[_0x28fe7(0x30c)]),console[_0x28fe7(0x2a9)](_0x28fe7(0x217)+_0x3917c1[_0x28fe7(0x23f)]),console[_0x28fe7(0x2a9)](_0x28fe7(0x1ed)+a51_0x5af198['green']('+'+_0x3917c1[_0x28fe7(0x177)][_0x28fe7(0x181)]+_0x28fe7(0x260))+',\x20'+(a51_0x5af198[_0x28fe7(0x1f4)]('~'+_0x3917c1['summary'][_0x28fe7(0x27a)]+_0x28fe7(0x26a))+',\x20')+(a51_0x5af198[_0x28fe7(0x23d)]('-'+_0x3917c1[_0x28fe7(0x177)][_0x28fe7(0x19b)]+_0x28fe7(0x2e0))+',\x20')+(''+a51_0x5af198[_0x28fe7(0x278)](_0x3917c1[_0x28fe7(0x177)]['unchanged']+_0x28fe7(0x312))));for(const _0x2fd1a8 of _0x3917c1[_0x28fe7(0x1f9)]){_0x2fd1a8['type']===_0x28fe7(0x27a)&&_0x2fd1a8[_0x28fe7(0x1f5)]&&(console[_0x28fe7(0x2a9)]('\x0a'+a51_0x5af198[_0x28fe7(0x1fe)](_0x28fe7(0x1e7)+_0x2fd1a8[_0x28fe7(0x1f1)])),console['error'](_0x2fd1a8[_0x28fe7(0x1f5)]));}if(!_0x3917c1[_0x28fe7(0x302)])return console[_0x28fe7(0x2a9)](a51_0x5af198[_0x28fe7(0x2ef)](_0x28fe7(0x1d3))),await this[_0x28fe7(0x284)](_0x554aeb,_0x3917c1['projectName'],_0x1617be['site']),0x0;if(_0x1617be[_0x28fe7(0x290)])return console[_0x28fe7(0x2a9)](a51_0x5af198['yellow'](_0x28fe7(0x179))),0x0;if(!_0x1617be[_0x28fe7(0x216)]){if(!isInteractive())return console[_0x28fe7(0x2a9)](a51_0x5af198[_0x28fe7(0x23d)](_0x28fe7(0x279)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x28fe7(0x2a9)](a51_0x5af198[_0x28fe7(0x278)](_0x28fe7(0x2f3))),0x1;const _0x2a66f0=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x2a66f0)return console['error'](a51_0x5af198[_0x28fe7(0x1f4)]('Cancelled'),'-\x20nothing\x20pushed'),0x1;}const _0x2001b2=await withSpinner('Pushing\x20project...',()=>_0x554aeb[_0x28fe7(0x237)][_0x28fe7(0x1d4)](_0x3917c1),{'verbose':_0x1617be[_0x28fe7(0x210)]}),_0x3667e1=_0x2001b2[_0x28fe7(0x1aa)];return console[_0x28fe7(0x2a9)](a51_0x5af198[_0x28fe7(0x2ef)]('✔\x20Push\x20complete')),console['error'](_0x28fe7(0x2ab)+_0x3667e1[_0x28fe7(0x266)]),console[_0x28fe7(0x2a9)](_0x28fe7(0x217)+_0x3667e1['revision']),await this[_0x28fe7(0x284)](_0x554aeb,_0x3667e1[_0x28fe7(0x211)],_0x1617be[_0x28fe7(0x1a4)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]='workflow:clone';['description']='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a51_0x64d48f(0x1fb)](_0x5e936c){const _0x187cc6=a51_0x64d48f,{options:_0x2455e1,args:_0x4ef1c8,tdx:_0x3905c5}=_0x5e936c,_0x4b5d68=this['resolveProjectDir'](_0x4ef1c8,_0x2455e1),_0x53a374=_0x2455e1[_0x187cc6(0x246)],_0x2b22aa=_0x2455e1[_0x187cc6(0x23f)],_0x5cdbf3=_0x2455e1[_0x187cc6(0x2da)];if(!_0x4b5d68)return console['error'](a51_0x5af198['red'](_0x187cc6(0x18c)),_0x187cc6(0x308)),console[_0x187cc6(0x2a9)](a51_0x5af198[_0x187cc6(0x278)](_0x187cc6(0x27c))),console[_0x187cc6(0x2a9)](a51_0x5af198[_0x187cc6(0x278)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x53a374)return console[_0x187cc6(0x2a9)](a51_0x5af198[_0x187cc6(0x23d)]('Error:'),_0x187cc6(0x1a1)),console['error'](a51_0x5af198[_0x187cc6(0x278)](_0x187cc6(0x27c))),0x1;_0x2455e1['verbose']&&(console[_0x187cc6(0x2a9)](_0x187cc6(0x25e)+_0x4b5d68),console['error'](_0x187cc6(0x1d5)+_0x53a374),_0x2b22aa&&console['error']('Revision:\x20'+_0x2b22aa),_0x2455e1[_0x187cc6(0x290)]&&console[_0x187cc6(0x2a9)](_0x187cc6(0x2c8)),_0x5cdbf3&&console[_0x187cc6(0x2a9)]('Validation:\x20skipped'));const _0x5579d0=await withSpinner(_0x187cc6(0x17a),()=>_0x3905c5[_0x187cc6(0x237)][_0x187cc6(0x196)](_0x4b5d68,_0x53a374,{'revision':_0x2b22aa,'skipValidation':_0x5cdbf3}),{'verbose':_0x2455e1[_0x187cc6(0x210)]}),_0x5d8f11=_0x5579d0[_0x187cc6(0x1aa)];console[_0x187cc6(0x2a9)](_0x187cc6(0x2d4)+_0x5d8f11[_0x187cc6(0x30c)]);_0x5d8f11[_0x187cc6(0x2cc)]&&console[_0x187cc6(0x2a9)](_0x187cc6(0x1b3)+_0x5d8f11['sourceProjectName']);console[_0x187cc6(0x2a9)](_0x187cc6(0x1d5)+_0x5d8f11[_0x187cc6(0x19a)]),console[_0x187cc6(0x2a9)](_0x187cc6(0x28f)+_0x5d8f11[_0x187cc6(0x23f)]),console[_0x187cc6(0x2a9)](_0x187cc6(0x28c)+_0x5d8f11[_0x187cc6(0x29b)]);_0x5d8f11[_0x187cc6(0x1c9)]&&(console[_0x187cc6(0x2a9)](a51_0x5af198[_0x187cc6(0x1f4)](_0x187cc6(0x1c2)+_0x5d8f11['newProjectName']+_0x187cc6(0x2a4)+_0x5d8f11[_0x187cc6(0x1ee)]+')')),console[_0x187cc6(0x2a9)](a51_0x5af198[_0x187cc6(0x1f4)](_0x187cc6(0x20f))));if(_0x2455e1[_0x187cc6(0x290)])return console[_0x187cc6(0x2a9)](a51_0x5af198[_0x187cc6(0x1f4)](_0x187cc6(0x2ea))),0x0;if(!_0x2455e1[_0x187cc6(0x216)]){if(!isInteractive())return console[_0x187cc6(0x2a9)](a51_0x5af198[_0x187cc6(0x23d)](_0x187cc6(0x279)),_0x187cc6(0x257)),console[_0x187cc6(0x2a9)](a51_0x5af198['dim'](_0x187cc6(0x2f3))),0x1;const _0x3693c7=_0x5d8f11[_0x187cc6(0x2cc)]||a51_0x2409f9[_0x187cc6(0x263)](_0x4b5d68),_0x30ce20=_0x5d8f11[_0x187cc6(0x1c9)]?_0x187cc6(0x292)+_0x53a374+_0x187cc6(0x2ba):_0x187cc6(0x220)+_0x3693c7+_0x187cc6(0x1e2)+_0x53a374+'\x22?',_0x52cd9a=await confirmKey(_0x30ce20);if(!_0x52cd9a)return console['error'](a51_0x5af198[_0x187cc6(0x1f4)](_0x187cc6(0x1cf))),0x1;}const _0x3011b2=await withSpinner(_0x5d8f11['targetExists']?_0x187cc6(0x269)+_0x53a374+_0x187cc6(0x231):_0x187cc6(0x2c9)+_0x53a374+_0x187cc6(0x231),()=>_0x3905c5[_0x187cc6(0x237)][_0x187cc6(0x208)](_0x5d8f11),{'verbose':_0x2455e1['verbose']}),_0x2d72b9=_0x3011b2[_0x187cc6(0x1aa)];return console[_0x187cc6(0x2a9)](a51_0x5af198[_0x187cc6(0x2ef)](_0x5d8f11['targetExists']?_0x187cc6(0x2d9):_0x187cc6(0x212))),console['error'](_0x187cc6(0x17b)+_0x2d72b9[_0x187cc6(0x19a)]),console[_0x187cc6(0x2a9)]('\x20\x20Project\x20ID:\x20'+_0x2d72b9[_0x187cc6(0x213)]),console[_0x187cc6(0x2a9)]('\x20\x20Revision:\x20'+_0x2d72b9[_0x187cc6(0x23f)]),await this[_0x187cc6(0x284)](_0x3905c5,_0x2d72b9[_0x187cc6(0x19a)],_0x2455e1[_0x187cc6(0x1a4)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a51_0x64d48f(0x246)]='workflow:delete';['description']='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a51_0x64d48f(0x1fb)](_0x4a0771){const _0x5170d5=a51_0x64d48f,{options:_0x43ac44,args:_0x5c225a,tdx:_0x45f59c}=_0x4a0771,_0x8ac369=_0x5c225a[0x0];if(!_0x8ac369)return console[_0x5170d5(0x2a9)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x5170d5(0x2a9)](_0x5170d5(0x226)),0x1;_0x43ac44['verbose']&&console['error'](_0x5170d5(0x198)+_0x8ac369);if(!_0x43ac44[_0x5170d5(0x216)]){if(!isInteractive())return console[_0x5170d5(0x2a9)](a51_0x5af198[_0x5170d5(0x23d)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5170d5(0x2a9)](a51_0x5af198[_0x5170d5(0x278)](_0x5170d5(0x2f3))),0x1;const _0x3bd5fc=await confirmKey(_0x5170d5(0x243)+_0x8ac369+_0x5170d5(0x1b8));if(!_0x3bd5fc)return console['error'](a51_0x5af198['yellow'](_0x5170d5(0x1cf))),0x1;}const _0x1d20af=await withSpinner('Deleting\x20project\x20'+_0x8ac369+_0x5170d5(0x231),()=>_0x45f59c[_0x5170d5(0x237)][_0x5170d5(0x22c)](_0x8ac369),{'verbose':_0x43ac44[_0x5170d5(0x210)]}),_0xc2215e=_0x1d20af[_0x5170d5(0x1aa)];return console['error'](_0x5170d5(0x2f6)+_0xc2215e[_0x5170d5(0x211)]),console[_0x5170d5(0x2a9)](_0x5170d5(0x2ab)+_0xc2215e['projectId']),0x0;}}export function parseKeyValue(_0x244ce1){const _0x5b4d10=a51_0x64d48f,_0x57d6e9=_0x244ce1[_0x5b4d10(0x22d)]('=');if(_0x57d6e9===-0x1)throw new Error('Invalid\x20format:\x20'+_0x244ce1+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x571aa7=_0x244ce1[_0x5b4d10(0x2bc)](0x0,_0x57d6e9),_0x952640=_0x244ce1[_0x5b4d10(0x2bc)](_0x57d6e9+0x1);if(!_0x571aa7)throw new Error(_0x5b4d10(0x1f0));return{'key':_0x571aa7,'value':_0x952640};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']='workflow:secrets:list';[a51_0x64d48f(0x252)]=a51_0x64d48f(0x1d9);async['execute'](_0x23d7d2){const _0x1128e6=a51_0x64d48f,{options:_0x83358,args:_0x3192b0,tdx:_0x54e4d7}=_0x23d7d2,_0x3be976=this[_0x1128e6(0x228)](_0x3192b0,_0x83358);if(!_0x3be976)return 0x1;_0x83358[_0x1128e6(0x210)]&&console[_0x1128e6(0x2a9)](_0x1128e6(0x198)+_0x3be976);const _0xa16a46=await withSpinner(_0x1128e6(0x1f8),()=>_0x54e4d7[_0x1128e6(0x237)][_0x1128e6(0x24b)](_0x3be976),{'verbose':_0x83358[_0x1128e6(0x210)]}),{secrets:_0x11e015}=_0xa16a46['data'];return console[_0x1128e6(0x2a9)]('✔\x20Found\x20'+_0x11e015[_0x1128e6(0x1d8)]+'\x20secret'+(_0x11e015[_0x1128e6(0x1d8)]!==0x1?'s':'')),await handleSDKOutput(_0x11e015,_0x83358),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x2b7);['description']='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async[a51_0x64d48f(0x1fb)](_0x4b58dc){const _0x27f3ac=a51_0x64d48f,{options:_0x1da62c,args:_0x174493,tdx:_0x4d7142}=_0x4b58dc;let _0x54641a,_0x554198;if(_0x174493[_0x27f3ac(0x1d8)]>=0x1&&!_0x174493[0x0][_0x27f3ac(0x248)]('='))_0x54641a=_0x174493[0x0],_0x554198=_0x174493['slice'](0x1);else{if(_0x174493[_0x27f3ac(0x1d8)]>=0x1&&_0x1da62c[_0x27f3ac(0x307)])_0x54641a=_0x1da62c[_0x27f3ac(0x307)],_0x554198=_0x174493;else return _0x174493['length']>=0x1?(console[_0x27f3ac(0x2a9)](_0x27f3ac(0x2e6)),console['error']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console['error']('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console['error'](_0x27f3ac(0x176)),0x1);}if(_0x554198[_0x27f3ac(0x1d8)]===0x0)return console[_0x27f3ac(0x2a9)](_0x27f3ac(0x2f5)),console['error'](_0x27f3ac(0x176)),0x1;const _0x5f3330={};try{for(const _0x366781 of _0x554198){const {key:_0x555fe8,value:_0x43d777}=parseKeyValue(_0x366781);_0x5f3330[_0x555fe8]=_0x43d777;}}catch(_0x292582){return _0x292582 instanceof Error&&console[_0x27f3ac(0x2a9)](a51_0x5af198[_0x27f3ac(0x23d)]('Error:'),_0x292582[_0x27f3ac(0x1a6)]),0x1;}const _0x52f7c5=Object[_0x27f3ac(0x291)](_0x5f3330);_0x1da62c[_0x27f3ac(0x210)]&&(console['error'](_0x27f3ac(0x198)+_0x54641a),console[_0x27f3ac(0x2a9)]('Secrets\x20to\x20set:\x20'+_0x52f7c5['join'](',\x20')));const _0xb1be3=await withSpinner(_0x52f7c5['length']===0x1?_0x27f3ac(0x29d):_0x27f3ac(0x309)+_0x52f7c5[_0x27f3ac(0x1d8)]+_0x27f3ac(0x18d),()=>_0x4d7142[_0x27f3ac(0x237)][_0x27f3ac(0x2f0)](_0x54641a,_0x5f3330),{'verbose':_0x1da62c[_0x27f3ac(0x210)]}),_0x33b22b=_0xb1be3['data'];return console[_0x27f3ac(0x2a9)](_0x52f7c5[_0x27f3ac(0x1d8)]===0x1?_0x27f3ac(0x1b6)+_0x33b22b[_0x27f3ac(0x291)][0x0]+_0x27f3ac(0x233)+_0x33b22b[_0x27f3ac(0x211)]+'\x27':'✔\x20'+_0x33b22b[_0x27f3ac(0x291)][_0x27f3ac(0x1d8)]+'\x20secrets\x20set\x20for\x20project\x20\x27'+_0x33b22b[_0x27f3ac(0x211)]+'\x27'),(_0x1da62c[_0x27f3ac(0x1c1)]||_0x1da62c['jsonl'])&&await handleSingleObjectOutput(_0x33b22b,_0x1da62c),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x30a);[a51_0x64d48f(0x252)]=a51_0x64d48f(0x2e8);async['execute'](_0x21212d){const _0x12bed4=a51_0x64d48f,{options:_0x438896,args:_0x3bbc53,tdx:_0x5bae1a}=_0x21212d;let _0x45b62f,_0x2349c4;if(_0x3bbc53[_0x12bed4(0x1d8)]>=0x2)_0x45b62f=_0x3bbc53[0x0],_0x2349c4=_0x3bbc53[0x1];else{if(_0x3bbc53[_0x12bed4(0x1d8)]===0x1&&_0x438896[_0x12bed4(0x307)])_0x45b62f=_0x438896[_0x12bed4(0x307)],_0x2349c4=_0x3bbc53[0x0];else return _0x3bbc53[_0x12bed4(0x1d8)]===0x1?(console[_0x12bed4(0x2a9)](_0x12bed4(0x2e6)),console[_0x12bed4(0x2a9)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x12bed4(0x2a9)](_0x12bed4(0x18a)),console[_0x12bed4(0x2a9)](_0x12bed4(0x2ce)),0x1);}_0x438896[_0x12bed4(0x210)]&&(console['error'](_0x12bed4(0x198)+_0x45b62f),console[_0x12bed4(0x2a9)](_0x12bed4(0x1b7)+_0x2349c4));if(!_0x438896['yes']){if(!isInteractive())return console['error'](a51_0x5af198['red']('\x0aError:'),_0x12bed4(0x257)),console['error'](a51_0x5af198[_0x12bed4(0x278)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x53c2b9=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x2349c4+_0x12bed4(0x310)+_0x45b62f+'\x27?');if(!_0x53c2b9)return console[_0x12bed4(0x2a9)](a51_0x5af198[_0x12bed4(0x1f4)](_0x12bed4(0x1cf))),0x1;}const _0x42dc21=await withSpinner(_0x12bed4(0x2d3),()=>_0x5bae1a[_0x12bed4(0x237)]['deleteSecret'](_0x45b62f,_0x2349c4),{'verbose':_0x438896[_0x12bed4(0x210)]}),_0x4432fb=_0x42dc21['data'];return console[_0x12bed4(0x2a9)](_0x12bed4(0x1b6)+_0x4432fb[_0x12bed4(0x2be)]+_0x12bed4(0x306)+_0x4432fb[_0x12bed4(0x211)]+'\x27'),(_0x438896[_0x12bed4(0x1c1)]||_0x438896[_0x12bed4(0x18f)])&&await handleSingleObjectOutput(_0x4432fb,_0x438896),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(_0x14bde3){const _0x288a27=a51_0x64d48f,_0x3b2c2d=Math['floor'](_0x14bde3/0x3e8),_0x114451=Math[_0x288a27(0x23b)](_0x3b2c2d/0x3c),_0x588779=Math['floor'](_0x114451/0x3c),_0x285155=Math[_0x288a27(0x23b)](_0x588779/0x18);if(_0x285155>0x0){const _0x2a2a5e=_0x588779%0x18;return _0x2a2a5e>0x0?_0x285155+'d\x20'+_0x2a2a5e+'h':_0x285155+'d';}else{if(_0x588779>0x0){const _0x360ded=_0x114451%0x3c;return _0x360ded>0x0?_0x588779+'h\x20'+_0x360ded+'m':_0x588779+'h';}else{if(_0x114451>0x0){const _0x21569c=_0x3b2c2d%0x3c;return _0x21569c>0x0?_0x114451+'m\x20'+_0x21569c+'s':_0x114451+'m';}else return _0x3b2c2d+'s';}}}function formatTimestamp(_0x3fe6cd,_0xe9e72d){const _0x2ac3a6=a51_0x64d48f,_0x4000b0=new Date(_0x3fe6cd),_0x17bfd5=String(_0x4000b0[_0x2ac3a6(0x190)]())[_0x2ac3a6(0x16e)](0x2,'0'),_0x4be3f8=String(_0x4000b0[_0x2ac3a6(0x311)]())[_0x2ac3a6(0x16e)](0x2,'0'),_0x3bb1a5=_0x17bfd5+':'+_0x4be3f8,_0x214b1f=_0x4000b0[_0x2ac3a6(0x192)]()===_0xe9e72d[_0x2ac3a6(0x192)]()&&_0x4000b0[_0x2ac3a6(0x1fc)]()===_0xe9e72d[_0x2ac3a6(0x1fc)]()&&_0x4000b0[_0x2ac3a6(0x2f4)]()===_0xe9e72d[_0x2ac3a6(0x2f4)]();if(_0x214b1f)return _0x3bb1a5;else{const _0x113fc4=String(_0x4000b0['getMonth']()+0x1)[_0x2ac3a6(0x16e)](0x2,'0'),_0x2c53fc=String(_0x4000b0['getDate']())[_0x2ac3a6(0x16e)](0x2,'0');return _0x113fc4+'-'+_0x2c53fc+'\x20'+_0x3bb1a5;}}function formatDate(_0x72a56b){const _0x5ca462=a51_0x64d48f,_0x3deaf7=_0x72a56b['getFullYear'](),_0x5b7d7b=String(_0x72a56b[_0x5ca462(0x1fc)]()+0x1)[_0x5ca462(0x16e)](0x2,'0'),_0x1e1606=String(_0x72a56b['getDate']())[_0x5ca462(0x16e)](0x2,'0');return _0x3deaf7+'-'+_0x5b7d7b+'-'+_0x1e1606;}function getTaskStateIcon(_0x1e12ff){const _0x255ecf={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x255ecf[_0x1e12ff]||'⚪';}function getBarChar(_0xfe5fe6){const _0x5a42d9=a51_0x64d48f;return _0xfe5fe6===_0x5a42d9(0x2a9)||_0xfe5fe6===_0x5a42d9(0x1fd)?'×':'─';}function getBarColor(_0xf8207a){const _0x25f035=a51_0x64d48f,_0x42e487={'success':a51_0x5af198[_0x25f035(0x2ef)],'error':a51_0x5af198['red'],'group_error':a51_0x5af198[_0x25f035(0x23d)],'running':a51_0x5af198[_0x25f035(0x1ef)],'blocked':a51_0x5af198['yellow'],'planned':a51_0x5af198[_0x25f035(0x278)],'canceling':a51_0x5af198[_0x25f035(0x1f4)]};return _0x42e487[_0xf8207a]||a51_0x5af198['white'];}function parseTaskName(_0x24fa9e){const _0x875782=a51_0x64d48f;let _0x447c65=_0x24fa9e['replace'](/^\++/,'');const _0x40827d=_0x447c65[_0x875782(0x283)]('+'),_0x81c518=_0x40827d[_0x875782(0x1d8)]>0x1?_0x40827d['length']-0x2:0x0,_0x251c09=_0x40827d[_0x40827d['length']-0x1]||_0x447c65;return{'level':_0x81c518,'name':'+'+_0x251c09};}function truncateTaskName(_0x35aba9,_0x1b02ba){const _0x29b8c3=a51_0x64d48f,_0x49b297=stringWidth(_0x35aba9);if(_0x49b297<=_0x1b02ba)return _0x35aba9;let _0x68a90c=_0x35aba9;while(stringWidth(_0x68a90c+'…')>_0x1b02ba&&_0x68a90c['length']>0x0){_0x68a90c=_0x68a90c[_0x29b8c3(0x22b)](0x0,-0x1);}return _0x68a90c+'…';}function calculateTimeScale(_0x4728e9,_0x2d46a3){const _0x2d71c7=a51_0x64d48f;return{'startTime':_0x4728e9[_0x2d71c7(0x178)],'endTime':_0x4728e9[_0x2d71c7(0x20e)],'durationMs':_0x4728e9[_0x2d71c7(0x186)],'msPerChar':_0x4728e9[_0x2d71c7(0x186)]/_0x2d46a3};}function timeToPosition(_0x46455c,_0x53b1b1,_0x1b1c05){const _0x845e79=a51_0x64d48f,_0x525330=_0x46455c-_0x53b1b1[_0x845e79(0x180)],_0x54ced6=Math[_0x845e79(0x23b)](_0x525330/_0x53b1b1[_0x845e79(0x2a8)]);return Math[_0x845e79(0x2d8)](0x0,Math[_0x845e79(0x254)](_0x54ced6,_0x1b1c05));}function renderTimeAxis(_0x15a8ee,_0x75cbca){const _0x792a12=a51_0x64d48f,_0x2d9466=Math['min'](TIMELINE_CONFIG[_0x792a12(0x24f)],Math[_0x792a12(0x2d8)](TIMELINE_CONFIG[_0x792a12(0x297)],Math[_0x792a12(0x23b)](_0x75cbca/TIMELINE_CONFIG[_0x792a12(0x20a)]))),_0x283229=_0x15a8ee['durationMs']/(_0x2d9466-0x1),_0x17737c=new Date(_0x15a8ee['startTime']),_0x45db2e=[];for(let _0x22b41c=0x0;_0x22b41c<_0x2d9466;_0x22b41c++){const _0x59bfc6=_0x15a8ee[_0x792a12(0x180)]+_0x22b41c*_0x283229,_0x5181a3=timeToPosition(_0x59bfc6,_0x15a8ee,_0x75cbca),_0x47451a=formatTimestamp(_0x59bfc6,_0x17737c);_0x45db2e[_0x792a12(0x235)]({'pos':_0x5181a3,'text':_0x47451a});}const _0x27d4cf=new Array(_0x75cbca)[_0x792a12(0x184)]('\x20');let _0x3e8dd9=-0x1;for(const {pos:_0x144ccc,text:_0x43a867}of _0x45db2e){let _0xde1386=Math[_0x792a12(0x2d8)](0x0,_0x144ccc-Math[_0x792a12(0x23b)](_0x43a867[_0x792a12(0x1d8)]/0x2));_0xde1386<=_0x3e8dd9+TIMELINE_CONFIG[_0x792a12(0x30f)]&&(_0xde1386=_0x3e8dd9+TIMELINE_CONFIG[_0x792a12(0x30f)]+0x1);_0xde1386+_0x43a867[_0x792a12(0x1d8)]>_0x75cbca&&(_0xde1386=_0x75cbca-_0x43a867[_0x792a12(0x1d8)]);if(_0xde1386>=0x0&&_0xde1386+_0x43a867[_0x792a12(0x1d8)]<=_0x75cbca&&_0xde1386>_0x3e8dd9){for(let _0x5f7e8a=0x0;_0x5f7e8a<_0x43a867[_0x792a12(0x1d8)];_0x5f7e8a++){_0x27d4cf[_0xde1386+_0x5f7e8a]=_0x43a867[_0x5f7e8a];}_0x3e8dd9=_0xde1386+_0x43a867[_0x792a12(0x1d8)]-0x1;}}return _0x27d4cf[_0x792a12(0x1eb)]('');}function renderTaskRow(_0x39d84,_0x39de20,_0x3719bf,_0x396a5f){const _0x26dc19=a51_0x64d48f,{level:_0x5007dc,name:_0x48337f}=parseTaskName(_0x39d84[_0x26dc19(0x246)]),_0x570f7c='\x20'[_0x26dc19(0x2dc)](_0x5007dc),_0x4c215a=_0x39d84[_0x26dc19(0x1a0)]?'('+formatElapsed(_0x39d84[_0x26dc19(0x1a0)][_0x26dc19(0x186)])+')':'',_0x337edf=stringWidth(_0x4c215a),_0x354787=_0x5007dc*0x1,_0x26c4ff=_0x396a5f-_0x354787-_0x337edf-0x1,_0x3f2d9f=truncateTaskName(_0x48337f,_0x26c4ff),_0x332f75=_0x570f7c+_0x3f2d9f,_0x586178=stringWidth(_0x332f75),_0x322101=_0x396a5f-_0x586178-_0x337edf,_0x5c4f04=_0x332f75+'\x20'['repeat'](Math[_0x26dc19(0x2d8)](0x1,_0x322101))+a51_0x5af198['dim'](_0x4c215a),_0x1a88d4=getTaskStateIcon(_0x39d84[_0x26dc19(0x1fa)]),_0x56870f=new Array(_0x3719bf)[_0x26dc19(0x184)]('\x20');if(_0x39d84[_0x26dc19(0x1a0)]){const _0x4a5ef4=timeToPosition(_0x39d84[_0x26dc19(0x1a0)]['start'],_0x39de20,_0x3719bf),_0x9a6a52=timeToPosition(_0x39d84['window'][_0x26dc19(0x20e)],_0x39de20,_0x3719bf),_0xa47de6=getBarChar(_0x39d84[_0x26dc19(0x1fa)]),_0x3e3cb3=Math['max'](_0x4a5ef4+0x1,_0x9a6a52);for(let _0x3d8b4d=_0x4a5ef4;_0x3d8b4d<Math[_0x26dc19(0x254)](_0x3e3cb3,_0x3719bf);_0x3d8b4d++){_0x56870f[_0x3d8b4d]=_0xa47de6;}}const _0x3751c4=getBarColor(_0x39d84[_0x26dc19(0x1fa)]),_0xba2f3=_0x56870f[_0x26dc19(0x2b9)](_0x16db3f=>_0x16db3f==='\x20'?'\x20':_0x3751c4(_0x16db3f))[_0x26dc19(0x1eb)]('');return _0x1a88d4+'\x20'+_0x5c4f04+'│'+_0xba2f3+'│';}function calculateStats(_0xbd01c2){const _0x2a2862=a51_0x64d48f,_0x5154af={'total':_0xbd01c2[_0x2a2862(0x1d8)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x1940ce of _0xbd01c2){if(_0x1940ce[_0x2a2862(0x1fa)]===_0x2a2862(0x27f))_0x5154af[_0x2a2862(0x27f)]++;else{if(_0x1940ce[_0x2a2862(0x1fa)]===_0x2a2862(0x2a9)||_0x1940ce[_0x2a2862(0x1fa)]===_0x2a2862(0x1fd))_0x5154af['error']++;else _0x1940ce[_0x2a2862(0x1fa)]===_0x2a2862(0x25a)?_0x5154af['running']++:_0x5154af[_0x2a2862(0x2ec)]++;}}return _0x5154af;}function formatStats(_0x1d7794){const _0x237b36=a51_0x64d48f;return[_0x237b36(0x21d)+_0x1d7794['total'],'✅\x20'+_0x1d7794['success'],'❌\x20'+_0x1d7794[_0x237b36(0x2a9)],_0x237b36(0x25b)+_0x1d7794[_0x237b36(0x25a)],'⏳\x20'+_0x1d7794[_0x237b36(0x2ec)]][_0x237b36(0x1eb)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]='workflow:timeline';[a51_0x64d48f(0x252)]='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async['execute'](_0x3f7d25){const _0x5af7c1=a51_0x64d48f,{options:_0x281e6b,args:_0x23b939,tdx:_0x295cfd}=_0x3f7d25;let _0x45583e,_0x1b1f35,_0x487520=![];if(_0x23b939[0x0]){if(_0x23b939[0x0][_0x5af7c1(0x248)]('.')){const _0x4e5799=this[_0x5af7c1(0x2b6)](_0x23b939,_0x281e6b);if(!_0x4e5799)return 0x1;_0x45583e=_0x4e5799[_0x5af7c1(0x211)],_0x1b1f35=_0x4e5799['workflowName'];}else{_0x1b1f35=_0x23b939[0x0],_0x45583e=_0x281e6b[_0x5af7c1(0x307)];if(!_0x45583e)return console[_0x5af7c1(0x2a9)](a51_0x5af198[_0x5af7c1(0x23d)](_0x5af7c1(0x18c)),_0x5af7c1(0x27d)),0x1;_0x487520=!![];}}else{const _0x7fc736=this[_0x5af7c1(0x2b6)](_0x23b939,_0x281e6b);if(!_0x7fc736)return 0x1;_0x45583e=_0x7fc736[_0x5af7c1(0x211)],_0x1b1f35=_0x7fc736['workflowName'];}if(_0x281e6b[_0x5af7c1(0x210)]){if(_0x45583e&&_0x1b1f35)console[_0x5af7c1(0x2a9)](_0x5af7c1(0x242)+_0x45583e+'.'+_0x1b1f35);else _0x45583e&&console[_0x5af7c1(0x2a9)](_0x5af7c1(0x2d6)+_0x45583e);}const _0x2552db=_0x281e6b[_0x5af7c1(0x2b1)],_0x3f4418=_0x281e6b[_0x5af7c1(0x17c)];if(_0x2552db){_0x3f4418&&console['error'](a51_0x5af198[_0x5af7c1(0x1f4)](_0x5af7c1(0x215)),_0x5af7c1(0x234));const _0x5133c0=_0x281e6b[_0x5af7c1(0x2aa)];return _0x5133c0?await this['pollTimeline'](_0x3f7d25,_0x2552db):await this[_0x5af7c1(0x277)](_0x3f7d25,_0x2552db,_0x281e6b),0x0;}if(_0x3f4418){const _0x57f14d=await withSpinner(_0x5af7c1(0x214),()=>_0x295cfd['workflow'][_0x5af7c1(0x2d0)]({'projectName':_0x45583e,'workflowName':_0x1b1f35,'limit':0x64}),{'verbose':_0x281e6b[_0x5af7c1(0x210)]}),_0x337afd=_0x57f14d[_0x5af7c1(0x1aa)][_0x5af7c1(0x305)](_0x4d1f42=>_0x4d1f42['id']===_0x3f4418);if(!_0x337afd)return console[_0x5af7c1(0x2a9)](a51_0x5af198[_0x5af7c1(0x23d)](_0x5af7c1(0x18c)),_0x5af7c1(0x1dd)+_0x3f4418),0x1;if(!_0x337afd[_0x5af7c1(0x296)]?.['id'])return console['error'](a51_0x5af198['red'](_0x5af7c1(0x18c)),_0x5af7c1(0x28e)+_0x3f4418+_0x5af7c1(0x1ea)),0x1;const _0x145d2d=_0x337afd[_0x5af7c1(0x296)]['id'];_0x281e6b[_0x5af7c1(0x210)]&&console[_0x5af7c1(0x2a9)](_0x5af7c1(0x28b)+_0x145d2d+_0x5af7c1(0x2b0)+_0x3f4418);const _0x59b68b=_0x281e6b[_0x5af7c1(0x2aa)];return _0x59b68b?await this[_0x5af7c1(0x2b4)](_0x3f7d25,_0x145d2d):await this[_0x5af7c1(0x277)](_0x3f7d25,_0x145d2d,_0x281e6b),0x0;}const _0x10d243=await withSpinner('Loading\x20sessions...',()=>_0x295cfd[_0x5af7c1(0x237)][_0x5af7c1(0x2d0)]({'projectName':_0x45583e,'workflowName':_0x1b1f35,'limit':_0x281e6b['limit']||0x32}),{'verbose':_0x281e6b['verbose']}),_0x2b8029=_0x10d243[_0x5af7c1(0x1aa)];if(_0x2b8029[_0x5af7c1(0x1d8)]===0x0){if(_0x45583e&&_0x1b1f35)console[_0x5af7c1(0x2a9)](_0x5af7c1(0x300)+_0x45583e+'.'+_0x1b1f35);else _0x45583e?console[_0x5af7c1(0x2a9)](_0x5af7c1(0x315)+_0x45583e):(console[_0x5af7c1(0x2a9)](_0x5af7c1(0x21f)),console['error'](a51_0x5af198[_0x5af7c1(0x278)]('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x2b8029['sort']((_0x361d07,_0x56fc8e)=>{const _0x3e1cbd=_0x5af7c1,_0x1c8cb5=_0x361d07['sessionTime']||'',_0x165d71=_0x56fc8e['sessionTime']||'';return _0x165d71[_0x3e1cbd(0x2fa)](_0x1c8cb5);});if(_0x281e6b[_0x5af7c1(0x1c1)]||_0x281e6b[_0x5af7c1(0x18f)])return await handleSDKOutput(_0x2b8029,_0x281e6b),0x0;let _0x3b91bb;if(_0x487520){const _0x3eaa3e=_0x2b8029[0x0];if(!_0x3eaa3e[_0x5af7c1(0x296)]?.['id'])return console[_0x5af7c1(0x2a9)](_0x5af7c1(0x16f)),0x0;_0x3b91bb=_0x3eaa3e[_0x5af7c1(0x296)]['id'],_0x281e6b[_0x5af7c1(0x210)]&&console[_0x5af7c1(0x2a9)](_0x5af7c1(0x19f)+_0x3eaa3e[_0x5af7c1(0x200)]);}else{const _0x11dac2=_0x2b8029[_0x5af7c1(0x2b9)](_0x16749b=>{const _0x380388=_0x5af7c1,_0x2a3b5b=getAttemptStatusDisplay(_0x16749b[_0x380388(0x296)]);return{'title':_0x16749b[_0x380388(0x29e)]?.['name']+'.'+_0x16749b[_0x380388(0x237)]?.[_0x380388(0x246)]+_0x380388(0x193)+_0x16749b[_0x380388(0x200)]+'\x20'+_0x2a3b5b['icon'],'value':_0x16749b[_0x380388(0x296)]?.['id']||'','description':_0x2a3b5b[_0x380388(0x288)]};}),_0x56ae9c=await a51_0x396bfc({'type':_0x5af7c1(0x2c4),'name':_0x5af7c1(0x2b1),'message':_0x5af7c1(0x225),'choices':_0x11dac2[_0x5af7c1(0x1f7)](_0xb9ef8b=>_0xb9ef8b[_0x5af7c1(0x2e9)]!=='')});if(!_0x56ae9c['attemptId'])return 0x0;_0x3b91bb=_0x56ae9c['attemptId'];}const _0xee9f0f=_0x281e6b[_0x5af7c1(0x2aa)];return _0xee9f0f?await this[_0x5af7c1(0x2b4)](_0x3f7d25,_0x3b91bb):await this[_0x5af7c1(0x277)](_0x3f7d25,_0x3b91bb,_0x281e6b),0x0;}async[a51_0x64d48f(0x277)](_0x5a99c3,_0x13d6bc,_0x393340){const _0x448933=a51_0x64d48f,{tdx:_0x17d839}=_0x5a99c3;let _0x3664d8,_0xe5d3a5;try{[_0x3664d8,_0xe5d3a5]=await Promise[_0x448933(0x1d0)]([_0x17d839[_0x448933(0x237)][_0x448933(0x1ba)](_0x13d6bc),_0x17d839[_0x448933(0x237)]['tasks'](_0x13d6bc,![])]);}catch(_0x2d5b82){console[_0x448933(0x2a9)](a51_0x5af198[_0x448933(0x23d)](_0x448933(0x1ff)));_0x393340[_0x448933(0x210)]&&console[_0x448933(0x2a9)](_0x2d5b82);throw _0x2d5b82;}if(_0x393340[_0x448933(0x1c1)]||_0x393340[_0x448933(0x18f)]){const _0x8a6538=this['buildTimelineData'](_0x3664d8,_0xe5d3a5);await handleSDKOutput([_0x8a6538],_0x393340);return;}const _0x46d9e5=_0x17d839[_0x448933(0x262)][_0x448933(0x1a4)],_0x302ea3=this[_0x448933(0x2ad)](_0x3664d8,_0xe5d3a5,_0x46d9e5);console[_0x448933(0x2a7)](_0x302ea3);}async[a51_0x64d48f(0x2b4)](_0xe1177a,_0x2c94d0){const _0x5710da=a51_0x64d48f,{tdx:_0x5c934e}=_0xe1177a,_0x27d3aa=TIMELINE_CONFIG[_0x5710da(0x2c5)],_0x31e348=TIMELINE_CONFIG[_0x5710da(0x207)];let _0x35edd9=0x0;while(_0x35edd9<_0x31e348){process[_0x5710da(0x289)][_0x5710da(0x295)]&&process['stdout']['write']('\x1bc');let _0x330de3,_0x344b45;try{[_0x330de3,_0x344b45]=await Promise[_0x5710da(0x1d0)]([_0x5c934e['workflow'][_0x5710da(0x1ba)](_0x2c94d0),_0x5c934e['workflow']['tasks'](_0x2c94d0,![])]);}catch(_0x45797b){console['error'](a51_0x5af198[_0x5710da(0x23d)]('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x35edd9>0x0&&console[_0x5710da(0x2a9)](a51_0x5af198[_0x5710da(0x278)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x35edd9));throw _0x45797b;}const _0x2fce94=_0x5c934e[_0x5710da(0x262)][_0x5710da(0x1a4)],_0x2df819=this[_0x5710da(0x2ad)](_0x330de3,_0x344b45,_0x2fce94);console[_0x5710da(0x2a7)](_0x2df819);const _0x332589=_0x330de3[_0x5710da(0x2bf)]&&_0x344b45[_0x5710da(0x2ee)](_0x4acd1b=>_0x4acd1b[_0x5710da(0x1fa)]!=='running'&&_0x4acd1b[_0x5710da(0x1fa)]!==_0x5710da(0x241));if(_0x332589){console[_0x5710da(0x2a9)](a51_0x5af198['green'](_0x5710da(0x2c2)));break;}console[_0x5710da(0x2a9)](a51_0x5af198[_0x5710da(0x278)](_0x5710da(0x244)+_0x35edd9*0x2+_0x5710da(0x1e0))),await new Promise(_0x5f2186=>setTimeout(_0x5f2186,_0x27d3aa)),_0x35edd9++;}_0x35edd9>=_0x31e348&&console['error'](a51_0x5af198['yellow']('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a51_0x64d48f(0x2ad)](_0x243b9c,_0xcc462,_0x3bd040){const _0x325451=a51_0x64d48f,_0x1fb76b=[],_0x174ade=TIMELINE_CONFIG[_0x325451(0x2f8)],_0x36c056=0x5,_0x2099c1=process['stdout']['columns']||0x78,_0x2b601a=_0x2099c1-_0x174ade-_0x36c056,_0x4aa5a9=Math[_0x325451(0x2d8)](TIMELINE_CONFIG[_0x325451(0x2b8)],Math[_0x325451(0x254)](_0x2b601a,TIMELINE_CONFIG[_0x325451(0x281)])),_0x56178a=new Date(_0x243b9c[_0x325451(0x2e3)])['getTime'](),_0x44370c=_0x243b9c[_0x325451(0x2d5)]?new Date(_0x243b9c[_0x325451(0x2d5)])[_0x325451(0x2bd)]():Date[_0x325451(0x2c7)](),_0x1a64fe={'start':_0x56178a,'end':_0x44370c,'duration':_0x44370c-_0x56178a},_0x7a47e1=new Map(),_0x20ab59=[];for(const _0x203a07 of _0xcc462){if(_0x203a07[_0x325451(0x1c0)]){const _0x1473ff=new Date(_0x203a07[_0x325451(0x1c0)])[_0x325451(0x2bd)](),_0x1ea258=_0x203a07[_0x325451(0x1ca)]?new Date(_0x203a07[_0x325451(0x1ca)])[_0x325451(0x2bd)]():Date[_0x325451(0x2c7)](),_0x2bbb92={'start':_0x1473ff,'end':_0x1ea258,'duration':_0x1ea258-_0x1473ff};_0x7a47e1[_0x325451(0x2a0)](_0x203a07['id'],_0x2bbb92),_0x20ab59['push']({'name':_0x203a07[_0x325451(0x194)],'state':_0x203a07['state']||_0x325451(0x218),'window':_0x2bbb92});}else _0x20ab59[_0x325451(0x235)]({'name':_0x203a07[_0x325451(0x194)],'state':_0x203a07[_0x325451(0x1fa)]||'planned','window':undefined});}_0x20ab59[_0x325451(0x19c)]((_0x34b5fb,_0x4b6f82)=>{const _0xc1d132=_0x325451;if(!_0x34b5fb[_0xc1d132(0x1a0)])return 0x1;if(!_0x4b6f82[_0xc1d132(0x1a0)])return-0x1;return _0x34b5fb[_0xc1d132(0x1a0)][_0xc1d132(0x178)]-_0x4b6f82['window'][_0xc1d132(0x178)];});const _0x27ab7f=_0x20ab59[_0x325451(0x1d8)],_0x417961=_0x27ab7f>TIMELINE_CONFIG[_0x325451(0x2b3)];_0x417961&&_0x20ab59[_0x325451(0x270)](TIMELINE_CONFIG[_0x325451(0x2b3)]);const _0x3e5756=calculateTimeScale(_0x1a64fe,_0x4aa5a9),_0x3ff71b=_0x243b9c[_0x325451(0x2bf)]?_0x243b9c['success']?a51_0x5af198['green'](_0x325451(0x27f)):a51_0x5af198['red'](_0x325451(0x2a9)):a51_0x5af198['blue'](_0x325451(0x25a)),_0xca535d=_0x243b9c['project']?.['id'],_0x20fe2d=_0x243b9c[_0x325451(0x17c)];let _0x3ec420;if(_0xca535d&&_0x20fe2d){const _0x5bac42=getWorkflowAttemptUrl(_0x3bd040,_0xca535d,_0x20fe2d,_0x243b9c['id']);_0x3ec420=hyperlink(a51_0x5af198[_0x325451(0x278)](_0x243b9c['id']),_0x5bac42);}else _0x3ec420=a51_0x5af198['dim'](_0x243b9c['id']);_0x1fb76b['push'](_0x325451(0x238)+_0x3ec420+_0x325451(0x193)+_0x3ff71b+_0x325451(0x193)+formatElapsed(_0x1a64fe[_0x325451(0x186)]));if(_0x20ab59[_0x325451(0x1d8)]>0x0){const _0x236adb=renderTimeAxis(_0x3e5756,_0x4aa5a9),_0x619643=new Date(_0x1a64fe[_0x325451(0x178)]),_0x13e8d7=formatDate(_0x619643),_0x6940d0=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x325451(0x274)]+_0x174ade,_0x4156d2=_0x13e8d7[_0x325451(0x16e)](_0x6940d0),_0x198e49=a51_0x5af198['dim'](_0x4156d2);_0x1fb76b[_0x325451(0x235)](_0x198e49+'\x20'+_0x236adb);for(const _0x4a01cc of _0x20ab59){_0x1fb76b[_0x325451(0x235)](renderTaskRow(_0x4a01cc,_0x3e5756,_0x4aa5a9,_0x174ade));}const _0x4f5f5c=calculateStats(_0x20ab59);_0x1fb76b['push'](formatStats(_0x4f5f5c)),_0x417961&&_0x1fb76b[_0x325451(0x235)](a51_0x5af198[_0x325451(0x1f4)](_0x325451(0x313)+TIMELINE_CONFIG[_0x325451(0x2b3)]+'\x20of\x20'+_0x27ab7f+'\x20tasks')),_0x1fb76b[_0x325451(0x235)](''),_0x1fb76b['push'](a51_0x5af198['dim'](_0x325451(0x1df))+(_0x325451(0x280)+_0x243b9c['id']+_0x325451(0x30e))+a51_0x5af198[_0x325451(0x278)](_0x325451(0x273)));}else _0x1fb76b[_0x325451(0x235)](_0x325451(0x1ae));return _0x1fb76b[_0x325451(0x1eb)]('\x0a');}[a51_0x64d48f(0x2cf)](_0x2b3114,_0x28b315){const _0x5eb8ce=a51_0x64d48f,_0x20b7c6=new Date(_0x2b3114['createdAt'])[_0x5eb8ce(0x2bd)](),_0x4b9d93=_0x2b3114[_0x5eb8ce(0x2d5)]?new Date(_0x2b3114[_0x5eb8ce(0x2d5)])[_0x5eb8ce(0x2bd)]():Date[_0x5eb8ce(0x2c7)](),_0x50ad21=_0x4b9d93-_0x20b7c6,_0x53d8b3=[];for(const _0x9c6c2b of _0x28b315){if(_0x9c6c2b[_0x5eb8ce(0x1c0)]){const _0x5a8fd8=new Date(_0x9c6c2b['startedAt'])[_0x5eb8ce(0x2bd)](),_0x206d1c=_0x9c6c2b['updatedAt']?new Date(_0x9c6c2b[_0x5eb8ce(0x1ca)])[_0x5eb8ce(0x2bd)]():Date['now']();_0x53d8b3[_0x5eb8ce(0x235)]({'name':_0x9c6c2b[_0x5eb8ce(0x194)],'state':_0x9c6c2b['state']||_0x5eb8ce(0x218),'window':{'start':_0x5a8fd8,'end':_0x206d1c,'duration':_0x206d1c-_0x5a8fd8}});}else _0x53d8b3[_0x5eb8ce(0x235)]({'name':_0x9c6c2b[_0x5eb8ce(0x194)],'state':_0x9c6c2b[_0x5eb8ce(0x1fa)]||'planned','window':undefined});}const _0x47da7e=calculateStats(_0x53d8b3);return{'attempt':{'id':_0x2b3114['id'],'status':_0x2b3114[_0x5eb8ce(0x2bf)]?_0x2b3114['success']?'success':_0x5eb8ce(0x2a9):_0x5eb8ce(0x25a),'createdAt':_0x2b3114[_0x5eb8ce(0x2e3)],'finishedAt':_0x2b3114['finishedAt'],'duration_ms':_0x50ad21},'tasks':_0x53d8b3[_0x5eb8ce(0x2b9)](_0x37296e=>({'name':_0x37296e[_0x5eb8ce(0x246)],'state':_0x37296e[_0x5eb8ce(0x1fa)],'startedAt':_0x37296e[_0x5eb8ce(0x1a0)]?new Date(_0x37296e[_0x5eb8ce(0x1a0)][_0x5eb8ce(0x178)])['toISOString']():null,'updatedAt':_0x37296e[_0x5eb8ce(0x1a0)]?new Date(_0x37296e[_0x5eb8ce(0x1a0)]['end'])[_0x5eb8ce(0x2c6)]():null,'duration_ms':_0x37296e[_0x5eb8ce(0x1a0)]?.['duration']||null})),'stats':_0x47da7e};}}
|
|
1
|
+
const a51_0x536d3c=a51_0x458b;(function(_0x23fc0a,_0x2dc456){const _0x3f7858=a51_0x458b,_0x32043d=_0x23fc0a();while(!![]){try{const _0x16b4e2=-parseInt(_0x3f7858(0x139))/0x1*(parseInt(_0x3f7858(0x223))/0x2)+parseInt(_0x3f7858(0x265))/0x3*(-parseInt(_0x3f7858(0x2a1))/0x4)+parseInt(_0x3f7858(0x184))/0x5*(-parseInt(_0x3f7858(0x1ac))/0x6)+parseInt(_0x3f7858(0x116))/0x7+parseInt(_0x3f7858(0x236))/0x8+parseInt(_0x3f7858(0x226))/0x9*(parseInt(_0x3f7858(0x1ed))/0xa)+-parseInt(_0x3f7858(0x215))/0xb*(-parseInt(_0x3f7858(0x137))/0xc);if(_0x16b4e2===_0x2dc456)break;else _0x32043d['push'](_0x32043d['shift']());}catch(_0x2f7431){_0x32043d['push'](_0x32043d['shift']());}}}(a51_0x1fdd,0x556d0));import a51_0x14a5c4 from'chalk';import{existsSync}from'fs';import a51_0x16c409 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 a51_0x1c7919 from'prompts';function getAttemptStatusDisplay(_0x519a47){const _0x4fb6a6=a51_0x458b;if(!_0x519a47)return{'icon':'⏳','text':''};const {done:_0x314379,success:_0x1fd45d,cancelRequested:_0x430a73}=_0x519a47;if(!_0x314379)return _0x430a73?{'icon':'🛑','text':a51_0x14a5c4['yellow'](_0x4fb6a6(0x13d))}:{'icon':'🔄','text':a51_0x14a5c4[_0x4fb6a6(0x280)](_0x4fb6a6(0x19c))};if(_0x1fd45d)return{'icon':'✅','text':a51_0x14a5c4[_0x4fb6a6(0x1a1)](_0x4fb6a6(0x238))};return{'icon':'❌','text':a51_0x14a5c4['red'](_0x4fb6a6(0x1ef))};}export class WorkflowBaseCommand extends BaseCommand{[a51_0x536d3c(0x10b)](_0x1574a5,_0x1fb1fb,_0x163c24=0x0){const _0x286f4b=a51_0x536d3c;return _0x1574a5[_0x163c24]||_0x1fb1fb[_0x286f4b(0x18e)];}[a51_0x536d3c(0x13a)](_0x4a4065,_0x8cce,_0x4cae47=0x0){const _0x3b4fe5=a51_0x536d3c,_0x7ecbc5=this[_0x3b4fe5(0x10b)](_0x4a4065,_0x8cce,_0x4cae47);if(!_0x7ecbc5)return console[_0x3b4fe5(0x1ef)](a51_0x14a5c4['red']('Error:'),_0x3b4fe5(0x1f7)),console[_0x3b4fe5(0x1ef)](a51_0x14a5c4['dim'](_0x3b4fe5(0x24a))),null;return _0x7ecbc5;}[a51_0x536d3c(0x1cd)](_0x32acb1,_0x13f263){const _0x2fa6f6=a51_0x536d3c;if(_0x32acb1[0x0]){const _0x3a13d5=_0x32acb1[0x0][_0x2fa6f6(0x15a)]('.');if(_0x3a13d5[_0x2fa6f6(0x224)]===0x1)return{'projectName':_0x3a13d5[0x0],'workflowName':undefined};else return _0x3a13d5[_0x2fa6f6(0x224)]===0x2?{'projectName':_0x3a13d5[0x0],'workflowName':_0x3a13d5[0x1]}:(console['error'](a51_0x14a5c4[_0x2fa6f6(0x1ec)]('Error:'),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x13f263[_0x2fa6f6(0x18e)],'workflowName':undefined};}['resolveProjectDir'](_0x24b942,_0x143766,_0x27e144=0x0){const _0x26403e=a51_0x536d3c;if(_0x24b942[_0x27e144])return _0x24b942[_0x27e144];if(_0x143766[_0x26403e(0x18e)]){const _0x5d7293=a51_0x16c409[_0x26403e(0x1f2)](process[_0x26403e(0x2ab)](),_0x26403e(0x117),_0x143766[_0x26403e(0x18e)]);if(existsSync(a51_0x16c409[_0x26403e(0x1f2)](_0x5d7293,_0x26403e(0x136))))return _0x5d7293;}return undefined;}async[a51_0x536d3c(0x1b9)](_0x5ddcfd,_0x1fcdbb,_0x4bf8fd){const _0x210b8e=a51_0x536d3c;try{const _0x32caf6=await _0x5ddcfd[_0x210b8e(0x157)][_0x210b8e(0x117)](_0x1fcdbb,{'limit':0x1});if(_0x32caf6[_0x210b8e(0x224)]>0x0){const _0x324e4b=_0x32caf6[0x0]['id'],_0x39c129=getWorkflowUrl(_0x4bf8fd,_0x324e4b);console[_0x210b8e(0x1ef)](_0x210b8e(0x1a0)+a51_0x14a5c4[_0x210b8e(0x239)](_0x39c129));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a51_0x536d3c(0x211);[a51_0x536d3c(0x1cc)]=a51_0x536d3c(0x10e);async['execute'](_0x266f66){const _0x38088a=a51_0x536d3c,{options:_0x50ca21,args:_0x80e874,tdx:_0x32595a}=_0x266f66,_0xe76d20=_0x80e874[0x0],_0x160ff2=_0x50ca21[_0x38088a(0x18f)];if(_0x160ff2)return saveSessionContext({'workflow_project':undefined},_0x50ca21[_0x38088a(0x159)]),console[_0x38088a(0x29d)](a51_0x14a5c4[_0x38088a(0x1a1)](_0x38088a(0x1af))),0x0;if(!_0xe76d20)return console[_0x38088a(0x1ef)](a51_0x14a5c4[_0x38088a(0x1ec)](_0x38088a(0x21d)),'Project\x20name\x20is\x20required'),console[_0x38088a(0x1ef)](a51_0x14a5c4[_0x38088a(0x176)](_0x38088a(0x260))),console[_0x38088a(0x1ef)](a51_0x14a5c4[_0x38088a(0x176)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x464cc5=await withSpinner(_0x38088a(0x185)+_0xe76d20+_0x38088a(0x25b),()=>_0x32595a['workflow']['resolveProjectId'](_0xe76d20),{'verbose':_0x50ca21['verbose']}),{name:_0x3f8701}=_0x464cc5['data'];return saveSessionContext({'workflow_project':_0x3f8701},_0x50ca21[_0x38088a(0x159)]),console['log'](a51_0x14a5c4['green'](_0x38088a(0x20a)+a51_0x14a5c4['cyan'](_0x3f8701))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a51_0x536d3c(0x279)]=a51_0x536d3c(0x134);[a51_0x536d3c(0x1cc)]=a51_0x536d3c(0x228);async[a51_0x536d3c(0x179)](_0x399eaf){const _0x112428=a51_0x536d3c,{options:_0x4107b3,args:_0x4b7338,tdx:_0xa374bb}=_0x399eaf,_0x46caef=_0x4b7338[0x0];_0x4107b3[_0x112428(0x22b)]&&_0x46caef&&console[_0x112428(0x1ef)](_0x112428(0x131)+_0x46caef);const _0x21bdd6=await withSpinner(_0x112428(0x14d),()=>_0xa374bb['workflow'][_0x112428(0x248)](_0x46caef,{'limit':_0x4107b3[_0x112428(0x144)]}),{'verbose':_0x4107b3['verbose']});let _0x21dcf5=_0x21bdd6[_0x112428(0x270)];_0x21dcf5[_0x112428(0x1eb)]((_0x2ee18f,_0x59ed8c)=>_0x2ee18f[_0x112428(0x279)][_0x112428(0x196)](_0x59ed8c[_0x112428(0x279)]));const _0x4e308a=_0x4107b3[_0x112428(0x144)]||0x64,_0x1fed8b=_0x21dcf5['length']>=_0x4e308a?a51_0x14a5c4[_0x112428(0x176)](_0x112428(0x295)):'';console[_0x112428(0x1ef)]('✔\x20Found\x20'+_0x21dcf5[_0x112428(0x224)]+_0x112428(0x251)+(_0x21dcf5[_0x112428(0x224)]!==0x1?'s':'')+_0x1fed8b);if(_0x4107b3[_0x112428(0x150)]===_0x112428(0x1f5)||_0x4107b3[_0x112428(0x150)]===_0x112428(0x1da)||_0x4107b3[_0x112428(0x150)]===_0x112428(0x120))await handleSDKOutput(_0x21dcf5,_0x4107b3);else{if(_0x21dcf5[_0x112428(0x224)]===0x0)_0x46caef?console[_0x112428(0x29d)](_0x112428(0x28b)+_0x46caef):console['log'](_0x112428(0x1b2));else{const _0x4a5c3e=_0x21dcf5['map'](_0xa56137=>{const _0x1807f4=_0x112428,_0x5bb175=_0xa56137[_0x1807f4(0x16d)]?.[_0x1807f4(0x259)](_0x2bd898=>_0x2bd898[_0x1807f4(0x12a)]===_0x1807f4(0x161)),_0x5b9351=_0x5bb175?a51_0x14a5c4[_0x1807f4(0x176)](_0x1807f4(0x183)):'';return _0x1807f4(0x125)+_0xa56137[_0x1807f4(0x279)]+_0x5b9351;});await writeOutput(_0x4a5c3e[_0x112428(0x1f2)]('\x0a'),_0x4107b3[_0x112428(0x168)],_0x112428(0x23e));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a51_0x536d3c(0x233);[a51_0x536d3c(0x1cc)]=a51_0x536d3c(0x281);async[a51_0x536d3c(0x179)](_0x38a816){const _0x13055f=a51_0x536d3c,{options:_0x4eaba2,args:_0x3d66b4,tdx:_0x3b1ed9}=_0x38a816,_0x49f28c=this[_0x13055f(0x10b)](_0x3d66b4,_0x4eaba2);_0x4eaba2[_0x13055f(0x22b)]&&_0x49f28c&&console[_0x13055f(0x1ef)](_0x13055f(0x170)+_0x49f28c);const _0x3b374f=await withSpinner(_0x13055f(0x234),()=>_0x3b1ed9[_0x13055f(0x157)]['workflows'](_0x49f28c,{'limit':_0x4eaba2[_0x13055f(0x144)]}),{'verbose':_0x4eaba2['verbose']});let _0x143e52=_0x3b374f[_0x13055f(0x270)];_0x143e52[_0x13055f(0x1eb)]((_0x232308,_0x35bb5b)=>{const _0x352eed=_0x13055f,_0x2bf02c=_0x232308['name'][_0x352eed(0x196)](_0x35bb5b[_0x352eed(0x279)]);if(_0x2bf02c!==0x0)return _0x2bf02c;return(_0x232308[_0x352eed(0x18d)]?.['name']||'')[_0x352eed(0x196)](_0x35bb5b['project']?.[_0x352eed(0x279)]||'');});const _0x3e2b95=_0x4eaba2[_0x13055f(0x144)]||0x64,_0x403c2a=_0x143e52[_0x13055f(0x224)]>=_0x3e2b95?a51_0x14a5c4[_0x13055f(0x176)](_0x13055f(0x295)):'';console[_0x13055f(0x1ef)](_0x13055f(0x17d)+_0x143e52[_0x13055f(0x224)]+_0x13055f(0x20e)+(_0x143e52[_0x13055f(0x224)]!==0x1?'s':'')+_0x403c2a);if(_0x4eaba2[_0x13055f(0x150)]==='json'||_0x4eaba2[_0x13055f(0x150)]===_0x13055f(0x1da)||_0x4eaba2[_0x13055f(0x150)]==='table')await handleSDKOutput(_0x143e52,_0x4eaba2);else{if(_0x143e52['length']===0x0)_0x49f28c?console[_0x13055f(0x29d)]('No\x20workflows\x20found\x20in\x20project:\x20'+_0x49f28c):console[_0x13055f(0x29d)](_0x13055f(0x28d));else{const _0x45b2ca=_0x4eaba2[_0x13055f(0x1a9)],_0x3134a9=_0x143e52[_0x13055f(0x147)](_0x32421d=>{const _0x5c73e4=_0x13055f,_0x40b1a9=a51_0x14a5c4['dim']('#'+_0x32421d['id']),_0x1069c1=hyperlink(_0x40b1a9,getWorkflowUrl(_0x45b2ca,_0x32421d['id'])),_0x595e62=_0x32421d[_0x5c73e4(0x18d)]?.[_0x5c73e4(0x279)]?a51_0x14a5c4[_0x5c73e4(0x176)]('\x20('+_0x32421d[_0x5c73e4(0x18d)][_0x5c73e4(0x279)]+')'):'';return _0x5c73e4(0x263)+_0x1069c1+'\x20'+_0x32421d['name']+_0x595e62;});await writeOutput(_0x3134a9['join']('\x0a'),_0x4eaba2[_0x13055f(0x168)],_0x13055f(0x23e));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a51_0x536d3c(0x279)]='workflow:sessions';[a51_0x536d3c(0x1cc)]=a51_0x536d3c(0x1ce);async[a51_0x536d3c(0x179)](_0x594e16){const _0x2c8c17=a51_0x536d3c,{options:_0x44b301,args:_0x1a4f79,tdx:_0x3e192d}=_0x594e16,_0xaad818=this[_0x2c8c17(0x1cd)](_0x1a4f79,_0x44b301);if(!_0xaad818)return 0x1;const {projectName:_0x17aa64,workflowName:_0x5f1a4a}=_0xaad818;if(_0x44b301[_0x2c8c17(0x22b)]){if(_0x17aa64&&_0x5f1a4a)console[_0x2c8c17(0x1ef)]('Filter:\x20'+_0x17aa64+'.'+_0x5f1a4a);else _0x17aa64&&console[_0x2c8c17(0x1ef)](_0x2c8c17(0x286)+_0x17aa64);const _0x33335c=_0x44b301['status'];_0x33335c&&console[_0x2c8c17(0x1ef)](_0x2c8c17(0x19a)+_0x33335c);}let _0x5099bd=0x28;if(process['stdout'][_0x2c8c17(0x23b)]&&!_0x44b301[_0x2c8c17(0x168)]&&!_0x44b301[_0x2c8c17(0x150)]){const _0x2a493d=process['stdout'][_0x2c8c17(0x1be)]||0x28;_0x5099bd=Math[_0x2c8c17(0x225)](0x14,Math[_0x2c8c17(0x28c)](_0x2a493d*0x2/0x3));}const _0x20efbd=_0x44b301[_0x2c8c17(0x144)]||_0x5099bd,_0x2b1692=await withSpinner(_0x2c8c17(0x255),()=>_0x3e192d[_0x2c8c17(0x157)]['sessions']({'projectName':_0x17aa64,'workflowName':_0x5f1a4a,'status':_0x44b301[_0x2c8c17(0x1f4)],'fromTime':_0x44b301[_0x2c8c17(0x112)],'toTime':_0x44b301['to'],'limit':_0x20efbd}),{'verbose':_0x44b301[_0x2c8c17(0x22b)]}),_0x531e82=_0x2b1692[_0x2c8c17(0x270)];_0x531e82[_0x2c8c17(0x1eb)]((_0x101200,_0x1a9b84)=>{const _0x51f405=_0x2c8c17,_0x46a63d=_0x101200[_0x51f405(0x145)]||'',_0x1081d0=_0x1a9b84[_0x51f405(0x145)]||'';return _0x1081d0['localeCompare'](_0x46a63d);});_0x531e82[_0x2c8c17(0x224)]>=_0x20efbd?console[_0x2c8c17(0x1ef)]('✔\x20Showing\x20'+_0x531e82[_0x2c8c17(0x224)]+'\x20sessions\x20'+a51_0x14a5c4[_0x2c8c17(0x176)](_0x2c8c17(0x266))):console[_0x2c8c17(0x1ef)](_0x2c8c17(0x17d)+_0x531e82[_0x2c8c17(0x224)]+_0x2c8c17(0x1d3)+(_0x531e82[_0x2c8c17(0x224)]!==0x1?'s':''));if(_0x44b301[_0x2c8c17(0x150)]===_0x2c8c17(0x1f5)||_0x44b301[_0x2c8c17(0x150)]===_0x2c8c17(0x1da)||_0x44b301[_0x2c8c17(0x150)]===_0x2c8c17(0x120))await handleSDKOutput(_0x531e82,_0x44b301);else{if(!process[_0x2c8c17(0x22f)][_0x2c8c17(0x23b)]||_0x44b301[_0x2c8c17(0x168)]){if(_0x531e82[_0x2c8c17(0x224)]===0x0){if(_0x17aa64&&_0x5f1a4a)console['log']('No\x20sessions\x20found\x20for:\x20'+_0x17aa64+'.'+_0x5f1a4a);else _0x17aa64?console[_0x2c8c17(0x29d)](_0x2c8c17(0x166)+_0x17aa64):console[_0x2c8c17(0x29d)](_0x2c8c17(0x232));}else{const _0x124683=_0x44b301[_0x2c8c17(0x1a9)],_0x2e2c8b=this[_0x2c8c17(0x1d0)](_0x531e82,_0x124683);_0x44b301[_0x2c8c17(0x168)]?await writeOutput(_0x2e2c8b,_0x44b301[_0x2c8c17(0x168)],_0x2c8c17(0x23e)):console[_0x2c8c17(0x29d)](_0x2e2c8b);}!_0x17aa64&&(console[_0x2c8c17(0x1ef)](''),console[_0x2c8c17(0x1ef)](a51_0x14a5c4[_0x2c8c17(0x176)](_0x2c8c17(0x1e1))),console[_0x2c8c17(0x1ef)](a51_0x14a5c4[_0x2c8c17(0x176)](_0x2c8c17(0x256))+'or'+a51_0x14a5c4[_0x2c8c17(0x176)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x531e82[_0x2c8c17(0x224)]===0x0){if(_0x17aa64&&_0x5f1a4a)console['log']('No\x20sessions\x20found\x20for:\x20'+_0x17aa64+'.'+_0x5f1a4a);else _0x17aa64?console[_0x2c8c17(0x29d)](_0x2c8c17(0x166)+_0x17aa64):console['log'](_0x2c8c17(0x232));}else await this[_0x2c8c17(0x101)](_0x531e82,_0x594e16,_0x17aa64);}}return 0x0;}['renderSessionsTimeline'](_0x6f2633,_0xd09c8d){const _0x47cef0=a51_0x536d3c,_0x342d87=[],_0x166ffc=new Map();let _0x341ae4=Infinity,_0x34fa5e=-Infinity;for(const _0x43f0f8 of _0x6f2633){if(_0x43f0f8['lastAttempt']?.[_0x47cef0(0x1e9)]){const _0x4b37be=new Date(_0x43f0f8[_0x47cef0(0x1c4)][_0x47cef0(0x1e9)])[_0x47cef0(0x1c5)](),_0x581874=_0x43f0f8['lastAttempt'][_0x47cef0(0x288)]?new Date(_0x43f0f8[_0x47cef0(0x1c4)][_0x47cef0(0x288)])[_0x47cef0(0x1c5)]():Date[_0x47cef0(0x277)](),_0x2c61e9=_0x43f0f8[_0x47cef0(0x18d)]?.['name']||_0x47cef0(0x208);!_0x166ffc[_0x47cef0(0x106)](_0x2c61e9)&&_0x166ffc[_0x47cef0(0x151)](_0x2c61e9,[]),_0x166ffc[_0x47cef0(0x199)](_0x2c61e9)[_0x47cef0(0x13e)]({'session':_0x43f0f8,'startTime':_0x4b37be,'endTime':_0x581874,'duration':_0x581874-_0x4b37be}),_0x341ae4=Math['min'](_0x341ae4,_0x4b37be),_0x34fa5e=Math[_0x47cef0(0x225)](_0x34fa5e,_0x581874);}}if(_0x166ffc[_0x47cef0(0x1d4)]===0x0)return _0x47cef0(0x22a);const _0x3ae958=process[_0x47cef0(0x22f)][_0x47cef0(0x1b5)]||0x78,_0x87b783=0x1e,_0x5b6a3e=0x32,_0x50b88d=0x4,_0x208efc=Math[_0x47cef0(0x28a)](_0x5b6a3e,Math[_0x47cef0(0x225)](_0x87b783,Math[_0x47cef0(0x28c)](_0x3ae958*0.3))),_0x1ed9e7=_0x3ae958-_0x208efc-TIMELINE_CONFIG[_0x47cef0(0x138)]-0x3-_0x50b88d,_0x23c3ad=_0x34fa5e-_0x341ae4,_0xc9543a=_0x23c3ad/_0x208efc,_0x12bfea=renderTimeAxis({'startTime':_0x341ae4,'endTime':_0x34fa5e,'durationMs':_0x23c3ad,'msPerChar':_0xc9543a},_0x208efc),_0x4126dc=[];for(const _0x5bc26e of _0x166ffc[_0x47cef0(0x194)]()){_0x4126dc[_0x47cef0(0x13e)](..._0x5bc26e);}_0x4126dc['sort']((_0x14dc6c,_0x1abd0f)=>_0x1abd0f[_0x47cef0(0x247)]-_0x14dc6c['startTime']);const _0x4b4430=new Date(_0x341ae4),_0x214322=formatDate(_0x4b4430),_0x1fd3e7=_0x50b88d+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x47cef0(0x244)]+_0x1ed9e7,_0x4e6412='\x20'['repeat'](_0x1fd3e7-_0x214322[_0x47cef0(0x224)]),_0x7d3f54=_0x4e6412+a51_0x14a5c4[_0x47cef0(0x176)](_0x214322)+'\x20'+_0x12bfea;_0x342d87[_0x47cef0(0x13e)](_0x7d3f54);const _0x4a7a60=0x16;let _0x18ed5d=0x0;for(const _0x20506f of _0x4126dc){const _0x1382bd=_0x20506f[_0x47cef0(0x159)]['project']?.[_0x47cef0(0x279)]||'?',_0x1c4c8f=Math[_0x47cef0(0x28a)](stringWidth(_0x1382bd),_0x4a7a60);_0x18ed5d=Math['max'](_0x18ed5d,_0x1c4c8f);}for(const _0xa5b31d of _0x4126dc){const {session:_0x173227,startTime:_0x2175f9,endTime:_0x1a4bd5,duration:_0x544755}=_0xa5b31d,_0x4dfd6a=_0x173227['project']?.['id'],_0x55d424=_0x173227['id'],_0x31b827=_0x173227[_0x47cef0(0x18d)]?.[_0x47cef0(0x279)]||'?',_0x371443=_0x173227[_0x47cef0(0x157)]?.[_0x47cef0(0x279)]||'?';let _0x351192,_0x5332a2;if(_0x173227[_0x47cef0(0x1c4)]){const _0x4c140c=_0x173227[_0x47cef0(0x1c4)];!_0x4c140c[_0x47cef0(0x115)]?(_0x351192=_0x4c140c['cancelRequested']?'🛑':'🔄',_0x5332a2=_0x4c140c[_0x47cef0(0x1cf)]?a51_0x14a5c4[_0x47cef0(0x23d)]:a51_0x14a5c4[_0x47cef0(0x280)]):(_0x351192=_0x4c140c['success']?'✅':'❌',_0x5332a2=_0x4c140c['success']?a51_0x14a5c4[_0x47cef0(0x1a1)]:a51_0x14a5c4[_0x47cef0(0x1ec)]);}else _0x351192='⏳',_0x5332a2=a51_0x14a5c4['dim'];const _0x4adb5e='#'+_0x55d424,_0x57eaa9=_0x4dfd6a?hyperlink(_0x4adb5e,getWorkflowSessionUrl(_0xd09c8d,_0x4dfd6a,_0x55d424)):_0x4adb5e;let _0x2f0d6e=_0x31b827;stringWidth(_0x31b827)>_0x4a7a60&&(_0x2f0d6e=_0x31b827['slice'](0x0,_0x4a7a60-0x1)+'…');const _0x175c20=a51_0x14a5c4[_0x47cef0(0x176)](_0x2f0d6e),_0x4c3a16=stringWidth(_0x2f0d6e),_0x37272c='\x20'[_0x47cef0(0x272)](_0x18ed5d-stringWidth(_0x2f0d6e)+0x2),_0x3ac220='('+formatElapsed(_0x544755)+')',_0x192e84=stringWidth(_0x3ac220),_0x445bef=stringWidth(_0x4adb5e),_0x270084=_0x445bef+0x1+_0x4c3a16+_0x37272c[_0x47cef0(0x224)],_0x39ac2e=_0x1ed9e7-_0x270084-_0x192e84-0x1-0x8;let _0xff4ffc=_0x371443;stringWidth(_0xff4ffc)>_0x39ac2e&&(_0xff4ffc=_0xff4ffc['slice'](0x0,_0x39ac2e-0x1)+'…');const _0x210acf=_0x57eaa9+'\x20'+_0x175c20+_0x37272c+_0xff4ffc,_0x5dbc01=stringWidth(_0x210acf),_0x357351=_0x1ed9e7-_0x5dbc01-_0x192e84,_0x1fa8b4=_0x210acf+'\x20'['repeat'](Math['max'](0x1,_0x357351))+a51_0x14a5c4[_0x47cef0(0x176)](_0x3ac220),_0x5a8a31=Math[_0x47cef0(0x28c)]((_0x2175f9-_0x341ae4)/_0xc9543a),_0x2e626f=Math['floor']((_0x1a4bd5-_0x341ae4)/_0xc9543a),_0x131115=Math['max'](_0x5a8a31+0x1,_0x2e626f),_0x26cbc1=new Array(_0x208efc)[_0x47cef0(0x114)]('\x20');for(let _0x213311=_0x5a8a31;_0x213311<Math[_0x47cef0(0x28a)](_0x131115,_0x208efc);_0x213311++){_0x26cbc1[_0x213311]='─';}const _0xe2c164=_0x26cbc1[_0x47cef0(0x147)](_0x3b4854=>_0x3b4854==='\x20'?'\x20':_0x5332a2(_0x3b4854))[_0x47cef0(0x1f2)]('');_0x342d87[_0x47cef0(0x13e)](_0x351192+'\x20'+_0x1fa8b4+'│'+_0xe2c164+'│');}return _0x342d87[_0x47cef0(0x1f2)]('\x0a');}async[a51_0x536d3c(0x101)](_0x3d1a38,_0x3f7bf6,_0x17630c){const _0x11f9fa=a51_0x536d3c,{options:_0x59d445,tdx:_0x110625}=_0x3f7bf6,_0x37354a=_0x59d445['site'],{timelineRows:_0x1f545c,timeAxisHeader:_0x887ccc}=this[_0x11f9fa(0x1d1)](_0x3d1a38,_0x37354a),_0x7d7a3b=_0x1f545c['filter'](_0x5e6feb=>_0x5e6feb['attemptId']);if(_0x7d7a3b[_0x11f9fa(0x224)]===0x0){const _0x3b361b=this[_0x11f9fa(0x1d0)](_0x3d1a38,_0x37354a);console['log'](_0x3b361b);!_0x17630c&&(console[_0x11f9fa(0x1ef)](''),console['error'](a51_0x14a5c4['dim']('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x11f9fa(0x1ef)](a51_0x14a5c4[_0x11f9fa(0x176)](_0x11f9fa(0x256))+'or'+a51_0x14a5c4[_0x11f9fa(0x176)](_0x11f9fa(0x158))));return;}_0x887ccc&&console['log'](_0x887ccc);const _0x2ab609=_0x1f545c[_0x11f9fa(0x16e)](_0x534547=>_0x534547[_0x11f9fa(0x1d5)])[_0x11f9fa(0x147)](_0x24ce21=>({'title':_0x24ce21['displayLine'],'value':_0x24ce21[_0x11f9fa(0x1d5)]})),_0x56ec2c=process[_0x11f9fa(0x22f)][_0x11f9fa(0x1be)]||0x3c,_0xa2cd25=Math[_0x11f9fa(0x225)](0x28,Math[_0x11f9fa(0x28c)](_0x56ec2c*0x2/0x3)),_0x156d05=await a51_0x1c7919({'type':_0x11f9fa(0x11b),'name':'attemptId','message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x2ab609,'initial':-0x1,'limit':_0xa2cd25,'clearFirst':!![],'fallback':{'title':_0x11f9fa(0x1ee),'value':null},'suggest':(_0x18d85e,_0x4ba156)=>{const _0xa8b941=_0x11f9fa;if(!_0x18d85e)return Promise[_0xa8b941(0x1de)](_0x4ba156);const _0x4071be=_0x4ba156[_0xa8b941(0x16e)](_0x33977a=>{const _0x435aa0=_0xa8b941,_0xa7040b=_0x33977a;return _0xa7040b['title'][_0x435aa0(0x14f)]()['includes'](_0x18d85e[_0x435aa0(0x14f)]());});return Promise[_0xa8b941(0x1de)](_0x4071be);}}),_0x472b27=()=>{const _0x32e406=_0x11f9fa;process[_0x32e406(0x22f)][_0x32e406(0x200)](_0x32e406(0x258)),process[_0x32e406(0x22f)][_0x32e406(0x200)](_0x32e406(0x258)),process[_0x32e406(0x22f)][_0x32e406(0x200)]('\x1b[1A\x1b[2K');},_0x428dfb=_0x156d05&&_0x156d05[_0x11f9fa(0x1d5)]&&_0x156d05[_0x11f9fa(0x1d5)]!==null&&_0x156d05[_0x11f9fa(0x1d5)][_0x11f9fa(0x1f0)]()!=='';if(!_0x428dfb){_0x472b27(),console[_0x11f9fa(0x29d)](a51_0x14a5c4[_0x11f9fa(0x176)](_0x11f9fa(0x24f)));return;}_0x472b27();const _0x1951af=_0x3d1a38[_0x11f9fa(0x1fa)](_0x379fd8=>_0x379fd8[_0x11f9fa(0x1c4)]?.['id']===_0x156d05[_0x11f9fa(0x1d5)]);if(_0x1951af){const _0x443c92=_0x1951af['project']?.[_0x11f9fa(0x279)]||'?',_0x1ce3ec=_0x1951af['workflow']?.[_0x11f9fa(0x279)]||'?';console[_0x11f9fa(0x29d)](_0x11f9fa(0x24d)+a51_0x14a5c4[_0x11f9fa(0x176)](_0x443c92)+',\x20Workflow:\x20'+a51_0x14a5c4[_0x11f9fa(0x176)](_0x1ce3ec));}const _0x135d0d=new WorkflowTimelineCommand();await _0x135d0d['execute']({'args':[],'options':{..._0x59d445,'attemptId':_0x156d05[_0x11f9fa(0x1d5)]},'tdx':_0x110625});}[a51_0x536d3c(0x1d1)](_0x580d28,_0x256895){const _0x4388ad=a51_0x536d3c,_0x5db634=new Map();for(const _0x11333a of _0x580d28){_0x11333a['id']&&_0x11333a['lastAttempt']?.['id']&&_0x5db634[_0x4388ad(0x151)](_0x11333a['id'],_0x11333a[_0x4388ad(0x1c4)]['id']);}const _0x1772ed=[];let _0x3a385f='';const _0x12a08d=this[_0x4388ad(0x1d0)](_0x580d28,_0x256895),_0x490f06=_0x12a08d[_0x4388ad(0x15a)]('\x0a');for(const _0x2d2b0b of _0x490f06){if(_0x2d2b0b['startsWith'](_0x4388ad(0x133))||_0x2d2b0b['match'](/^\s+\d{4}-\d{2}-\d{2}/))_0x3a385f=_0x2d2b0b;else{if(_0x2d2b0b[_0x4388ad(0x11a)](/^[✅❌🔄🛑⏳]/)){const _0xbb64be=_0x2d2b0b['match'](/#(\d+)/),_0x3a4f57=_0xbb64be?_0xbb64be[0x1]:null,_0x4bdfa6=_0x3a4f57?_0x5db634[_0x4388ad(0x199)](_0x3a4f57)||null:null,_0x3497eb=_0x580d28[_0x4388ad(0x1fa)](_0x32fb0e=>_0x32fb0e['id']===_0x3a4f57),_0x232fc1=_0x3497eb?.['project']?.[_0x4388ad(0x279)]||'';_0x1772ed['push']({'displayLine':_0x2d2b0b,'attemptId':_0x4bdfa6,'projectName':_0x232fc1});}}}return{'timelineRows':_0x1772ed,'timeAxisHeader':_0x3a385f};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a51_0x536d3c(0x279)]=a51_0x536d3c(0x18a);[a51_0x536d3c(0x1cc)]=a51_0x536d3c(0x10d);async[a51_0x536d3c(0x179)](_0x451fe8){const _0x3e1d9e=a51_0x536d3c,{options:_0x5483f1,args:_0x19d2f9,tdx:_0x3a54b0}=_0x451fe8,_0x2f4de6=this[_0x3e1d9e(0x1cd)](_0x19d2f9,_0x5483f1);if(!_0x2f4de6)return 0x1;const {projectName:_0x47e504,workflowName:_0x1a5a91}=_0x2f4de6,_0x3d80d3=_0x5483f1[_0x3e1d9e(0x221)];if(_0x5483f1[_0x3e1d9e(0x22b)]){if(_0x47e504&&_0x1a5a91)console[_0x3e1d9e(0x1ef)]('Filter:\x20'+_0x47e504+'.'+_0x1a5a91);else _0x47e504&&console['error'](_0x3e1d9e(0x286)+_0x47e504);_0x3d80d3&&console[_0x3e1d9e(0x1ef)]('Include\x20retried:\x20yes');}const _0x5e0165=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x3a54b0[_0x3e1d9e(0x157)]['attempts']({'projectName':_0x47e504,'workflowName':_0x1a5a91,'includeRetried':_0x3d80d3,'limit':_0x5483f1[_0x3e1d9e(0x144)]}),{'verbose':_0x5483f1[_0x3e1d9e(0x22b)]}),_0xd799dd=_0x5e0165['data'],_0x395fd5=_0x5483f1[_0x3e1d9e(0x144)]||0x64,_0x19b6ce=_0xd799dd[_0x3e1d9e(0x224)]>=_0x395fd5?a51_0x14a5c4['dim'](_0x3e1d9e(0x295)):'';console['error']('✔\x20Found\x20'+_0xd799dd[_0x3e1d9e(0x224)]+'\x20attempt'+(_0xd799dd[_0x3e1d9e(0x224)]!==0x1?'s':'')+_0x19b6ce);if(_0x5483f1[_0x3e1d9e(0x150)]==='json'||_0x5483f1['format']===_0x3e1d9e(0x1da)||_0x5483f1[_0x3e1d9e(0x150)]==='table')await handleSDKOutput(_0xd799dd,_0x5483f1);else{if(_0xd799dd['length']===0x0){if(_0x47e504&&_0x1a5a91)console['log'](_0x3e1d9e(0x2b1)+_0x47e504+'.'+_0x1a5a91);else _0x47e504?console['log']('No\x20attempts\x20found\x20in\x20project:\x20'+_0x47e504):console[_0x3e1d9e(0x29d)]('No\x20attempts\x20found');}else{const _0x16ab66=_0x5483f1[_0x3e1d9e(0x1a9)],_0x438767=_0xd799dd[_0x3e1d9e(0x147)](_0x36224e=>{const _0x3d80f1=_0x3e1d9e,_0x52a1e6=a51_0x14a5c4[_0x3d80f1(0x176)]('#'+_0x36224e['id']),_0x12f2d9=_0x36224e[_0x3d80f1(0x18d)]?.['id'],_0x276fae=_0x36224e[_0x3d80f1(0x1b3)]||_0x36224e[_0x3d80f1(0x20d)],_0xd0502d=_0x12f2d9&&_0x276fae?hyperlink(_0x52a1e6,getWorkflowAttemptUrl(_0x16ab66,_0x12f2d9,_0x276fae,_0x36224e['id'])):_0x52a1e6,{icon:_0xfcc394,text:_0x169c8b}=getAttemptStatusDisplay(_0x36224e),_0x4d0ff0=(_0x36224e[_0x3d80f1(0x18d)]?.[_0x3d80f1(0x279)]||'?')+'.'+(_0x36224e['workflow']?.[_0x3d80f1(0x279)]||'?'),_0x43ba07=_0x36224e['sessionTime']?a51_0x14a5c4[_0x3d80f1(0x176)](_0x36224e[_0x3d80f1(0x145)]):'';return(_0xd0502d+'\x20'+_0xfcc394+(_0x169c8b?'\x20'+_0x169c8b:'')+'\x20'+_0x4d0ff0+'\x20'+_0x43ba07)[_0x3d80f1(0x268)]();});await writeOutput(_0x438767['join']('\x0a'),_0x5483f1[_0x3e1d9e(0x168)],_0x3e1d9e(0x23e));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a51_0x536d3c(0x279)]=a51_0x536d3c(0x2a3);[a51_0x536d3c(0x1cc)]=a51_0x536d3c(0x2af);async[a51_0x536d3c(0x179)](_0x369b15){const _0x447af9=a51_0x536d3c,{options:_0x3ac7c3,args:_0x17cba6,tdx:_0x18f130}=_0x369b15,_0x5d8923=_0x17cba6[0x0];if(!_0x5d8923)return console['error'](_0x447af9(0x182)),0x1;_0x3ac7c3[_0x447af9(0x22b)]&&console[_0x447af9(0x1ef)](_0x447af9(0x27f)+_0x5d8923);const _0x3a3248=await withSpinner(_0x447af9(0x126),()=>_0x18f130[_0x447af9(0x157)][_0x447af9(0x178)](_0x5d8923),{'verbose':_0x3ac7c3[_0x447af9(0x22b)]}),_0x528338=_0x3a3248[_0x447af9(0x270)];let _0xfcb650;!_0x528338['done']?_0xfcb650=_0x528338[_0x447af9(0x1cf)]?'canceling':_0x447af9(0x19c):_0xfcb650=_0x528338[_0x447af9(0x238)]?_0x447af9(0x238):_0x447af9(0x1ef);let _0x2f2202;if(_0x528338[_0x447af9(0x1e9)]&&_0x528338[_0x447af9(0x288)]){const _0x2b1919=new Date(_0x528338[_0x447af9(0x1e9)])['getTime'](),_0x2adbc0=new Date(_0x528338[_0x447af9(0x288)])[_0x447af9(0x1c5)]();_0x2f2202=Math[_0x447af9(0x24b)]((_0x2adbc0-_0x2b1919)/0x3e8);}const _0x1f8342={'attempt_id':_0x528338['id'],'status':_0xfcb650,..._0x528338[_0x447af9(0x108)]!==undefined&&{'index':_0x528338['index']},..._0x528338['project']&&{'project':_0x528338[_0x447af9(0x18d)][_0x447af9(0x279)]},..._0x528338['workflow']&&{'workflow':_0x528338['workflow']['name']},..._0x528338[_0x447af9(0x20d)]&&{'session_id':_0x528338['sessionId']},..._0x528338['sessionTime']&&{'session_time':_0x528338['sessionTime']},..._0x528338[_0x447af9(0x160)]&&{'retry_attempt':_0x528338[_0x447af9(0x160)]},..._0x2f2202!==undefined&&{'duration_sec':_0x2f2202},..._0x528338[_0x447af9(0x1e9)]&&{'created_at':_0x528338[_0x447af9(0x1e9)]},..._0x528338['finishedAt']&&{'finished_at':_0x528338[_0x447af9(0x288)]},...Object[_0x447af9(0x29f)](_0x528338[_0x447af9(0x1c6)])[_0x447af9(0x224)]>0x0&&{'params':_0x528338[_0x447af9(0x1c6)]}};return await handleSingleObjectOutput(_0x1f8342,_0x3ac7c3),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a51_0x536d3c(0x279)]=a51_0x536d3c(0x19e);[a51_0x536d3c(0x1cc)]=a51_0x536d3c(0x1a7);async[a51_0x536d3c(0x179)](_0x45ebb3){const _0x3f48a4=a51_0x536d3c,{options:_0x52610f,args:_0x15748e,tdx:_0xc6e8da}=_0x45ebb3,_0x1c159a=_0x15748e[0x0];if(!_0x1c159a)return console[_0x3f48a4(0x1ef)](_0x3f48a4(0x182)),0x1;const _0x12817a=_0x52610f['includeSubtasks'];_0x52610f[_0x3f48a4(0x22b)]&&(console['error'](_0x3f48a4(0x27f)+_0x1c159a),_0x12817a&&console[_0x3f48a4(0x1ef)](_0x3f48a4(0x216)));const _0x124df8=await withSpinner(_0x3f48a4(0x246),()=>_0xc6e8da[_0x3f48a4(0x157)][_0x3f48a4(0x11c)](_0x1c159a,_0x12817a||![]),{'verbose':_0x52610f[_0x3f48a4(0x22b)]}),_0x2756ac=_0x124df8[_0x3f48a4(0x270)];return console[_0x3f48a4(0x1ef)](_0x3f48a4(0x17d)+_0x2756ac[_0x3f48a4(0x224)]+_0x3f48a4(0x1c7)+(_0x2756ac[_0x3f48a4(0x224)]!==0x1?'s':'')),await handleSDKOutput(_0x2756ac,_0x52610f),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a51_0x536d3c(0x279)]='workflow:logs';[a51_0x536d3c(0x1cc)]=a51_0x536d3c(0x110);async['execute'](_0x272be2){const _0x118f52=a51_0x536d3c,{options:_0x135d66,args:_0x5f2f1d,tdx:_0x7e84ea}=_0x272be2,_0x2cd059=_0x5f2f1d[0x0];let _0x2ee6c6=_0x5f2f1d[0x1];if(!_0x2cd059)return console[_0x118f52(0x1ef)](_0x118f52(0x182)),0x1;_0x135d66[_0x118f52(0x22b)]&&(console['error'](_0x118f52(0x27f)+_0x2cd059),_0x2ee6c6&&console[_0x118f52(0x1ef)](_0x118f52(0x16a)+_0x2ee6c6));const _0x4ec5e8=await withSpinner('Fetching\x20log\x20files...',()=>_0x7e84ea[_0x118f52(0x157)][_0x118f52(0x146)](_0x2cd059,_0x2ee6c6),{'verbose':_0x135d66['verbose']}),_0xa3a484=_0x4ec5e8['data'];if(_0xa3a484[_0x118f52(0x224)]===0x0)return console[_0x118f52(0x1ef)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x2ee6c6&&(_0x135d66['json']||_0x135d66[_0x118f52(0x150)]))return await handleSDKOutput(_0xa3a484,_0x135d66),0x0;if(!_0x2ee6c6){const _0x5976b9=_0xa3a484[_0x118f52(0x147)](_0xe1b498=>({'title':_0xe1b498['taskName']+'\x20('+formatBytes(_0xe1b498[_0x118f52(0x250)])+')','value':_0xe1b498['taskName']})),_0xadb393=await a51_0x1c7919({'type':_0x118f52(0x24e),'name':_0x118f52(0x257),'message':_0x118f52(0x1c0),'choices':_0x5976b9});if(!_0xadb393['task'])return console[_0x118f52(0x1ef)](_0x118f52(0x24f)),0x0;_0x2ee6c6=_0xadb393[_0x118f52(0x257)];}const _0x33a4af=await withSpinner('Downloading\x20logs...',()=>_0x7e84ea[_0x118f52(0x157)]['logs'](_0x2cd059,_0x2ee6c6),{'verbose':_0x135d66[_0x118f52(0x22b)]}),_0xf7ee9c=_0x33a4af['data'];return _0xf7ee9c?console[_0x118f52(0x29d)](_0xf7ee9c):console['error'](_0x118f52(0x19d)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a51_0x536d3c(0x279)]=a51_0x536d3c(0x2a5);[a51_0x536d3c(0x1cc)]=a51_0x536d3c(0x1d7);async[a51_0x536d3c(0x179)](_0x4d43a1){const _0x26898f=a51_0x536d3c,{options:_0x5616fb,args:_0x162a38,tdx:_0x128568}=_0x4d43a1,_0x5a7476=_0x162a38[0x0];if(!_0x5a7476)return console['error'](_0x26898f(0x182)),0x1;const _0x411112=_0x5616fb['reason'];_0x5616fb['verbose']&&(console[_0x26898f(0x1ef)](_0x26898f(0x27f)+_0x5a7476),_0x411112&&console['error'](_0x26898f(0x1a6)+_0x411112));if(!_0x5616fb[_0x26898f(0x195)]){if(!isInteractive())return console[_0x26898f(0x1ef)](a51_0x14a5c4[_0x26898f(0x1ec)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x26898f(0x1ef)](a51_0x14a5c4[_0x26898f(0x176)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x6dab2c=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x5a7476+'?');if(!_0x6dab2c)return console[_0x26898f(0x1ef)](a51_0x14a5c4[_0x26898f(0x23d)](_0x26898f(0x24f))),0x1;}const _0x58d640=await withSpinner('Killing\x20attempt...',()=>_0x128568[_0x26898f(0x157)][_0x26898f(0x297)](_0x5a7476,_0x411112),{'verbose':_0x5616fb[_0x26898f(0x22b)]}),_0x456567=_0x58d640[_0x26898f(0x270)];return console[_0x26898f(0x1ef)]('✔\x20'+_0x456567),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a51_0x536d3c(0x279)]=a51_0x536d3c(0x213);[a51_0x536d3c(0x1cc)]='Retry\x20a\x20session\x20or\x20attempt';async['execute'](_0x1a31ba){const _0x473c77=a51_0x536d3c,{options:_0x2cc1fe,args:_0x40eabf,tdx:_0x4a6a9e}=_0x1a31ba,_0x23c971=_0x40eabf[0x0];if(!_0x23c971)return console[_0x473c77(0x1ef)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x473c77(0x1ef)](_0x473c77(0x193)),0x1;let _0x1efb12=![],_0x213da9=_0x23c971;if(_0x23c971[_0x473c77(0x210)](_0x473c77(0x23a)))_0x1efb12=!![],_0x213da9=_0x23c971['substring'](0x8);else{if(_0x23c971['startsWith']('attempt:'))_0x1efb12=![],_0x213da9=_0x23c971[_0x473c77(0x26b)](0x8);else return console[_0x473c77(0x1ef)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0x473c77(0x1ef)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x335a6b=_0x2cc1fe[_0x473c77(0x2ae)],_0x3eda26=_0x2cc1fe[_0x473c77(0x155)],_0x3a71d2=_0x2cc1fe['params'],_0x1efccb=_0x2cc1fe[_0x473c77(0x17e)];_0x2cc1fe[_0x473c77(0x22b)]&&(console[_0x473c77(0x1ef)]('Target:\x20'+(_0x1efb12?_0x473c77(0x159):_0x473c77(0x178))+'\x20'+_0x213da9),_0x335a6b&&console[_0x473c77(0x1ef)](_0x473c77(0x2ac)+_0x335a6b),_0x3eda26&&console[_0x473c77(0x1ef)](_0x473c77(0x292)+_0x3eda26),_0x3a71d2&&console[_0x473c77(0x1ef)](_0x473c77(0x1aa)+_0x3a71d2),_0x1efccb&&console[_0x473c77(0x1ef)]('Force:\x20yes'));let _0x53bb4d;if(_0x3a71d2)try{if(_0x3a71d2[_0x473c77(0x210)]('@')){const _0x8b89a6=await import(_0x473c77(0x1b4)),_0x29e37a=_0x3a71d2[_0x473c77(0x26b)](0x1),_0x3a846e=await _0x8b89a6['readFile'](_0x29e37a,_0x473c77(0x261));_0x53bb4d=JSON['parse'](_0x3a846e);}else _0x53bb4d=JSON[_0x473c77(0x104)](_0x3a71d2);}catch{return console[_0x473c77(0x1ef)](_0x473c77(0x128)),0x1;}if(!_0x2cc1fe['yes']){if(!isInteractive())return console['error'](a51_0x14a5c4[_0x473c77(0x1ec)](_0x473c77(0x2ad)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x473c77(0x1ef)](a51_0x14a5c4[_0x473c77(0x176)](_0x473c77(0x298))),0x1;const _0x102bf6=await confirmKey(_0x473c77(0x149)+(_0x1efb12?_0x473c77(0x159):_0x473c77(0x178))+'\x20'+_0x213da9+'?');if(!_0x102bf6)return console[_0x473c77(0x1ef)](a51_0x14a5c4[_0x473c77(0x23d)](_0x473c77(0x24f))),0x1;}let _0x425782;_0x1efb12?_0x425782=await withSpinner(_0x473c77(0x202),()=>_0x4a6a9e['workflow'][_0x473c77(0x1c3)](_0x213da9,{'fromTask':_0x335a6b,'retryParams':_0x53bb4d}),{'verbose':_0x2cc1fe[_0x473c77(0x22b)]}):_0x425782=await withSpinner(_0x473c77(0x299),()=>_0x4a6a9e['workflow'][_0x473c77(0x2a9)](_0x213da9,{'resumeFrom':_0x3eda26,'retryParams':_0x53bb4d,'force':_0x1efccb}),{'verbose':_0x2cc1fe[_0x473c77(0x22b)]});const _0x1b458c=_0x425782['data'];return console[_0x473c77(0x1ef)](_0x473c77(0x29a)),console[_0x473c77(0x1ef)](_0x473c77(0x291)+_0x1b458c['attemptId']),console[_0x473c77(0x1ef)](_0x473c77(0x27a)+_0x1b458c[_0x473c77(0x20d)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']='workflow:run';[a51_0x536d3c(0x1cc)]=a51_0x536d3c(0x294);async['execute'](_0x5e895d){const _0x3af708=a51_0x536d3c,{options:_0x25e8b5,args:_0x17b20f,tdx:_0x1067c9}=_0x5e895d;let _0x84d4c6=_0x17b20f[0x0];if(!_0x84d4c6){const _0x10f966=this[_0x3af708(0x10b)]([],_0x25e8b5),_0x2dae2a=await withSpinner(_0x3af708(0x20b),()=>_0x1067c9['workflow']['workflows'](_0x10f966,{'limit':_0x25e8b5['limit']}),{'verbose':_0x25e8b5[_0x3af708(0x22b)]}),_0x749a4e=_0x2dae2a[_0x3af708(0x270)];if(_0x749a4e[_0x3af708(0x224)]===0x0)return console['error'](_0x3af708(0x28d)),!_0x10f966&&console['error'](a51_0x14a5c4[_0x3af708(0x176)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x1ab655=_0x749a4e[_0x3af708(0x147)](_0x39f9ac=>({'title':_0x39f9ac[_0x3af708(0x18d)]?.[_0x3af708(0x279)]+'.'+_0x39f9ac[_0x3af708(0x279)],'value':_0x39f9ac['project']?.[_0x3af708(0x279)]+'.'+_0x39f9ac[_0x3af708(0x279)],'description':_0x39f9ac[_0x3af708(0x172)]?_0x3af708(0x1ff)+_0x39f9ac[_0x3af708(0x172)]:undefined})),_0x2a6d1f=await a51_0x1c7919({'type':'select','name':_0x3af708(0x157),'message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x1ab655});if(!_0x2a6d1f[_0x3af708(0x157)])return 0x1;_0x84d4c6=_0x2a6d1f['workflow'];}if(!_0x84d4c6[_0x3af708(0x229)]('.')){const _0x3db087=this[_0x3af708(0x10b)]([],_0x25e8b5);if(_0x3db087)_0x84d4c6=_0x3db087+'.'+_0x84d4c6;else return console[_0x3af708(0x1ef)](a51_0x14a5c4[_0x3af708(0x1ec)](_0x3af708(0x21d)),_0x3af708(0x1f9)),console[_0x3af708(0x1ef)](a51_0x14a5c4[_0x3af708(0x176)](_0x3af708(0x24a))),0x1;}const _0x419a61=_0x25e8b5[_0x3af708(0x2a4)],_0x1e8820=_0x25e8b5[_0x3af708(0x145)],_0x46c0f2={};if(_0x419a61&&Array[_0x3af708(0x132)](_0x419a61))for(const _0x5950ce of _0x419a61){const _0x1bfe65=_0x5950ce['indexOf']('=');if(_0x1bfe65===-0x1)return console['error'](_0x3af708(0x252)+_0x5950ce),console[_0x3af708(0x1ef)](_0x3af708(0x2b0)),0x1;const _0x1e1f8b=_0x5950ce[_0x3af708(0x26b)](0x0,_0x1bfe65),_0x302c15=_0x5950ce[_0x3af708(0x26b)](_0x1bfe65+0x1);try{_0x46c0f2[_0x1e1f8b]=JSON[_0x3af708(0x104)](_0x302c15);}catch{_0x46c0f2[_0x1e1f8b]=_0x302c15;}}_0x25e8b5[_0x3af708(0x22b)]&&(console[_0x3af708(0x1ef)](_0x3af708(0x1e4)+_0x84d4c6),Object['keys'](_0x46c0f2)['length']>0x0&&console[_0x3af708(0x1ef)](_0x3af708(0x1e0)+JSON[_0x3af708(0x180)](_0x46c0f2)),_0x1e8820&&console[_0x3af708(0x1ef)]('Session\x20time:\x20'+_0x1e8820));const _0x6f95b=await withSpinner(_0x3af708(0x1e6),()=>_0x1067c9[_0x3af708(0x157)][_0x3af708(0x1fb)](_0x84d4c6,_0x46c0f2,{'sessionTime':_0x1e8820}),{'verbose':_0x25e8b5[_0x3af708(0x22b)]}),_0x3d2e48=_0x6f95b[_0x3af708(0x270)];console[_0x3af708(0x1ef)](_0x3af708(0x1ba)),console['error']('\x20\x20Attempt\x20ID:\x20'+_0x3d2e48['id']),console[_0x3af708(0x1ef)](_0x3af708(0x27a)+_0x3d2e48[_0x3af708(0x20d)]),console[_0x3af708(0x1ef)](_0x3af708(0x127)+_0x3d2e48[_0x3af708(0x18d)]?.[_0x3af708(0x279)]),console[_0x3af708(0x1ef)]('\x20\x20Workflow:\x20'+_0x3d2e48[_0x3af708(0x157)]?.['name']);if(_0x3d2e48[_0x3af708(0x18d)]?.['id']&&_0x3d2e48['sessionId']&&_0x3d2e48['id']){const _0x1420de=_0x25e8b5[_0x3af708(0x1a9)],_0x235977=getConsoleUrl(_0x1420de,'/app/workflows/'+_0x3d2e48['project']['id']+_0x3af708(0x287)+_0x3d2e48[_0x3af708(0x20d)]+_0x3af708(0x16f)+_0x3d2e48['id']);console[_0x3af708(0x1ef)](_0x3af708(0x1a0)+a51_0x14a5c4[_0x3af708(0x239)](_0x235977));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a51_0x536d3c(0x279)]=a51_0x536d3c(0x22e);[a51_0x536d3c(0x1cc)]=a51_0x536d3c(0x283);async[a51_0x536d3c(0x179)](_0x1d3780){const _0x4abd36=a51_0x536d3c,{options:_0x4ed274,args:_0x22ed49,tdx:_0x5490be}=_0x1d3780,_0xe5ae0=_0x22ed49[0x0],_0x23ab8d=_0x22ed49[0x1]||'.';if(!_0xe5ae0)return console[_0x4abd36(0x1ef)](_0x4abd36(0x23f)),console[_0x4abd36(0x1ef)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x230e41=_0x4ed274[_0x4abd36(0x172)];_0x4ed274[_0x4abd36(0x22b)]&&(console['error'](_0x4abd36(0x24d)+_0xe5ae0),console['error']('Output\x20directory:\x20'+_0x23ab8d),_0x230e41&&console[_0x4abd36(0x1ef)](_0x4abd36(0x1fe)+_0x230e41));const _0x26755c=await withSpinner(_0x4abd36(0x162)+_0xe5ae0+_0x4abd36(0x1f8),()=>_0x5490be[_0x4abd36(0x157)]['download'](_0xe5ae0,_0x23ab8d,{'revision':_0x230e41}),{'verbose':_0x4ed274[_0x4abd36(0x22b)]}),_0x359c2a=_0x26755c[_0x4abd36(0x270)];return console[_0x4abd36(0x1ef)](_0x4abd36(0x118)+_0x359c2a[_0x4abd36(0x285)]),console[_0x4abd36(0x1ef)](_0x4abd36(0x1b7)+_0x359c2a['revision']),console[_0x4abd36(0x1ef)](_0x4abd36(0x17f)+_0x359c2a['filesExtracted']),console[_0x4abd36(0x1ef)](_0x4abd36(0x1a8)+_0x23ab8d+'/'+_0x359c2a[_0x4abd36(0x285)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a51_0x536d3c(0x279)]=a51_0x536d3c(0x1a3);[a51_0x536d3c(0x1cc)]=a51_0x536d3c(0x15e);async['execute'](_0x39bd91){const _0x22dadf=a51_0x536d3c,{options:_0x385cbf,args:_0x3c1c3b,tdx:_0x23a925}=_0x39bd91;let _0x549fd7='.',_0xa44af9=_0x385cbf[_0x22dadf(0x279)];if(_0x3c1c3b[0x0]){const {promises:_0x2ff6a8}=await import('fs');try{const _0x1ed894=await _0x2ff6a8[_0x22dadf(0x1d9)](_0x3c1c3b[0x0]);if(_0x1ed894[_0x22dadf(0x273)]())_0x549fd7=_0x3c1c3b[0x0];else return console[_0x22dadf(0x1ef)](_0x22dadf(0x135)+_0x3c1c3b[0x0]+_0x22dadf(0x231)),0x1;}catch{_0xa44af9=_0x3c1c3b[0x0],_0x549fd7='.';}}const _0x23cf47=_0x385cbf['revision'],_0x112fce=_0x385cbf[_0x22dadf(0x241)];_0x385cbf[_0x22dadf(0x22b)]&&(console[_0x22dadf(0x1ef)]('Project\x20directory:\x20'+_0x549fd7),_0xa44af9&&console[_0x22dadf(0x1ef)](_0x22dadf(0x13f)+_0xa44af9),_0x23cf47&&console[_0x22dadf(0x1ef)](_0x22dadf(0x1fe)+_0x23cf47),_0x112fce&&console['error'](_0x22dadf(0x14c)));const _0x141e32=await withSpinner(_0x22dadf(0x26e),()=>_0x23a925[_0x22dadf(0x157)]['push'](_0x549fd7,{'projectName':_0xa44af9,'revision':_0x23cf47,'skipValidation':_0x112fce}),{'verbose':_0x385cbf['verbose']}),_0x482a7f=_0x141e32['data'];return console[_0x22dadf(0x1ef)](_0x22dadf(0x187)+_0x482a7f[_0x22dadf(0x285)]),console[_0x22dadf(0x1ef)](_0x22dadf(0x1f6)+_0x482a7f[_0x22dadf(0x153)]),console[_0x22dadf(0x1ef)](_0x22dadf(0x1b7)+_0x482a7f[_0x22dadf(0x172)]),await this[_0x22dadf(0x1b9)](_0x23a925,_0x482a7f[_0x22dadf(0x285)],_0x385cbf[_0x22dadf(0x1a9)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a51_0x536d3c(0x279)]=a51_0x536d3c(0x13b);[a51_0x536d3c(0x1cc)]=a51_0x536d3c(0x1ab);async['execute'](_0x14889d){const _0x1aaf09=a51_0x536d3c,{options:_0x4792e2,args:_0xc1bfb1,tdx:_0x4456bb}=_0x14889d,_0x167b0b=_0xc1bfb1[0x0],_0x484748=_0xc1bfb1[0x1];if(!_0x167b0b)return console['error'](a51_0x14a5c4[_0x1aaf09(0x1ec)]('Error:'),_0x1aaf09(0x1f7)),console[_0x1aaf09(0x1ef)](a51_0x14a5c4['dim']('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x2c3034=_0x4792e2[_0x1aaf09(0x172)];_0x4792e2[_0x1aaf09(0x22b)]&&(console[_0x1aaf09(0x1ef)]('Project:\x20'+_0x167b0b),_0x484748&&console['error'](_0x1aaf09(0x1f3)+_0x484748),_0x2c3034&&console[_0x1aaf09(0x1ef)](_0x1aaf09(0x1fe)+_0x2c3034),_0x4792e2[_0x1aaf09(0x167)]&&console['error'](_0x1aaf09(0x11d)));const _0xf05a80=await withSpinner(_0x1aaf09(0x107)+_0x167b0b+_0x1aaf09(0x1f8),()=>_0x4456bb[_0x1aaf09(0x157)]['pullProject'](_0x167b0b,{'targetDir':_0x484748,'revision':_0x2c3034}),{'verbose':_0x4792e2[_0x1aaf09(0x22b)]}),_0x2c6270=_0xf05a80['data'];_0x2c6270['isNewProject']?console['error'](_0x1aaf09(0x198)+_0x2c6270[_0x1aaf09(0x285)]):console['error'](_0x1aaf09(0x1a2)+_0x2c6270[_0x1aaf09(0x285)]);console['error']('\x20\x20Revision:\x20'+_0x2c6270[_0x1aaf09(0x172)]),console[_0x1aaf09(0x1ef)]('\x20\x20Target:\x20'+(a51_0x16c409[_0x1aaf09(0x12b)](process[_0x1aaf09(0x2ab)](),_0x2c6270[_0x1aaf09(0x1c2)])||'.')),console[_0x1aaf09(0x1ef)](_0x1aaf09(0x156)+a51_0x14a5c4['green']('+'+_0x2c6270['summary'][_0x1aaf09(0x121)]+'\x20new')+',\x20'+(a51_0x14a5c4[_0x1aaf09(0x23d)]('~'+_0x2c6270[_0x1aaf09(0x103)][_0x1aaf09(0x13c)]+'\x20modified')+',\x20')+(a51_0x14a5c4[_0x1aaf09(0x1ec)]('-'+_0x2c6270[_0x1aaf09(0x103)][_0x1aaf09(0x17a)]+_0x1aaf09(0x111))+',\x20')+(''+a51_0x14a5c4[_0x1aaf09(0x176)](_0x2c6270[_0x1aaf09(0x103)][_0x1aaf09(0x2a2)]+'\x20unchanged')));for(const _0x425243 of _0x2c6270[_0x1aaf09(0x190)]){_0x425243['type']===_0x1aaf09(0x13c)&&_0x425243[_0x1aaf09(0x197)]&&(console[_0x1aaf09(0x1ef)]('\x0a'+a51_0x14a5c4[_0x1aaf09(0x239)]('---\x20'+_0x425243['path'])),console['error'](_0x425243[_0x1aaf09(0x197)]));}if(!_0x2c6270[_0x1aaf09(0x122)])return saveSessionContext({'workflow_project':_0x2c6270['projectName']},_0x4792e2[_0x1aaf09(0x159)]),console[_0x1aaf09(0x1ef)](a51_0x14a5c4['green']('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x1aaf09(0x1ef)](a51_0x14a5c4[_0x1aaf09(0x176)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x2c6270[_0x1aaf09(0x285)])),0x0;if(_0x4792e2['dryRun'])return console[_0x1aaf09(0x1ef)](a51_0x14a5c4[_0x1aaf09(0x23d)](_0x1aaf09(0x2aa))),0x0;if(!_0x4792e2[_0x1aaf09(0x195)]){if(!isInteractive())return console[_0x1aaf09(0x1ef)](a51_0x14a5c4[_0x1aaf09(0x1ec)](_0x1aaf09(0x2ad)),_0x1aaf09(0x163)),console[_0x1aaf09(0x1ef)](a51_0x14a5c4['dim'](_0x1aaf09(0x298))),0x1;const _0xc12a91=await confirmKey(_0x1aaf09(0x253));if(!_0xc12a91)return console[_0x1aaf09(0x1ef)](a51_0x14a5c4[_0x1aaf09(0x23d)](_0x1aaf09(0x24f)),_0x1aaf09(0x26f)),0x1;}await withSpinner(_0x1aaf09(0x173),()=>_0x4456bb['workflow'][_0x1aaf09(0x264)](_0x2c6270,{'revision':_0x2c3034}),{'verbose':_0x4792e2[_0x1aaf09(0x22b)]}),saveSessionContext({'workflow_project':_0x2c6270[_0x1aaf09(0x285)]},_0x4792e2['session']),console[_0x1aaf09(0x1ef)](a51_0x14a5c4[_0x1aaf09(0x1a1)](_0x1aaf09(0x21a)));const _0x37bcfe=a51_0x16c409[_0x1aaf09(0x12b)](process['cwd'](),_0x2c6270[_0x1aaf09(0x1c2)])||'.';return console[_0x1aaf09(0x1ef)](a51_0x14a5c4[_0x1aaf09(0x176)](_0x1aaf09(0x1a8)+_0x37bcfe)),console[_0x1aaf09(0x1ef)](a51_0x14a5c4[_0x1aaf09(0x176)](_0x1aaf09(0x27c)+_0x2c6270[_0x1aaf09(0x285)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a51_0x536d3c(0x279)]='workflow:push';[a51_0x536d3c(0x1cc)]=a51_0x536d3c(0x141);async[a51_0x536d3c(0x179)](_0xc648e3){const _0x45fc5d=a51_0x536d3c,{options:_0x515ff6,args:_0xf4377,tdx:_0x182804}=_0xc648e3,_0x40fdc5=this[_0x45fc5d(0x12c)](_0xf4377,_0x515ff6),_0xc81fa5=_0x515ff6[_0x45fc5d(0x172)],_0x536767=_0x515ff6[_0x45fc5d(0x241)];_0x515ff6[_0x45fc5d(0x22b)]&&(_0x40fdc5&&console[_0x45fc5d(0x1ef)]('Source\x20directory:\x20'+_0x40fdc5),_0xc81fa5&&console[_0x45fc5d(0x1ef)](_0x45fc5d(0x1fe)+_0xc81fa5),_0x515ff6[_0x45fc5d(0x167)]&&console['error'](_0x45fc5d(0x11d)),_0x536767&&console['error']('Validation:\x20skipped'));let _0xfaffd0;try{_0xfaffd0=await withSpinner('Analyzing\x20changes...',()=>_0x182804[_0x45fc5d(0x157)][_0x45fc5d(0x1ae)]({'sourceDir':_0x40fdc5,'revision':_0xc81fa5,'skipValidation':_0x536767}),{'verbose':_0x515ff6[_0x45fc5d(0x22b)]});}catch(_0x52e7bf){if(_0x52e7bf instanceof Error&&_0x52e7bf['message'][_0x45fc5d(0x229)](_0x45fc5d(0x1f1)))return console[_0x45fc5d(0x1ef)](a51_0x14a5c4[_0x45fc5d(0x1ec)]('Error:'),_0x45fc5d(0x1d8)),_0x515ff6[_0x45fc5d(0x18e)]?console[_0x45fc5d(0x1ef)](a51_0x14a5c4[_0x45fc5d(0x176)](_0x45fc5d(0x209)+_0x515ff6[_0x45fc5d(0x18e)]+_0x45fc5d(0x142)+_0x515ff6['workflowProject']+'\x27')):console['error'](a51_0x14a5c4['dim']('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x52e7bf;}const _0x225936=_0xfaffd0[_0x45fc5d(0x270)];console[_0x45fc5d(0x1ef)]('✔\x20Project:\x20'+_0x225936[_0x45fc5d(0x285)]),console[_0x45fc5d(0x1ef)](_0x45fc5d(0x1bd)+_0x225936['sourceDir']),console['error'](_0x45fc5d(0x1b7)+_0x225936[_0x45fc5d(0x172)]),console[_0x45fc5d(0x1ef)](_0x45fc5d(0x156)+a51_0x14a5c4['green']('+'+_0x225936[_0x45fc5d(0x103)][_0x45fc5d(0x121)]+'\x20new')+',\x20'+(a51_0x14a5c4['yellow']('~'+_0x225936['summary'][_0x45fc5d(0x13c)]+_0x45fc5d(0x171))+',\x20')+(a51_0x14a5c4[_0x45fc5d(0x1ec)]('-'+_0x225936['summary'][_0x45fc5d(0x17a)]+_0x45fc5d(0x111))+',\x20')+(''+a51_0x14a5c4[_0x45fc5d(0x176)](_0x225936[_0x45fc5d(0x103)][_0x45fc5d(0x2a2)]+'\x20unchanged')));for(const _0x3596fb of _0x225936[_0x45fc5d(0x190)]){_0x3596fb[_0x45fc5d(0x1a5)]===_0x45fc5d(0x13c)&&_0x3596fb[_0x45fc5d(0x197)]&&(console['error']('\x0a'+a51_0x14a5c4[_0x45fc5d(0x239)](_0x45fc5d(0x237)+_0x3596fb[_0x45fc5d(0x27b)])),console[_0x45fc5d(0x1ef)](_0x3596fb[_0x45fc5d(0x197)]));}if(!_0x225936[_0x45fc5d(0x122)])return console[_0x45fc5d(0x1ef)](a51_0x14a5c4[_0x45fc5d(0x1a1)](_0x45fc5d(0x206))),await this['showWorkflowConsoleUrl'](_0x182804,_0x225936[_0x45fc5d(0x285)],_0x515ff6[_0x45fc5d(0x1a9)]),0x0;if(_0x515ff6[_0x45fc5d(0x167)])return console['error'](a51_0x14a5c4[_0x45fc5d(0x23d)](_0x45fc5d(0x1b8))),0x0;if(!_0x515ff6[_0x45fc5d(0x195)]){if(!isInteractive())return console['error'](a51_0x14a5c4[_0x45fc5d(0x1ec)](_0x45fc5d(0x2ad)),_0x45fc5d(0x163)),console[_0x45fc5d(0x1ef)](a51_0x14a5c4[_0x45fc5d(0x176)](_0x45fc5d(0x298))),0x1;const _0x1d577d=await confirmKey(_0x45fc5d(0x1e2));if(!_0x1d577d)return console[_0x45fc5d(0x1ef)](a51_0x14a5c4[_0x45fc5d(0x23d)](_0x45fc5d(0x24f)),_0x45fc5d(0x205)),0x1;}const _0x36c274=await withSpinner(_0x45fc5d(0x105),()=>_0x182804[_0x45fc5d(0x157)][_0x45fc5d(0x119)](_0x225936),{'verbose':_0x515ff6[_0x45fc5d(0x22b)]}),_0x723531=_0x36c274[_0x45fc5d(0x270)];return console[_0x45fc5d(0x1ef)](a51_0x14a5c4[_0x45fc5d(0x1a1)](_0x45fc5d(0x218))),console[_0x45fc5d(0x1ef)](_0x45fc5d(0x1f6)+_0x723531['projectId']),console[_0x45fc5d(0x1ef)]('\x20\x20Revision:\x20'+_0x723531['revision']),await this[_0x45fc5d(0x1b9)](_0x182804,_0x723531['projectName'],_0x515ff6[_0x45fc5d(0x1a9)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a51_0x536d3c(0x279)]='workflow:clone';[a51_0x536d3c(0x1cc)]=a51_0x536d3c(0x289);async[a51_0x536d3c(0x179)](_0x115548){const _0x35893d=a51_0x536d3c,{options:_0x5f403c,args:_0x501488,tdx:_0xdcd22d}=_0x115548,_0x505664=this[_0x35893d(0x12c)](_0x501488,_0x5f403c),_0x41f3a7=_0x5f403c[_0x35893d(0x279)],_0x418597=_0x5f403c[_0x35893d(0x172)],_0x2ca96a=_0x5f403c['skipValidation'];if(!_0x505664)return console[_0x35893d(0x1ef)](a51_0x14a5c4[_0x35893d(0x1ec)]('Error:'),_0x35893d(0x175)),console['error'](a51_0x14a5c4[_0x35893d(0x176)](_0x35893d(0x212))),console[_0x35893d(0x1ef)](a51_0x14a5c4[_0x35893d(0x176)](_0x35893d(0x240))),0x1;if(!_0x41f3a7)return console[_0x35893d(0x1ef)](a51_0x14a5c4[_0x35893d(0x1ec)](_0x35893d(0x21d)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console['error'](a51_0x14a5c4[_0x35893d(0x176)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x5f403c[_0x35893d(0x22b)]&&(console['error'](_0x35893d(0x1c1)+_0x505664),console[_0x35893d(0x1ef)](_0x35893d(0x25c)+_0x41f3a7),_0x418597&&console['error']('Revision:\x20'+_0x418597),_0x5f403c[_0x35893d(0x167)]&&console[_0x35893d(0x1ef)](_0x35893d(0x11d)),_0x2ca96a&&console[_0x35893d(0x1ef)](_0x35893d(0x14c)));const _0x2a8dbb=await withSpinner(_0x35893d(0x245),()=>_0xdcd22d['workflow'][_0x35893d(0x189)](_0x505664,_0x41f3a7,{'revision':_0x418597,'skipValidation':_0x2ca96a}),{'verbose':_0x5f403c['verbose']}),_0x251e9e=_0x2a8dbb[_0x35893d(0x270)];console[_0x35893d(0x1ef)](_0x35893d(0x1d2)+_0x251e9e[_0x35893d(0x143)]);_0x251e9e[_0x35893d(0x1e5)]&&console['error'](_0x35893d(0x12e)+_0x251e9e[_0x35893d(0x1e5)]);console['error'](_0x35893d(0x25c)+_0x251e9e[_0x35893d(0x20c)]),console[_0x35893d(0x1ef)](_0x35893d(0x1fe)+_0x251e9e[_0x35893d(0x172)]),console[_0x35893d(0x1ef)](_0x35893d(0x1b1)+_0x251e9e[_0x35893d(0x230)]);_0x251e9e[_0x35893d(0x1ad)]&&(console[_0x35893d(0x1ef)](a51_0x14a5c4[_0x35893d(0x23d)](_0x35893d(0x18c)+_0x251e9e[_0x35893d(0x20c)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x251e9e[_0x35893d(0x1fd)]+')')),console[_0x35893d(0x1ef)](a51_0x14a5c4[_0x35893d(0x23d)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x5f403c[_0x35893d(0x167)])return console[_0x35893d(0x1ef)](a51_0x14a5c4[_0x35893d(0x23d)](_0x35893d(0x1fc))),0x0;if(!_0x5f403c[_0x35893d(0x195)]){if(!isInteractive())return console['error'](a51_0x14a5c4[_0x35893d(0x1ec)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x35893d(0x1ef)](a51_0x14a5c4[_0x35893d(0x176)](_0x35893d(0x298))),0x1;const _0x21bbbd=_0x251e9e['sourceProjectName']||a51_0x16c409[_0x35893d(0x10a)](_0x505664),_0xf0b328=_0x251e9e['targetExists']?_0x35893d(0x293)+_0x41f3a7+_0x35893d(0x181):'\x0aClone\x20\x22'+_0x21bbbd+_0x35893d(0x219)+_0x41f3a7+'\x22?',_0x3d21d8=await confirmKey(_0xf0b328);if(!_0x3d21d8)return console[_0x35893d(0x1ef)](a51_0x14a5c4[_0x35893d(0x23d)]('Cancelled')),0x1;}const _0x362b4e=await withSpinner(_0x251e9e['targetExists']?_0x35893d(0x16c)+_0x41f3a7+_0x35893d(0x1f8):_0x35893d(0x262)+_0x41f3a7+_0x35893d(0x1f8),()=>_0xdcd22d[_0x35893d(0x157)][_0x35893d(0x267)](_0x251e9e),{'verbose':_0x5f403c[_0x35893d(0x22b)]}),_0x5b9330=_0x362b4e[_0x35893d(0x270)];return console['error'](a51_0x14a5c4[_0x35893d(0x1a1)](_0x251e9e[_0x35893d(0x1ad)]?'✔\x20Project\x20updated':_0x35893d(0x177))),console[_0x35893d(0x1ef)]('\x20\x20Project:\x20'+_0x5b9330['newProjectName']),console[_0x35893d(0x1ef)]('\x20\x20Project\x20ID:\x20'+_0x5b9330['newProjectId']),console[_0x35893d(0x1ef)]('\x20\x20Revision:\x20'+_0x5b9330[_0x35893d(0x172)]),await this[_0x35893d(0x1b9)](_0xdcd22d,_0x5b9330[_0x35893d(0x20c)],_0x5f403c['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a51_0x536d3c(0x279)]=a51_0x536d3c(0x21b);[a51_0x536d3c(0x1cc)]=a51_0x536d3c(0x16b);async[a51_0x536d3c(0x179)](_0x50b39b){const _0x4540f5=a51_0x536d3c,{options:_0x1a8d27,args:_0x25c6eb,tdx:_0x36ceb6}=_0x50b39b,_0x327712=_0x25c6eb[0x0];if(!_0x327712)return console[_0x4540f5(0x1ef)](_0x4540f5(0x1e8)),console[_0x4540f5(0x1ef)](_0x4540f5(0x1cb)),0x1;_0x1a8d27[_0x4540f5(0x22b)]&&console[_0x4540f5(0x1ef)]('Project:\x20'+_0x327712);if(!_0x1a8d27[_0x4540f5(0x195)]){if(!isInteractive())return console['error'](a51_0x14a5c4[_0x4540f5(0x1ec)](_0x4540f5(0x2ad)),_0x4540f5(0x163)),console[_0x4540f5(0x1ef)](a51_0x14a5c4[_0x4540f5(0x176)](_0x4540f5(0x298))),0x1;const _0x4635a9=await confirmKey(_0x4540f5(0x19b)+_0x327712+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x4635a9)return console[_0x4540f5(0x1ef)](a51_0x14a5c4[_0x4540f5(0x23d)](_0x4540f5(0x24f))),0x1;}const _0x50c8b6=await withSpinner(_0x4540f5(0x10f)+_0x327712+_0x4540f5(0x1f8),()=>_0x36ceb6['workflow']['delete'](_0x327712),{'verbose':_0x1a8d27[_0x4540f5(0x22b)]}),_0x5cc121=_0x50c8b6[_0x4540f5(0x270)];return console[_0x4540f5(0x1ef)](_0x4540f5(0x203)+_0x5cc121['projectName']),console['error'](_0x4540f5(0x1f6)+_0x5cc121[_0x4540f5(0x153)]),0x0;}}export function parseKeyValue(_0xe6ec00){const _0x3d4427=a51_0x536d3c,_0x1d6881=_0xe6ec00[_0x3d4427(0x2a7)]('=');if(_0x1d6881===-0x1)throw new Error('Invalid\x20format:\x20'+_0xe6ec00+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x20f16e=_0xe6ec00[_0x3d4427(0x26b)](0x0,_0x1d6881),_0x1fbbed=_0xe6ec00[_0x3d4427(0x26b)](_0x1d6881+0x1);if(!_0x20f16e)throw new Error(_0x3d4427(0x26a));return{'key':_0x20f16e,'value':_0x1fbbed};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a51_0x536d3c(0x279)]=a51_0x536d3c(0x201);[a51_0x536d3c(0x1cc)]=a51_0x536d3c(0x254);async['execute'](_0x1e8cd1){const _0xcec644=a51_0x536d3c,{options:_0x17a00a,args:_0x126ba7,tdx:_0x560792}=_0x1e8cd1,_0x2f32c5=this[_0xcec644(0x13a)](_0x126ba7,_0x17a00a);if(!_0x2f32c5)return 0x1;_0x17a00a[_0xcec644(0x22b)]&&console[_0xcec644(0x1ef)](_0xcec644(0x24d)+_0x2f32c5);const _0x1ae331=await withSpinner(_0xcec644(0x124),()=>_0x560792['workflow'][_0xcec644(0x242)](_0x2f32c5),{'verbose':_0x17a00a[_0xcec644(0x22b)]}),{secrets:_0x1c5aa4}=_0x1ae331['data'];return console['error'](_0xcec644(0x17d)+_0x1c5aa4[_0xcec644(0x224)]+_0xcec644(0x15b)+(_0x1c5aa4['length']!==0x1?'s':'')),await handleSDKOutput(_0x1c5aa4,_0x17a00a),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a51_0x536d3c(0x2a8);[a51_0x536d3c(0x1cc)]=a51_0x536d3c(0x227);async[a51_0x536d3c(0x179)](_0x5bfc4d){const _0x23feb0=a51_0x536d3c,{options:_0x2ef62d,args:_0x107495,tdx:_0x57f50e}=_0x5bfc4d;let _0x2b8247,_0x32bd06;if(_0x107495[_0x23feb0(0x224)]>=0x1&&!_0x107495[0x0][_0x23feb0(0x229)]('='))_0x2b8247=_0x107495[0x0],_0x32bd06=_0x107495[_0x23feb0(0x1ea)](0x1);else{if(_0x107495[_0x23feb0(0x224)]>=0x1&&_0x2ef62d[_0x23feb0(0x18e)])_0x2b8247=_0x2ef62d[_0x23feb0(0x18e)],_0x32bd06=_0x107495;else return _0x107495[_0x23feb0(0x224)]>=0x1?(console['error'](_0x23feb0(0x23f)),console[_0x23feb0(0x1ef)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x23feb0(0x1ef)](_0x23feb0(0x278)),console['error'](_0x23feb0(0x27d)),0x1);}if(_0x32bd06[_0x23feb0(0x224)]===0x0)return console[_0x23feb0(0x1ef)](_0x23feb0(0x278)),console['error'](_0x23feb0(0x27d)),0x1;const _0x2f8560={};try{for(const _0x2e3bc8 of _0x32bd06){const {key:_0xf16392,value:_0xd00cdc}=parseKeyValue(_0x2e3bc8);_0x2f8560[_0xf16392]=_0xd00cdc;}}catch(_0x479af8){return _0x479af8 instanceof Error&&console[_0x23feb0(0x1ef)](a51_0x14a5c4['red'](_0x23feb0(0x21d)),_0x479af8[_0x23feb0(0x129)]),0x1;}const _0xfa2d31=Object['keys'](_0x2f8560);_0x2ef62d[_0x23feb0(0x22b)]&&(console[_0x23feb0(0x1ef)](_0x23feb0(0x24d)+_0x2b8247),console[_0x23feb0(0x1ef)](_0x23feb0(0x217)+_0xfa2d31[_0x23feb0(0x1f2)](',\x20')));const _0x3f483c=await withSpinner(_0xfa2d31[_0x23feb0(0x224)]===0x1?_0x23feb0(0x29e):_0x23feb0(0x20f)+_0xfa2d31['length']+_0x23feb0(0x26d),()=>_0x57f50e[_0x23feb0(0x157)]['setSecrets'](_0x2b8247,_0x2f8560),{'verbose':_0x2ef62d[_0x23feb0(0x22b)]}),_0x3a676e=_0x3f483c[_0x23feb0(0x270)];return console[_0x23feb0(0x1ef)](_0xfa2d31['length']===0x1?_0x23feb0(0x1a4)+_0x3a676e['keys'][0x0]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x3a676e[_0x23feb0(0x285)]+'\x27':'✔\x20'+_0x3a676e['keys']['length']+_0x23feb0(0x14a)+_0x3a676e[_0x23feb0(0x285)]+'\x27'),(_0x2ef62d['json']||_0x2ef62d[_0x23feb0(0x1da)])&&await handleSingleObjectOutput(_0x3a676e,_0x2ef62d),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a51_0x536d3c(0x18b);[a51_0x536d3c(0x1cc)]=a51_0x536d3c(0x154);async[a51_0x536d3c(0x179)](_0x23efa5){const _0x4a798=a51_0x536d3c,{options:_0x5d61b8,args:_0x3a39c7,tdx:_0x1120fc}=_0x23efa5;let _0x279332,_0x5dad75;if(_0x3a39c7[_0x4a798(0x224)]>=0x2)_0x279332=_0x3a39c7[0x0],_0x5dad75=_0x3a39c7[0x1];else{if(_0x3a39c7[_0x4a798(0x224)]===0x1&&_0x5d61b8[_0x4a798(0x18e)])_0x279332=_0x5d61b8[_0x4a798(0x18e)],_0x5dad75=_0x3a39c7[0x0];else return _0x3a39c7[_0x4a798(0x224)]===0x1?(console[_0x4a798(0x1ef)](_0x4a798(0x23f)),console[_0x4a798(0x1ef)](_0x4a798(0x24a)),0x1):(console[_0x4a798(0x1ef)](_0x4a798(0x26c)),console[_0x4a798(0x1ef)](_0x4a798(0x22d)),0x1);}_0x5d61b8[_0x4a798(0x22b)]&&(console[_0x4a798(0x1ef)](_0x4a798(0x24d)+_0x279332),console[_0x4a798(0x1ef)](_0x4a798(0x123)+_0x5dad75));if(!_0x5d61b8[_0x4a798(0x195)]){if(!isInteractive())return console[_0x4a798(0x1ef)](a51_0x14a5c4[_0x4a798(0x1ec)](_0x4a798(0x2ad)),_0x4a798(0x163)),console[_0x4a798(0x1ef)](a51_0x14a5c4[_0x4a798(0x176)](_0x4a798(0x298))),0x1;const _0x395d74=await confirmKey(_0x4a798(0x140)+_0x5dad75+_0x4a798(0x249)+_0x279332+'\x27?');if(!_0x395d74)return console[_0x4a798(0x1ef)](a51_0x14a5c4[_0x4a798(0x23d)]('Cancelled')),0x1;}const _0x1e4292=await withSpinner(_0x4a798(0x269),()=>_0x1120fc['workflow']['deleteSecret'](_0x279332,_0x5dad75),{'verbose':_0x5d61b8['verbose']}),_0x2fcb8d=_0x1e4292[_0x4a798(0x270)];return console['error']('✔\x20Secret\x20\x27'+_0x2fcb8d[_0x4a798(0x12a)]+_0x4a798(0x21e)+_0x2fcb8d['projectName']+'\x27'),(_0x5d61b8[_0x4a798(0x1f5)]||_0x5d61b8['jsonl'])&&await handleSingleObjectOutput(_0x2fcb8d,_0x5d61b8),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 a51_0x1fdd(){const _0x277474=['startTime','projects','\x27\x20from\x20project\x20\x27','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','round','getDate','Project:\x20','select','Cancelled','fileSize','\x20project','Error:\x20Invalid\x20parameter\x20format:\x20','\x0aApply\x20these\x20changes?','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Listing\x20workflow\x20sessions...','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','task','\x1b[1A\x1b[2K','some','renderSingleTimeline','\x27...','New\x20project\x20name:\x20','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','POLL_INTERVAL_MS','\x0a✔\x20Attempt\x20complete','Usage:\x20tdx\x20wf\x20use\x20<project>','utf-8','Cloning\x20to\x20','📋\x20','applyPullProject','3SZqiJd','(use\x20--limit\x20to\x20see\x20more)','executeCloneProject','trimEnd','Deleting\x20secret...','Key\x20cannot\x20be\x20empty','substring','Error:\x20Secret\x20key\x20is\x20required','\x20secrets...','Pushing\x20workflow\x20project...','-\x20no\x20files\x20written','data','Attempt:\x20','repeat','isDirectory','LABEL_WIDTH_DIVISOR','all','renderTimeline','now','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','name','\x20\x20Session\x20ID:\x20','path','\x20\x20Session\x20context\x20set\x20to:\x20','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','ICON_WIDTH','Attempt\x20ID:\x20','blue','List\x20workflows','workflow:timeline','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','projectName','Filter:\x20project=','/sessions/','finishedAt','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','min','No\x20projects\x20match\x20pattern:\x20','floor','No\x20workflows\x20found','Warning:','splice','getMonth','\x20\x20New\x20attempt\x20ID:\x20','Resume\x20from:\x20','\x0aUpdate\x20existing\x20project\x20\x22','Start\x20a\x20workflow\x20run','\x20(use\x20--limit\x20to\x20show\x20more)','value','kill','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Retrying\x20attempt...','✔\x20Retry\x20started','\x20logs','workflowName','log','Setting\x20secret...','keys','Auto-selected\x20latest\x20session:\x20','2729344iHKUtI','unchanged','workflow:attempt','param','workflow:kill','No\x20workflow\x20sessions\x20found','indexOf','workflow:secrets:set','retryAttempt','\x0aDry\x20run\x20-\x20no\x20files\x20written','cwd','From\x20task:\x20','\x0aError:','fromTask','Show\x20specific\x20attempt\x20details','Expected\x20format:\x20--param\x20key=value','No\x20attempts\x20found\x20for:\x20','navigateSessionsInteractive','Session\x20','summary','parse','Pushing\x20project...','has','Pulling\x20project\x20','index','toISOString','basename','resolveProject','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','List\x20workflow\x20attempts','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Deleting\x20project\x20','Show\x20logs\x20for\x20a\x20workflow\x20attempt','\x20deleted','from','MIN_TIMELINE_WIDTH','fill','done','3957492rriZZs','workflows','✔\x20Downloaded\x20','executePushProject','match','autocomplete','tasks','Dry\x20run:\x20yes','follow','state','table','new','hasChanges','Key:\x20','Listing\x20secrets...','📁\x20','Getting\x20attempt\x20details...','\x20\x20Project:\x20','Error:\x20Invalid\x20JSON\x20in\x20--params','message','key','relative','resolveProjectDir','group_error','Source\x20project:\x20','end','msPerChar','Pattern:\x20','isArray','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','workflow:projects','Error:\x20','tdx.json','5166300yBavMG','GUTTER','1LKopxV','requireProject','workflow:pull','modified','canceling','push','Project\x20name:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','sourceDir','limit','sessionTime','logFiles','map','🔄\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','\x20secrets\x20set\x20for\x20project\x20\x27','\x20to\x20see\x20detailed\x20logs','Validation:\x20skipped','Listing\x20workflow\x20projects...','Loading\x20session...','toLowerCase','format','set','unknown','projectId','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','resumeFrom','\x20\x20Changes:\x20','workflow','\x20\x20tdx\x20wf\x20use\x20<project>','session','split','\x20secret','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','buildTimelineData','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','pollTimeline','retryAttemptName','sys','Downloading\x20project\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','fullName','\x20from\x20session\x20','No\x20sessions\x20found\x20in\x20project:\x20','dryRun','output','replace','Task\x20name:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Updating\x20','metadata','filter','/attempt/','Project\x20filter:\x20','\x20modified','revision','Writing\x20files...','\x0aPolling...\x20(','Source\x20directory\x20is\x20required','dim','✔\x20Clone\x20complete','attempt','execute','deleted','No\x20sessions\x20found\x20for:\x20','\x0aFailed\x20to\x20fetch\x20attempt\x20data','✔\x20Found\x20','force','\x20\x20Files\x20extracted:\x20','stringify','\x22\x20with\x20new\x20revision?','Error:\x20Attempt\x20ID\x20is\x20required','\x20(system)','10OpqxGg','Resolving\x20project\x20\x27','start','✔\x20Pushed\x20','\x20-\x20','prepareCloneProject','workflow:attempts','workflow:secrets:delete','\x0a⚠\x20Project\x20\x22','project','workflowProject','clear','changes','white','pending','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','values','yes','localeCompare','diff','→\x20New\x20project:\x20','get','Status:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','running','No\x20log\x20content\x20found','workflow:tasks','padStart','\x20\x20Console:\x20','green','→\x20Project:\x20','workflow:upload','✔\x20Secret\x20\x27','type','Reason:\x20','Show\x20tasks\x20for\x20an\x20attempt','\x20\x20Location:\x20','site','Params:\x20','Pull\x20workflow\x20project\x20to\x20local\x20folder','1887324cbsknl','targetExists','preparePushProject','✔\x20Workflow\x20project\x20context\x20cleared.','duration','Files\x20to\x20upload:\x20','No\x20workflow\x20projects\x20found','session_id','fs/promises','columns','MAX_LABEL_COUNT','\x20\x20Revision:\x20','\x0aDry\x20run\x20-\x20nothing\x20pushed','showWorkflowConsoleUrl','✔\x20Workflow\x20run\x20started','Loading\x20sessions...','getHours','\x20\x20Source:\x20','rows','getFullYear','Select\x20a\x20task\x20to\x20view\x20logs:','Source\x20directory:\x20','targetDir','retrySession','lastAttempt','getTime','params','\x20task','every','startedAt','\x20of\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','description','parseProjectWorkflowPattern','List\x20workflow\x20execution\x20sessions','cancelRequested','renderSessionsTimeline','generateSessionTimelineRows','Source:\x20','\x20session','size','attemptId','MAX_POLL_ITERATIONS','Kill\x20a\x20running\x20attempt','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','stat','jsonl','MAX_TIMELINE_WIDTH','Latest\x20session\x20has\x20no\x20attempt','MIN_LABEL_COUNT','resolve','LABEL_MIN_SPACING','Parameters:\x20','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','\x0aPush\x20these\x20changes?','durationMs','Workflow:\x20','sourceProjectName','Starting\x20workflow\x20run...','updatedAt','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','createdAt','slice','sort','red','212590ITNUYD','No\x20matching\x20sessions\x20found','error','trim','No\x20workflow\x20tdx.json\x20found','join','Target\x20directory:\x20','status','json','\x20\x20Project\x20ID:\x20','Project\x20name\x20is\x20required','...','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','find','run','\x0aDry\x20run\x20-\x20no\x20project\x20created','existingProjectId','Revision:\x20','revision:\x20','write','workflow:secrets:list','Retrying\x20session...','✔\x20Deleted\x20project\x20','Filter:\x20','-\x20nothing\x20pushed','\x0a✔\x20No\x20changes\x20to\x20push','window','(unknown)','Tip:\x20cd\x20to\x20workflows/','✔\x20Workflow\x20project\x20set\x20to:\x20','Loading\x20workflows...','newProjectName','sessionId','\x20workflow','Setting\x20','startsWith','workflow:use','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','workflow:retry','text','11CqIeqk','Including\x20subtasks:\x20yes','Secrets\x20to\x20set:\x20','✔\x20Push\x20complete','\x22\x20to\x20new\x20project\x20\x22','✔\x20Pull\x20complete','workflow:delete','context','Error:','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','MAX_TASKS_DISPLAY','planned','includeRetried','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','81412rSvtGp','length','max','207BiDLnT','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','List\x20all\x20workflow\x20projects','includes','No\x20sessions\x20with\x20timing\x20information','verbose','icon','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','workflow:download','stdout','fileCount','\x20is\x20not\x20a\x20directory','No\x20sessions\x20found','workflow:workflows','Listing\x20workflows...','getMinutes','1737728bGvEor','---\x20','success','cyan','session:','isTTY','Total:\x20','yellow','list','Error:\x20Project\x20name\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','skipValidation','listSecrets','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','ICON_SPACING','Analyzing\x20project...','Getting\x20attempt\x20tasks...'];a51_0x1fdd=function(){return _0x277474;};return a51_0x1fdd();}function formatElapsed(_0x5e2736){const _0x2ba298=a51_0x536d3c,_0x41c455=Math[_0x2ba298(0x28c)](_0x5e2736/0x3e8),_0x1cada6=Math[_0x2ba298(0x28c)](_0x41c455/0x3c),_0x24f779=Math[_0x2ba298(0x28c)](_0x1cada6/0x3c),_0x1aaab3=Math[_0x2ba298(0x28c)](_0x24f779/0x18);if(_0x1aaab3>0x0){const _0x20d498=_0x24f779%0x18;return _0x20d498>0x0?_0x1aaab3+'d\x20'+_0x20d498+'h':_0x1aaab3+'d';}else{if(_0x24f779>0x0){const _0xaed062=_0x1cada6%0x3c;return _0xaed062>0x0?_0x24f779+'h\x20'+_0xaed062+'m':_0x24f779+'h';}else{if(_0x1cada6>0x0){const _0x377254=_0x41c455%0x3c;return _0x377254>0x0?_0x1cada6+'m\x20'+_0x377254+'s':_0x1cada6+'m';}else return _0x41c455+'s';}}}function formatTimestamp(_0x12d924,_0x800e72){const _0x12341d=a51_0x536d3c,_0x50d23e=new Date(_0x12d924),_0x424071=String(_0x50d23e[_0x12341d(0x1bc)]())[_0x12341d(0x19f)](0x2,'0'),_0x5ec4bd=String(_0x50d23e[_0x12341d(0x235)]())[_0x12341d(0x19f)](0x2,'0'),_0x24d9c4=_0x424071+':'+_0x5ec4bd,_0x2a6b20=_0x50d23e[_0x12341d(0x1bf)]()===_0x800e72['getFullYear']()&&_0x50d23e[_0x12341d(0x290)]()===_0x800e72[_0x12341d(0x290)]()&&_0x50d23e[_0x12341d(0x24c)]()===_0x800e72[_0x12341d(0x24c)]();if(_0x2a6b20)return _0x24d9c4;else{const _0x45c540=String(_0x50d23e[_0x12341d(0x290)]()+0x1)['padStart'](0x2,'0'),_0x38fad7=String(_0x50d23e[_0x12341d(0x24c)]())['padStart'](0x2,'0');return _0x45c540+'-'+_0x38fad7+'\x20'+_0x24d9c4;}}function formatDate(_0x5507c4){const _0x33a235=a51_0x536d3c,_0x139a6c=_0x5507c4[_0x33a235(0x1bf)](),_0x444f02=String(_0x5507c4[_0x33a235(0x290)]()+0x1)[_0x33a235(0x19f)](0x2,'0'),_0x382192=String(_0x5507c4[_0x33a235(0x24c)]())[_0x33a235(0x19f)](0x2,'0');return _0x139a6c+'-'+_0x444f02+'-'+_0x382192;}function getTaskStateIcon(_0x29b1c5){const _0x1cea4e={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x1cea4e[_0x29b1c5]||'⚪';}function a51_0x458b(_0x547b9e,_0x3dcc9b){_0x547b9e=_0x547b9e-0x101;const _0x1fdd2f=a51_0x1fdd();let _0x458b22=_0x1fdd2f[_0x547b9e];return _0x458b22;}function getBarChar(_0x132e8a){const _0x3c98ae=a51_0x536d3c;return _0x132e8a==='error'||_0x132e8a===_0x3c98ae(0x12d)?'×':'─';}function getBarColor(_0x377f2d){const _0x187fcd=a51_0x536d3c,_0x30cab0={'success':a51_0x14a5c4['green'],'error':a51_0x14a5c4[_0x187fcd(0x1ec)],'group_error':a51_0x14a5c4['red'],'running':a51_0x14a5c4['blue'],'blocked':a51_0x14a5c4['yellow'],'planned':a51_0x14a5c4['dim'],'canceling':a51_0x14a5c4[_0x187fcd(0x23d)]};return _0x30cab0[_0x377f2d]||a51_0x14a5c4[_0x187fcd(0x191)];}function parseTaskName(_0xca3909){const _0x25d6c8=a51_0x536d3c;let _0x3294ff=_0xca3909[_0x25d6c8(0x169)](/^\++/,'');const _0x310820=_0x3294ff[_0x25d6c8(0x15a)]('+'),_0x5a052c=_0x310820[_0x25d6c8(0x224)]>0x1?_0x310820[_0x25d6c8(0x224)]-0x2:0x0,_0x9f509d=_0x310820[_0x310820[_0x25d6c8(0x224)]-0x1]||_0x3294ff;return{'level':_0x5a052c,'name':'+'+_0x9f509d};}function truncateTaskName(_0x14ae0c,_0x2b2111){const _0x5832ca=a51_0x536d3c,_0x364f69=stringWidth(_0x14ae0c);if(_0x364f69<=_0x2b2111)return _0x14ae0c;let _0x14cb21=_0x14ae0c;while(stringWidth(_0x14cb21+'…')>_0x2b2111&&_0x14cb21['length']>0x0){_0x14cb21=_0x14cb21[_0x5832ca(0x1ea)](0x0,-0x1);}return _0x14cb21+'…';}function calculateTimeScale(_0xd6eb31,_0x349d3b){const _0x53ad9d=a51_0x536d3c;return{'startTime':_0xd6eb31[_0x53ad9d(0x186)],'endTime':_0xd6eb31[_0x53ad9d(0x12f)],'durationMs':_0xd6eb31[_0x53ad9d(0x1b0)],'msPerChar':_0xd6eb31[_0x53ad9d(0x1b0)]/_0x349d3b};}function timeToPosition(_0x46a62a,_0x534b8b,_0x320860){const _0x2ff9b4=a51_0x536d3c,_0x9b906=_0x46a62a-_0x534b8b[_0x2ff9b4(0x247)],_0x5cd688=Math[_0x2ff9b4(0x28c)](_0x9b906/_0x534b8b[_0x2ff9b4(0x130)]);return Math[_0x2ff9b4(0x225)](0x0,Math['min'](_0x5cd688,_0x320860));}function renderTimeAxis(_0x588883,_0x40eecc){const _0x14f478=a51_0x536d3c,_0x23f8c0=Math[_0x14f478(0x28a)](TIMELINE_CONFIG[_0x14f478(0x1b6)],Math['max'](TIMELINE_CONFIG[_0x14f478(0x1dd)],Math[_0x14f478(0x28c)](_0x40eecc/TIMELINE_CONFIG[_0x14f478(0x274)]))),_0x3bb9ee=_0x588883[_0x14f478(0x1e3)]/(_0x23f8c0-0x1),_0x3231dd=new Date(_0x588883[_0x14f478(0x247)]),_0x158a04=[];for(let _0x165c27=0x0;_0x165c27<_0x23f8c0;_0x165c27++){const _0x15e884=_0x588883[_0x14f478(0x247)]+_0x165c27*_0x3bb9ee,_0x5b9ad1=timeToPosition(_0x15e884,_0x588883,_0x40eecc),_0x2c869a=formatTimestamp(_0x15e884,_0x3231dd);_0x158a04[_0x14f478(0x13e)]({'pos':_0x5b9ad1,'text':_0x2c869a});}const _0x174145=new Array(_0x40eecc)[_0x14f478(0x114)]('\x20');let _0x5d637d=-0x1;for(const {pos:_0x28349a,text:_0x3cd6b4}of _0x158a04){let _0x586b1d=Math['max'](0x0,_0x28349a-Math[_0x14f478(0x28c)](_0x3cd6b4['length']/0x2));_0x586b1d<=_0x5d637d+TIMELINE_CONFIG[_0x14f478(0x1df)]&&(_0x586b1d=_0x5d637d+TIMELINE_CONFIG[_0x14f478(0x1df)]+0x1);_0x586b1d+_0x3cd6b4[_0x14f478(0x224)]>_0x40eecc&&(_0x586b1d=_0x40eecc-_0x3cd6b4[_0x14f478(0x224)]);if(_0x586b1d>=0x0&&_0x586b1d+_0x3cd6b4[_0x14f478(0x224)]<=_0x40eecc&&_0x586b1d>_0x5d637d){for(let _0x39a51d=0x0;_0x39a51d<_0x3cd6b4[_0x14f478(0x224)];_0x39a51d++){_0x174145[_0x586b1d+_0x39a51d]=_0x3cd6b4[_0x39a51d];}_0x5d637d=_0x586b1d+_0x3cd6b4[_0x14f478(0x224)]-0x1;}}return _0x174145[_0x14f478(0x1f2)]('');}function renderTaskRow(_0x27f941,_0x4f2612,_0x1891f2,_0x1552cb){const _0x441aa1=a51_0x536d3c,{level:_0x2857ef,name:_0x361ecc}=parseTaskName(_0x27f941['name']),_0x123c37='\x20'['repeat'](_0x2857ef),_0x1ac555=_0x27f941['window']?'('+formatElapsed(_0x27f941['window'][_0x441aa1(0x1b0)])+')':'',_0x3a21ae=stringWidth(_0x1ac555),_0x15f947=_0x2857ef*0x1,_0x490db4=_0x1552cb-_0x15f947-_0x3a21ae-0x1,_0x4dec34=truncateTaskName(_0x361ecc,_0x490db4),_0x28059e=_0x123c37+_0x4dec34,_0x320b0a=stringWidth(_0x28059e),_0x49eea1=_0x1552cb-_0x320b0a-_0x3a21ae,_0x2073ff=_0x28059e+'\x20'[_0x441aa1(0x272)](Math[_0x441aa1(0x225)](0x1,_0x49eea1))+a51_0x14a5c4['dim'](_0x1ac555),_0x4febe2=getTaskStateIcon(_0x27f941['state']),_0x419322=new Array(_0x1891f2)['fill']('\x20');if(_0x27f941[_0x441aa1(0x207)]){const _0x463880=timeToPosition(_0x27f941[_0x441aa1(0x207)][_0x441aa1(0x186)],_0x4f2612,_0x1891f2),_0x219511=timeToPosition(_0x27f941[_0x441aa1(0x207)][_0x441aa1(0x12f)],_0x4f2612,_0x1891f2),_0x527fdf=getBarChar(_0x27f941[_0x441aa1(0x11f)]),_0x289778=Math[_0x441aa1(0x225)](_0x463880+0x1,_0x219511);for(let _0x184914=_0x463880;_0x184914<Math[_0x441aa1(0x28a)](_0x289778,_0x1891f2);_0x184914++){_0x419322[_0x184914]=_0x527fdf;}}const _0x2e1e0f=getBarColor(_0x27f941[_0x441aa1(0x11f)]),_0x48ee9a=_0x419322[_0x441aa1(0x147)](_0x1cc7fc=>_0x1cc7fc==='\x20'?'\x20':_0x2e1e0f(_0x1cc7fc))[_0x441aa1(0x1f2)]('');return _0x4febe2+'\x20'+_0x2073ff+'│'+_0x48ee9a+'│';}function calculateStats(_0x154929){const _0x16ddf3=a51_0x536d3c,_0x5e28e1={'total':_0x154929[_0x16ddf3(0x224)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x52dc0f of _0x154929){if(_0x52dc0f['state']==='success')_0x5e28e1[_0x16ddf3(0x238)]++;else{if(_0x52dc0f[_0x16ddf3(0x11f)]===_0x16ddf3(0x1ef)||_0x52dc0f[_0x16ddf3(0x11f)]==='group_error')_0x5e28e1[_0x16ddf3(0x1ef)]++;else _0x52dc0f[_0x16ddf3(0x11f)]===_0x16ddf3(0x19c)?_0x5e28e1[_0x16ddf3(0x19c)]++:_0x5e28e1[_0x16ddf3(0x192)]++;}}return _0x5e28e1;}function formatStats(_0x418a23){const _0x1d141b=a51_0x536d3c;return[_0x1d141b(0x23c)+_0x418a23['total'],'✅\x20'+_0x418a23[_0x1d141b(0x238)],'❌\x20'+_0x418a23['error'],_0x1d141b(0x148)+_0x418a23['running'],'⏳\x20'+_0x418a23['pending']][_0x1d141b(0x1f2)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a51_0x536d3c(0x279)]=a51_0x536d3c(0x282);['description']=a51_0x536d3c(0x284);async[a51_0x536d3c(0x179)](_0x55ef4b){const _0x2621c9=a51_0x536d3c,{options:_0xd640f9,args:_0x1bf92e,tdx:_0x147de0}=_0x55ef4b;let _0x116c81,_0x31dc80,_0x5224db=![];if(_0x1bf92e[0x0]){if(_0x1bf92e[0x0][_0x2621c9(0x229)]('.')){const _0x5c15c3=this[_0x2621c9(0x1cd)](_0x1bf92e,_0xd640f9);if(!_0x5c15c3)return 0x1;_0x116c81=_0x5c15c3['projectName'],_0x31dc80=_0x5c15c3[_0x2621c9(0x29c)];}else{_0x31dc80=_0x1bf92e[0x0],_0x116c81=_0xd640f9[_0x2621c9(0x18e)];if(!_0x116c81)return console[_0x2621c9(0x1ef)](a51_0x14a5c4[_0x2621c9(0x1ec)](_0x2621c9(0x21d)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x5224db=!![];}}else{const _0x252a12=this['parseProjectWorkflowPattern'](_0x1bf92e,_0xd640f9);if(!_0x252a12)return 0x1;_0x116c81=_0x252a12[_0x2621c9(0x285)],_0x31dc80=_0x252a12[_0x2621c9(0x29c)];}if(_0xd640f9[_0x2621c9(0x22b)]){if(_0x116c81&&_0x31dc80)console['error'](_0x2621c9(0x204)+_0x116c81+'.'+_0x31dc80);else _0x116c81&&console[_0x2621c9(0x1ef)](_0x2621c9(0x286)+_0x116c81);}const _0x189bb5=_0xd640f9[_0x2621c9(0x1d5)],_0x466b46=_0xd640f9[_0x2621c9(0x20d)];if(_0x189bb5){_0x466b46&&console[_0x2621c9(0x1ef)](a51_0x14a5c4[_0x2621c9(0x23d)](_0x2621c9(0x28e)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x3b743f=_0xd640f9['follow'];return _0x3b743f?await this[_0x2621c9(0x15f)](_0x55ef4b,_0x189bb5):await this[_0x2621c9(0x25a)](_0x55ef4b,_0x189bb5,_0xd640f9),0x0;}if(_0x466b46){const _0x40a88a=await withSpinner(_0x2621c9(0x14e),()=>_0x147de0[_0x2621c9(0x157)]['sessions']({'projectName':_0x116c81,'workflowName':_0x31dc80,'limit':0x64}),{'verbose':_0xd640f9[_0x2621c9(0x22b)]}),_0x3c1d3c=_0x40a88a[_0x2621c9(0x270)][_0x2621c9(0x1fa)](_0x3967dd=>_0x3967dd['id']===_0x466b46);if(!_0x3c1d3c)return console[_0x2621c9(0x1ef)](a51_0x14a5c4[_0x2621c9(0x1ec)](_0x2621c9(0x21d)),'Session\x20not\x20found:\x20'+_0x466b46),0x1;if(!_0x3c1d3c['lastAttempt']?.['id'])return console[_0x2621c9(0x1ef)](a51_0x14a5c4[_0x2621c9(0x1ec)]('Error:'),_0x2621c9(0x102)+_0x466b46+'\x20has\x20no\x20attempts'),0x1;const _0x5cc16f=_0x3c1d3c[_0x2621c9(0x1c4)]['id'];_0xd640f9[_0x2621c9(0x22b)]&&console[_0x2621c9(0x1ef)]('Using\x20attempt\x20'+_0x5cc16f+_0x2621c9(0x165)+_0x466b46);const _0x3e7934=_0xd640f9[_0x2621c9(0x11e)];return _0x3e7934?await this['pollTimeline'](_0x55ef4b,_0x5cc16f):await this[_0x2621c9(0x25a)](_0x55ef4b,_0x5cc16f,_0xd640f9),0x0;}const _0xb4f95e=await withSpinner(_0x2621c9(0x1bb),()=>_0x147de0[_0x2621c9(0x157)]['sessions']({'projectName':_0x116c81,'workflowName':_0x31dc80,'limit':_0xd640f9[_0x2621c9(0x144)]||0x32}),{'verbose':_0xd640f9[_0x2621c9(0x22b)]}),_0x2aed59=_0xb4f95e[_0x2621c9(0x270)];if(_0x2aed59[_0x2621c9(0x224)]===0x0){if(_0x116c81&&_0x31dc80)console[_0x2621c9(0x1ef)](_0x2621c9(0x17b)+_0x116c81+'.'+_0x31dc80);else _0x116c81?console[_0x2621c9(0x1ef)](_0x2621c9(0x166)+_0x116c81):(console[_0x2621c9(0x1ef)](_0x2621c9(0x2a6)),console[_0x2621c9(0x1ef)](a51_0x14a5c4['dim'](_0x2621c9(0x222))));return 0x0;}_0x2aed59[_0x2621c9(0x1eb)]((_0x38b377,_0xde522c)=>{const _0x12037f=_0x2621c9,_0x5412c7=_0x38b377[_0x12037f(0x145)]||'',_0x54ff3f=_0xde522c[_0x12037f(0x145)]||'';return _0x54ff3f[_0x12037f(0x196)](_0x5412c7);});if(_0xd640f9[_0x2621c9(0x1f5)]||_0xd640f9[_0x2621c9(0x1da)])return await handleSDKOutput(_0x2aed59,_0xd640f9),0x0;let _0x1f5c37;if(_0x5224db){const _0x33cc4f=_0x2aed59[0x0];if(!_0x33cc4f[_0x2621c9(0x1c4)]?.['id'])return console[_0x2621c9(0x1ef)](_0x2621c9(0x1dc)),0x0;_0x1f5c37=_0x33cc4f[_0x2621c9(0x1c4)]['id'],_0xd640f9[_0x2621c9(0x22b)]&&console['error'](_0x2621c9(0x2a0)+_0x33cc4f['sessionTime']);}else{const _0x2157a0=_0x2aed59[_0x2621c9(0x147)](_0x53e092=>{const _0x46ce88=_0x2621c9,_0x3f6fac=getAttemptStatusDisplay(_0x53e092[_0x46ce88(0x1c4)]);return{'title':_0x53e092[_0x46ce88(0x18d)]?.[_0x46ce88(0x279)]+'.'+_0x53e092[_0x46ce88(0x157)]?.[_0x46ce88(0x279)]+_0x46ce88(0x188)+_0x53e092[_0x46ce88(0x145)]+'\x20'+_0x3f6fac[_0x46ce88(0x22c)],'value':_0x53e092['lastAttempt']?.['id']||'','description':_0x3f6fac[_0x46ce88(0x214)]};}),_0x4713ce=await a51_0x1c7919({'type':'select','name':_0x2621c9(0x1d5),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x2157a0['filter'](_0xf00d15=>_0xf00d15[_0x2621c9(0x296)]!=='')});if(!_0x4713ce['attemptId'])return 0x0;_0x1f5c37=_0x4713ce['attemptId'];}const _0x4ee3c4=_0xd640f9[_0x2621c9(0x11e)];return _0x4ee3c4?await this[_0x2621c9(0x15f)](_0x55ef4b,_0x1f5c37):await this[_0x2621c9(0x25a)](_0x55ef4b,_0x1f5c37,_0xd640f9),0x0;}async[a51_0x536d3c(0x25a)](_0x537293,_0x3d5868,_0x138828){const _0x2c9cf1=a51_0x536d3c,{tdx:_0x531425}=_0x537293;let _0xabc6e9,_0x1a6677;try{[_0xabc6e9,_0x1a6677]=await Promise[_0x2c9cf1(0x275)]([_0x531425[_0x2c9cf1(0x157)]['attempt'](_0x3d5868),_0x531425[_0x2c9cf1(0x157)][_0x2c9cf1(0x11c)](_0x3d5868,![])]);}catch(_0x4352ed){console['error'](a51_0x14a5c4[_0x2c9cf1(0x1ec)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x138828[_0x2c9cf1(0x22b)]&&console[_0x2c9cf1(0x1ef)](_0x4352ed);throw _0x4352ed;}if(_0x138828[_0x2c9cf1(0x1f5)]||_0x138828[_0x2c9cf1(0x1da)]){const _0x1a074d=this[_0x2c9cf1(0x15d)](_0xabc6e9,_0x1a6677);await handleSDKOutput([_0x1a074d],_0x138828);return;}const _0x32007c=_0x531425['context'][_0x2c9cf1(0x1a9)],_0x169fec=this['renderTimeline'](_0xabc6e9,_0x1a6677,_0x32007c);console[_0x2c9cf1(0x29d)](_0x169fec);}async[a51_0x536d3c(0x15f)](_0x2e5584,_0x16ed87){const _0x553a9e=a51_0x536d3c,{tdx:_0x3d731f}=_0x2e5584,_0x3a92da=TIMELINE_CONFIG[_0x553a9e(0x25e)],_0x5d7992=TIMELINE_CONFIG[_0x553a9e(0x1d6)];let _0x12296f=0x0;while(_0x12296f<_0x5d7992){process[_0x553a9e(0x22f)][_0x553a9e(0x23b)]&&process['stdout'][_0x553a9e(0x200)]('\x1bc');let _0x663941,_0x1a4146;try{[_0x663941,_0x1a4146]=await Promise[_0x553a9e(0x275)]([_0x3d731f[_0x553a9e(0x157)][_0x553a9e(0x178)](_0x16ed87),_0x3d731f['workflow'][_0x553a9e(0x11c)](_0x16ed87,![])]);}catch(_0x4f6540){console[_0x553a9e(0x1ef)](a51_0x14a5c4[_0x553a9e(0x1ec)](_0x553a9e(0x17c)));_0x12296f>0x0&&console['error'](a51_0x14a5c4['dim'](_0x553a9e(0x10c)+_0x12296f));throw _0x4f6540;}const _0xaf823c=_0x3d731f[_0x553a9e(0x21c)][_0x553a9e(0x1a9)],_0xa72180=this[_0x553a9e(0x276)](_0x663941,_0x1a4146,_0xaf823c);console['log'](_0xa72180);const _0x3ffff=_0x663941[_0x553a9e(0x115)]&&_0x1a4146[_0x553a9e(0x1c8)](_0x598a4b=>_0x598a4b[_0x553a9e(0x11f)]!==_0x553a9e(0x19c)&&_0x598a4b[_0x553a9e(0x11f)]!==_0x553a9e(0x220));if(_0x3ffff){console['error'](a51_0x14a5c4[_0x553a9e(0x1a1)](_0x553a9e(0x25f)));break;}console[_0x553a9e(0x1ef)](a51_0x14a5c4['dim'](_0x553a9e(0x174)+_0x12296f*0x2+_0x553a9e(0x243))),await new Promise(_0x1d18a9=>setTimeout(_0x1d18a9,_0x3a92da)),_0x12296f++;}_0x12296f>=_0x5d7992&&console[_0x553a9e(0x1ef)](a51_0x14a5c4['yellow'](_0x553a9e(0x25d)));}[a51_0x536d3c(0x276)](_0x2ea1fd,_0x45fb84,_0x371d06){const _0x5d2189=a51_0x536d3c,_0x4f7cd9=[],_0x1a6859=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x3da439=0x5,_0x45fcee=process['stdout'][_0x5d2189(0x1b5)]||0x78,_0xec0221=_0x45fcee-_0x1a6859-_0x3da439,_0x994e22=Math[_0x5d2189(0x225)](TIMELINE_CONFIG[_0x5d2189(0x113)],Math['min'](_0xec0221,TIMELINE_CONFIG[_0x5d2189(0x1db)])),_0x18839d=new Date(_0x2ea1fd[_0x5d2189(0x1e9)])['getTime'](),_0x13d604=_0x2ea1fd[_0x5d2189(0x288)]?new Date(_0x2ea1fd['finishedAt'])[_0x5d2189(0x1c5)]():Date[_0x5d2189(0x277)](),_0x42cbba={'start':_0x18839d,'end':_0x13d604,'duration':_0x13d604-_0x18839d},_0x427458=new Map(),_0x73103a=[];for(const _0x206ed3 of _0x45fb84){if(_0x206ed3['startedAt']){const _0x4156a4=new Date(_0x206ed3[_0x5d2189(0x1c9)])[_0x5d2189(0x1c5)](),_0x3d9066=_0x206ed3[_0x5d2189(0x1e7)]?new Date(_0x206ed3['updatedAt'])[_0x5d2189(0x1c5)]():Date[_0x5d2189(0x277)](),_0x5d6898={'start':_0x4156a4,'end':_0x3d9066,'duration':_0x3d9066-_0x4156a4};_0x427458[_0x5d2189(0x151)](_0x206ed3['id'],_0x5d6898),_0x73103a[_0x5d2189(0x13e)]({'name':_0x206ed3[_0x5d2189(0x164)],'state':_0x206ed3[_0x5d2189(0x11f)]||_0x5d2189(0x152),'window':_0x5d6898});}else _0x73103a['push']({'name':_0x206ed3[_0x5d2189(0x164)],'state':_0x206ed3[_0x5d2189(0x11f)]||_0x5d2189(0x220),'window':undefined});}_0x73103a[_0x5d2189(0x1eb)]((_0x569a37,_0x4532d1)=>{const _0x12823e=_0x5d2189;if(!_0x569a37[_0x12823e(0x207)])return 0x1;if(!_0x4532d1['window'])return-0x1;return _0x569a37[_0x12823e(0x207)][_0x12823e(0x186)]-_0x4532d1['window']['start'];});const _0x2cc01b=_0x73103a[_0x5d2189(0x224)],_0x387bf5=_0x2cc01b>TIMELINE_CONFIG[_0x5d2189(0x21f)];_0x387bf5&&_0x73103a[_0x5d2189(0x28f)](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x59acba=calculateTimeScale(_0x42cbba,_0x994e22),_0x100d7e=_0x2ea1fd['done']?_0x2ea1fd[_0x5d2189(0x238)]?a51_0x14a5c4['green'](_0x5d2189(0x238)):a51_0x14a5c4[_0x5d2189(0x1ec)](_0x5d2189(0x1ef)):a51_0x14a5c4[_0x5d2189(0x280)]('running'),_0x199d84=_0x2ea1fd[_0x5d2189(0x18d)]?.['id'],_0x77b3fd=_0x2ea1fd[_0x5d2189(0x20d)];let _0x22517e;if(_0x199d84&&_0x77b3fd){const _0x307956=getWorkflowAttemptUrl(_0x371d06,_0x199d84,_0x77b3fd,_0x2ea1fd['id']);_0x22517e=hyperlink(a51_0x14a5c4['dim'](_0x2ea1fd['id']),_0x307956);}else _0x22517e=a51_0x14a5c4[_0x5d2189(0x176)](_0x2ea1fd['id']);_0x4f7cd9[_0x5d2189(0x13e)](_0x5d2189(0x271)+_0x22517e+_0x5d2189(0x188)+_0x100d7e+_0x5d2189(0x188)+formatElapsed(_0x42cbba[_0x5d2189(0x1b0)]));if(_0x73103a[_0x5d2189(0x224)]>0x0){const _0x377132=renderTimeAxis(_0x59acba,_0x994e22),_0x53559e=new Date(_0x42cbba[_0x5d2189(0x186)]),_0x4dadca=formatDate(_0x53559e),_0x4a1a98=TIMELINE_CONFIG[_0x5d2189(0x27e)]+TIMELINE_CONFIG[_0x5d2189(0x244)]+_0x1a6859,_0x93a141=_0x4dadca[_0x5d2189(0x19f)](_0x4a1a98),_0x8c4a1a=a51_0x14a5c4['dim'](_0x93a141);_0x4f7cd9[_0x5d2189(0x13e)](_0x8c4a1a+'\x20'+_0x377132);for(const _0x34b3f5 of _0x73103a){_0x4f7cd9[_0x5d2189(0x13e)](renderTaskRow(_0x34b3f5,_0x59acba,_0x994e22,_0x1a6859));}const _0x41feba=calculateStats(_0x73103a);_0x4f7cd9[_0x5d2189(0x13e)](formatStats(_0x41feba)),_0x387bf5&&_0x4f7cd9[_0x5d2189(0x13e)](a51_0x14a5c4[_0x5d2189(0x23d)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0x5d2189(0x21f)]+_0x5d2189(0x1ca)+_0x2cc01b+'\x20tasks')),_0x4f7cd9[_0x5d2189(0x13e)](''),_0x4f7cd9[_0x5d2189(0x13e)](a51_0x14a5c4['dim']('💡\x20Tip:\x20Use\x20')+('tdx\x20wf\x20attempt\x20'+_0x2ea1fd['id']+_0x5d2189(0x29b))+a51_0x14a5c4[_0x5d2189(0x176)](_0x5d2189(0x14b)));}else _0x4f7cd9['push'](_0x5d2189(0x15c));return _0x4f7cd9[_0x5d2189(0x1f2)]('\x0a');}[a51_0x536d3c(0x15d)](_0x45f705,_0x399e4c){const _0x5dd4fa=a51_0x536d3c,_0x402335=new Date(_0x45f705[_0x5dd4fa(0x1e9)])[_0x5dd4fa(0x1c5)](),_0x609903=_0x45f705[_0x5dd4fa(0x288)]?new Date(_0x45f705[_0x5dd4fa(0x288)])[_0x5dd4fa(0x1c5)]():Date['now'](),_0x33b43c=_0x609903-_0x402335,_0x516f50=[];for(const _0x4b171b of _0x399e4c){if(_0x4b171b['startedAt']){const _0x5d202a=new Date(_0x4b171b[_0x5dd4fa(0x1c9)])[_0x5dd4fa(0x1c5)](),_0x16fa44=_0x4b171b['updatedAt']?new Date(_0x4b171b[_0x5dd4fa(0x1e7)])['getTime']():Date[_0x5dd4fa(0x277)]();_0x516f50[_0x5dd4fa(0x13e)]({'name':_0x4b171b[_0x5dd4fa(0x164)],'state':_0x4b171b[_0x5dd4fa(0x11f)]||_0x5dd4fa(0x152),'window':{'start':_0x5d202a,'end':_0x16fa44,'duration':_0x16fa44-_0x5d202a}});}else _0x516f50[_0x5dd4fa(0x13e)]({'name':_0x4b171b['fullName'],'state':_0x4b171b[_0x5dd4fa(0x11f)]||_0x5dd4fa(0x220),'window':undefined});}const _0x1bd8e8=calculateStats(_0x516f50);return{'attempt':{'id':_0x45f705['id'],'status':_0x45f705[_0x5dd4fa(0x115)]?_0x45f705[_0x5dd4fa(0x238)]?'success':_0x5dd4fa(0x1ef):_0x5dd4fa(0x19c),'createdAt':_0x45f705[_0x5dd4fa(0x1e9)],'finishedAt':_0x45f705[_0x5dd4fa(0x288)],'duration_ms':_0x33b43c},'tasks':_0x516f50[_0x5dd4fa(0x147)](_0x2854b5=>({'name':_0x2854b5['name'],'state':_0x2854b5[_0x5dd4fa(0x11f)],'startedAt':_0x2854b5[_0x5dd4fa(0x207)]?new Date(_0x2854b5[_0x5dd4fa(0x207)][_0x5dd4fa(0x186)])[_0x5dd4fa(0x109)]():null,'updatedAt':_0x2854b5['window']?new Date(_0x2854b5[_0x5dd4fa(0x207)]['end'])[_0x5dd4fa(0x109)]():null,'duration_ms':_0x2854b5[_0x5dd4fa(0x207)]?.[_0x5dd4fa(0x1b0)]||null})),'stats':_0x1bd8e8};}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2bb90c,_0x2e47e){const _0x4c1c9c=a52_0x2434,_0x2733a2=_0x2bb90c();while(!![]){try{const _0x48f197=parseInt(_0x4c1c9c(0x1c6))/0x1+-parseInt(_0x4c1c9c(0x1c4))/0x2*(-parseInt(_0x4c1c9c(0x1b5))/0x3)+-parseInt(_0x4c1c9c(0x1c2))/0x4+-parseInt(_0x4c1c9c(0x1c7))/0x5*(parseInt(_0x4c1c9c(0x1c3))/0x6)+-parseInt(_0x4c1c9c(0x1bc))/0x7*(parseInt(_0x4c1c9c(0x1b9))/0x8)+-parseInt(_0x4c1c9c(0x1bf))/0x9*(-parseInt(_0x4c1c9c(0x1b4))/0xa)+parseInt(_0x4c1c9c(0x1c5))/0xb*(parseInt(_0x4c1c9c(0x1c8))/0xc);if(_0x48f197===_0x2e47e)break;else _0x2733a2['push'](_0x2733a2['shift']());}catch(_0x410bdd){_0x2733a2['push'](_0x2733a2['shift']());}}}(a52_0x1c1b,0xac81c));import{platform}from'os';function a52_0x2434(_0x5f525b,_0x3a63e1){_0x5f525b=_0x5f525b-0x1b3;const _0x1c1b22=a52_0x1c1b();let _0x243445=_0x1c1b22[_0x5f525b];return _0x243445;}import{getAPIKey}from'./config.js';function a52_0x1c1b(){const _0xe8af92=['1617eSfXHL','TD1\x20','tdx/','2790gRBjtV','X-Trino-User','version','2202248hLTcQq','333210wVhHaP','2uDjPxp','2299anFUiS','357974JQrnXK','65nRTgLs','13188MLWYyQ',';\x20node/','36380SZxoaG','4014123bXypKT','Authorization','replace','length','37208hoCPAO','Bearer\x20','entries'];a52_0x1c1b=function(){return _0xe8af92;};return a52_0x1c1b();}import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x3faf78=a52_0x2434,_0x298cf6=getVersion(),_0x1798e9=platform(),_0x5dba94=process[_0x3faf78(0x1c1)][_0x3faf78(0x1b7)]('v','');return _0x3faf78(0x1be)+_0x298cf6+'\x20('+_0x1798e9+_0x3faf78(0x1b3)+_0x5dba94+')';}export function getAuthHeaders(_0x43ae74,_0x104b2e,_0x2cf80e){const _0x574a32=a52_0x2434,_0x10ac70=getVersion(),_0x3d32d1={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x10ac70};if(_0x2cf80e)_0x3d32d1[_0x574a32(0x1b6)]=_0x574a32(0x1ba)+_0x2cf80e;else _0x104b2e&&(_0x3d32d1[_0x574a32(0x1b6)]=_0x574a32(0x1bd)+_0x104b2e);return _0x3d32d1;}export function toHeaderRecord(_0x2f938d){const _0x1ef388=a52_0x2434,_0x2cfae0={};for(const [_0x4e4ffc,_0x56ccab]of Object[_0x1ef388(0x1bb)](_0x2f938d)){_0x56ccab!==undefined&&(_0x2cfae0[_0x4e4ffc]=_0x56ccab);}return _0x2cfae0;}export function getTrinoHeaders(_0x89e03d,_0x490f46,_0x3b513a){const _0x235f2d=a52_0x2434,_0x30b5aa=getAuthHeaders(_0x89e03d),_0x1583fa=toHeaderRecord(_0x30b5aa);if(_0x3b513a)_0x1583fa['Authorization']=_0x235f2d(0x1ba)+_0x3b513a;else _0x490f46&&(_0x1583fa[_0x235f2d(0x1c0)]=_0x490f46);return _0x1583fa;}export function hasAPIKey(_0x46247a){const _0x4426fb=a52_0x2434,_0x13a75e=getAPIKey();return _0x13a75e!==undefined&&_0x13a75e[_0x4426fb(0x1b8)]>0x0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x15defb,_0x142ee3){const _0x2eb4e3=a53_0xba0a,_0x26bfba=_0x15defb();while(!![]){try{const _0x521888=-parseInt(_0x2eb4e3(0x196))/0x1+-parseInt(_0x2eb4e3(0x1b9))/0x2+parseInt(_0x2eb4e3(0x1c6))/0x3*(-parseInt(_0x2eb4e3(0x19b))/0x4)+-parseInt(_0x2eb4e3(0x1bf))/0x5+parseInt(_0x2eb4e3(0x1c1))/0x6*(parseInt(_0x2eb4e3(0x1d3))/0x7)+-parseInt(_0x2eb4e3(0x1d4))/0x8*(-parseInt(_0x2eb4e3(0x192))/0x9)+-parseInt(_0x2eb4e3(0x1ab))/0xa*(-parseInt(_0x2eb4e3(0x1b0))/0xb);if(_0x521888===_0x142ee3)break;else _0x26bfba['push'](_0x26bfba['shift']());}catch(_0x27ae75){_0x26bfba['push'](_0x26bfba['shift']());}}}(a53_0x22e0,0x61412));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 a53_0x9b76a7 from'chalk';function a53_0x22e0(){const _0x46fa95=['filter','stringify','write','output','tsv','yellow','189050IkwRHd','data','stdin','repeat','spawn','506PAzaMo','end','string','number','inherit','table','object','length','slice','142814XLoJAL','varchar','query','stdout','debug','keys','2578375bqmieX','padEnd','259110wzWLuO','map','entries','forEach','resolve','814653eMyqoN','magenta','limitStructuredFormats','stderr','list','push','cyan','[logs]','─┬─','rule','isFinite','─┴─','FINISHED','98exClxG','75832HckdZC','boolean','join','limit','isInteger','close','error','max','format','params','81oFgxoT','[rule]','No\x20data','[Object]','302544coPIRD','pipe','trim','log','json','4GnKSbl','isTTY','jsonl','sdk-result','noColor','bold','split','color','less','bigint'];a53_0x22e0=function(){return _0x46fa95;};return a53_0x22e0();}function a53_0xba0a(_0x2d3484,_0x3a2cfb){_0x2d3484=_0x2d3484-0x192;const _0x22e0d8=a53_0x22e0();let _0xba0af6=_0x22e0d8[_0x2d3484];return _0xba0af6;}import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0xc11c4){const _0x35d363=a53_0xba0a;return _0xc11c4['format']===_0x35d363(0x19a)||_0xc11c4[_0x35d363(0x1dc)]===_0x35d363(0x19d)||_0xc11c4[_0x35d363(0x1dc)]===_0x35d363(0x1a9)||_0xc11c4[_0x35d363(0x1dc)]===_0x35d363(0x1b5)||_0xc11c4['json']===!![]||_0xc11c4['jsonl']===!![]||_0xc11c4[_0x35d363(0x1a9)]===!![]||_0xc11c4['table']===!![];}export function parseOutputOptions(_0x169e5e){const _0x1baa01=a53_0xba0a;return{'format':_0x169e5e['format']||_0x1baa01(0x1b5),'output':_0x169e5e[_0x1baa01(0x1a8)]||'','limit':_0x169e5e['limit'],'limitStructuredFormats':_0x169e5e[_0x1baa01(0x1c8)],'color':_0x169e5e[_0x1baa01(0x1a2)],'noColor':_0x169e5e[_0x1baa01(0x19f)]};}function convertSDKResultToQueryResult(_0x19ca06){const _0x253fca=a53_0xba0a,_0x232bcb=[];if(_0x19ca06[_0x253fca(0x1b7)]>0x0){const _0x4aeba2=_0x19ca06[0x0];for(const [_0x241ee2,_0x354fed]of Object['entries'](_0x4aeba2)){let _0x2ffc23=_0x253fca(0x1ba);if(typeof _0x354fed==='number')_0x2ffc23=Number[_0x253fca(0x1d8)](_0x354fed)?_0x253fca(0x1a4):'double';else{if(typeof _0x354fed===_0x253fca(0x1d5))_0x2ffc23=_0x253fca(0x1d5);else _0x354fed===null&&(_0x2ffc23=_0x253fca(0x1ba));}_0x232bcb['push']({'name':_0x241ee2,'type':_0x2ffc23});}}return{'queryId':_0x253fca(0x19e),'columns':_0x232bcb,'data':_0x19ca06,'stats':{'state':_0x253fca(0x1d2),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x19ca06[_0x253fca(0x1b7)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x7b8866,_0x5d8fe2){const _0x5f540c=convertSDKResultToQueryResult(_0x7b8866);return formatQueryOutput(_0x5f540c,_0x5d8fe2);}export async function formatQueryOutput(_0x940c6a,_0x21d00f){const _0x58ea0b=a53_0xba0a,{format:_0x3155d6,limit:_0x5be50d,output:_0x4f9c7d,color:_0x5df2ca,noColor:_0x5339a4,limitStructuredFormats:_0x218bec}=_0x21d00f,_0x1b956d=Boolean(_0x4f9c7d)&&!_0x5df2ca,_0x84fb49={'color':_0x5df2ca,'noColor':_0x5339a4||_0x1b956d};if(_0x3155d6===_0x58ea0b(0x1b5)){const _0x518047=shouldUseLess(_0x3155d6,_0x4f9c7d);return formatAsTable(_0x940c6a,_0x5be50d,_0x518047,_0x84fb49);}const _0x418e57=_0x218bec&&Number[_0x58ea0b(0x1d0)](_0x5be50d)&&_0x940c6a[_0x58ea0b(0x1ac)][_0x58ea0b(0x1b7)]>_0x5be50d?{..._0x940c6a,'data':_0x940c6a[_0x58ea0b(0x1ac)][_0x58ea0b(0x1b8)](0x0,_0x5be50d)}:_0x940c6a;if(_0x3155d6===_0x58ea0b(0x19a))return formatAsJSON(_0x418e57,_0x84fb49);else return _0x3155d6===_0x58ea0b(0x19d)?formatAsJSONL(_0x418e57,_0x84fb49):formatQueryResult(_0x418e57,_0x3155d6);}function shouldUseLess(_0x18cdbd,_0x551824){const _0x5de25e=a53_0xba0a;return(_0x18cdbd===_0x5de25e(0x1b5)||_0x18cdbd===_0x5de25e(0x1ca))&&process[_0x5de25e(0x1bc)][_0x5de25e(0x19c)]&&!_0x551824;}export function resolveOutputOptions(_0x25ec71){const _0x270886=a53_0xba0a,_0x3bd9ee=_0x25ec71['output']||'',_0x39681a=resolveOutputFormat(_0x25ec71['format'],_0x3bd9ee,_0x270886(0x1b5));let _0xcd99b7=typeof _0x25ec71[_0x270886(0x1d7)]===_0x270886(0x1b3)?_0x25ec71[_0x270886(0x1d7)]:parseInt(_0x25ec71[_0x270886(0x1d7)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x25ec71['limit']===undefined&&shouldUseLess(_0x39681a,_0x3bd9ee)&&(_0xcd99b7=Infinity),{'format':_0x39681a,'output':_0x3bd9ee,'limit':_0xcd99b7,'limitStructuredFormats':_0x25ec71[_0x270886(0x1c8)],'color':_0x25ec71[_0x270886(0x1a2)],'noColor':_0x25ec71[_0x270886(0x19f)]};}export function writeOutput(_0x34a486,_0x207f1d,_0x24397f){const _0x91b530=a53_0xba0a;return _0x207f1d?(writeFileSync(_0x207f1d,_0x34a486),console[_0x91b530(0x1da)]('Results\x20saved\x20to\x20'+_0x207f1d),Promise[_0x91b530(0x1c5)]()):shouldUseLess(_0x24397f||'','')?new Promise(_0x111513=>{const _0x358fde=_0x91b530,_0x5ab744=spawn(_0x358fde(0x1a3),['-FXRSn'],{'stdio':[_0x358fde(0x197),'inherit',_0x358fde(0x1b4)]});let _0x4af442=![];_0x5ab744['on'](_0x358fde(0x1da),()=>{!_0x4af442&&(_0x4af442=!![],console['log'](_0x34a486),_0x111513());}),_0x5ab744['on'](_0x358fde(0x1d9),()=>{!_0x4af442&&(_0x4af442=!![],_0x111513());}),_0x5ab744['on'](_0x358fde(0x1af),()=>{const _0x193843=_0x358fde;!_0x4af442&&_0x5ab744[_0x193843(0x1ad)]&&(_0x5ab744['stdin']['on'](_0x193843(0x1da),()=>{}),_0x5ab744[_0x193843(0x1ad)][_0x193843(0x1a7)](_0x34a486),_0x5ab744[_0x193843(0x1ad)][_0x193843(0x1b1)]());}),!_0x5ab744['stdin']&&(!_0x4af442&&(_0x4af442=!![],console[_0x358fde(0x199)](_0x34a486),_0x111513()));}):(console[_0x91b530(0x199)](_0x34a486),Promise[_0x91b530(0x1c5)]());}export async function handleSDKOutput(_0x5c03b2,_0x20ed62){const _0x420e46=a53_0xba0a,_0x30bf80=resolveOutputOptions(_0x20ed62),_0x1fcf40=await formatSDKOutput(_0x5c03b2,_0x30bf80);await writeOutput(_0x1fcf40,_0x30bf80[_0x420e46(0x1a8)]||undefined,_0x30bf80[_0x420e46(0x1dc)]);}export async function handleQueryOutput(_0x5350e2,_0x197656){const _0x1963d9=resolveOutputOptions(_0x197656),_0x302fe3=await formatQueryOutput(_0x5350e2,_0x1963d9);await writeOutput(_0x302fe3,_0x1963d9['output']||undefined,_0x1963d9['format']);}async function formatSingleObject(_0x1d11da,_0x487ea){const _0x26cdda=a53_0xba0a,{format:_0x31e2dd,color:_0x492b97,noColor:_0xfc2e3d}=_0x487ea,_0x973eed={'color':_0x492b97,'noColor':_0xfc2e3d};if(_0x31e2dd===_0x26cdda(0x19a)){if(shouldUseColor(_0x973eed))return colorizeJSON(_0x1d11da,_0x973eed);return JSON[_0x26cdda(0x1a6)](_0x1d11da,null,0x2);}else{if(_0x31e2dd===_0x26cdda(0x19d)){if(shouldUseColor(_0x973eed))return colorizeJSONCompact(_0x1d11da,_0x973eed);return JSON[_0x26cdda(0x1a6)](_0x1d11da);}else{if(_0x31e2dd===_0x26cdda(0x1a9))return Object[_0x26cdda(0x1c3)](_0x1d11da)[_0x26cdda(0x1c2)](([_0x4a874e,_0x15b2cd])=>_0x4a874e+'\x09'+_0x15b2cd)[_0x26cdda(0x1d6)]('\x0a');else{const _0x119f6c=Object[_0x26cdda(0x1c3)](_0x1d11da);if(_0x119f6c['length']===0x0)return _0x26cdda(0x194);const _0x1a9d24=_0x1d11da[_0x26cdda(0x1bd)],_0x44c78c=_0x1d11da[_0x26cdda(0x1bb)],_0xec360f=_0x1d11da[_0x26cdda(0x1dd)],_0x58b278=_0x1d11da[_0x26cdda(0x1cf)],_0x479c58=_0x44c78c?typeof _0x44c78c===_0x26cdda(0x1b2)?_0x44c78c:JSON[_0x26cdda(0x1a6)](_0x44c78c,null,0x2):undefined,_0x521dcc=_0xec360f&&Object[_0x26cdda(0x1be)](_0xec360f)['length']>0x0?JSON[_0x26cdda(0x1a6)](_0xec360f,null,0x2):undefined,_0x1c50c5=_0x58b278&&Object[_0x26cdda(0x1be)](_0x58b278)[_0x26cdda(0x1b7)]>0x0?JSON['stringify'](_0x58b278,null,0x2):undefined,_0x1b4197=_0x119f6c[_0x26cdda(0x1a5)](([_0x2f25fd])=>_0x2f25fd!==_0x26cdda(0x1bd)&&_0x2f25fd!==_0x26cdda(0x1bb)&&_0x2f25fd!==_0x26cdda(0x1dd)&&_0x2f25fd!==_0x26cdda(0x1cf)),_0x39af61=Math[_0x26cdda(0x1db)](..._0x1b4197[_0x26cdda(0x1c2)](([_0x31a301])=>_0x31a301[_0x26cdda(0x1b7)])),_0x4fab91=Math[_0x26cdda(0x1db)](..._0x1b4197[_0x26cdda(0x1c2)](([,_0x3a49ee])=>{const _0x357676=_0x26cdda;try{const _0x15c039=_0x3a49ee===null||_0x3a49ee===undefined?'':typeof _0x3a49ee===_0x357676(0x1b6)?JSON['stringify'](_0x3a49ee):String(_0x3a49ee),_0x470f29=_0x15c039[_0x357676(0x1a1)]('\x0a');return Math['max'](..._0x470f29[_0x357676(0x1c2)](_0x51db4e=>_0x51db4e[_0x357676(0x1b7)]),0x0);}catch{return 0x0;}}),0x14),_0x8e1748=[];_0x8e1748[_0x26cdda(0x1cb)](colorBorder('┌─'+'─'[_0x26cdda(0x1ae)](_0x39af61)+_0x26cdda(0x1ce)+'─'[_0x26cdda(0x1ae)](_0x4fab91)+'─┐',_0x973eed)),_0x1b4197[_0x26cdda(0x1c4)](([_0x3f0934,_0x450c34])=>{const _0x276a4b=_0x26cdda;let _0x24be2f;try{_0x24be2f=_0x450c34===null||_0x450c34===undefined?'':typeof _0x450c34==='object'?JSON[_0x276a4b(0x1a6)](_0x450c34):String(_0x450c34);}catch{_0x24be2f=_0x276a4b(0x195);}const _0x2d00b1=_0x3f0934['padEnd'](_0x39af61),_0xa189fa=_0x24be2f[_0x276a4b(0x1a1)]('\x0a');_0xa189fa[_0x276a4b(0x1c4)]((_0x164b16,_0x6a569)=>{const _0x485f14=_0x276a4b,_0x16becd=colorBorder('│',_0x973eed);_0x6a569===0x0?_0x8e1748[_0x485f14(0x1cb)](_0x16becd+'\x20'+_0x2d00b1+'\x20'+_0x16becd+'\x20'+_0x164b16[_0x485f14(0x1c0)](_0x4fab91)+'\x20'+_0x16becd):_0x8e1748[_0x485f14(0x1cb)](_0x16becd+'\x20'+'\x20'[_0x485f14(0x1ae)](_0x39af61)+'\x20'+_0x16becd+'\x20'+_0x164b16[_0x485f14(0x1c0)](_0x4fab91)+'\x20'+_0x16becd);});}),_0x8e1748[_0x26cdda(0x1cb)](colorBorder('└─'+'─'[_0x26cdda(0x1ae)](_0x39af61)+_0x26cdda(0x1d1)+'─'[_0x26cdda(0x1ae)](_0x4fab91)+'─┘',_0x973eed));_0x479c58&&(_0x8e1748[_0x26cdda(0x1cb)](''),_0x8e1748[_0x26cdda(0x1cb)](String(a53_0x9b76a7[_0x26cdda(0x1aa)][_0x26cdda(0x1a0)]('[query]'))),_0x8e1748[_0x26cdda(0x1cb)](_0x479c58));_0x521dcc&&(_0x8e1748[_0x26cdda(0x1cb)](''),_0x8e1748[_0x26cdda(0x1cb)](String(a53_0x9b76a7['blue'][_0x26cdda(0x1a0)]('[params]'))),_0x8e1748[_0x26cdda(0x1cb)](_0x521dcc));_0x1c50c5&&(_0x8e1748['push'](''),_0x8e1748['push'](String(a53_0x9b76a7[_0x26cdda(0x1c7)][_0x26cdda(0x1a0)](_0x26cdda(0x193)))),_0x8e1748[_0x26cdda(0x1cb)](_0x1c50c5));if(_0x1a9d24){if(_0x1a9d24[_0x26cdda(0x1c9)]){_0x8e1748['push'](''),_0x8e1748['push'](String(a53_0x9b76a7['red'][_0x26cdda(0x1a0)]('[error]')));const _0x3b043e=_0x1a9d24[_0x26cdda(0x1c9)][_0x26cdda(0x1a1)]('\x0a');_0x3b043e['forEach'](_0x19477b=>{const _0x1219f0=_0x26cdda;_0x19477b[_0x1219f0(0x198)]()&&_0x8e1748[_0x1219f0(0x1cb)](_0x19477b);});}if(_0x1a9d24['cmdout']){_0x8e1748[_0x26cdda(0x1cb)](''),_0x8e1748[_0x26cdda(0x1cb)](String(a53_0x9b76a7[_0x26cdda(0x1cc)][_0x26cdda(0x1a0)](_0x26cdda(0x1cd))));const _0x3a4c10=_0x1a9d24['cmdout'][_0x26cdda(0x1a1)]('\x0a');_0x3a4c10[_0x26cdda(0x1c4)](_0x27903b=>{const _0x12dca3=_0x26cdda;_0x27903b['trim']()&&_0x8e1748[_0x12dca3(0x1cb)](_0x27903b);});}}return _0x8e1748[_0x26cdda(0x1d6)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x139137,_0x22541f){const _0x5477ea=a53_0xba0a;if(_0x22541f[_0x5477ea(0x1dc)]==='table'){await handleSDKOutput([_0x139137],_0x22541f);return;}const _0x195b11=resolveOutputOptions(_0x22541f),_0x41d90d=await formatSingleObject(_0x139137,_0x195b11);await writeOutput(_0x41d90d,_0x195b11[_0x5477ea(0x1a8)]||undefined,_0x195b11[_0x5477ea(0x1dc)]);}
|
|
1
|
+
(function(_0x4a9a53,_0x4b82ac){const _0x4c8430=a53_0xbb20,_0x5143eb=_0x4a9a53();while(!![]){try{const _0x4364b5=-parseInt(_0x4c8430(0x194))/0x1+parseInt(_0x4c8430(0x195))/0x2+-parseInt(_0x4c8430(0x166))/0x3*(parseInt(_0x4c8430(0x18f))/0x4)+-parseInt(_0x4c8430(0x1aa))/0x5*(parseInt(_0x4c8430(0x176))/0x6)+-parseInt(_0x4c8430(0x1a9))/0x7+parseInt(_0x4c8430(0x16c))/0x8+parseInt(_0x4c8430(0x185))/0x9;if(_0x4364b5===_0x4b82ac)break;else _0x5143eb['push'](_0x5143eb['shift']());}catch(_0x4e4587){_0x5143eb['push'](_0x5143eb['shift']());}}}(a53_0x425c,0xea179));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 a53_0x23ec56 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';function a53_0xbb20(_0x3105af,_0x3286c0){_0x3105af=_0x3105af-0x166;const _0x425c01=a53_0x425c();let _0xbb2066=_0x425c01[_0x3105af];return _0xbb2066;}export function isStructuredFormat(_0xc45606){const _0x4fa73a=a53_0xbb20;return _0xc45606[_0x4fa73a(0x173)]===_0x4fa73a(0x179)||_0xc45606[_0x4fa73a(0x173)]===_0x4fa73a(0x1a3)||_0xc45606['format']===_0x4fa73a(0x1ab)||_0xc45606[_0x4fa73a(0x173)]===_0x4fa73a(0x177)||_0xc45606[_0x4fa73a(0x179)]===!![]||_0xc45606[_0x4fa73a(0x1a3)]===!![]||_0xc45606[_0x4fa73a(0x1ab)]===!![]||_0xc45606[_0x4fa73a(0x177)]===!![];}export function parseOutputOptions(_0x1850b8){const _0x309f5d=a53_0xbb20;return{'format':_0x1850b8['format']||_0x309f5d(0x177),'output':_0x1850b8[_0x309f5d(0x16e)]||'','limit':_0x1850b8[_0x309f5d(0x17c)],'limitStructuredFormats':_0x1850b8[_0x309f5d(0x1b1)],'color':_0x1850b8[_0x309f5d(0x167)],'noColor':_0x1850b8[_0x309f5d(0x19a)]};}function convertSDKResultToQueryResult(_0x33770a){const _0x54433d=a53_0xbb20,_0x490182=[];if(_0x33770a['length']>0x0){const _0x37051e=_0x33770a[0x0];for(const [_0x1c82be,_0x2c0cda]of Object['entries'](_0x37051e)){let _0x373819=_0x54433d(0x183);if(typeof _0x2c0cda==='number')_0x373819=Number[_0x54433d(0x193)](_0x2c0cda)?_0x54433d(0x1a5):'double';else{if(typeof _0x2c0cda===_0x54433d(0x16d))_0x373819=_0x54433d(0x16d);else _0x2c0cda===null&&(_0x373819='varchar');}_0x490182[_0x54433d(0x1ae)]({'name':_0x1c82be,'type':_0x373819});}}return{'queryId':_0x54433d(0x181),'columns':_0x490182,'data':_0x33770a,'stats':{'state':_0x54433d(0x1b2),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x33770a[_0x54433d(0x1b3)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x59d694,_0x1f023b){const _0x4a52fe=convertSDKResultToQueryResult(_0x59d694);return formatQueryOutput(_0x4a52fe,_0x1f023b);}export async function formatQueryOutput(_0x33852f,_0x51d82e){const _0x42093d=a53_0xbb20,{format:_0x429724,limit:_0x3a1af4,output:_0x8d5ea1,color:_0x2eaf04,noColor:_0x28d5e0,limitStructuredFormats:_0xf95975}=_0x51d82e,_0x436301=Boolean(_0x8d5ea1)&&!_0x2eaf04,_0x586776={'color':_0x2eaf04,'noColor':_0x28d5e0||_0x436301};if(_0x429724==='table'){const _0x2a5f5d=shouldUseLess(_0x429724,_0x8d5ea1);return formatAsTable(_0x33852f,_0x3a1af4,_0x2a5f5d,_0x586776);}const _0x29c294=_0xf95975&&Number[_0x42093d(0x19f)](_0x3a1af4)&&_0x33852f[_0x42093d(0x16f)]['length']>_0x3a1af4?{..._0x33852f,'data':_0x33852f[_0x42093d(0x16f)][_0x42093d(0x1a0)](0x0,_0x3a1af4)}:_0x33852f;if(_0x429724===_0x42093d(0x179))return formatAsJSON(_0x29c294,_0x586776);else return _0x429724===_0x42093d(0x1a3)?formatAsJSONL(_0x29c294,_0x586776):formatQueryResult(_0x29c294,_0x429724);}function a53_0x425c(){const _0x46d3d2=['table','less','json','─┬─','split','limit','cyan','stdin','[query]','object','sdk-result','write','varchar','padEnd','29680704YcCZsv','bold','repeat','log','pipe','string','red','forEach','magenta','map','204irqEKo','spawn','[logs]','filter','isInteger','1343255yVlemW','391840HkLCzg','max','join','isTTY','debug','noColor','stdout','[Object]','─┴─','entries','isFinite','slice','yellow','[error]','jsonl','error','bigint','query','trim','list','4606014qgjDIB','357635oZTDul','tsv','keys','stringify','push','No\x20data','blue','limitStructuredFormats','FINISHED','length','104427trJZQl','color','inherit','Results\x20saved\x20to\x20','[rule]','rule','10504864DIQoDW','boolean','output','data','close','stderr','cmdout','format','number','[params]','6RCTKlO'];a53_0x425c=function(){return _0x46d3d2;};return a53_0x425c();}function shouldUseLess(_0x52e2bc,_0x3aba36){const _0x49cb29=a53_0xbb20;return(_0x52e2bc==='table'||_0x52e2bc===_0x49cb29(0x1a8))&&process[_0x49cb29(0x19b)][_0x49cb29(0x198)]&&!_0x3aba36;}export function resolveOutputOptions(_0x4ae7e6){const _0xffd860=a53_0xbb20,_0x31a7ac=_0x4ae7e6[_0xffd860(0x16e)]||'',_0x4dfc2b=resolveOutputFormat(_0x4ae7e6[_0xffd860(0x173)],_0x31a7ac,_0xffd860(0x177));let _0x48eeb9=typeof _0x4ae7e6[_0xffd860(0x17c)]===_0xffd860(0x174)?_0x4ae7e6[_0xffd860(0x17c)]:parseInt(_0x4ae7e6['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x4ae7e6[_0xffd860(0x17c)]===undefined&&shouldUseLess(_0x4dfc2b,_0x31a7ac)&&(_0x48eeb9=Infinity),{'format':_0x4dfc2b,'output':_0x31a7ac,'limit':_0x48eeb9,'limitStructuredFormats':_0x4ae7e6[_0xffd860(0x1b1)],'color':_0x4ae7e6[_0xffd860(0x167)],'noColor':_0x4ae7e6[_0xffd860(0x19a)]};}export function writeOutput(_0x1bf8fe,_0x549497,_0x4b856f){const _0x8c5d78=a53_0xbb20;return _0x549497?(writeFileSync(_0x549497,_0x1bf8fe),console[_0x8c5d78(0x1a4)](_0x8c5d78(0x169)+_0x549497),Promise['resolve']()):shouldUseLess(_0x4b856f||'','')?new Promise(_0x44c82b=>{const _0x2092af=_0x8c5d78,_0x29c7fe=spawn(_0x2092af(0x178),['-FXRSn'],{'stdio':[_0x2092af(0x189),_0x2092af(0x168),_0x2092af(0x168)]});let _0x418e06=![];_0x29c7fe['on']('error',()=>{const _0x2bd933=_0x2092af;!_0x418e06&&(_0x418e06=!![],console[_0x2bd933(0x188)](_0x1bf8fe),_0x44c82b());}),_0x29c7fe['on'](_0x2092af(0x170),()=>{!_0x418e06&&(_0x418e06=!![],_0x44c82b());}),_0x29c7fe['on'](_0x2092af(0x190),()=>{const _0x1802c3=_0x2092af;!_0x418e06&&_0x29c7fe[_0x1802c3(0x17e)]&&(_0x29c7fe[_0x1802c3(0x17e)]['on'](_0x1802c3(0x1a4),()=>{}),_0x29c7fe[_0x1802c3(0x17e)][_0x1802c3(0x182)](_0x1bf8fe),_0x29c7fe[_0x1802c3(0x17e)]['end']());}),!_0x29c7fe[_0x2092af(0x17e)]&&(!_0x418e06&&(_0x418e06=!![],console[_0x2092af(0x188)](_0x1bf8fe),_0x44c82b()));}):(console['log'](_0x1bf8fe),Promise['resolve']());}export async function handleSDKOutput(_0x2f28e4,_0x3a1919){const _0x1a7f2a=a53_0xbb20,_0xdd4d31=resolveOutputOptions(_0x3a1919),_0x1854d9=await formatSDKOutput(_0x2f28e4,_0xdd4d31);await writeOutput(_0x1854d9,_0xdd4d31[_0x1a7f2a(0x16e)]||undefined,_0xdd4d31[_0x1a7f2a(0x173)]);}export async function handleQueryOutput(_0x3ad87d,_0x50074f){const _0x29bf63=a53_0xbb20,_0x4441d1=resolveOutputOptions(_0x50074f),_0x1bd782=await formatQueryOutput(_0x3ad87d,_0x4441d1);await writeOutput(_0x1bd782,_0x4441d1[_0x29bf63(0x16e)]||undefined,_0x4441d1[_0x29bf63(0x173)]);}async function formatSingleObject(_0x350ff8,_0x37fb97){const _0x151968=a53_0xbb20,{format:_0x2e5481,color:_0x525a4b,noColor:_0x4de0d2}=_0x37fb97,_0xb322dd={'color':_0x525a4b,'noColor':_0x4de0d2};if(_0x2e5481===_0x151968(0x179)){if(shouldUseColor(_0xb322dd))return colorizeJSON(_0x350ff8,_0xb322dd);return JSON[_0x151968(0x1ad)](_0x350ff8,null,0x2);}else{if(_0x2e5481===_0x151968(0x1a3)){if(shouldUseColor(_0xb322dd))return colorizeJSONCompact(_0x350ff8,_0xb322dd);return JSON[_0x151968(0x1ad)](_0x350ff8);}else{if(_0x2e5481===_0x151968(0x1ab))return Object[_0x151968(0x19e)](_0x350ff8)['map'](([_0x57d4f4,_0xe97935])=>_0x57d4f4+'\x09'+_0xe97935)[_0x151968(0x197)]('\x0a');else{const _0x475d5a=Object[_0x151968(0x19e)](_0x350ff8);if(_0x475d5a[_0x151968(0x1b3)]===0x0)return _0x151968(0x1af);const _0xb1333d=_0x350ff8['debug'],_0x52c615=_0x350ff8['query'],_0x193fd4=_0x350ff8['params'],_0x4b0c1f=_0x350ff8[_0x151968(0x16b)],_0x266977=_0x52c615?typeof _0x52c615===_0x151968(0x18a)?_0x52c615:JSON[_0x151968(0x1ad)](_0x52c615,null,0x2):undefined,_0x33ac66=_0x193fd4&&Object[_0x151968(0x1ac)](_0x193fd4)[_0x151968(0x1b3)]>0x0?JSON[_0x151968(0x1ad)](_0x193fd4,null,0x2):undefined,_0x4faf9a=_0x4b0c1f&&Object[_0x151968(0x1ac)](_0x4b0c1f)[_0x151968(0x1b3)]>0x0?JSON[_0x151968(0x1ad)](_0x4b0c1f,null,0x2):undefined,_0x80f79e=_0x475d5a[_0x151968(0x192)](([_0xa70976])=>_0xa70976!==_0x151968(0x199)&&_0xa70976!==_0x151968(0x1a6)&&_0xa70976!=='params'&&_0xa70976!=='rule'),_0x3a15f9=Math['max'](..._0x80f79e['map'](([_0x1d9bbd])=>_0x1d9bbd['length'])),_0x1884da=Math[_0x151968(0x196)](..._0x80f79e['map'](([,_0x36e87c])=>{const _0x2f360f=_0x151968;try{const _0x37082b=_0x36e87c===null||_0x36e87c===undefined?'':typeof _0x36e87c===_0x2f360f(0x180)?JSON[_0x2f360f(0x1ad)](_0x36e87c):String(_0x36e87c),_0x3d32e9=_0x37082b[_0x2f360f(0x17b)]('\x0a');return Math['max'](..._0x3d32e9[_0x2f360f(0x18e)](_0x16d370=>_0x16d370[_0x2f360f(0x1b3)]),0x0);}catch{return 0x0;}}),0x14),_0x3a372c=[];_0x3a372c[_0x151968(0x1ae)](colorBorder('┌─'+'─'[_0x151968(0x187)](_0x3a15f9)+_0x151968(0x17a)+'─'[_0x151968(0x187)](_0x1884da)+'─┐',_0xb322dd)),_0x80f79e[_0x151968(0x18c)](([_0x57b203,_0x592913])=>{const _0x1f81fb=_0x151968;let _0x2f5d3e;try{_0x2f5d3e=_0x592913===null||_0x592913===undefined?'':typeof _0x592913===_0x1f81fb(0x180)?JSON[_0x1f81fb(0x1ad)](_0x592913):String(_0x592913);}catch{_0x2f5d3e=_0x1f81fb(0x19c);}const _0x305f4d=_0x57b203[_0x1f81fb(0x184)](_0x3a15f9),_0x195406=_0x2f5d3e[_0x1f81fb(0x17b)]('\x0a');_0x195406['forEach']((_0x342fe9,_0x31684e)=>{const _0x764f2c=_0x1f81fb,_0x29fd2f=colorBorder('│',_0xb322dd);_0x31684e===0x0?_0x3a372c['push'](_0x29fd2f+'\x20'+_0x305f4d+'\x20'+_0x29fd2f+'\x20'+_0x342fe9[_0x764f2c(0x184)](_0x1884da)+'\x20'+_0x29fd2f):_0x3a372c['push'](_0x29fd2f+'\x20'+'\x20'[_0x764f2c(0x187)](_0x3a15f9)+'\x20'+_0x29fd2f+'\x20'+_0x342fe9['padEnd'](_0x1884da)+'\x20'+_0x29fd2f);});}),_0x3a372c['push'](colorBorder('└─'+'─'[_0x151968(0x187)](_0x3a15f9)+_0x151968(0x19d)+'─'['repeat'](_0x1884da)+'─┘',_0xb322dd));_0x266977&&(_0x3a372c[_0x151968(0x1ae)](''),_0x3a372c[_0x151968(0x1ae)](String(a53_0x23ec56[_0x151968(0x1a1)]['bold'](_0x151968(0x17f)))),_0x3a372c[_0x151968(0x1ae)](_0x266977));_0x33ac66&&(_0x3a372c[_0x151968(0x1ae)](''),_0x3a372c[_0x151968(0x1ae)](String(a53_0x23ec56[_0x151968(0x1b0)][_0x151968(0x186)](_0x151968(0x175)))),_0x3a372c[_0x151968(0x1ae)](_0x33ac66));_0x4faf9a&&(_0x3a372c[_0x151968(0x1ae)](''),_0x3a372c['push'](String(a53_0x23ec56[_0x151968(0x18d)][_0x151968(0x186)](_0x151968(0x16a)))),_0x3a372c['push'](_0x4faf9a));if(_0xb1333d){if(_0xb1333d['stderr']){_0x3a372c[_0x151968(0x1ae)](''),_0x3a372c[_0x151968(0x1ae)](String(a53_0x23ec56[_0x151968(0x18b)][_0x151968(0x186)](_0x151968(0x1a2))));const _0x4a73e0=_0xb1333d[_0x151968(0x171)][_0x151968(0x17b)]('\x0a');_0x4a73e0[_0x151968(0x18c)](_0x2d10cd=>{const _0x1df98d=_0x151968;_0x2d10cd['trim']()&&_0x3a372c[_0x1df98d(0x1ae)](_0x2d10cd);});}if(_0xb1333d[_0x151968(0x172)]){_0x3a372c['push'](''),_0x3a372c[_0x151968(0x1ae)](String(a53_0x23ec56[_0x151968(0x17d)][_0x151968(0x186)](_0x151968(0x191))));const _0x2ff677=_0xb1333d[_0x151968(0x172)][_0x151968(0x17b)]('\x0a');_0x2ff677[_0x151968(0x18c)](_0x40cd01=>{const _0x2ad4e1=_0x151968;_0x40cd01[_0x2ad4e1(0x1a7)]()&&_0x3a372c[_0x2ad4e1(0x1ae)](_0x40cd01);});}}return _0x3a372c[_0x151968(0x197)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x3c41f2,_0x5412dd){const _0x12b134=a53_0xbb20;if(_0x5412dd[_0x12b134(0x173)]===_0x12b134(0x177)){await handleSDKOutput([_0x3c41f2],_0x5412dd);return;}const _0x320a51=resolveOutputOptions(_0x5412dd),_0x1c4543=await formatSingleObject(_0x3c41f2,_0x320a51);await writeOutput(_0x1c4543,_0x320a51[_0x12b134(0x16e)]||undefined,_0x320a51['format']);}
|