@treasuredata/tdx 2026.4.17 → 2026.4.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/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.d.ts +38 -0
- package/dist/commands/engage-command.d.ts.map +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-command.js.map +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.d.ts +26 -1
- package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/engage-api-client.js.map +1 -1
- package/dist/sdk/client/http-client.d.ts +1 -1
- package/dist/sdk/client/http-client.d.ts.map +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/http-client.js.map +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-validator.js.map +1 -1
- package/dist/sdk/engage/campaign-yaml.d.ts +1 -1
- package/dist/sdk/engage/campaign-yaml.d.ts.map +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js.map +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.d.ts +2 -2
- package/dist/sdk/engage/types/campaign-def.d.ts.map +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js.map +1 -1
- package/dist/sdk/engage/types/campaign-schema.d.ts +256 -8
- package/dist/sdk/engage/types/campaign-schema.d.ts.map +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js.map +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.d.ts +28 -1
- package/dist/sdk/engage.d.ts.map +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/engage.js.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.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/engage.d.ts +125 -1
- package/dist/sdk/types/engage.d.ts.map +1 -1
- package/dist/sdk/types/index.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +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_0x141bbb=a54_0x3172;(function(_0x45dbd5,_0x1c3055){const _0x1e5974=a54_0x3172,_0x5635c8=_0x45dbd5();while(!![]){try{const _0x5bcaf6=parseInt(_0x1e5974(0x1fd))/0x1+parseInt(_0x1e5974(0x2e0))/0x2*(-parseInt(_0x1e5974(0x33e))/0x3)+-parseInt(_0x1e5974(0x201))/0x4*(-parseInt(_0x1e5974(0x1d4))/0x5)+-parseInt(_0x1e5974(0x2d5))/0x6+-parseInt(_0x1e5974(0x214))/0x7+parseInt(_0x1e5974(0x2e3))/0x8*(-parseInt(_0x1e5974(0x345))/0x9)+-parseInt(_0x1e5974(0x1ae))/0xa*(-parseInt(_0x1e5974(0x202))/0xb);if(_0x5bcaf6===_0x1c3055)break;else _0x5635c8['push'](_0x5635c8['shift']());}catch(_0xdff002){_0x5635c8['push'](_0x5635c8['shift']());}}}(a54_0xc7bf,0xac61d));import a54_0x467bd9 from'chalk';import{existsSync}from'fs';import a54_0x20d6ee 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_0x20ee9d from'prompts';function getAttemptStatusDisplay(_0x2216d4){const _0x405301=a54_0x3172;if(!_0x2216d4)return{'icon':'⏳','text':''};const {done:_0x118afe,success:_0x20360b,cancelRequested:_0x1ad05a}=_0x2216d4;if(!_0x118afe)return _0x1ad05a?{'icon':'🛑','text':a54_0x467bd9[_0x405301(0x371)]('canceling')}:{'icon':'🔄','text':a54_0x467bd9[_0x405301(0x370)](_0x405301(0x295))};if(_0x20360b)return{'icon':'✅','text':a54_0x467bd9[_0x405301(0x20d)](_0x405301(0x346))};return{'icon':'❌','text':a54_0x467bd9['red'](_0x405301(0x2fc))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x141bbb(0x327)](_0x5357f4,_0x4a369f,_0x4279a8=0x0){const _0x5df392=a54_0x141bbb;return _0x5357f4[_0x4279a8]||_0x4a369f[_0x5df392(0x1d8)];}[a54_0x141bbb(0x374)](_0xee7a6a,_0x12aec2,_0xb4ef5c=0x0){const _0xa8824b=a54_0x141bbb,_0x1c2240=this[_0xa8824b(0x327)](_0xee7a6a,_0x12aec2,_0xb4ef5c);if(!_0x1c2240)return console[_0xa8824b(0x2fc)](a54_0x467bd9['red']('Error:'),_0xa8824b(0x2ef)),console[_0xa8824b(0x2fc)](a54_0x467bd9[_0xa8824b(0x293)](_0xa8824b(0x2cd))),null;return _0x1c2240;}['parseProjectWorkflowPattern'](_0x3bfa35,_0x111f6d){const _0x259e06=a54_0x141bbb;if(_0x3bfa35[0x0]){const _0x3ac1b4=_0x3bfa35[0x0]['split']('.');if(_0x3ac1b4[_0x259e06(0x1fa)]===0x1)return{'projectName':_0x3ac1b4[0x0],'workflowName':undefined};else return _0x3ac1b4[_0x259e06(0x1fa)]===0x2?{'projectName':_0x3ac1b4[0x0],'workflowName':_0x3ac1b4[0x1]}:(console[_0x259e06(0x2fc)](a54_0x467bd9[_0x259e06(0x2ac)](_0x259e06(0x20a)),_0x259e06(0x35e)),null);}return{'projectName':_0x111f6d[_0x259e06(0x1d8)],'workflowName':undefined};}[a54_0x141bbb(0x37a)](_0x381ada,_0x3b9515,_0x3f382d=0x0){const _0x5bed97=a54_0x141bbb;if(_0x381ada[_0x3f382d])return _0x381ada[_0x3f382d];if(_0x3b9515[_0x5bed97(0x1d8)]){const _0x5b51a4=a54_0x20d6ee['join'](process[_0x5bed97(0x34e)](),_0x5bed97(0x31c),_0x3b9515['workflowProject']);if(existsSync(a54_0x20d6ee[_0x5bed97(0x337)](_0x5b51a4,_0x5bed97(0x2dd))))return _0x5b51a4;}return undefined;}async[a54_0x141bbb(0x1da)](_0x2460d6,_0x2f0651,_0x5b0cbf){const _0x459abe=a54_0x141bbb;try{const _0x325173=await _0x2460d6[_0x459abe(0x22f)][_0x459abe(0x31c)](_0x2f0651,{'limit':0x1});if(_0x325173['length']>0x0){const _0x4c2248=_0x325173[0x0]['id'],_0x17f4f3=getWorkflowUrl(_0x5b0cbf,_0x4c2248);console[_0x459abe(0x2fc)](_0x459abe(0x28c)+a54_0x467bd9[_0x459abe(0x1cf)](_0x17f4f3));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a54_0x141bbb(0x34d)]=a54_0x141bbb(0x2a4);[a54_0x141bbb(0x20b)]=a54_0x141bbb(0x342);async['execute'](_0x48eeb1){const _0x6b85e3=a54_0x141bbb,{options:_0x302e4a,args:_0x247fb2,tdx:_0xca48a7}=_0x48eeb1,_0x2ff1d3=_0x247fb2[0x0],_0x5d97b1=_0x302e4a[_0x6b85e3(0x357)];if(_0x5d97b1)return saveSessionContext({'workflow_project':undefined},_0x302e4a[_0x6b85e3(0x34f)]),console[_0x6b85e3(0x2b9)](a54_0x467bd9[_0x6b85e3(0x20d)](_0x6b85e3(0x2c2))),0x0;if(!_0x2ff1d3)return console[_0x6b85e3(0x2fc)](a54_0x467bd9[_0x6b85e3(0x2ac)](_0x6b85e3(0x20a)),_0x6b85e3(0x2ef)),console['error'](a54_0x467bd9[_0x6b85e3(0x293)](_0x6b85e3(0x2f2))),console[_0x6b85e3(0x2fc)](a54_0x467bd9['dim'](_0x6b85e3(0x32f))),0x1;const _0x478991=await withSpinner(_0x6b85e3(0x32e)+_0x2ff1d3+'\x27...',()=>_0xca48a7[_0x6b85e3(0x22f)][_0x6b85e3(0x36a)](_0x2ff1d3),{'verbose':_0x302e4a['verbose']}),{name:_0x4af760}=_0x478991[_0x6b85e3(0x227)];return saveSessionContext({'workflow_project':_0x4af760},_0x302e4a[_0x6b85e3(0x34f)]),console[_0x6b85e3(0x2b9)](a54_0x467bd9[_0x6b85e3(0x20d)](_0x6b85e3(0x298)+a54_0x467bd9[_0x6b85e3(0x1cf)](_0x4af760))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x141bbb(0x34d)]=a54_0x141bbb(0x1d2);[a54_0x141bbb(0x20b)]=a54_0x141bbb(0x225);async[a54_0x141bbb(0x21d)](_0x43cdb2){const _0x2ff851=a54_0x141bbb,{options:_0x3b1211,args:_0x243b26,tdx:_0x4f2400}=_0x43cdb2,_0x4667f6=_0x243b26[0x0];_0x3b1211[_0x2ff851(0x2c5)]&&_0x4667f6&&console['error'](_0x2ff851(0x2f3)+_0x4667f6);const _0x2f7cd3=await withSpinner(_0x2ff851(0x2d9),()=>_0x4f2400[_0x2ff851(0x22f)]['projects'](_0x4667f6,{'limit':_0x3b1211[_0x2ff851(0x280)]}),{'verbose':_0x3b1211[_0x2ff851(0x2c5)]});let _0x3faade=_0x2f7cd3['data'];_0x3faade[_0x2ff851(0x2d7)]((_0x43835b,_0x3b08f5)=>_0x43835b[_0x2ff851(0x34d)][_0x2ff851(0x204)](_0x3b08f5[_0x2ff851(0x34d)]));const _0x5c9b94=_0x3b1211['limit']||0x64,_0x388e67=_0x3faade[_0x2ff851(0x1fa)]>=_0x5c9b94?a54_0x467bd9[_0x2ff851(0x293)](_0x2ff851(0x31a)):'';console[_0x2ff851(0x2fc)](_0x2ff851(0x35d)+_0x3faade[_0x2ff851(0x1fa)]+_0x2ff851(0x1cb)+(_0x3faade[_0x2ff851(0x1fa)]!==0x1?'s':'')+_0x388e67);if(_0x3b1211['format']===_0x2ff851(0x1f1)||_0x3b1211[_0x2ff851(0x244)]===_0x2ff851(0x26d)||_0x3b1211[_0x2ff851(0x244)]===_0x2ff851(0x331))await handleSDKOutput(_0x3faade,_0x3b1211);else{if(_0x3faade['length']===0x0)_0x4667f6?console[_0x2ff851(0x2b9)](_0x2ff851(0x27a)+_0x4667f6):console[_0x2ff851(0x2b9)](_0x2ff851(0x318));else{const _0x3aec22=_0x3faade[_0x2ff851(0x2b6)](_0x2291cf=>{const _0x1f4fe2=_0x2ff851,_0x488dc3=_0x2291cf['metadata']?.[_0x1f4fe2(0x310)](_0x26ce76=>_0x26ce76[_0x1f4fe2(0x24f)]===_0x1f4fe2(0x2ca)),_0x5e8e9e=_0x488dc3?a54_0x467bd9[_0x1f4fe2(0x293)](_0x1f4fe2(0x288)):'';return _0x1f4fe2(0x29a)+_0x2291cf[_0x1f4fe2(0x34d)]+_0x5e8e9e;});await writeOutput(_0x3aec22['join']('\x0a'),_0x3b1211[_0x2ff851(0x1d3)],'list');}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x141bbb(0x34d)]=a54_0x141bbb(0x2a2);[a54_0x141bbb(0x20b)]=a54_0x141bbb(0x1c7);async[a54_0x141bbb(0x21d)](_0x20ae68){const _0x346a31=a54_0x141bbb,{options:_0x176c74,args:_0x551eb7,tdx:_0xc69fba}=_0x20ae68,_0x580d59=this[_0x346a31(0x327)](_0x551eb7,_0x176c74);_0x176c74[_0x346a31(0x2c5)]&&_0x580d59&&console[_0x346a31(0x2fc)](_0x346a31(0x28f)+_0x580d59);const _0x4a1a23=await withSpinner(_0x346a31(0x335),()=>_0xc69fba['workflow'][_0x346a31(0x31c)](_0x580d59,{'limit':_0x176c74['limit']}),{'verbose':_0x176c74[_0x346a31(0x2c5)]});let _0x531259=_0x4a1a23['data'];_0x531259[_0x346a31(0x2d7)]((_0x3f72f9,_0x387471)=>{const _0x5c7d08=_0x346a31,_0x5d05d9=_0x3f72f9[_0x5c7d08(0x34d)][_0x5c7d08(0x204)](_0x387471['name']);if(_0x5d05d9!==0x0)return _0x5d05d9;return(_0x3f72f9['project']?.['name']||'')[_0x5c7d08(0x204)](_0x387471[_0x5c7d08(0x250)]?.['name']||'');});const _0x12e464=_0x176c74['limit']||0x64,_0x400618=_0x531259[_0x346a31(0x1fa)]>=_0x12e464?a54_0x467bd9[_0x346a31(0x293)](_0x346a31(0x31a)):'';console[_0x346a31(0x2fc)](_0x346a31(0x35d)+_0x531259[_0x346a31(0x1fa)]+_0x346a31(0x234)+(_0x531259['length']!==0x1?'s':'')+_0x400618);if(_0x176c74[_0x346a31(0x244)]===_0x346a31(0x1f1)||_0x176c74['format']===_0x346a31(0x26d)||_0x176c74['format']===_0x346a31(0x331))await handleSDKOutput(_0x531259,_0x176c74);else{if(_0x531259[_0x346a31(0x1fa)]===0x0)_0x580d59?console['log'](_0x346a31(0x21a)+_0x580d59):console[_0x346a31(0x2b9)]('No\x20workflows\x20found');else{const _0xe9d31f=_0x176c74[_0x346a31(0x1f4)],_0x369e34=_0x531259[_0x346a31(0x2b6)](_0x19362e=>{const _0x4b5dfa=_0x346a31,_0x5a5ebe=a54_0x467bd9[_0x4b5dfa(0x293)]('#'+_0x19362e['id']),_0x3fcec4=hyperlink(_0x5a5ebe,getWorkflowUrl(_0xe9d31f,_0x19362e['id'])),_0x2392a4=_0x19362e[_0x4b5dfa(0x250)]?.['name']?a54_0x467bd9[_0x4b5dfa(0x293)]('\x20('+_0x19362e[_0x4b5dfa(0x250)][_0x4b5dfa(0x34d)]+')'):'';return'📋\x20'+_0x3fcec4+'\x20'+_0x19362e[_0x4b5dfa(0x34d)]+_0x2392a4;});await writeOutput(_0x369e34[_0x346a31(0x337)]('\x0a'),_0x176c74['output'],_0x346a31(0x24e));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x141bbb(0x34d)]=a54_0x141bbb(0x1d9);[a54_0x141bbb(0x20b)]=a54_0x141bbb(0x2e6);async[a54_0x141bbb(0x21d)](_0x35155b){const _0x25e21f=a54_0x141bbb,{options:_0x24b6a3,args:_0x4e78bd,tdx:_0x3e71d2}=_0x35155b,_0x1742eb=this[_0x25e21f(0x25b)](_0x4e78bd,_0x24b6a3);if(!_0x1742eb)return 0x1;const {projectName:_0xae13d2,workflowName:_0x39953f}=_0x1742eb;if(_0x24b6a3['verbose']){if(_0xae13d2&&_0x39953f)console[_0x25e21f(0x2fc)]('Filter:\x20'+_0xae13d2+'.'+_0x39953f);else _0xae13d2&&console[_0x25e21f(0x2fc)]('Filter:\x20project='+_0xae13d2);const _0x2d3e6b=_0x24b6a3[_0x25e21f(0x304)];_0x2d3e6b&&console['error']('Status:\x20'+_0x2d3e6b);}let _0x3e2579=0x28;if(process[_0x25e21f(0x324)]['isTTY']&&!_0x24b6a3['output']&&!_0x24b6a3['format']){const _0x209aba=process[_0x25e21f(0x324)][_0x25e21f(0x241)]||0x28;_0x3e2579=Math['max'](0x14,Math[_0x25e21f(0x2d0)](_0x209aba*0x2/0x3));}const _0x2b70e7=_0x24b6a3['limit']||_0x3e2579,_0x477886=await withSpinner(_0x25e21f(0x283),()=>_0x3e71d2[_0x25e21f(0x22f)]['sessions']({'projectName':_0xae13d2,'workflowName':_0x39953f,'status':_0x24b6a3[_0x25e21f(0x304)],'fromTime':_0x24b6a3['from'],'toTime':_0x24b6a3['to'],'limit':_0x2b70e7}),{'verbose':_0x24b6a3[_0x25e21f(0x2c5)]}),_0x1237e4=_0x477886[_0x25e21f(0x227)];_0x1237e4[_0x25e21f(0x2d7)]((_0x12728c,_0x5eafd3)=>{const _0x221959=_0x25e21f,_0x2d4cb1=_0x12728c['sessionTime']||'',_0x562f0f=_0x5eafd3[_0x221959(0x321)]||'';return _0x562f0f['localeCompare'](_0x2d4cb1);});_0x1237e4[_0x25e21f(0x1fa)]>=_0x2b70e7?console[_0x25e21f(0x2fc)](_0x25e21f(0x367)+_0x1237e4['length']+'\x20sessions\x20'+a54_0x467bd9['dim']('(use\x20--limit\x20to\x20see\x20more)')):console[_0x25e21f(0x2fc)](_0x25e21f(0x35d)+_0x1237e4[_0x25e21f(0x1fa)]+'\x20session'+(_0x1237e4[_0x25e21f(0x1fa)]!==0x1?'s':''));if(_0x24b6a3[_0x25e21f(0x244)]===_0x25e21f(0x1f1)||_0x24b6a3['format']===_0x25e21f(0x26d)||_0x24b6a3[_0x25e21f(0x244)]===_0x25e21f(0x331))await handleSDKOutput(_0x1237e4,_0x24b6a3);else{if(!process[_0x25e21f(0x324)][_0x25e21f(0x1ad)]||_0x24b6a3['output']){if(_0x1237e4[_0x25e21f(0x1fa)]===0x0){if(_0xae13d2&&_0x39953f)console[_0x25e21f(0x2b9)](_0x25e21f(0x349)+_0xae13d2+'.'+_0x39953f);else _0xae13d2?console[_0x25e21f(0x2b9)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0xae13d2):console[_0x25e21f(0x2b9)](_0x25e21f(0x1c0));}else{const _0x2cf062=_0x24b6a3[_0x25e21f(0x1f4)],_0x172cde=this[_0x25e21f(0x2e4)](_0x1237e4,_0x2cf062);_0x24b6a3[_0x25e21f(0x1d3)]?await writeOutput(_0x172cde,_0x24b6a3[_0x25e21f(0x1d3)],_0x25e21f(0x24e)):console[_0x25e21f(0x2b9)](_0x172cde);}!_0xae13d2&&(console['error'](''),console[_0x25e21f(0x2fc)](a54_0x467bd9[_0x25e21f(0x293)](_0x25e21f(0x2e7))),console['error'](a54_0x467bd9[_0x25e21f(0x293)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a54_0x467bd9[_0x25e21f(0x293)](_0x25e21f(0x2a0))));}else{if(_0x1237e4[_0x25e21f(0x1fa)]===0x0){if(_0xae13d2&&_0x39953f)console[_0x25e21f(0x2b9)](_0x25e21f(0x349)+_0xae13d2+'.'+_0x39953f);else _0xae13d2?console[_0x25e21f(0x2b9)](_0x25e21f(0x235)+_0xae13d2):console[_0x25e21f(0x2b9)]('No\x20sessions\x20found');}else await this[_0x25e21f(0x273)](_0x1237e4,_0x35155b,_0xae13d2);}}return 0x0;}[a54_0x141bbb(0x2e4)](_0x2110f6,_0x3989f7){const _0x4e75f0=a54_0x141bbb,_0x1e838a=[],_0x3c9712=new Map();let _0x1c38f3=Infinity,_0x8fa22a=-Infinity;for(const _0x1cfd53 of _0x2110f6){if(_0x1cfd53[_0x4e75f0(0x313)]?.[_0x4e75f0(0x36f)]){const _0xf5fda4=new Date(_0x1cfd53['lastAttempt'][_0x4e75f0(0x36f)])[_0x4e75f0(0x2f4)](),_0x2a6778=_0x1cfd53[_0x4e75f0(0x313)][_0x4e75f0(0x2a7)]?new Date(_0x1cfd53[_0x4e75f0(0x313)][_0x4e75f0(0x2a7)])[_0x4e75f0(0x2f4)]():Date[_0x4e75f0(0x2b2)](),_0x55461e=_0x1cfd53[_0x4e75f0(0x250)]?.['name']||'(unknown)';!_0x3c9712[_0x4e75f0(0x29e)](_0x55461e)&&_0x3c9712[_0x4e75f0(0x1dc)](_0x55461e,[]),_0x3c9712[_0x4e75f0(0x34a)](_0x55461e)[_0x4e75f0(0x1be)]({'session':_0x1cfd53,'startTime':_0xf5fda4,'endTime':_0x2a6778,'duration':_0x2a6778-_0xf5fda4}),_0x1c38f3=Math[_0x4e75f0(0x301)](_0x1c38f3,_0xf5fda4),_0x8fa22a=Math[_0x4e75f0(0x36c)](_0x8fa22a,_0x2a6778);}}if(_0x3c9712[_0x4e75f0(0x1ea)]===0x0)return _0x4e75f0(0x1b9);const _0x46d91a=process['stdout'][_0x4e75f0(0x1cc)]||0x78,_0x45a46a=0x1e,_0x40a338=0x32,_0x1186a0=0x4,_0xf63f18=Math[_0x4e75f0(0x301)](_0x40a338,Math[_0x4e75f0(0x36c)](_0x45a46a,Math[_0x4e75f0(0x2d0)](_0x46d91a*0.3))),_0x5ee41e=_0x46d91a-_0xf63f18-TIMELINE_CONFIG[_0x4e75f0(0x340)]-0x3-_0x1186a0,_0x3d118f=_0x8fa22a-_0x1c38f3,_0xee498b=_0x3d118f/_0xf63f18,_0x327221=renderTimeAxis({'startTime':_0x1c38f3,'endTime':_0x8fa22a,'durationMs':_0x3d118f,'msPerChar':_0xee498b},_0xf63f18),_0x39c057=[];for(const _0x10d0bf of _0x3c9712[_0x4e75f0(0x229)]()){_0x39c057[_0x4e75f0(0x1be)](..._0x10d0bf);}_0x39c057[_0x4e75f0(0x2d7)]((_0x360a91,_0x34c9b7)=>_0x34c9b7[_0x4e75f0(0x254)]-_0x360a91[_0x4e75f0(0x254)]);const _0x1ad29b=new Date(_0x1c38f3),_0x5c3962=formatDate(_0x1ad29b),_0x149ff4=_0x1186a0+TIMELINE_CONFIG[_0x4e75f0(0x343)]+TIMELINE_CONFIG[_0x4e75f0(0x1ce)]+_0x5ee41e,_0x3cacb2='\x20'[_0x4e75f0(0x22c)](_0x149ff4-_0x5c3962[_0x4e75f0(0x1fa)]),_0x340380=_0x3cacb2+a54_0x467bd9[_0x4e75f0(0x293)](_0x5c3962)+'\x20'+_0x327221;_0x1e838a['push'](_0x340380);const _0xe2ad09=0x16;let _0x49da33=0x0;for(const _0x330a6a of _0x39c057){const _0x3a6d97=_0x330a6a[_0x4e75f0(0x34f)][_0x4e75f0(0x250)]?.[_0x4e75f0(0x34d)]||'?',_0x1df153=Math[_0x4e75f0(0x301)](stringWidth(_0x3a6d97),_0xe2ad09);_0x49da33=Math[_0x4e75f0(0x36c)](_0x49da33,_0x1df153);}for(const _0x26cf1d of _0x39c057){const {session:_0x1e0554,startTime:_0x5a25bd,endTime:_0x26d26b,duration:_0x226122}=_0x26cf1d,_0x2ce0e9=_0x1e0554['project']?.['id'],_0x3e5b63=_0x1e0554['id'],_0x490fe7=_0x1e0554[_0x4e75f0(0x250)]?.[_0x4e75f0(0x34d)]||'?',_0x4c6e35=_0x1e0554[_0x4e75f0(0x22f)]?.['name']||'?';let _0x321c19,_0x45baf5;if(_0x1e0554['lastAttempt']){const _0x27b9db=_0x1e0554[_0x4e75f0(0x313)];!_0x27b9db[_0x4e75f0(0x22e)]?(_0x321c19=_0x27b9db['cancelRequested']?'🛑':'🔄',_0x45baf5=_0x27b9db[_0x4e75f0(0x27b)]?a54_0x467bd9[_0x4e75f0(0x371)]:a54_0x467bd9['blue']):(_0x321c19=_0x27b9db[_0x4e75f0(0x346)]?'✅':'❌',_0x45baf5=_0x27b9db['success']?a54_0x467bd9[_0x4e75f0(0x20d)]:a54_0x467bd9['red']);}else _0x321c19='⏳',_0x45baf5=a54_0x467bd9['dim'];const _0x51a8d9='#'+_0x3e5b63,_0x5f5405=_0x2ce0e9?hyperlink(_0x51a8d9,getWorkflowSessionUrl(_0x3989f7,_0x2ce0e9,_0x3e5b63)):_0x51a8d9;let _0x5762fd=_0x490fe7;stringWidth(_0x490fe7)>_0xe2ad09&&(_0x5762fd=_0x490fe7[_0x4e75f0(0x338)](0x0,_0xe2ad09-0x1)+'…');const _0x27d97d=a54_0x467bd9[_0x4e75f0(0x293)](_0x5762fd),_0x13cc85=stringWidth(_0x5762fd),_0x2180c1='\x20'[_0x4e75f0(0x22c)](_0x49da33-stringWidth(_0x5762fd)+0x2),_0x9fbbdc='('+formatElapsed(_0x226122)+')',_0x35f1c8=stringWidth(_0x9fbbdc),_0x2f21d1=stringWidth(_0x51a8d9),_0x529b37=_0x2f21d1+0x1+_0x13cc85+_0x2180c1[_0x4e75f0(0x1fa)],_0x27fff7=_0x5ee41e-_0x529b37-_0x35f1c8-0x1-0x8;let _0xf1b35e=_0x4c6e35;stringWidth(_0xf1b35e)>_0x27fff7&&(_0xf1b35e=_0xf1b35e[_0x4e75f0(0x338)](0x0,_0x27fff7-0x1)+'…');const _0x9d36d6=_0x5f5405+'\x20'+_0x27d97d+_0x2180c1+_0xf1b35e,_0x30f385=stringWidth(_0x9d36d6),_0x194afc=_0x5ee41e-_0x30f385-_0x35f1c8,_0x23a3e1=_0x9d36d6+'\x20'[_0x4e75f0(0x22c)](Math[_0x4e75f0(0x36c)](0x1,_0x194afc))+a54_0x467bd9['dim'](_0x9fbbdc),_0x425c68=Math['floor']((_0x5a25bd-_0x1c38f3)/_0xee498b),_0x1fff8b=Math[_0x4e75f0(0x2d0)]((_0x26d26b-_0x1c38f3)/_0xee498b),_0x5b2dde=Math[_0x4e75f0(0x36c)](_0x425c68+0x1,_0x1fff8b),_0x188df9=new Array(_0xf63f18)[_0x4e75f0(0x248)]('\x20');for(let _0x1bfa9a=_0x425c68;_0x1bfa9a<Math[_0x4e75f0(0x301)](_0x5b2dde,_0xf63f18);_0x1bfa9a++){_0x188df9[_0x1bfa9a]='─';}const _0x58d18b=_0x188df9['map'](_0x34d6fc=>_0x34d6fc==='\x20'?'\x20':_0x45baf5(_0x34d6fc))[_0x4e75f0(0x337)]('');_0x1e838a[_0x4e75f0(0x1be)](_0x321c19+'\x20'+_0x23a3e1+'│'+_0x58d18b+'│');}return _0x1e838a[_0x4e75f0(0x337)]('\x0a');}async['navigateSessionsInteractive'](_0x5abd3f,_0x24961a,_0x15431a){const _0x36ca73=a54_0x141bbb,{options:_0x426b36,tdx:_0x228903}=_0x24961a,_0x5ba464=_0x426b36['site'],{timelineRows:_0x52ef38,timeAxisHeader:_0x498edc}=this[_0x36ca73(0x322)](_0x5abd3f,_0x5ba464),_0x3c33f9=_0x52ef38[_0x36ca73(0x1fe)](_0x36f924=>_0x36f924[_0x36ca73(0x2f0)]);if(_0x3c33f9[_0x36ca73(0x1fa)]===0x0){const _0x24d19f=this[_0x36ca73(0x2e4)](_0x5abd3f,_0x5ba464);console[_0x36ca73(0x2b9)](_0x24d19f);!_0x15431a&&(console[_0x36ca73(0x2fc)](''),console['error'](a54_0x467bd9[_0x36ca73(0x293)](_0x36ca73(0x2e7))),console['error'](a54_0x467bd9['dim']('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a54_0x467bd9['dim'](_0x36ca73(0x2a0))));return;}_0x498edc&&console[_0x36ca73(0x2b9)](_0x498edc);const _0x4cfaca=_0x52ef38[_0x36ca73(0x1fe)](_0x22e045=>_0x22e045[_0x36ca73(0x2f0)])['map'](_0x17fe54=>({'title':_0x17fe54[_0x36ca73(0x2f6)],'value':_0x17fe54[_0x36ca73(0x2f0)]})),_0x2669a0=process[_0x36ca73(0x324)]['rows']||0x3c,_0x4c14e1=Math[_0x36ca73(0x36c)](0x28,Math[_0x36ca73(0x2d0)](_0x2669a0*0x2/0x3)),_0x106a9f=await a54_0x20ee9d({'type':_0x36ca73(0x23a),'name':'attemptId','message':_0x36ca73(0x29f),'choices':_0x4cfaca,'initial':-0x1,'limit':_0x4c14e1,'clearFirst':!![],'fallback':{'title':_0x36ca73(0x2c3),'value':null},'suggest':(_0x30280a,_0x395c22)=>{const _0x2d1e90=_0x36ca73;if(!_0x30280a)return Promise[_0x2d1e90(0x34b)](_0x395c22);const _0x2d2413=_0x395c22[_0x2d1e90(0x1fe)](_0x1e1ca2=>{const _0x4a8300=_0x2d1e90,_0xf51107=_0x1e1ca2;return _0xf51107[_0x4a8300(0x212)][_0x4a8300(0x2f8)]()[_0x4a8300(0x238)](_0x30280a[_0x4a8300(0x2f8)]());});return Promise['resolve'](_0x2d2413);}}),_0x3d37c1=()=>{const _0x56ef9b=_0x36ca73;process[_0x56ef9b(0x324)][_0x56ef9b(0x1ee)](_0x56ef9b(0x266)),process[_0x56ef9b(0x324)][_0x56ef9b(0x1ee)]('\x1b[1A\x1b[2K'),process[_0x56ef9b(0x324)][_0x56ef9b(0x1ee)]('\x1b[1A\x1b[2K');},_0x1eeb11=_0x106a9f&&_0x106a9f[_0x36ca73(0x2f0)]&&_0x106a9f[_0x36ca73(0x2f0)]!==null&&_0x106a9f[_0x36ca73(0x2f0)][_0x36ca73(0x1ca)]()!=='';if(!_0x1eeb11){_0x3d37c1(),console['log'](a54_0x467bd9[_0x36ca73(0x293)](_0x36ca73(0x362)));return;}_0x3d37c1();const _0x2e7ff8=_0x5abd3f[_0x36ca73(0x1ab)](_0x22e917=>_0x22e917['lastAttempt']?.['id']===_0x106a9f[_0x36ca73(0x2f0)]);if(_0x2e7ff8){const _0x369462=_0x2e7ff8[_0x36ca73(0x250)]?.[_0x36ca73(0x34d)]||'?',_0x4bf493=_0x2e7ff8['workflow']?.[_0x36ca73(0x34d)]||'?';console[_0x36ca73(0x2b9)]('Project:\x20'+a54_0x467bd9[_0x36ca73(0x293)](_0x369462)+_0x36ca73(0x378)+a54_0x467bd9[_0x36ca73(0x293)](_0x4bf493));}const _0x5e7cc2=new WorkflowTimelineCommand();await _0x5e7cc2[_0x36ca73(0x21d)]({'args':[],'options':{..._0x426b36,'attemptId':_0x106a9f['attemptId']},'tdx':_0x228903});}[a54_0x141bbb(0x322)](_0x148a36,_0x3e321e){const _0x25e5dc=a54_0x141bbb,_0x354e8d=new Map();for(const _0x5f0cbc of _0x148a36){_0x5f0cbc['id']&&_0x5f0cbc['lastAttempt']?.['id']&&_0x354e8d[_0x25e5dc(0x1dc)](_0x5f0cbc['id'],_0x5f0cbc[_0x25e5dc(0x313)]['id']);}const _0x1a3113=[];let _0x52da37='';const _0x5d0cd1=this[_0x25e5dc(0x2e4)](_0x148a36,_0x3e321e),_0x29664a=_0x5d0cd1['split']('\x0a');for(const _0x2f0911 of _0x29664a){if(_0x2f0911[_0x25e5dc(0x33d)](_0x25e5dc(0x2db))||_0x2f0911[_0x25e5dc(0x27d)](/^\s+\d{4}-\d{2}-\d{2}/))_0x52da37=_0x2f0911;else{if(_0x2f0911[_0x25e5dc(0x27d)](/^[✅❌🔄🛑⏳]/)){const _0x14243f=_0x2f0911[_0x25e5dc(0x27d)](/#(\d+)/),_0x4950f6=_0x14243f?_0x14243f[0x1]:null,_0xfeeaf5=_0x4950f6?_0x354e8d[_0x25e5dc(0x34a)](_0x4950f6)||null:null,_0x151686=_0x148a36[_0x25e5dc(0x1ab)](_0x3179ba=>_0x3179ba['id']===_0x4950f6),_0x2718bf=_0x151686?.['project']?.['name']||'';_0x1a3113[_0x25e5dc(0x1be)]({'displayLine':_0x2f0911,'attemptId':_0xfeeaf5,'projectName':_0x2718bf});}}}return{'timelineRows':_0x1a3113,'timeAxisHeader':_0x52da37};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0x141bbb(0x34d)]=a54_0x141bbb(0x28d);[a54_0x141bbb(0x20b)]=a54_0x141bbb(0x2b1);async[a54_0x141bbb(0x21d)](_0x3dcb02){const _0x54c10b=a54_0x141bbb,{options:_0x267250,args:_0x58c12f,tdx:_0x478d9c}=_0x3dcb02,_0x301668=this[_0x54c10b(0x25b)](_0x58c12f,_0x267250);if(!_0x301668)return 0x1;const {projectName:_0x1c0c04,workflowName:_0x2b35ca}=_0x301668,_0x4438dd=_0x267250[_0x54c10b(0x21f)];if(_0x267250['verbose']){if(_0x1c0c04&&_0x2b35ca)console[_0x54c10b(0x2fc)](_0x54c10b(0x25f)+_0x1c0c04+'.'+_0x2b35ca);else _0x1c0c04&&console[_0x54c10b(0x2fc)]('Filter:\x20project='+_0x1c0c04);_0x4438dd&&console[_0x54c10b(0x2fc)](_0x54c10b(0x208));}const _0x3ce52b=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x478d9c[_0x54c10b(0x22f)][_0x54c10b(0x2b4)]({'projectName':_0x1c0c04,'workflowName':_0x2b35ca,'includeRetried':_0x4438dd,'limit':_0x267250['limit']}),{'verbose':_0x267250[_0x54c10b(0x2c5)]}),_0x565119=_0x3ce52b[_0x54c10b(0x227)],_0x2d9f42=_0x267250['limit']||0x64,_0x293268=_0x565119[_0x54c10b(0x1fa)]>=_0x2d9f42?a54_0x467bd9[_0x54c10b(0x293)](_0x54c10b(0x31a)):'';console['error'](_0x54c10b(0x35d)+_0x565119[_0x54c10b(0x1fa)]+_0x54c10b(0x222)+(_0x565119[_0x54c10b(0x1fa)]!==0x1?'s':'')+_0x293268);if(_0x267250[_0x54c10b(0x244)]===_0x54c10b(0x1f1)||_0x267250[_0x54c10b(0x244)]===_0x54c10b(0x26d)||_0x267250['format']==='table')await handleSDKOutput(_0x565119,_0x267250);else{if(_0x565119[_0x54c10b(0x1fa)]===0x0){if(_0x1c0c04&&_0x2b35ca)console['log'](_0x54c10b(0x224)+_0x1c0c04+'.'+_0x2b35ca);else _0x1c0c04?console['log'](_0x54c10b(0x30c)+_0x1c0c04):console['log'](_0x54c10b(0x2a9));}else{const _0x3dd650=_0x267250[_0x54c10b(0x1f4)],_0x55bce7=_0x565119['map'](_0x1c557c=>{const _0x345912=_0x54c10b,_0xe8ee2a=a54_0x467bd9[_0x345912(0x293)]('#'+_0x1c557c['id']),_0x3b1832=_0x1c557c[_0x345912(0x250)]?.['id'],_0x214015=_0x1c557c[_0x345912(0x1f3)]||_0x1c557c[_0x345912(0x223)],_0x133a6d=_0x3b1832&&_0x214015?hyperlink(_0xe8ee2a,getWorkflowAttemptUrl(_0x3dd650,_0x3b1832,_0x214015,_0x1c557c['id'])):_0xe8ee2a,{icon:_0x24db55,text:_0x395edd}=getAttemptStatusDisplay(_0x1c557c),_0x10aa5a=(_0x1c557c[_0x345912(0x250)]?.[_0x345912(0x34d)]||'?')+'.'+(_0x1c557c[_0x345912(0x22f)]?.[_0x345912(0x34d)]||'?'),_0x3859bb=_0x1c557c['sessionTime']?a54_0x467bd9['dim'](_0x1c557c[_0x345912(0x321)]):'';return(_0x133a6d+'\x20'+_0x24db55+(_0x395edd?'\x20'+_0x395edd:'')+'\x20'+_0x10aa5a+'\x20'+_0x3859bb)['trimEnd']();});await writeOutput(_0x55bce7[_0x54c10b(0x337)]('\x0a'),_0x267250[_0x54c10b(0x1d3)],_0x54c10b(0x24e));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x141bbb(0x34d)]='workflow:attempt';[a54_0x141bbb(0x20b)]='Show\x20specific\x20attempt\x20details';async['execute'](_0x3902a0){const _0x7df58c=a54_0x141bbb,{options:_0x1b5d0e,args:_0x50dc9b,tdx:_0x27cfcb}=_0x3902a0,_0x5eb47e=_0x50dc9b[0x0];if(!_0x5eb47e)return console[_0x7df58c(0x2fc)](_0x7df58c(0x23f)),0x1;_0x1b5d0e[_0x7df58c(0x2c5)]&&console[_0x7df58c(0x2fc)]('Attempt\x20ID:\x20'+_0x5eb47e);const _0x58c21a=await withSpinner(_0x7df58c(0x297),()=>_0x27cfcb[_0x7df58c(0x22f)][_0x7df58c(0x366)](_0x5eb47e),{'verbose':_0x1b5d0e[_0x7df58c(0x2c5)]}),_0x57120f=_0x58c21a[_0x7df58c(0x227)];let _0x8bdda5;!_0x57120f['done']?_0x8bdda5=_0x57120f[_0x7df58c(0x27b)]?_0x7df58c(0x1de):_0x7df58c(0x295):_0x8bdda5=_0x57120f['success']?_0x7df58c(0x346):_0x7df58c(0x2fc);let _0x4cde1f;if(_0x57120f[_0x7df58c(0x36f)]&&_0x57120f[_0x7df58c(0x2a7)]){const _0x368653=new Date(_0x57120f[_0x7df58c(0x36f)])[_0x7df58c(0x2f4)](),_0x1d41f1=new Date(_0x57120f['finishedAt'])['getTime']();_0x4cde1f=Math[_0x7df58c(0x26e)]((_0x1d41f1-_0x368653)/0x3e8);}const _0x3e7f73={'attempt_id':_0x57120f['id'],'status':_0x8bdda5,..._0x57120f[_0x7df58c(0x251)]!==undefined&&{'index':_0x57120f[_0x7df58c(0x251)]},..._0x57120f['project']&&{'project':_0x57120f[_0x7df58c(0x250)][_0x7df58c(0x34d)]},..._0x57120f[_0x7df58c(0x22f)]&&{'workflow':_0x57120f[_0x7df58c(0x22f)][_0x7df58c(0x34d)]},..._0x57120f['sessionId']&&{'session_id':_0x57120f[_0x7df58c(0x223)]},..._0x57120f[_0x7df58c(0x321)]&&{'session_time':_0x57120f[_0x7df58c(0x321)]},..._0x57120f[_0x7df58c(0x350)]&&{'retry_attempt':_0x57120f['retryAttemptName']},..._0x4cde1f!==undefined&&{'duration_sec':_0x4cde1f},..._0x57120f[_0x7df58c(0x36f)]&&{'created_at':_0x57120f[_0x7df58c(0x36f)]},..._0x57120f[_0x7df58c(0x2a7)]&&{'finished_at':_0x57120f[_0x7df58c(0x2a7)]},...Object[_0x7df58c(0x1e4)](_0x57120f[_0x7df58c(0x2cc)])[_0x7df58c(0x1fa)]>0x0&&{'params':_0x57120f[_0x7df58c(0x2cc)]}};return await handleSingleObjectOutput(_0x3e7f73,_0x1b5d0e),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a54_0x141bbb(0x226);[a54_0x141bbb(0x20b)]=a54_0x141bbb(0x1c2);async[a54_0x141bbb(0x21d)](_0x271732){const _0x44a286=a54_0x141bbb,{options:_0x376c4c,args:_0x407e16,tdx:_0x3f55f9}=_0x271732,_0x38fd25=_0x407e16[0x0];if(!_0x38fd25)return console[_0x44a286(0x2fc)](_0x44a286(0x23f)),0x1;const _0x251eaf=_0x376c4c['includeSubtasks'];_0x376c4c[_0x44a286(0x2c5)]&&(console[_0x44a286(0x2fc)]('Attempt\x20ID:\x20'+_0x38fd25),_0x251eaf&&console[_0x44a286(0x2fc)](_0x44a286(0x1d1)));const _0x24e912=await withSpinner(_0x44a286(0x2c0),()=>_0x3f55f9[_0x44a286(0x22f)]['tasks'](_0x38fd25,_0x251eaf||![]),{'verbose':_0x376c4c[_0x44a286(0x2c5)]}),_0x406a6c=_0x24e912[_0x44a286(0x227)];return console[_0x44a286(0x2fc)](_0x44a286(0x35d)+_0x406a6c[_0x44a286(0x1fa)]+_0x44a286(0x34c)+(_0x406a6c[_0x44a286(0x1fa)]!==0x1?'s':'')),await handleSDKOutput(_0x406a6c,_0x376c4c),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0x141bbb(0x34d)]='workflow:logs';[a54_0x141bbb(0x20b)]=a54_0x141bbb(0x2a5);async[a54_0x141bbb(0x21d)](_0x58d5e8){const _0x27cfee=a54_0x141bbb,{options:_0x3a8544,args:_0x30aa7d,tdx:_0x2a1ca1}=_0x58d5e8,_0x3ddee2=_0x30aa7d[0x0];let _0x58aa85=_0x30aa7d[0x1];if(!_0x3ddee2)return console[_0x27cfee(0x2fc)](_0x27cfee(0x23f)),0x1;_0x3a8544[_0x27cfee(0x2c5)]&&(console[_0x27cfee(0x2fc)](_0x27cfee(0x2b7)+_0x3ddee2),_0x58aa85&&console[_0x27cfee(0x2fc)]('Task\x20name:\x20'+_0x58aa85));const _0x451afa=await withSpinner(_0x27cfee(0x243),()=>_0x2a1ca1[_0x27cfee(0x22f)][_0x27cfee(0x1e1)](_0x3ddee2,_0x58aa85),{'verbose':_0x3a8544[_0x27cfee(0x2c5)]}),_0xf21edf=_0x451afa[_0x27cfee(0x227)];if(_0xf21edf[_0x27cfee(0x1fa)]===0x0)return console[_0x27cfee(0x2fc)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x58aa85&&(_0x3a8544['json']||_0x3a8544[_0x27cfee(0x244)]))return await handleSDKOutput(_0xf21edf,_0x3a8544),0x0;if(!_0x58aa85){const _0x395fb2=_0xf21edf[_0x27cfee(0x2b6)](_0x13aa5d=>({'title':_0x13aa5d[_0x27cfee(0x1dd)]+'\x20('+formatBytes(_0x13aa5d[_0x27cfee(0x29c)])+')','value':_0x13aa5d[_0x27cfee(0x1dd)]})),_0x1b5383=await a54_0x20ee9d({'type':_0x27cfee(0x1f6),'name':_0x27cfee(0x354),'message':_0x27cfee(0x249),'choices':_0x395fb2});if(!_0x1b5383['task'])return console['error'](_0x27cfee(0x362)),0x0;_0x58aa85=_0x1b5383[_0x27cfee(0x354)];}const _0xbd960b=await withSpinner(_0x27cfee(0x1ec),()=>_0x2a1ca1[_0x27cfee(0x22f)][_0x27cfee(0x2a8)](_0x3ddee2,_0x58aa85),{'verbose':_0x3a8544[_0x27cfee(0x2c5)]}),_0x23f0cf=_0xbd960b['data'];return _0x23f0cf?console[_0x27cfee(0x2b9)](_0x23f0cf):console[_0x27cfee(0x2fc)](_0x27cfee(0x347)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0x141bbb(0x34d)]=a54_0x141bbb(0x2ce);[a54_0x141bbb(0x20b)]='Kill\x20a\x20running\x20attempt';async[a54_0x141bbb(0x21d)](_0x44d3ba){const _0x5079cd=a54_0x141bbb,{options:_0x2cd4cc,args:_0x2f424f,tdx:_0x16d7f9}=_0x44d3ba,_0x58ecc1=_0x2f424f[0x0];if(!_0x58ecc1)return console[_0x5079cd(0x2fc)](_0x5079cd(0x23f)),0x1;const _0xdc1688=_0x2cd4cc['reason'];_0x2cd4cc[_0x5079cd(0x2c5)]&&(console['error']('Attempt\x20ID:\x20'+_0x58ecc1),_0xdc1688&&console[_0x5079cd(0x2fc)](_0x5079cd(0x291)+_0xdc1688));if(!_0x2cd4cc['yes']){if(!isInteractive())return console[_0x5079cd(0x2fc)](a54_0x467bd9['red'](_0x5079cd(0x317)),_0x5079cd(0x275)),console[_0x5079cd(0x2fc)](a54_0x467bd9[_0x5079cd(0x293)](_0x5079cd(0x1af))),0x1;const _0x573dea=await confirmKey(_0x5079cd(0x299)+_0x58ecc1+'?');if(!_0x573dea)return console['error'](a54_0x467bd9[_0x5079cd(0x371)](_0x5079cd(0x362))),0x1;}const _0x5a97a6=await withSpinner(_0x5079cd(0x30b),()=>_0x16d7f9[_0x5079cd(0x22f)][_0x5079cd(0x311)](_0x58ecc1,_0xdc1688),{'verbose':_0x2cd4cc[_0x5079cd(0x2c5)]}),_0x552393=_0x5a97a6['data'];return console[_0x5079cd(0x2fc)]('✔\x20'+_0x552393),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x141bbb(0x34d)]=a54_0x141bbb(0x372);[a54_0x141bbb(0x20b)]=a54_0x141bbb(0x2fe);async[a54_0x141bbb(0x21d)](_0x124e9d){const _0x5a320b=a54_0x141bbb,{options:_0x500a5c,args:_0x361a09,tdx:_0x367109}=_0x124e9d,_0x1f7de6=_0x361a09[0x0];if(!_0x1f7de6)return console['error']('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x5a320b(0x2fc)](_0x5a320b(0x246)),0x1;let _0x4bee22=![],_0x1d52d3=_0x1f7de6;if(_0x1f7de6[_0x5a320b(0x33d)](_0x5a320b(0x360)))_0x4bee22=!![],_0x1d52d3=_0x1f7de6['substring'](0x8);else{if(_0x1f7de6[_0x5a320b(0x33d)]('attempt:'))_0x4bee22=![],_0x1d52d3=_0x1f7de6[_0x5a320b(0x1ff)](0x8);else return console[_0x5a320b(0x2fc)](_0x5a320b(0x22b)),console['error'](_0x5a320b(0x246)),0x1;}const _0x4a59c6=_0x500a5c[_0x5a320b(0x1c8)],_0x88808=_0x500a5c[_0x5a320b(0x33b)],_0x5eb745=_0x500a5c[_0x5a320b(0x2cc)],_0x19fef5=_0x500a5c[_0x5a320b(0x289)];_0x500a5c[_0x5a320b(0x2c5)]&&(console[_0x5a320b(0x2fc)](_0x5a320b(0x209)+(_0x4bee22?_0x5a320b(0x34f):'attempt')+'\x20'+_0x1d52d3),_0x4a59c6&&console[_0x5a320b(0x2fc)](_0x5a320b(0x218)+_0x4a59c6),_0x88808&&console[_0x5a320b(0x2fc)](_0x5a320b(0x28e)+_0x88808),_0x5eb745&&console[_0x5a320b(0x2fc)](_0x5a320b(0x274)+_0x5eb745),_0x19fef5&&console[_0x5a320b(0x2fc)](_0x5a320b(0x2e9)));let _0x203372;if(_0x5eb745)try{if(_0x5eb745[_0x5a320b(0x33d)]('@')){const _0x406bcf=await import(_0x5a320b(0x231)),_0x56a369=_0x5eb745[_0x5a320b(0x1ff)](0x1),_0x2d0666=await _0x406bcf['readFile'](_0x56a369,_0x5a320b(0x320));_0x203372=JSON[_0x5a320b(0x281)](_0x2d0666);}else _0x203372=JSON[_0x5a320b(0x281)](_0x5eb745);}catch{return console[_0x5a320b(0x2fc)](_0x5a320b(0x287)),0x1;}if(!_0x500a5c[_0x5a320b(0x269)]){if(!isInteractive())return console[_0x5a320b(0x2fc)](a54_0x467bd9[_0x5a320b(0x2ac)](_0x5a320b(0x317)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a54_0x467bd9[_0x5a320b(0x293)](_0x5a320b(0x1af))),0x1;const _0x107707=await confirmKey(_0x5a320b(0x2c8)+(_0x4bee22?_0x5a320b(0x34f):'attempt')+'\x20'+_0x1d52d3+'?');if(!_0x107707)return console[_0x5a320b(0x2fc)](a54_0x467bd9['yellow'](_0x5a320b(0x362))),0x1;}let _0x339c4f;_0x4bee22?_0x339c4f=await withSpinner(_0x5a320b(0x292),()=>_0x367109[_0x5a320b(0x22f)]['retrySession'](_0x1d52d3,{'fromTask':_0x4a59c6,'retryParams':_0x203372}),{'verbose':_0x500a5c['verbose']}):_0x339c4f=await withSpinner(_0x5a320b(0x28b),()=>_0x367109[_0x5a320b(0x22f)][_0x5a320b(0x2be)](_0x1d52d3,{'resumeFrom':_0x88808,'retryParams':_0x203372,'force':_0x19fef5}),{'verbose':_0x500a5c[_0x5a320b(0x2c5)]});const _0x34a031=_0x339c4f[_0x5a320b(0x227)];return console[_0x5a320b(0x2fc)]('✔\x20Retry\x20started'),console['error']('\x20\x20New\x20attempt\x20ID:\x20'+_0x34a031[_0x5a320b(0x2f0)]),console[_0x5a320b(0x2fc)]('\x20\x20Session\x20ID:\x20'+_0x34a031[_0x5a320b(0x223)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x141bbb(0x34d)]=a54_0x141bbb(0x1bb);[a54_0x141bbb(0x20b)]=a54_0x141bbb(0x302);async[a54_0x141bbb(0x21d)](_0x12d938){const _0x2ff7be=a54_0x141bbb,{options:_0x5419f0,args:_0x4f86e5,tdx:_0x2eef71}=_0x12d938;let _0x4a605c=_0x4f86e5[0x0];if(!_0x4a605c){const _0x27d620=this[_0x2ff7be(0x327)]([],_0x5419f0),_0x3cb002=await withSpinner('Loading\x20workflows...',()=>_0x2eef71[_0x2ff7be(0x22f)][_0x2ff7be(0x31c)](_0x27d620,{'limit':_0x5419f0['limit']}),{'verbose':_0x5419f0[_0x2ff7be(0x2c5)]}),_0x4de4c6=_0x3cb002[_0x2ff7be(0x227)];if(_0x4de4c6[_0x2ff7be(0x1fa)]===0x0)return console['error'](_0x2ff7be(0x25c)),!_0x27d620&&console[_0x2ff7be(0x2fc)](a54_0x467bd9['dim'](_0x2ff7be(0x2cd))),0x1;const _0x463163=_0x4de4c6[_0x2ff7be(0x2b6)](_0x3ed53f=>({'title':_0x3ed53f[_0x2ff7be(0x250)]?.['name']+'.'+_0x3ed53f[_0x2ff7be(0x34d)],'value':_0x3ed53f[_0x2ff7be(0x250)]?.[_0x2ff7be(0x34d)]+'.'+_0x3ed53f['name'],'description':_0x3ed53f['revision']?_0x2ff7be(0x1b6)+_0x3ed53f[_0x2ff7be(0x2cb)]:undefined})),_0x5c1fa1=await a54_0x20ee9d({'type':_0x2ff7be(0x1f6),'name':_0x2ff7be(0x22f),'message':_0x2ff7be(0x1c4),'choices':_0x463163});if(!_0x5c1fa1[_0x2ff7be(0x22f)])return 0x1;_0x4a605c=_0x5c1fa1[_0x2ff7be(0x22f)];}if(!_0x4a605c[_0x2ff7be(0x238)]('.')){const _0x185078=this[_0x2ff7be(0x327)]([],_0x5419f0);if(_0x185078)_0x4a605c=_0x185078+'.'+_0x4a605c;else return console[_0x2ff7be(0x2fc)](a54_0x467bd9[_0x2ff7be(0x2ac)]('Error:'),_0x2ff7be(0x267)),console[_0x2ff7be(0x2fc)](a54_0x467bd9[_0x2ff7be(0x293)](_0x2ff7be(0x2cd))),0x1;}const _0x268c46=_0x5419f0[_0x2ff7be(0x361)],_0x26e4ca=_0x5419f0[_0x2ff7be(0x321)],_0x1018f2={};if(_0x268c46&&Array[_0x2ff7be(0x359)](_0x268c46))for(const _0x3d190f of _0x268c46){const _0x43bf1a=_0x3d190f[_0x2ff7be(0x30d)]('=');if(_0x43bf1a===-0x1)return console[_0x2ff7be(0x2fc)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x3d190f),console[_0x2ff7be(0x2fc)](_0x2ff7be(0x25a)),0x1;const _0x55813d=_0x3d190f[_0x2ff7be(0x1ff)](0x0,_0x43bf1a),_0x4da2a9=_0x3d190f[_0x2ff7be(0x1ff)](_0x43bf1a+0x1);try{_0x1018f2[_0x55813d]=JSON[_0x2ff7be(0x281)](_0x4da2a9);}catch{_0x1018f2[_0x55813d]=_0x4da2a9;}}_0x5419f0['verbose']&&(console['error'](_0x2ff7be(0x28a)+_0x4a605c),Object[_0x2ff7be(0x1e4)](_0x1018f2)[_0x2ff7be(0x1fa)]>0x0&&console['error'](_0x2ff7be(0x2c9)+JSON[_0x2ff7be(0x1bc)](_0x1018f2)),_0x26e4ca&&console[_0x2ff7be(0x2fc)](_0x2ff7be(0x2ff)+_0x26e4ca));const _0x4092b8=await withSpinner('Starting\x20workflow\x20run...',()=>_0x2eef71['workflow'][_0x2ff7be(0x239)](_0x4a605c,_0x1018f2,{'sessionTime':_0x26e4ca}),{'verbose':_0x5419f0[_0x2ff7be(0x2c5)]}),_0x4bfd86=_0x4092b8[_0x2ff7be(0x227)];console[_0x2ff7be(0x2fc)]('✔\x20Workflow\x20run\x20started'),console[_0x2ff7be(0x2fc)]('\x20\x20Attempt\x20ID:\x20'+_0x4bfd86['id']),console[_0x2ff7be(0x2fc)]('\x20\x20Session\x20ID:\x20'+_0x4bfd86[_0x2ff7be(0x223)]),console['error'](_0x2ff7be(0x1d6)+_0x4bfd86[_0x2ff7be(0x250)]?.[_0x2ff7be(0x34d)]),console[_0x2ff7be(0x2fc)](_0x2ff7be(0x36e)+_0x4bfd86[_0x2ff7be(0x22f)]?.[_0x2ff7be(0x34d)]);if(_0x4bfd86['project']?.['id']&&_0x4bfd86[_0x2ff7be(0x223)]&&_0x4bfd86['id']){const _0x4cf364=_0x5419f0['site'],_0x1be062=getConsoleUrl(_0x4cf364,'/app/workflows/'+_0x4bfd86['project']['id']+_0x2ff7be(0x2d3)+_0x4bfd86[_0x2ff7be(0x223)]+_0x2ff7be(0x32a)+_0x4bfd86['id']);console[_0x2ff7be(0x2fc)](_0x2ff7be(0x28c)+a54_0x467bd9[_0x2ff7be(0x1cf)](_0x1be062));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a54_0x141bbb(0x34d)]=a54_0x141bbb(0x272);[a54_0x141bbb(0x20b)]=a54_0x141bbb(0x2ea);async[a54_0x141bbb(0x21d)](_0x401c82){const _0x48962e=a54_0x141bbb,{options:_0xd9183a,args:_0xb7784,tdx:_0x1f9403}=_0x401c82,_0x5ad7a7=_0xb7784[0x0],_0x12db71=_0xb7784[0x1]||'.';if(!_0x5ad7a7)return console[_0x48962e(0x2fc)](_0x48962e(0x220)),console[_0x48962e(0x2fc)](_0x48962e(0x1b0)),0x1;const _0x5f20e5=_0xd9183a[_0x48962e(0x2cb)];_0xd9183a[_0x48962e(0x2c5)]&&(console[_0x48962e(0x2fc)](_0x48962e(0x2c7)+_0x5ad7a7),console[_0x48962e(0x2fc)](_0x48962e(0x300)+_0x12db71),_0x5f20e5&&console[_0x48962e(0x2fc)](_0x48962e(0x247)+_0x5f20e5));const _0x319b46=await withSpinner(_0x48962e(0x2fa)+_0x5ad7a7+_0x48962e(0x21e),()=>_0x1f9403[_0x48962e(0x22f)][_0x48962e(0x24a)](_0x5ad7a7,_0x12db71,{'revision':_0x5f20e5}),{'verbose':_0xd9183a[_0x48962e(0x2c5)]}),_0x515005=_0x319b46[_0x48962e(0x227)];return console[_0x48962e(0x2fc)](_0x48962e(0x2af)+_0x515005[_0x48962e(0x296)]),console[_0x48962e(0x2fc)](_0x48962e(0x37b)+_0x515005['revision']),console[_0x48962e(0x2fc)](_0x48962e(0x1bf)+_0x515005['filesExtracted']),console[_0x48962e(0x2fc)](_0x48962e(0x1c5)+_0x12db71+'/'+_0x515005[_0x48962e(0x296)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x141bbb(0x34d)]='workflow:upload';[a54_0x141bbb(0x20b)]=a54_0x141bbb(0x30a);async['execute'](_0x30f3e7){const _0x3c8dcc=a54_0x141bbb,{options:_0x18d902,args:_0x2a61ad,tdx:_0x55b3a2}=_0x30f3e7;let _0x25bd6e='.',_0x161bbf=_0x18d902[_0x3c8dcc(0x34d)];if(_0x2a61ad[0x0]){const {promises:_0xef2697}=await import('fs');try{const _0x48d775=await _0xef2697[_0x3c8dcc(0x2a1)](_0x2a61ad[0x0]);if(_0x48d775[_0x3c8dcc(0x25e)]())_0x25bd6e=_0x2a61ad[0x0];else return console['error']('Error:\x20'+_0x2a61ad[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x161bbf=_0x2a61ad[0x0],_0x25bd6e='.';}}const _0x21a38b=_0x18d902[_0x3c8dcc(0x2cb)],_0x1cd60c=_0x18d902['skipValidation'];_0x18d902['verbose']&&(console[_0x3c8dcc(0x2fc)](_0x3c8dcc(0x315)+_0x25bd6e),_0x161bbf&&console[_0x3c8dcc(0x2fc)](_0x3c8dcc(0x2e5)+_0x161bbf),_0x21a38b&&console[_0x3c8dcc(0x2fc)]('Revision:\x20'+_0x21a38b),_0x1cd60c&&console[_0x3c8dcc(0x2fc)]('Validation:\x20skipped'));const _0x5d6149=await withSpinner(_0x3c8dcc(0x245),()=>_0x55b3a2[_0x3c8dcc(0x22f)][_0x3c8dcc(0x1be)](_0x25bd6e,{'projectName':_0x161bbf,'revision':_0x21a38b,'skipValidation':_0x1cd60c}),{'verbose':_0x18d902[_0x3c8dcc(0x2c5)]}),_0x3e1c1c=_0x5d6149[_0x3c8dcc(0x227)];return console[_0x3c8dcc(0x2fc)]('✔\x20Pushed\x20'+_0x3e1c1c[_0x3c8dcc(0x296)]),console[_0x3c8dcc(0x2fc)]('\x20\x20Project\x20ID:\x20'+_0x3e1c1c[_0x3c8dcc(0x2d2)]),console[_0x3c8dcc(0x2fc)]('\x20\x20Revision:\x20'+_0x3e1c1c['revision']),await this['showWorkflowConsoleUrl'](_0x55b3a2,_0x3e1c1c[_0x3c8dcc(0x296)],_0x18d902[_0x3c8dcc(0x1f4)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x141bbb(0x34d)]=a54_0x141bbb(0x1f5);[a54_0x141bbb(0x20b)]=a54_0x141bbb(0x2c6);async[a54_0x141bbb(0x21d)](_0x1c0b76){const _0xe4f053=a54_0x141bbb,{options:_0xbdd43,args:_0x5e19b3,tdx:_0x266efe}=_0x1c0b76,_0x45bf18=_0x5e19b3[0x0],_0x197442=_0x5e19b3[0x1];if(!_0x45bf18)return console[_0xe4f053(0x2fc)](a54_0x467bd9[_0xe4f053(0x2ac)](_0xe4f053(0x20a)),'Project\x20name\x20is\x20required'),console[_0xe4f053(0x2fc)](a54_0x467bd9[_0xe4f053(0x293)](_0xe4f053(0x284))),0x1;const _0x4fa3de=_0xbdd43[_0xe4f053(0x2cb)];_0xbdd43[_0xe4f053(0x2c5)]&&(console['error']('Project:\x20'+_0x45bf18),_0x197442&&console[_0xe4f053(0x2fc)](_0xe4f053(0x1b5)+_0x197442),_0x4fa3de&&console[_0xe4f053(0x2fc)](_0xe4f053(0x247)+_0x4fa3de),_0xbdd43[_0xe4f053(0x228)]&&console[_0xe4f053(0x2fc)]('Dry\x20run:\x20yes'));const _0x42057b=await withSpinner(_0xe4f053(0x36d)+_0x45bf18+'...',()=>_0x266efe[_0xe4f053(0x22f)]['pullProject'](_0x45bf18,{'targetDir':_0x197442,'revision':_0x4fa3de}),{'verbose':_0xbdd43[_0xe4f053(0x2c5)]}),_0x2b57ea=_0x42057b[_0xe4f053(0x227)];_0x2b57ea['isNewProject']?console['error'](_0xe4f053(0x27c)+_0x2b57ea[_0xe4f053(0x296)]):console['error'](_0xe4f053(0x33a)+_0x2b57ea['projectName']);console['error'](_0xe4f053(0x37b)+_0x2b57ea[_0xe4f053(0x2cb)]),console[_0xe4f053(0x2fc)](_0xe4f053(0x232)+(a54_0x20d6ee['relative'](process[_0xe4f053(0x34e)](),_0x2b57ea[_0xe4f053(0x253)])||'.')),console[_0xe4f053(0x2fc)]('\x20\x20Changes:\x20'+a54_0x467bd9['green']('+'+_0x2b57ea[_0xe4f053(0x240)][_0xe4f053(0x26c)]+_0xe4f053(0x328))+',\x20'+(a54_0x467bd9[_0xe4f053(0x371)]('~'+_0x2b57ea['summary'][_0xe4f053(0x268)]+'\x20modified')+',\x20')+(a54_0x467bd9['red']('-'+_0x2b57ea[_0xe4f053(0x240)][_0xe4f053(0x333)]+_0xe4f053(0x219))+',\x20')+(''+a54_0x467bd9[_0xe4f053(0x293)](_0x2b57ea[_0xe4f053(0x240)][_0xe4f053(0x2cf)]+_0xe4f053(0x31b))));for(const _0x4144a1 of _0x2b57ea[_0xe4f053(0x2bd)]){_0x4144a1['type']===_0xe4f053(0x268)&&_0x4144a1[_0xe4f053(0x2fd)]&&(console['error']('\x0a'+a54_0x467bd9[_0xe4f053(0x1cf)](_0xe4f053(0x1b8)+_0x4144a1[_0xe4f053(0x258)])),console[_0xe4f053(0x2fc)](_0x4144a1[_0xe4f053(0x2fd)]));}if(!_0x2b57ea['hasChanges'])return saveSessionContext({'workflow_project':_0x2b57ea[_0xe4f053(0x296)]},_0xbdd43['session']),console['error'](a54_0x467bd9['green'](_0xe4f053(0x236))),console['error'](a54_0x467bd9['dim'](_0xe4f053(0x33f)+_0x2b57ea[_0xe4f053(0x296)])),0x0;if(_0xbdd43[_0xe4f053(0x228)])return console['error'](a54_0x467bd9[_0xe4f053(0x371)](_0xe4f053(0x368))),0x0;if(!_0xbdd43[_0xe4f053(0x269)]){if(!isInteractive())return console[_0xe4f053(0x2fc)](a54_0x467bd9['red'](_0xe4f053(0x317)),_0xe4f053(0x275)),console['error'](a54_0x467bd9[_0xe4f053(0x293)](_0xe4f053(0x1af))),0x1;const _0x3a8410=await confirmKey(_0xe4f053(0x1ac));if(!_0x3a8410)return console[_0xe4f053(0x2fc)](a54_0x467bd9[_0xe4f053(0x371)](_0xe4f053(0x362)),_0xe4f053(0x1e5)),0x1;}await withSpinner(_0xe4f053(0x277),()=>_0x266efe[_0xe4f053(0x22f)][_0xe4f053(0x1fb)](_0x2b57ea,{'revision':_0x4fa3de}),{'verbose':_0xbdd43[_0xe4f053(0x2c5)]}),saveSessionContext({'workflow_project':_0x2b57ea['projectName']},_0xbdd43[_0xe4f053(0x34f)]),console[_0xe4f053(0x2fc)](a54_0x467bd9[_0xe4f053(0x20d)](_0xe4f053(0x334)));const _0x5b9315=a54_0x20d6ee['relative'](process[_0xe4f053(0x34e)](),_0x2b57ea[_0xe4f053(0x253)])||'.';return console['error'](a54_0x467bd9[_0xe4f053(0x293)](_0xe4f053(0x1c5)+_0x5b9315)),console[_0xe4f053(0x2fc)](a54_0x467bd9['dim'](_0xe4f053(0x33f)+_0x2b57ea[_0xe4f053(0x296)])),0x0;}}function a54_0xc7bf(){const _0xcbc242=['65IuJrBH','Files\x20to\x20upload:\x20','\x20\x20Project:\x20','✔\x20Push\x20complete','workflowProject','workflow:sessions','showWorkflowConsoleUrl','\x20-\x20','set','taskName','canceling','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','text','logFiles','MAX_TASKS_DISPLAY','\x20tasks','keys','-\x20no\x20files\x20written','Deleting\x20secret...','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Enable\x20a\x20workflow\x20schedule','\x20of\x20','size','executePushProject','Downloading\x20logs...','start','write','\x0a✔\x20No\x20changes\x20to\x20push','Key:\x20','json','\x22\x20to\x20new\x20project\x20\x22','session_id','site','workflow:pull','select','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','\x20modified','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','length','applyPullProject','✔\x20Secret\x20\x27','799628OwaMqm','filter','substring','targetExists','35600rOdaRD','22lMNNjh','Schedule\x20ID\x20is\x20required','localeCompare','\x0aFailed\x20to\x20fetch\x20attempt\x20data','unknown','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','Include\x20retried:\x20yes','Target:\x20','Error:','description','TASK_NAME_WIDTH','green','Filter:\x20project=','\x20from\x20session\x20','\x20has\x20no\x20attempts','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','title','\x20secret','4543763YLtzWy','every','durationMs','updatedAt','From\x20task:\x20','\x20deleted','No\x20workflows\x20found\x20in\x20project:\x20','💡\x20Tip:\x20Use\x20','listSecrets','execute','...','includeRetried','Error:\x20Project\x20name\x20is\x20required','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','\x20attempt','sessionId','No\x20attempts\x20found\x20for:\x20','List\x20all\x20workflow\x20projects','workflow:tasks','data','dryRun','values','MIN_LABEL_COUNT','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','repeat','getFullYear','done','workflow','workflow:secrets:set','fs/promises','\x20\x20Target:\x20','No\x20workflow\x20sessions\x20found','\x20workflow','No\x20sessions\x20found\x20in\x20project:\x20','\x0a✔\x20Already\x20up\x20to\x20date','Source:\x20','includes','run','autocomplete','\x0a✔\x20Attempt\x20complete','workflow:schedule:disable','msPerChar','\x0aPolling...\x20(','Error:\x20Attempt\x20ID\x20is\x20required','summary','rows','fullName','Fetching\x20log\x20files...','format','Pushing\x20workflow\x20project...','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Revision:\x20','fill','Select\x20a\x20task\x20to\x20view\x20logs:','download','executeCloneProject','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Latest\x20session\x20has\x20no\x20attempt','list','key','project','index','Failed\x20to\x20fetch\x20attempt\x20data','targetDir','startTime','Dry\x20run:\x20yes','Source\x20directory:\x20','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','path','Validation:\x20skipped','Expected\x20format:\x20--param\x20key=value','parseProjectWorkflowPattern','No\x20workflows\x20found','startedAt','isDirectory','Filter:\x20','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','padStart','getMonth','\x0a⚠\x20Project\x20\x22','🔄\x20','toLocaleString','\x1b[1A\x1b[2K','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','modified','yes','window','\x20\x20Project\x20ID:\x20','new','jsonl','round','\x22?\x20This\x20cannot\x20be\x20undone.','white','Invalid\x20format:\x20','workflow:download','navigateSessionsInteractive','Params:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Pushing\x20project...','Writing\x20files...','\x20next:\x20','Disabling\x20schedule\x20#','No\x20projects\x20match\x20pattern:\x20','cancelRequested','→\x20New\x20project:\x20','match','basename','planned','limit','parse','No\x20schedules\x20found','Listing\x20workflow\x20sessions...','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','tasks','Using\x20attempt\x20','Error:\x20Invalid\x20JSON\x20in\x20--params','\x20(system)','force','Workflow:\x20','Retrying\x20attempt...','\x20\x20Console:\x20','workflow:attempts','Resume\x20from:\x20','Project\x20filter:\x20','setSecrets','Reason:\x20','Retrying\x20session...','dim','workflow:secrets:delete','running','projectName','Getting\x20attempt\x20details...','✔\x20Workflow\x20project\x20set\x20to:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','📁\x20','\x22\x20with\x20new\x20revision?','fileSize','(unknown)','has','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','\x20\x20tdx\x20wf\x20use\x20<project>','stat','workflow:workflows','Key\x20cannot\x20be\x20empty','workflow:use','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','finishedAt','logs','No\x20attempts\x20found','✔\x20Deleted\x20project\x20','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','red','disableSchedule','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','✔\x20Downloaded\x20','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','List\x20workflow\x20attempts','now','POLL_INTERVAL_MS','attempts','\x20secrets\x20set\x20for\x20project\x20\x27','map','Attempt\x20ID:\x20','toISOString','log','Updating\x20','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','workflow:push','changes','retryAttempt','\x0aDry\x20run\x20-\x20no\x20project\x20created','Getting\x20attempt\x20tasks...','Loading\x20session...','✔\x20Workflow\x20project\x20context\x20cleared.','No\x20matching\x20sessions\x20found','Warning:','verbose','Pull\x20workflow\x20project\x20to\x20local\x20folder','Project:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Parameters:\x20','sys','revision','params','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','workflow:kill','unchanged','floor','message','projectId','/sessions/','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','1478964EpDchP','\x20to\x20see\x20detailed\x20logs','sort','getDate','Listing\x20workflow\x20projects...','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','tdx.json','Analyzing\x20project...','\x20\x20Next\x20run:\x20','185844cekjoA','total','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','8imLgzE','renderSessionsTimeline','Project\x20name:\x20','List\x20workflow\x20execution\x20sessions','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','MAX_TIMELINE_WIDTH','Force:\x20yes','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','tdx\x20wf\x20attempt\x20','Listing\x20secrets...','group_error','sourceProjectName','Project\x20name\x20is\x20required','attemptId','Total:\x20','Usage:\x20tdx\x20wf\x20use\x20<project>','Pattern:\x20','getTime','follow','displayLine','Listing\x20schedules...','toLowerCase','type','Downloading\x20project\x20','workflow:clone','error','diff','Retry\x20a\x20session\x20or\x20attempt','Session\x20time:\x20','Output\x20directory:\x20','min','Start\x20a\x20workflow\x20run','end','status','context','New\x20project\x20name:\x20','split','listSchedules','LABEL_WIDTH_DIVISOR','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Killing\x20attempt...','No\x20attempts\x20found\x20in\x20project:\x20','indexOf','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Usage:\x20workflow:delete\x20<project-name-or-id>','some','kill','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','lastAttempt','\x0aUpdate\x20existing\x20project\x20\x22','Project\x20directory:\x20','Enabling\x20schedule\x20#','\x0aError:','No\x20workflow\x20projects\x20found','Tip:\x20cd\x20to\x20workflows/','\x20(use\x20--limit\x20to\x20show\x20more)','\x20unchanged','workflows','workflow:schedule:enable','workflowName','getMinutes','utf-8','sessionTime','generateSessionTimelineRows','\x20\x20Changes:\x20','stdout','\x27\x20from\x20project\x20\x27','\x20secrets...','resolveProject','\x20new','pollTimeline','/attempt/','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','renderSingleTimeline','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Resolving\x20project\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Source\x20directory\x20is\x20required','table','prepareCloneProject','deleted','✔\x20Pull\x20complete','Listing\x20workflows...','✔\x20Project:\x20','join','slice','MIN_TIMELINE_WIDTH','→\x20Project:\x20','resumeFrom','Setting\x20','startsWith','9YknvWz','\x20\x20Session\x20context\x20set\x20to:\x20','GUTTER','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','ICON_WIDTH','Session\x20','12412854qbkhbv','success','No\x20log\x20content\x20found','nextRunTime','No\x20sessions\x20found\x20for:\x20','get','resolve','\x20task','name','cwd','session','retryAttemptName','duration','skipValidation','getHours','task','Analyzing\x20changes...','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','clear','pending','isArray','Loading\x20sessions...','LABEL_MIN_SPACING','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','✔\x20Found\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','✔\x20Schedule\x20#','session:','param','Cancelled','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','⚠\x20Showing\x20first\x20','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','attempt','✔\x20Showing\x20','\x0aDry\x20run\x20-\x20no\x20files\x20written','fileCount','resolveProjectId','all','max','Pulling\x20project\x20','\x20\x20Workflow:\x20','createdAt','blue','yellow','workflow:retry','\x20schedule','requireProject','buildTimelineData','delete','icon',',\x20Workflow:\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','resolveProjectDir','\x20\x20Revision:\x20','find','\x0aApply\x20these\x20changes?','isTTY','11721620zJXHzO','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','workflow:schedules','List\x20workflow\x20schedules','\x20disabled\x20(','newProjectId','Target\x20directory:\x20','revision:\x20','workflow:timeline','---\x20','No\x20sessions\x20with\x20timing\x20information','Auto-selected\x20latest\x20session:\x20','workflow:run','stringify','workflow:secrets:list','push','\x20\x20Files\x20extracted:\x20','No\x20sessions\x20found','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','Show\x20tasks\x20for\x20an\x20attempt','MAX_POLL_ITERATIONS','Select\x20a\x20workflow\x20to\x20run','\x20\x20Location:\x20','state','List\x20workflows','fromTask','Select\x20a\x20session\x20to\x20view\x20timeline:','trim','\x20project','columns','newProjectName','ICON_SPACING','cyan','renderTimeline','Including\x20subtasks:\x20yes','workflow:projects','output'];a54_0xc7bf=function(){return _0xcbc242;};return a54_0xc7bf();}export class WorkflowPushCommand extends WorkflowBaseCommand{[a54_0x141bbb(0x34d)]=a54_0x141bbb(0x2bc);[a54_0x141bbb(0x20b)]=a54_0x141bbb(0x24c);async[a54_0x141bbb(0x21d)](_0x35c3d6){const _0x5a6c5b=a54_0x141bbb,{options:_0x39383b,args:_0x92f883,tdx:_0xc8c15d}=_0x35c3d6,_0x5f0864=this[_0x5a6c5b(0x37a)](_0x92f883,_0x39383b),_0x6a35d1=_0x39383b['revision'],_0x1d83f7=_0x39383b[_0x5a6c5b(0x352)];_0x39383b['verbose']&&(_0x5f0864&&console[_0x5a6c5b(0x2fc)](_0x5a6c5b(0x256)+_0x5f0864),_0x6a35d1&&console[_0x5a6c5b(0x2fc)]('Revision:\x20'+_0x6a35d1),_0x39383b[_0x5a6c5b(0x228)]&&console[_0x5a6c5b(0x2fc)](_0x5a6c5b(0x255)),_0x1d83f7&&console['error'](_0x5a6c5b(0x259)));let _0x44c424;try{_0x44c424=await withSpinner(_0x5a6c5b(0x355),()=>_0xc8c15d[_0x5a6c5b(0x22f)]['preparePushProject']({'sourceDir':_0x5f0864,'revision':_0x6a35d1,'skipValidation':_0x1d83f7}),{'verbose':_0x39383b[_0x5a6c5b(0x2c5)]});}catch(_0x220b02){if(_0x220b02 instanceof Error&&_0x220b02[_0x5a6c5b(0x2d1)][_0x5a6c5b(0x238)]('No\x20workflow\x20tdx.json\x20found'))return console[_0x5a6c5b(0x2fc)](a54_0x467bd9['red'](_0x5a6c5b(0x20a)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x39383b[_0x5a6c5b(0x1d8)]?console[_0x5a6c5b(0x2fc)](a54_0x467bd9[_0x5a6c5b(0x293)](_0x5a6c5b(0x319)+_0x39383b['workflowProject']+_0x5a6c5b(0x356)+_0x39383b[_0x5a6c5b(0x1d8)]+'\x27')):console[_0x5a6c5b(0x2fc)](a54_0x467bd9[_0x5a6c5b(0x293)](_0x5a6c5b(0x35c))),0x1;throw _0x220b02;}const _0x2465c5=_0x44c424[_0x5a6c5b(0x227)];console['error'](_0x5a6c5b(0x336)+_0x2465c5[_0x5a6c5b(0x296)]),console[_0x5a6c5b(0x2fc)]('\x20\x20Source:\x20'+_0x2465c5['sourceDir']),console[_0x5a6c5b(0x2fc)](_0x5a6c5b(0x37b)+_0x2465c5[_0x5a6c5b(0x2cb)]),console[_0x5a6c5b(0x2fc)](_0x5a6c5b(0x323)+a54_0x467bd9['green']('+'+_0x2465c5[_0x5a6c5b(0x240)]['new']+_0x5a6c5b(0x328))+',\x20'+(a54_0x467bd9[_0x5a6c5b(0x371)]('~'+_0x2465c5[_0x5a6c5b(0x240)]['modified']+_0x5a6c5b(0x1f8))+',\x20')+(a54_0x467bd9[_0x5a6c5b(0x2ac)]('-'+_0x2465c5[_0x5a6c5b(0x240)][_0x5a6c5b(0x333)]+_0x5a6c5b(0x219))+',\x20')+(''+a54_0x467bd9['dim'](_0x2465c5[_0x5a6c5b(0x240)][_0x5a6c5b(0x2cf)]+'\x20unchanged')));for(const _0x1da1b6 of _0x2465c5[_0x5a6c5b(0x2bd)]){_0x1da1b6[_0x5a6c5b(0x2f9)]===_0x5a6c5b(0x268)&&_0x1da1b6['diff']&&(console['error']('\x0a'+a54_0x467bd9[_0x5a6c5b(0x1cf)](_0x5a6c5b(0x1b8)+_0x1da1b6[_0x5a6c5b(0x258)])),console[_0x5a6c5b(0x2fc)](_0x1da1b6[_0x5a6c5b(0x2fd)]));}if(!_0x2465c5['hasChanges'])return console['error'](a54_0x467bd9[_0x5a6c5b(0x20d)](_0x5a6c5b(0x1ef))),await this[_0x5a6c5b(0x1da)](_0xc8c15d,_0x2465c5[_0x5a6c5b(0x296)],_0x39383b[_0x5a6c5b(0x1f4)]),0x0;if(_0x39383b[_0x5a6c5b(0x228)])return console[_0x5a6c5b(0x2fc)](a54_0x467bd9[_0x5a6c5b(0x371)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x39383b[_0x5a6c5b(0x269)]){if(!isInteractive())return console[_0x5a6c5b(0x2fc)](a54_0x467bd9['red'](_0x5a6c5b(0x317)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5a6c5b(0x2fc)](a54_0x467bd9[_0x5a6c5b(0x293)](_0x5a6c5b(0x1af))),0x1;const _0x16adb6=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x16adb6)return console[_0x5a6c5b(0x2fc)](a54_0x467bd9[_0x5a6c5b(0x371)]('Cancelled'),'-\x20nothing\x20pushed'),0x1;}const _0x426915=await withSpinner(_0x5a6c5b(0x276),()=>_0xc8c15d[_0x5a6c5b(0x22f)][_0x5a6c5b(0x1eb)](_0x2465c5),{'verbose':_0x39383b[_0x5a6c5b(0x2c5)]}),_0x1a25ca=_0x426915[_0x5a6c5b(0x227)];return console[_0x5a6c5b(0x2fc)](a54_0x467bd9[_0x5a6c5b(0x20d)](_0x5a6c5b(0x1d7))),console[_0x5a6c5b(0x2fc)]('\x20\x20Project\x20ID:\x20'+_0x1a25ca['projectId']),console['error'](_0x5a6c5b(0x37b)+_0x1a25ca['revision']),await this[_0x5a6c5b(0x1da)](_0xc8c15d,_0x1a25ca['projectName'],_0x39383b[_0x5a6c5b(0x1f4)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0x141bbb(0x34d)]=a54_0x141bbb(0x2fb);['description']=a54_0x141bbb(0x2ab);async['execute'](_0x201025){const _0x120f16=a54_0x141bbb,{options:_0x517651,args:_0x5e343d,tdx:_0x1d79a3}=_0x201025,_0x1fc536=this[_0x120f16(0x37a)](_0x5e343d,_0x517651),_0x32c35f=_0x517651[_0x120f16(0x34d)],_0x8282c7=_0x517651[_0x120f16(0x2cb)],_0x567c8e=_0x517651[_0x120f16(0x352)];if(!_0x1fc536)return console[_0x120f16(0x2fc)](a54_0x467bd9[_0x120f16(0x2ac)](_0x120f16(0x20a)),_0x120f16(0x330)),console[_0x120f16(0x2fc)](a54_0x467bd9[_0x120f16(0x293)](_0x120f16(0x365))),console['error'](a54_0x467bd9[_0x120f16(0x293)](_0x120f16(0x341))),0x1;if(!_0x32c35f)return console[_0x120f16(0x2fc)](a54_0x467bd9[_0x120f16(0x2ac)]('Error:'),_0x120f16(0x2e2)),console['error'](a54_0x467bd9[_0x120f16(0x293)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x517651[_0x120f16(0x2c5)]&&(console[_0x120f16(0x2fc)](_0x120f16(0x256)+_0x1fc536),console[_0x120f16(0x2fc)](_0x120f16(0x306)+_0x32c35f),_0x8282c7&&console[_0x120f16(0x2fc)](_0x120f16(0x247)+_0x8282c7),_0x517651[_0x120f16(0x228)]&&console[_0x120f16(0x2fc)](_0x120f16(0x255)),_0x567c8e&&console['error'](_0x120f16(0x259)));const _0x3971d7=await withSpinner(_0x120f16(0x2de),()=>_0x1d79a3[_0x120f16(0x22f)][_0x120f16(0x332)](_0x1fc536,_0x32c35f,{'revision':_0x8282c7,'skipValidation':_0x567c8e}),{'verbose':_0x517651[_0x120f16(0x2c5)]}),_0x3b400d=_0x3971d7[_0x120f16(0x227)];console[_0x120f16(0x2fc)](_0x120f16(0x237)+_0x3b400d['sourceDir']);_0x3b400d[_0x120f16(0x2ee)]&&console[_0x120f16(0x2fc)]('Source\x20project:\x20'+_0x3b400d[_0x120f16(0x2ee)]);console[_0x120f16(0x2fc)](_0x120f16(0x306)+_0x3b400d['newProjectName']),console[_0x120f16(0x2fc)](_0x120f16(0x247)+_0x3b400d[_0x120f16(0x2cb)]),console['error'](_0x120f16(0x1d5)+_0x3b400d[_0x120f16(0x369)]);_0x3b400d[_0x120f16(0x200)]&&(console[_0x120f16(0x2fc)](a54_0x467bd9['yellow'](_0x120f16(0x263)+_0x3b400d[_0x120f16(0x1cd)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x3b400d['existingProjectId']+')')),console[_0x120f16(0x2fc)](a54_0x467bd9[_0x120f16(0x371)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x517651[_0x120f16(0x228)])return console[_0x120f16(0x2fc)](a54_0x467bd9['yellow'](_0x120f16(0x2bf))),0x0;if(!_0x517651[_0x120f16(0x269)]){if(!isInteractive())return console[_0x120f16(0x2fc)](a54_0x467bd9[_0x120f16(0x2ac)](_0x120f16(0x317)),_0x120f16(0x275)),console[_0x120f16(0x2fc)](a54_0x467bd9[_0x120f16(0x293)](_0x120f16(0x1af))),0x1;const _0x8fbf7c=_0x3b400d[_0x120f16(0x2ee)]||a54_0x20d6ee[_0x120f16(0x27e)](_0x1fc536),_0x74c86c=_0x3b400d[_0x120f16(0x200)]?_0x120f16(0x314)+_0x32c35f+_0x120f16(0x29b):'\x0aClone\x20\x22'+_0x8fbf7c+_0x120f16(0x1f2)+_0x32c35f+'\x22?',_0x1f1ca6=await confirmKey(_0x74c86c);if(!_0x1f1ca6)return console[_0x120f16(0x2fc)](a54_0x467bd9[_0x120f16(0x371)](_0x120f16(0x362))),0x1;}const _0x296e6d=await withSpinner(_0x3b400d[_0x120f16(0x200)]?_0x120f16(0x2ba)+_0x32c35f+'...':'Cloning\x20to\x20'+_0x32c35f+_0x120f16(0x21e),()=>_0x1d79a3[_0x120f16(0x22f)][_0x120f16(0x24b)](_0x3b400d),{'verbose':_0x517651[_0x120f16(0x2c5)]}),_0x4542d5=_0x296e6d['data'];return console[_0x120f16(0x2fc)](a54_0x467bd9[_0x120f16(0x20d)](_0x3b400d[_0x120f16(0x200)]?'✔\x20Project\x20updated':'✔\x20Clone\x20complete')),console[_0x120f16(0x2fc)]('\x20\x20Project:\x20'+_0x4542d5[_0x120f16(0x1cd)]),console[_0x120f16(0x2fc)](_0x120f16(0x26b)+_0x4542d5[_0x120f16(0x1b4)]),console[_0x120f16(0x2fc)](_0x120f16(0x37b)+_0x4542d5[_0x120f16(0x2cb)]),await this[_0x120f16(0x1da)](_0x1d79a3,_0x4542d5[_0x120f16(0x1cd)],_0x517651['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']='workflow:delete';[a54_0x141bbb(0x20b)]=a54_0x141bbb(0x2a6);async[a54_0x141bbb(0x21d)](_0x1b165c){const _0x16063b=a54_0x141bbb,{options:_0x52f942,args:_0x44d4b6,tdx:_0x448871}=_0x1b165c,_0x108966=_0x44d4b6[0x0];if(!_0x108966)return console['error'](_0x16063b(0x363)),console[_0x16063b(0x2fc)](_0x16063b(0x30f)),0x1;_0x52f942['verbose']&&console[_0x16063b(0x2fc)](_0x16063b(0x2c7)+_0x108966);if(!_0x52f942[_0x16063b(0x269)]){if(!isInteractive())return console['error'](a54_0x467bd9[_0x16063b(0x2ac)](_0x16063b(0x317)),_0x16063b(0x275)),console[_0x16063b(0x2fc)](a54_0x467bd9[_0x16063b(0x293)](_0x16063b(0x1af))),0x1;const _0x5397fc=await confirmKey(_0x16063b(0x1e7)+_0x108966+_0x16063b(0x26f));if(!_0x5397fc)return console[_0x16063b(0x2fc)](a54_0x467bd9['yellow'](_0x16063b(0x362))),0x1;}const _0x3c075a=await withSpinner('Deleting\x20project\x20'+_0x108966+_0x16063b(0x21e),()=>_0x448871['workflow'][_0x16063b(0x376)](_0x108966),{'verbose':_0x52f942['verbose']}),_0x440134=_0x3c075a[_0x16063b(0x227)];return console['error'](_0x16063b(0x2aa)+_0x440134[_0x16063b(0x296)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x440134[_0x16063b(0x2d2)]),0x0;}}export function parseKeyValue(_0x4ca56e){const _0x1e255a=a54_0x141bbb,_0x3606c6=_0x4ca56e[_0x1e255a(0x30d)]('=');if(_0x3606c6===-0x1)throw new Error(_0x1e255a(0x271)+_0x4ca56e+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x2f77fe=_0x4ca56e[_0x1e255a(0x1ff)](0x0,_0x3606c6),_0x32f8db=_0x4ca56e[_0x1e255a(0x1ff)](_0x3606c6+0x1);if(!_0x2f77fe)throw new Error(_0x1e255a(0x2a3));return{'key':_0x2f77fe,'value':_0x32f8db};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x141bbb(0x34d)]=a54_0x141bbb(0x1bd);[a54_0x141bbb(0x20b)]=a54_0x141bbb(0x2d4);async[a54_0x141bbb(0x21d)](_0x21ae27){const _0x4ad8dc=a54_0x141bbb,{options:_0x42b899,args:_0x25cbe6,tdx:_0x22546a}=_0x21ae27,_0x42730d=this[_0x4ad8dc(0x374)](_0x25cbe6,_0x42b899);if(!_0x42730d)return 0x1;_0x42b899[_0x4ad8dc(0x2c5)]&&console[_0x4ad8dc(0x2fc)](_0x4ad8dc(0x2c7)+_0x42730d);const _0x19ab4a=await withSpinner(_0x4ad8dc(0x2ec),()=>_0x22546a[_0x4ad8dc(0x22f)][_0x4ad8dc(0x21c)](_0x42730d),{'verbose':_0x42b899[_0x4ad8dc(0x2c5)]}),{secrets:_0x5f5cef}=_0x19ab4a['data'];return console[_0x4ad8dc(0x2fc)]('✔\x20Found\x20'+_0x5f5cef[_0x4ad8dc(0x1fa)]+_0x4ad8dc(0x213)+(_0x5f5cef['length']!==0x1?'s':'')),await handleSDKOutput(_0x5f5cef,_0x42b899),0x0;}}function a54_0x3172(_0x3890f7,_0x58f4ce){_0x3890f7=_0x3890f7-0x1ab;const _0xc7bf89=a54_0xc7bf();let _0x317221=_0xc7bf89[_0x3890f7];return _0x317221;}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x141bbb(0x34d)]=a54_0x141bbb(0x230);[a54_0x141bbb(0x20b)]=a54_0x141bbb(0x312);async[a54_0x141bbb(0x21d)](_0x511584){const _0x2ce568=a54_0x141bbb,{options:_0x239980,args:_0x3b79db,tdx:_0x5ee9f3}=_0x511584;let _0x6b72aa,_0xbd4a3f;if(_0x3b79db[_0x2ce568(0x1fa)]>=0x1&&!_0x3b79db[0x0]['includes']('='))_0x6b72aa=_0x3b79db[0x0],_0xbd4a3f=_0x3b79db[_0x2ce568(0x338)](0x1);else{if(_0x3b79db[_0x2ce568(0x1fa)]>=0x1&&_0x239980[_0x2ce568(0x1d8)])_0x6b72aa=_0x239980[_0x2ce568(0x1d8)],_0xbd4a3f=_0x3b79db;else return _0x3b79db['length']>=0x1?(console[_0x2ce568(0x2fc)](_0x2ce568(0x220)),console['error']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x2ce568(0x2fc)](_0x2ce568(0x32b)),console['error'](_0x2ce568(0x1f9)),0x1);}if(_0xbd4a3f[_0x2ce568(0x1fa)]===0x0)return console[_0x2ce568(0x2fc)](_0x2ce568(0x32b)),console['error']('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1;const _0x609bab={};try{for(const _0x5e6e97 of _0xbd4a3f){const {key:_0x86f865,value:_0x2f70de}=parseKeyValue(_0x5e6e97);_0x609bab[_0x86f865]=_0x2f70de;}}catch(_0x26395b){return _0x26395b instanceof Error&&console[_0x2ce568(0x2fc)](a54_0x467bd9[_0x2ce568(0x2ac)](_0x2ce568(0x20a)),_0x26395b[_0x2ce568(0x2d1)]),0x1;}const _0x468d71=Object['keys'](_0x609bab);_0x239980['verbose']&&(console[_0x2ce568(0x2fc)](_0x2ce568(0x2c7)+_0x6b72aa),console[_0x2ce568(0x2fc)]('Secrets\x20to\x20set:\x20'+_0x468d71[_0x2ce568(0x337)](',\x20')));const _0x27bd40=await withSpinner(_0x468d71[_0x2ce568(0x1fa)]===0x1?'Setting\x20secret...':_0x2ce568(0x33c)+_0x468d71[_0x2ce568(0x1fa)]+_0x2ce568(0x326),()=>_0x5ee9f3[_0x2ce568(0x22f)][_0x2ce568(0x290)](_0x6b72aa,_0x609bab),{'verbose':_0x239980[_0x2ce568(0x2c5)]}),_0xfba83b=_0x27bd40['data'];return console['error'](_0x468d71[_0x2ce568(0x1fa)]===0x1?_0x2ce568(0x1fc)+_0xfba83b[_0x2ce568(0x1e4)][0x0]+_0x2ce568(0x2b0)+_0xfba83b[_0x2ce568(0x296)]+'\x27':'✔\x20'+_0xfba83b[_0x2ce568(0x1e4)][_0x2ce568(0x1fa)]+_0x2ce568(0x2b5)+_0xfba83b[_0x2ce568(0x296)]+'\x27'),(_0x239980[_0x2ce568(0x1f1)]||_0x239980[_0x2ce568(0x26d)])&&await handleSingleObjectOutput(_0xfba83b,_0x239980),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0x141bbb(0x34d)]=a54_0x141bbb(0x294);['description']=a54_0x141bbb(0x2da);async['execute'](_0x4feb4d){const _0x1807c6=a54_0x141bbb,{options:_0x548cf4,args:_0x2a35cc,tdx:_0x2314b4}=_0x4feb4d;let _0x19661b,_0x6c5ffe;if(_0x2a35cc[_0x1807c6(0x1fa)]>=0x2)_0x19661b=_0x2a35cc[0x0],_0x6c5ffe=_0x2a35cc[0x1];else{if(_0x2a35cc[_0x1807c6(0x1fa)]===0x1&&_0x548cf4[_0x1807c6(0x1d8)])_0x19661b=_0x548cf4[_0x1807c6(0x1d8)],_0x6c5ffe=_0x2a35cc[0x0];else return _0x2a35cc[_0x1807c6(0x1fa)]===0x1?(console[_0x1807c6(0x2fc)](_0x1807c6(0x220)),console[_0x1807c6(0x2fc)](_0x1807c6(0x2cd)),0x1):(console[_0x1807c6(0x2fc)]('Error:\x20Secret\x20key\x20is\x20required'),console[_0x1807c6(0x2fc)](_0x1807c6(0x260)),0x1);}_0x548cf4[_0x1807c6(0x2c5)]&&(console[_0x1807c6(0x2fc)](_0x1807c6(0x2c7)+_0x19661b),console[_0x1807c6(0x2fc)](_0x1807c6(0x1f0)+_0x6c5ffe));if(!_0x548cf4['yes']){if(!isInteractive())return console[_0x1807c6(0x2fc)](a54_0x467bd9['red'](_0x1807c6(0x317)),_0x1807c6(0x275)),console[_0x1807c6(0x2fc)](a54_0x467bd9['dim'](_0x1807c6(0x1af))),0x1;const _0x5d64d9=await confirmKey(_0x1807c6(0x2dc)+_0x6c5ffe+_0x1807c6(0x325)+_0x19661b+'\x27?');if(!_0x5d64d9)return console[_0x1807c6(0x2fc)](a54_0x467bd9[_0x1807c6(0x371)]('Cancelled')),0x1;}const _0x4b3292=await withSpinner(_0x1807c6(0x1e6),()=>_0x2314b4[_0x1807c6(0x22f)]['deleteSecret'](_0x19661b,_0x6c5ffe),{'verbose':_0x548cf4['verbose']}),_0x40795a=_0x4b3292[_0x1807c6(0x227)];return console[_0x1807c6(0x2fc)](_0x1807c6(0x1fc)+_0x40795a[_0x1807c6(0x24f)]+_0x1807c6(0x1f7)+_0x40795a[_0x1807c6(0x296)]+'\x27'),(_0x548cf4[_0x1807c6(0x1f1)]||_0x548cf4[_0x1807c6(0x26d)])&&await handleSingleObjectOutput(_0x40795a,_0x548cf4),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(_0xc918c1){const _0x37effe=a54_0x141bbb,_0x2c5de4=Math[_0x37effe(0x2d0)](_0xc918c1/0x3e8),_0x4affa6=Math[_0x37effe(0x2d0)](_0x2c5de4/0x3c),_0x352d1b=Math[_0x37effe(0x2d0)](_0x4affa6/0x3c),_0x456077=Math[_0x37effe(0x2d0)](_0x352d1b/0x18);if(_0x456077>0x0){const _0x4ebd7c=_0x352d1b%0x18;return _0x4ebd7c>0x0?_0x456077+'d\x20'+_0x4ebd7c+'h':_0x456077+'d';}else{if(_0x352d1b>0x0){const _0x1a7da2=_0x4affa6%0x3c;return _0x1a7da2>0x0?_0x352d1b+'h\x20'+_0x1a7da2+'m':_0x352d1b+'h';}else{if(_0x4affa6>0x0){const _0x460c8d=_0x2c5de4%0x3c;return _0x460c8d>0x0?_0x4affa6+'m\x20'+_0x460c8d+'s':_0x4affa6+'m';}else return _0x2c5de4+'s';}}}function formatTimestamp(_0x5bbcfc,_0x438b6f){const _0x26e657=a54_0x141bbb,_0x19e81d=new Date(_0x5bbcfc),_0x69c3d9=String(_0x19e81d[_0x26e657(0x353)]())[_0x26e657(0x261)](0x2,'0'),_0x22aa5f=String(_0x19e81d[_0x26e657(0x31f)]())[_0x26e657(0x261)](0x2,'0'),_0x30e847=_0x69c3d9+':'+_0x22aa5f,_0x2a53ec=_0x19e81d[_0x26e657(0x22d)]()===_0x438b6f[_0x26e657(0x22d)]()&&_0x19e81d[_0x26e657(0x262)]()===_0x438b6f[_0x26e657(0x262)]()&&_0x19e81d[_0x26e657(0x2d8)]()===_0x438b6f['getDate']();if(_0x2a53ec)return _0x30e847;else{const _0x26dfbf=String(_0x19e81d[_0x26e657(0x262)]()+0x1)['padStart'](0x2,'0'),_0x373b1d=String(_0x19e81d[_0x26e657(0x2d8)]())[_0x26e657(0x261)](0x2,'0');return _0x26dfbf+'-'+_0x373b1d+'\x20'+_0x30e847;}}function formatDate(_0x517b89){const _0x3eecb9=a54_0x141bbb,_0x12067b=_0x517b89[_0x3eecb9(0x22d)](),_0x2e9d5a=String(_0x517b89['getMonth']()+0x1)[_0x3eecb9(0x261)](0x2,'0'),_0x448a6f=String(_0x517b89[_0x3eecb9(0x2d8)]())[_0x3eecb9(0x261)](0x2,'0');return _0x12067b+'-'+_0x2e9d5a+'-'+_0x448a6f;}function getTaskStateIcon(_0x27a96e){const _0x55882c={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x55882c[_0x27a96e]||'⚪';}function getBarChar(_0x2d8c89){const _0x59865a=a54_0x141bbb;return _0x2d8c89===_0x59865a(0x2fc)||_0x2d8c89==='group_error'?'×':'─';}function getBarColor(_0x52bcf6){const _0x20e790=a54_0x141bbb,_0x25ff6e={'success':a54_0x467bd9[_0x20e790(0x20d)],'error':a54_0x467bd9[_0x20e790(0x2ac)],'group_error':a54_0x467bd9[_0x20e790(0x2ac)],'running':a54_0x467bd9['blue'],'blocked':a54_0x467bd9[_0x20e790(0x371)],'planned':a54_0x467bd9['dim'],'canceling':a54_0x467bd9[_0x20e790(0x371)]};return _0x25ff6e[_0x52bcf6]||a54_0x467bd9[_0x20e790(0x270)];}function parseTaskName(_0x4b2297){const _0x32ec8e=a54_0x141bbb;let _0xffc18=_0x4b2297['replace'](/^\++/,'');const _0x53c724=_0xffc18[_0x32ec8e(0x307)]('+'),_0x38b9fa=_0x53c724[_0x32ec8e(0x1fa)]>0x1?_0x53c724[_0x32ec8e(0x1fa)]-0x2:0x0,_0x56699d=_0x53c724[_0x53c724[_0x32ec8e(0x1fa)]-0x1]||_0xffc18;return{'level':_0x38b9fa,'name':'+'+_0x56699d};}function truncateTaskName(_0x5ab7bf,_0x2bea9b){const _0x483b32=a54_0x141bbb,_0x310dc3=stringWidth(_0x5ab7bf);if(_0x310dc3<=_0x2bea9b)return _0x5ab7bf;let _0x190c3f=_0x5ab7bf;while(stringWidth(_0x190c3f+'…')>_0x2bea9b&&_0x190c3f[_0x483b32(0x1fa)]>0x0){_0x190c3f=_0x190c3f['slice'](0x0,-0x1);}return _0x190c3f+'…';}function calculateTimeScale(_0x3d7d4c,_0x5a84f2){const _0x2df57d=a54_0x141bbb;return{'startTime':_0x3d7d4c[_0x2df57d(0x1ed)],'endTime':_0x3d7d4c[_0x2df57d(0x303)],'durationMs':_0x3d7d4c['duration'],'msPerChar':_0x3d7d4c[_0x2df57d(0x351)]/_0x5a84f2};}function timeToPosition(_0x331206,_0x3b4909,_0x1c1fef){const _0x3b181f=a54_0x141bbb,_0x2fca46=_0x331206-_0x3b4909['startTime'],_0x1ea7c0=Math[_0x3b181f(0x2d0)](_0x2fca46/_0x3b4909[_0x3b181f(0x23d)]);return Math['max'](0x0,Math[_0x3b181f(0x301)](_0x1ea7c0,_0x1c1fef));}function renderTimeAxis(_0x4a73e5,_0x3106e9){const _0x1584a5=a54_0x141bbb,_0x5090b1=Math['min'](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math['max'](TIMELINE_CONFIG[_0x1584a5(0x22a)],Math[_0x1584a5(0x2d0)](_0x3106e9/TIMELINE_CONFIG[_0x1584a5(0x309)]))),_0x2768ba=_0x4a73e5[_0x1584a5(0x216)]/(_0x5090b1-0x1),_0x111e5c=new Date(_0x4a73e5[_0x1584a5(0x254)]),_0x5dbcc6=[];for(let _0x2f86a1=0x0;_0x2f86a1<_0x5090b1;_0x2f86a1++){const _0x3422e=_0x4a73e5[_0x1584a5(0x254)]+_0x2f86a1*_0x2768ba,_0xed35d1=timeToPosition(_0x3422e,_0x4a73e5,_0x3106e9),_0x7bae50=formatTimestamp(_0x3422e,_0x111e5c);_0x5dbcc6[_0x1584a5(0x1be)]({'pos':_0xed35d1,'text':_0x7bae50});}const _0x40cfd7=new Array(_0x3106e9)[_0x1584a5(0x248)]('\x20');let _0x51e69f=-0x1;for(const {pos:_0x3e59ac,text:_0x108a54}of _0x5dbcc6){let _0x52d73a=Math[_0x1584a5(0x36c)](0x0,_0x3e59ac-Math[_0x1584a5(0x2d0)](_0x108a54[_0x1584a5(0x1fa)]/0x2));_0x52d73a<=_0x51e69f+TIMELINE_CONFIG[_0x1584a5(0x35b)]&&(_0x52d73a=_0x51e69f+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x52d73a+_0x108a54[_0x1584a5(0x1fa)]>_0x3106e9&&(_0x52d73a=_0x3106e9-_0x108a54[_0x1584a5(0x1fa)]);if(_0x52d73a>=0x0&&_0x52d73a+_0x108a54[_0x1584a5(0x1fa)]<=_0x3106e9&&_0x52d73a>_0x51e69f){for(let _0x312fc9=0x0;_0x312fc9<_0x108a54[_0x1584a5(0x1fa)];_0x312fc9++){_0x40cfd7[_0x52d73a+_0x312fc9]=_0x108a54[_0x312fc9];}_0x51e69f=_0x52d73a+_0x108a54['length']-0x1;}}return _0x40cfd7[_0x1584a5(0x337)]('');}function renderTaskRow(_0x21cb5e,_0x31404e,_0x21facc,_0x1dfec7){const _0x58ab04=a54_0x141bbb,{level:_0x6f1da0,name:_0x2fc22f}=parseTaskName(_0x21cb5e[_0x58ab04(0x34d)]),_0x27e495='\x20'['repeat'](_0x6f1da0),_0x1d02a9=_0x21cb5e[_0x58ab04(0x26a)]?'('+formatElapsed(_0x21cb5e[_0x58ab04(0x26a)][_0x58ab04(0x351)])+')':'',_0x5cd40f=stringWidth(_0x1d02a9),_0x4dd4d9=_0x6f1da0*0x1,_0x3e25b2=_0x1dfec7-_0x4dd4d9-_0x5cd40f-0x1,_0x51f030=truncateTaskName(_0x2fc22f,_0x3e25b2),_0x228db1=_0x27e495+_0x51f030,_0x47b12b=stringWidth(_0x228db1),_0x4cdb2a=_0x1dfec7-_0x47b12b-_0x5cd40f,_0x333452=_0x228db1+'\x20'[_0x58ab04(0x22c)](Math[_0x58ab04(0x36c)](0x1,_0x4cdb2a))+a54_0x467bd9[_0x58ab04(0x293)](_0x1d02a9),_0x52a69c=getTaskStateIcon(_0x21cb5e[_0x58ab04(0x1c6)]),_0x23eb78=new Array(_0x21facc)[_0x58ab04(0x248)]('\x20');if(_0x21cb5e['window']){const _0x36ff26=timeToPosition(_0x21cb5e[_0x58ab04(0x26a)][_0x58ab04(0x1ed)],_0x31404e,_0x21facc),_0xd7f05e=timeToPosition(_0x21cb5e['window'][_0x58ab04(0x303)],_0x31404e,_0x21facc),_0x309830=getBarChar(_0x21cb5e[_0x58ab04(0x1c6)]),_0x591d0f=Math[_0x58ab04(0x36c)](_0x36ff26+0x1,_0xd7f05e);for(let _0x45ceb2=_0x36ff26;_0x45ceb2<Math['min'](_0x591d0f,_0x21facc);_0x45ceb2++){_0x23eb78[_0x45ceb2]=_0x309830;}}const _0x507707=getBarColor(_0x21cb5e['state']),_0x470158=_0x23eb78[_0x58ab04(0x2b6)](_0xcd7191=>_0xcd7191==='\x20'?'\x20':_0x507707(_0xcd7191))[_0x58ab04(0x337)]('');return _0x52a69c+'\x20'+_0x333452+'│'+_0x470158+'│';}function calculateStats(_0x2abe66){const _0x23c7e0=a54_0x141bbb,_0x5d0734={'total':_0x2abe66[_0x23c7e0(0x1fa)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x436960 of _0x2abe66){if(_0x436960[_0x23c7e0(0x1c6)]==='success')_0x5d0734[_0x23c7e0(0x346)]++;else{if(_0x436960[_0x23c7e0(0x1c6)]===_0x23c7e0(0x2fc)||_0x436960[_0x23c7e0(0x1c6)]===_0x23c7e0(0x2ed))_0x5d0734[_0x23c7e0(0x2fc)]++;else _0x436960[_0x23c7e0(0x1c6)]===_0x23c7e0(0x295)?_0x5d0734[_0x23c7e0(0x295)]++:_0x5d0734[_0x23c7e0(0x358)]++;}}return _0x5d0734;}function formatStats(_0x2f0263){const _0x476e51=a54_0x141bbb;return[_0x476e51(0x2f1)+_0x2f0263[_0x476e51(0x2e1)],'✅\x20'+_0x2f0263[_0x476e51(0x346)],'❌\x20'+_0x2f0263[_0x476e51(0x2fc)],_0x476e51(0x264)+_0x2f0263[_0x476e51(0x295)],'⏳\x20'+_0x2f0263[_0x476e51(0x358)]][_0x476e51(0x337)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x141bbb(0x34d)]=a54_0x141bbb(0x1b7);[a54_0x141bbb(0x20b)]=a54_0x141bbb(0x1c1);async[a54_0x141bbb(0x21d)](_0x21e4d8){const _0x2ce5ff=a54_0x141bbb,{options:_0x5ec3a8,args:_0x493863,tdx:_0x311a41}=_0x21e4d8;let _0x900397,_0x5a4f19,_0x56a1c6=![];if(_0x493863[0x0]){if(_0x493863[0x0]['includes']('.')){const _0x54b827=this[_0x2ce5ff(0x25b)](_0x493863,_0x5ec3a8);if(!_0x54b827)return 0x1;_0x900397=_0x54b827[_0x2ce5ff(0x296)],_0x5a4f19=_0x54b827[_0x2ce5ff(0x31e)];}else{_0x5a4f19=_0x493863[0x0],_0x900397=_0x5ec3a8[_0x2ce5ff(0x1d8)];if(!_0x900397)return console['error'](a54_0x467bd9[_0x2ce5ff(0x2ac)](_0x2ce5ff(0x20a)),_0x2ce5ff(0x32d)),0x1;_0x56a1c6=!![];}}else{const _0x23553b=this[_0x2ce5ff(0x25b)](_0x493863,_0x5ec3a8);if(!_0x23553b)return 0x1;_0x900397=_0x23553b[_0x2ce5ff(0x296)],_0x5a4f19=_0x23553b[_0x2ce5ff(0x31e)];}if(_0x5ec3a8[_0x2ce5ff(0x2c5)]){if(_0x900397&&_0x5a4f19)console['error'](_0x2ce5ff(0x25f)+_0x900397+'.'+_0x5a4f19);else _0x900397&&console[_0x2ce5ff(0x2fc)](_0x2ce5ff(0x20e)+_0x900397);}const _0x489818=_0x5ec3a8['attemptId'],_0xa256ed=_0x5ec3a8['sessionId'];if(_0x489818){_0xa256ed&&console[_0x2ce5ff(0x2fc)](a54_0x467bd9[_0x2ce5ff(0x371)](_0x2ce5ff(0x2c4)),_0x2ce5ff(0x221));const _0x489bd7=_0x5ec3a8[_0x2ce5ff(0x2f5)];return _0x489bd7?await this[_0x2ce5ff(0x329)](_0x21e4d8,_0x489818):await this[_0x2ce5ff(0x32c)](_0x21e4d8,_0x489818,_0x5ec3a8),0x0;}if(_0xa256ed){const _0x76051c=await withSpinner(_0x2ce5ff(0x2c1),()=>_0x311a41[_0x2ce5ff(0x22f)]['sessions']({'projectName':_0x900397,'workflowName':_0x5a4f19,'limit':0x64}),{'verbose':_0x5ec3a8[_0x2ce5ff(0x2c5)]}),_0x27a01f=_0x76051c[_0x2ce5ff(0x227)][_0x2ce5ff(0x1ab)](_0x1e0a87=>_0x1e0a87['id']===_0xa256ed);if(!_0x27a01f)return console[_0x2ce5ff(0x2fc)](a54_0x467bd9[_0x2ce5ff(0x2ac)](_0x2ce5ff(0x20a)),'Session\x20not\x20found:\x20'+_0xa256ed),0x1;if(!_0x27a01f[_0x2ce5ff(0x313)]?.['id'])return console[_0x2ce5ff(0x2fc)](a54_0x467bd9[_0x2ce5ff(0x2ac)](_0x2ce5ff(0x20a)),_0x2ce5ff(0x344)+_0xa256ed+_0x2ce5ff(0x210)),0x1;const _0x1d795d=_0x27a01f[_0x2ce5ff(0x313)]['id'];_0x5ec3a8[_0x2ce5ff(0x2c5)]&&console[_0x2ce5ff(0x2fc)](_0x2ce5ff(0x286)+_0x1d795d+_0x2ce5ff(0x20f)+_0xa256ed);const _0x9a59e8=_0x5ec3a8[_0x2ce5ff(0x2f5)];return _0x9a59e8?await this[_0x2ce5ff(0x329)](_0x21e4d8,_0x1d795d):await this[_0x2ce5ff(0x32c)](_0x21e4d8,_0x1d795d,_0x5ec3a8),0x0;}const _0x182784=await withSpinner(_0x2ce5ff(0x35a),()=>_0x311a41[_0x2ce5ff(0x22f)]['sessions']({'projectName':_0x900397,'workflowName':_0x5a4f19,'limit':_0x5ec3a8['limit']||0x32}),{'verbose':_0x5ec3a8[_0x2ce5ff(0x2c5)]}),_0x42938c=_0x182784[_0x2ce5ff(0x227)];if(_0x42938c[_0x2ce5ff(0x1fa)]===0x0){if(_0x900397&&_0x5a4f19)console[_0x2ce5ff(0x2fc)]('No\x20sessions\x20found\x20for:\x20'+_0x900397+'.'+_0x5a4f19);else _0x900397?console[_0x2ce5ff(0x2fc)](_0x2ce5ff(0x235)+_0x900397):(console['error'](_0x2ce5ff(0x233)),console[_0x2ce5ff(0x2fc)](a54_0x467bd9[_0x2ce5ff(0x293)](_0x2ce5ff(0x1df))));return 0x0;}_0x42938c[_0x2ce5ff(0x2d7)]((_0x8d1081,_0x363cc7)=>{const _0x394090=_0x2ce5ff,_0x422acc=_0x8d1081[_0x394090(0x321)]||'',_0x4e0204=_0x363cc7[_0x394090(0x321)]||'';return _0x4e0204[_0x394090(0x204)](_0x422acc);});if(_0x5ec3a8[_0x2ce5ff(0x1f1)]||_0x5ec3a8[_0x2ce5ff(0x26d)])return await handleSDKOutput(_0x42938c,_0x5ec3a8),0x0;let _0x7d53f6;if(_0x56a1c6){const _0x318662=_0x42938c[0x0];if(!_0x318662['lastAttempt']?.['id'])return console[_0x2ce5ff(0x2fc)](_0x2ce5ff(0x24d)),0x0;_0x7d53f6=_0x318662[_0x2ce5ff(0x313)]['id'],_0x5ec3a8[_0x2ce5ff(0x2c5)]&&console[_0x2ce5ff(0x2fc)](_0x2ce5ff(0x1ba)+_0x318662[_0x2ce5ff(0x321)]);}else{const _0x1745ab=_0x42938c['map'](_0x40d41b=>{const _0x232230=_0x2ce5ff,_0x39ffd3=getAttemptStatusDisplay(_0x40d41b[_0x232230(0x313)]);return{'title':_0x40d41b[_0x232230(0x250)]?.['name']+'.'+_0x40d41b[_0x232230(0x22f)]?.[_0x232230(0x34d)]+_0x232230(0x1db)+_0x40d41b[_0x232230(0x321)]+'\x20'+_0x39ffd3[_0x232230(0x377)],'value':_0x40d41b[_0x232230(0x313)]?.['id']||'','description':_0x39ffd3[_0x232230(0x1e0)]};}),_0x2889a5=await a54_0x20ee9d({'type':_0x2ce5ff(0x1f6),'name':_0x2ce5ff(0x2f0),'message':_0x2ce5ff(0x1c9),'choices':_0x1745ab[_0x2ce5ff(0x1fe)](_0x4dbe19=>_0x4dbe19['value']!=='')});if(!_0x2889a5[_0x2ce5ff(0x2f0)])return 0x0;_0x7d53f6=_0x2889a5[_0x2ce5ff(0x2f0)];}const _0xe35408=_0x5ec3a8[_0x2ce5ff(0x2f5)];return _0xe35408?await this[_0x2ce5ff(0x329)](_0x21e4d8,_0x7d53f6):await this[_0x2ce5ff(0x32c)](_0x21e4d8,_0x7d53f6,_0x5ec3a8),0x0;}async[a54_0x141bbb(0x32c)](_0x6162b,_0x46e257,_0x10509c){const _0x50046c=a54_0x141bbb,{tdx:_0x1ada31}=_0x6162b;let _0x37d43b,_0x59a441;try{[_0x37d43b,_0x59a441]=await Promise[_0x50046c(0x36b)]([_0x1ada31['workflow'][_0x50046c(0x366)](_0x46e257),_0x1ada31[_0x50046c(0x22f)]['tasks'](_0x46e257,![])]);}catch(_0x449022){console[_0x50046c(0x2fc)](a54_0x467bd9[_0x50046c(0x2ac)](_0x50046c(0x252)));_0x10509c[_0x50046c(0x2c5)]&&console[_0x50046c(0x2fc)](_0x449022);throw _0x449022;}if(_0x10509c['json']||_0x10509c[_0x50046c(0x26d)]){const _0x57e00e=this['buildTimelineData'](_0x37d43b,_0x59a441);await handleSDKOutput([_0x57e00e],_0x10509c);return;}const _0x1602fc=_0x1ada31[_0x50046c(0x305)][_0x50046c(0x1f4)],_0x432f3b=this[_0x50046c(0x1d0)](_0x37d43b,_0x59a441,_0x1602fc);console[_0x50046c(0x2b9)](_0x432f3b);}async[a54_0x141bbb(0x329)](_0x5364ed,_0x193ec9){const _0x4adde4=a54_0x141bbb,{tdx:_0x3c0a5f}=_0x5364ed,_0x4949d3=TIMELINE_CONFIG[_0x4adde4(0x2b3)],_0x2463c9=TIMELINE_CONFIG[_0x4adde4(0x1c3)];let _0x2f2d99=0x0;while(_0x2f2d99<_0x2463c9){process[_0x4adde4(0x324)][_0x4adde4(0x1ad)]&&process['stdout'][_0x4adde4(0x1ee)]('\x1bc');let _0x54f94c,_0x568f7;try{[_0x54f94c,_0x568f7]=await Promise['all']([_0x3c0a5f[_0x4adde4(0x22f)]['attempt'](_0x193ec9),_0x3c0a5f[_0x4adde4(0x22f)][_0x4adde4(0x285)](_0x193ec9,![])]);}catch(_0x59d0b8){console[_0x4adde4(0x2fc)](a54_0x467bd9['red'](_0x4adde4(0x205)));_0x2f2d99>0x0&&console[_0x4adde4(0x2fc)](a54_0x467bd9[_0x4adde4(0x293)](_0x4adde4(0x257)+_0x2f2d99));throw _0x59d0b8;}const _0x194f6a=_0x3c0a5f[_0x4adde4(0x305)][_0x4adde4(0x1f4)],_0x5bc4c2=this[_0x4adde4(0x1d0)](_0x54f94c,_0x568f7,_0x194f6a);console[_0x4adde4(0x2b9)](_0x5bc4c2);const _0x64ebc5=_0x54f94c[_0x4adde4(0x22e)]&&_0x568f7[_0x4adde4(0x215)](_0x43c2fb=>_0x43c2fb[_0x4adde4(0x1c6)]!==_0x4adde4(0x295)&&_0x43c2fb[_0x4adde4(0x1c6)]!==_0x4adde4(0x27f));if(_0x64ebc5){console[_0x4adde4(0x2fc)](a54_0x467bd9[_0x4adde4(0x20d)](_0x4adde4(0x23b)));break;}console[_0x4adde4(0x2fc)](a54_0x467bd9['dim'](_0x4adde4(0x23e)+_0x2f2d99*0x2+_0x4adde4(0x379))),await new Promise(_0x28f2ab=>setTimeout(_0x28f2ab,_0x4949d3)),_0x2f2d99++;}_0x2f2d99>=_0x2463c9&&console[_0x4adde4(0x2fc)](a54_0x467bd9[_0x4adde4(0x371)](_0x4adde4(0x2bb)));}[a54_0x141bbb(0x1d0)](_0x5878b2,_0x5ec9cc,_0xfcb382){const _0x500dbb=a54_0x141bbb,_0xa09992=[],_0x27b8a9=TIMELINE_CONFIG[_0x500dbb(0x20c)],_0x15a7a1=0x5,_0x2f83bc=process[_0x500dbb(0x324)][_0x500dbb(0x1cc)]||0x78,_0x215742=_0x2f83bc-_0x27b8a9-_0x15a7a1,_0x20e235=Math[_0x500dbb(0x36c)](TIMELINE_CONFIG[_0x500dbb(0x339)],Math['min'](_0x215742,TIMELINE_CONFIG[_0x500dbb(0x2e8)])),_0x378f9d=new Date(_0x5878b2[_0x500dbb(0x36f)])[_0x500dbb(0x2f4)](),_0x6fada=_0x5878b2[_0x500dbb(0x2a7)]?new Date(_0x5878b2[_0x500dbb(0x2a7)])[_0x500dbb(0x2f4)]():Date['now'](),_0x822462={'start':_0x378f9d,'end':_0x6fada,'duration':_0x6fada-_0x378f9d},_0x5ca56d=new Map(),_0x3f88a7=[];for(const _0x580d7e of _0x5ec9cc){if(_0x580d7e[_0x500dbb(0x25d)]){const _0x32b270=new Date(_0x580d7e['startedAt'])['getTime'](),_0x5d85b0=_0x580d7e['updatedAt']?new Date(_0x580d7e[_0x500dbb(0x217)])[_0x500dbb(0x2f4)]():Date[_0x500dbb(0x2b2)](),_0x5502f1={'start':_0x32b270,'end':_0x5d85b0,'duration':_0x5d85b0-_0x32b270};_0x5ca56d[_0x500dbb(0x1dc)](_0x580d7e['id'],_0x5502f1),_0x3f88a7[_0x500dbb(0x1be)]({'name':_0x580d7e[_0x500dbb(0x242)],'state':_0x580d7e[_0x500dbb(0x1c6)]||_0x500dbb(0x206),'window':_0x5502f1});}else _0x3f88a7['push']({'name':_0x580d7e[_0x500dbb(0x242)],'state':_0x580d7e[_0x500dbb(0x1c6)]||_0x500dbb(0x27f),'window':undefined});}_0x3f88a7[_0x500dbb(0x2d7)]((_0x1967a6,_0x29f6c6)=>{const _0x1cfc6b=_0x500dbb;if(!_0x1967a6[_0x1cfc6b(0x26a)])return 0x1;if(!_0x29f6c6[_0x1cfc6b(0x26a)])return-0x1;return _0x1967a6['window'][_0x1cfc6b(0x1ed)]-_0x29f6c6['window']['start'];});const _0x233a45=_0x3f88a7[_0x500dbb(0x1fa)],_0x229529=_0x233a45>TIMELINE_CONFIG[_0x500dbb(0x1e2)];_0x229529&&_0x3f88a7['splice'](TIMELINE_CONFIG[_0x500dbb(0x1e2)]);const _0x471e3d=calculateTimeScale(_0x822462,_0x20e235),_0x2edaaa=_0x5878b2[_0x500dbb(0x22e)]?_0x5878b2[_0x500dbb(0x346)]?a54_0x467bd9[_0x500dbb(0x20d)](_0x500dbb(0x346)):a54_0x467bd9[_0x500dbb(0x2ac)](_0x500dbb(0x2fc)):a54_0x467bd9[_0x500dbb(0x370)](_0x500dbb(0x295)),_0x5e9ffb=_0x5878b2['project']?.['id'],_0x32756d=_0x5878b2[_0x500dbb(0x223)];let _0x55146c;if(_0x5e9ffb&&_0x32756d){const _0x3833a2=getWorkflowAttemptUrl(_0xfcb382,_0x5e9ffb,_0x32756d,_0x5878b2['id']);_0x55146c=hyperlink(a54_0x467bd9['dim'](_0x5878b2['id']),_0x3833a2);}else _0x55146c=a54_0x467bd9[_0x500dbb(0x293)](_0x5878b2['id']);_0xa09992[_0x500dbb(0x1be)]('Attempt:\x20'+_0x55146c+_0x500dbb(0x1db)+_0x2edaaa+'\x20-\x20'+formatElapsed(_0x822462['duration']));if(_0x3f88a7['length']>0x0){const _0x19ea88=renderTimeAxis(_0x471e3d,_0x20e235),_0x1941c2=new Date(_0x822462[_0x500dbb(0x1ed)]),_0xc24c6c=formatDate(_0x1941c2),_0xcca4d2=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x500dbb(0x1ce)]+_0x27b8a9,_0x21aa52=_0xc24c6c[_0x500dbb(0x261)](_0xcca4d2),_0x434d66=a54_0x467bd9[_0x500dbb(0x293)](_0x21aa52);_0xa09992['push'](_0x434d66+'\x20'+_0x19ea88);for(const _0x1f7e33 of _0x3f88a7){_0xa09992['push'](renderTaskRow(_0x1f7e33,_0x471e3d,_0x20e235,_0x27b8a9));}const _0x62dc74=calculateStats(_0x3f88a7);_0xa09992[_0x500dbb(0x1be)](formatStats(_0x62dc74)),_0x229529&&_0xa09992[_0x500dbb(0x1be)](a54_0x467bd9[_0x500dbb(0x371)](_0x500dbb(0x364)+TIMELINE_CONFIG[_0x500dbb(0x1e2)]+_0x500dbb(0x1e9)+_0x233a45+_0x500dbb(0x1e3))),_0xa09992[_0x500dbb(0x1be)](''),_0xa09992[_0x500dbb(0x1be)](a54_0x467bd9[_0x500dbb(0x293)](_0x500dbb(0x21b))+(_0x500dbb(0x2eb)+_0x5878b2['id']+'\x20logs')+a54_0x467bd9[_0x500dbb(0x293)](_0x500dbb(0x2d6)));}else _0xa09992['push'](_0x500dbb(0x30e));return _0xa09992[_0x500dbb(0x337)]('\x0a');}[a54_0x141bbb(0x375)](_0x29032d,_0xa9438d){const _0x43497f=a54_0x141bbb,_0x1f3bb6=new Date(_0x29032d[_0x43497f(0x36f)])[_0x43497f(0x2f4)](),_0x56596c=_0x29032d[_0x43497f(0x2a7)]?new Date(_0x29032d['finishedAt'])[_0x43497f(0x2f4)]():Date[_0x43497f(0x2b2)](),_0x12d642=_0x56596c-_0x1f3bb6,_0x26903d=[];for(const _0x15e872 of _0xa9438d){if(_0x15e872[_0x43497f(0x25d)]){const _0x2faa75=new Date(_0x15e872['startedAt'])[_0x43497f(0x2f4)](),_0xcb67a9=_0x15e872[_0x43497f(0x217)]?new Date(_0x15e872[_0x43497f(0x217)])['getTime']():Date[_0x43497f(0x2b2)]();_0x26903d[_0x43497f(0x1be)]({'name':_0x15e872[_0x43497f(0x242)],'state':_0x15e872[_0x43497f(0x1c6)]||_0x43497f(0x206),'window':{'start':_0x2faa75,'end':_0xcb67a9,'duration':_0xcb67a9-_0x2faa75}});}else _0x26903d[_0x43497f(0x1be)]({'name':_0x15e872[_0x43497f(0x242)],'state':_0x15e872[_0x43497f(0x1c6)]||'planned','window':undefined});}const _0x19ee2e=calculateStats(_0x26903d);return{'attempt':{'id':_0x29032d['id'],'status':_0x29032d[_0x43497f(0x22e)]?_0x29032d[_0x43497f(0x346)]?'success':_0x43497f(0x2fc):_0x43497f(0x295),'createdAt':_0x29032d['createdAt'],'finishedAt':_0x29032d[_0x43497f(0x2a7)],'duration_ms':_0x12d642},'tasks':_0x26903d[_0x43497f(0x2b6)](_0x202cdc=>({'name':_0x202cdc[_0x43497f(0x34d)],'state':_0x202cdc[_0x43497f(0x1c6)],'startedAt':_0x202cdc[_0x43497f(0x26a)]?new Date(_0x202cdc[_0x43497f(0x26a)]['start'])[_0x43497f(0x2b8)]():null,'updatedAt':_0x202cdc['window']?new Date(_0x202cdc[_0x43497f(0x26a)][_0x43497f(0x303)])[_0x43497f(0x2b8)]():null,'duration_ms':_0x202cdc['window']?.[_0x43497f(0x351)]||null})),'stats':_0x19ee2e};}}export class WorkflowSchedulesCommand extends BaseCommand{[a54_0x141bbb(0x34d)]=a54_0x141bbb(0x1b1);[a54_0x141bbb(0x20b)]=a54_0x141bbb(0x1b2);async['execute'](_0xbd47f2){const _0x4e2fce=a54_0x141bbb,{options:_0x2487d9,tdx:_0x19aea8}=_0xbd47f2,_0x59a0e2=await withSpinner(_0x4e2fce(0x2f7),()=>_0x19aea8[_0x4e2fce(0x22f)][_0x4e2fce(0x308)](),{'verbose':_0x2487d9[_0x4e2fce(0x2c5)]}),_0x2a78f3=_0x59a0e2['data'];console['error']('✔\x20Found\x20'+_0x2a78f3[_0x4e2fce(0x1fa)]+_0x4e2fce(0x373)+(_0x2a78f3[_0x4e2fce(0x1fa)]!==0x1?'s':''));if(isStructuredFormat(_0x2487d9))await handleSDKOutput(_0x2a78f3,_0x2487d9);else{if(_0x2a78f3[_0x4e2fce(0x1fa)]===0x0)console[_0x4e2fce(0x2b9)](_0x4e2fce(0x282));else for(const _0x12a99f of _0x2a78f3){const _0x2176b1=_0x12a99f['disabledAt']?a54_0x467bd9[_0x4e2fce(0x371)]('\x20(disabled)'):'',_0x5dfdb1=_0x12a99f['project']?.['name']?a54_0x467bd9['dim']('\x20['+_0x12a99f[_0x4e2fce(0x250)]['name']+']'):'',_0x3eb806=_0x12a99f[_0x4e2fce(0x348)]?a54_0x467bd9['dim'](_0x4e2fce(0x278)+new Date(_0x12a99f['nextRunTime'])[_0x4e2fce(0x265)]()):'';console[_0x4e2fce(0x2b9)]('📅\x20#'+_0x12a99f['id']+'\x20'+(_0x12a99f[_0x4e2fce(0x22f)]?.[_0x4e2fce(0x34d)]||_0x4e2fce(0x29d))+_0x5dfdb1+_0x2176b1+_0x3eb806);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a54_0x141bbb(0x34d)]=a54_0x141bbb(0x31d);[a54_0x141bbb(0x20b)]=a54_0x141bbb(0x1e8);async[a54_0x141bbb(0x21d)](_0x441fa6){const _0x5e28cc=a54_0x141bbb,{options:_0x11aa0b,args:_0x9f3baa,tdx:_0x4e24a4}=_0x441fa6,_0x81723d=_0x9f3baa[0x0];if(!_0x81723d)return console[_0x5e28cc(0x2fc)](a54_0x467bd9[_0x5e28cc(0x2ac)](_0x5e28cc(0x20a)),_0x5e28cc(0x203)),console[_0x5e28cc(0x2fc)](a54_0x467bd9[_0x5e28cc(0x293)](_0x5e28cc(0x207))),console[_0x5e28cc(0x2fc)](a54_0x467bd9[_0x5e28cc(0x293)](_0x5e28cc(0x211))),0x1;const _0x588dd6=await withSpinner(_0x5e28cc(0x316)+_0x81723d+'...',()=>_0x4e24a4[_0x5e28cc(0x22f)]['enableSchedule'](_0x81723d),{'verbose':_0x11aa0b[_0x5e28cc(0x2c5)]}),_0x5d6644=_0x588dd6[_0x5e28cc(0x227)];return isStructuredFormat(_0x11aa0b)?await handleSingleObjectOutput(_0x5d6644,_0x11aa0b):(console[_0x5e28cc(0x2b9)]('✔\x20Schedule\x20#'+_0x81723d+'\x20enabled\x20('+(_0x5d6644['workflow']?.[_0x5e28cc(0x34d)]||'unknown')+')'),_0x5d6644[_0x5e28cc(0x348)]&&console['log'](a54_0x467bd9[_0x5e28cc(0x293)](_0x5e28cc(0x2df)+new Date(_0x5d6644[_0x5e28cc(0x348)])['toLocaleString']()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a54_0x141bbb(0x34d)]=a54_0x141bbb(0x23c);[a54_0x141bbb(0x20b)]='Disable\x20a\x20workflow\x20schedule';async[a54_0x141bbb(0x21d)](_0x49db29){const _0x33f6da=a54_0x141bbb,{options:_0x270659,args:_0x42732d,tdx:_0x7cd318}=_0x49db29,_0x8ecdfb=_0x42732d[0x0];if(!_0x8ecdfb)return console[_0x33f6da(0x2fc)](a54_0x467bd9[_0x33f6da(0x2ac)](_0x33f6da(0x20a)),_0x33f6da(0x203)),console[_0x33f6da(0x2fc)](a54_0x467bd9[_0x33f6da(0x293)](_0x33f6da(0x2ae))),console[_0x33f6da(0x2fc)](a54_0x467bd9[_0x33f6da(0x293)]('Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs')),0x1;const _0xa604ef=await withSpinner(_0x33f6da(0x279)+_0x8ecdfb+'...',()=>_0x7cd318[_0x33f6da(0x22f)][_0x33f6da(0x2ad)](_0x8ecdfb),{'verbose':_0x270659[_0x33f6da(0x2c5)]}),_0x316c7c=_0xa604ef[_0x33f6da(0x227)];return isStructuredFormat(_0x270659)?await handleSingleObjectOutput(_0x316c7c,_0x270659):console[_0x33f6da(0x2b9)](_0x33f6da(0x35f)+_0x8ecdfb+_0x33f6da(0x1b3)+(_0x316c7c['workflow']?.[_0x33f6da(0x34d)]||_0x33f6da(0x206))+')'),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x33f051,_0xf9053d){const _0x5b5ac9=a55_0x4e4b,_0x15c409=_0x33f051();while(!![]){try{const _0x2e8748=-parseInt(_0x5b5ac9(0xbe))/0x1+parseInt(_0x5b5ac9(0xbb))/0x2+-parseInt(_0x5b5ac9(0xc0))/0x3*(-parseInt(_0x5b5ac9(0xbd))/0x4)+parseInt(_0x5b5ac9(0xc5))/0x5*(parseInt(_0x5b5ac9(0xb7))/0x6)+parseInt(_0x5b5ac9(0xb6))/0x7+-parseInt(_0x5b5ac9(0xc8))/0x8+parseInt(_0x5b5ac9(0xc7))/0x9*(-parseInt(_0x5b5ac9(0xb9))/0xa);if(_0x2e8748===_0xf9053d)break;else _0x15c409['push'](_0x15c409['shift']());}catch(_0x644b91){_0x15c409['push'](_0x15c409['shift']());}}}(a55_0x2117,0x72911));function a55_0x2117(){const _0x4e604f=['1696740ZBOsZZ','X-Trino-User','832cmxpRS','350406GuqVaR','TD1\x20','3273yZtqGi','Bearer\x20','Authorization','version','tdx','181825jeDtGc','tdx/','460557rdjnxt','4390424bXgtDu',';\x20node/','3248861gMruHv','90OfylxX','replace','140eHnxTH','entries'];a55_0x2117=function(){return _0x4e604f;};return a55_0x2117();}import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a55_0x4e4b(_0x5e2bd9,_0x1a3cad){_0x5e2bd9=_0x5e2bd9-0xb5;const _0x211704=a55_0x2117();let _0x4e4bbc=_0x211704[_0x5e2bd9];return _0x4e4bbc;}export function getUserAgent(){const _0x1439df=a55_0x4e4b,_0x501c81=getVersion(),_0x36351f=platform(),_0x29386e=process[_0x1439df(0xc3)][_0x1439df(0xb8)]('v','');return _0x1439df(0xc6)+_0x501c81+'\x20('+_0x36351f+_0x1439df(0xb5)+_0x29386e+')';}export function getAuthHeaders(_0x221b74,_0x8f46aa,_0x5edb99){const _0x46e14c=a55_0x4e4b,_0x3bb654=getVersion(),_0x3b2db0={'User-Agent':getUserAgent(),'X-TD-Client':_0x46e14c(0xc4),'X-TD-Client-Version':_0x3bb654};if(_0x5edb99)_0x3b2db0[_0x46e14c(0xc2)]=_0x46e14c(0xc1)+_0x5edb99;else _0x8f46aa&&(_0x3b2db0['Authorization']=_0x46e14c(0xbf)+_0x8f46aa);return _0x3b2db0;}export function toHeaderRecord(_0x22dfdd){const _0x37f059=a55_0x4e4b,_0x1a3cae={};for(const [_0x6e81e9,_0x560c65]of Object[_0x37f059(0xba)](_0x22dfdd)){_0x560c65!==undefined&&(_0x1a3cae[_0x6e81e9]=_0x560c65);}return _0x1a3cae;}export function getTrinoHeaders(_0x118693,_0x7b85d0,_0x4e9872){const _0xf59389=a55_0x4e4b,_0x1d0f72=getAuthHeaders(_0x118693),_0x2aa039=toHeaderRecord(_0x1d0f72);if(_0x4e9872)_0x2aa039[_0xf59389(0xc2)]='Bearer\x20'+_0x4e9872;else _0x7b85d0&&(_0x2aa039[_0xf59389(0xbc)]=_0x7b85d0);return _0x2aa039;}export function hasAPIKey(_0x51a93e){const _0x2ca81a=getAPIKey();return _0x2ca81a!==undefined&&_0x2ca81a['length']>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(_0x557872,_0x542f31){const _0x2bf76b=a56_0x2890,_0x46c47f=_0x557872();while(!![]){try{const _0x4ef99b=parseInt(_0x2bf76b(0x173))/0x1+parseInt(_0x2bf76b(0x152))/0x2+-parseInt(_0x2bf76b(0x141))/0x3*(parseInt(_0x2bf76b(0x154))/0x4)+parseInt(_0x2bf76b(0x160))/0x5+-parseInt(_0x2bf76b(0x169))/0x6*(parseInt(_0x2bf76b(0x166))/0x7)+-parseInt(_0x2bf76b(0x161))/0x8+parseInt(_0x2bf76b(0x13e))/0x9*(parseInt(_0x2bf76b(0x16e))/0xa);if(_0x4ef99b===_0x542f31)break;else _0x46c47f['push'](_0x46c47f['shift']());}catch(_0x41287b){_0x46c47f['push'](_0x46c47f['shift']());}}}(a56_0x2557,0x889a3));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_0x24d67e from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x25f144){const _0x87f1ad=a56_0x2890;return _0x25f144[_0x87f1ad(0x15a)]===_0x87f1ad(0x13a)||_0x25f144[_0x87f1ad(0x15a)]===_0x87f1ad(0x13c)||_0x25f144[_0x87f1ad(0x15a)]==='tsv'||_0x25f144[_0x87f1ad(0x15a)]==='table'||_0x25f144[_0x87f1ad(0x13a)]===!![]||_0x25f144[_0x87f1ad(0x13c)]===!![]||_0x25f144['tsv']===!![]||_0x25f144[_0x87f1ad(0x16f)]===!![];}export function parseOutputOptions(_0x45a0e4){const _0x53e59c=a56_0x2890;return{'format':_0x45a0e4[_0x53e59c(0x15a)]||_0x53e59c(0x16f),'output':_0x45a0e4[_0x53e59c(0x14b)]||'','limit':_0x45a0e4[_0x53e59c(0x13f)],'limitStructuredFormats':_0x45a0e4[_0x53e59c(0x171)],'color':_0x45a0e4[_0x53e59c(0x15f)],'noColor':_0x45a0e4['noColor']};}function convertSDKResultToQueryResult(_0x1dd42a){const _0x108976=a56_0x2890,_0x481357=[];if(_0x1dd42a['length']>0x0){const _0x5cc7b4=_0x1dd42a[0x0];for(const [_0x4ad1a7,_0x19a645]of Object[_0x108976(0x177)](_0x5cc7b4)){let _0x281563=_0x108976(0x14d);if(typeof _0x19a645==='number')_0x281563=Number[_0x108976(0x13b)](_0x19a645)?_0x108976(0x138):_0x108976(0x145);else{if(typeof _0x19a645===_0x108976(0x15c))_0x281563=_0x108976(0x15c);else _0x19a645===null&&(_0x281563=_0x108976(0x14d));}_0x481357['push']({'name':_0x4ad1a7,'type':_0x281563});}}return{'queryId':'sdk-result','columns':_0x481357,'data':_0x1dd42a,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x1dd42a[_0x108976(0x13d)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}function a56_0x2557(){const _0x37bc52=['length','13599162oKxGTz','limit','object','81tWzJcV','[rule]','stdout','stringify','double','padEnd','[error]','log','params','No\x20data','output','[Object]','varchar','keys','cmdout','filter','stderr','1513500mbPDeY','write','107908wIZJVl','forEach','noColor','bold','map','string','format','max','boolean','[params]','cyan','color','72430icoDyf','6299624SGABds','list','data','end','less','7jAANON','red','join','6275958aXgSFz','rule','resolve','─┴─','repeat','10hukLMK','table','split','limitStructuredFormats','error','839094zryehz','push','spawn','inherit','entries','stdin','query','number','slice','─┬─','trim','isTTY','tsv','bigint','debug','json','isInteger','jsonl'];a56_0x2557=function(){return _0x37bc52;};return a56_0x2557();}export async function formatSDKOutput(_0x1a1e1f,_0x32f33d){const _0x2d4eb6=convertSDKResultToQueryResult(_0x1a1e1f);return formatQueryOutput(_0x2d4eb6,_0x32f33d);}function a56_0x2890(_0x3cd959,_0x11abfb){_0x3cd959=_0x3cd959-0x138;const _0x25574e=a56_0x2557();let _0x2890da=_0x25574e[_0x3cd959];return _0x2890da;}export async function formatQueryOutput(_0x54d06f,_0x1d5819){const _0x1f41a3=a56_0x2890,{format:_0x20f62a,limit:_0x57b631,output:_0x381030,color:_0x329ca2,noColor:_0x44667f,limitStructuredFormats:_0x4238b7}=_0x1d5819,_0xf1ca5c=Boolean(_0x381030)&&!_0x329ca2,_0x2a357e={'color':_0x329ca2,'noColor':_0x44667f||_0xf1ca5c};if(_0x20f62a==='table'){const _0x582970=shouldUseLess(_0x20f62a,_0x381030);return formatAsTable(_0x54d06f,_0x57b631,_0x582970,_0x2a357e);}const _0x495e1f=_0x4238b7&&Number['isFinite'](_0x57b631)&&_0x54d06f[_0x1f41a3(0x163)][_0x1f41a3(0x13d)]>_0x57b631?{..._0x54d06f,'data':_0x54d06f[_0x1f41a3(0x163)][_0x1f41a3(0x17b)](0x0,_0x57b631)}:_0x54d06f;if(_0x20f62a===_0x1f41a3(0x13a))return formatAsJSON(_0x495e1f,_0x2a357e);else return _0x20f62a===_0x1f41a3(0x13c)?formatAsJSONL(_0x495e1f,_0x2a357e):formatQueryResult(_0x495e1f,_0x20f62a);}function shouldUseLess(_0x4e2af2,_0x5c1b54){const _0x589298=a56_0x2890;return(_0x4e2af2===_0x589298(0x16f)||_0x4e2af2===_0x589298(0x162))&&process[_0x589298(0x143)][_0x589298(0x17e)]&&!_0x5c1b54;}export function resolveOutputOptions(_0x358b1d){const _0x13a096=a56_0x2890,_0x59a8a1=_0x358b1d[_0x13a096(0x14b)]||'',_0x3365d0=resolveOutputFormat(_0x358b1d['format'],_0x59a8a1,'table');let _0xda341e=typeof _0x358b1d[_0x13a096(0x13f)]===_0x13a096(0x17a)?_0x358b1d[_0x13a096(0x13f)]:parseInt(_0x358b1d[_0x13a096(0x13f)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x358b1d[_0x13a096(0x13f)]===undefined&&shouldUseLess(_0x3365d0,_0x59a8a1)&&(_0xda341e=Infinity),{'format':_0x3365d0,'output':_0x59a8a1,'limit':_0xda341e,'limitStructuredFormats':_0x358b1d[_0x13a096(0x171)],'color':_0x358b1d[_0x13a096(0x15f)],'noColor':_0x358b1d[_0x13a096(0x156)]};}export function writeOutput(_0x504964,_0x332559,_0x2f2a94){const _0x5b32c2=a56_0x2890;return _0x332559?(writeFileSync(_0x332559,_0x504964),console[_0x5b32c2(0x172)]('Results\x20saved\x20to\x20'+_0x332559),Promise[_0x5b32c2(0x16b)]()):shouldUseLess(_0x2f2a94||'','')?new Promise(_0x304bc2=>{const _0x50a490=_0x5b32c2,_0x3e49d2=spawn(_0x50a490(0x165),['-FXRSn'],{'stdio':['pipe',_0x50a490(0x176),'inherit']});let _0x12d49b=![];_0x3e49d2['on']('error',()=>{const _0x5630d4=_0x50a490;!_0x12d49b&&(_0x12d49b=!![],console[_0x5630d4(0x148)](_0x504964),_0x304bc2());}),_0x3e49d2['on']('close',()=>{!_0x12d49b&&(_0x12d49b=!![],_0x304bc2());}),_0x3e49d2['on'](_0x50a490(0x175),()=>{const _0x224754=_0x50a490;!_0x12d49b&&_0x3e49d2[_0x224754(0x178)]&&(_0x3e49d2[_0x224754(0x178)]['on'](_0x224754(0x172),()=>{}),_0x3e49d2[_0x224754(0x178)][_0x224754(0x153)](_0x504964),_0x3e49d2['stdin'][_0x224754(0x164)]());}),!_0x3e49d2[_0x50a490(0x178)]&&(!_0x12d49b&&(_0x12d49b=!![],console['log'](_0x504964),_0x304bc2()));}):(console[_0x5b32c2(0x148)](_0x504964),Promise[_0x5b32c2(0x16b)]());}export async function handleSDKOutput(_0x528363,_0xc7d44e){const _0xa29670=a56_0x2890,_0x4d9eae=resolveOutputOptions(_0xc7d44e),_0x4d379f=await formatSDKOutput(_0x528363,_0x4d9eae);await writeOutput(_0x4d379f,_0x4d9eae['output']||undefined,_0x4d9eae[_0xa29670(0x15a)]);}export async function handleQueryOutput(_0x19b0c7,_0x124877){const _0x2bd492=a56_0x2890,_0x1395cd=resolveOutputOptions(_0x124877),_0x294265=await formatQueryOutput(_0x19b0c7,_0x1395cd);await writeOutput(_0x294265,_0x1395cd[_0x2bd492(0x14b)]||undefined,_0x1395cd[_0x2bd492(0x15a)]);}async function formatSingleObject(_0x33d22b,_0x324267){const _0x311204=a56_0x2890,{format:_0x546a48,color:_0x2d842a,noColor:_0x5b4b94}=_0x324267,_0x184cd2={'color':_0x2d842a,'noColor':_0x5b4b94};if(_0x546a48===_0x311204(0x13a)){if(shouldUseColor(_0x184cd2))return colorizeJSON(_0x33d22b,_0x184cd2);return JSON[_0x311204(0x144)](_0x33d22b,null,0x2);}else{if(_0x546a48===_0x311204(0x13c)){if(shouldUseColor(_0x184cd2))return colorizeJSONCompact(_0x33d22b,_0x184cd2);return JSON['stringify'](_0x33d22b);}else{if(_0x546a48===_0x311204(0x17f))return Object[_0x311204(0x177)](_0x33d22b)['map'](([_0x227a83,_0x26937d])=>_0x227a83+'\x09'+_0x26937d)[_0x311204(0x168)]('\x0a');else{const _0x36230f=Object[_0x311204(0x177)](_0x33d22b);if(_0x36230f[_0x311204(0x13d)]===0x0)return _0x311204(0x14a);const _0x259eb5=_0x33d22b[_0x311204(0x139)],_0x4b4183=_0x33d22b[_0x311204(0x179)],_0x4c4711=_0x33d22b[_0x311204(0x149)],_0xa13190=_0x33d22b[_0x311204(0x16a)],_0x4183da=_0x4b4183?typeof _0x4b4183===_0x311204(0x159)?_0x4b4183:JSON[_0x311204(0x144)](_0x4b4183,null,0x2):undefined,_0x18dd96=_0x4c4711&&Object[_0x311204(0x14e)](_0x4c4711)[_0x311204(0x13d)]>0x0?JSON[_0x311204(0x144)](_0x4c4711,null,0x2):undefined,_0x277f9c=_0xa13190&&Object[_0x311204(0x14e)](_0xa13190)[_0x311204(0x13d)]>0x0?JSON[_0x311204(0x144)](_0xa13190,null,0x2):undefined,_0x1b51c7=_0x36230f[_0x311204(0x150)](([_0x2694c5])=>_0x2694c5!=='debug'&&_0x2694c5!==_0x311204(0x179)&&_0x2694c5!==_0x311204(0x149)&&_0x2694c5!==_0x311204(0x16a)),_0x415244=Math[_0x311204(0x15b)](..._0x1b51c7['map'](([_0x33d37c])=>_0x33d37c[_0x311204(0x13d)])),_0x351957=Math[_0x311204(0x15b)](..._0x1b51c7[_0x311204(0x158)](([,_0x8223eb])=>{const _0x3a2e8c=_0x311204;try{const _0x405c38=_0x8223eb===null||_0x8223eb===undefined?'':typeof _0x8223eb===_0x3a2e8c(0x140)?JSON[_0x3a2e8c(0x144)](_0x8223eb):String(_0x8223eb),_0x45eb82=_0x405c38[_0x3a2e8c(0x170)]('\x0a');return Math[_0x3a2e8c(0x15b)](..._0x45eb82[_0x3a2e8c(0x158)](_0x41f574=>_0x41f574[_0x3a2e8c(0x13d)]),0x0);}catch{return 0x0;}}),0x14),_0x10e09d=[];_0x10e09d[_0x311204(0x174)](colorBorder('┌─'+'─'[_0x311204(0x16d)](_0x415244)+_0x311204(0x17c)+'─'['repeat'](_0x351957)+'─┐',_0x184cd2)),_0x1b51c7['forEach'](([_0x2e9a4a,_0x1a33b3])=>{const _0x8ba84b=_0x311204;let _0x27375e;try{_0x27375e=_0x1a33b3===null||_0x1a33b3===undefined?'':typeof _0x1a33b3===_0x8ba84b(0x140)?JSON[_0x8ba84b(0x144)](_0x1a33b3):String(_0x1a33b3);}catch{_0x27375e=_0x8ba84b(0x14c);}const _0x1f70aa=_0x2e9a4a[_0x8ba84b(0x146)](_0x415244),_0x4eaf86=_0x27375e[_0x8ba84b(0x170)]('\x0a');_0x4eaf86[_0x8ba84b(0x155)]((_0x5ab270,_0x3e2b5b)=>{const _0x18763d=_0x8ba84b,_0x70ba57=colorBorder('│',_0x184cd2);_0x3e2b5b===0x0?_0x10e09d[_0x18763d(0x174)](_0x70ba57+'\x20'+_0x1f70aa+'\x20'+_0x70ba57+'\x20'+_0x5ab270[_0x18763d(0x146)](_0x351957)+'\x20'+_0x70ba57):_0x10e09d['push'](_0x70ba57+'\x20'+'\x20'['repeat'](_0x415244)+'\x20'+_0x70ba57+'\x20'+_0x5ab270[_0x18763d(0x146)](_0x351957)+'\x20'+_0x70ba57);});}),_0x10e09d[_0x311204(0x174)](colorBorder('└─'+'─'['repeat'](_0x415244)+_0x311204(0x16c)+'─'['repeat'](_0x351957)+'─┘',_0x184cd2));_0x4183da&&(_0x10e09d[_0x311204(0x174)](''),_0x10e09d['push'](String(a56_0x24d67e['yellow'][_0x311204(0x157)]('[query]'))),_0x10e09d[_0x311204(0x174)](_0x4183da));_0x18dd96&&(_0x10e09d[_0x311204(0x174)](''),_0x10e09d[_0x311204(0x174)](String(a56_0x24d67e['blue'][_0x311204(0x157)](_0x311204(0x15d)))),_0x10e09d[_0x311204(0x174)](_0x18dd96));_0x277f9c&&(_0x10e09d[_0x311204(0x174)](''),_0x10e09d[_0x311204(0x174)](String(a56_0x24d67e['magenta'][_0x311204(0x157)](_0x311204(0x142)))),_0x10e09d[_0x311204(0x174)](_0x277f9c));if(_0x259eb5){if(_0x259eb5['stderr']){_0x10e09d['push'](''),_0x10e09d[_0x311204(0x174)](String(a56_0x24d67e[_0x311204(0x167)]['bold'](_0x311204(0x147))));const _0x2eb386=_0x259eb5[_0x311204(0x151)]['split']('\x0a');_0x2eb386[_0x311204(0x155)](_0x2636ef=>{const _0x268b14=_0x311204;_0x2636ef['trim']()&&_0x10e09d[_0x268b14(0x174)](_0x2636ef);});}if(_0x259eb5[_0x311204(0x14f)]){_0x10e09d[_0x311204(0x174)](''),_0x10e09d[_0x311204(0x174)](String(a56_0x24d67e[_0x311204(0x15e)][_0x311204(0x157)]('[logs]')));const _0x12b148=_0x259eb5[_0x311204(0x14f)]['split']('\x0a');_0x12b148[_0x311204(0x155)](_0x4e41d6=>{const _0x5c0f32=_0x311204;_0x4e41d6[_0x5c0f32(0x17d)]()&&_0x10e09d[_0x5c0f32(0x174)](_0x4e41d6);});}}return _0x10e09d[_0x311204(0x168)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x108807,_0x350a99){const _0x27ca5b=a56_0x2890;if(_0x350a99[_0x27ca5b(0x15a)]==='table'){await handleSDKOutput([_0x108807],_0x350a99);return;}const _0x3fb684=resolveOutputOptions(_0x350a99),_0x5c73d3=await formatSingleObject(_0x108807,_0x3fb684);await writeOutput(_0x5c73d3,_0x3fb684['output']||undefined,_0x3fb684[_0x27ca5b(0x15a)]);}
|