@treasuredata/tdx 0.25.3 → 0.25.4
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/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/describe.js +1 -1
- package/dist/commands/engage-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/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/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/api.js +1 -1
- package/dist/sdk/client/cdp-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/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/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/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.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-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-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/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.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/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/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/port.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 a42_0x5154e0=a42_0x36dc;(function(_0x224b43,_0x50cdb9){const _0x34ecb6=a42_0x36dc,_0x2fcd90=_0x224b43();while(!![]){try{const _0x5a1ba5=-parseInt(_0x34ecb6(0x1c3))/0x1*(parseInt(_0x34ecb6(0x2be))/0x2)+-parseInt(_0x34ecb6(0x162))/0x3+parseInt(_0x34ecb6(0x1c4))/0x4*(-parseInt(_0x34ecb6(0x17a))/0x5)+parseInt(_0x34ecb6(0x258))/0x6*(-parseInt(_0x34ecb6(0x190))/0x7)+-parseInt(_0x34ecb6(0x2ce))/0x8*(-parseInt(_0x34ecb6(0x1b8))/0x9)+parseInt(_0x34ecb6(0x288))/0xa+parseInt(_0x34ecb6(0x2ac))/0xb;if(_0x5a1ba5===_0x50cdb9)break;else _0x2fcd90['push'](_0x2fcd90['shift']());}catch(_0x4e59fb){_0x2fcd90['push'](_0x2fcd90['shift']());}}}(a42_0x189d,0x7556f));import a42_0x968a9d from'chalk';import{existsSync}from'fs';import a42_0xbe61c2 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 a42_0x4f473f from'prompts';function getAttemptStatusDisplay(_0x4db601){const _0x507042=a42_0x36dc;if(!_0x4db601)return{'icon':'⏳','text':''};const {done:_0xe09abe,success:_0x3707cf,cancelRequested:_0xf7bac0}=_0x4db601;if(!_0xe09abe)return _0xf7bac0?{'icon':'🛑','text':a42_0x968a9d[_0x507042(0x251)](_0x507042(0x310))}:{'icon':'🔄','text':a42_0x968a9d[_0x507042(0x1f6)](_0x507042(0x16d))};if(_0x3707cf)return{'icon':'✅','text':a42_0x968a9d[_0x507042(0x272)](_0x507042(0x183))};return{'icon':'❌','text':a42_0x968a9d['red']('error')};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x1da097,_0x3038d0,_0x1b8e5e=0x0){return _0x1da097[_0x1b8e5e]||_0x3038d0['workflowProject'];}[a42_0x5154e0(0x1de)](_0x149112,_0x5aa63b,_0x21bcde=0x0){const _0x4d854a=a42_0x5154e0,_0x4fadc1=this[_0x4d854a(0x20b)](_0x149112,_0x5aa63b,_0x21bcde);if(!_0x4fadc1)return console[_0x4d854a(0x27a)](a42_0x968a9d[_0x4d854a(0x21f)](_0x4d854a(0x1b7)),_0x4d854a(0x246)),console[_0x4d854a(0x27a)](a42_0x968a9d[_0x4d854a(0x290)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x4fadc1;}[a42_0x5154e0(0x2f9)](_0x2ca280,_0x488224){const _0x43dc9a=a42_0x5154e0;if(_0x2ca280[0x0]){const _0x5993da=_0x2ca280[0x0][_0x43dc9a(0x1b9)]('.');if(_0x5993da[_0x43dc9a(0x28d)]===0x1)return{'projectName':_0x5993da[0x0],'workflowName':undefined};else return _0x5993da[_0x43dc9a(0x28d)]===0x2?{'projectName':_0x5993da[0x0],'workflowName':_0x5993da[0x1]}:(console[_0x43dc9a(0x27a)](a42_0x968a9d[_0x43dc9a(0x21f)](_0x43dc9a(0x1b7)),_0x43dc9a(0x195)),null);}return{'projectName':_0x488224[_0x43dc9a(0x233)],'workflowName':undefined};}[a42_0x5154e0(0x2d1)](_0x4887a3,_0x29ddb2,_0x493289=0x0){const _0xc06439=a42_0x5154e0;if(_0x4887a3[_0x493289])return _0x4887a3[_0x493289];if(_0x29ddb2[_0xc06439(0x233)]){const _0x11d919=a42_0xbe61c2[_0xc06439(0x2e9)](process[_0xc06439(0x20a)](),_0xc06439(0x237),_0x29ddb2['workflowProject']);if(existsSync(a42_0xbe61c2['join'](_0x11d919,_0xc06439(0x2b7))))return _0x11d919;}return undefined;}async[a42_0x5154e0(0x211)](_0x49f3ed,_0x1095d6,_0x36d745){const _0x33b8cd=a42_0x5154e0;try{const _0x87047e=await _0x49f3ed[_0x33b8cd(0x1b6)][_0x33b8cd(0x237)](_0x1095d6,{'limit':0x1});if(_0x87047e[_0x33b8cd(0x28d)]>0x0){const _0x36cee1=_0x87047e[0x0]['id'],_0x5cf05a=getWorkflowUrl(_0x36d745,_0x36cee1);console[_0x33b8cd(0x27a)](_0x33b8cd(0x210)+a42_0x968a9d[_0x33b8cd(0x2a9)](_0x5cf05a));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a42_0x5154e0(0x30a);[a42_0x5154e0(0x1cf)]=a42_0x5154e0(0x2e0);async[a42_0x5154e0(0x1ec)](_0xe9ffe4){const _0x20f7ad=a42_0x5154e0,{options:_0x5e85f5,args:_0x9e5246,tdx:_0x4165c4}=_0xe9ffe4,_0x3d7553=_0x9e5246[0x0],_0xb79ae0=_0x5e85f5[_0x20f7ad(0x269)];if(_0xb79ae0)return saveSessionContext({'workflow_project':undefined},_0x5e85f5[_0x20f7ad(0x181)]),console[_0x20f7ad(0x263)](a42_0x968a9d[_0x20f7ad(0x272)](_0x20f7ad(0x2c9))),0x0;if(!_0x3d7553)return console['error'](a42_0x968a9d[_0x20f7ad(0x21f)]('Error:'),_0x20f7ad(0x246)),console[_0x20f7ad(0x27a)](a42_0x968a9d[_0x20f7ad(0x290)](_0x20f7ad(0x25c))),console['error'](a42_0x968a9d[_0x20f7ad(0x290)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x3ca51b=await withSpinner('Resolving\x20project\x20\x27'+_0x3d7553+_0x20f7ad(0x2c8),()=>_0x4165c4[_0x20f7ad(0x1b6)][_0x20f7ad(0x2f0)](_0x3d7553),{'verbose':_0x5e85f5[_0x20f7ad(0x300)]}),{name:_0x27ca38}=_0x3ca51b[_0x20f7ad(0x223)];return saveSessionContext({'workflow_project':_0x27ca38},_0x5e85f5[_0x20f7ad(0x181)]),console[_0x20f7ad(0x263)](a42_0x968a9d[_0x20f7ad(0x272)](_0x20f7ad(0x1bb)+a42_0x968a9d[_0x20f7ad(0x2a9)](_0x27ca38))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a42_0x5154e0(0x285)]=a42_0x5154e0(0x2df);[a42_0x5154e0(0x1cf)]=a42_0x5154e0(0x26f);async[a42_0x5154e0(0x1ec)](_0x206e9e){const _0xfad3c6=a42_0x5154e0,{options:_0x1d6dd8,args:_0x8d0629,tdx:_0x3e38d2}=_0x206e9e,_0x338129=_0x8d0629[0x0];_0x1d6dd8[_0xfad3c6(0x300)]&&_0x338129&&console[_0xfad3c6(0x27a)](_0xfad3c6(0x259)+_0x338129);const _0x405f54=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x3e38d2[_0xfad3c6(0x1b6)]['projects'](_0x338129,{'limit':_0x1d6dd8[_0xfad3c6(0x2a0)]}),{'verbose':_0x1d6dd8[_0xfad3c6(0x300)]});let _0x449bd0=_0x405f54[_0xfad3c6(0x223)];_0x449bd0[_0xfad3c6(0x239)]((_0x5cf7ad,_0x3fb5d4)=>_0x5cf7ad[_0xfad3c6(0x285)][_0xfad3c6(0x169)](_0x3fb5d4[_0xfad3c6(0x285)]));const _0x7067dc=_0x1d6dd8[_0xfad3c6(0x2a0)]||0x64,_0x1c652f=_0x449bd0[_0xfad3c6(0x28d)]>=_0x7067dc?a42_0x968a9d[_0xfad3c6(0x290)](_0xfad3c6(0x23e)):'';console[_0xfad3c6(0x27a)](_0xfad3c6(0x30b)+_0x449bd0[_0xfad3c6(0x28d)]+_0xfad3c6(0x2e2)+(_0x449bd0['length']!==0x1?'s':'')+_0x1c652f);if(_0x1d6dd8['format']===_0xfad3c6(0x1d1)||_0x1d6dd8[_0xfad3c6(0x170)]==='jsonl'||_0x1d6dd8[_0xfad3c6(0x170)]==='table')await handleSDKOutput(_0x449bd0,_0x1d6dd8);else{if(_0x449bd0[_0xfad3c6(0x28d)]===0x0)_0x338129?console[_0xfad3c6(0x263)]('No\x20projects\x20match\x20pattern:\x20'+_0x338129):console[_0xfad3c6(0x263)](_0xfad3c6(0x1e8));else{const _0x32f041=_0x449bd0[_0xfad3c6(0x204)](_0x3c6e8c=>{const _0x42e45d=_0xfad3c6,_0x1fac68=_0x3c6e8c['metadata']?.[_0x42e45d(0x2fb)](_0x2255af=>_0x2255af[_0x42e45d(0x17d)]===_0x42e45d(0x292)),_0x485b0e=_0x1fac68?a42_0x968a9d[_0x42e45d(0x290)](_0x42e45d(0x28a)):'';return _0x42e45d(0x184)+_0x3c6e8c['name']+_0x485b0e;});await writeOutput(_0x32f041[_0xfad3c6(0x2e9)]('\x0a'),_0x1d6dd8['output'],_0xfad3c6(0x218));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a42_0x5154e0(0x285)]='workflow:workflows';['description']=a42_0x5154e0(0x2fe);async[a42_0x5154e0(0x1ec)](_0x5f5da8){const _0x7e2be9=a42_0x5154e0,{options:_0x1a1ae9,args:_0x45915a,tdx:_0x1de56e}=_0x5f5da8,_0x432149=this['resolveProject'](_0x45915a,_0x1a1ae9);_0x1a1ae9[_0x7e2be9(0x300)]&&_0x432149&&console[_0x7e2be9(0x27a)](_0x7e2be9(0x2fc)+_0x432149);const _0x23dcc3=await withSpinner(_0x7e2be9(0x297),()=>_0x1de56e[_0x7e2be9(0x1b6)][_0x7e2be9(0x237)](_0x432149,{'limit':_0x1a1ae9[_0x7e2be9(0x2a0)]}),{'verbose':_0x1a1ae9[_0x7e2be9(0x300)]});let _0x1ef3d7=_0x23dcc3[_0x7e2be9(0x223)];_0x1ef3d7[_0x7e2be9(0x239)]((_0x1c37a6,_0x2df704)=>{const _0x5c3c9f=_0x7e2be9,_0x24068b=_0x1c37a6['name'][_0x5c3c9f(0x169)](_0x2df704['name']);if(_0x24068b!==0x0)return _0x24068b;return(_0x1c37a6[_0x5c3c9f(0x1d5)]?.[_0x5c3c9f(0x285)]||'')['localeCompare'](_0x2df704['project']?.['name']||'');});const _0x3b2b42=_0x1a1ae9[_0x7e2be9(0x2a0)]||0x64,_0x2ed32a=_0x1ef3d7[_0x7e2be9(0x28d)]>=_0x3b2b42?a42_0x968a9d['dim'](_0x7e2be9(0x23e)):'';console[_0x7e2be9(0x27a)]('✔\x20Found\x20'+_0x1ef3d7[_0x7e2be9(0x28d)]+'\x20workflow'+(_0x1ef3d7[_0x7e2be9(0x28d)]!==0x1?'s':'')+_0x2ed32a);if(_0x1a1ae9['format']==='json'||_0x1a1ae9['format']===_0x7e2be9(0x2ba)||_0x1a1ae9[_0x7e2be9(0x170)]==='table')await handleSDKOutput(_0x1ef3d7,_0x1a1ae9);else{if(_0x1ef3d7[_0x7e2be9(0x28d)]===0x0)_0x432149?console[_0x7e2be9(0x263)](_0x7e2be9(0x1e5)+_0x432149):console[_0x7e2be9(0x263)](_0x7e2be9(0x2c6));else{const _0x5460ea=_0x1a1ae9[_0x7e2be9(0x1c8)],_0x3a0ee0=_0x1ef3d7['map'](_0x56306d=>{const _0x5a1ac8=_0x7e2be9,_0xa29e78=a42_0x968a9d[_0x5a1ac8(0x290)]('#'+_0x56306d['id']),_0x4d6d8e=hyperlink(_0xa29e78,getWorkflowUrl(_0x5460ea,_0x56306d['id'])),_0x2bd9d1=_0x56306d[_0x5a1ac8(0x1d5)]?.[_0x5a1ac8(0x285)]?a42_0x968a9d['dim']('\x20('+_0x56306d[_0x5a1ac8(0x1d5)][_0x5a1ac8(0x285)]+')'):'';return _0x5a1ac8(0x1b5)+_0x4d6d8e+'\x20'+_0x56306d[_0x5a1ac8(0x285)]+_0x2bd9d1;});await writeOutput(_0x3a0ee0[_0x7e2be9(0x2e9)]('\x0a'),_0x1a1ae9[_0x7e2be9(0x225)],_0x7e2be9(0x218));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a42_0x5154e0(0x285)]=a42_0x5154e0(0x1d7);[a42_0x5154e0(0x1cf)]=a42_0x5154e0(0x28e);async[a42_0x5154e0(0x1ec)](_0x4df8c0){const _0x5a029f=a42_0x5154e0,{options:_0x407d82,args:_0x49b08f,tdx:_0x4c2f07}=_0x4df8c0,_0x407282=this['parseProjectWorkflowPattern'](_0x49b08f,_0x407d82);if(!_0x407282)return 0x1;const {projectName:_0x11f564,workflowName:_0x2d1b2a}=_0x407282;if(_0x407d82['verbose']){if(_0x11f564&&_0x2d1b2a)console['error'](_0x5a029f(0x29a)+_0x11f564+'.'+_0x2d1b2a);else _0x11f564&&console[_0x5a029f(0x27a)]('Filter:\x20project='+_0x11f564);const _0x519d94=_0x407d82[_0x5a029f(0x18b)];_0x519d94&&console[_0x5a029f(0x27a)](_0x5a029f(0x2a7)+_0x519d94);}let _0x47e585=0x28;if(process['stdout'][_0x5a029f(0x194)]&&!_0x407d82[_0x5a029f(0x225)]&&!_0x407d82[_0x5a029f(0x170)]){const _0xba1e88=process['stdout'][_0x5a029f(0x1a8)]||0x28;_0x47e585=Math['max'](0x14,Math['floor'](_0xba1e88*0x2/0x3));}const _0xc36430=_0x407d82[_0x5a029f(0x2a0)]||_0x47e585,_0x281ddb=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x4c2f07[_0x5a029f(0x1b6)][_0x5a029f(0x1f8)]({'projectName':_0x11f564,'workflowName':_0x2d1b2a,'status':_0x407d82[_0x5a029f(0x18b)],'fromTime':_0x407d82[_0x5a029f(0x19a)],'toTime':_0x407d82['to'],'limit':_0xc36430}),{'verbose':_0x407d82[_0x5a029f(0x300)]}),_0x3eabee=_0x281ddb['data'];_0x3eabee[_0x5a029f(0x239)]((_0x32632d,_0x2d9804)=>{const _0x212d7d=_0x5a029f,_0x547a53=_0x32632d[_0x212d7d(0x1e6)]||'',_0x3e3f6a=_0x2d9804[_0x212d7d(0x1e6)]||'';return _0x3e3f6a[_0x212d7d(0x169)](_0x547a53);});_0x3eabee[_0x5a029f(0x28d)]>=_0xc36430?console[_0x5a029f(0x27a)](_0x5a029f(0x2f4)+_0x3eabee['length']+'\x20sessions\x20'+a42_0x968a9d[_0x5a029f(0x290)]('(use\x20--limit\x20to\x20see\x20more)')):console[_0x5a029f(0x27a)]('✔\x20Found\x20'+_0x3eabee['length']+'\x20session'+(_0x3eabee['length']!==0x1?'s':''));if(_0x407d82['format']===_0x5a029f(0x1d1)||_0x407d82[_0x5a029f(0x170)]==='jsonl'||_0x407d82[_0x5a029f(0x170)]===_0x5a029f(0x2f3))await handleSDKOutput(_0x3eabee,_0x407d82);else{if(!process[_0x5a029f(0x1a5)][_0x5a029f(0x194)]||_0x407d82[_0x5a029f(0x225)]){if(_0x3eabee[_0x5a029f(0x28d)]===0x0){if(_0x11f564&&_0x2d1b2a)console[_0x5a029f(0x263)]('No\x20sessions\x20found\x20for:\x20'+_0x11f564+'.'+_0x2d1b2a);else _0x11f564?console[_0x5a029f(0x263)](_0x5a029f(0x26e)+_0x11f564):console[_0x5a029f(0x263)](_0x5a029f(0x1f1));}else{const _0x27cda1=_0x407d82[_0x5a029f(0x1c8)],_0x196e04=this[_0x5a029f(0x203)](_0x3eabee,_0x27cda1);_0x407d82[_0x5a029f(0x225)]?await writeOutput(_0x196e04,_0x407d82['output'],'list'):console[_0x5a029f(0x263)](_0x196e04);}!_0x11f564&&(console[_0x5a029f(0x27a)](''),console[_0x5a029f(0x27a)](a42_0x968a9d[_0x5a029f(0x290)](_0x5a029f(0x1fa))),console[_0x5a029f(0x27a)](a42_0x968a9d[_0x5a029f(0x290)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a42_0x968a9d[_0x5a029f(0x290)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x3eabee[_0x5a029f(0x28d)]===0x0){if(_0x11f564&&_0x2d1b2a)console[_0x5a029f(0x263)](_0x5a029f(0x275)+_0x11f564+'.'+_0x2d1b2a);else _0x11f564?console[_0x5a029f(0x263)](_0x5a029f(0x26e)+_0x11f564):console[_0x5a029f(0x263)](_0x5a029f(0x1f1));}else await this[_0x5a029f(0x21b)](_0x3eabee,_0x4df8c0,_0x11f564);}}return 0x0;}[a42_0x5154e0(0x203)](_0x41bc7f,_0x44a627){const _0x5d7df5=a42_0x5154e0,_0x165cb9=[],_0x445123=new Map();let _0x259ecf=Infinity,_0x24016d=-Infinity;for(const _0x710311 of _0x41bc7f){if(_0x710311[_0x5d7df5(0x293)]?.[_0x5d7df5(0x2ad)]){const _0x150e19=new Date(_0x710311['lastAttempt'][_0x5d7df5(0x2ad)])[_0x5d7df5(0x2d4)](),_0x1f9cfb=_0x710311[_0x5d7df5(0x293)][_0x5d7df5(0x224)]?new Date(_0x710311['lastAttempt'][_0x5d7df5(0x224)])[_0x5d7df5(0x2d4)]():Date[_0x5d7df5(0x216)](),_0x1b0829=_0x710311[_0x5d7df5(0x1d5)]?.['name']||_0x5d7df5(0x19d);!_0x445123[_0x5d7df5(0x1f4)](_0x1b0829)&&_0x445123[_0x5d7df5(0x1d3)](_0x1b0829,[]),_0x445123[_0x5d7df5(0x196)](_0x1b0829)[_0x5d7df5(0x2d5)]({'session':_0x710311,'startTime':_0x150e19,'endTime':_0x1f9cfb,'duration':_0x1f9cfb-_0x150e19}),_0x259ecf=Math[_0x5d7df5(0x2db)](_0x259ecf,_0x150e19),_0x24016d=Math[_0x5d7df5(0x2c0)](_0x24016d,_0x1f9cfb);}}if(_0x445123['size']===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x2d3797=process['stdout'][_0x5d7df5(0x27c)]||0x78,_0x52b934=0x1e,_0x4c3a97=0x32,_0x3cd2ef=0x4,_0x40c28c=Math[_0x5d7df5(0x2db)](_0x4c3a97,Math[_0x5d7df5(0x2c0)](_0x52b934,Math[_0x5d7df5(0x243)](_0x2d3797*0.3))),_0x2fe2cb=_0x2d3797-_0x40c28c-TIMELINE_CONFIG[_0x5d7df5(0x2cd)]-0x3-_0x3cd2ef,_0x1b1f81=_0x24016d-_0x259ecf,_0x2c313c=_0x1b1f81/_0x40c28c,_0xf2cf1b=renderTimeAxis({'startTime':_0x259ecf,'endTime':_0x24016d,'durationMs':_0x1b1f81,'msPerChar':_0x2c313c},_0x40c28c),_0x51d5e9=[];for(const _0x2cb9b3 of _0x445123[_0x5d7df5(0x16f)]()){_0x51d5e9[_0x5d7df5(0x2d5)](..._0x2cb9b3);}_0x51d5e9['sort']((_0x195881,_0x39651d)=>_0x39651d['startTime']-_0x195881[_0x5d7df5(0x166)]);const _0x9ce4a8=new Date(_0x259ecf),_0x34be9c=formatDate(_0x9ce4a8),_0x20be7e=_0x3cd2ef+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x5d7df5(0x2e6)]+_0x2fe2cb,_0x140b65='\x20'[_0x5d7df5(0x26a)](_0x20be7e-_0x34be9c[_0x5d7df5(0x28d)]),_0x5e23f0=_0x140b65+a42_0x968a9d[_0x5d7df5(0x290)](_0x34be9c)+'\x20'+_0xf2cf1b;_0x165cb9['push'](_0x5e23f0);const _0x165772=0x16;let _0x4e17dc=0x0;for(const _0x54c409 of _0x51d5e9){const _0x42724c=_0x54c409[_0x5d7df5(0x181)][_0x5d7df5(0x1d5)]?.[_0x5d7df5(0x285)]||'?',_0x33822e=Math['min'](stringWidth(_0x42724c),_0x165772);_0x4e17dc=Math['max'](_0x4e17dc,_0x33822e);}for(const _0x4b580c of _0x51d5e9){const {session:_0x33bd54,startTime:_0x4c86bb,endTime:_0x5789d9,duration:_0x5c587d}=_0x4b580c,_0xb838dc=_0x33bd54['project']?.['id'],_0x4501e0=_0x33bd54['id'],_0x5259c0=_0x33bd54[_0x5d7df5(0x1d5)]?.['name']||'?',_0x455d4e=_0x33bd54['workflow']?.[_0x5d7df5(0x285)]||'?';let _0x5d7e91,_0x53b0ec;if(_0x33bd54[_0x5d7df5(0x293)]){const _0x3bdff1=_0x33bd54[_0x5d7df5(0x293)];!_0x3bdff1[_0x5d7df5(0x1b3)]?(_0x5d7e91=_0x3bdff1[_0x5d7df5(0x273)]?'🛑':'🔄',_0x53b0ec=_0x3bdff1['cancelRequested']?a42_0x968a9d['yellow']:a42_0x968a9d[_0x5d7df5(0x1f6)]):(_0x5d7e91=_0x3bdff1['success']?'✅':'❌',_0x53b0ec=_0x3bdff1[_0x5d7df5(0x183)]?a42_0x968a9d[_0x5d7df5(0x272)]:a42_0x968a9d[_0x5d7df5(0x21f)]);}else _0x5d7e91='⏳',_0x53b0ec=a42_0x968a9d['dim'];const _0x713f2d='#'+_0x4501e0,_0x4ff5df=_0xb838dc?hyperlink(_0x713f2d,getWorkflowSessionUrl(_0x44a627,_0xb838dc,_0x4501e0)):_0x713f2d;let _0x5e1bd5=_0x5259c0;stringWidth(_0x5259c0)>_0x165772&&(_0x5e1bd5=_0x5259c0[_0x5d7df5(0x2b6)](0x0,_0x165772-0x1)+'…');const _0x361b69=a42_0x968a9d[_0x5d7df5(0x290)](_0x5e1bd5),_0x4397f6=stringWidth(_0x5e1bd5),_0x402aea='\x20'[_0x5d7df5(0x26a)](_0x4e17dc-stringWidth(_0x5e1bd5)+0x2),_0x1b2342='('+formatElapsed(_0x5c587d)+')',_0xaaab52=stringWidth(_0x1b2342),_0x180f22=stringWidth(_0x713f2d),_0x8c86a5=_0x180f22+0x1+_0x4397f6+_0x402aea['length'],_0x12b491=_0x2fe2cb-_0x8c86a5-_0xaaab52-0x1-0x8;let _0xd2cbc6=_0x455d4e;stringWidth(_0xd2cbc6)>_0x12b491&&(_0xd2cbc6=_0xd2cbc6[_0x5d7df5(0x2b6)](0x0,_0x12b491-0x1)+'…');const _0x32d427=_0x4ff5df+'\x20'+_0x361b69+_0x402aea+_0xd2cbc6,_0x19e7ab=stringWidth(_0x32d427),_0x598992=_0x2fe2cb-_0x19e7ab-_0xaaab52,_0x52e77c=_0x32d427+'\x20'[_0x5d7df5(0x26a)](Math[_0x5d7df5(0x2c0)](0x1,_0x598992))+a42_0x968a9d['dim'](_0x1b2342),_0x38d355=Math[_0x5d7df5(0x243)]((_0x4c86bb-_0x259ecf)/_0x2c313c),_0xa9d20e=Math['floor']((_0x5789d9-_0x259ecf)/_0x2c313c),_0x169b04=Math[_0x5d7df5(0x2c0)](_0x38d355+0x1,_0xa9d20e),_0x920677=new Array(_0x40c28c)[_0x5d7df5(0x230)]('\x20');for(let _0x5b180f=_0x38d355;_0x5b180f<Math[_0x5d7df5(0x2db)](_0x169b04,_0x40c28c);_0x5b180f++){_0x920677[_0x5b180f]='─';}const _0x3877f3=_0x920677[_0x5d7df5(0x204)](_0x49a65f=>_0x49a65f==='\x20'?'\x20':_0x53b0ec(_0x49a65f))[_0x5d7df5(0x2e9)]('');_0x165cb9[_0x5d7df5(0x2d5)](_0x5d7e91+'\x20'+_0x52e77c+'│'+_0x3877f3+'│');}return _0x165cb9[_0x5d7df5(0x2e9)]('\x0a');}async[a42_0x5154e0(0x21b)](_0x5c6782,_0x5b7ecc,_0x4d659d){const _0x174ba6=a42_0x5154e0,{options:_0x3ca363,tdx:_0x2df740}=_0x5b7ecc,_0x2c3823=_0x3ca363[_0x174ba6(0x1c8)],{timelineRows:_0x457563,timeAxisHeader:_0x5b0ad3}=this[_0x174ba6(0x1f3)](_0x5c6782,_0x2c3823),_0x465a8b=_0x457563[_0x174ba6(0x268)](_0x422755=>_0x422755[_0x174ba6(0x2af)]);if(_0x465a8b['length']===0x0){const _0x1fb1cb=this['renderSessionsTimeline'](_0x5c6782,_0x2c3823);console['log'](_0x1fb1cb);!_0x4d659d&&(console[_0x174ba6(0x27a)](''),console[_0x174ba6(0x27a)](a42_0x968a9d[_0x174ba6(0x290)](_0x174ba6(0x1fa))),console[_0x174ba6(0x27a)](a42_0x968a9d[_0x174ba6(0x290)](_0x174ba6(0x2d2))+'or'+a42_0x968a9d[_0x174ba6(0x290)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0x5b0ad3&&console[_0x174ba6(0x263)](_0x5b0ad3);const _0x415283=_0x457563[_0x174ba6(0x268)](_0x43b0b6=>_0x43b0b6[_0x174ba6(0x2af)])[_0x174ba6(0x204)](_0x2a04bf=>({'title':_0x2a04bf['displayLine'],'value':_0x2a04bf[_0x174ba6(0x2af)]})),_0x163c77=process[_0x174ba6(0x1a5)][_0x174ba6(0x1a8)]||0x3c,_0x11f7a8=Math[_0x174ba6(0x2c0)](0x28,Math[_0x174ba6(0x243)](_0x163c77*0x2/0x3)),_0xdbd2c=await a42_0x4f473f({'type':_0x174ba6(0x232),'name':_0x174ba6(0x2af),'message':_0x174ba6(0x2f1),'choices':_0x415283,'initial':-0x1,'limit':_0x11f7a8,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x12da1a,_0x5c68dc)=>{const _0x21cb2a=_0x174ba6;if(!_0x12da1a)return Promise[_0x21cb2a(0x200)](_0x5c68dc);const _0x52d364=_0x5c68dc[_0x21cb2a(0x268)](_0x2b15f6=>{const _0x567214=_0x21cb2a,_0x39cedc=_0x2b15f6;return _0x39cedc[_0x567214(0x207)][_0x567214(0x189)]()['includes'](_0x12da1a['toLowerCase']());});return Promise['resolve'](_0x52d364);}}),_0x15c177=()=>{const _0x269362=_0x174ba6;process[_0x269362(0x1a5)]['write'](_0x269362(0x2b4)),process[_0x269362(0x1a5)]['write']('\x1b[1A\x1b[2K'),process['stdout'][_0x269362(0x1ac)](_0x269362(0x2b4));},_0x15d5b7=_0xdbd2c&&_0xdbd2c[_0x174ba6(0x2af)]&&_0xdbd2c['attemptId']!==null&&_0xdbd2c[_0x174ba6(0x2af)][_0x174ba6(0x1fc)]()!=='';if(!_0x15d5b7){_0x15c177(),console[_0x174ba6(0x263)](a42_0x968a9d['dim'](_0x174ba6(0x1ba)));return;}_0x15c177();const _0x450962=_0x5c6782[_0x174ba6(0x281)](_0x37aa20=>_0x37aa20[_0x174ba6(0x293)]?.['id']===_0xdbd2c[_0x174ba6(0x2af)]);if(_0x450962){const _0x8593bc=_0x450962[_0x174ba6(0x1d5)]?.[_0x174ba6(0x285)]||'?',_0x10da7b=_0x450962[_0x174ba6(0x1b6)]?.[_0x174ba6(0x285)]||'?';console['log'](_0x174ba6(0x2ee)+a42_0x968a9d[_0x174ba6(0x290)](_0x8593bc)+_0x174ba6(0x23f)+a42_0x968a9d[_0x174ba6(0x290)](_0x10da7b));}const _0x33a593=new WorkflowTimelineCommand();await _0x33a593[_0x174ba6(0x1ec)]({'args':[],'options':{..._0x3ca363,'attemptId':_0xdbd2c[_0x174ba6(0x2af)]},'tdx':_0x2df740});}[a42_0x5154e0(0x1f3)](_0x26fb1f,_0xa7b3d8){const _0x40cfe8=a42_0x5154e0,_0x9176d5=new Map();for(const _0x1a9891 of _0x26fb1f){_0x1a9891['id']&&_0x1a9891['lastAttempt']?.['id']&&_0x9176d5[_0x40cfe8(0x1d3)](_0x1a9891['id'],_0x1a9891[_0x40cfe8(0x293)]['id']);}const _0x1c7592=[];let _0x2c5c7d='';const _0x3f0d48=this['renderSessionsTimeline'](_0x26fb1f,_0xa7b3d8),_0x2e3a83=_0x3f0d48[_0x40cfe8(0x1b9)]('\x0a');for(const _0x4cbee9 of _0x2e3a83){if(_0x4cbee9['startsWith'](_0x40cfe8(0x2fa))||_0x4cbee9[_0x40cfe8(0x193)](/^\s+\d{4}-\d{2}-\d{2}/))_0x2c5c7d=_0x4cbee9;else{if(_0x4cbee9[_0x40cfe8(0x193)](/^[✅❌🔄🛑⏳]/)){const _0x1d8454=_0x4cbee9[_0x40cfe8(0x193)](/#(\d+)/),_0x15eddc=_0x1d8454?_0x1d8454[0x1]:null,_0x26abce=_0x15eddc?_0x9176d5[_0x40cfe8(0x196)](_0x15eddc)||null:null,_0x10b57a=_0x26fb1f[_0x40cfe8(0x281)](_0x44dc9b=>_0x44dc9b['id']===_0x15eddc),_0x53ab29=_0x10b57a?.['project']?.[_0x40cfe8(0x285)]||'';_0x1c7592[_0x40cfe8(0x2d5)]({'displayLine':_0x4cbee9,'attemptId':_0x26abce,'projectName':_0x53ab29});}}}return{'timelineRows':_0x1c7592,'timeAxisHeader':_0x2c5c7d};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']=a42_0x5154e0(0x188);['description']='List\x20workflow\x20attempts';async[a42_0x5154e0(0x1ec)](_0x476be1){const _0x39305d=a42_0x5154e0,{options:_0x5c3208,args:_0x26b897,tdx:_0x5a689e}=_0x476be1,_0xc81413=this[_0x39305d(0x2f9)](_0x26b897,_0x5c3208);if(!_0xc81413)return 0x1;const {projectName:_0x1e7879,workflowName:_0x50610d}=_0xc81413,_0x562fe4=_0x5c3208[_0x39305d(0x309)];if(_0x5c3208[_0x39305d(0x300)]){if(_0x1e7879&&_0x50610d)console[_0x39305d(0x27a)](_0x39305d(0x29a)+_0x1e7879+'.'+_0x50610d);else _0x1e7879&&console[_0x39305d(0x27a)](_0x39305d(0x238)+_0x1e7879);_0x562fe4&&console[_0x39305d(0x27a)](_0x39305d(0x1be));}const _0x2d4613=await withSpinner(_0x39305d(0x260),()=>_0x5a689e['workflow']['attempts']({'projectName':_0x1e7879,'workflowName':_0x50610d,'includeRetried':_0x562fe4,'limit':_0x5c3208[_0x39305d(0x2a0)]}),{'verbose':_0x5c3208[_0x39305d(0x300)]}),_0x4cc681=_0x2d4613[_0x39305d(0x223)],_0x719504=_0x5c3208[_0x39305d(0x2a0)]||0x64,_0x56698f=_0x4cc681[_0x39305d(0x28d)]>=_0x719504?a42_0x968a9d[_0x39305d(0x290)](_0x39305d(0x23e)):'';console[_0x39305d(0x27a)](_0x39305d(0x30b)+_0x4cc681[_0x39305d(0x28d)]+_0x39305d(0x1ef)+(_0x4cc681[_0x39305d(0x28d)]!==0x1?'s':'')+_0x56698f);if(_0x5c3208['format']===_0x39305d(0x1d1)||_0x5c3208[_0x39305d(0x170)]==='jsonl'||_0x5c3208[_0x39305d(0x170)]===_0x39305d(0x2f3))await handleSDKOutput(_0x4cc681,_0x5c3208);else{if(_0x4cc681[_0x39305d(0x28d)]===0x0){if(_0x1e7879&&_0x50610d)console[_0x39305d(0x263)]('No\x20attempts\x20found\x20for:\x20'+_0x1e7879+'.'+_0x50610d);else _0x1e7879?console['log'](_0x39305d(0x2bf)+_0x1e7879):console[_0x39305d(0x263)](_0x39305d(0x30d));}else{const _0x31b3e2=_0x5c3208[_0x39305d(0x1c8)],_0x3fa1a5=_0x4cc681[_0x39305d(0x204)](_0x1ea558=>{const _0x4f52cf=_0x39305d,_0x4d6f90=a42_0x968a9d[_0x4f52cf(0x290)]('#'+_0x1ea558['id']),_0x3518ff=_0x1ea558[_0x4f52cf(0x1d5)]?.['id'],_0x1608b0=_0x1ea558[_0x4f52cf(0x262)]||_0x1ea558['sessionId'],_0x2057dc=_0x3518ff&&_0x1608b0?hyperlink(_0x4d6f90,getWorkflowAttemptUrl(_0x31b3e2,_0x3518ff,_0x1608b0,_0x1ea558['id'])):_0x4d6f90,{icon:_0x1ac3c4,text:_0x2beff9}=getAttemptStatusDisplay(_0x1ea558),_0x47240b=(_0x1ea558[_0x4f52cf(0x1d5)]?.[_0x4f52cf(0x285)]||'?')+'.'+(_0x1ea558[_0x4f52cf(0x1b6)]?.['name']||'?'),_0x373175=_0x1ea558[_0x4f52cf(0x1e6)]?a42_0x968a9d[_0x4f52cf(0x290)](_0x1ea558[_0x4f52cf(0x1e6)]):'';return(_0x2057dc+'\x20'+_0x1ac3c4+(_0x2beff9?'\x20'+_0x2beff9:'')+'\x20'+_0x47240b+'\x20'+_0x373175)[_0x4f52cf(0x1fb)]();});await writeOutput(_0x3fa1a5[_0x39305d(0x2e9)]('\x0a'),_0x5c3208['output'],_0x39305d(0x218));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a42_0x5154e0(0x285)]=a42_0x5154e0(0x1f9);[a42_0x5154e0(0x1cf)]=a42_0x5154e0(0x2ab);async[a42_0x5154e0(0x1ec)](_0x50f3cf){const _0x53c309=a42_0x5154e0,{options:_0x3e1ab5,args:_0x7356f1,tdx:_0x2e5422}=_0x50f3cf,_0xb85a83=_0x7356f1[0x0];if(!_0xb85a83)return console[_0x53c309(0x27a)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x3e1ab5[_0x53c309(0x300)]&&console['error'](_0x53c309(0x1e1)+_0xb85a83);const _0x261699=await withSpinner(_0x53c309(0x276),()=>_0x2e5422[_0x53c309(0x1b6)]['attempt'](_0xb85a83),{'verbose':_0x3e1ab5[_0x53c309(0x300)]}),_0x48315f=_0x261699['data'];let _0x30c747;!_0x48315f[_0x53c309(0x1b3)]?_0x30c747=_0x48315f[_0x53c309(0x273)]?'canceling':_0x53c309(0x16d):_0x30c747=_0x48315f[_0x53c309(0x183)]?'success':_0x53c309(0x27a);let _0x3aa0f0;if(_0x48315f[_0x53c309(0x2ad)]&&_0x48315f[_0x53c309(0x224)]){const _0x5e95c0=new Date(_0x48315f[_0x53c309(0x2ad)])[_0x53c309(0x2d4)](),_0x127b1a=new Date(_0x48315f[_0x53c309(0x224)])[_0x53c309(0x2d4)]();_0x3aa0f0=Math[_0x53c309(0x1d4)]((_0x127b1a-_0x5e95c0)/0x3e8);}const _0x3129b5={'attempt_id':_0x48315f['id'],'status':_0x30c747,..._0x48315f[_0x53c309(0x17e)]!==undefined&&{'index':_0x48315f[_0x53c309(0x17e)]},..._0x48315f[_0x53c309(0x1d5)]&&{'project':_0x48315f['project'][_0x53c309(0x285)]},..._0x48315f[_0x53c309(0x1b6)]&&{'workflow':_0x48315f[_0x53c309(0x1b6)][_0x53c309(0x285)]},..._0x48315f[_0x53c309(0x1ea)]&&{'session_id':_0x48315f[_0x53c309(0x1ea)]},..._0x48315f[_0x53c309(0x1e6)]&&{'session_time':_0x48315f['sessionTime']},..._0x48315f['retryAttemptName']&&{'retry_attempt':_0x48315f[_0x53c309(0x185)]},..._0x3aa0f0!==undefined&&{'duration_sec':_0x3aa0f0},..._0x48315f[_0x53c309(0x2ad)]&&{'created_at':_0x48315f['createdAt']},..._0x48315f[_0x53c309(0x224)]&&{'finished_at':_0x48315f[_0x53c309(0x224)]},...Object[_0x53c309(0x2dc)](_0x48315f[_0x53c309(0x167)])[_0x53c309(0x28d)]>0x0&&{'params':_0x48315f['params']}};return await handleSingleObjectOutput(_0x3129b5,_0x3e1ab5),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a42_0x5154e0(0x285)]=a42_0x5154e0(0x1e9);[a42_0x5154e0(0x1cf)]=a42_0x5154e0(0x1d6);async[a42_0x5154e0(0x1ec)](_0xd92b95){const _0x16f265=a42_0x5154e0,{options:_0x3748fe,args:_0x72f954,tdx:_0x207df7}=_0xd92b95,_0x5b025f=_0x72f954[0x0];if(!_0x5b025f)return console[_0x16f265(0x27a)](_0x16f265(0x2f5)),0x1;const _0x60969e=_0x3748fe['includeSubtasks'];_0x3748fe[_0x16f265(0x300)]&&(console[_0x16f265(0x27a)]('Attempt\x20ID:\x20'+_0x5b025f),_0x60969e&&console[_0x16f265(0x27a)](_0x16f265(0x1f7)));const _0x4b6896=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x207df7['workflow'][_0x16f265(0x25f)](_0x5b025f,_0x60969e||![]),{'verbose':_0x3748fe[_0x16f265(0x300)]}),_0x4b2fb9=_0x4b6896[_0x16f265(0x223)];return console[_0x16f265(0x27a)](_0x16f265(0x30b)+_0x4b2fb9[_0x16f265(0x28d)]+'\x20task'+(_0x4b2fb9[_0x16f265(0x28d)]!==0x1?'s':'')),await handleSDKOutput(_0x4b2fb9,_0x3748fe),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a42_0x5154e0(0x285)]=a42_0x5154e0(0x1b4);[a42_0x5154e0(0x1cf)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a42_0x5154e0(0x1ec)](_0x156be4){const _0x5690ec=a42_0x5154e0,{options:_0x5e82d0,args:_0x208cc3,tdx:_0x4540be}=_0x156be4,_0x51854c=_0x208cc3[0x0];let _0xd570c8=_0x208cc3[0x1];if(!_0x51854c)return console[_0x5690ec(0x27a)](_0x5690ec(0x2f5)),0x1;_0x5e82d0[_0x5690ec(0x300)]&&(console[_0x5690ec(0x27a)](_0x5690ec(0x1e1)+_0x51854c),_0xd570c8&&console['error'](_0x5690ec(0x165)+_0xd570c8));const _0x433c5a=await withSpinner(_0x5690ec(0x21a),()=>_0x4540be[_0x5690ec(0x1b6)][_0x5690ec(0x2fd)](_0x51854c,_0xd570c8),{'verbose':_0x5e82d0[_0x5690ec(0x300)]}),_0xef4051=_0x433c5a['data'];if(_0xef4051[_0x5690ec(0x28d)]===0x0)return console[_0x5690ec(0x27a)](_0x5690ec(0x212)),0x0;if(!_0xd570c8&&(_0x5e82d0[_0x5690ec(0x1d1)]||_0x5e82d0['format']))return await handleSDKOutput(_0xef4051,_0x5e82d0),0x0;if(!_0xd570c8){const _0x10c64e=_0xef4051['map'](_0x24e9b9=>({'title':_0x24e9b9[_0x5690ec(0x241)]+'\x20('+formatBytes(_0x24e9b9[_0x5690ec(0x2e1)])+')','value':_0x24e9b9[_0x5690ec(0x241)]})),_0x461c1e=await a42_0x4f473f({'type':'select','name':_0x5690ec(0x18e),'message':_0x5690ec(0x1d2),'choices':_0x10c64e});if(!_0x461c1e['task'])return console[_0x5690ec(0x27a)](_0x5690ec(0x1ba)),0x0;_0xd570c8=_0x461c1e['task'];}const _0x2e4d90=await withSpinner(_0x5690ec(0x2bb),()=>_0x4540be[_0x5690ec(0x1b6)][_0x5690ec(0x1e0)](_0x51854c,_0xd570c8),{'verbose':_0x5e82d0[_0x5690ec(0x300)]}),_0x3200f4=_0x2e4d90[_0x5690ec(0x223)];return _0x3200f4?console[_0x5690ec(0x263)](_0x3200f4):console[_0x5690ec(0x27a)](_0x5690ec(0x222)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a42_0x5154e0(0x285)]=a42_0x5154e0(0x2ff);['description']=a42_0x5154e0(0x20e);async[a42_0x5154e0(0x1ec)](_0x28f046){const _0x4f0def=a42_0x5154e0,{options:_0x17afe8,args:_0x17e276,tdx:_0x655520}=_0x28f046,_0x20e67b=_0x17e276[0x0];if(!_0x20e67b)return console[_0x4f0def(0x27a)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x36c5f9=_0x17afe8[_0x4f0def(0x1a2)];_0x17afe8['verbose']&&(console[_0x4f0def(0x27a)](_0x4f0def(0x1e1)+_0x20e67b),_0x36c5f9&&console[_0x4f0def(0x27a)]('Reason:\x20'+_0x36c5f9));if(!_0x17afe8[_0x4f0def(0x176)]){if(!isInteractive())return console[_0x4f0def(0x27a)](a42_0x968a9d[_0x4f0def(0x21f)]('\x0aError:'),_0x4f0def(0x2d0)),console[_0x4f0def(0x27a)](a42_0x968a9d[_0x4f0def(0x290)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5bb3cb=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x20e67b+'?');if(!_0x5bb3cb)return console[_0x4f0def(0x27a)](a42_0x968a9d[_0x4f0def(0x251)](_0x4f0def(0x1ba))),0x1;}const _0xfcca76=await withSpinner(_0x4f0def(0x179),()=>_0x655520[_0x4f0def(0x1b6)][_0x4f0def(0x2b9)](_0x20e67b,_0x36c5f9),{'verbose':_0x17afe8[_0x4f0def(0x300)]}),_0x438ef3=_0xfcca76[_0x4f0def(0x223)];return console[_0x4f0def(0x27a)]('✔\x20'+_0x438ef3),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a42_0x5154e0(0x285)]=a42_0x5154e0(0x1a7);[a42_0x5154e0(0x1cf)]=a42_0x5154e0(0x2bd);async[a42_0x5154e0(0x1ec)](_0xf6679a){const _0x3d8557=a42_0x5154e0,{options:_0x2e0fe5,args:_0x581cc8,tdx:_0xc0172e}=_0xf6679a,_0x3fd3a2=_0x581cc8[0x0];if(!_0x3fd3a2)return console[_0x3d8557(0x27a)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x3d8557(0x27a)](_0x3d8557(0x1a6)),0x1;let _0x33fcce=![],_0x292ed0=_0x3fd3a2;if(_0x3fd3a2['startsWith'](_0x3d8557(0x24a)))_0x33fcce=!![],_0x292ed0=_0x3fd3a2['substring'](0x8);else{if(_0x3fd3a2['startsWith'](_0x3d8557(0x1ed)))_0x33fcce=![],_0x292ed0=_0x3fd3a2[_0x3d8557(0x30c)](0x8);else return console[_0x3d8557(0x27a)](_0x3d8557(0x2e5)),console[_0x3d8557(0x27a)](_0x3d8557(0x1a6)),0x1;}const _0x525895=_0x2e0fe5[_0x3d8557(0x2bc)],_0x1c8138=_0x2e0fe5[_0x3d8557(0x1a0)],_0x1a8aee=_0x2e0fe5[_0x3d8557(0x167)],_0x303b22=_0x2e0fe5[_0x3d8557(0x302)];_0x2e0fe5[_0x3d8557(0x300)]&&(console[_0x3d8557(0x27a)]('Target:\x20'+(_0x33fcce?'session':_0x3d8557(0x311))+'\x20'+_0x292ed0),_0x525895&&console['error'](_0x3d8557(0x270)+_0x525895),_0x1c8138&&console[_0x3d8557(0x27a)](_0x3d8557(0x221)+_0x1c8138),_0x1a8aee&&console[_0x3d8557(0x27a)]('Params:\x20'+_0x1a8aee),_0x303b22&&console[_0x3d8557(0x27a)](_0x3d8557(0x284)));let _0x1bd7c0;if(_0x1a8aee)try{if(_0x1a8aee[_0x3d8557(0x171)]('@')){const _0x22eafa=await import('fs/promises'),_0x14583e=_0x1a8aee[_0x3d8557(0x30c)](0x1),_0x58e332=await _0x22eafa['readFile'](_0x14583e,'utf-8');_0x1bd7c0=JSON[_0x3d8557(0x279)](_0x58e332);}else _0x1bd7c0=JSON['parse'](_0x1a8aee);}catch{return console[_0x3d8557(0x27a)](_0x3d8557(0x1c0)),0x1;}if(!_0x2e0fe5[_0x3d8557(0x176)]){if(!isInteractive())return console['error'](a42_0x968a9d['red'](_0x3d8557(0x2f8)),_0x3d8557(0x2d0)),console['error'](a42_0x968a9d['dim'](_0x3d8557(0x16a))),0x1;const _0x2247fb=await confirmKey(_0x3d8557(0x25a)+(_0x33fcce?'session':'attempt')+'\x20'+_0x292ed0+'?');if(!_0x2247fb)return console['error'](a42_0x968a9d['yellow'](_0x3d8557(0x1ba))),0x1;}let _0x6c9dd0;_0x33fcce?_0x6c9dd0=await withSpinner(_0x3d8557(0x2eb),()=>_0xc0172e[_0x3d8557(0x1b6)][_0x3d8557(0x298)](_0x292ed0,{'fromTask':_0x525895,'retryParams':_0x1bd7c0}),{'verbose':_0x2e0fe5[_0x3d8557(0x300)]}):_0x6c9dd0=await withSpinner(_0x3d8557(0x249),()=>_0xc0172e[_0x3d8557(0x1b6)]['retryAttempt'](_0x292ed0,{'resumeFrom':_0x1c8138,'retryParams':_0x1bd7c0,'force':_0x303b22}),{'verbose':_0x2e0fe5['verbose']});const _0x3f99e8=_0x6c9dd0[_0x3d8557(0x223)];return console[_0x3d8557(0x27a)]('✔\x20Retry\x20started'),console['error'](_0x3d8557(0x1a3)+_0x3f99e8[_0x3d8557(0x2af)]),console['error'](_0x3d8557(0x1ab)+_0x3f99e8['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a42_0x5154e0(0x1e4);[a42_0x5154e0(0x1cf)]='Start\x20a\x20workflow\x20run';async[a42_0x5154e0(0x1ec)](_0x57a7d8){const _0x187a1c=a42_0x5154e0,{options:_0x116f16,args:_0x3111bf,tdx:_0x2f836e}=_0x57a7d8;let _0x393785=_0x3111bf[0x0];if(!_0x393785){const _0x39681e=this[_0x187a1c(0x20b)]([],_0x116f16),_0x2dd7d9=await withSpinner('Loading\x20workflows...',()=>_0x2f836e[_0x187a1c(0x1b6)]['workflows'](_0x39681e,{'limit':_0x116f16['limit']}),{'verbose':_0x116f16[_0x187a1c(0x300)]}),_0x1600e0=_0x2dd7d9['data'];if(_0x1600e0[_0x187a1c(0x28d)]===0x0)return console['error'](_0x187a1c(0x2c6)),!_0x39681e&&console[_0x187a1c(0x27a)](a42_0x968a9d[_0x187a1c(0x290)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x58c609=_0x1600e0['map'](_0x189da8=>({'title':_0x189da8[_0x187a1c(0x1d5)]?.[_0x187a1c(0x285)]+'.'+_0x189da8[_0x187a1c(0x285)],'value':_0x189da8['project']?.['name']+'.'+_0x189da8[_0x187a1c(0x285)],'description':_0x189da8[_0x187a1c(0x1ad)]?_0x187a1c(0x1dd)+_0x189da8['revision']:undefined})),_0x2d325b=await a42_0x4f473f({'type':_0x187a1c(0x29d),'name':_0x187a1c(0x1b6),'message':_0x187a1c(0x24b),'choices':_0x58c609});if(!_0x2d325b[_0x187a1c(0x1b6)])return 0x1;_0x393785=_0x2d325b[_0x187a1c(0x1b6)];}if(!_0x393785[_0x187a1c(0x24d)]('.')){const _0x90baab=this['resolveProject']([],_0x116f16);if(_0x90baab)_0x393785=_0x90baab+'.'+_0x393785;else return console[_0x187a1c(0x27a)](a42_0x968a9d[_0x187a1c(0x21f)](_0x187a1c(0x1b7)),_0x187a1c(0x252)),console['error'](a42_0x968a9d[_0x187a1c(0x290)](_0x187a1c(0x26c))),0x1;}const _0x1a4ce9=_0x116f16[_0x187a1c(0x26b)],_0x3b8f10=_0x116f16[_0x187a1c(0x1e6)],_0x3e59cf={};if(_0x1a4ce9&&Array[_0x187a1c(0x1b1)](_0x1a4ce9))for(const _0x5655c0 of _0x1a4ce9){const _0x22dac3=_0x5655c0[_0x187a1c(0x2cc)]('=');if(_0x22dac3===-0x1)return console[_0x187a1c(0x27a)](_0x187a1c(0x283)+_0x5655c0),console['error'](_0x187a1c(0x29e)),0x1;const _0x3044ae=_0x5655c0[_0x187a1c(0x30c)](0x0,_0x22dac3),_0x194d57=_0x5655c0['substring'](_0x22dac3+0x1);try{_0x3e59cf[_0x3044ae]=JSON[_0x187a1c(0x279)](_0x194d57);}catch{_0x3e59cf[_0x3044ae]=_0x194d57;}}_0x116f16[_0x187a1c(0x300)]&&(console[_0x187a1c(0x27a)](_0x187a1c(0x214)+_0x393785),Object['keys'](_0x3e59cf)[_0x187a1c(0x28d)]>0x0&&console[_0x187a1c(0x27a)]('Parameters:\x20'+JSON['stringify'](_0x3e59cf)),_0x3b8f10&&console[_0x187a1c(0x27a)](_0x187a1c(0x23d)+_0x3b8f10));const _0x558048=await withSpinner(_0x187a1c(0x236),()=>_0x2f836e['workflow'][_0x187a1c(0x1cd)](_0x393785,_0x3e59cf,{'sessionTime':_0x3b8f10}),{'verbose':_0x116f16[_0x187a1c(0x300)]}),_0x3fab63=_0x558048['data'];console[_0x187a1c(0x27a)](_0x187a1c(0x280)),console[_0x187a1c(0x27a)](_0x187a1c(0x278)+_0x3fab63['id']),console[_0x187a1c(0x27a)](_0x187a1c(0x1ab)+_0x3fab63['sessionId']),console[_0x187a1c(0x27a)](_0x187a1c(0x27e)+_0x3fab63[_0x187a1c(0x1d5)]?.[_0x187a1c(0x285)]),console[_0x187a1c(0x27a)](_0x187a1c(0x244)+_0x3fab63['workflow']?.[_0x187a1c(0x285)]);if(_0x3fab63[_0x187a1c(0x1d5)]?.['id']&&_0x3fab63['sessionId']&&_0x3fab63['id']){const _0xfb3b22=_0x116f16[_0x187a1c(0x1c8)],_0x18a49c=getConsoleUrl(_0xfb3b22,_0x187a1c(0x1af)+_0x3fab63[_0x187a1c(0x1d5)]['id']+_0x187a1c(0x242)+_0x3fab63[_0x187a1c(0x1ea)]+_0x187a1c(0x19b)+_0x3fab63['id']);console[_0x187a1c(0x27a)](_0x187a1c(0x210)+a42_0x968a9d['cyan'](_0x18a49c));}return 0x0;}}function a42_0x189d(){const _0x437c86=['filesExtracted','text','session','Error:\x20KEY=VALUE\x20is\x20required','success','📁\x20','retryAttemptName','Failed\x20to\x20fetch\x20attempt\x20data','✔\x20Pushed\x20','workflow:attempts','toLowerCase','durationMs','status','Deleting\x20secret...','---\x20','task','Using\x20attempt\x20','77014ljvdOV','sourceDir','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','match','isTTY','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','get','download','\x0aDry\x20run\x20-\x20nothing\x20pushed','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','from','/attempt/','Dry\x20run:\x20yes','(unknown)','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','✔\x20Downloaded\x20','resumeFrom','modified','reason','\x20\x20New\x20attempt\x20ID:\x20','🔄\x20','stdout','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','workflow:retry','rows','getMonth','getMinutes','\x20\x20Session\x20ID:\x20','write','revision','existingProjectId','/app/workflows/','Loading\x20sessions...','isArray','workflow:secrets:delete','done','workflow:logs','📋\x20','workflow','Error:','9eLsxzb','split','Cancelled','✔\x20Workflow\x20project\x20set\x20to:\x20','\x20has\x20no\x20attempts','Updating\x20','Include\x20retried:\x20yes','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','Error:\x20Invalid\x20JSON\x20in\x20--params','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','MIN_TIMELINE_WIDTH','436171KSQbmh','4eAUTYP','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','Error:\x20','✔\x20Project:\x20','site','\x0aApply\x20these\x20changes?','\x20new','\x20\x20Location:\x20','unknown','run','padStart','description','\x20to\x20see\x20detailed\x20logs','json','Select\x20a\x20task\x20to\x20view\x20logs:','set','round','project','Show\x20tasks\x20for\x20an\x20attempt','workflow:sessions','toISOString','✔\x20Push\x20complete','total','workflow:download','LABEL_MIN_SPACING','revision:\x20','requireProject','renderTimeline','logs','Attempt\x20ID:\x20','TASK_NAME_WIDTH','unchanged','workflow:run','No\x20workflows\x20found\x20in\x20project:\x20','sessionTime','Listing\x20secrets...','No\x20workflow\x20projects\x20found','workflow:tasks','sessionId','\x22\x20with\x20new\x20revision?','execute','attempt:','Tip:\x20cd\x20to\x20workflows/','\x20attempt','renderSingleTimeline','No\x20sessions\x20found','✔\x20Secret\x20\x27','generateSessionTimelineRows','has','isDirectory','blue','Including\x20subtasks:\x20yes','sessions','workflow:attempt','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','trimEnd','trim','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','hasChanges','value','resolve','workflow:pull','getHours','renderSessionsTimeline','map','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Downloading\x20project\x20','title','workflow:timeline','Source:\x20','cwd','resolveProject','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Session\x20not\x20found:\x20','Kill\x20a\x20running\x20attempt','\x20modified','\x20\x20Console:\x20','showWorkflowConsoleUrl','No\x20log\x20files\x20found\x20for\x20this\x20attempt','projectId','Workflow:\x20','path','now','every','list','workflowName','Fetching\x20log\x20files...','navigateSessionsInteractive','Source\x20directory\x20is\x20required','\x20\x20Source:\x20','MAX_TASKS_DISPLAY','red','Error:\x20Secret\x20key\x20is\x20required','Resume\x20from:\x20','No\x20log\x20content\x20found','data','finishedAt','output','\x22\x20to\x20new\x20project\x20\x22','start','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','msPerChar','\x0a✔\x20Already\x20up\x20to\x20date','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','dryRun','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','Key:\x20','listSecrets','fill','\x0a⚠\x20Project\x20\x22','autocomplete','workflowProject','sourceProjectName','\x0aUpdate\x20existing\x20project\x20\x22','Starting\x20workflow\x20run...','workflows','Filter:\x20project=','sort','Validation:\x20skipped','No\x20workflow\x20sessions\x20found','prepareCloneProject','Session\x20time:\x20','\x20(use\x20--limit\x20to\x20show\x20more)',',\x20Workflow:\x20','summary','taskName','/sessions/','floor','\x20\x20Workflow:\x20','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Project\x20name\x20is\x20required','follow','No\x20workflow\x20tdx.json\x20found','Retrying\x20attempt...','session:','Select\x20a\x20workflow\x20to\x20run','Attempt:\x20','includes','-\x20nothing\x20pushed','context','workflow:delete','yellow','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','\x20\x20Changes:\x20','\x0aDry\x20run\x20-\x20no\x20files\x20written','type','isNewProject','78sYtgly','Pattern:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','fullName','Usage:\x20tdx\x20wf\x20use\x20<project>','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','workflow:clone','tasks','Listing\x20workflow\x20attempts...','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','session_id','log','updatedAt','→\x20New\x20project:\x20','✔\x20Pull\x20complete','tdx\x20wf\x20attempt\x20','filter','clear','repeat','param','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','setSecret','No\x20sessions\x20found\x20in\x20project:\x20','List\x20all\x20workflow\x20projects','From\x20task:\x20','MIN_LABEL_COUNT','green','cancelRequested','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','No\x20sessions\x20found\x20for:\x20','Getting\x20attempt\x20details...','\x20is\x20not\x20a\x20directory','\x20\x20Attempt\x20ID:\x20','parse','error','targetDir','columns','skipValidation','\x20\x20Project:\x20','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','✔\x20Workflow\x20run\x20started','find','buildTimelineData','Error:\x20Invalid\x20parameter\x20format:\x20','Force:\x20yes','name','-\x20no\x20files\x20written','.\x20Expected\x20format:\x20KEY=VALUE','7207280AzSpjJ','Loading\x20session...','\x20(system)','splice','\x20\x20Revision:\x20','length','List\x20workflow\x20execution\x20sessions','pollTimeline','dim','delete','sys','lastAttempt','MAX_POLL_ITERATIONS','Revision:\x20','\x20secret','Listing\x20workflows...','retrySession','Cloning\x20to\x20','Filter:\x20','executePushProject','workflow:push','select','Expected\x20format:\x20--param\x20key=value','white','limit','→\x20Project:\x20','\x20\x20Project\x20ID:\x20','\x20\x20Session\x20context\x20set\x20to:\x20','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Invalid\x20format:\x20','workflow:upload','Status:\x20','\x20unchanged','cyan','Writing\x20files...','Show\x20specific\x20attempt\x20details','6732627HiTAAd','createdAt','\x27\x20from\x20project\x20\x27','attemptId','New\x20project\x20name:\x20','all','\x20tasks','startedAt','\x1b[1A\x1b[2K','getDate','slice','tdx.json','\x20deleted','kill','jsonl','Downloading\x20logs...','fromTask','Retry\x20a\x20session\x20or\x20attempt','2sukvnM','No\x20attempts\x20found\x20in\x20project:\x20','max','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','\x20\x20Files\x20extracted:\x20','Pulling\x20project\x20','Key\x20cannot\x20be\x20empty','window','No\x20workflows\x20found','Output\x20directory:\x20','\x27...','✔\x20Workflow\x20project\x20context\x20cleared.','Warning:','Error:\x20Project\x20name\x20is\x20required','indexOf','GUTTER','1263664IaqmoD','Deleting\x20project\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','resolveProjectDir','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','getTime','push','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','Pull\x20workflow\x20project\x20to\x20local\x20folder','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','basename','...','min','keys','planned','message','workflow:projects','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','fileSize','\x20project','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','ICON_SPACING','group_error','pullProject','join','\x0a✔\x20Attempt\x20complete','Retrying\x20session...','workflow:secrets:set','diff','Project:\x20','projectName','resolveProjectId','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','Session\x20','table','✔\x20Showing\x20','Error:\x20Attempt\x20ID\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','deleted','\x0aError:','parseProjectWorkflowPattern','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','some','Project\x20filter:\x20','logFiles','List\x20workflows','workflow:kill','verbose','MAX_LABEL_COUNT','force','Files\x20to\x20upload:\x20','relative','\x0aDry\x20run\x20-\x20no\x20project\x20created','workflow:secrets:list','getFullYear','targetExists','includeRetried','workflow:use','✔\x20Found\x20','substring','No\x20attempts\x20found','pending','Target\x20directory:\x20','canceling','attempt','LABEL_WIDTH_DIVISOR','duration','377826JOyIGi','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','changes','Task\x20name:\x20','startTime','params','\x20-\x20','localeCompare','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','✔\x20Project\x20updated','running','newProjectName','values','format','startsWith','MAX_TIMELINE_WIDTH','icon','⚠\x20Showing\x20first\x20','Analyzing\x20changes...','yes','\x22?\x20This\x20cannot\x20be\x20undone.','end','Killing\x20attempt...','1524905aUVnJW','state','✔\x20Deleted\x20project\x20','key','index'];a42_0x189d=function(){return _0x437c86;};return a42_0x189d();}export class WorkflowDownloadCommand extends BaseCommand{['name']=a42_0x5154e0(0x1db);[a42_0x5154e0(0x1cf)]=a42_0x5154e0(0x19e);async[a42_0x5154e0(0x1ec)](_0x362e18){const _0x2f5a52=a42_0x5154e0,{options:_0x57ad2e,args:_0x3fe344,tdx:_0x4cadc7}=_0x362e18,_0x2815e3=_0x3fe344[0x0],_0x2c782c=_0x3fe344[0x1]||'.';if(!_0x2815e3)return console['error'](_0x2f5a52(0x2cb)),console['error']('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x29d5b4=_0x57ad2e[_0x2f5a52(0x1ad)];_0x57ad2e[_0x2f5a52(0x300)]&&(console[_0x2f5a52(0x27a)](_0x2f5a52(0x2ee)+_0x2815e3),console[_0x2f5a52(0x27a)](_0x2f5a52(0x2c7)+_0x2c782c),_0x29d5b4&&console['error'](_0x2f5a52(0x295)+_0x29d5b4));const _0x483218=await withSpinner(_0x2f5a52(0x206)+_0x2815e3+'...',()=>_0x4cadc7[_0x2f5a52(0x1b6)][_0x2f5a52(0x197)](_0x2815e3,_0x2c782c,{'revision':_0x29d5b4}),{'verbose':_0x57ad2e[_0x2f5a52(0x300)]}),_0x57fa71=_0x483218['data'];return console[_0x2f5a52(0x27a)](_0x2f5a52(0x19f)+_0x57fa71[_0x2f5a52(0x2ef)]),console[_0x2f5a52(0x27a)]('\x20\x20Revision:\x20'+_0x57fa71[_0x2f5a52(0x1ad)]),console[_0x2f5a52(0x27a)](_0x2f5a52(0x2c2)+_0x57fa71[_0x2f5a52(0x17f)]),console[_0x2f5a52(0x27a)]('\x20\x20Location:\x20'+_0x2c782c+'/'+_0x57fa71[_0x2f5a52(0x2ef)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a42_0x5154e0(0x2a6);[a42_0x5154e0(0x1cf)]=a42_0x5154e0(0x25d);async[a42_0x5154e0(0x1ec)](_0x1548bf){const _0x2e390a=a42_0x5154e0,{options:_0x889d03,args:_0x51274b,tdx:_0x326fc2}=_0x1548bf;let _0x37dff8='.',_0x2cfa01=_0x889d03['name'];if(_0x51274b[0x0]){const {promises:_0x2f90aa}=await import('fs');try{const _0x15a031=await _0x2f90aa['stat'](_0x51274b[0x0]);if(_0x15a031[_0x2e390a(0x1f5)]())_0x37dff8=_0x51274b[0x0];else return console[_0x2e390a(0x27a)](_0x2e390a(0x1c6)+_0x51274b[0x0]+_0x2e390a(0x277)),0x1;}catch{_0x2cfa01=_0x51274b[0x0],_0x37dff8='.';}}const _0x263d6e=_0x889d03[_0x2e390a(0x1ad)],_0x10a769=_0x889d03[_0x2e390a(0x27d)];_0x889d03['verbose']&&(console['error']('Project\x20directory:\x20'+_0x37dff8),_0x2cfa01&&console[_0x2e390a(0x27a)]('Project\x20name:\x20'+_0x2cfa01),_0x263d6e&&console[_0x2e390a(0x27a)]('Revision:\x20'+_0x263d6e),_0x10a769&&console[_0x2e390a(0x27a)]('Validation:\x20skipped'));const _0x3a09d5=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x326fc2[_0x2e390a(0x1b6)][_0x2e390a(0x2d5)](_0x37dff8,{'projectName':_0x2cfa01,'revision':_0x263d6e,'skipValidation':_0x10a769}),{'verbose':_0x889d03[_0x2e390a(0x300)]}),_0x4bd468=_0x3a09d5[_0x2e390a(0x223)];return console[_0x2e390a(0x27a)](_0x2e390a(0x187)+_0x4bd468['projectName']),console[_0x2e390a(0x27a)](_0x2e390a(0x2a2)+_0x4bd468[_0x2e390a(0x213)]),console[_0x2e390a(0x27a)](_0x2e390a(0x28c)+_0x4bd468[_0x2e390a(0x1ad)]),await this[_0x2e390a(0x211)](_0x326fc2,_0x4bd468[_0x2e390a(0x2ef)],_0x889d03['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a42_0x5154e0(0x285)]=a42_0x5154e0(0x201);['description']=a42_0x5154e0(0x2d7);async[a42_0x5154e0(0x1ec)](_0x5cee8f){const _0x342abc=a42_0x5154e0,{options:_0x50a4c6,args:_0x206319,tdx:_0x21d877}=_0x5cee8f,_0x11b751=_0x206319[0x0],_0x5bd2f8=_0x206319[0x1];if(!_0x11b751)return console[_0x342abc(0x27a)](a42_0x968a9d['red'](_0x342abc(0x1b7)),_0x342abc(0x246)),console[_0x342abc(0x27a)](a42_0x968a9d['dim'](_0x342abc(0x1bf))),0x1;const _0x3390df=_0x50a4c6[_0x342abc(0x1ad)];_0x50a4c6[_0x342abc(0x300)]&&(console[_0x342abc(0x27a)](_0x342abc(0x2ee)+_0x11b751),_0x5bd2f8&&console['error'](_0x342abc(0x30f)+_0x5bd2f8),_0x3390df&&console[_0x342abc(0x27a)](_0x342abc(0x295)+_0x3390df),_0x50a4c6[_0x342abc(0x22c)]&&console['error'](_0x342abc(0x19c)));const _0x3c725d=await withSpinner(_0x342abc(0x2c3)+_0x11b751+_0x342abc(0x2da),()=>_0x21d877['workflow'][_0x342abc(0x2e8)](_0x11b751,{'targetDir':_0x5bd2f8,'revision':_0x3390df}),{'verbose':_0x50a4c6[_0x342abc(0x300)]}),_0x1bc953=_0x3c725d[_0x342abc(0x223)];_0x1bc953[_0x342abc(0x257)]?console['error'](_0x342abc(0x265)+_0x1bc953[_0x342abc(0x2ef)]):console['error'](_0x342abc(0x2a1)+_0x1bc953['projectName']);console[_0x342abc(0x27a)](_0x342abc(0x28c)+_0x1bc953['revision']),console[_0x342abc(0x27a)]('\x20\x20Target:\x20'+(a42_0xbe61c2[_0x342abc(0x304)](process[_0x342abc(0x20a)](),_0x1bc953[_0x342abc(0x27b)])||'.')),console[_0x342abc(0x27a)](_0x342abc(0x254)+a42_0x968a9d[_0x342abc(0x272)]('+'+_0x1bc953[_0x342abc(0x240)]['new']+'\x20new')+',\x20'+(a42_0x968a9d[_0x342abc(0x251)]('~'+_0x1bc953['summary'][_0x342abc(0x1a1)]+'\x20modified')+',\x20')+(a42_0x968a9d[_0x342abc(0x21f)]('-'+_0x1bc953[_0x342abc(0x240)][_0x342abc(0x2f7)]+_0x342abc(0x2b8))+',\x20')+(''+a42_0x968a9d[_0x342abc(0x290)](_0x1bc953[_0x342abc(0x240)][_0x342abc(0x1e3)]+_0x342abc(0x2a8))));for(const _0x336caa of _0x1bc953['changes']){_0x336caa[_0x342abc(0x256)]==='modified'&&_0x336caa[_0x342abc(0x2ed)]&&(console[_0x342abc(0x27a)]('\x0a'+a42_0x968a9d[_0x342abc(0x2a9)](_0x342abc(0x18d)+_0x336caa[_0x342abc(0x215)])),console['error'](_0x336caa['diff']));}if(!_0x1bc953['hasChanges'])return saveSessionContext({'workflow_project':_0x1bc953[_0x342abc(0x2ef)]},_0x50a4c6[_0x342abc(0x181)]),console[_0x342abc(0x27a)](a42_0x968a9d[_0x342abc(0x272)](_0x342abc(0x22a))),console[_0x342abc(0x27a)](a42_0x968a9d[_0x342abc(0x290)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x1bc953['projectName'])),0x0;if(_0x50a4c6[_0x342abc(0x22c)])return console['error'](a42_0x968a9d[_0x342abc(0x251)](_0x342abc(0x255))),0x0;if(!_0x50a4c6[_0x342abc(0x176)]){if(!isInteractive())return console[_0x342abc(0x27a)](a42_0x968a9d['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x342abc(0x27a)](a42_0x968a9d[_0x342abc(0x290)](_0x342abc(0x16a))),0x1;const _0x2e0bf2=await confirmKey(_0x342abc(0x1c9));if(!_0x2e0bf2)return console[_0x342abc(0x27a)](a42_0x968a9d[_0x342abc(0x251)](_0x342abc(0x1ba)),_0x342abc(0x286)),0x1;}await withSpinner(_0x342abc(0x2aa),()=>_0x21d877[_0x342abc(0x1b6)]['applyPullProject'](_0x1bc953,{'revision':_0x3390df}),{'verbose':_0x50a4c6[_0x342abc(0x300)]}),saveSessionContext({'workflow_project':_0x1bc953[_0x342abc(0x2ef)]},_0x50a4c6['session']),console['error'](a42_0x968a9d[_0x342abc(0x272)](_0x342abc(0x266)));const _0x1bc749=a42_0xbe61c2['relative'](process[_0x342abc(0x20a)](),_0x1bc953[_0x342abc(0x27b)])||'.';return console[_0x342abc(0x27a)](a42_0x968a9d[_0x342abc(0x290)](_0x342abc(0x1cb)+_0x1bc749)),console[_0x342abc(0x27a)](a42_0x968a9d['dim'](_0x342abc(0x2a3)+_0x1bc953[_0x342abc(0x2ef)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a42_0x5154e0(0x285)]=a42_0x5154e0(0x29c);['description']=a42_0x5154e0(0x1fd);async[a42_0x5154e0(0x1ec)](_0x3fa48d){const _0x5945be=a42_0x5154e0,{options:_0x5f3862,args:_0x31760a,tdx:_0x2fc8e7}=_0x3fa48d,_0xfeda2d=this[_0x5945be(0x2d1)](_0x31760a,_0x5f3862),_0x284558=_0x5f3862['revision'],_0x7fa67a=_0x5f3862['skipValidation'];_0x5f3862[_0x5945be(0x300)]&&(_0xfeda2d&&console[_0x5945be(0x27a)]('Source\x20directory:\x20'+_0xfeda2d),_0x284558&&console['error'](_0x5945be(0x295)+_0x284558),_0x5f3862[_0x5945be(0x22c)]&&console[_0x5945be(0x27a)](_0x5945be(0x19c)),_0x7fa67a&&console[_0x5945be(0x27a)](_0x5945be(0x23a)));let _0x2ff149;try{_0x2ff149=await withSpinner(_0x5945be(0x175),()=>_0x2fc8e7[_0x5945be(0x1b6)]['preparePushProject']({'sourceDir':_0xfeda2d,'revision':_0x284558,'skipValidation':_0x7fa67a}),{'verbose':_0x5f3862['verbose']});}catch(_0x5b4b1a){if(_0x5b4b1a instanceof Error&&_0x5b4b1a[_0x5945be(0x2de)]['includes'](_0x5945be(0x248)))return console[_0x5945be(0x27a)](a42_0x968a9d[_0x5945be(0x21f)](_0x5945be(0x1b7)),_0x5945be(0x228)),_0x5f3862[_0x5945be(0x233)]?console[_0x5945be(0x27a)](a42_0x968a9d[_0x5945be(0x290)](_0x5945be(0x1ee)+_0x5f3862[_0x5945be(0x233)]+_0x5945be(0x2d3)+_0x5f3862['workflowProject']+'\x27')):console[_0x5945be(0x27a)](a42_0x968a9d[_0x5945be(0x290)](_0x5945be(0x253))),0x1;throw _0x5b4b1a;}const _0x2a042d=_0x2ff149[_0x5945be(0x223)];console[_0x5945be(0x27a)](_0x5945be(0x1c7)+_0x2a042d['projectName']),console[_0x5945be(0x27a)](_0x5945be(0x21d)+_0x2a042d[_0x5945be(0x191)]),console[_0x5945be(0x27a)](_0x5945be(0x28c)+_0x2a042d['revision']),console[_0x5945be(0x27a)](_0x5945be(0x254)+a42_0x968a9d['green']('+'+_0x2a042d[_0x5945be(0x240)]['new']+_0x5945be(0x1ca))+',\x20'+(a42_0x968a9d[_0x5945be(0x251)]('~'+_0x2a042d[_0x5945be(0x240)][_0x5945be(0x1a1)]+_0x5945be(0x20f))+',\x20')+(a42_0x968a9d[_0x5945be(0x21f)]('-'+_0x2a042d[_0x5945be(0x240)][_0x5945be(0x2f7)]+_0x5945be(0x2b8))+',\x20')+(''+a42_0x968a9d[_0x5945be(0x290)](_0x2a042d['summary']['unchanged']+'\x20unchanged')));for(const _0x53d2f1 of _0x2a042d[_0x5945be(0x164)]){_0x53d2f1['type']===_0x5945be(0x1a1)&&_0x53d2f1[_0x5945be(0x2ed)]&&(console[_0x5945be(0x27a)]('\x0a'+a42_0x968a9d[_0x5945be(0x2a9)](_0x5945be(0x18d)+_0x53d2f1[_0x5945be(0x215)])),console[_0x5945be(0x27a)](_0x53d2f1[_0x5945be(0x2ed)]));}if(!_0x2a042d[_0x5945be(0x1fe)])return console[_0x5945be(0x27a)](a42_0x968a9d[_0x5945be(0x272)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x5945be(0x211)](_0x2fc8e7,_0x2a042d['projectName'],_0x5f3862[_0x5945be(0x1c8)]),0x0;if(_0x5f3862['dryRun'])return console[_0x5945be(0x27a)](a42_0x968a9d['yellow'](_0x5945be(0x198))),0x0;if(!_0x5f3862[_0x5945be(0x176)]){if(!isInteractive())return console[_0x5945be(0x27a)](a42_0x968a9d['red'](_0x5945be(0x2f8)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5945be(0x27a)](a42_0x968a9d['dim'](_0x5945be(0x16a))),0x1;const _0x16edcf=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x16edcf)return console[_0x5945be(0x27a)](a42_0x968a9d[_0x5945be(0x251)](_0x5945be(0x1ba)),_0x5945be(0x24e)),0x1;}const _0x4608a9=await withSpinner('Pushing\x20project...',()=>_0x2fc8e7['workflow'][_0x5945be(0x29b)](_0x2a042d),{'verbose':_0x5f3862['verbose']}),_0x5f3253=_0x4608a9['data'];return console['error'](a42_0x968a9d[_0x5945be(0x272)](_0x5945be(0x1d9))),console[_0x5945be(0x27a)](_0x5945be(0x2a2)+_0x5f3253['projectId']),console[_0x5945be(0x27a)]('\x20\x20Revision:\x20'+_0x5f3253[_0x5945be(0x1ad)]),await this['showWorkflowConsoleUrl'](_0x2fc8e7,_0x5f3253[_0x5945be(0x2ef)],_0x5f3862[_0x5945be(0x1c8)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a42_0x5154e0(0x25e);[a42_0x5154e0(0x1cf)]=a42_0x5154e0(0x2d6);async[a42_0x5154e0(0x1ec)](_0x21efb8){const _0x3a32e6=a42_0x5154e0,{options:_0x5bd6e0,args:_0x5b2e14,tdx:_0x530fc7}=_0x21efb8,_0x4825bb=this[_0x3a32e6(0x2d1)](_0x5b2e14,_0x5bd6e0),_0x3fd875=_0x5bd6e0['name'],_0x12164f=_0x5bd6e0[_0x3a32e6(0x1ad)],_0x4783f5=_0x5bd6e0[_0x3a32e6(0x27d)];if(!_0x4825bb)return console['error'](a42_0x968a9d[_0x3a32e6(0x21f)]('Error:'),_0x3a32e6(0x21c)),console[_0x3a32e6(0x27a)](a42_0x968a9d[_0x3a32e6(0x290)](_0x3a32e6(0x1c1))),console['error'](a42_0x968a9d[_0x3a32e6(0x290)](_0x3a32e6(0x2f6))),0x1;if(!_0x3fd875)return console['error'](a42_0x968a9d[_0x3a32e6(0x21f)](_0x3a32e6(0x1b7)),_0x3a32e6(0x199)),console[_0x3a32e6(0x27a)](a42_0x968a9d[_0x3a32e6(0x290)](_0x3a32e6(0x1c1))),0x1;_0x5bd6e0[_0x3a32e6(0x300)]&&(console[_0x3a32e6(0x27a)]('Source\x20directory:\x20'+_0x4825bb),console['error'](_0x3a32e6(0x2b0)+_0x3fd875),_0x12164f&&console[_0x3a32e6(0x27a)](_0x3a32e6(0x295)+_0x12164f),_0x5bd6e0[_0x3a32e6(0x22c)]&&console[_0x3a32e6(0x27a)](_0x3a32e6(0x19c)),_0x4783f5&&console[_0x3a32e6(0x27a)](_0x3a32e6(0x23a)));const _0x42a5ee=await withSpinner('Analyzing\x20project...',()=>_0x530fc7['workflow'][_0x3a32e6(0x23c)](_0x4825bb,_0x3fd875,{'revision':_0x12164f,'skipValidation':_0x4783f5}),{'verbose':_0x5bd6e0[_0x3a32e6(0x300)]}),_0x12c7f8=_0x42a5ee[_0x3a32e6(0x223)];console[_0x3a32e6(0x27a)](_0x3a32e6(0x209)+_0x12c7f8['sourceDir']);_0x12c7f8[_0x3a32e6(0x234)]&&console[_0x3a32e6(0x27a)]('Source\x20project:\x20'+_0x12c7f8['sourceProjectName']);console[_0x3a32e6(0x27a)](_0x3a32e6(0x2b0)+_0x12c7f8[_0x3a32e6(0x16e)]),console[_0x3a32e6(0x27a)](_0x3a32e6(0x295)+_0x12c7f8[_0x3a32e6(0x1ad)]),console[_0x3a32e6(0x27a)](_0x3a32e6(0x303)+_0x12c7f8['fileCount']);_0x12c7f8[_0x3a32e6(0x308)]&&(console[_0x3a32e6(0x27a)](a42_0x968a9d[_0x3a32e6(0x251)](_0x3a32e6(0x231)+_0x12c7f8['newProjectName']+'\x22\x20already\x20exists\x20(ID:\x20'+_0x12c7f8[_0x3a32e6(0x1ae)]+')')),console[_0x3a32e6(0x27a)](a42_0x968a9d[_0x3a32e6(0x251)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x5bd6e0[_0x3a32e6(0x22c)])return console[_0x3a32e6(0x27a)](a42_0x968a9d['yellow'](_0x3a32e6(0x305))),0x0;if(!_0x5bd6e0[_0x3a32e6(0x176)]){if(!isInteractive())return console['error'](a42_0x968a9d['red'](_0x3a32e6(0x2f8)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3a32e6(0x27a)](a42_0x968a9d[_0x3a32e6(0x290)](_0x3a32e6(0x16a))),0x1;const _0x2ba66f=_0x12c7f8[_0x3a32e6(0x234)]||a42_0xbe61c2[_0x3a32e6(0x2d9)](_0x4825bb),_0x25772f=_0x12c7f8['targetExists']?_0x3a32e6(0x235)+_0x3fd875+_0x3a32e6(0x1eb):'\x0aClone\x20\x22'+_0x2ba66f+_0x3a32e6(0x226)+_0x3fd875+'\x22?',_0x40d242=await confirmKey(_0x25772f);if(!_0x40d242)return console[_0x3a32e6(0x27a)](a42_0x968a9d[_0x3a32e6(0x251)](_0x3a32e6(0x1ba))),0x1;}const _0x5c7952=await withSpinner(_0x12c7f8[_0x3a32e6(0x308)]?_0x3a32e6(0x1bd)+_0x3fd875+_0x3a32e6(0x2da):_0x3a32e6(0x299)+_0x3fd875+_0x3a32e6(0x2da),()=>_0x530fc7[_0x3a32e6(0x1b6)]['executeCloneProject'](_0x12c7f8),{'verbose':_0x5bd6e0[_0x3a32e6(0x300)]}),_0x5c54f2=_0x5c7952[_0x3a32e6(0x223)];return console[_0x3a32e6(0x27a)](a42_0x968a9d[_0x3a32e6(0x272)](_0x12c7f8['targetExists']?_0x3a32e6(0x16c):'✔\x20Clone\x20complete')),console[_0x3a32e6(0x27a)](_0x3a32e6(0x27e)+_0x5c54f2[_0x3a32e6(0x16e)]),console[_0x3a32e6(0x27a)](_0x3a32e6(0x2a2)+_0x5c54f2['newProjectId']),console[_0x3a32e6(0x27a)]('\x20\x20Revision:\x20'+_0x5c54f2['revision']),await this[_0x3a32e6(0x211)](_0x530fc7,_0x5c54f2[_0x3a32e6(0x16e)],_0x5bd6e0[_0x3a32e6(0x1c8)]),0x0;}}function a42_0x36dc(_0x5e2c04,_0xa4d5cb){_0x5e2c04=_0x5e2c04-0x161;const _0x189dfe=a42_0x189d();let _0x36dcb9=_0x189dfe[_0x5e2c04];return _0x36dcb9;}export class WorkflowDeleteCommand extends BaseCommand{[a42_0x5154e0(0x285)]=a42_0x5154e0(0x250);[a42_0x5154e0(0x1cf)]=a42_0x5154e0(0x22b);async[a42_0x5154e0(0x1ec)](_0x2267e7){const _0xf96281=a42_0x5154e0,{options:_0x1c67ee,args:_0xd7769d,tdx:_0x5335cd}=_0x2267e7,_0x26683b=_0xd7769d[0x0];if(!_0x26683b)return console[_0xf96281(0x27a)](_0xf96281(0x2e4)),console[_0xf96281(0x27a)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x1c67ee[_0xf96281(0x300)]&&console[_0xf96281(0x27a)](_0xf96281(0x2ee)+_0x26683b);if(!_0x1c67ee['yes']){if(!isInteractive())return console[_0xf96281(0x27a)](a42_0x968a9d['red'](_0xf96281(0x2f8)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xf96281(0x27a)](a42_0x968a9d[_0xf96281(0x290)](_0xf96281(0x16a))),0x1;const _0x39ce72=await confirmKey(_0xf96281(0x163)+_0x26683b+_0xf96281(0x177));if(!_0x39ce72)return console[_0xf96281(0x27a)](a42_0x968a9d[_0xf96281(0x251)](_0xf96281(0x1ba))),0x1;}const _0x1f8eac=await withSpinner(_0xf96281(0x2cf)+_0x26683b+_0xf96281(0x2da),()=>_0x5335cd[_0xf96281(0x1b6)][_0xf96281(0x291)](_0x26683b),{'verbose':_0x1c67ee[_0xf96281(0x300)]}),_0x779461=_0x1f8eac[_0xf96281(0x223)];return console[_0xf96281(0x27a)](_0xf96281(0x17c)+_0x779461[_0xf96281(0x2ef)]),console['error'](_0xf96281(0x2a2)+_0x779461[_0xf96281(0x213)]),0x0;}}export function parseKeyValue(_0x3262da){const _0x2d36a8=a42_0x5154e0,_0x256b03=_0x3262da[_0x2d36a8(0x2cc)]('=');if(_0x256b03===-0x1)throw new Error(_0x2d36a8(0x2a5)+_0x3262da+_0x2d36a8(0x287));const _0x344d8f=_0x3262da['substring'](0x0,_0x256b03),_0x54c92f=_0x3262da[_0x2d36a8(0x30c)](_0x256b03+0x1);if(!_0x344d8f)throw new Error(_0x2d36a8(0x2c4));return{'key':_0x344d8f,'value':_0x54c92f};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a42_0x5154e0(0x285)]=a42_0x5154e0(0x306);['description']=a42_0x5154e0(0x192);async[a42_0x5154e0(0x1ec)](_0x34457c){const _0x4f3dde=a42_0x5154e0,{options:_0x4ee998,args:_0x68a43a,tdx:_0x3091b4}=_0x34457c,_0x2588df=this[_0x4f3dde(0x1de)](_0x68a43a,_0x4ee998);if(!_0x2588df)return 0x1;_0x4ee998['verbose']&&console[_0x4f3dde(0x27a)](_0x4f3dde(0x2ee)+_0x2588df);const _0x5bac2a=await withSpinner(_0x4f3dde(0x1e7),()=>_0x3091b4['workflow'][_0x4f3dde(0x22f)](_0x2588df),{'verbose':_0x4ee998['verbose']}),{secrets:_0x2f35f9}=_0x5bac2a[_0x4f3dde(0x223)];return console[_0x4f3dde(0x27a)](_0x4f3dde(0x30b)+_0x2f35f9[_0x4f3dde(0x28d)]+_0x4f3dde(0x296)+(_0x2f35f9[_0x4f3dde(0x28d)]!==0x1?'s':'')),await handleSDKOutput(_0x2f35f9,_0x4ee998),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a42_0x5154e0(0x285)]=a42_0x5154e0(0x2ec);[a42_0x5154e0(0x1cf)]=a42_0x5154e0(0x245);async[a42_0x5154e0(0x1ec)](_0x5aa9df){const _0x440ecb=a42_0x5154e0,{options:_0x140f2a,args:_0x2adba5,tdx:_0x3e7a63}=_0x5aa9df;let _0x28104b,_0x5cd88d;if(_0x2adba5['length']>=0x2)_0x28104b=_0x2adba5[0x0],_0x5cd88d=_0x2adba5[0x1];else{if(_0x2adba5[_0x440ecb(0x28d)]===0x1&&_0x140f2a[_0x440ecb(0x233)])_0x28104b=_0x140f2a['workflowProject'],_0x5cd88d=_0x2adba5[0x0];else return _0x2adba5[_0x440ecb(0x28d)]===0x1?(console[_0x440ecb(0x27a)](_0x440ecb(0x2cb)),console[_0x440ecb(0x27a)](_0x440ecb(0x26c)),0x1):(console[_0x440ecb(0x27a)](_0x440ecb(0x182)),console[_0x440ecb(0x27a)](_0x440ecb(0x2d8)),0x1);}let _0x275525,_0x13935a;try{({key:_0x275525,value:_0x13935a}=parseKeyValue(_0x5cd88d));}catch(_0x32c51a){return _0x32c51a instanceof Error&&console[_0x440ecb(0x27a)](a42_0x968a9d[_0x440ecb(0x21f)](_0x440ecb(0x1b7)),_0x32c51a['message']),0x1;}_0x140f2a[_0x440ecb(0x300)]&&(console['error'](_0x440ecb(0x2ee)+_0x28104b),console[_0x440ecb(0x27a)]('Key:\x20'+_0x275525));const _0x162daf=await withSpinner('Setting\x20secret...',()=>_0x3e7a63['workflow'][_0x440ecb(0x26d)](_0x28104b,_0x275525,_0x13935a),{'verbose':_0x140f2a['verbose']}),_0x42a964=_0x162daf[_0x440ecb(0x223)];return console[_0x440ecb(0x27a)](_0x440ecb(0x1f2)+_0x42a964['key']+_0x440ecb(0x2c1)+_0x42a964[_0x440ecb(0x2ef)]+'\x27'),(_0x140f2a[_0x440ecb(0x1d1)]||_0x140f2a[_0x440ecb(0x2ba)])&&await handleSingleObjectOutput(_0x42a964,_0x140f2a),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a42_0x5154e0(0x285)]=a42_0x5154e0(0x1b2);[a42_0x5154e0(0x1cf)]=a42_0x5154e0(0x2a4);async[a42_0x5154e0(0x1ec)](_0x3b4bd6){const _0x11125e=a42_0x5154e0,{options:_0x5d6fb3,args:_0x44b234,tdx:_0x27d30a}=_0x3b4bd6;let _0x551a01,_0x33ccf2;if(_0x44b234[_0x11125e(0x28d)]>=0x2)_0x551a01=_0x44b234[0x0],_0x33ccf2=_0x44b234[0x1];else{if(_0x44b234[_0x11125e(0x28d)]===0x1&&_0x5d6fb3['workflowProject'])_0x551a01=_0x5d6fb3['workflowProject'],_0x33ccf2=_0x44b234[0x0];else return _0x44b234[_0x11125e(0x28d)]===0x1?(console[_0x11125e(0x27a)](_0x11125e(0x2cb)),console['error'](_0x11125e(0x26c)),0x1):(console['error'](_0x11125e(0x220)),console[_0x11125e(0x27a)](_0x11125e(0x27f)),0x1);}_0x5d6fb3[_0x11125e(0x300)]&&(console['error'](_0x11125e(0x2ee)+_0x551a01),console['error'](_0x11125e(0x22e)+_0x33ccf2));if(!_0x5d6fb3['yes']){if(!isInteractive())return console[_0x11125e(0x27a)](a42_0x968a9d[_0x11125e(0x21f)](_0x11125e(0x2f8)),_0x11125e(0x2d0)),console[_0x11125e(0x27a)](a42_0x968a9d[_0x11125e(0x290)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5e90b1=await confirmKey(_0x11125e(0x261)+_0x33ccf2+_0x11125e(0x2ae)+_0x551a01+'\x27?');if(!_0x5e90b1)return console[_0x11125e(0x27a)](a42_0x968a9d['yellow'](_0x11125e(0x1ba))),0x1;}const _0x5c37ef=await withSpinner(_0x11125e(0x18c),()=>_0x27d30a[_0x11125e(0x1b6)]['deleteSecret'](_0x551a01,_0x33ccf2),{'verbose':_0x5d6fb3[_0x11125e(0x300)]}),_0x83968e=_0x5c37ef['data'];return console['error']('✔\x20Secret\x20\x27'+_0x83968e[_0x11125e(0x17d)]+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x83968e[_0x11125e(0x2ef)]+'\x27'),(_0x5d6fb3[_0x11125e(0x1d1)]||_0x5d6fb3[_0x11125e(0x2ba)])&&await handleSingleObjectOutput(_0x83968e,_0x5d6fb3),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(_0xd8887c){const _0x359083=a42_0x5154e0,_0x54d577=Math[_0x359083(0x243)](_0xd8887c/0x3e8),_0x5bbd12=Math['floor'](_0x54d577/0x3c),_0x389cc4=Math['floor'](_0x5bbd12/0x3c),_0x36eb4e=Math[_0x359083(0x243)](_0x389cc4/0x18);if(_0x36eb4e>0x0){const _0x4dafbd=_0x389cc4%0x18;return _0x4dafbd>0x0?_0x36eb4e+'d\x20'+_0x4dafbd+'h':_0x36eb4e+'d';}else{if(_0x389cc4>0x0){const _0x4f7ee5=_0x5bbd12%0x3c;return _0x4f7ee5>0x0?_0x389cc4+'h\x20'+_0x4f7ee5+'m':_0x389cc4+'h';}else{if(_0x5bbd12>0x0){const _0xb1af3c=_0x54d577%0x3c;return _0xb1af3c>0x0?_0x5bbd12+'m\x20'+_0xb1af3c+'s':_0x5bbd12+'m';}else return _0x54d577+'s';}}}function formatTimestamp(_0x5e3fc5,_0x3ef3b2){const _0xd32ae9=a42_0x5154e0,_0x81b74=new Date(_0x5e3fc5),_0x13cefa=String(_0x81b74[_0xd32ae9(0x202)]())[_0xd32ae9(0x1ce)](0x2,'0'),_0x10b0d1=String(_0x81b74[_0xd32ae9(0x1aa)]())[_0xd32ae9(0x1ce)](0x2,'0'),_0x43e059=_0x13cefa+':'+_0x10b0d1,_0x38f4bb=_0x81b74[_0xd32ae9(0x307)]()===_0x3ef3b2['getFullYear']()&&_0x81b74['getMonth']()===_0x3ef3b2[_0xd32ae9(0x1a9)]()&&_0x81b74[_0xd32ae9(0x2b5)]()===_0x3ef3b2[_0xd32ae9(0x2b5)]();if(_0x38f4bb)return _0x43e059;else{const _0xc33b94=String(_0x81b74['getMonth']()+0x1)[_0xd32ae9(0x1ce)](0x2,'0'),_0x525fc0=String(_0x81b74[_0xd32ae9(0x2b5)]())[_0xd32ae9(0x1ce)](0x2,'0');return _0xc33b94+'-'+_0x525fc0+'\x20'+_0x43e059;}}function formatDate(_0x5035b6){const _0x253fde=a42_0x5154e0,_0x24b783=_0x5035b6[_0x253fde(0x307)](),_0x14ef0d=String(_0x5035b6['getMonth']()+0x1)[_0x253fde(0x1ce)](0x2,'0'),_0x4ab51f=String(_0x5035b6['getDate']())[_0x253fde(0x1ce)](0x2,'0');return _0x24b783+'-'+_0x14ef0d+'-'+_0x4ab51f;}function getTaskStateIcon(_0x500ede){const _0x412585={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x412585[_0x500ede]||'⚪';}function getBarChar(_0x3a86de){const _0x59e241=a42_0x5154e0;return _0x3a86de==='error'||_0x3a86de===_0x59e241(0x2e7)?'×':'─';}function getBarColor(_0x498219){const _0x1a6348=a42_0x5154e0,_0x2ecbb5={'success':a42_0x968a9d['green'],'error':a42_0x968a9d[_0x1a6348(0x21f)],'group_error':a42_0x968a9d[_0x1a6348(0x21f)],'running':a42_0x968a9d[_0x1a6348(0x1f6)],'blocked':a42_0x968a9d['yellow'],'planned':a42_0x968a9d[_0x1a6348(0x290)],'canceling':a42_0x968a9d['yellow']};return _0x2ecbb5[_0x498219]||a42_0x968a9d[_0x1a6348(0x29f)];}function parseTaskName(_0x2a4a2d){const _0xf83212=a42_0x5154e0;let _0x208e93=_0x2a4a2d['replace'](/^\++/,'');const _0xcfb660=_0x208e93[_0xf83212(0x1b9)]('+'),_0x261fd5=_0xcfb660['length']>0x1?_0xcfb660[_0xf83212(0x28d)]-0x2:0x0,_0xbc9152=_0xcfb660[_0xcfb660[_0xf83212(0x28d)]-0x1]||_0x208e93;return{'level':_0x261fd5,'name':'+'+_0xbc9152};}function truncateTaskName(_0x56a1e2,_0x4a15e8){const _0x24e86d=a42_0x5154e0,_0x20d24e=stringWidth(_0x56a1e2);if(_0x20d24e<=_0x4a15e8)return _0x56a1e2;let _0x16ea82=_0x56a1e2;while(stringWidth(_0x16ea82+'…')>_0x4a15e8&&_0x16ea82[_0x24e86d(0x28d)]>0x0){_0x16ea82=_0x16ea82[_0x24e86d(0x2b6)](0x0,-0x1);}return _0x16ea82+'…';}function calculateTimeScale(_0x4379c9,_0x2fec89){const _0x205399=a42_0x5154e0;return{'startTime':_0x4379c9[_0x205399(0x227)],'endTime':_0x4379c9[_0x205399(0x178)],'durationMs':_0x4379c9[_0x205399(0x161)],'msPerChar':_0x4379c9['duration']/_0x2fec89};}function timeToPosition(_0x44ef7d,_0x56463f,_0x33bb51){const _0x5cd222=a42_0x5154e0,_0x193271=_0x44ef7d-_0x56463f[_0x5cd222(0x166)],_0x2e78e1=Math[_0x5cd222(0x243)](_0x193271/_0x56463f[_0x5cd222(0x229)]);return Math[_0x5cd222(0x2c0)](0x0,Math[_0x5cd222(0x2db)](_0x2e78e1,_0x33bb51));}function renderTimeAxis(_0x2d95d7,_0x2755df){const _0x1b0a70=a42_0x5154e0,_0x2d9455=Math[_0x1b0a70(0x2db)](TIMELINE_CONFIG[_0x1b0a70(0x301)],Math[_0x1b0a70(0x2c0)](TIMELINE_CONFIG[_0x1b0a70(0x271)],Math[_0x1b0a70(0x243)](_0x2755df/TIMELINE_CONFIG[_0x1b0a70(0x312)]))),_0x210d6b=_0x2d95d7[_0x1b0a70(0x18a)]/(_0x2d9455-0x1),_0x286acd=new Date(_0x2d95d7[_0x1b0a70(0x166)]),_0x17f782=[];for(let _0x432f56=0x0;_0x432f56<_0x2d9455;_0x432f56++){const _0x5251f3=_0x2d95d7[_0x1b0a70(0x166)]+_0x432f56*_0x210d6b,_0xb696aa=timeToPosition(_0x5251f3,_0x2d95d7,_0x2755df),_0x341047=formatTimestamp(_0x5251f3,_0x286acd);_0x17f782[_0x1b0a70(0x2d5)]({'pos':_0xb696aa,'text':_0x341047});}const _0x4d30f2=new Array(_0x2755df)[_0x1b0a70(0x230)]('\x20');let _0x2c9e4e=-0x1;for(const {pos:_0x3c0a23,text:_0x37debd}of _0x17f782){let _0xfca86b=Math['max'](0x0,_0x3c0a23-Math[_0x1b0a70(0x243)](_0x37debd[_0x1b0a70(0x28d)]/0x2));_0xfca86b<=_0x2c9e4e+TIMELINE_CONFIG[_0x1b0a70(0x1dc)]&&(_0xfca86b=_0x2c9e4e+TIMELINE_CONFIG[_0x1b0a70(0x1dc)]+0x1);_0xfca86b+_0x37debd[_0x1b0a70(0x28d)]>_0x2755df&&(_0xfca86b=_0x2755df-_0x37debd[_0x1b0a70(0x28d)]);if(_0xfca86b>=0x0&&_0xfca86b+_0x37debd[_0x1b0a70(0x28d)]<=_0x2755df&&_0xfca86b>_0x2c9e4e){for(let _0x3a6d39=0x0;_0x3a6d39<_0x37debd[_0x1b0a70(0x28d)];_0x3a6d39++){_0x4d30f2[_0xfca86b+_0x3a6d39]=_0x37debd[_0x3a6d39];}_0x2c9e4e=_0xfca86b+_0x37debd[_0x1b0a70(0x28d)]-0x1;}}return _0x4d30f2[_0x1b0a70(0x2e9)]('');}function renderTaskRow(_0x157dad,_0x5ddaad,_0x46da28,_0x3865c4){const _0x29bc2c=a42_0x5154e0,{level:_0x204fbb,name:_0x3a17e4}=parseTaskName(_0x157dad[_0x29bc2c(0x285)]),_0xfd458e='\x20'['repeat'](_0x204fbb),_0x1facf8=_0x157dad[_0x29bc2c(0x2c5)]?'('+formatElapsed(_0x157dad[_0x29bc2c(0x2c5)][_0x29bc2c(0x161)])+')':'',_0x1a09fb=stringWidth(_0x1facf8),_0x431962=_0x204fbb*0x1,_0x155657=_0x3865c4-_0x431962-_0x1a09fb-0x1,_0x613ddc=truncateTaskName(_0x3a17e4,_0x155657),_0x1d512d=_0xfd458e+_0x613ddc,_0x47077c=stringWidth(_0x1d512d),_0x223624=_0x3865c4-_0x47077c-_0x1a09fb,_0x4ce045=_0x1d512d+'\x20'[_0x29bc2c(0x26a)](Math[_0x29bc2c(0x2c0)](0x1,_0x223624))+a42_0x968a9d['dim'](_0x1facf8),_0x4b9828=getTaskStateIcon(_0x157dad['state']),_0x29a465=new Array(_0x46da28)[_0x29bc2c(0x230)]('\x20');if(_0x157dad['window']){const _0x4695b1=timeToPosition(_0x157dad['window'][_0x29bc2c(0x227)],_0x5ddaad,_0x46da28),_0xd5b8f6=timeToPosition(_0x157dad[_0x29bc2c(0x2c5)]['end'],_0x5ddaad,_0x46da28),_0x13c1c4=getBarChar(_0x157dad['state']),_0xd5ee64=Math[_0x29bc2c(0x2c0)](_0x4695b1+0x1,_0xd5b8f6);for(let _0x50e3fe=_0x4695b1;_0x50e3fe<Math[_0x29bc2c(0x2db)](_0xd5ee64,_0x46da28);_0x50e3fe++){_0x29a465[_0x50e3fe]=_0x13c1c4;}}const _0x23070e=getBarColor(_0x157dad[_0x29bc2c(0x17b)]),_0x367e98=_0x29a465[_0x29bc2c(0x204)](_0x2dab1d=>_0x2dab1d==='\x20'?'\x20':_0x23070e(_0x2dab1d))[_0x29bc2c(0x2e9)]('');return _0x4b9828+'\x20'+_0x4ce045+'│'+_0x367e98+'│';}function calculateStats(_0x17b2a0){const _0x1e19c0=a42_0x5154e0,_0x1ad785={'total':_0x17b2a0[_0x1e19c0(0x28d)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x25c7e8 of _0x17b2a0){if(_0x25c7e8[_0x1e19c0(0x17b)]===_0x1e19c0(0x183))_0x1ad785['success']++;else{if(_0x25c7e8[_0x1e19c0(0x17b)]===_0x1e19c0(0x27a)||_0x25c7e8['state']===_0x1e19c0(0x2e7))_0x1ad785[_0x1e19c0(0x27a)]++;else _0x25c7e8[_0x1e19c0(0x17b)]===_0x1e19c0(0x16d)?_0x1ad785[_0x1e19c0(0x16d)]++:_0x1ad785[_0x1e19c0(0x30e)]++;}}return _0x1ad785;}function formatStats(_0x4ed26c){const _0x17f931=a42_0x5154e0;return['Total:\x20'+_0x4ed26c[_0x17f931(0x1da)],'✅\x20'+_0x4ed26c[_0x17f931(0x183)],'❌\x20'+_0x4ed26c[_0x17f931(0x27a)],_0x17f931(0x1a4)+_0x4ed26c[_0x17f931(0x16d)],'⏳\x20'+_0x4ed26c[_0x17f931(0x30e)]][_0x17f931(0x2e9)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a42_0x5154e0(0x208);[a42_0x5154e0(0x1cf)]=a42_0x5154e0(0x16b);async['execute'](_0x25367d){const _0xfa3690=a42_0x5154e0,{options:_0x2bed49,args:_0x55ecc9,tdx:_0x5028f6}=_0x25367d;let _0x1a8c4b,_0x1b510c,_0x2e2ed3=![];if(_0x55ecc9[0x0]){if(_0x55ecc9[0x0][_0xfa3690(0x24d)]('.')){const _0x2170b9=this[_0xfa3690(0x2f9)](_0x55ecc9,_0x2bed49);if(!_0x2170b9)return 0x1;_0x1a8c4b=_0x2170b9[_0xfa3690(0x2ef)],_0x1b510c=_0x2170b9[_0xfa3690(0x219)];}else{_0x1b510c=_0x55ecc9[0x0],_0x1a8c4b=_0x2bed49['workflowProject'];if(!_0x1a8c4b)return console['error'](a42_0x968a9d[_0xfa3690(0x21f)](_0xfa3690(0x1b7)),_0xfa3690(0x274)),0x1;_0x2e2ed3=!![];}}else{const _0x398e0a=this[_0xfa3690(0x2f9)](_0x55ecc9,_0x2bed49);if(!_0x398e0a)return 0x1;_0x1a8c4b=_0x398e0a[_0xfa3690(0x2ef)],_0x1b510c=_0x398e0a['workflowName'];}if(_0x2bed49[_0xfa3690(0x300)]){if(_0x1a8c4b&&_0x1b510c)console[_0xfa3690(0x27a)](_0xfa3690(0x29a)+_0x1a8c4b+'.'+_0x1b510c);else _0x1a8c4b&&console[_0xfa3690(0x27a)]('Filter:\x20project='+_0x1a8c4b);}const _0x54c039=_0x2bed49[_0xfa3690(0x2af)],_0x4cbc2c=_0x2bed49[_0xfa3690(0x1ea)];if(_0x54c039){_0x4cbc2c&&console['error'](a42_0x968a9d['yellow'](_0xfa3690(0x2ca)),_0xfa3690(0x22d));const _0x404257=_0x2bed49['follow'];return _0x404257?await this[_0xfa3690(0x28f)](_0x25367d,_0x54c039):await this[_0xfa3690(0x1f0)](_0x25367d,_0x54c039,_0x2bed49),0x0;}if(_0x4cbc2c){const _0x2ab657=await withSpinner(_0xfa3690(0x289),()=>_0x5028f6[_0xfa3690(0x1b6)][_0xfa3690(0x1f8)]({'projectName':_0x1a8c4b,'workflowName':_0x1b510c,'limit':0x64}),{'verbose':_0x2bed49['verbose']}),_0xfa75b1=_0x2ab657[_0xfa3690(0x223)]['find'](_0x47e287=>_0x47e287['id']===_0x4cbc2c);if(!_0xfa75b1)return console[_0xfa3690(0x27a)](a42_0x968a9d[_0xfa3690(0x21f)]('Error:'),_0xfa3690(0x20d)+_0x4cbc2c),0x1;if(!_0xfa75b1[_0xfa3690(0x293)]?.['id'])return console[_0xfa3690(0x27a)](a42_0x968a9d[_0xfa3690(0x21f)](_0xfa3690(0x1b7)),_0xfa3690(0x2f2)+_0x4cbc2c+_0xfa3690(0x1bc)),0x1;const _0x2ca722=_0xfa75b1[_0xfa3690(0x293)]['id'];_0x2bed49[_0xfa3690(0x300)]&&console[_0xfa3690(0x27a)](_0xfa3690(0x18f)+_0x2ca722+'\x20from\x20session\x20'+_0x4cbc2c);const _0x5159b1=_0x2bed49['follow'];return _0x5159b1?await this[_0xfa3690(0x28f)](_0x25367d,_0x2ca722):await this[_0xfa3690(0x1f0)](_0x25367d,_0x2ca722,_0x2bed49),0x0;}const _0x47ef47=await withSpinner(_0xfa3690(0x1b0),()=>_0x5028f6[_0xfa3690(0x1b6)][_0xfa3690(0x1f8)]({'projectName':_0x1a8c4b,'workflowName':_0x1b510c,'limit':_0x2bed49[_0xfa3690(0x2a0)]||0x32}),{'verbose':_0x2bed49['verbose']}),_0x338ef0=_0x47ef47['data'];if(_0x338ef0['length']===0x0){if(_0x1a8c4b&&_0x1b510c)console[_0xfa3690(0x27a)](_0xfa3690(0x275)+_0x1a8c4b+'.'+_0x1b510c);else _0x1a8c4b?console['error'](_0xfa3690(0x26e)+_0x1a8c4b):(console['error'](_0xfa3690(0x23b)),console[_0xfa3690(0x27a)](a42_0x968a9d[_0xfa3690(0x290)](_0xfa3690(0x205))));return 0x0;}_0x338ef0['sort']((_0x3f31c2,_0x5e97dc)=>{const _0x293178=_0xfa3690,_0x2a65a3=_0x3f31c2['sessionTime']||'',_0x36aa9a=_0x5e97dc[_0x293178(0x1e6)]||'';return _0x36aa9a['localeCompare'](_0x2a65a3);});if(_0x2bed49[_0xfa3690(0x1d1)]||_0x2bed49[_0xfa3690(0x2ba)])return await handleSDKOutput(_0x338ef0,_0x2bed49),0x0;let _0x182ee8;if(_0x2e2ed3){const _0x3679ec=_0x338ef0[0x0];if(!_0x3679ec[_0xfa3690(0x293)]?.['id'])return console['error']('Latest\x20session\x20has\x20no\x20attempt'),0x0;_0x182ee8=_0x3679ec[_0xfa3690(0x293)]['id'],_0x2bed49[_0xfa3690(0x300)]&&console[_0xfa3690(0x27a)]('Auto-selected\x20latest\x20session:\x20'+_0x3679ec[_0xfa3690(0x1e6)]);}else{const _0x17661d=_0x338ef0[_0xfa3690(0x204)](_0x138cd0=>{const _0x4799ac=_0xfa3690,_0x5a305d=getAttemptStatusDisplay(_0x138cd0[_0x4799ac(0x293)]);return{'title':_0x138cd0[_0x4799ac(0x1d5)]?.[_0x4799ac(0x285)]+'.'+_0x138cd0[_0x4799ac(0x1b6)]?.[_0x4799ac(0x285)]+_0x4799ac(0x168)+_0x138cd0[_0x4799ac(0x1e6)]+'\x20'+_0x5a305d[_0x4799ac(0x173)],'value':_0x138cd0['lastAttempt']?.['id']||'','description':_0x5a305d[_0x4799ac(0x180)]};}),_0x310a12=await a42_0x4f473f({'type':_0xfa3690(0x29d),'name':_0xfa3690(0x2af),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x17661d['filter'](_0x5a3d60=>_0x5a3d60[_0xfa3690(0x1ff)]!=='')});if(!_0x310a12['attemptId'])return 0x0;_0x182ee8=_0x310a12[_0xfa3690(0x2af)];}const _0x5277fc=_0x2bed49[_0xfa3690(0x247)];return _0x5277fc?await this[_0xfa3690(0x28f)](_0x25367d,_0x182ee8):await this[_0xfa3690(0x1f0)](_0x25367d,_0x182ee8,_0x2bed49),0x0;}async[a42_0x5154e0(0x1f0)](_0x505bc8,_0x897b16,_0x1ad26e){const _0xbdac78=a42_0x5154e0,{tdx:_0x4e79c5}=_0x505bc8;let _0x5b9e04,_0x4b0003;try{[_0x5b9e04,_0x4b0003]=await Promise[_0xbdac78(0x2b1)]([_0x4e79c5[_0xbdac78(0x1b6)]['attempt'](_0x897b16),_0x4e79c5['workflow']['tasks'](_0x897b16,![])]);}catch(_0x1971e1){console[_0xbdac78(0x27a)](a42_0x968a9d[_0xbdac78(0x21f)](_0xbdac78(0x186)));_0x1ad26e['verbose']&&console[_0xbdac78(0x27a)](_0x1971e1);throw _0x1971e1;}if(_0x1ad26e[_0xbdac78(0x1d1)]||_0x1ad26e[_0xbdac78(0x2ba)]){const _0x2300b2=this[_0xbdac78(0x282)](_0x5b9e04,_0x4b0003);await handleSDKOutput([_0x2300b2],_0x1ad26e);return;}const _0x59d32e=_0x4e79c5['context'][_0xbdac78(0x1c8)],_0x21c6b4=this['renderTimeline'](_0x5b9e04,_0x4b0003,_0x59d32e);console[_0xbdac78(0x263)](_0x21c6b4);}async[a42_0x5154e0(0x28f)](_0x42a6da,_0x2497bd){const _0x397142=a42_0x5154e0,{tdx:_0x17c273}=_0x42a6da,_0x418a80=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x1ae9ed=TIMELINE_CONFIG[_0x397142(0x294)];let _0x440327=0x0;while(_0x440327<_0x1ae9ed){process[_0x397142(0x1a5)][_0x397142(0x194)]&&process[_0x397142(0x1a5)]['write']('\x1bc');let _0x1a0906,_0x3e41b3;try{[_0x1a0906,_0x3e41b3]=await Promise[_0x397142(0x2b1)]([_0x17c273[_0x397142(0x1b6)][_0x397142(0x311)](_0x2497bd),_0x17c273['workflow'][_0x397142(0x25f)](_0x2497bd,![])]);}catch(_0x4e4e2a){console[_0x397142(0x27a)](a42_0x968a9d[_0x397142(0x21f)]('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x440327>0x0&&console['error'](a42_0x968a9d[_0x397142(0x290)](_0x397142(0x1c5)+_0x440327));throw _0x4e4e2a;}const _0x53691c=_0x17c273[_0x397142(0x24f)]['site'],_0x360a5d=this[_0x397142(0x1df)](_0x1a0906,_0x3e41b3,_0x53691c);console[_0x397142(0x263)](_0x360a5d);const _0x147315=_0x1a0906[_0x397142(0x1b3)]&&_0x3e41b3[_0x397142(0x217)](_0x5bed57=>_0x5bed57[_0x397142(0x17b)]!==_0x397142(0x16d)&&_0x5bed57['state']!==_0x397142(0x2dd));if(_0x147315){console[_0x397142(0x27a)](a42_0x968a9d[_0x397142(0x272)](_0x397142(0x2ea)));break;}console[_0x397142(0x27a)](a42_0x968a9d[_0x397142(0x290)]('\x0aPolling...\x20('+_0x440327*0x2+_0x397142(0x20c))),await new Promise(_0x2f8494=>setTimeout(_0x2f8494,_0x418a80)),_0x440327++;}_0x440327>=_0x1ae9ed&&console['error'](a42_0x968a9d['yellow']('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a42_0x5154e0(0x1df)](_0x151532,_0x311cdd,_0x2954c0){const _0x41f802=a42_0x5154e0,_0x409975=[],_0x33ee8d=TIMELINE_CONFIG[_0x41f802(0x1e2)],_0x54613c=0x5,_0x5d6d7d=process[_0x41f802(0x1a5)][_0x41f802(0x27c)]||0x78,_0x34aa0f=_0x5d6d7d-_0x33ee8d-_0x54613c,_0x11e0d3=Math['max'](TIMELINE_CONFIG[_0x41f802(0x1c2)],Math['min'](_0x34aa0f,TIMELINE_CONFIG[_0x41f802(0x172)])),_0x3528e9=new Date(_0x151532[_0x41f802(0x2ad)])[_0x41f802(0x2d4)](),_0x17d322=_0x151532[_0x41f802(0x224)]?new Date(_0x151532[_0x41f802(0x224)])['getTime']():Date[_0x41f802(0x216)](),_0x5f5794={'start':_0x3528e9,'end':_0x17d322,'duration':_0x17d322-_0x3528e9},_0xdc1557=new Map(),_0x2e5ba7=[];for(const _0x113d3b of _0x311cdd){if(_0x113d3b[_0x41f802(0x2b3)]){const _0x27b455=new Date(_0x113d3b[_0x41f802(0x2b3)])[_0x41f802(0x2d4)](),_0x34d221=_0x113d3b['updatedAt']?new Date(_0x113d3b[_0x41f802(0x264)])[_0x41f802(0x2d4)]():Date[_0x41f802(0x216)](),_0x2434bb={'start':_0x27b455,'end':_0x34d221,'duration':_0x34d221-_0x27b455};_0xdc1557[_0x41f802(0x1d3)](_0x113d3b['id'],_0x2434bb),_0x2e5ba7[_0x41f802(0x2d5)]({'name':_0x113d3b[_0x41f802(0x25b)],'state':_0x113d3b[_0x41f802(0x17b)]||'unknown','window':_0x2434bb});}else _0x2e5ba7[_0x41f802(0x2d5)]({'name':_0x113d3b[_0x41f802(0x25b)],'state':_0x113d3b[_0x41f802(0x17b)]||_0x41f802(0x2dd),'window':undefined});}_0x2e5ba7[_0x41f802(0x239)]((_0x441501,_0xa46e06)=>{const _0x871b25=_0x41f802;if(!_0x441501['window'])return 0x1;if(!_0xa46e06[_0x871b25(0x2c5)])return-0x1;return _0x441501['window'][_0x871b25(0x227)]-_0xa46e06[_0x871b25(0x2c5)][_0x871b25(0x227)];});const _0x577c9e=_0x2e5ba7[_0x41f802(0x28d)],_0x5e5142=_0x577c9e>TIMELINE_CONFIG[_0x41f802(0x21e)];_0x5e5142&&_0x2e5ba7[_0x41f802(0x28b)](TIMELINE_CONFIG[_0x41f802(0x21e)]);const _0x6c4c9d=calculateTimeScale(_0x5f5794,_0x11e0d3),_0x53d5cd=_0x151532[_0x41f802(0x1b3)]?_0x151532[_0x41f802(0x183)]?a42_0x968a9d[_0x41f802(0x272)](_0x41f802(0x183)):a42_0x968a9d['red'](_0x41f802(0x27a)):a42_0x968a9d[_0x41f802(0x1f6)](_0x41f802(0x16d)),_0x4721da=_0x151532['project']?.['id'],_0x5b58ff=_0x151532['sessionId'];let _0x36dab4;if(_0x4721da&&_0x5b58ff){const _0x46126f=getWorkflowAttemptUrl(_0x2954c0,_0x4721da,_0x5b58ff,_0x151532['id']);_0x36dab4=hyperlink(a42_0x968a9d[_0x41f802(0x290)](_0x151532['id']),_0x46126f);}else _0x36dab4=a42_0x968a9d[_0x41f802(0x290)](_0x151532['id']);_0x409975[_0x41f802(0x2d5)](_0x41f802(0x24c)+_0x36dab4+'\x20-\x20'+_0x53d5cd+'\x20-\x20'+formatElapsed(_0x5f5794[_0x41f802(0x161)]));if(_0x2e5ba7['length']>0x0){const _0x9ff8d9=renderTimeAxis(_0x6c4c9d,_0x11e0d3),_0x310a33=new Date(_0x5f5794['start']),_0x4a885f=formatDate(_0x310a33),_0x4e4726=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x41f802(0x2e6)]+_0x33ee8d,_0xa78b74=_0x4a885f[_0x41f802(0x1ce)](_0x4e4726),_0x1e0760=a42_0x968a9d[_0x41f802(0x290)](_0xa78b74);_0x409975['push'](_0x1e0760+'\x20'+_0x9ff8d9);for(const _0x55ea78 of _0x2e5ba7){_0x409975['push'](renderTaskRow(_0x55ea78,_0x6c4c9d,_0x11e0d3,_0x33ee8d));}const _0xae46fd=calculateStats(_0x2e5ba7);_0x409975[_0x41f802(0x2d5)](formatStats(_0xae46fd)),_0x5e5142&&_0x409975[_0x41f802(0x2d5)](a42_0x968a9d[_0x41f802(0x251)](_0x41f802(0x174)+TIMELINE_CONFIG[_0x41f802(0x21e)]+'\x20of\x20'+_0x577c9e+_0x41f802(0x2b2))),_0x409975[_0x41f802(0x2d5)](''),_0x409975['push'](a42_0x968a9d['dim']('💡\x20Tip:\x20Use\x20')+(_0x41f802(0x267)+_0x151532['id']+'\x20logs')+a42_0x968a9d['dim'](_0x41f802(0x1d0)));}else _0x409975['push'](_0x41f802(0x2e3));return _0x409975[_0x41f802(0x2e9)]('\x0a');}['buildTimelineData'](_0x24081b,_0x9632f2){const _0x58e60d=a42_0x5154e0,_0x3f9f9b=new Date(_0x24081b['createdAt'])[_0x58e60d(0x2d4)](),_0x4af2bc=_0x24081b[_0x58e60d(0x224)]?new Date(_0x24081b[_0x58e60d(0x224)])[_0x58e60d(0x2d4)]():Date[_0x58e60d(0x216)](),_0x4b8342=_0x4af2bc-_0x3f9f9b,_0x363546=[];for(const _0x51b96e of _0x9632f2){if(_0x51b96e['startedAt']){const _0x3c0d8b=new Date(_0x51b96e[_0x58e60d(0x2b3)])[_0x58e60d(0x2d4)](),_0x2b663a=_0x51b96e[_0x58e60d(0x264)]?new Date(_0x51b96e[_0x58e60d(0x264)])[_0x58e60d(0x2d4)]():Date['now']();_0x363546[_0x58e60d(0x2d5)]({'name':_0x51b96e['fullName'],'state':_0x51b96e['state']||_0x58e60d(0x1cc),'window':{'start':_0x3c0d8b,'end':_0x2b663a,'duration':_0x2b663a-_0x3c0d8b}});}else _0x363546[_0x58e60d(0x2d5)]({'name':_0x51b96e[_0x58e60d(0x25b)],'state':_0x51b96e[_0x58e60d(0x17b)]||_0x58e60d(0x2dd),'window':undefined});}const _0x4ca3a5=calculateStats(_0x363546);return{'attempt':{'id':_0x24081b['id'],'status':_0x24081b[_0x58e60d(0x1b3)]?_0x24081b[_0x58e60d(0x183)]?_0x58e60d(0x183):'error':_0x58e60d(0x16d),'createdAt':_0x24081b[_0x58e60d(0x2ad)],'finishedAt':_0x24081b['finishedAt'],'duration_ms':_0x4b8342},'tasks':_0x363546[_0x58e60d(0x204)](_0x576b64=>({'name':_0x576b64['name'],'state':_0x576b64['state'],'startedAt':_0x576b64[_0x58e60d(0x2c5)]?new Date(_0x576b64[_0x58e60d(0x2c5)][_0x58e60d(0x227)])['toISOString']():null,'updatedAt':_0x576b64['window']?new Date(_0x576b64[_0x58e60d(0x2c5)][_0x58e60d(0x178)])[_0x58e60d(0x1d8)]():null,'duration_ms':_0x576b64[_0x58e60d(0x2c5)]?.[_0x58e60d(0x161)]||null})),'stats':_0x4ca3a5};}}
|
|
1
|
+
const a42_0x271344=a42_0x3418;(function(_0x37e5bd,_0x52bf12){const _0x356386=a42_0x3418,_0x166c91=_0x37e5bd();while(!![]){try{const _0x121a00=-parseInt(_0x356386(0x2e6))/0x1+-parseInt(_0x356386(0x1b3))/0x2*(parseInt(_0x356386(0x282))/0x3)+-parseInt(_0x356386(0x2ae))/0x4+parseInt(_0x356386(0x2be))/0x5+parseInt(_0x356386(0x262))/0x6*(-parseInt(_0x356386(0x22e))/0x7)+-parseInt(_0x356386(0x285))/0x8*(parseInt(_0x356386(0x1ea))/0x9)+parseInt(_0x356386(0x18e))/0xa;if(_0x121a00===_0x52bf12)break;else _0x166c91['push'](_0x166c91['shift']());}catch(_0x15c582){_0x166c91['push'](_0x166c91['shift']());}}}(a42_0x3fe2,0x2dde1));import a42_0x4cb0ba from'chalk';import{existsSync}from'fs';import a42_0xff53de 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 a42_0x5e9a1d from'prompts';function getAttemptStatusDisplay(_0x5b4291){const _0x179bf9=a42_0x3418;if(!_0x5b4291)return{'icon':'⏳','text':''};const {done:_0x22c11a,success:_0x4b2333,cancelRequested:_0x3d690e}=_0x5b4291;if(!_0x22c11a)return _0x3d690e?{'icon':'🛑','text':a42_0x4cb0ba[_0x179bf9(0x1c6)]('canceling')}:{'icon':'🔄','text':a42_0x4cb0ba[_0x179bf9(0x2d8)](_0x179bf9(0x230))};if(_0x4b2333)return{'icon':'✅','text':a42_0x4cb0ba[_0x179bf9(0x1ff)](_0x179bf9(0x223))};return{'icon':'❌','text':a42_0x4cb0ba[_0x179bf9(0x2eb)](_0x179bf9(0x1e2))};}export class WorkflowBaseCommand extends BaseCommand{[a42_0x271344(0x16a)](_0xbb9cce,_0x310f28,_0x16ddff=0x0){const _0x6afd83=a42_0x271344;return _0xbb9cce[_0x16ddff]||_0x310f28[_0x6afd83(0x2e5)];}[a42_0x271344(0x1a0)](_0xcab8b1,_0x75054a,_0xfcf448=0x0){const _0x385f1f=a42_0x271344,_0x2305a9=this['resolveProject'](_0xcab8b1,_0x75054a,_0xfcf448);if(!_0x2305a9)return console[_0x385f1f(0x1e2)](a42_0x4cb0ba[_0x385f1f(0x2eb)](_0x385f1f(0x29a)),_0x385f1f(0x170)),console[_0x385f1f(0x1e2)](a42_0x4cb0ba[_0x385f1f(0x1fb)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x2305a9;}[a42_0x271344(0x15b)](_0x121503,_0x56913f){const _0x3155e7=a42_0x271344;if(_0x121503[0x0]){const _0x4b436=_0x121503[0x0][_0x3155e7(0x242)]('.');if(_0x4b436[_0x3155e7(0x152)]===0x1)return{'projectName':_0x4b436[0x0],'workflowName':undefined};else return _0x4b436[_0x3155e7(0x152)]===0x2?{'projectName':_0x4b436[0x0],'workflowName':_0x4b436[0x1]}:(console['error'](a42_0x4cb0ba[_0x3155e7(0x2eb)]('Error:'),_0x3155e7(0x2b6)),null);}return{'projectName':_0x56913f['workflowProject'],'workflowName':undefined};}[a42_0x271344(0x16b)](_0x22a1dd,_0x5e4b10,_0x4ef2f5=0x0){const _0x467734=a42_0x271344;if(_0x22a1dd[_0x4ef2f5])return _0x22a1dd[_0x4ef2f5];if(_0x5e4b10[_0x467734(0x2e5)]){const _0x3ee627=a42_0xff53de['join'](process[_0x467734(0x1e0)](),_0x467734(0x2f3),_0x5e4b10['workflowProject']);if(existsSync(a42_0xff53de[_0x467734(0x247)](_0x3ee627,'tdx.json')))return _0x3ee627;}return undefined;}async['showWorkflowConsoleUrl'](_0x1edd54,_0x3e6482,_0x2bd33a){const _0x170883=a42_0x271344;try{const _0x278025=await _0x1edd54[_0x170883(0x2b8)]['workflows'](_0x3e6482,{'limit':0x1});if(_0x278025['length']>0x0){const _0x320f35=_0x278025[0x0]['id'],_0x723085=getWorkflowUrl(_0x2bd33a,_0x320f35);console[_0x170883(0x1e2)](_0x170883(0x2ab)+a42_0x4cb0ba[_0x170883(0x27a)](_0x723085));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a42_0x271344(0x1dd);[a42_0x271344(0x186)]='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async[a42_0x271344(0x1ef)](_0x282c04){const _0x4a61eb=a42_0x271344,{options:_0x4fb4ef,args:_0x39e4a6,tdx:_0x5ec620}=_0x282c04,_0x20fc6f=_0x39e4a6[0x0],_0x597d30=_0x4fb4ef[_0x4a61eb(0x2e3)];if(_0x597d30)return saveSessionContext({'workflow_project':undefined},_0x4fb4ef[_0x4a61eb(0x23a)]),console[_0x4a61eb(0x295)](a42_0x4cb0ba[_0x4a61eb(0x1ff)]('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x20fc6f)return console['error'](a42_0x4cb0ba[_0x4a61eb(0x2eb)]('Error:'),_0x4a61eb(0x170)),console[_0x4a61eb(0x1e2)](a42_0x4cb0ba[_0x4a61eb(0x1fb)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x4a61eb(0x1e2)](a42_0x4cb0ba[_0x4a61eb(0x1fb)](_0x4a61eb(0x2a9))),0x1;const _0x396887=await withSpinner('Resolving\x20project\x20\x27'+_0x20fc6f+_0x4a61eb(0x1c1),()=>_0x5ec620[_0x4a61eb(0x2b8)]['resolveProjectId'](_0x20fc6f),{'verbose':_0x4fb4ef['verbose']}),{name:_0x4094aa}=_0x396887['data'];return saveSessionContext({'workflow_project':_0x4094aa},_0x4fb4ef[_0x4a61eb(0x23a)]),console[_0x4a61eb(0x295)](a42_0x4cb0ba['green'](_0x4a61eb(0x261)+a42_0x4cb0ba[_0x4a61eb(0x27a)](_0x4094aa))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a42_0x271344(0x1bf)]=a42_0x271344(0x294);[a42_0x271344(0x186)]='List\x20all\x20workflow\x20projects';async[a42_0x271344(0x1ef)](_0x3db8ec){const _0x497c70=a42_0x271344,{options:_0x21a003,args:_0x22d9e3,tdx:_0x509da5}=_0x3db8ec,_0xf4705c=_0x22d9e3[0x0];_0x21a003['verbose']&&_0xf4705c&&console[_0x497c70(0x1e2)]('Pattern:\x20'+_0xf4705c);const _0x45c5b2=await withSpinner(_0x497c70(0x23c),()=>_0x509da5[_0x497c70(0x2b8)]['projects'](_0xf4705c,{'limit':_0x21a003[_0x497c70(0x22c)]}),{'verbose':_0x21a003[_0x497c70(0x2cc)]});let _0x8f8f19=_0x45c5b2[_0x497c70(0x1c3)];_0x8f8f19[_0x497c70(0x1cd)]((_0x5c7161,_0x477d65)=>_0x5c7161[_0x497c70(0x1bf)]['localeCompare'](_0x477d65[_0x497c70(0x1bf)]));const _0x407af0=_0x21a003[_0x497c70(0x22c)]||0x64,_0x2872a8=_0x8f8f19['length']>=_0x407af0?a42_0x4cb0ba[_0x497c70(0x1fb)](_0x497c70(0x2d6)):'';console[_0x497c70(0x1e2)](_0x497c70(0x18a)+_0x8f8f19[_0x497c70(0x152)]+'\x20project'+(_0x8f8f19['length']!==0x1?'s':'')+_0x2872a8);if(_0x21a003['format']===_0x497c70(0x19c)||_0x21a003['format']===_0x497c70(0x173)||_0x21a003[_0x497c70(0x2ed)]===_0x497c70(0x16c))await handleSDKOutput(_0x8f8f19,_0x21a003);else{if(_0x8f8f19[_0x497c70(0x152)]===0x0)_0xf4705c?console[_0x497c70(0x295)]('No\x20projects\x20match\x20pattern:\x20'+_0xf4705c):console['log']('No\x20workflow\x20projects\x20found');else{const _0x5a005e=_0x8f8f19[_0x497c70(0x174)](_0x29a99f=>{const _0x3843f8=_0x497c70,_0xdecb0f=_0x29a99f[_0x3843f8(0x208)]?.[_0x3843f8(0x1b9)](_0x4df9f4=>_0x4df9f4[_0x3843f8(0x1d3)]===_0x3843f8(0x1a2)),_0x43625c=_0xdecb0f?a42_0x4cb0ba[_0x3843f8(0x1fb)](_0x3843f8(0x2af)):'';return'📁\x20'+_0x29a99f['name']+_0x43625c;});await writeOutput(_0x5a005e[_0x497c70(0x247)]('\x0a'),_0x21a003['output'],_0x497c70(0x22d));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a42_0x271344(0x1bf)]=a42_0x271344(0x1a3);[a42_0x271344(0x186)]=a42_0x271344(0x1b8);async['execute'](_0x483e2c){const _0x5d1743=a42_0x271344,{options:_0x15e229,args:_0x38b5aa,tdx:_0x5229b1}=_0x483e2c,_0x34edd0=this[_0x5d1743(0x16a)](_0x38b5aa,_0x15e229);_0x15e229['verbose']&&_0x34edd0&&console[_0x5d1743(0x1e2)](_0x5d1743(0x159)+_0x34edd0);const _0x5ac472=await withSpinner(_0x5d1743(0x28f),()=>_0x5229b1[_0x5d1743(0x2b8)]['workflows'](_0x34edd0,{'limit':_0x15e229['limit']}),{'verbose':_0x15e229[_0x5d1743(0x2cc)]});let _0x5448e3=_0x5ac472[_0x5d1743(0x1c3)];_0x5448e3[_0x5d1743(0x1cd)]((_0x55fca8,_0x37c8b6)=>{const _0x3d9e40=_0x5d1743,_0x372534=_0x55fca8[_0x3d9e40(0x1bf)][_0x3d9e40(0x235)](_0x37c8b6[_0x3d9e40(0x1bf)]);if(_0x372534!==0x0)return _0x372534;return(_0x55fca8['project']?.['name']||'')[_0x3d9e40(0x235)](_0x37c8b6['project']?.[_0x3d9e40(0x1bf)]||'');});const _0xa2691b=_0x15e229[_0x5d1743(0x22c)]||0x64,_0x3aaa8b=_0x5448e3[_0x5d1743(0x152)]>=_0xa2691b?a42_0x4cb0ba['dim'](_0x5d1743(0x2d6)):'';console[_0x5d1743(0x1e2)](_0x5d1743(0x18a)+_0x5448e3[_0x5d1743(0x152)]+_0x5d1743(0x20c)+(_0x5448e3[_0x5d1743(0x152)]!==0x1?'s':'')+_0x3aaa8b);if(_0x15e229[_0x5d1743(0x2ed)]===_0x5d1743(0x19c)||_0x15e229[_0x5d1743(0x2ed)]===_0x5d1743(0x173)||_0x15e229[_0x5d1743(0x2ed)]===_0x5d1743(0x16c))await handleSDKOutput(_0x5448e3,_0x15e229);else{if(_0x5448e3[_0x5d1743(0x152)]===0x0)_0x34edd0?console[_0x5d1743(0x295)](_0x5d1743(0x15f)+_0x34edd0):console[_0x5d1743(0x295)](_0x5d1743(0x2dc));else{const _0x325d85=_0x15e229[_0x5d1743(0x21f)],_0x22bdf9=_0x5448e3[_0x5d1743(0x174)](_0xc0306a=>{const _0x5a76be=_0x5d1743,_0x377c2e=a42_0x4cb0ba[_0x5a76be(0x1fb)]('#'+_0xc0306a['id']),_0x128184=hyperlink(_0x377c2e,getWorkflowUrl(_0x325d85,_0xc0306a['id'])),_0x533c06=_0xc0306a['project']?.[_0x5a76be(0x1bf)]?a42_0x4cb0ba[_0x5a76be(0x1fb)]('\x20('+_0xc0306a['project'][_0x5a76be(0x1bf)]+')'):'';return _0x5a76be(0x2c5)+_0x128184+'\x20'+_0xc0306a[_0x5a76be(0x1bf)]+_0x533c06;});await writeOutput(_0x22bdf9[_0x5d1743(0x247)]('\x0a'),_0x15e229['output'],_0x5d1743(0x22d));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a42_0x271344(0x1bf)]=a42_0x271344(0x211);[a42_0x271344(0x186)]=a42_0x271344(0x19d);async[a42_0x271344(0x1ef)](_0x39fdb3){const _0x575de7=a42_0x271344,{options:_0x42a797,args:_0x198f69,tdx:_0x364729}=_0x39fdb3,_0x4e91bd=this[_0x575de7(0x15b)](_0x198f69,_0x42a797);if(!_0x4e91bd)return 0x1;const {projectName:_0x500cb6,workflowName:_0xc47da}=_0x4e91bd;if(_0x42a797[_0x575de7(0x2cc)]){if(_0x500cb6&&_0xc47da)console[_0x575de7(0x1e2)](_0x575de7(0x25e)+_0x500cb6+'.'+_0xc47da);else _0x500cb6&&console[_0x575de7(0x1e2)]('Filter:\x20project='+_0x500cb6);const _0x46da98=_0x42a797['status'];_0x46da98&&console[_0x575de7(0x1e2)]('Status:\x20'+_0x46da98);}let _0x9ae4b6=0x28;if(process[_0x575de7(0x206)]['isTTY']&&!_0x42a797[_0x575de7(0x263)]&&!_0x42a797[_0x575de7(0x2ed)]){const _0x5d66a9=process[_0x575de7(0x206)][_0x575de7(0x147)]||0x28;_0x9ae4b6=Math[_0x575de7(0x1c0)](0x14,Math[_0x575de7(0x1f4)](_0x5d66a9*0x2/0x3));}const _0x35c794=_0x42a797[_0x575de7(0x22c)]||_0x9ae4b6,_0x8cf0c8=await withSpinner(_0x575de7(0x24d),()=>_0x364729[_0x575de7(0x2b8)][_0x575de7(0x15c)]({'projectName':_0x500cb6,'workflowName':_0xc47da,'status':_0x42a797[_0x575de7(0x1eb)],'fromTime':_0x42a797[_0x575de7(0x2d2)],'toTime':_0x42a797['to'],'limit':_0x35c794}),{'verbose':_0x42a797[_0x575de7(0x2cc)]}),_0x859a8f=_0x8cf0c8[_0x575de7(0x1c3)];_0x859a8f[_0x575de7(0x1cd)]((_0x383e5b,_0x5762dc)=>{const _0x463a95=_0x575de7,_0x53f836=_0x383e5b['sessionTime']||'',_0x16edc0=_0x5762dc[_0x463a95(0x2d7)]||'';return _0x16edc0[_0x463a95(0x235)](_0x53f836);});_0x859a8f[_0x575de7(0x152)]>=_0x35c794?console[_0x575de7(0x1e2)](_0x575de7(0x2a7)+_0x859a8f[_0x575de7(0x152)]+_0x575de7(0x220)+a42_0x4cb0ba[_0x575de7(0x1fb)](_0x575de7(0x2d4))):console[_0x575de7(0x1e2)](_0x575de7(0x18a)+_0x859a8f[_0x575de7(0x152)]+_0x575de7(0x1e9)+(_0x859a8f[_0x575de7(0x152)]!==0x1?'s':''));if(_0x42a797[_0x575de7(0x2ed)]===_0x575de7(0x19c)||_0x42a797[_0x575de7(0x2ed)]==='jsonl'||_0x42a797[_0x575de7(0x2ed)]===_0x575de7(0x16c))await handleSDKOutput(_0x859a8f,_0x42a797);else{if(!process[_0x575de7(0x206)][_0x575de7(0x1da)]||_0x42a797[_0x575de7(0x263)]){if(_0x859a8f['length']===0x0){if(_0x500cb6&&_0xc47da)console[_0x575de7(0x295)](_0x575de7(0x239)+_0x500cb6+'.'+_0xc47da);else _0x500cb6?console[_0x575de7(0x295)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x500cb6):console[_0x575de7(0x295)](_0x575de7(0x243));}else{const _0x4edf00=_0x42a797[_0x575de7(0x21f)],_0xb13222=this[_0x575de7(0x175)](_0x859a8f,_0x4edf00);_0x42a797['output']?await writeOutput(_0xb13222,_0x42a797[_0x575de7(0x263)],_0x575de7(0x22d)):console['log'](_0xb13222);}!_0x500cb6&&(console['error'](''),console[_0x575de7(0x1e2)](a42_0x4cb0ba[_0x575de7(0x1fb)](_0x575de7(0x236))),console[_0x575de7(0x1e2)](a42_0x4cb0ba[_0x575de7(0x1fb)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a42_0x4cb0ba[_0x575de7(0x1fb)](_0x575de7(0x273))));}else{if(_0x859a8f['length']===0x0){if(_0x500cb6&&_0xc47da)console[_0x575de7(0x295)](_0x575de7(0x239)+_0x500cb6+'.'+_0xc47da);else _0x500cb6?console[_0x575de7(0x295)](_0x575de7(0x200)+_0x500cb6):console[_0x575de7(0x295)](_0x575de7(0x243));}else await this[_0x575de7(0x1c5)](_0x859a8f,_0x39fdb3,_0x500cb6);}}return 0x0;}[a42_0x271344(0x175)](_0x56c7a9,_0x4d6d4a){const _0x29f894=a42_0x271344,_0xd5ac48=[],_0x1c43e7=new Map();let _0x925098=Infinity,_0x3a4ae2=-Infinity;for(const _0x450a89 of _0x56c7a9){if(_0x450a89['lastAttempt']?.[_0x29f894(0x2a2)]){const _0x48e6ca=new Date(_0x450a89['lastAttempt']['createdAt'])[_0x29f894(0x2c3)](),_0x555898=_0x450a89['lastAttempt'][_0x29f894(0x2e4)]?new Date(_0x450a89[_0x29f894(0x18c)][_0x29f894(0x2e4)])[_0x29f894(0x2c3)]():Date['now'](),_0x14e958=_0x450a89[_0x29f894(0x24b)]?.['name']||_0x29f894(0x2e9);!_0x1c43e7[_0x29f894(0x221)](_0x14e958)&&_0x1c43e7[_0x29f894(0x154)](_0x14e958,[]),_0x1c43e7[_0x29f894(0x210)](_0x14e958)[_0x29f894(0x1ad)]({'session':_0x450a89,'startTime':_0x48e6ca,'endTime':_0x555898,'duration':_0x555898-_0x48e6ca}),_0x925098=Math[_0x29f894(0x25c)](_0x925098,_0x48e6ca),_0x3a4ae2=Math['max'](_0x3a4ae2,_0x555898);}}if(_0x1c43e7[_0x29f894(0x1ce)]===0x0)return _0x29f894(0x287);const _0x483a68=process[_0x29f894(0x206)][_0x29f894(0x260)]||0x78,_0x3dce30=0x1e,_0xc23d43=0x32,_0x2e0aed=0x4,_0x461cbb=Math[_0x29f894(0x25c)](_0xc23d43,Math[_0x29f894(0x1c0)](_0x3dce30,Math[_0x29f894(0x1f4)](_0x483a68*0.3))),_0x12c8a6=_0x483a68-_0x461cbb-TIMELINE_CONFIG[_0x29f894(0x1fc)]-0x3-_0x2e0aed,_0x28435e=_0x3a4ae2-_0x925098,_0x140717=_0x28435e/_0x461cbb,_0x36f004=renderTimeAxis({'startTime':_0x925098,'endTime':_0x3a4ae2,'durationMs':_0x28435e,'msPerChar':_0x140717},_0x461cbb),_0x413dfb=[];for(const _0x17f81f of _0x1c43e7[_0x29f894(0x17e)]()){_0x413dfb[_0x29f894(0x1ad)](..._0x17f81f);}_0x413dfb[_0x29f894(0x1cd)]((_0x1571f6,_0x2a15c9)=>_0x2a15c9['startTime']-_0x1571f6[_0x29f894(0x224)]);const _0x1704a0=new Date(_0x925098),_0x7e97f4=formatDate(_0x1704a0),_0x2096cd=_0x2e0aed+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x29f894(0x185)]+_0x12c8a6,_0x9a359a='\x20'['repeat'](_0x2096cd-_0x7e97f4[_0x29f894(0x152)]),_0x296127=_0x9a359a+a42_0x4cb0ba[_0x29f894(0x1fb)](_0x7e97f4)+'\x20'+_0x36f004;_0xd5ac48[_0x29f894(0x1ad)](_0x296127);const _0x168965=0x16;let _0x4c2be3=0x0;for(const _0x4a46fe of _0x413dfb){const _0x43d9a0=_0x4a46fe[_0x29f894(0x23a)][_0x29f894(0x24b)]?.['name']||'?',_0x1f52dc=Math[_0x29f894(0x25c)](stringWidth(_0x43d9a0),_0x168965);_0x4c2be3=Math['max'](_0x4c2be3,_0x1f52dc);}for(const _0x426bd0 of _0x413dfb){const {session:_0x5e1596,startTime:_0x4590cd,endTime:_0x113bb7,duration:_0x32419a}=_0x426bd0,_0x57ffaa=_0x5e1596['project']?.['id'],_0x472fa9=_0x5e1596['id'],_0x590561=_0x5e1596[_0x29f894(0x24b)]?.['name']||'?',_0x1d22cb=_0x5e1596[_0x29f894(0x2b8)]?.[_0x29f894(0x1bf)]||'?';let _0x52cf38,_0xe27e80;if(_0x5e1596[_0x29f894(0x18c)]){const _0x369eb7=_0x5e1596[_0x29f894(0x18c)];!_0x369eb7[_0x29f894(0x240)]?(_0x52cf38=_0x369eb7['cancelRequested']?'🛑':'🔄',_0xe27e80=_0x369eb7[_0x29f894(0x2f2)]?a42_0x4cb0ba['yellow']:a42_0x4cb0ba[_0x29f894(0x2d8)]):(_0x52cf38=_0x369eb7[_0x29f894(0x223)]?'✅':'❌',_0xe27e80=_0x369eb7[_0x29f894(0x223)]?a42_0x4cb0ba[_0x29f894(0x1ff)]:a42_0x4cb0ba[_0x29f894(0x2eb)]);}else _0x52cf38='⏳',_0xe27e80=a42_0x4cb0ba['dim'];const _0x353dc2='#'+_0x472fa9,_0xe3e005=_0x57ffaa?hyperlink(_0x353dc2,getWorkflowSessionUrl(_0x4d6d4a,_0x57ffaa,_0x472fa9)):_0x353dc2;let _0x4ce0e4=_0x590561;stringWidth(_0x590561)>_0x168965&&(_0x4ce0e4=_0x590561[_0x29f894(0x213)](0x0,_0x168965-0x1)+'…');const _0xeba4=a42_0x4cb0ba[_0x29f894(0x1fb)](_0x4ce0e4),_0x253f58=stringWidth(_0x4ce0e4),_0xfacde3='\x20'[_0x29f894(0x188)](_0x4c2be3-stringWidth(_0x4ce0e4)+0x2),_0x3fe473='('+formatElapsed(_0x32419a)+')',_0x936e30=stringWidth(_0x3fe473),_0x4201fa=stringWidth(_0x353dc2),_0x4fe5cd=_0x4201fa+0x1+_0x253f58+_0xfacde3[_0x29f894(0x152)],_0x181619=_0x12c8a6-_0x4fe5cd-_0x936e30-0x1-0x8;let _0x2b29e9=_0x1d22cb;stringWidth(_0x2b29e9)>_0x181619&&(_0x2b29e9=_0x2b29e9['slice'](0x0,_0x181619-0x1)+'…');const _0x53d91d=_0xe3e005+'\x20'+_0xeba4+_0xfacde3+_0x2b29e9,_0x6a9747=stringWidth(_0x53d91d),_0x122863=_0x12c8a6-_0x6a9747-_0x936e30,_0x1f8dda=_0x53d91d+'\x20'[_0x29f894(0x188)](Math[_0x29f894(0x1c0)](0x1,_0x122863))+a42_0x4cb0ba[_0x29f894(0x1fb)](_0x3fe473),_0x50544e=Math['floor']((_0x4590cd-_0x925098)/_0x140717),_0x1eee3b=Math[_0x29f894(0x1f4)]((_0x113bb7-_0x925098)/_0x140717),_0x2927e8=Math[_0x29f894(0x1c0)](_0x50544e+0x1,_0x1eee3b),_0x3b53e5=new Array(_0x461cbb)[_0x29f894(0x1dc)]('\x20');for(let _0x4eb531=_0x50544e;_0x4eb531<Math[_0x29f894(0x25c)](_0x2927e8,_0x461cbb);_0x4eb531++){_0x3b53e5[_0x4eb531]='─';}const _0x478ada=_0x3b53e5['map'](_0x4685e7=>_0x4685e7==='\x20'?'\x20':_0xe27e80(_0x4685e7))['join']('');_0xd5ac48[_0x29f894(0x1ad)](_0x52cf38+'\x20'+_0x1f8dda+'│'+_0x478ada+'│');}return _0xd5ac48[_0x29f894(0x247)]('\x0a');}async['navigateSessionsInteractive'](_0x3c8c32,_0xaabc10,_0x39af06){const _0x4fa681=a42_0x271344,{options:_0x538f13,tdx:_0x4d9e94}=_0xaabc10,_0x180197=_0x538f13['site'],{timelineRows:_0x593685,timeAxisHeader:_0x39b37c}=this[_0x4fa681(0x205)](_0x3c8c32,_0x180197),_0x34914c=_0x593685[_0x4fa681(0x288)](_0x5d6f1f=>_0x5d6f1f['attemptId']);if(_0x34914c[_0x4fa681(0x152)]===0x0){const _0x1e862b=this['renderSessionsTimeline'](_0x3c8c32,_0x180197);console[_0x4fa681(0x295)](_0x1e862b);!_0x39af06&&(console[_0x4fa681(0x1e2)](''),console[_0x4fa681(0x1e2)](a42_0x4cb0ba[_0x4fa681(0x1fb)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x4fa681(0x1e2)](a42_0x4cb0ba['dim'](_0x4fa681(0x29d))+'or'+a42_0x4cb0ba[_0x4fa681(0x1fb)](_0x4fa681(0x273))));return;}_0x39b37c&&console[_0x4fa681(0x295)](_0x39b37c);const _0x218504=_0x593685[_0x4fa681(0x288)](_0x278ba9=>_0x278ba9[_0x4fa681(0x16d)])[_0x4fa681(0x174)](_0x412185=>({'title':_0x412185[_0x4fa681(0x183)],'value':_0x412185['attemptId']})),_0xcb070e=process[_0x4fa681(0x206)][_0x4fa681(0x147)]||0x3c,_0x55150c=Math[_0x4fa681(0x1c0)](0x28,Math[_0x4fa681(0x1f4)](_0xcb070e*0x2/0x3)),_0x485a0b=await a42_0x5e9a1d({'type':_0x4fa681(0x2ee),'name':_0x4fa681(0x16d),'message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x218504,'initial':-0x1,'limit':_0x55150c,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x35623c,_0x2f1ee8)=>{const _0x445363=_0x4fa681;if(!_0x35623c)return Promise[_0x445363(0x23e)](_0x2f1ee8);const _0x458674=_0x2f1ee8[_0x445363(0x288)](_0x3fbacf=>{const _0x560299=_0x445363,_0x3b8589=_0x3fbacf;return _0x3b8589[_0x560299(0x146)][_0x560299(0x1af)]()['includes'](_0x35623c[_0x560299(0x1af)]());});return Promise[_0x445363(0x23e)](_0x458674);}}),_0x519060=()=>{const _0x515570=_0x4fa681;process[_0x515570(0x206)]['write'](_0x515570(0x281)),process[_0x515570(0x206)][_0x515570(0x1f3)]('\x1b[1A\x1b[2K'),process[_0x515570(0x206)]['write']('\x1b[1A\x1b[2K');},_0x46dee0=_0x485a0b&&_0x485a0b['attemptId']&&_0x485a0b[_0x4fa681(0x16d)]!==null&&_0x485a0b['attemptId'][_0x4fa681(0x194)]()!=='';if(!_0x46dee0){_0x519060(),console[_0x4fa681(0x295)](a42_0x4cb0ba[_0x4fa681(0x1fb)](_0x4fa681(0x1e5)));return;}_0x519060();const _0x1e65f6=_0x3c8c32['find'](_0x1d2f44=>_0x1d2f44[_0x4fa681(0x18c)]?.['id']===_0x485a0b[_0x4fa681(0x16d)]);if(_0x1e65f6){const _0x248e28=_0x1e65f6[_0x4fa681(0x24b)]?.[_0x4fa681(0x1bf)]||'?',_0x195c01=_0x1e65f6[_0x4fa681(0x2b8)]?.[_0x4fa681(0x1bf)]||'?';console[_0x4fa681(0x295)](_0x4fa681(0x1e4)+a42_0x4cb0ba[_0x4fa681(0x1fb)](_0x248e28)+_0x4fa681(0x2d5)+a42_0x4cb0ba['dim'](_0x195c01));}const _0x2c71ee=new WorkflowTimelineCommand();await _0x2c71ee[_0x4fa681(0x1ef)]({'args':[],'options':{..._0x538f13,'attemptId':_0x485a0b[_0x4fa681(0x16d)]},'tdx':_0x4d9e94});}[a42_0x271344(0x205)](_0x8eb44b,_0x33005){const _0x2bc2cd=a42_0x271344,_0x4efce6=new Map();for(const _0xd14b2d of _0x8eb44b){_0xd14b2d['id']&&_0xd14b2d['lastAttempt']?.['id']&&_0x4efce6[_0x2bc2cd(0x154)](_0xd14b2d['id'],_0xd14b2d[_0x2bc2cd(0x18c)]['id']);}const _0x2851d7=[];let _0x416b30='';const _0x4d85a7=this['renderSessionsTimeline'](_0x8eb44b,_0x33005),_0x1c6e00=_0x4d85a7[_0x2bc2cd(0x242)]('\x0a');for(const _0x18a61c of _0x1c6e00){if(_0x18a61c[_0x2bc2cd(0x253)](_0x2bc2cd(0x189))||_0x18a61c[_0x2bc2cd(0x15d)](/^\s+\d{4}-\d{2}-\d{2}/))_0x416b30=_0x18a61c;else{if(_0x18a61c[_0x2bc2cd(0x15d)](/^[✅❌🔄🛑⏳]/)){const _0x34ee0e=_0x18a61c[_0x2bc2cd(0x15d)](/#(\d+)/),_0x29287f=_0x34ee0e?_0x34ee0e[0x1]:null,_0x2cc989=_0x29287f?_0x4efce6[_0x2bc2cd(0x210)](_0x29287f)||null:null,_0x320324=_0x8eb44b[_0x2bc2cd(0x2b4)](_0x1a92da=>_0x1a92da['id']===_0x29287f),_0x2cf3c5=_0x320324?.[_0x2bc2cd(0x24b)]?.[_0x2bc2cd(0x1bf)]||'';_0x2851d7[_0x2bc2cd(0x1ad)]({'displayLine':_0x18a61c,'attemptId':_0x2cc989,'projectName':_0x2cf3c5});}}}return{'timelineRows':_0x2851d7,'timeAxisHeader':_0x416b30};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a42_0x271344(0x1bf)]=a42_0x271344(0x2e8);[a42_0x271344(0x186)]=a42_0x271344(0x1aa);async[a42_0x271344(0x1ef)](_0x6e62a4){const _0x357588=a42_0x271344,{options:_0x579f25,args:_0x258f08,tdx:_0x42da15}=_0x6e62a4,_0x1299b1=this[_0x357588(0x15b)](_0x258f08,_0x579f25);if(!_0x1299b1)return 0x1;const {projectName:_0xd95cbd,workflowName:_0x527375}=_0x1299b1,_0x3e7207=_0x579f25[_0x357588(0x21a)];if(_0x579f25[_0x357588(0x2cc)]){if(_0xd95cbd&&_0x527375)console[_0x357588(0x1e2)]('Filter:\x20'+_0xd95cbd+'.'+_0x527375);else _0xd95cbd&&console['error']('Filter:\x20project='+_0xd95cbd);_0x3e7207&&console[_0x357588(0x1e2)]('Include\x20retried:\x20yes');}const _0xc3aca8=await withSpinner(_0x357588(0x2c7),()=>_0x42da15['workflow'][_0x357588(0x202)]({'projectName':_0xd95cbd,'workflowName':_0x527375,'includeRetried':_0x3e7207,'limit':_0x579f25[_0x357588(0x22c)]}),{'verbose':_0x579f25[_0x357588(0x2cc)]}),_0x2c75f0=_0xc3aca8['data'],_0x19f1a4=_0x579f25['limit']||0x64,_0x5e175b=_0x2c75f0[_0x357588(0x152)]>=_0x19f1a4?a42_0x4cb0ba[_0x357588(0x1fb)](_0x357588(0x2d6)):'';console[_0x357588(0x1e2)](_0x357588(0x18a)+_0x2c75f0[_0x357588(0x152)]+'\x20attempt'+(_0x2c75f0[_0x357588(0x152)]!==0x1?'s':'')+_0x5e175b);if(_0x579f25['format']===_0x357588(0x19c)||_0x579f25['format']===_0x357588(0x173)||_0x579f25['format']==='table')await handleSDKOutput(_0x2c75f0,_0x579f25);else{if(_0x2c75f0['length']===0x0){if(_0xd95cbd&&_0x527375)console[_0x357588(0x295)]('No\x20attempts\x20found\x20for:\x20'+_0xd95cbd+'.'+_0x527375);else _0xd95cbd?console[_0x357588(0x295)](_0x357588(0x17b)+_0xd95cbd):console['log'](_0x357588(0x15a));}else{const _0x153495=_0x579f25[_0x357588(0x21f)],_0x50a90b=_0x2c75f0[_0x357588(0x174)](_0x217fc8=>{const _0x10a0ad=_0x357588,_0x5516f5=a42_0x4cb0ba['dim']('#'+_0x217fc8['id']),_0x365233=_0x217fc8['project']?.['id'],_0xf0439=_0x217fc8['session_id']||_0x217fc8[_0x10a0ad(0x20b)],_0x4dfb3a=_0x365233&&_0xf0439?hyperlink(_0x5516f5,getWorkflowAttemptUrl(_0x153495,_0x365233,_0xf0439,_0x217fc8['id'])):_0x5516f5,{icon:_0x90c425,text:_0x1c55fe}=getAttemptStatusDisplay(_0x217fc8),_0x483dd9=(_0x217fc8['project']?.[_0x10a0ad(0x1bf)]||'?')+'.'+(_0x217fc8[_0x10a0ad(0x2b8)]?.['name']||'?'),_0x1f3287=_0x217fc8[_0x10a0ad(0x2d7)]?a42_0x4cb0ba[_0x10a0ad(0x1fb)](_0x217fc8['sessionTime']):'';return(_0x4dfb3a+'\x20'+_0x90c425+(_0x1c55fe?'\x20'+_0x1c55fe:'')+'\x20'+_0x483dd9+'\x20'+_0x1f3287)[_0x10a0ad(0x171)]();});await writeOutput(_0x50a90b['join']('\x0a'),_0x579f25[_0x357588(0x263)],_0x357588(0x22d));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a42_0x271344(0x24c);[a42_0x271344(0x186)]=a42_0x271344(0x2df);async[a42_0x271344(0x1ef)](_0x38b17a){const _0x5e9714=a42_0x271344,{options:_0x21a724,args:_0xd104ad,tdx:_0x118671}=_0x38b17a,_0x310623=_0xd104ad[0x0];if(!_0x310623)return console[_0x5e9714(0x1e2)](_0x5e9714(0x19e)),0x1;_0x21a724[_0x5e9714(0x2cc)]&&console[_0x5e9714(0x1e2)]('Attempt\x20ID:\x20'+_0x310623);const _0x105bd7=await withSpinner(_0x5e9714(0x2ef),()=>_0x118671[_0x5e9714(0x2b8)][_0x5e9714(0x1e6)](_0x310623),{'verbose':_0x21a724[_0x5e9714(0x2cc)]}),_0x1e98b6=_0x105bd7['data'];let _0x359309;!_0x1e98b6[_0x5e9714(0x240)]?_0x359309=_0x1e98b6[_0x5e9714(0x2f2)]?_0x5e9714(0x254):'running':_0x359309=_0x1e98b6['success']?_0x5e9714(0x223):'error';let _0x1b2763;if(_0x1e98b6[_0x5e9714(0x2a2)]&&_0x1e98b6['finishedAt']){const _0x3f1b7e=new Date(_0x1e98b6[_0x5e9714(0x2a2)])[_0x5e9714(0x2c3)](),_0x4af970=new Date(_0x1e98b6[_0x5e9714(0x2e4)])[_0x5e9714(0x2c3)]();_0x1b2763=Math['round']((_0x4af970-_0x3f1b7e)/0x3e8);}const _0xa97bd5={'attempt_id':_0x1e98b6['id'],'status':_0x359309,..._0x1e98b6[_0x5e9714(0x214)]!==undefined&&{'index':_0x1e98b6['index']},..._0x1e98b6[_0x5e9714(0x24b)]&&{'project':_0x1e98b6[_0x5e9714(0x24b)][_0x5e9714(0x1bf)]},..._0x1e98b6['workflow']&&{'workflow':_0x1e98b6[_0x5e9714(0x2b8)][_0x5e9714(0x1bf)]},..._0x1e98b6[_0x5e9714(0x20b)]&&{'session_id':_0x1e98b6['sessionId']},..._0x1e98b6[_0x5e9714(0x2d7)]&&{'session_time':_0x1e98b6[_0x5e9714(0x2d7)]},..._0x1e98b6[_0x5e9714(0x1c8)]&&{'retry_attempt':_0x1e98b6[_0x5e9714(0x1c8)]},..._0x1b2763!==undefined&&{'duration_sec':_0x1b2763},..._0x1e98b6[_0x5e9714(0x2a2)]&&{'created_at':_0x1e98b6['createdAt']},..._0x1e98b6[_0x5e9714(0x2e4)]&&{'finished_at':_0x1e98b6[_0x5e9714(0x2e4)]},...Object[_0x5e9714(0x17a)](_0x1e98b6['params'])['length']>0x0&&{'params':_0x1e98b6[_0x5e9714(0x151)]}};return await handleSingleObjectOutput(_0xa97bd5,_0x21a724),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a42_0x271344(0x1bf)]=a42_0x271344(0x1ec);['description']=a42_0x271344(0x226);async[a42_0x271344(0x1ef)](_0x380d1f){const _0x546778=a42_0x271344,{options:_0x5711e7,args:_0x4e04d6,tdx:_0xcdf21c}=_0x380d1f,_0x4a6e75=_0x4e04d6[0x0];if(!_0x4a6e75)return console[_0x546778(0x1e2)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x30c768=_0x5711e7[_0x546778(0x266)];_0x5711e7[_0x546778(0x2cc)]&&(console['error']('Attempt\x20ID:\x20'+_0x4a6e75),_0x30c768&&console['error']('Including\x20subtasks:\x20yes'));const _0x4057de=await withSpinner(_0x546778(0x153),()=>_0xcdf21c[_0x546778(0x2b8)][_0x546778(0x258)](_0x4a6e75,_0x30c768||![]),{'verbose':_0x5711e7['verbose']}),_0x54111a=_0x4057de[_0x546778(0x1c3)];return console[_0x546778(0x1e2)](_0x546778(0x18a)+_0x54111a[_0x546778(0x152)]+_0x546778(0x1e8)+(_0x54111a[_0x546778(0x152)]!==0x1?'s':'')),await handleSDKOutput(_0x54111a,_0x5711e7),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a42_0x271344(0x1bf)]=a42_0x271344(0x2a4);['description']=a42_0x271344(0x172);async[a42_0x271344(0x1ef)](_0x2ffb81){const _0x46ff54=a42_0x271344,{options:_0x44f588,args:_0x550c32,tdx:_0x26e3b4}=_0x2ffb81,_0x34b7d6=_0x550c32[0x0];let _0x2af40a=_0x550c32[0x1];if(!_0x34b7d6)return console[_0x46ff54(0x1e2)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x44f588[_0x46ff54(0x2cc)]&&(console[_0x46ff54(0x1e2)]('Attempt\x20ID:\x20'+_0x34b7d6),_0x2af40a&&console[_0x46ff54(0x1e2)](_0x46ff54(0x19f)+_0x2af40a));const _0x18dc52=await withSpinner(_0x46ff54(0x148),()=>_0x26e3b4['workflow'][_0x46ff54(0x24a)](_0x34b7d6,_0x2af40a),{'verbose':_0x44f588[_0x46ff54(0x2cc)]}),_0xa17cf0=_0x18dc52['data'];if(_0xa17cf0[_0x46ff54(0x152)]===0x0)return console[_0x46ff54(0x1e2)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x2af40a&&(_0x44f588['json']||_0x44f588[_0x46ff54(0x2ed)]))return await handleSDKOutput(_0xa17cf0,_0x44f588),0x0;if(!_0x2af40a){const _0x222795=_0xa17cf0['map'](_0x24e890=>({'title':_0x24e890[_0x46ff54(0x237)]+'\x20('+formatBytes(_0x24e890[_0x46ff54(0x1a7)])+')','value':_0x24e890['taskName']})),_0x3c3fa8=await a42_0x5e9a1d({'type':'select','name':_0x46ff54(0x17c),'message':_0x46ff54(0x234),'choices':_0x222795});if(!_0x3c3fa8['task'])return console[_0x46ff54(0x1e2)](_0x46ff54(0x1e5)),0x0;_0x2af40a=_0x3c3fa8[_0x46ff54(0x17c)];}const _0x530fcd=await withSpinner('Downloading\x20logs...',()=>_0x26e3b4[_0x46ff54(0x2b8)][_0x46ff54(0x209)](_0x34b7d6,_0x2af40a),{'verbose':_0x44f588['verbose']}),_0x5a0813=_0x530fcd[_0x46ff54(0x1c3)];return _0x5a0813?console[_0x46ff54(0x295)](_0x5a0813):console[_0x46ff54(0x1e2)](_0x46ff54(0x16e)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a42_0x271344(0x1bf)]=a42_0x271344(0x284);[a42_0x271344(0x186)]=a42_0x271344(0x2aa);async[a42_0x271344(0x1ef)](_0x20108d){const _0xc8d50b=a42_0x271344,{options:_0x6746ff,args:_0x5e7228,tdx:_0x484099}=_0x20108d,_0xcebaa6=_0x5e7228[0x0];if(!_0xcebaa6)return console['error'](_0xc8d50b(0x19e)),0x1;const _0x3e9535=_0x6746ff[_0xc8d50b(0x198)];_0x6746ff[_0xc8d50b(0x2cc)]&&(console[_0xc8d50b(0x1e2)]('Attempt\x20ID:\x20'+_0xcebaa6),_0x3e9535&&console[_0xc8d50b(0x1e2)]('Reason:\x20'+_0x3e9535));if(!_0x6746ff[_0xc8d50b(0x169)]){if(!isInteractive())return console[_0xc8d50b(0x1e2)](a42_0x4cb0ba[_0xc8d50b(0x2eb)](_0xc8d50b(0x16f)),_0xc8d50b(0x1b4)),console['error'](a42_0x4cb0ba[_0xc8d50b(0x1fb)](_0xc8d50b(0x1cc))),0x1;const _0x20950e=await confirmKey(_0xc8d50b(0x233)+_0xcebaa6+'?');if(!_0x20950e)return console['error'](a42_0x4cb0ba['yellow'](_0xc8d50b(0x1e5))),0x1;}const _0x18e3b0=await withSpinner('Killing\x20attempt...',()=>_0x484099[_0xc8d50b(0x2b8)]['kill'](_0xcebaa6,_0x3e9535),{'verbose':_0x6746ff['verbose']}),_0x503606=_0x18e3b0[_0xc8d50b(0x1c3)];return console['error']('✔\x20'+_0x503606),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a42_0x271344(0x2ac);[a42_0x271344(0x186)]=a42_0x271344(0x1fe);async[a42_0x271344(0x1ef)](_0x1e2175){const _0x922142=a42_0x271344,{options:_0x32b04d,args:_0x3683b2,tdx:_0x2cd933}=_0x1e2175,_0x181857=_0x3683b2[0x0];if(!_0x181857)return console['error'](_0x922142(0x286)),console['error']('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x52f8ca=![],_0x13fb48=_0x181857;if(_0x181857['startsWith'](_0x922142(0x2d3)))_0x52f8ca=!![],_0x13fb48=_0x181857[_0x922142(0x29e)](0x8);else{if(_0x181857['startsWith'](_0x922142(0x1d4)))_0x52f8ca=![],_0x13fb48=_0x181857[_0x922142(0x29e)](0x8);else return console['error'](_0x922142(0x1ab)),console[_0x922142(0x1e2)](_0x922142(0x28d)),0x1;}const _0x516372=_0x32b04d[_0x922142(0x1a6)],_0x2927e6=_0x32b04d[_0x922142(0x2a5)],_0x17c05a=_0x32b04d[_0x922142(0x151)],_0x4ddaa1=_0x32b04d[_0x922142(0x1b7)];_0x32b04d[_0x922142(0x2cc)]&&(console['error'](_0x922142(0x1f9)+(_0x52f8ca?'session':_0x922142(0x1e6))+'\x20'+_0x13fb48),_0x516372&&console[_0x922142(0x1e2)]('From\x20task:\x20'+_0x516372),_0x2927e6&&console['error'](_0x922142(0x2c0)+_0x2927e6),_0x17c05a&&console[_0x922142(0x1e2)](_0x922142(0x23d)+_0x17c05a),_0x4ddaa1&&console['error'](_0x922142(0x2f1)));let _0x1dd5ad;if(_0x17c05a)try{if(_0x17c05a[_0x922142(0x253)]('@')){const _0x4c1b50=await import('fs/promises'),_0x247cb5=_0x17c05a[_0x922142(0x29e)](0x1),_0x490c1e=await _0x4c1b50[_0x922142(0x2a0)](_0x247cb5,_0x922142(0x241));_0x1dd5ad=JSON[_0x922142(0x1cb)](_0x490c1e);}else _0x1dd5ad=JSON[_0x922142(0x1cb)](_0x17c05a);}catch{return console[_0x922142(0x1e2)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x32b04d[_0x922142(0x169)]){if(!isInteractive())return console[_0x922142(0x1e2)](a42_0x4cb0ba['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x922142(0x1e2)](a42_0x4cb0ba['dim'](_0x922142(0x1cc))),0x1;const _0x10a94a=await confirmKey(_0x922142(0x251)+(_0x52f8ca?_0x922142(0x23a):_0x922142(0x1e6))+'\x20'+_0x13fb48+'?');if(!_0x10a94a)return console['error'](a42_0x4cb0ba[_0x922142(0x1c6)](_0x922142(0x1e5))),0x1;}let _0x45be42;_0x52f8ca?_0x45be42=await withSpinner('Retrying\x20session...',()=>_0x2cd933['workflow'][_0x922142(0x21e)](_0x13fb48,{'fromTask':_0x516372,'retryParams':_0x1dd5ad}),{'verbose':_0x32b04d[_0x922142(0x2cc)]}):_0x45be42=await withSpinner(_0x922142(0x275),()=>_0x2cd933[_0x922142(0x2b8)][_0x922142(0x1d9)](_0x13fb48,{'resumeFrom':_0x2927e6,'retryParams':_0x1dd5ad,'force':_0x4ddaa1}),{'verbose':_0x32b04d[_0x922142(0x2cc)]});const _0x1e824d=_0x45be42[_0x922142(0x1c3)];return console[_0x922142(0x1e2)]('✔\x20Retry\x20started'),console[_0x922142(0x1e2)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x1e824d[_0x922142(0x16d)]),console[_0x922142(0x1e2)](_0x922142(0x149)+_0x1e824d[_0x922142(0x20b)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a42_0x271344(0x1bf)]='workflow:run';[a42_0x271344(0x186)]='Start\x20a\x20workflow\x20run';async[a42_0x271344(0x1ef)](_0x4783b9){const _0x757681=a42_0x271344,{options:_0x572edf,args:_0x4dd736,tdx:_0x295830}=_0x4783b9;let _0x508d63=_0x4dd736[0x0];if(!_0x508d63){const _0x8b0f58=this[_0x757681(0x16a)]([],_0x572edf),_0x36efea=await withSpinner(_0x757681(0x26c),()=>_0x295830[_0x757681(0x2b8)][_0x757681(0x2f3)](_0x8b0f58,{'limit':_0x572edf[_0x757681(0x22c)]}),{'verbose':_0x572edf[_0x757681(0x2cc)]}),_0x38490e=_0x36efea[_0x757681(0x1c3)];if(_0x38490e[_0x757681(0x152)]===0x0)return console[_0x757681(0x1e2)](_0x757681(0x2dc)),!_0x8b0f58&&console['error'](a42_0x4cb0ba[_0x757681(0x1fb)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x21d356=_0x38490e[_0x757681(0x174)](_0x518255=>({'title':_0x518255['project']?.[_0x757681(0x1bf)]+'.'+_0x518255[_0x757681(0x1bf)],'value':_0x518255[_0x757681(0x24b)]?.[_0x757681(0x1bf)]+'.'+_0x518255['name'],'description':_0x518255[_0x757681(0x1f7)]?_0x757681(0x265)+_0x518255[_0x757681(0x1f7)]:undefined})),_0x1ba9fe=await a42_0x5e9a1d({'type':'select','name':_0x757681(0x2b8),'message':_0x757681(0x1ae),'choices':_0x21d356});if(!_0x1ba9fe[_0x757681(0x2b8)])return 0x1;_0x508d63=_0x1ba9fe[_0x757681(0x2b8)];}if(!_0x508d63[_0x757681(0x181)]('.')){const _0x3e8d1b=this[_0x757681(0x16a)]([],_0x572edf);if(_0x3e8d1b)_0x508d63=_0x3e8d1b+'.'+_0x508d63;else return console[_0x757681(0x1e2)](a42_0x4cb0ba[_0x757681(0x2eb)](_0x757681(0x29a)),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console[_0x757681(0x1e2)](a42_0x4cb0ba[_0x757681(0x1fb)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x8afa4e=_0x572edf[_0x757681(0x1bc)],_0x3524f6=_0x572edf[_0x757681(0x2d7)],_0x15cd64={};if(_0x8afa4e&&Array['isArray'](_0x8afa4e))for(const _0x3bcc8b of _0x8afa4e){const _0x4f430c=_0x3bcc8b['indexOf']('=');if(_0x4f430c===-0x1)return console['error'](_0x757681(0x2bd)+_0x3bcc8b),console[_0x757681(0x1e2)](_0x757681(0x2d9)),0x1;const _0x3d05d4=_0x3bcc8b[_0x757681(0x29e)](0x0,_0x4f430c),_0x56a6e2=_0x3bcc8b[_0x757681(0x29e)](_0x4f430c+0x1);try{_0x15cd64[_0x3d05d4]=JSON['parse'](_0x56a6e2);}catch{_0x15cd64[_0x3d05d4]=_0x56a6e2;}}_0x572edf[_0x757681(0x2cc)]&&(console[_0x757681(0x1e2)](_0x757681(0x1a4)+_0x508d63),Object[_0x757681(0x17a)](_0x15cd64)[_0x757681(0x152)]>0x0&&console[_0x757681(0x1e2)]('Parameters:\x20'+JSON[_0x757681(0x29b)](_0x15cd64)),_0x3524f6&&console[_0x757681(0x1e2)](_0x757681(0x264)+_0x3524f6));const _0x96a04b=await withSpinner('Starting\x20workflow\x20run...',()=>_0x295830[_0x757681(0x2b8)][_0x757681(0x1b0)](_0x508d63,_0x15cd64,{'sessionTime':_0x3524f6}),{'verbose':_0x572edf[_0x757681(0x2cc)]}),_0xe7baf2=_0x96a04b[_0x757681(0x1c3)];console[_0x757681(0x1e2)](_0x757681(0x14d)),console[_0x757681(0x1e2)](_0x757681(0x192)+_0xe7baf2['id']),console[_0x757681(0x1e2)](_0x757681(0x149)+_0xe7baf2[_0x757681(0x20b)]),console['error'](_0x757681(0x248)+_0xe7baf2['project']?.[_0x757681(0x1bf)]),console[_0x757681(0x1e2)](_0x757681(0x195)+_0xe7baf2['workflow']?.[_0x757681(0x1bf)]);if(_0xe7baf2[_0x757681(0x24b)]?.['id']&&_0xe7baf2[_0x757681(0x20b)]&&_0xe7baf2['id']){const _0x7a7ccc=_0x572edf['site'],_0x104148=getConsoleUrl(_0x7a7ccc,_0x757681(0x298)+_0xe7baf2[_0x757681(0x24b)]['id']+_0x757681(0x20e)+_0xe7baf2[_0x757681(0x20b)]+_0x757681(0x1fa)+_0xe7baf2['id']);console[_0x757681(0x1e2)](_0x757681(0x2ab)+a42_0x4cb0ba[_0x757681(0x27a)](_0x104148));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a42_0x271344(0x1bf)]=a42_0x271344(0x14c);['description']='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a42_0x271344(0x1ef)](_0xa2faf8){const _0x1259e3=a42_0x271344,{options:_0x385ce7,args:_0x136784,tdx:_0x57d176}=_0xa2faf8,_0xf6f47d=_0x136784[0x0],_0x56c363=_0x136784[0x1]||'.';if(!_0xf6f47d)return console['error'](_0x1259e3(0x289)),console['error'](_0x1259e3(0x269)),0x1;const _0x38f89c=_0x385ce7[_0x1259e3(0x1f7)];_0x385ce7['verbose']&&(console[_0x1259e3(0x1e2)]('Project:\x20'+_0xf6f47d),console[_0x1259e3(0x1e2)](_0x1259e3(0x2ba)+_0x56c363),_0x38f89c&&console[_0x1259e3(0x1e2)](_0x1259e3(0x229)+_0x38f89c));const _0x3ae907=await withSpinner('Downloading\x20project\x20'+_0xf6f47d+'...',()=>_0x57d176[_0x1259e3(0x2b8)][_0x1259e3(0x1de)](_0xf6f47d,_0x56c363,{'revision':_0x38f89c}),{'verbose':_0x385ce7[_0x1259e3(0x2cc)]}),_0x2097e3=_0x3ae907['data'];return console[_0x1259e3(0x1e2)](_0x1259e3(0x219)+_0x2097e3['projectName']),console['error'](_0x1259e3(0x1df)+_0x2097e3['revision']),console[_0x1259e3(0x1e2)](_0x1259e3(0x1e3)+_0x2097e3['filesExtracted']),console[_0x1259e3(0x1e2)]('\x20\x20Location:\x20'+_0x56c363+'/'+_0x2097e3[_0x1259e3(0x19a)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a42_0x271344(0x1bf)]=a42_0x271344(0x259);[a42_0x271344(0x186)]=a42_0x271344(0x217);async[a42_0x271344(0x1ef)](_0x479eef){const _0x5ab344=a42_0x271344,{options:_0x2834ff,args:_0x56c0b1,tdx:_0x5d9638}=_0x479eef;let _0x2bbc9d='.',_0x41ee06=_0x2834ff['name'];if(_0x56c0b1[0x0]){const {promises:_0x5d566e}=await import('fs');try{const _0x2c8f94=await _0x5d566e[_0x5ab344(0x1bb)](_0x56c0b1[0x0]);if(_0x2c8f94[_0x5ab344(0x270)]())_0x2bbc9d=_0x56c0b1[0x0];else return console[_0x5ab344(0x1e2)]('Error:\x20'+_0x56c0b1[0x0]+_0x5ab344(0x2da)),0x1;}catch{_0x41ee06=_0x56c0b1[0x0],_0x2bbc9d='.';}}const _0x32140c=_0x2834ff[_0x5ab344(0x1f7)],_0x3151e8=_0x2834ff[_0x5ab344(0x2ec)];_0x2834ff['verbose']&&(console['error']('Project\x20directory:\x20'+_0x2bbc9d),_0x41ee06&&console[_0x5ab344(0x1e2)](_0x5ab344(0x1d2)+_0x41ee06),_0x32140c&&console[_0x5ab344(0x1e2)](_0x5ab344(0x229)+_0x32140c),_0x3151e8&&console[_0x5ab344(0x1e2)](_0x5ab344(0x22f)));const _0x3722fb=await withSpinner(_0x5ab344(0x164),()=>_0x5d9638[_0x5ab344(0x2b8)][_0x5ab344(0x1ad)](_0x2bbc9d,{'projectName':_0x41ee06,'revision':_0x32140c,'skipValidation':_0x3151e8}),{'verbose':_0x2834ff[_0x5ab344(0x2cc)]}),_0x323ddd=_0x3722fb[_0x5ab344(0x1c3)];return console['error'](_0x5ab344(0x14b)+_0x323ddd[_0x5ab344(0x19a)]),console[_0x5ab344(0x1e2)]('\x20\x20Project\x20ID:\x20'+_0x323ddd[_0x5ab344(0x201)]),console[_0x5ab344(0x1e2)](_0x5ab344(0x1df)+_0x323ddd[_0x5ab344(0x1f7)]),await this[_0x5ab344(0x203)](_0x5d9638,_0x323ddd[_0x5ab344(0x19a)],_0x2834ff['site']),0x0;}}function a42_0x3fe2(){const _0x7d6bda=['/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','\x20\x20Changes:\x20','retrySession','site','\x20sessions\x20','has','\x0aDry\x20run\x20-\x20no\x20project\x20created','success','startTime','workflow:secrets:list','Show\x20tasks\x20for\x20an\x20attempt','Analyzing\x20changes...','buildTimelineData','Revision:\x20','-\x20nothing\x20pushed','✔\x20Push\x20complete','limit','list','63zdimhp','Validation:\x20skipped','running','✔\x20Secret\x20\x27','\x0aClone\x20\x22','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Select\x20a\x20task\x20to\x20view\x20logs:','localeCompare','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','taskName','→\x20New\x20project:\x20','No\x20sessions\x20found\x20for:\x20','session','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Listing\x20workflow\x20projects...','Params:\x20','resolve','Select\x20a\x20session\x20to\x20view\x20timeline:','done','utf-8','split','No\x20sessions\x20found','planned','Cloning\x20to\x20','fullName','join','\x20\x20Project:\x20','deleteSecret','logFiles','project','workflow:attempt','Listing\x20workflow\x20sessions...','unchanged','workflow:secrets:delete','getDate','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','workflow:pull','startsWith','canceling','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','tasks','workflow:upload','-\x20no\x20files\x20written','Listing\x20secrets...','min','Latest\x20session\x20has\x20no\x20attempt','Filter:\x20','now','columns','✔\x20Workflow\x20project\x20set\x20to:\x20','211722KBtmep','output','Session\x20time:\x20','revision:\x20','includeSubtasks','Attempt:\x20','summary','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','\x22?\x20This\x20cannot\x20be\x20undone.','toISOString','Loading\x20workflows...','targetExists','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','getMinutes','isDirectory','sourceDir','type','\x20\x20tdx\x20wf\x20use\x20<project>','Auto-selected\x20latest\x20session:\x20','Retrying\x20attempt...','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','\x20tasks','Writing\x20files...','Session\x20','cyan','POLL_INTERVAL_MS','Source\x20project:\x20','replace','No\x20workflow\x20sessions\x20found','\x20secret','padStart','\x1b[1A\x1b[2K','21RcxCYH','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','workflow:kill','35512YeEioN','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','No\x20sessions\x20with\x20timing\x20information','filter','Error:\x20Project\x20name\x20is\x20required','\x20new','workflow:push','Updating\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Target\x20directory:\x20','Listing\x20workflows...','⚠\x20Showing\x20first\x20','Loading\x20session...','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','unknown','workflow:projects','log','dryRun','\x0a✔\x20No\x20changes\x20to\x20push','/app/workflows/','workflow:clone','Error:','stringify','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','substring','\x20modified','readFile','...','createdAt','\x0aFailed\x20to\x20fetch\x20attempt\x20data','workflow:logs','resumeFrom','end','✔\x20Showing\x20','modified','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Kill\x20a\x20running\x20attempt','\x20\x20Console:\x20','workflow:retry','ICON_WIDTH','1313156OECZpN','\x20(system)','\x20\x20Source:\x20','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','\x20to\x20see\x20detailed\x20logs','getMonth','find','pullProject','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','✔\x20Project\x20updated','workflow','MAX_POLL_ITERATIONS','Output\x20directory:\x20','\x0aPolling...\x20(','MIN_TIMELINE_WIDTH','Error:\x20Invalid\x20parameter\x20format:\x20','892825QHPdTj','New\x20project\x20name:\x20','Resume\x20from:\x20','renderSingleTimeline','Source:\x20','getTime','Warning:','📋\x20','getFullYear','Listing\x20workflow\x20attempts...','Pushing\x20project...','path','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','durationMs','verbose','Files\x20to\x20upload:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','executeCloneProject','Loading\x20sessions...','Analyzing\x20project...','from','session:','(use\x20--limit\x20to\x20see\x20more)',',\x20Workflow:\x20','\x20(use\x20--limit\x20to\x20show\x20more)','sessionTime','blue','Expected\x20format:\x20--param\x20key=value','\x20is\x20not\x20a\x20directory','newProjectName','No\x20workflows\x20found','Key\x20cannot\x20be\x20empty','workflow:timeline','Show\x20specific\x20attempt\x20details','MAX_LABEL_COUNT','diff','✔\x20Deleted\x20project\x20','clear','finishedAt','workflowProject','56799WFvvra','Error:\x20Secret\x20key\x20is\x20required','workflow:attempts','(unknown)','pending','red','skipValidation','format','autocomplete','Getting\x20attempt\x20details...','MAX_TASKS_DISPLAY','Force:\x20yes','cancelRequested','workflows','Usage:\x20workflow:delete\x20<project-name-or-id>','title','rows','Fetching\x20log\x20files...','\x20\x20Session\x20ID:\x20','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','✔\x20Pushed\x20','workflow:download','✔\x20Workflow\x20run\x20started','MAX_TIMELINE_WIDTH','white','prepareCloneProject','params','length','Getting\x20attempt\x20tasks...','set','Setting\x20secret...','existingProjectId','\x0aPush\x20these\x20changes?','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','Project\x20filter:\x20','No\x20attempts\x20found','parseProjectWorkflowPattern','sessions','match','Error:\x20KEY=VALUE\x20is\x20required','No\x20workflows\x20found\x20in\x20project:\x20','\x20deleted','\x22\x20to\x20new\x20project\x20\x22','LABEL_MIN_SPACING','message','Pushing\x20workflow\x20project...','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','fileCount','text','msPerChar','yes','resolveProject','resolveProjectDir','table','attemptId','No\x20log\x20content\x20found','\x0aError:','Project\x20name\x20is\x20required','trimEnd','Show\x20logs\x20for\x20a\x20workflow\x20attempt','jsonl','map','renderSessionsTimeline','pollTimeline','Pulling\x20project\x20','group_error','\x0aDry\x20run\x20-\x20no\x20files\x20written','keys','No\x20attempts\x20found\x20in\x20project:\x20','task','every','values','updatedAt','workflow:secrets:set','includes','\x20unchanged','displayLine','---\x20','ICON_SPACING','description','✔\x20Pull\x20complete','repeat','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','✔\x20Found\x20','\x27\x20from\x20project\x20\x27','lastAttempt','tdx\x20wf\x20attempt\x20','9408850cgkaJk','Using\x20attempt\x20','Tip:\x20cd\x20to\x20workflows/','\x22\x20with\x20new\x20revision?','\x20\x20Attempt\x20ID:\x20','follow','trim','\x20\x20Workflow:\x20','delete','Source\x20directory\x20is\x20required','reason','Key:\x20','projectName','🔄\x20','json','List\x20workflow\x20execution\x20sessions','Error:\x20Attempt\x20ID\x20is\x20required','Task\x20name:\x20','requireProject','\x20-\x20','sys','workflow:workflows','Workflow:\x20','Source\x20directory:\x20','fromTask','fileSize','Invalid\x20format:\x20','basename','List\x20workflow\x20attempts','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','getHours','push','Select\x20a\x20workflow\x20to\x20run','toLowerCase','run','\x20\x20Session\x20context\x20set\x20to:\x20','window','13402JDkkPu','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','state','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','force','List\x20workflows','some','startedAt','stat','param','all','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','name','max','\x27...','targetDir','data','\x22\x20already\x20exists\x20(ID:\x20','navigateSessionsInteractive','yellow','Pull\x20workflow\x20project\x20to\x20local\x20folder','retryAttemptName','\x20has\x20no\x20attempts','\x20\x20Location:\x20','parse','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','sort','size','relative','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','💡\x20Tip:\x20Use\x20','Project\x20name:\x20','key','attempt:','\x0a✔\x20Attempt\x20complete','deleted','Total:\x20','listSecrets','retryAttempt','isTTY','\x20from\x20session\x20','fill','workflow:use','download','\x20\x20Revision:\x20','cwd','indexOf','error','\x20\x20Files\x20extracted:\x20','Project:\x20','Cancelled','attempt','No\x20workflow\x20tdx.json\x20found','\x20task','\x20session','369SksvTq','status','workflow:tasks','\x0aUpdate\x20existing\x20project\x20\x22','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','execute','\x0a✔\x20Already\x20up\x20to\x20date','sourceProjectName','\x20\x20Project\x20ID:\x20','write','floor','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','start','revision','value','Target:\x20','/attempt/','dim','GUTTER','duration','Retry\x20a\x20session\x20or\x20attempt','green','No\x20sessions\x20found\x20in\x20project:\x20','projectId','attempts','showWorkflowConsoleUrl','✔\x20Project:\x20','generateSessionTimelineRows','stdout','Filter:\x20project=','metadata','logs','Session\x20not\x20found:\x20','sessionId','\x20workflow','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','/sessions/','→\x20Project:\x20','get','workflow:sessions','\x0a⚠\x20Project\x20\x22','slice','index','TASK_NAME_WIDTH','renderTimeline','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Dry\x20run:\x20yes','✔\x20Downloaded\x20','includeRetried','splice'];a42_0x3fe2=function(){return _0x7d6bda;};return a42_0x3fe2();}export class WorkflowPullCommand extends BaseCommand{['name']=a42_0x271344(0x252);['description']=a42_0x271344(0x1c7);async[a42_0x271344(0x1ef)](_0x1978aa){const _0x4f1c5c=a42_0x271344,{options:_0xceb75a,args:_0x20262d,tdx:_0x1efb44}=_0x1978aa,_0x1e21be=_0x20262d[0x0],_0x59bc4a=_0x20262d[0x1];if(!_0x1e21be)return console[_0x4f1c5c(0x1e2)](a42_0x4cb0ba[_0x4f1c5c(0x2eb)]('Error:'),_0x4f1c5c(0x170)),console[_0x4f1c5c(0x1e2)](a42_0x4cb0ba['dim'](_0x4f1c5c(0x2ca))),0x1;const _0xd119d9=_0xceb75a[_0x4f1c5c(0x1f7)];_0xceb75a[_0x4f1c5c(0x2cc)]&&(console[_0x4f1c5c(0x1e2)](_0x4f1c5c(0x1e4)+_0x1e21be),_0x59bc4a&&console[_0x4f1c5c(0x1e2)](_0x4f1c5c(0x28e)+_0x59bc4a),_0xd119d9&&console[_0x4f1c5c(0x1e2)](_0x4f1c5c(0x229)+_0xd119d9),_0xceb75a[_0x4f1c5c(0x296)]&&console['error'](_0x4f1c5c(0x218)));const _0x1e2fe5=await withSpinner(_0x4f1c5c(0x177)+_0x1e21be+_0x4f1c5c(0x2a1),()=>_0x1efb44[_0x4f1c5c(0x2b8)][_0x4f1c5c(0x2b5)](_0x1e21be,{'targetDir':_0x59bc4a,'revision':_0xd119d9}),{'verbose':_0xceb75a['verbose']}),_0x1de765=_0x1e2fe5['data'];_0x1de765['isNewProject']?console[_0x4f1c5c(0x1e2)](_0x4f1c5c(0x238)+_0x1de765[_0x4f1c5c(0x19a)]):console[_0x4f1c5c(0x1e2)](_0x4f1c5c(0x20f)+_0x1de765[_0x4f1c5c(0x19a)]);console[_0x4f1c5c(0x1e2)](_0x4f1c5c(0x1df)+_0x1de765['revision']),console['error']('\x20\x20Target:\x20'+(a42_0xff53de[_0x4f1c5c(0x1cf)](process[_0x4f1c5c(0x1e0)](),_0x1de765[_0x4f1c5c(0x1c2)])||'.')),console['error'](_0x4f1c5c(0x21d)+a42_0x4cb0ba[_0x4f1c5c(0x1ff)]('+'+_0x1de765[_0x4f1c5c(0x268)]['new']+_0x4f1c5c(0x28a))+',\x20'+(a42_0x4cb0ba[_0x4f1c5c(0x1c6)]('~'+_0x1de765['summary']['modified']+_0x4f1c5c(0x29f))+',\x20')+(a42_0x4cb0ba[_0x4f1c5c(0x2eb)]('-'+_0x1de765[_0x4f1c5c(0x268)]['deleted']+_0x4f1c5c(0x160))+',\x20')+(''+a42_0x4cb0ba[_0x4f1c5c(0x1fb)](_0x1de765['summary'][_0x4f1c5c(0x24e)]+_0x4f1c5c(0x182))));for(const _0xa347f9 of _0x1de765['changes']){_0xa347f9[_0x4f1c5c(0x272)]===_0x4f1c5c(0x2a8)&&_0xa347f9[_0x4f1c5c(0x2e1)]&&(console[_0x4f1c5c(0x1e2)]('\x0a'+a42_0x4cb0ba[_0x4f1c5c(0x27a)](_0x4f1c5c(0x184)+_0xa347f9[_0x4f1c5c(0x2c9)])),console[_0x4f1c5c(0x1e2)](_0xa347f9[_0x4f1c5c(0x2e1)]));}if(!_0x1de765['hasChanges'])return saveSessionContext({'workflow_project':_0x1de765[_0x4f1c5c(0x19a)]},_0xceb75a[_0x4f1c5c(0x23a)]),console[_0x4f1c5c(0x1e2)](a42_0x4cb0ba[_0x4f1c5c(0x1ff)](_0x4f1c5c(0x1f0))),console['error'](a42_0x4cb0ba[_0x4f1c5c(0x1fb)](_0x4f1c5c(0x1b1)+_0x1de765[_0x4f1c5c(0x19a)])),0x0;if(_0xceb75a[_0x4f1c5c(0x296)])return console[_0x4f1c5c(0x1e2)](a42_0x4cb0ba[_0x4f1c5c(0x1c6)](_0x4f1c5c(0x179))),0x0;if(!_0xceb75a[_0x4f1c5c(0x169)]){if(!isInteractive())return console[_0x4f1c5c(0x1e2)](a42_0x4cb0ba['red'](_0x4f1c5c(0x16f)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4f1c5c(0x1e2)](a42_0x4cb0ba[_0x4f1c5c(0x1fb)](_0x4f1c5c(0x1cc))),0x1;const _0x55a129=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x55a129)return console['error'](a42_0x4cb0ba[_0x4f1c5c(0x1c6)](_0x4f1c5c(0x1e5)),_0x4f1c5c(0x25a)),0x1;}await withSpinner(_0x4f1c5c(0x278),()=>_0x1efb44['workflow']['applyPullProject'](_0x1de765,{'revision':_0xd119d9}),{'verbose':_0xceb75a['verbose']}),saveSessionContext({'workflow_project':_0x1de765[_0x4f1c5c(0x19a)]},_0xceb75a[_0x4f1c5c(0x23a)]),console[_0x4f1c5c(0x1e2)](a42_0x4cb0ba[_0x4f1c5c(0x1ff)](_0x4f1c5c(0x187)));const _0x1272e2=a42_0xff53de[_0x4f1c5c(0x1cf)](process['cwd'](),_0x1de765[_0x4f1c5c(0x1c2)])||'.';return console[_0x4f1c5c(0x1e2)](a42_0x4cb0ba[_0x4f1c5c(0x1fb)](_0x4f1c5c(0x1ca)+_0x1272e2)),console[_0x4f1c5c(0x1e2)](a42_0x4cb0ba[_0x4f1c5c(0x1fb)](_0x4f1c5c(0x1b1)+_0x1de765[_0x4f1c5c(0x19a)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a42_0x271344(0x1bf)]=a42_0x271344(0x28b);['description']=a42_0x271344(0x23b);async['execute'](_0x1dd9f6){const _0x4dcd79=a42_0x271344,{options:_0x3cbde4,args:_0x4a1079,tdx:_0x402740}=_0x1dd9f6,_0x33e555=this[_0x4dcd79(0x16b)](_0x4a1079,_0x3cbde4),_0x388dce=_0x3cbde4['revision'],_0x43811f=_0x3cbde4[_0x4dcd79(0x2ec)];_0x3cbde4[_0x4dcd79(0x2cc)]&&(_0x33e555&&console[_0x4dcd79(0x1e2)](_0x4dcd79(0x1a5)+_0x33e555),_0x388dce&&console['error'](_0x4dcd79(0x229)+_0x388dce),_0x3cbde4[_0x4dcd79(0x296)]&&console[_0x4dcd79(0x1e2)](_0x4dcd79(0x218)),_0x43811f&&console['error'](_0x4dcd79(0x22f)));let _0x1e731b;try{_0x1e731b=await withSpinner(_0x4dcd79(0x227),()=>_0x402740['workflow']['preparePushProject']({'sourceDir':_0x33e555,'revision':_0x388dce,'skipValidation':_0x43811f}),{'verbose':_0x3cbde4[_0x4dcd79(0x2cc)]});}catch(_0x1e85ae){if(_0x1e85ae instanceof Error&&_0x1e85ae[_0x4dcd79(0x163)][_0x4dcd79(0x181)](_0x4dcd79(0x1e7)))return console[_0x4dcd79(0x1e2)](a42_0x4cb0ba['red'](_0x4dcd79(0x29a)),_0x4dcd79(0x256)),_0x3cbde4[_0x4dcd79(0x2e5)]?console[_0x4dcd79(0x1e2)](a42_0x4cb0ba['dim'](_0x4dcd79(0x190)+_0x3cbde4[_0x4dcd79(0x2e5)]+_0x4dcd79(0x21c)+_0x3cbde4[_0x4dcd79(0x2e5)]+'\x27')):console[_0x4dcd79(0x1e2)](a42_0x4cb0ba[_0x4dcd79(0x1fb)](_0x4dcd79(0x158))),0x1;throw _0x1e85ae;}const _0x492b6c=_0x1e731b['data'];console['error'](_0x4dcd79(0x204)+_0x492b6c[_0x4dcd79(0x19a)]),console[_0x4dcd79(0x1e2)](_0x4dcd79(0x2b0)+_0x492b6c[_0x4dcd79(0x271)]),console[_0x4dcd79(0x1e2)](_0x4dcd79(0x1df)+_0x492b6c[_0x4dcd79(0x1f7)]),console[_0x4dcd79(0x1e2)]('\x20\x20Changes:\x20'+a42_0x4cb0ba[_0x4dcd79(0x1ff)]('+'+_0x492b6c[_0x4dcd79(0x268)]['new']+_0x4dcd79(0x28a))+',\x20'+(a42_0x4cb0ba[_0x4dcd79(0x1c6)]('~'+_0x492b6c[_0x4dcd79(0x268)][_0x4dcd79(0x2a8)]+_0x4dcd79(0x29f))+',\x20')+(a42_0x4cb0ba[_0x4dcd79(0x2eb)]('-'+_0x492b6c[_0x4dcd79(0x268)][_0x4dcd79(0x1d6)]+'\x20deleted')+',\x20')+(''+a42_0x4cb0ba[_0x4dcd79(0x1fb)](_0x492b6c['summary']['unchanged']+'\x20unchanged')));for(const _0x4de858 of _0x492b6c['changes']){_0x4de858[_0x4dcd79(0x272)]==='modified'&&_0x4de858[_0x4dcd79(0x2e1)]&&(console[_0x4dcd79(0x1e2)]('\x0a'+a42_0x4cb0ba[_0x4dcd79(0x27a)](_0x4dcd79(0x184)+_0x4de858[_0x4dcd79(0x2c9)])),console['error'](_0x4de858[_0x4dcd79(0x2e1)]));}if(!_0x492b6c['hasChanges'])return console[_0x4dcd79(0x1e2)](a42_0x4cb0ba[_0x4dcd79(0x1ff)](_0x4dcd79(0x297))),await this[_0x4dcd79(0x203)](_0x402740,_0x492b6c['projectName'],_0x3cbde4[_0x4dcd79(0x21f)]),0x0;if(_0x3cbde4['dryRun'])return console[_0x4dcd79(0x1e2)](a42_0x4cb0ba['yellow']('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x3cbde4[_0x4dcd79(0x169)]){if(!isInteractive())return console['error'](a42_0x4cb0ba[_0x4dcd79(0x2eb)](_0x4dcd79(0x16f)),_0x4dcd79(0x1b4)),console[_0x4dcd79(0x1e2)](a42_0x4cb0ba[_0x4dcd79(0x1fb)](_0x4dcd79(0x1cc))),0x1;const _0x4c1a3c=await confirmKey(_0x4dcd79(0x157));if(!_0x4c1a3c)return console[_0x4dcd79(0x1e2)](a42_0x4cb0ba[_0x4dcd79(0x1c6)](_0x4dcd79(0x1e5)),_0x4dcd79(0x22a)),0x1;}const _0x19ff18=await withSpinner(_0x4dcd79(0x2c8),()=>_0x402740[_0x4dcd79(0x2b8)]['executePushProject'](_0x492b6c),{'verbose':_0x3cbde4[_0x4dcd79(0x2cc)]}),_0x5803c0=_0x19ff18[_0x4dcd79(0x1c3)];return console[_0x4dcd79(0x1e2)](a42_0x4cb0ba[_0x4dcd79(0x1ff)](_0x4dcd79(0x22b))),console[_0x4dcd79(0x1e2)](_0x4dcd79(0x1f2)+_0x5803c0[_0x4dcd79(0x201)]),console[_0x4dcd79(0x1e2)](_0x4dcd79(0x1df)+_0x5803c0['revision']),await this['showWorkflowConsoleUrl'](_0x402740,_0x5803c0[_0x4dcd79(0x19a)],_0x3cbde4['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a42_0x271344(0x1bf)]=a42_0x271344(0x299);[a42_0x271344(0x186)]=a42_0x271344(0x283);async[a42_0x271344(0x1ef)](_0x3ae30d){const _0x8d75f1=a42_0x271344,{options:_0x586b15,args:_0x3ccd1a,tdx:_0x1c122d}=_0x3ae30d,_0x24f9e8=this['resolveProjectDir'](_0x3ccd1a,_0x586b15),_0x6fc0fd=_0x586b15[_0x8d75f1(0x1bf)],_0x44d177=_0x586b15[_0x8d75f1(0x1f7)],_0x5148ab=_0x586b15[_0x8d75f1(0x2ec)];if(!_0x24f9e8)return console[_0x8d75f1(0x1e2)](a42_0x4cb0ba[_0x8d75f1(0x2eb)](_0x8d75f1(0x29a)),_0x8d75f1(0x197)),console[_0x8d75f1(0x1e2)](a42_0x4cb0ba[_0x8d75f1(0x1fb)](_0x8d75f1(0x1f5))),console['error'](a42_0x4cb0ba[_0x8d75f1(0x1fb)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x6fc0fd)return console[_0x8d75f1(0x1e2)](a42_0x4cb0ba[_0x8d75f1(0x2eb)](_0x8d75f1(0x29a)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console['error'](a42_0x4cb0ba[_0x8d75f1(0x1fb)](_0x8d75f1(0x1f5))),0x1;_0x586b15[_0x8d75f1(0x2cc)]&&(console['error'](_0x8d75f1(0x1a5)+_0x24f9e8),console['error'](_0x8d75f1(0x2bf)+_0x6fc0fd),_0x44d177&&console[_0x8d75f1(0x1e2)](_0x8d75f1(0x229)+_0x44d177),_0x586b15[_0x8d75f1(0x296)]&&console[_0x8d75f1(0x1e2)](_0x8d75f1(0x218)),_0x5148ab&&console['error']('Validation:\x20skipped'));const _0x2c89e3=await withSpinner(_0x8d75f1(0x2d1),()=>_0x1c122d[_0x8d75f1(0x2b8)][_0x8d75f1(0x150)](_0x24f9e8,_0x6fc0fd,{'revision':_0x44d177,'skipValidation':_0x5148ab}),{'verbose':_0x586b15['verbose']}),_0x2b50bb=_0x2c89e3[_0x8d75f1(0x1c3)];console['error'](_0x8d75f1(0x2c2)+_0x2b50bb[_0x8d75f1(0x271)]);_0x2b50bb[_0x8d75f1(0x1f1)]&&console[_0x8d75f1(0x1e2)](_0x8d75f1(0x27c)+_0x2b50bb[_0x8d75f1(0x1f1)]);console['error'](_0x8d75f1(0x2bf)+_0x2b50bb[_0x8d75f1(0x2db)]),console[_0x8d75f1(0x1e2)](_0x8d75f1(0x229)+_0x2b50bb[_0x8d75f1(0x1f7)]),console[_0x8d75f1(0x1e2)](_0x8d75f1(0x2cd)+_0x2b50bb[_0x8d75f1(0x166)]);_0x2b50bb[_0x8d75f1(0x26d)]&&(console[_0x8d75f1(0x1e2)](a42_0x4cb0ba[_0x8d75f1(0x1c6)](_0x8d75f1(0x212)+_0x2b50bb[_0x8d75f1(0x2db)]+_0x8d75f1(0x1c4)+_0x2b50bb[_0x8d75f1(0x156)]+')')),console[_0x8d75f1(0x1e2)](a42_0x4cb0ba[_0x8d75f1(0x1c6)](_0x8d75f1(0x1ee))));if(_0x586b15['dryRun'])return console[_0x8d75f1(0x1e2)](a42_0x4cb0ba[_0x8d75f1(0x1c6)](_0x8d75f1(0x222))),0x0;if(!_0x586b15[_0x8d75f1(0x169)]){if(!isInteractive())return console[_0x8d75f1(0x1e2)](a42_0x4cb0ba[_0x8d75f1(0x2eb)](_0x8d75f1(0x16f)),_0x8d75f1(0x1b4)),console[_0x8d75f1(0x1e2)](a42_0x4cb0ba['dim'](_0x8d75f1(0x1cc))),0x1;const _0x2a3898=_0x2b50bb[_0x8d75f1(0x1f1)]||a42_0xff53de[_0x8d75f1(0x1a9)](_0x24f9e8),_0xce9c9f=_0x2b50bb[_0x8d75f1(0x26d)]?_0x8d75f1(0x1ed)+_0x6fc0fd+_0x8d75f1(0x191):_0x8d75f1(0x232)+_0x2a3898+_0x8d75f1(0x161)+_0x6fc0fd+'\x22?',_0x2f11b4=await confirmKey(_0xce9c9f);if(!_0x2f11b4)return console[_0x8d75f1(0x1e2)](a42_0x4cb0ba[_0x8d75f1(0x1c6)](_0x8d75f1(0x1e5))),0x1;}const _0x483277=await withSpinner(_0x2b50bb[_0x8d75f1(0x26d)]?_0x8d75f1(0x28c)+_0x6fc0fd+'...':_0x8d75f1(0x245)+_0x6fc0fd+_0x8d75f1(0x2a1),()=>_0x1c122d[_0x8d75f1(0x2b8)][_0x8d75f1(0x2cf)](_0x2b50bb),{'verbose':_0x586b15[_0x8d75f1(0x2cc)]}),_0x17d9c7=_0x483277['data'];return console[_0x8d75f1(0x1e2)](a42_0x4cb0ba[_0x8d75f1(0x1ff)](_0x2b50bb[_0x8d75f1(0x26d)]?_0x8d75f1(0x2b7):'✔\x20Clone\x20complete')),console[_0x8d75f1(0x1e2)](_0x8d75f1(0x248)+_0x17d9c7[_0x8d75f1(0x2db)]),console[_0x8d75f1(0x1e2)](_0x8d75f1(0x1f2)+_0x17d9c7['newProjectId']),console['error']('\x20\x20Revision:\x20'+_0x17d9c7[_0x8d75f1(0x1f7)]),await this[_0x8d75f1(0x203)](_0x1c122d,_0x17d9c7['newProjectName'],_0x586b15[_0x8d75f1(0x21f)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a42_0x271344(0x1bf)]='workflow:delete';[a42_0x271344(0x186)]=a42_0x271344(0x292);async[a42_0x271344(0x1ef)](_0x378e5c){const _0x14d91a=a42_0x271344,{options:_0x4b5fd6,args:_0x2711b6,tdx:_0x43e5f0}=_0x378e5c,_0x515f37=_0x2711b6[0x0];if(!_0x515f37)return console[_0x14d91a(0x1e2)](_0x14d91a(0x14a)),console['error'](_0x14d91a(0x2f4)),0x1;_0x4b5fd6[_0x14d91a(0x2cc)]&&console[_0x14d91a(0x1e2)](_0x14d91a(0x1e4)+_0x515f37);if(!_0x4b5fd6['yes']){if(!isInteractive())return console[_0x14d91a(0x1e2)](a42_0x4cb0ba[_0x14d91a(0x2eb)](_0x14d91a(0x16f)),_0x14d91a(0x1b4)),console[_0x14d91a(0x1e2)](a42_0x4cb0ba[_0x14d91a(0x1fb)](_0x14d91a(0x1cc))),0x1;const _0x4a98a9=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x515f37+_0x14d91a(0x26a));if(!_0x4a98a9)return console['error'](a42_0x4cb0ba[_0x14d91a(0x1c6)](_0x14d91a(0x1e5))),0x1;}const _0x19a0fe=await withSpinner('Deleting\x20project\x20'+_0x515f37+'...',()=>_0x43e5f0[_0x14d91a(0x2b8)][_0x14d91a(0x196)](_0x515f37),{'verbose':_0x4b5fd6[_0x14d91a(0x2cc)]}),_0x58f3cf=_0x19a0fe[_0x14d91a(0x1c3)];return console[_0x14d91a(0x1e2)](_0x14d91a(0x2e2)+_0x58f3cf[_0x14d91a(0x19a)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x58f3cf[_0x14d91a(0x201)]),0x0;}}export function parseKeyValue(_0x367e0c){const _0x107742=a42_0x271344,_0x4a2a01=_0x367e0c[_0x107742(0x1e1)]('=');if(_0x4a2a01===-0x1)throw new Error(_0x107742(0x1a8)+_0x367e0c+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x20b31c=_0x367e0c['substring'](0x0,_0x4a2a01),_0x422882=_0x367e0c[_0x107742(0x29e)](_0x4a2a01+0x1);if(!_0x20b31c)throw new Error(_0x107742(0x2dd));return{'key':_0x20b31c,'value':_0x422882};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a42_0x271344(0x1bf)]=a42_0x271344(0x225);[a42_0x271344(0x186)]=a42_0x271344(0x257);async[a42_0x271344(0x1ef)](_0x320f1e){const _0x3d5376=a42_0x271344,{options:_0x5b1175,args:_0x58cca7,tdx:_0x677ae5}=_0x320f1e,_0x35721d=this[_0x3d5376(0x1a0)](_0x58cca7,_0x5b1175);if(!_0x35721d)return 0x1;_0x5b1175[_0x3d5376(0x2cc)]&&console[_0x3d5376(0x1e2)](_0x3d5376(0x1e4)+_0x35721d);const _0x487041=await withSpinner(_0x3d5376(0x25b),()=>_0x677ae5[_0x3d5376(0x2b8)][_0x3d5376(0x1d8)](_0x35721d),{'verbose':_0x5b1175[_0x3d5376(0x2cc)]}),{secrets:_0x19c9b3}=_0x487041[_0x3d5376(0x1c3)];return console[_0x3d5376(0x1e2)](_0x3d5376(0x18a)+_0x19c9b3[_0x3d5376(0x152)]+_0x3d5376(0x27f)+(_0x19c9b3['length']!==0x1?'s':'')),await handleSDKOutput(_0x19c9b3,_0x5b1175),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a42_0x271344(0x1bf)]=a42_0x271344(0x180);[a42_0x271344(0x186)]=a42_0x271344(0x2b1);async[a42_0x271344(0x1ef)](_0x17f5ad){const _0x4be3a3=a42_0x271344,{options:_0x38aafd,args:_0xcf610c,tdx:_0x2371d8}=_0x17f5ad;let _0x1d7c47,_0x4ad674;if(_0xcf610c[_0x4be3a3(0x152)]>=0x2)_0x1d7c47=_0xcf610c[0x0],_0x4ad674=_0xcf610c[0x1];else{if(_0xcf610c[_0x4be3a3(0x152)]===0x1&&_0x38aafd['workflowProject'])_0x1d7c47=_0x38aafd['workflowProject'],_0x4ad674=_0xcf610c[0x0];else return _0xcf610c[_0x4be3a3(0x152)]===0x1?(console[_0x4be3a3(0x1e2)](_0x4be3a3(0x289)),console[_0x4be3a3(0x1e2)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x4be3a3(0x1e2)](_0x4be3a3(0x15e)),console['error'](_0x4be3a3(0x165)),0x1);}let _0x342edf,_0x52f58f;try{({key:_0x342edf,value:_0x52f58f}=parseKeyValue(_0x4ad674));}catch(_0x304390){return _0x304390 instanceof Error&&console[_0x4be3a3(0x1e2)](a42_0x4cb0ba[_0x4be3a3(0x2eb)](_0x4be3a3(0x29a)),_0x304390[_0x4be3a3(0x163)]),0x1;}_0x38aafd[_0x4be3a3(0x2cc)]&&(console[_0x4be3a3(0x1e2)](_0x4be3a3(0x1e4)+_0x1d7c47),console[_0x4be3a3(0x1e2)](_0x4be3a3(0x199)+_0x342edf));const _0x144118=await withSpinner(_0x4be3a3(0x155),()=>_0x2371d8[_0x4be3a3(0x2b8)]['setSecret'](_0x1d7c47,_0x342edf,_0x52f58f),{'verbose':_0x38aafd['verbose']}),_0x36d24a=_0x144118[_0x4be3a3(0x1c3)];return console[_0x4be3a3(0x1e2)](_0x4be3a3(0x231)+_0x36d24a[_0x4be3a3(0x1d3)]+_0x4be3a3(0x255)+_0x36d24a[_0x4be3a3(0x19a)]+'\x27'),(_0x38aafd[_0x4be3a3(0x19c)]||_0x38aafd['jsonl'])&&await handleSingleObjectOutput(_0x36d24a,_0x38aafd),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a42_0x271344(0x1bf)]=a42_0x271344(0x24f);[a42_0x271344(0x186)]='Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project';async[a42_0x271344(0x1ef)](_0x5283eb){const _0x5cac0=a42_0x271344,{options:_0x5441a8,args:_0x440215,tdx:_0x489e50}=_0x5283eb;let _0x44fa92,_0x20bc81;if(_0x440215[_0x5cac0(0x152)]>=0x2)_0x44fa92=_0x440215[0x0],_0x20bc81=_0x440215[0x1];else{if(_0x440215['length']===0x1&&_0x5441a8[_0x5cac0(0x2e5)])_0x44fa92=_0x5441a8['workflowProject'],_0x20bc81=_0x440215[0x0];else return _0x440215[_0x5cac0(0x152)]===0x1?(console[_0x5cac0(0x1e2)]('Error:\x20Project\x20name\x20is\x20required'),console['error']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x5cac0(0x1e2)](_0x5cac0(0x2e7)),console[_0x5cac0(0x1e2)]('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x5441a8[_0x5cac0(0x2cc)]&&(console[_0x5cac0(0x1e2)](_0x5cac0(0x1e4)+_0x44fa92),console['error'](_0x5cac0(0x199)+_0x20bc81));if(!_0x5441a8['yes']){if(!isInteractive())return console[_0x5cac0(0x1e2)](a42_0x4cb0ba[_0x5cac0(0x2eb)]('\x0aError:'),_0x5cac0(0x1b4)),console['error'](a42_0x4cb0ba[_0x5cac0(0x1fb)](_0x5cac0(0x1cc))),0x1;const _0x19123a=await confirmKey(_0x5cac0(0x2ce)+_0x20bc81+_0x5cac0(0x18b)+_0x44fa92+'\x27?');if(!_0x19123a)return console[_0x5cac0(0x1e2)](a42_0x4cb0ba['yellow'](_0x5cac0(0x1e5))),0x1;}const _0xd63a90=await withSpinner('Deleting\x20secret...',()=>_0x489e50[_0x5cac0(0x2b8)][_0x5cac0(0x249)](_0x44fa92,_0x20bc81),{'verbose':_0x5441a8[_0x5cac0(0x2cc)]}),_0x5803f9=_0xd63a90[_0x5cac0(0x1c3)];return console['error'](_0x5cac0(0x231)+_0x5803f9[_0x5cac0(0x1d3)]+_0x5cac0(0x29c)+_0x5803f9[_0x5cac0(0x19a)]+'\x27'),(_0x5441a8['json']||_0x5441a8[_0x5cac0(0x173)])&&await handleSingleObjectOutput(_0x5803f9,_0x5441a8),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(_0x568a00){const _0x106ac2=a42_0x271344,_0x4e4c66=Math[_0x106ac2(0x1f4)](_0x568a00/0x3e8),_0x49538a=Math[_0x106ac2(0x1f4)](_0x4e4c66/0x3c),_0x416352=Math[_0x106ac2(0x1f4)](_0x49538a/0x3c),_0x1deeda=Math[_0x106ac2(0x1f4)](_0x416352/0x18);if(_0x1deeda>0x0){const _0x28d201=_0x416352%0x18;return _0x28d201>0x0?_0x1deeda+'d\x20'+_0x28d201+'h':_0x1deeda+'d';}else{if(_0x416352>0x0){const _0x171293=_0x49538a%0x3c;return _0x171293>0x0?_0x416352+'h\x20'+_0x171293+'m':_0x416352+'h';}else{if(_0x49538a>0x0){const _0x3e2da3=_0x4e4c66%0x3c;return _0x3e2da3>0x0?_0x49538a+'m\x20'+_0x3e2da3+'s':_0x49538a+'m';}else return _0x4e4c66+'s';}}}function formatTimestamp(_0x154e5b,_0x45bb2d){const _0x1098e2=a42_0x271344,_0x5c5f64=new Date(_0x154e5b),_0x19449e=String(_0x5c5f64[_0x1098e2(0x1ac)]())[_0x1098e2(0x280)](0x2,'0'),_0x20e0c4=String(_0x5c5f64[_0x1098e2(0x26f)]())[_0x1098e2(0x280)](0x2,'0'),_0x25d1c4=_0x19449e+':'+_0x20e0c4,_0x9d2d6f=_0x5c5f64['getFullYear']()===_0x45bb2d[_0x1098e2(0x2c6)]()&&_0x5c5f64[_0x1098e2(0x2b3)]()===_0x45bb2d['getMonth']()&&_0x5c5f64[_0x1098e2(0x250)]()===_0x45bb2d[_0x1098e2(0x250)]();if(_0x9d2d6f)return _0x25d1c4;else{const _0x27ec36=String(_0x5c5f64[_0x1098e2(0x2b3)]()+0x1)['padStart'](0x2,'0'),_0xa692c9=String(_0x5c5f64['getDate']())[_0x1098e2(0x280)](0x2,'0');return _0x27ec36+'-'+_0xa692c9+'\x20'+_0x25d1c4;}}function formatDate(_0xc8f7b8){const _0x5aec96=a42_0x271344,_0x16082e=_0xc8f7b8[_0x5aec96(0x2c6)](),_0x3446c6=String(_0xc8f7b8[_0x5aec96(0x2b3)]()+0x1)['padStart'](0x2,'0'),_0x39b8d6=String(_0xc8f7b8[_0x5aec96(0x250)]())[_0x5aec96(0x280)](0x2,'0');return _0x16082e+'-'+_0x3446c6+'-'+_0x39b8d6;}function a42_0x3418(_0x4fdf70,_0x21b29d){_0x4fdf70=_0x4fdf70-0x146;const _0x3fe26d=a42_0x3fe2();let _0x341892=_0x3fe26d[_0x4fdf70];return _0x341892;}function getTaskStateIcon(_0x198a5a){const _0x431766={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x431766[_0x198a5a]||'⚪';}function getBarChar(_0x405495){const _0x27f222=a42_0x271344;return _0x405495===_0x27f222(0x1e2)||_0x405495===_0x27f222(0x178)?'×':'─';}function getBarColor(_0x3ffd75){const _0x473136=a42_0x271344,_0x4491c9={'success':a42_0x4cb0ba['green'],'error':a42_0x4cb0ba[_0x473136(0x2eb)],'group_error':a42_0x4cb0ba[_0x473136(0x2eb)],'running':a42_0x4cb0ba[_0x473136(0x2d8)],'blocked':a42_0x4cb0ba[_0x473136(0x1c6)],'planned':a42_0x4cb0ba[_0x473136(0x1fb)],'canceling':a42_0x4cb0ba[_0x473136(0x1c6)]};return _0x4491c9[_0x3ffd75]||a42_0x4cb0ba[_0x473136(0x14f)];}function parseTaskName(_0x29bff2){const _0x5bccc1=a42_0x271344;let _0x1589a5=_0x29bff2[_0x5bccc1(0x27d)](/^\++/,'');const _0x4a7a80=_0x1589a5['split']('+'),_0xd02b32=_0x4a7a80['length']>0x1?_0x4a7a80[_0x5bccc1(0x152)]-0x2:0x0,_0x4ba51d=_0x4a7a80[_0x4a7a80[_0x5bccc1(0x152)]-0x1]||_0x1589a5;return{'level':_0xd02b32,'name':'+'+_0x4ba51d};}function truncateTaskName(_0x7e82ee,_0xea27b9){const _0x3a7f4a=a42_0x271344,_0x56d31f=stringWidth(_0x7e82ee);if(_0x56d31f<=_0xea27b9)return _0x7e82ee;let _0x4661b8=_0x7e82ee;while(stringWidth(_0x4661b8+'…')>_0xea27b9&&_0x4661b8['length']>0x0){_0x4661b8=_0x4661b8[_0x3a7f4a(0x213)](0x0,-0x1);}return _0x4661b8+'…';}function calculateTimeScale(_0x402ccb,_0x36d30b){const _0x5c7797=a42_0x271344;return{'startTime':_0x402ccb['start'],'endTime':_0x402ccb[_0x5c7797(0x2a6)],'durationMs':_0x402ccb['duration'],'msPerChar':_0x402ccb[_0x5c7797(0x1fd)]/_0x36d30b};}function timeToPosition(_0x442405,_0x470838,_0x807988){const _0x2afac3=a42_0x271344,_0x154b72=_0x442405-_0x470838[_0x2afac3(0x224)],_0x271a5a=Math['floor'](_0x154b72/_0x470838[_0x2afac3(0x168)]);return Math[_0x2afac3(0x1c0)](0x0,Math['min'](_0x271a5a,_0x807988));}function renderTimeAxis(_0x5ba9a0,_0xdc68ff){const _0x13c4ba=a42_0x271344,_0x5a2ab6=Math['min'](TIMELINE_CONFIG[_0x13c4ba(0x2e0)],Math[_0x13c4ba(0x1c0)](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math['floor'](_0xdc68ff/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x29b72c=_0x5ba9a0[_0x13c4ba(0x2cb)]/(_0x5a2ab6-0x1),_0x296d19=new Date(_0x5ba9a0[_0x13c4ba(0x224)]),_0x1e480c=[];for(let _0x499e3e=0x0;_0x499e3e<_0x5a2ab6;_0x499e3e++){const _0x5b1357=_0x5ba9a0[_0x13c4ba(0x224)]+_0x499e3e*_0x29b72c,_0x5d807f=timeToPosition(_0x5b1357,_0x5ba9a0,_0xdc68ff),_0x209c30=formatTimestamp(_0x5b1357,_0x296d19);_0x1e480c[_0x13c4ba(0x1ad)]({'pos':_0x5d807f,'text':_0x209c30});}const _0x5ee2c6=new Array(_0xdc68ff)[_0x13c4ba(0x1dc)]('\x20');let _0x1d0262=-0x1;for(const {pos:_0x8e46f4,text:_0x5111c6}of _0x1e480c){let _0x497324=Math['max'](0x0,_0x8e46f4-Math['floor'](_0x5111c6['length']/0x2));_0x497324<=_0x1d0262+TIMELINE_CONFIG[_0x13c4ba(0x162)]&&(_0x497324=_0x1d0262+TIMELINE_CONFIG[_0x13c4ba(0x162)]+0x1);_0x497324+_0x5111c6[_0x13c4ba(0x152)]>_0xdc68ff&&(_0x497324=_0xdc68ff-_0x5111c6[_0x13c4ba(0x152)]);if(_0x497324>=0x0&&_0x497324+_0x5111c6[_0x13c4ba(0x152)]<=_0xdc68ff&&_0x497324>_0x1d0262){for(let _0x3e8c11=0x0;_0x3e8c11<_0x5111c6[_0x13c4ba(0x152)];_0x3e8c11++){_0x5ee2c6[_0x497324+_0x3e8c11]=_0x5111c6[_0x3e8c11];}_0x1d0262=_0x497324+_0x5111c6['length']-0x1;}}return _0x5ee2c6['join']('');}function renderTaskRow(_0x145626,_0x158a02,_0x555605,_0x2da091){const _0x4202e3=a42_0x271344,{level:_0x157d80,name:_0x2733f5}=parseTaskName(_0x145626[_0x4202e3(0x1bf)]),_0x1c2e65='\x20'[_0x4202e3(0x188)](_0x157d80),_0x7352fd=_0x145626[_0x4202e3(0x1b2)]?'('+formatElapsed(_0x145626['window'][_0x4202e3(0x1fd)])+')':'',_0x3292cb=stringWidth(_0x7352fd),_0x396055=_0x157d80*0x1,_0x119a07=_0x2da091-_0x396055-_0x3292cb-0x1,_0xe23f6e=truncateTaskName(_0x2733f5,_0x119a07),_0x249cbf=_0x1c2e65+_0xe23f6e,_0x4596c4=stringWidth(_0x249cbf),_0x1c6b0f=_0x2da091-_0x4596c4-_0x3292cb,_0x1096e0=_0x249cbf+'\x20'[_0x4202e3(0x188)](Math[_0x4202e3(0x1c0)](0x1,_0x1c6b0f))+a42_0x4cb0ba['dim'](_0x7352fd),_0x5dd97b=getTaskStateIcon(_0x145626[_0x4202e3(0x1b5)]),_0x328087=new Array(_0x555605)[_0x4202e3(0x1dc)]('\x20');if(_0x145626[_0x4202e3(0x1b2)]){const _0x59f9c7=timeToPosition(_0x145626[_0x4202e3(0x1b2)][_0x4202e3(0x1f6)],_0x158a02,_0x555605),_0xd812bd=timeToPosition(_0x145626[_0x4202e3(0x1b2)]['end'],_0x158a02,_0x555605),_0x332263=getBarChar(_0x145626[_0x4202e3(0x1b5)]),_0x5a1a7a=Math[_0x4202e3(0x1c0)](_0x59f9c7+0x1,_0xd812bd);for(let _0x5a03d2=_0x59f9c7;_0x5a03d2<Math[_0x4202e3(0x25c)](_0x5a1a7a,_0x555605);_0x5a03d2++){_0x328087[_0x5a03d2]=_0x332263;}}const _0x190c07=getBarColor(_0x145626['state']),_0x5c6c45=_0x328087['map'](_0x3ed8a8=>_0x3ed8a8==='\x20'?'\x20':_0x190c07(_0x3ed8a8))[_0x4202e3(0x247)]('');return _0x5dd97b+'\x20'+_0x1096e0+'│'+_0x5c6c45+'│';}function calculateStats(_0x375adc){const _0xe9b230=a42_0x271344,_0x1375b2={'total':_0x375adc[_0xe9b230(0x152)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x547fc6 of _0x375adc){if(_0x547fc6[_0xe9b230(0x1b5)]===_0xe9b230(0x223))_0x1375b2['success']++;else{if(_0x547fc6['state']===_0xe9b230(0x1e2)||_0x547fc6['state']==='group_error')_0x1375b2[_0xe9b230(0x1e2)]++;else _0x547fc6[_0xe9b230(0x1b5)]==='running'?_0x1375b2['running']++:_0x1375b2[_0xe9b230(0x2ea)]++;}}return _0x1375b2;}function formatStats(_0x355c5c){const _0x5a3ebc=a42_0x271344;return[_0x5a3ebc(0x1d7)+_0x355c5c['total'],'✅\x20'+_0x355c5c[_0x5a3ebc(0x223)],'❌\x20'+_0x355c5c[_0x5a3ebc(0x1e2)],_0x5a3ebc(0x19b)+_0x355c5c[_0x5a3ebc(0x230)],'⏳\x20'+_0x355c5c[_0x5a3ebc(0x2ea)]][_0x5a3ebc(0x247)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a42_0x271344(0x1bf)]=a42_0x271344(0x2de);[a42_0x271344(0x186)]=a42_0x271344(0x20d);async[a42_0x271344(0x1ef)](_0xab71c4){const _0x26c175=a42_0x271344,{options:_0x39cb46,args:_0x1dce9b,tdx:_0x4283d9}=_0xab71c4;let _0x7349ca,_0x3aeab0,_0x32132a=![];if(_0x1dce9b[0x0]){if(_0x1dce9b[0x0][_0x26c175(0x181)]('.')){const _0x1d08e2=this[_0x26c175(0x15b)](_0x1dce9b,_0x39cb46);if(!_0x1d08e2)return 0x1;_0x7349ca=_0x1d08e2[_0x26c175(0x19a)],_0x3aeab0=_0x1d08e2['workflowName'];}else{_0x3aeab0=_0x1dce9b[0x0],_0x7349ca=_0x39cb46[_0x26c175(0x2e5)];if(!_0x7349ca)return console['error'](a42_0x4cb0ba[_0x26c175(0x2eb)](_0x26c175(0x29a)),_0x26c175(0x1b6)),0x1;_0x32132a=!![];}}else{const _0x2fd424=this[_0x26c175(0x15b)](_0x1dce9b,_0x39cb46);if(!_0x2fd424)return 0x1;_0x7349ca=_0x2fd424[_0x26c175(0x19a)],_0x3aeab0=_0x2fd424['workflowName'];}if(_0x39cb46[_0x26c175(0x2cc)]){if(_0x7349ca&&_0x3aeab0)console[_0x26c175(0x1e2)](_0x26c175(0x25e)+_0x7349ca+'.'+_0x3aeab0);else _0x7349ca&&console[_0x26c175(0x1e2)](_0x26c175(0x207)+_0x7349ca);}const _0x4df698=_0x39cb46[_0x26c175(0x16d)],_0x6e1c1=_0x39cb46['sessionId'];if(_0x4df698){_0x6e1c1&&console['error'](a42_0x4cb0ba['yellow'](_0x26c175(0x2c4)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x24a662=_0x39cb46[_0x26c175(0x193)];return _0x24a662?await this[_0x26c175(0x176)](_0xab71c4,_0x4df698):await this[_0x26c175(0x2c1)](_0xab71c4,_0x4df698,_0x39cb46),0x0;}if(_0x6e1c1){const _0x22bb17=await withSpinner(_0x26c175(0x291),()=>_0x4283d9[_0x26c175(0x2b8)][_0x26c175(0x15c)]({'projectName':_0x7349ca,'workflowName':_0x3aeab0,'limit':0x64}),{'verbose':_0x39cb46[_0x26c175(0x2cc)]}),_0x3585f3=_0x22bb17[_0x26c175(0x1c3)][_0x26c175(0x2b4)](_0x496e88=>_0x496e88['id']===_0x6e1c1);if(!_0x3585f3)return console[_0x26c175(0x1e2)](a42_0x4cb0ba[_0x26c175(0x2eb)](_0x26c175(0x29a)),_0x26c175(0x20a)+_0x6e1c1),0x1;if(!_0x3585f3['lastAttempt']?.['id'])return console[_0x26c175(0x1e2)](a42_0x4cb0ba[_0x26c175(0x2eb)](_0x26c175(0x29a)),_0x26c175(0x279)+_0x6e1c1+_0x26c175(0x1c9)),0x1;const _0x5c9d7c=_0x3585f3['lastAttempt']['id'];_0x39cb46[_0x26c175(0x2cc)]&&console[_0x26c175(0x1e2)](_0x26c175(0x18f)+_0x5c9d7c+_0x26c175(0x1db)+_0x6e1c1);const _0xe3cc65=_0x39cb46['follow'];return _0xe3cc65?await this[_0x26c175(0x176)](_0xab71c4,_0x5c9d7c):await this[_0x26c175(0x2c1)](_0xab71c4,_0x5c9d7c,_0x39cb46),0x0;}const _0x1441fc=await withSpinner(_0x26c175(0x2d0),()=>_0x4283d9[_0x26c175(0x2b8)][_0x26c175(0x15c)]({'projectName':_0x7349ca,'workflowName':_0x3aeab0,'limit':_0x39cb46[_0x26c175(0x22c)]||0x32}),{'verbose':_0x39cb46[_0x26c175(0x2cc)]}),_0x14f029=_0x1441fc['data'];if(_0x14f029[_0x26c175(0x152)]===0x0){if(_0x7349ca&&_0x3aeab0)console['error']('No\x20sessions\x20found\x20for:\x20'+_0x7349ca+'.'+_0x3aeab0);else _0x7349ca?console[_0x26c175(0x1e2)](_0x26c175(0x200)+_0x7349ca):(console[_0x26c175(0x1e2)](_0x26c175(0x27e)),console[_0x26c175(0x1e2)](a42_0x4cb0ba[_0x26c175(0x1fb)](_0x26c175(0x1d0))));return 0x0;}_0x14f029[_0x26c175(0x1cd)]((_0x39662b,_0x95215d)=>{const _0x75327d=_0x26c175,_0x2aeb6d=_0x39662b[_0x75327d(0x2d7)]||'',_0x4d1538=_0x95215d[_0x75327d(0x2d7)]||'';return _0x4d1538[_0x75327d(0x235)](_0x2aeb6d);});if(_0x39cb46['json']||_0x39cb46[_0x26c175(0x173)])return await handleSDKOutput(_0x14f029,_0x39cb46),0x0;let _0x5d89a8;if(_0x32132a){const _0x1d0ce5=_0x14f029[0x0];if(!_0x1d0ce5[_0x26c175(0x18c)]?.['id'])return console[_0x26c175(0x1e2)](_0x26c175(0x25d)),0x0;_0x5d89a8=_0x1d0ce5[_0x26c175(0x18c)]['id'],_0x39cb46['verbose']&&console[_0x26c175(0x1e2)](_0x26c175(0x274)+_0x1d0ce5[_0x26c175(0x2d7)]);}else{const _0x4fb7f3=_0x14f029[_0x26c175(0x174)](_0x6f0ec2=>{const _0x1ae3f8=_0x26c175,_0xff8264=getAttemptStatusDisplay(_0x6f0ec2[_0x1ae3f8(0x18c)]);return{'title':_0x6f0ec2[_0x1ae3f8(0x24b)]?.['name']+'.'+_0x6f0ec2[_0x1ae3f8(0x2b8)]?.[_0x1ae3f8(0x1bf)]+_0x1ae3f8(0x1a1)+_0x6f0ec2[_0x1ae3f8(0x2d7)]+'\x20'+_0xff8264['icon'],'value':_0x6f0ec2[_0x1ae3f8(0x18c)]?.['id']||'','description':_0xff8264[_0x1ae3f8(0x167)]};}),_0x50eb47=await a42_0x5e9a1d({'type':'select','name':'attemptId','message':_0x26c175(0x23f),'choices':_0x4fb7f3[_0x26c175(0x288)](_0x5db82b=>_0x5db82b[_0x26c175(0x1f8)]!=='')});if(!_0x50eb47['attemptId'])return 0x0;_0x5d89a8=_0x50eb47[_0x26c175(0x16d)];}const _0x2b827b=_0x39cb46[_0x26c175(0x193)];return _0x2b827b?await this[_0x26c175(0x176)](_0xab71c4,_0x5d89a8):await this['renderSingleTimeline'](_0xab71c4,_0x5d89a8,_0x39cb46),0x0;}async[a42_0x271344(0x2c1)](_0x1fbb0f,_0x269c98,_0x432b14){const _0x551bf8=a42_0x271344,{tdx:_0x3a3fdc}=_0x1fbb0f;let _0x19af5d,_0x17b07f;try{[_0x19af5d,_0x17b07f]=await Promise['all']([_0x3a3fdc['workflow']['attempt'](_0x269c98),_0x3a3fdc[_0x551bf8(0x2b8)][_0x551bf8(0x258)](_0x269c98,![])]);}catch(_0x58027e){console[_0x551bf8(0x1e2)](a42_0x4cb0ba[_0x551bf8(0x2eb)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x432b14[_0x551bf8(0x2cc)]&&console[_0x551bf8(0x1e2)](_0x58027e);throw _0x58027e;}if(_0x432b14[_0x551bf8(0x19c)]||_0x432b14[_0x551bf8(0x173)]){const _0x4ece42=this['buildTimelineData'](_0x19af5d,_0x17b07f);await handleSDKOutput([_0x4ece42],_0x432b14);return;}const _0x149811=_0x3a3fdc['context'][_0x551bf8(0x21f)],_0x42a925=this[_0x551bf8(0x216)](_0x19af5d,_0x17b07f,_0x149811);console['log'](_0x42a925);}async[a42_0x271344(0x176)](_0x1e96a6,_0x50da42){const _0x3fe8d4=a42_0x271344,{tdx:_0x128f40}=_0x1e96a6,_0x32e4a4=TIMELINE_CONFIG[_0x3fe8d4(0x27b)],_0x3c66c6=TIMELINE_CONFIG[_0x3fe8d4(0x2b9)];let _0x1a2422=0x0;while(_0x1a2422<_0x3c66c6){process[_0x3fe8d4(0x206)][_0x3fe8d4(0x1da)]&&process[_0x3fe8d4(0x206)]['write']('\x1bc');let _0xe92117,_0x58141f;try{[_0xe92117,_0x58141f]=await Promise[_0x3fe8d4(0x1bd)]([_0x128f40['workflow'][_0x3fe8d4(0x1e6)](_0x50da42),_0x128f40[_0x3fe8d4(0x2b8)]['tasks'](_0x50da42,![])]);}catch(_0x255891){console['error'](a42_0x4cb0ba['red'](_0x3fe8d4(0x2a3)));_0x1a2422>0x0&&console[_0x3fe8d4(0x1e2)](a42_0x4cb0ba[_0x3fe8d4(0x1fb)](_0x3fe8d4(0x26e)+_0x1a2422));throw _0x255891;}const _0x9251c7=_0x128f40['context']['site'],_0x5de985=this[_0x3fe8d4(0x216)](_0xe92117,_0x58141f,_0x9251c7);console[_0x3fe8d4(0x295)](_0x5de985);const _0x5579b9=_0xe92117['done']&&_0x58141f[_0x3fe8d4(0x17d)](_0x408cf9=>_0x408cf9[_0x3fe8d4(0x1b5)]!==_0x3fe8d4(0x230)&&_0x408cf9[_0x3fe8d4(0x1b5)]!==_0x3fe8d4(0x244));if(_0x5579b9){console[_0x3fe8d4(0x1e2)](a42_0x4cb0ba[_0x3fe8d4(0x1ff)](_0x3fe8d4(0x1d5)));break;}console['error'](a42_0x4cb0ba[_0x3fe8d4(0x1fb)](_0x3fe8d4(0x2bb)+_0x1a2422*0x2+_0x3fe8d4(0x276))),await new Promise(_0x2fa3e5=>setTimeout(_0x2fa3e5,_0x32e4a4)),_0x1a2422++;}_0x1a2422>=_0x3c66c6&&console[_0x3fe8d4(0x1e2)](a42_0x4cb0ba['yellow']('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a42_0x271344(0x216)](_0x1625aa,_0x3dd7b0,_0x536253){const _0x26ddae=a42_0x271344,_0x4f391d=[],_0x11e24f=TIMELINE_CONFIG[_0x26ddae(0x215)],_0x2acfe5=0x5,_0xdf88cd=process[_0x26ddae(0x206)]['columns']||0x78,_0x210a54=_0xdf88cd-_0x11e24f-_0x2acfe5,_0x514931=Math[_0x26ddae(0x1c0)](TIMELINE_CONFIG[_0x26ddae(0x2bc)],Math[_0x26ddae(0x25c)](_0x210a54,TIMELINE_CONFIG[_0x26ddae(0x14e)])),_0x44b8ed=new Date(_0x1625aa['createdAt'])[_0x26ddae(0x2c3)](),_0x2c9b71=_0x1625aa[_0x26ddae(0x2e4)]?new Date(_0x1625aa[_0x26ddae(0x2e4)])[_0x26ddae(0x2c3)]():Date[_0x26ddae(0x25f)](),_0x4d056c={'start':_0x44b8ed,'end':_0x2c9b71,'duration':_0x2c9b71-_0x44b8ed},_0x277e5f=new Map(),_0x4fc59c=[];for(const _0x177790 of _0x3dd7b0){if(_0x177790[_0x26ddae(0x1ba)]){const _0x3991ec=new Date(_0x177790[_0x26ddae(0x1ba)])[_0x26ddae(0x2c3)](),_0x1fef7d=_0x177790[_0x26ddae(0x17f)]?new Date(_0x177790['updatedAt'])[_0x26ddae(0x2c3)]():Date[_0x26ddae(0x25f)](),_0xfd18a3={'start':_0x3991ec,'end':_0x1fef7d,'duration':_0x1fef7d-_0x3991ec};_0x277e5f[_0x26ddae(0x154)](_0x177790['id'],_0xfd18a3),_0x4fc59c[_0x26ddae(0x1ad)]({'name':_0x177790[_0x26ddae(0x246)],'state':_0x177790[_0x26ddae(0x1b5)]||_0x26ddae(0x293),'window':_0xfd18a3});}else _0x4fc59c['push']({'name':_0x177790[_0x26ddae(0x246)],'state':_0x177790[_0x26ddae(0x1b5)]||'planned','window':undefined});}_0x4fc59c[_0x26ddae(0x1cd)]((_0x16099c,_0x5741e1)=>{const _0xcf0bbe=_0x26ddae;if(!_0x16099c[_0xcf0bbe(0x1b2)])return 0x1;if(!_0x5741e1[_0xcf0bbe(0x1b2)])return-0x1;return _0x16099c['window'][_0xcf0bbe(0x1f6)]-_0x5741e1[_0xcf0bbe(0x1b2)][_0xcf0bbe(0x1f6)];});const _0x4ba989=_0x4fc59c['length'],_0x36bc3a=_0x4ba989>TIMELINE_CONFIG[_0x26ddae(0x2f0)];_0x36bc3a&&_0x4fc59c[_0x26ddae(0x21b)](TIMELINE_CONFIG[_0x26ddae(0x2f0)]);const _0x346f4f=calculateTimeScale(_0x4d056c,_0x514931),_0x405f13=_0x1625aa[_0x26ddae(0x240)]?_0x1625aa[_0x26ddae(0x223)]?a42_0x4cb0ba['green'](_0x26ddae(0x223)):a42_0x4cb0ba[_0x26ddae(0x2eb)](_0x26ddae(0x1e2)):a42_0x4cb0ba['blue'](_0x26ddae(0x230)),_0x2169ad=_0x1625aa[_0x26ddae(0x24b)]?.['id'],_0x445f61=_0x1625aa[_0x26ddae(0x20b)];let _0x3ec36b;if(_0x2169ad&&_0x445f61){const _0x346fe8=getWorkflowAttemptUrl(_0x536253,_0x2169ad,_0x445f61,_0x1625aa['id']);_0x3ec36b=hyperlink(a42_0x4cb0ba[_0x26ddae(0x1fb)](_0x1625aa['id']),_0x346fe8);}else _0x3ec36b=a42_0x4cb0ba['dim'](_0x1625aa['id']);_0x4f391d['push'](_0x26ddae(0x267)+_0x3ec36b+_0x26ddae(0x1a1)+_0x405f13+_0x26ddae(0x1a1)+formatElapsed(_0x4d056c[_0x26ddae(0x1fd)]));if(_0x4fc59c['length']>0x0){const _0x4b1e3c=renderTimeAxis(_0x346f4f,_0x514931),_0x565b48=new Date(_0x4d056c[_0x26ddae(0x1f6)]),_0x13c6e9=formatDate(_0x565b48),_0x1c51e3=TIMELINE_CONFIG[_0x26ddae(0x2ad)]+TIMELINE_CONFIG[_0x26ddae(0x185)]+_0x11e24f,_0x353b5f=_0x13c6e9['padStart'](_0x1c51e3),_0x100a44=a42_0x4cb0ba['dim'](_0x353b5f);_0x4f391d[_0x26ddae(0x1ad)](_0x100a44+'\x20'+_0x4b1e3c);for(const _0x1169bc of _0x4fc59c){_0x4f391d[_0x26ddae(0x1ad)](renderTaskRow(_0x1169bc,_0x346f4f,_0x514931,_0x11e24f));}const _0x3909e9=calculateStats(_0x4fc59c);_0x4f391d[_0x26ddae(0x1ad)](formatStats(_0x3909e9)),_0x36bc3a&&_0x4f391d['push'](a42_0x4cb0ba[_0x26ddae(0x1c6)](_0x26ddae(0x290)+TIMELINE_CONFIG[_0x26ddae(0x2f0)]+'\x20of\x20'+_0x4ba989+_0x26ddae(0x277))),_0x4f391d['push'](''),_0x4f391d[_0x26ddae(0x1ad)](a42_0x4cb0ba[_0x26ddae(0x1fb)](_0x26ddae(0x1d1))+(_0x26ddae(0x18d)+_0x1625aa['id']+'\x20logs')+a42_0x4cb0ba[_0x26ddae(0x1fb)](_0x26ddae(0x2b2)));}else _0x4f391d['push'](_0x26ddae(0x1be));return _0x4f391d[_0x26ddae(0x247)]('\x0a');}[a42_0x271344(0x228)](_0x55d453,_0x5efcbc){const _0x23bfb4=a42_0x271344,_0x6fce9=new Date(_0x55d453[_0x23bfb4(0x2a2)])[_0x23bfb4(0x2c3)](),_0x1b9e45=_0x55d453[_0x23bfb4(0x2e4)]?new Date(_0x55d453['finishedAt'])[_0x23bfb4(0x2c3)]():Date[_0x23bfb4(0x25f)](),_0x52d149=_0x1b9e45-_0x6fce9,_0x35858e=[];for(const _0x329d82 of _0x5efcbc){if(_0x329d82[_0x23bfb4(0x1ba)]){const _0x278e56=new Date(_0x329d82[_0x23bfb4(0x1ba)])[_0x23bfb4(0x2c3)](),_0x21dfae=_0x329d82[_0x23bfb4(0x17f)]?new Date(_0x329d82[_0x23bfb4(0x17f)])[_0x23bfb4(0x2c3)]():Date['now']();_0x35858e[_0x23bfb4(0x1ad)]({'name':_0x329d82[_0x23bfb4(0x246)],'state':_0x329d82['state']||_0x23bfb4(0x293),'window':{'start':_0x278e56,'end':_0x21dfae,'duration':_0x21dfae-_0x278e56}});}else _0x35858e[_0x23bfb4(0x1ad)]({'name':_0x329d82['fullName'],'state':_0x329d82[_0x23bfb4(0x1b5)]||_0x23bfb4(0x244),'window':undefined});}const _0x1d7a82=calculateStats(_0x35858e);return{'attempt':{'id':_0x55d453['id'],'status':_0x55d453['done']?_0x55d453['success']?_0x23bfb4(0x223):_0x23bfb4(0x1e2):'running','createdAt':_0x55d453[_0x23bfb4(0x2a2)],'finishedAt':_0x55d453['finishedAt'],'duration_ms':_0x52d149},'tasks':_0x35858e[_0x23bfb4(0x174)](_0x58b256=>({'name':_0x58b256[_0x23bfb4(0x1bf)],'state':_0x58b256['state'],'startedAt':_0x58b256[_0x23bfb4(0x1b2)]?new Date(_0x58b256[_0x23bfb4(0x1b2)][_0x23bfb4(0x1f6)])[_0x23bfb4(0x26b)]():null,'updatedAt':_0x58b256[_0x23bfb4(0x1b2)]?new Date(_0x58b256['window']['end'])[_0x23bfb4(0x26b)]():null,'duration_ms':_0x58b256['window']?.[_0x23bfb4(0x1fd)]||null})),'stats':_0x1d7a82};}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1d10e3,_0x4f13ad){const _0x2bf3de=a43_0x5123,_0x459f8e=_0x1d10e3();while(!![]){try{const _0x5e923f=parseInt(_0x2bf3de(0x16c))/0x1*(parseInt(_0x2bf3de(0x174))/0x2)+parseInt(_0x2bf3de(0x171))/0x3+-parseInt(_0x2bf3de(0x16e))/0x4+parseInt(_0x2bf3de(0x176))/0x5*(-parseInt(_0x2bf3de(0x16b))/0x6)+-parseInt(_0x2bf3de(0x172))/0x7+parseInt(_0x2bf3de(0x169))/0x8+parseInt(_0x2bf3de(0x168))/0x9;if(_0x5e923f===_0x4f13ad)break;else _0x459f8e['push'](_0x459f8e['shift']());}catch(_0xb583ab){_0x459f8e['push'](_0x459f8e['shift']());}}}(a43_0x3407,0xaebeb));import{platform}from'os';function a43_0x3407(){const _0xb99ea=['544132ZuWUwT','Authorization','110445XATCUD','length','tdx/','5091660kCtllD','9178264cpWUOm','replace','288uGoBbR','3cpkjCd','tdx','4006688UEOkex','entries','version','4084344zskZXZ','7790790ftWjEj','X-Trino-User'];a43_0x3407=function(){return _0xb99ea;};return a43_0x3407();}import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x2c64f9=a43_0x5123,_0x3f19a0=getVersion(),_0x28fa8b=platform(),_0x87ec6c=process[_0x2c64f9(0x170)][_0x2c64f9(0x16a)]('v','');return _0x2c64f9(0x167)+_0x3f19a0+'\x20('+_0x28fa8b+';\x20node/'+_0x87ec6c+')';}export function getAuthHeaders(_0x3c6434,_0x39eb81){const _0xc7d6cd=a43_0x5123,_0xf8f57d=getVersion(),_0x54864d={'User-Agent':getUserAgent(),'X-TD-Client':_0xc7d6cd(0x16d),'X-TD-Client-Version':_0xf8f57d};return _0x39eb81&&(_0x54864d[_0xc7d6cd(0x175)]='TD1\x20'+_0x39eb81),_0x54864d;}function a43_0x5123(_0x259010,_0x550501){_0x259010=_0x259010-0x166;const _0x34075c=a43_0x3407();let _0x51239e=_0x34075c[_0x259010];return _0x51239e;}export function toHeaderRecord(_0x20b760){const _0x244105=a43_0x5123,_0x3a3dfb={};for(const [_0x800d0f,_0x329097]of Object[_0x244105(0x16f)](_0x20b760)){_0x329097!==undefined&&(_0x3a3dfb[_0x800d0f]=_0x329097);}return _0x3a3dfb;}export function getTrinoHeaders(_0x5187f6,_0x37a7dc){const _0x4654c4=a43_0x5123,_0x26cbd8=getAuthHeaders(_0x5187f6,_0x37a7dc),_0x58317c=toHeaderRecord(_0x26cbd8);return delete _0x58317c[_0x4654c4(0x175)],_0x37a7dc&&(_0x58317c[_0x4654c4(0x173)]=_0x37a7dc),_0x58317c;}export function hasAPIKey(_0x37def6){const _0x3bc239=a43_0x5123,_0x5bf94d=getAPIKey();return _0x5bf94d!==undefined&&_0x5bf94d[_0x3bc239(0x166)]>0x0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x3d367e,_0x5b34b5){const _0x2f19dc=a44_0x3d5c,_0x8af57e=_0x3d367e();while(!![]){try{const _0x1dab1a=-parseInt(_0x2f19dc(0x183))/0x1+parseInt(_0x2f19dc(0x1be))/0x2+-parseInt(_0x2f19dc(0x19b))/0x3*(-parseInt(_0x2f19dc(0x199))/0x4)+parseInt(_0x2f19dc(0x187))/0x5*(parseInt(_0x2f19dc(0x1c2))/0x6)+-parseInt(_0x2f19dc(0x19a))/0x7+parseInt(_0x2f19dc(0x1a6))/0x8*(parseInt(_0x2f19dc(0x18e))/0x9)+-parseInt(_0x2f19dc(0x1a1))/0xa;if(_0x1dab1a===_0x5b34b5)break;else _0x8af57e['push'](_0x8af57e['shift']());}catch(_0x3ef928){_0x8af57e['push'](_0x8af57e['shift']());}}}(a44_0x38da,0x70629));function a44_0x3d5c(_0x4c29ba,_0x934680){_0x4c29ba=_0x4c29ba-0x181;const _0x38da9a=a44_0x38da();let _0x3d5cb6=_0x38da9a[_0x4c29ba];return _0x3d5cb6;}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 a44_0x562dce from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x49f59a){const _0x10a6a8=a44_0x3d5c;return _0x49f59a[_0x10a6a8(0x1c6)]===_0x10a6a8(0x1a4)||_0x49f59a[_0x10a6a8(0x1c6)]===_0x10a6a8(0x1b3)||_0x49f59a[_0x10a6a8(0x1c6)]===_0x10a6a8(0x198)||_0x49f59a[_0x10a6a8(0x1c6)]===_0x10a6a8(0x1ab)||_0x49f59a[_0x10a6a8(0x1a4)]===!![]||_0x49f59a[_0x10a6a8(0x1b3)]===!![]||_0x49f59a[_0x10a6a8(0x198)]===!![]||_0x49f59a[_0x10a6a8(0x1ab)]===!![];}export function parseOutputOptions(_0x2e529b){const _0x1cd71a=a44_0x3d5c;return{'format':_0x2e529b['format']||'table','output':_0x2e529b[_0x1cd71a(0x1ad)]||'','limit':_0x2e529b['limit'],'color':_0x2e529b[_0x1cd71a(0x1c7)],'noColor':_0x2e529b[_0x1cd71a(0x1ac)]};}function convertSDKResultToQueryResult(_0x4971fa){const _0x23b246=a44_0x3d5c,_0x39b732=[];if(_0x4971fa[_0x23b246(0x188)]>0x0){const _0x3a18c6=_0x4971fa[0x0];for(const [_0x372484,_0x3b3b91]of Object[_0x23b246(0x1ba)](_0x3a18c6)){let _0x2e1907=_0x23b246(0x1aa);if(typeof _0x3b3b91===_0x23b246(0x1b1))_0x2e1907=Number['isInteger'](_0x3b3b91)?_0x23b246(0x1b0):_0x23b246(0x1b6);else{if(typeof _0x3b3b91===_0x23b246(0x1c1))_0x2e1907=_0x23b246(0x1c1);else _0x3b3b91===null&&(_0x2e1907=_0x23b246(0x1aa));}_0x39b732[_0x23b246(0x196)]({'name':_0x372484,'type':_0x2e1907});}}return{'queryId':'sdk-result','columns':_0x39b732,'data':_0x4971fa,'stats':{'state':_0x23b246(0x19d),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x4971fa[_0x23b246(0x188)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x5ccb72,_0x3dd0ef){const _0x4f79d3=convertSDKResultToQueryResult(_0x5ccb72);return formatQueryOutput(_0x4f79d3,_0x3dd0ef);}export async function formatQueryOutput(_0x40299b,_0x50c80b){const _0x32a376=a44_0x3d5c,{format:_0x130dfc,limit:_0x173c70,output:_0x18564c,color:_0x3ec0b5,noColor:_0x46e573}=_0x50c80b,_0x2b5e71=Boolean(_0x18564c)&&!_0x3ec0b5,_0x5989d4={'color':_0x3ec0b5,'noColor':_0x46e573||_0x2b5e71};if(_0x130dfc===_0x32a376(0x1ab)){const _0x528da3=shouldUseLess(_0x130dfc,_0x18564c);return formatAsTable(_0x40299b,_0x173c70,_0x528da3,_0x5989d4);}else{if(_0x130dfc===_0x32a376(0x1a4))return formatAsJSON(_0x40299b,_0x5989d4);else return _0x130dfc==='jsonl'?formatAsJSONL(_0x40299b,_0x5989d4):formatQueryResult(_0x40299b,_0x130dfc);}}function a44_0x38da(){const _0x2f7735=['31314ETHCFb','close','list','rule','format','color','bold','cmdout','[query]','[logs]','93143moiVTl','inherit','log','[error]','405YhOsnm','length','padEnd','join','Results\x20saved\x20to\x20','end','less','53496CuOjTz','No\x20data','repeat','keys','write','max','stdout','magenta','push','─┬─','tsv','1968wCJzQC','875154gVNshz','1977ueaEzx','object','FINISHED','─┴─','error','[Object]','16858080ShMoGP','stdin','map','json','stringify','1088xnPTAS','cyan','spawn','-FXRSn','varchar','table','noColor','output','stderr','filter','bigint','number','[rule]','jsonl','trim','red','double','limit','params','resolve','entries','forEach','pipe','query','1617902GNnvNW','split','debug','boolean'];a44_0x38da=function(){return _0x2f7735;};return a44_0x38da();}function shouldUseLess(_0x5bbf7d,_0x47b691){const _0x581ffb=a44_0x3d5c;return(_0x5bbf7d===_0x581ffb(0x1ab)||_0x5bbf7d===_0x581ffb(0x1c4))&&process[_0x581ffb(0x194)]['isTTY']&&!_0x47b691;}export function resolveOutputOptions(_0x211881){const _0x3e3be3=a44_0x3d5c,_0x26eda2=resolveOutputFormat(_0x211881[_0x3e3be3(0x1c6)],_0x211881[_0x3e3be3(0x1ad)],_0x3e3be3(0x1ab));let _0x2f1aec=typeof _0x211881[_0x3e3be3(0x1b7)]===_0x3e3be3(0x1b1)?_0x211881['limit']:parseInt(_0x211881['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x2dd79f=_0x211881[_0x3e3be3(0x1ad)]||'';return shouldUseLess(_0x26eda2,_0x2dd79f)&&(_0x2f1aec=Infinity),{'format':_0x26eda2,'output':_0x2dd79f,'limit':_0x2f1aec,'color':_0x211881[_0x3e3be3(0x1c7)],'noColor':_0x211881[_0x3e3be3(0x1ac)]};}export function writeOutput(_0x3cc7a4,_0x1bcf41,_0x15d43a){const _0xadfcf6=a44_0x3d5c;return _0x1bcf41?(writeFileSync(_0x1bcf41,_0x3cc7a4),console[_0xadfcf6(0x19f)](_0xadfcf6(0x18b)+_0x1bcf41),Promise[_0xadfcf6(0x1b9)]()):shouldUseLess(_0x15d43a||'','')?new Promise(_0x1403fe=>{const _0x17899a=_0xadfcf6,_0x5f23f1=spawn(_0x17899a(0x18d),[_0x17899a(0x1a9)],{'stdio':[_0x17899a(0x1bc),_0x17899a(0x184),_0x17899a(0x184)]});let _0x81bf49=![];_0x5f23f1['on']('error',()=>{!_0x81bf49&&(_0x81bf49=!![],console['log'](_0x3cc7a4),_0x1403fe());}),_0x5f23f1['on'](_0x17899a(0x1c3),()=>{!_0x81bf49&&(_0x81bf49=!![],_0x1403fe());}),_0x5f23f1['on'](_0x17899a(0x1a8),()=>{const _0x2c719a=_0x17899a;!_0x81bf49&&_0x5f23f1[_0x2c719a(0x1a2)]&&(_0x5f23f1[_0x2c719a(0x1a2)]['on'](_0x2c719a(0x19f),()=>{}),_0x5f23f1[_0x2c719a(0x1a2)][_0x2c719a(0x192)](_0x3cc7a4),_0x5f23f1[_0x2c719a(0x1a2)][_0x2c719a(0x18c)]());}),!_0x5f23f1[_0x17899a(0x1a2)]&&(!_0x81bf49&&(_0x81bf49=!![],console['log'](_0x3cc7a4),_0x1403fe()));}):(console[_0xadfcf6(0x185)](_0x3cc7a4),Promise['resolve']());}export async function handleSDKOutput(_0x2d48d7,_0x471406){const _0x170edd=a44_0x3d5c,_0x3d0adb=resolveOutputOptions(_0x471406),_0x5779dc=await formatSDKOutput(_0x2d48d7,_0x3d0adb);await writeOutput(_0x5779dc,_0x3d0adb['output']||undefined,_0x3d0adb[_0x170edd(0x1c6)]);}export async function handleQueryOutput(_0x2041f9,_0x3daeca){const _0x2b0b03=a44_0x3d5c,_0x2103b4=resolveOutputOptions(_0x3daeca),_0x2c809d=await formatQueryOutput(_0x2041f9,_0x2103b4);await writeOutput(_0x2c809d,_0x2103b4[_0x2b0b03(0x1ad)]||undefined,_0x2103b4[_0x2b0b03(0x1c6)]);}async function formatSingleObject(_0xeb4fc4,_0x37638a){const _0x529530=a44_0x3d5c,{format:_0x168e75,color:_0x4a66db,noColor:_0x415bbb}=_0x37638a,_0x5c68e9={'color':_0x4a66db,'noColor':_0x415bbb};if(_0x168e75===_0x529530(0x1a4)){if(shouldUseColor(_0x5c68e9))return colorizeJSON(_0xeb4fc4,_0x5c68e9);return JSON[_0x529530(0x1a5)](_0xeb4fc4,null,0x2);}else{if(_0x168e75===_0x529530(0x1b3)){if(shouldUseColor(_0x5c68e9))return colorizeJSONCompact(_0xeb4fc4,_0x5c68e9);return JSON[_0x529530(0x1a5)](_0xeb4fc4);}else{if(_0x168e75===_0x529530(0x198))return Object[_0x529530(0x1ba)](_0xeb4fc4)[_0x529530(0x1a3)](([_0x35a91d,_0x47429d])=>_0x35a91d+'\x09'+_0x47429d)[_0x529530(0x18a)]('\x0a');else{const _0x383b81=Object[_0x529530(0x1ba)](_0xeb4fc4);if(_0x383b81['length']===0x0)return _0x529530(0x18f);const _0x208b2f=_0xeb4fc4['debug'],_0x466227=_0xeb4fc4[_0x529530(0x1bd)],_0x1db9d5=_0xeb4fc4[_0x529530(0x1b8)],_0x33d882=_0xeb4fc4[_0x529530(0x1c5)],_0x3d87f2=_0x466227?typeof _0x466227==='string'?_0x466227:JSON[_0x529530(0x1a5)](_0x466227,null,0x2):undefined,_0x363e1f=_0x1db9d5&&Object['keys'](_0x1db9d5)[_0x529530(0x188)]>0x0?JSON['stringify'](_0x1db9d5,null,0x2):undefined,_0x51815f=_0x33d882&&Object[_0x529530(0x191)](_0x33d882)[_0x529530(0x188)]>0x0?JSON[_0x529530(0x1a5)](_0x33d882,null,0x2):undefined,_0x159283=_0x383b81[_0x529530(0x1af)](([_0xaf0b75])=>_0xaf0b75!==_0x529530(0x1c0)&&_0xaf0b75!==_0x529530(0x1bd)&&_0xaf0b75!==_0x529530(0x1b8)&&_0xaf0b75!==_0x529530(0x1c5)),_0x50bb81=Math[_0x529530(0x193)](..._0x159283['map'](([_0x1d7274])=>_0x1d7274['length'])),_0x224f3f=Math[_0x529530(0x193)](..._0x159283[_0x529530(0x1a3)](([,_0x5b7883])=>{const _0x3a5543=_0x529530;try{const _0x3a30e1=_0x5b7883===null||_0x5b7883===undefined?'':typeof _0x5b7883==='object'?JSON['stringify'](_0x5b7883):String(_0x5b7883),_0x438cc5=_0x3a30e1[_0x3a5543(0x1bf)]('\x0a');return Math['max'](..._0x438cc5[_0x3a5543(0x1a3)](_0x5279aa=>_0x5279aa[_0x3a5543(0x188)]),0x0);}catch{return 0x0;}}),0x14),_0x1df21b=[];_0x1df21b[_0x529530(0x196)](colorBorder('┌─'+'─'[_0x529530(0x190)](_0x50bb81)+_0x529530(0x197)+'─'['repeat'](_0x224f3f)+'─┐',_0x5c68e9)),_0x159283[_0x529530(0x1bb)](([_0xed756e,_0xa9b403])=>{const _0x4ae341=_0x529530;let _0x5a7684;try{_0x5a7684=_0xa9b403===null||_0xa9b403===undefined?'':typeof _0xa9b403===_0x4ae341(0x19c)?JSON[_0x4ae341(0x1a5)](_0xa9b403):String(_0xa9b403);}catch{_0x5a7684=_0x4ae341(0x1a0);}const _0xfe8551=_0xed756e[_0x4ae341(0x189)](_0x50bb81),_0x2e0529=_0x5a7684['split']('\x0a');_0x2e0529[_0x4ae341(0x1bb)]((_0x2d69ef,_0x533249)=>{const _0x5be65a=_0x4ae341,_0x14ddc9=colorBorder('│',_0x5c68e9);_0x533249===0x0?_0x1df21b[_0x5be65a(0x196)](_0x14ddc9+'\x20'+_0xfe8551+'\x20'+_0x14ddc9+'\x20'+_0x2d69ef[_0x5be65a(0x189)](_0x224f3f)+'\x20'+_0x14ddc9):_0x1df21b[_0x5be65a(0x196)](_0x14ddc9+'\x20'+'\x20'[_0x5be65a(0x190)](_0x50bb81)+'\x20'+_0x14ddc9+'\x20'+_0x2d69ef[_0x5be65a(0x189)](_0x224f3f)+'\x20'+_0x14ddc9);});}),_0x1df21b['push'](colorBorder('└─'+'─'['repeat'](_0x50bb81)+_0x529530(0x19e)+'─'[_0x529530(0x190)](_0x224f3f)+'─┘',_0x5c68e9));_0x3d87f2&&(_0x1df21b[_0x529530(0x196)](''),_0x1df21b[_0x529530(0x196)](String(a44_0x562dce['yellow'][_0x529530(0x1c8)](_0x529530(0x181)))),_0x1df21b[_0x529530(0x196)](_0x3d87f2));_0x363e1f&&(_0x1df21b[_0x529530(0x196)](''),_0x1df21b['push'](String(a44_0x562dce['blue']['bold']('[params]'))),_0x1df21b[_0x529530(0x196)](_0x363e1f));_0x51815f&&(_0x1df21b[_0x529530(0x196)](''),_0x1df21b[_0x529530(0x196)](String(a44_0x562dce[_0x529530(0x195)]['bold'](_0x529530(0x1b2)))),_0x1df21b[_0x529530(0x196)](_0x51815f));if(_0x208b2f){if(_0x208b2f['stderr']){_0x1df21b[_0x529530(0x196)](''),_0x1df21b[_0x529530(0x196)](String(a44_0x562dce[_0x529530(0x1b5)][_0x529530(0x1c8)](_0x529530(0x186))));const _0x1249c9=_0x208b2f[_0x529530(0x1ae)]['split']('\x0a');_0x1249c9[_0x529530(0x1bb)](_0x4d4902=>{const _0x264a89=_0x529530;_0x4d4902[_0x264a89(0x1b4)]()&&_0x1df21b[_0x264a89(0x196)](_0x4d4902);});}if(_0x208b2f[_0x529530(0x1c9)]){_0x1df21b['push'](''),_0x1df21b[_0x529530(0x196)](String(a44_0x562dce[_0x529530(0x1a7)][_0x529530(0x1c8)](_0x529530(0x182))));const _0x1b04bc=_0x208b2f[_0x529530(0x1c9)]['split']('\x0a');_0x1b04bc[_0x529530(0x1bb)](_0x4104be=>{_0x4104be['trim']()&&_0x1df21b['push'](_0x4104be);});}}return _0x1df21b['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x3ecb90,_0x3a41bf){const _0x4dcf6c=a44_0x3d5c;if(_0x3a41bf[_0x4dcf6c(0x1c6)]===_0x4dcf6c(0x1ab)){await handleSDKOutput([_0x3ecb90],_0x3a41bf);return;}const _0x16b616=resolveOutputOptions(_0x3a41bf),_0x10164b=await formatSingleObject(_0x3ecb90,_0x16b616);await writeOutput(_0x10164b,_0x16b616[_0x4dcf6c(0x1ad)]||undefined,_0x16b616[_0x4dcf6c(0x1c6)]);}
|
|
1
|
+
(function(_0x5d9a2a,_0x506afa){const _0x4f0804=a44_0x5437,_0x1d212b=_0x5d9a2a();while(!![]){try{const _0x3c24e7=parseInt(_0x4f0804(0x1e7))/0x1*(parseInt(_0x4f0804(0x1df))/0x2)+-parseInt(_0x4f0804(0x1c4))/0x3*(-parseInt(_0x4f0804(0x1ea))/0x4)+-parseInt(_0x4f0804(0x1f1))/0x5+parseInt(_0x4f0804(0x1c5))/0x6+parseInt(_0x4f0804(0x1cf))/0x7*(parseInt(_0x4f0804(0x1c6))/0x8)+parseInt(_0x4f0804(0x1c1))/0x9*(parseInt(_0x4f0804(0x1ff))/0xa)+parseInt(_0x4f0804(0x1eb))/0xb*(-parseInt(_0x4f0804(0x1d9))/0xc);if(_0x3c24e7===_0x506afa)break;else _0x1d212b['push'](_0x1d212b['shift']());}catch(_0x3ae51a){_0x1d212b['push'](_0x1d212b['shift']());}}}(a44_0x8e12,0x1e589));import{writeFileSync}from'fs';function a44_0x5437(_0x4e2677,_0xc7e83b){_0x4e2677=_0x4e2677-0x1c1;const _0x8e12a2=a44_0x8e12();let _0x54372b=_0x8e12a2[_0x4e2677];return _0x54372b;}import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a44_0x3ff761 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x36a1c9){const _0xa3d6f3=a44_0x5437;return _0x36a1c9['format']===_0xa3d6f3(0x1e1)||_0x36a1c9[_0xa3d6f3(0x1ef)]===_0xa3d6f3(0x1d0)||_0x36a1c9[_0xa3d6f3(0x1ef)]===_0xa3d6f3(0x1d6)||_0x36a1c9[_0xa3d6f3(0x1ef)]===_0xa3d6f3(0x202)||_0x36a1c9[_0xa3d6f3(0x1e1)]===!![]||_0x36a1c9[_0xa3d6f3(0x1d0)]===!![]||_0x36a1c9[_0xa3d6f3(0x1d6)]===!![]||_0x36a1c9[_0xa3d6f3(0x202)]===!![];}export function parseOutputOptions(_0x2525dd){const _0x166117=a44_0x5437;return{'format':_0x2525dd[_0x166117(0x1ef)]||'table','output':_0x2525dd['output']||'','limit':_0x2525dd['limit'],'color':_0x2525dd['color'],'noColor':_0x2525dd['noColor']};}function convertSDKResultToQueryResult(_0x48c052){const _0xf3553d=a44_0x5437,_0x103bab=[];if(_0x48c052['length']>0x0){const _0x22917b=_0x48c052[0x0];for(const [_0x3d31c0,_0x154261]of Object['entries'](_0x22917b)){let _0x2a0bd5=_0xf3553d(0x1d1);if(typeof _0x154261===_0xf3553d(0x1ee))_0x2a0bd5=Number['isInteger'](_0x154261)?_0xf3553d(0x1e9):'double';else{if(typeof _0x154261===_0xf3553d(0x1e3))_0x2a0bd5=_0xf3553d(0x1e3);else _0x154261===null&&(_0x2a0bd5=_0xf3553d(0x1d1));}_0x103bab['push']({'name':_0x3d31c0,'type':_0x2a0bd5});}}return{'queryId':'sdk-result','columns':_0x103bab,'data':_0x48c052,'stats':{'state':_0xf3553d(0x1fd),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x48c052[_0xf3553d(0x1c3)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0xa1ffd0,_0x24d74e){const _0x2583c4=convertSDKResultToQueryResult(_0xa1ffd0);return formatQueryOutput(_0x2583c4,_0x24d74e);}export async function formatQueryOutput(_0x1079eb,_0x398408){const _0x5c8fd4=a44_0x5437,{format:_0x29ccae,limit:_0x315da9,output:_0x3ad7ff,color:_0x228862,noColor:_0x384660}=_0x398408,_0x570f67=Boolean(_0x3ad7ff)&&!_0x228862,_0x24e2ab={'color':_0x228862,'noColor':_0x384660||_0x570f67};if(_0x29ccae===_0x5c8fd4(0x202)){const _0x3540b3=shouldUseLess(_0x29ccae,_0x3ad7ff);return formatAsTable(_0x1079eb,_0x315da9,_0x3540b3,_0x24e2ab);}else{if(_0x29ccae===_0x5c8fd4(0x1e1))return formatAsJSON(_0x1079eb,_0x24e2ab);else return _0x29ccae===_0x5c8fd4(0x1d0)?formatAsJSONL(_0x1079eb,_0x24e2ab):formatQueryResult(_0x1079eb,_0x29ccae);}}function shouldUseLess(_0xbc906b,_0x556f6d){const _0x197ecd=a44_0x5437;return(_0xbc906b===_0x197ecd(0x202)||_0xbc906b===_0x197ecd(0x1cc))&&process[_0x197ecd(0x204)][_0x197ecd(0x1e8)]&&!_0x556f6d;}export function resolveOutputOptions(_0x190306){const _0x3dbd4e=a44_0x5437,_0x3d5403=resolveOutputFormat(_0x190306[_0x3dbd4e(0x1ef)],_0x190306[_0x3dbd4e(0x1fb)],'table');let _0x144acf=typeof _0x190306[_0x3dbd4e(0x1db)]===_0x3dbd4e(0x1ee)?_0x190306[_0x3dbd4e(0x1db)]:parseInt(_0x190306[_0x3dbd4e(0x1db)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0xe2e22e=_0x190306[_0x3dbd4e(0x1fb)]||'';return shouldUseLess(_0x3d5403,_0xe2e22e)&&(_0x144acf=Infinity),{'format':_0x3d5403,'output':_0xe2e22e,'limit':_0x144acf,'color':_0x190306[_0x3dbd4e(0x1f8)],'noColor':_0x190306['noColor']};}export function writeOutput(_0xa6a26e,_0x127193,_0x139b09){const _0x289d87=a44_0x5437;return _0x127193?(writeFileSync(_0x127193,_0xa6a26e),console[_0x289d87(0x1e6)]('Results\x20saved\x20to\x20'+_0x127193),Promise['resolve']()):shouldUseLess(_0x139b09||'','')?new Promise(_0x1d3d2a=>{const _0x15a101=_0x289d87,_0x345e06=spawn(_0x15a101(0x1f2),[_0x15a101(0x1de)],{'stdio':['pipe','inherit',_0x15a101(0x1fc)]});let _0x4feeb6=![];_0x345e06['on']('error',()=>{const _0xddff4b=_0x15a101;!_0x4feeb6&&(_0x4feeb6=!![],console[_0xddff4b(0x1d2)](_0xa6a26e),_0x1d3d2a());}),_0x345e06['on'](_0x15a101(0x1cd),()=>{!_0x4feeb6&&(_0x4feeb6=!![],_0x1d3d2a());}),_0x345e06['on'](_0x15a101(0x201),()=>{const _0xb5ad8e=_0x15a101;!_0x4feeb6&&_0x345e06['stdin']&&(_0x345e06[_0xb5ad8e(0x205)]['on'](_0xb5ad8e(0x1e6),()=>{}),_0x345e06[_0xb5ad8e(0x205)]['write'](_0xa6a26e),_0x345e06[_0xb5ad8e(0x205)]['end']());}),!_0x345e06[_0x15a101(0x205)]&&(!_0x4feeb6&&(_0x4feeb6=!![],console[_0x15a101(0x1d2)](_0xa6a26e),_0x1d3d2a()));}):(console[_0x289d87(0x1d2)](_0xa6a26e),Promise[_0x289d87(0x1d5)]());}export async function handleSDKOutput(_0x193851,_0x3a6498){const _0x322842=a44_0x5437,_0x171233=resolveOutputOptions(_0x3a6498),_0x21d34e=await formatSDKOutput(_0x193851,_0x171233);await writeOutput(_0x21d34e,_0x171233[_0x322842(0x1fb)]||undefined,_0x171233[_0x322842(0x1ef)]);}export async function handleQueryOutput(_0x1fdf1c,_0x59c99e){const _0x1df27c=a44_0x5437,_0x576593=resolveOutputOptions(_0x59c99e),_0x550a88=await formatQueryOutput(_0x1fdf1c,_0x576593);await writeOutput(_0x550a88,_0x576593[_0x1df27c(0x1fb)]||undefined,_0x576593['format']);}function a44_0x8e12(){const _0x267d01=['keys','max','─┬─','─┴─','list','close','forEach','14NdzNxb','jsonl','varchar','log','debug','stderr','resolve','tsv','params','entries','24cKdcPg','string','limit','magenta','yellow','-FXRSn','1992oLXFrY','trim','json','filter','boolean','query','repeat','error','216rZDcot','isTTY','bigint','901372ESPvxL','4651130QbSmmM','split','map','number','format','stringify','152620FaEtkl','less','push','cmdout','No\x20data','rule','cyan','color','bold','red','output','inherit','FINISHED','object','61630gjGsty','padEnd','spawn','table','[rule]','stdout','stdin','[query]','351QTLzxu','blue','length','3uuuWWj','518862mvYIkq','932672hyfoEj','join'];a44_0x8e12=function(){return _0x267d01;};return a44_0x8e12();}async function formatSingleObject(_0x23d168,_0x587dd7){const _0x5a112d=a44_0x5437,{format:_0x28d68e,color:_0x12a4bb,noColor:_0x25f12f}=_0x587dd7,_0x745cf2={'color':_0x12a4bb,'noColor':_0x25f12f};if(_0x28d68e===_0x5a112d(0x1e1)){if(shouldUseColor(_0x745cf2))return colorizeJSON(_0x23d168,_0x745cf2);return JSON[_0x5a112d(0x1f0)](_0x23d168,null,0x2);}else{if(_0x28d68e===_0x5a112d(0x1d0)){if(shouldUseColor(_0x745cf2))return colorizeJSONCompact(_0x23d168,_0x745cf2);return JSON[_0x5a112d(0x1f0)](_0x23d168);}else{if(_0x28d68e===_0x5a112d(0x1d6))return Object[_0x5a112d(0x1d8)](_0x23d168)[_0x5a112d(0x1ed)](([_0x2844e1,_0xf95840])=>_0x2844e1+'\x09'+_0xf95840)['join']('\x0a');else{const _0x24d1a8=Object[_0x5a112d(0x1d8)](_0x23d168);if(_0x24d1a8['length']===0x0)return _0x5a112d(0x1f5);const _0x4afc12=_0x23d168[_0x5a112d(0x1d3)],_0x5dde92=_0x23d168[_0x5a112d(0x1e4)],_0x3ff994=_0x23d168[_0x5a112d(0x1d7)],_0x23c2a2=_0x23d168[_0x5a112d(0x1f6)],_0x58791c=_0x5dde92?typeof _0x5dde92===_0x5a112d(0x1da)?_0x5dde92:JSON[_0x5a112d(0x1f0)](_0x5dde92,null,0x2):undefined,_0x49f577=_0x3ff994&&Object['keys'](_0x3ff994)[_0x5a112d(0x1c3)]>0x0?JSON['stringify'](_0x3ff994,null,0x2):undefined,_0x3b42a1=_0x23c2a2&&Object[_0x5a112d(0x1c8)](_0x23c2a2)[_0x5a112d(0x1c3)]>0x0?JSON['stringify'](_0x23c2a2,null,0x2):undefined,_0x3ef5e8=_0x24d1a8[_0x5a112d(0x1e2)](([_0x2b8a68])=>_0x2b8a68!==_0x5a112d(0x1d3)&&_0x2b8a68!=='query'&&_0x2b8a68!==_0x5a112d(0x1d7)&&_0x2b8a68!==_0x5a112d(0x1f6)),_0x24c31e=Math[_0x5a112d(0x1c9)](..._0x3ef5e8[_0x5a112d(0x1ed)](([_0x56b2dd])=>_0x56b2dd[_0x5a112d(0x1c3)])),_0x22992e=Math['max'](..._0x3ef5e8['map'](([,_0x1d930e])=>{const _0x31e65a=_0x5a112d;try{const _0x2f2d93=_0x1d930e===null||_0x1d930e===undefined?'':typeof _0x1d930e==='object'?JSON['stringify'](_0x1d930e):String(_0x1d930e),_0x11c08a=_0x2f2d93[_0x31e65a(0x1ec)]('\x0a');return Math[_0x31e65a(0x1c9)](..._0x11c08a[_0x31e65a(0x1ed)](_0xcae11f=>_0xcae11f[_0x31e65a(0x1c3)]),0x0);}catch{return 0x0;}}),0x14),_0x4c8958=[];_0x4c8958[_0x5a112d(0x1f3)](colorBorder('┌─'+'─'['repeat'](_0x24c31e)+_0x5a112d(0x1ca)+'─'[_0x5a112d(0x1e5)](_0x22992e)+'─┐',_0x745cf2)),_0x3ef5e8[_0x5a112d(0x1ce)](([_0x3ef532,_0x5d26a6])=>{const _0x4fdc8d=_0x5a112d;let _0x583a28;try{_0x583a28=_0x5d26a6===null||_0x5d26a6===undefined?'':typeof _0x5d26a6===_0x4fdc8d(0x1fe)?JSON[_0x4fdc8d(0x1f0)](_0x5d26a6):String(_0x5d26a6);}catch{_0x583a28='[Object]';}const _0x14ecb9=_0x3ef532['padEnd'](_0x24c31e),_0x1097e9=_0x583a28[_0x4fdc8d(0x1ec)]('\x0a');_0x1097e9[_0x4fdc8d(0x1ce)]((_0x11b755,_0xc5bcb1)=>{const _0x3c681=_0x4fdc8d,_0x4dc17a=colorBorder('│',_0x745cf2);_0xc5bcb1===0x0?_0x4c8958[_0x3c681(0x1f3)](_0x4dc17a+'\x20'+_0x14ecb9+'\x20'+_0x4dc17a+'\x20'+_0x11b755[_0x3c681(0x200)](_0x22992e)+'\x20'+_0x4dc17a):_0x4c8958[_0x3c681(0x1f3)](_0x4dc17a+'\x20'+'\x20'['repeat'](_0x24c31e)+'\x20'+_0x4dc17a+'\x20'+_0x11b755[_0x3c681(0x200)](_0x22992e)+'\x20'+_0x4dc17a);});}),_0x4c8958[_0x5a112d(0x1f3)](colorBorder('└─'+'─'[_0x5a112d(0x1e5)](_0x24c31e)+_0x5a112d(0x1cb)+'─'[_0x5a112d(0x1e5)](_0x22992e)+'─┘',_0x745cf2));_0x58791c&&(_0x4c8958[_0x5a112d(0x1f3)](''),_0x4c8958['push'](String(a44_0x3ff761[_0x5a112d(0x1dd)][_0x5a112d(0x1f9)](_0x5a112d(0x206)))),_0x4c8958[_0x5a112d(0x1f3)](_0x58791c));_0x49f577&&(_0x4c8958[_0x5a112d(0x1f3)](''),_0x4c8958['push'](String(a44_0x3ff761[_0x5a112d(0x1c2)][_0x5a112d(0x1f9)]('[params]'))),_0x4c8958['push'](_0x49f577));_0x3b42a1&&(_0x4c8958['push'](''),_0x4c8958[_0x5a112d(0x1f3)](String(a44_0x3ff761[_0x5a112d(0x1dc)]['bold'](_0x5a112d(0x203)))),_0x4c8958['push'](_0x3b42a1));if(_0x4afc12){if(_0x4afc12[_0x5a112d(0x1d4)]){_0x4c8958[_0x5a112d(0x1f3)](''),_0x4c8958[_0x5a112d(0x1f3)](String(a44_0x3ff761[_0x5a112d(0x1fa)][_0x5a112d(0x1f9)]('[error]')));const _0x58c59e=_0x4afc12[_0x5a112d(0x1d4)][_0x5a112d(0x1ec)]('\x0a');_0x58c59e['forEach'](_0x5a7097=>{const _0x40cd8e=_0x5a112d;_0x5a7097[_0x40cd8e(0x1e0)]()&&_0x4c8958['push'](_0x5a7097);});}if(_0x4afc12[_0x5a112d(0x1f4)]){_0x4c8958[_0x5a112d(0x1f3)](''),_0x4c8958[_0x5a112d(0x1f3)](String(a44_0x3ff761[_0x5a112d(0x1f7)][_0x5a112d(0x1f9)]('[logs]')));const _0x8d7013=_0x4afc12[_0x5a112d(0x1f4)][_0x5a112d(0x1ec)]('\x0a');_0x8d7013[_0x5a112d(0x1ce)](_0x248317=>{const _0x1e63b2=_0x5a112d;_0x248317[_0x1e63b2(0x1e0)]()&&_0x4c8958[_0x1e63b2(0x1f3)](_0x248317);});}}return _0x4c8958[_0x5a112d(0x1c7)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x10526c,_0x517ab1){const _0x35e1c8=a44_0x5437;if(_0x517ab1[_0x35e1c8(0x1ef)]==='table'){await handleSDKOutput([_0x10526c],_0x517ab1);return;}const _0x6504c3=resolveOutputOptions(_0x517ab1),_0x3ebbcf=await formatSingleObject(_0x10526c,_0x6504c3);await writeOutput(_0x3ebbcf,_0x6504c3[_0x35e1c8(0x1fb)]||undefined,_0x6504c3[_0x35e1c8(0x1ef)]);}
|