@treasuredata/tdx 2026.3.18 → 2026.3.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +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/segment-validator.js.map +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a51_0x57b8c4=a51_0x532a;(function(_0x96bc9a,_0x267145){const _0x1a9d81=a51_0x532a,_0x4931c8=_0x96bc9a();while(!![]){try{const _0x5eb2d8=-parseInt(_0x1a9d81(0x196))/0x1+-parseInt(_0x1a9d81(0x27b))/0x2+-parseInt(_0x1a9d81(0x25a))/0x3+-parseInt(_0x1a9d81(0x1b4))/0x4*(parseInt(_0x1a9d81(0x198))/0x5)+-parseInt(_0x1a9d81(0x2bb))/0x6+parseInt(_0x1a9d81(0x266))/0x7*(-parseInt(_0x1a9d81(0x20b))/0x8)+parseInt(_0x1a9d81(0x2b2))/0x9*(parseInt(_0x1a9d81(0x11d))/0xa);if(_0x5eb2d8===_0x267145)break;else _0x4931c8['push'](_0x4931c8['shift']());}catch(_0x33893a){_0x4931c8['push'](_0x4931c8['shift']());}}}(a51_0x43e0,0x7589f));import a51_0x4bfa70 from'chalk';import{existsSync}from'fs';import a51_0x1bf6f6 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a51_0x49f54b from'prompts';function getAttemptStatusDisplay(_0x4708d8){const _0x17c49b=a51_0x532a;if(!_0x4708d8)return{'icon':'⏳','text':''};const {done:_0x5ccaf4,success:_0x53c48a,cancelRequested:_0xc31ad3}=_0x4708d8;if(!_0x5ccaf4)return _0xc31ad3?{'icon':'🛑','text':a51_0x4bfa70['yellow'](_0x17c49b(0x136))}:{'icon':'🔄','text':a51_0x4bfa70[_0x17c49b(0x180)](_0x17c49b(0x237))};if(_0x53c48a)return{'icon':'✅','text':a51_0x4bfa70[_0x17c49b(0x24d)](_0x17c49b(0x2be))};return{'icon':'❌','text':a51_0x4bfa70[_0x17c49b(0x14a)](_0x17c49b(0x276))};}export class WorkflowBaseCommand extends BaseCommand{[a51_0x57b8c4(0x1e5)](_0x3c98df,_0x3889e4,_0x3e5aa6=0x0){const _0x144bcd=a51_0x57b8c4;return _0x3c98df[_0x3e5aa6]||_0x3889e4[_0x144bcd(0x1f1)];}[a51_0x57b8c4(0x1bb)](_0x3c0fd0,_0x55d3a0,_0x1e472e=0x0){const _0xfb31d4=a51_0x57b8c4,_0x1bf87b=this[_0xfb31d4(0x1e5)](_0x3c0fd0,_0x55d3a0,_0x1e472e);if(!_0x1bf87b)return console[_0xfb31d4(0x276)](a51_0x4bfa70[_0xfb31d4(0x14a)](_0xfb31d4(0x2ac)),_0xfb31d4(0x1b5)),console[_0xfb31d4(0x276)](a51_0x4bfa70[_0xfb31d4(0x27c)](_0xfb31d4(0x2a1))),null;return _0x1bf87b;}[a51_0x57b8c4(0x1ae)](_0x525789,_0x517225){const _0x24f2ad=a51_0x57b8c4;if(_0x525789[0x0]){const _0x1250f8=_0x525789[0x0]['split']('.');if(_0x1250f8[_0x24f2ad(0x28b)]===0x1)return{'projectName':_0x1250f8[0x0],'workflowName':undefined};else return _0x1250f8['length']===0x2?{'projectName':_0x1250f8[0x0],'workflowName':_0x1250f8[0x1]}:(console['error'](a51_0x4bfa70[_0x24f2ad(0x14a)](_0x24f2ad(0x2ac)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x517225[_0x24f2ad(0x1f1)],'workflowName':undefined};}[a51_0x57b8c4(0x1fc)](_0x1c567d,_0x562c92,_0xb751a4=0x0){const _0x154c9c=a51_0x57b8c4;if(_0x1c567d[_0xb751a4])return _0x1c567d[_0xb751a4];if(_0x562c92['workflowProject']){const _0x13d738=a51_0x1bf6f6[_0x154c9c(0x1a6)](process[_0x154c9c(0x26a)](),_0x154c9c(0x2c3),_0x562c92['workflowProject']);if(existsSync(a51_0x1bf6f6['join'](_0x13d738,'tdx.json')))return _0x13d738;}return undefined;}async['showWorkflowConsoleUrl'](_0x75963d,_0x13119,_0x40dd39){const _0x106ae6=a51_0x57b8c4;try{const _0x1803a6=await _0x75963d['workflow'][_0x106ae6(0x2c3)](_0x13119,{'limit':0x1});if(_0x1803a6[_0x106ae6(0x28b)]>0x0){const _0x301cd6=_0x1803a6[0x0]['id'],_0x272d89=getWorkflowUrl(_0x40dd39,_0x301cd6);console[_0x106ae6(0x276)](_0x106ae6(0x1df)+a51_0x4bfa70[_0x106ae6(0x129)](_0x272d89));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a51_0x57b8c4(0x149);[a51_0x57b8c4(0x18a)]=a51_0x57b8c4(0x1d8);async['execute'](_0x564694){const _0x5e821d=a51_0x57b8c4,{options:_0x302c29,args:_0x3cf99e,tdx:_0x214beb}=_0x564694,_0x4fad6f=_0x3cf99e[0x0],_0x5a393a=_0x302c29[_0x5e821d(0x1c5)];if(_0x5a393a)return saveSessionContext({'workflow_project':undefined},_0x302c29[_0x5e821d(0x208)]),console[_0x5e821d(0x17d)](a51_0x4bfa70[_0x5e821d(0x24d)](_0x5e821d(0x15a))),0x0;if(!_0x4fad6f)return console[_0x5e821d(0x276)](a51_0x4bfa70[_0x5e821d(0x14a)]('Error:'),_0x5e821d(0x1b5)),console[_0x5e821d(0x276)](a51_0x4bfa70['dim'](_0x5e821d(0x29a))),console[_0x5e821d(0x276)](a51_0x4bfa70[_0x5e821d(0x27c)](_0x5e821d(0x2c7))),0x1;const _0x134869=await withSpinner(_0x5e821d(0x209)+_0x4fad6f+_0x5e821d(0x268),()=>_0x214beb[_0x5e821d(0x197)][_0x5e821d(0x1c2)](_0x4fad6f),{'verbose':_0x302c29[_0x5e821d(0x235)]}),{name:_0x1df2a0}=_0x134869['data'];return saveSessionContext({'workflow_project':_0x1df2a0},_0x302c29[_0x5e821d(0x208)]),console['log'](a51_0x4bfa70['green']('✔\x20Workflow\x20project\x20set\x20to:\x20'+a51_0x4bfa70[_0x5e821d(0x129)](_0x1df2a0))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a51_0x57b8c4(0x14f)]=a51_0x57b8c4(0x2a3);[a51_0x57b8c4(0x18a)]=a51_0x57b8c4(0x1f9);async[a51_0x57b8c4(0x297)](_0x4eff82){const _0x5193dc=a51_0x57b8c4,{options:_0x59f23c,args:_0x11e3c0,tdx:_0x553348}=_0x4eff82,_0x51c4ac=_0x11e3c0[0x0];_0x59f23c[_0x5193dc(0x235)]&&_0x51c4ac&&console[_0x5193dc(0x276)](_0x5193dc(0x2c9)+_0x51c4ac);const _0x3108b9=await withSpinner(_0x5193dc(0x1c4),()=>_0x553348['workflow'][_0x5193dc(0x23a)](_0x51c4ac,{'limit':_0x59f23c['limit']}),{'verbose':_0x59f23c[_0x5193dc(0x235)]});let _0x660bdc=_0x3108b9['data'];_0x660bdc['sort']((_0x2a5d6e,_0x5a31a3)=>_0x2a5d6e[_0x5193dc(0x14f)]['localeCompare'](_0x5a31a3['name']));const _0x27824b=_0x59f23c[_0x5193dc(0x1b2)]||0x64,_0x1288b2=_0x660bdc[_0x5193dc(0x28b)]>=_0x27824b?a51_0x4bfa70[_0x5193dc(0x27c)](_0x5193dc(0x1cc)):'';console[_0x5193dc(0x276)](_0x5193dc(0x29b)+_0x660bdc[_0x5193dc(0x28b)]+_0x5193dc(0x20c)+(_0x660bdc['length']!==0x1?'s':'')+_0x1288b2);if(_0x59f23c[_0x5193dc(0x171)]===_0x5193dc(0x1ef)||_0x59f23c[_0x5193dc(0x171)]==='jsonl'||_0x59f23c[_0x5193dc(0x171)]===_0x5193dc(0x15d))await handleSDKOutput(_0x660bdc,_0x59f23c);else{if(_0x660bdc[_0x5193dc(0x28b)]===0x0)_0x51c4ac?console[_0x5193dc(0x17d)](_0x5193dc(0x195)+_0x51c4ac):console[_0x5193dc(0x17d)](_0x5193dc(0x150));else{const _0x53e3fe=_0x660bdc[_0x5193dc(0x210)](_0x42ab45=>{const _0xccd265=_0x5193dc,_0x43620a=_0x42ab45['metadata']?.['some'](_0xa93ee9=>_0xa93ee9[_0xccd265(0x2bc)]===_0xccd265(0x2b5)),_0xfdcd0c=_0x43620a?a51_0x4bfa70['dim']('\x20(system)'):'';return _0xccd265(0x2a2)+_0x42ab45[_0xccd265(0x14f)]+_0xfdcd0c;});await writeOutput(_0x53e3fe['join']('\x0a'),_0x59f23c['output'],'list');}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a51_0x57b8c4(0x143);[a51_0x57b8c4(0x18a)]=a51_0x57b8c4(0x1eb);async[a51_0x57b8c4(0x297)](_0x258117){const _0x5aba21=a51_0x57b8c4,{options:_0x18c803,args:_0x12ff76,tdx:_0x3159c4}=_0x258117,_0xdeef2=this[_0x5aba21(0x1e5)](_0x12ff76,_0x18c803);_0x18c803[_0x5aba21(0x235)]&&_0xdeef2&&console['error'](_0x5aba21(0x15e)+_0xdeef2);const _0x34289a=await withSpinner(_0x5aba21(0x22a),()=>_0x3159c4['workflow']['workflows'](_0xdeef2,{'limit':_0x18c803[_0x5aba21(0x1b2)]}),{'verbose':_0x18c803['verbose']});let _0x4076c6=_0x34289a['data'];_0x4076c6['sort']((_0x5b0ac9,_0x5aca7d)=>{const _0x5900e0=_0x5aba21,_0x4ec160=_0x5b0ac9['name'][_0x5900e0(0x223)](_0x5aca7d['name']);if(_0x4ec160!==0x0)return _0x4ec160;return(_0x5b0ac9[_0x5900e0(0x1ed)]?.[_0x5900e0(0x14f)]||'')['localeCompare'](_0x5aca7d[_0x5900e0(0x1ed)]?.[_0x5900e0(0x14f)]||'');});const _0x4e3cfe=_0x18c803[_0x5aba21(0x1b2)]||0x64,_0x177b42=_0x4076c6[_0x5aba21(0x28b)]>=_0x4e3cfe?a51_0x4bfa70[_0x5aba21(0x27c)](_0x5aba21(0x1cc)):'';console[_0x5aba21(0x276)](_0x5aba21(0x29b)+_0x4076c6[_0x5aba21(0x28b)]+_0x5aba21(0x19e)+(_0x4076c6[_0x5aba21(0x28b)]!==0x1?'s':'')+_0x177b42);if(_0x18c803[_0x5aba21(0x171)]==='json'||_0x18c803[_0x5aba21(0x171)]===_0x5aba21(0x259)||_0x18c803[_0x5aba21(0x171)]===_0x5aba21(0x15d))await handleSDKOutput(_0x4076c6,_0x18c803);else{if(_0x4076c6['length']===0x0)_0xdeef2?console[_0x5aba21(0x17d)](_0x5aba21(0x1a3)+_0xdeef2):console['log'](_0x5aba21(0x11a));else{const _0x2e19b1=_0x18c803[_0x5aba21(0x12b)],_0x5036f3=_0x4076c6[_0x5aba21(0x210)](_0x2dd9ba=>{const _0x57478c=_0x5aba21,_0x515706=a51_0x4bfa70[_0x57478c(0x27c)]('#'+_0x2dd9ba['id']),_0x22c211=hyperlink(_0x515706,getWorkflowUrl(_0x2e19b1,_0x2dd9ba['id'])),_0x115fd0=_0x2dd9ba[_0x57478c(0x1ed)]?.[_0x57478c(0x14f)]?a51_0x4bfa70[_0x57478c(0x27c)]('\x20('+_0x2dd9ba[_0x57478c(0x1ed)][_0x57478c(0x14f)]+')'):'';return _0x57478c(0x202)+_0x22c211+'\x20'+_0x2dd9ba['name']+_0x115fd0;});await writeOutput(_0x5036f3[_0x5aba21(0x1a6)]('\x0a'),_0x18c803['output'],_0x5aba21(0x273));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a51_0x57b8c4(0x14f)]=a51_0x57b8c4(0x272);[a51_0x57b8c4(0x18a)]='List\x20workflow\x20execution\x20sessions';async[a51_0x57b8c4(0x297)](_0x6f9de){const _0x1f085d=a51_0x57b8c4,{options:_0x1b3d6b,args:_0x37635a,tdx:_0x240469}=_0x6f9de,_0x257505=this['parseProjectWorkflowPattern'](_0x37635a,_0x1b3d6b);if(!_0x257505)return 0x1;const {projectName:_0x417489,workflowName:_0x2b8d98}=_0x257505;if(_0x1b3d6b['verbose']){if(_0x417489&&_0x2b8d98)console[_0x1f085d(0x276)](_0x1f085d(0x2cc)+_0x417489+'.'+_0x2b8d98);else _0x417489&&console[_0x1f085d(0x276)](_0x1f085d(0x2ca)+_0x417489);const _0x4c74aa=_0x1b3d6b[_0x1f085d(0x140)];_0x4c74aa&&console['error'](_0x1f085d(0x248)+_0x4c74aa);}let _0x4a841e=0x28;if(process['stdout'][_0x1f085d(0x14d)]&&!_0x1b3d6b['output']&&!_0x1b3d6b[_0x1f085d(0x171)]){const _0xf8ed1c=process['stdout']['rows']||0x28;_0x4a841e=Math[_0x1f085d(0x17f)](0x14,Math[_0x1f085d(0x27e)](_0xf8ed1c*0x2/0x3));}const _0x53f07a=_0x1b3d6b[_0x1f085d(0x1b2)]||_0x4a841e,_0x489263=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x240469['workflow'][_0x1f085d(0x28f)]({'projectName':_0x417489,'workflowName':_0x2b8d98,'status':_0x1b3d6b[_0x1f085d(0x140)],'fromTime':_0x1b3d6b[_0x1f085d(0x1a9)],'toTime':_0x1b3d6b['to'],'limit':_0x53f07a}),{'verbose':_0x1b3d6b[_0x1f085d(0x235)]}),_0x4a5b83=_0x489263[_0x1f085d(0x134)];_0x4a5b83[_0x1f085d(0x29e)]((_0x2a5946,_0x4a4f6b)=>{const _0x4701b7=_0x1f085d,_0x6b5343=_0x2a5946[_0x4701b7(0x14b)]||'',_0x3ff03c=_0x4a4f6b[_0x4701b7(0x14b)]||'';return _0x3ff03c[_0x4701b7(0x223)](_0x6b5343);});_0x4a5b83[_0x1f085d(0x28b)]>=_0x53f07a?console[_0x1f085d(0x276)](_0x1f085d(0x278)+_0x4a5b83['length']+_0x1f085d(0x1f7)+a51_0x4bfa70[_0x1f085d(0x27c)](_0x1f085d(0x1ce))):console['error'](_0x1f085d(0x29b)+_0x4a5b83[_0x1f085d(0x28b)]+_0x1f085d(0x231)+(_0x4a5b83[_0x1f085d(0x28b)]!==0x1?'s':''));if(_0x1b3d6b[_0x1f085d(0x171)]==='json'||_0x1b3d6b[_0x1f085d(0x171)]===_0x1f085d(0x259)||_0x1b3d6b[_0x1f085d(0x171)]===_0x1f085d(0x15d))await handleSDKOutput(_0x4a5b83,_0x1b3d6b);else{if(!process[_0x1f085d(0x2b3)][_0x1f085d(0x14d)]||_0x1b3d6b['output']){if(_0x4a5b83[_0x1f085d(0x28b)]===0x0){if(_0x417489&&_0x2b8d98)console['log'](_0x1f085d(0x141)+_0x417489+'.'+_0x2b8d98);else _0x417489?console[_0x1f085d(0x17d)](_0x1f085d(0x1a4)+_0x417489):console[_0x1f085d(0x17d)](_0x1f085d(0x1c9));}else{const _0x48fb06=_0x1b3d6b[_0x1f085d(0x12b)],_0x2df524=this[_0x1f085d(0x1f5)](_0x4a5b83,_0x48fb06);_0x1b3d6b['output']?await writeOutput(_0x2df524,_0x1b3d6b['output'],_0x1f085d(0x273)):console[_0x1f085d(0x17d)](_0x2df524);}!_0x417489&&(console[_0x1f085d(0x276)](''),console[_0x1f085d(0x276)](a51_0x4bfa70[_0x1f085d(0x27c)](_0x1f085d(0x1c1))),console['error'](a51_0x4bfa70[_0x1f085d(0x27c)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a51_0x4bfa70[_0x1f085d(0x27c)](_0x1f085d(0x298))));}else{if(_0x4a5b83[_0x1f085d(0x28b)]===0x0){if(_0x417489&&_0x2b8d98)console[_0x1f085d(0x17d)]('No\x20sessions\x20found\x20for:\x20'+_0x417489+'.'+_0x2b8d98);else _0x417489?console['log'](_0x1f085d(0x1a4)+_0x417489):console[_0x1f085d(0x17d)]('No\x20sessions\x20found');}else await this[_0x1f085d(0x28c)](_0x4a5b83,_0x6f9de,_0x417489);}}return 0x0;}[a51_0x57b8c4(0x1f5)](_0x597108,_0x6373a9){const _0x2f1fc6=a51_0x57b8c4,_0xa5d72=[],_0x1604b9=new Map();let _0x53222c=Infinity,_0x5ba0a6=-Infinity;for(const _0x46f640 of _0x597108){if(_0x46f640[_0x2f1fc6(0x160)]?.[_0x2f1fc6(0x22b)]){const _0x25c7df=new Date(_0x46f640['lastAttempt']['createdAt'])[_0x2f1fc6(0x1bd)](),_0x1cfc53=_0x46f640[_0x2f1fc6(0x160)]['finishedAt']?new Date(_0x46f640[_0x2f1fc6(0x160)][_0x2f1fc6(0x234)])[_0x2f1fc6(0x1bd)]():Date[_0x2f1fc6(0x176)](),_0x35fa96=_0x46f640[_0x2f1fc6(0x1ed)]?.[_0x2f1fc6(0x14f)]||_0x2f1fc6(0x1aa);!_0x1604b9[_0x2f1fc6(0x181)](_0x35fa96)&&_0x1604b9[_0x2f1fc6(0x280)](_0x35fa96,[]),_0x1604b9['get'](_0x35fa96)['push']({'session':_0x46f640,'startTime':_0x25c7df,'endTime':_0x1cfc53,'duration':_0x1cfc53-_0x25c7df}),_0x53222c=Math[_0x2f1fc6(0x19b)](_0x53222c,_0x25c7df),_0x5ba0a6=Math[_0x2f1fc6(0x17f)](_0x5ba0a6,_0x1cfc53);}}if(_0x1604b9[_0x2f1fc6(0x168)]===0x0)return _0x2f1fc6(0x1ba);const _0x4271e7=process['stdout'][_0x2f1fc6(0x1fd)]||0x78,_0x38f5e3=0x1e,_0x1ef529=0x32,_0x1ab504=0x4,_0x1fa9b1=Math[_0x2f1fc6(0x19b)](_0x1ef529,Math[_0x2f1fc6(0x17f)](_0x38f5e3,Math['floor'](_0x4271e7*0.3))),_0x341849=_0x4271e7-_0x1fa9b1-TIMELINE_CONFIG[_0x2f1fc6(0x161)]-0x3-_0x1ab504,_0x5be425=_0x5ba0a6-_0x53222c,_0x252532=_0x5be425/_0x1fa9b1,_0x3778f1=renderTimeAxis({'startTime':_0x53222c,'endTime':_0x5ba0a6,'durationMs':_0x5be425,'msPerChar':_0x252532},_0x1fa9b1),_0x14dc7a=[];for(const _0xa9e8d of _0x1604b9[_0x2f1fc6(0x1d0)]()){_0x14dc7a['push'](..._0xa9e8d);}_0x14dc7a[_0x2f1fc6(0x29e)]((_0x1b9451,_0x36ce9c)=>_0x36ce9c[_0x2f1fc6(0x216)]-_0x1b9451['startTime']);const _0x382cb0=new Date(_0x53222c),_0x18fd76=formatDate(_0x382cb0),_0x1d7ad7=_0x1ab504+TIMELINE_CONFIG[_0x2f1fc6(0x165)]+TIMELINE_CONFIG[_0x2f1fc6(0x2c1)]+_0x341849,_0x532d38='\x20'['repeat'](_0x1d7ad7-_0x18fd76['length']),_0x4f4eec=_0x532d38+a51_0x4bfa70['dim'](_0x18fd76)+'\x20'+_0x3778f1;_0xa5d72[_0x2f1fc6(0x145)](_0x4f4eec);const _0x410c1c=0x16;let _0x5775f2=0x0;for(const _0x4358ff of _0x14dc7a){const _0x3fb85d=_0x4358ff[_0x2f1fc6(0x208)]['project']?.[_0x2f1fc6(0x14f)]||'?',_0x4e2a97=Math[_0x2f1fc6(0x19b)](stringWidth(_0x3fb85d),_0x410c1c);_0x5775f2=Math[_0x2f1fc6(0x17f)](_0x5775f2,_0x4e2a97);}for(const _0x179088 of _0x14dc7a){const {session:_0x3eaa01,startTime:_0x47ce95,endTime:_0x1f806d,duration:_0x270ba7}=_0x179088,_0x188fb4=_0x3eaa01[_0x2f1fc6(0x1ed)]?.['id'],_0x5bce73=_0x3eaa01['id'],_0x418f75=_0x3eaa01[_0x2f1fc6(0x1ed)]?.[_0x2f1fc6(0x14f)]||'?',_0xc1f94d=_0x3eaa01['workflow']?.['name']||'?';let _0x186505,_0x3973c5;if(_0x3eaa01[_0x2f1fc6(0x160)]){const _0x4786b0=_0x3eaa01[_0x2f1fc6(0x160)];!_0x4786b0[_0x2f1fc6(0x178)]?(_0x186505=_0x4786b0[_0x2f1fc6(0x275)]?'🛑':'🔄',_0x3973c5=_0x4786b0['cancelRequested']?a51_0x4bfa70[_0x2f1fc6(0x1c6)]:a51_0x4bfa70[_0x2f1fc6(0x180)]):(_0x186505=_0x4786b0[_0x2f1fc6(0x2be)]?'✅':'❌',_0x3973c5=_0x4786b0[_0x2f1fc6(0x2be)]?a51_0x4bfa70[_0x2f1fc6(0x24d)]:a51_0x4bfa70[_0x2f1fc6(0x14a)]);}else _0x186505='⏳',_0x3973c5=a51_0x4bfa70[_0x2f1fc6(0x27c)];const _0x1f9dc9='#'+_0x5bce73,_0x76f313=_0x188fb4?hyperlink(_0x1f9dc9,getWorkflowSessionUrl(_0x6373a9,_0x188fb4,_0x5bce73)):_0x1f9dc9;let _0x25b5cb=_0x418f75;stringWidth(_0x418f75)>_0x410c1c&&(_0x25b5cb=_0x418f75[_0x2f1fc6(0x156)](0x0,_0x410c1c-0x1)+'…');const _0x55b144=a51_0x4bfa70[_0x2f1fc6(0x27c)](_0x25b5cb),_0x31466e=stringWidth(_0x25b5cb),_0x4d0190='\x20'[_0x2f1fc6(0x213)](_0x5775f2-stringWidth(_0x25b5cb)+0x2),_0x2df2b5='('+formatElapsed(_0x270ba7)+')',_0x20f0c4=stringWidth(_0x2df2b5),_0x3e6ee4=stringWidth(_0x1f9dc9),_0x5187b8=_0x3e6ee4+0x1+_0x31466e+_0x4d0190[_0x2f1fc6(0x28b)],_0x6b95fd=_0x341849-_0x5187b8-_0x20f0c4-0x1-0x8;let _0x42df8d=_0xc1f94d;stringWidth(_0x42df8d)>_0x6b95fd&&(_0x42df8d=_0x42df8d[_0x2f1fc6(0x156)](0x0,_0x6b95fd-0x1)+'…');const _0x32c58a=_0x76f313+'\x20'+_0x55b144+_0x4d0190+_0x42df8d,_0x29aa0e=stringWidth(_0x32c58a),_0x3c96f4=_0x341849-_0x29aa0e-_0x20f0c4,_0x3df3f0=_0x32c58a+'\x20'[_0x2f1fc6(0x213)](Math[_0x2f1fc6(0x17f)](0x1,_0x3c96f4))+a51_0x4bfa70[_0x2f1fc6(0x27c)](_0x2df2b5),_0x4b3ee5=Math[_0x2f1fc6(0x27e)]((_0x47ce95-_0x53222c)/_0x252532),_0x3a7b5=Math[_0x2f1fc6(0x27e)]((_0x1f806d-_0x53222c)/_0x252532),_0x20abf8=Math[_0x2f1fc6(0x17f)](_0x4b3ee5+0x1,_0x3a7b5),_0x1700b6=new Array(_0x1fa9b1)[_0x2f1fc6(0x1b7)]('\x20');for(let _0x45e191=_0x4b3ee5;_0x45e191<Math[_0x2f1fc6(0x19b)](_0x20abf8,_0x1fa9b1);_0x45e191++){_0x1700b6[_0x45e191]='─';}const _0xe30d21=_0x1700b6[_0x2f1fc6(0x210)](_0x21af41=>_0x21af41==='\x20'?'\x20':_0x3973c5(_0x21af41))[_0x2f1fc6(0x1a6)]('');_0xa5d72['push'](_0x186505+'\x20'+_0x3df3f0+'│'+_0xe30d21+'│');}return _0xa5d72[_0x2f1fc6(0x1a6)]('\x0a');}async[a51_0x57b8c4(0x28c)](_0x234412,_0x31ee54,_0x545ae7){const _0x384ebd=a51_0x57b8c4,{options:_0x127124,tdx:_0x4d210b}=_0x31ee54,_0x13cdd0=_0x127124[_0x384ebd(0x12b)],{timelineRows:_0x53e8f6,timeAxisHeader:_0x1d0573}=this[_0x384ebd(0x121)](_0x234412,_0x13cdd0),_0x2fa3b5=_0x53e8f6[_0x384ebd(0x18b)](_0x4be64f=>_0x4be64f[_0x384ebd(0x193)]);if(_0x2fa3b5[_0x384ebd(0x28b)]===0x0){const _0x4ded58=this[_0x384ebd(0x1f5)](_0x234412,_0x13cdd0);console[_0x384ebd(0x17d)](_0x4ded58);!_0x545ae7&&(console[_0x384ebd(0x276)](''),console[_0x384ebd(0x276)](a51_0x4bfa70['dim'](_0x384ebd(0x1c1))),console['error'](a51_0x4bfa70['dim'](_0x384ebd(0x1a8))+'or'+a51_0x4bfa70[_0x384ebd(0x27c)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0x1d0573&&console[_0x384ebd(0x17d)](_0x1d0573);const _0x3aa740=_0x53e8f6['filter'](_0xe33bcb=>_0xe33bcb[_0x384ebd(0x193)])[_0x384ebd(0x210)](_0x39a57a=>({'title':_0x39a57a['displayLine'],'value':_0x39a57a[_0x384ebd(0x193)]})),_0x404079=process[_0x384ebd(0x2b3)][_0x384ebd(0x26d)]||0x3c,_0x46bcc9=Math[_0x384ebd(0x17f)](0x28,Math[_0x384ebd(0x27e)](_0x404079*0x2/0x3)),_0x165b87=await a51_0x49f54b({'type':'autocomplete','name':_0x384ebd(0x193),'message':_0x384ebd(0x133),'choices':_0x3aa740,'initial':-0x1,'limit':_0x46bcc9,'clearFirst':!![],'fallback':{'title':_0x384ebd(0x296),'value':null},'suggest':(_0x3c5b5a,_0x1ba030)=>{const _0xd69706=_0x384ebd;if(!_0x3c5b5a)return Promise[_0xd69706(0x142)](_0x1ba030);const _0x538c75=_0x1ba030[_0xd69706(0x18b)](_0x738b79=>{const _0x45658b=_0xd69706,_0x374eef=_0x738b79;return _0x374eef['title'][_0x45658b(0x13e)]()['includes'](_0x3c5b5a[_0x45658b(0x13e)]());});return Promise[_0xd69706(0x142)](_0x538c75);}}),_0x2052bc=()=>{const _0x4b309f=_0x384ebd;process[_0x4b309f(0x2b3)][_0x4b309f(0x239)](_0x4b309f(0x1e8)),process['stdout']['write'](_0x4b309f(0x1e8)),process[_0x4b309f(0x2b3)][_0x4b309f(0x239)](_0x4b309f(0x1e8));},_0xd100e9=_0x165b87&&_0x165b87[_0x384ebd(0x193)]&&_0x165b87['attemptId']!==null&&_0x165b87[_0x384ebd(0x193)][_0x384ebd(0x294)]()!=='';if(!_0xd100e9){_0x2052bc(),console[_0x384ebd(0x17d)](a51_0x4bfa70['dim']('Cancelled'));return;}_0x2052bc();const _0x2a0d37=_0x234412[_0x384ebd(0x1cb)](_0x21f9af=>_0x21f9af['lastAttempt']?.['id']===_0x165b87['attemptId']);if(_0x2a0d37){const _0x2934fd=_0x2a0d37[_0x384ebd(0x1ed)]?.[_0x384ebd(0x14f)]||'?',_0x1a117f=_0x2a0d37[_0x384ebd(0x197)]?.[_0x384ebd(0x14f)]||'?';console['log']('Project:\x20'+a51_0x4bfa70[_0x384ebd(0x27c)](_0x2934fd)+_0x384ebd(0x2a6)+a51_0x4bfa70[_0x384ebd(0x27c)](_0x1a117f));}const _0x5d3107=new WorkflowTimelineCommand();await _0x5d3107[_0x384ebd(0x297)]({'args':[],'options':{..._0x127124,'attemptId':_0x165b87[_0x384ebd(0x193)]},'tdx':_0x4d210b});}[a51_0x57b8c4(0x121)](_0x4d3046,_0x14d7a1){const _0xa8954a=a51_0x57b8c4,_0x264c29=new Map();for(const _0x25f777 of _0x4d3046){_0x25f777['id']&&_0x25f777[_0xa8954a(0x160)]?.['id']&&_0x264c29[_0xa8954a(0x280)](_0x25f777['id'],_0x25f777[_0xa8954a(0x160)]['id']);}const _0xd04cab=[];let _0x1c6740='';const _0x3acd8d=this['renderSessionsTimeline'](_0x4d3046,_0x14d7a1),_0x154545=_0x3acd8d[_0xa8954a(0x1d3)]('\x0a');for(const _0x471f3a of _0x154545){if(_0x471f3a[_0xa8954a(0x22f)](_0xa8954a(0x12d))||_0x471f3a['match'](/^\s+\d{4}-\d{2}-\d{2}/))_0x1c6740=_0x471f3a;else{if(_0x471f3a[_0xa8954a(0x258)](/^[✅❌🔄🛑⏳]/)){const _0x53925d=_0x471f3a[_0xa8954a(0x258)](/#(\d+)/),_0x5ec435=_0x53925d?_0x53925d[0x1]:null,_0xae1d38=_0x5ec435?_0x264c29['get'](_0x5ec435)||null:null,_0x565b13=_0x4d3046[_0xa8954a(0x1cb)](_0x1d28bd=>_0x1d28bd['id']===_0x5ec435),_0x521194=_0x565b13?.['project']?.[_0xa8954a(0x14f)]||'';_0xd04cab[_0xa8954a(0x145)]({'displayLine':_0x471f3a,'attemptId':_0xae1d38,'projectName':_0x521194});}}}return{'timelineRows':_0xd04cab,'timeAxisHeader':_0x1c6740};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']=a51_0x57b8c4(0x1da);[a51_0x57b8c4(0x18a)]=a51_0x57b8c4(0x11b);async['execute'](_0x17e223){const _0x3c1c37=a51_0x57b8c4,{options:_0x7fe656,args:_0x5d1fc4,tdx:_0x1e35d5}=_0x17e223,_0x21d852=this[_0x3c1c37(0x1ae)](_0x5d1fc4,_0x7fe656);if(!_0x21d852)return 0x1;const {projectName:_0x4fa66e,workflowName:_0xedb87f}=_0x21d852,_0x26b0e8=_0x7fe656[_0x3c1c37(0x182)];if(_0x7fe656['verbose']){if(_0x4fa66e&&_0xedb87f)console[_0x3c1c37(0x276)](_0x3c1c37(0x2cc)+_0x4fa66e+'.'+_0xedb87f);else _0x4fa66e&&console[_0x3c1c37(0x276)](_0x3c1c37(0x2ca)+_0x4fa66e);_0x26b0e8&&console['error'](_0x3c1c37(0x1a1));}const _0x16a06a=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x1e35d5[_0x3c1c37(0x197)]['attempts']({'projectName':_0x4fa66e,'workflowName':_0xedb87f,'includeRetried':_0x26b0e8,'limit':_0x7fe656[_0x3c1c37(0x1b2)]}),{'verbose':_0x7fe656[_0x3c1c37(0x235)]}),_0x321bd4=_0x16a06a['data'],_0x9cd54c=_0x7fe656['limit']||0x64,_0x4dc570=_0x321bd4[_0x3c1c37(0x28b)]>=_0x9cd54c?a51_0x4bfa70[_0x3c1c37(0x27c)](_0x3c1c37(0x1cc)):'';console[_0x3c1c37(0x276)]('✔\x20Found\x20'+_0x321bd4[_0x3c1c37(0x28b)]+_0x3c1c37(0x18c)+(_0x321bd4[_0x3c1c37(0x28b)]!==0x1?'s':'')+_0x4dc570);if(_0x7fe656[_0x3c1c37(0x171)]===_0x3c1c37(0x1ef)||_0x7fe656['format']===_0x3c1c37(0x259)||_0x7fe656[_0x3c1c37(0x171)]===_0x3c1c37(0x15d))await handleSDKOutput(_0x321bd4,_0x7fe656);else{if(_0x321bd4[_0x3c1c37(0x28b)]===0x0){if(_0x4fa66e&&_0xedb87f)console[_0x3c1c37(0x17d)]('No\x20attempts\x20found\x20for:\x20'+_0x4fa66e+'.'+_0xedb87f);else _0x4fa66e?console[_0x3c1c37(0x17d)](_0x3c1c37(0x251)+_0x4fa66e):console[_0x3c1c37(0x17d)](_0x3c1c37(0x228));}else{const _0x40f8b6=_0x7fe656[_0x3c1c37(0x12b)],_0x2d50a8=_0x321bd4[_0x3c1c37(0x210)](_0x559ccc=>{const _0x310564=_0x3c1c37,_0x1c1478=a51_0x4bfa70[_0x310564(0x27c)]('#'+_0x559ccc['id']),_0x1ba1fc=_0x559ccc[_0x310564(0x1ed)]?.['id'],_0x8bf95c=_0x559ccc[_0x310564(0x1d9)]||_0x559ccc[_0x310564(0x18e)],_0x4293f8=_0x1ba1fc&&_0x8bf95c?hyperlink(_0x1c1478,getWorkflowAttemptUrl(_0x40f8b6,_0x1ba1fc,_0x8bf95c,_0x559ccc['id'])):_0x1c1478,{icon:_0x2f6f56,text:_0x26788e}=getAttemptStatusDisplay(_0x559ccc),_0x314571=(_0x559ccc[_0x310564(0x1ed)]?.[_0x310564(0x14f)]||'?')+'.'+(_0x559ccc[_0x310564(0x197)]?.[_0x310564(0x14f)]||'?'),_0x52b6c4=_0x559ccc[_0x310564(0x14b)]?a51_0x4bfa70['dim'](_0x559ccc[_0x310564(0x14b)]):'';return(_0x4293f8+'\x20'+_0x2f6f56+(_0x26788e?'\x20'+_0x26788e:'')+'\x20'+_0x314571+'\x20'+_0x52b6c4)['trimEnd']();});await writeOutput(_0x2d50a8[_0x3c1c37(0x1a6)]('\x0a'),_0x7fe656[_0x3c1c37(0x253)],_0x3c1c37(0x273));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a51_0x57b8c4(0x14f)]='workflow:attempt';['description']='Show\x20specific\x20attempt\x20details';async['execute'](_0x2532e5){const _0x2d365a=a51_0x57b8c4,{options:_0x26a958,args:_0x435fdc,tdx:_0x20ec1c}=_0x2532e5,_0x3ec4fe=_0x435fdc[0x0];if(!_0x3ec4fe)return console[_0x2d365a(0x276)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x26a958['verbose']&&console['error']('Attempt\x20ID:\x20'+_0x3ec4fe);const _0x4c6814=await withSpinner(_0x2d365a(0x2b0),()=>_0x20ec1c[_0x2d365a(0x197)][_0x2d365a(0x1f3)](_0x3ec4fe),{'verbose':_0x26a958[_0x2d365a(0x235)]}),_0x364cc6=_0x4c6814['data'];let _0x32abc9;!_0x364cc6['done']?_0x32abc9=_0x364cc6[_0x2d365a(0x275)]?_0x2d365a(0x136):_0x2d365a(0x237):_0x32abc9=_0x364cc6[_0x2d365a(0x2be)]?'success':_0x2d365a(0x276);let _0x1e6971;if(_0x364cc6[_0x2d365a(0x22b)]&&_0x364cc6[_0x2d365a(0x234)]){const _0x7d0063=new Date(_0x364cc6[_0x2d365a(0x22b)])[_0x2d365a(0x1bd)](),_0x285706=new Date(_0x364cc6[_0x2d365a(0x234)])[_0x2d365a(0x1bd)]();_0x1e6971=Math['round']((_0x285706-_0x7d0063)/0x3e8);}const _0x387887={'attempt_id':_0x364cc6['id'],'status':_0x32abc9,..._0x364cc6[_0x2d365a(0x1e3)]!==undefined&&{'index':_0x364cc6[_0x2d365a(0x1e3)]},..._0x364cc6[_0x2d365a(0x1ed)]&&{'project':_0x364cc6[_0x2d365a(0x1ed)][_0x2d365a(0x14f)]},..._0x364cc6[_0x2d365a(0x197)]&&{'workflow':_0x364cc6[_0x2d365a(0x197)][_0x2d365a(0x14f)]},..._0x364cc6[_0x2d365a(0x18e)]&&{'session_id':_0x364cc6[_0x2d365a(0x18e)]},..._0x364cc6['sessionTime']&&{'session_time':_0x364cc6[_0x2d365a(0x14b)]},..._0x364cc6[_0x2d365a(0x267)]&&{'retry_attempt':_0x364cc6[_0x2d365a(0x267)]},..._0x1e6971!==undefined&&{'duration_sec':_0x1e6971},..._0x364cc6['createdAt']&&{'created_at':_0x364cc6[_0x2d365a(0x22b)]},..._0x364cc6[_0x2d365a(0x234)]&&{'finished_at':_0x364cc6[_0x2d365a(0x234)]},...Object[_0x2d365a(0x177)](_0x364cc6[_0x2d365a(0x172)])[_0x2d365a(0x28b)]>0x0&&{'params':_0x364cc6['params']}};return await handleSingleObjectOutput(_0x387887,_0x26a958),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a51_0x57b8c4(0x14f)]=a51_0x57b8c4(0x1c0);['description']='Show\x20tasks\x20for\x20an\x20attempt';async[a51_0x57b8c4(0x297)](_0x3e018d){const _0x407f14=a51_0x57b8c4,{options:_0x2efb7e,args:_0xfc539e,tdx:_0x40bd26}=_0x3e018d,_0x193775=_0xfc539e[0x0];if(!_0x193775)return console[_0x407f14(0x276)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x9f3baa=_0x2efb7e['includeSubtasks'];_0x2efb7e[_0x407f14(0x235)]&&(console[_0x407f14(0x276)](_0x407f14(0x175)+_0x193775),_0x9f3baa&&console[_0x407f14(0x276)]('Including\x20subtasks:\x20yes'));const _0x540094=await withSpinner(_0x407f14(0x2c2),()=>_0x40bd26['workflow'][_0x407f14(0x13c)](_0x193775,_0x9f3baa||![]),{'verbose':_0x2efb7e[_0x407f14(0x235)]}),_0x5935d5=_0x540094[_0x407f14(0x134)];return console[_0x407f14(0x276)]('✔\x20Found\x20'+_0x5935d5[_0x407f14(0x28b)]+_0x407f14(0x207)+(_0x5935d5[_0x407f14(0x28b)]!==0x1?'s':'')),await handleSDKOutput(_0x5935d5,_0x2efb7e),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a51_0x57b8c4(0x14f)]=a51_0x57b8c4(0x1ec);['description']=a51_0x57b8c4(0x24f);async[a51_0x57b8c4(0x297)](_0x5893ca){const _0x46a16d=a51_0x57b8c4,{options:_0x54dd96,args:_0x179c6f,tdx:_0x4ae85b}=_0x5893ca,_0x16c3be=_0x179c6f[0x0];let _0x3c7982=_0x179c6f[0x1];if(!_0x16c3be)return console[_0x46a16d(0x276)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x54dd96['verbose']&&(console[_0x46a16d(0x276)](_0x46a16d(0x175)+_0x16c3be),_0x3c7982&&console['error'](_0x46a16d(0x246)+_0x3c7982));const _0x2ffebb=await withSpinner(_0x46a16d(0x138),()=>_0x4ae85b[_0x46a16d(0x197)][_0x46a16d(0x250)](_0x16c3be,_0x3c7982),{'verbose':_0x54dd96[_0x46a16d(0x235)]}),_0x379dbd=_0x2ffebb['data'];if(_0x379dbd[_0x46a16d(0x28b)]===0x0)return console[_0x46a16d(0x276)](_0x46a16d(0x151)),0x0;if(!_0x3c7982&&(_0x54dd96[_0x46a16d(0x1ef)]||_0x54dd96['format']))return await handleSDKOutput(_0x379dbd,_0x54dd96),0x0;if(!_0x3c7982){const _0x434e65=_0x379dbd[_0x46a16d(0x210)](_0x2ec6eb=>({'title':_0x2ec6eb[_0x46a16d(0x261)]+'\x20('+formatBytes(_0x2ec6eb['fileSize'])+')','value':_0x2ec6eb['taskName']})),_0x1545a4=await a51_0x49f54b({'type':_0x46a16d(0x2ce),'name':_0x46a16d(0x243),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x434e65});if(!_0x1545a4[_0x46a16d(0x243)])return console[_0x46a16d(0x276)]('Cancelled'),0x0;_0x3c7982=_0x1545a4[_0x46a16d(0x243)];}const _0x35e405=await withSpinner(_0x46a16d(0x1dc),()=>_0x4ae85b[_0x46a16d(0x197)][_0x46a16d(0x16f)](_0x16c3be,_0x3c7982),{'verbose':_0x54dd96[_0x46a16d(0x235)]}),_0x502c77=_0x35e405[_0x46a16d(0x134)];return _0x502c77?console[_0x46a16d(0x17d)](_0x502c77):console[_0x46a16d(0x276)](_0x46a16d(0x1ee)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a51_0x57b8c4(0x14f)]='workflow:kill';[a51_0x57b8c4(0x18a)]=a51_0x57b8c4(0x215);async[a51_0x57b8c4(0x297)](_0x57aa16){const _0x571c41=a51_0x57b8c4,{options:_0x2a8c91,args:_0x2012c6,tdx:_0x2214dc}=_0x57aa16,_0x4c5e83=_0x2012c6[0x0];if(!_0x4c5e83)return console[_0x571c41(0x276)](_0x571c41(0x244)),0x1;const _0x3e80ae=_0x2a8c91[_0x571c41(0x217)];_0x2a8c91[_0x571c41(0x235)]&&(console[_0x571c41(0x276)](_0x571c41(0x175)+_0x4c5e83),_0x3e80ae&&console[_0x571c41(0x276)](_0x571c41(0x18f)+_0x3e80ae));if(!_0x2a8c91[_0x571c41(0x218)]){if(!isInteractive())return console[_0x571c41(0x276)](a51_0x4bfa70[_0x571c41(0x14a)](_0x571c41(0x205)),_0x571c41(0x1e4)),console[_0x571c41(0x276)](a51_0x4bfa70[_0x571c41(0x27c)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x35f7cc=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x4c5e83+'?');if(!_0x35f7cc)return console[_0x571c41(0x276)](a51_0x4bfa70['yellow'](_0x571c41(0x257))),0x1;}const _0x10e8ab=await withSpinner(_0x571c41(0x247),()=>_0x2214dc[_0x571c41(0x197)][_0x571c41(0x128)](_0x4c5e83,_0x3e80ae),{'verbose':_0x2a8c91[_0x571c41(0x235)]}),_0x5eecc5=_0x10e8ab[_0x571c41(0x134)];return console[_0x571c41(0x276)]('✔\x20'+_0x5eecc5),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a51_0x57b8c4(0x14f)]='workflow:retry';[a51_0x57b8c4(0x18a)]=a51_0x57b8c4(0x292);async[a51_0x57b8c4(0x297)](_0x2f34a6){const _0x1801d0=a51_0x57b8c4,{options:_0x1467e4,args:_0x15e127,tdx:_0x49f436}=_0x2f34a6,_0x5875fd=_0x15e127[0x0];if(!_0x5875fd)return console['error'](_0x1801d0(0x2b8)),console[_0x1801d0(0x276)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x16fbad=![],_0x1607be=_0x5875fd;if(_0x5875fd[_0x1801d0(0x22f)](_0x1801d0(0x24c)))_0x16fbad=!![],_0x1607be=_0x5875fd[_0x1801d0(0x28d)](0x8);else{if(_0x5875fd['startsWith'](_0x1801d0(0x241)))_0x16fbad=![],_0x1607be=_0x5875fd['substring'](0x8);else return console['error'](_0x1801d0(0x262)),console['error'](_0x1801d0(0x23e)),0x1;}const _0x865b14=_0x1467e4['fromTask'],_0x4c53ae=_0x1467e4[_0x1801d0(0x20e)],_0x5e3446=_0x1467e4[_0x1801d0(0x172)],_0x415dbe=_0x1467e4[_0x1801d0(0x20a)];_0x1467e4[_0x1801d0(0x235)]&&(console[_0x1801d0(0x276)](_0x1801d0(0x1af)+(_0x16fbad?_0x1801d0(0x208):_0x1801d0(0x1f3))+'\x20'+_0x1607be),_0x865b14&&console[_0x1801d0(0x276)](_0x1801d0(0x166)+_0x865b14),_0x4c53ae&&console['error'](_0x1801d0(0x238)+_0x4c53ae),_0x5e3446&&console[_0x1801d0(0x276)]('Params:\x20'+_0x5e3446),_0x415dbe&&console[_0x1801d0(0x276)](_0x1801d0(0x2c0)));let _0x4feb0a;if(_0x5e3446)try{if(_0x5e3446[_0x1801d0(0x22f)]('@')){const _0x5cbd66=await import(_0x1801d0(0x279)),_0x34dc68=_0x5e3446['substring'](0x1),_0x2357af=await _0x5cbd66[_0x1801d0(0x2bd)](_0x34dc68,_0x1801d0(0x1b0));_0x4feb0a=JSON[_0x1801d0(0x263)](_0x2357af);}else _0x4feb0a=JSON[_0x1801d0(0x263)](_0x5e3446);}catch{return console[_0x1801d0(0x276)](_0x1801d0(0x2aa)),0x1;}if(!_0x1467e4[_0x1801d0(0x218)]){if(!isInteractive())return console[_0x1801d0(0x276)](a51_0x4bfa70[_0x1801d0(0x14a)](_0x1801d0(0x205)),_0x1801d0(0x1e4)),console[_0x1801d0(0x276)](a51_0x4bfa70['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x57714b=await confirmKey(_0x1801d0(0x16e)+(_0x16fbad?_0x1801d0(0x208):_0x1801d0(0x1f3))+'\x20'+_0x1607be+'?');if(!_0x57714b)return console[_0x1801d0(0x276)](a51_0x4bfa70[_0x1801d0(0x1c6)]('Cancelled')),0x1;}let _0x4125ca;_0x16fbad?_0x4125ca=await withSpinner(_0x1801d0(0x126),()=>_0x49f436[_0x1801d0(0x197)]['retrySession'](_0x1607be,{'fromTask':_0x865b14,'retryParams':_0x4feb0a}),{'verbose':_0x1467e4['verbose']}):_0x4125ca=await withSpinner(_0x1801d0(0x14e),()=>_0x49f436[_0x1801d0(0x197)][_0x1801d0(0x16a)](_0x1607be,{'resumeFrom':_0x4c53ae,'retryParams':_0x4feb0a,'force':_0x415dbe}),{'verbose':_0x1467e4['verbose']});const _0x59fc81=_0x4125ca[_0x1801d0(0x134)];return console[_0x1801d0(0x276)]('✔\x20Retry\x20started'),console['error']('\x20\x20New\x20attempt\x20ID:\x20'+_0x59fc81[_0x1801d0(0x193)]),console[_0x1801d0(0x276)](_0x1801d0(0x1e0)+_0x59fc81[_0x1801d0(0x18e)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a51_0x57b8c4(0x14f)]=a51_0x57b8c4(0x148);[a51_0x57b8c4(0x18a)]=a51_0x57b8c4(0x265);async[a51_0x57b8c4(0x297)](_0x3398d0){const _0x156741=a51_0x57b8c4,{options:_0x5f17d8,args:_0x45dc26,tdx:_0x58388f}=_0x3398d0;let _0x5813c3=_0x45dc26[0x0];if(!_0x5813c3){const _0x4fd8ba=this['resolveProject']([],_0x5f17d8),_0x657965=await withSpinner('Loading\x20workflows...',()=>_0x58388f[_0x156741(0x197)]['workflows'](_0x4fd8ba,{'limit':_0x5f17d8[_0x156741(0x1b2)]}),{'verbose':_0x5f17d8[_0x156741(0x235)]}),_0x1144f5=_0x657965[_0x156741(0x134)];if(_0x1144f5['length']===0x0)return console[_0x156741(0x276)](_0x156741(0x11a)),!_0x4fd8ba&&console[_0x156741(0x276)](a51_0x4bfa70['dim'](_0x156741(0x2a1))),0x1;const _0x4a084b=_0x1144f5[_0x156741(0x210)](_0x1c21f1=>({'title':_0x1c21f1[_0x156741(0x1ed)]?.[_0x156741(0x14f)]+'.'+_0x1c21f1[_0x156741(0x14f)],'value':_0x1c21f1[_0x156741(0x1ed)]?.[_0x156741(0x14f)]+'.'+_0x1c21f1[_0x156741(0x14f)],'description':_0x1c21f1[_0x156741(0x1a0)]?_0x156741(0x1c8)+_0x1c21f1['revision']:undefined})),_0x212f48=await a51_0x49f54b({'type':'select','name':_0x156741(0x197),'message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x4a084b});if(!_0x212f48[_0x156741(0x197)])return 0x1;_0x5813c3=_0x212f48[_0x156741(0x197)];}if(!_0x5813c3[_0x156741(0x174)]('.')){const _0x382eb2=this[_0x156741(0x1e5)]([],_0x5f17d8);if(_0x382eb2)_0x5813c3=_0x382eb2+'.'+_0x5813c3;else return console['error'](a51_0x4bfa70[_0x156741(0x14a)]('Error:'),_0x156741(0x157)),console[_0x156741(0x276)](a51_0x4bfa70['dim'](_0x156741(0x2a1))),0x1;}const _0x334595=_0x5f17d8[_0x156741(0x127)],_0x59e514=_0x5f17d8[_0x156741(0x14b)],_0x9eef18={};if(_0x334595&&Array[_0x156741(0x139)](_0x334595))for(const _0xc63ba7 of _0x334595){const _0x18e317=_0xc63ba7[_0x156741(0x2b9)]('=');if(_0x18e317===-0x1)return console[_0x156741(0x276)](_0x156741(0x1b3)+_0xc63ba7),console[_0x156741(0x276)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x5481d0=_0xc63ba7[_0x156741(0x28d)](0x0,_0x18e317),_0x1c765a=_0xc63ba7['substring'](_0x18e317+0x1);try{_0x9eef18[_0x5481d0]=JSON[_0x156741(0x263)](_0x1c765a);}catch{_0x9eef18[_0x5481d0]=_0x1c765a;}}_0x5f17d8[_0x156741(0x235)]&&(console[_0x156741(0x276)](_0x156741(0x147)+_0x5813c3),Object[_0x156741(0x177)](_0x9eef18)[_0x156741(0x28b)]>0x0&&console[_0x156741(0x276)](_0x156741(0x1fe)+JSON[_0x156741(0x21f)](_0x9eef18)),_0x59e514&&console[_0x156741(0x276)]('Session\x20time:\x20'+_0x59e514));const _0x320151=await withSpinner('Starting\x20workflow\x20run...',()=>_0x58388f[_0x156741(0x197)]['run'](_0x5813c3,_0x9eef18,{'sessionTime':_0x59e514}),{'verbose':_0x5f17d8[_0x156741(0x235)]}),_0x408292=_0x320151['data'];console['error'](_0x156741(0x2ba)),console[_0x156741(0x276)](_0x156741(0x2ab)+_0x408292['id']),console[_0x156741(0x276)](_0x156741(0x1e0)+_0x408292[_0x156741(0x18e)]),console[_0x156741(0x276)](_0x156741(0x1bf)+_0x408292[_0x156741(0x1ed)]?.['name']),console[_0x156741(0x276)](_0x156741(0x164)+_0x408292['workflow']?.[_0x156741(0x14f)]);if(_0x408292[_0x156741(0x1ed)]?.['id']&&_0x408292[_0x156741(0x18e)]&&_0x408292['id']){const _0x1d34b9=_0x5f17d8[_0x156741(0x12b)],_0x31916c=getConsoleUrl(_0x1d34b9,_0x156741(0x146)+_0x408292[_0x156741(0x1ed)]['id']+'/sessions/'+_0x408292[_0x156741(0x18e)]+_0x156741(0x1a2)+_0x408292['id']);console['error'](_0x156741(0x1df)+a51_0x4bfa70[_0x156741(0x129)](_0x31916c));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a51_0x57b8c4(0x14f)]=a51_0x57b8c4(0x11f);[a51_0x57b8c4(0x18a)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a51_0x57b8c4(0x297)](_0x1939b9){const _0x147034=a51_0x57b8c4,{options:_0x2e4c45,args:_0x4ebed2,tdx:_0x3e5f72}=_0x1939b9,_0x21458e=_0x4ebed2[0x0],_0x1f2254=_0x4ebed2[0x1]||'.';if(!_0x21458e)return console[_0x147034(0x276)](_0x147034(0x27d)),console[_0x147034(0x276)](_0x147034(0x1a5)),0x1;const _0x21c503=_0x2e4c45[_0x147034(0x1a0)];_0x2e4c45['verbose']&&(console[_0x147034(0x276)](_0x147034(0x17e)+_0x21458e),console[_0x147034(0x276)](_0x147034(0x277)+_0x1f2254),_0x21c503&&console['error'](_0x147034(0x2a8)+_0x21c503));const _0x30f09d=await withSpinner(_0x147034(0x236)+_0x21458e+'...',()=>_0x3e5f72[_0x147034(0x197)][_0x147034(0x232)](_0x21458e,_0x1f2254,{'revision':_0x21c503}),{'verbose':_0x2e4c45['verbose']}),_0x15e6bb=_0x30f09d['data'];return console[_0x147034(0x276)]('✔\x20Downloaded\x20'+_0x15e6bb['projectName']),console[_0x147034(0x276)](_0x147034(0x17b)+_0x15e6bb[_0x147034(0x1a0)]),console[_0x147034(0x276)](_0x147034(0x12c)+_0x15e6bb['filesExtracted']),console[_0x147034(0x276)](_0x147034(0x221)+_0x1f2254+'/'+_0x15e6bb[_0x147034(0x12e)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a51_0x57b8c4(0x14f)]=a51_0x57b8c4(0x124);['description']=a51_0x57b8c4(0x137);async[a51_0x57b8c4(0x297)](_0x506ec7){const _0x4ae611=a51_0x57b8c4,{options:_0x3db7ed,args:_0x398f29,tdx:_0x327905}=_0x506ec7;let _0x2fb7bc='.',_0x3186c3=_0x3db7ed[_0x4ae611(0x14f)];if(_0x398f29[0x0]){const {promises:_0x511622}=await import('fs');try{const _0x24e0d2=await _0x511622[_0x4ae611(0x291)](_0x398f29[0x0]);if(_0x24e0d2[_0x4ae611(0x189)]())_0x2fb7bc=_0x398f29[0x0];else return console[_0x4ae611(0x276)](_0x4ae611(0x2b7)+_0x398f29[0x0]+_0x4ae611(0x17c)),0x1;}catch{_0x3186c3=_0x398f29[0x0],_0x2fb7bc='.';}}const _0x541fb6=_0x3db7ed[_0x4ae611(0x1a0)],_0x3eaae0=_0x3db7ed[_0x4ae611(0x191)];_0x3db7ed[_0x4ae611(0x235)]&&(console[_0x4ae611(0x276)](_0x4ae611(0x131)+_0x2fb7bc),_0x3186c3&&console[_0x4ae611(0x276)](_0x4ae611(0x290)+_0x3186c3),_0x541fb6&&console['error']('Revision:\x20'+_0x541fb6),_0x3eaae0&&console[_0x4ae611(0x276)](_0x4ae611(0x269)));const _0xf0213b=await withSpinner(_0x4ae611(0x23c),()=>_0x327905[_0x4ae611(0x197)][_0x4ae611(0x145)](_0x2fb7bc,{'projectName':_0x3186c3,'revision':_0x541fb6,'skipValidation':_0x3eaae0}),{'verbose':_0x3db7ed[_0x4ae611(0x235)]}),_0xd24f2c=_0xf0213b['data'];return console['error'](_0x4ae611(0x1fa)+_0xd24f2c[_0x4ae611(0x12e)]),console['error'](_0x4ae611(0x1f2)+_0xd24f2c[_0x4ae611(0x219)]),console[_0x4ae611(0x276)](_0x4ae611(0x17b)+_0xd24f2c[_0x4ae611(0x1a0)]),await this[_0x4ae611(0x255)](_0x327905,_0xd24f2c[_0x4ae611(0x12e)],_0x3db7ed[_0x4ae611(0x12b)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a51_0x57b8c4(0x14f)]='workflow:pull';[a51_0x57b8c4(0x18a)]=a51_0x57b8c4(0x293);async[a51_0x57b8c4(0x297)](_0x5d8fb3){const _0x1a6d91=a51_0x57b8c4,{options:_0x3961a4,args:_0x23652b,tdx:_0x5539f8}=_0x5d8fb3,_0x1a55f1=_0x23652b[0x0],_0x49d307=_0x23652b[0x1];if(!_0x1a55f1)return console[_0x1a6d91(0x276)](a51_0x4bfa70['red'](_0x1a6d91(0x2ac)),_0x1a6d91(0x1b5)),console[_0x1a6d91(0x276)](a51_0x4bfa70[_0x1a6d91(0x27c)](_0x1a6d91(0x281))),0x1;const _0x11acc8=_0x3961a4[_0x1a6d91(0x1a0)];_0x3961a4[_0x1a6d91(0x235)]&&(console[_0x1a6d91(0x276)](_0x1a6d91(0x17e)+_0x1a55f1),_0x49d307&&console[_0x1a6d91(0x276)](_0x1a6d91(0x24a)+_0x49d307),_0x11acc8&&console[_0x1a6d91(0x276)](_0x1a6d91(0x2a8)+_0x11acc8),_0x3961a4['dryRun']&&console[_0x1a6d91(0x276)](_0x1a6d91(0x155)));const _0x433257=await withSpinner('Pulling\x20project\x20'+_0x1a55f1+'...',()=>_0x5539f8[_0x1a6d91(0x197)][_0x1a6d91(0x245)](_0x1a55f1,{'targetDir':_0x49d307,'revision':_0x11acc8}),{'verbose':_0x3961a4[_0x1a6d91(0x235)]}),_0x5acca4=_0x433257['data'];_0x5acca4[_0x1a6d91(0x27a)]?console[_0x1a6d91(0x276)](_0x1a6d91(0x16b)+_0x5acca4['projectName']):console[_0x1a6d91(0x276)](_0x1a6d91(0x286)+_0x5acca4[_0x1a6d91(0x12e)]);console[_0x1a6d91(0x276)](_0x1a6d91(0x17b)+_0x5acca4[_0x1a6d91(0x1a0)]),console['error'](_0x1a6d91(0x2b6)+(a51_0x1bf6f6[_0x1a6d91(0x1e6)](process['cwd'](),_0x5acca4['targetDir'])||'.')),console[_0x1a6d91(0x276)](_0x1a6d91(0x15c)+a51_0x4bfa70[_0x1a6d91(0x24d)]('+'+_0x5acca4['summary'][_0x1a6d91(0x1f0)]+_0x1a6d91(0x25c))+',\x20'+(a51_0x4bfa70[_0x1a6d91(0x1c6)]('~'+_0x5acca4[_0x1a6d91(0x287)][_0x1a6d91(0x1ac)]+_0x1a6d91(0x123))+',\x20')+(a51_0x4bfa70[_0x1a6d91(0x14a)]('-'+_0x5acca4[_0x1a6d91(0x287)][_0x1a6d91(0x152)]+_0x1a6d91(0x206))+',\x20')+(''+a51_0x4bfa70[_0x1a6d91(0x27c)](_0x5acca4[_0x1a6d91(0x287)][_0x1a6d91(0x203)]+_0x1a6d91(0x169))));for(const _0x5ed641 of _0x5acca4[_0x1a6d91(0x225)]){_0x5ed641[_0x1a6d91(0x2c8)]===_0x1a6d91(0x1ac)&&_0x5ed641[_0x1a6d91(0x20d)]&&(console[_0x1a6d91(0x276)]('\x0a'+a51_0x4bfa70['cyan']('---\x20'+_0x5ed641[_0x1a6d91(0x21c)])),console[_0x1a6d91(0x276)](_0x5ed641[_0x1a6d91(0x20d)]));}if(!_0x5acca4['hasChanges'])return saveSessionContext({'workflow_project':_0x5acca4[_0x1a6d91(0x12e)]},_0x3961a4[_0x1a6d91(0x208)]),console[_0x1a6d91(0x276)](a51_0x4bfa70['green'](_0x1a6d91(0x28e))),console[_0x1a6d91(0x276)](a51_0x4bfa70[_0x1a6d91(0x27c)](_0x1a6d91(0x29d)+_0x5acca4[_0x1a6d91(0x12e)])),0x0;if(_0x3961a4[_0x1a6d91(0x163)])return console[_0x1a6d91(0x276)](a51_0x4bfa70[_0x1a6d91(0x1c6)](_0x1a6d91(0x229))),0x0;if(!_0x3961a4[_0x1a6d91(0x218)]){if(!isInteractive())return console[_0x1a6d91(0x276)](a51_0x4bfa70[_0x1a6d91(0x14a)](_0x1a6d91(0x205)),_0x1a6d91(0x1e4)),console['error'](a51_0x4bfa70[_0x1a6d91(0x27c)](_0x1a6d91(0x25d))),0x1;const _0x545bf9=await confirmKey(_0x1a6d91(0x252));if(!_0x545bf9)return console['error'](a51_0x4bfa70[_0x1a6d91(0x1c6)](_0x1a6d91(0x257)),'-\x20no\x20files\x20written'),0x1;}await withSpinner('Writing\x20files...',()=>_0x5539f8[_0x1a6d91(0x197)]['applyPullProject'](_0x5acca4,{'revision':_0x11acc8}),{'verbose':_0x3961a4[_0x1a6d91(0x235)]}),saveSessionContext({'workflow_project':_0x5acca4[_0x1a6d91(0x12e)]},_0x3961a4[_0x1a6d91(0x208)]),console[_0x1a6d91(0x276)](a51_0x4bfa70[_0x1a6d91(0x24d)](_0x1a6d91(0x1fb)));const _0x48c007=a51_0x1bf6f6[_0x1a6d91(0x1e6)](process[_0x1a6d91(0x26a)](),_0x5acca4['targetDir'])||'.';return console[_0x1a6d91(0x276)](a51_0x4bfa70[_0x1a6d91(0x27c)]('\x20\x20Location:\x20'+_0x48c007)),console['error'](a51_0x4bfa70[_0x1a6d91(0x27c)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x5acca4[_0x1a6d91(0x12e)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a51_0x57b8c4(0x14f)]=a51_0x57b8c4(0x233);['description']='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async[a51_0x57b8c4(0x297)](_0x463df6){const _0x106b27=a51_0x57b8c4,{options:_0x2882e2,args:_0x43c78c,tdx:_0x248127}=_0x463df6,_0x4513c9=this[_0x106b27(0x1fc)](_0x43c78c,_0x2882e2),_0x2b9527=_0x2882e2[_0x106b27(0x1a0)],_0xd4ab62=_0x2882e2[_0x106b27(0x191)];_0x2882e2[_0x106b27(0x235)]&&(_0x4513c9&&console['error']('Source\x20directory:\x20'+_0x4513c9),_0x2b9527&&console[_0x106b27(0x276)]('Revision:\x20'+_0x2b9527),_0x2882e2[_0x106b27(0x163)]&&console[_0x106b27(0x276)](_0x106b27(0x155)),_0xd4ab62&&console[_0x106b27(0x276)]('Validation:\x20skipped'));let _0x3bc2d8;try{_0x3bc2d8=await withSpinner(_0x106b27(0x1f6),()=>_0x248127[_0x106b27(0x197)]['preparePushProject']({'sourceDir':_0x4513c9,'revision':_0x2b9527,'skipValidation':_0xd4ab62}),{'verbose':_0x2882e2['verbose']});}catch(_0x20c44f){if(_0x20c44f instanceof Error&&_0x20c44f['message']['includes'](_0x106b27(0x2a9)))return console['error'](a51_0x4bfa70[_0x106b27(0x14a)](_0x106b27(0x2ac)),_0x106b27(0x289)),_0x2882e2[_0x106b27(0x1f1)]?console[_0x106b27(0x276)](a51_0x4bfa70[_0x106b27(0x27c)](_0x106b27(0x167)+_0x2882e2['workflowProject']+_0x106b27(0x22e)+_0x2882e2[_0x106b27(0x1f1)]+'\x27')):console[_0x106b27(0x276)](a51_0x4bfa70[_0x106b27(0x27c)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x20c44f;}const _0x58b8ef=_0x3bc2d8[_0x106b27(0x134)];console[_0x106b27(0x276)]('✔\x20Project:\x20'+_0x58b8ef[_0x106b27(0x12e)]),console[_0x106b27(0x276)]('\x20\x20Source:\x20'+_0x58b8ef[_0x106b27(0x12f)]),console[_0x106b27(0x276)](_0x106b27(0x17b)+_0x58b8ef[_0x106b27(0x1a0)]),console[_0x106b27(0x276)]('\x20\x20Changes:\x20'+a51_0x4bfa70[_0x106b27(0x24d)]('+'+_0x58b8ef[_0x106b27(0x287)]['new']+'\x20new')+',\x20'+(a51_0x4bfa70['yellow']('~'+_0x58b8ef[_0x106b27(0x287)]['modified']+'\x20modified')+',\x20')+(a51_0x4bfa70['red']('-'+_0x58b8ef[_0x106b27(0x287)][_0x106b27(0x152)]+_0x106b27(0x206))+',\x20')+(''+a51_0x4bfa70[_0x106b27(0x27c)](_0x58b8ef[_0x106b27(0x287)]['unchanged']+_0x106b27(0x169))));for(const _0x561ea2 of _0x58b8ef[_0x106b27(0x225)]){_0x561ea2['type']===_0x106b27(0x1ac)&&_0x561ea2[_0x106b27(0x20d)]&&(console[_0x106b27(0x276)]('\x0a'+a51_0x4bfa70[_0x106b27(0x129)]('---\x20'+_0x561ea2[_0x106b27(0x21c)])),console[_0x106b27(0x276)](_0x561ea2[_0x106b27(0x20d)]));}if(!_0x58b8ef[_0x106b27(0x1f8)])return console[_0x106b27(0x276)](a51_0x4bfa70[_0x106b27(0x24d)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x106b27(0x255)](_0x248127,_0x58b8ef['projectName'],_0x2882e2[_0x106b27(0x12b)]),0x0;if(_0x2882e2[_0x106b27(0x163)])return console[_0x106b27(0x276)](a51_0x4bfa70[_0x106b27(0x1c6)](_0x106b27(0x11e))),0x0;if(!_0x2882e2[_0x106b27(0x218)]){if(!isInteractive())return console[_0x106b27(0x276)](a51_0x4bfa70[_0x106b27(0x14a)](_0x106b27(0x205)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x106b27(0x276)](a51_0x4bfa70[_0x106b27(0x27c)](_0x106b27(0x25d))),0x1;const _0x3e3616=await confirmKey(_0x106b27(0x22d));if(!_0x3e3616)return console[_0x106b27(0x276)](a51_0x4bfa70[_0x106b27(0x1c6)](_0x106b27(0x257)),_0x106b27(0x212)),0x1;}const _0x1a80a1=await withSpinner(_0x106b27(0x2cb),()=>_0x248127[_0x106b27(0x197)][_0x106b27(0x2af)](_0x58b8ef),{'verbose':_0x2882e2[_0x106b27(0x235)]}),_0x5d9bc3=_0x1a80a1[_0x106b27(0x134)];return console[_0x106b27(0x276)](a51_0x4bfa70[_0x106b27(0x24d)](_0x106b27(0x21d))),console[_0x106b27(0x276)]('\x20\x20Project\x20ID:\x20'+_0x5d9bc3[_0x106b27(0x219)]),console['error'](_0x106b27(0x17b)+_0x5d9bc3['revision']),await this[_0x106b27(0x255)](_0x248127,_0x5d9bc3[_0x106b27(0x12e)],_0x2882e2[_0x106b27(0x12b)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a51_0x57b8c4(0x2a4);[a51_0x57b8c4(0x18a)]=a51_0x57b8c4(0x1c7);async['execute'](_0x2b61e5){const _0x42c601=a51_0x57b8c4,{options:_0x5c55df,args:_0x7903a3,tdx:_0x16b187}=_0x2b61e5,_0x2c4aa5=this['resolveProjectDir'](_0x7903a3,_0x5c55df),_0x5165a0=_0x5c55df[_0x42c601(0x14f)],_0xf9bbb5=_0x5c55df[_0x42c601(0x1a0)],_0x55829c=_0x5c55df[_0x42c601(0x191)];if(!_0x2c4aa5)return console[_0x42c601(0x276)](a51_0x4bfa70[_0x42c601(0x14a)](_0x42c601(0x2ac)),'Source\x20directory\x20is\x20required'),console[_0x42c601(0x276)](a51_0x4bfa70[_0x42c601(0x27c)](_0x42c601(0x2c5))),console[_0x42c601(0x276)](a51_0x4bfa70[_0x42c601(0x27c)](_0x42c601(0x1ff))),0x1;if(!_0x5165a0)return console[_0x42c601(0x276)](a51_0x4bfa70[_0x42c601(0x14a)]('Error:'),_0x42c601(0x2c4)),console[_0x42c601(0x276)](a51_0x4bfa70[_0x42c601(0x27c)](_0x42c601(0x2c5))),0x1;_0x5c55df[_0x42c601(0x235)]&&(console[_0x42c601(0x276)]('Source\x20directory:\x20'+_0x2c4aa5),console[_0x42c601(0x276)](_0x42c601(0x1d7)+_0x5165a0),_0xf9bbb5&&console[_0x42c601(0x276)](_0x42c601(0x2a8)+_0xf9bbb5),_0x5c55df[_0x42c601(0x163)]&&console['error']('Dry\x20run:\x20yes'),_0x55829c&&console[_0x42c601(0x276)](_0x42c601(0x269)));const _0x1911fd=await withSpinner(_0x42c601(0x1b1),()=>_0x16b187[_0x42c601(0x197)][_0x42c601(0x21a)](_0x2c4aa5,_0x5165a0,{'revision':_0xf9bbb5,'skipValidation':_0x55829c}),{'verbose':_0x5c55df[_0x42c601(0x235)]}),_0x2c6dcf=_0x1911fd[_0x42c601(0x134)];console['error'](_0x42c601(0x2ad)+_0x2c6dcf[_0x42c601(0x12f)]);_0x2c6dcf[_0x42c601(0x186)]&&console[_0x42c601(0x276)](_0x42c601(0x249)+_0x2c6dcf[_0x42c601(0x186)]);console[_0x42c601(0x276)](_0x42c601(0x1d7)+_0x2c6dcf[_0x42c601(0x2a0)]),console[_0x42c601(0x276)](_0x42c601(0x2a8)+_0x2c6dcf[_0x42c601(0x1a0)]),console[_0x42c601(0x276)](_0x42c601(0x285)+_0x2c6dcf[_0x42c601(0x201)]);_0x2c6dcf[_0x42c601(0x256)]&&(console[_0x42c601(0x276)](a51_0x4bfa70[_0x42c601(0x1c6)]('\x0a⚠\x20Project\x20\x22'+_0x2c6dcf['newProjectName']+_0x42c601(0x283)+_0x2c6dcf[_0x42c601(0x1d2)]+')')),console[_0x42c601(0x276)](a51_0x4bfa70['yellow']('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x5c55df['dryRun'])return console[_0x42c601(0x276)](a51_0x4bfa70[_0x42c601(0x1c6)](_0x42c601(0x26c))),0x0;if(!_0x5c55df[_0x42c601(0x218)]){if(!isInteractive())return console[_0x42c601(0x276)](a51_0x4bfa70['red']('\x0aError:'),_0x42c601(0x1e4)),console[_0x42c601(0x276)](a51_0x4bfa70['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4c646a=_0x2c6dcf[_0x42c601(0x186)]||a51_0x1bf6f6['basename'](_0x2c4aa5),_0xad952b=_0x2c6dcf[_0x42c601(0x256)]?_0x42c601(0x28a)+_0x5165a0+_0x42c601(0x18d):_0x42c601(0x220)+_0x4c646a+_0x42c601(0x25f)+_0x5165a0+'\x22?',_0x1d52ab=await confirmKey(_0xad952b);if(!_0x1d52ab)return console[_0x42c601(0x276)](a51_0x4bfa70['yellow']('Cancelled')),0x1;}const _0x114b53=await withSpinner(_0x2c6dcf[_0x42c601(0x256)]?_0x42c601(0x16d)+_0x5165a0+_0x42c601(0x12a):'Cloning\x20to\x20'+_0x5165a0+_0x42c601(0x12a),()=>_0x16b187[_0x42c601(0x197)]['executeCloneProject'](_0x2c6dcf),{'verbose':_0x5c55df['verbose']}),_0x5df013=_0x114b53['data'];return console['error'](a51_0x4bfa70['green'](_0x2c6dcf[_0x42c601(0x256)]?_0x42c601(0x23b):'✔\x20Clone\x20complete')),console[_0x42c601(0x276)](_0x42c601(0x1bf)+_0x5df013[_0x42c601(0x2a0)]),console[_0x42c601(0x276)](_0x42c601(0x1f2)+_0x5df013[_0x42c601(0x13a)]),console[_0x42c601(0x276)](_0x42c601(0x17b)+_0x5df013['revision']),await this[_0x42c601(0x255)](_0x16b187,_0x5df013[_0x42c601(0x2a0)],_0x5c55df['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a51_0x57b8c4(0x14f)]=a51_0x57b8c4(0x1ad);['description']=a51_0x57b8c4(0x21b);async[a51_0x57b8c4(0x297)](_0x331271){const _0x10e9ce=a51_0x57b8c4,{options:_0x314523,args:_0x278a36,tdx:_0x2ed46d}=_0x331271,_0x399818=_0x278a36[0x0];if(!_0x399818)return console[_0x10e9ce(0x276)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x10e9ce(0x276)](_0x10e9ce(0x2a7)),0x1;_0x314523[_0x10e9ce(0x235)]&&console[_0x10e9ce(0x276)]('Project:\x20'+_0x399818);if(!_0x314523['yes']){if(!isInteractive())return console[_0x10e9ce(0x276)](a51_0x4bfa70['red'](_0x10e9ce(0x205)),_0x10e9ce(0x1e4)),console['error'](a51_0x4bfa70[_0x10e9ce(0x27c)](_0x10e9ce(0x25d))),0x1;const _0x582240=await confirmKey(_0x10e9ce(0x1f4)+_0x399818+_0x10e9ce(0x190));if(!_0x582240)return console['error'](a51_0x4bfa70[_0x10e9ce(0x1c6)](_0x10e9ce(0x257))),0x1;}const _0x5278b4=await withSpinner(_0x10e9ce(0x1be)+_0x399818+'...',()=>_0x2ed46d[_0x10e9ce(0x197)]['delete'](_0x399818),{'verbose':_0x314523[_0x10e9ce(0x235)]}),_0xeb7ea3=_0x5278b4['data'];return console[_0x10e9ce(0x276)](_0x10e9ce(0x194)+_0xeb7ea3[_0x10e9ce(0x12e)]),console['error'](_0x10e9ce(0x1f2)+_0xeb7ea3[_0x10e9ce(0x219)]),0x0;}}export function parseKeyValue(_0x1340d3){const _0x40d9fa=a51_0x57b8c4,_0x563c6b=_0x1340d3[_0x40d9fa(0x2b9)]('=');if(_0x563c6b===-0x1)throw new Error(_0x40d9fa(0x1e2)+_0x1340d3+_0x40d9fa(0x125));const _0x32c524=_0x1340d3[_0x40d9fa(0x28d)](0x0,_0x563c6b),_0x2a866e=_0x1340d3['substring'](_0x563c6b+0x1);if(!_0x32c524)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x32c524,'value':_0x2a866e};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']=a51_0x57b8c4(0x282);[a51_0x57b8c4(0x18a)]=a51_0x57b8c4(0x2bf);async['execute'](_0x2ddbd0){const _0x542225=a51_0x57b8c4,{options:_0x49d705,args:_0x114bb4,tdx:_0x44e351}=_0x2ddbd0,_0x2e51c7=this['requireProject'](_0x114bb4,_0x49d705);if(!_0x2e51c7)return 0x1;_0x49d705['verbose']&&console['error'](_0x542225(0x17e)+_0x2e51c7);const _0x3b4fda=await withSpinner(_0x542225(0x154),()=>_0x44e351['workflow'][_0x542225(0x21e)](_0x2e51c7),{'verbose':_0x49d705[_0x542225(0x235)]}),{secrets:_0x3acaf4}=_0x3b4fda['data'];return console['error'](_0x542225(0x29b)+_0x3acaf4[_0x542225(0x28b)]+_0x542225(0x1ea)+(_0x3acaf4[_0x542225(0x28b)]!==0x1?'s':'')),await handleSDKOutput(_0x3acaf4,_0x49d705),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a51_0x57b8c4(0x14f)]=a51_0x57b8c4(0x260);['description']=a51_0x57b8c4(0x254);async[a51_0x57b8c4(0x297)](_0x4da598){const _0x221062=a51_0x57b8c4,{options:_0x274ddc,args:_0x1a6b59,tdx:_0x2701ce}=_0x4da598;let _0x330cd9,_0x5f5bfa;if(_0x1a6b59[_0x221062(0x28b)]>=0x1&&!_0x1a6b59[0x0][_0x221062(0x174)]('='))_0x330cd9=_0x1a6b59[0x0],_0x5f5bfa=_0x1a6b59[_0x221062(0x156)](0x1);else{if(_0x1a6b59[_0x221062(0x28b)]>=0x1&&_0x274ddc[_0x221062(0x1f1)])_0x330cd9=_0x274ddc['workflowProject'],_0x5f5bfa=_0x1a6b59;else return _0x1a6b59[_0x221062(0x28b)]>=0x1?(console['error'](_0x221062(0x27d)),console[_0x221062(0x276)](_0x221062(0x2a1)),0x1):(console[_0x221062(0x276)](_0x221062(0x13f)),console['error']('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1);}if(_0x5f5bfa['length']===0x0)return console[_0x221062(0x276)](_0x221062(0x13f)),console['error'](_0x221062(0x13b)),0x1;const _0x32450d={};try{for(const _0x58e6b0 of _0x5f5bfa){const {key:_0x370014,value:_0x4ddf48}=parseKeyValue(_0x58e6b0);_0x32450d[_0x370014]=_0x4ddf48;}}catch(_0x4d325e){return _0x4d325e instanceof Error&&console['error'](a51_0x4bfa70['red'](_0x221062(0x2ac)),_0x4d325e[_0x221062(0x199)]),0x1;}const _0x182e32=Object['keys'](_0x32450d);_0x274ddc[_0x221062(0x235)]&&(console['error'](_0x221062(0x17e)+_0x330cd9),console[_0x221062(0x276)](_0x221062(0x15b)+_0x182e32[_0x221062(0x1a6)](',\x20')));const _0x399578=await withSpinner(_0x182e32[_0x221062(0x28b)]===0x1?_0x221062(0x16c):_0x221062(0x158)+_0x182e32[_0x221062(0x28b)]+_0x221062(0x173),()=>_0x2701ce[_0x221062(0x197)][_0x221062(0x264)](_0x330cd9,_0x32450d),{'verbose':_0x274ddc[_0x221062(0x235)]}),_0x3e1451=_0x399578[_0x221062(0x134)];return console['error'](_0x182e32['length']===0x1?_0x221062(0x1db)+_0x3e1451[_0x221062(0x177)][0x0]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x3e1451[_0x221062(0x12e)]+'\x27':'✔\x20'+_0x3e1451[_0x221062(0x177)][_0x221062(0x28b)]+_0x221062(0x226)+_0x3e1451[_0x221062(0x12e)]+'\x27'),(_0x274ddc[_0x221062(0x1ef)]||_0x274ddc[_0x221062(0x259)])&&await handleSingleObjectOutput(_0x3e1451,_0x274ddc),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a51_0x57b8c4(0x14f)]=a51_0x57b8c4(0x2b4);['description']=a51_0x57b8c4(0x222);async[a51_0x57b8c4(0x297)](_0xb46565){const _0x2a1ef2=a51_0x57b8c4,{options:_0x178732,args:_0xd59469,tdx:_0x17a134}=_0xb46565;let _0x3e5df4,_0x5806a8;if(_0xd59469[_0x2a1ef2(0x28b)]>=0x2)_0x3e5df4=_0xd59469[0x0],_0x5806a8=_0xd59469[0x1];else{if(_0xd59469[_0x2a1ef2(0x28b)]===0x1&&_0x178732[_0x2a1ef2(0x1f1)])_0x3e5df4=_0x178732[_0x2a1ef2(0x1f1)],_0x5806a8=_0xd59469[0x0];else return _0xd59469[_0x2a1ef2(0x28b)]===0x1?(console['error'](_0x2a1ef2(0x27d)),console[_0x2a1ef2(0x276)](_0x2a1ef2(0x2a1)),0x1):(console['error'](_0x2a1ef2(0x130)),console[_0x2a1ef2(0x276)]('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x178732[_0x2a1ef2(0x235)]&&(console[_0x2a1ef2(0x276)](_0x2a1ef2(0x17e)+_0x3e5df4),console[_0x2a1ef2(0x276)](_0x2a1ef2(0x2ae)+_0x5806a8));if(!_0x178732['yes']){if(!isInteractive())return console[_0x2a1ef2(0x276)](a51_0x4bfa70[_0x2a1ef2(0x14a)](_0x2a1ef2(0x205)),_0x2a1ef2(0x1e4)),console['error'](a51_0x4bfa70[_0x2a1ef2(0x27c)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1a039e=await confirmKey(_0x2a1ef2(0x242)+_0x5806a8+_0x2a1ef2(0x270)+_0x3e5df4+'\x27?');if(!_0x1a039e)return console[_0x2a1ef2(0x276)](a51_0x4bfa70[_0x2a1ef2(0x1c6)](_0x2a1ef2(0x257))),0x1;}const _0x4e9d81=await withSpinner(_0x2a1ef2(0x184),()=>_0x17a134['workflow'][_0x2a1ef2(0x19c)](_0x3e5df4,_0x5806a8),{'verbose':_0x178732[_0x2a1ef2(0x235)]}),_0x1522f3=_0x4e9d81['data'];return console[_0x2a1ef2(0x276)](_0x2a1ef2(0x1db)+_0x1522f3[_0x2a1ef2(0x2bc)]+_0x2a1ef2(0x153)+_0x1522f3['projectName']+'\x27'),(_0x178732[_0x2a1ef2(0x1ef)]||_0x178732[_0x2a1ef2(0x259)])&&await handleSingleObjectOutput(_0x1522f3,_0x178732),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(_0x1cd7a8){const _0x593257=a51_0x57b8c4,_0x35a9f3=Math[_0x593257(0x27e)](_0x1cd7a8/0x3e8),_0x4c988b=Math[_0x593257(0x27e)](_0x35a9f3/0x3c),_0xcd8b2c=Math['floor'](_0x4c988b/0x3c),_0x244f17=Math[_0x593257(0x27e)](_0xcd8b2c/0x18);if(_0x244f17>0x0){const _0x178bdb=_0xcd8b2c%0x18;return _0x178bdb>0x0?_0x244f17+'d\x20'+_0x178bdb+'h':_0x244f17+'d';}else{if(_0xcd8b2c>0x0){const _0x554b10=_0x4c988b%0x3c;return _0x554b10>0x0?_0xcd8b2c+'h\x20'+_0x554b10+'m':_0xcd8b2c+'h';}else{if(_0x4c988b>0x0){const _0x48f256=_0x35a9f3%0x3c;return _0x48f256>0x0?_0x4c988b+'m\x20'+_0x48f256+'s':_0x4c988b+'m';}else return _0x35a9f3+'s';}}}function formatTimestamp(_0x10ea27,_0x364aec){const _0x2a9a97=a51_0x57b8c4,_0x35bb9d=new Date(_0x10ea27),_0x2c1e32=String(_0x35bb9d[_0x2a9a97(0x23d)]())[_0x2a9a97(0x204)](0x2,'0'),_0x39cc62=String(_0x35bb9d[_0x2a9a97(0x26f)]())[_0x2a9a97(0x204)](0x2,'0'),_0x51c1a7=_0x2c1e32+':'+_0x39cc62,_0x8309ae=_0x35bb9d[_0x2a9a97(0x159)]()===_0x364aec[_0x2a9a97(0x159)]()&&_0x35bb9d[_0x2a9a97(0x1e7)]()===_0x364aec[_0x2a9a97(0x1e7)]()&&_0x35bb9d['getDate']()===_0x364aec[_0x2a9a97(0x1dd)]();if(_0x8309ae)return _0x51c1a7;else{const _0x432024=String(_0x35bb9d[_0x2a9a97(0x1e7)]()+0x1)[_0x2a9a97(0x204)](0x2,'0'),_0x2fa0b3=String(_0x35bb9d[_0x2a9a97(0x1dd)]())[_0x2a9a97(0x204)](0x2,'0');return _0x432024+'-'+_0x2fa0b3+'\x20'+_0x51c1a7;}}function formatDate(_0x281933){const _0x27b9a7=a51_0x57b8c4,_0x1b18a0=_0x281933[_0x27b9a7(0x159)](),_0x56c38c=String(_0x281933[_0x27b9a7(0x1e7)]()+0x1)[_0x27b9a7(0x204)](0x2,'0'),_0x3a9ba7=String(_0x281933[_0x27b9a7(0x1dd)]())[_0x27b9a7(0x204)](0x2,'0');return _0x1b18a0+'-'+_0x56c38c+'-'+_0x3a9ba7;}function getTaskStateIcon(_0x599ce9){const _0x5ce152={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x5ce152[_0x599ce9]||'⚪';}function getBarChar(_0x9697f6){const _0x1137c9=a51_0x57b8c4;return _0x9697f6===_0x1137c9(0x276)||_0x9697f6===_0x1137c9(0x26e)?'×':'─';}function a51_0x43e0(){const _0x45a0a4=['workflow:run','workflow:use','red','sessionTime','workflowName','isTTY','Retrying\x20attempt...','name','No\x20workflow\x20projects\x20found','No\x20log\x20files\x20found\x20for\x20this\x20attempt','deleted','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Listing\x20secrets...','Dry\x20run:\x20yes','slice','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','Setting\x20','getFullYear','✔\x20Workflow\x20project\x20context\x20cleared.','Secrets\x20to\x20set:\x20','\x20\x20Changes:\x20','table','Project\x20filter:\x20','pollTimeline','lastAttempt','GUTTER','⚠\x20Showing\x20first\x20','dryRun','\x20\x20Workflow:\x20','ICON_WIDTH','From\x20task:\x20','Tip:\x20cd\x20to\x20workflows/','size','\x20unchanged','retryAttempt','→\x20New\x20project:\x20','Setting\x20secret...','Updating\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','logs','tdx\x20wf\x20attempt\x20','format','params','\x20secrets...','includes','Attempt\x20ID:\x20','now','keys','done','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','value','\x20\x20Revision:\x20','\x20is\x20not\x20a\x20directory','log','Project:\x20','max','blue','has','includeRetried','\x20logs','Deleting\x20secret...','Latest\x20session\x20has\x20no\x20attempt','sourceProjectName','buildTimelineData','Session\x20not\x20found:\x20','isDirectory','description','filter','\x20attempt','\x22\x20with\x20new\x20revision?','sessionId','Reason:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','skipValidation','LABEL_MIN_SPACING','attemptId','✔\x20Deleted\x20project\x20','No\x20projects\x20match\x20pattern:\x20','857879NslVxV','workflow','40Mhpjbx','message','MAX_TIMELINE_WIDTH','min','deleteSecret','TASK_NAME_WIDTH','\x20workflow','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','revision','Include\x20retried:\x20yes','/attempt/','No\x20workflows\x20found\x20in\x20project:\x20','No\x20sessions\x20found\x20in\x20project:\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','join','unknown','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','from','(unknown)','context','modified','workflow:delete','parseProjectWorkflowPattern','Target:\x20','utf-8','Analyzing\x20project...','limit','Error:\x20Invalid\x20parameter\x20format:\x20','49576PUQnof','Project\x20name\x20is\x20required','total','fill','state','Loading\x20sessions...','No\x20sessions\x20with\x20timing\x20information','requireProject','start','getTime','Deleting\x20project\x20','\x20\x20Project:\x20','workflow:tasks','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','resolveProjectId','all','Listing\x20workflow\x20projects...','clear','yellow','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','revision:\x20','No\x20sessions\x20found','pending','find','\x20(use\x20--limit\x20to\x20show\x20more)','Select\x20a\x20session\x20to\x20view\x20timeline:','(use\x20--limit\x20to\x20see\x20more)','fullName','values','text','existingProjectId','split','durationMs','planned','🔄\x20','New\x20project\x20name:\x20','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','session_id','workflow:attempts','✔\x20Secret\x20\x27','Downloading\x20logs...','getDate','MAX_TASKS_DISPLAY','\x20\x20Console:\x20','\x20\x20Session\x20ID:\x20','replace','Invalid\x20format:\x20','index','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','resolveProject','relative','getMonth','\x1b[1A\x1b[2K','toISOString','\x20secret','List\x20workflows','workflow:logs','project','No\x20log\x20content\x20found','json','new','workflowProject','\x20\x20Project\x20ID:\x20','attempt','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','renderSessionsTimeline','Analyzing\x20changes...','\x20sessions\x20','hasChanges','List\x20all\x20workflow\x20projects','✔\x20Pushed\x20','✔\x20Pull\x20complete','resolveProjectDir','columns','Parameters:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','window','fileCount','📋\x20','unchanged','padStart','\x0aError:','\x20deleted','\x20task','session','Resolving\x20project\x20\x27','force','24rMztuN','\x20project','diff','resumeFrom','updatedAt','map','icon','-\x20nothing\x20pushed','repeat','Using\x20attempt\x20','Kill\x20a\x20running\x20attempt','startTime','reason','yes','projectId','prepareCloneProject','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','path','✔\x20Push\x20complete','listSecrets','stringify','\x0aClone\x20\x22','\x20\x20Location:\x20','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','localeCompare','\x20-\x20','changes','\x20secrets\x20set\x20for\x20project\x20\x27','MIN_TIMELINE_WIDTH','No\x20attempts\x20found','\x0aDry\x20run\x20-\x20no\x20files\x20written','Listing\x20workflows...','createdAt','renderSingleTimeline','\x0aPush\x20these\x20changes?','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','startsWith','startedAt','\x20session','download','workflow:push','finishedAt','verbose','Downloading\x20project\x20','running','Resume\x20from:\x20','write','projects','✔\x20Project\x20updated','Pushing\x20workflow\x20project...','getHours','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','every','POLL_INTERVAL_MS','attempt:','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','task','Error:\x20Attempt\x20ID\x20is\x20required','pullProject','Task\x20name:\x20','Killing\x20attempt...','Status:\x20','Source\x20project:\x20','Target\x20directory:\x20','No\x20workflow\x20sessions\x20found','session:','green','\x20from\x20session\x20','Show\x20logs\x20for\x20a\x20workflow\x20attempt','logFiles','No\x20attempts\x20found\x20in\x20project:\x20','\x0aApply\x20these\x20changes?','output','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','showWorkflowConsoleUrl','targetExists','Cancelled','match','jsonl','1274367mRWwVF','\x20to\x20see\x20detailed\x20logs','\x20new','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','renderTimeline','\x22\x20to\x20new\x20project\x20\x22','workflow:secrets:set','taskName','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','parse','setSecrets','Start\x20a\x20workflow\x20run','1789473tvMGjg','retryAttemptName','\x27...','Validation:\x20skipped','cwd','white','\x0aDry\x20run\x20-\x20no\x20project\x20created','rows','group_error','getMinutes','\x27\x20from\x20project\x20\x27','MAX_LABEL_COUNT','workflow:sessions','list','\x0aFailed\x20to\x20fetch\x20attempt\x20data','cancelRequested','error','Output\x20directory:\x20','✔\x20Showing\x20','fs/promises','isNewProject','799122JmCRzf','dim','Error:\x20Project\x20name\x20is\x20required','floor','msPerChar','set','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','workflow:secrets:list','\x22\x20already\x20exists\x20(ID:\x20','Session\x20','Files\x20to\x20upload:\x20','→\x20Project:\x20','summary','\x0aPolling...\x20(','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','\x0aUpdate\x20existing\x20project\x20\x22','length','navigateSessionsInteractive','substring','\x0a✔\x20Already\x20up\x20to\x20date','sessions','Project\x20name:\x20','stat','Retry\x20a\x20session\x20or\x20attempt','Pull\x20workflow\x20project\x20to\x20local\x20folder','trim','\x20has\x20no\x20attempts','No\x20matching\x20sessions\x20found','execute','\x20\x20tdx\x20wf\x20use\x20<project>','LABEL_WIDTH_DIVISOR','Usage:\x20tdx\x20wf\x20use\x20<project>','✔\x20Found\x20','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','\x20\x20Session\x20context\x20set\x20to:\x20','sort','splice','newProjectName','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','📁\x20','workflow:projects','workflow:clone','Attempt:\x20',',\x20Workflow:\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','Revision:\x20','No\x20workflow\x20tdx.json\x20found','Error:\x20Invalid\x20JSON\x20in\x20--params','\x20\x20Attempt\x20ID:\x20','Error:','Source:\x20','Key:\x20','executePushProject','Getting\x20attempt\x20details...','follow','18jeBudl','stdout','workflow:secrets:delete','sys','\x20\x20Target:\x20','Error:\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','indexOf','✔\x20Workflow\x20run\x20started','4356798nyijXN','key','readFile','success','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Force:\x20yes','ICON_SPACING','Getting\x20attempt\x20tasks...','workflows','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','\x20tasks','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','type','Pattern:\x20','Filter:\x20project=','Pushing\x20project...','Filter:\x20','Total:\x20','select','No\x20workflows\x20found','List\x20workflow\x20attempts','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','18779350ZOBZSD','\x0aDry\x20run\x20-\x20nothing\x20pushed','workflow:download','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','generateSessionTimelineRows','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','\x20modified','workflow:upload','.\x20Expected\x20format:\x20KEY=VALUE','Retrying\x20session...','param','kill','cyan','...','site','\x20\x20Files\x20extracted:\x20','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','projectName','sourceDir','Error:\x20Secret\x20key\x20is\x20required','Project\x20directory:\x20','end','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','data','MIN_LABEL_COUNT','canceling','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Fetching\x20log\x20files...','isArray','newProjectId','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','tasks','duration','toLowerCase','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','status','No\x20sessions\x20found\x20for:\x20','resolve','workflow:workflows','Warning:','push','/app/workflows/','Workflow:\x20'];a51_0x43e0=function(){return _0x45a0a4;};return a51_0x43e0();}function getBarColor(_0x880f74){const _0x561094=a51_0x57b8c4,_0xf6d2c3={'success':a51_0x4bfa70[_0x561094(0x24d)],'error':a51_0x4bfa70[_0x561094(0x14a)],'group_error':a51_0x4bfa70[_0x561094(0x14a)],'running':a51_0x4bfa70[_0x561094(0x180)],'blocked':a51_0x4bfa70[_0x561094(0x1c6)],'planned':a51_0x4bfa70[_0x561094(0x27c)],'canceling':a51_0x4bfa70[_0x561094(0x1c6)]};return _0xf6d2c3[_0x880f74]||a51_0x4bfa70[_0x561094(0x26b)];}function parseTaskName(_0x6e877a){const _0x4f344d=a51_0x57b8c4;let _0x5eb784=_0x6e877a[_0x4f344d(0x1e1)](/^\++/,'');const _0x3b9b3=_0x5eb784[_0x4f344d(0x1d3)]('+'),_0x139d12=_0x3b9b3[_0x4f344d(0x28b)]>0x1?_0x3b9b3['length']-0x2:0x0,_0x40b81d=_0x3b9b3[_0x3b9b3[_0x4f344d(0x28b)]-0x1]||_0x5eb784;return{'level':_0x139d12,'name':'+'+_0x40b81d};}function truncateTaskName(_0x1c42c0,_0x4f5fdc){const _0x68a683=a51_0x57b8c4,_0x5d4360=stringWidth(_0x1c42c0);if(_0x5d4360<=_0x4f5fdc)return _0x1c42c0;let _0x157924=_0x1c42c0;while(stringWidth(_0x157924+'…')>_0x4f5fdc&&_0x157924[_0x68a683(0x28b)]>0x0){_0x157924=_0x157924[_0x68a683(0x156)](0x0,-0x1);}return _0x157924+'…';}function calculateTimeScale(_0x189e01,_0x4122fb){const _0x468b16=a51_0x57b8c4;return{'startTime':_0x189e01[_0x468b16(0x1bc)],'endTime':_0x189e01[_0x468b16(0x132)],'durationMs':_0x189e01[_0x468b16(0x13d)],'msPerChar':_0x189e01[_0x468b16(0x13d)]/_0x4122fb};}function timeToPosition(_0x129828,_0x2b12d9,_0x3a0fbc){const _0x250402=a51_0x57b8c4,_0x40f7e2=_0x129828-_0x2b12d9[_0x250402(0x216)],_0x287c8e=Math[_0x250402(0x27e)](_0x40f7e2/_0x2b12d9[_0x250402(0x27f)]);return Math[_0x250402(0x17f)](0x0,Math[_0x250402(0x19b)](_0x287c8e,_0x3a0fbc));}function a51_0x532a(_0xf98eb,_0x35fffc){_0xf98eb=_0xf98eb-0x11a;const _0x43e058=a51_0x43e0();let _0x532a29=_0x43e058[_0xf98eb];return _0x532a29;}function renderTimeAxis(_0x4b6442,_0x45c4c){const _0x5bf6bc=a51_0x57b8c4,_0x32670b=Math['min'](TIMELINE_CONFIG[_0x5bf6bc(0x271)],Math[_0x5bf6bc(0x17f)](TIMELINE_CONFIG[_0x5bf6bc(0x135)],Math[_0x5bf6bc(0x27e)](_0x45c4c/TIMELINE_CONFIG[_0x5bf6bc(0x299)]))),_0x5f45fc=_0x4b6442[_0x5bf6bc(0x1d4)]/(_0x32670b-0x1),_0x283975=new Date(_0x4b6442[_0x5bf6bc(0x216)]),_0x58795b=[];for(let _0x58416f=0x0;_0x58416f<_0x32670b;_0x58416f++){const _0x2ad071=_0x4b6442[_0x5bf6bc(0x216)]+_0x58416f*_0x5f45fc,_0x57e63a=timeToPosition(_0x2ad071,_0x4b6442,_0x45c4c),_0x55f2fa=formatTimestamp(_0x2ad071,_0x283975);_0x58795b[_0x5bf6bc(0x145)]({'pos':_0x57e63a,'text':_0x55f2fa});}const _0x5a7357=new Array(_0x45c4c)[_0x5bf6bc(0x1b7)]('\x20');let _0x2e32e8=-0x1;for(const {pos:_0x5a1c1b,text:_0x18eb68}of _0x58795b){let _0x513cbb=Math[_0x5bf6bc(0x17f)](0x0,_0x5a1c1b-Math[_0x5bf6bc(0x27e)](_0x18eb68[_0x5bf6bc(0x28b)]/0x2));_0x513cbb<=_0x2e32e8+TIMELINE_CONFIG[_0x5bf6bc(0x192)]&&(_0x513cbb=_0x2e32e8+TIMELINE_CONFIG[_0x5bf6bc(0x192)]+0x1);_0x513cbb+_0x18eb68['length']>_0x45c4c&&(_0x513cbb=_0x45c4c-_0x18eb68['length']);if(_0x513cbb>=0x0&&_0x513cbb+_0x18eb68[_0x5bf6bc(0x28b)]<=_0x45c4c&&_0x513cbb>_0x2e32e8){for(let _0xc4de9a=0x0;_0xc4de9a<_0x18eb68[_0x5bf6bc(0x28b)];_0xc4de9a++){_0x5a7357[_0x513cbb+_0xc4de9a]=_0x18eb68[_0xc4de9a];}_0x2e32e8=_0x513cbb+_0x18eb68[_0x5bf6bc(0x28b)]-0x1;}}return _0x5a7357['join']('');}function renderTaskRow(_0x14e35d,_0x45a8f0,_0x4a7462,_0x3bc4f3){const _0x39ec55=a51_0x57b8c4,{level:_0x3bb079,name:_0x502e8a}=parseTaskName(_0x14e35d[_0x39ec55(0x14f)]),_0x38eb9b='\x20'['repeat'](_0x3bb079),_0x434262=_0x14e35d[_0x39ec55(0x200)]?'('+formatElapsed(_0x14e35d[_0x39ec55(0x200)]['duration'])+')':'',_0x21f213=stringWidth(_0x434262),_0x32c116=_0x3bb079*0x1,_0x4650f0=_0x3bc4f3-_0x32c116-_0x21f213-0x1,_0x113602=truncateTaskName(_0x502e8a,_0x4650f0),_0x2babeb=_0x38eb9b+_0x113602,_0x2afeca=stringWidth(_0x2babeb),_0x5a0772=_0x3bc4f3-_0x2afeca-_0x21f213,_0x1259e2=_0x2babeb+'\x20'[_0x39ec55(0x213)](Math['max'](0x1,_0x5a0772))+a51_0x4bfa70[_0x39ec55(0x27c)](_0x434262),_0x2e16b0=getTaskStateIcon(_0x14e35d['state']),_0x107b2c=new Array(_0x4a7462)['fill']('\x20');if(_0x14e35d[_0x39ec55(0x200)]){const _0xd399e7=timeToPosition(_0x14e35d[_0x39ec55(0x200)][_0x39ec55(0x1bc)],_0x45a8f0,_0x4a7462),_0x58bd8d=timeToPosition(_0x14e35d[_0x39ec55(0x200)][_0x39ec55(0x132)],_0x45a8f0,_0x4a7462),_0x33cb99=getBarChar(_0x14e35d[_0x39ec55(0x1b8)]),_0x8adc23=Math[_0x39ec55(0x17f)](_0xd399e7+0x1,_0x58bd8d);for(let _0x17f312=_0xd399e7;_0x17f312<Math[_0x39ec55(0x19b)](_0x8adc23,_0x4a7462);_0x17f312++){_0x107b2c[_0x17f312]=_0x33cb99;}}const _0x179cff=getBarColor(_0x14e35d[_0x39ec55(0x1b8)]),_0x2ef743=_0x107b2c[_0x39ec55(0x210)](_0xc35e70=>_0xc35e70==='\x20'?'\x20':_0x179cff(_0xc35e70))[_0x39ec55(0x1a6)]('');return _0x2e16b0+'\x20'+_0x1259e2+'│'+_0x2ef743+'│';}function calculateStats(_0x305794){const _0x288781=a51_0x57b8c4,_0x1b8e96={'total':_0x305794[_0x288781(0x28b)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x3d3d10 of _0x305794){if(_0x3d3d10[_0x288781(0x1b8)]===_0x288781(0x2be))_0x1b8e96[_0x288781(0x2be)]++;else{if(_0x3d3d10['state']===_0x288781(0x276)||_0x3d3d10[_0x288781(0x1b8)]===_0x288781(0x26e))_0x1b8e96[_0x288781(0x276)]++;else _0x3d3d10['state']===_0x288781(0x237)?_0x1b8e96[_0x288781(0x237)]++:_0x1b8e96[_0x288781(0x1ca)]++;}}return _0x1b8e96;}function formatStats(_0x100f05){const _0x557782=a51_0x57b8c4;return[_0x557782(0x2cd)+_0x100f05[_0x557782(0x1b6)],'✅\x20'+_0x100f05['success'],'❌\x20'+_0x100f05['error'],_0x557782(0x1d6)+_0x100f05[_0x557782(0x237)],'⏳\x20'+_0x100f05[_0x557782(0x1ca)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a51_0x57b8c4(0x14f)]='workflow:timeline';[a51_0x57b8c4(0x18a)]=a51_0x57b8c4(0x29c);async[a51_0x57b8c4(0x297)](_0x2ee1fc){const _0x2c4754=a51_0x57b8c4,{options:_0x52de34,args:_0x27cb71,tdx:_0x105640}=_0x2ee1fc;let _0x16d8f5,_0x3b9786,_0x3f9e1a=![];if(_0x27cb71[0x0]){if(_0x27cb71[0x0][_0x2c4754(0x174)]('.')){const _0x19a28d=this[_0x2c4754(0x1ae)](_0x27cb71,_0x52de34);if(!_0x19a28d)return 0x1;_0x16d8f5=_0x19a28d[_0x2c4754(0x12e)],_0x3b9786=_0x19a28d[_0x2c4754(0x14c)];}else{_0x3b9786=_0x27cb71[0x0],_0x16d8f5=_0x52de34[_0x2c4754(0x1f1)];if(!_0x16d8f5)return console[_0x2c4754(0x276)](a51_0x4bfa70[_0x2c4754(0x14a)]('Error:'),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x3f9e1a=!![];}}else{const _0xd8e54c=this[_0x2c4754(0x1ae)](_0x27cb71,_0x52de34);if(!_0xd8e54c)return 0x1;_0x16d8f5=_0xd8e54c['projectName'],_0x3b9786=_0xd8e54c[_0x2c4754(0x14c)];}if(_0x52de34[_0x2c4754(0x235)]){if(_0x16d8f5&&_0x3b9786)console['error'](_0x2c4754(0x2cc)+_0x16d8f5+'.'+_0x3b9786);else _0x16d8f5&&console['error'](_0x2c4754(0x2ca)+_0x16d8f5);}const _0x3dfe0f=_0x52de34[_0x2c4754(0x193)],_0x2817cf=_0x52de34['sessionId'];if(_0x3dfe0f){_0x2817cf&&console['error'](a51_0x4bfa70[_0x2c4754(0x1c6)](_0x2c4754(0x144)),_0x2c4754(0x19f));const _0x3fcef0=_0x52de34[_0x2c4754(0x2b1)];return _0x3fcef0?await this['pollTimeline'](_0x2ee1fc,_0x3dfe0f):await this[_0x2c4754(0x22c)](_0x2ee1fc,_0x3dfe0f,_0x52de34),0x0;}if(_0x2817cf){const _0x9786e5=await withSpinner('Loading\x20session...',()=>_0x105640[_0x2c4754(0x197)]['sessions']({'projectName':_0x16d8f5,'workflowName':_0x3b9786,'limit':0x64}),{'verbose':_0x52de34[_0x2c4754(0x235)]}),_0x5dd624=_0x9786e5[_0x2c4754(0x134)]['find'](_0x2732da=>_0x2732da['id']===_0x2817cf);if(!_0x5dd624)return console[_0x2c4754(0x276)](a51_0x4bfa70[_0x2c4754(0x14a)](_0x2c4754(0x2ac)),_0x2c4754(0x188)+_0x2817cf),0x1;if(!_0x5dd624['lastAttempt']?.['id'])return console[_0x2c4754(0x276)](a51_0x4bfa70['red']('Error:'),_0x2c4754(0x284)+_0x2817cf+_0x2c4754(0x295)),0x1;const _0x48f68d=_0x5dd624[_0x2c4754(0x160)]['id'];_0x52de34[_0x2c4754(0x235)]&&console[_0x2c4754(0x276)](_0x2c4754(0x214)+_0x48f68d+_0x2c4754(0x24e)+_0x2817cf);const _0x458993=_0x52de34[_0x2c4754(0x2b1)];return _0x458993?await this[_0x2c4754(0x15f)](_0x2ee1fc,_0x48f68d):await this[_0x2c4754(0x22c)](_0x2ee1fc,_0x48f68d,_0x52de34),0x0;}const _0x4a5e68=await withSpinner(_0x2c4754(0x1b9),()=>_0x105640['workflow'][_0x2c4754(0x28f)]({'projectName':_0x16d8f5,'workflowName':_0x3b9786,'limit':_0x52de34[_0x2c4754(0x1b2)]||0x32}),{'verbose':_0x52de34['verbose']}),_0x421832=_0x4a5e68[_0x2c4754(0x134)];if(_0x421832[_0x2c4754(0x28b)]===0x0){if(_0x16d8f5&&_0x3b9786)console[_0x2c4754(0x276)](_0x2c4754(0x141)+_0x16d8f5+'.'+_0x3b9786);else _0x16d8f5?console['error'](_0x2c4754(0x1a4)+_0x16d8f5):(console[_0x2c4754(0x276)](_0x2c4754(0x24b)),console['error'](a51_0x4bfa70[_0x2c4754(0x27c)]('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x421832[_0x2c4754(0x29e)]((_0x1374db,_0x4db289)=>{const _0x555af4=_0x2c4754,_0x2ebbc7=_0x1374db['sessionTime']||'',_0x4d1bd7=_0x4db289[_0x555af4(0x14b)]||'';return _0x4d1bd7[_0x555af4(0x223)](_0x2ebbc7);});if(_0x52de34[_0x2c4754(0x1ef)]||_0x52de34[_0x2c4754(0x259)])return await handleSDKOutput(_0x421832,_0x52de34),0x0;let _0x397df8;if(_0x3f9e1a){const _0x49f970=_0x421832[0x0];if(!_0x49f970['lastAttempt']?.['id'])return console[_0x2c4754(0x276)](_0x2c4754(0x185)),0x0;_0x397df8=_0x49f970['lastAttempt']['id'],_0x52de34[_0x2c4754(0x235)]&&console['error']('Auto-selected\x20latest\x20session:\x20'+_0x49f970['sessionTime']);}else{const _0x47b428=_0x421832[_0x2c4754(0x210)](_0x210c5f=>{const _0x20617b=_0x2c4754,_0x4a2b36=getAttemptStatusDisplay(_0x210c5f[_0x20617b(0x160)]);return{'title':_0x210c5f[_0x20617b(0x1ed)]?.[_0x20617b(0x14f)]+'.'+_0x210c5f[_0x20617b(0x197)]?.[_0x20617b(0x14f)]+_0x20617b(0x224)+_0x210c5f[_0x20617b(0x14b)]+'\x20'+_0x4a2b36[_0x20617b(0x211)],'value':_0x210c5f['lastAttempt']?.['id']||'','description':_0x4a2b36[_0x20617b(0x1d1)]};}),_0x1ca719=await a51_0x49f54b({'type':_0x2c4754(0x2ce),'name':'attemptId','message':_0x2c4754(0x1cd),'choices':_0x47b428['filter'](_0x1d5bf5=>_0x1d5bf5[_0x2c4754(0x17a)]!=='')});if(!_0x1ca719['attemptId'])return 0x0;_0x397df8=_0x1ca719[_0x2c4754(0x193)];}const _0x31f93f=_0x52de34[_0x2c4754(0x2b1)];return _0x31f93f?await this[_0x2c4754(0x15f)](_0x2ee1fc,_0x397df8):await this['renderSingleTimeline'](_0x2ee1fc,_0x397df8,_0x52de34),0x0;}async['renderSingleTimeline'](_0x4a9a27,_0x483fe3,_0x28b0ef){const _0x228a75=a51_0x57b8c4,{tdx:_0x169f69}=_0x4a9a27;let _0x533ccb,_0x316749;try{[_0x533ccb,_0x316749]=await Promise[_0x228a75(0x1c3)]([_0x169f69['workflow'][_0x228a75(0x1f3)](_0x483fe3),_0x169f69[_0x228a75(0x197)][_0x228a75(0x13c)](_0x483fe3,![])]);}catch(_0x1a77f8){console[_0x228a75(0x276)](a51_0x4bfa70[_0x228a75(0x14a)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x28b0ef[_0x228a75(0x235)]&&console['error'](_0x1a77f8);throw _0x1a77f8;}if(_0x28b0ef[_0x228a75(0x1ef)]||_0x28b0ef['jsonl']){const _0x7a19aa=this[_0x228a75(0x187)](_0x533ccb,_0x316749);await handleSDKOutput([_0x7a19aa],_0x28b0ef);return;}const _0x5536d7=_0x169f69[_0x228a75(0x1ab)][_0x228a75(0x12b)],_0x5dfd5b=this['renderTimeline'](_0x533ccb,_0x316749,_0x5536d7);console[_0x228a75(0x17d)](_0x5dfd5b);}async[a51_0x57b8c4(0x15f)](_0x377af3,_0x4ba695){const _0x3fd511=a51_0x57b8c4,{tdx:_0x1edee2}=_0x377af3,_0x543348=TIMELINE_CONFIG[_0x3fd511(0x240)],_0x1d13cb=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x253d22=0x0;while(_0x253d22<_0x1d13cb){process[_0x3fd511(0x2b3)][_0x3fd511(0x14d)]&&process[_0x3fd511(0x2b3)][_0x3fd511(0x239)]('\x1bc');let _0x5ac3b5,_0x5beeb0;try{[_0x5ac3b5,_0x5beeb0]=await Promise[_0x3fd511(0x1c3)]([_0x1edee2[_0x3fd511(0x197)]['attempt'](_0x4ba695),_0x1edee2[_0x3fd511(0x197)][_0x3fd511(0x13c)](_0x4ba695,![])]);}catch(_0x40dfc2){console[_0x3fd511(0x276)](a51_0x4bfa70[_0x3fd511(0x14a)](_0x3fd511(0x274)));_0x253d22>0x0&&console[_0x3fd511(0x276)](a51_0x4bfa70[_0x3fd511(0x27c)](_0x3fd511(0x120)+_0x253d22));throw _0x40dfc2;}const _0x54873c=_0x1edee2[_0x3fd511(0x1ab)][_0x3fd511(0x12b)],_0x468d00=this[_0x3fd511(0x25e)](_0x5ac3b5,_0x5beeb0,_0x54873c);console[_0x3fd511(0x17d)](_0x468d00);const _0x530bf3=_0x5ac3b5[_0x3fd511(0x178)]&&_0x5beeb0[_0x3fd511(0x23f)](_0x56139c=>_0x56139c[_0x3fd511(0x1b8)]!==_0x3fd511(0x237)&&_0x56139c['state']!=='planned');if(_0x530bf3){console[_0x3fd511(0x276)](a51_0x4bfa70[_0x3fd511(0x24d)]('\x0a✔\x20Attempt\x20complete'));break;}console['error'](a51_0x4bfa70['dim'](_0x3fd511(0x288)+_0x253d22*0x2+_0x3fd511(0x11c))),await new Promise(_0x442003=>setTimeout(_0x442003,_0x543348)),_0x253d22++;}_0x253d22>=_0x1d13cb&&console['error'](a51_0x4bfa70['yellow'](_0x3fd511(0x179)));}[a51_0x57b8c4(0x25e)](_0x11f644,_0xf231e6,_0x3f6724){const _0x5d3c29=a51_0x57b8c4,_0x348724=[],_0x3adade=TIMELINE_CONFIG[_0x5d3c29(0x19d)],_0x3f953f=0x5,_0x572de9=process[_0x5d3c29(0x2b3)]['columns']||0x78,_0xcd1bfb=_0x572de9-_0x3adade-_0x3f953f,_0x3cf370=Math[_0x5d3c29(0x17f)](TIMELINE_CONFIG[_0x5d3c29(0x227)],Math[_0x5d3c29(0x19b)](_0xcd1bfb,TIMELINE_CONFIG[_0x5d3c29(0x19a)])),_0x25876b=new Date(_0x11f644[_0x5d3c29(0x22b)])[_0x5d3c29(0x1bd)](),_0x50d120=_0x11f644[_0x5d3c29(0x234)]?new Date(_0x11f644[_0x5d3c29(0x234)])[_0x5d3c29(0x1bd)]():Date[_0x5d3c29(0x176)](),_0xd56954={'start':_0x25876b,'end':_0x50d120,'duration':_0x50d120-_0x25876b},_0x4030b7=new Map(),_0xc98224=[];for(const _0x5f04f7 of _0xf231e6){if(_0x5f04f7[_0x5d3c29(0x230)]){const _0x4c1694=new Date(_0x5f04f7[_0x5d3c29(0x230)])[_0x5d3c29(0x1bd)](),_0x1bf7a7=_0x5f04f7[_0x5d3c29(0x20f)]?new Date(_0x5f04f7[_0x5d3c29(0x20f)])[_0x5d3c29(0x1bd)]():Date[_0x5d3c29(0x176)](),_0x30ab9e={'start':_0x4c1694,'end':_0x1bf7a7,'duration':_0x1bf7a7-_0x4c1694};_0x4030b7[_0x5d3c29(0x280)](_0x5f04f7['id'],_0x30ab9e),_0xc98224[_0x5d3c29(0x145)]({'name':_0x5f04f7[_0x5d3c29(0x1cf)],'state':_0x5f04f7[_0x5d3c29(0x1b8)]||_0x5d3c29(0x1a7),'window':_0x30ab9e});}else _0xc98224['push']({'name':_0x5f04f7[_0x5d3c29(0x1cf)],'state':_0x5f04f7['state']||'planned','window':undefined});}_0xc98224[_0x5d3c29(0x29e)]((_0x45cb46,_0x308a4a)=>{const _0x19e7e2=_0x5d3c29;if(!_0x45cb46[_0x19e7e2(0x200)])return 0x1;if(!_0x308a4a[_0x19e7e2(0x200)])return-0x1;return _0x45cb46[_0x19e7e2(0x200)][_0x19e7e2(0x1bc)]-_0x308a4a[_0x19e7e2(0x200)][_0x19e7e2(0x1bc)];});const _0x4c1bea=_0xc98224[_0x5d3c29(0x28b)],_0x33aca7=_0x4c1bea>TIMELINE_CONFIG[_0x5d3c29(0x1de)];_0x33aca7&&_0xc98224[_0x5d3c29(0x29f)](TIMELINE_CONFIG[_0x5d3c29(0x1de)]);const _0x22b1b3=calculateTimeScale(_0xd56954,_0x3cf370),_0x301bb2=_0x11f644['done']?_0x11f644[_0x5d3c29(0x2be)]?a51_0x4bfa70[_0x5d3c29(0x24d)](_0x5d3c29(0x2be)):a51_0x4bfa70[_0x5d3c29(0x14a)](_0x5d3c29(0x276)):a51_0x4bfa70['blue']('running'),_0x56263c=_0x11f644['project']?.['id'],_0x17bcf9=_0x11f644[_0x5d3c29(0x18e)];let _0x168aa9;if(_0x56263c&&_0x17bcf9){const _0x3275b2=getWorkflowAttemptUrl(_0x3f6724,_0x56263c,_0x17bcf9,_0x11f644['id']);_0x168aa9=hyperlink(a51_0x4bfa70[_0x5d3c29(0x27c)](_0x11f644['id']),_0x3275b2);}else _0x168aa9=a51_0x4bfa70['dim'](_0x11f644['id']);_0x348724['push'](_0x5d3c29(0x2a5)+_0x168aa9+_0x5d3c29(0x224)+_0x301bb2+_0x5d3c29(0x224)+formatElapsed(_0xd56954[_0x5d3c29(0x13d)]));if(_0xc98224['length']>0x0){const _0x311c7f=renderTimeAxis(_0x22b1b3,_0x3cf370),_0x2c56c3=new Date(_0xd56954[_0x5d3c29(0x1bc)]),_0x4a0f7f=formatDate(_0x2c56c3),_0xa0de41=TIMELINE_CONFIG[_0x5d3c29(0x165)]+TIMELINE_CONFIG['ICON_SPACING']+_0x3adade,_0x44436a=_0x4a0f7f[_0x5d3c29(0x204)](_0xa0de41),_0x11b4b0=a51_0x4bfa70[_0x5d3c29(0x27c)](_0x44436a);_0x348724['push'](_0x11b4b0+'\x20'+_0x311c7f);for(const _0x258692 of _0xc98224){_0x348724[_0x5d3c29(0x145)](renderTaskRow(_0x258692,_0x22b1b3,_0x3cf370,_0x3adade));}const _0x255447=calculateStats(_0xc98224);_0x348724['push'](formatStats(_0x255447)),_0x33aca7&&_0x348724['push'](a51_0x4bfa70[_0x5d3c29(0x1c6)](_0x5d3c29(0x162)+TIMELINE_CONFIG[_0x5d3c29(0x1de)]+'\x20of\x20'+_0x4c1bea+_0x5d3c29(0x2c6))),_0x348724['push'](''),_0x348724[_0x5d3c29(0x145)](a51_0x4bfa70[_0x5d3c29(0x27c)]('💡\x20Tip:\x20Use\x20')+(_0x5d3c29(0x170)+_0x11f644['id']+_0x5d3c29(0x183))+a51_0x4bfa70['dim'](_0x5d3c29(0x25b)));}else _0x348724[_0x5d3c29(0x145)](_0x5d3c29(0x122));return _0x348724[_0x5d3c29(0x1a6)]('\x0a');}[a51_0x57b8c4(0x187)](_0x35b13a,_0x169ab6){const _0x28d844=a51_0x57b8c4,_0xf82e5=new Date(_0x35b13a[_0x28d844(0x22b)])[_0x28d844(0x1bd)](),_0x1f891f=_0x35b13a[_0x28d844(0x234)]?new Date(_0x35b13a[_0x28d844(0x234)])['getTime']():Date[_0x28d844(0x176)](),_0x596e95=_0x1f891f-_0xf82e5,_0xfa17a=[];for(const _0x18cd2e of _0x169ab6){if(_0x18cd2e['startedAt']){const _0x50febd=new Date(_0x18cd2e[_0x28d844(0x230)])[_0x28d844(0x1bd)](),_0x1787d2=_0x18cd2e[_0x28d844(0x20f)]?new Date(_0x18cd2e[_0x28d844(0x20f)])[_0x28d844(0x1bd)]():Date[_0x28d844(0x176)]();_0xfa17a['push']({'name':_0x18cd2e[_0x28d844(0x1cf)],'state':_0x18cd2e[_0x28d844(0x1b8)]||'unknown','window':{'start':_0x50febd,'end':_0x1787d2,'duration':_0x1787d2-_0x50febd}});}else _0xfa17a['push']({'name':_0x18cd2e[_0x28d844(0x1cf)],'state':_0x18cd2e['state']||_0x28d844(0x1d5),'window':undefined});}const _0x21791a=calculateStats(_0xfa17a);return{'attempt':{'id':_0x35b13a['id'],'status':_0x35b13a[_0x28d844(0x178)]?_0x35b13a[_0x28d844(0x2be)]?_0x28d844(0x2be):_0x28d844(0x276):_0x28d844(0x237),'createdAt':_0x35b13a['createdAt'],'finishedAt':_0x35b13a[_0x28d844(0x234)],'duration_ms':_0x596e95},'tasks':_0xfa17a[_0x28d844(0x210)](_0x7946a9=>({'name':_0x7946a9[_0x28d844(0x14f)],'state':_0x7946a9[_0x28d844(0x1b8)],'startedAt':_0x7946a9[_0x28d844(0x200)]?new Date(_0x7946a9[_0x28d844(0x200)][_0x28d844(0x1bc)])[_0x28d844(0x1e9)]():null,'updatedAt':_0x7946a9['window']?new Date(_0x7946a9[_0x28d844(0x200)]['end'])[_0x28d844(0x1e9)]():null,'duration_ms':_0x7946a9[_0x28d844(0x200)]?.[_0x28d844(0x13d)]||null})),'stats':_0x21791a};}}
|
|
1
|
+
const a51_0x22a388=a51_0x57ff;(function(_0x75908b,_0x4f2e71){const _0x510860=a51_0x57ff,_0xae360e=_0x75908b();while(!![]){try{const _0x1dd9da=parseInt(_0x510860(0x15e))/0x1+-parseInt(_0x510860(0x1ff))/0x2*(parseInt(_0x510860(0x137))/0x3)+parseInt(_0x510860(0x116))/0x4*(parseInt(_0x510860(0x185))/0x5)+-parseInt(_0x510860(0x19e))/0x6*(parseInt(_0x510860(0xc4))/0x7)+parseInt(_0x510860(0x230))/0x8*(-parseInt(_0x510860(0x16f))/0x9)+parseInt(_0x510860(0x181))/0xa*(parseInt(_0x510860(0x193))/0xb)+parseInt(_0x510860(0xfe))/0xc;if(_0x1dd9da===_0x4f2e71)break;else _0xae360e['push'](_0xae360e['shift']());}catch(_0x3a9057){_0xae360e['push'](_0xae360e['shift']());}}}(a51_0x15a1,0xb2c43));import a51_0x5bf18c from'chalk';import{existsSync}from'fs';import a51_0x108fb0 from'path';import{BaseCommand}from'./command.js';function a51_0x57ff(_0x313d8a,_0x4aa9fb){_0x313d8a=_0x313d8a-0x9a;const _0x15a1bc=a51_0x15a1();let _0x57ffb4=_0x15a1bc[_0x313d8a];return _0x57ffb4;}import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a51_0x4f4bd3 from'prompts';function getAttemptStatusDisplay(_0x36a70b){const _0x490647=a51_0x57ff;if(!_0x36a70b)return{'icon':'⏳','text':''};const {done:_0x2381d8,success:_0x5a91c8,cancelRequested:_0x3f8c7e}=_0x36a70b;if(!_0x2381d8)return _0x3f8c7e?{'icon':'🛑','text':a51_0x5bf18c['yellow'](_0x490647(0x18c))}:{'icon':'🔄','text':a51_0x5bf18c['blue'](_0x490647(0x15b))};if(_0x5a91c8)return{'icon':'✅','text':a51_0x5bf18c[_0x490647(0xf7)](_0x490647(0x179))};return{'icon':'❌','text':a51_0x5bf18c['red'](_0x490647(0xf6))};}export class WorkflowBaseCommand extends BaseCommand{[a51_0x22a388(0x202)](_0x24ac75,_0x17e688,_0x1768e9=0x0){return _0x24ac75[_0x1768e9]||_0x17e688['workflowProject'];}['requireProject'](_0x3fd8b4,_0x27de86,_0x228223=0x0){const _0x11a967=a51_0x22a388,_0x21ffd3=this['resolveProject'](_0x3fd8b4,_0x27de86,_0x228223);if(!_0x21ffd3)return console[_0x11a967(0xf6)](a51_0x5bf18c['red']('Error:'),'Project\x20name\x20is\x20required'),console[_0x11a967(0xf6)](a51_0x5bf18c['dim'](_0x11a967(0x10a))),null;return _0x21ffd3;}['parseProjectWorkflowPattern'](_0x136944,_0x640206){const _0x2be523=a51_0x22a388;if(_0x136944[0x0]){const _0x1b3948=_0x136944[0x0][_0x2be523(0x22c)]('.');if(_0x1b3948[_0x2be523(0x221)]===0x1)return{'projectName':_0x1b3948[0x0],'workflowName':undefined};else return _0x1b3948[_0x2be523(0x221)]===0x2?{'projectName':_0x1b3948[0x0],'workflowName':_0x1b3948[0x1]}:(console[_0x2be523(0xf6)](a51_0x5bf18c[_0x2be523(0xf3)](_0x2be523(0x1e0)),_0x2be523(0x13d)),null);}return{'projectName':_0x640206['workflowProject'],'workflowName':undefined};}['resolveProjectDir'](_0x590abb,_0x57a309,_0x273b87=0x0){const _0x339145=a51_0x22a388;if(_0x590abb[_0x273b87])return _0x590abb[_0x273b87];if(_0x57a309[_0x339145(0x1c1)]){const _0x221c83=a51_0x108fb0[_0x339145(0x192)](process[_0x339145(0x166)](),'workflows',_0x57a309['workflowProject']);if(existsSync(a51_0x108fb0[_0x339145(0x192)](_0x221c83,'tdx.json')))return _0x221c83;}return undefined;}async['showWorkflowConsoleUrl'](_0x46bdd0,_0xb5e62c,_0x4ece11){const _0x5f5da6=a51_0x22a388;try{const _0x14224f=await _0x46bdd0[_0x5f5da6(0x121)][_0x5f5da6(0xa7)](_0xb5e62c,{'limit':0x1});if(_0x14224f[_0x5f5da6(0x221)]>0x0){const _0x21089e=_0x14224f[0x0]['id'],_0x5865ad=getWorkflowUrl(_0x4ece11,_0x21089e);console[_0x5f5da6(0xf6)](_0x5f5da6(0xa4)+a51_0x5bf18c[_0x5f5da6(0xbb)](_0x5865ad));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x20d);[a51_0x22a388(0x1b4)]='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async[a51_0x22a388(0xd2)](_0x226f97){const _0x567a04=a51_0x22a388,{options:_0xf38846,args:_0x349c8d,tdx:_0x1ba47b}=_0x226f97,_0x1da4d4=_0x349c8d[0x0],_0x102391=_0xf38846['clear'];if(_0x102391)return saveSessionContext({'workflow_project':undefined},_0xf38846['session']),console[_0x567a04(0x204)](a51_0x5bf18c[_0x567a04(0xf7)]('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x1da4d4)return console[_0x567a04(0xf6)](a51_0x5bf18c[_0x567a04(0xf3)](_0x567a04(0x1e0)),_0x567a04(0x21b)),console['error'](a51_0x5bf18c[_0x567a04(0x1b0)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x567a04(0xf6)](a51_0x5bf18c[_0x567a04(0x1b0)](_0x567a04(0x1e7))),0x1;const _0x1f0879=await withSpinner(_0x567a04(0x1a8)+_0x1da4d4+_0x567a04(0xda),()=>_0x1ba47b[_0x567a04(0x121)][_0x567a04(0x14f)](_0x1da4d4),{'verbose':_0xf38846[_0x567a04(0xde)]}),{name:_0x17c47a}=_0x1f0879[_0x567a04(0x195)];return saveSessionContext({'workflow_project':_0x17c47a},_0xf38846['session']),console[_0x567a04(0x204)](a51_0x5bf18c[_0x567a04(0xf7)](_0x567a04(0x1e5)+a51_0x5bf18c[_0x567a04(0xbb)](_0x17c47a))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a51_0x22a388(0x147);[a51_0x22a388(0x1b4)]='List\x20all\x20workflow\x20projects';async['execute'](_0x5b25ab){const _0x1e683d=a51_0x22a388,{options:_0x45c5cc,args:_0x6e759f,tdx:_0x4e61a4}=_0x5b25ab,_0x4b686c=_0x6e759f[0x0];_0x45c5cc[_0x1e683d(0xde)]&&_0x4b686c&&console['error'](_0x1e683d(0x18d)+_0x4b686c);const _0x2bd287=await withSpinner(_0x1e683d(0x129),()=>_0x4e61a4['workflow'][_0x1e683d(0x126)](_0x4b686c,{'limit':_0x45c5cc[_0x1e683d(0xa9)]}),{'verbose':_0x45c5cc[_0x1e683d(0xde)]});let _0x4688ca=_0x2bd287[_0x1e683d(0x195)];_0x4688ca['sort']((_0x917c6b,_0x110f93)=>_0x917c6b['name'][_0x1e683d(0xa1)](_0x110f93[_0x1e683d(0x174)]));const _0x8d30fa=_0x45c5cc[_0x1e683d(0xa9)]||0x64,_0x376b5a=_0x4688ca[_0x1e683d(0x221)]>=_0x8d30fa?a51_0x5bf18c[_0x1e683d(0x1b0)](_0x1e683d(0x22a)):'';console[_0x1e683d(0xf6)]('✔\x20Found\x20'+_0x4688ca['length']+'\x20project'+(_0x4688ca[_0x1e683d(0x221)]!==0x1?'s':'')+_0x376b5a);if(_0x45c5cc[_0x1e683d(0x1d7)]===_0x1e683d(0x176)||_0x45c5cc[_0x1e683d(0x1d7)]==='jsonl'||_0x45c5cc['format']===_0x1e683d(0xd8))await handleSDKOutput(_0x4688ca,_0x45c5cc);else{if(_0x4688ca['length']===0x0)_0x4b686c?console[_0x1e683d(0x204)](_0x1e683d(0x17c)+_0x4b686c):console[_0x1e683d(0x204)](_0x1e683d(0x14c));else{const _0x2db132=_0x4688ca['map'](_0x5a5ed2=>{const _0x2bb51c=_0x1e683d,_0x585226=_0x5a5ed2[_0x2bb51c(0x24e)]?.[_0x2bb51c(0x11a)](_0x1a8afc=>_0x1a8afc[_0x2bb51c(0x1b2)]===_0x2bb51c(0x1c3)),_0x19e60f=_0x585226?a51_0x5bf18c['dim'](_0x2bb51c(0x1bc)):'';return _0x2bb51c(0x102)+_0x5a5ed2[_0x2bb51c(0x174)]+_0x19e60f;});await writeOutput(_0x2db132[_0x1e683d(0x192)]('\x0a'),_0x45c5cc['output'],_0x1e683d(0x19f));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a51_0x22a388(0x1a6);[a51_0x22a388(0x1b4)]='List\x20workflows';async[a51_0x22a388(0xd2)](_0x10a832){const _0x3378f6=a51_0x22a388,{options:_0x2910f9,args:_0x330238,tdx:_0x2fc716}=_0x10a832,_0x53a58c=this['resolveProject'](_0x330238,_0x2910f9);_0x2910f9[_0x3378f6(0xde)]&&_0x53a58c&&console[_0x3378f6(0xf6)]('Project\x20filter:\x20'+_0x53a58c);const _0x5f2776=await withSpinner('Listing\x20workflows...',()=>_0x2fc716[_0x3378f6(0x121)][_0x3378f6(0xa7)](_0x53a58c,{'limit':_0x2910f9[_0x3378f6(0xa9)]}),{'verbose':_0x2910f9[_0x3378f6(0xde)]});let _0x4b72d3=_0x5f2776[_0x3378f6(0x195)];_0x4b72d3[_0x3378f6(0x248)]((_0x3aea9c,_0x3b5aee)=>{const _0x463fa4=_0x3378f6,_0x168108=_0x3aea9c[_0x463fa4(0x174)][_0x463fa4(0xa1)](_0x3b5aee[_0x463fa4(0x174)]);if(_0x168108!==0x0)return _0x168108;return(_0x3aea9c['project']?.[_0x463fa4(0x174)]||'')[_0x463fa4(0xa1)](_0x3b5aee[_0x463fa4(0x1fe)]?.[_0x463fa4(0x174)]||'');});const _0x2f7199=_0x2910f9['limit']||0x64,_0x3c3822=_0x4b72d3[_0x3378f6(0x221)]>=_0x2f7199?a51_0x5bf18c[_0x3378f6(0x1b0)](_0x3378f6(0x22a)):'';console[_0x3378f6(0xf6)](_0x3378f6(0x17a)+_0x4b72d3['length']+'\x20workflow'+(_0x4b72d3['length']!==0x1?'s':'')+_0x3c3822);if(_0x2910f9[_0x3378f6(0x1d7)]==='json'||_0x2910f9['format']==='jsonl'||_0x2910f9[_0x3378f6(0x1d7)]===_0x3378f6(0xd8))await handleSDKOutput(_0x4b72d3,_0x2910f9);else{if(_0x4b72d3[_0x3378f6(0x221)]===0x0)_0x53a58c?console['log'](_0x3378f6(0x122)+_0x53a58c):console[_0x3378f6(0x204)]('No\x20workflows\x20found');else{const _0x13ccf4=_0x2910f9[_0x3378f6(0x1e3)],_0x2109b4=_0x4b72d3[_0x3378f6(0x1de)](_0x3c3668=>{const _0x57915e=_0x3378f6,_0x196327=a51_0x5bf18c['dim']('#'+_0x3c3668['id']),_0x26e025=hyperlink(_0x196327,getWorkflowUrl(_0x13ccf4,_0x3c3668['id'])),_0xc6b819=_0x3c3668[_0x57915e(0x1fe)]?.[_0x57915e(0x174)]?a51_0x5bf18c[_0x57915e(0x1b0)]('\x20('+_0x3c3668['project']['name']+')'):'';return _0x57915e(0x13c)+_0x26e025+'\x20'+_0x3c3668[_0x57915e(0x174)]+_0xc6b819;});await writeOutput(_0x2109b4[_0x3378f6(0x192)]('\x0a'),_0x2910f9[_0x3378f6(0x1fd)],_0x3378f6(0x19f));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0xa6);[a51_0x22a388(0x1b4)]='List\x20workflow\x20execution\x20sessions';async['execute'](_0x3c7144){const _0x49c80e=a51_0x22a388,{options:_0x3b3da4,args:_0x4f6e13,tdx:_0x1a70ed}=_0x3c7144,_0x2301c1=this[_0x49c80e(0x227)](_0x4f6e13,_0x3b3da4);if(!_0x2301c1)return 0x1;const {projectName:_0x3f24cb,workflowName:_0x45ee48}=_0x2301c1;if(_0x3b3da4['verbose']){if(_0x3f24cb&&_0x45ee48)console['error']('Filter:\x20'+_0x3f24cb+'.'+_0x45ee48);else _0x3f24cb&&console[_0x49c80e(0xf6)]('Filter:\x20project='+_0x3f24cb);const _0x3858f2=_0x3b3da4[_0x49c80e(0x196)];_0x3858f2&&console[_0x49c80e(0xf6)](_0x49c80e(0x22d)+_0x3858f2);}let _0x499bad=0x28;if(process[_0x49c80e(0x20b)]['isTTY']&&!_0x3b3da4[_0x49c80e(0x1fd)]&&!_0x3b3da4[_0x49c80e(0x1d7)]){const _0x29ee0f=process[_0x49c80e(0x20b)]['rows']||0x28;_0x499bad=Math[_0x49c80e(0x170)](0x14,Math[_0x49c80e(0xdd)](_0x29ee0f*0x2/0x3));}const _0x1235c1=_0x3b3da4[_0x49c80e(0xa9)]||_0x499bad,_0x290083=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x1a70ed[_0x49c80e(0x121)]['sessions']({'projectName':_0x3f24cb,'workflowName':_0x45ee48,'status':_0x3b3da4[_0x49c80e(0x196)],'fromTime':_0x3b3da4[_0x49c80e(0x111)],'toTime':_0x3b3da4['to'],'limit':_0x1235c1}),{'verbose':_0x3b3da4['verbose']}),_0x467f6a=_0x290083[_0x49c80e(0x195)];_0x467f6a[_0x49c80e(0x248)]((_0x4d7a18,_0x2615fc)=>{const _0x20fcd4=_0x49c80e,_0xa38de3=_0x4d7a18[_0x20fcd4(0x16a)]||'',_0xff59f9=_0x2615fc[_0x20fcd4(0x16a)]||'';return _0xff59f9[_0x20fcd4(0xa1)](_0xa38de3);});_0x467f6a[_0x49c80e(0x221)]>=_0x1235c1?console['error']('✔\x20Showing\x20'+_0x467f6a[_0x49c80e(0x221)]+_0x49c80e(0x1df)+a51_0x5bf18c[_0x49c80e(0x1b0)](_0x49c80e(0x1b1))):console['error'](_0x49c80e(0x17a)+_0x467f6a[_0x49c80e(0x221)]+_0x49c80e(0x165)+(_0x467f6a['length']!==0x1?'s':''));if(_0x3b3da4['format']===_0x49c80e(0x176)||_0x3b3da4[_0x49c80e(0x1d7)]===_0x49c80e(0x201)||_0x3b3da4['format']===_0x49c80e(0xd8))await handleSDKOutput(_0x467f6a,_0x3b3da4);else{if(!process['stdout']['isTTY']||_0x3b3da4[_0x49c80e(0x1fd)]){if(_0x467f6a[_0x49c80e(0x221)]===0x0){if(_0x3f24cb&&_0x45ee48)console[_0x49c80e(0x204)](_0x49c80e(0x177)+_0x3f24cb+'.'+_0x45ee48);else _0x3f24cb?console[_0x49c80e(0x204)](_0x49c80e(0x19d)+_0x3f24cb):console[_0x49c80e(0x204)](_0x49c80e(0x188));}else{const _0x3ea174=_0x3b3da4[_0x49c80e(0x1e3)],_0x5245b5=this[_0x49c80e(0xad)](_0x467f6a,_0x3ea174);_0x3b3da4[_0x49c80e(0x1fd)]?await writeOutput(_0x5245b5,_0x3b3da4[_0x49c80e(0x1fd)],_0x49c80e(0x19f)):console[_0x49c80e(0x204)](_0x5245b5);}!_0x3f24cb&&(console[_0x49c80e(0xf6)](''),console[_0x49c80e(0xf6)](a51_0x5bf18c['dim'](_0x49c80e(0x9d))),console[_0x49c80e(0xf6)](a51_0x5bf18c[_0x49c80e(0x1b0)](_0x49c80e(0x104))+'or'+a51_0x5bf18c[_0x49c80e(0x1b0)](_0x49c80e(0x229))));}else{if(_0x467f6a[_0x49c80e(0x221)]===0x0){if(_0x3f24cb&&_0x45ee48)console[_0x49c80e(0x204)](_0x49c80e(0x177)+_0x3f24cb+'.'+_0x45ee48);else _0x3f24cb?console[_0x49c80e(0x204)](_0x49c80e(0x19d)+_0x3f24cb):console[_0x49c80e(0x204)](_0x49c80e(0x188));}else await this['navigateSessionsInteractive'](_0x467f6a,_0x3c7144,_0x3f24cb);}}return 0x0;}[a51_0x22a388(0xad)](_0x229df5,_0x52968b){const _0x4ec16b=a51_0x22a388,_0x2eb8a1=[],_0x2be67f=new Map();let _0x9749ba=Infinity,_0x138cc8=-Infinity;for(const _0x1dad8f of _0x229df5){if(_0x1dad8f[_0x4ec16b(0x225)]?.[_0x4ec16b(0x151)]){const _0x3ca8cc=new Date(_0x1dad8f[_0x4ec16b(0x225)][_0x4ec16b(0x151)])[_0x4ec16b(0x1dc)](),_0x4202b9=_0x1dad8f[_0x4ec16b(0x225)]['finishedAt']?new Date(_0x1dad8f[_0x4ec16b(0x225)]['finishedAt'])[_0x4ec16b(0x1dc)]():Date[_0x4ec16b(0x23d)](),_0x76fdb3=_0x1dad8f[_0x4ec16b(0x1fe)]?.[_0x4ec16b(0x174)]||_0x4ec16b(0x22e);!_0x2be67f['has'](_0x76fdb3)&&_0x2be67f[_0x4ec16b(0x9a)](_0x76fdb3,[]),_0x2be67f[_0x4ec16b(0x17f)](_0x76fdb3)[_0x4ec16b(0x11e)]({'session':_0x1dad8f,'startTime':_0x3ca8cc,'endTime':_0x4202b9,'duration':_0x4202b9-_0x3ca8cc}),_0x9749ba=Math[_0x4ec16b(0x13a)](_0x9749ba,_0x3ca8cc),_0x138cc8=Math[_0x4ec16b(0x170)](_0x138cc8,_0x4202b9);}}if(_0x2be67f[_0x4ec16b(0x200)]===0x0)return _0x4ec16b(0x158);const _0x15d624=process[_0x4ec16b(0x20b)][_0x4ec16b(0x1e8)]||0x78,_0x537347=0x1e,_0x5dd3ee=0x32,_0xf58b3e=0x4,_0x20e46e=Math['min'](_0x5dd3ee,Math['max'](_0x537347,Math['floor'](_0x15d624*0.3))),_0x47e3ac=_0x15d624-_0x20e46e-TIMELINE_CONFIG[_0x4ec16b(0x220)]-0x3-_0xf58b3e,_0x3fd18f=_0x138cc8-_0x9749ba,_0x259096=_0x3fd18f/_0x20e46e,_0x10feb2=renderTimeAxis({'startTime':_0x9749ba,'endTime':_0x138cc8,'durationMs':_0x3fd18f,'msPerChar':_0x259096},_0x20e46e),_0x8b9f55=[];for(const _0x41d84a of _0x2be67f[_0x4ec16b(0x1d1)]()){_0x8b9f55['push'](..._0x41d84a);}_0x8b9f55[_0x4ec16b(0x248)]((_0x474e84,_0x538a67)=>_0x538a67[_0x4ec16b(0x240)]-_0x474e84[_0x4ec16b(0x240)]);const _0x5de4b5=new Date(_0x9749ba),_0x937d29=formatDate(_0x5de4b5),_0x597698=_0xf58b3e+TIMELINE_CONFIG[_0x4ec16b(0x1ae)]+TIMELINE_CONFIG['ICON_SPACING']+_0x47e3ac,_0xe29f27='\x20'['repeat'](_0x597698-_0x937d29['length']),_0x20065c=_0xe29f27+a51_0x5bf18c['dim'](_0x937d29)+'\x20'+_0x10feb2;_0x2eb8a1[_0x4ec16b(0x11e)](_0x20065c);const _0x3de083=0x16;let _0x433b5f=0x0;for(const _0x52044f of _0x8b9f55){const _0x139925=_0x52044f['session'][_0x4ec16b(0x1fe)]?.[_0x4ec16b(0x174)]||'?',_0x3d3b0e=Math[_0x4ec16b(0x13a)](stringWidth(_0x139925),_0x3de083);_0x433b5f=Math[_0x4ec16b(0x170)](_0x433b5f,_0x3d3b0e);}for(const _0x2473d0 of _0x8b9f55){const {session:_0x448cb7,startTime:_0x7f78ea,endTime:_0x2d5f10,duration:_0x89bf09}=_0x2473d0,_0x3d1f64=_0x448cb7[_0x4ec16b(0x1fe)]?.['id'],_0x44f96f=_0x448cb7['id'],_0x14f1bc=_0x448cb7[_0x4ec16b(0x1fe)]?.['name']||'?',_0x46b834=_0x448cb7[_0x4ec16b(0x121)]?.['name']||'?';let _0x1768b2,_0x114a89;if(_0x448cb7[_0x4ec16b(0x225)]){const _0x56742b=_0x448cb7[_0x4ec16b(0x225)];!_0x56742b[_0x4ec16b(0xe1)]?(_0x1768b2=_0x56742b[_0x4ec16b(0x1d4)]?'🛑':'🔄',_0x114a89=_0x56742b['cancelRequested']?a51_0x5bf18c[_0x4ec16b(0xfc)]:a51_0x5bf18c[_0x4ec16b(0x1ed)]):(_0x1768b2=_0x56742b['success']?'✅':'❌',_0x114a89=_0x56742b[_0x4ec16b(0x179)]?a51_0x5bf18c[_0x4ec16b(0xf7)]:a51_0x5bf18c[_0x4ec16b(0xf3)]);}else _0x1768b2='⏳',_0x114a89=a51_0x5bf18c[_0x4ec16b(0x1b0)];const _0x35c99a='#'+_0x44f96f,_0xa9cba1=_0x3d1f64?hyperlink(_0x35c99a,getWorkflowSessionUrl(_0x52968b,_0x3d1f64,_0x44f96f)):_0x35c99a;let _0x1fd997=_0x14f1bc;stringWidth(_0x14f1bc)>_0x3de083&&(_0x1fd997=_0x14f1bc[_0x4ec16b(0xe9)](0x0,_0x3de083-0x1)+'…');const _0x4dc9a8=a51_0x5bf18c[_0x4ec16b(0x1b0)](_0x1fd997),_0x4e1dd3=stringWidth(_0x1fd997),_0x191655='\x20'['repeat'](_0x433b5f-stringWidth(_0x1fd997)+0x2),_0x59926d='('+formatElapsed(_0x89bf09)+')',_0x262cfe=stringWidth(_0x59926d),_0xa3231f=stringWidth(_0x35c99a),_0x7109a5=_0xa3231f+0x1+_0x4e1dd3+_0x191655[_0x4ec16b(0x221)],_0x2c7970=_0x47e3ac-_0x7109a5-_0x262cfe-0x1-0x8;let _0x21c14a=_0x46b834;stringWidth(_0x21c14a)>_0x2c7970&&(_0x21c14a=_0x21c14a[_0x4ec16b(0xe9)](0x0,_0x2c7970-0x1)+'…');const _0x2381d9=_0xa9cba1+'\x20'+_0x4dc9a8+_0x191655+_0x21c14a,_0x3d2da6=stringWidth(_0x2381d9),_0x48ba72=_0x47e3ac-_0x3d2da6-_0x262cfe,_0x228462=_0x2381d9+'\x20'[_0x4ec16b(0x245)](Math['max'](0x1,_0x48ba72))+a51_0x5bf18c['dim'](_0x59926d),_0x24c29d=Math['floor']((_0x7f78ea-_0x9749ba)/_0x259096),_0x18afb7=Math[_0x4ec16b(0xdd)]((_0x2d5f10-_0x9749ba)/_0x259096),_0x24dd63=Math['max'](_0x24c29d+0x1,_0x18afb7),_0x3fe6ec=new Array(_0x20e46e)[_0x4ec16b(0x113)]('\x20');for(let _0x2e5e06=_0x24c29d;_0x2e5e06<Math['min'](_0x24dd63,_0x20e46e);_0x2e5e06++){_0x3fe6ec[_0x2e5e06]='─';}const _0x543fa8=_0x3fe6ec[_0x4ec16b(0x1de)](_0x4de6e3=>_0x4de6e3==='\x20'?'\x20':_0x114a89(_0x4de6e3))[_0x4ec16b(0x192)]('');_0x2eb8a1[_0x4ec16b(0x11e)](_0x1768b2+'\x20'+_0x228462+'│'+_0x543fa8+'│');}return _0x2eb8a1[_0x4ec16b(0x192)]('\x0a');}async[a51_0x22a388(0x241)](_0x3c74e5,_0x3d69df,_0x185e5f){const _0x4f93e2=a51_0x22a388,{options:_0x3456a1,tdx:_0x38e950}=_0x3d69df,_0x3300ad=_0x3456a1['site'],{timelineRows:_0x366dd7,timeAxisHeader:_0x3a62d7}=this['generateSessionTimelineRows'](_0x3c74e5,_0x3300ad),_0x111350=_0x366dd7[_0x4f93e2(0x183)](_0x41417b=>_0x41417b['attemptId']);if(_0x111350[_0x4f93e2(0x221)]===0x0){const _0x5d0d5e=this['renderSessionsTimeline'](_0x3c74e5,_0x3300ad);console[_0x4f93e2(0x204)](_0x5d0d5e);!_0x185e5f&&(console[_0x4f93e2(0xf6)](''),console[_0x4f93e2(0xf6)](a51_0x5bf18c[_0x4f93e2(0x1b0)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console['error'](a51_0x5bf18c[_0x4f93e2(0x1b0)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a51_0x5bf18c[_0x4f93e2(0x1b0)](_0x4f93e2(0x229))));return;}_0x3a62d7&&console[_0x4f93e2(0x204)](_0x3a62d7);const _0x2439c9=_0x366dd7['filter'](_0xb911bf=>_0xb911bf['attemptId'])['map'](_0x3c8d27=>({'title':_0x3c8d27[_0x4f93e2(0x231)],'value':_0x3c8d27[_0x4f93e2(0x173)]})),_0xa5005b=process[_0x4f93e2(0x20b)]['rows']||0x3c,_0x185de9=Math[_0x4f93e2(0x170)](0x28,Math[_0x4f93e2(0xdd)](_0xa5005b*0x2/0x3)),_0x503c90=await a51_0x4f4bd3({'type':_0x4f93e2(0x1b5),'name':_0x4f93e2(0x173),'message':_0x4f93e2(0xec),'choices':_0x2439c9,'initial':-0x1,'limit':_0x185de9,'clearFirst':!![],'fallback':{'title':_0x4f93e2(0xf1),'value':null},'suggest':(_0x1639bb,_0x1cb561)=>{const _0x510388=_0x4f93e2;if(!_0x1639bb)return Promise['resolve'](_0x1cb561);const _0x5cd9f3=_0x1cb561[_0x510388(0x183)](_0x43e407=>{const _0x235d15=_0x510388,_0x3d4a7d=_0x43e407;return _0x3d4a7d['title'][_0x235d15(0x14b)]()['includes'](_0x1639bb[_0x235d15(0x14b)]());});return Promise[_0x510388(0x154)](_0x5cd9f3);}}),_0x1843b7=()=>{const _0x1e9724=_0x4f93e2;process[_0x1e9724(0x20b)][_0x1e9724(0xbc)](_0x1e9724(0x1f1)),process[_0x1e9724(0x20b)][_0x1e9724(0xbc)](_0x1e9724(0x1f1)),process[_0x1e9724(0x20b)][_0x1e9724(0xbc)]('\x1b[1A\x1b[2K');},_0x5aa09d=_0x503c90&&_0x503c90[_0x4f93e2(0x173)]&&_0x503c90[_0x4f93e2(0x173)]!==null&&_0x503c90[_0x4f93e2(0x173)][_0x4f93e2(0xf4)]()!=='';if(!_0x5aa09d){_0x1843b7(),console['log'](a51_0x5bf18c[_0x4f93e2(0x1b0)](_0x4f93e2(0x1cb)));return;}_0x1843b7();const _0x257f1c=_0x3c74e5[_0x4f93e2(0x20e)](_0x1feca3=>_0x1feca3[_0x4f93e2(0x225)]?.['id']===_0x503c90['attemptId']);if(_0x257f1c){const _0x22959d=_0x257f1c[_0x4f93e2(0x1fe)]?.[_0x4f93e2(0x174)]||'?',_0x13666c=_0x257f1c[_0x4f93e2(0x121)]?.['name']||'?';console['log'](_0x4f93e2(0xba)+a51_0x5bf18c[_0x4f93e2(0x1b0)](_0x22959d)+_0x4f93e2(0x15c)+a51_0x5bf18c[_0x4f93e2(0x1b0)](_0x13666c));}const _0x34db10=new WorkflowTimelineCommand();await _0x34db10[_0x4f93e2(0xd2)]({'args':[],'options':{..._0x3456a1,'attemptId':_0x503c90[_0x4f93e2(0x173)]},'tdx':_0x38e950});}['generateSessionTimelineRows'](_0xeb1370,_0x2f648d){const _0x19d985=a51_0x22a388,_0x52b80b=new Map();for(const _0x5d25a2 of _0xeb1370){_0x5d25a2['id']&&_0x5d25a2[_0x19d985(0x225)]?.['id']&&_0x52b80b['set'](_0x5d25a2['id'],_0x5d25a2[_0x19d985(0x225)]['id']);}const _0x33e3c0=[];let _0x3e713d='';const _0x48b4e2=this['renderSessionsTimeline'](_0xeb1370,_0x2f648d),_0x13cea5=_0x48b4e2[_0x19d985(0x22c)]('\x0a');for(const _0x3cf390 of _0x13cea5){if(_0x3cf390[_0x19d985(0xb5)](_0x19d985(0x23c))||_0x3cf390[_0x19d985(0x239)](/^\s+\d{4}-\d{2}-\d{2}/))_0x3e713d=_0x3cf390;else{if(_0x3cf390[_0x19d985(0x239)](/^[✅❌🔄🛑⏳]/)){const _0x1956da=_0x3cf390[_0x19d985(0x239)](/#(\d+)/),_0x2e5eb5=_0x1956da?_0x1956da[0x1]:null,_0x29decc=_0x2e5eb5?_0x52b80b['get'](_0x2e5eb5)||null:null,_0x42ccf1=_0xeb1370[_0x19d985(0x20e)](_0x126381=>_0x126381['id']===_0x2e5eb5),_0x4137d4=_0x42ccf1?.[_0x19d985(0x1fe)]?.[_0x19d985(0x174)]||'';_0x33e3c0[_0x19d985(0x11e)]({'displayLine':_0x3cf390,'attemptId':_0x29decc,'projectName':_0x4137d4});}}}return{'timelineRows':_0x33e3c0,'timeAxisHeader':_0x3e713d};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x1c7);[a51_0x22a388(0x1b4)]=a51_0x22a388(0x228);async[a51_0x22a388(0xd2)](_0x53799c){const _0x29a342=a51_0x22a388,{options:_0x3481fb,args:_0x3e5d36,tdx:_0x40ee2f}=_0x53799c,_0x82ea0c=this[_0x29a342(0x227)](_0x3e5d36,_0x3481fb);if(!_0x82ea0c)return 0x1;const {projectName:_0x537b6e,workflowName:_0x6d281b}=_0x82ea0c,_0x27f90a=_0x3481fb[_0x29a342(0xcf)];if(_0x3481fb[_0x29a342(0xde)]){if(_0x537b6e&&_0x6d281b)console[_0x29a342(0xf6)](_0x29a342(0x140)+_0x537b6e+'.'+_0x6d281b);else _0x537b6e&&console[_0x29a342(0xf6)](_0x29a342(0x123)+_0x537b6e);_0x27f90a&&console[_0x29a342(0xf6)](_0x29a342(0xd3));}const _0x15ae3d=await withSpinner(_0x29a342(0x13e),()=>_0x40ee2f[_0x29a342(0x121)][_0x29a342(0x103)]({'projectName':_0x537b6e,'workflowName':_0x6d281b,'includeRetried':_0x27f90a,'limit':_0x3481fb[_0x29a342(0xa9)]}),{'verbose':_0x3481fb['verbose']}),_0x241427=_0x15ae3d[_0x29a342(0x195)],_0xf6f20e=_0x3481fb[_0x29a342(0xa9)]||0x64,_0x47ab46=_0x241427[_0x29a342(0x221)]>=_0xf6f20e?a51_0x5bf18c[_0x29a342(0x1b0)](_0x29a342(0x22a)):'';console[_0x29a342(0xf6)]('✔\x20Found\x20'+_0x241427['length']+'\x20attempt'+(_0x241427[_0x29a342(0x221)]!==0x1?'s':'')+_0x47ab46);if(_0x3481fb['format']===_0x29a342(0x176)||_0x3481fb[_0x29a342(0x1d7)]===_0x29a342(0x201)||_0x3481fb[_0x29a342(0x1d7)]===_0x29a342(0xd8))await handleSDKOutput(_0x241427,_0x3481fb);else{if(_0x241427[_0x29a342(0x221)]===0x0){if(_0x537b6e&&_0x6d281b)console[_0x29a342(0x204)](_0x29a342(0x138)+_0x537b6e+'.'+_0x6d281b);else _0x537b6e?console['log']('No\x20attempts\x20found\x20in\x20project:\x20'+_0x537b6e):console[_0x29a342(0x204)](_0x29a342(0x142));}else{const _0x3be5ae=_0x3481fb[_0x29a342(0x1e3)],_0x3b3173=_0x241427[_0x29a342(0x1de)](_0xc3e028=>{const _0x5b865b=_0x29a342,_0x4379cc=a51_0x5bf18c[_0x5b865b(0x1b0)]('#'+_0xc3e028['id']),_0x25a21a=_0xc3e028[_0x5b865b(0x1fe)]?.['id'],_0x5a9cff=_0xc3e028[_0x5b865b(0x131)]||_0xc3e028[_0x5b865b(0x214)],_0x22a284=_0x25a21a&&_0x5a9cff?hyperlink(_0x4379cc,getWorkflowAttemptUrl(_0x3be5ae,_0x25a21a,_0x5a9cff,_0xc3e028['id'])):_0x4379cc,{icon:_0x16655a,text:_0x3288f4}=getAttemptStatusDisplay(_0xc3e028),_0x4f26e7=(_0xc3e028[_0x5b865b(0x1fe)]?.[_0x5b865b(0x174)]||'?')+'.'+(_0xc3e028[_0x5b865b(0x121)]?.[_0x5b865b(0x174)]||'?'),_0x3e02e0=_0xc3e028['sessionTime']?a51_0x5bf18c[_0x5b865b(0x1b0)](_0xc3e028[_0x5b865b(0x16a)]):'';return(_0x22a284+'\x20'+_0x16655a+(_0x3288f4?'\x20'+_0x3288f4:'')+'\x20'+_0x4f26e7+'\x20'+_0x3e02e0)[_0x5b865b(0x101)]();});await writeOutput(_0x3b3173[_0x29a342(0x192)]('\x0a'),_0x3481fb['output'],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']='workflow:attempt';[a51_0x22a388(0x1b4)]=a51_0x22a388(0x22f);async[a51_0x22a388(0xd2)](_0x4824a6){const _0x239b40=a51_0x22a388,{options:_0x44c040,args:_0x569136,tdx:_0x266b9d}=_0x4824a6,_0x3a5da1=_0x569136[0x0];if(!_0x3a5da1)return console[_0x239b40(0xf6)](_0x239b40(0x20c)),0x1;_0x44c040['verbose']&&console[_0x239b40(0xf6)]('Attempt\x20ID:\x20'+_0x3a5da1);const _0x2fe496=await withSpinner(_0x239b40(0x19c),()=>_0x266b9d[_0x239b40(0x121)][_0x239b40(0xfa)](_0x3a5da1),{'verbose':_0x44c040['verbose']}),_0x5f206c=_0x2fe496[_0x239b40(0x195)];let _0x32ee6e;!_0x5f206c['done']?_0x32ee6e=_0x5f206c[_0x239b40(0x1d4)]?_0x239b40(0x18c):_0x239b40(0x15b):_0x32ee6e=_0x5f206c[_0x239b40(0x179)]?_0x239b40(0x179):'error';let _0x156f81;if(_0x5f206c['createdAt']&&_0x5f206c[_0x239b40(0x1d3)]){const _0x3ee70e=new Date(_0x5f206c[_0x239b40(0x151)])[_0x239b40(0x1dc)](),_0x3c74a3=new Date(_0x5f206c['finishedAt'])[_0x239b40(0x1dc)]();_0x156f81=Math[_0x239b40(0x12d)]((_0x3c74a3-_0x3ee70e)/0x3e8);}const _0xf1a3df={'attempt_id':_0x5f206c['id'],'status':_0x32ee6e,..._0x5f206c[_0x239b40(0x1e4)]!==undefined&&{'index':_0x5f206c[_0x239b40(0x1e4)]},..._0x5f206c['project']&&{'project':_0x5f206c[_0x239b40(0x1fe)][_0x239b40(0x174)]},..._0x5f206c['workflow']&&{'workflow':_0x5f206c[_0x239b40(0x121)][_0x239b40(0x174)]},..._0x5f206c[_0x239b40(0x214)]&&{'session_id':_0x5f206c[_0x239b40(0x214)]},..._0x5f206c['sessionTime']&&{'session_time':_0x5f206c[_0x239b40(0x16a)]},..._0x5f206c[_0x239b40(0x21c)]&&{'retry_attempt':_0x5f206c['retryAttemptName']},..._0x156f81!==undefined&&{'duration_sec':_0x156f81},..._0x5f206c['createdAt']&&{'created_at':_0x5f206c[_0x239b40(0x151)]},..._0x5f206c[_0x239b40(0x1d3)]&&{'finished_at':_0x5f206c[_0x239b40(0x1d3)]},...Object[_0x239b40(0x244)](_0x5f206c[_0x239b40(0xb8)])[_0x239b40(0x221)]>0x0&&{'params':_0x5f206c[_0x239b40(0xb8)]}};return await handleSingleObjectOutput(_0xf1a3df,_0x44c040),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a51_0x22a388(0x174)]='workflow:tasks';['description']=a51_0x22a388(0xbd);async['execute'](_0x414455){const _0x364dcc=a51_0x22a388,{options:_0x3079a5,args:_0x5e3b07,tdx:_0x27e550}=_0x414455,_0x8bae87=_0x5e3b07[0x0];if(!_0x8bae87)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x52d603=_0x3079a5['includeSubtasks'];_0x3079a5[_0x364dcc(0xde)]&&(console[_0x364dcc(0xf6)](_0x364dcc(0x1ec)+_0x8bae87),_0x52d603&&console[_0x364dcc(0xf6)]('Including\x20subtasks:\x20yes'));const _0x28073b=await withSpinner(_0x364dcc(0x106),()=>_0x27e550[_0x364dcc(0x121)]['tasks'](_0x8bae87,_0x52d603||![]),{'verbose':_0x3079a5[_0x364dcc(0xde)]}),_0x17bbd7=_0x28073b[_0x364dcc(0x195)];return console['error'](_0x364dcc(0x17a)+_0x17bbd7[_0x364dcc(0x221)]+_0x364dcc(0xb7)+(_0x17bbd7['length']!==0x1?'s':'')),await handleSDKOutput(_0x17bbd7,_0x3079a5),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x1f2);[a51_0x22a388(0x1b4)]=a51_0x22a388(0xce);async[a51_0x22a388(0xd2)](_0x989bf6){const _0x226a9d=a51_0x22a388,{options:_0x443793,args:_0x4990c4,tdx:_0x4fd3a7}=_0x989bf6,_0x29d231=_0x4990c4[0x0];let _0xd40c28=_0x4990c4[0x1];if(!_0x29d231)return console['error'](_0x226a9d(0x20c)),0x1;_0x443793['verbose']&&(console[_0x226a9d(0xf6)]('Attempt\x20ID:\x20'+_0x29d231),_0xd40c28&&console[_0x226a9d(0xf6)](_0x226a9d(0x1c6)+_0xd40c28));const _0x262e93=await withSpinner(_0x226a9d(0x15a),()=>_0x4fd3a7[_0x226a9d(0x121)][_0x226a9d(0xaf)](_0x29d231,_0xd40c28),{'verbose':_0x443793[_0x226a9d(0xde)]}),_0x3cee2b=_0x262e93[_0x226a9d(0x195)];if(_0x3cee2b[_0x226a9d(0x221)]===0x0)return console['error'](_0x226a9d(0x12c)),0x0;if(!_0xd40c28&&(_0x443793[_0x226a9d(0x176)]||_0x443793[_0x226a9d(0x1d7)]))return await handleSDKOutput(_0x3cee2b,_0x443793),0x0;if(!_0xd40c28){const _0x16b476=_0x3cee2b[_0x226a9d(0x1de)](_0x550546=>({'title':_0x550546[_0x226a9d(0x146)]+'\x20('+formatBytes(_0x550546[_0x226a9d(0x1ce)])+')','value':_0x550546[_0x226a9d(0x146)]})),_0xbcb466=await a51_0x4f4bd3({'type':_0x226a9d(0xff),'name':_0x226a9d(0x1f4),'message':_0x226a9d(0x152),'choices':_0x16b476});if(!_0xbcb466['task'])return console[_0x226a9d(0xf6)](_0x226a9d(0x1cb)),0x0;_0xd40c28=_0xbcb466[_0x226a9d(0x1f4)];}const _0x1b4b70=await withSpinner('Downloading\x20logs...',()=>_0x4fd3a7[_0x226a9d(0x121)][_0x226a9d(0x1bd)](_0x29d231,_0xd40c28),{'verbose':_0x443793['verbose']}),_0x29d7b7=_0x1b4b70[_0x226a9d(0x195)];return _0x29d7b7?console[_0x226a9d(0x204)](_0x29d7b7):console['error']('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x1ad);[a51_0x22a388(0x1b4)]=a51_0x22a388(0x24c);async[a51_0x22a388(0xd2)](_0x53ee6a){const _0x2c64b5=a51_0x22a388,{options:_0x5af752,args:_0x40db3a,tdx:_0x1297b0}=_0x53ee6a,_0x5b931b=_0x40db3a[0x0];if(!_0x5b931b)return console[_0x2c64b5(0xf6)](_0x2c64b5(0x20c)),0x1;const _0x28969d=_0x5af752[_0x2c64b5(0x23e)];_0x5af752[_0x2c64b5(0xde)]&&(console[_0x2c64b5(0xf6)](_0x2c64b5(0x1ec)+_0x5b931b),_0x28969d&&console[_0x2c64b5(0xf6)]('Reason:\x20'+_0x28969d));if(!_0x5af752[_0x2c64b5(0x117)]){if(!isInteractive())return console[_0x2c64b5(0xf6)](a51_0x5bf18c[_0x2c64b5(0xf3)]('\x0aError:'),_0x2c64b5(0x23f)),console[_0x2c64b5(0xf6)](a51_0x5bf18c[_0x2c64b5(0x1b0)](_0x2c64b5(0x119))),0x1;const _0x4ba5db=await confirmKey(_0x2c64b5(0x175)+_0x5b931b+'?');if(!_0x4ba5db)return console[_0x2c64b5(0xf6)](a51_0x5bf18c[_0x2c64b5(0xfc)]('Cancelled')),0x1;}const _0x3e9b77=await withSpinner(_0x2c64b5(0xc8),()=>_0x1297b0[_0x2c64b5(0x121)][_0x2c64b5(0x208)](_0x5b931b,_0x28969d),{'verbose':_0x5af752[_0x2c64b5(0xde)]}),_0x47a1b6=_0x3e9b77['data'];return console['error']('✔\x20'+_0x47a1b6),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x114);[a51_0x22a388(0x1b4)]=a51_0x22a388(0xb9);async['execute'](_0x5d675d){const _0x8de37a=a51_0x22a388,{options:_0x3e009a,args:_0x148bd4,tdx:_0xf3834c}=_0x5d675d,_0xb7674f=_0x148bd4[0x0];if(!_0xb7674f)return console['error'](_0x8de37a(0x237)),console[_0x8de37a(0xf6)](_0x8de37a(0xe4)),0x1;let _0x4c1d01=![],_0x2d171e=_0xb7674f;if(_0xb7674f[_0x8de37a(0xb5)](_0x8de37a(0x1c4)))_0x4c1d01=!![],_0x2d171e=_0xb7674f[_0x8de37a(0x24a)](0x8);else{if(_0xb7674f[_0x8de37a(0xb5)]('attempt:'))_0x4c1d01=![],_0x2d171e=_0xb7674f[_0x8de37a(0x24a)](0x8);else return console[_0x8de37a(0xf6)](_0x8de37a(0x222)),console[_0x8de37a(0xf6)](_0x8de37a(0xe4)),0x1;}const _0x3d8a8c=_0x3e009a[_0x8de37a(0x1e6)],_0x370553=_0x3e009a[_0x8de37a(0xac)],_0x40d8d8=_0x3e009a[_0x8de37a(0xb8)],_0x1cd0c2=_0x3e009a[_0x8de37a(0x211)];_0x3e009a[_0x8de37a(0xde)]&&(console['error'](_0x8de37a(0x197)+(_0x4c1d01?_0x8de37a(0xe7):_0x8de37a(0xfa))+'\x20'+_0x2d171e),_0x3d8a8c&&console['error'](_0x8de37a(0x238)+_0x3d8a8c),_0x370553&&console['error'](_0x8de37a(0x1ba)+_0x370553),_0x40d8d8&&console[_0x8de37a(0xf6)]('Params:\x20'+_0x40d8d8),_0x1cd0c2&&console[_0x8de37a(0xf6)]('Force:\x20yes'));let _0x3ba4f0;if(_0x40d8d8)try{if(_0x40d8d8[_0x8de37a(0xb5)]('@')){const _0x2d9f7f=await import('fs/promises'),_0x4c80e1=_0x40d8d8[_0x8de37a(0x24a)](0x1),_0x518e80=await _0x2d9f7f['readFile'](_0x4c80e1,_0x8de37a(0x16d));_0x3ba4f0=JSON[_0x8de37a(0xc6)](_0x518e80);}else _0x3ba4f0=JSON[_0x8de37a(0xc6)](_0x40d8d8);}catch{return console['error'](_0x8de37a(0xe3)),0x1;}if(!_0x3e009a[_0x8de37a(0x117)]){if(!isInteractive())return console['error'](a51_0x5bf18c[_0x8de37a(0xf3)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x8de37a(0xf6)](a51_0x5bf18c[_0x8de37a(0x1b0)](_0x8de37a(0x119))),0x1;const _0x4569f6=await confirmKey(_0x8de37a(0x242)+(_0x4c1d01?'session':_0x8de37a(0xfa))+'\x20'+_0x2d171e+'?');if(!_0x4569f6)return console[_0x8de37a(0xf6)](a51_0x5bf18c[_0x8de37a(0xfc)](_0x8de37a(0x1cb))),0x1;}let _0x13b8d5;_0x4c1d01?_0x13b8d5=await withSpinner(_0x8de37a(0x215),()=>_0xf3834c[_0x8de37a(0x121)][_0x8de37a(0x1ea)](_0x2d171e,{'fromTask':_0x3d8a8c,'retryParams':_0x3ba4f0}),{'verbose':_0x3e009a[_0x8de37a(0xde)]}):_0x13b8d5=await withSpinner(_0x8de37a(0x107),()=>_0xf3834c[_0x8de37a(0x121)][_0x8de37a(0x205)](_0x2d171e,{'resumeFrom':_0x370553,'retryParams':_0x3ba4f0,'force':_0x1cd0c2}),{'verbose':_0x3e009a['verbose']});const _0x42333e=_0x13b8d5[_0x8de37a(0x195)];return console[_0x8de37a(0xf6)]('✔\x20Retry\x20started'),console[_0x8de37a(0xf6)](_0x8de37a(0xc2)+_0x42333e[_0x8de37a(0x173)]),console[_0x8de37a(0xf6)](_0x8de37a(0x9c)+_0x42333e['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]='workflow:run';[a51_0x22a388(0x1b4)]=a51_0x22a388(0x157);async['execute'](_0x1a04d8){const _0x2bbec8=a51_0x22a388,{options:_0x3e63fa,args:_0x4b3b96,tdx:_0x59ee69}=_0x1a04d8;let _0x5e523d=_0x4b3b96[0x0];if(!_0x5e523d){const _0x48ca48=this[_0x2bbec8(0x202)]([],_0x3e63fa),_0x4224ad=await withSpinner('Loading\x20workflows...',()=>_0x59ee69[_0x2bbec8(0x121)][_0x2bbec8(0xa7)](_0x48ca48,{'limit':_0x3e63fa['limit']}),{'verbose':_0x3e63fa[_0x2bbec8(0xde)]}),_0x48dd40=_0x4224ad[_0x2bbec8(0x195)];if(_0x48dd40[_0x2bbec8(0x221)]===0x0)return console[_0x2bbec8(0xf6)](_0x2bbec8(0xe6)),!_0x48ca48&&console[_0x2bbec8(0xf6)](a51_0x5bf18c[_0x2bbec8(0x1b0)](_0x2bbec8(0x10a))),0x1;const _0x148529=_0x48dd40[_0x2bbec8(0x1de)](_0x27b663=>({'title':_0x27b663[_0x2bbec8(0x1fe)]?.[_0x2bbec8(0x174)]+'.'+_0x27b663['name'],'value':_0x27b663[_0x2bbec8(0x1fe)]?.[_0x2bbec8(0x174)]+'.'+_0x27b663['name'],'description':_0x27b663[_0x2bbec8(0xf2)]?_0x2bbec8(0xcc)+_0x27b663['revision']:undefined})),_0xa5b8dc=await a51_0x4f4bd3({'type':'select','name':_0x2bbec8(0x121),'message':_0x2bbec8(0x194),'choices':_0x148529});if(!_0xa5b8dc['workflow'])return 0x1;_0x5e523d=_0xa5b8dc[_0x2bbec8(0x121)];}if(!_0x5e523d[_0x2bbec8(0xe0)]('.')){const _0x1d16fe=this[_0x2bbec8(0x202)]([],_0x3e63fa);if(_0x1d16fe)_0x5e523d=_0x1d16fe+'.'+_0x5e523d;else return console[_0x2bbec8(0xf6)](a51_0x5bf18c[_0x2bbec8(0xf3)](_0x2bbec8(0x1e0)),_0x2bbec8(0x249)),console['error'](a51_0x5bf18c[_0x2bbec8(0x1b0)](_0x2bbec8(0x10a))),0x1;}const _0x14821b=_0x3e63fa[_0x2bbec8(0x128)],_0x535d86=_0x3e63fa[_0x2bbec8(0x16a)],_0x478260={};if(_0x14821b&&Array[_0x2bbec8(0x124)](_0x14821b))for(const _0x11b006 of _0x14821b){const _0x4d2dba=_0x11b006[_0x2bbec8(0xd7)]('=');if(_0x4d2dba===-0x1)return console[_0x2bbec8(0xf6)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x11b006),console[_0x2bbec8(0xf6)](_0x2bbec8(0x190)),0x1;const _0x369d55=_0x11b006[_0x2bbec8(0x24a)](0x0,_0x4d2dba),_0x1b171a=_0x11b006[_0x2bbec8(0x24a)](_0x4d2dba+0x1);try{_0x478260[_0x369d55]=JSON['parse'](_0x1b171a);}catch{_0x478260[_0x369d55]=_0x1b171a;}}_0x3e63fa[_0x2bbec8(0xde)]&&(console[_0x2bbec8(0xf6)](_0x2bbec8(0x162)+_0x5e523d),Object[_0x2bbec8(0x244)](_0x478260)[_0x2bbec8(0x221)]>0x0&&console[_0x2bbec8(0xf6)](_0x2bbec8(0x1b8)+JSON[_0x2bbec8(0x246)](_0x478260)),_0x535d86&&console[_0x2bbec8(0xf6)](_0x2bbec8(0x11b)+_0x535d86));const _0x44917b=await withSpinner('Starting\x20workflow\x20run...',()=>_0x59ee69[_0x2bbec8(0x121)][_0x2bbec8(0xe2)](_0x5e523d,_0x478260,{'sessionTime':_0x535d86}),{'verbose':_0x3e63fa[_0x2bbec8(0xde)]}),_0x3a706d=_0x44917b[_0x2bbec8(0x195)];console['error'](_0x2bbec8(0xa3)),console[_0x2bbec8(0xf6)](_0x2bbec8(0x161)+_0x3a706d['id']),console[_0x2bbec8(0xf6)]('\x20\x20Session\x20ID:\x20'+_0x3a706d['sessionId']),console['error'](_0x2bbec8(0x186)+_0x3a706d[_0x2bbec8(0x1fe)]?.[_0x2bbec8(0x174)]),console[_0x2bbec8(0xf6)]('\x20\x20Workflow:\x20'+_0x3a706d['workflow']?.[_0x2bbec8(0x174)]);if(_0x3a706d[_0x2bbec8(0x1fe)]?.['id']&&_0x3a706d['sessionId']&&_0x3a706d['id']){const _0x48a6f9=_0x3e63fa[_0x2bbec8(0x1e3)],_0x2194bf=getConsoleUrl(_0x48a6f9,_0x2bbec8(0xcd)+_0x3a706d[_0x2bbec8(0x1fe)]['id']+'/sessions/'+_0x3a706d[_0x2bbec8(0x214)]+_0x2bbec8(0x136)+_0x3a706d['id']);console['error']('\x20\x20Console:\x20'+a51_0x5bf18c['cyan'](_0x2194bf));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a51_0x22a388(0xb3);[a51_0x22a388(0x1b4)]=a51_0x22a388(0x1ac);async['execute'](_0x8e89c9){const _0x28ddfc=a51_0x22a388,{options:_0x3c4370,args:_0x1751f5,tdx:_0x3296d0}=_0x8e89c9,_0x164e10=_0x1751f5[0x0],_0x5e04a8=_0x1751f5[0x1]||'.';if(!_0x164e10)return console[_0x28ddfc(0xf6)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x28ddfc(0xf6)](_0x28ddfc(0xd1)),0x1;const _0x3a1f6a=_0x3c4370['revision'];_0x3c4370[_0x28ddfc(0xde)]&&(console['error'](_0x28ddfc(0xba)+_0x164e10),console[_0x28ddfc(0xf6)]('Output\x20directory:\x20'+_0x5e04a8),_0x3a1f6a&&console[_0x28ddfc(0xf6)]('Revision:\x20'+_0x3a1f6a));const _0x2c89f5=await withSpinner(_0x28ddfc(0x24d)+_0x164e10+_0x28ddfc(0x156),()=>_0x3296d0[_0x28ddfc(0x121)][_0x28ddfc(0x1cc)](_0x164e10,_0x5e04a8,{'revision':_0x3a1f6a}),{'verbose':_0x3c4370[_0x28ddfc(0xde)]}),_0xd008b1=_0x2c89f5[_0x28ddfc(0x195)];return console['error']('✔\x20Downloaded\x20'+_0xd008b1[_0x28ddfc(0xb4)]),console[_0x28ddfc(0xf6)](_0x28ddfc(0x182)+_0xd008b1['revision']),console[_0x28ddfc(0xf6)]('\x20\x20Files\x20extracted:\x20'+_0xd008b1['filesExtracted']),console['error'](_0x28ddfc(0x1c9)+_0x5e04a8+'/'+_0xd008b1['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a51_0x22a388(0xd4);[a51_0x22a388(0x1b4)]=a51_0x22a388(0x172);async[a51_0x22a388(0xd2)](_0x1a3328){const _0x814c27=a51_0x22a388,{options:_0x1b95c2,args:_0x3dd527,tdx:_0x99fddd}=_0x1a3328;let _0x401bbe='.',_0x993034=_0x1b95c2[_0x814c27(0x174)];if(_0x3dd527[0x0]){const {promises:_0x4b9617}=await import('fs');try{const _0x5cd473=await _0x4b9617['stat'](_0x3dd527[0x0]);if(_0x5cd473[_0x814c27(0x153)]())_0x401bbe=_0x3dd527[0x0];else return console[_0x814c27(0xf6)](_0x814c27(0x12b)+_0x3dd527[0x0]+_0x814c27(0x168)),0x1;}catch{_0x993034=_0x3dd527[0x0],_0x401bbe='.';}}const _0xb43ffa=_0x1b95c2[_0x814c27(0xf2)],_0x1ae3cd=_0x1b95c2[_0x814c27(0xf9)];_0x1b95c2[_0x814c27(0xde)]&&(console[_0x814c27(0xf6)]('Project\x20directory:\x20'+_0x401bbe),_0x993034&&console[_0x814c27(0xf6)](_0x814c27(0x1bf)+_0x993034),_0xb43ffa&&console['error']('Revision:\x20'+_0xb43ffa),_0x1ae3cd&&console['error'](_0x814c27(0xd0)));const _0x34bb7a=await withSpinner(_0x814c27(0x171),()=>_0x99fddd[_0x814c27(0x121)][_0x814c27(0x11e)](_0x401bbe,{'projectName':_0x993034,'revision':_0xb43ffa,'skipValidation':_0x1ae3cd}),{'verbose':_0x1b95c2['verbose']}),_0x3ae6ba=_0x34bb7a[_0x814c27(0x195)];return console[_0x814c27(0xf6)]('✔\x20Pushed\x20'+_0x3ae6ba[_0x814c27(0xb4)]),console['error'](_0x814c27(0xca)+_0x3ae6ba[_0x814c27(0xb6)]),console['error'](_0x814c27(0x182)+_0x3ae6ba[_0x814c27(0xf2)]),await this[_0x814c27(0x134)](_0x99fddd,_0x3ae6ba[_0x814c27(0xb4)],_0x1b95c2[_0x814c27(0x1e3)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x23a);['description']=a51_0x22a388(0x217);async[a51_0x22a388(0xd2)](_0x5325ae){const _0x17afd8=a51_0x22a388,{options:_0x45591b,args:_0x1df2e5,tdx:_0x3707b1}=_0x5325ae,_0x4c5e64=_0x1df2e5[0x0],_0x4ef354=_0x1df2e5[0x1];if(!_0x4c5e64)return console['error'](a51_0x5bf18c[_0x17afd8(0xf3)](_0x17afd8(0x1e0)),_0x17afd8(0x21b)),console[_0x17afd8(0xf6)](a51_0x5bf18c[_0x17afd8(0x1b0)](_0x17afd8(0x133))),0x1;const _0x5495bf=_0x45591b[_0x17afd8(0xf2)];_0x45591b[_0x17afd8(0xde)]&&(console['error'](_0x17afd8(0xba)+_0x4c5e64),_0x4ef354&&console['error'](_0x17afd8(0x1f6)+_0x4ef354),_0x5495bf&&console[_0x17afd8(0xf6)](_0x17afd8(0xa2)+_0x5495bf),_0x45591b['dryRun']&&console[_0x17afd8(0xf6)](_0x17afd8(0x21f)));const _0x3c601b=await withSpinner(_0x17afd8(0x1ee)+_0x4c5e64+_0x17afd8(0x156),()=>_0x3707b1[_0x17afd8(0x121)][_0x17afd8(0x21a)](_0x4c5e64,{'targetDir':_0x4ef354,'revision':_0x5495bf}),{'verbose':_0x45591b[_0x17afd8(0xde)]}),_0x2b2ffa=_0x3c601b['data'];_0x2b2ffa[_0x17afd8(0x234)]?console[_0x17afd8(0xf6)](_0x17afd8(0x247)+_0x2b2ffa[_0x17afd8(0xb4)]):console[_0x17afd8(0xf6)](_0x17afd8(0xdc)+_0x2b2ffa['projectName']);console[_0x17afd8(0xf6)](_0x17afd8(0x182)+_0x2b2ffa[_0x17afd8(0xf2)]),console['error'](_0x17afd8(0x1c0)+(a51_0x108fb0[_0x17afd8(0x1d2)](process[_0x17afd8(0x166)](),_0x2b2ffa[_0x17afd8(0x1a4)])||'.')),console[_0x17afd8(0xf6)]('\x20\x20Changes:\x20'+a51_0x5bf18c[_0x17afd8(0xf7)]('+'+_0x2b2ffa[_0x17afd8(0x145)]['new']+'\x20new')+',\x20'+(a51_0x5bf18c['yellow']('~'+_0x2b2ffa[_0x17afd8(0x145)][_0x17afd8(0x109)]+_0x17afd8(0x115))+',\x20')+(a51_0x5bf18c[_0x17afd8(0xf3)]('-'+_0x2b2ffa['summary'][_0x17afd8(0xe5)]+_0x17afd8(0x1be))+',\x20')+(''+a51_0x5bf18c[_0x17afd8(0x1b0)](_0x2b2ffa[_0x17afd8(0x145)][_0x17afd8(0x19a)]+_0x17afd8(0x21e))));for(const _0x194f56 of _0x2b2ffa[_0x17afd8(0xa8)]){_0x194f56[_0x17afd8(0x1a5)]==='modified'&&_0x194f56[_0x17afd8(0x1d9)]&&(console[_0x17afd8(0xf6)]('\x0a'+a51_0x5bf18c[_0x17afd8(0xbb)]('---\x20'+_0x194f56[_0x17afd8(0x15d)])),console['error'](_0x194f56['diff']));}if(!_0x2b2ffa[_0x17afd8(0xd6)])return saveSessionContext({'workflow_project':_0x2b2ffa[_0x17afd8(0xb4)]},_0x45591b[_0x17afd8(0xe7)]),console[_0x17afd8(0xf6)](a51_0x5bf18c[_0x17afd8(0xf7)](_0x17afd8(0x23b))),console[_0x17afd8(0xf6)](a51_0x5bf18c[_0x17afd8(0x1b0)](_0x17afd8(0x1cd)+_0x2b2ffa[_0x17afd8(0xb4)])),0x0;if(_0x45591b[_0x17afd8(0x164)])return console[_0x17afd8(0xf6)](a51_0x5bf18c[_0x17afd8(0xfc)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x45591b[_0x17afd8(0x117)]){if(!isInteractive())return console[_0x17afd8(0xf6)](a51_0x5bf18c[_0x17afd8(0xf3)](_0x17afd8(0xd9)),_0x17afd8(0x23f)),console[_0x17afd8(0xf6)](a51_0x5bf18c[_0x17afd8(0x1b0)](_0x17afd8(0x119))),0x1;const _0x20dc5b=await confirmKey(_0x17afd8(0xa5));if(!_0x20dc5b)return console[_0x17afd8(0xf6)](a51_0x5bf18c[_0x17afd8(0xfc)](_0x17afd8(0x1cb)),_0x17afd8(0x9f)),0x1;}await withSpinner(_0x17afd8(0x130),()=>_0x3707b1['workflow'][_0x17afd8(0x1aa)](_0x2b2ffa,{'revision':_0x5495bf}),{'verbose':_0x45591b[_0x17afd8(0xde)]}),saveSessionContext({'workflow_project':_0x2b2ffa[_0x17afd8(0xb4)]},_0x45591b[_0x17afd8(0xe7)]),console['error'](a51_0x5bf18c['green'](_0x17afd8(0x15f)));const _0x30cb33=a51_0x108fb0[_0x17afd8(0x1d2)](process[_0x17afd8(0x166)](),_0x2b2ffa[_0x17afd8(0x1a4)])||'.';return console['error'](a51_0x5bf18c[_0x17afd8(0x1b0)]('\x20\x20Location:\x20'+_0x30cb33)),console[_0x17afd8(0xf6)](a51_0x5bf18c[_0x17afd8(0x1b0)](_0x17afd8(0x1cd)+_0x2b2ffa['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x224);[a51_0x22a388(0x1b4)]=a51_0x22a388(0x135);async[a51_0x22a388(0xd2)](_0xcfdb24){const _0x5bf818=a51_0x22a388,{options:_0x2e0f7b,args:_0x545015,tdx:_0x29dff5}=_0xcfdb24,_0x4b88df=this[_0x5bf818(0x235)](_0x545015,_0x2e0f7b),_0x28b808=_0x2e0f7b[_0x5bf818(0xf2)],_0xe1ecd1=_0x2e0f7b[_0x5bf818(0xf9)];_0x2e0f7b['verbose']&&(_0x4b88df&&console[_0x5bf818(0xf6)](_0x5bf818(0x191)+_0x4b88df),_0x28b808&&console['error'](_0x5bf818(0xa2)+_0x28b808),_0x2e0f7b['dryRun']&&console[_0x5bf818(0xf6)](_0x5bf818(0x21f)),_0xe1ecd1&&console[_0x5bf818(0xf6)](_0x5bf818(0xd0)));let _0x281709;try{_0x281709=await withSpinner('Analyzing\x20changes...',()=>_0x29dff5['workflow'][_0x5bf818(0x127)]({'sourceDir':_0x4b88df,'revision':_0x28b808,'skipValidation':_0xe1ecd1}),{'verbose':_0x2e0f7b['verbose']});}catch(_0x159dc9){if(_0x159dc9 instanceof Error&&_0x159dc9[_0x5bf818(0x17b)]['includes'](_0x5bf818(0x10b)))return console[_0x5bf818(0xf6)](a51_0x5bf18c['red']('Error:'),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x2e0f7b[_0x5bf818(0x1c1)]?console[_0x5bf818(0xf6)](a51_0x5bf18c[_0x5bf818(0x1b0)](_0x5bf818(0x1f3)+_0x2e0f7b[_0x5bf818(0x1c1)]+_0x5bf818(0x184)+_0x2e0f7b[_0x5bf818(0x1c1)]+'\x27')):console[_0x5bf818(0xf6)](a51_0x5bf18c[_0x5bf818(0x1b0)](_0x5bf818(0x1da))),0x1;throw _0x159dc9;}const _0x2f05c3=_0x281709['data'];console['error'](_0x5bf818(0xfb)+_0x2f05c3[_0x5bf818(0xb4)]),console[_0x5bf818(0xf6)](_0x5bf818(0x20f)+_0x2f05c3[_0x5bf818(0x18e)]),console[_0x5bf818(0xf6)](_0x5bf818(0x182)+_0x2f05c3[_0x5bf818(0xf2)]),console['error'](_0x5bf818(0x150)+a51_0x5bf18c[_0x5bf818(0xf7)]('+'+_0x2f05c3[_0x5bf818(0x145)]['new']+'\x20new')+',\x20'+(a51_0x5bf18c[_0x5bf818(0xfc)]('~'+_0x2f05c3[_0x5bf818(0x145)][_0x5bf818(0x109)]+_0x5bf818(0x115))+',\x20')+(a51_0x5bf18c['red']('-'+_0x2f05c3[_0x5bf818(0x145)][_0x5bf818(0xe5)]+_0x5bf818(0x1be))+',\x20')+(''+a51_0x5bf18c['dim'](_0x2f05c3['summary'][_0x5bf818(0x19a)]+_0x5bf818(0x21e))));for(const _0xa673e5 of _0x2f05c3[_0x5bf818(0xa8)]){_0xa673e5[_0x5bf818(0x1a5)]===_0x5bf818(0x109)&&_0xa673e5[_0x5bf818(0x1d9)]&&(console[_0x5bf818(0xf6)]('\x0a'+a51_0x5bf18c[_0x5bf818(0xbb)]('---\x20'+_0xa673e5[_0x5bf818(0x15d)])),console[_0x5bf818(0xf6)](_0xa673e5[_0x5bf818(0x1d9)]));}if(!_0x2f05c3[_0x5bf818(0xd6)])return console['error'](a51_0x5bf18c[_0x5bf818(0xf7)](_0x5bf818(0x1b3))),await this['showWorkflowConsoleUrl'](_0x29dff5,_0x2f05c3['projectName'],_0x2e0f7b['site']),0x0;if(_0x2e0f7b[_0x5bf818(0x164)])return console[_0x5bf818(0xf6)](a51_0x5bf18c[_0x5bf818(0xfc)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x2e0f7b[_0x5bf818(0x117)]){if(!isInteractive())return console[_0x5bf818(0xf6)](a51_0x5bf18c['red'](_0x5bf818(0xd9)),_0x5bf818(0x23f)),console[_0x5bf818(0xf6)](a51_0x5bf18c[_0x5bf818(0x1b0)](_0x5bf818(0x119))),0x1;const _0x14d59f=await confirmKey(_0x5bf818(0x1f0));if(!_0x14d59f)return console['error'](a51_0x5bf18c[_0x5bf818(0xfc)](_0x5bf818(0x1cb)),_0x5bf818(0x1c8)),0x1;}const _0x25fbdc=await withSpinner(_0x5bf818(0x21d),()=>_0x29dff5[_0x5bf818(0x121)]['executePushProject'](_0x2f05c3),{'verbose':_0x2e0f7b[_0x5bf818(0xde)]}),_0x2816c6=_0x25fbdc[_0x5bf818(0x195)];return console[_0x5bf818(0xf6)](a51_0x5bf18c[_0x5bf818(0xf7)](_0x5bf818(0x11c))),console['error'](_0x5bf818(0xca)+_0x2816c6[_0x5bf818(0xb6)]),console['error'](_0x5bf818(0x182)+_0x2816c6[_0x5bf818(0xf2)]),await this[_0x5bf818(0x134)](_0x29dff5,_0x2816c6['projectName'],_0x2e0f7b[_0x5bf818(0x1e3)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x12a);[a51_0x22a388(0x1b4)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a51_0x22a388(0xd2)](_0x205d9){const _0x41bfbc=a51_0x22a388,{options:_0x16244d,args:_0x1d629d,tdx:_0x13d357}=_0x205d9,_0x4913b0=this[_0x41bfbc(0x235)](_0x1d629d,_0x16244d),_0x471b19=_0x16244d[_0x41bfbc(0x174)],_0x15b7de=_0x16244d[_0x41bfbc(0xf2)],_0xbce095=_0x16244d[_0x41bfbc(0xf9)];if(!_0x4913b0)return console[_0x41bfbc(0xf6)](a51_0x5bf18c[_0x41bfbc(0xf3)]('Error:'),_0x41bfbc(0x1dd)),console[_0x41bfbc(0xf6)](a51_0x5bf18c['dim']('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x41bfbc(0xf6)](a51_0x5bf18c[_0x41bfbc(0x1b0)](_0x41bfbc(0x1d5))),0x1;if(!_0x471b19)return console[_0x41bfbc(0xf6)](a51_0x5bf18c[_0x41bfbc(0xf3)](_0x41bfbc(0x1e0)),_0x41bfbc(0x10c)),console[_0x41bfbc(0xf6)](a51_0x5bf18c[_0x41bfbc(0x1b0)](_0x41bfbc(0x1a9))),0x1;_0x16244d[_0x41bfbc(0xde)]&&(console['error'](_0x41bfbc(0x191)+_0x4913b0),console[_0x41bfbc(0xf6)](_0x41bfbc(0x206)+_0x471b19),_0x15b7de&&console['error'](_0x41bfbc(0xa2)+_0x15b7de),_0x16244d[_0x41bfbc(0x164)]&&console['error']('Dry\x20run:\x20yes'),_0xbce095&&console['error'](_0x41bfbc(0xd0)));const _0x36ef65=await withSpinner(_0x41bfbc(0x17e),()=>_0x13d357[_0x41bfbc(0x121)][_0x41bfbc(0x120)](_0x4913b0,_0x471b19,{'revision':_0x15b7de,'skipValidation':_0xbce095}),{'verbose':_0x16244d[_0x41bfbc(0xde)]}),_0xdb1c64=_0x36ef65[_0x41bfbc(0x195)];console['error'](_0x41bfbc(0x10d)+_0xdb1c64[_0x41bfbc(0x18e)]);_0xdb1c64['sourceProjectName']&&console[_0x41bfbc(0xf6)]('Source\x20project:\x20'+_0xdb1c64[_0x41bfbc(0xbf)]);console[_0x41bfbc(0xf6)](_0x41bfbc(0x206)+_0xdb1c64[_0x41bfbc(0xf0)]),console['error'](_0x41bfbc(0xa2)+_0xdb1c64[_0x41bfbc(0xf2)]),console[_0x41bfbc(0xf6)](_0x41bfbc(0x1b9)+_0xdb1c64[_0x41bfbc(0x1af)]);_0xdb1c64[_0x41bfbc(0x1d6)]&&(console['error'](a51_0x5bf18c[_0x41bfbc(0xfc)]('\x0a⚠\x20Project\x20\x22'+_0xdb1c64[_0x41bfbc(0xf0)]+_0x41bfbc(0x148)+_0xdb1c64[_0x41bfbc(0x10e)]+')')),console[_0x41bfbc(0xf6)](a51_0x5bf18c[_0x41bfbc(0xfc)](_0x41bfbc(0x209))));if(_0x16244d[_0x41bfbc(0x164)])return console[_0x41bfbc(0xf6)](a51_0x5bf18c[_0x41bfbc(0xfc)](_0x41bfbc(0xc1))),0x0;if(!_0x16244d[_0x41bfbc(0x117)]){if(!isInteractive())return console[_0x41bfbc(0xf6)](a51_0x5bf18c[_0x41bfbc(0xf3)](_0x41bfbc(0xd9)),_0x41bfbc(0x23f)),console['error'](a51_0x5bf18c[_0x41bfbc(0x1b0)](_0x41bfbc(0x119))),0x1;const _0x5d9a0f=_0xdb1c64['sourceProjectName']||a51_0x108fb0[_0x41bfbc(0x144)](_0x4913b0),_0x29946d=_0xdb1c64['targetExists']?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x471b19+_0x41bfbc(0x1db):_0x41bfbc(0x1f5)+_0x5d9a0f+_0x41bfbc(0xdb)+_0x471b19+'\x22?',_0x88002b=await confirmKey(_0x29946d);if(!_0x88002b)return console['error'](a51_0x5bf18c[_0x41bfbc(0xfc)](_0x41bfbc(0x1cb))),0x1;}const _0x88b4d3=await withSpinner(_0xdb1c64[_0x41bfbc(0x1d6)]?_0x41bfbc(0x9b)+_0x471b19+_0x41bfbc(0x156):_0x41bfbc(0x1f7)+_0x471b19+'...',()=>_0x13d357[_0x41bfbc(0x121)]['executeCloneProject'](_0xdb1c64),{'verbose':_0x16244d[_0x41bfbc(0xde)]}),_0xeb1080=_0x88b4d3[_0x41bfbc(0x195)];return console[_0x41bfbc(0xf6)](a51_0x5bf18c[_0x41bfbc(0xf7)](_0xdb1c64['targetExists']?_0x41bfbc(0x11f):_0x41bfbc(0x1ca))),console[_0x41bfbc(0xf6)](_0x41bfbc(0x186)+_0xeb1080['newProjectName']),console[_0x41bfbc(0xf6)]('\x20\x20Project\x20ID:\x20'+_0xeb1080[_0x41bfbc(0xe8)]),console[_0x41bfbc(0xf6)](_0x41bfbc(0x182)+_0xeb1080[_0x41bfbc(0xf2)]),await this['showWorkflowConsoleUrl'](_0x13d357,_0xeb1080['newProjectName'],_0x16244d[_0x41bfbc(0x1e3)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x125);[a51_0x22a388(0x1b4)]=a51_0x22a388(0x112);async[a51_0x22a388(0xd2)](_0x555115){const _0x4f4c8e=a51_0x22a388,{options:_0x1bc4d0,args:_0xb668c6,tdx:_0xa629f7}=_0x555115,_0x46f820=_0xb668c6[0x0];if(!_0x46f820)return console['error'](_0x4f4c8e(0x1d8)),console[_0x4f4c8e(0xf6)](_0x4f4c8e(0x1a2)),0x1;_0x1bc4d0[_0x4f4c8e(0xde)]&&console[_0x4f4c8e(0xf6)](_0x4f4c8e(0xba)+_0x46f820);if(!_0x1bc4d0[_0x4f4c8e(0x117)]){if(!isInteractive())return console[_0x4f4c8e(0xf6)](a51_0x5bf18c[_0x4f4c8e(0xf3)](_0x4f4c8e(0xd9)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a51_0x5bf18c[_0x4f4c8e(0x1b0)](_0x4f4c8e(0x119))),0x1;const _0x37b925=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x46f820+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x37b925)return console[_0x4f4c8e(0xf6)](a51_0x5bf18c['yellow'](_0x4f4c8e(0x1cb))),0x1;}const _0x56d3b7=await withSpinner('Deleting\x20project\x20'+_0x46f820+_0x4f4c8e(0x156),()=>_0xa629f7['workflow'][_0x4f4c8e(0xc9)](_0x46f820),{'verbose':_0x1bc4d0[_0x4f4c8e(0xde)]}),_0x333b9e=_0x56d3b7['data'];return console['error'](_0x4f4c8e(0x1bb)+_0x333b9e['projectName']),console[_0x4f4c8e(0xf6)](_0x4f4c8e(0xca)+_0x333b9e[_0x4f4c8e(0xb6)]),0x0;}}export function parseKeyValue(_0x2455e0){const _0xdb6dfa=a51_0x22a388,_0x1678e0=_0x2455e0[_0xdb6dfa(0xd7)]('=');if(_0x1678e0===-0x1)throw new Error(_0xdb6dfa(0x159)+_0x2455e0+_0xdb6dfa(0x12f));const _0x33d1a5=_0x2455e0[_0xdb6dfa(0x24a)](0x0,_0x1678e0),_0x5a0004=_0x2455e0[_0xdb6dfa(0x24a)](_0x1678e0+0x1);if(!_0x33d1a5)throw new Error(_0xdb6dfa(0xed));return{'key':_0x33d1a5,'value':_0x5a0004};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x226);[a51_0x22a388(0x1b4)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a51_0x22a388(0xd2)](_0x5e2b52){const _0x2f6c79=a51_0x22a388,{options:_0x1bac9b,args:_0x2c53b5,tdx:_0x2e731d}=_0x5e2b52,_0x1dca4d=this[_0x2f6c79(0x118)](_0x2c53b5,_0x1bac9b);if(!_0x1dca4d)return 0x1;_0x1bac9b[_0x2f6c79(0xde)]&&console[_0x2f6c79(0xf6)]('Project:\x20'+_0x1dca4d);const _0x324164=await withSpinner(_0x2f6c79(0x18a),()=>_0x2e731d['workflow'][_0x2f6c79(0x105)](_0x1dca4d),{'verbose':_0x1bac9b[_0x2f6c79(0xde)]}),{secrets:_0x2db372}=_0x324164[_0x2f6c79(0x195)];return console['error'](_0x2f6c79(0x17a)+_0x2db372[_0x2f6c79(0x221)]+_0x2f6c79(0xf5)+(_0x2db372['length']!==0x1?'s':'')),await handleSDKOutput(_0x2db372,_0x1bac9b),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x223);[a51_0x22a388(0x1b4)]='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async[a51_0x22a388(0xd2)](_0x1fbba7){const _0x2642c1=a51_0x22a388,{options:_0x4a89d2,args:_0x9a2265,tdx:_0x895a46}=_0x1fbba7;let _0x149a41,_0x5effae;if(_0x9a2265[_0x2642c1(0x221)]>=0x1&&!_0x9a2265[0x0]['includes']('='))_0x149a41=_0x9a2265[0x0],_0x5effae=_0x9a2265['slice'](0x1);else{if(_0x9a2265[_0x2642c1(0x221)]>=0x1&&_0x4a89d2[_0x2642c1(0x1c1)])_0x149a41=_0x4a89d2[_0x2642c1(0x1c1)],_0x5effae=_0x9a2265;else return _0x9a2265[_0x2642c1(0x221)]>=0x1?(console[_0x2642c1(0xf6)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x2642c1(0x10a)),0x1):(console['error'](_0x2642c1(0xb1)),console[_0x2642c1(0xf6)](_0x2642c1(0x1d0)),0x1);}if(_0x5effae[_0x2642c1(0x221)]===0x0)return console[_0x2642c1(0xf6)](_0x2642c1(0xb1)),console[_0x2642c1(0xf6)](_0x2642c1(0x1d0)),0x1;const _0x2a06c4={};try{for(const _0x4ef91d of _0x5effae){const {key:_0x147283,value:_0xcd7782}=parseKeyValue(_0x4ef91d);_0x2a06c4[_0x147283]=_0xcd7782;}}catch(_0x455620){return _0x455620 instanceof Error&&console[_0x2642c1(0xf6)](a51_0x5bf18c[_0x2642c1(0xf3)](_0x2642c1(0x1e0)),_0x455620[_0x2642c1(0x17b)]),0x1;}const _0x1c4890=Object['keys'](_0x2a06c4);_0x4a89d2['verbose']&&(console[_0x2642c1(0xf6)](_0x2642c1(0xba)+_0x149a41),console[_0x2642c1(0xf6)]('Secrets\x20to\x20set:\x20'+_0x1c4890['join'](',\x20')));const _0x3b6bef=await withSpinner(_0x1c4890['length']===0x1?_0x2642c1(0x178):_0x2642c1(0xeb)+_0x1c4890[_0x2642c1(0x221)]+'\x20secrets...',()=>_0x895a46[_0x2642c1(0x121)][_0x2642c1(0xbe)](_0x149a41,_0x2a06c4),{'verbose':_0x4a89d2['verbose']}),_0x4d72de=_0x3b6bef['data'];return console[_0x2642c1(0xf6)](_0x1c4890[_0x2642c1(0x221)]===0x1?_0x2642c1(0x243)+_0x4d72de[_0x2642c1(0x244)][0x0]+_0x2642c1(0x1c5)+_0x4d72de[_0x2642c1(0xb4)]+'\x27':'✔\x20'+_0x4d72de[_0x2642c1(0x244)][_0x2642c1(0x221)]+_0x2642c1(0x216)+_0x4d72de[_0x2642c1(0xb4)]+'\x27'),(_0x4a89d2[_0x2642c1(0x176)]||_0x4a89d2[_0x2642c1(0x201)])&&await handleSingleObjectOutput(_0x4d72de,_0x4a89d2),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0xaa);['description']=a51_0x22a388(0x16c);async[a51_0x22a388(0xd2)](_0x1b8163){const _0xa02d26=a51_0x22a388,{options:_0x20afcb,args:_0x2bf17d,tdx:_0x2aa889}=_0x1b8163;let _0x2751ad,_0xa531f1;if(_0x2bf17d[_0xa02d26(0x221)]>=0x2)_0x2751ad=_0x2bf17d[0x0],_0xa531f1=_0x2bf17d[0x1];else{if(_0x2bf17d[_0xa02d26(0x221)]===0x1&&_0x20afcb[_0xa02d26(0x1c1)])_0x2751ad=_0x20afcb['workflowProject'],_0xa531f1=_0x2bf17d[0x0];else return _0x2bf17d[_0xa02d26(0x221)]===0x1?(console[_0xa02d26(0xf6)]('Error:\x20Project\x20name\x20is\x20required'),console[_0xa02d26(0xf6)](_0xa02d26(0x10a)),0x1):(console[_0xa02d26(0xf6)](_0xa02d26(0x203)),console[_0xa02d26(0xf6)](_0xa02d26(0xc0)),0x1);}_0x20afcb[_0xa02d26(0xde)]&&(console[_0xa02d26(0xf6)](_0xa02d26(0xba)+_0x2751ad),console['error']('Key:\x20'+_0xa531f1));if(!_0x20afcb[_0xa02d26(0x117)]){if(!isInteractive())return console[_0xa02d26(0xf6)](a51_0x5bf18c['red'](_0xa02d26(0xd9)),_0xa02d26(0x23f)),console[_0xa02d26(0xf6)](a51_0x5bf18c[_0xa02d26(0x1b0)](_0xa02d26(0x119))),0x1;const _0x5eed28=await confirmKey(_0xa02d26(0x22b)+_0xa531f1+_0xa02d26(0x1fc)+_0x2751ad+'\x27?');if(!_0x5eed28)return console['error'](a51_0x5bf18c[_0xa02d26(0xfc)](_0xa02d26(0x1cb))),0x1;}const _0x5c1535=await withSpinner(_0xa02d26(0x141),()=>_0x2aa889[_0xa02d26(0x121)][_0xa02d26(0xd5)](_0x2751ad,_0xa531f1),{'verbose':_0x20afcb['verbose']}),_0x381d4e=_0x5c1535[_0xa02d26(0x195)];return console['error']('✔\x20Secret\x20\x27'+_0x381d4e[_0xa02d26(0x1b2)]+_0xa02d26(0x132)+_0x381d4e[_0xa02d26(0xb4)]+'\x27'),(_0x20afcb[_0xa02d26(0x176)]||_0x20afcb['jsonl'])&&await handleSingleObjectOutput(_0x381d4e,_0x20afcb),0x0;}}const TIMELINE_CONFIG={'TASK_NAME_WIDTH':0x28,'ICON_WIDTH':0x2,'ICON_SPACING':0x1,'GUTTER':0x5,'MIN_TIMELINE_WIDTH':0x28,'MAX_TIMELINE_WIDTH':0x50,'LABEL_MIN_SPACING':0x2,'POLL_INTERVAL_MS':0x7d0,'MAX_POLL_TIME_MS':0x36ee80,'MAX_POLL_ITERATIONS':0x708,'MAX_TASKS_DISPLAY':0x64,'MIN_LABEL_COUNT':0x3,'MAX_LABEL_COUNT':0x6,'LABEL_WIDTH_DIVISOR':0xf};function formatElapsed(_0x1428a6){const _0x278aab=a51_0x22a388,_0x451e0c=Math['floor'](_0x1428a6/0x3e8),_0x36c19a=Math['floor'](_0x451e0c/0x3c),_0x14f753=Math[_0x278aab(0xdd)](_0x36c19a/0x3c),_0x1ce6ac=Math[_0x278aab(0xdd)](_0x14f753/0x18);if(_0x1ce6ac>0x0){const _0x101211=_0x14f753%0x18;return _0x101211>0x0?_0x1ce6ac+'d\x20'+_0x101211+'h':_0x1ce6ac+'d';}else{if(_0x14f753>0x0){const _0x2572b9=_0x36c19a%0x3c;return _0x2572b9>0x0?_0x14f753+'h\x20'+_0x2572b9+'m':_0x14f753+'h';}else{if(_0x36c19a>0x0){const _0x4a0f4c=_0x451e0c%0x3c;return _0x4a0f4c>0x0?_0x36c19a+'m\x20'+_0x4a0f4c+'s':_0x36c19a+'m';}else return _0x451e0c+'s';}}}function formatTimestamp(_0x4acb03,_0x6b69ea){const _0x54f91e=a51_0x22a388,_0x29127f=new Date(_0x4acb03),_0x58c0a7=String(_0x29127f[_0x54f91e(0x1fa)]())[_0x54f91e(0x17d)](0x2,'0'),_0x5e4109=String(_0x29127f[_0x54f91e(0x14d)]())[_0x54f91e(0x17d)](0x2,'0'),_0x1683f1=_0x58c0a7+':'+_0x5e4109,_0x5e6762=_0x29127f[_0x54f91e(0x1e9)]()===_0x6b69ea[_0x54f91e(0x1e9)]()&&_0x29127f[_0x54f91e(0x187)]()===_0x6b69ea['getMonth']()&&_0x29127f['getDate']()===_0x6b69ea[_0x54f91e(0x149)]();if(_0x5e6762)return _0x1683f1;else{const _0x2262e4=String(_0x29127f['getMonth']()+0x1)[_0x54f91e(0x17d)](0x2,'0'),_0x381b9f=String(_0x29127f[_0x54f91e(0x149)]())['padStart'](0x2,'0');return _0x2262e4+'-'+_0x381b9f+'\x20'+_0x1683f1;}}function formatDate(_0x22af93){const _0x4ba063=a51_0x22a388,_0x37df52=_0x22af93[_0x4ba063(0x1e9)](),_0x478199=String(_0x22af93['getMonth']()+0x1)[_0x4ba063(0x17d)](0x2,'0'),_0x5d30b0=String(_0x22af93[_0x4ba063(0x149)]())[_0x4ba063(0x17d)](0x2,'0');return _0x37df52+'-'+_0x478199+'-'+_0x5d30b0;}function getTaskStateIcon(_0x52646e){const _0x90fac7={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x90fac7[_0x52646e]||'⚪';}function getBarChar(_0x54c532){const _0x53af6c=a51_0x22a388;return _0x54c532===_0x53af6c(0xf6)||_0x54c532==='group_error'?'×':'─';}function a51_0x15a1(){const _0x38f735=['getDate','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','toLowerCase','No\x20workflow\x20projects\x20found','getMinutes','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','resolveProjectId','\x20\x20Changes:\x20','createdAt','Select\x20a\x20task\x20to\x20view\x20logs:','isDirectory','resolve','\x20logs','...','Start\x20a\x20workflow\x20run','No\x20sessions\x20with\x20timing\x20information','Invalid\x20format:\x20','Fetching\x20log\x20files...','running',',\x20Workflow:\x20','path','764923JSlXkI','✔\x20Pull\x20complete','sessions','\x20\x20Attempt\x20ID:\x20','Workflow:\x20','fullName','dryRun','\x20session','cwd','ICON_SPACING','\x20is\x20not\x20a\x20directory','\x0aPolling...\x20(','sessionTime','\x20tasks','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','utf-8','Warning:','9FoyEzQ','max','Pushing\x20workflow\x20project...','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','attemptId','name','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','json','No\x20sessions\x20found\x20for:\x20','Setting\x20secret...','success','✔\x20Found\x20','message','No\x20projects\x20match\x20pattern:\x20','padStart','Analyzing\x20project...','get','MIN_TIMELINE_WIDTH','130VhtFrZ','\x20\x20Revision:\x20','filter','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','12960FhlFLr','\x20\x20Project:\x20','getMonth','No\x20sessions\x20found','text','Listing\x20secrets...','Loading\x20sessions...','canceling','Pattern:\x20','sourceDir','Auto-selected\x20latest\x20session:\x20','Expected\x20format:\x20--param\x20key=value','Source\x20directory:\x20','join','1177055sIldPh','Select\x20a\x20workflow\x20to\x20run','data','status','Target:\x20','duration','follow','unchanged','startedAt','Getting\x20attempt\x20details...','No\x20sessions\x20found\x20in\x20project:\x20','439818ECCzdr','list','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Usage:\x20workflow:delete\x20<project-name-or-id>','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','targetDir','type','workflow:workflows','MAX_TASKS_DISPLAY','Resolving\x20project\x20\x27','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','applyPullProject','TASK_NAME_WIDTH','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','workflow:kill','ICON_WIDTH','fileCount','dim','(use\x20--limit\x20to\x20see\x20more)','key','\x0a✔\x20No\x20changes\x20to\x20push','description','autocomplete','workflowName','renderSingleTimeline','Parameters:\x20','Files\x20to\x20upload:\x20','Resume\x20from:\x20','✔\x20Deleted\x20project\x20','\x20(system)','logs','\x20deleted','Project\x20name:\x20','\x20\x20Target:\x20','workflowProject','\x0aFailed\x20to\x20fetch\x20attempt\x20data','sys','session:','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Task\x20name:\x20','workflow:attempts','-\x20nothing\x20pushed','\x20\x20Location:\x20','✔\x20Clone\x20complete','Cancelled','download','\x20\x20Session\x20context\x20set\x20to:\x20','fileSize','value','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','values','relative','finishedAt','cancelRequested','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','targetExists','format','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','diff','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','\x22\x20with\x20new\x20revision?','getTime','Source\x20directory\x20is\x20required','map','\x20sessions\x20','Error:','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Attempt:\x20','site','index','✔\x20Workflow\x20project\x20set\x20to:\x20','fromTask','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','columns','getFullYear','retrySession','Total:\x20','Attempt\x20ID:\x20','blue','Pulling\x20project\x20','isTTY','\x0aPush\x20these\x20changes?','\x1b[1A\x1b[2K','workflow:logs','Tip:\x20cd\x20to\x20workflows/','task','\x0aClone\x20\x22','Target\x20directory:\x20','Cloning\x20to\x20','toISOString','Loading\x20session...','getHours','Session\x20','\x27\x20from\x20project\x20\x27','output','project','2fXfHev','size','jsonl','resolveProject','Error:\x20Secret\x20key\x20is\x20required','log','retryAttempt','New\x20project\x20name:\x20','durationMs','kill','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','planned','stdout','Error:\x20Attempt\x20ID\x20is\x20required','workflow:use','find','\x20\x20Source:\x20','state','force','updatedAt','🔄\x20','sessionId','Retrying\x20session...','\x20secrets\x20set\x20for\x20project\x20\x27','Pull\x20workflow\x20project\x20to\x20local\x20folder','\x0a✔\x20Attempt\x20complete','MAX_LABEL_COUNT','pullProject','Project\x20name\x20is\x20required','retryAttemptName','Pushing\x20project...','\x20unchanged','Dry\x20run:\x20yes','GUTTER','length','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','workflow:secrets:set','workflow:push','lastAttempt','workflow:secrets:list','parseProjectWorkflowPattern','List\x20workflow\x20attempts','\x20\x20tdx\x20wf\x20use\x20<project>','\x20(use\x20--limit\x20to\x20show\x20more)','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','split','Status:\x20','(unknown)','Show\x20specific\x20attempt\x20details','5945640cVAfVm','displayLine','end','\x20from\x20session\x20','isNewProject','resolveProjectDir','all','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','From\x20task:\x20','match','workflow:pull','\x0a✔\x20Already\x20up\x20to\x20date','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','now','reason','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','startTime','navigateSessionsInteractive','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','✔\x20Secret\x20\x27','keys','repeat','stringify','→\x20New\x20project:\x20','sort','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','substring','context','Kill\x20a\x20running\x20attempt','Downloading\x20project\x20','metadata','replace','unknown','set','Updating\x20','\x20\x20Session\x20ID:\x20','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','tdx\x20wf\x20attempt\x20','-\x20no\x20files\x20written','total','localeCompare','Revision:\x20','✔\x20Workflow\x20run\x20started','\x20\x20Console:\x20','\x0aApply\x20these\x20changes?','workflow:sessions','workflows','changes','limit','workflow:secrets:delete','renderTimeline','resumeFrom','renderSessionsTimeline','Latest\x20session\x20has\x20no\x20attempt','logFiles','\x20of\x20','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','window','workflow:download','projectName','startsWith','projectId','\x20task','params','Retry\x20a\x20session\x20or\x20attempt','Project:\x20','cyan','write','Show\x20tasks\x20for\x20an\x20attempt','setSecrets','sourceProjectName','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','\x0aDry\x20run\x20-\x20no\x20project\x20created','\x20\x20New\x20attempt\x20ID:\x20','group_error','42SgXLyd','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','parse','pollTimeline','Killing\x20attempt...','delete','\x20\x20Project\x20ID:\x20','start','revision:\x20','/app/workflows/','Show\x20logs\x20for\x20a\x20workflow\x20attempt','includeRetried','Validation:\x20skipped','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','execute','Include\x20retried:\x20yes','workflow:upload','deleteSecret','hasChanges','indexOf','table','\x0aError:','\x27...','\x22\x20to\x20new\x20project\x20\x22','→\x20Project:\x20','floor','verbose','white','includes','done','run','Error:\x20Invalid\x20JSON\x20in\x20--params','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','deleted','No\x20workflows\x20found','session','newProjectId','slice','tasks','Setting\x20','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','Key\x20cannot\x20be\x20empty','splice','Failed\x20to\x20fetch\x20attempt\x20data','newProjectName','No\x20matching\x20sessions\x20found','revision','red','trim','\x20secret','error','green','LABEL_WIDTH_DIVISOR','skipValidation','attempt','✔\x20Project:\x20','yellow','pending','4745652klNLnU','select','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','trimEnd','📁\x20','attempts','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','listSecrets','Getting\x20attempt\x20tasks...','Retrying\x20attempt...','every','modified','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','No\x20workflow\x20tdx.json\x20found','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','Source:\x20','existingProjectId','msPerChar','\x20has\x20no\x20attempts','from','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','fill','workflow:retry','\x20modified','868FhWAQL','yes','requireProject','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','some','Session\x20time:\x20','✔\x20Push\x20complete','MIN_LABEL_COUNT','push','✔\x20Project\x20updated','prepareCloneProject','workflow','No\x20workflows\x20found\x20in\x20project:\x20','Filter:\x20project=','isArray','workflow:delete','projects','preparePushProject','param','Listing\x20workflow\x20projects...','workflow:clone','Error:\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','round','icon','.\x20Expected\x20format:\x20KEY=VALUE','Writing\x20files...','session_id','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','showWorkflowConsoleUrl','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','/attempt/','3596019clpXQF','No\x20attempts\x20found\x20for:\x20','workflow:timeline','min','Using\x20attempt\x20','📋\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Listing\x20workflow\x20attempts...','⚠\x20Showing\x20first\x20','Filter:\x20','Deleting\x20secret...','No\x20attempts\x20found','buildTimelineData','basename','summary','taskName','workflow:projects','\x22\x20already\x20exists\x20(ID:\x20'];a51_0x15a1=function(){return _0x38f735;};return a51_0x15a1();}function getBarColor(_0x5ef56b){const _0x22292a=a51_0x22a388,_0x3c9c10={'success':a51_0x5bf18c['green'],'error':a51_0x5bf18c[_0x22292a(0xf3)],'group_error':a51_0x5bf18c['red'],'running':a51_0x5bf18c[_0x22292a(0x1ed)],'blocked':a51_0x5bf18c[_0x22292a(0xfc)],'planned':a51_0x5bf18c[_0x22292a(0x1b0)],'canceling':a51_0x5bf18c[_0x22292a(0xfc)]};return _0x3c9c10[_0x5ef56b]||a51_0x5bf18c[_0x22292a(0xdf)];}function parseTaskName(_0x3baa75){const _0x4cb243=a51_0x22a388;let _0xf280cf=_0x3baa75[_0x4cb243(0x24f)](/^\++/,'');const _0x4f6d6f=_0xf280cf[_0x4cb243(0x22c)]('+'),_0xf94e53=_0x4f6d6f[_0x4cb243(0x221)]>0x1?_0x4f6d6f[_0x4cb243(0x221)]-0x2:0x0,_0x1ebcc0=_0x4f6d6f[_0x4f6d6f[_0x4cb243(0x221)]-0x1]||_0xf280cf;return{'level':_0xf94e53,'name':'+'+_0x1ebcc0};}function truncateTaskName(_0x8c2696,_0x3ed74c){const _0x342955=a51_0x22a388,_0x7b2fe4=stringWidth(_0x8c2696);if(_0x7b2fe4<=_0x3ed74c)return _0x8c2696;let _0x3e3a78=_0x8c2696;while(stringWidth(_0x3e3a78+'…')>_0x3ed74c&&_0x3e3a78[_0x342955(0x221)]>0x0){_0x3e3a78=_0x3e3a78['slice'](0x0,-0x1);}return _0x3e3a78+'…';}function calculateTimeScale(_0x1be0e0,_0x1b1ded){const _0x547c1f=a51_0x22a388;return{'startTime':_0x1be0e0[_0x547c1f(0xcb)],'endTime':_0x1be0e0[_0x547c1f(0x232)],'durationMs':_0x1be0e0[_0x547c1f(0x198)],'msPerChar':_0x1be0e0['duration']/_0x1b1ded};}function timeToPosition(_0xf050d0,_0x2e746d,_0x330eb4){const _0x309ec8=a51_0x22a388,_0x3cafe3=_0xf050d0-_0x2e746d[_0x309ec8(0x240)],_0x398b87=Math[_0x309ec8(0xdd)](_0x3cafe3/_0x2e746d[_0x309ec8(0x10f)]);return Math[_0x309ec8(0x170)](0x0,Math[_0x309ec8(0x13a)](_0x398b87,_0x330eb4));}function renderTimeAxis(_0x833dc2,_0x17cb8a){const _0x58cafe=a51_0x22a388,_0x4c6d9e=Math[_0x58cafe(0x13a)](TIMELINE_CONFIG[_0x58cafe(0x219)],Math[_0x58cafe(0x170)](TIMELINE_CONFIG[_0x58cafe(0x11d)],Math[_0x58cafe(0xdd)](_0x17cb8a/TIMELINE_CONFIG[_0x58cafe(0xf8)]))),_0x2896b7=_0x833dc2[_0x58cafe(0x207)]/(_0x4c6d9e-0x1),_0x3a9c8c=new Date(_0x833dc2['startTime']),_0x5964ec=[];for(let _0x2cdd58=0x0;_0x2cdd58<_0x4c6d9e;_0x2cdd58++){const _0x36ae95=_0x833dc2[_0x58cafe(0x240)]+_0x2cdd58*_0x2896b7,_0x20c2cf=timeToPosition(_0x36ae95,_0x833dc2,_0x17cb8a),_0x2a0dc2=formatTimestamp(_0x36ae95,_0x3a9c8c);_0x5964ec[_0x58cafe(0x11e)]({'pos':_0x20c2cf,'text':_0x2a0dc2});}const _0x292427=new Array(_0x17cb8a)['fill']('\x20');let _0x101a2c=-0x1;for(const {pos:_0x21ed09,text:_0x23d630}of _0x5964ec){let _0x233eb8=Math[_0x58cafe(0x170)](0x0,_0x21ed09-Math[_0x58cafe(0xdd)](_0x23d630[_0x58cafe(0x221)]/0x2));_0x233eb8<=_0x101a2c+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x233eb8=_0x101a2c+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x233eb8+_0x23d630[_0x58cafe(0x221)]>_0x17cb8a&&(_0x233eb8=_0x17cb8a-_0x23d630[_0x58cafe(0x221)]);if(_0x233eb8>=0x0&&_0x233eb8+_0x23d630['length']<=_0x17cb8a&&_0x233eb8>_0x101a2c){for(let _0x92766c=0x0;_0x92766c<_0x23d630['length'];_0x92766c++){_0x292427[_0x233eb8+_0x92766c]=_0x23d630[_0x92766c];}_0x101a2c=_0x233eb8+_0x23d630[_0x58cafe(0x221)]-0x1;}}return _0x292427['join']('');}function renderTaskRow(_0x1128de,_0x599c37,_0x3dc06b,_0x5cdd99){const _0x197ae4=a51_0x22a388,{level:_0x1085f0,name:_0x577bce}=parseTaskName(_0x1128de[_0x197ae4(0x174)]),_0x3b00d2='\x20'[_0x197ae4(0x245)](_0x1085f0),_0x471e4c=_0x1128de[_0x197ae4(0xb2)]?'('+formatElapsed(_0x1128de[_0x197ae4(0xb2)][_0x197ae4(0x198)])+')':'',_0x461c04=stringWidth(_0x471e4c),_0x163e85=_0x1085f0*0x1,_0x12d7b8=_0x5cdd99-_0x163e85-_0x461c04-0x1,_0x48db3e=truncateTaskName(_0x577bce,_0x12d7b8),_0x4da87e=_0x3b00d2+_0x48db3e,_0x4414ef=stringWidth(_0x4da87e),_0x1ce73a=_0x5cdd99-_0x4414ef-_0x461c04,_0x43a7d4=_0x4da87e+'\x20'[_0x197ae4(0x245)](Math['max'](0x1,_0x1ce73a))+a51_0x5bf18c['dim'](_0x471e4c),_0x192944=getTaskStateIcon(_0x1128de[_0x197ae4(0x210)]),_0x2fa108=new Array(_0x3dc06b)[_0x197ae4(0x113)]('\x20');if(_0x1128de[_0x197ae4(0xb2)]){const _0x25a88a=timeToPosition(_0x1128de[_0x197ae4(0xb2)]['start'],_0x599c37,_0x3dc06b),_0x458229=timeToPosition(_0x1128de[_0x197ae4(0xb2)][_0x197ae4(0x232)],_0x599c37,_0x3dc06b),_0x4b2c83=getBarChar(_0x1128de[_0x197ae4(0x210)]),_0xc585f8=Math['max'](_0x25a88a+0x1,_0x458229);for(let _0x243c73=_0x25a88a;_0x243c73<Math[_0x197ae4(0x13a)](_0xc585f8,_0x3dc06b);_0x243c73++){_0x2fa108[_0x243c73]=_0x4b2c83;}}const _0xb179ce=getBarColor(_0x1128de['state']),_0x19d77e=_0x2fa108[_0x197ae4(0x1de)](_0x432d7e=>_0x432d7e==='\x20'?'\x20':_0xb179ce(_0x432d7e))[_0x197ae4(0x192)]('');return _0x192944+'\x20'+_0x43a7d4+'│'+_0x19d77e+'│';}function calculateStats(_0x41b1cf){const _0x386e64=a51_0x22a388,_0x19d088={'total':_0x41b1cf['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x367ae1 of _0x41b1cf){if(_0x367ae1['state']===_0x386e64(0x179))_0x19d088[_0x386e64(0x179)]++;else{if(_0x367ae1[_0x386e64(0x210)]==='error'||_0x367ae1[_0x386e64(0x210)]===_0x386e64(0xc3))_0x19d088['error']++;else _0x367ae1[_0x386e64(0x210)]===_0x386e64(0x15b)?_0x19d088[_0x386e64(0x15b)]++:_0x19d088[_0x386e64(0xfd)]++;}}return _0x19d088;}function formatStats(_0x22b928){const _0x43738b=a51_0x22a388;return[_0x43738b(0x1eb)+_0x22b928[_0x43738b(0xa0)],'✅\x20'+_0x22b928[_0x43738b(0x179)],'❌\x20'+_0x22b928[_0x43738b(0xf6)],_0x43738b(0x213)+_0x22b928['running'],'⏳\x20'+_0x22b928[_0x43738b(0xfd)]][_0x43738b(0x192)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x139);[a51_0x22a388(0x1b4)]=a51_0x22a388(0x100);async[a51_0x22a388(0xd2)](_0x5fdb59){const _0xf412ea=a51_0x22a388,{options:_0x530412,args:_0x40c661,tdx:_0x113432}=_0x5fdb59;let _0xfdbae8,_0x49e519,_0x1218c6=![];if(_0x40c661[0x0]){if(_0x40c661[0x0][_0xf412ea(0xe0)]('.')){const _0x12f5c7=this[_0xf412ea(0x227)](_0x40c661,_0x530412);if(!_0x12f5c7)return 0x1;_0xfdbae8=_0x12f5c7[_0xf412ea(0xb4)],_0x49e519=_0x12f5c7[_0xf412ea(0x1b6)];}else{_0x49e519=_0x40c661[0x0],_0xfdbae8=_0x530412['workflowProject'];if(!_0xfdbae8)return console[_0xf412ea(0xf6)](a51_0x5bf18c[_0xf412ea(0xf3)](_0xf412ea(0x1e0)),_0xf412ea(0x14e)),0x1;_0x1218c6=!![];}}else{const _0x28e7cc=this[_0xf412ea(0x227)](_0x40c661,_0x530412);if(!_0x28e7cc)return 0x1;_0xfdbae8=_0x28e7cc[_0xf412ea(0xb4)],_0x49e519=_0x28e7cc[_0xf412ea(0x1b6)];}if(_0x530412[_0xf412ea(0xde)]){if(_0xfdbae8&&_0x49e519)console[_0xf412ea(0xf6)]('Filter:\x20'+_0xfdbae8+'.'+_0x49e519);else _0xfdbae8&&console[_0xf412ea(0xf6)](_0xf412ea(0x123)+_0xfdbae8);}const _0x1bc6b7=_0x530412[_0xf412ea(0x173)],_0x4cbc63=_0x530412[_0xf412ea(0x214)];if(_0x1bc6b7){_0x4cbc63&&console[_0xf412ea(0xf6)](a51_0x5bf18c[_0xf412ea(0xfc)](_0xf412ea(0x16e)),_0xf412ea(0xc5));const _0x50132b=_0x530412[_0xf412ea(0x199)];return _0x50132b?await this[_0xf412ea(0xc7)](_0x5fdb59,_0x1bc6b7):await this[_0xf412ea(0x1b7)](_0x5fdb59,_0x1bc6b7,_0x530412),0x0;}if(_0x4cbc63){const _0x1b7101=await withSpinner(_0xf412ea(0x1f9),()=>_0x113432[_0xf412ea(0x121)][_0xf412ea(0x160)]({'projectName':_0xfdbae8,'workflowName':_0x49e519,'limit':0x64}),{'verbose':_0x530412[_0xf412ea(0xde)]}),_0x1d78cc=_0x1b7101[_0xf412ea(0x195)][_0xf412ea(0x20e)](_0x298ee6=>_0x298ee6['id']===_0x4cbc63);if(!_0x1d78cc)return console['error'](a51_0x5bf18c[_0xf412ea(0xf3)]('Error:'),'Session\x20not\x20found:\x20'+_0x4cbc63),0x1;if(!_0x1d78cc[_0xf412ea(0x225)]?.['id'])return console['error'](a51_0x5bf18c[_0xf412ea(0xf3)]('Error:'),_0xf412ea(0x1fb)+_0x4cbc63+_0xf412ea(0x110)),0x1;const _0x5eb2f6=_0x1d78cc['lastAttempt']['id'];_0x530412[_0xf412ea(0xde)]&&console[_0xf412ea(0xf6)](_0xf412ea(0x13b)+_0x5eb2f6+_0xf412ea(0x233)+_0x4cbc63);const _0x23a67a=_0x530412['follow'];return _0x23a67a?await this[_0xf412ea(0xc7)](_0x5fdb59,_0x5eb2f6):await this[_0xf412ea(0x1b7)](_0x5fdb59,_0x5eb2f6,_0x530412),0x0;}const _0x4dc11d=await withSpinner(_0xf412ea(0x18b),()=>_0x113432[_0xf412ea(0x121)]['sessions']({'projectName':_0xfdbae8,'workflowName':_0x49e519,'limit':_0x530412[_0xf412ea(0xa9)]||0x32}),{'verbose':_0x530412['verbose']}),_0x55a8b9=_0x4dc11d[_0xf412ea(0x195)];if(_0x55a8b9['length']===0x0){if(_0xfdbae8&&_0x49e519)console[_0xf412ea(0xf6)](_0xf412ea(0x177)+_0xfdbae8+'.'+_0x49e519);else _0xfdbae8?console[_0xf412ea(0xf6)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0xfdbae8):(console[_0xf412ea(0xf6)]('No\x20workflow\x20sessions\x20found'),console[_0xf412ea(0xf6)](a51_0x5bf18c[_0xf412ea(0x1b0)](_0xf412ea(0x1a0))));return 0x0;}_0x55a8b9['sort']((_0x2ab334,_0x422c27)=>{const _0x489a3e=_0xf412ea,_0x3569df=_0x2ab334[_0x489a3e(0x16a)]||'',_0x59f2af=_0x422c27[_0x489a3e(0x16a)]||'';return _0x59f2af[_0x489a3e(0xa1)](_0x3569df);});if(_0x530412[_0xf412ea(0x176)]||_0x530412['jsonl'])return await handleSDKOutput(_0x55a8b9,_0x530412),0x0;let _0x5c77c1;if(_0x1218c6){const _0x1c906e=_0x55a8b9[0x0];if(!_0x1c906e[_0xf412ea(0x225)]?.['id'])return console['error'](_0xf412ea(0xae)),0x0;_0x5c77c1=_0x1c906e[_0xf412ea(0x225)]['id'],_0x530412[_0xf412ea(0xde)]&&console['error'](_0xf412ea(0x18f)+_0x1c906e[_0xf412ea(0x16a)]);}else{const _0x2147ec=_0x55a8b9[_0xf412ea(0x1de)](_0x5b4679=>{const _0x1c46f3=_0xf412ea,_0x352be2=getAttemptStatusDisplay(_0x5b4679[_0x1c46f3(0x225)]);return{'title':_0x5b4679[_0x1c46f3(0x1fe)]?.[_0x1c46f3(0x174)]+'.'+_0x5b4679['workflow']?.['name']+'\x20-\x20'+_0x5b4679[_0x1c46f3(0x16a)]+'\x20'+_0x352be2[_0x1c46f3(0x12e)],'value':_0x5b4679[_0x1c46f3(0x225)]?.['id']||'','description':_0x352be2[_0x1c46f3(0x189)]};}),_0x2d0dab=await a51_0x4f4bd3({'type':_0xf412ea(0xff),'name':_0xf412ea(0x173),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x2147ec['filter'](_0x170b7b=>_0x170b7b[_0xf412ea(0x1cf)]!=='')});if(!_0x2d0dab[_0xf412ea(0x173)])return 0x0;_0x5c77c1=_0x2d0dab[_0xf412ea(0x173)];}const _0x2621dd=_0x530412[_0xf412ea(0x199)];return _0x2621dd?await this[_0xf412ea(0xc7)](_0x5fdb59,_0x5c77c1):await this['renderSingleTimeline'](_0x5fdb59,_0x5c77c1,_0x530412),0x0;}async[a51_0x22a388(0x1b7)](_0x5ba2f8,_0x4411ac,_0x4e928c){const _0x2496ab=a51_0x22a388,{tdx:_0x3842bd}=_0x5ba2f8;let _0x47ba86,_0x540252;try{[_0x47ba86,_0x540252]=await Promise[_0x2496ab(0x236)]([_0x3842bd['workflow'][_0x2496ab(0xfa)](_0x4411ac),_0x3842bd[_0x2496ab(0x121)][_0x2496ab(0xea)](_0x4411ac,![])]);}catch(_0x46d48d){console['error'](a51_0x5bf18c[_0x2496ab(0xf3)](_0x2496ab(0xef)));_0x4e928c[_0x2496ab(0xde)]&&console[_0x2496ab(0xf6)](_0x46d48d);throw _0x46d48d;}if(_0x4e928c['json']||_0x4e928c['jsonl']){const _0x5dc369=this['buildTimelineData'](_0x47ba86,_0x540252);await handleSDKOutput([_0x5dc369],_0x4e928c);return;}const _0x398d2d=_0x3842bd[_0x2496ab(0x24b)][_0x2496ab(0x1e3)],_0x20abcc=this[_0x2496ab(0xab)](_0x47ba86,_0x540252,_0x398d2d);console[_0x2496ab(0x204)](_0x20abcc);}async['pollTimeline'](_0x599ba9,_0x4c8fa0){const _0x2710c5=a51_0x22a388,{tdx:_0x2967fb}=_0x599ba9,_0x633545=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x4db982=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x46b5fb=0x0;while(_0x46b5fb<_0x4db982){process[_0x2710c5(0x20b)][_0x2710c5(0x1ef)]&&process['stdout'][_0x2710c5(0xbc)]('\x1bc');let _0x192b6e,_0x3043fd;try{[_0x192b6e,_0x3043fd]=await Promise['all']([_0x2967fb[_0x2710c5(0x121)][_0x2710c5(0xfa)](_0x4c8fa0),_0x2967fb[_0x2710c5(0x121)][_0x2710c5(0xea)](_0x4c8fa0,![])]);}catch(_0x449b55){console[_0x2710c5(0xf6)](a51_0x5bf18c['red'](_0x2710c5(0x1c2)));_0x46b5fb>0x0&&console[_0x2710c5(0xf6)](a51_0x5bf18c[_0x2710c5(0x1b0)](_0x2710c5(0x1a3)+_0x46b5fb));throw _0x449b55;}const _0x21189b=_0x2967fb['context']['site'],_0x164116=this[_0x2710c5(0xab)](_0x192b6e,_0x3043fd,_0x21189b);console[_0x2710c5(0x204)](_0x164116);const _0x431c36=_0x192b6e['done']&&_0x3043fd[_0x2710c5(0x108)](_0x3e7268=>_0x3e7268[_0x2710c5(0x210)]!==_0x2710c5(0x15b)&&_0x3e7268[_0x2710c5(0x210)]!==_0x2710c5(0x20a));if(_0x431c36){console[_0x2710c5(0xf6)](a51_0x5bf18c['green'](_0x2710c5(0x218)));break;}console['error'](a51_0x5bf18c[_0x2710c5(0x1b0)](_0x2710c5(0x169)+_0x46b5fb*0x2+_0x2710c5(0x1e1))),await new Promise(_0x32808d=>setTimeout(_0x32808d,_0x633545)),_0x46b5fb++;}_0x46b5fb>=_0x4db982&&console[_0x2710c5(0xf6)](a51_0x5bf18c['yellow'](_0x2710c5(0x14a)));}['renderTimeline'](_0x389b06,_0x293148,_0x300f97){const _0x41e783=a51_0x22a388,_0x404767=[],_0x428e9c=TIMELINE_CONFIG[_0x41e783(0x1ab)],_0x56930f=0x5,_0x1e7aeb=process[_0x41e783(0x20b)]['columns']||0x78,_0x58487a=_0x1e7aeb-_0x428e9c-_0x56930f,_0x437dbf=Math[_0x41e783(0x170)](TIMELINE_CONFIG[_0x41e783(0x180)],Math['min'](_0x58487a,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x41223d=new Date(_0x389b06['createdAt'])[_0x41e783(0x1dc)](),_0x223a40=_0x389b06['finishedAt']?new Date(_0x389b06['finishedAt'])[_0x41e783(0x1dc)]():Date[_0x41e783(0x23d)](),_0x40ecac={'start':_0x41223d,'end':_0x223a40,'duration':_0x223a40-_0x41223d},_0x4702db=new Map(),_0x5a1e7c=[];for(const _0x29195c of _0x293148){if(_0x29195c[_0x41e783(0x19b)]){const _0x4a8f90=new Date(_0x29195c[_0x41e783(0x19b)])['getTime'](),_0x3719dd=_0x29195c[_0x41e783(0x212)]?new Date(_0x29195c[_0x41e783(0x212)])[_0x41e783(0x1dc)]():Date[_0x41e783(0x23d)](),_0x45519d={'start':_0x4a8f90,'end':_0x3719dd,'duration':_0x3719dd-_0x4a8f90};_0x4702db[_0x41e783(0x9a)](_0x29195c['id'],_0x45519d),_0x5a1e7c[_0x41e783(0x11e)]({'name':_0x29195c[_0x41e783(0x163)],'state':_0x29195c['state']||_0x41e783(0x250),'window':_0x45519d});}else _0x5a1e7c[_0x41e783(0x11e)]({'name':_0x29195c[_0x41e783(0x163)],'state':_0x29195c[_0x41e783(0x210)]||'planned','window':undefined});}_0x5a1e7c[_0x41e783(0x248)]((_0x314cf8,_0x5ac8a6)=>{const _0x5e6741=_0x41e783;if(!_0x314cf8['window'])return 0x1;if(!_0x5ac8a6[_0x5e6741(0xb2)])return-0x1;return _0x314cf8[_0x5e6741(0xb2)]['start']-_0x5ac8a6[_0x5e6741(0xb2)][_0x5e6741(0xcb)];});const _0x47d01e=_0x5a1e7c['length'],_0x103da3=_0x47d01e>TIMELINE_CONFIG[_0x41e783(0x1a7)];_0x103da3&&_0x5a1e7c[_0x41e783(0xee)](TIMELINE_CONFIG[_0x41e783(0x1a7)]);const _0xd56400=calculateTimeScale(_0x40ecac,_0x437dbf),_0x16d7b7=_0x389b06[_0x41e783(0xe1)]?_0x389b06['success']?a51_0x5bf18c[_0x41e783(0xf7)](_0x41e783(0x179)):a51_0x5bf18c[_0x41e783(0xf3)]('error'):a51_0x5bf18c[_0x41e783(0x1ed)](_0x41e783(0x15b)),_0x352435=_0x389b06['project']?.['id'],_0x4dc04c=_0x389b06[_0x41e783(0x214)];let _0x2adc11;if(_0x352435&&_0x4dc04c){const _0x74c979=getWorkflowAttemptUrl(_0x300f97,_0x352435,_0x4dc04c,_0x389b06['id']);_0x2adc11=hyperlink(a51_0x5bf18c[_0x41e783(0x1b0)](_0x389b06['id']),_0x74c979);}else _0x2adc11=a51_0x5bf18c[_0x41e783(0x1b0)](_0x389b06['id']);_0x404767[_0x41e783(0x11e)](_0x41e783(0x1e2)+_0x2adc11+'\x20-\x20'+_0x16d7b7+'\x20-\x20'+formatElapsed(_0x40ecac[_0x41e783(0x198)]));if(_0x5a1e7c['length']>0x0){const _0x283e7f=renderTimeAxis(_0xd56400,_0x437dbf),_0x1f1934=new Date(_0x40ecac[_0x41e783(0xcb)]),_0x8f474=formatDate(_0x1f1934),_0x35475b=TIMELINE_CONFIG[_0x41e783(0x1ae)]+TIMELINE_CONFIG[_0x41e783(0x167)]+_0x428e9c,_0x374828=_0x8f474[_0x41e783(0x17d)](_0x35475b),_0x198669=a51_0x5bf18c[_0x41e783(0x1b0)](_0x374828);_0x404767[_0x41e783(0x11e)](_0x198669+'\x20'+_0x283e7f);for(const _0x508d6e of _0x5a1e7c){_0x404767['push'](renderTaskRow(_0x508d6e,_0xd56400,_0x437dbf,_0x428e9c));}const _0x30e6dc=calculateStats(_0x5a1e7c);_0x404767[_0x41e783(0x11e)](formatStats(_0x30e6dc)),_0x103da3&&_0x404767[_0x41e783(0x11e)](a51_0x5bf18c[_0x41e783(0xfc)](_0x41e783(0x13f)+TIMELINE_CONFIG[_0x41e783(0x1a7)]+_0x41e783(0xb0)+_0x47d01e+_0x41e783(0x16b))),_0x404767[_0x41e783(0x11e)](''),_0x404767[_0x41e783(0x11e)](a51_0x5bf18c[_0x41e783(0x1b0)]('💡\x20Tip:\x20Use\x20')+(_0x41e783(0x9e)+_0x389b06['id']+_0x41e783(0x155))+a51_0x5bf18c[_0x41e783(0x1b0)]('\x20to\x20see\x20detailed\x20logs'));}else _0x404767[_0x41e783(0x11e)](_0x41e783(0x1a1));return _0x404767[_0x41e783(0x192)]('\x0a');}[a51_0x22a388(0x143)](_0x4deb58,_0xabdca1){const _0x3a31bc=a51_0x22a388,_0x14f863=new Date(_0x4deb58['createdAt'])[_0x3a31bc(0x1dc)](),_0x393b96=_0x4deb58[_0x3a31bc(0x1d3)]?new Date(_0x4deb58[_0x3a31bc(0x1d3)])[_0x3a31bc(0x1dc)]():Date[_0x3a31bc(0x23d)](),_0x2d0707=_0x393b96-_0x14f863,_0x34df82=[];for(const _0x451573 of _0xabdca1){if(_0x451573[_0x3a31bc(0x19b)]){const _0x6e2d6=new Date(_0x451573[_0x3a31bc(0x19b)])['getTime'](),_0x3df4ab=_0x451573['updatedAt']?new Date(_0x451573[_0x3a31bc(0x212)])[_0x3a31bc(0x1dc)]():Date['now']();_0x34df82[_0x3a31bc(0x11e)]({'name':_0x451573[_0x3a31bc(0x163)],'state':_0x451573[_0x3a31bc(0x210)]||_0x3a31bc(0x250),'window':{'start':_0x6e2d6,'end':_0x3df4ab,'duration':_0x3df4ab-_0x6e2d6}});}else _0x34df82[_0x3a31bc(0x11e)]({'name':_0x451573[_0x3a31bc(0x163)],'state':_0x451573[_0x3a31bc(0x210)]||'planned','window':undefined});}const _0x215478=calculateStats(_0x34df82);return{'attempt':{'id':_0x4deb58['id'],'status':_0x4deb58[_0x3a31bc(0xe1)]?_0x4deb58[_0x3a31bc(0x179)]?'success':'error':'running','createdAt':_0x4deb58[_0x3a31bc(0x151)],'finishedAt':_0x4deb58['finishedAt'],'duration_ms':_0x2d0707},'tasks':_0x34df82[_0x3a31bc(0x1de)](_0x3ef098=>({'name':_0x3ef098[_0x3a31bc(0x174)],'state':_0x3ef098[_0x3a31bc(0x210)],'startedAt':_0x3ef098['window']?new Date(_0x3ef098[_0x3a31bc(0xb2)][_0x3a31bc(0xcb)])[_0x3a31bc(0x1f8)]():null,'updatedAt':_0x3ef098[_0x3a31bc(0xb2)]?new Date(_0x3ef098[_0x3a31bc(0xb2)]['end'])[_0x3a31bc(0x1f8)]():null,'duration_ms':_0x3ef098[_0x3a31bc(0xb2)]?.[_0x3a31bc(0x198)]||null})),'stats':_0x215478};}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3fbb44,_0x58b8ca){const _0x47b0d4=a52_0x242e,_0x48396e=_0x3fbb44();while(!![]){try{const _0x3f6c1d=-parseInt(_0x47b0d4(0x16a))/0x1*(parseInt(_0x47b0d4(0x164))/0x2)+-parseInt(_0x47b0d4(0x173))/0x3+parseInt(_0x47b0d4(0x172))/0x4*(parseInt(_0x47b0d4(0x16c))/0x5)+-parseInt(_0x47b0d4(0x16d))/0x6*(parseInt(_0x47b0d4(0x168))/0x7)+parseInt(_0x47b0d4(0x16f))/0x8*(-parseInt(_0x47b0d4(0x167))/0x9)+parseInt(_0x47b0d4(0x174))/0xa+-parseInt(_0x47b0d4(0x162))/0xb*(-parseInt(_0x47b0d4(0x169))/0xc);if(_0x3f6c1d===_0x58b8ca)break;else _0x48396e['push'](_0x48396e['shift']());}catch(_0x297984){_0x48396e['push'](_0x48396e['shift']());}}}(a52_0x15e1,0xc4c95));import{platform}from'os';function a52_0x242e(_0x2c233e,_0x5c9922){_0x2c233e=_0x2c233e-0x161;const _0x15e15e=a52_0x15e1();let _0x242e45=_0x15e15e[_0x2c233e];return _0x242e45;}import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a52_0x15e1(){const _0x545f87=['X-Trino-User','898020jpHeux','3829119sRaGzQ','7695580dyNziT','replace','52367656bLURRC','Bearer\x20','2707596HjnVdM','entries','version','13806OPFvrO','8763783kNmjRh','12JmhWgg','1jpKQQg','length','15fxbpjK','6qvEIvc','Authorization','7904dVZINx','TD1\x20'];a52_0x15e1=function(){return _0x545f87;};return a52_0x15e1();}export function getUserAgent(){const _0x459d6e=a52_0x242e,_0x43966e=getVersion(),_0x1b9ed7=platform(),_0x31f743=process[_0x459d6e(0x166)][_0x459d6e(0x161)]('v','');return'tdx/'+_0x43966e+'\x20('+_0x1b9ed7+';\x20node/'+_0x31f743+')';}export function getAuthHeaders(_0x2b9c67,_0x390ebf,_0x2b4229){const _0x1f5b08=a52_0x242e,_0x442127=getVersion(),_0x41bb72={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x442127};if(_0x2b4229)_0x41bb72[_0x1f5b08(0x16e)]=_0x1f5b08(0x163)+_0x2b4229;else _0x390ebf&&(_0x41bb72[_0x1f5b08(0x16e)]=_0x1f5b08(0x170)+_0x390ebf);return _0x41bb72;}export function toHeaderRecord(_0x2f8bc2){const _0x3cc974=a52_0x242e,_0x3d2ec9={};for(const [_0x520420,_0x4826c3]of Object[_0x3cc974(0x165)](_0x2f8bc2)){_0x4826c3!==undefined&&(_0x3d2ec9[_0x520420]=_0x4826c3);}return _0x3d2ec9;}export function getTrinoHeaders(_0x4ae0a3,_0x18a2bb,_0x1dfa5d){const _0x19cee0=a52_0x242e,_0x58aad4=getAuthHeaders(_0x4ae0a3),_0xa1e1fa=toHeaderRecord(_0x58aad4);if(_0x1dfa5d)_0xa1e1fa[_0x19cee0(0x16e)]=_0x19cee0(0x163)+_0x1dfa5d;else _0x18a2bb&&(_0xa1e1fa[_0x19cee0(0x171)]=_0x18a2bb);return _0xa1e1fa;}export function hasAPIKey(_0x2340a2){const _0x5f2e23=a52_0x242e,_0x1523ad=getAPIKey();return _0x1523ad!==undefined&&_0x1523ad[_0x5f2e23(0x16b)]>0x0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4ae855,_0x3d3533){const _0xf45d8e=a53_0x4465,_0xbeaf33=_0x4ae855();while(!![]){try{const _0x3dca5c=-parseInt(_0xf45d8e(0x121))/0x1+parseInt(_0xf45d8e(0x109))/0x2*(-parseInt(_0xf45d8e(0x103))/0x3)+-parseInt(_0xf45d8e(0x105))/0x4+-parseInt(_0xf45d8e(0x122))/0x5+-parseInt(_0xf45d8e(0x11b))/0x6*(parseInt(_0xf45d8e(0x10b))/0x7)+parseInt(_0xf45d8e(0xf5))/0x8*(-parseInt(_0xf45d8e(0x117))/0x9)+parseInt(_0xf45d8e(0x126))/0xa;if(_0x3dca5c===_0x3d3533)break;else _0xbeaf33['push'](_0xbeaf33['shift']());}catch(_0x1b0b8e){_0xbeaf33['push'](_0xbeaf33['shift']());}}}(a53_0x101c,0x4f40a));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a53_0x3eb13a from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x5a63f0){const _0x1d190f=a53_0x4465;return _0x5a63f0[_0x1d190f(0x12f)]===_0x1d190f(0x100)||_0x5a63f0[_0x1d190f(0x12f)]==='jsonl'||_0x5a63f0[_0x1d190f(0x12f)]===_0x1d190f(0x136)||_0x5a63f0[_0x1d190f(0x12f)]===_0x1d190f(0x11d)||_0x5a63f0['json']===!![]||_0x5a63f0['jsonl']===!![]||_0x5a63f0[_0x1d190f(0x136)]===!![]||_0x5a63f0[_0x1d190f(0x11d)]===!![];}export function parseOutputOptions(_0x432c55){const _0x17c671=a53_0x4465;return{'format':_0x432c55[_0x17c671(0x12f)]||_0x17c671(0x11d),'output':_0x432c55[_0x17c671(0xf8)]||'','limit':_0x432c55['limit'],'limitStructuredFormats':_0x432c55[_0x17c671(0x123)],'color':_0x432c55[_0x17c671(0x10a)],'noColor':_0x432c55[_0x17c671(0x106)]};}function convertSDKResultToQueryResult(_0x4c5b67){const _0x25a15b=a53_0x4465,_0x16843c=[];if(_0x4c5b67[_0x25a15b(0x12d)]>0x0){const _0x1e65c5=_0x4c5b67[0x0];for(const [_0x5174d1,_0xe7eef6]of Object[_0x25a15b(0x138)](_0x1e65c5)){let _0x4c3117=_0x25a15b(0x118);if(typeof _0xe7eef6==='number')_0x4c3117=Number['isInteger'](_0xe7eef6)?_0x25a15b(0xf4):_0x25a15b(0x11f);else{if(typeof _0xe7eef6===_0x25a15b(0x108))_0x4c3117=_0x25a15b(0x108);else _0xe7eef6===null&&(_0x4c3117=_0x25a15b(0x118));}_0x16843c[_0x25a15b(0x116)]({'name':_0x5174d1,'type':_0x4c3117});}}return{'queryId':'sdk-result','columns':_0x16843c,'data':_0x4c5b67,'stats':{'state':_0x25a15b(0x135),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x4c5b67[_0x25a15b(0x12d)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x5bd09a,_0x1e126e){const _0x314001=convertSDKResultToQueryResult(_0x5bd09a);return formatQueryOutput(_0x314001,_0x1e126e);}export async function formatQueryOutput(_0x2d9ed2,_0x4e1a32){const _0x2e7bd0=a53_0x4465,{format:_0x3fded1,limit:_0x1635c7,output:_0x5e5597,color:_0x5e2806,noColor:_0x5ce790,limitStructuredFormats:_0xf43a5c}=_0x4e1a32,_0xd06b5c=Boolean(_0x5e5597)&&!_0x5e2806,_0x17a154={'color':_0x5e2806,'noColor':_0x5ce790||_0xd06b5c};if(_0x3fded1===_0x2e7bd0(0x11d)){const _0x399fbd=shouldUseLess(_0x3fded1,_0x5e5597);return formatAsTable(_0x2d9ed2,_0x1635c7,_0x399fbd,_0x17a154);}const _0x50c1c0=_0xf43a5c&&Number[_0x2e7bd0(0x10c)](_0x1635c7)&&_0x2d9ed2[_0x2e7bd0(0x130)][_0x2e7bd0(0x12d)]>_0x1635c7?{..._0x2d9ed2,'data':_0x2d9ed2[_0x2e7bd0(0x130)]['slice'](0x0,_0x1635c7)}:_0x2d9ed2;if(_0x3fded1===_0x2e7bd0(0x100))return formatAsJSON(_0x50c1c0,_0x17a154);else return _0x3fded1==='jsonl'?formatAsJSONL(_0x50c1c0,_0x17a154):formatQueryResult(_0x50c1c0,_0x3fded1);}function shouldUseLess(_0x188828,_0x94699c){const _0x2c0272=a53_0x4465;return(_0x188828===_0x2c0272(0x11d)||_0x188828===_0x2c0272(0x137))&&process['stdout'][_0x2c0272(0x133)]&&!_0x94699c;}export function resolveOutputOptions(_0x56a7ed){const _0x4f3e37=a53_0x4465,_0x5a6cab=_0x56a7ed[_0x4f3e37(0xf8)]||'',_0x14982e=resolveOutputFormat(_0x56a7ed['format'],_0x5a6cab,_0x4f3e37(0x11d));let _0x17017d=typeof _0x56a7ed['limit']===_0x4f3e37(0x120)?_0x56a7ed[_0x4f3e37(0x112)]:parseInt(_0x56a7ed[_0x4f3e37(0x112)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x56a7ed[_0x4f3e37(0x112)]===undefined&&shouldUseLess(_0x14982e,_0x5a6cab)&&(_0x17017d=Infinity),{'format':_0x14982e,'output':_0x5a6cab,'limit':_0x17017d,'limitStructuredFormats':_0x56a7ed[_0x4f3e37(0x123)],'color':_0x56a7ed[_0x4f3e37(0x10a)],'noColor':_0x56a7ed[_0x4f3e37(0x106)]};}function a53_0x101c(){const _0x3dec18=['filter','split','trim','[rule]','cmdout','json','map','keys','1065iOcaNW','No\x20data','479520FUcBhp','noColor','stdin','boolean','1262jUIjLQ','color','659911ARvdOX','isFinite','padEnd','error','stringify','[error]','join','limit','repeat','log','params','push','9xSaDws','varchar','max','write','30rxnVNm','blue','table','end','double','number','612689DxwFxR','935550LBGsLn','limitStructuredFormats','inherit','yellow','23144960nawdCZ','query','resolve','spawn','close','stderr','object','length','rule','format','data','pipe','─┬─','isTTY','less','FINISHED','tsv','list','entries','forEach','[Object]','bigint','2998632xPUvIW','─┴─','jsonl','output','red','bold'];a53_0x101c=function(){return _0x3dec18;};return a53_0x101c();}export function writeOutput(_0x421efd,_0x2ad708,_0x309d9d){const _0x3abf69=a53_0x4465;return _0x2ad708?(writeFileSync(_0x2ad708,_0x421efd),console[_0x3abf69(0x10e)]('Results\x20saved\x20to\x20'+_0x2ad708),Promise[_0x3abf69(0x128)]()):shouldUseLess(_0x309d9d||'','')?new Promise(_0xb3516b=>{const _0xe0e794=_0x3abf69,_0x353312=spawn(_0xe0e794(0x134),['-FXRSn'],{'stdio':[_0xe0e794(0x131),_0xe0e794(0x124),_0xe0e794(0x124)]});let _0x5031ef=![];_0x353312['on']('error',()=>{const _0x136993=_0xe0e794;!_0x5031ef&&(_0x5031ef=!![],console[_0x136993(0x114)](_0x421efd),_0xb3516b());}),_0x353312['on'](_0xe0e794(0x12a),()=>{!_0x5031ef&&(_0x5031ef=!![],_0xb3516b());}),_0x353312['on'](_0xe0e794(0x129),()=>{const _0x4e7576=_0xe0e794;!_0x5031ef&&_0x353312[_0x4e7576(0x107)]&&(_0x353312[_0x4e7576(0x107)]['on'](_0x4e7576(0x10e),()=>{}),_0x353312[_0x4e7576(0x107)][_0x4e7576(0x11a)](_0x421efd),_0x353312[_0x4e7576(0x107)][_0x4e7576(0x11e)]());}),!_0x353312[_0xe0e794(0x107)]&&(!_0x5031ef&&(_0x5031ef=!![],console[_0xe0e794(0x114)](_0x421efd),_0xb3516b()));}):(console[_0x3abf69(0x114)](_0x421efd),Promise[_0x3abf69(0x128)]());}export async function handleSDKOutput(_0x559245,_0x2d112b){const _0x35e2c5=a53_0x4465,_0x1af3ee=resolveOutputOptions(_0x2d112b),_0x14b377=await formatSDKOutput(_0x559245,_0x1af3ee);await writeOutput(_0x14b377,_0x1af3ee[_0x35e2c5(0xf8)]||undefined,_0x1af3ee[_0x35e2c5(0x12f)]);}function a53_0x4465(_0x4034e9,_0x450523){_0x4034e9=_0x4034e9-0xf3;const _0x101c66=a53_0x101c();let _0x4465be=_0x101c66[_0x4034e9];return _0x4465be;}export async function handleQueryOutput(_0x4bccd9,_0x9631d9){const _0x1a9b74=a53_0x4465,_0x38401d=resolveOutputOptions(_0x9631d9),_0x43d812=await formatQueryOutput(_0x4bccd9,_0x38401d);await writeOutput(_0x43d812,_0x38401d[_0x1a9b74(0xf8)]||undefined,_0x38401d[_0x1a9b74(0x12f)]);}async function formatSingleObject(_0x3720c0,_0x5a425a){const _0x1da4f6=a53_0x4465,{format:_0x5673d6,color:_0x25d3cc,noColor:_0x4c54fb}=_0x5a425a,_0x3705c7={'color':_0x25d3cc,'noColor':_0x4c54fb};if(_0x5673d6==='json'){if(shouldUseColor(_0x3705c7))return colorizeJSON(_0x3720c0,_0x3705c7);return JSON['stringify'](_0x3720c0,null,0x2);}else{if(_0x5673d6===_0x1da4f6(0xf7)){if(shouldUseColor(_0x3705c7))return colorizeJSONCompact(_0x3720c0,_0x3705c7);return JSON[_0x1da4f6(0x10f)](_0x3720c0);}else{if(_0x5673d6===_0x1da4f6(0x136))return Object[_0x1da4f6(0x138)](_0x3720c0)[_0x1da4f6(0x101)](([_0x2d1a61,_0x297d1a])=>_0x2d1a61+'\x09'+_0x297d1a)['join']('\x0a');else{const _0x547c1e=Object[_0x1da4f6(0x138)](_0x3720c0);if(_0x547c1e[_0x1da4f6(0x12d)]===0x0)return _0x1da4f6(0x104);const _0x58ef46=_0x3720c0['debug'],_0x4362de=_0x3720c0[_0x1da4f6(0x127)],_0x5af9fa=_0x3720c0[_0x1da4f6(0x115)],_0x4e8c0c=_0x3720c0['rule'],_0xc721bb=_0x4362de?typeof _0x4362de==='string'?_0x4362de:JSON[_0x1da4f6(0x10f)](_0x4362de,null,0x2):undefined,_0x61963b=_0x5af9fa&&Object[_0x1da4f6(0x102)](_0x5af9fa)[_0x1da4f6(0x12d)]>0x0?JSON[_0x1da4f6(0x10f)](_0x5af9fa,null,0x2):undefined,_0x32e2f2=_0x4e8c0c&&Object[_0x1da4f6(0x102)](_0x4e8c0c)[_0x1da4f6(0x12d)]>0x0?JSON[_0x1da4f6(0x10f)](_0x4e8c0c,null,0x2):undefined,_0x67a132=_0x547c1e[_0x1da4f6(0xfb)](([_0x316fdb])=>_0x316fdb!=='debug'&&_0x316fdb!==_0x1da4f6(0x127)&&_0x316fdb!==_0x1da4f6(0x115)&&_0x316fdb!==_0x1da4f6(0x12e)),_0x3ecfd=Math['max'](..._0x67a132[_0x1da4f6(0x101)](([_0x4fde10])=>_0x4fde10[_0x1da4f6(0x12d)])),_0x3cb399=Math['max'](..._0x67a132[_0x1da4f6(0x101)](([,_0x430d3b])=>{const _0x299573=_0x1da4f6;try{const _0x21f358=_0x430d3b===null||_0x430d3b===undefined?'':typeof _0x430d3b===_0x299573(0x12c)?JSON['stringify'](_0x430d3b):String(_0x430d3b),_0x4fdcea=_0x21f358[_0x299573(0xfc)]('\x0a');return Math[_0x299573(0x119)](..._0x4fdcea['map'](_0x53e86a=>_0x53e86a[_0x299573(0x12d)]),0x0);}catch{return 0x0;}}),0x14),_0x3c80ea=[];_0x3c80ea[_0x1da4f6(0x116)](colorBorder('┌─'+'─'[_0x1da4f6(0x113)](_0x3ecfd)+_0x1da4f6(0x132)+'─'[_0x1da4f6(0x113)](_0x3cb399)+'─┐',_0x3705c7)),_0x67a132[_0x1da4f6(0x139)](([_0x217343,_0x3231ab])=>{const _0x2396b6=_0x1da4f6;let _0x3e4a4c;try{_0x3e4a4c=_0x3231ab===null||_0x3231ab===undefined?'':typeof _0x3231ab===_0x2396b6(0x12c)?JSON[_0x2396b6(0x10f)](_0x3231ab):String(_0x3231ab);}catch{_0x3e4a4c=_0x2396b6(0xf3);}const _0x30aeca=_0x217343[_0x2396b6(0x10d)](_0x3ecfd),_0x467b1f=_0x3e4a4c[_0x2396b6(0xfc)]('\x0a');_0x467b1f[_0x2396b6(0x139)]((_0x21a0c2,_0x11a82c)=>{const _0x2e9ea0=_0x2396b6,_0x2a5d00=colorBorder('│',_0x3705c7);_0x11a82c===0x0?_0x3c80ea['push'](_0x2a5d00+'\x20'+_0x30aeca+'\x20'+_0x2a5d00+'\x20'+_0x21a0c2[_0x2e9ea0(0x10d)](_0x3cb399)+'\x20'+_0x2a5d00):_0x3c80ea[_0x2e9ea0(0x116)](_0x2a5d00+'\x20'+'\x20'[_0x2e9ea0(0x113)](_0x3ecfd)+'\x20'+_0x2a5d00+'\x20'+_0x21a0c2[_0x2e9ea0(0x10d)](_0x3cb399)+'\x20'+_0x2a5d00);});}),_0x3c80ea['push'](colorBorder('└─'+'─'[_0x1da4f6(0x113)](_0x3ecfd)+_0x1da4f6(0xf6)+'─'['repeat'](_0x3cb399)+'─┘',_0x3705c7));_0xc721bb&&(_0x3c80ea[_0x1da4f6(0x116)](''),_0x3c80ea[_0x1da4f6(0x116)](String(a53_0x3eb13a[_0x1da4f6(0x125)][_0x1da4f6(0xfa)]('[query]'))),_0x3c80ea[_0x1da4f6(0x116)](_0xc721bb));_0x61963b&&(_0x3c80ea[_0x1da4f6(0x116)](''),_0x3c80ea[_0x1da4f6(0x116)](String(a53_0x3eb13a[_0x1da4f6(0x11c)]['bold']('[params]'))),_0x3c80ea['push'](_0x61963b));_0x32e2f2&&(_0x3c80ea[_0x1da4f6(0x116)](''),_0x3c80ea[_0x1da4f6(0x116)](String(a53_0x3eb13a['magenta']['bold'](_0x1da4f6(0xfe)))),_0x3c80ea['push'](_0x32e2f2));if(_0x58ef46){if(_0x58ef46[_0x1da4f6(0x12b)]){_0x3c80ea[_0x1da4f6(0x116)](''),_0x3c80ea[_0x1da4f6(0x116)](String(a53_0x3eb13a[_0x1da4f6(0xf9)][_0x1da4f6(0xfa)](_0x1da4f6(0x110))));const _0x2226f7=_0x58ef46[_0x1da4f6(0x12b)][_0x1da4f6(0xfc)]('\x0a');_0x2226f7[_0x1da4f6(0x139)](_0x4a4db2=>{const _0x356e34=_0x1da4f6;_0x4a4db2['trim']()&&_0x3c80ea[_0x356e34(0x116)](_0x4a4db2);});}if(_0x58ef46[_0x1da4f6(0xff)]){_0x3c80ea['push'](''),_0x3c80ea['push'](String(a53_0x3eb13a['cyan'][_0x1da4f6(0xfa)]('[logs]')));const _0x2155ba=_0x58ef46['cmdout'][_0x1da4f6(0xfc)]('\x0a');_0x2155ba[_0x1da4f6(0x139)](_0x5ced42=>{const _0x3ff514=_0x1da4f6;_0x5ced42[_0x3ff514(0xfd)]()&&_0x3c80ea['push'](_0x5ced42);});}}return _0x3c80ea[_0x1da4f6(0x111)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x2af191,_0x119ece){const _0x648ba=a53_0x4465;if(_0x119ece[_0x648ba(0x12f)]===_0x648ba(0x11d)){await handleSDKOutput([_0x2af191],_0x119ece);return;}const _0x4f0332=resolveOutputOptions(_0x119ece),_0xec9c98=await formatSingleObject(_0x2af191,_0x4f0332);await writeOutput(_0xec9c98,_0x4f0332[_0x648ba(0xf8)]||undefined,_0x4f0332[_0x648ba(0x12f)]);}
|
|
1
|
+
(function(_0x44f65f,_0xe75728){const _0x2e3210=a53_0x5ef9,_0x233248=_0x44f65f();while(!![]){try{const _0x418919=-parseInt(_0x2e3210(0x1bb))/0x1+parseInt(_0x2e3210(0x1c3))/0x2+-parseInt(_0x2e3210(0x197))/0x3*(-parseInt(_0x2e3210(0x1a0))/0x4)+parseInt(_0x2e3210(0x1bf))/0x5*(-parseInt(_0x2e3210(0x188))/0x6)+parseInt(_0x2e3210(0x18e))/0x7*(-parseInt(_0x2e3210(0x193))/0x8)+-parseInt(_0x2e3210(0x19a))/0x9*(-parseInt(_0x2e3210(0x196))/0xa)+parseInt(_0x2e3210(0x19c))/0xb;if(_0x418919===_0xe75728)break;else _0x233248['push'](_0x233248['shift']());}catch(_0x29f9c8){_0x233248['push'](_0x233248['shift']());}}}(a53_0x1d70,0x48722));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a53_0x187921 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x1cc55c){const _0x156f42=a53_0x5ef9;return _0x1cc55c[_0x156f42(0x1c1)]==='json'||_0x1cc55c[_0x156f42(0x1c1)]===_0x156f42(0x1a2)||_0x1cc55c[_0x156f42(0x1c1)]===_0x156f42(0x195)||_0x1cc55c['format']==='table'||_0x1cc55c[_0x156f42(0x194)]===!![]||_0x1cc55c[_0x156f42(0x1a2)]===!![]||_0x1cc55c[_0x156f42(0x195)]===!![]||_0x1cc55c[_0x156f42(0x1be)]===!![];}function a53_0x1d70(){const _0x3ae2d5=['error','length','push','limit','resolve','[error]','inherit','[rule]','object','─┴─','152671SEMZyN','limitStructuredFormats','repeat','table','415ttBhmz','spawn','format','No\x20data','890934YOfdmK','close','params','cyan','bigint','blue','trim','list','bold','pipe','cmdout','end','filter','write','less','noColor','14604GzntGw','FINISHED','rule','max','number','-FXRSn','112cCRCJk','varchar','split','padEnd','map','176744UZNTSc','json','tsv','17300iDNAZY','3PYoqUF','red','join','711cXjSPz','debug','1338359BmmDqz','stdin','stringify','forEach','1204452SqOdfc','color','jsonl','log','boolean','[logs]','entries','data','isInteger','query','keys','isFinite','stderr','output','string','Results\x20saved\x20to\x20','[query]'];a53_0x1d70=function(){return _0x3ae2d5;};return a53_0x1d70();}export function parseOutputOptions(_0x472f8b){const _0x4f5f1c=a53_0x5ef9;return{'format':_0x472f8b[_0x4f5f1c(0x1c1)]||'table','output':_0x472f8b['output']||'','limit':_0x472f8b[_0x4f5f1c(0x1b4)],'limitStructuredFormats':_0x472f8b[_0x4f5f1c(0x1bc)],'color':_0x472f8b[_0x4f5f1c(0x1a1)],'noColor':_0x472f8b[_0x4f5f1c(0x187)]};}function convertSDKResultToQueryResult(_0x30f7fa){const _0x51534d=a53_0x5ef9,_0xb1ecd6=[];if(_0x30f7fa[_0x51534d(0x1b2)]>0x0){const _0x1044d6=_0x30f7fa[0x0];for(const [_0x36a06b,_0x39fe73]of Object[_0x51534d(0x1a6)](_0x1044d6)){let _0x47698d=_0x51534d(0x18f);if(typeof _0x39fe73===_0x51534d(0x18c))_0x47698d=Number[_0x51534d(0x1a8)](_0x39fe73)?_0x51534d(0x1c7):'double';else{if(typeof _0x39fe73==='boolean')_0x47698d=_0x51534d(0x1a4);else _0x39fe73===null&&(_0x47698d='varchar');}_0xb1ecd6[_0x51534d(0x1b3)]({'name':_0x36a06b,'type':_0x47698d});}}return{'queryId':'sdk-result','columns':_0xb1ecd6,'data':_0x30f7fa,'stats':{'state':_0x51534d(0x189),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x30f7fa[_0x51534d(0x1b2)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x193f05,_0xabd7e4){const _0x44a09a=convertSDKResultToQueryResult(_0x193f05);return formatQueryOutput(_0x44a09a,_0xabd7e4);}export async function formatQueryOutput(_0x337db1,_0x15b64d){const _0x18af89=a53_0x5ef9,{format:_0x1e2fab,limit:_0x221370,output:_0x2e523e,color:_0x22de72,noColor:_0x3f7673,limitStructuredFormats:_0x28ab22}=_0x15b64d,_0xe68817=Boolean(_0x2e523e)&&!_0x22de72,_0x289016={'color':_0x22de72,'noColor':_0x3f7673||_0xe68817};if(_0x1e2fab===_0x18af89(0x1be)){const _0x4a2205=shouldUseLess(_0x1e2fab,_0x2e523e);return formatAsTable(_0x337db1,_0x221370,_0x4a2205,_0x289016);}const _0x28d30e=_0x28ab22&&Number[_0x18af89(0x1ab)](_0x221370)&&_0x337db1[_0x18af89(0x1a7)]['length']>_0x221370?{..._0x337db1,'data':_0x337db1[_0x18af89(0x1a7)]['slice'](0x0,_0x221370)}:_0x337db1;if(_0x1e2fab===_0x18af89(0x194))return formatAsJSON(_0x28d30e,_0x289016);else return _0x1e2fab==='jsonl'?formatAsJSONL(_0x28d30e,_0x289016):formatQueryResult(_0x28d30e,_0x1e2fab);}function shouldUseLess(_0x18d216,_0x3c183d){const _0x422c8b=a53_0x5ef9;return(_0x18d216===_0x422c8b(0x1be)||_0x18d216===_0x422c8b(0x1ca))&&process['stdout']['isTTY']&&!_0x3c183d;}export function resolveOutputOptions(_0x3dd2e3){const _0x9c341=a53_0x5ef9,_0x216e65=_0x3dd2e3['output']||'',_0x13a95a=resolveOutputFormat(_0x3dd2e3[_0x9c341(0x1c1)],_0x216e65,'table');let _0x247e25=typeof _0x3dd2e3[_0x9c341(0x1b4)]===_0x9c341(0x18c)?_0x3dd2e3[_0x9c341(0x1b4)]:parseInt(_0x3dd2e3[_0x9c341(0x1b4)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x3dd2e3[_0x9c341(0x1b4)]===undefined&&shouldUseLess(_0x13a95a,_0x216e65)&&(_0x247e25=Infinity),{'format':_0x13a95a,'output':_0x216e65,'limit':_0x247e25,'limitStructuredFormats':_0x3dd2e3['limitStructuredFormats'],'color':_0x3dd2e3[_0x9c341(0x1a1)],'noColor':_0x3dd2e3[_0x9c341(0x187)]};}export function writeOutput(_0x44414b,_0xd54b1b,_0x735ff8){const _0x29bee1=a53_0x5ef9;return _0xd54b1b?(writeFileSync(_0xd54b1b,_0x44414b),console[_0x29bee1(0x1b1)](_0x29bee1(0x1af)+_0xd54b1b),Promise[_0x29bee1(0x1b5)]()):shouldUseLess(_0x735ff8||'','')?new Promise(_0x2b1cd4=>{const _0x2fb0fa=_0x29bee1,_0x2264ac=spawn(_0x2fb0fa(0x186),[_0x2fb0fa(0x18d)],{'stdio':[_0x2fb0fa(0x1cc),_0x2fb0fa(0x1b7),_0x2fb0fa(0x1b7)]});let _0x5de27a=![];_0x2264ac['on']('error',()=>{const _0x1e0812=_0x2fb0fa;!_0x5de27a&&(_0x5de27a=!![],console[_0x1e0812(0x1a3)](_0x44414b),_0x2b1cd4());}),_0x2264ac['on'](_0x2fb0fa(0x1c4),()=>{!_0x5de27a&&(_0x5de27a=!![],_0x2b1cd4());}),_0x2264ac['on'](_0x2fb0fa(0x1c0),()=>{const _0x51593d=_0x2fb0fa;!_0x5de27a&&_0x2264ac['stdin']&&(_0x2264ac[_0x51593d(0x19d)]['on'](_0x51593d(0x1b1),()=>{}),_0x2264ac['stdin'][_0x51593d(0x185)](_0x44414b),_0x2264ac[_0x51593d(0x19d)][_0x51593d(0x183)]());}),!_0x2264ac[_0x2fb0fa(0x19d)]&&(!_0x5de27a&&(_0x5de27a=!![],console[_0x2fb0fa(0x1a3)](_0x44414b),_0x2b1cd4()));}):(console[_0x29bee1(0x1a3)](_0x44414b),Promise[_0x29bee1(0x1b5)]());}export async function handleSDKOutput(_0x4fcb8b,_0xcaaf86){const _0x14e085=a53_0x5ef9,_0x1f3639=resolveOutputOptions(_0xcaaf86),_0x5bc09b=await formatSDKOutput(_0x4fcb8b,_0x1f3639);await writeOutput(_0x5bc09b,_0x1f3639[_0x14e085(0x1ad)]||undefined,_0x1f3639[_0x14e085(0x1c1)]);}export async function handleQueryOutput(_0x330860,_0x38ed13){const _0x18879a=a53_0x5ef9,_0x451ad5=resolveOutputOptions(_0x38ed13),_0x3b34e1=await formatQueryOutput(_0x330860,_0x451ad5);await writeOutput(_0x3b34e1,_0x451ad5[_0x18879a(0x1ad)]||undefined,_0x451ad5[_0x18879a(0x1c1)]);}function a53_0x5ef9(_0x24be92,_0x378a95){_0x24be92=_0x24be92-0x183;const _0x1d70e9=a53_0x1d70();let _0x5ef986=_0x1d70e9[_0x24be92];return _0x5ef986;}async function formatSingleObject(_0x52b0f0,_0x4dbdc0){const _0x2170bb=a53_0x5ef9,{format:_0x33e1ba,color:_0x154650,noColor:_0x1e67a3}=_0x4dbdc0,_0x155f0e={'color':_0x154650,'noColor':_0x1e67a3};if(_0x33e1ba===_0x2170bb(0x194)){if(shouldUseColor(_0x155f0e))return colorizeJSON(_0x52b0f0,_0x155f0e);return JSON[_0x2170bb(0x19e)](_0x52b0f0,null,0x2);}else{if(_0x33e1ba===_0x2170bb(0x1a2)){if(shouldUseColor(_0x155f0e))return colorizeJSONCompact(_0x52b0f0,_0x155f0e);return JSON[_0x2170bb(0x19e)](_0x52b0f0);}else{if(_0x33e1ba===_0x2170bb(0x195))return Object[_0x2170bb(0x1a6)](_0x52b0f0)[_0x2170bb(0x192)](([_0x153c02,_0x4e458f])=>_0x153c02+'\x09'+_0x4e458f)[_0x2170bb(0x199)]('\x0a');else{const _0x1a2a66=Object[_0x2170bb(0x1a6)](_0x52b0f0);if(_0x1a2a66[_0x2170bb(0x1b2)]===0x0)return _0x2170bb(0x1c2);const _0x419c28=_0x52b0f0[_0x2170bb(0x19b)],_0x5664e8=_0x52b0f0['query'],_0x194282=_0x52b0f0[_0x2170bb(0x1c5)],_0x58b3db=_0x52b0f0[_0x2170bb(0x18a)],_0x289d24=_0x5664e8?typeof _0x5664e8===_0x2170bb(0x1ae)?_0x5664e8:JSON[_0x2170bb(0x19e)](_0x5664e8,null,0x2):undefined,_0x377cbe=_0x194282&&Object[_0x2170bb(0x1aa)](_0x194282)[_0x2170bb(0x1b2)]>0x0?JSON['stringify'](_0x194282,null,0x2):undefined,_0xae9b7d=_0x58b3db&&Object['keys'](_0x58b3db)[_0x2170bb(0x1b2)]>0x0?JSON[_0x2170bb(0x19e)](_0x58b3db,null,0x2):undefined,_0x2e6e32=_0x1a2a66[_0x2170bb(0x184)](([_0x1d0c37])=>_0x1d0c37!==_0x2170bb(0x19b)&&_0x1d0c37!==_0x2170bb(0x1a9)&&_0x1d0c37!=='params'&&_0x1d0c37!==_0x2170bb(0x18a)),_0xf7a253=Math[_0x2170bb(0x18b)](..._0x2e6e32[_0x2170bb(0x192)](([_0x3d2e76])=>_0x3d2e76[_0x2170bb(0x1b2)])),_0xb25567=Math[_0x2170bb(0x18b)](..._0x2e6e32[_0x2170bb(0x192)](([,_0x3baea4])=>{const _0x2fa8ce=_0x2170bb;try{const _0x487b18=_0x3baea4===null||_0x3baea4===undefined?'':typeof _0x3baea4===_0x2fa8ce(0x1b9)?JSON[_0x2fa8ce(0x19e)](_0x3baea4):String(_0x3baea4),_0x5e6d9c=_0x487b18[_0x2fa8ce(0x190)]('\x0a');return Math[_0x2fa8ce(0x18b)](..._0x5e6d9c[_0x2fa8ce(0x192)](_0x191aa5=>_0x191aa5[_0x2fa8ce(0x1b2)]),0x0);}catch{return 0x0;}}),0x14),_0x29f0ce=[];_0x29f0ce[_0x2170bb(0x1b3)](colorBorder('┌─'+'─'['repeat'](_0xf7a253)+'─┬─'+'─'[_0x2170bb(0x1bd)](_0xb25567)+'─┐',_0x155f0e)),_0x2e6e32[_0x2170bb(0x19f)](([_0x38ef06,_0x130a66])=>{const _0x54e95e=_0x2170bb;let _0x4bcafb;try{_0x4bcafb=_0x130a66===null||_0x130a66===undefined?'':typeof _0x130a66===_0x54e95e(0x1b9)?JSON[_0x54e95e(0x19e)](_0x130a66):String(_0x130a66);}catch{_0x4bcafb='[Object]';}const _0x12cff6=_0x38ef06[_0x54e95e(0x191)](_0xf7a253),_0x1cf1a5=_0x4bcafb[_0x54e95e(0x190)]('\x0a');_0x1cf1a5[_0x54e95e(0x19f)]((_0x54b269,_0x2daadc)=>{const _0x247256=_0x54e95e,_0x1e8940=colorBorder('│',_0x155f0e);_0x2daadc===0x0?_0x29f0ce[_0x247256(0x1b3)](_0x1e8940+'\x20'+_0x12cff6+'\x20'+_0x1e8940+'\x20'+_0x54b269[_0x247256(0x191)](_0xb25567)+'\x20'+_0x1e8940):_0x29f0ce[_0x247256(0x1b3)](_0x1e8940+'\x20'+'\x20'[_0x247256(0x1bd)](_0xf7a253)+'\x20'+_0x1e8940+'\x20'+_0x54b269[_0x247256(0x191)](_0xb25567)+'\x20'+_0x1e8940);});}),_0x29f0ce[_0x2170bb(0x1b3)](colorBorder('└─'+'─'[_0x2170bb(0x1bd)](_0xf7a253)+_0x2170bb(0x1ba)+'─'[_0x2170bb(0x1bd)](_0xb25567)+'─┘',_0x155f0e));_0x289d24&&(_0x29f0ce[_0x2170bb(0x1b3)](''),_0x29f0ce[_0x2170bb(0x1b3)](String(a53_0x187921['yellow'][_0x2170bb(0x1cb)](_0x2170bb(0x1b0)))),_0x29f0ce[_0x2170bb(0x1b3)](_0x289d24));_0x377cbe&&(_0x29f0ce[_0x2170bb(0x1b3)](''),_0x29f0ce[_0x2170bb(0x1b3)](String(a53_0x187921[_0x2170bb(0x1c8)][_0x2170bb(0x1cb)]('[params]'))),_0x29f0ce[_0x2170bb(0x1b3)](_0x377cbe));_0xae9b7d&&(_0x29f0ce[_0x2170bb(0x1b3)](''),_0x29f0ce[_0x2170bb(0x1b3)](String(a53_0x187921['magenta']['bold'](_0x2170bb(0x1b8)))),_0x29f0ce[_0x2170bb(0x1b3)](_0xae9b7d));if(_0x419c28){if(_0x419c28[_0x2170bb(0x1ac)]){_0x29f0ce['push'](''),_0x29f0ce[_0x2170bb(0x1b3)](String(a53_0x187921[_0x2170bb(0x198)][_0x2170bb(0x1cb)](_0x2170bb(0x1b6))));const _0x40fdcf=_0x419c28['stderr'][_0x2170bb(0x190)]('\x0a');_0x40fdcf[_0x2170bb(0x19f)](_0xc41bf5=>{const _0x12f282=_0x2170bb;_0xc41bf5['trim']()&&_0x29f0ce[_0x12f282(0x1b3)](_0xc41bf5);});}if(_0x419c28[_0x2170bb(0x1cd)]){_0x29f0ce[_0x2170bb(0x1b3)](''),_0x29f0ce[_0x2170bb(0x1b3)](String(a53_0x187921[_0x2170bb(0x1c6)][_0x2170bb(0x1cb)](_0x2170bb(0x1a5))));const _0xbb045c=_0x419c28['cmdout']['split']('\x0a');_0xbb045c[_0x2170bb(0x19f)](_0x47b97f=>{const _0x323aeb=_0x2170bb;_0x47b97f[_0x323aeb(0x1c9)]()&&_0x29f0ce['push'](_0x47b97f);});}}return _0x29f0ce[_0x2170bb(0x199)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x335603,_0x2df130){const _0x408f4d=a53_0x5ef9;if(_0x2df130[_0x408f4d(0x1c1)]===_0x408f4d(0x1be)){await handleSDKOutput([_0x335603],_0x2df130);return;}const _0x2e27f2=resolveOutputOptions(_0x2df130),_0x3eedd4=await formatSingleObject(_0x335603,_0x2e27f2);await writeOutput(_0x3eedd4,_0x2e27f2[_0x408f4d(0x1ad)]||undefined,_0x2e27f2[_0x408f4d(0x1c1)]);}
|