@treasuredata/tdx 0.8.3 → 0.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/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.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/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/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.d.ts.map +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/query-command.js.map +1 -1
- package/dist/commands/segment-command.d.ts.map +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-command.js.map +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.d.ts.map +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-pull-command.js.map +1 -1
- package/dist/commands/segment-push-command.d.ts.map +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-push-command.js.map +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segments.d.ts.map +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/segments.js.map +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/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.d.ts +10 -2
- package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/anthropic-adapter.js.map +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.d.ts +18 -0
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts +24 -5
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/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.d.ts +1 -0
- package/dist/types/index.d.ts.map +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 +6 -0
- 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.d.ts +37 -1
- package/dist/utils/sql-parser.d.ts.map +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sql-parser.js.map +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.d.ts +4 -0
- package/dist/utils/tree-formatter.d.ts.map +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/tree-formatter.js.map +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +3 -3
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x31d8ed=a38_0x119b;(function(_0x30c6e9,_0x2c04f7){const _0x113f35=a38_0x119b,_0x2e2f76=_0x30c6e9();while(!![]){try{const _0x2ddacb=-parseInt(_0x113f35(0x17c))/0x1+parseInt(_0x113f35(0x178))/0x2*(parseInt(_0x113f35(0x18f))/0x3)+parseInt(_0x113f35(0x17b))/0x4+parseInt(_0x113f35(0x173))/0x5*(parseInt(_0x113f35(0x18d))/0x6)+parseInt(_0x113f35(0x18e))/0x7+parseInt(_0x113f35(0x196))/0x8+-parseInt(_0x113f35(0x197))/0x9;if(_0x2ddacb===_0x2c04f7)break;else _0x2e2f76['push'](_0x2e2f76['shift']());}catch(_0x2a2a35){_0x2e2f76['push'](_0x2e2f76['shift']());}}}(a38_0x46b2,0xf046d));function a38_0x46b2(){const _0x36bc1b=['name','5279145fTllgb','execute','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','show','\x20row','4KHVpai','verbose','args','5242492FJJEUx','1583380JAXgga','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','limit','error','Error:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','Show\x20table\x20contents','message','query','\x20\x20Cause:\x20','Limit:\x20','description','✔\x20Retrieved\x20','validate','length','site','cause','6AgFycG','8931615TSNehY','1646544SHdEtB','showTable','Catalog:\x20','table','catalog','data','database','703320NAJGpx','20344095BqNnQr','Usage:\x20tdx\x20show\x20<database.table>','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options'];a38_0x46b2=function(){return _0x36bc1b;};return a38_0x46b2();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';function a38_0x119b(_0x1ba31a,_0x582fe7){_0x1ba31a=_0x1ba31a-0x172;const _0x46b232=a38_0x46b2();let _0x119b6f=_0x46b232[_0x1ba31a];return _0x119b6f;}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{[a38_0x31d8ed(0x172)]=a38_0x31d8ed(0x176);[a38_0x31d8ed(0x187)]=a38_0x31d8ed(0x182);async[a38_0x31d8ed(0x174)](_0x1f7f39){return this['showTable'](_0x1f7f39);}async[a38_0x31d8ed(0x190)](_0x36bc80){const _0x1d8724=a38_0x31d8ed,{options:_0x3882aa,args:_0xc045c4,tdx:_0x246ba8}=_0x36bc80;let _0x5468f4;try{_0x5468f4=parseTableReference(_0xc045c4[0x0]);const _0x98390=_0x3882aa[_0x1d8724(0x195)];!_0x5468f4[_0x1d8724(0x195)]&&_0x98390&&(_0x5468f4[_0x1d8724(0x195)]=_0x98390);const _0x13bd91=validateTableDescribeReference(_0x5468f4);if(_0x13bd91)return console[_0x1d8724(0x17f)](_0x1d8724(0x180)+_0x13bd91),console[_0x1d8724(0x17f)](_0x1d8724(0x198)),console[_0x1d8724(0x17f)](_0x1d8724(0x181)),console[_0x1d8724(0x17f)](_0x1d8724(0x17d)),0x1;}catch(_0x5167fa){return console[_0x1d8724(0x17f)](_0x1d8724(0x180)+_0x5167fa[_0x1d8724(0x183)]),console['error'](_0x1d8724(0x198)),console[_0x1d8724(0x17f)](_0x1d8724(0x181)),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x3da02a=_0x5468f4[_0x1d8724(0x193)],_0x2c04dc=_0x5468f4[_0x1d8724(0x195)],_0x27f4fd=_0x5468f4[_0x1d8724(0x192)],_0xce5d99=resolveLimit(_0x3882aa[_0x1d8724(0x17e)],DEFAULT_DISPLAY_LIMIT);try{_0x3882aa[_0x1d8724(0x179)]&&(console[_0x1d8724(0x17f)]('Site:\x20'+_0x3882aa[_0x1d8724(0x18b)]),_0x3da02a&&console[_0x1d8724(0x17f)](_0x1d8724(0x191)+_0x3da02a),console[_0x1d8724(0x17f)]('Database:\x20'+_0x2c04dc),console[_0x1d8724(0x17f)]('Table:\x20'+_0x27f4fd),console[_0x1d8724(0x17f)](_0x1d8724(0x186)+_0xce5d99));const _0x479493=_0x3da02a?_0x3da02a+'.'+_0x2c04dc+'.'+_0x27f4fd:_0x2c04dc+'.'+_0x27f4fd,_0x210755=await withSpinner('Querying\x20'+_0x479493+'...',()=>_0x246ba8[_0x1d8724(0x184)][_0x1d8724(0x190)](_0x2c04dc,_0x27f4fd,_0xce5d99,_0x3da02a),{'verbose':_0x3882aa['verbose']}),_0x1b41e7=_0x210755[_0x1d8724(0x194)],_0x3f109f=_0x1b41e7[_0x1d8724(0x194)];return _0x3f109f[_0x1d8724(0x18a)]===0x0?console[_0x1d8724(0x17f)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x1d8724(0x17f)](_0x1d8724(0x188)+_0x3f109f['length']+_0x1d8724(0x177)+(_0x3f109f['length']!==0x1?'s':'')+'\x20from\x20'+_0x479493),await handleSDKOutput(_0x3f109f,_0x3882aa),0x0;}catch(_0x4a815f){if(_0x4a815f instanceof SDKError)return console[_0x1d8724(0x17f)]('Error:\x20'+_0x4a815f['message']),_0x4a815f[_0x1d8724(0x18c)]&&console[_0x1d8724(0x17f)](_0x1d8724(0x185)+_0x4a815f[_0x1d8724(0x18c)]),0x1;throw _0x4a815f;}}[a38_0x31d8ed(0x189)](_0x4874bc){const _0x24c17a=a38_0x31d8ed;if(_0x4874bc[_0x24c17a(0x17a)][_0x24c17a(0x18a)]===0x0)return _0x24c17a(0x175);if(_0x4874bc['args'][_0x24c17a(0x18a)]>0x1)return _0x24c17a(0x199);return undefined;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a39_0x564f8c=a39_0x51f6;(function(_0x4ee2e4,_0x391e16){const _0x922db9=a39_0x51f6,_0x2714ac=_0x4ee2e4();while(!![]){try{const _0x2e76d2=parseInt(_0x922db9(0x173))/0x1*(parseInt(_0x922db9(0x171))/0x2)+parseInt(_0x922db9(0x176))/0x3*(parseInt(_0x922db9(0x165))/0x4)+parseInt(_0x922db9(0x17f))/0x5+parseInt(_0x922db9(0x174))/0x6*(parseInt(_0x922db9(0x185))/0x7)+parseInt(_0x922db9(0x181))/0x8*(parseInt(_0x922db9(0x180))/0x9)+-parseInt(_0x922db9(0x15f))/0xa+-parseInt(_0x922db9(0x192))/0xb;if(_0x2e76d2===_0x391e16)break;else _0x2714ac['push'](_0x2714ac['shift']());}catch(_0x10e07c){_0x2714ac['push'](_0x2714ac['shift']());}}}(a39_0x3553,0x3059a));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';function a39_0x3553(){const _0x29e052=['database','Table\x20pattern:\x20','Database:\x20all','3220210iUdRGa','includes','Database\x20pattern:\x20','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','error','4UdmlaZ','\x20\x20Cause:\x20','\x27\x20is\x20ambiguous.','\x20table','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','✖\x20No\x20tables\x20found','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','Database:\x20','validate','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','description','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','10026VEKcHW','.*\x22','47jJOPXg','633102LIzQjo','Site:\x20','604341ERdcZt','Or\x20use\x20--in\x20flag:','✔\x20Found\x20','listTables','query','Error:\x20Pattern\x20\x27','message','List\x20tables\x20in\x20a\x20database','Database\x20\x27','1579690ixNxbW','9zIFuDN','1084792ZxZYJM','cause','limit','\x20\x20Use:\x20tdx\x20tables\x20\x22','14KxWmll','verbose','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','table','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','execute','length','\x27\x20across\x20all\x20databases.','site','Listing\x20tables...','Error:\x20','name','tables','6375226BHCSPp'];a39_0x3553=function(){return _0x29e052;};return a39_0x3553();}function a39_0x51f6(_0x3723f3,_0x5b1b74){_0x3723f3=_0x3723f3-0x15d;const _0x355373=a39_0x3553();let _0x51f61b=_0x355373[_0x3723f3];return _0x51f61b;}export class TablesCommand extends BaseCommand{[a39_0x564f8c(0x190)]=a39_0x564f8c(0x191);[a39_0x564f8c(0x16f)]=a39_0x564f8c(0x17d);async[a39_0x564f8c(0x18a)](_0x39d1d8){const _0x353c2f=a39_0x564f8c,{options:_0x3e1a4b,args:_0x285a4f,tdx:_0x3e75eb}=_0x39d1d8;let _0x4f8f31;if(_0x285a4f[_0x353c2f(0x18b)]===0x0)_0x4f8f31={'database':undefined,'table':undefined,'original':''};else{if(_0x285a4f[_0x353c2f(0x18b)]===0x1)try{_0x4f8f31=parseTableReference(_0x285a4f[0x0]);if(_0x4f8f31['table']&&!_0x4f8f31[_0x353c2f(0x193)]&&!_0x4f8f31[_0x353c2f(0x188)][_0x353c2f(0x160)]('*')&&!_0x4f8f31[_0x353c2f(0x188)][_0x353c2f(0x160)]('?'))return console[_0x353c2f(0x164)](_0x353c2f(0x17b)+_0x285a4f[0x0]+_0x353c2f(0x167)),console['error'](_0x353c2f(0x169)+_0x4f8f31[_0x353c2f(0x188)]+'\x27?'),console[_0x353c2f(0x164)](_0x353c2f(0x184)+_0x4f8f31[_0x353c2f(0x188)]+_0x353c2f(0x172)),console[_0x353c2f(0x164)]('\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'+_0x4f8f31['table']),console[_0x353c2f(0x164)](_0x353c2f(0x162)+_0x4f8f31[_0x353c2f(0x188)]),console[_0x353c2f(0x164)](''),console[_0x353c2f(0x164)]('Note:\x20\x27'+_0x285a4f[0x0]+_0x353c2f(0x189)+_0x4f8f31[_0x353c2f(0x188)]+_0x353c2f(0x18c)),0x1;}catch(_0x4b31c9){return console[_0x353c2f(0x164)](_0x353c2f(0x18f)+_0x4b31c9[_0x353c2f(0x17c)]),0x1;}else return console[_0x353c2f(0x164)]('Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'),console[_0x353c2f(0x164)]('\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases'),console[_0x353c2f(0x164)](_0x353c2f(0x16e)),console[_0x353c2f(0x164)](_0x353c2f(0x16b)),console[_0x353c2f(0x164)](_0x353c2f(0x170)),console[_0x353c2f(0x164)](_0x353c2f(0x177)),console[_0x353c2f(0x164)](_0x353c2f(0x187)),0x1;}const _0x529c5c=_0x3e1a4b['database'];!_0x4f8f31[_0x353c2f(0x193)]&&_0x529c5c&&(_0x4f8f31[_0x353c2f(0x193)]=_0x529c5c);try{const _0x10db3a=_0x1aae46=>_0x1aae46&&(_0x1aae46[_0x353c2f(0x160)]('*')||_0x1aae46[_0x353c2f(0x160)]('?')),_0x1caebc=_0x10db3a(_0x4f8f31[_0x353c2f(0x193)]);_0x3e1a4b[_0x353c2f(0x186)]&&(console[_0x353c2f(0x164)](_0x353c2f(0x175)+_0x3e1a4b[_0x353c2f(0x18d)]),_0x4f8f31[_0x353c2f(0x193)]?_0x1caebc?console[_0x353c2f(0x164)](_0x353c2f(0x161)+_0x4f8f31[_0x353c2f(0x193)]):console[_0x353c2f(0x164)](_0x353c2f(0x16c)+_0x4f8f31[_0x353c2f(0x193)]):console[_0x353c2f(0x164)](_0x353c2f(0x15e)),_0x4f8f31[_0x353c2f(0x188)]&&console['error'](_0x353c2f(0x15d)+_0x4f8f31[_0x353c2f(0x188)]));const _0x2bf9a4=_0x4f8f31['database']&&!_0x1caebc?_0x4f8f31[_0x353c2f(0x193)]:undefined,_0x23c4e5=_0x1caebc?_0x4f8f31[_0x353c2f(0x193)]:undefined,_0x273ba6=_0x4f8f31['table'],_0x523cc9=resolveLimit(_0x3e1a4b[_0x353c2f(0x183)],DEFAULT_LISTING_LIMIT),_0x2b073c=await withSpinner(_0x353c2f(0x18e),()=>_0x3e75eb[_0x353c2f(0x17a)][_0x353c2f(0x179)](_0x2bf9a4,_0x273ba6,_0x23c4e5,_0x523cc9),{'verbose':_0x3e1a4b[_0x353c2f(0x186)]}),_0x1b2087=_0x2b073c['data'];if(_0x1b2087['length']===0x0&&_0x4f8f31[_0x353c2f(0x193)]&&!_0x1caebc)return console['error'](_0x353c2f(0x16a)),console[_0x353c2f(0x164)](_0x353c2f(0x17e)+_0x4f8f31[_0x353c2f(0x193)]+_0x353c2f(0x163)),0x1;return console[_0x353c2f(0x164)](_0x353c2f(0x178)+_0x1b2087[_0x353c2f(0x18b)]+_0x353c2f(0x168)+(_0x1b2087[_0x353c2f(0x18b)]!==0x1?'s':'')),await handleSDKOutput(_0x1b2087,{..._0x3e1a4b,'limit':_0x523cc9}),0x0;}catch(_0x516cdd){if(_0x516cdd instanceof SDKError)return console['error'](_0x353c2f(0x18f)+_0x516cdd[_0x353c2f(0x17c)]),_0x516cdd[_0x353c2f(0x182)]&&console[_0x353c2f(0x164)](_0x353c2f(0x166)+_0x516cdd[_0x353c2f(0x182)]),0x1;throw _0x516cdd;}}[a39_0x564f8c(0x16d)](_0x194763){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a40_0x11cf41=a40_0x2740;(function(_0x2d84e7,_0x30a9c8){const _0x32d780=a40_0x2740,_0x5d771f=_0x2d84e7();while(!![]){try{const _0x3052b9=parseInt(_0x32d780(0x136))/0x1+-parseInt(_0x32d780(0x141))/0x2+-parseInt(_0x32d780(0x137))/0x3+parseInt(_0x32d780(0x12d))/0x4+-parseInt(_0x32d780(0x131))/0x5*(-parseInt(_0x32d780(0x130))/0x6)+parseInt(_0x32d780(0x12f))/0x7*(-parseInt(_0x32d780(0x12c))/0x8)+parseInt(_0x32d780(0x128))/0x9*(-parseInt(_0x32d780(0x143))/0xa);if(_0x3052b9===_0x30a9c8)break;else _0x5d771f['push'](_0x5d771f['shift']());}catch(_0x293901){_0x5d771f['push'](_0x5d771f['shift']());}}}(a40_0x3a89,0x32238));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists}from'../core/profile.js';function a40_0x3a89(){const _0x17f919=['Session\x20llm_project\x20set\x20to:\x20','toString','error','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','(session:\x20','database','cleared','Session\x20database\x20set\x20to:\x20','green','9xozBLb','engage_workspace','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace','Session\x20parent_segment\x20set\x20to:\x20','250040CDsNnv','726484jBFbdj','.\x20Must\x20be\x20one\x20of:\x20','7aDaLLM','18WkwsWH','267440lcrKrj','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','dim','execute','llm_project','341316LfRlWy','159987aTiSUX','displayWithSources','validate','Session\x20engage_workspace\x20set\x20to:\x20','Error:\x20','Session\x20context\x20','Invalid\x20resource:\x20','Session\x20profile\x20set\x20to:\x20','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','description','23876gCVadW','session','3815110YILpwy','includes','clear','log','Set\x20session-level\x20context','length','debug','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','\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','parent_segment','name'];a40_0x3a89=function(){return _0x17f919;};return a40_0x3a89();}import{GlobalContext}from'../core/global-context.js';function a40_0x2740(_0x4090e2,_0x5110c4){_0x4090e2=_0x4090e2-0x125;const _0x3a8953=a40_0x3a89();let _0x274066=_0x3a8953[_0x4090e2];return _0x274066;}import a40_0x52ddde from'chalk';export class UseCommand extends BaseCommand{[a40_0x11cf41(0x14e)]='use';[a40_0x11cf41(0x140)]=a40_0x11cf41(0x147);[a40_0x11cf41(0x139)](_0x4a9822){const _0x308ac7=a40_0x11cf41,{args:_0x411333}=_0x4a9822;if(_0x411333[_0x308ac7(0x148)]===0x0)return undefined;if(_0x411333[_0x308ac7(0x148)]===0x1)return _0x308ac7(0x14a)+_0x308ac7(0x14c)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a'+'\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace\x0a'+_0x308ac7(0x13f);const _0x32df1b=_0x411333[0x0],_0x28d01f=[_0x308ac7(0x154),_0x308ac7(0x14d),_0x308ac7(0x135),'profile',_0x308ac7(0x129)];if(!_0x28d01f[_0x308ac7(0x144)](_0x32df1b))return _0x308ac7(0x13d)+_0x32df1b+_0x308ac7(0x12e)+_0x28d01f['join'](',\x20');return undefined;}async[a40_0x11cf41(0x134)](_0x173f98){const _0x53a669=a40_0x11cf41,{args:_0x4f060e,options:_0x14a63d}=_0x173f98,_0x388278=_0x14a63d[_0x53a669(0x149)],_0x38f799=_0x14a63d[_0x53a669(0x145)];cleanExpiredSessions();try{if(_0x38f799){clearSessionContext(_0x14a63d[_0x53a669(0x142)]);const _0x15241c=_0x14a63d[_0x53a669(0x142)]||getCurrentSessionPID()[_0x53a669(0x150)]();return console[_0x53a669(0x146)](_0x53a669(0x13c)+a40_0x52ddde[_0x53a669(0x127)](_0x53a669(0x125))+'\x20'+a40_0x52ddde['dim'](_0x53a669(0x153)+_0x15241c+')')),0x0;}if(_0x4f060e[_0x53a669(0x148)]===0x0){const _0x10904f=new GlobalContext(_0x14a63d);return _0x388278?_0x10904f[_0x53a669(0x138)]():_0x10904f['display'](),console['log'](a40_0x52ddde[_0x53a669(0x133)](_0x53a669(0x14b))),console[_0x53a669(0x146)](a40_0x52ddde[_0x53a669(0x133)](_0x53a669(0x12a))),0x0;}const _0x27021f=_0x4f060e[0x0],_0x2c7116=_0x4f060e[0x1];if(_0x27021f==='profile'){if(!profileExists(_0x2c7116))return console[_0x53a669(0x151)]('Error:\x20Profile\x20\x27'+_0x2c7116+'\x27\x20does\x20not\x20exist'),console['error'](_0x53a669(0x152)),0x1;const _0x3c60c7=_0x14a63d['session']||getCurrentSessionPID()[_0x53a669(0x150)]();return saveSessionContext({'profile':_0x2c7116},_0x14a63d[_0x53a669(0x142)]),console[_0x53a669(0x146)](_0x53a669(0x13e)+a40_0x52ddde['green'](_0x2c7116)+'\x20'+a40_0x52ddde[_0x53a669(0x133)](_0x53a669(0x153)+_0x3c60c7+')')),console[_0x53a669(0x146)](a40_0x52ddde[_0x53a669(0x133)](_0x53a669(0x132))),0x0;}const _0x17a117={},_0x2286b5=_0x14a63d[_0x53a669(0x142)]||getCurrentSessionPID()[_0x53a669(0x150)]();switch(_0x27021f){case _0x53a669(0x154):_0x17a117[_0x53a669(0x154)]=_0x2c7116,console[_0x53a669(0x146)](_0x53a669(0x126)+a40_0x52ddde[_0x53a669(0x127)](_0x2c7116)+'\x20'+a40_0x52ddde[_0x53a669(0x133)](_0x53a669(0x153)+_0x2286b5+')'));break;case _0x53a669(0x14d):_0x17a117['parent_segment']=_0x2c7116,console['log'](_0x53a669(0x12b)+a40_0x52ddde[_0x53a669(0x127)](_0x2c7116)+'\x20'+a40_0x52ddde['dim'](_0x53a669(0x153)+_0x2286b5+')'));break;case _0x53a669(0x135):_0x17a117['llm_project']=_0x2c7116,console[_0x53a669(0x146)](_0x53a669(0x14f)+a40_0x52ddde['green'](_0x2c7116)+'\x20'+a40_0x52ddde['dim']('(session:\x20'+_0x2286b5+')'));break;case _0x53a669(0x129):_0x17a117[_0x53a669(0x129)]=_0x2c7116,console[_0x53a669(0x146)](_0x53a669(0x13a)+a40_0x52ddde['green'](_0x2c7116)+'\x20'+a40_0x52ddde[_0x53a669(0x133)](_0x53a669(0x153)+_0x2286b5+')'));break;}return saveSessionContext(_0x17a117,_0x14a63d[_0x53a669(0x142)]),console['log'](a40_0x52ddde['dim'](_0x53a669(0x132))),0x0;}catch(_0x176c0b){return _0x176c0b instanceof Error&&console[_0x53a669(0x151)](_0x53a669(0x13b)+_0x176c0b['message']),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a41_0x2d75ce=a41_0x207c;(function(_0x18fb97,_0x5268a1){const _0x1ee3ff=a41_0x207c,_0x5384df=_0x18fb97();while(!![]){try{const _0x28ffe0=parseInt(_0x1ee3ff(0x88))/0x1*(-parseInt(_0x1ee3ff(0x97))/0x2)+parseInt(_0x1ee3ff(0x8f))/0x3+parseInt(_0x1ee3ff(0x85))/0x4+parseInt(_0x1ee3ff(0x89))/0x5+parseInt(_0x1ee3ff(0x91))/0x6+parseInt(_0x1ee3ff(0x99))/0x7*(parseInt(_0x1ee3ff(0x87))/0x8)+-parseInt(_0x1ee3ff(0x93))/0x9;if(_0x28ffe0===_0x5268a1)break;else _0x5384df['push'](_0x5384df['shift']());}catch(_0x2318b8){_0x5384df['push'](_0x5384df['shift']());}}}(a41_0x56f1,0xc75a6));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a41_0x207c(_0x1162a4,_0x436543){_0x1162a4=_0x1162a4-0x82;const _0x56f1e3=a41_0x56f1();let _0x207c8d=_0x56f1e3[_0x1162a4];return _0x207c8d;}import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';function a41_0x56f1(){const _0x4cf161=['114112NfZiVi','2LRSHSR','4524035bReLaL','List\x20all\x20users\x20in\x20the\x20account','error','✔\x20Found\x20','\x20\x20Cause:\x20','description','1908507wrVwQf','user','2715264pOiARv','data','29631195saJWsL','length','verbose','user\x20list','375434BzPRda','Error:\x20','644knCzrd','name','execute','message','Listing\x20users...','Show\x20current\x20user\x20information','4714124MBjYvI','cause'];a41_0x56f1=function(){return _0x4cf161;};return a41_0x56f1();}import{withSpinner}from'../utils/spinner.js';export class UserCommand extends BaseCommand{[a41_0x2d75ce(0x9a)]='user';[a41_0x2d75ce(0x8e)]=a41_0x2d75ce(0x84);async[a41_0x2d75ce(0x9b)](_0x1d24c2){const _0x43ebfb=a41_0x2d75ce,{options:_0x305053,tdx:_0x204cba}=_0x1d24c2;try{const _0x4db13d=await withSpinner('Fetching\x20user\x20info...',()=>_0x204cba[_0x43ebfb(0x90)]['getCurrent'](),{'verbose':_0x305053[_0x43ebfb(0x95)]}),_0x28111a=_0x4db13d[_0x43ebfb(0x92)];return await handleSingleObjectOutput(_0x28111a,_0x305053),0x0;}catch(_0x5990db){if(_0x5990db instanceof SDKError)return console[_0x43ebfb(0x8b)]('Error:\x20'+_0x5990db[_0x43ebfb(0x82)]),_0x5990db[_0x43ebfb(0x86)]&&console[_0x43ebfb(0x8b)](_0x43ebfb(0x8d)+_0x5990db[_0x43ebfb(0x86)]),0x1;throw _0x5990db;}}}export class UserListCommand extends BaseCommand{[a41_0x2d75ce(0x9a)]=a41_0x2d75ce(0x96);[a41_0x2d75ce(0x8e)]=a41_0x2d75ce(0x8a);async[a41_0x2d75ce(0x9b)](_0x4df1a0){const _0x36052f=a41_0x2d75ce,{options:_0x3985a0,tdx:_0x296588}=_0x4df1a0;try{const _0x3420da=await withSpinner(_0x36052f(0x83),()=>_0x296588[_0x36052f(0x90)]['list'](),{'verbose':_0x3985a0[_0x36052f(0x95)]}),_0x6dc245=_0x3420da[_0x36052f(0x92)];return console[_0x36052f(0x8b)](_0x36052f(0x8c)+_0x6dc245['length']+'\x20user'+(_0x6dc245[_0x36052f(0x94)]!==0x1?'s':'')),await handleSDKOutput(_0x6dc245,_0x3985a0),0x0;}catch(_0x371c33){if(_0x371c33 instanceof SDKError)return console['error'](_0x36052f(0x98)+_0x371c33[_0x36052f(0x82)]),_0x371c33['cause']&&console[_0x36052f(0x8b)](_0x36052f(0x8d)+_0x371c33['cause']),0x1;throw _0x371c33;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a42_0x1c8bd5=a42_0x2a1e;(function(_0x2d8028,_0xe06ef1){const _0xa697a4=a42_0x2a1e,_0x1d6525=_0x2d8028();while(!![]){try{const _0x1701b2=parseInt(_0xa697a4(0xa9))/0x1*(parseInt(_0xa697a4(0xeb))/0x2)+parseInt(_0xa697a4(0xfc))/0x3*(parseInt(_0xa697a4(0x109))/0x4)+parseInt(_0xa697a4(0xd8))/0x5*(parseInt(_0xa697a4(0xb4))/0x6)+-parseInt(_0xa697a4(0x92))/0x7+parseInt(_0xa697a4(0x85))/0x8+parseInt(_0xa697a4(0xfd))/0x9*(-parseInt(_0xa697a4(0xb6))/0xa)+-parseInt(_0xa697a4(0xaf))/0xb*(parseInt(_0xa697a4(0x75))/0xc);if(_0x1701b2===_0xe06ef1)break;else _0x1d6525['push'](_0x1d6525['shift']());}catch(_0x114766){_0x1d6525['push'](_0x1d6525['shift']());}}}(a42_0x2f56,0xba624));function a42_0x2f56(){const _0x5c1cbb=['\x20\x20Project\x20ID:\x20','\x20\x20Session\x20ID:\x20','workflow:retry','workflow:attempt','workflow:download','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Show\x20logs\x20for\x20a\x20workflow\x20attempt','retryAttempt','1705235gFtcaa','substring','\x20attempt','download','attempts','Including\x20subtasks:\x20yes','List\x20workflow\x20execution\x20sessions','\x20\x20Attempt\x20ID:\x20','\x20is\x20not\x20a\x20directory','select','startsWith','Retry\x20a\x20session\x20or\x20attempt','Retrying\x20session...','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Kill\x20a\x20running\x20attempt','cause','Pushing\x20workflow\x20project...','data','workflow:logs','Resume\x20from:\x20','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','workflow:kill','workflow:push','59064ksqrle','Getting\x20attempt\x20tasks...','attemptId','List\x20workflows','Listing\x20workflow\x20sessions...','Listing\x20workflows...','121ntznZF','Pattern:\x20','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','projectName','Getting\x20attempt\x20details...','2817102mjCtzr','taskName','10ZzqGpT','fromTask','attempt:','format','Listing\x20workflow\x20projects...','Downloading\x20project\x20','log','Error:\x20Attempt\x20ID\x20is\x20required','List\x20workflow\x20attempts','delete','✔\x20Retry\x20started','readFile','\x20\x20New\x20attempt\x20ID:\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Start\x20a\x20workflow\x20run','workflow','Session\x20time:\x20','\x20workflow','skipValidation','\x20\x20Project:\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','fileSize','Attempt\x20ID:\x20','...','Error:\x20','\x20\x20Cause:\x20','Killing\x20attempt...','Parameters:\x20','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Workflow:\x20','projectId','workflows','revision','getTime','5RlQtmQ','Reason:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Fetching\x20log\x20files...','resumeFrom','Deleting\x20project\x20','Starting\x20workflow\x20run...','Error:\x20Invalid\x20parameter\x20format:\x20','✔\x20Found\x20','utf-8','includeRetried','\x20\x20Workflow:\x20','task','index','kill','createdAt','Project\x20filter:\x20','isDirectory','workflow:sessions','18xHDFjL','message','\x20\x20Location:\x20','List\x20all\x20workflow\x20projects','includeSubtasks','split','\x22?\x20This\x20cannot\x20be\x20undone.','execute','round','workflow:attempts','force','Params:\x20','Filter:\x20project=','sessionId','project','tasks','logFiles','5793hEeqqI','11035431WZbCPJ','keys','stringify','error','Revision:\x20','parse','attempt','Project:\x20','From\x20task:\x20','verbose','yes','length','1032EZqzGH','Select\x20a\x20task\x20to\x20view\x20logs:','No\x20log\x20content\x20found','Task\x20name:\x20','projects','workflow:delete','retryAttemptName','limit','session','retrySession','stat','workflow:tasks','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Project\x20name:\x20','name','filesExtracted','fs/promises','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','workflow:run','Expected\x20format:\x20--param\x20key=value','workflow:projects','Error:\x20Project\x20name\x20is\x20required','706956tuSfum','Cancelled','description','\x20project','Filter:\x20','done','indexOf','sessions','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','✔\x20Workflow\x20run\x20started','\x20\x20Revision:\x20','finishedAt','params','Force:\x20yes','status','logs','11055552xyLTfM','Validation:\x20skipped','Listing\x20workflow\x20attempts...','push','sessionTime'];a42_0x2f56=function(){return _0x5c1cbb;};return a42_0x2f56();}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 a42_0x5da6d2 from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a42_0x1c8bd5(0x117)]=a42_0x1c8bd5(0x73);[a42_0x1c8bd5(0x77)]=a42_0x1c8bd5(0xee);async[a42_0x1c8bd5(0xf2)](_0x53422b){const _0x25e4b8=a42_0x1c8bd5,{options:_0x5ea0bd,args:_0x25b0d2,tdx:_0x31711f}=_0x53422b,_0x30210e=_0x25b0d2[0x0];try{_0x5ea0bd[_0x25e4b8(0x106)]&&_0x30210e&&console[_0x25e4b8(0x100)](_0x25e4b8(0xb0)+_0x30210e);const _0x94f6db=await withSpinner(_0x25e4b8(0xba),()=>_0x31711f[_0x25e4b8(0xc5)][_0x25e4b8(0x10d)](_0x30210e,{'limit':_0x5ea0bd[_0x25e4b8(0x110)]}),{'verbose':_0x5ea0bd[_0x25e4b8(0x106)]}),_0x3d9a60=_0x94f6db['data'];return console[_0x25e4b8(0x100)](_0x25e4b8(0xe0)+_0x3d9a60['length']+_0x25e4b8(0x78)+(_0x3d9a60[_0x25e4b8(0x108)]!==0x1?'s':'')),await handleSDKOutput(_0x3d9a60,_0x5ea0bd),0x0;}catch(_0x3d573a){if(_0x3d573a instanceof SDKError)return console[_0x25e4b8(0x100)](_0x25e4b8(0xce)+_0x3d573a[_0x25e4b8(0xec)]),_0x3d573a[_0x25e4b8(0xa1)]&&console[_0x25e4b8(0x100)](_0x25e4b8(0xcf)+_0x3d573a[_0x25e4b8(0xa1)]),0x1;throw _0x3d573a;}}}function a42_0x2a1e(_0x2b21ff,_0x46b24c){_0x2b21ff=_0x2b21ff-0x6e;const _0x2f5618=a42_0x2f56();let _0x2a1e68=_0x2f5618[_0x2b21ff];return _0x2a1e68;}export class WorkflowWorkflowsCommand extends BaseCommand{[a42_0x1c8bd5(0x117)]='workflow:workflows';['description']=a42_0x1c8bd5(0xac);async[a42_0x1c8bd5(0xf2)](_0x53b0db){const _0x56b76d=a42_0x1c8bd5,{options:_0x55d7cc,args:_0x3cf8a0,tdx:_0x4b0294}=_0x53b0db,_0x54c00e=_0x3cf8a0[0x0];try{_0x55d7cc[_0x56b76d(0x106)]&&_0x54c00e&&console['error'](_0x56b76d(0xe8)+_0x54c00e);const _0x4c8c4b=await withSpinner(_0x56b76d(0xae),()=>_0x4b0294[_0x56b76d(0xc5)][_0x56b76d(0xd5)](_0x54c00e,{'limit':_0x55d7cc[_0x56b76d(0x110)]}),{'verbose':_0x55d7cc[_0x56b76d(0x106)]}),_0x5ef5b5=_0x4c8c4b['data'];return console[_0x56b76d(0x100)](_0x56b76d(0xe0)+_0x5ef5b5[_0x56b76d(0x108)]+_0x56b76d(0xc7)+(_0x5ef5b5[_0x56b76d(0x108)]!==0x1?'s':'')),await handleSDKOutput(_0x5ef5b5,_0x55d7cc),0x0;}catch(_0x1520b6){if(_0x1520b6 instanceof SDKError)return console[_0x56b76d(0x100)](_0x56b76d(0xce)+_0x1520b6['message']),_0x1520b6['cause']&&console['error'](_0x56b76d(0xcf)+_0x1520b6[_0x56b76d(0xa1)]),0x1;throw _0x1520b6;}}}export class WorkflowSessionsCommand extends BaseCommand{[a42_0x1c8bd5(0x117)]=a42_0x1c8bd5(0xea);[a42_0x1c8bd5(0x77)]=a42_0x1c8bd5(0x98);async['execute'](_0x491616){const _0x51f63e=a42_0x1c8bd5,{options:_0x3f384b,args:_0x5711ad,tdx:_0x2a6315}=_0x491616;let _0x5bf1cc,_0x1ee94e;if(_0x5711ad[0x0]){const _0x2558dc=_0x5711ad[0x0]['split']('.');if(_0x2558dc[_0x51f63e(0x108)]===0x1)_0x5bf1cc=_0x2558dc[0x0];else{if(_0x2558dc[_0x51f63e(0x108)]===0x2)[_0x5bf1cc,_0x1ee94e]=_0x2558dc;else return console[_0x51f63e(0x100)](_0x51f63e(0xd2)),0x1;}}try{if(_0x3f384b[_0x51f63e(0x106)]){if(_0x5bf1cc&&_0x1ee94e)console[_0x51f63e(0x100)](_0x51f63e(0x79)+_0x5bf1cc+'.'+_0x1ee94e);else _0x5bf1cc&&console[_0x51f63e(0x100)](_0x51f63e(0xf7)+_0x5bf1cc);const _0xd49ade=_0x3f384b[_0x51f63e(0x83)];_0xd49ade&&console[_0x51f63e(0x100)]('Status:\x20'+_0xd49ade);}const _0x3bc212=await withSpinner(_0x51f63e(0xad),()=>_0x2a6315[_0x51f63e(0xc5)][_0x51f63e(0x7c)]({'projectName':_0x5bf1cc,'workflowName':_0x1ee94e,'status':_0x3f384b[_0x51f63e(0x83)],'fromTime':_0x3f384b['from'],'toTime':_0x3f384b['to'],'limit':_0x3f384b[_0x51f63e(0x110)]}),{'verbose':_0x3f384b[_0x51f63e(0x106)]}),_0x14da97=_0x3bc212['data'];return console[_0x51f63e(0x100)]('✔\x20Found\x20'+_0x14da97[_0x51f63e(0x108)]+'\x20session'+(_0x14da97['length']!==0x1?'s':'')),await handleSDKOutput(_0x14da97,_0x3f384b),0x0;}catch(_0x47426b){if(_0x47426b instanceof SDKError)return console[_0x51f63e(0x100)](_0x51f63e(0xce)+_0x47426b[_0x51f63e(0xec)]),_0x47426b['cause']&&console['error'](_0x51f63e(0xcf)+_0x47426b['cause']),0x1;throw _0x47426b;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a42_0x1c8bd5(0x117)]=a42_0x1c8bd5(0xf4);[a42_0x1c8bd5(0x77)]=a42_0x1c8bd5(0xbe);async[a42_0x1c8bd5(0xf2)](_0x5618ed){const _0x2ec2e7=a42_0x1c8bd5,{options:_0x47ed37,args:_0x1c16bf,tdx:_0x2ce1eb}=_0x5618ed;let _0x27ff34,_0x51d26f;if(_0x1c16bf[0x0]){const _0x1d0703=_0x1c16bf[0x0][_0x2ec2e7(0xf0)]('.');if(_0x1d0703[_0x2ec2e7(0x108)]===0x1)_0x27ff34=_0x1d0703[0x0];else{if(_0x1d0703[_0x2ec2e7(0x108)]===0x2)[_0x27ff34,_0x51d26f]=_0x1d0703;else return console[_0x2ec2e7(0x100)](_0x2ec2e7(0xd2)),0x1;}}try{const _0x363607=_0x47ed37[_0x2ec2e7(0xe2)];if(_0x47ed37[_0x2ec2e7(0x106)]){if(_0x27ff34&&_0x51d26f)console[_0x2ec2e7(0x100)](_0x2ec2e7(0x79)+_0x27ff34+'.'+_0x51d26f);else _0x27ff34&&console[_0x2ec2e7(0x100)](_0x2ec2e7(0xf7)+_0x27ff34);_0x363607&&console[_0x2ec2e7(0x100)]('Include\x20retried:\x20yes');}const _0x2d3c9f=await withSpinner(_0x2ec2e7(0x87),()=>_0x2ce1eb['workflow'][_0x2ec2e7(0x96)]({'projectName':_0x27ff34,'workflowName':_0x51d26f,'includeRetried':_0x363607,'limit':_0x47ed37['limit']}),{'verbose':_0x47ed37[_0x2ec2e7(0x106)]}),_0x322c4c=_0x2d3c9f['data'];return console['error'](_0x2ec2e7(0xe0)+_0x322c4c['length']+_0x2ec2e7(0x94)+(_0x322c4c[_0x2ec2e7(0x108)]!==0x1?'s':'')),await handleSDKOutput(_0x322c4c,_0x47ed37),0x0;}catch(_0x255910){if(_0x255910 instanceof SDKError)return console[_0x2ec2e7(0x100)](_0x2ec2e7(0xce)+_0x255910[_0x2ec2e7(0xec)]),_0x255910[_0x2ec2e7(0xa1)]&&console[_0x2ec2e7(0x100)](_0x2ec2e7(0xcf)+_0x255910['cause']),0x1;throw _0x255910;}}}export class WorkflowAttemptCommand extends BaseCommand{[a42_0x1c8bd5(0x117)]=a42_0x1c8bd5(0x8d);['description']='Show\x20specific\x20attempt\x20details';async[a42_0x1c8bd5(0xf2)](_0x15f695){const _0x337767=a42_0x1c8bd5,{options:_0x535038,args:_0x15db23,tdx:_0x257ad7}=_0x15f695,_0xef929a=_0x15db23[0x0];if(!_0xef929a)return console[_0x337767(0x100)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{_0x535038[_0x337767(0x106)]&&console[_0x337767(0x100)](_0x337767(0xcc)+_0xef929a);const _0x126822=await withSpinner(_0x337767(0xb3),()=>_0x257ad7[_0x337767(0xc5)][_0x337767(0x103)](_0xef929a),{'verbose':_0x535038[_0x337767(0x106)]}),_0x1eb8fc=_0x126822[_0x337767(0xa3)];let _0x1f110f;!_0x1eb8fc[_0x337767(0x7a)]?_0x1f110f=_0x1eb8fc['cancelRequested']?'canceling':'running':_0x1f110f=_0x1eb8fc['success']?'success':_0x337767(0x100);let _0x241293;if(_0x1eb8fc[_0x337767(0xe7)]&&_0x1eb8fc[_0x337767(0x80)]){const _0x20ff4f=new Date(_0x1eb8fc['createdAt'])[_0x337767(0xd7)](),_0x12b061=new Date(_0x1eb8fc[_0x337767(0x80)])['getTime']();_0x241293=Math[_0x337767(0xf3)]((_0x12b061-_0x20ff4f)/0x3e8);}const _0x14822b={'attempt_id':_0x1eb8fc['id'],'status':_0x1f110f,..._0x1eb8fc[_0x337767(0xe5)]!==undefined&&{'index':_0x1eb8fc[_0x337767(0xe5)]},..._0x1eb8fc['project']&&{'project':_0x1eb8fc[_0x337767(0xf9)][_0x337767(0x117)]},..._0x1eb8fc[_0x337767(0xc5)]&&{'workflow':_0x1eb8fc[_0x337767(0xc5)]['name']},..._0x1eb8fc['sessionId']&&{'session_id':_0x1eb8fc[_0x337767(0xf8)]},..._0x1eb8fc[_0x337767(0x89)]&&{'session_time':_0x1eb8fc['sessionTime']},..._0x1eb8fc[_0x337767(0x10f)]&&{'retry_attempt':_0x1eb8fc['retryAttemptName']},..._0x241293!==undefined&&{'duration_sec':_0x241293},..._0x1eb8fc[_0x337767(0xe7)]&&{'created_at':_0x1eb8fc[_0x337767(0xe7)]},..._0x1eb8fc[_0x337767(0x80)]&&{'finished_at':_0x1eb8fc[_0x337767(0x80)]},...Object[_0x337767(0xfe)](_0x1eb8fc[_0x337767(0x81)])[_0x337767(0x108)]>0x0&&{'params':_0x1eb8fc[_0x337767(0x81)]}};return await handleSingleObjectOutput(_0x14822b,_0x535038),0x0;}catch(_0x3272ac){if(_0x3272ac instanceof SDKError)return console[_0x337767(0x100)](_0x337767(0xce)+_0x3272ac[_0x337767(0xec)]),_0x3272ac[_0x337767(0xa1)]&&console[_0x337767(0x100)](_0x337767(0xcf)+_0x3272ac[_0x337767(0xa1)]),0x1;throw _0x3272ac;}}}export class WorkflowTasksCommand extends BaseCommand{[a42_0x1c8bd5(0x117)]=a42_0x1c8bd5(0x114);[a42_0x1c8bd5(0x77)]='Show\x20tasks\x20for\x20an\x20attempt';async[a42_0x1c8bd5(0xf2)](_0x1dec3e){const _0x1ff6d0=a42_0x1c8bd5,{options:_0x2424fd,args:_0x46c12e,tdx:_0x1e4b03}=_0x1dec3e,_0x209d80=_0x46c12e[0x0];if(!_0x209d80)return console[_0x1ff6d0(0x100)](_0x1ff6d0(0xbd)),0x1;try{const _0x1eb8a8=_0x2424fd[_0x1ff6d0(0xef)];_0x2424fd[_0x1ff6d0(0x106)]&&(console[_0x1ff6d0(0x100)](_0x1ff6d0(0xcc)+_0x209d80),_0x1eb8a8&&console[_0x1ff6d0(0x100)](_0x1ff6d0(0x97)));const _0x402638=await withSpinner(_0x1ff6d0(0xaa),()=>_0x1e4b03[_0x1ff6d0(0xc5)][_0x1ff6d0(0xfa)](_0x209d80,_0x1eb8a8||![]),{'verbose':_0x2424fd[_0x1ff6d0(0x106)]}),_0x52473f=_0x402638[_0x1ff6d0(0xa3)];return console[_0x1ff6d0(0x100)]('✔\x20Found\x20'+_0x52473f['length']+'\x20task'+(_0x52473f['length']!==0x1?'s':'')),await handleSDKOutput(_0x52473f,_0x2424fd),0x0;}catch(_0x22a790){if(_0x22a790 instanceof SDKError)return console[_0x1ff6d0(0x100)]('Error:\x20'+_0x22a790['message']),_0x22a790[_0x1ff6d0(0xa1)]&&console[_0x1ff6d0(0x100)]('\x20\x20Cause:\x20'+_0x22a790[_0x1ff6d0(0xa1)]),0x1;throw _0x22a790;}}}export class WorkflowLogsCommand extends BaseCommand{[a42_0x1c8bd5(0x117)]=a42_0x1c8bd5(0xa4);[a42_0x1c8bd5(0x77)]=a42_0x1c8bd5(0x90);async[a42_0x1c8bd5(0xf2)](_0x3a06b1){const _0x47069b=a42_0x1c8bd5,{options:_0x5f2197,args:_0x161ff5,tdx:_0x589d1b}=_0x3a06b1,_0x1551ee=_0x161ff5[0x0];let _0x504c04=_0x161ff5[0x1];if(!_0x1551ee)return console[_0x47069b(0x100)](_0x47069b(0xbd)),0x1;try{_0x5f2197['verbose']&&(console[_0x47069b(0x100)](_0x47069b(0xcc)+_0x1551ee),_0x504c04&&console[_0x47069b(0x100)](_0x47069b(0x10c)+_0x504c04));const _0x1b1150=await withSpinner(_0x47069b(0xdb),()=>_0x589d1b[_0x47069b(0xc5)][_0x47069b(0xfb)](_0x1551ee,_0x504c04),{'verbose':_0x5f2197[_0x47069b(0x106)]}),_0x295424=_0x1b1150['data'];if(_0x295424[_0x47069b(0x108)]===0x0)return console[_0x47069b(0x100)](_0x47069b(0xca)),0x0;if(!_0x504c04&&(_0x5f2197['json']||_0x5f2197[_0x47069b(0xb9)]))return await handleSDKOutput(_0x295424,_0x5f2197),0x0;if(!_0x504c04){const _0x5d96fb=_0x295424['map'](_0x1d2ec1=>({'title':_0x1d2ec1[_0x47069b(0xb5)]+'\x20('+formatBytes(_0x1d2ec1[_0x47069b(0xcb)])+')','value':_0x1d2ec1[_0x47069b(0xb5)]})),_0x25bb7a=await a42_0x5da6d2({'type':_0x47069b(0x9b),'name':'task','message':_0x47069b(0x10a),'choices':_0x5d96fb});if(!_0x25bb7a['task'])return console[_0x47069b(0x100)](_0x47069b(0x76)),0x0;_0x504c04=_0x25bb7a[_0x47069b(0xe4)];}const _0x761230=await withSpinner('Downloading\x20logs...',()=>_0x589d1b[_0x47069b(0xc5)][_0x47069b(0x84)](_0x1551ee,_0x504c04),{'verbose':_0x5f2197[_0x47069b(0x106)]}),_0x378960=_0x761230[_0x47069b(0xa3)];return _0x378960?console[_0x47069b(0xbc)](_0x378960):console['error'](_0x47069b(0x10b)),0x0;}catch(_0x1a0b85){if(_0x1a0b85 instanceof SDKError)return console['error']('Error:\x20'+_0x1a0b85['message']),_0x1a0b85[_0x47069b(0xa1)]&&console[_0x47069b(0x100)](_0x47069b(0xcf)+_0x1a0b85['cause']),0x1;throw _0x1a0b85;}}}export class WorkflowKillCommand extends BaseCommand{[a42_0x1c8bd5(0x117)]=a42_0x1c8bd5(0xa7);['description']=a42_0x1c8bd5(0xa0);async[a42_0x1c8bd5(0xf2)](_0x106b79){const _0x21d41e=a42_0x1c8bd5,{options:_0x572f13,args:_0x5f1920,tdx:_0x3df405}=_0x106b79,_0x24f392=_0x5f1920[0x0];if(!_0x24f392)return console[_0x21d41e(0x100)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x32b6ec=_0x572f13['reason'];_0x572f13['verbose']&&(console[_0x21d41e(0x100)](_0x21d41e(0xcc)+_0x24f392),_0x32b6ec&&console[_0x21d41e(0x100)](_0x21d41e(0xd9)+_0x32b6ec));if(!_0x572f13[_0x21d41e(0x107)]){const _0x469502=await confirm(_0x21d41e(0x7d)+_0x24f392+'?');if(!_0x469502)return console[_0x21d41e(0x100)](_0x21d41e(0x76)),0x0;}const _0x31a7f6=await withSpinner(_0x21d41e(0xd0),()=>_0x3df405[_0x21d41e(0xc5)][_0x21d41e(0xe6)](_0x24f392,_0x32b6ec),{'verbose':_0x572f13[_0x21d41e(0x106)]}),_0x2eb568=_0x31a7f6[_0x21d41e(0xa3)];return console['error']('✔\x20'+_0x2eb568),0x0;}catch(_0x46358c){if(_0x46358c instanceof SDKError)return console['error']('Error:\x20'+_0x46358c[_0x21d41e(0xec)]),_0x46358c[_0x21d41e(0xa1)]&&console['error'](_0x21d41e(0xcf)+_0x46358c[_0x21d41e(0xa1)]),0x1;throw _0x46358c;}}}export class WorkflowRetryCommand extends BaseCommand{[a42_0x1c8bd5(0x117)]=a42_0x1c8bd5(0x8c);[a42_0x1c8bd5(0x77)]=a42_0x1c8bd5(0x9d);async['execute'](_0x3de1ae){const _0x8043df=a42_0x1c8bd5,{options:_0x26588c,args:_0x2c4448,tdx:_0x35d1c2}=_0x3de1ae,_0x15ec8f=_0x2c4448[0x0];if(!_0x15ec8f)return console[_0x8043df(0x100)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x8043df(0x100)](_0x8043df(0xda)),0x1;let _0x24561d=![],_0x5ca0fb=_0x15ec8f;if(_0x15ec8f['startsWith']('session:'))_0x24561d=!![],_0x5ca0fb=_0x15ec8f['substring'](0x8);else{if(_0x15ec8f[_0x8043df(0x9c)](_0x8043df(0xb8)))_0x24561d=![],_0x5ca0fb=_0x15ec8f['substring'](0x8);else return console[_0x8043df(0x100)](_0x8043df(0x115)),console['error'](_0x8043df(0xda)),0x1;}try{const _0x1f6fb7=_0x26588c[_0x8043df(0xb7)],_0x52e634=_0x26588c[_0x8043df(0xdc)],_0x476ae7=_0x26588c['params'],_0x472322=_0x26588c[_0x8043df(0xf5)];_0x26588c['verbose']&&(console[_0x8043df(0x100)]('Target:\x20'+(_0x24561d?_0x8043df(0x111):'attempt')+'\x20'+_0x5ca0fb),_0x1f6fb7&&console[_0x8043df(0x100)](_0x8043df(0x105)+_0x1f6fb7),_0x52e634&&console[_0x8043df(0x100)](_0x8043df(0xa5)+_0x52e634),_0x476ae7&&console[_0x8043df(0x100)](_0x8043df(0xf6)+_0x476ae7),_0x472322&&console[_0x8043df(0x100)](_0x8043df(0x82)));let _0x46dd4d;if(_0x476ae7)try{if(_0x476ae7[_0x8043df(0x9c)]('@')){const _0x4be510=await import(_0x8043df(0x6f)),_0x109809=_0x476ae7['substring'](0x1),_0x3a169f=await _0x4be510[_0x8043df(0xc1)](_0x109809,_0x8043df(0xe1));_0x46dd4d=JSON[_0x8043df(0x102)](_0x3a169f);}else _0x46dd4d=JSON[_0x8043df(0x102)](_0x476ae7);}catch{return console['error']('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x26588c['yes']){const _0x6e7f33=await confirm(_0x8043df(0x9f)+(_0x24561d?'session':'attempt')+'\x20'+_0x5ca0fb+'?');if(!_0x6e7f33)return console[_0x8043df(0x100)](_0x8043df(0x76)),0x0;}let _0x16574a;_0x24561d?_0x16574a=await withSpinner(_0x8043df(0x9e),()=>_0x35d1c2[_0x8043df(0xc5)][_0x8043df(0x112)](_0x5ca0fb,{'fromTask':_0x1f6fb7,'retryParams':_0x46dd4d}),{'verbose':_0x26588c[_0x8043df(0x106)]}):_0x16574a=await withSpinner('Retrying\x20attempt...',()=>_0x35d1c2[_0x8043df(0xc5)][_0x8043df(0x91)](_0x5ca0fb,{'resumeFrom':_0x52e634,'retryParams':_0x46dd4d,'force':_0x472322}),{'verbose':_0x26588c[_0x8043df(0x106)]});const _0x2267d2=_0x16574a['data'];return console[_0x8043df(0x100)](_0x8043df(0xc0)),console[_0x8043df(0x100)](_0x8043df(0xc2)+_0x2267d2[_0x8043df(0xab)]),console['error'](_0x8043df(0x8b)+_0x2267d2[_0x8043df(0xf8)]),0x0;}catch(_0x44d8eb){if(_0x44d8eb instanceof SDKError)return console['error'](_0x8043df(0xce)+_0x44d8eb['message']),_0x44d8eb[_0x8043df(0xa1)]&&console[_0x8043df(0x100)](_0x8043df(0xcf)+_0x44d8eb[_0x8043df(0xa1)]),0x1;throw _0x44d8eb;}}}export class WorkflowRunCommand extends BaseCommand{[a42_0x1c8bd5(0x117)]=a42_0x1c8bd5(0x71);[a42_0x1c8bd5(0x77)]=a42_0x1c8bd5(0xc4);async[a42_0x1c8bd5(0xf2)](_0x59eea0){const _0x3c55a0=a42_0x1c8bd5,{options:_0x1a39bd,args:_0x85ec4b,tdx:_0x259236}=_0x59eea0,_0x3db4fb=_0x85ec4b[0x0];if(!_0x3db4fb)return console[_0x3c55a0(0x100)]('Error:\x20Workflow\x20identifier\x20is\x20required'),console[_0x3c55a0(0x100)](_0x3c55a0(0xa6)),0x1;const _0x4e1beb=_0x1a39bd['param'],_0x844889=_0x1a39bd['sessionTime'],_0x4f140a={};if(_0x4e1beb&&Array['isArray'](_0x4e1beb))for(const _0x4a3d4e of _0x4e1beb){const _0x3feb3a=_0x4a3d4e[_0x3c55a0(0x7b)]('=');if(_0x3feb3a===-0x1)return console[_0x3c55a0(0x100)](_0x3c55a0(0xdf)+_0x4a3d4e),console[_0x3c55a0(0x100)](_0x3c55a0(0x72)),0x1;const _0x71df3b=_0x4a3d4e[_0x3c55a0(0x93)](0x0,_0x3feb3a),_0x3478d5=_0x4a3d4e[_0x3c55a0(0x93)](_0x3feb3a+0x1);try{_0x4f140a[_0x71df3b]=JSON[_0x3c55a0(0x102)](_0x3478d5);}catch{_0x4f140a[_0x71df3b]=_0x3478d5;}}_0x1a39bd[_0x3c55a0(0x106)]&&(console[_0x3c55a0(0x100)](_0x3c55a0(0xd3)+_0x3db4fb),Object[_0x3c55a0(0xfe)](_0x4f140a)[_0x3c55a0(0x108)]>0x0&&console[_0x3c55a0(0x100)](_0x3c55a0(0xd1)+JSON[_0x3c55a0(0xff)](_0x4f140a)),_0x844889&&console['error'](_0x3c55a0(0xc6)+_0x844889));const _0x2847e3=await withSpinner(_0x3c55a0(0xde),()=>_0x259236[_0x3c55a0(0xc5)]['run'](_0x3db4fb,_0x4f140a,{'sessionTime':_0x844889}),{'verbose':_0x1a39bd[_0x3c55a0(0x106)]}),_0x4a2c03=_0x2847e3[_0x3c55a0(0xa3)];return console[_0x3c55a0(0x100)](_0x3c55a0(0x7e)),console[_0x3c55a0(0x100)](_0x3c55a0(0x99)+_0x4a2c03['id']),console['error']('\x20\x20Session\x20ID:\x20'+_0x4a2c03[_0x3c55a0(0xf8)]),console[_0x3c55a0(0x100)](_0x3c55a0(0xc9)+_0x4a2c03[_0x3c55a0(0xf9)]?.['name']),console[_0x3c55a0(0x100)](_0x3c55a0(0xe3)+_0x4a2c03[_0x3c55a0(0xc5)]?.['name']),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a42_0x1c8bd5(0x8e);[a42_0x1c8bd5(0x77)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a42_0x1c8bd5(0xf2)](_0x44f645){const _0x550997=a42_0x1c8bd5,{options:_0x5b0329,args:_0x430b48,tdx:_0x40be36}=_0x44f645,_0xd17509=_0x430b48[0x0],_0x233159=_0x430b48[0x1]||'.';if(!_0xd17509)return console[_0x550997(0x100)](_0x550997(0x74)),console['error'](_0x550997(0xc3)),0x1;const _0x1ede09=_0x5b0329[_0x550997(0xd6)];_0x5b0329['verbose']&&(console[_0x550997(0x100)](_0x550997(0x104)+_0xd17509),console[_0x550997(0x100)]('Output\x20directory:\x20'+_0x233159),_0x1ede09&&console[_0x550997(0x100)](_0x550997(0x101)+_0x1ede09));const _0x3e8931=await withSpinner(_0x550997(0xbb)+_0xd17509+_0x550997(0xcd),()=>_0x40be36['workflow'][_0x550997(0x95)](_0xd17509,_0x233159,{'revision':_0x1ede09}),{'verbose':_0x5b0329['verbose']}),_0x352b10=_0x3e8931[_0x550997(0xa3)];return console['error']('✔\x20Downloaded\x20'+_0x352b10[_0x550997(0xb2)]),console[_0x550997(0x100)]('\x20\x20Revision:\x20'+_0x352b10[_0x550997(0xd6)]),console['error']('\x20\x20Files\x20extracted:\x20'+_0x352b10[_0x550997(0x6e)]),console[_0x550997(0x100)](_0x550997(0xed)+_0x233159+'/'+_0x352b10['projectName']),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a42_0x1c8bd5(0x117)]=a42_0x1c8bd5(0xa8);[a42_0x1c8bd5(0x77)]=a42_0x1c8bd5(0xb1);async['execute'](_0x5b5986){const _0x3a4b95=a42_0x1c8bd5,{options:_0x2c87ba,args:_0x1fd114,tdx:_0x19558c}=_0x5b5986;let _0xf83cc7='.',_0x3f32df=_0x2c87ba[_0x3a4b95(0x117)];if(_0x1fd114[0x0]){const {promises:_0x3de70e}=await import('fs');try{const _0x4e9a24=await _0x3de70e[_0x3a4b95(0x113)](_0x1fd114[0x0]);if(_0x4e9a24[_0x3a4b95(0xe9)]())_0xf83cc7=_0x1fd114[0x0];else return console[_0x3a4b95(0x100)](_0x3a4b95(0xce)+_0x1fd114[0x0]+_0x3a4b95(0x9a)),0x1;}catch{_0x3f32df=_0x1fd114[0x0],_0xf83cc7='.';}}const _0x3b52a8=_0x2c87ba[_0x3a4b95(0xd6)],_0x4be117=_0x2c87ba[_0x3a4b95(0xc8)];_0x2c87ba[_0x3a4b95(0x106)]&&(console[_0x3a4b95(0x100)]('Project\x20directory:\x20'+_0xf83cc7),_0x3f32df&&console[_0x3a4b95(0x100)](_0x3a4b95(0x116)+_0x3f32df),_0x3b52a8&&console[_0x3a4b95(0x100)](_0x3a4b95(0x101)+_0x3b52a8),_0x4be117&&console['error'](_0x3a4b95(0x86)));const _0x12f6fc=await withSpinner(_0x3a4b95(0xa2),()=>_0x19558c['workflow'][_0x3a4b95(0x88)](_0xf83cc7,{'projectName':_0x3f32df,'revision':_0x3b52a8,'skipValidation':_0x4be117}),{'verbose':_0x2c87ba[_0x3a4b95(0x106)]}),_0x1430b5=_0x12f6fc['data'];return console[_0x3a4b95(0x100)]('✔\x20Pushed\x20'+_0x1430b5['projectName']),console[_0x3a4b95(0x100)](_0x3a4b95(0x8a)+_0x1430b5[_0x3a4b95(0xd4)]),console[_0x3a4b95(0x100)](_0x3a4b95(0x7f)+_0x1430b5[_0x3a4b95(0xd6)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a42_0x1c8bd5(0x10e);[a42_0x1c8bd5(0x77)]=a42_0x1c8bd5(0x8f);async[a42_0x1c8bd5(0xf2)](_0x31c104){const _0x427ea0=a42_0x1c8bd5,{options:_0xf36126,args:_0x25bf31,tdx:_0x5b4a26}=_0x31c104,_0x25741e=_0x25bf31[0x0];if(!_0x25741e)return console['error']('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x427ea0(0x100)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0xf36126[_0x427ea0(0x106)]&&console[_0x427ea0(0x100)](_0x427ea0(0x104)+_0x25741e);if(!_0xf36126['yes']){const _0x1f7585=await confirm(_0x427ea0(0x70)+_0x25741e+_0x427ea0(0xf1));if(!_0x1f7585)return console[_0x427ea0(0x100)](_0x427ea0(0x76)),0x0;}const _0x2449c5=await withSpinner(_0x427ea0(0xdd)+_0x25741e+_0x427ea0(0xcd),()=>_0x5b4a26[_0x427ea0(0xc5)][_0x427ea0(0xbf)](_0x25741e),{'verbose':_0xf36126[_0x427ea0(0x106)]}),_0x5e5d33=_0x2449c5[_0x427ea0(0xa3)];return console['error']('✔\x20Deleted\x20project\x20'+_0x5e5d33['projectName']),console[_0x427ea0(0x100)](_0x427ea0(0x8a)+_0x5e5d33['projectId']),0x0;}}
|
|
1
|
+
const a42_0x39f797=a42_0x8e82;(function(_0x3920f7,_0x589d9d){const _0x23c633=a42_0x8e82,_0x50fc2b=_0x3920f7();while(!![]){try{const _0x465694=parseInt(_0x23c633(0x15d))/0x1*(-parseInt(_0x23c633(0x136))/0x2)+parseInt(_0x23c633(0x163))/0x3+-parseInt(_0x23c633(0x162))/0x4+-parseInt(_0x23c633(0x164))/0x5+parseInt(_0x23c633(0x156))/0x6+-parseInt(_0x23c633(0x17f))/0x7+parseInt(_0x23c633(0x1bd))/0x8;if(_0x465694===_0x589d9d)break;else _0x50fc2b['push'](_0x50fc2b['shift']());}catch(_0xd68cfb){_0x50fc2b['push'](_0x50fc2b['shift']());}}}(a42_0x2484,0xc4f08));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a42_0x2484(){const _0x4254f4=['filesExtracted','download','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','task','Error:\x20Invalid\x20JSON\x20in\x20--params','Deleting\x20project\x20','retryAttempt','\x20\x20Project\x20ID:\x20','✔\x20Found\x20','yes','projectName','workflow:retry','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','\x20project','Select\x20a\x20task\x20to\x20view\x20logs:','reason','workflow:sessions','Target:\x20','\x20task','\x20\x20Cause:\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','attempt','length','Listing\x20workflows...','List\x20workflow\x20attempts','workflow:attempt','From\x20task:\x20','workflow:projects','Include\x20retried:\x20yes','canceling','Resume\x20from:\x20','from','cause','Project\x20filter:\x20','map','122TSVTEM','data','List\x20workflows','status','params','Project\x20directory:\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','session','Listing\x20workflow\x20attempts...','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','workflow:tasks','finishedAt','List\x20all\x20workflow\x20projects','Project:\x20','\x20\x20Project:\x20','\x20attempt','sessions','readFile','isDirectory','\x20workflow','\x20\x20Files\x20extracted:\x20','Getting\x20attempt\x20details...','tasks','Project\x20name:\x20','Downloading\x20project\x20','retryAttemptName','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','✔\x20Downloaded\x20','workflow:attempts','Parameters:\x20','workflow:download','Attempt\x20ID:\x20','8028306INUmnF','getTime','keys','push','✔\x20Deleted\x20project\x20','Start\x20a\x20workflow\x20run','limit','4413hLBTIU','Revision:\x20','Listing\x20workflow\x20projects...','Error:\x20Project\x20name\x20is\x20required','workflow','4435172SaSIpU','2982765JBWTPW','5212945ZIWCdF','\x22?\x20This\x20cannot\x20be\x20undone.','Kill\x20a\x20running\x20attempt','Status:\x20','description','utf-8','\x20session','force','success','workflow:kill','Output\x20directory:\x20','Task\x20name:\x20','Retry\x20a\x20session\x20or\x20attempt','param','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','fromTask','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','stringify','\x20\x20Location:\x20','Expected\x20format:\x20--param\x20key=value','\x20\x20Workflow:\x20','resumeFrom','Cancelled','substring','Retrying\x20session...','Listing\x20workflow\x20sessions...','1291465xxdonF','\x20\x20Session\x20ID:\x20','delete','workflow:run','Reason:\x20','taskName','Including\x20subtasks:\x20yes','✔\x20Pushed\x20','sessionTime','split','Killing\x20attempt...','✔\x20Retry\x20started','Validation:\x20skipped','Error:\x20Attempt\x20ID\x20is\x20required','project','Error:\x20','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','startsWith','select','indexOf','retrySession','projects','logFiles','fs/promises','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Filter:\x20project=','workflow:workflows','sessionId','parse','isArray','done','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','round','message','createdAt','index','Pattern:\x20','\x20\x20New\x20attempt\x20ID:\x20','execute','Workflow:\x20','workflow:delete','Session\x20time:\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','verbose','log','attempts','includeSubtasks','fileSize','projectId','Filter:\x20','cancelRequested','format','name','error','stat','No\x20log\x20content\x20found','Force:\x20yes','Retrying\x20attempt...','Show\x20specific\x20attempt\x20details','Fetching\x20log\x20files...','revision','session:','8635424bdNzSo','run','...','Getting\x20attempt\x20tasks...','Starting\x20workflow\x20run...'];a42_0x2484=function(){return _0x4254f4;};return a42_0x2484();}import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a42_0x8e82(_0x4c8d42,_0x53aa68){_0x4c8d42=_0x4c8d42-0x129;const _0x248410=a42_0x2484();let _0x8e82ac=_0x248410[_0x4c8d42];return _0x8e82ac;}import{confirm}from'../utils/prompt.js';import{formatBytes}from'../utils/formatters.js';import a42_0x5bf2b7 from'prompts';export class WorkflowProjectsCommand extends BaseCommand{['name']=a42_0x39f797(0x12e);[a42_0x39f797(0x168)]=a42_0x39f797(0x142);async['execute'](_0x1b4d49){const _0x3d3501=a42_0x39f797,{options:_0x33d8b4,args:_0x4eaf7f,tdx:_0x37d261}=_0x1b4d49,_0x1bb152=_0x4eaf7f[0x0];try{_0x33d8b4[_0x3d3501(0x1aa)]&&_0x1bb152&&console[_0x3d3501(0x1b4)](_0x3d3501(0x1a3)+_0x1bb152);const _0x56f2bf=await withSpinner(_0x3d3501(0x15f),()=>_0x37d261[_0x3d3501(0x161)][_0x3d3501(0x194)](_0x1bb152,{'limit':_0x33d8b4['limit']}),{'verbose':_0x33d8b4['verbose']}),_0x2d3ff0=_0x56f2bf[_0x3d3501(0x137)];return console['error'](_0x3d3501(0x1ca)+_0x2d3ff0['length']+_0x3d3501(0x1cf)+(_0x2d3ff0[_0x3d3501(0x129)]!==0x1?'s':'')),await handleSDKOutput(_0x2d3ff0,_0x33d8b4),0x0;}catch(_0x3220cb){if(_0x3220cb instanceof SDKError)return console['error'](_0x3d3501(0x18e)+_0x3220cb['message']),_0x3220cb[_0x3d3501(0x133)]&&console[_0x3d3501(0x1b4)](_0x3d3501(0x1d5)+_0x3220cb[_0x3d3501(0x133)]),0x1;throw _0x3220cb;}}}export class WorkflowWorkflowsCommand extends BaseCommand{['name']=a42_0x39f797(0x199);[a42_0x39f797(0x168)]=a42_0x39f797(0x138);async[a42_0x39f797(0x1a5)](_0x1de52f){const _0x130f2e=a42_0x39f797,{options:_0x2e4481,args:_0x11b098,tdx:_0x459d0a}=_0x1de52f,_0x39e360=_0x11b098[0x0];try{_0x2e4481[_0x130f2e(0x1aa)]&&_0x39e360&&console[_0x130f2e(0x1b4)](_0x130f2e(0x134)+_0x39e360);const _0x19cd4a=await withSpinner(_0x130f2e(0x12a),()=>_0x459d0a[_0x130f2e(0x161)]['workflows'](_0x39e360,{'limit':_0x2e4481[_0x130f2e(0x15c)]}),{'verbose':_0x2e4481[_0x130f2e(0x1aa)]}),_0x4cfc59=_0x19cd4a[_0x130f2e(0x137)];return console['error'](_0x130f2e(0x1ca)+_0x4cfc59[_0x130f2e(0x129)]+_0x130f2e(0x149)+(_0x4cfc59['length']!==0x1?'s':'')),await handleSDKOutput(_0x4cfc59,_0x2e4481),0x0;}catch(_0x541d8c){if(_0x541d8c instanceof SDKError)return console[_0x130f2e(0x1b4)](_0x130f2e(0x18e)+_0x541d8c[_0x130f2e(0x1a0)]),_0x541d8c[_0x130f2e(0x133)]&&console[_0x130f2e(0x1b4)](_0x130f2e(0x1d5)+_0x541d8c['cause']),0x1;throw _0x541d8c;}}}export class WorkflowSessionsCommand extends BaseCommand{[a42_0x39f797(0x1b3)]=a42_0x39f797(0x1d2);[a42_0x39f797(0x168)]='List\x20workflow\x20execution\x20sessions';async[a42_0x39f797(0x1a5)](_0x2e6194){const _0x180c1b=a42_0x39f797,{options:_0x34588e,args:_0x3e4015,tdx:_0x32396e}=_0x2e6194;let _0x249508,_0x113cce;if(_0x3e4015[0x0]){const _0x4facd8=_0x3e4015[0x0][_0x180c1b(0x188)]('.');if(_0x4facd8['length']===0x1)_0x249508=_0x4facd8[0x0];else{if(_0x4facd8[_0x180c1b(0x129)]===0x2)[_0x249508,_0x113cce]=_0x4facd8;else return console[_0x180c1b(0x1b4)](_0x180c1b(0x175)),0x1;}}try{if(_0x34588e[_0x180c1b(0x1aa)]){if(_0x249508&&_0x113cce)console[_0x180c1b(0x1b4)](_0x180c1b(0x1b0)+_0x249508+'.'+_0x113cce);else _0x249508&&console[_0x180c1b(0x1b4)](_0x180c1b(0x198)+_0x249508);const _0xb6ba37=_0x34588e['status'];_0xb6ba37&&console[_0x180c1b(0x1b4)](_0x180c1b(0x167)+_0xb6ba37);}const _0x2f3ee7=await withSpinner(_0x180c1b(0x17e),()=>_0x32396e[_0x180c1b(0x161)][_0x180c1b(0x146)]({'projectName':_0x249508,'workflowName':_0x113cce,'status':_0x34588e[_0x180c1b(0x139)],'fromTime':_0x34588e[_0x180c1b(0x132)],'toTime':_0x34588e['to'],'limit':_0x34588e[_0x180c1b(0x15c)]}),{'verbose':_0x34588e[_0x180c1b(0x1aa)]}),_0x32e662=_0x2f3ee7[_0x180c1b(0x137)];return console[_0x180c1b(0x1b4)](_0x180c1b(0x1ca)+_0x32e662[_0x180c1b(0x129)]+_0x180c1b(0x16a)+(_0x32e662[_0x180c1b(0x129)]!==0x1?'s':'')),await handleSDKOutput(_0x32e662,_0x34588e),0x0;}catch(_0xef145c){if(_0xef145c instanceof SDKError)return console[_0x180c1b(0x1b4)](_0x180c1b(0x18e)+_0xef145c[_0x180c1b(0x1a0)]),_0xef145c[_0x180c1b(0x133)]&&console[_0x180c1b(0x1b4)]('\x20\x20Cause:\x20'+_0xef145c[_0x180c1b(0x133)]),0x1;throw _0xef145c;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a42_0x39f797(0x1b3)]=a42_0x39f797(0x152);['description']=a42_0x39f797(0x12b);async[a42_0x39f797(0x1a5)](_0x46d81b){const _0x410008=a42_0x39f797,{options:_0xc20a89,args:_0x2bc835,tdx:_0x176a30}=_0x46d81b;let _0x5c52be,_0x5269f9;if(_0x2bc835[0x0]){const _0x44eeb6=_0x2bc835[0x0][_0x410008(0x188)]('.');if(_0x44eeb6['length']===0x1)_0x5c52be=_0x44eeb6[0x0];else{if(_0x44eeb6['length']===0x2)[_0x5c52be,_0x5269f9]=_0x44eeb6;else return console['error'](_0x410008(0x175)),0x1;}}try{const _0x155b60=_0xc20a89['includeRetried'];if(_0xc20a89[_0x410008(0x1aa)]){if(_0x5c52be&&_0x5269f9)console[_0x410008(0x1b4)]('Filter:\x20'+_0x5c52be+'.'+_0x5269f9);else _0x5c52be&&console[_0x410008(0x1b4)]('Filter:\x20project='+_0x5c52be);_0x155b60&&console[_0x410008(0x1b4)](_0x410008(0x12f));}const _0x8bb38=await withSpinner(_0x410008(0x13e),()=>_0x176a30[_0x410008(0x161)][_0x410008(0x1ac)]({'projectName':_0x5c52be,'workflowName':_0x5269f9,'includeRetried':_0x155b60,'limit':_0xc20a89[_0x410008(0x15c)]}),{'verbose':_0xc20a89[_0x410008(0x1aa)]}),_0x13fadb=_0x8bb38[_0x410008(0x137)];return console[_0x410008(0x1b4)]('✔\x20Found\x20'+_0x13fadb[_0x410008(0x129)]+_0x410008(0x145)+(_0x13fadb[_0x410008(0x129)]!==0x1?'s':'')),await handleSDKOutput(_0x13fadb,_0xc20a89),0x0;}catch(_0x132dda){if(_0x132dda instanceof SDKError)return console[_0x410008(0x1b4)](_0x410008(0x18e)+_0x132dda[_0x410008(0x1a0)]),_0x132dda[_0x410008(0x133)]&&console[_0x410008(0x1b4)](_0x410008(0x1d5)+_0x132dda[_0x410008(0x133)]),0x1;throw _0x132dda;}}}export class WorkflowAttemptCommand extends BaseCommand{[a42_0x39f797(0x1b3)]=a42_0x39f797(0x12c);['description']=a42_0x39f797(0x1b9);async[a42_0x39f797(0x1a5)](_0x32b9b2){const _0x1f0d37=a42_0x39f797,{options:_0xa79d6,args:_0xd96fe7,tdx:_0x1617fd}=_0x32b9b2,_0xf87d31=_0xd96fe7[0x0];if(!_0xf87d31)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{_0xa79d6[_0x1f0d37(0x1aa)]&&console['error'](_0x1f0d37(0x155)+_0xf87d31);const _0x299458=await withSpinner(_0x1f0d37(0x14b),()=>_0x1617fd[_0x1f0d37(0x161)][_0x1f0d37(0x1d7)](_0xf87d31),{'verbose':_0xa79d6[_0x1f0d37(0x1aa)]}),_0x3a165a=_0x299458[_0x1f0d37(0x137)];let _0x4ecb5a;!_0x3a165a[_0x1f0d37(0x19d)]?_0x4ecb5a=_0x3a165a[_0x1f0d37(0x1b1)]?_0x1f0d37(0x130):'running':_0x4ecb5a=_0x3a165a[_0x1f0d37(0x16c)]?_0x1f0d37(0x16c):_0x1f0d37(0x1b4);let _0x3e12d2;if(_0x3a165a[_0x1f0d37(0x1a1)]&&_0x3a165a[_0x1f0d37(0x141)]){const _0x592cce=new Date(_0x3a165a[_0x1f0d37(0x1a1)])[_0x1f0d37(0x157)](),_0x5c3452=new Date(_0x3a165a['finishedAt'])[_0x1f0d37(0x157)]();_0x3e12d2=Math[_0x1f0d37(0x19f)]((_0x5c3452-_0x592cce)/0x3e8);}const _0x3f6796={'attempt_id':_0x3a165a['id'],'status':_0x4ecb5a,..._0x3a165a[_0x1f0d37(0x1a2)]!==undefined&&{'index':_0x3a165a[_0x1f0d37(0x1a2)]},..._0x3a165a['project']&&{'project':_0x3a165a[_0x1f0d37(0x18d)][_0x1f0d37(0x1b3)]},..._0x3a165a[_0x1f0d37(0x161)]&&{'workflow':_0x3a165a['workflow']['name']},..._0x3a165a[_0x1f0d37(0x19a)]&&{'session_id':_0x3a165a[_0x1f0d37(0x19a)]},..._0x3a165a[_0x1f0d37(0x187)]&&{'session_time':_0x3a165a[_0x1f0d37(0x187)]},..._0x3a165a['retryAttemptName']&&{'retry_attempt':_0x3a165a[_0x1f0d37(0x14f)]},..._0x3e12d2!==undefined&&{'duration_sec':_0x3e12d2},..._0x3a165a[_0x1f0d37(0x1a1)]&&{'created_at':_0x3a165a[_0x1f0d37(0x1a1)]},..._0x3a165a[_0x1f0d37(0x141)]&&{'finished_at':_0x3a165a[_0x1f0d37(0x141)]},...Object['keys'](_0x3a165a[_0x1f0d37(0x13a)])[_0x1f0d37(0x129)]>0x0&&{'params':_0x3a165a[_0x1f0d37(0x13a)]}};return await handleSingleObjectOutput(_0x3f6796,_0xa79d6),0x0;}catch(_0x9c1a09){if(_0x9c1a09 instanceof SDKError)return console[_0x1f0d37(0x1b4)]('Error:\x20'+_0x9c1a09['message']),_0x9c1a09[_0x1f0d37(0x133)]&&console[_0x1f0d37(0x1b4)](_0x1f0d37(0x1d5)+_0x9c1a09['cause']),0x1;throw _0x9c1a09;}}}export class WorkflowTasksCommand extends BaseCommand{[a42_0x39f797(0x1b3)]=a42_0x39f797(0x140);[a42_0x39f797(0x168)]='Show\x20tasks\x20for\x20an\x20attempt';async[a42_0x39f797(0x1a5)](_0x57a816){const _0x4c5d10=a42_0x39f797,{options:_0x2f8556,args:_0x295561,tdx:_0x5239f2}=_0x57a816,_0x171ed3=_0x295561[0x0];if(!_0x171ed3)return console[_0x4c5d10(0x1b4)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x2afe2f=_0x2f8556[_0x4c5d10(0x1ad)];_0x2f8556[_0x4c5d10(0x1aa)]&&(console[_0x4c5d10(0x1b4)](_0x4c5d10(0x155)+_0x171ed3),_0x2afe2f&&console[_0x4c5d10(0x1b4)](_0x4c5d10(0x185)));const _0x52f74f=await withSpinner(_0x4c5d10(0x1c0),()=>_0x5239f2[_0x4c5d10(0x161)][_0x4c5d10(0x14c)](_0x171ed3,_0x2afe2f||![]),{'verbose':_0x2f8556['verbose']}),_0x3ee4f3=_0x52f74f[_0x4c5d10(0x137)];return console[_0x4c5d10(0x1b4)](_0x4c5d10(0x1ca)+_0x3ee4f3['length']+_0x4c5d10(0x1d4)+(_0x3ee4f3[_0x4c5d10(0x129)]!==0x1?'s':'')),await handleSDKOutput(_0x3ee4f3,_0x2f8556),0x0;}catch(_0x55527c){if(_0x55527c instanceof SDKError)return console[_0x4c5d10(0x1b4)](_0x4c5d10(0x18e)+_0x55527c[_0x4c5d10(0x1a0)]),_0x55527c[_0x4c5d10(0x133)]&&console[_0x4c5d10(0x1b4)](_0x4c5d10(0x1d5)+_0x55527c[_0x4c5d10(0x133)]),0x1;throw _0x55527c;}}}export class WorkflowLogsCommand extends BaseCommand{[a42_0x39f797(0x1b3)]='workflow:logs';[a42_0x39f797(0x168)]=a42_0x39f797(0x172);async[a42_0x39f797(0x1a5)](_0xea38bc){const _0x3503dd=a42_0x39f797,{options:_0x2dd129,args:_0x5c004a,tdx:_0x3ce5f0}=_0xea38bc,_0x418f11=_0x5c004a[0x0];let _0x4257fa=_0x5c004a[0x1];if(!_0x418f11)return console['error'](_0x3503dd(0x18c)),0x1;try{_0x2dd129['verbose']&&(console['error'](_0x3503dd(0x155)+_0x418f11),_0x4257fa&&console[_0x3503dd(0x1b4)](_0x3503dd(0x16f)+_0x4257fa));const _0x5e03fd=await withSpinner(_0x3503dd(0x1ba),()=>_0x3ce5f0[_0x3503dd(0x161)][_0x3503dd(0x195)](_0x418f11,_0x4257fa),{'verbose':_0x2dd129['verbose']}),_0x218ff2=_0x5e03fd[_0x3503dd(0x137)];if(_0x218ff2[_0x3503dd(0x129)]===0x0)return console[_0x3503dd(0x1b4)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x4257fa&&(_0x2dd129['json']||_0x2dd129[_0x3503dd(0x1b2)]))return await handleSDKOutput(_0x218ff2,_0x2dd129),0x0;if(!_0x4257fa){const _0x34ebed=_0x218ff2[_0x3503dd(0x135)](_0x2b391e=>({'title':_0x2b391e[_0x3503dd(0x184)]+'\x20('+formatBytes(_0x2b391e[_0x3503dd(0x1ae)])+')','value':_0x2b391e[_0x3503dd(0x184)]})),_0x8c324f=await a42_0x5bf2b7({'type':_0x3503dd(0x191),'name':'task','message':_0x3503dd(0x1d0),'choices':_0x34ebed});if(!_0x8c324f[_0x3503dd(0x1c5)])return console['error']('Cancelled'),0x0;_0x4257fa=_0x8c324f[_0x3503dd(0x1c5)];}const _0x169a88=await withSpinner('Downloading\x20logs...',()=>_0x3ce5f0[_0x3503dd(0x161)]['logs'](_0x418f11,_0x4257fa),{'verbose':_0x2dd129[_0x3503dd(0x1aa)]}),_0x510a74=_0x169a88['data'];return _0x510a74?console[_0x3503dd(0x1ab)](_0x510a74):console[_0x3503dd(0x1b4)](_0x3503dd(0x1b6)),0x0;}catch(_0x5a951d){if(_0x5a951d instanceof SDKError)return console[_0x3503dd(0x1b4)](_0x3503dd(0x18e)+_0x5a951d[_0x3503dd(0x1a0)]),_0x5a951d['cause']&&console['error'](_0x3503dd(0x1d5)+_0x5a951d[_0x3503dd(0x133)]),0x1;throw _0x5a951d;}}}export class WorkflowKillCommand extends BaseCommand{[a42_0x39f797(0x1b3)]=a42_0x39f797(0x16d);[a42_0x39f797(0x168)]=a42_0x39f797(0x166);async['execute'](_0x293725){const _0x3967bc=a42_0x39f797,{options:_0x47bd0f,args:_0x2b6241,tdx:_0xaf9659}=_0x293725,_0x351073=_0x2b6241[0x0];if(!_0x351073)return console[_0x3967bc(0x1b4)](_0x3967bc(0x18c)),0x1;try{const _0x158be4=_0x47bd0f[_0x3967bc(0x1d1)];_0x47bd0f[_0x3967bc(0x1aa)]&&(console['error'](_0x3967bc(0x155)+_0x351073),_0x158be4&&console[_0x3967bc(0x1b4)](_0x3967bc(0x183)+_0x158be4));if(!_0x47bd0f[_0x3967bc(0x1cb)]){const _0x4c63b7=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x351073+'?');if(!_0x4c63b7)return console[_0x3967bc(0x1b4)]('Cancelled'),0x0;}const _0x41f858=await withSpinner(_0x3967bc(0x189),()=>_0xaf9659[_0x3967bc(0x161)]['kill'](_0x351073,_0x158be4),{'verbose':_0x47bd0f[_0x3967bc(0x1aa)]}),_0x2c23cc=_0x41f858[_0x3967bc(0x137)];return console[_0x3967bc(0x1b4)]('✔\x20'+_0x2c23cc),0x0;}catch(_0x505e55){if(_0x505e55 instanceof SDKError)return console['error'](_0x3967bc(0x18e)+_0x505e55[_0x3967bc(0x1a0)]),_0x505e55[_0x3967bc(0x133)]&&console['error'](_0x3967bc(0x1d5)+_0x505e55[_0x3967bc(0x133)]),0x1;throw _0x505e55;}}}export class WorkflowRetryCommand extends BaseCommand{[a42_0x39f797(0x1b3)]=a42_0x39f797(0x1cd);[a42_0x39f797(0x168)]=a42_0x39f797(0x170);async[a42_0x39f797(0x1a5)](_0x2e388f){const _0x9fe2a7=a42_0x39f797,{options:_0x1c7042,args:_0x3c16cf,tdx:_0x2cb50d}=_0x2e388f,_0x57ac57=_0x3c16cf[0x0];if(!_0x57ac57)return console[_0x9fe2a7(0x1b4)](_0x9fe2a7(0x173)),console[_0x9fe2a7(0x1b4)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x42c9b3=![],_0x353b6a=_0x57ac57;if(_0x57ac57[_0x9fe2a7(0x190)](_0x9fe2a7(0x1bc)))_0x42c9b3=!![],_0x353b6a=_0x57ac57[_0x9fe2a7(0x17c)](0x8);else{if(_0x57ac57[_0x9fe2a7(0x190)]('attempt:'))_0x42c9b3=![],_0x353b6a=_0x57ac57['substring'](0x8);else return console[_0x9fe2a7(0x1b4)](_0x9fe2a7(0x1a9)),console[_0x9fe2a7(0x1b4)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}try{const _0x156947=_0x1c7042[_0x9fe2a7(0x174)],_0x5b629a=_0x1c7042[_0x9fe2a7(0x17a)],_0x566df3=_0x1c7042[_0x9fe2a7(0x13a)],_0x446a48=_0x1c7042[_0x9fe2a7(0x16b)];_0x1c7042[_0x9fe2a7(0x1aa)]&&(console[_0x9fe2a7(0x1b4)](_0x9fe2a7(0x1d3)+(_0x42c9b3?_0x9fe2a7(0x13d):_0x9fe2a7(0x1d7))+'\x20'+_0x353b6a),_0x156947&&console[_0x9fe2a7(0x1b4)](_0x9fe2a7(0x12d)+_0x156947),_0x5b629a&&console['error'](_0x9fe2a7(0x131)+_0x5b629a),_0x566df3&&console['error']('Params:\x20'+_0x566df3),_0x446a48&&console[_0x9fe2a7(0x1b4)](_0x9fe2a7(0x1b7)));let _0x359d24;if(_0x566df3)try{if(_0x566df3[_0x9fe2a7(0x190)]('@')){const _0x18581d=await import(_0x9fe2a7(0x196)),_0x2bd7e7=_0x566df3[_0x9fe2a7(0x17c)](0x1),_0x10cbe4=await _0x18581d[_0x9fe2a7(0x147)](_0x2bd7e7,_0x9fe2a7(0x169));_0x359d24=JSON[_0x9fe2a7(0x19b)](_0x10cbe4);}else _0x359d24=JSON[_0x9fe2a7(0x19b)](_0x566df3);}catch{return console[_0x9fe2a7(0x1b4)](_0x9fe2a7(0x1c6)),0x1;}if(!_0x1c7042['yes']){const _0x595840=await confirm(_0x9fe2a7(0x1ce)+(_0x42c9b3?_0x9fe2a7(0x13d):_0x9fe2a7(0x1d7))+'\x20'+_0x353b6a+'?');if(!_0x595840)return console[_0x9fe2a7(0x1b4)](_0x9fe2a7(0x17b)),0x0;}let _0x44de84;_0x42c9b3?_0x44de84=await withSpinner(_0x9fe2a7(0x17d),()=>_0x2cb50d['workflow'][_0x9fe2a7(0x193)](_0x353b6a,{'fromTask':_0x156947,'retryParams':_0x359d24}),{'verbose':_0x1c7042[_0x9fe2a7(0x1aa)]}):_0x44de84=await withSpinner(_0x9fe2a7(0x1b8),()=>_0x2cb50d[_0x9fe2a7(0x161)][_0x9fe2a7(0x1c8)](_0x353b6a,{'resumeFrom':_0x5b629a,'retryParams':_0x359d24,'force':_0x446a48}),{'verbose':_0x1c7042['verbose']});const _0x41a19d=_0x44de84[_0x9fe2a7(0x137)];return console[_0x9fe2a7(0x1b4)](_0x9fe2a7(0x18a)),console[_0x9fe2a7(0x1b4)](_0x9fe2a7(0x1a4)+_0x41a19d['attemptId']),console[_0x9fe2a7(0x1b4)](_0x9fe2a7(0x180)+_0x41a19d[_0x9fe2a7(0x19a)]),0x0;}catch(_0x1db62b){if(_0x1db62b instanceof SDKError)return console[_0x9fe2a7(0x1b4)](_0x9fe2a7(0x18e)+_0x1db62b[_0x9fe2a7(0x1a0)]),_0x1db62b[_0x9fe2a7(0x133)]&&console[_0x9fe2a7(0x1b4)](_0x9fe2a7(0x1d5)+_0x1db62b[_0x9fe2a7(0x133)]),0x1;throw _0x1db62b;}}}export class WorkflowRunCommand extends BaseCommand{[a42_0x39f797(0x1b3)]=a42_0x39f797(0x182);['description']=a42_0x39f797(0x15b);async[a42_0x39f797(0x1a5)](_0x1d029a){const _0x5d0bd2=a42_0x39f797,{options:_0x4e18c2,args:_0x260ef3,tdx:_0x21cb39}=_0x1d029a,_0x4856b9=_0x260ef3[0x0];if(!_0x4856b9)return console[_0x5d0bd2(0x1b4)]('Error:\x20Workflow\x20identifier\x20is\x20required'),console[_0x5d0bd2(0x1b4)](_0x5d0bd2(0x13f)),0x1;const _0x4c2eb7=_0x4e18c2[_0x5d0bd2(0x171)],_0x2cc344=_0x4e18c2['sessionTime'],_0x4f5c71={};if(_0x4c2eb7&&Array[_0x5d0bd2(0x19c)](_0x4c2eb7))for(const _0x137414 of _0x4c2eb7){const _0x5ea00d=_0x137414[_0x5d0bd2(0x192)]('=');if(_0x5ea00d===-0x1)return console['error']('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x137414),console[_0x5d0bd2(0x1b4)](_0x5d0bd2(0x178)),0x1;const _0x264985=_0x137414[_0x5d0bd2(0x17c)](0x0,_0x5ea00d),_0x5d72ff=_0x137414['substring'](_0x5ea00d+0x1);try{_0x4f5c71[_0x264985]=JSON['parse'](_0x5d72ff);}catch{_0x4f5c71[_0x264985]=_0x5d72ff;}}_0x4e18c2[_0x5d0bd2(0x1aa)]&&(console[_0x5d0bd2(0x1b4)](_0x5d0bd2(0x1a6)+_0x4856b9),Object[_0x5d0bd2(0x158)](_0x4f5c71)[_0x5d0bd2(0x129)]>0x0&&console[_0x5d0bd2(0x1b4)](_0x5d0bd2(0x153)+JSON[_0x5d0bd2(0x176)](_0x4f5c71)),_0x2cc344&&console[_0x5d0bd2(0x1b4)](_0x5d0bd2(0x1a8)+_0x2cc344));const _0x56fbd3=await withSpinner(_0x5d0bd2(0x1c1),()=>_0x21cb39[_0x5d0bd2(0x161)][_0x5d0bd2(0x1be)](_0x4856b9,_0x4f5c71,{'sessionTime':_0x2cc344}),{'verbose':_0x4e18c2[_0x5d0bd2(0x1aa)]}),_0x396907=_0x56fbd3[_0x5d0bd2(0x137)];return console['error']('✔\x20Workflow\x20run\x20started'),console[_0x5d0bd2(0x1b4)]('\x20\x20Attempt\x20ID:\x20'+_0x396907['id']),console[_0x5d0bd2(0x1b4)](_0x5d0bd2(0x180)+_0x396907[_0x5d0bd2(0x19a)]),console[_0x5d0bd2(0x1b4)](_0x5d0bd2(0x144)+_0x396907[_0x5d0bd2(0x18d)]?.[_0x5d0bd2(0x1b3)]),console['error'](_0x5d0bd2(0x179)+_0x396907[_0x5d0bd2(0x161)]?.['name']),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a42_0x39f797(0x1b3)]=a42_0x39f797(0x154);[a42_0x39f797(0x168)]=a42_0x39f797(0x19e);async[a42_0x39f797(0x1a5)](_0x1ef631){const _0x143c4f=a42_0x39f797,{options:_0x40f896,args:_0x5bea16,tdx:_0x786312}=_0x1ef631,_0x5486c2=_0x5bea16[0x0],_0x17ccf7=_0x5bea16[0x1]||'.';if(!_0x5486c2)return console[_0x143c4f(0x1b4)](_0x143c4f(0x160)),console['error'](_0x143c4f(0x1d6)),0x1;const _0x1ca5ba=_0x40f896[_0x143c4f(0x1bb)];_0x40f896[_0x143c4f(0x1aa)]&&(console[_0x143c4f(0x1b4)](_0x143c4f(0x143)+_0x5486c2),console[_0x143c4f(0x1b4)](_0x143c4f(0x16e)+_0x17ccf7),_0x1ca5ba&&console[_0x143c4f(0x1b4)](_0x143c4f(0x15e)+_0x1ca5ba));const _0x2f181c=await withSpinner(_0x143c4f(0x14e)+_0x5486c2+'...',()=>_0x786312['workflow'][_0x143c4f(0x1c3)](_0x5486c2,_0x17ccf7,{'revision':_0x1ca5ba}),{'verbose':_0x40f896[_0x143c4f(0x1aa)]}),_0x4ab919=_0x2f181c[_0x143c4f(0x137)];return console[_0x143c4f(0x1b4)](_0x143c4f(0x151)+_0x4ab919[_0x143c4f(0x1cc)]),console[_0x143c4f(0x1b4)]('\x20\x20Revision:\x20'+_0x4ab919['revision']),console[_0x143c4f(0x1b4)](_0x143c4f(0x14a)+_0x4ab919[_0x143c4f(0x1c2)]),console['error'](_0x143c4f(0x177)+_0x17ccf7+'/'+_0x4ab919['projectName']),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a42_0x39f797(0x1b3)]='workflow:push';[a42_0x39f797(0x168)]=a42_0x39f797(0x18f);async['execute'](_0x1472f4){const _0x55d288=a42_0x39f797,{options:_0x21eb68,args:_0x6aba06,tdx:_0x36c0ea}=_0x1472f4;let _0x39c88c='.',_0x8346c9=_0x21eb68[_0x55d288(0x1b3)];if(_0x6aba06[0x0]){const {promises:_0x223423}=await import('fs');try{const _0x2673ea=await _0x223423[_0x55d288(0x1b5)](_0x6aba06[0x0]);if(_0x2673ea[_0x55d288(0x148)]())_0x39c88c=_0x6aba06[0x0];else return console[_0x55d288(0x1b4)](_0x55d288(0x18e)+_0x6aba06[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x8346c9=_0x6aba06[0x0],_0x39c88c='.';}}const _0x4de704=_0x21eb68[_0x55d288(0x1bb)],_0x4a2148=_0x21eb68['skipValidation'];_0x21eb68[_0x55d288(0x1aa)]&&(console[_0x55d288(0x1b4)](_0x55d288(0x13b)+_0x39c88c),_0x8346c9&&console[_0x55d288(0x1b4)](_0x55d288(0x14d)+_0x8346c9),_0x4de704&&console[_0x55d288(0x1b4)](_0x55d288(0x15e)+_0x4de704),_0x4a2148&&console[_0x55d288(0x1b4)](_0x55d288(0x18b)));const _0x905cd6=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x36c0ea[_0x55d288(0x161)][_0x55d288(0x159)](_0x39c88c,{'projectName':_0x8346c9,'revision':_0x4de704,'skipValidation':_0x4a2148}),{'verbose':_0x21eb68[_0x55d288(0x1aa)]}),_0x58c06a=_0x905cd6[_0x55d288(0x137)];return console[_0x55d288(0x1b4)](_0x55d288(0x186)+_0x58c06a[_0x55d288(0x1cc)]),console[_0x55d288(0x1b4)](_0x55d288(0x1c9)+_0x58c06a[_0x55d288(0x1af)]),console[_0x55d288(0x1b4)]('\x20\x20Revision:\x20'+_0x58c06a[_0x55d288(0x1bb)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a42_0x39f797(0x1a7);[a42_0x39f797(0x168)]=a42_0x39f797(0x197);async[a42_0x39f797(0x1a5)](_0x309088){const _0x211340=a42_0x39f797,{options:_0x3baa0c,args:_0x39800a,tdx:_0x2d115d}=_0x309088,_0x4ec221=_0x39800a[0x0];if(!_0x4ec221)return console[_0x211340(0x1b4)](_0x211340(0x150)),console[_0x211340(0x1b4)](_0x211340(0x13c)),0x1;_0x3baa0c[_0x211340(0x1aa)]&&console[_0x211340(0x1b4)]('Project:\x20'+_0x4ec221);if(!_0x3baa0c[_0x211340(0x1cb)]){const _0x217fea=await confirm(_0x211340(0x1c4)+_0x4ec221+_0x211340(0x165));if(!_0x217fea)return console['error']('Cancelled'),0x0;}const _0xa7a6c9=await withSpinner(_0x211340(0x1c7)+_0x4ec221+_0x211340(0x1bf),()=>_0x2d115d['workflow'][_0x211340(0x181)](_0x4ec221),{'verbose':_0x3baa0c['verbose']}),_0x36a2a1=_0xa7a6c9[_0x211340(0x137)];return console[_0x211340(0x1b4)](_0x211340(0x15a)+_0x36a2a1[_0x211340(0x1cc)]),console['error'](_0x211340(0x1c9)+_0x36a2a1[_0x211340(0x1af)]),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2163d1,_0x377641){const _0x16f7fd=a43_0x1ee0,_0x2adf34=_0x2163d1();while(!![]){try{const _0x178c9d=parseInt(_0x16f7fd(0x166))/0x1*(-parseInt(_0x16f7fd(0x15c))/0x2)+parseInt(_0x16f7fd(0x157))/0x3*(-parseInt(_0x16f7fd(0x163))/0x4)+parseInt(_0x16f7fd(0x168))/0x5*(-parseInt(_0x16f7fd(0x159))/0x6)+parseInt(_0x16f7fd(0x16a))/0x7*(-parseInt(_0x16f7fd(0x15e))/0x8)+-parseInt(_0x16f7fd(0x154))/0x9+-parseInt(_0x16f7fd(0x160))/0xa*(parseInt(_0x16f7fd(0x167))/0xb)+-parseInt(_0x16f7fd(0x165))/0xc*(-parseInt(_0x16f7fd(0x162))/0xd);if(_0x178c9d===_0x377641)break;else _0x2adf34['push'](_0x2adf34['shift']());}catch(_0x1641eb){_0x2adf34['push'](_0x2adf34['shift']());}}}(a43_0x37f3,0x75e18));import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x275dbc=a43_0x1ee0;try{const _0x20a56a=fileURLToPath(import.meta.url),_0x48bfc8=dirname(_0x20a56a),_0x1625cd=join(_0x48bfc8,_0x275dbc(0x15a)),_0x34bb0a=JSON[_0x275dbc(0x164)](readFileSync(_0x1625cd,_0x275dbc(0x153)));return _0x34bb0a[_0x275dbc(0x161)];}catch{return _0x275dbc(0x158);}}export function getUserAgent(){const _0x3ec246=a43_0x1ee0,_0x6541df=getVersion(),_0x4274e9=platform(),_0x61e39f=process[_0x3ec246(0x161)][_0x3ec246(0x15d)]('v','');return _0x3ec246(0x15f)+_0x6541df+'\x20('+_0x4274e9+_0x3ec246(0x15b)+_0x61e39f+')';}export function getAuthHeaders(_0x42c366,_0x34ed11){const _0x2d1b21=a43_0x1ee0,_0xef58c8=getVersion(),_0x5d1496={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0xef58c8};return _0x34ed11&&(_0x5d1496[_0x2d1b21(0x169)]=_0x2d1b21(0x155)+_0x34ed11),_0x5d1496;}function a43_0x1ee0(_0xa52498,_0x37c398){_0xa52498=_0xa52498-0x153;const _0x37f376=a43_0x37f3();let _0x1ee02b=_0x37f376[_0xa52498];return _0x1ee02b;}function a43_0x37f3(){const _0x501544=[';\x20node/','18EikwTe','replace','2456kGZaOm','tdx/','1476050lHztgQ','version','104TCcsVN','31076QfAWGG','parse','5143464qpAMbl','95548LXgGlq','22DLrLvP','160780DvDssV','Authorization','7259pIpLZm','utf-8','6076935uHKDRS','TD1\x20','length','72pGjTed','0.0.0','114iaJznS','../../package.json'];a43_0x37f3=function(){return _0x501544;};return a43_0x37f3();}export function toHeaderRecord(_0x43078b){const _0x358d4d={};for(const [_0x317ed3,_0x28e152]of Object['entries'](_0x43078b)){_0x28e152!==undefined&&(_0x358d4d[_0x317ed3]=_0x28e152);}return _0x358d4d;}export function getTrinoHeaders(_0xeab393,_0x45c457){const _0x1316cc=getAuthHeaders(_0xeab393,_0x45c457),_0x1eb818=toHeaderRecord(_0x1316cc);return delete _0x1eb818['Authorization'],_0x45c457&&(_0x1eb818['X-Trino-User']=_0x45c457),_0x1eb818;}export function hasAPIKey(_0xfdc5f4){const _0x1f7ef9=a43_0x1ee0,_0xf34c10=getAPIKey(_0xfdc5f4);return _0xf34c10!==undefined&&_0xf34c10[_0x1f7ef9(0x156)]>0x0;}
|
package/dist/core/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x31271e,_0x4d2082){const _0x30c5ee=a44_0x1b84,_0x2532d1=_0x31271e();while(!![]){try{const _0x5ea704=parseInt(_0x30c5ee(0x144))/0x1*(parseInt(_0x30c5ee(0x150))/0x2)+-parseInt(_0x30c5ee(0x15e))/0x3*(parseInt(_0x30c5ee(0x13b))/0x4)+parseInt(_0x30c5ee(0x159))/0x5+parseInt(_0x30c5ee(0x128))/0x6+-parseInt(_0x30c5ee(0x160))/0x7+parseInt(_0x30c5ee(0x12e))/0x8+-parseInt(_0x30c5ee(0x16a))/0x9;if(_0x5ea704===_0x4d2082)break;else _0x2532d1['push'](_0x2532d1['shift']());}catch(_0x2edd07){_0x2532d1['push'](_0x2532d1['shift']());}}}(a44_0xc586,0x98d5c));function a44_0xc586(){const _0x30303d=['startsWith','3185184OswShP','Warning:\x20Failed\x20to\x20load\x20','entries','TDX_API_KEY','dev-us01','llm_default_project','isDeprecated','existsSync','.json','us01','number','tdx.json','eu01','1614876IBYCHW','apiKeys','env','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','apiKey','name','TDX_API_KEY_<PROFILE>','tdx','accountId','16143rgXuMu','includes','trim','account_info.','keychain','some','jp01','slice','string','site','warn','.env.','82WQtdsf','readFileSync','endsWith','keychain\x20(profile:\x20','profiles','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','account_info.json','\x20env\x20var','map','4309780oZRlaJ','.env','dev-eu01','TD_API_KEY_','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','3nzSHCQ','split','8270920NVhtXA','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','Warning:\x20Failed\x20to\x20read\x20','source','ap03','join','replace','legacy\x20.env\x20file\x20(profile:\x20','toUpperCase','stringify','8539200tSxICj','toISOString','parse','legacy\x20.env\x20file','TD_API_KEY','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','ap02','llm_default_project.','stg-jp01','TD_API_KEY\x20env\x20var\x20(deprecated)','7428744yOLBLU','utf-8','match','yellow','stg-us01'];a44_0xc586=function(){return _0x30303d;};return a44_0xc586();}import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a44_0x28f01c from'node:fs';import*as a44_0x3e21ee 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 a44_0x28a917 from'chalk';export function getConfigDir(){const _0x41a994=a44_0x1b84;return process[_0x41a994(0x13d)]['TDX_CONFIG_DIR']||join(homedir(),'.config',_0x41a994(0x142));}export function getConfigFile(){const _0x38e9a5=a44_0x1b84;return join(getConfigDir(),_0x38e9a5(0x15a));}export function getConfigFilePath(_0x283766){const _0x233c37=a44_0x1b84,_0x25734b=getConfigDir();return _0x283766?a44_0x3e21ee[_0x233c37(0x165)](_0x25734b,'.env.'+_0x283766):getConfigFile();}export function getCacheDir(){const _0x42e7ee=a44_0x1b84;return process[_0x42e7ee(0x13d)]['TDX_CACHE_DIR']||join(homedir(),'.cache',_0x42e7ee(0x142));}export function getLLMProjectCacheFile(_0x136148){const _0xa36a0d=a44_0x1b84,_0x166701=_0x136148?_0xa36a0d(0x171)+_0x136148:_0xa36a0d(0x133);return join(getCacheDir(),_0x166701);}export function readCachedLLMProject(_0x3cd37b){const _0x15efd7=a44_0x1b84;try{const _0x39711b=getLLMProjectCacheFile(_0x3cd37b);if(!existsSync(_0x39711b))return null;const _0x529848=readFileSync(_0x39711b,_0x15efd7(0x129))[_0x15efd7(0x146)]();try{const _0x422ca8=JSON['parse'](_0x529848);if(_0x422ca8&&typeof _0x422ca8['id']===_0x15efd7(0x14c)&&typeof _0x422ca8[_0x15efd7(0x140)]===_0x15efd7(0x14c))return _0x422ca8;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x562278,_0x510e9a,_0x42425e){const _0x10569c=a44_0x1b84;try{const _0x258db5=getCacheDir(),_0x1e8101=getLLMProjectCacheFile(_0x42425e);!existsSync(_0x258db5)&&mkdirSync(_0x258db5,{'recursive':!![]});const _0x4af50a={'name':_0x562278,'id':_0x510e9a};writeFileSync(_0x1e8101,JSON[_0x10569c(0x169)](_0x4af50a),_0x10569c(0x129));}catch{}}export function getAccountInfoCacheFile(_0x544451){const _0xaca0d9=a44_0x1b84,_0x1ded94=_0x544451?_0xaca0d9(0x147)+_0x544451+_0xaca0d9(0x136):_0xaca0d9(0x156);return join(getCacheDir(),_0x1ded94);}export function readCachedAccountInfo(_0x18b1fc){const _0x215d4a=a44_0x1b84;try{const _0x9ce861=getAccountInfoCacheFile(_0x18b1fc);if(!existsSync(_0x9ce861))return null;const _0x7bf470=readFileSync(_0x9ce861,_0x215d4a(0x129))[_0x215d4a(0x146)](),_0x19a7d6=JSON[_0x215d4a(0x16c)](_0x7bf470);if(_0x19a7d6&&typeof _0x19a7d6[_0x215d4a(0x14d)]===_0x215d4a(0x14c)&&typeof _0x19a7d6[_0x215d4a(0x143)]===_0x215d4a(0x138))return _0x19a7d6;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x1564b7,_0x5a5198,_0x2fd474){const _0x5b13eb=a44_0x1b84;try{const _0x5ead36=getCacheDir(),_0x152ef1=getAccountInfoCacheFile(_0x2fd474);!existsSync(_0x5ead36)&&mkdirSync(_0x5ead36,{'recursive':!![]});const _0x1c5c78={'site':_0x1564b7,'accountId':_0x5a5198,'cachedAt':new Date()[_0x5b13eb(0x16b)]()};writeFileSync(_0x152ef1,JSON[_0x5b13eb(0x169)](_0x1c5c78),'utf-8');}catch{}}export function parseEnvFile(_0x14c9aa){const _0x43b41a=a44_0x1b84,_0x4f492b={};for(const _0x5b4712 of _0x14c9aa[_0x43b41a(0x15f)]('\x0a')){const _0x3ddbeb=_0x5b4712[_0x43b41a(0x146)]();if(!_0x3ddbeb||_0x3ddbeb[_0x43b41a(0x12d)]('#'))continue;const _0x12299a=_0x3ddbeb[_0x43b41a(0x12a)](/^([^=]+)=(.*)$/);if(_0x12299a){const _0x42286c=_0x12299a[0x1][_0x43b41a(0x146)]();let _0x165dce=_0x12299a[0x2]['trim']();(_0x165dce[_0x43b41a(0x12d)]('\x22')&&_0x165dce[_0x43b41a(0x152)]('\x22')||_0x165dce[_0x43b41a(0x12d)]('\x27')&&_0x165dce[_0x43b41a(0x152)]('\x27'))&&(_0x165dce=_0x165dce[_0x43b41a(0x14b)](0x1,-0x1)),_0x4f492b[_0x42286c]=_0x165dce;}}return _0x4f492b;}export function readUserConfig(){const _0x46f285=a44_0x1b84,_0x49baf9=getConfigFile();if(!existsSync(_0x49baf9))return{};try{const _0x32900f=readFileSync(_0x49baf9,_0x46f285(0x129));return parseEnvFile(_0x32900f);}catch(_0x5eb03e){return console[_0x46f285(0x14e)](_0x46f285(0x155)+_0x49baf9+':',_0x5eb03e),{};}}export function resolveSite(_0x3964a3){const _0x399b07=a44_0x1b84,_0x10504a=[_0x399b07(0x137),'jp01',_0x399b07(0x13a),_0x399b07(0x170),'ap03',_0x399b07(0x132),_0x399b07(0x15b),_0x399b07(0x12c),_0x399b07(0x126),'stg-ap03'];if(_0x10504a['includes'](_0x3964a3))return _0x3964a3;if(_0x3964a3 in SITE_ALIASES)return SITE_ALIASES[_0x3964a3];return console[_0x399b07(0x14e)]('Warning:\x20Unknown\x20site\x20\x27'+_0x3964a3+'\x27,\x20defaulting\x20to\x20us01'),_0x399b07(0x137);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x33bbb3,_0xdb0a1d){const _0x4fcfac=a44_0x1b84,_0x129814=_0xdb0a1d||getActiveProfileName();if(_0x129814){const _0x31bab2='TDX_API_KEY_'+normalizeProfileForEnvVar(_0x129814);if(process[_0x4fcfac(0x13d)][_0x31bab2])return process[_0x4fcfac(0x13d)][_0x31bab2];}if(process[_0x4fcfac(0x13d)][_0x4fcfac(0x131)])return process['env'][_0x4fcfac(0x131)];if(process[_0x4fcfac(0x13d)][_0x4fcfac(0x16e)])return process[_0x4fcfac(0x13d)][_0x4fcfac(0x16e)];const _0x215660=_0x33bbb3[_0x4fcfac(0x168)]()[_0x4fcfac(0x166)](/-/g,'_'),_0x316229=_0x4fcfac(0x15c)+_0x215660;if(_0x129814){const _0x1012e5=loadProfileEnv(_0x129814);if(_0x1012e5){if(_0x1012e5[_0x316229])return _0x1012e5[_0x316229];if(_0x1012e5[_0x4fcfac(0x16e)])return _0x1012e5[_0x4fcfac(0x16e)];}}const _0x118e24=loadUserConfigOnce();if(_0x118e24[_0x316229])return _0x118e24[_0x316229];if(_0x118e24['TD_API_KEY'])return _0x118e24[_0x4fcfac(0x16e)];return undefined;}function a44_0x1b84(_0x579bfb,_0x367f9a){_0x579bfb=_0x579bfb-0x126;const _0xc586f7=a44_0xc586();let _0x1b8457=_0xc586f7[_0x579bfb];return _0x1b8457;}export function normalizeProfileForEnvVar(_0x4adacd){const _0x5b9951=a44_0x1b84;return _0x4adacd[_0x5b9951(0x168)]()[_0x5b9951(0x166)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x1dac87,_0x5a8ac4){const _0x386810=a44_0x1b84,_0x279b51=_0x5a8ac4||getActiveProfileName()||undefined;if(_0x279b51){const _0x211abc='TDX_API_KEY_'+normalizeProfileForEnvVar(_0x279b51);if(process[_0x386810(0x13d)][_0x211abc])return{'apiKey':process[_0x386810(0x13d)][_0x211abc],'source':_0x211abc+_0x386810(0x157),'isDeprecated':![]};const _0x5d9f78=getCachedCredential(_0x1dac87,_0x279b51);if(_0x5d9f78)return{'apiKey':_0x5d9f78,'source':'keychain\x20(profile:\x20'+_0x279b51+')','isDeprecated':![]};const _0x12c214=await getKeychainAPIKey(_0x279b51);if(_0x12c214)return setCachedCredential(_0x12c214,_0x1dac87,_0x279b51),{'apiKey':_0x12c214,'source':_0x386810(0x153)+_0x279b51+')','isDeprecated':![]};}if(process[_0x386810(0x13d)][_0x386810(0x131)])return{'apiKey':process[_0x386810(0x13d)]['TDX_API_KEY'],'source':'TDX_API_KEY\x20env\x20var','isDeprecated':![]};if(!_0x279b51){const _0x5426a9=getCachedCredential(_0x1dac87,undefined);if(_0x5426a9)return{'apiKey':_0x5426a9,'source':_0x386810(0x148),'isDeprecated':![]};const _0x1230c7=await getKeychainAPIKey(undefined);if(_0x1230c7)return setCachedCredential(_0x1230c7,_0x1dac87,undefined),{'apiKey':_0x1230c7,'source':'keychain','isDeprecated':![]};}if(process[_0x386810(0x13d)][_0x386810(0x16e)])return{'apiKey':process['env'][_0x386810(0x16e)],'source':_0x386810(0x127),'isDeprecated':!![]};const _0x41f58c=getLegacyEnvAPIKey(_0x1dac87,_0x279b51);if(_0x41f58c){const _0x258d94=await isKeychainAvailable();if(_0x258d94)try{await saveKeychainAPIKey(_0x41f58c,_0x279b51),setCachedCredential(_0x41f58c,_0x1dac87,_0x279b51);const _0x1a605f=getConfigFilePath(_0x279b51);cleanupLegacyEnvFile(_0x1a605f)&&console[_0x386810(0x14e)](a44_0x28a917[_0x386810(0x12b)](_0x386810(0x16f)));}catch(_0x50162e){console['warn'](a44_0x28a917[_0x386810(0x12b)](_0x386810(0x15d)+_0x50162e));}const _0x1dfcd3=_0x279b51?_0x386810(0x167)+_0x279b51+')':_0x386810(0x16d);return{'apiKey':_0x41f58c,'source':_0x1dfcd3,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x2f697c,_0x1f1a16,_0x3e12a1=!![]){const _0x52997c=a44_0x1b84,_0x273ec1=await resolveAPIKeyAsync(_0x2f697c,_0x1f1a16);if(!_0x273ec1)return undefined;if(_0x3e12a1&&_0x273ec1[_0x52997c(0x134)]&&_0x273ec1[_0x52997c(0x163)][_0x52997c(0x145)](_0x52997c(0x16e))){const _0x37be22=_0x1f1a16||getActiveProfileName()||undefined,_0x1cbdf5=_0x37be22?'TDX_API_KEY_'+normalizeProfileForEnvVar(_0x37be22):_0x52997c(0x141);console[_0x52997c(0x14e)](a44_0x28a917[_0x52997c(0x12b)]('Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a'+(_0x52997c(0x13e)+_0x1cbdf5+').')));}return _0x273ec1[_0x52997c(0x13f)];}function getLegacyEnvAPIKey(_0x3affee,_0x58832e){const _0x5e4b7b=a44_0x1b84,_0x5b2404=_0x3affee[_0x5e4b7b(0x168)]()[_0x5e4b7b(0x166)](/-/g,'_'),_0xbba3b3='TD_API_KEY_'+_0x5b2404;if(_0x58832e){const _0x456d73=loadProfileEnv(_0x58832e);if(_0x456d73){if(_0x456d73[_0xbba3b3])return _0x456d73[_0xbba3b3];if(_0x456d73[_0x5e4b7b(0x16e)])return _0x456d73['TD_API_KEY'];}}const _0x58690b=loadUserConfigOnce();if(_0x58690b[_0xbba3b3])return _0x58690b[_0xbba3b3];if(_0x58690b[_0x5e4b7b(0x16e)])return _0x58690b[_0x5e4b7b(0x16e)];return undefined;}function cleanupLegacyEnvFile(_0x46f3a2){const _0x439e4a=a44_0x1b84;if(!existsSync(_0x46f3a2))return![];try{const _0x3d82d5=readFileSync(_0x46f3a2,_0x439e4a(0x129)),_0x32ba9b=_0x3d82d5[_0x439e4a(0x15f)]('\x0a'),_0x226bd3=_0x32ba9b['filter'](_0x46a821=>{const _0x2f5647=_0x439e4a,_0x4c2219=_0x46a821[_0x2f5647(0x146)]();if(!_0x4c2219||_0x4c2219['startsWith']('#'))return!![];const [_0x2ad1dc]=_0x4c2219[_0x2f5647(0x15f)]('=');return!_0x2ad1dc[_0x2f5647(0x12d)]('TD_API_KEY');}),_0x59f355=_0x226bd3[_0x439e4a(0x149)](_0x3c8b76=>{const _0x24f8eb=_0x439e4a,_0xb1deed=_0x3c8b76['trim']();return _0xb1deed&&!_0xb1deed[_0x24f8eb(0x12d)]('#');});if(!_0x59f355)return unlinkSync(_0x46f3a2),!![];return writeFileSync(_0x46f3a2,_0x226bd3['join']('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x5853c8){const _0xf9b379=a44_0x1b84,_0x34cec5=a44_0x3e21ee[_0xf9b379(0x165)](getConfigDir(),_0xf9b379(0x14f)+_0x5853c8);if(a44_0x28f01c[_0xf9b379(0x135)](_0x34cec5)){validateSecureFilePermissions(_0x34cec5);try{const _0x148b0c=a44_0x28f01c['readFileSync'](_0x34cec5,'utf-8');return parseEnvFile(_0x148b0c);}catch(_0x10b597){console[_0xf9b379(0x14e)](_0xf9b379(0x12f)+_0x34cec5+':\x20'+_0x10b597);}}const _0x1c2505=a44_0x3e21ee[_0xf9b379(0x165)](getConfigDir(),_0xf9b379(0x154),_0x5853c8,_0xf9b379(0x15a));if(a44_0x28f01c[_0xf9b379(0x135)](_0x1c2505)){validateSecureFilePermissions(_0x1c2505);try{const _0x504e89=a44_0x28f01c[_0xf9b379(0x151)](_0x1c2505,_0xf9b379(0x129));return parseEnvFile(_0x504e89);}catch(_0x12bbc3){return console[_0xf9b379(0x14e)](_0xf9b379(0x12f)+_0x1c2505+':\x20'+_0x12bbc3),null;}}return null;}function getActiveProfileName(){const _0x776f1c=a44_0x1b84,_0x3e31cc=a44_0x3e21ee[_0x776f1c(0x165)](getConfigDir(),_0x776f1c(0x139));if(!a44_0x28f01c[_0x776f1c(0x135)](_0x3e31cc))return null;try{const _0x46281a=a44_0x28f01c[_0x776f1c(0x151)](_0x3e31cc,_0x776f1c(0x129)),_0x258b0a=JSON[_0x776f1c(0x16c)](_0x46281a);return _0x258b0a['profile']||null;}catch{return null;}}export function saveAPIKey(_0x30ccb5,_0x4bc1b1,_0x3a549c){const _0x2232ab=a44_0x1b84,_0x1bbd9e=getConfigDir(),_0xfb82d=getConfigFilePath(_0x3a549c);!existsSync(_0x1bbd9e)&&mkdirSync(_0x1bbd9e,{'recursive':!![],'mode':0x1c0});let _0x71120c={};if(existsSync(_0xfb82d))try{const _0x7c3b20=readFileSync(_0xfb82d,_0x2232ab(0x129));_0x71120c=parseEnvFile(_0x7c3b20);}catch(_0x48f9af){console[_0x2232ab(0x14e)](_0x2232ab(0x162)+_0xfb82d+':',_0x48f9af);}const _0x385a79=_0x30ccb5[_0x2232ab(0x168)]()['replace'](/-/g,'_');_0x71120c[_0x2232ab(0x15c)+_0x385a79]=_0x4bc1b1;const _0x389e76=Object[_0x2232ab(0x130)](_0x71120c)[_0x2232ab(0x158)](([_0x28a072,_0x5a8575])=>_0x28a072+'='+_0x5a8575);writeFileSync(_0xfb82d,_0x389e76['join']('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x196c37,_0x5ab195,_0x23bc78){const _0x353adc=a44_0x1b84;await saveKeychainAPIKey(_0x196c37,_0x23bc78),setCachedCredential(_0x196c37,_0x5ab195,_0x23bc78);const _0x241716=getConfigFilePath(_0x23bc78);cleanupLegacyEnvFile(_0x241716)&&console['warn'](a44_0x28a917[_0x353adc(0x12b)](_0x353adc(0x161)));}export function loadConfig(){const _0x2deb72=a44_0x1b84,_0x5d35e9={'apiKeys':{},'defaultSite':'us01'},_0x49ec50=[_0x2deb72(0x137),_0x2deb72(0x14a),'eu01',_0x2deb72(0x170),_0x2deb72(0x164),'dev-us01','dev-eu01',_0x2deb72(0x12c),_0x2deb72(0x126),'stg-ap03'];for(const _0xa9b475 of _0x49ec50){const _0x2a233b=getAPIKey(_0xa9b475);_0x2a233b&&(_0x5d35e9[_0x2deb72(0x13c)][_0xa9b475]=_0x2a233b);}return _0x5d35e9;}
|
|
1
|
+
(function(_0x5e949d,_0x3cf7ad){const _0x2550f1=a44_0x5e06,_0x2cb161=_0x5e949d();while(!![]){try{const _0x222244=-parseInt(_0x2550f1(0x21a))/0x1*(parseInt(_0x2550f1(0x201))/0x2)+parseInt(_0x2550f1(0x217))/0x3+-parseInt(_0x2550f1(0x20a))/0x4+parseInt(_0x2550f1(0x206))/0x5*(-parseInt(_0x2550f1(0x1ec))/0x6)+parseInt(_0x2550f1(0x228))/0x7*(parseInt(_0x2550f1(0x1f2))/0x8)+parseInt(_0x2550f1(0x22b))/0x9*(parseInt(_0x2550f1(0x205))/0xa)+parseInt(_0x2550f1(0x232))/0xb;if(_0x222244===_0x3cf7ad)break;else _0x2cb161['push'](_0x2cb161['shift']());}catch(_0x444c51){_0x2cb161['push'](_0x2cb161['shift']());}}}(a44_0x5656,0x373cd));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a44_0x109aa1 from'node:fs';import*as a44_0x591638 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 a44_0x29ee18 from'chalk';export function getConfigDir(){const _0xf672ff=a44_0x5e06;return process[_0xf672ff(0x1eb)]['TDX_CONFIG_DIR']||join(homedir(),_0xf672ff(0x20b),_0xf672ff(0x222));}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getConfigFilePath(_0x4095d1){const _0x540ae1=a44_0x5e06,_0x2803e0=getConfigDir();return _0x4095d1?a44_0x591638['join'](_0x2803e0,_0x540ae1(0x210)+_0x4095d1):getConfigFile();}export function getCacheDir(){const _0x7d0be4=a44_0x5e06;return process[_0x7d0be4(0x1eb)][_0x7d0be4(0x21b)]||join(homedir(),_0x7d0be4(0x214),_0x7d0be4(0x222));}export function getLLMProjectCacheFile(_0x3defe5){const _0x3f4053=a44_0x5e06,_0x22904c=_0x3defe5?'llm_default_project.'+_0x3defe5:_0x3f4053(0x236);return join(getCacheDir(),_0x22904c);}export function readCachedLLMProject(_0x13d459){const _0x429d12=a44_0x5e06;try{const _0x573811=getLLMProjectCacheFile(_0x13d459);if(!existsSync(_0x573811))return null;const _0x5292b2=readFileSync(_0x573811,_0x429d12(0x220))[_0x429d12(0x202)]();try{const _0x38c048=JSON[_0x429d12(0x223)](_0x5292b2);if(_0x38c048&&typeof _0x38c048['id']==='string'&&typeof _0x38c048['name']==='string')return _0x38c048;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x1eb588,_0x3351f6,_0x301843){const _0x5de73a=a44_0x5e06;try{const _0x39d291=getCacheDir(),_0x3b186e=getLLMProjectCacheFile(_0x301843);!existsSync(_0x39d291)&&mkdirSync(_0x39d291,{'recursive':!![]});const _0x28ba07={'name':_0x1eb588,'id':_0x3351f6};writeFileSync(_0x3b186e,JSON[_0x5de73a(0x229)](_0x28ba07),_0x5de73a(0x220));}catch{}}export function getAccountInfoCacheFile(_0xa69011){const _0xa3a771=a44_0x5e06,_0x4a8b5d=_0xa69011?_0xa3a771(0x208)+_0xa69011+'.json':_0xa3a771(0x212);return join(getCacheDir(),_0x4a8b5d);}export function readCachedAccountInfo(_0x5793b7){const _0x40ec77=a44_0x5e06;try{const _0x3ae676=getAccountInfoCacheFile(_0x5793b7);if(!existsSync(_0x3ae676))return null;const _0x2c6cf1=readFileSync(_0x3ae676,_0x40ec77(0x220))[_0x40ec77(0x202)](),_0x4902dc=JSON[_0x40ec77(0x223)](_0x2c6cf1);if(_0x4902dc&&typeof _0x4902dc[_0x40ec77(0x22e)]===_0x40ec77(0x224)&&typeof _0x4902dc[_0x40ec77(0x1ee)]===_0x40ec77(0x1f8))return _0x4902dc;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x14cec1,_0x3a1904,_0x227ab8){const _0x4ae3d5=a44_0x5e06;try{const _0x72a38d=getCacheDir(),_0x34e523=getAccountInfoCacheFile(_0x227ab8);!existsSync(_0x72a38d)&&mkdirSync(_0x72a38d,{'recursive':!![]});const _0x2fe800={'site':_0x14cec1,'accountId':_0x3a1904,'cachedAt':new Date()['toISOString']()};writeFileSync(_0x34e523,JSON[_0x4ae3d5(0x229)](_0x2fe800),_0x4ae3d5(0x220));}catch{}}export function parseEnvFile(_0x101b49){const _0x2a7727=a44_0x5e06,_0xa5601a={};for(const _0x146462 of _0x101b49[_0x2a7727(0x215)]('\x0a')){const _0x1cbc02=_0x146462['trim']();if(!_0x1cbc02||_0x1cbc02[_0x2a7727(0x22c)]('#'))continue;const _0x2b77aa=_0x1cbc02['match'](/^([^=]+)=(.*)$/);if(_0x2b77aa){const _0x264ed8=_0x2b77aa[0x1]['trim']();let _0x11b28f=_0x2b77aa[0x2][_0x2a7727(0x202)]();(_0x11b28f[_0x2a7727(0x22c)]('\x22')&&_0x11b28f[_0x2a7727(0x22a)]('\x22')||_0x11b28f[_0x2a7727(0x22c)]('\x27')&&_0x11b28f[_0x2a7727(0x22a)]('\x27'))&&(_0x11b28f=_0x11b28f[_0x2a7727(0x1fd)](0x1,-0x1)),_0xa5601a[_0x264ed8]=_0x11b28f;}}return _0xa5601a;}export function readUserConfig(){const _0xf85e51=a44_0x5e06,_0x1c14b1=getConfigFile();if(!existsSync(_0x1c14b1))return{};try{const _0x1ec1f1=readFileSync(_0x1c14b1,_0xf85e51(0x220));return parseEnvFile(_0x1ec1f1);}catch(_0x485a5e){return console[_0xf85e51(0x200)]('Warning:\x20Failed\x20to\x20read\x20config\x20file\x20'+_0x1c14b1+':',_0x485a5e),{};}}export function resolveSite(_0x49f1b7){const _0x4f1210=a44_0x5e06,_0x41e011=[_0x4f1210(0x22f),_0x4f1210(0x238),_0x4f1210(0x237),_0x4f1210(0x235),_0x4f1210(0x21c),_0x4f1210(0x221),_0x4f1210(0x22d),'stg-us01',_0x4f1210(0x211),_0x4f1210(0x1fb)];if(_0x41e011[_0x4f1210(0x207)](_0x49f1b7))return _0x49f1b7;if(_0x49f1b7 in SITE_ALIASES)return SITE_ALIASES[_0x49f1b7];return console[_0x4f1210(0x200)](_0x4f1210(0x233)+_0x49f1b7+_0x4f1210(0x230)),'us01';}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x5f4900,_0x1020a1){const _0x6df608=a44_0x5e06,_0xccf861=_0x1020a1||getActiveProfileName();if(_0xccf861){const _0x3930cf=_0x6df608(0x20f)+normalizeProfileForEnvVar(_0xccf861);if(process[_0x6df608(0x1eb)][_0x3930cf])return process[_0x6df608(0x1eb)][_0x3930cf];}if(process[_0x6df608(0x1eb)][_0x6df608(0x20d)])return process[_0x6df608(0x1eb)][_0x6df608(0x20d)];if(process['env'][_0x6df608(0x1f7)])return process[_0x6df608(0x1eb)][_0x6df608(0x1f7)];const _0x583948=_0x5f4900[_0x6df608(0x1f0)]()[_0x6df608(0x227)](/-/g,'_'),_0x5d3c38=_0x6df608(0x1ed)+_0x583948;if(_0xccf861){const _0x2e03a9=loadProfileEnv(_0xccf861);if(_0x2e03a9){if(_0x2e03a9[_0x5d3c38])return _0x2e03a9[_0x5d3c38];if(_0x2e03a9['TD_API_KEY'])return _0x2e03a9[_0x6df608(0x1f7)];}}const _0xe83948=loadUserConfigOnce();if(_0xe83948[_0x5d3c38])return _0xe83948[_0x5d3c38];if(_0xe83948['TD_API_KEY'])return _0xe83948[_0x6df608(0x1f7)];return undefined;}function a44_0x5656(){const _0x2a3283=['profiles','legacy\x20.env\x20file\x20(profile:\x20','TD_API_KEY','number','filter','.env','stg-ap03','TDX_API_KEY\x20env\x20var','slice','keychain','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','warn','694256rsEUky','trim','yellow','Warning:\x20Failed\x20to\x20read\x20','208170gEZOhl','5vCzvcE','includes','account_info.','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','177440jdqmdX','.config','isDeprecated','TDX_API_KEY','some','TDX_API_KEY_','.env.','stg-jp01','account_info.json','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','.cache','split','map','595245iqKAWs','apiKey','stg-us01','1eVFHqE','TDX_CACHE_DIR','ap03','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','source','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','utf-8','dev-us01','tdx','parse','string','keychain\x20(profile:\x20','readFileSync','replace','7aZFwWr','stringify','endsWith','54SorjBO','startsWith','dev-eu01','site','us01','\x27,\x20defaulting\x20to\x20us01','apiKeys','1944074FtqQfy','Warning:\x20Unknown\x20site\x20\x27','profile','ap02','llm_default_project','eu01','jp01','existsSync','env','1104618XZJgYl','TD_API_KEY_','accountId','legacy\x20.env\x20file','toUpperCase','join','2414344lJNFBk','Warning:\x20Failed\x20to\x20load\x20','TDX_API_KEY_<PROFILE>'];a44_0x5656=function(){return _0x2a3283;};return a44_0x5656();}export function normalizeProfileForEnvVar(_0x9a38e6){const _0xb30002=a44_0x5e06;return _0x9a38e6[_0xb30002(0x1f0)]()[_0xb30002(0x227)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0xe7d261,_0x120acc){const _0x570887=a44_0x5e06,_0x459f9f=_0x120acc||getActiveProfileName()||undefined;if(_0x459f9f){const _0x22904f=_0x570887(0x20f)+normalizeProfileForEnvVar(_0x459f9f);if(process[_0x570887(0x1eb)][_0x22904f])return{'apiKey':process[_0x570887(0x1eb)][_0x22904f],'source':_0x22904f+'\x20env\x20var','isDeprecated':![]};const _0x7cb189=getCachedCredential(_0xe7d261,_0x459f9f);if(_0x7cb189)return{'apiKey':_0x7cb189,'source':_0x570887(0x225)+_0x459f9f+')','isDeprecated':![]};const _0x500c32=await getKeychainAPIKey(_0x459f9f);if(_0x500c32)return setCachedCredential(_0x500c32,_0xe7d261,_0x459f9f),{'apiKey':_0x500c32,'source':_0x570887(0x225)+_0x459f9f+')','isDeprecated':![]};}if(process[_0x570887(0x1eb)][_0x570887(0x20d)])return{'apiKey':process[_0x570887(0x1eb)][_0x570887(0x20d)],'source':_0x570887(0x1fc),'isDeprecated':![]};if(!_0x459f9f){const _0x503e3c=getCachedCredential(_0xe7d261,undefined);if(_0x503e3c)return{'apiKey':_0x503e3c,'source':_0x570887(0x1fe),'isDeprecated':![]};const _0x1828dd=await getKeychainAPIKey(undefined);if(_0x1828dd)return setCachedCredential(_0x1828dd,_0xe7d261,undefined),{'apiKey':_0x1828dd,'source':_0x570887(0x1fe),'isDeprecated':![]};}if(process[_0x570887(0x1eb)]['TD_API_KEY'])return{'apiKey':process[_0x570887(0x1eb)]['TD_API_KEY'],'source':'TD_API_KEY\x20env\x20var\x20(deprecated)','isDeprecated':!![]};const _0x3ac8b9=getLegacyEnvAPIKey(_0xe7d261,_0x459f9f);if(_0x3ac8b9){const _0x22a175=await isKeychainAvailable();if(_0x22a175)try{await saveKeychainAPIKey(_0x3ac8b9,_0x459f9f),setCachedCredential(_0x3ac8b9,_0xe7d261,_0x459f9f);const _0x12a447=getConfigFilePath(_0x459f9f);cleanupLegacyEnvFile(_0x12a447)&&console[_0x570887(0x200)](a44_0x29ee18[_0x570887(0x203)](_0x570887(0x1ff)));}catch(_0x1509f0){console[_0x570887(0x200)](a44_0x29ee18[_0x570887(0x203)](_0x570887(0x21f)+_0x1509f0));}const _0x32a74e=_0x459f9f?_0x570887(0x1f6)+_0x459f9f+')':_0x570887(0x1ef);return{'apiKey':_0x3ac8b9,'source':_0x32a74e,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x4c31dd,_0x3d790d,_0x376d6e=!![]){const _0x4499b5=a44_0x5e06,_0x189c40=await resolveAPIKeyAsync(_0x4c31dd,_0x3d790d);if(!_0x189c40)return undefined;if(_0x376d6e&&_0x189c40[_0x4499b5(0x20c)]&&_0x189c40[_0x4499b5(0x21e)][_0x4499b5(0x207)](_0x4499b5(0x1f7))){const _0x512f41=_0x3d790d||getActiveProfileName()||undefined,_0x4e96b4=_0x512f41?_0x4499b5(0x20f)+normalizeProfileForEnvVar(_0x512f41):_0x4499b5(0x1f4);console['warn'](a44_0x29ee18[_0x4499b5(0x203)](_0x4499b5(0x21d)+(_0x4499b5(0x209)+_0x4e96b4+').')));}return _0x189c40[_0x4499b5(0x218)];}function getLegacyEnvAPIKey(_0x5ee33b,_0x3eb35d){const _0x2af41f=a44_0x5e06,_0x26b156=_0x5ee33b[_0x2af41f(0x1f0)]()['replace'](/-/g,'_'),_0x1fac2f='TD_API_KEY_'+_0x26b156;if(_0x3eb35d){const _0x2585ec=loadProfileEnv(_0x3eb35d);if(_0x2585ec){if(_0x2585ec[_0x1fac2f])return _0x2585ec[_0x1fac2f];if(_0x2585ec[_0x2af41f(0x1f7)])return _0x2585ec['TD_API_KEY'];}}const _0x4b936d=loadUserConfigOnce();if(_0x4b936d[_0x1fac2f])return _0x4b936d[_0x1fac2f];if(_0x4b936d[_0x2af41f(0x1f7)])return _0x4b936d[_0x2af41f(0x1f7)];return undefined;}function cleanupLegacyEnvFile(_0x3adf83){const _0x5ec01d=a44_0x5e06;if(!existsSync(_0x3adf83))return![];try{const _0x488ff5=readFileSync(_0x3adf83,_0x5ec01d(0x220)),_0x56da53=_0x488ff5[_0x5ec01d(0x215)]('\x0a'),_0xf949a6=_0x56da53[_0x5ec01d(0x1f9)](_0xfaedf0=>{const _0x50180a=_0x5ec01d,_0x3be377=_0xfaedf0['trim']();if(!_0x3be377||_0x3be377[_0x50180a(0x22c)]('#'))return!![];const [_0x4a035a]=_0x3be377[_0x50180a(0x215)]('=');return!_0x4a035a[_0x50180a(0x22c)]('TD_API_KEY');}),_0x2ce9ec=_0xf949a6[_0x5ec01d(0x20e)](_0x3dd2f1=>{const _0x34369b=_0x5ec01d,_0x4f0038=_0x3dd2f1[_0x34369b(0x202)]();return _0x4f0038&&!_0x4f0038[_0x34369b(0x22c)]('#');});if(!_0x2ce9ec)return unlinkSync(_0x3adf83),!![];return writeFileSync(_0x3adf83,_0xf949a6[_0x5ec01d(0x1f1)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x1f49b5){const _0x7a22db=a44_0x5e06,_0x3fb985=a44_0x591638[_0x7a22db(0x1f1)](getConfigDir(),_0x7a22db(0x210)+_0x1f49b5);if(a44_0x109aa1['existsSync'](_0x3fb985)){validateSecureFilePermissions(_0x3fb985);try{const _0x3e01d9=a44_0x109aa1[_0x7a22db(0x226)](_0x3fb985,_0x7a22db(0x220));return parseEnvFile(_0x3e01d9);}catch(_0x5773e3){console[_0x7a22db(0x200)]('Warning:\x20Failed\x20to\x20load\x20'+_0x3fb985+':\x20'+_0x5773e3);}}const _0x3cd008=a44_0x591638['join'](getConfigDir(),_0x7a22db(0x1f5),_0x1f49b5,_0x7a22db(0x1fa));if(a44_0x109aa1[_0x7a22db(0x1ea)](_0x3cd008)){validateSecureFilePermissions(_0x3cd008);try{const _0x8c885a=a44_0x109aa1[_0x7a22db(0x226)](_0x3cd008,'utf-8');return parseEnvFile(_0x8c885a);}catch(_0x5cfd61){return console[_0x7a22db(0x200)](_0x7a22db(0x1f3)+_0x3cd008+':\x20'+_0x5cfd61),null;}}return null;}function getActiveProfileName(){const _0x3d51bb=a44_0x5e06,_0x357b17=a44_0x591638['join'](getConfigDir(),'tdx.json');if(!a44_0x109aa1[_0x3d51bb(0x1ea)](_0x357b17))return null;try{const _0x7495a6=a44_0x109aa1[_0x3d51bb(0x226)](_0x357b17,_0x3d51bb(0x220)),_0x3e91ff=JSON[_0x3d51bb(0x223)](_0x7495a6);return _0x3e91ff[_0x3d51bb(0x234)]||null;}catch{return null;}}export function saveAPIKey(_0x16cd82,_0x294b85,_0x2baab1){const _0x4ef280=a44_0x5e06,_0xcecf38=getConfigDir(),_0xa37cad=getConfigFilePath(_0x2baab1);!existsSync(_0xcecf38)&&mkdirSync(_0xcecf38,{'recursive':!![],'mode':0x1c0});let _0x490dd9={};if(existsSync(_0xa37cad))try{const _0x6a46de=readFileSync(_0xa37cad,_0x4ef280(0x220));_0x490dd9=parseEnvFile(_0x6a46de);}catch(_0x380996){console[_0x4ef280(0x200)](_0x4ef280(0x204)+_0xa37cad+':',_0x380996);}const _0x26b3ac=_0x16cd82['toUpperCase']()['replace'](/-/g,'_');_0x490dd9['TD_API_KEY_'+_0x26b3ac]=_0x294b85;const _0x324a92=Object['entries'](_0x490dd9)[_0x4ef280(0x216)](([_0x399ea3,_0x43e721])=>_0x399ea3+'='+_0x43e721);writeFileSync(_0xa37cad,_0x324a92[_0x4ef280(0x1f1)]('\x0a')+'\x0a',{'mode':0x180});}function a44_0x5e06(_0x3d5c93,_0x161d2c){_0x3d5c93=_0x3d5c93-0x1ea;const _0x56567a=a44_0x5656();let _0x5e064d=_0x56567a[_0x3d5c93];return _0x5e064d;}export async function saveAPIKeyAsync(_0x44f705,_0x207a81,_0x13385a){const _0x37e5d5=a44_0x5e06;await saveKeychainAPIKey(_0x44f705,_0x13385a),setCachedCredential(_0x44f705,_0x207a81,_0x13385a);const _0x2c716f=getConfigFilePath(_0x13385a);cleanupLegacyEnvFile(_0x2c716f)&&console[_0x37e5d5(0x200)](a44_0x29ee18[_0x37e5d5(0x203)](_0x37e5d5(0x213)));}export function loadConfig(){const _0x4eef1e=a44_0x5e06,_0x5d4e91={'apiKeys':{},'defaultSite':'us01'},_0x24af2a=[_0x4eef1e(0x22f),_0x4eef1e(0x238),_0x4eef1e(0x237),_0x4eef1e(0x235),'ap03',_0x4eef1e(0x221),_0x4eef1e(0x22d),_0x4eef1e(0x219),_0x4eef1e(0x211),_0x4eef1e(0x1fb)];for(const _0x574afa of _0x24af2a){const _0x4257dd=getAPIKey(_0x574afa);_0x4257dd&&(_0x5d4e91[_0x4eef1e(0x231)][_0x574afa]=_0x4257dd);}return _0x5d4e91;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4665c2,_0x4aaa9f){const _0x556b44=a45_0x2aac,_0x20ddcb=_0x4665c2();while(!![]){try{const _0x54058a=-parseInt(_0x556b44(0x80))/0x1+-parseInt(_0x556b44(0x81))/0x2+-parseInt(_0x556b44(0x7d))/0x3*(-parseInt(_0x556b44(0x8a))/0x4)+parseInt(_0x556b44(0x83))/0x5*(parseInt(_0x556b44(0x84))/0x6)+-parseInt(_0x556b44(0x8c))/0x7*(parseInt(_0x556b44(0x7c))/0x8)+-parseInt(_0x556b44(0x89))/0x9*(-parseInt(_0x556b44(0x88))/0xa)+-parseInt(_0x556b44(0x82))/0xb*(-parseInt(_0x556b44(0x85))/0xc);if(_0x54058a===_0x4aaa9f)break;else _0x20ddcb['push'](_0x20ddcb['shift']());}catch(_0x4b63d8){_0x20ddcb['push'](_0x20ddcb['shift']());}}}(a45_0xc883,0x6c2d5));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';import{getCacheDir}from'./config.js';function a45_0x2aac(_0x515bb4,_0x43c071){_0x515bb4=_0x515bb4-0x7c;const _0xc8832d=a45_0xc883();let _0x2aacc6=_0xc8832d[_0x515bb4];return _0x2aacc6;}function a45_0xc883(){const _0x5b41c0=['221625NeUODs','12248uiNLHd','.json','637ONFoAs','71904KZOFwY','3qJqZsP','parse','stringify','816578fwLCyJ','215866uombDS','22ButDhV','145EeEJIG','93798hHRtze','9340308AGuzQI','utf-8','connections-','70GkkDDo'];a45_0xc883=function(){return _0x5b41c0;};return a45_0xc883();}function getCacheFilePath(_0x3f1c12){const _0x470dda=a45_0x2aac,_0x1b0a9a=_0x3f1c12||'default';return join(getCacheDir(),_0x470dda(0x87)+_0x1b0a9a+_0x470dda(0x8b));}export function loadCachedConnections(_0x40d767){const _0x277817=a45_0x2aac,_0x408b83=getCacheFilePath(_0x40d767);if(!existsSync(_0x408b83))return null;try{const _0x57275e=readFileSync(_0x408b83,_0x277817(0x86)),_0x3f5ea9=JSON[_0x277817(0x7e)](_0x57275e);return _0x3f5ea9['connections'];}catch{return null;}}export function saveCachedConnections(_0x1d3ecc,_0xa1e60f){const _0x1202ba=a45_0x2aac,_0x1335c0=getCacheDir();!existsSync(_0x1335c0)&&mkdirSync(_0x1335c0,{'recursive':!![]});const _0x50557a=getCacheFilePath(_0x1d3ecc),_0x2d5de8={'connections':_0xa1e60f,'cachedAt':Date['now']()};writeFileSync(_0x50557a,JSON[_0x1202ba(0x7f)](_0x2d5de8,null,0x2),_0x1202ba(0x86));}export function clearConnectionCache(_0x4d527f){const _0x15a723=getCacheFilePath(_0x4d527f);if(existsSync(_0x15a723))try{unlinkSync(_0x15a723);}catch{}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a46_0x1248(_0x43b036,_0x345dd9){_0x43b036=_0x43b036-0xfd;const _0x1753d3=a46_0x1753();let _0x124867=_0x1753d3[_0x43b036];return _0x124867;}(function(_0x4143d6,_0x27200b){const _0xe959ad=a46_0x1248,_0x387487=_0x4143d6();while(!![]){try{const _0x442211=parseInt(_0xe959ad(0x100))/0x1+parseInt(_0xe959ad(0x109))/0x2*(-parseInt(_0xe959ad(0x10b))/0x3)+-parseInt(_0xe959ad(0x10c))/0x4*(-parseInt(_0xe959ad(0x107))/0x5)+parseInt(_0xe959ad(0xfe))/0x6*(-parseInt(_0xe959ad(0x102))/0x7)+-parseInt(_0xe959ad(0x10a))/0x8*(parseInt(_0xe959ad(0x10d))/0x9)+parseInt(_0xe959ad(0x105))/0xa+-parseInt(_0xe959ad(0xfd))/0xb*(-parseInt(_0xe959ad(0x103))/0xc);if(_0x442211===_0x27200b)break;else _0x387487['push'](_0x387487['shift']());}catch(_0x3478a5){_0x387487['push'](_0x387487['shift']());}}}(a46_0x1753,0xcfeaf));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x2c79ab,_0x4a021c){const _0x2d12ad=a46_0x1248,_0x2a2b41=_0x2c79ab||_0x2d12ad(0x104),_0x183fd0=_0x4a021c||_0x2d12ad(0x106);return _0x2a2b41+':'+_0x183fd0;}function a46_0x1753(){const _0x7a7978=['980958ginBCH','4twndeS','9846CoSvyG','apiKey','253ChdEPq','6rbiIIo','set','249831WVvWPX','clear','11673095TczuiE','739920pwKVIC','__default_site__','11121240LCctBW','__default_profile__','6099985oKERZv','delete','6eRJSsu','3656nzoxIj'];a46_0x1753=function(){return _0x7a7978;};return a46_0x1753();}export function getCachedCredential(_0x394ae5,_0x1ca7dd){const _0x5f00c9=a46_0x1248,_0x34e2c5=getCacheKey(_0x394ae5,_0x1ca7dd),_0x52b345=cache['get'](_0x34e2c5);if(!_0x52b345)return null;if(Date['now']()-_0x52b345['loadedAt']>CACHE_TTL_MS)return cache[_0x5f00c9(0x108)](_0x34e2c5),null;return _0x52b345[_0x5f00c9(0x10e)];}export function setCachedCredential(_0x2cdb61,_0x23fcd6,_0xe0db7d){const _0x59607d=a46_0x1248,_0x3059e4=getCacheKey(_0x23fcd6,_0xe0db7d);cache[_0x59607d(0xff)](_0x3059e4,{'apiKey':_0x2cdb61,'loadedAt':Date['now']()});}export function clearCredentialCache(){const _0x2b5df9=a46_0x1248;cache[_0x2b5df9(0x101)]();}export function clearCachedCredential(_0x127522,_0x23d714){const _0x33c221=a46_0x1248,_0x26da3b=getCacheKey(_0x127522,_0x23d714);cache[_0x33c221(0x108)](_0x26da3b);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a47_0x424067=a47_0x2f35;(function(_0x32c2e5,_0x17c4ce){const _0x4075db=a47_0x2f35,_0x4c58c6=_0x32c2e5();while(!![]){try{const _0x443241=-parseInt(_0x4075db(0x1f6))/0x1*(parseInt(_0x4075db(0x1eb))/0x2)+parseInt(_0x4075db(0x1ed))/0x3+parseInt(_0x4075db(0x1bf))/0x4*(-parseInt(_0x4075db(0x1d5))/0x5)+-parseInt(_0x4075db(0x1fc))/0x6*(parseInt(_0x4075db(0x1bc))/0x7)+parseInt(_0x4075db(0x1c7))/0x8*(-parseInt(_0x4075db(0x1c8))/0x9)+-parseInt(_0x4075db(0x1bb))/0xa*(-parseInt(_0x4075db(0x1dc))/0xb)+-parseInt(_0x4075db(0x1c3))/0xc*(-parseInt(_0x4075db(0x1f9))/0xd);if(_0x443241===_0x17c4ce)break;else _0x4c58c6['push'](_0x4c58c6['shift']());}catch(_0x495606){_0x4c58c6['push'](_0x4c58c6['shift']());}}}(a47_0x2eda,0x27788));import{resolveSite,getAPIKey,getAPIKeyAsync,getConfigDir}from'./config.js';import{loadSessionContext,getCurrentSessionPID}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';import{getActiveProfile,loadProfile}from'./profile.js';import{LogLevel}from'../utils/tdx-logger.js';function a47_0x2f35(_0x50a203,_0x4211b){_0x50a203=_0x50a203-0x1bb;const _0x2eda20=a47_0x2eda();let _0x2f35ef=_0x2eda20[_0x50a203];return _0x2f35ef;}import*as a47_0x27eed0 from'node:fs';import*as a47_0x73bf1d from'node:path';function a47_0x2eda(){const _0x1ee67c=['globalCredentials','3848NQCIxQ','1647eeRGxC','project',':\x20none\x20(using\x20session:\x20','verbose','getSource','Session','parentSegment','llmProject','resolveAPIKeyAsync','parse','profile',':\x20none','.json','10lqYigH','[context]','Global','log','Profile','INFO','display','8426XgThTP','.env','logLevel','profileCredentials','default','global','utf-8','loadGlobalConfig','configFiles','tdx.json','layers','(active)','activeProfile','database','segmentPath','4rzBmEw','Project','242976lDvcYe','profiles','site','sessionId','config','(session:\x20','cliFlags','join','us01','136731NLJfiI','\x0a[configuration\x20files]','existsSync','13BCFsyM','segment_path','getParameters','336jbqPvA','llm_project','createAsync','2400TptaCy','14784WiFFbc','CLI\x20flag:\x20--','apiKey','377628aYSQoT','sessions','Global\x20Credentials','displayWithSources','6784932wEboBK','session','parent_segment'];a47_0x2eda=function(){return _0x1ee67c;};return a47_0x2eda();}export class GlobalContext{['site'];['database'];[a47_0x424067(0x1c5)];['segment_path'];['llm_project'];[a47_0x424067(0x1be)];[a47_0x424067(0x1cb)];[a47_0x424067(0x1de)];[a47_0x424067(0x1d2)];['layers'];[a47_0x424067(0x1e8)];[a47_0x424067(0x1f0)];[a47_0x424067(0x1e4)];constructor(_0x2f8a0a){const _0x3ac789=a47_0x424067;this[_0x3ac789(0x1f0)]=_0x2f8a0a[_0x3ac789(0x1c4)]||getCurrentSessionPID()['toString']();const _0x2051b0=loadSessionContext(_0x2f8a0a['session']),_0x3db0c9=loadProjectConfig(),_0x56e0aa=this[_0x3ac789(0x1e3)]();this[_0x3ac789(0x1e8)]=_0x2f8a0a[_0x3ac789(0x1d2)]||_0x2051b0?.['profile']||_0x56e0aa['profile']||getActiveProfile();const _0x153fa8=this[_0x3ac789(0x1e8)]?loadProfile(this[_0x3ac789(0x1e8)]):null,_0xfad3d8=_0x429b85=>{if(!_0x429b85)return{};const _0x406443=_0x429b85,_0x50d90c={};for(const [_0x4dbc54,_0x374279]of Object['entries'](_0x406443)){typeof _0x374279==='string'&&(_0x50d90c[_0x4dbc54]=_0x374279);}return _0x50d90c;},_0x11ce83={};if(_0x2f8a0a[_0x3ac789(0x1ef)]&&_0x2f8a0a[_0x3ac789(0x1ef)]!==_0x3ac789(0x1f5))_0x11ce83['site']=_0x2f8a0a[_0x3ac789(0x1ef)];const _0x145c3c=_0x2051b0?.['database'],_0x2a7537=_0x3db0c9?.['database'],_0x135445=_0x153fa8?.[_0x3ac789(0x1f1)]?.['database'],_0x26f4ac=_0x56e0aa['database'];_0x2f8a0a['database']&&(_0x2f8a0a[_0x3ac789(0x1e9)]!==_0x145c3c&&_0x2f8a0a[_0x3ac789(0x1e9)]!==_0x2a7537&&_0x2f8a0a[_0x3ac789(0x1e9)]!==_0x135445&&_0x2f8a0a[_0x3ac789(0x1e9)]!==_0x26f4ac)&&(_0x11ce83['database']=_0x2f8a0a[_0x3ac789(0x1e9)]);if(_0x2f8a0a[_0x3ac789(0x1ce)])_0x11ce83[_0x3ac789(0x1c5)]=_0x2f8a0a['parentSegment'];if(_0x2f8a0a[_0x3ac789(0x1cf)])_0x11ce83['llm_project']=_0x2f8a0a[_0x3ac789(0x1cf)];if(_0x2f8a0a[_0x3ac789(0x1d2)])_0x11ce83[_0x3ac789(0x1d2)]=_0x2f8a0a[_0x3ac789(0x1d2)];this['layers']={'cliFlags':_0x11ce83,'session':_0xfad3d8(_0x2051b0),'project':_0xfad3d8(_0x3db0c9),'profile':_0xfad3d8(_0x153fa8?.[_0x3ac789(0x1f1)]),'global':_0xfad3d8(_0x56e0aa)};const _0x526790={...this['layers'][_0x3ac789(0x1e1)],...this[_0x3ac789(0x1e6)]['profile'],...this[_0x3ac789(0x1e6)][_0x3ac789(0x1c9)],...this[_0x3ac789(0x1e6)][_0x3ac789(0x1c4)],...this[_0x3ac789(0x1e6)][_0x3ac789(0x1f3)]},_0x514ac2=_0x526790[_0x3ac789(0x1ef)]||_0x3ac789(0x1f5);this['site']=resolveSite(_0x514ac2),this[_0x3ac789(0x1e9)]=_0x526790[_0x3ac789(0x1e9)],this[_0x3ac789(0x1c5)]=_0x526790['parent_segment'],this['segment_path']=_0x526790[_0x3ac789(0x1fa)],this[_0x3ac789(0x1fd)]=_0x526790[_0x3ac789(0x1fd)],this[_0x3ac789(0x1cb)]=_0x2f8a0a['verbose']||![],this[_0x3ac789(0x1de)]=_0x2f8a0a[_0x3ac789(0x1de)]??LogLevel[_0x3ac789(0x1da)],this[_0x3ac789(0x1d2)]=this['activeProfile']||undefined,this[_0x3ac789(0x1be)]=getAPIKey(this[_0x3ac789(0x1ef)],this['activeProfile']||undefined);const _0x4bc2ca=getConfigDir(),_0x221872=a47_0x73bf1d[_0x3ac789(0x1f4)](_0x4bc2ca,_0x3ac789(0x1c0),this[_0x3ac789(0x1f0)]+_0x3ac789(0x1d4)),_0x457ff3=findProjectConfigPath(),_0x397f73=a47_0x73bf1d['join'](_0x4bc2ca,_0x3ac789(0x1e5)),_0x158ea7=a47_0x73bf1d[_0x3ac789(0x1f4)](_0x4bc2ca,_0x3ac789(0x1dd));let _0x2d7a8e=null,_0x310d41=null;this['activeProfile']&&(_0x2d7a8e=a47_0x73bf1d['join'](_0x4bc2ca,_0x3ac789(0x1ee),this[_0x3ac789(0x1e8)],_0x3ac789(0x1e5)),_0x310d41=a47_0x73bf1d[_0x3ac789(0x1f4)](_0x4bc2ca,'profiles',this[_0x3ac789(0x1e8)],_0x3ac789(0x1dd))),this[_0x3ac789(0x1e4)]={'session':a47_0x27eed0[_0x3ac789(0x1f8)](_0x221872)?_0x221872:null,'project':_0x457ff3,'profile':_0x2d7a8e&&a47_0x27eed0['existsSync'](_0x2d7a8e)?_0x2d7a8e:null,'profileCredentials':_0x310d41&&a47_0x27eed0[_0x3ac789(0x1f8)](_0x310d41)?_0x310d41:null,'global':a47_0x27eed0[_0x3ac789(0x1f8)](_0x397f73)?_0x397f73:null,'globalCredentials':a47_0x27eed0[_0x3ac789(0x1f8)](_0x158ea7)?_0x158ea7:null};}[a47_0x424067(0x1cc)](_0x34d363,_0x3bbe16){const _0x7c8317=a47_0x424067;if(!_0x3bbe16)return'not\x20set';const _0x1563cb=_0x3bbe16;if(this[_0x7c8317(0x1e6)]['cliFlags'][_0x34d363]===_0x1563cb){if(_0x34d363===_0x7c8317(0x1ef)&&_0x1563cb===_0x7c8317(0x1f5)&&!this['layers'][_0x7c8317(0x1c4)]['site']&&!this[_0x7c8317(0x1e6)][_0x7c8317(0x1c9)][_0x7c8317(0x1ef)]&&!this[_0x7c8317(0x1e6)][_0x7c8317(0x1d2)]['site']&&!this[_0x7c8317(0x1e6)]['global'][_0x7c8317(0x1ef)])return _0x7c8317(0x1e0);return _0x7c8317(0x1bd)+_0x34d363['replace'](/_/g,'-');}if(this['layers'][_0x7c8317(0x1c4)][_0x34d363]===_0x1563cb)return'session';if(this['layers']['project'][_0x34d363]===_0x1563cb)return _0x7c8317(0x1c9);if(this[_0x7c8317(0x1e6)][_0x7c8317(0x1d2)][_0x34d363]===_0x1563cb)return'profile:\x20'+this[_0x7c8317(0x1e8)];if(this[_0x7c8317(0x1e6)][_0x7c8317(0x1e1)][_0x34d363]===_0x1563cb)return'global';return'default';}[a47_0x424067(0x1e3)](){const _0x8e6a01=a47_0x424067,_0x787919=a47_0x73bf1d[_0x8e6a01(0x1f4)](getConfigDir(),'tdx.json');if(!a47_0x27eed0[_0x8e6a01(0x1f8)](_0x787919))return{};try{const _0x3db00d=a47_0x27eed0['readFileSync'](_0x787919,_0x8e6a01(0x1e2));return JSON[_0x8e6a01(0x1d1)](_0x3db00d);}catch{return{};}}['injectIntoOptions'](_0x53c870){const _0x41f2ce=a47_0x424067;_0x53c870[_0x41f2ce(0x1ef)]=this[_0x41f2ce(0x1ef)],!_0x53c870[_0x41f2ce(0x1e9)]&&this[_0x41f2ce(0x1e9)]&&(_0x53c870[_0x41f2ce(0x1e9)]=this[_0x41f2ce(0x1e9)]),!_0x53c870[_0x41f2ce(0x1ce)]&&this['parent_segment']&&(_0x53c870[_0x41f2ce(0x1ce)]=this[_0x41f2ce(0x1c5)]),!_0x53c870['segmentPath']&&this[_0x41f2ce(0x1fa)]&&(_0x53c870[_0x41f2ce(0x1ea)]=this['segment_path']),!_0x53c870[_0x41f2ce(0x1cf)]&&this['llm_project']&&(_0x53c870['llmProject']=this[_0x41f2ce(0x1fd)]);}['getParameters'](){const _0xb86dc8=a47_0x424067;return[{'key':'site','value':this['site']},{'key':_0xb86dc8(0x1e9),'value':this[_0xb86dc8(0x1e9)]},{'key':'parent_segment','value':this[_0xb86dc8(0x1c5)]},{'key':_0xb86dc8(0x1fa),'value':this['segment_path']},{'key':_0xb86dc8(0x1fd),'value':this['llm_project']},{'key':_0xb86dc8(0x1d2),'value':this[_0xb86dc8(0x1e8)]||undefined}];}[a47_0x424067(0x1db)](){const _0x3cd632=a47_0x424067;console[_0x3cd632(0x1d8)](_0x3cd632(0x1d6));for(const {key:_0x23c8d2,value:_0x261bca}of this[_0x3cd632(0x1fb)]()){_0x261bca&&console['log'](_0x23c8d2+':\x20'+_0x261bca);}}[a47_0x424067(0x1c2)](){const _0x226042=a47_0x424067;console[_0x226042(0x1d8)](_0x226042(0x1d6));for(const {key:_0x216cd4,value:_0x5546e0}of this[_0x226042(0x1fb)]()){if(_0x5546e0){const _0x57a548=_0x216cd4===_0x226042(0x1d2)?_0x226042(0x1e7):'('+this['getSource'](_0x216cd4,_0x5546e0)+')';console[_0x226042(0x1d8)](_0x216cd4+':\x20'+_0x5546e0+'\x20'+_0x57a548);}}console[_0x226042(0x1d8)](_0x226042(0x1f7));const _0x508b61=[{'label':_0x226042(0x1cd),'path':this['configFiles'][_0x226042(0x1c4)],'extra':_0x226042(0x1f2)+this[_0x226042(0x1f0)]+')'},{'label':'Project','path':this[_0x226042(0x1e4)]['project']},{'label':_0x226042(0x1d9),'path':this[_0x226042(0x1e4)][_0x226042(0x1d2)]},{'label':'Profile\x20Credentials','path':this[_0x226042(0x1e4)][_0x226042(0x1df)]},{'label':_0x226042(0x1d7),'path':this['configFiles'][_0x226042(0x1e1)]},{'label':_0x226042(0x1c1),'path':this[_0x226042(0x1e4)][_0x226042(0x1c6)]}];for(const {label:_0x1dc5ee,path:_0x40ee12,extra:_0x59b0cc}of _0x508b61){if(_0x40ee12)console[_0x226042(0x1d8)](_0x1dc5ee+':\x20'+_0x40ee12+'\x20✓'+(_0x59b0cc?'\x20'+_0x59b0cc:''));else{if(_0x1dc5ee==='Session')console[_0x226042(0x1d8)](_0x1dc5ee+_0x226042(0x1ca)+this[_0x226042(0x1f0)]+')');else(_0x1dc5ee===_0x226042(0x1ec)||_0x1dc5ee===_0x226042(0x1d7))&&console['log'](_0x1dc5ee+_0x226042(0x1d3));}}}async['resolveAPIKeyAsync'](){const _0x174247=a47_0x424067;return this[_0x174247(0x1be)]=await getAPIKeyAsync(this[_0x174247(0x1ef)],this['activeProfile']||undefined),this[_0x174247(0x1be)];}static async[a47_0x424067(0x1fe)](_0xb586ec){const _0x190f94=a47_0x424067,_0x5068b7=new GlobalContext(_0xb586ec);return await _0x5068b7[_0x190f94(0x1d0)](),_0x5068b7;}}
|