@treasuredata/tdx 0.8.6 → 0.8.8
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 +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.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.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +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/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-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.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segments.js +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/config.js +1 -1
- package/dist/core/connection-cache.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/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/api.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/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/fields-display.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/llm-backup-utils.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/model-factors.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.d.ts.map +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.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-config.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a40_0x572c2c=a40_0x5337;(function(_0x2a1d72,_0x4c8443){const _0x5c5932=a40_0x5337,_0x20f8b6=_0x2a1d72();while(!![]){try{const _0x25c7ee=parseInt(_0x5c5932(0xd5))/0x1+parseInt(_0x5c5932(0xe1))/0x2*(-parseInt(_0x5c5932(0xe2))/0x3)+parseInt(_0x5c5932(0xec))/0x4*(-parseInt(_0x5c5932(0xe3))/0x5)+-parseInt(_0x5c5932(0xd4))/0x6+parseInt(_0x5c5932(0xd0))/0x7*(-parseInt(_0x5c5932(0xea))/0x8)+parseInt(_0x5c5932(0xcc))/0x9+-parseInt(_0x5c5932(0xdc))/0xa*(-parseInt(_0x5c5932(0xee))/0xb);if(_0x25c7ee===_0x4c8443)break;else _0x20f8b6['push'](_0x20f8b6['shift']());}catch(_0x2fb8c8){_0x20f8b6['push'](_0x20f8b6['shift']());}}}(a40_0x516b,0x48aaf));function a40_0x5337(_0x3f87ba,_0x53e4d8){_0x3f87ba=_0x3f87ba-0xca;const _0x516bca=a40_0x516b();let _0x533739=_0x516bca[_0x3f87ba];return _0x533739;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a40_0x516b(){const _0x592ea0=['table','verbose','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','1498672mRXhKq','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','8VDSUgV','Site:\x20','11hAFZMc','length','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','\x20\x20Cause:\x20','Database:\x20','Listing\x20tables...','.*\x22','\x27\x20across\x20all\x20databases.','\x20\x20Use:\x20tdx\x20tables\x20\x22','Database:\x20all','message','Note:\x20\x27','3257253hIarLR','Database\x20pattern:\x20','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','validate','14GMpoHk','Error:\x20','error','includes','1450758hNzrqy','46460zlnWVY','tables','query','limit','cause','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','✖\x20No\x20tables\x20found','7547030cbUuVz','database','\x27\x20is\x20ambiguous.','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','execute','4dZPkju','273399wZxIJO','166765oZKnkA','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','Database\x20\x27'];a40_0x516b=function(){return _0x592ea0;};return a40_0x516b();}import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{['name']=a40_0x572c2c(0xd6);['description']='List\x20tables\x20in\x20a\x20database';async[a40_0x572c2c(0xe0)](_0x402912){const _0x2fb8dd=a40_0x572c2c,{options:_0x565ed5,args:_0x553466,tdx:_0x1fc4ed}=_0x402912;let _0x200d53;if(_0x553466['length']===0x0)_0x200d53={'database':undefined,'table':undefined,'original':''};else{if(_0x553466['length']===0x1)try{_0x200d53=parseTableReference(_0x553466[0x0]);if(_0x200d53['table']&&!_0x200d53['database']&&!_0x200d53[_0x2fb8dd(0xe6)][_0x2fb8dd(0xd3)]('*')&&!_0x200d53['table'][_0x2fb8dd(0xd3)]('?'))return console[_0x2fb8dd(0xd2)]('Error:\x20Pattern\x20\x27'+_0x553466[0x0]+_0x2fb8dd(0xde)),console[_0x2fb8dd(0xd2)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x200d53[_0x2fb8dd(0xe6)]+'\x27?'),console[_0x2fb8dd(0xd2)](_0x2fb8dd(0xf6)+_0x200d53[_0x2fb8dd(0xe6)]+_0x2fb8dd(0xf4)),console[_0x2fb8dd(0xd2)]('\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'+_0x200d53[_0x2fb8dd(0xe6)]),console['error'](_0x2fb8dd(0xe4)+_0x200d53[_0x2fb8dd(0xe6)]),console[_0x2fb8dd(0xd2)](''),console[_0x2fb8dd(0xd2)](_0x2fb8dd(0xcb)+_0x553466[0x0]+_0x2fb8dd(0xe9)+_0x200d53[_0x2fb8dd(0xe6)]+_0x2fb8dd(0xf5)),0x1;}catch(_0x264754){return console[_0x2fb8dd(0xd2)]('Error:\x20'+_0x264754[_0x2fb8dd(0xca)]),0x1;}else return console[_0x2fb8dd(0xd2)](_0x2fb8dd(0xf0)),console[_0x2fb8dd(0xd2)](_0x2fb8dd(0xda)),console[_0x2fb8dd(0xd2)]('\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),console[_0x2fb8dd(0xd2)](_0x2fb8dd(0xeb)),console[_0x2fb8dd(0xd2)](_0x2fb8dd(0xce)),console[_0x2fb8dd(0xd2)]('Or\x20use\x20--in\x20flag:'),console[_0x2fb8dd(0xd2)](_0x2fb8dd(0xdf)),0x1;}const _0x4cbe0f=_0x565ed5[_0x2fb8dd(0xdd)];!_0x200d53[_0x2fb8dd(0xdd)]&&_0x4cbe0f&&(_0x200d53[_0x2fb8dd(0xdd)]=_0x4cbe0f);try{const _0x530f43=_0x5bb181=>_0x5bb181&&(_0x5bb181[_0x2fb8dd(0xd3)]('*')||_0x5bb181[_0x2fb8dd(0xd3)]('?')),_0x5262fd=_0x530f43(_0x200d53[_0x2fb8dd(0xdd)]);_0x565ed5[_0x2fb8dd(0xe7)]&&(console['error'](_0x2fb8dd(0xed)+_0x565ed5['site']),_0x200d53['database']?_0x5262fd?console[_0x2fb8dd(0xd2)](_0x2fb8dd(0xcd)+_0x200d53[_0x2fb8dd(0xdd)]):console[_0x2fb8dd(0xd2)](_0x2fb8dd(0xf2)+_0x200d53[_0x2fb8dd(0xdd)]):console[_0x2fb8dd(0xd2)](_0x2fb8dd(0xf7)),_0x200d53[_0x2fb8dd(0xe6)]&&console[_0x2fb8dd(0xd2)]('Table\x20pattern:\x20'+_0x200d53['table']));const _0x3f59e9=_0x200d53[_0x2fb8dd(0xdd)]&&!_0x5262fd?_0x200d53[_0x2fb8dd(0xdd)]:undefined,_0x4ae2ba=_0x5262fd?_0x200d53[_0x2fb8dd(0xdd)]:undefined,_0x19e70d=_0x200d53['table'],_0x4692af=resolveLimit(_0x565ed5[_0x2fb8dd(0xd8)],DEFAULT_LISTING_LIMIT),_0x5c6f94=await withSpinner(_0x2fb8dd(0xf3),()=>_0x1fc4ed[_0x2fb8dd(0xd7)]['listTables'](_0x3f59e9,_0x19e70d,_0x4ae2ba,_0x4692af),{'verbose':_0x565ed5[_0x2fb8dd(0xe7)]}),_0x26c619=_0x5c6f94['data'];if(_0x26c619[_0x2fb8dd(0xef)]===0x0&&_0x200d53[_0x2fb8dd(0xdd)]&&!_0x5262fd)return console['error'](_0x2fb8dd(0xdb)),console[_0x2fb8dd(0xd2)](_0x2fb8dd(0xe5)+_0x200d53[_0x2fb8dd(0xdd)]+_0x2fb8dd(0xe8)),0x1;return console['error']('✔\x20Found\x20'+_0x26c619[_0x2fb8dd(0xef)]+'\x20table'+(_0x26c619[_0x2fb8dd(0xef)]!==0x1?'s':'')),await handleSDKOutput(_0x26c619,{..._0x565ed5,'limit':_0x4692af}),0x0;}catch(_0x3267ea){if(_0x3267ea instanceof SDKError)return console[_0x2fb8dd(0xd2)](_0x2fb8dd(0xd1)+_0x3267ea[_0x2fb8dd(0xca)]),_0x3267ea[_0x2fb8dd(0xd9)]&&console[_0x2fb8dd(0xd2)](_0x2fb8dd(0xf1)+_0x3267ea[_0x2fb8dd(0xd9)]),0x1;throw _0x3267ea;}}[a40_0x572c2c(0xcf)](_0x4a3a32){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a41_0x434452=a41_0x2365;function a41_0x2365(_0x12529e,_0xef0472){_0x12529e=_0x12529e-0x1f4;const _0x24d599=a41_0x24d5();let _0x236583=_0x24d599[_0x12529e];return _0x236583;}(function(_0x3a490b,_0x3a444f){const _0x250923=a41_0x2365,_0x455d45=_0x3a490b();while(!![]){try{const _0x561607=parseInt(_0x250923(0x21a))/0x1*(-parseInt(_0x250923(0x21e))/0x2)+-parseInt(_0x250923(0x218))/0x3*(parseInt(_0x250923(0x1f7))/0x4)+-parseInt(_0x250923(0x1ff))/0x5*(-parseInt(_0x250923(0x215))/0x6)+-parseInt(_0x250923(0x207))/0x7*(parseInt(_0x250923(0x21d))/0x8)+parseInt(_0x250923(0x213))/0x9+-parseInt(_0x250923(0x20b))/0xa+parseInt(_0x250923(0x205))/0xb;if(_0x561607===_0x3a444f)break;else _0x455d45['push'](_0x455d45['shift']());}catch(_0x295514){_0x455d45['push'](_0x455d45['shift']());}}}(a41_0x24d5,0x52717));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists}from'../core/profile.js';import{GlobalContext}from'../core/global-context.js';import a41_0x4bdf83 from'chalk';export class UseCommand extends BaseCommand{['name']=a41_0x434452(0x1f6);[a41_0x434452(0x222)]=a41_0x434452(0x203);[a41_0x434452(0x223)](_0x75ec14){const _0x14ea10=a41_0x434452,{args:_0x980b10}=_0x75ec14;if(_0x980b10[_0x14ea10(0x20f)]===0x0)return undefined;if(_0x980b10[_0x14ea10(0x20f)]===0x1)return _0x14ea10(0x211)+_0x14ea10(0x224)+_0x14ea10(0x1fb)+'\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace\x0a'+_0x14ea10(0x217);const _0x3e1ac8=_0x980b10[0x0],_0x4cde1d=[_0x14ea10(0x1f4),_0x14ea10(0x216),_0x14ea10(0x202),_0x14ea10(0x208),_0x14ea10(0x21c)];if(!_0x4cde1d[_0x14ea10(0x219)](_0x3e1ac8))return _0x14ea10(0x20e)+_0x3e1ac8+_0x14ea10(0x210)+_0x4cde1d[_0x14ea10(0x21b)](',\x20');return undefined;}async[a41_0x434452(0x212)](_0x2ce9ec){const _0x32ece9=a41_0x434452,{args:_0x2656d5,options:_0x130fc1}=_0x2ce9ec,_0x3cbdfc=_0x130fc1[_0x32ece9(0x20c)],_0x40a414=_0x130fc1[_0x32ece9(0x226)];cleanExpiredSessions();try{if(_0x40a414){clearSessionContext(_0x130fc1[_0x32ece9(0x206)]);const _0x1d2d7c=_0x130fc1[_0x32ece9(0x206)]||getCurrentSessionPID()[_0x32ece9(0x1f9)]();return console['log'](_0x32ece9(0x204)+a41_0x4bdf83['green']('cleared')+'\x20'+a41_0x4bdf83[_0x32ece9(0x1fc)]('(session:\x20'+_0x1d2d7c+')')),0x0;}if(_0x2656d5[_0x32ece9(0x20f)]===0x0){const _0x379eb3=new GlobalContext(_0x130fc1);return _0x3cbdfc?_0x379eb3[_0x32ece9(0x20d)]():_0x379eb3['display'](),console['log'](a41_0x4bdf83[_0x32ece9(0x1fc)](_0x32ece9(0x209))),console[_0x32ece9(0x21f)](a41_0x4bdf83['dim'](_0x32ece9(0x1f8))),0x0;}const _0x2de426=_0x2656d5[0x0],_0x335a9e=_0x2656d5[0x1];if(_0x2de426==='profile'){if(!profileExists(_0x335a9e))return console[_0x32ece9(0x201)](_0x32ece9(0x1fe)+_0x335a9e+_0x32ece9(0x221)),console[_0x32ece9(0x201)](_0x32ece9(0x1f5)),0x1;const _0x1d98fc=_0x130fc1['session']||getCurrentSessionPID()['toString']();return saveSessionContext({'profile':_0x335a9e},_0x130fc1[_0x32ece9(0x206)]),console[_0x32ece9(0x21f)](_0x32ece9(0x214)+a41_0x4bdf83[_0x32ece9(0x1fa)](_0x335a9e)+'\x20'+a41_0x4bdf83['dim'](_0x32ece9(0x200)+_0x1d98fc+')')),console['log'](a41_0x4bdf83[_0x32ece9(0x1fc)](_0x32ece9(0x20a))),0x0;}const _0x12a151={},_0x44798a=_0x130fc1[_0x32ece9(0x206)]||getCurrentSessionPID()['toString']();switch(_0x2de426){case _0x32ece9(0x1f4):_0x12a151[_0x32ece9(0x1f4)]=_0x335a9e,console[_0x32ece9(0x21f)]('Session\x20database\x20set\x20to:\x20'+a41_0x4bdf83[_0x32ece9(0x1fa)](_0x335a9e)+'\x20'+a41_0x4bdf83['dim'](_0x32ece9(0x200)+_0x44798a+')'));break;case _0x32ece9(0x216):_0x12a151[_0x32ece9(0x216)]=_0x335a9e,console[_0x32ece9(0x21f)]('Session\x20parent_segment\x20set\x20to:\x20'+a41_0x4bdf83[_0x32ece9(0x1fa)](_0x335a9e)+'\x20'+a41_0x4bdf83[_0x32ece9(0x1fc)]('(session:\x20'+_0x44798a+')'));break;case _0x32ece9(0x202):_0x12a151[_0x32ece9(0x202)]=_0x335a9e,console[_0x32ece9(0x21f)](_0x32ece9(0x225)+a41_0x4bdf83['green'](_0x335a9e)+'\x20'+a41_0x4bdf83[_0x32ece9(0x1fc)](_0x32ece9(0x200)+_0x44798a+')'));break;case _0x32ece9(0x21c):_0x12a151[_0x32ece9(0x21c)]=_0x335a9e,console['log'](_0x32ece9(0x220)+a41_0x4bdf83['green'](_0x335a9e)+'\x20'+a41_0x4bdf83[_0x32ece9(0x1fc)](_0x32ece9(0x200)+_0x44798a+')'));break;}return saveSessionContext(_0x12a151,_0x130fc1[_0x32ece9(0x206)]),console['log'](a41_0x4bdf83[_0x32ece9(0x1fc)](_0x32ece9(0x20a))),0x0;}catch(_0x22a431){return _0x22a431 instanceof Error&&console[_0x32ece9(0x201)]('Error:\x20'+_0x22a431[_0x32ece9(0x1fd)]),0x1;}}}function a41_0x24d5(){const _0x3b8fc6=['execute','2450637zHCPGW','Session\x20profile\x20set\x20to:\x20','246aAECEu','parent_segment','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','9snQloS','includes','558039KWVJco','join','engage_workspace','503608gxaZyx','2syehwK','log','Session\x20engage_workspace\x20set\x20to:\x20','\x27\x20does\x20not\x20exist','description','validate','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context\x0a','Session\x20llm_project\x20set\x20to:\x20','clear','database','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','use','385428nEncwZ','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace','toString','green','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','dim','message','Error:\x20Profile\x20\x27','19770zDdUuF','(session:\x20','error','llm_project','Set\x20session-level\x20context','Session\x20context\x20','21543104SRBvAy','session','63lMwySW','profile','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','6415150XqQcsl','debug','displayWithSources','Invalid\x20resource:\x20','length','.\x20Must\x20be\x20one\x20of:\x20','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a'];a41_0x24d5=function(){return _0x3b8fc6;};return a41_0x24d5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a42_0x387fe0=a42_0x5658;function a42_0x5658(_0x16e3fd,_0x4e5b05){_0x16e3fd=_0x16e3fd-0xea;const _0x2642b5=a42_0x2642();let _0x56587d=_0x2642b5[_0x16e3fd];return _0x56587d;}function a42_0x2642(){const _0x5031cb=['12429172GPmXuu','length','✔\x20Found\x20','Error:\x20','Show\x20current\x20user\x20information','8suUUZR','user\x20list','Fetching\x20user\x20info...','message','cause','6UcBKLb','4327964bmWCrk','808683dCHOgf','user','verbose','error','922372MZYRan','10DqPhaW','Listing\x20users...','1326235xIKYYO','execute','name','description','2547130bWgRlV','45sbqTvj','18511229lvHZFy'];a42_0x2642=function(){return _0x5031cb;};return a42_0x2642();}(function(_0x58ccfb,_0x82b1b3){const _0x1861b1=a42_0x5658,_0xe7b1f8=_0x58ccfb();while(!![]){try{const _0x53dbb1=parseInt(_0x1861b1(0xfc))/0x1+-parseInt(_0x1861b1(0xfd))/0x2*(-parseInt(_0x1861b1(0xf8))/0x3)+parseInt(_0x1861b1(0xf7))/0x4+parseInt(_0x1861b1(0xff))/0x5*(-parseInt(_0x1861b1(0xf6))/0x6)+parseInt(_0x1861b1(0xec))/0x7*(-parseInt(_0x1861b1(0xf1))/0x8)+parseInt(_0x1861b1(0xea))/0x9*(parseInt(_0x1861b1(0x103))/0xa)+-parseInt(_0x1861b1(0xeb))/0xb;if(_0x53dbb1===_0x82b1b3)break;else _0xe7b1f8['push'](_0xe7b1f8['shift']());}catch(_0x3cfa32){_0xe7b1f8['push'](_0xe7b1f8['shift']());}}}(a42_0x2642,0xdc3a3));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class UserCommand extends BaseCommand{['name']=a42_0x387fe0(0xf9);[a42_0x387fe0(0x102)]=a42_0x387fe0(0xf0);async[a42_0x387fe0(0x100)](_0x22503d){const _0x2004b8=a42_0x387fe0,{options:_0x2c905b,tdx:_0x20cd12}=_0x22503d;try{const _0x40f2e1=await withSpinner(_0x2004b8(0xf3),()=>_0x20cd12[_0x2004b8(0xf9)]['getCurrent'](),{'verbose':_0x2c905b[_0x2004b8(0xfa)]}),_0x3d8a8b=_0x40f2e1['data'];return await handleSingleObjectOutput(_0x3d8a8b,_0x2c905b),0x0;}catch(_0x4c64c2){if(_0x4c64c2 instanceof SDKError)return console[_0x2004b8(0xfb)](_0x2004b8(0xef)+_0x4c64c2[_0x2004b8(0xf4)]),_0x4c64c2['cause']&&console[_0x2004b8(0xfb)]('\x20\x20Cause:\x20'+_0x4c64c2[_0x2004b8(0xf5)]),0x1;throw _0x4c64c2;}}}export class UserListCommand extends BaseCommand{[a42_0x387fe0(0x101)]=a42_0x387fe0(0xf2);[a42_0x387fe0(0x102)]='List\x20all\x20users\x20in\x20the\x20account';async[a42_0x387fe0(0x100)](_0x2384c3){const _0x6ef686=a42_0x387fe0,{options:_0x3b2d0b,tdx:_0x5a83d7}=_0x2384c3;try{const _0x4fa4ec=await withSpinner(_0x6ef686(0xfe),()=>_0x5a83d7['user']['list'](),{'verbose':_0x3b2d0b[_0x6ef686(0xfa)]}),_0xc29e55=_0x4fa4ec['data'];return console[_0x6ef686(0xfb)](_0x6ef686(0xee)+_0xc29e55[_0x6ef686(0xed)]+'\x20user'+(_0xc29e55[_0x6ef686(0xed)]!==0x1?'s':'')),await handleSDKOutput(_0xc29e55,_0x3b2d0b),0x0;}catch(_0x279d17){if(_0x279d17 instanceof SDKError)return console[_0x6ef686(0xfb)](_0x6ef686(0xef)+_0x279d17[_0x6ef686(0xf4)]),_0x279d17[_0x6ef686(0xf5)]&&console['error']('\x20\x20Cause:\x20'+_0x279d17[_0x6ef686(0xf5)]),0x1;throw _0x279d17;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a43_0x144bdc=a43_0x256d;function a43_0x256d(_0x5263e5,_0x149b6d){_0x5263e5=_0x5263e5-0x1ef;const _0x1df1ef=a43_0x1df1();let _0x256d13=_0x1df1ef[_0x5263e5];return _0x256d13;}(function(_0x23e884,_0x4d2b9f){const _0x42526c=a43_0x256d,_0x2e758a=_0x23e884();while(!![]){try{const _0x31115c=-parseInt(_0x42526c(0x23b))/0x1*(parseInt(_0x42526c(0x282))/0x2)+parseInt(_0x42526c(0x215))/0x3*(-parseInt(_0x42526c(0x23f))/0x4)+parseInt(_0x42526c(0x263))/0x5+parseInt(_0x42526c(0x255))/0x6*(parseInt(_0x42526c(0x235))/0x7)+parseInt(_0x42526c(0x230))/0x8+parseInt(_0x42526c(0x287))/0x9+-parseInt(_0x42526c(0x269))/0xa;if(_0x31115c===_0x4d2b9f)break;else _0x2e758a['push'](_0x2e758a['shift']());}catch(_0x55b868){_0x2e758a['push'](_0x2e758a['shift']());}}}(a43_0x1df1,0x66da4));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{formatBytes}from'../utils/formatters.js';import a43_0x46b35f from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a43_0x144bdc(0x242)]='workflow:projects';[a43_0x144bdc(0x22d)]=a43_0x144bdc(0x22b);async[a43_0x144bdc(0x21b)](_0x2858bb){const _0x45fcde=a43_0x144bdc,{options:_0x2762cd,args:_0x2b5bdd,tdx:_0x42878f}=_0x2858bb,_0x20b9d5=_0x2b5bdd[0x0];try{_0x2762cd[_0x45fcde(0x231)]&&_0x20b9d5&&console['error'](_0x45fcde(0x254)+_0x20b9d5);const _0x4adff0=await withSpinner(_0x45fcde(0x226),()=>_0x42878f[_0x45fcde(0x207)][_0x45fcde(0x201)](_0x20b9d5,{'limit':_0x2762cd[_0x45fcde(0x229)]}),{'verbose':_0x2762cd[_0x45fcde(0x231)]}),_0x3e1079=_0x4adff0[_0x45fcde(0x277)];return console['error'](_0x45fcde(0x249)+_0x3e1079[_0x45fcde(0x23e)]+_0x45fcde(0x232)+(_0x3e1079[_0x45fcde(0x23e)]!==0x1?'s':'')),await handleSDKOutput(_0x3e1079,_0x2762cd),0x0;}catch(_0x2aabca){if(_0x2aabca instanceof SDKError)return console[_0x45fcde(0x22a)](_0x45fcde(0x1f4)+_0x2aabca[_0x45fcde(0x252)]),_0x2aabca['cause']&&console['error'](_0x45fcde(0x1fd)+_0x2aabca[_0x45fcde(0x259)]),0x1;throw _0x2aabca;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a43_0x144bdc(0x242)]=a43_0x144bdc(0x20e);[a43_0x144bdc(0x22d)]=a43_0x144bdc(0x274);async[a43_0x144bdc(0x21b)](_0x30efa3){const _0x9a16e3=a43_0x144bdc,{options:_0xd030f1,args:_0x3179df,tdx:_0x4bd7e6}=_0x30efa3,_0x26903f=_0x3179df[0x0];try{_0xd030f1['verbose']&&_0x26903f&&console[_0x9a16e3(0x22a)]('Project\x20filter:\x20'+_0x26903f);const _0x3ba67d=await withSpinner('Listing\x20workflows...',()=>_0x4bd7e6[_0x9a16e3(0x207)][_0x9a16e3(0x26a)](_0x26903f,{'limit':_0xd030f1[_0x9a16e3(0x229)]}),{'verbose':_0xd030f1[_0x9a16e3(0x231)]}),_0x43f2c4=_0x3ba67d[_0x9a16e3(0x277)];return console['error'](_0x9a16e3(0x249)+_0x43f2c4[_0x9a16e3(0x23e)]+_0x9a16e3(0x218)+(_0x43f2c4[_0x9a16e3(0x23e)]!==0x1?'s':'')),await handleSDKOutput(_0x43f2c4,_0xd030f1),0x0;}catch(_0x3adfb1){if(_0x3adfb1 instanceof SDKError)return console[_0x9a16e3(0x22a)](_0x9a16e3(0x1f4)+_0x3adfb1[_0x9a16e3(0x252)]),_0x3adfb1[_0x9a16e3(0x259)]&&console[_0x9a16e3(0x22a)]('\x20\x20Cause:\x20'+_0x3adfb1['cause']),0x1;throw _0x3adfb1;}}}export class WorkflowSessionsCommand extends BaseCommand{['name']='workflow:sessions';['description']='List\x20workflow\x20execution\x20sessions';async['execute'](_0x8ca84b){const _0x2aab9d=a43_0x144bdc,{options:_0x41c6fe,args:_0x4d5c37,tdx:_0x872b65}=_0x8ca84b;let _0x7f4f95,_0x1fb23d;if(_0x4d5c37[0x0]){const _0x40975b=_0x4d5c37[0x0]['split']('.');if(_0x40975b['length']===0x1)_0x7f4f95=_0x40975b[0x0];else{if(_0x40975b['length']===0x2)[_0x7f4f95,_0x1fb23d]=_0x40975b;else return console[_0x2aab9d(0x22a)](_0x2aab9d(0x220)),0x1;}}try{if(_0x41c6fe[_0x2aab9d(0x231)]){if(_0x7f4f95&&_0x1fb23d)console[_0x2aab9d(0x22a)](_0x2aab9d(0x246)+_0x7f4f95+'.'+_0x1fb23d);else _0x7f4f95&&console[_0x2aab9d(0x22a)](_0x2aab9d(0x210)+_0x7f4f95);const _0x4d1218=_0x41c6fe[_0x2aab9d(0x291)];_0x4d1218&&console[_0x2aab9d(0x22a)]('Status:\x20'+_0x4d1218);}const _0x581551=await withSpinner(_0x2aab9d(0x24b),()=>_0x872b65[_0x2aab9d(0x207)][_0x2aab9d(0x21e)]({'projectName':_0x7f4f95,'workflowName':_0x1fb23d,'status':_0x41c6fe[_0x2aab9d(0x291)],'fromTime':_0x41c6fe[_0x2aab9d(0x266)],'toTime':_0x41c6fe['to'],'limit':_0x41c6fe[_0x2aab9d(0x229)]}),{'verbose':_0x41c6fe['verbose']}),_0x2057db=_0x581551[_0x2aab9d(0x277)];return console[_0x2aab9d(0x22a)](_0x2aab9d(0x249)+_0x2057db['length']+'\x20session'+(_0x2057db[_0x2aab9d(0x23e)]!==0x1?'s':'')),await handleSDKOutput(_0x2057db,_0x41c6fe),0x0;}catch(_0x5f2303){if(_0x5f2303 instanceof SDKError)return console[_0x2aab9d(0x22a)](_0x2aab9d(0x1f4)+_0x5f2303[_0x2aab9d(0x252)]),_0x5f2303['cause']&&console[_0x2aab9d(0x22a)](_0x2aab9d(0x1fd)+_0x5f2303[_0x2aab9d(0x259)]),0x1;throw _0x5f2303;}}}export class WorkflowAttemptsCommand extends BaseCommand{['name']=a43_0x144bdc(0x260);['description']=a43_0x144bdc(0x203);async[a43_0x144bdc(0x21b)](_0x246b51){const _0x380c8b=a43_0x144bdc,{options:_0x487af8,args:_0x4e8eb2,tdx:_0x216500}=_0x246b51;let _0x1212ed,_0x43108a;if(_0x4e8eb2[0x0]){const _0x20db43=_0x4e8eb2[0x0]['split']('.');if(_0x20db43['length']===0x1)_0x1212ed=_0x20db43[0x0];else{if(_0x20db43[_0x380c8b(0x23e)]===0x2)[_0x1212ed,_0x43108a]=_0x20db43;else return console[_0x380c8b(0x22a)]('Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),0x1;}}try{const _0x5571cc=_0x487af8[_0x380c8b(0x286)];if(_0x487af8[_0x380c8b(0x231)]){if(_0x1212ed&&_0x43108a)console[_0x380c8b(0x22a)](_0x380c8b(0x246)+_0x1212ed+'.'+_0x43108a);else _0x1212ed&&console[_0x380c8b(0x22a)](_0x380c8b(0x210)+_0x1212ed);_0x5571cc&&console[_0x380c8b(0x22a)]('Include\x20retried:\x20yes');}const _0x554233=await withSpinner(_0x380c8b(0x212),()=>_0x216500[_0x380c8b(0x207)][_0x380c8b(0x1ef)]({'projectName':_0x1212ed,'workflowName':_0x43108a,'includeRetried':_0x5571cc,'limit':_0x487af8[_0x380c8b(0x229)]}),{'verbose':_0x487af8[_0x380c8b(0x231)]}),_0x563da2=_0x554233[_0x380c8b(0x277)];return console[_0x380c8b(0x22a)]('✔\x20Found\x20'+_0x563da2[_0x380c8b(0x23e)]+'\x20attempt'+(_0x563da2['length']!==0x1?'s':'')),await handleSDKOutput(_0x563da2,_0x487af8),0x0;}catch(_0x4a4590){if(_0x4a4590 instanceof SDKError)return console[_0x380c8b(0x22a)](_0x380c8b(0x1f4)+_0x4a4590[_0x380c8b(0x252)]),_0x4a4590[_0x380c8b(0x259)]&&console[_0x380c8b(0x22a)](_0x380c8b(0x1fd)+_0x4a4590[_0x380c8b(0x259)]),0x1;throw _0x4a4590;}}}export class WorkflowAttemptCommand extends BaseCommand{[a43_0x144bdc(0x242)]=a43_0x144bdc(0x23d);[a43_0x144bdc(0x22d)]=a43_0x144bdc(0x23a);async[a43_0x144bdc(0x21b)](_0x4223a1){const _0x28aa4f=a43_0x144bdc,{options:_0xfaf4ef,args:_0x10f26a,tdx:_0x132d67}=_0x4223a1,_0x268a3e=_0x10f26a[0x0];if(!_0x268a3e)return console['error'](_0x28aa4f(0x1f5)),0x1;try{_0xfaf4ef[_0x28aa4f(0x231)]&&console[_0x28aa4f(0x22a)](_0x28aa4f(0x20f)+_0x268a3e);const _0x5da75d=await withSpinner(_0x28aa4f(0x26b),()=>_0x132d67[_0x28aa4f(0x207)][_0x28aa4f(0x238)](_0x268a3e),{'verbose':_0xfaf4ef[_0x28aa4f(0x231)]}),_0x34a82f=_0x5da75d[_0x28aa4f(0x277)];let _0x51753f;!_0x34a82f[_0x28aa4f(0x271)]?_0x51753f=_0x34a82f[_0x28aa4f(0x27d)]?_0x28aa4f(0x27e):'running':_0x51753f=_0x34a82f[_0x28aa4f(0x26e)]?'success':_0x28aa4f(0x22a);let _0x288d25;if(_0x34a82f[_0x28aa4f(0x272)]&&_0x34a82f[_0x28aa4f(0x22c)]){const _0x1e7029=new Date(_0x34a82f[_0x28aa4f(0x272)])[_0x28aa4f(0x213)](),_0x141df0=new Date(_0x34a82f[_0x28aa4f(0x22c)])[_0x28aa4f(0x213)]();_0x288d25=Math[_0x28aa4f(0x22e)]((_0x141df0-_0x1e7029)/0x3e8);}const _0x52de7a={'attempt_id':_0x34a82f['id'],'status':_0x51753f,..._0x34a82f['index']!==undefined&&{'index':_0x34a82f[_0x28aa4f(0x264)]},..._0x34a82f['project']&&{'project':_0x34a82f['project'][_0x28aa4f(0x242)]},..._0x34a82f['workflow']&&{'workflow':_0x34a82f['workflow']['name']},..._0x34a82f['sessionId']&&{'session_id':_0x34a82f[_0x28aa4f(0x273)]},..._0x34a82f[_0x28aa4f(0x221)]&&{'session_time':_0x34a82f['sessionTime']},..._0x34a82f[_0x28aa4f(0x20c)]&&{'retry_attempt':_0x34a82f[_0x28aa4f(0x20c)]},..._0x288d25!==undefined&&{'duration_sec':_0x288d25},..._0x34a82f[_0x28aa4f(0x272)]&&{'created_at':_0x34a82f[_0x28aa4f(0x272)]},..._0x34a82f[_0x28aa4f(0x22c)]&&{'finished_at':_0x34a82f[_0x28aa4f(0x22c)]},...Object[_0x28aa4f(0x240)](_0x34a82f[_0x28aa4f(0x28d)])[_0x28aa4f(0x23e)]>0x0&&{'params':_0x34a82f[_0x28aa4f(0x28d)]}};return await handleSingleObjectOutput(_0x52de7a,_0xfaf4ef),0x0;}catch(_0x2d5e33){if(_0x2d5e33 instanceof SDKError)return console['error'](_0x28aa4f(0x1f4)+_0x2d5e33['message']),_0x2d5e33[_0x28aa4f(0x259)]&&console['error'](_0x28aa4f(0x1fd)+_0x2d5e33[_0x28aa4f(0x259)]),0x1;throw _0x2d5e33;}}}export class WorkflowTasksCommand extends BaseCommand{[a43_0x144bdc(0x242)]='workflow:tasks';[a43_0x144bdc(0x22d)]='Show\x20tasks\x20for\x20an\x20attempt';async[a43_0x144bdc(0x21b)](_0x107023){const _0x441379=a43_0x144bdc,{options:_0x2e0734,args:_0x27b625,tdx:_0x39aef9}=_0x107023,_0x12bd89=_0x27b625[0x0];if(!_0x12bd89)return console[_0x441379(0x22a)](_0x441379(0x1f5)),0x1;try{const _0x55b654=_0x2e0734[_0x441379(0x200)];_0x2e0734['verbose']&&(console[_0x441379(0x22a)](_0x441379(0x20f)+_0x12bd89),_0x55b654&&console[_0x441379(0x22a)](_0x441379(0x211)));const _0xe73a97=await withSpinner(_0x441379(0x224),()=>_0x39aef9[_0x441379(0x207)][_0x441379(0x261)](_0x12bd89,_0x55b654||![]),{'verbose':_0x2e0734[_0x441379(0x231)]}),_0xb840b3=_0xe73a97[_0x441379(0x277)];return console[_0x441379(0x22a)]('✔\x20Found\x20'+_0xb840b3['length']+'\x20task'+(_0xb840b3['length']!==0x1?'s':'')),await handleSDKOutput(_0xb840b3,_0x2e0734),0x0;}catch(_0x57151c){if(_0x57151c instanceof SDKError)return console['error']('Error:\x20'+_0x57151c[_0x441379(0x252)]),_0x57151c['cause']&&console[_0x441379(0x22a)](_0x441379(0x1fd)+_0x57151c['cause']),0x1;throw _0x57151c;}}}export class WorkflowLogsCommand extends BaseCommand{[a43_0x144bdc(0x242)]='workflow:logs';[a43_0x144bdc(0x22d)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a43_0x144bdc(0x21b)](_0x29532f){const _0xd9c472=a43_0x144bdc,{options:_0x4f2860,args:_0x36ceb4,tdx:_0x16bf8f}=_0x29532f,_0x3c7a68=_0x36ceb4[0x0];let _0x465612=_0x36ceb4[0x1];if(!_0x3c7a68)return console['error'](_0xd9c472(0x1f5)),0x1;try{_0x4f2860[_0xd9c472(0x231)]&&(console[_0xd9c472(0x22a)](_0xd9c472(0x20f)+_0x3c7a68),_0x465612&&console[_0xd9c472(0x22a)](_0xd9c472(0x26c)+_0x465612));const _0x51e977=await withSpinner(_0xd9c472(0x24a),()=>_0x16bf8f[_0xd9c472(0x207)]['logFiles'](_0x3c7a68,_0x465612),{'verbose':_0x4f2860[_0xd9c472(0x231)]}),_0xfb8179=_0x51e977['data'];if(_0xfb8179[_0xd9c472(0x23e)]===0x0)return console[_0xd9c472(0x22a)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x465612&&(_0x4f2860['json']||_0x4f2860[_0xd9c472(0x25b)]))return await handleSDKOutput(_0xfb8179,_0x4f2860),0x0;if(!_0x465612){const _0x357edf=_0xfb8179[_0xd9c472(0x285)](_0x238180=>({'title':_0x238180[_0xd9c472(0x1f2)]+'\x20('+formatBytes(_0x238180['fileSize'])+')','value':_0x238180[_0xd9c472(0x1f2)]})),_0x293922=await a43_0x46b35f({'type':_0xd9c472(0x28c),'name':_0xd9c472(0x250),'message':_0xd9c472(0x258),'choices':_0x357edf});if(!_0x293922[_0xd9c472(0x250)])return console['error'](_0xd9c472(0x28a)),0x0;_0x465612=_0x293922[_0xd9c472(0x250)];}const _0x41ae1d=await withSpinner(_0xd9c472(0x268),()=>_0x16bf8f[_0xd9c472(0x207)][_0xd9c472(0x216)](_0x3c7a68,_0x465612),{'verbose':_0x4f2860['verbose']}),_0x18775b=_0x41ae1d['data'];return _0x18775b?console[_0xd9c472(0x1f9)](_0x18775b):console[_0xd9c472(0x22a)](_0xd9c472(0x1f1)),0x0;}catch(_0x168642){if(_0x168642 instanceof SDKError)return console[_0xd9c472(0x22a)](_0xd9c472(0x1f4)+_0x168642[_0xd9c472(0x252)]),_0x168642[_0xd9c472(0x259)]&&console[_0xd9c472(0x22a)](_0xd9c472(0x1fd)+_0x168642[_0xd9c472(0x259)]),0x1;throw _0x168642;}}}function a43_0x1df1(){const _0x3fbb5a=['Show\x20specific\x20attempt\x20details','7149OYSAkU','workflow:kill','workflow:attempt','length','92vyzuJu','keys','yes','name','Params:\x20','revision','\x20\x20Location:\x20','Filter:\x20','Project\x20directory:\x20','isArray','✔\x20Found\x20','Fetching\x20log\x20files...','Listing\x20workflow\x20sessions...','attemptId','parse','✔\x20Retry\x20started','reason','task','Parameters:\x20','message','force','Pattern:\x20','178278lAUBha','\x20\x20Project\x20ID:\x20','Starting\x20workflow\x20run...','Select\x20a\x20task\x20to\x20view\x20logs:','cause','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','format','\x20\x20Workflow:\x20','run','✔\x20Downloaded\x20','workflow:run','workflow:attempts','tasks','indexOf','2979420qdXFEk','index','Validation:\x20skipped','from','\x20\x20New\x20attempt\x20ID:\x20','Downloading\x20logs...','7434500fIBfMP','workflows','Getting\x20attempt\x20details...','Task\x20name:\x20','Workflow:\x20','success','✔\x20Pushed\x20','Error:\x20Workflow\x20identifier\x20is\x20required','done','createdAt','sessionId','List\x20workflows','\x20\x20Revision:\x20','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','data','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','Force:\x20yes','From\x20task:\x20','stat','skipValidation','cancelRequested','canceling','filesExtracted','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Error:\x20Invalid\x20parameter\x20format:\x20','188tkbbso','...','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','map','includeRetried','4402953upIiFb','Project:\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Cancelled','param','select','params','Retrying\x20attempt...','session','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','status','readFile','projectName','attempts','\x20\x20Files\x20extracted:\x20','No\x20log\x20content\x20found','taskName','Deleting\x20project\x20','Error:\x20','Error:\x20Attempt\x20ID\x20is\x20required','substring','Error:\x20Project\x20name\x20is\x20required','Usage:\x20workflow:delete\x20<project-name-or-id>','log','Resume\x20from:\x20','retryAttempt','Output\x20directory:\x20','\x20\x20Cause:\x20','delete','projectId','includeSubtasks','projects','workflow:download','List\x20workflow\x20attempts','Reason:\x20','startsWith','project','workflow','Revision:\x20','Retrying\x20session...','attempt:','\x20\x20Attempt\x20ID:\x20','retryAttemptName','\x22?\x20This\x20cannot\x20be\x20undone.','workflow:workflows','Attempt\x20ID:\x20','Filter:\x20project=','Including\x20subtasks:\x20yes','Listing\x20workflow\x20attempts...','getTime','session:','6954ruGvmS','logs','stringify','\x20workflow','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Error:\x20Invalid\x20JSON\x20in\x20--params','execute','Start\x20a\x20workflow\x20run','\x20\x20Project:\x20','sessions','Project\x20name:\x20','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','sessionTime','\x20\x20Session\x20ID:\x20','fromTask','Getting\x20attempt\x20tasks...','Killing\x20attempt...','Listing\x20workflow\x20projects...','Kill\x20a\x20running\x20attempt','Expected\x20format:\x20--param\x20key=value','limit','error','List\x20all\x20workflow\x20projects','finishedAt','description','round','kill','5251104ACFOcF','verbose','\x20project','isDirectory','Session\x20time:\x20','35epkFPu','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','Target:\x20','attempt','Pushing\x20workflow\x20project...'];a43_0x1df1=function(){return _0x3fbb5a;};return a43_0x1df1();}export class WorkflowKillCommand extends BaseCommand{[a43_0x144bdc(0x242)]=a43_0x144bdc(0x23c);['description']=a43_0x144bdc(0x227);async['execute'](_0x5e8038){const _0x70c6c2=a43_0x144bdc,{options:_0x5b1128,args:_0x472f5a,tdx:_0xcbc343}=_0x5e8038,_0x410651=_0x472f5a[0x0];if(!_0x410651)return console[_0x70c6c2(0x22a)](_0x70c6c2(0x1f5)),0x1;try{const _0x5b5921=_0x5b1128[_0x70c6c2(0x24f)];_0x5b1128[_0x70c6c2(0x231)]&&(console[_0x70c6c2(0x22a)]('Attempt\x20ID:\x20'+_0x410651),_0x5b5921&&console[_0x70c6c2(0x22a)](_0x70c6c2(0x204)+_0x5b5921));if(!_0x5b1128[_0x70c6c2(0x241)]){const _0x132a76=await confirm(_0x70c6c2(0x290)+_0x410651+'?');if(!_0x132a76)return console[_0x70c6c2(0x22a)]('Cancelled'),0x0;}const _0x349a83=await withSpinner(_0x70c6c2(0x225),()=>_0xcbc343[_0x70c6c2(0x207)][_0x70c6c2(0x22f)](_0x410651,_0x5b5921),{'verbose':_0x5b1128['verbose']}),_0x20d850=_0x349a83[_0x70c6c2(0x277)];return console[_0x70c6c2(0x22a)]('✔\x20'+_0x20d850),0x0;}catch(_0x4c0eed){if(_0x4c0eed instanceof SDKError)return console[_0x70c6c2(0x22a)](_0x70c6c2(0x1f4)+_0x4c0eed[_0x70c6c2(0x252)]),_0x4c0eed[_0x70c6c2(0x259)]&&console[_0x70c6c2(0x22a)](_0x70c6c2(0x1fd)+_0x4c0eed[_0x70c6c2(0x259)]),0x1;throw _0x4c0eed;}}}export class WorkflowRetryCommand extends BaseCommand{[a43_0x144bdc(0x242)]='workflow:retry';['description']='Retry\x20a\x20session\x20or\x20attempt';async[a43_0x144bdc(0x21b)](_0x3b3443){const _0xb1ae8=a43_0x144bdc,{options:_0x46b87f,args:_0x188deb,tdx:_0x4052d3}=_0x3b3443,_0x51718b=_0x188deb[0x0];if(!_0x51718b)return console[_0xb1ae8(0x22a)](_0xb1ae8(0x284)),console[_0xb1ae8(0x22a)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x2853e1=![],_0x2d6956=_0x51718b;if(_0x51718b[_0xb1ae8(0x205)](_0xb1ae8(0x214)))_0x2853e1=!![],_0x2d6956=_0x51718b[_0xb1ae8(0x1f6)](0x8);else{if(_0x51718b[_0xb1ae8(0x205)](_0xb1ae8(0x20a)))_0x2853e1=![],_0x2d6956=_0x51718b[_0xb1ae8(0x1f6)](0x8);else return console['error'](_0xb1ae8(0x25a)),console[_0xb1ae8(0x22a)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}try{const _0x469ebc=_0x46b87f[_0xb1ae8(0x223)],_0x11bf16=_0x46b87f['resumeFrom'],_0x588b8f=_0x46b87f[_0xb1ae8(0x28d)],_0x188fd5=_0x46b87f[_0xb1ae8(0x253)];_0x46b87f[_0xb1ae8(0x231)]&&(console[_0xb1ae8(0x22a)](_0xb1ae8(0x237)+(_0x2853e1?_0xb1ae8(0x28f):_0xb1ae8(0x238))+'\x20'+_0x2d6956),_0x469ebc&&console['error'](_0xb1ae8(0x27a)+_0x469ebc),_0x11bf16&&console[_0xb1ae8(0x22a)](_0xb1ae8(0x1fa)+_0x11bf16),_0x588b8f&&console[_0xb1ae8(0x22a)](_0xb1ae8(0x243)+_0x588b8f),_0x188fd5&&console[_0xb1ae8(0x22a)](_0xb1ae8(0x279)));let _0x4d23ce;if(_0x588b8f)try{if(_0x588b8f[_0xb1ae8(0x205)]('@')){const _0x387a17=await import('fs/promises'),_0x57078e=_0x588b8f[_0xb1ae8(0x1f6)](0x1),_0x2cf4e7=await _0x387a17[_0xb1ae8(0x292)](_0x57078e,'utf-8');_0x4d23ce=JSON[_0xb1ae8(0x24d)](_0x2cf4e7);}else _0x4d23ce=JSON[_0xb1ae8(0x24d)](_0x588b8f);}catch{return console['error'](_0xb1ae8(0x21a)),0x1;}if(!_0x46b87f[_0xb1ae8(0x241)]){const _0x544652=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x2853e1?'session':_0xb1ae8(0x238))+'\x20'+_0x2d6956+'?');if(!_0x544652)return console[_0xb1ae8(0x22a)](_0xb1ae8(0x28a)),0x0;}let _0xaf436b;_0x2853e1?_0xaf436b=await withSpinner(_0xb1ae8(0x209),()=>_0x4052d3[_0xb1ae8(0x207)]['retrySession'](_0x2d6956,{'fromTask':_0x469ebc,'retryParams':_0x4d23ce}),{'verbose':_0x46b87f['verbose']}):_0xaf436b=await withSpinner(_0xb1ae8(0x28e),()=>_0x4052d3['workflow'][_0xb1ae8(0x1fb)](_0x2d6956,{'resumeFrom':_0x11bf16,'retryParams':_0x4d23ce,'force':_0x188fd5}),{'verbose':_0x46b87f[_0xb1ae8(0x231)]});const _0x3b2554=_0xaf436b[_0xb1ae8(0x277)];return console[_0xb1ae8(0x22a)](_0xb1ae8(0x24e)),console[_0xb1ae8(0x22a)](_0xb1ae8(0x267)+_0x3b2554[_0xb1ae8(0x24c)]),console[_0xb1ae8(0x22a)](_0xb1ae8(0x222)+_0x3b2554['sessionId']),0x0;}catch(_0x29fbb7){if(_0x29fbb7 instanceof SDKError)return console[_0xb1ae8(0x22a)]('Error:\x20'+_0x29fbb7[_0xb1ae8(0x252)]),_0x29fbb7['cause']&&console[_0xb1ae8(0x22a)]('\x20\x20Cause:\x20'+_0x29fbb7[_0xb1ae8(0x259)]),0x1;throw _0x29fbb7;}}}export class WorkflowRunCommand extends BaseCommand{[a43_0x144bdc(0x242)]=a43_0x144bdc(0x25f);[a43_0x144bdc(0x22d)]=a43_0x144bdc(0x21c);async[a43_0x144bdc(0x21b)](_0x26787a){const _0x3377e6=a43_0x144bdc,{options:_0x4a5c72,args:_0x264cd5,tdx:_0x1570cb}=_0x26787a,_0x5c7d5e=_0x264cd5[0x0];if(!_0x5c7d5e)return console['error'](_0x3377e6(0x270)),console[_0x3377e6(0x22a)](_0x3377e6(0x236)),0x1;const _0x551b25=_0x4a5c72[_0x3377e6(0x28b)],_0xe98c0=_0x4a5c72['sessionTime'],_0x4f6c56={};if(_0x551b25&&Array[_0x3377e6(0x248)](_0x551b25))for(const _0xd39c4 of _0x551b25){const _0x39617c=_0xd39c4[_0x3377e6(0x262)]('=');if(_0x39617c===-0x1)return console[_0x3377e6(0x22a)](_0x3377e6(0x281)+_0xd39c4),console['error'](_0x3377e6(0x228)),0x1;const _0x191664=_0xd39c4[_0x3377e6(0x1f6)](0x0,_0x39617c),_0x4673da=_0xd39c4[_0x3377e6(0x1f6)](_0x39617c+0x1);try{_0x4f6c56[_0x191664]=JSON['parse'](_0x4673da);}catch{_0x4f6c56[_0x191664]=_0x4673da;}}_0x4a5c72[_0x3377e6(0x231)]&&(console[_0x3377e6(0x22a)](_0x3377e6(0x26d)+_0x5c7d5e),Object[_0x3377e6(0x240)](_0x4f6c56)[_0x3377e6(0x23e)]>0x0&&console[_0x3377e6(0x22a)](_0x3377e6(0x251)+JSON[_0x3377e6(0x217)](_0x4f6c56)),_0xe98c0&&console[_0x3377e6(0x22a)](_0x3377e6(0x234)+_0xe98c0));const _0x4efb2e=await withSpinner(_0x3377e6(0x257),()=>_0x1570cb['workflow'][_0x3377e6(0x25d)](_0x5c7d5e,_0x4f6c56,{'sessionTime':_0xe98c0}),{'verbose':_0x4a5c72[_0x3377e6(0x231)]}),_0x47fddf=_0x4efb2e[_0x3377e6(0x277)];return console[_0x3377e6(0x22a)]('✔\x20Workflow\x20run\x20started'),console['error'](_0x3377e6(0x20b)+_0x47fddf['id']),console[_0x3377e6(0x22a)](_0x3377e6(0x222)+_0x47fddf[_0x3377e6(0x273)]),console[_0x3377e6(0x22a)](_0x3377e6(0x21d)+_0x47fddf[_0x3377e6(0x206)]?.['name']),console[_0x3377e6(0x22a)](_0x3377e6(0x25c)+_0x47fddf['workflow']?.['name']),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a43_0x144bdc(0x242)]=a43_0x144bdc(0x202);[a43_0x144bdc(0x22d)]=a43_0x144bdc(0x289);async[a43_0x144bdc(0x21b)](_0x1e1188){const _0x16798e=a43_0x144bdc,{options:_0x106059,args:_0x3d8033,tdx:_0x315f9b}=_0x1e1188,_0x425dff=_0x3d8033[0x0],_0x16b7de=_0x3d8033[0x1]||'.';if(!_0x425dff)return console['error'](_0x16798e(0x1f7)),console[_0x16798e(0x22a)](_0x16798e(0x219)),0x1;const _0x581aa3=_0x106059['revision'];_0x106059[_0x16798e(0x231)]&&(console[_0x16798e(0x22a)]('Project:\x20'+_0x425dff),console[_0x16798e(0x22a)](_0x16798e(0x1fc)+_0x16b7de),_0x581aa3&&console['error'](_0x16798e(0x208)+_0x581aa3));const _0xabd444=await withSpinner('Downloading\x20project\x20'+_0x425dff+_0x16798e(0x283),()=>_0x315f9b[_0x16798e(0x207)]['download'](_0x425dff,_0x16b7de,{'revision':_0x581aa3}),{'verbose':_0x106059[_0x16798e(0x231)]}),_0x65c98d=_0xabd444[_0x16798e(0x277)];return console['error'](_0x16798e(0x25e)+_0x65c98d[_0x16798e(0x293)]),console[_0x16798e(0x22a)](_0x16798e(0x275)+_0x65c98d[_0x16798e(0x244)]),console[_0x16798e(0x22a)](_0x16798e(0x1f0)+_0x65c98d[_0x16798e(0x27f)]),console[_0x16798e(0x22a)](_0x16798e(0x245)+_0x16b7de+'/'+_0x65c98d[_0x16798e(0x293)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a43_0x144bdc(0x242)]='workflow:push';[a43_0x144bdc(0x22d)]=a43_0x144bdc(0x278);async[a43_0x144bdc(0x21b)](_0x2a324b){const _0x30d20c=a43_0x144bdc,{options:_0x13b2f9,args:_0x46809a,tdx:_0x888b58}=_0x2a324b;let _0x3cd99b='.',_0x3108b0=_0x13b2f9[_0x30d20c(0x242)];if(_0x46809a[0x0]){const {promises:_0x59504c}=await import('fs');try{const _0x6eabc=await _0x59504c[_0x30d20c(0x27b)](_0x46809a[0x0]);if(_0x6eabc[_0x30d20c(0x233)]())_0x3cd99b=_0x46809a[0x0];else return console[_0x30d20c(0x22a)](_0x30d20c(0x1f4)+_0x46809a[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x3108b0=_0x46809a[0x0],_0x3cd99b='.';}}const _0x173f2a=_0x13b2f9[_0x30d20c(0x244)],_0x5f4ac8=_0x13b2f9[_0x30d20c(0x27c)];_0x13b2f9[_0x30d20c(0x231)]&&(console[_0x30d20c(0x22a)](_0x30d20c(0x247)+_0x3cd99b),_0x3108b0&&console['error'](_0x30d20c(0x21f)+_0x3108b0),_0x173f2a&&console[_0x30d20c(0x22a)](_0x30d20c(0x208)+_0x173f2a),_0x5f4ac8&&console['error'](_0x30d20c(0x265)));const _0x46b80d=await withSpinner(_0x30d20c(0x239),()=>_0x888b58[_0x30d20c(0x207)]['push'](_0x3cd99b,{'projectName':_0x3108b0,'revision':_0x173f2a,'skipValidation':_0x5f4ac8}),{'verbose':_0x13b2f9[_0x30d20c(0x231)]}),_0x1d7d25=_0x46b80d[_0x30d20c(0x277)];return console['error'](_0x30d20c(0x26f)+_0x1d7d25[_0x30d20c(0x293)]),console[_0x30d20c(0x22a)]('\x20\x20Project\x20ID:\x20'+_0x1d7d25[_0x30d20c(0x1ff)]),console[_0x30d20c(0x22a)](_0x30d20c(0x275)+_0x1d7d25['revision']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']='workflow:delete';[a43_0x144bdc(0x22d)]=a43_0x144bdc(0x280);async[a43_0x144bdc(0x21b)](_0xfa6d39){const _0x200454=a43_0x144bdc,{options:_0x5b70b2,args:_0x4c0be0,tdx:_0x23c9b9}=_0xfa6d39,_0x4db7a7=_0x4c0be0[0x0];if(!_0x4db7a7)return console[_0x200454(0x22a)](_0x200454(0x276)),console[_0x200454(0x22a)](_0x200454(0x1f8)),0x1;_0x5b70b2[_0x200454(0x231)]&&console[_0x200454(0x22a)](_0x200454(0x288)+_0x4db7a7);if(!_0x5b70b2['yes']){const _0x286cc4=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x4db7a7+_0x200454(0x20d));if(!_0x286cc4)return console[_0x200454(0x22a)](_0x200454(0x28a)),0x0;}const _0x12b621=await withSpinner(_0x200454(0x1f3)+_0x4db7a7+_0x200454(0x283),()=>_0x23c9b9[_0x200454(0x207)][_0x200454(0x1fe)](_0x4db7a7),{'verbose':_0x5b70b2[_0x200454(0x231)]}),_0x33c000=_0x12b621['data'];return console[_0x200454(0x22a)]('✔\x20Deleted\x20project\x20'+_0x33c000[_0x200454(0x293)]),console[_0x200454(0x22a)](_0x200454(0x256)+_0x33c000['projectId']),0x0;}}
|
|
1
|
+
const a43_0x26092c=a43_0x397f;function a43_0x397f(_0x3d6a47,_0x35c756){_0x3d6a47=_0x3d6a47-0xd2;const _0x6a1dc9=a43_0x6a1d();let _0x397f32=_0x6a1dc9[_0x3d6a47];return _0x397f32;}(function(_0x592f68,_0x3a4dac){const _0x55263d=a43_0x397f,_0x18764d=_0x592f68();while(!![]){try{const _0x1fabb3=parseInt(_0x55263d(0xe4))/0x1*(parseInt(_0x55263d(0x142))/0x2)+-parseInt(_0x55263d(0x169))/0x3+parseInt(_0x55263d(0x141))/0x4*(-parseInt(_0x55263d(0x157))/0x5)+-parseInt(_0x55263d(0x13c))/0x6+parseInt(_0x55263d(0xee))/0x7+parseInt(_0x55263d(0xea))/0x8*(-parseInt(_0x55263d(0x143))/0x9)+-parseInt(_0x55263d(0x133))/0xa*(-parseInt(_0x55263d(0x152))/0xb);if(_0x1fabb3===_0x3a4dac)break;else _0x18764d['push'](_0x18764d['shift']());}catch(_0x438897){_0x18764d['push'](_0x18764d['shift']());}}}(a43_0x6a1d,0x684c7));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{formatBytes}from'../utils/formatters.js';import a43_0x140319 from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a43_0x26092c(0x131)]=a43_0x26092c(0xe5);['description']='List\x20all\x20workflow\x20projects';async[a43_0x26092c(0xf6)](_0x165c46){const _0x140c6f=a43_0x26092c,{options:_0xbf039,args:_0x105a9b,tdx:_0x569692}=_0x165c46,_0x98245f=_0x105a9b[0x0];try{_0xbf039['verbose']&&_0x98245f&&console[_0x140c6f(0xf1)](_0x140c6f(0x102)+_0x98245f);const _0x20bed2=await withSpinner(_0x140c6f(0x10e),()=>_0x569692[_0x140c6f(0x149)][_0x140c6f(0x13b)](_0x98245f,{'limit':_0xbf039[_0x140c6f(0x111)]}),{'verbose':_0xbf039[_0x140c6f(0x163)]}),_0x365490=_0x20bed2['data'];return console[_0x140c6f(0xf1)](_0x140c6f(0xf7)+_0x365490[_0x140c6f(0x12a)]+_0x140c6f(0x122)+(_0x365490[_0x140c6f(0x12a)]!==0x1?'s':'')),await handleSDKOutput(_0x365490,_0xbf039),0x0;}catch(_0x2888f5){if(_0x2888f5 instanceof SDKError)return console[_0x140c6f(0xf1)](_0x140c6f(0xf5)+_0x2888f5[_0x140c6f(0x14a)]),_0x2888f5[_0x140c6f(0x14e)]&&console['error'](_0x140c6f(0x114)+_0x2888f5['cause']),0x1;throw _0x2888f5;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a43_0x26092c(0x131)]=a43_0x26092c(0x123);[a43_0x26092c(0xe6)]=a43_0x26092c(0x15d);async[a43_0x26092c(0xf6)](_0x591cfd){const _0xb81e02=a43_0x26092c,{options:_0x3b857e,args:_0x5f10e5,tdx:_0x4601eb}=_0x591cfd,_0x5924be=_0x5f10e5[0x0];try{_0x3b857e[_0xb81e02(0x163)]&&_0x5924be&&console[_0xb81e02(0xf1)](_0xb81e02(0x105)+_0x5924be);const _0x2354a7=await withSpinner(_0xb81e02(0x130),()=>_0x4601eb[_0xb81e02(0x149)]['workflows'](_0x5924be,{'limit':_0x3b857e[_0xb81e02(0x111)]}),{'verbose':_0x3b857e[_0xb81e02(0x163)]}),_0x494583=_0x2354a7[_0xb81e02(0xeb)];return console[_0xb81e02(0xf1)]('✔\x20Found\x20'+_0x494583[_0xb81e02(0x12a)]+_0xb81e02(0xd4)+(_0x494583[_0xb81e02(0x12a)]!==0x1?'s':'')),await handleSDKOutput(_0x494583,_0x3b857e),0x0;}catch(_0x2f8f5e){if(_0x2f8f5e instanceof SDKError)return console[_0xb81e02(0xf1)](_0xb81e02(0xf5)+_0x2f8f5e[_0xb81e02(0x14a)]),_0x2f8f5e[_0xb81e02(0x14e)]&&console['error'](_0xb81e02(0x114)+_0x2f8f5e[_0xb81e02(0x14e)]),0x1;throw _0x2f8f5e;}}}export class WorkflowSessionsCommand extends BaseCommand{['name']=a43_0x26092c(0xfb);[a43_0x26092c(0xe6)]=a43_0x26092c(0xff);async['execute'](_0x57b825){const _0x447a95=a43_0x26092c,{options:_0x217b5e,args:_0x4d4aa6,tdx:_0x1cfa06}=_0x57b825;let _0x5ef0f0,_0x536817;if(_0x4d4aa6[0x0]){const _0x539f3f=_0x4d4aa6[0x0][_0x447a95(0xfd)]('.');if(_0x539f3f[_0x447a95(0x12a)]===0x1)_0x5ef0f0=_0x539f3f[0x0];else{if(_0x539f3f[_0x447a95(0x12a)]===0x2)[_0x5ef0f0,_0x536817]=_0x539f3f;else return console[_0x447a95(0xf1)](_0x447a95(0x117)),0x1;}}try{if(_0x217b5e['verbose']){if(_0x5ef0f0&&_0x536817)console[_0x447a95(0xf1)]('Filter:\x20'+_0x5ef0f0+'.'+_0x536817);else _0x5ef0f0&&console[_0x447a95(0xf1)](_0x447a95(0xf2)+_0x5ef0f0);const _0x5d4e1b=_0x217b5e[_0x447a95(0xf4)];_0x5d4e1b&&console['error']('Status:\x20'+_0x5d4e1b);}const _0x10b310=await withSpinner(_0x447a95(0xe3),()=>_0x1cfa06['workflow'][_0x447a95(0x135)]({'projectName':_0x5ef0f0,'workflowName':_0x536817,'status':_0x217b5e[_0x447a95(0xf4)],'fromTime':_0x217b5e['from'],'toTime':_0x217b5e['to'],'limit':_0x217b5e[_0x447a95(0x111)]}),{'verbose':_0x217b5e[_0x447a95(0x163)]}),_0x58c3d3=_0x10b310[_0x447a95(0xeb)];return console['error'](_0x447a95(0xf7)+_0x58c3d3[_0x447a95(0x12a)]+_0x447a95(0x14d)+(_0x58c3d3[_0x447a95(0x12a)]!==0x1?'s':'')),await handleSDKOutput(_0x58c3d3,_0x217b5e),0x0;}catch(_0x4e0da1){if(_0x4e0da1 instanceof SDKError)return console[_0x447a95(0xf1)](_0x447a95(0xf5)+_0x4e0da1[_0x447a95(0x14a)]),_0x4e0da1[_0x447a95(0x14e)]&&console[_0x447a95(0xf1)](_0x447a95(0x114)+_0x4e0da1[_0x447a95(0x14e)]),0x1;throw _0x4e0da1;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a43_0x26092c(0x131)]=a43_0x26092c(0x145);[a43_0x26092c(0xe6)]=a43_0x26092c(0x164);async[a43_0x26092c(0xf6)](_0x67a400){const _0x23d4fc=a43_0x26092c,{options:_0x20847,args:_0x144327,tdx:_0x24a4a6}=_0x67a400;let _0x3f3377,_0x51ff55;if(_0x144327[0x0]){const _0x220d9f=_0x144327[0x0]['split']('.');if(_0x220d9f['length']===0x1)_0x3f3377=_0x220d9f[0x0];else{if(_0x220d9f[_0x23d4fc(0x12a)]===0x2)[_0x3f3377,_0x51ff55]=_0x220d9f;else return console[_0x23d4fc(0xf1)]('Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),0x1;}}try{const _0x3f8703=_0x20847[_0x23d4fc(0xe1)];if(_0x20847[_0x23d4fc(0x163)]){if(_0x3f3377&&_0x51ff55)console[_0x23d4fc(0xf1)]('Filter:\x20'+_0x3f3377+'.'+_0x51ff55);else _0x3f3377&&console['error'](_0x23d4fc(0xf2)+_0x3f3377);_0x3f8703&&console['error']('Include\x20retried:\x20yes');}const _0x49412c=await withSpinner(_0x23d4fc(0x10d),()=>_0x24a4a6[_0x23d4fc(0x149)][_0x23d4fc(0xd2)]({'projectName':_0x3f3377,'workflowName':_0x51ff55,'includeRetried':_0x3f8703,'limit':_0x20847['limit']}),{'verbose':_0x20847[_0x23d4fc(0x163)]}),_0x138a32=_0x49412c[_0x23d4fc(0xeb)];return console[_0x23d4fc(0xf1)](_0x23d4fc(0xf7)+_0x138a32[_0x23d4fc(0x12a)]+_0x23d4fc(0x115)+(_0x138a32['length']!==0x1?'s':'')),await handleSDKOutput(_0x138a32,_0x20847),0x0;}catch(_0x186055){if(_0x186055 instanceof SDKError)return console[_0x23d4fc(0xf1)]('Error:\x20'+_0x186055[_0x23d4fc(0x14a)]),_0x186055[_0x23d4fc(0x14e)]&&console[_0x23d4fc(0xf1)](_0x23d4fc(0x114)+_0x186055[_0x23d4fc(0x14e)]),0x1;throw _0x186055;}}}export class WorkflowAttemptCommand extends BaseCommand{[a43_0x26092c(0x131)]=a43_0x26092c(0x156);[a43_0x26092c(0xe6)]=a43_0x26092c(0x12b);async['execute'](_0x338493){const _0x323d23=a43_0x26092c,{options:_0x2152c3,args:_0x4d071e,tdx:_0x3d6930}=_0x338493,_0x503e36=_0x4d071e[0x0];if(!_0x503e36)return console[_0x323d23(0xf1)](_0x323d23(0xe2)),0x1;try{_0x2152c3[_0x323d23(0x163)]&&console[_0x323d23(0xf1)](_0x323d23(0x150)+_0x503e36);const _0x3fbdbc=await withSpinner('Getting\x20attempt\x20details...',()=>_0x3d6930[_0x323d23(0x149)][_0x323d23(0x15a)](_0x503e36),{'verbose':_0x2152c3[_0x323d23(0x163)]}),_0x5ee70e=_0x3fbdbc[_0x323d23(0xeb)];let _0x3f5f79;!_0x5ee70e[_0x323d23(0x106)]?_0x3f5f79=_0x5ee70e[_0x323d23(0xdc)]?_0x323d23(0xd3):'running':_0x3f5f79=_0x5ee70e['success']?_0x323d23(0x110):_0x323d23(0xf1);let _0x35f4c7;if(_0x5ee70e[_0x323d23(0x159)]&&_0x5ee70e[_0x323d23(0x11f)]){const _0x563024=new Date(_0x5ee70e[_0x323d23(0x159)])[_0x323d23(0xfa)](),_0x3f5afa=new Date(_0x5ee70e[_0x323d23(0x11f)])[_0x323d23(0xfa)]();_0x35f4c7=Math[_0x323d23(0xe0)]((_0x3f5afa-_0x563024)/0x3e8);}const _0x1b436e={'attempt_id':_0x5ee70e['id'],'status':_0x3f5f79,..._0x5ee70e[_0x323d23(0xed)]!==undefined&&{'index':_0x5ee70e[_0x323d23(0xed)]},..._0x5ee70e['project']&&{'project':_0x5ee70e[_0x323d23(0x154)]['name']},..._0x5ee70e[_0x323d23(0x149)]&&{'workflow':_0x5ee70e[_0x323d23(0x149)][_0x323d23(0x131)]},..._0x5ee70e[_0x323d23(0x10b)]&&{'session_id':_0x5ee70e['sessionId']},..._0x5ee70e['sessionTime']&&{'session_time':_0x5ee70e[_0x323d23(0x171)]},..._0x5ee70e['retryAttemptName']&&{'retry_attempt':_0x5ee70e[_0x323d23(0xe8)]},..._0x35f4c7!==undefined&&{'duration_sec':_0x35f4c7},..._0x5ee70e[_0x323d23(0x159)]&&{'created_at':_0x5ee70e[_0x323d23(0x159)]},..._0x5ee70e['finishedAt']&&{'finished_at':_0x5ee70e['finishedAt']},...Object[_0x323d23(0x134)](_0x5ee70e['params'])[_0x323d23(0x12a)]>0x0&&{'params':_0x5ee70e[_0x323d23(0xec)]}};return await handleSingleObjectOutput(_0x1b436e,_0x2152c3),0x0;}catch(_0x3b8505){if(_0x3b8505 instanceof SDKError)return console[_0x323d23(0xf1)]('Error:\x20'+_0x3b8505[_0x323d23(0x14a)]),_0x3b8505['cause']&&console[_0x323d23(0xf1)](_0x323d23(0x114)+_0x3b8505[_0x323d23(0x14e)]),0x1;throw _0x3b8505;}}}export class WorkflowTasksCommand extends BaseCommand{['name']=a43_0x26092c(0x148);[a43_0x26092c(0xe6)]=a43_0x26092c(0x15b);async['execute'](_0x2e0ab2){const _0x36736d=a43_0x26092c,{options:_0x1ab2d1,args:_0x3b8c50,tdx:_0x121ace}=_0x2e0ab2,_0x3cf200=_0x3b8c50[0x0];if(!_0x3cf200)return console[_0x36736d(0xf1)](_0x36736d(0xe2)),0x1;try{const _0x4f473b=_0x1ab2d1['includeSubtasks'];_0x1ab2d1[_0x36736d(0x163)]&&(console[_0x36736d(0xf1)]('Attempt\x20ID:\x20'+_0x3cf200),_0x4f473b&&console['error']('Including\x20subtasks:\x20yes'));const _0x7d3a19=await withSpinner(_0x36736d(0x165),()=>_0x121ace['workflow']['tasks'](_0x3cf200,_0x4f473b||![]),{'verbose':_0x1ab2d1[_0x36736d(0x163)]}),_0x23562a=_0x7d3a19[_0x36736d(0xeb)];return console['error']('✔\x20Found\x20'+_0x23562a['length']+_0x36736d(0x11c)+(_0x23562a['length']!==0x1?'s':'')),await handleSDKOutput(_0x23562a,_0x1ab2d1),0x0;}catch(_0x442ded){if(_0x442ded instanceof SDKError)return console[_0x36736d(0xf1)](_0x36736d(0xf5)+_0x442ded[_0x36736d(0x14a)]),_0x442ded['cause']&&console['error'](_0x36736d(0x114)+_0x442ded[_0x36736d(0x14e)]),0x1;throw _0x442ded;}}}export class WorkflowLogsCommand extends BaseCommand{['name']=a43_0x26092c(0x118);[a43_0x26092c(0xe6)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a43_0x26092c(0xf6)](_0x4a0c85){const _0x2ad9da=a43_0x26092c,{options:_0x310eb8,args:_0x2180a3,tdx:_0x38c6ce}=_0x4a0c85,_0x3aab5a=_0x2180a3[0x0];let _0x80004=_0x2180a3[0x1];if(!_0x3aab5a)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{_0x310eb8[_0x2ad9da(0x163)]&&(console['error'](_0x2ad9da(0x150)+_0x3aab5a),_0x80004&&console['error'](_0x2ad9da(0x112)+_0x80004));const _0x39d914=await withSpinner(_0x2ad9da(0x16d),()=>_0x38c6ce[_0x2ad9da(0x149)]['logFiles'](_0x3aab5a,_0x80004),{'verbose':_0x310eb8['verbose']}),_0x13fc51=_0x39d914[_0x2ad9da(0xeb)];if(_0x13fc51['length']===0x0)return console[_0x2ad9da(0xf1)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x80004&&(_0x310eb8['json']||_0x310eb8[_0x2ad9da(0x16e)]))return await handleSDKOutput(_0x13fc51,_0x310eb8),0x0;if(!_0x80004){const _0x383430=_0x13fc51[_0x2ad9da(0xf8)](_0xb611a9=>({'title':_0xb611a9['taskName']+'\x20('+formatBytes(_0xb611a9[_0x2ad9da(0x119)])+')','value':_0xb611a9[_0x2ad9da(0x12f)]})),_0x22fa1c=await a43_0x140319({'type':_0x2ad9da(0x125),'name':_0x2ad9da(0x138),'message':_0x2ad9da(0x147),'choices':_0x383430});if(!_0x22fa1c[_0x2ad9da(0x138)])return console[_0x2ad9da(0xf1)](_0x2ad9da(0x121)),0x0;_0x80004=_0x22fa1c['task'];}const _0x5eb5e4=await withSpinner('Downloading\x20logs...',()=>_0x38c6ce[_0x2ad9da(0x149)][_0x2ad9da(0x136)](_0x3aab5a,_0x80004),{'verbose':_0x310eb8['verbose']}),_0x2c1fd1=_0x5eb5e4['data'];return _0x2c1fd1?console['log'](_0x2c1fd1):console[_0x2ad9da(0xf1)](_0x2ad9da(0x14f)),0x0;}catch(_0x3c8444){if(_0x3c8444 instanceof SDKError)return console[_0x2ad9da(0xf1)]('Error:\x20'+_0x3c8444['message']),_0x3c8444['cause']&&console[_0x2ad9da(0xf1)](_0x2ad9da(0x114)+_0x3c8444['cause']),0x1;throw _0x3c8444;}}}function a43_0x6a1d(){const _0x2380cb=['message','isDirectory','Expected\x20format:\x20--param\x20key=value','\x20session','cause','No\x20log\x20content\x20found','Attempt\x20ID:\x20','\x20\x20Project:\x20','10006832mOIOBB','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','project','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','workflow:attempt','1061845dtgSft','download','createdAt','attempt','Show\x20tasks\x20for\x20an\x20attempt','Resume\x20from:\x20','List\x20workflows','Session\x20time:\x20','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','readFile','\x20\x20Files\x20extracted:\x20','Output\x20directory:\x20','verbose','List\x20workflow\x20attempts','Getting\x20attempt\x20tasks...','✔\x20Retry\x20started','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','startsWith','1130034obFSgq','✔\x20Workflow\x20run\x20started','workflow:kill','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','Fetching\x20log\x20files...','format','Params:\x20','✔\x20Deleted\x20project\x20','sessionTime','Pushing\x20workflow\x20project...','attempts','canceling','\x20workflow','Usage:\x20workflow:delete\x20<project-name-or-id>','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Retrying\x20attempt...','Reason:\x20','isArray','cancelRequested','\x20\x20Project\x20ID:\x20','Project\x20directory:\x20','Error:\x20Workflow\x20identifier\x20is\x20required','round','includeRetried','Error:\x20Attempt\x20ID\x20is\x20required','Listing\x20workflow\x20sessions...','1OqTedT','workflow:projects','description','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','retryAttemptName','session','16kxJPvY','data','params','index','944328UBlkNV','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','kill','error','Filter:\x20project=','Retry\x20a\x20session\x20or\x20attempt','status','Error:\x20','execute','✔\x20Found\x20','map','param','getTime','workflow:sessions','Force:\x20yes','split','\x20\x20Revision:\x20','List\x20workflow\x20execution\x20sessions','\x20\x20Session\x20ID:\x20','...','Pattern:\x20','Validation:\x20skipped','Downloading\x20project\x20','Project\x20filter:\x20','done','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Project\x20name:\x20','revision','workflow:run','sessionId','stat','Listing\x20workflow\x20attempts...','Listing\x20workflow\x20projects...','\x20\x20Location:\x20','success','limit','Task\x20name:\x20','delete','\x20\x20Cause:\x20','\x20attempt','skipValidation','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','workflow:logs','fileSize','projectId','Retrying\x20session...','\x20task','\x20\x20New\x20attempt\x20ID:\x20','yes','finishedAt','\x22?\x20This\x20cannot\x20be\x20undone.','Cancelled','\x20project','workflow:workflows','filesExtracted','select','parse','Deleting\x20project\x20','retryAttempt','workflow:download','length','Show\x20specific\x20attempt\x20details','\x20\x20Workflow:\x20','Revision:\x20','Error:\x20Project\x20name\x20is\x20required','taskName','Listing\x20workflows...','name','Killing\x20attempt...','20qJBvTT','keys','sessions','logs','fromTask','task','Project:\x20','Error:\x20Invalid\x20parameter\x20format:\x20','projects','1517892hoRglX','substring','workflow:delete','✔\x20Pushed\x20','Target:\x20','16LMezph','569626lEcQNu','1497591ITCzvQ','Workflow:\x20','workflow:attempts','projectName','Select\x20a\x20task\x20to\x20view\x20logs:','workflow:tasks','workflow'];a43_0x6a1d=function(){return _0x2380cb;};return a43_0x6a1d();}export class WorkflowKillCommand extends BaseCommand{['name']=a43_0x26092c(0x16b);['description']='Kill\x20a\x20running\x20attempt';async['execute'](_0x4ba037){const _0x3096fe=a43_0x26092c,{options:_0x48e5f0,args:_0x271acb,tdx:_0x13ea0d}=_0x4ba037,_0x5db049=_0x271acb[0x0];if(!_0x5db049)return console[_0x3096fe(0xf1)](_0x3096fe(0xe2)),0x1;try{const _0x4bf268=_0x48e5f0['reason'];_0x48e5f0['verbose']&&(console[_0x3096fe(0xf1)]('Attempt\x20ID:\x20'+_0x5db049),_0x4bf268&&console[_0x3096fe(0xf1)](_0x3096fe(0xda)+_0x4bf268));if(!_0x48e5f0[_0x3096fe(0x11e)]){const _0x3e9fa4=await confirm(_0x3096fe(0xe7)+_0x5db049+'?');if(!_0x3e9fa4)return console[_0x3096fe(0xf1)](_0x3096fe(0x121)),0x0;}const _0x4377eb=await withSpinner(_0x3096fe(0x132),()=>_0x13ea0d['workflow'][_0x3096fe(0xf0)](_0x5db049,_0x4bf268),{'verbose':_0x48e5f0[_0x3096fe(0x163)]}),_0x3a2942=_0x4377eb[_0x3096fe(0xeb)];return console[_0x3096fe(0xf1)]('✔\x20'+_0x3a2942),0x0;}catch(_0x540f09){if(_0x540f09 instanceof SDKError)return console[_0x3096fe(0xf1)](_0x3096fe(0xf5)+_0x540f09['message']),_0x540f09[_0x3096fe(0x14e)]&&console[_0x3096fe(0xf1)](_0x3096fe(0x114)+_0x540f09[_0x3096fe(0x14e)]),0x1;throw _0x540f09;}}}export class WorkflowRetryCommand extends BaseCommand{[a43_0x26092c(0x131)]='workflow:retry';[a43_0x26092c(0xe6)]=a43_0x26092c(0xf3);async['execute'](_0x5a8ded){const _0x3cbf41=a43_0x26092c,{options:_0x5ed9c2,args:_0x107442,tdx:_0x2b4a20}=_0x5a8ded,_0x220916=_0x107442[0x0];if(!_0x220916)return console[_0x3cbf41(0xf1)](_0x3cbf41(0x167)),console[_0x3cbf41(0xf1)](_0x3cbf41(0xd6)),0x1;let _0x3b9fc5=![],_0x24e073=_0x220916;if(_0x220916[_0x3cbf41(0x168)]('session:'))_0x3b9fc5=!![],_0x24e073=_0x220916[_0x3cbf41(0x13d)](0x8);else{if(_0x220916[_0x3cbf41(0x168)]('attempt:'))_0x3b9fc5=![],_0x24e073=_0x220916[_0x3cbf41(0x13d)](0x8);else return console[_0x3cbf41(0xf1)](_0x3cbf41(0xd7)),console[_0x3cbf41(0xf1)](_0x3cbf41(0xd6)),0x1;}try{const _0x358078=_0x5ed9c2[_0x3cbf41(0x137)],_0x58f730=_0x5ed9c2['resumeFrom'],_0xdd35bd=_0x5ed9c2[_0x3cbf41(0xec)],_0x1aec14=_0x5ed9c2['force'];_0x5ed9c2['verbose']&&(console['error'](_0x3cbf41(0x140)+(_0x3b9fc5?_0x3cbf41(0xe9):_0x3cbf41(0x15a))+'\x20'+_0x24e073),_0x358078&&console[_0x3cbf41(0xf1)]('From\x20task:\x20'+_0x358078),_0x58f730&&console[_0x3cbf41(0xf1)](_0x3cbf41(0x15c)+_0x58f730),_0xdd35bd&&console[_0x3cbf41(0xf1)](_0x3cbf41(0x16f)+_0xdd35bd),_0x1aec14&&console[_0x3cbf41(0xf1)](_0x3cbf41(0xfc)));let _0xe46e14;if(_0xdd35bd)try{if(_0xdd35bd[_0x3cbf41(0x168)]('@')){const _0x27e5c5=await import('fs/promises'),_0x21c8fa=_0xdd35bd[_0x3cbf41(0x13d)](0x1),_0x518d31=await _0x27e5c5[_0x3cbf41(0x160)](_0x21c8fa,'utf-8');_0xe46e14=JSON[_0x3cbf41(0x126)](_0x518d31);}else _0xe46e14=JSON['parse'](_0xdd35bd);}catch{return console[_0x3cbf41(0xf1)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x5ed9c2[_0x3cbf41(0x11e)]){const _0x121e74=await confirm(_0x3cbf41(0xef)+(_0x3b9fc5?'session':_0x3cbf41(0x15a))+'\x20'+_0x24e073+'?');if(!_0x121e74)return console[_0x3cbf41(0xf1)](_0x3cbf41(0x121)),0x0;}let _0x45d103;_0x3b9fc5?_0x45d103=await withSpinner(_0x3cbf41(0x11b),()=>_0x2b4a20[_0x3cbf41(0x149)]['retrySession'](_0x24e073,{'fromTask':_0x358078,'retryParams':_0xe46e14}),{'verbose':_0x5ed9c2[_0x3cbf41(0x163)]}):_0x45d103=await withSpinner(_0x3cbf41(0xd9),()=>_0x2b4a20[_0x3cbf41(0x149)][_0x3cbf41(0x128)](_0x24e073,{'resumeFrom':_0x58f730,'retryParams':_0xe46e14,'force':_0x1aec14}),{'verbose':_0x5ed9c2[_0x3cbf41(0x163)]});const _0x4226e8=_0x45d103[_0x3cbf41(0xeb)];return console['error'](_0x3cbf41(0x166)),console[_0x3cbf41(0xf1)](_0x3cbf41(0x11d)+_0x4226e8['attemptId']),console[_0x3cbf41(0xf1)](_0x3cbf41(0x100)+_0x4226e8[_0x3cbf41(0x10b)]),0x0;}catch(_0x197568){if(_0x197568 instanceof SDKError)return console[_0x3cbf41(0xf1)](_0x3cbf41(0xf5)+_0x197568[_0x3cbf41(0x14a)]),_0x197568[_0x3cbf41(0x14e)]&&console['error'](_0x3cbf41(0x114)+_0x197568[_0x3cbf41(0x14e)]),0x1;throw _0x197568;}}}export class WorkflowRunCommand extends BaseCommand{['name']=a43_0x26092c(0x10a);[a43_0x26092c(0xe6)]='Start\x20a\x20workflow\x20run';async[a43_0x26092c(0xf6)](_0x612b8c){const _0x233d34=a43_0x26092c,{options:_0x204382,args:_0x5c3a38,tdx:_0x42f6dd}=_0x612b8c,_0x162c1b=_0x5c3a38[0x0];if(!_0x162c1b)return console[_0x233d34(0xf1)](_0x233d34(0xdf)),console[_0x233d34(0xf1)](_0x233d34(0x15f)),0x1;const _0x5838c4=_0x204382[_0x233d34(0xf9)],_0x8c1de2=_0x204382[_0x233d34(0x171)],_0x1a692a={};if(_0x5838c4&&Array[_0x233d34(0xdb)](_0x5838c4))for(const _0x1d285c of _0x5838c4){const _0x18aaf9=_0x1d285c['indexOf']('=');if(_0x18aaf9===-0x1)return console[_0x233d34(0xf1)](_0x233d34(0x13a)+_0x1d285c),console['error'](_0x233d34(0x14c)),0x1;const _0x399616=_0x1d285c[_0x233d34(0x13d)](0x0,_0x18aaf9),_0xaa056b=_0x1d285c[_0x233d34(0x13d)](_0x18aaf9+0x1);try{_0x1a692a[_0x399616]=JSON[_0x233d34(0x126)](_0xaa056b);}catch{_0x1a692a[_0x399616]=_0xaa056b;}}_0x204382['verbose']&&(console[_0x233d34(0xf1)](_0x233d34(0x144)+_0x162c1b),Object[_0x233d34(0x134)](_0x1a692a)[_0x233d34(0x12a)]>0x0&&console[_0x233d34(0xf1)]('Parameters:\x20'+JSON['stringify'](_0x1a692a)),_0x8c1de2&&console[_0x233d34(0xf1)](_0x233d34(0x15e)+_0x8c1de2));const _0x31c020=await withSpinner('Starting\x20workflow\x20run...',()=>_0x42f6dd[_0x233d34(0x149)]['run'](_0x162c1b,_0x1a692a,{'sessionTime':_0x8c1de2}),{'verbose':_0x204382[_0x233d34(0x163)]}),_0xda3f31=_0x31c020[_0x233d34(0xeb)];return console[_0x233d34(0xf1)](_0x233d34(0x16a)),console[_0x233d34(0xf1)]('\x20\x20Attempt\x20ID:\x20'+_0xda3f31['id']),console[_0x233d34(0xf1)](_0x233d34(0x100)+_0xda3f31[_0x233d34(0x10b)]),console['error'](_0x233d34(0x151)+_0xda3f31['project']?.[_0x233d34(0x131)]),console[_0x233d34(0xf1)](_0x233d34(0x12c)+_0xda3f31[_0x233d34(0x149)]?.[_0x233d34(0x131)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a43_0x26092c(0x131)]=a43_0x26092c(0x129);[a43_0x26092c(0xe6)]=a43_0x26092c(0x153);async[a43_0x26092c(0xf6)](_0x238baa){const _0x53d218=a43_0x26092c,{options:_0x5c11d5,args:_0x28ed91,tdx:_0x176e97}=_0x238baa,_0x25fa9c=_0x28ed91[0x0],_0x529dc2=_0x28ed91[0x1]||'.';if(!_0x25fa9c)return console['error'](_0x53d218(0x12e)),console[_0x53d218(0xf1)](_0x53d218(0x107)),0x1;const _0x88aa6f=_0x5c11d5[_0x53d218(0x109)];_0x5c11d5[_0x53d218(0x163)]&&(console[_0x53d218(0xf1)](_0x53d218(0x139)+_0x25fa9c),console[_0x53d218(0xf1)](_0x53d218(0x162)+_0x529dc2),_0x88aa6f&&console[_0x53d218(0xf1)](_0x53d218(0x12d)+_0x88aa6f));const _0x1580e4=await withSpinner(_0x53d218(0x104)+_0x25fa9c+_0x53d218(0x101),()=>_0x176e97[_0x53d218(0x149)][_0x53d218(0x158)](_0x25fa9c,_0x529dc2,{'revision':_0x88aa6f}),{'verbose':_0x5c11d5[_0x53d218(0x163)]}),_0x59d734=_0x1580e4[_0x53d218(0xeb)];return console[_0x53d218(0xf1)]('✔\x20Downloaded\x20'+_0x59d734[_0x53d218(0x146)]),console[_0x53d218(0xf1)](_0x53d218(0xfe)+_0x59d734[_0x53d218(0x109)]),console[_0x53d218(0xf1)](_0x53d218(0x161)+_0x59d734[_0x53d218(0x124)]),console['error'](_0x53d218(0x10f)+_0x529dc2+'/'+_0x59d734[_0x53d218(0x146)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a43_0x26092c(0x131)]='workflow:push';[a43_0x26092c(0xe6)]=a43_0x26092c(0x16c);async[a43_0x26092c(0xf6)](_0x54dad8){const _0x2628e8=a43_0x26092c,{options:_0x2fa658,args:_0x228e0e,tdx:_0x5ab6fe}=_0x54dad8;let _0x30d8e9='.',_0x44820a=_0x2fa658[_0x2628e8(0x131)];if(_0x228e0e[0x0]){const {promises:_0x2c526f}=await import('fs');try{const _0x469d4b=await _0x2c526f[_0x2628e8(0x10c)](_0x228e0e[0x0]);if(_0x469d4b[_0x2628e8(0x14b)]())_0x30d8e9=_0x228e0e[0x0];else return console[_0x2628e8(0xf1)](_0x2628e8(0xf5)+_0x228e0e[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x44820a=_0x228e0e[0x0],_0x30d8e9='.';}}const _0x341601=_0x2fa658['revision'],_0x2afda6=_0x2fa658[_0x2628e8(0x116)];_0x2fa658[_0x2628e8(0x163)]&&(console['error'](_0x2628e8(0xde)+_0x30d8e9),_0x44820a&&console[_0x2628e8(0xf1)](_0x2628e8(0x108)+_0x44820a),_0x341601&&console[_0x2628e8(0xf1)](_0x2628e8(0x12d)+_0x341601),_0x2afda6&&console[_0x2628e8(0xf1)](_0x2628e8(0x103)));const _0x142270=await withSpinner(_0x2628e8(0x172),()=>_0x5ab6fe[_0x2628e8(0x149)]['push'](_0x30d8e9,{'projectName':_0x44820a,'revision':_0x341601,'skipValidation':_0x2afda6}),{'verbose':_0x2fa658[_0x2628e8(0x163)]}),_0x15b200=_0x142270[_0x2628e8(0xeb)];return console[_0x2628e8(0xf1)](_0x2628e8(0x13f)+_0x15b200['projectName']),console['error'](_0x2628e8(0xdd)+_0x15b200[_0x2628e8(0x11a)]),console[_0x2628e8(0xf1)](_0x2628e8(0xfe)+_0x15b200['revision']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a43_0x26092c(0x13e);[a43_0x26092c(0xe6)]=a43_0x26092c(0x155);async[a43_0x26092c(0xf6)](_0x598ec3){const _0x14d99d=a43_0x26092c,{options:_0x11431d,args:_0x4968da,tdx:_0x2dbce2}=_0x598ec3,_0xce6355=_0x4968da[0x0];if(!_0xce6355)return console[_0x14d99d(0xf1)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x14d99d(0xd5)),0x1;_0x11431d[_0x14d99d(0x163)]&&console[_0x14d99d(0xf1)](_0x14d99d(0x139)+_0xce6355);if(!_0x11431d[_0x14d99d(0x11e)]){const _0x4f04bf=await confirm(_0x14d99d(0xd8)+_0xce6355+_0x14d99d(0x120));if(!_0x4f04bf)return console[_0x14d99d(0xf1)](_0x14d99d(0x121)),0x0;}const _0x4ff4c1=await withSpinner(_0x14d99d(0x127)+_0xce6355+_0x14d99d(0x101),()=>_0x2dbce2[_0x14d99d(0x149)][_0x14d99d(0x113)](_0xce6355),{'verbose':_0x11431d[_0x14d99d(0x163)]}),_0xbf1e02=_0x4ff4c1['data'];return console['error'](_0x14d99d(0x170)+_0xbf1e02[_0x14d99d(0x146)]),console[_0x14d99d(0xf1)](_0x14d99d(0xdd)+_0xbf1e02[_0x14d99d(0x11a)]),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1a3189,_0x1541f8){const _0xfb166b=a44_0x471d,_0x53f0c9=_0x1a3189();while(!![]){try{const _0x25d40e=parseInt(_0xfb166b(0x114))/0x1+parseInt(_0xfb166b(0x128))/0x2*(parseInt(_0xfb166b(0x11e))/0x3)+parseInt(_0xfb166b(0x123))/0x4*(-parseInt(_0xfb166b(0x124))/0x5)+-parseInt(_0xfb166b(0x119))/0x6*(-parseInt(_0xfb166b(0x126))/0x7)+parseInt(_0xfb166b(0x118))/0x8+-parseInt(_0xfb166b(0x11a))/0x9+-parseInt(_0xfb166b(0x129))/0xa;if(_0x25d40e===_0x1541f8)break;else _0x53f0c9['push'](_0x53f0c9['shift']());}catch(_0x59bc6c){_0x53f0c9['push'](_0x53f0c9['shift']());}}}(a44_0x54bf,0x9427c));import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';function a44_0x54bf(){const _0x5e47bb=['313820cSQxFX','utf-8','length','tdx/','8412856cPHwqT','18YaCfuX','3019725HNESvW','0.0.0','X-Trino-User','tdx','1695iojuos','TD1\x20','Authorization','parse','entries','1272geOZPc','7905iiyuRL','version','850976kmeTwa','replace','688GqCbJQ','4793640ukYAnq'];a44_0x54bf=function(){return _0x5e47bb;};return a44_0x54bf();}import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x8193b6=a44_0x471d;try{const _0x28381a=fileURLToPath(import.meta.url),_0x1fac34=dirname(_0x28381a),_0x3e0d21=join(_0x1fac34,'../../package.json'),_0xe4db34=JSON[_0x8193b6(0x121)](readFileSync(_0x3e0d21,_0x8193b6(0x115)));return _0xe4db34[_0x8193b6(0x125)];}catch{return _0x8193b6(0x11b);}}function a44_0x471d(_0x273218,_0x4df715){_0x273218=_0x273218-0x114;const _0x54bf09=a44_0x54bf();let _0x471d27=_0x54bf09[_0x273218];return _0x471d27;}export function getUserAgent(){const _0x43e286=a44_0x471d,_0x177729=getVersion(),_0x1acbf4=platform(),_0x3eef4b=process['version'][_0x43e286(0x127)]('v','');return _0x43e286(0x117)+_0x177729+'\x20('+_0x1acbf4+';\x20node/'+_0x3eef4b+')';}export function getAuthHeaders(_0xd54a30,_0x52ce9a){const _0x2e0085=a44_0x471d,_0xca107f=getVersion(),_0x10a9e3={'User-Agent':getUserAgent(),'X-TD-Client':_0x2e0085(0x11d),'X-TD-Client-Version':_0xca107f};return _0x52ce9a&&(_0x10a9e3[_0x2e0085(0x120)]=_0x2e0085(0x11f)+_0x52ce9a),_0x10a9e3;}export function toHeaderRecord(_0x2e377c){const _0x4f206f=a44_0x471d,_0x84bbf0={};for(const [_0x570a6a,_0x428501]of Object[_0x4f206f(0x122)](_0x2e377c)){_0x428501!==undefined&&(_0x84bbf0[_0x570a6a]=_0x428501);}return _0x84bbf0;}export function getTrinoHeaders(_0x259a78,_0x30a129){const _0x32f342=a44_0x471d,_0x59b1a2=getAuthHeaders(_0x259a78,_0x30a129),_0x3e1fb0=toHeaderRecord(_0x59b1a2);return delete _0x3e1fb0[_0x32f342(0x120)],_0x30a129&&(_0x3e1fb0[_0x32f342(0x11c)]=_0x30a129),_0x3e1fb0;}export function hasAPIKey(_0x289309){const _0x2121a6=a44_0x471d,_0x2baf70=getAPIKey(_0x289309);return _0x2baf70!==undefined&&_0x2baf70[_0x2121a6(0x116)]>0x0;}
|
package/dist/core/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x178263,_0x5f3583){const _0x2e5816=a45_0x1f0c,_0x3a8407=_0x178263();while(!![]){try{const _0x2cb81e=parseInt(_0x2e5816(0x14d))/0x1+parseInt(_0x2e5816(0x163))/0x2*(parseInt(_0x2e5816(0x140))/0x3)+-parseInt(_0x2e5816(0x139))/0x4+parseInt(_0x2e5816(0x153))/0x5+-parseInt(_0x2e5816(0x158))/0x6*(parseInt(_0x2e5816(0x164))/0x7)+-parseInt(_0x2e5816(0x165))/0x8*(parseInt(_0x2e5816(0x123))/0x9)+-parseInt(_0x2e5816(0x14b))/0xa*(-parseInt(_0x2e5816(0x14f))/0xb);if(_0x2cb81e===_0x5f3583)break;else _0x3a8407['push'](_0x3a8407['shift']());}catch(_0x154ec3){_0x3a8407['push'](_0x3a8407['shift']());}}}(a45_0x25cc,0x3d571));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a45_0x21762c from'node:fs';import*as a45_0x624711 from'node:path';import{SITE_ALIASES}from'../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 a45_0x49209b from'chalk';export function getConfigDir(){const _0x329e0a=a45_0x1f0c;return process[_0x329e0a(0x120)][_0x329e0a(0x162)]||join(homedir(),_0x329e0a(0x131),_0x329e0a(0x121));}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getConfigFilePath(_0x51a856){const _0x4fa4e0=a45_0x1f0c,_0x4e4a89=getConfigDir();return _0x51a856?a45_0x624711[_0x4fa4e0(0x15a)](_0x4e4a89,'.env.'+_0x51a856):getConfigFile();}export function getCacheDir(){const _0x359b12=a45_0x1f0c;return process[_0x359b12(0x120)][_0x359b12(0x155)]||join(homedir(),_0x359b12(0x125),_0x359b12(0x121));}export function getLLMProjectCacheFile(_0x1fe77d){const _0x1dd3a9=a45_0x1f0c,_0x1065af=_0x1fe77d?'llm_default_project.'+_0x1fe77d:_0x1dd3a9(0x13b);return join(getCacheDir(),_0x1065af);}export function readCachedLLMProject(_0x2e2003){const _0x1bc534=a45_0x1f0c;try{const _0x2044be=getLLMProjectCacheFile(_0x2e2003);if(!existsSync(_0x2044be))return null;const _0x2b5533=readFileSync(_0x2044be,_0x1bc534(0x124))[_0x1bc534(0x15d)]();try{const _0x4f26f2=JSON[_0x1bc534(0x126)](_0x2b5533);if(_0x4f26f2&&typeof _0x4f26f2['id']===_0x1bc534(0x166)&&typeof _0x4f26f2[_0x1bc534(0x160)]===_0x1bc534(0x166))return _0x4f26f2;}catch{}return null;}catch{return null;}}function a45_0x1f0c(_0x41965e,_0x58c560){_0x41965e=_0x41965e-0x11f;const _0x25cc50=a45_0x25cc();let _0x1f0c38=_0x25cc50[_0x41965e];return _0x1f0c38;}export function writeCachedLLMProject(_0x56b2e3,_0x44bce9,_0x4e154d){const _0x21bd55=a45_0x1f0c;try{const _0x5191db=getCacheDir(),_0x56572b=getLLMProjectCacheFile(_0x4e154d);!existsSync(_0x5191db)&&mkdirSync(_0x5191db,{'recursive':!![]});const _0x184e2d={'name':_0x56b2e3,'id':_0x44bce9};writeFileSync(_0x56572b,JSON[_0x21bd55(0x135)](_0x184e2d),_0x21bd55(0x124));}catch{}}export function getAccountInfoCacheFile(_0x8113a2){const _0x23260f=a45_0x1f0c,_0x143a30=_0x8113a2?'account_info.'+_0x8113a2+_0x23260f(0x128):'account_info.json';return join(getCacheDir(),_0x143a30);}export function readCachedAccountInfo(_0xe2c474){const _0x3c891f=a45_0x1f0c;try{const _0x573cfd=getAccountInfoCacheFile(_0xe2c474);if(!existsSync(_0x573cfd))return null;const _0xa5910e=readFileSync(_0x573cfd,_0x3c891f(0x124))[_0x3c891f(0x15d)](),_0x57beed=JSON['parse'](_0xa5910e);if(_0x57beed&&typeof _0x57beed[_0x3c891f(0x132)]===_0x3c891f(0x166)&&typeof _0x57beed[_0x3c891f(0x152)]===_0x3c891f(0x12c))return _0x57beed;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x260153,_0x51cd87,_0xdb76c9){const _0x2e2e2a=a45_0x1f0c;try{const _0x48f83e=getCacheDir(),_0x192be4=getAccountInfoCacheFile(_0xdb76c9);!existsSync(_0x48f83e)&&mkdirSync(_0x48f83e,{'recursive':!![]});const _0x1b6962={'site':_0x260153,'accountId':_0x51cd87,'cachedAt':new Date()[_0x2e2e2a(0x14c)]()};writeFileSync(_0x192be4,JSON[_0x2e2e2a(0x135)](_0x1b6962),'utf-8');}catch{}}export function parseEnvFile(_0x9dce26){const _0x573690=a45_0x1f0c,_0x5bab6f={};for(const _0x56749a of _0x9dce26[_0x573690(0x14a)]('\x0a')){const _0x71d4b6=_0x56749a[_0x573690(0x15d)]();if(!_0x71d4b6||_0x71d4b6['startsWith']('#'))continue;const _0x3ddca7=_0x71d4b6[_0x573690(0x14e)](/^([^=]+)=(.*)$/);if(_0x3ddca7){const _0x1c5d9=_0x3ddca7[0x1]['trim']();let _0x2e57ba=_0x3ddca7[0x2][_0x573690(0x15d)]();(_0x2e57ba[_0x573690(0x161)]('\x22')&&_0x2e57ba['endsWith']('\x22')||_0x2e57ba[_0x573690(0x161)]('\x27')&&_0x2e57ba['endsWith']('\x27'))&&(_0x2e57ba=_0x2e57ba[_0x573690(0x144)](0x1,-0x1)),_0x5bab6f[_0x1c5d9]=_0x2e57ba;}}return _0x5bab6f;}export function readUserConfig(){const _0x41ef74=a45_0x1f0c,_0xaffb0c=getConfigFile();if(!existsSync(_0xaffb0c))return{};try{const _0x29f0b8=readFileSync(_0xaffb0c,_0x41ef74(0x124));return parseEnvFile(_0x29f0b8);}catch(_0x382eeb){return console[_0x41ef74(0x12f)]('Warning:\x20Failed\x20to\x20read\x20config\x20file\x20'+_0xaffb0c+':',_0x382eeb),{};}}export function resolveSite(_0x1fedcd){const _0x318504=a45_0x1f0c,_0x52314e=['us01',_0x318504(0x15b),_0x318504(0x13e),'ap02','ap03','dev-us01',_0x318504(0x13a),_0x318504(0x12e),_0x318504(0x149),'stg-ap03'];if(_0x52314e[_0x318504(0x12b)](_0x1fedcd))return _0x1fedcd;if(_0x1fedcd in SITE_ALIASES)return SITE_ALIASES[_0x1fedcd];return console['warn']('Warning:\x20Unknown\x20site\x20\x27'+_0x1fedcd+'\x27,\x20defaulting\x20to\x20us01'),_0x318504(0x137);}function a45_0x25cc(){const _0x55285c=['TDX_API_KEY','2304066HqEBFy','TD_API_KEY','join','jp01','replace','trim','TD_API_KEY\x20env\x20var\x20(deprecated)','isDeprecated','name','startsWith','TDX_CONFIG_DIR','49186lfpJlH','7vyaaNy','2064VKMeJW','string','keychain','env','tdx','filter','621DnRaiT','utf-8','.cache','parse','TD_API_KEY_','.json','yellow','profiles','includes','number','.env.','stg-us01','warn','stg-ap03','.config','site','entries','TDX_API_KEY_','stringify','.env','us01','apiKeys','1873264odahzG','dev-eu01','llm_default_project','existsSync','map','eu01','some','45mmcIjo','ap02','TDX_API_KEY_<PROFILE>','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','slice','Warning:\x20Failed\x20to\x20load\x20','keychain\x20(profile:\x20','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','readFileSync','stg-jp01','split','290jOaqNP','toISOString','430803hhpXks','match','66451cevmTm','\x20env\x20var','toUpperCase','accountId','732455VliGus','Warning:\x20Failed\x20to\x20read\x20','TDX_CACHE_DIR','apiKey'];a45_0x25cc=function(){return _0x55285c;};return a45_0x25cc();}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0xfaa26a,_0xc269f){const _0x43a1a8=a45_0x1f0c,_0x4a5346=_0xc269f||getActiveProfileName();if(_0x4a5346){const _0x3cab79='TDX_API_KEY_'+normalizeProfileForEnvVar(_0x4a5346);if(process[_0x43a1a8(0x120)][_0x3cab79])return process[_0x43a1a8(0x120)][_0x3cab79];}if(process[_0x43a1a8(0x120)]['TDX_API_KEY'])return process[_0x43a1a8(0x120)][_0x43a1a8(0x157)];if(process['env'][_0x43a1a8(0x159)])return process[_0x43a1a8(0x120)][_0x43a1a8(0x159)];const _0x38acc4=_0xfaa26a['toUpperCase']()['replace'](/-/g,'_'),_0x226591='TD_API_KEY_'+_0x38acc4;if(_0x4a5346){const _0x2fe69f=loadProfileEnv(_0x4a5346);if(_0x2fe69f){if(_0x2fe69f[_0x226591])return _0x2fe69f[_0x226591];if(_0x2fe69f[_0x43a1a8(0x159)])return _0x2fe69f[_0x43a1a8(0x159)];}}const _0x413757=loadUserConfigOnce();if(_0x413757[_0x226591])return _0x413757[_0x226591];if(_0x413757[_0x43a1a8(0x159)])return _0x413757['TD_API_KEY'];return undefined;}export function normalizeProfileForEnvVar(_0x46a313){const _0x4cd6a7=a45_0x1f0c;return _0x46a313['toUpperCase']()[_0x4cd6a7(0x15c)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0xa291c1,_0xd255ae){const _0x377840=a45_0x1f0c,_0x305e1a=_0xd255ae||getActiveProfileName()||undefined;if(_0x305e1a){const _0x53b0f0=_0x377840(0x134)+normalizeProfileForEnvVar(_0x305e1a);if(process['env'][_0x53b0f0])return{'apiKey':process[_0x377840(0x120)][_0x53b0f0],'source':_0x53b0f0+_0x377840(0x150),'isDeprecated':![]};const _0x4325bc=getCachedCredential(_0xa291c1,_0x305e1a);if(_0x4325bc)return{'apiKey':_0x4325bc,'source':'keychain\x20(profile:\x20'+_0x305e1a+')','isDeprecated':![]};const _0x4caecb=await getKeychainAPIKey(_0x305e1a);if(_0x4caecb)return setCachedCredential(_0x4caecb,_0xa291c1,_0x305e1a),{'apiKey':_0x4caecb,'source':_0x377840(0x146)+_0x305e1a+')','isDeprecated':![]};}if(process[_0x377840(0x120)][_0x377840(0x157)])return{'apiKey':process['env']['TDX_API_KEY'],'source':'TDX_API_KEY\x20env\x20var','isDeprecated':![]};if(!_0x305e1a){const _0x49ed0e=getCachedCredential(_0xa291c1,undefined);if(_0x49ed0e)return{'apiKey':_0x49ed0e,'source':_0x377840(0x11f),'isDeprecated':![]};const _0x5c3fdd=await getKeychainAPIKey(undefined);if(_0x5c3fdd)return setCachedCredential(_0x5c3fdd,_0xa291c1,undefined),{'apiKey':_0x5c3fdd,'source':_0x377840(0x11f),'isDeprecated':![]};}if(process[_0x377840(0x120)][_0x377840(0x159)])return{'apiKey':process[_0x377840(0x120)][_0x377840(0x159)],'source':_0x377840(0x15e),'isDeprecated':!![]};const _0x5b1d02=getLegacyEnvAPIKey(_0xa291c1,_0x305e1a);if(_0x5b1d02){const _0x40e5b4=await isKeychainAvailable();if(_0x40e5b4)try{await saveKeychainAPIKey(_0x5b1d02,_0x305e1a),setCachedCredential(_0x5b1d02,_0xa291c1,_0x305e1a);const _0x14155a=getConfigFilePath(_0x305e1a);cleanupLegacyEnvFile(_0x14155a)&&console[_0x377840(0x12f)](a45_0x49209b['yellow']('⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage'));}catch(_0x1691d7){console['warn'](a45_0x49209b[_0x377840(0x129)]('⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20'+_0x1691d7));}const _0x2d0f8a=_0x305e1a?'legacy\x20.env\x20file\x20(profile:\x20'+_0x305e1a+')':'legacy\x20.env\x20file';return{'apiKey':_0x5b1d02,'source':_0x2d0f8a,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x257f64,_0x1e546a,_0x13b879=!![]){const _0x2b3bfe=a45_0x1f0c,_0x33db27=await resolveAPIKeyAsync(_0x257f64,_0x1e546a);if(!_0x33db27)return undefined;if(_0x13b879&&_0x33db27[_0x2b3bfe(0x15f)]&&_0x33db27['source']['includes'](_0x2b3bfe(0x159))){const _0x13cfe4=_0x1e546a||getActiveProfileName()||undefined,_0x4bf780=_0x13cfe4?'TDX_API_KEY_'+normalizeProfileForEnvVar(_0x13cfe4):_0x2b3bfe(0x142);console[_0x2b3bfe(0x12f)](a45_0x49209b[_0x2b3bfe(0x129)](_0x2b3bfe(0x147)+(_0x2b3bfe(0x143)+_0x4bf780+').')));}return _0x33db27[_0x2b3bfe(0x156)];}function getLegacyEnvAPIKey(_0x5bb65e,_0x10aa58){const _0x3a9e36=a45_0x1f0c,_0x3a5f1c=_0x5bb65e['toUpperCase']()[_0x3a9e36(0x15c)](/-/g,'_'),_0x52358e=_0x3a9e36(0x127)+_0x3a5f1c;if(_0x10aa58){const _0x1fa663=loadProfileEnv(_0x10aa58);if(_0x1fa663){if(_0x1fa663[_0x52358e])return _0x1fa663[_0x52358e];if(_0x1fa663[_0x3a9e36(0x159)])return _0x1fa663[_0x3a9e36(0x159)];}}const _0x153317=loadUserConfigOnce();if(_0x153317[_0x52358e])return _0x153317[_0x52358e];if(_0x153317[_0x3a9e36(0x159)])return _0x153317[_0x3a9e36(0x159)];return undefined;}function cleanupLegacyEnvFile(_0x21d05d){const _0xce67c4=a45_0x1f0c;if(!existsSync(_0x21d05d))return![];try{const _0x3d4128=readFileSync(_0x21d05d,_0xce67c4(0x124)),_0x28249b=_0x3d4128[_0xce67c4(0x14a)]('\x0a'),_0x4aa030=_0x28249b[_0xce67c4(0x122)](_0x2052e7=>{const _0x55702d=_0xce67c4,_0x4a61a5=_0x2052e7[_0x55702d(0x15d)]();if(!_0x4a61a5||_0x4a61a5[_0x55702d(0x161)]('#'))return!![];const [_0x401ed7]=_0x4a61a5[_0x55702d(0x14a)]('=');return!_0x401ed7[_0x55702d(0x161)](_0x55702d(0x159));}),_0x35c7bd=_0x4aa030[_0xce67c4(0x13f)](_0x2d9e2f=>{const _0x317cdf=_0xce67c4,_0x42681a=_0x2d9e2f[_0x317cdf(0x15d)]();return _0x42681a&&!_0x42681a['startsWith']('#');});if(!_0x35c7bd)return unlinkSync(_0x21d05d),!![];return writeFileSync(_0x21d05d,_0x4aa030['join']('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x3d97ac){const _0x50ccac=a45_0x1f0c,_0x461ad2=a45_0x624711[_0x50ccac(0x15a)](getConfigDir(),_0x50ccac(0x12d)+_0x3d97ac);if(a45_0x21762c['existsSync'](_0x461ad2)){validateSecureFilePermissions(_0x461ad2);try{const _0x33ef52=a45_0x21762c['readFileSync'](_0x461ad2,_0x50ccac(0x124));return parseEnvFile(_0x33ef52);}catch(_0x3ded82){console[_0x50ccac(0x12f)](_0x50ccac(0x145)+_0x461ad2+':\x20'+_0x3ded82);}}const _0x446a43=a45_0x624711['join'](getConfigDir(),_0x50ccac(0x12a),_0x3d97ac,_0x50ccac(0x136));if(a45_0x21762c[_0x50ccac(0x13c)](_0x446a43)){validateSecureFilePermissions(_0x446a43);try{const _0x599ced=a45_0x21762c[_0x50ccac(0x148)](_0x446a43,'utf-8');return parseEnvFile(_0x599ced);}catch(_0x5a77e7){return console[_0x50ccac(0x12f)](_0x50ccac(0x145)+_0x446a43+':\x20'+_0x5a77e7),null;}}return null;}function getActiveProfileName(){const _0x2fc700=a45_0x1f0c,_0x3fa75f=a45_0x624711[_0x2fc700(0x15a)](getConfigDir(),'tdx.json');if(!a45_0x21762c['existsSync'](_0x3fa75f))return null;try{const _0xed2699=a45_0x21762c[_0x2fc700(0x148)](_0x3fa75f,_0x2fc700(0x124)),_0x5b0552=JSON[_0x2fc700(0x126)](_0xed2699);return _0x5b0552['profile']||null;}catch{return null;}}export function saveAPIKey(_0x36ab57,_0x39cef4,_0x40e312){const _0x312abc=a45_0x1f0c,_0x3a8897=getConfigDir(),_0x1cc7b8=getConfigFilePath(_0x40e312);!existsSync(_0x3a8897)&&mkdirSync(_0x3a8897,{'recursive':!![],'mode':0x1c0});let _0x448952={};if(existsSync(_0x1cc7b8))try{const _0x229b43=readFileSync(_0x1cc7b8,_0x312abc(0x124));_0x448952=parseEnvFile(_0x229b43);}catch(_0x53af44){console[_0x312abc(0x12f)](_0x312abc(0x154)+_0x1cc7b8+':',_0x53af44);}const _0x2ee64c=_0x36ab57[_0x312abc(0x151)]()[_0x312abc(0x15c)](/-/g,'_');_0x448952[_0x312abc(0x127)+_0x2ee64c]=_0x39cef4;const _0x14ef56=Object[_0x312abc(0x133)](_0x448952)[_0x312abc(0x13d)](([_0x9ae471,_0x134aa2])=>_0x9ae471+'='+_0x134aa2);writeFileSync(_0x1cc7b8,_0x14ef56[_0x312abc(0x15a)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x5cc93d,_0x3b45f7,_0x5d85da){const _0x3588b6=a45_0x1f0c;await saveKeychainAPIKey(_0x5cc93d,_0x5d85da),setCachedCredential(_0x5cc93d,_0x3b45f7,_0x5d85da);const _0x5d5a80=getConfigFilePath(_0x5d85da);cleanupLegacyEnvFile(_0x5d5a80)&&console[_0x3588b6(0x12f)](a45_0x49209b[_0x3588b6(0x129)]('⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file'));}export function loadConfig(){const _0x2fe702=a45_0x1f0c,_0x59eb8b={'apiKeys':{},'defaultSite':_0x2fe702(0x137)},_0xa311e8=[_0x2fe702(0x137),'jp01','eu01',_0x2fe702(0x141),'ap03','dev-us01',_0x2fe702(0x13a),_0x2fe702(0x12e),_0x2fe702(0x149),_0x2fe702(0x130)];for(const _0x278149 of _0xa311e8){const _0x49b73c=getAPIKey(_0x278149);_0x49b73c&&(_0x59eb8b[_0x2fe702(0x138)][_0x278149]=_0x49b73c);}return _0x59eb8b;}
|
|
1
|
+
(function(_0x52fbef,_0xae2636){const _0x79e5ff=a45_0x8daa,_0x46b9dd=_0x52fbef();while(!![]){try{const _0x3404ac=-parseInt(_0x79e5ff(0x128))/0x1+-parseInt(_0x79e5ff(0x14d))/0x2+parseInt(_0x79e5ff(0x109))/0x3*(-parseInt(_0x79e5ff(0x123))/0x4)+-parseInt(_0x79e5ff(0x153))/0x5*(-parseInt(_0x79e5ff(0x13e))/0x6)+parseInt(_0x79e5ff(0x12a))/0x7*(parseInt(_0x79e5ff(0x152))/0x8)+parseInt(_0x79e5ff(0x144))/0x9*(-parseInt(_0x79e5ff(0x129))/0xa)+parseInt(_0x79e5ff(0x116))/0xb*(parseInt(_0x79e5ff(0x111))/0xc);if(_0x3404ac===_0xae2636)break;else _0x46b9dd['push'](_0x46b9dd['shift']());}catch(_0x4f67b3){_0x46b9dd['push'](_0x46b9dd['shift']());}}}(a45_0x3d5f,0xd1cbb));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a45_0x45aaad from'node:fs';import*as a45_0x364fa5 from'node:path';import{SITE_ALIASES}from'../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 a45_0x19930c from'chalk';export function getConfigDir(){const _0x1ee5eb=a45_0x8daa;return process[_0x1ee5eb(0x107)][_0x1ee5eb(0x10c)]||join(homedir(),_0x1ee5eb(0x14b),_0x1ee5eb(0x131));}export function getConfigFile(){const _0x124bba=a45_0x8daa;return join(getConfigDir(),_0x124bba(0x125));}export function getConfigFilePath(_0x787bb4){const _0x594c51=a45_0x8daa,_0x44aa61=getConfigDir();return _0x787bb4?a45_0x364fa5[_0x594c51(0x11c)](_0x44aa61,'.env.'+_0x787bb4):getConfigFile();}function a45_0x3d5f(){const _0x1b3199=['llm_default_project.','number','.config','profiles','1881000Zqxtom','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','TDX_API_KEY_','keychain\x20(profile:\x20','keychain','2184uLSiHX','5BQawQN','account_info.','\x20env\x20var','env','TD_API_KEY_','102iYNIar','split','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','TDX_CONFIG_DIR','TDX_API_KEY\x20env\x20var','dev-eu01','accountId','ap02','3348564wtmdWg','trim','yellow','TDX_API_KEY','apiKey','99wYMNPy','isDeprecated','existsSync','startsWith','.json','ap03','join','toUpperCase','map','replace','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','legacy\x20.env\x20file\x20(profile:\x20','.env.','111868ccFauT','llm_default_project','.env','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','source','173076jaeznL','4632120jUvQEk','4501PXdyQS','site','.cache','us01','warn','TD_API_KEY\x20env\x20var\x20(deprecated)','Warning:\x20Failed\x20to\x20read\x20','tdx','stringify','parse','TDX_CACHE_DIR','name','stg-us01','utf-8','Warning:\x20Unknown\x20site\x20\x27','jp01','includes','toISOString','string','TD_API_KEY','6979434uWondX','stg-jp01','stg-ap03','entries','endsWith','profile','18lYiOuG','readFileSync','filter','eu01','dev-us01'];a45_0x3d5f=function(){return _0x1b3199;};return a45_0x3d5f();}export function getCacheDir(){const _0x1d64a7=a45_0x8daa;return process[_0x1d64a7(0x107)][_0x1d64a7(0x134)]||join(homedir(),_0x1d64a7(0x12c),_0x1d64a7(0x131));}export function getLLMProjectCacheFile(_0x39d0a2){const _0xcb1c61=a45_0x8daa,_0x1eb846=_0x39d0a2?_0xcb1c61(0x149)+_0x39d0a2:_0xcb1c61(0x124);return join(getCacheDir(),_0x1eb846);}export function readCachedLLMProject(_0x54b886){const _0x542531=a45_0x8daa;try{const _0x1228d4=getLLMProjectCacheFile(_0x54b886);if(!existsSync(_0x1228d4))return null;const _0x2dcf6e=readFileSync(_0x1228d4,_0x542531(0x137))['trim']();try{const _0xdcce64=JSON[_0x542531(0x133)](_0x2dcf6e);if(_0xdcce64&&typeof _0xdcce64['id']===_0x542531(0x13c)&&typeof _0xdcce64[_0x542531(0x135)]===_0x542531(0x13c))return _0xdcce64;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x190967,_0x133ca8,_0x1cf823){const _0x49e5db=a45_0x8daa;try{const _0x4381de=getCacheDir(),_0x3e2383=getLLMProjectCacheFile(_0x1cf823);!existsSync(_0x4381de)&&mkdirSync(_0x4381de,{'recursive':!![]});const _0x57594e={'name':_0x190967,'id':_0x133ca8};writeFileSync(_0x3e2383,JSON['stringify'](_0x57594e),_0x49e5db(0x137));}catch{}}export function getAccountInfoCacheFile(_0xa1c736){const _0x57cd5f=a45_0x8daa,_0x380214=_0xa1c736?_0x57cd5f(0x154)+_0xa1c736+_0x57cd5f(0x11a):'account_info.json';return join(getCacheDir(),_0x380214);}export function readCachedAccountInfo(_0x4f7b14){const _0x4cdcd7=a45_0x8daa;try{const _0x1da536=getAccountInfoCacheFile(_0x4f7b14);if(!existsSync(_0x1da536))return null;const _0x3e6f9e=readFileSync(_0x1da536,_0x4cdcd7(0x137))[_0x4cdcd7(0x112)](),_0x14c562=JSON[_0x4cdcd7(0x133)](_0x3e6f9e);if(_0x14c562&&typeof _0x14c562[_0x4cdcd7(0x12b)]===_0x4cdcd7(0x13c)&&typeof _0x14c562[_0x4cdcd7(0x10f)]===_0x4cdcd7(0x14a))return _0x14c562;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x4dd6ee,_0x5b8e67,_0x316e8d){const _0x355cb3=a45_0x8daa;try{const _0x4655f0=getCacheDir(),_0x5739a2=getAccountInfoCacheFile(_0x316e8d);!existsSync(_0x4655f0)&&mkdirSync(_0x4655f0,{'recursive':!![]});const _0xd5b045={'site':_0x4dd6ee,'accountId':_0x5b8e67,'cachedAt':new Date()[_0x355cb3(0x13b)]()};writeFileSync(_0x5739a2,JSON[_0x355cb3(0x132)](_0xd5b045),'utf-8');}catch{}}export function parseEnvFile(_0xb50d75){const _0x24791f=a45_0x8daa,_0x5974fc={};for(const _0xadd129 of _0xb50d75['split']('\x0a')){const _0x3783f4=_0xadd129[_0x24791f(0x112)]();if(!_0x3783f4||_0x3783f4['startsWith']('#'))continue;const _0x5698b2=_0x3783f4['match'](/^([^=]+)=(.*)$/);if(_0x5698b2){const _0x319e88=_0x5698b2[0x1][_0x24791f(0x112)]();let _0x9f0dd1=_0x5698b2[0x2][_0x24791f(0x112)]();(_0x9f0dd1[_0x24791f(0x119)]('\x22')&&_0x9f0dd1[_0x24791f(0x142)]('\x22')||_0x9f0dd1[_0x24791f(0x119)]('\x27')&&_0x9f0dd1[_0x24791f(0x142)]('\x27'))&&(_0x9f0dd1=_0x9f0dd1['slice'](0x1,-0x1)),_0x5974fc[_0x319e88]=_0x9f0dd1;}}return _0x5974fc;}export function readUserConfig(){const _0x2ce988=a45_0x8daa,_0x2026c5=getConfigFile();if(!existsSync(_0x2026c5))return{};try{const _0x4eca22=readFileSync(_0x2026c5,'utf-8');return parseEnvFile(_0x4eca22);}catch(_0x3d6e16){return console[_0x2ce988(0x12e)](_0x2ce988(0x10b)+_0x2026c5+':',_0x3d6e16),{};}}export function resolveSite(_0x3329a0){const _0xb73ff4=a45_0x8daa,_0x51aaca=[_0xb73ff4(0x12d),_0xb73ff4(0x139),_0xb73ff4(0x147),'ap02','ap03',_0xb73ff4(0x148),_0xb73ff4(0x10e),_0xb73ff4(0x136),_0xb73ff4(0x13f),_0xb73ff4(0x140)];if(_0x51aaca[_0xb73ff4(0x13a)](_0x3329a0))return _0x3329a0;if(_0x3329a0 in SITE_ALIASES)return SITE_ALIASES[_0x3329a0];return console[_0xb73ff4(0x12e)](_0xb73ff4(0x138)+_0x3329a0+'\x27,\x20defaulting\x20to\x20us01'),_0xb73ff4(0x12d);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x4244a9,_0x4d7ff4){const _0x2461a8=a45_0x8daa,_0x5a1f8e=_0x4d7ff4||getActiveProfileName();if(_0x5a1f8e){const _0x54e29d=_0x2461a8(0x14f)+normalizeProfileForEnvVar(_0x5a1f8e);if(process[_0x2461a8(0x107)][_0x54e29d])return process[_0x2461a8(0x107)][_0x54e29d];}if(process[_0x2461a8(0x107)][_0x2461a8(0x114)])return process[_0x2461a8(0x107)][_0x2461a8(0x114)];if(process[_0x2461a8(0x107)]['TD_API_KEY'])return process[_0x2461a8(0x107)][_0x2461a8(0x13d)];const _0x239085=_0x4244a9[_0x2461a8(0x11d)]()[_0x2461a8(0x11f)](/-/g,'_'),_0x2272ac=_0x2461a8(0x108)+_0x239085;if(_0x5a1f8e){const _0x211640=loadProfileEnv(_0x5a1f8e);if(_0x211640){if(_0x211640[_0x2272ac])return _0x211640[_0x2272ac];if(_0x211640[_0x2461a8(0x13d)])return _0x211640['TD_API_KEY'];}}const _0x47c92b=loadUserConfigOnce();if(_0x47c92b[_0x2272ac])return _0x47c92b[_0x2272ac];if(_0x47c92b['TD_API_KEY'])return _0x47c92b['TD_API_KEY'];return undefined;}function a45_0x8daa(_0x5d4706,_0x36f4e1){_0x5d4706=_0x5d4706-0x106;const _0x3d5f56=a45_0x3d5f();let _0x8daa6d=_0x3d5f56[_0x5d4706];return _0x8daa6d;}export function normalizeProfileForEnvVar(_0x1b6d5f){const _0x65d210=a45_0x8daa;return _0x1b6d5f[_0x65d210(0x11d)]()[_0x65d210(0x11f)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x316228,_0x9cb428){const _0x28cb8a=a45_0x8daa,_0x123a02=_0x9cb428||getActiveProfileName()||undefined;if(_0x123a02){const _0xedd9de=_0x28cb8a(0x14f)+normalizeProfileForEnvVar(_0x123a02);if(process['env'][_0xedd9de])return{'apiKey':process[_0x28cb8a(0x107)][_0xedd9de],'source':_0xedd9de+_0x28cb8a(0x106),'isDeprecated':![]};const _0x2a1849=getCachedCredential(_0x316228,_0x123a02);if(_0x2a1849)return{'apiKey':_0x2a1849,'source':_0x28cb8a(0x150)+_0x123a02+')','isDeprecated':![]};const _0x19fef7=await getKeychainAPIKey(_0x123a02);if(_0x19fef7)return setCachedCredential(_0x19fef7,_0x316228,_0x123a02),{'apiKey':_0x19fef7,'source':_0x28cb8a(0x150)+_0x123a02+')','isDeprecated':![]};}if(process[_0x28cb8a(0x107)][_0x28cb8a(0x114)])return{'apiKey':process[_0x28cb8a(0x107)]['TDX_API_KEY'],'source':_0x28cb8a(0x10d),'isDeprecated':![]};if(!_0x123a02){const _0x2b96e0=getCachedCredential(_0x316228,undefined);if(_0x2b96e0)return{'apiKey':_0x2b96e0,'source':_0x28cb8a(0x151),'isDeprecated':![]};const _0x4d3b13=await getKeychainAPIKey(undefined);if(_0x4d3b13)return setCachedCredential(_0x4d3b13,_0x316228,undefined),{'apiKey':_0x4d3b13,'source':'keychain','isDeprecated':![]};}if(process['env']['TD_API_KEY'])return{'apiKey':process[_0x28cb8a(0x107)][_0x28cb8a(0x13d)],'source':_0x28cb8a(0x12f),'isDeprecated':!![]};const _0x2f6295=getLegacyEnvAPIKey(_0x316228,_0x123a02);if(_0x2f6295){const _0x5d5d3b=await isKeychainAvailable();if(_0x5d5d3b)try{await saveKeychainAPIKey(_0x2f6295,_0x123a02),setCachedCredential(_0x2f6295,_0x316228,_0x123a02);const _0x43ad75=getConfigFilePath(_0x123a02);cleanupLegacyEnvFile(_0x43ad75)&&console[_0x28cb8a(0x12e)](a45_0x19930c['yellow'](_0x28cb8a(0x120)));}catch(_0x49cd65){console[_0x28cb8a(0x12e)](a45_0x19930c[_0x28cb8a(0x113)]('⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20'+_0x49cd65));}const _0x59ee0c=_0x123a02?_0x28cb8a(0x121)+_0x123a02+')':'legacy\x20.env\x20file';return{'apiKey':_0x2f6295,'source':_0x59ee0c,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x3d864d,_0x453461,_0x33e1a5=!![]){const _0x345bf1=a45_0x8daa,_0x595b43=await resolveAPIKeyAsync(_0x3d864d,_0x453461);if(!_0x595b43)return undefined;if(_0x33e1a5&&_0x595b43[_0x345bf1(0x117)]&&_0x595b43[_0x345bf1(0x127)][_0x345bf1(0x13a)](_0x345bf1(0x13d))){const _0x58c9ff=_0x453461||getActiveProfileName()||undefined,_0x3d9b56=_0x58c9ff?_0x345bf1(0x14f)+normalizeProfileForEnvVar(_0x58c9ff):'TDX_API_KEY_<PROFILE>';console['warn'](a45_0x19930c[_0x345bf1(0x113)](_0x345bf1(0x126)+('\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20'+_0x3d9b56+').')));}return _0x595b43[_0x345bf1(0x115)];}function getLegacyEnvAPIKey(_0x18e05b,_0x269aae){const _0xdf68fb=a45_0x8daa,_0x47a66c=_0x18e05b[_0xdf68fb(0x11d)]()[_0xdf68fb(0x11f)](/-/g,'_'),_0x2f8cd3=_0xdf68fb(0x108)+_0x47a66c;if(_0x269aae){const _0xb67a9d=loadProfileEnv(_0x269aae);if(_0xb67a9d){if(_0xb67a9d[_0x2f8cd3])return _0xb67a9d[_0x2f8cd3];if(_0xb67a9d[_0xdf68fb(0x13d)])return _0xb67a9d[_0xdf68fb(0x13d)];}}const _0x5a40f7=loadUserConfigOnce();if(_0x5a40f7[_0x2f8cd3])return _0x5a40f7[_0x2f8cd3];if(_0x5a40f7['TD_API_KEY'])return _0x5a40f7[_0xdf68fb(0x13d)];return undefined;}function cleanupLegacyEnvFile(_0x3aaa40){const _0x276699=a45_0x8daa;if(!existsSync(_0x3aaa40))return![];try{const _0x211bc4=readFileSync(_0x3aaa40,'utf-8'),_0x3a332f=_0x211bc4[_0x276699(0x10a)]('\x0a'),_0x3fd6a8=_0x3a332f[_0x276699(0x146)](_0x48b36d=>{const _0x330fd9=_0x276699,_0x6d802c=_0x48b36d[_0x330fd9(0x112)]();if(!_0x6d802c||_0x6d802c['startsWith']('#'))return!![];const [_0x11a476]=_0x6d802c[_0x330fd9(0x10a)]('=');return!_0x11a476[_0x330fd9(0x119)](_0x330fd9(0x13d));}),_0x26d99d=_0x3fd6a8['some'](_0x1f005c=>{const _0x1c9253=_0x276699,_0x5528c2=_0x1f005c[_0x1c9253(0x112)]();return _0x5528c2&&!_0x5528c2[_0x1c9253(0x119)]('#');});if(!_0x26d99d)return unlinkSync(_0x3aaa40),!![];return writeFileSync(_0x3aaa40,_0x3fd6a8[_0x276699(0x11c)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x5ee39b){const _0x3a1a9d=a45_0x8daa,_0x5d6a4a=a45_0x364fa5[_0x3a1a9d(0x11c)](getConfigDir(),_0x3a1a9d(0x122)+_0x5ee39b);if(a45_0x45aaad['existsSync'](_0x5d6a4a)){validateSecureFilePermissions(_0x5d6a4a);try{const _0x3ef1fe=a45_0x45aaad['readFileSync'](_0x5d6a4a,_0x3a1a9d(0x137));return parseEnvFile(_0x3ef1fe);}catch(_0x3438a6){console['warn']('Warning:\x20Failed\x20to\x20load\x20'+_0x5d6a4a+':\x20'+_0x3438a6);}}const _0x1c3a6f=a45_0x364fa5['join'](getConfigDir(),_0x3a1a9d(0x14c),_0x5ee39b,'.env');if(a45_0x45aaad[_0x3a1a9d(0x118)](_0x1c3a6f)){validateSecureFilePermissions(_0x1c3a6f);try{const _0x45318f=a45_0x45aaad['readFileSync'](_0x1c3a6f,'utf-8');return parseEnvFile(_0x45318f);}catch(_0x22c35b){return console['warn']('Warning:\x20Failed\x20to\x20load\x20'+_0x1c3a6f+':\x20'+_0x22c35b),null;}}return null;}function getActiveProfileName(){const _0x46967c=a45_0x8daa,_0x4bc1e5=a45_0x364fa5[_0x46967c(0x11c)](getConfigDir(),'tdx.json');if(!a45_0x45aaad['existsSync'](_0x4bc1e5))return null;try{const _0x3e03ba=a45_0x45aaad[_0x46967c(0x145)](_0x4bc1e5,_0x46967c(0x137)),_0x521cae=JSON[_0x46967c(0x133)](_0x3e03ba);return _0x521cae[_0x46967c(0x143)]||null;}catch{return null;}}export function saveAPIKey(_0x5724fa,_0x1a9385,_0xf0478c){const _0x23e7e9=a45_0x8daa,_0x3adf85=getConfigDir(),_0x52f85c=getConfigFilePath(_0xf0478c);!existsSync(_0x3adf85)&&mkdirSync(_0x3adf85,{'recursive':!![],'mode':0x1c0});let _0x800ff1={};if(existsSync(_0x52f85c))try{const _0x1a36a9=readFileSync(_0x52f85c,'utf-8');_0x800ff1=parseEnvFile(_0x1a36a9);}catch(_0x17ffc9){console['warn'](_0x23e7e9(0x130)+_0x52f85c+':',_0x17ffc9);}const _0x4b5220=_0x5724fa[_0x23e7e9(0x11d)]()['replace'](/-/g,'_');_0x800ff1['TD_API_KEY_'+_0x4b5220]=_0x1a9385;const _0x432c4a=Object[_0x23e7e9(0x141)](_0x800ff1)[_0x23e7e9(0x11e)](([_0xc9c8c5,_0x3b6437])=>_0xc9c8c5+'='+_0x3b6437);writeFileSync(_0x52f85c,_0x432c4a['join']('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x44c80c,_0x2a1c55,_0x27dc29){const _0x4193fa=a45_0x8daa;await saveKeychainAPIKey(_0x44c80c,_0x27dc29),setCachedCredential(_0x44c80c,_0x2a1c55,_0x27dc29);const _0xd9ca67=getConfigFilePath(_0x27dc29);cleanupLegacyEnvFile(_0xd9ca67)&&console[_0x4193fa(0x12e)](a45_0x19930c[_0x4193fa(0x113)](_0x4193fa(0x14e)));}export function loadConfig(){const _0x5f3006=a45_0x8daa,_0x23d776={'apiKeys':{},'defaultSite':_0x5f3006(0x12d)},_0x45cb65=[_0x5f3006(0x12d),_0x5f3006(0x139),_0x5f3006(0x147),_0x5f3006(0x110),_0x5f3006(0x11b),_0x5f3006(0x148),_0x5f3006(0x10e),_0x5f3006(0x136),_0x5f3006(0x13f),_0x5f3006(0x140)];for(const _0x5d2f8d of _0x45cb65){const _0x3cf8ba=getAPIKey(_0x5d2f8d);_0x3cf8ba&&(_0x23d776['apiKeys'][_0x5d2f8d]=_0x3cf8ba);}return _0x23d776;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x14f29c,_0x4a8109){const _0x1fd962=a46_0x14c8,_0xc8c52e=_0x14f29c();while(!![]){try{const _0x2de308=-parseInt(_0x1fd962(0xea))/0x1*(parseInt(_0x1fd962(0xec))/0x2)+-parseInt(_0x1fd962(0xe6))/0x3*(parseInt(_0x1fd962(0xf0))/0x4)+parseInt(_0x1fd962(0xe0))/0x5+parseInt(_0x1fd962(0xee))/0x6+parseInt(_0x1fd962(0xe9))/0x7+-parseInt(_0x1fd962(0xe2))/0x8*(parseInt(_0x1fd962(0xe4))/0x9)+parseInt(_0x1fd962(0xe5))/0xa;if(_0x2de308===_0x4a8109)break;else _0xc8c52e['push'](_0xc8c52e['shift']());}catch(_0x46ab98){_0xc8c52e['push'](_0xc8c52e['shift']());}}}(a46_0x226f,0xafe43));function a46_0x14c8(_0x2e6a26,_0x3004c9){_0x2e6a26=_0x2e6a26-0xe0;const _0x226fcd=a46_0x226f();let _0x14c8c7=_0x226fcd[_0x2e6a26];return _0x14c8c7;}import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';function a46_0x226f(){const _0x55611b=['130NoeUay','connections-','770184GZNtcv','default','692oajkCU','3983390ZYNplc','parse','8gPhuLc','.json','11191707ALkLFg','14130180pHSQiT','1791qIyRaB','now','connections','4773300jldxdi','14657iBZBVA','stringify'];a46_0x226f=function(){return _0x55611b;};return a46_0x226f();}import{getCacheDir}from'./config.js';function getCacheFilePath(_0x4923bf){const _0x55ff41=a46_0x14c8,_0x279b06=_0x4923bf||_0x55ff41(0xef);return join(getCacheDir(),_0x55ff41(0xed)+_0x279b06+_0x55ff41(0xe3));}export function loadCachedConnections(_0x32f7ab){const _0x37789c=a46_0x14c8,_0x27806d=getCacheFilePath(_0x32f7ab);if(!existsSync(_0x27806d))return null;try{const _0x13e025=readFileSync(_0x27806d,'utf-8'),_0x4d1bba=JSON[_0x37789c(0xe1)](_0x13e025);return _0x4d1bba[_0x37789c(0xe8)];}catch{return null;}}export function saveCachedConnections(_0x50218c,_0x4fc446){const _0x31709e=a46_0x14c8,_0x3ebb46=getCacheDir();!existsSync(_0x3ebb46)&&mkdirSync(_0x3ebb46,{'recursive':!![]});const _0x4aab17=getCacheFilePath(_0x50218c),_0x1dc588={'connections':_0x4fc446,'cachedAt':Date[_0x31709e(0xe7)]()};writeFileSync(_0x4aab17,JSON[_0x31709e(0xeb)](_0x1dc588,null,0x2),'utf-8');}export function clearConnectionCache(_0x5c4ad8){const _0x4a923d=getCacheFilePath(_0x5c4ad8);if(existsSync(_0x4a923d))try{unlinkSync(_0x4a923d);}catch{}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xd4783,_0x2388e3){const _0x3641da=a47_0x28ba,_0x197e28=_0xd4783();while(!![]){try{const _0x166d8e=-parseInt(_0x3641da(0x158))/0x1+-parseInt(_0x3641da(0x157))/0x2+-parseInt(_0x3641da(0x153))/0x3+parseInt(_0x3641da(0x14e))/0x4*(parseInt(_0x3641da(0x156))/0x5)+parseInt(_0x3641da(0x14f))/0x6*(-parseInt(_0x3641da(0x155))/0x7)+-parseInt(_0x3641da(0x14d))/0x8+parseInt(_0x3641da(0x152))/0x9;if(_0x166d8e===_0x2388e3)break;else _0x197e28['push'](_0x197e28['shift']());}catch(_0x41d0d6){_0x197e28['push'](_0x197e28['shift']());}}}(a47_0x1404,0x19d56));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x41a74f,_0xa2a323){const _0x5d3a4e=a47_0x28ba,_0x2a30bd=_0x41a74f||_0x5d3a4e(0x15a),_0x211b0e=_0xa2a323||'__default_profile__';return _0x2a30bd+':'+_0x211b0e;}function a47_0x28ba(_0x22ccb8,_0x23e67c){_0x22ccb8=_0x22ccb8-0x14d;const _0x1404c7=a47_0x1404();let _0x28bab3=_0x1404c7[_0x22ccb8];return _0x28bab3;}export function getCachedCredential(_0x192215,_0x12a7bb){const _0x26c874=a47_0x28ba,_0x5193b6=getCacheKey(_0x192215,_0x12a7bb),_0x5aa05a=cache[_0x26c874(0x151)](_0x5193b6);if(!_0x5aa05a)return null;if(Date[_0x26c874(0x15c)]()-_0x5aa05a['loadedAt']>CACHE_TTL_MS)return cache[_0x26c874(0x159)](_0x5193b6),null;return _0x5aa05a[_0x26c874(0x150)];}export function setCachedCredential(_0x3a2612,_0x7dde9c,_0x2085fa){const _0x4b1a6f=a47_0x28ba,_0x5562db=getCacheKey(_0x7dde9c,_0x2085fa);cache[_0x4b1a6f(0x15b)](_0x5562db,{'apiKey':_0x3a2612,'loadedAt':Date['now']()});}export function clearCredentialCache(){const _0x3ceb8d=a47_0x28ba;cache[_0x3ceb8d(0x154)]();}export function clearCachedCredential(_0x5363db,_0x226aad){const _0x4352cb=getCacheKey(_0x5363db,_0x226aad);cache['delete'](_0x4352cb);}function a47_0x1404(){const _0x331494=['4106448kgbJVN','244890GsTuXU','clear','164017gUDwKL','176705eqrxnm','47408miaXBu','69192iYzzAp','delete','__default_site__','set','now','1601128FJBOzs','16FPCkuJ','30JQKuJL','apiKey','get'];a47_0x1404=function(){return _0x331494;};return a47_0x1404();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a48_0x519476=a48_0xb504;(function(_0x1ebd11,_0x1b00a8){const _0x5b26cd=a48_0xb504,_0x3410d1=_0x1ebd11();while(!![]){try{const _0x5f58bb=parseInt(_0x5b26cd(0x1bd))/0x1+parseInt(_0x5b26cd(0x1ae))/0x2*(parseInt(_0x5b26cd(0x1af))/0x3)+-parseInt(_0x5b26cd(0x1b1))/0x4+parseInt(_0x5b26cd(0x1b7))/0x5*(parseInt(_0x5b26cd(0x18b))/0x6)+parseInt(_0x5b26cd(0x1aa))/0x7+-parseInt(_0x5b26cd(0x192))/0x8*(-parseInt(_0x5b26cd(0x197))/0x9)+-parseInt(_0x5b26cd(0x182))/0xa;if(_0x5f58bb===_0x1b00a8)break;else _0x3410d1['push'](_0x3410d1['shift']());}catch(_0x44cbb0){_0x3410d1['push'](_0x3410d1['shift']());}}}(a48_0x176b,0x62ba6));function a48_0x176b(){const _0x5b6bb2=['config','Project','apiKey','parentSegment','log','cliFlags','.json','Profile\x20Credentials','llm_project','default','605101wagJef','globalCredentials',':\x20none','sessionId','2VWLjSb','365751WTeJEK','utf-8','629568RwXjHD','verbose','INFO','loadGlobalConfig','profileCredentials','getParameters','580NhGthT','parent_segment','llmProject','site','project','resolveAPIKeyAsync','721767WXMBwf','Session','Global','profile','toString','segmentPath','16135770bcglXh','[context]','segment_path','.env','CLI\x20flag:\x20--','injectIntoOptions','entries','existsSync','tdx.json','23694auQOmS','display','us01','getSource','join','activeProfile','string','1574296zskZHs','profiles','database','session','readFileSync','36HaLtDD','configFiles','layers','\x0a[configuration\x20files]',':\x20none\x20(using\x20session:\x20','global','Profile','logLevel','parse'];a48_0x176b=function(){return _0x5b6bb2;};return a48_0x176b();}import{resolveSite,getAPIKey,getAPIKeyAsync,getConfigDir}from'./config.js';import{loadSessionContext,getCurrentSessionPID}from'./session.js';function a48_0xb504(_0xba10f4,_0x398603){_0xba10f4=_0xba10f4-0x17f;const _0x176b65=a48_0x176b();let _0xb5048a=_0x176b65[_0xba10f4];return _0xb5048a;}import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';import{getActiveProfile,loadProfile}from'./profile.js';import{LogLevel}from'../utils/tdx-logger.js';import*as a48_0x322a6 from'node:fs';import*as a48_0x194e36 from'node:path';export class GlobalContext{[a48_0x519476(0x1ba)];[a48_0x519476(0x194)];[a48_0x519476(0x1b8)];[a48_0x519476(0x184)];['llm_project'];['apiKey'];[a48_0x519476(0x1b2)];[a48_0x519476(0x19e)];['profile'];['layers'];[a48_0x519476(0x190)];[a48_0x519476(0x1ad)];[a48_0x519476(0x198)];constructor(_0x132f64){const _0x3d6ad9=a48_0x519476;this['sessionId']=_0x132f64[_0x3d6ad9(0x195)]||getCurrentSessionPID()[_0x3d6ad9(0x180)]();const _0x4b50a5=loadSessionContext(_0x132f64[_0x3d6ad9(0x195)]),_0x3fe58a=loadProjectConfig(),_0x4dd2f5=this[_0x3d6ad9(0x1b4)]();this[_0x3d6ad9(0x190)]=_0x132f64[_0x3d6ad9(0x17f)]||_0x4b50a5?.['profile']||_0x4dd2f5[_0x3d6ad9(0x17f)]||getActiveProfile();const _0x35bc2a=this['activeProfile']?loadProfile(this[_0x3d6ad9(0x190)]):null,_0x3de2d5=_0x1bd078=>{const _0x1d3199=_0x3d6ad9;if(!_0x1bd078)return{};const _0x2aba22=_0x1bd078,_0x9df060={};for(const [_0x5f59d4,_0x9ffff5]of Object[_0x1d3199(0x188)](_0x2aba22)){typeof _0x9ffff5===_0x1d3199(0x191)&&(_0x9df060[_0x5f59d4]=_0x9ffff5);}return _0x9df060;},_0x1124a6={};if(_0x132f64['site']&&_0x132f64['site']!==_0x3d6ad9(0x18d))_0x1124a6['site']=_0x132f64['site'];const _0x1673b8=_0x4b50a5?.[_0x3d6ad9(0x194)],_0x14eceb=_0x3fe58a?.['database'],_0x53dcee=_0x35bc2a?.['config']?.[_0x3d6ad9(0x194)],_0x467635=_0x4dd2f5[_0x3d6ad9(0x194)];_0x132f64[_0x3d6ad9(0x194)]&&(_0x132f64['database']!==_0x1673b8&&_0x132f64['database']!==_0x14eceb&&_0x132f64[_0x3d6ad9(0x194)]!==_0x53dcee&&_0x132f64[_0x3d6ad9(0x194)]!==_0x467635)&&(_0x1124a6['database']=_0x132f64['database']);if(_0x132f64[_0x3d6ad9(0x1a3)])_0x1124a6[_0x3d6ad9(0x1b8)]=_0x132f64[_0x3d6ad9(0x1a3)];if(_0x132f64['llmProject'])_0x1124a6[_0x3d6ad9(0x1a8)]=_0x132f64[_0x3d6ad9(0x1b9)];if(_0x132f64[_0x3d6ad9(0x17f)])_0x1124a6[_0x3d6ad9(0x17f)]=_0x132f64[_0x3d6ad9(0x17f)];this['layers']={'cliFlags':_0x1124a6,'session':_0x3de2d5(_0x4b50a5),'project':_0x3de2d5(_0x3fe58a),'profile':_0x3de2d5(_0x35bc2a?.[_0x3d6ad9(0x1a0)]),'global':_0x3de2d5(_0x4dd2f5)};const _0x49cefe={...this[_0x3d6ad9(0x199)][_0x3d6ad9(0x19c)],...this[_0x3d6ad9(0x199)][_0x3d6ad9(0x17f)],...this['layers'][_0x3d6ad9(0x1bb)],...this['layers'][_0x3d6ad9(0x195)],...this[_0x3d6ad9(0x199)][_0x3d6ad9(0x1a5)]},_0x351ee8=_0x49cefe['site']||_0x3d6ad9(0x18d);this[_0x3d6ad9(0x1ba)]=resolveSite(_0x351ee8),this[_0x3d6ad9(0x194)]=_0x49cefe['database'],this[_0x3d6ad9(0x1b8)]=_0x49cefe['parent_segment'],this[_0x3d6ad9(0x184)]=_0x49cefe[_0x3d6ad9(0x184)],this[_0x3d6ad9(0x1a8)]=_0x49cefe[_0x3d6ad9(0x1a8)],this[_0x3d6ad9(0x1b2)]=_0x132f64['verbose']||![],this[_0x3d6ad9(0x19e)]=_0x132f64[_0x3d6ad9(0x19e)]??LogLevel[_0x3d6ad9(0x1b3)],this[_0x3d6ad9(0x17f)]=this[_0x3d6ad9(0x190)]||undefined,this[_0x3d6ad9(0x1a2)]=getAPIKey(this[_0x3d6ad9(0x1ba)],this[_0x3d6ad9(0x190)]||undefined);const _0x118b04=getConfigDir(),_0xd93972=a48_0x194e36[_0x3d6ad9(0x18f)](_0x118b04,'sessions',this[_0x3d6ad9(0x1ad)]+_0x3d6ad9(0x1a6)),_0x305c82=findProjectConfigPath(),_0x3f5863=a48_0x194e36[_0x3d6ad9(0x18f)](_0x118b04,_0x3d6ad9(0x18a)),_0x4a29ae=a48_0x194e36[_0x3d6ad9(0x18f)](_0x118b04,_0x3d6ad9(0x185));let _0x47fbd2=null,_0x1bcb6c=null;this[_0x3d6ad9(0x190)]&&(_0x47fbd2=a48_0x194e36['join'](_0x118b04,_0x3d6ad9(0x193),this['activeProfile'],_0x3d6ad9(0x18a)),_0x1bcb6c=a48_0x194e36[_0x3d6ad9(0x18f)](_0x118b04,_0x3d6ad9(0x193),this['activeProfile'],_0x3d6ad9(0x185))),this[_0x3d6ad9(0x198)]={'session':a48_0x322a6[_0x3d6ad9(0x189)](_0xd93972)?_0xd93972:null,'project':_0x305c82,'profile':_0x47fbd2&&a48_0x322a6[_0x3d6ad9(0x189)](_0x47fbd2)?_0x47fbd2:null,'profileCredentials':_0x1bcb6c&&a48_0x322a6['existsSync'](_0x1bcb6c)?_0x1bcb6c:null,'global':a48_0x322a6[_0x3d6ad9(0x189)](_0x3f5863)?_0x3f5863:null,'globalCredentials':a48_0x322a6[_0x3d6ad9(0x189)](_0x4a29ae)?_0x4a29ae:null};}[a48_0x519476(0x18e)](_0x4c5517,_0x4c70a5){const _0x112070=a48_0x519476;if(!_0x4c70a5)return'not\x20set';const _0xfd9081=_0x4c70a5;if(this[_0x112070(0x199)][_0x112070(0x1a5)][_0x4c5517]===_0xfd9081){if(_0x4c5517===_0x112070(0x1ba)&&_0xfd9081===_0x112070(0x18d)&&!this['layers'][_0x112070(0x195)][_0x112070(0x1ba)]&&!this[_0x112070(0x199)]['project']['site']&&!this[_0x112070(0x199)][_0x112070(0x17f)][_0x112070(0x1ba)]&&!this['layers']['global'][_0x112070(0x1ba)])return _0x112070(0x1a9);return _0x112070(0x186)+_0x4c5517['replace'](/_/g,'-');}if(this[_0x112070(0x199)][_0x112070(0x195)][_0x4c5517]===_0xfd9081)return'session';if(this[_0x112070(0x199)][_0x112070(0x1bb)][_0x4c5517]===_0xfd9081)return _0x112070(0x1bb);if(this[_0x112070(0x199)][_0x112070(0x17f)][_0x4c5517]===_0xfd9081)return'profile:\x20'+this['activeProfile'];if(this[_0x112070(0x199)]['global'][_0x4c5517]===_0xfd9081)return _0x112070(0x19c);return'default';}['loadGlobalConfig'](){const _0x5b7f9c=a48_0x519476,_0x336dd8=a48_0x194e36[_0x5b7f9c(0x18f)](getConfigDir(),_0x5b7f9c(0x18a));if(!a48_0x322a6[_0x5b7f9c(0x189)](_0x336dd8))return{};try{const _0x176251=a48_0x322a6[_0x5b7f9c(0x196)](_0x336dd8,_0x5b7f9c(0x1b0));return JSON[_0x5b7f9c(0x19f)](_0x176251);}catch{return{};}}[a48_0x519476(0x187)](_0xc47201){const _0x47d48a=a48_0x519476;_0xc47201[_0x47d48a(0x1ba)]=this[_0x47d48a(0x1ba)],!_0xc47201[_0x47d48a(0x194)]&&this['database']&&(_0xc47201[_0x47d48a(0x194)]=this['database']),!_0xc47201[_0x47d48a(0x1a3)]&&this[_0x47d48a(0x1b8)]&&(_0xc47201['parentSegment']=this['parent_segment']),!_0xc47201[_0x47d48a(0x181)]&&this[_0x47d48a(0x184)]&&(_0xc47201[_0x47d48a(0x181)]=this[_0x47d48a(0x184)]),!_0xc47201[_0x47d48a(0x1b9)]&&this['llm_project']&&(_0xc47201[_0x47d48a(0x1b9)]=this[_0x47d48a(0x1a8)]);}['getParameters'](){const _0xf94347=a48_0x519476;return[{'key':_0xf94347(0x1ba),'value':this[_0xf94347(0x1ba)]},{'key':'database','value':this[_0xf94347(0x194)]},{'key':_0xf94347(0x1b8),'value':this['parent_segment']},{'key':_0xf94347(0x184),'value':this['segment_path']},{'key':'llm_project','value':this[_0xf94347(0x1a8)]},{'key':_0xf94347(0x17f),'value':this['activeProfile']||undefined}];}[a48_0x519476(0x18c)](){const _0x480e25=a48_0x519476;console[_0x480e25(0x1a4)](_0x480e25(0x183));for(const {key:_0x153ac4,value:_0x9364f6}of this[_0x480e25(0x1b6)]()){_0x9364f6&&console['log'](_0x153ac4+':\x20'+_0x9364f6);}}['displayWithSources'](){const _0x39d832=a48_0x519476;console['log'](_0x39d832(0x183));for(const {key:_0x3899bb,value:_0x44824f}of this['getParameters']()){if(_0x44824f){const _0x13afc9=_0x3899bb===_0x39d832(0x17f)?'(active)':'('+this[_0x39d832(0x18e)](_0x3899bb,_0x44824f)+')';console[_0x39d832(0x1a4)](_0x3899bb+':\x20'+_0x44824f+'\x20'+_0x13afc9);}}console[_0x39d832(0x1a4)](_0x39d832(0x19a));const _0x33975e=[{'label':_0x39d832(0x1be),'path':this[_0x39d832(0x198)][_0x39d832(0x195)],'extra':'(session:\x20'+this[_0x39d832(0x1ad)]+')'},{'label':_0x39d832(0x1a1),'path':this[_0x39d832(0x198)][_0x39d832(0x1bb)]},{'label':_0x39d832(0x19d),'path':this[_0x39d832(0x198)][_0x39d832(0x17f)]},{'label':_0x39d832(0x1a7),'path':this[_0x39d832(0x198)][_0x39d832(0x1b5)]},{'label':_0x39d832(0x1bf),'path':this[_0x39d832(0x198)]['global']},{'label':'Global\x20Credentials','path':this[_0x39d832(0x198)][_0x39d832(0x1ab)]}];for(const {label:_0x1c5c62,path:_0x52a870,extra:_0x3a1ee8}of _0x33975e){if(_0x52a870)console['log'](_0x1c5c62+':\x20'+_0x52a870+'\x20✓'+(_0x3a1ee8?'\x20'+_0x3a1ee8:''));else{if(_0x1c5c62===_0x39d832(0x1be))console[_0x39d832(0x1a4)](_0x1c5c62+_0x39d832(0x19b)+this[_0x39d832(0x1ad)]+')');else(_0x1c5c62===_0x39d832(0x1a1)||_0x1c5c62===_0x39d832(0x1bf))&&console[_0x39d832(0x1a4)](_0x1c5c62+_0x39d832(0x1ac));}}}async[a48_0x519476(0x1bc)](){const _0x762fa=a48_0x519476;return this[_0x762fa(0x1a2)]=await getAPIKeyAsync(this[_0x762fa(0x1ba)],this[_0x762fa(0x190)]||undefined),this[_0x762fa(0x1a2)];}static async['createAsync'](_0x46d15a){const _0x2e29a3=new GlobalContext(_0x46d15a);return await _0x2e29a3['resolveAPIKeyAsync'](),_0x2e29a3;}}
|
package/dist/core/keychain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a49_0x497d0e=a49_0x2183;(function(_0x2b0831,_0x223410){const _0x1e355b=a49_0x2183,_0x3ced64=_0x2b0831();while(!![]){try{const _0x5e44a6=-parseInt(_0x1e355b(0x83))/0x1*(-parseInt(_0x1e355b(0x78))/0x2)+parseInt(_0x1e355b(0x89))/0x3+parseInt(_0x1e355b(0x6a))/0x4+-parseInt(_0x1e355b(0x6c))/0x5*(parseInt(_0x1e355b(0x75))/0x6)+-parseInt(_0x1e355b(0x73))/0x7+parseInt(_0x1e355b(0x6d))/0x8+parseInt(_0x1e355b(0x84))/0x9*(-parseInt(_0x1e355b(0x87))/0xa);if(_0x5e44a6===_0x223410)break;else _0x3ced64['push'](_0x3ced64['shift']());}catch(_0x50a76a){_0x3ced64['push'](_0x3ced64['shift']());}}}(a49_0x56e6,0xeac33));const SERVICE_NAME=a49_0x497d0e(0x70);let keyringModule=null,keyringLoadError=null;async function getKeyring(){const _0x5c7f8f=a49_0x497d0e;if(keyringModule!==null)return keyringModule;if(keyringLoadError!==null)return null;try{const _0x129259=await import(_0x5c7f8f(0x79));return keyringModule=_0x129259[_0x5c7f8f(0x7a)],keyringModule;}catch(_0x154a63){return keyringLoadError=_0x154a63 instanceof Error?_0x154a63:new Error(String(_0x154a63)),null;}}function getAccountName(_0x2fd148){const _0x1384d2=a49_0x497d0e,_0x4eebdc=_0x2fd148||'';return _0x1384d2(0x7d)+_0x4eebdc+_0x1384d2(0x86);}export async function getKeychainAPIKey(_0x443ad8){const _0x39bb9c=a49_0x497d0e,_0x5463eb=await getKeychainAPIKeyWithStatus(_0x443ad8);if(_0x5463eb['success'])return _0x5463eb[_0x39bb9c(0x82)];return _0x5463eb[_0x39bb9c(0x71)]==='access_denied'&&console[_0x39bb9c(0x88)](_0x39bb9c(0x80)+_0x5463eb[_0x39bb9c(0x7b)]),null;}export async function getKeychainAPIKeyWithStatus(_0x2232f4){const _0x5e8805=a49_0x497d0e;try{const _0x189603=await getKeyring();if(!_0x189603)return{'success':![],'reason':_0x5e8805(0x77)};const _0x5cf19a=getAccountName(_0x2232f4),_0x2f1490=await _0x189603['getPassword'](SERVICE_NAME,_0x5cf19a);if(_0x2f1490)return{'success':!![],'value':_0x2f1490};return{'success':![],'reason':_0x5e8805(0x76)};}catch(_0x2e537f){const _0x23481e=_0x2e537f instanceof Error?_0x2e537f['message']:String(_0x2e537f);if(_0x23481e[_0x5e8805(0x69)](_0x5e8805(0x72))||_0x23481e['toLowerCase']()[_0x5e8805(0x69)]('could\x20not\x20be\x20found')||_0x23481e[_0x5e8805(0x6b)]()[_0x5e8805(0x69)]('not\x20found'))return{'success':![],'reason':_0x5e8805(0x76)};if(_0x23481e[_0x5e8805(0x69)](_0x5e8805(0x7e))||_0x23481e[_0x5e8805(0x6b)]()[_0x5e8805(0x69)](_0x5e8805(0x6e))||_0x23481e[_0x5e8805(0x6b)]()['includes'](_0x5e8805(0x6f)))return{'success':![],'reason':'access_denied','message':_0x5e8805(0x7f)};return{'success':![],'reason':'unavailable','message':_0x23481e};}}function a49_0x2183(_0x45f299,_0x29c570){_0x45f299=_0x45f299-0x69;const _0x56e61e=a49_0x56e6();let _0x218380=_0x56e61e[_0x45f299];return _0x218380;}export async function saveKeychainAPIKey(_0xf437d3,_0x5ea69f){const _0x54d251=a49_0x497d0e,_0x28f38e=await getKeyring();if(!_0x28f38e)throw new Error('System\x20keychain\x20is\x20not\x20available');const _0x3c9aa9=getAccountName(_0x5ea69f);await _0x28f38e[_0x54d251(0x85)](SERVICE_NAME,_0x3c9aa9,_0xf437d3);}function a49_0x56e6(){const _0x31b984=['4465120GxrlWN','toLowerCase','55DQXIjP','3618072nRsfNM','restricted','access','tdx','reason','-25300','2456475qIORil','cannot\x20find','430908FqArGH','not_found','unavailable','2INGbsB','@zowe/secrets-for-zowe-sdk','keyring','message','getPassword','profile:','-25293','Keychain\x20access\x20denied.\x20The\x20API\x20key\x20exists\x20but\x20cannot\x20be\x20accessed.\x20Try\x20running\x20\x22tdx\x20auth\x20setup\x22\x20to\x20re-authenticate,\x20or\x20check\x20your\x20keychain\x20permissions\x20for\x20\x22tdx\x22.','Warning:\x20','not\x20supported','value','1505963snGdfS','36iUESQL','setPassword',':api_key','6303130VqLIxL','error','4647780fvnOeR','includes'];a49_0x56e6=function(){return _0x31b984;};return a49_0x56e6();}export async function deleteKeychainAPIKey(_0x3753e1){try{const _0x3bc79d=await getKeyring();if(!_0x3bc79d)return![];const _0x448af4=getAccountName(_0x3753e1);return await _0x3bc79d['deletePassword'](SERVICE_NAME,_0x448af4);}catch{return![];}}export async function isKeychainAvailable(){const _0x1b816e=a49_0x497d0e;try{const _0x13ddc2=await getKeyring();if(!_0x13ddc2)return![];return await _0x13ddc2[_0x1b816e(0x7c)](SERVICE_NAME,'__keychain_test__'),!![];}catch(_0x46ab05){const _0x44e518=_0x46ab05 instanceof Error?_0x46ab05['message']['toLowerCase']():'';if(_0x44e518[_0x1b816e(0x69)]('not\x20available')||_0x44e518[_0x1b816e(0x69)](_0x1b816e(0x81))||_0x44e518[_0x1b816e(0x69)](_0x1b816e(0x74)))return![];return!![];}}
|