@treasuredata/tdx 2026.4.12 → 2026.4.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a54_0x478897=a54_0x50e0;(function(_0x2bef41,_0x24dcd8){const _0x366e51=a54_0x50e0,_0x2d1dba=_0x2bef41();while(!![]){try{const _0x50592f=-parseInt(_0x366e51(0x20c))/0x1+-parseInt(_0x366e51(0x26d))/0x2*(-parseInt(_0x366e51(0x2bf))/0x3)+-parseInt(_0x366e51(0x28f))/0x4+parseInt(_0x366e51(0x1a2))/0x5*(parseInt(_0x366e51(0x202))/0x6)+-parseInt(_0x366e51(0x222))/0x7+parseInt(_0x366e51(0x287))/0x8*(parseInt(_0x366e51(0x1ea))/0x9)+-parseInt(_0x366e51(0x237))/0xa;if(_0x50592f===_0x24dcd8)break;else _0x2d1dba['push'](_0x2d1dba['shift']());}catch(_0x989028){_0x2d1dba['push'](_0x2d1dba['shift']());}}}(a54_0xa03e,0x9f382));import a54_0x5a87b0 from'chalk';import{existsSync}from'fs';import a54_0x2b2dff 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_0xfbc779 from'prompts';function getAttemptStatusDisplay(_0x322894){const _0x22238e=a54_0x50e0;if(!_0x322894)return{'icon':'⏳','text':''};const {done:_0x137b05,success:_0x12f203,cancelRequested:_0xd510e5}=_0x322894;if(!_0x137b05)return _0xd510e5?{'icon':'🛑','text':a54_0x5a87b0[_0x22238e(0x1c9)](_0x22238e(0x1f3))}:{'icon':'🔄','text':a54_0x5a87b0[_0x22238e(0x1b5)](_0x22238e(0x296))};if(_0x12f203)return{'icon':'✅','text':a54_0x5a87b0[_0x22238e(0x31f)](_0x22238e(0x2e1))};return{'icon':'❌','text':a54_0x5a87b0[_0x22238e(0x264)](_0x22238e(0x2f5))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x5382fd,_0x3c379b,_0x5bf4fe=0x0){const _0x2636b7=a54_0x50e0;return _0x5382fd[_0x5bf4fe]||_0x3c379b[_0x2636b7(0x2f7)];}['requireProject'](_0x48593d,_0xfb1de7,_0x566616=0x0){const _0xf6b7b2=a54_0x50e0,_0x399101=this['resolveProject'](_0x48593d,_0xfb1de7,_0x566616);if(!_0x399101)return console[_0xf6b7b2(0x2f5)](a54_0x5a87b0[_0xf6b7b2(0x264)](_0xf6b7b2(0x32c)),'Project\x20name\x20is\x20required'),console[_0xf6b7b2(0x2f5)](a54_0x5a87b0[_0xf6b7b2(0x1e4)](_0xf6b7b2(0x2f1))),null;return _0x399101;}['parseProjectWorkflowPattern'](_0x18d30c,_0x5a98d4){const _0x3e9f9f=a54_0x50e0;if(_0x18d30c[0x0]){const _0x1d064d=_0x18d30c[0x0][_0x3e9f9f(0x2de)]('.');if(_0x1d064d[_0x3e9f9f(0x1b1)]===0x1)return{'projectName':_0x1d064d[0x0],'workflowName':undefined};else return _0x1d064d['length']===0x2?{'projectName':_0x1d064d[0x0],'workflowName':_0x1d064d[0x1]}:(console[_0x3e9f9f(0x2f5)](a54_0x5a87b0[_0x3e9f9f(0x264)](_0x3e9f9f(0x32c)),_0x3e9f9f(0x260)),null);}return{'projectName':_0x5a98d4[_0x3e9f9f(0x2f7)],'workflowName':undefined};}['resolveProjectDir'](_0x1f8974,_0x54b77d,_0x461f13=0x0){const _0x30af28=a54_0x50e0;if(_0x1f8974[_0x461f13])return _0x1f8974[_0x461f13];if(_0x54b77d[_0x30af28(0x2f7)]){const _0x5837c6=a54_0x2b2dff[_0x30af28(0x1bc)](process[_0x30af28(0x215)](),_0x30af28(0x2af),_0x54b77d['workflowProject']);if(existsSync(a54_0x2b2dff[_0x30af28(0x1bc)](_0x5837c6,_0x30af28(0x2a5))))return _0x5837c6;}return undefined;}async[a54_0x478897(0x236)](_0x57c65,_0x1cbe02,_0x46979d){const _0x3f9eb9=a54_0x478897;try{const _0x11a10d=await _0x57c65['workflow']['workflows'](_0x1cbe02,{'limit':0x1});if(_0x11a10d['length']>0x0){const _0x2bd0c3=_0x11a10d[0x0]['id'],_0x224bfc=getWorkflowUrl(_0x46979d,_0x2bd0c3);console[_0x3f9eb9(0x2f5)](_0x3f9eb9(0x275)+a54_0x5a87b0[_0x3f9eb9(0x2c4)](_0x224bfc));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a54_0x478897(0x346)]='workflow:use';['description']='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async[a54_0x478897(0x339)](_0x42e3bd){const _0x1dd20d=a54_0x478897,{options:_0x3881b7,args:_0x532fd2,tdx:_0x3e5d8f}=_0x42e3bd,_0x5ac966=_0x532fd2[0x0],_0x505665=_0x3881b7[_0x1dd20d(0x1e7)];if(_0x505665)return saveSessionContext({'workflow_project':undefined},_0x3881b7[_0x1dd20d(0x22a)]),console[_0x1dd20d(0x224)](a54_0x5a87b0[_0x1dd20d(0x31f)](_0x1dd20d(0x1cb))),0x0;if(!_0x5ac966)return console['error'](a54_0x5a87b0[_0x1dd20d(0x264)](_0x1dd20d(0x32c)),'Project\x20name\x20is\x20required'),console[_0x1dd20d(0x2f5)](a54_0x5a87b0[_0x1dd20d(0x1e4)](_0x1dd20d(0x1be))),console[_0x1dd20d(0x2f5)](a54_0x5a87b0[_0x1dd20d(0x1e4)](_0x1dd20d(0x255))),0x1;const _0x4fad55=await withSpinner(_0x1dd20d(0x340)+_0x5ac966+_0x1dd20d(0x33d),()=>_0x3e5d8f['workflow']['resolveProjectId'](_0x5ac966),{'verbose':_0x3881b7[_0x1dd20d(0x1c0)]}),{name:_0x52da41}=_0x4fad55[_0x1dd20d(0x223)];return saveSessionContext({'workflow_project':_0x52da41},_0x3881b7[_0x1dd20d(0x22a)]),console[_0x1dd20d(0x224)](a54_0x5a87b0['green']('✔\x20Workflow\x20project\x20set\x20to:\x20'+a54_0x5a87b0['cyan'](_0x52da41))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x478897(0x346)]=a54_0x478897(0x1d3);[a54_0x478897(0x320)]='List\x20all\x20workflow\x20projects';async[a54_0x478897(0x339)](_0x59aac7){const _0xe5a12d=a54_0x478897,{options:_0x58b5e8,args:_0x3441a0,tdx:_0x43d51b}=_0x59aac7,_0x5b1c9c=_0x3441a0[0x0];_0x58b5e8[_0xe5a12d(0x1c0)]&&_0x5b1c9c&&console['error']('Pattern:\x20'+_0x5b1c9c);const _0x43a51b=await withSpinner(_0xe5a12d(0x1c2),()=>_0x43d51b[_0xe5a12d(0x266)][_0xe5a12d(0x22c)](_0x5b1c9c,{'limit':_0x58b5e8[_0xe5a12d(0x1ff)]}),{'verbose':_0x58b5e8[_0xe5a12d(0x1c0)]});let _0x393477=_0x43a51b[_0xe5a12d(0x223)];_0x393477[_0xe5a12d(0x1ee)]((_0x4a5456,_0x287012)=>_0x4a5456[_0xe5a12d(0x346)][_0xe5a12d(0x2a3)](_0x287012[_0xe5a12d(0x346)]));const _0xbf2bed=_0x58b5e8[_0xe5a12d(0x1ff)]||0x64,_0x57632c=_0x393477[_0xe5a12d(0x1b1)]>=_0xbf2bed?a54_0x5a87b0[_0xe5a12d(0x1e4)](_0xe5a12d(0x298)):'';console[_0xe5a12d(0x2f5)]('✔\x20Found\x20'+_0x393477[_0xe5a12d(0x1b1)]+_0xe5a12d(0x24d)+(_0x393477['length']!==0x1?'s':'')+_0x57632c);if(_0x58b5e8[_0xe5a12d(0x233)]===_0xe5a12d(0x221)||_0x58b5e8[_0xe5a12d(0x233)]===_0xe5a12d(0x2f0)||_0x58b5e8['format']===_0xe5a12d(0x216))await handleSDKOutput(_0x393477,_0x58b5e8);else{if(_0x393477[_0xe5a12d(0x1b1)]===0x0)_0x5b1c9c?console['log']('No\x20projects\x20match\x20pattern:\x20'+_0x5b1c9c):console['log'](_0xe5a12d(0x2fd));else{const _0x1a1feb=_0x393477[_0xe5a12d(0x30b)](_0x4027bf=>{const _0x59ed28=_0xe5a12d,_0x14f667=_0x4027bf['metadata']?.[_0x59ed28(0x1b7)](_0x200475=>_0x200475[_0x59ed28(0x261)]===_0x59ed28(0x309)),_0x97b63a=_0x14f667?a54_0x5a87b0['dim'](_0x59ed28(0x2ca)):'';return _0x59ed28(0x1fd)+_0x4027bf[_0x59ed28(0x346)]+_0x97b63a;});await writeOutput(_0x1a1feb[_0xe5a12d(0x1bc)]('\x0a'),_0x58b5e8[_0xe5a12d(0x28d)],_0xe5a12d(0x336));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x478897(0x346)]='workflow:workflows';['description']='List\x20workflows';async[a54_0x478897(0x339)](_0x46379e){const _0x24cdfb=a54_0x478897,{options:_0x6afd07,args:_0x40b3a7,tdx:_0x12ebe1}=_0x46379e,_0x117af9=this[_0x24cdfb(0x284)](_0x40b3a7,_0x6afd07);_0x6afd07[_0x24cdfb(0x1c0)]&&_0x117af9&&console['error'](_0x24cdfb(0x2ac)+_0x117af9);const _0x243702=await withSpinner(_0x24cdfb(0x23d),()=>_0x12ebe1['workflow'][_0x24cdfb(0x2af)](_0x117af9,{'limit':_0x6afd07[_0x24cdfb(0x1ff)]}),{'verbose':_0x6afd07[_0x24cdfb(0x1c0)]});let _0x43a869=_0x243702[_0x24cdfb(0x223)];_0x43a869[_0x24cdfb(0x1ee)]((_0x147d38,_0x2597aa)=>{const _0xee44c0=_0x24cdfb,_0x2f7a21=_0x147d38[_0xee44c0(0x346)][_0xee44c0(0x2a3)](_0x2597aa[_0xee44c0(0x346)]);if(_0x2f7a21!==0x0)return _0x2f7a21;return(_0x147d38[_0xee44c0(0x2e5)]?.['name']||'')['localeCompare'](_0x2597aa[_0xee44c0(0x2e5)]?.[_0xee44c0(0x346)]||'');});const _0x174f61=_0x6afd07[_0x24cdfb(0x1ff)]||0x64,_0x48d3fa=_0x43a869['length']>=_0x174f61?a54_0x5a87b0[_0x24cdfb(0x1e4)](_0x24cdfb(0x298)):'';console[_0x24cdfb(0x2f5)](_0x24cdfb(0x1ab)+_0x43a869[_0x24cdfb(0x1b1)]+_0x24cdfb(0x235)+(_0x43a869[_0x24cdfb(0x1b1)]!==0x1?'s':'')+_0x48d3fa);if(_0x6afd07[_0x24cdfb(0x233)]===_0x24cdfb(0x221)||_0x6afd07[_0x24cdfb(0x233)]===_0x24cdfb(0x2f0)||_0x6afd07[_0x24cdfb(0x233)]===_0x24cdfb(0x216))await handleSDKOutput(_0x43a869,_0x6afd07);else{if(_0x43a869['length']===0x0)_0x117af9?console['log']('No\x20workflows\x20found\x20in\x20project:\x20'+_0x117af9):console['log'](_0x24cdfb(0x31b));else{const _0x380fc9=_0x6afd07[_0x24cdfb(0x30d)],_0x27015c=_0x43a869[_0x24cdfb(0x30b)](_0x460845=>{const _0x4c7fb3=_0x24cdfb,_0x134477=a54_0x5a87b0[_0x4c7fb3(0x1e4)]('#'+_0x460845['id']),_0x3f6b1d=hyperlink(_0x134477,getWorkflowUrl(_0x380fc9,_0x460845['id'])),_0x1c6cc2=_0x460845[_0x4c7fb3(0x2e5)]?.[_0x4c7fb3(0x346)]?a54_0x5a87b0[_0x4c7fb3(0x1e4)]('\x20('+_0x460845[_0x4c7fb3(0x2e5)]['name']+')'):'';return _0x4c7fb3(0x279)+_0x3f6b1d+'\x20'+_0x460845[_0x4c7fb3(0x346)]+_0x1c6cc2;});await writeOutput(_0x27015c['join']('\x0a'),_0x6afd07['output'],_0x24cdfb(0x336));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x478897(0x346)]=a54_0x478897(0x33c);[a54_0x478897(0x320)]=a54_0x478897(0x274);async['execute'](_0x1a6bcc){const _0x51361c=a54_0x478897,{options:_0x5cfc69,args:_0x4fc798,tdx:_0xc169fc}=_0x1a6bcc,_0x1710b2=this['parseProjectWorkflowPattern'](_0x4fc798,_0x5cfc69);if(!_0x1710b2)return 0x1;const {projectName:_0x782772,workflowName:_0x57cefb}=_0x1710b2;if(_0x5cfc69[_0x51361c(0x1c0)]){if(_0x782772&&_0x57cefb)console['error']('Filter:\x20'+_0x782772+'.'+_0x57cefb);else _0x782772&&console[_0x51361c(0x2f5)](_0x51361c(0x303)+_0x782772);const _0x5b9ba4=_0x5cfc69[_0x51361c(0x2e6)];_0x5b9ba4&&console[_0x51361c(0x2f5)](_0x51361c(0x20b)+_0x5b9ba4);}let _0x50a9bd=0x28;if(process[_0x51361c(0x19c)]['isTTY']&&!_0x5cfc69['output']&&!_0x5cfc69[_0x51361c(0x233)]){const _0x439921=process[_0x51361c(0x19c)][_0x51361c(0x331)]||0x28;_0x50a9bd=Math[_0x51361c(0x31e)](0x14,Math[_0x51361c(0x1fc)](_0x439921*0x2/0x3));}const _0x27178c=_0x5cfc69[_0x51361c(0x1ff)]||_0x50a9bd,_0x247c7f=await withSpinner(_0x51361c(0x22e),()=>_0xc169fc[_0x51361c(0x266)][_0x51361c(0x2ab)]({'projectName':_0x782772,'workflowName':_0x57cefb,'status':_0x5cfc69['status'],'fromTime':_0x5cfc69[_0x51361c(0x197)],'toTime':_0x5cfc69['to'],'limit':_0x27178c}),{'verbose':_0x5cfc69[_0x51361c(0x1c0)]}),_0x3d76e4=_0x247c7f[_0x51361c(0x223)];_0x3d76e4[_0x51361c(0x1ee)]((_0x39a9ae,_0x4e64c0)=>{const _0x2ab567=_0x51361c,_0x1f8509=_0x39a9ae[_0x2ab567(0x301)]||'',_0x1880a5=_0x4e64c0[_0x2ab567(0x301)]||'';return _0x1880a5[_0x2ab567(0x2a3)](_0x1f8509);});_0x3d76e4[_0x51361c(0x1b1)]>=_0x27178c?console['error'](_0x51361c(0x2cc)+_0x3d76e4[_0x51361c(0x1b1)]+_0x51361c(0x1e9)+a54_0x5a87b0[_0x51361c(0x1e4)](_0x51361c(0x227))):console[_0x51361c(0x2f5)](_0x51361c(0x1ab)+_0x3d76e4[_0x51361c(0x1b1)]+_0x51361c(0x1a7)+(_0x3d76e4[_0x51361c(0x1b1)]!==0x1?'s':''));if(_0x5cfc69['format']==='json'||_0x5cfc69['format']==='jsonl'||_0x5cfc69[_0x51361c(0x233)]==='table')await handleSDKOutput(_0x3d76e4,_0x5cfc69);else{if(!process[_0x51361c(0x19c)][_0x51361c(0x25d)]||_0x5cfc69['output']){if(_0x3d76e4[_0x51361c(0x1b1)]===0x0){if(_0x782772&&_0x57cefb)console['log']('No\x20sessions\x20found\x20for:\x20'+_0x782772+'.'+_0x57cefb);else _0x782772?console[_0x51361c(0x224)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x782772):console[_0x51361c(0x224)]('No\x20sessions\x20found');}else{const _0x4047da=_0x5cfc69[_0x51361c(0x30d)],_0x2384ee=this['renderSessionsTimeline'](_0x3d76e4,_0x4047da);_0x5cfc69[_0x51361c(0x28d)]?await writeOutput(_0x2384ee,_0x5cfc69[_0x51361c(0x28d)],_0x51361c(0x336)):console[_0x51361c(0x224)](_0x2384ee);}!_0x782772&&(console[_0x51361c(0x2f5)](''),console[_0x51361c(0x2f5)](a54_0x5a87b0[_0x51361c(0x1e4)](_0x51361c(0x1f9))),console[_0x51361c(0x2f5)](a54_0x5a87b0[_0x51361c(0x1e4)](_0x51361c(0x26c))+'or'+a54_0x5a87b0[_0x51361c(0x1e4)](_0x51361c(0x29e))));}else{if(_0x3d76e4[_0x51361c(0x1b1)]===0x0){if(_0x782772&&_0x57cefb)console[_0x51361c(0x224)]('No\x20sessions\x20found\x20for:\x20'+_0x782772+'.'+_0x57cefb);else _0x782772?console[_0x51361c(0x224)](_0x51361c(0x319)+_0x782772):console[_0x51361c(0x224)](_0x51361c(0x322));}else await this[_0x51361c(0x272)](_0x3d76e4,_0x1a6bcc,_0x782772);}}return 0x0;}[a54_0x478897(0x212)](_0x184aeb,_0x3fc0a5){const _0x9a00de=a54_0x478897,_0x116c74=[],_0x26a018=new Map();let _0x71e8e0=Infinity,_0x3087f5=-Infinity;for(const _0x4071b1 of _0x184aeb){if(_0x4071b1['lastAttempt']?.['createdAt']){const _0xc9a241=new Date(_0x4071b1[_0x9a00de(0x1c4)]['createdAt'])['getTime'](),_0x45a833=_0x4071b1[_0x9a00de(0x1c4)][_0x9a00de(0x2ce)]?new Date(_0x4071b1[_0x9a00de(0x1c4)][_0x9a00de(0x2ce)])[_0x9a00de(0x300)]():Date[_0x9a00de(0x196)](),_0x29a701=_0x4071b1[_0x9a00de(0x2e5)]?.['name']||_0x9a00de(0x208);!_0x26a018[_0x9a00de(0x231)](_0x29a701)&&_0x26a018[_0x9a00de(0x1f2)](_0x29a701,[]),_0x26a018['get'](_0x29a701)['push']({'session':_0x4071b1,'startTime':_0xc9a241,'endTime':_0x45a833,'duration':_0x45a833-_0xc9a241}),_0x71e8e0=Math[_0x9a00de(0x1c7)](_0x71e8e0,_0xc9a241),_0x3087f5=Math[_0x9a00de(0x31e)](_0x3087f5,_0x45a833);}}if(_0x26a018[_0x9a00de(0x1d0)]===0x0)return _0x9a00de(0x1ed);const _0x2a8602=process[_0x9a00de(0x19c)]['columns']||0x78,_0x1bb51f=0x1e,_0x21ecbe=0x32,_0x5dd4a7=0x4,_0x477305=Math[_0x9a00de(0x1c7)](_0x21ecbe,Math[_0x9a00de(0x31e)](_0x1bb51f,Math[_0x9a00de(0x1fc)](_0x2a8602*0.3))),_0xcfac5a=_0x2a8602-_0x477305-TIMELINE_CONFIG[_0x9a00de(0x28e)]-0x3-_0x5dd4a7,_0x1dc8bf=_0x3087f5-_0x71e8e0,_0x2fca75=_0x1dc8bf/_0x477305,_0xa163bd=renderTimeAxis({'startTime':_0x71e8e0,'endTime':_0x3087f5,'durationMs':_0x1dc8bf,'msPerChar':_0x2fca75},_0x477305),_0x153278=[];for(const _0x5d2261 of _0x26a018['values']()){_0x153278[_0x9a00de(0x240)](..._0x5d2261);}_0x153278['sort']((_0x3a874d,_0x54ef25)=>_0x54ef25[_0x9a00de(0x2bb)]-_0x3a874d[_0x9a00de(0x2bb)]);const _0x1e9b2a=new Date(_0x71e8e0),_0xa89f4a=formatDate(_0x1e9b2a),_0x2c9052=_0x5dd4a7+TIMELINE_CONFIG[_0x9a00de(0x26e)]+TIMELINE_CONFIG[_0x9a00de(0x2dc)]+_0xcfac5a,_0x5b09f6='\x20'[_0x9a00de(0x245)](_0x2c9052-_0xa89f4a[_0x9a00de(0x1b1)]),_0x388b6f=_0x5b09f6+a54_0x5a87b0[_0x9a00de(0x1e4)](_0xa89f4a)+'\x20'+_0xa163bd;_0x116c74[_0x9a00de(0x240)](_0x388b6f);const _0x11ae3d=0x16;let _0x307ec8=0x0;for(const _0x575681 of _0x153278){const _0x5c1575=_0x575681[_0x9a00de(0x22a)][_0x9a00de(0x2e5)]?.[_0x9a00de(0x346)]||'?',_0x360cac=Math[_0x9a00de(0x1c7)](stringWidth(_0x5c1575),_0x11ae3d);_0x307ec8=Math['max'](_0x307ec8,_0x360cac);}for(const _0x3cf767 of _0x153278){const {session:_0x389189,startTime:_0x4dbed7,endTime:_0x4c040d,duration:_0x33ebac}=_0x3cf767,_0x132edc=_0x389189[_0x9a00de(0x2e5)]?.['id'],_0x5658be=_0x389189['id'],_0x5c39f2=_0x389189[_0x9a00de(0x2e5)]?.[_0x9a00de(0x346)]||'?',_0x5dba70=_0x389189[_0x9a00de(0x266)]?.[_0x9a00de(0x346)]||'?';let _0x2ace7a,_0x2036a7;if(_0x389189[_0x9a00de(0x1c4)]){const _0x53735c=_0x389189['lastAttempt'];!_0x53735c[_0x9a00de(0x25e)]?(_0x2ace7a=_0x53735c[_0x9a00de(0x2c5)]?'🛑':'🔄',_0x2036a7=_0x53735c[_0x9a00de(0x2c5)]?a54_0x5a87b0[_0x9a00de(0x1c9)]:a54_0x5a87b0['blue']):(_0x2ace7a=_0x53735c[_0x9a00de(0x2e1)]?'✅':'❌',_0x2036a7=_0x53735c['success']?a54_0x5a87b0[_0x9a00de(0x31f)]:a54_0x5a87b0[_0x9a00de(0x264)]);}else _0x2ace7a='⏳',_0x2036a7=a54_0x5a87b0[_0x9a00de(0x1e4)];const _0x19c708='#'+_0x5658be,_0x4a1cbb=_0x132edc?hyperlink(_0x19c708,getWorkflowSessionUrl(_0x3fc0a5,_0x132edc,_0x5658be)):_0x19c708;let _0x56db20=_0x5c39f2;stringWidth(_0x5c39f2)>_0x11ae3d&&(_0x56db20=_0x5c39f2[_0x9a00de(0x242)](0x0,_0x11ae3d-0x1)+'…');const _0x1bd92f=a54_0x5a87b0['dim'](_0x56db20),_0x184357=stringWidth(_0x56db20),_0x5642eb='\x20'[_0x9a00de(0x245)](_0x307ec8-stringWidth(_0x56db20)+0x2),_0x5caafe='('+formatElapsed(_0x33ebac)+')',_0x53c0f4=stringWidth(_0x5caafe),_0x13a909=stringWidth(_0x19c708),_0x141dfd=_0x13a909+0x1+_0x184357+_0x5642eb[_0x9a00de(0x1b1)],_0x130cc9=_0xcfac5a-_0x141dfd-_0x53c0f4-0x1-0x8;let _0x3ab8ec=_0x5dba70;stringWidth(_0x3ab8ec)>_0x130cc9&&(_0x3ab8ec=_0x3ab8ec[_0x9a00de(0x242)](0x0,_0x130cc9-0x1)+'…');const _0x3c0515=_0x4a1cbb+'\x20'+_0x1bd92f+_0x5642eb+_0x3ab8ec,_0x36a86f=stringWidth(_0x3c0515),_0x230f8a=_0xcfac5a-_0x36a86f-_0x53c0f4,_0x478690=_0x3c0515+'\x20'[_0x9a00de(0x245)](Math[_0x9a00de(0x31e)](0x1,_0x230f8a))+a54_0x5a87b0[_0x9a00de(0x1e4)](_0x5caafe),_0x2d30a7=Math[_0x9a00de(0x1fc)]((_0x4dbed7-_0x71e8e0)/_0x2fca75),_0x47fa43=Math[_0x9a00de(0x1fc)]((_0x4c040d-_0x71e8e0)/_0x2fca75),_0x47b0a9=Math[_0x9a00de(0x31e)](_0x2d30a7+0x1,_0x47fa43),_0x14eea5=new Array(_0x477305)[_0x9a00de(0x1b8)]('\x20');for(let _0x1c2424=_0x2d30a7;_0x1c2424<Math[_0x9a00de(0x1c7)](_0x47b0a9,_0x477305);_0x1c2424++){_0x14eea5[_0x1c2424]='─';}const _0x3a09d3=_0x14eea5[_0x9a00de(0x30b)](_0x50638a=>_0x50638a==='\x20'?'\x20':_0x2036a7(_0x50638a))['join']('');_0x116c74[_0x9a00de(0x240)](_0x2ace7a+'\x20'+_0x478690+'│'+_0x3a09d3+'│');}return _0x116c74[_0x9a00de(0x1bc)]('\x0a');}async[a54_0x478897(0x272)](_0x413cbc,_0x1bf1cc,_0x4effe3){const _0x3de73f=a54_0x478897,{options:_0x2e6b33,tdx:_0x38f36e}=_0x1bf1cc,_0x37913e=_0x2e6b33[_0x3de73f(0x30d)],{timelineRows:_0x3334e4,timeAxisHeader:_0xfaa0cd}=this[_0x3de73f(0x20f)](_0x413cbc,_0x37913e),_0x2687cf=_0x3334e4['filter'](_0x11ee81=>_0x11ee81[_0x3de73f(0x1a3)]);if(_0x2687cf['length']===0x0){const _0x358710=this[_0x3de73f(0x212)](_0x413cbc,_0x37913e);console[_0x3de73f(0x224)](_0x358710);!_0x4effe3&&(console[_0x3de73f(0x2f5)](''),console[_0x3de73f(0x2f5)](a54_0x5a87b0[_0x3de73f(0x1e4)](_0x3de73f(0x1f9))),console[_0x3de73f(0x2f5)](a54_0x5a87b0[_0x3de73f(0x1e4)](_0x3de73f(0x26c))+'or'+a54_0x5a87b0[_0x3de73f(0x1e4)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0xfaa0cd&&console[_0x3de73f(0x224)](_0xfaa0cd);const _0x773215=_0x3334e4['filter'](_0x346990=>_0x346990[_0x3de73f(0x1a3)])[_0x3de73f(0x30b)](_0x3a6eb6=>({'title':_0x3a6eb6[_0x3de73f(0x205)],'value':_0x3a6eb6[_0x3de73f(0x1a3)]})),_0x40953e=process[_0x3de73f(0x19c)]['rows']||0x3c,_0x4425ac=Math[_0x3de73f(0x31e)](0x28,Math[_0x3de73f(0x1fc)](_0x40953e*0x2/0x3)),_0x4a1063=await a54_0xfbc779({'type':_0x3de73f(0x2d3),'name':_0x3de73f(0x1a3),'message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x773215,'initial':-0x1,'limit':_0x4425ac,'clearFirst':!![],'fallback':{'title':_0x3de73f(0x1fe),'value':null},'suggest':(_0x4441c4,_0x3bb107)=>{const _0x525ce3=_0x3de73f;if(!_0x4441c4)return Promise['resolve'](_0x3bb107);const _0x299520=_0x3bb107[_0x525ce3(0x2c8)](_0xf43624=>{const _0x42a505=_0x525ce3,_0x50ed2e=_0xf43624;return _0x50ed2e[_0x42a505(0x1f7)][_0x42a505(0x22d)]()[_0x42a505(0x1cc)](_0x4441c4['toLowerCase']());});return Promise[_0x525ce3(0x2fc)](_0x299520);}}),_0x3ebd31=()=>{const _0x2d4986=_0x3de73f;process[_0x2d4986(0x19c)]['write'](_0x2d4986(0x1d9)),process[_0x2d4986(0x19c)][_0x2d4986(0x267)](_0x2d4986(0x1d9)),process[_0x2d4986(0x19c)]['write']('\x1b[1A\x1b[2K');},_0x3812a=_0x4a1063&&_0x4a1063[_0x3de73f(0x1a3)]&&_0x4a1063[_0x3de73f(0x1a3)]!==null&&_0x4a1063['attemptId'][_0x3de73f(0x334)]()!=='';if(!_0x3812a){_0x3ebd31(),console[_0x3de73f(0x224)](a54_0x5a87b0['dim'](_0x3de73f(0x1ec)));return;}_0x3ebd31();const _0x44f87c=_0x413cbc[_0x3de73f(0x281)](_0x86c14f=>_0x86c14f[_0x3de73f(0x1c4)]?.['id']===_0x4a1063[_0x3de73f(0x1a3)]);if(_0x44f87c){const _0x25ca8c=_0x44f87c[_0x3de73f(0x2e5)]?.[_0x3de73f(0x346)]||'?',_0x28fe12=_0x44f87c[_0x3de73f(0x266)]?.[_0x3de73f(0x346)]||'?';console[_0x3de73f(0x224)](_0x3de73f(0x1d1)+a54_0x5a87b0[_0x3de73f(0x1e4)](_0x25ca8c)+',\x20Workflow:\x20'+a54_0x5a87b0[_0x3de73f(0x1e4)](_0x28fe12));}const _0x4a1658=new WorkflowTimelineCommand();await _0x4a1658['execute']({'args':[],'options':{..._0x2e6b33,'attemptId':_0x4a1063[_0x3de73f(0x1a3)]},'tdx':_0x38f36e});}['generateSessionTimelineRows'](_0x5d0c9c,_0x23c206){const _0x475865=a54_0x478897,_0x260e73=new Map();for(const _0x2a8783 of _0x5d0c9c){_0x2a8783['id']&&_0x2a8783['lastAttempt']?.['id']&&_0x260e73[_0x475865(0x1f2)](_0x2a8783['id'],_0x2a8783[_0x475865(0x1c4)]['id']);}const _0x3b6fb9=[];let _0x153c97='';const _0x2564d3=this[_0x475865(0x212)](_0x5d0c9c,_0x23c206),_0x4db854=_0x2564d3[_0x475865(0x2de)]('\x0a');for(const _0x1059dc of _0x4db854){if(_0x1059dc[_0x475865(0x225)](_0x475865(0x2d8))||_0x1059dc['match'](/^\s+\d{4}-\d{2}-\d{2}/))_0x153c97=_0x1059dc;else{if(_0x1059dc[_0x475865(0x2e7)](/^[✅❌🔄🛑⏳]/)){const _0x522b3a=_0x1059dc[_0x475865(0x2e7)](/#(\d+)/),_0x56c295=_0x522b3a?_0x522b3a[0x1]:null,_0x3a625b=_0x56c295?_0x260e73[_0x475865(0x2e4)](_0x56c295)||null:null,_0x41a985=_0x5d0c9c[_0x475865(0x281)](_0x4cdc02=>_0x4cdc02['id']===_0x56c295),_0x4bb3a3=_0x41a985?.[_0x475865(0x2e5)]?.[_0x475865(0x346)]||'';_0x3b6fb9[_0x475865(0x240)]({'displayLine':_0x1059dc,'attemptId':_0x3a625b,'projectName':_0x4bb3a3});}}}return{'timelineRows':_0x3b6fb9,'timeAxisHeader':_0x153c97};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0x478897(0x346)]='workflow:attempts';[a54_0x478897(0x320)]=a54_0x478897(0x25b);async[a54_0x478897(0x339)](_0x1b4321){const _0x399402=a54_0x478897,{options:_0x354eec,args:_0xdfaa1e,tdx:_0x9bc724}=_0x1b4321,_0x261f6e=this[_0x399402(0x1c1)](_0xdfaa1e,_0x354eec);if(!_0x261f6e)return 0x1;const {projectName:_0x18f620,workflowName:_0x6b4b7f}=_0x261f6e,_0x436adb=_0x354eec['includeRetried'];if(_0x354eec['verbose']){if(_0x18f620&&_0x6b4b7f)console[_0x399402(0x2f5)]('Filter:\x20'+_0x18f620+'.'+_0x6b4b7f);else _0x18f620&&console[_0x399402(0x2f5)]('Filter:\x20project='+_0x18f620);_0x436adb&&console[_0x399402(0x2f5)](_0x399402(0x257));}const _0x413e47=await withSpinner(_0x399402(0x328),()=>_0x9bc724[_0x399402(0x266)]['attempts']({'projectName':_0x18f620,'workflowName':_0x6b4b7f,'includeRetried':_0x436adb,'limit':_0x354eec['limit']}),{'verbose':_0x354eec['verbose']}),_0x435bf1=_0x413e47[_0x399402(0x223)],_0x128598=_0x354eec[_0x399402(0x1ff)]||0x64,_0x504a29=_0x435bf1[_0x399402(0x1b1)]>=_0x128598?a54_0x5a87b0[_0x399402(0x1e4)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x399402(0x2f5)]('✔\x20Found\x20'+_0x435bf1['length']+'\x20attempt'+(_0x435bf1['length']!==0x1?'s':'')+_0x504a29);if(_0x354eec[_0x399402(0x233)]===_0x399402(0x221)||_0x354eec['format']===_0x399402(0x2f0)||_0x354eec[_0x399402(0x233)]===_0x399402(0x216))await handleSDKOutput(_0x435bf1,_0x354eec);else{if(_0x435bf1[_0x399402(0x1b1)]===0x0){if(_0x18f620&&_0x6b4b7f)console[_0x399402(0x224)](_0x399402(0x2db)+_0x18f620+'.'+_0x6b4b7f);else _0x18f620?console[_0x399402(0x224)](_0x399402(0x2b0)+_0x18f620):console[_0x399402(0x224)](_0x399402(0x290));}else{const _0x580490=_0x354eec[_0x399402(0x30d)],_0x58e150=_0x435bf1[_0x399402(0x30b)](_0x47496e=>{const _0x4cfd92=_0x399402,_0x296598=a54_0x5a87b0[_0x4cfd92(0x1e4)]('#'+_0x47496e['id']),_0x52a231=_0x47496e[_0x4cfd92(0x2e5)]?.['id'],_0x59dc34=_0x47496e['session_id']||_0x47496e[_0x4cfd92(0x25c)],_0x179a26=_0x52a231&&_0x59dc34?hyperlink(_0x296598,getWorkflowAttemptUrl(_0x580490,_0x52a231,_0x59dc34,_0x47496e['id'])):_0x296598,{icon:_0xb4eb60,text:_0x98f3e}=getAttemptStatusDisplay(_0x47496e),_0x286d7b=(_0x47496e[_0x4cfd92(0x2e5)]?.[_0x4cfd92(0x346)]||'?')+'.'+(_0x47496e[_0x4cfd92(0x266)]?.['name']||'?'),_0xbf39d9=_0x47496e[_0x4cfd92(0x301)]?a54_0x5a87b0[_0x4cfd92(0x1e4)](_0x47496e[_0x4cfd92(0x301)]):'';return(_0x179a26+'\x20'+_0xb4eb60+(_0x98f3e?'\x20'+_0x98f3e:'')+'\x20'+_0x286d7b+'\x20'+_0xbf39d9)[_0x4cfd92(0x1cd)]();});await writeOutput(_0x58e150[_0x399402(0x1bc)]('\x0a'),_0x354eec[_0x399402(0x28d)],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x478897(0x346)]=a54_0x478897(0x204);['description']=a54_0x478897(0x21a);async[a54_0x478897(0x339)](_0x522d3c){const _0x51df4b=a54_0x478897,{options:_0x4b5b3a,args:_0x415b06,tdx:_0x307d08}=_0x522d3c,_0x31c702=_0x415b06[0x0];if(!_0x31c702)return console[_0x51df4b(0x2f5)](_0x51df4b(0x1dd)),0x1;_0x4b5b3a[_0x51df4b(0x1c0)]&&console[_0x51df4b(0x2f5)](_0x51df4b(0x282)+_0x31c702);const _0x578b2d=await withSpinner('Getting\x20attempt\x20details...',()=>_0x307d08['workflow']['attempt'](_0x31c702),{'verbose':_0x4b5b3a[_0x51df4b(0x1c0)]}),_0xbb5063=_0x578b2d['data'];let _0x1ce276;!_0xbb5063[_0x51df4b(0x25e)]?_0x1ce276=_0xbb5063[_0x51df4b(0x2c5)]?'canceling':_0x51df4b(0x296):_0x1ce276=_0xbb5063[_0x51df4b(0x2e1)]?_0x51df4b(0x2e1):_0x51df4b(0x2f5);let _0x2b2c6a;if(_0xbb5063['createdAt']&&_0xbb5063[_0x51df4b(0x2ce)]){const _0x38767e=new Date(_0xbb5063[_0x51df4b(0x327)])[_0x51df4b(0x300)](),_0x2a6269=new Date(_0xbb5063[_0x51df4b(0x2ce)])[_0x51df4b(0x300)]();_0x2b2c6a=Math[_0x51df4b(0x2d0)]((_0x2a6269-_0x38767e)/0x3e8);}const _0xb15cbd={'attempt_id':_0xbb5063['id'],'status':_0x1ce276,..._0xbb5063[_0x51df4b(0x2bd)]!==undefined&&{'index':_0xbb5063[_0x51df4b(0x2bd)]},..._0xbb5063[_0x51df4b(0x2e5)]&&{'project':_0xbb5063[_0x51df4b(0x2e5)]['name']},..._0xbb5063[_0x51df4b(0x266)]&&{'workflow':_0xbb5063['workflow'][_0x51df4b(0x346)]},..._0xbb5063[_0x51df4b(0x25c)]&&{'session_id':_0xbb5063[_0x51df4b(0x25c)]},..._0xbb5063[_0x51df4b(0x301)]&&{'session_time':_0xbb5063[_0x51df4b(0x301)]},..._0xbb5063[_0x51df4b(0x311)]&&{'retry_attempt':_0xbb5063[_0x51df4b(0x311)]},..._0x2b2c6a!==undefined&&{'duration_sec':_0x2b2c6a},..._0xbb5063[_0x51df4b(0x327)]&&{'created_at':_0xbb5063['createdAt']},..._0xbb5063[_0x51df4b(0x2ce)]&&{'finished_at':_0xbb5063[_0x51df4b(0x2ce)]},...Object[_0x51df4b(0x27b)](_0xbb5063['params'])['length']>0x0&&{'params':_0xbb5063['params']}};return await handleSingleObjectOutput(_0xb15cbd,_0x4b5b3a),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']='workflow:tasks';[a54_0x478897(0x320)]='Show\x20tasks\x20for\x20an\x20attempt';async['execute'](_0x388a23){const _0x523792=a54_0x478897,{options:_0x35b566,args:_0x3395fe,tdx:_0x40bf4a}=_0x388a23,_0x416b7f=_0x3395fe[0x0];if(!_0x416b7f)return console['error'](_0x523792(0x1dd)),0x1;const _0x3ccd16=_0x35b566[_0x523792(0x1e1)];_0x35b566[_0x523792(0x1c0)]&&(console[_0x523792(0x2f5)]('Attempt\x20ID:\x20'+_0x416b7f),_0x3ccd16&&console[_0x523792(0x2f5)](_0x523792(0x228)));const _0x105641=await withSpinner(_0x523792(0x31c),()=>_0x40bf4a[_0x523792(0x266)]['tasks'](_0x416b7f,_0x3ccd16||![]),{'verbose':_0x35b566[_0x523792(0x1c0)]}),_0x4e03ff=_0x105641[_0x523792(0x223)];return console[_0x523792(0x2f5)]('✔\x20Found\x20'+_0x4e03ff['length']+_0x523792(0x232)+(_0x4e03ff[_0x523792(0x1b1)]!==0x1?'s':'')),await handleSDKOutput(_0x4e03ff,_0x35b566),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0x478897(0x346)]=a54_0x478897(0x2a0);[a54_0x478897(0x320)]=a54_0x478897(0x217);async[a54_0x478897(0x339)](_0x4642ba){const _0x4dc0b4=a54_0x478897,{options:_0x282373,args:_0x17f08a,tdx:_0x5e5a2c}=_0x4642ba,_0x386901=_0x17f08a[0x0];let _0x2983b2=_0x17f08a[0x1];if(!_0x386901)return console[_0x4dc0b4(0x2f5)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x282373[_0x4dc0b4(0x1c0)]&&(console[_0x4dc0b4(0x2f5)]('Attempt\x20ID:\x20'+_0x386901),_0x2983b2&&console[_0x4dc0b4(0x2f5)](_0x4dc0b4(0x24f)+_0x2983b2));const _0x36108e=await withSpinner('Fetching\x20log\x20files...',()=>_0x5e5a2c['workflow'][_0x4dc0b4(0x323)](_0x386901,_0x2983b2),{'verbose':_0x282373[_0x4dc0b4(0x1c0)]}),_0x29398b=_0x36108e['data'];if(_0x29398b['length']===0x0)return console[_0x4dc0b4(0x2f5)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x2983b2&&(_0x282373['json']||_0x282373[_0x4dc0b4(0x233)]))return await handleSDKOutput(_0x29398b,_0x282373),0x0;if(!_0x2983b2){const _0x4e0e48=_0x29398b['map'](_0x17b142=>({'title':_0x17b142[_0x4dc0b4(0x2e2)]+'\x20('+formatBytes(_0x17b142[_0x4dc0b4(0x2ee)])+')','value':_0x17b142['taskName']})),_0x5a78af=await a54_0xfbc779({'type':_0x4dc0b4(0x30f),'name':_0x4dc0b4(0x23c),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x4e0e48});if(!_0x5a78af[_0x4dc0b4(0x23c)])return console['error'](_0x4dc0b4(0x1ec)),0x0;_0x2983b2=_0x5a78af[_0x4dc0b4(0x23c)];}const _0x35df87=await withSpinner('Downloading\x20logs...',()=>_0x5e5a2c[_0x4dc0b4(0x266)][_0x4dc0b4(0x1dc)](_0x386901,_0x2983b2),{'verbose':_0x282373[_0x4dc0b4(0x1c0)]}),_0x421b5d=_0x35df87[_0x4dc0b4(0x223)];return _0x421b5d?console[_0x4dc0b4(0x224)](_0x421b5d):console['error'](_0x4dc0b4(0x1b9)),0x0;}}function a54_0x50e0(_0x3bbbd8,_0x18c6cb){_0x3bbbd8=_0x3bbbd8-0x193;const _0xa03ea6=a54_0xa03e();let _0x50e058=_0xa03ea6[_0x3bbbd8];return _0x50e058;}export class WorkflowKillCommand extends BaseCommand{['name']=a54_0x478897(0x2d5);[a54_0x478897(0x320)]=a54_0x478897(0x27d);async[a54_0x478897(0x339)](_0x4b03c8){const _0x14591c=a54_0x478897,{options:_0x21b7ea,args:_0x5cb449,tdx:_0x4c0677}=_0x4b03c8,_0x4b5321=_0x5cb449[0x0];if(!_0x4b5321)return console['error'](_0x14591c(0x1dd)),0x1;const _0x296756=_0x21b7ea[_0x14591c(0x343)];_0x21b7ea['verbose']&&(console[_0x14591c(0x2f5)]('Attempt\x20ID:\x20'+_0x4b5321),_0x296756&&console[_0x14591c(0x2f5)](_0x14591c(0x345)+_0x296756));if(!_0x21b7ea[_0x14591c(0x1f5)]){if(!isInteractive())return console[_0x14591c(0x2f5)](a54_0x5a87b0['red']('\x0aError:'),_0x14591c(0x34b)),console[_0x14591c(0x2f5)](a54_0x5a87b0[_0x14591c(0x1e4)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2f57c9=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x4b5321+'?');if(!_0x2f57c9)return console['error'](a54_0x5a87b0['yellow'](_0x14591c(0x1ec))),0x1;}const _0x5bd8d7=await withSpinner(_0x14591c(0x24e),()=>_0x4c0677['workflow'][_0x14591c(0x1ce)](_0x4b5321,_0x296756),{'verbose':_0x21b7ea[_0x14591c(0x1c0)]}),_0x24e0e2=_0x5bd8d7[_0x14591c(0x223)];return console[_0x14591c(0x2f5)]('✔\x20'+_0x24e0e2),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x478897(0x346)]=a54_0x478897(0x1ac);[a54_0x478897(0x320)]=a54_0x478897(0x2b3);async[a54_0x478897(0x339)](_0x5a4c30){const _0x33505c=a54_0x478897,{options:_0x5b66f4,args:_0x36cfa0,tdx:_0x5a065d}=_0x5a4c30,_0x5989f8=_0x36cfa0[0x0];if(!_0x5989f8)return console[_0x33505c(0x2f5)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x33505c(0x2f5)](_0x33505c(0x302)),0x1;let _0x11f2a0=![],_0x46f80c=_0x5989f8;if(_0x5989f8[_0x33505c(0x225)](_0x33505c(0x2ad)))_0x11f2a0=!![],_0x46f80c=_0x5989f8[_0x33505c(0x28c)](0x8);else{if(_0x5989f8['startsWith'](_0x33505c(0x213)))_0x11f2a0=![],_0x46f80c=_0x5989f8[_0x33505c(0x28c)](0x8);else return console[_0x33505c(0x2f5)](_0x33505c(0x2d6)),console[_0x33505c(0x2f5)](_0x33505c(0x302)),0x1;}const _0x4cf534=_0x5b66f4[_0x33505c(0x243)],_0x207383=_0x5b66f4[_0x33505c(0x1bd)],_0x263db1=_0x5b66f4[_0x33505c(0x269)],_0x1f8cd0=_0x5b66f4['force'];_0x5b66f4[_0x33505c(0x1c0)]&&(console[_0x33505c(0x2f5)]('Target:\x20'+(_0x11f2a0?_0x33505c(0x22a):'attempt')+'\x20'+_0x46f80c),_0x4cf534&&console[_0x33505c(0x2f5)]('From\x20task:\x20'+_0x4cf534),_0x207383&&console[_0x33505c(0x2f5)](_0x33505c(0x276)+_0x207383),_0x263db1&&console['error'](_0x33505c(0x258)+_0x263db1),_0x1f8cd0&&console[_0x33505c(0x2f5)](_0x33505c(0x253)));let _0x26c974;if(_0x263db1)try{if(_0x263db1['startsWith']('@')){const _0x57889c=await import(_0x33505c(0x2fa)),_0x29be29=_0x263db1[_0x33505c(0x28c)](0x1),_0x4989fc=await _0x57889c['readFile'](_0x29be29,_0x33505c(0x1f4));_0x26c974=JSON[_0x33505c(0x247)](_0x4989fc);}else _0x26c974=JSON[_0x33505c(0x247)](_0x263db1);}catch{return console['error'](_0x33505c(0x1a8)),0x1;}if(!_0x5b66f4[_0x33505c(0x1f5)]){if(!isInteractive())return console[_0x33505c(0x2f5)](a54_0x5a87b0[_0x33505c(0x264)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x33505c(0x2f5)](a54_0x5a87b0[_0x33505c(0x1e4)](_0x33505c(0x2dd))),0x1;const _0x5f5509=await confirmKey(_0x33505c(0x348)+(_0x11f2a0?'session':_0x33505c(0x21b))+'\x20'+_0x46f80c+'?');if(!_0x5f5509)return console[_0x33505c(0x2f5)](a54_0x5a87b0[_0x33505c(0x1c9)]('Cancelled')),0x1;}let _0x16b6a4;_0x11f2a0?_0x16b6a4=await withSpinner(_0x33505c(0x244),()=>_0x5a065d['workflow'][_0x33505c(0x2f2)](_0x46f80c,{'fromTask':_0x4cf534,'retryParams':_0x26c974}),{'verbose':_0x5b66f4[_0x33505c(0x1c0)]}):_0x16b6a4=await withSpinner(_0x33505c(0x314),()=>_0x5a065d[_0x33505c(0x266)][_0x33505c(0x2c1)](_0x46f80c,{'resumeFrom':_0x207383,'retryParams':_0x26c974,'force':_0x1f8cd0}),{'verbose':_0x5b66f4[_0x33505c(0x1c0)]});const _0x4db758=_0x16b6a4[_0x33505c(0x223)];return console[_0x33505c(0x2f5)](_0x33505c(0x1b6)),console[_0x33505c(0x2f5)](_0x33505c(0x286)+_0x4db758[_0x33505c(0x1a3)]),console['error'](_0x33505c(0x1e2)+_0x4db758['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a54_0x478897(0x239);['description']=a54_0x478897(0x31a);async[a54_0x478897(0x339)](_0x1223b4){const _0x4b015e=a54_0x478897,{options:_0xb65f25,args:_0xce90b1,tdx:_0x3f20e5}=_0x1223b4;let _0x47a920=_0xce90b1[0x0];if(!_0x47a920){const _0x13751b=this[_0x4b015e(0x284)]([],_0xb65f25),_0x435cf2=await withSpinner(_0x4b015e(0x248),()=>_0x3f20e5[_0x4b015e(0x266)][_0x4b015e(0x2af)](_0x13751b,{'limit':_0xb65f25[_0x4b015e(0x1ff)]}),{'verbose':_0xb65f25[_0x4b015e(0x1c0)]}),_0x39b29d=_0x435cf2[_0x4b015e(0x223)];if(_0x39b29d['length']===0x0)return console[_0x4b015e(0x2f5)]('No\x20workflows\x20found'),!_0x13751b&&console[_0x4b015e(0x2f5)](a54_0x5a87b0[_0x4b015e(0x1e4)](_0x4b015e(0x2f1))),0x1;const _0x5d1615=_0x39b29d['map'](_0x1ef705=>({'title':_0x1ef705[_0x4b015e(0x2e5)]?.['name']+'.'+_0x1ef705[_0x4b015e(0x346)],'value':_0x1ef705['project']?.['name']+'.'+_0x1ef705[_0x4b015e(0x346)],'description':_0x1ef705[_0x4b015e(0x226)]?_0x4b015e(0x2c0)+_0x1ef705['revision']:undefined})),_0x2a1b81=await a54_0xfbc779({'type':_0x4b015e(0x30f),'name':_0x4b015e(0x266),'message':_0x4b015e(0x2b4),'choices':_0x5d1615});if(!_0x2a1b81['workflow'])return 0x1;_0x47a920=_0x2a1b81[_0x4b015e(0x266)];}if(!_0x47a920[_0x4b015e(0x1cc)]('.')){const _0x5dc404=this[_0x4b015e(0x284)]([],_0xb65f25);if(_0x5dc404)_0x47a920=_0x5dc404+'.'+_0x47a920;else return console['error'](a54_0x5a87b0[_0x4b015e(0x264)]('Error:'),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console[_0x4b015e(0x2f5)](a54_0x5a87b0['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x45fe6f=_0xb65f25[_0x4b015e(0x2a9)],_0x4def62=_0xb65f25[_0x4b015e(0x301)],_0x3aecd1={};if(_0x45fe6f&&Array[_0x4b015e(0x271)](_0x45fe6f))for(const _0x422ac8 of _0x45fe6f){const _0x20a73c=_0x422ac8['indexOf']('=');if(_0x20a73c===-0x1)return console[_0x4b015e(0x2f5)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x422ac8),console[_0x4b015e(0x2f5)](_0x4b015e(0x246)),0x1;const _0x5d7e19=_0x422ac8[_0x4b015e(0x28c)](0x0,_0x20a73c),_0x514d56=_0x422ac8['substring'](_0x20a73c+0x1);try{_0x3aecd1[_0x5d7e19]=JSON['parse'](_0x514d56);}catch{_0x3aecd1[_0x5d7e19]=_0x514d56;}}_0xb65f25['verbose']&&(console[_0x4b015e(0x2f5)](_0x4b015e(0x1e3)+_0x47a920),Object['keys'](_0x3aecd1)[_0x4b015e(0x1b1)]>0x0&&console[_0x4b015e(0x2f5)](_0x4b015e(0x2a7)+JSON[_0x4b015e(0x2cf)](_0x3aecd1)),_0x4def62&&console[_0x4b015e(0x2f5)](_0x4b015e(0x332)+_0x4def62));const _0x3a92b2=await withSpinner('Starting\x20workflow\x20run...',()=>_0x3f20e5['workflow'][_0x4b015e(0x27f)](_0x47a920,_0x3aecd1,{'sessionTime':_0x4def62}),{'verbose':_0xb65f25[_0x4b015e(0x1c0)]}),_0x56bffb=_0x3a92b2['data'];console[_0x4b015e(0x2f5)]('✔\x20Workflow\x20run\x20started'),console[_0x4b015e(0x2f5)](_0x4b015e(0x1d4)+_0x56bffb['id']),console[_0x4b015e(0x2f5)]('\x20\x20Session\x20ID:\x20'+_0x56bffb[_0x4b015e(0x25c)]),console['error'](_0x4b015e(0x299)+_0x56bffb[_0x4b015e(0x2e5)]?.[_0x4b015e(0x346)]),console[_0x4b015e(0x2f5)]('\x20\x20Workflow:\x20'+_0x56bffb[_0x4b015e(0x266)]?.[_0x4b015e(0x346)]);if(_0x56bffb[_0x4b015e(0x2e5)]?.['id']&&_0x56bffb[_0x4b015e(0x25c)]&&_0x56bffb['id']){const _0x42d0ca=_0xb65f25['site'],_0x23957e=getConsoleUrl(_0x42d0ca,'/app/workflows/'+_0x56bffb[_0x4b015e(0x2e5)]['id']+'/sessions/'+_0x56bffb[_0x4b015e(0x25c)]+_0x4b015e(0x230)+_0x56bffb['id']);console['error'](_0x4b015e(0x275)+a54_0x5a87b0[_0x4b015e(0x2c4)](_0x23957e));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a54_0x478897(0x241);[a54_0x478897(0x320)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a54_0x478897(0x339)](_0x170206){const _0x3c3e85=a54_0x478897,{options:_0x204ce3,args:_0x179958,tdx:_0x168b5a}=_0x170206,_0x18219b=_0x179958[0x0],_0x2f9124=_0x179958[0x1]||'.';if(!_0x18219b)return console['error'](_0x3c3e85(0x347)),console[_0x3c3e85(0x2f5)](_0x3c3e85(0x1e8)),0x1;const _0x5cc57f=_0x204ce3[_0x3c3e85(0x226)];_0x204ce3['verbose']&&(console['error'](_0x3c3e85(0x1d1)+_0x18219b),console[_0x3c3e85(0x2f5)](_0x3c3e85(0x29d)+_0x2f9124),_0x5cc57f&&console[_0x3c3e85(0x2f5)](_0x3c3e85(0x283)+_0x5cc57f));const _0x25d96c=await withSpinner(_0x3c3e85(0x1d8)+_0x18219b+_0x3c3e85(0x22b),()=>_0x168b5a[_0x3c3e85(0x266)][_0x3c3e85(0x26a)](_0x18219b,_0x2f9124,{'revision':_0x5cc57f}),{'verbose':_0x204ce3[_0x3c3e85(0x1c0)]}),_0x4aa304=_0x25d96c['data'];return console[_0x3c3e85(0x2f5)]('✔\x20Downloaded\x20'+_0x4aa304['projectName']),console[_0x3c3e85(0x2f5)](_0x3c3e85(0x20d)+_0x4aa304[_0x3c3e85(0x226)]),console[_0x3c3e85(0x2f5)](_0x3c3e85(0x2e9)+_0x4aa304['filesExtracted']),console['error']('\x20\x20Location:\x20'+_0x2f9124+'/'+_0x4aa304[_0x3c3e85(0x2b7)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a54_0x478897(0x259);[a54_0x478897(0x320)]=a54_0x478897(0x2df);async[a54_0x478897(0x339)](_0x192c4e){const _0x403008=a54_0x478897,{options:_0x5477f2,args:_0x1537f9,tdx:_0x81d132}=_0x192c4e;let _0x11329e='.',_0x9d26cf=_0x5477f2['name'];if(_0x1537f9[0x0]){const {promises:_0x181706}=await import('fs');try{const _0x59eb4b=await _0x181706[_0x403008(0x325)](_0x1537f9[0x0]);if(_0x59eb4b[_0x403008(0x20a)]())_0x11329e=_0x1537f9[0x0];else return console[_0x403008(0x2f5)](_0x403008(0x1ad)+_0x1537f9[0x0]+_0x403008(0x1ba)),0x1;}catch{_0x9d26cf=_0x1537f9[0x0],_0x11329e='.';}}const _0x4c5d55=_0x5477f2[_0x403008(0x226)],_0x1cae0e=_0x5477f2[_0x403008(0x19f)];_0x5477f2[_0x403008(0x1c0)]&&(console[_0x403008(0x2f5)](_0x403008(0x2da)+_0x11329e),_0x9d26cf&&console[_0x403008(0x2f5)](_0x403008(0x2b5)+_0x9d26cf),_0x4c5d55&&console['error'](_0x403008(0x283)+_0x4c5d55),_0x1cae0e&&console[_0x403008(0x2f5)](_0x403008(0x1b4)));const _0x409733=await withSpinner(_0x403008(0x28b),()=>_0x81d132[_0x403008(0x266)][_0x403008(0x240)](_0x11329e,{'projectName':_0x9d26cf,'revision':_0x4c5d55,'skipValidation':_0x1cae0e}),{'verbose':_0x5477f2[_0x403008(0x1c0)]}),_0x2658fb=_0x409733['data'];return console[_0x403008(0x2f5)](_0x403008(0x33a)+_0x2658fb[_0x403008(0x2b7)]),console[_0x403008(0x2f5)](_0x403008(0x1df)+_0x2658fb['projectId']),console['error']('\x20\x20Revision:\x20'+_0x2658fb[_0x403008(0x226)]),await this[_0x403008(0x236)](_0x81d132,_0x2658fb[_0x403008(0x2b7)],_0x5477f2[_0x403008(0x30d)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x478897(0x346)]='workflow:pull';[a54_0x478897(0x320)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async['execute'](_0x5a7400){const _0x1ee59a=a54_0x478897,{options:_0x5bfe47,args:_0x44a152,tdx:_0x873da8}=_0x5a7400,_0x200e75=_0x44a152[0x0],_0x447281=_0x44a152[0x1];if(!_0x200e75)return console[_0x1ee59a(0x2f5)](a54_0x5a87b0[_0x1ee59a(0x264)]('Error:'),_0x1ee59a(0x2d9)),console['error'](a54_0x5a87b0[_0x1ee59a(0x1e4)]('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x5baaab=_0x5bfe47['revision'];_0x5bfe47[_0x1ee59a(0x1c0)]&&(console[_0x1ee59a(0x2f5)]('Project:\x20'+_0x200e75),_0x447281&&console['error'](_0x1ee59a(0x29a)+_0x447281),_0x5baaab&&console['error'](_0x1ee59a(0x283)+_0x5baaab),_0x5bfe47[_0x1ee59a(0x1d7)]&&console[_0x1ee59a(0x2f5)]('Dry\x20run:\x20yes'));const _0x59c2bd=await withSpinner(_0x1ee59a(0x324)+_0x200e75+'...',()=>_0x873da8[_0x1ee59a(0x266)][_0x1ee59a(0x249)](_0x200e75,{'targetDir':_0x447281,'revision':_0x5baaab}),{'verbose':_0x5bfe47[_0x1ee59a(0x1c0)]}),_0x1aa498=_0x59c2bd['data'];_0x1aa498[_0x1ee59a(0x24a)]?console['error']('→\x20New\x20project:\x20'+_0x1aa498['projectName']):console['error']('→\x20Project:\x20'+_0x1aa498[_0x1ee59a(0x2b7)]);console['error']('\x20\x20Revision:\x20'+_0x1aa498[_0x1ee59a(0x226)]),console[_0x1ee59a(0x2f5)](_0x1ee59a(0x1a1)+(a54_0x2b2dff[_0x1ee59a(0x207)](process[_0x1ee59a(0x215)](),_0x1aa498[_0x1ee59a(0x234)])||'.')),console[_0x1ee59a(0x2f5)](_0x1ee59a(0x2ae)+a54_0x5a87b0[_0x1ee59a(0x31f)]('+'+_0x1aa498[_0x1ee59a(0x1a6)][_0x1ee59a(0x304)]+'\x20new')+',\x20'+(a54_0x5a87b0[_0x1ee59a(0x1c9)]('~'+_0x1aa498[_0x1ee59a(0x1a6)][_0x1ee59a(0x1b3)]+'\x20modified')+',\x20')+(a54_0x5a87b0[_0x1ee59a(0x264)]('-'+_0x1aa498['summary'][_0x1ee59a(0x2f3)]+_0x1ee59a(0x2ff))+',\x20')+(''+a54_0x5a87b0[_0x1ee59a(0x1e4)](_0x1aa498[_0x1ee59a(0x1a6)][_0x1ee59a(0x25f)]+_0x1ee59a(0x306))));for(const _0x521698 of _0x1aa498[_0x1ee59a(0x19e)]){_0x521698[_0x1ee59a(0x291)]===_0x1ee59a(0x1b3)&&_0x521698[_0x1ee59a(0x277)]&&(console['error']('\x0a'+a54_0x5a87b0[_0x1ee59a(0x2c4)](_0x1ee59a(0x329)+_0x521698['path'])),console[_0x1ee59a(0x2f5)](_0x521698[_0x1ee59a(0x277)]));}if(!_0x1aa498[_0x1ee59a(0x1eb)])return saveSessionContext({'workflow_project':_0x1aa498['projectName']},_0x5bfe47[_0x1ee59a(0x22a)]),console[_0x1ee59a(0x2f5)](a54_0x5a87b0['green']('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x1ee59a(0x2f5)](a54_0x5a87b0['dim']('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x1aa498[_0x1ee59a(0x2b7)])),0x0;if(_0x5bfe47[_0x1ee59a(0x1d7)])return console[_0x1ee59a(0x2f5)](a54_0x5a87b0[_0x1ee59a(0x1c9)](_0x1ee59a(0x268))),0x0;if(!_0x5bfe47[_0x1ee59a(0x1f5)]){if(!isInteractive())return console[_0x1ee59a(0x2f5)](a54_0x5a87b0[_0x1ee59a(0x264)](_0x1ee59a(0x211)),_0x1ee59a(0x34b)),console[_0x1ee59a(0x2f5)](a54_0x5a87b0[_0x1ee59a(0x1e4)](_0x1ee59a(0x2dd))),0x1;const _0xa59623=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0xa59623)return console['error'](a54_0x5a87b0['yellow'](_0x1ee59a(0x1ec)),_0x1ee59a(0x22f)),0x1;}await withSpinner(_0x1ee59a(0x24c),()=>_0x873da8[_0x1ee59a(0x266)][_0x1ee59a(0x19d)](_0x1aa498,{'revision':_0x5baaab}),{'verbose':_0x5bfe47['verbose']}),saveSessionContext({'workflow_project':_0x1aa498['projectName']},_0x5bfe47[_0x1ee59a(0x22a)]),console[_0x1ee59a(0x2f5)](a54_0x5a87b0[_0x1ee59a(0x31f)](_0x1ee59a(0x1c5)));const _0x1d8851=a54_0x2b2dff[_0x1ee59a(0x207)](process[_0x1ee59a(0x215)](),_0x1aa498[_0x1ee59a(0x234)])||'.';return console[_0x1ee59a(0x2f5)](a54_0x5a87b0[_0x1ee59a(0x1e4)](_0x1ee59a(0x21e)+_0x1d8851)),console[_0x1ee59a(0x2f5)](a54_0x5a87b0[_0x1ee59a(0x1e4)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x1aa498[_0x1ee59a(0x2b7)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a54_0x478897(0x346)]=a54_0x478897(0x2b8);[a54_0x478897(0x320)]='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async[a54_0x478897(0x339)](_0x3c501c){const _0x221902=a54_0x478897,{options:_0x4e3e09,args:_0x486117,tdx:_0xa37c5d}=_0x3c501c,_0x4a3c57=this[_0x221902(0x32a)](_0x486117,_0x4e3e09),_0x5d93a2=_0x4e3e09[_0x221902(0x226)],_0x16f652=_0x4e3e09[_0x221902(0x19f)];_0x4e3e09['verbose']&&(_0x4a3c57&&console[_0x221902(0x2f5)](_0x221902(0x2c7)+_0x4a3c57),_0x5d93a2&&console[_0x221902(0x2f5)](_0x221902(0x283)+_0x5d93a2),_0x4e3e09[_0x221902(0x1d7)]&&console[_0x221902(0x2f5)](_0x221902(0x312)),_0x16f652&&console[_0x221902(0x2f5)](_0x221902(0x1b4)));let _0xbf7fb3;try{_0xbf7fb3=await withSpinner(_0x221902(0x2c6),()=>_0xa37c5d[_0x221902(0x266)]['preparePushProject']({'sourceDir':_0x4a3c57,'revision':_0x5d93a2,'skipValidation':_0x16f652}),{'verbose':_0x4e3e09[_0x221902(0x1c0)]});}catch(_0x5b06b7){if(_0x5b06b7 instanceof Error&&_0x5b06b7[_0x221902(0x1a4)][_0x221902(0x1cc)](_0x221902(0x307)))return console[_0x221902(0x2f5)](a54_0x5a87b0['red'](_0x221902(0x32c)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x4e3e09[_0x221902(0x2f7)]?console[_0x221902(0x2f5)](a54_0x5a87b0['dim']('Tip:\x20cd\x20to\x20workflows/'+_0x4e3e09[_0x221902(0x2f7)]+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x4e3e09['workflowProject']+'\x27')):console[_0x221902(0x2f5)](a54_0x5a87b0[_0x221902(0x1e4)](_0x221902(0x2cb))),0x1;throw _0x5b06b7;}const _0xab789f=_0xbf7fb3[_0x221902(0x223)];console[_0x221902(0x2f5)](_0x221902(0x28a)+_0xab789f[_0x221902(0x2b7)]),console[_0x221902(0x2f5)](_0x221902(0x195)+_0xab789f[_0x221902(0x20e)]),console['error']('\x20\x20Revision:\x20'+_0xab789f['revision']),console[_0x221902(0x2f5)](_0x221902(0x2ae)+a54_0x5a87b0[_0x221902(0x31f)]('+'+_0xab789f['summary'][_0x221902(0x304)]+_0x221902(0x1e6))+',\x20'+(a54_0x5a87b0[_0x221902(0x1c9)]('~'+_0xab789f['summary']['modified']+'\x20modified')+',\x20')+(a54_0x5a87b0['red']('-'+_0xab789f['summary'][_0x221902(0x2f3)]+_0x221902(0x2ff))+',\x20')+(''+a54_0x5a87b0[_0x221902(0x1e4)](_0xab789f['summary']['unchanged']+_0x221902(0x306))));for(const _0x35f1d7 of _0xab789f['changes']){_0x35f1d7[_0x221902(0x291)]===_0x221902(0x1b3)&&_0x35f1d7[_0x221902(0x277)]&&(console['error']('\x0a'+a54_0x5a87b0[_0x221902(0x2c4)](_0x221902(0x329)+_0x35f1d7['path'])),console[_0x221902(0x2f5)](_0x35f1d7[_0x221902(0x277)]));}if(!_0xab789f[_0x221902(0x1eb)])return console['error'](a54_0x5a87b0['green'](_0x221902(0x220))),await this[_0x221902(0x236)](_0xa37c5d,_0xab789f[_0x221902(0x2b7)],_0x4e3e09[_0x221902(0x30d)]),0x0;if(_0x4e3e09[_0x221902(0x1d7)])return console['error'](a54_0x5a87b0[_0x221902(0x1c9)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x4e3e09['yes']){if(!isInteractive())return console[_0x221902(0x2f5)](a54_0x5a87b0[_0x221902(0x264)]('\x0aError:'),_0x221902(0x34b)),console[_0x221902(0x2f5)](a54_0x5a87b0[_0x221902(0x1e4)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x22d378=await confirmKey(_0x221902(0x21c));if(!_0x22d378)return console[_0x221902(0x2f5)](a54_0x5a87b0[_0x221902(0x1c9)](_0x221902(0x1ec)),_0x221902(0x321)),0x1;}const _0x25d277=await withSpinner(_0x221902(0x2fe),()=>_0xa37c5d['workflow'][_0x221902(0x2d7)](_0xab789f),{'verbose':_0x4e3e09[_0x221902(0x1c0)]}),_0x29c6db=_0x25d277[_0x221902(0x223)];return console['error'](a54_0x5a87b0['green'](_0x221902(0x203))),console[_0x221902(0x2f5)]('\x20\x20Project\x20ID:\x20'+_0x29c6db[_0x221902(0x262)]),console[_0x221902(0x2f5)](_0x221902(0x20d)+_0x29c6db['revision']),await this[_0x221902(0x236)](_0xa37c5d,_0x29c6db[_0x221902(0x2b7)],_0x4e3e09[_0x221902(0x30d)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0x478897(0x346)]=a54_0x478897(0x297);[a54_0x478897(0x320)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a54_0x478897(0x339)](_0x4bb390){const _0x54242c=a54_0x478897,{options:_0x171aaa,args:_0x55e640,tdx:_0x5d5051}=_0x4bb390,_0x5e27f9=this[_0x54242c(0x32a)](_0x55e640,_0x171aaa),_0x5aa922=_0x171aaa[_0x54242c(0x346)],_0x155b79=_0x171aaa[_0x54242c(0x226)],_0x31becb=_0x171aaa[_0x54242c(0x19f)];if(!_0x5e27f9)return console[_0x54242c(0x2f5)](a54_0x5a87b0[_0x54242c(0x264)]('Error:'),_0x54242c(0x24b)),console[_0x54242c(0x2f5)](a54_0x5a87b0[_0x54242c(0x1e4)](_0x54242c(0x1f8))),console[_0x54242c(0x2f5)](a54_0x5a87b0[_0x54242c(0x1e4)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x5aa922)return console['error'](a54_0x5a87b0['red'](_0x54242c(0x32c)),_0x54242c(0x26b)),console[_0x54242c(0x2f5)](a54_0x5a87b0[_0x54242c(0x1e4)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x171aaa[_0x54242c(0x1c0)]&&(console[_0x54242c(0x2f5)](_0x54242c(0x2c7)+_0x5e27f9),console[_0x54242c(0x2f5)]('New\x20project\x20name:\x20'+_0x5aa922),_0x155b79&&console[_0x54242c(0x2f5)](_0x54242c(0x283)+_0x155b79),_0x171aaa['dryRun']&&console[_0x54242c(0x2f5)](_0x54242c(0x312)),_0x31becb&&console[_0x54242c(0x2f5)](_0x54242c(0x1b4)));const _0x40c715=await withSpinner(_0x54242c(0x229),()=>_0x5d5051[_0x54242c(0x266)][_0x54242c(0x308)](_0x5e27f9,_0x5aa922,{'revision':_0x155b79,'skipValidation':_0x31becb}),{'verbose':_0x171aaa['verbose']}),_0x24b4e6=_0x40c715['data'];console[_0x54242c(0x2f5)](_0x54242c(0x1b0)+_0x24b4e6[_0x54242c(0x20e)]);_0x24b4e6['sourceProjectName']&&console[_0x54242c(0x2f5)](_0x54242c(0x30a)+_0x24b4e6[_0x54242c(0x2be)]);console[_0x54242c(0x2f5)](_0x54242c(0x33e)+_0x24b4e6[_0x54242c(0x1bb)]),console[_0x54242c(0x2f5)](_0x54242c(0x283)+_0x24b4e6[_0x54242c(0x226)]),console[_0x54242c(0x2f5)]('Files\x20to\x20upload:\x20'+_0x24b4e6['fileCount']);_0x24b4e6[_0x54242c(0x2d1)]&&(console[_0x54242c(0x2f5)](a54_0x5a87b0[_0x54242c(0x1c9)]('\x0a⚠\x20Project\x20\x22'+_0x24b4e6[_0x54242c(0x1bb)]+_0x54242c(0x278)+_0x24b4e6[_0x54242c(0x294)]+')')),console[_0x54242c(0x2f5)](a54_0x5a87b0[_0x54242c(0x1c9)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x171aaa['dryRun'])return console[_0x54242c(0x2f5)](a54_0x5a87b0['yellow']('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x171aaa['yes']){if(!isInteractive())return console[_0x54242c(0x2f5)](a54_0x5a87b0[_0x54242c(0x264)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x54242c(0x2f5)](a54_0x5a87b0[_0x54242c(0x1e4)](_0x54242c(0x2dd))),0x1;const _0x3642cf=_0x24b4e6[_0x54242c(0x2be)]||a54_0x2b2dff['basename'](_0x5e27f9),_0x31c52e=_0x24b4e6[_0x54242c(0x2d1)]?_0x54242c(0x256)+_0x5aa922+_0x54242c(0x285):_0x54242c(0x2ec)+_0x3642cf+'\x22\x20to\x20new\x20project\x20\x22'+_0x5aa922+'\x22?',_0x584838=await confirmKey(_0x31c52e);if(!_0x584838)return console[_0x54242c(0x2f5)](a54_0x5a87b0[_0x54242c(0x1c9)](_0x54242c(0x1ec))),0x1;}const _0x629f15=await withSpinner(_0x24b4e6[_0x54242c(0x2d1)]?_0x54242c(0x1f0)+_0x5aa922+_0x54242c(0x22b):_0x54242c(0x333)+_0x5aa922+_0x54242c(0x22b),()=>_0x5d5051[_0x54242c(0x266)][_0x54242c(0x315)](_0x24b4e6),{'verbose':_0x171aaa[_0x54242c(0x1c0)]}),_0x38b192=_0x629f15[_0x54242c(0x223)];return console['error'](a54_0x5a87b0[_0x54242c(0x31f)](_0x24b4e6['targetExists']?'✔\x20Project\x20updated':_0x54242c(0x27a))),console[_0x54242c(0x2f5)](_0x54242c(0x299)+_0x38b192[_0x54242c(0x1bb)]),console['error'](_0x54242c(0x1df)+_0x38b192[_0x54242c(0x1f1)]),console[_0x54242c(0x2f5)](_0x54242c(0x20d)+_0x38b192['revision']),await this[_0x54242c(0x236)](_0x5d5051,_0x38b192[_0x54242c(0x1bb)],_0x171aaa[_0x54242c(0x30d)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']='workflow:delete';[a54_0x478897(0x320)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a54_0x478897(0x339)](_0x47cd18){const _0x24c0ac=a54_0x478897,{options:_0x124cf3,args:_0x32492f,tdx:_0x543cbf}=_0x47cd18,_0x482277=_0x32492f[0x0];if(!_0x482277)return console['error'](_0x24c0ac(0x34d)),console[_0x24c0ac(0x2f5)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x124cf3[_0x24c0ac(0x1c0)]&&console['error'](_0x24c0ac(0x1d1)+_0x482277);if(!_0x124cf3[_0x24c0ac(0x1f5)]){if(!isInteractive())return console[_0x24c0ac(0x2f5)](a54_0x5a87b0[_0x24c0ac(0x264)](_0x24c0ac(0x211)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a54_0x5a87b0[_0x24c0ac(0x1e4)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x38277b=await confirmKey(_0x24c0ac(0x23a)+_0x482277+_0x24c0ac(0x1ef));if(!_0x38277b)return console[_0x24c0ac(0x2f5)](a54_0x5a87b0[_0x24c0ac(0x1c9)]('Cancelled')),0x1;}const _0x598735=await withSpinner(_0x24c0ac(0x29c)+_0x482277+'...',()=>_0x543cbf['workflow']['delete'](_0x482277),{'verbose':_0x124cf3[_0x24c0ac(0x1c0)]}),_0x2f6fee=_0x598735[_0x24c0ac(0x223)];return console[_0x24c0ac(0x2f5)](_0x24c0ac(0x1b2)+_0x2f6fee[_0x24c0ac(0x2b7)]),console[_0x24c0ac(0x2f5)](_0x24c0ac(0x1df)+_0x2f6fee[_0x24c0ac(0x262)]),0x0;}}export function parseKeyValue(_0x36351e){const _0x406c62=a54_0x478897,_0x31057b=_0x36351e[_0x406c62(0x2f6)]('=');if(_0x31057b===-0x1)throw new Error(_0x406c62(0x2c3)+_0x36351e+_0x406c62(0x2f4));const _0x200501=_0x36351e[_0x406c62(0x28c)](0x0,_0x31057b),_0xea32b9=_0x36351e[_0x406c62(0x28c)](_0x31057b+0x1);if(!_0x200501)throw new Error(_0x406c62(0x214));return{'key':_0x200501,'value':_0xea32b9};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x478897(0x346)]='workflow:secrets:list';[a54_0x478897(0x320)]=a54_0x478897(0x2d4);async[a54_0x478897(0x339)](_0x2762ff){const _0x4019c1=a54_0x478897,{options:_0x2a40a1,args:_0x227be1,tdx:_0x16c181}=_0x2762ff,_0x38e5ad=this[_0x4019c1(0x263)](_0x227be1,_0x2a40a1);if(!_0x38e5ad)return 0x1;_0x2a40a1['verbose']&&console[_0x4019c1(0x2f5)](_0x4019c1(0x1d1)+_0x38e5ad);const _0x475f1e=await withSpinner(_0x4019c1(0x33f),()=>_0x16c181[_0x4019c1(0x266)][_0x4019c1(0x280)](_0x38e5ad),{'verbose':_0x2a40a1[_0x4019c1(0x1c0)]}),{secrets:_0x3e97be}=_0x475f1e[_0x4019c1(0x223)];return console['error'](_0x4019c1(0x1ab)+_0x3e97be[_0x4019c1(0x1b1)]+_0x4019c1(0x2cd)+(_0x3e97be[_0x4019c1(0x1b1)]!==0x1?'s':'')),await handleSDKOutput(_0x3e97be,_0x2a40a1),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x478897(0x346)]='workflow:secrets:set';[a54_0x478897(0x320)]=a54_0x478897(0x1fb);async[a54_0x478897(0x339)](_0x42b1e7){const _0x5e1810=a54_0x478897,{options:_0x20e296,args:_0x497f11,tdx:_0x2e3de4}=_0x42b1e7;let _0x44bfd8,_0x10167e;if(_0x497f11[_0x5e1810(0x1b1)]>=0x1&&!_0x497f11[0x0]['includes']('='))_0x44bfd8=_0x497f11[0x0],_0x10167e=_0x497f11['slice'](0x1);else{if(_0x497f11[_0x5e1810(0x1b1)]>=0x1&&_0x20e296[_0x5e1810(0x2f7)])_0x44bfd8=_0x20e296[_0x5e1810(0x2f7)],_0x10167e=_0x497f11;else return _0x497f11[_0x5e1810(0x1b1)]>=0x1?(console['error'](_0x5e1810(0x347)),console[_0x5e1810(0x2f5)](_0x5e1810(0x2f1)),0x1):(console['error'](_0x5e1810(0x34f)),console[_0x5e1810(0x2f5)](_0x5e1810(0x1d6)),0x1);}if(_0x10167e[_0x5e1810(0x1b1)]===0x0)return console[_0x5e1810(0x2f5)](_0x5e1810(0x34f)),console[_0x5e1810(0x2f5)](_0x5e1810(0x1d6)),0x1;const _0x305ad6={};try{for(const _0x10fbfc of _0x10167e){const {key:_0x211f0e,value:_0x1197e4}=parseKeyValue(_0x10fbfc);_0x305ad6[_0x211f0e]=_0x1197e4;}}catch(_0x468380){return _0x468380 instanceof Error&&console[_0x5e1810(0x2f5)](a54_0x5a87b0[_0x5e1810(0x264)](_0x5e1810(0x32c)),_0x468380[_0x5e1810(0x1a4)]),0x1;}const _0xbd5947=Object[_0x5e1810(0x27b)](_0x305ad6);_0x20e296['verbose']&&(console[_0x5e1810(0x2f5)](_0x5e1810(0x1d1)+_0x44bfd8),console['error'](_0x5e1810(0x30c)+_0xbd5947['join'](',\x20')));const _0x5f16a9=await withSpinner(_0xbd5947[_0x5e1810(0x1b1)]===0x1?_0x5e1810(0x1da):'Setting\x20'+_0xbd5947['length']+_0x5e1810(0x209),()=>_0x2e3de4[_0x5e1810(0x266)][_0x5e1810(0x26f)](_0x44bfd8,_0x305ad6),{'verbose':_0x20e296[_0x5e1810(0x1c0)]}),_0x1be561=_0x5f16a9['data'];return console[_0x5e1810(0x2f5)](_0xbd5947[_0x5e1810(0x1b1)]===0x1?_0x5e1810(0x2ba)+_0x1be561[_0x5e1810(0x27b)][0x0]+_0x5e1810(0x295)+_0x1be561[_0x5e1810(0x2b7)]+'\x27':'✔\x20'+_0x1be561['keys'][_0x5e1810(0x1b1)]+_0x5e1810(0x238)+_0x1be561[_0x5e1810(0x2b7)]+'\x27'),(_0x20e296[_0x5e1810(0x221)]||_0x20e296[_0x5e1810(0x2f0)])&&await handleSingleObjectOutput(_0x1be561,_0x20e296),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0x478897(0x346)]=a54_0x478897(0x289);[a54_0x478897(0x320)]=a54_0x478897(0x206);async[a54_0x478897(0x339)](_0x264cde){const _0x2b5143=a54_0x478897,{options:_0x569b94,args:_0x280d72,tdx:_0x18252f}=_0x264cde;let _0x220d45,_0xd21765;if(_0x280d72[_0x2b5143(0x1b1)]>=0x2)_0x220d45=_0x280d72[0x0],_0xd21765=_0x280d72[0x1];else{if(_0x280d72[_0x2b5143(0x1b1)]===0x1&&_0x569b94[_0x2b5143(0x2f7)])_0x220d45=_0x569b94[_0x2b5143(0x2f7)],_0xd21765=_0x280d72[0x0];else return _0x280d72[_0x2b5143(0x1b1)]===0x1?(console[_0x2b5143(0x2f5)](_0x2b5143(0x347)),console[_0x2b5143(0x2f5)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console['error'](_0x2b5143(0x273)),console[_0x2b5143(0x2f5)](_0x2b5143(0x338)),0x1);}_0x569b94[_0x2b5143(0x1c0)]&&(console[_0x2b5143(0x2f5)](_0x2b5143(0x1d1)+_0x220d45),console['error'](_0x2b5143(0x292)+_0xd21765));if(!_0x569b94['yes']){if(!isInteractive())return console[_0x2b5143(0x2f5)](a54_0x5a87b0[_0x2b5143(0x264)](_0x2b5143(0x211)),_0x2b5143(0x34b)),console[_0x2b5143(0x2f5)](a54_0x5a87b0['dim'](_0x2b5143(0x2dd))),0x1;const _0x6abfe4=await confirmKey(_0x2b5143(0x1a0)+_0xd21765+_0x2b5143(0x219)+_0x220d45+'\x27?');if(!_0x6abfe4)return console[_0x2b5143(0x2f5)](a54_0x5a87b0[_0x2b5143(0x1c9)](_0x2b5143(0x1ec))),0x1;}const _0x1d0cd3=await withSpinner(_0x2b5143(0x2e0),()=>_0x18252f['workflow'][_0x2b5143(0x201)](_0x220d45,_0xd21765),{'verbose':_0x569b94[_0x2b5143(0x1c0)]}),_0x2a924b=_0x1d0cd3['data'];return console['error'](_0x2b5143(0x2ba)+_0x2a924b[_0x2b5143(0x261)]+_0x2b5143(0x2a6)+_0x2a924b[_0x2b5143(0x2b7)]+'\x27'),(_0x569b94[_0x2b5143(0x221)]||_0x569b94[_0x2b5143(0x2f0)])&&await handleSingleObjectOutput(_0x2a924b,_0x569b94),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(_0x33921c){const _0x11c50b=a54_0x478897,_0x3b29c7=Math[_0x11c50b(0x1fc)](_0x33921c/0x3e8),_0x50d803=Math[_0x11c50b(0x1fc)](_0x3b29c7/0x3c),_0x4af91e=Math[_0x11c50b(0x1fc)](_0x50d803/0x3c),_0x11a954=Math['floor'](_0x4af91e/0x18);if(_0x11a954>0x0){const _0x2f5f80=_0x4af91e%0x18;return _0x2f5f80>0x0?_0x11a954+'d\x20'+_0x2f5f80+'h':_0x11a954+'d';}else{if(_0x4af91e>0x0){const _0x591adf=_0x50d803%0x3c;return _0x591adf>0x0?_0x4af91e+'h\x20'+_0x591adf+'m':_0x4af91e+'h';}else{if(_0x50d803>0x0){const _0x40abaa=_0x3b29c7%0x3c;return _0x40abaa>0x0?_0x50d803+'m\x20'+_0x40abaa+'s':_0x50d803+'m';}else return _0x3b29c7+'s';}}}function formatTimestamp(_0x33874f,_0x5a8124){const _0x543a80=a54_0x478897,_0x40e745=new Date(_0x33874f),_0x9f03b6=String(_0x40e745[_0x543a80(0x1ae)]())[_0x543a80(0x318)](0x2,'0'),_0x141a34=String(_0x40e745[_0x543a80(0x34c)]())[_0x543a80(0x318)](0x2,'0'),_0x437eb2=_0x9f03b6+':'+_0x141a34,_0x58ea49=_0x40e745['getFullYear']()===_0x5a8124[_0x543a80(0x1e5)]()&&_0x40e745['getMonth']()===_0x5a8124['getMonth']()&&_0x40e745[_0x543a80(0x349)]()===_0x5a8124[_0x543a80(0x349)]();if(_0x58ea49)return _0x437eb2;else{const _0x1dc6e8=String(_0x40e745['getMonth']()+0x1)[_0x543a80(0x318)](0x2,'0'),_0x1e8399=String(_0x40e745[_0x543a80(0x349)]())[_0x543a80(0x318)](0x2,'0');return _0x1dc6e8+'-'+_0x1e8399+'\x20'+_0x437eb2;}}function formatDate(_0x49c626){const _0x3148c7=a54_0x478897,_0x3673e8=_0x49c626[_0x3148c7(0x1e5)](),_0x2d1c03=String(_0x49c626[_0x3148c7(0x316)]()+0x1)[_0x3148c7(0x318)](0x2,'0'),_0x40ed7c=String(_0x49c626[_0x3148c7(0x349)]())[_0x3148c7(0x318)](0x2,'0');return _0x3673e8+'-'+_0x2d1c03+'-'+_0x40ed7c;}function getTaskStateIcon(_0x1b2b40){const _0x428f9d={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x428f9d[_0x1b2b40]||'⚪';}function getBarChar(_0xa5defb){const _0x4c5419=a54_0x478897;return _0xa5defb===_0x4c5419(0x2f5)||_0xa5defb===_0x4c5419(0x23e)?'×':'─';}function getBarColor(_0x60359b){const _0x32157c=a54_0x478897,_0x178fa0={'success':a54_0x5a87b0[_0x32157c(0x31f)],'error':a54_0x5a87b0[_0x32157c(0x264)],'group_error':a54_0x5a87b0['red'],'running':a54_0x5a87b0[_0x32157c(0x1b5)],'blocked':a54_0x5a87b0[_0x32157c(0x1c9)],'planned':a54_0x5a87b0['dim'],'canceling':a54_0x5a87b0[_0x32157c(0x1c9)]};return _0x178fa0[_0x60359b]||a54_0x5a87b0[_0x32157c(0x30e)];}function parseTaskName(_0x1dd832){const _0x1e2731=a54_0x478897;let _0x3f353b=_0x1dd832['replace'](/^\++/,'');const _0x59aedb=_0x3f353b[_0x1e2731(0x2de)]('+'),_0x37e50c=_0x59aedb[_0x1e2731(0x1b1)]>0x1?_0x59aedb[_0x1e2731(0x1b1)]-0x2:0x0,_0x3037ed=_0x59aedb[_0x59aedb[_0x1e2731(0x1b1)]-0x1]||_0x3f353b;return{'level':_0x37e50c,'name':'+'+_0x3037ed};}function truncateTaskName(_0x63a698,_0x1f5542){const _0x39c177=a54_0x478897,_0x117867=stringWidth(_0x63a698);if(_0x117867<=_0x1f5542)return _0x63a698;let _0x1b1747=_0x63a698;while(stringWidth(_0x1b1747+'…')>_0x1f5542&&_0x1b1747[_0x39c177(0x1b1)]>0x0){_0x1b1747=_0x1b1747[_0x39c177(0x242)](0x0,-0x1);}return _0x1b1747+'…';}function calculateTimeScale(_0x416d64,_0x52a044){const _0x473c90=a54_0x478897;return{'startTime':_0x416d64['start'],'endTime':_0x416d64[_0x473c90(0x335)],'durationMs':_0x416d64[_0x473c90(0x1f6)],'msPerChar':_0x416d64[_0x473c90(0x1f6)]/_0x52a044};}function timeToPosition(_0xf6429f,_0x24b838,_0x327999){const _0x32a73b=a54_0x478897,_0x800dd0=_0xf6429f-_0x24b838[_0x32a73b(0x2bb)],_0x1d2b5c=Math[_0x32a73b(0x1fc)](_0x800dd0/_0x24b838[_0x32a73b(0x326)]);return Math[_0x32a73b(0x31e)](0x0,Math[_0x32a73b(0x1c7)](_0x1d2b5c,_0x327999));}function renderTimeAxis(_0x241b47,_0x1e71d3){const _0x528800=a54_0x478897,_0x3d7067=Math[_0x528800(0x1c7)](TIMELINE_CONFIG[_0x528800(0x218)],Math[_0x528800(0x31e)](TIMELINE_CONFIG[_0x528800(0x2ea)],Math[_0x528800(0x1fc)](_0x1e71d3/TIMELINE_CONFIG[_0x528800(0x1d2)]))),_0x493bcc=_0x241b47[_0x528800(0x2eb)]/(_0x3d7067-0x1),_0xf0d0e=new Date(_0x241b47['startTime']),_0x4daa5d=[];for(let _0x349218=0x0;_0x349218<_0x3d7067;_0x349218++){const _0x34a176=_0x241b47[_0x528800(0x2bb)]+_0x349218*_0x493bcc,_0x208951=timeToPosition(_0x34a176,_0x241b47,_0x1e71d3),_0x3b1cc4=formatTimestamp(_0x34a176,_0xf0d0e);_0x4daa5d[_0x528800(0x240)]({'pos':_0x208951,'text':_0x3b1cc4});}const _0x4d851c=new Array(_0x1e71d3)[_0x528800(0x1b8)]('\x20');let _0x364f01=-0x1;for(const {pos:_0x32a1e8,text:_0x2f2987}of _0x4daa5d){let _0x401b14=Math[_0x528800(0x31e)](0x0,_0x32a1e8-Math[_0x528800(0x1fc)](_0x2f2987[_0x528800(0x1b1)]/0x2));_0x401b14<=_0x364f01+TIMELINE_CONFIG[_0x528800(0x2bc)]&&(_0x401b14=_0x364f01+TIMELINE_CONFIG[_0x528800(0x2bc)]+0x1);_0x401b14+_0x2f2987[_0x528800(0x1b1)]>_0x1e71d3&&(_0x401b14=_0x1e71d3-_0x2f2987[_0x528800(0x1b1)]);if(_0x401b14>=0x0&&_0x401b14+_0x2f2987[_0x528800(0x1b1)]<=_0x1e71d3&&_0x401b14>_0x364f01){for(let _0x5368f4=0x0;_0x5368f4<_0x2f2987[_0x528800(0x1b1)];_0x5368f4++){_0x4d851c[_0x401b14+_0x5368f4]=_0x2f2987[_0x5368f4];}_0x364f01=_0x401b14+_0x2f2987[_0x528800(0x1b1)]-0x1;}}return _0x4d851c['join']('');}function a54_0xa03e(){const _0x2bbecf=['rows','Session\x20time:\x20','Cloning\x20to\x20','trim','end','list','workflowName','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','execute','✔\x20Pushed\x20','Enable\x20a\x20workflow\x20schedule','workflow:sessions','\x27...','New\x20project\x20name:\x20','Listing\x20secrets...','Resolving\x20project\x20\x27','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','text','reason','value','Reason:\x20','name','Error:\x20Project\x20name\x20is\x20required','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','getDate','\x20to\x20see\x20detailed\x20logs','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','getMinutes','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','icon','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','follow','workflow:schedule:disable','\x20\x20Source:\x20','now','from','\x20of\x20','MAX_TASKS_DISPLAY','pollTimeline','start','stdout','applyPullProject','changes','skipValidation','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','\x20\x20Target:\x20','2312305JfuUiH','attemptId','message','\x0a✔\x20Attempt\x20complete','summary','\x20session','Error:\x20Invalid\x20JSON\x20in\x20--params','state','\x20disabled\x20(','✔\x20Found\x20','workflow:retry','Error:\x20','getHours','Select\x20a\x20session\x20to\x20view\x20timeline:','Source:\x20','length','✔\x20Deleted\x20project\x20','modified','Validation:\x20skipped','blue','✔\x20Retry\x20started','some','fill','No\x20log\x20content\x20found','\x20is\x20not\x20a\x20directory','newProjectName','join','resumeFrom','Usage:\x20tdx\x20wf\x20use\x20<project>','startedAt','verbose','parseProjectWorkflowPattern','Listing\x20workflow\x20projects...','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','lastAttempt','✔\x20Pull\x20complete','workflow:schedules','min','buildTimelineData','yellow','Warning:','✔\x20Workflow\x20project\x20context\x20cleared.','includes','trimEnd','kill','unknown','size','Project:\x20','LABEL_WIDTH_DIVISOR','workflow:projects','\x20\x20Attempt\x20ID:\x20','planned','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','dryRun','Downloading\x20project\x20','\x1b[1A\x1b[2K','Setting\x20secret...','Auto-selected\x20latest\x20session:\x20','logs','Error:\x20Attempt\x20ID\x20is\x20required','💡\x20Tip:\x20Use\x20','\x20\x20Project\x20ID:\x20','Disable\x20a\x20workflow\x20schedule','includeSubtasks','\x20\x20Session\x20ID:\x20','Workflow:\x20','dim','getFullYear','\x20new','clear','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','\x20sessions\x20','54JMwGNe','hasChanges','Cancelled','No\x20sessions\x20with\x20timing\x20information','sort','\x22?\x20This\x20cannot\x20be\x20undone.','Updating\x20','newProjectId','set','canceling','utf-8','yes','duration','title','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','floor','📁\x20','No\x20matching\x20sessions\x20found','limit','\x20from\x20session\x20','deleteSecret','6AeztWO','✔\x20Push\x20complete','workflow:attempt','displayLine','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','relative','(unknown)','\x20secrets...','isDirectory','Status:\x20','358079cHfHBc','\x20\x20Revision:\x20','sourceDir','generateSessionTimelineRows','renderTimeline','\x0aError:','renderSessionsTimeline','attempt:','Key\x20cannot\x20be\x20empty','cwd','table','Show\x20logs\x20for\x20a\x20workflow\x20attempt','MAX_LABEL_COUNT','\x27\x20from\x20project\x20\x27','Show\x20specific\x20attempt\x20details','attempt','\x0aPush\x20these\x20changes?','MAX_TIMELINE_WIDTH','\x20\x20Location:\x20','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','\x0a✔\x20No\x20changes\x20to\x20push','json','2623376qPqCAQ','data','log','startsWith','revision','(use\x20--limit\x20to\x20see\x20more)','Including\x20subtasks:\x20yes','Analyzing\x20project...','session','...','projects','toLowerCase','Listing\x20workflow\x20sessions...','-\x20no\x20files\x20written','/attempt/','has','\x20task','format','targetDir','\x20workflow','showWorkflowConsoleUrl','5830040GijMHm','\x20secrets\x20set\x20for\x20project\x20\x27','workflow:run','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','tdx\x20wf\x20attempt\x20','task','Listing\x20workflows...','group_error','Loading\x20session...','push','workflow:download','slice','fromTask','Retrying\x20session...','repeat','Expected\x20format:\x20--param\x20key=value','parse','Loading\x20workflows...','pullProject','isNewProject','Source\x20directory\x20is\x20required','Writing\x20files...','\x20project','Killing\x20attempt...','Task\x20name:\x20','📅\x20#','Filter:\x20','toISOString','Force:\x20yes','tasks','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','\x0aUpdate\x20existing\x20project\x20\x22','Include\x20retried:\x20yes','Params:\x20','workflow:upload','Latest\x20session\x20has\x20no\x20attempt','List\x20workflow\x20attempts','sessionId','isTTY','done','unchanged','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','key','projectId','requireProject','red','Total:\x20','workflow','write','\x0aDry\x20run\x20-\x20no\x20files\x20written','params','download','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','248FpMvMT','ICON_WIDTH','setSecrets','workflow:timeline','isArray','navigateSessionsInteractive','Error:\x20Secret\x20key\x20is\x20required','List\x20workflow\x20execution\x20sessions','\x20\x20Console:\x20','Resume\x20from:\x20','diff','\x22\x20already\x20exists\x20(ID:\x20','📋\x20','✔\x20Clone\x20complete','keys','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','Kill\x20a\x20running\x20attempt','Schedule\x20ID\x20is\x20required','run','listSecrets','find','Attempt\x20ID:\x20','Revision:\x20','resolveProject','\x22\x20with\x20new\x20revision?','\x20\x20New\x20attempt\x20ID:\x20','1728528rAWNSY','all','workflow:secrets:delete','✔\x20Project:\x20','Pushing\x20workflow\x20project...','substring','output','GUTTER','1835328tACFMF','No\x20attempts\x20found','type','Key:\x20','enableSchedule','existingProjectId','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','running','workflow:clone','\x20(use\x20--limit\x20to\x20show\x20more)','\x20\x20Project:\x20','Target\x20directory:\x20','\x20has\x20no\x20attempts','Deleting\x20project\x20','Output\x20directory:\x20','\x20\x20tdx\x20wf\x20use\x20<project>','workflow:schedule:enable','workflow:logs','updatedAt','total','localeCompare','pending','tdx.json','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Parameters:\x20','nextRunTime','param','every','sessions','Project\x20filter:\x20','session:','\x20\x20Changes:\x20','workflows','No\x20attempts\x20found\x20in\x20project:\x20','fullName','No\x20workflow\x20sessions\x20found','Retry\x20a\x20session\x20or\x20attempt','Select\x20a\x20workflow\x20to\x20run','Project\x20name:\x20','columns','projectName','workflow:push','renderSingleTimeline','✔\x20Secret\x20\x27','startTime','LABEL_MIN_SPACING','index','sourceProjectName','16161aPzzfV','revision:\x20','retryAttempt','\x20-\x20','Invalid\x20format:\x20','cyan','cancelRequested','Analyzing\x20changes...','Source\x20directory:\x20','filter','\x20next:\x20','\x20(system)','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','✔\x20Showing\x20','\x20secret','finishedAt','stringify','round','targetExists','\x0aPolling...\x20(','autocomplete','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','workflow:kill','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','executePushProject','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Project\x20name\x20is\x20required','Project\x20directory:\x20','No\x20attempts\x20found\x20for:\x20','ICON_SPACING','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','split','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Deleting\x20secret...','success','taskName','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','get','project','status','match','POLL_INTERVAL_MS','\x20\x20Files\x20extracted:\x20','MIN_LABEL_COUNT','durationMs','\x0aClone\x20\x22','Disabling\x20schedule\x20#','fileSize','\x20schedule','jsonl','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','retrySession','deleted','.\x20Expected\x20format:\x20KEY=VALUE','error','indexOf','workflowProject','Session\x20','disabledAt','fs/promises','context','resolve','No\x20workflow\x20projects\x20found','Pushing\x20project...','\x20deleted','getTime','sessionTime','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Filter:\x20project=','new','✔\x20Schedule\x20#','\x20unchanged','No\x20workflow\x20tdx.json\x20found','prepareCloneProject','sys','Source\x20project:\x20','map','Secrets\x20to\x20set:\x20','site','white','select','MAX_POLL_ITERATIONS','retryAttemptName','Dry\x20run:\x20yes','window','Retrying\x20attempt...','executeCloneProject','getMonth','Loading\x20sessions...','padStart','No\x20sessions\x20found\x20in\x20project:\x20','Start\x20a\x20workflow\x20run','No\x20workflows\x20found','Getting\x20attempt\x20tasks...','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','max','green','description','-\x20nothing\x20pushed','No\x20sessions\x20found','logFiles','Pulling\x20project\x20','stat','msPerChar','createdAt','Listing\x20workflow\x20attempts...','---\x20','resolveProjectDir','toLocaleString','Error:','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','Session\x20not\x20found:\x20','\x20\x20Next\x20run:\x20','\x20(disabled)'];a54_0xa03e=function(){return _0x2bbecf;};return a54_0xa03e();}function renderTaskRow(_0x59c2b7,_0x5ec535,_0xb4160a,_0x4ec583){const _0x311ee0=a54_0x478897,{level:_0x1d8983,name:_0x4866ea}=parseTaskName(_0x59c2b7[_0x311ee0(0x346)]),_0x4f1e36='\x20'[_0x311ee0(0x245)](_0x1d8983),_0x54d319=_0x59c2b7[_0x311ee0(0x313)]?'('+formatElapsed(_0x59c2b7[_0x311ee0(0x313)][_0x311ee0(0x1f6)])+')':'',_0x56c172=stringWidth(_0x54d319),_0x33f8e4=_0x1d8983*0x1,_0x18ede5=_0x4ec583-_0x33f8e4-_0x56c172-0x1,_0x341dde=truncateTaskName(_0x4866ea,_0x18ede5),_0xc7083a=_0x4f1e36+_0x341dde,_0x2f273b=stringWidth(_0xc7083a),_0x6ea106=_0x4ec583-_0x2f273b-_0x56c172,_0x41dd37=_0xc7083a+'\x20'[_0x311ee0(0x245)](Math['max'](0x1,_0x6ea106))+a54_0x5a87b0[_0x311ee0(0x1e4)](_0x54d319),_0x4aaf72=getTaskStateIcon(_0x59c2b7[_0x311ee0(0x1a9)]),_0x368688=new Array(_0xb4160a)[_0x311ee0(0x1b8)]('\x20');if(_0x59c2b7[_0x311ee0(0x313)]){const _0x2d9b58=timeToPosition(_0x59c2b7[_0x311ee0(0x313)][_0x311ee0(0x19b)],_0x5ec535,_0xb4160a),_0x19bf73=timeToPosition(_0x59c2b7[_0x311ee0(0x313)]['end'],_0x5ec535,_0xb4160a),_0xd6ebea=getBarChar(_0x59c2b7[_0x311ee0(0x1a9)]),_0x459088=Math[_0x311ee0(0x31e)](_0x2d9b58+0x1,_0x19bf73);for(let _0xc1e873=_0x2d9b58;_0xc1e873<Math[_0x311ee0(0x1c7)](_0x459088,_0xb4160a);_0xc1e873++){_0x368688[_0xc1e873]=_0xd6ebea;}}const _0x534e74=getBarColor(_0x59c2b7[_0x311ee0(0x1a9)]),_0x302146=_0x368688[_0x311ee0(0x30b)](_0x2864d6=>_0x2864d6==='\x20'?'\x20':_0x534e74(_0x2864d6))[_0x311ee0(0x1bc)]('');return _0x4aaf72+'\x20'+_0x41dd37+'│'+_0x302146+'│';}function calculateStats(_0x4edb16){const _0x489783=a54_0x478897,_0x1ade8c={'total':_0x4edb16[_0x489783(0x1b1)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0xebdc8a of _0x4edb16){if(_0xebdc8a[_0x489783(0x1a9)]==='success')_0x1ade8c['success']++;else{if(_0xebdc8a[_0x489783(0x1a9)]===_0x489783(0x2f5)||_0xebdc8a[_0x489783(0x1a9)]==='group_error')_0x1ade8c[_0x489783(0x2f5)]++;else _0xebdc8a[_0x489783(0x1a9)]===_0x489783(0x296)?_0x1ade8c[_0x489783(0x296)]++:_0x1ade8c[_0x489783(0x2a4)]++;}}return _0x1ade8c;}function formatStats(_0x47d2e8){const _0x1a55ae=a54_0x478897;return[_0x1a55ae(0x265)+_0x47d2e8[_0x1a55ae(0x2a2)],'✅\x20'+_0x47d2e8[_0x1a55ae(0x2e1)],'❌\x20'+_0x47d2e8[_0x1a55ae(0x2f5)],'🔄\x20'+_0x47d2e8[_0x1a55ae(0x296)],'⏳\x20'+_0x47d2e8['pending']][_0x1a55ae(0x1bc)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x478897(0x346)]=a54_0x478897(0x270);[a54_0x478897(0x320)]='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async['execute'](_0x478263){const _0x2c59ad=a54_0x478897,{options:_0x413f73,args:_0x6d2d2d,tdx:_0x2c0d23}=_0x478263;let _0x3bb5e2,_0x184ab7,_0x424b36=![];if(_0x6d2d2d[0x0]){if(_0x6d2d2d[0x0][_0x2c59ad(0x1cc)]('.')){const _0x41dee6=this[_0x2c59ad(0x1c1)](_0x6d2d2d,_0x413f73);if(!_0x41dee6)return 0x1;_0x3bb5e2=_0x41dee6[_0x2c59ad(0x2b7)],_0x184ab7=_0x41dee6['workflowName'];}else{_0x184ab7=_0x6d2d2d[0x0],_0x3bb5e2=_0x413f73['workflowProject'];if(!_0x3bb5e2)return console[_0x2c59ad(0x2f5)](a54_0x5a87b0[_0x2c59ad(0x264)](_0x2c59ad(0x32c)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x424b36=!![];}}else{const _0x2f31da=this[_0x2c59ad(0x1c1)](_0x6d2d2d,_0x413f73);if(!_0x2f31da)return 0x1;_0x3bb5e2=_0x2f31da[_0x2c59ad(0x2b7)],_0x184ab7=_0x2f31da[_0x2c59ad(0x337)];}if(_0x413f73[_0x2c59ad(0x1c0)]){if(_0x3bb5e2&&_0x184ab7)console[_0x2c59ad(0x2f5)](_0x2c59ad(0x251)+_0x3bb5e2+'.'+_0x184ab7);else _0x3bb5e2&&console[_0x2c59ad(0x2f5)]('Filter:\x20project='+_0x3bb5e2);}const _0x3117e7=_0x413f73['attemptId'],_0x1f841e=_0x413f73['sessionId'];if(_0x3117e7){_0x1f841e&&console[_0x2c59ad(0x2f5)](a54_0x5a87b0[_0x2c59ad(0x1c9)](_0x2c59ad(0x1ca)),_0x2c59ad(0x341));const _0x3c0f2c=_0x413f73[_0x2c59ad(0x193)];return _0x3c0f2c?await this[_0x2c59ad(0x19a)](_0x478263,_0x3117e7):await this[_0x2c59ad(0x2b9)](_0x478263,_0x3117e7,_0x413f73),0x0;}if(_0x1f841e){const _0x3865f3=await withSpinner(_0x2c59ad(0x23f),()=>_0x2c0d23[_0x2c59ad(0x266)]['sessions']({'projectName':_0x3bb5e2,'workflowName':_0x184ab7,'limit':0x64}),{'verbose':_0x413f73['verbose']}),_0x4e6216=_0x3865f3[_0x2c59ad(0x223)]['find'](_0xd5e37d=>_0xd5e37d['id']===_0x1f841e);if(!_0x4e6216)return console['error'](a54_0x5a87b0[_0x2c59ad(0x264)]('Error:'),_0x2c59ad(0x32e)+_0x1f841e),0x1;if(!_0x4e6216['lastAttempt']?.['id'])return console[_0x2c59ad(0x2f5)](a54_0x5a87b0[_0x2c59ad(0x264)](_0x2c59ad(0x32c)),_0x2c59ad(0x2f8)+_0x1f841e+_0x2c59ad(0x29b)),0x1;const _0x10bb3e=_0x4e6216[_0x2c59ad(0x1c4)]['id'];_0x413f73['verbose']&&console[_0x2c59ad(0x2f5)]('Using\x20attempt\x20'+_0x10bb3e+_0x2c59ad(0x200)+_0x1f841e);const _0x1a4291=_0x413f73[_0x2c59ad(0x193)];return _0x1a4291?await this[_0x2c59ad(0x19a)](_0x478263,_0x10bb3e):await this['renderSingleTimeline'](_0x478263,_0x10bb3e,_0x413f73),0x0;}const _0x320bff=await withSpinner(_0x2c59ad(0x317),()=>_0x2c0d23[_0x2c59ad(0x266)][_0x2c59ad(0x2ab)]({'projectName':_0x3bb5e2,'workflowName':_0x184ab7,'limit':_0x413f73[_0x2c59ad(0x1ff)]||0x32}),{'verbose':_0x413f73[_0x2c59ad(0x1c0)]}),_0x167ef5=_0x320bff['data'];if(_0x167ef5[_0x2c59ad(0x1b1)]===0x0){if(_0x3bb5e2&&_0x184ab7)console['error']('No\x20sessions\x20found\x20for:\x20'+_0x3bb5e2+'.'+_0x184ab7);else _0x3bb5e2?console['error'](_0x2c59ad(0x319)+_0x3bb5e2):(console[_0x2c59ad(0x2f5)](_0x2c59ad(0x2b2)),console[_0x2c59ad(0x2f5)](a54_0x5a87b0[_0x2c59ad(0x1e4)](_0x2c59ad(0x31d))));return 0x0;}_0x167ef5[_0x2c59ad(0x1ee)]((_0x3b78b7,_0x34675e)=>{const _0x4efbd0=_0x2c59ad,_0x5917b5=_0x3b78b7[_0x4efbd0(0x301)]||'',_0x1119a5=_0x34675e['sessionTime']||'';return _0x1119a5[_0x4efbd0(0x2a3)](_0x5917b5);});if(_0x413f73[_0x2c59ad(0x221)]||_0x413f73[_0x2c59ad(0x2f0)])return await handleSDKOutput(_0x167ef5,_0x413f73),0x0;let _0x5b3039;if(_0x424b36){const _0x4fb7a8=_0x167ef5[0x0];if(!_0x4fb7a8['lastAttempt']?.['id'])return console[_0x2c59ad(0x2f5)](_0x2c59ad(0x25a)),0x0;_0x5b3039=_0x4fb7a8[_0x2c59ad(0x1c4)]['id'],_0x413f73[_0x2c59ad(0x1c0)]&&console[_0x2c59ad(0x2f5)](_0x2c59ad(0x1db)+_0x4fb7a8['sessionTime']);}else{const _0x110acf=_0x167ef5[_0x2c59ad(0x30b)](_0x28ddd1=>{const _0x839bd4=_0x2c59ad,_0x359d97=getAttemptStatusDisplay(_0x28ddd1[_0x839bd4(0x1c4)]);return{'title':_0x28ddd1[_0x839bd4(0x2e5)]?.[_0x839bd4(0x346)]+'.'+_0x28ddd1[_0x839bd4(0x266)]?.['name']+_0x839bd4(0x2c2)+_0x28ddd1[_0x839bd4(0x301)]+'\x20'+_0x359d97[_0x839bd4(0x34e)],'value':_0x28ddd1['lastAttempt']?.['id']||'','description':_0x359d97[_0x839bd4(0x342)]};}),_0x136f93=await a54_0xfbc779({'type':'select','name':'attemptId','message':_0x2c59ad(0x1af),'choices':_0x110acf[_0x2c59ad(0x2c8)](_0x3e8872=>_0x3e8872[_0x2c59ad(0x344)]!=='')});if(!_0x136f93[_0x2c59ad(0x1a3)])return 0x0;_0x5b3039=_0x136f93[_0x2c59ad(0x1a3)];}const _0x5729e7=_0x413f73['follow'];return _0x5729e7?await this[_0x2c59ad(0x19a)](_0x478263,_0x5b3039):await this[_0x2c59ad(0x2b9)](_0x478263,_0x5b3039,_0x413f73),0x0;}async[a54_0x478897(0x2b9)](_0x18c372,_0x263cec,_0x14ad90){const _0xac818=a54_0x478897,{tdx:_0x533f9e}=_0x18c372;let _0x8e4802,_0x59da01;try{[_0x8e4802,_0x59da01]=await Promise[_0xac818(0x288)]([_0x533f9e[_0xac818(0x266)][_0xac818(0x21b)](_0x263cec),_0x533f9e[_0xac818(0x266)][_0xac818(0x254)](_0x263cec,![])]);}catch(_0x3ffa3b){console[_0xac818(0x2f5)](a54_0x5a87b0[_0xac818(0x264)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x14ad90[_0xac818(0x1c0)]&&console['error'](_0x3ffa3b);throw _0x3ffa3b;}if(_0x14ad90['json']||_0x14ad90[_0xac818(0x2f0)]){const _0x11172c=this[_0xac818(0x1c8)](_0x8e4802,_0x59da01);await handleSDKOutput([_0x11172c],_0x14ad90);return;}const _0x4a843e=_0x533f9e[_0xac818(0x2fb)][_0xac818(0x30d)],_0x30e79b=this[_0xac818(0x210)](_0x8e4802,_0x59da01,_0x4a843e);console['log'](_0x30e79b);}async['pollTimeline'](_0x29cdf8,_0x5d2db4){const _0x2b440e=a54_0x478897,{tdx:_0x3dea7f}=_0x29cdf8,_0x43c527=TIMELINE_CONFIG[_0x2b440e(0x2e8)],_0x29e686=TIMELINE_CONFIG[_0x2b440e(0x310)];let _0x2f6514=0x0;while(_0x2f6514<_0x29e686){process[_0x2b440e(0x19c)][_0x2b440e(0x25d)]&&process[_0x2b440e(0x19c)][_0x2b440e(0x267)]('\x1bc');let _0x56ec9d,_0x377997;try{[_0x56ec9d,_0x377997]=await Promise[_0x2b440e(0x288)]([_0x3dea7f[_0x2b440e(0x266)]['attempt'](_0x5d2db4),_0x3dea7f[_0x2b440e(0x266)][_0x2b440e(0x254)](_0x5d2db4,![])]);}catch(_0x5afac7){console[_0x2b440e(0x2f5)](a54_0x5a87b0[_0x2b440e(0x264)](_0x2b440e(0x1fa)));_0x2f6514>0x0&&console[_0x2b440e(0x2f5)](a54_0x5a87b0[_0x2b440e(0x1e4)](_0x2b440e(0x1c3)+_0x2f6514));throw _0x5afac7;}const _0x48f1db=_0x3dea7f[_0x2b440e(0x2fb)][_0x2b440e(0x30d)],_0x1c46a2=this[_0x2b440e(0x210)](_0x56ec9d,_0x377997,_0x48f1db);console[_0x2b440e(0x224)](_0x1c46a2);const _0x5439e0=_0x56ec9d[_0x2b440e(0x25e)]&&_0x377997[_0x2b440e(0x2aa)](_0x36aa1f=>_0x36aa1f[_0x2b440e(0x1a9)]!==_0x2b440e(0x296)&&_0x36aa1f[_0x2b440e(0x1a9)]!==_0x2b440e(0x1d5));if(_0x5439e0){console[_0x2b440e(0x2f5)](a54_0x5a87b0[_0x2b440e(0x31f)](_0x2b440e(0x1a5)));break;}console[_0x2b440e(0x2f5)](a54_0x5a87b0[_0x2b440e(0x1e4)](_0x2b440e(0x2d2)+_0x2f6514*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x18375e=>setTimeout(_0x18375e,_0x43c527)),_0x2f6514++;}_0x2f6514>=_0x29e686&&console['error'](a54_0x5a87b0[_0x2b440e(0x1c9)](_0x2b440e(0x21f)));}[a54_0x478897(0x210)](_0x371a1f,_0x5ad92d,_0xc92ae3){const _0xc24c7=a54_0x478897,_0x219d12=[],_0x10c43b=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x5e5fc2=0x5,_0xf3db07=process[_0xc24c7(0x19c)][_0xc24c7(0x2b6)]||0x78,_0x5ef812=_0xf3db07-_0x10c43b-_0x5e5fc2,_0xefa553=Math[_0xc24c7(0x31e)](TIMELINE_CONFIG['MIN_TIMELINE_WIDTH'],Math[_0xc24c7(0x1c7)](_0x5ef812,TIMELINE_CONFIG[_0xc24c7(0x21d)])),_0x1e11fa=new Date(_0x371a1f[_0xc24c7(0x327)])[_0xc24c7(0x300)](),_0x318cb4=_0x371a1f['finishedAt']?new Date(_0x371a1f[_0xc24c7(0x2ce)])[_0xc24c7(0x300)]():Date[_0xc24c7(0x196)](),_0xaa970e={'start':_0x1e11fa,'end':_0x318cb4,'duration':_0x318cb4-_0x1e11fa},_0x4aee91=new Map(),_0x3251f3=[];for(const _0x414a90 of _0x5ad92d){if(_0x414a90[_0xc24c7(0x1bf)]){const _0x526fd4=new Date(_0x414a90['startedAt'])['getTime'](),_0xf6fc38=_0x414a90[_0xc24c7(0x2a1)]?new Date(_0x414a90[_0xc24c7(0x2a1)])[_0xc24c7(0x300)]():Date[_0xc24c7(0x196)](),_0x55a13b={'start':_0x526fd4,'end':_0xf6fc38,'duration':_0xf6fc38-_0x526fd4};_0x4aee91[_0xc24c7(0x1f2)](_0x414a90['id'],_0x55a13b),_0x3251f3[_0xc24c7(0x240)]({'name':_0x414a90['fullName'],'state':_0x414a90[_0xc24c7(0x1a9)]||'unknown','window':_0x55a13b});}else _0x3251f3[_0xc24c7(0x240)]({'name':_0x414a90[_0xc24c7(0x2b1)],'state':_0x414a90[_0xc24c7(0x1a9)]||_0xc24c7(0x1d5),'window':undefined});}_0x3251f3[_0xc24c7(0x1ee)]((_0x558bed,_0x588ad8)=>{const _0x42e1a8=_0xc24c7;if(!_0x558bed[_0x42e1a8(0x313)])return 0x1;if(!_0x588ad8['window'])return-0x1;return _0x558bed[_0x42e1a8(0x313)]['start']-_0x588ad8['window'][_0x42e1a8(0x19b)];});const _0x2ba3c1=_0x3251f3[_0xc24c7(0x1b1)],_0x4033e9=_0x2ba3c1>TIMELINE_CONFIG[_0xc24c7(0x199)];_0x4033e9&&_0x3251f3['splice'](TIMELINE_CONFIG[_0xc24c7(0x199)]);const _0x2548d5=calculateTimeScale(_0xaa970e,_0xefa553),_0x2d3d08=_0x371a1f[_0xc24c7(0x25e)]?_0x371a1f[_0xc24c7(0x2e1)]?a54_0x5a87b0['green'](_0xc24c7(0x2e1)):a54_0x5a87b0[_0xc24c7(0x264)]('error'):a54_0x5a87b0['blue'](_0xc24c7(0x296)),_0x102430=_0x371a1f['project']?.['id'],_0x2cf68b=_0x371a1f[_0xc24c7(0x25c)];let _0x2807a0;if(_0x102430&&_0x2cf68b){const _0x1dd295=getWorkflowAttemptUrl(_0xc92ae3,_0x102430,_0x2cf68b,_0x371a1f['id']);_0x2807a0=hyperlink(a54_0x5a87b0[_0xc24c7(0x1e4)](_0x371a1f['id']),_0x1dd295);}else _0x2807a0=a54_0x5a87b0[_0xc24c7(0x1e4)](_0x371a1f['id']);_0x219d12[_0xc24c7(0x240)]('Attempt:\x20'+_0x2807a0+_0xc24c7(0x2c2)+_0x2d3d08+_0xc24c7(0x2c2)+formatElapsed(_0xaa970e['duration']));if(_0x3251f3[_0xc24c7(0x1b1)]>0x0){const _0x4eba48=renderTimeAxis(_0x2548d5,_0xefa553),_0x25079f=new Date(_0xaa970e[_0xc24c7(0x19b)]),_0x38e310=formatDate(_0x25079f),_0x3399ef=TIMELINE_CONFIG[_0xc24c7(0x26e)]+TIMELINE_CONFIG[_0xc24c7(0x2dc)]+_0x10c43b,_0x1d930d=_0x38e310[_0xc24c7(0x318)](_0x3399ef),_0x1477f9=a54_0x5a87b0[_0xc24c7(0x1e4)](_0x1d930d);_0x219d12[_0xc24c7(0x240)](_0x1477f9+'\x20'+_0x4eba48);for(const _0x508dfb of _0x3251f3){_0x219d12[_0xc24c7(0x240)](renderTaskRow(_0x508dfb,_0x2548d5,_0xefa553,_0x10c43b));}const _0x4e178f=calculateStats(_0x3251f3);_0x219d12['push'](formatStats(_0x4e178f)),_0x4033e9&&_0x219d12[_0xc24c7(0x240)](a54_0x5a87b0[_0xc24c7(0x1c9)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0xc24c7(0x198)+_0x2ba3c1+'\x20tasks')),_0x219d12[_0xc24c7(0x240)](''),_0x219d12[_0xc24c7(0x240)](a54_0x5a87b0[_0xc24c7(0x1e4)](_0xc24c7(0x1de))+(_0xc24c7(0x23b)+_0x371a1f['id']+'\x20logs')+a54_0x5a87b0[_0xc24c7(0x1e4)](_0xc24c7(0x34a)));}else _0x219d12[_0xc24c7(0x240)]('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x219d12[_0xc24c7(0x1bc)]('\x0a');}['buildTimelineData'](_0x2366b0,_0x114651){const _0x54ebb9=a54_0x478897,_0x1da8dd=new Date(_0x2366b0[_0x54ebb9(0x327)])['getTime'](),_0x470132=_0x2366b0['finishedAt']?new Date(_0x2366b0[_0x54ebb9(0x2ce)])[_0x54ebb9(0x300)]():Date[_0x54ebb9(0x196)](),_0x48f07c=_0x470132-_0x1da8dd,_0x3341a3=[];for(const _0x4cac74 of _0x114651){if(_0x4cac74[_0x54ebb9(0x1bf)]){const _0x1ee1e8=new Date(_0x4cac74[_0x54ebb9(0x1bf)])['getTime'](),_0x438ba0=_0x4cac74['updatedAt']?new Date(_0x4cac74[_0x54ebb9(0x2a1)])['getTime']():Date[_0x54ebb9(0x196)]();_0x3341a3[_0x54ebb9(0x240)]({'name':_0x4cac74[_0x54ebb9(0x2b1)],'state':_0x4cac74[_0x54ebb9(0x1a9)]||'unknown','window':{'start':_0x1ee1e8,'end':_0x438ba0,'duration':_0x438ba0-_0x1ee1e8}});}else _0x3341a3[_0x54ebb9(0x240)]({'name':_0x4cac74[_0x54ebb9(0x2b1)],'state':_0x4cac74[_0x54ebb9(0x1a9)]||_0x54ebb9(0x1d5),'window':undefined});}const _0x25125f=calculateStats(_0x3341a3);return{'attempt':{'id':_0x2366b0['id'],'status':_0x2366b0['done']?_0x2366b0[_0x54ebb9(0x2e1)]?_0x54ebb9(0x2e1):_0x54ebb9(0x2f5):_0x54ebb9(0x296),'createdAt':_0x2366b0[_0x54ebb9(0x327)],'finishedAt':_0x2366b0[_0x54ebb9(0x2ce)],'duration_ms':_0x48f07c},'tasks':_0x3341a3[_0x54ebb9(0x30b)](_0x2eac72=>({'name':_0x2eac72['name'],'state':_0x2eac72[_0x54ebb9(0x1a9)],'startedAt':_0x2eac72[_0x54ebb9(0x313)]?new Date(_0x2eac72[_0x54ebb9(0x313)][_0x54ebb9(0x19b)])[_0x54ebb9(0x252)]():null,'updatedAt':_0x2eac72[_0x54ebb9(0x313)]?new Date(_0x2eac72[_0x54ebb9(0x313)][_0x54ebb9(0x335)])[_0x54ebb9(0x252)]():null,'duration_ms':_0x2eac72[_0x54ebb9(0x313)]?.[_0x54ebb9(0x1f6)]||null})),'stats':_0x25125f};}}export class WorkflowSchedulesCommand extends BaseCommand{[a54_0x478897(0x346)]=a54_0x478897(0x1c6);[a54_0x478897(0x320)]='List\x20workflow\x20schedules';async[a54_0x478897(0x339)](_0x3c2108){const _0x209d13=a54_0x478897,{options:_0x2cd182,tdx:_0xad129e}=_0x3c2108,_0x1ee156=await withSpinner('Listing\x20schedules...',()=>_0xad129e[_0x209d13(0x266)]['listSchedules'](),{'verbose':_0x2cd182['verbose']}),_0x5365a2=_0x1ee156['data'];console['error'](_0x209d13(0x1ab)+_0x5365a2[_0x209d13(0x1b1)]+_0x209d13(0x2ef)+(_0x5365a2[_0x209d13(0x1b1)]!==0x1?'s':''));if(isStructuredFormat(_0x2cd182))await handleSDKOutput(_0x5365a2,_0x2cd182);else{if(_0x5365a2[_0x209d13(0x1b1)]===0x0)console['log']('No\x20schedules\x20found');else for(const _0x490262 of _0x5365a2){const _0x4029a2=_0x490262[_0x209d13(0x2f9)]?a54_0x5a87b0[_0x209d13(0x1c9)](_0x209d13(0x330)):'',_0x196f0a=_0x490262['project']?.[_0x209d13(0x346)]?a54_0x5a87b0[_0x209d13(0x1e4)]('\x20['+_0x490262[_0x209d13(0x2e5)][_0x209d13(0x346)]+']'):'',_0x693d0b=_0x490262[_0x209d13(0x2a8)]?a54_0x5a87b0[_0x209d13(0x1e4)](_0x209d13(0x2c9)+new Date(_0x490262[_0x209d13(0x2a8)])[_0x209d13(0x32b)]()):'';console['log'](_0x209d13(0x250)+_0x490262['id']+'\x20'+(_0x490262[_0x209d13(0x266)]?.['name']||_0x209d13(0x208))+_0x196f0a+_0x4029a2+_0x693d0b);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a54_0x478897(0x346)]=a54_0x478897(0x29f);[a54_0x478897(0x320)]=a54_0x478897(0x33b);async[a54_0x478897(0x339)](_0x6bd3a6){const _0x5581bc=a54_0x478897,{options:_0x19e153,args:_0x58ae35,tdx:_0x4e4cb2}=_0x6bd3a6,_0x2226b5=_0x58ae35[0x0];if(!_0x2226b5)return console[_0x5581bc(0x2f5)](a54_0x5a87b0['red']('Error:'),'Schedule\x20ID\x20is\x20required'),console[_0x5581bc(0x2f5)](a54_0x5a87b0[_0x5581bc(0x1e4)](_0x5581bc(0x27c))),console[_0x5581bc(0x2f5)](a54_0x5a87b0[_0x5581bc(0x1e4)]('Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs')),0x1;const _0x21fd8b=await withSpinner('Enabling\x20schedule\x20#'+_0x2226b5+_0x5581bc(0x22b),()=>_0x4e4cb2[_0x5581bc(0x266)][_0x5581bc(0x293)](_0x2226b5),{'verbose':_0x19e153[_0x5581bc(0x1c0)]}),_0x239c8c=_0x21fd8b[_0x5581bc(0x223)];return isStructuredFormat(_0x19e153)?await handleSingleObjectOutput(_0x239c8c,_0x19e153):(console[_0x5581bc(0x224)](_0x5581bc(0x305)+_0x2226b5+'\x20enabled\x20('+(_0x239c8c[_0x5581bc(0x266)]?.['name']||_0x5581bc(0x1cf))+')'),_0x239c8c['nextRunTime']&&console[_0x5581bc(0x224)](a54_0x5a87b0[_0x5581bc(0x1e4)](_0x5581bc(0x32f)+new Date(_0x239c8c['nextRunTime'])[_0x5581bc(0x32b)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a54_0x478897(0x346)]=a54_0x478897(0x194);['description']=a54_0x478897(0x1e0);async['execute'](_0x593e1a){const _0x5f0876=a54_0x478897,{options:_0x164857,args:_0x11aa79,tdx:_0x50656e}=_0x593e1a,_0x3d087c=_0x11aa79[0x0];if(!_0x3d087c)return console['error'](a54_0x5a87b0[_0x5f0876(0x264)](_0x5f0876(0x32c)),_0x5f0876(0x27e)),console[_0x5f0876(0x2f5)](a54_0x5a87b0[_0x5f0876(0x1e4)](_0x5f0876(0x32d))),console[_0x5f0876(0x2f5)](a54_0x5a87b0[_0x5f0876(0x1e4)](_0x5f0876(0x2e3))),0x1;const _0x94fc0b=await withSpinner(_0x5f0876(0x2ed)+_0x3d087c+_0x5f0876(0x22b),()=>_0x50656e[_0x5f0876(0x266)]['disableSchedule'](_0x3d087c),{'verbose':_0x164857[_0x5f0876(0x1c0)]}),_0x374ba2=_0x94fc0b[_0x5f0876(0x223)];return isStructuredFormat(_0x164857)?await handleSingleObjectOutput(_0x374ba2,_0x164857):console[_0x5f0876(0x224)]('✔\x20Schedule\x20#'+_0x3d087c+_0x5f0876(0x1aa)+(_0x374ba2[_0x5f0876(0x266)]?.[_0x5f0876(0x346)]||_0x5f0876(0x1cf))+')'),0x0;}}
|
|
1
|
+
function a54_0x5540(){const _0x2075e3=['sort','resolve','pollTimeline','workflow:download','List\x20workflow\x20attempts','duration','\x20of\x20','length','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','attempt','attemptId','Using\x20attempt\x20','new','toISOString','Include\x20retried:\x20yes','force','workflow:logs','📋\x20','73742LvbHOx','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','green','name','attempts','follow','Params:\x20','isArray','Invalid\x20format:\x20','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','max','Cloning\x20to\x20','join','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Listing\x20workflow\x20sessions...','Select\x20a\x20task\x20to\x20view\x20logs:','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Workflow:\x20','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','.\x20Expected\x20format:\x20KEY=VALUE','listSecrets','taskName','5862626DqAZbn','data','✔\x20Secret\x20\x27','Output\x20directory:\x20','Listing\x20workflows...','size','\x20\x20Attempt\x20ID:\x20','startsWith','revision','workflow:run','slice','white','fs/promises','\x20\x20Target:\x20','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','projects','807dEbRyQ','deleteSecret','Analyzing\x20project...','isNewProject','Failed\x20to\x20fetch\x20attempt\x20data','\x27\x20from\x20project\x20\x27','Downloading\x20logs...','status','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Listing\x20workflow\x20attempts...','Listing\x20workflow\x20projects...','\x1b[1A\x1b[2K','Tip:\x20cd\x20to\x20workflows/','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','yes','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','fromTask','TASK_NAME_WIDTH','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','params','map','workflow:schedule:disable','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','List\x20workflows','Secrets\x20to\x20set:\x20','💡\x20Tip:\x20Use\x20','projectName','rows','Pulling\x20project\x20','\x20-\x20','getMonth','Force:\x20yes','⚠\x20Showing\x20first\x20','start','\x22\x20with\x20new\x20revision?','includeSubtasks','/attempt/','resumeFrom','diff','✔\x20Retry\x20started','✔\x20Workflow\x20project\x20context\x20cleared.','Retry\x20a\x20session\x20or\x20attempt','sessions','now','\x20modified','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','renderSingleTimeline','workflow','workflows','blue','trim','✔\x20Project\x20updated','GUTTER','→\x20Project:\x20','done','\x20\x20Workflow:\x20','renderSessionsTimeline','split','\x20next:\x20','6wzXffz','100460UeFsdR','getHours','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','LABEL_WIDTH_DIVISOR','No\x20sessions\x20found','List\x20workflow\x20schedules','Project\x20directory:\x20','reason','MAX_TIMELINE_WIDTH','Enable\x20a\x20workflow\x20schedule','getMinutes','\x20\x20Files\x20extracted:\x20','Error:\x20Invalid\x20JSON\x20in\x20--params','\x20is\x20not\x20a\x20directory','workflowProject','retrySession','No\x20workflow\x20tdx.json\x20found','summary','\x20\x20Changes:\x20','Writing\x20files...','Attempt:\x20','session','resolveProject','\x20\x20Revision:\x20','session_id','Attempt\x20ID:\x20','preparePushProject','executePushProject','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','tdx.json','match','workflow:attempt','updatedAt','repeat','navigateSessionsInteractive','Deleting\x20project\x20','→\x20New\x20project:\x20','Resolving\x20project\x20\x27','createdAt','Downloading\x20project\x20','Files\x20to\x20upload:\x20','startedAt','✔\x20Found\x20','(use\x20--limit\x20to\x20see\x20more)','filter','Loading\x20session...','getDate','fill','No\x20sessions\x20found\x20in\x20project:\x20','LABEL_MIN_SPACING','ICON_WIDTH','Error:','targetExists','\x20session','disabledAt','existingProjectId','running','Starting\x20workflow\x20run...','generateSessionTimelineRows','\x0aUpdate\x20existing\x20project\x20\x22','Retrying\x20session...','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','/sessions/','Parameters:\x20','✔\x20Pushed\x20','Target\x20directory:\x20','workflow:schedule:enable','Revision:\x20','Deleting\x20secret...','Error:\x20Project\x20name\x20is\x20required','No\x20workflows\x20found\x20in\x20project:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','...','dryRun','Source\x20directory:\x20','No\x20log\x20content\x20found','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','end','set','\x0aClone\x20\x22','\x0aError:','state','\x20new','list','workflow:delete','splice','retryAttemptName','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','replace','tdx\x20wf\x20attempt\x20','context','Session\x20time:\x20','workflow:kill','Listing\x20schedules...','cancelRequested','Task\x20name:\x20','\x20task','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Pattern:\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','\x20enabled\x20(','394555ZxnhNn','No\x20attempts\x20found\x20in\x20project:\x20','includeRetried','\x0a✔\x20No\x20changes\x20to\x20push','path','table','\x20(use\x20--limit\x20to\x20show\x20more)','write','Select\x20a\x20workflow\x20to\x20run','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Cancelled','planned','Retrying\x20attempt...','stat','cwd','\x20\x20Location:\x20','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','tasks','trimEnd','retryAttempt','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','workflow:upload','session:','text','project','red','Fetching\x20log\x20files...','setSecrets','Pull\x20workflow\x20project\x20to\x20local\x20folder','yellow','newProjectName','\x22\x20to\x20new\x20project\x20\x22','\x0aFailed\x20to\x20fetch\x20attempt\x20data','\x0aPush\x20these\x20changes?','keys','success','Kill\x20a\x20running\x20attempt','json','\x20unchanged','getFullYear','\x20workflow','verbose','limit','pending','12268mSuvFy','toLocaleString','MAX_TASKS_DISPLAY','output','site','newProjectId','execute','MAX_LABEL_COUNT','\x20project','index','unknown','log','Usage:\x20workflow:delete\x20<project-name-or-id>','durationMs','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','type','sourceProjectName','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','workflowName','✔\x20Workflow\x20project\x20set\x20to:\x20','resolveProjectId','error','dim','Filter:\x20','columns','value','\x20(disabled)','\x20secrets...','localeCompare','2072945ilzoij','skipValidation','Loading\x20workflows...','every','No\x20attempts\x20found\x20for:\x20','download','relative','Project\x20name\x20is\x20required','sessionTime','message','group_error','Getting\x20attempt\x20tasks...','sourceDir','isTTY','\x20secrets\x20set\x20for\x20project\x20\x27','No\x20attempts\x20found','canceling','resolveProjectDir','workflow:secrets:list','ICON_SPACING','jsonl','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','✔\x20Project:\x20','indexOf','Killing\x20attempt...','cyan','prepareCloneProject','substring','✔\x20Downloaded\x20','Key:\x20','MIN_TIMELINE_WIDTH','MIN_LABEL_COUNT','2529dCWDVi','attempt:','Analyzing\x20changes...','workflow:timeline','Schedule\x20ID\x20is\x20required','min','✔\x20Pull\x20complete','renderTimeline','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','-\x20nothing\x20pushed','No\x20log\x20files\x20found\x20for\x20this\x20attempt','No\x20workflow\x20projects\x20found','\x20attempt','kill','\x20sessions\x20','Error:\x20','workflow:push','workflow:use','find','(unknown)','select','title','\x20\x20tdx\x20wf\x20use\x20<project>','Listing\x20secrets...','sessionId','hasChanges','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','changes','getTime','requireProject','Updating\x20','displayLine','fileCount','Show\x20logs\x20for\x20a\x20workflow\x20attempt','startTime','Loading\x20sessions...','\x20tasks','\x20schedule','Target:\x20','disableSchedule','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','✔\x20Showing\x20','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','filesExtracted','Latest\x20session\x20has\x20no\x20attempt','Getting\x20attempt\x20details...','Select\x20a\x20session\x20to\x20view\x20timeline:','Warning:','key','Dry\x20run:\x20yes','\x20logs','task','Source:\x20','Error:\x20Secret\x20key\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Session\x20context\x20set\x20to:\x20','get','deleted','delete','Show\x20tasks\x20for\x20an\x20attempt','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','autocomplete','basename','projectId','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','Project:\x20','Resume\x20from:\x20','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','\x20\x20New\x20attempt\x20ID:\x20','parse','description','logFiles','\x20disabled\x20(','includes','\x20\x20Project:\x20','format','lastAttempt','stringify','fullName','📅\x20#','Filter:\x20project=','No\x20workflows\x20found','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','\x20from\x20session\x20','/app/workflows/','Total:\x20','✔\x20Schedule\x20#','\x0aApply\x20these\x20changes?','---\x20','pullProject','Reason:\x20','has','toLowerCase','No\x20projects\x20match\x20pattern:\x20','5911832ywGkGp','from','No\x20workflow\x20sessions\x20found','\x20(system)','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Validation:\x20skipped','buildTimelineData','floor','round','showWorkflowConsoleUrl','workflow:secrets:set','nextRunTime','-\x20no\x20files\x20written','✔\x20Clone\x20complete','Disable\x20a\x20workflow\x20schedule','\x20\x20Console:\x20','\x20\x20Source:\x20','targetDir','\x20\x20Session\x20ID:\x20','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','workflow:pull','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','push','stdout','\x0a✔\x20Attempt\x20complete','parseProjectWorkflowPattern','Session\x20','Status:\x20','padStart','Error:\x20Attempt\x20ID\x20is\x20required','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','window','unchanged','finishedAt','run','total','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','New\x20project\x20name:\x20','\x20\x20Project\x20ID:\x20','Pushing\x20project...','workflow:tasks','Expected\x20format:\x20--param\x20key=value','modified'];a54_0x5540=function(){return _0x2075e3;};return a54_0x5540();}const a54_0x1fa737=a54_0x6007;(function(_0x566793,_0x3710c7){const _0x3d12cb=a54_0x6007,_0x4b2e85=_0x566793();while(!![]){try{const _0x348bf3=parseInt(_0x3d12cb(0x147))/0x1+parseInt(_0x3d12cb(0x24b))/0x2+parseInt(_0x3d12cb(0x271))/0x3*(-parseInt(_0x3d12cb(0x173))/0x4)+parseInt(_0x3d12cb(0x190))/0x5*(-parseInt(_0x3d12cb(0x2ac))/0x6)+-parseInt(_0x3d12cb(0x261))/0x7+-parseInt(_0x3d12cb(0x20e))/0x8+parseInt(_0x3d12cb(0x1b0))/0x9*(parseInt(_0x3d12cb(0x2ad))/0xa);if(_0x348bf3===_0x3710c7)break;else _0x4b2e85['push'](_0x4b2e85['shift']());}catch(_0x27300a){_0x4b2e85['push'](_0x4b2e85['shift']());}}}(a54_0x5540,0x6afe3));function a54_0x6007(_0x1b5b29,_0x41caa1){_0x1b5b29=_0x1b5b29-0x12a;const _0x55402d=a54_0x5540();let _0x60070=_0x55402d[_0x1b5b29];return _0x60070;}import a54_0x3b7b49 from'chalk';import{existsSync}from'fs';import a54_0x2cd77d 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_0x49b152 from'prompts';function getAttemptStatusDisplay(_0x31c614){const _0x2fb178=a54_0x6007;if(!_0x31c614)return{'icon':'⏳','text':''};const {done:_0x5b45d7,success:_0x36baf1,cancelRequested:_0x797b4f}=_0x31c614;if(!_0x5b45d7)return _0x797b4f?{'icon':'🛑','text':a54_0x3b7b49[_0x2fb178(0x164)](_0x2fb178(0x1a0))}:{'icon':'🔄','text':a54_0x3b7b49[_0x2fb178(0x2a2)](_0x2fb178(0x2e5))};if(_0x36baf1)return{'icon':'✅','text':a54_0x3b7b49[_0x2fb178(0x24d)](_0x2fb178(0x16a))};return{'icon':'❌','text':a54_0x3b7b49['red'](_0x2fb178(0x188))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x1fa737(0x2c3)](_0x19a695,_0x4b1d1a,_0x58d0f8=0x0){const _0x3b36e9=a54_0x1fa737;return _0x19a695[_0x58d0f8]||_0x4b1d1a[_0x3b36e9(0x2bb)];}[a54_0x1fa737(0x1cd)](_0x4010fb,_0x1721e3,_0x5c91ee=0x0){const _0x1f67f5=a54_0x1fa737,_0x23205f=this[_0x1f67f5(0x2c3)](_0x4010fb,_0x1721e3,_0x5c91ee);if(!_0x23205f)return console[_0x1f67f5(0x188)](a54_0x3b7b49[_0x1f67f5(0x160)](_0x1f67f5(0x2e0)),_0x1f67f5(0x197)),console[_0x1f67f5(0x188)](a54_0x3b7b49[_0x1f67f5(0x189)](_0x1f67f5(0x2ea))),null;return _0x23205f;}[a54_0x1fa737(0x227)](_0x32b508,_0x17228b){const _0x20078a=a54_0x1fa737;if(_0x32b508[0x0]){const _0x376d74=_0x32b508[0x0][_0x20078a(0x2aa)]('.');if(_0x376d74[_0x20078a(0x240)]===0x1)return{'projectName':_0x376d74[0x0],'workflowName':undefined};else return _0x376d74[_0x20078a(0x240)]===0x2?{'projectName':_0x376d74[0x0],'workflowName':_0x376d74[0x1]}:(console[_0x20078a(0x188)](a54_0x3b7b49[_0x20078a(0x160)](_0x20078a(0x2e0)),_0x20078a(0x29e)),null);}return{'projectName':_0x17228b['workflowProject'],'workflowName':undefined};}[a54_0x1fa737(0x1a1)](_0x1f465b,_0x55458d,_0xdf639b=0x0){const _0x47aebc=a54_0x1fa737;if(_0x1f465b[_0xdf639b])return _0x1f465b[_0xdf639b];if(_0x55458d[_0x47aebc(0x2bb)]){const _0x4239e8=a54_0x2cd77d[_0x47aebc(0x257)](process['cwd'](),'workflows',_0x55458d['workflowProject']);if(existsSync(a54_0x2cd77d[_0x47aebc(0x257)](_0x4239e8,_0x47aebc(0x2ca))))return _0x4239e8;}return undefined;}async[a54_0x1fa737(0x217)](_0x19c73a,_0x4a9c59,_0x8fb821){const _0x5ab0f9=a54_0x1fa737;try{const _0x8e1afa=await _0x19c73a['workflow']['workflows'](_0x4a9c59,{'limit':0x1});if(_0x8e1afa[_0x5ab0f9(0x240)]>0x0){const _0x30fdf7=_0x8e1afa[0x0]['id'],_0x3fca0f=getWorkflowUrl(_0x8fb821,_0x30fdf7);console[_0x5ab0f9(0x188)](_0x5ab0f9(0x21d)+a54_0x3b7b49[_0x5ab0f9(0x1a9)](_0x3fca0f));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a54_0x1fa737(0x24e)]=a54_0x1fa737(0x1c1);[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x1d8);async[a54_0x1fa737(0x179)](_0x56faf2){const _0x4db829=a54_0x1fa737,{options:_0x41dd30,args:_0x53f4b5,tdx:_0x48ee31}=_0x56faf2,_0x1b54ac=_0x53f4b5[0x0],_0x29d018=_0x41dd30['clear'];if(_0x29d018)return saveSessionContext({'workflow_project':undefined},_0x41dd30[_0x4db829(0x2c2)]),console[_0x4db829(0x17e)](a54_0x3b7b49[_0x4db829(0x24d)](_0x4db829(0x299))),0x0;if(!_0x1b54ac)return console[_0x4db829(0x188)](a54_0x3b7b49['red'](_0x4db829(0x2e0)),'Project\x20name\x20is\x20required'),console[_0x4db829(0x188)](a54_0x3b7b49[_0x4db829(0x189)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x4db829(0x188)](a54_0x3b7b49[_0x4db829(0x189)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x48fd4=await withSpinner(_0x4db829(0x2d2)+_0x1b54ac+'\x27...',()=>_0x48ee31['workflow'][_0x4db829(0x187)](_0x1b54ac),{'verbose':_0x41dd30[_0x4db829(0x170)]}),{name:_0x4d3dc7}=_0x48fd4[_0x4db829(0x262)];return saveSessionContext({'workflow_project':_0x4d3dc7},_0x41dd30[_0x4db829(0x2c2)]),console[_0x4db829(0x17e)](a54_0x3b7b49[_0x4db829(0x24d)](_0x4db829(0x186)+a54_0x3b7b49[_0x4db829(0x1a9)](_0x4d3dc7))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x1fa737(0x24e)]='workflow:projects';[a54_0x1fa737(0x1f6)]='List\x20all\x20workflow\x20projects';async[a54_0x1fa737(0x179)](_0x44c2c1){const _0x553fb9=a54_0x1fa737,{options:_0x39b9ef,args:_0x18fc5f,tdx:_0x40416f}=_0x44c2c1,_0xa04e16=_0x18fc5f[0x0];_0x39b9ef[_0x553fb9(0x170)]&&_0xa04e16&&console[_0x553fb9(0x188)](_0x553fb9(0x144)+_0xa04e16);const _0x1d9121=await withSpinner(_0x553fb9(0x27b),()=>_0x40416f[_0x553fb9(0x2a0)][_0x553fb9(0x270)](_0xa04e16,{'limit':_0x39b9ef[_0x553fb9(0x171)]}),{'verbose':_0x39b9ef[_0x553fb9(0x170)]});let _0x600bc1=_0x1d9121[_0x553fb9(0x262)];_0x600bc1['sort']((_0x480a9e,_0x23fc29)=>_0x480a9e[_0x553fb9(0x24e)]['localeCompare'](_0x23fc29[_0x553fb9(0x24e)]));const _0x3a990e=_0x39b9ef[_0x553fb9(0x171)]||0x64,_0x51bedd=_0x600bc1[_0x553fb9(0x240)]>=_0x3a990e?a54_0x3b7b49[_0x553fb9(0x189)](_0x553fb9(0x14d)):'';console['error']('✔\x20Found\x20'+_0x600bc1['length']+_0x553fb9(0x17b)+(_0x600bc1['length']!==0x1?'s':'')+_0x51bedd);if(_0x39b9ef[_0x553fb9(0x1fb)]===_0x553fb9(0x16c)||_0x39b9ef[_0x553fb9(0x1fb)]==='jsonl'||_0x39b9ef[_0x553fb9(0x1fb)]==='table')await handleSDKOutput(_0x600bc1,_0x39b9ef);else{if(_0x600bc1[_0x553fb9(0x240)]===0x0)_0xa04e16?console[_0x553fb9(0x17e)](_0x553fb9(0x20d)+_0xa04e16):console[_0x553fb9(0x17e)](_0x553fb9(0x1bb));else{const _0xd67626=_0x600bc1[_0x553fb9(0x285)](_0x4c809=>{const _0x97f0dd=_0x553fb9,_0x182bb2=_0x4c809['metadata']?.['some'](_0x301013=>_0x301013['key']==='sys'),_0x5227eb=_0x182bb2?a54_0x3b7b49['dim'](_0x97f0dd(0x211)):'';return'📁\x20'+_0x4c809[_0x97f0dd(0x24e)]+_0x5227eb;});await writeOutput(_0xd67626['join']('\x0a'),_0x39b9ef[_0x553fb9(0x176)],_0x553fb9(0x135));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x1fa737(0x24e)]='workflow:workflows';[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x288);async[a54_0x1fa737(0x179)](_0x481970){const _0x21985e=a54_0x1fa737,{options:_0x241b5e,args:_0x56a408,tdx:_0x37aa6d}=_0x481970,_0x102291=this[_0x21985e(0x2c3)](_0x56a408,_0x241b5e);_0x241b5e[_0x21985e(0x170)]&&_0x102291&&console[_0x21985e(0x188)]('Project\x20filter:\x20'+_0x102291);const _0x298135=await withSpinner(_0x21985e(0x265),()=>_0x37aa6d[_0x21985e(0x2a0)][_0x21985e(0x2a1)](_0x102291,{'limit':_0x241b5e[_0x21985e(0x171)]}),{'verbose':_0x241b5e[_0x21985e(0x170)]});let _0x2af1d2=_0x298135[_0x21985e(0x262)];_0x2af1d2[_0x21985e(0x239)]((_0x219704,_0x70beff)=>{const _0x595d14=_0x21985e,_0x1de101=_0x219704[_0x595d14(0x24e)][_0x595d14(0x18f)](_0x70beff[_0x595d14(0x24e)]);if(_0x1de101!==0x0)return _0x1de101;return(_0x219704['project']?.[_0x595d14(0x24e)]||'')[_0x595d14(0x18f)](_0x70beff[_0x595d14(0x15f)]?.[_0x595d14(0x24e)]||'');});const _0x189282=_0x241b5e['limit']||0x64,_0x514fff=_0x2af1d2[_0x21985e(0x240)]>=_0x189282?a54_0x3b7b49[_0x21985e(0x189)](_0x21985e(0x14d)):'';console['error'](_0x21985e(0x2d7)+_0x2af1d2[_0x21985e(0x240)]+_0x21985e(0x16f)+(_0x2af1d2[_0x21985e(0x240)]!==0x1?'s':'')+_0x514fff);if(_0x241b5e['format']===_0x21985e(0x16c)||_0x241b5e[_0x21985e(0x1fb)]===_0x21985e(0x1a4)||_0x241b5e[_0x21985e(0x1fb)]===_0x21985e(0x14c))await handleSDKOutput(_0x2af1d2,_0x241b5e);else{if(_0x2af1d2[_0x21985e(0x240)]===0x0)_0x102291?console['log'](_0x21985e(0x2f3)+_0x102291):console[_0x21985e(0x17e)](_0x21985e(0x201));else{const _0x2a02bf=_0x241b5e[_0x21985e(0x177)],_0x5f09b1=_0x2af1d2['map'](_0x1981d2=>{const _0x278dbd=_0x21985e,_0xed6633=a54_0x3b7b49[_0x278dbd(0x189)]('#'+_0x1981d2['id']),_0x33a4e4=hyperlink(_0xed6633,getWorkflowUrl(_0x2a02bf,_0x1981d2['id'])),_0x393639=_0x1981d2[_0x278dbd(0x15f)]?.['name']?a54_0x3b7b49[_0x278dbd(0x189)]('\x20('+_0x1981d2[_0x278dbd(0x15f)]['name']+')'):'';return _0x278dbd(0x24a)+_0x33a4e4+'\x20'+_0x1981d2[_0x278dbd(0x24e)]+_0x393639;});await writeOutput(_0x5f09b1['join']('\x0a'),_0x241b5e[_0x21985e(0x176)],_0x21985e(0x135));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x1fa737(0x24e)]='workflow:sessions';['description']='List\x20workflow\x20execution\x20sessions';async[a54_0x1fa737(0x179)](_0x2798ca){const _0x4c18ad=a54_0x1fa737,{options:_0x363e95,args:_0x23b190,tdx:_0x7ed50a}=_0x2798ca,_0x149127=this[_0x4c18ad(0x227)](_0x23b190,_0x363e95);if(!_0x149127)return 0x1;const {projectName:_0x2ca9f5,workflowName:_0x154e17}=_0x149127;if(_0x363e95[_0x4c18ad(0x170)]){if(_0x2ca9f5&&_0x154e17)console[_0x4c18ad(0x188)]('Filter:\x20'+_0x2ca9f5+'.'+_0x154e17);else _0x2ca9f5&&console[_0x4c18ad(0x188)](_0x4c18ad(0x200)+_0x2ca9f5);const _0x45c3e6=_0x363e95[_0x4c18ad(0x278)];_0x45c3e6&&console[_0x4c18ad(0x188)](_0x4c18ad(0x229)+_0x45c3e6);}let _0x4173ca=0x28;if(process['stdout'][_0x4c18ad(0x19d)]&&!_0x363e95[_0x4c18ad(0x176)]&&!_0x363e95[_0x4c18ad(0x1fb)]){const _0x502a93=process[_0x4c18ad(0x225)][_0x4c18ad(0x28c)]||0x28;_0x4173ca=Math['max'](0x14,Math['floor'](_0x502a93*0x2/0x3));}const _0x569368=_0x363e95[_0x4c18ad(0x171)]||_0x4173ca,_0x98cd2a=await withSpinner(_0x4c18ad(0x259),()=>_0x7ed50a[_0x4c18ad(0x2a0)]['sessions']({'projectName':_0x2ca9f5,'workflowName':_0x154e17,'status':_0x363e95[_0x4c18ad(0x278)],'fromTime':_0x363e95[_0x4c18ad(0x20f)],'toTime':_0x363e95['to'],'limit':_0x569368}),{'verbose':_0x363e95[_0x4c18ad(0x170)]}),_0x190242=_0x98cd2a['data'];_0x190242[_0x4c18ad(0x239)]((_0x4967b5,_0x16ee11)=>{const _0x13e6d1=_0x4c18ad,_0x5c04ba=_0x4967b5[_0x13e6d1(0x198)]||'',_0x4b8c4c=_0x16ee11[_0x13e6d1(0x198)]||'';return _0x4b8c4c[_0x13e6d1(0x18f)](_0x5c04ba);});_0x190242['length']>=_0x569368?console[_0x4c18ad(0x188)](_0x4c18ad(0x1d9)+_0x190242[_0x4c18ad(0x240)]+_0x4c18ad(0x1be)+a54_0x3b7b49[_0x4c18ad(0x189)](_0x4c18ad(0x2d8))):console[_0x4c18ad(0x188)](_0x4c18ad(0x2d7)+_0x190242[_0x4c18ad(0x240)]+_0x4c18ad(0x2e2)+(_0x190242[_0x4c18ad(0x240)]!==0x1?'s':''));if(_0x363e95[_0x4c18ad(0x1fb)]===_0x4c18ad(0x16c)||_0x363e95[_0x4c18ad(0x1fb)]===_0x4c18ad(0x1a4)||_0x363e95[_0x4c18ad(0x1fb)]==='table')await handleSDKOutput(_0x190242,_0x363e95);else{if(!process[_0x4c18ad(0x225)]['isTTY']||_0x363e95['output']){if(_0x190242[_0x4c18ad(0x240)]===0x0){if(_0x2ca9f5&&_0x154e17)console[_0x4c18ad(0x17e)]('No\x20sessions\x20found\x20for:\x20'+_0x2ca9f5+'.'+_0x154e17);else _0x2ca9f5?console['log'](_0x4c18ad(0x2dd)+_0x2ca9f5):console[_0x4c18ad(0x17e)](_0x4c18ad(0x2b1));}else{const _0x511bca=_0x363e95[_0x4c18ad(0x177)],_0x3038a3=this['renderSessionsTimeline'](_0x190242,_0x511bca);_0x363e95[_0x4c18ad(0x176)]?await writeOutput(_0x3038a3,_0x363e95[_0x4c18ad(0x176)],_0x4c18ad(0x135)):console[_0x4c18ad(0x17e)](_0x3038a3);}!_0x2ca9f5&&(console['error'](''),console[_0x4c18ad(0x188)](a54_0x3b7b49[_0x4c18ad(0x189)](_0x4c18ad(0x150))),console[_0x4c18ad(0x188)](a54_0x3b7b49[_0x4c18ad(0x189)](_0x4c18ad(0x258))+'or'+a54_0x3b7b49[_0x4c18ad(0x189)](_0x4c18ad(0x1c6))));}else{if(_0x190242[_0x4c18ad(0x240)]===0x0){if(_0x2ca9f5&&_0x154e17)console[_0x4c18ad(0x17e)]('No\x20sessions\x20found\x20for:\x20'+_0x2ca9f5+'.'+_0x154e17);else _0x2ca9f5?console[_0x4c18ad(0x17e)](_0x4c18ad(0x2dd)+_0x2ca9f5):console['log'](_0x4c18ad(0x2b1));}else await this[_0x4c18ad(0x2cf)](_0x190242,_0x2798ca,_0x2ca9f5);}}return 0x0;}[a54_0x1fa737(0x2a9)](_0x5af120,_0x2a8ccd){const _0x46a1e0=a54_0x1fa737,_0x379c23=[],_0x3b468e=new Map();let _0x10a2cb=Infinity,_0x4f4454=-Infinity;for(const _0x6eb24d of _0x5af120){if(_0x6eb24d[_0x46a1e0(0x1fc)]?.[_0x46a1e0(0x2d3)]){const _0x539632=new Date(_0x6eb24d[_0x46a1e0(0x1fc)]['createdAt'])[_0x46a1e0(0x1cc)](),_0x1a3937=_0x6eb24d[_0x46a1e0(0x1fc)]['finishedAt']?new Date(_0x6eb24d[_0x46a1e0(0x1fc)]['finishedAt'])['getTime']():Date[_0x46a1e0(0x29c)](),_0x395da9=_0x6eb24d[_0x46a1e0(0x15f)]?.[_0x46a1e0(0x24e)]||_0x46a1e0(0x1c3);!_0x3b468e[_0x46a1e0(0x20b)](_0x395da9)&&_0x3b468e[_0x46a1e0(0x130)](_0x395da9,[]),_0x3b468e[_0x46a1e0(0x1e8)](_0x395da9)[_0x46a1e0(0x224)]({'session':_0x6eb24d,'startTime':_0x539632,'endTime':_0x1a3937,'duration':_0x1a3937-_0x539632}),_0x10a2cb=Math['min'](_0x10a2cb,_0x539632),_0x4f4454=Math[_0x46a1e0(0x255)](_0x4f4454,_0x1a3937);}}if(_0x3b468e[_0x46a1e0(0x266)]===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x31387c=process['stdout'][_0x46a1e0(0x18b)]||0x78,_0x40fd3d=0x1e,_0x585b35=0x32,_0x271140=0x4,_0x26c7f1=Math[_0x46a1e0(0x1b5)](_0x585b35,Math[_0x46a1e0(0x255)](_0x40fd3d,Math[_0x46a1e0(0x215)](_0x31387c*0.3))),_0x69d843=_0x31387c-_0x26c7f1-TIMELINE_CONFIG[_0x46a1e0(0x2a5)]-0x3-_0x271140,_0x5ca525=_0x4f4454-_0x10a2cb,_0x242c3f=_0x5ca525/_0x26c7f1,_0x5ad510=renderTimeAxis({'startTime':_0x10a2cb,'endTime':_0x4f4454,'durationMs':_0x5ca525,'msPerChar':_0x242c3f},_0x26c7f1),_0x291d7c=[];for(const _0x17068d of _0x3b468e['values']()){_0x291d7c[_0x46a1e0(0x224)](..._0x17068d);}_0x291d7c[_0x46a1e0(0x239)]((_0x49d18d,_0xab9290)=>_0xab9290['startTime']-_0x49d18d['startTime']);const _0x9ff9f8=new Date(_0x10a2cb),_0x3e1d62=formatDate(_0x9ff9f8),_0x21a1e9=_0x271140+TIMELINE_CONFIG[_0x46a1e0(0x2df)]+TIMELINE_CONFIG[_0x46a1e0(0x1a3)]+_0x69d843,_0x21484c='\x20'[_0x46a1e0(0x2ce)](_0x21a1e9-_0x3e1d62[_0x46a1e0(0x240)]),_0x54ce6d=_0x21484c+a54_0x3b7b49['dim'](_0x3e1d62)+'\x20'+_0x5ad510;_0x379c23[_0x46a1e0(0x224)](_0x54ce6d);const _0x11672c=0x16;let _0x9bca25=0x0;for(const _0x56056d of _0x291d7c){const _0x36d37f=_0x56056d[_0x46a1e0(0x2c2)]['project']?.[_0x46a1e0(0x24e)]||'?',_0x355f1f=Math[_0x46a1e0(0x1b5)](stringWidth(_0x36d37f),_0x11672c);_0x9bca25=Math[_0x46a1e0(0x255)](_0x9bca25,_0x355f1f);}for(const _0x4acacf of _0x291d7c){const {session:_0x57c07f,startTime:_0x5e8df1,endTime:_0x122890,duration:_0x14f94a}=_0x4acacf,_0x1e2fa8=_0x57c07f['project']?.['id'],_0x4b797c=_0x57c07f['id'],_0x3a0c52=_0x57c07f[_0x46a1e0(0x15f)]?.[_0x46a1e0(0x24e)]||'?',_0x22f4d7=_0x57c07f[_0x46a1e0(0x2a0)]?.['name']||'?';let _0x3a4ec4,_0x375b65;if(_0x57c07f[_0x46a1e0(0x1fc)]){const _0x858464=_0x57c07f[_0x46a1e0(0x1fc)];!_0x858464[_0x46a1e0(0x2a7)]?(_0x3a4ec4=_0x858464['cancelRequested']?'🛑':'🔄',_0x375b65=_0x858464['cancelRequested']?a54_0x3b7b49[_0x46a1e0(0x164)]:a54_0x3b7b49[_0x46a1e0(0x2a2)]):(_0x3a4ec4=_0x858464['success']?'✅':'❌',_0x375b65=_0x858464[_0x46a1e0(0x16a)]?a54_0x3b7b49[_0x46a1e0(0x24d)]:a54_0x3b7b49[_0x46a1e0(0x160)]);}else _0x3a4ec4='⏳',_0x375b65=a54_0x3b7b49[_0x46a1e0(0x189)];const _0x23daee='#'+_0x4b797c,_0x18c0a4=_0x1e2fa8?hyperlink(_0x23daee,getWorkflowSessionUrl(_0x2a8ccd,_0x1e2fa8,_0x4b797c)):_0x23daee;let _0x556d35=_0x3a0c52;stringWidth(_0x3a0c52)>_0x11672c&&(_0x556d35=_0x3a0c52[_0x46a1e0(0x26b)](0x0,_0x11672c-0x1)+'…');const _0x9b2742=a54_0x3b7b49[_0x46a1e0(0x189)](_0x556d35),_0x1fea57=stringWidth(_0x556d35),_0x23c61b='\x20'['repeat'](_0x9bca25-stringWidth(_0x556d35)+0x2),_0x54284a='('+formatElapsed(_0x14f94a)+')',_0x2b647e=stringWidth(_0x54284a),_0x219fd5=stringWidth(_0x23daee),_0x4bda82=_0x219fd5+0x1+_0x1fea57+_0x23c61b[_0x46a1e0(0x240)],_0x1bae1c=_0x69d843-_0x4bda82-_0x2b647e-0x1-0x8;let _0x8bc76b=_0x22f4d7;stringWidth(_0x8bc76b)>_0x1bae1c&&(_0x8bc76b=_0x8bc76b['slice'](0x0,_0x1bae1c-0x1)+'…');const _0x3d3d60=_0x18c0a4+'\x20'+_0x9b2742+_0x23c61b+_0x8bc76b,_0x142ac6=stringWidth(_0x3d3d60),_0x4ead22=_0x69d843-_0x142ac6-_0x2b647e,_0x273f15=_0x3d3d60+'\x20'[_0x46a1e0(0x2ce)](Math['max'](0x1,_0x4ead22))+a54_0x3b7b49[_0x46a1e0(0x189)](_0x54284a),_0x4ac4cf=Math[_0x46a1e0(0x215)]((_0x5e8df1-_0x10a2cb)/_0x242c3f),_0x57bb8a=Math[_0x46a1e0(0x215)]((_0x122890-_0x10a2cb)/_0x242c3f),_0x253ab7=Math[_0x46a1e0(0x255)](_0x4ac4cf+0x1,_0x57bb8a),_0xd9b629=new Array(_0x26c7f1)['fill']('\x20');for(let _0x4ba968=_0x4ac4cf;_0x4ba968<Math[_0x46a1e0(0x1b5)](_0x253ab7,_0x26c7f1);_0x4ba968++){_0xd9b629[_0x4ba968]='─';}const _0x36e7c3=_0xd9b629[_0x46a1e0(0x285)](_0x1ec78f=>_0x1ec78f==='\x20'?'\x20':_0x375b65(_0x1ec78f))['join']('');_0x379c23[_0x46a1e0(0x224)](_0x3a4ec4+'\x20'+_0x273f15+'│'+_0x36e7c3+'│');}return _0x379c23[_0x46a1e0(0x257)]('\x0a');}async[a54_0x1fa737(0x2cf)](_0x4c8ad9,_0x491745,_0x47abfb){const _0xf016d6=a54_0x1fa737,{options:_0xa3f7bd,tdx:_0x5a513b}=_0x491745,_0x57d023=_0xa3f7bd['site'],{timelineRows:_0xab174d,timeAxisHeader:_0x2c34e2}=this[_0xf016d6(0x2e7)](_0x4c8ad9,_0x57d023),_0x429cbe=_0xab174d[_0xf016d6(0x2d9)](_0x954fea=>_0x954fea[_0xf016d6(0x243)]);if(_0x429cbe[_0xf016d6(0x240)]===0x0){const _0x433d74=this[_0xf016d6(0x2a9)](_0x4c8ad9,_0x57d023);console['log'](_0x433d74);!_0x47abfb&&(console[_0xf016d6(0x188)](''),console[_0xf016d6(0x188)](a54_0x3b7b49[_0xf016d6(0x189)](_0xf016d6(0x150))),console[_0xf016d6(0x188)](a54_0x3b7b49['dim']('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a54_0x3b7b49[_0xf016d6(0x189)](_0xf016d6(0x1c6))));return;}_0x2c34e2&&console[_0xf016d6(0x17e)](_0x2c34e2);const _0xd9ba79=_0xab174d['filter'](_0x478c7d=>_0x478c7d[_0xf016d6(0x243)])['map'](_0x72aec6=>({'title':_0x72aec6[_0xf016d6(0x1cf)],'value':_0x72aec6[_0xf016d6(0x243)]})),_0x5243ba=process[_0xf016d6(0x225)][_0xf016d6(0x28c)]||0x3c,_0x2eb04d=Math[_0xf016d6(0x255)](0x28,Math[_0xf016d6(0x215)](_0x5243ba*0x2/0x3)),_0x496964=await a54_0x49b152({'type':_0xf016d6(0x1ed),'name':_0xf016d6(0x243),'message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0xd9ba79,'initial':-0x1,'limit':_0x2eb04d,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x59c048,_0x482adc)=>{const _0x24fdee=_0xf016d6;if(!_0x59c048)return Promise[_0x24fdee(0x23a)](_0x482adc);const _0x2e0ba0=_0x482adc[_0x24fdee(0x2d9)](_0x5fc6cf=>{const _0x392cf0=_0x24fdee,_0x424db6=_0x5fc6cf;return _0x424db6[_0x392cf0(0x1c5)][_0x392cf0(0x20c)]()['includes'](_0x59c048[_0x392cf0(0x20c)]());});return Promise[_0x24fdee(0x23a)](_0x2e0ba0);}}),_0x2ed005=()=>{const _0x13db09=_0xf016d6;process[_0x13db09(0x225)][_0x13db09(0x14e)](_0x13db09(0x27c)),process[_0x13db09(0x225)]['write'](_0x13db09(0x27c)),process['stdout'][_0x13db09(0x14e)](_0x13db09(0x27c));},_0x3c652d=_0x496964&&_0x496964[_0xf016d6(0x243)]&&_0x496964['attemptId']!==null&&_0x496964[_0xf016d6(0x243)][_0xf016d6(0x2a3)]()!=='';if(!_0x3c652d){_0x2ed005(),console[_0xf016d6(0x17e)](a54_0x3b7b49[_0xf016d6(0x189)]('Cancelled'));return;}_0x2ed005();const _0x319202=_0x4c8ad9['find'](_0x2e9091=>_0x2e9091[_0xf016d6(0x1fc)]?.['id']===_0x496964[_0xf016d6(0x243)]);if(_0x319202){const _0x5e002a=_0x319202[_0xf016d6(0x15f)]?.['name']||'?',_0x274f00=_0x319202['workflow']?.[_0xf016d6(0x24e)]||'?';console[_0xf016d6(0x17e)]('Project:\x20'+a54_0x3b7b49['dim'](_0x5e002a)+',\x20Workflow:\x20'+a54_0x3b7b49[_0xf016d6(0x189)](_0x274f00));}const _0x261b01=new WorkflowTimelineCommand();await _0x261b01[_0xf016d6(0x179)]({'args':[],'options':{..._0xa3f7bd,'attemptId':_0x496964[_0xf016d6(0x243)]},'tdx':_0x5a513b});}['generateSessionTimelineRows'](_0x35731c,_0xd01f1c){const _0x2e5487=a54_0x1fa737,_0x15e659=new Map();for(const _0x24741c of _0x35731c){_0x24741c['id']&&_0x24741c['lastAttempt']?.['id']&&_0x15e659[_0x2e5487(0x130)](_0x24741c['id'],_0x24741c[_0x2e5487(0x1fc)]['id']);}const _0x29d5d1=[];let _0x3952ae='';const _0x46e43c=this['renderSessionsTimeline'](_0x35731c,_0xd01f1c),_0x140700=_0x46e43c[_0x2e5487(0x2aa)]('\x0a');for(const _0x4a297c of _0x140700){if(_0x4a297c['startsWith'](_0x2e5487(0x1e6))||_0x4a297c[_0x2e5487(0x2cb)](/^\s+\d{4}-\d{2}-\d{2}/))_0x3952ae=_0x4a297c;else{if(_0x4a297c[_0x2e5487(0x2cb)](/^[✅❌🔄🛑⏳]/)){const _0x2c239d=_0x4a297c['match'](/#(\d+)/),_0x4abf8c=_0x2c239d?_0x2c239d[0x1]:null,_0x21a910=_0x4abf8c?_0x15e659[_0x2e5487(0x1e8)](_0x4abf8c)||null:null,_0x57b99e=_0x35731c[_0x2e5487(0x1c2)](_0x698a6d=>_0x698a6d['id']===_0x4abf8c),_0x3ec4c5=_0x57b99e?.['project']?.['name']||'';_0x29d5d1[_0x2e5487(0x224)]({'displayLine':_0x4a297c,'attemptId':_0x21a910,'projectName':_0x3ec4c5});}}}return{'timelineRows':_0x29d5d1,'timeAxisHeader':_0x3952ae};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']='workflow:attempts';[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x23d);async['execute'](_0x23e92f){const _0x3788f6=a54_0x1fa737,{options:_0x40a899,args:_0x10f2a3,tdx:_0x36887c}=_0x23e92f,_0x5f05f1=this[_0x3788f6(0x227)](_0x10f2a3,_0x40a899);if(!_0x5f05f1)return 0x1;const {projectName:_0x454ee6,workflowName:_0x366bd9}=_0x5f05f1,_0x5cebba=_0x40a899[_0x3788f6(0x149)];if(_0x40a899[_0x3788f6(0x170)]){if(_0x454ee6&&_0x366bd9)console[_0x3788f6(0x188)](_0x3788f6(0x18a)+_0x454ee6+'.'+_0x366bd9);else _0x454ee6&&console['error'](_0x3788f6(0x200)+_0x454ee6);_0x5cebba&&console[_0x3788f6(0x188)](_0x3788f6(0x247));}const _0x3f11a7=await withSpinner(_0x3788f6(0x27a),()=>_0x36887c[_0x3788f6(0x2a0)][_0x3788f6(0x24f)]({'projectName':_0x454ee6,'workflowName':_0x366bd9,'includeRetried':_0x5cebba,'limit':_0x40a899['limit']}),{'verbose':_0x40a899['verbose']}),_0x3bc9b5=_0x3f11a7[_0x3788f6(0x262)],_0x292954=_0x40a899[_0x3788f6(0x171)]||0x64,_0x57d353=_0x3bc9b5[_0x3788f6(0x240)]>=_0x292954?a54_0x3b7b49[_0x3788f6(0x189)](_0x3788f6(0x14d)):'';console[_0x3788f6(0x188)](_0x3788f6(0x2d7)+_0x3bc9b5[_0x3788f6(0x240)]+_0x3788f6(0x1bc)+(_0x3bc9b5[_0x3788f6(0x240)]!==0x1?'s':'')+_0x57d353);if(_0x40a899[_0x3788f6(0x1fb)]===_0x3788f6(0x16c)||_0x40a899[_0x3788f6(0x1fb)]==='jsonl'||_0x40a899[_0x3788f6(0x1fb)]==='table')await handleSDKOutput(_0x3bc9b5,_0x40a899);else{if(_0x3bc9b5[_0x3788f6(0x240)]===0x0){if(_0x454ee6&&_0x366bd9)console['log'](_0x3788f6(0x194)+_0x454ee6+'.'+_0x366bd9);else _0x454ee6?console[_0x3788f6(0x17e)](_0x3788f6(0x148)+_0x454ee6):console[_0x3788f6(0x17e)](_0x3788f6(0x19f));}else{const _0x40b6db=_0x40a899[_0x3788f6(0x177)],_0x5c34a4=_0x3bc9b5[_0x3788f6(0x285)](_0xe6451b=>{const _0x6fe108=_0x3788f6,_0x4dc2d6=a54_0x3b7b49[_0x6fe108(0x189)]('#'+_0xe6451b['id']),_0x20d8fd=_0xe6451b['project']?.['id'],_0x3a2a90=_0xe6451b[_0x6fe108(0x2c5)]||_0xe6451b['sessionId'],_0xda51e2=_0x20d8fd&&_0x3a2a90?hyperlink(_0x4dc2d6,getWorkflowAttemptUrl(_0x40b6db,_0x20d8fd,_0x3a2a90,_0xe6451b['id'])):_0x4dc2d6,{icon:_0x49e6f1,text:_0x57c1b0}=getAttemptStatusDisplay(_0xe6451b),_0x2be812=(_0xe6451b[_0x6fe108(0x15f)]?.[_0x6fe108(0x24e)]||'?')+'.'+(_0xe6451b[_0x6fe108(0x2a0)]?.[_0x6fe108(0x24e)]||'?'),_0x572bbe=_0xe6451b[_0x6fe108(0x198)]?a54_0x3b7b49[_0x6fe108(0x189)](_0xe6451b[_0x6fe108(0x198)]):'';return(_0xda51e2+'\x20'+_0x49e6f1+(_0x57c1b0?'\x20'+_0x57c1b0:'')+'\x20'+_0x2be812+'\x20'+_0x572bbe)[_0x6fe108(0x159)]();});await writeOutput(_0x5c34a4[_0x3788f6(0x257)]('\x0a'),_0x40a899[_0x3788f6(0x176)],_0x3788f6(0x135));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a54_0x1fa737(0x2cc);[a54_0x1fa737(0x1f6)]='Show\x20specific\x20attempt\x20details';async[a54_0x1fa737(0x179)](_0x3de35e){const _0x33d350=a54_0x1fa737,{options:_0x11b651,args:_0x525f66,tdx:_0x3000aa}=_0x3de35e,_0x23cfc9=_0x525f66[0x0];if(!_0x23cfc9)return console[_0x33d350(0x188)](_0x33d350(0x22b)),0x1;_0x11b651['verbose']&&console['error'](_0x33d350(0x2c6)+_0x23cfc9);const _0x6e46f6=await withSpinner(_0x33d350(0x1dd),()=>_0x3000aa['workflow']['attempt'](_0x23cfc9),{'verbose':_0x11b651[_0x33d350(0x170)]}),_0x2d1e5b=_0x6e46f6[_0x33d350(0x262)];let _0x2e24d0;!_0x2d1e5b[_0x33d350(0x2a7)]?_0x2e24d0=_0x2d1e5b[_0x33d350(0x140)]?_0x33d350(0x1a0):_0x33d350(0x2e5):_0x2e24d0=_0x2d1e5b[_0x33d350(0x16a)]?_0x33d350(0x16a):_0x33d350(0x188);let _0x34dbae;if(_0x2d1e5b[_0x33d350(0x2d3)]&&_0x2d1e5b[_0x33d350(0x22f)]){const _0x3f4326=new Date(_0x2d1e5b[_0x33d350(0x2d3)])[_0x33d350(0x1cc)](),_0x31240a=new Date(_0x2d1e5b['finishedAt'])['getTime']();_0x34dbae=Math[_0x33d350(0x216)]((_0x31240a-_0x3f4326)/0x3e8);}const _0x178ef1={'attempt_id':_0x2d1e5b['id'],'status':_0x2e24d0,..._0x2d1e5b[_0x33d350(0x17c)]!==undefined&&{'index':_0x2d1e5b[_0x33d350(0x17c)]},..._0x2d1e5b[_0x33d350(0x15f)]&&{'project':_0x2d1e5b[_0x33d350(0x15f)][_0x33d350(0x24e)]},..._0x2d1e5b['workflow']&&{'workflow':_0x2d1e5b['workflow'][_0x33d350(0x24e)]},..._0x2d1e5b[_0x33d350(0x1c8)]&&{'session_id':_0x2d1e5b[_0x33d350(0x1c8)]},..._0x2d1e5b[_0x33d350(0x198)]&&{'session_time':_0x2d1e5b[_0x33d350(0x198)]},..._0x2d1e5b[_0x33d350(0x138)]&&{'retry_attempt':_0x2d1e5b[_0x33d350(0x138)]},..._0x34dbae!==undefined&&{'duration_sec':_0x34dbae},..._0x2d1e5b[_0x33d350(0x2d3)]&&{'created_at':_0x2d1e5b[_0x33d350(0x2d3)]},..._0x2d1e5b[_0x33d350(0x22f)]&&{'finished_at':_0x2d1e5b[_0x33d350(0x22f)]},...Object[_0x33d350(0x169)](_0x2d1e5b[_0x33d350(0x284)])[_0x33d350(0x240)]>0x0&&{'params':_0x2d1e5b['params']}};return await handleSingleObjectOutput(_0x178ef1,_0x11b651),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a54_0x1fa737(0x236);['description']=a54_0x1fa737(0x1eb);async[a54_0x1fa737(0x179)](_0x595c53){const _0x1f23ec=a54_0x1fa737,{options:_0x1058df,args:_0x57806f,tdx:_0x591a8d}=_0x595c53,_0x4982ef=_0x57806f[0x0];if(!_0x4982ef)return console[_0x1f23ec(0x188)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x235d7f=_0x1058df[_0x1f23ec(0x294)];_0x1058df['verbose']&&(console[_0x1f23ec(0x188)](_0x1f23ec(0x2c6)+_0x4982ef),_0x235d7f&&console[_0x1f23ec(0x188)]('Including\x20subtasks:\x20yes'));const _0x2d3460=await withSpinner(_0x1f23ec(0x19b),()=>_0x591a8d['workflow'][_0x1f23ec(0x158)](_0x4982ef,_0x235d7f||![]),{'verbose':_0x1058df['verbose']}),_0x4fa37d=_0x2d3460[_0x1f23ec(0x262)];return console[_0x1f23ec(0x188)](_0x1f23ec(0x2d7)+_0x4fa37d[_0x1f23ec(0x240)]+_0x1f23ec(0x142)+(_0x4fa37d['length']!==0x1?'s':'')),await handleSDKOutput(_0x4fa37d,_0x1058df),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0x1fa737(0x24e)]=a54_0x1fa737(0x249);[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x1d1);async[a54_0x1fa737(0x179)](_0x1e4b57){const _0x28b2e9=a54_0x1fa737,{options:_0x3b9fdf,args:_0x2f7abe,tdx:_0x261b17}=_0x1e4b57,_0x34acda=_0x2f7abe[0x0];let _0xe21a55=_0x2f7abe[0x1];if(!_0x34acda)return console[_0x28b2e9(0x188)](_0x28b2e9(0x22b)),0x1;_0x3b9fdf[_0x28b2e9(0x170)]&&(console[_0x28b2e9(0x188)]('Attempt\x20ID:\x20'+_0x34acda),_0xe21a55&&console['error'](_0x28b2e9(0x141)+_0xe21a55));const _0x41427d=await withSpinner(_0x28b2e9(0x161),()=>_0x261b17[_0x28b2e9(0x2a0)][_0x28b2e9(0x1f7)](_0x34acda,_0xe21a55),{'verbose':_0x3b9fdf[_0x28b2e9(0x170)]}),_0x4eaa2f=_0x41427d['data'];if(_0x4eaa2f[_0x28b2e9(0x240)]===0x0)return console['error'](_0x28b2e9(0x1ba)),0x0;if(!_0xe21a55&&(_0x3b9fdf['json']||_0x3b9fdf[_0x28b2e9(0x1fb)]))return await handleSDKOutput(_0x4eaa2f,_0x3b9fdf),0x0;if(!_0xe21a55){const _0x262dc2=_0x4eaa2f[_0x28b2e9(0x285)](_0x60f54a=>({'title':_0x60f54a[_0x28b2e9(0x260)]+'\x20('+formatBytes(_0x60f54a['fileSize'])+')','value':_0x60f54a[_0x28b2e9(0x260)]})),_0x44bc45=await a54_0x49b152({'type':_0x28b2e9(0x1c4),'name':_0x28b2e9(0x1e3),'message':_0x28b2e9(0x25a),'choices':_0x262dc2});if(!_0x44bc45[_0x28b2e9(0x1e3)])return console['error'](_0x28b2e9(0x151)),0x0;_0xe21a55=_0x44bc45[_0x28b2e9(0x1e3)];}const _0x360c41=await withSpinner(_0x28b2e9(0x277),()=>_0x261b17[_0x28b2e9(0x2a0)]['logs'](_0x34acda,_0xe21a55),{'verbose':_0x3b9fdf[_0x28b2e9(0x170)]}),_0x4a94cc=_0x360c41[_0x28b2e9(0x262)];return _0x4a94cc?console['log'](_0x4a94cc):console['error'](_0x28b2e9(0x12d)),0x0;}}export class WorkflowKillCommand extends BaseCommand{['name']=a54_0x1fa737(0x13e);[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x16b);async[a54_0x1fa737(0x179)](_0x123b8d){const _0x1bd957=a54_0x1fa737,{options:_0x475b41,args:_0x19452a,tdx:_0x237745}=_0x123b8d,_0x2f0b9e=_0x19452a[0x0];if(!_0x2f0b9e)return console[_0x1bd957(0x188)](_0x1bd957(0x22b)),0x1;const _0x1c1631=_0x475b41[_0x1bd957(0x2b4)];_0x475b41[_0x1bd957(0x170)]&&(console[_0x1bd957(0x188)](_0x1bd957(0x2c6)+_0x2f0b9e),_0x1c1631&&console[_0x1bd957(0x188)](_0x1bd957(0x20a)+_0x1c1631));if(!_0x475b41['yes']){if(!isInteractive())return console[_0x1bd957(0x188)](a54_0x3b7b49[_0x1bd957(0x160)](_0x1bd957(0x132)),_0x1bd957(0x223)),console['error'](a54_0x3b7b49[_0x1bd957(0x189)](_0x1bd957(0x283))),0x1;const _0x364bb2=await confirmKey(_0x1bd957(0x232)+_0x2f0b9e+'?');if(!_0x364bb2)return console[_0x1bd957(0x188)](a54_0x3b7b49[_0x1bd957(0x164)](_0x1bd957(0x151))),0x1;}const _0x194bc=await withSpinner(_0x1bd957(0x1a8),()=>_0x237745[_0x1bd957(0x2a0)][_0x1bd957(0x1bd)](_0x2f0b9e,_0x1c1631),{'verbose':_0x475b41['verbose']}),_0x12edfa=_0x194bc[_0x1bd957(0x262)];return console['error']('✔\x20'+_0x12edfa),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x1fa737(0x24e)]='workflow:retry';[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x29a);async['execute'](_0x418006){const _0xd37217=a54_0x1fa737,{options:_0x2d3a0c,args:_0x82b132,tdx:_0x170255}=_0x418006,_0x340301=_0x82b132[0x0];if(!_0x340301)return console['error']('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0xd37217(0x188)](_0xd37217(0x143)),0x1;let _0x2fbeee=![],_0x36380d=_0x340301;if(_0x340301[_0xd37217(0x268)](_0xd37217(0x15d)))_0x2fbeee=!![],_0x36380d=_0x340301[_0xd37217(0x1ab)](0x8);else{if(_0x340301[_0xd37217(0x268)](_0xd37217(0x1b1)))_0x2fbeee=![],_0x36380d=_0x340301[_0xd37217(0x1ab)](0x8);else return console[_0xd37217(0x188)](_0xd37217(0x241)),console['error'](_0xd37217(0x143)),0x1;}const _0x2d0aa3=_0x2d3a0c[_0xd37217(0x281)],_0xb39192=_0x2d3a0c[_0xd37217(0x296)],_0x55d17a=_0x2d3a0c['params'],_0x3cfa37=_0x2d3a0c[_0xd37217(0x248)];_0x2d3a0c[_0xd37217(0x170)]&&(console[_0xd37217(0x188)](_0xd37217(0x1d6)+(_0x2fbeee?_0xd37217(0x2c2):_0xd37217(0x242))+'\x20'+_0x36380d),_0x2d0aa3&&console['error']('From\x20task:\x20'+_0x2d0aa3),_0xb39192&&console[_0xd37217(0x188)](_0xd37217(0x1f2)+_0xb39192),_0x55d17a&&console[_0xd37217(0x188)](_0xd37217(0x251)+_0x55d17a),_0x3cfa37&&console[_0xd37217(0x188)](_0xd37217(0x290)));let _0x5708cc;if(_0x55d17a)try{if(_0x55d17a[_0xd37217(0x268)]('@')){const _0x48a810=await import(_0xd37217(0x26d)),_0x57de3f=_0x55d17a[_0xd37217(0x1ab)](0x1),_0x34f81b=await _0x48a810['readFile'](_0x57de3f,'utf-8');_0x5708cc=JSON[_0xd37217(0x1f5)](_0x34f81b);}else _0x5708cc=JSON[_0xd37217(0x1f5)](_0x55d17a);}catch{return console[_0xd37217(0x188)](_0xd37217(0x2b9)),0x1;}if(!_0x2d3a0c[_0xd37217(0x27f)]){if(!isInteractive())return console[_0xd37217(0x188)](a54_0x3b7b49['red'](_0xd37217(0x132)),_0xd37217(0x223)),console['error'](a54_0x3b7b49[_0xd37217(0x189)](_0xd37217(0x283))),0x1;const _0x1082c6=await confirmKey(_0xd37217(0x212)+(_0x2fbeee?_0xd37217(0x2c2):_0xd37217(0x242))+'\x20'+_0x36380d+'?');if(!_0x1082c6)return console[_0xd37217(0x188)](a54_0x3b7b49[_0xd37217(0x164)](_0xd37217(0x151))),0x1;}let _0x3bdf15;_0x2fbeee?_0x3bdf15=await withSpinner(_0xd37217(0x2e9),()=>_0x170255['workflow'][_0xd37217(0x2bc)](_0x36380d,{'fromTask':_0x2d0aa3,'retryParams':_0x5708cc}),{'verbose':_0x2d3a0c[_0xd37217(0x170)]}):_0x3bdf15=await withSpinner(_0xd37217(0x153),()=>_0x170255[_0xd37217(0x2a0)][_0xd37217(0x15a)](_0x36380d,{'resumeFrom':_0xb39192,'retryParams':_0x5708cc,'force':_0x3cfa37}),{'verbose':_0x2d3a0c[_0xd37217(0x170)]});const _0x3afd46=_0x3bdf15[_0xd37217(0x262)];return console['error'](_0xd37217(0x298)),console[_0xd37217(0x188)](_0xd37217(0x1f4)+_0x3afd46[_0xd37217(0x243)]),console[_0xd37217(0x188)](_0xd37217(0x220)+_0x3afd46['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x1fa737(0x24e)]=a54_0x1fa737(0x26a);[a54_0x1fa737(0x1f6)]='Start\x20a\x20workflow\x20run';async[a54_0x1fa737(0x179)](_0x225910){const _0x2b2d71=a54_0x1fa737,{options:_0x88c799,args:_0x3b28ef,tdx:_0x1cce4a}=_0x225910;let _0x15f3eb=_0x3b28ef[0x0];if(!_0x15f3eb){const _0x264332=this[_0x2b2d71(0x2c3)]([],_0x88c799),_0x585b2e=await withSpinner(_0x2b2d71(0x192),()=>_0x1cce4a['workflow'][_0x2b2d71(0x2a1)](_0x264332,{'limit':_0x88c799['limit']}),{'verbose':_0x88c799['verbose']}),_0x1261f2=_0x585b2e[_0x2b2d71(0x262)];if(_0x1261f2[_0x2b2d71(0x240)]===0x0)return console[_0x2b2d71(0x188)](_0x2b2d71(0x201)),!_0x264332&&console[_0x2b2d71(0x188)](a54_0x3b7b49[_0x2b2d71(0x189)](_0x2b2d71(0x2ea))),0x1;const _0x575328=_0x1261f2[_0x2b2d71(0x285)](_0x3ba72f=>({'title':_0x3ba72f[_0x2b2d71(0x15f)]?.[_0x2b2d71(0x24e)]+'.'+_0x3ba72f[_0x2b2d71(0x24e)],'value':_0x3ba72f['project']?.[_0x2b2d71(0x24e)]+'.'+_0x3ba72f[_0x2b2d71(0x24e)],'description':_0x3ba72f['revision']?'revision:\x20'+_0x3ba72f[_0x2b2d71(0x269)]:undefined})),_0x20b659=await a54_0x49b152({'type':_0x2b2d71(0x1c4),'name':'workflow','message':_0x2b2d71(0x14f),'choices':_0x575328});if(!_0x20b659[_0x2b2d71(0x2a0)])return 0x1;_0x15f3eb=_0x20b659[_0x2b2d71(0x2a0)];}if(!_0x15f3eb[_0x2b2d71(0x1f9)]('.')){const _0x52b047=this['resolveProject']([],_0x88c799);if(_0x52b047)_0x15f3eb=_0x52b047+'.'+_0x15f3eb;else return console[_0x2b2d71(0x188)](a54_0x3b7b49[_0x2b2d71(0x160)]('Error:'),_0x2b2d71(0x1da)),console[_0x2b2d71(0x188)](a54_0x3b7b49['dim'](_0x2b2d71(0x2ea))),0x1;}const _0x2ecad0=_0x88c799['param'],_0x5857cc=_0x88c799[_0x2b2d71(0x198)],_0x624563={};if(_0x2ecad0&&Array[_0x2b2d71(0x252)](_0x2ecad0))for(const _0x278564 of _0x2ecad0){const _0x599334=_0x278564[_0x2b2d71(0x1a7)]('=');if(_0x599334===-0x1)return console[_0x2b2d71(0x188)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x278564),console[_0x2b2d71(0x188)](_0x2b2d71(0x237)),0x1;const _0x4e3d5e=_0x278564['substring'](0x0,_0x599334),_0x5a078e=_0x278564[_0x2b2d71(0x1ab)](_0x599334+0x1);try{_0x624563[_0x4e3d5e]=JSON[_0x2b2d71(0x1f5)](_0x5a078e);}catch{_0x624563[_0x4e3d5e]=_0x5a078e;}}_0x88c799[_0x2b2d71(0x170)]&&(console[_0x2b2d71(0x188)](_0x2b2d71(0x25c)+_0x15f3eb),Object[_0x2b2d71(0x169)](_0x624563)[_0x2b2d71(0x240)]>0x0&&console[_0x2b2d71(0x188)](_0x2b2d71(0x2ec)+JSON[_0x2b2d71(0x1fd)](_0x624563)),_0x5857cc&&console[_0x2b2d71(0x188)](_0x2b2d71(0x13d)+_0x5857cc));const _0x5b2f6b=await withSpinner(_0x2b2d71(0x2e6),()=>_0x1cce4a[_0x2b2d71(0x2a0)][_0x2b2d71(0x230)](_0x15f3eb,_0x624563,{'sessionTime':_0x5857cc}),{'verbose':_0x88c799[_0x2b2d71(0x170)]}),_0x2e08de=_0x5b2f6b[_0x2b2d71(0x262)];console[_0x2b2d71(0x188)]('✔\x20Workflow\x20run\x20started'),console[_0x2b2d71(0x188)](_0x2b2d71(0x267)+_0x2e08de['id']),console[_0x2b2d71(0x188)]('\x20\x20Session\x20ID:\x20'+_0x2e08de[_0x2b2d71(0x1c8)]),console[_0x2b2d71(0x188)]('\x20\x20Project:\x20'+_0x2e08de[_0x2b2d71(0x15f)]?.[_0x2b2d71(0x24e)]),console[_0x2b2d71(0x188)](_0x2b2d71(0x2a8)+_0x2e08de['workflow']?.[_0x2b2d71(0x24e)]);if(_0x2e08de[_0x2b2d71(0x15f)]?.['id']&&_0x2e08de['sessionId']&&_0x2e08de['id']){const _0xdc6ddc=_0x88c799[_0x2b2d71(0x177)],_0xabe0d9=getConsoleUrl(_0xdc6ddc,_0x2b2d71(0x204)+_0x2e08de['project']['id']+_0x2b2d71(0x2eb)+_0x2e08de['sessionId']+_0x2b2d71(0x295)+_0x2e08de['id']);console['error'](_0x2b2d71(0x21d)+a54_0x3b7b49['cyan'](_0xabe0d9));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a54_0x1fa737(0x24e)]=a54_0x1fa737(0x23c);[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x22c);async['execute'](_0x12ff5a){const _0xa6009d=a54_0x1fa737,{options:_0x75eb20,args:_0x472157,tdx:_0x403bad}=_0x12ff5a,_0x4f42c0=_0x472157[0x0],_0x2a903f=_0x472157[0x1]||'.';if(!_0x4f42c0)return console['error'](_0xa6009d(0x2f2)),console[_0xa6009d(0x188)](_0xa6009d(0x12e)),0x1;const _0x2b3b3d=_0x75eb20[_0xa6009d(0x269)];_0x75eb20['verbose']&&(console['error']('Project:\x20'+_0x4f42c0),console[_0xa6009d(0x188)](_0xa6009d(0x264)+_0x2a903f),_0x2b3b3d&&console['error'](_0xa6009d(0x2f0)+_0x2b3b3d));const _0x31cfa3=await withSpinner(_0xa6009d(0x2d4)+_0x4f42c0+_0xa6009d(0x12a),()=>_0x403bad[_0xa6009d(0x2a0)][_0xa6009d(0x195)](_0x4f42c0,_0x2a903f,{'revision':_0x2b3b3d}),{'verbose':_0x75eb20[_0xa6009d(0x170)]}),_0x2affde=_0x31cfa3['data'];return console[_0xa6009d(0x188)](_0xa6009d(0x1ac)+_0x2affde[_0xa6009d(0x28b)]),console[_0xa6009d(0x188)]('\x20\x20Revision:\x20'+_0x2affde['revision']),console[_0xa6009d(0x188)](_0xa6009d(0x2b8)+_0x2affde[_0xa6009d(0x1db)]),console['error']('\x20\x20Location:\x20'+_0x2a903f+'/'+_0x2affde[_0xa6009d(0x28b)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x1fa737(0x24e)]=a54_0x1fa737(0x15c);['description']=a54_0x1fa737(0x139);async[a54_0x1fa737(0x179)](_0x1f1816){const _0x3e85c5=a54_0x1fa737,{options:_0x4263fa,args:_0xae389b,tdx:_0x56ed3d}=_0x1f1816;let _0x1324a7='.',_0x422da7=_0x4263fa[_0x3e85c5(0x24e)];if(_0xae389b[0x0]){const {promises:_0x3e5914}=await import('fs');try{const _0x2ea308=await _0x3e5914[_0x3e85c5(0x154)](_0xae389b[0x0]);if(_0x2ea308['isDirectory']())_0x1324a7=_0xae389b[0x0];else return console['error'](_0x3e85c5(0x1bf)+_0xae389b[0x0]+_0x3e85c5(0x2ba)),0x1;}catch{_0x422da7=_0xae389b[0x0],_0x1324a7='.';}}const _0x3e35ef=_0x4263fa[_0x3e85c5(0x269)],_0x506dc5=_0x4263fa[_0x3e85c5(0x191)];_0x4263fa[_0x3e85c5(0x170)]&&(console[_0x3e85c5(0x188)](_0x3e85c5(0x2b3)+_0x1324a7),_0x422da7&&console[_0x3e85c5(0x188)]('Project\x20name:\x20'+_0x422da7),_0x3e35ef&&console['error']('Revision:\x20'+_0x3e35ef),_0x506dc5&&console[_0x3e85c5(0x188)](_0x3e85c5(0x213)));const _0x37d9b6=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x56ed3d[_0x3e85c5(0x2a0)]['push'](_0x1324a7,{'projectName':_0x422da7,'revision':_0x3e35ef,'skipValidation':_0x506dc5}),{'verbose':_0x4263fa[_0x3e85c5(0x170)]}),_0x2e5de5=_0x37d9b6[_0x3e85c5(0x262)];return console[_0x3e85c5(0x188)](_0x3e85c5(0x2ed)+_0x2e5de5[_0x3e85c5(0x28b)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x2e5de5[_0x3e85c5(0x1ef)]),console[_0x3e85c5(0x188)](_0x3e85c5(0x2c4)+_0x2e5de5[_0x3e85c5(0x269)]),await this[_0x3e85c5(0x217)](_0x56ed3d,_0x2e5de5['projectName'],_0x4263fa[_0x3e85c5(0x177)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x1fa737(0x24e)]=a54_0x1fa737(0x222);[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x163);async[a54_0x1fa737(0x179)](_0xf9408b){const _0x185165=a54_0x1fa737,{options:_0x1feb98,args:_0x5199bb,tdx:_0x3a2eed}=_0xf9408b,_0x5455e0=_0x5199bb[0x0],_0x3b65e3=_0x5199bb[0x1];if(!_0x5455e0)return console[_0x185165(0x188)](a54_0x3b7b49[_0x185165(0x160)](_0x185165(0x2e0)),_0x185165(0x197)),console[_0x185165(0x188)](a54_0x3b7b49['dim']('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x7808ae=_0x1feb98[_0x185165(0x269)];_0x1feb98['verbose']&&(console[_0x185165(0x188)](_0x185165(0x1f1)+_0x5455e0),_0x3b65e3&&console['error'](_0x185165(0x2ee)+_0x3b65e3),_0x7808ae&&console['error'](_0x185165(0x2f0)+_0x7808ae),_0x1feb98['dryRun']&&console[_0x185165(0x188)](_0x185165(0x1e1)));const _0x1f38d0=await withSpinner(_0x185165(0x28d)+_0x5455e0+'...',()=>_0x3a2eed[_0x185165(0x2a0)][_0x185165(0x209)](_0x5455e0,{'targetDir':_0x3b65e3,'revision':_0x7808ae}),{'verbose':_0x1feb98['verbose']}),_0x157ea7=_0x1f38d0[_0x185165(0x262)];_0x157ea7[_0x185165(0x274)]?console['error'](_0x185165(0x2d1)+_0x157ea7[_0x185165(0x28b)]):console['error'](_0x185165(0x2a6)+_0x157ea7[_0x185165(0x28b)]);console[_0x185165(0x188)](_0x185165(0x2c4)+_0x157ea7[_0x185165(0x269)]),console[_0x185165(0x188)](_0x185165(0x26e)+(a54_0x2cd77d[_0x185165(0x196)](process[_0x185165(0x155)](),_0x157ea7[_0x185165(0x21f)])||'.')),console[_0x185165(0x188)]('\x20\x20Changes:\x20'+a54_0x3b7b49[_0x185165(0x24d)]('+'+_0x157ea7[_0x185165(0x2be)]['new']+_0x185165(0x134))+',\x20'+(a54_0x3b7b49[_0x185165(0x164)]('~'+_0x157ea7[_0x185165(0x2be)]['modified']+_0x185165(0x29d))+',\x20')+(a54_0x3b7b49[_0x185165(0x160)]('-'+_0x157ea7[_0x185165(0x2be)][_0x185165(0x1e9)]+'\x20deleted')+',\x20')+(''+a54_0x3b7b49[_0x185165(0x189)](_0x157ea7[_0x185165(0x2be)][_0x185165(0x22e)]+_0x185165(0x16d))));for(const _0x1f5ad0 of _0x157ea7[_0x185165(0x1cb)]){_0x1f5ad0['type']===_0x185165(0x238)&&_0x1f5ad0[_0x185165(0x297)]&&(console[_0x185165(0x188)]('\x0a'+a54_0x3b7b49[_0x185165(0x1a9)](_0x185165(0x208)+_0x1f5ad0[_0x185165(0x14b)])),console[_0x185165(0x188)](_0x1f5ad0['diff']));}if(!_0x157ea7[_0x185165(0x1c9)])return saveSessionContext({'workflow_project':_0x157ea7['projectName']},_0x1feb98['session']),console[_0x185165(0x188)](a54_0x3b7b49[_0x185165(0x24d)]('\x0a✔\x20Already\x20up\x20to\x20date')),console['error'](a54_0x3b7b49['dim'](_0x185165(0x1e7)+_0x157ea7[_0x185165(0x28b)])),0x0;if(_0x1feb98[_0x185165(0x12b)])return console['error'](a54_0x3b7b49['yellow']('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x1feb98[_0x185165(0x27f)]){if(!isInteractive())return console[_0x185165(0x188)](a54_0x3b7b49['red'](_0x185165(0x132)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x185165(0x188)](a54_0x3b7b49[_0x185165(0x189)](_0x185165(0x283))),0x1;const _0x1fc312=await confirmKey(_0x185165(0x207));if(!_0x1fc312)return console[_0x185165(0x188)](a54_0x3b7b49['yellow'](_0x185165(0x151)),_0x185165(0x21a)),0x1;}await withSpinner(_0x185165(0x2c0),()=>_0x3a2eed['workflow']['applyPullProject'](_0x157ea7,{'revision':_0x7808ae}),{'verbose':_0x1feb98[_0x185165(0x170)]}),saveSessionContext({'workflow_project':_0x157ea7[_0x185165(0x28b)]},_0x1feb98[_0x185165(0x2c2)]),console[_0x185165(0x188)](a54_0x3b7b49[_0x185165(0x24d)](_0x185165(0x1b6)));const _0x2bc9db=a54_0x2cd77d['relative'](process[_0x185165(0x155)](),_0x157ea7[_0x185165(0x21f)])||'.';return console[_0x185165(0x188)](a54_0x3b7b49[_0x185165(0x189)](_0x185165(0x156)+_0x2bc9db)),console[_0x185165(0x188)](a54_0x3b7b49['dim'](_0x185165(0x1e7)+_0x157ea7[_0x185165(0x28b)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a54_0x1fa737(0x24e)]=a54_0x1fa737(0x1c0);[a54_0x1fa737(0x1f6)]='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async[a54_0x1fa737(0x179)](_0x30b2d5){const _0x386648=a54_0x1fa737,{options:_0x37bcbb,args:_0x446b00,tdx:_0x1309d7}=_0x30b2d5,_0x292c71=this[_0x386648(0x1a1)](_0x446b00,_0x37bcbb),_0x4b9613=_0x37bcbb['revision'],_0x49c4b1=_0x37bcbb['skipValidation'];_0x37bcbb[_0x386648(0x170)]&&(_0x292c71&&console[_0x386648(0x188)](_0x386648(0x12c)+_0x292c71),_0x4b9613&&console[_0x386648(0x188)](_0x386648(0x2f0)+_0x4b9613),_0x37bcbb[_0x386648(0x12b)]&&console[_0x386648(0x188)](_0x386648(0x1e1)),_0x49c4b1&&console['error'](_0x386648(0x213)));let _0x2ac813;try{_0x2ac813=await withSpinner(_0x386648(0x1b2),()=>_0x1309d7[_0x386648(0x2a0)][_0x386648(0x2c7)]({'sourceDir':_0x292c71,'revision':_0x4b9613,'skipValidation':_0x49c4b1}),{'verbose':_0x37bcbb[_0x386648(0x170)]});}catch(_0x8e98e8){if(_0x8e98e8 instanceof Error&&_0x8e98e8[_0x386648(0x199)]['includes'](_0x386648(0x2bd)))return console[_0x386648(0x188)](a54_0x3b7b49[_0x386648(0x160)]('Error:'),_0x386648(0x2af)),_0x37bcbb[_0x386648(0x2bb)]?console[_0x386648(0x188)](a54_0x3b7b49[_0x386648(0x189)](_0x386648(0x27d)+_0x37bcbb['workflowProject']+_0x386648(0x2c9)+_0x37bcbb[_0x386648(0x2bb)]+'\x27')):console[_0x386648(0x188)](a54_0x3b7b49[_0x386648(0x189)](_0x386648(0x145))),0x1;throw _0x8e98e8;}const _0x2bb9ad=_0x2ac813[_0x386648(0x262)];console[_0x386648(0x188)](_0x386648(0x1a6)+_0x2bb9ad[_0x386648(0x28b)]),console[_0x386648(0x188)](_0x386648(0x21e)+_0x2bb9ad[_0x386648(0x19c)]),console[_0x386648(0x188)](_0x386648(0x2c4)+_0x2bb9ad[_0x386648(0x269)]),console[_0x386648(0x188)](_0x386648(0x2bf)+a54_0x3b7b49[_0x386648(0x24d)]('+'+_0x2bb9ad['summary'][_0x386648(0x245)]+_0x386648(0x134))+',\x20'+(a54_0x3b7b49[_0x386648(0x164)]('~'+_0x2bb9ad['summary'][_0x386648(0x238)]+_0x386648(0x29d))+',\x20')+(a54_0x3b7b49[_0x386648(0x160)]('-'+_0x2bb9ad[_0x386648(0x2be)]['deleted']+'\x20deleted')+',\x20')+(''+a54_0x3b7b49[_0x386648(0x189)](_0x2bb9ad[_0x386648(0x2be)][_0x386648(0x22e)]+_0x386648(0x16d))));for(const _0x42d51c of _0x2bb9ad[_0x386648(0x1cb)]){_0x42d51c[_0x386648(0x182)]==='modified'&&_0x42d51c[_0x386648(0x297)]&&(console['error']('\x0a'+a54_0x3b7b49[_0x386648(0x1a9)](_0x386648(0x208)+_0x42d51c[_0x386648(0x14b)])),console[_0x386648(0x188)](_0x42d51c['diff']));}if(!_0x2bb9ad[_0x386648(0x1c9)])return console[_0x386648(0x188)](a54_0x3b7b49[_0x386648(0x24d)](_0x386648(0x14a))),await this[_0x386648(0x217)](_0x1309d7,_0x2bb9ad[_0x386648(0x28b)],_0x37bcbb[_0x386648(0x177)]),0x0;if(_0x37bcbb['dryRun'])return console[_0x386648(0x188)](a54_0x3b7b49[_0x386648(0x164)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x37bcbb[_0x386648(0x27f)]){if(!isInteractive())return console['error'](a54_0x3b7b49[_0x386648(0x160)](_0x386648(0x132)),_0x386648(0x223)),console[_0x386648(0x188)](a54_0x3b7b49['dim'](_0x386648(0x283))),0x1;const _0x1df4dc=await confirmKey(_0x386648(0x168));if(!_0x1df4dc)return console[_0x386648(0x188)](a54_0x3b7b49[_0x386648(0x164)](_0x386648(0x151)),_0x386648(0x1b9)),0x1;}const _0x25d227=await withSpinner(_0x386648(0x235),()=>_0x1309d7[_0x386648(0x2a0)][_0x386648(0x2c8)](_0x2bb9ad),{'verbose':_0x37bcbb[_0x386648(0x170)]}),_0x3cc4d4=_0x25d227['data'];return console['error'](a54_0x3b7b49[_0x386648(0x24d)]('✔\x20Push\x20complete')),console['error'](_0x386648(0x234)+_0x3cc4d4[_0x386648(0x1ef)]),console['error'](_0x386648(0x2c4)+_0x3cc4d4[_0x386648(0x269)]),await this['showWorkflowConsoleUrl'](_0x1309d7,_0x3cc4d4[_0x386648(0x28b)],_0x37bcbb[_0x386648(0x177)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0x1fa737(0x24e)]='workflow:clone';[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x24c);async[a54_0x1fa737(0x179)](_0x3f18cb){const _0x3a8f7f=a54_0x1fa737,{options:_0x10fc70,args:_0x5996a5,tdx:_0x128d85}=_0x3f18cb,_0xca2655=this[_0x3a8f7f(0x1a1)](_0x5996a5,_0x10fc70),_0x1baa9f=_0x10fc70[_0x3a8f7f(0x24e)],_0x19a42d=_0x10fc70[_0x3a8f7f(0x269)],_0x5d0b5b=_0x10fc70[_0x3a8f7f(0x191)];if(!_0xca2655)return console['error'](a54_0x3b7b49[_0x3a8f7f(0x160)](_0x3a8f7f(0x2e0)),'Source\x20directory\x20is\x20required'),console[_0x3a8f7f(0x188)](a54_0x3b7b49[_0x3a8f7f(0x189)](_0x3a8f7f(0x221))),console[_0x3a8f7f(0x188)](a54_0x3b7b49[_0x3a8f7f(0x189)](_0x3a8f7f(0x184))),0x1;if(!_0x1baa9f)return console['error'](a54_0x3b7b49['red'](_0x3a8f7f(0x2e0)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x3a8f7f(0x188)](a54_0x3b7b49[_0x3a8f7f(0x189)](_0x3a8f7f(0x221))),0x1;_0x10fc70[_0x3a8f7f(0x170)]&&(console[_0x3a8f7f(0x188)](_0x3a8f7f(0x12c)+_0xca2655),console[_0x3a8f7f(0x188)](_0x3a8f7f(0x233)+_0x1baa9f),_0x19a42d&&console[_0x3a8f7f(0x188)](_0x3a8f7f(0x2f0)+_0x19a42d),_0x10fc70[_0x3a8f7f(0x12b)]&&console['error'](_0x3a8f7f(0x1e1)),_0x5d0b5b&&console[_0x3a8f7f(0x188)](_0x3a8f7f(0x213)));const _0x287fc6=await withSpinner(_0x3a8f7f(0x273),()=>_0x128d85[_0x3a8f7f(0x2a0)][_0x3a8f7f(0x1aa)](_0xca2655,_0x1baa9f,{'revision':_0x19a42d,'skipValidation':_0x5d0b5b}),{'verbose':_0x10fc70[_0x3a8f7f(0x170)]}),_0x4567be=_0x287fc6[_0x3a8f7f(0x262)];console[_0x3a8f7f(0x188)](_0x3a8f7f(0x1e4)+_0x4567be[_0x3a8f7f(0x19c)]);_0x4567be[_0x3a8f7f(0x183)]&&console[_0x3a8f7f(0x188)]('Source\x20project:\x20'+_0x4567be[_0x3a8f7f(0x183)]);console['error'](_0x3a8f7f(0x233)+_0x4567be[_0x3a8f7f(0x165)]),console[_0x3a8f7f(0x188)](_0x3a8f7f(0x2f0)+_0x4567be[_0x3a8f7f(0x269)]),console[_0x3a8f7f(0x188)](_0x3a8f7f(0x2d5)+_0x4567be[_0x3a8f7f(0x1d0)]);_0x4567be['targetExists']&&(console[_0x3a8f7f(0x188)](a54_0x3b7b49[_0x3a8f7f(0x164)]('\x0a⚠\x20Project\x20\x22'+_0x4567be[_0x3a8f7f(0x165)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x4567be[_0x3a8f7f(0x2e4)]+')')),console['error'](a54_0x3b7b49[_0x3a8f7f(0x164)](_0x3a8f7f(0x1a5))));if(_0x10fc70[_0x3a8f7f(0x12b)])return console[_0x3a8f7f(0x188)](a54_0x3b7b49[_0x3a8f7f(0x164)]('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x10fc70[_0x3a8f7f(0x27f)]){if(!isInteractive())return console['error'](a54_0x3b7b49['red'](_0x3a8f7f(0x132)),_0x3a8f7f(0x223)),console[_0x3a8f7f(0x188)](a54_0x3b7b49[_0x3a8f7f(0x189)](_0x3a8f7f(0x283))),0x1;const _0x3d3ff2=_0x4567be[_0x3a8f7f(0x183)]||a54_0x2cd77d[_0x3a8f7f(0x1ee)](_0xca2655),_0x555fc7=_0x4567be['targetExists']?_0x3a8f7f(0x2e8)+_0x1baa9f+_0x3a8f7f(0x293):_0x3a8f7f(0x131)+_0x3d3ff2+_0x3a8f7f(0x166)+_0x1baa9f+'\x22?',_0x291daa=await confirmKey(_0x555fc7);if(!_0x291daa)return console['error'](a54_0x3b7b49[_0x3a8f7f(0x164)](_0x3a8f7f(0x151))),0x1;}const _0x2419b9=await withSpinner(_0x4567be[_0x3a8f7f(0x2e1)]?_0x3a8f7f(0x1ce)+_0x1baa9f+_0x3a8f7f(0x12a):_0x3a8f7f(0x256)+_0x1baa9f+_0x3a8f7f(0x12a),()=>_0x128d85[_0x3a8f7f(0x2a0)]['executeCloneProject'](_0x4567be),{'verbose':_0x10fc70[_0x3a8f7f(0x170)]}),_0x100c37=_0x2419b9['data'];return console[_0x3a8f7f(0x188)](a54_0x3b7b49[_0x3a8f7f(0x24d)](_0x4567be[_0x3a8f7f(0x2e1)]?_0x3a8f7f(0x2a4):_0x3a8f7f(0x21b))),console[_0x3a8f7f(0x188)](_0x3a8f7f(0x1fa)+_0x100c37[_0x3a8f7f(0x165)]),console[_0x3a8f7f(0x188)](_0x3a8f7f(0x234)+_0x100c37[_0x3a8f7f(0x178)]),console[_0x3a8f7f(0x188)](_0x3a8f7f(0x2c4)+_0x100c37[_0x3a8f7f(0x269)]),await this[_0x3a8f7f(0x217)](_0x128d85,_0x100c37[_0x3a8f7f(0x165)],_0x10fc70['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x1fa737(0x24e)]=a54_0x1fa737(0x136);[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x1b8);async['execute'](_0x1c4244){const _0x17c3ef=a54_0x1fa737,{options:_0x52f93d,args:_0x8ba991,tdx:_0x1295a5}=_0x1c4244,_0x4d7de8=_0x8ba991[0x0];if(!_0x4d7de8)return console[_0x17c3ef(0x188)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x17c3ef(0x17f)),0x1;_0x52f93d[_0x17c3ef(0x170)]&&console[_0x17c3ef(0x188)]('Project:\x20'+_0x4d7de8);if(!_0x52f93d[_0x17c3ef(0x27f)]){if(!isInteractive())return console['error'](a54_0x3b7b49['red'](_0x17c3ef(0x132)),_0x17c3ef(0x223)),console[_0x17c3ef(0x188)](a54_0x3b7b49[_0x17c3ef(0x189)](_0x17c3ef(0x283))),0x1;const _0x41c8bb=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x4d7de8+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x41c8bb)return console[_0x17c3ef(0x188)](a54_0x3b7b49['yellow'](_0x17c3ef(0x151))),0x1;}const _0x573cd4=await withSpinner(_0x17c3ef(0x2d0)+_0x4d7de8+_0x17c3ef(0x12a),()=>_0x1295a5[_0x17c3ef(0x2a0)][_0x17c3ef(0x1ea)](_0x4d7de8),{'verbose':_0x52f93d[_0x17c3ef(0x170)]}),_0x16ddf2=_0x573cd4['data'];return console[_0x17c3ef(0x188)]('✔\x20Deleted\x20project\x20'+_0x16ddf2[_0x17c3ef(0x28b)]),console[_0x17c3ef(0x188)](_0x17c3ef(0x234)+_0x16ddf2[_0x17c3ef(0x1ef)]),0x0;}}export function parseKeyValue(_0x916885){const _0x18160f=a54_0x1fa737,_0x2e91d1=_0x916885['indexOf']('=');if(_0x2e91d1===-0x1)throw new Error(_0x18160f(0x253)+_0x916885+_0x18160f(0x25e));const _0x36284e=_0x916885[_0x18160f(0x1ab)](0x0,_0x2e91d1),_0x53333b=_0x916885[_0x18160f(0x1ab)](_0x2e91d1+0x1);if(!_0x36284e)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x36284e,'value':_0x53333b};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x1fa737(0x24e)]=a54_0x1fa737(0x1a2);['description']=a54_0x1fa737(0x280);async[a54_0x1fa737(0x179)](_0x856b9f){const _0x4ee046=a54_0x1fa737,{options:_0x6fd84b,args:_0x5d0931,tdx:_0x217b1f}=_0x856b9f,_0x1ed6fb=this[_0x4ee046(0x1cd)](_0x5d0931,_0x6fd84b);if(!_0x1ed6fb)return 0x1;_0x6fd84b['verbose']&&console['error'](_0x4ee046(0x1f1)+_0x1ed6fb);const _0x9d8b6d=await withSpinner(_0x4ee046(0x1c7),()=>_0x217b1f[_0x4ee046(0x2a0)][_0x4ee046(0x25f)](_0x1ed6fb),{'verbose':_0x6fd84b[_0x4ee046(0x170)]}),{secrets:_0x5bd196}=_0x9d8b6d[_0x4ee046(0x262)];return console[_0x4ee046(0x188)](_0x4ee046(0x2d7)+_0x5bd196[_0x4ee046(0x240)]+'\x20secret'+(_0x5bd196['length']!==0x1?'s':'')),await handleSDKOutput(_0x5bd196,_0x6fd84b),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x1fa737(0x24e)]=a54_0x1fa737(0x218);[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x279);async[a54_0x1fa737(0x179)](_0x350d0e){const _0x3f4b39=a54_0x1fa737,{options:_0x24a1b5,args:_0xfe7f3e,tdx:_0x8295e5}=_0x350d0e;let _0x41a4f,_0x4bd227;if(_0xfe7f3e['length']>=0x1&&!_0xfe7f3e[0x0][_0x3f4b39(0x1f9)]('='))_0x41a4f=_0xfe7f3e[0x0],_0x4bd227=_0xfe7f3e[_0x3f4b39(0x26b)](0x1);else{if(_0xfe7f3e['length']>=0x1&&_0x24a1b5[_0x3f4b39(0x2bb)])_0x41a4f=_0x24a1b5[_0x3f4b39(0x2bb)],_0x4bd227=_0xfe7f3e;else return _0xfe7f3e[_0x3f4b39(0x240)]>=0x1?(console[_0x3f4b39(0x188)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x3f4b39(0x188)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x3f4b39(0x188)](_0x3f4b39(0x181)),console[_0x3f4b39(0x188)](_0x3f4b39(0x25d)),0x1);}if(_0x4bd227[_0x3f4b39(0x240)]===0x0)return console[_0x3f4b39(0x188)](_0x3f4b39(0x181)),console['error'](_0x3f4b39(0x25d)),0x1;const _0x4ba5cb={};try{for(const _0x3b482c of _0x4bd227){const {key:_0x4ac0b3,value:_0x1d1aed}=parseKeyValue(_0x3b482c);_0x4ba5cb[_0x4ac0b3]=_0x1d1aed;}}catch(_0x44b1ae){return _0x44b1ae instanceof Error&&console[_0x3f4b39(0x188)](a54_0x3b7b49['red'](_0x3f4b39(0x2e0)),_0x44b1ae['message']),0x1;}const _0x543813=Object['keys'](_0x4ba5cb);_0x24a1b5[_0x3f4b39(0x170)]&&(console['error'](_0x3f4b39(0x1f1)+_0x41a4f),console[_0x3f4b39(0x188)](_0x3f4b39(0x289)+_0x543813['join'](',\x20')));const _0xb887aa=await withSpinner(_0x543813[_0x3f4b39(0x240)]===0x1?'Setting\x20secret...':'Setting\x20'+_0x543813['length']+_0x3f4b39(0x18e),()=>_0x8295e5['workflow'][_0x3f4b39(0x162)](_0x41a4f,_0x4ba5cb),{'verbose':_0x24a1b5[_0x3f4b39(0x170)]}),_0xd0d116=_0xb887aa[_0x3f4b39(0x262)];return console[_0x3f4b39(0x188)](_0x543813[_0x3f4b39(0x240)]===0x1?'✔\x20Secret\x20\x27'+_0xd0d116[_0x3f4b39(0x169)][0x0]+_0x3f4b39(0x202)+_0xd0d116[_0x3f4b39(0x28b)]+'\x27':'✔\x20'+_0xd0d116[_0x3f4b39(0x169)]['length']+_0x3f4b39(0x19e)+_0xd0d116[_0x3f4b39(0x28b)]+'\x27'),(_0x24a1b5[_0x3f4b39(0x16c)]||_0x24a1b5[_0x3f4b39(0x1a4)])&&await handleSingleObjectOutput(_0xd0d116,_0x24a1b5),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0x1fa737(0x24e)]='workflow:secrets:delete';[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x15b);async[a54_0x1fa737(0x179)](_0x4a8689){const _0x240d0d=a54_0x1fa737,{options:_0x369ebb,args:_0x4b08f5,tdx:_0x37e909}=_0x4a8689;let _0x397dd1,_0x1cfd33;if(_0x4b08f5[_0x240d0d(0x240)]>=0x2)_0x397dd1=_0x4b08f5[0x0],_0x1cfd33=_0x4b08f5[0x1];else{if(_0x4b08f5[_0x240d0d(0x240)]===0x1&&_0x369ebb[_0x240d0d(0x2bb)])_0x397dd1=_0x369ebb[_0x240d0d(0x2bb)],_0x1cfd33=_0x4b08f5[0x0];else return _0x4b08f5[_0x240d0d(0x240)]===0x1?(console['error'](_0x240d0d(0x2f2)),console['error']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x240d0d(0x188)](_0x240d0d(0x1e5)),console[_0x240d0d(0x188)](_0x240d0d(0x26f)),0x1);}_0x369ebb[_0x240d0d(0x170)]&&(console[_0x240d0d(0x188)](_0x240d0d(0x1f1)+_0x397dd1),console['error'](_0x240d0d(0x1ad)+_0x1cfd33));if(!_0x369ebb['yes']){if(!isInteractive())return console['error'](a54_0x3b7b49[_0x240d0d(0x160)](_0x240d0d(0x132)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x240d0d(0x188)](a54_0x3b7b49[_0x240d0d(0x189)](_0x240d0d(0x283))),0x1;const _0x58f37e=await confirmKey(_0x240d0d(0x2f4)+_0x1cfd33+_0x240d0d(0x276)+_0x397dd1+'\x27?');if(!_0x58f37e)return console[_0x240d0d(0x188)](a54_0x3b7b49['yellow'](_0x240d0d(0x151))),0x1;}const _0x5bb7ff=await withSpinner(_0x240d0d(0x2f1),()=>_0x37e909[_0x240d0d(0x2a0)][_0x240d0d(0x272)](_0x397dd1,_0x1cfd33),{'verbose':_0x369ebb[_0x240d0d(0x170)]}),_0x8f508b=_0x5bb7ff[_0x240d0d(0x262)];return console[_0x240d0d(0x188)](_0x240d0d(0x263)+_0x8f508b[_0x240d0d(0x1e0)]+_0x240d0d(0x157)+_0x8f508b[_0x240d0d(0x28b)]+'\x27'),(_0x369ebb[_0x240d0d(0x16c)]||_0x369ebb[_0x240d0d(0x1a4)])&&await handleSingleObjectOutput(_0x8f508b,_0x369ebb),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(_0x1dbbc7){const _0x1aab00=a54_0x1fa737,_0x816b48=Math[_0x1aab00(0x215)](_0x1dbbc7/0x3e8),_0x2e81d0=Math[_0x1aab00(0x215)](_0x816b48/0x3c),_0xce6316=Math[_0x1aab00(0x215)](_0x2e81d0/0x3c),_0x2ed597=Math[_0x1aab00(0x215)](_0xce6316/0x18);if(_0x2ed597>0x0){const _0xfb401b=_0xce6316%0x18;return _0xfb401b>0x0?_0x2ed597+'d\x20'+_0xfb401b+'h':_0x2ed597+'d';}else{if(_0xce6316>0x0){const _0x30c5c5=_0x2e81d0%0x3c;return _0x30c5c5>0x0?_0xce6316+'h\x20'+_0x30c5c5+'m':_0xce6316+'h';}else{if(_0x2e81d0>0x0){const _0x314b39=_0x816b48%0x3c;return _0x314b39>0x0?_0x2e81d0+'m\x20'+_0x314b39+'s':_0x2e81d0+'m';}else return _0x816b48+'s';}}}function formatTimestamp(_0x1c7030,_0xb1042f){const _0x5b24f8=a54_0x1fa737,_0x55203f=new Date(_0x1c7030),_0x12ac5d=String(_0x55203f[_0x5b24f8(0x2ae)]())['padStart'](0x2,'0'),_0x545df0=String(_0x55203f[_0x5b24f8(0x2b7)]())[_0x5b24f8(0x22a)](0x2,'0'),_0x349d54=_0x12ac5d+':'+_0x545df0,_0x2dc689=_0x55203f['getFullYear']()===_0xb1042f[_0x5b24f8(0x16e)]()&&_0x55203f[_0x5b24f8(0x28f)]()===_0xb1042f[_0x5b24f8(0x28f)]()&&_0x55203f['getDate']()===_0xb1042f['getDate']();if(_0x2dc689)return _0x349d54;else{const _0x200410=String(_0x55203f['getMonth']()+0x1)[_0x5b24f8(0x22a)](0x2,'0'),_0x3cd426=String(_0x55203f[_0x5b24f8(0x2db)]())[_0x5b24f8(0x22a)](0x2,'0');return _0x200410+'-'+_0x3cd426+'\x20'+_0x349d54;}}function formatDate(_0x34570e){const _0x304208=a54_0x1fa737,_0x54ea93=_0x34570e[_0x304208(0x16e)](),_0x475a57=String(_0x34570e[_0x304208(0x28f)]()+0x1)[_0x304208(0x22a)](0x2,'0'),_0x3933a5=String(_0x34570e['getDate']())[_0x304208(0x22a)](0x2,'0');return _0x54ea93+'-'+_0x475a57+'-'+_0x3933a5;}function getTaskStateIcon(_0xf18b4c){const _0x44b7da={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x44b7da[_0xf18b4c]||'⚪';}function getBarChar(_0x1127e5){const _0x475271=a54_0x1fa737;return _0x1127e5===_0x475271(0x188)||_0x1127e5==='group_error'?'×':'─';}function getBarColor(_0x223fb4){const _0x598595=a54_0x1fa737,_0x97bc3={'success':a54_0x3b7b49[_0x598595(0x24d)],'error':a54_0x3b7b49[_0x598595(0x160)],'group_error':a54_0x3b7b49[_0x598595(0x160)],'running':a54_0x3b7b49[_0x598595(0x2a2)],'blocked':a54_0x3b7b49['yellow'],'planned':a54_0x3b7b49[_0x598595(0x189)],'canceling':a54_0x3b7b49[_0x598595(0x164)]};return _0x97bc3[_0x223fb4]||a54_0x3b7b49[_0x598595(0x26c)];}function parseTaskName(_0x1dce6a){const _0x3d2a97=a54_0x1fa737;let _0x18c27a=_0x1dce6a[_0x3d2a97(0x13a)](/^\++/,'');const _0x12f40f=_0x18c27a[_0x3d2a97(0x2aa)]('+'),_0x94026a=_0x12f40f[_0x3d2a97(0x240)]>0x1?_0x12f40f[_0x3d2a97(0x240)]-0x2:0x0,_0x3f863e=_0x12f40f[_0x12f40f[_0x3d2a97(0x240)]-0x1]||_0x18c27a;return{'level':_0x94026a,'name':'+'+_0x3f863e};}function truncateTaskName(_0x50393e,_0x12bd08){const _0x9e56e9=a54_0x1fa737,_0xe56769=stringWidth(_0x50393e);if(_0xe56769<=_0x12bd08)return _0x50393e;let _0xa03ba1=_0x50393e;while(stringWidth(_0xa03ba1+'…')>_0x12bd08&&_0xa03ba1[_0x9e56e9(0x240)]>0x0){_0xa03ba1=_0xa03ba1[_0x9e56e9(0x26b)](0x0,-0x1);}return _0xa03ba1+'…';}function calculateTimeScale(_0x554478,_0x40aa83){const _0x341cfa=a54_0x1fa737;return{'startTime':_0x554478['start'],'endTime':_0x554478[_0x341cfa(0x12f)],'durationMs':_0x554478[_0x341cfa(0x23e)],'msPerChar':_0x554478['duration']/_0x40aa83};}function timeToPosition(_0x3b51d2,_0x2f9ea9,_0x5bef03){const _0x3b4941=a54_0x1fa737,_0x288f62=_0x3b51d2-_0x2f9ea9[_0x3b4941(0x1d2)],_0x559511=Math['floor'](_0x288f62/_0x2f9ea9['msPerChar']);return Math['max'](0x0,Math[_0x3b4941(0x1b5)](_0x559511,_0x5bef03));}function renderTimeAxis(_0xc0f44c,_0x1919b1){const _0x492224=a54_0x1fa737,_0x24fe99=Math[_0x492224(0x1b5)](TIMELINE_CONFIG[_0x492224(0x17a)],Math[_0x492224(0x255)](TIMELINE_CONFIG[_0x492224(0x1af)],Math[_0x492224(0x215)](_0x1919b1/TIMELINE_CONFIG[_0x492224(0x2b0)]))),_0x20ac21=_0xc0f44c[_0x492224(0x180)]/(_0x24fe99-0x1),_0x846aa6=new Date(_0xc0f44c[_0x492224(0x1d2)]),_0x599815=[];for(let _0x2669b8=0x0;_0x2669b8<_0x24fe99;_0x2669b8++){const _0x4f9c14=_0xc0f44c[_0x492224(0x1d2)]+_0x2669b8*_0x20ac21,_0x588f7e=timeToPosition(_0x4f9c14,_0xc0f44c,_0x1919b1),_0x38f2b8=formatTimestamp(_0x4f9c14,_0x846aa6);_0x599815['push']({'pos':_0x588f7e,'text':_0x38f2b8});}const _0x92ccfa=new Array(_0x1919b1)[_0x492224(0x2dc)]('\x20');let _0x215328=-0x1;for(const {pos:_0x276a46,text:_0x1fb756}of _0x599815){let _0x716e8b=Math[_0x492224(0x255)](0x0,_0x276a46-Math[_0x492224(0x215)](_0x1fb756[_0x492224(0x240)]/0x2));_0x716e8b<=_0x215328+TIMELINE_CONFIG[_0x492224(0x2de)]&&(_0x716e8b=_0x215328+TIMELINE_CONFIG[_0x492224(0x2de)]+0x1);_0x716e8b+_0x1fb756[_0x492224(0x240)]>_0x1919b1&&(_0x716e8b=_0x1919b1-_0x1fb756[_0x492224(0x240)]);if(_0x716e8b>=0x0&&_0x716e8b+_0x1fb756['length']<=_0x1919b1&&_0x716e8b>_0x215328){for(let _0x49f007=0x0;_0x49f007<_0x1fb756[_0x492224(0x240)];_0x49f007++){_0x92ccfa[_0x716e8b+_0x49f007]=_0x1fb756[_0x49f007];}_0x215328=_0x716e8b+_0x1fb756[_0x492224(0x240)]-0x1;}}return _0x92ccfa['join']('');}function renderTaskRow(_0x2d45f0,_0x27b425,_0x4dcc83,_0x5bbe12){const _0x445a2a=a54_0x1fa737,{level:_0x5e256f,name:_0x4fdb11}=parseTaskName(_0x2d45f0[_0x445a2a(0x24e)]),_0x147f6a='\x20'[_0x445a2a(0x2ce)](_0x5e256f),_0x193afc=_0x2d45f0[_0x445a2a(0x22d)]?'('+formatElapsed(_0x2d45f0[_0x445a2a(0x22d)][_0x445a2a(0x23e)])+')':'',_0x19e10a=stringWidth(_0x193afc),_0x2b800f=_0x5e256f*0x1,_0x55a04e=_0x5bbe12-_0x2b800f-_0x19e10a-0x1,_0x45ffa5=truncateTaskName(_0x4fdb11,_0x55a04e),_0x2ed331=_0x147f6a+_0x45ffa5,_0x15e3c7=stringWidth(_0x2ed331),_0x32b902=_0x5bbe12-_0x15e3c7-_0x19e10a,_0x1af525=_0x2ed331+'\x20'[_0x445a2a(0x2ce)](Math[_0x445a2a(0x255)](0x1,_0x32b902))+a54_0x3b7b49['dim'](_0x193afc),_0x35df21=getTaskStateIcon(_0x2d45f0[_0x445a2a(0x133)]),_0x1655c0=new Array(_0x4dcc83)[_0x445a2a(0x2dc)]('\x20');if(_0x2d45f0[_0x445a2a(0x22d)]){const _0x350556=timeToPosition(_0x2d45f0['window'][_0x445a2a(0x292)],_0x27b425,_0x4dcc83),_0x3b5f22=timeToPosition(_0x2d45f0[_0x445a2a(0x22d)][_0x445a2a(0x12f)],_0x27b425,_0x4dcc83),_0x4cc656=getBarChar(_0x2d45f0[_0x445a2a(0x133)]),_0x391176=Math[_0x445a2a(0x255)](_0x350556+0x1,_0x3b5f22);for(let _0x25e946=_0x350556;_0x25e946<Math[_0x445a2a(0x1b5)](_0x391176,_0x4dcc83);_0x25e946++){_0x1655c0[_0x25e946]=_0x4cc656;}}const _0x1add9c=getBarColor(_0x2d45f0['state']),_0x1e8eb7=_0x1655c0[_0x445a2a(0x285)](_0x35783e=>_0x35783e==='\x20'?'\x20':_0x1add9c(_0x35783e))[_0x445a2a(0x257)]('');return _0x35df21+'\x20'+_0x1af525+'│'+_0x1e8eb7+'│';}function calculateStats(_0x3fd6bb){const _0x50129a=a54_0x1fa737,_0xe27de8={'total':_0x3fd6bb[_0x50129a(0x240)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x35bcee of _0x3fd6bb){if(_0x35bcee[_0x50129a(0x133)]===_0x50129a(0x16a))_0xe27de8['success']++;else{if(_0x35bcee[_0x50129a(0x133)]==='error'||_0x35bcee[_0x50129a(0x133)]===_0x50129a(0x19a))_0xe27de8[_0x50129a(0x188)]++;else _0x35bcee[_0x50129a(0x133)]==='running'?_0xe27de8[_0x50129a(0x2e5)]++:_0xe27de8[_0x50129a(0x172)]++;}}return _0xe27de8;}function formatStats(_0x4e3b93){const _0x4a9d6f=a54_0x1fa737;return[_0x4a9d6f(0x205)+_0x4e3b93[_0x4a9d6f(0x231)],'✅\x20'+_0x4e3b93[_0x4a9d6f(0x16a)],'❌\x20'+_0x4e3b93[_0x4a9d6f(0x188)],'🔄\x20'+_0x4e3b93[_0x4a9d6f(0x2e5)],'⏳\x20'+_0x4e3b93[_0x4a9d6f(0x172)]][_0x4a9d6f(0x257)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a54_0x1fa737(0x1b3);[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x1ca);async[a54_0x1fa737(0x179)](_0x2ae232){const _0x116f5e=a54_0x1fa737,{options:_0x4479f6,args:_0x21beb3,tdx:_0x4bef6c}=_0x2ae232;let _0x628c0,_0x33ab3e,_0xae45ac=![];if(_0x21beb3[0x0]){if(_0x21beb3[0x0][_0x116f5e(0x1f9)]('.')){const _0x514eb6=this[_0x116f5e(0x227)](_0x21beb3,_0x4479f6);if(!_0x514eb6)return 0x1;_0x628c0=_0x514eb6[_0x116f5e(0x28b)],_0x33ab3e=_0x514eb6[_0x116f5e(0x185)];}else{_0x33ab3e=_0x21beb3[0x0],_0x628c0=_0x4479f6[_0x116f5e(0x2bb)];if(!_0x628c0)return console['error'](a54_0x3b7b49[_0x116f5e(0x160)]('Error:'),_0x116f5e(0x254)),0x1;_0xae45ac=!![];}}else{const _0x3339f8=this[_0x116f5e(0x227)](_0x21beb3,_0x4479f6);if(!_0x3339f8)return 0x1;_0x628c0=_0x3339f8['projectName'],_0x33ab3e=_0x3339f8['workflowName'];}if(_0x4479f6[_0x116f5e(0x170)]){if(_0x628c0&&_0x33ab3e)console[_0x116f5e(0x188)](_0x116f5e(0x18a)+_0x628c0+'.'+_0x33ab3e);else _0x628c0&&console[_0x116f5e(0x188)]('Filter:\x20project='+_0x628c0);}const _0xc53c8e=_0x4479f6['attemptId'],_0x329144=_0x4479f6[_0x116f5e(0x1c8)];if(_0xc53c8e){_0x329144&&console['error'](a54_0x3b7b49[_0x116f5e(0x164)](_0x116f5e(0x1df)),_0x116f5e(0x287));const _0x4457ea=_0x4479f6[_0x116f5e(0x250)];return _0x4457ea?await this[_0x116f5e(0x23b)](_0x2ae232,_0xc53c8e):await this[_0x116f5e(0x29f)](_0x2ae232,_0xc53c8e,_0x4479f6),0x0;}if(_0x329144){const _0x29a6af=await withSpinner(_0x116f5e(0x2da),()=>_0x4bef6c[_0x116f5e(0x2a0)][_0x116f5e(0x29b)]({'projectName':_0x628c0,'workflowName':_0x33ab3e,'limit':0x64}),{'verbose':_0x4479f6[_0x116f5e(0x170)]}),_0x27996f=_0x29a6af[_0x116f5e(0x262)][_0x116f5e(0x1c2)](_0x51543b=>_0x51543b['id']===_0x329144);if(!_0x27996f)return console[_0x116f5e(0x188)](a54_0x3b7b49[_0x116f5e(0x160)](_0x116f5e(0x2e0)),'Session\x20not\x20found:\x20'+_0x329144),0x1;if(!_0x27996f['lastAttempt']?.['id'])return console[_0x116f5e(0x188)](a54_0x3b7b49['red']('Error:'),_0x116f5e(0x228)+_0x329144+'\x20has\x20no\x20attempts'),0x1;const _0x23bcc7=_0x27996f[_0x116f5e(0x1fc)]['id'];_0x4479f6[_0x116f5e(0x170)]&&console[_0x116f5e(0x188)](_0x116f5e(0x244)+_0x23bcc7+_0x116f5e(0x203)+_0x329144);const _0x5b5d11=_0x4479f6['follow'];return _0x5b5d11?await this[_0x116f5e(0x23b)](_0x2ae232,_0x23bcc7):await this[_0x116f5e(0x29f)](_0x2ae232,_0x23bcc7,_0x4479f6),0x0;}const _0x3952f9=await withSpinner(_0x116f5e(0x1d3),()=>_0x4bef6c[_0x116f5e(0x2a0)][_0x116f5e(0x29b)]({'projectName':_0x628c0,'workflowName':_0x33ab3e,'limit':_0x4479f6['limit']||0x32}),{'verbose':_0x4479f6[_0x116f5e(0x170)]}),_0x470e10=_0x3952f9[_0x116f5e(0x262)];if(_0x470e10[_0x116f5e(0x240)]===0x0){if(_0x628c0&&_0x33ab3e)console[_0x116f5e(0x188)]('No\x20sessions\x20found\x20for:\x20'+_0x628c0+'.'+_0x33ab3e);else _0x628c0?console[_0x116f5e(0x188)](_0x116f5e(0x2dd)+_0x628c0):(console['error'](_0x116f5e(0x210)),console[_0x116f5e(0x188)](a54_0x3b7b49[_0x116f5e(0x189)](_0x116f5e(0x25b))));return 0x0;}_0x470e10[_0x116f5e(0x239)]((_0x31c876,_0xd46c37)=>{const _0x146a3a=_0x116f5e,_0xe62c47=_0x31c876[_0x146a3a(0x198)]||'',_0x395d57=_0xd46c37[_0x146a3a(0x198)]||'';return _0x395d57[_0x146a3a(0x18f)](_0xe62c47);});if(_0x4479f6[_0x116f5e(0x16c)]||_0x4479f6[_0x116f5e(0x1a4)])return await handleSDKOutput(_0x470e10,_0x4479f6),0x0;let _0x275177;if(_0xae45ac){const _0x503248=_0x470e10[0x0];if(!_0x503248['lastAttempt']?.['id'])return console[_0x116f5e(0x188)](_0x116f5e(0x1dc)),0x0;_0x275177=_0x503248[_0x116f5e(0x1fc)]['id'],_0x4479f6[_0x116f5e(0x170)]&&console[_0x116f5e(0x188)]('Auto-selected\x20latest\x20session:\x20'+_0x503248[_0x116f5e(0x198)]);}else{const _0x2a93ae=_0x470e10[_0x116f5e(0x285)](_0x2edf4=>{const _0x4c3f76=_0x116f5e,_0x39651e=getAttemptStatusDisplay(_0x2edf4[_0x4c3f76(0x1fc)]);return{'title':_0x2edf4[_0x4c3f76(0x15f)]?.[_0x4c3f76(0x24e)]+'.'+_0x2edf4[_0x4c3f76(0x2a0)]?.[_0x4c3f76(0x24e)]+_0x4c3f76(0x28e)+_0x2edf4[_0x4c3f76(0x198)]+'\x20'+_0x39651e['icon'],'value':_0x2edf4[_0x4c3f76(0x1fc)]?.['id']||'','description':_0x39651e[_0x4c3f76(0x15e)]};}),_0x25d2aa=await a54_0x49b152({'type':'select','name':_0x116f5e(0x243),'message':_0x116f5e(0x1de),'choices':_0x2a93ae[_0x116f5e(0x2d9)](_0x579365=>_0x579365[_0x116f5e(0x18c)]!=='')});if(!_0x25d2aa[_0x116f5e(0x243)])return 0x0;_0x275177=_0x25d2aa[_0x116f5e(0x243)];}const _0x187bd4=_0x4479f6['follow'];return _0x187bd4?await this[_0x116f5e(0x23b)](_0x2ae232,_0x275177):await this['renderSingleTimeline'](_0x2ae232,_0x275177,_0x4479f6),0x0;}async['renderSingleTimeline'](_0x17b8ff,_0x35375d,_0x5e0bae){const _0x3988cf=a54_0x1fa737,{tdx:_0x32aefa}=_0x17b8ff;let _0x1e0b83,_0x214087;try{[_0x1e0b83,_0x214087]=await Promise['all']([_0x32aefa['workflow']['attempt'](_0x35375d),_0x32aefa[_0x3988cf(0x2a0)][_0x3988cf(0x158)](_0x35375d,![])]);}catch(_0x284ec4){console[_0x3988cf(0x188)](a54_0x3b7b49[_0x3988cf(0x160)](_0x3988cf(0x275)));_0x5e0bae[_0x3988cf(0x170)]&&console['error'](_0x284ec4);throw _0x284ec4;}if(_0x5e0bae[_0x3988cf(0x16c)]||_0x5e0bae[_0x3988cf(0x1a4)]){const _0xc2fb62=this[_0x3988cf(0x214)](_0x1e0b83,_0x214087);await handleSDKOutput([_0xc2fb62],_0x5e0bae);return;}const _0x3fbc72=_0x32aefa[_0x3988cf(0x13c)][_0x3988cf(0x177)],_0x2c5e0d=this[_0x3988cf(0x1b7)](_0x1e0b83,_0x214087,_0x3fbc72);console[_0x3988cf(0x17e)](_0x2c5e0d);}async[a54_0x1fa737(0x23b)](_0x2f7ac5,_0x52b7b3){const _0x5435eb=a54_0x1fa737,{tdx:_0xd46f87}=_0x2f7ac5,_0xf68b8c=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x2db855=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x4cefe3=0x0;while(_0x4cefe3<_0x2db855){process[_0x5435eb(0x225)][_0x5435eb(0x19d)]&&process[_0x5435eb(0x225)]['write']('\x1bc');let _0x391f03,_0x3320e5;try{[_0x391f03,_0x3320e5]=await Promise['all']([_0xd46f87[_0x5435eb(0x2a0)][_0x5435eb(0x242)](_0x52b7b3),_0xd46f87['workflow'][_0x5435eb(0x158)](_0x52b7b3,![])]);}catch(_0x4bb172){console[_0x5435eb(0x188)](a54_0x3b7b49[_0x5435eb(0x160)](_0x5435eb(0x167)));_0x4cefe3>0x0&&console[_0x5435eb(0x188)](a54_0x3b7b49[_0x5435eb(0x189)](_0x5435eb(0x1f3)+_0x4cefe3));throw _0x4bb172;}const _0x3e3724=_0xd46f87['context'][_0x5435eb(0x177)],_0x22cdea=this[_0x5435eb(0x1b7)](_0x391f03,_0x3320e5,_0x3e3724);console[_0x5435eb(0x17e)](_0x22cdea);const _0x11256b=_0x391f03[_0x5435eb(0x2a7)]&&_0x3320e5[_0x5435eb(0x193)](_0x1f4344=>_0x1f4344[_0x5435eb(0x133)]!==_0x5435eb(0x2e5)&&_0x1f4344[_0x5435eb(0x133)]!==_0x5435eb(0x152));if(_0x11256b){console['error'](a54_0x3b7b49['green'](_0x5435eb(0x226)));break;}console[_0x5435eb(0x188)](a54_0x3b7b49['dim']('\x0aPolling...\x20('+_0x4cefe3*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x1d417d=>setTimeout(_0x1d417d,_0xf68b8c)),_0x4cefe3++;}_0x4cefe3>=_0x2db855&&console[_0x5435eb(0x188)](a54_0x3b7b49['yellow']('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a54_0x1fa737(0x1b7)](_0x175a3b,_0x3176b2,_0x28f2d4){const _0x2b9c16=a54_0x1fa737,_0x1a92cc=[],_0x5eaa41=TIMELINE_CONFIG[_0x2b9c16(0x282)],_0x491d08=0x5,_0x5cc73b=process[_0x2b9c16(0x225)][_0x2b9c16(0x18b)]||0x78,_0x1cc8c7=_0x5cc73b-_0x5eaa41-_0x491d08,_0x2b53fa=Math[_0x2b9c16(0x255)](TIMELINE_CONFIG[_0x2b9c16(0x1ae)],Math[_0x2b9c16(0x1b5)](_0x1cc8c7,TIMELINE_CONFIG[_0x2b9c16(0x2b5)])),_0x3a3a34=new Date(_0x175a3b[_0x2b9c16(0x2d3)])['getTime'](),_0x475d14=_0x175a3b[_0x2b9c16(0x22f)]?new Date(_0x175a3b[_0x2b9c16(0x22f)])[_0x2b9c16(0x1cc)]():Date['now'](),_0x5e4440={'start':_0x3a3a34,'end':_0x475d14,'duration':_0x475d14-_0x3a3a34},_0x4245e4=new Map(),_0xa38232=[];for(const _0x42b1e2 of _0x3176b2){if(_0x42b1e2[_0x2b9c16(0x2d6)]){const _0x50b6f9=new Date(_0x42b1e2['startedAt'])[_0x2b9c16(0x1cc)](),_0x55659f=_0x42b1e2['updatedAt']?new Date(_0x42b1e2['updatedAt'])[_0x2b9c16(0x1cc)]():Date[_0x2b9c16(0x29c)](),_0x24fb2c={'start':_0x50b6f9,'end':_0x55659f,'duration':_0x55659f-_0x50b6f9};_0x4245e4['set'](_0x42b1e2['id'],_0x24fb2c),_0xa38232[_0x2b9c16(0x224)]({'name':_0x42b1e2[_0x2b9c16(0x1fe)],'state':_0x42b1e2[_0x2b9c16(0x133)]||_0x2b9c16(0x17d),'window':_0x24fb2c});}else _0xa38232[_0x2b9c16(0x224)]({'name':_0x42b1e2[_0x2b9c16(0x1fe)],'state':_0x42b1e2[_0x2b9c16(0x133)]||'planned','window':undefined});}_0xa38232[_0x2b9c16(0x239)]((_0x593d6a,_0x279385)=>{const _0x5b93ea=_0x2b9c16;if(!_0x593d6a['window'])return 0x1;if(!_0x279385[_0x5b93ea(0x22d)])return-0x1;return _0x593d6a[_0x5b93ea(0x22d)][_0x5b93ea(0x292)]-_0x279385[_0x5b93ea(0x22d)]['start'];});const _0x2a24e7=_0xa38232[_0x2b9c16(0x240)],_0x75a0d=_0x2a24e7>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x75a0d&&_0xa38232[_0x2b9c16(0x137)](TIMELINE_CONFIG[_0x2b9c16(0x175)]);const _0xb379=calculateTimeScale(_0x5e4440,_0x2b53fa),_0x46a27b=_0x175a3b[_0x2b9c16(0x2a7)]?_0x175a3b[_0x2b9c16(0x16a)]?a54_0x3b7b49[_0x2b9c16(0x24d)](_0x2b9c16(0x16a)):a54_0x3b7b49[_0x2b9c16(0x160)]('error'):a54_0x3b7b49[_0x2b9c16(0x2a2)]('running'),_0x2673d5=_0x175a3b['project']?.['id'],_0x1466cb=_0x175a3b['sessionId'];let _0x1e97a9;if(_0x2673d5&&_0x1466cb){const _0x553d62=getWorkflowAttemptUrl(_0x28f2d4,_0x2673d5,_0x1466cb,_0x175a3b['id']);_0x1e97a9=hyperlink(a54_0x3b7b49['dim'](_0x175a3b['id']),_0x553d62);}else _0x1e97a9=a54_0x3b7b49[_0x2b9c16(0x189)](_0x175a3b['id']);_0x1a92cc['push'](_0x2b9c16(0x2c1)+_0x1e97a9+'\x20-\x20'+_0x46a27b+_0x2b9c16(0x28e)+formatElapsed(_0x5e4440[_0x2b9c16(0x23e)]));if(_0xa38232[_0x2b9c16(0x240)]>0x0){const _0x2821a6=renderTimeAxis(_0xb379,_0x2b53fa),_0x2ec35d=new Date(_0x5e4440[_0x2b9c16(0x292)]),_0x511f1a=formatDate(_0x2ec35d),_0x2f2470=TIMELINE_CONFIG[_0x2b9c16(0x2df)]+TIMELINE_CONFIG['ICON_SPACING']+_0x5eaa41,_0x38f7b1=_0x511f1a[_0x2b9c16(0x22a)](_0x2f2470),_0x2708c2=a54_0x3b7b49[_0x2b9c16(0x189)](_0x38f7b1);_0x1a92cc[_0x2b9c16(0x224)](_0x2708c2+'\x20'+_0x2821a6);for(const _0x3405a6 of _0xa38232){_0x1a92cc[_0x2b9c16(0x224)](renderTaskRow(_0x3405a6,_0xb379,_0x2b53fa,_0x5eaa41));}const _0x186ecb=calculateStats(_0xa38232);_0x1a92cc[_0x2b9c16(0x224)](formatStats(_0x186ecb)),_0x75a0d&&_0x1a92cc[_0x2b9c16(0x224)](a54_0x3b7b49[_0x2b9c16(0x164)](_0x2b9c16(0x291)+TIMELINE_CONFIG[_0x2b9c16(0x175)]+_0x2b9c16(0x23f)+_0x2a24e7+_0x2b9c16(0x1d4))),_0x1a92cc[_0x2b9c16(0x224)](''),_0x1a92cc[_0x2b9c16(0x224)](a54_0x3b7b49[_0x2b9c16(0x189)](_0x2b9c16(0x28a))+(_0x2b9c16(0x13b)+_0x175a3b['id']+_0x2b9c16(0x1e2))+a54_0x3b7b49['dim']('\x20to\x20see\x20detailed\x20logs'));}else _0x1a92cc[_0x2b9c16(0x224)]('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x1a92cc['join']('\x0a');}[a54_0x1fa737(0x214)](_0x172901,_0x2b42c6){const _0x1e01d4=a54_0x1fa737,_0x1d9e3b=new Date(_0x172901[_0x1e01d4(0x2d3)])[_0x1e01d4(0x1cc)](),_0x1d0a34=_0x172901[_0x1e01d4(0x22f)]?new Date(_0x172901['finishedAt'])[_0x1e01d4(0x1cc)]():Date[_0x1e01d4(0x29c)](),_0x562140=_0x1d0a34-_0x1d9e3b,_0x45ceb2=[];for(const _0xe3f684 of _0x2b42c6){if(_0xe3f684[_0x1e01d4(0x2d6)]){const _0x565509=new Date(_0xe3f684['startedAt'])[_0x1e01d4(0x1cc)](),_0x3d7262=_0xe3f684['updatedAt']?new Date(_0xe3f684[_0x1e01d4(0x2cd)])[_0x1e01d4(0x1cc)]():Date[_0x1e01d4(0x29c)]();_0x45ceb2['push']({'name':_0xe3f684[_0x1e01d4(0x1fe)],'state':_0xe3f684['state']||_0x1e01d4(0x17d),'window':{'start':_0x565509,'end':_0x3d7262,'duration':_0x3d7262-_0x565509}});}else _0x45ceb2[_0x1e01d4(0x224)]({'name':_0xe3f684[_0x1e01d4(0x1fe)],'state':_0xe3f684[_0x1e01d4(0x133)]||_0x1e01d4(0x152),'window':undefined});}const _0x4a55ad=calculateStats(_0x45ceb2);return{'attempt':{'id':_0x172901['id'],'status':_0x172901[_0x1e01d4(0x2a7)]?_0x172901[_0x1e01d4(0x16a)]?_0x1e01d4(0x16a):_0x1e01d4(0x188):'running','createdAt':_0x172901['createdAt'],'finishedAt':_0x172901[_0x1e01d4(0x22f)],'duration_ms':_0x562140},'tasks':_0x45ceb2[_0x1e01d4(0x285)](_0x38cbb2=>({'name':_0x38cbb2[_0x1e01d4(0x24e)],'state':_0x38cbb2[_0x1e01d4(0x133)],'startedAt':_0x38cbb2[_0x1e01d4(0x22d)]?new Date(_0x38cbb2[_0x1e01d4(0x22d)][_0x1e01d4(0x292)])[_0x1e01d4(0x246)]():null,'updatedAt':_0x38cbb2[_0x1e01d4(0x22d)]?new Date(_0x38cbb2['window'][_0x1e01d4(0x12f)])[_0x1e01d4(0x246)]():null,'duration_ms':_0x38cbb2[_0x1e01d4(0x22d)]?.['duration']||null})),'stats':_0x4a55ad};}}export class WorkflowSchedulesCommand extends BaseCommand{[a54_0x1fa737(0x24e)]='workflow:schedules';[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x2b2);async[a54_0x1fa737(0x179)](_0x18a4be){const _0x281a7e=a54_0x1fa737,{options:_0x583068,tdx:_0x808e35}=_0x18a4be,_0x4c7b12=await withSpinner(_0x281a7e(0x13f),()=>_0x808e35[_0x281a7e(0x2a0)]['listSchedules'](),{'verbose':_0x583068['verbose']}),_0x5dd7db=_0x4c7b12[_0x281a7e(0x262)];console['error'](_0x281a7e(0x2d7)+_0x5dd7db[_0x281a7e(0x240)]+_0x281a7e(0x1d5)+(_0x5dd7db[_0x281a7e(0x240)]!==0x1?'s':''));if(isStructuredFormat(_0x583068))await handleSDKOutput(_0x5dd7db,_0x583068);else{if(_0x5dd7db[_0x281a7e(0x240)]===0x0)console[_0x281a7e(0x17e)]('No\x20schedules\x20found');else for(const _0x1ff443 of _0x5dd7db){const _0x8de5f7=_0x1ff443[_0x281a7e(0x2e3)]?a54_0x3b7b49[_0x281a7e(0x164)](_0x281a7e(0x18d)):'',_0x378527=_0x1ff443['project']?.['name']?a54_0x3b7b49[_0x281a7e(0x189)]('\x20['+_0x1ff443['project'][_0x281a7e(0x24e)]+']'):'',_0x1e27fb=_0x1ff443[_0x281a7e(0x219)]?a54_0x3b7b49[_0x281a7e(0x189)](_0x281a7e(0x2ab)+new Date(_0x1ff443[_0x281a7e(0x219)])[_0x281a7e(0x174)]()):'';console[_0x281a7e(0x17e)](_0x281a7e(0x1ff)+_0x1ff443['id']+'\x20'+(_0x1ff443[_0x281a7e(0x2a0)]?.[_0x281a7e(0x24e)]||_0x281a7e(0x1c3))+_0x378527+_0x8de5f7+_0x1e27fb);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a54_0x1fa737(0x24e)]=a54_0x1fa737(0x2ef);[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x2b6);async['execute'](_0x370546){const _0x5ecdc8=a54_0x1fa737,{options:_0x5ddf66,args:_0x411362,tdx:_0xbf23b2}=_0x370546,_0x31bc6a=_0x411362[0x0];if(!_0x31bc6a)return console[_0x5ecdc8(0x188)](a54_0x3b7b49['red'](_0x5ecdc8(0x2e0)),_0x5ecdc8(0x1b4)),console[_0x5ecdc8(0x188)](a54_0x3b7b49[_0x5ecdc8(0x189)](_0x5ecdc8(0x1ec))),console[_0x5ecdc8(0x188)](a54_0x3b7b49[_0x5ecdc8(0x189)]('Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs')),0x1;const _0x542294=await withSpinner('Enabling\x20schedule\x20#'+_0x31bc6a+_0x5ecdc8(0x12a),()=>_0xbf23b2['workflow']['enableSchedule'](_0x31bc6a),{'verbose':_0x5ddf66[_0x5ecdc8(0x170)]}),_0x5f2ac9=_0x542294[_0x5ecdc8(0x262)];return isStructuredFormat(_0x5ddf66)?await handleSingleObjectOutput(_0x5f2ac9,_0x5ddf66):(console[_0x5ecdc8(0x17e)](_0x5ecdc8(0x206)+_0x31bc6a+_0x5ecdc8(0x146)+(_0x5f2ac9[_0x5ecdc8(0x2a0)]?.[_0x5ecdc8(0x24e)]||_0x5ecdc8(0x17d))+')'),_0x5f2ac9[_0x5ecdc8(0x219)]&&console[_0x5ecdc8(0x17e)](a54_0x3b7b49[_0x5ecdc8(0x189)]('\x20\x20Next\x20run:\x20'+new Date(_0x5f2ac9['nextRunTime'])[_0x5ecdc8(0x174)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a54_0x1fa737(0x24e)]=a54_0x1fa737(0x286);[a54_0x1fa737(0x1f6)]=a54_0x1fa737(0x21c);async['execute'](_0x1a64a1){const _0x347837=a54_0x1fa737,{options:_0x14e451,args:_0x27324c,tdx:_0x13d8a2}=_0x1a64a1,_0x26bc3d=_0x27324c[0x0];if(!_0x26bc3d)return console[_0x347837(0x188)](a54_0x3b7b49[_0x347837(0x160)](_0x347837(0x2e0)),_0x347837(0x1b4)),console[_0x347837(0x188)](a54_0x3b7b49[_0x347837(0x189)](_0x347837(0x1f0))),console[_0x347837(0x188)](a54_0x3b7b49[_0x347837(0x189)](_0x347837(0x27e))),0x1;const _0x23b847=await withSpinner('Disabling\x20schedule\x20#'+_0x26bc3d+_0x347837(0x12a),()=>_0x13d8a2[_0x347837(0x2a0)][_0x347837(0x1d7)](_0x26bc3d),{'verbose':_0x14e451[_0x347837(0x170)]}),_0x1a7be9=_0x23b847[_0x347837(0x262)];return isStructuredFormat(_0x14e451)?await handleSingleObjectOutput(_0x1a7be9,_0x14e451):console[_0x347837(0x17e)](_0x347837(0x206)+_0x26bc3d+_0x347837(0x1f8)+(_0x1a7be9[_0x347837(0x2a0)]?.[_0x347837(0x24e)]||_0x347837(0x17d))+')'),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1faad6,_0x43ed51){const _0x102e39=a55_0x3c3a,_0x5e06cc=_0x1faad6();while(!![]){try{const _0x351d30=parseInt(_0x102e39(0x16c))/0x1*(-parseInt(_0x102e39(0x175))/0x2)+-parseInt(_0x102e39(0x177))/0x3*(parseInt(_0x102e39(0x168))/0x4)+-parseInt(_0x102e39(0x170))/0x5*(-parseInt(_0x102e39(0x174))/0x6)+parseInt(_0x102e39(0x169))/0x7*(-parseInt(_0x102e39(0x164))/0x8)+-parseInt(_0x102e39(0x163))/0x9+-parseInt(_0x102e39(0x176))/0xa+parseInt(_0x102e39(0x16d))/0xb*(parseInt(_0x102e39(0x167))/0xc);if(_0x351d30===_0x43ed51)break;else _0x5e06cc['push'](_0x5e06cc['shift']());}catch(_0x1cf25e){_0x5e06cc['push'](_0x5e06cc['shift']());}}}(a55_0x1e93,0xb6129));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a55_0x1e93(){const _0x58783a=['entries','Bearer\x20','Authorization','42JmjXyo','194CZcsSQ','9048850Cxdgkr','3bMgELV','6772410qcALjo','24vXchHW',';\x20node/','X-Trino-User','2464476FrJeiI','5927268TkOIZZ','3087742nLzLVY','replace','length','1567EfBVLC','209qEdCwe','tdx','version','1041565sGtdqE'];a55_0x1e93=function(){return _0x58783a;};return a55_0x1e93();}function a55_0x3c3a(_0x1038eb,_0xab67e9){_0x1038eb=_0x1038eb-0x163;const _0x1e9330=a55_0x1e93();let _0x3c3acf=_0x1e9330[_0x1038eb];return _0x3c3acf;}export function getUserAgent(){const _0x4fd5a3=a55_0x3c3a,_0x244621=getVersion(),_0x393c3c=platform(),_0x98bf42=process[_0x4fd5a3(0x16f)][_0x4fd5a3(0x16a)]('v','');return'tdx/'+_0x244621+'\x20('+_0x393c3c+_0x4fd5a3(0x165)+_0x98bf42+')';}export function getAuthHeaders(_0x175b56,_0xd2c711,_0x371709){const _0x2f7b6f=a55_0x3c3a,_0x26ce7a=getVersion(),_0xd22e65={'User-Agent':getUserAgent(),'X-TD-Client':_0x2f7b6f(0x16e),'X-TD-Client-Version':_0x26ce7a};if(_0x371709)_0xd22e65[_0x2f7b6f(0x173)]=_0x2f7b6f(0x172)+_0x371709;else _0xd2c711&&(_0xd22e65[_0x2f7b6f(0x173)]='TD1\x20'+_0xd2c711);return _0xd22e65;}export function toHeaderRecord(_0x5e7d0c){const _0x2e156c=a55_0x3c3a,_0x46eea5={};for(const [_0x10391e,_0x4c41be]of Object[_0x2e156c(0x171)](_0x5e7d0c)){_0x4c41be!==undefined&&(_0x46eea5[_0x10391e]=_0x4c41be);}return _0x46eea5;}export function getTrinoHeaders(_0x2ad6c9,_0x11ec2d,_0x38682c){const _0x57ee74=a55_0x3c3a,_0x1f5e79=getAuthHeaders(_0x2ad6c9),_0x3bebf6=toHeaderRecord(_0x1f5e79);if(_0x38682c)_0x3bebf6['Authorization']='Bearer\x20'+_0x38682c;else _0x11ec2d&&(_0x3bebf6[_0x57ee74(0x166)]=_0x11ec2d);return _0x3bebf6;}export function hasAPIKey(_0x4986f5){const _0x4cae3d=a55_0x3c3a,_0x103a05=getAPIKey();return _0x103a05!==undefined&&_0x103a05[_0x4cae3d(0x16b)]>0x0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4b5e55,_0x14f9c7){const _0x390329=a56_0x1cb4,_0x346926=_0x4b5e55();while(!![]){try{const _0x18bb0d=-parseInt(_0x390329(0x142))/0x1*(parseInt(_0x390329(0x139))/0x2)+parseInt(_0x390329(0x15e))/0x3+parseInt(_0x390329(0x122))/0x4+-parseInt(_0x390329(0x136))/0x5+-parseInt(_0x390329(0x13b))/0x6*(-parseInt(_0x390329(0x125))/0x7)+parseInt(_0x390329(0x161))/0x8*(parseInt(_0x390329(0x160))/0x9)+-parseInt(_0x390329(0x145))/0xa;if(_0x18bb0d===_0x14f9c7)break;else _0x346926['push'](_0x346926['shift']());}catch(_0x4a6343){_0x346926['push'](_0x346926['shift']());}}}(a56_0x217c,0xbaf9b));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_0x41d5cc from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x5a40be){const _0x4403b3=a56_0x1cb4;return _0x5a40be[_0x4403b3(0x156)]==='json'||_0x5a40be[_0x4403b3(0x156)]===_0x4403b3(0x13a)||_0x5a40be[_0x4403b3(0x156)]===_0x4403b3(0x166)||_0x5a40be[_0x4403b3(0x156)]===_0x4403b3(0x130)||_0x5a40be[_0x4403b3(0x151)]===!![]||_0x5a40be[_0x4403b3(0x13a)]===!![]||_0x5a40be[_0x4403b3(0x166)]===!![]||_0x5a40be[_0x4403b3(0x130)]===!![];}export function parseOutputOptions(_0x47cace){const _0x2a8c11=a56_0x1cb4;return{'format':_0x47cace['format']||'table','output':_0x47cace['output']||'','limit':_0x47cace[_0x2a8c11(0x141)],'limitStructuredFormats':_0x47cace[_0x2a8c11(0x120)],'color':_0x47cace[_0x2a8c11(0x153)],'noColor':_0x47cace[_0x2a8c11(0x15d)]};}function convertSDKResultToQueryResult(_0x458b66){const _0x1cbfde=a56_0x1cb4,_0x3c206d=[];if(_0x458b66[_0x1cbfde(0x15a)]>0x0){const _0x20a273=_0x458b66[0x0];for(const [_0x2fcea3,_0xde6651]of Object[_0x1cbfde(0x152)](_0x20a273)){let _0x1039bc=_0x1cbfde(0x135);if(typeof _0xde6651===_0x1cbfde(0x14a))_0x1039bc=Number['isInteger'](_0xde6651)?_0x1cbfde(0x127):_0x1cbfde(0x137);else{if(typeof _0xde6651==='boolean')_0x1039bc='boolean';else _0xde6651===null&&(_0x1039bc='varchar');}_0x3c206d[_0x1cbfde(0x12d)]({'name':_0x2fcea3,'type':_0x1039bc});}}return{'queryId':_0x1cbfde(0x121),'columns':_0x3c206d,'data':_0x458b66,'stats':{'state':_0x1cbfde(0x148),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x458b66[_0x1cbfde(0x15a)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x4849dd,_0x12c737){const _0x2f1839=convertSDKResultToQueryResult(_0x4849dd);return formatQueryOutput(_0x2f1839,_0x12c737);}function a56_0x1cb4(_0x15b4d6,_0x38edce){_0x15b4d6=_0x15b4d6-0x120;const _0x217c18=a56_0x217c();let _0x1cb4c3=_0x217c18[_0x15b4d6];return _0x1cb4c3;}export async function formatQueryOutput(_0x4e4b98,_0x1b00a7){const _0x16413e=a56_0x1cb4,{format:_0x2adf32,limit:_0x582d64,output:_0x3c8d75,color:_0x14462b,noColor:_0x1adc7b,limitStructuredFormats:_0x265b2e}=_0x1b00a7,_0x1fb32b=Boolean(_0x3c8d75)&&!_0x14462b,_0x17bd43={'color':_0x14462b,'noColor':_0x1adc7b||_0x1fb32b};if(_0x2adf32===_0x16413e(0x130)){const _0x422461=shouldUseLess(_0x2adf32,_0x3c8d75);return formatAsTable(_0x4e4b98,_0x582d64,_0x422461,_0x17bd43);}const _0x519e26=_0x265b2e&&Number[_0x16413e(0x14c)](_0x582d64)&&_0x4e4b98[_0x16413e(0x12b)][_0x16413e(0x15a)]>_0x582d64?{..._0x4e4b98,'data':_0x4e4b98[_0x16413e(0x12b)][_0x16413e(0x13e)](0x0,_0x582d64)}:_0x4e4b98;if(_0x2adf32===_0x16413e(0x151))return formatAsJSON(_0x519e26,_0x17bd43);else return _0x2adf32===_0x16413e(0x13a)?formatAsJSONL(_0x519e26,_0x17bd43):formatQueryResult(_0x519e26,_0x2adf32);}function shouldUseLess(_0x4fcc66,_0x23741a){const _0x481ab4=a56_0x1cb4;return(_0x4fcc66===_0x481ab4(0x130)||_0x4fcc66==='list')&&process['stdout']['isTTY']&&!_0x23741a;}export function resolveOutputOptions(_0x2e22b5){const _0x306042=a56_0x1cb4,_0x4d6468=_0x2e22b5[_0x306042(0x12f)]||'',_0x102297=resolveOutputFormat(_0x2e22b5[_0x306042(0x156)],_0x4d6468,_0x306042(0x130));let _0x65165d=typeof _0x2e22b5[_0x306042(0x141)]===_0x306042(0x14a)?_0x2e22b5[_0x306042(0x141)]:parseInt(_0x2e22b5[_0x306042(0x141)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x2e22b5[_0x306042(0x141)]===undefined&&shouldUseLess(_0x102297,_0x4d6468)&&(_0x65165d=Infinity),{'format':_0x102297,'output':_0x4d6468,'limit':_0x65165d,'limitStructuredFormats':_0x2e22b5[_0x306042(0x120)],'color':_0x2e22b5[_0x306042(0x153)],'noColor':_0x2e22b5['noColor']};}export function writeOutput(_0x15795c,_0x6270b,_0x5e7ef7){const _0x528de6=a56_0x1cb4;return _0x6270b?(writeFileSync(_0x6270b,_0x15795c),console['error']('Results\x20saved\x20to\x20'+_0x6270b),Promise[_0x528de6(0x15b)]()):shouldUseLess(_0x5e7ef7||'','')?new Promise(_0x7989ed=>{const _0x266489=_0x528de6,_0xcce015=spawn(_0x266489(0x157),['-FXRSn'],{'stdio':[_0x266489(0x143),_0x266489(0x165),_0x266489(0x165)]});let _0x11e4bf=![];_0xcce015['on']('error',()=>{!_0x11e4bf&&(_0x11e4bf=!![],console['log'](_0x15795c),_0x7989ed());}),_0xcce015['on'](_0x266489(0x15f),()=>{!_0x11e4bf&&(_0x11e4bf=!![],_0x7989ed());}),_0xcce015['on'](_0x266489(0x162),()=>{const _0x1077ea=_0x266489;!_0x11e4bf&&_0xcce015[_0x1077ea(0x124)]&&(_0xcce015['stdin']['on'](_0x1077ea(0x12a),()=>{}),_0xcce015['stdin']['write'](_0x15795c),_0xcce015[_0x1077ea(0x124)][_0x1077ea(0x132)]());}),!_0xcce015[_0x266489(0x124)]&&(!_0x11e4bf&&(_0x11e4bf=!![],console[_0x266489(0x15c)](_0x15795c),_0x7989ed()));}):(console['log'](_0x15795c),Promise['resolve']());}export async function handleSDKOutput(_0x47d584,_0x55db24){const _0x49ac9b=a56_0x1cb4,_0x53c009=resolveOutputOptions(_0x55db24),_0x47f1a7=await formatSDKOutput(_0x47d584,_0x53c009);await writeOutput(_0x47f1a7,_0x53c009[_0x49ac9b(0x12f)]||undefined,_0x53c009['format']);}function a56_0x217c(){const _0x1c7deb=['stringify','62638rWQwaC','jsonl','6OUSNDZ','forEach','─┬─','slice','trim','split','limit','21SZZGYx','pipe','params','2793000rfobRT','max','[rule]','FINISHED','map','number','[params]','isFinite','yellow','debug','cmdout','No\x20data','json','entries','color','repeat','rule','format','less','blue','query','length','resolve','log','noColor','1719783UZPWUC','close','1773fAqfqC','59448hCVSBJ','spawn','filter','join','inherit','tsv','stderr','limitStructuredFormats','sdk-result','1281608iUyVgy','object','stdin','2240462rlWRNe','[logs]','bigint','[Object]','bold','error','data','padEnd','push','magenta','output','table','[query]','end','red','keys','varchar','4873930flzfYw','double'];a56_0x217c=function(){return _0x1c7deb;};return a56_0x217c();}export async function handleQueryOutput(_0x554355,_0x4b1710){const _0x2713cd=a56_0x1cb4,_0x437b4a=resolveOutputOptions(_0x4b1710),_0x29afb7=await formatQueryOutput(_0x554355,_0x437b4a);await writeOutput(_0x29afb7,_0x437b4a[_0x2713cd(0x12f)]||undefined,_0x437b4a['format']);}async function formatSingleObject(_0x18e898,_0x489abf){const _0x54007d=a56_0x1cb4,{format:_0x2374c2,color:_0x39352a,noColor:_0x4bdc7e}=_0x489abf,_0x12dd1e={'color':_0x39352a,'noColor':_0x4bdc7e};if(_0x2374c2===_0x54007d(0x151)){if(shouldUseColor(_0x12dd1e))return colorizeJSON(_0x18e898,_0x12dd1e);return JSON[_0x54007d(0x138)](_0x18e898,null,0x2);}else{if(_0x2374c2===_0x54007d(0x13a)){if(shouldUseColor(_0x12dd1e))return colorizeJSONCompact(_0x18e898,_0x12dd1e);return JSON['stringify'](_0x18e898);}else{if(_0x2374c2===_0x54007d(0x166))return Object[_0x54007d(0x152)](_0x18e898)['map'](([_0x9e805b,_0xed8254])=>_0x9e805b+'\x09'+_0xed8254)[_0x54007d(0x164)]('\x0a');else{const _0x468599=Object[_0x54007d(0x152)](_0x18e898);if(_0x468599[_0x54007d(0x15a)]===0x0)return _0x54007d(0x150);const _0x5cc658=_0x18e898[_0x54007d(0x14e)],_0x2317ad=_0x18e898[_0x54007d(0x159)],_0x3f1ee2=_0x18e898[_0x54007d(0x144)],_0x426bdc=_0x18e898[_0x54007d(0x155)],_0x5af97d=_0x2317ad?typeof _0x2317ad==='string'?_0x2317ad:JSON[_0x54007d(0x138)](_0x2317ad,null,0x2):undefined,_0x3a01e6=_0x3f1ee2&&Object[_0x54007d(0x134)](_0x3f1ee2)[_0x54007d(0x15a)]>0x0?JSON[_0x54007d(0x138)](_0x3f1ee2,null,0x2):undefined,_0x20d2ce=_0x426bdc&&Object[_0x54007d(0x134)](_0x426bdc)[_0x54007d(0x15a)]>0x0?JSON[_0x54007d(0x138)](_0x426bdc,null,0x2):undefined,_0x59cf11=_0x468599[_0x54007d(0x163)](([_0x2ac4ea])=>_0x2ac4ea!==_0x54007d(0x14e)&&_0x2ac4ea!==_0x54007d(0x159)&&_0x2ac4ea!==_0x54007d(0x144)&&_0x2ac4ea!==_0x54007d(0x155)),_0x386964=Math[_0x54007d(0x146)](..._0x59cf11[_0x54007d(0x149)](([_0x16a849])=>_0x16a849['length'])),_0x2e16e2=Math['max'](..._0x59cf11[_0x54007d(0x149)](([,_0x515599])=>{const _0x2e49e6=_0x54007d;try{const _0x23c62d=_0x515599===null||_0x515599===undefined?'':typeof _0x515599===_0x2e49e6(0x123)?JSON[_0x2e49e6(0x138)](_0x515599):String(_0x515599),_0x2d5c01=_0x23c62d['split']('\x0a');return Math[_0x2e49e6(0x146)](..._0x2d5c01[_0x2e49e6(0x149)](_0x5f3298=>_0x5f3298['length']),0x0);}catch{return 0x0;}}),0x14),_0x3d88f9=[];_0x3d88f9['push'](colorBorder('┌─'+'─'['repeat'](_0x386964)+_0x54007d(0x13d)+'─'[_0x54007d(0x154)](_0x2e16e2)+'─┐',_0x12dd1e)),_0x59cf11['forEach'](([_0x356369,_0x3c1ebb])=>{const _0x318fbe=_0x54007d;let _0x68df95;try{_0x68df95=_0x3c1ebb===null||_0x3c1ebb===undefined?'':typeof _0x3c1ebb==='object'?JSON[_0x318fbe(0x138)](_0x3c1ebb):String(_0x3c1ebb);}catch{_0x68df95=_0x318fbe(0x128);}const _0x40a747=_0x356369['padEnd'](_0x386964),_0x263448=_0x68df95['split']('\x0a');_0x263448['forEach']((_0xa7edcf,_0x2d192a)=>{const _0x4ae9b5=_0x318fbe,_0x15e96a=colorBorder('│',_0x12dd1e);_0x2d192a===0x0?_0x3d88f9[_0x4ae9b5(0x12d)](_0x15e96a+'\x20'+_0x40a747+'\x20'+_0x15e96a+'\x20'+_0xa7edcf[_0x4ae9b5(0x12c)](_0x2e16e2)+'\x20'+_0x15e96a):_0x3d88f9[_0x4ae9b5(0x12d)](_0x15e96a+'\x20'+'\x20'[_0x4ae9b5(0x154)](_0x386964)+'\x20'+_0x15e96a+'\x20'+_0xa7edcf[_0x4ae9b5(0x12c)](_0x2e16e2)+'\x20'+_0x15e96a);});}),_0x3d88f9['push'](colorBorder('└─'+'─'[_0x54007d(0x154)](_0x386964)+'─┴─'+'─'[_0x54007d(0x154)](_0x2e16e2)+'─┘',_0x12dd1e));_0x5af97d&&(_0x3d88f9[_0x54007d(0x12d)](''),_0x3d88f9[_0x54007d(0x12d)](String(a56_0x41d5cc[_0x54007d(0x14d)][_0x54007d(0x129)](_0x54007d(0x131)))),_0x3d88f9[_0x54007d(0x12d)](_0x5af97d));_0x3a01e6&&(_0x3d88f9[_0x54007d(0x12d)](''),_0x3d88f9['push'](String(a56_0x41d5cc[_0x54007d(0x158)][_0x54007d(0x129)](_0x54007d(0x14b)))),_0x3d88f9[_0x54007d(0x12d)](_0x3a01e6));_0x20d2ce&&(_0x3d88f9[_0x54007d(0x12d)](''),_0x3d88f9[_0x54007d(0x12d)](String(a56_0x41d5cc[_0x54007d(0x12e)][_0x54007d(0x129)](_0x54007d(0x147)))),_0x3d88f9[_0x54007d(0x12d)](_0x20d2ce));if(_0x5cc658){if(_0x5cc658['stderr']){_0x3d88f9['push'](''),_0x3d88f9['push'](String(a56_0x41d5cc[_0x54007d(0x133)][_0x54007d(0x129)]('[error]')));const _0xfbc2d0=_0x5cc658[_0x54007d(0x167)][_0x54007d(0x140)]('\x0a');_0xfbc2d0[_0x54007d(0x13c)](_0x232664=>{const _0x6dbfb5=_0x54007d;_0x232664[_0x6dbfb5(0x13f)]()&&_0x3d88f9[_0x6dbfb5(0x12d)](_0x232664);});}if(_0x5cc658[_0x54007d(0x14f)]){_0x3d88f9[_0x54007d(0x12d)](''),_0x3d88f9['push'](String(a56_0x41d5cc['cyan'][_0x54007d(0x129)](_0x54007d(0x126))));const _0x20b085=_0x5cc658[_0x54007d(0x14f)][_0x54007d(0x140)]('\x0a');_0x20b085[_0x54007d(0x13c)](_0x4b1758=>{const _0x2b077f=_0x54007d;_0x4b1758[_0x2b077f(0x13f)]()&&_0x3d88f9[_0x2b077f(0x12d)](_0x4b1758);});}}return _0x3d88f9[_0x54007d(0x164)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x4fc44a,_0x14ca8c){const _0x4f2e32=a56_0x1cb4;if(_0x14ca8c['format']===_0x4f2e32(0x130)){await handleSDKOutput([_0x4fc44a],_0x14ca8c);return;}const _0x4ff326=resolveOutputOptions(_0x14ca8c),_0x312fd3=await formatSingleObject(_0x4fc44a,_0x4ff326);await writeOutput(_0x312fd3,_0x4ff326[_0x4f2e32(0x12f)]||undefined,_0x4ff326[_0x4f2e32(0x156)]);}
|
|
1
|
+
(function(_0x52cc88,_0x5942d2){const _0x46b0d2=a56_0x4084,_0x21772a=_0x52cc88();while(!![]){try{const _0x3750f2=-parseInt(_0x46b0d2(0x117))/0x1*(parseInt(_0x46b0d2(0x11b))/0x2)+parseInt(_0x46b0d2(0x123))/0x3+-parseInt(_0x46b0d2(0x10a))/0x4+-parseInt(_0x46b0d2(0x12c))/0x5+-parseInt(_0x46b0d2(0xf8))/0x6+-parseInt(_0x46b0d2(0x132))/0x7+parseInt(_0x46b0d2(0x105))/0x8;if(_0x3750f2===_0x5942d2)break;else _0x21772a['push'](_0x21772a['shift']());}catch(_0x5a3700){_0x21772a['push'](_0x21772a['shift']());}}}(a56_0x6e21,0xcb353));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';function a56_0x4084(_0x185fcf,_0x1ff167){_0x185fcf=_0x185fcf-0xf4;const _0x6e219=a56_0x6e21();let _0x40845c=_0x6e219[_0x185fcf];return _0x40845c;}import a56_0x59d8d5 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x7e7b7e){const _0x12683c=a56_0x4084;return _0x7e7b7e[_0x12683c(0xfc)]===_0x12683c(0x10c)||_0x7e7b7e[_0x12683c(0xfc)]==='jsonl'||_0x7e7b7e[_0x12683c(0xfc)]===_0x12683c(0x10d)||_0x7e7b7e['format']===_0x12683c(0x136)||_0x7e7b7e[_0x12683c(0x10c)]===!![]||_0x7e7b7e[_0x12683c(0x126)]===!![]||_0x7e7b7e['tsv']===!![]||_0x7e7b7e[_0x12683c(0x136)]===!![];}export function parseOutputOptions(_0x2a102b){const _0x2308bb=a56_0x4084;return{'format':_0x2a102b[_0x2308bb(0xfc)]||_0x2308bb(0x136),'output':_0x2a102b[_0x2308bb(0x135)]||'','limit':_0x2a102b[_0x2308bb(0x115)],'limitStructuredFormats':_0x2a102b['limitStructuredFormats'],'color':_0x2a102b[_0x2308bb(0x10f)],'noColor':_0x2a102b[_0x2308bb(0x134)]};}function convertSDKResultToQueryResult(_0x5b6be3){const _0x3738b8=a56_0x4084,_0x5388ca=[];if(_0x5b6be3['length']>0x0){const _0x2dc6a1=_0x5b6be3[0x0];for(const [_0x298440,_0x1a7fe1]of Object[_0x3738b8(0x11c)](_0x2dc6a1)){let _0x668b8f=_0x3738b8(0xff);if(typeof _0x1a7fe1===_0x3738b8(0x111))_0x668b8f=Number[_0x3738b8(0xfb)](_0x1a7fe1)?_0x3738b8(0xf4):_0x3738b8(0x104);else{if(typeof _0x1a7fe1===_0x3738b8(0x116))_0x668b8f=_0x3738b8(0x116);else _0x1a7fe1===null&&(_0x668b8f='varchar');}_0x5388ca[_0x3738b8(0x133)]({'name':_0x298440,'type':_0x668b8f});}}return{'queryId':_0x3738b8(0x12a),'columns':_0x5388ca,'data':_0x5b6be3,'stats':{'state':_0x3738b8(0x12f),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x5b6be3['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x529991,_0x6a5900){const _0xcade7b=convertSDKResultToQueryResult(_0x529991);return formatQueryOutput(_0xcade7b,_0x6a5900);}export async function formatQueryOutput(_0x3c80ca,_0xff10dd){const _0x1f6d2c=a56_0x4084,{format:_0x445416,limit:_0x2ba552,output:_0x589814,color:_0x1c97dc,noColor:_0x410e2e,limitStructuredFormats:_0x20214c}=_0xff10dd,_0x36e57e=Boolean(_0x589814)&&!_0x1c97dc,_0x442451={'color':_0x1c97dc,'noColor':_0x410e2e||_0x36e57e};if(_0x445416===_0x1f6d2c(0x136)){const _0x49700e=shouldUseLess(_0x445416,_0x589814);return formatAsTable(_0x3c80ca,_0x2ba552,_0x49700e,_0x442451);}const _0x5d7e53=_0x20214c&&Number['isFinite'](_0x2ba552)&&_0x3c80ca[_0x1f6d2c(0x11f)]['length']>_0x2ba552?{..._0x3c80ca,'data':_0x3c80ca[_0x1f6d2c(0x11f)]['slice'](0x0,_0x2ba552)}:_0x3c80ca;if(_0x445416==='json')return formatAsJSON(_0x5d7e53,_0x442451);else return _0x445416===_0x1f6d2c(0x126)?formatAsJSONL(_0x5d7e53,_0x442451):formatQueryResult(_0x5d7e53,_0x445416);}function shouldUseLess(_0x57809e,_0x53872e){const _0x29d6c9=a56_0x4084;return(_0x57809e==='table'||_0x57809e===_0x29d6c9(0x125))&&process[_0x29d6c9(0x137)][_0x29d6c9(0x108)]&&!_0x53872e;}export function resolveOutputOptions(_0x538343){const _0x50dfee=a56_0x4084,_0x154af0=_0x538343[_0x50dfee(0x135)]||'',_0x260cea=resolveOutputFormat(_0x538343['format'],_0x154af0,'table');let _0x384931=typeof _0x538343[_0x50dfee(0x115)]===_0x50dfee(0x111)?_0x538343['limit']:parseInt(_0x538343[_0x50dfee(0x115)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x538343[_0x50dfee(0x115)]===undefined&&shouldUseLess(_0x260cea,_0x154af0)&&(_0x384931=Infinity),{'format':_0x260cea,'output':_0x154af0,'limit':_0x384931,'limitStructuredFormats':_0x538343[_0x50dfee(0x122)],'color':_0x538343['color'],'noColor':_0x538343['noColor']};}export function writeOutput(_0x3d157a,_0x3379dd,_0x514d08){const _0x7bf3a=a56_0x4084;return _0x3379dd?(writeFileSync(_0x3379dd,_0x3d157a),console[_0x7bf3a(0x10e)](_0x7bf3a(0x131)+_0x3379dd),Promise[_0x7bf3a(0x12d)]()):shouldUseLess(_0x514d08||'','')?new Promise(_0x29ce71=>{const _0x3d47ed=_0x7bf3a,_0x555b53=spawn(_0x3d47ed(0x11d),['-FXRSn'],{'stdio':[_0x3d47ed(0x109),_0x3d47ed(0x113),_0x3d47ed(0x113)]});let _0x2c70ee=![];_0x555b53['on']('error',()=>{const _0x5cf3e5=_0x3d47ed;!_0x2c70ee&&(_0x2c70ee=!![],console[_0x5cf3e5(0xfa)](_0x3d157a),_0x29ce71());}),_0x555b53['on'](_0x3d47ed(0x114),()=>{!_0x2c70ee&&(_0x2c70ee=!![],_0x29ce71());}),_0x555b53['on']('spawn',()=>{const _0x2cb10d=_0x3d47ed;!_0x2c70ee&&_0x555b53[_0x2cb10d(0x101)]&&(_0x555b53[_0x2cb10d(0x101)]['on'](_0x2cb10d(0x10e),()=>{}),_0x555b53[_0x2cb10d(0x101)]['write'](_0x3d157a),_0x555b53[_0x2cb10d(0x101)][_0x2cb10d(0x107)]());}),!_0x555b53[_0x3d47ed(0x101)]&&(!_0x2c70ee&&(_0x2c70ee=!![],console['log'](_0x3d157a),_0x29ce71()));}):(console[_0x7bf3a(0xfa)](_0x3d157a),Promise[_0x7bf3a(0x12d)]());}export async function handleSDKOutput(_0x585552,_0x4922bd){const _0x40d6c1=a56_0x4084,_0x158972=resolveOutputOptions(_0x4922bd),_0x2c125b=await formatSDKOutput(_0x585552,_0x158972);await writeOutput(_0x2c125b,_0x158972[_0x40d6c1(0x135)]||undefined,_0x158972['format']);}export async function handleQueryOutput(_0xd7cff0,_0x6737a9){const _0x5aa1fe=a56_0x4084,_0x5854db=resolveOutputOptions(_0x6737a9),_0x43e85e=await formatQueryOutput(_0xd7cff0,_0x5854db);await writeOutput(_0x43e85e,_0x5854db[_0x5aa1fe(0x135)]||undefined,_0x5854db[_0x5aa1fe(0xfc)]);}async function formatSingleObject(_0x3d348b,_0x3c9496){const _0x10cc74=a56_0x4084,{format:_0x497382,color:_0x3e64b5,noColor:_0x3f5c11}=_0x3c9496,_0x452ca1={'color':_0x3e64b5,'noColor':_0x3f5c11};if(_0x497382===_0x10cc74(0x10c)){if(shouldUseColor(_0x452ca1))return colorizeJSON(_0x3d348b,_0x452ca1);return JSON[_0x10cc74(0x138)](_0x3d348b,null,0x2);}else{if(_0x497382===_0x10cc74(0x126)){if(shouldUseColor(_0x452ca1))return colorizeJSONCompact(_0x3d348b,_0x452ca1);return JSON[_0x10cc74(0x138)](_0x3d348b);}else{if(_0x497382==='tsv')return Object[_0x10cc74(0x11c)](_0x3d348b)['map'](([_0x494619,_0x3912ae])=>_0x494619+'\x09'+_0x3912ae)[_0x10cc74(0x139)]('\x0a');else{const _0x4ae87f=Object[_0x10cc74(0x11c)](_0x3d348b);if(_0x4ae87f[_0x10cc74(0xf6)]===0x0)return _0x10cc74(0x110);const _0x2e2e3a=_0x3d348b['debug'],_0x39bbf6=_0x3d348b[_0x10cc74(0x129)],_0x48cc33=_0x3d348b['params'],_0x271590=_0x3d348b[_0x10cc74(0x11e)],_0x13c154=_0x39bbf6?typeof _0x39bbf6===_0x10cc74(0x130)?_0x39bbf6:JSON[_0x10cc74(0x138)](_0x39bbf6,null,0x2):undefined,_0x514e2c=_0x48cc33&&Object[_0x10cc74(0x120)](_0x48cc33)[_0x10cc74(0xf6)]>0x0?JSON[_0x10cc74(0x138)](_0x48cc33,null,0x2):undefined,_0x19e873=_0x271590&&Object[_0x10cc74(0x120)](_0x271590)[_0x10cc74(0xf6)]>0x0?JSON['stringify'](_0x271590,null,0x2):undefined,_0x45a19d=_0x4ae87f[_0x10cc74(0x119)](([_0x35ba16])=>_0x35ba16!==_0x10cc74(0x124)&&_0x35ba16!==_0x10cc74(0x129)&&_0x35ba16!==_0x10cc74(0x10b)&&_0x35ba16!==_0x10cc74(0x11e)),_0x361c99=Math['max'](..._0x45a19d[_0x10cc74(0x103)](([_0x5562f6])=>_0x5562f6['length'])),_0x9db5ef=Math[_0x10cc74(0xf9)](..._0x45a19d[_0x10cc74(0x103)](([,_0x412777])=>{const _0x5c0e93=_0x10cc74;try{const _0x3317b2=_0x412777===null||_0x412777===undefined?'':typeof _0x412777==='object'?JSON[_0x5c0e93(0x138)](_0x412777):String(_0x412777),_0x297265=_0x3317b2[_0x5c0e93(0x112)]('\x0a');return Math[_0x5c0e93(0xf9)](..._0x297265['map'](_0x484434=>_0x484434[_0x5c0e93(0xf6)]),0x0);}catch{return 0x0;}}),0x14),_0x91fa09=[];_0x91fa09[_0x10cc74(0x133)](colorBorder('┌─'+'─'[_0x10cc74(0x127)](_0x361c99)+_0x10cc74(0x121)+'─'[_0x10cc74(0x127)](_0x9db5ef)+'─┐',_0x452ca1)),_0x45a19d[_0x10cc74(0xf5)](([_0x127145,_0x20cd49])=>{const _0x242e01=_0x10cc74;let _0x643cd4;try{_0x643cd4=_0x20cd49===null||_0x20cd49===undefined?'':typeof _0x20cd49==='object'?JSON['stringify'](_0x20cd49):String(_0x20cd49);}catch{_0x643cd4='[Object]';}const _0x47215d=_0x127145['padEnd'](_0x361c99),_0x1dc913=_0x643cd4[_0x242e01(0x112)]('\x0a');_0x1dc913[_0x242e01(0xf5)]((_0x5272ed,_0x2dc541)=>{const _0x2ae1d6=_0x242e01,_0x588ca3=colorBorder('│',_0x452ca1);_0x2dc541===0x0?_0x91fa09[_0x2ae1d6(0x133)](_0x588ca3+'\x20'+_0x47215d+'\x20'+_0x588ca3+'\x20'+_0x5272ed['padEnd'](_0x9db5ef)+'\x20'+_0x588ca3):_0x91fa09[_0x2ae1d6(0x133)](_0x588ca3+'\x20'+'\x20'[_0x2ae1d6(0x127)](_0x361c99)+'\x20'+_0x588ca3+'\x20'+_0x5272ed['padEnd'](_0x9db5ef)+'\x20'+_0x588ca3);});}),_0x91fa09[_0x10cc74(0x133)](colorBorder('└─'+'─'['repeat'](_0x361c99)+_0x10cc74(0x100)+'─'['repeat'](_0x9db5ef)+'─┘',_0x452ca1));_0x13c154&&(_0x91fa09['push'](''),_0x91fa09['push'](String(a56_0x59d8d5[_0x10cc74(0x118)][_0x10cc74(0x106)](_0x10cc74(0x12e)))),_0x91fa09[_0x10cc74(0x133)](_0x13c154));_0x514e2c&&(_0x91fa09[_0x10cc74(0x133)](''),_0x91fa09[_0x10cc74(0x133)](String(a56_0x59d8d5[_0x10cc74(0xfd)][_0x10cc74(0x106)](_0x10cc74(0xfe)))),_0x91fa09[_0x10cc74(0x133)](_0x514e2c));_0x19e873&&(_0x91fa09[_0x10cc74(0x133)](''),_0x91fa09[_0x10cc74(0x133)](String(a56_0x59d8d5[_0x10cc74(0x12b)][_0x10cc74(0x106)]('[rule]'))),_0x91fa09[_0x10cc74(0x133)](_0x19e873));if(_0x2e2e3a){if(_0x2e2e3a['stderr']){_0x91fa09[_0x10cc74(0x133)](''),_0x91fa09[_0x10cc74(0x133)](String(a56_0x59d8d5['red'][_0x10cc74(0x106)](_0x10cc74(0xf7))));const _0x4df0a0=_0x2e2e3a[_0x10cc74(0x102)][_0x10cc74(0x112)]('\x0a');_0x4df0a0[_0x10cc74(0xf5)](_0x1e310b=>{const _0x40af53=_0x10cc74;_0x1e310b[_0x40af53(0x11a)]()&&_0x91fa09['push'](_0x1e310b);});}if(_0x2e2e3a[_0x10cc74(0x128)]){_0x91fa09[_0x10cc74(0x133)](''),_0x91fa09['push'](String(a56_0x59d8d5['cyan'][_0x10cc74(0x106)]('[logs]')));const _0x5002a5=_0x2e2e3a[_0x10cc74(0x128)][_0x10cc74(0x112)]('\x0a');_0x5002a5[_0x10cc74(0xf5)](_0x424118=>{const _0x3b1bdc=_0x10cc74;_0x424118[_0x3b1bdc(0x11a)]()&&_0x91fa09[_0x3b1bdc(0x133)](_0x424118);});}}return _0x91fa09[_0x10cc74(0x139)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x154ce7,_0x588e7f){const _0xb69e8=a56_0x4084;if(_0x588e7f[_0xb69e8(0xfc)]===_0xb69e8(0x136)){await handleSDKOutput([_0x154ce7],_0x588e7f);return;}const _0x5781f5=resolveOutputOptions(_0x588e7f),_0x85283=await formatSingleObject(_0x154ce7,_0x5781f5);await writeOutput(_0x85283,_0x5781f5['output']||undefined,_0x5781f5[_0xb69e8(0xfc)]);}function a56_0x6e21(){const _0x1d3b97=['blue','[params]','varchar','─┴─','stdin','stderr','map','double','19156072UJOZxr','bold','end','isTTY','pipe','3559936gmYlkZ','params','json','tsv','error','color','No\x20data','number','split','inherit','close','limit','boolean','9290dmtZCu','yellow','filter','trim','8ioiBhC','entries','less','rule','data','keys','─┬─','limitStructuredFormats','3128388GslPfG','debug','list','jsonl','repeat','cmdout','query','sdk-result','magenta','9160QxasHC','resolve','[query]','FINISHED','string','Results\x20saved\x20to\x20','6190254hYtFjm','push','noColor','output','table','stdout','stringify','join','bigint','forEach','length','[error]','4750008vJHJVH','max','log','isInteger','format'];a56_0x6e21=function(){return _0x1d3b97;};return a56_0x6e21();}
|