@treasuredata/tdx 2026.3.18 → 2026.3.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.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.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/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_0x198ccf=a51_0x2f39;(function(_0x11648d,_0x2c991b){const _0x531bf5=a51_0x2f39,_0x5a38a3=_0x11648d();while(!![]){try{const _0x31ef2a=-parseInt(_0x531bf5(0x352))/0x1+parseInt(_0x531bf5(0x314))/0x2+parseInt(_0x531bf5(0x27b))/0x3+parseInt(_0x531bf5(0x2b9))/0x4*(-parseInt(_0x531bf5(0x347))/0x5)+-parseInt(_0x531bf5(0x2dc))/0x6*(parseInt(_0x531bf5(0x2e4))/0x7)+parseInt(_0x531bf5(0x328))/0x8+parseInt(_0x531bf5(0x258))/0x9;if(_0x31ef2a===_0x2c991b)break;else _0x5a38a3['push'](_0x5a38a3['shift']());}catch(_0xb1fab){_0x5a38a3['push'](_0x5a38a3['shift']());}}}(a51_0x3170,0x81259));import a51_0x35b3be from'chalk';import{existsSync}from'fs';import a51_0x3ec8c4 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_0x4141d8 from'prompts';function getAttemptStatusDisplay(_0x2043ba){const _0x548336=a51_0x2f39;if(!_0x2043ba)return{'icon':'⏳','text':''};const {done:_0x2c7ea2,success:_0x4c5093,cancelRequested:_0x4a8a2d}=_0x2043ba;if(!_0x2c7ea2)return _0x4a8a2d?{'icon':'🛑','text':a51_0x35b3be[_0x548336(0x35b)](_0x548336(0x31a))}:{'icon':'🔄','text':a51_0x35b3be[_0x548336(0x216)](_0x548336(0x2db))};if(_0x4c5093)return{'icon':'✅','text':a51_0x35b3be[_0x548336(0x2a4)]('success')};return{'icon':'❌','text':a51_0x35b3be[_0x548336(0x294)](_0x548336(0x358))};}export class WorkflowBaseCommand extends BaseCommand{[a51_0x198ccf(0x2fe)](_0x392051,_0x4162c5,_0x201e48=0x0){const _0x394a88=a51_0x198ccf;return _0x392051[_0x201e48]||_0x4162c5[_0x394a88(0x222)];}[a51_0x198ccf(0x267)](_0x4b77b6,_0x32d3dc,_0x339787=0x0){const _0x15aa1a=a51_0x198ccf,_0x14cd70=this[_0x15aa1a(0x2fe)](_0x4b77b6,_0x32d3dc,_0x339787);if(!_0x14cd70)return console['error'](a51_0x35b3be[_0x15aa1a(0x294)]('Error:'),_0x15aa1a(0x20c)),console[_0x15aa1a(0x358)](a51_0x35b3be[_0x15aa1a(0x344)](_0x15aa1a(0x33f))),null;return _0x14cd70;}[a51_0x198ccf(0x2af)](_0x2d746e,_0x377ce1){const _0x1f746c=a51_0x198ccf;if(_0x2d746e[0x0]){const _0x263a4b=_0x2d746e[0x0][_0x1f746c(0x356)]('.');if(_0x263a4b[_0x1f746c(0x252)]===0x1)return{'projectName':_0x263a4b[0x0],'workflowName':undefined};else return _0x263a4b['length']===0x2?{'projectName':_0x263a4b[0x0],'workflowName':_0x263a4b[0x1]}:(console[_0x1f746c(0x358)](a51_0x35b3be[_0x1f746c(0x294)](_0x1f746c(0x28e)),_0x1f746c(0x38d)),null);}return{'projectName':_0x377ce1[_0x1f746c(0x222)],'workflowName':undefined};}[a51_0x198ccf(0x286)](_0x3d8ebe,_0x3881f2,_0x102ac8=0x0){const _0x39c300=a51_0x198ccf;if(_0x3d8ebe[_0x102ac8])return _0x3d8ebe[_0x102ac8];if(_0x3881f2[_0x39c300(0x222)]){const _0x38b26e=a51_0x3ec8c4[_0x39c300(0x274)](process[_0x39c300(0x302)](),_0x39c300(0x262),_0x3881f2[_0x39c300(0x222)]);if(existsSync(a51_0x3ec8c4[_0x39c300(0x274)](_0x38b26e,'tdx.json')))return _0x38b26e;}return undefined;}async[a51_0x198ccf(0x27d)](_0x24fce4,_0x3dad69,_0x20ffd6){const _0xbdacdc=a51_0x198ccf;try{const _0x2ea89d=await _0x24fce4['workflow'][_0xbdacdc(0x262)](_0x3dad69,{'limit':0x1});if(_0x2ea89d[_0xbdacdc(0x252)]>0x0){const _0x323e95=_0x2ea89d[0x0]['id'],_0xc54b79=getWorkflowUrl(_0x20ffd6,_0x323e95);console['error'](_0xbdacdc(0x2d4)+a51_0x35b3be['cyan'](_0xc54b79));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a51_0x198ccf(0x236)]=a51_0x198ccf(0x384);['description']=a51_0x198ccf(0x31b);async[a51_0x198ccf(0x1ff)](_0x549e34){const _0x199dfe=a51_0x198ccf,{options:_0xca7314,args:_0x19abb4,tdx:_0x565d2f}=_0x549e34,_0x9f392=_0x19abb4[0x0],_0x59c9e9=_0xca7314[_0x199dfe(0x375)];if(_0x59c9e9)return saveSessionContext({'workflow_project':undefined},_0xca7314[_0x199dfe(0x359)]),console[_0x199dfe(0x263)](a51_0x35b3be[_0x199dfe(0x2a4)](_0x199dfe(0x260))),0x0;if(!_0x9f392)return console[_0x199dfe(0x358)](a51_0x35b3be[_0x199dfe(0x294)](_0x199dfe(0x28e)),_0x199dfe(0x20c)),console['error'](a51_0x35b3be[_0x199dfe(0x344)](_0x199dfe(0x32f))),console[_0x199dfe(0x358)](a51_0x35b3be['dim']('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x3d3921=await withSpinner('Resolving\x20project\x20\x27'+_0x9f392+'\x27...',()=>_0x565d2f[_0x199dfe(0x2d3)][_0x199dfe(0x312)](_0x9f392),{'verbose':_0xca7314[_0x199dfe(0x2ce)]}),{name:_0x3e8e36}=_0x3d3921['data'];return saveSessionContext({'workflow_project':_0x3e8e36},_0xca7314['session']),console[_0x199dfe(0x263)](a51_0x35b3be[_0x199dfe(0x2a4)](_0x199dfe(0x36b)+a51_0x35b3be[_0x199dfe(0x37e)](_0x3e8e36))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a51_0x198ccf(0x2e0);['description']='List\x20all\x20workflow\x20projects';async['execute'](_0x249141){const _0x13c2ef=a51_0x198ccf,{options:_0x55db4b,args:_0x2d8fce,tdx:_0xfc7de2}=_0x249141,_0x2fad7f=_0x2d8fce[0x0];_0x55db4b[_0x13c2ef(0x2ce)]&&_0x2fad7f&&console[_0x13c2ef(0x358)](_0x13c2ef(0x27a)+_0x2fad7f);const _0x15166f=await withSpinner(_0x13c2ef(0x396),()=>_0xfc7de2[_0x13c2ef(0x2d3)][_0x13c2ef(0x23a)](_0x2fad7f,{'limit':_0x55db4b[_0x13c2ef(0x320)]}),{'verbose':_0x55db4b[_0x13c2ef(0x2ce)]});let _0x5ee41d=_0x15166f[_0x13c2ef(0x303)];_0x5ee41d[_0x13c2ef(0x224)]((_0x340048,_0x540381)=>_0x340048[_0x13c2ef(0x236)][_0x13c2ef(0x259)](_0x540381[_0x13c2ef(0x236)]));const _0x3fff3b=_0x55db4b[_0x13c2ef(0x320)]||0x64,_0x2fe8d6=_0x5ee41d[_0x13c2ef(0x252)]>=_0x3fff3b?a51_0x35b3be[_0x13c2ef(0x344)](_0x13c2ef(0x39c)):'';console['error'](_0x13c2ef(0x1f2)+_0x5ee41d['length']+_0x13c2ef(0x2e1)+(_0x5ee41d[_0x13c2ef(0x252)]!==0x1?'s':'')+_0x2fe8d6);if(_0x55db4b[_0x13c2ef(0x200)]===_0x13c2ef(0x21b)||_0x55db4b[_0x13c2ef(0x200)]==='jsonl'||_0x55db4b['format']===_0x13c2ef(0x211))await handleSDKOutput(_0x5ee41d,_0x55db4b);else{if(_0x5ee41d[_0x13c2ef(0x252)]===0x0)_0x2fad7f?console[_0x13c2ef(0x263)](_0x13c2ef(0x390)+_0x2fad7f):console[_0x13c2ef(0x263)]('No\x20workflow\x20projects\x20found');else{const _0x49cba5=_0x5ee41d[_0x13c2ef(0x316)](_0x31a551=>{const _0x45f72d=_0x13c2ef,_0x59298f=_0x31a551[_0x45f72d(0x2c0)]?.[_0x45f72d(0x2d5)](_0xf0f524=>_0xf0f524[_0x45f72d(0x2c8)]==='sys'),_0x2d1f81=_0x59298f?a51_0x35b3be[_0x45f72d(0x344)](_0x45f72d(0x2aa)):'';return _0x45f72d(0x33d)+_0x31a551[_0x45f72d(0x236)]+_0x2d1f81;});await writeOutput(_0x49cba5[_0x13c2ef(0x274)]('\x0a'),_0x55db4b[_0x13c2ef(0x264)],_0x13c2ef(0x226));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a51_0x198ccf(0x236)]=a51_0x198ccf(0x255);[a51_0x198ccf(0x209)]=a51_0x198ccf(0x388);async[a51_0x198ccf(0x1ff)](_0x2f3c26){const _0x15271a=a51_0x198ccf,{options:_0x16f1e9,args:_0x299e98,tdx:_0x518adf}=_0x2f3c26,_0x59457c=this['resolveProject'](_0x299e98,_0x16f1e9);_0x16f1e9[_0x15271a(0x2ce)]&&_0x59457c&&console[_0x15271a(0x358)](_0x15271a(0x39a)+_0x59457c);const _0x2a3681=await withSpinner('Listing\x20workflows...',()=>_0x518adf[_0x15271a(0x2d3)][_0x15271a(0x262)](_0x59457c,{'limit':_0x16f1e9[_0x15271a(0x320)]}),{'verbose':_0x16f1e9['verbose']});let _0x767e1d=_0x2a3681[_0x15271a(0x303)];_0x767e1d[_0x15271a(0x224)]((_0x15db8f,_0x425cbc)=>{const _0xed670=_0x15271a,_0x563e07=_0x15db8f[_0xed670(0x236)][_0xed670(0x259)](_0x425cbc[_0xed670(0x236)]);if(_0x563e07!==0x0)return _0x563e07;return(_0x15db8f[_0xed670(0x218)]?.['name']||'')[_0xed670(0x259)](_0x425cbc[_0xed670(0x218)]?.[_0xed670(0x236)]||'');});const _0x439f0f=_0x16f1e9[_0x15271a(0x320)]||0x64,_0x236a8d=_0x767e1d['length']>=_0x439f0f?a51_0x35b3be['dim']('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x15271a(0x358)](_0x15271a(0x1f2)+_0x767e1d[_0x15271a(0x252)]+_0x15271a(0x343)+(_0x767e1d[_0x15271a(0x252)]!==0x1?'s':'')+_0x236a8d);if(_0x16f1e9[_0x15271a(0x200)]==='json'||_0x16f1e9[_0x15271a(0x200)]===_0x15271a(0x28c)||_0x16f1e9[_0x15271a(0x200)]===_0x15271a(0x211))await handleSDKOutput(_0x767e1d,_0x16f1e9);else{if(_0x767e1d[_0x15271a(0x252)]===0x0)_0x59457c?console[_0x15271a(0x263)]('No\x20workflows\x20found\x20in\x20project:\x20'+_0x59457c):console[_0x15271a(0x263)](_0x15271a(0x2d7));else{const _0x51d8b5=_0x16f1e9[_0x15271a(0x208)],_0x57a310=_0x767e1d[_0x15271a(0x316)](_0x274157=>{const _0x110466=_0x15271a,_0x4152f6=a51_0x35b3be[_0x110466(0x344)]('#'+_0x274157['id']),_0x445d3d=hyperlink(_0x4152f6,getWorkflowUrl(_0x51d8b5,_0x274157['id'])),_0x3b0991=_0x274157['project']?.[_0x110466(0x236)]?a51_0x35b3be[_0x110466(0x344)]('\x20('+_0x274157[_0x110466(0x218)]['name']+')'):'';return _0x110466(0x337)+_0x445d3d+'\x20'+_0x274157[_0x110466(0x236)]+_0x3b0991;});await writeOutput(_0x57a310['join']('\x0a'),_0x16f1e9[_0x15271a(0x264)],_0x15271a(0x226));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a51_0x198ccf(0x236)]='workflow:sessions';[a51_0x198ccf(0x209)]=a51_0x198ccf(0x29b);async['execute'](_0x5141a7){const _0x1f466b=a51_0x198ccf,{options:_0x57ec7c,args:_0x110c29,tdx:_0x27c154}=_0x5141a7,_0xa2a771=this['parseProjectWorkflowPattern'](_0x110c29,_0x57ec7c);if(!_0xa2a771)return 0x1;const {projectName:_0x2543cb,workflowName:_0x5b6b60}=_0xa2a771;if(_0x57ec7c[_0x1f466b(0x2ce)]){if(_0x2543cb&&_0x5b6b60)console[_0x1f466b(0x358)](_0x1f466b(0x26e)+_0x2543cb+'.'+_0x5b6b60);else _0x2543cb&&console[_0x1f466b(0x358)](_0x1f466b(0x1fb)+_0x2543cb);const _0x4d5e44=_0x57ec7c['status'];_0x4d5e44&&console['error']('Status:\x20'+_0x4d5e44);}let _0x4fc331=0x28;if(process[_0x1f466b(0x2b5)][_0x1f466b(0x338)]&&!_0x57ec7c['output']&&!_0x57ec7c[_0x1f466b(0x200)]){const _0x325520=process[_0x1f466b(0x2b5)][_0x1f466b(0x37b)]||0x28;_0x4fc331=Math[_0x1f466b(0x217)](0x14,Math[_0x1f466b(0x271)](_0x325520*0x2/0x3));}const _0x2789b5=_0x57ec7c[_0x1f466b(0x320)]||_0x4fc331,_0x1133ac=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x27c154[_0x1f466b(0x2d3)][_0x1f466b(0x29f)]({'projectName':_0x2543cb,'workflowName':_0x5b6b60,'status':_0x57ec7c['status'],'fromTime':_0x57ec7c[_0x1f466b(0x2de)],'toTime':_0x57ec7c['to'],'limit':_0x2789b5}),{'verbose':_0x57ec7c['verbose']}),_0x4e8fbf=_0x1133ac[_0x1f466b(0x303)];_0x4e8fbf[_0x1f466b(0x224)]((_0x4bbc3b,_0x25364f)=>{const _0x5e0a6e=_0x1f466b,_0x25ec50=_0x4bbc3b[_0x5e0a6e(0x2eb)]||'',_0x598ba9=_0x25364f[_0x5e0a6e(0x2eb)]||'';return _0x598ba9[_0x5e0a6e(0x259)](_0x25ec50);});_0x4e8fbf[_0x1f466b(0x252)]>=_0x2789b5?console['error'](_0x1f466b(0x334)+_0x4e8fbf[_0x1f466b(0x252)]+_0x1f466b(0x1f9)+a51_0x35b3be[_0x1f466b(0x344)]('(use\x20--limit\x20to\x20see\x20more)')):console['error'](_0x1f466b(0x1f2)+_0x4e8fbf[_0x1f466b(0x252)]+'\x20session'+(_0x4e8fbf[_0x1f466b(0x252)]!==0x1?'s':''));if(_0x57ec7c[_0x1f466b(0x200)]===_0x1f466b(0x21b)||_0x57ec7c[_0x1f466b(0x200)]===_0x1f466b(0x28c)||_0x57ec7c['format']===_0x1f466b(0x211))await handleSDKOutput(_0x4e8fbf,_0x57ec7c);else{if(!process['stdout'][_0x1f466b(0x338)]||_0x57ec7c[_0x1f466b(0x264)]){if(_0x4e8fbf[_0x1f466b(0x252)]===0x0){if(_0x2543cb&&_0x5b6b60)console[_0x1f466b(0x263)](_0x1f466b(0x2c5)+_0x2543cb+'.'+_0x5b6b60);else _0x2543cb?console[_0x1f466b(0x263)](_0x1f466b(0x2f8)+_0x2543cb):console[_0x1f466b(0x263)](_0x1f466b(0x361));}else{const _0x34b0f2=_0x57ec7c[_0x1f466b(0x208)],_0x105766=this[_0x1f466b(0x22b)](_0x4e8fbf,_0x34b0f2);_0x57ec7c[_0x1f466b(0x264)]?await writeOutput(_0x105766,_0x57ec7c[_0x1f466b(0x264)],_0x1f466b(0x226)):console[_0x1f466b(0x263)](_0x105766);}!_0x2543cb&&(console['error'](''),console['error'](a51_0x35b3be[_0x1f466b(0x344)](_0x1f466b(0x235))),console[_0x1f466b(0x358)](a51_0x35b3be['dim'](_0x1f466b(0x228))+'or'+a51_0x35b3be[_0x1f466b(0x344)](_0x1f466b(0x250))));}else{if(_0x4e8fbf[_0x1f466b(0x252)]===0x0){if(_0x2543cb&&_0x5b6b60)console[_0x1f466b(0x263)](_0x1f466b(0x2c5)+_0x2543cb+'.'+_0x5b6b60);else _0x2543cb?console[_0x1f466b(0x263)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x2543cb):console[_0x1f466b(0x263)](_0x1f466b(0x361));}else await this[_0x1f466b(0x28b)](_0x4e8fbf,_0x5141a7,_0x2543cb);}}return 0x0;}['renderSessionsTimeline'](_0x4a5089,_0x198b8d){const _0x583d89=a51_0x198ccf,_0x34ae17=[],_0x6e5615=new Map();let _0x5c01ed=Infinity,_0x5608c8=-Infinity;for(const _0x535dc1 of _0x4a5089){if(_0x535dc1['lastAttempt']?.[_0x583d89(0x30b)]){const _0x347da5=new Date(_0x535dc1[_0x583d89(0x33c)][_0x583d89(0x30b)])[_0x583d89(0x2c3)](),_0x2e575e=_0x535dc1['lastAttempt'][_0x583d89(0x229)]?new Date(_0x535dc1[_0x583d89(0x33c)][_0x583d89(0x229)])[_0x583d89(0x2c3)]():Date['now'](),_0xca2da9=_0x535dc1[_0x583d89(0x218)]?.['name']||_0x583d89(0x28d);!_0x6e5615[_0x583d89(0x39b)](_0xca2da9)&&_0x6e5615[_0x583d89(0x227)](_0xca2da9,[]),_0x6e5615[_0x583d89(0x291)](_0xca2da9)['push']({'session':_0x535dc1,'startTime':_0x347da5,'endTime':_0x2e575e,'duration':_0x2e575e-_0x347da5}),_0x5c01ed=Math['min'](_0x5c01ed,_0x347da5),_0x5608c8=Math[_0x583d89(0x217)](_0x5608c8,_0x2e575e);}}if(_0x6e5615[_0x583d89(0x308)]===0x0)return _0x583d89(0x207);const _0x69f58d=process['stdout'][_0x583d89(0x32c)]||0x78,_0x36d950=0x1e,_0x16c516=0x32,_0x4e0101=0x4,_0x230a46=Math['min'](_0x16c516,Math[_0x583d89(0x217)](_0x36d950,Math[_0x583d89(0x271)](_0x69f58d*0.3))),_0x2f461c=_0x69f58d-_0x230a46-TIMELINE_CONFIG[_0x583d89(0x357)]-0x3-_0x4e0101,_0x220f75=_0x5608c8-_0x5c01ed,_0x2c9b5e=_0x220f75/_0x230a46,_0x408dbd=renderTimeAxis({'startTime':_0x5c01ed,'endTime':_0x5608c8,'durationMs':_0x220f75,'msPerChar':_0x2c9b5e},_0x230a46),_0x46f009=[];for(const _0x556ae4 of _0x6e5615[_0x583d89(0x242)]()){_0x46f009[_0x583d89(0x307)](..._0x556ae4);}_0x46f009[_0x583d89(0x224)]((_0x1dce73,_0xf5f9bb)=>_0xf5f9bb[_0x583d89(0x2bd)]-_0x1dce73[_0x583d89(0x2bd)]);const _0x3909ab=new Date(_0x5c01ed),_0x2b12d6=formatDate(_0x3909ab),_0x3603b6=_0x4e0101+TIMELINE_CONFIG[_0x583d89(0x251)]+TIMELINE_CONFIG['ICON_SPACING']+_0x2f461c,_0x3e177e='\x20'[_0x583d89(0x24e)](_0x3603b6-_0x2b12d6[_0x583d89(0x252)]),_0x371547=_0x3e177e+a51_0x35b3be[_0x583d89(0x344)](_0x2b12d6)+'\x20'+_0x408dbd;_0x34ae17[_0x583d89(0x307)](_0x371547);const _0x24b7e7=0x16;let _0x1a246f=0x0;for(const _0x465bce of _0x46f009){const _0x2e855e=_0x465bce[_0x583d89(0x359)][_0x583d89(0x218)]?.[_0x583d89(0x236)]||'?',_0x34b6e8=Math[_0x583d89(0x332)](stringWidth(_0x2e855e),_0x24b7e7);_0x1a246f=Math[_0x583d89(0x217)](_0x1a246f,_0x34b6e8);}for(const _0x25d047 of _0x46f009){const {session:_0x263f60,startTime:_0x50543c,endTime:_0x414199,duration:_0x1cd035}=_0x25d047,_0x138c2c=_0x263f60[_0x583d89(0x218)]?.['id'],_0x135c6b=_0x263f60['id'],_0x422cd5=_0x263f60[_0x583d89(0x218)]?.[_0x583d89(0x236)]||'?',_0x2710fd=_0x263f60[_0x583d89(0x2d3)]?.['name']||'?';let _0xada69f,_0x2b7fdc;if(_0x263f60[_0x583d89(0x33c)]){const _0xd0fc4=_0x263f60[_0x583d89(0x33c)];!_0xd0fc4[_0x583d89(0x2a9)]?(_0xada69f=_0xd0fc4[_0x583d89(0x369)]?'🛑':'🔄',_0x2b7fdc=_0xd0fc4[_0x583d89(0x369)]?a51_0x35b3be[_0x583d89(0x35b)]:a51_0x35b3be[_0x583d89(0x216)]):(_0xada69f=_0xd0fc4['success']?'✅':'❌',_0x2b7fdc=_0xd0fc4[_0x583d89(0x245)]?a51_0x35b3be[_0x583d89(0x2a4)]:a51_0x35b3be[_0x583d89(0x294)]);}else _0xada69f='⏳',_0x2b7fdc=a51_0x35b3be[_0x583d89(0x344)];const _0x2ca5a3='#'+_0x135c6b,_0x51cf89=_0x138c2c?hyperlink(_0x2ca5a3,getWorkflowSessionUrl(_0x198b8d,_0x138c2c,_0x135c6b)):_0x2ca5a3;let _0x48ec56=_0x422cd5;stringWidth(_0x422cd5)>_0x24b7e7&&(_0x48ec56=_0x422cd5[_0x583d89(0x371)](0x0,_0x24b7e7-0x1)+'…');const _0x201c64=a51_0x35b3be[_0x583d89(0x344)](_0x48ec56),_0x3dd59d=stringWidth(_0x48ec56),_0xbbe6f4='\x20'[_0x583d89(0x24e)](_0x1a246f-stringWidth(_0x48ec56)+0x2),_0x27de94='('+formatElapsed(_0x1cd035)+')',_0xbca809=stringWidth(_0x27de94),_0x5edcfe=stringWidth(_0x2ca5a3),_0x187f9c=_0x5edcfe+0x1+_0x3dd59d+_0xbbe6f4[_0x583d89(0x252)],_0x4de83c=_0x2f461c-_0x187f9c-_0xbca809-0x1-0x8;let _0x45c5b5=_0x2710fd;stringWidth(_0x45c5b5)>_0x4de83c&&(_0x45c5b5=_0x45c5b5[_0x583d89(0x371)](0x0,_0x4de83c-0x1)+'…');const _0x53f642=_0x51cf89+'\x20'+_0x201c64+_0xbbe6f4+_0x45c5b5,_0x3c6ab5=stringWidth(_0x53f642),_0x5c0fba=_0x2f461c-_0x3c6ab5-_0xbca809,_0x11037d=_0x53f642+'\x20'[_0x583d89(0x24e)](Math[_0x583d89(0x217)](0x1,_0x5c0fba))+a51_0x35b3be['dim'](_0x27de94),_0x3f0c69=Math[_0x583d89(0x271)]((_0x50543c-_0x5c01ed)/_0x2c9b5e),_0x5724ed=Math[_0x583d89(0x271)]((_0x414199-_0x5c01ed)/_0x2c9b5e),_0x1ae35c=Math[_0x583d89(0x217)](_0x3f0c69+0x1,_0x5724ed),_0x2bc482=new Array(_0x230a46)[_0x583d89(0x2d0)]('\x20');for(let _0xcd28f6=_0x3f0c69;_0xcd28f6<Math[_0x583d89(0x332)](_0x1ae35c,_0x230a46);_0xcd28f6++){_0x2bc482[_0xcd28f6]='─';}const _0x36d4bf=_0x2bc482[_0x583d89(0x316)](_0x168015=>_0x168015==='\x20'?'\x20':_0x2b7fdc(_0x168015))[_0x583d89(0x274)]('');_0x34ae17[_0x583d89(0x307)](_0xada69f+'\x20'+_0x11037d+'│'+_0x36d4bf+'│');}return _0x34ae17[_0x583d89(0x274)]('\x0a');}async['navigateSessionsInteractive'](_0x35f257,_0x3b1599,_0x3233e9){const _0x36799b=a51_0x198ccf,{options:_0x1444c4,tdx:_0x67b3da}=_0x3b1599,_0x59b262=_0x1444c4[_0x36799b(0x208)],{timelineRows:_0x24ee24,timeAxisHeader:_0x279a21}=this[_0x36799b(0x254)](_0x35f257,_0x59b262),_0x22a77a=_0x24ee24[_0x36799b(0x346)](_0x2ad5b6=>_0x2ad5b6[_0x36799b(0x270)]);if(_0x22a77a[_0x36799b(0x252)]===0x0){const _0x3501be=this[_0x36799b(0x22b)](_0x35f257,_0x59b262);console['log'](_0x3501be);!_0x3233e9&&(console[_0x36799b(0x358)](''),console[_0x36799b(0x358)](a51_0x35b3be[_0x36799b(0x344)](_0x36799b(0x235))),console[_0x36799b(0x358)](a51_0x35b3be[_0x36799b(0x344)](_0x36799b(0x228))+'or'+a51_0x35b3be[_0x36799b(0x344)](_0x36799b(0x250))));return;}_0x279a21&&console[_0x36799b(0x263)](_0x279a21);const _0x5c36ff=_0x24ee24['filter'](_0x2aedf8=>_0x2aedf8['attemptId'])[_0x36799b(0x316)](_0x5189fd=>({'title':_0x5189fd[_0x36799b(0x23f)],'value':_0x5189fd[_0x36799b(0x270)]})),_0x2f05f4=process[_0x36799b(0x2b5)]['rows']||0x3c,_0x216cf6=Math[_0x36799b(0x217)](0x28,Math[_0x36799b(0x271)](_0x2f05f4*0x2/0x3)),_0x455dd2=await a51_0x4141d8({'type':_0x36799b(0x269),'name':_0x36799b(0x270),'message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x5c36ff,'initial':-0x1,'limit':_0x216cf6,'clearFirst':!![],'fallback':{'title':_0x36799b(0x2da),'value':null},'suggest':(_0x55ed86,_0x190305)=>{const _0x433869=_0x36799b;if(!_0x55ed86)return Promise[_0x433869(0x1f5)](_0x190305);const _0x1285da=_0x190305['filter'](_0x3ff42e=>{const _0x22be4a=_0x433869,_0x448e51=_0x3ff42e;return _0x448e51['title'][_0x22be4a(0x2d2)]()['includes'](_0x55ed86[_0x22be4a(0x2d2)]());});return Promise['resolve'](_0x1285da);}}),_0x3a0045=()=>{const _0x13ce47=_0x36799b;process[_0x13ce47(0x2b5)][_0x13ce47(0x35f)](_0x13ce47(0x2ee)),process[_0x13ce47(0x2b5)][_0x13ce47(0x35f)](_0x13ce47(0x2ee)),process[_0x13ce47(0x2b5)][_0x13ce47(0x35f)]('\x1b[1A\x1b[2K');},_0x192c41=_0x455dd2&&_0x455dd2[_0x36799b(0x270)]&&_0x455dd2['attemptId']!==null&&_0x455dd2[_0x36799b(0x270)][_0x36799b(0x2c1)]()!=='';if(!_0x192c41){_0x3a0045(),console[_0x36799b(0x263)](a51_0x35b3be['dim'](_0x36799b(0x2cb)));return;}_0x3a0045();const _0x26a60e=_0x35f257[_0x36799b(0x204)](_0x3651da=>_0x3651da['lastAttempt']?.['id']===_0x455dd2[_0x36799b(0x270)]);if(_0x26a60e){const _0x23bb28=_0x26a60e[_0x36799b(0x218)]?.['name']||'?',_0x14bdb9=_0x26a60e[_0x36799b(0x2d3)]?.['name']||'?';console[_0x36799b(0x263)](_0x36799b(0x1fa)+a51_0x35b3be[_0x36799b(0x344)](_0x23bb28)+',\x20Workflow:\x20'+a51_0x35b3be[_0x36799b(0x344)](_0x14bdb9));}const _0x3af145=new WorkflowTimelineCommand();await _0x3af145[_0x36799b(0x1ff)]({'args':[],'options':{..._0x1444c4,'attemptId':_0x455dd2['attemptId']},'tdx':_0x67b3da});}[a51_0x198ccf(0x254)](_0x4b59ca,_0x5476a8){const _0x529982=a51_0x198ccf,_0x8e2c7e=new Map();for(const _0x16dc3b of _0x4b59ca){_0x16dc3b['id']&&_0x16dc3b['lastAttempt']?.['id']&&_0x8e2c7e['set'](_0x16dc3b['id'],_0x16dc3b[_0x529982(0x33c)]['id']);}const _0x5f37f4=[];let _0x9fb3b5='';const _0x39c221=this[_0x529982(0x22b)](_0x4b59ca,_0x5476a8),_0x2da0b2=_0x39c221['split']('\x0a');for(const _0x116bf3 of _0x2da0b2){if(_0x116bf3[_0x529982(0x331)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x116bf3[_0x529982(0x21e)](/^\s+\d{4}-\d{2}-\d{2}/))_0x9fb3b5=_0x116bf3;else{if(_0x116bf3[_0x529982(0x21e)](/^[✅❌🔄🛑⏳]/)){const _0x328efd=_0x116bf3[_0x529982(0x21e)](/#(\d+)/),_0x4c76ae=_0x328efd?_0x328efd[0x1]:null,_0x116b24=_0x4c76ae?_0x8e2c7e[_0x529982(0x291)](_0x4c76ae)||null:null,_0x4e1b50=_0x4b59ca['find'](_0x1318ac=>_0x1318ac['id']===_0x4c76ae),_0x3008b9=_0x4e1b50?.[_0x529982(0x218)]?.[_0x529982(0x236)]||'';_0x5f37f4[_0x529982(0x307)]({'displayLine':_0x116bf3,'attemptId':_0x116b24,'projectName':_0x3008b9});}}}return{'timelineRows':_0x5f37f4,'timeAxisHeader':_0x9fb3b5};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a51_0x198ccf(0x236)]='workflow:attempts';['description']=a51_0x198ccf(0x22d);async[a51_0x198ccf(0x1ff)](_0x339fb9){const _0x24a8a2=a51_0x198ccf,{options:_0x46fecd,args:_0x2da694,tdx:_0x3ff8dc}=_0x339fb9,_0x5cf276=this[_0x24a8a2(0x2af)](_0x2da694,_0x46fecd);if(!_0x5cf276)return 0x1;const {projectName:_0x52d464,workflowName:_0x2335de}=_0x5cf276,_0x1a85db=_0x46fecd[_0x24a8a2(0x212)];if(_0x46fecd['verbose']){if(_0x52d464&&_0x2335de)console['error'](_0x24a8a2(0x26e)+_0x52d464+'.'+_0x2335de);else _0x52d464&&console[_0x24a8a2(0x358)]('Filter:\x20project='+_0x52d464);_0x1a85db&&console[_0x24a8a2(0x358)](_0x24a8a2(0x2a2));}const _0x4d3d9d=await withSpinner(_0x24a8a2(0x2f4),()=>_0x3ff8dc['workflow'][_0x24a8a2(0x329)]({'projectName':_0x52d464,'workflowName':_0x2335de,'includeRetried':_0x1a85db,'limit':_0x46fecd[_0x24a8a2(0x320)]}),{'verbose':_0x46fecd[_0x24a8a2(0x2ce)]}),_0x77345f=_0x4d3d9d[_0x24a8a2(0x303)],_0x334b24=_0x46fecd[_0x24a8a2(0x320)]||0x64,_0x327081=_0x77345f[_0x24a8a2(0x252)]>=_0x334b24?a51_0x35b3be[_0x24a8a2(0x344)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console['error'](_0x24a8a2(0x1f2)+_0x77345f['length']+_0x24a8a2(0x335)+(_0x77345f['length']!==0x1?'s':'')+_0x327081);if(_0x46fecd[_0x24a8a2(0x200)]==='json'||_0x46fecd[_0x24a8a2(0x200)]===_0x24a8a2(0x28c)||_0x46fecd[_0x24a8a2(0x200)]===_0x24a8a2(0x211))await handleSDKOutput(_0x77345f,_0x46fecd);else{if(_0x77345f[_0x24a8a2(0x252)]===0x0){if(_0x52d464&&_0x2335de)console[_0x24a8a2(0x263)]('No\x20attempts\x20found\x20for:\x20'+_0x52d464+'.'+_0x2335de);else _0x52d464?console[_0x24a8a2(0x263)](_0x24a8a2(0x38a)+_0x52d464):console['log'](_0x24a8a2(0x233));}else{const _0x5b8313=_0x46fecd['site'],_0x36bdcd=_0x77345f['map'](_0x513755=>{const _0x10a13a=_0x24a8a2,_0x58535d=a51_0x35b3be[_0x10a13a(0x344)]('#'+_0x513755['id']),_0x5e18c8=_0x513755[_0x10a13a(0x218)]?.['id'],_0x5d310f=_0x513755[_0x10a13a(0x2a3)]||_0x513755[_0x10a13a(0x20e)],_0x44600d=_0x5e18c8&&_0x5d310f?hyperlink(_0x58535d,getWorkflowAttemptUrl(_0x5b8313,_0x5e18c8,_0x5d310f,_0x513755['id'])):_0x58535d,{icon:_0x1063e2,text:_0x4597a3}=getAttemptStatusDisplay(_0x513755),_0x52195f=(_0x513755['project']?.[_0x10a13a(0x236)]||'?')+'.'+(_0x513755[_0x10a13a(0x2d3)]?.['name']||'?'),_0x40e62c=_0x513755[_0x10a13a(0x2eb)]?a51_0x35b3be['dim'](_0x513755['sessionTime']):'';return(_0x44600d+'\x20'+_0x1063e2+(_0x4597a3?'\x20'+_0x4597a3:'')+'\x20'+_0x52195f+'\x20'+_0x40e62c)[_0x10a13a(0x1f0)]();});await writeOutput(_0x36bdcd[_0x24a8a2(0x274)]('\x0a'),_0x46fecd[_0x24a8a2(0x264)],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a51_0x198ccf(0x236)]=a51_0x198ccf(0x364);['description']=a51_0x198ccf(0x26a);async[a51_0x198ccf(0x1ff)](_0x471987){const _0x18b0d9=a51_0x198ccf,{options:_0x425d44,args:_0x2ad56d,tdx:_0x1b627e}=_0x471987,_0x1f8652=_0x2ad56d[0x0];if(!_0x1f8652)return console[_0x18b0d9(0x358)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x425d44['verbose']&&console[_0x18b0d9(0x358)](_0x18b0d9(0x351)+_0x1f8652);const _0x4d99cd=await withSpinner(_0x18b0d9(0x31c),()=>_0x1b627e['workflow']['attempt'](_0x1f8652),{'verbose':_0x425d44[_0x18b0d9(0x2ce)]}),_0x6a9db4=_0x4d99cd[_0x18b0d9(0x303)];let _0x301e27;!_0x6a9db4[_0x18b0d9(0x2a9)]?_0x301e27=_0x6a9db4[_0x18b0d9(0x369)]?'canceling':'running':_0x301e27=_0x6a9db4[_0x18b0d9(0x245)]?'success':_0x18b0d9(0x358);let _0x41acf9;if(_0x6a9db4[_0x18b0d9(0x30b)]&&_0x6a9db4['finishedAt']){const _0x12bfc9=new Date(_0x6a9db4[_0x18b0d9(0x30b)])['getTime'](),_0x4ecbcc=new Date(_0x6a9db4['finishedAt'])[_0x18b0d9(0x2c3)]();_0x41acf9=Math['round']((_0x4ecbcc-_0x12bfc9)/0x3e8);}const _0x2f3fe0={'attempt_id':_0x6a9db4['id'],'status':_0x301e27,..._0x6a9db4[_0x18b0d9(0x315)]!==undefined&&{'index':_0x6a9db4['index']},..._0x6a9db4[_0x18b0d9(0x218)]&&{'project':_0x6a9db4[_0x18b0d9(0x218)][_0x18b0d9(0x236)]},..._0x6a9db4['workflow']&&{'workflow':_0x6a9db4['workflow'][_0x18b0d9(0x236)]},..._0x6a9db4[_0x18b0d9(0x20e)]&&{'session_id':_0x6a9db4[_0x18b0d9(0x20e)]},..._0x6a9db4[_0x18b0d9(0x2eb)]&&{'session_time':_0x6a9db4[_0x18b0d9(0x2eb)]},..._0x6a9db4[_0x18b0d9(0x31d)]&&{'retry_attempt':_0x6a9db4[_0x18b0d9(0x31d)]},..._0x41acf9!==undefined&&{'duration_sec':_0x41acf9},..._0x6a9db4['createdAt']&&{'created_at':_0x6a9db4[_0x18b0d9(0x30b)]},..._0x6a9db4['finishedAt']&&{'finished_at':_0x6a9db4[_0x18b0d9(0x229)]},...Object['keys'](_0x6a9db4[_0x18b0d9(0x2a7)])[_0x18b0d9(0x252)]>0x0&&{'params':_0x6a9db4[_0x18b0d9(0x2a7)]}};return await handleSingleObjectOutput(_0x2f3fe0,_0x425d44),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a51_0x198ccf(0x236)]=a51_0x198ccf(0x23b);[a51_0x198ccf(0x209)]=a51_0x198ccf(0x387);async[a51_0x198ccf(0x1ff)](_0x4ca3ca){const _0xe4be8b=a51_0x198ccf,{options:_0x29aabf,args:_0xd6c6f9,tdx:_0x2fd041}=_0x4ca3ca,_0x50f066=_0xd6c6f9[0x0];if(!_0x50f066)return console['error'](_0xe4be8b(0x205)),0x1;const _0x1780e1=_0x29aabf[_0xe4be8b(0x324)];_0x29aabf[_0xe4be8b(0x2ce)]&&(console['error'](_0xe4be8b(0x351)+_0x50f066),_0x1780e1&&console[_0xe4be8b(0x358)](_0xe4be8b(0x339)));const _0x2ee9a3=await withSpinner(_0xe4be8b(0x25a),()=>_0x2fd041['workflow'][_0xe4be8b(0x27c)](_0x50f066,_0x1780e1||![]),{'verbose':_0x29aabf[_0xe4be8b(0x2ce)]}),_0xb5387b=_0x2ee9a3['data'];return console[_0xe4be8b(0x358)](_0xe4be8b(0x1f2)+_0xb5387b['length']+'\x20task'+(_0xb5387b[_0xe4be8b(0x252)]!==0x1?'s':'')),await handleSDKOutput(_0xb5387b,_0x29aabf),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']='workflow:logs';[a51_0x198ccf(0x209)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a51_0x198ccf(0x1ff)](_0x513f0e){const _0x2062b0=a51_0x198ccf,{options:_0x26dedd,args:_0x57edd1,tdx:_0x3a8972}=_0x513f0e,_0xc6318a=_0x57edd1[0x0];let _0x389917=_0x57edd1[0x1];if(!_0xc6318a)return console[_0x2062b0(0x358)](_0x2062b0(0x205)),0x1;_0x26dedd[_0x2062b0(0x2ce)]&&(console[_0x2062b0(0x358)](_0x2062b0(0x351)+_0xc6318a),_0x389917&&console[_0x2062b0(0x358)](_0x2062b0(0x20b)+_0x389917));const _0x2591ec=await withSpinner(_0x2062b0(0x2b3),()=>_0x3a8972[_0x2062b0(0x2d3)][_0x2062b0(0x30f)](_0xc6318a,_0x389917),{'verbose':_0x26dedd[_0x2062b0(0x2ce)]}),_0x15e491=_0x2591ec['data'];if(_0x15e491[_0x2062b0(0x252)]===0x0)return console[_0x2062b0(0x358)](_0x2062b0(0x38b)),0x0;if(!_0x389917&&(_0x26dedd[_0x2062b0(0x21b)]||_0x26dedd[_0x2062b0(0x200)]))return await handleSDKOutput(_0x15e491,_0x26dedd),0x0;if(!_0x389917){const _0x336f8d=_0x15e491[_0x2062b0(0x316)](_0xe3d3ea=>({'title':_0xe3d3ea[_0x2062b0(0x342)]+'\x20('+formatBytes(_0xe3d3ea['fileSize'])+')','value':_0xe3d3ea[_0x2062b0(0x342)]})),_0x505414=await a51_0x4141d8({'type':'select','name':'task','message':_0x2062b0(0x25c),'choices':_0x336f8d});if(!_0x505414['task'])return console['error']('Cancelled'),0x0;_0x389917=_0x505414[_0x2062b0(0x392)];}const _0x125c6f=await withSpinner(_0x2062b0(0x2ab),()=>_0x3a8972[_0x2062b0(0x2d3)][_0x2062b0(0x253)](_0xc6318a,_0x389917),{'verbose':_0x26dedd[_0x2062b0(0x2ce)]}),_0x4653a2=_0x125c6f[_0x2062b0(0x303)];return _0x4653a2?console[_0x2062b0(0x263)](_0x4653a2):console[_0x2062b0(0x358)](_0x2062b0(0x2c4)),0x0;}}export class WorkflowKillCommand extends BaseCommand{['name']=a51_0x198ccf(0x21a);[a51_0x198ccf(0x209)]=a51_0x198ccf(0x36c);async[a51_0x198ccf(0x1ff)](_0x4a50c6){const _0x1c77a9=a51_0x198ccf,{options:_0x3077f7,args:_0xdf394f,tdx:_0xfa99a1}=_0x4a50c6,_0x134b02=_0xdf394f[0x0];if(!_0x134b02)return console[_0x1c77a9(0x358)](_0x1c77a9(0x205)),0x1;const _0x494772=_0x3077f7['reason'];_0x3077f7[_0x1c77a9(0x2ce)]&&(console[_0x1c77a9(0x358)](_0x1c77a9(0x351)+_0x134b02),_0x494772&&console[_0x1c77a9(0x358)](_0x1c77a9(0x1f1)+_0x494772));if(!_0x3077f7[_0x1c77a9(0x2fc)]){if(!isInteractive())return console[_0x1c77a9(0x358)](a51_0x35b3be[_0x1c77a9(0x294)](_0x1c77a9(0x33b)),_0x1c77a9(0x37c)),console[_0x1c77a9(0x358)](a51_0x35b3be[_0x1c77a9(0x344)](_0x1c77a9(0x2f7))),0x1;const _0x5dc0eb=await confirmKey(_0x1c77a9(0x2ef)+_0x134b02+'?');if(!_0x5dc0eb)return console[_0x1c77a9(0x358)](a51_0x35b3be['yellow'](_0x1c77a9(0x2cb))),0x1;}const _0x22bb91=await withSpinner(_0x1c77a9(0x374),()=>_0xfa99a1['workflow'][_0x1c77a9(0x201)](_0x134b02,_0x494772),{'verbose':_0x3077f7['verbose']}),_0x215361=_0x22bb91[_0x1c77a9(0x303)];return console[_0x1c77a9(0x358)]('✔\x20'+_0x215361),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']='workflow:retry';[a51_0x198ccf(0x209)]='Retry\x20a\x20session\x20or\x20attempt';async[a51_0x198ccf(0x1ff)](_0x26557d){const _0xcff0aa=a51_0x198ccf,{options:_0x4921f6,args:_0x3cd81f,tdx:_0x2fb572}=_0x26557d,_0x3b5657=_0x3cd81f[0x0];if(!_0x3b5657)return console[_0xcff0aa(0x358)](_0xcff0aa(0x30e)),console[_0xcff0aa(0x358)](_0xcff0aa(0x2f3)),0x1;let _0x175e68=![],_0x181658=_0x3b5657;if(_0x3b5657['startsWith'](_0xcff0aa(0x2e5)))_0x175e68=!![],_0x181658=_0x3b5657[_0xcff0aa(0x2e9)](0x8);else{if(_0x3b5657[_0xcff0aa(0x331)](_0xcff0aa(0x287)))_0x175e68=![],_0x181658=_0x3b5657[_0xcff0aa(0x2e9)](0x8);else return console['error']('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0xcff0aa(0x358)](_0xcff0aa(0x2f3)),0x1;}const _0x5892db=_0x4921f6[_0xcff0aa(0x32a)],_0x597756=_0x4921f6[_0xcff0aa(0x36e)],_0x3d491c=_0x4921f6[_0xcff0aa(0x2a7)],_0x58d5b0=_0x4921f6[_0xcff0aa(0x32b)];_0x4921f6[_0xcff0aa(0x2ce)]&&(console[_0xcff0aa(0x358)]('Target:\x20'+(_0x175e68?'session':'attempt')+'\x20'+_0x181658),_0x5892db&&console[_0xcff0aa(0x358)](_0xcff0aa(0x319)+_0x5892db),_0x597756&&console[_0xcff0aa(0x358)]('Resume\x20from:\x20'+_0x597756),_0x3d491c&&console[_0xcff0aa(0x358)](_0xcff0aa(0x350)+_0x3d491c),_0x58d5b0&&console['error'](_0xcff0aa(0x24a)));let _0x57a3b5;if(_0x3d491c)try{if(_0x3d491c[_0xcff0aa(0x331)]('@')){const _0x22a8db=await import(_0xcff0aa(0x220)),_0xcf9b6d=_0x3d491c['substring'](0x1),_0x48c84e=await _0x22a8db[_0xcff0aa(0x34f)](_0xcf9b6d,_0xcff0aa(0x2bf));_0x57a3b5=JSON[_0xcff0aa(0x248)](_0x48c84e);}else _0x57a3b5=JSON[_0xcff0aa(0x248)](_0x3d491c);}catch{return console['error'](_0xcff0aa(0x306)),0x1;}if(!_0x4921f6['yes']){if(!isInteractive())return console['error'](a51_0x35b3be[_0xcff0aa(0x294)](_0xcff0aa(0x33b)),_0xcff0aa(0x37c)),console[_0xcff0aa(0x358)](a51_0x35b3be['dim'](_0xcff0aa(0x2f7))),0x1;const _0x31d35b=await confirmKey(_0xcff0aa(0x293)+(_0x175e68?_0xcff0aa(0x359):_0xcff0aa(0x298))+'\x20'+_0x181658+'?');if(!_0x31d35b)return console[_0xcff0aa(0x358)](a51_0x35b3be['yellow'](_0xcff0aa(0x2cb))),0x1;}let _0x511169;_0x175e68?_0x511169=await withSpinner(_0xcff0aa(0x249),()=>_0x2fb572[_0xcff0aa(0x2d3)][_0xcff0aa(0x223)](_0x181658,{'fromTask':_0x5892db,'retryParams':_0x57a3b5}),{'verbose':_0x4921f6['verbose']}):_0x511169=await withSpinner(_0xcff0aa(0x378),()=>_0x2fb572['workflow']['retryAttempt'](_0x181658,{'resumeFrom':_0x597756,'retryParams':_0x57a3b5,'force':_0x58d5b0}),{'verbose':_0x4921f6[_0xcff0aa(0x2ce)]});const _0x2b8f01=_0x511169[_0xcff0aa(0x303)];return console[_0xcff0aa(0x358)](_0xcff0aa(0x391)),console[_0xcff0aa(0x358)](_0xcff0aa(0x383)+_0x2b8f01[_0xcff0aa(0x270)]),console[_0xcff0aa(0x358)]('\x20\x20Session\x20ID:\x20'+_0x2b8f01[_0xcff0aa(0x20e)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a51_0x198ccf(0x236)]=a51_0x198ccf(0x341);[a51_0x198ccf(0x209)]='Start\x20a\x20workflow\x20run';async[a51_0x198ccf(0x1ff)](_0x195378){const _0x21847d=a51_0x198ccf,{options:_0x5ce269,args:_0x22fdf4,tdx:_0x28274c}=_0x195378;let _0x2d6bb1=_0x22fdf4[0x0];if(!_0x2d6bb1){const _0x123bdf=this[_0x21847d(0x2fe)]([],_0x5ce269),_0x4a6862=await withSpinner('Loading\x20workflows...',()=>_0x28274c[_0x21847d(0x2d3)]['workflows'](_0x123bdf,{'limit':_0x5ce269[_0x21847d(0x320)]}),{'verbose':_0x5ce269[_0x21847d(0x2ce)]}),_0x37fdbf=_0x4a6862[_0x21847d(0x303)];if(_0x37fdbf[_0x21847d(0x252)]===0x0)return console[_0x21847d(0x358)]('No\x20workflows\x20found'),!_0x123bdf&&console[_0x21847d(0x358)](a51_0x35b3be[_0x21847d(0x344)](_0x21847d(0x33f))),0x1;const _0x104156=_0x37fdbf[_0x21847d(0x316)](_0x368811=>({'title':_0x368811['project']?.[_0x21847d(0x236)]+'.'+_0x368811['name'],'value':_0x368811[_0x21847d(0x218)]?.[_0x21847d(0x236)]+'.'+_0x368811['name'],'description':_0x368811[_0x21847d(0x230)]?_0x21847d(0x2a1)+_0x368811['revision']:undefined})),_0x456bb0=await a51_0x4141d8({'type':_0x21847d(0x1ef),'name':'workflow','message':_0x21847d(0x22f),'choices':_0x104156});if(!_0x456bb0['workflow'])return 0x1;_0x2d6bb1=_0x456bb0[_0x21847d(0x2d3)];}if(!_0x2d6bb1[_0x21847d(0x30a)]('.')){const _0x2b6c15=this['resolveProject']([],_0x5ce269);if(_0x2b6c15)_0x2d6bb1=_0x2b6c15+'.'+_0x2d6bb1;else return console[_0x21847d(0x358)](a51_0x35b3be[_0x21847d(0x294)]('Error:'),_0x21847d(0x28a)),console['error'](a51_0x35b3be['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x4f8c25=_0x5ce269[_0x21847d(0x215)],_0x4b78da=_0x5ce269[_0x21847d(0x2eb)],_0x3f65fe={};if(_0x4f8c25&&Array[_0x21847d(0x2cc)](_0x4f8c25))for(const _0x4bff94 of _0x4f8c25){const _0x5685ef=_0x4bff94['indexOf']('=');if(_0x5685ef===-0x1)return console[_0x21847d(0x358)](_0x21847d(0x348)+_0x4bff94),console[_0x21847d(0x358)](_0x21847d(0x234)),0x1;const _0x3f85fc=_0x4bff94[_0x21847d(0x2e9)](0x0,_0x5685ef),_0x32c2f2=_0x4bff94['substring'](_0x5685ef+0x1);try{_0x3f65fe[_0x3f85fc]=JSON[_0x21847d(0x248)](_0x32c2f2);}catch{_0x3f65fe[_0x3f85fc]=_0x32c2f2;}}_0x5ce269[_0x21847d(0x2ce)]&&(console['error'](_0x21847d(0x2ed)+_0x2d6bb1),Object[_0x21847d(0x295)](_0x3f65fe)[_0x21847d(0x252)]>0x0&&console['error'](_0x21847d(0x355)+JSON[_0x21847d(0x2a5)](_0x3f65fe)),_0x4b78da&&console[_0x21847d(0x358)]('Session\x20time:\x20'+_0x4b78da));const _0x344174=await withSpinner(_0x21847d(0x1f7),()=>_0x28274c[_0x21847d(0x2d3)][_0x21847d(0x2dd)](_0x2d6bb1,_0x3f65fe,{'sessionTime':_0x4b78da}),{'verbose':_0x5ce269[_0x21847d(0x2ce)]}),_0x3aff0e=_0x344174[_0x21847d(0x303)];console[_0x21847d(0x358)](_0x21847d(0x22e)),console[_0x21847d(0x358)](_0x21847d(0x381)+_0x3aff0e['id']),console[_0x21847d(0x358)](_0x21847d(0x397)+_0x3aff0e[_0x21847d(0x20e)]),console[_0x21847d(0x358)](_0x21847d(0x29c)+_0x3aff0e['project']?.[_0x21847d(0x236)]),console[_0x21847d(0x358)](_0x21847d(0x24c)+_0x3aff0e['workflow']?.[_0x21847d(0x236)]);if(_0x3aff0e['project']?.['id']&&_0x3aff0e[_0x21847d(0x20e)]&&_0x3aff0e['id']){const _0x866bb6=_0x5ce269[_0x21847d(0x208)],_0x524122=getConsoleUrl(_0x866bb6,'/app/workflows/'+_0x3aff0e[_0x21847d(0x218)]['id']+'/sessions/'+_0x3aff0e[_0x21847d(0x20e)]+_0x21847d(0x24b)+_0x3aff0e['id']);console[_0x21847d(0x358)](_0x21847d(0x2d4)+a51_0x35b3be[_0x21847d(0x37e)](_0x524122));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a51_0x198ccf(0x2e2);[a51_0x198ccf(0x209)]=a51_0x198ccf(0x32d);async[a51_0x198ccf(0x1ff)](_0x5c2fe8){const _0x49a27d=a51_0x198ccf,{options:_0x53f61b,args:_0x1d7a76,tdx:_0x17bd22}=_0x5c2fe8,_0x33edb8=_0x1d7a76[0x0],_0xc21fcd=_0x1d7a76[0x1]||'.';if(!_0x33edb8)return console['error'](_0x49a27d(0x2d8)),console[_0x49a27d(0x358)](_0x49a27d(0x2a6)),0x1;const _0x490c37=_0x53f61b['revision'];_0x53f61b[_0x49a27d(0x2ce)]&&(console[_0x49a27d(0x358)](_0x49a27d(0x1fa)+_0x33edb8),console[_0x49a27d(0x358)](_0x49a27d(0x1ed)+_0xc21fcd),_0x490c37&&console['error']('Revision:\x20'+_0x490c37));const _0x5cc556=await withSpinner(_0x49a27d(0x24f)+_0x33edb8+'...',()=>_0x17bd22['workflow']['download'](_0x33edb8,_0xc21fcd,{'revision':_0x490c37}),{'verbose':_0x53f61b[_0x49a27d(0x2ce)]}),_0x1be2ad=_0x5cc556[_0x49a27d(0x303)];return console[_0x49a27d(0x358)]('✔\x20Downloaded\x20'+_0x1be2ad['projectName']),console[_0x49a27d(0x358)](_0x49a27d(0x280)+_0x1be2ad[_0x49a27d(0x230)]),console[_0x49a27d(0x358)](_0x49a27d(0x243)+_0x1be2ad[_0x49a27d(0x23e)]),console['error'](_0x49a27d(0x2ba)+_0xc21fcd+'/'+_0x1be2ad['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a51_0x198ccf(0x2fb);[a51_0x198ccf(0x209)]=a51_0x198ccf(0x26c);async[a51_0x198ccf(0x1ff)](_0x266053){const _0x25aa16=a51_0x198ccf,{options:_0x5ce8fd,args:_0x524e91,tdx:_0x26116a}=_0x266053;let _0x47ef6e='.',_0x553bdf=_0x5ce8fd['name'];if(_0x524e91[0x0]){const {promises:_0x518500}=await import('fs');try{const _0x2132bb=await _0x518500[_0x25aa16(0x354)](_0x524e91[0x0]);if(_0x2132bb[_0x25aa16(0x214)]())_0x47ef6e=_0x524e91[0x0];else return console[_0x25aa16(0x358)](_0x25aa16(0x386)+_0x524e91[0x0]+_0x25aa16(0x25b)),0x1;}catch{_0x553bdf=_0x524e91[0x0],_0x47ef6e='.';}}const _0x1918e4=_0x5ce8fd[_0x25aa16(0x230)],_0x399aa8=_0x5ce8fd[_0x25aa16(0x394)];_0x5ce8fd[_0x25aa16(0x2ce)]&&(console[_0x25aa16(0x358)](_0x25aa16(0x33a)+_0x47ef6e),_0x553bdf&&console[_0x25aa16(0x358)](_0x25aa16(0x304)+_0x553bdf),_0x1918e4&&console[_0x25aa16(0x358)](_0x25aa16(0x283)+_0x1918e4),_0x399aa8&&console[_0x25aa16(0x358)](_0x25aa16(0x292)));const _0x238f44=await withSpinner(_0x25aa16(0x2fa),()=>_0x26116a[_0x25aa16(0x2d3)][_0x25aa16(0x307)](_0x47ef6e,{'projectName':_0x553bdf,'revision':_0x1918e4,'skipValidation':_0x399aa8}),{'verbose':_0x5ce8fd[_0x25aa16(0x2ce)]}),_0x1accf7=_0x238f44[_0x25aa16(0x303)];return console[_0x25aa16(0x358)](_0x25aa16(0x2bc)+_0x1accf7['projectName']),console[_0x25aa16(0x358)]('\x20\x20Project\x20ID:\x20'+_0x1accf7[_0x25aa16(0x246)]),console[_0x25aa16(0x358)](_0x25aa16(0x280)+_0x1accf7[_0x25aa16(0x230)]),await this[_0x25aa16(0x27d)](_0x26116a,_0x1accf7[_0x25aa16(0x2ae)],_0x5ce8fd['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a51_0x198ccf(0x236)]=a51_0x198ccf(0x20a);[a51_0x198ccf(0x209)]=a51_0x198ccf(0x35d);async['execute'](_0x530a46){const _0x307a4e=a51_0x198ccf,{options:_0x2eb833,args:_0x950a93,tdx:_0x16646d}=_0x530a46,_0x42c320=_0x950a93[0x0],_0x159c84=_0x950a93[0x1];if(!_0x42c320)return console[_0x307a4e(0x358)](a51_0x35b3be['red'](_0x307a4e(0x28e)),'Project\x20name\x20is\x20required'),console['error'](a51_0x35b3be['dim'](_0x307a4e(0x309))),0x1;const _0x1cb096=_0x2eb833[_0x307a4e(0x230)];_0x2eb833['verbose']&&(console[_0x307a4e(0x358)]('Project:\x20'+_0x42c320),_0x159c84&&console[_0x307a4e(0x358)](_0x307a4e(0x305)+_0x159c84),_0x1cb096&&console[_0x307a4e(0x358)](_0x307a4e(0x283)+_0x1cb096),_0x2eb833[_0x307a4e(0x34c)]&&console[_0x307a4e(0x358)]('Dry\x20run:\x20yes'));const _0x4dbdf6=await withSpinner(_0x307a4e(0x37d)+_0x42c320+_0x307a4e(0x239),()=>_0x16646d['workflow'][_0x307a4e(0x385)](_0x42c320,{'targetDir':_0x159c84,'revision':_0x1cb096}),{'verbose':_0x2eb833[_0x307a4e(0x2ce)]}),_0x95738e=_0x4dbdf6[_0x307a4e(0x303)];_0x95738e[_0x307a4e(0x232)]?console[_0x307a4e(0x358)]('→\x20New\x20project:\x20'+_0x95738e[_0x307a4e(0x2ae)]):console[_0x307a4e(0x358)](_0x307a4e(0x1f4)+_0x95738e['projectName']);console['error']('\x20\x20Revision:\x20'+_0x95738e['revision']),console[_0x307a4e(0x358)](_0x307a4e(0x1fe)+(a51_0x3ec8c4[_0x307a4e(0x2ff)](process[_0x307a4e(0x302)](),_0x95738e['targetDir'])||'.')),console['error'](_0x307a4e(0x268)+a51_0x35b3be[_0x307a4e(0x2a4)]('+'+_0x95738e[_0x307a4e(0x2f2)][_0x307a4e(0x281)]+_0x307a4e(0x2d6))+',\x20'+(a51_0x35b3be[_0x307a4e(0x35b)]('~'+_0x95738e[_0x307a4e(0x2f2)][_0x307a4e(0x398)]+_0x307a4e(0x22a))+',\x20')+(a51_0x35b3be['red']('-'+_0x95738e[_0x307a4e(0x2f2)][_0x307a4e(0x203)]+_0x307a4e(0x353))+',\x20')+(''+a51_0x35b3be[_0x307a4e(0x344)](_0x95738e[_0x307a4e(0x2f2)][_0x307a4e(0x373)]+_0x307a4e(0x210))));for(const _0x1611f6 of _0x95738e[_0x307a4e(0x275)]){_0x1611f6[_0x307a4e(0x349)]===_0x307a4e(0x398)&&_0x1611f6[_0x307a4e(0x35c)]&&(console[_0x307a4e(0x358)]('\x0a'+a51_0x35b3be['cyan'](_0x307a4e(0x2b6)+_0x1611f6[_0x307a4e(0x321)])),console[_0x307a4e(0x358)](_0x1611f6[_0x307a4e(0x35c)]));}if(!_0x95738e[_0x307a4e(0x366)])return saveSessionContext({'workflow_project':_0x95738e['projectName']},_0x2eb833['session']),console[_0x307a4e(0x358)](a51_0x35b3be['green']('\x0a✔\x20Already\x20up\x20to\x20date')),console['error'](a51_0x35b3be['dim']('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x95738e['projectName'])),0x0;if(_0x2eb833['dryRun'])return console[_0x307a4e(0x358)](a51_0x35b3be['yellow'](_0x307a4e(0x2ea))),0x0;if(!_0x2eb833[_0x307a4e(0x2fc)]){if(!isInteractive())return console[_0x307a4e(0x358)](a51_0x35b3be[_0x307a4e(0x294)](_0x307a4e(0x33b)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x307a4e(0x358)](a51_0x35b3be['dim'](_0x307a4e(0x2f7))),0x1;const _0xac680c=await confirmKey(_0x307a4e(0x310));if(!_0xac680c)return console[_0x307a4e(0x358)](a51_0x35b3be[_0x307a4e(0x35b)]('Cancelled'),_0x307a4e(0x370)),0x1;}await withSpinner('Writing\x20files...',()=>_0x16646d[_0x307a4e(0x2d3)][_0x307a4e(0x25f)](_0x95738e,{'revision':_0x1cb096}),{'verbose':_0x2eb833['verbose']}),saveSessionContext({'workflow_project':_0x95738e[_0x307a4e(0x2ae)]},_0x2eb833[_0x307a4e(0x359)]),console[_0x307a4e(0x358)](a51_0x35b3be[_0x307a4e(0x2a4)](_0x307a4e(0x379)));const _0x56c86f=a51_0x3ec8c4[_0x307a4e(0x2ff)](process[_0x307a4e(0x302)](),_0x95738e[_0x307a4e(0x395)])||'.';return console['error'](a51_0x35b3be[_0x307a4e(0x344)](_0x307a4e(0x2ba)+_0x56c86f)),console['error'](a51_0x35b3be[_0x307a4e(0x344)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x95738e[_0x307a4e(0x2ae)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a51_0x198ccf(0x236)]=a51_0x198ccf(0x2cd);['description']=a51_0x198ccf(0x2f6);async[a51_0x198ccf(0x1ff)](_0x296e56){const _0x2f0550=a51_0x198ccf,{options:_0x194a04,args:_0x1246f6,tdx:_0x341cba}=_0x296e56,_0x33bfd3=this['resolveProjectDir'](_0x1246f6,_0x194a04),_0x129266=_0x194a04[_0x2f0550(0x230)],_0x1e1015=_0x194a04[_0x2f0550(0x394)];_0x194a04[_0x2f0550(0x2ce)]&&(_0x33bfd3&&console[_0x2f0550(0x358)](_0x2f0550(0x2c2)+_0x33bfd3),_0x129266&&console[_0x2f0550(0x358)](_0x2f0550(0x283)+_0x129266),_0x194a04[_0x2f0550(0x34c)]&&console[_0x2f0550(0x358)](_0x2f0550(0x1f8)),_0x1e1015&&console[_0x2f0550(0x358)]('Validation:\x20skipped'));let _0x27c49b;try{_0x27c49b=await withSpinner(_0x2f0550(0x367),()=>_0x341cba[_0x2f0550(0x2d3)]['preparePushProject']({'sourceDir':_0x33bfd3,'revision':_0x129266,'skipValidation':_0x1e1015}),{'verbose':_0x194a04[_0x2f0550(0x2ce)]});}catch(_0x27f6e8){if(_0x27f6e8 instanceof Error&&_0x27f6e8[_0x2f0550(0x1ec)][_0x2f0550(0x30a)]('No\x20workflow\x20tdx.json\x20found'))return console[_0x2f0550(0x358)](a51_0x35b3be[_0x2f0550(0x294)]('Error:'),_0x2f0550(0x38f)),_0x194a04['workflowProject']?console['error'](a51_0x35b3be[_0x2f0550(0x344)]('Tip:\x20cd\x20to\x20workflows/'+_0x194a04[_0x2f0550(0x222)]+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x194a04['workflowProject']+'\x27')):console[_0x2f0550(0x358)](a51_0x35b3be[_0x2f0550(0x344)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x27f6e8;}const _0x2395a5=_0x27c49b[_0x2f0550(0x303)];console[_0x2f0550(0x358)](_0x2f0550(0x25e)+_0x2395a5[_0x2f0550(0x2ae)]),console['error'](_0x2f0550(0x2f5)+_0x2395a5['sourceDir']),console[_0x2f0550(0x358)](_0x2f0550(0x280)+_0x2395a5['revision']),console[_0x2f0550(0x358)](_0x2f0550(0x268)+a51_0x35b3be['green']('+'+_0x2395a5[_0x2f0550(0x2f2)][_0x2f0550(0x281)]+'\x20new')+',\x20'+(a51_0x35b3be['yellow']('~'+_0x2395a5['summary'][_0x2f0550(0x398)]+_0x2f0550(0x22a))+',\x20')+(a51_0x35b3be[_0x2f0550(0x294)]('-'+_0x2395a5[_0x2f0550(0x2f2)]['deleted']+_0x2f0550(0x353))+',\x20')+(''+a51_0x35b3be[_0x2f0550(0x344)](_0x2395a5[_0x2f0550(0x2f2)][_0x2f0550(0x373)]+_0x2f0550(0x210))));for(const _0x401b2a of _0x2395a5[_0x2f0550(0x275)]){_0x401b2a[_0x2f0550(0x349)]===_0x2f0550(0x398)&&_0x401b2a[_0x2f0550(0x35c)]&&(console['error']('\x0a'+a51_0x35b3be[_0x2f0550(0x37e)](_0x2f0550(0x2b6)+_0x401b2a[_0x2f0550(0x321)])),console[_0x2f0550(0x358)](_0x401b2a['diff']));}if(!_0x2395a5['hasChanges'])return console[_0x2f0550(0x358)](a51_0x35b3be[_0x2f0550(0x2a4)](_0x2f0550(0x2df))),await this[_0x2f0550(0x27d)](_0x341cba,_0x2395a5[_0x2f0550(0x2ae)],_0x194a04[_0x2f0550(0x208)]),0x0;if(_0x194a04[_0x2f0550(0x34c)])return console['error'](a51_0x35b3be['yellow'](_0x2f0550(0x360))),0x0;if(!_0x194a04[_0x2f0550(0x2fc)]){if(!isInteractive())return console[_0x2f0550(0x358)](a51_0x35b3be[_0x2f0550(0x294)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2f0550(0x358)](a51_0x35b3be[_0x2f0550(0x344)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x463da7=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x463da7)return console[_0x2f0550(0x358)](a51_0x35b3be[_0x2f0550(0x35b)]('Cancelled'),_0x2f0550(0x2be)),0x1;}const _0x23dba4=await withSpinner(_0x2f0550(0x237),()=>_0x341cba[_0x2f0550(0x2d3)][_0x2f0550(0x273)](_0x2395a5),{'verbose':_0x194a04[_0x2f0550(0x2ce)]}),_0x97a24=_0x23dba4['data'];return console[_0x2f0550(0x358)](a51_0x35b3be[_0x2f0550(0x2a4)](_0x2f0550(0x2b0))),console[_0x2f0550(0x358)](_0x2f0550(0x2c6)+_0x97a24[_0x2f0550(0x246)]),console[_0x2f0550(0x358)](_0x2f0550(0x280)+_0x97a24[_0x2f0550(0x230)]),await this['showWorkflowConsoleUrl'](_0x341cba,_0x97a24[_0x2f0550(0x2ae)],_0x194a04[_0x2f0550(0x208)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']='workflow:clone';['description']=a51_0x198ccf(0x362);async['execute'](_0x5913c8){const _0x429ee1=a51_0x198ccf,{options:_0x439792,args:_0x58b6ed,tdx:_0x1590c0}=_0x5913c8,_0x5ae96f=this[_0x429ee1(0x286)](_0x58b6ed,_0x439792),_0x3355c5=_0x439792[_0x429ee1(0x236)],_0x3982e3=_0x439792['revision'],_0x5982d5=_0x439792[_0x429ee1(0x394)];if(!_0x5ae96f)return console[_0x429ee1(0x358)](a51_0x35b3be['red']('Error:'),_0x429ee1(0x313)),console[_0x429ee1(0x358)](a51_0x35b3be[_0x429ee1(0x344)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console['error'](a51_0x35b3be[_0x429ee1(0x344)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x3355c5)return console[_0x429ee1(0x358)](a51_0x35b3be[_0x429ee1(0x294)](_0x429ee1(0x28e)),_0x429ee1(0x35a)),console['error'](a51_0x35b3be['dim'](_0x429ee1(0x2d1))),0x1;_0x439792[_0x429ee1(0x2ce)]&&(console['error']('Source\x20directory:\x20'+_0x5ae96f),console[_0x429ee1(0x358)](_0x429ee1(0x393)+_0x3355c5),_0x3982e3&&console[_0x429ee1(0x358)](_0x429ee1(0x283)+_0x3982e3),_0x439792[_0x429ee1(0x34c)]&&console['error'](_0x429ee1(0x1f8)),_0x5982d5&&console[_0x429ee1(0x358)](_0x429ee1(0x292)));const _0x200326=await withSpinner(_0x429ee1(0x34d),()=>_0x1590c0[_0x429ee1(0x2d3)][_0x429ee1(0x23c)](_0x5ae96f,_0x3355c5,{'revision':_0x3982e3,'skipValidation':_0x5982d5}),{'verbose':_0x439792[_0x429ee1(0x2ce)]}),_0x3d62c4=_0x200326[_0x429ee1(0x303)];console[_0x429ee1(0x358)](_0x429ee1(0x2ad)+_0x3d62c4[_0x429ee1(0x340)]);_0x3d62c4[_0x429ee1(0x31e)]&&console[_0x429ee1(0x358)](_0x429ee1(0x38c)+_0x3d62c4['sourceProjectName']);console[_0x429ee1(0x358)](_0x429ee1(0x393)+_0x3d62c4[_0x429ee1(0x382)]),console[_0x429ee1(0x358)](_0x429ee1(0x283)+_0x3d62c4[_0x429ee1(0x230)]),console[_0x429ee1(0x358)](_0x429ee1(0x372)+_0x3d62c4[_0x429ee1(0x277)]);_0x3d62c4[_0x429ee1(0x323)]&&(console[_0x429ee1(0x358)](a51_0x35b3be['yellow']('\x0a⚠\x20Project\x20\x22'+_0x3d62c4[_0x429ee1(0x382)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x3d62c4['existingProjectId']+')')),console['error'](a51_0x35b3be[_0x429ee1(0x35b)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x439792[_0x429ee1(0x34c)])return console[_0x429ee1(0x358)](a51_0x35b3be[_0x429ee1(0x35b)](_0x429ee1(0x240))),0x0;if(!_0x439792[_0x429ee1(0x2fc)]){if(!isInteractive())return console['error'](a51_0x35b3be[_0x429ee1(0x294)](_0x429ee1(0x33b)),_0x429ee1(0x37c)),console[_0x429ee1(0x358)](a51_0x35b3be[_0x429ee1(0x344)](_0x429ee1(0x2f7))),0x1;const _0x1050b6=_0x3d62c4[_0x429ee1(0x31e)]||a51_0x3ec8c4[_0x429ee1(0x1fc)](_0x5ae96f),_0x4b735b=_0x3d62c4[_0x429ee1(0x323)]?_0x429ee1(0x36a)+_0x3355c5+_0x429ee1(0x2ec):'\x0aClone\x20\x22'+_0x1050b6+_0x429ee1(0x26f)+_0x3355c5+'\x22?',_0x5354b3=await confirmKey(_0x4b735b);if(!_0x5354b3)return console[_0x429ee1(0x358)](a51_0x35b3be[_0x429ee1(0x35b)](_0x429ee1(0x2cb))),0x1;}const _0x1059c5=await withSpinner(_0x3d62c4[_0x429ee1(0x323)]?_0x429ee1(0x28f)+_0x3355c5+'...':_0x429ee1(0x322)+_0x3355c5+'...',()=>_0x1590c0['workflow'][_0x429ee1(0x2c7)](_0x3d62c4),{'verbose':_0x439792['verbose']}),_0x446025=_0x1059c5[_0x429ee1(0x303)];return console[_0x429ee1(0x358)](a51_0x35b3be['green'](_0x3d62c4['targetExists']?_0x429ee1(0x202):_0x429ee1(0x231))),console[_0x429ee1(0x358)](_0x429ee1(0x29c)+_0x446025['newProjectName']),console[_0x429ee1(0x358)](_0x429ee1(0x2c6)+_0x446025[_0x429ee1(0x2cf)]),console['error'](_0x429ee1(0x280)+_0x446025[_0x429ee1(0x230)]),await this[_0x429ee1(0x27d)](_0x1590c0,_0x446025[_0x429ee1(0x382)],_0x439792['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a51_0x198ccf(0x25d);[a51_0x198ccf(0x209)]=a51_0x198ccf(0x2e3);async['execute'](_0x4c1c50){const _0x594e8c=a51_0x198ccf,{options:_0x4841bd,args:_0xc271bf,tdx:_0x257991}=_0x4c1c50,_0x454c07=_0xc271bf[0x0];if(!_0x454c07)return console['error']('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x594e8c(0x2ca)),0x1;_0x4841bd[_0x594e8c(0x2ce)]&&console['error'](_0x594e8c(0x1fa)+_0x454c07);if(!_0x4841bd[_0x594e8c(0x2fc)]){if(!isInteractive())return console[_0x594e8c(0x358)](a51_0x35b3be['red'](_0x594e8c(0x33b)),_0x594e8c(0x37c)),console[_0x594e8c(0x358)](a51_0x35b3be[_0x594e8c(0x344)](_0x594e8c(0x2f7))),0x1;const _0x5e9c8c=await confirmKey(_0x594e8c(0x1f6)+_0x454c07+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x5e9c8c)return console[_0x594e8c(0x358)](a51_0x35b3be[_0x594e8c(0x35b)](_0x594e8c(0x2cb))),0x1;}const _0x5dcbc1=await withSpinner(_0x594e8c(0x2e7)+_0x454c07+_0x594e8c(0x239),()=>_0x257991['workflow']['delete'](_0x454c07),{'verbose':_0x4841bd[_0x594e8c(0x2ce)]}),_0x37dbc9=_0x5dcbc1[_0x594e8c(0x303)];return console[_0x594e8c(0x358)](_0x594e8c(0x221)+_0x37dbc9[_0x594e8c(0x2ae)]),console[_0x594e8c(0x358)](_0x594e8c(0x2c6)+_0x37dbc9[_0x594e8c(0x246)]),0x0;}}export function parseKeyValue(_0x38f270){const _0x15ed21=a51_0x198ccf,_0x5a3245=_0x38f270[_0x15ed21(0x299)]('=');if(_0x5a3245===-0x1)throw new Error(_0x15ed21(0x296)+_0x38f270+_0x15ed21(0x26d));const _0xfaf6c6=_0x38f270[_0x15ed21(0x2e9)](0x0,_0x5a3245),_0x383e4b=_0x38f270['substring'](_0x5a3245+0x1);if(!_0xfaf6c6)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0xfaf6c6,'value':_0x383e4b};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a51_0x198ccf(0x236)]=a51_0x198ccf(0x26b);[a51_0x198ccf(0x209)]=a51_0x198ccf(0x30d);async[a51_0x198ccf(0x1ff)](_0x36612b){const _0x425d60=a51_0x198ccf,{options:_0x231b64,args:_0x3c3f1a,tdx:_0x1a148a}=_0x36612b,_0x2be38a=this[_0x425d60(0x267)](_0x3c3f1a,_0x231b64);if(!_0x2be38a)return 0x1;_0x231b64[_0x425d60(0x2ce)]&&console[_0x425d60(0x358)](_0x425d60(0x1fa)+_0x2be38a);const _0x2ff6b0=await withSpinner(_0x425d60(0x29d),()=>_0x1a148a[_0x425d60(0x2d3)][_0x425d60(0x2b2)](_0x2be38a),{'verbose':_0x231b64[_0x425d60(0x2ce)]}),{secrets:_0x1afc21}=_0x2ff6b0[_0x425d60(0x303)];return console['error'](_0x425d60(0x1f2)+_0x1afc21['length']+_0x425d60(0x27e)+(_0x1afc21[_0x425d60(0x252)]!==0x1?'s':'')),await handleSDKOutput(_0x1afc21,_0x231b64),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a51_0x198ccf(0x236)]=a51_0x198ccf(0x34b);['description']=a51_0x198ccf(0x301);async[a51_0x198ccf(0x1ff)](_0x1b709e){const _0x4285b9=a51_0x198ccf,{options:_0x270613,args:_0x1b3855,tdx:_0x518718}=_0x1b709e;let _0x582da6,_0x58ba63;if(_0x1b3855[_0x4285b9(0x252)]>=0x1&&!_0x1b3855[0x0][_0x4285b9(0x30a)]('='))_0x582da6=_0x1b3855[0x0],_0x58ba63=_0x1b3855['slice'](0x1);else{if(_0x1b3855[_0x4285b9(0x252)]>=0x1&&_0x270613[_0x4285b9(0x222)])_0x582da6=_0x270613[_0x4285b9(0x222)],_0x58ba63=_0x1b3855;else return _0x1b3855[_0x4285b9(0x252)]>=0x1?(console[_0x4285b9(0x358)](_0x4285b9(0x2d8)),console[_0x4285b9(0x358)](_0x4285b9(0x33f)),0x1):(console[_0x4285b9(0x358)](_0x4285b9(0x326)),console[_0x4285b9(0x358)](_0x4285b9(0x279)),0x1);}if(_0x58ba63[_0x4285b9(0x252)]===0x0)return console['error'](_0x4285b9(0x326)),console[_0x4285b9(0x358)](_0x4285b9(0x279)),0x1;const _0x102944={};try{for(const _0x574bfe of _0x58ba63){const {key:_0x78d1ed,value:_0x19cbdd}=parseKeyValue(_0x574bfe);_0x102944[_0x78d1ed]=_0x19cbdd;}}catch(_0x35fdba){return _0x35fdba instanceof Error&&console[_0x4285b9(0x358)](a51_0x35b3be[_0x4285b9(0x294)]('Error:'),_0x35fdba[_0x4285b9(0x1ec)]),0x1;}const _0x522fdf=Object[_0x4285b9(0x295)](_0x102944);_0x270613[_0x4285b9(0x2ce)]&&(console[_0x4285b9(0x358)](_0x4285b9(0x1fa)+_0x582da6),console[_0x4285b9(0x358)]('Secrets\x20to\x20set:\x20'+_0x522fdf[_0x4285b9(0x274)](',\x20')));const _0x479f79=await withSpinner(_0x522fdf['length']===0x1?_0x4285b9(0x2b4):_0x4285b9(0x2b8)+_0x522fdf[_0x4285b9(0x252)]+_0x4285b9(0x35e),()=>_0x518718[_0x4285b9(0x2d3)]['setSecrets'](_0x582da6,_0x102944),{'verbose':_0x270613[_0x4285b9(0x2ce)]}),_0x362eee=_0x479f79[_0x4285b9(0x303)];return console[_0x4285b9(0x358)](_0x522fdf['length']===0x1?'✔\x20Secret\x20\x27'+_0x362eee[_0x4285b9(0x295)][0x0]+_0x4285b9(0x266)+_0x362eee[_0x4285b9(0x2ae)]+'\x27':'✔\x20'+_0x362eee['keys'][_0x4285b9(0x252)]+_0x4285b9(0x21d)+_0x362eee[_0x4285b9(0x2ae)]+'\x27'),(_0x270613[_0x4285b9(0x21b)]||_0x270613[_0x4285b9(0x28c)])&&await handleSingleObjectOutput(_0x362eee,_0x270613),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a51_0x198ccf(0x236)]=a51_0x198ccf(0x318);['description']=a51_0x198ccf(0x288);async[a51_0x198ccf(0x1ff)](_0x483671){const _0x8e4726=a51_0x198ccf,{options:_0x4cd4f4,args:_0x472a39,tdx:_0x302ec7}=_0x483671;let _0x1618a3,_0x45fb3e;if(_0x472a39[_0x8e4726(0x252)]>=0x2)_0x1618a3=_0x472a39[0x0],_0x45fb3e=_0x472a39[0x1];else{if(_0x472a39['length']===0x1&&_0x4cd4f4[_0x8e4726(0x222)])_0x1618a3=_0x4cd4f4[_0x8e4726(0x222)],_0x45fb3e=_0x472a39[0x0];else return _0x472a39[_0x8e4726(0x252)]===0x1?(console['error'](_0x8e4726(0x2d8)),console[_0x8e4726(0x358)](_0x8e4726(0x33f)),0x1):(console[_0x8e4726(0x358)](_0x8e4726(0x2bb)),console[_0x8e4726(0x358)](_0x8e4726(0x377)),0x1);}_0x4cd4f4[_0x8e4726(0x2ce)]&&(console[_0x8e4726(0x358)]('Project:\x20'+_0x1618a3),console[_0x8e4726(0x358)](_0x8e4726(0x2d9)+_0x45fb3e));if(!_0x4cd4f4[_0x8e4726(0x2fc)]){if(!isInteractive())return console[_0x8e4726(0x358)](a51_0x35b3be[_0x8e4726(0x294)](_0x8e4726(0x33b)),_0x8e4726(0x37c)),console[_0x8e4726(0x358)](a51_0x35b3be[_0x8e4726(0x344)](_0x8e4726(0x2f7))),0x1;const _0x1c4e38=await confirmKey(_0x8e4726(0x2b1)+_0x45fb3e+_0x8e4726(0x325)+_0x1618a3+'\x27?');if(!_0x1c4e38)return console[_0x8e4726(0x358)](a51_0x35b3be[_0x8e4726(0x35b)]('Cancelled')),0x1;}const _0x38da8d=await withSpinner(_0x8e4726(0x2f9),()=>_0x302ec7[_0x8e4726(0x2d3)][_0x8e4726(0x376)](_0x1618a3,_0x45fb3e),{'verbose':_0x4cd4f4[_0x8e4726(0x2ce)]}),_0x47f163=_0x38da8d['data'];return console[_0x8e4726(0x358)](_0x8e4726(0x22c)+_0x47f163['key']+_0x8e4726(0x272)+_0x47f163['projectName']+'\x27'),(_0x4cd4f4[_0x8e4726(0x21b)]||_0x4cd4f4['jsonl'])&&await handleSingleObjectOutput(_0x47f163,_0x4cd4f4),0x0;}}function a51_0x3170(){const _0x3b090a=['63NRWkzH','session:','renderSingleTimeline','Deleting\x20project\x20','ICON_SPACING','substring','\x0aDry\x20run\x20-\x20no\x20files\x20written','sessionTime','\x22\x20with\x20new\x20revision?','Workflow:\x20','\x1b[1A\x1b[2K','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','summary','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Listing\x20workflow\x20attempts...','\x20\x20Source:\x20','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','No\x20sessions\x20found\x20in\x20project:\x20','Deleting\x20secret...','Pushing\x20workflow\x20project...','workflow:upload','yes','💡\x20Tip:\x20Use\x20','resolveProject','relative','state','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','cwd','data','Project\x20name:\x20','Target\x20directory:\x20','Error:\x20Invalid\x20JSON\x20in\x20--params','push','size','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','includes','createdAt','getDate','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','logFiles','\x0aApply\x20these\x20changes?','pollTimeline','resolveProjectId','Source\x20directory\x20is\x20required','1788200EkilLS','index','map','LABEL_MIN_SPACING','workflow:secrets:delete','From\x20task:\x20','canceling','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Getting\x20attempt\x20details...','retryAttemptName','sourceProjectName','window','limit','path','Cloning\x20to\x20','targetExists','includeSubtasks','\x27\x20from\x20project\x20\x27','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','startedAt','4608096gTEqlA','attempts','fromTask','force','columns','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','workflow:timeline','Usage:\x20tdx\x20wf\x20use\x20<project>','end','startsWith','min','text','✔\x20Showing\x20','\x20attempt','follow','📋\x20','isTTY','Including\x20subtasks:\x20yes','Project\x20directory:\x20','\x0aError:','lastAttempt','📁\x20','\x20logs','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','sourceDir','workflow:run','taskName','\x20workflow','dim','MIN_TIMELINE_WIDTH','filter','2182210gqxFuc','Error:\x20Invalid\x20parameter\x20format:\x20','type','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','workflow:secrets:set','dryRun','Analyzing\x20project...','start','readFile','Params:\x20','Attempt\x20ID:\x20','705386hdehhO','\x20deleted','stat','Parameters:\x20','split','GUTTER','error','session','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','yellow','diff','Pull\x20workflow\x20project\x20to\x20local\x20folder','\x20secrets...','write','\x0aDry\x20run\x20-\x20nothing\x20pushed','No\x20sessions\x20found','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','getMonth','workflow:attempt','getFullYear','hasChanges','Analyzing\x20changes...','tdx\x20wf\x20attempt\x20','cancelRequested','\x0aUpdate\x20existing\x20project\x20\x22','✔\x20Workflow\x20project\x20set\x20to:\x20','Kill\x20a\x20running\x20attempt','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','resumeFrom','white','-\x20no\x20files\x20written','slice','Files\x20to\x20upload:\x20','unchanged','Killing\x20attempt...','clear','deleteSecret','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','Retrying\x20attempt...','✔\x20Pull\x20complete','MAX_TASKS_DISPLAY','rows','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Pulling\x20project\x20','cyan','msPerChar','durationMs','\x20\x20Attempt\x20ID:\x20','newProjectName','\x20\x20New\x20attempt\x20ID:\x20','workflow:use','pullProject','Error:\x20','Show\x20tasks\x20for\x20an\x20attempt','List\x20workflows','Latest\x20session\x20has\x20no\x20attempt','No\x20attempts\x20found\x20in\x20project:\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Source\x20project:\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Failed\x20to\x20fetch\x20attempt\x20data','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','No\x20projects\x20match\x20pattern:\x20','✔\x20Retry\x20started','task','New\x20project\x20name:\x20','skipValidation','targetDir','Listing\x20workflow\x20projects...','\x20\x20Session\x20ID:\x20','modified','fullName','Project\x20filter:\x20','has','\x20(use\x20--limit\x20to\x20show\x20more)','message','Output\x20directory:\x20','No\x20workflow\x20sessions\x20found','select','trimEnd','Reason:\x20','✔\x20Found\x20','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','→\x20Project:\x20','resolve','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Starting\x20workflow\x20run...','Dry\x20run:\x20yes','\x20sessions\x20','Project:\x20','Filter:\x20project=','basename','padStart','\x20\x20Target:\x20','execute','format','kill','✔\x20Project\x20updated','deleted','find','Error:\x20Attempt\x20ID\x20is\x20required','unknown','No\x20sessions\x20with\x20timing\x20information','site','description','workflow:pull','Task\x20name:\x20','Project\x20name\x20is\x20required','buildTimelineData','sessionId','Total:\x20','\x20unchanged','table','includeRetried','MAX_TIMELINE_WIDTH','isDirectory','param','blue','max','project','toISOString','workflow:kill','json','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','\x20secrets\x20set\x20for\x20project\x20\x27','match','Auto-selected\x20latest\x20session:\x20','fs/promises','✔\x20Deleted\x20project\x20','workflowProject','retrySession','sort','renderTimeline','list','set','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','finishedAt','\x20modified','renderSessionsTimeline','✔\x20Secret\x20\x27','List\x20workflow\x20attempts','✔\x20Workflow\x20run\x20started','Select\x20a\x20workflow\x20to\x20run','revision','✔\x20Clone\x20complete','isNewProject','No\x20attempts\x20found','Expected\x20format:\x20--param\x20key=value','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','name','Pushing\x20project...','LABEL_WIDTH_DIVISOR','...','projects','workflow:tasks','prepareCloneProject','Session\x20','filesExtracted','displayLine','\x0aDry\x20run\x20-\x20no\x20project\x20created','\x20-\x20','values','\x20\x20Files\x20extracted:\x20','total','success','projectId','updatedAt','parse','Retrying\x20session...','Force:\x20yes','/attempt/','\x20\x20Workflow:\x20','Warning:','repeat','Downloading\x20project\x20','\x20\x20tdx\x20wf\x20use\x20<project>','ICON_WIDTH','length','logs','generateSessionTimelineRows','workflow:workflows','planned','now','6181821gcKbYB','localeCompare','Getting\x20attempt\x20tasks...','\x20is\x20not\x20a\x20directory','Select\x20a\x20task\x20to\x20view\x20logs:','workflow:delete','✔\x20Project:\x20','applyPullProject','✔\x20Workflow\x20project\x20context\x20cleared.','Using\x20attempt\x20','workflows','log','output','Attempt:\x20','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','requireProject','\x20\x20Changes:\x20','autocomplete','Show\x20specific\x20attempt\x20details','workflow:secrets:list','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','.\x20Expected\x20format:\x20KEY=VALUE','Filter:\x20','\x22\x20to\x20new\x20project\x20\x22','attemptId','floor','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','executePushProject','join','changes','workflowName','fileCount','\x20has\x20no\x20attempts','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','Pattern:\x20','1553319ySrGAP','tasks','showWorkflowConsoleUrl','\x20secret','⚠\x20Showing\x20first\x20','\x20\x20Revision:\x20','new','group_error','Revision:\x20','\x0a✔\x20Attempt\x20complete','all','resolveProjectDir','attempt:','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','replace','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','navigateSessionsInteractive','jsonl','(unknown)','Error:','Updating\x20','\x20of\x20','get','Validation:\x20skipped','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','red','keys','Invalid\x20format:\x20','Select\x20a\x20session\x20to\x20view\x20timeline:','attempt','indexOf','splice','List\x20workflow\x20execution\x20sessions','\x20\x20Project:\x20','Listing\x20secrets...','\x20tasks','sessions','context','revision:\x20','Include\x20retried:\x20yes','session_id','green','stringify','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','params','Session\x20not\x20found:\x20','done','\x20(system)','Downloading\x20logs...','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Source:\x20','projectName','parseProjectWorkflowPattern','✔\x20Push\x20complete','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','listSecrets','Fetching\x20log\x20files...','Setting\x20secret...','stdout','---\x20','duration','Setting\x20','4bMITDI','\x20\x20Location:\x20','Error:\x20Secret\x20key\x20is\x20required','✔\x20Pushed\x20','startTime','-\x20nothing\x20pushed','utf-8','metadata','trim','Source\x20directory:\x20','getTime','No\x20log\x20content\x20found','No\x20sessions\x20found\x20for:\x20','\x20\x20Project\x20ID:\x20','executeCloneProject','key','Loading\x20sessions...','Usage:\x20workflow:delete\x20<project-name-or-id>','Cancelled','isArray','workflow:push','verbose','newProjectId','fill','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','toLowerCase','workflow','\x20\x20Console:\x20','some','\x20new','No\x20workflows\x20found','Error:\x20Project\x20name\x20is\x20required','Key:\x20','No\x20matching\x20sessions\x20found','running','669294JqaUsm','run','from','\x0a✔\x20No\x20changes\x20to\x20push','workflow:projects','\x20project','workflow:download','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data'];a51_0x3170=function(){return _0x3b090a;};return a51_0x3170();}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(_0x14e456){const _0x13bf7e=a51_0x198ccf,_0x5cfe04=Math[_0x13bf7e(0x271)](_0x14e456/0x3e8),_0x443980=Math[_0x13bf7e(0x271)](_0x5cfe04/0x3c),_0x32445f=Math['floor'](_0x443980/0x3c),_0x33f6b4=Math[_0x13bf7e(0x271)](_0x32445f/0x18);if(_0x33f6b4>0x0){const _0x89acce=_0x32445f%0x18;return _0x89acce>0x0?_0x33f6b4+'d\x20'+_0x89acce+'h':_0x33f6b4+'d';}else{if(_0x32445f>0x0){const _0x40072a=_0x443980%0x3c;return _0x40072a>0x0?_0x32445f+'h\x20'+_0x40072a+'m':_0x32445f+'h';}else{if(_0x443980>0x0){const _0x335113=_0x5cfe04%0x3c;return _0x335113>0x0?_0x443980+'m\x20'+_0x335113+'s':_0x443980+'m';}else return _0x5cfe04+'s';}}}function formatTimestamp(_0x2c7b18,_0xaa0cf){const _0x518102=a51_0x198ccf,_0x14672f=new Date(_0x2c7b18),_0x1c5403=String(_0x14672f['getHours']())[_0x518102(0x1fd)](0x2,'0'),_0x71429b=String(_0x14672f['getMinutes']())['padStart'](0x2,'0'),_0x252a96=_0x1c5403+':'+_0x71429b,_0x5a2261=_0x14672f['getFullYear']()===_0xaa0cf[_0x518102(0x365)]()&&_0x14672f['getMonth']()===_0xaa0cf['getMonth']()&&_0x14672f['getDate']()===_0xaa0cf[_0x518102(0x30c)]();if(_0x5a2261)return _0x252a96;else{const _0x1e8b2e=String(_0x14672f['getMonth']()+0x1)[_0x518102(0x1fd)](0x2,'0'),_0x342a62=String(_0x14672f[_0x518102(0x30c)]())['padStart'](0x2,'0');return _0x1e8b2e+'-'+_0x342a62+'\x20'+_0x252a96;}}function formatDate(_0x20986e){const _0x414cf0=a51_0x198ccf,_0x5e20af=_0x20986e[_0x414cf0(0x365)](),_0x1fddf7=String(_0x20986e[_0x414cf0(0x363)]()+0x1)['padStart'](0x2,'0'),_0x330b40=String(_0x20986e['getDate']())[_0x414cf0(0x1fd)](0x2,'0');return _0x5e20af+'-'+_0x1fddf7+'-'+_0x330b40;}function getTaskStateIcon(_0x533a26){const _0x147606={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x147606[_0x533a26]||'⚪';}function getBarChar(_0x2b7927){const _0x5de153=a51_0x198ccf;return _0x2b7927===_0x5de153(0x358)||_0x2b7927===_0x5de153(0x282)?'×':'─';}function getBarColor(_0x5903db){const _0x5e8958=a51_0x198ccf,_0x53d51d={'success':a51_0x35b3be[_0x5e8958(0x2a4)],'error':a51_0x35b3be['red'],'group_error':a51_0x35b3be[_0x5e8958(0x294)],'running':a51_0x35b3be[_0x5e8958(0x216)],'blocked':a51_0x35b3be['yellow'],'planned':a51_0x35b3be[_0x5e8958(0x344)],'canceling':a51_0x35b3be[_0x5e8958(0x35b)]};return _0x53d51d[_0x5903db]||a51_0x35b3be[_0x5e8958(0x36f)];}function parseTaskName(_0x3945b8){const _0x2e41b7=a51_0x198ccf;let _0x3dc96c=_0x3945b8[_0x2e41b7(0x289)](/^\++/,'');const _0x106ec3=_0x3dc96c['split']('+'),_0x208963=_0x106ec3[_0x2e41b7(0x252)]>0x1?_0x106ec3[_0x2e41b7(0x252)]-0x2:0x0,_0xe5fffb=_0x106ec3[_0x106ec3[_0x2e41b7(0x252)]-0x1]||_0x3dc96c;return{'level':_0x208963,'name':'+'+_0xe5fffb};}function a51_0x2f39(_0x4c0e29,_0x4abeff){_0x4c0e29=_0x4c0e29-0x1ec;const _0x3170d6=a51_0x3170();let _0x2f390f=_0x3170d6[_0x4c0e29];return _0x2f390f;}function truncateTaskName(_0x5f3b13,_0xc4222e){const _0x4b77c2=a51_0x198ccf,_0x85ef1=stringWidth(_0x5f3b13);if(_0x85ef1<=_0xc4222e)return _0x5f3b13;let _0x5c6ac0=_0x5f3b13;while(stringWidth(_0x5c6ac0+'…')>_0xc4222e&&_0x5c6ac0[_0x4b77c2(0x252)]>0x0){_0x5c6ac0=_0x5c6ac0[_0x4b77c2(0x371)](0x0,-0x1);}return _0x5c6ac0+'…';}function calculateTimeScale(_0x179abe,_0x49d6b5){const _0x422ef9=a51_0x198ccf;return{'startTime':_0x179abe[_0x422ef9(0x34e)],'endTime':_0x179abe[_0x422ef9(0x330)],'durationMs':_0x179abe['duration'],'msPerChar':_0x179abe['duration']/_0x49d6b5};}function timeToPosition(_0x3d27a5,_0x25b439,_0x24384b){const _0xf1b748=a51_0x198ccf,_0x57932f=_0x3d27a5-_0x25b439[_0xf1b748(0x2bd)],_0x2f56e5=Math[_0xf1b748(0x271)](_0x57932f/_0x25b439[_0xf1b748(0x37f)]);return Math['max'](0x0,Math[_0xf1b748(0x332)](_0x2f56e5,_0x24384b));}function renderTimeAxis(_0x217d2e,_0x4d10a7){const _0x7c694b=a51_0x198ccf,_0x3ffdad=Math['min'](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x7c694b(0x217)](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math[_0x7c694b(0x271)](_0x4d10a7/TIMELINE_CONFIG[_0x7c694b(0x238)]))),_0x5dd6ca=_0x217d2e[_0x7c694b(0x380)]/(_0x3ffdad-0x1),_0x42f3fc=new Date(_0x217d2e[_0x7c694b(0x2bd)]),_0x46df93=[];for(let _0x4be46a=0x0;_0x4be46a<_0x3ffdad;_0x4be46a++){const _0x2d3a27=_0x217d2e['startTime']+_0x4be46a*_0x5dd6ca,_0x11a57a=timeToPosition(_0x2d3a27,_0x217d2e,_0x4d10a7),_0x33271b=formatTimestamp(_0x2d3a27,_0x42f3fc);_0x46df93[_0x7c694b(0x307)]({'pos':_0x11a57a,'text':_0x33271b});}const _0x41231a=new Array(_0x4d10a7)[_0x7c694b(0x2d0)]('\x20');let _0x2e1fbd=-0x1;for(const {pos:_0x1c2229,text:_0x4bda24}of _0x46df93){let _0x338fb9=Math[_0x7c694b(0x217)](0x0,_0x1c2229-Math[_0x7c694b(0x271)](_0x4bda24[_0x7c694b(0x252)]/0x2));_0x338fb9<=_0x2e1fbd+TIMELINE_CONFIG[_0x7c694b(0x317)]&&(_0x338fb9=_0x2e1fbd+TIMELINE_CONFIG[_0x7c694b(0x317)]+0x1);_0x338fb9+_0x4bda24['length']>_0x4d10a7&&(_0x338fb9=_0x4d10a7-_0x4bda24['length']);if(_0x338fb9>=0x0&&_0x338fb9+_0x4bda24[_0x7c694b(0x252)]<=_0x4d10a7&&_0x338fb9>_0x2e1fbd){for(let _0x4bbf65=0x0;_0x4bbf65<_0x4bda24[_0x7c694b(0x252)];_0x4bbf65++){_0x41231a[_0x338fb9+_0x4bbf65]=_0x4bda24[_0x4bbf65];}_0x2e1fbd=_0x338fb9+_0x4bda24['length']-0x1;}}return _0x41231a['join']('');}function renderTaskRow(_0x361353,_0x4886b0,_0x417bc5,_0x4ce3d7){const _0x558417=a51_0x198ccf,{level:_0x19fb9c,name:_0x4f511d}=parseTaskName(_0x361353[_0x558417(0x236)]),_0x5cec11='\x20'[_0x558417(0x24e)](_0x19fb9c),_0x228e98=_0x361353[_0x558417(0x31f)]?'('+formatElapsed(_0x361353[_0x558417(0x31f)][_0x558417(0x2b7)])+')':'',_0x16b8a3=stringWidth(_0x228e98),_0x54ace8=_0x19fb9c*0x1,_0x1dcc59=_0x4ce3d7-_0x54ace8-_0x16b8a3-0x1,_0x5c1d94=truncateTaskName(_0x4f511d,_0x1dcc59),_0x292db0=_0x5cec11+_0x5c1d94,_0x1ed588=stringWidth(_0x292db0),_0xd59576=_0x4ce3d7-_0x1ed588-_0x16b8a3,_0x21e83c=_0x292db0+'\x20'['repeat'](Math['max'](0x1,_0xd59576))+a51_0x35b3be['dim'](_0x228e98),_0x173477=getTaskStateIcon(_0x361353[_0x558417(0x300)]),_0x2ddb42=new Array(_0x417bc5)['fill']('\x20');if(_0x361353['window']){const _0x116217=timeToPosition(_0x361353[_0x558417(0x31f)][_0x558417(0x34e)],_0x4886b0,_0x417bc5),_0x4f897f=timeToPosition(_0x361353['window']['end'],_0x4886b0,_0x417bc5),_0x442fa2=getBarChar(_0x361353[_0x558417(0x300)]),_0x828278=Math[_0x558417(0x217)](_0x116217+0x1,_0x4f897f);for(let _0x2cee6c=_0x116217;_0x2cee6c<Math[_0x558417(0x332)](_0x828278,_0x417bc5);_0x2cee6c++){_0x2ddb42[_0x2cee6c]=_0x442fa2;}}const _0x3d6f03=getBarColor(_0x361353[_0x558417(0x300)]),_0x329557=_0x2ddb42[_0x558417(0x316)](_0x42619a=>_0x42619a==='\x20'?'\x20':_0x3d6f03(_0x42619a))[_0x558417(0x274)]('');return _0x173477+'\x20'+_0x21e83c+'│'+_0x329557+'│';}function calculateStats(_0x28c62a){const _0x521ee0=a51_0x198ccf,_0x537775={'total':_0x28c62a['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x1d0f58 of _0x28c62a){if(_0x1d0f58[_0x521ee0(0x300)]===_0x521ee0(0x245))_0x537775[_0x521ee0(0x245)]++;else{if(_0x1d0f58[_0x521ee0(0x300)]===_0x521ee0(0x358)||_0x1d0f58[_0x521ee0(0x300)]===_0x521ee0(0x282))_0x537775[_0x521ee0(0x358)]++;else _0x1d0f58[_0x521ee0(0x300)]===_0x521ee0(0x2db)?_0x537775['running']++:_0x537775['pending']++;}}return _0x537775;}function formatStats(_0xe6d410){const _0x5f010c=a51_0x198ccf;return[_0x5f010c(0x20f)+_0xe6d410[_0x5f010c(0x244)],'✅\x20'+_0xe6d410[_0x5f010c(0x245)],'❌\x20'+_0xe6d410[_0x5f010c(0x358)],'🔄\x20'+_0xe6d410['running'],'⏳\x20'+_0xe6d410['pending']]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a51_0x198ccf(0x236)]=a51_0x198ccf(0x32e);[a51_0x198ccf(0x209)]=a51_0x198ccf(0x34a);async[a51_0x198ccf(0x1ff)](_0x519396){const _0x3b7cac=a51_0x198ccf,{options:_0x3ddff7,args:_0x1e229a,tdx:_0x41b8ab}=_0x519396;let _0x18556b,_0x28f79e,_0x388a64=![];if(_0x1e229a[0x0]){if(_0x1e229a[0x0][_0x3b7cac(0x30a)]('.')){const _0x4bcea9=this[_0x3b7cac(0x2af)](_0x1e229a,_0x3ddff7);if(!_0x4bcea9)return 0x1;_0x18556b=_0x4bcea9['projectName'],_0x28f79e=_0x4bcea9[_0x3b7cac(0x276)];}else{_0x28f79e=_0x1e229a[0x0],_0x18556b=_0x3ddff7[_0x3b7cac(0x222)];if(!_0x18556b)return console[_0x3b7cac(0x358)](a51_0x35b3be['red'](_0x3b7cac(0x28e)),_0x3b7cac(0x36d)),0x1;_0x388a64=!![];}}else{const _0x2b21e1=this['parseProjectWorkflowPattern'](_0x1e229a,_0x3ddff7);if(!_0x2b21e1)return 0x1;_0x18556b=_0x2b21e1['projectName'],_0x28f79e=_0x2b21e1['workflowName'];}if(_0x3ddff7[_0x3b7cac(0x2ce)]){if(_0x18556b&&_0x28f79e)console[_0x3b7cac(0x358)](_0x3b7cac(0x26e)+_0x18556b+'.'+_0x28f79e);else _0x18556b&&console['error'](_0x3b7cac(0x1fb)+_0x18556b);}const _0x421134=_0x3ddff7[_0x3b7cac(0x270)],_0x117642=_0x3ddff7[_0x3b7cac(0x20e)];if(_0x421134){_0x117642&&console[_0x3b7cac(0x358)](a51_0x35b3be[_0x3b7cac(0x35b)](_0x3b7cac(0x24d)),_0x3b7cac(0x1f3));const _0x1132bb=_0x3ddff7[_0x3b7cac(0x336)];return _0x1132bb?await this[_0x3b7cac(0x311)](_0x519396,_0x421134):await this[_0x3b7cac(0x2e6)](_0x519396,_0x421134,_0x3ddff7),0x0;}if(_0x117642){const _0x2f3efc=await withSpinner('Loading\x20session...',()=>_0x41b8ab[_0x3b7cac(0x2d3)][_0x3b7cac(0x29f)]({'projectName':_0x18556b,'workflowName':_0x28f79e,'limit':0x64}),{'verbose':_0x3ddff7['verbose']}),_0xa41260=_0x2f3efc[_0x3b7cac(0x303)][_0x3b7cac(0x204)](_0x3cb57f=>_0x3cb57f['id']===_0x117642);if(!_0xa41260)return console['error'](a51_0x35b3be[_0x3b7cac(0x294)](_0x3b7cac(0x28e)),_0x3b7cac(0x2a8)+_0x117642),0x1;if(!_0xa41260['lastAttempt']?.['id'])return console[_0x3b7cac(0x358)](a51_0x35b3be[_0x3b7cac(0x294)](_0x3b7cac(0x28e)),_0x3b7cac(0x23d)+_0x117642+_0x3b7cac(0x278)),0x1;const _0x108a91=_0xa41260[_0x3b7cac(0x33c)]['id'];_0x3ddff7[_0x3b7cac(0x2ce)]&&console[_0x3b7cac(0x358)](_0x3b7cac(0x261)+_0x108a91+'\x20from\x20session\x20'+_0x117642);const _0x265c3e=_0x3ddff7['follow'];return _0x265c3e?await this[_0x3b7cac(0x311)](_0x519396,_0x108a91):await this[_0x3b7cac(0x2e6)](_0x519396,_0x108a91,_0x3ddff7),0x0;}const _0x234bf6=await withSpinner(_0x3b7cac(0x2c9),()=>_0x41b8ab[_0x3b7cac(0x2d3)][_0x3b7cac(0x29f)]({'projectName':_0x18556b,'workflowName':_0x28f79e,'limit':_0x3ddff7['limit']||0x32}),{'verbose':_0x3ddff7['verbose']}),_0x4d0103=_0x234bf6[_0x3b7cac(0x303)];if(_0x4d0103[_0x3b7cac(0x252)]===0x0){if(_0x18556b&&_0x28f79e)console[_0x3b7cac(0x358)](_0x3b7cac(0x2c5)+_0x18556b+'.'+_0x28f79e);else _0x18556b?console[_0x3b7cac(0x358)](_0x3b7cac(0x2f8)+_0x18556b):(console['error'](_0x3b7cac(0x1ee)),console['error'](a51_0x35b3be[_0x3b7cac(0x344)](_0x3b7cac(0x2f0))));return 0x0;}_0x4d0103['sort']((_0x9452d0,_0xce8262)=>{const _0x2b5a3d=_0x3b7cac,_0xf6c215=_0x9452d0[_0x2b5a3d(0x2eb)]||'',_0x412ed5=_0xce8262[_0x2b5a3d(0x2eb)]||'';return _0x412ed5['localeCompare'](_0xf6c215);});if(_0x3ddff7[_0x3b7cac(0x21b)]||_0x3ddff7[_0x3b7cac(0x28c)])return await handleSDKOutput(_0x4d0103,_0x3ddff7),0x0;let _0x3debf6;if(_0x388a64){const _0x49d470=_0x4d0103[0x0];if(!_0x49d470[_0x3b7cac(0x33c)]?.['id'])return console[_0x3b7cac(0x358)](_0x3b7cac(0x389)),0x0;_0x3debf6=_0x49d470[_0x3b7cac(0x33c)]['id'],_0x3ddff7['verbose']&&console[_0x3b7cac(0x358)](_0x3b7cac(0x21f)+_0x49d470['sessionTime']);}else{const _0x5745d1=_0x4d0103['map'](_0x472c41=>{const _0x1df7f2=_0x3b7cac,_0x5e455d=getAttemptStatusDisplay(_0x472c41[_0x1df7f2(0x33c)]);return{'title':_0x472c41['project']?.[_0x1df7f2(0x236)]+'.'+_0x472c41['workflow']?.['name']+_0x1df7f2(0x241)+_0x472c41['sessionTime']+'\x20'+_0x5e455d['icon'],'value':_0x472c41[_0x1df7f2(0x33c)]?.['id']||'','description':_0x5e455d[_0x1df7f2(0x333)]};}),_0x17dc34=await a51_0x4141d8({'type':_0x3b7cac(0x1ef),'name':_0x3b7cac(0x270),'message':_0x3b7cac(0x297),'choices':_0x5745d1[_0x3b7cac(0x346)](_0x1784a1=>_0x1784a1['value']!=='')});if(!_0x17dc34['attemptId'])return 0x0;_0x3debf6=_0x17dc34[_0x3b7cac(0x270)];}const _0xbc2ab=_0x3ddff7[_0x3b7cac(0x336)];return _0xbc2ab?await this[_0x3b7cac(0x311)](_0x519396,_0x3debf6):await this[_0x3b7cac(0x2e6)](_0x519396,_0x3debf6,_0x3ddff7),0x0;}async[a51_0x198ccf(0x2e6)](_0x16839b,_0x3427e1,_0x5b54e6){const _0x52b63c=a51_0x198ccf,{tdx:_0xfc1c72}=_0x16839b;let _0x15fa0e,_0x363a7a;try{[_0x15fa0e,_0x363a7a]=await Promise[_0x52b63c(0x285)]([_0xfc1c72[_0x52b63c(0x2d3)]['attempt'](_0x3427e1),_0xfc1c72[_0x52b63c(0x2d3)][_0x52b63c(0x27c)](_0x3427e1,![])]);}catch(_0x1fe119){console['error'](a51_0x35b3be['red'](_0x52b63c(0x38e)));_0x5b54e6[_0x52b63c(0x2ce)]&&console[_0x52b63c(0x358)](_0x1fe119);throw _0x1fe119;}if(_0x5b54e6[_0x52b63c(0x21b)]||_0x5b54e6['jsonl']){const _0x10e85c=this[_0x52b63c(0x20d)](_0x15fa0e,_0x363a7a);await handleSDKOutput([_0x10e85c],_0x5b54e6);return;}const _0x38ae25=_0xfc1c72[_0x52b63c(0x2a0)][_0x52b63c(0x208)],_0x3e4b09=this[_0x52b63c(0x225)](_0x15fa0e,_0x363a7a,_0x38ae25);console[_0x52b63c(0x263)](_0x3e4b09);}async[a51_0x198ccf(0x311)](_0x15be8f,_0x222f2c){const _0x14522a=a51_0x198ccf,{tdx:_0x4b904b}=_0x15be8f,_0xa3c08c=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x174cb4=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x1edc51=0x0;while(_0x1edc51<_0x174cb4){process[_0x14522a(0x2b5)][_0x14522a(0x338)]&&process[_0x14522a(0x2b5)]['write']('\x1bc');let _0x5410dd,_0x5dc30d;try{[_0x5410dd,_0x5dc30d]=await Promise[_0x14522a(0x285)]([_0x4b904b[_0x14522a(0x2d3)]['attempt'](_0x222f2c),_0x4b904b[_0x14522a(0x2d3)][_0x14522a(0x27c)](_0x222f2c,![])]);}catch(_0x26be12){console['error'](a51_0x35b3be['red']('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x1edc51>0x0&&console[_0x14522a(0x358)](a51_0x35b3be[_0x14522a(0x344)](_0x14522a(0x21c)+_0x1edc51));throw _0x26be12;}const _0x10ae78=_0x4b904b[_0x14522a(0x2a0)][_0x14522a(0x208)],_0x1d4baa=this[_0x14522a(0x225)](_0x5410dd,_0x5dc30d,_0x10ae78);console[_0x14522a(0x263)](_0x1d4baa);const _0x2bda7a=_0x5410dd[_0x14522a(0x2a9)]&&_0x5dc30d['every'](_0x5c9b9e=>_0x5c9b9e[_0x14522a(0x300)]!==_0x14522a(0x2db)&&_0x5c9b9e[_0x14522a(0x300)]!==_0x14522a(0x256));if(_0x2bda7a){console[_0x14522a(0x358)](a51_0x35b3be[_0x14522a(0x2a4)](_0x14522a(0x284)));break;}console['error'](a51_0x35b3be[_0x14522a(0x344)]('\x0aPolling...\x20('+_0x1edc51*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0xa99849=>setTimeout(_0xa99849,_0xa3c08c)),_0x1edc51++;}_0x1edc51>=_0x174cb4&&console[_0x14522a(0x358)](a51_0x35b3be[_0x14522a(0x35b)](_0x14522a(0x2f1)));}['renderTimeline'](_0x231d79,_0x21505a,_0xd1a18a){const _0x2b84bb=a51_0x198ccf,_0x281ac1=[],_0x15bc27=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x5ec288=0x5,_0x174234=process[_0x2b84bb(0x2b5)][_0x2b84bb(0x32c)]||0x78,_0x2134bb=_0x174234-_0x15bc27-_0x5ec288,_0x494de9=Math['max'](TIMELINE_CONFIG[_0x2b84bb(0x345)],Math[_0x2b84bb(0x332)](_0x2134bb,TIMELINE_CONFIG[_0x2b84bb(0x213)])),_0x179d1e=new Date(_0x231d79[_0x2b84bb(0x30b)])[_0x2b84bb(0x2c3)](),_0x1489bf=_0x231d79['finishedAt']?new Date(_0x231d79['finishedAt'])[_0x2b84bb(0x2c3)]():Date[_0x2b84bb(0x257)](),_0xec3046={'start':_0x179d1e,'end':_0x1489bf,'duration':_0x1489bf-_0x179d1e},_0x12d79a=new Map(),_0x583b1a=[];for(const _0x81a030 of _0x21505a){if(_0x81a030['startedAt']){const _0x3ea3de=new Date(_0x81a030['startedAt'])[_0x2b84bb(0x2c3)](),_0x3c98fe=_0x81a030[_0x2b84bb(0x247)]?new Date(_0x81a030[_0x2b84bb(0x247)])[_0x2b84bb(0x2c3)]():Date['now'](),_0x1608e5={'start':_0x3ea3de,'end':_0x3c98fe,'duration':_0x3c98fe-_0x3ea3de};_0x12d79a[_0x2b84bb(0x227)](_0x81a030['id'],_0x1608e5),_0x583b1a[_0x2b84bb(0x307)]({'name':_0x81a030[_0x2b84bb(0x399)],'state':_0x81a030[_0x2b84bb(0x300)]||'unknown','window':_0x1608e5});}else _0x583b1a['push']({'name':_0x81a030['fullName'],'state':_0x81a030[_0x2b84bb(0x300)]||_0x2b84bb(0x256),'window':undefined});}_0x583b1a[_0x2b84bb(0x224)]((_0x2d48fa,_0x3dc2eb)=>{const _0x1cf944=_0x2b84bb;if(!_0x2d48fa['window'])return 0x1;if(!_0x3dc2eb['window'])return-0x1;return _0x2d48fa[_0x1cf944(0x31f)][_0x1cf944(0x34e)]-_0x3dc2eb[_0x1cf944(0x31f)]['start'];});const _0x55a2b6=_0x583b1a['length'],_0x4b9961=_0x55a2b6>TIMELINE_CONFIG[_0x2b84bb(0x37a)];_0x4b9961&&_0x583b1a[_0x2b84bb(0x29a)](TIMELINE_CONFIG[_0x2b84bb(0x37a)]);const _0x42b39e=calculateTimeScale(_0xec3046,_0x494de9),_0x546910=_0x231d79[_0x2b84bb(0x2a9)]?_0x231d79[_0x2b84bb(0x245)]?a51_0x35b3be[_0x2b84bb(0x2a4)](_0x2b84bb(0x245)):a51_0x35b3be[_0x2b84bb(0x294)](_0x2b84bb(0x358)):a51_0x35b3be['blue']('running'),_0x2d0485=_0x231d79[_0x2b84bb(0x218)]?.['id'],_0x537594=_0x231d79[_0x2b84bb(0x20e)];let _0x1197c5;if(_0x2d0485&&_0x537594){const _0x7a0cab=getWorkflowAttemptUrl(_0xd1a18a,_0x2d0485,_0x537594,_0x231d79['id']);_0x1197c5=hyperlink(a51_0x35b3be[_0x2b84bb(0x344)](_0x231d79['id']),_0x7a0cab);}else _0x1197c5=a51_0x35b3be[_0x2b84bb(0x344)](_0x231d79['id']);_0x281ac1[_0x2b84bb(0x307)](_0x2b84bb(0x265)+_0x1197c5+_0x2b84bb(0x241)+_0x546910+_0x2b84bb(0x241)+formatElapsed(_0xec3046[_0x2b84bb(0x2b7)]));if(_0x583b1a[_0x2b84bb(0x252)]>0x0){const _0x2524ac=renderTimeAxis(_0x42b39e,_0x494de9),_0x3afd09=new Date(_0xec3046[_0x2b84bb(0x34e)]),_0x32a16b=formatDate(_0x3afd09),_0x577a2b=TIMELINE_CONFIG[_0x2b84bb(0x251)]+TIMELINE_CONFIG[_0x2b84bb(0x2e8)]+_0x15bc27,_0x4ced41=_0x32a16b['padStart'](_0x577a2b),_0x520664=a51_0x35b3be['dim'](_0x4ced41);_0x281ac1[_0x2b84bb(0x307)](_0x520664+'\x20'+_0x2524ac);for(const _0x1ec083 of _0x583b1a){_0x281ac1[_0x2b84bb(0x307)](renderTaskRow(_0x1ec083,_0x42b39e,_0x494de9,_0x15bc27));}const _0x443e5b=calculateStats(_0x583b1a);_0x281ac1[_0x2b84bb(0x307)](formatStats(_0x443e5b)),_0x4b9961&&_0x281ac1[_0x2b84bb(0x307)](a51_0x35b3be[_0x2b84bb(0x35b)](_0x2b84bb(0x27f)+TIMELINE_CONFIG[_0x2b84bb(0x37a)]+_0x2b84bb(0x290)+_0x55a2b6+_0x2b84bb(0x29e))),_0x281ac1[_0x2b84bb(0x307)](''),_0x281ac1[_0x2b84bb(0x307)](a51_0x35b3be['dim'](_0x2b84bb(0x2fd))+(_0x2b84bb(0x368)+_0x231d79['id']+_0x2b84bb(0x33e))+a51_0x35b3be[_0x2b84bb(0x344)]('\x20to\x20see\x20detailed\x20logs'));}else _0x281ac1[_0x2b84bb(0x307)](_0x2b84bb(0x2ac));return _0x281ac1[_0x2b84bb(0x274)]('\x0a');}['buildTimelineData'](_0x140a28,_0x30774d){const _0x2b74fd=a51_0x198ccf,_0x53b365=new Date(_0x140a28[_0x2b74fd(0x30b)])[_0x2b74fd(0x2c3)](),_0x50fa4f=_0x140a28[_0x2b74fd(0x229)]?new Date(_0x140a28[_0x2b74fd(0x229)])[_0x2b74fd(0x2c3)]():Date[_0x2b74fd(0x257)](),_0x149ffc=_0x50fa4f-_0x53b365,_0x4c0a5e=[];for(const _0x215c9e of _0x30774d){if(_0x215c9e[_0x2b74fd(0x327)]){const _0x27e196=new Date(_0x215c9e[_0x2b74fd(0x327)])[_0x2b74fd(0x2c3)](),_0x16daee=_0x215c9e[_0x2b74fd(0x247)]?new Date(_0x215c9e[_0x2b74fd(0x247)])[_0x2b74fd(0x2c3)]():Date[_0x2b74fd(0x257)]();_0x4c0a5e[_0x2b74fd(0x307)]({'name':_0x215c9e[_0x2b74fd(0x399)],'state':_0x215c9e['state']||_0x2b74fd(0x206),'window':{'start':_0x27e196,'end':_0x16daee,'duration':_0x16daee-_0x27e196}});}else _0x4c0a5e['push']({'name':_0x215c9e[_0x2b74fd(0x399)],'state':_0x215c9e[_0x2b74fd(0x300)]||_0x2b74fd(0x256),'window':undefined});}const _0x297b81=calculateStats(_0x4c0a5e);return{'attempt':{'id':_0x140a28['id'],'status':_0x140a28['done']?_0x140a28[_0x2b74fd(0x245)]?_0x2b74fd(0x245):_0x2b74fd(0x358):_0x2b74fd(0x2db),'createdAt':_0x140a28[_0x2b74fd(0x30b)],'finishedAt':_0x140a28[_0x2b74fd(0x229)],'duration_ms':_0x149ffc},'tasks':_0x4c0a5e[_0x2b74fd(0x316)](_0x1205ba=>({'name':_0x1205ba[_0x2b74fd(0x236)],'state':_0x1205ba[_0x2b74fd(0x300)],'startedAt':_0x1205ba[_0x2b74fd(0x31f)]?new Date(_0x1205ba[_0x2b74fd(0x31f)][_0x2b74fd(0x34e)])[_0x2b74fd(0x219)]():null,'updatedAt':_0x1205ba[_0x2b74fd(0x31f)]?new Date(_0x1205ba[_0x2b74fd(0x31f)][_0x2b74fd(0x330)])[_0x2b74fd(0x219)]():null,'duration_ms':_0x1205ba[_0x2b74fd(0x31f)]?.[_0x2b74fd(0x2b7)]||null})),'stats':_0x297b81};}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a52_0x28fb(){const _0xeb2c86=['8CswmFL','5286cPAJzx','4770PUyjsn','version','3054921httbaS',';\x20node/','tdx','X-Trino-User','entries','length','10429038Tymsba','TD1\x20','3956909WFMhAJ','Authorization','10okTQzi','456842AtQorj','Bearer\x20','5236574ukgLIz','4ODAaAD','21108216pZRSPo','1tgLbbe'];a52_0x28fb=function(){return _0xeb2c86;};return a52_0x28fb();}(function(_0x57edd7,_0x3a3ef1){const _0x35dca0=a52_0x8b7e,_0x38ec39=_0x57edd7();while(!![]){try{const _0x18e10b=-parseInt(_0x35dca0(0x1ba))/0x1*(parseInt(_0x35dca0(0x1b5))/0x2)+parseInt(_0x35dca0(0x1aa))/0x3*(-parseInt(_0x35dca0(0x1b8))/0x4)+-parseInt(_0x35dca0(0x1bd))/0x5*(-parseInt(_0x35dca0(0x1bc))/0x6)+parseInt(_0x35dca0(0x1b7))/0x7*(parseInt(_0x35dca0(0x1bb))/0x8)+-parseInt(_0x35dca0(0x1b0))/0x9+parseInt(_0x35dca0(0x1b4))/0xa*(-parseInt(_0x35dca0(0x1b2))/0xb)+parseInt(_0x35dca0(0x1b9))/0xc;if(_0x18e10b===_0x3a3ef1)break;else _0x38ec39['push'](_0x38ec39['shift']());}catch(_0x20ede8){_0x38ec39['push'](_0x38ec39['shift']());}}}(a52_0x28fb,0x8e2c9));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x538826=a52_0x8b7e,_0x5e95cd=getVersion(),_0x232dfb=platform(),_0x4b76dd=process[_0x538826(0x1a9)]['replace']('v','');return'tdx/'+_0x5e95cd+'\x20('+_0x232dfb+_0x538826(0x1ab)+_0x4b76dd+')';}function a52_0x8b7e(_0x8e3f36,_0x269502){_0x8e3f36=_0x8e3f36-0x1a9;const _0x28fb1a=a52_0x28fb();let _0x8b7ea8=_0x28fb1a[_0x8e3f36];return _0x8b7ea8;}export function getAuthHeaders(_0x2e3775,_0x2205f3,_0x1a1adc){const _0x2bfe1c=a52_0x8b7e,_0x1f12a0=getVersion(),_0x385cc5={'User-Agent':getUserAgent(),'X-TD-Client':_0x2bfe1c(0x1ac),'X-TD-Client-Version':_0x1f12a0};if(_0x1a1adc)_0x385cc5[_0x2bfe1c(0x1b3)]=_0x2bfe1c(0x1b6)+_0x1a1adc;else _0x2205f3&&(_0x385cc5['Authorization']=_0x2bfe1c(0x1b1)+_0x2205f3);return _0x385cc5;}export function toHeaderRecord(_0x27fd1c){const _0xeb1adc=a52_0x8b7e,_0x6126d3={};for(const [_0x319f01,_0x1ed4ca]of Object[_0xeb1adc(0x1ae)](_0x27fd1c)){_0x1ed4ca!==undefined&&(_0x6126d3[_0x319f01]=_0x1ed4ca);}return _0x6126d3;}export function getTrinoHeaders(_0x38476d,_0x2afbce,_0x14af7a){const _0x56a1d0=a52_0x8b7e,_0x54f38b=getAuthHeaders(_0x38476d),_0x491aa9=toHeaderRecord(_0x54f38b);if(_0x14af7a)_0x491aa9['Authorization']=_0x56a1d0(0x1b6)+_0x14af7a;else _0x2afbce&&(_0x491aa9[_0x56a1d0(0x1ad)]=_0x2afbce);return _0x491aa9;}export function hasAPIKey(_0x9d584){const _0x1c5480=a52_0x8b7e,_0xe3ccf2=getAPIKey();return _0xe3ccf2!==undefined&&_0xe3ccf2[_0x1c5480(0x1af)]>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(_0x56f4b3,_0x12ebd8){const _0x57e244=a53_0xa97c,_0x272af1=_0x56f4b3();while(!![]){try{const _0x580e4f=parseInt(_0x57e244(0x11d))/0x1*(parseInt(_0x57e244(0xf3))/0x2)+-parseInt(_0x57e244(0x10d))/0x3+parseInt(_0x57e244(0xe2))/0x4+-parseInt(_0x57e244(0x126))/0x5+parseInt(_0x57e244(0xf9))/0x6+parseInt(_0x57e244(0x108))/0x7+-parseInt(_0x57e244(0x11f))/0x8*(parseInt(_0x57e244(0x101))/0x9);if(_0x580e4f===_0x12ebd8)break;else _0x272af1['push'](_0x272af1['shift']());}catch(_0x146bac){_0x272af1['push'](_0x272af1['shift']());}}}(a53_0x5b27,0x9dd0c));function a53_0xa97c(_0x4d6961,_0x136193){_0x4d6961=_0x4d6961-0xdc;const _0x5b27c2=a53_0x5b27();let _0xa97c17=_0x5b27c2[_0x4d6961];return _0xa97c17;}import{writeFileSync}from'fs';import{spawn}from'child_process';function a53_0x5b27(){const _0x5d45e0=['object','stderr','7700220XIfPxA','jsonl','join','double','push','stringify','json','varchar','3658815fIlZgY','red','FINISHED','[error]','limit','[params]','isTTY','4081189yJbHsq','Results\x20saved\x20to\x20','pipe','log','stdin','2465250nzOZZx','repeat','query','─┴─','[rule]','color','limitStructuredFormats','less','padEnd','trim','list','number','end','forEach','bigint','spawn','2ijDfXj','close','16xjubxS','entries','sdk-result','split','stdout','cyan','params','3423630rOVhaw','string','table','filter','rule','boolean','max','2044908LfzNKb','isFinite','keys','noColor','format','length','─┬─','yellow','debug','bold','data','map','resolve','-FXRSn','tsv','error','cmdout','588334OeynYL','blue','slice','output'];a53_0x5b27=function(){return _0x5d45e0;};return a53_0x5b27();}import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a53_0x204530 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0xfe13b8){const _0x328e25=a53_0xa97c;return _0xfe13b8['format']===_0x328e25(0xff)||_0xfe13b8[_0x328e25(0xe6)]===_0x328e25(0xfa)||_0xfe13b8[_0x328e25(0xe6)]===_0x328e25(0xf0)||_0xfe13b8['format']===_0x328e25(0xdd)||_0xfe13b8[_0x328e25(0xff)]===!![]||_0xfe13b8[_0x328e25(0xfa)]===!![]||_0xfe13b8[_0x328e25(0xf0)]===!![]||_0xfe13b8[_0x328e25(0xdd)]===!![];}export function parseOutputOptions(_0x228bb5){const _0x124477=a53_0xa97c;return{'format':_0x228bb5[_0x124477(0xe6)]||_0x124477(0xdd),'output':_0x228bb5[_0x124477(0xf6)]||'','limit':_0x228bb5[_0x124477(0x105)],'limitStructuredFormats':_0x228bb5[_0x124477(0x113)],'color':_0x228bb5[_0x124477(0x112)],'noColor':_0x228bb5[_0x124477(0xe5)]};}function convertSDKResultToQueryResult(_0x2600ad){const _0x2e999c=a53_0xa97c,_0x948c23=[];if(_0x2600ad[_0x2e999c(0xe7)]>0x0){const _0x2fd086=_0x2600ad[0x0];for(const [_0x6d802a,_0x1de6ac]of Object['entries'](_0x2fd086)){let _0x23c5f4=_0x2e999c(0x100);if(typeof _0x1de6ac===_0x2e999c(0x118))_0x23c5f4=Number['isInteger'](_0x1de6ac)?_0x2e999c(0x11b):_0x2e999c(0xfc);else{if(typeof _0x1de6ac===_0x2e999c(0xe0))_0x23c5f4=_0x2e999c(0xe0);else _0x1de6ac===null&&(_0x23c5f4=_0x2e999c(0x100));}_0x948c23['push']({'name':_0x6d802a,'type':_0x23c5f4});}}return{'queryId':_0x2e999c(0x121),'columns':_0x948c23,'data':_0x2600ad,'stats':{'state':_0x2e999c(0x103),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x2600ad['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0xdc61c9,_0x16cacc){const _0x5126fc=convertSDKResultToQueryResult(_0xdc61c9);return formatQueryOutput(_0x5126fc,_0x16cacc);}export async function formatQueryOutput(_0x284746,_0x32cf5e){const _0x5865c0=a53_0xa97c,{format:_0x118d5c,limit:_0x4426a2,output:_0x45783c,color:_0x1b937d,noColor:_0xca9de7,limitStructuredFormats:_0x411125}=_0x32cf5e,_0x5378a9=Boolean(_0x45783c)&&!_0x1b937d,_0x39417b={'color':_0x1b937d,'noColor':_0xca9de7||_0x5378a9};if(_0x118d5c===_0x5865c0(0xdd)){const _0x62da82=shouldUseLess(_0x118d5c,_0x45783c);return formatAsTable(_0x284746,_0x4426a2,_0x62da82,_0x39417b);}const _0x1e83d7=_0x411125&&Number[_0x5865c0(0xe3)](_0x4426a2)&&_0x284746['data'][_0x5865c0(0xe7)]>_0x4426a2?{..._0x284746,'data':_0x284746[_0x5865c0(0xec)][_0x5865c0(0xf5)](0x0,_0x4426a2)}:_0x284746;if(_0x118d5c===_0x5865c0(0xff))return formatAsJSON(_0x1e83d7,_0x39417b);else return _0x118d5c===_0x5865c0(0xfa)?formatAsJSONL(_0x1e83d7,_0x39417b):formatQueryResult(_0x1e83d7,_0x118d5c);}function shouldUseLess(_0x346ff4,_0x46456f){const _0x1b73cb=a53_0xa97c;return(_0x346ff4===_0x1b73cb(0xdd)||_0x346ff4===_0x1b73cb(0x117))&&process[_0x1b73cb(0x123)][_0x1b73cb(0x107)]&&!_0x46456f;}export function resolveOutputOptions(_0x429532){const _0x2f4e06=a53_0xa97c,_0x23be91=_0x429532[_0x2f4e06(0xf6)]||'',_0x166327=resolveOutputFormat(_0x429532[_0x2f4e06(0xe6)],_0x23be91,_0x2f4e06(0xdd));let _0x557107=typeof _0x429532[_0x2f4e06(0x105)]===_0x2f4e06(0x118)?_0x429532['limit']:parseInt(_0x429532[_0x2f4e06(0x105)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x429532[_0x2f4e06(0x105)]===undefined&&shouldUseLess(_0x166327,_0x23be91)&&(_0x557107=Infinity),{'format':_0x166327,'output':_0x23be91,'limit':_0x557107,'limitStructuredFormats':_0x429532[_0x2f4e06(0x113)],'color':_0x429532[_0x2f4e06(0x112)],'noColor':_0x429532[_0x2f4e06(0xe5)]};}export function writeOutput(_0x4d1be7,_0x58ccc9,_0xc24c37){const _0x2bd318=a53_0xa97c;return _0x58ccc9?(writeFileSync(_0x58ccc9,_0x4d1be7),console[_0x2bd318(0xf1)](_0x2bd318(0x109)+_0x58ccc9),Promise[_0x2bd318(0xee)]()):shouldUseLess(_0xc24c37||'','')?new Promise(_0x46b871=>{const _0x38c5a9=_0x2bd318,_0x892729=spawn(_0x38c5a9(0x114),[_0x38c5a9(0xef)],{'stdio':[_0x38c5a9(0x10a),'inherit','inherit']});let _0x91f547=![];_0x892729['on'](_0x38c5a9(0xf1),()=>{const _0x57c8ad=_0x38c5a9;!_0x91f547&&(_0x91f547=!![],console[_0x57c8ad(0x10b)](_0x4d1be7),_0x46b871());}),_0x892729['on'](_0x38c5a9(0x11e),()=>{!_0x91f547&&(_0x91f547=!![],_0x46b871());}),_0x892729['on'](_0x38c5a9(0x11c),()=>{const _0x2dbc81=_0x38c5a9;!_0x91f547&&_0x892729[_0x2dbc81(0x10c)]&&(_0x892729[_0x2dbc81(0x10c)]['on'](_0x2dbc81(0xf1),()=>{}),_0x892729[_0x2dbc81(0x10c)]['write'](_0x4d1be7),_0x892729[_0x2dbc81(0x10c)][_0x2dbc81(0x119)]());}),!_0x892729[_0x38c5a9(0x10c)]&&(!_0x91f547&&(_0x91f547=!![],console[_0x38c5a9(0x10b)](_0x4d1be7),_0x46b871()));}):(console[_0x2bd318(0x10b)](_0x4d1be7),Promise[_0x2bd318(0xee)]());}export async function handleSDKOutput(_0x15d6f5,_0x1ba47f){const _0x2ade90=a53_0xa97c,_0xf57143=resolveOutputOptions(_0x1ba47f),_0x241028=await formatSDKOutput(_0x15d6f5,_0xf57143);await writeOutput(_0x241028,_0xf57143[_0x2ade90(0xf6)]||undefined,_0xf57143[_0x2ade90(0xe6)]);}export async function handleQueryOutput(_0x3182ff,_0x556a17){const _0x4926bd=a53_0xa97c,_0x538206=resolveOutputOptions(_0x556a17),_0x3d0c79=await formatQueryOutput(_0x3182ff,_0x538206);await writeOutput(_0x3d0c79,_0x538206[_0x4926bd(0xf6)]||undefined,_0x538206[_0x4926bd(0xe6)]);}async function formatSingleObject(_0x455cd7,_0x3b2e0c){const _0x580c04=a53_0xa97c,{format:_0x1eec20,color:_0x538626,noColor:_0x3cdfd1}=_0x3b2e0c,_0x23f04f={'color':_0x538626,'noColor':_0x3cdfd1};if(_0x1eec20===_0x580c04(0xff)){if(shouldUseColor(_0x23f04f))return colorizeJSON(_0x455cd7,_0x23f04f);return JSON[_0x580c04(0xfe)](_0x455cd7,null,0x2);}else{if(_0x1eec20===_0x580c04(0xfa)){if(shouldUseColor(_0x23f04f))return colorizeJSONCompact(_0x455cd7,_0x23f04f);return JSON[_0x580c04(0xfe)](_0x455cd7);}else{if(_0x1eec20===_0x580c04(0xf0))return Object[_0x580c04(0x120)](_0x455cd7)[_0x580c04(0xed)](([_0x28492d,_0x240142])=>_0x28492d+'\x09'+_0x240142)['join']('\x0a');else{const _0x3bb4d3=Object[_0x580c04(0x120)](_0x455cd7);if(_0x3bb4d3[_0x580c04(0xe7)]===0x0)return'No\x20data';const _0x28d596=_0x455cd7[_0x580c04(0xea)],_0x498d2d=_0x455cd7[_0x580c04(0x10f)],_0x495985=_0x455cd7[_0x580c04(0x125)],_0xfb9760=_0x455cd7[_0x580c04(0xdf)],_0x5a731d=_0x498d2d?typeof _0x498d2d===_0x580c04(0xdc)?_0x498d2d:JSON[_0x580c04(0xfe)](_0x498d2d,null,0x2):undefined,_0x312b01=_0x495985&&Object['keys'](_0x495985)[_0x580c04(0xe7)]>0x0?JSON[_0x580c04(0xfe)](_0x495985,null,0x2):undefined,_0x2743ee=_0xfb9760&&Object[_0x580c04(0xe4)](_0xfb9760)[_0x580c04(0xe7)]>0x0?JSON[_0x580c04(0xfe)](_0xfb9760,null,0x2):undefined,_0x429a24=_0x3bb4d3[_0x580c04(0xde)](([_0x567ae4])=>_0x567ae4!==_0x580c04(0xea)&&_0x567ae4!==_0x580c04(0x10f)&&_0x567ae4!==_0x580c04(0x125)&&_0x567ae4!==_0x580c04(0xdf)),_0x4bec1b=Math[_0x580c04(0xe1)](..._0x429a24[_0x580c04(0xed)](([_0x24cf04])=>_0x24cf04['length'])),_0x2028ef=Math[_0x580c04(0xe1)](..._0x429a24['map'](([,_0x495018])=>{const _0x19623a=_0x580c04;try{const _0x30e80f=_0x495018===null||_0x495018===undefined?'':typeof _0x495018===_0x19623a(0xf7)?JSON[_0x19623a(0xfe)](_0x495018):String(_0x495018),_0x2a94ad=_0x30e80f['split']('\x0a');return Math[_0x19623a(0xe1)](..._0x2a94ad[_0x19623a(0xed)](_0x34414b=>_0x34414b['length']),0x0);}catch{return 0x0;}}),0x14),_0x129f08=[];_0x129f08[_0x580c04(0xfd)](colorBorder('┌─'+'─'[_0x580c04(0x10e)](_0x4bec1b)+_0x580c04(0xe8)+'─'[_0x580c04(0x10e)](_0x2028ef)+'─┐',_0x23f04f)),_0x429a24[_0x580c04(0x11a)](([_0x481225,_0x2ede15])=>{const _0x53438c=_0x580c04;let _0x78844a;try{_0x78844a=_0x2ede15===null||_0x2ede15===undefined?'':typeof _0x2ede15==='object'?JSON[_0x53438c(0xfe)](_0x2ede15):String(_0x2ede15);}catch{_0x78844a='[Object]';}const _0x285dcb=_0x481225[_0x53438c(0x115)](_0x4bec1b),_0x92269b=_0x78844a[_0x53438c(0x122)]('\x0a');_0x92269b[_0x53438c(0x11a)]((_0x47e081,_0x57905d)=>{const _0xc8fe82=_0x53438c,_0x2711ea=colorBorder('│',_0x23f04f);_0x57905d===0x0?_0x129f08[_0xc8fe82(0xfd)](_0x2711ea+'\x20'+_0x285dcb+'\x20'+_0x2711ea+'\x20'+_0x47e081['padEnd'](_0x2028ef)+'\x20'+_0x2711ea):_0x129f08[_0xc8fe82(0xfd)](_0x2711ea+'\x20'+'\x20'[_0xc8fe82(0x10e)](_0x4bec1b)+'\x20'+_0x2711ea+'\x20'+_0x47e081[_0xc8fe82(0x115)](_0x2028ef)+'\x20'+_0x2711ea);});}),_0x129f08[_0x580c04(0xfd)](colorBorder('└─'+'─'[_0x580c04(0x10e)](_0x4bec1b)+_0x580c04(0x110)+'─'[_0x580c04(0x10e)](_0x2028ef)+'─┘',_0x23f04f));_0x5a731d&&(_0x129f08[_0x580c04(0xfd)](''),_0x129f08[_0x580c04(0xfd)](String(a53_0x204530[_0x580c04(0xe9)]['bold']('[query]'))),_0x129f08[_0x580c04(0xfd)](_0x5a731d));_0x312b01&&(_0x129f08[_0x580c04(0xfd)](''),_0x129f08['push'](String(a53_0x204530[_0x580c04(0xf4)][_0x580c04(0xeb)](_0x580c04(0x106)))),_0x129f08[_0x580c04(0xfd)](_0x312b01));_0x2743ee&&(_0x129f08[_0x580c04(0xfd)](''),_0x129f08[_0x580c04(0xfd)](String(a53_0x204530['magenta'][_0x580c04(0xeb)](_0x580c04(0x111)))),_0x129f08[_0x580c04(0xfd)](_0x2743ee));if(_0x28d596){if(_0x28d596['stderr']){_0x129f08[_0x580c04(0xfd)](''),_0x129f08[_0x580c04(0xfd)](String(a53_0x204530[_0x580c04(0x102)]['bold'](_0x580c04(0x104))));const _0x175409=_0x28d596[_0x580c04(0xf8)]['split']('\x0a');_0x175409['forEach'](_0xdf2c5d=>{const _0x4c6309=_0x580c04;_0xdf2c5d['trim']()&&_0x129f08[_0x4c6309(0xfd)](_0xdf2c5d);});}if(_0x28d596['cmdout']){_0x129f08[_0x580c04(0xfd)](''),_0x129f08[_0x580c04(0xfd)](String(a53_0x204530[_0x580c04(0x124)][_0x580c04(0xeb)]('[logs]')));const _0x596e8e=_0x28d596[_0x580c04(0xf2)]['split']('\x0a');_0x596e8e[_0x580c04(0x11a)](_0x3ad5bc=>{const _0x4f65c5=_0x580c04;_0x3ad5bc[_0x4f65c5(0x116)]()&&_0x129f08[_0x4f65c5(0xfd)](_0x3ad5bc);});}}return _0x129f08[_0x580c04(0xfb)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x37a2a5,_0x1487d0){const _0x5013b5=a53_0xa97c;if(_0x1487d0[_0x5013b5(0xe6)]===_0x5013b5(0xdd)){await handleSDKOutput([_0x37a2a5],_0x1487d0);return;}const _0x3f9cb2=resolveOutputOptions(_0x1487d0),_0x1b3f1b=await formatSingleObject(_0x37a2a5,_0x3f9cb2);await writeOutput(_0x1b3f1b,_0x3f9cb2[_0x5013b5(0xf6)]||undefined,_0x3f9cb2[_0x5013b5(0xe6)]);}
|