@treasuredata/tdx 0.13.0 → 0.13.1
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.d.ts +1 -1
- package/dist/cli-categories.js +1 -1
- package/dist/cli-categories.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/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.d.ts +1 -0
- package/dist/commands/journey-command.d.ts.map +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-command.js.map +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.d.ts.map +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-command.js.map +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.d.ts.map +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/parent-segment-command.js.map +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/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.d.ts.map +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-pull-command.js.map +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.d.ts +1 -1
- package/dist/commands/segments.d.ts.map +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/segments.js.map +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.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/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.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/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.d.ts +13 -1
- package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +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.d.ts +54 -19
- package/dist/sdk/journey.d.ts.map +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/journey.js.map +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-aliases.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/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.d.ts +47 -3
- package/dist/sdk/segment/journey-utils.d.ts.map +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-utils.js.map +1 -1
- package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +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.d.ts +2 -0
- package/dist/sdk/segment/pull-workflow.d.ts.map +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/pull-workflow.js.map +1 -1
- package/dist/sdk/segment/push-workflow.d.ts.map +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js.map +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.d.ts +42 -11
- package/dist/sdk/segment.d.ts.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/segment.js.map +1 -1
- package/dist/sdk/types/cdp.d.ts +71 -1
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/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.d.ts +3 -5
- package/dist/sdk/util/tree-formatter.d.ts.map +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/util/tree-formatter.js.map +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/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/json-loader.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 a38_0x3e0780=a38_0x544d;(function(_0xe2bedd,_0x418770){const _0x2d5290=a38_0x544d,_0x591bbb=_0xe2bedd();while(!![]){try{const _0x3e4d16=-parseInt(_0x2d5290(0x237))/0x1*(parseInt(_0x2d5290(0x1af))/0x2)+parseInt(_0x2d5290(0x1b8))/0x3+parseInt(_0x2d5290(0x1c5))/0x4+parseInt(_0x2d5290(0x19e))/0x5+-parseInt(_0x2d5290(0x208))/0x6+parseInt(_0x2d5290(0x253))/0x7*(-parseInt(_0x2d5290(0x206))/0x8)+parseInt(_0x2d5290(0x167))/0x9;if(_0x3e4d16===_0x418770)break;else _0x591bbb['push'](_0x591bbb['shift']());}catch(_0x46d91b){_0x591bbb['push'](_0x591bbb['shift']());}}}(a38_0x32b2,0x6998c));import a38_0x2eb555 from'chalk';import{existsSync}from'fs';import a38_0x4e4b26 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}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a38_0x454f8d from'prompts';function getAttemptStatusDisplay(_0x22aff1){const _0x1ecace=a38_0x544d;if(!_0x22aff1)return{'icon':'⏳','text':''};const {done:_0x202d34,success:_0x47e718,cancelRequested:_0x32aeac}=_0x22aff1;if(!_0x202d34)return _0x32aeac?{'icon':'🛑','text':a38_0x2eb555['yellow'](_0x1ecace(0x22a))}:{'icon':'🔄','text':a38_0x2eb555[_0x1ecace(0x223)]('running')};if(_0x47e718)return{'icon':'✅','text':a38_0x2eb555[_0x1ecace(0x290)](_0x1ecace(0x1b6))};return{'icon':'❌','text':a38_0x2eb555['red']('error')};}export class WorkflowBaseCommand extends BaseCommand{[a38_0x3e0780(0x1dc)](_0xe0f5e1,_0x18b633,_0x1585f6=0x0){const _0x343761=a38_0x3e0780;return _0xe0f5e1[_0x1585f6]||_0x18b633[_0x343761(0x23a)];}[a38_0x3e0780(0x1a8)](_0x2955ae,_0xfcfa4d,_0x399f9c=0x0){const _0x58d38c=a38_0x3e0780,_0x50aebb=this['resolveProject'](_0x2955ae,_0xfcfa4d,_0x399f9c);if(!_0x50aebb)return console[_0x58d38c(0x294)](a38_0x2eb555[_0x58d38c(0x1bf)](_0x58d38c(0x18a)),_0x58d38c(0x20c)),console[_0x58d38c(0x294)](a38_0x2eb555[_0x58d38c(0x1e8)](_0x58d38c(0x232))),null;return _0x50aebb;}[a38_0x3e0780(0x234)](_0x18ba62,_0x131717){const _0x459c82=a38_0x3e0780;if(_0x18ba62[0x0]){const _0x545483=_0x18ba62[0x0][_0x459c82(0x276)]('.');if(_0x545483['length']===0x1)return{'projectName':_0x545483[0x0],'workflowName':undefined};else return _0x545483[_0x459c82(0x239)]===0x2?{'projectName':_0x545483[0x0],'workflowName':_0x545483[0x1]}:(console['error'](a38_0x2eb555['red'](_0x459c82(0x18a)),_0x459c82(0x236)),null);}return{'projectName':_0x131717['workflowProject'],'workflowName':undefined};}[a38_0x3e0780(0x19f)](_0x11c257,_0x33603c,_0x1063a6=0x0){const _0x1cdef0=a38_0x3e0780;if(_0x11c257[_0x1063a6])return _0x11c257[_0x1063a6];if(_0x33603c[_0x1cdef0(0x23a)]){const _0x29f452=a38_0x4e4b26[_0x1cdef0(0x192)](process[_0x1cdef0(0x18d)](),_0x1cdef0(0x193),_0x33603c['workflowProject']);if(existsSync(a38_0x4e4b26[_0x1cdef0(0x192)](_0x29f452,_0x1cdef0(0x1c2))))return _0x29f452;}return undefined;}async[a38_0x3e0780(0x22d)](_0x422bbd,_0x243f9e,_0x28d7b4){const _0x10c7b3=a38_0x3e0780;try{const _0x1c3d49=await _0x422bbd[_0x10c7b3(0x27f)][_0x10c7b3(0x193)](_0x243f9e,{'limit':0x1});if(_0x1c3d49[_0x10c7b3(0x239)]>0x0){const _0x398082=_0x1c3d49[0x0]['id'],_0x1c9270=getWorkflowUrl(_0x28d7b4,_0x398082);console[_0x10c7b3(0x294)]('\x20\x20Console:\x20'+a38_0x2eb555[_0x10c7b3(0x1f1)](_0x1c9270));}}catch{}}}function a38_0x544d(_0x1f18ea,_0xaf45a3){_0x1f18ea=_0x1f18ea-0x15f;const _0x32b2ce=a38_0x32b2();let _0x544d68=_0x32b2ce[_0x1f18ea];return _0x544d68;}export class WorkflowUseCommand extends BaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x1a3);[a38_0x3e0780(0x1f5)]=a38_0x3e0780(0x1c3);async[a38_0x3e0780(0x21b)](_0x530da1){const _0x26984c=a38_0x3e0780,{options:_0x1a3153,args:_0x505714,tdx:_0x567323}=_0x530da1,_0x4a062b=_0x505714[0x0],_0x1f6082=_0x1a3153['clear'];if(_0x1f6082)return saveSessionContext({'workflow_project':undefined},_0x1a3153[_0x26984c(0x1c6)]),console[_0x26984c(0x16c)](a38_0x2eb555[_0x26984c(0x290)](_0x26984c(0x1cd))),0x0;if(!_0x4a062b)return console[_0x26984c(0x294)](a38_0x2eb555[_0x26984c(0x1bf)](_0x26984c(0x18a)),_0x26984c(0x20c)),console[_0x26984c(0x294)](a38_0x2eb555['dim'](_0x26984c(0x24a))),console['error'](a38_0x2eb555[_0x26984c(0x1e8)](_0x26984c(0x270))),0x1;const _0x113e6b=await withSpinner('Resolving\x20project\x20\x27'+_0x4a062b+_0x26984c(0x1a0),()=>_0x567323[_0x26984c(0x27f)][_0x26984c(0x17e)](_0x4a062b),{'verbose':_0x1a3153[_0x26984c(0x244)]}),{name:_0x431a1f}=_0x113e6b[_0x26984c(0x245)];return saveSessionContext({'workflow_project':_0x431a1f},_0x1a3153[_0x26984c(0x1c6)]),console[_0x26984c(0x16c)](a38_0x2eb555['green'](_0x26984c(0x1b4)+a38_0x2eb555[_0x26984c(0x1f1)](_0x431a1f))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x1a2);[a38_0x3e0780(0x1f5)]='List\x20all\x20workflow\x20projects';async[a38_0x3e0780(0x21b)](_0x3fd83b){const _0x51b7f1=a38_0x3e0780,{options:_0x1a0439,args:_0x92b799,tdx:_0x5dac2b}=_0x3fd83b,_0x16f896=_0x92b799[0x0];_0x1a0439[_0x51b7f1(0x244)]&&_0x16f896&&console[_0x51b7f1(0x294)](_0x51b7f1(0x26c)+_0x16f896);const _0x3068f3=await withSpinner(_0x51b7f1(0x203),()=>_0x5dac2b['workflow'][_0x51b7f1(0x1d8)](_0x16f896,{'limit':_0x1a0439[_0x51b7f1(0x1ab)]}),{'verbose':_0x1a0439[_0x51b7f1(0x244)]});let _0x200574=_0x3068f3[_0x51b7f1(0x245)];_0x200574['sort']((_0x558944,_0x1376ae)=>_0x558944[_0x51b7f1(0x170)][_0x51b7f1(0x24f)](_0x1376ae['name']));const _0x4cf206=_0x1a0439['limit']||0x64,_0x13bb40=_0x200574[_0x51b7f1(0x239)]>=_0x4cf206?a38_0x2eb555[_0x51b7f1(0x1e8)](_0x51b7f1(0x160)):'';console[_0x51b7f1(0x294)]('✔\x20Found\x20'+_0x200574[_0x51b7f1(0x239)]+_0x51b7f1(0x212)+(_0x200574['length']!==0x1?'s':'')+_0x13bb40);if(_0x1a0439[_0x51b7f1(0x266)]==='json'||_0x1a0439[_0x51b7f1(0x266)]==='jsonl'||_0x1a0439[_0x51b7f1(0x266)]===_0x51b7f1(0x1ec))await handleSDKOutput(_0x200574,_0x1a0439);else{if(_0x200574[_0x51b7f1(0x239)]===0x0)_0x16f896?console[_0x51b7f1(0x16c)](_0x51b7f1(0x20d)+_0x16f896):console['log'](_0x51b7f1(0x26a));else{const _0x588a10=_0x200574[_0x51b7f1(0x265)](_0x14aeb9=>{const _0xe2def9=_0x51b7f1,_0x2ad876=_0x14aeb9[_0xe2def9(0x1c1)]?.['some'](_0x23d630=>_0x23d630[_0xe2def9(0x1b5)]===_0xe2def9(0x280)),_0x5eb4ec=_0x2ad876?a38_0x2eb555[_0xe2def9(0x1e8)](_0xe2def9(0x1e4)):'';return _0xe2def9(0x235)+_0x14aeb9[_0xe2def9(0x170)]+_0x5eb4ec;});await writeOutput(_0x588a10[_0x51b7f1(0x192)]('\x0a'),_0x1a0439[_0x51b7f1(0x1f4)],_0x51b7f1(0x225));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a38_0x3e0780(0x170)]='workflow:workflows';[a38_0x3e0780(0x1f5)]=a38_0x3e0780(0x285);async[a38_0x3e0780(0x21b)](_0x184971){const _0x192bf4=a38_0x3e0780,{options:_0x180686,args:_0x121859,tdx:_0x4cf2ce}=_0x184971,_0x161fc0=this[_0x192bf4(0x1dc)](_0x121859,_0x180686);_0x180686[_0x192bf4(0x244)]&&_0x161fc0&&console['error'](_0x192bf4(0x178)+_0x161fc0);const _0x349c5f=await withSpinner('Listing\x20workflows...',()=>_0x4cf2ce[_0x192bf4(0x27f)][_0x192bf4(0x193)](_0x161fc0,{'limit':_0x180686[_0x192bf4(0x1ab)]}),{'verbose':_0x180686['verbose']});let _0x109c58=_0x349c5f['data'];_0x109c58[_0x192bf4(0x209)]((_0x340af5,_0x156b26)=>{const _0x337f07=_0x192bf4,_0x5468bf=_0x340af5[_0x337f07(0x170)][_0x337f07(0x24f)](_0x156b26['name']);if(_0x5468bf!==0x0)return _0x5468bf;return(_0x340af5['project']?.[_0x337f07(0x170)]||'')[_0x337f07(0x24f)](_0x156b26['project']?.[_0x337f07(0x170)]||'');});const _0x3e0840=_0x180686[_0x192bf4(0x1ab)]||0x64,_0x5ecb3c=_0x109c58['length']>=_0x3e0840?a38_0x2eb555[_0x192bf4(0x1e8)](_0x192bf4(0x160)):'';console[_0x192bf4(0x294)](_0x192bf4(0x17a)+_0x109c58[_0x192bf4(0x239)]+'\x20workflow'+(_0x109c58[_0x192bf4(0x239)]!==0x1?'s':'')+_0x5ecb3c);if(_0x180686['format']===_0x192bf4(0x1d2)||_0x180686['format']===_0x192bf4(0x1ae)||_0x180686[_0x192bf4(0x266)]===_0x192bf4(0x1ec))await handleSDKOutput(_0x109c58,_0x180686);else{if(_0x109c58[_0x192bf4(0x239)]===0x0)_0x161fc0?console['log'](_0x192bf4(0x214)+_0x161fc0):console[_0x192bf4(0x16c)](_0x192bf4(0x176));else{const _0x23b75d=_0x180686[_0x192bf4(0x217)],_0x5c6c0e=_0x109c58[_0x192bf4(0x265)](_0x36a92b=>{const _0x2ab788=_0x192bf4,_0x1e8648=a38_0x2eb555[_0x2ab788(0x1e8)]('#'+_0x36a92b['id']),_0x863c64=hyperlink(_0x1e8648,getWorkflowUrl(_0x23b75d,_0x36a92b['id'])),_0x36d683=_0x36a92b[_0x2ab788(0x240)]?.[_0x2ab788(0x170)]?a38_0x2eb555[_0x2ab788(0x1e8)]('\x20('+_0x36a92b[_0x2ab788(0x240)][_0x2ab788(0x170)]+')'):'';return _0x2ab788(0x271)+_0x863c64+'\x20'+_0x36a92b[_0x2ab788(0x170)]+_0x36d683;});await writeOutput(_0x5c6c0e[_0x192bf4(0x192)]('\x0a'),_0x180686['output'],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a38_0x3e0780(0x170)]='workflow:sessions';['description']=a38_0x3e0780(0x23c);async[a38_0x3e0780(0x21b)](_0x1f2dc6){const _0x4906da=a38_0x3e0780,{options:_0x1227c9,args:_0x108829,tdx:_0x201747}=_0x1f2dc6,_0x3c8dd4=this[_0x4906da(0x234)](_0x108829,_0x1227c9);if(!_0x3c8dd4)return 0x1;const {projectName:_0x4d6bce,workflowName:_0x2635d3}=_0x3c8dd4;if(_0x1227c9[_0x4906da(0x244)]){if(_0x4d6bce&&_0x2635d3)console['error'](_0x4906da(0x27c)+_0x4d6bce+'.'+_0x2635d3);else _0x4d6bce&&console[_0x4906da(0x294)](_0x4906da(0x20b)+_0x4d6bce);const _0x1a0fb0=_0x1227c9['status'];_0x1a0fb0&&console[_0x4906da(0x294)](_0x4906da(0x21d)+_0x1a0fb0);}const _0x294da1=await withSpinner(_0x4906da(0x221),()=>_0x201747['workflow'][_0x4906da(0x281)]({'projectName':_0x4d6bce,'workflowName':_0x2635d3,'status':_0x1227c9[_0x4906da(0x293)],'fromTime':_0x1227c9[_0x4906da(0x211)],'toTime':_0x1227c9['to'],'limit':_0x1227c9[_0x4906da(0x1ab)]}),{'verbose':_0x1227c9[_0x4906da(0x244)]}),_0x41e351=_0x294da1[_0x4906da(0x245)];_0x41e351[_0x4906da(0x209)]((_0x4e57e4,_0x1a661f)=>{const _0x43fc79=_0x4906da,_0x525d78=_0x4e57e4['sessionTime']||'',_0x336a8d=_0x1a661f['sessionTime']||'';return _0x336a8d[_0x43fc79(0x24f)](_0x525d78);});const _0x557360=_0x1227c9[_0x4906da(0x1ab)]||0x64,_0xfa9bd8=_0x41e351[_0x4906da(0x239)]>=_0x557360?a38_0x2eb555[_0x4906da(0x1e8)](_0x4906da(0x160)):'';console[_0x4906da(0x294)]('✔\x20Found\x20'+_0x41e351['length']+_0x4906da(0x238)+(_0x41e351['length']!==0x1?'s':'')+_0xfa9bd8);if(_0x1227c9[_0x4906da(0x266)]===_0x4906da(0x1d2)||_0x1227c9[_0x4906da(0x266)]===_0x4906da(0x1ae)||_0x1227c9[_0x4906da(0x266)]==='table')await handleSDKOutput(_0x41e351,_0x1227c9);else{if(_0x41e351['length']===0x0){if(_0x4d6bce&&_0x2635d3)console[_0x4906da(0x16c)](_0x4906da(0x286)+_0x4d6bce+'.'+_0x2635d3);else _0x4d6bce?console[_0x4906da(0x16c)](_0x4906da(0x1d1)+_0x4d6bce):console[_0x4906da(0x16c)](_0x4906da(0x202));}else{const _0x40666c=_0x1227c9[_0x4906da(0x217)],_0x78397c=_0x41e351[_0x4906da(0x265)](_0x255f45=>{const _0x1fde9b=_0x4906da,_0x26fb6f=a38_0x2eb555[_0x1fde9b(0x1e8)]('#'+_0x255f45['id']),_0x25d37b=_0x255f45[_0x1fde9b(0x240)]?.['id'],_0x3a3147=_0x25d37b?hyperlink(_0x26fb6f,getWorkflowSessionUrl(_0x40666c,_0x25d37b,_0x255f45['id'])):_0x26fb6f,{icon:_0x558164,text:_0x1966c8}=getAttemptStatusDisplay(_0x255f45[_0x1fde9b(0x195)]),_0x4b0d10=(_0x255f45['project']?.['name']||'?')+'.'+(_0x255f45['workflow']?.[_0x1fde9b(0x170)]||'?'),_0x33d963=_0x255f45[_0x1fde9b(0x16d)]?a38_0x2eb555[_0x1fde9b(0x1e8)](_0x255f45['sessionTime']):'';return(_0x3a3147+'\x20'+_0x558164+(_0x1966c8?'\x20'+_0x1966c8:'')+'\x20'+_0x4b0d10+'\x20'+_0x33d963)['trimEnd']();});await writeOutput(_0x78397c['join']('\x0a'),_0x1227c9[_0x4906da(0x1f4)],_0x4906da(0x225));}}return 0x0;}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']=a38_0x3e0780(0x27d);['description']='List\x20workflow\x20attempts';async[a38_0x3e0780(0x21b)](_0x18cd62){const _0x4376f9=a38_0x3e0780,{options:_0x1e957b,args:_0x2fd04d,tdx:_0x5bf720}=_0x18cd62,_0x52e26e=this[_0x4376f9(0x234)](_0x2fd04d,_0x1e957b);if(!_0x52e26e)return 0x1;const {projectName:_0x5c4241,workflowName:_0x95d4f3}=_0x52e26e,_0x1b5b88=_0x1e957b[_0x4376f9(0x1f9)];if(_0x1e957b[_0x4376f9(0x244)]){if(_0x5c4241&&_0x95d4f3)console['error']('Filter:\x20'+_0x5c4241+'.'+_0x95d4f3);else _0x5c4241&&console[_0x4376f9(0x294)]('Filter:\x20project='+_0x5c4241);_0x1b5b88&&console[_0x4376f9(0x294)](_0x4376f9(0x27a));}const _0x5b9318=await withSpinner(_0x4376f9(0x1ac),()=>_0x5bf720['workflow'][_0x4376f9(0x1e2)]({'projectName':_0x5c4241,'workflowName':_0x95d4f3,'includeRetried':_0x1b5b88,'limit':_0x1e957b['limit']}),{'verbose':_0x1e957b[_0x4376f9(0x244)]}),_0x7aeda=_0x5b9318[_0x4376f9(0x245)],_0x38231d=_0x1e957b['limit']||0x64,_0x45a7a6=_0x7aeda['length']>=_0x38231d?a38_0x2eb555[_0x4376f9(0x1e8)](_0x4376f9(0x160)):'';console[_0x4376f9(0x294)](_0x4376f9(0x17a)+_0x7aeda[_0x4376f9(0x239)]+_0x4376f9(0x200)+(_0x7aeda[_0x4376f9(0x239)]!==0x1?'s':'')+_0x45a7a6);if(_0x1e957b['format']==='json'||_0x1e957b['format']===_0x4376f9(0x1ae)||_0x1e957b[_0x4376f9(0x266)]===_0x4376f9(0x1ec))await handleSDKOutput(_0x7aeda,_0x1e957b);else{if(_0x7aeda[_0x4376f9(0x239)]===0x0){if(_0x5c4241&&_0x95d4f3)console['log'](_0x4376f9(0x28c)+_0x5c4241+'.'+_0x95d4f3);else _0x5c4241?console['log'](_0x4376f9(0x22e)+_0x5c4241):console[_0x4376f9(0x16c)](_0x4376f9(0x1b9));}else{const _0x195a83=_0x1e957b[_0x4376f9(0x217)],_0x3f4907=_0x7aeda['map'](_0x5c096c=>{const _0x448a58=_0x4376f9,_0x374bba=a38_0x2eb555['dim']('#'+_0x5c096c['id']),_0x15ee04=_0x5c096c[_0x448a58(0x240)]?.['id'],_0x10a66d=_0x5c096c[_0x448a58(0x161)]||_0x5c096c[_0x448a58(0x260)],_0x3aec35=_0x15ee04&&_0x10a66d?hyperlink(_0x374bba,getWorkflowAttemptUrl(_0x195a83,_0x15ee04,_0x10a66d,_0x5c096c['id'])):_0x374bba,{icon:_0x19ac7b,text:_0x4123a7}=getAttemptStatusDisplay(_0x5c096c),_0x453c86=(_0x5c096c['project']?.[_0x448a58(0x170)]||'?')+'.'+(_0x5c096c[_0x448a58(0x27f)]?.['name']||'?'),_0xd7f771=_0x5c096c['sessionTime']?a38_0x2eb555[_0x448a58(0x1e8)](_0x5c096c[_0x448a58(0x16d)]):'';return(_0x3aec35+'\x20'+_0x19ac7b+(_0x4123a7?'\x20'+_0x4123a7:'')+'\x20'+_0x453c86+'\x20'+_0xd7f771)[_0x448a58(0x28d)]();});await writeOutput(_0x3f4907[_0x4376f9(0x192)]('\x0a'),_0x1e957b[_0x4376f9(0x1f4)],_0x4376f9(0x225));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x25e);[a38_0x3e0780(0x1f5)]=a38_0x3e0780(0x25b);async[a38_0x3e0780(0x21b)](_0x4f343f){const _0xe9151e=a38_0x3e0780,{options:_0x4391c9,args:_0x19bdf7,tdx:_0x5a6725}=_0x4f343f,_0x5d27ef=_0x19bdf7[0x0];if(!_0x5d27ef)return console['error'](_0xe9151e(0x259)),0x1;_0x4391c9[_0xe9151e(0x244)]&&console[_0xe9151e(0x294)](_0xe9151e(0x166)+_0x5d27ef);const _0x6915ce=await withSpinner(_0xe9151e(0x1b2),()=>_0x5a6725[_0xe9151e(0x27f)][_0xe9151e(0x289)](_0x5d27ef),{'verbose':_0x4391c9[_0xe9151e(0x244)]}),_0x360ed0=_0x6915ce[_0xe9151e(0x245)];let _0xe0c5dd;!_0x360ed0[_0xe9151e(0x255)]?_0xe0c5dd=_0x360ed0[_0xe9151e(0x1de)]?'canceling':_0xe9151e(0x1f6):_0xe0c5dd=_0x360ed0['success']?_0xe9151e(0x1b6):_0xe9151e(0x294);let _0x118b0e;if(_0x360ed0[_0xe9151e(0x263)]&&_0x360ed0['finishedAt']){const _0x4c440c=new Date(_0x360ed0[_0xe9151e(0x263)])[_0xe9151e(0x1ad)](),_0x16e21b=new Date(_0x360ed0['finishedAt'])[_0xe9151e(0x1ad)]();_0x118b0e=Math[_0xe9151e(0x254)]((_0x16e21b-_0x4c440c)/0x3e8);}const _0xf0a304={'attempt_id':_0x360ed0['id'],'status':_0xe0c5dd,..._0x360ed0['index']!==undefined&&{'index':_0x360ed0[_0xe9151e(0x274)]},..._0x360ed0[_0xe9151e(0x240)]&&{'project':_0x360ed0['project'][_0xe9151e(0x170)]},..._0x360ed0[_0xe9151e(0x27f)]&&{'workflow':_0x360ed0[_0xe9151e(0x27f)]['name']},..._0x360ed0[_0xe9151e(0x260)]&&{'session_id':_0x360ed0[_0xe9151e(0x260)]},..._0x360ed0[_0xe9151e(0x16d)]&&{'session_time':_0x360ed0['sessionTime']},..._0x360ed0[_0xe9151e(0x15f)]&&{'retry_attempt':_0x360ed0[_0xe9151e(0x15f)]},..._0x118b0e!==undefined&&{'duration_sec':_0x118b0e},..._0x360ed0[_0xe9151e(0x263)]&&{'created_at':_0x360ed0[_0xe9151e(0x263)]},..._0x360ed0['finishedAt']&&{'finished_at':_0x360ed0['finishedAt']},...Object['keys'](_0x360ed0[_0xe9151e(0x1ba)])[_0xe9151e(0x239)]>0x0&&{'params':_0x360ed0[_0xe9151e(0x1ba)]}};return await handleSingleObjectOutput(_0xf0a304,_0x4391c9),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x1b7);['description']='Show\x20tasks\x20for\x20an\x20attempt';async[a38_0x3e0780(0x21b)](_0x58013d){const _0x2de131=a38_0x3e0780,{options:_0xa16590,args:_0x3bb54f,tdx:_0x361079}=_0x58013d,_0x87dc68=_0x3bb54f[0x0];if(!_0x87dc68)return console[_0x2de131(0x294)](_0x2de131(0x259)),0x1;const _0x38eac7=_0xa16590[_0x2de131(0x20f)];_0xa16590[_0x2de131(0x244)]&&(console['error'](_0x2de131(0x166)+_0x87dc68),_0x38eac7&&console[_0x2de131(0x294)]('Including\x20subtasks:\x20yes'));const _0x57a661=await withSpinner(_0x2de131(0x174),()=>_0x361079[_0x2de131(0x27f)][_0x2de131(0x230)](_0x87dc68,_0x38eac7||![]),{'verbose':_0xa16590[_0x2de131(0x244)]}),_0xd6f126=_0x57a661[_0x2de131(0x245)];return console['error'](_0x2de131(0x17a)+_0xd6f126[_0x2de131(0x239)]+_0x2de131(0x17f)+(_0xd6f126[_0x2de131(0x239)]!==0x1?'s':'')),await handleSDKOutput(_0xd6f126,_0xa16590),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a38_0x3e0780(0x1f0);[a38_0x3e0780(0x1f5)]=a38_0x3e0780(0x16a);async[a38_0x3e0780(0x21b)](_0x461fa2){const _0x3d3b5a=a38_0x3e0780,{options:_0x15274c,args:_0x5ee0b5,tdx:_0x13b679}=_0x461fa2,_0x5f562e=_0x5ee0b5[0x0];let _0x3ef5c5=_0x5ee0b5[0x1];if(!_0x5f562e)return console[_0x3d3b5a(0x294)](_0x3d3b5a(0x259)),0x1;_0x15274c[_0x3d3b5a(0x244)]&&(console[_0x3d3b5a(0x294)](_0x3d3b5a(0x166)+_0x5f562e),_0x3ef5c5&&console[_0x3d3b5a(0x294)](_0x3d3b5a(0x181)+_0x3ef5c5));const _0x4084d8=await withSpinner('Fetching\x20log\x20files...',()=>_0x13b679['workflow']['logFiles'](_0x5f562e,_0x3ef5c5),{'verbose':_0x15274c[_0x3d3b5a(0x244)]}),_0x4a4d64=_0x4084d8[_0x3d3b5a(0x245)];if(_0x4a4d64[_0x3d3b5a(0x239)]===0x0)return console[_0x3d3b5a(0x294)](_0x3d3b5a(0x21c)),0x0;if(!_0x3ef5c5&&(_0x15274c[_0x3d3b5a(0x1d2)]||_0x15274c['format']))return await handleSDKOutput(_0x4a4d64,_0x15274c),0x0;if(!_0x3ef5c5){const _0x10acd4=_0x4a4d64[_0x3d3b5a(0x265)](_0x39f314=>({'title':_0x39f314[_0x3d3b5a(0x21a)]+'\x20('+formatBytes(_0x39f314['fileSize'])+')','value':_0x39f314[_0x3d3b5a(0x21a)]})),_0x53941b=await a38_0x454f8d({'type':_0x3d3b5a(0x23f),'name':_0x3d3b5a(0x279),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x10acd4});if(!_0x53941b[_0x3d3b5a(0x279)])return console[_0x3d3b5a(0x294)]('Cancelled'),0x0;_0x3ef5c5=_0x53941b[_0x3d3b5a(0x279)];}const _0x4fac53=await withSpinner('Downloading\x20logs...',()=>_0x13b679[_0x3d3b5a(0x27f)]['logs'](_0x5f562e,_0x3ef5c5),{'verbose':_0x15274c[_0x3d3b5a(0x244)]}),_0x18ca13=_0x4fac53[_0x3d3b5a(0x245)];return _0x18ca13?console[_0x3d3b5a(0x16c)](_0x18ca13):console[_0x3d3b5a(0x294)](_0x3d3b5a(0x24e)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x1be);['description']=a38_0x3e0780(0x243);async[a38_0x3e0780(0x21b)](_0x36cf03){const _0x796b1e=a38_0x3e0780,{options:_0x20d7f5,args:_0x36d23f,tdx:_0x205940}=_0x36cf03,_0x3d0831=_0x36d23f[0x0];if(!_0x3d0831)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x2bf422=_0x20d7f5[_0x796b1e(0x1ca)];_0x20d7f5['verbose']&&(console[_0x796b1e(0x294)](_0x796b1e(0x166)+_0x3d0831),_0x2bf422&&console[_0x796b1e(0x294)]('Reason:\x20'+_0x2bf422));if(!_0x20d7f5[_0x796b1e(0x264)]){const _0x4af64f=await confirmKey(_0x796b1e(0x1ff)+_0x3d0831+'?');if(!_0x4af64f)return console['error'](_0x796b1e(0x250)),0x0;}const _0x58cd68=await withSpinner(_0x796b1e(0x26e),()=>_0x205940['workflow'][_0x796b1e(0x204)](_0x3d0831,_0x2bf422),{'verbose':_0x20d7f5[_0x796b1e(0x244)]}),_0x24500d=_0x58cd68[_0x796b1e(0x245)];return console[_0x796b1e(0x294)]('✔\x20'+_0x24500d),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x1c0);[a38_0x3e0780(0x1f5)]='Retry\x20a\x20session\x20or\x20attempt';async[a38_0x3e0780(0x21b)](_0x5f47fc){const _0x436d6d=a38_0x3e0780,{options:_0x439322,args:_0x5eec66,tdx:_0x4a9881}=_0x5f47fc,_0x49832d=_0x5eec66[0x0];if(!_0x49832d)return console['error'](_0x436d6d(0x1aa)),console[_0x436d6d(0x294)](_0x436d6d(0x19c)),0x1;let _0x4329a8=![],_0x2ff7af=_0x49832d;if(_0x49832d[_0x436d6d(0x1fe)]('session:'))_0x4329a8=!![],_0x2ff7af=_0x49832d[_0x436d6d(0x21e)](0x8);else{if(_0x49832d[_0x436d6d(0x1fe)](_0x436d6d(0x173)))_0x4329a8=![],_0x2ff7af=_0x49832d[_0x436d6d(0x21e)](0x8);else return console[_0x436d6d(0x294)](_0x436d6d(0x19b)),console[_0x436d6d(0x294)](_0x436d6d(0x19c)),0x1;}const _0x53b859=_0x439322[_0x436d6d(0x1e9)],_0x9c46ff=_0x439322[_0x436d6d(0x269)],_0x366bfc=_0x439322['params'],_0x50da28=_0x439322[_0x436d6d(0x1f7)];_0x439322['verbose']&&(console['error']('Target:\x20'+(_0x4329a8?'session':_0x436d6d(0x289))+'\x20'+_0x2ff7af),_0x53b859&&console[_0x436d6d(0x294)](_0x436d6d(0x28e)+_0x53b859),_0x9c46ff&&console[_0x436d6d(0x294)](_0x436d6d(0x262)+_0x9c46ff),_0x366bfc&&console[_0x436d6d(0x294)]('Params:\x20'+_0x366bfc),_0x50da28&&console[_0x436d6d(0x294)](_0x436d6d(0x1e5)));let _0x70f2ae;if(_0x366bfc)try{if(_0x366bfc[_0x436d6d(0x1fe)]('@')){const _0x56eacc=await import('fs/promises'),_0x1711f0=_0x366bfc[_0x436d6d(0x21e)](0x1),_0x51262d=await _0x56eacc[_0x436d6d(0x28f)](_0x1711f0,'utf-8');_0x70f2ae=JSON['parse'](_0x51262d);}else _0x70f2ae=JSON[_0x436d6d(0x1c4)](_0x366bfc);}catch{return console[_0x436d6d(0x294)](_0x436d6d(0x196)),0x1;}if(!_0x439322[_0x436d6d(0x264)]){const _0x29c2e6=await confirmKey(_0x436d6d(0x23d)+(_0x4329a8?_0x436d6d(0x1c6):_0x436d6d(0x289))+'\x20'+_0x2ff7af+'?');if(!_0x29c2e6)return console[_0x436d6d(0x294)]('Cancelled'),0x0;}let _0x3d4446;_0x4329a8?_0x3d4446=await withSpinner(_0x436d6d(0x249),()=>_0x4a9881[_0x436d6d(0x27f)][_0x436d6d(0x291)](_0x2ff7af,{'fromTask':_0x53b859,'retryParams':_0x70f2ae}),{'verbose':_0x439322['verbose']}):_0x3d4446=await withSpinner(_0x436d6d(0x187),()=>_0x4a9881[_0x436d6d(0x27f)]['retryAttempt'](_0x2ff7af,{'resumeFrom':_0x9c46ff,'retryParams':_0x70f2ae,'force':_0x50da28}),{'verbose':_0x439322[_0x436d6d(0x244)]});const _0x323ac1=_0x3d4446['data'];return console[_0x436d6d(0x294)](_0x436d6d(0x16b)),console['error'](_0x436d6d(0x26b)+_0x323ac1[_0x436d6d(0x21f)]),console[_0x436d6d(0x294)](_0x436d6d(0x283)+_0x323ac1[_0x436d6d(0x260)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x190);['description']=a38_0x3e0780(0x288);async[a38_0x3e0780(0x21b)](_0xeb535){const _0x3fb43c=a38_0x3e0780,{options:_0x58bfa5,args:_0x19bec2,tdx:_0x23eaf3}=_0xeb535;let _0x1aa0d6=_0x19bec2[0x0];if(!_0x1aa0d6){const _0x3f144a=this[_0x3fb43c(0x1dc)]([],_0x58bfa5),_0x1b4012=await withSpinner(_0x3fb43c(0x1ee),()=>_0x23eaf3[_0x3fb43c(0x27f)][_0x3fb43c(0x193)](_0x3f144a,{'limit':_0x58bfa5['limit']}),{'verbose':_0x58bfa5[_0x3fb43c(0x244)]}),_0x266dd1=_0x1b4012[_0x3fb43c(0x245)];if(_0x266dd1[_0x3fb43c(0x239)]===0x0)return console[_0x3fb43c(0x294)](_0x3fb43c(0x176)),!_0x3f144a&&console[_0x3fb43c(0x294)](a38_0x2eb555['dim'](_0x3fb43c(0x232))),0x1;const _0x21d4cf=_0x266dd1[_0x3fb43c(0x265)](_0x528218=>({'title':_0x528218[_0x3fb43c(0x240)]?.[_0x3fb43c(0x170)]+'.'+_0x528218['name'],'value':_0x528218[_0x3fb43c(0x240)]?.[_0x3fb43c(0x170)]+'.'+_0x528218[_0x3fb43c(0x170)],'description':_0x528218[_0x3fb43c(0x180)]?_0x3fb43c(0x222)+_0x528218['revision']:undefined})),_0x1e63ce=await a38_0x454f8d({'type':_0x3fb43c(0x23f),'name':'workflow','message':_0x3fb43c(0x268),'choices':_0x21d4cf});if(!_0x1e63ce[_0x3fb43c(0x27f)])return 0x1;_0x1aa0d6=_0x1e63ce[_0x3fb43c(0x27f)];}if(!_0x1aa0d6[_0x3fb43c(0x272)]('.')){const _0x8964b1=this['resolveProject']([],_0x58bfa5);if(_0x8964b1)_0x1aa0d6=_0x8964b1+'.'+_0x1aa0d6;else return console[_0x3fb43c(0x294)](a38_0x2eb555[_0x3fb43c(0x1bf)](_0x3fb43c(0x18a)),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console[_0x3fb43c(0x294)](a38_0x2eb555[_0x3fb43c(0x1e8)](_0x3fb43c(0x232))),0x1;}const _0x52fd54=_0x58bfa5[_0x3fb43c(0x1e3)],_0x548cd6=_0x58bfa5[_0x3fb43c(0x16d)],_0xf87b7b={};if(_0x52fd54&&Array[_0x3fb43c(0x20a)](_0x52fd54))for(const _0xf23d8d of _0x52fd54){const _0x5c459b=_0xf23d8d[_0x3fb43c(0x25a)]('=');if(_0x5c459b===-0x1)return console[_0x3fb43c(0x294)](_0x3fb43c(0x258)+_0xf23d8d),console['error']('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x4e077e=_0xf23d8d[_0x3fb43c(0x21e)](0x0,_0x5c459b),_0x212f16=_0xf23d8d[_0x3fb43c(0x21e)](_0x5c459b+0x1);try{_0xf87b7b[_0x4e077e]=JSON[_0x3fb43c(0x1c4)](_0x212f16);}catch{_0xf87b7b[_0x4e077e]=_0x212f16;}}_0x58bfa5[_0x3fb43c(0x244)]&&(console[_0x3fb43c(0x294)](_0x3fb43c(0x1d4)+_0x1aa0d6),Object['keys'](_0xf87b7b)[_0x3fb43c(0x239)]>0x0&&console[_0x3fb43c(0x294)]('Parameters:\x20'+JSON[_0x3fb43c(0x1fa)](_0xf87b7b)),_0x548cd6&&console[_0x3fb43c(0x294)](_0x3fb43c(0x218)+_0x548cd6));const _0x5b9229=await withSpinner(_0x3fb43c(0x24b),()=>_0x23eaf3[_0x3fb43c(0x27f)]['run'](_0x1aa0d6,_0xf87b7b,{'sessionTime':_0x548cd6}),{'verbose':_0x58bfa5[_0x3fb43c(0x244)]}),_0x2db429=_0x5b9229[_0x3fb43c(0x245)];console['error'](_0x3fb43c(0x246)),console['error'](_0x3fb43c(0x247)+_0x2db429['id']),console[_0x3fb43c(0x294)](_0x3fb43c(0x283)+_0x2db429['sessionId']),console[_0x3fb43c(0x294)]('\x20\x20Project:\x20'+_0x2db429['project']?.[_0x3fb43c(0x170)]),console[_0x3fb43c(0x294)](_0x3fb43c(0x201)+_0x2db429['workflow']?.[_0x3fb43c(0x170)]);if(_0x2db429[_0x3fb43c(0x240)]?.['id']&&_0x2db429['sessionId']&&_0x2db429['id']){const _0x4ca85a=_0x58bfa5['site'],_0x1d4922=getConsoleUrl(_0x4ca85a,'/app/workflows/'+_0x2db429[_0x3fb43c(0x240)]['id']+_0x3fb43c(0x1bc)+_0x2db429[_0x3fb43c(0x260)]+_0x3fb43c(0x18f)+_0x2db429['id']);console['error'](_0x3fb43c(0x1a4)+a38_0x2eb555[_0x3fb43c(0x1f1)](_0x1d4922));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x172);['description']='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a38_0x3e0780(0x21b)](_0x2a6e67){const _0x3725f3=a38_0x3e0780,{options:_0x8b21e4,args:_0xd9e36f,tdx:_0x37d866}=_0x2a6e67,_0x4adc59=_0xd9e36f[0x0],_0x3acdf4=_0xd9e36f[0x1]||'.';if(!_0x4adc59)return console[_0x3725f3(0x294)](_0x3725f3(0x1e7)),console['error']('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x9b3406=_0x8b21e4[_0x3725f3(0x180)];_0x8b21e4[_0x3725f3(0x244)]&&(console[_0x3725f3(0x294)](_0x3725f3(0x184)+_0x4adc59),console['error']('Output\x20directory:\x20'+_0x3acdf4),_0x9b3406&&console['error'](_0x3725f3(0x163)+_0x9b3406));const _0x5b5cdc=await withSpinner(_0x3725f3(0x1b1)+_0x4adc59+_0x3725f3(0x183),()=>_0x37d866[_0x3725f3(0x27f)][_0x3725f3(0x23e)](_0x4adc59,_0x3acdf4,{'revision':_0x9b3406}),{'verbose':_0x8b21e4[_0x3725f3(0x244)]}),_0x449ac3=_0x5b5cdc[_0x3725f3(0x245)];return console[_0x3725f3(0x294)](_0x3725f3(0x1a1)+_0x449ac3[_0x3725f3(0x241)]),console[_0x3725f3(0x294)](_0x3725f3(0x162)+_0x449ac3[_0x3725f3(0x180)]),console[_0x3725f3(0x294)]('\x20\x20Files\x20extracted:\x20'+_0x449ac3[_0x3725f3(0x18e)]),console[_0x3725f3(0x294)](_0x3725f3(0x1eb)+_0x3acdf4+'/'+_0x449ac3[_0x3725f3(0x241)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x1c8);[a38_0x3e0780(0x1f5)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async['execute'](_0x591667){const _0x540707=a38_0x3e0780,{options:_0x5e1b62,args:_0x577444,tdx:_0x4a23f7}=_0x591667;let _0x235f30='.',_0x382d1b=_0x5e1b62['name'];if(_0x577444[0x0]){const {promises:_0x10fd0f}=await import('fs');try{const _0x357686=await _0x10fd0f['stat'](_0x577444[0x0]);if(_0x357686['isDirectory']())_0x235f30=_0x577444[0x0];else return console['error'](_0x540707(0x1dd)+_0x577444[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x382d1b=_0x577444[0x0],_0x235f30='.';}}const _0x126038=_0x5e1b62[_0x540707(0x180)],_0x341056=_0x5e1b62[_0x540707(0x23b)];_0x5e1b62[_0x540707(0x244)]&&(console[_0x540707(0x294)](_0x540707(0x1e1)+_0x235f30),_0x382d1b&&console[_0x540707(0x294)](_0x540707(0x1a6)+_0x382d1b),_0x126038&&console['error']('Revision:\x20'+_0x126038),_0x341056&&console[_0x540707(0x294)](_0x540707(0x28b)));const _0x2fd605=await withSpinner(_0x540707(0x198),()=>_0x4a23f7[_0x540707(0x27f)][_0x540707(0x1b0)](_0x235f30,{'projectName':_0x382d1b,'revision':_0x126038,'skipValidation':_0x341056}),{'verbose':_0x5e1b62[_0x540707(0x244)]}),_0xd2359c=_0x2fd605[_0x540707(0x245)];return console['error'](_0x540707(0x278)+_0xd2359c['projectName']),console[_0x540707(0x294)](_0x540707(0x1df)+_0xd2359c[_0x540707(0x1d0)]),console['error'](_0x540707(0x162)+_0xd2359c['revision']),await this[_0x540707(0x22d)](_0x4a23f7,_0xd2359c[_0x540707(0x241)],_0x5e1b62[_0x540707(0x217)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a38_0x3e0780(0x170)]='workflow:pull';['description']=a38_0x3e0780(0x189);async['execute'](_0x376aeb){const _0x3e8022=a38_0x3e0780,{options:_0x5ae26f,args:_0x2219e7,tdx:_0x4a8308}=_0x376aeb,_0x224ec8=_0x2219e7[0x0],_0x2d2de8=_0x2219e7[0x1];if(!_0x224ec8)return console[_0x3e8022(0x294)](a38_0x2eb555[_0x3e8022(0x1bf)](_0x3e8022(0x18a)),_0x3e8022(0x20c)),console[_0x3e8022(0x294)](a38_0x2eb555[_0x3e8022(0x1e8)](_0x3e8022(0x16e))),0x1;const _0x4930f9=_0x5ae26f[_0x3e8022(0x180)];_0x5ae26f[_0x3e8022(0x244)]&&(console[_0x3e8022(0x294)](_0x3e8022(0x184)+_0x224ec8),_0x2d2de8&&console[_0x3e8022(0x294)](_0x3e8022(0x175)+_0x2d2de8),_0x4930f9&&console[_0x3e8022(0x294)]('Revision:\x20'+_0x4930f9),_0x5ae26f[_0x3e8022(0x251)]&&console[_0x3e8022(0x294)](_0x3e8022(0x1d6)));const _0x345bad=await withSpinner(_0x3e8022(0x229)+_0x224ec8+_0x3e8022(0x183),()=>_0x4a8308[_0x3e8022(0x27f)][_0x3e8022(0x194)](_0x224ec8,{'targetDir':_0x2d2de8,'revision':_0x4930f9}),{'verbose':_0x5ae26f[_0x3e8022(0x244)]}),_0x2778dd=_0x345bad['data'];_0x2778dd[_0x3e8022(0x177)]?console[_0x3e8022(0x294)](_0x3e8022(0x256)+_0x2778dd[_0x3e8022(0x241)]):console[_0x3e8022(0x294)](_0x3e8022(0x205)+_0x2778dd[_0x3e8022(0x241)]);console['error'](_0x3e8022(0x162)+_0x2778dd[_0x3e8022(0x180)]),console[_0x3e8022(0x294)](_0x3e8022(0x1f3)+(a38_0x4e4b26[_0x3e8022(0x267)](process[_0x3e8022(0x18d)](),_0x2778dd[_0x3e8022(0x231)])||'.')),console[_0x3e8022(0x294)]('\x20\x20Changes:\x20'+a38_0x2eb555[_0x3e8022(0x290)]('+'+_0x2778dd[_0x3e8022(0x284)][_0x3e8022(0x275)]+_0x3e8022(0x17c))+',\x20'+(a38_0x2eb555[_0x3e8022(0x252)]('~'+_0x2778dd[_0x3e8022(0x284)][_0x3e8022(0x1e6)]+_0x3e8022(0x1a5))+',\x20')+(a38_0x2eb555[_0x3e8022(0x1bf)]('-'+_0x2778dd[_0x3e8022(0x284)]['deleted']+_0x3e8022(0x1db))+',\x20')+(''+a38_0x2eb555[_0x3e8022(0x1e8)](_0x2778dd['summary'][_0x3e8022(0x1cb)]+'\x20unchanged')));for(const _0x476367 of _0x2778dd[_0x3e8022(0x191)]){_0x476367[_0x3e8022(0x1a7)]==='modified'&&_0x476367[_0x3e8022(0x257)]&&(console['error']('\x0a'+a38_0x2eb555['cyan'](_0x3e8022(0x1d9)+_0x476367[_0x3e8022(0x16f)])),console[_0x3e8022(0x294)](_0x476367['diff']));}if(!_0x2778dd[_0x3e8022(0x165)])return saveSessionContext({'workflow_project':_0x2778dd[_0x3e8022(0x241)]},_0x5ae26f[_0x3e8022(0x1c6)]),console['error'](a38_0x2eb555['green'](_0x3e8022(0x1c7))),console['error'](a38_0x2eb555[_0x3e8022(0x1e8)](_0x3e8022(0x18c)+_0x2778dd[_0x3e8022(0x241)])),0x0;if(_0x5ae26f[_0x3e8022(0x251)])return console[_0x3e8022(0x294)](a38_0x2eb555[_0x3e8022(0x252)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x5ae26f[_0x3e8022(0x264)]){const _0xe03f49=await confirmKey(_0x3e8022(0x1d5));if(!_0xe03f49)return console[_0x3e8022(0x294)](_0x3e8022(0x250)),0x0;}await withSpinner(_0x3e8022(0x1fc),()=>_0x4a8308[_0x3e8022(0x27f)][_0x3e8022(0x1d3)](_0x2778dd,{'revision':_0x4930f9}),{'verbose':_0x5ae26f[_0x3e8022(0x244)]}),saveSessionContext({'workflow_project':_0x2778dd['projectName']},_0x5ae26f[_0x3e8022(0x1c6)]),console[_0x3e8022(0x294)](a38_0x2eb555['green'](_0x3e8022(0x22b)));const _0x167b94=a38_0x4e4b26['relative'](process[_0x3e8022(0x18d)](),_0x2778dd[_0x3e8022(0x231)])||'.';return console[_0x3e8022(0x294)](a38_0x2eb555[_0x3e8022(0x1e8)](_0x3e8022(0x1eb)+_0x167b94)),console[_0x3e8022(0x294)](a38_0x2eb555[_0x3e8022(0x1e8)](_0x3e8022(0x18c)+_0x2778dd[_0x3e8022(0x241)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x277);[a38_0x3e0780(0x1f5)]=a38_0x3e0780(0x261);async[a38_0x3e0780(0x21b)](_0x2e72cf){const _0x2e3fc8=a38_0x3e0780,{options:_0x1fc362,args:_0x4873f7,tdx:_0x2038ba}=_0x2e72cf,_0x47dc2a=this[_0x2e3fc8(0x19f)](_0x4873f7,_0x1fc362),_0x158a28=_0x1fc362[_0x2e3fc8(0x180)],_0x36a5a4=_0x1fc362[_0x2e3fc8(0x23b)];_0x1fc362[_0x2e3fc8(0x244)]&&(_0x47dc2a&&console[_0x2e3fc8(0x294)](_0x2e3fc8(0x227)+_0x47dc2a),_0x158a28&&console[_0x2e3fc8(0x294)](_0x2e3fc8(0x163)+_0x158a28),_0x1fc362[_0x2e3fc8(0x251)]&&console[_0x2e3fc8(0x294)]('Dry\x20run:\x20yes'),_0x36a5a4&&console[_0x2e3fc8(0x294)](_0x2e3fc8(0x28b)));let _0x324d62;try{_0x324d62=await withSpinner(_0x2e3fc8(0x26f),()=>_0x2038ba['workflow'][_0x2e3fc8(0x1a9)]({'sourceDir':_0x47dc2a,'revision':_0x158a28,'skipValidation':_0x36a5a4}),{'verbose':_0x1fc362[_0x2e3fc8(0x244)]});}catch(_0x5e78ce){if(_0x5e78ce instanceof Error&&_0x5e78ce[_0x2e3fc8(0x197)][_0x2e3fc8(0x272)](_0x2e3fc8(0x1d7)))return console['error'](a38_0x2eb555['red']('Error:'),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x1fc362[_0x2e3fc8(0x23a)]?console['error'](a38_0x2eb555[_0x2e3fc8(0x1e8)](_0x2e3fc8(0x24d)+_0x1fc362['workflowProject']+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x1fc362['workflowProject']+'\x27')):console[_0x2e3fc8(0x294)](a38_0x2eb555[_0x2e3fc8(0x1e8)](_0x2e3fc8(0x1cf))),0x1;throw _0x5e78ce;}const _0x34b4de=_0x324d62[_0x2e3fc8(0x245)];console['error'](_0x2e3fc8(0x205)+_0x34b4de[_0x2e3fc8(0x241)]),console[_0x2e3fc8(0x294)](_0x2e3fc8(0x22c)+_0x34b4de['sourceDir']),console[_0x2e3fc8(0x294)](_0x2e3fc8(0x162)+_0x34b4de[_0x2e3fc8(0x180)]),console[_0x2e3fc8(0x294)]('\x20\x20Changes:\x20'+a38_0x2eb555[_0x2e3fc8(0x290)]('+'+_0x34b4de[_0x2e3fc8(0x284)][_0x2e3fc8(0x275)]+'\x20new')+',\x20'+(a38_0x2eb555[_0x2e3fc8(0x252)]('~'+_0x34b4de[_0x2e3fc8(0x284)][_0x2e3fc8(0x1e6)]+_0x2e3fc8(0x1a5))+',\x20')+(a38_0x2eb555['red']('-'+_0x34b4de['summary'][_0x2e3fc8(0x1ea)]+_0x2e3fc8(0x1db))+',\x20')+(''+a38_0x2eb555['dim'](_0x34b4de[_0x2e3fc8(0x284)][_0x2e3fc8(0x1cb)]+_0x2e3fc8(0x1ed))));for(const _0x211831 of _0x34b4de[_0x2e3fc8(0x191)]){_0x211831[_0x2e3fc8(0x1a7)]==='modified'&&_0x211831['diff']&&(console[_0x2e3fc8(0x294)]('\x0a'+a38_0x2eb555[_0x2e3fc8(0x1f1)](_0x2e3fc8(0x1d9)+_0x211831[_0x2e3fc8(0x16f)])),console[_0x2e3fc8(0x294)](_0x211831['diff']));}if(!_0x34b4de['hasChanges'])return console[_0x2e3fc8(0x294)](a38_0x2eb555[_0x2e3fc8(0x290)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x2e3fc8(0x22d)](_0x2038ba,_0x34b4de[_0x2e3fc8(0x241)],_0x1fc362['site']),0x0;if(_0x1fc362['dryRun'])return console[_0x2e3fc8(0x294)](a38_0x2eb555[_0x2e3fc8(0x252)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x1fc362['yes']){const _0x19f688=await confirmKey(_0x2e3fc8(0x1fb));if(!_0x19f688)return console[_0x2e3fc8(0x294)]('Cancelled'),0x0;}const _0x157700=await withSpinner('Pushing\x20project...',()=>_0x2038ba['workflow'][_0x2e3fc8(0x228)](_0x34b4de),{'verbose':_0x1fc362[_0x2e3fc8(0x244)]}),_0x2a0338=_0x157700[_0x2e3fc8(0x245)];return console['error'](a38_0x2eb555[_0x2e3fc8(0x290)](_0x2e3fc8(0x169))),console[_0x2e3fc8(0x294)]('\x20\x20Project\x20ID:\x20'+_0x2a0338['projectId']),console['error']('\x20\x20Revision:\x20'+_0x2a0338['revision']),await this['showWorkflowConsoleUrl'](_0x2038ba,_0x2a0338[_0x2e3fc8(0x241)],_0x1fc362['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x287);['description']='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a38_0x3e0780(0x21b)](_0x1b895b){const _0x2466b6=a38_0x3e0780,{options:_0x75dd56,args:_0x2f7554,tdx:_0x18959c}=_0x1b895b,_0x2bd1fc=this['resolveProjectDir'](_0x2f7554,_0x75dd56),_0x503ec2=_0x75dd56[_0x2466b6(0x170)],_0x2a70bc=_0x75dd56[_0x2466b6(0x180)],_0x5d5059=_0x75dd56[_0x2466b6(0x23b)];if(!_0x2bd1fc)return console[_0x2466b6(0x294)](a38_0x2eb555[_0x2466b6(0x1bf)](_0x2466b6(0x18a)),_0x2466b6(0x22f)),console[_0x2466b6(0x294)](a38_0x2eb555['dim']('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x2466b6(0x294)](a38_0x2eb555[_0x2466b6(0x1e8)](_0x2466b6(0x1c9))),0x1;if(!_0x503ec2)return console[_0x2466b6(0x294)](a38_0x2eb555[_0x2466b6(0x1bf)](_0x2466b6(0x18a)),_0x2466b6(0x215)),console[_0x2466b6(0x294)](a38_0x2eb555[_0x2466b6(0x1e8)](_0x2466b6(0x24c))),0x1;_0x75dd56[_0x2466b6(0x244)]&&(console[_0x2466b6(0x294)](_0x2466b6(0x227)+_0x2bd1fc),console[_0x2466b6(0x294)](_0x2466b6(0x17b)+_0x503ec2),_0x2a70bc&&console[_0x2466b6(0x294)]('Revision:\x20'+_0x2a70bc),_0x75dd56['dryRun']&&console[_0x2466b6(0x294)](_0x2466b6(0x1d6)),_0x5d5059&&console[_0x2466b6(0x294)]('Validation:\x20skipped'));const _0x1a1c31=await withSpinner(_0x2466b6(0x1e0),()=>_0x18959c[_0x2466b6(0x27f)][_0x2466b6(0x213)](_0x2bd1fc,_0x503ec2,{'revision':_0x2a70bc,'skipValidation':_0x5d5059}),{'verbose':_0x75dd56['verbose']}),_0xf98ef5=_0x1a1c31['data'];console[_0x2466b6(0x294)]('Source:\x20'+_0xf98ef5['sourceDir']);_0xf98ef5[_0x2466b6(0x1cc)]&&console['error'](_0x2466b6(0x1ce)+_0xf98ef5['sourceProjectName']);console[_0x2466b6(0x294)](_0x2466b6(0x17b)+_0xf98ef5[_0x2466b6(0x1da)]),console[_0x2466b6(0x294)](_0x2466b6(0x163)+_0xf98ef5['revision']),console['error'](_0x2466b6(0x182)+_0xf98ef5[_0x2466b6(0x25c)]);_0xf98ef5['targetExists']&&(console[_0x2466b6(0x294)](a38_0x2eb555[_0x2466b6(0x252)](_0x2466b6(0x292)+_0xf98ef5['newProjectName']+_0x2466b6(0x19a)+_0xf98ef5['existingProjectId']+')')),console[_0x2466b6(0x294)](a38_0x2eb555[_0x2466b6(0x252)](_0x2466b6(0x248))));if(_0x75dd56[_0x2466b6(0x251)])return console[_0x2466b6(0x294)](a38_0x2eb555[_0x2466b6(0x252)](_0x2466b6(0x1ef))),0x0;if(!_0x75dd56['yes']){const _0x115b43=_0xf98ef5[_0x2466b6(0x1cc)]||a38_0x4e4b26['basename'](_0x2bd1fc),_0x162438=_0xf98ef5['targetExists']?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x503ec2+_0x2466b6(0x179):_0x2466b6(0x1f2)+_0x115b43+_0x2466b6(0x20e)+_0x503ec2+'\x22?',_0xc0b5b=await confirmKey(_0x162438);if(!_0xc0b5b)return console['error'](_0x2466b6(0x250)),0x0;}const _0x5738dd=await withSpinner(_0xf98ef5[_0x2466b6(0x219)]?_0x2466b6(0x1fd)+_0x503ec2+'...':_0x2466b6(0x164)+_0x503ec2+_0x2466b6(0x183),()=>_0x18959c[_0x2466b6(0x27f)][_0x2466b6(0x27e)](_0xf98ef5),{'verbose':_0x75dd56[_0x2466b6(0x244)]}),_0x20bdc8=_0x5738dd[_0x2466b6(0x245)];return console[_0x2466b6(0x294)](a38_0x2eb555[_0x2466b6(0x290)](_0xf98ef5['targetExists']?'✔\x20Project\x20updated':_0x2466b6(0x17d))),console[_0x2466b6(0x294)](_0x2466b6(0x1bb)+_0x20bdc8[_0x2466b6(0x1da)]),console[_0x2466b6(0x294)](_0x2466b6(0x1df)+_0x20bdc8[_0x2466b6(0x171)]),console[_0x2466b6(0x294)](_0x2466b6(0x162)+_0x20bdc8[_0x2466b6(0x180)]),await this[_0x2466b6(0x22d)](_0x18959c,_0x20bdc8[_0x2466b6(0x1da)],_0x75dd56[_0x2466b6(0x217)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a38_0x3e0780(0x1f8);[a38_0x3e0780(0x1f5)]=a38_0x3e0780(0x220);async['execute'](_0x367f91){const _0x57cc9b=a38_0x3e0780,{options:_0x5def54,args:_0x3134bd,tdx:_0x17ade9}=_0x367f91,_0x3430c6=_0x3134bd[0x0];if(!_0x3430c6)return console[_0x57cc9b(0x294)](_0x57cc9b(0x188)),console[_0x57cc9b(0x294)](_0x57cc9b(0x19d)),0x1;_0x5def54['verbose']&&console['error'](_0x57cc9b(0x184)+_0x3430c6);if(!_0x5def54['yes']){const _0x36d3b5=await confirmKey(_0x57cc9b(0x282)+_0x3430c6+_0x57cc9b(0x18b));if(!_0x36d3b5)return console[_0x57cc9b(0x294)](_0x57cc9b(0x250)),0x0;}const _0x556038=await withSpinner('Deleting\x20project\x20'+_0x3430c6+_0x57cc9b(0x183),()=>_0x17ade9[_0x57cc9b(0x27f)]['delete'](_0x3430c6),{'verbose':_0x5def54[_0x57cc9b(0x244)]}),_0x4dc307=_0x556038['data'];return console[_0x57cc9b(0x294)](_0x57cc9b(0x168)+_0x4dc307[_0x57cc9b(0x241)]),console[_0x57cc9b(0x294)](_0x57cc9b(0x1df)+_0x4dc307[_0x57cc9b(0x1d0)]),0x0;}}function a38_0x32b2(){const _0x43885f=['Project\x20filter:\x20','\x22\x20with\x20new\x20revision?','✔\x20Found\x20','New\x20project\x20name:\x20','\x20new','✔\x20Clone\x20complete','resolveProjectId','\x20task','revision','Task\x20name:\x20','Files\x20to\x20upload:\x20','...','Project:\x20','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Error:\x20KEY=VALUE\x20is\x20required','Retrying\x20attempt...','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Pull\x20workflow\x20project\x20to\x20local\x20folder','Error:','\x22?\x20This\x20cannot\x20be\x20undone.','\x20\x20Session\x20context\x20set\x20to:\x20','cwd','filesExtracted','/attempt/','workflow:run','changes','join','workflows','pullProject','lastAttempt','Error:\x20Invalid\x20JSON\x20in\x20--params','message','Pushing\x20workflow\x20project...','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','\x22\x20already\x20exists\x20(ID:\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Usage:\x20workflow:delete\x20<project-name-or-id>','464955rTXAFK','resolveProjectDir','\x27...','✔\x20Downloaded\x20','workflow:projects','workflow:use','\x20\x20Console:\x20','\x20modified','Project\x20name:\x20','type','requireProject','preparePushProject','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','limit','Listing\x20workflow\x20attempts...','getTime','jsonl','23804iNzOTl','push','Downloading\x20project\x20','Getting\x20attempt\x20details...','workflow:secrets:delete','✔\x20Workflow\x20project\x20set\x20to:\x20','key','success','workflow:tasks','303135eSwjDQ','No\x20attempts\x20found','params','\x20\x20Project:\x20','/sessions/','listSecrets','workflow:kill','red','workflow:retry','metadata','tdx.json','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','parse','2967220UNafus','session','\x0a✔\x20Already\x20up\x20to\x20date','workflow:upload','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','reason','unchanged','sourceProjectName','✔\x20Workflow\x20project\x20context\x20cleared.','Source\x20project:\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','projectId','No\x20sessions\x20found\x20in\x20project:\x20','json','applyPullProject','Workflow:\x20','\x0aApply\x20these\x20changes?','Dry\x20run:\x20yes','No\x20workflow\x20tdx.json\x20found','projects','---\x20','newProjectName','\x20deleted','resolveProject','Error:\x20','cancelRequested','\x20\x20Project\x20ID:\x20','Analyzing\x20project...','Project\x20directory:\x20','attempts','param','\x20(system)','Force:\x20yes','modified','Error:\x20Project\x20name\x20is\x20required','dim','fromTask','deleted','\x20\x20Location:\x20','table','\x20unchanged','Loading\x20workflows...','\x0aDry\x20run\x20-\x20no\x20project\x20created','workflow:logs','cyan','\x0aClone\x20\x22','\x20\x20Target:\x20','output','description','running','force','workflow:delete','includeRetried','stringify','\x0aPush\x20these\x20changes?','Writing\x20files...','Updating\x20','startsWith','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','\x20attempt','\x20\x20Workflow:\x20','No\x20sessions\x20found','Listing\x20workflow\x20projects...','kill','✔\x20Project:\x20','8qvGfXu','workflow:secrets:set','362646BBlQbb','sort','isArray','Filter:\x20project=','Project\x20name\x20is\x20required','No\x20projects\x20match\x20pattern:\x20','\x22\x20to\x20new\x20project\x20\x22','includeSubtasks','Setting\x20secret...','from','\x20project','prepareCloneProject','No\x20workflows\x20found\x20in\x20project:\x20','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','site','Session\x20time:\x20','targetExists','taskName','execute','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Status:\x20','substring','attemptId','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Listing\x20workflow\x20sessions...','revision:\x20','blue','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','list','Listing\x20secrets...','Source\x20directory:\x20','executePushProject','Pulling\x20project\x20','canceling','✔\x20Pull\x20complete','\x20\x20Source:\x20','showWorkflowConsoleUrl','No\x20attempts\x20found\x20in\x20project:\x20','Source\x20directory\x20is\x20required','tasks','targetDir','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','workflow:secrets:list','parseProjectWorkflowPattern','📁\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','59TDQnje','\x20session','length','workflowProject','skipValidation','List\x20workflow\x20execution\x20sessions','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','download','select','project','projectName','✔\x20Secret\x20\x27','Kill\x20a\x20running\x20attempt','verbose','data','✔\x20Workflow\x20run\x20started','\x20\x20Attempt\x20ID:\x20','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','Retrying\x20session...','Usage:\x20tdx\x20wf\x20use\x20<project>','Starting\x20workflow\x20run...','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Tip:\x20cd\x20to\x20workflows/','No\x20log\x20content\x20found','localeCompare','Cancelled','dryRun','yellow','573601oFWHkm','round','done','✔\x20New\x20project:\x20','diff','Error:\x20Invalid\x20parameter\x20format:\x20','Error:\x20Attempt\x20ID\x20is\x20required','indexOf','Show\x20specific\x20attempt\x20details','fileCount','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','workflow:attempt','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','sessionId','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Resume\x20from:\x20','createdAt','yes','map','format','relative','Select\x20a\x20workflow\x20to\x20run','resumeFrom','No\x20workflow\x20projects\x20found','\x20\x20New\x20attempt\x20ID:\x20','Pattern:\x20','deleteSecret','Killing\x20attempt...','Analyzing\x20changes...','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','📋\x20','includes','Key:\x20','index','new','split','workflow:push','✔\x20Pushed\x20','task','Include\x20retried:\x20yes','\x20secret','Filter:\x20','workflow:attempts','executeCloneProject','workflow','sys','sessions','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','\x20\x20Session\x20ID:\x20','summary','List\x20workflows','No\x20sessions\x20found\x20for:\x20','workflow:clone','Start\x20a\x20workflow\x20run','attempt','setSecret','Validation:\x20skipped','No\x20attempts\x20found\x20for:\x20','trimEnd','From\x20task:\x20','readFile','green','retrySession','\x0a⚠\x20Project\x20\x22','status','error','retryAttemptName','\x20(use\x20--limit\x20to\x20show\x20more)','session_id','\x20\x20Revision:\x20','Revision:\x20','Cloning\x20to\x20','hasChanges','Attempt\x20ID:\x20','3071565pjmyWv','✔\x20Deleted\x20project\x20','✔\x20Push\x20complete','Show\x20logs\x20for\x20a\x20workflow\x20attempt','✔\x20Retry\x20started','log','sessionTime','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','path','name','newProjectId','workflow:download','attempt:','Getting\x20attempt\x20tasks...','Target\x20directory:\x20','No\x20workflows\x20found','isNewProject'];a38_0x32b2=function(){return _0x43885f;};return a38_0x32b2();}export function parseKeyValue(_0x42e6da){const _0x59d64c=a38_0x3e0780,_0x230504=_0x42e6da[_0x59d64c(0x25a)]('=');if(_0x230504===-0x1)throw new Error('Invalid\x20format:\x20'+_0x42e6da+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x6cb7da=_0x42e6da[_0x59d64c(0x21e)](0x0,_0x230504),_0x4b049f=_0x42e6da[_0x59d64c(0x21e)](_0x230504+0x1);if(!_0x6cb7da)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x6cb7da,'value':_0x4b049f};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x233);[a38_0x3e0780(0x1f5)]=a38_0x3e0780(0x216);async[a38_0x3e0780(0x21b)](_0x1e9e94){const _0x5deec8=a38_0x3e0780,{options:_0x2e744a,args:_0x17ef42,tdx:_0xe81020}=_0x1e9e94,_0x56460c=this[_0x5deec8(0x1a8)](_0x17ef42,_0x2e744a);if(!_0x56460c)return 0x1;_0x2e744a[_0x5deec8(0x244)]&&console[_0x5deec8(0x294)](_0x5deec8(0x184)+_0x56460c);const _0x5129ad=await withSpinner(_0x5deec8(0x226),()=>_0xe81020[_0x5deec8(0x27f)][_0x5deec8(0x1bd)](_0x56460c),{'verbose':_0x2e744a[_0x5deec8(0x244)]}),{secrets:_0x367da7}=_0x5129ad[_0x5deec8(0x245)];return console[_0x5deec8(0x294)](_0x5deec8(0x17a)+_0x367da7[_0x5deec8(0x239)]+_0x5deec8(0x27b)+(_0x367da7[_0x5deec8(0x239)]!==0x1?'s':'')),await handleSDKOutput(_0x367da7,_0x2e744a),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x207);[a38_0x3e0780(0x1f5)]=a38_0x3e0780(0x199);async[a38_0x3e0780(0x21b)](_0x3ad818){const _0xbb5958=a38_0x3e0780,{options:_0x434d78,args:_0x4422cc,tdx:_0x1c1c62}=_0x3ad818;let _0x194ae6,_0xc915c6;if(_0x4422cc[_0xbb5958(0x239)]>=0x2)_0x194ae6=_0x4422cc[0x0],_0xc915c6=_0x4422cc[0x1];else{if(_0x4422cc[_0xbb5958(0x239)]===0x1&&_0x434d78[_0xbb5958(0x23a)])_0x194ae6=_0x434d78['workflowProject'],_0xc915c6=_0x4422cc[0x0];else return _0x4422cc[_0xbb5958(0x239)]===0x1?(console[_0xbb5958(0x294)](_0xbb5958(0x1e7)),console[_0xbb5958(0x294)](_0xbb5958(0x232)),0x1):(console[_0xbb5958(0x294)](_0xbb5958(0x186)),console['error'](_0xbb5958(0x25f)),0x1);}let _0x1cd632,_0x2793e2;try{({key:_0x1cd632,value:_0x2793e2}=parseKeyValue(_0xc915c6));}catch(_0x229d13){return _0x229d13 instanceof Error&&console[_0xbb5958(0x294)](a38_0x2eb555[_0xbb5958(0x1bf)](_0xbb5958(0x18a)),_0x229d13[_0xbb5958(0x197)]),0x1;}_0x434d78[_0xbb5958(0x244)]&&(console[_0xbb5958(0x294)](_0xbb5958(0x184)+_0x194ae6),console[_0xbb5958(0x294)](_0xbb5958(0x273)+_0x1cd632));const _0x5eec15=await withSpinner(_0xbb5958(0x210),()=>_0x1c1c62[_0xbb5958(0x27f)][_0xbb5958(0x28a)](_0x194ae6,_0x1cd632,_0x2793e2),{'verbose':_0x434d78[_0xbb5958(0x244)]}),_0x2dd7ab=_0x5eec15['data'];return console[_0xbb5958(0x294)](_0xbb5958(0x242)+_0x2dd7ab['key']+_0xbb5958(0x185)+_0x2dd7ab['projectName']+'\x27'),(_0x434d78[_0xbb5958(0x1d2)]||_0x434d78[_0xbb5958(0x1ae)])&&await handleSingleObjectOutput(_0x2dd7ab,_0x434d78),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x1b3);[a38_0x3e0780(0x1f5)]=a38_0x3e0780(0x224);async[a38_0x3e0780(0x21b)](_0x7380d0){const _0x144590=a38_0x3e0780,{options:_0x2f219f,args:_0x35d623,tdx:_0x20bed3}=_0x7380d0;let _0x20d6fa,_0x33c9cd;if(_0x35d623['length']>=0x2)_0x20d6fa=_0x35d623[0x0],_0x33c9cd=_0x35d623[0x1];else{if(_0x35d623[_0x144590(0x239)]===0x1&&_0x2f219f[_0x144590(0x23a)])_0x20d6fa=_0x2f219f[_0x144590(0x23a)],_0x33c9cd=_0x35d623[0x0];else return _0x35d623[_0x144590(0x239)]===0x1?(console['error'](_0x144590(0x1e7)),console[_0x144590(0x294)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x144590(0x294)]('Error:\x20Secret\x20key\x20is\x20required'),console[_0x144590(0x294)]('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x2f219f[_0x144590(0x244)]&&(console[_0x144590(0x294)](_0x144590(0x184)+_0x20d6fa),console[_0x144590(0x294)]('Key:\x20'+_0x33c9cd));if(!_0x2f219f[_0x144590(0x264)]){const _0x458c46=await confirmKey(_0x144590(0x25d)+_0x33c9cd+'\x27\x20from\x20project\x20\x27'+_0x20d6fa+'\x27?');if(!_0x458c46)return console['error'](_0x144590(0x250)),0x0;}const _0x53438d=await withSpinner('Deleting\x20secret...',()=>_0x20bed3[_0x144590(0x27f)][_0x144590(0x26d)](_0x20d6fa,_0x33c9cd),{'verbose':_0x2f219f['verbose']}),_0x5ca577=_0x53438d[_0x144590(0x245)];return console['error'](_0x144590(0x242)+_0x5ca577[_0x144590(0x1b5)]+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x5ca577['projectName']+'\x27'),(_0x2f219f[_0x144590(0x1d2)]||_0x2f219f[_0x144590(0x1ae)])&&await handleSingleObjectOutput(_0x5ca577,_0x2f219f),0x0;}}
|
|
1
|
+
const a38_0x2f1d07=a38_0x32de;(function(_0xf6ad25,_0x532c0b){const _0x32d9ec=a38_0x32de,_0x42db89=_0xf6ad25();while(!![]){try{const _0x3a25f1=parseInt(_0x32d9ec(0x22e))/0x1+parseInt(_0x32d9ec(0x225))/0x2*(-parseInt(_0x32d9ec(0x143))/0x3)+parseInt(_0x32d9ec(0x17a))/0x4+parseInt(_0x32d9ec(0x1ba))/0x5*(-parseInt(_0x32d9ec(0x1aa))/0x6)+-parseInt(_0x32d9ec(0x16e))/0x7+parseInt(_0x32d9ec(0x1d3))/0x8*(parseInt(_0x32d9ec(0x216))/0x9)+parseInt(_0x32d9ec(0x104))/0xa*(parseInt(_0x32d9ec(0x112))/0xb);if(_0x3a25f1===_0x532c0b)break;else _0x42db89['push'](_0x42db89['shift']());}catch(_0x46b6f6){_0x42db89['push'](_0x42db89['shift']());}}}(a38_0x201a,0x73076));function a38_0x32de(_0x26aac7,_0x3e1805){_0x26aac7=_0x26aac7-0x100;const _0x201a45=a38_0x201a();let _0x32de19=_0x201a45[_0x26aac7];return _0x32de19;}import a38_0x3a8e01 from'chalk';import{existsSync}from'fs';import a38_0x37abe7 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}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a38_0x41838f from'prompts';function getAttemptStatusDisplay(_0x32f461){const _0x1155c3=a38_0x32de;if(!_0x32f461)return{'icon':'⏳','text':''};const {done:_0x6f65ac,success:_0x593f9f,cancelRequested:_0x20f7f4}=_0x32f461;if(!_0x6f65ac)return _0x20f7f4?{'icon':'🛑','text':a38_0x3a8e01['yellow']('canceling')}:{'icon':'🔄','text':a38_0x3a8e01[_0x1155c3(0x171)](_0x1155c3(0x15a))};if(_0x593f9f)return{'icon':'✅','text':a38_0x3a8e01[_0x1155c3(0x1d1)](_0x1155c3(0x1c8))};return{'icon':'❌','text':a38_0x3a8e01[_0x1155c3(0x16b)]('error')};}export class WorkflowBaseCommand extends BaseCommand{[a38_0x2f1d07(0x15f)](_0x4f77cb,_0x2c026b,_0x47ae23=0x0){const _0x21b693=a38_0x2f1d07;return _0x4f77cb[_0x47ae23]||_0x2c026b[_0x21b693(0x1ed)];}[a38_0x2f1d07(0x16d)](_0x29a888,_0x5af43b,_0x4cae51=0x0){const _0x127f90=a38_0x2f1d07,_0x3aa250=this[_0x127f90(0x15f)](_0x29a888,_0x5af43b,_0x4cae51);if(!_0x3aa250)return console['error'](a38_0x3a8e01['red']('Error:'),'Project\x20name\x20is\x20required'),console[_0x127f90(0x1bf)](a38_0x3a8e01[_0x127f90(0x237)](_0x127f90(0x1e6))),null;return _0x3aa250;}[a38_0x2f1d07(0x114)](_0x3d2e1e,_0x1b9eec){const _0x304b4c=a38_0x2f1d07;if(_0x3d2e1e[0x0]){const _0x322a71=_0x3d2e1e[0x0][_0x304b4c(0x212)]('.');if(_0x322a71['length']===0x1)return{'projectName':_0x322a71[0x0],'workflowName':undefined};else return _0x322a71[_0x304b4c(0x17c)]===0x2?{'projectName':_0x322a71[0x0],'workflowName':_0x322a71[0x1]}:(console['error'](a38_0x3a8e01[_0x304b4c(0x16b)]('Error:'),_0x304b4c(0x178)),null);}return{'projectName':_0x1b9eec[_0x304b4c(0x1ed)],'workflowName':undefined};}[a38_0x2f1d07(0x188)](_0x35ff70,_0x156d18,_0x43673a=0x0){const _0x392a7e=a38_0x2f1d07;if(_0x35ff70[_0x43673a])return _0x35ff70[_0x43673a];if(_0x156d18['workflowProject']){const _0x2ec057=a38_0x37abe7['join'](process['cwd'](),_0x392a7e(0x138),_0x156d18['workflowProject']);if(existsSync(a38_0x37abe7['join'](_0x2ec057,_0x392a7e(0x147))))return _0x2ec057;}return undefined;}async[a38_0x2f1d07(0x151)](_0x4fb1b7,_0x2297a6,_0x1fbc77){const _0x830c7b=a38_0x2f1d07;try{const _0x2caccb=await _0x4fb1b7[_0x830c7b(0x166)][_0x830c7b(0x138)](_0x2297a6,{'limit':0x1});if(_0x2caccb['length']>0x0){const _0xf1974f=_0x2caccb[0x0]['id'],_0x45877c=getWorkflowUrl(_0x1fbc77,_0xf1974f);console[_0x830c7b(0x1bf)](_0x830c7b(0x1e8)+a38_0x3a8e01['cyan'](_0x45877c));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a38_0x2f1d07(0x1fb)]=a38_0x2f1d07(0x1a1);[a38_0x2f1d07(0x14c)]=a38_0x2f1d07(0x221);async[a38_0x2f1d07(0x1a7)](_0xee3ac1){const _0x32c1de=a38_0x2f1d07,{options:_0x33cd2e,args:_0x2caeb5,tdx:_0x5cb707}=_0xee3ac1,_0x5867c2=_0x2caeb5[0x0],_0x3529de=_0x33cd2e[_0x32c1de(0x1cd)];if(_0x3529de)return saveSessionContext({'workflow_project':undefined},_0x33cd2e['session']),console['log'](a38_0x3a8e01['green'](_0x32c1de(0x233))),0x0;if(!_0x5867c2)return console[_0x32c1de(0x1bf)](a38_0x3a8e01[_0x32c1de(0x16b)](_0x32c1de(0x196)),_0x32c1de(0x19b)),console['error'](a38_0x3a8e01[_0x32c1de(0x237)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x32c1de(0x1bf)](a38_0x3a8e01[_0x32c1de(0x237)](_0x32c1de(0x1d6))),0x1;const _0x4d3ff4=await withSpinner(_0x32c1de(0x206)+_0x5867c2+_0x32c1de(0x187),()=>_0x5cb707['workflow'][_0x32c1de(0x217)](_0x5867c2),{'verbose':_0x33cd2e[_0x32c1de(0x219)]}),{name:_0x19285a}=_0x4d3ff4[_0x32c1de(0x1ab)];return saveSessionContext({'workflow_project':_0x19285a},_0x33cd2e[_0x32c1de(0x1f7)]),console['log'](a38_0x3a8e01[_0x32c1de(0x1d1)](_0x32c1de(0x231)+a38_0x3a8e01[_0x32c1de(0x214)](_0x19285a))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a38_0x2f1d07(0x1fb)]=a38_0x2f1d07(0x21e);['description']=a38_0x2f1d07(0x155);async[a38_0x2f1d07(0x1a7)](_0x4acd27){const _0x40a3cb=a38_0x2f1d07,{options:_0x434016,args:_0x3189c0,tdx:_0x4d02c7}=_0x4acd27,_0x42b51f=_0x3189c0[0x0];_0x434016[_0x40a3cb(0x219)]&&_0x42b51f&&console[_0x40a3cb(0x1bf)](_0x40a3cb(0x1f3)+_0x42b51f);const _0x20cec8=await withSpinner(_0x40a3cb(0x1d8),()=>_0x4d02c7[_0x40a3cb(0x166)][_0x40a3cb(0x1a2)](_0x42b51f,{'limit':_0x434016[_0x40a3cb(0x1c7)]}),{'verbose':_0x434016['verbose']});let _0x25fcc1=_0x20cec8['data'];_0x25fcc1[_0x40a3cb(0x157)]((_0x17f782,_0x98281)=>_0x17f782[_0x40a3cb(0x1fb)]['localeCompare'](_0x98281[_0x40a3cb(0x1fb)]));const _0x45d85d=_0x434016[_0x40a3cb(0x1c7)]||0x64,_0x2748a8=_0x25fcc1[_0x40a3cb(0x17c)]>=_0x45d85d?a38_0x3a8e01[_0x40a3cb(0x237)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x40a3cb(0x1bf)](_0x40a3cb(0x1be)+_0x25fcc1[_0x40a3cb(0x17c)]+_0x40a3cb(0x14f)+(_0x25fcc1[_0x40a3cb(0x17c)]!==0x1?'s':'')+_0x2748a8);if(_0x434016[_0x40a3cb(0x172)]===_0x40a3cb(0x180)||_0x434016[_0x40a3cb(0x172)]===_0x40a3cb(0x13f)||_0x434016['format']===_0x40a3cb(0x215))await handleSDKOutput(_0x25fcc1,_0x434016);else{if(_0x25fcc1[_0x40a3cb(0x17c)]===0x0)_0x42b51f?console['log'](_0x40a3cb(0x176)+_0x42b51f):console[_0x40a3cb(0x10a)](_0x40a3cb(0x1f0));else{const _0x4a11c5=_0x25fcc1[_0x40a3cb(0x179)](_0x388e5f=>{const _0xe756e2=_0x40a3cb,_0x1424bf=_0x388e5f[_0xe756e2(0x10e)]?.['some'](_0x129172=>_0x129172[_0xe756e2(0x164)]===_0xe756e2(0x21f)),_0x5c2975=_0x1424bf?a38_0x3a8e01[_0xe756e2(0x237)](_0xe756e2(0x162)):'';return _0xe756e2(0x194)+_0x388e5f['name']+_0x5c2975;});await writeOutput(_0x4a11c5[_0x40a3cb(0x185)]('\x0a'),_0x434016[_0x40a3cb(0x103)],_0x40a3cb(0x1a3));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a38_0x2f1d07(0x1fb)]=a38_0x2f1d07(0x101);[a38_0x2f1d07(0x14c)]=a38_0x2f1d07(0x1dd);async[a38_0x2f1d07(0x1a7)](_0x19b812){const _0x3014bb=a38_0x2f1d07,{options:_0x17001e,args:_0x4538c7,tdx:_0x2e037c}=_0x19b812,_0x5c2d3a=this[_0x3014bb(0x15f)](_0x4538c7,_0x17001e);_0x17001e[_0x3014bb(0x219)]&&_0x5c2d3a&&console[_0x3014bb(0x1bf)](_0x3014bb(0x1bb)+_0x5c2d3a);const _0x191082=await withSpinner(_0x3014bb(0x223),()=>_0x2e037c[_0x3014bb(0x166)]['workflows'](_0x5c2d3a,{'limit':_0x17001e['limit']}),{'verbose':_0x17001e[_0x3014bb(0x219)]});let _0x2ee899=_0x191082[_0x3014bb(0x1ab)];_0x2ee899[_0x3014bb(0x157)]((_0x1f1f25,_0x2c522a)=>{const _0x2262ad=_0x3014bb,_0x41aaee=_0x1f1f25['name'][_0x2262ad(0x20f)](_0x2c522a[_0x2262ad(0x1fb)]);if(_0x41aaee!==0x0)return _0x41aaee;return(_0x1f1f25[_0x2262ad(0x205)]?.[_0x2262ad(0x1fb)]||'')[_0x2262ad(0x20f)](_0x2c522a[_0x2262ad(0x205)]?.['name']||'');});const _0x157cac=_0x17001e[_0x3014bb(0x1c7)]||0x64,_0x12b343=_0x2ee899[_0x3014bb(0x17c)]>=_0x157cac?a38_0x3a8e01[_0x3014bb(0x237)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console['error'](_0x3014bb(0x1be)+_0x2ee899['length']+_0x3014bb(0x1b0)+(_0x2ee899[_0x3014bb(0x17c)]!==0x1?'s':'')+_0x12b343);if(_0x17001e['format']===_0x3014bb(0x180)||_0x17001e['format']==='jsonl'||_0x17001e[_0x3014bb(0x172)]===_0x3014bb(0x215))await handleSDKOutput(_0x2ee899,_0x17001e);else{if(_0x2ee899[_0x3014bb(0x17c)]===0x0)_0x5c2d3a?console['log']('No\x20workflows\x20found\x20in\x20project:\x20'+_0x5c2d3a):console[_0x3014bb(0x10a)]('No\x20workflows\x20found');else{const _0x507ae5=_0x17001e[_0x3014bb(0x213)],_0x40ef14=_0x2ee899[_0x3014bb(0x179)](_0x18db89=>{const _0x265771=_0x3014bb,_0x3b342a=a38_0x3a8e01[_0x265771(0x237)]('#'+_0x18db89['id']),_0x1080a0=hyperlink(_0x3b342a,getWorkflowUrl(_0x507ae5,_0x18db89['id'])),_0x507a81=_0x18db89[_0x265771(0x205)]?.[_0x265771(0x1fb)]?a38_0x3a8e01[_0x265771(0x237)]('\x20('+_0x18db89['project'][_0x265771(0x1fb)]+')'):'';return _0x265771(0x102)+_0x1080a0+'\x20'+_0x18db89['name']+_0x507a81;});await writeOutput(_0x40ef14[_0x3014bb(0x185)]('\x0a'),_0x17001e['output'],_0x3014bb(0x1a3));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a38_0x2f1d07(0x1fb)]=a38_0x2f1d07(0x1fe);[a38_0x2f1d07(0x14c)]=a38_0x2f1d07(0x1a8);async[a38_0x2f1d07(0x1a7)](_0x4c4bd1){const _0x2ac010=a38_0x2f1d07,{options:_0x49b948,args:_0x1ad134,tdx:_0x466074}=_0x4c4bd1,_0x589465=this['parseProjectWorkflowPattern'](_0x1ad134,_0x49b948);if(!_0x589465)return 0x1;const {projectName:_0x10964c,workflowName:_0x1d9219}=_0x589465;if(_0x49b948[_0x2ac010(0x219)]){if(_0x10964c&&_0x1d9219)console[_0x2ac010(0x1bf)](_0x2ac010(0x177)+_0x10964c+'.'+_0x1d9219);else _0x10964c&&console[_0x2ac010(0x1bf)](_0x2ac010(0x10b)+_0x10964c);const _0x1339dc=_0x49b948[_0x2ac010(0x208)];_0x1339dc&&console[_0x2ac010(0x1bf)](_0x2ac010(0x139)+_0x1339dc);}const _0x44ff87=await withSpinner(_0x2ac010(0x167),()=>_0x466074[_0x2ac010(0x166)]['sessions']({'projectName':_0x10964c,'workflowName':_0x1d9219,'status':_0x49b948[_0x2ac010(0x208)],'fromTime':_0x49b948[_0x2ac010(0x11f)],'toTime':_0x49b948['to'],'limit':_0x49b948['limit']}),{'verbose':_0x49b948[_0x2ac010(0x219)]}),_0x2fa5e6=_0x44ff87[_0x2ac010(0x1ab)];_0x2fa5e6[_0x2ac010(0x157)]((_0x4b8b85,_0x531bd3)=>{const _0x50ac7a=_0x2ac010,_0x51e89a=_0x4b8b85['sessionTime']||'',_0x4d8102=_0x531bd3[_0x50ac7a(0x142)]||'';return _0x4d8102[_0x50ac7a(0x20f)](_0x51e89a);});const _0x3f39de=_0x49b948['limit']||0x64,_0x4aa322=_0x2fa5e6['length']>=_0x3f39de?a38_0x3a8e01[_0x2ac010(0x237)](_0x2ac010(0x14a)):'';console['error']('✔\x20Found\x20'+_0x2fa5e6[_0x2ac010(0x17c)]+'\x20session'+(_0x2fa5e6[_0x2ac010(0x17c)]!==0x1?'s':'')+_0x4aa322);if(_0x49b948['format']==='json'||_0x49b948['format']===_0x2ac010(0x13f)||_0x49b948[_0x2ac010(0x172)]===_0x2ac010(0x215))await handleSDKOutput(_0x2fa5e6,_0x49b948);else{if(_0x2fa5e6['length']===0x0){if(_0x10964c&&_0x1d9219)console[_0x2ac010(0x10a)](_0x2ac010(0x160)+_0x10964c+'.'+_0x1d9219);else _0x10964c?console[_0x2ac010(0x10a)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x10964c):console[_0x2ac010(0x10a)](_0x2ac010(0x1e1));}else{const _0x1cd846=_0x49b948[_0x2ac010(0x213)],_0x264c88=_0x2fa5e6[_0x2ac010(0x179)](_0x4e7e01=>{const _0x395a3a=_0x2ac010,_0xc62d42=a38_0x3a8e01[_0x395a3a(0x237)]('#'+_0x4e7e01['id']),_0x4e9940=_0x4e7e01[_0x395a3a(0x205)]?.['id'],_0x3c82a9=_0x4e9940?hyperlink(_0xc62d42,getWorkflowSessionUrl(_0x1cd846,_0x4e9940,_0x4e7e01['id'])):_0xc62d42,{icon:_0x56055e,text:_0x287215}=getAttemptStatusDisplay(_0x4e7e01[_0x395a3a(0x13b)]),_0x1b6961=(_0x4e7e01[_0x395a3a(0x205)]?.[_0x395a3a(0x1fb)]||'?')+'.'+(_0x4e7e01[_0x395a3a(0x166)]?.[_0x395a3a(0x1fb)]||'?'),_0x18a0c3=_0x4e7e01[_0x395a3a(0x142)]?a38_0x3a8e01[_0x395a3a(0x237)](_0x4e7e01['sessionTime']):'';return(_0x3c82a9+'\x20'+_0x56055e+(_0x287215?'\x20'+_0x287215:'')+'\x20'+_0x1b6961+'\x20'+_0x18a0c3)[_0x395a3a(0x144)]();});await writeOutput(_0x264c88[_0x2ac010(0x185)]('\x0a'),_0x49b948[_0x2ac010(0x103)],'list');}}return 0x0;}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a38_0x2f1d07(0x1fb)]='workflow:attempts';[a38_0x2f1d07(0x14c)]=a38_0x2f1d07(0x210);async[a38_0x2f1d07(0x1a7)](_0x51d514){const _0x54e635=a38_0x2f1d07,{options:_0x23af10,args:_0x877d11,tdx:_0x277835}=_0x51d514,_0x47faeb=this['parseProjectWorkflowPattern'](_0x877d11,_0x23af10);if(!_0x47faeb)return 0x1;const {projectName:_0x2566e6,workflowName:_0x427a2d}=_0x47faeb,_0x58d44e=_0x23af10['includeRetried'];if(_0x23af10[_0x54e635(0x219)]){if(_0x2566e6&&_0x427a2d)console[_0x54e635(0x1bf)]('Filter:\x20'+_0x2566e6+'.'+_0x427a2d);else _0x2566e6&&console['error'](_0x54e635(0x10b)+_0x2566e6);_0x58d44e&&console[_0x54e635(0x1bf)](_0x54e635(0x1fc));}const _0x141b6a=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x277835[_0x54e635(0x166)][_0x54e635(0x20b)]({'projectName':_0x2566e6,'workflowName':_0x427a2d,'includeRetried':_0x58d44e,'limit':_0x23af10[_0x54e635(0x1c7)]}),{'verbose':_0x23af10[_0x54e635(0x219)]}),_0x24aa22=_0x141b6a[_0x54e635(0x1ab)],_0x3b35ad=_0x23af10[_0x54e635(0x1c7)]||0x64,_0x2cdcfb=_0x24aa22[_0x54e635(0x17c)]>=_0x3b35ad?a38_0x3a8e01[_0x54e635(0x237)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x54e635(0x1bf)](_0x54e635(0x1be)+_0x24aa22[_0x54e635(0x17c)]+'\x20attempt'+(_0x24aa22[_0x54e635(0x17c)]!==0x1?'s':'')+_0x2cdcfb);if(_0x23af10[_0x54e635(0x172)]===_0x54e635(0x180)||_0x23af10[_0x54e635(0x172)]===_0x54e635(0x13f)||_0x23af10['format']===_0x54e635(0x215))await handleSDKOutput(_0x24aa22,_0x23af10);else{if(_0x24aa22[_0x54e635(0x17c)]===0x0){if(_0x2566e6&&_0x427a2d)console['log'](_0x54e635(0x156)+_0x2566e6+'.'+_0x427a2d);else _0x2566e6?console[_0x54e635(0x10a)]('No\x20attempts\x20found\x20in\x20project:\x20'+_0x2566e6):console['log']('No\x20attempts\x20found');}else{const _0xc5ed82=_0x23af10[_0x54e635(0x213)],_0x42b7f9=_0x24aa22['map'](_0xf13dee=>{const _0x252bab=_0x54e635,_0x5680d6=a38_0x3a8e01[_0x252bab(0x237)]('#'+_0xf13dee['id']),_0x59e0b4=_0xf13dee[_0x252bab(0x205)]?.['id'],_0xc3212d=_0xf13dee[_0x252bab(0x115)]||_0xf13dee[_0x252bab(0x197)],_0x180b96=_0x59e0b4&&_0xc3212d?hyperlink(_0x5680d6,getWorkflowAttemptUrl(_0xc5ed82,_0x59e0b4,_0xc3212d,_0xf13dee['id'])):_0x5680d6,{icon:_0x111840,text:_0x548214}=getAttemptStatusDisplay(_0xf13dee),_0x519a11=(_0xf13dee[_0x252bab(0x205)]?.[_0x252bab(0x1fb)]||'?')+'.'+(_0xf13dee[_0x252bab(0x166)]?.['name']||'?'),_0x3bb9f2=_0xf13dee[_0x252bab(0x142)]?a38_0x3a8e01[_0x252bab(0x237)](_0xf13dee[_0x252bab(0x142)]):'';return(_0x180b96+'\x20'+_0x111840+(_0x548214?'\x20'+_0x548214:'')+'\x20'+_0x519a11+'\x20'+_0x3bb9f2)[_0x252bab(0x144)]();});await writeOutput(_0x42b7f9[_0x54e635(0x185)]('\x0a'),_0x23af10[_0x54e635(0x103)],_0x54e635(0x1a3));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a38_0x2f1d07(0x1fb)]=a38_0x2f1d07(0x1b1);['description']=a38_0x2f1d07(0x169);async[a38_0x2f1d07(0x1a7)](_0x2549b5){const _0x371f03=a38_0x2f1d07,{options:_0x42631c,args:_0x13d085,tdx:_0x309814}=_0x2549b5,_0x1bea42=_0x13d085[0x0];if(!_0x1bea42)return console[_0x371f03(0x1bf)](_0x371f03(0x1e0)),0x1;_0x42631c[_0x371f03(0x219)]&&console['error'](_0x371f03(0x13e)+_0x1bea42);const _0x3b1dd8=await withSpinner('Getting\x20attempt\x20details...',()=>_0x309814['workflow'][_0x371f03(0x222)](_0x1bea42),{'verbose':_0x42631c[_0x371f03(0x219)]}),_0x404fa4=_0x3b1dd8[_0x371f03(0x1ab)];let _0xcf6a83;!_0x404fa4[_0x371f03(0x19d)]?_0xcf6a83=_0x404fa4['cancelRequested']?_0x371f03(0x132):'running':_0xcf6a83=_0x404fa4['success']?_0x371f03(0x1c8):_0x371f03(0x1bf);let _0x1deca8;if(_0x404fa4[_0x371f03(0x137)]&&_0x404fa4[_0x371f03(0x133)]){const _0x2ccd4a=new Date(_0x404fa4[_0x371f03(0x137)])['getTime'](),_0x3f2e63=new Date(_0x404fa4['finishedAt'])[_0x371f03(0x152)]();_0x1deca8=Math[_0x371f03(0x22d)]((_0x3f2e63-_0x2ccd4a)/0x3e8);}const _0x49a765={'attempt_id':_0x404fa4['id'],'status':_0xcf6a83,..._0x404fa4[_0x371f03(0x109)]!==undefined&&{'index':_0x404fa4['index']},..._0x404fa4[_0x371f03(0x205)]&&{'project':_0x404fa4['project'][_0x371f03(0x1fb)]},..._0x404fa4[_0x371f03(0x166)]&&{'workflow':_0x404fa4[_0x371f03(0x166)]['name']},..._0x404fa4['sessionId']&&{'session_id':_0x404fa4['sessionId']},..._0x404fa4[_0x371f03(0x142)]&&{'session_time':_0x404fa4[_0x371f03(0x142)]},..._0x404fa4[_0x371f03(0x1a0)]&&{'retry_attempt':_0x404fa4[_0x371f03(0x1a0)]},..._0x1deca8!==undefined&&{'duration_sec':_0x1deca8},..._0x404fa4[_0x371f03(0x137)]&&{'created_at':_0x404fa4[_0x371f03(0x137)]},..._0x404fa4[_0x371f03(0x133)]&&{'finished_at':_0x404fa4[_0x371f03(0x133)]},...Object['keys'](_0x404fa4[_0x371f03(0x1fd)])[_0x371f03(0x17c)]>0x0&&{'params':_0x404fa4['params']}};return await handleSingleObjectOutput(_0x49a765,_0x42631c),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a38_0x2f1d07(0x1fb)]=a38_0x2f1d07(0x108);['description']=a38_0x2f1d07(0x1c9);async[a38_0x2f1d07(0x1a7)](_0x59d30a){const _0x1870c3=a38_0x2f1d07,{options:_0xc65297,args:_0x494b0a,tdx:_0x4f401f}=_0x59d30a,_0x51a987=_0x494b0a[0x0];if(!_0x51a987)return console[_0x1870c3(0x1bf)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x174174=_0xc65297[_0x1870c3(0x1cc)];_0xc65297[_0x1870c3(0x219)]&&(console[_0x1870c3(0x1bf)](_0x1870c3(0x13e)+_0x51a987),_0x174174&&console[_0x1870c3(0x1bf)]('Including\x20subtasks:\x20yes'));const _0x258e67=await withSpinner(_0x1870c3(0x173),()=>_0x4f401f[_0x1870c3(0x166)][_0x1870c3(0x193)](_0x51a987,_0x174174||![]),{'verbose':_0xc65297[_0x1870c3(0x219)]}),_0xc0e93d=_0x258e67[_0x1870c3(0x1ab)];return console['error'](_0x1870c3(0x1be)+_0xc0e93d[_0x1870c3(0x17c)]+'\x20task'+(_0xc0e93d[_0x1870c3(0x17c)]!==0x1?'s':'')),await handleSDKOutput(_0xc0e93d,_0xc65297),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a38_0x2f1d07(0x1fb)]=a38_0x2f1d07(0x18f);[a38_0x2f1d07(0x14c)]=a38_0x2f1d07(0x1d5);async[a38_0x2f1d07(0x1a7)](_0x1683a0){const _0xf95d2c=a38_0x2f1d07,{options:_0x50232c,args:_0x104fdc,tdx:_0x53342a}=_0x1683a0,_0x321b8f=_0x104fdc[0x0];let _0x16bd1c=_0x104fdc[0x1];if(!_0x321b8f)return console[_0xf95d2c(0x1bf)](_0xf95d2c(0x1e0)),0x1;_0x50232c[_0xf95d2c(0x219)]&&(console['error'](_0xf95d2c(0x13e)+_0x321b8f),_0x16bd1c&&console[_0xf95d2c(0x1bf)](_0xf95d2c(0x12d)+_0x16bd1c));const _0x25bc63=await withSpinner('Fetching\x20log\x20files...',()=>_0x53342a[_0xf95d2c(0x166)][_0xf95d2c(0x184)](_0x321b8f,_0x16bd1c),{'verbose':_0x50232c['verbose']}),_0x549266=_0x25bc63[_0xf95d2c(0x1ab)];if(_0x549266[_0xf95d2c(0x17c)]===0x0)return console['error'](_0xf95d2c(0x207)),0x0;if(!_0x16bd1c&&(_0x50232c['json']||_0x50232c[_0xf95d2c(0x172)]))return await handleSDKOutput(_0x549266,_0x50232c),0x0;if(!_0x16bd1c){const _0x1f793c=_0x549266[_0xf95d2c(0x179)](_0x3520ee=>({'title':_0x3520ee[_0xf95d2c(0x117)]+'\x20('+formatBytes(_0x3520ee['fileSize'])+')','value':_0x3520ee['taskName']})),_0x4b5d9c=await a38_0x41838f({'type':_0xf95d2c(0x20e),'name':'task','message':_0xf95d2c(0x123),'choices':_0x1f793c});if(!_0x4b5d9c[_0xf95d2c(0x1cf)])return console[_0xf95d2c(0x1bf)](_0xf95d2c(0x111)),0x0;_0x16bd1c=_0x4b5d9c[_0xf95d2c(0x1cf)];}const _0x4f66bc=await withSpinner(_0xf95d2c(0x18d),()=>_0x53342a[_0xf95d2c(0x166)][_0xf95d2c(0x128)](_0x321b8f,_0x16bd1c),{'verbose':_0x50232c[_0xf95d2c(0x219)]}),_0x2557b4=_0x4f66bc['data'];return _0x2557b4?console['log'](_0x2557b4):console['error']('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{['name']='workflow:kill';[a38_0x2f1d07(0x14c)]='Kill\x20a\x20running\x20attempt';async['execute'](_0x19ed11){const _0x493bf3=a38_0x2f1d07,{options:_0x20333e,args:_0x22bb15,tdx:_0x1bc972}=_0x19ed11,_0x18936f=_0x22bb15[0x0];if(!_0x18936f)return console['error'](_0x493bf3(0x1e0)),0x1;const _0x594b2d=_0x20333e[_0x493bf3(0x14e)];_0x20333e[_0x493bf3(0x219)]&&(console[_0x493bf3(0x1bf)](_0x493bf3(0x13e)+_0x18936f),_0x594b2d&&console[_0x493bf3(0x1bf)](_0x493bf3(0x1cb)+_0x594b2d));if(!_0x20333e[_0x493bf3(0x14b)]){const _0x240125=await confirmKey(_0x493bf3(0x1c4)+_0x18936f+'?');if(!_0x240125)return console['error'](_0x493bf3(0x111)),0x0;}const _0x5b44cf=await withSpinner('Killing\x20attempt...',()=>_0x1bc972[_0x493bf3(0x166)][_0x493bf3(0x1bd)](_0x18936f,_0x594b2d),{'verbose':_0x20333e[_0x493bf3(0x219)]}),_0x52ce47=_0x5b44cf['data'];return console['error']('✔\x20'+_0x52ce47),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a38_0x2f1d07(0x1fb)]='workflow:retry';[a38_0x2f1d07(0x14c)]=a38_0x2f1d07(0x1e9);async[a38_0x2f1d07(0x1a7)](_0x3ff829){const _0x5a7a39=a38_0x2f1d07,{options:_0x307625,args:_0x36d3d1,tdx:_0x4dcbff}=_0x3ff829,_0x1cbb71=_0x36d3d1[0x0];if(!_0x1cbb71)return console[_0x5a7a39(0x1bf)](_0x5a7a39(0x170)),console[_0x5a7a39(0x1bf)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x86fe5b=![],_0x40ea02=_0x1cbb71;if(_0x1cbb71[_0x5a7a39(0x12b)](_0x5a7a39(0x13d)))_0x86fe5b=!![],_0x40ea02=_0x1cbb71[_0x5a7a39(0x1c6)](0x8);else{if(_0x1cbb71[_0x5a7a39(0x12b)](_0x5a7a39(0x232)))_0x86fe5b=![],_0x40ea02=_0x1cbb71[_0x5a7a39(0x1c6)](0x8);else return console[_0x5a7a39(0x1bf)](_0x5a7a39(0x149)),console[_0x5a7a39(0x1bf)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x1dff9e=_0x307625['fromTask'],_0x416976=_0x307625[_0x5a7a39(0x1b9)],_0x21f704=_0x307625['params'],_0x170e0b=_0x307625[_0x5a7a39(0x19f)];_0x307625[_0x5a7a39(0x219)]&&(console['error'](_0x5a7a39(0x202)+(_0x86fe5b?'session':_0x5a7a39(0x222))+'\x20'+_0x40ea02),_0x1dff9e&&console[_0x5a7a39(0x1bf)](_0x5a7a39(0x200)+_0x1dff9e),_0x416976&&console[_0x5a7a39(0x1bf)](_0x5a7a39(0x1ac)+_0x416976),_0x21f704&&console[_0x5a7a39(0x1bf)]('Params:\x20'+_0x21f704),_0x170e0b&&console[_0x5a7a39(0x1bf)](_0x5a7a39(0x11a)));let _0x4e70c6;if(_0x21f704)try{if(_0x21f704['startsWith']('@')){const _0x408b05=await import(_0x5a7a39(0x161)),_0x49b3b0=_0x21f704['substring'](0x1),_0x1d78d4=await _0x408b05[_0x5a7a39(0x230)](_0x49b3b0,_0x5a7a39(0x154));_0x4e70c6=JSON['parse'](_0x1d78d4);}else _0x4e70c6=JSON[_0x5a7a39(0x1a9)](_0x21f704);}catch{return console[_0x5a7a39(0x1bf)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x307625[_0x5a7a39(0x14b)]){const _0x13e671=await confirmKey(_0x5a7a39(0x1ef)+(_0x86fe5b?_0x5a7a39(0x1f7):'attempt')+'\x20'+_0x40ea02+'?');if(!_0x13e671)return console['error'](_0x5a7a39(0x111)),0x0;}let _0x3f022b;_0x86fe5b?_0x3f022b=await withSpinner('Retrying\x20session...',()=>_0x4dcbff['workflow'][_0x5a7a39(0x1ae)](_0x40ea02,{'fromTask':_0x1dff9e,'retryParams':_0x4e70c6}),{'verbose':_0x307625[_0x5a7a39(0x219)]}):_0x3f022b=await withSpinner(_0x5a7a39(0x122),()=>_0x4dcbff['workflow'][_0x5a7a39(0x211)](_0x40ea02,{'resumeFrom':_0x416976,'retryParams':_0x4e70c6,'force':_0x170e0b}),{'verbose':_0x307625[_0x5a7a39(0x219)]});const _0xc29f32=_0x3f022b['data'];return console[_0x5a7a39(0x1bf)](_0x5a7a39(0x1dc)),console[_0x5a7a39(0x1bf)](_0x5a7a39(0x146)+_0xc29f32['attemptId']),console[_0x5a7a39(0x1bf)]('\x20\x20Session\x20ID:\x20'+_0xc29f32[_0x5a7a39(0x197)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a38_0x2f1d07(0x1f2);[a38_0x2f1d07(0x14c)]=a38_0x2f1d07(0x1d7);async[a38_0x2f1d07(0x1a7)](_0x16c479){const _0x2e5024=a38_0x2f1d07,{options:_0x1554b7,args:_0x1070ff,tdx:_0x512392}=_0x16c479;let _0x4e0c96=_0x1070ff[0x0];if(!_0x4e0c96){const _0x50dd79=this[_0x2e5024(0x15f)]([],_0x1554b7),_0x20aabf=await withSpinner('Loading\x20workflows...',()=>_0x512392[_0x2e5024(0x166)]['workflows'](_0x50dd79,{'limit':_0x1554b7[_0x2e5024(0x1c7)]}),{'verbose':_0x1554b7[_0x2e5024(0x219)]}),_0x51e8d7=_0x20aabf[_0x2e5024(0x1ab)];if(_0x51e8d7[_0x2e5024(0x17c)]===0x0)return console[_0x2e5024(0x1bf)](_0x2e5024(0x1b8)),!_0x50dd79&&console[_0x2e5024(0x1bf)](a38_0x3a8e01[_0x2e5024(0x237)](_0x2e5024(0x1e6))),0x1;const _0x5f06c0=_0x51e8d7[_0x2e5024(0x179)](_0x33ef67=>({'title':_0x33ef67[_0x2e5024(0x205)]?.['name']+'.'+_0x33ef67[_0x2e5024(0x1fb)],'value':_0x33ef67[_0x2e5024(0x205)]?.[_0x2e5024(0x1fb)]+'.'+_0x33ef67[_0x2e5024(0x1fb)],'description':_0x33ef67[_0x2e5024(0x12c)]?_0x2e5024(0x12f)+_0x33ef67[_0x2e5024(0x12c)]:undefined})),_0x363e6e=await a38_0x41838f({'type':'select','name':_0x2e5024(0x166),'message':_0x2e5024(0x1a4),'choices':_0x5f06c0});if(!_0x363e6e[_0x2e5024(0x166)])return 0x1;_0x4e0c96=_0x363e6e[_0x2e5024(0x166)];}if(!_0x4e0c96[_0x2e5024(0x1af)]('.')){const _0x7f5c90=this[_0x2e5024(0x15f)]([],_0x1554b7);if(_0x7f5c90)_0x4e0c96=_0x7f5c90+'.'+_0x4e0c96;else return console[_0x2e5024(0x1bf)](a38_0x3a8e01[_0x2e5024(0x16b)](_0x2e5024(0x196)),_0x2e5024(0x18b)),console[_0x2e5024(0x1bf)](a38_0x3a8e01['dim'](_0x2e5024(0x1e6))),0x1;}const _0x1bd4f6=_0x1554b7[_0x2e5024(0x204)],_0x3c2833=_0x1554b7['sessionTime'],_0x33e7bc={};if(_0x1bd4f6&&Array['isArray'](_0x1bd4f6))for(const _0x26b5c2 of _0x1bd4f6){const _0x3a918e=_0x26b5c2['indexOf']('=');if(_0x3a918e===-0x1)return console[_0x2e5024(0x1bf)](_0x2e5024(0x21c)+_0x26b5c2),console[_0x2e5024(0x1bf)](_0x2e5024(0x125)),0x1;const _0x516fe2=_0x26b5c2[_0x2e5024(0x1c6)](0x0,_0x3a918e),_0x387a35=_0x26b5c2['substring'](_0x3a918e+0x1);try{_0x33e7bc[_0x516fe2]=JSON[_0x2e5024(0x1a9)](_0x387a35);}catch{_0x33e7bc[_0x516fe2]=_0x387a35;}}_0x1554b7['verbose']&&(console[_0x2e5024(0x1bf)]('Workflow:\x20'+_0x4e0c96),Object[_0x2e5024(0x11c)](_0x33e7bc)[_0x2e5024(0x17c)]>0x0&&console[_0x2e5024(0x1bf)](_0x2e5024(0x10d)+JSON[_0x2e5024(0x1c3)](_0x33e7bc)),_0x3c2833&&console[_0x2e5024(0x1bf)]('Session\x20time:\x20'+_0x3c2833));const _0x396f98=await withSpinner(_0x2e5024(0x100),()=>_0x512392['workflow'][_0x2e5024(0x18c)](_0x4e0c96,_0x33e7bc,{'sessionTime':_0x3c2833}),{'verbose':_0x1554b7['verbose']}),_0x2d4bd8=_0x396f98[_0x2e5024(0x1ab)];console['error']('✔\x20Workflow\x20run\x20started'),console[_0x2e5024(0x1bf)]('\x20\x20Attempt\x20ID:\x20'+_0x2d4bd8['id']),console['error'](_0x2e5024(0x1e5)+_0x2d4bd8[_0x2e5024(0x197)]),console[_0x2e5024(0x1bf)]('\x20\x20Project:\x20'+_0x2d4bd8[_0x2e5024(0x205)]?.[_0x2e5024(0x1fb)]),console[_0x2e5024(0x1bf)](_0x2e5024(0x21a)+_0x2d4bd8[_0x2e5024(0x166)]?.['name']);if(_0x2d4bd8[_0x2e5024(0x205)]?.['id']&&_0x2d4bd8[_0x2e5024(0x197)]&&_0x2d4bd8['id']){const _0x2e07ed=_0x1554b7['site'],_0x40ca32=getConsoleUrl(_0x2e07ed,_0x2e5024(0x22b)+_0x2d4bd8[_0x2e5024(0x205)]['id']+'/sessions/'+_0x2d4bd8[_0x2e5024(0x197)]+_0x2e5024(0x1a5)+_0x2d4bd8['id']);console['error'](_0x2e5024(0x1e8)+a38_0x3a8e01['cyan'](_0x40ca32));}return 0x0;}}function a38_0x201a(){const _0x4cab19=['workflows','Status:\x20','delete','lastAttempt','deleted','session:','Attempt\x20ID:\x20','jsonl','\x20\x20Source:\x20','relative','sessionTime','33ukanrz','trimEnd','Pushing\x20project...','\x20\x20New\x20attempt\x20ID:\x20','tdx.json','Invalid\x20format:\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x20(use\x20--limit\x20to\x20show\x20more)','yes','description','✔\x20Push\x20complete','reason','\x20project','Analyzing\x20changes...','showWorkflowConsoleUrl','getTime','targetDir','utf-8','List\x20all\x20workflow\x20projects','No\x20attempts\x20found\x20for:\x20','sort','\x20\x20Target:\x20','\x22\x20to\x20new\x20project\x20\x22','running','workflow:secrets:set','\x0aDry\x20run\x20-\x20no\x20project\x20created','executePushProject','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','resolveProject','No\x20sessions\x20found\x20for:\x20','fs/promises','\x20(system)','dryRun','key','deleteSecret','workflow','Listing\x20workflow\x20sessions...','\x20\x20Session\x20context\x20set\x20to:\x20','Show\x20specific\x20attempt\x20details','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','red','newProjectName','requireProject','1354143oKqqRq','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','blue','format','Getting\x20attempt\x20tasks...','✔\x20Pull\x20complete','listSecrets','No\x20projects\x20match\x20pattern:\x20','Filter:\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','map','9116PWBwiG','Dry\x20run:\x20yes','length','Output\x20directory:\x20','new','download','json','projectId','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','Validation:\x20skipped','logFiles','join','indexOf','\x27...','resolveProjectDir','pullProject','Updating\x20','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','run','Downloading\x20logs...','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','workflow:logs','modified','changes','projectName','tasks','📁\x20','Error:\x20Secret\x20key\x20is\x20required','Error:','sessionId','path','\x22\x20with\x20new\x20revision?','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Project\x20name\x20is\x20required','message','done','\x0a⚠\x20Project\x20\x22','force','retryAttemptName','workflow:use','projects','list','Select\x20a\x20workflow\x20to\x20run','/attempt/','newProjectId','execute','List\x20workflow\x20execution\x20sessions','parse','418164FkHgOu','data','Resume\x20from:\x20','type','retrySession','includes','\x20workflow','workflow:attempt','Key\x20cannot\x20be\x20empty','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','Project\x20name:\x20','\x20\x20Changes:\x20','sourceDir','\x20\x20Project\x20ID:\x20','No\x20workflows\x20found','resumeFrom','60ihjbYp','Project\x20filter:\x20','Project:\x20','kill','✔\x20Found\x20','error','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','Key:\x20','workflow:delete','stringify','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','substring','limit','success','Show\x20tasks\x20for\x20an\x20attempt','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','Reason:\x20','includeSubtasks','clear','cwd','task','New\x20project\x20name:\x20','green','Setting\x20secret...','8NMVGaa','targetExists','Show\x20logs\x20for\x20a\x20workflow\x20attempt','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Start\x20a\x20workflow\x20run','Listing\x20workflow\x20projects...','hasChanges','Project\x20directory:\x20','Deleting\x20project\x20','✔\x20Retry\x20started','List\x20workflows','summary','setSecret','Error:\x20Attempt\x20ID\x20is\x20required','No\x20sessions\x20found','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','preparePushProject','sourceProjectName','\x20\x20Session\x20ID:\x20','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','\x20modified','\x20\x20Console:\x20','Retry\x20a\x20session\x20or\x20attempt','Pushing\x20workflow\x20project...','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','...','workflowProject','✔\x20Project\x20updated','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','No\x20workflow\x20projects\x20found','Source\x20project:\x20','workflow:run','Pattern:\x20','workflow:secrets:delete','executeCloneProject','\x20\x20Location:\x20','session','Listing\x20secrets...','diff','skipValidation','name','Include\x20retried:\x20yes','params','workflow:sessions','\x20\x20Revision:\x20','From\x20task:\x20','filesExtracted','Target:\x20','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','param','project','Resolving\x20project\x20\x27','No\x20log\x20files\x20found\x20for\x20this\x20attempt','status','✔\x20Secret\x20\x27','\x20deleted','attempts','stat','Source\x20directory:\x20','select','localeCompare','List\x20workflow\x20attempts','retryAttempt','split','site','cyan','table','7786206HMwulI','resolveProjectId','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','verbose','\x20\x20Workflow:\x20','---\x20','Error:\x20Invalid\x20parameter\x20format:\x20','\x0aClone\x20\x22','workflow:projects','sys','Downloading\x20project\x20','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','attempt','Listing\x20workflows...','Error:\x20KEY=VALUE\x20is\x20required','110674xWswdJ','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Source:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','Pull\x20workflow\x20project\x20to\x20local\x20folder','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','/app/workflows/','\x0aDry\x20run\x20-\x20nothing\x20pushed','round','184478DqLEcO','workflow:upload','readFile','✔\x20Workflow\x20project\x20set\x20to:\x20','attempt:','✔\x20Workflow\x20project\x20context\x20cleared.','\x0aPush\x20these\x20changes?','\x20is\x20not\x20a\x20directory','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','dim','Error:\x20','.\x20Expected\x20format:\x20KEY=VALUE','existingProjectId','Starting\x20workflow\x20run...','workflow:workflows','📋\x20','output','310zMHgqG','prepareCloneProject','✔\x20Pushed\x20','✔\x20New\x20project:\x20','workflow:tasks','index','log','Filter:\x20project=','Cloning\x20to\x20','Parameters:\x20','metadata','\x0a✔\x20Already\x20up\x20to\x20date','Target\x20directory:\x20','Cancelled','375331mbaIBf','\x22\x20already\x20exists\x20(ID:\x20','parseProjectWorkflowPattern','session_id','\x20new','taskName','isNewProject','fileCount','Force:\x20yes','workflow:secrets:list','keys','Source\x20directory\x20is\x20required','Error:\x20Project\x20name\x20is\x20required','from','isDirectory','basename','Retrying\x20attempt...','Select\x20a\x20task\x20to\x20view\x20logs:','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Expected\x20format:\x20--param\x20key=value','Revision:\x20','✔\x20Project:\x20','logs','✔\x20Downloaded\x20','Writing\x20files...','startsWith','revision','Task\x20name:\x20','Files\x20to\x20upload:\x20','revision:\x20','\x0aDry\x20run\x20-\x20no\x20files\x20written','yellow','canceling','finishedAt','workflow:download','unchanged','Deleting\x20secret...','createdAt'];a38_0x201a=function(){return _0x4cab19;};return a38_0x201a();}export class WorkflowDownloadCommand extends BaseCommand{[a38_0x2f1d07(0x1fb)]=a38_0x2f1d07(0x134);['description']=a38_0x2f1d07(0x1c5);async[a38_0x2f1d07(0x1a7)](_0x13f6a0){const _0x175cb6=a38_0x2f1d07,{options:_0x3d3277,args:_0x3c222f,tdx:_0x79c948}=_0x13f6a0,_0x4d43e3=_0x3c222f[0x0],_0x3349b3=_0x3c222f[0x1]||'.';if(!_0x4d43e3)return console[_0x175cb6(0x1bf)](_0x175cb6(0x11e)),console[_0x175cb6(0x1bf)](_0x175cb6(0x22a)),0x1;const _0x3ad1a4=_0x3d3277[_0x175cb6(0x12c)];_0x3d3277[_0x175cb6(0x219)]&&(console[_0x175cb6(0x1bf)](_0x175cb6(0x1bc)+_0x4d43e3),console['error'](_0x175cb6(0x17d)+_0x3349b3),_0x3ad1a4&&console[_0x175cb6(0x1bf)](_0x175cb6(0x126)+_0x3ad1a4));const _0x5b4aa5=await withSpinner(_0x175cb6(0x220)+_0x4d43e3+_0x175cb6(0x1ec),()=>_0x79c948[_0x175cb6(0x166)][_0x175cb6(0x17f)](_0x4d43e3,_0x3349b3,{'revision':_0x3ad1a4}),{'verbose':_0x3d3277[_0x175cb6(0x219)]}),_0x132514=_0x5b4aa5[_0x175cb6(0x1ab)];return console[_0x175cb6(0x1bf)](_0x175cb6(0x129)+_0x132514[_0x175cb6(0x192)]),console[_0x175cb6(0x1bf)](_0x175cb6(0x1ff)+_0x132514[_0x175cb6(0x12c)]),console[_0x175cb6(0x1bf)]('\x20\x20Files\x20extracted:\x20'+_0x132514[_0x175cb6(0x201)]),console[_0x175cb6(0x1bf)](_0x175cb6(0x1f6)+_0x3349b3+'/'+_0x132514[_0x175cb6(0x192)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a38_0x2f1d07(0x1fb)]=a38_0x2f1d07(0x22f);[a38_0x2f1d07(0x14c)]=a38_0x2f1d07(0x16f);async['execute'](_0x38cdf7){const _0x2bbf7e=a38_0x2f1d07,{options:_0x229b80,args:_0x30bb2a,tdx:_0x4ef4ea}=_0x38cdf7;let _0x1e70e1='.',_0x11008f=_0x229b80['name'];if(_0x30bb2a[0x0]){const {promises:_0x4fdbb5}=await import('fs');try{const _0x24bf9a=await _0x4fdbb5[_0x2bbf7e(0x20c)](_0x30bb2a[0x0]);if(_0x24bf9a[_0x2bbf7e(0x120)]())_0x1e70e1=_0x30bb2a[0x0];else return console['error'](_0x2bbf7e(0x238)+_0x30bb2a[0x0]+_0x2bbf7e(0x235)),0x1;}catch{_0x11008f=_0x30bb2a[0x0],_0x1e70e1='.';}}const _0x480ccf=_0x229b80[_0x2bbf7e(0x12c)],_0x2c9005=_0x229b80[_0x2bbf7e(0x1fa)];_0x229b80[_0x2bbf7e(0x219)]&&(console[_0x2bbf7e(0x1bf)](_0x2bbf7e(0x1da)+_0x1e70e1),_0x11008f&&console[_0x2bbf7e(0x1bf)](_0x2bbf7e(0x1b4)+_0x11008f),_0x480ccf&&console['error'](_0x2bbf7e(0x126)+_0x480ccf),_0x2c9005&&console[_0x2bbf7e(0x1bf)](_0x2bbf7e(0x183)));const _0x15ebd7=await withSpinner(_0x2bbf7e(0x1ea),()=>_0x4ef4ea[_0x2bbf7e(0x166)]['push'](_0x1e70e1,{'projectName':_0x11008f,'revision':_0x480ccf,'skipValidation':_0x2c9005}),{'verbose':_0x229b80['verbose']}),_0x14465a=_0x15ebd7[_0x2bbf7e(0x1ab)];return console[_0x2bbf7e(0x1bf)](_0x2bbf7e(0x106)+_0x14465a[_0x2bbf7e(0x192)]),console['error'](_0x2bbf7e(0x1b7)+_0x14465a[_0x2bbf7e(0x181)]),console[_0x2bbf7e(0x1bf)](_0x2bbf7e(0x1ff)+_0x14465a[_0x2bbf7e(0x12c)]),await this[_0x2bbf7e(0x151)](_0x4ef4ea,_0x14465a[_0x2bbf7e(0x192)],_0x229b80[_0x2bbf7e(0x213)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a38_0x2f1d07(0x1fb)]='workflow:pull';['description']=a38_0x2f1d07(0x229);async[a38_0x2f1d07(0x1a7)](_0x3faa46){const _0x49f79a=a38_0x2f1d07,{options:_0x26880f,args:_0xd92459,tdx:_0x31d048}=_0x3faa46,_0x52184c=_0xd92459[0x0],_0x56f572=_0xd92459[0x1];if(!_0x52184c)return console[_0x49f79a(0x1bf)](a38_0x3a8e01['red']('Error:'),_0x49f79a(0x19b)),console[_0x49f79a(0x1bf)](a38_0x3a8e01['dim'](_0x49f79a(0x182))),0x1;const _0xbe2023=_0x26880f[_0x49f79a(0x12c)];_0x26880f[_0x49f79a(0x219)]&&(console[_0x49f79a(0x1bf)](_0x49f79a(0x1bc)+_0x52184c),_0x56f572&&console[_0x49f79a(0x1bf)](_0x49f79a(0x110)+_0x56f572),_0xbe2023&&console[_0x49f79a(0x1bf)](_0x49f79a(0x126)+_0xbe2023),_0x26880f['dryRun']&&console[_0x49f79a(0x1bf)](_0x49f79a(0x17b)));const _0x2cb94f=await withSpinner('Pulling\x20project\x20'+_0x52184c+_0x49f79a(0x1ec),()=>_0x31d048[_0x49f79a(0x166)][_0x49f79a(0x189)](_0x52184c,{'targetDir':_0x56f572,'revision':_0xbe2023}),{'verbose':_0x26880f[_0x49f79a(0x219)]}),_0x1e056f=_0x2cb94f['data'];_0x1e056f[_0x49f79a(0x118)]?console[_0x49f79a(0x1bf)](_0x49f79a(0x107)+_0x1e056f[_0x49f79a(0x192)]):console[_0x49f79a(0x1bf)]('✔\x20Project:\x20'+_0x1e056f[_0x49f79a(0x192)]);console[_0x49f79a(0x1bf)](_0x49f79a(0x1ff)+_0x1e056f['revision']),console[_0x49f79a(0x1bf)](_0x49f79a(0x158)+(a38_0x37abe7[_0x49f79a(0x141)](process[_0x49f79a(0x1ce)](),_0x1e056f[_0x49f79a(0x153)])||'.')),console[_0x49f79a(0x1bf)]('\x20\x20Changes:\x20'+a38_0x3a8e01['green']('+'+_0x1e056f[_0x49f79a(0x1de)][_0x49f79a(0x17e)]+_0x49f79a(0x116))+',\x20'+(a38_0x3a8e01[_0x49f79a(0x131)]('~'+_0x1e056f[_0x49f79a(0x1de)][_0x49f79a(0x190)]+_0x49f79a(0x1e7))+',\x20')+(a38_0x3a8e01[_0x49f79a(0x16b)]('-'+_0x1e056f['summary'][_0x49f79a(0x13c)]+_0x49f79a(0x20a))+',\x20')+(''+a38_0x3a8e01['dim'](_0x1e056f[_0x49f79a(0x1de)][_0x49f79a(0x135)]+'\x20unchanged')));for(const _0x4b1bf3 of _0x1e056f[_0x49f79a(0x191)]){_0x4b1bf3['type']===_0x49f79a(0x190)&&_0x4b1bf3['diff']&&(console[_0x49f79a(0x1bf)]('\x0a'+a38_0x3a8e01['cyan']('---\x20'+_0x4b1bf3[_0x49f79a(0x198)])),console[_0x49f79a(0x1bf)](_0x4b1bf3[_0x49f79a(0x1f9)]));}if(!_0x1e056f['hasChanges'])return saveSessionContext({'workflow_project':_0x1e056f[_0x49f79a(0x192)]},_0x26880f['session']),console[_0x49f79a(0x1bf)](a38_0x3a8e01['green'](_0x49f79a(0x10f))),console[_0x49f79a(0x1bf)](a38_0x3a8e01[_0x49f79a(0x237)](_0x49f79a(0x168)+_0x1e056f[_0x49f79a(0x192)])),0x0;if(_0x26880f[_0x49f79a(0x163)])return console['error'](a38_0x3a8e01[_0x49f79a(0x131)](_0x49f79a(0x130))),0x0;if(!_0x26880f['yes']){const _0x2fa6a3=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x2fa6a3)return console[_0x49f79a(0x1bf)](_0x49f79a(0x111)),0x0;}await withSpinner(_0x49f79a(0x12a),()=>_0x31d048[_0x49f79a(0x166)]['applyPullProject'](_0x1e056f,{'revision':_0xbe2023}),{'verbose':_0x26880f[_0x49f79a(0x219)]}),saveSessionContext({'workflow_project':_0x1e056f['projectName']},_0x26880f['session']),console[_0x49f79a(0x1bf)](a38_0x3a8e01[_0x49f79a(0x1d1)](_0x49f79a(0x174)));const _0x203ed3=a38_0x37abe7[_0x49f79a(0x141)](process[_0x49f79a(0x1ce)](),_0x1e056f['targetDir'])||'.';return console[_0x49f79a(0x1bf)](a38_0x3a8e01[_0x49f79a(0x237)](_0x49f79a(0x1f6)+_0x203ed3)),console[_0x49f79a(0x1bf)](a38_0x3a8e01[_0x49f79a(0x237)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x1e056f[_0x49f79a(0x192)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a38_0x2f1d07(0x1fb)]='workflow:push';[a38_0x2f1d07(0x14c)]=a38_0x2f1d07(0x18e);async[a38_0x2f1d07(0x1a7)](_0xfb3776){const _0x2b3b63=a38_0x2f1d07,{options:_0xfffcbc,args:_0x9578f1,tdx:_0x337e6f}=_0xfb3776,_0x3955a1=this[_0x2b3b63(0x188)](_0x9578f1,_0xfffcbc),_0x3573e6=_0xfffcbc[_0x2b3b63(0x12c)],_0x13f0f1=_0xfffcbc[_0x2b3b63(0x1fa)];_0xfffcbc['verbose']&&(_0x3955a1&&console['error'](_0x2b3b63(0x20d)+_0x3955a1),_0x3573e6&&console[_0x2b3b63(0x1bf)]('Revision:\x20'+_0x3573e6),_0xfffcbc[_0x2b3b63(0x163)]&&console[_0x2b3b63(0x1bf)]('Dry\x20run:\x20yes'),_0x13f0f1&&console[_0x2b3b63(0x1bf)](_0x2b3b63(0x183)));let _0x49587b;try{_0x49587b=await withSpinner(_0x2b3b63(0x150),()=>_0x337e6f[_0x2b3b63(0x166)][_0x2b3b63(0x1e3)]({'sourceDir':_0x3955a1,'revision':_0x3573e6,'skipValidation':_0x13f0f1}),{'verbose':_0xfffcbc[_0x2b3b63(0x219)]});}catch(_0x16a45c){if(_0x16a45c instanceof Error&&_0x16a45c[_0x2b3b63(0x19c)]['includes']('No\x20workflow\x20tdx.json\x20found'))return console[_0x2b3b63(0x1bf)](a38_0x3a8e01[_0x2b3b63(0x16b)](_0x2b3b63(0x196)),_0x2b3b63(0x15e)),_0xfffcbc[_0x2b3b63(0x1ed)]?console[_0x2b3b63(0x1bf)](a38_0x3a8e01['dim']('Tip:\x20cd\x20to\x20workflows/'+_0xfffcbc[_0x2b3b63(0x1ed)]+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0xfffcbc[_0x2b3b63(0x1ed)]+'\x27')):console[_0x2b3b63(0x1bf)](a38_0x3a8e01[_0x2b3b63(0x237)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x16a45c;}const _0x280b8a=_0x49587b['data'];console['error'](_0x2b3b63(0x127)+_0x280b8a[_0x2b3b63(0x192)]),console[_0x2b3b63(0x1bf)](_0x2b3b63(0x140)+_0x280b8a[_0x2b3b63(0x1b6)]),console[_0x2b3b63(0x1bf)]('\x20\x20Revision:\x20'+_0x280b8a['revision']),console[_0x2b3b63(0x1bf)](_0x2b3b63(0x1b5)+a38_0x3a8e01[_0x2b3b63(0x1d1)]('+'+_0x280b8a[_0x2b3b63(0x1de)][_0x2b3b63(0x17e)]+'\x20new')+',\x20'+(a38_0x3a8e01['yellow']('~'+_0x280b8a['summary'][_0x2b3b63(0x190)]+_0x2b3b63(0x1e7))+',\x20')+(a38_0x3a8e01['red']('-'+_0x280b8a['summary'][_0x2b3b63(0x13c)]+_0x2b3b63(0x20a))+',\x20')+(''+a38_0x3a8e01['dim'](_0x280b8a[_0x2b3b63(0x1de)]['unchanged']+'\x20unchanged')));for(const _0x854546 of _0x280b8a[_0x2b3b63(0x191)]){_0x854546[_0x2b3b63(0x1ad)]===_0x2b3b63(0x190)&&_0x854546[_0x2b3b63(0x1f9)]&&(console[_0x2b3b63(0x1bf)]('\x0a'+a38_0x3a8e01['cyan'](_0x2b3b63(0x21b)+_0x854546[_0x2b3b63(0x198)])),console['error'](_0x854546[_0x2b3b63(0x1f9)]));}if(!_0x280b8a[_0x2b3b63(0x1d9)])return console[_0x2b3b63(0x1bf)](a38_0x3a8e01[_0x2b3b63(0x1d1)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this['showWorkflowConsoleUrl'](_0x337e6f,_0x280b8a[_0x2b3b63(0x192)],_0xfffcbc[_0x2b3b63(0x213)]),0x0;if(_0xfffcbc['dryRun'])return console[_0x2b3b63(0x1bf)](a38_0x3a8e01['yellow'](_0x2b3b63(0x22c))),0x0;if(!_0xfffcbc['yes']){const _0x39b3d5=await confirmKey(_0x2b3b63(0x234));if(!_0x39b3d5)return console['error'](_0x2b3b63(0x111)),0x0;}const _0x21eb81=await withSpinner(_0x2b3b63(0x145),()=>_0x337e6f[_0x2b3b63(0x166)][_0x2b3b63(0x15d)](_0x280b8a),{'verbose':_0xfffcbc[_0x2b3b63(0x219)]}),_0x33dc23=_0x21eb81[_0x2b3b63(0x1ab)];return console[_0x2b3b63(0x1bf)](a38_0x3a8e01[_0x2b3b63(0x1d1)](_0x2b3b63(0x14d))),console[_0x2b3b63(0x1bf)]('\x20\x20Project\x20ID:\x20'+_0x33dc23['projectId']),console[_0x2b3b63(0x1bf)]('\x20\x20Revision:\x20'+_0x33dc23[_0x2b3b63(0x12c)]),await this[_0x2b3b63(0x151)](_0x337e6f,_0x33dc23[_0x2b3b63(0x192)],_0xfffcbc['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a38_0x2f1d07(0x1fb)]='workflow:clone';[a38_0x2f1d07(0x14c)]=a38_0x2f1d07(0x203);async[a38_0x2f1d07(0x1a7)](_0x2c5ecd){const _0x5e430f=a38_0x2f1d07,{options:_0x3618ec,args:_0x58e0fe,tdx:_0x29d568}=_0x2c5ecd,_0x5ddbce=this[_0x5e430f(0x188)](_0x58e0fe,_0x3618ec),_0x4a4800=_0x3618ec['name'],_0x3857a0=_0x3618ec[_0x5e430f(0x12c)],_0x55a04a=_0x3618ec[_0x5e430f(0x1fa)];if(!_0x5ddbce)return console[_0x5e430f(0x1bf)](a38_0x3a8e01[_0x5e430f(0x16b)](_0x5e430f(0x196)),_0x5e430f(0x11d)),console[_0x5e430f(0x1bf)](a38_0x3a8e01[_0x5e430f(0x237)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x5e430f(0x1bf)](a38_0x3a8e01['dim'](_0x5e430f(0x1eb))),0x1;if(!_0x4a4800)return console[_0x5e430f(0x1bf)](a38_0x3a8e01['red']('Error:'),_0x5e430f(0x1b3)),console[_0x5e430f(0x1bf)](a38_0x3a8e01[_0x5e430f(0x237)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x3618ec[_0x5e430f(0x219)]&&(console[_0x5e430f(0x1bf)](_0x5e430f(0x20d)+_0x5ddbce),console[_0x5e430f(0x1bf)]('New\x20project\x20name:\x20'+_0x4a4800),_0x3857a0&&console['error'](_0x5e430f(0x126)+_0x3857a0),_0x3618ec[_0x5e430f(0x163)]&&console[_0x5e430f(0x1bf)]('Dry\x20run:\x20yes'),_0x55a04a&&console[_0x5e430f(0x1bf)](_0x5e430f(0x183)));const _0x33ccce=await withSpinner('Analyzing\x20project...',()=>_0x29d568[_0x5e430f(0x166)][_0x5e430f(0x105)](_0x5ddbce,_0x4a4800,{'revision':_0x3857a0,'skipValidation':_0x55a04a}),{'verbose':_0x3618ec[_0x5e430f(0x219)]}),_0x47c302=_0x33ccce['data'];console[_0x5e430f(0x1bf)](_0x5e430f(0x227)+_0x47c302['sourceDir']);_0x47c302['sourceProjectName']&&console[_0x5e430f(0x1bf)](_0x5e430f(0x1f1)+_0x47c302['sourceProjectName']);console['error'](_0x5e430f(0x1d0)+_0x47c302[_0x5e430f(0x16c)]),console[_0x5e430f(0x1bf)](_0x5e430f(0x126)+_0x47c302[_0x5e430f(0x12c)]),console['error'](_0x5e430f(0x12e)+_0x47c302[_0x5e430f(0x119)]);_0x47c302[_0x5e430f(0x1d4)]&&(console[_0x5e430f(0x1bf)](a38_0x3a8e01['yellow'](_0x5e430f(0x19e)+_0x47c302['newProjectName']+_0x5e430f(0x113)+_0x47c302[_0x5e430f(0x23a)]+')')),console[_0x5e430f(0x1bf)](a38_0x3a8e01['yellow']('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x3618ec[_0x5e430f(0x163)])return console[_0x5e430f(0x1bf)](a38_0x3a8e01[_0x5e430f(0x131)](_0x5e430f(0x15c))),0x0;if(!_0x3618ec[_0x5e430f(0x14b)]){const _0x540fd0=_0x47c302[_0x5e430f(0x1e4)]||a38_0x37abe7[_0x5e430f(0x121)](_0x5ddbce),_0x59aa6c=_0x47c302[_0x5e430f(0x1d4)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x4a4800+_0x5e430f(0x199):_0x5e430f(0x21d)+_0x540fd0+_0x5e430f(0x159)+_0x4a4800+'\x22?',_0x6e516b=await confirmKey(_0x59aa6c);if(!_0x6e516b)return console[_0x5e430f(0x1bf)](_0x5e430f(0x111)),0x0;}const _0x29bdc3=await withSpinner(_0x47c302['targetExists']?_0x5e430f(0x18a)+_0x4a4800+_0x5e430f(0x1ec):_0x5e430f(0x10c)+_0x4a4800+'...',()=>_0x29d568['workflow'][_0x5e430f(0x1f5)](_0x47c302),{'verbose':_0x3618ec[_0x5e430f(0x219)]}),_0x37b44e=_0x29bdc3[_0x5e430f(0x1ab)];return console[_0x5e430f(0x1bf)](a38_0x3a8e01[_0x5e430f(0x1d1)](_0x47c302[_0x5e430f(0x1d4)]?_0x5e430f(0x1ee):'✔\x20Clone\x20complete')),console['error']('\x20\x20Project:\x20'+_0x37b44e[_0x5e430f(0x16c)]),console[_0x5e430f(0x1bf)]('\x20\x20Project\x20ID:\x20'+_0x37b44e[_0x5e430f(0x1a6)]),console[_0x5e430f(0x1bf)](_0x5e430f(0x1ff)+_0x37b44e[_0x5e430f(0x12c)]),await this['showWorkflowConsoleUrl'](_0x29d568,_0x37b44e[_0x5e430f(0x16c)],_0x3618ec[_0x5e430f(0x213)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a38_0x2f1d07(0x1c2);['description']=a38_0x2f1d07(0x236);async[a38_0x2f1d07(0x1a7)](_0x3587cf){const _0x25c773=a38_0x2f1d07,{options:_0xa0782b,args:_0x499cc2,tdx:_0x29dcc5}=_0x3587cf,_0x420fb2=_0x499cc2[0x0];if(!_0x420fb2)return console['error'](_0x25c773(0x1e2)),console[_0x25c773(0x1bf)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0xa0782b['verbose']&&console[_0x25c773(0x1bf)](_0x25c773(0x1bc)+_0x420fb2);if(!_0xa0782b[_0x25c773(0x14b)]){const _0x2814c6=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x420fb2+_0x25c773(0x228));if(!_0x2814c6)return console[_0x25c773(0x1bf)](_0x25c773(0x111)),0x0;}const _0x14a7d0=await withSpinner(_0x25c773(0x1db)+_0x420fb2+_0x25c773(0x1ec),()=>_0x29dcc5[_0x25c773(0x166)][_0x25c773(0x13a)](_0x420fb2),{'verbose':_0xa0782b['verbose']}),_0x5d58e4=_0x14a7d0[_0x25c773(0x1ab)];return console[_0x25c773(0x1bf)]('✔\x20Deleted\x20project\x20'+_0x5d58e4[_0x25c773(0x192)]),console['error'](_0x25c773(0x1b7)+_0x5d58e4[_0x25c773(0x181)]),0x0;}}export function parseKeyValue(_0x2c2525){const _0x1e55cb=a38_0x2f1d07,_0x56d8d3=_0x2c2525[_0x1e55cb(0x186)]('=');if(_0x56d8d3===-0x1)throw new Error(_0x1e55cb(0x148)+_0x2c2525+_0x1e55cb(0x239));const _0x2ec9c3=_0x2c2525[_0x1e55cb(0x1c6)](0x0,_0x56d8d3),_0x1f12a7=_0x2c2525[_0x1e55cb(0x1c6)](_0x56d8d3+0x1);if(!_0x2ec9c3)throw new Error(_0x1e55cb(0x1b2));return{'key':_0x2ec9c3,'value':_0x1f12a7};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a38_0x2f1d07(0x1fb)]=a38_0x2f1d07(0x11b);[a38_0x2f1d07(0x14c)]=a38_0x2f1d07(0x19a);async[a38_0x2f1d07(0x1a7)](_0x4621c4){const _0x3e8ebc=a38_0x2f1d07,{options:_0x502316,args:_0x569fb6,tdx:_0x6be009}=_0x4621c4,_0x559c95=this[_0x3e8ebc(0x16d)](_0x569fb6,_0x502316);if(!_0x559c95)return 0x1;_0x502316[_0x3e8ebc(0x219)]&&console[_0x3e8ebc(0x1bf)]('Project:\x20'+_0x559c95);const _0x55c7a2=await withSpinner(_0x3e8ebc(0x1f8),()=>_0x6be009['workflow'][_0x3e8ebc(0x175)](_0x559c95),{'verbose':_0x502316[_0x3e8ebc(0x219)]}),{secrets:_0x1ce422}=_0x55c7a2['data'];return console[_0x3e8ebc(0x1bf)](_0x3e8ebc(0x1be)+_0x1ce422['length']+'\x20secret'+(_0x1ce422['length']!==0x1?'s':'')),await handleSDKOutput(_0x1ce422,_0x502316),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a38_0x2f1d07(0x15b);['description']=a38_0x2f1d07(0x218);async[a38_0x2f1d07(0x1a7)](_0x394d8a){const _0x2faff9=a38_0x2f1d07,{options:_0x2bd692,args:_0x260c41,tdx:_0x1de054}=_0x394d8a;let _0x49d351,_0x2a5d78;if(_0x260c41['length']>=0x2)_0x49d351=_0x260c41[0x0],_0x2a5d78=_0x260c41[0x1];else{if(_0x260c41[_0x2faff9(0x17c)]===0x1&&_0x2bd692[_0x2faff9(0x1ed)])_0x49d351=_0x2bd692['workflowProject'],_0x2a5d78=_0x260c41[0x0];else return _0x260c41[_0x2faff9(0x17c)]===0x1?(console[_0x2faff9(0x1bf)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x2faff9(0x1bf)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x2faff9(0x1bf)](_0x2faff9(0x224)),console[_0x2faff9(0x1bf)](_0x2faff9(0x1c0)),0x1);}let _0x16329e,_0xbaa6e1;try{({key:_0x16329e,value:_0xbaa6e1}=parseKeyValue(_0x2a5d78));}catch(_0x111ef9){return _0x111ef9 instanceof Error&&console[_0x2faff9(0x1bf)](a38_0x3a8e01[_0x2faff9(0x16b)](_0x2faff9(0x196)),_0x111ef9[_0x2faff9(0x19c)]),0x1;}_0x2bd692[_0x2faff9(0x219)]&&(console[_0x2faff9(0x1bf)](_0x2faff9(0x1bc)+_0x49d351),console[_0x2faff9(0x1bf)](_0x2faff9(0x1c1)+_0x16329e));const _0x26576e=await withSpinner(_0x2faff9(0x1d2),()=>_0x1de054[_0x2faff9(0x166)][_0x2faff9(0x1df)](_0x49d351,_0x16329e,_0xbaa6e1),{'verbose':_0x2bd692[_0x2faff9(0x219)]}),_0x317679=_0x26576e['data'];return console[_0x2faff9(0x1bf)](_0x2faff9(0x209)+_0x317679[_0x2faff9(0x164)]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x317679[_0x2faff9(0x192)]+'\x27'),(_0x2bd692[_0x2faff9(0x180)]||_0x2bd692[_0x2faff9(0x13f)])&&await handleSingleObjectOutput(_0x317679,_0x2bd692),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a38_0x2f1d07(0x1fb)]=a38_0x2f1d07(0x1f4);['description']=a38_0x2f1d07(0x226);async[a38_0x2f1d07(0x1a7)](_0x371e58){const _0x1c254e=a38_0x2f1d07,{options:_0x555f0a,args:_0x27b604,tdx:_0x3e489e}=_0x371e58;let _0x549ccf,_0x39552d;if(_0x27b604[_0x1c254e(0x17c)]>=0x2)_0x549ccf=_0x27b604[0x0],_0x39552d=_0x27b604[0x1];else{if(_0x27b604[_0x1c254e(0x17c)]===0x1&&_0x555f0a[_0x1c254e(0x1ed)])_0x549ccf=_0x555f0a[_0x1c254e(0x1ed)],_0x39552d=_0x27b604[0x0];else return _0x27b604[_0x1c254e(0x17c)]===0x1?(console['error'](_0x1c254e(0x11e)),console['error'](_0x1c254e(0x1e6)),0x1):(console[_0x1c254e(0x1bf)](_0x1c254e(0x195)),console[_0x1c254e(0x1bf)](_0x1c254e(0x1ca)),0x1);}_0x555f0a[_0x1c254e(0x219)]&&(console[_0x1c254e(0x1bf)](_0x1c254e(0x1bc)+_0x549ccf),console[_0x1c254e(0x1bf)]('Key:\x20'+_0x39552d));if(!_0x555f0a['yes']){const _0x11f73f=await confirmKey(_0x1c254e(0x16a)+_0x39552d+'\x27\x20from\x20project\x20\x27'+_0x549ccf+'\x27?');if(!_0x11f73f)return console['error']('Cancelled'),0x0;}const _0x1a5f74=await withSpinner(_0x1c254e(0x136),()=>_0x3e489e['workflow'][_0x1c254e(0x165)](_0x549ccf,_0x39552d),{'verbose':_0x555f0a[_0x1c254e(0x219)]}),_0x2c2dd8=_0x1a5f74[_0x1c254e(0x1ab)];return console['error'](_0x1c254e(0x209)+_0x2c2dd8[_0x1c254e(0x164)]+_0x1c254e(0x124)+_0x2c2dd8['projectName']+'\x27'),(_0x555f0a['json']||_0x555f0a[_0x1c254e(0x13f)])&&await handleSingleObjectOutput(_0x2c2dd8,_0x555f0a),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a39_0x57c9(_0x4ebe06,_0x48570f){_0x4ebe06=_0x4ebe06-0x1c1;const _0x2ddade=a39_0x2dda();let _0x57c9ce=_0x2ddade[_0x4ebe06];return _0x57c9ce;}(function(_0x25310b,_0x19b6b7){const _0x164318=a39_0x57c9,_0x524a4b=_0x25310b();while(!![]){try{const _0x4c8cb3=parseInt(_0x164318(0x1c5))/0x1+-parseInt(_0x164318(0x1c6))/0x2*(parseInt(_0x164318(0x1c1))/0x3)+parseInt(_0x164318(0x1cd))/0x4+parseInt(_0x164318(0x1cf))/0x5*(-parseInt(_0x164318(0x1d3))/0x6)+parseInt(_0x164318(0x1c8))/0x7*(-parseInt(_0x164318(0x1d2))/0x8)+-parseInt(_0x164318(0x1ce))/0x9*(-parseInt(_0x164318(0x1d1))/0xa)+parseInt(_0x164318(0x1ca))/0xb;if(_0x4c8cb3===_0x19b6b7)break;else _0x524a4b['push'](_0x524a4b['shift']());}catch(_0x5cfdf5){_0x524a4b['push'](_0x524a4b['shift']());}}}(a39_0x2dda,0xdea24));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x103f1e=a39_0x57c9,_0x268245=getVersion(),_0x57f626=platform(),_0x5cebaa=process[_0x103f1e(0x1c7)][_0x103f1e(0x1c2)]('v','');return'tdx/'+_0x268245+'\x20('+_0x57f626+_0x103f1e(0x1c3)+_0x5cebaa+')';}export function getAuthHeaders(_0x46cdc9,_0x1a275c){const _0x34ded7=a39_0x57c9,_0x4897c5=getVersion(),_0x16f04f={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x4897c5};return _0x1a275c&&(_0x16f04f[_0x34ded7(0x1c4)]=_0x34ded7(0x1cc)+_0x1a275c),_0x16f04f;}export function toHeaderRecord(_0x114884){const _0x30da40=a39_0x57c9,_0x585817={};for(const [_0x5c0073,_0x4b0099]of Object[_0x30da40(0x1cb)](_0x114884)){_0x4b0099!==undefined&&(_0x585817[_0x5c0073]=_0x4b0099);}return _0x585817;}function a39_0x2dda(){const _0x1ac636=[';\x20node/','Authorization','394345HZYVHd','2rndCKD','version','287pxyHoE','X-Trino-User','16484215mOQdMW','entries','TD1\x20','632712Zasqek','180jgaumZ','5ixRlzd','length','844430wFveFh','254480QHITgs','5745738ifvsSU','1698621SjIefE','replace'];a39_0x2dda=function(){return _0x1ac636;};return a39_0x2dda();}export function getTrinoHeaders(_0x17f047,_0xcb0376){const _0x2f8853=a39_0x57c9,_0x45991d=getAuthHeaders(_0x17f047,_0xcb0376),_0x1623bf=toHeaderRecord(_0x45991d);return delete _0x1623bf[_0x2f8853(0x1c4)],_0xcb0376&&(_0x1623bf[_0x2f8853(0x1c9)]=_0xcb0376),_0x1623bf;}export function hasAPIKey(_0xca9e42){const _0x2ab938=a39_0x57c9,_0x3ae00b=getAPIKey(_0xca9e42);return _0x3ae00b!==undefined&&_0x3ae00b[_0x2ab938(0x1d0)]>0x0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x58fb27,_0x600087){const _0x12bf59=a40_0x4a90,_0x1e444a=_0x58fb27();while(!![]){try{const _0x1e0e44=-parseInt(_0x12bf59(0x1c7))/0x1*(-parseInt(_0x12bf59(0x18c))/0x2)+parseInt(_0x12bf59(0x1bd))/0x3*(-parseInt(_0x12bf59(0x1b6))/0x4)+parseInt(_0x12bf59(0x1a1))/0x5+-parseInt(_0x12bf59(0x18a))/0x6*(-parseInt(_0x12bf59(0x1b4))/0x7)+-parseInt(_0x12bf59(0x19c))/0x8*(-parseInt(_0x12bf59(0x1c3))/0x9)+-parseInt(_0x12bf59(0x181))/0xa+-parseInt(_0x12bf59(0x185))/0xb*(parseInt(_0x12bf59(0x1a4))/0xc);if(_0x1e0e44===_0x600087)break;else _0x1e444a['push'](_0x1e444a['shift']());}catch(_0x3c1c30){_0x1e444a['push'](_0x1e444a['shift']());}}}(a40_0x46cd,0x79c01));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';function a40_0x46cd(){const _0x4c4c29=['log','462685xCyMPP','length','cyan','1135932qUFSdR','table','stringify','forEach','blue','[error]','max','format','cmdout','query','params','rule','inherit','magenta','filter','repeat','2292521HYUvcG','[rule]','4xrvyaG','─┴─','double','push','resolve','debug','stdin','2458989PJZfou','number','bold','keys','-FXRSn','stderr','187092ZTFkUP','[logs]','entries','less','4cMEpNm','error','output','write','3392230FKoBvU','spawn','pipe','[params]','55ZEsGtm','padEnd','stdout','boolean','map','6SfbKcl','limit','398084ipdWlN','bigint','jsonl','No\x20data','close','─┬─','tsv','join','varchar','split','FINISHED','trim','end','isTTY','json','object','352CJmSOS','noColor','[query]','isInteger'];a40_0x46cd=function(){return _0x4c4c29;};return a40_0x46cd();}import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a40_0xfba5e4 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0xccc845){const _0x2eb2ed=a40_0x4a90;return _0xccc845[_0x2eb2ed(0x1ab)]==='json'||_0xccc845[_0x2eb2ed(0x1ab)]===_0x2eb2ed(0x18e)||_0xccc845[_0x2eb2ed(0x1ab)]==='tsv'||_0xccc845[_0x2eb2ed(0x1ab)]===_0x2eb2ed(0x1a5)||_0xccc845['json']===!![]||_0xccc845[_0x2eb2ed(0x18e)]===!![]||_0xccc845['tsv']===!![]||_0xccc845['table']===!![];}export function parseOutputOptions(_0x3e9165){const _0x34b22a=a40_0x4a90;return{'format':_0x3e9165[_0x34b22a(0x1ab)]||_0x34b22a(0x1a5),'output':_0x3e9165['output']||'','limit':_0x3e9165[_0x34b22a(0x18b)],'color':_0x3e9165['color'],'noColor':_0x3e9165[_0x34b22a(0x19d)]};}function convertSDKResultToQueryResult(_0x50e053){const _0x4d4957=a40_0x4a90,_0x339165=[];if(_0x50e053[_0x4d4957(0x1a2)]>0x0){const _0x41a9ce=_0x50e053[0x0];for(const [_0x47e0ce,_0x1fa3ed]of Object[_0x4d4957(0x1c5)](_0x41a9ce)){let _0x4b8db4=_0x4d4957(0x194);if(typeof _0x1fa3ed===_0x4d4957(0x1be))_0x4b8db4=Number[_0x4d4957(0x19f)](_0x1fa3ed)?_0x4d4957(0x18d):_0x4d4957(0x1b8);else{if(typeof _0x1fa3ed===_0x4d4957(0x188))_0x4b8db4='boolean';else _0x1fa3ed===null&&(_0x4b8db4=_0x4d4957(0x194));}_0x339165[_0x4d4957(0x1b9)]({'name':_0x47e0ce,'type':_0x4b8db4});}}return{'queryId':'sdk-result','columns':_0x339165,'data':_0x50e053,'stats':{'state':_0x4d4957(0x196),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x50e053[_0x4d4957(0x1a2)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x1e5b32,_0x6f1ee8){const _0x5092a7=convertSDKResultToQueryResult(_0x1e5b32);return formatQueryOutput(_0x5092a7,_0x6f1ee8);}export async function formatQueryOutput(_0x2b5602,_0x2da49a){const _0x23216d=a40_0x4a90,{format:_0x5c04ae,limit:_0x488149,output:_0x26862e,color:_0x1c8e29,noColor:_0x5f2efa}=_0x2da49a,_0x4882b8=Boolean(_0x26862e)&&!_0x1c8e29,_0x14fd6e={'color':_0x1c8e29,'noColor':_0x5f2efa||_0x4882b8};if(_0x5c04ae==='table'){const _0x3da5bb=shouldUseLess(_0x5c04ae,_0x26862e);return formatAsTable(_0x2b5602,_0x488149,_0x3da5bb,_0x14fd6e);}else{if(_0x5c04ae===_0x23216d(0x19a))return formatAsJSON(_0x2b5602,_0x14fd6e);else return _0x5c04ae==='jsonl'?formatAsJSONL(_0x2b5602,_0x14fd6e):formatQueryResult(_0x2b5602,_0x5c04ae);}}function a40_0x4a90(_0x257414,_0x4c5833){_0x257414=_0x257414-0x17e;const _0x46cd91=a40_0x46cd();let _0x4a902f=_0x46cd91[_0x257414];return _0x4a902f;}function shouldUseLess(_0x1ffa8d,_0x17001c){const _0x35eb34=a40_0x4a90;return(_0x1ffa8d===_0x35eb34(0x1a5)||_0x1ffa8d==='list')&&process[_0x35eb34(0x187)][_0x35eb34(0x199)]&&!_0x17001c;}export function resolveOutputOptions(_0x1ed141){const _0x5c8c79=a40_0x4a90,_0x4ca433=resolveOutputFormat(_0x1ed141[_0x5c8c79(0x1ab)],_0x1ed141[_0x5c8c79(0x17f)],_0x5c8c79(0x1a5));let _0x20ea39=typeof _0x1ed141[_0x5c8c79(0x18b)]===_0x5c8c79(0x1be)?_0x1ed141[_0x5c8c79(0x18b)]:parseInt(_0x1ed141[_0x5c8c79(0x18b)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x4f2985=_0x1ed141['output']||'';return shouldUseLess(_0x4ca433,_0x4f2985)&&(_0x20ea39=Infinity),{'format':_0x4ca433,'output':_0x4f2985,'limit':_0x20ea39,'color':_0x1ed141['color'],'noColor':_0x1ed141[_0x5c8c79(0x19d)]};}export function writeOutput(_0x4fa626,_0x329d97,_0x5dcb99){const _0x27c455=a40_0x4a90;return _0x329d97?(writeFileSync(_0x329d97,_0x4fa626),console[_0x27c455(0x17e)]('Results\x20saved\x20to\x20'+_0x329d97),Promise[_0x27c455(0x1ba)]()):shouldUseLess(_0x5dcb99||'','')?new Promise(_0x72fb45=>{const _0xde5916=_0x27c455,_0x491eb2=spawn(_0xde5916(0x1c6),[_0xde5916(0x1c1)],{'stdio':[_0xde5916(0x183),_0xde5916(0x1b0),_0xde5916(0x1b0)]});let _0x2b0eda=![];_0x491eb2['on']('error',()=>{const _0x278f89=_0xde5916;!_0x2b0eda&&(_0x2b0eda=!![],console[_0x278f89(0x1a0)](_0x4fa626),_0x72fb45());}),_0x491eb2['on'](_0xde5916(0x190),()=>{!_0x2b0eda&&(_0x2b0eda=!![],_0x72fb45());}),_0x491eb2['on'](_0xde5916(0x182),()=>{const _0x230e0d=_0xde5916;!_0x2b0eda&&_0x491eb2[_0x230e0d(0x1bc)]&&(_0x491eb2[_0x230e0d(0x1bc)]['on']('error',()=>{}),_0x491eb2[_0x230e0d(0x1bc)][_0x230e0d(0x180)](_0x4fa626),_0x491eb2[_0x230e0d(0x1bc)][_0x230e0d(0x198)]());}),!_0x491eb2[_0xde5916(0x1bc)]&&(!_0x2b0eda&&(_0x2b0eda=!![],console[_0xde5916(0x1a0)](_0x4fa626),_0x72fb45()));}):(console[_0x27c455(0x1a0)](_0x4fa626),Promise[_0x27c455(0x1ba)]());}export async function handleSDKOutput(_0x3e8c5d,_0x30211a){const _0x59b8ad=a40_0x4a90,_0x1c89e0=resolveOutputOptions(_0x30211a),_0x36ba6e=await formatSDKOutput(_0x3e8c5d,_0x1c89e0);await writeOutput(_0x36ba6e,_0x1c89e0[_0x59b8ad(0x17f)]||undefined,_0x1c89e0[_0x59b8ad(0x1ab)]);}export async function handleQueryOutput(_0x5a2069,_0x3e7af7){const _0x435464=a40_0x4a90,_0x3b623a=resolveOutputOptions(_0x3e7af7),_0x214b08=await formatQueryOutput(_0x5a2069,_0x3b623a);await writeOutput(_0x214b08,_0x3b623a[_0x435464(0x17f)]||undefined,_0x3b623a[_0x435464(0x1ab)]);}async function formatSingleObject(_0x4fb8c3,_0x3e932b){const _0x260e59=a40_0x4a90,{format:_0x4a1635,color:_0x17c9ba,noColor:_0x2664e6}=_0x3e932b,_0x4f461f={'color':_0x17c9ba,'noColor':_0x2664e6};if(_0x4a1635===_0x260e59(0x19a)){if(shouldUseColor(_0x4f461f))return colorizeJSON(_0x4fb8c3,_0x4f461f);return JSON[_0x260e59(0x1a6)](_0x4fb8c3,null,0x2);}else{if(_0x4a1635===_0x260e59(0x18e)){if(shouldUseColor(_0x4f461f))return colorizeJSONCompact(_0x4fb8c3,_0x4f461f);return JSON['stringify'](_0x4fb8c3);}else{if(_0x4a1635===_0x260e59(0x192))return Object[_0x260e59(0x1c5)](_0x4fb8c3)[_0x260e59(0x189)](([_0x594673,_0x3c88c7])=>_0x594673+'\x09'+_0x3c88c7)[_0x260e59(0x193)]('\x0a');else{const _0x4055ef=Object[_0x260e59(0x1c5)](_0x4fb8c3);if(_0x4055ef[_0x260e59(0x1a2)]===0x0)return _0x260e59(0x18f);const _0x3e2172=_0x4fb8c3['debug'],_0x441f44=_0x4fb8c3[_0x260e59(0x1ad)],_0x2f8ceb=_0x4fb8c3[_0x260e59(0x1ae)],_0x20c7c7=_0x4fb8c3[_0x260e59(0x1af)],_0x79f086=_0x441f44?typeof _0x441f44==='string'?_0x441f44:JSON['stringify'](_0x441f44,null,0x2):undefined,_0x2491ca=_0x2f8ceb&&Object[_0x260e59(0x1c0)](_0x2f8ceb)[_0x260e59(0x1a2)]>0x0?JSON['stringify'](_0x2f8ceb,null,0x2):undefined,_0x305586=_0x20c7c7&&Object[_0x260e59(0x1c0)](_0x20c7c7)['length']>0x0?JSON['stringify'](_0x20c7c7,null,0x2):undefined,_0x114783=_0x4055ef[_0x260e59(0x1b2)](([_0xed84d2])=>_0xed84d2!==_0x260e59(0x1bb)&&_0xed84d2!==_0x260e59(0x1ad)&&_0xed84d2!=='params'&&_0xed84d2!==_0x260e59(0x1af)),_0x5741d0=Math[_0x260e59(0x1aa)](..._0x114783[_0x260e59(0x189)](([_0x103857])=>_0x103857[_0x260e59(0x1a2)])),_0x4e4964=Math[_0x260e59(0x1aa)](..._0x114783[_0x260e59(0x189)](([,_0x2accf9])=>{const _0x2cf2ad=_0x260e59;try{const _0x50f2bb=_0x2accf9===null||_0x2accf9===undefined?'':typeof _0x2accf9==='object'?JSON['stringify'](_0x2accf9):String(_0x2accf9),_0x9d342c=_0x50f2bb[_0x2cf2ad(0x195)]('\x0a');return Math[_0x2cf2ad(0x1aa)](..._0x9d342c['map'](_0x477418=>_0x477418[_0x2cf2ad(0x1a2)]),0x0);}catch{return 0x0;}}),0x14),_0x2ceeb0=[];_0x2ceeb0[_0x260e59(0x1b9)](colorBorder('┌─'+'─'[_0x260e59(0x1b3)](_0x5741d0)+_0x260e59(0x191)+'─'[_0x260e59(0x1b3)](_0x4e4964)+'─┐',_0x4f461f)),_0x114783['forEach'](([_0x280caa,_0x2e44b7])=>{const _0x1923b8=_0x260e59;let _0x358313;try{_0x358313=_0x2e44b7===null||_0x2e44b7===undefined?'':typeof _0x2e44b7===_0x1923b8(0x19b)?JSON[_0x1923b8(0x1a6)](_0x2e44b7):String(_0x2e44b7);}catch{_0x358313='[Object]';}const _0x54a6be=_0x280caa['padEnd'](_0x5741d0),_0x3538ac=_0x358313[_0x1923b8(0x195)]('\x0a');_0x3538ac['forEach']((_0x359fd0,_0x218663)=>{const _0x3282f7=_0x1923b8,_0x17b7f9=colorBorder('│',_0x4f461f);_0x218663===0x0?_0x2ceeb0[_0x3282f7(0x1b9)](_0x17b7f9+'\x20'+_0x54a6be+'\x20'+_0x17b7f9+'\x20'+_0x359fd0[_0x3282f7(0x186)](_0x4e4964)+'\x20'+_0x17b7f9):_0x2ceeb0[_0x3282f7(0x1b9)](_0x17b7f9+'\x20'+'\x20'[_0x3282f7(0x1b3)](_0x5741d0)+'\x20'+_0x17b7f9+'\x20'+_0x359fd0[_0x3282f7(0x186)](_0x4e4964)+'\x20'+_0x17b7f9);});}),_0x2ceeb0[_0x260e59(0x1b9)](colorBorder('└─'+'─'[_0x260e59(0x1b3)](_0x5741d0)+_0x260e59(0x1b7)+'─'[_0x260e59(0x1b3)](_0x4e4964)+'─┘',_0x4f461f));_0x79f086&&(_0x2ceeb0[_0x260e59(0x1b9)](''),_0x2ceeb0[_0x260e59(0x1b9)](String(a40_0xfba5e4['yellow'][_0x260e59(0x1bf)](_0x260e59(0x19e)))),_0x2ceeb0['push'](_0x79f086));_0x2491ca&&(_0x2ceeb0[_0x260e59(0x1b9)](''),_0x2ceeb0['push'](String(a40_0xfba5e4[_0x260e59(0x1a8)][_0x260e59(0x1bf)](_0x260e59(0x184)))),_0x2ceeb0[_0x260e59(0x1b9)](_0x2491ca));_0x305586&&(_0x2ceeb0['push'](''),_0x2ceeb0['push'](String(a40_0xfba5e4[_0x260e59(0x1b1)][_0x260e59(0x1bf)](_0x260e59(0x1b5)))),_0x2ceeb0[_0x260e59(0x1b9)](_0x305586));if(_0x3e2172){if(_0x3e2172[_0x260e59(0x1c2)]){_0x2ceeb0['push'](''),_0x2ceeb0['push'](String(a40_0xfba5e4['red'][_0x260e59(0x1bf)](_0x260e59(0x1a9))));const _0x3d17b5=_0x3e2172[_0x260e59(0x1c2)][_0x260e59(0x195)]('\x0a');_0x3d17b5[_0x260e59(0x1a7)](_0x8ae640=>{const _0x7586e6=_0x260e59;_0x8ae640[_0x7586e6(0x197)]()&&_0x2ceeb0[_0x7586e6(0x1b9)](_0x8ae640);});}if(_0x3e2172[_0x260e59(0x1ac)]){_0x2ceeb0['push'](''),_0x2ceeb0['push'](String(a40_0xfba5e4[_0x260e59(0x1a3)][_0x260e59(0x1bf)](_0x260e59(0x1c4))));const _0x5ae845=_0x3e2172['cmdout'][_0x260e59(0x195)]('\x0a');_0x5ae845['forEach'](_0x190e70=>{const _0x2d3641=_0x260e59;_0x190e70[_0x2d3641(0x197)]()&&_0x2ceeb0[_0x2d3641(0x1b9)](_0x190e70);});}}return _0x2ceeb0['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x52e2b1,_0x1c355f){const _0x5d8bcf=a40_0x4a90;if(_0x1c355f[_0x5d8bcf(0x1ab)]==='table'){await handleSDKOutput([_0x52e2b1],_0x1c355f);return;}const _0x26c8e5=resolveOutputOptions(_0x1c355f),_0x4b88b1=await formatSingleObject(_0x52e2b1,_0x26c8e5);await writeOutput(_0x4b88b1,_0x26c8e5['output']||undefined,_0x26c8e5[_0x5d8bcf(0x1ab)]);}
|
|
1
|
+
function a40_0x407c(_0x18ab58,_0x6e9dcc){_0x18ab58=_0x18ab58-0xad;const _0x5b6125=a40_0x5b61();let _0x407c7b=_0x5b6125[_0x18ab58];return _0x407c7b;}(function(_0xe7e790,_0x4e5502){const _0x1c43a1=a40_0x407c,_0x37da2f=_0xe7e790();while(!![]){try{const _0x28f5bf=parseInt(_0x1c43a1(0xd5))/0x1*(-parseInt(_0x1c43a1(0xf0))/0x2)+-parseInt(_0x1c43a1(0xbe))/0x3*(parseInt(_0x1c43a1(0xef))/0x4)+-parseInt(_0x1c43a1(0xdd))/0x5*(parseInt(_0x1c43a1(0xe5))/0x6)+-parseInt(_0x1c43a1(0xcf))/0x7*(-parseInt(_0x1c43a1(0xe3))/0x8)+parseInt(_0x1c43a1(0xec))/0x9+parseInt(_0x1c43a1(0xd3))/0xa*(parseInt(_0x1c43a1(0xe4))/0xb)+-parseInt(_0x1c43a1(0xb2))/0xc*(-parseInt(_0x1c43a1(0xc5))/0xd);if(_0x28f5bf===_0x4e5502)break;else _0x37da2f['push'](_0x37da2f['shift']());}catch(_0x3fd95b){_0x37da2f['push'](_0x37da2f['shift']());}}}(a40_0x5b61,0xde944));import{writeFileSync}from'fs';function a40_0x5b61(){const _0x319f51=['output','stringify','number','[params]','push','21sEbXSU','list','map','string','15930xlPWRp','pipe','726RQqpgx','inherit','jsonl','rule','join','query','max','[error]','153430UvgdLV','[logs]','object','error','sdk-result','split','658264lgpiou','4015TxYmIB','318zmMIRB','trim','repeat','spawn','cyan','format','varchar','8010504OUndvd','keys','stderr','238600KHtMbt','4220tTNDLM','Results\x20saved\x20to\x20','close','limit','red','tsv','stdout','yellow','json','isTTY','color','params','12DgYYPo','[Object]','blue','table','end','write','resolve','noColor','[query]','forEach','boolean','bigint','6BjSUzP','log','-FXRSn','length','─┴─','padEnd','No\x20data','32121076PiGfOf','bold','double','stdin','entries'];a40_0x5b61=function(){return _0x319f51;};return a40_0x5b61();}import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a40_0x41e27c from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x18db10){const _0x5b9802=a40_0x407c;return _0x18db10['format']===_0x5b9802(0xae)||_0x18db10[_0x5b9802(0xea)]===_0x5b9802(0xd7)||_0x18db10['format']===_0x5b9802(0xf5)||_0x18db10['format']===_0x5b9802(0xb5)||_0x18db10[_0x5b9802(0xae)]===!![]||_0x18db10[_0x5b9802(0xd7)]===!![]||_0x18db10[_0x5b9802(0xf5)]===!![]||_0x18db10[_0x5b9802(0xb5)]===!![];}export function parseOutputOptions(_0x3453dc){const _0x19b43a=a40_0x407c;return{'format':_0x3453dc[_0x19b43a(0xea)]||_0x19b43a(0xb5),'output':_0x3453dc[_0x19b43a(0xca)]||'','limit':_0x3453dc[_0x19b43a(0xf3)],'color':_0x3453dc['color'],'noColor':_0x3453dc[_0x19b43a(0xb9)]};}function convertSDKResultToQueryResult(_0x5ea9ea){const _0x41d714=a40_0x407c,_0x34bd65=[];if(_0x5ea9ea['length']>0x0){const _0x3fde41=_0x5ea9ea[0x0];for(const [_0x1ec0d9,_0x171c64]of Object[_0x41d714(0xc9)](_0x3fde41)){let _0x2ac275=_0x41d714(0xeb);if(typeof _0x171c64===_0x41d714(0xcc))_0x2ac275=Number['isInteger'](_0x171c64)?_0x41d714(0xbd):_0x41d714(0xc7);else{if(typeof _0x171c64===_0x41d714(0xbc))_0x2ac275=_0x41d714(0xbc);else _0x171c64===null&&(_0x2ac275=_0x41d714(0xeb));}_0x34bd65['push']({'name':_0x1ec0d9,'type':_0x2ac275});}}return{'queryId':_0x41d714(0xe1),'columns':_0x34bd65,'data':_0x5ea9ea,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x5ea9ea['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x5a9d21,_0xbbe3e5){const _0x439b53=convertSDKResultToQueryResult(_0x5a9d21);return formatQueryOutput(_0x439b53,_0xbbe3e5);}export async function formatQueryOutput(_0x49df04,_0x5b46af){const _0x35019f=a40_0x407c,{format:_0x528127,limit:_0x5de5f9,output:_0xe225ef,color:_0x1c2118,noColor:_0x4cca22}=_0x5b46af,_0x458f01=Boolean(_0xe225ef)&&!_0x1c2118,_0x3a644b={'color':_0x1c2118,'noColor':_0x4cca22||_0x458f01};if(_0x528127==='table'){const _0x3328c4=shouldUseLess(_0x528127,_0xe225ef);return formatAsTable(_0x49df04,_0x5de5f9,_0x3328c4,_0x3a644b);}else{if(_0x528127===_0x35019f(0xae))return formatAsJSON(_0x49df04,_0x3a644b);else return _0x528127==='jsonl'?formatAsJSONL(_0x49df04,_0x3a644b):formatQueryResult(_0x49df04,_0x528127);}}function shouldUseLess(_0x4d9b8d,_0x104181){const _0x8f36a5=a40_0x407c;return(_0x4d9b8d===_0x8f36a5(0xb5)||_0x4d9b8d===_0x8f36a5(0xd0))&&process[_0x8f36a5(0xf6)][_0x8f36a5(0xaf)]&&!_0x104181;}export function resolveOutputOptions(_0x592e66){const _0x39a6c0=a40_0x407c,_0x3502b8=resolveOutputFormat(_0x592e66['format'],_0x592e66[_0x39a6c0(0xca)],_0x39a6c0(0xb5));let _0x115d00=typeof _0x592e66[_0x39a6c0(0xf3)]==='number'?_0x592e66[_0x39a6c0(0xf3)]:parseInt(_0x592e66[_0x39a6c0(0xf3)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x1dca09=_0x592e66[_0x39a6c0(0xca)]||'';return shouldUseLess(_0x3502b8,_0x1dca09)&&(_0x115d00=Infinity),{'format':_0x3502b8,'output':_0x1dca09,'limit':_0x115d00,'color':_0x592e66[_0x39a6c0(0xb0)],'noColor':_0x592e66[_0x39a6c0(0xb9)]};}export function writeOutput(_0x54dbc7,_0x2a36bb,_0x41c45e){const _0x336280=a40_0x407c;return _0x2a36bb?(writeFileSync(_0x2a36bb,_0x54dbc7),console[_0x336280(0xe0)](_0x336280(0xf1)+_0x2a36bb),Promise[_0x336280(0xb8)]()):shouldUseLess(_0x41c45e||'','')?new Promise(_0x10856e=>{const _0x475f55=_0x336280,_0x37ea47=spawn('less',[_0x475f55(0xc0)],{'stdio':[_0x475f55(0xd4),_0x475f55(0xd6),_0x475f55(0xd6)]});let _0x23341e=![];_0x37ea47['on'](_0x475f55(0xe0),()=>{const _0x5afa09=_0x475f55;!_0x23341e&&(_0x23341e=!![],console[_0x5afa09(0xbf)](_0x54dbc7),_0x10856e());}),_0x37ea47['on'](_0x475f55(0xf2),()=>{!_0x23341e&&(_0x23341e=!![],_0x10856e());}),_0x37ea47['on'](_0x475f55(0xe8),()=>{const _0x4c3d6e=_0x475f55;!_0x23341e&&_0x37ea47[_0x4c3d6e(0xc8)]&&(_0x37ea47[_0x4c3d6e(0xc8)]['on']('error',()=>{}),_0x37ea47[_0x4c3d6e(0xc8)][_0x4c3d6e(0xb7)](_0x54dbc7),_0x37ea47[_0x4c3d6e(0xc8)][_0x4c3d6e(0xb6)]());}),!_0x37ea47['stdin']&&(!_0x23341e&&(_0x23341e=!![],console['log'](_0x54dbc7),_0x10856e()));}):(console[_0x336280(0xbf)](_0x54dbc7),Promise[_0x336280(0xb8)]());}export async function handleSDKOutput(_0x103eef,_0x2fc621){const _0x5e31a1=a40_0x407c,_0xa19f2d=resolveOutputOptions(_0x2fc621),_0x40196e=await formatSDKOutput(_0x103eef,_0xa19f2d);await writeOutput(_0x40196e,_0xa19f2d[_0x5e31a1(0xca)]||undefined,_0xa19f2d[_0x5e31a1(0xea)]);}export async function handleQueryOutput(_0x439ead,_0x456fc1){const _0x9ea19=a40_0x407c,_0x44f809=resolveOutputOptions(_0x456fc1),_0x5adda6=await formatQueryOutput(_0x439ead,_0x44f809);await writeOutput(_0x5adda6,_0x44f809[_0x9ea19(0xca)]||undefined,_0x44f809[_0x9ea19(0xea)]);}async function formatSingleObject(_0x5e4ab5,_0x26aaca){const _0xad58dd=a40_0x407c,{format:_0x1a0fc4,color:_0x54505d,noColor:_0xf013d0}=_0x26aaca,_0x2a3043={'color':_0x54505d,'noColor':_0xf013d0};if(_0x1a0fc4===_0xad58dd(0xae)){if(shouldUseColor(_0x2a3043))return colorizeJSON(_0x5e4ab5,_0x2a3043);return JSON[_0xad58dd(0xcb)](_0x5e4ab5,null,0x2);}else{if(_0x1a0fc4==='jsonl'){if(shouldUseColor(_0x2a3043))return colorizeJSONCompact(_0x5e4ab5,_0x2a3043);return JSON[_0xad58dd(0xcb)](_0x5e4ab5);}else{if(_0x1a0fc4==='tsv')return Object['entries'](_0x5e4ab5)[_0xad58dd(0xd1)](([_0x2096a8,_0x58a134])=>_0x2096a8+'\x09'+_0x58a134)['join']('\x0a');else{const _0x513d4a=Object[_0xad58dd(0xc9)](_0x5e4ab5);if(_0x513d4a[_0xad58dd(0xc1)]===0x0)return _0xad58dd(0xc4);const _0x110522=_0x5e4ab5['debug'],_0x1c062c=_0x5e4ab5[_0xad58dd(0xda)],_0x205ce3=_0x5e4ab5[_0xad58dd(0xb1)],_0x14646a=_0x5e4ab5[_0xad58dd(0xd8)],_0x27dae1=_0x1c062c?typeof _0x1c062c===_0xad58dd(0xd2)?_0x1c062c:JSON[_0xad58dd(0xcb)](_0x1c062c,null,0x2):undefined,_0x13f4c3=_0x205ce3&&Object['keys'](_0x205ce3)['length']>0x0?JSON[_0xad58dd(0xcb)](_0x205ce3,null,0x2):undefined,_0x4282d5=_0x14646a&&Object[_0xad58dd(0xed)](_0x14646a)[_0xad58dd(0xc1)]>0x0?JSON['stringify'](_0x14646a,null,0x2):undefined,_0x4ed27e=_0x513d4a['filter'](([_0x3b1057])=>_0x3b1057!=='debug'&&_0x3b1057!==_0xad58dd(0xda)&&_0x3b1057!=='params'&&_0x3b1057!==_0xad58dd(0xd8)),_0x2a6664=Math['max'](..._0x4ed27e['map'](([_0x4c0fe0])=>_0x4c0fe0[_0xad58dd(0xc1)])),_0x4b4d96=Math[_0xad58dd(0xdb)](..._0x4ed27e[_0xad58dd(0xd1)](([,_0xa37591])=>{const _0x459039=_0xad58dd;try{const _0x1617fb=_0xa37591===null||_0xa37591===undefined?'':typeof _0xa37591===_0x459039(0xdf)?JSON[_0x459039(0xcb)](_0xa37591):String(_0xa37591),_0x546e3a=_0x1617fb[_0x459039(0xe2)]('\x0a');return Math[_0x459039(0xdb)](..._0x546e3a['map'](_0x3dfe6f=>_0x3dfe6f[_0x459039(0xc1)]),0x0);}catch{return 0x0;}}),0x14),_0x4d3ba8=[];_0x4d3ba8[_0xad58dd(0xce)](colorBorder('┌─'+'─'[_0xad58dd(0xe7)](_0x2a6664)+'─┬─'+'─'['repeat'](_0x4b4d96)+'─┐',_0x2a3043)),_0x4ed27e[_0xad58dd(0xbb)](([_0x4c8e56,_0x24f1d3])=>{const _0x3b3c5b=_0xad58dd;let _0x3002b4;try{_0x3002b4=_0x24f1d3===null||_0x24f1d3===undefined?'':typeof _0x24f1d3===_0x3b3c5b(0xdf)?JSON[_0x3b3c5b(0xcb)](_0x24f1d3):String(_0x24f1d3);}catch{_0x3002b4=_0x3b3c5b(0xb3);}const _0x234d1c=_0x4c8e56['padEnd'](_0x2a6664),_0x265dbd=_0x3002b4['split']('\x0a');_0x265dbd[_0x3b3c5b(0xbb)]((_0x4b6673,_0x34508b)=>{const _0x19f087=_0x3b3c5b,_0x1720ba=colorBorder('│',_0x2a3043);_0x34508b===0x0?_0x4d3ba8[_0x19f087(0xce)](_0x1720ba+'\x20'+_0x234d1c+'\x20'+_0x1720ba+'\x20'+_0x4b6673[_0x19f087(0xc3)](_0x4b4d96)+'\x20'+_0x1720ba):_0x4d3ba8[_0x19f087(0xce)](_0x1720ba+'\x20'+'\x20'['repeat'](_0x2a6664)+'\x20'+_0x1720ba+'\x20'+_0x4b6673[_0x19f087(0xc3)](_0x4b4d96)+'\x20'+_0x1720ba);});}),_0x4d3ba8['push'](colorBorder('└─'+'─'['repeat'](_0x2a6664)+_0xad58dd(0xc2)+'─'[_0xad58dd(0xe7)](_0x4b4d96)+'─┘',_0x2a3043));_0x27dae1&&(_0x4d3ba8[_0xad58dd(0xce)](''),_0x4d3ba8[_0xad58dd(0xce)](String(a40_0x41e27c[_0xad58dd(0xad)][_0xad58dd(0xc6)](_0xad58dd(0xba)))),_0x4d3ba8[_0xad58dd(0xce)](_0x27dae1));_0x13f4c3&&(_0x4d3ba8[_0xad58dd(0xce)](''),_0x4d3ba8[_0xad58dd(0xce)](String(a40_0x41e27c[_0xad58dd(0xb4)]['bold'](_0xad58dd(0xcd)))),_0x4d3ba8[_0xad58dd(0xce)](_0x13f4c3));_0x4282d5&&(_0x4d3ba8[_0xad58dd(0xce)](''),_0x4d3ba8[_0xad58dd(0xce)](String(a40_0x41e27c['magenta']['bold']('[rule]'))),_0x4d3ba8['push'](_0x4282d5));if(_0x110522){if(_0x110522[_0xad58dd(0xee)]){_0x4d3ba8[_0xad58dd(0xce)](''),_0x4d3ba8[_0xad58dd(0xce)](String(a40_0x41e27c[_0xad58dd(0xf4)][_0xad58dd(0xc6)](_0xad58dd(0xdc))));const _0x3c312c=_0x110522['stderr'][_0xad58dd(0xe2)]('\x0a');_0x3c312c['forEach'](_0x1c031c=>{const _0x21c85c=_0xad58dd;_0x1c031c[_0x21c85c(0xe6)]()&&_0x4d3ba8[_0x21c85c(0xce)](_0x1c031c);});}if(_0x110522['cmdout']){_0x4d3ba8[_0xad58dd(0xce)](''),_0x4d3ba8[_0xad58dd(0xce)](String(a40_0x41e27c[_0xad58dd(0xe9)][_0xad58dd(0xc6)](_0xad58dd(0xde))));const _0x13240c=_0x110522['cmdout'][_0xad58dd(0xe2)]('\x0a');_0x13240c[_0xad58dd(0xbb)](_0x3c0dc5=>{const _0x3046c0=_0xad58dd;_0x3c0dc5['trim']()&&_0x4d3ba8[_0x3046c0(0xce)](_0x3c0dc5);});}}return _0x4d3ba8[_0xad58dd(0xd9)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x234046,_0x280f39){const _0x4df5a6=a40_0x407c;if(_0x280f39[_0x4df5a6(0xea)]===_0x4df5a6(0xb5)){await handleSDKOutput([_0x234046],_0x280f39);return;}const _0x497a95=resolveOutputOptions(_0x280f39),_0x138110=await formatSingleObject(_0x234046,_0x497a95);await writeOutput(_0x138110,_0x497a95[_0x4df5a6(0xca)]||undefined,_0x497a95[_0x4df5a6(0xea)]);}
|
package/dist/core/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4d01ec,_0x4b576f){const _0x47def2=a41_0x40c2,_0x272ea7=_0x4d01ec();while(!![]){try{const _0x27f0cc=-parseInt(_0x47def2(0xf2))/0x1+-parseInt(_0x47def2(0xf3))/0x2+parseInt(_0x47def2(0xe6))/0x3+parseInt(_0x47def2(0xe0))/0x4*(parseInt(_0x47def2(0xb4))/0x5)+parseInt(_0x47def2(0xd2))/0x6+parseInt(_0x47def2(0xe7))/0x7*(parseInt(_0x47def2(0xe1))/0x8)+-parseInt(_0x47def2(0xcc))/0x9;if(_0x27f0cc===_0x4b576f)break;else _0x272ea7['push'](_0x272ea7['shift']());}catch(_0x423f2b){_0x272ea7['push'](_0x272ea7['shift']());}}}(a41_0x1edb,0x9a5f5));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a41_0x304a86 from'node:fs';function a41_0x1edb(){const _0x194a9c=['TDX_CONFIG_DIR','\x27,\x20defaulting\x20to\x20us01','llm_default_project','1860918wBXfdD','250663ElzOvy','llm_default_agent','keychain\x20(profile:\x20','parse','stg-jp01','source','split','ap02','eu01','existsSync','\x20env\x20var','650952HXnimG','1401726OobPGi','stg-ap03','trim','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','endsWith','env','profile','tdx','apiKey','ap03','name','site','dev-eu01','us01','.env.','legacy\x20.env\x20file\x20(profile:\x20','includes','slice','apiKeys','profiles','5coTpFt','yellow','.cache','utf-8','number','match','TD_API_KEY_','map','.json','Warning:\x20Failed\x20to\x20read\x20','TD_API_KEY\x20env\x20var\x20(deprecated)','stringify','toUpperCase','TDX_API_KEY','filter','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','Warning:\x20Unknown\x20site\x20\x27','accountId','account_info.','readFileSync','legacy\x20.env\x20file','llm_default_project.','TDX_API_KEY_','account_info.json','8091675xMSzyY','warn','toISOString','string','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','isDeprecated','6872202uECaaN','keychain','.config','replace','TD_API_KEY','projectId','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','entries','jp01','startsWith','TDX_CACHE_DIR','tdx.json','dev-us01','join','602732PuqaYg','216DWaKlx','stg-us01'];a41_0x1edb=function(){return _0x194a9c;};return a41_0x1edb();}import*as a41_0x54d3b4 from'node:path';import{SITE_ALIASES}from'../sdk/types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a41_0x45e16c from'chalk';export function getConfigDir(){const _0x480393=a41_0x40c2;return process[_0x480393(0xf8)][_0x480393(0xe3)]||join(homedir(),_0x480393(0xd4),_0x480393(0xfa));}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getConfigFilePath(_0x4549f5){const _0x4e8d8e=a41_0x40c2,_0x16c12b=getConfigDir();return _0x4549f5?a41_0x54d3b4['join'](_0x16c12b,_0x4e8d8e(0xae)+_0x4549f5):getConfigFile();}export function getCacheDir(){const _0x42ba1f=a41_0x40c2;return process[_0x42ba1f(0xf8)][_0x42ba1f(0xdc)]||join(homedir(),_0x42ba1f(0xb6),_0x42ba1f(0xfa));}export function getLLMProjectCacheFile(_0x31c991){const _0x204a6f=a41_0x40c2,_0x1d9118=_0x31c991?_0x204a6f(0xc9)+_0x31c991:_0x204a6f(0xe5);return join(getCacheDir(),_0x1d9118);}export function readCachedLLMProject(_0x8098){const _0xdab947=a41_0x40c2;try{const _0x184fc6=getLLMProjectCacheFile(_0x8098);if(!existsSync(_0x184fc6))return null;const _0x7ce120=readFileSync(_0x184fc6,_0xdab947(0xb7))[_0xdab947(0xf5)]();try{const _0x8c54a6=JSON['parse'](_0x7ce120);if(_0x8c54a6&&typeof _0x8c54a6['id']==='string'&&typeof _0x8c54a6['name']===_0xdab947(0xcf))return _0x8c54a6;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x5cdd83,_0x178c81,_0x2647c1){const _0x38fc84=a41_0x40c2;try{const _0x134921=getCacheDir(),_0xa8b8e5=getLLMProjectCacheFile(_0x2647c1);!existsSync(_0x134921)&&mkdirSync(_0x134921,{'recursive':!![]});const _0x488593={'name':_0x5cdd83,'id':_0x178c81};writeFileSync(_0xa8b8e5,JSON['stringify'](_0x488593),_0x38fc84(0xb7));}catch{}}export function getLLMAgentCacheFile(_0x2352b6){const _0x59ff9b=a41_0x40c2,_0x1abcec=_0x2352b6?'llm_default_agent.'+_0x2352b6:_0x59ff9b(0xe8);return join(getCacheDir(),_0x1abcec);}function a41_0x40c2(_0x133084,_0x3019e3){_0x133084=_0x133084-0xad;const _0x1edb36=a41_0x1edb();let _0x40c2fe=_0x1edb36[_0x133084];return _0x40c2fe;}export function readCachedLLMAgent(_0x56f3a2){const _0x157b0a=a41_0x40c2;try{const _0x578a3c=getLLMAgentCacheFile(_0x56f3a2);if(!existsSync(_0x578a3c))return null;const _0x5ca322=readFileSync(_0x578a3c,_0x157b0a(0xb7))[_0x157b0a(0xf5)]();try{const _0x2d3b19=JSON[_0x157b0a(0xea)](_0x5ca322);if(_0x2d3b19&&typeof _0x2d3b19['id']===_0x157b0a(0xcf)&&typeof _0x2d3b19[_0x157b0a(0xfd)]===_0x157b0a(0xcf)&&typeof _0x2d3b19[_0x157b0a(0xd7)]===_0x157b0a(0xcf))return _0x2d3b19;}catch{}return null;}catch{return null;}}export function writeCachedLLMAgent(_0x44756d,_0x42399c,_0x1e9dbb,_0x2e9052){const _0x582dbf=a41_0x40c2;try{const _0x2d99cb=getCacheDir(),_0x533826=getLLMAgentCacheFile(_0x2e9052);!existsSync(_0x2d99cb)&&mkdirSync(_0x2d99cb,{'recursive':!![]});const _0x143034={'name':_0x44756d,'id':_0x42399c,'projectId':_0x1e9dbb};writeFileSync(_0x533826,JSON['stringify'](_0x143034),_0x582dbf(0xb7));}catch{}}export function clearCachedLLMAgent(_0xc1e889){try{const _0x1ff9d6=getLLMAgentCacheFile(_0xc1e889);existsSync(_0x1ff9d6)&&unlinkSync(_0x1ff9d6);}catch{}}export function getAccountInfoCacheFile(_0x577a26){const _0x288fd3=a41_0x40c2,_0x415d83=_0x577a26?_0x288fd3(0xc6)+_0x577a26+_0x288fd3(0xbc):_0x288fd3(0xcb);return join(getCacheDir(),_0x415d83);}export function readCachedAccountInfo(_0x51672f){const _0x302444=a41_0x40c2;try{const _0x8fd14c=getAccountInfoCacheFile(_0x51672f);if(!existsSync(_0x8fd14c))return null;const _0x49a298=readFileSync(_0x8fd14c,_0x302444(0xb7))[_0x302444(0xf5)](),_0x4cd240=JSON[_0x302444(0xea)](_0x49a298);if(_0x4cd240&&typeof _0x4cd240[_0x302444(0xfe)]===_0x302444(0xcf)&&typeof _0x4cd240[_0x302444(0xc5)]===_0x302444(0xb8))return _0x4cd240;return null;}catch{return null;}}export function writeCachedAccountInfo(_0xc51068,_0x444bc3,_0x3464ae){const _0x13a3a5=a41_0x40c2;try{const _0x468eed=getCacheDir(),_0x4793fa=getAccountInfoCacheFile(_0x3464ae);!existsSync(_0x468eed)&&mkdirSync(_0x468eed,{'recursive':!![]});const _0x2b911d={'site':_0xc51068,'accountId':_0x444bc3,'cachedAt':new Date()[_0x13a3a5(0xce)]()};writeFileSync(_0x4793fa,JSON[_0x13a3a5(0xbf)](_0x2b911d),_0x13a3a5(0xb7));}catch{}}export function parseEnvFile(_0x2953ef){const _0x3249ea=a41_0x40c2,_0x16e9e2={};for(const _0xce8aa1 of _0x2953ef['split']('\x0a')){const _0xf37902=_0xce8aa1[_0x3249ea(0xf5)]();if(!_0xf37902||_0xf37902[_0x3249ea(0xdb)]('#'))continue;const _0x20edbc=_0xf37902[_0x3249ea(0xb9)](/^([^=]+)=(.*)$/);if(_0x20edbc){const _0x58496d=_0x20edbc[0x1][_0x3249ea(0xf5)]();let _0x438a58=_0x20edbc[0x2][_0x3249ea(0xf5)]();(_0x438a58[_0x3249ea(0xdb)]('\x22')&&_0x438a58[_0x3249ea(0xf7)]('\x22')||_0x438a58[_0x3249ea(0xdb)]('\x27')&&_0x438a58[_0x3249ea(0xf7)]('\x27'))&&(_0x438a58=_0x438a58[_0x3249ea(0xb1)](0x1,-0x1)),_0x16e9e2[_0x58496d]=_0x438a58;}}return _0x16e9e2;}export function readUserConfig(){const _0x1e1eaa=a41_0x40c2,_0x5deb04=getConfigFile();if(!existsSync(_0x5deb04))return{};try{const _0x636f37=readFileSync(_0x5deb04,_0x1e1eaa(0xb7));return parseEnvFile(_0x636f37);}catch(_0x2232ea){return console[_0x1e1eaa(0xcd)](_0x1e1eaa(0xd8)+_0x5deb04+':',_0x2232ea),{};}}export function resolveSite(_0x553248){const _0x454c74=a41_0x40c2,_0x13667a=[_0x454c74(0xad),'jp01',_0x454c74(0xef),'ap02',_0x454c74(0xfc),_0x454c74(0xde),_0x454c74(0xff),_0x454c74(0xe2),'stg-jp01',_0x454c74(0xf4)];if(_0x13667a[_0x454c74(0xb0)](_0x553248))return _0x553248;if(_0x553248 in SITE_ALIASES)return SITE_ALIASES[_0x553248];return console[_0x454c74(0xcd)](_0x454c74(0xc4)+_0x553248+_0x454c74(0xe4)),_0x454c74(0xad);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x123ccd,_0x172be3){const _0x54ec04=a41_0x40c2,_0x1b4d79=_0x172be3||getActiveProfileName();if(_0x1b4d79){const _0x4a2348=_0x54ec04(0xca)+normalizeProfileForEnvVar(_0x1b4d79);if(process['env'][_0x4a2348])return process['env'][_0x4a2348];}if(process['env'][_0x54ec04(0xc1)])return process['env'][_0x54ec04(0xc1)];if(process['env'][_0x54ec04(0xd6)])return process[_0x54ec04(0xf8)][_0x54ec04(0xd6)];const _0x2fcc56=_0x123ccd[_0x54ec04(0xc0)]()[_0x54ec04(0xd5)](/-/g,'_'),_0x5a82be='TD_API_KEY_'+_0x2fcc56;if(_0x1b4d79){const _0xe6e73f=loadProfileEnv(_0x1b4d79);if(_0xe6e73f){if(_0xe6e73f[_0x5a82be])return _0xe6e73f[_0x5a82be];if(_0xe6e73f[_0x54ec04(0xd6)])return _0xe6e73f['TD_API_KEY'];}}const _0x428eb4=loadUserConfigOnce();if(_0x428eb4[_0x5a82be])return _0x428eb4[_0x5a82be];if(_0x428eb4[_0x54ec04(0xd6)])return _0x428eb4['TD_API_KEY'];return undefined;}export function normalizeProfileForEnvVar(_0x3d6ed1){const _0x5c5ec2=a41_0x40c2;return _0x3d6ed1[_0x5c5ec2(0xc0)]()[_0x5c5ec2(0xd5)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x412488,_0x39df9e){const _0x3dff46=a41_0x40c2,_0xf47fc9=_0x39df9e||getActiveProfileName()||undefined;if(_0xf47fc9){const _0x3edc2c=_0x3dff46(0xca)+normalizeProfileForEnvVar(_0xf47fc9);if(process[_0x3dff46(0xf8)][_0x3edc2c])return{'apiKey':process[_0x3dff46(0xf8)][_0x3edc2c],'source':_0x3edc2c+_0x3dff46(0xf1),'isDeprecated':![]};const _0x263a96=getCachedCredential(_0x412488,_0xf47fc9);if(_0x263a96)return{'apiKey':_0x263a96,'source':_0x3dff46(0xe9)+_0xf47fc9+')','isDeprecated':![]};const _0x211a4f=await getKeychainAPIKey(_0xf47fc9);if(_0x211a4f)return setCachedCredential(_0x211a4f,_0x412488,_0xf47fc9),{'apiKey':_0x211a4f,'source':_0x3dff46(0xe9)+_0xf47fc9+')','isDeprecated':![]};}if(process['env'][_0x3dff46(0xc1)])return{'apiKey':process[_0x3dff46(0xf8)]['TDX_API_KEY'],'source':'TDX_API_KEY\x20env\x20var','isDeprecated':![]};if(!_0xf47fc9){const _0x310776=getCachedCredential(_0x412488,undefined);if(_0x310776)return{'apiKey':_0x310776,'source':_0x3dff46(0xd3),'isDeprecated':![]};const _0x433bc3=await getKeychainAPIKey(undefined);if(_0x433bc3)return setCachedCredential(_0x433bc3,_0x412488,undefined),{'apiKey':_0x433bc3,'source':_0x3dff46(0xd3),'isDeprecated':![]};}if(process[_0x3dff46(0xf8)]['TD_API_KEY'])return{'apiKey':process[_0x3dff46(0xf8)][_0x3dff46(0xd6)],'source':_0x3dff46(0xbe),'isDeprecated':!![]};const _0x109fb4=getLegacyEnvAPIKey(_0x412488,_0xf47fc9);if(_0x109fb4){const _0x371e3c=await isKeychainAvailable();if(_0x371e3c)try{await saveKeychainAPIKey(_0x109fb4,_0xf47fc9),setCachedCredential(_0x109fb4,_0x412488,_0xf47fc9);const _0x386aee=getConfigFilePath(_0xf47fc9);cleanupLegacyEnvFile(_0x386aee)&&console['warn'](a41_0x45e16c[_0x3dff46(0xb5)](_0x3dff46(0xf6)));}catch(_0x2e85f8){console[_0x3dff46(0xcd)](a41_0x45e16c[_0x3dff46(0xb5)](_0x3dff46(0xc3)+_0x2e85f8));}const _0x381ad0=_0xf47fc9?_0x3dff46(0xaf)+_0xf47fc9+')':_0x3dff46(0xc8);return{'apiKey':_0x109fb4,'source':_0x381ad0,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x2118b1,_0x1932f2,_0x41c725=!![]){const _0x4dbc5d=a41_0x40c2,_0x801354=await resolveAPIKeyAsync(_0x2118b1,_0x1932f2);if(!_0x801354)return undefined;if(_0x41c725&&_0x801354[_0x4dbc5d(0xd1)]&&_0x801354[_0x4dbc5d(0xec)][_0x4dbc5d(0xb0)](_0x4dbc5d(0xd6))){const _0x585ac9=_0x1932f2||getActiveProfileName()||undefined,_0x5dd2cd=_0x585ac9?_0x4dbc5d(0xca)+normalizeProfileForEnvVar(_0x585ac9):'TDX_API_KEY_<PROFILE>';console[_0x4dbc5d(0xcd)](a41_0x45e16c[_0x4dbc5d(0xb5)](_0x4dbc5d(0xd0)+('\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20'+_0x5dd2cd+').')));}return _0x801354[_0x4dbc5d(0xfb)];}function getLegacyEnvAPIKey(_0xfaffa9,_0x54ffbc){const _0x30cb1d=a41_0x40c2,_0xcbe187=_0xfaffa9[_0x30cb1d(0xc0)]()[_0x30cb1d(0xd5)](/-/g,'_'),_0x5054e7=_0x30cb1d(0xba)+_0xcbe187;if(_0x54ffbc){const _0xc95f2d=loadProfileEnv(_0x54ffbc);if(_0xc95f2d){if(_0xc95f2d[_0x5054e7])return _0xc95f2d[_0x5054e7];if(_0xc95f2d['TD_API_KEY'])return _0xc95f2d[_0x30cb1d(0xd6)];}}const _0x385e05=loadUserConfigOnce();if(_0x385e05[_0x5054e7])return _0x385e05[_0x5054e7];if(_0x385e05[_0x30cb1d(0xd6)])return _0x385e05[_0x30cb1d(0xd6)];return undefined;}function cleanupLegacyEnvFile(_0xe9d13d){const _0x109a53=a41_0x40c2;if(!existsSync(_0xe9d13d))return![];try{const _0xc8501d=readFileSync(_0xe9d13d,_0x109a53(0xb7)),_0x484649=_0xc8501d[_0x109a53(0xed)]('\x0a'),_0x7aae03=_0x484649[_0x109a53(0xc2)](_0x2e2fd8=>{const _0x284b29=_0x109a53,_0x59915c=_0x2e2fd8[_0x284b29(0xf5)]();if(!_0x59915c||_0x59915c[_0x284b29(0xdb)]('#'))return!![];const [_0x45d72c]=_0x59915c[_0x284b29(0xed)]('=');return!_0x45d72c['startsWith'](_0x284b29(0xd6));}),_0x58adc8=_0x7aae03['some'](_0x4e6c53=>{const _0xe9cbc=_0x109a53,_0x543fd7=_0x4e6c53[_0xe9cbc(0xf5)]();return _0x543fd7&&!_0x543fd7[_0xe9cbc(0xdb)]('#');});if(!_0x58adc8)return unlinkSync(_0xe9d13d),!![];return writeFileSync(_0xe9d13d,_0x7aae03[_0x109a53(0xdf)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x2b706e){const _0x4dcb96=a41_0x40c2,_0x383eec=a41_0x54d3b4[_0x4dcb96(0xdf)](getConfigDir(),_0x4dcb96(0xae)+_0x2b706e);if(a41_0x304a86[_0x4dcb96(0xf0)](_0x383eec)){validateSecureFilePermissions(_0x383eec);try{const _0x1720a9=a41_0x304a86[_0x4dcb96(0xc7)](_0x383eec,_0x4dcb96(0xb7));return parseEnvFile(_0x1720a9);}catch(_0x3c029d){console[_0x4dcb96(0xcd)]('Warning:\x20Failed\x20to\x20load\x20'+_0x383eec+':\x20'+_0x3c029d);}}const _0xf5aa84=a41_0x54d3b4[_0x4dcb96(0xdf)](getConfigDir(),_0x4dcb96(0xb3),_0x2b706e,'.env');if(a41_0x304a86[_0x4dcb96(0xf0)](_0xf5aa84)){validateSecureFilePermissions(_0xf5aa84);try{const _0x1231e0=a41_0x304a86[_0x4dcb96(0xc7)](_0xf5aa84,_0x4dcb96(0xb7));return parseEnvFile(_0x1231e0);}catch(_0x24f770){return console[_0x4dcb96(0xcd)]('Warning:\x20Failed\x20to\x20load\x20'+_0xf5aa84+':\x20'+_0x24f770),null;}}return null;}function getActiveProfileName(){const _0x38d401=a41_0x40c2,_0x518db6=a41_0x54d3b4['join'](getConfigDir(),_0x38d401(0xdd));if(!a41_0x304a86[_0x38d401(0xf0)](_0x518db6))return null;try{const _0x4a20eb=a41_0x304a86[_0x38d401(0xc7)](_0x518db6,'utf-8'),_0x1fcb7d=JSON['parse'](_0x4a20eb);return _0x1fcb7d[_0x38d401(0xf9)]||null;}catch{return null;}}export function saveAPIKey(_0x294658,_0x3e80de,_0x4f1d13){const _0x3333ec=a41_0x40c2,_0x2306eb=getConfigDir(),_0x22148e=getConfigFilePath(_0x4f1d13);!existsSync(_0x2306eb)&&mkdirSync(_0x2306eb,{'recursive':!![],'mode':0x1c0});let _0x387487={};if(existsSync(_0x22148e))try{const _0x5a6fbd=readFileSync(_0x22148e,_0x3333ec(0xb7));_0x387487=parseEnvFile(_0x5a6fbd);}catch(_0x239d43){console[_0x3333ec(0xcd)](_0x3333ec(0xbd)+_0x22148e+':',_0x239d43);}const _0x2c1bbd=_0x294658[_0x3333ec(0xc0)]()['replace'](/-/g,'_');_0x387487['TD_API_KEY_'+_0x2c1bbd]=_0x3e80de;const _0x2b1fe8=Object[_0x3333ec(0xd9)](_0x387487)[_0x3333ec(0xbb)](([_0x5a1d70,_0x32d143])=>_0x5a1d70+'='+_0x32d143);writeFileSync(_0x22148e,_0x2b1fe8[_0x3333ec(0xdf)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x1d6571,_0x2c3ad6,_0x561d36){const _0x46db06=a41_0x40c2;await saveKeychainAPIKey(_0x1d6571,_0x561d36),setCachedCredential(_0x1d6571,_0x2c3ad6,_0x561d36);const _0x272869=getConfigFilePath(_0x561d36);cleanupLegacyEnvFile(_0x272869)&&console[_0x46db06(0xcd)](a41_0x45e16c[_0x46db06(0xb5)]('⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file'));}export function loadConfig(){const _0x5bf4f1=a41_0x40c2,_0x313582={'apiKeys':{},'defaultSite':_0x5bf4f1(0xad)},_0x491a29=['us01',_0x5bf4f1(0xda),'eu01',_0x5bf4f1(0xee),_0x5bf4f1(0xfc),_0x5bf4f1(0xde),_0x5bf4f1(0xff),_0x5bf4f1(0xe2),_0x5bf4f1(0xeb),_0x5bf4f1(0xf4)];for(const _0x523fcb of _0x491a29){const _0x5de419=getAPIKey(_0x523fcb);_0x5de419&&(_0x313582[_0x5bf4f1(0xb2)][_0x523fcb]=_0x5de419);}return _0x313582;}
|
|
1
|
+
(function(_0x3f13f0,_0x2a8057){const _0x1de0f3=a41_0x16cd,_0x446e37=_0x3f13f0();while(!![]){try{const _0x2cc91e=-parseInt(_0x1de0f3(0x11e))/0x1+parseInt(_0x1de0f3(0x10f))/0x2*(parseInt(_0x1de0f3(0x149))/0x3)+parseInt(_0x1de0f3(0x134))/0x4*(parseInt(_0x1de0f3(0x115))/0x5)+-parseInt(_0x1de0f3(0x152))/0x6*(-parseInt(_0x1de0f3(0x112))/0x7)+-parseInt(_0x1de0f3(0x145))/0x8+-parseInt(_0x1de0f3(0x123))/0x9*(-parseInt(_0x1de0f3(0x143))/0xa)+parseInt(_0x1de0f3(0x10e))/0xb*(-parseInt(_0x1de0f3(0x127))/0xc);if(_0x2cc91e===_0x2a8057)break;else _0x446e37['push'](_0x446e37['shift']());}catch(_0x24af1b){_0x446e37['push'](_0x446e37['shift']());}}}(a41_0x45dd,0xbfcac));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a41_0x1a1941 from'node:fs';import*as a41_0x33e51b from'node:path';import{SITE_ALIASES}from'../sdk/types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a41_0x5889d3 from'chalk';export function getConfigDir(){const _0x37d604=a41_0x16cd;return process['env'][_0x37d604(0x124)]||join(homedir(),_0x37d604(0x136),_0x37d604(0x131));}export function getConfigFile(){const _0xab4258=a41_0x16cd;return join(getConfigDir(),_0xab4258(0x138));}export function getConfigFilePath(_0x4456d3){const _0x2e30b0=a41_0x16cd,_0x5a5eb3=getConfigDir();return _0x4456d3?a41_0x33e51b[_0x2e30b0(0x114)](_0x5a5eb3,_0x2e30b0(0x155)+_0x4456d3):getConfigFile();}export function getCacheDir(){const _0x372168=a41_0x16cd;return process[_0x372168(0x154)]['TDX_CACHE_DIR']||join(homedir(),'.cache','tdx');}export function getLLMProjectCacheFile(_0x37420b){const _0x53ed37=a41_0x16cd,_0x28b892=_0x37420b?'llm_default_project.'+_0x37420b:_0x53ed37(0x144);return join(getCacheDir(),_0x28b892);}export function readCachedLLMProject(_0x96a452){const _0x3424e4=a41_0x16cd;try{const _0x1386dc=getLLMProjectCacheFile(_0x96a452);if(!existsSync(_0x1386dc))return null;const _0x11b2fd=readFileSync(_0x1386dc,_0x3424e4(0x12d))[_0x3424e4(0x158)]();try{const _0x31b091=JSON['parse'](_0x11b2fd);if(_0x31b091&&typeof _0x31b091['id']===_0x3424e4(0x13c)&&typeof _0x31b091[_0x3424e4(0x11a)]==='string')return _0x31b091;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x131960,_0x280a3d,_0x1fee0b){try{const _0x3acbf9=getCacheDir(),_0x19f951=getLLMProjectCacheFile(_0x1fee0b);!existsSync(_0x3acbf9)&&mkdirSync(_0x3acbf9,{'recursive':!![]});const _0x978055={'name':_0x131960,'id':_0x280a3d};writeFileSync(_0x19f951,JSON['stringify'](_0x978055),'utf-8');}catch{}}export function getLLMAgentCacheFile(_0x52cb44){const _0x6fb33e=a41_0x16cd,_0x445d0e=_0x52cb44?_0x6fb33e(0x12e)+_0x52cb44:'llm_default_agent';return join(getCacheDir(),_0x445d0e);}export function readCachedLLMAgent(_0x573348){const _0x575dce=a41_0x16cd;try{const _0x8c11ef=getLLMAgentCacheFile(_0x573348);if(!existsSync(_0x8c11ef))return null;const _0x2c9c9d=readFileSync(_0x8c11ef,'utf-8')[_0x575dce(0x158)]();try{const _0x31aea6=JSON[_0x575dce(0x15a)](_0x2c9c9d);if(_0x31aea6&&typeof _0x31aea6['id']==='string'&&typeof _0x31aea6[_0x575dce(0x11a)]===_0x575dce(0x13c)&&typeof _0x31aea6[_0x575dce(0x146)]===_0x575dce(0x13c))return _0x31aea6;}catch{}return null;}catch{return null;}}export function writeCachedLLMAgent(_0xd21e4e,_0x31b6e6,_0x1641be,_0x5f57ef){const _0x4248df=a41_0x16cd;try{const _0x56b17f=getCacheDir(),_0x1864d5=getLLMAgentCacheFile(_0x5f57ef);!existsSync(_0x56b17f)&&mkdirSync(_0x56b17f,{'recursive':!![]});const _0x5d5f7b={'name':_0xd21e4e,'id':_0x31b6e6,'projectId':_0x1641be};writeFileSync(_0x1864d5,JSON[_0x4248df(0x159)](_0x5d5f7b),_0x4248df(0x12d));}catch{}}export function clearCachedLLMAgent(_0x506582){try{const _0x13bfdb=getLLMAgentCacheFile(_0x506582);existsSync(_0x13bfdb)&&unlinkSync(_0x13bfdb);}catch{}}function a41_0x45dd(){const _0x3bf39f=['split','360solFbw','TDX_CONFIG_DIR','readFileSync','replace','964596XgvzcH','stg-ap03','stg-us01','match','keychain','startsWith','utf-8','llm_default_agent.','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','filter','tdx','TDX_API_KEY','TD_API_KEY\x20env\x20var\x20(deprecated)','49964OvsNoJ','tdx.json','.config','TD_API_KEY','.env','.json','yellow','endsWith','string','us01','some','jp01','entries','\x27,\x20defaulting\x20to\x20us01','Warning:\x20Unknown\x20site\x20\x27','189460KueyHJ','llm_default_project','5809968hzOfua','projectId','profile','stg-jp01','23652TFhgPp','warn','TD_API_KEY_','Warning:\x20Failed\x20to\x20load\x20','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','legacy\x20.env\x20file','toUpperCase','dev-us01','account_info.json','7235502shHzLy','keychain\x20(profile:\x20','env','.env.','TDX_API_KEY_','account_info.','trim','stringify','parse','apiKeys','176QtaRah','8ZsNPWX','TDX_API_KEY_<PROFILE>','existsSync','7JNTAND','profiles','join','415hfUuYo','TDX_API_KEY\x20env\x20var','ap02','isDeprecated','toISOString','name','eu01','ap03','includes','234092cLmsJc','site','dev-eu01','number'];a41_0x45dd=function(){return _0x3bf39f;};return a41_0x45dd();}export function getAccountInfoCacheFile(_0x1c6eea){const _0x3a0835=a41_0x16cd,_0x2b8945=_0x1c6eea?_0x3a0835(0x157)+_0x1c6eea+_0x3a0835(0x139):_0x3a0835(0x151);return join(getCacheDir(),_0x2b8945);}export function readCachedAccountInfo(_0xc912d6){const _0x5d3b56=a41_0x16cd;try{const _0x19a646=getAccountInfoCacheFile(_0xc912d6);if(!existsSync(_0x19a646))return null;const _0x512f6f=readFileSync(_0x19a646,_0x5d3b56(0x12d))[_0x5d3b56(0x158)](),_0x561983=JSON['parse'](_0x512f6f);if(_0x561983&&typeof _0x561983[_0x5d3b56(0x11f)]===_0x5d3b56(0x13c)&&typeof _0x561983['accountId']===_0x5d3b56(0x121))return _0x561983;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x3fc170,_0x56b824,_0x1625d7){const _0x39c463=a41_0x16cd;try{const _0x13abba=getCacheDir(),_0x2b44fd=getAccountInfoCacheFile(_0x1625d7);!existsSync(_0x13abba)&&mkdirSync(_0x13abba,{'recursive':!![]});const _0x184e54={'site':_0x3fc170,'accountId':_0x56b824,'cachedAt':new Date()[_0x39c463(0x119)]()};writeFileSync(_0x2b44fd,JSON[_0x39c463(0x159)](_0x184e54),_0x39c463(0x12d));}catch{}}export function parseEnvFile(_0xe8dd26){const _0x9c713a=a41_0x16cd,_0x489189={};for(const _0x18d9a1 of _0xe8dd26['split']('\x0a')){const _0x14337a=_0x18d9a1[_0x9c713a(0x158)]();if(!_0x14337a||_0x14337a['startsWith']('#'))continue;const _0x3097c0=_0x14337a[_0x9c713a(0x12a)](/^([^=]+)=(.*)$/);if(_0x3097c0){const _0x2b06db=_0x3097c0[0x1][_0x9c713a(0x158)]();let _0x4274d0=_0x3097c0[0x2][_0x9c713a(0x158)]();(_0x4274d0[_0x9c713a(0x12c)]('\x22')&&_0x4274d0[_0x9c713a(0x13b)]('\x22')||_0x4274d0[_0x9c713a(0x12c)]('\x27')&&_0x4274d0[_0x9c713a(0x13b)]('\x27'))&&(_0x4274d0=_0x4274d0['slice'](0x1,-0x1)),_0x489189[_0x2b06db]=_0x4274d0;}}return _0x489189;}export function readUserConfig(){const _0x5d562d=a41_0x16cd,_0x42df21=getConfigFile();if(!existsSync(_0x42df21))return{};try{const _0x55cca3=readFileSync(_0x42df21,_0x5d562d(0x12d));return parseEnvFile(_0x55cca3);}catch(_0x4856ea){return console[_0x5d562d(0x14a)]('Warning:\x20Failed\x20to\x20read\x20config\x20file\x20'+_0x42df21+':',_0x4856ea),{};}}function a41_0x16cd(_0x394d7f,_0x1f2038){_0x394d7f=_0x394d7f-0x10e;const _0x45ddff=a41_0x45dd();let _0x16cdd8=_0x45ddff[_0x394d7f];return _0x16cdd8;}export function resolveSite(_0xfaf44){const _0x5181e1=a41_0x16cd,_0xd4c240=[_0x5181e1(0x13d),_0x5181e1(0x13f),_0x5181e1(0x11b),'ap02','ap03',_0x5181e1(0x150),'dev-eu01',_0x5181e1(0x129),_0x5181e1(0x148),'stg-ap03'];if(_0xd4c240['includes'](_0xfaf44))return _0xfaf44;if(_0xfaf44 in SITE_ALIASES)return SITE_ALIASES[_0xfaf44];return console['warn'](_0x5181e1(0x142)+_0xfaf44+_0x5181e1(0x141)),_0x5181e1(0x13d);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x4ef70a,_0x32c759){const _0x252ecf=a41_0x16cd,_0x2f9358=_0x32c759||getActiveProfileName();if(_0x2f9358){const _0x470723=_0x252ecf(0x156)+normalizeProfileForEnvVar(_0x2f9358);if(process[_0x252ecf(0x154)][_0x470723])return process['env'][_0x470723];}if(process[_0x252ecf(0x154)]['TDX_API_KEY'])return process[_0x252ecf(0x154)]['TDX_API_KEY'];if(process[_0x252ecf(0x154)][_0x252ecf(0x137)])return process[_0x252ecf(0x154)][_0x252ecf(0x137)];const _0x23d444=_0x4ef70a[_0x252ecf(0x14f)]()[_0x252ecf(0x126)](/-/g,'_'),_0x358c9a='TD_API_KEY_'+_0x23d444;if(_0x2f9358){const _0x4666ae=loadProfileEnv(_0x2f9358);if(_0x4666ae){if(_0x4666ae[_0x358c9a])return _0x4666ae[_0x358c9a];if(_0x4666ae[_0x252ecf(0x137)])return _0x4666ae[_0x252ecf(0x137)];}}const _0x3e6ebc=loadUserConfigOnce();if(_0x3e6ebc[_0x358c9a])return _0x3e6ebc[_0x358c9a];if(_0x3e6ebc[_0x252ecf(0x137)])return _0x3e6ebc['TD_API_KEY'];return undefined;}export function normalizeProfileForEnvVar(_0xdfe05a){const _0x188d11=a41_0x16cd;return _0xdfe05a[_0x188d11(0x14f)]()[_0x188d11(0x126)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x14a5f8,_0x548679){const _0x5e26ae=a41_0x16cd,_0x23b33e=_0x548679||getActiveProfileName()||undefined;if(_0x23b33e){const _0x5951fd=_0x5e26ae(0x156)+normalizeProfileForEnvVar(_0x23b33e);if(process[_0x5e26ae(0x154)][_0x5951fd])return{'apiKey':process[_0x5e26ae(0x154)][_0x5951fd],'source':_0x5951fd+'\x20env\x20var','isDeprecated':![]};const _0x2e0362=getCachedCredential(_0x14a5f8,_0x23b33e);if(_0x2e0362)return{'apiKey':_0x2e0362,'source':_0x5e26ae(0x153)+_0x23b33e+')','isDeprecated':![]};const _0x8f7f16=await getKeychainAPIKey(_0x23b33e);if(_0x8f7f16)return setCachedCredential(_0x8f7f16,_0x14a5f8,_0x23b33e),{'apiKey':_0x8f7f16,'source':'keychain\x20(profile:\x20'+_0x23b33e+')','isDeprecated':![]};}if(process[_0x5e26ae(0x154)][_0x5e26ae(0x132)])return{'apiKey':process[_0x5e26ae(0x154)][_0x5e26ae(0x132)],'source':_0x5e26ae(0x116),'isDeprecated':![]};if(!_0x23b33e){const _0x5a413a=getCachedCredential(_0x14a5f8,undefined);if(_0x5a413a)return{'apiKey':_0x5a413a,'source':'keychain','isDeprecated':![]};const _0x49c6f3=await getKeychainAPIKey(undefined);if(_0x49c6f3)return setCachedCredential(_0x49c6f3,_0x14a5f8,undefined),{'apiKey':_0x49c6f3,'source':_0x5e26ae(0x12b),'isDeprecated':![]};}if(process[_0x5e26ae(0x154)]['TD_API_KEY'])return{'apiKey':process['env'][_0x5e26ae(0x137)],'source':_0x5e26ae(0x133),'isDeprecated':!![]};const _0x1a9271=getLegacyEnvAPIKey(_0x14a5f8,_0x23b33e);if(_0x1a9271){const _0x32f8b0=await isKeychainAvailable();if(_0x32f8b0)try{await saveKeychainAPIKey(_0x1a9271,_0x23b33e),setCachedCredential(_0x1a9271,_0x14a5f8,_0x23b33e);const _0x122174=getConfigFilePath(_0x23b33e);cleanupLegacyEnvFile(_0x122174)&&console[_0x5e26ae(0x14a)](a41_0x5889d3[_0x5e26ae(0x13a)](_0x5e26ae(0x14d)));}catch(_0xca5d2d){console[_0x5e26ae(0x14a)](a41_0x5889d3['yellow']('⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20'+_0xca5d2d));}const _0x5d0e3a=_0x23b33e?'legacy\x20.env\x20file\x20(profile:\x20'+_0x23b33e+')':_0x5e26ae(0x14e);return{'apiKey':_0x1a9271,'source':_0x5d0e3a,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x1dc96f,_0x235371,_0x717f1b=!![]){const _0x5e8335=a41_0x16cd,_0x248bdf=await resolveAPIKeyAsync(_0x1dc96f,_0x235371);if(!_0x248bdf)return undefined;if(_0x717f1b&&_0x248bdf[_0x5e8335(0x118)]&&_0x248bdf['source'][_0x5e8335(0x11d)](_0x5e8335(0x137))){const _0x483a25=_0x235371||getActiveProfileName()||undefined,_0x35b334=_0x483a25?_0x5e8335(0x156)+normalizeProfileForEnvVar(_0x483a25):_0x5e8335(0x110);console[_0x5e8335(0x14a)](a41_0x5889d3[_0x5e8335(0x13a)]('Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a'+(_0x5e8335(0x12f)+_0x35b334+').')));}return _0x248bdf['apiKey'];}function getLegacyEnvAPIKey(_0x4c18b9,_0x2fb955){const _0x1c17e4=a41_0x16cd,_0x253867=_0x4c18b9['toUpperCase']()[_0x1c17e4(0x126)](/-/g,'_'),_0x2d1c72=_0x1c17e4(0x14b)+_0x253867;if(_0x2fb955){const _0x458444=loadProfileEnv(_0x2fb955);if(_0x458444){if(_0x458444[_0x2d1c72])return _0x458444[_0x2d1c72];if(_0x458444['TD_API_KEY'])return _0x458444[_0x1c17e4(0x137)];}}const _0x200bb0=loadUserConfigOnce();if(_0x200bb0[_0x2d1c72])return _0x200bb0[_0x2d1c72];if(_0x200bb0[_0x1c17e4(0x137)])return _0x200bb0['TD_API_KEY'];return undefined;}function cleanupLegacyEnvFile(_0x598ad7){const _0x803387=a41_0x16cd;if(!existsSync(_0x598ad7))return![];try{const _0x592e17=readFileSync(_0x598ad7,_0x803387(0x12d)),_0x55077b=_0x592e17['split']('\x0a'),_0x5f1b52=_0x55077b[_0x803387(0x130)](_0x474c89=>{const _0x3884ef=_0x803387,_0x2f3f80=_0x474c89[_0x3884ef(0x158)]();if(!_0x2f3f80||_0x2f3f80['startsWith']('#'))return!![];const [_0x26bd66]=_0x2f3f80[_0x3884ef(0x122)]('=');return!_0x26bd66[_0x3884ef(0x12c)](_0x3884ef(0x137));}),_0x21a441=_0x5f1b52[_0x803387(0x13e)](_0x540a9b=>{const _0x2d4ebf=_0x803387,_0x3ed08d=_0x540a9b[_0x2d4ebf(0x158)]();return _0x3ed08d&&!_0x3ed08d[_0x2d4ebf(0x12c)]('#');});if(!_0x21a441)return unlinkSync(_0x598ad7),!![];return writeFileSync(_0x598ad7,_0x5f1b52[_0x803387(0x114)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x2c8d74){const _0xcab7a8=a41_0x16cd,_0x31947b=a41_0x33e51b[_0xcab7a8(0x114)](getConfigDir(),_0xcab7a8(0x155)+_0x2c8d74);if(a41_0x1a1941[_0xcab7a8(0x111)](_0x31947b)){validateSecureFilePermissions(_0x31947b);try{const _0x59f3bf=a41_0x1a1941[_0xcab7a8(0x125)](_0x31947b,'utf-8');return parseEnvFile(_0x59f3bf);}catch(_0x16b2b1){console[_0xcab7a8(0x14a)](_0xcab7a8(0x14c)+_0x31947b+':\x20'+_0x16b2b1);}}const _0x38cfd5=a41_0x33e51b[_0xcab7a8(0x114)](getConfigDir(),_0xcab7a8(0x113),_0x2c8d74,'.env');if(a41_0x1a1941[_0xcab7a8(0x111)](_0x38cfd5)){validateSecureFilePermissions(_0x38cfd5);try{const _0x8b320f=a41_0x1a1941['readFileSync'](_0x38cfd5,_0xcab7a8(0x12d));return parseEnvFile(_0x8b320f);}catch(_0x5ab3b6){return console[_0xcab7a8(0x14a)](_0xcab7a8(0x14c)+_0x38cfd5+':\x20'+_0x5ab3b6),null;}}return null;}function getActiveProfileName(){const _0x5e44d9=a41_0x16cd,_0x2a1c79=a41_0x33e51b[_0x5e44d9(0x114)](getConfigDir(),_0x5e44d9(0x135));if(!a41_0x1a1941['existsSync'](_0x2a1c79))return null;try{const _0x4ffe50=a41_0x1a1941['readFileSync'](_0x2a1c79,_0x5e44d9(0x12d)),_0x13cc9d=JSON[_0x5e44d9(0x15a)](_0x4ffe50);return _0x13cc9d[_0x5e44d9(0x147)]||null;}catch{return null;}}export function saveAPIKey(_0x51489c,_0x582370,_0x518810){const _0x1b3170=a41_0x16cd,_0x586f38=getConfigDir(),_0x2375db=getConfigFilePath(_0x518810);!existsSync(_0x586f38)&&mkdirSync(_0x586f38,{'recursive':!![],'mode':0x1c0});let _0x3d7df0={};if(existsSync(_0x2375db))try{const _0x1a9553=readFileSync(_0x2375db,_0x1b3170(0x12d));_0x3d7df0=parseEnvFile(_0x1a9553);}catch(_0x31be68){console['warn']('Warning:\x20Failed\x20to\x20read\x20'+_0x2375db+':',_0x31be68);}const _0x30ab8b=_0x51489c[_0x1b3170(0x14f)]()['replace'](/-/g,'_');_0x3d7df0[_0x1b3170(0x14b)+_0x30ab8b]=_0x582370;const _0x17f438=Object[_0x1b3170(0x140)](_0x3d7df0)['map'](([_0x53700a,_0x377338])=>_0x53700a+'='+_0x377338);writeFileSync(_0x2375db,_0x17f438[_0x1b3170(0x114)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0xfb9040,_0x4590b0,_0xcc26a9){const _0x531670=a41_0x16cd;await saveKeychainAPIKey(_0xfb9040,_0xcc26a9),setCachedCredential(_0xfb9040,_0x4590b0,_0xcc26a9);const _0x409466=getConfigFilePath(_0xcc26a9);cleanupLegacyEnvFile(_0x409466)&&console[_0x531670(0x14a)](a41_0x5889d3[_0x531670(0x13a)]('⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file'));}export function loadConfig(){const _0x7b1648=a41_0x16cd,_0x1dc95e={'apiKeys':{},'defaultSite':_0x7b1648(0x13d)},_0x4bfac8=[_0x7b1648(0x13d),'jp01',_0x7b1648(0x11b),_0x7b1648(0x117),_0x7b1648(0x11c),_0x7b1648(0x150),_0x7b1648(0x120),_0x7b1648(0x129),'stg-jp01',_0x7b1648(0x128)];for(const _0x355bac of _0x4bfac8){const _0x232a25=getAPIKey(_0x355bac);_0x232a25&&(_0x1dc95e[_0x7b1648(0x15b)][_0x355bac]=_0x232a25);}return _0x1dc95e;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3416d1,_0xa3ab04){const _0x135dab=a42_0x10f4,_0xd38c5f=_0x3416d1();while(!![]){try{const _0x42c53e=-parseInt(_0x135dab(0x8c))/0x1*(-parseInt(_0x135dab(0x87))/0x2)+parseInt(_0x135dab(0x91))/0x3+-parseInt(_0x135dab(0x81))/0x4+-parseInt(_0x135dab(0x90))/0x5*(-parseInt(_0x135dab(0x8a))/0x6)+parseInt(_0x135dab(0x85))/0x7+parseInt(_0x135dab(0x8d))/0x8+-parseInt(_0x135dab(0x86))/0x9;if(_0x42c53e===_0xa3ab04)break;else _0xd38c5f['push'](_0xd38c5f['shift']());}catch(_0xf9136d){_0xd38c5f['push'](_0xd38c5f['shift']());}}}(a42_0x4e4b,0x41503));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';function a42_0x10f4(_0x1b5591,_0x2086e4){_0x1b5591=_0x1b5591-0x81;const _0x4e4b1d=a42_0x4e4b();let _0x10f427=_0x4e4b1d[_0x1b5591];return _0x10f427;}import{join}from'path';import{getCacheDir}from'./config.js';function getCacheFilePath(_0x489517){const _0x3d2c79=a42_0x10f4,_0x342e7f=_0x489517||_0x3d2c79(0x88);return join(getCacheDir(),_0x3d2c79(0x8b)+_0x342e7f+_0x3d2c79(0x83));}export function loadCachedConnections(_0x28f1f9){const _0x3cab73=a42_0x10f4,_0x3fa33c=getCacheFilePath(_0x28f1f9);if(!existsSync(_0x3fa33c))return null;try{const _0x4e0ef9=readFileSync(_0x3fa33c,_0x3cab73(0x89)),_0x45a899=JSON[_0x3cab73(0x8e)](_0x4e0ef9);return _0x45a899[_0x3cab73(0x84)];}catch{return null;}}function a42_0x4e4b(){const _0x37b3f8=['9613764TtkhoF','34iPIeBf','default','utf-8','535974fothjP','connections-','15371DSsIxl','3678000KCSitr','parse','stringify','5ZGzyYf','1307616uVNVdl','787708HXqosR','now','.json','connections','2004716EMDWwa'];a42_0x4e4b=function(){return _0x37b3f8;};return a42_0x4e4b();}export function saveCachedConnections(_0x303eb7,_0x32ac85){const _0x3c2228=a42_0x10f4,_0x3f34c7=getCacheDir();!existsSync(_0x3f34c7)&&mkdirSync(_0x3f34c7,{'recursive':!![]});const _0xa9cf72=getCacheFilePath(_0x303eb7),_0x59be03={'connections':_0x32ac85,'cachedAt':Date[_0x3c2228(0x82)]()};writeFileSync(_0xa9cf72,JSON[_0x3c2228(0x8f)](_0x59be03,null,0x2),_0x3c2228(0x89));}export function clearConnectionCache(_0x486b68){const _0x1cf1a1=getCacheFilePath(_0x486b68);if(existsSync(_0x1cf1a1))try{unlinkSync(_0x1cf1a1);}catch{}}
|
package/dist/core/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x287705,_0x142152){const _0x3ef9ad=a43_0x41da,_0x13a90b=_0x287705();while(!![]){try{const _0x15c764=parseInt(_0x3ef9ad(0xf8))/0x1*(-parseInt(_0x3ef9ad(0xfc))/0x2)+-parseInt(_0x3ef9ad(0xf6))/0x3+parseInt(_0x3ef9ad(0xf5))/0x4+-parseInt(_0x3ef9ad(0xfd))/0x5+parseInt(_0x3ef9ad(0xf9))/0x6*(parseInt(_0x3ef9ad(0xfa))/0x7)+-parseInt(_0x3ef9ad(0xff))/0x8*(-parseInt(_0x3ef9ad(0xfb))/0x9)+parseInt(_0x3ef9ad(0xf7))/0xa;if(_0x15c764===_0x142152)break;else _0x13a90b['push'](_0x13a90b['shift']());}catch(_0xd7693f){_0x13a90b['push'](_0x13a90b['shift']());}}}(a43_0x1c6d,0xcbc05));export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;function a43_0x41da(_0x559f20,_0x4b0874){_0x559f20=_0x559f20-0xf5;const _0x1c6daf=a43_0x1c6d();let _0x41daed=_0x1c6daf[_0x559f20];return _0x41daed;}export function resolveLimit(_0x2c704f,_0x56504e){const _0xcb2097=a43_0x41da;if(_0x2c704f===undefined)return _0x56504e;if(typeof _0x2c704f===_0xcb2097(0xfe))return _0x2c704f;return parseInt(_0x2c704f,0xa);}function a43_0x1c6d(){const _0x5ceaf7=['number','29576EJdNuu','5110560ObMQFL','4699068rWEneI','27067990CJNzxs','481699frWczg','12ZJiyhC','3794469rxiQMw','684jXZAUZ','6UbJmYj','7517635KgArRT'];a43_0x1c6d=function(){return _0x5ceaf7;};return a43_0x1c6d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x51181c,_0x5a95ef){const _0x5883fe=a44_0x1ad6,_0x494230=_0x51181c();while(!![]){try{const _0x27b333=parseInt(_0x5883fe(0xd9))/0x1*(-parseInt(_0x5883fe(0xd8))/0x2)+parseInt(_0x5883fe(0xdd))/0x3*(-parseInt(_0x5883fe(0xd5))/0x4)+parseInt(_0x5883fe(0xe6))/0x5*(parseInt(_0x5883fe(0xe4))/0x6)+-parseInt(_0x5883fe(0xdc))/0x7*(parseInt(_0x5883fe(0xe5))/0x8)+-parseInt(_0x5883fe(0xd4))/0x9+-parseInt(_0x5883fe(0xe8))/0xa+-parseInt(_0x5883fe(0xe7))/0xb*(-parseInt(_0x5883fe(0xe3))/0xc);if(_0x27b333===_0x5a95ef)break;else _0x494230['push'](_0x494230['shift']());}catch(_0x333e9a){_0x494230['push'](_0x494230['shift']());}}}(a44_0x261d,0x7e3c2));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function a44_0x1ad6(_0x3a3f7d,_0x51aebc){_0x3a3f7d=_0x3a3f7d-0xd4;const _0x261d39=a44_0x261d();let _0x1ad662=_0x261d39[_0x3a3f7d];return _0x1ad662;}function a44_0x261d(){const _0x1fe147=['10196480CSgxkt','7092414lJvnRY','1516BirISx','__default_site__','__default_profile__','230rZDTqB','4952BnQvDk','set','clear','3206077SewFkm','2895QJxAzP','delete','loadedAt','get','now','apiKey','276Bjssgd','414990zwUqDp','8sTtDat','35knbNYQ','1546611pNxAxb'];a44_0x261d=function(){return _0x1fe147;};return a44_0x261d();}function getCacheKey(_0x2d8e1e,_0x4316d1){const _0x222a3d=a44_0x1ad6,_0x245157=_0x2d8e1e||_0x222a3d(0xd6),_0x341d45=_0x4316d1||_0x222a3d(0xd7);return _0x245157+':'+_0x341d45;}export function getCachedCredential(_0x12bebb,_0x398680){const _0xa420fb=a44_0x1ad6,_0x639d46=getCacheKey(_0x12bebb,_0x398680),_0x143fec=cache[_0xa420fb(0xe0)](_0x639d46);if(!_0x143fec)return null;if(Date[_0xa420fb(0xe1)]()-_0x143fec[_0xa420fb(0xdf)]>CACHE_TTL_MS)return cache[_0xa420fb(0xde)](_0x639d46),null;return _0x143fec[_0xa420fb(0xe2)];}export function setCachedCredential(_0x22a12d,_0x5d8ca2,_0x285802){const _0x31253e=a44_0x1ad6,_0x457c83=getCacheKey(_0x5d8ca2,_0x285802);cache[_0x31253e(0xda)](_0x457c83,{'apiKey':_0x22a12d,'loadedAt':Date['now']()});}export function clearCredentialCache(){const _0x525380=a44_0x1ad6;cache[_0x525380(0xdb)]();}export function clearCachedCredential(_0x404c74,_0x123377){const _0x6401a1=a44_0x1ad6,_0x13e7d4=getCacheKey(_0x404c74,_0x123377);cache[_0x6401a1(0xde)](_0x13e7d4);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a45_0x4c10(){const _0x10859b=['layers','string','segmentPath','profile:\x20','\x0a[configuration\x20files]','verbose','2716430ApbvjP','[context]','Project','env','profileCredentials','configFiles','llmAgent','2840KqdKQz','project','Session','loadGlobalConfig','222762kDpsDd',':\x20none','Global\x20Credentials','segment_path','global','2nelYUX','tdx.json','logLevel','sessionId','llm_project','parent_segment','workflowProject','database','Profile','TDX_SITE','Global','213zaZqqk','getParameters','.env','llm_agent','623232WokRnO','sessions','activeProfile','cliFlags','7647123CWomsJ','Profile\x20Credentials','getSource','apiKey','toString','session','136447yRKuPa','.json','parentSegment','not\x20set','readFileSync','log','site','llmProject','workflow_project','displayWithSources','us01','profile','existsSync','utf-8','1420hsktAM','entries','assign','30RrSRNR','join',':\x20none\x20(using\x20session:\x20','profiles','createAsync','resolveAPIKeyAsync','7035uHMRgQ','globalCredentials','config','replace'];a45_0x4c10=function(){return _0x10859b;};return a45_0x4c10();}function a45_0x4f8c(_0x4754cb,_0x422d38){_0x4754cb=_0x4754cb-0x1be;const _0x4c10bb=a45_0x4c10();let _0x4f8ccc=_0x4c10bb[_0x4754cb];return _0x4f8ccc;}const a45_0x3d609f=a45_0x4f8c;(function(_0x3bbe2e,_0x445b91){const _0x54caf6=a45_0x4f8c,_0x3e8418=_0x3bbe2e();while(!![]){try{const _0x212455=parseInt(_0x54caf6(0x1cf))/0x1*(-parseInt(_0x54caf6(0x200))/0x2)+-parseInt(_0x54caf6(0x1c1))/0x3*(-parseInt(_0x54caf6(0x1dd))/0x4)+-parseInt(_0x54caf6(0x1e0))/0x5*(parseInt(_0x54caf6(0x1fb))/0x6)+-parseInt(_0x54caf6(0x1e6))/0x7*(parseInt(_0x54caf6(0x1f7))/0x8)+parseInt(_0x54caf6(0x1c5))/0x9+parseInt(_0x54caf6(0x1f0))/0xa+parseInt(_0x54caf6(0x1c9))/0xb;if(_0x212455===_0x445b91)break;else _0x3e8418['push'](_0x3e8418['shift']());}catch(_0x4a64e6){_0x3e8418['push'](_0x3e8418['shift']());}}}(a45_0x4c10,0x544d9));import{resolveSite,getAPIKey,getAPIKeyAsync,getConfigDir}from'./config.js';import{loadSessionContext,getCurrentSessionPID}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';import{getActiveProfile,loadProfile}from'./profile.js';import{LogLevel}from'../utils/tdx-logger.js';import*as a45_0x54f58a from'node:fs';import*as a45_0x425cb3 from'node:path';export class GlobalContext{[a45_0x3d609f(0x1d5)];[a45_0x3d609f(0x207)];[a45_0x3d609f(0x205)];['segment_path'];[a45_0x3d609f(0x204)];['llm_agent'];[a45_0x3d609f(0x1d7)];[a45_0x3d609f(0x1cc)];[a45_0x3d609f(0x1ef)];[a45_0x3d609f(0x202)];[a45_0x3d609f(0x1da)];[a45_0x3d609f(0x1ea)];[a45_0x3d609f(0x1c7)];[a45_0x3d609f(0x203)];[a45_0x3d609f(0x1f5)];constructor(_0x29deae){const _0x4639ac=a45_0x3d609f;this[_0x4639ac(0x203)]=_0x29deae['session']||getCurrentSessionPID()[_0x4639ac(0x1cd)]();const _0x39bd70=loadSessionContext(_0x29deae[_0x4639ac(0x1ce)]),_0xb9865c=loadProjectConfig(),_0x46a5da=this[_0x4639ac(0x1fa)]();this[_0x4639ac(0x1c7)]=_0x29deae[_0x4639ac(0x1da)]||_0x39bd70?.[_0x4639ac(0x1da)]||_0x46a5da[_0x4639ac(0x1da)]||getActiveProfile();const _0x5a1037=this[_0x4639ac(0x1c7)]?loadProfile(this['activeProfile']):null,_0x42cf75=_0x382c9b=>{const _0x25deae=_0x4639ac;if(!_0x382c9b)return{};const _0x9303ff=_0x382c9b,_0x1a016b={};for(const [_0x6bfd6e,_0x1bebba]of Object[_0x25deae(0x1de)](_0x9303ff)){typeof _0x1bebba===_0x25deae(0x1eb)&&(_0x1a016b[_0x6bfd6e]=_0x1bebba);}return _0x1a016b;},_0x21ef7c={};if(_0x29deae[_0x4639ac(0x1d5)]&&_0x29deae[_0x4639ac(0x1d5)]!==_0x4639ac(0x1d9))_0x21ef7c['site']=_0x29deae['site'];const _0x1e2e21=_0x39bd70?.[_0x4639ac(0x207)],_0x4b5914=_0xb9865c?.['database'],_0x362685=_0x5a1037?.[_0x4639ac(0x1e8)]?.[_0x4639ac(0x207)],_0x1f536f=_0x46a5da['database'];_0x29deae[_0x4639ac(0x207)]&&(_0x29deae['database']!==_0x1e2e21&&_0x29deae['database']!==_0x4b5914&&_0x29deae[_0x4639ac(0x207)]!==_0x362685&&_0x29deae['database']!==_0x1f536f)&&(_0x21ef7c[_0x4639ac(0x207)]=_0x29deae[_0x4639ac(0x207)]);if(_0x29deae['parentSegment'])_0x21ef7c[_0x4639ac(0x205)]=_0x29deae[_0x4639ac(0x1d1)];if(_0x29deae[_0x4639ac(0x1d6)])_0x21ef7c[_0x4639ac(0x204)]=_0x29deae[_0x4639ac(0x1d6)];if(_0x29deae['llmAgent'])_0x21ef7c['llm_agent']=_0x29deae[_0x4639ac(0x1f6)];if(_0x29deae['profile'])_0x21ef7c[_0x4639ac(0x1da)]=_0x29deae[_0x4639ac(0x1da)];this[_0x4639ac(0x1ea)]={'cliFlags':_0x21ef7c,'session':_0x42cf75(_0x39bd70),'project':_0x42cf75(_0xb9865c),'profile':_0x42cf75(_0x5a1037?.[_0x4639ac(0x1e8)]),'global':_0x42cf75(_0x46a5da)};const _0x5e42e1={...this[_0x4639ac(0x1ea)]['global'],...this['layers'][_0x4639ac(0x1da)],...this[_0x4639ac(0x1ea)]['project']};process[_0x4639ac(0x1f3)]['TDX_SITE']&&!this[_0x4639ac(0x1ea)][_0x4639ac(0x1ce)][_0x4639ac(0x1d5)]&&!this[_0x4639ac(0x1ea)][_0x4639ac(0x1c8)][_0x4639ac(0x1d5)]&&(_0x5e42e1[_0x4639ac(0x1d5)]=process['env'][_0x4639ac(0x1bf)]);Object[_0x4639ac(0x1df)](_0x5e42e1,this[_0x4639ac(0x1ea)][_0x4639ac(0x1ce)]),Object[_0x4639ac(0x1df)](_0x5e42e1,this[_0x4639ac(0x1ea)][_0x4639ac(0x1c8)]);const _0x30d6ed=_0x5e42e1['site']||_0x4639ac(0x1d9);this[_0x4639ac(0x1d5)]=resolveSite(_0x30d6ed),this['database']=_0x5e42e1[_0x4639ac(0x207)],this[_0x4639ac(0x205)]=_0x5e42e1[_0x4639ac(0x205)],this['segment_path']=_0x5e42e1['segment_path'],this['llm_project']=_0x5e42e1[_0x4639ac(0x204)],this[_0x4639ac(0x1c4)]=_0x5e42e1[_0x4639ac(0x1c4)],this[_0x4639ac(0x1d7)]=_0x5e42e1[_0x4639ac(0x1d7)],this[_0x4639ac(0x1ef)]=_0x29deae[_0x4639ac(0x1ef)]||![],this['logLevel']=_0x29deae[_0x4639ac(0x202)]??LogLevel['INFO'],this[_0x4639ac(0x1da)]=this[_0x4639ac(0x1c7)]||undefined,this[_0x4639ac(0x1cc)]=getAPIKey(this[_0x4639ac(0x1d5)],this[_0x4639ac(0x1c7)]||undefined);const _0x1bbfaf=getConfigDir(),_0x550d92=a45_0x425cb3[_0x4639ac(0x1e1)](_0x1bbfaf,_0x4639ac(0x1c6),this['sessionId']+_0x4639ac(0x1d0)),_0x2c6538=findProjectConfigPath(),_0x14f64c=a45_0x425cb3[_0x4639ac(0x1e1)](_0x1bbfaf,_0x4639ac(0x201)),_0x419942=a45_0x425cb3[_0x4639ac(0x1e1)](_0x1bbfaf,_0x4639ac(0x1c3));let _0x3c0676=null,_0x3ab27c=null;this[_0x4639ac(0x1c7)]&&(_0x3c0676=a45_0x425cb3[_0x4639ac(0x1e1)](_0x1bbfaf,'profiles',this['activeProfile'],'tdx.json'),_0x3ab27c=a45_0x425cb3[_0x4639ac(0x1e1)](_0x1bbfaf,_0x4639ac(0x1e3),this['activeProfile'],_0x4639ac(0x1c3))),this[_0x4639ac(0x1f5)]={'session':a45_0x54f58a[_0x4639ac(0x1db)](_0x550d92)?_0x550d92:null,'project':_0x2c6538,'profile':_0x3c0676&&a45_0x54f58a[_0x4639ac(0x1db)](_0x3c0676)?_0x3c0676:null,'profileCredentials':_0x3ab27c&&a45_0x54f58a[_0x4639ac(0x1db)](_0x3ab27c)?_0x3ab27c:null,'global':a45_0x54f58a['existsSync'](_0x14f64c)?_0x14f64c:null,'globalCredentials':a45_0x54f58a[_0x4639ac(0x1db)](_0x419942)?_0x419942:null};}['getSource'](_0x88ca2c,_0x3d922e){const _0x1518fe=a45_0x3d609f;if(!_0x3d922e)return _0x1518fe(0x1d2);const _0x32b28f=_0x3d922e;if(this['layers'][_0x1518fe(0x1c8)][_0x88ca2c]===_0x32b28f){if(_0x88ca2c==='site'&&_0x32b28f===_0x1518fe(0x1d9)&&!this[_0x1518fe(0x1ea)][_0x1518fe(0x1ce)][_0x1518fe(0x1d5)]&&!this[_0x1518fe(0x1ea)]['project'][_0x1518fe(0x1d5)]&&!this['layers'][_0x1518fe(0x1da)][_0x1518fe(0x1d5)]&&!this[_0x1518fe(0x1ea)][_0x1518fe(0x1ff)]['site'])return'default';return'CLI\x20flag:\x20--'+_0x88ca2c[_0x1518fe(0x1e9)](/_/g,'-');}if(this[_0x1518fe(0x1ea)][_0x1518fe(0x1ce)][_0x88ca2c]===_0x32b28f)return _0x1518fe(0x1ce);if(this['layers'][_0x1518fe(0x1f8)][_0x88ca2c]===_0x32b28f)return _0x1518fe(0x1f8);if(this[_0x1518fe(0x1ea)][_0x1518fe(0x1da)][_0x88ca2c]===_0x32b28f)return _0x1518fe(0x1ed)+this[_0x1518fe(0x1c7)];if(this[_0x1518fe(0x1ea)][_0x1518fe(0x1ff)][_0x88ca2c]===_0x32b28f)return _0x1518fe(0x1ff);return'default';}[a45_0x3d609f(0x1fa)](){const _0x477c95=a45_0x3d609f,_0xc1eb16=a45_0x425cb3[_0x477c95(0x1e1)](getConfigDir(),_0x477c95(0x201));if(!a45_0x54f58a[_0x477c95(0x1db)](_0xc1eb16))return{};try{const _0x4543e6=a45_0x54f58a[_0x477c95(0x1d3)](_0xc1eb16,_0x477c95(0x1dc));return JSON['parse'](_0x4543e6);}catch{return{};}}['injectIntoOptions'](_0x4785f3){const _0x4e066c=a45_0x3d609f;_0x4785f3['site']=this[_0x4e066c(0x1d5)],!_0x4785f3[_0x4e066c(0x207)]&&this['database']&&(_0x4785f3[_0x4e066c(0x207)]=this[_0x4e066c(0x207)]),!_0x4785f3[_0x4e066c(0x1d1)]&&this[_0x4e066c(0x205)]&&(_0x4785f3[_0x4e066c(0x1d1)]=this['parent_segment']),!_0x4785f3[_0x4e066c(0x1ec)]&&this[_0x4e066c(0x1fe)]&&(_0x4785f3[_0x4e066c(0x1ec)]=this['segment_path']),!_0x4785f3[_0x4e066c(0x1d6)]&&this[_0x4e066c(0x204)]&&(_0x4785f3['llmProject']=this[_0x4e066c(0x204)]),!_0x4785f3[_0x4e066c(0x1f6)]&&this[_0x4e066c(0x1c4)]&&(_0x4785f3['llmAgent']=this[_0x4e066c(0x1c4)]),!_0x4785f3['workflowProject']&&this[_0x4e066c(0x1d7)]&&(_0x4785f3[_0x4e066c(0x206)]=this[_0x4e066c(0x1d7)]);}[a45_0x3d609f(0x1c2)](){const _0x225047=a45_0x3d609f;return[{'key':'site','value':this[_0x225047(0x1d5)]},{'key':_0x225047(0x207),'value':this['database']},{'key':'parent_segment','value':this[_0x225047(0x205)]},{'key':_0x225047(0x1fe),'value':this[_0x225047(0x1fe)]},{'key':_0x225047(0x204),'value':this[_0x225047(0x204)]},{'key':_0x225047(0x1c4),'value':this['llm_agent']},{'key':_0x225047(0x1d7),'value':this[_0x225047(0x1d7)]},{'key':_0x225047(0x1da),'value':this[_0x225047(0x1c7)]||undefined}];}['display'](){const _0x2af234=a45_0x3d609f;console[_0x2af234(0x1d4)](_0x2af234(0x1f1));for(const {key:_0x3ea041,value:_0xfdf102}of this[_0x2af234(0x1c2)]()){_0xfdf102&&console[_0x2af234(0x1d4)](_0x3ea041+':\x20'+_0xfdf102);}}[a45_0x3d609f(0x1d8)](){const _0x1fa2a0=a45_0x3d609f;console[_0x1fa2a0(0x1d4)](_0x1fa2a0(0x1f1));for(const {key:_0x46596b,value:_0x54e1fe}of this[_0x1fa2a0(0x1c2)]()){if(_0x54e1fe){const _0x53def0=_0x46596b===_0x1fa2a0(0x1da)?'(active)':'('+this[_0x1fa2a0(0x1cb)](_0x46596b,_0x54e1fe)+')';console[_0x1fa2a0(0x1d4)](_0x46596b+':\x20'+_0x54e1fe+'\x20'+_0x53def0);}}console['log'](_0x1fa2a0(0x1ee));const _0xd9e2a0=[{'label':_0x1fa2a0(0x1f9),'path':this[_0x1fa2a0(0x1f5)][_0x1fa2a0(0x1ce)],'extra':'(session:\x20'+this[_0x1fa2a0(0x203)]+')'},{'label':_0x1fa2a0(0x1f2),'path':this[_0x1fa2a0(0x1f5)][_0x1fa2a0(0x1f8)]},{'label':_0x1fa2a0(0x1be),'path':this[_0x1fa2a0(0x1f5)][_0x1fa2a0(0x1da)]},{'label':_0x1fa2a0(0x1ca),'path':this['configFiles'][_0x1fa2a0(0x1f4)]},{'label':_0x1fa2a0(0x1c0),'path':this[_0x1fa2a0(0x1f5)][_0x1fa2a0(0x1ff)]},{'label':_0x1fa2a0(0x1fd),'path':this[_0x1fa2a0(0x1f5)][_0x1fa2a0(0x1e7)]}];for(const {label:_0x5a2ffa,path:_0x1817d8,extra:_0x3df991}of _0xd9e2a0){if(_0x1817d8)console[_0x1fa2a0(0x1d4)](_0x5a2ffa+':\x20'+_0x1817d8+'\x20✓'+(_0x3df991?'\x20'+_0x3df991:''));else{if(_0x5a2ffa===_0x1fa2a0(0x1f9))console[_0x1fa2a0(0x1d4)](_0x5a2ffa+_0x1fa2a0(0x1e2)+this[_0x1fa2a0(0x203)]+')');else(_0x5a2ffa===_0x1fa2a0(0x1f2)||_0x5a2ffa===_0x1fa2a0(0x1c0))&&console['log'](_0x5a2ffa+_0x1fa2a0(0x1fc));}}}async[a45_0x3d609f(0x1e5)](){const _0x2a5b98=a45_0x3d609f;return this[_0x2a5b98(0x1cc)]=await getAPIKeyAsync(this['site'],this[_0x2a5b98(0x1c7)]||undefined),this['apiKey'];}static async[a45_0x3d609f(0x1e4)](_0x353e29){const _0x27940c=a45_0x3d609f,_0x5c0a28=new GlobalContext(_0x353e29);return await _0x5c0a28[_0x27940c(0x1e5)](),_0x5c0a28;}}
|
|
1
|
+
const a45_0x18a11d=a45_0x450b;(function(_0x4a0195,_0x59b865){const _0x192998=a45_0x450b,_0x20940c=_0x4a0195();while(!![]){try{const _0x26b0dd=-parseInt(_0x192998(0x1ba))/0x1*(-parseInt(_0x192998(0x1df))/0x2)+parseInt(_0x192998(0x1d0))/0x3+parseInt(_0x192998(0x1c6))/0x4+parseInt(_0x192998(0x1b3))/0x5*(parseInt(_0x192998(0x1c9))/0x6)+-parseInt(_0x192998(0x1d7))/0x7+parseInt(_0x192998(0x1f9))/0x8+parseInt(_0x192998(0x1ee))/0x9*(-parseInt(_0x192998(0x1c2))/0xa);if(_0x26b0dd===_0x59b865)break;else _0x20940c['push'](_0x20940c['shift']());}catch(_0x1ef048){_0x20940c['push'](_0x20940c['shift']());}}}(a45_0x19d5,0x87de6));import{resolveSite,getAPIKey,getAPIKeyAsync,getConfigDir}from'./config.js';import{loadSessionContext,getCurrentSessionPID}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';import{getActiveProfile,loadProfile}from'./profile.js';import{LogLevel}from'../utils/tdx-logger.js';import*as a45_0x454923 from'node:fs';import*as a45_0xa6fbdb from'node:path';export class GlobalContext{['site'];[a45_0x18a11d(0x1db)];[a45_0x18a11d(0x1dd)];[a45_0x18a11d(0x1d2)];[a45_0x18a11d(0x1e8)];[a45_0x18a11d(0x1f3)];[a45_0x18a11d(0x1e9)];['apiKey'];['verbose'];['logLevel'];[a45_0x18a11d(0x1e2)];['layers'];['activeProfile'];[a45_0x18a11d(0x1f5)];[a45_0x18a11d(0x1e3)];constructor(_0x535a92){const _0x372a9c=a45_0x18a11d;this[_0x372a9c(0x1f5)]=_0x535a92['session']||getCurrentSessionPID()[_0x372a9c(0x1f6)]();const _0x2f0b4d=loadSessionContext(_0x535a92[_0x372a9c(0x1f8)]),_0x1b1c8f=loadProjectConfig(),_0x3d18d7=this['loadGlobalConfig']();this['activeProfile']=_0x535a92['profile']||_0x2f0b4d?.[_0x372a9c(0x1e2)]||_0x3d18d7[_0x372a9c(0x1e2)]||getActiveProfile();const _0x58e511=this[_0x372a9c(0x1cf)]?loadProfile(this[_0x372a9c(0x1cf)]):null,_0x226ed4=_0x438457=>{const _0x3fae15=_0x372a9c;if(!_0x438457)return{};const _0x4009d0=_0x438457,_0x4ca2c2={};for(const [_0x4ab0e0,_0x1255bc]of Object[_0x3fae15(0x1e6)](_0x4009d0)){typeof _0x1255bc===_0x3fae15(0x1b9)&&(_0x4ca2c2[_0x4ab0e0]=_0x1255bc);}return _0x4ca2c2;},_0x2e1a45={};if(_0x535a92[_0x372a9c(0x1dc)]&&_0x535a92[_0x372a9c(0x1dc)]!==_0x372a9c(0x1d3))_0x2e1a45[_0x372a9c(0x1dc)]=_0x535a92[_0x372a9c(0x1dc)];const _0x227a51=_0x2f0b4d?.['database'],_0x54119a=_0x1b1c8f?.['database'],_0x4a3152=_0x58e511?.[_0x372a9c(0x1fd)]?.[_0x372a9c(0x1db)],_0x3a1090=_0x3d18d7[_0x372a9c(0x1db)];_0x535a92[_0x372a9c(0x1db)]&&(_0x535a92[_0x372a9c(0x1db)]!==_0x227a51&&_0x535a92[_0x372a9c(0x1db)]!==_0x54119a&&_0x535a92[_0x372a9c(0x1db)]!==_0x4a3152&&_0x535a92['database']!==_0x3a1090)&&(_0x2e1a45['database']=_0x535a92['database']);if(_0x535a92[_0x372a9c(0x1e4)])_0x2e1a45['parent_segment']=_0x535a92[_0x372a9c(0x1e4)];if(_0x535a92[_0x372a9c(0x1ed)])_0x2e1a45[_0x372a9c(0x1e8)]=_0x535a92[_0x372a9c(0x1ed)];if(_0x535a92['llmAgent'])_0x2e1a45[_0x372a9c(0x1f3)]=_0x535a92[_0x372a9c(0x1cc)];if(_0x535a92[_0x372a9c(0x1e2)])_0x2e1a45[_0x372a9c(0x1e2)]=_0x535a92[_0x372a9c(0x1e2)];this[_0x372a9c(0x1b5)]={'cliFlags':_0x2e1a45,'session':_0x226ed4(_0x2f0b4d),'project':_0x226ed4(_0x1b1c8f),'profile':_0x226ed4(_0x58e511?.[_0x372a9c(0x1fd)]),'global':_0x226ed4(_0x3d18d7)};const _0x48498e={...this[_0x372a9c(0x1b5)][_0x372a9c(0x1bc)],...this[_0x372a9c(0x1b5)][_0x372a9c(0x1e2)],...this['layers']['project']};process[_0x372a9c(0x1be)][_0x372a9c(0x1cd)]&&!this[_0x372a9c(0x1b5)][_0x372a9c(0x1f8)][_0x372a9c(0x1dc)]&&!this[_0x372a9c(0x1b5)][_0x372a9c(0x1fb)][_0x372a9c(0x1dc)]&&(_0x48498e[_0x372a9c(0x1dc)]=process[_0x372a9c(0x1be)][_0x372a9c(0x1cd)]);Object[_0x372a9c(0x1f2)](_0x48498e,this['layers']['session']),Object['assign'](_0x48498e,this[_0x372a9c(0x1b5)][_0x372a9c(0x1fb)]);const _0x1b8a0a=_0x48498e[_0x372a9c(0x1dc)]||_0x372a9c(0x1d3);this['site']=resolveSite(_0x1b8a0a),this[_0x372a9c(0x1db)]=_0x48498e[_0x372a9c(0x1db)],this[_0x372a9c(0x1dd)]=_0x48498e[_0x372a9c(0x1dd)],this[_0x372a9c(0x1d2)]=_0x48498e['segment_path'],this['llm_project']=_0x48498e[_0x372a9c(0x1e8)],this[_0x372a9c(0x1f3)]=_0x48498e[_0x372a9c(0x1f3)],this['workflow_project']=_0x48498e['workflow_project'],this[_0x372a9c(0x1e1)]=_0x535a92[_0x372a9c(0x1e1)]||![],this[_0x372a9c(0x1bf)]=_0x535a92['logLevel']??LogLevel[_0x372a9c(0x1ea)],this['profile']=this['activeProfile']||undefined,this[_0x372a9c(0x1d8)]=getAPIKey(this[_0x372a9c(0x1dc)],this['activeProfile']||undefined);const _0x18bd62=getConfigDir(),_0x41034d=a45_0xa6fbdb[_0x372a9c(0x1da)](_0x18bd62,'sessions',this[_0x372a9c(0x1f5)]+_0x372a9c(0x1de)),_0x33b794=findProjectConfigPath(),_0x34fee1=a45_0xa6fbdb['join'](_0x18bd62,_0x372a9c(0x1fa)),_0x4a16ab=a45_0xa6fbdb[_0x372a9c(0x1da)](_0x18bd62,'.env');let _0x426873=null,_0x179165=null;this['activeProfile']&&(_0x426873=a45_0xa6fbdb[_0x372a9c(0x1da)](_0x18bd62,_0x372a9c(0x1f0),this[_0x372a9c(0x1cf)],_0x372a9c(0x1fa)),_0x179165=a45_0xa6fbdb[_0x372a9c(0x1da)](_0x18bd62,'profiles',this[_0x372a9c(0x1cf)],_0x372a9c(0x1c3))),this[_0x372a9c(0x1e3)]={'session':a45_0x454923[_0x372a9c(0x1d6)](_0x41034d)?_0x41034d:null,'project':_0x33b794,'profile':_0x426873&&a45_0x454923[_0x372a9c(0x1d6)](_0x426873)?_0x426873:null,'profileCredentials':_0x179165&&a45_0x454923[_0x372a9c(0x1d6)](_0x179165)?_0x179165:null,'global':a45_0x454923[_0x372a9c(0x1d6)](_0x34fee1)?_0x34fee1:null,'globalCredentials':a45_0x454923['existsSync'](_0x4a16ab)?_0x4a16ab:null};}[a45_0x18a11d(0x1cb)](_0x5451a9,_0x4e9f69){const _0x5be105=a45_0x18a11d;if(!_0x4e9f69)return _0x5be105(0x1eb);const _0x2940c5=_0x4e9f69;if(this[_0x5be105(0x1b5)][_0x5be105(0x1fb)][_0x5451a9]===_0x2940c5){if(_0x5451a9===_0x5be105(0x1dc)&&_0x2940c5===_0x5be105(0x1d3)&&!this[_0x5be105(0x1b5)][_0x5be105(0x1f8)][_0x5be105(0x1dc)]&&!this[_0x5be105(0x1b5)]['project'][_0x5be105(0x1dc)]&&!this[_0x5be105(0x1b5)][_0x5be105(0x1e2)][_0x5be105(0x1dc)]&&!this[_0x5be105(0x1b5)][_0x5be105(0x1bc)][_0x5be105(0x1dc)])return'default';return _0x5be105(0x1b8)+_0x5451a9[_0x5be105(0x1f1)](/_/g,'-');}if(this['layers'][_0x5be105(0x1f8)][_0x5451a9]===_0x2940c5)return'session';if(this[_0x5be105(0x1b5)][_0x5be105(0x1f4)][_0x5451a9]===_0x2940c5)return _0x5be105(0x1f4);if(this['layers'][_0x5be105(0x1e2)][_0x5451a9]===_0x2940c5)return _0x5be105(0x1bd)+this[_0x5be105(0x1cf)];if(this[_0x5be105(0x1b5)][_0x5be105(0x1bc)][_0x5451a9]===_0x2940c5)return _0x5be105(0x1bc);return _0x5be105(0x1e5);}[a45_0x18a11d(0x1f7)](){const _0x3af7dd=a45_0x18a11d,_0x5de7c4=a45_0xa6fbdb['join'](getConfigDir(),_0x3af7dd(0x1fa));if(!a45_0x454923[_0x3af7dd(0x1d6)](_0x5de7c4))return{};try{const _0x51f052=a45_0x454923[_0x3af7dd(0x1ef)](_0x5de7c4,_0x3af7dd(0x1d5));return JSON[_0x3af7dd(0x1bb)](_0x51f052);}catch{return{};}}[a45_0x18a11d(0x1d9)](_0x450c8b){const _0x53a338=a45_0x18a11d;_0x450c8b['site']=this[_0x53a338(0x1dc)],!_0x450c8b[_0x53a338(0x1db)]&&this[_0x53a338(0x1db)]&&(_0x450c8b[_0x53a338(0x1db)]=this['database']),!_0x450c8b[_0x53a338(0x1e4)]&&this['parent_segment']&&(_0x450c8b[_0x53a338(0x1e4)]=this['parent_segment']),!_0x450c8b[_0x53a338(0x1c8)]&&this[_0x53a338(0x1d2)]&&(_0x450c8b['segmentPath']=this['segment_path']),!_0x450c8b[_0x53a338(0x1ed)]&&this[_0x53a338(0x1e8)]&&(_0x450c8b[_0x53a338(0x1ed)]=this['llm_project']),!_0x450c8b['llmAgent']&&this['llm_agent']&&(_0x450c8b['llmAgent']=this[_0x53a338(0x1f3)]),!_0x450c8b[_0x53a338(0x1b4)]&&this[_0x53a338(0x1e9)]&&(_0x450c8b[_0x53a338(0x1b4)]=this['workflow_project']);}[a45_0x18a11d(0x1ec)](){const _0xadd937=a45_0x18a11d;return[{'key':_0xadd937(0x1dc),'value':this['site']},{'key':_0xadd937(0x1db),'value':this[_0xadd937(0x1db)]},{'key':_0xadd937(0x1dd),'value':this['parent_segment']},{'key':'segment_path','value':this[_0xadd937(0x1d2)]},{'key':_0xadd937(0x1e8),'value':this[_0xadd937(0x1e8)]},{'key':_0xadd937(0x1f3),'value':this['llm_agent']},{'key':_0xadd937(0x1e9),'value':this[_0xadd937(0x1e9)]},{'key':_0xadd937(0x1e2),'value':this[_0xadd937(0x1cf)]||undefined}];}[a45_0x18a11d(0x1d4)](){const _0x4a39d3=a45_0x18a11d;console['log'](_0x4a39d3(0x1ce));for(const {key:_0x547109,value:_0x4cf55a}of this[_0x4a39d3(0x1ec)]()){_0x4cf55a&&console['log'](_0x547109+':\x20'+_0x4cf55a);}}['displayWithSources'](){const _0x214222=a45_0x18a11d;console[_0x214222(0x1c5)](_0x214222(0x1ce));for(const {key:_0x23b67e,value:_0x5d9e69}of this['getParameters']()){if(_0x5d9e69){const _0x5c02af=_0x23b67e===_0x214222(0x1e2)?'(active)':'('+this[_0x214222(0x1cb)](_0x23b67e,_0x5d9e69)+')';console['log'](_0x23b67e+':\x20'+_0x5d9e69+'\x20'+_0x5c02af);}}console[_0x214222(0x1c5)](_0x214222(0x1d1));const _0x309a79=[{'label':_0x214222(0x1b6),'path':this[_0x214222(0x1e3)][_0x214222(0x1f8)],'extra':'(session:\x20'+this[_0x214222(0x1f5)]+')'},{'label':_0x214222(0x1e7),'path':this[_0x214222(0x1e3)][_0x214222(0x1f4)]},{'label':_0x214222(0x1e0),'path':this[_0x214222(0x1e3)][_0x214222(0x1e2)]},{'label':_0x214222(0x1b2),'path':this[_0x214222(0x1e3)][_0x214222(0x1b7)]},{'label':_0x214222(0x1c1),'path':this['configFiles']['global']},{'label':_0x214222(0x1c4),'path':this[_0x214222(0x1e3)]['globalCredentials']}];for(const {label:_0xd024e3,path:_0x1760f3,extra:_0x1fad3b}of _0x309a79){if(_0x1760f3)console['log'](_0xd024e3+':\x20'+_0x1760f3+'\x20✓'+(_0x1fad3b?'\x20'+_0x1fad3b:''));else{if(_0xd024e3===_0x214222(0x1b6))console[_0x214222(0x1c5)](_0xd024e3+_0x214222(0x1fc)+this[_0x214222(0x1f5)]+')');else(_0xd024e3===_0x214222(0x1e7)||_0xd024e3===_0x214222(0x1c1))&&console[_0x214222(0x1c5)](_0xd024e3+_0x214222(0x1c0));}}}async[a45_0x18a11d(0x1c7)](){const _0x2af0b=a45_0x18a11d;return this[_0x2af0b(0x1d8)]=await getAPIKeyAsync(this['site'],this['activeProfile']||undefined),this['apiKey'];}static async[a45_0x18a11d(0x1ca)](_0x11a6cd){const _0x127f57=a45_0x18a11d,_0xd5b08b=new GlobalContext(_0x11a6cd);return await _0xd5b08b[_0x127f57(0x1c7)](),_0xd5b08b;}}function a45_0x450b(_0x71ba93,_0x23a9ce){_0x71ba93=_0x71ba93-0x1b2;const _0x19d572=a45_0x19d5();let _0x450bf8=_0x19d572[_0x71ba93];return _0x450bf8;}function a45_0x19d5(){const _0x348f2d=['15432620dwDkEC','.env','Global\x20Credentials','log','3340852KlqbXO','resolveAPIKeyAsync','segmentPath','6kQWYMH','createAsync','getSource','llmAgent','TDX_SITE','[context]','activeProfile','2191488YcldAQ','\x0a[configuration\x20files]','segment_path','us01','display','utf-8','existsSync','3177713zKzZzA','apiKey','injectIntoOptions','join','database','site','parent_segment','.json','196844dcmFTA','Profile','verbose','profile','configFiles','parentSegment','default','entries','Project','llm_project','workflow_project','INFO','not\x20set','getParameters','llmProject','9LfjjKh','readFileSync','profiles','replace','assign','llm_agent','project','sessionId','toString','loadGlobalConfig','session','4185552HlnhhH','tdx.json','cliFlags',':\x20none\x20(using\x20session:\x20','config','Profile\x20Credentials','1832070cmkrTd','workflowProject','layers','Session','profileCredentials','CLI\x20flag:\x20--','string','1orkNAQ','parse','global','profile:\x20','env','logLevel',':\x20none','Global'];a45_0x19d5=function(){return _0x348f2d;};return a45_0x19d5();}
|