@treasuredata/tdx 2026.3.20 → 2026.3.21
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.d.ts +1 -1
- package/dist/cli-categories.js +1 -1
- package/dist/cli-categories.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/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/policy-command.d.ts +33 -0
- package/dist/commands/policy-command.d.ts.map +1 -0
- package/dist/commands/policy-command.js +1 -0
- package/dist/commands/policy-command.js.map +1 -0
- 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.d.ts +7 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +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/policy.d.ts +41 -0
- package/dist/sdk/policy.d.ts.map +1 -0
- package/dist/sdk/policy.js +1 -0
- package/dist/sdk/policy.js.map +1 -0
- 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.d.ts +1 -0
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/policy.d.ts +58 -0
- package/dist/sdk/types/policy.d.ts.map +1 -0
- package/dist/sdk/types/policy.js +1 -0
- package/dist/sdk/types/policy.js.map +1 -0
- 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_0x22a388=a51_0x57ff;(function(_0x75908b,_0x4f2e71){const _0x510860=a51_0x57ff,_0xae360e=_0x75908b();while(!![]){try{const _0x1dd9da=parseInt(_0x510860(0x15e))/0x1+-parseInt(_0x510860(0x1ff))/0x2*(parseInt(_0x510860(0x137))/0x3)+parseInt(_0x510860(0x116))/0x4*(parseInt(_0x510860(0x185))/0x5)+-parseInt(_0x510860(0x19e))/0x6*(parseInt(_0x510860(0xc4))/0x7)+parseInt(_0x510860(0x230))/0x8*(-parseInt(_0x510860(0x16f))/0x9)+parseInt(_0x510860(0x181))/0xa*(parseInt(_0x510860(0x193))/0xb)+parseInt(_0x510860(0xfe))/0xc;if(_0x1dd9da===_0x4f2e71)break;else _0xae360e['push'](_0xae360e['shift']());}catch(_0x3a9057){_0xae360e['push'](_0xae360e['shift']());}}}(a51_0x15a1,0xb2c43));import a51_0x5bf18c from'chalk';import{existsSync}from'fs';import a51_0x108fb0 from'path';import{BaseCommand}from'./command.js';function a51_0x57ff(_0x313d8a,_0x4aa9fb){_0x313d8a=_0x313d8a-0x9a;const _0x15a1bc=a51_0x15a1();let _0x57ffb4=_0x15a1bc[_0x313d8a];return _0x57ffb4;}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_0x4f4bd3 from'prompts';function getAttemptStatusDisplay(_0x36a70b){const _0x490647=a51_0x57ff;if(!_0x36a70b)return{'icon':'⏳','text':''};const {done:_0x2381d8,success:_0x5a91c8,cancelRequested:_0x3f8c7e}=_0x36a70b;if(!_0x2381d8)return _0x3f8c7e?{'icon':'🛑','text':a51_0x5bf18c['yellow'](_0x490647(0x18c))}:{'icon':'🔄','text':a51_0x5bf18c['blue'](_0x490647(0x15b))};if(_0x5a91c8)return{'icon':'✅','text':a51_0x5bf18c[_0x490647(0xf7)](_0x490647(0x179))};return{'icon':'❌','text':a51_0x5bf18c['red'](_0x490647(0xf6))};}export class WorkflowBaseCommand extends BaseCommand{[a51_0x22a388(0x202)](_0x24ac75,_0x17e688,_0x1768e9=0x0){return _0x24ac75[_0x1768e9]||_0x17e688['workflowProject'];}['requireProject'](_0x3fd8b4,_0x27de86,_0x228223=0x0){const _0x11a967=a51_0x22a388,_0x21ffd3=this['resolveProject'](_0x3fd8b4,_0x27de86,_0x228223);if(!_0x21ffd3)return console[_0x11a967(0xf6)](a51_0x5bf18c['red']('Error:'),'Project\x20name\x20is\x20required'),console[_0x11a967(0xf6)](a51_0x5bf18c['dim'](_0x11a967(0x10a))),null;return _0x21ffd3;}['parseProjectWorkflowPattern'](_0x136944,_0x640206){const _0x2be523=a51_0x22a388;if(_0x136944[0x0]){const _0x1b3948=_0x136944[0x0][_0x2be523(0x22c)]('.');if(_0x1b3948[_0x2be523(0x221)]===0x1)return{'projectName':_0x1b3948[0x0],'workflowName':undefined};else return _0x1b3948[_0x2be523(0x221)]===0x2?{'projectName':_0x1b3948[0x0],'workflowName':_0x1b3948[0x1]}:(console[_0x2be523(0xf6)](a51_0x5bf18c[_0x2be523(0xf3)](_0x2be523(0x1e0)),_0x2be523(0x13d)),null);}return{'projectName':_0x640206['workflowProject'],'workflowName':undefined};}['resolveProjectDir'](_0x590abb,_0x57a309,_0x273b87=0x0){const _0x339145=a51_0x22a388;if(_0x590abb[_0x273b87])return _0x590abb[_0x273b87];if(_0x57a309[_0x339145(0x1c1)]){const _0x221c83=a51_0x108fb0[_0x339145(0x192)](process[_0x339145(0x166)](),'workflows',_0x57a309['workflowProject']);if(existsSync(a51_0x108fb0[_0x339145(0x192)](_0x221c83,'tdx.json')))return _0x221c83;}return undefined;}async['showWorkflowConsoleUrl'](_0x46bdd0,_0xb5e62c,_0x4ece11){const _0x5f5da6=a51_0x22a388;try{const _0x14224f=await _0x46bdd0[_0x5f5da6(0x121)][_0x5f5da6(0xa7)](_0xb5e62c,{'limit':0x1});if(_0x14224f[_0x5f5da6(0x221)]>0x0){const _0x21089e=_0x14224f[0x0]['id'],_0x5865ad=getWorkflowUrl(_0x4ece11,_0x21089e);console[_0x5f5da6(0xf6)](_0x5f5da6(0xa4)+a51_0x5bf18c[_0x5f5da6(0xbb)](_0x5865ad));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x20d);[a51_0x22a388(0x1b4)]='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async[a51_0x22a388(0xd2)](_0x226f97){const _0x567a04=a51_0x22a388,{options:_0xf38846,args:_0x349c8d,tdx:_0x1ba47b}=_0x226f97,_0x1da4d4=_0x349c8d[0x0],_0x102391=_0xf38846['clear'];if(_0x102391)return saveSessionContext({'workflow_project':undefined},_0xf38846['session']),console[_0x567a04(0x204)](a51_0x5bf18c[_0x567a04(0xf7)]('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x1da4d4)return console[_0x567a04(0xf6)](a51_0x5bf18c[_0x567a04(0xf3)](_0x567a04(0x1e0)),_0x567a04(0x21b)),console['error'](a51_0x5bf18c[_0x567a04(0x1b0)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x567a04(0xf6)](a51_0x5bf18c[_0x567a04(0x1b0)](_0x567a04(0x1e7))),0x1;const _0x1f0879=await withSpinner(_0x567a04(0x1a8)+_0x1da4d4+_0x567a04(0xda),()=>_0x1ba47b[_0x567a04(0x121)][_0x567a04(0x14f)](_0x1da4d4),{'verbose':_0xf38846[_0x567a04(0xde)]}),{name:_0x17c47a}=_0x1f0879[_0x567a04(0x195)];return saveSessionContext({'workflow_project':_0x17c47a},_0xf38846['session']),console[_0x567a04(0x204)](a51_0x5bf18c[_0x567a04(0xf7)](_0x567a04(0x1e5)+a51_0x5bf18c[_0x567a04(0xbb)](_0x17c47a))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a51_0x22a388(0x147);[a51_0x22a388(0x1b4)]='List\x20all\x20workflow\x20projects';async['execute'](_0x5b25ab){const _0x1e683d=a51_0x22a388,{options:_0x45c5cc,args:_0x6e759f,tdx:_0x4e61a4}=_0x5b25ab,_0x4b686c=_0x6e759f[0x0];_0x45c5cc[_0x1e683d(0xde)]&&_0x4b686c&&console['error'](_0x1e683d(0x18d)+_0x4b686c);const _0x2bd287=await withSpinner(_0x1e683d(0x129),()=>_0x4e61a4['workflow'][_0x1e683d(0x126)](_0x4b686c,{'limit':_0x45c5cc[_0x1e683d(0xa9)]}),{'verbose':_0x45c5cc[_0x1e683d(0xde)]});let _0x4688ca=_0x2bd287[_0x1e683d(0x195)];_0x4688ca['sort']((_0x917c6b,_0x110f93)=>_0x917c6b['name'][_0x1e683d(0xa1)](_0x110f93[_0x1e683d(0x174)]));const _0x8d30fa=_0x45c5cc[_0x1e683d(0xa9)]||0x64,_0x376b5a=_0x4688ca[_0x1e683d(0x221)]>=_0x8d30fa?a51_0x5bf18c[_0x1e683d(0x1b0)](_0x1e683d(0x22a)):'';console[_0x1e683d(0xf6)]('✔\x20Found\x20'+_0x4688ca['length']+'\x20project'+(_0x4688ca[_0x1e683d(0x221)]!==0x1?'s':'')+_0x376b5a);if(_0x45c5cc[_0x1e683d(0x1d7)]===_0x1e683d(0x176)||_0x45c5cc[_0x1e683d(0x1d7)]==='jsonl'||_0x45c5cc['format']===_0x1e683d(0xd8))await handleSDKOutput(_0x4688ca,_0x45c5cc);else{if(_0x4688ca['length']===0x0)_0x4b686c?console[_0x1e683d(0x204)](_0x1e683d(0x17c)+_0x4b686c):console[_0x1e683d(0x204)](_0x1e683d(0x14c));else{const _0x2db132=_0x4688ca['map'](_0x5a5ed2=>{const _0x2bb51c=_0x1e683d,_0x585226=_0x5a5ed2[_0x2bb51c(0x24e)]?.[_0x2bb51c(0x11a)](_0x1a8afc=>_0x1a8afc[_0x2bb51c(0x1b2)]===_0x2bb51c(0x1c3)),_0x19e60f=_0x585226?a51_0x5bf18c['dim'](_0x2bb51c(0x1bc)):'';return _0x2bb51c(0x102)+_0x5a5ed2[_0x2bb51c(0x174)]+_0x19e60f;});await writeOutput(_0x2db132[_0x1e683d(0x192)]('\x0a'),_0x45c5cc['output'],_0x1e683d(0x19f));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a51_0x22a388(0x1a6);[a51_0x22a388(0x1b4)]='List\x20workflows';async[a51_0x22a388(0xd2)](_0x10a832){const _0x3378f6=a51_0x22a388,{options:_0x2910f9,args:_0x330238,tdx:_0x2fc716}=_0x10a832,_0x53a58c=this['resolveProject'](_0x330238,_0x2910f9);_0x2910f9[_0x3378f6(0xde)]&&_0x53a58c&&console[_0x3378f6(0xf6)]('Project\x20filter:\x20'+_0x53a58c);const _0x5f2776=await withSpinner('Listing\x20workflows...',()=>_0x2fc716[_0x3378f6(0x121)][_0x3378f6(0xa7)](_0x53a58c,{'limit':_0x2910f9[_0x3378f6(0xa9)]}),{'verbose':_0x2910f9[_0x3378f6(0xde)]});let _0x4b72d3=_0x5f2776[_0x3378f6(0x195)];_0x4b72d3[_0x3378f6(0x248)]((_0x3aea9c,_0x3b5aee)=>{const _0x463fa4=_0x3378f6,_0x168108=_0x3aea9c[_0x463fa4(0x174)][_0x463fa4(0xa1)](_0x3b5aee[_0x463fa4(0x174)]);if(_0x168108!==0x0)return _0x168108;return(_0x3aea9c['project']?.[_0x463fa4(0x174)]||'')[_0x463fa4(0xa1)](_0x3b5aee[_0x463fa4(0x1fe)]?.[_0x463fa4(0x174)]||'');});const _0x2f7199=_0x2910f9['limit']||0x64,_0x3c3822=_0x4b72d3[_0x3378f6(0x221)]>=_0x2f7199?a51_0x5bf18c[_0x3378f6(0x1b0)](_0x3378f6(0x22a)):'';console[_0x3378f6(0xf6)](_0x3378f6(0x17a)+_0x4b72d3['length']+'\x20workflow'+(_0x4b72d3['length']!==0x1?'s':'')+_0x3c3822);if(_0x2910f9[_0x3378f6(0x1d7)]==='json'||_0x2910f9['format']==='jsonl'||_0x2910f9[_0x3378f6(0x1d7)]===_0x3378f6(0xd8))await handleSDKOutput(_0x4b72d3,_0x2910f9);else{if(_0x4b72d3[_0x3378f6(0x221)]===0x0)_0x53a58c?console['log'](_0x3378f6(0x122)+_0x53a58c):console[_0x3378f6(0x204)]('No\x20workflows\x20found');else{const _0x13ccf4=_0x2910f9[_0x3378f6(0x1e3)],_0x2109b4=_0x4b72d3[_0x3378f6(0x1de)](_0x3c3668=>{const _0x57915e=_0x3378f6,_0x196327=a51_0x5bf18c['dim']('#'+_0x3c3668['id']),_0x26e025=hyperlink(_0x196327,getWorkflowUrl(_0x13ccf4,_0x3c3668['id'])),_0xc6b819=_0x3c3668[_0x57915e(0x1fe)]?.[_0x57915e(0x174)]?a51_0x5bf18c[_0x57915e(0x1b0)]('\x20('+_0x3c3668['project']['name']+')'):'';return _0x57915e(0x13c)+_0x26e025+'\x20'+_0x3c3668[_0x57915e(0x174)]+_0xc6b819;});await writeOutput(_0x2109b4[_0x3378f6(0x192)]('\x0a'),_0x2910f9[_0x3378f6(0x1fd)],_0x3378f6(0x19f));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0xa6);[a51_0x22a388(0x1b4)]='List\x20workflow\x20execution\x20sessions';async['execute'](_0x3c7144){const _0x49c80e=a51_0x22a388,{options:_0x3b3da4,args:_0x4f6e13,tdx:_0x1a70ed}=_0x3c7144,_0x2301c1=this[_0x49c80e(0x227)](_0x4f6e13,_0x3b3da4);if(!_0x2301c1)return 0x1;const {projectName:_0x3f24cb,workflowName:_0x45ee48}=_0x2301c1;if(_0x3b3da4['verbose']){if(_0x3f24cb&&_0x45ee48)console['error']('Filter:\x20'+_0x3f24cb+'.'+_0x45ee48);else _0x3f24cb&&console[_0x49c80e(0xf6)]('Filter:\x20project='+_0x3f24cb);const _0x3858f2=_0x3b3da4[_0x49c80e(0x196)];_0x3858f2&&console[_0x49c80e(0xf6)](_0x49c80e(0x22d)+_0x3858f2);}let _0x499bad=0x28;if(process[_0x49c80e(0x20b)]['isTTY']&&!_0x3b3da4[_0x49c80e(0x1fd)]&&!_0x3b3da4[_0x49c80e(0x1d7)]){const _0x29ee0f=process[_0x49c80e(0x20b)]['rows']||0x28;_0x499bad=Math[_0x49c80e(0x170)](0x14,Math[_0x49c80e(0xdd)](_0x29ee0f*0x2/0x3));}const _0x1235c1=_0x3b3da4[_0x49c80e(0xa9)]||_0x499bad,_0x290083=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x1a70ed[_0x49c80e(0x121)]['sessions']({'projectName':_0x3f24cb,'workflowName':_0x45ee48,'status':_0x3b3da4[_0x49c80e(0x196)],'fromTime':_0x3b3da4[_0x49c80e(0x111)],'toTime':_0x3b3da4['to'],'limit':_0x1235c1}),{'verbose':_0x3b3da4['verbose']}),_0x467f6a=_0x290083[_0x49c80e(0x195)];_0x467f6a[_0x49c80e(0x248)]((_0x4d7a18,_0x2615fc)=>{const _0x20fcd4=_0x49c80e,_0xa38de3=_0x4d7a18[_0x20fcd4(0x16a)]||'',_0xff59f9=_0x2615fc[_0x20fcd4(0x16a)]||'';return _0xff59f9[_0x20fcd4(0xa1)](_0xa38de3);});_0x467f6a[_0x49c80e(0x221)]>=_0x1235c1?console['error']('✔\x20Showing\x20'+_0x467f6a[_0x49c80e(0x221)]+_0x49c80e(0x1df)+a51_0x5bf18c[_0x49c80e(0x1b0)](_0x49c80e(0x1b1))):console['error'](_0x49c80e(0x17a)+_0x467f6a[_0x49c80e(0x221)]+_0x49c80e(0x165)+(_0x467f6a['length']!==0x1?'s':''));if(_0x3b3da4['format']===_0x49c80e(0x176)||_0x3b3da4[_0x49c80e(0x1d7)]===_0x49c80e(0x201)||_0x3b3da4['format']===_0x49c80e(0xd8))await handleSDKOutput(_0x467f6a,_0x3b3da4);else{if(!process['stdout']['isTTY']||_0x3b3da4[_0x49c80e(0x1fd)]){if(_0x467f6a[_0x49c80e(0x221)]===0x0){if(_0x3f24cb&&_0x45ee48)console[_0x49c80e(0x204)](_0x49c80e(0x177)+_0x3f24cb+'.'+_0x45ee48);else _0x3f24cb?console[_0x49c80e(0x204)](_0x49c80e(0x19d)+_0x3f24cb):console[_0x49c80e(0x204)](_0x49c80e(0x188));}else{const _0x3ea174=_0x3b3da4[_0x49c80e(0x1e3)],_0x5245b5=this[_0x49c80e(0xad)](_0x467f6a,_0x3ea174);_0x3b3da4[_0x49c80e(0x1fd)]?await writeOutput(_0x5245b5,_0x3b3da4[_0x49c80e(0x1fd)],_0x49c80e(0x19f)):console[_0x49c80e(0x204)](_0x5245b5);}!_0x3f24cb&&(console[_0x49c80e(0xf6)](''),console[_0x49c80e(0xf6)](a51_0x5bf18c['dim'](_0x49c80e(0x9d))),console[_0x49c80e(0xf6)](a51_0x5bf18c[_0x49c80e(0x1b0)](_0x49c80e(0x104))+'or'+a51_0x5bf18c[_0x49c80e(0x1b0)](_0x49c80e(0x229))));}else{if(_0x467f6a[_0x49c80e(0x221)]===0x0){if(_0x3f24cb&&_0x45ee48)console[_0x49c80e(0x204)](_0x49c80e(0x177)+_0x3f24cb+'.'+_0x45ee48);else _0x3f24cb?console[_0x49c80e(0x204)](_0x49c80e(0x19d)+_0x3f24cb):console[_0x49c80e(0x204)](_0x49c80e(0x188));}else await this['navigateSessionsInteractive'](_0x467f6a,_0x3c7144,_0x3f24cb);}}return 0x0;}[a51_0x22a388(0xad)](_0x229df5,_0x52968b){const _0x4ec16b=a51_0x22a388,_0x2eb8a1=[],_0x2be67f=new Map();let _0x9749ba=Infinity,_0x138cc8=-Infinity;for(const _0x1dad8f of _0x229df5){if(_0x1dad8f[_0x4ec16b(0x225)]?.[_0x4ec16b(0x151)]){const _0x3ca8cc=new Date(_0x1dad8f[_0x4ec16b(0x225)][_0x4ec16b(0x151)])[_0x4ec16b(0x1dc)](),_0x4202b9=_0x1dad8f[_0x4ec16b(0x225)]['finishedAt']?new Date(_0x1dad8f[_0x4ec16b(0x225)]['finishedAt'])[_0x4ec16b(0x1dc)]():Date[_0x4ec16b(0x23d)](),_0x76fdb3=_0x1dad8f[_0x4ec16b(0x1fe)]?.[_0x4ec16b(0x174)]||_0x4ec16b(0x22e);!_0x2be67f['has'](_0x76fdb3)&&_0x2be67f[_0x4ec16b(0x9a)](_0x76fdb3,[]),_0x2be67f[_0x4ec16b(0x17f)](_0x76fdb3)[_0x4ec16b(0x11e)]({'session':_0x1dad8f,'startTime':_0x3ca8cc,'endTime':_0x4202b9,'duration':_0x4202b9-_0x3ca8cc}),_0x9749ba=Math[_0x4ec16b(0x13a)](_0x9749ba,_0x3ca8cc),_0x138cc8=Math[_0x4ec16b(0x170)](_0x138cc8,_0x4202b9);}}if(_0x2be67f[_0x4ec16b(0x200)]===0x0)return _0x4ec16b(0x158);const _0x15d624=process[_0x4ec16b(0x20b)][_0x4ec16b(0x1e8)]||0x78,_0x537347=0x1e,_0x5dd3ee=0x32,_0xf58b3e=0x4,_0x20e46e=Math['min'](_0x5dd3ee,Math['max'](_0x537347,Math['floor'](_0x15d624*0.3))),_0x47e3ac=_0x15d624-_0x20e46e-TIMELINE_CONFIG[_0x4ec16b(0x220)]-0x3-_0xf58b3e,_0x3fd18f=_0x138cc8-_0x9749ba,_0x259096=_0x3fd18f/_0x20e46e,_0x10feb2=renderTimeAxis({'startTime':_0x9749ba,'endTime':_0x138cc8,'durationMs':_0x3fd18f,'msPerChar':_0x259096},_0x20e46e),_0x8b9f55=[];for(const _0x41d84a of _0x2be67f[_0x4ec16b(0x1d1)]()){_0x8b9f55['push'](..._0x41d84a);}_0x8b9f55[_0x4ec16b(0x248)]((_0x474e84,_0x538a67)=>_0x538a67[_0x4ec16b(0x240)]-_0x474e84[_0x4ec16b(0x240)]);const _0x5de4b5=new Date(_0x9749ba),_0x937d29=formatDate(_0x5de4b5),_0x597698=_0xf58b3e+TIMELINE_CONFIG[_0x4ec16b(0x1ae)]+TIMELINE_CONFIG['ICON_SPACING']+_0x47e3ac,_0xe29f27='\x20'['repeat'](_0x597698-_0x937d29['length']),_0x20065c=_0xe29f27+a51_0x5bf18c['dim'](_0x937d29)+'\x20'+_0x10feb2;_0x2eb8a1[_0x4ec16b(0x11e)](_0x20065c);const _0x3de083=0x16;let _0x433b5f=0x0;for(const _0x52044f of _0x8b9f55){const _0x139925=_0x52044f['session'][_0x4ec16b(0x1fe)]?.[_0x4ec16b(0x174)]||'?',_0x3d3b0e=Math[_0x4ec16b(0x13a)](stringWidth(_0x139925),_0x3de083);_0x433b5f=Math[_0x4ec16b(0x170)](_0x433b5f,_0x3d3b0e);}for(const _0x2473d0 of _0x8b9f55){const {session:_0x448cb7,startTime:_0x7f78ea,endTime:_0x2d5f10,duration:_0x89bf09}=_0x2473d0,_0x3d1f64=_0x448cb7[_0x4ec16b(0x1fe)]?.['id'],_0x44f96f=_0x448cb7['id'],_0x14f1bc=_0x448cb7[_0x4ec16b(0x1fe)]?.['name']||'?',_0x46b834=_0x448cb7[_0x4ec16b(0x121)]?.['name']||'?';let _0x1768b2,_0x114a89;if(_0x448cb7[_0x4ec16b(0x225)]){const _0x56742b=_0x448cb7[_0x4ec16b(0x225)];!_0x56742b[_0x4ec16b(0xe1)]?(_0x1768b2=_0x56742b[_0x4ec16b(0x1d4)]?'🛑':'🔄',_0x114a89=_0x56742b['cancelRequested']?a51_0x5bf18c[_0x4ec16b(0xfc)]:a51_0x5bf18c[_0x4ec16b(0x1ed)]):(_0x1768b2=_0x56742b['success']?'✅':'❌',_0x114a89=_0x56742b[_0x4ec16b(0x179)]?a51_0x5bf18c[_0x4ec16b(0xf7)]:a51_0x5bf18c[_0x4ec16b(0xf3)]);}else _0x1768b2='⏳',_0x114a89=a51_0x5bf18c[_0x4ec16b(0x1b0)];const _0x35c99a='#'+_0x44f96f,_0xa9cba1=_0x3d1f64?hyperlink(_0x35c99a,getWorkflowSessionUrl(_0x52968b,_0x3d1f64,_0x44f96f)):_0x35c99a;let _0x1fd997=_0x14f1bc;stringWidth(_0x14f1bc)>_0x3de083&&(_0x1fd997=_0x14f1bc[_0x4ec16b(0xe9)](0x0,_0x3de083-0x1)+'…');const _0x4dc9a8=a51_0x5bf18c[_0x4ec16b(0x1b0)](_0x1fd997),_0x4e1dd3=stringWidth(_0x1fd997),_0x191655='\x20'['repeat'](_0x433b5f-stringWidth(_0x1fd997)+0x2),_0x59926d='('+formatElapsed(_0x89bf09)+')',_0x262cfe=stringWidth(_0x59926d),_0xa3231f=stringWidth(_0x35c99a),_0x7109a5=_0xa3231f+0x1+_0x4e1dd3+_0x191655[_0x4ec16b(0x221)],_0x2c7970=_0x47e3ac-_0x7109a5-_0x262cfe-0x1-0x8;let _0x21c14a=_0x46b834;stringWidth(_0x21c14a)>_0x2c7970&&(_0x21c14a=_0x21c14a[_0x4ec16b(0xe9)](0x0,_0x2c7970-0x1)+'…');const _0x2381d9=_0xa9cba1+'\x20'+_0x4dc9a8+_0x191655+_0x21c14a,_0x3d2da6=stringWidth(_0x2381d9),_0x48ba72=_0x47e3ac-_0x3d2da6-_0x262cfe,_0x228462=_0x2381d9+'\x20'[_0x4ec16b(0x245)](Math['max'](0x1,_0x48ba72))+a51_0x5bf18c['dim'](_0x59926d),_0x24c29d=Math['floor']((_0x7f78ea-_0x9749ba)/_0x259096),_0x18afb7=Math[_0x4ec16b(0xdd)]((_0x2d5f10-_0x9749ba)/_0x259096),_0x24dd63=Math['max'](_0x24c29d+0x1,_0x18afb7),_0x3fe6ec=new Array(_0x20e46e)[_0x4ec16b(0x113)]('\x20');for(let _0x2e5e06=_0x24c29d;_0x2e5e06<Math['min'](_0x24dd63,_0x20e46e);_0x2e5e06++){_0x3fe6ec[_0x2e5e06]='─';}const _0x543fa8=_0x3fe6ec[_0x4ec16b(0x1de)](_0x4de6e3=>_0x4de6e3==='\x20'?'\x20':_0x114a89(_0x4de6e3))[_0x4ec16b(0x192)]('');_0x2eb8a1[_0x4ec16b(0x11e)](_0x1768b2+'\x20'+_0x228462+'│'+_0x543fa8+'│');}return _0x2eb8a1[_0x4ec16b(0x192)]('\x0a');}async[a51_0x22a388(0x241)](_0x3c74e5,_0x3d69df,_0x185e5f){const _0x4f93e2=a51_0x22a388,{options:_0x3456a1,tdx:_0x38e950}=_0x3d69df,_0x3300ad=_0x3456a1['site'],{timelineRows:_0x366dd7,timeAxisHeader:_0x3a62d7}=this['generateSessionTimelineRows'](_0x3c74e5,_0x3300ad),_0x111350=_0x366dd7[_0x4f93e2(0x183)](_0x41417b=>_0x41417b['attemptId']);if(_0x111350[_0x4f93e2(0x221)]===0x0){const _0x5d0d5e=this['renderSessionsTimeline'](_0x3c74e5,_0x3300ad);console[_0x4f93e2(0x204)](_0x5d0d5e);!_0x185e5f&&(console[_0x4f93e2(0xf6)](''),console[_0x4f93e2(0xf6)](a51_0x5bf18c[_0x4f93e2(0x1b0)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console['error'](a51_0x5bf18c[_0x4f93e2(0x1b0)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a51_0x5bf18c[_0x4f93e2(0x1b0)](_0x4f93e2(0x229))));return;}_0x3a62d7&&console[_0x4f93e2(0x204)](_0x3a62d7);const _0x2439c9=_0x366dd7['filter'](_0xb911bf=>_0xb911bf['attemptId'])['map'](_0x3c8d27=>({'title':_0x3c8d27[_0x4f93e2(0x231)],'value':_0x3c8d27[_0x4f93e2(0x173)]})),_0xa5005b=process[_0x4f93e2(0x20b)]['rows']||0x3c,_0x185de9=Math[_0x4f93e2(0x170)](0x28,Math[_0x4f93e2(0xdd)](_0xa5005b*0x2/0x3)),_0x503c90=await a51_0x4f4bd3({'type':_0x4f93e2(0x1b5),'name':_0x4f93e2(0x173),'message':_0x4f93e2(0xec),'choices':_0x2439c9,'initial':-0x1,'limit':_0x185de9,'clearFirst':!![],'fallback':{'title':_0x4f93e2(0xf1),'value':null},'suggest':(_0x1639bb,_0x1cb561)=>{const _0x510388=_0x4f93e2;if(!_0x1639bb)return Promise['resolve'](_0x1cb561);const _0x5cd9f3=_0x1cb561[_0x510388(0x183)](_0x43e407=>{const _0x235d15=_0x510388,_0x3d4a7d=_0x43e407;return _0x3d4a7d['title'][_0x235d15(0x14b)]()['includes'](_0x1639bb[_0x235d15(0x14b)]());});return Promise[_0x510388(0x154)](_0x5cd9f3);}}),_0x1843b7=()=>{const _0x1e9724=_0x4f93e2;process[_0x1e9724(0x20b)][_0x1e9724(0xbc)](_0x1e9724(0x1f1)),process[_0x1e9724(0x20b)][_0x1e9724(0xbc)](_0x1e9724(0x1f1)),process[_0x1e9724(0x20b)][_0x1e9724(0xbc)]('\x1b[1A\x1b[2K');},_0x5aa09d=_0x503c90&&_0x503c90[_0x4f93e2(0x173)]&&_0x503c90[_0x4f93e2(0x173)]!==null&&_0x503c90[_0x4f93e2(0x173)][_0x4f93e2(0xf4)]()!=='';if(!_0x5aa09d){_0x1843b7(),console['log'](a51_0x5bf18c[_0x4f93e2(0x1b0)](_0x4f93e2(0x1cb)));return;}_0x1843b7();const _0x257f1c=_0x3c74e5[_0x4f93e2(0x20e)](_0x1feca3=>_0x1feca3[_0x4f93e2(0x225)]?.['id']===_0x503c90['attemptId']);if(_0x257f1c){const _0x22959d=_0x257f1c[_0x4f93e2(0x1fe)]?.[_0x4f93e2(0x174)]||'?',_0x13666c=_0x257f1c[_0x4f93e2(0x121)]?.['name']||'?';console['log'](_0x4f93e2(0xba)+a51_0x5bf18c[_0x4f93e2(0x1b0)](_0x22959d)+_0x4f93e2(0x15c)+a51_0x5bf18c[_0x4f93e2(0x1b0)](_0x13666c));}const _0x34db10=new WorkflowTimelineCommand();await _0x34db10[_0x4f93e2(0xd2)]({'args':[],'options':{..._0x3456a1,'attemptId':_0x503c90[_0x4f93e2(0x173)]},'tdx':_0x38e950});}['generateSessionTimelineRows'](_0xeb1370,_0x2f648d){const _0x19d985=a51_0x22a388,_0x52b80b=new Map();for(const _0x5d25a2 of _0xeb1370){_0x5d25a2['id']&&_0x5d25a2[_0x19d985(0x225)]?.['id']&&_0x52b80b['set'](_0x5d25a2['id'],_0x5d25a2[_0x19d985(0x225)]['id']);}const _0x33e3c0=[];let _0x3e713d='';const _0x48b4e2=this['renderSessionsTimeline'](_0xeb1370,_0x2f648d),_0x13cea5=_0x48b4e2[_0x19d985(0x22c)]('\x0a');for(const _0x3cf390 of _0x13cea5){if(_0x3cf390[_0x19d985(0xb5)](_0x19d985(0x23c))||_0x3cf390[_0x19d985(0x239)](/^\s+\d{4}-\d{2}-\d{2}/))_0x3e713d=_0x3cf390;else{if(_0x3cf390[_0x19d985(0x239)](/^[✅❌🔄🛑⏳]/)){const _0x1956da=_0x3cf390[_0x19d985(0x239)](/#(\d+)/),_0x2e5eb5=_0x1956da?_0x1956da[0x1]:null,_0x29decc=_0x2e5eb5?_0x52b80b['get'](_0x2e5eb5)||null:null,_0x42ccf1=_0xeb1370[_0x19d985(0x20e)](_0x126381=>_0x126381['id']===_0x2e5eb5),_0x4137d4=_0x42ccf1?.[_0x19d985(0x1fe)]?.[_0x19d985(0x174)]||'';_0x33e3c0[_0x19d985(0x11e)]({'displayLine':_0x3cf390,'attemptId':_0x29decc,'projectName':_0x4137d4});}}}return{'timelineRows':_0x33e3c0,'timeAxisHeader':_0x3e713d};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x1c7);[a51_0x22a388(0x1b4)]=a51_0x22a388(0x228);async[a51_0x22a388(0xd2)](_0x53799c){const _0x29a342=a51_0x22a388,{options:_0x3481fb,args:_0x3e5d36,tdx:_0x40ee2f}=_0x53799c,_0x82ea0c=this[_0x29a342(0x227)](_0x3e5d36,_0x3481fb);if(!_0x82ea0c)return 0x1;const {projectName:_0x537b6e,workflowName:_0x6d281b}=_0x82ea0c,_0x27f90a=_0x3481fb[_0x29a342(0xcf)];if(_0x3481fb[_0x29a342(0xde)]){if(_0x537b6e&&_0x6d281b)console[_0x29a342(0xf6)](_0x29a342(0x140)+_0x537b6e+'.'+_0x6d281b);else _0x537b6e&&console[_0x29a342(0xf6)](_0x29a342(0x123)+_0x537b6e);_0x27f90a&&console[_0x29a342(0xf6)](_0x29a342(0xd3));}const _0x15ae3d=await withSpinner(_0x29a342(0x13e),()=>_0x40ee2f[_0x29a342(0x121)][_0x29a342(0x103)]({'projectName':_0x537b6e,'workflowName':_0x6d281b,'includeRetried':_0x27f90a,'limit':_0x3481fb[_0x29a342(0xa9)]}),{'verbose':_0x3481fb['verbose']}),_0x241427=_0x15ae3d[_0x29a342(0x195)],_0xf6f20e=_0x3481fb[_0x29a342(0xa9)]||0x64,_0x47ab46=_0x241427[_0x29a342(0x221)]>=_0xf6f20e?a51_0x5bf18c[_0x29a342(0x1b0)](_0x29a342(0x22a)):'';console[_0x29a342(0xf6)]('✔\x20Found\x20'+_0x241427['length']+'\x20attempt'+(_0x241427[_0x29a342(0x221)]!==0x1?'s':'')+_0x47ab46);if(_0x3481fb['format']===_0x29a342(0x176)||_0x3481fb[_0x29a342(0x1d7)]===_0x29a342(0x201)||_0x3481fb[_0x29a342(0x1d7)]===_0x29a342(0xd8))await handleSDKOutput(_0x241427,_0x3481fb);else{if(_0x241427[_0x29a342(0x221)]===0x0){if(_0x537b6e&&_0x6d281b)console[_0x29a342(0x204)](_0x29a342(0x138)+_0x537b6e+'.'+_0x6d281b);else _0x537b6e?console['log']('No\x20attempts\x20found\x20in\x20project:\x20'+_0x537b6e):console[_0x29a342(0x204)](_0x29a342(0x142));}else{const _0x3be5ae=_0x3481fb[_0x29a342(0x1e3)],_0x3b3173=_0x241427[_0x29a342(0x1de)](_0xc3e028=>{const _0x5b865b=_0x29a342,_0x4379cc=a51_0x5bf18c[_0x5b865b(0x1b0)]('#'+_0xc3e028['id']),_0x25a21a=_0xc3e028[_0x5b865b(0x1fe)]?.['id'],_0x5a9cff=_0xc3e028[_0x5b865b(0x131)]||_0xc3e028[_0x5b865b(0x214)],_0x22a284=_0x25a21a&&_0x5a9cff?hyperlink(_0x4379cc,getWorkflowAttemptUrl(_0x3be5ae,_0x25a21a,_0x5a9cff,_0xc3e028['id'])):_0x4379cc,{icon:_0x16655a,text:_0x3288f4}=getAttemptStatusDisplay(_0xc3e028),_0x4f26e7=(_0xc3e028[_0x5b865b(0x1fe)]?.[_0x5b865b(0x174)]||'?')+'.'+(_0xc3e028[_0x5b865b(0x121)]?.[_0x5b865b(0x174)]||'?'),_0x3e02e0=_0xc3e028['sessionTime']?a51_0x5bf18c[_0x5b865b(0x1b0)](_0xc3e028[_0x5b865b(0x16a)]):'';return(_0x22a284+'\x20'+_0x16655a+(_0x3288f4?'\x20'+_0x3288f4:'')+'\x20'+_0x4f26e7+'\x20'+_0x3e02e0)[_0x5b865b(0x101)]();});await writeOutput(_0x3b3173[_0x29a342(0x192)]('\x0a'),_0x3481fb['output'],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']='workflow:attempt';[a51_0x22a388(0x1b4)]=a51_0x22a388(0x22f);async[a51_0x22a388(0xd2)](_0x4824a6){const _0x239b40=a51_0x22a388,{options:_0x44c040,args:_0x569136,tdx:_0x266b9d}=_0x4824a6,_0x3a5da1=_0x569136[0x0];if(!_0x3a5da1)return console[_0x239b40(0xf6)](_0x239b40(0x20c)),0x1;_0x44c040['verbose']&&console[_0x239b40(0xf6)]('Attempt\x20ID:\x20'+_0x3a5da1);const _0x2fe496=await withSpinner(_0x239b40(0x19c),()=>_0x266b9d[_0x239b40(0x121)][_0x239b40(0xfa)](_0x3a5da1),{'verbose':_0x44c040['verbose']}),_0x5f206c=_0x2fe496[_0x239b40(0x195)];let _0x32ee6e;!_0x5f206c['done']?_0x32ee6e=_0x5f206c[_0x239b40(0x1d4)]?_0x239b40(0x18c):_0x239b40(0x15b):_0x32ee6e=_0x5f206c[_0x239b40(0x179)]?_0x239b40(0x179):'error';let _0x156f81;if(_0x5f206c['createdAt']&&_0x5f206c[_0x239b40(0x1d3)]){const _0x3ee70e=new Date(_0x5f206c[_0x239b40(0x151)])[_0x239b40(0x1dc)](),_0x3c74a3=new Date(_0x5f206c['finishedAt'])[_0x239b40(0x1dc)]();_0x156f81=Math[_0x239b40(0x12d)]((_0x3c74a3-_0x3ee70e)/0x3e8);}const _0xf1a3df={'attempt_id':_0x5f206c['id'],'status':_0x32ee6e,..._0x5f206c[_0x239b40(0x1e4)]!==undefined&&{'index':_0x5f206c[_0x239b40(0x1e4)]},..._0x5f206c['project']&&{'project':_0x5f206c[_0x239b40(0x1fe)][_0x239b40(0x174)]},..._0x5f206c['workflow']&&{'workflow':_0x5f206c[_0x239b40(0x121)][_0x239b40(0x174)]},..._0x5f206c[_0x239b40(0x214)]&&{'session_id':_0x5f206c[_0x239b40(0x214)]},..._0x5f206c['sessionTime']&&{'session_time':_0x5f206c[_0x239b40(0x16a)]},..._0x5f206c[_0x239b40(0x21c)]&&{'retry_attempt':_0x5f206c['retryAttemptName']},..._0x156f81!==undefined&&{'duration_sec':_0x156f81},..._0x5f206c['createdAt']&&{'created_at':_0x5f206c[_0x239b40(0x151)]},..._0x5f206c[_0x239b40(0x1d3)]&&{'finished_at':_0x5f206c[_0x239b40(0x1d3)]},...Object[_0x239b40(0x244)](_0x5f206c[_0x239b40(0xb8)])[_0x239b40(0x221)]>0x0&&{'params':_0x5f206c[_0x239b40(0xb8)]}};return await handleSingleObjectOutput(_0xf1a3df,_0x44c040),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a51_0x22a388(0x174)]='workflow:tasks';['description']=a51_0x22a388(0xbd);async['execute'](_0x414455){const _0x364dcc=a51_0x22a388,{options:_0x3079a5,args:_0x5e3b07,tdx:_0x27e550}=_0x414455,_0x8bae87=_0x5e3b07[0x0];if(!_0x8bae87)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x52d603=_0x3079a5['includeSubtasks'];_0x3079a5[_0x364dcc(0xde)]&&(console[_0x364dcc(0xf6)](_0x364dcc(0x1ec)+_0x8bae87),_0x52d603&&console[_0x364dcc(0xf6)]('Including\x20subtasks:\x20yes'));const _0x28073b=await withSpinner(_0x364dcc(0x106),()=>_0x27e550[_0x364dcc(0x121)]['tasks'](_0x8bae87,_0x52d603||![]),{'verbose':_0x3079a5[_0x364dcc(0xde)]}),_0x17bbd7=_0x28073b[_0x364dcc(0x195)];return console['error'](_0x364dcc(0x17a)+_0x17bbd7[_0x364dcc(0x221)]+_0x364dcc(0xb7)+(_0x17bbd7['length']!==0x1?'s':'')),await handleSDKOutput(_0x17bbd7,_0x3079a5),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x1f2);[a51_0x22a388(0x1b4)]=a51_0x22a388(0xce);async[a51_0x22a388(0xd2)](_0x989bf6){const _0x226a9d=a51_0x22a388,{options:_0x443793,args:_0x4990c4,tdx:_0x4fd3a7}=_0x989bf6,_0x29d231=_0x4990c4[0x0];let _0xd40c28=_0x4990c4[0x1];if(!_0x29d231)return console['error'](_0x226a9d(0x20c)),0x1;_0x443793['verbose']&&(console[_0x226a9d(0xf6)]('Attempt\x20ID:\x20'+_0x29d231),_0xd40c28&&console[_0x226a9d(0xf6)](_0x226a9d(0x1c6)+_0xd40c28));const _0x262e93=await withSpinner(_0x226a9d(0x15a),()=>_0x4fd3a7[_0x226a9d(0x121)][_0x226a9d(0xaf)](_0x29d231,_0xd40c28),{'verbose':_0x443793[_0x226a9d(0xde)]}),_0x3cee2b=_0x262e93[_0x226a9d(0x195)];if(_0x3cee2b[_0x226a9d(0x221)]===0x0)return console['error'](_0x226a9d(0x12c)),0x0;if(!_0xd40c28&&(_0x443793[_0x226a9d(0x176)]||_0x443793[_0x226a9d(0x1d7)]))return await handleSDKOutput(_0x3cee2b,_0x443793),0x0;if(!_0xd40c28){const _0x16b476=_0x3cee2b[_0x226a9d(0x1de)](_0x550546=>({'title':_0x550546[_0x226a9d(0x146)]+'\x20('+formatBytes(_0x550546[_0x226a9d(0x1ce)])+')','value':_0x550546[_0x226a9d(0x146)]})),_0xbcb466=await a51_0x4f4bd3({'type':_0x226a9d(0xff),'name':_0x226a9d(0x1f4),'message':_0x226a9d(0x152),'choices':_0x16b476});if(!_0xbcb466['task'])return console[_0x226a9d(0xf6)](_0x226a9d(0x1cb)),0x0;_0xd40c28=_0xbcb466[_0x226a9d(0x1f4)];}const _0x1b4b70=await withSpinner('Downloading\x20logs...',()=>_0x4fd3a7[_0x226a9d(0x121)][_0x226a9d(0x1bd)](_0x29d231,_0xd40c28),{'verbose':_0x443793['verbose']}),_0x29d7b7=_0x1b4b70[_0x226a9d(0x195)];return _0x29d7b7?console[_0x226a9d(0x204)](_0x29d7b7):console['error']('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x1ad);[a51_0x22a388(0x1b4)]=a51_0x22a388(0x24c);async[a51_0x22a388(0xd2)](_0x53ee6a){const _0x2c64b5=a51_0x22a388,{options:_0x5af752,args:_0x40db3a,tdx:_0x1297b0}=_0x53ee6a,_0x5b931b=_0x40db3a[0x0];if(!_0x5b931b)return console[_0x2c64b5(0xf6)](_0x2c64b5(0x20c)),0x1;const _0x28969d=_0x5af752[_0x2c64b5(0x23e)];_0x5af752[_0x2c64b5(0xde)]&&(console[_0x2c64b5(0xf6)](_0x2c64b5(0x1ec)+_0x5b931b),_0x28969d&&console[_0x2c64b5(0xf6)]('Reason:\x20'+_0x28969d));if(!_0x5af752[_0x2c64b5(0x117)]){if(!isInteractive())return console[_0x2c64b5(0xf6)](a51_0x5bf18c[_0x2c64b5(0xf3)]('\x0aError:'),_0x2c64b5(0x23f)),console[_0x2c64b5(0xf6)](a51_0x5bf18c[_0x2c64b5(0x1b0)](_0x2c64b5(0x119))),0x1;const _0x4ba5db=await confirmKey(_0x2c64b5(0x175)+_0x5b931b+'?');if(!_0x4ba5db)return console[_0x2c64b5(0xf6)](a51_0x5bf18c[_0x2c64b5(0xfc)]('Cancelled')),0x1;}const _0x3e9b77=await withSpinner(_0x2c64b5(0xc8),()=>_0x1297b0[_0x2c64b5(0x121)][_0x2c64b5(0x208)](_0x5b931b,_0x28969d),{'verbose':_0x5af752[_0x2c64b5(0xde)]}),_0x47a1b6=_0x3e9b77['data'];return console['error']('✔\x20'+_0x47a1b6),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x114);[a51_0x22a388(0x1b4)]=a51_0x22a388(0xb9);async['execute'](_0x5d675d){const _0x8de37a=a51_0x22a388,{options:_0x3e009a,args:_0x148bd4,tdx:_0xf3834c}=_0x5d675d,_0xb7674f=_0x148bd4[0x0];if(!_0xb7674f)return console['error'](_0x8de37a(0x237)),console[_0x8de37a(0xf6)](_0x8de37a(0xe4)),0x1;let _0x4c1d01=![],_0x2d171e=_0xb7674f;if(_0xb7674f[_0x8de37a(0xb5)](_0x8de37a(0x1c4)))_0x4c1d01=!![],_0x2d171e=_0xb7674f[_0x8de37a(0x24a)](0x8);else{if(_0xb7674f[_0x8de37a(0xb5)]('attempt:'))_0x4c1d01=![],_0x2d171e=_0xb7674f[_0x8de37a(0x24a)](0x8);else return console[_0x8de37a(0xf6)](_0x8de37a(0x222)),console[_0x8de37a(0xf6)](_0x8de37a(0xe4)),0x1;}const _0x3d8a8c=_0x3e009a[_0x8de37a(0x1e6)],_0x370553=_0x3e009a[_0x8de37a(0xac)],_0x40d8d8=_0x3e009a[_0x8de37a(0xb8)],_0x1cd0c2=_0x3e009a[_0x8de37a(0x211)];_0x3e009a[_0x8de37a(0xde)]&&(console['error'](_0x8de37a(0x197)+(_0x4c1d01?_0x8de37a(0xe7):_0x8de37a(0xfa))+'\x20'+_0x2d171e),_0x3d8a8c&&console['error'](_0x8de37a(0x238)+_0x3d8a8c),_0x370553&&console['error'](_0x8de37a(0x1ba)+_0x370553),_0x40d8d8&&console[_0x8de37a(0xf6)]('Params:\x20'+_0x40d8d8),_0x1cd0c2&&console[_0x8de37a(0xf6)]('Force:\x20yes'));let _0x3ba4f0;if(_0x40d8d8)try{if(_0x40d8d8[_0x8de37a(0xb5)]('@')){const _0x2d9f7f=await import('fs/promises'),_0x4c80e1=_0x40d8d8[_0x8de37a(0x24a)](0x1),_0x518e80=await _0x2d9f7f['readFile'](_0x4c80e1,_0x8de37a(0x16d));_0x3ba4f0=JSON[_0x8de37a(0xc6)](_0x518e80);}else _0x3ba4f0=JSON[_0x8de37a(0xc6)](_0x40d8d8);}catch{return console['error'](_0x8de37a(0xe3)),0x1;}if(!_0x3e009a[_0x8de37a(0x117)]){if(!isInteractive())return console['error'](a51_0x5bf18c[_0x8de37a(0xf3)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x8de37a(0xf6)](a51_0x5bf18c[_0x8de37a(0x1b0)](_0x8de37a(0x119))),0x1;const _0x4569f6=await confirmKey(_0x8de37a(0x242)+(_0x4c1d01?'session':_0x8de37a(0xfa))+'\x20'+_0x2d171e+'?');if(!_0x4569f6)return console[_0x8de37a(0xf6)](a51_0x5bf18c[_0x8de37a(0xfc)](_0x8de37a(0x1cb))),0x1;}let _0x13b8d5;_0x4c1d01?_0x13b8d5=await withSpinner(_0x8de37a(0x215),()=>_0xf3834c[_0x8de37a(0x121)][_0x8de37a(0x1ea)](_0x2d171e,{'fromTask':_0x3d8a8c,'retryParams':_0x3ba4f0}),{'verbose':_0x3e009a[_0x8de37a(0xde)]}):_0x13b8d5=await withSpinner(_0x8de37a(0x107),()=>_0xf3834c[_0x8de37a(0x121)][_0x8de37a(0x205)](_0x2d171e,{'resumeFrom':_0x370553,'retryParams':_0x3ba4f0,'force':_0x1cd0c2}),{'verbose':_0x3e009a['verbose']});const _0x42333e=_0x13b8d5[_0x8de37a(0x195)];return console[_0x8de37a(0xf6)]('✔\x20Retry\x20started'),console[_0x8de37a(0xf6)](_0x8de37a(0xc2)+_0x42333e[_0x8de37a(0x173)]),console[_0x8de37a(0xf6)](_0x8de37a(0x9c)+_0x42333e['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]='workflow:run';[a51_0x22a388(0x1b4)]=a51_0x22a388(0x157);async['execute'](_0x1a04d8){const _0x2bbec8=a51_0x22a388,{options:_0x3e63fa,args:_0x4b3b96,tdx:_0x59ee69}=_0x1a04d8;let _0x5e523d=_0x4b3b96[0x0];if(!_0x5e523d){const _0x48ca48=this[_0x2bbec8(0x202)]([],_0x3e63fa),_0x4224ad=await withSpinner('Loading\x20workflows...',()=>_0x59ee69[_0x2bbec8(0x121)][_0x2bbec8(0xa7)](_0x48ca48,{'limit':_0x3e63fa['limit']}),{'verbose':_0x3e63fa[_0x2bbec8(0xde)]}),_0x48dd40=_0x4224ad[_0x2bbec8(0x195)];if(_0x48dd40[_0x2bbec8(0x221)]===0x0)return console[_0x2bbec8(0xf6)](_0x2bbec8(0xe6)),!_0x48ca48&&console[_0x2bbec8(0xf6)](a51_0x5bf18c[_0x2bbec8(0x1b0)](_0x2bbec8(0x10a))),0x1;const _0x148529=_0x48dd40[_0x2bbec8(0x1de)](_0x27b663=>({'title':_0x27b663[_0x2bbec8(0x1fe)]?.[_0x2bbec8(0x174)]+'.'+_0x27b663['name'],'value':_0x27b663[_0x2bbec8(0x1fe)]?.[_0x2bbec8(0x174)]+'.'+_0x27b663['name'],'description':_0x27b663[_0x2bbec8(0xf2)]?_0x2bbec8(0xcc)+_0x27b663['revision']:undefined})),_0xa5b8dc=await a51_0x4f4bd3({'type':'select','name':_0x2bbec8(0x121),'message':_0x2bbec8(0x194),'choices':_0x148529});if(!_0xa5b8dc['workflow'])return 0x1;_0x5e523d=_0xa5b8dc[_0x2bbec8(0x121)];}if(!_0x5e523d[_0x2bbec8(0xe0)]('.')){const _0x1d16fe=this[_0x2bbec8(0x202)]([],_0x3e63fa);if(_0x1d16fe)_0x5e523d=_0x1d16fe+'.'+_0x5e523d;else return console[_0x2bbec8(0xf6)](a51_0x5bf18c[_0x2bbec8(0xf3)](_0x2bbec8(0x1e0)),_0x2bbec8(0x249)),console['error'](a51_0x5bf18c[_0x2bbec8(0x1b0)](_0x2bbec8(0x10a))),0x1;}const _0x14821b=_0x3e63fa[_0x2bbec8(0x128)],_0x535d86=_0x3e63fa[_0x2bbec8(0x16a)],_0x478260={};if(_0x14821b&&Array[_0x2bbec8(0x124)](_0x14821b))for(const _0x11b006 of _0x14821b){const _0x4d2dba=_0x11b006[_0x2bbec8(0xd7)]('=');if(_0x4d2dba===-0x1)return console[_0x2bbec8(0xf6)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x11b006),console[_0x2bbec8(0xf6)](_0x2bbec8(0x190)),0x1;const _0x369d55=_0x11b006[_0x2bbec8(0x24a)](0x0,_0x4d2dba),_0x1b171a=_0x11b006[_0x2bbec8(0x24a)](_0x4d2dba+0x1);try{_0x478260[_0x369d55]=JSON['parse'](_0x1b171a);}catch{_0x478260[_0x369d55]=_0x1b171a;}}_0x3e63fa[_0x2bbec8(0xde)]&&(console[_0x2bbec8(0xf6)](_0x2bbec8(0x162)+_0x5e523d),Object[_0x2bbec8(0x244)](_0x478260)[_0x2bbec8(0x221)]>0x0&&console[_0x2bbec8(0xf6)](_0x2bbec8(0x1b8)+JSON[_0x2bbec8(0x246)](_0x478260)),_0x535d86&&console[_0x2bbec8(0xf6)](_0x2bbec8(0x11b)+_0x535d86));const _0x44917b=await withSpinner('Starting\x20workflow\x20run...',()=>_0x59ee69[_0x2bbec8(0x121)][_0x2bbec8(0xe2)](_0x5e523d,_0x478260,{'sessionTime':_0x535d86}),{'verbose':_0x3e63fa[_0x2bbec8(0xde)]}),_0x3a706d=_0x44917b[_0x2bbec8(0x195)];console['error'](_0x2bbec8(0xa3)),console[_0x2bbec8(0xf6)](_0x2bbec8(0x161)+_0x3a706d['id']),console[_0x2bbec8(0xf6)]('\x20\x20Session\x20ID:\x20'+_0x3a706d['sessionId']),console['error'](_0x2bbec8(0x186)+_0x3a706d[_0x2bbec8(0x1fe)]?.[_0x2bbec8(0x174)]),console[_0x2bbec8(0xf6)]('\x20\x20Workflow:\x20'+_0x3a706d['workflow']?.[_0x2bbec8(0x174)]);if(_0x3a706d[_0x2bbec8(0x1fe)]?.['id']&&_0x3a706d['sessionId']&&_0x3a706d['id']){const _0x48a6f9=_0x3e63fa[_0x2bbec8(0x1e3)],_0x2194bf=getConsoleUrl(_0x48a6f9,_0x2bbec8(0xcd)+_0x3a706d[_0x2bbec8(0x1fe)]['id']+'/sessions/'+_0x3a706d[_0x2bbec8(0x214)]+_0x2bbec8(0x136)+_0x3a706d['id']);console['error']('\x20\x20Console:\x20'+a51_0x5bf18c['cyan'](_0x2194bf));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a51_0x22a388(0xb3);[a51_0x22a388(0x1b4)]=a51_0x22a388(0x1ac);async['execute'](_0x8e89c9){const _0x28ddfc=a51_0x22a388,{options:_0x3c4370,args:_0x1751f5,tdx:_0x3296d0}=_0x8e89c9,_0x164e10=_0x1751f5[0x0],_0x5e04a8=_0x1751f5[0x1]||'.';if(!_0x164e10)return console[_0x28ddfc(0xf6)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x28ddfc(0xf6)](_0x28ddfc(0xd1)),0x1;const _0x3a1f6a=_0x3c4370['revision'];_0x3c4370[_0x28ddfc(0xde)]&&(console['error'](_0x28ddfc(0xba)+_0x164e10),console[_0x28ddfc(0xf6)]('Output\x20directory:\x20'+_0x5e04a8),_0x3a1f6a&&console[_0x28ddfc(0xf6)]('Revision:\x20'+_0x3a1f6a));const _0x2c89f5=await withSpinner(_0x28ddfc(0x24d)+_0x164e10+_0x28ddfc(0x156),()=>_0x3296d0[_0x28ddfc(0x121)][_0x28ddfc(0x1cc)](_0x164e10,_0x5e04a8,{'revision':_0x3a1f6a}),{'verbose':_0x3c4370[_0x28ddfc(0xde)]}),_0xd008b1=_0x2c89f5[_0x28ddfc(0x195)];return console['error']('✔\x20Downloaded\x20'+_0xd008b1[_0x28ddfc(0xb4)]),console[_0x28ddfc(0xf6)](_0x28ddfc(0x182)+_0xd008b1['revision']),console[_0x28ddfc(0xf6)]('\x20\x20Files\x20extracted:\x20'+_0xd008b1['filesExtracted']),console['error'](_0x28ddfc(0x1c9)+_0x5e04a8+'/'+_0xd008b1['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a51_0x22a388(0xd4);[a51_0x22a388(0x1b4)]=a51_0x22a388(0x172);async[a51_0x22a388(0xd2)](_0x1a3328){const _0x814c27=a51_0x22a388,{options:_0x1b95c2,args:_0x3dd527,tdx:_0x99fddd}=_0x1a3328;let _0x401bbe='.',_0x993034=_0x1b95c2[_0x814c27(0x174)];if(_0x3dd527[0x0]){const {promises:_0x4b9617}=await import('fs');try{const _0x5cd473=await _0x4b9617['stat'](_0x3dd527[0x0]);if(_0x5cd473[_0x814c27(0x153)]())_0x401bbe=_0x3dd527[0x0];else return console[_0x814c27(0xf6)](_0x814c27(0x12b)+_0x3dd527[0x0]+_0x814c27(0x168)),0x1;}catch{_0x993034=_0x3dd527[0x0],_0x401bbe='.';}}const _0xb43ffa=_0x1b95c2[_0x814c27(0xf2)],_0x1ae3cd=_0x1b95c2[_0x814c27(0xf9)];_0x1b95c2[_0x814c27(0xde)]&&(console[_0x814c27(0xf6)]('Project\x20directory:\x20'+_0x401bbe),_0x993034&&console[_0x814c27(0xf6)](_0x814c27(0x1bf)+_0x993034),_0xb43ffa&&console['error']('Revision:\x20'+_0xb43ffa),_0x1ae3cd&&console['error'](_0x814c27(0xd0)));const _0x34bb7a=await withSpinner(_0x814c27(0x171),()=>_0x99fddd[_0x814c27(0x121)][_0x814c27(0x11e)](_0x401bbe,{'projectName':_0x993034,'revision':_0xb43ffa,'skipValidation':_0x1ae3cd}),{'verbose':_0x1b95c2['verbose']}),_0x3ae6ba=_0x34bb7a[_0x814c27(0x195)];return console[_0x814c27(0xf6)]('✔\x20Pushed\x20'+_0x3ae6ba[_0x814c27(0xb4)]),console['error'](_0x814c27(0xca)+_0x3ae6ba[_0x814c27(0xb6)]),console['error'](_0x814c27(0x182)+_0x3ae6ba[_0x814c27(0xf2)]),await this[_0x814c27(0x134)](_0x99fddd,_0x3ae6ba[_0x814c27(0xb4)],_0x1b95c2[_0x814c27(0x1e3)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x23a);['description']=a51_0x22a388(0x217);async[a51_0x22a388(0xd2)](_0x5325ae){const _0x17afd8=a51_0x22a388,{options:_0x45591b,args:_0x1df2e5,tdx:_0x3707b1}=_0x5325ae,_0x4c5e64=_0x1df2e5[0x0],_0x4ef354=_0x1df2e5[0x1];if(!_0x4c5e64)return console['error'](a51_0x5bf18c[_0x17afd8(0xf3)](_0x17afd8(0x1e0)),_0x17afd8(0x21b)),console[_0x17afd8(0xf6)](a51_0x5bf18c[_0x17afd8(0x1b0)](_0x17afd8(0x133))),0x1;const _0x5495bf=_0x45591b[_0x17afd8(0xf2)];_0x45591b[_0x17afd8(0xde)]&&(console['error'](_0x17afd8(0xba)+_0x4c5e64),_0x4ef354&&console['error'](_0x17afd8(0x1f6)+_0x4ef354),_0x5495bf&&console[_0x17afd8(0xf6)](_0x17afd8(0xa2)+_0x5495bf),_0x45591b['dryRun']&&console[_0x17afd8(0xf6)](_0x17afd8(0x21f)));const _0x3c601b=await withSpinner(_0x17afd8(0x1ee)+_0x4c5e64+_0x17afd8(0x156),()=>_0x3707b1[_0x17afd8(0x121)][_0x17afd8(0x21a)](_0x4c5e64,{'targetDir':_0x4ef354,'revision':_0x5495bf}),{'verbose':_0x45591b[_0x17afd8(0xde)]}),_0x2b2ffa=_0x3c601b['data'];_0x2b2ffa[_0x17afd8(0x234)]?console[_0x17afd8(0xf6)](_0x17afd8(0x247)+_0x2b2ffa[_0x17afd8(0xb4)]):console[_0x17afd8(0xf6)](_0x17afd8(0xdc)+_0x2b2ffa['projectName']);console[_0x17afd8(0xf6)](_0x17afd8(0x182)+_0x2b2ffa[_0x17afd8(0xf2)]),console['error'](_0x17afd8(0x1c0)+(a51_0x108fb0[_0x17afd8(0x1d2)](process[_0x17afd8(0x166)](),_0x2b2ffa[_0x17afd8(0x1a4)])||'.')),console[_0x17afd8(0xf6)]('\x20\x20Changes:\x20'+a51_0x5bf18c[_0x17afd8(0xf7)]('+'+_0x2b2ffa[_0x17afd8(0x145)]['new']+'\x20new')+',\x20'+(a51_0x5bf18c['yellow']('~'+_0x2b2ffa[_0x17afd8(0x145)][_0x17afd8(0x109)]+_0x17afd8(0x115))+',\x20')+(a51_0x5bf18c[_0x17afd8(0xf3)]('-'+_0x2b2ffa['summary'][_0x17afd8(0xe5)]+_0x17afd8(0x1be))+',\x20')+(''+a51_0x5bf18c[_0x17afd8(0x1b0)](_0x2b2ffa[_0x17afd8(0x145)][_0x17afd8(0x19a)]+_0x17afd8(0x21e))));for(const _0x194f56 of _0x2b2ffa[_0x17afd8(0xa8)]){_0x194f56[_0x17afd8(0x1a5)]==='modified'&&_0x194f56[_0x17afd8(0x1d9)]&&(console[_0x17afd8(0xf6)]('\x0a'+a51_0x5bf18c[_0x17afd8(0xbb)]('---\x20'+_0x194f56[_0x17afd8(0x15d)])),console['error'](_0x194f56['diff']));}if(!_0x2b2ffa[_0x17afd8(0xd6)])return saveSessionContext({'workflow_project':_0x2b2ffa[_0x17afd8(0xb4)]},_0x45591b[_0x17afd8(0xe7)]),console[_0x17afd8(0xf6)](a51_0x5bf18c[_0x17afd8(0xf7)](_0x17afd8(0x23b))),console[_0x17afd8(0xf6)](a51_0x5bf18c[_0x17afd8(0x1b0)](_0x17afd8(0x1cd)+_0x2b2ffa[_0x17afd8(0xb4)])),0x0;if(_0x45591b[_0x17afd8(0x164)])return console[_0x17afd8(0xf6)](a51_0x5bf18c[_0x17afd8(0xfc)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x45591b[_0x17afd8(0x117)]){if(!isInteractive())return console[_0x17afd8(0xf6)](a51_0x5bf18c[_0x17afd8(0xf3)](_0x17afd8(0xd9)),_0x17afd8(0x23f)),console[_0x17afd8(0xf6)](a51_0x5bf18c[_0x17afd8(0x1b0)](_0x17afd8(0x119))),0x1;const _0x20dc5b=await confirmKey(_0x17afd8(0xa5));if(!_0x20dc5b)return console[_0x17afd8(0xf6)](a51_0x5bf18c[_0x17afd8(0xfc)](_0x17afd8(0x1cb)),_0x17afd8(0x9f)),0x1;}await withSpinner(_0x17afd8(0x130),()=>_0x3707b1['workflow'][_0x17afd8(0x1aa)](_0x2b2ffa,{'revision':_0x5495bf}),{'verbose':_0x45591b[_0x17afd8(0xde)]}),saveSessionContext({'workflow_project':_0x2b2ffa[_0x17afd8(0xb4)]},_0x45591b[_0x17afd8(0xe7)]),console['error'](a51_0x5bf18c['green'](_0x17afd8(0x15f)));const _0x30cb33=a51_0x108fb0[_0x17afd8(0x1d2)](process[_0x17afd8(0x166)](),_0x2b2ffa[_0x17afd8(0x1a4)])||'.';return console['error'](a51_0x5bf18c[_0x17afd8(0x1b0)]('\x20\x20Location:\x20'+_0x30cb33)),console[_0x17afd8(0xf6)](a51_0x5bf18c[_0x17afd8(0x1b0)](_0x17afd8(0x1cd)+_0x2b2ffa['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x224);[a51_0x22a388(0x1b4)]=a51_0x22a388(0x135);async[a51_0x22a388(0xd2)](_0xcfdb24){const _0x5bf818=a51_0x22a388,{options:_0x2e0f7b,args:_0x545015,tdx:_0x29dff5}=_0xcfdb24,_0x4b88df=this[_0x5bf818(0x235)](_0x545015,_0x2e0f7b),_0x28b808=_0x2e0f7b[_0x5bf818(0xf2)],_0xe1ecd1=_0x2e0f7b[_0x5bf818(0xf9)];_0x2e0f7b['verbose']&&(_0x4b88df&&console[_0x5bf818(0xf6)](_0x5bf818(0x191)+_0x4b88df),_0x28b808&&console['error'](_0x5bf818(0xa2)+_0x28b808),_0x2e0f7b['dryRun']&&console[_0x5bf818(0xf6)](_0x5bf818(0x21f)),_0xe1ecd1&&console[_0x5bf818(0xf6)](_0x5bf818(0xd0)));let _0x281709;try{_0x281709=await withSpinner('Analyzing\x20changes...',()=>_0x29dff5['workflow'][_0x5bf818(0x127)]({'sourceDir':_0x4b88df,'revision':_0x28b808,'skipValidation':_0xe1ecd1}),{'verbose':_0x2e0f7b['verbose']});}catch(_0x159dc9){if(_0x159dc9 instanceof Error&&_0x159dc9[_0x5bf818(0x17b)]['includes'](_0x5bf818(0x10b)))return console[_0x5bf818(0xf6)](a51_0x5bf18c['red']('Error:'),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x2e0f7b[_0x5bf818(0x1c1)]?console[_0x5bf818(0xf6)](a51_0x5bf18c[_0x5bf818(0x1b0)](_0x5bf818(0x1f3)+_0x2e0f7b[_0x5bf818(0x1c1)]+_0x5bf818(0x184)+_0x2e0f7b[_0x5bf818(0x1c1)]+'\x27')):console[_0x5bf818(0xf6)](a51_0x5bf18c[_0x5bf818(0x1b0)](_0x5bf818(0x1da))),0x1;throw _0x159dc9;}const _0x2f05c3=_0x281709['data'];console['error'](_0x5bf818(0xfb)+_0x2f05c3[_0x5bf818(0xb4)]),console[_0x5bf818(0xf6)](_0x5bf818(0x20f)+_0x2f05c3[_0x5bf818(0x18e)]),console[_0x5bf818(0xf6)](_0x5bf818(0x182)+_0x2f05c3[_0x5bf818(0xf2)]),console['error'](_0x5bf818(0x150)+a51_0x5bf18c[_0x5bf818(0xf7)]('+'+_0x2f05c3[_0x5bf818(0x145)]['new']+'\x20new')+',\x20'+(a51_0x5bf18c[_0x5bf818(0xfc)]('~'+_0x2f05c3[_0x5bf818(0x145)][_0x5bf818(0x109)]+_0x5bf818(0x115))+',\x20')+(a51_0x5bf18c['red']('-'+_0x2f05c3[_0x5bf818(0x145)][_0x5bf818(0xe5)]+_0x5bf818(0x1be))+',\x20')+(''+a51_0x5bf18c['dim'](_0x2f05c3['summary'][_0x5bf818(0x19a)]+_0x5bf818(0x21e))));for(const _0xa673e5 of _0x2f05c3[_0x5bf818(0xa8)]){_0xa673e5[_0x5bf818(0x1a5)]===_0x5bf818(0x109)&&_0xa673e5[_0x5bf818(0x1d9)]&&(console[_0x5bf818(0xf6)]('\x0a'+a51_0x5bf18c[_0x5bf818(0xbb)]('---\x20'+_0xa673e5[_0x5bf818(0x15d)])),console[_0x5bf818(0xf6)](_0xa673e5[_0x5bf818(0x1d9)]));}if(!_0x2f05c3[_0x5bf818(0xd6)])return console['error'](a51_0x5bf18c[_0x5bf818(0xf7)](_0x5bf818(0x1b3))),await this['showWorkflowConsoleUrl'](_0x29dff5,_0x2f05c3['projectName'],_0x2e0f7b['site']),0x0;if(_0x2e0f7b[_0x5bf818(0x164)])return console[_0x5bf818(0xf6)](a51_0x5bf18c[_0x5bf818(0xfc)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x2e0f7b[_0x5bf818(0x117)]){if(!isInteractive())return console[_0x5bf818(0xf6)](a51_0x5bf18c['red'](_0x5bf818(0xd9)),_0x5bf818(0x23f)),console[_0x5bf818(0xf6)](a51_0x5bf18c[_0x5bf818(0x1b0)](_0x5bf818(0x119))),0x1;const _0x14d59f=await confirmKey(_0x5bf818(0x1f0));if(!_0x14d59f)return console['error'](a51_0x5bf18c[_0x5bf818(0xfc)](_0x5bf818(0x1cb)),_0x5bf818(0x1c8)),0x1;}const _0x25fbdc=await withSpinner(_0x5bf818(0x21d),()=>_0x29dff5[_0x5bf818(0x121)]['executePushProject'](_0x2f05c3),{'verbose':_0x2e0f7b[_0x5bf818(0xde)]}),_0x2816c6=_0x25fbdc[_0x5bf818(0x195)];return console[_0x5bf818(0xf6)](a51_0x5bf18c[_0x5bf818(0xf7)](_0x5bf818(0x11c))),console['error'](_0x5bf818(0xca)+_0x2816c6[_0x5bf818(0xb6)]),console['error'](_0x5bf818(0x182)+_0x2816c6[_0x5bf818(0xf2)]),await this[_0x5bf818(0x134)](_0x29dff5,_0x2816c6['projectName'],_0x2e0f7b[_0x5bf818(0x1e3)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x12a);[a51_0x22a388(0x1b4)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a51_0x22a388(0xd2)](_0x205d9){const _0x41bfbc=a51_0x22a388,{options:_0x16244d,args:_0x1d629d,tdx:_0x13d357}=_0x205d9,_0x4913b0=this[_0x41bfbc(0x235)](_0x1d629d,_0x16244d),_0x471b19=_0x16244d[_0x41bfbc(0x174)],_0x15b7de=_0x16244d[_0x41bfbc(0xf2)],_0xbce095=_0x16244d[_0x41bfbc(0xf9)];if(!_0x4913b0)return console[_0x41bfbc(0xf6)](a51_0x5bf18c[_0x41bfbc(0xf3)]('Error:'),_0x41bfbc(0x1dd)),console[_0x41bfbc(0xf6)](a51_0x5bf18c['dim']('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x41bfbc(0xf6)](a51_0x5bf18c[_0x41bfbc(0x1b0)](_0x41bfbc(0x1d5))),0x1;if(!_0x471b19)return console[_0x41bfbc(0xf6)](a51_0x5bf18c[_0x41bfbc(0xf3)](_0x41bfbc(0x1e0)),_0x41bfbc(0x10c)),console[_0x41bfbc(0xf6)](a51_0x5bf18c[_0x41bfbc(0x1b0)](_0x41bfbc(0x1a9))),0x1;_0x16244d[_0x41bfbc(0xde)]&&(console['error'](_0x41bfbc(0x191)+_0x4913b0),console[_0x41bfbc(0xf6)](_0x41bfbc(0x206)+_0x471b19),_0x15b7de&&console['error'](_0x41bfbc(0xa2)+_0x15b7de),_0x16244d[_0x41bfbc(0x164)]&&console['error']('Dry\x20run:\x20yes'),_0xbce095&&console['error'](_0x41bfbc(0xd0)));const _0x36ef65=await withSpinner(_0x41bfbc(0x17e),()=>_0x13d357[_0x41bfbc(0x121)][_0x41bfbc(0x120)](_0x4913b0,_0x471b19,{'revision':_0x15b7de,'skipValidation':_0xbce095}),{'verbose':_0x16244d[_0x41bfbc(0xde)]}),_0xdb1c64=_0x36ef65[_0x41bfbc(0x195)];console['error'](_0x41bfbc(0x10d)+_0xdb1c64[_0x41bfbc(0x18e)]);_0xdb1c64['sourceProjectName']&&console[_0x41bfbc(0xf6)]('Source\x20project:\x20'+_0xdb1c64[_0x41bfbc(0xbf)]);console[_0x41bfbc(0xf6)](_0x41bfbc(0x206)+_0xdb1c64[_0x41bfbc(0xf0)]),console['error'](_0x41bfbc(0xa2)+_0xdb1c64[_0x41bfbc(0xf2)]),console[_0x41bfbc(0xf6)](_0x41bfbc(0x1b9)+_0xdb1c64[_0x41bfbc(0x1af)]);_0xdb1c64[_0x41bfbc(0x1d6)]&&(console['error'](a51_0x5bf18c[_0x41bfbc(0xfc)]('\x0a⚠\x20Project\x20\x22'+_0xdb1c64[_0x41bfbc(0xf0)]+_0x41bfbc(0x148)+_0xdb1c64[_0x41bfbc(0x10e)]+')')),console[_0x41bfbc(0xf6)](a51_0x5bf18c[_0x41bfbc(0xfc)](_0x41bfbc(0x209))));if(_0x16244d[_0x41bfbc(0x164)])return console[_0x41bfbc(0xf6)](a51_0x5bf18c[_0x41bfbc(0xfc)](_0x41bfbc(0xc1))),0x0;if(!_0x16244d[_0x41bfbc(0x117)]){if(!isInteractive())return console[_0x41bfbc(0xf6)](a51_0x5bf18c[_0x41bfbc(0xf3)](_0x41bfbc(0xd9)),_0x41bfbc(0x23f)),console['error'](a51_0x5bf18c[_0x41bfbc(0x1b0)](_0x41bfbc(0x119))),0x1;const _0x5d9a0f=_0xdb1c64['sourceProjectName']||a51_0x108fb0[_0x41bfbc(0x144)](_0x4913b0),_0x29946d=_0xdb1c64['targetExists']?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x471b19+_0x41bfbc(0x1db):_0x41bfbc(0x1f5)+_0x5d9a0f+_0x41bfbc(0xdb)+_0x471b19+'\x22?',_0x88002b=await confirmKey(_0x29946d);if(!_0x88002b)return console['error'](a51_0x5bf18c[_0x41bfbc(0xfc)](_0x41bfbc(0x1cb))),0x1;}const _0x88b4d3=await withSpinner(_0xdb1c64[_0x41bfbc(0x1d6)]?_0x41bfbc(0x9b)+_0x471b19+_0x41bfbc(0x156):_0x41bfbc(0x1f7)+_0x471b19+'...',()=>_0x13d357[_0x41bfbc(0x121)]['executeCloneProject'](_0xdb1c64),{'verbose':_0x16244d[_0x41bfbc(0xde)]}),_0xeb1080=_0x88b4d3[_0x41bfbc(0x195)];return console[_0x41bfbc(0xf6)](a51_0x5bf18c[_0x41bfbc(0xf7)](_0xdb1c64['targetExists']?_0x41bfbc(0x11f):_0x41bfbc(0x1ca))),console[_0x41bfbc(0xf6)](_0x41bfbc(0x186)+_0xeb1080['newProjectName']),console[_0x41bfbc(0xf6)]('\x20\x20Project\x20ID:\x20'+_0xeb1080[_0x41bfbc(0xe8)]),console[_0x41bfbc(0xf6)](_0x41bfbc(0x182)+_0xeb1080[_0x41bfbc(0xf2)]),await this['showWorkflowConsoleUrl'](_0x13d357,_0xeb1080['newProjectName'],_0x16244d[_0x41bfbc(0x1e3)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x125);[a51_0x22a388(0x1b4)]=a51_0x22a388(0x112);async[a51_0x22a388(0xd2)](_0x555115){const _0x4f4c8e=a51_0x22a388,{options:_0x1bc4d0,args:_0xb668c6,tdx:_0xa629f7}=_0x555115,_0x46f820=_0xb668c6[0x0];if(!_0x46f820)return console['error'](_0x4f4c8e(0x1d8)),console[_0x4f4c8e(0xf6)](_0x4f4c8e(0x1a2)),0x1;_0x1bc4d0[_0x4f4c8e(0xde)]&&console[_0x4f4c8e(0xf6)](_0x4f4c8e(0xba)+_0x46f820);if(!_0x1bc4d0[_0x4f4c8e(0x117)]){if(!isInteractive())return console[_0x4f4c8e(0xf6)](a51_0x5bf18c[_0x4f4c8e(0xf3)](_0x4f4c8e(0xd9)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a51_0x5bf18c[_0x4f4c8e(0x1b0)](_0x4f4c8e(0x119))),0x1;const _0x37b925=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x46f820+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x37b925)return console[_0x4f4c8e(0xf6)](a51_0x5bf18c['yellow'](_0x4f4c8e(0x1cb))),0x1;}const _0x56d3b7=await withSpinner('Deleting\x20project\x20'+_0x46f820+_0x4f4c8e(0x156),()=>_0xa629f7['workflow'][_0x4f4c8e(0xc9)](_0x46f820),{'verbose':_0x1bc4d0[_0x4f4c8e(0xde)]}),_0x333b9e=_0x56d3b7['data'];return console['error'](_0x4f4c8e(0x1bb)+_0x333b9e['projectName']),console[_0x4f4c8e(0xf6)](_0x4f4c8e(0xca)+_0x333b9e[_0x4f4c8e(0xb6)]),0x0;}}export function parseKeyValue(_0x2455e0){const _0xdb6dfa=a51_0x22a388,_0x1678e0=_0x2455e0[_0xdb6dfa(0xd7)]('=');if(_0x1678e0===-0x1)throw new Error(_0xdb6dfa(0x159)+_0x2455e0+_0xdb6dfa(0x12f));const _0x33d1a5=_0x2455e0[_0xdb6dfa(0x24a)](0x0,_0x1678e0),_0x5a0004=_0x2455e0[_0xdb6dfa(0x24a)](_0x1678e0+0x1);if(!_0x33d1a5)throw new Error(_0xdb6dfa(0xed));return{'key':_0x33d1a5,'value':_0x5a0004};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x226);[a51_0x22a388(0x1b4)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a51_0x22a388(0xd2)](_0x5e2b52){const _0x2f6c79=a51_0x22a388,{options:_0x1bac9b,args:_0x2c53b5,tdx:_0x2e731d}=_0x5e2b52,_0x1dca4d=this[_0x2f6c79(0x118)](_0x2c53b5,_0x1bac9b);if(!_0x1dca4d)return 0x1;_0x1bac9b[_0x2f6c79(0xde)]&&console[_0x2f6c79(0xf6)]('Project:\x20'+_0x1dca4d);const _0x324164=await withSpinner(_0x2f6c79(0x18a),()=>_0x2e731d['workflow'][_0x2f6c79(0x105)](_0x1dca4d),{'verbose':_0x1bac9b[_0x2f6c79(0xde)]}),{secrets:_0x2db372}=_0x324164[_0x2f6c79(0x195)];return console['error'](_0x2f6c79(0x17a)+_0x2db372[_0x2f6c79(0x221)]+_0x2f6c79(0xf5)+(_0x2db372['length']!==0x1?'s':'')),await handleSDKOutput(_0x2db372,_0x1bac9b),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x223);[a51_0x22a388(0x1b4)]='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async[a51_0x22a388(0xd2)](_0x1fbba7){const _0x2642c1=a51_0x22a388,{options:_0x4a89d2,args:_0x9a2265,tdx:_0x895a46}=_0x1fbba7;let _0x149a41,_0x5effae;if(_0x9a2265[_0x2642c1(0x221)]>=0x1&&!_0x9a2265[0x0]['includes']('='))_0x149a41=_0x9a2265[0x0],_0x5effae=_0x9a2265['slice'](0x1);else{if(_0x9a2265[_0x2642c1(0x221)]>=0x1&&_0x4a89d2[_0x2642c1(0x1c1)])_0x149a41=_0x4a89d2[_0x2642c1(0x1c1)],_0x5effae=_0x9a2265;else return _0x9a2265[_0x2642c1(0x221)]>=0x1?(console[_0x2642c1(0xf6)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x2642c1(0x10a)),0x1):(console['error'](_0x2642c1(0xb1)),console[_0x2642c1(0xf6)](_0x2642c1(0x1d0)),0x1);}if(_0x5effae[_0x2642c1(0x221)]===0x0)return console[_0x2642c1(0xf6)](_0x2642c1(0xb1)),console[_0x2642c1(0xf6)](_0x2642c1(0x1d0)),0x1;const _0x2a06c4={};try{for(const _0x4ef91d of _0x5effae){const {key:_0x147283,value:_0xcd7782}=parseKeyValue(_0x4ef91d);_0x2a06c4[_0x147283]=_0xcd7782;}}catch(_0x455620){return _0x455620 instanceof Error&&console[_0x2642c1(0xf6)](a51_0x5bf18c[_0x2642c1(0xf3)](_0x2642c1(0x1e0)),_0x455620[_0x2642c1(0x17b)]),0x1;}const _0x1c4890=Object['keys'](_0x2a06c4);_0x4a89d2['verbose']&&(console[_0x2642c1(0xf6)](_0x2642c1(0xba)+_0x149a41),console[_0x2642c1(0xf6)]('Secrets\x20to\x20set:\x20'+_0x1c4890['join'](',\x20')));const _0x3b6bef=await withSpinner(_0x1c4890['length']===0x1?_0x2642c1(0x178):_0x2642c1(0xeb)+_0x1c4890[_0x2642c1(0x221)]+'\x20secrets...',()=>_0x895a46[_0x2642c1(0x121)][_0x2642c1(0xbe)](_0x149a41,_0x2a06c4),{'verbose':_0x4a89d2['verbose']}),_0x4d72de=_0x3b6bef['data'];return console[_0x2642c1(0xf6)](_0x1c4890[_0x2642c1(0x221)]===0x1?_0x2642c1(0x243)+_0x4d72de[_0x2642c1(0x244)][0x0]+_0x2642c1(0x1c5)+_0x4d72de[_0x2642c1(0xb4)]+'\x27':'✔\x20'+_0x4d72de[_0x2642c1(0x244)][_0x2642c1(0x221)]+_0x2642c1(0x216)+_0x4d72de[_0x2642c1(0xb4)]+'\x27'),(_0x4a89d2[_0x2642c1(0x176)]||_0x4a89d2[_0x2642c1(0x201)])&&await handleSingleObjectOutput(_0x4d72de,_0x4a89d2),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0xaa);['description']=a51_0x22a388(0x16c);async[a51_0x22a388(0xd2)](_0x1b8163){const _0xa02d26=a51_0x22a388,{options:_0x20afcb,args:_0x2bf17d,tdx:_0x2aa889}=_0x1b8163;let _0x2751ad,_0xa531f1;if(_0x2bf17d[_0xa02d26(0x221)]>=0x2)_0x2751ad=_0x2bf17d[0x0],_0xa531f1=_0x2bf17d[0x1];else{if(_0x2bf17d[_0xa02d26(0x221)]===0x1&&_0x20afcb[_0xa02d26(0x1c1)])_0x2751ad=_0x20afcb['workflowProject'],_0xa531f1=_0x2bf17d[0x0];else return _0x2bf17d[_0xa02d26(0x221)]===0x1?(console[_0xa02d26(0xf6)]('Error:\x20Project\x20name\x20is\x20required'),console[_0xa02d26(0xf6)](_0xa02d26(0x10a)),0x1):(console[_0xa02d26(0xf6)](_0xa02d26(0x203)),console[_0xa02d26(0xf6)](_0xa02d26(0xc0)),0x1);}_0x20afcb[_0xa02d26(0xde)]&&(console[_0xa02d26(0xf6)](_0xa02d26(0xba)+_0x2751ad),console['error']('Key:\x20'+_0xa531f1));if(!_0x20afcb[_0xa02d26(0x117)]){if(!isInteractive())return console[_0xa02d26(0xf6)](a51_0x5bf18c['red'](_0xa02d26(0xd9)),_0xa02d26(0x23f)),console[_0xa02d26(0xf6)](a51_0x5bf18c[_0xa02d26(0x1b0)](_0xa02d26(0x119))),0x1;const _0x5eed28=await confirmKey(_0xa02d26(0x22b)+_0xa531f1+_0xa02d26(0x1fc)+_0x2751ad+'\x27?');if(!_0x5eed28)return console['error'](a51_0x5bf18c[_0xa02d26(0xfc)](_0xa02d26(0x1cb))),0x1;}const _0x5c1535=await withSpinner(_0xa02d26(0x141),()=>_0x2aa889[_0xa02d26(0x121)][_0xa02d26(0xd5)](_0x2751ad,_0xa531f1),{'verbose':_0x20afcb['verbose']}),_0x381d4e=_0x5c1535[_0xa02d26(0x195)];return console['error']('✔\x20Secret\x20\x27'+_0x381d4e[_0xa02d26(0x1b2)]+_0xa02d26(0x132)+_0x381d4e[_0xa02d26(0xb4)]+'\x27'),(_0x20afcb[_0xa02d26(0x176)]||_0x20afcb['jsonl'])&&await handleSingleObjectOutput(_0x381d4e,_0x20afcb),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(_0x1428a6){const _0x278aab=a51_0x22a388,_0x451e0c=Math['floor'](_0x1428a6/0x3e8),_0x36c19a=Math['floor'](_0x451e0c/0x3c),_0x14f753=Math[_0x278aab(0xdd)](_0x36c19a/0x3c),_0x1ce6ac=Math[_0x278aab(0xdd)](_0x14f753/0x18);if(_0x1ce6ac>0x0){const _0x101211=_0x14f753%0x18;return _0x101211>0x0?_0x1ce6ac+'d\x20'+_0x101211+'h':_0x1ce6ac+'d';}else{if(_0x14f753>0x0){const _0x2572b9=_0x36c19a%0x3c;return _0x2572b9>0x0?_0x14f753+'h\x20'+_0x2572b9+'m':_0x14f753+'h';}else{if(_0x36c19a>0x0){const _0x4a0f4c=_0x451e0c%0x3c;return _0x4a0f4c>0x0?_0x36c19a+'m\x20'+_0x4a0f4c+'s':_0x36c19a+'m';}else return _0x451e0c+'s';}}}function formatTimestamp(_0x4acb03,_0x6b69ea){const _0x54f91e=a51_0x22a388,_0x29127f=new Date(_0x4acb03),_0x58c0a7=String(_0x29127f[_0x54f91e(0x1fa)]())[_0x54f91e(0x17d)](0x2,'0'),_0x5e4109=String(_0x29127f[_0x54f91e(0x14d)]())[_0x54f91e(0x17d)](0x2,'0'),_0x1683f1=_0x58c0a7+':'+_0x5e4109,_0x5e6762=_0x29127f[_0x54f91e(0x1e9)]()===_0x6b69ea[_0x54f91e(0x1e9)]()&&_0x29127f[_0x54f91e(0x187)]()===_0x6b69ea['getMonth']()&&_0x29127f['getDate']()===_0x6b69ea[_0x54f91e(0x149)]();if(_0x5e6762)return _0x1683f1;else{const _0x2262e4=String(_0x29127f['getMonth']()+0x1)[_0x54f91e(0x17d)](0x2,'0'),_0x381b9f=String(_0x29127f[_0x54f91e(0x149)]())['padStart'](0x2,'0');return _0x2262e4+'-'+_0x381b9f+'\x20'+_0x1683f1;}}function formatDate(_0x22af93){const _0x4ba063=a51_0x22a388,_0x37df52=_0x22af93[_0x4ba063(0x1e9)](),_0x478199=String(_0x22af93['getMonth']()+0x1)[_0x4ba063(0x17d)](0x2,'0'),_0x5d30b0=String(_0x22af93[_0x4ba063(0x149)]())[_0x4ba063(0x17d)](0x2,'0');return _0x37df52+'-'+_0x478199+'-'+_0x5d30b0;}function getTaskStateIcon(_0x52646e){const _0x90fac7={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x90fac7[_0x52646e]||'⚪';}function getBarChar(_0x54c532){const _0x53af6c=a51_0x22a388;return _0x54c532===_0x53af6c(0xf6)||_0x54c532==='group_error'?'×':'─';}function a51_0x15a1(){const _0x38f735=['getDate','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','toLowerCase','No\x20workflow\x20projects\x20found','getMinutes','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','resolveProjectId','\x20\x20Changes:\x20','createdAt','Select\x20a\x20task\x20to\x20view\x20logs:','isDirectory','resolve','\x20logs','...','Start\x20a\x20workflow\x20run','No\x20sessions\x20with\x20timing\x20information','Invalid\x20format:\x20','Fetching\x20log\x20files...','running',',\x20Workflow:\x20','path','764923JSlXkI','✔\x20Pull\x20complete','sessions','\x20\x20Attempt\x20ID:\x20','Workflow:\x20','fullName','dryRun','\x20session','cwd','ICON_SPACING','\x20is\x20not\x20a\x20directory','\x0aPolling...\x20(','sessionTime','\x20tasks','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','utf-8','Warning:','9FoyEzQ','max','Pushing\x20workflow\x20project...','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','attemptId','name','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','json','No\x20sessions\x20found\x20for:\x20','Setting\x20secret...','success','✔\x20Found\x20','message','No\x20projects\x20match\x20pattern:\x20','padStart','Analyzing\x20project...','get','MIN_TIMELINE_WIDTH','130VhtFrZ','\x20\x20Revision:\x20','filter','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','12960FhlFLr','\x20\x20Project:\x20','getMonth','No\x20sessions\x20found','text','Listing\x20secrets...','Loading\x20sessions...','canceling','Pattern:\x20','sourceDir','Auto-selected\x20latest\x20session:\x20','Expected\x20format:\x20--param\x20key=value','Source\x20directory:\x20','join','1177055sIldPh','Select\x20a\x20workflow\x20to\x20run','data','status','Target:\x20','duration','follow','unchanged','startedAt','Getting\x20attempt\x20details...','No\x20sessions\x20found\x20in\x20project:\x20','439818ECCzdr','list','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Usage:\x20workflow:delete\x20<project-name-or-id>','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','targetDir','type','workflow:workflows','MAX_TASKS_DISPLAY','Resolving\x20project\x20\x27','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','applyPullProject','TASK_NAME_WIDTH','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','workflow:kill','ICON_WIDTH','fileCount','dim','(use\x20--limit\x20to\x20see\x20more)','key','\x0a✔\x20No\x20changes\x20to\x20push','description','autocomplete','workflowName','renderSingleTimeline','Parameters:\x20','Files\x20to\x20upload:\x20','Resume\x20from:\x20','✔\x20Deleted\x20project\x20','\x20(system)','logs','\x20deleted','Project\x20name:\x20','\x20\x20Target:\x20','workflowProject','\x0aFailed\x20to\x20fetch\x20attempt\x20data','sys','session:','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Task\x20name:\x20','workflow:attempts','-\x20nothing\x20pushed','\x20\x20Location:\x20','✔\x20Clone\x20complete','Cancelled','download','\x20\x20Session\x20context\x20set\x20to:\x20','fileSize','value','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','values','relative','finishedAt','cancelRequested','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','targetExists','format','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','diff','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','\x22\x20with\x20new\x20revision?','getTime','Source\x20directory\x20is\x20required','map','\x20sessions\x20','Error:','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Attempt:\x20','site','index','✔\x20Workflow\x20project\x20set\x20to:\x20','fromTask','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','columns','getFullYear','retrySession','Total:\x20','Attempt\x20ID:\x20','blue','Pulling\x20project\x20','isTTY','\x0aPush\x20these\x20changes?','\x1b[1A\x1b[2K','workflow:logs','Tip:\x20cd\x20to\x20workflows/','task','\x0aClone\x20\x22','Target\x20directory:\x20','Cloning\x20to\x20','toISOString','Loading\x20session...','getHours','Session\x20','\x27\x20from\x20project\x20\x27','output','project','2fXfHev','size','jsonl','resolveProject','Error:\x20Secret\x20key\x20is\x20required','log','retryAttempt','New\x20project\x20name:\x20','durationMs','kill','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','planned','stdout','Error:\x20Attempt\x20ID\x20is\x20required','workflow:use','find','\x20\x20Source:\x20','state','force','updatedAt','🔄\x20','sessionId','Retrying\x20session...','\x20secrets\x20set\x20for\x20project\x20\x27','Pull\x20workflow\x20project\x20to\x20local\x20folder','\x0a✔\x20Attempt\x20complete','MAX_LABEL_COUNT','pullProject','Project\x20name\x20is\x20required','retryAttemptName','Pushing\x20project...','\x20unchanged','Dry\x20run:\x20yes','GUTTER','length','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','workflow:secrets:set','workflow:push','lastAttempt','workflow:secrets:list','parseProjectWorkflowPattern','List\x20workflow\x20attempts','\x20\x20tdx\x20wf\x20use\x20<project>','\x20(use\x20--limit\x20to\x20show\x20more)','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','split','Status:\x20','(unknown)','Show\x20specific\x20attempt\x20details','5945640cVAfVm','displayLine','end','\x20from\x20session\x20','isNewProject','resolveProjectDir','all','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','From\x20task:\x20','match','workflow:pull','\x0a✔\x20Already\x20up\x20to\x20date','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','now','reason','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','startTime','navigateSessionsInteractive','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','✔\x20Secret\x20\x27','keys','repeat','stringify','→\x20New\x20project:\x20','sort','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','substring','context','Kill\x20a\x20running\x20attempt','Downloading\x20project\x20','metadata','replace','unknown','set','Updating\x20','\x20\x20Session\x20ID:\x20','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','tdx\x20wf\x20attempt\x20','-\x20no\x20files\x20written','total','localeCompare','Revision:\x20','✔\x20Workflow\x20run\x20started','\x20\x20Console:\x20','\x0aApply\x20these\x20changes?','workflow:sessions','workflows','changes','limit','workflow:secrets:delete','renderTimeline','resumeFrom','renderSessionsTimeline','Latest\x20session\x20has\x20no\x20attempt','logFiles','\x20of\x20','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','window','workflow:download','projectName','startsWith','projectId','\x20task','params','Retry\x20a\x20session\x20or\x20attempt','Project:\x20','cyan','write','Show\x20tasks\x20for\x20an\x20attempt','setSecrets','sourceProjectName','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','\x0aDry\x20run\x20-\x20no\x20project\x20created','\x20\x20New\x20attempt\x20ID:\x20','group_error','42SgXLyd','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','parse','pollTimeline','Killing\x20attempt...','delete','\x20\x20Project\x20ID:\x20','start','revision:\x20','/app/workflows/','Show\x20logs\x20for\x20a\x20workflow\x20attempt','includeRetried','Validation:\x20skipped','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','execute','Include\x20retried:\x20yes','workflow:upload','deleteSecret','hasChanges','indexOf','table','\x0aError:','\x27...','\x22\x20to\x20new\x20project\x20\x22','→\x20Project:\x20','floor','verbose','white','includes','done','run','Error:\x20Invalid\x20JSON\x20in\x20--params','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','deleted','No\x20workflows\x20found','session','newProjectId','slice','tasks','Setting\x20','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','Key\x20cannot\x20be\x20empty','splice','Failed\x20to\x20fetch\x20attempt\x20data','newProjectName','No\x20matching\x20sessions\x20found','revision','red','trim','\x20secret','error','green','LABEL_WIDTH_DIVISOR','skipValidation','attempt','✔\x20Project:\x20','yellow','pending','4745652klNLnU','select','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','trimEnd','📁\x20','attempts','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','listSecrets','Getting\x20attempt\x20tasks...','Retrying\x20attempt...','every','modified','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','No\x20workflow\x20tdx.json\x20found','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','Source:\x20','existingProjectId','msPerChar','\x20has\x20no\x20attempts','from','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','fill','workflow:retry','\x20modified','868FhWAQL','yes','requireProject','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','some','Session\x20time:\x20','✔\x20Push\x20complete','MIN_LABEL_COUNT','push','✔\x20Project\x20updated','prepareCloneProject','workflow','No\x20workflows\x20found\x20in\x20project:\x20','Filter:\x20project=','isArray','workflow:delete','projects','preparePushProject','param','Listing\x20workflow\x20projects...','workflow:clone','Error:\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','round','icon','.\x20Expected\x20format:\x20KEY=VALUE','Writing\x20files...','session_id','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','showWorkflowConsoleUrl','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','/attempt/','3596019clpXQF','No\x20attempts\x20found\x20for:\x20','workflow:timeline','min','Using\x20attempt\x20','📋\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Listing\x20workflow\x20attempts...','⚠\x20Showing\x20first\x20','Filter:\x20','Deleting\x20secret...','No\x20attempts\x20found','buildTimelineData','basename','summary','taskName','workflow:projects','\x22\x20already\x20exists\x20(ID:\x20'];a51_0x15a1=function(){return _0x38f735;};return a51_0x15a1();}function getBarColor(_0x5ef56b){const _0x22292a=a51_0x22a388,_0x3c9c10={'success':a51_0x5bf18c['green'],'error':a51_0x5bf18c[_0x22292a(0xf3)],'group_error':a51_0x5bf18c['red'],'running':a51_0x5bf18c[_0x22292a(0x1ed)],'blocked':a51_0x5bf18c[_0x22292a(0xfc)],'planned':a51_0x5bf18c[_0x22292a(0x1b0)],'canceling':a51_0x5bf18c[_0x22292a(0xfc)]};return _0x3c9c10[_0x5ef56b]||a51_0x5bf18c[_0x22292a(0xdf)];}function parseTaskName(_0x3baa75){const _0x4cb243=a51_0x22a388;let _0xf280cf=_0x3baa75[_0x4cb243(0x24f)](/^\++/,'');const _0x4f6d6f=_0xf280cf[_0x4cb243(0x22c)]('+'),_0xf94e53=_0x4f6d6f[_0x4cb243(0x221)]>0x1?_0x4f6d6f[_0x4cb243(0x221)]-0x2:0x0,_0x1ebcc0=_0x4f6d6f[_0x4f6d6f[_0x4cb243(0x221)]-0x1]||_0xf280cf;return{'level':_0xf94e53,'name':'+'+_0x1ebcc0};}function truncateTaskName(_0x8c2696,_0x3ed74c){const _0x342955=a51_0x22a388,_0x7b2fe4=stringWidth(_0x8c2696);if(_0x7b2fe4<=_0x3ed74c)return _0x8c2696;let _0x3e3a78=_0x8c2696;while(stringWidth(_0x3e3a78+'…')>_0x3ed74c&&_0x3e3a78[_0x342955(0x221)]>0x0){_0x3e3a78=_0x3e3a78['slice'](0x0,-0x1);}return _0x3e3a78+'…';}function calculateTimeScale(_0x1be0e0,_0x1b1ded){const _0x547c1f=a51_0x22a388;return{'startTime':_0x1be0e0[_0x547c1f(0xcb)],'endTime':_0x1be0e0[_0x547c1f(0x232)],'durationMs':_0x1be0e0[_0x547c1f(0x198)],'msPerChar':_0x1be0e0['duration']/_0x1b1ded};}function timeToPosition(_0xf050d0,_0x2e746d,_0x330eb4){const _0x309ec8=a51_0x22a388,_0x3cafe3=_0xf050d0-_0x2e746d[_0x309ec8(0x240)],_0x398b87=Math[_0x309ec8(0xdd)](_0x3cafe3/_0x2e746d[_0x309ec8(0x10f)]);return Math[_0x309ec8(0x170)](0x0,Math[_0x309ec8(0x13a)](_0x398b87,_0x330eb4));}function renderTimeAxis(_0x833dc2,_0x17cb8a){const _0x58cafe=a51_0x22a388,_0x4c6d9e=Math[_0x58cafe(0x13a)](TIMELINE_CONFIG[_0x58cafe(0x219)],Math[_0x58cafe(0x170)](TIMELINE_CONFIG[_0x58cafe(0x11d)],Math[_0x58cafe(0xdd)](_0x17cb8a/TIMELINE_CONFIG[_0x58cafe(0xf8)]))),_0x2896b7=_0x833dc2[_0x58cafe(0x207)]/(_0x4c6d9e-0x1),_0x3a9c8c=new Date(_0x833dc2['startTime']),_0x5964ec=[];for(let _0x2cdd58=0x0;_0x2cdd58<_0x4c6d9e;_0x2cdd58++){const _0x36ae95=_0x833dc2[_0x58cafe(0x240)]+_0x2cdd58*_0x2896b7,_0x20c2cf=timeToPosition(_0x36ae95,_0x833dc2,_0x17cb8a),_0x2a0dc2=formatTimestamp(_0x36ae95,_0x3a9c8c);_0x5964ec[_0x58cafe(0x11e)]({'pos':_0x20c2cf,'text':_0x2a0dc2});}const _0x292427=new Array(_0x17cb8a)['fill']('\x20');let _0x101a2c=-0x1;for(const {pos:_0x21ed09,text:_0x23d630}of _0x5964ec){let _0x233eb8=Math[_0x58cafe(0x170)](0x0,_0x21ed09-Math[_0x58cafe(0xdd)](_0x23d630[_0x58cafe(0x221)]/0x2));_0x233eb8<=_0x101a2c+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x233eb8=_0x101a2c+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x233eb8+_0x23d630[_0x58cafe(0x221)]>_0x17cb8a&&(_0x233eb8=_0x17cb8a-_0x23d630[_0x58cafe(0x221)]);if(_0x233eb8>=0x0&&_0x233eb8+_0x23d630['length']<=_0x17cb8a&&_0x233eb8>_0x101a2c){for(let _0x92766c=0x0;_0x92766c<_0x23d630['length'];_0x92766c++){_0x292427[_0x233eb8+_0x92766c]=_0x23d630[_0x92766c];}_0x101a2c=_0x233eb8+_0x23d630[_0x58cafe(0x221)]-0x1;}}return _0x292427['join']('');}function renderTaskRow(_0x1128de,_0x599c37,_0x3dc06b,_0x5cdd99){const _0x197ae4=a51_0x22a388,{level:_0x1085f0,name:_0x577bce}=parseTaskName(_0x1128de[_0x197ae4(0x174)]),_0x3b00d2='\x20'[_0x197ae4(0x245)](_0x1085f0),_0x471e4c=_0x1128de[_0x197ae4(0xb2)]?'('+formatElapsed(_0x1128de[_0x197ae4(0xb2)][_0x197ae4(0x198)])+')':'',_0x461c04=stringWidth(_0x471e4c),_0x163e85=_0x1085f0*0x1,_0x12d7b8=_0x5cdd99-_0x163e85-_0x461c04-0x1,_0x48db3e=truncateTaskName(_0x577bce,_0x12d7b8),_0x4da87e=_0x3b00d2+_0x48db3e,_0x4414ef=stringWidth(_0x4da87e),_0x1ce73a=_0x5cdd99-_0x4414ef-_0x461c04,_0x43a7d4=_0x4da87e+'\x20'[_0x197ae4(0x245)](Math['max'](0x1,_0x1ce73a))+a51_0x5bf18c['dim'](_0x471e4c),_0x192944=getTaskStateIcon(_0x1128de[_0x197ae4(0x210)]),_0x2fa108=new Array(_0x3dc06b)[_0x197ae4(0x113)]('\x20');if(_0x1128de[_0x197ae4(0xb2)]){const _0x25a88a=timeToPosition(_0x1128de[_0x197ae4(0xb2)]['start'],_0x599c37,_0x3dc06b),_0x458229=timeToPosition(_0x1128de[_0x197ae4(0xb2)][_0x197ae4(0x232)],_0x599c37,_0x3dc06b),_0x4b2c83=getBarChar(_0x1128de[_0x197ae4(0x210)]),_0xc585f8=Math['max'](_0x25a88a+0x1,_0x458229);for(let _0x243c73=_0x25a88a;_0x243c73<Math[_0x197ae4(0x13a)](_0xc585f8,_0x3dc06b);_0x243c73++){_0x2fa108[_0x243c73]=_0x4b2c83;}}const _0xb179ce=getBarColor(_0x1128de['state']),_0x19d77e=_0x2fa108[_0x197ae4(0x1de)](_0x432d7e=>_0x432d7e==='\x20'?'\x20':_0xb179ce(_0x432d7e))[_0x197ae4(0x192)]('');return _0x192944+'\x20'+_0x43a7d4+'│'+_0x19d77e+'│';}function calculateStats(_0x41b1cf){const _0x386e64=a51_0x22a388,_0x19d088={'total':_0x41b1cf['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x367ae1 of _0x41b1cf){if(_0x367ae1['state']===_0x386e64(0x179))_0x19d088[_0x386e64(0x179)]++;else{if(_0x367ae1[_0x386e64(0x210)]==='error'||_0x367ae1[_0x386e64(0x210)]===_0x386e64(0xc3))_0x19d088['error']++;else _0x367ae1[_0x386e64(0x210)]===_0x386e64(0x15b)?_0x19d088[_0x386e64(0x15b)]++:_0x19d088[_0x386e64(0xfd)]++;}}return _0x19d088;}function formatStats(_0x22b928){const _0x43738b=a51_0x22a388;return[_0x43738b(0x1eb)+_0x22b928[_0x43738b(0xa0)],'✅\x20'+_0x22b928[_0x43738b(0x179)],'❌\x20'+_0x22b928[_0x43738b(0xf6)],_0x43738b(0x213)+_0x22b928['running'],'⏳\x20'+_0x22b928[_0x43738b(0xfd)]][_0x43738b(0x192)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x139);[a51_0x22a388(0x1b4)]=a51_0x22a388(0x100);async[a51_0x22a388(0xd2)](_0x5fdb59){const _0xf412ea=a51_0x22a388,{options:_0x530412,args:_0x40c661,tdx:_0x113432}=_0x5fdb59;let _0xfdbae8,_0x49e519,_0x1218c6=![];if(_0x40c661[0x0]){if(_0x40c661[0x0][_0xf412ea(0xe0)]('.')){const _0x12f5c7=this[_0xf412ea(0x227)](_0x40c661,_0x530412);if(!_0x12f5c7)return 0x1;_0xfdbae8=_0x12f5c7[_0xf412ea(0xb4)],_0x49e519=_0x12f5c7[_0xf412ea(0x1b6)];}else{_0x49e519=_0x40c661[0x0],_0xfdbae8=_0x530412['workflowProject'];if(!_0xfdbae8)return console[_0xf412ea(0xf6)](a51_0x5bf18c[_0xf412ea(0xf3)](_0xf412ea(0x1e0)),_0xf412ea(0x14e)),0x1;_0x1218c6=!![];}}else{const _0x28e7cc=this[_0xf412ea(0x227)](_0x40c661,_0x530412);if(!_0x28e7cc)return 0x1;_0xfdbae8=_0x28e7cc[_0xf412ea(0xb4)],_0x49e519=_0x28e7cc[_0xf412ea(0x1b6)];}if(_0x530412[_0xf412ea(0xde)]){if(_0xfdbae8&&_0x49e519)console[_0xf412ea(0xf6)]('Filter:\x20'+_0xfdbae8+'.'+_0x49e519);else _0xfdbae8&&console[_0xf412ea(0xf6)](_0xf412ea(0x123)+_0xfdbae8);}const _0x1bc6b7=_0x530412[_0xf412ea(0x173)],_0x4cbc63=_0x530412[_0xf412ea(0x214)];if(_0x1bc6b7){_0x4cbc63&&console[_0xf412ea(0xf6)](a51_0x5bf18c[_0xf412ea(0xfc)](_0xf412ea(0x16e)),_0xf412ea(0xc5));const _0x50132b=_0x530412[_0xf412ea(0x199)];return _0x50132b?await this[_0xf412ea(0xc7)](_0x5fdb59,_0x1bc6b7):await this[_0xf412ea(0x1b7)](_0x5fdb59,_0x1bc6b7,_0x530412),0x0;}if(_0x4cbc63){const _0x1b7101=await withSpinner(_0xf412ea(0x1f9),()=>_0x113432[_0xf412ea(0x121)][_0xf412ea(0x160)]({'projectName':_0xfdbae8,'workflowName':_0x49e519,'limit':0x64}),{'verbose':_0x530412[_0xf412ea(0xde)]}),_0x1d78cc=_0x1b7101[_0xf412ea(0x195)][_0xf412ea(0x20e)](_0x298ee6=>_0x298ee6['id']===_0x4cbc63);if(!_0x1d78cc)return console['error'](a51_0x5bf18c[_0xf412ea(0xf3)]('Error:'),'Session\x20not\x20found:\x20'+_0x4cbc63),0x1;if(!_0x1d78cc[_0xf412ea(0x225)]?.['id'])return console['error'](a51_0x5bf18c[_0xf412ea(0xf3)]('Error:'),_0xf412ea(0x1fb)+_0x4cbc63+_0xf412ea(0x110)),0x1;const _0x5eb2f6=_0x1d78cc['lastAttempt']['id'];_0x530412[_0xf412ea(0xde)]&&console[_0xf412ea(0xf6)](_0xf412ea(0x13b)+_0x5eb2f6+_0xf412ea(0x233)+_0x4cbc63);const _0x23a67a=_0x530412['follow'];return _0x23a67a?await this[_0xf412ea(0xc7)](_0x5fdb59,_0x5eb2f6):await this[_0xf412ea(0x1b7)](_0x5fdb59,_0x5eb2f6,_0x530412),0x0;}const _0x4dc11d=await withSpinner(_0xf412ea(0x18b),()=>_0x113432[_0xf412ea(0x121)]['sessions']({'projectName':_0xfdbae8,'workflowName':_0x49e519,'limit':_0x530412[_0xf412ea(0xa9)]||0x32}),{'verbose':_0x530412['verbose']}),_0x55a8b9=_0x4dc11d[_0xf412ea(0x195)];if(_0x55a8b9['length']===0x0){if(_0xfdbae8&&_0x49e519)console[_0xf412ea(0xf6)](_0xf412ea(0x177)+_0xfdbae8+'.'+_0x49e519);else _0xfdbae8?console[_0xf412ea(0xf6)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0xfdbae8):(console[_0xf412ea(0xf6)]('No\x20workflow\x20sessions\x20found'),console[_0xf412ea(0xf6)](a51_0x5bf18c[_0xf412ea(0x1b0)](_0xf412ea(0x1a0))));return 0x0;}_0x55a8b9['sort']((_0x2ab334,_0x422c27)=>{const _0x489a3e=_0xf412ea,_0x3569df=_0x2ab334[_0x489a3e(0x16a)]||'',_0x59f2af=_0x422c27[_0x489a3e(0x16a)]||'';return _0x59f2af[_0x489a3e(0xa1)](_0x3569df);});if(_0x530412[_0xf412ea(0x176)]||_0x530412['jsonl'])return await handleSDKOutput(_0x55a8b9,_0x530412),0x0;let _0x5c77c1;if(_0x1218c6){const _0x1c906e=_0x55a8b9[0x0];if(!_0x1c906e[_0xf412ea(0x225)]?.['id'])return console['error'](_0xf412ea(0xae)),0x0;_0x5c77c1=_0x1c906e[_0xf412ea(0x225)]['id'],_0x530412[_0xf412ea(0xde)]&&console['error'](_0xf412ea(0x18f)+_0x1c906e[_0xf412ea(0x16a)]);}else{const _0x2147ec=_0x55a8b9[_0xf412ea(0x1de)](_0x5b4679=>{const _0x1c46f3=_0xf412ea,_0x352be2=getAttemptStatusDisplay(_0x5b4679[_0x1c46f3(0x225)]);return{'title':_0x5b4679[_0x1c46f3(0x1fe)]?.[_0x1c46f3(0x174)]+'.'+_0x5b4679['workflow']?.['name']+'\x20-\x20'+_0x5b4679[_0x1c46f3(0x16a)]+'\x20'+_0x352be2[_0x1c46f3(0x12e)],'value':_0x5b4679[_0x1c46f3(0x225)]?.['id']||'','description':_0x352be2[_0x1c46f3(0x189)]};}),_0x2d0dab=await a51_0x4f4bd3({'type':_0xf412ea(0xff),'name':_0xf412ea(0x173),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x2147ec['filter'](_0x170b7b=>_0x170b7b[_0xf412ea(0x1cf)]!=='')});if(!_0x2d0dab[_0xf412ea(0x173)])return 0x0;_0x5c77c1=_0x2d0dab[_0xf412ea(0x173)];}const _0x2621dd=_0x530412[_0xf412ea(0x199)];return _0x2621dd?await this[_0xf412ea(0xc7)](_0x5fdb59,_0x5c77c1):await this['renderSingleTimeline'](_0x5fdb59,_0x5c77c1,_0x530412),0x0;}async[a51_0x22a388(0x1b7)](_0x5ba2f8,_0x4411ac,_0x4e928c){const _0x2496ab=a51_0x22a388,{tdx:_0x3842bd}=_0x5ba2f8;let _0x47ba86,_0x540252;try{[_0x47ba86,_0x540252]=await Promise[_0x2496ab(0x236)]([_0x3842bd['workflow'][_0x2496ab(0xfa)](_0x4411ac),_0x3842bd[_0x2496ab(0x121)][_0x2496ab(0xea)](_0x4411ac,![])]);}catch(_0x46d48d){console['error'](a51_0x5bf18c[_0x2496ab(0xf3)](_0x2496ab(0xef)));_0x4e928c[_0x2496ab(0xde)]&&console[_0x2496ab(0xf6)](_0x46d48d);throw _0x46d48d;}if(_0x4e928c['json']||_0x4e928c['jsonl']){const _0x5dc369=this['buildTimelineData'](_0x47ba86,_0x540252);await handleSDKOutput([_0x5dc369],_0x4e928c);return;}const _0x398d2d=_0x3842bd[_0x2496ab(0x24b)][_0x2496ab(0x1e3)],_0x20abcc=this[_0x2496ab(0xab)](_0x47ba86,_0x540252,_0x398d2d);console[_0x2496ab(0x204)](_0x20abcc);}async['pollTimeline'](_0x599ba9,_0x4c8fa0){const _0x2710c5=a51_0x22a388,{tdx:_0x2967fb}=_0x599ba9,_0x633545=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x4db982=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x46b5fb=0x0;while(_0x46b5fb<_0x4db982){process[_0x2710c5(0x20b)][_0x2710c5(0x1ef)]&&process['stdout'][_0x2710c5(0xbc)]('\x1bc');let _0x192b6e,_0x3043fd;try{[_0x192b6e,_0x3043fd]=await Promise['all']([_0x2967fb[_0x2710c5(0x121)][_0x2710c5(0xfa)](_0x4c8fa0),_0x2967fb[_0x2710c5(0x121)][_0x2710c5(0xea)](_0x4c8fa0,![])]);}catch(_0x449b55){console[_0x2710c5(0xf6)](a51_0x5bf18c['red'](_0x2710c5(0x1c2)));_0x46b5fb>0x0&&console[_0x2710c5(0xf6)](a51_0x5bf18c[_0x2710c5(0x1b0)](_0x2710c5(0x1a3)+_0x46b5fb));throw _0x449b55;}const _0x21189b=_0x2967fb['context']['site'],_0x164116=this[_0x2710c5(0xab)](_0x192b6e,_0x3043fd,_0x21189b);console[_0x2710c5(0x204)](_0x164116);const _0x431c36=_0x192b6e['done']&&_0x3043fd[_0x2710c5(0x108)](_0x3e7268=>_0x3e7268[_0x2710c5(0x210)]!==_0x2710c5(0x15b)&&_0x3e7268[_0x2710c5(0x210)]!==_0x2710c5(0x20a));if(_0x431c36){console[_0x2710c5(0xf6)](a51_0x5bf18c['green'](_0x2710c5(0x218)));break;}console['error'](a51_0x5bf18c[_0x2710c5(0x1b0)](_0x2710c5(0x169)+_0x46b5fb*0x2+_0x2710c5(0x1e1))),await new Promise(_0x32808d=>setTimeout(_0x32808d,_0x633545)),_0x46b5fb++;}_0x46b5fb>=_0x4db982&&console[_0x2710c5(0xf6)](a51_0x5bf18c['yellow'](_0x2710c5(0x14a)));}['renderTimeline'](_0x389b06,_0x293148,_0x300f97){const _0x41e783=a51_0x22a388,_0x404767=[],_0x428e9c=TIMELINE_CONFIG[_0x41e783(0x1ab)],_0x56930f=0x5,_0x1e7aeb=process[_0x41e783(0x20b)]['columns']||0x78,_0x58487a=_0x1e7aeb-_0x428e9c-_0x56930f,_0x437dbf=Math[_0x41e783(0x170)](TIMELINE_CONFIG[_0x41e783(0x180)],Math['min'](_0x58487a,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x41223d=new Date(_0x389b06['createdAt'])[_0x41e783(0x1dc)](),_0x223a40=_0x389b06['finishedAt']?new Date(_0x389b06['finishedAt'])[_0x41e783(0x1dc)]():Date[_0x41e783(0x23d)](),_0x40ecac={'start':_0x41223d,'end':_0x223a40,'duration':_0x223a40-_0x41223d},_0x4702db=new Map(),_0x5a1e7c=[];for(const _0x29195c of _0x293148){if(_0x29195c[_0x41e783(0x19b)]){const _0x4a8f90=new Date(_0x29195c[_0x41e783(0x19b)])['getTime'](),_0x3719dd=_0x29195c[_0x41e783(0x212)]?new Date(_0x29195c[_0x41e783(0x212)])[_0x41e783(0x1dc)]():Date[_0x41e783(0x23d)](),_0x45519d={'start':_0x4a8f90,'end':_0x3719dd,'duration':_0x3719dd-_0x4a8f90};_0x4702db[_0x41e783(0x9a)](_0x29195c['id'],_0x45519d),_0x5a1e7c[_0x41e783(0x11e)]({'name':_0x29195c[_0x41e783(0x163)],'state':_0x29195c['state']||_0x41e783(0x250),'window':_0x45519d});}else _0x5a1e7c[_0x41e783(0x11e)]({'name':_0x29195c[_0x41e783(0x163)],'state':_0x29195c[_0x41e783(0x210)]||'planned','window':undefined});}_0x5a1e7c[_0x41e783(0x248)]((_0x314cf8,_0x5ac8a6)=>{const _0x5e6741=_0x41e783;if(!_0x314cf8['window'])return 0x1;if(!_0x5ac8a6[_0x5e6741(0xb2)])return-0x1;return _0x314cf8[_0x5e6741(0xb2)]['start']-_0x5ac8a6[_0x5e6741(0xb2)][_0x5e6741(0xcb)];});const _0x47d01e=_0x5a1e7c['length'],_0x103da3=_0x47d01e>TIMELINE_CONFIG[_0x41e783(0x1a7)];_0x103da3&&_0x5a1e7c[_0x41e783(0xee)](TIMELINE_CONFIG[_0x41e783(0x1a7)]);const _0xd56400=calculateTimeScale(_0x40ecac,_0x437dbf),_0x16d7b7=_0x389b06[_0x41e783(0xe1)]?_0x389b06['success']?a51_0x5bf18c[_0x41e783(0xf7)](_0x41e783(0x179)):a51_0x5bf18c[_0x41e783(0xf3)]('error'):a51_0x5bf18c[_0x41e783(0x1ed)](_0x41e783(0x15b)),_0x352435=_0x389b06['project']?.['id'],_0x4dc04c=_0x389b06[_0x41e783(0x214)];let _0x2adc11;if(_0x352435&&_0x4dc04c){const _0x74c979=getWorkflowAttemptUrl(_0x300f97,_0x352435,_0x4dc04c,_0x389b06['id']);_0x2adc11=hyperlink(a51_0x5bf18c[_0x41e783(0x1b0)](_0x389b06['id']),_0x74c979);}else _0x2adc11=a51_0x5bf18c[_0x41e783(0x1b0)](_0x389b06['id']);_0x404767[_0x41e783(0x11e)](_0x41e783(0x1e2)+_0x2adc11+'\x20-\x20'+_0x16d7b7+'\x20-\x20'+formatElapsed(_0x40ecac[_0x41e783(0x198)]));if(_0x5a1e7c['length']>0x0){const _0x283e7f=renderTimeAxis(_0xd56400,_0x437dbf),_0x1f1934=new Date(_0x40ecac[_0x41e783(0xcb)]),_0x8f474=formatDate(_0x1f1934),_0x35475b=TIMELINE_CONFIG[_0x41e783(0x1ae)]+TIMELINE_CONFIG[_0x41e783(0x167)]+_0x428e9c,_0x374828=_0x8f474[_0x41e783(0x17d)](_0x35475b),_0x198669=a51_0x5bf18c[_0x41e783(0x1b0)](_0x374828);_0x404767[_0x41e783(0x11e)](_0x198669+'\x20'+_0x283e7f);for(const _0x508d6e of _0x5a1e7c){_0x404767['push'](renderTaskRow(_0x508d6e,_0xd56400,_0x437dbf,_0x428e9c));}const _0x30e6dc=calculateStats(_0x5a1e7c);_0x404767[_0x41e783(0x11e)](formatStats(_0x30e6dc)),_0x103da3&&_0x404767[_0x41e783(0x11e)](a51_0x5bf18c[_0x41e783(0xfc)](_0x41e783(0x13f)+TIMELINE_CONFIG[_0x41e783(0x1a7)]+_0x41e783(0xb0)+_0x47d01e+_0x41e783(0x16b))),_0x404767[_0x41e783(0x11e)](''),_0x404767[_0x41e783(0x11e)](a51_0x5bf18c[_0x41e783(0x1b0)]('💡\x20Tip:\x20Use\x20')+(_0x41e783(0x9e)+_0x389b06['id']+_0x41e783(0x155))+a51_0x5bf18c[_0x41e783(0x1b0)]('\x20to\x20see\x20detailed\x20logs'));}else _0x404767[_0x41e783(0x11e)](_0x41e783(0x1a1));return _0x404767[_0x41e783(0x192)]('\x0a');}[a51_0x22a388(0x143)](_0x4deb58,_0xabdca1){const _0x3a31bc=a51_0x22a388,_0x14f863=new Date(_0x4deb58['createdAt'])[_0x3a31bc(0x1dc)](),_0x393b96=_0x4deb58[_0x3a31bc(0x1d3)]?new Date(_0x4deb58[_0x3a31bc(0x1d3)])[_0x3a31bc(0x1dc)]():Date[_0x3a31bc(0x23d)](),_0x2d0707=_0x393b96-_0x14f863,_0x34df82=[];for(const _0x451573 of _0xabdca1){if(_0x451573[_0x3a31bc(0x19b)]){const _0x6e2d6=new Date(_0x451573[_0x3a31bc(0x19b)])['getTime'](),_0x3df4ab=_0x451573['updatedAt']?new Date(_0x451573[_0x3a31bc(0x212)])[_0x3a31bc(0x1dc)]():Date['now']();_0x34df82[_0x3a31bc(0x11e)]({'name':_0x451573[_0x3a31bc(0x163)],'state':_0x451573[_0x3a31bc(0x210)]||_0x3a31bc(0x250),'window':{'start':_0x6e2d6,'end':_0x3df4ab,'duration':_0x3df4ab-_0x6e2d6}});}else _0x34df82[_0x3a31bc(0x11e)]({'name':_0x451573[_0x3a31bc(0x163)],'state':_0x451573[_0x3a31bc(0x210)]||'planned','window':undefined});}const _0x215478=calculateStats(_0x34df82);return{'attempt':{'id':_0x4deb58['id'],'status':_0x4deb58[_0x3a31bc(0xe1)]?_0x4deb58[_0x3a31bc(0x179)]?'success':'error':'running','createdAt':_0x4deb58[_0x3a31bc(0x151)],'finishedAt':_0x4deb58['finishedAt'],'duration_ms':_0x2d0707},'tasks':_0x34df82[_0x3a31bc(0x1de)](_0x3ef098=>({'name':_0x3ef098[_0x3a31bc(0x174)],'state':_0x3ef098[_0x3a31bc(0x210)],'startedAt':_0x3ef098['window']?new Date(_0x3ef098[_0x3a31bc(0xb2)][_0x3a31bc(0xcb)])[_0x3a31bc(0x1f8)]():null,'updatedAt':_0x3ef098[_0x3a31bc(0xb2)]?new Date(_0x3ef098[_0x3a31bc(0xb2)]['end'])[_0x3a31bc(0x1f8)]():null,'duration_ms':_0x3ef098[_0x3a31bc(0xb2)]?.[_0x3a31bc(0x198)]||null})),'stats':_0x215478};}}
|
|
1
|
+
const a52_0x5b31a0=a52_0x191d;(function(_0x4f95da,_0x3f74a0){const _0x46ce20=a52_0x191d,_0x2b3b26=_0x4f95da();while(!![]){try{const _0x4d3ea1=parseInt(_0x46ce20(0x1ef))/0x1*(-parseInt(_0x46ce20(0x17f))/0x2)+-parseInt(_0x46ce20(0x17e))/0x3*(parseInt(_0x46ce20(0x1fa))/0x4)+-parseInt(_0x46ce20(0x185))/0x5+-parseInt(_0x46ce20(0x1c6))/0x6*(-parseInt(_0x46ce20(0x18a))/0x7)+parseInt(_0x46ce20(0x305))/0x8*(-parseInt(_0x46ce20(0x26b))/0x9)+parseInt(_0x46ce20(0x20c))/0xa*(-parseInt(_0x46ce20(0x289))/0xb)+-parseInt(_0x46ce20(0x215))/0xc*(-parseInt(_0x46ce20(0x329))/0xd);if(_0x4d3ea1===_0x3f74a0)break;else _0x2b3b26['push'](_0x2b3b26['shift']());}catch(_0xbc2907){_0x2b3b26['push'](_0x2b3b26['shift']());}}}(a52_0x5e1e,0x5cd98));import a52_0x29459a from'chalk';import{existsSync}from'fs';import a52_0x113b0c 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 a52_0x2378a5 from'prompts';function getAttemptStatusDisplay(_0x4783bc){const _0x21c43f=a52_0x191d;if(!_0x4783bc)return{'icon':'⏳','text':''};const {done:_0x1063a4,success:_0x4b93d8,cancelRequested:_0xffe19a}=_0x4783bc;if(!_0x1063a4)return _0xffe19a?{'icon':'🛑','text':a52_0x29459a[_0x21c43f(0x22d)](_0x21c43f(0x190))}:{'icon':'🔄','text':a52_0x29459a[_0x21c43f(0x2f6)](_0x21c43f(0x1a8))};if(_0x4b93d8)return{'icon':'✅','text':a52_0x29459a[_0x21c43f(0x232)]('success')};return{'icon':'❌','text':a52_0x29459a[_0x21c43f(0x1cd)](_0x21c43f(0x274))};}export class WorkflowBaseCommand extends BaseCommand{[a52_0x5b31a0(0x226)](_0x29d458,_0x334d88,_0x34f951=0x0){const _0x3a7770=a52_0x5b31a0;return _0x29d458[_0x34f951]||_0x334d88[_0x3a7770(0x1f0)];}['requireProject'](_0x3b6b7e,_0x33bf47,_0x18706e=0x0){const _0x780366=a52_0x5b31a0,_0x20e180=this['resolveProject'](_0x3b6b7e,_0x33bf47,_0x18706e);if(!_0x20e180)return console[_0x780366(0x274)](a52_0x29459a[_0x780366(0x1cd)](_0x780366(0x2b0)),_0x780366(0x1a6)),console[_0x780366(0x274)](a52_0x29459a['dim'](_0x780366(0x253))),null;return _0x20e180;}[a52_0x5b31a0(0x1b5)](_0x4e2537,_0x447027){const _0x349fb5=a52_0x5b31a0;if(_0x4e2537[0x0]){const _0x4f9939=_0x4e2537[0x0][_0x349fb5(0x198)]('.');if(_0x4f9939['length']===0x1)return{'projectName':_0x4f9939[0x0],'workflowName':undefined};else return _0x4f9939[_0x349fb5(0x24f)]===0x2?{'projectName':_0x4f9939[0x0],'workflowName':_0x4f9939[0x1]}:(console['error'](a52_0x29459a[_0x349fb5(0x1cd)](_0x349fb5(0x2b0)),_0x349fb5(0x2ab)),null);}return{'projectName':_0x447027[_0x349fb5(0x1f0)],'workflowName':undefined};}[a52_0x5b31a0(0x25b)](_0x4aeabf,_0x38b935,_0x242fe6=0x0){const _0x1dcddf=a52_0x5b31a0;if(_0x4aeabf[_0x242fe6])return _0x4aeabf[_0x242fe6];if(_0x38b935['workflowProject']){const _0x440d6d=a52_0x113b0c[_0x1dcddf(0x241)](process[_0x1dcddf(0x1a3)](),_0x1dcddf(0x1b7),_0x38b935[_0x1dcddf(0x1f0)]);if(existsSync(a52_0x113b0c[_0x1dcddf(0x241)](_0x440d6d,_0x1dcddf(0x18b))))return _0x440d6d;}return undefined;}async['showWorkflowConsoleUrl'](_0x788dca,_0x9b461,_0x4abaff){const _0x4e97b2=a52_0x5b31a0;try{const _0x596a64=await _0x788dca[_0x4e97b2(0x265)][_0x4e97b2(0x1b7)](_0x9b461,{'limit':0x1});if(_0x596a64[_0x4e97b2(0x24f)]>0x0){const _0x32d55f=_0x596a64[0x0]['id'],_0x1c044e=getWorkflowUrl(_0x4abaff,_0x32d55f);console[_0x4e97b2(0x274)](_0x4e97b2(0x2f3)+a52_0x29459a[_0x4e97b2(0x1bc)](_0x1c044e));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a52_0x5b31a0(0x301);[a52_0x5b31a0(0x1c2)]=a52_0x5b31a0(0x32c);async[a52_0x5b31a0(0x247)](_0x489e43){const _0x4c8284=a52_0x5b31a0,{options:_0x52f081,args:_0x526296,tdx:_0x17de2f}=_0x489e43,_0x226a3b=_0x526296[0x0],_0x459f40=_0x52f081['clear'];if(_0x459f40)return saveSessionContext({'workflow_project':undefined},_0x52f081['session']),console[_0x4c8284(0x201)](a52_0x29459a[_0x4c8284(0x232)](_0x4c8284(0x28e))),0x0;if(!_0x226a3b)return console[_0x4c8284(0x274)](a52_0x29459a[_0x4c8284(0x1cd)](_0x4c8284(0x2b0)),'Project\x20name\x20is\x20required'),console[_0x4c8284(0x274)](a52_0x29459a[_0x4c8284(0x230)](_0x4c8284(0x216))),console[_0x4c8284(0x274)](a52_0x29459a[_0x4c8284(0x230)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x441e4e=await withSpinner(_0x4c8284(0x1cc)+_0x226a3b+_0x4c8284(0x2a5),()=>_0x17de2f[_0x4c8284(0x265)][_0x4c8284(0x2d0)](_0x226a3b),{'verbose':_0x52f081[_0x4c8284(0x2bb)]}),{name:_0x96654c}=_0x441e4e[_0x4c8284(0x244)];return saveSessionContext({'workflow_project':_0x96654c},_0x52f081[_0x4c8284(0x1a4)]),console[_0x4c8284(0x201)](a52_0x29459a[_0x4c8284(0x232)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a52_0x29459a[_0x4c8284(0x1bc)](_0x96654c))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a52_0x5b31a0(0x269);[a52_0x5b31a0(0x1c2)]=a52_0x5b31a0(0x326);async['execute'](_0x31b4bc){const _0x2e5d16=a52_0x5b31a0,{options:_0x13c7b8,args:_0x243022,tdx:_0x218441}=_0x31b4bc,_0x23544d=_0x243022[0x0];_0x13c7b8[_0x2e5d16(0x2bb)]&&_0x23544d&&console['error'](_0x2e5d16(0x308)+_0x23544d);const _0x4711c6=await withSpinner(_0x2e5d16(0x1c1),()=>_0x218441[_0x2e5d16(0x265)][_0x2e5d16(0x212)](_0x23544d,{'limit':_0x13c7b8[_0x2e5d16(0x1f6)]}),{'verbose':_0x13c7b8[_0x2e5d16(0x2bb)]});let _0x4b9b4e=_0x4711c6[_0x2e5d16(0x244)];_0x4b9b4e['sort']((_0x3037b1,_0x14ac7c)=>_0x3037b1[_0x2e5d16(0x278)][_0x2e5d16(0x184)](_0x14ac7c[_0x2e5d16(0x278)]));const _0xd2336a=_0x13c7b8[_0x2e5d16(0x1f6)]||0x64,_0x46cb92=_0x4b9b4e[_0x2e5d16(0x24f)]>=_0xd2336a?a52_0x29459a[_0x2e5d16(0x230)](_0x2e5d16(0x1fe)):'';console['error'](_0x2e5d16(0x327)+_0x4b9b4e[_0x2e5d16(0x24f)]+_0x2e5d16(0x2c9)+(_0x4b9b4e[_0x2e5d16(0x24f)]!==0x1?'s':'')+_0x46cb92);if(_0x13c7b8[_0x2e5d16(0x1b6)]===_0x2e5d16(0x29a)||_0x13c7b8['format']===_0x2e5d16(0x20e)||_0x13c7b8['format']===_0x2e5d16(0x1a1))await handleSDKOutput(_0x4b9b4e,_0x13c7b8);else{if(_0x4b9b4e[_0x2e5d16(0x24f)]===0x0)_0x23544d?console['log'](_0x2e5d16(0x255)+_0x23544d):console[_0x2e5d16(0x201)]('No\x20workflow\x20projects\x20found');else{const _0x24f958=_0x4b9b4e['map'](_0x5acc2e=>{const _0x1af88d=_0x2e5d16,_0x4536e5=_0x5acc2e[_0x1af88d(0x1c3)]?.[_0x1af88d(0x27b)](_0x58d00c=>_0x58d00c[_0x1af88d(0x191)]===_0x1af88d(0x18d)),_0xc83d31=_0x4536e5?a52_0x29459a[_0x1af88d(0x230)](_0x1af88d(0x1ab)):'';return _0x1af88d(0x2dd)+_0x5acc2e['name']+_0xc83d31;});await writeOutput(_0x24f958[_0x2e5d16(0x241)]('\x0a'),_0x13c7b8[_0x2e5d16(0x32d)],'list');}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a52_0x5b31a0(0x278)]=a52_0x5b31a0(0x217);[a52_0x5b31a0(0x1c2)]=a52_0x5b31a0(0x277);async[a52_0x5b31a0(0x247)](_0x357992){const _0x4778cb=a52_0x5b31a0,{options:_0x590903,args:_0xb80758,tdx:_0x515f44}=_0x357992,_0x2a74f3=this['resolveProject'](_0xb80758,_0x590903);_0x590903[_0x4778cb(0x2bb)]&&_0x2a74f3&&console[_0x4778cb(0x274)](_0x4778cb(0x262)+_0x2a74f3);const _0x1ff53f=await withSpinner(_0x4778cb(0x25e),()=>_0x515f44['workflow'][_0x4778cb(0x1b7)](_0x2a74f3,{'limit':_0x590903['limit']}),{'verbose':_0x590903[_0x4778cb(0x2bb)]});let _0x360096=_0x1ff53f[_0x4778cb(0x244)];_0x360096[_0x4778cb(0x251)]((_0x2689c6,_0x4f1026)=>{const _0x1d3d95=_0x4778cb,_0x682f61=_0x2689c6['name']['localeCompare'](_0x4f1026[_0x1d3d95(0x278)]);if(_0x682f61!==0x0)return _0x682f61;return(_0x2689c6[_0x1d3d95(0x222)]?.['name']||'')[_0x1d3d95(0x184)](_0x4f1026[_0x1d3d95(0x222)]?.[_0x1d3d95(0x278)]||'');});const _0x212752=_0x590903[_0x4778cb(0x1f6)]||0x64,_0x49f771=_0x360096[_0x4778cb(0x24f)]>=_0x212752?a52_0x29459a[_0x4778cb(0x230)](_0x4778cb(0x1fe)):'';console['error'](_0x4778cb(0x327)+_0x360096['length']+_0x4778cb(0x179)+(_0x360096[_0x4778cb(0x24f)]!==0x1?'s':'')+_0x49f771);if(_0x590903[_0x4778cb(0x1b6)]==='json'||_0x590903['format']===_0x4778cb(0x20e)||_0x590903['format']===_0x4778cb(0x1a1))await handleSDKOutput(_0x360096,_0x590903);else{if(_0x360096[_0x4778cb(0x24f)]===0x0)_0x2a74f3?console['log'](_0x4778cb(0x1bb)+_0x2a74f3):console[_0x4778cb(0x201)](_0x4778cb(0x209));else{const _0x56185a=_0x590903[_0x4778cb(0x1be)],_0x366a65=_0x360096[_0x4778cb(0x2aa)](_0x4c8737=>{const _0x57e98e=_0x4778cb,_0x40af70=a52_0x29459a[_0x57e98e(0x230)]('#'+_0x4c8737['id']),_0x100797=hyperlink(_0x40af70,getWorkflowUrl(_0x56185a,_0x4c8737['id'])),_0x24674d=_0x4c8737['project']?.[_0x57e98e(0x278)]?a52_0x29459a[_0x57e98e(0x230)]('\x20('+_0x4c8737[_0x57e98e(0x222)][_0x57e98e(0x278)]+')'):'';return'📋\x20'+_0x100797+'\x20'+_0x4c8737[_0x57e98e(0x278)]+_0x24674d;});await writeOutput(_0x366a65['join']('\x0a'),_0x590903['output'],_0x4778cb(0x18c));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a52_0x5b31a0(0x278)]=a52_0x5b31a0(0x1ed);[a52_0x5b31a0(0x1c2)]=a52_0x5b31a0(0x1e5);async['execute'](_0x22e048){const _0x44690c=a52_0x5b31a0,{options:_0x281bca,args:_0x573c2c,tdx:_0x2d78c4}=_0x22e048,_0x50b722=this[_0x44690c(0x1b5)](_0x573c2c,_0x281bca);if(!_0x50b722)return 0x1;const {projectName:_0x17db75,workflowName:_0xf1b6f3}=_0x50b722;if(_0x281bca[_0x44690c(0x2bb)]){if(_0x17db75&&_0xf1b6f3)console[_0x44690c(0x274)](_0x44690c(0x23c)+_0x17db75+'.'+_0xf1b6f3);else _0x17db75&&console[_0x44690c(0x274)](_0x44690c(0x2c5)+_0x17db75);const _0x1df368=_0x281bca[_0x44690c(0x206)];_0x1df368&&console['error'](_0x44690c(0x1bd)+_0x1df368);}let _0x206ba4=0x28;if(process[_0x44690c(0x236)]['isTTY']&&!_0x281bca['output']&&!_0x281bca[_0x44690c(0x1b6)]){const _0x120e14=process[_0x44690c(0x236)][_0x44690c(0x1f8)]||0x28;_0x206ba4=Math[_0x44690c(0x2b3)](0x14,Math[_0x44690c(0x19e)](_0x120e14*0x2/0x3));}const _0x29b047=_0x281bca[_0x44690c(0x1f6)]||_0x206ba4,_0x241324=await withSpinner(_0x44690c(0x1c5),()=>_0x2d78c4[_0x44690c(0x265)][_0x44690c(0x20d)]({'projectName':_0x17db75,'workflowName':_0xf1b6f3,'status':_0x281bca[_0x44690c(0x206)],'fromTime':_0x281bca[_0x44690c(0x1f9)],'toTime':_0x281bca['to'],'limit':_0x29b047}),{'verbose':_0x281bca[_0x44690c(0x2bb)]}),_0x4188e6=_0x241324[_0x44690c(0x244)];_0x4188e6[_0x44690c(0x251)]((_0x460ea8,_0x35fedc)=>{const _0x57544b=_0x44690c,_0x105a84=_0x460ea8[_0x57544b(0x29d)]||'',_0x1810b1=_0x35fedc[_0x57544b(0x29d)]||'';return _0x1810b1[_0x57544b(0x184)](_0x105a84);});_0x4188e6[_0x44690c(0x24f)]>=_0x29b047?console[_0x44690c(0x274)](_0x44690c(0x1d5)+_0x4188e6[_0x44690c(0x24f)]+'\x20sessions\x20'+a52_0x29459a['dim'](_0x44690c(0x25f))):console[_0x44690c(0x274)](_0x44690c(0x327)+_0x4188e6[_0x44690c(0x24f)]+_0x44690c(0x21d)+(_0x4188e6[_0x44690c(0x24f)]!==0x1?'s':''));if(_0x281bca[_0x44690c(0x1b6)]===_0x44690c(0x29a)||_0x281bca[_0x44690c(0x1b6)]==='jsonl'||_0x281bca[_0x44690c(0x1b6)]===_0x44690c(0x1a1))await handleSDKOutput(_0x4188e6,_0x281bca);else{if(!process[_0x44690c(0x236)]['isTTY']||_0x281bca[_0x44690c(0x32d)]){if(_0x4188e6['length']===0x0){if(_0x17db75&&_0xf1b6f3)console['log'](_0x44690c(0x211)+_0x17db75+'.'+_0xf1b6f3);else _0x17db75?console[_0x44690c(0x201)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x17db75):console[_0x44690c(0x201)](_0x44690c(0x199));}else{const _0x5d236f=_0x281bca['site'],_0x4194b4=this[_0x44690c(0x30b)](_0x4188e6,_0x5d236f);_0x281bca[_0x44690c(0x32d)]?await writeOutput(_0x4194b4,_0x281bca['output'],_0x44690c(0x18c)):console[_0x44690c(0x201)](_0x4194b4);}!_0x17db75&&(console['error'](''),console[_0x44690c(0x274)](a52_0x29459a[_0x44690c(0x230)](_0x44690c(0x229))),console['error'](a52_0x29459a[_0x44690c(0x230)](_0x44690c(0x2f4))+'or'+a52_0x29459a[_0x44690c(0x230)](_0x44690c(0x1ac))));}else{if(_0x4188e6[_0x44690c(0x24f)]===0x0){if(_0x17db75&&_0xf1b6f3)console[_0x44690c(0x201)](_0x44690c(0x211)+_0x17db75+'.'+_0xf1b6f3);else _0x17db75?console[_0x44690c(0x201)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x17db75):console['log'](_0x44690c(0x199));}else await this[_0x44690c(0x1cb)](_0x4188e6,_0x22e048,_0x17db75);}}return 0x0;}[a52_0x5b31a0(0x30b)](_0x3f983e,_0x9e034){const _0xfcf0b3=a52_0x5b31a0,_0x1ec748=[],_0x4269ba=new Map();let _0xe9fe57=Infinity,_0x384678=-Infinity;for(const _0x48073 of _0x3f983e){if(_0x48073[_0xfcf0b3(0x20f)]?.[_0xfcf0b3(0x21c)]){const _0x185995=new Date(_0x48073[_0xfcf0b3(0x20f)][_0xfcf0b3(0x21c)])[_0xfcf0b3(0x2f5)](),_0x85d9ae=_0x48073[_0xfcf0b3(0x20f)][_0xfcf0b3(0x304)]?new Date(_0x48073['lastAttempt'][_0xfcf0b3(0x304)])['getTime']():Date[_0xfcf0b3(0x2f0)](),_0x39cfd3=_0x48073['project']?.['name']||'(unknown)';!_0x4269ba[_0xfcf0b3(0x243)](_0x39cfd3)&&_0x4269ba[_0xfcf0b3(0x22b)](_0x39cfd3,[]),_0x4269ba['get'](_0x39cfd3)['push']({'session':_0x48073,'startTime':_0x185995,'endTime':_0x85d9ae,'duration':_0x85d9ae-_0x185995}),_0xe9fe57=Math[_0xfcf0b3(0x264)](_0xe9fe57,_0x185995),_0x384678=Math['max'](_0x384678,_0x85d9ae);}}if(_0x4269ba['size']===0x0)return _0xfcf0b3(0x2d3);const _0x4e6d59=process[_0xfcf0b3(0x236)][_0xfcf0b3(0x2fe)]||0x78,_0x1b4f2e=0x1e,_0x39d18c=0x32,_0x190159=0x4,_0x1b6882=Math[_0xfcf0b3(0x264)](_0x39d18c,Math['max'](_0x1b4f2e,Math[_0xfcf0b3(0x19e)](_0x4e6d59*0.3))),_0x5dcaeb=_0x4e6d59-_0x1b6882-TIMELINE_CONFIG['GUTTER']-0x3-_0x190159,_0xde0ca7=_0x384678-_0xe9fe57,_0xc94af5=_0xde0ca7/_0x1b6882,_0xec4ba1=renderTimeAxis({'startTime':_0xe9fe57,'endTime':_0x384678,'durationMs':_0xde0ca7,'msPerChar':_0xc94af5},_0x1b6882),_0x48826f=[];for(const _0x19f8e6 of _0x4269ba[_0xfcf0b3(0x24e)]()){_0x48826f[_0xfcf0b3(0x1cf)](..._0x19f8e6);}_0x48826f[_0xfcf0b3(0x251)]((_0x36fa62,_0x227ebb)=>_0x227ebb[_0xfcf0b3(0x2fa)]-_0x36fa62[_0xfcf0b3(0x2fa)]);const _0x3ae4b3=new Date(_0xe9fe57),_0x2ede40=formatDate(_0x3ae4b3),_0x2c875f=_0x190159+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0xfcf0b3(0x324)]+_0x5dcaeb,_0x4f9303='\x20'['repeat'](_0x2c875f-_0x2ede40[_0xfcf0b3(0x24f)]),_0x2e3d7a=_0x4f9303+a52_0x29459a[_0xfcf0b3(0x230)](_0x2ede40)+'\x20'+_0xec4ba1;_0x1ec748[_0xfcf0b3(0x1cf)](_0x2e3d7a);const _0x29d798=0x16;let _0x1100ab=0x0;for(const _0x5a08df of _0x48826f){const _0x13d188=_0x5a08df[_0xfcf0b3(0x1a4)][_0xfcf0b3(0x222)]?.[_0xfcf0b3(0x278)]||'?',_0x34957d=Math['min'](stringWidth(_0x13d188),_0x29d798);_0x1100ab=Math[_0xfcf0b3(0x2b3)](_0x1100ab,_0x34957d);}for(const _0xd74683 of _0x48826f){const {session:_0x229cc8,startTime:_0x4e2ccf,endTime:_0x3ee974,duration:_0x595f1c}=_0xd74683,_0x2c9ba9=_0x229cc8['project']?.['id'],_0x3c7d4e=_0x229cc8['id'],_0x385043=_0x229cc8[_0xfcf0b3(0x222)]?.[_0xfcf0b3(0x278)]||'?',_0x800ab2=_0x229cc8[_0xfcf0b3(0x265)]?.[_0xfcf0b3(0x278)]||'?';let _0x20502b,_0x35adb2;if(_0x229cc8[_0xfcf0b3(0x20f)]){const _0x1e897a=_0x229cc8['lastAttempt'];!_0x1e897a[_0xfcf0b3(0x24b)]?(_0x20502b=_0x1e897a[_0xfcf0b3(0x325)]?'🛑':'🔄',_0x35adb2=_0x1e897a['cancelRequested']?a52_0x29459a[_0xfcf0b3(0x22d)]:a52_0x29459a[_0xfcf0b3(0x2f6)]):(_0x20502b=_0x1e897a['success']?'✅':'❌',_0x35adb2=_0x1e897a[_0xfcf0b3(0x2c0)]?a52_0x29459a['green']:a52_0x29459a[_0xfcf0b3(0x1cd)]);}else _0x20502b='⏳',_0x35adb2=a52_0x29459a[_0xfcf0b3(0x230)];const _0x53ed8e='#'+_0x3c7d4e,_0x2b15fa=_0x2c9ba9?hyperlink(_0x53ed8e,getWorkflowSessionUrl(_0x9e034,_0x2c9ba9,_0x3c7d4e)):_0x53ed8e;let _0x1bdf2b=_0x385043;stringWidth(_0x385043)>_0x29d798&&(_0x1bdf2b=_0x385043[_0xfcf0b3(0x246)](0x0,_0x29d798-0x1)+'…');const _0x3e1596=a52_0x29459a[_0xfcf0b3(0x230)](_0x1bdf2b),_0x5aea62=stringWidth(_0x1bdf2b),_0x19120f='\x20'[_0xfcf0b3(0x31a)](_0x1100ab-stringWidth(_0x1bdf2b)+0x2),_0x285e4f='('+formatElapsed(_0x595f1c)+')',_0x5895d1=stringWidth(_0x285e4f),_0x3b75c3=stringWidth(_0x53ed8e),_0x501900=_0x3b75c3+0x1+_0x5aea62+_0x19120f[_0xfcf0b3(0x24f)],_0x3c8fad=_0x5dcaeb-_0x501900-_0x5895d1-0x1-0x8;let _0x2c38be=_0x800ab2;stringWidth(_0x2c38be)>_0x3c8fad&&(_0x2c38be=_0x2c38be[_0xfcf0b3(0x246)](0x0,_0x3c8fad-0x1)+'…');const _0x5a20e3=_0x2b15fa+'\x20'+_0x3e1596+_0x19120f+_0x2c38be,_0x117498=stringWidth(_0x5a20e3),_0x1ee837=_0x5dcaeb-_0x117498-_0x5895d1,_0x355b3f=_0x5a20e3+'\x20'['repeat'](Math[_0xfcf0b3(0x2b3)](0x1,_0x1ee837))+a52_0x29459a[_0xfcf0b3(0x230)](_0x285e4f),_0x476832=Math[_0xfcf0b3(0x19e)]((_0x4e2ccf-_0xe9fe57)/_0xc94af5),_0x33e576=Math[_0xfcf0b3(0x19e)]((_0x3ee974-_0xe9fe57)/_0xc94af5),_0x20eea0=Math['max'](_0x476832+0x1,_0x33e576),_0x32397f=new Array(_0x1b6882)[_0xfcf0b3(0x2d7)]('\x20');for(let _0x2ea530=_0x476832;_0x2ea530<Math[_0xfcf0b3(0x264)](_0x20eea0,_0x1b6882);_0x2ea530++){_0x32397f[_0x2ea530]='─';}const _0x54ec33=_0x32397f['map'](_0x40b3e8=>_0x40b3e8==='\x20'?'\x20':_0x35adb2(_0x40b3e8))[_0xfcf0b3(0x241)]('');_0x1ec748[_0xfcf0b3(0x1cf)](_0x20502b+'\x20'+_0x355b3f+'│'+_0x54ec33+'│');}return _0x1ec748[_0xfcf0b3(0x241)]('\x0a');}async[a52_0x5b31a0(0x1cb)](_0x4186ca,_0x214137,_0x7c0f19){const _0x2b92b7=a52_0x5b31a0,{options:_0x466a09,tdx:_0x425dfb}=_0x214137,_0x1b4bba=_0x466a09['site'],{timelineRows:_0x59bcef,timeAxisHeader:_0x1b4c61}=this[_0x2b92b7(0x1a0)](_0x4186ca,_0x1b4bba),_0x5c269a=_0x59bcef[_0x2b92b7(0x210)](_0x4b0a8e=>_0x4b0a8e['attemptId']);if(_0x5c269a['length']===0x0){const _0x1de742=this[_0x2b92b7(0x30b)](_0x4186ca,_0x1b4bba);console['log'](_0x1de742);!_0x7c0f19&&(console[_0x2b92b7(0x274)](''),console[_0x2b92b7(0x274)](a52_0x29459a[_0x2b92b7(0x230)](_0x2b92b7(0x229))),console['error'](a52_0x29459a[_0x2b92b7(0x230)](_0x2b92b7(0x2f4))+'or'+a52_0x29459a[_0x2b92b7(0x230)](_0x2b92b7(0x1ac))));return;}_0x1b4c61&&console[_0x2b92b7(0x201)](_0x1b4c61);const _0x4e1558=_0x59bcef[_0x2b92b7(0x210)](_0x47dc1b=>_0x47dc1b[_0x2b92b7(0x1f2)])[_0x2b92b7(0x2aa)](_0x58d7ae=>({'title':_0x58d7ae[_0x2b92b7(0x235)],'value':_0x58d7ae[_0x2b92b7(0x1f2)]})),_0x1a69bd=process[_0x2b92b7(0x236)][_0x2b92b7(0x1f8)]||0x3c,_0x25719e=Math[_0x2b92b7(0x2b3)](0x28,Math[_0x2b92b7(0x19e)](_0x1a69bd*0x2/0x3)),_0x47f96a=await a52_0x2378a5({'type':_0x2b92b7(0x2de),'name':'attemptId','message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x4e1558,'initial':-0x1,'limit':_0x25719e,'clearFirst':!![],'fallback':{'title':_0x2b92b7(0x2ac),'value':null},'suggest':(_0x1c177f,_0xb29e3a)=>{const _0x50d77a=_0x2b92b7;if(!_0x1c177f)return Promise[_0x50d77a(0x17d)](_0xb29e3a);const _0x4eb526=_0xb29e3a[_0x50d77a(0x210)](_0x44dd14=>{const _0x59e2f8=_0x50d77a,_0x54305b=_0x44dd14;return _0x54305b[_0x59e2f8(0x1a5)][_0x59e2f8(0x23a)]()[_0x59e2f8(0x270)](_0x1c177f[_0x59e2f8(0x23a)]());});return Promise[_0x50d77a(0x17d)](_0x4eb526);}}),_0x2044b7=()=>{const _0x3d8634=_0x2b92b7;process[_0x3d8634(0x236)][_0x3d8634(0x22c)](_0x3d8634(0x178)),process[_0x3d8634(0x236)][_0x3d8634(0x22c)](_0x3d8634(0x178)),process[_0x3d8634(0x236)]['write'](_0x3d8634(0x178));},_0x7ffad3=_0x47f96a&&_0x47f96a[_0x2b92b7(0x1f2)]&&_0x47f96a[_0x2b92b7(0x1f2)]!==null&&_0x47f96a[_0x2b92b7(0x1f2)][_0x2b92b7(0x200)]()!=='';if(!_0x7ffad3){_0x2044b7(),console[_0x2b92b7(0x201)](a52_0x29459a[_0x2b92b7(0x230)]('Cancelled'));return;}_0x2044b7();const _0x2fc283=_0x4186ca[_0x2b92b7(0x279)](_0x4cdb4f=>_0x4cdb4f[_0x2b92b7(0x20f)]?.['id']===_0x47f96a['attemptId']);if(_0x2fc283){const _0x27eafd=_0x2fc283[_0x2b92b7(0x222)]?.[_0x2b92b7(0x278)]||'?',_0x4753e5=_0x2fc283['workflow']?.[_0x2b92b7(0x278)]||'?';console[_0x2b92b7(0x201)]('Project:\x20'+a52_0x29459a['dim'](_0x27eafd)+_0x2b92b7(0x2fb)+a52_0x29459a[_0x2b92b7(0x230)](_0x4753e5));}const _0x13e627=new WorkflowTimelineCommand();await _0x13e627[_0x2b92b7(0x247)]({'args':[],'options':{..._0x466a09,'attemptId':_0x47f96a['attemptId']},'tdx':_0x425dfb});}[a52_0x5b31a0(0x1a0)](_0x42754b,_0x256b19){const _0x26181f=a52_0x5b31a0,_0x94825=new Map();for(const _0x2ec63f of _0x42754b){_0x2ec63f['id']&&_0x2ec63f[_0x26181f(0x20f)]?.['id']&&_0x94825['set'](_0x2ec63f['id'],_0x2ec63f['lastAttempt']['id']);}const _0x19226a=[];let _0x29a1e2='';const _0x5dc463=this[_0x26181f(0x30b)](_0x42754b,_0x256b19),_0x443da1=_0x5dc463[_0x26181f(0x198)]('\x0a');for(const _0x2bf869 of _0x443da1){if(_0x2bf869[_0x26181f(0x1b2)](_0x26181f(0x1ca))||_0x2bf869[_0x26181f(0x2d2)](/^\s+\d{4}-\d{2}-\d{2}/))_0x29a1e2=_0x2bf869;else{if(_0x2bf869[_0x26181f(0x2d2)](/^[✅❌🔄🛑⏳]/)){const _0x4b4270=_0x2bf869[_0x26181f(0x2d2)](/#(\d+)/),_0x41c1e4=_0x4b4270?_0x4b4270[0x1]:null,_0x4f524c=_0x41c1e4?_0x94825[_0x26181f(0x25c)](_0x41c1e4)||null:null,_0x3248ee=_0x42754b[_0x26181f(0x279)](_0x1d5396=>_0x1d5396['id']===_0x41c1e4),_0x3d2d14=_0x3248ee?.[_0x26181f(0x222)]?.[_0x26181f(0x278)]||'';_0x19226a['push']({'displayLine':_0x2bf869,'attemptId':_0x4f524c,'projectName':_0x3d2d14});}}}return{'timelineRows':_0x19226a,'timeAxisHeader':_0x29a1e2};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a52_0x5b31a0(0x278)]=a52_0x5b31a0(0x2df);['description']=a52_0x5b31a0(0x239);async[a52_0x5b31a0(0x247)](_0x33421b){const _0x3c3c2a=a52_0x5b31a0,{options:_0x392a62,args:_0x338a4d,tdx:_0x221cc8}=_0x33421b,_0x5dab64=this[_0x3c3c2a(0x1b5)](_0x338a4d,_0x392a62);if(!_0x5dab64)return 0x1;const {projectName:_0x1405d2,workflowName:_0x450bb7}=_0x5dab64,_0x524d77=_0x392a62['includeRetried'];if(_0x392a62[_0x3c3c2a(0x2bb)]){if(_0x1405d2&&_0x450bb7)console[_0x3c3c2a(0x274)](_0x3c3c2a(0x23c)+_0x1405d2+'.'+_0x450bb7);else _0x1405d2&&console['error'](_0x3c3c2a(0x2c5)+_0x1405d2);_0x524d77&&console[_0x3c3c2a(0x274)]('Include\x20retried:\x20yes');}const _0x3a042e=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x221cc8[_0x3c3c2a(0x265)][_0x3c3c2a(0x328)]({'projectName':_0x1405d2,'workflowName':_0x450bb7,'includeRetried':_0x524d77,'limit':_0x392a62[_0x3c3c2a(0x1f6)]}),{'verbose':_0x392a62[_0x3c3c2a(0x2bb)]}),_0x4a6d8f=_0x3a042e['data'],_0x19ba14=_0x392a62['limit']||0x64,_0x2b594a=_0x4a6d8f[_0x3c3c2a(0x24f)]>=_0x19ba14?a52_0x29459a[_0x3c3c2a(0x230)](_0x3c3c2a(0x1fe)):'';console[_0x3c3c2a(0x274)](_0x3c3c2a(0x327)+_0x4a6d8f[_0x3c3c2a(0x24f)]+'\x20attempt'+(_0x4a6d8f[_0x3c3c2a(0x24f)]!==0x1?'s':'')+_0x2b594a);if(_0x392a62[_0x3c3c2a(0x1b6)]==='json'||_0x392a62[_0x3c3c2a(0x1b6)]===_0x3c3c2a(0x20e)||_0x392a62[_0x3c3c2a(0x1b6)]==='table')await handleSDKOutput(_0x4a6d8f,_0x392a62);else{if(_0x4a6d8f[_0x3c3c2a(0x24f)]===0x0){if(_0x1405d2&&_0x450bb7)console[_0x3c3c2a(0x201)](_0x3c3c2a(0x1bf)+_0x1405d2+'.'+_0x450bb7);else _0x1405d2?console['log'](_0x3c3c2a(0x1a7)+_0x1405d2):console[_0x3c3c2a(0x201)](_0x3c3c2a(0x30f));}else{const _0x4449a1=_0x392a62['site'],_0x144571=_0x4a6d8f['map'](_0x5a108a=>{const _0x3527c7=_0x3c3c2a,_0x307e9b=a52_0x29459a[_0x3527c7(0x230)]('#'+_0x5a108a['id']),_0x26f8cc=_0x5a108a[_0x3527c7(0x222)]?.['id'],_0x4b1492=_0x5a108a[_0x3527c7(0x2ca)]||_0x5a108a['sessionId'],_0x48489e=_0x26f8cc&&_0x4b1492?hyperlink(_0x307e9b,getWorkflowAttemptUrl(_0x4449a1,_0x26f8cc,_0x4b1492,_0x5a108a['id'])):_0x307e9b,{icon:_0x35ce43,text:_0x4e0629}=getAttemptStatusDisplay(_0x5a108a),_0x2bb481=(_0x5a108a['project']?.[_0x3527c7(0x278)]||'?')+'.'+(_0x5a108a[_0x3527c7(0x265)]?.[_0x3527c7(0x278)]||'?'),_0x380507=_0x5a108a[_0x3527c7(0x29d)]?a52_0x29459a['dim'](_0x5a108a[_0x3527c7(0x29d)]):'';return(_0x48489e+'\x20'+_0x35ce43+(_0x4e0629?'\x20'+_0x4e0629:'')+'\x20'+_0x2bb481+'\x20'+_0x380507)[_0x3527c7(0x276)]();});await writeOutput(_0x144571['join']('\x0a'),_0x392a62[_0x3c3c2a(0x32d)],_0x3c3c2a(0x18c));}}return 0x0;}}function a52_0x5e1e(){const _0x491808=['workflow:run','done','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','values','length','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','sort','pullProject','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','getMonth','No\x20projects\x20match\x20pattern:\x20','planned','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Key:\x20','No\x20log\x20content\x20found','resolveProjectDir','get','taskName','Listing\x20workflows...','(use\x20--limit\x20to\x20see\x20more)','Attempt:\x20','pollTimeline','Project\x20filter:\x20','POLL_INTERVAL_MS','min','workflow','showWorkflowConsoleUrl','task','/app/workflows/','workflow:projects','kill','9aKjHWm','Auto-selected\x20latest\x20session:\x20','Retry\x20a\x20session\x20or\x20attempt','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','dryRun','includes','Error:\x20Invalid\x20JSON\x20in\x20--params','renderTimeline','stat','error','.\x20Expected\x20format:\x20KEY=VALUE','trimEnd','List\x20workflows','name','find','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','some','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','No\x20sessions\x20found\x20in\x20project:\x20','\x22\x20to\x20new\x20project\x20\x22','unchanged','\x20unchanged','applyPullProject','workflow:download','buildTimelineData','Pushing\x20project...','executeCloneProject','existingProjectId','deleted','Retrying\x20attempt...','1207591FvZffm','Show\x20logs\x20for\x20a\x20workflow\x20attempt','end','\x20\x20Project:\x20','✔\x20Retry\x20started','✔\x20Workflow\x20project\x20context\x20cleared.','Error:\x20Invalid\x20parameter\x20format:\x20','Force:\x20yes','Validation:\x20skipped','Deleting\x20secret...','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','Error:\x20Secret\x20key\x20is\x20required','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','round','keys','follow','Project\x20directory:\x20','json','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x20\x20Workflow:\x20','sessionTime','readFile','workflow:secrets:list','Source:\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','→\x20New\x20project:\x20','pending','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','\x27...','\x0aDry\x20run\x20-\x20no\x20files\x20written','yes','Target:\x20','attempt:','map','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','No\x20matching\x20sessions\x20found','\x22\x20with\x20new\x20revision?','includeSubtasks','Session\x20time:\x20','Error:','\x20\x20Source:\x20','/sessions/','max','retryAttemptName','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','utf-8','Total:\x20','Writing\x20files...','Killing\x20attempt...','verbose','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','hasChanges','summary','\x20modified','success','Source\x20directory:\x20','Invalid\x20format:\x20','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','MAX_TIMELINE_WIDTH','Filter:\x20project=','getMinutes','type','\x0aUpdate\x20existing\x20project\x20\x22','\x20project','session_id','Analyzing\x20project...','LABEL_MIN_SPACING','Show\x20specific\x20attempt\x20details','Revision:\x20','group_error','resolveProjectId','Resume\x20from:\x20','match','No\x20sessions\x20with\x20timing\x20information','\x20deleted','Start\x20a\x20workflow\x20run','\x0aClone\x20\x22','fill','renderSingleTimeline','Select\x20a\x20workflow\x20to\x20run','Source\x20project:\x20','Pushing\x20workflow\x20project...','replace','📁\x20','autocomplete','workflow:attempts','start','workflow:pull','Latest\x20session\x20has\x20no\x20attempt','setSecrets','Show\x20tasks\x20for\x20an\x20attempt','Dry\x20run:\x20yes','newProjectId','workflow:attempt','skipValidation','workflow:secrets:delete','Setting\x20secret...','projectName','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Updating\x20','revision','prepareCloneProject','now','retrySession','→\x20Project:\x20','\x20\x20Console:\x20','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','getTime','blue','newProjectName','splice','Files\x20to\x20upload:\x20','startTime',',\x20Workflow:\x20','\x20to\x20see\x20detailed\x20logs','params','columns','Deleting\x20project\x20','-\x20no\x20files\x20written','workflow:use','No\x20workflow\x20sessions\x20found','fromTask','finishedAt','4589128iFiIER','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','icon','Pattern:\x20','padStart','window','renderSessionsTimeline','\x0aDry\x20run\x20-\x20no\x20project\x20created','Reason:\x20','state','No\x20attempts\x20found','relative','\x20\x20Target:\x20','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','workflow:delete','Fetching\x20log\x20files...','TASK_NAME_WIDTH','sessionId','\x0a✔\x20Already\x20up\x20to\x20date','Source\x20directory\x20is\x20required','New\x20project\x20name:\x20','repeat','projectId','\x27\x20from\x20project\x20\x27','✔\x20Pushed\x20','Downloading\x20logs...','Attempt\x20ID:\x20','\x20is\x20not\x20a\x20directory','msPerChar','MIN_LABEL_COUNT','Workflow:\x20','ICON_SPACING','cancelRequested','List\x20all\x20workflow\x20projects','✔\x20Found\x20','attempts','442gfLhxI','run','Parameters:\x20','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','output','modified','workflow:logs','startedAt','Project:\x20','✔\x20Clone\x20complete','Failed\x20to\x20fetch\x20attempt\x20data','sourceDir','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','/attempt/','resumeFrom','\x1b[1A\x1b[2K','\x20workflow','Target\x20directory:\x20','\x20\x20Project\x20ID:\x20','fs/promises','resolve','73203toTNwA','38596KJKKgg','message','\x20\x20Changes:\x20','toISOString','logs','localeCompare','1304125tRwgCi','MIN_TIMELINE_WIDTH','MAX_TASKS_DISPLAY','\x20\x20Location:\x20','Session\x20not\x20found:\x20','667408fZBzfC','tdx.json','list','sys','\x20tasks','\x0aApply\x20these\x20changes?','canceling','key','workflow:kill','LABEL_WIDTH_DIVISOR','Cancelled','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','parse','substring','split','No\x20sessions\x20found','\x20\x20Session\x20ID:\x20','workflow:timeline','Pulling\x20project\x20','Tip:\x20cd\x20to\x20workflows/','floor','indexOf','generateSessionTimelineRows','table','\x20\x20Session\x20context\x20set\x20to:\x20','cwd','session','title','Project\x20name\x20is\x20required','No\x20attempts\x20found\x20in\x20project:\x20','running','getHours','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','\x20(system)','\x20\x20tdx\x20wf\x20use\x20<project>','deleteSecret','Error:\x20Attempt\x20ID\x20is\x20required','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Retrying\x20session...','workflow:clone','startsWith','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Including\x20subtasks:\x20yes','parseProjectWorkflowPattern','format','workflows','Select\x20a\x20task\x20to\x20view\x20logs:','context','Select\x20a\x20session\x20to\x20view\x20timeline:','No\x20workflows\x20found\x20in\x20project:\x20','cyan','Status:\x20','site','No\x20attempts\x20found\x20for:\x20','updatedAt','Listing\x20workflow\x20projects...','description','metadata','No\x20workflow\x20tdx.json\x20found','Listing\x20workflow\x20sessions...','30JOIzZs','Expected\x20format:\x20--param\x20key=value','workflow:secrets:set','🔄\x20','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','navigateSessionsInteractive','Resolving\x20project\x20\x27','red','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','push','ICON_WIDTH','✔\x20Secret\x20\x27','\x0aError:','✔\x20Workflow\x20run\x20started','\x0a✔\x20Attempt\x20complete','✔\x20Showing\x20','diff','value','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','...','white','select','durationMs','\x20secrets\x20set\x20for\x20project\x20\x27','💡\x20Tip:\x20Use\x20','download','\x20\x20Revision:\x20','Cloning\x20to\x20','getFullYear','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','sourceProjectName','List\x20workflow\x20execution\x20sessions','fullName','Task\x20name:\x20','logFiles','workflow:push','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','fileCount','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','workflow:sessions','requireProject','37PTDRYM','workflowProject','Loading\x20session...','attemptId','new','Listing\x20secrets...','fileSize','limit','\x20-\x20','rows','from','52zFFCra','tasks','\x20logs','-\x20nothing\x20pushed','\x20(use\x20--limit\x20to\x20show\x20more)','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','trim','log','Setting\x20','Pull\x20workflow\x20project\x20to\x20local\x20folder','targetDir','total','status','\x20of\x20','✔\x20Downloaded\x20','No\x20workflows\x20found','workflow:upload','stringify','10LYSFaO','sessions','jsonl','lastAttempt','filter','No\x20sessions\x20found\x20for:\x20','projects','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','duration','663204bNeeqM','Usage:\x20tdx\x20wf\x20use\x20<project>','workflow:workflows','Loading\x20workflows...','basename','\x0aDry\x20run\x20-\x20nothing\x20pushed','\x0a⚠\x20Project\x20\x22','createdAt','\x20session','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','param','\x20\x20New\x20attempt\x20ID:\x20','changes','project','Error:\x20','Error:\x20Project\x20name\x20is\x20required','Key\x20cannot\x20be\x20empty','resolveProject','Output\x20directory:\x20','getDate','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','\x22?\x20This\x20cannot\x20be\x20undone.','set','write','yellow','\x20task','workflowName','dim','reason','green','\x0aPush\x20these\x20changes?','Warning:','displayLine','stdout','No\x20log\x20files\x20found\x20for\x20this\x20attempt','attempt','List\x20workflow\x20attempts','toLowerCase','unknown','Filter:\x20','✔\x20Push\x20complete','path','targetExists','Kill\x20a\x20running\x20attempt','join','\x0aFailed\x20to\x20fetch\x20attempt\x20data','has','data','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','slice','execute','isDirectory','Loading\x20sessions...'];a52_0x5e1e=function(){return _0x491808;};return a52_0x5e1e();}export class WorkflowAttemptCommand extends BaseCommand{[a52_0x5b31a0(0x278)]=a52_0x5b31a0(0x2e7);[a52_0x5b31a0(0x1c2)]=a52_0x5b31a0(0x2cd);async[a52_0x5b31a0(0x247)](_0x505c2a){const _0x545c1b=a52_0x5b31a0,{options:_0x24040a,args:_0x168b20,tdx:_0x57a56c}=_0x505c2a,_0x4c61d3=_0x168b20[0x0];if(!_0x4c61d3)return console['error'](_0x545c1b(0x1ae)),0x1;_0x24040a[_0x545c1b(0x2bb)]&&console['error'](_0x545c1b(0x31f)+_0x4c61d3);const _0x33147f=await withSpinner('Getting\x20attempt\x20details...',()=>_0x57a56c[_0x545c1b(0x265)]['attempt'](_0x4c61d3),{'verbose':_0x24040a[_0x545c1b(0x2bb)]}),_0xee7d2b=_0x33147f[_0x545c1b(0x244)];let _0x5ce3e1;!_0xee7d2b[_0x545c1b(0x24b)]?_0x5ce3e1=_0xee7d2b['cancelRequested']?'canceling':'running':_0x5ce3e1=_0xee7d2b['success']?_0x545c1b(0x2c0):_0x545c1b(0x274);let _0x3c5f9a;if(_0xee7d2b[_0x545c1b(0x21c)]&&_0xee7d2b[_0x545c1b(0x304)]){const _0x414709=new Date(_0xee7d2b[_0x545c1b(0x21c)])['getTime'](),_0x2f1ff5=new Date(_0xee7d2b[_0x545c1b(0x304)])[_0x545c1b(0x2f5)]();_0x3c5f9a=Math[_0x545c1b(0x296)]((_0x2f1ff5-_0x414709)/0x3e8);}const _0xabc3d4={'attempt_id':_0xee7d2b['id'],'status':_0x5ce3e1,..._0xee7d2b['index']!==undefined&&{'index':_0xee7d2b['index']},..._0xee7d2b[_0x545c1b(0x222)]&&{'project':_0xee7d2b[_0x545c1b(0x222)][_0x545c1b(0x278)]},..._0xee7d2b[_0x545c1b(0x265)]&&{'workflow':_0xee7d2b['workflow'][_0x545c1b(0x278)]},..._0xee7d2b[_0x545c1b(0x316)]&&{'session_id':_0xee7d2b['sessionId']},..._0xee7d2b[_0x545c1b(0x29d)]&&{'session_time':_0xee7d2b[_0x545c1b(0x29d)]},..._0xee7d2b[_0x545c1b(0x2b4)]&&{'retry_attempt':_0xee7d2b[_0x545c1b(0x2b4)]},..._0x3c5f9a!==undefined&&{'duration_sec':_0x3c5f9a},..._0xee7d2b[_0x545c1b(0x21c)]&&{'created_at':_0xee7d2b[_0x545c1b(0x21c)]},..._0xee7d2b[_0x545c1b(0x304)]&&{'finished_at':_0xee7d2b[_0x545c1b(0x304)]},...Object[_0x545c1b(0x297)](_0xee7d2b[_0x545c1b(0x2fd)])['length']>0x0&&{'params':_0xee7d2b[_0x545c1b(0x2fd)]}};return await handleSingleObjectOutput(_0xabc3d4,_0x24040a),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a52_0x5b31a0(0x278)]='workflow:tasks';[a52_0x5b31a0(0x1c2)]=a52_0x5b31a0(0x2e4);async[a52_0x5b31a0(0x247)](_0x5cd364){const _0x41b4cc=a52_0x5b31a0,{options:_0x5d2b32,args:_0x3131a1,tdx:_0x4a632b}=_0x5cd364,_0x4ddd51=_0x3131a1[0x0];if(!_0x4ddd51)return console[_0x41b4cc(0x274)](_0x41b4cc(0x1ae)),0x1;const _0x51f35e=_0x5d2b32[_0x41b4cc(0x2ae)];_0x5d2b32[_0x41b4cc(0x2bb)]&&(console[_0x41b4cc(0x274)](_0x41b4cc(0x31f)+_0x4ddd51),_0x51f35e&&console[_0x41b4cc(0x274)](_0x41b4cc(0x1b4)));const _0x18cd33=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x4a632b[_0x41b4cc(0x265)][_0x41b4cc(0x1fb)](_0x4ddd51,_0x51f35e||![]),{'verbose':_0x5d2b32['verbose']}),_0x2ffc9f=_0x18cd33[_0x41b4cc(0x244)];return console[_0x41b4cc(0x274)](_0x41b4cc(0x327)+_0x2ffc9f[_0x41b4cc(0x24f)]+_0x41b4cc(0x22e)+(_0x2ffc9f[_0x41b4cc(0x24f)]!==0x1?'s':'')),await handleSDKOutput(_0x2ffc9f,_0x5d2b32),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a52_0x5b31a0(0x278)]=a52_0x5b31a0(0x16f);[a52_0x5b31a0(0x1c2)]=a52_0x5b31a0(0x28a);async[a52_0x5b31a0(0x247)](_0x278353){const _0x2e2de4=a52_0x5b31a0,{options:_0x44320a,args:_0xd50526,tdx:_0x1d2202}=_0x278353,_0x51162a=_0xd50526[0x0];let _0x1da04c=_0xd50526[0x1];if(!_0x51162a)return console[_0x2e2de4(0x274)](_0x2e2de4(0x1ae)),0x1;_0x44320a[_0x2e2de4(0x2bb)]&&(console[_0x2e2de4(0x274)](_0x2e2de4(0x31f)+_0x51162a),_0x1da04c&&console[_0x2e2de4(0x274)](_0x2e2de4(0x1e7)+_0x1da04c));const _0x48154d=await withSpinner(_0x2e2de4(0x314),()=>_0x1d2202[_0x2e2de4(0x265)][_0x2e2de4(0x1e8)](_0x51162a,_0x1da04c),{'verbose':_0x44320a[_0x2e2de4(0x2bb)]}),_0x31fa07=_0x48154d[_0x2e2de4(0x244)];if(_0x31fa07[_0x2e2de4(0x24f)]===0x0)return console['error'](_0x2e2de4(0x237)),0x0;if(!_0x1da04c&&(_0x44320a[_0x2e2de4(0x29a)]||_0x44320a[_0x2e2de4(0x1b6)]))return await handleSDKOutput(_0x31fa07,_0x44320a),0x0;if(!_0x1da04c){const _0x361a4b=_0x31fa07[_0x2e2de4(0x2aa)](_0x2ff178=>({'title':_0x2ff178[_0x2e2de4(0x25d)]+'\x20('+formatBytes(_0x2ff178[_0x2e2de4(0x1f5)])+')','value':_0x2ff178['taskName']})),_0x400ca4=await a52_0x2378a5({'type':_0x2e2de4(0x1db),'name':_0x2e2de4(0x267),'message':_0x2e2de4(0x1b8),'choices':_0x361a4b});if(!_0x400ca4['task'])return console[_0x2e2de4(0x274)](_0x2e2de4(0x194)),0x0;_0x1da04c=_0x400ca4[_0x2e2de4(0x267)];}const _0x593cf7=await withSpinner(_0x2e2de4(0x31e),()=>_0x1d2202['workflow'][_0x2e2de4(0x183)](_0x51162a,_0x1da04c),{'verbose':_0x44320a[_0x2e2de4(0x2bb)]}),_0x3008c3=_0x593cf7['data'];return _0x3008c3?console[_0x2e2de4(0x201)](_0x3008c3):console[_0x2e2de4(0x274)](_0x2e2de4(0x25a)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a52_0x5b31a0(0x278)]=a52_0x5b31a0(0x192);[a52_0x5b31a0(0x1c2)]=a52_0x5b31a0(0x240);async[a52_0x5b31a0(0x247)](_0x299d01){const _0x4ef23d=a52_0x5b31a0,{options:_0x1a1ffb,args:_0x3df8a5,tdx:_0x42d3c5}=_0x299d01,_0x3cd139=_0x3df8a5[0x0];if(!_0x3cd139)return console[_0x4ef23d(0x274)](_0x4ef23d(0x1ae)),0x1;const _0x424e23=_0x1a1ffb[_0x4ef23d(0x231)];_0x1a1ffb['verbose']&&(console[_0x4ef23d(0x274)]('Attempt\x20ID:\x20'+_0x3cd139),_0x424e23&&console[_0x4ef23d(0x274)](_0x4ef23d(0x30d)+_0x424e23));if(!_0x1a1ffb['yes']){if(!isInteractive())return console[_0x4ef23d(0x274)](a52_0x29459a[_0x4ef23d(0x1cd)]('\x0aError:'),_0x4ef23d(0x258)),console[_0x4ef23d(0x274)](a52_0x29459a[_0x4ef23d(0x230)](_0x4ef23d(0x306))),0x1;const _0xb6b84d=await confirmKey(_0x4ef23d(0x1af)+_0x3cd139+'?');if(!_0xb6b84d)return console[_0x4ef23d(0x274)](a52_0x29459a['yellow'](_0x4ef23d(0x194))),0x1;}const _0x263510=await withSpinner(_0x4ef23d(0x2ba),()=>_0x42d3c5[_0x4ef23d(0x265)][_0x4ef23d(0x26a)](_0x3cd139,_0x424e23),{'verbose':_0x1a1ffb[_0x4ef23d(0x2bb)]}),_0x4658f1=_0x263510['data'];return console[_0x4ef23d(0x274)]('✔\x20'+_0x4658f1),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a52_0x5b31a0(0x278)]='workflow:retry';[a52_0x5b31a0(0x1c2)]=a52_0x5b31a0(0x26d);async[a52_0x5b31a0(0x247)](_0x545c12){const _0x5c484d=a52_0x5b31a0,{options:_0x1c82a4,args:_0x1f74f8,tdx:_0x26963b}=_0x545c12,_0x130766=_0x1f74f8[0x0];if(!_0x130766)return console[_0x5c484d(0x274)](_0x5c484d(0x27c)),console[_0x5c484d(0x274)](_0x5c484d(0x1ff)),0x1;let _0x8a6506=![],_0x250187=_0x130766;if(_0x130766[_0x5c484d(0x1b2)]('session:'))_0x8a6506=!![],_0x250187=_0x130766[_0x5c484d(0x197)](0x8);else{if(_0x130766[_0x5c484d(0x1b2)](_0x5c484d(0x2a9)))_0x8a6506=![],_0x250187=_0x130766[_0x5c484d(0x197)](0x8);else return console[_0x5c484d(0x274)](_0x5c484d(0x29b)),console[_0x5c484d(0x274)](_0x5c484d(0x1ff)),0x1;}const _0x5ce1ce=_0x1c82a4[_0x5c484d(0x303)],_0x3dd388=_0x1c82a4[_0x5c484d(0x177)],_0x4e7c15=_0x1c82a4['params'],_0x5c6f5f=_0x1c82a4['force'];_0x1c82a4[_0x5c484d(0x2bb)]&&(console[_0x5c484d(0x274)](_0x5c484d(0x2a8)+(_0x8a6506?_0x5c484d(0x1a4):_0x5c484d(0x238))+'\x20'+_0x250187),_0x5ce1ce&&console[_0x5c484d(0x274)]('From\x20task:\x20'+_0x5ce1ce),_0x3dd388&&console[_0x5c484d(0x274)](_0x5c484d(0x2d1)+_0x3dd388),_0x4e7c15&&console[_0x5c484d(0x274)]('Params:\x20'+_0x4e7c15),_0x5c6f5f&&console[_0x5c484d(0x274)](_0x5c484d(0x290)));let _0x3acafc;if(_0x4e7c15)try{if(_0x4e7c15['startsWith']('@')){const _0x5b4394=await import(_0x5c484d(0x17c)),_0x501a26=_0x4e7c15[_0x5c484d(0x197)](0x1),_0x36340c=await _0x5b4394[_0x5c484d(0x29e)](_0x501a26,_0x5c484d(0x2b7));_0x3acafc=JSON[_0x5c484d(0x196)](_0x36340c);}else _0x3acafc=JSON[_0x5c484d(0x196)](_0x4e7c15);}catch{return console['error'](_0x5c484d(0x271)),0x1;}if(!_0x1c82a4[_0x5c484d(0x2a7)]){if(!isInteractive())return console[_0x5c484d(0x274)](a52_0x29459a['red'](_0x5c484d(0x1d2)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a52_0x29459a[_0x5c484d(0x230)](_0x5c484d(0x306))),0x1;const _0xeda435=await confirmKey(_0x5c484d(0x1b3)+(_0x8a6506?_0x5c484d(0x1a4):'attempt')+'\x20'+_0x250187+'?');if(!_0xeda435)return console['error'](a52_0x29459a['yellow'](_0x5c484d(0x194))),0x1;}let _0x18449d;_0x8a6506?_0x18449d=await withSpinner(_0x5c484d(0x1b0),()=>_0x26963b['workflow'][_0x5c484d(0x2f1)](_0x250187,{'fromTask':_0x5ce1ce,'retryParams':_0x3acafc}),{'verbose':_0x1c82a4['verbose']}):_0x18449d=await withSpinner(_0x5c484d(0x288),()=>_0x26963b['workflow']['retryAttempt'](_0x250187,{'resumeFrom':_0x3dd388,'retryParams':_0x3acafc,'force':_0x5c6f5f}),{'verbose':_0x1c82a4['verbose']});const _0x3d8e75=_0x18449d['data'];return console['error'](_0x5c484d(0x28d)),console[_0x5c484d(0x274)](_0x5c484d(0x220)+_0x3d8e75['attemptId']),console[_0x5c484d(0x274)]('\x20\x20Session\x20ID:\x20'+_0x3d8e75['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a52_0x5b31a0(0x24a);['description']=a52_0x5b31a0(0x2d5);async[a52_0x5b31a0(0x247)](_0x515ff2){const _0x21960d=a52_0x5b31a0,{options:_0x453c0d,args:_0x12716c,tdx:_0x2fb4d6}=_0x515ff2;let _0x5a60f2=_0x12716c[0x0];if(!_0x5a60f2){const _0xca39b1=this['resolveProject']([],_0x453c0d),_0xe3a980=await withSpinner(_0x21960d(0x218),()=>_0x2fb4d6['workflow']['workflows'](_0xca39b1,{'limit':_0x453c0d[_0x21960d(0x1f6)]}),{'verbose':_0x453c0d[_0x21960d(0x2bb)]}),_0x426176=_0xe3a980[_0x21960d(0x244)];if(_0x426176[_0x21960d(0x24f)]===0x0)return console[_0x21960d(0x274)](_0x21960d(0x209)),!_0xca39b1&&console[_0x21960d(0x274)](a52_0x29459a[_0x21960d(0x230)](_0x21960d(0x253))),0x1;const _0x36900b=_0x426176[_0x21960d(0x2aa)](_0x105f2e=>({'title':_0x105f2e['project']?.[_0x21960d(0x278)]+'.'+_0x105f2e[_0x21960d(0x278)],'value':_0x105f2e['project']?.[_0x21960d(0x278)]+'.'+_0x105f2e[_0x21960d(0x278)],'description':_0x105f2e[_0x21960d(0x2ee)]?'revision:\x20'+_0x105f2e['revision']:undefined})),_0x327634=await a52_0x2378a5({'type':'select','name':_0x21960d(0x265),'message':_0x21960d(0x2d9),'choices':_0x36900b});if(!_0x327634['workflow'])return 0x1;_0x5a60f2=_0x327634[_0x21960d(0x265)];}if(!_0x5a60f2[_0x21960d(0x270)]('.')){const _0x14fb40=this[_0x21960d(0x226)]([],_0x453c0d);if(_0x14fb40)_0x5a60f2=_0x14fb40+'.'+_0x5a60f2;else return console['error'](a52_0x29459a[_0x21960d(0x1cd)]('Error:'),_0x21960d(0x2b6)),console[_0x21960d(0x274)](a52_0x29459a['dim'](_0x21960d(0x253))),0x1;}const _0x4c4b76=_0x453c0d[_0x21960d(0x21f)],_0x57bd03=_0x453c0d[_0x21960d(0x29d)],_0x463fc7={};if(_0x4c4b76&&Array['isArray'](_0x4c4b76))for(const _0x454fe0 of _0x4c4b76){const _0x24654f=_0x454fe0['indexOf']('=');if(_0x24654f===-0x1)return console[_0x21960d(0x274)](_0x21960d(0x28f)+_0x454fe0),console[_0x21960d(0x274)](_0x21960d(0x1c7)),0x1;const _0x3d1766=_0x454fe0[_0x21960d(0x197)](0x0,_0x24654f),_0x549c7d=_0x454fe0[_0x21960d(0x197)](_0x24654f+0x1);try{_0x463fc7[_0x3d1766]=JSON['parse'](_0x549c7d);}catch{_0x463fc7[_0x3d1766]=_0x549c7d;}}_0x453c0d[_0x21960d(0x2bb)]&&(console[_0x21960d(0x274)](_0x21960d(0x323)+_0x5a60f2),Object[_0x21960d(0x297)](_0x463fc7)[_0x21960d(0x24f)]>0x0&&console[_0x21960d(0x274)](_0x21960d(0x32b)+JSON[_0x21960d(0x20b)](_0x463fc7)),_0x57bd03&&console[_0x21960d(0x274)](_0x21960d(0x2af)+_0x57bd03));const _0x28a888=await withSpinner('Starting\x20workflow\x20run...',()=>_0x2fb4d6[_0x21960d(0x265)][_0x21960d(0x32a)](_0x5a60f2,_0x463fc7,{'sessionTime':_0x57bd03}),{'verbose':_0x453c0d[_0x21960d(0x2bb)]}),_0x4ae077=_0x28a888[_0x21960d(0x244)];console[_0x21960d(0x274)](_0x21960d(0x1d3)),console[_0x21960d(0x274)]('\x20\x20Attempt\x20ID:\x20'+_0x4ae077['id']),console[_0x21960d(0x274)](_0x21960d(0x19a)+_0x4ae077[_0x21960d(0x316)]),console[_0x21960d(0x274)](_0x21960d(0x28c)+_0x4ae077['project']?.[_0x21960d(0x278)]),console[_0x21960d(0x274)](_0x21960d(0x29c)+_0x4ae077[_0x21960d(0x265)]?.[_0x21960d(0x278)]);if(_0x4ae077[_0x21960d(0x222)]?.['id']&&_0x4ae077['sessionId']&&_0x4ae077['id']){const _0x14c51d=_0x453c0d[_0x21960d(0x1be)],_0x4834d7=getConsoleUrl(_0x14c51d,_0x21960d(0x268)+_0x4ae077[_0x21960d(0x222)]['id']+_0x21960d(0x2b2)+_0x4ae077['sessionId']+_0x21960d(0x176)+_0x4ae077['id']);console[_0x21960d(0x274)](_0x21960d(0x2f3)+a52_0x29459a[_0x21960d(0x1bc)](_0x4834d7));}return 0x0;}}function a52_0x191d(_0xce212d,_0x2af4ad){_0xce212d=_0xce212d-0x16e;const _0x5e1ece=a52_0x5e1e();let _0x191d4f=_0x5e1ece[_0xce212d];return _0x191d4f;}export class WorkflowDownloadCommand extends BaseCommand{[a52_0x5b31a0(0x278)]=a52_0x5b31a0(0x282);[a52_0x5b31a0(0x1c2)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a52_0x5b31a0(0x247)](_0x161533){const _0x579529=a52_0x5b31a0,{options:_0x286b16,args:_0x571329,tdx:_0x908bac}=_0x161533,_0x26af69=_0x571329[0x0],_0x279634=_0x571329[0x1]||'.';if(!_0x26af69)return console[_0x579529(0x274)](_0x579529(0x224)),console[_0x579529(0x274)](_0x579529(0x1e3)),0x1;const _0x182c75=_0x286b16['revision'];_0x286b16['verbose']&&(console['error'](_0x579529(0x171)+_0x26af69),console[_0x579529(0x274)](_0x579529(0x227)+_0x279634),_0x182c75&&console[_0x579529(0x274)]('Revision:\x20'+_0x182c75));const _0x360e4a=await withSpinner('Downloading\x20project\x20'+_0x26af69+'...',()=>_0x908bac[_0x579529(0x265)][_0x579529(0x1df)](_0x26af69,_0x279634,{'revision':_0x182c75}),{'verbose':_0x286b16[_0x579529(0x2bb)]}),_0x55f5ec=_0x360e4a[_0x579529(0x244)];return console[_0x579529(0x274)](_0x579529(0x208)+_0x55f5ec[_0x579529(0x2eb)]),console['error'](_0x579529(0x1e0)+_0x55f5ec['revision']),console[_0x579529(0x274)]('\x20\x20Files\x20extracted:\x20'+_0x55f5ec['filesExtracted']),console[_0x579529(0x274)]('\x20\x20Location:\x20'+_0x279634+'/'+_0x55f5ec[_0x579529(0x2eb)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a52_0x5b31a0(0x20a);[a52_0x5b31a0(0x1c2)]=a52_0x5b31a0(0x26e);async['execute'](_0x3f7f80){const _0x4d5fc8=a52_0x5b31a0,{options:_0x2c66c8,args:_0x18fa7f,tdx:_0x4281c6}=_0x3f7f80;let _0x5657fd='.',_0xbaa374=_0x2c66c8[_0x4d5fc8(0x278)];if(_0x18fa7f[0x0]){const {promises:_0x223a41}=await import('fs');try{const _0x3b089e=await _0x223a41[_0x4d5fc8(0x273)](_0x18fa7f[0x0]);if(_0x3b089e[_0x4d5fc8(0x248)]())_0x5657fd=_0x18fa7f[0x0];else return console[_0x4d5fc8(0x274)](_0x4d5fc8(0x223)+_0x18fa7f[0x0]+_0x4d5fc8(0x320)),0x1;}catch{_0xbaa374=_0x18fa7f[0x0],_0x5657fd='.';}}const _0xf507d9=_0x2c66c8[_0x4d5fc8(0x2ee)],_0x33e92d=_0x2c66c8[_0x4d5fc8(0x2e8)];_0x2c66c8['verbose']&&(console['error'](_0x4d5fc8(0x299)+_0x5657fd),_0xbaa374&&console[_0x4d5fc8(0x274)]('Project\x20name:\x20'+_0xbaa374),_0xf507d9&&console[_0x4d5fc8(0x274)](_0x4d5fc8(0x2ce)+_0xf507d9),_0x33e92d&&console[_0x4d5fc8(0x274)](_0x4d5fc8(0x291)));const _0x4fca98=await withSpinner(_0x4d5fc8(0x2db),()=>_0x4281c6['workflow']['push'](_0x5657fd,{'projectName':_0xbaa374,'revision':_0xf507d9,'skipValidation':_0x33e92d}),{'verbose':_0x2c66c8[_0x4d5fc8(0x2bb)]}),_0x4b25e0=_0x4fca98[_0x4d5fc8(0x244)];return console[_0x4d5fc8(0x274)](_0x4d5fc8(0x31d)+_0x4b25e0[_0x4d5fc8(0x2eb)]),console[_0x4d5fc8(0x274)](_0x4d5fc8(0x17b)+_0x4b25e0[_0x4d5fc8(0x31b)]),console[_0x4d5fc8(0x274)](_0x4d5fc8(0x1e0)+_0x4b25e0[_0x4d5fc8(0x2ee)]),await this[_0x4d5fc8(0x266)](_0x4281c6,_0x4b25e0['projectName'],_0x2c66c8[_0x4d5fc8(0x1be)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a52_0x5b31a0(0x278)]=a52_0x5b31a0(0x2e1);[a52_0x5b31a0(0x1c2)]=a52_0x5b31a0(0x203);async[a52_0x5b31a0(0x247)](_0x19c935){const _0x181c75=a52_0x5b31a0,{options:_0x2af4ae,args:_0x504c38,tdx:_0x4e17d9}=_0x19c935,_0x267d1e=_0x504c38[0x0],_0x70ef9c=_0x504c38[0x1];if(!_0x267d1e)return console[_0x181c75(0x274)](a52_0x29459a['red'](_0x181c75(0x2b0)),'Project\x20name\x20is\x20required'),console[_0x181c75(0x274)](a52_0x29459a[_0x181c75(0x230)](_0x181c75(0x1ec))),0x1;const _0x4246bd=_0x2af4ae[_0x181c75(0x2ee)];_0x2af4ae[_0x181c75(0x2bb)]&&(console['error'](_0x181c75(0x171)+_0x267d1e),_0x70ef9c&&console[_0x181c75(0x274)](_0x181c75(0x17a)+_0x70ef9c),_0x4246bd&&console[_0x181c75(0x274)]('Revision:\x20'+_0x4246bd),_0x2af4ae[_0x181c75(0x26f)]&&console[_0x181c75(0x274)](_0x181c75(0x2e5)));const _0xf173e4=await withSpinner(_0x181c75(0x19c)+_0x267d1e+'...',()=>_0x4e17d9[_0x181c75(0x265)][_0x181c75(0x252)](_0x267d1e,{'targetDir':_0x70ef9c,'revision':_0x4246bd}),{'verbose':_0x2af4ae['verbose']}),_0x1fd72d=_0xf173e4[_0x181c75(0x244)];_0x1fd72d['isNewProject']?console[_0x181c75(0x274)](_0x181c75(0x2a2)+_0x1fd72d[_0x181c75(0x2eb)]):console[_0x181c75(0x274)](_0x181c75(0x2f2)+_0x1fd72d[_0x181c75(0x2eb)]);console['error'](_0x181c75(0x1e0)+_0x1fd72d[_0x181c75(0x2ee)]),console[_0x181c75(0x274)](_0x181c75(0x311)+(a52_0x113b0c[_0x181c75(0x310)](process[_0x181c75(0x1a3)](),_0x1fd72d[_0x181c75(0x204)])||'.')),console[_0x181c75(0x274)](_0x181c75(0x181)+a52_0x29459a[_0x181c75(0x232)]('+'+_0x1fd72d['summary']['new']+'\x20new')+',\x20'+(a52_0x29459a[_0x181c75(0x22d)]('~'+_0x1fd72d[_0x181c75(0x2be)][_0x181c75(0x16e)]+_0x181c75(0x2bf))+',\x20')+(a52_0x29459a[_0x181c75(0x1cd)]('-'+_0x1fd72d['summary']['deleted']+'\x20deleted')+',\x20')+(''+a52_0x29459a['dim'](_0x1fd72d[_0x181c75(0x2be)][_0x181c75(0x27f)]+_0x181c75(0x280))));for(const _0x554860 of _0x1fd72d[_0x181c75(0x221)]){_0x554860[_0x181c75(0x2c7)]===_0x181c75(0x16e)&&_0x554860[_0x181c75(0x1d6)]&&(console[_0x181c75(0x274)]('\x0a'+a52_0x29459a[_0x181c75(0x1bc)]('---\x20'+_0x554860[_0x181c75(0x23e)])),console[_0x181c75(0x274)](_0x554860[_0x181c75(0x1d6)]));}if(!_0x1fd72d[_0x181c75(0x2bd)])return saveSessionContext({'workflow_project':_0x1fd72d[_0x181c75(0x2eb)]},_0x2af4ae['session']),console[_0x181c75(0x274)](a52_0x29459a[_0x181c75(0x232)](_0x181c75(0x317))),console[_0x181c75(0x274)](a52_0x29459a[_0x181c75(0x230)](_0x181c75(0x1a2)+_0x1fd72d[_0x181c75(0x2eb)])),0x0;if(_0x2af4ae[_0x181c75(0x26f)])return console[_0x181c75(0x274)](a52_0x29459a[_0x181c75(0x22d)](_0x181c75(0x2a6))),0x0;if(!_0x2af4ae[_0x181c75(0x2a7)]){if(!isInteractive())return console[_0x181c75(0x274)](a52_0x29459a[_0x181c75(0x1cd)](_0x181c75(0x1d2)),_0x181c75(0x258)),console[_0x181c75(0x274)](a52_0x29459a[_0x181c75(0x230)](_0x181c75(0x306))),0x1;const _0x50e217=await confirmKey(_0x181c75(0x18f));if(!_0x50e217)return console['error'](a52_0x29459a['yellow'](_0x181c75(0x194)),_0x181c75(0x300)),0x1;}await withSpinner(_0x181c75(0x2b9),()=>_0x4e17d9['workflow'][_0x181c75(0x281)](_0x1fd72d,{'revision':_0x4246bd}),{'verbose':_0x2af4ae[_0x181c75(0x2bb)]}),saveSessionContext({'workflow_project':_0x1fd72d[_0x181c75(0x2eb)]},_0x2af4ae[_0x181c75(0x1a4)]),console[_0x181c75(0x274)](a52_0x29459a[_0x181c75(0x232)]('✔\x20Pull\x20complete'));const _0xb0a7b8=a52_0x113b0c[_0x181c75(0x310)](process[_0x181c75(0x1a3)](),_0x1fd72d[_0x181c75(0x204)])||'.';return console[_0x181c75(0x274)](a52_0x29459a[_0x181c75(0x230)](_0x181c75(0x188)+_0xb0a7b8)),console[_0x181c75(0x274)](a52_0x29459a[_0x181c75(0x230)](_0x181c75(0x1a2)+_0x1fd72d[_0x181c75(0x2eb)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a52_0x5b31a0(0x278)]=a52_0x5b31a0(0x1e9);[a52_0x5b31a0(0x1c2)]=a52_0x5b31a0(0x250);async[a52_0x5b31a0(0x247)](_0x48abfa){const _0x1c05c0=a52_0x5b31a0,{options:_0x4e53cb,args:_0x1dcb86,tdx:_0x1a66ec}=_0x48abfa,_0x1f4d86=this[_0x1c05c0(0x25b)](_0x1dcb86,_0x4e53cb),_0xe3a5ac=_0x4e53cb[_0x1c05c0(0x2ee)],_0x2762a3=_0x4e53cb[_0x1c05c0(0x2e8)];_0x4e53cb[_0x1c05c0(0x2bb)]&&(_0x1f4d86&&console[_0x1c05c0(0x274)](_0x1c05c0(0x2c1)+_0x1f4d86),_0xe3a5ac&&console[_0x1c05c0(0x274)]('Revision:\x20'+_0xe3a5ac),_0x4e53cb['dryRun']&&console['error'](_0x1c05c0(0x2e5)),_0x2762a3&&console[_0x1c05c0(0x274)](_0x1c05c0(0x291)));let _0x28d8dd;try{_0x28d8dd=await withSpinner('Analyzing\x20changes...',()=>_0x1a66ec[_0x1c05c0(0x265)]['preparePushProject']({'sourceDir':_0x1f4d86,'revision':_0xe3a5ac,'skipValidation':_0x2762a3}),{'verbose':_0x4e53cb[_0x1c05c0(0x2bb)]});}catch(_0x3acc32){if(_0x3acc32 instanceof Error&&_0x3acc32[_0x1c05c0(0x180)][_0x1c05c0(0x270)](_0x1c05c0(0x1c4)))return console[_0x1c05c0(0x274)](a52_0x29459a[_0x1c05c0(0x1cd)](_0x1c05c0(0x2b0)),_0x1c05c0(0x175)),_0x4e53cb[_0x1c05c0(0x1f0)]?console[_0x1c05c0(0x274)](a52_0x29459a[_0x1c05c0(0x230)](_0x1c05c0(0x19d)+_0x4e53cb[_0x1c05c0(0x1f0)]+_0x1c05c0(0x1aa)+_0x4e53cb[_0x1c05c0(0x1f0)]+'\x27')):console['error'](a52_0x29459a[_0x1c05c0(0x230)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x3acc32;}const _0x1c5dbf=_0x28d8dd[_0x1c05c0(0x244)];console[_0x1c05c0(0x274)]('✔\x20Project:\x20'+_0x1c5dbf['projectName']),console[_0x1c05c0(0x274)](_0x1c05c0(0x2b1)+_0x1c5dbf[_0x1c05c0(0x174)]),console[_0x1c05c0(0x274)](_0x1c05c0(0x1e0)+_0x1c5dbf[_0x1c05c0(0x2ee)]),console[_0x1c05c0(0x274)]('\x20\x20Changes:\x20'+a52_0x29459a[_0x1c05c0(0x232)]('+'+_0x1c5dbf['summary'][_0x1c05c0(0x1f3)]+'\x20new')+',\x20'+(a52_0x29459a['yellow']('~'+_0x1c5dbf[_0x1c05c0(0x2be)]['modified']+_0x1c05c0(0x2bf))+',\x20')+(a52_0x29459a[_0x1c05c0(0x1cd)]('-'+_0x1c5dbf['summary'][_0x1c05c0(0x287)]+_0x1c05c0(0x2d4))+',\x20')+(''+a52_0x29459a[_0x1c05c0(0x230)](_0x1c5dbf[_0x1c05c0(0x2be)]['unchanged']+_0x1c05c0(0x280))));for(const _0x1b18a6 of _0x1c5dbf[_0x1c05c0(0x221)]){_0x1b18a6['type']===_0x1c05c0(0x16e)&&_0x1b18a6['diff']&&(console[_0x1c05c0(0x274)]('\x0a'+a52_0x29459a['cyan']('---\x20'+_0x1b18a6['path'])),console[_0x1c05c0(0x274)](_0x1b18a6[_0x1c05c0(0x1d6)]));}if(!_0x1c5dbf[_0x1c05c0(0x2bd)])return console['error'](a52_0x29459a['green']('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x1c05c0(0x266)](_0x1a66ec,_0x1c5dbf[_0x1c05c0(0x2eb)],_0x4e53cb[_0x1c05c0(0x1be)]),0x0;if(_0x4e53cb[_0x1c05c0(0x26f)])return console[_0x1c05c0(0x274)](a52_0x29459a[_0x1c05c0(0x22d)](_0x1c05c0(0x21a))),0x0;if(!_0x4e53cb[_0x1c05c0(0x2a7)]){if(!isInteractive())return console[_0x1c05c0(0x274)](a52_0x29459a[_0x1c05c0(0x1cd)](_0x1c05c0(0x1d2)),_0x1c05c0(0x258)),console['error'](a52_0x29459a[_0x1c05c0(0x230)](_0x1c05c0(0x306))),0x1;const _0x5c0058=await confirmKey(_0x1c05c0(0x233));if(!_0x5c0058)return console[_0x1c05c0(0x274)](a52_0x29459a[_0x1c05c0(0x22d)](_0x1c05c0(0x194)),_0x1c05c0(0x1fd)),0x1;}const _0x9076b7=await withSpinner(_0x1c05c0(0x284),()=>_0x1a66ec['workflow']['executePushProject'](_0x1c5dbf),{'verbose':_0x4e53cb['verbose']}),_0x58fbdc=_0x9076b7[_0x1c05c0(0x244)];return console[_0x1c05c0(0x274)](a52_0x29459a[_0x1c05c0(0x232)](_0x1c05c0(0x23d))),console[_0x1c05c0(0x274)](_0x1c05c0(0x17b)+_0x58fbdc['projectId']),console[_0x1c05c0(0x274)](_0x1c05c0(0x1e0)+_0x58fbdc[_0x1c05c0(0x2ee)]),await this[_0x1c05c0(0x266)](_0x1a66ec,_0x58fbdc[_0x1c05c0(0x2eb)],_0x4e53cb[_0x1c05c0(0x1be)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a52_0x5b31a0(0x278)]=a52_0x5b31a0(0x1b1);[a52_0x5b31a0(0x1c2)]=a52_0x5b31a0(0x1ce);async[a52_0x5b31a0(0x247)](_0x415cac){const _0x36976c=a52_0x5b31a0,{options:_0x5f1ee3,args:_0x5de8bd,tdx:_0x2f86bf}=_0x415cac,_0x2118b3=this[_0x36976c(0x25b)](_0x5de8bd,_0x5f1ee3),_0x2f87a7=_0x5f1ee3['name'],_0x4fdb5f=_0x5f1ee3[_0x36976c(0x2ee)],_0x39b9aa=_0x5f1ee3['skipValidation'];if(!_0x2118b3)return console['error'](a52_0x29459a['red'](_0x36976c(0x2b0)),_0x36976c(0x318)),console[_0x36976c(0x274)](a52_0x29459a['dim'](_0x36976c(0x21e))),console[_0x36976c(0x274)](a52_0x29459a[_0x36976c(0x230)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x2f87a7)return console[_0x36976c(0x274)](a52_0x29459a[_0x36976c(0x1cd)](_0x36976c(0x2b0)),_0x36976c(0x1ea)),console[_0x36976c(0x274)](a52_0x29459a[_0x36976c(0x230)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x5f1ee3[_0x36976c(0x2bb)]&&(console[_0x36976c(0x274)](_0x36976c(0x2c1)+_0x2118b3),console[_0x36976c(0x274)](_0x36976c(0x319)+_0x2f87a7),_0x4fdb5f&&console[_0x36976c(0x274)](_0x36976c(0x2ce)+_0x4fdb5f),_0x5f1ee3[_0x36976c(0x26f)]&&console[_0x36976c(0x274)](_0x36976c(0x2e5)),_0x39b9aa&&console[_0x36976c(0x274)](_0x36976c(0x291)));const _0x42e940=await withSpinner(_0x36976c(0x2cb),()=>_0x2f86bf[_0x36976c(0x265)][_0x36976c(0x2ef)](_0x2118b3,_0x2f87a7,{'revision':_0x4fdb5f,'skipValidation':_0x39b9aa}),{'verbose':_0x5f1ee3['verbose']}),_0x2d00ed=_0x42e940[_0x36976c(0x244)];console[_0x36976c(0x274)](_0x36976c(0x2a0)+_0x2d00ed[_0x36976c(0x174)]);_0x2d00ed[_0x36976c(0x1e4)]&&console[_0x36976c(0x274)](_0x36976c(0x2da)+_0x2d00ed[_0x36976c(0x1e4)]);console[_0x36976c(0x274)](_0x36976c(0x319)+_0x2d00ed['newProjectName']),console[_0x36976c(0x274)](_0x36976c(0x2ce)+_0x2d00ed[_0x36976c(0x2ee)]),console[_0x36976c(0x274)](_0x36976c(0x2f9)+_0x2d00ed[_0x36976c(0x1eb)]);_0x2d00ed['targetExists']&&(console[_0x36976c(0x274)](a52_0x29459a['yellow'](_0x36976c(0x21b)+_0x2d00ed[_0x36976c(0x2f7)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x2d00ed[_0x36976c(0x286)]+')')),console[_0x36976c(0x274)](a52_0x29459a[_0x36976c(0x22d)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x5f1ee3[_0x36976c(0x26f)])return console['error'](a52_0x29459a[_0x36976c(0x22d)](_0x36976c(0x30c))),0x0;if(!_0x5f1ee3[_0x36976c(0x2a7)]){if(!isInteractive())return console[_0x36976c(0x274)](a52_0x29459a['red']('\x0aError:'),_0x36976c(0x258)),console[_0x36976c(0x274)](a52_0x29459a[_0x36976c(0x230)](_0x36976c(0x306))),0x1;const _0x3b31ab=_0x2d00ed[_0x36976c(0x1e4)]||a52_0x113b0c[_0x36976c(0x219)](_0x2118b3),_0x73d22b=_0x2d00ed['targetExists']?_0x36976c(0x2c8)+_0x2f87a7+_0x36976c(0x2ad):_0x36976c(0x2d6)+_0x3b31ab+_0x36976c(0x27e)+_0x2f87a7+'\x22?',_0x578cb1=await confirmKey(_0x73d22b);if(!_0x578cb1)return console[_0x36976c(0x274)](a52_0x29459a[_0x36976c(0x22d)](_0x36976c(0x194))),0x1;}const _0x246670=await withSpinner(_0x2d00ed[_0x36976c(0x23f)]?_0x36976c(0x2ed)+_0x2f87a7+_0x36976c(0x1d9):_0x36976c(0x1e1)+_0x2f87a7+_0x36976c(0x1d9),()=>_0x2f86bf[_0x36976c(0x265)][_0x36976c(0x285)](_0x2d00ed),{'verbose':_0x5f1ee3[_0x36976c(0x2bb)]}),_0x452b45=_0x246670[_0x36976c(0x244)];return console[_0x36976c(0x274)](a52_0x29459a[_0x36976c(0x232)](_0x2d00ed[_0x36976c(0x23f)]?'✔\x20Project\x20updated':_0x36976c(0x172))),console[_0x36976c(0x274)](_0x36976c(0x28c)+_0x452b45['newProjectName']),console[_0x36976c(0x274)](_0x36976c(0x17b)+_0x452b45[_0x36976c(0x2e6)]),console[_0x36976c(0x274)]('\x20\x20Revision:\x20'+_0x452b45['revision']),await this['showWorkflowConsoleUrl'](_0x2f86bf,_0x452b45[_0x36976c(0x2f7)],_0x5f1ee3[_0x36976c(0x1be)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a52_0x5b31a0(0x278)]=a52_0x5b31a0(0x313);[a52_0x5b31a0(0x1c2)]=a52_0x5b31a0(0x257);async[a52_0x5b31a0(0x247)](_0x2cd372){const _0x353fa9=a52_0x5b31a0,{options:_0x373b55,args:_0x2a7de2,tdx:_0x2228e5}=_0x2cd372,_0x2ad26e=_0x2a7de2[0x0];if(!_0x2ad26e)return console[_0x353fa9(0x274)](_0x353fa9(0x195)),console[_0x353fa9(0x274)](_0x353fa9(0x2a1)),0x1;_0x373b55[_0x353fa9(0x2bb)]&&console['error']('Project:\x20'+_0x2ad26e);if(!_0x373b55['yes']){if(!isInteractive())return console[_0x353fa9(0x274)](a52_0x29459a[_0x353fa9(0x1cd)](_0x353fa9(0x1d2)),_0x353fa9(0x258)),console[_0x353fa9(0x274)](a52_0x29459a[_0x353fa9(0x230)](_0x353fa9(0x306))),0x1;const _0x2fdff2=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x2ad26e+_0x353fa9(0x22a));if(!_0x2fdff2)return console['error'](a52_0x29459a[_0x353fa9(0x22d)]('Cancelled')),0x1;}const _0xe378b5=await withSpinner(_0x353fa9(0x2ff)+_0x2ad26e+_0x353fa9(0x1d9),()=>_0x2228e5[_0x353fa9(0x265)]['delete'](_0x2ad26e),{'verbose':_0x373b55['verbose']}),_0x3a01e2=_0xe378b5[_0x353fa9(0x244)];return console[_0x353fa9(0x274)]('✔\x20Deleted\x20project\x20'+_0x3a01e2[_0x353fa9(0x2eb)]),console[_0x353fa9(0x274)](_0x353fa9(0x17b)+_0x3a01e2[_0x353fa9(0x31b)]),0x0;}}export function parseKeyValue(_0x4e8ee0){const _0x18a9b4=a52_0x5b31a0,_0x1579d4=_0x4e8ee0[_0x18a9b4(0x19f)]('=');if(_0x1579d4===-0x1)throw new Error(_0x18a9b4(0x2c2)+_0x4e8ee0+_0x18a9b4(0x275));const _0xfdfdb5=_0x4e8ee0[_0x18a9b4(0x197)](0x0,_0x1579d4),_0x520462=_0x4e8ee0[_0x18a9b4(0x197)](_0x1579d4+0x1);if(!_0xfdfdb5)throw new Error(_0x18a9b4(0x225));return{'key':_0xfdfdb5,'value':_0x520462};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a52_0x5b31a0(0x278)]=a52_0x5b31a0(0x29f);['description']=a52_0x5b31a0(0x2c3);async[a52_0x5b31a0(0x247)](_0x470c2e){const _0x3b40bd=a52_0x5b31a0,{options:_0x5641d8,args:_0x2a2f88,tdx:_0x30af1f}=_0x470c2e,_0x583555=this[_0x3b40bd(0x1ee)](_0x2a2f88,_0x5641d8);if(!_0x583555)return 0x1;_0x5641d8[_0x3b40bd(0x2bb)]&&console[_0x3b40bd(0x274)](_0x3b40bd(0x171)+_0x583555);const _0x39da4d=await withSpinner(_0x3b40bd(0x1f4),()=>_0x30af1f[_0x3b40bd(0x265)]['listSecrets'](_0x583555),{'verbose':_0x5641d8[_0x3b40bd(0x2bb)]}),{secrets:_0x3398fe}=_0x39da4d[_0x3b40bd(0x244)];return console[_0x3b40bd(0x274)](_0x3b40bd(0x327)+_0x3398fe[_0x3b40bd(0x24f)]+'\x20secret'+(_0x3398fe[_0x3b40bd(0x24f)]!==0x1?'s':'')),await handleSDKOutput(_0x3398fe,_0x5641d8),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a52_0x5b31a0(0x278)]=a52_0x5b31a0(0x1c8);[a52_0x5b31a0(0x1c2)]=a52_0x5b31a0(0x1d8);async['execute'](_0x43f5e8){const _0x32ebd1=a52_0x5b31a0,{options:_0x488d06,args:_0x4e0920,tdx:_0xe6a81d}=_0x43f5e8;let _0x2cd1bf,_0x26fd45;if(_0x4e0920[_0x32ebd1(0x24f)]>=0x1&&!_0x4e0920[0x0]['includes']('='))_0x2cd1bf=_0x4e0920[0x0],_0x26fd45=_0x4e0920[_0x32ebd1(0x246)](0x1);else{if(_0x4e0920[_0x32ebd1(0x24f)]>=0x1&&_0x488d06[_0x32ebd1(0x1f0)])_0x2cd1bf=_0x488d06['workflowProject'],_0x26fd45=_0x4e0920;else return _0x4e0920[_0x32ebd1(0x24f)]>=0x1?(console[_0x32ebd1(0x274)](_0x32ebd1(0x224)),console['error']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console['error'](_0x32ebd1(0x312)),console['error'](_0x32ebd1(0x245)),0x1);}if(_0x26fd45['length']===0x0)return console[_0x32ebd1(0x274)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console['error']('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1;const _0x7847eb={};try{for(const _0x15b202 of _0x26fd45){const {key:_0x527efc,value:_0x8bdf5c}=parseKeyValue(_0x15b202);_0x7847eb[_0x527efc]=_0x8bdf5c;}}catch(_0x54da33){return _0x54da33 instanceof Error&&console[_0x32ebd1(0x274)](a52_0x29459a[_0x32ebd1(0x1cd)](_0x32ebd1(0x2b0)),_0x54da33[_0x32ebd1(0x180)]),0x1;}const _0x569cae=Object[_0x32ebd1(0x297)](_0x7847eb);_0x488d06[_0x32ebd1(0x2bb)]&&(console[_0x32ebd1(0x274)](_0x32ebd1(0x171)+_0x2cd1bf),console['error']('Secrets\x20to\x20set:\x20'+_0x569cae['join'](',\x20')));const _0xdcf77b=await withSpinner(_0x569cae[_0x32ebd1(0x24f)]===0x1?_0x32ebd1(0x2ea):_0x32ebd1(0x202)+_0x569cae[_0x32ebd1(0x24f)]+'\x20secrets...',()=>_0xe6a81d['workflow'][_0x32ebd1(0x2e3)](_0x2cd1bf,_0x7847eb),{'verbose':_0x488d06['verbose']}),_0x52a57f=_0xdcf77b[_0x32ebd1(0x244)];return console[_0x32ebd1(0x274)](_0x569cae['length']===0x1?_0x32ebd1(0x1d1)+_0x52a57f[_0x32ebd1(0x297)][0x0]+_0x32ebd1(0x2bc)+_0x52a57f[_0x32ebd1(0x2eb)]+'\x27':'✔\x20'+_0x52a57f[_0x32ebd1(0x297)][_0x32ebd1(0x24f)]+_0x32ebd1(0x1dd)+_0x52a57f[_0x32ebd1(0x2eb)]+'\x27'),(_0x488d06[_0x32ebd1(0x29a)]||_0x488d06[_0x32ebd1(0x20e)])&&await handleSingleObjectOutput(_0x52a57f,_0x488d06),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a52_0x5b31a0(0x278)]=a52_0x5b31a0(0x2e9);['description']=a52_0x5b31a0(0x24c);async[a52_0x5b31a0(0x247)](_0x2f69e0){const _0x51bb1f=a52_0x5b31a0,{options:_0x2573a7,args:_0xd4ea47,tdx:_0x47f73e}=_0x2f69e0;let _0x18a6c7,_0x185444;if(_0xd4ea47[_0x51bb1f(0x24f)]>=0x2)_0x18a6c7=_0xd4ea47[0x0],_0x185444=_0xd4ea47[0x1];else{if(_0xd4ea47[_0x51bb1f(0x24f)]===0x1&&_0x2573a7[_0x51bb1f(0x1f0)])_0x18a6c7=_0x2573a7[_0x51bb1f(0x1f0)],_0x185444=_0xd4ea47[0x0];else return _0xd4ea47[_0x51bb1f(0x24f)]===0x1?(console[_0x51bb1f(0x274)]('Error:\x20Project\x20name\x20is\x20required'),console['error']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x51bb1f(0x274)](_0x51bb1f(0x294)),console[_0x51bb1f(0x274)](_0x51bb1f(0x27a)),0x1);}_0x2573a7['verbose']&&(console[_0x51bb1f(0x274)](_0x51bb1f(0x171)+_0x18a6c7),console[_0x51bb1f(0x274)](_0x51bb1f(0x259)+_0x185444));if(!_0x2573a7['yes']){if(!isInteractive())return console[_0x51bb1f(0x274)](a52_0x29459a[_0x51bb1f(0x1cd)](_0x51bb1f(0x1d2)),_0x51bb1f(0x258)),console[_0x51bb1f(0x274)](a52_0x29459a[_0x51bb1f(0x230)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x496fbd=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x185444+_0x51bb1f(0x31c)+_0x18a6c7+'\x27?');if(!_0x496fbd)return console[_0x51bb1f(0x274)](a52_0x29459a['yellow'](_0x51bb1f(0x194))),0x1;}const _0x4a82ee=await withSpinner(_0x51bb1f(0x292),()=>_0x47f73e[_0x51bb1f(0x265)][_0x51bb1f(0x1ad)](_0x18a6c7,_0x185444),{'verbose':_0x2573a7[_0x51bb1f(0x2bb)]}),_0x529484=_0x4a82ee['data'];return console[_0x51bb1f(0x274)]('✔\x20Secret\x20\x27'+_0x529484[_0x51bb1f(0x191)]+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x529484[_0x51bb1f(0x2eb)]+'\x27'),(_0x2573a7[_0x51bb1f(0x29a)]||_0x2573a7['jsonl'])&&await handleSingleObjectOutput(_0x529484,_0x2573a7),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(_0x1b91c7){const _0xed5777=a52_0x5b31a0,_0x24b047=Math[_0xed5777(0x19e)](_0x1b91c7/0x3e8),_0x8a21a9=Math[_0xed5777(0x19e)](_0x24b047/0x3c),_0xa13ed=Math[_0xed5777(0x19e)](_0x8a21a9/0x3c),_0x5ccc23=Math[_0xed5777(0x19e)](_0xa13ed/0x18);if(_0x5ccc23>0x0){const _0x13fee7=_0xa13ed%0x18;return _0x13fee7>0x0?_0x5ccc23+'d\x20'+_0x13fee7+'h':_0x5ccc23+'d';}else{if(_0xa13ed>0x0){const _0x54f40c=_0x8a21a9%0x3c;return _0x54f40c>0x0?_0xa13ed+'h\x20'+_0x54f40c+'m':_0xa13ed+'h';}else{if(_0x8a21a9>0x0){const _0x77115e=_0x24b047%0x3c;return _0x77115e>0x0?_0x8a21a9+'m\x20'+_0x77115e+'s':_0x8a21a9+'m';}else return _0x24b047+'s';}}}function formatTimestamp(_0x2b2e7c,_0xad7abf){const _0x182b33=a52_0x5b31a0,_0x1a56e5=new Date(_0x2b2e7c),_0x1f2c45=String(_0x1a56e5[_0x182b33(0x1a9)]())[_0x182b33(0x309)](0x2,'0'),_0x4803e4=String(_0x1a56e5[_0x182b33(0x2c6)]())[_0x182b33(0x309)](0x2,'0'),_0x5a172a=_0x1f2c45+':'+_0x4803e4,_0x3f1d04=_0x1a56e5['getFullYear']()===_0xad7abf[_0x182b33(0x1e2)]()&&_0x1a56e5[_0x182b33(0x254)]()===_0xad7abf[_0x182b33(0x254)]()&&_0x1a56e5[_0x182b33(0x228)]()===_0xad7abf[_0x182b33(0x228)]();if(_0x3f1d04)return _0x5a172a;else{const _0x390c37=String(_0x1a56e5[_0x182b33(0x254)]()+0x1)[_0x182b33(0x309)](0x2,'0'),_0x59a2e9=String(_0x1a56e5[_0x182b33(0x228)]())[_0x182b33(0x309)](0x2,'0');return _0x390c37+'-'+_0x59a2e9+'\x20'+_0x5a172a;}}function formatDate(_0x3b9b54){const _0x7ccec7=a52_0x5b31a0,_0x52e5ff=_0x3b9b54[_0x7ccec7(0x1e2)](),_0x407713=String(_0x3b9b54[_0x7ccec7(0x254)]()+0x1)[_0x7ccec7(0x309)](0x2,'0'),_0x2bb404=String(_0x3b9b54[_0x7ccec7(0x228)]())[_0x7ccec7(0x309)](0x2,'0');return _0x52e5ff+'-'+_0x407713+'-'+_0x2bb404;}function getTaskStateIcon(_0x4cdf84){const _0x1c421a={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x1c421a[_0x4cdf84]||'⚪';}function getBarChar(_0x1e9f13){const _0x36b3e3=a52_0x5b31a0;return _0x1e9f13===_0x36b3e3(0x274)||_0x1e9f13===_0x36b3e3(0x2cf)?'×':'─';}function getBarColor(_0x21a3a3){const _0x6fd796=a52_0x5b31a0,_0x21405d={'success':a52_0x29459a[_0x6fd796(0x232)],'error':a52_0x29459a[_0x6fd796(0x1cd)],'group_error':a52_0x29459a[_0x6fd796(0x1cd)],'running':a52_0x29459a['blue'],'blocked':a52_0x29459a['yellow'],'planned':a52_0x29459a['dim'],'canceling':a52_0x29459a[_0x6fd796(0x22d)]};return _0x21405d[_0x21a3a3]||a52_0x29459a[_0x6fd796(0x1da)];}function parseTaskName(_0x3d3768){const _0x477676=a52_0x5b31a0;let _0x502d22=_0x3d3768[_0x477676(0x2dc)](/^\++/,'');const _0x19e715=_0x502d22[_0x477676(0x198)]('+'),_0x5ef62b=_0x19e715[_0x477676(0x24f)]>0x1?_0x19e715[_0x477676(0x24f)]-0x2:0x0,_0x53103b=_0x19e715[_0x19e715[_0x477676(0x24f)]-0x1]||_0x502d22;return{'level':_0x5ef62b,'name':'+'+_0x53103b};}function truncateTaskName(_0x226780,_0x5b8bc6){const _0x4b83a5=a52_0x5b31a0,_0x5f234a=stringWidth(_0x226780);if(_0x5f234a<=_0x5b8bc6)return _0x226780;let _0x2b44ad=_0x226780;while(stringWidth(_0x2b44ad+'…')>_0x5b8bc6&&_0x2b44ad[_0x4b83a5(0x24f)]>0x0){_0x2b44ad=_0x2b44ad[_0x4b83a5(0x246)](0x0,-0x1);}return _0x2b44ad+'…';}function calculateTimeScale(_0x4bf6b1,_0x46655d){const _0x3099b7=a52_0x5b31a0;return{'startTime':_0x4bf6b1[_0x3099b7(0x2e0)],'endTime':_0x4bf6b1[_0x3099b7(0x28b)],'durationMs':_0x4bf6b1['duration'],'msPerChar':_0x4bf6b1[_0x3099b7(0x214)]/_0x46655d};}function timeToPosition(_0x3e8c64,_0x28d0a6,_0x58d1c1){const _0x5395f5=a52_0x5b31a0,_0x48344c=_0x3e8c64-_0x28d0a6[_0x5395f5(0x2fa)],_0x345b0c=Math[_0x5395f5(0x19e)](_0x48344c/_0x28d0a6[_0x5395f5(0x321)]);return Math[_0x5395f5(0x2b3)](0x0,Math[_0x5395f5(0x264)](_0x345b0c,_0x58d1c1));}function renderTimeAxis(_0x71929a,_0x50a0f9){const _0xfe2733=a52_0x5b31a0,_0x4fa4d5=Math[_0xfe2733(0x264)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math['max'](TIMELINE_CONFIG[_0xfe2733(0x322)],Math[_0xfe2733(0x19e)](_0x50a0f9/TIMELINE_CONFIG[_0xfe2733(0x193)]))),_0x284929=_0x71929a[_0xfe2733(0x1dc)]/(_0x4fa4d5-0x1),_0x276648=new Date(_0x71929a[_0xfe2733(0x2fa)]),_0x19ba10=[];for(let _0x33fc26=0x0;_0x33fc26<_0x4fa4d5;_0x33fc26++){const _0xfe2e54=_0x71929a[_0xfe2733(0x2fa)]+_0x33fc26*_0x284929,_0x53dd7d=timeToPosition(_0xfe2e54,_0x71929a,_0x50a0f9),_0x2aad98=formatTimestamp(_0xfe2e54,_0x276648);_0x19ba10['push']({'pos':_0x53dd7d,'text':_0x2aad98});}const _0x2055a5=new Array(_0x50a0f9)[_0xfe2733(0x2d7)]('\x20');let _0x2295ea=-0x1;for(const {pos:_0x437c96,text:_0x4498c9}of _0x19ba10){let _0x27ab7e=Math[_0xfe2733(0x2b3)](0x0,_0x437c96-Math[_0xfe2733(0x19e)](_0x4498c9[_0xfe2733(0x24f)]/0x2));_0x27ab7e<=_0x2295ea+TIMELINE_CONFIG[_0xfe2733(0x2cc)]&&(_0x27ab7e=_0x2295ea+TIMELINE_CONFIG[_0xfe2733(0x2cc)]+0x1);_0x27ab7e+_0x4498c9[_0xfe2733(0x24f)]>_0x50a0f9&&(_0x27ab7e=_0x50a0f9-_0x4498c9[_0xfe2733(0x24f)]);if(_0x27ab7e>=0x0&&_0x27ab7e+_0x4498c9['length']<=_0x50a0f9&&_0x27ab7e>_0x2295ea){for(let _0x1066df=0x0;_0x1066df<_0x4498c9[_0xfe2733(0x24f)];_0x1066df++){_0x2055a5[_0x27ab7e+_0x1066df]=_0x4498c9[_0x1066df];}_0x2295ea=_0x27ab7e+_0x4498c9[_0xfe2733(0x24f)]-0x1;}}return _0x2055a5['join']('');}function renderTaskRow(_0x4b477f,_0x4a8ba9,_0x2cc5b1,_0x27e372){const _0x7ee11f=a52_0x5b31a0,{level:_0x1c9568,name:_0x3b0d13}=parseTaskName(_0x4b477f[_0x7ee11f(0x278)]),_0x3a7da4='\x20'[_0x7ee11f(0x31a)](_0x1c9568),_0x3123da=_0x4b477f[_0x7ee11f(0x30a)]?'('+formatElapsed(_0x4b477f['window'][_0x7ee11f(0x214)])+')':'',_0x4fefa2=stringWidth(_0x3123da),_0x268334=_0x1c9568*0x1,_0x226f8e=_0x27e372-_0x268334-_0x4fefa2-0x1,_0x819227=truncateTaskName(_0x3b0d13,_0x226f8e),_0x146423=_0x3a7da4+_0x819227,_0x18496e=stringWidth(_0x146423),_0x4f8cc2=_0x27e372-_0x18496e-_0x4fefa2,_0x4b7f71=_0x146423+'\x20'[_0x7ee11f(0x31a)](Math[_0x7ee11f(0x2b3)](0x1,_0x4f8cc2))+a52_0x29459a['dim'](_0x3123da),_0xb613d2=getTaskStateIcon(_0x4b477f[_0x7ee11f(0x30e)]),_0x3fb0d0=new Array(_0x2cc5b1)['fill']('\x20');if(_0x4b477f['window']){const _0x560219=timeToPosition(_0x4b477f[_0x7ee11f(0x30a)][_0x7ee11f(0x2e0)],_0x4a8ba9,_0x2cc5b1),_0x31dacd=timeToPosition(_0x4b477f[_0x7ee11f(0x30a)][_0x7ee11f(0x28b)],_0x4a8ba9,_0x2cc5b1),_0x514f99=getBarChar(_0x4b477f[_0x7ee11f(0x30e)]),_0x473481=Math['max'](_0x560219+0x1,_0x31dacd);for(let _0x2be8ea=_0x560219;_0x2be8ea<Math['min'](_0x473481,_0x2cc5b1);_0x2be8ea++){_0x3fb0d0[_0x2be8ea]=_0x514f99;}}const _0x2df848=getBarColor(_0x4b477f[_0x7ee11f(0x30e)]),_0x28ea52=_0x3fb0d0['map'](_0x4b61ed=>_0x4b61ed==='\x20'?'\x20':_0x2df848(_0x4b61ed))[_0x7ee11f(0x241)]('');return _0xb613d2+'\x20'+_0x4b7f71+'│'+_0x28ea52+'│';}function calculateStats(_0x442f45){const _0x5adc67=a52_0x5b31a0,_0x223c00={'total':_0x442f45[_0x5adc67(0x24f)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x2d296d of _0x442f45){if(_0x2d296d['state']===_0x5adc67(0x2c0))_0x223c00['success']++;else{if(_0x2d296d[_0x5adc67(0x30e)]===_0x5adc67(0x274)||_0x2d296d[_0x5adc67(0x30e)]===_0x5adc67(0x2cf))_0x223c00[_0x5adc67(0x274)]++;else _0x2d296d[_0x5adc67(0x30e)]===_0x5adc67(0x1a8)?_0x223c00[_0x5adc67(0x1a8)]++:_0x223c00[_0x5adc67(0x2a3)]++;}}return _0x223c00;}function formatStats(_0x5b8505){const _0x1910c6=a52_0x5b31a0;return[_0x1910c6(0x2b8)+_0x5b8505[_0x1910c6(0x205)],'✅\x20'+_0x5b8505[_0x1910c6(0x2c0)],'❌\x20'+_0x5b8505[_0x1910c6(0x274)],_0x1910c6(0x1c9)+_0x5b8505['running'],'⏳\x20'+_0x5b8505[_0x1910c6(0x2a3)]][_0x1910c6(0x241)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a52_0x5b31a0(0x278)]=a52_0x5b31a0(0x19b);[a52_0x5b31a0(0x1c2)]=a52_0x5b31a0(0x2a4);async[a52_0x5b31a0(0x247)](_0x66f137){const _0x40b81e=a52_0x5b31a0,{options:_0x3941d8,args:_0x119f81,tdx:_0x2e7cd0}=_0x66f137;let _0xcb265d,_0x42bece,_0x366099=![];if(_0x119f81[0x0]){if(_0x119f81[0x0][_0x40b81e(0x270)]('.')){const _0x15726d=this[_0x40b81e(0x1b5)](_0x119f81,_0x3941d8);if(!_0x15726d)return 0x1;_0xcb265d=_0x15726d[_0x40b81e(0x2eb)],_0x42bece=_0x15726d[_0x40b81e(0x22f)];}else{_0x42bece=_0x119f81[0x0],_0xcb265d=_0x3941d8[_0x40b81e(0x1f0)];if(!_0xcb265d)return console[_0x40b81e(0x274)](a52_0x29459a[_0x40b81e(0x1cd)]('Error:'),_0x40b81e(0x2b5)),0x1;_0x366099=!![];}}else{const _0x2e518e=this[_0x40b81e(0x1b5)](_0x119f81,_0x3941d8);if(!_0x2e518e)return 0x1;_0xcb265d=_0x2e518e[_0x40b81e(0x2eb)],_0x42bece=_0x2e518e[_0x40b81e(0x22f)];}if(_0x3941d8[_0x40b81e(0x2bb)]){if(_0xcb265d&&_0x42bece)console[_0x40b81e(0x274)](_0x40b81e(0x23c)+_0xcb265d+'.'+_0x42bece);else _0xcb265d&&console[_0x40b81e(0x274)](_0x40b81e(0x2c5)+_0xcb265d);}const _0x2a4c4d=_0x3941d8[_0x40b81e(0x1f2)],_0x318774=_0x3941d8[_0x40b81e(0x316)];if(_0x2a4c4d){_0x318774&&console[_0x40b81e(0x274)](a52_0x29459a[_0x40b81e(0x22d)](_0x40b81e(0x234)),_0x40b81e(0x213));const _0x365da2=_0x3941d8[_0x40b81e(0x298)];return _0x365da2?await this['pollTimeline'](_0x66f137,_0x2a4c4d):await this[_0x40b81e(0x2d8)](_0x66f137,_0x2a4c4d,_0x3941d8),0x0;}if(_0x318774){const _0x522f34=await withSpinner(_0x40b81e(0x1f1),()=>_0x2e7cd0['workflow'][_0x40b81e(0x20d)]({'projectName':_0xcb265d,'workflowName':_0x42bece,'limit':0x64}),{'verbose':_0x3941d8['verbose']}),_0x23c188=_0x522f34[_0x40b81e(0x244)][_0x40b81e(0x279)](_0x244366=>_0x244366['id']===_0x318774);if(!_0x23c188)return console[_0x40b81e(0x274)](a52_0x29459a[_0x40b81e(0x1cd)]('Error:'),_0x40b81e(0x189)+_0x318774),0x1;if(!_0x23c188[_0x40b81e(0x20f)]?.['id'])return console[_0x40b81e(0x274)](a52_0x29459a[_0x40b81e(0x1cd)]('Error:'),'Session\x20'+_0x318774+'\x20has\x20no\x20attempts'),0x1;const _0x3b3185=_0x23c188[_0x40b81e(0x20f)]['id'];_0x3941d8[_0x40b81e(0x2bb)]&&console['error']('Using\x20attempt\x20'+_0x3b3185+'\x20from\x20session\x20'+_0x318774);const _0x1a07c2=_0x3941d8[_0x40b81e(0x298)];return _0x1a07c2?await this[_0x40b81e(0x261)](_0x66f137,_0x3b3185):await this[_0x40b81e(0x2d8)](_0x66f137,_0x3b3185,_0x3941d8),0x0;}const _0x183948=await withSpinner(_0x40b81e(0x249),()=>_0x2e7cd0[_0x40b81e(0x265)]['sessions']({'projectName':_0xcb265d,'workflowName':_0x42bece,'limit':_0x3941d8['limit']||0x32}),{'verbose':_0x3941d8[_0x40b81e(0x2bb)]}),_0x2352d1=_0x183948[_0x40b81e(0x244)];if(_0x2352d1['length']===0x0){if(_0xcb265d&&_0x42bece)console[_0x40b81e(0x274)](_0x40b81e(0x211)+_0xcb265d+'.'+_0x42bece);else _0xcb265d?console['error'](_0x40b81e(0x27d)+_0xcb265d):(console[_0x40b81e(0x274)](_0x40b81e(0x302)),console[_0x40b81e(0x274)](a52_0x29459a['dim'](_0x40b81e(0x24d))));return 0x0;}_0x2352d1['sort']((_0x4192e8,_0x5048ea)=>{const _0x65c04f=_0x40b81e,_0x18e95b=_0x4192e8[_0x65c04f(0x29d)]||'',_0x78e14d=_0x5048ea[_0x65c04f(0x29d)]||'';return _0x78e14d[_0x65c04f(0x184)](_0x18e95b);});if(_0x3941d8['json']||_0x3941d8[_0x40b81e(0x20e)])return await handleSDKOutput(_0x2352d1,_0x3941d8),0x0;let _0x215c45;if(_0x366099){const _0x32d7f4=_0x2352d1[0x0];if(!_0x32d7f4[_0x40b81e(0x20f)]?.['id'])return console[_0x40b81e(0x274)](_0x40b81e(0x2e2)),0x0;_0x215c45=_0x32d7f4[_0x40b81e(0x20f)]['id'],_0x3941d8[_0x40b81e(0x2bb)]&&console[_0x40b81e(0x274)](_0x40b81e(0x26c)+_0x32d7f4['sessionTime']);}else{const _0x3a68b2=_0x2352d1[_0x40b81e(0x2aa)](_0x80c793=>{const _0x2dfb00=_0x40b81e,_0x2580cb=getAttemptStatusDisplay(_0x80c793[_0x2dfb00(0x20f)]);return{'title':_0x80c793[_0x2dfb00(0x222)]?.[_0x2dfb00(0x278)]+'.'+_0x80c793[_0x2dfb00(0x265)]?.[_0x2dfb00(0x278)]+_0x2dfb00(0x1f7)+_0x80c793[_0x2dfb00(0x29d)]+'\x20'+_0x2580cb[_0x2dfb00(0x307)],'value':_0x80c793[_0x2dfb00(0x20f)]?.['id']||'','description':_0x2580cb['text']};}),_0x16830b=await a52_0x2378a5({'type':_0x40b81e(0x1db),'name':_0x40b81e(0x1f2),'message':_0x40b81e(0x1ba),'choices':_0x3a68b2['filter'](_0x3c5dfe=>_0x3c5dfe[_0x40b81e(0x1d7)]!=='')});if(!_0x16830b[_0x40b81e(0x1f2)])return 0x0;_0x215c45=_0x16830b[_0x40b81e(0x1f2)];}const _0x3ee21e=_0x3941d8['follow'];return _0x3ee21e?await this[_0x40b81e(0x261)](_0x66f137,_0x215c45):await this[_0x40b81e(0x2d8)](_0x66f137,_0x215c45,_0x3941d8),0x0;}async[a52_0x5b31a0(0x2d8)](_0x409c31,_0x12483d,_0x1069e9){const _0x1a7a73=a52_0x5b31a0,{tdx:_0x24404a}=_0x409c31;let _0x1ef813,_0x4b8d9b;try{[_0x1ef813,_0x4b8d9b]=await Promise['all']([_0x24404a[_0x1a7a73(0x265)][_0x1a7a73(0x238)](_0x12483d),_0x24404a[_0x1a7a73(0x265)][_0x1a7a73(0x1fb)](_0x12483d,![])]);}catch(_0x3d9558){console['error'](a52_0x29459a['red'](_0x1a7a73(0x173)));_0x1069e9[_0x1a7a73(0x2bb)]&&console['error'](_0x3d9558);throw _0x3d9558;}if(_0x1069e9['json']||_0x1069e9[_0x1a7a73(0x20e)]){const _0x11e0ea=this['buildTimelineData'](_0x1ef813,_0x4b8d9b);await handleSDKOutput([_0x11e0ea],_0x1069e9);return;}const _0x1bfd44=_0x24404a[_0x1a7a73(0x1b9)]['site'],_0x34c638=this[_0x1a7a73(0x272)](_0x1ef813,_0x4b8d9b,_0x1bfd44);console[_0x1a7a73(0x201)](_0x34c638);}async[a52_0x5b31a0(0x261)](_0x18f35d,_0x4db713){const _0x438adb=a52_0x5b31a0,{tdx:_0x5bab9e}=_0x18f35d,_0x5b59df=TIMELINE_CONFIG[_0x438adb(0x263)],_0x3e11d5=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x1aaf0=0x0;while(_0x1aaf0<_0x3e11d5){process['stdout']['isTTY']&&process[_0x438adb(0x236)][_0x438adb(0x22c)]('\x1bc');let _0x3b754a,_0x333861;try{[_0x3b754a,_0x333861]=await Promise['all']([_0x5bab9e['workflow']['attempt'](_0x4db713),_0x5bab9e[_0x438adb(0x265)][_0x438adb(0x1fb)](_0x4db713,![])]);}catch(_0x5b907d){console[_0x438adb(0x274)](a52_0x29459a[_0x438adb(0x1cd)](_0x438adb(0x242)));_0x1aaf0>0x0&&console['error'](a52_0x29459a[_0x438adb(0x230)](_0x438adb(0x293)+_0x1aaf0));throw _0x5b907d;}const _0x277c81=_0x5bab9e[_0x438adb(0x1b9)][_0x438adb(0x1be)],_0x461dad=this[_0x438adb(0x272)](_0x3b754a,_0x333861,_0x277c81);console['log'](_0x461dad);const _0xab5c69=_0x3b754a[_0x438adb(0x24b)]&&_0x333861['every'](_0x160737=>_0x160737[_0x438adb(0x30e)]!==_0x438adb(0x1a8)&&_0x160737[_0x438adb(0x30e)]!==_0x438adb(0x256));if(_0xab5c69){console[_0x438adb(0x274)](a52_0x29459a[_0x438adb(0x232)](_0x438adb(0x1d4)));break;}console[_0x438adb(0x274)](a52_0x29459a[_0x438adb(0x230)]('\x0aPolling...\x20('+_0x1aaf0*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x1a0e4e=>setTimeout(_0x1a0e4e,_0x5b59df)),_0x1aaf0++;}_0x1aaf0>=_0x3e11d5&&console[_0x438adb(0x274)](a52_0x29459a[_0x438adb(0x22d)](_0x438adb(0x295)));}[a52_0x5b31a0(0x272)](_0x56a4b7,_0x4a93b2,_0x5057b9){const _0x4c9488=a52_0x5b31a0,_0x24b7cb=[],_0x2013c1=TIMELINE_CONFIG[_0x4c9488(0x315)],_0xf688c8=0x5,_0x1346e2=process[_0x4c9488(0x236)][_0x4c9488(0x2fe)]||0x78,_0x5b8f8c=_0x1346e2-_0x2013c1-_0xf688c8,_0x189cda=Math[_0x4c9488(0x2b3)](TIMELINE_CONFIG[_0x4c9488(0x186)],Math[_0x4c9488(0x264)](_0x5b8f8c,TIMELINE_CONFIG[_0x4c9488(0x2c4)])),_0xc2da42=new Date(_0x56a4b7[_0x4c9488(0x21c)])[_0x4c9488(0x2f5)](),_0x8075d0=_0x56a4b7[_0x4c9488(0x304)]?new Date(_0x56a4b7['finishedAt'])['getTime']():Date[_0x4c9488(0x2f0)](),_0x2e3aa0={'start':_0xc2da42,'end':_0x8075d0,'duration':_0x8075d0-_0xc2da42},_0xb907f1=new Map(),_0x46011e=[];for(const _0x3c0946 of _0x4a93b2){if(_0x3c0946[_0x4c9488(0x170)]){const _0x5b8c76=new Date(_0x3c0946[_0x4c9488(0x170)])['getTime'](),_0x291a15=_0x3c0946[_0x4c9488(0x1c0)]?new Date(_0x3c0946[_0x4c9488(0x1c0)])[_0x4c9488(0x2f5)]():Date['now'](),_0x140582={'start':_0x5b8c76,'end':_0x291a15,'duration':_0x291a15-_0x5b8c76};_0xb907f1[_0x4c9488(0x22b)](_0x3c0946['id'],_0x140582),_0x46011e[_0x4c9488(0x1cf)]({'name':_0x3c0946[_0x4c9488(0x1e6)],'state':_0x3c0946[_0x4c9488(0x30e)]||_0x4c9488(0x23b),'window':_0x140582});}else _0x46011e[_0x4c9488(0x1cf)]({'name':_0x3c0946['fullName'],'state':_0x3c0946[_0x4c9488(0x30e)]||_0x4c9488(0x256),'window':undefined});}_0x46011e[_0x4c9488(0x251)]((_0x36be7b,_0x5247be)=>{const _0x13408d=_0x4c9488;if(!_0x36be7b[_0x13408d(0x30a)])return 0x1;if(!_0x5247be[_0x13408d(0x30a)])return-0x1;return _0x36be7b[_0x13408d(0x30a)][_0x13408d(0x2e0)]-_0x5247be[_0x13408d(0x30a)]['start'];});const _0x57e73a=_0x46011e[_0x4c9488(0x24f)],_0x116005=_0x57e73a>TIMELINE_CONFIG[_0x4c9488(0x187)];_0x116005&&_0x46011e[_0x4c9488(0x2f8)](TIMELINE_CONFIG[_0x4c9488(0x187)]);const _0x43557a=calculateTimeScale(_0x2e3aa0,_0x189cda),_0x3eac11=_0x56a4b7[_0x4c9488(0x24b)]?_0x56a4b7[_0x4c9488(0x2c0)]?a52_0x29459a[_0x4c9488(0x232)](_0x4c9488(0x2c0)):a52_0x29459a[_0x4c9488(0x1cd)](_0x4c9488(0x274)):a52_0x29459a[_0x4c9488(0x2f6)]('running'),_0x5adb1f=_0x56a4b7['project']?.['id'],_0xa210f6=_0x56a4b7[_0x4c9488(0x316)];let _0x1ad24a;if(_0x5adb1f&&_0xa210f6){const _0x495fd4=getWorkflowAttemptUrl(_0x5057b9,_0x5adb1f,_0xa210f6,_0x56a4b7['id']);_0x1ad24a=hyperlink(a52_0x29459a[_0x4c9488(0x230)](_0x56a4b7['id']),_0x495fd4);}else _0x1ad24a=a52_0x29459a[_0x4c9488(0x230)](_0x56a4b7['id']);_0x24b7cb['push'](_0x4c9488(0x260)+_0x1ad24a+'\x20-\x20'+_0x3eac11+_0x4c9488(0x1f7)+formatElapsed(_0x2e3aa0[_0x4c9488(0x214)]));if(_0x46011e['length']>0x0){const _0x4b6435=renderTimeAxis(_0x43557a,_0x189cda),_0x5413ad=new Date(_0x2e3aa0[_0x4c9488(0x2e0)]),_0x557311=formatDate(_0x5413ad),_0x1ba6c2=TIMELINE_CONFIG[_0x4c9488(0x1d0)]+TIMELINE_CONFIG['ICON_SPACING']+_0x2013c1,_0x1020c8=_0x557311[_0x4c9488(0x309)](_0x1ba6c2),_0x358423=a52_0x29459a['dim'](_0x1020c8);_0x24b7cb['push'](_0x358423+'\x20'+_0x4b6435);for(const _0x472626 of _0x46011e){_0x24b7cb[_0x4c9488(0x1cf)](renderTaskRow(_0x472626,_0x43557a,_0x189cda,_0x2013c1));}const _0x5b5cbf=calculateStats(_0x46011e);_0x24b7cb[_0x4c9488(0x1cf)](formatStats(_0x5b5cbf)),_0x116005&&_0x24b7cb[_0x4c9488(0x1cf)](a52_0x29459a[_0x4c9488(0x22d)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0x4c9488(0x187)]+_0x4c9488(0x207)+_0x57e73a+_0x4c9488(0x18e))),_0x24b7cb[_0x4c9488(0x1cf)](''),_0x24b7cb[_0x4c9488(0x1cf)](a52_0x29459a['dim'](_0x4c9488(0x1de))+('tdx\x20wf\x20attempt\x20'+_0x56a4b7['id']+_0x4c9488(0x1fc))+a52_0x29459a[_0x4c9488(0x230)](_0x4c9488(0x2fc)));}else _0x24b7cb[_0x4c9488(0x1cf)](_0x4c9488(0x2ec));return _0x24b7cb[_0x4c9488(0x241)]('\x0a');}[a52_0x5b31a0(0x283)](_0x5042ff,_0x5b820f){const _0x1616e6=a52_0x5b31a0,_0x4c477a=new Date(_0x5042ff[_0x1616e6(0x21c)])[_0x1616e6(0x2f5)](),_0x44a207=_0x5042ff[_0x1616e6(0x304)]?new Date(_0x5042ff[_0x1616e6(0x304)])[_0x1616e6(0x2f5)]():Date[_0x1616e6(0x2f0)](),_0x57cce6=_0x44a207-_0x4c477a,_0x4a3a12=[];for(const _0x31289e of _0x5b820f){if(_0x31289e[_0x1616e6(0x170)]){const _0x17c6fc=new Date(_0x31289e[_0x1616e6(0x170)])[_0x1616e6(0x2f5)](),_0x28ff5e=_0x31289e[_0x1616e6(0x1c0)]?new Date(_0x31289e[_0x1616e6(0x1c0)])[_0x1616e6(0x2f5)]():Date[_0x1616e6(0x2f0)]();_0x4a3a12[_0x1616e6(0x1cf)]({'name':_0x31289e[_0x1616e6(0x1e6)],'state':_0x31289e['state']||_0x1616e6(0x23b),'window':{'start':_0x17c6fc,'end':_0x28ff5e,'duration':_0x28ff5e-_0x17c6fc}});}else _0x4a3a12[_0x1616e6(0x1cf)]({'name':_0x31289e[_0x1616e6(0x1e6)],'state':_0x31289e[_0x1616e6(0x30e)]||_0x1616e6(0x256),'window':undefined});}const _0xfad22c=calculateStats(_0x4a3a12);return{'attempt':{'id':_0x5042ff['id'],'status':_0x5042ff[_0x1616e6(0x24b)]?_0x5042ff['success']?_0x1616e6(0x2c0):'error':_0x1616e6(0x1a8),'createdAt':_0x5042ff[_0x1616e6(0x21c)],'finishedAt':_0x5042ff['finishedAt'],'duration_ms':_0x57cce6},'tasks':_0x4a3a12[_0x1616e6(0x2aa)](_0xeb0361=>({'name':_0xeb0361['name'],'state':_0xeb0361['state'],'startedAt':_0xeb0361['window']?new Date(_0xeb0361[_0x1616e6(0x30a)][_0x1616e6(0x2e0)])[_0x1616e6(0x182)]():null,'updatedAt':_0xeb0361[_0x1616e6(0x30a)]?new Date(_0xeb0361['window'][_0x1616e6(0x28b)])[_0x1616e6(0x182)]():null,'duration_ms':_0xeb0361[_0x1616e6(0x30a)]?.['duration']||null})),'stats':_0xfad22c};}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x217949,_0x4d34b5){const _0x5aa95b=a53_0x4a79,_0x10feae=_0x217949();while(!![]){try{const _0x1f2d1a=-parseInt(_0x5aa95b(0xe2))/0x1+parseInt(_0x5aa95b(0xe9))/0x2*(-parseInt(_0x5aa95b(0xe6))/0x3)+-parseInt(_0x5aa95b(0xf3))/0x4*(parseInt(_0x5aa95b(0xf2))/0x5)+parseInt(_0x5aa95b(0xeb))/0x6*(parseInt(_0x5aa95b(0xee))/0x7)+parseInt(_0x5aa95b(0xf4))/0x8+-parseInt(_0x5aa95b(0xe7))/0x9+parseInt(_0x5aa95b(0xf1))/0xa*(parseInt(_0x5aa95b(0xe3))/0xb);if(_0x1f2d1a===_0x4d34b5)break;else _0x10feae['push'](_0x10feae['shift']());}catch(_0x154a1e){_0x10feae['push'](_0x10feae['shift']());}}}(a53_0x5aa7,0xa3900));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x3d977d=a53_0x4a79,_0xff19ad=getVersion(),_0x2d97f5=platform(),_0x2815c6=process['version'][_0x3d977d(0xed)]('v','');return _0x3d977d(0xec)+_0xff19ad+'\x20('+_0x2d97f5+_0x3d977d(0xe8)+_0x2815c6+')';}export function getAuthHeaders(_0x259525,_0x4572a0,_0x4568fd){const _0x3612f4=a53_0x4a79,_0x543a77=getVersion(),_0x15dbe2={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x543a77};if(_0x4568fd)_0x15dbe2[_0x3612f4(0xf0)]='Bearer\x20'+_0x4568fd;else _0x4572a0&&(_0x15dbe2[_0x3612f4(0xf0)]=_0x3612f4(0xe4)+_0x4572a0);return _0x15dbe2;}function a53_0x4a79(_0xaede3,_0x57769f){_0xaede3=_0xaede3-0xe2;const _0x5aa7f6=a53_0x5aa7();let _0x4a7975=_0x5aa7f6[_0xaede3];return _0x4a7975;}export function toHeaderRecord(_0x74cf88){const _0x1bf6f=a53_0x4a79,_0x17c780={};for(const [_0x4edf22,_0x54c67c]of Object[_0x1bf6f(0xe5)](_0x74cf88)){_0x54c67c!==undefined&&(_0x17c780[_0x4edf22]=_0x54c67c);}return _0x17c780;}export function getTrinoHeaders(_0x37fbaa,_0x3bc81b,_0x28e2bc){const _0x9c852d=a53_0x4a79,_0x24a942=getAuthHeaders(_0x37fbaa),_0x10635e=toHeaderRecord(_0x24a942);if(_0x28e2bc)_0x10635e[_0x9c852d(0xf0)]=_0x9c852d(0xea)+_0x28e2bc;else _0x3bc81b&&(_0x10635e['X-Trino-User']=_0x3bc81b);return _0x10635e;}export function hasAPIKey(_0x4affb1){const _0x3f427c=a53_0x4a79,_0x4f8224=getAPIKey();return _0x4f8224!==undefined&&_0x4f8224[_0x3f427c(0xef)]>0x0;}function a53_0x5aa7(){const _0x5695e4=['TD1\x20','entries','327WUoPNs','3617937jmGgiS',';\x20node/','172BfNLNk','Bearer\x20','4263984yynSpD','tdx/','replace','7JhXDRj','length','Authorization','30NGRYdf','213935nkhyiG','124VXoOUk','895664ARxPxV','724513LmWUGk','8468559bKjfgg'];a53_0x5aa7=function(){return _0x5695e4;};return a53_0x5aa7();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x44f65f,_0xe75728){const _0x2e3210=a53_0x5ef9,_0x233248=_0x44f65f();while(!![]){try{const _0x418919=-parseInt(_0x2e3210(0x1bb))/0x1+parseInt(_0x2e3210(0x1c3))/0x2+-parseInt(_0x2e3210(0x197))/0x3*(-parseInt(_0x2e3210(0x1a0))/0x4)+parseInt(_0x2e3210(0x1bf))/0x5*(-parseInt(_0x2e3210(0x188))/0x6)+parseInt(_0x2e3210(0x18e))/0x7*(-parseInt(_0x2e3210(0x193))/0x8)+-parseInt(_0x2e3210(0x19a))/0x9*(-parseInt(_0x2e3210(0x196))/0xa)+parseInt(_0x2e3210(0x19c))/0xb;if(_0x418919===_0xe75728)break;else _0x233248['push'](_0x233248['shift']());}catch(_0x29f9c8){_0x233248['push'](_0x233248['shift']());}}}(a53_0x1d70,0x48722));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_0x187921 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x1cc55c){const _0x156f42=a53_0x5ef9;return _0x1cc55c[_0x156f42(0x1c1)]==='json'||_0x1cc55c[_0x156f42(0x1c1)]===_0x156f42(0x1a2)||_0x1cc55c[_0x156f42(0x1c1)]===_0x156f42(0x195)||_0x1cc55c['format']==='table'||_0x1cc55c[_0x156f42(0x194)]===!![]||_0x1cc55c[_0x156f42(0x1a2)]===!![]||_0x1cc55c[_0x156f42(0x195)]===!![]||_0x1cc55c[_0x156f42(0x1be)]===!![];}function a53_0x1d70(){const _0x3ae2d5=['error','length','push','limit','resolve','[error]','inherit','[rule]','object','─┴─','152671SEMZyN','limitStructuredFormats','repeat','table','415ttBhmz','spawn','format','No\x20data','890934YOfdmK','close','params','cyan','bigint','blue','trim','list','bold','pipe','cmdout','end','filter','write','less','noColor','14604GzntGw','FINISHED','rule','max','number','-FXRSn','112cCRCJk','varchar','split','padEnd','map','176744UZNTSc','json','tsv','17300iDNAZY','3PYoqUF','red','join','711cXjSPz','debug','1338359BmmDqz','stdin','stringify','forEach','1204452SqOdfc','color','jsonl','log','boolean','[logs]','entries','data','isInteger','query','keys','isFinite','stderr','output','string','Results\x20saved\x20to\x20','[query]'];a53_0x1d70=function(){return _0x3ae2d5;};return a53_0x1d70();}export function parseOutputOptions(_0x472f8b){const _0x4f5f1c=a53_0x5ef9;return{'format':_0x472f8b[_0x4f5f1c(0x1c1)]||'table','output':_0x472f8b['output']||'','limit':_0x472f8b[_0x4f5f1c(0x1b4)],'limitStructuredFormats':_0x472f8b[_0x4f5f1c(0x1bc)],'color':_0x472f8b[_0x4f5f1c(0x1a1)],'noColor':_0x472f8b[_0x4f5f1c(0x187)]};}function convertSDKResultToQueryResult(_0x30f7fa){const _0x51534d=a53_0x5ef9,_0xb1ecd6=[];if(_0x30f7fa[_0x51534d(0x1b2)]>0x0){const _0x1044d6=_0x30f7fa[0x0];for(const [_0x36a06b,_0x39fe73]of Object[_0x51534d(0x1a6)](_0x1044d6)){let _0x47698d=_0x51534d(0x18f);if(typeof _0x39fe73===_0x51534d(0x18c))_0x47698d=Number[_0x51534d(0x1a8)](_0x39fe73)?_0x51534d(0x1c7):'double';else{if(typeof _0x39fe73==='boolean')_0x47698d=_0x51534d(0x1a4);else _0x39fe73===null&&(_0x47698d='varchar');}_0xb1ecd6[_0x51534d(0x1b3)]({'name':_0x36a06b,'type':_0x47698d});}}return{'queryId':'sdk-result','columns':_0xb1ecd6,'data':_0x30f7fa,'stats':{'state':_0x51534d(0x189),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x30f7fa[_0x51534d(0x1b2)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x193f05,_0xabd7e4){const _0x44a09a=convertSDKResultToQueryResult(_0x193f05);return formatQueryOutput(_0x44a09a,_0xabd7e4);}export async function formatQueryOutput(_0x337db1,_0x15b64d){const _0x18af89=a53_0x5ef9,{format:_0x1e2fab,limit:_0x221370,output:_0x2e523e,color:_0x22de72,noColor:_0x3f7673,limitStructuredFormats:_0x28ab22}=_0x15b64d,_0xe68817=Boolean(_0x2e523e)&&!_0x22de72,_0x289016={'color':_0x22de72,'noColor':_0x3f7673||_0xe68817};if(_0x1e2fab===_0x18af89(0x1be)){const _0x4a2205=shouldUseLess(_0x1e2fab,_0x2e523e);return formatAsTable(_0x337db1,_0x221370,_0x4a2205,_0x289016);}const _0x28d30e=_0x28ab22&&Number[_0x18af89(0x1ab)](_0x221370)&&_0x337db1[_0x18af89(0x1a7)]['length']>_0x221370?{..._0x337db1,'data':_0x337db1[_0x18af89(0x1a7)]['slice'](0x0,_0x221370)}:_0x337db1;if(_0x1e2fab===_0x18af89(0x194))return formatAsJSON(_0x28d30e,_0x289016);else return _0x1e2fab==='jsonl'?formatAsJSONL(_0x28d30e,_0x289016):formatQueryResult(_0x28d30e,_0x1e2fab);}function shouldUseLess(_0x18d216,_0x3c183d){const _0x422c8b=a53_0x5ef9;return(_0x18d216===_0x422c8b(0x1be)||_0x18d216===_0x422c8b(0x1ca))&&process['stdout']['isTTY']&&!_0x3c183d;}export function resolveOutputOptions(_0x3dd2e3){const _0x9c341=a53_0x5ef9,_0x216e65=_0x3dd2e3['output']||'',_0x13a95a=resolveOutputFormat(_0x3dd2e3[_0x9c341(0x1c1)],_0x216e65,'table');let _0x247e25=typeof _0x3dd2e3[_0x9c341(0x1b4)]===_0x9c341(0x18c)?_0x3dd2e3[_0x9c341(0x1b4)]:parseInt(_0x3dd2e3[_0x9c341(0x1b4)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x3dd2e3[_0x9c341(0x1b4)]===undefined&&shouldUseLess(_0x13a95a,_0x216e65)&&(_0x247e25=Infinity),{'format':_0x13a95a,'output':_0x216e65,'limit':_0x247e25,'limitStructuredFormats':_0x3dd2e3['limitStructuredFormats'],'color':_0x3dd2e3[_0x9c341(0x1a1)],'noColor':_0x3dd2e3[_0x9c341(0x187)]};}export function writeOutput(_0x44414b,_0xd54b1b,_0x735ff8){const _0x29bee1=a53_0x5ef9;return _0xd54b1b?(writeFileSync(_0xd54b1b,_0x44414b),console[_0x29bee1(0x1b1)](_0x29bee1(0x1af)+_0xd54b1b),Promise[_0x29bee1(0x1b5)]()):shouldUseLess(_0x735ff8||'','')?new Promise(_0x2b1cd4=>{const _0x2fb0fa=_0x29bee1,_0x2264ac=spawn(_0x2fb0fa(0x186),[_0x2fb0fa(0x18d)],{'stdio':[_0x2fb0fa(0x1cc),_0x2fb0fa(0x1b7),_0x2fb0fa(0x1b7)]});let _0x5de27a=![];_0x2264ac['on']('error',()=>{const _0x1e0812=_0x2fb0fa;!_0x5de27a&&(_0x5de27a=!![],console[_0x1e0812(0x1a3)](_0x44414b),_0x2b1cd4());}),_0x2264ac['on'](_0x2fb0fa(0x1c4),()=>{!_0x5de27a&&(_0x5de27a=!![],_0x2b1cd4());}),_0x2264ac['on'](_0x2fb0fa(0x1c0),()=>{const _0x51593d=_0x2fb0fa;!_0x5de27a&&_0x2264ac['stdin']&&(_0x2264ac[_0x51593d(0x19d)]['on'](_0x51593d(0x1b1),()=>{}),_0x2264ac['stdin'][_0x51593d(0x185)](_0x44414b),_0x2264ac[_0x51593d(0x19d)][_0x51593d(0x183)]());}),!_0x2264ac[_0x2fb0fa(0x19d)]&&(!_0x5de27a&&(_0x5de27a=!![],console[_0x2fb0fa(0x1a3)](_0x44414b),_0x2b1cd4()));}):(console[_0x29bee1(0x1a3)](_0x44414b),Promise[_0x29bee1(0x1b5)]());}export async function handleSDKOutput(_0x4fcb8b,_0xcaaf86){const _0x14e085=a53_0x5ef9,_0x1f3639=resolveOutputOptions(_0xcaaf86),_0x5bc09b=await formatSDKOutput(_0x4fcb8b,_0x1f3639);await writeOutput(_0x5bc09b,_0x1f3639[_0x14e085(0x1ad)]||undefined,_0x1f3639[_0x14e085(0x1c1)]);}export async function handleQueryOutput(_0x330860,_0x38ed13){const _0x18879a=a53_0x5ef9,_0x451ad5=resolveOutputOptions(_0x38ed13),_0x3b34e1=await formatQueryOutput(_0x330860,_0x451ad5);await writeOutput(_0x3b34e1,_0x451ad5[_0x18879a(0x1ad)]||undefined,_0x451ad5[_0x18879a(0x1c1)]);}function a53_0x5ef9(_0x24be92,_0x378a95){_0x24be92=_0x24be92-0x183;const _0x1d70e9=a53_0x1d70();let _0x5ef986=_0x1d70e9[_0x24be92];return _0x5ef986;}async function formatSingleObject(_0x52b0f0,_0x4dbdc0){const _0x2170bb=a53_0x5ef9,{format:_0x33e1ba,color:_0x154650,noColor:_0x1e67a3}=_0x4dbdc0,_0x155f0e={'color':_0x154650,'noColor':_0x1e67a3};if(_0x33e1ba===_0x2170bb(0x194)){if(shouldUseColor(_0x155f0e))return colorizeJSON(_0x52b0f0,_0x155f0e);return JSON[_0x2170bb(0x19e)](_0x52b0f0,null,0x2);}else{if(_0x33e1ba===_0x2170bb(0x1a2)){if(shouldUseColor(_0x155f0e))return colorizeJSONCompact(_0x52b0f0,_0x155f0e);return JSON[_0x2170bb(0x19e)](_0x52b0f0);}else{if(_0x33e1ba===_0x2170bb(0x195))return Object[_0x2170bb(0x1a6)](_0x52b0f0)[_0x2170bb(0x192)](([_0x153c02,_0x4e458f])=>_0x153c02+'\x09'+_0x4e458f)[_0x2170bb(0x199)]('\x0a');else{const _0x1a2a66=Object[_0x2170bb(0x1a6)](_0x52b0f0);if(_0x1a2a66[_0x2170bb(0x1b2)]===0x0)return _0x2170bb(0x1c2);const _0x419c28=_0x52b0f0[_0x2170bb(0x19b)],_0x5664e8=_0x52b0f0['query'],_0x194282=_0x52b0f0[_0x2170bb(0x1c5)],_0x58b3db=_0x52b0f0[_0x2170bb(0x18a)],_0x289d24=_0x5664e8?typeof _0x5664e8===_0x2170bb(0x1ae)?_0x5664e8:JSON[_0x2170bb(0x19e)](_0x5664e8,null,0x2):undefined,_0x377cbe=_0x194282&&Object[_0x2170bb(0x1aa)](_0x194282)[_0x2170bb(0x1b2)]>0x0?JSON['stringify'](_0x194282,null,0x2):undefined,_0xae9b7d=_0x58b3db&&Object['keys'](_0x58b3db)[_0x2170bb(0x1b2)]>0x0?JSON[_0x2170bb(0x19e)](_0x58b3db,null,0x2):undefined,_0x2e6e32=_0x1a2a66[_0x2170bb(0x184)](([_0x1d0c37])=>_0x1d0c37!==_0x2170bb(0x19b)&&_0x1d0c37!==_0x2170bb(0x1a9)&&_0x1d0c37!=='params'&&_0x1d0c37!==_0x2170bb(0x18a)),_0xf7a253=Math[_0x2170bb(0x18b)](..._0x2e6e32[_0x2170bb(0x192)](([_0x3d2e76])=>_0x3d2e76[_0x2170bb(0x1b2)])),_0xb25567=Math[_0x2170bb(0x18b)](..._0x2e6e32[_0x2170bb(0x192)](([,_0x3baea4])=>{const _0x2fa8ce=_0x2170bb;try{const _0x487b18=_0x3baea4===null||_0x3baea4===undefined?'':typeof _0x3baea4===_0x2fa8ce(0x1b9)?JSON[_0x2fa8ce(0x19e)](_0x3baea4):String(_0x3baea4),_0x5e6d9c=_0x487b18[_0x2fa8ce(0x190)]('\x0a');return Math[_0x2fa8ce(0x18b)](..._0x5e6d9c[_0x2fa8ce(0x192)](_0x191aa5=>_0x191aa5[_0x2fa8ce(0x1b2)]),0x0);}catch{return 0x0;}}),0x14),_0x29f0ce=[];_0x29f0ce[_0x2170bb(0x1b3)](colorBorder('┌─'+'─'['repeat'](_0xf7a253)+'─┬─'+'─'[_0x2170bb(0x1bd)](_0xb25567)+'─┐',_0x155f0e)),_0x2e6e32[_0x2170bb(0x19f)](([_0x38ef06,_0x130a66])=>{const _0x54e95e=_0x2170bb;let _0x4bcafb;try{_0x4bcafb=_0x130a66===null||_0x130a66===undefined?'':typeof _0x130a66===_0x54e95e(0x1b9)?JSON[_0x54e95e(0x19e)](_0x130a66):String(_0x130a66);}catch{_0x4bcafb='[Object]';}const _0x12cff6=_0x38ef06[_0x54e95e(0x191)](_0xf7a253),_0x1cf1a5=_0x4bcafb[_0x54e95e(0x190)]('\x0a');_0x1cf1a5[_0x54e95e(0x19f)]((_0x54b269,_0x2daadc)=>{const _0x247256=_0x54e95e,_0x1e8940=colorBorder('│',_0x155f0e);_0x2daadc===0x0?_0x29f0ce[_0x247256(0x1b3)](_0x1e8940+'\x20'+_0x12cff6+'\x20'+_0x1e8940+'\x20'+_0x54b269[_0x247256(0x191)](_0xb25567)+'\x20'+_0x1e8940):_0x29f0ce[_0x247256(0x1b3)](_0x1e8940+'\x20'+'\x20'[_0x247256(0x1bd)](_0xf7a253)+'\x20'+_0x1e8940+'\x20'+_0x54b269[_0x247256(0x191)](_0xb25567)+'\x20'+_0x1e8940);});}),_0x29f0ce[_0x2170bb(0x1b3)](colorBorder('└─'+'─'[_0x2170bb(0x1bd)](_0xf7a253)+_0x2170bb(0x1ba)+'─'[_0x2170bb(0x1bd)](_0xb25567)+'─┘',_0x155f0e));_0x289d24&&(_0x29f0ce[_0x2170bb(0x1b3)](''),_0x29f0ce[_0x2170bb(0x1b3)](String(a53_0x187921['yellow'][_0x2170bb(0x1cb)](_0x2170bb(0x1b0)))),_0x29f0ce[_0x2170bb(0x1b3)](_0x289d24));_0x377cbe&&(_0x29f0ce[_0x2170bb(0x1b3)](''),_0x29f0ce[_0x2170bb(0x1b3)](String(a53_0x187921[_0x2170bb(0x1c8)][_0x2170bb(0x1cb)]('[params]'))),_0x29f0ce[_0x2170bb(0x1b3)](_0x377cbe));_0xae9b7d&&(_0x29f0ce[_0x2170bb(0x1b3)](''),_0x29f0ce[_0x2170bb(0x1b3)](String(a53_0x187921['magenta']['bold'](_0x2170bb(0x1b8)))),_0x29f0ce[_0x2170bb(0x1b3)](_0xae9b7d));if(_0x419c28){if(_0x419c28[_0x2170bb(0x1ac)]){_0x29f0ce['push'](''),_0x29f0ce[_0x2170bb(0x1b3)](String(a53_0x187921[_0x2170bb(0x198)][_0x2170bb(0x1cb)](_0x2170bb(0x1b6))));const _0x40fdcf=_0x419c28['stderr'][_0x2170bb(0x190)]('\x0a');_0x40fdcf[_0x2170bb(0x19f)](_0xc41bf5=>{const _0x12f282=_0x2170bb;_0xc41bf5['trim']()&&_0x29f0ce[_0x12f282(0x1b3)](_0xc41bf5);});}if(_0x419c28[_0x2170bb(0x1cd)]){_0x29f0ce[_0x2170bb(0x1b3)](''),_0x29f0ce[_0x2170bb(0x1b3)](String(a53_0x187921[_0x2170bb(0x1c6)][_0x2170bb(0x1cb)](_0x2170bb(0x1a5))));const _0xbb045c=_0x419c28['cmdout']['split']('\x0a');_0xbb045c[_0x2170bb(0x19f)](_0x47b97f=>{const _0x323aeb=_0x2170bb;_0x47b97f[_0x323aeb(0x1c9)]()&&_0x29f0ce['push'](_0x47b97f);});}}return _0x29f0ce[_0x2170bb(0x199)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x335603,_0x2df130){const _0x408f4d=a53_0x5ef9;if(_0x2df130[_0x408f4d(0x1c1)]===_0x408f4d(0x1be)){await handleSDKOutput([_0x335603],_0x2df130);return;}const _0x2e27f2=resolveOutputOptions(_0x2df130),_0x3eedd4=await formatSingleObject(_0x335603,_0x2e27f2);await writeOutput(_0x3eedd4,_0x2e27f2[_0x408f4d(0x1ad)]||undefined,_0x2e27f2[_0x408f4d(0x1c1)]);}
|
|
1
|
+
(function(_0x24a414,_0x4aaa5f){const _0x3e9889=a54_0x2e93,_0xea4ed=_0x24a414();while(!![]){try{const _0x5b4532=-parseInt(_0x3e9889(0x141))/0x1*(-parseInt(_0x3e9889(0x15c))/0x2)+parseInt(_0x3e9889(0x14f))/0x3*(-parseInt(_0x3e9889(0x146))/0x4)+-parseInt(_0x3e9889(0x126))/0x5+-parseInt(_0x3e9889(0x147))/0x6+-parseInt(_0x3e9889(0x12b))/0x7+parseInt(_0x3e9889(0x166))/0x8+parseInt(_0x3e9889(0x13e))/0x9;if(_0x5b4532===_0x4aaa5f)break;else _0xea4ed['push'](_0xea4ed['shift']());}catch(_0x5da9bf){_0xea4ed['push'](_0xea4ed['shift']());}}}(a54_0x569a,0x774ca));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 a54_0x2a7a16 from'chalk';function a54_0x2e93(_0x137aa0,_0x270580){_0x137aa0=_0x137aa0-0x124;const _0x569a27=a54_0x569a();let _0x2e93f4=_0x569a27[_0x137aa0];return _0x2e93f4;}import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x21d9e3){const _0x2c6056=a54_0x2e93;return _0x21d9e3['format']===_0x2c6056(0x140)||_0x21d9e3['format']===_0x2c6056(0x14c)||_0x21d9e3[_0x2c6056(0x134)]==='tsv'||_0x21d9e3['format']==='table'||_0x21d9e3[_0x2c6056(0x140)]===!![]||_0x21d9e3[_0x2c6056(0x14c)]===!![]||_0x21d9e3['tsv']===!![]||_0x21d9e3[_0x2c6056(0x13a)]===!![];}function a54_0x569a(){const _0x7d848d=['blue','rule','query','join','noColor','forEach','[params]','No\x20data','format','spawn','sdk-result','magenta','double','resolve','table','limit','params','keys','19363581mVpoXy','isTTY','json','1JohPaJ','color','stdout','write','close','752QebaBB','2614008vWqQwd','list','pipe','limitStructuredFormats','inherit','jsonl','red','debug','3834mlHwah','slice','log','bold','error','boolean','stdin','number','─┬─','output','filter','padEnd','varchar','152246BBQeZh','tsv','isFinite','[Object]','stringify','object','─┴─','yellow','split','entries','2256928kSrkDD','bigint','repeat','isInteger','data','[rule]','cmdout','[error]','[query]','map','length','2262500sEejGe','stderr','trim','push','FINISHED','6248662ATkUNR'];a54_0x569a=function(){return _0x7d848d;};return a54_0x569a();}export function parseOutputOptions(_0xf2b338){const _0x2a2378=a54_0x2e93;return{'format':_0xf2b338[_0x2a2378(0x134)]||'table','output':_0xf2b338[_0x2a2378(0x158)]||'','limit':_0xf2b338['limit'],'limitStructuredFormats':_0xf2b338[_0x2a2378(0x14a)],'color':_0xf2b338['color'],'noColor':_0xf2b338[_0x2a2378(0x130)]};}function convertSDKResultToQueryResult(_0x1830d7){const _0x5f0030=a54_0x2e93,_0x517290=[];if(_0x1830d7[_0x5f0030(0x125)]>0x0){const _0x48b6bc=_0x1830d7[0x0];for(const [_0xd411a1,_0x35b79c]of Object[_0x5f0030(0x165)](_0x48b6bc)){let _0x5a425a=_0x5f0030(0x15b);if(typeof _0x35b79c===_0x5f0030(0x156))_0x5a425a=Number[_0x5f0030(0x169)](_0x35b79c)?_0x5f0030(0x167):_0x5f0030(0x138);else{if(typeof _0x35b79c==='boolean')_0x5a425a=_0x5f0030(0x154);else _0x35b79c===null&&(_0x5a425a=_0x5f0030(0x15b));}_0x517290[_0x5f0030(0x129)]({'name':_0xd411a1,'type':_0x5a425a});}}return{'queryId':_0x5f0030(0x136),'columns':_0x517290,'data':_0x1830d7,'stats':{'state':_0x5f0030(0x12a),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x1830d7[_0x5f0030(0x125)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x3d5d97,_0x1d8bf8){const _0x2d7cae=convertSDKResultToQueryResult(_0x3d5d97);return formatQueryOutput(_0x2d7cae,_0x1d8bf8);}export async function formatQueryOutput(_0x2c0d4a,_0x567654){const _0x4831c2=a54_0x2e93,{format:_0x51e9b3,limit:_0x506aa6,output:_0x9895ac,color:_0xa57e72,noColor:_0x1f37e2,limitStructuredFormats:_0x445bea}=_0x567654,_0x2717c1=Boolean(_0x9895ac)&&!_0xa57e72,_0xb3083b={'color':_0xa57e72,'noColor':_0x1f37e2||_0x2717c1};if(_0x51e9b3===_0x4831c2(0x13a)){const _0x1c5b70=shouldUseLess(_0x51e9b3,_0x9895ac);return formatAsTable(_0x2c0d4a,_0x506aa6,_0x1c5b70,_0xb3083b);}const _0x40a03b=_0x445bea&&Number[_0x4831c2(0x15e)](_0x506aa6)&&_0x2c0d4a['data'][_0x4831c2(0x125)]>_0x506aa6?{..._0x2c0d4a,'data':_0x2c0d4a[_0x4831c2(0x16a)][_0x4831c2(0x150)](0x0,_0x506aa6)}:_0x2c0d4a;if(_0x51e9b3===_0x4831c2(0x140))return formatAsJSON(_0x40a03b,_0xb3083b);else return _0x51e9b3===_0x4831c2(0x14c)?formatAsJSONL(_0x40a03b,_0xb3083b):formatQueryResult(_0x40a03b,_0x51e9b3);}function shouldUseLess(_0xbec537,_0x583510){const _0x62553d=a54_0x2e93;return(_0xbec537===_0x62553d(0x13a)||_0xbec537===_0x62553d(0x148))&&process[_0x62553d(0x143)][_0x62553d(0x13f)]&&!_0x583510;}export function resolveOutputOptions(_0x459e5a){const _0x269caa=a54_0x2e93,_0x209a7b=_0x459e5a[_0x269caa(0x158)]||'',_0x3f8ec3=resolveOutputFormat(_0x459e5a['format'],_0x209a7b,_0x269caa(0x13a));let _0x51975d=typeof _0x459e5a[_0x269caa(0x13b)]===_0x269caa(0x156)?_0x459e5a[_0x269caa(0x13b)]:parseInt(_0x459e5a['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x459e5a[_0x269caa(0x13b)]===undefined&&shouldUseLess(_0x3f8ec3,_0x209a7b)&&(_0x51975d=Infinity),{'format':_0x3f8ec3,'output':_0x209a7b,'limit':_0x51975d,'limitStructuredFormats':_0x459e5a['limitStructuredFormats'],'color':_0x459e5a[_0x269caa(0x142)],'noColor':_0x459e5a[_0x269caa(0x130)]};}export function writeOutput(_0x14f78b,_0x9a6140,_0x14a030){const _0xb9ec47=a54_0x2e93;return _0x9a6140?(writeFileSync(_0x9a6140,_0x14f78b),console[_0xb9ec47(0x153)]('Results\x20saved\x20to\x20'+_0x9a6140),Promise[_0xb9ec47(0x139)]()):shouldUseLess(_0x14a030||'','')?new Promise(_0x2f64b0=>{const _0x3e3d55=_0xb9ec47,_0xca6c44=spawn('less',['-FXRSn'],{'stdio':[_0x3e3d55(0x149),'inherit',_0x3e3d55(0x14b)]});let _0x4c67f9=![];_0xca6c44['on'](_0x3e3d55(0x153),()=>{const _0x344f64=_0x3e3d55;!_0x4c67f9&&(_0x4c67f9=!![],console[_0x344f64(0x151)](_0x14f78b),_0x2f64b0());}),_0xca6c44['on'](_0x3e3d55(0x145),()=>{!_0x4c67f9&&(_0x4c67f9=!![],_0x2f64b0());}),_0xca6c44['on'](_0x3e3d55(0x135),()=>{const _0x5a2b34=_0x3e3d55;!_0x4c67f9&&_0xca6c44['stdin']&&(_0xca6c44[_0x5a2b34(0x155)]['on'](_0x5a2b34(0x153),()=>{}),_0xca6c44[_0x5a2b34(0x155)][_0x5a2b34(0x144)](_0x14f78b),_0xca6c44[_0x5a2b34(0x155)]['end']());}),!_0xca6c44['stdin']&&(!_0x4c67f9&&(_0x4c67f9=!![],console[_0x3e3d55(0x151)](_0x14f78b),_0x2f64b0()));}):(console['log'](_0x14f78b),Promise[_0xb9ec47(0x139)]());}export async function handleSDKOutput(_0x3a09be,_0x8e90cc){const _0x4a600e=a54_0x2e93,_0x21a4c7=resolveOutputOptions(_0x8e90cc),_0x5d1b38=await formatSDKOutput(_0x3a09be,_0x21a4c7);await writeOutput(_0x5d1b38,_0x21a4c7[_0x4a600e(0x158)]||undefined,_0x21a4c7[_0x4a600e(0x134)]);}export async function handleQueryOutput(_0x14d6f2,_0x15b845){const _0x248c50=a54_0x2e93,_0x5b532e=resolveOutputOptions(_0x15b845),_0x313a09=await formatQueryOutput(_0x14d6f2,_0x5b532e);await writeOutput(_0x313a09,_0x5b532e[_0x248c50(0x158)]||undefined,_0x5b532e[_0x248c50(0x134)]);}async function formatSingleObject(_0x48f912,_0x3147c7){const _0xb9d5d=a54_0x2e93,{format:_0x3a7cdf,color:_0x4e17a5,noColor:_0x5b65b1}=_0x3147c7,_0x131317={'color':_0x4e17a5,'noColor':_0x5b65b1};if(_0x3a7cdf==='json'){if(shouldUseColor(_0x131317))return colorizeJSON(_0x48f912,_0x131317);return JSON['stringify'](_0x48f912,null,0x2);}else{if(_0x3a7cdf===_0xb9d5d(0x14c)){if(shouldUseColor(_0x131317))return colorizeJSONCompact(_0x48f912,_0x131317);return JSON['stringify'](_0x48f912);}else{if(_0x3a7cdf===_0xb9d5d(0x15d))return Object[_0xb9d5d(0x165)](_0x48f912)[_0xb9d5d(0x124)](([_0x425f4a,_0x53940d])=>_0x425f4a+'\x09'+_0x53940d)[_0xb9d5d(0x12f)]('\x0a');else{const _0x3b5441=Object[_0xb9d5d(0x165)](_0x48f912);if(_0x3b5441['length']===0x0)return _0xb9d5d(0x133);const _0x4515a9=_0x48f912[_0xb9d5d(0x14e)],_0x1a25fa=_0x48f912['query'],_0x2beb16=_0x48f912[_0xb9d5d(0x13c)],_0x47d685=_0x48f912[_0xb9d5d(0x12d)],_0xc4643b=_0x1a25fa?typeof _0x1a25fa==='string'?_0x1a25fa:JSON[_0xb9d5d(0x160)](_0x1a25fa,null,0x2):undefined,_0x2a5395=_0x2beb16&&Object['keys'](_0x2beb16)[_0xb9d5d(0x125)]>0x0?JSON[_0xb9d5d(0x160)](_0x2beb16,null,0x2):undefined,_0x5a3316=_0x47d685&&Object[_0xb9d5d(0x13d)](_0x47d685)['length']>0x0?JSON[_0xb9d5d(0x160)](_0x47d685,null,0x2):undefined,_0x419f11=_0x3b5441[_0xb9d5d(0x159)](([_0x3a1c84])=>_0x3a1c84!==_0xb9d5d(0x14e)&&_0x3a1c84!==_0xb9d5d(0x12e)&&_0x3a1c84!==_0xb9d5d(0x13c)&&_0x3a1c84!=='rule'),_0x57bd6e=Math['max'](..._0x419f11[_0xb9d5d(0x124)](([_0x51cbed])=>_0x51cbed['length'])),_0xa6465d=Math['max'](..._0x419f11['map'](([,_0x40f744])=>{const _0x8b8503=_0xb9d5d;try{const _0x2b60db=_0x40f744===null||_0x40f744===undefined?'':typeof _0x40f744===_0x8b8503(0x161)?JSON[_0x8b8503(0x160)](_0x40f744):String(_0x40f744),_0xf306dc=_0x2b60db[_0x8b8503(0x164)]('\x0a');return Math['max'](..._0xf306dc[_0x8b8503(0x124)](_0x204ab0=>_0x204ab0[_0x8b8503(0x125)]),0x0);}catch{return 0x0;}}),0x14),_0x10d933=[];_0x10d933[_0xb9d5d(0x129)](colorBorder('┌─'+'─'['repeat'](_0x57bd6e)+_0xb9d5d(0x157)+'─'['repeat'](_0xa6465d)+'─┐',_0x131317)),_0x419f11[_0xb9d5d(0x131)](([_0x3c8e66,_0x57c2f0])=>{const _0x5e77d2=_0xb9d5d;let _0x3496c6;try{_0x3496c6=_0x57c2f0===null||_0x57c2f0===undefined?'':typeof _0x57c2f0==='object'?JSON[_0x5e77d2(0x160)](_0x57c2f0):String(_0x57c2f0);}catch{_0x3496c6=_0x5e77d2(0x15f);}const _0x5551a7=_0x3c8e66[_0x5e77d2(0x15a)](_0x57bd6e),_0x4d8c8c=_0x3496c6[_0x5e77d2(0x164)]('\x0a');_0x4d8c8c[_0x5e77d2(0x131)]((_0x3db204,_0x3a0f14)=>{const _0x2eeec5=_0x5e77d2,_0x4d12cf=colorBorder('│',_0x131317);_0x3a0f14===0x0?_0x10d933[_0x2eeec5(0x129)](_0x4d12cf+'\x20'+_0x5551a7+'\x20'+_0x4d12cf+'\x20'+_0x3db204[_0x2eeec5(0x15a)](_0xa6465d)+'\x20'+_0x4d12cf):_0x10d933['push'](_0x4d12cf+'\x20'+'\x20'[_0x2eeec5(0x168)](_0x57bd6e)+'\x20'+_0x4d12cf+'\x20'+_0x3db204[_0x2eeec5(0x15a)](_0xa6465d)+'\x20'+_0x4d12cf);});}),_0x10d933[_0xb9d5d(0x129)](colorBorder('└─'+'─'[_0xb9d5d(0x168)](_0x57bd6e)+_0xb9d5d(0x162)+'─'[_0xb9d5d(0x168)](_0xa6465d)+'─┘',_0x131317));_0xc4643b&&(_0x10d933[_0xb9d5d(0x129)](''),_0x10d933[_0xb9d5d(0x129)](String(a54_0x2a7a16[_0xb9d5d(0x163)][_0xb9d5d(0x152)](_0xb9d5d(0x16e)))),_0x10d933[_0xb9d5d(0x129)](_0xc4643b));_0x2a5395&&(_0x10d933[_0xb9d5d(0x129)](''),_0x10d933[_0xb9d5d(0x129)](String(a54_0x2a7a16[_0xb9d5d(0x12c)][_0xb9d5d(0x152)](_0xb9d5d(0x132)))),_0x10d933[_0xb9d5d(0x129)](_0x2a5395));_0x5a3316&&(_0x10d933['push'](''),_0x10d933[_0xb9d5d(0x129)](String(a54_0x2a7a16[_0xb9d5d(0x137)][_0xb9d5d(0x152)](_0xb9d5d(0x16b)))),_0x10d933[_0xb9d5d(0x129)](_0x5a3316));if(_0x4515a9){if(_0x4515a9[_0xb9d5d(0x127)]){_0x10d933[_0xb9d5d(0x129)](''),_0x10d933[_0xb9d5d(0x129)](String(a54_0x2a7a16[_0xb9d5d(0x14d)][_0xb9d5d(0x152)](_0xb9d5d(0x16d))));const _0x5f27bf=_0x4515a9[_0xb9d5d(0x127)][_0xb9d5d(0x164)]('\x0a');_0x5f27bf[_0xb9d5d(0x131)](_0x3d1e42=>{const _0x45d61e=_0xb9d5d;_0x3d1e42[_0x45d61e(0x128)]()&&_0x10d933['push'](_0x3d1e42);});}if(_0x4515a9[_0xb9d5d(0x16c)]){_0x10d933[_0xb9d5d(0x129)](''),_0x10d933['push'](String(a54_0x2a7a16['cyan'][_0xb9d5d(0x152)]('[logs]')));const _0x72d9f6=_0x4515a9[_0xb9d5d(0x16c)][_0xb9d5d(0x164)]('\x0a');_0x72d9f6[_0xb9d5d(0x131)](_0x150b8f=>{const _0xf2513a=_0xb9d5d;_0x150b8f[_0xf2513a(0x128)]()&&_0x10d933[_0xf2513a(0x129)](_0x150b8f);});}}return _0x10d933['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x5d4e93,_0x48c975){const _0x442867=a54_0x2e93;if(_0x48c975['format']==='table'){await handleSDKOutput([_0x5d4e93],_0x48c975);return;}const _0x505646=resolveOutputOptions(_0x48c975),_0x4217be=await formatSingleObject(_0x5d4e93,_0x505646);await writeOutput(_0x4217be,_0x505646[_0x442867(0x158)]||undefined,_0x505646[_0x442867(0x134)]);}
|