@treasuredata/tdx 2026.4.17 → 2026.4.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-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.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-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/tools/work-create-item.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/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.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/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.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 +17 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const a54_0xb298fb=a54_0x2110;(function(_0x3b705e,_0x30084f){const _0x23a438=a54_0x2110,_0x3f61dd=_0x3b705e();while(!![]){try{const _0x2c57e9=-parseInt(_0x23a438(0x36f))/0x1+-parseInt(_0x23a438(0x210))/0x2+-parseInt(_0x23a438(0x25b))/0x3*(parseInt(_0x23a438(0x274))/0x4)+-parseInt(_0x23a438(0x26b))/0x5+parseInt(_0x23a438(0x2e1))/0x6*(-parseInt(_0x23a438(0x3aa))/0x7)+parseInt(_0x23a438(0x2a6))/0x8+parseInt(_0x23a438(0x345))/0x9;if(_0x2c57e9===_0x30084f)break;else _0x3f61dd['push'](_0x3f61dd['shift']());}catch(_0x4dc4a4){_0x3f61dd['push'](_0x3f61dd['shift']());}}}(a54_0x56b4,0x5d436));import a54_0x238b4f from'chalk';import{existsSync}from'fs';import a54_0x2f24e3 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,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 a54_0x206969 from'prompts';function getAttemptStatusDisplay(_0xbf0ebf){const _0x21317a=a54_0x2110;if(!_0xbf0ebf)return{'icon':'⏳','text':''};const {done:_0x2a4b5c,success:_0x149ca0,cancelRequested:_0x481ff1}=_0xbf0ebf;if(!_0x2a4b5c)return _0x481ff1?{'icon':'🛑','text':a54_0x238b4f[_0x21317a(0x344)](_0x21317a(0x203))}:{'icon':'🔄','text':a54_0x238b4f[_0x21317a(0x211)](_0x21317a(0x20a))};if(_0x149ca0)return{'icon':'✅','text':a54_0x238b4f['green'](_0x21317a(0x2d2))};return{'icon':'❌','text':a54_0x238b4f[_0x21317a(0x301)](_0x21317a(0x30d))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0xb298fb(0x2e6)](_0x3fd076,_0x20aad0,_0x372d8d=0x0){const _0x5c8792=a54_0xb298fb;return _0x3fd076[_0x372d8d]||_0x20aad0[_0x5c8792(0x216)];}['requireProject'](_0x450f58,_0x270991,_0x4911ff=0x0){const _0x13776d=a54_0xb298fb,_0x2e9718=this[_0x13776d(0x2e6)](_0x450f58,_0x270991,_0x4911ff);if(!_0x2e9718)return console['error'](a54_0x238b4f[_0x13776d(0x301)]('Error:'),_0x13776d(0x2ba)),console['error'](a54_0x238b4f[_0x13776d(0x373)](_0x13776d(0x2ab))),null;return _0x2e9718;}['parseProjectWorkflowPattern'](_0x2c7ef7,_0x1501f5){const _0x4aafca=a54_0xb298fb;if(_0x2c7ef7[0x0]){const _0x271ec0=_0x2c7ef7[0x0][_0x4aafca(0x2ee)]('.');if(_0x271ec0[_0x4aafca(0x33b)]===0x1)return{'projectName':_0x271ec0[0x0],'workflowName':undefined};else return _0x271ec0[_0x4aafca(0x33b)]===0x2?{'projectName':_0x271ec0[0x0],'workflowName':_0x271ec0[0x1]}:(console[_0x4aafca(0x30d)](a54_0x238b4f[_0x4aafca(0x301)]('Error:'),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x1501f5[_0x4aafca(0x216)],'workflowName':undefined};}[a54_0xb298fb(0x398)](_0x1c5ab2,_0x30288f,_0x40846f=0x0){const _0x4207ca=a54_0xb298fb;if(_0x1c5ab2[_0x40846f])return _0x1c5ab2[_0x40846f];if(_0x30288f[_0x4207ca(0x216)]){const _0x253dc2=a54_0x2f24e3[_0x4207ca(0x29a)](process[_0x4207ca(0x28a)](),_0x4207ca(0x267),_0x30288f[_0x4207ca(0x216)]);if(existsSync(a54_0x2f24e3['join'](_0x253dc2,'tdx.json')))return _0x253dc2;}return undefined;}async[a54_0xb298fb(0x317)](_0x365c11,_0x5c6b3a,_0xe4f703){const _0x51116f=a54_0xb298fb;try{const _0x3c4e38=await _0x365c11[_0x51116f(0x2e9)][_0x51116f(0x267)](_0x5c6b3a,{'limit':0x1});if(_0x3c4e38[_0x51116f(0x33b)]>0x0){const _0x37196c=_0x3c4e38[0x0]['id'],_0x17c7b8=getWorkflowUrl(_0xe4f703,_0x37196c);console['error']('\x20\x20Console:\x20'+a54_0x238b4f['cyan'](_0x17c7b8));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a54_0xb298fb(0x2ce);[a54_0xb298fb(0x346)]=a54_0xb298fb(0x37e);async[a54_0xb298fb(0x335)](_0x350aa1){const _0x1c2f02=a54_0xb298fb,{options:_0x393380,args:_0x280988,tdx:_0xe8a385}=_0x350aa1,_0x104a47=_0x280988[0x0],_0x2d02c3=_0x393380['clear'];if(_0x2d02c3)return saveSessionContext({'workflow_project':undefined},_0x393380[_0x1c2f02(0x38b)]),console[_0x1c2f02(0x360)](a54_0x238b4f[_0x1c2f02(0x23e)](_0x1c2f02(0x283))),0x0;if(!_0x104a47)return console[_0x1c2f02(0x30d)](a54_0x238b4f['red'](_0x1c2f02(0x33f)),'Project\x20name\x20is\x20required'),console[_0x1c2f02(0x30d)](a54_0x238b4f[_0x1c2f02(0x373)](_0x1c2f02(0x263))),console[_0x1c2f02(0x30d)](a54_0x238b4f[_0x1c2f02(0x373)](_0x1c2f02(0x34e))),0x1;const _0x1c1a3c=await withSpinner(_0x1c2f02(0x294)+_0x104a47+'\x27...',()=>_0xe8a385[_0x1c2f02(0x2e9)][_0x1c2f02(0x1ea)](_0x104a47),{'verbose':_0x393380[_0x1c2f02(0x31d)]}),{name:_0x1b1b8b}=_0x1c1a3c['data'];return saveSessionContext({'workflow_project':_0x1b1b8b},_0x393380['session']),console['log'](a54_0x238b4f[_0x1c2f02(0x23e)](_0x1c2f02(0x1ed)+a54_0x238b4f['cyan'](_0x1b1b8b))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a54_0xb298fb(0x256);[a54_0xb298fb(0x346)]=a54_0xb298fb(0x35c);async[a54_0xb298fb(0x335)](_0x4cecb6){const _0x1c4e8c=a54_0xb298fb,{options:_0x1aeb70,args:_0x2ba0d2,tdx:_0x135132}=_0x4cecb6,_0x11e6fb=_0x2ba0d2[0x0];_0x1aeb70['verbose']&&_0x11e6fb&&console[_0x1c4e8c(0x30d)](_0x1c4e8c(0x33e)+_0x11e6fb);const _0x214aa9=await withSpinner(_0x1c4e8c(0x2c8),()=>_0x135132[_0x1c4e8c(0x2e9)][_0x1c4e8c(0x38a)](_0x11e6fb,{'limit':_0x1aeb70[_0x1c4e8c(0x3ab)]}),{'verbose':_0x1aeb70[_0x1c4e8c(0x31d)]});let _0x26d8f4=_0x214aa9[_0x1c4e8c(0x364)];_0x26d8f4[_0x1c4e8c(0x270)]((_0x440ede,_0x59d370)=>_0x440ede['name']['localeCompare'](_0x59d370[_0x1c4e8c(0x2f3)]));const _0x47f250=_0x1aeb70[_0x1c4e8c(0x3ab)]||0x64,_0xd62f8=_0x26d8f4['length']>=_0x47f250?a54_0x238b4f[_0x1c4e8c(0x373)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x1c4e8c(0x30d)](_0x1c4e8c(0x275)+_0x26d8f4[_0x1c4e8c(0x33b)]+_0x1c4e8c(0x355)+(_0x26d8f4[_0x1c4e8c(0x33b)]!==0x1?'s':'')+_0xd62f8);if(_0x1aeb70[_0x1c4e8c(0x2b6)]===_0x1c4e8c(0x366)||_0x1aeb70[_0x1c4e8c(0x2b6)]===_0x1c4e8c(0x35b)||_0x1aeb70['format']===_0x1c4e8c(0x340))await handleSDKOutput(_0x26d8f4,_0x1aeb70);else{if(_0x26d8f4[_0x1c4e8c(0x33b)]===0x0)_0x11e6fb?console[_0x1c4e8c(0x360)]('No\x20projects\x20match\x20pattern:\x20'+_0x11e6fb):console[_0x1c4e8c(0x360)](_0x1c4e8c(0x32d));else{const _0x5e03b5=_0x26d8f4[_0x1c4e8c(0x298)](_0x3986e4=>{const _0x557353=_0x1c4e8c,_0x3f1a76=_0x3986e4[_0x557353(0x2e4)]?.[_0x557353(0x35f)](_0x47e4ae=>_0x47e4ae['key']==='sys'),_0x1ccbdb=_0x3f1a76?a54_0x238b4f['dim'](_0x557353(0x21d)):'';return'📁\x20'+_0x3986e4[_0x557353(0x2f3)]+_0x1ccbdb;});await writeOutput(_0x5e03b5['join']('\x0a'),_0x1aeb70['output'],_0x1c4e8c(0x209));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a54_0xb298fb(0x3b4);[a54_0xb298fb(0x346)]=a54_0xb298fb(0x32a);async[a54_0xb298fb(0x335)](_0x372ed3){const _0x1f9b88=a54_0xb298fb,{options:_0x1124a9,args:_0xb6ead0,tdx:_0x7cd526}=_0x372ed3,_0x580af4=this[_0x1f9b88(0x2e6)](_0xb6ead0,_0x1124a9);_0x1124a9[_0x1f9b88(0x31d)]&&_0x580af4&&console[_0x1f9b88(0x30d)](_0x1f9b88(0x2c0)+_0x580af4);const _0x545006=await withSpinner(_0x1f9b88(0x397),()=>_0x7cd526[_0x1f9b88(0x2e9)][_0x1f9b88(0x267)](_0x580af4,{'limit':_0x1124a9[_0x1f9b88(0x3ab)]}),{'verbose':_0x1124a9[_0x1f9b88(0x31d)]});let _0x272e41=_0x545006[_0x1f9b88(0x364)];_0x272e41[_0x1f9b88(0x270)]((_0x11a241,_0xb0c35a)=>{const _0x4983ec=_0x1f9b88,_0x5f3fda=_0x11a241[_0x4983ec(0x2f3)]['localeCompare'](_0xb0c35a[_0x4983ec(0x2f3)]);if(_0x5f3fda!==0x0)return _0x5f3fda;return(_0x11a241[_0x4983ec(0x1f5)]?.[_0x4983ec(0x2f3)]||'')['localeCompare'](_0xb0c35a[_0x4983ec(0x1f5)]?.[_0x4983ec(0x2f3)]||'');});const _0xbfc55=_0x1124a9['limit']||0x64,_0x6ce2f9=_0x272e41['length']>=_0xbfc55?a54_0x238b4f[_0x1f9b88(0x373)](_0x1f9b88(0x277)):'';console[_0x1f9b88(0x30d)]('✔\x20Found\x20'+_0x272e41[_0x1f9b88(0x33b)]+'\x20workflow'+(_0x272e41[_0x1f9b88(0x33b)]!==0x1?'s':'')+_0x6ce2f9);if(_0x1124a9['format']===_0x1f9b88(0x366)||_0x1124a9[_0x1f9b88(0x2b6)]===_0x1f9b88(0x35b)||_0x1124a9[_0x1f9b88(0x2b6)]==='table')await handleSDKOutput(_0x272e41,_0x1124a9);else{if(_0x272e41[_0x1f9b88(0x33b)]===0x0)_0x580af4?console[_0x1f9b88(0x360)](_0x1f9b88(0x2bd)+_0x580af4):console[_0x1f9b88(0x360)]('No\x20workflows\x20found');else{const _0xa780ef=_0x1124a9[_0x1f9b88(0x311)],_0x3762cf=_0x272e41[_0x1f9b88(0x298)](_0x53a507=>{const _0x48bfb2=_0x1f9b88,_0x5128e6=a54_0x238b4f['dim']('#'+_0x53a507['id']),_0x3b870b=hyperlink(_0x5128e6,getWorkflowUrl(_0xa780ef,_0x53a507['id'])),_0x3503cd=_0x53a507[_0x48bfb2(0x1f5)]?.[_0x48bfb2(0x2f3)]?a54_0x238b4f[_0x48bfb2(0x373)]('\x20('+_0x53a507[_0x48bfb2(0x1f5)][_0x48bfb2(0x2f3)]+')'):'';return _0x48bfb2(0x300)+_0x3b870b+'\x20'+_0x53a507[_0x48bfb2(0x2f3)]+_0x3503cd;});await writeOutput(_0x3762cf[_0x1f9b88(0x29a)]('\x0a'),_0x1124a9[_0x1f9b88(0x292)],_0x1f9b88(0x209));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']=a54_0xb298fb(0x220);[a54_0xb298fb(0x346)]='List\x20workflow\x20execution\x20sessions';async['execute'](_0x75737){const _0x2cc1ca=a54_0xb298fb,{options:_0x5c5bde,args:_0x584aec,tdx:_0x376b5b}=_0x75737,_0x7b328a=this[_0x2cc1ca(0x31c)](_0x584aec,_0x5c5bde);if(!_0x7b328a)return 0x1;const {projectName:_0x356f50,workflowName:_0x2ba40f}=_0x7b328a;if(_0x5c5bde[_0x2cc1ca(0x31d)]){if(_0x356f50&&_0x2ba40f)console[_0x2cc1ca(0x30d)](_0x2cc1ca(0x3a8)+_0x356f50+'.'+_0x2ba40f);else _0x356f50&&console[_0x2cc1ca(0x30d)](_0x2cc1ca(0x284)+_0x356f50);const _0x53e6ec=_0x5c5bde['status'];_0x53e6ec&&console[_0x2cc1ca(0x30d)](_0x2cc1ca(0x21c)+_0x53e6ec);}let _0x31bbbb=0x28;if(process[_0x2cc1ca(0x296)][_0x2cc1ca(0x3b1)]&&!_0x5c5bde[_0x2cc1ca(0x292)]&&!_0x5c5bde[_0x2cc1ca(0x2b6)]){const _0xd3133a=process[_0x2cc1ca(0x296)][_0x2cc1ca(0x278)]||0x28;_0x31bbbb=Math['max'](0x14,Math[_0x2cc1ca(0x332)](_0xd3133a*0x2/0x3));}const _0x2c1cad=_0x5c5bde['limit']||_0x31bbbb,_0x2dbc40=await withSpinner(_0x2cc1ca(0x34f),()=>_0x376b5b[_0x2cc1ca(0x2e9)][_0x2cc1ca(0x24a)]({'projectName':_0x356f50,'workflowName':_0x2ba40f,'status':_0x5c5bde[_0x2cc1ca(0x321)],'fromTime':_0x5c5bde[_0x2cc1ca(0x3b3)],'toTime':_0x5c5bde['to'],'limit':_0x2c1cad}),{'verbose':_0x5c5bde[_0x2cc1ca(0x31d)]}),_0x475115=_0x2dbc40[_0x2cc1ca(0x364)];_0x475115['sort']((_0x1419a0,_0x2a621c)=>{const _0x3cb82f=_0x2cc1ca,_0x2dd856=_0x1419a0['sessionTime']||'',_0x2808f0=_0x2a621c[_0x3cb82f(0x230)]||'';return _0x2808f0[_0x3cb82f(0x337)](_0x2dd856);});_0x475115[_0x2cc1ca(0x33b)]>=_0x2c1cad?console[_0x2cc1ca(0x30d)]('✔\x20Showing\x20'+_0x475115[_0x2cc1ca(0x33b)]+_0x2cc1ca(0x20f)+a54_0x238b4f[_0x2cc1ca(0x373)](_0x2cc1ca(0x205))):console['error'](_0x2cc1ca(0x275)+_0x475115[_0x2cc1ca(0x33b)]+_0x2cc1ca(0x1eb)+(_0x475115[_0x2cc1ca(0x33b)]!==0x1?'s':''));if(_0x5c5bde['format']==='json'||_0x5c5bde[_0x2cc1ca(0x2b6)]===_0x2cc1ca(0x35b)||_0x5c5bde['format']===_0x2cc1ca(0x340))await handleSDKOutput(_0x475115,_0x5c5bde);else{if(!process[_0x2cc1ca(0x296)][_0x2cc1ca(0x3b1)]||_0x5c5bde[_0x2cc1ca(0x292)]){if(_0x475115[_0x2cc1ca(0x33b)]===0x0){if(_0x356f50&&_0x2ba40f)console[_0x2cc1ca(0x360)](_0x2cc1ca(0x2f9)+_0x356f50+'.'+_0x2ba40f);else _0x356f50?console[_0x2cc1ca(0x360)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x356f50):console['log'](_0x2cc1ca(0x3b0));}else{const _0xad9c8f=_0x5c5bde[_0x2cc1ca(0x311)],_0xfb92f0=this[_0x2cc1ca(0x280)](_0x475115,_0xad9c8f);_0x5c5bde[_0x2cc1ca(0x292)]?await writeOutput(_0xfb92f0,_0x5c5bde['output'],'list'):console[_0x2cc1ca(0x360)](_0xfb92f0);}!_0x356f50&&(console[_0x2cc1ca(0x30d)](''),console[_0x2cc1ca(0x30d)](a54_0x238b4f[_0x2cc1ca(0x373)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console['error'](a54_0x238b4f['dim'](_0x2cc1ca(0x351))+'or'+a54_0x238b4f[_0x2cc1ca(0x373)](_0x2cc1ca(0x2f7))));}else{if(_0x475115[_0x2cc1ca(0x33b)]===0x0){if(_0x356f50&&_0x2ba40f)console[_0x2cc1ca(0x360)]('No\x20sessions\x20found\x20for:\x20'+_0x356f50+'.'+_0x2ba40f);else _0x356f50?console['log'](_0x2cc1ca(0x2be)+_0x356f50):console['log'](_0x2cc1ca(0x3b0));}else await this[_0x2cc1ca(0x36c)](_0x475115,_0x75737,_0x356f50);}}return 0x0;}['renderSessionsTimeline'](_0x5d1b3a,_0x5b23e2){const _0x2d5362=a54_0xb298fb,_0x1dfb81=[],_0x1509b3=new Map();let _0x28e8b4=Infinity,_0x33d00c=-Infinity;for(const _0x3177a3 of _0x5d1b3a){if(_0x3177a3[_0x2d5362(0x266)]?.[_0x2d5362(0x217)]){const _0x21bcfb=new Date(_0x3177a3['lastAttempt'][_0x2d5362(0x217)])[_0x2d5362(0x3a4)](),_0x2be63d=_0x3177a3['lastAttempt'][_0x2d5362(0x227)]?new Date(_0x3177a3[_0x2d5362(0x266)]['finishedAt'])['getTime']():Date['now'](),_0x137575=_0x3177a3[_0x2d5362(0x1f5)]?.['name']||'(unknown)';!_0x1509b3['has'](_0x137575)&&_0x1509b3['set'](_0x137575,[]),_0x1509b3['get'](_0x137575)['push']({'session':_0x3177a3,'startTime':_0x21bcfb,'endTime':_0x2be63d,'duration':_0x2be63d-_0x21bcfb}),_0x28e8b4=Math['min'](_0x28e8b4,_0x21bcfb),_0x33d00c=Math[_0x2d5362(0x23d)](_0x33d00c,_0x2be63d);}}if(_0x1509b3['size']===0x0)return _0x2d5362(0x29c);const _0x196d15=process[_0x2d5362(0x296)][_0x2d5362(0x326)]||0x78,_0x445aac=0x1e,_0x4c3130=0x32,_0x41e43e=0x4,_0x547f61=Math['min'](_0x4c3130,Math[_0x2d5362(0x23d)](_0x445aac,Math['floor'](_0x196d15*0.3))),_0x191915=_0x196d15-_0x547f61-TIMELINE_CONFIG[_0x2d5362(0x248)]-0x3-_0x41e43e,_0x4cf679=_0x33d00c-_0x28e8b4,_0x343748=_0x4cf679/_0x547f61,_0x29cc43=renderTimeAxis({'startTime':_0x28e8b4,'endTime':_0x33d00c,'durationMs':_0x4cf679,'msPerChar':_0x343748},_0x547f61),_0x56ab59=[];for(const _0x185e35 of _0x1509b3[_0x2d5362(0x2c4)]()){_0x56ab59[_0x2d5362(0x2c7)](..._0x185e35);}_0x56ab59[_0x2d5362(0x270)]((_0x20458a,_0x5c6893)=>_0x5c6893[_0x2d5362(0x223)]-_0x20458a['startTime']);const _0x4ed24c=new Date(_0x28e8b4),_0x35073f=formatDate(_0x4ed24c),_0x523908=_0x41e43e+TIMELINE_CONFIG[_0x2d5362(0x2d3)]+TIMELINE_CONFIG[_0x2d5362(0x2f0)]+_0x191915,_0x473903='\x20'['repeat'](_0x523908-_0x35073f['length']),_0x1ea375=_0x473903+a54_0x238b4f[_0x2d5362(0x373)](_0x35073f)+'\x20'+_0x29cc43;_0x1dfb81[_0x2d5362(0x2c7)](_0x1ea375);const _0xa2a723=0x16;let _0x3b9deb=0x0;for(const _0x5da6b2 of _0x56ab59){const _0xf48747=_0x5da6b2['session'][_0x2d5362(0x1f5)]?.[_0x2d5362(0x2f3)]||'?',_0x2798ca=Math[_0x2d5362(0x27d)](stringWidth(_0xf48747),_0xa2a723);_0x3b9deb=Math[_0x2d5362(0x23d)](_0x3b9deb,_0x2798ca);}for(const _0x221380 of _0x56ab59){const {session:_0x244a2e,startTime:_0x2853ee,endTime:_0x475f00,duration:_0x2314b1}=_0x221380,_0x185524=_0x244a2e[_0x2d5362(0x1f5)]?.['id'],_0x5f4f80=_0x244a2e['id'],_0x244703=_0x244a2e['project']?.[_0x2d5362(0x2f3)]||'?',_0xc67da4=_0x244a2e['workflow']?.[_0x2d5362(0x2f3)]||'?';let _0x44ec52,_0x2c0d8f;if(_0x244a2e[_0x2d5362(0x266)]){const _0x3bd448=_0x244a2e[_0x2d5362(0x266)];!_0x3bd448['done']?(_0x44ec52=_0x3bd448['cancelRequested']?'🛑':'🔄',_0x2c0d8f=_0x3bd448[_0x2d5362(0x379)]?a54_0x238b4f[_0x2d5362(0x344)]:a54_0x238b4f['blue']):(_0x44ec52=_0x3bd448[_0x2d5362(0x2d2)]?'✅':'❌',_0x2c0d8f=_0x3bd448['success']?a54_0x238b4f[_0x2d5362(0x23e)]:a54_0x238b4f[_0x2d5362(0x301)]);}else _0x44ec52='⏳',_0x2c0d8f=a54_0x238b4f['dim'];const _0x44ee7e='#'+_0x5f4f80,_0x16e1a0=_0x185524?hyperlink(_0x44ee7e,getWorkflowSessionUrl(_0x5b23e2,_0x185524,_0x5f4f80)):_0x44ee7e;let _0x58a2aa=_0x244703;stringWidth(_0x244703)>_0xa2a723&&(_0x58a2aa=_0x244703[_0x2d5362(0x258)](0x0,_0xa2a723-0x1)+'…');const _0x2eaed2=a54_0x238b4f[_0x2d5362(0x373)](_0x58a2aa),_0x18c48d=stringWidth(_0x58a2aa),_0x5b7999='\x20'[_0x2d5362(0x21a)](_0x3b9deb-stringWidth(_0x58a2aa)+0x2),_0x5d50b9='('+formatElapsed(_0x2314b1)+')',_0x465909=stringWidth(_0x5d50b9),_0x396d32=stringWidth(_0x44ee7e),_0x4213c8=_0x396d32+0x1+_0x18c48d+_0x5b7999[_0x2d5362(0x33b)],_0x1782a2=_0x191915-_0x4213c8-_0x465909-0x1-0x8;let _0x192fd0=_0xc67da4;stringWidth(_0x192fd0)>_0x1782a2&&(_0x192fd0=_0x192fd0[_0x2d5362(0x258)](0x0,_0x1782a2-0x1)+'…');const _0x3c990e=_0x16e1a0+'\x20'+_0x2eaed2+_0x5b7999+_0x192fd0,_0x43df7e=stringWidth(_0x3c990e),_0xd6f749=_0x191915-_0x43df7e-_0x465909,_0x44ec27=_0x3c990e+'\x20'['repeat'](Math[_0x2d5362(0x23d)](0x1,_0xd6f749))+a54_0x238b4f[_0x2d5362(0x373)](_0x5d50b9),_0x4bf132=Math[_0x2d5362(0x332)]((_0x2853ee-_0x28e8b4)/_0x343748),_0x3cb0dd=Math[_0x2d5362(0x332)]((_0x475f00-_0x28e8b4)/_0x343748),_0x5cc26d=Math['max'](_0x4bf132+0x1,_0x3cb0dd),_0x11d4a5=new Array(_0x547f61)[_0x2d5362(0x286)]('\x20');for(let _0x148500=_0x4bf132;_0x148500<Math[_0x2d5362(0x27d)](_0x5cc26d,_0x547f61);_0x148500++){_0x11d4a5[_0x148500]='─';}const _0x5e667b=_0x11d4a5[_0x2d5362(0x298)](_0x11bf4f=>_0x11bf4f==='\x20'?'\x20':_0x2c0d8f(_0x11bf4f))[_0x2d5362(0x29a)]('');_0x1dfb81[_0x2d5362(0x2c7)](_0x44ec52+'\x20'+_0x44ec27+'│'+_0x5e667b+'│');}return _0x1dfb81[_0x2d5362(0x29a)]('\x0a');}async['navigateSessionsInteractive'](_0x1d5423,_0x11eed9,_0x3c7301){const _0x280cf0=a54_0xb298fb,{options:_0x24fc4e,tdx:_0x1f6e80}=_0x11eed9,_0x1a1970=_0x24fc4e[_0x280cf0(0x311)],{timelineRows:_0x34f978,timeAxisHeader:_0x2317db}=this[_0x280cf0(0x3af)](_0x1d5423,_0x1a1970),_0x33f117=_0x34f978[_0x280cf0(0x281)](_0x3a3a42=>_0x3a3a42[_0x280cf0(0x2b7)]);if(_0x33f117[_0x280cf0(0x33b)]===0x0){const _0x15f6dd=this['renderSessionsTimeline'](_0x1d5423,_0x1a1970);console['log'](_0x15f6dd);!_0x3c7301&&(console[_0x280cf0(0x30d)](''),console[_0x280cf0(0x30d)](a54_0x238b4f[_0x280cf0(0x373)](_0x280cf0(0x25c))),console['error'](a54_0x238b4f[_0x280cf0(0x373)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a54_0x238b4f[_0x280cf0(0x373)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0x2317db&&console[_0x280cf0(0x360)](_0x2317db);const _0xa3dad7=_0x34f978[_0x280cf0(0x281)](_0x583538=>_0x583538['attemptId'])[_0x280cf0(0x298)](_0x95364b=>({'title':_0x95364b[_0x280cf0(0x348)],'value':_0x95364b[_0x280cf0(0x2b7)]})),_0x3c3f26=process[_0x280cf0(0x296)][_0x280cf0(0x278)]||0x3c,_0x2fe3bf=Math[_0x280cf0(0x23d)](0x28,Math['floor'](_0x3c3f26*0x2/0x3)),_0x40ad5e=await a54_0x206969({'type':_0x280cf0(0x272),'name':_0x280cf0(0x2b7),'message':_0x280cf0(0x221),'choices':_0xa3dad7,'initial':-0x1,'limit':_0x2fe3bf,'clearFirst':!![],'fallback':{'title':_0x280cf0(0x3a2),'value':null},'suggest':(_0x54be6b,_0x1d8075)=>{const _0x4d016a=_0x280cf0;if(!_0x54be6b)return Promise[_0x4d016a(0x1fa)](_0x1d8075);const _0x566b58=_0x1d8075[_0x4d016a(0x281)](_0x330485=>{const _0x3e34c4=_0x4d016a,_0x597a0d=_0x330485;return _0x597a0d[_0x3e34c4(0x2e8)]['toLowerCase']()['includes'](_0x54be6b[_0x3e34c4(0x2f4)]());});return Promise['resolve'](_0x566b58);}}),_0x5396d2=()=>{const _0xa302a0=_0x280cf0;process[_0xa302a0(0x296)]['write']('\x1b[1A\x1b[2K'),process[_0xa302a0(0x296)][_0xa302a0(0x1f0)](_0xa302a0(0x244)),process[_0xa302a0(0x296)]['write']('\x1b[1A\x1b[2K');},_0xd083d8=_0x40ad5e&&_0x40ad5e[_0x280cf0(0x2b7)]&&_0x40ad5e[_0x280cf0(0x2b7)]!==null&&_0x40ad5e['attemptId']['trim']()!=='';if(!_0xd083d8){_0x5396d2(),console[_0x280cf0(0x360)](a54_0x238b4f[_0x280cf0(0x373)](_0x280cf0(0x30e)));return;}_0x5396d2();const _0x196657=_0x1d5423[_0x280cf0(0x2fd)](_0x585e8f=>_0x585e8f[_0x280cf0(0x266)]?.['id']===_0x40ad5e[_0x280cf0(0x2b7)]);if(_0x196657){const _0xc1b553=_0x196657[_0x280cf0(0x1f5)]?.[_0x280cf0(0x2f3)]||'?',_0x4e931e=_0x196657[_0x280cf0(0x2e9)]?.[_0x280cf0(0x2f3)]||'?';console[_0x280cf0(0x360)](_0x280cf0(0x24b)+a54_0x238b4f['dim'](_0xc1b553)+_0x280cf0(0x1ee)+a54_0x238b4f[_0x280cf0(0x373)](_0x4e931e));}const _0x93b4dc=new WorkflowTimelineCommand();await _0x93b4dc['execute']({'args':[],'options':{..._0x24fc4e,'attemptId':_0x40ad5e[_0x280cf0(0x2b7)]},'tdx':_0x1f6e80});}[a54_0xb298fb(0x3af)](_0x13743e,_0x168ceb){const _0x43e64f=a54_0xb298fb,_0x4afad6=new Map();for(const _0x2e8a96 of _0x13743e){_0x2e8a96['id']&&_0x2e8a96[_0x43e64f(0x266)]?.['id']&&_0x4afad6['set'](_0x2e8a96['id'],_0x2e8a96[_0x43e64f(0x266)]['id']);}const _0x598546=[];let _0x458ebc='';const _0x1055d2=this[_0x43e64f(0x280)](_0x13743e,_0x168ceb),_0x3004b1=_0x1055d2[_0x43e64f(0x2ee)]('\x0a');for(const _0x34c738 of _0x3004b1){if(_0x34c738['startsWith']('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x34c738[_0x43e64f(0x37f)](/^\s+\d{4}-\d{2}-\d{2}/))_0x458ebc=_0x34c738;else{if(_0x34c738[_0x43e64f(0x37f)](/^[✅❌🔄🛑⏳]/)){const _0xef5b3d=_0x34c738[_0x43e64f(0x37f)](/#(\d+)/),_0x6739cd=_0xef5b3d?_0xef5b3d[0x1]:null,_0x4cdc47=_0x6739cd?_0x4afad6[_0x43e64f(0x378)](_0x6739cd)||null:null,_0x2e6889=_0x13743e[_0x43e64f(0x2fd)](_0x400960=>_0x400960['id']===_0x6739cd),_0x538ab7=_0x2e6889?.[_0x43e64f(0x1f5)]?.[_0x43e64f(0x2f3)]||'';_0x598546[_0x43e64f(0x2c7)]({'displayLine':_0x34c738,'attemptId':_0x4cdc47,'projectName':_0x538ab7});}}}return{'timelineRows':_0x598546,'timeAxisHeader':_0x458ebc};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']=a54_0xb298fb(0x381);[a54_0xb298fb(0x346)]=a54_0xb298fb(0x334);async[a54_0xb298fb(0x335)](_0x106181){const _0x123e12=a54_0xb298fb,{options:_0x6f9ff3,args:_0x4d8349,tdx:_0x4d90a9}=_0x106181,_0x305bce=this[_0x123e12(0x31c)](_0x4d8349,_0x6f9ff3);if(!_0x305bce)return 0x1;const {projectName:_0x2e9668,workflowName:_0x317af0}=_0x305bce,_0x2602b2=_0x6f9ff3[_0x123e12(0x308)];if(_0x6f9ff3[_0x123e12(0x31d)]){if(_0x2e9668&&_0x317af0)console['error']('Filter:\x20'+_0x2e9668+'.'+_0x317af0);else _0x2e9668&&console['error'](_0x123e12(0x284)+_0x2e9668);_0x2602b2&&console['error']('Include\x20retried:\x20yes');}const _0x1cc6ab=await withSpinner(_0x123e12(0x319),()=>_0x4d90a9[_0x123e12(0x2e9)][_0x123e12(0x368)]({'projectName':_0x2e9668,'workflowName':_0x317af0,'includeRetried':_0x2602b2,'limit':_0x6f9ff3[_0x123e12(0x3ab)]}),{'verbose':_0x6f9ff3[_0x123e12(0x31d)]}),_0x461c87=_0x1cc6ab[_0x123e12(0x364)],_0x54ce33=_0x6f9ff3[_0x123e12(0x3ab)]||0x64,_0x164889=_0x461c87['length']>=_0x54ce33?a54_0x238b4f[_0x123e12(0x373)](_0x123e12(0x277)):'';console[_0x123e12(0x30d)](_0x123e12(0x275)+_0x461c87['length']+_0x123e12(0x27e)+(_0x461c87[_0x123e12(0x33b)]!==0x1?'s':'')+_0x164889);if(_0x6f9ff3[_0x123e12(0x2b6)]===_0x123e12(0x366)||_0x6f9ff3[_0x123e12(0x2b6)]==='jsonl'||_0x6f9ff3[_0x123e12(0x2b6)]===_0x123e12(0x340))await handleSDKOutput(_0x461c87,_0x6f9ff3);else{if(_0x461c87[_0x123e12(0x33b)]===0x0){if(_0x2e9668&&_0x317af0)console[_0x123e12(0x360)](_0x123e12(0x219)+_0x2e9668+'.'+_0x317af0);else _0x2e9668?console[_0x123e12(0x360)]('No\x20attempts\x20found\x20in\x20project:\x20'+_0x2e9668):console['log'](_0x123e12(0x201));}else{const _0x21ff18=_0x6f9ff3['site'],_0xf17b27=_0x461c87[_0x123e12(0x298)](_0x288a71=>{const _0x3efe48=_0x123e12,_0x2b44e8=a54_0x238b4f[_0x3efe48(0x373)]('#'+_0x288a71['id']),_0x3412f6=_0x288a71[_0x3efe48(0x1f5)]?.['id'],_0xb13cdc=_0x288a71[_0x3efe48(0x310)]||_0x288a71[_0x3efe48(0x2ca)],_0x5802d7=_0x3412f6&&_0xb13cdc?hyperlink(_0x2b44e8,getWorkflowAttemptUrl(_0x21ff18,_0x3412f6,_0xb13cdc,_0x288a71['id'])):_0x2b44e8,{icon:_0x20fe71,text:_0x155f0e}=getAttemptStatusDisplay(_0x288a71),_0x33f536=(_0x288a71[_0x3efe48(0x1f5)]?.['name']||'?')+'.'+(_0x288a71[_0x3efe48(0x2e9)]?.['name']||'?'),_0x8ea03=_0x288a71[_0x3efe48(0x230)]?a54_0x238b4f[_0x3efe48(0x373)](_0x288a71['sessionTime']):'';return(_0x5802d7+'\x20'+_0x20fe71+(_0x155f0e?'\x20'+_0x155f0e:'')+'\x20'+_0x33f536+'\x20'+_0x8ea03)[_0x3efe48(0x2ff)]();});await writeOutput(_0xf17b27['join']('\x0a'),_0x6f9ff3['output'],_0x123e12(0x209));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0xb298fb(0x2f3)]='workflow:attempt';[a54_0xb298fb(0x346)]=a54_0xb298fb(0x386);async[a54_0xb298fb(0x335)](_0x642f62){const _0x2a7cc2=a54_0xb298fb,{options:_0x145479,args:_0x50d6fa,tdx:_0x21ab0f}=_0x642f62,_0x4d2fa6=_0x50d6fa[0x0];if(!_0x4d2fa6)return console[_0x2a7cc2(0x30d)](_0x2a7cc2(0x24d)),0x1;_0x145479['verbose']&&console[_0x2a7cc2(0x30d)](_0x2a7cc2(0x333)+_0x4d2fa6);const _0x674ad3=await withSpinner('Getting\x20attempt\x20details...',()=>_0x21ab0f[_0x2a7cc2(0x2e9)][_0x2a7cc2(0x328)](_0x4d2fa6),{'verbose':_0x145479['verbose']}),_0x1d30c3=_0x674ad3[_0x2a7cc2(0x364)];let _0x4a107b;!_0x1d30c3[_0x2a7cc2(0x234)]?_0x4a107b=_0x1d30c3['cancelRequested']?_0x2a7cc2(0x203):_0x2a7cc2(0x20a):_0x4a107b=_0x1d30c3[_0x2a7cc2(0x2d2)]?_0x2a7cc2(0x2d2):_0x2a7cc2(0x30d);let _0x430818;if(_0x1d30c3['createdAt']&&_0x1d30c3[_0x2a7cc2(0x227)]){const _0x565f33=new Date(_0x1d30c3[_0x2a7cc2(0x217)])[_0x2a7cc2(0x3a4)](),_0x2629ff=new Date(_0x1d30c3['finishedAt'])[_0x2a7cc2(0x3a4)]();_0x430818=Math[_0x2a7cc2(0x358)]((_0x2629ff-_0x565f33)/0x3e8);}const _0x456e0f={'attempt_id':_0x1d30c3['id'],'status':_0x4a107b,..._0x1d30c3[_0x2a7cc2(0x288)]!==undefined&&{'index':_0x1d30c3[_0x2a7cc2(0x288)]},..._0x1d30c3[_0x2a7cc2(0x1f5)]&&{'project':_0x1d30c3[_0x2a7cc2(0x1f5)][_0x2a7cc2(0x2f3)]},..._0x1d30c3[_0x2a7cc2(0x2e9)]&&{'workflow':_0x1d30c3['workflow']['name']},..._0x1d30c3['sessionId']&&{'session_id':_0x1d30c3[_0x2a7cc2(0x2ca)]},..._0x1d30c3[_0x2a7cc2(0x230)]&&{'session_time':_0x1d30c3[_0x2a7cc2(0x230)]},..._0x1d30c3['retryAttemptName']&&{'retry_attempt':_0x1d30c3[_0x2a7cc2(0x26f)]},..._0x430818!==undefined&&{'duration_sec':_0x430818},..._0x1d30c3[_0x2a7cc2(0x217)]&&{'created_at':_0x1d30c3[_0x2a7cc2(0x217)]},..._0x1d30c3[_0x2a7cc2(0x227)]&&{'finished_at':_0x1d30c3['finishedAt']},...Object[_0x2a7cc2(0x39f)](_0x1d30c3[_0x2a7cc2(0x30c)])[_0x2a7cc2(0x33b)]>0x0&&{'params':_0x1d30c3[_0x2a7cc2(0x30c)]}};return await handleSingleObjectOutput(_0x456e0f,_0x145479),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a54_0xb298fb(0x2f3)]=a54_0xb298fb(0x27f);['description']=a54_0xb298fb(0x1fc);async[a54_0xb298fb(0x335)](_0x1d42f8){const _0x46f413=a54_0xb298fb,{options:_0xd51279,args:_0x3b7d19,tdx:_0x472333}=_0x1d42f8,_0x284a5c=_0x3b7d19[0x0];if(!_0x284a5c)return console[_0x46f413(0x30d)](_0x46f413(0x24d)),0x1;const _0x5ce814=_0xd51279[_0x46f413(0x238)];_0xd51279['verbose']&&(console[_0x46f413(0x30d)](_0x46f413(0x333)+_0x284a5c),_0x5ce814&&console[_0x46f413(0x30d)](_0x46f413(0x2a4)));const _0x59b4d8=await withSpinner(_0x46f413(0x307),()=>_0x472333[_0x46f413(0x2e9)][_0x46f413(0x2a9)](_0x284a5c,_0x5ce814||![]),{'verbose':_0xd51279[_0x46f413(0x31d)]}),_0x9f80c1=_0x59b4d8[_0x46f413(0x364)];return console['error'](_0x46f413(0x275)+_0x9f80c1[_0x46f413(0x33b)]+_0x46f413(0x22d)+(_0x9f80c1['length']!==0x1?'s':'')),await handleSDKOutput(_0x9f80c1,_0xd51279),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0xb298fb(0x2f3)]=a54_0xb298fb(0x36b);[a54_0xb298fb(0x346)]=a54_0xb298fb(0x25d);async['execute'](_0x1e6ef3){const _0xf49420=a54_0xb298fb,{options:_0x55719,args:_0x35cd87,tdx:_0x1684ec}=_0x1e6ef3,_0x49da90=_0x35cd87[0x0];let _0x46cb86=_0x35cd87[0x1];if(!_0x49da90)return console[_0xf49420(0x30d)](_0xf49420(0x24d)),0x1;_0x55719['verbose']&&(console[_0xf49420(0x30d)](_0xf49420(0x333)+_0x49da90),_0x46cb86&&console['error'](_0xf49420(0x2b0)+_0x46cb86));const _0x3afc38=await withSpinner(_0xf49420(0x2a8),()=>_0x1684ec[_0xf49420(0x2e9)][_0xf49420(0x3a9)](_0x49da90,_0x46cb86),{'verbose':_0x55719[_0xf49420(0x31d)]}),_0x35a912=_0x3afc38[_0xf49420(0x364)];if(_0x35a912[_0xf49420(0x33b)]===0x0)return console[_0xf49420(0x30d)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x46cb86&&(_0x55719[_0xf49420(0x366)]||_0x55719[_0xf49420(0x2b6)]))return await handleSDKOutput(_0x35a912,_0x55719),0x0;if(!_0x46cb86){const _0xa81465=_0x35a912[_0xf49420(0x298)](_0x4c7cab=>({'title':_0x4c7cab[_0xf49420(0x255)]+'\x20('+formatBytes(_0x4c7cab[_0xf49420(0x2b2)])+')','value':_0x4c7cab[_0xf49420(0x255)]})),_0x57e979=await a54_0x206969({'type':'select','name':_0xf49420(0x331),'message':_0xf49420(0x23f),'choices':_0xa81465});if(!_0x57e979['task'])return console[_0xf49420(0x30d)](_0xf49420(0x30e)),0x0;_0x46cb86=_0x57e979[_0xf49420(0x331)];}const _0x43eb49=await withSpinner(_0xf49420(0x28f),()=>_0x1684ec[_0xf49420(0x2e9)]['logs'](_0x49da90,_0x46cb86),{'verbose':_0x55719[_0xf49420(0x31d)]}),_0x333d23=_0x43eb49[_0xf49420(0x364)];return _0x333d23?console[_0xf49420(0x360)](_0x333d23):console['error'](_0xf49420(0x320)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0xb298fb(0x2f3)]=a54_0xb298fb(0x2c6);[a54_0xb298fb(0x346)]=a54_0xb298fb(0x1f3);async[a54_0xb298fb(0x335)](_0x3b8d66){const _0x377818=a54_0xb298fb,{options:_0x16bb44,args:_0x17ddab,tdx:_0x6a6b9f}=_0x3b8d66,_0x13cfe9=_0x17ddab[0x0];if(!_0x13cfe9)return console[_0x377818(0x30d)](_0x377818(0x24d)),0x1;const _0x5c489d=_0x16bb44['reason'];_0x16bb44[_0x377818(0x31d)]&&(console[_0x377818(0x30d)]('Attempt\x20ID:\x20'+_0x13cfe9),_0x5c489d&&console['error'](_0x377818(0x1f4)+_0x5c489d));if(!_0x16bb44['yes']){if(!isInteractive())return console[_0x377818(0x30d)](a54_0x238b4f[_0x377818(0x301)](_0x377818(0x343)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x377818(0x30d)](a54_0x238b4f[_0x377818(0x373)](_0x377818(0x1f6))),0x1;const _0x7f9587=await confirmKey(_0x377818(0x38c)+_0x13cfe9+'?');if(!_0x7f9587)return console[_0x377818(0x30d)](a54_0x238b4f['yellow']('Cancelled')),0x1;}const _0x1aec53=await withSpinner(_0x377818(0x257),()=>_0x6a6b9f['workflow']['kill'](_0x13cfe9,_0x5c489d),{'verbose':_0x16bb44[_0x377818(0x31d)]}),_0x322a0f=_0x1aec53[_0x377818(0x364)];return console[_0x377818(0x30d)]('✔\x20'+_0x322a0f),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0xb298fb(0x2f3)]=a54_0xb298fb(0x27b);[a54_0xb298fb(0x346)]='Retry\x20a\x20session\x20or\x20attempt';async['execute'](_0x10fc8d){const _0x4cb303=a54_0xb298fb,{options:_0x296a79,args:_0x5c114b,tdx:_0x3e98c9}=_0x10fc8d,_0x15b86f=_0x5c114b[0x0];if(!_0x15b86f)return console[_0x4cb303(0x30d)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x4cb303(0x30d)](_0x4cb303(0x2f6)),0x1;let _0x3a6516=![],_0x21c52d=_0x15b86f;if(_0x15b86f[_0x4cb303(0x30a)](_0x4cb303(0x28d)))_0x3a6516=!![],_0x21c52d=_0x15b86f[_0x4cb303(0x291)](0x8);else{if(_0x15b86f[_0x4cb303(0x30a)](_0x4cb303(0x1f9)))_0x3a6516=![],_0x21c52d=_0x15b86f[_0x4cb303(0x291)](0x8);else return console[_0x4cb303(0x30d)](_0x4cb303(0x226)),console[_0x4cb303(0x30d)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x1a381a=_0x296a79[_0x4cb303(0x2bf)],_0x584b1d=_0x296a79[_0x4cb303(0x2b8)],_0x5ac5a6=_0x296a79[_0x4cb303(0x30c)],_0x48137b=_0x296a79[_0x4cb303(0x207)];_0x296a79['verbose']&&(console[_0x4cb303(0x30d)](_0x4cb303(0x2de)+(_0x3a6516?_0x4cb303(0x38b):_0x4cb303(0x328))+'\x20'+_0x21c52d),_0x1a381a&&console['error']('From\x20task:\x20'+_0x1a381a),_0x584b1d&&console['error']('Resume\x20from:\x20'+_0x584b1d),_0x5ac5a6&&console[_0x4cb303(0x30d)](_0x4cb303(0x2f2)+_0x5ac5a6),_0x48137b&&console['error'](_0x4cb303(0x32e)));let _0x3cb124;if(_0x5ac5a6)try{if(_0x5ac5a6[_0x4cb303(0x30a)]('@')){const _0x2226bb=await import(_0x4cb303(0x3ac)),_0xf8eac2=_0x5ac5a6['substring'](0x1),_0x30e6ae=await _0x2226bb[_0x4cb303(0x374)](_0xf8eac2,_0x4cb303(0x2fb));_0x3cb124=JSON[_0x4cb303(0x1e9)](_0x30e6ae);}else _0x3cb124=JSON['parse'](_0x5ac5a6);}catch{return console[_0x4cb303(0x30d)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x296a79[_0x4cb303(0x30b)]){if(!isInteractive())return console['error'](a54_0x238b4f[_0x4cb303(0x301)](_0x4cb303(0x343)),_0x4cb303(0x2e2)),console[_0x4cb303(0x30d)](a54_0x238b4f['dim'](_0x4cb303(0x1f6))),0x1;const _0x5bd351=await confirmKey(_0x4cb303(0x261)+(_0x3a6516?_0x4cb303(0x38b):'attempt')+'\x20'+_0x21c52d+'?');if(!_0x5bd351)return console[_0x4cb303(0x30d)](a54_0x238b4f['yellow'](_0x4cb303(0x30e))),0x1;}let _0x1259bb;_0x3a6516?_0x1259bb=await withSpinner(_0x4cb303(0x392),()=>_0x3e98c9['workflow'][_0x4cb303(0x2e5)](_0x21c52d,{'fromTask':_0x1a381a,'retryParams':_0x3cb124}),{'verbose':_0x296a79[_0x4cb303(0x31d)]}):_0x1259bb=await withSpinner(_0x4cb303(0x304),()=>_0x3e98c9['workflow'][_0x4cb303(0x349)](_0x21c52d,{'resumeFrom':_0x584b1d,'retryParams':_0x3cb124,'force':_0x48137b}),{'verbose':_0x296a79[_0x4cb303(0x31d)]});const _0xc3d55c=_0x1259bb[_0x4cb303(0x364)];return console[_0x4cb303(0x30d)](_0x4cb303(0x37c)),console['error'](_0x4cb303(0x23a)+_0xc3d55c['attemptId']),console['error'](_0x4cb303(0x20d)+_0xc3d55c[_0x4cb303(0x2ca)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a54_0xb298fb(0x2ea);['description']=a54_0xb298fb(0x34a);async[a54_0xb298fb(0x335)](_0xe7c7dd){const _0x5bc3be=a54_0xb298fb,{options:_0x4f293d,args:_0x4f523e,tdx:_0x4a030c}=_0xe7c7dd;let _0x5a4b1e=_0x4f523e[0x0];if(!_0x5a4b1e){const _0x3c8fee=this[_0x5bc3be(0x2e6)]([],_0x4f293d),_0x3189ea=await withSpinner('Loading\x20workflows...',()=>_0x4a030c[_0x5bc3be(0x2e9)][_0x5bc3be(0x267)](_0x3c8fee,{'limit':_0x4f293d[_0x5bc3be(0x3ab)]}),{'verbose':_0x4f293d[_0x5bc3be(0x31d)]}),_0x36bcad=_0x3189ea[_0x5bc3be(0x364)];if(_0x36bcad[_0x5bc3be(0x33b)]===0x0)return console['error']('No\x20workflows\x20found'),!_0x3c8fee&&console[_0x5bc3be(0x30d)](a54_0x238b4f['dim'](_0x5bc3be(0x2ab))),0x1;const _0x5803a6=_0x36bcad[_0x5bc3be(0x298)](_0x2cbf69=>({'title':_0x2cbf69['project']?.[_0x5bc3be(0x2f3)]+'.'+_0x2cbf69[_0x5bc3be(0x2f3)],'value':_0x2cbf69[_0x5bc3be(0x1f5)]?.[_0x5bc3be(0x2f3)]+'.'+_0x2cbf69[_0x5bc3be(0x2f3)],'description':_0x2cbf69[_0x5bc3be(0x2c3)]?_0x5bc3be(0x297)+_0x2cbf69[_0x5bc3be(0x2c3)]:undefined})),_0x1778bb=await a54_0x206969({'type':_0x5bc3be(0x29f),'name':_0x5bc3be(0x2e9),'message':_0x5bc3be(0x354),'choices':_0x5803a6});if(!_0x1778bb[_0x5bc3be(0x2e9)])return 0x1;_0x5a4b1e=_0x1778bb[_0x5bc3be(0x2e9)];}if(!_0x5a4b1e[_0x5bc3be(0x388)]('.')){const _0x4d5df9=this[_0x5bc3be(0x2e6)]([],_0x4f293d);if(_0x4d5df9)_0x5a4b1e=_0x4d5df9+'.'+_0x5a4b1e;else return console[_0x5bc3be(0x30d)](a54_0x238b4f[_0x5bc3be(0x301)]('Error:'),_0x5bc3be(0x1fd)),console['error'](a54_0x238b4f[_0x5bc3be(0x373)](_0x5bc3be(0x2ab))),0x1;}const _0x419652=_0x4f293d[_0x5bc3be(0x34b)],_0x21e5e2=_0x4f293d[_0x5bc3be(0x230)],_0x156fba={};if(_0x419652&&Array[_0x5bc3be(0x2a2)](_0x419652))for(const _0x16ff79 of _0x419652){const _0x2e5159=_0x16ff79['indexOf']('=');if(_0x2e5159===-0x1)return console[_0x5bc3be(0x30d)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x16ff79),console[_0x5bc3be(0x30d)](_0x5bc3be(0x31a)),0x1;const _0x34a48e=_0x16ff79['substring'](0x0,_0x2e5159),_0x3dbf0f=_0x16ff79[_0x5bc3be(0x291)](_0x2e5159+0x1);try{_0x156fba[_0x34a48e]=JSON[_0x5bc3be(0x1e9)](_0x3dbf0f);}catch{_0x156fba[_0x34a48e]=_0x3dbf0f;}}_0x4f293d[_0x5bc3be(0x31d)]&&(console['error'](_0x5bc3be(0x37d)+_0x5a4b1e),Object[_0x5bc3be(0x39f)](_0x156fba)[_0x5bc3be(0x33b)]>0x0&&console[_0x5bc3be(0x30d)](_0x5bc3be(0x2a0)+JSON[_0x5bc3be(0x22b)](_0x156fba)),_0x21e5e2&&console[_0x5bc3be(0x30d)](_0x5bc3be(0x2dd)+_0x21e5e2));const _0x38dad0=await withSpinner('Starting\x20workflow\x20run...',()=>_0x4a030c[_0x5bc3be(0x2e9)][_0x5bc3be(0x32f)](_0x5a4b1e,_0x156fba,{'sessionTime':_0x21e5e2}),{'verbose':_0x4f293d['verbose']}),_0x3d8120=_0x38dad0[_0x5bc3be(0x364)];console[_0x5bc3be(0x30d)](_0x5bc3be(0x28e)),console[_0x5bc3be(0x30d)](_0x5bc3be(0x21e)+_0x3d8120['id']),console[_0x5bc3be(0x30d)](_0x5bc3be(0x20d)+_0x3d8120['sessionId']),console[_0x5bc3be(0x30d)](_0x5bc3be(0x271)+_0x3d8120[_0x5bc3be(0x1f5)]?.[_0x5bc3be(0x2f3)]),console[_0x5bc3be(0x30d)](_0x5bc3be(0x37a)+_0x3d8120['workflow']?.[_0x5bc3be(0x2f3)]);if(_0x3d8120[_0x5bc3be(0x1f5)]?.['id']&&_0x3d8120[_0x5bc3be(0x2ca)]&&_0x3d8120['id']){const _0x2bc4c8=_0x4f293d['site'],_0x4ae436=getConsoleUrl(_0x2bc4c8,'/app/workflows/'+_0x3d8120['project']['id']+_0x5bc3be(0x2c2)+_0x3d8120[_0x5bc3be(0x2ca)]+_0x5bc3be(0x363)+_0x3d8120['id']);console[_0x5bc3be(0x30d)](_0x5bc3be(0x22c)+a54_0x238b4f[_0x5bc3be(0x228)](_0x4ae436));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a54_0xb298fb(0x2f3)]=a54_0xb298fb(0x302);['description']=a54_0xb298fb(0x303);async[a54_0xb298fb(0x335)](_0x573e73){const _0x248d5a=a54_0xb298fb,{options:_0x481dcf,args:_0x2bbbd3,tdx:_0x15da8c}=_0x573e73,_0x13aff6=_0x2bbbd3[0x0],_0x5f3765=_0x2bbbd3[0x1]||'.';if(!_0x13aff6)return console[_0x248d5a(0x30d)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x248d5a(0x30d)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x50a67e=_0x481dcf[_0x248d5a(0x2c3)];_0x481dcf[_0x248d5a(0x31d)]&&(console['error'](_0x248d5a(0x24b)+_0x13aff6),console['error'](_0x248d5a(0x2a1)+_0x5f3765),_0x50a67e&&console[_0x248d5a(0x30d)]('Revision:\x20'+_0x50a67e));const _0x52a5c4=await withSpinner('Downloading\x20project\x20'+_0x13aff6+_0x248d5a(0x3a6),()=>_0x15da8c['workflow'][_0x248d5a(0x22e)](_0x13aff6,_0x5f3765,{'revision':_0x50a67e}),{'verbose':_0x481dcf['verbose']}),_0x486d95=_0x52a5c4['data'];return console[_0x248d5a(0x30d)](_0x248d5a(0x214)+_0x486d95[_0x248d5a(0x352)]),console['error']('\x20\x20Revision:\x20'+_0x486d95[_0x248d5a(0x2c3)]),console[_0x248d5a(0x30d)](_0x248d5a(0x38d)+_0x486d95[_0x248d5a(0x24f)]),console[_0x248d5a(0x30d)]('\x20\x20Location:\x20'+_0x5f3765+'/'+_0x486d95[_0x248d5a(0x352)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0xb298fb(0x2f3)]=a54_0xb298fb(0x3ad);[a54_0xb298fb(0x346)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async[a54_0xb298fb(0x335)](_0x31a874){const _0x4df6c9=a54_0xb298fb,{options:_0x22f07a,args:_0x3ca4ea,tdx:_0x272f35}=_0x31a874;let _0x19641b='.',_0x461237=_0x22f07a[_0x4df6c9(0x2f3)];if(_0x3ca4ea[0x0]){const {promises:_0x29fbd7}=await import('fs');try{const _0x81eade=await _0x29fbd7[_0x4df6c9(0x318)](_0x3ca4ea[0x0]);if(_0x81eade['isDirectory']())_0x19641b=_0x3ca4ea[0x0];else return console[_0x4df6c9(0x30d)](_0x4df6c9(0x239)+_0x3ca4ea[0x0]+_0x4df6c9(0x26e)),0x1;}catch{_0x461237=_0x3ca4ea[0x0],_0x19641b='.';}}const _0x16fcf9=_0x22f07a[_0x4df6c9(0x2c3)],_0x3562a1=_0x22f07a[_0x4df6c9(0x365)];_0x22f07a[_0x4df6c9(0x31d)]&&(console['error']('Project\x20directory:\x20'+_0x19641b),_0x461237&&console['error'](_0x4df6c9(0x24e)+_0x461237),_0x16fcf9&&console['error'](_0x4df6c9(0x32b)+_0x16fcf9),_0x3562a1&&console[_0x4df6c9(0x30d)](_0x4df6c9(0x295)));const _0x3cc37f=await withSpinner(_0x4df6c9(0x20c),()=>_0x272f35['workflow']['push'](_0x19641b,{'projectName':_0x461237,'revision':_0x16fcf9,'skipValidation':_0x3562a1}),{'verbose':_0x22f07a[_0x4df6c9(0x31d)]}),_0x52e1d9=_0x3cc37f[_0x4df6c9(0x364)];return console[_0x4df6c9(0x30d)](_0x4df6c9(0x2d4)+_0x52e1d9['projectName']),console[_0x4df6c9(0x30d)](_0x4df6c9(0x350)+_0x52e1d9['projectId']),console[_0x4df6c9(0x30d)](_0x4df6c9(0x204)+_0x52e1d9[_0x4df6c9(0x2c3)]),await this[_0x4df6c9(0x317)](_0x272f35,_0x52e1d9[_0x4df6c9(0x352)],_0x22f07a[_0x4df6c9(0x311)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']=a54_0xb298fb(0x31b);['description']=a54_0xb298fb(0x35d);async[a54_0xb298fb(0x335)](_0x1d76b3){const _0x3fc718=a54_0xb298fb,{options:_0x2d52f9,args:_0x3ef490,tdx:_0x3bd061}=_0x1d76b3,_0x4c213a=_0x3ef490[0x0],_0x346876=_0x3ef490[0x1];if(!_0x4c213a)return console[_0x3fc718(0x30d)](a54_0x238b4f[_0x3fc718(0x301)](_0x3fc718(0x33f)),_0x3fc718(0x2ba)),console[_0x3fc718(0x30d)](a54_0x238b4f[_0x3fc718(0x373)](_0x3fc718(0x34c))),0x1;const _0x7f728=_0x2d52f9[_0x3fc718(0x2c3)];_0x2d52f9[_0x3fc718(0x31d)]&&(console[_0x3fc718(0x30d)]('Project:\x20'+_0x4c213a),_0x346876&&console[_0x3fc718(0x30d)](_0x3fc718(0x254)+_0x346876),_0x7f728&&console[_0x3fc718(0x30d)](_0x3fc718(0x32b)+_0x7f728),_0x2d52f9['dryRun']&&console[_0x3fc718(0x30d)](_0x3fc718(0x3a3)));const _0x5d5504=await withSpinner(_0x3fc718(0x395)+_0x4c213a+_0x3fc718(0x3a6),()=>_0x3bd061[_0x3fc718(0x2e9)][_0x3fc718(0x259)](_0x4c213a,{'targetDir':_0x346876,'revision':_0x7f728}),{'verbose':_0x2d52f9['verbose']}),_0x399711=_0x5d5504['data'];_0x399711[_0x3fc718(0x2cb)]?console[_0x3fc718(0x30d)]('→\x20New\x20project:\x20'+_0x399711[_0x3fc718(0x352)]):console[_0x3fc718(0x30d)](_0x3fc718(0x380)+_0x399711['projectName']);console['error']('\x20\x20Revision:\x20'+_0x399711[_0x3fc718(0x2c3)]),console[_0x3fc718(0x30d)](_0x3fc718(0x22a)+(a54_0x2f24e3[_0x3fc718(0x361)](process['cwd'](),_0x399711['targetDir'])||'.')),console[_0x3fc718(0x30d)]('\x20\x20Changes:\x20'+a54_0x238b4f[_0x3fc718(0x23e)]('+'+_0x399711[_0x3fc718(0x2ed)][_0x3fc718(0x1ef)]+_0x3fc718(0x237))+',\x20'+(a54_0x238b4f[_0x3fc718(0x344)]('~'+_0x399711[_0x3fc718(0x2ed)][_0x3fc718(0x247)]+_0x3fc718(0x269))+',\x20')+(a54_0x238b4f[_0x3fc718(0x301)]('-'+_0x399711[_0x3fc718(0x2ed)][_0x3fc718(0x25f)]+_0x3fc718(0x35a))+',\x20')+(''+a54_0x238b4f['dim'](_0x399711[_0x3fc718(0x2ed)]['unchanged']+_0x3fc718(0x39c))));for(const _0x2d5ea6 of _0x399711[_0x3fc718(0x375)]){_0x2d5ea6['type']==='modified'&&_0x2d5ea6['diff']&&(console[_0x3fc718(0x30d)]('\x0a'+a54_0x238b4f[_0x3fc718(0x228)]('---\x20'+_0x2d5ea6[_0x3fc718(0x329)])),console[_0x3fc718(0x30d)](_0x2d5ea6[_0x3fc718(0x265)]));}if(!_0x399711[_0x3fc718(0x2da)])return saveSessionContext({'workflow_project':_0x399711['projectName']},_0x2d52f9[_0x3fc718(0x38b)]),console[_0x3fc718(0x30d)](a54_0x238b4f[_0x3fc718(0x23e)](_0x3fc718(0x2a3))),console[_0x3fc718(0x30d)](a54_0x238b4f['dim'](_0x3fc718(0x253)+_0x399711['projectName'])),0x0;if(_0x2d52f9[_0x3fc718(0x2d5)])return console[_0x3fc718(0x30d)](a54_0x238b4f[_0x3fc718(0x344)](_0x3fc718(0x31f))),0x0;if(!_0x2d52f9[_0x3fc718(0x30b)]){if(!isInteractive())return console[_0x3fc718(0x30d)](a54_0x238b4f[_0x3fc718(0x301)]('\x0aError:'),_0x3fc718(0x2e2)),console[_0x3fc718(0x30d)](a54_0x238b4f[_0x3fc718(0x373)](_0x3fc718(0x1f6))),0x1;const _0x478023=await confirmKey(_0x3fc718(0x20b));if(!_0x478023)return console[_0x3fc718(0x30d)](a54_0x238b4f[_0x3fc718(0x344)]('Cancelled'),_0x3fc718(0x370)),0x1;}await withSpinner(_0x3fc718(0x2a5),()=>_0x3bd061[_0x3fc718(0x2e9)][_0x3fc718(0x229)](_0x399711,{'revision':_0x7f728}),{'verbose':_0x2d52f9['verbose']}),saveSessionContext({'workflow_project':_0x399711['projectName']},_0x2d52f9['session']),console[_0x3fc718(0x30d)](a54_0x238b4f[_0x3fc718(0x23e)](_0x3fc718(0x1f2)));const _0x28fc26=a54_0x2f24e3[_0x3fc718(0x361)](process[_0x3fc718(0x28a)](),_0x399711[_0x3fc718(0x279)])||'.';return console[_0x3fc718(0x30d)](a54_0x238b4f['dim'](_0x3fc718(0x241)+_0x28fc26)),console[_0x3fc718(0x30d)](a54_0x238b4f[_0x3fc718(0x373)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x399711[_0x3fc718(0x352)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a54_0xb298fb(0x2f3)]=a54_0xb298fb(0x252);[a54_0xb298fb(0x346)]=a54_0xb298fb(0x2d7);async[a54_0xb298fb(0x335)](_0x286347){const _0x3f77aa=a54_0xb298fb,{options:_0x938a3f,args:_0x4e8a6f,tdx:_0x320684}=_0x286347,_0x3f6d5a=this[_0x3f77aa(0x398)](_0x4e8a6f,_0x938a3f),_0x6bcdbc=_0x938a3f[_0x3f77aa(0x2c3)],_0x22bea0=_0x938a3f[_0x3f77aa(0x365)];_0x938a3f[_0x3f77aa(0x31d)]&&(_0x3f6d5a&&console[_0x3f77aa(0x30d)](_0x3f77aa(0x390)+_0x3f6d5a),_0x6bcdbc&&console[_0x3f77aa(0x30d)]('Revision:\x20'+_0x6bcdbc),_0x938a3f['dryRun']&&console[_0x3f77aa(0x30d)]('Dry\x20run:\x20yes'),_0x22bea0&&console[_0x3f77aa(0x30d)]('Validation:\x20skipped'));let _0x5a0dfc;try{_0x5a0dfc=await withSpinner('Analyzing\x20changes...',()=>_0x320684[_0x3f77aa(0x2e9)][_0x3f77aa(0x3a7)]({'sourceDir':_0x3f6d5a,'revision':_0x6bcdbc,'skipValidation':_0x22bea0}),{'verbose':_0x938a3f[_0x3f77aa(0x31d)]});}catch(_0x5ac0e1){if(_0x5ac0e1 instanceof Error&&_0x5ac0e1[_0x3f77aa(0x26d)][_0x3f77aa(0x388)]('No\x20workflow\x20tdx.json\x20found'))return console[_0x3f77aa(0x30d)](a54_0x238b4f[_0x3f77aa(0x301)]('Error:'),_0x3f77aa(0x339)),_0x938a3f[_0x3f77aa(0x216)]?console[_0x3f77aa(0x30d)](a54_0x238b4f['dim'](_0x3f77aa(0x399)+_0x938a3f[_0x3f77aa(0x216)]+_0x3f77aa(0x2f8)+_0x938a3f[_0x3f77aa(0x216)]+'\x27')):console[_0x3f77aa(0x30d)](a54_0x238b4f[_0x3f77aa(0x373)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x5ac0e1;}const _0x2bfa7f=_0x5a0dfc[_0x3f77aa(0x364)];console[_0x3f77aa(0x30d)](_0x3f77aa(0x212)+_0x2bfa7f['projectName']),console[_0x3f77aa(0x30d)](_0x3f77aa(0x34d)+_0x2bfa7f[_0x3f77aa(0x31e)]),console[_0x3f77aa(0x30d)]('\x20\x20Revision:\x20'+_0x2bfa7f['revision']),console[_0x3f77aa(0x30d)](_0x3f77aa(0x356)+a54_0x238b4f['green']('+'+_0x2bfa7f[_0x3f77aa(0x2ed)][_0x3f77aa(0x1ef)]+_0x3f77aa(0x237))+',\x20'+(a54_0x238b4f[_0x3f77aa(0x344)]('~'+_0x2bfa7f['summary']['modified']+_0x3f77aa(0x269))+',\x20')+(a54_0x238b4f['red']('-'+_0x2bfa7f[_0x3f77aa(0x2ed)][_0x3f77aa(0x25f)]+_0x3f77aa(0x35a))+',\x20')+(''+a54_0x238b4f[_0x3f77aa(0x373)](_0x2bfa7f[_0x3f77aa(0x2ed)][_0x3f77aa(0x251)]+_0x3f77aa(0x39c))));for(const _0x5046b5 of _0x2bfa7f[_0x3f77aa(0x375)]){_0x5046b5['type']===_0x3f77aa(0x247)&&_0x5046b5[_0x3f77aa(0x265)]&&(console[_0x3f77aa(0x30d)]('\x0a'+a54_0x238b4f['cyan'](_0x3f77aa(0x309)+_0x5046b5[_0x3f77aa(0x329)])),console[_0x3f77aa(0x30d)](_0x5046b5[_0x3f77aa(0x265)]));}if(!_0x2bfa7f['hasChanges'])return console[_0x3f77aa(0x30d)](a54_0x238b4f[_0x3f77aa(0x23e)](_0x3f77aa(0x29b))),await this['showWorkflowConsoleUrl'](_0x320684,_0x2bfa7f['projectName'],_0x938a3f[_0x3f77aa(0x311)]),0x0;if(_0x938a3f['dryRun'])return console[_0x3f77aa(0x30d)](a54_0x238b4f[_0x3f77aa(0x344)](_0x3f77aa(0x20e))),0x0;if(!_0x938a3f[_0x3f77aa(0x30b)]){if(!isInteractive())return console[_0x3f77aa(0x30d)](a54_0x238b4f[_0x3f77aa(0x301)](_0x3f77aa(0x343)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3f77aa(0x30d)](a54_0x238b4f['dim'](_0x3f77aa(0x1f6))),0x1;const _0x59c755=await confirmKey(_0x3f77aa(0x2b3));if(!_0x59c755)return console[_0x3f77aa(0x30d)](a54_0x238b4f[_0x3f77aa(0x344)](_0x3f77aa(0x30e)),_0x3f77aa(0x2b5)),0x1;}const _0x36de50=await withSpinner(_0x3f77aa(0x2bb),()=>_0x320684[_0x3f77aa(0x2e9)][_0x3f77aa(0x293)](_0x2bfa7f),{'verbose':_0x938a3f[_0x3f77aa(0x31d)]}),_0x3daee2=_0x36de50[_0x3f77aa(0x364)];return console['error'](a54_0x238b4f[_0x3f77aa(0x23e)]('✔\x20Push\x20complete')),console[_0x3f77aa(0x30d)](_0x3f77aa(0x350)+_0x3daee2[_0x3f77aa(0x2fa)]),console['error'](_0x3f77aa(0x204)+_0x3daee2[_0x3f77aa(0x2c3)]),await this[_0x3f77aa(0x317)](_0x320684,_0x3daee2['projectName'],_0x938a3f[_0x3f77aa(0x311)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']='workflow:clone';[a54_0xb298fb(0x346)]=a54_0xb298fb(0x208);async[a54_0xb298fb(0x335)](_0x358bbb){const _0x1729d2=a54_0xb298fb,{options:_0x1c648c,args:_0x50044b,tdx:_0x36a31e}=_0x358bbb,_0x3a2233=this['resolveProjectDir'](_0x50044b,_0x1c648c),_0x245c2a=_0x1c648c[_0x1729d2(0x2f3)],_0xbb93e6=_0x1c648c['revision'],_0x4b9e16=_0x1c648c[_0x1729d2(0x365)];if(!_0x3a2233)return console[_0x1729d2(0x30d)](a54_0x238b4f['red'](_0x1729d2(0x33f)),_0x1729d2(0x28c)),console[_0x1729d2(0x30d)](a54_0x238b4f[_0x1729d2(0x373)](_0x1729d2(0x2ec))),console['error'](a54_0x238b4f[_0x1729d2(0x373)](_0x1729d2(0x25a))),0x1;if(!_0x245c2a)return console[_0x1729d2(0x30d)](a54_0x238b4f[_0x1729d2(0x301)]('Error:'),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x1729d2(0x30d)](a54_0x238b4f['dim']('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x1c648c[_0x1729d2(0x31d)]&&(console['error'](_0x1729d2(0x390)+_0x3a2233),console[_0x1729d2(0x30d)](_0x1729d2(0x2ae)+_0x245c2a),_0xbb93e6&&console[_0x1729d2(0x30d)](_0x1729d2(0x32b)+_0xbb93e6),_0x1c648c[_0x1729d2(0x2d5)]&&console[_0x1729d2(0x30d)](_0x1729d2(0x3a3)),_0x4b9e16&&console[_0x1729d2(0x30d)]('Validation:\x20skipped'));const _0x6f6125=await withSpinner(_0x1729d2(0x243),()=>_0x36a31e['workflow'][_0x1729d2(0x357)](_0x3a2233,_0x245c2a,{'revision':_0xbb93e6,'skipValidation':_0x4b9e16}),{'verbose':_0x1c648c[_0x1729d2(0x31d)]}),_0x2daf59=_0x6f6125['data'];console['error'](_0x1729d2(0x29d)+_0x2daf59[_0x1729d2(0x31e)]);_0x2daf59[_0x1729d2(0x2aa)]&&console['error'](_0x1729d2(0x240)+_0x2daf59[_0x1729d2(0x2aa)]);console['error'](_0x1729d2(0x2ae)+_0x2daf59['newProjectName']),console[_0x1729d2(0x30d)](_0x1729d2(0x32b)+_0x2daf59[_0x1729d2(0x2c3)]),console[_0x1729d2(0x30d)](_0x1729d2(0x3ae)+_0x2daf59[_0x1729d2(0x323)]);_0x2daf59[_0x1729d2(0x2c1)]&&(console['error'](a54_0x238b4f[_0x1729d2(0x344)]('\x0a⚠\x20Project\x20\x22'+_0x2daf59[_0x1729d2(0x2ac)]+_0x1729d2(0x22f)+_0x2daf59[_0x1729d2(0x2fe)]+')')),console['error'](a54_0x238b4f['yellow'](_0x1729d2(0x250))));if(_0x1c648c[_0x1729d2(0x2d5)])return console[_0x1729d2(0x30d)](a54_0x238b4f[_0x1729d2(0x344)](_0x1729d2(0x327))),0x0;if(!_0x1c648c[_0x1729d2(0x30b)]){if(!isInteractive())return console[_0x1729d2(0x30d)](a54_0x238b4f[_0x1729d2(0x301)]('\x0aError:'),_0x1729d2(0x2e2)),console[_0x1729d2(0x30d)](a54_0x238b4f[_0x1729d2(0x373)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1f4c6c=_0x2daf59['sourceProjectName']||a54_0x2f24e3[_0x1729d2(0x2db)](_0x3a2233),_0x675291=_0x2daf59[_0x1729d2(0x2c1)]?_0x1729d2(0x371)+_0x245c2a+_0x1729d2(0x2e0):_0x1729d2(0x215)+_0x1f4c6c+_0x1729d2(0x1fe)+_0x245c2a+'\x22?',_0x5c0c33=await confirmKey(_0x675291);if(!_0x5c0c33)return console[_0x1729d2(0x30d)](a54_0x238b4f[_0x1729d2(0x344)](_0x1729d2(0x30e))),0x1;}const _0x514f34=await withSpinner(_0x2daf59['targetExists']?_0x1729d2(0x3a1)+_0x245c2a+_0x1729d2(0x3a6):'Cloning\x20to\x20'+_0x245c2a+'...',()=>_0x36a31e['workflow'][_0x1729d2(0x377)](_0x2daf59),{'verbose':_0x1c648c['verbose']}),_0x46d6fb=_0x514f34[_0x1729d2(0x364)];return console[_0x1729d2(0x30d)](a54_0x238b4f[_0x1729d2(0x23e)](_0x2daf59[_0x1729d2(0x2c1)]?_0x1729d2(0x387):_0x1729d2(0x1f1))),console[_0x1729d2(0x30d)](_0x1729d2(0x271)+_0x46d6fb[_0x1729d2(0x2ac)]),console[_0x1729d2(0x30d)](_0x1729d2(0x350)+_0x46d6fb[_0x1729d2(0x232)]),console[_0x1729d2(0x30d)]('\x20\x20Revision:\x20'+_0x46d6fb[_0x1729d2(0x2c3)]),await this[_0x1729d2(0x317)](_0x36a31e,_0x46d6fb[_0x1729d2(0x2ac)],_0x1c648c[_0x1729d2(0x311)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a54_0xb298fb(0x2dc);[a54_0xb298fb(0x346)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a54_0xb298fb(0x335)](_0x39c67c){const _0x4c4e76=a54_0xb298fb,{options:_0x3e1369,args:_0x28a631,tdx:_0x1840df}=_0x39c67c,_0x114967=_0x28a631[0x0];if(!_0x114967)return console['error'](_0x4c4e76(0x23c)),console['error'](_0x4c4e76(0x33a)),0x1;_0x3e1369['verbose']&&console[_0x4c4e76(0x30d)](_0x4c4e76(0x24b)+_0x114967);if(!_0x3e1369[_0x4c4e76(0x30b)]){if(!isInteractive())return console[_0x4c4e76(0x30d)](a54_0x238b4f[_0x4c4e76(0x301)](_0x4c4e76(0x343)),_0x4c4e76(0x2e2)),console[_0x4c4e76(0x30d)](a54_0x238b4f[_0x4c4e76(0x373)](_0x4c4e76(0x1f6))),0x1;const _0x472c4d=await confirmKey(_0x4c4e76(0x1fb)+_0x114967+_0x4c4e76(0x314));if(!_0x472c4d)return console['error'](a54_0x238b4f['yellow'](_0x4c4e76(0x30e))),0x1;}const _0x475f2f=await withSpinner(_0x4c4e76(0x305)+_0x114967+_0x4c4e76(0x3a6),()=>_0x1840df[_0x4c4e76(0x2e9)][_0x4c4e76(0x25e)](_0x114967),{'verbose':_0x3e1369['verbose']}),_0x518fb0=_0x475f2f[_0x4c4e76(0x364)];return console['error'](_0x4c4e76(0x3b2)+_0x518fb0[_0x4c4e76(0x352)]),console[_0x4c4e76(0x30d)](_0x4c4e76(0x350)+_0x518fb0[_0x4c4e76(0x2fa)]),0x0;}}export function parseKeyValue(_0x5ef584){const _0x44e990=a54_0xb298fb,_0xd75e0f=_0x5ef584[_0x44e990(0x315)]('=');if(_0xd75e0f===-0x1)throw new Error(_0x44e990(0x36a)+_0x5ef584+_0x44e990(0x369));const _0x1075c7=_0x5ef584[_0x44e990(0x291)](0x0,_0xd75e0f),_0x28b96b=_0x5ef584[_0x44e990(0x291)](_0xd75e0f+0x1);if(!_0x1075c7)throw new Error(_0x44e990(0x2ad));return{'key':_0x1075c7,'value':_0x28b96b};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0xb298fb(0x2f3)]=a54_0xb298fb(0x2d0);[a54_0xb298fb(0x346)]=a54_0xb298fb(0x2c9);async[a54_0xb298fb(0x335)](_0xf38b5b){const _0x49a442=a54_0xb298fb,{options:_0x49e29c,args:_0x58fa38,tdx:_0x51b1eb}=_0xf38b5b,_0x4c372c=this[_0x49a442(0x3b5)](_0x58fa38,_0x49e29c);if(!_0x4c372c)return 0x1;_0x49e29c[_0x49a442(0x31d)]&&console[_0x49a442(0x30d)](_0x49a442(0x24b)+_0x4c372c);const _0x2b2c4f=await withSpinner(_0x49a442(0x383),()=>_0x51b1eb['workflow'][_0x49a442(0x2af)](_0x4c372c),{'verbose':_0x49e29c['verbose']}),{secrets:_0x28e924}=_0x2b2c4f['data'];return console[_0x49a442(0x30d)](_0x49a442(0x275)+_0x28e924[_0x49a442(0x33b)]+_0x49a442(0x33d)+(_0x28e924['length']!==0x1?'s':'')),await handleSDKOutput(_0x28e924,_0x49e29c),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0xb298fb(0x2f3)]=a54_0xb298fb(0x2cc);['description']=a54_0xb298fb(0x2bc);async[a54_0xb298fb(0x335)](_0x508075){const _0x1a921d=a54_0xb298fb,{options:_0x4aef2a,args:_0xdef4ce,tdx:_0x4d52b6}=_0x508075;let _0x44a5b8,_0x5f41cd;if(_0xdef4ce[_0x1a921d(0x33b)]>=0x1&&!_0xdef4ce[0x0][_0x1a921d(0x388)]('='))_0x44a5b8=_0xdef4ce[0x0],_0x5f41cd=_0xdef4ce[_0x1a921d(0x258)](0x1);else{if(_0xdef4ce[_0x1a921d(0x33b)]>=0x1&&_0x4aef2a[_0x1a921d(0x216)])_0x44a5b8=_0x4aef2a[_0x1a921d(0x216)],_0x5f41cd=_0xdef4ce;else return _0xdef4ce[_0x1a921d(0x33b)]>=0x1?(console[_0x1a921d(0x30d)](_0x1a921d(0x39a)),console[_0x1a921d(0x30d)](_0x1a921d(0x2ab)),0x1):(console[_0x1a921d(0x30d)](_0x1a921d(0x389)),console[_0x1a921d(0x30d)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1);}if(_0x5f41cd['length']===0x0)return console[_0x1a921d(0x30d)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x1a921d(0x30d)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1;const _0x49ccdb={};try{for(const _0x3f9fc1 of _0x5f41cd){const {key:_0x436bd7,value:_0x3f6ddd}=parseKeyValue(_0x3f9fc1);_0x49ccdb[_0x436bd7]=_0x3f6ddd;}}catch(_0x2ffad3){return _0x2ffad3 instanceof Error&&console[_0x1a921d(0x30d)](a54_0x238b4f[_0x1a921d(0x301)](_0x1a921d(0x33f)),_0x2ffad3[_0x1a921d(0x26d)]),0x1;}const _0x3b8744=Object[_0x1a921d(0x39f)](_0x49ccdb);_0x4aef2a[_0x1a921d(0x31d)]&&(console[_0x1a921d(0x30d)](_0x1a921d(0x24b)+_0x44a5b8),console['error'](_0x1a921d(0x38e)+_0x3b8744['join'](',\x20')));const _0x1968c7=await withSpinner(_0x3b8744[_0x1a921d(0x33b)]===0x1?_0x1a921d(0x385):_0x1a921d(0x225)+_0x3b8744[_0x1a921d(0x33b)]+'\x20secrets...',()=>_0x4d52b6[_0x1a921d(0x2e9)]['setSecrets'](_0x44a5b8,_0x49ccdb),{'verbose':_0x4aef2a[_0x1a921d(0x31d)]}),_0x151291=_0x1968c7['data'];return console[_0x1a921d(0x30d)](_0x3b8744[_0x1a921d(0x33b)]===0x1?_0x1a921d(0x2fc)+_0x151291[_0x1a921d(0x39f)][0x0]+_0x1a921d(0x1ec)+_0x151291['projectName']+'\x27':'✔\x20'+_0x151291[_0x1a921d(0x39f)]['length']+'\x20secrets\x20set\x20for\x20project\x20\x27'+_0x151291['projectName']+'\x27'),(_0x4aef2a[_0x1a921d(0x366)]||_0x4aef2a[_0x1a921d(0x35b)])&&await handleSingleObjectOutput(_0x151291,_0x4aef2a),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0xb298fb(0x2f3)]=a54_0xb298fb(0x249);[a54_0xb298fb(0x346)]='Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project';async[a54_0xb298fb(0x335)](_0x43966b){const _0x57f1f5=a54_0xb298fb,{options:_0x46d58f,args:_0x1f9fe4,tdx:_0x4d3043}=_0x43966b;let _0x377345,_0x2e4194;if(_0x1f9fe4[_0x57f1f5(0x33b)]>=0x2)_0x377345=_0x1f9fe4[0x0],_0x2e4194=_0x1f9fe4[0x1];else{if(_0x1f9fe4[_0x57f1f5(0x33b)]===0x1&&_0x46d58f[_0x57f1f5(0x216)])_0x377345=_0x46d58f[_0x57f1f5(0x216)],_0x2e4194=_0x1f9fe4[0x0];else return _0x1f9fe4[_0x57f1f5(0x33b)]===0x1?(console[_0x57f1f5(0x30d)](_0x57f1f5(0x39a)),console[_0x57f1f5(0x30d)](_0x57f1f5(0x2ab)),0x1):(console[_0x57f1f5(0x30d)](_0x57f1f5(0x206)),console['error'](_0x57f1f5(0x236)),0x1);}_0x46d58f[_0x57f1f5(0x31d)]&&(console[_0x57f1f5(0x30d)](_0x57f1f5(0x24b)+_0x377345),console[_0x57f1f5(0x30d)](_0x57f1f5(0x290)+_0x2e4194));if(!_0x46d58f['yes']){if(!isInteractive())return console[_0x57f1f5(0x30d)](a54_0x238b4f[_0x57f1f5(0x301)](_0x57f1f5(0x343)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x57f1f5(0x30d)](a54_0x238b4f[_0x57f1f5(0x373)](_0x57f1f5(0x1f6))),0x1;const _0x4d6c28=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x2e4194+_0x57f1f5(0x24c)+_0x377345+'\x27?');if(!_0x4d6c28)return console[_0x57f1f5(0x30d)](a54_0x238b4f[_0x57f1f5(0x344)](_0x57f1f5(0x30e))),0x1;}const _0x587d8a=await withSpinner(_0x57f1f5(0x2d6),()=>_0x4d3043[_0x57f1f5(0x2e9)][_0x57f1f5(0x276)](_0x377345,_0x2e4194),{'verbose':_0x46d58f[_0x57f1f5(0x31d)]}),_0xcbada6=_0x587d8a[_0x57f1f5(0x364)];return console[_0x57f1f5(0x30d)](_0x57f1f5(0x2fc)+_0xcbada6[_0x57f1f5(0x382)]+_0x57f1f5(0x322)+_0xcbada6[_0x57f1f5(0x352)]+'\x27'),(_0x46d58f['json']||_0x46d58f[_0x57f1f5(0x35b)])&&await handleSingleObjectOutput(_0xcbada6,_0x46d58f),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(_0x2d0c0b){const _0x2fde85=a54_0xb298fb,_0x5aef95=Math[_0x2fde85(0x332)](_0x2d0c0b/0x3e8),_0x2d3487=Math['floor'](_0x5aef95/0x3c),_0xf563fc=Math[_0x2fde85(0x332)](_0x2d3487/0x3c),_0x180736=Math[_0x2fde85(0x332)](_0xf563fc/0x18);if(_0x180736>0x0){const _0x4c9abf=_0xf563fc%0x18;return _0x4c9abf>0x0?_0x180736+'d\x20'+_0x4c9abf+'h':_0x180736+'d';}else{if(_0xf563fc>0x0){const _0x558cb8=_0x2d3487%0x3c;return _0x558cb8>0x0?_0xf563fc+'h\x20'+_0x558cb8+'m':_0xf563fc+'h';}else{if(_0x2d3487>0x0){const _0x4290a6=_0x5aef95%0x3c;return _0x4290a6>0x0?_0x2d3487+'m\x20'+_0x4290a6+'s':_0x2d3487+'m';}else return _0x5aef95+'s';}}}function formatTimestamp(_0x3a67e7,_0x2c1154){const _0x5c0fdf=a54_0xb298fb,_0x3c8989=new Date(_0x3a67e7),_0x392eef=String(_0x3c8989['getHours']())[_0x5c0fdf(0x325)](0x2,'0'),_0x4090fd=String(_0x3c8989[_0x5c0fdf(0x231)]())[_0x5c0fdf(0x325)](0x2,'0'),_0x2d5470=_0x392eef+':'+_0x4090fd,_0xd00a43=_0x3c8989[_0x5c0fdf(0x260)]()===_0x2c1154[_0x5c0fdf(0x260)]()&&_0x3c8989['getMonth']()===_0x2c1154[_0x5c0fdf(0x2e3)]()&&_0x3c8989[_0x5c0fdf(0x384)]()===_0x2c1154[_0x5c0fdf(0x384)]();if(_0xd00a43)return _0x2d5470;else{const _0x212556=String(_0x3c8989[_0x5c0fdf(0x2e3)]()+0x1)['padStart'](0x2,'0'),_0x1ad5f3=String(_0x3c8989['getDate']())[_0x5c0fdf(0x325)](0x2,'0');return _0x212556+'-'+_0x1ad5f3+'\x20'+_0x2d5470;}}function formatDate(_0x250375){const _0x1cf1d2=a54_0xb298fb,_0x2abb65=_0x250375[_0x1cf1d2(0x260)](),_0x5d8e4c=String(_0x250375[_0x1cf1d2(0x2e3)]()+0x1)[_0x1cf1d2(0x325)](0x2,'0'),_0x2e81cf=String(_0x250375[_0x1cf1d2(0x384)]())[_0x1cf1d2(0x325)](0x2,'0');return _0x2abb65+'-'+_0x5d8e4c+'-'+_0x2e81cf;}function getTaskStateIcon(_0x2f1d83){const _0x5033d0={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x5033d0[_0x2f1d83]||'⚪';}function getBarChar(_0x34d43a){const _0x5918f3=a54_0xb298fb;return _0x34d43a===_0x5918f3(0x30d)||_0x34d43a==='group_error'?'×':'─';}function getBarColor(_0x47dd3b){const _0x41b100=a54_0xb298fb,_0x5d9c72={'success':a54_0x238b4f['green'],'error':a54_0x238b4f[_0x41b100(0x301)],'group_error':a54_0x238b4f['red'],'running':a54_0x238b4f[_0x41b100(0x211)],'blocked':a54_0x238b4f['yellow'],'planned':a54_0x238b4f['dim'],'canceling':a54_0x238b4f['yellow']};return _0x5d9c72[_0x47dd3b]||a54_0x238b4f[_0x41b100(0x2df)];}function parseTaskName(_0x1c53e3){const _0x1ee984=a54_0xb298fb;let _0x3e14f2=_0x1c53e3[_0x1ee984(0x2c5)](/^\++/,'');const _0x3de49a=_0x3e14f2[_0x1ee984(0x2ee)]('+'),_0x4bffe2=_0x3de49a[_0x1ee984(0x33b)]>0x1?_0x3de49a[_0x1ee984(0x33b)]-0x2:0x0,_0x1e8811=_0x3de49a[_0x3de49a[_0x1ee984(0x33b)]-0x1]||_0x3e14f2;return{'level':_0x4bffe2,'name':'+'+_0x1e8811};}function a54_0x2110(_0x183309,_0x381d2d){_0x183309=_0x183309-0x1e7;const _0x56b492=a54_0x56b4();let _0x21105d=_0x56b492[_0x183309];return _0x21105d;}function truncateTaskName(_0x1d2752,_0xc5afc9){const _0x2152e6=a54_0xb298fb,_0x10eded=stringWidth(_0x1d2752);if(_0x10eded<=_0xc5afc9)return _0x1d2752;let _0xe3b053=_0x1d2752;while(stringWidth(_0xe3b053+'…')>_0xc5afc9&&_0xe3b053[_0x2152e6(0x33b)]>0x0){_0xe3b053=_0xe3b053['slice'](0x0,-0x1);}return _0xe3b053+'…';}function calculateTimeScale(_0x58478b,_0x5d5e6d){const _0x43b520=a54_0xb298fb;return{'startTime':_0x58478b['start'],'endTime':_0x58478b[_0x43b520(0x342)],'durationMs':_0x58478b[_0x43b520(0x1ff)],'msPerChar':_0x58478b[_0x43b520(0x1ff)]/_0x5d5e6d};}function timeToPosition(_0x1659dc,_0x206dce,_0x31d1c8){const _0x22adfe=a54_0xb298fb,_0x17ca20=_0x1659dc-_0x206dce['startTime'],_0x40f771=Math[_0x22adfe(0x332)](_0x17ca20/_0x206dce[_0x22adfe(0x268)]);return Math[_0x22adfe(0x23d)](0x0,Math[_0x22adfe(0x27d)](_0x40f771,_0x31d1c8));}function renderTimeAxis(_0x1242a9,_0x4f7461){const _0x372fd3=a54_0xb298fb,_0x5c30c7=Math[_0x372fd3(0x27d)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x372fd3(0x23d)](TIMELINE_CONFIG[_0x372fd3(0x2e7)],Math[_0x372fd3(0x332)](_0x4f7461/TIMELINE_CONFIG[_0x372fd3(0x316)]))),_0x213c6a=_0x1242a9[_0x372fd3(0x393)]/(_0x5c30c7-0x1),_0x3ca231=new Date(_0x1242a9[_0x372fd3(0x223)]),_0x11e5e7=[];for(let _0x189517=0x0;_0x189517<_0x5c30c7;_0x189517++){const _0x53dc80=_0x1242a9[_0x372fd3(0x223)]+_0x189517*_0x213c6a,_0x125cb0=timeToPosition(_0x53dc80,_0x1242a9,_0x4f7461),_0x453d1e=formatTimestamp(_0x53dc80,_0x3ca231);_0x11e5e7[_0x372fd3(0x2c7)]({'pos':_0x125cb0,'text':_0x453d1e});}const _0x348880=new Array(_0x4f7461)[_0x372fd3(0x286)]('\x20');let _0x273804=-0x1;for(const {pos:_0x52530c,text:_0x24728b}of _0x11e5e7){let _0x428da9=Math['max'](0x0,_0x52530c-Math[_0x372fd3(0x332)](_0x24728b['length']/0x2));_0x428da9<=_0x273804+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x428da9=_0x273804+TIMELINE_CONFIG[_0x372fd3(0x1f8)]+0x1);_0x428da9+_0x24728b[_0x372fd3(0x33b)]>_0x4f7461&&(_0x428da9=_0x4f7461-_0x24728b[_0x372fd3(0x33b)]);if(_0x428da9>=0x0&&_0x428da9+_0x24728b[_0x372fd3(0x33b)]<=_0x4f7461&&_0x428da9>_0x273804){for(let _0x3cd5f7=0x0;_0x3cd5f7<_0x24728b[_0x372fd3(0x33b)];_0x3cd5f7++){_0x348880[_0x428da9+_0x3cd5f7]=_0x24728b[_0x3cd5f7];}_0x273804=_0x428da9+_0x24728b[_0x372fd3(0x33b)]-0x1;}}return _0x348880['join']('');}function renderTaskRow(_0x208867,_0x48e5da,_0x19e4b5,_0x4094f3){const _0x2d1c12=a54_0xb298fb,{level:_0x37e246,name:_0x517847}=parseTaskName(_0x208867[_0x2d1c12(0x2f3)]),_0x4c1563='\x20'[_0x2d1c12(0x21a)](_0x37e246),_0x270980=_0x208867['window']?'('+formatElapsed(_0x208867[_0x2d1c12(0x36d)][_0x2d1c12(0x1ff)])+')':'',_0x59fa42=stringWidth(_0x270980),_0x4d02f6=_0x37e246*0x1,_0xc4766f=_0x4094f3-_0x4d02f6-_0x59fa42-0x1,_0x3cac56=truncateTaskName(_0x517847,_0xc4766f),_0x317fe2=_0x4c1563+_0x3cac56,_0x4cb279=stringWidth(_0x317fe2),_0x1d2965=_0x4094f3-_0x4cb279-_0x59fa42,_0x32584b=_0x317fe2+'\x20'[_0x2d1c12(0x21a)](Math['max'](0x1,_0x1d2965))+a54_0x238b4f[_0x2d1c12(0x373)](_0x270980),_0x42fadb=getTaskStateIcon(_0x208867[_0x2d1c12(0x39d)]),_0x22761b=new Array(_0x19e4b5)['fill']('\x20');if(_0x208867[_0x2d1c12(0x36d)]){const _0x46baa9=timeToPosition(_0x208867[_0x2d1c12(0x36d)]['start'],_0x48e5da,_0x19e4b5),_0x51cdd3=timeToPosition(_0x208867['window']['end'],_0x48e5da,_0x19e4b5),_0x30c0fc=getBarChar(_0x208867[_0x2d1c12(0x39d)]),_0x137628=Math[_0x2d1c12(0x23d)](_0x46baa9+0x1,_0x51cdd3);for(let _0x415152=_0x46baa9;_0x415152<Math[_0x2d1c12(0x27d)](_0x137628,_0x19e4b5);_0x415152++){_0x22761b[_0x415152]=_0x30c0fc;}}const _0x10c678=getBarColor(_0x208867['state']),_0x10e58e=_0x22761b['map'](_0x9a971=>_0x9a971==='\x20'?'\x20':_0x10c678(_0x9a971))['join']('');return _0x42fadb+'\x20'+_0x32584b+'│'+_0x10e58e+'│';}function calculateStats(_0xda9577){const _0x266f7d=a54_0xb298fb,_0x5b56c3={'total':_0xda9577[_0x266f7d(0x33b)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x29ef17 of _0xda9577){if(_0x29ef17[_0x266f7d(0x39d)]===_0x266f7d(0x2d2))_0x5b56c3[_0x266f7d(0x2d2)]++;else{if(_0x29ef17['state']===_0x266f7d(0x30d)||_0x29ef17[_0x266f7d(0x39d)]===_0x266f7d(0x324))_0x5b56c3[_0x266f7d(0x30d)]++;else _0x29ef17[_0x266f7d(0x39d)]===_0x266f7d(0x20a)?_0x5b56c3[_0x266f7d(0x20a)]++:_0x5b56c3[_0x266f7d(0x2d8)]++;}}return _0x5b56c3;}function formatStats(_0xa8d040){const _0x1db2e8=a54_0xb298fb;return[_0x1db2e8(0x273)+_0xa8d040[_0x1db2e8(0x2b1)],'✅\x20'+_0xa8d040[_0x1db2e8(0x2d2)],'❌\x20'+_0xa8d040[_0x1db2e8(0x30d)],'🔄\x20'+_0xa8d040['running'],'⏳\x20'+_0xa8d040[_0x1db2e8(0x2d8)]][_0x1db2e8(0x29a)]('\x20\x20');}function a54_0x56b4(){const _0x285fd5=['✔\x20Downloaded\x20','\x0aClone\x20\x22','workflowProject','createdAt','disableSchedule','No\x20attempts\x20found\x20for:\x20','repeat','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','Status:\x20','\x20(system)','\x20\x20Attempt\x20ID:\x20','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','workflow:sessions','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','\x20-\x20','startTime','List\x20workflow\x20schedules','Setting\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','finishedAt','cyan','applyPullProject','\x20\x20Target:\x20','stringify','\x20\x20Console:\x20','\x20task','download','\x22\x20already\x20exists\x20(ID:\x20','sessionTime','getMinutes','newProjectId','renderTimeline','done','\x20tasks','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','\x20new','includeSubtasks','Error:\x20','\x20\x20New\x20attempt\x20ID:\x20','\x20schedule','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','max','green','Select\x20a\x20task\x20to\x20view\x20logs:','Source\x20project:\x20','\x20\x20Location:\x20','Disable\x20a\x20workflow\x20schedule','Analyzing\x20project...','\x1b[1A\x1b[2K','listSchedules','workflow:schedule:enable','modified','GUTTER','workflow:secrets:delete','sessions','Project:\x20','\x27\x20from\x20project\x20\x27','Error:\x20Attempt\x20ID\x20is\x20required','Project\x20name:\x20','filesExtracted','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','unchanged','workflow:push','\x20\x20Session\x20context\x20set\x20to:\x20','Target\x20directory:\x20','taskName','workflow:projects','Killing\x20attempt...','slice','pullProject','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','6EMvRYI','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Show\x20logs\x20for\x20a\x20workflow\x20attempt','delete','deleted','getFullYear','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Auto-selected\x20latest\x20session:\x20','Usage:\x20tdx\x20wf\x20use\x20<project>','pollTimeline','diff','lastAttempt','workflows','msPerChar','\x20modified','TASK_NAME_WIDTH','1148145sUhbhl','planned','message','\x20is\x20not\x20a\x20directory','retryAttemptName','sort','\x20\x20Project:\x20','autocomplete','Total:\x20','964576UwhDpR','✔\x20Found\x20','deleteSecret','\x20(use\x20--limit\x20to\x20show\x20more)','rows','targetDir','value','workflow:retry','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','min','\x20attempt','workflow:tasks','renderSessionsTimeline','filter','workflow:timeline','✔\x20Workflow\x20project\x20context\x20cleared.','Filter:\x20project=','disabledAt','fill','Enabling\x20schedule\x20#','index','fullName','cwd','MAX_TIMELINE_WIDTH','Source\x20directory\x20is\x20required','session:','✔\x20Workflow\x20run\x20started','Downloading\x20logs...','Key:\x20','substring','output','executePushProject','Resolving\x20project\x20\x27','Validation:\x20skipped','stdout','revision:\x20','map','\x20enabled\x20(','join','\x0a✔\x20No\x20changes\x20to\x20push','No\x20sessions\x20with\x20timing\x20information','Source:\x20','Latest\x20session\x20has\x20no\x20attempt','select','Parameters:\x20','Output\x20directory:\x20','isArray','\x0a✔\x20Already\x20up\x20to\x20date','Including\x20subtasks:\x20yes','Writing\x20files...','2558200qsiZWQ','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','Fetching\x20log\x20files...','tasks','sourceProjectName','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','newProjectName','Key\x20cannot\x20be\x20empty','New\x20project\x20name:\x20','listSecrets','Task\x20name:\x20','total','fileSize','\x0aPush\x20these\x20changes?','MIN_TIMELINE_WIDTH','-\x20nothing\x20pushed','format','attemptId','resumeFrom','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','Project\x20name\x20is\x20required','Pushing\x20project...','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','No\x20workflows\x20found\x20in\x20project:\x20','No\x20sessions\x20found\x20in\x20project:\x20','fromTask','Project\x20filter:\x20','targetExists','/sessions/','revision','values','replace','workflow:kill','push','Listing\x20workflow\x20projects...','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','sessionId','isNewProject','workflow:secrets:set','buildTimelineData','workflow:use','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','workflow:secrets:list','toLocaleString','success','ICON_WIDTH','✔\x20Pushed\x20','dryRun','Deleting\x20secret...','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','pending','splice','hasChanges','basename','workflow:delete','Session\x20time:\x20','Target:\x20','white','\x22\x20with\x20new\x20revision?','258PWskTI','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','getMonth','metadata','retrySession','resolveProject','MIN_LABEL_COUNT','title','workflow','workflow:run','context','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','summary','split','start','ICON_SPACING','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','Params:\x20','name','toLowerCase','Loading\x20session...','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','\x20\x20tdx\x20wf\x20use\x20<project>','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','No\x20sessions\x20found\x20for:\x20','projectId','utf-8','✔\x20Secret\x20\x27','find','existingProjectId','trimEnd','📋\x20','red','workflow:download','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Retrying\x20attempt...','Deleting\x20project\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Getting\x20attempt\x20tasks...','includeRetried','---\x20','startsWith','yes','params','error','Cancelled','📅\x20#','session_id','site','POLL_INTERVAL_MS','Session\x20','\x22?\x20This\x20cannot\x20be\x20undone.','indexOf','LABEL_WIDTH_DIVISOR','showWorkflowConsoleUrl','stat','Listing\x20workflow\x20attempts...','Expected\x20format:\x20--param\x20key=value','workflow:pull','parseProjectWorkflowPattern','verbose','sourceDir','\x0aDry\x20run\x20-\x20no\x20files\x20written','No\x20log\x20content\x20found','status','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','fileCount','group_error','padStart','columns','\x0aDry\x20run\x20-\x20no\x20project\x20created','attempt','path','List\x20workflows','Revision:\x20','\x20from\x20session\x20','No\x20workflow\x20projects\x20found','Force:\x20yes','run','No\x20workflow\x20sessions\x20found','task','floor','Attempt\x20ID:\x20','List\x20workflow\x20attempts','execute','startedAt','localeCompare','⚠\x20Showing\x20first\x20','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Usage:\x20workflow:delete\x20<project-name-or-id>','length','Attempt:\x20','\x20secret','Pattern:\x20','Error:','table','icon','end','\x0aError:','yellow','14574699YMBCro','description','✔\x20Schedule\x20#','displayLine','retryAttempt','Start\x20a\x20workflow\x20run','param','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','\x20\x20Source:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Listing\x20workflow\x20sessions...','\x20\x20Project\x20ID:\x20','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','projectName','unknown','Select\x20a\x20workflow\x20to\x20run','\x20project','\x20\x20Changes:\x20','prepareCloneProject','round','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','\x20deleted','jsonl','List\x20all\x20workflow\x20projects','Pull\x20workflow\x20project\x20to\x20local\x20folder','workflowName','some','log','relative','nextRunTime','/attempt/','data','skipValidation','json','\x0aPolling...\x20(','attempts','.\x20Expected\x20format:\x20KEY=VALUE','Invalid\x20format:\x20','workflow:logs','navigateSessionsInteractive','window','Listing\x20schedules...','90572UiRpfD','-\x20no\x20files\x20written','\x0aUpdate\x20existing\x20project\x20\x22','renderSingleTimeline','dim','readFile','changes','Schedule\x20ID\x20is\x20required','executeCloneProject','get','cancelRequested','\x20\x20Workflow:\x20','MAX_TASKS_DISPLAY','✔\x20Retry\x20started','Workflow:\x20','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','match','→\x20Project:\x20','workflow:attempts','key','Listing\x20secrets...','getDate','Setting\x20secret...','Show\x20specific\x20attempt\x20details','✔\x20Project\x20updated','includes','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','projects','session','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','\x20\x20Files\x20extracted:\x20','Secrets\x20to\x20set:\x20','(unknown)','Source\x20directory:\x20','\x0a✔\x20Attempt\x20complete','Retrying\x20session...','durationMs','💡\x20Tip:\x20Use\x20','Pulling\x20project\x20','Warning:','Listing\x20workflows...','resolveProjectDir','Tip:\x20cd\x20to\x20workflows/','Error:\x20Project\x20name\x20is\x20required','now','\x20unchanged','state','all','keys','updatedAt','Updating\x20','No\x20matching\x20sessions\x20found','Dry\x20run:\x20yes','getTime','Disabling\x20schedule\x20#','...','preparePushProject','Filter:\x20','logFiles','75698VqquqR','limit','fs/promises','workflow:upload','Files\x20to\x20upload:\x20','generateSessionTimelineRows','No\x20sessions\x20found','isTTY','✔\x20Deleted\x20project\x20','from','workflow:workflows','requireProject','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','Session\x20not\x20found:\x20','parse','resolveProjectId','\x20session','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','✔\x20Workflow\x20project\x20set\x20to:\x20',',\x20Workflow:\x20','new','write','✔\x20Clone\x20complete','✔\x20Pull\x20complete','Kill\x20a\x20running\x20attempt','Reason:\x20','project','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','MAX_POLL_ITERATIONS','LABEL_MIN_SPACING','attempt:','resolve','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Show\x20tasks\x20for\x20an\x20attempt','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','\x22\x20to\x20new\x20project\x20\x22','duration','follow','No\x20attempts\x20found','\x20(disabled)','canceling','\x20\x20Revision:\x20','(use\x20--limit\x20to\x20see\x20more)','Error:\x20Secret\x20key\x20is\x20required','force','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','list','running','\x0aApply\x20these\x20changes?','Pushing\x20workflow\x20project...','\x20\x20Session\x20ID:\x20','\x0aDry\x20run\x20-\x20nothing\x20pushed','\x20sessions\x20','579378pwArzP','blue','✔\x20Project:\x20','\x20disabled\x20('];a54_0x56b4=function(){return _0x285fd5;};return a54_0x56b4();}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a54_0xb298fb(0x282);[a54_0xb298fb(0x346)]=a54_0xb298fb(0x2f1);async['execute'](_0x3453fa){const _0x127f6d=a54_0xb298fb,{options:_0x1e6a56,args:_0x50ff82,tdx:_0x5643f0}=_0x3453fa;let _0x40114e,_0x35b3f5,_0x523738=![];if(_0x50ff82[0x0]){if(_0x50ff82[0x0][_0x127f6d(0x388)]('.')){const _0x459e1e=this[_0x127f6d(0x31c)](_0x50ff82,_0x1e6a56);if(!_0x459e1e)return 0x1;_0x40114e=_0x459e1e['projectName'],_0x35b3f5=_0x459e1e[_0x127f6d(0x35e)];}else{_0x35b3f5=_0x50ff82[0x0],_0x40114e=_0x1e6a56[_0x127f6d(0x216)];if(!_0x40114e)return console[_0x127f6d(0x30d)](a54_0x238b4f[_0x127f6d(0x301)](_0x127f6d(0x33f)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x523738=!![];}}else{const _0x20018b=this[_0x127f6d(0x31c)](_0x50ff82,_0x1e6a56);if(!_0x20018b)return 0x1;_0x40114e=_0x20018b[_0x127f6d(0x352)],_0x35b3f5=_0x20018b[_0x127f6d(0x35e)];}if(_0x1e6a56[_0x127f6d(0x31d)]){if(_0x40114e&&_0x35b3f5)console['error'](_0x127f6d(0x3a8)+_0x40114e+'.'+_0x35b3f5);else _0x40114e&&console[_0x127f6d(0x30d)]('Filter:\x20project='+_0x40114e);}const _0x59debe=_0x1e6a56[_0x127f6d(0x2b7)],_0x3f71d2=_0x1e6a56[_0x127f6d(0x2ca)];if(_0x59debe){_0x3f71d2&&console[_0x127f6d(0x30d)](a54_0x238b4f[_0x127f6d(0x344)](_0x127f6d(0x396)),_0x127f6d(0x2cf));const _0x130b99=_0x1e6a56['follow'];return _0x130b99?await this[_0x127f6d(0x264)](_0x3453fa,_0x59debe):await this[_0x127f6d(0x372)](_0x3453fa,_0x59debe,_0x1e6a56),0x0;}if(_0x3f71d2){const _0xdf0ea6=await withSpinner(_0x127f6d(0x2f5),()=>_0x5643f0[_0x127f6d(0x2e9)]['sessions']({'projectName':_0x40114e,'workflowName':_0x35b3f5,'limit':0x64}),{'verbose':_0x1e6a56[_0x127f6d(0x31d)]}),_0x1c80da=_0xdf0ea6[_0x127f6d(0x364)][_0x127f6d(0x2fd)](_0x501ade=>_0x501ade['id']===_0x3f71d2);if(!_0x1c80da)return console[_0x127f6d(0x30d)](a54_0x238b4f[_0x127f6d(0x301)](_0x127f6d(0x33f)),_0x127f6d(0x1e8)+_0x3f71d2),0x1;if(!_0x1c80da[_0x127f6d(0x266)]?.['id'])return console[_0x127f6d(0x30d)](a54_0x238b4f[_0x127f6d(0x301)](_0x127f6d(0x33f)),_0x127f6d(0x313)+_0x3f71d2+'\x20has\x20no\x20attempts'),0x1;const _0x2c14ed=_0x1c80da['lastAttempt']['id'];_0x1e6a56['verbose']&&console[_0x127f6d(0x30d)]('Using\x20attempt\x20'+_0x2c14ed+_0x127f6d(0x32c)+_0x3f71d2);const _0x46112f=_0x1e6a56[_0x127f6d(0x200)];return _0x46112f?await this[_0x127f6d(0x264)](_0x3453fa,_0x2c14ed):await this[_0x127f6d(0x372)](_0x3453fa,_0x2c14ed,_0x1e6a56),0x0;}const _0x2b4698=await withSpinner('Loading\x20sessions...',()=>_0x5643f0[_0x127f6d(0x2e9)][_0x127f6d(0x24a)]({'projectName':_0x40114e,'workflowName':_0x35b3f5,'limit':_0x1e6a56[_0x127f6d(0x3ab)]||0x32}),{'verbose':_0x1e6a56['verbose']}),_0x56cff3=_0x2b4698[_0x127f6d(0x364)];if(_0x56cff3['length']===0x0){if(_0x40114e&&_0x35b3f5)console[_0x127f6d(0x30d)](_0x127f6d(0x2f9)+_0x40114e+'.'+_0x35b3f5);else _0x40114e?console['error'](_0x127f6d(0x2be)+_0x40114e):(console[_0x127f6d(0x30d)](_0x127f6d(0x330)),console[_0x127f6d(0x30d)](a54_0x238b4f[_0x127f6d(0x373)](_0x127f6d(0x27c))));return 0x0;}_0x56cff3[_0x127f6d(0x270)]((_0x28cbf1,_0x399549)=>{const _0x321b90=_0x127f6d,_0x30b646=_0x28cbf1[_0x321b90(0x230)]||'',_0x488fde=_0x399549[_0x321b90(0x230)]||'';return _0x488fde[_0x321b90(0x337)](_0x30b646);});if(_0x1e6a56['json']||_0x1e6a56[_0x127f6d(0x35b)])return await handleSDKOutput(_0x56cff3,_0x1e6a56),0x0;let _0x27203d;if(_0x523738){const _0x3e3ef6=_0x56cff3[0x0];if(!_0x3e3ef6[_0x127f6d(0x266)]?.['id'])return console[_0x127f6d(0x30d)](_0x127f6d(0x29e)),0x0;_0x27203d=_0x3e3ef6[_0x127f6d(0x266)]['id'],_0x1e6a56[_0x127f6d(0x31d)]&&console[_0x127f6d(0x30d)](_0x127f6d(0x262)+_0x3e3ef6['sessionTime']);}else{const _0x51e011=_0x56cff3[_0x127f6d(0x298)](_0x18f589=>{const _0x51a948=_0x127f6d,_0x528bba=getAttemptStatusDisplay(_0x18f589[_0x51a948(0x266)]);return{'title':_0x18f589['project']?.[_0x51a948(0x2f3)]+'.'+_0x18f589[_0x51a948(0x2e9)]?.[_0x51a948(0x2f3)]+_0x51a948(0x222)+_0x18f589[_0x51a948(0x230)]+'\x20'+_0x528bba[_0x51a948(0x341)],'value':_0x18f589[_0x51a948(0x266)]?.['id']||'','description':_0x528bba['text']};}),_0x1b93a5=await a54_0x206969({'type':_0x127f6d(0x29f),'name':'attemptId','message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x51e011[_0x127f6d(0x281)](_0x2ed6da=>_0x2ed6da[_0x127f6d(0x27a)]!=='')});if(!_0x1b93a5[_0x127f6d(0x2b7)])return 0x0;_0x27203d=_0x1b93a5[_0x127f6d(0x2b7)];}const _0x4a5cd1=_0x1e6a56[_0x127f6d(0x200)];return _0x4a5cd1?await this[_0x127f6d(0x264)](_0x3453fa,_0x27203d):await this[_0x127f6d(0x372)](_0x3453fa,_0x27203d,_0x1e6a56),0x0;}async[a54_0xb298fb(0x372)](_0x50855b,_0x38a855,_0x5caef7){const _0x51a8e4=a54_0xb298fb,{tdx:_0x2ba4d4}=_0x50855b;let _0x38a478,_0xf4b221;try{[_0x38a478,_0xf4b221]=await Promise[_0x51a8e4(0x39e)]([_0x2ba4d4[_0x51a8e4(0x2e9)][_0x51a8e4(0x328)](_0x38a855),_0x2ba4d4[_0x51a8e4(0x2e9)][_0x51a8e4(0x2a9)](_0x38a855,![])]);}catch(_0x2e83a1){console['error'](a54_0x238b4f[_0x51a8e4(0x301)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x5caef7['verbose']&&console[_0x51a8e4(0x30d)](_0x2e83a1);throw _0x2e83a1;}if(_0x5caef7[_0x51a8e4(0x366)]||_0x5caef7[_0x51a8e4(0x35b)]){const _0xe081a6=this[_0x51a8e4(0x2cd)](_0x38a478,_0xf4b221);await handleSDKOutput([_0xe081a6],_0x5caef7);return;}const _0xb3bbd3=_0x2ba4d4[_0x51a8e4(0x2eb)][_0x51a8e4(0x311)],_0x241dec=this[_0x51a8e4(0x233)](_0x38a478,_0xf4b221,_0xb3bbd3);console['log'](_0x241dec);}async[a54_0xb298fb(0x264)](_0x58b0de,_0x3ed551){const _0x211b6f=a54_0xb298fb,{tdx:_0x5599ad}=_0x58b0de,_0x3f7238=TIMELINE_CONFIG[_0x211b6f(0x312)],_0x4f1015=TIMELINE_CONFIG[_0x211b6f(0x1f7)];let _0x32935d=0x0;while(_0x32935d<_0x4f1015){process[_0x211b6f(0x296)][_0x211b6f(0x3b1)]&&process[_0x211b6f(0x296)][_0x211b6f(0x1f0)]('\x1bc');let _0x4df22e,_0x262c41;try{[_0x4df22e,_0x262c41]=await Promise['all']([_0x5599ad[_0x211b6f(0x2e9)][_0x211b6f(0x328)](_0x3ed551),_0x5599ad[_0x211b6f(0x2e9)][_0x211b6f(0x2a9)](_0x3ed551,![])]);}catch(_0x5633ec){console[_0x211b6f(0x30d)](a54_0x238b4f['red']('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x32935d>0x0&&console['error'](a54_0x238b4f[_0x211b6f(0x373)](_0x211b6f(0x1e7)+_0x32935d));throw _0x5633ec;}const _0xcb6fe7=_0x5599ad[_0x211b6f(0x2eb)][_0x211b6f(0x311)],_0x5d446c=this[_0x211b6f(0x233)](_0x4df22e,_0x262c41,_0xcb6fe7);console[_0x211b6f(0x360)](_0x5d446c);const _0x38ea57=_0x4df22e[_0x211b6f(0x234)]&&_0x262c41['every'](_0x957641=>_0x957641[_0x211b6f(0x39d)]!=='running'&&_0x957641[_0x211b6f(0x39d)]!==_0x211b6f(0x26c));if(_0x38ea57){console['error'](a54_0x238b4f['green'](_0x211b6f(0x391)));break;}console['error'](a54_0x238b4f['dim'](_0x211b6f(0x367)+_0x32935d*0x2+_0x211b6f(0x306))),await new Promise(_0x22ee8e=>setTimeout(_0x22ee8e,_0x3f7238)),_0x32935d++;}_0x32935d>=_0x4f1015&&console[_0x211b6f(0x30d)](a54_0x238b4f[_0x211b6f(0x344)](_0x211b6f(0x359)));}['renderTimeline'](_0xa2362f,_0x11b9e0,_0x37c57f){const _0x55ee7c=a54_0xb298fb,_0x68d89a=[],_0x3f05f4=TIMELINE_CONFIG[_0x55ee7c(0x26a)],_0x3c70b9=0x5,_0x293047=process[_0x55ee7c(0x296)]['columns']||0x78,_0x10b5f5=_0x293047-_0x3f05f4-_0x3c70b9,_0x22bbec=Math[_0x55ee7c(0x23d)](TIMELINE_CONFIG[_0x55ee7c(0x2b4)],Math[_0x55ee7c(0x27d)](_0x10b5f5,TIMELINE_CONFIG[_0x55ee7c(0x28b)])),_0x479da4=new Date(_0xa2362f[_0x55ee7c(0x217)])[_0x55ee7c(0x3a4)](),_0x459d55=_0xa2362f[_0x55ee7c(0x227)]?new Date(_0xa2362f[_0x55ee7c(0x227)])[_0x55ee7c(0x3a4)]():Date['now'](),_0x41dfd8={'start':_0x479da4,'end':_0x459d55,'duration':_0x459d55-_0x479da4},_0x515636=new Map(),_0x4c6a22=[];for(const _0x5078fd of _0x11b9e0){if(_0x5078fd[_0x55ee7c(0x336)]){const _0x4cd64c=new Date(_0x5078fd[_0x55ee7c(0x336)])[_0x55ee7c(0x3a4)](),_0x3c337d=_0x5078fd[_0x55ee7c(0x3a0)]?new Date(_0x5078fd[_0x55ee7c(0x3a0)])[_0x55ee7c(0x3a4)]():Date[_0x55ee7c(0x39b)](),_0x44afff={'start':_0x4cd64c,'end':_0x3c337d,'duration':_0x3c337d-_0x4cd64c};_0x515636['set'](_0x5078fd['id'],_0x44afff),_0x4c6a22[_0x55ee7c(0x2c7)]({'name':_0x5078fd['fullName'],'state':_0x5078fd[_0x55ee7c(0x39d)]||_0x55ee7c(0x353),'window':_0x44afff});}else _0x4c6a22[_0x55ee7c(0x2c7)]({'name':_0x5078fd[_0x55ee7c(0x289)],'state':_0x5078fd[_0x55ee7c(0x39d)]||'planned','window':undefined});}_0x4c6a22[_0x55ee7c(0x270)]((_0x5cde55,_0xcd9dcd)=>{const _0x45f383=_0x55ee7c;if(!_0x5cde55[_0x45f383(0x36d)])return 0x1;if(!_0xcd9dcd[_0x45f383(0x36d)])return-0x1;return _0x5cde55[_0x45f383(0x36d)][_0x45f383(0x2ef)]-_0xcd9dcd[_0x45f383(0x36d)]['start'];});const _0xa1111d=_0x4c6a22[_0x55ee7c(0x33b)],_0xc4aeb2=_0xa1111d>TIMELINE_CONFIG[_0x55ee7c(0x37b)];_0xc4aeb2&&_0x4c6a22[_0x55ee7c(0x2d9)](TIMELINE_CONFIG[_0x55ee7c(0x37b)]);const _0x26d293=calculateTimeScale(_0x41dfd8,_0x22bbec),_0x19ed5e=_0xa2362f[_0x55ee7c(0x234)]?_0xa2362f[_0x55ee7c(0x2d2)]?a54_0x238b4f[_0x55ee7c(0x23e)](_0x55ee7c(0x2d2)):a54_0x238b4f[_0x55ee7c(0x301)](_0x55ee7c(0x30d)):a54_0x238b4f[_0x55ee7c(0x211)](_0x55ee7c(0x20a)),_0x26f743=_0xa2362f[_0x55ee7c(0x1f5)]?.['id'],_0xc92e2a=_0xa2362f[_0x55ee7c(0x2ca)];let _0x166971;if(_0x26f743&&_0xc92e2a){const _0x4459bb=getWorkflowAttemptUrl(_0x37c57f,_0x26f743,_0xc92e2a,_0xa2362f['id']);_0x166971=hyperlink(a54_0x238b4f[_0x55ee7c(0x373)](_0xa2362f['id']),_0x4459bb);}else _0x166971=a54_0x238b4f[_0x55ee7c(0x373)](_0xa2362f['id']);_0x68d89a[_0x55ee7c(0x2c7)](_0x55ee7c(0x33c)+_0x166971+_0x55ee7c(0x222)+_0x19ed5e+_0x55ee7c(0x222)+formatElapsed(_0x41dfd8['duration']));if(_0x4c6a22[_0x55ee7c(0x33b)]>0x0){const _0x592c10=renderTimeAxis(_0x26d293,_0x22bbec),_0x1f336b=new Date(_0x41dfd8[_0x55ee7c(0x2ef)]),_0x5a9ea9=formatDate(_0x1f336b),_0x2daaff=TIMELINE_CONFIG[_0x55ee7c(0x2d3)]+TIMELINE_CONFIG[_0x55ee7c(0x2f0)]+_0x3f05f4,_0x3e4fbb=_0x5a9ea9['padStart'](_0x2daaff),_0x464cee=a54_0x238b4f['dim'](_0x3e4fbb);_0x68d89a[_0x55ee7c(0x2c7)](_0x464cee+'\x20'+_0x592c10);for(const _0x3deb85 of _0x4c6a22){_0x68d89a[_0x55ee7c(0x2c7)](renderTaskRow(_0x3deb85,_0x26d293,_0x22bbec,_0x3f05f4));}const _0x296241=calculateStats(_0x4c6a22);_0x68d89a['push'](formatStats(_0x296241)),_0xc4aeb2&&_0x68d89a[_0x55ee7c(0x2c7)](a54_0x238b4f[_0x55ee7c(0x344)](_0x55ee7c(0x338)+TIMELINE_CONFIG[_0x55ee7c(0x37b)]+'\x20of\x20'+_0xa1111d+_0x55ee7c(0x235))),_0x68d89a['push'](''),_0x68d89a['push'](a54_0x238b4f[_0x55ee7c(0x373)](_0x55ee7c(0x394))+('tdx\x20wf\x20attempt\x20'+_0xa2362f['id']+'\x20logs')+a54_0x238b4f[_0x55ee7c(0x373)]('\x20to\x20see\x20detailed\x20logs'));}else _0x68d89a[_0x55ee7c(0x2c7)](_0x55ee7c(0x21f));return _0x68d89a[_0x55ee7c(0x29a)]('\x0a');}[a54_0xb298fb(0x2cd)](_0x2a4ca4,_0x2d63ae){const _0x2eb1d7=a54_0xb298fb,_0x362f80=new Date(_0x2a4ca4[_0x2eb1d7(0x217)])[_0x2eb1d7(0x3a4)](),_0x495c12=_0x2a4ca4[_0x2eb1d7(0x227)]?new Date(_0x2a4ca4['finishedAt'])[_0x2eb1d7(0x3a4)]():Date[_0x2eb1d7(0x39b)](),_0x201206=_0x495c12-_0x362f80,_0x3c126e=[];for(const _0x37710f of _0x2d63ae){if(_0x37710f[_0x2eb1d7(0x336)]){const _0x1fe158=new Date(_0x37710f['startedAt'])[_0x2eb1d7(0x3a4)](),_0x4d98bb=_0x37710f[_0x2eb1d7(0x3a0)]?new Date(_0x37710f[_0x2eb1d7(0x3a0)])[_0x2eb1d7(0x3a4)]():Date[_0x2eb1d7(0x39b)]();_0x3c126e[_0x2eb1d7(0x2c7)]({'name':_0x37710f[_0x2eb1d7(0x289)],'state':_0x37710f[_0x2eb1d7(0x39d)]||_0x2eb1d7(0x353),'window':{'start':_0x1fe158,'end':_0x4d98bb,'duration':_0x4d98bb-_0x1fe158}});}else _0x3c126e[_0x2eb1d7(0x2c7)]({'name':_0x37710f[_0x2eb1d7(0x289)],'state':_0x37710f[_0x2eb1d7(0x39d)]||_0x2eb1d7(0x26c),'window':undefined});}const _0x2396be=calculateStats(_0x3c126e);return{'attempt':{'id':_0x2a4ca4['id'],'status':_0x2a4ca4[_0x2eb1d7(0x234)]?_0x2a4ca4[_0x2eb1d7(0x2d2)]?_0x2eb1d7(0x2d2):_0x2eb1d7(0x30d):_0x2eb1d7(0x20a),'createdAt':_0x2a4ca4['createdAt'],'finishedAt':_0x2a4ca4[_0x2eb1d7(0x227)],'duration_ms':_0x201206},'tasks':_0x3c126e[_0x2eb1d7(0x298)](_0x543d27=>({'name':_0x543d27['name'],'state':_0x543d27[_0x2eb1d7(0x39d)],'startedAt':_0x543d27[_0x2eb1d7(0x36d)]?new Date(_0x543d27[_0x2eb1d7(0x36d)][_0x2eb1d7(0x2ef)])['toISOString']():null,'updatedAt':_0x543d27[_0x2eb1d7(0x36d)]?new Date(_0x543d27[_0x2eb1d7(0x36d)][_0x2eb1d7(0x342)])['toISOString']():null,'duration_ms':_0x543d27['window']?.[_0x2eb1d7(0x1ff)]||null})),'stats':_0x2396be};}}export class WorkflowSchedulesCommand extends BaseCommand{[a54_0xb298fb(0x2f3)]='workflow:schedules';[a54_0xb298fb(0x346)]=a54_0xb298fb(0x224);async[a54_0xb298fb(0x335)](_0x2693d0){const _0x70ad6a=a54_0xb298fb,{options:_0x841d31,tdx:_0x260595}=_0x2693d0,_0x274bd6=await withSpinner(_0x70ad6a(0x36e),()=>_0x260595[_0x70ad6a(0x2e9)][_0x70ad6a(0x245)](),{'verbose':_0x841d31[_0x70ad6a(0x31d)]}),_0x1d6ff4=_0x274bd6[_0x70ad6a(0x364)];console[_0x70ad6a(0x30d)](_0x70ad6a(0x275)+_0x1d6ff4[_0x70ad6a(0x33b)]+_0x70ad6a(0x23b)+(_0x1d6ff4['length']!==0x1?'s':''));if(isStructuredFormat(_0x841d31))await handleSDKOutput(_0x1d6ff4,_0x841d31);else{if(_0x1d6ff4['length']===0x0)console[_0x70ad6a(0x360)]('No\x20schedules\x20found');else for(const _0x230cf0 of _0x1d6ff4){const _0x3f5742=_0x230cf0[_0x70ad6a(0x285)]?a54_0x238b4f[_0x70ad6a(0x344)](_0x70ad6a(0x202)):'',_0x36acc6=_0x230cf0['project']?.[_0x70ad6a(0x2f3)]?a54_0x238b4f[_0x70ad6a(0x373)]('\x20['+_0x230cf0[_0x70ad6a(0x1f5)][_0x70ad6a(0x2f3)]+']'):'',_0x1299c1=_0x230cf0[_0x70ad6a(0x362)]?a54_0x238b4f[_0x70ad6a(0x373)]('\x20next:\x20'+new Date(_0x230cf0[_0x70ad6a(0x362)])[_0x70ad6a(0x2d1)]()):'';console[_0x70ad6a(0x360)](_0x70ad6a(0x30f)+_0x230cf0['id']+'\x20'+(_0x230cf0[_0x70ad6a(0x2e9)]?.[_0x70ad6a(0x2f3)]||_0x70ad6a(0x38f))+_0x36acc6+_0x3f5742+_0x1299c1);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a54_0xb298fb(0x2f3)]=a54_0xb298fb(0x246);[a54_0xb298fb(0x346)]='Enable\x20a\x20workflow\x20schedule';async[a54_0xb298fb(0x335)](_0x5ba4f1){const _0x51adac=a54_0xb298fb,{options:_0xa8e0ae,args:_0x507abb,tdx:_0x5ab483}=_0x5ba4f1,_0x459f8d=_0x507abb[0x0];if(!_0x459f8d)return console[_0x51adac(0x30d)](a54_0x238b4f[_0x51adac(0x301)](_0x51adac(0x33f)),_0x51adac(0x376)),console[_0x51adac(0x30d)](a54_0x238b4f['dim'](_0x51adac(0x2a7))),console[_0x51adac(0x30d)](a54_0x238b4f[_0x51adac(0x373)](_0x51adac(0x21b))),0x1;const _0x7d25f8=await withSpinner(_0x51adac(0x287)+_0x459f8d+_0x51adac(0x3a6),()=>_0x5ab483[_0x51adac(0x2e9)]['enableSchedule'](_0x459f8d),{'verbose':_0xa8e0ae[_0x51adac(0x31d)]}),_0x206448=_0x7d25f8[_0x51adac(0x364)];return isStructuredFormat(_0xa8e0ae)?await handleSingleObjectOutput(_0x206448,_0xa8e0ae):(console[_0x51adac(0x360)](_0x51adac(0x347)+_0x459f8d+_0x51adac(0x299)+(_0x206448[_0x51adac(0x2e9)]?.['name']||'unknown')+')'),_0x206448['nextRunTime']&&console[_0x51adac(0x360)](a54_0x238b4f['dim']('\x20\x20Next\x20run:\x20'+new Date(_0x206448[_0x51adac(0x362)])[_0x51adac(0x2d1)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{['name']='workflow:schedule:disable';[a54_0xb298fb(0x346)]=a54_0xb298fb(0x242);async[a54_0xb298fb(0x335)](_0x2593de){const _0x57e50c=a54_0xb298fb,{options:_0x632e06,args:_0x590fa1,tdx:_0x436430}=_0x2593de,_0x354446=_0x590fa1[0x0];if(!_0x354446)return console[_0x57e50c(0x30d)](a54_0x238b4f[_0x57e50c(0x301)](_0x57e50c(0x33f)),_0x57e50c(0x376)),console['error'](a54_0x238b4f['dim'](_0x57e50c(0x2b9))),console[_0x57e50c(0x30d)](a54_0x238b4f[_0x57e50c(0x373)]('Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs')),0x1;const _0x395a10=await withSpinner(_0x57e50c(0x3a5)+_0x354446+_0x57e50c(0x3a6),()=>_0x436430[_0x57e50c(0x2e9)][_0x57e50c(0x218)](_0x354446),{'verbose':_0x632e06[_0x57e50c(0x31d)]}),_0x292b60=_0x395a10[_0x57e50c(0x364)];return isStructuredFormat(_0x632e06)?await handleSingleObjectOutput(_0x292b60,_0x632e06):console['log'](_0x57e50c(0x347)+_0x354446+_0x57e50c(0x213)+(_0x292b60[_0x57e50c(0x2e9)]?.[_0x57e50c(0x2f3)]||_0x57e50c(0x353))+')'),0x0;}}
|
|
1
|
+
const a54_0x311ab7=a54_0x4c77;(function(_0x538e57,_0x480c94){const _0xd29c7b=a54_0x4c77,_0xdcf896=_0x538e57();while(!![]){try{const _0x143b8a=parseInt(_0xd29c7b(0x1bd))/0x1+parseInt(_0xd29c7b(0x268))/0x2+-parseInt(_0xd29c7b(0x28f))/0x3*(parseInt(_0xd29c7b(0x2f6))/0x4)+-parseInt(_0xd29c7b(0x1f7))/0x5+parseInt(_0xd29c7b(0x1fa))/0x6*(-parseInt(_0xd29c7b(0x252))/0x7)+-parseInt(_0xd29c7b(0x319))/0x8+parseInt(_0xd29c7b(0x1d7))/0x9*(parseInt(_0xd29c7b(0x325))/0xa);if(_0x143b8a===_0x480c94)break;else _0xdcf896['push'](_0xdcf896['shift']());}catch(_0x3e25d2){_0xdcf896['push'](_0xdcf896['shift']());}}}(a54_0x1add,0xddeb4));import a54_0x17bcd3 from'chalk';import{existsSync}from'fs';import a54_0x14b5f4 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';function a54_0x1add(){const _0xd7b479=['fileCount','Loading\x20sessions...','Warning:','revision:\x20','limit','(use\x20--limit\x20to\x20see\x20more)','duration','params','\x20schedule','Force:\x20yes','isDirectory','Project\x20name:\x20','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','preparePushProject','workflow:use','stat','Pull\x20workflow\x20project\x20to\x20local\x20folder','LABEL_MIN_SPACING','Getting\x20attempt\x20details...','Error:\x20Invalid\x20parameter\x20format:\x20','readFile','session','Deleting\x20secret...','Source\x20directory:\x20','projectId','durationMs','attempt:','Parameters:\x20','now','pollTimeline','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','modified','window','No\x20sessions\x20found\x20in\x20project:\x20','changes','Total:\x20','sort','/sessions/','isArray','createdAt','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','select','\x0aApply\x20these\x20changes?','-\x20nothing\x20pushed','Enabling\x20schedule\x20#','ICON_SPACING','canceling','✔\x20Project:\x20','✔\x20Pushed\x20','deleteSecret','\x20disabled\x20(','Latest\x20session\x20has\x20no\x20attempt','startsWith','write','Downloading\x20logs...','\x22\x20with\x20new\x20revision?','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','Files\x20to\x20upload:\x20','\x20(disabled)','targetDir','No\x20attempts\x20found\x20for:\x20','MIN_TIMELINE_WIDTH','MIN_LABEL_COUNT','workflow:attempt','session_id','done','No\x20sessions\x20found','indexOf','Listing\x20workflow\x20attempts...','\x0aDry\x20run\x20-\x20nothing\x20pushed',',\x20Workflow:\x20','→\x20New\x20project:\x20','🔄\x20','Attempt\x20ID:\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x20\x20Next\x20run:\x20','\x20\x20Console:\x20','Setting\x20secret...','format','toLocaleString','✔\x20Workflow\x20run\x20started','LABEL_WIDTH_DIVISOR','No\x20workflows\x20found','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Using\x20attempt\x20','workflow:tasks','Error:\x20Project\x20name\x20is\x20required','28518oepeON','No\x20workflow\x20sessions\x20found','getTime','✔\x20Schedule\x20#','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','\x20secrets\x20set\x20for\x20project\x20\x27','parseProjectWorkflowPattern','\x20\x20Attempt\x20ID:\x20','output','...','skipValidation','Retry\x20a\x20session\x20or\x20attempt','targetExists','Pushing\x20project...','Key:\x20','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','\x20modified','\x20secret','Updating\x20','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','\x20\x20Session\x20ID:\x20','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','683734ZzJGxJ','workflow:secrets:list','\x0aUpdate\x20existing\x20project\x20\x22','delete','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Error:\x20Secret\x20key\x20is\x20required','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','clear','resolve','workflow:secrets:set','Project\x20name\x20is\x20required','\x20unchanged','\x20from\x20session\x20','workflow:workflows','New\x20project\x20name:\x20','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','workflow','round','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20tasks','workflow:projects','includeSubtasks','fullName','ICON_WIDTH','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','newProjectName','Error:\x20Invalid\x20JSON\x20in\x20--params','metadata','\x22\x20already\x20exists\x20(ID:\x20','(unknown)','Show\x20tasks\x20for\x20an\x20attempt','revision','\x27\x20from\x20project\x20\x27','No\x20workflows\x20found\x20in\x20project:\x20','keys','List\x20workflow\x20attempts','renderSingleTimeline','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','/attempt/','9LyHsKO','workflowName','\x0a✔\x20No\x20changes\x20to\x20push','From\x20task:\x20','Pushing\x20workflow\x20project...','List\x20workflows','dryRun','json','Workflow:\x20','Listing\x20schedules...','workflow:push','Start\x20a\x20workflow\x20run','MAX_POLL_ITERATIONS','deleted','task','No\x20sessions\x20with\x20timing\x20information','attempt','jsonl','taskName','workflow:delete','Analyzing\x20changes...','replace','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','yellow','project','✔\x20Downloaded\x20','push','filter','MAX_TIMELINE_WIDTH','sessionId','isTTY','diff','No\x20attempts\x20found\x20in\x20project:\x20','\x0a✔\x20Already\x20up\x20to\x20date','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','blue','error','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','applyPullProject','workflow:schedule:disable','Downloading\x20project\x20','\x20task','trim','values','startedAt','fill','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','Cloning\x20to\x20','nextRunTime','\x20\x20Changes:\x20','logs','List\x20workflow\x20schedules','log','Source\x20project:\x20','/app/workflows/','\x20deleted','match','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','relative','Setting\x20','📅\x20#','Disabling\x20schedule\x20#','Usage:\x20workflow:delete\x20<project-name-or-id>','tdx.json','download','📋\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','workflow:retry','resolveProjectId','follow','Select\x20a\x20task\x20to\x20view\x20logs:','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','navigateSessionsInteractive','fs/promises','buildTimelineData','requireProject','run','workflow:secrets:delete','List\x20all\x20workflow\x20projects','Error:\x20Attempt\x20ID\x20is\x20required','white','every','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Pattern:\x20','✔\x20Secret\x20\x27','\x20session','No\x20log\x20files\x20found\x20for\x20this\x20attempt','\x20sessions\x20','No\x20workflow\x20tdx.json\x20found','Resolving\x20project\x20\x27','\x20\x20Project\x20ID:\x20','type','basename','Params:\x20','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Filter:\x20','unchanged','✔\x20Showing\x20','message','logFiles','Source:\x20','some','cancelRequested','104724DXGMhv','📁\x20','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','workflow:pull','Retrying\x20attempt...','getDate','attemptId','substring','Listing\x20workflows...','executePushProject','✔\x20Workflow\x20project\x20context\x20cleared.','name','site','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','\x0aError:','Revision:\x20','end','green','getHours','\x20\x20Revision:\x20','MAX_TASKS_DISPLAY','Invalid\x20format:\x20','\x20\x20Project:\x20','trimEnd','newProjectId','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','yes','\x20project','Dry\x20run:\x20yes','Killing\x20attempt...','workflow:sessions','✔\x20Push\x20complete','start','14259576ZAaYhU','Project\x20filter:\x20','Show\x20logs\x20for\x20a\x20workflow\x20attempt','padStart','Project:\x20','param','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','floor','startTime','all','new','→\x20Project:\x20','48860kPpgOE','renderSessionsTimeline','stringify','includeRetried','✔\x20Retry\x20started','Secrets\x20to\x20set:\x20','Disable\x20a\x20workflow\x20schedule','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','finishedAt','Session\x20time:\x20','planned','group_error','updatedAt','hasChanges','execute','resolveProjectDir','workflow:upload','\x0aFailed\x20to\x20fetch\x20attempt\x20data','renderTimeline','Failed\x20to\x20fetch\x20attempt\x20data','projectName','running','repeat','Analyzing\x20project...','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','getFullYear','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','---\x20','map','\x20\x20New\x20attempt\x20ID:\x20','Writing\x20files...','No\x20workflow\x20projects\x20found','fromTask','kill','✔\x20Clone\x20complete','Error:','min','No\x20attempts\x20found','\x20-\x20','\x0aPolling...\x20(','prepareCloneProject','dim','✔\x20Workflow\x20project\x20set\x20to:\x20','context','columns','retryAttemptName','Session\x20','workflow:schedules','Tip:\x20cd\x20to\x20workflows/','No\x20sessions\x20found\x20for:\x20','generateSessionTimelineRows','retrySession','Validation:\x20skipped','\x1b[1A\x1b[2K','Session\x20not\x20found:\x20','\x20(system)','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Target\x20directory:\x20','\x20attempt','\x20(use\x20--limit\x20to\x20show\x20more)','✔\x20Project\x20updated','Fetching\x20log\x20files...','lastAttempt','\x20\x20Session\x20context\x20set\x20to:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','Listing\x20workflow\x20projects...','Pulling\x20project\x20','Getting\x20attempt\x20tasks...','POLL_INTERVAL_MS','cwd','sourceProjectName','Reason:\x20','table','✔\x20Found\x20','-\x20no\x20files\x20written','Resume\x20from:\x20','\x20secrets...','\x20\x20Workflow:\x20','pending','success','executeCloneProject','slice','max','workflow:run','verbose','list','\x20to\x20see\x20detailed\x20logs','\x0aDry\x20run\x20-\x20no\x20project\x20created','length','\x20new','\x20logs','workflows','MAX_LABEL_COUNT','setSecrets','set','session:','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','Status:\x20','reason','\x0a✔\x20Attempt\x20complete','Include\x20retried:\x20yes','workflow:clone','1644142zSrUsb','summary','sourceDir','Target:\x20','includes','sessionTime','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Loading\x20workflows...','Expected\x20format:\x20--param\x20key=value','Auto-selected\x20latest\x20session:\x20','No\x20matching\x20sessions\x20found','state','\x20\x20Source:\x20','unknown','resolveProject','workflow:attempts','data','stdout','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','toLowerCase','index','\x20\x20tdx\x20wf\x20use\x20<project>','get','Deleting\x20project\x20','cyan','\x20\x20Files\x20extracted:\x20','4563pDMrTo','\x27...','join','path','\x0aClone\x20\x22','Schedule\x20ID\x20is\x20required','showWorkflowConsoleUrl','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','attempts','split','localeCompare','msPerChar','getMonth','description','Filter:\x20project=','disableSchedule','Listing\x20secrets...','Enable\x20a\x20workflow\x20schedule','getMinutes','.\x20Expected\x20format:\x20KEY=VALUE','Attempt:\x20','\x20next:\x20','TASK_NAME_WIDTH','splice','parse','✔\x20Pull\x20complete','Select\x20a\x20workflow\x20to\x20run','\x22\x20to\x20new\x20project\x20\x22','find','\x0aDry\x20run\x20-\x20no\x20files\x20written','tasks','red','8181025YwoBgn','workflowProject','Cancelled','84EskUXb'];a54_0x1add=function(){return _0xd7b479;};return a54_0x1add();}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 a54_0xd27f88 from'prompts';function getAttemptStatusDisplay(_0x3c5466){const _0x595a35=a54_0x4c77;if(!_0x3c5466)return{'icon':'⏳','text':''};const {done:_0x38f32a,success:_0x1e18d0,cancelRequested:_0xd68cc3}=_0x3c5466;if(!_0x38f32a)return _0xd68cc3?{'icon':'🛑','text':a54_0x17bcd3[_0x595a35(0x2a6)](_0x595a35(0x229))}:{'icon':'🔄','text':a54_0x17bcd3[_0x595a35(0x2b2)](_0x595a35(0x16c))};if(_0x1e18d0)return{'icon':'✅','text':a54_0x17bcd3['green'](_0x595a35(0x1a6))};return{'icon':'❌','text':a54_0x17bcd3[_0x595a35(0x1f6)](_0x595a35(0x2b3))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x1a217e,_0x28a0f4,_0xd5b41e=0x0){const _0x6a2fee=a54_0x4c77;return _0x1a217e[_0xd5b41e]||_0x28a0f4[_0x6a2fee(0x1f8)];}['requireProject'](_0x50bc9d,_0x2e9287,_0x33a351=0x0){const _0x2f71ac=a54_0x4c77,_0x49738b=this[_0x2f71ac(0x1cb)](_0x50bc9d,_0x2e9287,_0x33a351);if(!_0x49738b)return console['error'](a54_0x17bcd3[_0x2f71ac(0x1f6)](_0x2f71ac(0x17a)),_0x2f71ac(0x272)),console[_0x2f71ac(0x2b3)](a54_0x17bcd3[_0x2f71ac(0x180)](_0x2f71ac(0x311))),null;return _0x49738b;}[a54_0x311ab7(0x258)](_0x324ec6,_0x1d82e5){const _0x43927a=a54_0x311ab7;if(_0x324ec6[0x0]){const _0x27eef8=_0x324ec6[0x0][_0x43927a(0x1e0)]('.');if(_0x27eef8[_0x43927a(0x1af)]===0x1)return{'projectName':_0x27eef8[0x0],'workflowName':undefined};else return _0x27eef8[_0x43927a(0x1af)]===0x2?{'projectName':_0x27eef8[0x0],'workflowName':_0x27eef8[0x1]}:(console[_0x43927a(0x2b3)](a54_0x17bcd3[_0x43927a(0x1f6)](_0x43927a(0x17a)),_0x43927a(0x2d1)),null);}return{'projectName':_0x1d82e5[_0x43927a(0x1f8)],'workflowName':undefined};}[a54_0x311ab7(0x166)](_0x3dfd06,_0x10cef3,_0x1c4398=0x0){const _0x3756e8=a54_0x311ab7;if(_0x3dfd06[_0x1c4398])return _0x3dfd06[_0x1c4398];if(_0x10cef3[_0x3756e8(0x1f8)]){const _0x333218=a54_0x14b5f4[_0x3756e8(0x1d9)](process[_0x3756e8(0x19c)](),'workflows',_0x10cef3[_0x3756e8(0x1f8)]);if(existsSync(a54_0x14b5f4[_0x3756e8(0x1d9)](_0x333218,_0x3756e8(0x2ce))))return _0x333218;}return undefined;}async[a54_0x311ab7(0x1dd)](_0x56e3e2,_0x2ad3c2,_0x4fb10c){const _0xe46eff=a54_0x311ab7;try{const _0x32776d=await _0x56e3e2[_0xe46eff(0x278)][_0xe46eff(0x1b2)](_0x2ad3c2,{'limit':0x1});if(_0x32776d['length']>0x0){const _0x42158c=_0x32776d[0x0]['id'],_0x54a8d6=getWorkflowUrl(_0x4fb10c,_0x42158c);console[_0xe46eff(0x2b3)]('\x20\x20Console:\x20'+a54_0x17bcd3['cyan'](_0x54a8d6));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a54_0x311ab7(0x301)]=a54_0x311ab7(0x209);['description']=a54_0x311ab7(0x267);async[a54_0x311ab7(0x165)](_0x10a882){const _0x91299f=a54_0x311ab7,{options:_0x59f7ac,args:_0x50e815,tdx:_0x4ea563}=_0x10a882,_0x5db60a=_0x50e815[0x0],_0x4ee00d=_0x59f7ac[_0x91299f(0x26f)];if(_0x4ee00d)return saveSessionContext({'workflow_project':undefined},_0x59f7ac[_0x91299f(0x210)]),console['log'](a54_0x17bcd3[_0x91299f(0x308)](_0x91299f(0x300))),0x0;if(!_0x5db60a)return console[_0x91299f(0x2b3)](a54_0x17bcd3['red']('Error:'),_0x91299f(0x272)),console[_0x91299f(0x2b3)](a54_0x17bcd3['dim']('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x91299f(0x2b3)](a54_0x17bcd3['dim'](_0x91299f(0x280))),0x1;const _0x1d2341=await withSpinner(_0x91299f(0x2e8)+_0x5db60a+_0x91299f(0x1d8),()=>_0x4ea563['workflow'][_0x91299f(0x2d3)](_0x5db60a),{'verbose':_0x59f7ac[_0x91299f(0x1ab)]}),{name:_0x4565a7}=_0x1d2341['data'];return saveSessionContext({'workflow_project':_0x4565a7},_0x59f7ac[_0x91299f(0x210)]),console[_0x91299f(0x2c3)](a54_0x17bcd3[_0x91299f(0x308)](_0x91299f(0x181)+a54_0x17bcd3[_0x91299f(0x1d5)](_0x4565a7))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a54_0x311ab7(0x27c);[a54_0x311ab7(0x1e4)]=a54_0x311ab7(0x2dd);async[a54_0x311ab7(0x165)](_0x166fe6){const _0x68ea2b=a54_0x311ab7,{options:_0x51cf07,args:_0x383a23,tdx:_0x4aa9a3}=_0x166fe6,_0xfa0611=_0x383a23[0x0];_0x51cf07['verbose']&&_0xfa0611&&console['error'](_0x68ea2b(0x2e2)+_0xfa0611);const _0x1223a7=await withSpinner(_0x68ea2b(0x198),()=>_0x4aa9a3[_0x68ea2b(0x278)]['projects'](_0xfa0611,{'limit':_0x51cf07[_0x68ea2b(0x1ff)]}),{'verbose':_0x51cf07[_0x68ea2b(0x1ab)]});let _0x549c7e=_0x1223a7['data'];_0x549c7e[_0x68ea2b(0x21f)]((_0x12a66e,_0x2d5db8)=>_0x12a66e[_0x68ea2b(0x301)]['localeCompare'](_0x2d5db8[_0x68ea2b(0x301)]));const _0x50bac0=_0x51cf07[_0x68ea2b(0x1ff)]||0x64,_0x2d0592=_0x549c7e['length']>=_0x50bac0?a54_0x17bcd3[_0x68ea2b(0x180)](_0x68ea2b(0x192)):'';console['error'](_0x68ea2b(0x1a0)+_0x549c7e[_0x68ea2b(0x1af)]+_0x68ea2b(0x313)+(_0x549c7e[_0x68ea2b(0x1af)]!==0x1?'s':'')+_0x2d0592);if(_0x51cf07[_0x68ea2b(0x249)]===_0x68ea2b(0x296)||_0x51cf07[_0x68ea2b(0x249)]===_0x68ea2b(0x2a0)||_0x51cf07[_0x68ea2b(0x249)]===_0x68ea2b(0x19f))await handleSDKOutput(_0x549c7e,_0x51cf07);else{if(_0x549c7e[_0x68ea2b(0x1af)]===0x0)_0xfa0611?console[_0x68ea2b(0x2c3)]('No\x20projects\x20match\x20pattern:\x20'+_0xfa0611):console[_0x68ea2b(0x2c3)](_0x68ea2b(0x176));else{const _0x420b1e=_0x549c7e[_0x68ea2b(0x173)](_0x3accbf=>{const _0x208ab0=_0x68ea2b,_0x445202=_0x3accbf[_0x208ab0(0x283)]?.[_0x208ab0(0x2f4)](_0x262f93=>_0x262f93['key']==='sys'),_0x58a724=_0x445202?a54_0x17bcd3[_0x208ab0(0x180)](_0x208ab0(0x18e)):'';return _0x208ab0(0x2f7)+_0x3accbf['name']+_0x58a724;});await writeOutput(_0x420b1e[_0x68ea2b(0x1d9)]('\x0a'),_0x51cf07[_0x68ea2b(0x25a)],_0x68ea2b(0x1ac));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a54_0x311ab7(0x275);['description']=a54_0x311ab7(0x294);async[a54_0x311ab7(0x165)](_0x3ca27b){const _0x4cfae3=a54_0x311ab7,{options:_0x1d0195,args:_0x208347,tdx:_0x28422c}=_0x3ca27b,_0x9f1558=this[_0x4cfae3(0x1cb)](_0x208347,_0x1d0195);_0x1d0195[_0x4cfae3(0x1ab)]&&_0x9f1558&&console[_0x4cfae3(0x2b3)](_0x4cfae3(0x31a)+_0x9f1558);const _0x20844e=await withSpinner(_0x4cfae3(0x2fe),()=>_0x28422c[_0x4cfae3(0x278)]['workflows'](_0x9f1558,{'limit':_0x1d0195[_0x4cfae3(0x1ff)]}),{'verbose':_0x1d0195[_0x4cfae3(0x1ab)]});let _0x2a3d2c=_0x20844e[_0x4cfae3(0x1cd)];_0x2a3d2c[_0x4cfae3(0x21f)]((_0x587e26,_0x171662)=>{const _0x30b372=_0x4cfae3,_0x2328c6=_0x587e26[_0x30b372(0x301)][_0x30b372(0x1e1)](_0x171662[_0x30b372(0x301)]);if(_0x2328c6!==0x0)return _0x2328c6;return(_0x587e26[_0x30b372(0x2a7)]?.[_0x30b372(0x301)]||'')['localeCompare'](_0x171662[_0x30b372(0x2a7)]?.[_0x30b372(0x301)]||'');});const _0x40e3e2=_0x1d0195[_0x4cfae3(0x1ff)]||0x64,_0x22c523=_0x2a3d2c[_0x4cfae3(0x1af)]>=_0x40e3e2?a54_0x17bcd3['dim'](_0x4cfae3(0x192)):'';console[_0x4cfae3(0x2b3)](_0x4cfae3(0x1a0)+_0x2a3d2c['length']+'\x20workflow'+(_0x2a3d2c[_0x4cfae3(0x1af)]!==0x1?'s':'')+_0x22c523);if(_0x1d0195[_0x4cfae3(0x249)]===_0x4cfae3(0x296)||_0x1d0195['format']==='jsonl'||_0x1d0195['format']===_0x4cfae3(0x19f))await handleSDKOutput(_0x2a3d2c,_0x1d0195);else{if(_0x2a3d2c[_0x4cfae3(0x1af)]===0x0)_0x9f1558?console[_0x4cfae3(0x2c3)](_0x4cfae3(0x289)+_0x9f1558):console[_0x4cfae3(0x2c3)](_0x4cfae3(0x24d));else{const _0x425464=_0x1d0195[_0x4cfae3(0x302)],_0x478274=_0x2a3d2c['map'](_0x144642=>{const _0xce531b=_0x4cfae3,_0x379b2d=a54_0x17bcd3['dim']('#'+_0x144642['id']),_0x53f287=hyperlink(_0x379b2d,getWorkflowUrl(_0x425464,_0x144642['id'])),_0xccaa8f=_0x144642[_0xce531b(0x2a7)]?.[_0xce531b(0x301)]?a54_0x17bcd3[_0xce531b(0x180)]('\x20('+_0x144642[_0xce531b(0x2a7)][_0xce531b(0x301)]+')'):'';return _0xce531b(0x2d0)+_0x53f287+'\x20'+_0x144642[_0xce531b(0x301)]+_0xccaa8f;});await writeOutput(_0x478274[_0x4cfae3(0x1d9)]('\x0a'),_0x1d0195[_0x4cfae3(0x25a)],_0x4cfae3(0x1ac));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x311ab7(0x301)]=a54_0x311ab7(0x316);[a54_0x311ab7(0x1e4)]='List\x20workflow\x20execution\x20sessions';async[a54_0x311ab7(0x165)](_0x246a89){const _0x339a72=a54_0x311ab7,{options:_0x1c254d,args:_0x21a8a3,tdx:_0x5e494d}=_0x246a89,_0x523213=this[_0x339a72(0x258)](_0x21a8a3,_0x1c254d);if(!_0x523213)return 0x1;const {projectName:_0x11b879,workflowName:_0x5d16cc}=_0x523213;if(_0x1c254d[_0x339a72(0x1ab)]){if(_0x11b879&&_0x5d16cc)console[_0x339a72(0x2b3)](_0x339a72(0x2ee)+_0x11b879+'.'+_0x5d16cc);else _0x11b879&&console['error']('Filter:\x20project='+_0x11b879);const _0x979be0=_0x1c254d['status'];_0x979be0&&console[_0x339a72(0x2b3)](_0x339a72(0x1b8)+_0x979be0);}let _0x1060ce=0x28;if(process[_0x339a72(0x1ce)][_0x339a72(0x2ad)]&&!_0x1c254d['output']&&!_0x1c254d[_0x339a72(0x249)]){const _0x3938e2=process['stdout']['rows']||0x28;_0x1060ce=Math[_0x339a72(0x1a9)](0x14,Math['floor'](_0x3938e2*0x2/0x3));}const _0x33d0ca=_0x1c254d[_0x339a72(0x1ff)]||_0x1060ce,_0x2c8e1b=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x5e494d[_0x339a72(0x278)]['sessions']({'projectName':_0x11b879,'workflowName':_0x5d16cc,'status':_0x1c254d['status'],'fromTime':_0x1c254d['from'],'toTime':_0x1c254d['to'],'limit':_0x33d0ca}),{'verbose':_0x1c254d['verbose']}),_0x4025be=_0x2c8e1b[_0x339a72(0x1cd)];_0x4025be['sort']((_0x52b907,_0x4b7567)=>{const _0x48bba7=_0x339a72,_0xf546d6=_0x52b907['sessionTime']||'',_0x85ddc1=_0x4b7567[_0x48bba7(0x1c2)]||'';return _0x85ddc1['localeCompare'](_0xf546d6);});_0x4025be[_0x339a72(0x1af)]>=_0x33d0ca?console[_0x339a72(0x2b3)](_0x339a72(0x2f0)+_0x4025be['length']+_0x339a72(0x2e6)+a54_0x17bcd3[_0x339a72(0x180)](_0x339a72(0x200))):console['error'](_0x339a72(0x1a0)+_0x4025be[_0x339a72(0x1af)]+_0x339a72(0x2e4)+(_0x4025be['length']!==0x1?'s':''));if(_0x1c254d['format']==='json'||_0x1c254d[_0x339a72(0x249)]===_0x339a72(0x2a0)||_0x1c254d[_0x339a72(0x249)]===_0x339a72(0x19f))await handleSDKOutput(_0x4025be,_0x1c254d);else{if(!process[_0x339a72(0x1ce)]['isTTY']||_0x1c254d[_0x339a72(0x25a)]){if(_0x4025be[_0x339a72(0x1af)]===0x0){if(_0x11b879&&_0x5d16cc)console[_0x339a72(0x2c3)](_0x339a72(0x188)+_0x11b879+'.'+_0x5d16cc);else _0x11b879?console[_0x339a72(0x2c3)](_0x339a72(0x21c)+_0x11b879):console['log']('No\x20sessions\x20found');}else{const _0x343ad1=_0x1c254d[_0x339a72(0x302)],_0x398452=this[_0x339a72(0x326)](_0x4025be,_0x343ad1);_0x1c254d['output']?await writeOutput(_0x398452,_0x1c254d[_0x339a72(0x25a)],_0x339a72(0x1ac)):console[_0x339a72(0x2c3)](_0x398452);}!_0x11b879&&(console['error'](''),console[_0x339a72(0x2b3)](a54_0x17bcd3[_0x339a72(0x180)](_0x339a72(0x15e))),console[_0x339a72(0x2b3)](a54_0x17bcd3[_0x339a72(0x180)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a54_0x17bcd3[_0x339a72(0x180)](_0x339a72(0x1d2))));}else{if(_0x4025be['length']===0x0){if(_0x11b879&&_0x5d16cc)console[_0x339a72(0x2c3)](_0x339a72(0x188)+_0x11b879+'.'+_0x5d16cc);else _0x11b879?console[_0x339a72(0x2c3)](_0x339a72(0x21c)+_0x11b879):console[_0x339a72(0x2c3)](_0x339a72(0x23d));}else await this[_0x339a72(0x2d7)](_0x4025be,_0x246a89,_0x11b879);}}return 0x0;}[a54_0x311ab7(0x326)](_0x316759,_0x4383db){const _0x36992a=a54_0x311ab7,_0x377b3b=[],_0x27042d=new Map();let _0x74c0f8=Infinity,_0x463c47=-Infinity;for(const _0x3c9fd4 of _0x316759){if(_0x3c9fd4['lastAttempt']?.[_0x36992a(0x222)]){const _0x4d7b9f=new Date(_0x3c9fd4[_0x36992a(0x195)][_0x36992a(0x222)])[_0x36992a(0x254)](),_0x376d96=_0x3c9fd4['lastAttempt']['finishedAt']?new Date(_0x3c9fd4[_0x36992a(0x195)]['finishedAt'])[_0x36992a(0x254)]():Date[_0x36992a(0x217)](),_0x1cf244=_0x3c9fd4[_0x36992a(0x2a7)]?.[_0x36992a(0x301)]||_0x36992a(0x285);!_0x27042d['has'](_0x1cf244)&&_0x27042d[_0x36992a(0x1b5)](_0x1cf244,[]),_0x27042d[_0x36992a(0x1d3)](_0x1cf244)[_0x36992a(0x2a9)]({'session':_0x3c9fd4,'startTime':_0x4d7b9f,'endTime':_0x376d96,'duration':_0x376d96-_0x4d7b9f}),_0x74c0f8=Math[_0x36992a(0x17b)](_0x74c0f8,_0x4d7b9f),_0x463c47=Math['max'](_0x463c47,_0x376d96);}}if(_0x27042d['size']===0x0)return _0x36992a(0x29e);const _0x3da575=process['stdout']['columns']||0x78,_0x1a0134=0x1e,_0x306267=0x32,_0x4c8ea0=0x4,_0x45dacc=Math[_0x36992a(0x17b)](_0x306267,Math[_0x36992a(0x1a9)](_0x1a0134,Math[_0x36992a(0x320)](_0x3da575*0.3))),_0x2f496c=_0x3da575-_0x45dacc-TIMELINE_CONFIG['GUTTER']-0x3-_0x4c8ea0,_0x359835=_0x463c47-_0x74c0f8,_0x3bb45b=_0x359835/_0x45dacc,_0x30fddf=renderTimeAxis({'startTime':_0x74c0f8,'endTime':_0x463c47,'durationMs':_0x359835,'msPerChar':_0x3bb45b},_0x45dacc),_0x34e328=[];for(const _0x3a5acc of _0x27042d[_0x36992a(0x2ba)]()){_0x34e328['push'](..._0x3a5acc);}_0x34e328['sort']((_0x430752,_0x2b2782)=>_0x2b2782[_0x36992a(0x321)]-_0x430752[_0x36992a(0x321)]);const _0x459a9e=new Date(_0x74c0f8),_0x109c83=formatDate(_0x459a9e),_0x1cf550=_0x4c8ea0+TIMELINE_CONFIG[_0x36992a(0x27f)]+TIMELINE_CONFIG[_0x36992a(0x228)]+_0x2f496c,_0x14e313='\x20'[_0x36992a(0x16d)](_0x1cf550-_0x109c83[_0x36992a(0x1af)]),_0x5d14a5=_0x14e313+a54_0x17bcd3[_0x36992a(0x180)](_0x109c83)+'\x20'+_0x30fddf;_0x377b3b[_0x36992a(0x2a9)](_0x5d14a5);const _0x2485ca=0x16;let _0x1f57af=0x0;for(const _0x4eb87c of _0x34e328){const _0x36b929=_0x4eb87c['session']['project']?.[_0x36992a(0x301)]||'?',_0x23ed4d=Math[_0x36992a(0x17b)](stringWidth(_0x36b929),_0x2485ca);_0x1f57af=Math[_0x36992a(0x1a9)](_0x1f57af,_0x23ed4d);}for(const _0x17136a of _0x34e328){const {session:_0xededc5,startTime:_0x5dab53,endTime:_0xaddddd,duration:_0x33f856}=_0x17136a,_0x41ffba=_0xededc5[_0x36992a(0x2a7)]?.['id'],_0x311411=_0xededc5['id'],_0x1e5bf4=_0xededc5[_0x36992a(0x2a7)]?.[_0x36992a(0x301)]||'?',_0x2314c1=_0xededc5[_0x36992a(0x278)]?.[_0x36992a(0x301)]||'?';let _0x451eeb,_0x5d94e6;if(_0xededc5[_0x36992a(0x195)]){const _0x4e838a=_0xededc5[_0x36992a(0x195)];!_0x4e838a[_0x36992a(0x23c)]?(_0x451eeb=_0x4e838a['cancelRequested']?'🛑':'🔄',_0x5d94e6=_0x4e838a[_0x36992a(0x2f5)]?a54_0x17bcd3[_0x36992a(0x2a6)]:a54_0x17bcd3['blue']):(_0x451eeb=_0x4e838a[_0x36992a(0x1a6)]?'✅':'❌',_0x5d94e6=_0x4e838a[_0x36992a(0x1a6)]?a54_0x17bcd3[_0x36992a(0x308)]:a54_0x17bcd3[_0x36992a(0x1f6)]);}else _0x451eeb='⏳',_0x5d94e6=a54_0x17bcd3[_0x36992a(0x180)];const _0x41aa09='#'+_0x311411,_0x4bd9e2=_0x41ffba?hyperlink(_0x41aa09,getWorkflowSessionUrl(_0x4383db,_0x41ffba,_0x311411)):_0x41aa09;let _0x279c27=_0x1e5bf4;stringWidth(_0x1e5bf4)>_0x2485ca&&(_0x279c27=_0x1e5bf4[_0x36992a(0x1a8)](0x0,_0x2485ca-0x1)+'…');const _0x5cb944=a54_0x17bcd3[_0x36992a(0x180)](_0x279c27),_0x3ab7c9=stringWidth(_0x279c27),_0x165022='\x20'[_0x36992a(0x16d)](_0x1f57af-stringWidth(_0x279c27)+0x2),_0x225a49='('+formatElapsed(_0x33f856)+')',_0x45dd22=stringWidth(_0x225a49),_0x5d57d4=stringWidth(_0x41aa09),_0x16e48d=_0x5d57d4+0x1+_0x3ab7c9+_0x165022[_0x36992a(0x1af)],_0x121d2f=_0x2f496c-_0x16e48d-_0x45dd22-0x1-0x8;let _0x413d88=_0x2314c1;stringWidth(_0x413d88)>_0x121d2f&&(_0x413d88=_0x413d88['slice'](0x0,_0x121d2f-0x1)+'…');const _0x1a213f=_0x4bd9e2+'\x20'+_0x5cb944+_0x165022+_0x413d88,_0x320fc1=stringWidth(_0x1a213f),_0x2e04d9=_0x2f496c-_0x320fc1-_0x45dd22,_0x957c31=_0x1a213f+'\x20'[_0x36992a(0x16d)](Math['max'](0x1,_0x2e04d9))+a54_0x17bcd3[_0x36992a(0x180)](_0x225a49),_0x397302=Math[_0x36992a(0x320)]((_0x5dab53-_0x74c0f8)/_0x3bb45b),_0x3b51cb=Math[_0x36992a(0x320)]((_0xaddddd-_0x74c0f8)/_0x3bb45b),_0x4e16a7=Math['max'](_0x397302+0x1,_0x3b51cb),_0x142358=new Array(_0x45dacc)[_0x36992a(0x2bc)]('\x20');for(let _0x2ec45f=_0x397302;_0x2ec45f<Math[_0x36992a(0x17b)](_0x4e16a7,_0x45dacc);_0x2ec45f++){_0x142358[_0x2ec45f]='─';}const _0x23174e=_0x142358['map'](_0x6ed221=>_0x6ed221==='\x20'?'\x20':_0x5d94e6(_0x6ed221))[_0x36992a(0x1d9)]('');_0x377b3b[_0x36992a(0x2a9)](_0x451eeb+'\x20'+_0x957c31+'│'+_0x23174e+'│');}return _0x377b3b[_0x36992a(0x1d9)]('\x0a');}async[a54_0x311ab7(0x2d7)](_0x1d32cc,_0x3de03d,_0x2f6cea){const _0x20b895=a54_0x311ab7,{options:_0x4f0b4d,tdx:_0x2710fc}=_0x3de03d,_0x5e81d8=_0x4f0b4d[_0x20b895(0x302)],{timelineRows:_0x13238a,timeAxisHeader:_0x3e20c8}=this[_0x20b895(0x189)](_0x1d32cc,_0x5e81d8),_0xed4b79=_0x13238a[_0x20b895(0x2aa)](_0x46ed19=>_0x46ed19[_0x20b895(0x2fc)]);if(_0xed4b79[_0x20b895(0x1af)]===0x0){const _0x1cee7a=this['renderSessionsTimeline'](_0x1d32cc,_0x5e81d8);console[_0x20b895(0x2c3)](_0x1cee7a);!_0x2f6cea&&(console[_0x20b895(0x2b3)](''),console[_0x20b895(0x2b3)](a54_0x17bcd3[_0x20b895(0x180)](_0x20b895(0x15e))),console[_0x20b895(0x2b3)](a54_0x17bcd3[_0x20b895(0x180)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a54_0x17bcd3[_0x20b895(0x180)](_0x20b895(0x1d2))));return;}_0x3e20c8&&console[_0x20b895(0x2c3)](_0x3e20c8);const _0x3ce61d=_0x13238a['filter'](_0x243787=>_0x243787[_0x20b895(0x2fc)])['map'](_0x515649=>({'title':_0x515649['displayLine'],'value':_0x515649[_0x20b895(0x2fc)]})),_0x309fee=process[_0x20b895(0x1ce)]['rows']||0x3c,_0xd15ba0=Math[_0x20b895(0x1a9)](0x28,Math[_0x20b895(0x320)](_0x309fee*0x2/0x3)),_0x11f6ca=await a54_0xd27f88({'type':'autocomplete','name':_0x20b895(0x2fc),'message':_0x20b895(0x2bd),'choices':_0x3ce61d,'initial':-0x1,'limit':_0xd15ba0,'clearFirst':!![],'fallback':{'title':_0x20b895(0x1c7),'value':null},'suggest':(_0xb29448,_0x379e28)=>{const _0x2b3a97=_0x20b895;if(!_0xb29448)return Promise[_0x2b3a97(0x270)](_0x379e28);const _0x2943ad=_0x379e28[_0x2b3a97(0x2aa)](_0xa61d1d=>{const _0x59dd81=_0x2b3a97,_0x291990=_0xa61d1d;return _0x291990['title'][_0x59dd81(0x1d0)]()['includes'](_0xb29448['toLowerCase']());});return Promise[_0x2b3a97(0x270)](_0x2943ad);}}),_0x899008=()=>{const _0x4e2d97=_0x20b895;process[_0x4e2d97(0x1ce)][_0x4e2d97(0x230)]('\x1b[1A\x1b[2K'),process[_0x4e2d97(0x1ce)]['write'](_0x4e2d97(0x18c)),process[_0x4e2d97(0x1ce)]['write'](_0x4e2d97(0x18c));},_0x1977a2=_0x11f6ca&&_0x11f6ca['attemptId']&&_0x11f6ca[_0x20b895(0x2fc)]!==null&&_0x11f6ca['attemptId'][_0x20b895(0x2b9)]()!=='';if(!_0x1977a2){_0x899008(),console[_0x20b895(0x2c3)](a54_0x17bcd3[_0x20b895(0x180)]('Cancelled'));return;}_0x899008();const _0x48b9c5=_0x1d32cc[_0x20b895(0x1f3)](_0x106d9a=>_0x106d9a[_0x20b895(0x195)]?.['id']===_0x11f6ca['attemptId']);if(_0x48b9c5){const _0x75ac19=_0x48b9c5[_0x20b895(0x2a7)]?.[_0x20b895(0x301)]||'?',_0x5c728a=_0x48b9c5['workflow']?.[_0x20b895(0x301)]||'?';console['log'](_0x20b895(0x31d)+a54_0x17bcd3['dim'](_0x75ac19)+_0x20b895(0x241)+a54_0x17bcd3[_0x20b895(0x180)](_0x5c728a));}const _0x5617d0=new WorkflowTimelineCommand();await _0x5617d0[_0x20b895(0x165)]({'args':[],'options':{..._0x4f0b4d,'attemptId':_0x11f6ca['attemptId']},'tdx':_0x2710fc});}[a54_0x311ab7(0x189)](_0x3fd03c,_0x3984a8){const _0x3fc059=a54_0x311ab7,_0xbad6c3=new Map();for(const _0xb0959e of _0x3fd03c){_0xb0959e['id']&&_0xb0959e[_0x3fc059(0x195)]?.['id']&&_0xbad6c3['set'](_0xb0959e['id'],_0xb0959e[_0x3fc059(0x195)]['id']);}const _0x15a349=[];let _0x1259f5='';const _0x257c29=this[_0x3fc059(0x326)](_0x3fd03c,_0x3984a8),_0x220150=_0x257c29[_0x3fc059(0x1e0)]('\x0a');for(const _0x1a4e29 of _0x220150){if(_0x1a4e29[_0x3fc059(0x22f)](_0x3fc059(0x2d6))||_0x1a4e29['match'](/^\s+\d{4}-\d{2}-\d{2}/))_0x1259f5=_0x1a4e29;else{if(_0x1a4e29[_0x3fc059(0x2c7)](/^[✅❌🔄🛑⏳]/)){const _0x8d977e=_0x1a4e29[_0x3fc059(0x2c7)](/#(\d+)/),_0x1672c1=_0x8d977e?_0x8d977e[0x1]:null,_0x3766e1=_0x1672c1?_0xbad6c3['get'](_0x1672c1)||null:null,_0x56ee33=_0x3fd03c[_0x3fc059(0x1f3)](_0x5699eb=>_0x5699eb['id']===_0x1672c1),_0x44a3c2=_0x56ee33?.[_0x3fc059(0x2a7)]?.[_0x3fc059(0x301)]||'';_0x15a349['push']({'displayLine':_0x1a4e29,'attemptId':_0x3766e1,'projectName':_0x44a3c2});}}}return{'timelineRows':_0x15a349,'timeAxisHeader':_0x1259f5};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']=a54_0x311ab7(0x1cc);[a54_0x311ab7(0x1e4)]=a54_0x311ab7(0x28b);async[a54_0x311ab7(0x165)](_0x754456){const _0x59c34d=a54_0x311ab7,{options:_0x2d38f0,args:_0x11199f,tdx:_0x489520}=_0x754456,_0x350b75=this['parseProjectWorkflowPattern'](_0x11199f,_0x2d38f0);if(!_0x350b75)return 0x1;const {projectName:_0x307ac2,workflowName:_0x523cad}=_0x350b75,_0x4a51b9=_0x2d38f0[_0x59c34d(0x15a)];if(_0x2d38f0[_0x59c34d(0x1ab)]){if(_0x307ac2&&_0x523cad)console[_0x59c34d(0x2b3)]('Filter:\x20'+_0x307ac2+'.'+_0x523cad);else _0x307ac2&&console[_0x59c34d(0x2b3)]('Filter:\x20project='+_0x307ac2);_0x4a51b9&&console[_0x59c34d(0x2b3)](_0x59c34d(0x1bb));}const _0xcfac11=await withSpinner(_0x59c34d(0x23f),()=>_0x489520['workflow'][_0x59c34d(0x1df)]({'projectName':_0x307ac2,'workflowName':_0x523cad,'includeRetried':_0x4a51b9,'limit':_0x2d38f0[_0x59c34d(0x1ff)]}),{'verbose':_0x2d38f0['verbose']}),_0x1dae15=_0xcfac11[_0x59c34d(0x1cd)],_0x10e622=_0x2d38f0[_0x59c34d(0x1ff)]||0x64,_0x5f4c70=_0x1dae15[_0x59c34d(0x1af)]>=_0x10e622?a54_0x17bcd3['dim']('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x59c34d(0x2b3)](_0x59c34d(0x1a0)+_0x1dae15[_0x59c34d(0x1af)]+_0x59c34d(0x191)+(_0x1dae15[_0x59c34d(0x1af)]!==0x1?'s':'')+_0x5f4c70);if(_0x2d38f0['format']==='json'||_0x2d38f0['format']===_0x59c34d(0x2a0)||_0x2d38f0[_0x59c34d(0x249)]===_0x59c34d(0x19f))await handleSDKOutput(_0x1dae15,_0x2d38f0);else{if(_0x1dae15[_0x59c34d(0x1af)]===0x0){if(_0x307ac2&&_0x523cad)console[_0x59c34d(0x2c3)](_0x59c34d(0x237)+_0x307ac2+'.'+_0x523cad);else _0x307ac2?console['log'](_0x59c34d(0x2af)+_0x307ac2):console[_0x59c34d(0x2c3)](_0x59c34d(0x17c));}else{const _0xbf14fc=_0x2d38f0[_0x59c34d(0x302)],_0x3e6420=_0x1dae15[_0x59c34d(0x173)](_0x37af89=>{const _0xbbce59=_0x59c34d,_0x8d145b=a54_0x17bcd3[_0xbbce59(0x180)]('#'+_0x37af89['id']),_0x35c833=_0x37af89[_0xbbce59(0x2a7)]?.['id'],_0x1fd21e=_0x37af89[_0xbbce59(0x23b)]||_0x37af89[_0xbbce59(0x2ac)],_0x2c267b=_0x35c833&&_0x1fd21e?hyperlink(_0x8d145b,getWorkflowAttemptUrl(_0xbf14fc,_0x35c833,_0x1fd21e,_0x37af89['id'])):_0x8d145b,{icon:_0x15a00c,text:_0x426660}=getAttemptStatusDisplay(_0x37af89),_0x2525c0=(_0x37af89[_0xbbce59(0x2a7)]?.['name']||'?')+'.'+(_0x37af89[_0xbbce59(0x278)]?.[_0xbbce59(0x301)]||'?'),_0x278ba7=_0x37af89[_0xbbce59(0x1c2)]?a54_0x17bcd3[_0xbbce59(0x180)](_0x37af89[_0xbbce59(0x1c2)]):'';return(_0x2c267b+'\x20'+_0x15a00c+(_0x426660?'\x20'+_0x426660:'')+'\x20'+_0x2525c0+'\x20'+_0x278ba7)[_0xbbce59(0x30e)]();});await writeOutput(_0x3e6420[_0x59c34d(0x1d9)]('\x0a'),_0x2d38f0[_0x59c34d(0x25a)],_0x59c34d(0x1ac));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x311ab7(0x301)]=a54_0x311ab7(0x23a);[a54_0x311ab7(0x1e4)]='Show\x20specific\x20attempt\x20details';async[a54_0x311ab7(0x165)](_0x379312){const _0x58017=a54_0x311ab7,{options:_0x318ff2,args:_0x1243d9,tdx:_0x49ba63}=_0x379312,_0x3f4b9b=_0x1243d9[0x0];if(!_0x3f4b9b)return console[_0x58017(0x2b3)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x318ff2[_0x58017(0x1ab)]&&console[_0x58017(0x2b3)](_0x58017(0x244)+_0x3f4b9b);const _0x35aa62=await withSpinner(_0x58017(0x20d),()=>_0x49ba63['workflow']['attempt'](_0x3f4b9b),{'verbose':_0x318ff2[_0x58017(0x1ab)]}),_0x26efbf=_0x35aa62[_0x58017(0x1cd)];let _0x4f7fd1;!_0x26efbf[_0x58017(0x23c)]?_0x4f7fd1=_0x26efbf[_0x58017(0x2f5)]?_0x58017(0x229):_0x58017(0x16c):_0x4f7fd1=_0x26efbf[_0x58017(0x1a6)]?_0x58017(0x1a6):_0x58017(0x2b3);let _0x550e90;if(_0x26efbf['createdAt']&&_0x26efbf['finishedAt']){const _0x466467=new Date(_0x26efbf[_0x58017(0x222)])[_0x58017(0x254)](),_0x34d703=new Date(_0x26efbf['finishedAt'])[_0x58017(0x254)]();_0x550e90=Math[_0x58017(0x279)]((_0x34d703-_0x466467)/0x3e8);}const _0x239e5a={'attempt_id':_0x26efbf['id'],'status':_0x4f7fd1,..._0x26efbf[_0x58017(0x1d1)]!==undefined&&{'index':_0x26efbf[_0x58017(0x1d1)]},..._0x26efbf[_0x58017(0x2a7)]&&{'project':_0x26efbf[_0x58017(0x2a7)][_0x58017(0x301)]},..._0x26efbf[_0x58017(0x278)]&&{'workflow':_0x26efbf[_0x58017(0x278)][_0x58017(0x301)]},..._0x26efbf[_0x58017(0x2ac)]&&{'session_id':_0x26efbf[_0x58017(0x2ac)]},..._0x26efbf[_0x58017(0x1c2)]&&{'session_time':_0x26efbf['sessionTime']},..._0x26efbf[_0x58017(0x184)]&&{'retry_attempt':_0x26efbf[_0x58017(0x184)]},..._0x550e90!==undefined&&{'duration_sec':_0x550e90},..._0x26efbf[_0x58017(0x222)]&&{'created_at':_0x26efbf[_0x58017(0x222)]},..._0x26efbf[_0x58017(0x15f)]&&{'finished_at':_0x26efbf[_0x58017(0x15f)]},...Object['keys'](_0x26efbf['params'])[_0x58017(0x1af)]>0x0&&{'params':_0x26efbf[_0x58017(0x202)]}};return await handleSingleObjectOutput(_0x239e5a,_0x318ff2),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a54_0x311ab7(0x250);[a54_0x311ab7(0x1e4)]=a54_0x311ab7(0x286);async[a54_0x311ab7(0x165)](_0x1469f2){const _0x2fd95e=a54_0x311ab7,{options:_0x25f4b8,args:_0x12beab,tdx:_0x8102d1}=_0x1469f2,_0x491d28=_0x12beab[0x0];if(!_0x491d28)return console[_0x2fd95e(0x2b3)](_0x2fd95e(0x2de)),0x1;const _0x49e457=_0x25f4b8[_0x2fd95e(0x27d)];_0x25f4b8[_0x2fd95e(0x1ab)]&&(console[_0x2fd95e(0x2b3)]('Attempt\x20ID:\x20'+_0x491d28),_0x49e457&&console[_0x2fd95e(0x2b3)]('Including\x20subtasks:\x20yes'));const _0x10a6f5=await withSpinner(_0x2fd95e(0x19a),()=>_0x8102d1[_0x2fd95e(0x278)][_0x2fd95e(0x1f5)](_0x491d28,_0x49e457||![]),{'verbose':_0x25f4b8[_0x2fd95e(0x1ab)]}),_0x500732=_0x10a6f5[_0x2fd95e(0x1cd)];return console[_0x2fd95e(0x2b3)]('✔\x20Found\x20'+_0x500732[_0x2fd95e(0x1af)]+_0x2fd95e(0x2b8)+(_0x500732[_0x2fd95e(0x1af)]!==0x1?'s':'')),await handleSDKOutput(_0x500732,_0x25f4b8),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']='workflow:logs';[a54_0x311ab7(0x1e4)]=a54_0x311ab7(0x31b);async[a54_0x311ab7(0x165)](_0x519c40){const _0x536d30=a54_0x311ab7,{options:_0x239f27,args:_0x17cfcf,tdx:_0x563fea}=_0x519c40,_0xac08a5=_0x17cfcf[0x0];let _0x21c7f4=_0x17cfcf[0x1];if(!_0xac08a5)return console['error'](_0x536d30(0x2de)),0x1;_0x239f27[_0x536d30(0x1ab)]&&(console[_0x536d30(0x2b3)](_0x536d30(0x244)+_0xac08a5),_0x21c7f4&&console[_0x536d30(0x2b3)]('Task\x20name:\x20'+_0x21c7f4));const _0x2a6bbf=await withSpinner(_0x536d30(0x194),()=>_0x563fea[_0x536d30(0x278)][_0x536d30(0x2f2)](_0xac08a5,_0x21c7f4),{'verbose':_0x239f27[_0x536d30(0x1ab)]}),_0x4b919c=_0x2a6bbf[_0x536d30(0x1cd)];if(_0x4b919c['length']===0x0)return console['error'](_0x536d30(0x2e5)),0x0;if(!_0x21c7f4&&(_0x239f27[_0x536d30(0x296)]||_0x239f27['format']))return await handleSDKOutput(_0x4b919c,_0x239f27),0x0;if(!_0x21c7f4){const _0xd8c311=_0x4b919c['map'](_0x2c3f12=>({'title':_0x2c3f12[_0x536d30(0x2a1)]+'\x20('+formatBytes(_0x2c3f12['fileSize'])+')','value':_0x2c3f12[_0x536d30(0x2a1)]})),_0x1fc3b4=await a54_0xd27f88({'type':_0x536d30(0x224),'name':'task','message':_0x536d30(0x2d5),'choices':_0xd8c311});if(!_0x1fc3b4[_0x536d30(0x29d)])return console[_0x536d30(0x2b3)](_0x536d30(0x1f9)),0x0;_0x21c7f4=_0x1fc3b4[_0x536d30(0x29d)];}const _0x47ae56=await withSpinner(_0x536d30(0x231),()=>_0x563fea[_0x536d30(0x278)][_0x536d30(0x2c1)](_0xac08a5,_0x21c7f4),{'verbose':_0x239f27[_0x536d30(0x1ab)]}),_0x393364=_0x47ae56['data'];return _0x393364?console[_0x536d30(0x2c3)](_0x393364):console[_0x536d30(0x2b3)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0x311ab7(0x301)]='workflow:kill';[a54_0x311ab7(0x1e4)]='Kill\x20a\x20running\x20attempt';async[a54_0x311ab7(0x165)](_0x480f07){const _0x40cabf=a54_0x311ab7,{options:_0x473aa8,args:_0x2beab2,tdx:_0x10663a}=_0x480f07,_0x1c8629=_0x2beab2[0x0];if(!_0x1c8629)return console[_0x40cabf(0x2b3)](_0x40cabf(0x2de)),0x1;const _0x273de5=_0x473aa8[_0x40cabf(0x1b9)];_0x473aa8[_0x40cabf(0x1ab)]&&(console[_0x40cabf(0x2b3)](_0x40cabf(0x244)+_0x1c8629),_0x273de5&&console[_0x40cabf(0x2b3)](_0x40cabf(0x19e)+_0x273de5));if(!_0x473aa8['yes']){if(!isInteractive())return console[_0x40cabf(0x2b3)](a54_0x17bcd3[_0x40cabf(0x1f6)](_0x40cabf(0x305)),_0x40cabf(0x27a)),console['error'](a54_0x17bcd3[_0x40cabf(0x180)](_0x40cabf(0x2a5))),0x1;const _0x1fe1cf=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x1c8629+'?');if(!_0x1fe1cf)return console[_0x40cabf(0x2b3)](a54_0x17bcd3['yellow'](_0x40cabf(0x1f9))),0x1;}const _0x2eaa5e=await withSpinner(_0x40cabf(0x315),()=>_0x10663a['workflow'][_0x40cabf(0x178)](_0x1c8629,_0x273de5),{'verbose':_0x473aa8[_0x40cabf(0x1ab)]}),_0x21998b=_0x2eaa5e[_0x40cabf(0x1cd)];return console[_0x40cabf(0x2b3)]('✔\x20'+_0x21998b),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a54_0x311ab7(0x2d2);['description']=a54_0x311ab7(0x25d);async[a54_0x311ab7(0x165)](_0xef83f9){const _0x122c38=a54_0x311ab7,{options:_0x4259c9,args:_0x39d0d2,tdx:_0x2519a3}=_0xef83f9,_0x6a7e6d=_0x39d0d2[0x0];if(!_0x6a7e6d)return console[_0x122c38(0x2b3)](_0x122c38(0x2b4)),console[_0x122c38(0x2b3)](_0x122c38(0x303)),0x1;let _0x4805ca=![],_0x1ce6cc=_0x6a7e6d;if(_0x6a7e6d[_0x122c38(0x22f)](_0x122c38(0x1b6)))_0x4805ca=!![],_0x1ce6cc=_0x6a7e6d[_0x122c38(0x2fd)](0x8);else{if(_0x6a7e6d[_0x122c38(0x22f)](_0x122c38(0x215)))_0x4805ca=![],_0x1ce6cc=_0x6a7e6d['substring'](0x8);else return console[_0x122c38(0x2b3)](_0x122c38(0x245)),console[_0x122c38(0x2b3)](_0x122c38(0x303)),0x1;}const _0x3acdf7=_0x4259c9[_0x122c38(0x177)],_0xfef0cc=_0x4259c9['resumeFrom'],_0x51ecf0=_0x4259c9[_0x122c38(0x202)],_0x5e22a6=_0x4259c9['force'];_0x4259c9['verbose']&&(console[_0x122c38(0x2b3)](_0x122c38(0x1c0)+(_0x4805ca?_0x122c38(0x210):_0x122c38(0x29f))+'\x20'+_0x1ce6cc),_0x3acdf7&&console[_0x122c38(0x2b3)](_0x122c38(0x292)+_0x3acdf7),_0xfef0cc&&console[_0x122c38(0x2b3)](_0x122c38(0x1a2)+_0xfef0cc),_0x51ecf0&&console[_0x122c38(0x2b3)](_0x122c38(0x2ec)+_0x51ecf0),_0x5e22a6&&console['error'](_0x122c38(0x204)));let _0x4d7f64;if(_0x51ecf0)try{if(_0x51ecf0[_0x122c38(0x22f)]('@')){const _0x3284ce=await import(_0x122c38(0x2d8)),_0x1a7e10=_0x51ecf0[_0x122c38(0x2fd)](0x1),_0x45497a=await _0x3284ce[_0x122c38(0x20f)](_0x1a7e10,'utf-8');_0x4d7f64=JSON['parse'](_0x45497a);}else _0x4d7f64=JSON[_0x122c38(0x1ef)](_0x51ecf0);}catch{return console['error'](_0x122c38(0x282)),0x1;}if(!_0x4259c9[_0x122c38(0x312)]){if(!isInteractive())return console['error'](a54_0x17bcd3[_0x122c38(0x1f6)](_0x122c38(0x305)),_0x122c38(0x27a)),console[_0x122c38(0x2b3)](a54_0x17bcd3[_0x122c38(0x180)](_0x122c38(0x2a5))),0x1;const _0x1dff2a=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x4805ca?_0x122c38(0x210):_0x122c38(0x29f))+'\x20'+_0x1ce6cc+'?');if(!_0x1dff2a)return console[_0x122c38(0x2b3)](a54_0x17bcd3[_0x122c38(0x2a6)](_0x122c38(0x1f9))),0x1;}let _0x46d325;_0x4805ca?_0x46d325=await withSpinner('Retrying\x20session...',()=>_0x2519a3[_0x122c38(0x278)][_0x122c38(0x18a)](_0x1ce6cc,{'fromTask':_0x3acdf7,'retryParams':_0x4d7f64}),{'verbose':_0x4259c9[_0x122c38(0x1ab)]}):_0x46d325=await withSpinner(_0x122c38(0x2fa),()=>_0x2519a3['workflow']['retryAttempt'](_0x1ce6cc,{'resumeFrom':_0xfef0cc,'retryParams':_0x4d7f64,'force':_0x5e22a6}),{'verbose':_0x4259c9['verbose']});const _0x5bf5af=_0x46d325[_0x122c38(0x1cd)];return console['error'](_0x122c38(0x15b)),console['error'](_0x122c38(0x174)+_0x5bf5af[_0x122c38(0x2fc)]),console['error']('\x20\x20Session\x20ID:\x20'+_0x5bf5af[_0x122c38(0x2ac)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x311ab7(0x301)]=a54_0x311ab7(0x1aa);[a54_0x311ab7(0x1e4)]=a54_0x311ab7(0x29a);async[a54_0x311ab7(0x165)](_0x32a603){const _0x2812cd=a54_0x311ab7,{options:_0x26ec06,args:_0x2dab93,tdx:_0x15761e}=_0x32a603;let _0xf9e2a4=_0x2dab93[0x0];if(!_0xf9e2a4){const _0x174d60=this[_0x2812cd(0x1cb)]([],_0x26ec06),_0x4fac77=await withSpinner(_0x2812cd(0x1c4),()=>_0x15761e[_0x2812cd(0x278)][_0x2812cd(0x1b2)](_0x174d60,{'limit':_0x26ec06[_0x2812cd(0x1ff)]}),{'verbose':_0x26ec06[_0x2812cd(0x1ab)]}),_0x10382c=_0x4fac77[_0x2812cd(0x1cd)];if(_0x10382c[_0x2812cd(0x1af)]===0x0)return console['error']('No\x20workflows\x20found'),!_0x174d60&&console[_0x2812cd(0x2b3)](a54_0x17bcd3['dim'](_0x2812cd(0x311))),0x1;const _0x1b5dc2=_0x10382c[_0x2812cd(0x173)](_0x59f816=>({'title':_0x59f816['project']?.[_0x2812cd(0x301)]+'.'+_0x59f816[_0x2812cd(0x301)],'value':_0x59f816[_0x2812cd(0x2a7)]?.[_0x2812cd(0x301)]+'.'+_0x59f816[_0x2812cd(0x301)],'description':_0x59f816[_0x2812cd(0x287)]?_0x2812cd(0x1fe)+_0x59f816[_0x2812cd(0x287)]:undefined})),_0x422b94=await a54_0xd27f88({'type':_0x2812cd(0x224),'name':_0x2812cd(0x278),'message':_0x2812cd(0x1f1),'choices':_0x1b5dc2});if(!_0x422b94['workflow'])return 0x1;_0xf9e2a4=_0x422b94['workflow'];}if(!_0xf9e2a4[_0x2812cd(0x1c1)]('.')){const _0x4bcb28=this['resolveProject']([],_0x26ec06);if(_0x4bcb28)_0xf9e2a4=_0x4bcb28+'.'+_0xf9e2a4;else return console[_0x2812cd(0x2b3)](a54_0x17bcd3[_0x2812cd(0x1f6)](_0x2812cd(0x17a)),_0x2812cd(0x16f)),console[_0x2812cd(0x2b3)](a54_0x17bcd3[_0x2812cd(0x180)](_0x2812cd(0x311))),0x1;}const _0x32cccc=_0x26ec06[_0x2812cd(0x31e)],_0x5b6ced=_0x26ec06[_0x2812cd(0x1c2)],_0x16bc58={};if(_0x32cccc&&Array[_0x2812cd(0x221)](_0x32cccc))for(const _0xee03fc of _0x32cccc){const _0x122f16=_0xee03fc[_0x2812cd(0x23e)]('=');if(_0x122f16===-0x1)return console[_0x2812cd(0x2b3)](_0x2812cd(0x20e)+_0xee03fc),console['error'](_0x2812cd(0x1c5)),0x1;const _0x358d3c=_0xee03fc['substring'](0x0,_0x122f16),_0x1fb9d5=_0xee03fc[_0x2812cd(0x2fd)](_0x122f16+0x1);try{_0x16bc58[_0x358d3c]=JSON[_0x2812cd(0x1ef)](_0x1fb9d5);}catch{_0x16bc58[_0x358d3c]=_0x1fb9d5;}}_0x26ec06['verbose']&&(console['error'](_0x2812cd(0x297)+_0xf9e2a4),Object[_0x2812cd(0x28a)](_0x16bc58)['length']>0x0&&console[_0x2812cd(0x2b3)](_0x2812cd(0x216)+JSON[_0x2812cd(0x327)](_0x16bc58)),_0x5b6ced&&console[_0x2812cd(0x2b3)](_0x2812cd(0x160)+_0x5b6ced));const _0xb9389c=await withSpinner('Starting\x20workflow\x20run...',()=>_0x15761e[_0x2812cd(0x278)][_0x2812cd(0x2db)](_0xf9e2a4,_0x16bc58,{'sessionTime':_0x5b6ced}),{'verbose':_0x26ec06[_0x2812cd(0x1ab)]}),_0x272f18=_0xb9389c['data'];console[_0x2812cd(0x2b3)](_0x2812cd(0x24b)),console[_0x2812cd(0x2b3)](_0x2812cd(0x259)+_0x272f18['id']),console[_0x2812cd(0x2b3)](_0x2812cd(0x266)+_0x272f18['sessionId']),console[_0x2812cd(0x2b3)](_0x2812cd(0x30d)+_0x272f18[_0x2812cd(0x2a7)]?.[_0x2812cd(0x301)]),console[_0x2812cd(0x2b3)](_0x2812cd(0x1a4)+_0x272f18[_0x2812cd(0x278)]?.[_0x2812cd(0x301)]);if(_0x272f18[_0x2812cd(0x2a7)]?.['id']&&_0x272f18[_0x2812cd(0x2ac)]&&_0x272f18['id']){const _0x58175d=_0x26ec06[_0x2812cd(0x302)],_0x42a7f1=getConsoleUrl(_0x58175d,_0x2812cd(0x2c5)+_0x272f18[_0x2812cd(0x2a7)]['id']+_0x2812cd(0x220)+_0x272f18[_0x2812cd(0x2ac)]+_0x2812cd(0x28e)+_0x272f18['id']);console[_0x2812cd(0x2b3)](_0x2812cd(0x247)+a54_0x17bcd3['cyan'](_0x42a7f1));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']='workflow:download';['description']=a54_0x311ab7(0x223);async[a54_0x311ab7(0x165)](_0xb4ae01){const _0x7a1f8a=a54_0x311ab7,{options:_0x28a952,args:_0x495961,tdx:_0x391f94}=_0xb4ae01,_0x548157=_0x495961[0x0],_0x2d4862=_0x495961[0x1]||'.';if(!_0x548157)return console[_0x7a1f8a(0x2b3)](_0x7a1f8a(0x251)),console[_0x7a1f8a(0x2b3)](_0x7a1f8a(0x26c)),0x1;const _0x1ff4e9=_0x28a952[_0x7a1f8a(0x287)];_0x28a952[_0x7a1f8a(0x1ab)]&&(console[_0x7a1f8a(0x2b3)]('Project:\x20'+_0x548157),console[_0x7a1f8a(0x2b3)]('Output\x20directory:\x20'+_0x2d4862),_0x1ff4e9&&console['error'](_0x7a1f8a(0x306)+_0x1ff4e9));const _0xffd0f0=await withSpinner(_0x7a1f8a(0x2b7)+_0x548157+'...',()=>_0x391f94[_0x7a1f8a(0x278)][_0x7a1f8a(0x2cf)](_0x548157,_0x2d4862,{'revision':_0x1ff4e9}),{'verbose':_0x28a952[_0x7a1f8a(0x1ab)]}),_0x30fc45=_0xffd0f0[_0x7a1f8a(0x1cd)];return console['error'](_0x7a1f8a(0x2a8)+_0x30fc45[_0x7a1f8a(0x16b)]),console[_0x7a1f8a(0x2b3)](_0x7a1f8a(0x30a)+_0x30fc45[_0x7a1f8a(0x287)]),console[_0x7a1f8a(0x2b3)](_0x7a1f8a(0x1d6)+_0x30fc45['filesExtracted']),console[_0x7a1f8a(0x2b3)]('\x20\x20Location:\x20'+_0x2d4862+'/'+_0x30fc45[_0x7a1f8a(0x16b)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x311ab7(0x301)]=a54_0x311ab7(0x167);[a54_0x311ab7(0x1e4)]=a54_0x311ab7(0x1cf);async['execute'](_0x1e915b){const _0x303c79=a54_0x311ab7,{options:_0x2b92b9,args:_0x54a341,tdx:_0x14addb}=_0x1e915b;let _0x5ee8d4='.',_0x10ce1b=_0x2b92b9[_0x303c79(0x301)];if(_0x54a341[0x0]){const {promises:_0x82a986}=await import('fs');try{const _0x2f2cd4=await _0x82a986[_0x303c79(0x20a)](_0x54a341[0x0]);if(_0x2f2cd4[_0x303c79(0x205)]())_0x5ee8d4=_0x54a341[0x0];else return console[_0x303c79(0x2b3)]('Error:\x20'+_0x54a341[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x10ce1b=_0x54a341[0x0],_0x5ee8d4='.';}}const _0x7c7cb9=_0x2b92b9['revision'],_0x2dc3f9=_0x2b92b9[_0x303c79(0x25c)];_0x2b92b9[_0x303c79(0x1ab)]&&(console[_0x303c79(0x2b3)]('Project\x20directory:\x20'+_0x5ee8d4),_0x10ce1b&&console[_0x303c79(0x2b3)](_0x303c79(0x206)+_0x10ce1b),_0x7c7cb9&&console[_0x303c79(0x2b3)](_0x303c79(0x306)+_0x7c7cb9),_0x2dc3f9&&console[_0x303c79(0x2b3)]('Validation:\x20skipped'));const _0x3f68c3=await withSpinner(_0x303c79(0x293),()=>_0x14addb[_0x303c79(0x278)][_0x303c79(0x2a9)](_0x5ee8d4,{'projectName':_0x10ce1b,'revision':_0x7c7cb9,'skipValidation':_0x2dc3f9}),{'verbose':_0x2b92b9[_0x303c79(0x1ab)]}),_0x30e90e=_0x3f68c3[_0x303c79(0x1cd)];return console[_0x303c79(0x2b3)](_0x303c79(0x22b)+_0x30e90e[_0x303c79(0x16b)]),console['error'](_0x303c79(0x2e9)+_0x30e90e[_0x303c79(0x213)]),console[_0x303c79(0x2b3)](_0x303c79(0x30a)+_0x30e90e[_0x303c79(0x287)]),await this[_0x303c79(0x1dd)](_0x14addb,_0x30e90e[_0x303c79(0x16b)],_0x2b92b9[_0x303c79(0x302)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x311ab7(0x301)]=a54_0x311ab7(0x2f9);[a54_0x311ab7(0x1e4)]=a54_0x311ab7(0x20b);async[a54_0x311ab7(0x165)](_0x5ca5a7){const _0x4a78c6=a54_0x311ab7,{options:_0x176072,args:_0x75b0f7,tdx:_0x15ae7b}=_0x5ca5a7,_0x7e97e5=_0x75b0f7[0x0],_0x529cf3=_0x75b0f7[0x1];if(!_0x7e97e5)return console[_0x4a78c6(0x2b3)](a54_0x17bcd3[_0x4a78c6(0x1f6)](_0x4a78c6(0x17a)),'Project\x20name\x20is\x20required'),console['error'](a54_0x17bcd3[_0x4a78c6(0x180)](_0x4a78c6(0x310))),0x1;const _0x2d7190=_0x176072[_0x4a78c6(0x287)];_0x176072[_0x4a78c6(0x1ab)]&&(console[_0x4a78c6(0x2b3)]('Project:\x20'+_0x7e97e5),_0x529cf3&&console[_0x4a78c6(0x2b3)](_0x4a78c6(0x190)+_0x529cf3),_0x2d7190&&console[_0x4a78c6(0x2b3)](_0x4a78c6(0x306)+_0x2d7190),_0x176072['dryRun']&&console[_0x4a78c6(0x2b3)]('Dry\x20run:\x20yes'));const _0xc65866=await withSpinner(_0x4a78c6(0x199)+_0x7e97e5+_0x4a78c6(0x25b),()=>_0x15ae7b[_0x4a78c6(0x278)]['pullProject'](_0x7e97e5,{'targetDir':_0x529cf3,'revision':_0x2d7190}),{'verbose':_0x176072['verbose']}),_0x1cbb6a=_0xc65866[_0x4a78c6(0x1cd)];_0x1cbb6a['isNewProject']?console[_0x4a78c6(0x2b3)](_0x4a78c6(0x242)+_0x1cbb6a[_0x4a78c6(0x16b)]):console['error'](_0x4a78c6(0x324)+_0x1cbb6a[_0x4a78c6(0x16b)]);console[_0x4a78c6(0x2b3)]('\x20\x20Revision:\x20'+_0x1cbb6a[_0x4a78c6(0x287)]),console['error']('\x20\x20Target:\x20'+(a54_0x14b5f4[_0x4a78c6(0x2c9)](process[_0x4a78c6(0x19c)](),_0x1cbb6a[_0x4a78c6(0x236)])||'.')),console[_0x4a78c6(0x2b3)](_0x4a78c6(0x2c0)+a54_0x17bcd3[_0x4a78c6(0x308)]('+'+_0x1cbb6a[_0x4a78c6(0x1be)][_0x4a78c6(0x323)]+_0x4a78c6(0x1b0))+',\x20'+(a54_0x17bcd3['yellow']('~'+_0x1cbb6a['summary']['modified']+_0x4a78c6(0x262))+',\x20')+(a54_0x17bcd3['red']('-'+_0x1cbb6a[_0x4a78c6(0x1be)][_0x4a78c6(0x29c)]+_0x4a78c6(0x2c6))+',\x20')+(''+a54_0x17bcd3[_0x4a78c6(0x180)](_0x1cbb6a[_0x4a78c6(0x1be)][_0x4a78c6(0x2ef)]+_0x4a78c6(0x273))));for(const _0x1b9128 of _0x1cbb6a[_0x4a78c6(0x21d)]){_0x1b9128[_0x4a78c6(0x2ea)]==='modified'&&_0x1b9128[_0x4a78c6(0x2ae)]&&(console[_0x4a78c6(0x2b3)]('\x0a'+a54_0x17bcd3[_0x4a78c6(0x1d5)](_0x4a78c6(0x172)+_0x1b9128[_0x4a78c6(0x1da)])),console[_0x4a78c6(0x2b3)](_0x1b9128[_0x4a78c6(0x2ae)]));}if(!_0x1cbb6a[_0x4a78c6(0x164)])return saveSessionContext({'workflow_project':_0x1cbb6a[_0x4a78c6(0x16b)]},_0x176072[_0x4a78c6(0x210)]),console[_0x4a78c6(0x2b3)](a54_0x17bcd3[_0x4a78c6(0x308)](_0x4a78c6(0x2b0))),console[_0x4a78c6(0x2b3)](a54_0x17bcd3[_0x4a78c6(0x180)](_0x4a78c6(0x196)+_0x1cbb6a['projectName'])),0x0;if(_0x176072[_0x4a78c6(0x295)])return console[_0x4a78c6(0x2b3)](a54_0x17bcd3[_0x4a78c6(0x2a6)](_0x4a78c6(0x1f4))),0x0;if(!_0x176072['yes']){if(!isInteractive())return console[_0x4a78c6(0x2b3)](a54_0x17bcd3[_0x4a78c6(0x1f6)](_0x4a78c6(0x305)),_0x4a78c6(0x27a)),console[_0x4a78c6(0x2b3)](a54_0x17bcd3[_0x4a78c6(0x180)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x44802b=await confirmKey(_0x4a78c6(0x225));if(!_0x44802b)return console[_0x4a78c6(0x2b3)](a54_0x17bcd3[_0x4a78c6(0x2a6)](_0x4a78c6(0x1f9)),_0x4a78c6(0x1a1)),0x1;}await withSpinner(_0x4a78c6(0x175),()=>_0x15ae7b['workflow'][_0x4a78c6(0x2b5)](_0x1cbb6a,{'revision':_0x2d7190}),{'verbose':_0x176072[_0x4a78c6(0x1ab)]}),saveSessionContext({'workflow_project':_0x1cbb6a[_0x4a78c6(0x16b)]},_0x176072[_0x4a78c6(0x210)]),console[_0x4a78c6(0x2b3)](a54_0x17bcd3[_0x4a78c6(0x308)](_0x4a78c6(0x1f0)));const _0x205884=a54_0x14b5f4['relative'](process[_0x4a78c6(0x19c)](),_0x1cbb6a[_0x4a78c6(0x236)])||'.';return console[_0x4a78c6(0x2b3)](a54_0x17bcd3[_0x4a78c6(0x180)]('\x20\x20Location:\x20'+_0x205884)),console['error'](a54_0x17bcd3[_0x4a78c6(0x180)](_0x4a78c6(0x196)+_0x1cbb6a['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a54_0x311ab7(0x301)]=a54_0x311ab7(0x299);[a54_0x311ab7(0x1e4)]=a54_0x311ab7(0x2b1);async['execute'](_0x5980a5){const _0x37b94f=a54_0x311ab7,{options:_0x16050b,args:_0x214f9d,tdx:_0x4dbf2f}=_0x5980a5,_0x532033=this['resolveProjectDir'](_0x214f9d,_0x16050b),_0x2d9eaa=_0x16050b['revision'],_0xe77be=_0x16050b['skipValidation'];_0x16050b[_0x37b94f(0x1ab)]&&(_0x532033&&console[_0x37b94f(0x2b3)](_0x37b94f(0x212)+_0x532033),_0x2d9eaa&&console[_0x37b94f(0x2b3)]('Revision:\x20'+_0x2d9eaa),_0x16050b['dryRun']&&console[_0x37b94f(0x2b3)]('Dry\x20run:\x20yes'),_0xe77be&&console[_0x37b94f(0x2b3)](_0x37b94f(0x18b)));let _0x5b705c;try{_0x5b705c=await withSpinner(_0x37b94f(0x2a3),()=>_0x4dbf2f['workflow'][_0x37b94f(0x208)]({'sourceDir':_0x532033,'revision':_0x2d9eaa,'skipValidation':_0xe77be}),{'verbose':_0x16050b[_0x37b94f(0x1ab)]});}catch(_0x3e046b){if(_0x3e046b instanceof Error&&_0x3e046b[_0x37b94f(0x2f1)][_0x37b94f(0x1c1)](_0x37b94f(0x2e7)))return console[_0x37b94f(0x2b3)](a54_0x17bcd3[_0x37b94f(0x1f6)](_0x37b94f(0x17a)),_0x37b94f(0x261)),_0x16050b[_0x37b94f(0x1f8)]?console['error'](a54_0x17bcd3[_0x37b94f(0x180)](_0x37b94f(0x187)+_0x16050b[_0x37b94f(0x1f8)]+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x16050b[_0x37b94f(0x1f8)]+'\x27')):console['error'](a54_0x17bcd3[_0x37b94f(0x180)](_0x37b94f(0x31f))),0x1;throw _0x3e046b;}const _0x2a04c6=_0x5b705c['data'];console['error'](_0x37b94f(0x22a)+_0x2a04c6[_0x37b94f(0x16b)]),console[_0x37b94f(0x2b3)](_0x37b94f(0x1c9)+_0x2a04c6[_0x37b94f(0x1bf)]),console[_0x37b94f(0x2b3)]('\x20\x20Revision:\x20'+_0x2a04c6['revision']),console['error'](_0x37b94f(0x2c0)+a54_0x17bcd3[_0x37b94f(0x308)]('+'+_0x2a04c6['summary']['new']+'\x20new')+',\x20'+(a54_0x17bcd3[_0x37b94f(0x2a6)]('~'+_0x2a04c6[_0x37b94f(0x1be)][_0x37b94f(0x21a)]+_0x37b94f(0x262))+',\x20')+(a54_0x17bcd3['red']('-'+_0x2a04c6[_0x37b94f(0x1be)]['deleted']+_0x37b94f(0x2c6))+',\x20')+(''+a54_0x17bcd3[_0x37b94f(0x180)](_0x2a04c6[_0x37b94f(0x1be)][_0x37b94f(0x2ef)]+_0x37b94f(0x273))));for(const _0x37526d of _0x2a04c6[_0x37b94f(0x21d)]){_0x37526d[_0x37b94f(0x2ea)]===_0x37b94f(0x21a)&&_0x37526d[_0x37b94f(0x2ae)]&&(console[_0x37b94f(0x2b3)]('\x0a'+a54_0x17bcd3[_0x37b94f(0x1d5)](_0x37b94f(0x172)+_0x37526d[_0x37b94f(0x1da)])),console['error'](_0x37526d[_0x37b94f(0x2ae)]));}if(!_0x2a04c6[_0x37b94f(0x164)])return console['error'](a54_0x17bcd3[_0x37b94f(0x308)](_0x37b94f(0x291))),await this[_0x37b94f(0x1dd)](_0x4dbf2f,_0x2a04c6[_0x37b94f(0x16b)],_0x16050b[_0x37b94f(0x302)]),0x0;if(_0x16050b[_0x37b94f(0x295)])return console[_0x37b94f(0x2b3)](a54_0x17bcd3[_0x37b94f(0x2a6)](_0x37b94f(0x240))),0x0;if(!_0x16050b['yes']){if(!isInteractive())return console[_0x37b94f(0x2b3)](a54_0x17bcd3[_0x37b94f(0x1f6)]('\x0aError:'),_0x37b94f(0x27a)),console[_0x37b94f(0x2b3)](a54_0x17bcd3[_0x37b94f(0x180)](_0x37b94f(0x2a5))),0x1;const _0x2a8c0e=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x2a8c0e)return console[_0x37b94f(0x2b3)](a54_0x17bcd3['yellow'](_0x37b94f(0x1f9)),_0x37b94f(0x226)),0x1;}const _0x1e63a9=await withSpinner(_0x37b94f(0x25f),()=>_0x4dbf2f['workflow'][_0x37b94f(0x2ff)](_0x2a04c6),{'verbose':_0x16050b[_0x37b94f(0x1ab)]}),_0x317f8d=_0x1e63a9[_0x37b94f(0x1cd)];return console[_0x37b94f(0x2b3)](a54_0x17bcd3[_0x37b94f(0x308)](_0x37b94f(0x317))),console[_0x37b94f(0x2b3)](_0x37b94f(0x2e9)+_0x317f8d[_0x37b94f(0x213)]),console[_0x37b94f(0x2b3)](_0x37b94f(0x30a)+_0x317f8d[_0x37b94f(0x287)]),await this[_0x37b94f(0x1dd)](_0x4dbf2f,_0x317f8d['projectName'],_0x16050b[_0x37b94f(0x302)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0x311ab7(0x301)]=a54_0x311ab7(0x1bc);['description']=a54_0x311ab7(0x304);async[a54_0x311ab7(0x165)](_0x1d7f70){const _0x42cd79=a54_0x311ab7,{options:_0x331697,args:_0x638325,tdx:_0x453a60}=_0x1d7f70,_0x5a7d95=this[_0x42cd79(0x166)](_0x638325,_0x331697),_0x4ead56=_0x331697['name'],_0x446925=_0x331697['revision'],_0x3d85a3=_0x331697[_0x42cd79(0x25c)];if(!_0x5a7d95)return console[_0x42cd79(0x2b3)](a54_0x17bcd3[_0x42cd79(0x1f6)]('Error:'),'Source\x20directory\x20is\x20required'),console[_0x42cd79(0x2b3)](a54_0x17bcd3[_0x42cd79(0x180)](_0x42cd79(0x265))),console[_0x42cd79(0x2b3)](a54_0x17bcd3[_0x42cd79(0x180)](_0x42cd79(0x197))),0x1;if(!_0x4ead56)return console[_0x42cd79(0x2b3)](a54_0x17bcd3['red'](_0x42cd79(0x17a)),_0x42cd79(0x2c8)),console[_0x42cd79(0x2b3)](a54_0x17bcd3['dim'](_0x42cd79(0x265))),0x1;_0x331697[_0x42cd79(0x1ab)]&&(console[_0x42cd79(0x2b3)]('Source\x20directory:\x20'+_0x5a7d95),console['error'](_0x42cd79(0x276)+_0x4ead56),_0x446925&&console['error']('Revision:\x20'+_0x446925),_0x331697['dryRun']&&console['error'](_0x42cd79(0x314)),_0x3d85a3&&console[_0x42cd79(0x2b3)](_0x42cd79(0x18b)));const _0x4820e1=await withSpinner(_0x42cd79(0x16e),()=>_0x453a60[_0x42cd79(0x278)][_0x42cd79(0x17f)](_0x5a7d95,_0x4ead56,{'revision':_0x446925,'skipValidation':_0x3d85a3}),{'verbose':_0x331697[_0x42cd79(0x1ab)]}),_0xc28a25=_0x4820e1[_0x42cd79(0x1cd)];console[_0x42cd79(0x2b3)](_0x42cd79(0x2f3)+_0xc28a25[_0x42cd79(0x1bf)]);_0xc28a25[_0x42cd79(0x19d)]&&console[_0x42cd79(0x2b3)](_0x42cd79(0x2c4)+_0xc28a25['sourceProjectName']);console[_0x42cd79(0x2b3)](_0x42cd79(0x276)+_0xc28a25['newProjectName']),console[_0x42cd79(0x2b3)](_0x42cd79(0x306)+_0xc28a25[_0x42cd79(0x287)]),console[_0x42cd79(0x2b3)](_0x42cd79(0x234)+_0xc28a25[_0x42cd79(0x1fb)]);_0xc28a25[_0x42cd79(0x25e)]&&(console['error'](a54_0x17bcd3[_0x42cd79(0x2a6)]('\x0a⚠\x20Project\x20\x22'+_0xc28a25[_0x42cd79(0x281)]+_0x42cd79(0x284)+_0xc28a25['existingProjectId']+')')),console[_0x42cd79(0x2b3)](a54_0x17bcd3[_0x42cd79(0x2a6)](_0x42cd79(0x171))));if(_0x331697[_0x42cd79(0x295)])return console[_0x42cd79(0x2b3)](a54_0x17bcd3['yellow'](_0x42cd79(0x1ae))),0x0;if(!_0x331697['yes']){if(!isInteractive())return console[_0x42cd79(0x2b3)](a54_0x17bcd3['red']('\x0aError:'),_0x42cd79(0x27a)),console[_0x42cd79(0x2b3)](a54_0x17bcd3['dim'](_0x42cd79(0x2a5))),0x1;const _0x576efd=_0xc28a25[_0x42cd79(0x19d)]||a54_0x14b5f4[_0x42cd79(0x2eb)](_0x5a7d95),_0x5ea339=_0xc28a25['targetExists']?_0x42cd79(0x26a)+_0x4ead56+_0x42cd79(0x232):_0x42cd79(0x1db)+_0x576efd+_0x42cd79(0x1f2)+_0x4ead56+'\x22?',_0x58003f=await confirmKey(_0x5ea339);if(!_0x58003f)return console['error'](a54_0x17bcd3[_0x42cd79(0x2a6)]('Cancelled')),0x1;}const _0x26c07d=await withSpinner(_0xc28a25['targetExists']?_0x42cd79(0x264)+_0x4ead56+_0x42cd79(0x25b):_0x42cd79(0x2be)+_0x4ead56+'...',()=>_0x453a60['workflow'][_0x42cd79(0x1a7)](_0xc28a25),{'verbose':_0x331697[_0x42cd79(0x1ab)]}),_0x303e9e=_0x26c07d[_0x42cd79(0x1cd)];return console[_0x42cd79(0x2b3)](a54_0x17bcd3[_0x42cd79(0x308)](_0xc28a25['targetExists']?_0x42cd79(0x193):_0x42cd79(0x179))),console[_0x42cd79(0x2b3)](_0x42cd79(0x30d)+_0x303e9e[_0x42cd79(0x281)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x303e9e[_0x42cd79(0x30f)]),console[_0x42cd79(0x2b3)](_0x42cd79(0x30a)+_0x303e9e[_0x42cd79(0x287)]),await this[_0x42cd79(0x1dd)](_0x453a60,_0x303e9e[_0x42cd79(0x281)],_0x331697[_0x42cd79(0x302)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x311ab7(0x301)]=a54_0x311ab7(0x2a2);[a54_0x311ab7(0x1e4)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a54_0x311ab7(0x165)](_0x4cf1ec){const _0x27510=a54_0x311ab7,{options:_0x71f756,args:_0x3900f9,tdx:_0x5592f8}=_0x4cf1ec,_0x4579af=_0x3900f9[0x0];if(!_0x4579af)return console[_0x27510(0x2b3)](_0x27510(0x28d)),console[_0x27510(0x2b3)](_0x27510(0x2cd)),0x1;_0x71f756[_0x27510(0x1ab)]&&console[_0x27510(0x2b3)]('Project:\x20'+_0x4579af);if(!_0x71f756['yes']){if(!isInteractive())return console[_0x27510(0x2b3)](a54_0x17bcd3[_0x27510(0x1f6)](_0x27510(0x305)),_0x27510(0x27a)),console[_0x27510(0x2b3)](a54_0x17bcd3['dim'](_0x27510(0x2a5))),0x1;const _0x2b5570=await confirmKey(_0x27510(0x2e1)+_0x4579af+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x2b5570)return console[_0x27510(0x2b3)](a54_0x17bcd3[_0x27510(0x2a6)](_0x27510(0x1f9))),0x1;}const _0x401667=await withSpinner(_0x27510(0x1d4)+_0x4579af+_0x27510(0x25b),()=>_0x5592f8['workflow'][_0x27510(0x26b)](_0x4579af),{'verbose':_0x71f756[_0x27510(0x1ab)]}),_0x1ae6da=_0x401667['data'];return console[_0x27510(0x2b3)]('✔\x20Deleted\x20project\x20'+_0x1ae6da[_0x27510(0x16b)]),console[_0x27510(0x2b3)](_0x27510(0x2e9)+_0x1ae6da['projectId']),0x0;}}export function parseKeyValue(_0xe28606){const _0x3f4a4c=a54_0x311ab7,_0xaf5d12=_0xe28606['indexOf']('=');if(_0xaf5d12===-0x1)throw new Error(_0x3f4a4c(0x30c)+_0xe28606+_0x3f4a4c(0x1ea));const _0x45ea03=_0xe28606[_0x3f4a4c(0x2fd)](0x0,_0xaf5d12),_0x3a7462=_0xe28606[_0x3f4a4c(0x2fd)](_0xaf5d12+0x1);if(!_0x45ea03)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x45ea03,'value':_0x3a7462};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x311ab7(0x301)]=a54_0x311ab7(0x269);[a54_0x311ab7(0x1e4)]=a54_0x311ab7(0x2ed);async[a54_0x311ab7(0x165)](_0x1664aa){const _0x3cd646=a54_0x311ab7,{options:_0x32f6f7,args:_0x582212,tdx:_0x11ea74}=_0x1664aa,_0x5b3e36=this[_0x3cd646(0x2da)](_0x582212,_0x32f6f7);if(!_0x5b3e36)return 0x1;_0x32f6f7[_0x3cd646(0x1ab)]&&console[_0x3cd646(0x2b3)](_0x3cd646(0x31d)+_0x5b3e36);const _0x1d5f87=await withSpinner(_0x3cd646(0x1e7),()=>_0x11ea74['workflow']['listSecrets'](_0x5b3e36),{'verbose':_0x32f6f7[_0x3cd646(0x1ab)]}),{secrets:_0x58677f}=_0x1d5f87[_0x3cd646(0x1cd)];return console[_0x3cd646(0x2b3)](_0x3cd646(0x1a0)+_0x58677f['length']+_0x3cd646(0x263)+(_0x58677f['length']!==0x1?'s':'')),await handleSDKOutput(_0x58677f,_0x32f6f7),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x311ab7(0x301)]=a54_0x311ab7(0x271);[a54_0x311ab7(0x1e4)]='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async[a54_0x311ab7(0x165)](_0x46e2f1){const _0x42fc2a=a54_0x311ab7,{options:_0x586903,args:_0x59183d,tdx:_0x6d6385}=_0x46e2f1;let _0x55e1f4,_0x10824e;if(_0x59183d[_0x42fc2a(0x1af)]>=0x1&&!_0x59183d[0x0][_0x42fc2a(0x1c1)]('='))_0x55e1f4=_0x59183d[0x0],_0x10824e=_0x59183d[_0x42fc2a(0x1a8)](0x1);else{if(_0x59183d[_0x42fc2a(0x1af)]>=0x1&&_0x586903[_0x42fc2a(0x1f8)])_0x55e1f4=_0x586903[_0x42fc2a(0x1f8)],_0x10824e=_0x59183d;else return _0x59183d['length']>=0x1?(console[_0x42fc2a(0x2b3)](_0x42fc2a(0x251)),console[_0x42fc2a(0x2b3)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x42fc2a(0x2b3)](_0x42fc2a(0x26e)),console[_0x42fc2a(0x2b3)](_0x42fc2a(0x233)),0x1);}if(_0x10824e[_0x42fc2a(0x1af)]===0x0)return console[_0x42fc2a(0x2b3)](_0x42fc2a(0x26e)),console[_0x42fc2a(0x2b3)](_0x42fc2a(0x233)),0x1;const _0x3cc715={};try{for(const _0x2d1250 of _0x10824e){const {key:_0x2f64c1,value:_0x4ee1e9}=parseKeyValue(_0x2d1250);_0x3cc715[_0x2f64c1]=_0x4ee1e9;}}catch(_0x5742b5){return _0x5742b5 instanceof Error&&console['error'](a54_0x17bcd3[_0x42fc2a(0x1f6)](_0x42fc2a(0x17a)),_0x5742b5[_0x42fc2a(0x2f1)]),0x1;}const _0xcea9e1=Object[_0x42fc2a(0x28a)](_0x3cc715);_0x586903[_0x42fc2a(0x1ab)]&&(console[_0x42fc2a(0x2b3)]('Project:\x20'+_0x55e1f4),console[_0x42fc2a(0x2b3)](_0x42fc2a(0x15c)+_0xcea9e1[_0x42fc2a(0x1d9)](',\x20')));const _0x133bff=await withSpinner(_0xcea9e1[_0x42fc2a(0x1af)]===0x1?_0x42fc2a(0x248):_0x42fc2a(0x2ca)+_0xcea9e1[_0x42fc2a(0x1af)]+_0x42fc2a(0x1a3),()=>_0x6d6385[_0x42fc2a(0x278)][_0x42fc2a(0x1b4)](_0x55e1f4,_0x3cc715),{'verbose':_0x586903[_0x42fc2a(0x1ab)]}),_0x25253d=_0x133bff[_0x42fc2a(0x1cd)];return console['error'](_0xcea9e1[_0x42fc2a(0x1af)]===0x1?'✔\x20Secret\x20\x27'+_0x25253d['keys'][0x0]+_0x42fc2a(0x24e)+_0x25253d[_0x42fc2a(0x16b)]+'\x27':'✔\x20'+_0x25253d[_0x42fc2a(0x28a)][_0x42fc2a(0x1af)]+_0x42fc2a(0x257)+_0x25253d[_0x42fc2a(0x16b)]+'\x27'),(_0x586903[_0x42fc2a(0x296)]||_0x586903['jsonl'])&&await handleSingleObjectOutput(_0x25253d,_0x586903),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0x311ab7(0x301)]=a54_0x311ab7(0x2dc);[a54_0x311ab7(0x1e4)]='Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project';async[a54_0x311ab7(0x165)](_0x2f4e6d){const _0x499647=a54_0x311ab7,{options:_0x485a98,args:_0x588a43,tdx:_0x3e25ee}=_0x2f4e6d;let _0x186979,_0x37a2cd;if(_0x588a43[_0x499647(0x1af)]>=0x2)_0x186979=_0x588a43[0x0],_0x37a2cd=_0x588a43[0x1];else{if(_0x588a43[_0x499647(0x1af)]===0x1&&_0x485a98[_0x499647(0x1f8)])_0x186979=_0x485a98['workflowProject'],_0x37a2cd=_0x588a43[0x0];else return _0x588a43['length']===0x1?(console['error'](_0x499647(0x251)),console[_0x499647(0x2b3)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console['error'](_0x499647(0x26d)),console[_0x499647(0x2b3)](_0x499647(0x1de)),0x1);}_0x485a98[_0x499647(0x1ab)]&&(console[_0x499647(0x2b3)]('Project:\x20'+_0x186979),console['error'](_0x499647(0x260)+_0x37a2cd));if(!_0x485a98[_0x499647(0x312)]){if(!isInteractive())return console[_0x499647(0x2b3)](a54_0x17bcd3[_0x499647(0x1f6)](_0x499647(0x305)),_0x499647(0x27a)),console[_0x499647(0x2b3)](a54_0x17bcd3[_0x499647(0x180)](_0x499647(0x2a5))),0x1;const _0x3bdd3a=await confirmKey(_0x499647(0x18f)+_0x37a2cd+_0x499647(0x288)+_0x186979+'\x27?');if(!_0x3bdd3a)return console[_0x499647(0x2b3)](a54_0x17bcd3[_0x499647(0x2a6)](_0x499647(0x1f9))),0x1;}const _0x5ed6c9=await withSpinner(_0x499647(0x211),()=>_0x3e25ee[_0x499647(0x278)][_0x499647(0x22c)](_0x186979,_0x37a2cd),{'verbose':_0x485a98[_0x499647(0x1ab)]}),_0x1965d6=_0x5ed6c9[_0x499647(0x1cd)];return console[_0x499647(0x2b3)](_0x499647(0x2e3)+_0x1965d6['key']+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x1965d6[_0x499647(0x16b)]+'\x27'),(_0x485a98['json']||_0x485a98[_0x499647(0x2a0)])&&await handleSingleObjectOutput(_0x1965d6,_0x485a98),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(_0x4e3325){const _0x1ba875=a54_0x311ab7,_0x10c92b=Math['floor'](_0x4e3325/0x3e8),_0x2c4d21=Math['floor'](_0x10c92b/0x3c),_0x4dffce=Math[_0x1ba875(0x320)](_0x2c4d21/0x3c),_0x2ad690=Math['floor'](_0x4dffce/0x18);if(_0x2ad690>0x0){const _0x54dfa1=_0x4dffce%0x18;return _0x54dfa1>0x0?_0x2ad690+'d\x20'+_0x54dfa1+'h':_0x2ad690+'d';}else{if(_0x4dffce>0x0){const _0x4e3a62=_0x2c4d21%0x3c;return _0x4e3a62>0x0?_0x4dffce+'h\x20'+_0x4e3a62+'m':_0x4dffce+'h';}else{if(_0x2c4d21>0x0){const _0x4f391e=_0x10c92b%0x3c;return _0x4f391e>0x0?_0x2c4d21+'m\x20'+_0x4f391e+'s':_0x2c4d21+'m';}else return _0x10c92b+'s';}}}function formatTimestamp(_0x3625bb,_0x2c5038){const _0xb2962e=a54_0x311ab7,_0x493ce9=new Date(_0x3625bb),_0x19d92b=String(_0x493ce9[_0xb2962e(0x309)]())[_0xb2962e(0x31c)](0x2,'0'),_0x348953=String(_0x493ce9[_0xb2962e(0x1e9)]())[_0xb2962e(0x31c)](0x2,'0'),_0x1f2d4e=_0x19d92b+':'+_0x348953,_0x4c2a0f=_0x493ce9['getFullYear']()===_0x2c5038[_0xb2962e(0x170)]()&&_0x493ce9[_0xb2962e(0x1e3)]()===_0x2c5038[_0xb2962e(0x1e3)]()&&_0x493ce9[_0xb2962e(0x2fb)]()===_0x2c5038[_0xb2962e(0x2fb)]();if(_0x4c2a0f)return _0x1f2d4e;else{const _0x216bad=String(_0x493ce9[_0xb2962e(0x1e3)]()+0x1)[_0xb2962e(0x31c)](0x2,'0'),_0x567dc0=String(_0x493ce9['getDate']())[_0xb2962e(0x31c)](0x2,'0');return _0x216bad+'-'+_0x567dc0+'\x20'+_0x1f2d4e;}}function formatDate(_0x567e8a){const _0x4bf468=a54_0x311ab7,_0x22b6a6=_0x567e8a[_0x4bf468(0x170)](),_0x1b1e84=String(_0x567e8a[_0x4bf468(0x1e3)]()+0x1)[_0x4bf468(0x31c)](0x2,'0'),_0x531ef7=String(_0x567e8a[_0x4bf468(0x2fb)]())[_0x4bf468(0x31c)](0x2,'0');return _0x22b6a6+'-'+_0x1b1e84+'-'+_0x531ef7;}function getTaskStateIcon(_0x3a4f85){const _0x2a9d30={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x2a9d30[_0x3a4f85]||'⚪';}function getBarChar(_0x3448be){const _0x1a2f1e=a54_0x311ab7;return _0x3448be===_0x1a2f1e(0x2b3)||_0x3448be===_0x1a2f1e(0x162)?'×':'─';}function getBarColor(_0x434d96){const _0x5959c7=a54_0x311ab7,_0x1f7158={'success':a54_0x17bcd3['green'],'error':a54_0x17bcd3['red'],'group_error':a54_0x17bcd3[_0x5959c7(0x1f6)],'running':a54_0x17bcd3[_0x5959c7(0x2b2)],'blocked':a54_0x17bcd3[_0x5959c7(0x2a6)],'planned':a54_0x17bcd3[_0x5959c7(0x180)],'canceling':a54_0x17bcd3['yellow']};return _0x1f7158[_0x434d96]||a54_0x17bcd3[_0x5959c7(0x2df)];}function parseTaskName(_0x498123){const _0x1ef128=a54_0x311ab7;let _0x203f80=_0x498123[_0x1ef128(0x2a4)](/^\++/,'');const _0x58e56d=_0x203f80['split']('+'),_0x1ab1bb=_0x58e56d[_0x1ef128(0x1af)]>0x1?_0x58e56d['length']-0x2:0x0,_0x599a1a=_0x58e56d[_0x58e56d[_0x1ef128(0x1af)]-0x1]||_0x203f80;return{'level':_0x1ab1bb,'name':'+'+_0x599a1a};}function truncateTaskName(_0x49ea97,_0x532c43){const _0x56bcf1=stringWidth(_0x49ea97);if(_0x56bcf1<=_0x532c43)return _0x49ea97;let _0x2d4f2f=_0x49ea97;while(stringWidth(_0x2d4f2f+'…')>_0x532c43&&_0x2d4f2f['length']>0x0){_0x2d4f2f=_0x2d4f2f['slice'](0x0,-0x1);}return _0x2d4f2f+'…';}function calculateTimeScale(_0x491b32,_0x19519a){const _0x1cab7b=a54_0x311ab7;return{'startTime':_0x491b32[_0x1cab7b(0x318)],'endTime':_0x491b32[_0x1cab7b(0x307)],'durationMs':_0x491b32[_0x1cab7b(0x201)],'msPerChar':_0x491b32['duration']/_0x19519a};}function timeToPosition(_0xca543f,_0xd1f57e,_0x39dfdf){const _0x35edf2=a54_0x311ab7,_0x5727b0=_0xca543f-_0xd1f57e[_0x35edf2(0x321)],_0x437218=Math[_0x35edf2(0x320)](_0x5727b0/_0xd1f57e[_0x35edf2(0x1e2)]);return Math[_0x35edf2(0x1a9)](0x0,Math[_0x35edf2(0x17b)](_0x437218,_0x39dfdf));}function renderTimeAxis(_0x49e8ee,_0x22e2b9){const _0x2bbf35=a54_0x311ab7,_0x46063b=Math[_0x2bbf35(0x17b)](TIMELINE_CONFIG[_0x2bbf35(0x1b3)],Math[_0x2bbf35(0x1a9)](TIMELINE_CONFIG[_0x2bbf35(0x239)],Math[_0x2bbf35(0x320)](_0x22e2b9/TIMELINE_CONFIG[_0x2bbf35(0x24c)]))),_0x3d1e83=_0x49e8ee[_0x2bbf35(0x214)]/(_0x46063b-0x1),_0x48ed7b=new Date(_0x49e8ee[_0x2bbf35(0x321)]),_0x54b4e2=[];for(let _0x21d958=0x0;_0x21d958<_0x46063b;_0x21d958++){const _0x5b768e=_0x49e8ee['startTime']+_0x21d958*_0x3d1e83,_0xc29607=timeToPosition(_0x5b768e,_0x49e8ee,_0x22e2b9),_0x5b7eae=formatTimestamp(_0x5b768e,_0x48ed7b);_0x54b4e2[_0x2bbf35(0x2a9)]({'pos':_0xc29607,'text':_0x5b7eae});}const _0x531c2a=new Array(_0x22e2b9)[_0x2bbf35(0x2bc)]('\x20');let _0x52d2f1=-0x1;for(const {pos:_0x166db2,text:_0xe1021}of _0x54b4e2){let _0x1a9855=Math[_0x2bbf35(0x1a9)](0x0,_0x166db2-Math[_0x2bbf35(0x320)](_0xe1021[_0x2bbf35(0x1af)]/0x2));_0x1a9855<=_0x52d2f1+TIMELINE_CONFIG[_0x2bbf35(0x20c)]&&(_0x1a9855=_0x52d2f1+TIMELINE_CONFIG[_0x2bbf35(0x20c)]+0x1);_0x1a9855+_0xe1021[_0x2bbf35(0x1af)]>_0x22e2b9&&(_0x1a9855=_0x22e2b9-_0xe1021[_0x2bbf35(0x1af)]);if(_0x1a9855>=0x0&&_0x1a9855+_0xe1021[_0x2bbf35(0x1af)]<=_0x22e2b9&&_0x1a9855>_0x52d2f1){for(let _0x42cf22=0x0;_0x42cf22<_0xe1021[_0x2bbf35(0x1af)];_0x42cf22++){_0x531c2a[_0x1a9855+_0x42cf22]=_0xe1021[_0x42cf22];}_0x52d2f1=_0x1a9855+_0xe1021[_0x2bbf35(0x1af)]-0x1;}}return _0x531c2a['join']('');}function renderTaskRow(_0x4a8f49,_0x6dcf6b,_0x3dec7c,_0x58d7d1){const _0x1aa676=a54_0x311ab7,{level:_0x280d11,name:_0x4c0180}=parseTaskName(_0x4a8f49[_0x1aa676(0x301)]),_0x1e84bb='\x20'[_0x1aa676(0x16d)](_0x280d11),_0x5b1a45=_0x4a8f49[_0x1aa676(0x21b)]?'('+formatElapsed(_0x4a8f49[_0x1aa676(0x21b)][_0x1aa676(0x201)])+')':'',_0x410518=stringWidth(_0x5b1a45),_0x1a75a2=_0x280d11*0x1,_0xe6f037=_0x58d7d1-_0x1a75a2-_0x410518-0x1,_0x3a4622=truncateTaskName(_0x4c0180,_0xe6f037),_0x5cd702=_0x1e84bb+_0x3a4622,_0x8e3ce1=stringWidth(_0x5cd702),_0x38a5e2=_0x58d7d1-_0x8e3ce1-_0x410518,_0x416fc7=_0x5cd702+'\x20'['repeat'](Math[_0x1aa676(0x1a9)](0x1,_0x38a5e2))+a54_0x17bcd3[_0x1aa676(0x180)](_0x5b1a45),_0x5746df=getTaskStateIcon(_0x4a8f49[_0x1aa676(0x1c8)]),_0x1f4089=new Array(_0x3dec7c)[_0x1aa676(0x2bc)]('\x20');if(_0x4a8f49[_0x1aa676(0x21b)]){const _0x288171=timeToPosition(_0x4a8f49[_0x1aa676(0x21b)][_0x1aa676(0x318)],_0x6dcf6b,_0x3dec7c),_0x200bd4=timeToPosition(_0x4a8f49['window'][_0x1aa676(0x307)],_0x6dcf6b,_0x3dec7c),_0x37bc89=getBarChar(_0x4a8f49[_0x1aa676(0x1c8)]),_0x5ce7fb=Math[_0x1aa676(0x1a9)](_0x288171+0x1,_0x200bd4);for(let _0x9363cb=_0x288171;_0x9363cb<Math[_0x1aa676(0x17b)](_0x5ce7fb,_0x3dec7c);_0x9363cb++){_0x1f4089[_0x9363cb]=_0x37bc89;}}const _0x48ec81=getBarColor(_0x4a8f49[_0x1aa676(0x1c8)]),_0x4d8d59=_0x1f4089[_0x1aa676(0x173)](_0x45cefe=>_0x45cefe==='\x20'?'\x20':_0x48ec81(_0x45cefe))[_0x1aa676(0x1d9)]('');return _0x5746df+'\x20'+_0x416fc7+'│'+_0x4d8d59+'│';}function calculateStats(_0x35745a){const _0x2cc385=a54_0x311ab7,_0x463fdd={'total':_0x35745a[_0x2cc385(0x1af)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x82d323 of _0x35745a){if(_0x82d323[_0x2cc385(0x1c8)]===_0x2cc385(0x1a6))_0x463fdd[_0x2cc385(0x1a6)]++;else{if(_0x82d323[_0x2cc385(0x1c8)]===_0x2cc385(0x2b3)||_0x82d323['state']==='group_error')_0x463fdd['error']++;else _0x82d323['state']==='running'?_0x463fdd[_0x2cc385(0x16c)]++:_0x463fdd['pending']++;}}return _0x463fdd;}function formatStats(_0x311729){const _0x51fe9a=a54_0x311ab7;return[_0x51fe9a(0x21e)+_0x311729['total'],'✅\x20'+_0x311729[_0x51fe9a(0x1a6)],'❌\x20'+_0x311729[_0x51fe9a(0x2b3)],_0x51fe9a(0x243)+_0x311729[_0x51fe9a(0x16c)],'⏳\x20'+_0x311729[_0x51fe9a(0x1a5)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x311ab7(0x301)]='workflow:timeline';[a54_0x311ab7(0x1e4)]=a54_0x311ab7(0x219);async[a54_0x311ab7(0x165)](_0x403ddf){const _0xf68a99=a54_0x311ab7,{options:_0xc10395,args:_0x2e0ebd,tdx:_0x5699f8}=_0x403ddf;let _0x148dca,_0x372a26,_0x1c0847=![];if(_0x2e0ebd[0x0]){if(_0x2e0ebd[0x0][_0xf68a99(0x1c1)]('.')){const _0x33bc41=this[_0xf68a99(0x258)](_0x2e0ebd,_0xc10395);if(!_0x33bc41)return 0x1;_0x148dca=_0x33bc41[_0xf68a99(0x16b)],_0x372a26=_0x33bc41[_0xf68a99(0x290)];}else{_0x372a26=_0x2e0ebd[0x0],_0x148dca=_0xc10395[_0xf68a99(0x1f8)];if(!_0x148dca)return console[_0xf68a99(0x2b3)](a54_0x17bcd3['red'](_0xf68a99(0x17a)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x1c0847=!![];}}else{const _0x49d973=this[_0xf68a99(0x258)](_0x2e0ebd,_0xc10395);if(!_0x49d973)return 0x1;_0x148dca=_0x49d973[_0xf68a99(0x16b)],_0x372a26=_0x49d973[_0xf68a99(0x290)];}if(_0xc10395[_0xf68a99(0x1ab)]){if(_0x148dca&&_0x372a26)console[_0xf68a99(0x2b3)](_0xf68a99(0x2ee)+_0x148dca+'.'+_0x372a26);else _0x148dca&&console[_0xf68a99(0x2b3)](_0xf68a99(0x1e5)+_0x148dca);}const _0x5a1426=_0xc10395[_0xf68a99(0x2fc)],_0x17e87a=_0xc10395[_0xf68a99(0x2ac)];if(_0x5a1426){_0x17e87a&&console[_0xf68a99(0x2b3)](a54_0x17bcd3[_0xf68a99(0x2a6)](_0xf68a99(0x1fd)),_0xf68a99(0x1b7));const _0x18d36a=_0xc10395[_0xf68a99(0x2d4)];return _0x18d36a?await this['pollTimeline'](_0x403ddf,_0x5a1426):await this[_0xf68a99(0x28c)](_0x403ddf,_0x5a1426,_0xc10395),0x0;}if(_0x17e87a){const _0x18a188=await withSpinner('Loading\x20session...',()=>_0x5699f8['workflow']['sessions']({'projectName':_0x148dca,'workflowName':_0x372a26,'limit':0x64}),{'verbose':_0xc10395['verbose']}),_0x446562=_0x18a188[_0xf68a99(0x1cd)][_0xf68a99(0x1f3)](_0x544e63=>_0x544e63['id']===_0x17e87a);if(!_0x446562)return console[_0xf68a99(0x2b3)](a54_0x17bcd3[_0xf68a99(0x1f6)](_0xf68a99(0x17a)),_0xf68a99(0x18d)+_0x17e87a),0x1;if(!_0x446562['lastAttempt']?.['id'])return console[_0xf68a99(0x2b3)](a54_0x17bcd3[_0xf68a99(0x1f6)](_0xf68a99(0x17a)),_0xf68a99(0x185)+_0x17e87a+'\x20has\x20no\x20attempts'),0x1;const _0x53f96e=_0x446562[_0xf68a99(0x195)]['id'];_0xc10395[_0xf68a99(0x1ab)]&&console[_0xf68a99(0x2b3)](_0xf68a99(0x24f)+_0x53f96e+_0xf68a99(0x274)+_0x17e87a);const _0x2a9d7e=_0xc10395[_0xf68a99(0x2d4)];return _0x2a9d7e?await this['pollTimeline'](_0x403ddf,_0x53f96e):await this['renderSingleTimeline'](_0x403ddf,_0x53f96e,_0xc10395),0x0;}const _0x53ba36=await withSpinner(_0xf68a99(0x1fc),()=>_0x5699f8[_0xf68a99(0x278)]['sessions']({'projectName':_0x148dca,'workflowName':_0x372a26,'limit':_0xc10395[_0xf68a99(0x1ff)]||0x32}),{'verbose':_0xc10395[_0xf68a99(0x1ab)]}),_0x4b98d0=_0x53ba36[_0xf68a99(0x1cd)];if(_0x4b98d0[_0xf68a99(0x1af)]===0x0){if(_0x148dca&&_0x372a26)console[_0xf68a99(0x2b3)](_0xf68a99(0x188)+_0x148dca+'.'+_0x372a26);else _0x148dca?console['error'](_0xf68a99(0x21c)+_0x148dca):(console['error'](_0xf68a99(0x253)),console['error'](a54_0x17bcd3[_0xf68a99(0x180)](_0xf68a99(0x207))));return 0x0;}_0x4b98d0[_0xf68a99(0x21f)]((_0x12a7d4,_0x1df5da)=>{const _0x4257e2=_0xf68a99,_0x15a9f2=_0x12a7d4[_0x4257e2(0x1c2)]||'',_0x4f894b=_0x1df5da['sessionTime']||'';return _0x4f894b['localeCompare'](_0x15a9f2);});if(_0xc10395[_0xf68a99(0x296)]||_0xc10395[_0xf68a99(0x2a0)])return await handleSDKOutput(_0x4b98d0,_0xc10395),0x0;let _0x3b8122;if(_0x1c0847){const _0x3ee616=_0x4b98d0[0x0];if(!_0x3ee616[_0xf68a99(0x195)]?.['id'])return console[_0xf68a99(0x2b3)](_0xf68a99(0x22e)),0x0;_0x3b8122=_0x3ee616['lastAttempt']['id'],_0xc10395[_0xf68a99(0x1ab)]&&console[_0xf68a99(0x2b3)](_0xf68a99(0x1c6)+_0x3ee616['sessionTime']);}else{const _0x66dc1f=_0x4b98d0[_0xf68a99(0x173)](_0x28ffbc=>{const _0x325400=_0xf68a99,_0x18af74=getAttemptStatusDisplay(_0x28ffbc[_0x325400(0x195)]);return{'title':_0x28ffbc[_0x325400(0x2a7)]?.[_0x325400(0x301)]+'.'+_0x28ffbc['workflow']?.[_0x325400(0x301)]+'\x20-\x20'+_0x28ffbc['sessionTime']+'\x20'+_0x18af74['icon'],'value':_0x28ffbc['lastAttempt']?.['id']||'','description':_0x18af74['text']};}),_0x1bd79e=await a54_0xd27f88({'type':_0xf68a99(0x224),'name':'attemptId','message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x66dc1f[_0xf68a99(0x2aa)](_0x58744e=>_0x58744e['value']!=='')});if(!_0x1bd79e['attemptId'])return 0x0;_0x3b8122=_0x1bd79e[_0xf68a99(0x2fc)];}const _0x4f4e23=_0xc10395[_0xf68a99(0x2d4)];return _0x4f4e23?await this[_0xf68a99(0x218)](_0x403ddf,_0x3b8122):await this[_0xf68a99(0x28c)](_0x403ddf,_0x3b8122,_0xc10395),0x0;}async[a54_0x311ab7(0x28c)](_0x16f167,_0x392238,_0x3f6ca4){const _0x2662e9=a54_0x311ab7,{tdx:_0x5538d2}=_0x16f167;let _0x2d57a8,_0x569e92;try{[_0x2d57a8,_0x569e92]=await Promise[_0x2662e9(0x322)]([_0x5538d2[_0x2662e9(0x278)][_0x2662e9(0x29f)](_0x392238),_0x5538d2['workflow'][_0x2662e9(0x1f5)](_0x392238,![])]);}catch(_0x1fdfd5){console[_0x2662e9(0x2b3)](a54_0x17bcd3['red'](_0x2662e9(0x16a)));_0x3f6ca4[_0x2662e9(0x1ab)]&&console[_0x2662e9(0x2b3)](_0x1fdfd5);throw _0x1fdfd5;}if(_0x3f6ca4[_0x2662e9(0x296)]||_0x3f6ca4[_0x2662e9(0x2a0)]){const _0x32773c=this[_0x2662e9(0x2d9)](_0x2d57a8,_0x569e92);await handleSDKOutput([_0x32773c],_0x3f6ca4);return;}const _0x2f01eb=_0x5538d2[_0x2662e9(0x182)]['site'],_0x19739f=this[_0x2662e9(0x169)](_0x2d57a8,_0x569e92,_0x2f01eb);console[_0x2662e9(0x2c3)](_0x19739f);}async[a54_0x311ab7(0x218)](_0x11eee5,_0x450973){const _0x45c183=a54_0x311ab7,{tdx:_0x5dad26}=_0x11eee5,_0x2a1bb0=TIMELINE_CONFIG[_0x45c183(0x19b)],_0x245fe9=TIMELINE_CONFIG[_0x45c183(0x29b)];let _0x42a2bb=0x0;while(_0x42a2bb<_0x245fe9){process[_0x45c183(0x1ce)][_0x45c183(0x2ad)]&&process[_0x45c183(0x1ce)][_0x45c183(0x230)]('\x1bc');let _0x2c0d0d,_0x5b43ce;try{[_0x2c0d0d,_0x5b43ce]=await Promise[_0x45c183(0x322)]([_0x5dad26[_0x45c183(0x278)][_0x45c183(0x29f)](_0x450973),_0x5dad26[_0x45c183(0x278)]['tasks'](_0x450973,![])]);}catch(_0x268ea3){console[_0x45c183(0x2b3)](a54_0x17bcd3[_0x45c183(0x1f6)](_0x45c183(0x168)));_0x42a2bb>0x0&&console['error'](a54_0x17bcd3[_0x45c183(0x180)](_0x45c183(0x2f8)+_0x42a2bb));throw _0x268ea3;}const _0x2cf3e8=_0x5dad26[_0x45c183(0x182)][_0x45c183(0x302)],_0x3a99c5=this[_0x45c183(0x169)](_0x2c0d0d,_0x5b43ce,_0x2cf3e8);console[_0x45c183(0x2c3)](_0x3a99c5);const _0x235481=_0x2c0d0d[_0x45c183(0x23c)]&&_0x5b43ce[_0x45c183(0x2e0)](_0x3b1352=>_0x3b1352[_0x45c183(0x1c8)]!==_0x45c183(0x16c)&&_0x3b1352[_0x45c183(0x1c8)]!==_0x45c183(0x161));if(_0x235481){console[_0x45c183(0x2b3)](a54_0x17bcd3[_0x45c183(0x308)](_0x45c183(0x1ba)));break;}console[_0x45c183(0x2b3)](a54_0x17bcd3[_0x45c183(0x180)](_0x45c183(0x17e)+_0x42a2bb*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x1bbb5a=>setTimeout(_0x1bbb5a,_0x2a1bb0)),_0x42a2bb++;}_0x42a2bb>=_0x245fe9&&console['error'](a54_0x17bcd3[_0x45c183(0x2a6)]('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a54_0x311ab7(0x169)](_0x10a2ad,_0x491e8,_0x444713){const _0x37f7f4=a54_0x311ab7,_0x52ec13=[],_0x1faf08=TIMELINE_CONFIG[_0x37f7f4(0x1ed)],_0x449e8e=0x5,_0x594499=process['stdout'][_0x37f7f4(0x183)]||0x78,_0x328d71=_0x594499-_0x1faf08-_0x449e8e,_0x2b63e6=Math[_0x37f7f4(0x1a9)](TIMELINE_CONFIG[_0x37f7f4(0x238)],Math[_0x37f7f4(0x17b)](_0x328d71,TIMELINE_CONFIG[_0x37f7f4(0x2ab)])),_0x6bc502=new Date(_0x10a2ad[_0x37f7f4(0x222)])[_0x37f7f4(0x254)](),_0x5143b1=_0x10a2ad[_0x37f7f4(0x15f)]?new Date(_0x10a2ad[_0x37f7f4(0x15f)])[_0x37f7f4(0x254)]():Date[_0x37f7f4(0x217)](),_0x30df3a={'start':_0x6bc502,'end':_0x5143b1,'duration':_0x5143b1-_0x6bc502},_0x177607=new Map(),_0x1ddd64=[];for(const _0x3866ef of _0x491e8){if(_0x3866ef[_0x37f7f4(0x2bb)]){const _0x33186c=new Date(_0x3866ef[_0x37f7f4(0x2bb)])[_0x37f7f4(0x254)](),_0x578779=_0x3866ef['updatedAt']?new Date(_0x3866ef[_0x37f7f4(0x163)])['getTime']():Date['now'](),_0xdecd72={'start':_0x33186c,'end':_0x578779,'duration':_0x578779-_0x33186c};_0x177607[_0x37f7f4(0x1b5)](_0x3866ef['id'],_0xdecd72),_0x1ddd64[_0x37f7f4(0x2a9)]({'name':_0x3866ef[_0x37f7f4(0x27e)],'state':_0x3866ef[_0x37f7f4(0x1c8)]||'unknown','window':_0xdecd72});}else _0x1ddd64[_0x37f7f4(0x2a9)]({'name':_0x3866ef[_0x37f7f4(0x27e)],'state':_0x3866ef[_0x37f7f4(0x1c8)]||'planned','window':undefined});}_0x1ddd64['sort']((_0x34e99f,_0x241d14)=>{const _0x1dc3f7=_0x37f7f4;if(!_0x34e99f['window'])return 0x1;if(!_0x241d14[_0x1dc3f7(0x21b)])return-0x1;return _0x34e99f[_0x1dc3f7(0x21b)][_0x1dc3f7(0x318)]-_0x241d14[_0x1dc3f7(0x21b)][_0x1dc3f7(0x318)];});const _0x3cfc42=_0x1ddd64['length'],_0x982199=_0x3cfc42>TIMELINE_CONFIG[_0x37f7f4(0x30b)];_0x982199&&_0x1ddd64[_0x37f7f4(0x1ee)](TIMELINE_CONFIG[_0x37f7f4(0x30b)]);const _0x842ccd=calculateTimeScale(_0x30df3a,_0x2b63e6),_0x2c3a25=_0x10a2ad[_0x37f7f4(0x23c)]?_0x10a2ad[_0x37f7f4(0x1a6)]?a54_0x17bcd3['green'](_0x37f7f4(0x1a6)):a54_0x17bcd3['red'](_0x37f7f4(0x2b3)):a54_0x17bcd3['blue']('running'),_0x793d5d=_0x10a2ad[_0x37f7f4(0x2a7)]?.['id'],_0x2f330b=_0x10a2ad['sessionId'];let _0x2d4c4f;if(_0x793d5d&&_0x2f330b){const _0x1238d3=getWorkflowAttemptUrl(_0x444713,_0x793d5d,_0x2f330b,_0x10a2ad['id']);_0x2d4c4f=hyperlink(a54_0x17bcd3[_0x37f7f4(0x180)](_0x10a2ad['id']),_0x1238d3);}else _0x2d4c4f=a54_0x17bcd3[_0x37f7f4(0x180)](_0x10a2ad['id']);_0x52ec13['push'](_0x37f7f4(0x1eb)+_0x2d4c4f+_0x37f7f4(0x17d)+_0x2c3a25+'\x20-\x20'+formatElapsed(_0x30df3a[_0x37f7f4(0x201)]));if(_0x1ddd64[_0x37f7f4(0x1af)]>0x0){const _0x22be71=renderTimeAxis(_0x842ccd,_0x2b63e6),_0x8679d7=new Date(_0x30df3a[_0x37f7f4(0x318)]),_0x22444a=formatDate(_0x8679d7),_0x443f3d=TIMELINE_CONFIG[_0x37f7f4(0x27f)]+TIMELINE_CONFIG[_0x37f7f4(0x228)]+_0x1faf08,_0x1dd06e=_0x22444a[_0x37f7f4(0x31c)](_0x443f3d),_0x8084aa=a54_0x17bcd3[_0x37f7f4(0x180)](_0x1dd06e);_0x52ec13[_0x37f7f4(0x2a9)](_0x8084aa+'\x20'+_0x22be71);for(const _0x542f93 of _0x1ddd64){_0x52ec13[_0x37f7f4(0x2a9)](renderTaskRow(_0x542f93,_0x842ccd,_0x2b63e6,_0x1faf08));}const _0x332310=calculateStats(_0x1ddd64);_0x52ec13[_0x37f7f4(0x2a9)](formatStats(_0x332310)),_0x982199&&_0x52ec13[_0x37f7f4(0x2a9)](a54_0x17bcd3[_0x37f7f4(0x2a6)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0x37f7f4(0x30b)]+'\x20of\x20'+_0x3cfc42+_0x37f7f4(0x27b))),_0x52ec13['push'](''),_0x52ec13[_0x37f7f4(0x2a9)](a54_0x17bcd3[_0x37f7f4(0x180)]('💡\x20Tip:\x20Use\x20')+('tdx\x20wf\x20attempt\x20'+_0x10a2ad['id']+_0x37f7f4(0x1b1))+a54_0x17bcd3[_0x37f7f4(0x180)](_0x37f7f4(0x1ad)));}else _0x52ec13['push'](_0x37f7f4(0x1c3));return _0x52ec13[_0x37f7f4(0x1d9)]('\x0a');}[a54_0x311ab7(0x2d9)](_0x35b6cb,_0x27b8fc){const _0x11b73c=a54_0x311ab7,_0x9cb4f=new Date(_0x35b6cb[_0x11b73c(0x222)])['getTime'](),_0x5e67d9=_0x35b6cb['finishedAt']?new Date(_0x35b6cb[_0x11b73c(0x15f)])[_0x11b73c(0x254)]():Date[_0x11b73c(0x217)](),_0x5c9aa7=_0x5e67d9-_0x9cb4f,_0xa4bebb=[];for(const _0x1ff3ca of _0x27b8fc){if(_0x1ff3ca[_0x11b73c(0x2bb)]){const _0x59205e=new Date(_0x1ff3ca[_0x11b73c(0x2bb)])[_0x11b73c(0x254)](),_0x1f8fa1=_0x1ff3ca[_0x11b73c(0x163)]?new Date(_0x1ff3ca[_0x11b73c(0x163)])[_0x11b73c(0x254)]():Date['now']();_0xa4bebb['push']({'name':_0x1ff3ca[_0x11b73c(0x27e)],'state':_0x1ff3ca[_0x11b73c(0x1c8)]||_0x11b73c(0x1ca),'window':{'start':_0x59205e,'end':_0x1f8fa1,'duration':_0x1f8fa1-_0x59205e}});}else _0xa4bebb[_0x11b73c(0x2a9)]({'name':_0x1ff3ca[_0x11b73c(0x27e)],'state':_0x1ff3ca[_0x11b73c(0x1c8)]||_0x11b73c(0x161),'window':undefined});}const _0x1aae41=calculateStats(_0xa4bebb);return{'attempt':{'id':_0x35b6cb['id'],'status':_0x35b6cb[_0x11b73c(0x23c)]?_0x35b6cb['success']?_0x11b73c(0x1a6):_0x11b73c(0x2b3):_0x11b73c(0x16c),'createdAt':_0x35b6cb[_0x11b73c(0x222)],'finishedAt':_0x35b6cb['finishedAt'],'duration_ms':_0x5c9aa7},'tasks':_0xa4bebb['map'](_0x390cea=>({'name':_0x390cea[_0x11b73c(0x301)],'state':_0x390cea[_0x11b73c(0x1c8)],'startedAt':_0x390cea[_0x11b73c(0x21b)]?new Date(_0x390cea[_0x11b73c(0x21b)][_0x11b73c(0x318)])['toISOString']():null,'updatedAt':_0x390cea[_0x11b73c(0x21b)]?new Date(_0x390cea['window'][_0x11b73c(0x307)])['toISOString']():null,'duration_ms':_0x390cea[_0x11b73c(0x21b)]?.[_0x11b73c(0x201)]||null})),'stats':_0x1aae41};}}function a54_0x4c77(_0x1a343a,_0x20a764){_0x1a343a=_0x1a343a-0x15a;const _0x1add7e=a54_0x1add();let _0x4c774c=_0x1add7e[_0x1a343a];return _0x4c774c;}export class WorkflowSchedulesCommand extends BaseCommand{['name']=a54_0x311ab7(0x186);[a54_0x311ab7(0x1e4)]=a54_0x311ab7(0x2c2);async[a54_0x311ab7(0x165)](_0x598a56){const _0x4132c8=a54_0x311ab7,{options:_0x304c8b,tdx:_0x5bbc9a}=_0x598a56,_0x5bdfc9=await withSpinner(_0x4132c8(0x298),()=>_0x5bbc9a[_0x4132c8(0x278)]['listSchedules'](),{'verbose':_0x304c8b[_0x4132c8(0x1ab)]}),_0x4bd72d=_0x5bdfc9['data'];console[_0x4132c8(0x2b3)]('✔\x20Found\x20'+_0x4bd72d[_0x4132c8(0x1af)]+_0x4132c8(0x203)+(_0x4bd72d[_0x4132c8(0x1af)]!==0x1?'s':''));if(isStructuredFormat(_0x304c8b))await handleSDKOutput(_0x4bd72d,_0x304c8b);else{if(_0x4bd72d[_0x4132c8(0x1af)]===0x0)console[_0x4132c8(0x2c3)]('No\x20schedules\x20found');else for(const _0x9696c1 of _0x4bd72d){const _0x311687=_0x9696c1['disabledAt']?a54_0x17bcd3['yellow'](_0x4132c8(0x235)):'',_0x2d69c6=_0x9696c1['project']?.[_0x4132c8(0x301)]?a54_0x17bcd3[_0x4132c8(0x180)]('\x20['+_0x9696c1[_0x4132c8(0x2a7)][_0x4132c8(0x301)]+']'):'',_0x265dd4=_0x9696c1[_0x4132c8(0x2bf)]?a54_0x17bcd3[_0x4132c8(0x180)](_0x4132c8(0x1ec)+new Date(_0x9696c1[_0x4132c8(0x2bf)])['toLocaleString']()):'';console[_0x4132c8(0x2c3)](_0x4132c8(0x2cb)+_0x9696c1['id']+'\x20'+(_0x9696c1[_0x4132c8(0x278)]?.[_0x4132c8(0x301)]||_0x4132c8(0x285))+_0x2d69c6+_0x311687+_0x265dd4);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a54_0x311ab7(0x301)]='workflow:schedule:enable';['description']=a54_0x311ab7(0x1e8);async[a54_0x311ab7(0x165)](_0x13690c){const _0x9358b4=a54_0x311ab7,{options:_0x522980,args:_0x2bfa35,tdx:_0x7a36c9}=_0x13690c,_0xc0810=_0x2bfa35[0x0];if(!_0xc0810)return console['error'](a54_0x17bcd3[_0x9358b4(0x1f6)]('Error:'),_0x9358b4(0x1dc)),console[_0x9358b4(0x2b3)](a54_0x17bcd3[_0x9358b4(0x180)](_0x9358b4(0x277))),console[_0x9358b4(0x2b3)](a54_0x17bcd3[_0x9358b4(0x180)](_0x9358b4(0x256))),0x1;const _0x375504=await withSpinner(_0x9358b4(0x227)+_0xc0810+_0x9358b4(0x25b),()=>_0x7a36c9[_0x9358b4(0x278)]['enableSchedule'](_0xc0810),{'verbose':_0x522980[_0x9358b4(0x1ab)]}),_0x11ce30=_0x375504[_0x9358b4(0x1cd)];return isStructuredFormat(_0x522980)?await handleSingleObjectOutput(_0x11ce30,_0x522980):(console[_0x9358b4(0x2c3)]('✔\x20Schedule\x20#'+_0xc0810+'\x20enabled\x20('+(_0x11ce30[_0x9358b4(0x278)]?.[_0x9358b4(0x301)]||_0x9358b4(0x1ca))+')'),_0x11ce30[_0x9358b4(0x2bf)]&&console[_0x9358b4(0x2c3)](a54_0x17bcd3[_0x9358b4(0x180)](_0x9358b4(0x246)+new Date(_0x11ce30[_0x9358b4(0x2bf)])[_0x9358b4(0x24a)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a54_0x311ab7(0x301)]=a54_0x311ab7(0x2b6);[a54_0x311ab7(0x1e4)]=a54_0x311ab7(0x15d);async[a54_0x311ab7(0x165)](_0x30b7b0){const _0x46a6dd=a54_0x311ab7,{options:_0x3e786e,args:_0x4e766c,tdx:_0x55bb87}=_0x30b7b0,_0x2bc74a=_0x4e766c[0x0];if(!_0x2bc74a)return console[_0x46a6dd(0x2b3)](a54_0x17bcd3[_0x46a6dd(0x1f6)](_0x46a6dd(0x17a)),_0x46a6dd(0x1dc)),console[_0x46a6dd(0x2b3)](a54_0x17bcd3['dim']('Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>')),console['error'](a54_0x17bcd3[_0x46a6dd(0x180)](_0x46a6dd(0x256))),0x1;const _0x47fd6d=await withSpinner(_0x46a6dd(0x2cc)+_0x2bc74a+'...',()=>_0x55bb87[_0x46a6dd(0x278)][_0x46a6dd(0x1e6)](_0x2bc74a),{'verbose':_0x3e786e[_0x46a6dd(0x1ab)]}),_0x5467d1=_0x47fd6d[_0x46a6dd(0x1cd)];return isStructuredFormat(_0x3e786e)?await handleSingleObjectOutput(_0x5467d1,_0x3e786e):console['log'](_0x46a6dd(0x255)+_0x2bc74a+_0x46a6dd(0x22d)+(_0x5467d1[_0x46a6dd(0x278)]?.[_0x46a6dd(0x301)]||_0x46a6dd(0x1ca))+')'),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x32ef79,_0x4e1b34){const _0x3b56d2=a55_0x18b0,_0x1ab193=_0x32ef79();while(!![]){try{const _0x1f5f63=parseInt(_0x3b56d2(0xe6))/0x1+parseInt(_0x3b56d2(0xeb))/0x2*(-parseInt(_0x3b56d2(0xe8))/0x3)+-parseInt(_0x3b56d2(0xe0))/0x4*(-parseInt(_0x3b56d2(0xe1))/0x5)+-parseInt(_0x3b56d2(0xe4))/0x6+parseInt(_0x3b56d2(0xf2))/0x7*(-parseInt(_0x3b56d2(0xec))/0x8)+parseInt(_0x3b56d2(0xf0))/0x9+-parseInt(_0x3b56d2(0xe3))/0xa*(parseInt(_0x3b56d2(0xee))/0xb);if(_0x1f5f63===_0x4e1b34)break;else _0x1ab193['push'](_0x1ab193['shift']());}catch(_0x24b545){_0x1ab193['push'](_0x1ab193['shift']());}}}(a55_0x2164,0x5faa9));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a55_0x18b0(_0x1f220b,_0x252fdf){_0x1f220b=_0x1f220b-0xe0;const _0x2164f1=a55_0x2164();let _0x18b0ee=_0x2164f1[_0x1f220b];return _0x18b0ee;}function a55_0x2164(){const _0x1bcedf=['588993didxPO',';\x20node/','119802IKnZIx','Authorization','Bearer\x20','4JoEwsG','2762720SQuYkk','X-Trino-User','77jWWqMb','tdx/','655119EjLcFC','length','7RrgNzy','4BhWdhj','3329895mtgMlC','entries','428920nCyFOq','1262772JacDxl','tdx'];a55_0x2164=function(){return _0x1bcedf;};return a55_0x2164();}export function getUserAgent(){const _0x110a96=a55_0x18b0,_0x57aacd=getVersion(),_0x10ecb7=platform(),_0x292d51=process['version']['replace']('v','');return _0x110a96(0xef)+_0x57aacd+'\x20('+_0x10ecb7+_0x110a96(0xe7)+_0x292d51+')';}export function getAuthHeaders(_0x49c5d4,_0x2fd81,_0x7924c1){const _0x4c3e29=a55_0x18b0,_0x62db26=getVersion(),_0x42882b={'User-Agent':getUserAgent(),'X-TD-Client':_0x4c3e29(0xe5),'X-TD-Client-Version':_0x62db26};if(_0x7924c1)_0x42882b[_0x4c3e29(0xe9)]=_0x4c3e29(0xea)+_0x7924c1;else _0x2fd81&&(_0x42882b[_0x4c3e29(0xe9)]='TD1\x20'+_0x2fd81);return _0x42882b;}export function toHeaderRecord(_0x40695a){const _0x257993=a55_0x18b0,_0x20c7e5={};for(const [_0x2bb3a5,_0x83ee8b]of Object[_0x257993(0xe2)](_0x40695a)){_0x83ee8b!==undefined&&(_0x20c7e5[_0x2bb3a5]=_0x83ee8b);}return _0x20c7e5;}export function getTrinoHeaders(_0x4521df,_0x5f586f,_0x7d6aac){const _0x265ed4=a55_0x18b0,_0x5f1114=getAuthHeaders(_0x4521df),_0x4d3e24=toHeaderRecord(_0x5f1114);if(_0x7d6aac)_0x4d3e24['Authorization']=_0x265ed4(0xea)+_0x7d6aac;else _0x5f586f&&(_0x4d3e24[_0x265ed4(0xed)]=_0x5f586f);return _0x4d3e24;}export function hasAPIKey(_0x5ae8db){const _0x119a3c=a55_0x18b0,_0x4e75d7=getAPIKey();return _0x4e75d7!==undefined&&_0x4e75d7[_0x119a3c(0xf1)]>0x0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4cf41d,_0x22c891){const _0xd0b4c7=a56_0xe13f,_0x479414=_0x4cf41d();while(!![]){try{const _0x4821b6=-parseInt(_0xd0b4c7(0x18d))/0x1+-parseInt(_0xd0b4c7(0x194))/0x2+-parseInt(_0xd0b4c7(0x1a8))/0x3*(parseInt(_0xd0b4c7(0x1aa))/0x4)+parseInt(_0xd0b4c7(0x19c))/0x5+parseInt(_0xd0b4c7(0x184))/0x6+parseInt(_0xd0b4c7(0x18e))/0x7+-parseInt(_0xd0b4c7(0x1a5))/0x8;if(_0x4821b6===_0x22c891)break;else _0x479414['push'](_0x479414['shift']());}catch(_0x5bb0b4){_0x479414['push'](_0x479414['shift']());}}}(a56_0x459c,0x6e4c1));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 a56_0x14c237 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';function a56_0x459c(){const _0x2361cb=['2075688wsIXPy','error','stringify','669MkMAHp','isFinite','2428WEvYtJ','log','color','-FXRSn','limit','debug','string','bold','trim','padEnd','noColor','stderr','pipe','table','less','FINISHED','max','cyan','object','query','split','bigint','cmdout','keys','tsv','double','write','slice','[rule]','─┬─','entries','Results\x20saved\x20to\x20','varchar','4208982fvInpF','[logs]','data','join','repeat','number','format','rule','forEach','366548tPDJNs','1627682SLBOzN','stdin','boolean','params','No\x20data','resolve','301968WKGYSC','spawn','isTTY','magenta','output','stdout','json','[error]','2150540nWpxMD','map','close','[Object]','push','jsonl','length','limitStructuredFormats','inherit'];a56_0x459c=function(){return _0x2361cb;};return a56_0x459c();}export function isStructuredFormat(_0x45d023){const _0x279b32=a56_0xe13f;return _0x45d023['format']===_0x279b32(0x19a)||_0x45d023[_0x279b32(0x18a)]===_0x279b32(0x1a1)||_0x45d023['format']===_0x279b32(0x17b)||_0x45d023[_0x279b32(0x18a)]===_0x279b32(0x1b7)||_0x45d023[_0x279b32(0x19a)]===!![]||_0x45d023[_0x279b32(0x1a1)]===!![]||_0x45d023[_0x279b32(0x17b)]===!![]||_0x45d023[_0x279b32(0x1b7)]===!![];}export function parseOutputOptions(_0x12d7ec){const _0x1dce28=a56_0xe13f;return{'format':_0x12d7ec[_0x1dce28(0x18a)]||_0x1dce28(0x1b7),'output':_0x12d7ec[_0x1dce28(0x198)]||'','limit':_0x12d7ec['limit'],'limitStructuredFormats':_0x12d7ec[_0x1dce28(0x1a3)],'color':_0x12d7ec['color'],'noColor':_0x12d7ec[_0x1dce28(0x1b4)]};}function convertSDKResultToQueryResult(_0x6e9323){const _0xcc6037=a56_0xe13f,_0x537911=[];if(_0x6e9323[_0xcc6037(0x1a2)]>0x0){const _0x8f9130=_0x6e9323[0x0];for(const [_0x687398,_0x175956]of Object[_0xcc6037(0x181)](_0x8f9130)){let _0x528310=_0xcc6037(0x183);if(typeof _0x175956==='number')_0x528310=Number['isInteger'](_0x175956)?_0xcc6037(0x178):_0xcc6037(0x17c);else{if(typeof _0x175956===_0xcc6037(0x190))_0x528310=_0xcc6037(0x190);else _0x175956===null&&(_0x528310=_0xcc6037(0x183));}_0x537911[_0xcc6037(0x1a0)]({'name':_0x687398,'type':_0x528310});}}return{'queryId':'sdk-result','columns':_0x537911,'data':_0x6e9323,'stats':{'state':_0xcc6037(0x1b9),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x6e9323[_0xcc6037(0x1a2)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x401e90,_0x5f0f35){const _0x5e0b30=convertSDKResultToQueryResult(_0x401e90);return formatQueryOutput(_0x5e0b30,_0x5f0f35);}export async function formatQueryOutput(_0x5a384a,_0x42c9b5){const _0x3101da=a56_0xe13f,{format:_0x5c2ef9,limit:_0xd523e5,output:_0x13974c,color:_0x4b75b6,noColor:_0x2cdac5,limitStructuredFormats:_0x20bf3a}=_0x42c9b5,_0x3d2e54=Boolean(_0x13974c)&&!_0x4b75b6,_0x1b1eb4={'color':_0x4b75b6,'noColor':_0x2cdac5||_0x3d2e54};if(_0x5c2ef9===_0x3101da(0x1b7)){const _0x46be72=shouldUseLess(_0x5c2ef9,_0x13974c);return formatAsTable(_0x5a384a,_0xd523e5,_0x46be72,_0x1b1eb4);}const _0x55a7bd=_0x20bf3a&&Number[_0x3101da(0x1a9)](_0xd523e5)&&_0x5a384a[_0x3101da(0x186)][_0x3101da(0x1a2)]>_0xd523e5?{..._0x5a384a,'data':_0x5a384a[_0x3101da(0x186)][_0x3101da(0x17e)](0x0,_0xd523e5)}:_0x5a384a;if(_0x5c2ef9==='json')return formatAsJSON(_0x55a7bd,_0x1b1eb4);else return _0x5c2ef9===_0x3101da(0x1a1)?formatAsJSONL(_0x55a7bd,_0x1b1eb4):formatQueryResult(_0x55a7bd,_0x5c2ef9);}function shouldUseLess(_0x2d3825,_0x33e6d5){const _0xedc8a4=a56_0xe13f;return(_0x2d3825===_0xedc8a4(0x1b7)||_0x2d3825==='list')&&process[_0xedc8a4(0x199)][_0xedc8a4(0x196)]&&!_0x33e6d5;}export function resolveOutputOptions(_0x31f35e){const _0x34402d=a56_0xe13f,_0x16a3f8=_0x31f35e[_0x34402d(0x198)]||'',_0x358ef1=resolveOutputFormat(_0x31f35e[_0x34402d(0x18a)],_0x16a3f8,_0x34402d(0x1b7));let _0x456c32=typeof _0x31f35e[_0x34402d(0x1ae)]===_0x34402d(0x189)?_0x31f35e[_0x34402d(0x1ae)]:parseInt(_0x31f35e[_0x34402d(0x1ae)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x31f35e['limit']===undefined&&shouldUseLess(_0x358ef1,_0x16a3f8)&&(_0x456c32=Infinity),{'format':_0x358ef1,'output':_0x16a3f8,'limit':_0x456c32,'limitStructuredFormats':_0x31f35e[_0x34402d(0x1a3)],'color':_0x31f35e[_0x34402d(0x1ac)],'noColor':_0x31f35e[_0x34402d(0x1b4)]};}function a56_0xe13f(_0x2d6736,_0x54f6d9){_0x2d6736=_0x2d6736-0x178;const _0x459cd7=a56_0x459c();let _0xe13fc7=_0x459cd7[_0x2d6736];return _0xe13fc7;}export function writeOutput(_0x3fe44a,_0x50ac50,_0x1194f4){const _0x4ff62c=a56_0xe13f;return _0x50ac50?(writeFileSync(_0x50ac50,_0x3fe44a),console['error'](_0x4ff62c(0x182)+_0x50ac50),Promise[_0x4ff62c(0x193)]()):shouldUseLess(_0x1194f4||'','')?new Promise(_0x253875=>{const _0x4cf977=_0x4ff62c,_0x444f28=spawn(_0x4cf977(0x1b8),[_0x4cf977(0x1ad)],{'stdio':[_0x4cf977(0x1b6),_0x4cf977(0x1a4),'inherit']});let _0x3251d1=![];_0x444f28['on'](_0x4cf977(0x1a6),()=>{const _0x5bc7b6=_0x4cf977;!_0x3251d1&&(_0x3251d1=!![],console[_0x5bc7b6(0x1ab)](_0x3fe44a),_0x253875());}),_0x444f28['on'](_0x4cf977(0x19e),()=>{!_0x3251d1&&(_0x3251d1=!![],_0x253875());}),_0x444f28['on'](_0x4cf977(0x195),()=>{const _0x2bfde5=_0x4cf977;!_0x3251d1&&_0x444f28['stdin']&&(_0x444f28[_0x2bfde5(0x18f)]['on']('error',()=>{}),_0x444f28[_0x2bfde5(0x18f)][_0x2bfde5(0x17d)](_0x3fe44a),_0x444f28[_0x2bfde5(0x18f)]['end']());}),!_0x444f28[_0x4cf977(0x18f)]&&(!_0x3251d1&&(_0x3251d1=!![],console[_0x4cf977(0x1ab)](_0x3fe44a),_0x253875()));}):(console['log'](_0x3fe44a),Promise[_0x4ff62c(0x193)]());}export async function handleSDKOutput(_0x30c2d7,_0x3314db){const _0x30534d=a56_0xe13f,_0x103b46=resolveOutputOptions(_0x3314db),_0x3c19f8=await formatSDKOutput(_0x30c2d7,_0x103b46);await writeOutput(_0x3c19f8,_0x103b46[_0x30534d(0x198)]||undefined,_0x103b46[_0x30534d(0x18a)]);}export async function handleQueryOutput(_0x33d258,_0x5ea5ee){const _0x245e60=a56_0xe13f,_0x1fd059=resolveOutputOptions(_0x5ea5ee),_0x29c251=await formatQueryOutput(_0x33d258,_0x1fd059);await writeOutput(_0x29c251,_0x1fd059[_0x245e60(0x198)]||undefined,_0x1fd059[_0x245e60(0x18a)]);}async function formatSingleObject(_0x29eba6,_0x59177e){const _0x3ebecf=a56_0xe13f,{format:_0x1921d3,color:_0x5df002,noColor:_0x32e64b}=_0x59177e,_0x13f39c={'color':_0x5df002,'noColor':_0x32e64b};if(_0x1921d3===_0x3ebecf(0x19a)){if(shouldUseColor(_0x13f39c))return colorizeJSON(_0x29eba6,_0x13f39c);return JSON[_0x3ebecf(0x1a7)](_0x29eba6,null,0x2);}else{if(_0x1921d3===_0x3ebecf(0x1a1)){if(shouldUseColor(_0x13f39c))return colorizeJSONCompact(_0x29eba6,_0x13f39c);return JSON[_0x3ebecf(0x1a7)](_0x29eba6);}else{if(_0x1921d3===_0x3ebecf(0x17b))return Object[_0x3ebecf(0x181)](_0x29eba6)['map'](([_0xdb7563,_0x391f37])=>_0xdb7563+'\x09'+_0x391f37)[_0x3ebecf(0x187)]('\x0a');else{const _0x118072=Object['entries'](_0x29eba6);if(_0x118072['length']===0x0)return _0x3ebecf(0x192);const _0x14f0c8=_0x29eba6['debug'],_0x4e7f20=_0x29eba6[_0x3ebecf(0x1bd)],_0x588868=_0x29eba6[_0x3ebecf(0x191)],_0x34ed52=_0x29eba6[_0x3ebecf(0x18b)],_0x2e780c=_0x4e7f20?typeof _0x4e7f20===_0x3ebecf(0x1b0)?_0x4e7f20:JSON[_0x3ebecf(0x1a7)](_0x4e7f20,null,0x2):undefined,_0x332178=_0x588868&&Object['keys'](_0x588868)[_0x3ebecf(0x1a2)]>0x0?JSON['stringify'](_0x588868,null,0x2):undefined,_0x42170d=_0x34ed52&&Object[_0x3ebecf(0x17a)](_0x34ed52)[_0x3ebecf(0x1a2)]>0x0?JSON[_0x3ebecf(0x1a7)](_0x34ed52,null,0x2):undefined,_0x473f8c=_0x118072['filter'](([_0x49d3c0])=>_0x49d3c0!==_0x3ebecf(0x1af)&&_0x49d3c0!==_0x3ebecf(0x1bd)&&_0x49d3c0!==_0x3ebecf(0x191)&&_0x49d3c0!==_0x3ebecf(0x18b)),_0xc45915=Math['max'](..._0x473f8c[_0x3ebecf(0x19d)](([_0x3efe4d])=>_0x3efe4d['length'])),_0x2fb858=Math['max'](..._0x473f8c[_0x3ebecf(0x19d)](([,_0x51602a])=>{const _0x54ab5d=_0x3ebecf;try{const _0x24dfc4=_0x51602a===null||_0x51602a===undefined?'':typeof _0x51602a==='object'?JSON[_0x54ab5d(0x1a7)](_0x51602a):String(_0x51602a),_0x4cd3e6=_0x24dfc4[_0x54ab5d(0x1be)]('\x0a');return Math[_0x54ab5d(0x1ba)](..._0x4cd3e6[_0x54ab5d(0x19d)](_0x21f9e1=>_0x21f9e1[_0x54ab5d(0x1a2)]),0x0);}catch{return 0x0;}}),0x14),_0x3c9c22=[];_0x3c9c22[_0x3ebecf(0x1a0)](colorBorder('┌─'+'─'[_0x3ebecf(0x188)](_0xc45915)+_0x3ebecf(0x180)+'─'[_0x3ebecf(0x188)](_0x2fb858)+'─┐',_0x13f39c)),_0x473f8c['forEach'](([_0x508085,_0x193afb])=>{const _0x5b2086=_0x3ebecf;let _0x260e35;try{_0x260e35=_0x193afb===null||_0x193afb===undefined?'':typeof _0x193afb===_0x5b2086(0x1bc)?JSON[_0x5b2086(0x1a7)](_0x193afb):String(_0x193afb);}catch{_0x260e35=_0x5b2086(0x19f);}const _0x4fdbf4=_0x508085[_0x5b2086(0x1b3)](_0xc45915),_0x1e648e=_0x260e35[_0x5b2086(0x1be)]('\x0a');_0x1e648e[_0x5b2086(0x18c)]((_0x566f46,_0x4daba8)=>{const _0x4b4139=_0x5b2086,_0x17c5b8=colorBorder('│',_0x13f39c);_0x4daba8===0x0?_0x3c9c22[_0x4b4139(0x1a0)](_0x17c5b8+'\x20'+_0x4fdbf4+'\x20'+_0x17c5b8+'\x20'+_0x566f46[_0x4b4139(0x1b3)](_0x2fb858)+'\x20'+_0x17c5b8):_0x3c9c22[_0x4b4139(0x1a0)](_0x17c5b8+'\x20'+'\x20'[_0x4b4139(0x188)](_0xc45915)+'\x20'+_0x17c5b8+'\x20'+_0x566f46[_0x4b4139(0x1b3)](_0x2fb858)+'\x20'+_0x17c5b8);});}),_0x3c9c22['push'](colorBorder('└─'+'─'[_0x3ebecf(0x188)](_0xc45915)+'─┴─'+'─'[_0x3ebecf(0x188)](_0x2fb858)+'─┘',_0x13f39c));_0x2e780c&&(_0x3c9c22[_0x3ebecf(0x1a0)](''),_0x3c9c22[_0x3ebecf(0x1a0)](String(a56_0x14c237['yellow'][_0x3ebecf(0x1b1)]('[query]'))),_0x3c9c22['push'](_0x2e780c));_0x332178&&(_0x3c9c22[_0x3ebecf(0x1a0)](''),_0x3c9c22['push'](String(a56_0x14c237['blue'][_0x3ebecf(0x1b1)]('[params]'))),_0x3c9c22[_0x3ebecf(0x1a0)](_0x332178));_0x42170d&&(_0x3c9c22[_0x3ebecf(0x1a0)](''),_0x3c9c22[_0x3ebecf(0x1a0)](String(a56_0x14c237[_0x3ebecf(0x197)][_0x3ebecf(0x1b1)](_0x3ebecf(0x17f)))),_0x3c9c22[_0x3ebecf(0x1a0)](_0x42170d));if(_0x14f0c8){if(_0x14f0c8[_0x3ebecf(0x1b5)]){_0x3c9c22['push'](''),_0x3c9c22[_0x3ebecf(0x1a0)](String(a56_0x14c237['red'][_0x3ebecf(0x1b1)](_0x3ebecf(0x19b))));const _0x43a506=_0x14f0c8['stderr'][_0x3ebecf(0x1be)]('\x0a');_0x43a506[_0x3ebecf(0x18c)](_0x57c7b6=>{const _0x155751=_0x3ebecf;_0x57c7b6[_0x155751(0x1b2)]()&&_0x3c9c22[_0x155751(0x1a0)](_0x57c7b6);});}if(_0x14f0c8[_0x3ebecf(0x179)]){_0x3c9c22['push'](''),_0x3c9c22[_0x3ebecf(0x1a0)](String(a56_0x14c237[_0x3ebecf(0x1bb)][_0x3ebecf(0x1b1)](_0x3ebecf(0x185))));const _0x5724ee=_0x14f0c8[_0x3ebecf(0x179)]['split']('\x0a');_0x5724ee[_0x3ebecf(0x18c)](_0x1ce067=>{const _0x2afdb7=_0x3ebecf;_0x1ce067[_0x2afdb7(0x1b2)]()&&_0x3c9c22[_0x2afdb7(0x1a0)](_0x1ce067);});}}return _0x3c9c22['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x3ef504,_0xc16069){const _0x31e357=a56_0xe13f;if(_0xc16069['format']==='table'){await handleSDKOutput([_0x3ef504],_0xc16069);return;}const _0x5ba790=resolveOutputOptions(_0xc16069),_0x7cdc9a=await formatSingleObject(_0x3ef504,_0x5ba790);await writeOutput(_0x7cdc9a,_0x5ba790[_0x31e357(0x198)]||undefined,_0x5ba790[_0x31e357(0x18a)]);}
|
|
1
|
+
(function(_0x35671f,_0x436ab5){const _0x1bfc55=a56_0x3f40,_0x257fab=_0x35671f();while(!![]){try{const _0x1c7439=parseInt(_0x1bfc55(0x180))/0x1+-parseInt(_0x1bfc55(0x16d))/0x2*(-parseInt(_0x1bfc55(0x159))/0x3)+-parseInt(_0x1bfc55(0x174))/0x4+-parseInt(_0x1bfc55(0x19b))/0x5*(parseInt(_0x1bfc55(0x1a2))/0x6)+-parseInt(_0x1bfc55(0x186))/0x7*(-parseInt(_0x1bfc55(0x176))/0x8)+-parseInt(_0x1bfc55(0x17d))/0x9*(-parseInt(_0x1bfc55(0x164))/0xa)+-parseInt(_0x1bfc55(0x190))/0xb*(parseInt(_0x1bfc55(0x189))/0xc);if(_0x1c7439===_0x436ab5)break;else _0x257fab['push'](_0x257fab['shift']());}catch(_0xd8704d){_0x257fab['push'](_0x257fab['shift']());}}}(a56_0x10d7,0x813c0));import{writeFileSync}from'fs';function a56_0x10d7(){const _0x24e72f=['[logs]','FINISHED','forEach','tsv','-FXRSn','push','17778211iEQjhU','noColor','entries','red','json','[params]','limit','number','error','close','join','54935PJyQqc','resolve','rule','isFinite','data','list','[rule]','354eDESCv','cmdout','stdout','29901MRJyIb','output','cyan','isTTY','limitStructuredFormats','spawn','string','log','blue','jsonl','color','410bHkLsj','split','bold','yellow','stderr','end','repeat','double','─┬─','188cPqJkg','table','query','format','varchar','trim','isInteger','1189548UGzcCp','sdk-result','1528XuvLzf','stdin','debug','[query]','params','write','inherit','63180Bmjrml','length','stringify','1011149iumzIx','boolean','[error]','slice','map','padEnd','31346EmpnVa','keys','max','12DSehlE'];a56_0x10d7=function(){return _0x24e72f;};return a56_0x10d7();}import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a56_0x554305 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x5755de){const _0xc4277b=a56_0x3f40;return _0x5755de[_0xc4277b(0x170)]===_0xc4277b(0x194)||_0x5755de[_0xc4277b(0x170)]===_0xc4277b(0x162)||_0x5755de[_0xc4277b(0x170)]==='tsv'||_0x5755de['format']===_0xc4277b(0x16e)||_0x5755de['json']===!![]||_0x5755de[_0xc4277b(0x162)]===!![]||_0x5755de[_0xc4277b(0x18d)]===!![]||_0x5755de[_0xc4277b(0x16e)]===!![];}export function parseOutputOptions(_0x196efa){const _0x26dfc5=a56_0x3f40;return{'format':_0x196efa[_0x26dfc5(0x170)]||'table','output':_0x196efa['output']||'','limit':_0x196efa[_0x26dfc5(0x196)],'limitStructuredFormats':_0x196efa[_0x26dfc5(0x15d)],'color':_0x196efa['color'],'noColor':_0x196efa['noColor']};}function a56_0x3f40(_0x1c9eac,_0x3fcf11){_0x1c9eac=_0x1c9eac-0x159;const _0x10d7cf=a56_0x10d7();let _0x3f409d=_0x10d7cf[_0x1c9eac];return _0x3f409d;}function convertSDKResultToQueryResult(_0x533dc5){const _0x26d4ed=a56_0x3f40,_0x1784ee=[];if(_0x533dc5[_0x26d4ed(0x17e)]>0x0){const _0x18819c=_0x533dc5[0x0];for(const [_0x5abfcb,_0x5d29b2]of Object[_0x26d4ed(0x192)](_0x18819c)){let _0x4c7a8a='varchar';if(typeof _0x5d29b2===_0x26d4ed(0x197))_0x4c7a8a=Number[_0x26d4ed(0x173)](_0x5d29b2)?'bigint':_0x26d4ed(0x16b);else{if(typeof _0x5d29b2===_0x26d4ed(0x181))_0x4c7a8a=_0x26d4ed(0x181);else _0x5d29b2===null&&(_0x4c7a8a=_0x26d4ed(0x171));}_0x1784ee[_0x26d4ed(0x18f)]({'name':_0x5abfcb,'type':_0x4c7a8a});}}return{'queryId':_0x26d4ed(0x175),'columns':_0x1784ee,'data':_0x533dc5,'stats':{'state':_0x26d4ed(0x18b),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x533dc5['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x546867,_0xb78935){const _0x5a8924=convertSDKResultToQueryResult(_0x546867);return formatQueryOutput(_0x5a8924,_0xb78935);}export async function formatQueryOutput(_0x4e462b,_0x29969d){const _0x248c46=a56_0x3f40,{format:_0x207e05,limit:_0x5e2829,output:_0x1d7930,color:_0x582bc2,noColor:_0x4b982b,limitStructuredFormats:_0x3a41e5}=_0x29969d,_0x4fecf3=Boolean(_0x1d7930)&&!_0x582bc2,_0x4c0fc9={'color':_0x582bc2,'noColor':_0x4b982b||_0x4fecf3};if(_0x207e05===_0x248c46(0x16e)){const _0x2377c0=shouldUseLess(_0x207e05,_0x1d7930);return formatAsTable(_0x4e462b,_0x5e2829,_0x2377c0,_0x4c0fc9);}const _0x485bea=_0x3a41e5&&Number[_0x248c46(0x19e)](_0x5e2829)&&_0x4e462b['data'][_0x248c46(0x17e)]>_0x5e2829?{..._0x4e462b,'data':_0x4e462b[_0x248c46(0x19f)][_0x248c46(0x183)](0x0,_0x5e2829)}:_0x4e462b;if(_0x207e05===_0x248c46(0x194))return formatAsJSON(_0x485bea,_0x4c0fc9);else return _0x207e05===_0x248c46(0x162)?formatAsJSONL(_0x485bea,_0x4c0fc9):formatQueryResult(_0x485bea,_0x207e05);}function shouldUseLess(_0xb19dbc,_0x294bc6){const _0x165c59=a56_0x3f40;return(_0xb19dbc===_0x165c59(0x16e)||_0xb19dbc===_0x165c59(0x1a0))&&process[_0x165c59(0x1a4)][_0x165c59(0x15c)]&&!_0x294bc6;}export function resolveOutputOptions(_0x1661cd){const _0xb074af=a56_0x3f40,_0x7b2e31=_0x1661cd[_0xb074af(0x15a)]||'',_0x5b0a16=resolveOutputFormat(_0x1661cd[_0xb074af(0x170)],_0x7b2e31,_0xb074af(0x16e));let _0x57a331=typeof _0x1661cd['limit']===_0xb074af(0x197)?_0x1661cd[_0xb074af(0x196)]:parseInt(_0x1661cd[_0xb074af(0x196)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x1661cd[_0xb074af(0x196)]===undefined&&shouldUseLess(_0x5b0a16,_0x7b2e31)&&(_0x57a331=Infinity),{'format':_0x5b0a16,'output':_0x7b2e31,'limit':_0x57a331,'limitStructuredFormats':_0x1661cd[_0xb074af(0x15d)],'color':_0x1661cd[_0xb074af(0x163)],'noColor':_0x1661cd[_0xb074af(0x191)]};}export function writeOutput(_0x3ad199,_0x1bd6ff,_0x841a91){const _0x11c164=a56_0x3f40;return _0x1bd6ff?(writeFileSync(_0x1bd6ff,_0x3ad199),console[_0x11c164(0x198)]('Results\x20saved\x20to\x20'+_0x1bd6ff),Promise[_0x11c164(0x19c)]()):shouldUseLess(_0x841a91||'','')?new Promise(_0x3008f4=>{const _0x2d7e81=_0x11c164,_0x5b0c8b=spawn('less',[_0x2d7e81(0x18e)],{'stdio':['pipe',_0x2d7e81(0x17c),'inherit']});let _0x4960f1=![];_0x5b0c8b['on'](_0x2d7e81(0x198),()=>{const _0x16c1bd=_0x2d7e81;!_0x4960f1&&(_0x4960f1=!![],console[_0x16c1bd(0x160)](_0x3ad199),_0x3008f4());}),_0x5b0c8b['on'](_0x2d7e81(0x199),()=>{!_0x4960f1&&(_0x4960f1=!![],_0x3008f4());}),_0x5b0c8b['on'](_0x2d7e81(0x15e),()=>{const _0x1642a3=_0x2d7e81;!_0x4960f1&&_0x5b0c8b[_0x1642a3(0x177)]&&(_0x5b0c8b[_0x1642a3(0x177)]['on'](_0x1642a3(0x198),()=>{}),_0x5b0c8b[_0x1642a3(0x177)][_0x1642a3(0x17b)](_0x3ad199),_0x5b0c8b['stdin'][_0x1642a3(0x169)]());}),!_0x5b0c8b['stdin']&&(!_0x4960f1&&(_0x4960f1=!![],console['log'](_0x3ad199),_0x3008f4()));}):(console[_0x11c164(0x160)](_0x3ad199),Promise[_0x11c164(0x19c)]());}export async function handleSDKOutput(_0x25bca4,_0x189c4c){const _0x19382e=a56_0x3f40,_0x3ecf3a=resolveOutputOptions(_0x189c4c),_0x4390af=await formatSDKOutput(_0x25bca4,_0x3ecf3a);await writeOutput(_0x4390af,_0x3ecf3a[_0x19382e(0x15a)]||undefined,_0x3ecf3a[_0x19382e(0x170)]);}export async function handleQueryOutput(_0x480d42,_0x1e8698){const _0x45c285=a56_0x3f40,_0x480fac=resolveOutputOptions(_0x1e8698),_0x5995a9=await formatQueryOutput(_0x480d42,_0x480fac);await writeOutput(_0x5995a9,_0x480fac[_0x45c285(0x15a)]||undefined,_0x480fac[_0x45c285(0x170)]);}async function formatSingleObject(_0x4ca3ff,_0x496be8){const _0x4d5f5b=a56_0x3f40,{format:_0x2c3b6a,color:_0x4c85d5,noColor:_0x2cd564}=_0x496be8,_0x2f9a46={'color':_0x4c85d5,'noColor':_0x2cd564};if(_0x2c3b6a===_0x4d5f5b(0x194)){if(shouldUseColor(_0x2f9a46))return colorizeJSON(_0x4ca3ff,_0x2f9a46);return JSON[_0x4d5f5b(0x17f)](_0x4ca3ff,null,0x2);}else{if(_0x2c3b6a===_0x4d5f5b(0x162)){if(shouldUseColor(_0x2f9a46))return colorizeJSONCompact(_0x4ca3ff,_0x2f9a46);return JSON[_0x4d5f5b(0x17f)](_0x4ca3ff);}else{if(_0x2c3b6a==='tsv')return Object[_0x4d5f5b(0x192)](_0x4ca3ff)[_0x4d5f5b(0x184)](([_0x56d539,_0x5d71a9])=>_0x56d539+'\x09'+_0x5d71a9)[_0x4d5f5b(0x19a)]('\x0a');else{const _0x5e8772=Object[_0x4d5f5b(0x192)](_0x4ca3ff);if(_0x5e8772[_0x4d5f5b(0x17e)]===0x0)return'No\x20data';const _0x2f9921=_0x4ca3ff[_0x4d5f5b(0x178)],_0x5b71ce=_0x4ca3ff[_0x4d5f5b(0x16f)],_0x138aff=_0x4ca3ff[_0x4d5f5b(0x17a)],_0x526950=_0x4ca3ff[_0x4d5f5b(0x19d)],_0x22c0bc=_0x5b71ce?typeof _0x5b71ce===_0x4d5f5b(0x15f)?_0x5b71ce:JSON[_0x4d5f5b(0x17f)](_0x5b71ce,null,0x2):undefined,_0x3104cd=_0x138aff&&Object[_0x4d5f5b(0x187)](_0x138aff)['length']>0x0?JSON[_0x4d5f5b(0x17f)](_0x138aff,null,0x2):undefined,_0x28441e=_0x526950&&Object[_0x4d5f5b(0x187)](_0x526950)['length']>0x0?JSON['stringify'](_0x526950,null,0x2):undefined,_0x490fd1=_0x5e8772['filter'](([_0xa10f69])=>_0xa10f69!==_0x4d5f5b(0x178)&&_0xa10f69!==_0x4d5f5b(0x16f)&&_0xa10f69!==_0x4d5f5b(0x17a)&&_0xa10f69!==_0x4d5f5b(0x19d)),_0x273819=Math[_0x4d5f5b(0x188)](..._0x490fd1['map'](([_0x1f22df])=>_0x1f22df[_0x4d5f5b(0x17e)])),_0x128fca=Math[_0x4d5f5b(0x188)](..._0x490fd1[_0x4d5f5b(0x184)](([,_0x8df179])=>{const _0x2178e8=_0x4d5f5b;try{const _0x4b587c=_0x8df179===null||_0x8df179===undefined?'':typeof _0x8df179==='object'?JSON[_0x2178e8(0x17f)](_0x8df179):String(_0x8df179),_0x38e309=_0x4b587c['split']('\x0a');return Math[_0x2178e8(0x188)](..._0x38e309[_0x2178e8(0x184)](_0x42db77=>_0x42db77['length']),0x0);}catch{return 0x0;}}),0x14),_0x1170a2=[];_0x1170a2[_0x4d5f5b(0x18f)](colorBorder('┌─'+'─'[_0x4d5f5b(0x16a)](_0x273819)+_0x4d5f5b(0x16c)+'─'[_0x4d5f5b(0x16a)](_0x128fca)+'─┐',_0x2f9a46)),_0x490fd1['forEach'](([_0x3c0286,_0x300c99])=>{const _0x59a203=_0x4d5f5b;let _0x5bdb2c;try{_0x5bdb2c=_0x300c99===null||_0x300c99===undefined?'':typeof _0x300c99==='object'?JSON[_0x59a203(0x17f)](_0x300c99):String(_0x300c99);}catch{_0x5bdb2c='[Object]';}const _0x213b23=_0x3c0286[_0x59a203(0x185)](_0x273819),_0x435160=_0x5bdb2c[_0x59a203(0x165)]('\x0a');_0x435160['forEach']((_0x2195f9,_0x176373)=>{const _0x8007d5=_0x59a203,_0x3c6ead=colorBorder('│',_0x2f9a46);_0x176373===0x0?_0x1170a2[_0x8007d5(0x18f)](_0x3c6ead+'\x20'+_0x213b23+'\x20'+_0x3c6ead+'\x20'+_0x2195f9[_0x8007d5(0x185)](_0x128fca)+'\x20'+_0x3c6ead):_0x1170a2[_0x8007d5(0x18f)](_0x3c6ead+'\x20'+'\x20'[_0x8007d5(0x16a)](_0x273819)+'\x20'+_0x3c6ead+'\x20'+_0x2195f9[_0x8007d5(0x185)](_0x128fca)+'\x20'+_0x3c6ead);});}),_0x1170a2['push'](colorBorder('└─'+'─'[_0x4d5f5b(0x16a)](_0x273819)+'─┴─'+'─'[_0x4d5f5b(0x16a)](_0x128fca)+'─┘',_0x2f9a46));_0x22c0bc&&(_0x1170a2['push'](''),_0x1170a2[_0x4d5f5b(0x18f)](String(a56_0x554305[_0x4d5f5b(0x167)][_0x4d5f5b(0x166)](_0x4d5f5b(0x179)))),_0x1170a2['push'](_0x22c0bc));_0x3104cd&&(_0x1170a2[_0x4d5f5b(0x18f)](''),_0x1170a2[_0x4d5f5b(0x18f)](String(a56_0x554305[_0x4d5f5b(0x161)][_0x4d5f5b(0x166)](_0x4d5f5b(0x195)))),_0x1170a2['push'](_0x3104cd));_0x28441e&&(_0x1170a2[_0x4d5f5b(0x18f)](''),_0x1170a2[_0x4d5f5b(0x18f)](String(a56_0x554305['magenta'][_0x4d5f5b(0x166)](_0x4d5f5b(0x1a1)))),_0x1170a2[_0x4d5f5b(0x18f)](_0x28441e));if(_0x2f9921){if(_0x2f9921[_0x4d5f5b(0x168)]){_0x1170a2[_0x4d5f5b(0x18f)](''),_0x1170a2[_0x4d5f5b(0x18f)](String(a56_0x554305[_0x4d5f5b(0x193)]['bold'](_0x4d5f5b(0x182))));const _0x19692f=_0x2f9921[_0x4d5f5b(0x168)][_0x4d5f5b(0x165)]('\x0a');_0x19692f[_0x4d5f5b(0x18c)](_0x47c66b=>{const _0x366518=_0x4d5f5b;_0x47c66b[_0x366518(0x172)]()&&_0x1170a2['push'](_0x47c66b);});}if(_0x2f9921[_0x4d5f5b(0x1a3)]){_0x1170a2[_0x4d5f5b(0x18f)](''),_0x1170a2['push'](String(a56_0x554305[_0x4d5f5b(0x15b)][_0x4d5f5b(0x166)](_0x4d5f5b(0x18a))));const _0x2c12f8=_0x2f9921[_0x4d5f5b(0x1a3)]['split']('\x0a');_0x2c12f8[_0x4d5f5b(0x18c)](_0x31a502=>{const _0x225447=_0x4d5f5b;_0x31a502['trim']()&&_0x1170a2[_0x225447(0x18f)](_0x31a502);});}}return _0x1170a2[_0x4d5f5b(0x19a)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x6419f3,_0x12bda7){const _0xd42fe=a56_0x3f40;if(_0x12bda7[_0xd42fe(0x170)]==='table'){await handleSDKOutput([_0x6419f3],_0x12bda7);return;}const _0x4169c7=resolveOutputOptions(_0x12bda7),_0xda9dcd=await formatSingleObject(_0x6419f3,_0x4169c7);await writeOutput(_0xda9dcd,_0x4169c7[_0xd42fe(0x15a)]||undefined,_0x4169c7[_0xd42fe(0x170)]);}
|