@treasuredata/tdx 0.7.2 → 0.7.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.d.ts +20 -1
- package/dist/client/cdp-api-client.d.ts.map +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/cdp-api-client.js.map +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/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.d.ts +5 -4
- package/dist/commands/parent-segment-command.d.ts.map +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/parent-segment-command.js.map +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pwd-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.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/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment.d.ts.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/segment.js.map +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/cdp.d.ts +59 -0
- package/dist/types/cdp.d.ts.map +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.d.ts +1 -1
- 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/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.d.ts +1 -0
- package/dist/utils/fields-display.d.ts.map +1 -1
- package/dist/utils/fields-display.js +1 -1
- package/dist/utils/fields-display.js.map +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.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a34_0x4f448f=a34_0x2cf4;(function(_0x396a17,_0xbdaf50){const _0xdd1390=a34_0x2cf4,_0x38e45c=_0x396a17();while(!![]){try{const _0x19ec64=-parseInt(_0xdd1390(0x1e0))/0x1*(-parseInt(_0xdd1390(0x1cf))/0x2)+parseInt(_0xdd1390(0x1e2))/0x3+-parseInt(_0xdd1390(0x1f8))/0x4+parseInt(_0xdd1390(0x1d0))/0x5+-parseInt(_0xdd1390(0x1df))/0x6*(parseInt(_0xdd1390(0x1c6))/0x7)+-parseInt(_0xdd1390(0x1ee))/0x8*(-parseInt(_0xdd1390(0x1cd))/0x9)+-parseInt(_0xdd1390(0x1cc))/0xa;if(_0x19ec64===_0xbdaf50)break;else _0x38e45c['push'](_0x38e45c['shift']());}catch(_0x2d627e){_0x38e45c['push'](_0x38e45c['shift']());}}}(a34_0x303c,0x6e684));import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a34_0x303c(){const _0x513012=['fullPath','resolvePathToResource','session','type','1661860nyqLYP','Context\x20cleared.\x20Back\x20to\x20root.','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','parentId','folderPath','error','63LIayRc','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Context\x20set\x20to:\x20','verbose','\x27...','site','1804220ljkVKd','3879qnNmTt','Examples:','1258hKIegn','99005fmFYvf','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','segment:use','length','Folder\x20ID:\x20','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Parent\x20ID:\x20','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','folderId','isAbsolute','Resolving\x20path\x20\x27','Resolved\x20relative\x20path\x20to:\x20','Target\x20path:\x20','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','325782xoxPXb','1243FSaPyv','join','112053FtpZCI','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','parentName','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Error:\x20Path\x20is\x20required','slice','log','Usage:\x20tdx\x20segment\x20use\x20<path>','Use:\x20tdx\x20segment\x20use\x20','Site:\x20','split','name','12952TlqCcA','segment','description','segmentPath','segments','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'];a34_0x303c=function(){return _0x513012;};return a34_0x303c();}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';function a34_0x2cf4(_0x2f0bd2,_0x28d5a5){const _0x303ce0=a34_0x303c();return a34_0x2cf4=function(_0x2cf4bb,_0x4fbc2c){_0x2cf4bb=_0x2cf4bb-0x1c6;let _0x26953a=_0x303ce0[_0x2cf4bb];return _0x26953a;},a34_0x2cf4(_0x2f0bd2,_0x28d5a5);}export class SegmentUseCommand extends BaseCommand{[a34_0x4f448f(0x1ed)]=a34_0x4f448f(0x1d2);[a34_0x4f448f(0x1f0)]=a34_0x4f448f(0x1d5);async['execute'](_0x8b72e6){const _0x1e1850=a34_0x4f448f,{options:_0x26f336,args:_0x2be8f8,tdx:_0x5c8530}=_0x8b72e6;if(_0x2be8f8[_0x1e1850(0x1d3)]===0x0)return console[_0x1e1850(0x1fd)](_0x1e1850(0x1e6)),console['error'](_0x1e1850(0x1e9)),console[_0x1e1850(0x1fd)](_0x1e1850(0x1ce)),console[_0x1e1850(0x1fd)](_0x1e1850(0x1e5)),console[_0x1e1850(0x1fd)](_0x1e1850(0x1d1)),console[_0x1e1850(0x1fd)](_0x1e1850(0x1fa)),console[_0x1e1850(0x1fd)](_0x1e1850(0x1dd)),0x1;const _0x325ed0=_0x2be8f8[0x0],_0x8c6a6d=_0x26f336[_0x1e1850(0x1f6)];try{if(_0x325ed0==='/')return saveSessionContext({'segment_path':undefined},_0x8c6a6d),console[_0x1e1850(0x1e8)](_0x1e1850(0x1f9)),0x0;const _0x375190=_0x26f336[_0x1e1850(0x1f1)];let _0x5eca58=_0x325ed0;const _0x3254e7=parsePath(_0x325ed0);if(!_0x3254e7[_0x1e1850(0x1d9)]){if(!_0x375190)return console[_0x1e1850(0x1fd)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.'),console['error'](_0x1e1850(0x1c7)),0x1;if(_0x325ed0==='..'){const _0x48bc60=_0x375190[_0x1e1850(0x1ec)]('/')[_0x1e1850(0x1e7)](0x0,-0x1)[_0x1e1850(0x1e1)]('/');_0x5eca58=_0x48bc60||'/';}else _0x325ed0==='.'?_0x5eca58=_0x375190:_0x5eca58=_0x375190+'/'+_0x325ed0;_0x26f336[_0x1e1850(0x1c9)]&&console['error'](_0x1e1850(0x1db)+_0x5eca58);}if(_0x5eca58==='/'||_0x5eca58==='')return saveSessionContext({'segment_path':undefined},_0x8c6a6d),console[_0x1e1850(0x1e8)](_0x1e1850(0x1f9)),0x0;_0x5eca58=normalizePath(_0x5eca58);const _0x18dd72=parsePath(_0x5eca58)[_0x1e1850(0x1f2)];if(_0x18dd72[_0x1e1850(0x1d3)]===0x0)return saveSessionContext({'segment_path':undefined},_0x8c6a6d),console[_0x1e1850(0x1e8)](_0x1e1850(0x1f9)),0x0;_0x26f336[_0x1e1850(0x1c9)]&&(console[_0x1e1850(0x1fd)](_0x1e1850(0x1eb)+_0x26f336[_0x1e1850(0x1cb)]),console[_0x1e1850(0x1fd)](_0x1e1850(0x1dc)+_0x5eca58));const _0x2a8d77=await withSpinner(_0x1e1850(0x1da)+_0x5eca58+_0x1e1850(0x1ca),()=>_0x5c8530[_0x1e1850(0x1ef)][_0x1e1850(0x1f5)](_0x5eca58),{'verbose':_0x26f336[_0x1e1850(0x1c9)]}),_0x1caee8=_0x2a8d77['data'];_0x26f336[_0x1e1850(0x1c9)]&&(console[_0x1e1850(0x1fd)]('Resolved\x20path\x20type:\x20'+_0x1caee8[_0x1e1850(0x1f7)]),console[_0x1e1850(0x1fd)](_0x1e1850(0x1d6)+_0x1caee8[_0x1e1850(0x1fb)]),_0x1caee8['folderId']&&console[_0x1e1850(0x1fd)](_0x1e1850(0x1d4)+_0x1caee8[_0x1e1850(0x1d8)]));if(_0x1caee8[_0x1e1850(0x1f7)]==='segment')return console['error']('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.'),console[_0x1e1850(0x1fd)](_0x1e1850(0x1f3)),console[_0x1e1850(0x1fd)](_0x1e1850(0x1ea)+_0x1caee8[_0x1e1850(0x1e4)]+(_0x1caee8[_0x1e1850(0x1fc)]?'/'+_0x1caee8['folderPath'][_0x1e1850(0x1e1)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x1caee8[_0x1e1850(0x1f4)],'parent_segment':_0x1caee8[_0x1e1850(0x1e4)]},_0x8c6a6d),console[_0x1e1850(0x1e8)](_0x1e1850(0x1c8)+_0x1caee8['fullPath']),_0x26f336['verbose']&&(console['error'](_0x1e1850(0x1e3)),console[_0x1e1850(0x1fd)](_0x1e1850(0x1de)),console[_0x1e1850(0x1fd)](_0x1e1850(0x1d7))),0x0;}catch(_0x2d202d){throw _0x2d202d;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a35_0x2ae4f1=a35_0x16bc;(function(_0x390e08,_0x300459){const _0x3fe97b=a35_0x16bc,_0x46c79a=_0x390e08();while(!![]){try{const _0x2b502a=-parseInt(_0x3fe97b(0xdb))/0x1*(-parseInt(_0x3fe97b(0xad))/0x2)+parseInt(_0x3fe97b(0xd0))/0x3+parseInt(_0x3fe97b(0xc3))/0x4+parseInt(_0x3fe97b(0xe1))/0x5*(parseInt(_0x3fe97b(0xe2))/0x6)+-parseInt(_0x3fe97b(0xe6))/0x7*(-parseInt(_0x3fe97b(0xd2))/0x8)+parseInt(_0x3fe97b(0xcd))/0x9*(-parseInt(_0x3fe97b(0xba))/0xa)+-parseInt(_0x3fe97b(0xdd))/0xb*(parseInt(_0x3fe97b(0xd7))/0xc);if(_0x2b502a===_0x300459)break;else _0x46c79a['push'](_0x46c79a['shift']());}catch(_0x1b73f3){_0x46c79a['push'](_0x46c79a['shift']());}}}(a35_0x2f4d,0x1ae7a));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a35_0x16bc(_0x4849b2,_0x4b6c04){const _0x2f4dcd=a35_0x2f4d();return a35_0x16bc=function(_0x16bcb7,_0x5af95f){_0x16bcb7=_0x16bcb7-0xab;let _0x2cb8d0=_0x2f4dcd[_0x16bcb7];return _0x2cb8d0;},a35_0x16bc(_0x4849b2,_0x4b6c04);}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{formatRows}from'../utils/formatters.js';import a35_0x459f2b from'chalk';export class SegmentsCommand extends BaseCommand{[a35_0x2ae4f1(0xe5)]='segments';[a35_0x2ae4f1(0xc8)]='List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments';async[a35_0x2ae4f1(0xe0)](_0x2d56c5){const _0x55acaf=a35_0x2ae4f1,{options:_0x3d7009,args:_0x1222a7}=_0x2d56c5,_0x325e0b=_0x3d7009['recursive'],_0x4e79f0=_0x1222a7[0x0];try{const _0x4cd560=_0x3d7009[_0x55acaf(0xe4)];_0x3d7009[_0x55acaf(0xe9)]&&(console[_0x55acaf(0xde)](_0x55acaf(0xb5)+_0x3d7009['site']),console[_0x55acaf(0xde)](_0x55acaf(0xcc)+(_0x4cd560||'/')),_0x4e79f0&&console[_0x55acaf(0xde)](_0x55acaf(0xb1)+_0x4e79f0),_0x325e0b&&console[_0x55acaf(0xde)](_0x55acaf(0xbf)));if(_0x4e79f0){const _0x402219=_0x4e79f0[_0x55acaf(0xc1)]('*')||_0x4e79f0[_0x55acaf(0xc1)]('?');if(_0x402219&&!_0x4cd560)return await this[_0x55acaf(0xac)](_0x2d56c5,_0x4e79f0);else return _0x402219?(console[_0x55acaf(0xde)]('Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).'),console[_0x55acaf(0xde)]('Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/'),0x1):_0x325e0b?await this[_0x55acaf(0xda)](_0x2d56c5,_0x4e79f0):await this['listUnified'](_0x2d56c5,_0x4e79f0);}if(!_0x4cd560)return await this[_0x55acaf(0xd9)](_0x2d56c5);return _0x325e0b?await this[_0x55acaf(0xda)](_0x2d56c5,_0x4cd560):await this['listUnified'](_0x2d56c5,_0x4cd560);}catch(_0x1a2d8f){if(_0x1a2d8f instanceof SDKError)return console[_0x55acaf(0xde)]('Error:\x20'+_0x1a2d8f[_0x55acaf(0xbe)]),_0x1a2d8f[_0x55acaf(0xc7)]&&console['error'](_0x55acaf(0xb0)+_0x1a2d8f[_0x55acaf(0xc7)]),0x1;throw _0x1a2d8f;}}async[a35_0x2ae4f1(0xac)](_0x5acfc0,_0x2f4685){const _0x455bdb=a35_0x2ae4f1,{options:_0x30d5f0,tdx:_0x43442a}=_0x5acfc0,_0x595ee6=await withSpinner('Listing\x20parent\x20segments\x20matching\x20\x27'+_0x2f4685+_0x455bdb(0xaf),()=>_0x43442a[_0x455bdb(0xd4)][_0x455bdb(0xd9)](),{'verbose':_0x30d5f0[_0x455bdb(0xe9)]}),_0x304889=_0x595ee6['data'],_0x412851=_0x2f4685[_0x455bdb(0xc0)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x455bdb(0xc0)](/\*/g,'.*')[_0x455bdb(0xc0)](/\?/g,'.'),_0x188e37=new RegExp('^'+_0x412851+'$','i'),_0x2caeee=_0x304889[_0x455bdb(0xb4)](_0x2d17ab=>_0x188e37[_0x455bdb(0xe8)](_0x2d17ab[_0x455bdb(0xbc)][_0x455bdb(0xe5)]));console['error'](_0x455bdb(0xce)+_0x2caeee[_0x455bdb(0xca)]+_0x455bdb(0xcf)+(_0x2caeee[_0x455bdb(0xca)]!==0x1?'s':'')+_0x455bdb(0xd5)+_0x2f4685+'\x27');if(_0x30d5f0[_0x455bdb(0xc5)]===_0x455bdb(0xb9)||_0x30d5f0[_0x455bdb(0xc5)]==='jsonl')await handleSDKOutput(_0x2caeee,_0x30d5f0);else{if(_0x2caeee['length']===0x0)console[_0x455bdb(0xbd)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x2f4685);else{console[_0x455bdb(0xbd)](_0x455bdb(0xe3));for(const _0x3b52a5 of _0x2caeee){const _0x52575e=_0x3b52a5[_0x455bdb(0xbc)][_0x455bdb(0xb2)]?a35_0x459f2b[_0x455bdb(0xb7)]('\x20('+formatRows(_0x3b52a5[_0x455bdb(0xbc)][_0x455bdb(0xb2)])+')'):'';console[_0x455bdb(0xbd)](_0x455bdb(0xcb)+_0x3b52a5['attributes'][_0x455bdb(0xe5)]+_0x52575e);}}}return 0x0;}async[a35_0x2ae4f1(0xd9)](_0x2fba59){const _0xd2f9f=a35_0x2ae4f1,{options:_0x340da4,tdx:_0x55c7c5}=_0x2fba59,_0x1dd8ad=await withSpinner(_0xd2f9f(0xc6),()=>_0x55c7c5['segment']['listParents'](),{'verbose':_0x340da4[_0xd2f9f(0xe9)]}),_0x4f5542=_0x1dd8ad[_0xd2f9f(0xbb)];console['error']('✔\x20Found\x20'+_0x4f5542['length']+'\x20parent\x20segment'+(_0x4f5542[_0xd2f9f(0xca)]!==0x1?'s':''));if(_0x340da4[_0xd2f9f(0xc5)]===_0xd2f9f(0xb9)||_0x340da4[_0xd2f9f(0xc5)]==='jsonl')await handleSDKOutput(_0x4f5542,_0x340da4);else{console[_0xd2f9f(0xbd)](_0xd2f9f(0xe3));for(const _0xdc3f05 of _0x4f5542){const _0x349f28=_0xdc3f05[_0xd2f9f(0xbc)][_0xd2f9f(0xb2)]?a35_0x459f2b[_0xd2f9f(0xb7)]('\x20('+formatRows(_0xdc3f05[_0xd2f9f(0xbc)][_0xd2f9f(0xb2)])+')'):'';console[_0xd2f9f(0xbd)](_0xd2f9f(0xcb)+_0xdc3f05[_0xd2f9f(0xbc)][_0xd2f9f(0xe5)]+_0x349f28);}}return 0x0;}async[a35_0x2ae4f1(0xab)](_0x35ef45,_0x4201f3){const _0x1f38dc=a35_0x2ae4f1,{options:_0x1dfcdd,tdx:_0x385099}=_0x35ef45,_0x5c659e=await withSpinner(_0x1f38dc(0xd8)+_0x4201f3+_0x1f38dc(0xaf),()=>_0x385099[_0x1f38dc(0xd4)]['resolvePathToResource'](_0x4201f3),{'verbose':_0x1dfcdd[_0x1f38dc(0xe9)]}),_0x44490a=_0x5c659e[_0x1f38dc(0xbb)];_0x1dfcdd['verbose']&&(console[_0x1f38dc(0xde)](_0x1f38dc(0xe7)+_0x44490a['parentId']),_0x44490a['folderId']&&console[_0x1f38dc(0xde)]('Folder\x20ID:\x20'+_0x44490a[_0x1f38dc(0xae)]));const _0x73da19=await withSpinner(_0x1f38dc(0xc4),()=>_0x385099['segment']['listUnified'](_0x44490a['parentId'],_0x44490a[_0x1f38dc(0xae)]),{'verbose':_0x1dfcdd[_0x1f38dc(0xe9)]}),{folders:_0x36fa35,segments:_0x4d4ff9}=_0x73da19[_0x1f38dc(0xbb)],_0x1252c3=_0x36fa35[_0x1f38dc(0xca)]+_0x4d4ff9['length'];console['error'](_0x1f38dc(0xce)+_0x36fa35['length']+'\x20folder'+(_0x36fa35[_0x1f38dc(0xca)]!==0x1?'s':'')+'\x20and\x20'+_0x4d4ff9['length']+'\x20segment'+(_0x4d4ff9['length']!==0x1?'s':''));if(_0x1dfcdd['format']===_0x1f38dc(0xb9)||_0x1dfcdd['format']==='jsonl'){const _0x27077d=[..._0x36fa35[_0x1f38dc(0xd6)](_0x5b4371=>({..._0x5b4371,'type':_0x1f38dc(0xc2)})),..._0x4d4ff9[_0x1f38dc(0xd6)](_0x40e934=>({..._0x40e934,'type':_0x1f38dc(0xd4)}))]['sort']((_0x11c478,_0x479fa8)=>_0x11c478[_0x1f38dc(0xe5)][_0x1f38dc(0xb3)](_0x479fa8['name']));await handleSDKOutput(_0x27077d,_0x1dfcdd);}else{if(_0x1252c3===0x0)console[_0x1f38dc(0xbd)](a35_0x459f2b[_0x1f38dc(0xb7)]('[/'+_0x4201f3+']')),console['log'](_0x1f38dc(0xd1));else{console['log'](a35_0x459f2b[_0x1f38dc(0xb7)]('[/'+_0x4201f3+']'));const _0x1c58df=formatFlatList(_0x36fa35,_0x4d4ff9,{'showMetadata':!![]});console[_0x1f38dc(0xbd)](_0x1c58df);}}return 0x0;}async[a35_0x2ae4f1(0xda)](_0x2bfe6d,_0x221155){const _0x51f185=a35_0x2ae4f1,{options:_0x2c2004,tdx:_0x3496aa}=_0x2bfe6d,_0x178ba3=await withSpinner(_0x51f185(0xd8)+_0x221155+'\x27...',()=>_0x3496aa['segment'][_0x51f185(0xb8)](_0x221155),{'verbose':_0x2c2004[_0x51f185(0xe9)]}),_0x922224=_0x178ba3[_0x51f185(0xbb)];_0x2c2004['verbose']&&(console[_0x51f185(0xde)](_0x51f185(0xe7)+_0x922224['parentId']),_0x922224[_0x51f185(0xae)]&&console[_0x51f185(0xde)](_0x51f185(0xdf)+_0x922224[_0x51f185(0xae)]));const _0x55e4b5=_0x2c2004[_0x51f185(0xdc)]||0xa,_0x4179ab=await withSpinner(_0x51f185(0xb6),()=>_0x3496aa['segment'][_0x51f185(0xda)](_0x922224[_0x51f185(0xc9)],_0x922224[_0x51f185(0xae)],0x0,_0x55e4b5),{'verbose':_0x2c2004[_0x51f185(0xe9)]}),_0x58250e=_0x4179ab[_0x51f185(0xbb)];console[_0x51f185(0xde)]('✔\x20Built\x20tree\x20with\x20'+_0x58250e[_0x51f185(0xca)]+'\x20top-level\x20items');if(_0x2c2004[_0x51f185(0xc5)]==='json'||_0x2c2004[_0x51f185(0xc5)]===_0x51f185(0xd3))await handleSDKOutput(_0x58250e,_0x2c2004);else{console[_0x51f185(0xbd)](a35_0x459f2b[_0x51f185(0xb7)]('[/'+_0x221155+']'));const _0x533b94=formatTree(_0x58250e,{'showMetadata':!![]});console[_0x51f185(0xbd)](_0x533b94);}return 0x0;}}function a35_0x2f4d(){const _0x2ff546=['filter','Site:\x20','Building\x20hierarchy\x20tree...','dim','resolvePathToResource','json','350yWCGRf','data','attributes','log','message','Recursive\x20mode:\x20enabled','replace','includes','folder','528496PmwndZ','Listing\x20folders\x20and\x20segments...','format','Listing\x20parent\x20segments...','cause','description','parentId','length','👥\x20','Current\x20context:\x20','21789OxHzWf','✔\x20Found\x20','\x20parent\x20segment','44712mqeODr','(empty)','32DWHgzI','jsonl','segment','\x20matching\x20\x27','map','1102716xnwUPK','Resolving\x20context\x20path\x20\x27','listParents','listRecursive','19BGQKJh','maxDepth','33ZagFxc','error','Folder\x20ID:\x20','execute','5GOQKrc','129378JQPjOL','[parent\x20segments]','segmentPath','name','351155ATGVND','Parent\x20ID:\x20','test','verbose','listUnified','listParentsWithPattern','10670pCAqgs','folderId','\x27...','\x20\x20Cause:\x20','Path/pattern\x20arg:\x20','population','localeCompare'];a35_0x2f4d=function(){return _0x2ff546;};return a35_0x2f4d();}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x2a5f33=a36_0x3905;(function(_0x5f5be3,_0x1109b1){const _0x1b0189=a36_0x3905,_0x2d5c24=_0x5f5be3();while(!![]){try{const _0x4a3d79=parseInt(_0x1b0189(0x87))/0x1+parseInt(_0x1b0189(0x85))/0x2+-parseInt(_0x1b0189(0xa8))/0x3*(-parseInt(_0x1b0189(0x99))/0x4)+parseInt(_0x1b0189(0x91))/0x5+-parseInt(_0x1b0189(0xa2))/0x6*(-parseInt(_0x1b0189(0x92))/0x7)+-parseInt(_0x1b0189(0x93))/0x8*(-parseInt(_0x1b0189(0x97))/0x9)+-parseInt(_0x1b0189(0xa3))/0xa;if(_0x4a3d79===_0x1109b1)break;else _0x2d5c24['push'](_0x2d5c24['shift']());}catch(_0x2e923b){_0x2d5c24['push'](_0x2d5c24['shift']());}}}(a36_0x3bbb,0x6e2b8));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a36_0x3905(_0x25db16,_0x26b035){const _0x3bbb26=a36_0x3bbb();return a36_0x3905=function(_0x39054b,_0x33daa9){_0x39054b=_0x39054b-0x80;let _0x2f4fc6=_0x3bbb26[_0x39054b];return _0x2f4fc6;},a36_0x3905(_0x25db16,_0x26b035);}import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';function a36_0x3bbb(){const _0x168bc1=['\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','show','length','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','6SCfxcj','16000340njJgKj','args','...','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','data','6WEnyYi','Database:\x20','\x20row','Table:\x20','limit','✔\x20Retrieved\x20','587246WbZvPt','validate','272863HDNqmV','cause','database','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','description','message','Limit:\x20','error','execute','verbose','390365JLcENx','5698301GLFIRC','144HeoXDf','Usage:\x20tdx\x20show\x20<database.table>','Querying\x20','showTable','218223YuWPTU','Error:\x20','312484lzHKIv','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','query','Show\x20table\x20contents','table'];a36_0x3bbb=function(){return _0x168bc1;};return a36_0x3bbb();}export class ShowCommand extends BaseCommand{['name']=a36_0x2a5f33(0x9f);[a36_0x2a5f33(0x8b)]=a36_0x2a5f33(0x9c);async[a36_0x2a5f33(0x8f)](_0x4b4b19){const _0x35202b=a36_0x2a5f33;return this[_0x35202b(0x96)](_0x4b4b19);}async[a36_0x2a5f33(0x96)](_0xcfd911){const _0x5dc89d=a36_0x2a5f33,{options:_0x3e54e8,args:_0xf49fd8,tdx:_0x31a985}=_0xcfd911;let _0x1543fc;try{_0x1543fc=parseTableReference(_0xf49fd8[0x0]);const _0x58e2c1=_0x3e54e8['database'];!_0x1543fc['database']&&_0x58e2c1&&(_0x1543fc[_0x5dc89d(0x89)]=_0x58e2c1);const _0x168a95=validateTableDescribeReference(_0x1543fc);if(_0x168a95)return console[_0x5dc89d(0x8e)](_0x5dc89d(0x98)+_0x168a95),console[_0x5dc89d(0x8e)](_0x5dc89d(0x94)),console[_0x5dc89d(0x8e)](_0x5dc89d(0xa6)),console[_0x5dc89d(0x8e)](_0x5dc89d(0x9e)),0x1;}catch(_0x515bf4){return console[_0x5dc89d(0x8e)](_0x5dc89d(0x98)+_0x515bf4[_0x5dc89d(0x8c)]),console['error']('Usage:\x20tdx\x20show\x20<database.table>'),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x5dc89d(0x8e)](_0x5dc89d(0x9e)),0x1;}const _0x111b19=_0x1543fc['catalog'],_0x426254=_0x1543fc['database'],_0x3fb0bd=_0x1543fc[_0x5dc89d(0x9d)],_0x378041=resolveLimit(_0x3e54e8[_0x5dc89d(0x83)],DEFAULT_DISPLAY_LIMIT);try{_0x3e54e8[_0x5dc89d(0x90)]&&(console['error']('Site:\x20'+_0x3e54e8['site']),_0x111b19&&console[_0x5dc89d(0x8e)]('Catalog:\x20'+_0x111b19),console[_0x5dc89d(0x8e)](_0x5dc89d(0x80)+_0x426254),console['error'](_0x5dc89d(0x82)+_0x3fb0bd),console['error'](_0x5dc89d(0x8d)+_0x378041));const _0x25470c=_0x111b19?_0x111b19+'.'+_0x426254+'.'+_0x3fb0bd:_0x426254+'.'+_0x3fb0bd,_0x4fb4fe=await withSpinner(_0x5dc89d(0x95)+_0x25470c+_0x5dc89d(0xa5),()=>_0x31a985[_0x5dc89d(0x9b)][_0x5dc89d(0x96)](_0x426254,_0x3fb0bd,_0x378041,_0x111b19),{'verbose':_0x3e54e8['verbose']}),_0x55cd7a=_0x4fb4fe[_0x5dc89d(0xa7)],_0x55a941=_0x55cd7a['data'];return _0x55a941['length']===0x0?console[_0x5dc89d(0x8e)](_0x5dc89d(0x9a)):console[_0x5dc89d(0x8e)](_0x5dc89d(0x84)+_0x55a941['length']+_0x5dc89d(0x81)+(_0x55a941[_0x5dc89d(0xa0)]!==0x1?'s':'')+'\x20from\x20'+_0x25470c),await handleSDKOutput(_0x55a941,_0x3e54e8),0x0;}catch(_0x665b0){if(_0x665b0 instanceof SDKError)return console[_0x5dc89d(0x8e)](_0x5dc89d(0x98)+_0x665b0[_0x5dc89d(0x8c)]),_0x665b0[_0x5dc89d(0x88)]&&console['error']('\x20\x20Cause:\x20'+_0x665b0[_0x5dc89d(0x88)]),0x1;throw _0x665b0;}}[a36_0x2a5f33(0x86)](_0x43efbf){const _0x25de67=a36_0x2a5f33;if(_0x43efbf[_0x25de67(0xa4)][_0x25de67(0xa0)]===0x0)return _0x25de67(0xa1);if(_0x43efbf[_0x25de67(0xa4)][_0x25de67(0xa0)]>0x1)return _0x25de67(0x8a);return undefined;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x27df97=a37_0x3d89;(function(_0x3b6b70,_0x51e088){const _0x1c243c=a37_0x3d89,_0x351563=_0x3b6b70();while(!![]){try{const _0xf8bffa=parseInt(_0x1c243c(0xa7))/0x1+-parseInt(_0x1c243c(0xb0))/0x2*(-parseInt(_0x1c243c(0xa2))/0x3)+parseInt(_0x1c243c(0x96))/0x4+parseInt(_0x1c243c(0x99))/0x5*(parseInt(_0x1c243c(0xb1))/0x6)+parseInt(_0x1c243c(0xaf))/0x7+parseInt(_0x1c243c(0x9f))/0x8*(-parseInt(_0x1c243c(0xb7))/0x9)+parseInt(_0x1c243c(0xae))/0xa*(-parseInt(_0x1c243c(0x98))/0xb);if(_0xf8bffa===_0x51e088)break;else _0x351563['push'](_0x351563['shift']());}catch(_0x54729a){_0x351563['push'](_0x351563['shift']());}}}(a37_0x25b1,0x59bbc));import{BaseCommand}from'./command.js';function a37_0x3d89(_0x955b97,_0x45a2be){const _0x25b15a=a37_0x25b1();return a37_0x3d89=function(_0x3d8952,_0x9fb214){_0x3d8952=_0x3d8952-0x94;let _0x4b3d8d=_0x25b15a[_0x3d8952];return _0x4b3d8d;},a37_0x3d89(_0x955b97,_0x45a2be);}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a37_0x25b1(){const _0x2abf47=['listTables','execute','674180gZRFMG','\x27\x20across\x20all\x20databases.','781BYTMKZ','3230635KdwgIU','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','List\x20tables\x20in\x20a\x20database','Error:\x20','Error:\x20Pattern\x20\x27','Database:\x20all','180808xxzcRW','description','✔\x20Found\x20','84gUwNZJ','cause','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','message','name','35364Yzrtuj','Database\x20pattern:\x20','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','includes','data','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','\x27\x20is\x20ambiguous.','187710rFKnuD','4711280zWCbUj','30416CefECm','6uKlzpM','limit','length','.*\x22','Or\x20use\x20--in\x20flag:','verbose','99BVjFXA','tables','error','table','database','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','Database\x20\x27','✖\x20No\x20tables\x20found','Listing\x20tables...','site','Note:\x20\x27','Site:\x20'];a37_0x25b1=function(){return _0x2abf47;};return a37_0x25b1();}import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a37_0x27df97(0xa6)]=a37_0x27df97(0xb8);[a37_0x27df97(0xa0)]=a37_0x27df97(0x9b);async[a37_0x27df97(0x95)](_0x8b347f){const _0x2de57d=a37_0x27df97,{options:_0x4dd8a1,args:_0x546bfb,tdx:_0x1d27b0}=_0x8b347f;let _0x55c96d;if(_0x546bfb[_0x2de57d(0xb3)]===0x0)_0x55c96d={'database':undefined,'table':undefined,'original':''};else{if(_0x546bfb[_0x2de57d(0xb3)]===0x1)try{_0x55c96d=parseTableReference(_0x546bfb[0x0]);if(_0x55c96d[_0x2de57d(0xba)]&&!_0x55c96d[_0x2de57d(0xbb)]&&!_0x55c96d[_0x2de57d(0xba)][_0x2de57d(0xaa)]('*')&&!_0x55c96d[_0x2de57d(0xba)][_0x2de57d(0xaa)]('?'))return console['error'](_0x2de57d(0x9d)+_0x546bfb[0x0]+_0x2de57d(0xad)),console['error'](_0x2de57d(0xa4)+_0x55c96d[_0x2de57d(0xba)]+'\x27?'),console[_0x2de57d(0xb9)]('\x20\x20Use:\x20tdx\x20tables\x20\x22'+_0x55c96d['table']+_0x2de57d(0xb4)),console['error']('\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'+_0x55c96d[_0x2de57d(0xba)]),console['error'](_0x2de57d(0x9a)+_0x55c96d['table']),console['error'](''),console['error'](_0x2de57d(0xc1)+_0x546bfb[0x0]+_0x2de57d(0xa9)+_0x55c96d['table']+_0x2de57d(0x97)),0x1;}catch(_0x33d933){return console['error'](_0x2de57d(0x9c)+_0x33d933[_0x2de57d(0xa5)]),0x1;}else return console[_0x2de57d(0xb9)]('Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'),console[_0x2de57d(0xb9)]('\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases'),console['error']('\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),console[_0x2de57d(0xb9)](_0x2de57d(0xac)),console[_0x2de57d(0xb9)](_0x2de57d(0xbc)),console[_0x2de57d(0xb9)](_0x2de57d(0xb5)),console[_0x2de57d(0xb9)]('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0x4788d1=_0x4dd8a1['database'];!_0x55c96d[_0x2de57d(0xbb)]&&_0x4788d1&&(_0x55c96d[_0x2de57d(0xbb)]=_0x4788d1);try{const _0x4db6ad=_0x243ac0=>_0x243ac0&&(_0x243ac0[_0x2de57d(0xaa)]('*')||_0x243ac0[_0x2de57d(0xaa)]('?')),_0x519144=_0x4db6ad(_0x55c96d[_0x2de57d(0xbb)]);_0x4dd8a1[_0x2de57d(0xb6)]&&(console[_0x2de57d(0xb9)](_0x2de57d(0xc2)+_0x4dd8a1[_0x2de57d(0xc0)]),_0x55c96d[_0x2de57d(0xbb)]?_0x519144?console['error'](_0x2de57d(0xa8)+_0x55c96d[_0x2de57d(0xbb)]):console[_0x2de57d(0xb9)]('Database:\x20'+_0x55c96d[_0x2de57d(0xbb)]):console[_0x2de57d(0xb9)](_0x2de57d(0x9e)),_0x55c96d['table']&&console[_0x2de57d(0xb9)]('Table\x20pattern:\x20'+_0x55c96d[_0x2de57d(0xba)]));const _0x315dc7=_0x55c96d[_0x2de57d(0xbb)]&&!_0x519144?_0x55c96d['database']:undefined,_0x12994b=_0x519144?_0x55c96d[_0x2de57d(0xbb)]:undefined,_0x4d6a0e=_0x55c96d[_0x2de57d(0xba)],_0x2a4ac1=resolveLimit(_0x4dd8a1[_0x2de57d(0xb2)],DEFAULT_LISTING_LIMIT),_0xb1fdfc=await withSpinner(_0x2de57d(0xbf),()=>_0x1d27b0['query'][_0x2de57d(0x94)](_0x315dc7,_0x4d6a0e,_0x12994b,_0x2a4ac1),{'verbose':_0x4dd8a1['verbose']}),_0x5e764e=_0xb1fdfc[_0x2de57d(0xab)];if(_0x5e764e[_0x2de57d(0xb3)]===0x0&&_0x55c96d['database']&&!_0x519144)return console[_0x2de57d(0xb9)](_0x2de57d(0xbe)),console['error'](_0x2de57d(0xbd)+_0x55c96d[_0x2de57d(0xbb)]+'\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables'),0x1;return console[_0x2de57d(0xb9)](_0x2de57d(0xa1)+_0x5e764e[_0x2de57d(0xb3)]+'\x20table'+(_0x5e764e['length']!==0x1?'s':'')),await handleSDKOutput(_0x5e764e,{..._0x4dd8a1,'limit':_0x2a4ac1}),0x0;}catch(_0x4d76d3){if(_0x4d76d3 instanceof SDKError)return console[_0x2de57d(0xb9)]('Error:\x20'+_0x4d76d3['message']),_0x4d76d3[_0x2de57d(0xa3)]&&console[_0x2de57d(0xb9)]('\x20\x20Cause:\x20'+_0x4d76d3['cause']),0x1;throw _0x4d76d3;}}['validate'](_0xd3cf4f){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x302600=a38_0x35eb;(function(_0x174dad,_0x1cf40a){const _0x189951=a38_0x35eb,_0x2b1c7d=_0x174dad();while(!![]){try{const _0x332762=-parseInt(_0x189951(0x119))/0x1+-parseInt(_0x189951(0x11b))/0x2*(-parseInt(_0x189951(0x102))/0x3)+-parseInt(_0x189951(0x11f))/0x4+parseInt(_0x189951(0x124))/0x5*(parseInt(_0x189951(0x109))/0x6)+parseInt(_0x189951(0x127))/0x7*(-parseInt(_0x189951(0x128))/0x8)+parseInt(_0x189951(0x123))/0x9*(-parseInt(_0x189951(0xfc))/0xa)+parseInt(_0x189951(0x111))/0xb*(parseInt(_0x189951(0x110))/0xc);if(_0x332762===_0x1cf40a)break;else _0x2b1c7d['push'](_0x2b1c7d['shift']());}catch(_0x489e88){_0x2b1c7d['push'](_0x2b1c7d['shift']());}}}(a38_0x6ab4,0x6830f));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';function a38_0x35eb(_0x279e04,_0x1b628b){const _0x6ab498=a38_0x6ab4();return a38_0x35eb=function(_0x35eb55,_0x31d95d){_0x35eb55=_0x35eb55-0xfa;let _0x2e4476=_0x6ab498[_0x35eb55];return _0x2e4476;},a38_0x35eb(_0x279e04,_0x1b628b);}import{profileExists}from'../core/profile.js';import{GlobalContext}from'../core/global-context.js';import a38_0xfcca43 from'chalk';function a38_0x6ab4(){const _0x57cf4f=['execute','Error:\x20','\x27\x20does\x20not\x20exist','2921356xeVkZQ','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','database','engage_workspace','4986099LauDzD','7540zcHHmn','Session\x20engage_workspace\x20set\x20to:\x20','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','21RkpNnx','2012448uzXTUZ','validate','Session\x20parent_segment\x20set\x20to:\x20','Set\x20session-level\x20context','debug','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace','join','name','profile','10CCEfyg','cleared','session','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context\x0a','(session:\x20','error','1551UxMMLJ','Session\x20profile\x20set\x20to:\x20','length','includes','Session\x20llm_project\x20set\x20to:\x20','parent_segment','Session\x20database\x20set\x20to:\x20','1086muNchV','.\x20Must\x20be\x20one\x20of:\x20','Invalid\x20resource:\x20','\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace\x0a','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','description','toString','156CtXcmd','1970188JtoryS','llm_project','green','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','Session\x20context\x20','log','display','684621ifErSC','dim','2124RfYkLX'];a38_0x6ab4=function(){return _0x57cf4f;};return a38_0x6ab4();}export class UseCommand extends BaseCommand{[a38_0x302600(0xfa)]='use';[a38_0x302600(0x10e)]=a38_0x302600(0x12b);[a38_0x302600(0x129)](_0x1fd228){const _0xc76a54=a38_0x302600,{args:_0x34740b}=_0x1fd228;if(_0x34740b['length']===0x0)return undefined;if(_0x34740b['length']===0x1)return _0xc76a54(0x114)+_0xc76a54(0xff)+_0xc76a54(0x115)+_0xc76a54(0x10c)+_0xc76a54(0x12d);const _0xb2d326=_0x34740b[0x0],_0x3d0cee=[_0xc76a54(0x121),_0xc76a54(0x107),_0xc76a54(0x112),_0xc76a54(0xfb),_0xc76a54(0x122)];if(!_0x3d0cee[_0xc76a54(0x105)](_0xb2d326))return _0xc76a54(0x10b)+_0xb2d326+_0xc76a54(0x10a)+_0x3d0cee[_0xc76a54(0x12f)](',\x20');return undefined;}async[a38_0x302600(0x11c)](_0x3e5fe5){const _0x44e8e4=a38_0x302600,{args:_0x362e30,options:_0x152baf}=_0x3e5fe5,_0x2dfc1d=_0x152baf[_0x44e8e4(0x12c)],_0x49f107=_0x152baf['clear'];cleanExpiredSessions();try{if(_0x49f107){clearSessionContext(_0x152baf['session']);const _0x172931=_0x152baf[_0x44e8e4(0xfe)]||getCurrentSessionPID()['toString']();return console[_0x44e8e4(0x117)](_0x44e8e4(0x116)+a38_0xfcca43[_0x44e8e4(0x113)](_0x44e8e4(0xfd))+'\x20'+a38_0xfcca43['dim'](_0x44e8e4(0x100)+_0x172931+')')),0x0;}if(_0x362e30[_0x44e8e4(0x104)]===0x0){const _0x6c5d2f=new GlobalContext(_0x152baf);return _0x2dfc1d?_0x6c5d2f['displayWithSources']():_0x6c5d2f[_0x44e8e4(0x118)](),console[_0x44e8e4(0x117)](a38_0xfcca43[_0x44e8e4(0x11a)](_0x44e8e4(0x10d))),console[_0x44e8e4(0x117)](a38_0xfcca43[_0x44e8e4(0x11a)](_0x44e8e4(0x12e))),0x0;}const _0x354103=_0x362e30[0x0],_0x5cca6d=_0x362e30[0x1];if(_0x354103===_0x44e8e4(0xfb)){if(!profileExists(_0x5cca6d))return console[_0x44e8e4(0x101)]('Error:\x20Profile\x20\x27'+_0x5cca6d+_0x44e8e4(0x11e)),console[_0x44e8e4(0x101)](_0x44e8e4(0x120)),0x1;const _0x3ff1ac=_0x152baf[_0x44e8e4(0xfe)]||getCurrentSessionPID()[_0x44e8e4(0x10f)]();return saveSessionContext({'profile':_0x5cca6d},_0x152baf[_0x44e8e4(0xfe)]),console['log'](_0x44e8e4(0x103)+a38_0xfcca43['green'](_0x5cca6d)+'\x20'+a38_0xfcca43[_0x44e8e4(0x11a)]('(session:\x20'+_0x3ff1ac+')')),console[_0x44e8e4(0x117)](a38_0xfcca43['dim'](_0x44e8e4(0x126))),0x0;}const _0x340304={},_0x52b9fe=_0x152baf[_0x44e8e4(0xfe)]||getCurrentSessionPID()[_0x44e8e4(0x10f)]();switch(_0x354103){case _0x44e8e4(0x121):_0x340304[_0x44e8e4(0x121)]=_0x5cca6d,console[_0x44e8e4(0x117)](_0x44e8e4(0x108)+a38_0xfcca43[_0x44e8e4(0x113)](_0x5cca6d)+'\x20'+a38_0xfcca43[_0x44e8e4(0x11a)](_0x44e8e4(0x100)+_0x52b9fe+')'));break;case'parent_segment':_0x340304[_0x44e8e4(0x107)]=_0x5cca6d,console['log'](_0x44e8e4(0x12a)+a38_0xfcca43['green'](_0x5cca6d)+'\x20'+a38_0xfcca43[_0x44e8e4(0x11a)](_0x44e8e4(0x100)+_0x52b9fe+')'));break;case _0x44e8e4(0x112):_0x340304[_0x44e8e4(0x112)]=_0x5cca6d,console[_0x44e8e4(0x117)](_0x44e8e4(0x106)+a38_0xfcca43[_0x44e8e4(0x113)](_0x5cca6d)+'\x20'+a38_0xfcca43['dim'](_0x44e8e4(0x100)+_0x52b9fe+')'));break;case'engage_workspace':_0x340304[_0x44e8e4(0x122)]=_0x5cca6d,console['log'](_0x44e8e4(0x125)+a38_0xfcca43[_0x44e8e4(0x113)](_0x5cca6d)+'\x20'+a38_0xfcca43[_0x44e8e4(0x11a)]('(session:\x20'+_0x52b9fe+')'));break;}return saveSessionContext(_0x340304,_0x152baf[_0x44e8e4(0xfe)]),console[_0x44e8e4(0x117)](a38_0xfcca43[_0x44e8e4(0x11a)](_0x44e8e4(0x126))),0x0;}catch(_0x344d39){return _0x344d39 instanceof Error&&console[_0x44e8e4(0x101)](_0x44e8e4(0x11d)+_0x344d39['message']),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a39_0x495444=a39_0x19fb;function a39_0x1e3f(){const _0x1f127a=['List\x20workflows','done','cause','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','delete','isDirectory','Retry\x20a\x20session\x20or\x20attempt','Resume\x20from:\x20','workflow:retry','Error:\x20Attempt\x20ID\x20is\x20required','6810Pntacd','Project\x20filter:\x20','Error:\x20','\x20\x20Attempt\x20ID:\x20','\x20\x20Location:\x20','session:','fileSize','from','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Show\x20specific\x20attempt\x20details','\x20\x20Project\x20ID:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','success','error','keys','Status:\x20','tasks','Error:\x20Invalid\x20JSON\x20in\x20--params','\x20\x20Cause:\x20','includeSubtasks','Project\x20directory:\x20','Select\x20a\x20task\x20to\x20view\x20logs:','12035647FqQjgF','295FwGXxC','\x20attempt','split','workflow','format','attemptId','12FMINEs','\x20\x20Project:\x20','param','force','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','workflow:push','fs/promises','Starting\x20workflow\x20run...','Revision:\x20','logFiles','✔\x20Found\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Validation:\x20skipped','320698sRNamn','\x20session','select','limit','stat','round','status','length','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Listing\x20workflows...','3022632MPdWak','1870wSYoBU','From\x20task:\x20','workflow:attempt','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','...','params','Listing\x20workflow\x20attempts...','Retrying\x20attempt...','Fetching\x20log\x20files...','Start\x20a\x20workflow\x20run','\x20\x20Revision:\x20','data','\x20\x20Files\x20extracted:\x20','Params:\x20','projects','List\x20workflow\x20attempts','List\x20all\x20workflow\x20projects','workflow:run','createdAt','session','Parameters:\x20','attempt','canceling','yes','✔\x20Deleted\x20project\x20','indexOf','download','sessionTime','execute','finishedAt','Reason:\x20','No\x20log\x20content\x20found','Target:\x20','Filter:\x20','6960384PlrFEf','\x20is\x20not\x20a\x20directory','filesExtracted','workflow:logs','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Downloading\x20logs...','retryAttemptName','description','index','Force:\x20yes','Workflow:\x20','Pattern:\x20','Getting\x20attempt\x20tasks...','18AKGUNT','\x20task','Killing\x20attempt...','Including\x20subtasks:\x20yes','List\x20workflow\x20execution\x20sessions','Kill\x20a\x20running\x20attempt','verbose','Filter:\x20project=','✔\x20Pushed\x20','\x20workflow','Downloading\x20project\x20','\x20\x20Session\x20ID:\x20','Cancelled','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','attempt:','Show\x20tasks\x20for\x20an\x20attempt','attempts','workflow:kill','isArray','workflow:download','Usage:\x20workflow:delete\x20<project-name-or-id>','kill','taskName','projectName','Pushing\x20workflow\x20project...','✔\x20Retry\x20started','push','getTime','Task\x20name:\x20','14YCvFrJ','Project:\x20','task','5870XBFGqI','2SXwWKT','Error:\x20Invalid\x20parameter\x20format:\x20','workflow:attempts','startsWith','includeRetried','substring','Attempt\x20ID:\x20','Output\x20directory:\x20','sessionId','157900UwfcSX','name','logs','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','sessions','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','revision','message','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','project','retryAttempt','Deleting\x20project\x20','workflow:projects','cancelRequested','json','retrySession','map','workflow:sessions','\x20\x20Workflow:\x20','Include\x20retried:\x20yes','parse','\x20\x20New\x20attempt\x20ID:\x20','skipValidation','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'];a39_0x1e3f=function(){return _0x1f127a;};return a39_0x1e3f();}(function(_0x55893f,_0x15f270){const _0x44af56=a39_0x19fb,_0x19989a=_0x55893f();while(!![]){try{const _0x2ced2f=-parseInt(_0x44af56(0x1a4))/0x1*(-parseInt(_0x44af56(0x14f))/0x2)+-parseInt(_0x44af56(0x12e))/0x3*(parseInt(_0x44af56(0x158))/0x4)+-parseInt(_0x44af56(0x191))/0x5*(parseInt(_0x44af56(0x17a))/0x6)+parseInt(_0x44af56(0x14b))/0x7*(parseInt(_0x44af56(0x1ae))/0x8)+parseInt(_0x44af56(0x121))/0x9+parseInt(_0x44af56(0x14e))/0xa*(parseInt(_0x44af56(0x1af))/0xb)+parseInt(_0x44af56(0x197))/0xc*(-parseInt(_0x44af56(0x190))/0xd);if(_0x2ced2f===_0x15f270)break;else _0x19989a['push'](_0x19989a['shift']());}catch(_0x2e8032){_0x19989a['push'](_0x19989a['shift']());}}}(a39_0x1e3f,0xafc10));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';function a39_0x19fb(_0x2130b4,_0x2f832){const _0x1e3ff1=a39_0x1e3f();return a39_0x19fb=function(_0x19fb4d,_0x964387){_0x19fb4d=_0x19fb4d-0x106;let _0x28c373=_0x1e3ff1[_0x19fb4d];return _0x28c373;},a39_0x19fb(_0x2130b4,_0x2f832);}import a39_0x48f917 from'prompts';export class WorkflowProjectsCommand extends BaseCommand{['name']=a39_0x495444(0x164);[a39_0x495444(0x128)]=a39_0x495444(0x10f);async[a39_0x495444(0x11b)](_0x4334d3){const _0x2ae912=a39_0x495444,{options:_0xa627ae,args:_0x5df83e,tdx:_0x2a07b9}=_0x4334d3,_0x4f3b6e=_0x5df83e[0x0];try{_0xa627ae[_0x2ae912(0x134)]&&_0x4f3b6e&&console[_0x2ae912(0x187)](_0x2ae912(0x12c)+_0x4f3b6e);const _0xc4e210=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x2a07b9[_0x2ae912(0x194)][_0x2ae912(0x10d)](_0x4f3b6e,{'limit':_0xa627ae[_0x2ae912(0x1a7)]}),{'verbose':_0xa627ae[_0x2ae912(0x134)]}),_0x2cb39a=_0xc4e210[_0x2ae912(0x10a)];return console[_0x2ae912(0x187)](_0x2ae912(0x1a1)+_0x2cb39a['length']+'\x20project'+(_0x2cb39a['length']!==0x1?'s':'')),await handleSDKOutput(_0x2cb39a,_0xa627ae),0x0;}catch(_0x5a9846){if(_0x5a9846 instanceof SDKError)return console[_0x2ae912(0x187)](_0x2ae912(0x17c)+_0x5a9846[_0x2ae912(0x15f)]),_0x5a9846['cause']&&console[_0x2ae912(0x187)](_0x2ae912(0x18c)+_0x5a9846[_0x2ae912(0x172)]),0x1;throw _0x5a9846;}}}export class WorkflowWorkflowsCommand extends BaseCommand{['name']='workflow:workflows';[a39_0x495444(0x128)]=a39_0x495444(0x170);async[a39_0x495444(0x11b)](_0x570fb0){const _0x36eb8a=a39_0x495444,{options:_0x411b2f,args:_0x14be65,tdx:_0x21dd43}=_0x570fb0,_0x16e23e=_0x14be65[0x0];try{_0x411b2f[_0x36eb8a(0x134)]&&_0x16e23e&&console[_0x36eb8a(0x187)](_0x36eb8a(0x17b)+_0x16e23e);const _0x312c1a=await withSpinner(_0x36eb8a(0x1ad),()=>_0x21dd43['workflow']['workflows'](_0x16e23e,{'limit':_0x411b2f[_0x36eb8a(0x1a7)]}),{'verbose':_0x411b2f[_0x36eb8a(0x134)]}),_0x466f66=_0x312c1a[_0x36eb8a(0x10a)];return console[_0x36eb8a(0x187)](_0x36eb8a(0x1a1)+_0x466f66[_0x36eb8a(0x1ab)]+_0x36eb8a(0x137)+(_0x466f66[_0x36eb8a(0x1ab)]!==0x1?'s':'')),await handleSDKOutput(_0x466f66,_0x411b2f),0x0;}catch(_0x488026){if(_0x488026 instanceof SDKError)return console['error'](_0x36eb8a(0x17c)+_0x488026['message']),_0x488026['cause']&&console[_0x36eb8a(0x187)](_0x36eb8a(0x18c)+_0x488026[_0x36eb8a(0x172)]),0x1;throw _0x488026;}}}export class WorkflowSessionsCommand extends BaseCommand{['name']=a39_0x495444(0x169);[a39_0x495444(0x128)]=a39_0x495444(0x132);async['execute'](_0x3abce5){const _0x53cb17=a39_0x495444,{options:_0x4856e2,args:_0x224ddb,tdx:_0x48e1ce}=_0x3abce5;let _0xae9683,_0x16c0dd;if(_0x224ddb[0x0]){const _0x586a15=_0x224ddb[0x0]['split']('.');if(_0x586a15[_0x53cb17(0x1ab)]===0x1)_0xae9683=_0x586a15[0x0];else{if(_0x586a15['length']===0x2)[_0xae9683,_0x16c0dd]=_0x586a15;else return console[_0x53cb17(0x187)](_0x53cb17(0x19b)),0x1;}}try{if(_0x4856e2[_0x53cb17(0x134)]){if(_0xae9683&&_0x16c0dd)console[_0x53cb17(0x187)](_0x53cb17(0x120)+_0xae9683+'.'+_0x16c0dd);else _0xae9683&&console[_0x53cb17(0x187)](_0x53cb17(0x135)+_0xae9683);const _0x473008=_0x4856e2['status'];_0x473008&&console[_0x53cb17(0x187)](_0x53cb17(0x189)+_0x473008);}const _0x2ca966=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x48e1ce['workflow'][_0x53cb17(0x15c)]({'projectName':_0xae9683,'workflowName':_0x16c0dd,'status':_0x4856e2[_0x53cb17(0x1aa)],'fromTime':_0x4856e2[_0x53cb17(0x181)],'toTime':_0x4856e2['to'],'limit':_0x4856e2['limit']}),{'verbose':_0x4856e2['verbose']}),_0x20db0b=_0x2ca966[_0x53cb17(0x10a)];return console[_0x53cb17(0x187)](_0x53cb17(0x1a1)+_0x20db0b[_0x53cb17(0x1ab)]+_0x53cb17(0x1a5)+(_0x20db0b[_0x53cb17(0x1ab)]!==0x1?'s':'')),await handleSDKOutput(_0x20db0b,_0x4856e2),0x0;}catch(_0x514111){if(_0x514111 instanceof SDKError)return console[_0x53cb17(0x187)](_0x53cb17(0x17c)+_0x514111['message']),_0x514111['cause']&&console[_0x53cb17(0x187)](_0x53cb17(0x18c)+_0x514111[_0x53cb17(0x172)]),0x1;throw _0x514111;}}}export class WorkflowAttemptsCommand extends BaseCommand{['name']=a39_0x495444(0x151);['description']=a39_0x495444(0x10e);async[a39_0x495444(0x11b)](_0xaaa802){const _0x5a2fa1=a39_0x495444,{options:_0x3bc8be,args:_0x4d2d8c,tdx:_0xc9ee8}=_0xaaa802;let _0x2d58d0,_0x705b3e;if(_0x4d2d8c[0x0]){const _0x5e9322=_0x4d2d8c[0x0][_0x5a2fa1(0x193)]('.');if(_0x5e9322[_0x5a2fa1(0x1ab)]===0x1)_0x2d58d0=_0x5e9322[0x0];else{if(_0x5e9322['length']===0x2)[_0x2d58d0,_0x705b3e]=_0x5e9322;else return console['error'](_0x5a2fa1(0x19b)),0x1;}}try{const _0x39213=_0x3bc8be[_0x5a2fa1(0x153)];if(_0x3bc8be['verbose']){if(_0x2d58d0&&_0x705b3e)console[_0x5a2fa1(0x187)](_0x5a2fa1(0x120)+_0x2d58d0+'.'+_0x705b3e);else _0x2d58d0&&console[_0x5a2fa1(0x187)](_0x5a2fa1(0x135)+_0x2d58d0);_0x39213&&console['error'](_0x5a2fa1(0x16b));}const _0x3f86b9=await withSpinner(_0x5a2fa1(0x1b5),()=>_0xc9ee8[_0x5a2fa1(0x194)][_0x5a2fa1(0x13e)]({'projectName':_0x2d58d0,'workflowName':_0x705b3e,'includeRetried':_0x39213,'limit':_0x3bc8be[_0x5a2fa1(0x1a7)]}),{'verbose':_0x3bc8be[_0x5a2fa1(0x134)]}),_0xa9155=_0x3f86b9[_0x5a2fa1(0x10a)];return console[_0x5a2fa1(0x187)]('✔\x20Found\x20'+_0xa9155[_0x5a2fa1(0x1ab)]+_0x5a2fa1(0x192)+(_0xa9155[_0x5a2fa1(0x1ab)]!==0x1?'s':'')),await handleSDKOutput(_0xa9155,_0x3bc8be),0x0;}catch(_0x3e138e){if(_0x3e138e instanceof SDKError)return console[_0x5a2fa1(0x187)](_0x5a2fa1(0x17c)+_0x3e138e[_0x5a2fa1(0x15f)]),_0x3e138e[_0x5a2fa1(0x172)]&&console[_0x5a2fa1(0x187)](_0x5a2fa1(0x18c)+_0x3e138e[_0x5a2fa1(0x172)]),0x1;throw _0x3e138e;}}}export class WorkflowAttemptCommand extends BaseCommand{[a39_0x495444(0x159)]=a39_0x495444(0x1b1);[a39_0x495444(0x128)]=a39_0x495444(0x183);async[a39_0x495444(0x11b)](_0x247a79){const _0x3de7d4=a39_0x495444,{options:_0x42042d,args:_0x4b81c1,tdx:_0x51c19e}=_0x247a79,_0x3c9064=_0x4b81c1[0x0];if(!_0x3c9064)return console[_0x3de7d4(0x187)](_0x3de7d4(0x179)),0x1;try{_0x42042d[_0x3de7d4(0x134)]&&console[_0x3de7d4(0x187)]('Attempt\x20ID:\x20'+_0x3c9064);const _0x557778=await withSpinner('Getting\x20attempt\x20details...',()=>_0x51c19e['workflow'][_0x3de7d4(0x114)](_0x3c9064),{'verbose':_0x42042d[_0x3de7d4(0x134)]}),_0x4b6497=_0x557778['data'];let _0x30d747;!_0x4b6497[_0x3de7d4(0x171)]?_0x30d747=_0x4b6497[_0x3de7d4(0x165)]?_0x3de7d4(0x115):'running':_0x30d747=_0x4b6497[_0x3de7d4(0x186)]?_0x3de7d4(0x186):_0x3de7d4(0x187);let _0xeda6e6;if(_0x4b6497['createdAt']&&_0x4b6497['finishedAt']){const _0x4f15de=new Date(_0x4b6497[_0x3de7d4(0x111)])['getTime'](),_0x3eb38c=new Date(_0x4b6497[_0x3de7d4(0x11c)])[_0x3de7d4(0x149)]();_0xeda6e6=Math[_0x3de7d4(0x1a9)]((_0x3eb38c-_0x4f15de)/0x3e8);}const _0x2e5eff={'attempt_id':_0x4b6497['id'],'status':_0x30d747,..._0x4b6497[_0x3de7d4(0x129)]!==undefined&&{'index':_0x4b6497[_0x3de7d4(0x129)]},..._0x4b6497[_0x3de7d4(0x161)]&&{'project':_0x4b6497['project'][_0x3de7d4(0x159)]},..._0x4b6497[_0x3de7d4(0x194)]&&{'workflow':_0x4b6497[_0x3de7d4(0x194)][_0x3de7d4(0x159)]},..._0x4b6497['sessionId']&&{'session_id':_0x4b6497[_0x3de7d4(0x157)]},..._0x4b6497[_0x3de7d4(0x11a)]&&{'session_time':_0x4b6497[_0x3de7d4(0x11a)]},..._0x4b6497[_0x3de7d4(0x127)]&&{'retry_attempt':_0x4b6497[_0x3de7d4(0x127)]},..._0xeda6e6!==undefined&&{'duration_sec':_0xeda6e6},..._0x4b6497['createdAt']&&{'created_at':_0x4b6497['createdAt']},..._0x4b6497[_0x3de7d4(0x11c)]&&{'finished_at':_0x4b6497[_0x3de7d4(0x11c)]},...Object['keys'](_0x4b6497[_0x3de7d4(0x1b4)])[_0x3de7d4(0x1ab)]>0x0&&{'params':_0x4b6497[_0x3de7d4(0x1b4)]}};return await handleSingleObjectOutput(_0x2e5eff,_0x42042d),0x0;}catch(_0x30ef18){if(_0x30ef18 instanceof SDKError)return console[_0x3de7d4(0x187)]('Error:\x20'+_0x30ef18[_0x3de7d4(0x15f)]),_0x30ef18[_0x3de7d4(0x172)]&&console[_0x3de7d4(0x187)](_0x3de7d4(0x18c)+_0x30ef18[_0x3de7d4(0x172)]),0x1;throw _0x30ef18;}}}export class WorkflowTasksCommand extends BaseCommand{['name']='workflow:tasks';[a39_0x495444(0x128)]=a39_0x495444(0x13d);async[a39_0x495444(0x11b)](_0x373ca2){const _0x40091d=a39_0x495444,{options:_0x38a65c,args:_0x514865,tdx:_0x571867}=_0x373ca2,_0x25c613=_0x514865[0x0];if(!_0x25c613)return console['error'](_0x40091d(0x179)),0x1;try{const _0x313cd5=_0x38a65c[_0x40091d(0x18d)];_0x38a65c[_0x40091d(0x134)]&&(console[_0x40091d(0x187)](_0x40091d(0x155)+_0x25c613),_0x313cd5&&console['error'](_0x40091d(0x131)));const _0x3da60a=await withSpinner(_0x40091d(0x12d),()=>_0x571867[_0x40091d(0x194)][_0x40091d(0x18a)](_0x25c613,_0x313cd5||![]),{'verbose':_0x38a65c[_0x40091d(0x134)]}),_0x4660a6=_0x3da60a[_0x40091d(0x10a)];return console[_0x40091d(0x187)]('✔\x20Found\x20'+_0x4660a6[_0x40091d(0x1ab)]+_0x40091d(0x12f)+(_0x4660a6[_0x40091d(0x1ab)]!==0x1?'s':'')),await handleSDKOutput(_0x4660a6,_0x38a65c),0x0;}catch(_0x169586){if(_0x169586 instanceof SDKError)return console[_0x40091d(0x187)](_0x40091d(0x17c)+_0x169586['message']),_0x169586[_0x40091d(0x172)]&&console[_0x40091d(0x187)]('\x20\x20Cause:\x20'+_0x169586[_0x40091d(0x172)]),0x1;throw _0x169586;}}}export class WorkflowLogsCommand extends BaseCommand{[a39_0x495444(0x159)]=a39_0x495444(0x124);[a39_0x495444(0x128)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a39_0x495444(0x11b)](_0x536d79){const _0x1b1692=a39_0x495444,{options:_0x30d966,args:_0xa256ae,tdx:_0x4dcb5b}=_0x536d79,_0x5a620d=_0xa256ae[0x0];let _0x1d5405=_0xa256ae[0x1];if(!_0x5a620d)return console[_0x1b1692(0x187)](_0x1b1692(0x179)),0x1;try{_0x30d966[_0x1b1692(0x134)]&&(console[_0x1b1692(0x187)](_0x1b1692(0x155)+_0x5a620d),_0x1d5405&&console[_0x1b1692(0x187)](_0x1b1692(0x14a)+_0x1d5405));const _0x5605ec=await withSpinner(_0x1b1692(0x107),()=>_0x4dcb5b['workflow'][_0x1b1692(0x1a0)](_0x5a620d,_0x1d5405),{'verbose':_0x30d966[_0x1b1692(0x134)]}),_0x19e187=_0x5605ec['data'];if(_0x19e187[_0x1b1692(0x1ab)]===0x0)return console[_0x1b1692(0x187)](_0x1b1692(0x125)),0x0;if(!_0x1d5405&&(_0x30d966[_0x1b1692(0x166)]||_0x30d966[_0x1b1692(0x195)]))return await handleSDKOutput(_0x19e187,_0x30d966),0x0;if(!_0x1d5405){const _0x1d81c3=_0x19e187[_0x1b1692(0x168)](_0x2ca0c8=>({'title':_0x2ca0c8[_0x1b1692(0x144)]+'\x20('+formatBytes(_0x2ca0c8[_0x1b1692(0x180)])+')','value':_0x2ca0c8[_0x1b1692(0x144)]})),_0x369248=await a39_0x48f917({'type':_0x1b1692(0x1a6),'name':_0x1b1692(0x14d),'message':_0x1b1692(0x18f),'choices':_0x1d81c3});if(!_0x369248['task'])return console[_0x1b1692(0x187)](_0x1b1692(0x13a)),0x0;_0x1d5405=_0x369248[_0x1b1692(0x14d)];}const _0x3d3bef=await withSpinner(_0x1b1692(0x126),()=>_0x4dcb5b[_0x1b1692(0x194)][_0x1b1692(0x15a)](_0x5a620d,_0x1d5405),{'verbose':_0x30d966[_0x1b1692(0x134)]}),_0x3a34cc=_0x3d3bef[_0x1b1692(0x10a)];return _0x3a34cc?console['log'](_0x3a34cc):console['error'](_0x1b1692(0x11e)),0x0;}catch(_0x34220b){if(_0x34220b instanceof SDKError)return console[_0x1b1692(0x187)](_0x1b1692(0x17c)+_0x34220b['message']),_0x34220b[_0x1b1692(0x172)]&&console['error'](_0x1b1692(0x18c)+_0x34220b[_0x1b1692(0x172)]),0x1;throw _0x34220b;}}}export class WorkflowKillCommand extends BaseCommand{[a39_0x495444(0x159)]=a39_0x495444(0x13f);['description']=a39_0x495444(0x133);async[a39_0x495444(0x11b)](_0x5efa1e){const _0x532bc7=a39_0x495444,{options:_0xb956fc,args:_0x350b50,tdx:_0x2f457e}=_0x5efa1e,_0x4814c9=_0x350b50[0x0];if(!_0x4814c9)return console[_0x532bc7(0x187)](_0x532bc7(0x179)),0x1;try{const _0x196a7a=_0xb956fc['reason'];_0xb956fc['verbose']&&(console[_0x532bc7(0x187)](_0x532bc7(0x155)+_0x4814c9),_0x196a7a&&console[_0x532bc7(0x187)](_0x532bc7(0x11d)+_0x196a7a));if(!_0xb956fc[_0x532bc7(0x116)]){const _0x26e06c=await confirm(_0x532bc7(0x173)+_0x4814c9+'?');if(!_0x26e06c)return console['error']('Cancelled'),0x0;}const _0xd59c0c=await withSpinner(_0x532bc7(0x130),()=>_0x2f457e['workflow'][_0x532bc7(0x143)](_0x4814c9,_0x196a7a),{'verbose':_0xb956fc['verbose']}),_0x115b28=_0xd59c0c[_0x532bc7(0x10a)];return console[_0x532bc7(0x187)]('✔\x20'+_0x115b28),0x0;}catch(_0x3b7b2b){if(_0x3b7b2b instanceof SDKError)return console[_0x532bc7(0x187)](_0x532bc7(0x17c)+_0x3b7b2b[_0x532bc7(0x15f)]),_0x3b7b2b[_0x532bc7(0x172)]&&console[_0x532bc7(0x187)]('\x20\x20Cause:\x20'+_0x3b7b2b[_0x532bc7(0x172)]),0x1;throw _0x3b7b2b;}}}export class WorkflowRetryCommand extends BaseCommand{[a39_0x495444(0x159)]=a39_0x495444(0x178);[a39_0x495444(0x128)]=a39_0x495444(0x176);async[a39_0x495444(0x11b)](_0x1e8ca4){const _0x38d13b=a39_0x495444,{options:_0x17c2c0,args:_0x331d2d,tdx:_0x5de683}=_0x1e8ca4,_0x2f03bf=_0x331d2d[0x0];if(!_0x2f03bf)return console[_0x38d13b(0x187)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x38d13b(0x187)](_0x38d13b(0x1a2)),0x1;let _0x33f8ae=![],_0x2b250c=_0x2f03bf;if(_0x2f03bf['startsWith'](_0x38d13b(0x17f)))_0x33f8ae=!![],_0x2b250c=_0x2f03bf[_0x38d13b(0x154)](0x8);else{if(_0x2f03bf[_0x38d13b(0x152)](_0x38d13b(0x13c)))_0x33f8ae=![],_0x2b250c=_0x2f03bf[_0x38d13b(0x154)](0x8);else return console[_0x38d13b(0x187)](_0x38d13b(0x182)),console['error'](_0x38d13b(0x1a2)),0x1;}try{const _0x140ea2=_0x17c2c0['fromTask'],_0x226090=_0x17c2c0['resumeFrom'],_0x22267e=_0x17c2c0[_0x38d13b(0x1b4)],_0xf37dac=_0x17c2c0[_0x38d13b(0x19a)];_0x17c2c0['verbose']&&(console['error'](_0x38d13b(0x11f)+(_0x33f8ae?_0x38d13b(0x112):_0x38d13b(0x114))+'\x20'+_0x2b250c),_0x140ea2&&console[_0x38d13b(0x187)](_0x38d13b(0x1b0)+_0x140ea2),_0x226090&&console[_0x38d13b(0x187)](_0x38d13b(0x177)+_0x226090),_0x22267e&&console[_0x38d13b(0x187)](_0x38d13b(0x10c)+_0x22267e),_0xf37dac&&console[_0x38d13b(0x187)](_0x38d13b(0x12a)));let _0x178731;if(_0x22267e)try{if(_0x22267e[_0x38d13b(0x152)]('@')){const _0x4eaa13=await import(_0x38d13b(0x19d)),_0x28e8c1=_0x22267e['substring'](0x1),_0x3c3fc6=await _0x4eaa13['readFile'](_0x28e8c1,'utf-8');_0x178731=JSON[_0x38d13b(0x16c)](_0x3c3fc6);}else _0x178731=JSON[_0x38d13b(0x16c)](_0x22267e);}catch{return console[_0x38d13b(0x187)](_0x38d13b(0x18b)),0x1;}if(!_0x17c2c0[_0x38d13b(0x116)]){const _0x4ef34c=await confirm(_0x38d13b(0x160)+(_0x33f8ae?_0x38d13b(0x112):_0x38d13b(0x114))+'\x20'+_0x2b250c+'?');if(!_0x4ef34c)return console[_0x38d13b(0x187)](_0x38d13b(0x13a)),0x0;}let _0x51fda8;_0x33f8ae?_0x51fda8=await withSpinner('Retrying\x20session...',()=>_0x5de683[_0x38d13b(0x194)][_0x38d13b(0x167)](_0x2b250c,{'fromTask':_0x140ea2,'retryParams':_0x178731}),{'verbose':_0x17c2c0[_0x38d13b(0x134)]}):_0x51fda8=await withSpinner(_0x38d13b(0x106),()=>_0x5de683['workflow'][_0x38d13b(0x162)](_0x2b250c,{'resumeFrom':_0x226090,'retryParams':_0x178731,'force':_0xf37dac}),{'verbose':_0x17c2c0[_0x38d13b(0x134)]});const _0x126a3e=_0x51fda8[_0x38d13b(0x10a)];return console['error'](_0x38d13b(0x147)),console['error'](_0x38d13b(0x16d)+_0x126a3e[_0x38d13b(0x196)]),console[_0x38d13b(0x187)](_0x38d13b(0x139)+_0x126a3e[_0x38d13b(0x157)]),0x0;}catch(_0x39f6af){if(_0x39f6af instanceof SDKError)return console[_0x38d13b(0x187)](_0x38d13b(0x17c)+_0x39f6af[_0x38d13b(0x15f)]),_0x39f6af[_0x38d13b(0x172)]&&console[_0x38d13b(0x187)]('\x20\x20Cause:\x20'+_0x39f6af[_0x38d13b(0x172)]),0x1;throw _0x39f6af;}}}export class WorkflowRunCommand extends BaseCommand{['name']=a39_0x495444(0x110);[a39_0x495444(0x128)]=a39_0x495444(0x108);async[a39_0x495444(0x11b)](_0x5a5072){const _0x1d8ac0=a39_0x495444,{options:_0x3b1d14,args:_0x3c4dc2,tdx:_0x47b09e}=_0x5a5072,_0x26bcc8=_0x3c4dc2[0x0];if(!_0x26bcc8)return console[_0x1d8ac0(0x187)]('Error:\x20Workflow\x20identifier\x20is\x20required'),console[_0x1d8ac0(0x187)]('Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]'),0x1;const _0x302e80=_0x3b1d14[_0x1d8ac0(0x199)],_0xf9f836=_0x3b1d14['sessionTime'],_0x4ce36e={};if(_0x302e80&&Array[_0x1d8ac0(0x140)](_0x302e80))for(const _0xdaeac3 of _0x302e80){const _0xd3fc1=_0xdaeac3[_0x1d8ac0(0x118)]('=');if(_0xd3fc1===-0x1)return console[_0x1d8ac0(0x187)](_0x1d8ac0(0x150)+_0xdaeac3),console[_0x1d8ac0(0x187)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x64d7b1=_0xdaeac3[_0x1d8ac0(0x154)](0x0,_0xd3fc1),_0x553dc8=_0xdaeac3[_0x1d8ac0(0x154)](_0xd3fc1+0x1);try{_0x4ce36e[_0x64d7b1]=JSON[_0x1d8ac0(0x16c)](_0x553dc8);}catch{_0x4ce36e[_0x64d7b1]=_0x553dc8;}}_0x3b1d14[_0x1d8ac0(0x134)]&&(console['error'](_0x1d8ac0(0x12b)+_0x26bcc8),Object[_0x1d8ac0(0x188)](_0x4ce36e)[_0x1d8ac0(0x1ab)]>0x0&&console[_0x1d8ac0(0x187)](_0x1d8ac0(0x113)+JSON['stringify'](_0x4ce36e)),_0xf9f836&&console[_0x1d8ac0(0x187)]('Session\x20time:\x20'+_0xf9f836));const _0x2a12b3=await withSpinner(_0x1d8ac0(0x19e),()=>_0x47b09e[_0x1d8ac0(0x194)]['run'](_0x26bcc8,_0x4ce36e,{'sessionTime':_0xf9f836}),{'verbose':_0x3b1d14['verbose']}),_0x20a187=_0x2a12b3['data'];return console[_0x1d8ac0(0x187)]('✔\x20Workflow\x20run\x20started'),console[_0x1d8ac0(0x187)](_0x1d8ac0(0x17d)+_0x20a187['id']),console[_0x1d8ac0(0x187)](_0x1d8ac0(0x139)+_0x20a187[_0x1d8ac0(0x157)]),console['error'](_0x1d8ac0(0x198)+_0x20a187[_0x1d8ac0(0x161)]?.['name']),console[_0x1d8ac0(0x187)](_0x1d8ac0(0x16a)+_0x20a187['workflow']?.[_0x1d8ac0(0x159)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a39_0x495444(0x159)]=a39_0x495444(0x141);[a39_0x495444(0x128)]=a39_0x495444(0x1b2);async[a39_0x495444(0x11b)](_0x318beb){const _0x5aa383=a39_0x495444,{options:_0x430ec9,args:_0x1408de,tdx:_0x59dda5}=_0x318beb,_0x399201=_0x1408de[0x0],_0x58192d=_0x1408de[0x1]||'.';if(!_0x399201)return console[_0x5aa383(0x187)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x5aa383(0x187)](_0x5aa383(0x16f)),0x1;const _0x495592=_0x430ec9[_0x5aa383(0x15e)];_0x430ec9[_0x5aa383(0x134)]&&(console[_0x5aa383(0x187)](_0x5aa383(0x14c)+_0x399201),console['error'](_0x5aa383(0x156)+_0x58192d),_0x495592&&console[_0x5aa383(0x187)](_0x5aa383(0x19f)+_0x495592));const _0xa6dfde=await withSpinner(_0x5aa383(0x138)+_0x399201+_0x5aa383(0x1b3),()=>_0x59dda5[_0x5aa383(0x194)][_0x5aa383(0x119)](_0x399201,_0x58192d,{'revision':_0x495592}),{'verbose':_0x430ec9[_0x5aa383(0x134)]}),_0x5d94b9=_0xa6dfde['data'];return console[_0x5aa383(0x187)]('✔\x20Downloaded\x20'+_0x5d94b9[_0x5aa383(0x145)]),console[_0x5aa383(0x187)](_0x5aa383(0x109)+_0x5d94b9[_0x5aa383(0x15e)]),console[_0x5aa383(0x187)](_0x5aa383(0x10b)+_0x5d94b9[_0x5aa383(0x123)]),console[_0x5aa383(0x187)](_0x5aa383(0x17e)+_0x58192d+'/'+_0x5d94b9[_0x5aa383(0x145)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a39_0x495444(0x159)]=a39_0x495444(0x19c);[a39_0x495444(0x128)]=a39_0x495444(0x15b);async['execute'](_0x296c5f){const _0x304fdc=a39_0x495444,{options:_0x2b23f5,args:_0x259217,tdx:_0x5774ac}=_0x296c5f;let _0xa1ed3f='.',_0x544498=_0x2b23f5[_0x304fdc(0x159)];if(_0x259217[0x0]){const {promises:_0x1814b9}=await import('fs');try{const _0x8f6c3d=await _0x1814b9[_0x304fdc(0x1a8)](_0x259217[0x0]);if(_0x8f6c3d[_0x304fdc(0x175)]())_0xa1ed3f=_0x259217[0x0];else return console[_0x304fdc(0x187)]('Error:\x20'+_0x259217[0x0]+_0x304fdc(0x122)),0x1;}catch{_0x544498=_0x259217[0x0],_0xa1ed3f='.';}}const _0x44dfaa=_0x2b23f5[_0x304fdc(0x15e)],_0x3b34fd=_0x2b23f5[_0x304fdc(0x16e)];_0x2b23f5[_0x304fdc(0x134)]&&(console[_0x304fdc(0x187)](_0x304fdc(0x18e)+_0xa1ed3f),_0x544498&&console[_0x304fdc(0x187)]('Project\x20name:\x20'+_0x544498),_0x44dfaa&&console[_0x304fdc(0x187)](_0x304fdc(0x19f)+_0x44dfaa),_0x3b34fd&&console[_0x304fdc(0x187)](_0x304fdc(0x1a3)));const _0x237171=await withSpinner(_0x304fdc(0x146),()=>_0x5774ac['workflow'][_0x304fdc(0x148)](_0xa1ed3f,{'projectName':_0x544498,'revision':_0x44dfaa,'skipValidation':_0x3b34fd}),{'verbose':_0x2b23f5[_0x304fdc(0x134)]}),_0x501725=_0x237171[_0x304fdc(0x10a)];return console['error'](_0x304fdc(0x136)+_0x501725[_0x304fdc(0x145)]),console[_0x304fdc(0x187)](_0x304fdc(0x184)+_0x501725['projectId']),console[_0x304fdc(0x187)]('\x20\x20Revision:\x20'+_0x501725[_0x304fdc(0x15e)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a39_0x495444(0x159)]='workflow:delete';['description']=a39_0x495444(0x13b);async[a39_0x495444(0x11b)](_0x13c274){const _0x387f47=a39_0x495444,{options:_0x2b8cc2,args:_0x146990,tdx:_0x53aba9}=_0x13c274,_0x7f33dc=_0x146990[0x0];if(!_0x7f33dc)return console[_0x387f47(0x187)](_0x387f47(0x15d)),console[_0x387f47(0x187)](_0x387f47(0x142)),0x1;_0x2b8cc2[_0x387f47(0x134)]&&console[_0x387f47(0x187)](_0x387f47(0x14c)+_0x7f33dc);if(!_0x2b8cc2[_0x387f47(0x116)]){const _0x3ff1ec=await confirm(_0x387f47(0x1ac)+_0x7f33dc+_0x387f47(0x185));if(!_0x3ff1ec)return console['error'](_0x387f47(0x13a)),0x0;}const _0x4c3d4b=await withSpinner(_0x387f47(0x163)+_0x7f33dc+_0x387f47(0x1b3),()=>_0x53aba9[_0x387f47(0x194)][_0x387f47(0x174)](_0x7f33dc),{'verbose':_0x2b8cc2['verbose']}),_0x395671=_0x4c3d4b[_0x387f47(0x10a)];return console['error'](_0x387f47(0x117)+_0x395671[_0x387f47(0x145)]),console[_0x387f47(0x187)](_0x387f47(0x184)+_0x395671['projectId']),0x0;}}
|
|
1
|
+
const a39_0x45ce2a=a39_0x98fb;(function(_0x1af532,_0xb7412b){const _0x54a122=a39_0x98fb,_0x1b093c=_0x1af532();while(!![]){try{const _0x446acd=parseInt(_0x54a122(0x12a))/0x1+parseInt(_0x54a122(0x1a2))/0x2+-parseInt(_0x54a122(0x16a))/0x3*(-parseInt(_0x54a122(0x1a1))/0x4)+-parseInt(_0x54a122(0x19e))/0x5*(parseInt(_0x54a122(0x109))/0x6)+parseInt(_0x54a122(0x125))/0x7*(parseInt(_0x54a122(0x16e))/0x8)+parseInt(_0x54a122(0x115))/0x9*(-parseInt(_0x54a122(0x19a))/0xa)+-parseInt(_0x54a122(0x102))/0xb;if(_0x446acd===_0xb7412b)break;else _0x1b093c['push'](_0x1b093c['shift']());}catch(_0x1540e7){_0x1b093c['push'](_0x1b093c['shift']());}}}(a39_0x4d22,0x9ed85));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 a39_0xd55755 from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a39_0x45ce2a(0x100)]=a39_0x45ce2a(0x12b);['description']=a39_0x45ce2a(0x17d);async[a39_0x45ce2a(0x10d)](_0x59ff6e){const _0x218bf9=a39_0x45ce2a,{options:_0x34f558,args:_0x8e3b4e,tdx:_0xee7d0a}=_0x59ff6e,_0x8c6655=_0x8e3b4e[0x0];try{_0x34f558[_0x218bf9(0x13d)]&&_0x8c6655&&console[_0x218bf9(0x144)](_0x218bf9(0x190)+_0x8c6655);const _0x3b6a5c=await withSpinner(_0x218bf9(0x189),()=>_0xee7d0a[_0x218bf9(0x106)]['projects'](_0x8c6655,{'limit':_0x34f558[_0x218bf9(0x10c)]}),{'verbose':_0x34f558['verbose']}),_0x545e56=_0x3b6a5c[_0x218bf9(0x17c)];return console['error']('✔\x20Found\x20'+_0x545e56[_0x218bf9(0x181)]+_0x218bf9(0x18c)+(_0x545e56[_0x218bf9(0x181)]!==0x1?'s':'')),await handleSDKOutput(_0x545e56,_0x34f558),0x0;}catch(_0x321c36){if(_0x321c36 instanceof SDKError)return console[_0x218bf9(0x144)](_0x218bf9(0x10a)+_0x321c36[_0x218bf9(0x122)]),_0x321c36[_0x218bf9(0x117)]&&console['error'](_0x218bf9(0x120)+_0x321c36[_0x218bf9(0x117)]),0x1;throw _0x321c36;}}}export class WorkflowWorkflowsCommand extends BaseCommand{['name']=a39_0x45ce2a(0x18a);['description']=a39_0x45ce2a(0x14d);async[a39_0x45ce2a(0x10d)](_0x208806){const _0x323796=a39_0x45ce2a,{options:_0x2a0c5e,args:_0x17d2bd,tdx:_0x22e33f}=_0x208806,_0x5735f1=_0x17d2bd[0x0];try{_0x2a0c5e['verbose']&&_0x5735f1&&console[_0x323796(0x144)](_0x323796(0x14c)+_0x5735f1);const _0x20bfab=await withSpinner('Listing\x20workflows...',()=>_0x22e33f[_0x323796(0x106)][_0x323796(0x194)](_0x5735f1,{'limit':_0x2a0c5e[_0x323796(0x10c)]}),{'verbose':_0x2a0c5e[_0x323796(0x13d)]}),_0xc77606=_0x20bfab[_0x323796(0x17c)];return console[_0x323796(0x144)](_0x323796(0x128)+_0xc77606['length']+_0x323796(0x107)+(_0xc77606[_0x323796(0x181)]!==0x1?'s':'')),await handleSDKOutput(_0xc77606,_0x2a0c5e),0x0;}catch(_0x3ba44a){if(_0x3ba44a instanceof SDKError)return console[_0x323796(0x144)](_0x323796(0x10a)+_0x3ba44a['message']),_0x3ba44a[_0x323796(0x117)]&&console[_0x323796(0x144)](_0x323796(0x120)+_0x3ba44a[_0x323796(0x117)]),0x1;throw _0x3ba44a;}}}export class WorkflowSessionsCommand extends BaseCommand{[a39_0x45ce2a(0x100)]=a39_0x45ce2a(0x112);[a39_0x45ce2a(0x137)]=a39_0x45ce2a(0x10f);async[a39_0x45ce2a(0x10d)](_0x2e64ec){const _0x365792=a39_0x45ce2a,{options:_0x2ec956,args:_0xd220ab,tdx:_0x4f55f8}=_0x2e64ec;let _0x248e41,_0x373f63;if(_0xd220ab[0x0]){const _0x109afa=_0xd220ab[0x0][_0x365792(0x14b)]('.');if(_0x109afa['length']===0x1)_0x248e41=_0x109afa[0x0];else{if(_0x109afa[_0x365792(0x181)]===0x2)[_0x248e41,_0x373f63]=_0x109afa;else return console[_0x365792(0x144)](_0x365792(0x152)),0x1;}}try{if(_0x2ec956[_0x365792(0x13d)]){if(_0x248e41&&_0x373f63)console[_0x365792(0x144)](_0x365792(0x155)+_0x248e41+'.'+_0x373f63);else _0x248e41&&console[_0x365792(0x144)](_0x365792(0x150)+_0x248e41);const _0x2f4ce5=_0x2ec956[_0x365792(0x14a)];_0x2f4ce5&&console[_0x365792(0x144)](_0x365792(0x134)+_0x2f4ce5);}const _0x59d68f=await withSpinner(_0x365792(0x103),()=>_0x4f55f8['workflow']['sessions']({'projectName':_0x248e41,'workflowName':_0x373f63,'status':_0x2ec956[_0x365792(0x14a)],'fromTime':_0x2ec956[_0x365792(0x158)],'toTime':_0x2ec956['to'],'limit':_0x2ec956[_0x365792(0x10c)]}),{'verbose':_0x2ec956[_0x365792(0x13d)]}),_0x4edd0c=_0x59d68f[_0x365792(0x17c)];return console[_0x365792(0x144)]('✔\x20Found\x20'+_0x4edd0c[_0x365792(0x181)]+_0x365792(0x124)+(_0x4edd0c[_0x365792(0x181)]!==0x1?'s':'')),await handleSDKOutput(_0x4edd0c,_0x2ec956),0x0;}catch(_0x2953fc){if(_0x2953fc instanceof SDKError)return console[_0x365792(0x144)](_0x365792(0x10a)+_0x2953fc['message']),_0x2953fc[_0x365792(0x117)]&&console[_0x365792(0x144)](_0x365792(0x120)+_0x2953fc[_0x365792(0x117)]),0x1;throw _0x2953fc;}}}function a39_0x4d22(){const _0xaeda09=['Error:\x20','session:','limit','execute','substring','List\x20workflow\x20execution\x20sessions','attempt','json','workflow:sessions','map','logs','3311631WZsyKi','Select\x20a\x20task\x20to\x20view\x20logs:','cause','workflow:attempt','Killing\x20attempt...','\x20\x20Workflow:\x20','Project:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Include\x20retried:\x20yes','Revision:\x20','createdAt','\x20\x20Cause:\x20','attempt:','message','workflow:kill','\x20session','40943MhYiLo','Getting\x20attempt\x20details...','sessionTime','✔\x20Found\x20','download','755570mcIpxp','workflow:projects','Kill\x20a\x20running\x20attempt','startsWith','Resume\x20from:\x20','projectId','includeRetried','select','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','run','Status:\x20','Deleting\x20project\x20','✔\x20Downloaded\x20','description','Cancelled','Attempt\x20ID:\x20','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','Fetching\x20log\x20files...','Target:\x20','verbose','session','isArray','Session\x20time:\x20','utf-8','workflow:retry','readFile','error','delete','tasks','Listing\x20workflow\x20attempts...','fromTask','running','status','split','Project\x20filter:\x20','List\x20workflows','Parameters:\x20','✔\x20Retry\x20started','Filter:\x20project=','Task\x20name:\x20','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Retry\x20a\x20session\x20or\x20attempt','\x20task','Filter:\x20','List\x20workflow\x20attempts','retryAttempt','from','indexOf','Error:\x20Invalid\x20parameter\x20format:\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','projectName','No\x20log\x20content\x20found','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Output\x20directory:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','Show\x20tasks\x20for\x20an\x20attempt','stat','filesExtracted','round','✔\x20Workflow\x20run\x20started','attempts','project','Project\x20directory:\x20','workflow:run','12iGodrI','retrySession','taskName','workflow:delete','1688PnJDgV','success','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','logFiles','\x20\x20Revision:\x20','keys','\x20\x20Project\x20ID:\x20','Start\x20a\x20workflow\x20run','Validation:\x20skipped','Retrying\x20session...','Retrying\x20attempt...','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','Reason:\x20','\x20\x20New\x20attempt\x20ID:\x20','data','List\x20all\x20workflow\x20projects','Show\x20specific\x20attempt\x20details','Including\x20subtasks:\x20yes','params','length','yes','From\x20task:\x20','force','cancelRequested','param','revision','task','Listing\x20workflow\x20projects...','workflow:workflows','kill','\x20project','done','push','index','Pattern:\x20','Error:\x20Workflow\x20identifier\x20is\x20required','\x20is\x20not\x20a\x20directory','No\x20log\x20files\x20found\x20for\x20this\x20attempt','workflows','workflow:push','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','...','\x20attempt','30FrpTMo','format','stringify','Getting\x20attempt\x20tasks...','46685FozRhu','finishedAt','sessionId','503176FYknzM','2195288FQtwxU','Error:\x20Project\x20name\x20is\x20required','parse','reason','✔\x20Deleted\x20project\x20','retryAttemptName','Error:\x20Attempt\x20ID\x20is\x20required','\x20\x20Session\x20ID:\x20','name','attemptId','11671572FluBKC','Listing\x20workflow\x20sessions...','Downloading\x20project\x20','Expected\x20format:\x20--param\x20key=value','workflow','\x20workflow','workflow:logs','498GBOwAp'];a39_0x4d22=function(){return _0xaeda09;};return a39_0x4d22();}export class WorkflowAttemptsCommand extends BaseCommand{['name']='workflow:attempts';[a39_0x45ce2a(0x137)]=a39_0x45ce2a(0x156);async['execute'](_0x1693ec){const _0x11ba31=a39_0x45ce2a,{options:_0x48f1f8,args:_0x3b3c88,tdx:_0x5e241c}=_0x1693ec;let _0x3255e4,_0x3b6b36;if(_0x3b3c88[0x0]){const _0x289673=_0x3b3c88[0x0][_0x11ba31(0x14b)]('.');if(_0x289673['length']===0x1)_0x3255e4=_0x289673[0x0];else{if(_0x289673[_0x11ba31(0x181)]===0x2)[_0x3255e4,_0x3b6b36]=_0x289673;else return console[_0x11ba31(0x144)](_0x11ba31(0x152)),0x1;}}try{const _0x21b27a=_0x48f1f8[_0x11ba31(0x130)];if(_0x48f1f8[_0x11ba31(0x13d)]){if(_0x3255e4&&_0x3b6b36)console[_0x11ba31(0x144)]('Filter:\x20'+_0x3255e4+'.'+_0x3b6b36);else _0x3255e4&&console[_0x11ba31(0x144)](_0x11ba31(0x150)+_0x3255e4);_0x21b27a&&console[_0x11ba31(0x144)](_0x11ba31(0x11d));}const _0x490cdb=await withSpinner(_0x11ba31(0x147),()=>_0x5e241c[_0x11ba31(0x106)][_0x11ba31(0x166)]({'projectName':_0x3255e4,'workflowName':_0x3b6b36,'includeRetried':_0x21b27a,'limit':_0x48f1f8[_0x11ba31(0x10c)]}),{'verbose':_0x48f1f8[_0x11ba31(0x13d)]}),_0x542956=_0x490cdb[_0x11ba31(0x17c)];return console[_0x11ba31(0x144)](_0x11ba31(0x128)+_0x542956[_0x11ba31(0x181)]+_0x11ba31(0x199)+(_0x542956[_0x11ba31(0x181)]!==0x1?'s':'')),await handleSDKOutput(_0x542956,_0x48f1f8),0x0;}catch(_0xdaca94){if(_0xdaca94 instanceof SDKError)return console[_0x11ba31(0x144)]('Error:\x20'+_0xdaca94[_0x11ba31(0x122)]),_0xdaca94[_0x11ba31(0x117)]&&console[_0x11ba31(0x144)](_0x11ba31(0x120)+_0xdaca94[_0x11ba31(0x117)]),0x1;throw _0xdaca94;}}}export class WorkflowAttemptCommand extends BaseCommand{[a39_0x45ce2a(0x100)]=a39_0x45ce2a(0x118);[a39_0x45ce2a(0x137)]=a39_0x45ce2a(0x17e);async[a39_0x45ce2a(0x10d)](_0x58c6db){const _0x79e973=a39_0x45ce2a,{options:_0x3eafef,args:_0x5310d2,tdx:_0x5da6c5}=_0x58c6db,_0x1bddcc=_0x5310d2[0x0];if(!_0x1bddcc)return console[_0x79e973(0x144)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{_0x3eafef['verbose']&&console[_0x79e973(0x144)](_0x79e973(0x139)+_0x1bddcc);const _0x97bbc9=await withSpinner(_0x79e973(0x126),()=>_0x5da6c5[_0x79e973(0x106)][_0x79e973(0x110)](_0x1bddcc),{'verbose':_0x3eafef['verbose']}),_0x3559e5=_0x97bbc9[_0x79e973(0x17c)];let _0x1ecb9f;!_0x3559e5[_0x79e973(0x18d)]?_0x1ecb9f=_0x3559e5[_0x79e973(0x185)]?'canceling':_0x79e973(0x149):_0x1ecb9f=_0x3559e5[_0x79e973(0x16f)]?_0x79e973(0x16f):_0x79e973(0x144);let _0x2d7c4a;if(_0x3559e5[_0x79e973(0x11f)]&&_0x3559e5[_0x79e973(0x19f)]){const _0x5e82bb=new Date(_0x3559e5[_0x79e973(0x11f)])['getTime'](),_0x1d115f=new Date(_0x3559e5[_0x79e973(0x19f)])['getTime']();_0x2d7c4a=Math[_0x79e973(0x164)]((_0x1d115f-_0x5e82bb)/0x3e8);}const _0x42f98e={'attempt_id':_0x3559e5['id'],'status':_0x1ecb9f,..._0x3559e5[_0x79e973(0x18f)]!==undefined&&{'index':_0x3559e5[_0x79e973(0x18f)]},..._0x3559e5['project']&&{'project':_0x3559e5[_0x79e973(0x167)][_0x79e973(0x100)]},..._0x3559e5[_0x79e973(0x106)]&&{'workflow':_0x3559e5[_0x79e973(0x106)][_0x79e973(0x100)]},..._0x3559e5[_0x79e973(0x1a0)]&&{'session_id':_0x3559e5[_0x79e973(0x1a0)]},..._0x3559e5[_0x79e973(0x127)]&&{'session_time':_0x3559e5['sessionTime']},..._0x3559e5[_0x79e973(0xfd)]&&{'retry_attempt':_0x3559e5[_0x79e973(0xfd)]},..._0x2d7c4a!==undefined&&{'duration_sec':_0x2d7c4a},..._0x3559e5[_0x79e973(0x11f)]&&{'created_at':_0x3559e5[_0x79e973(0x11f)]},..._0x3559e5[_0x79e973(0x19f)]&&{'finished_at':_0x3559e5[_0x79e973(0x19f)]},...Object[_0x79e973(0x173)](_0x3559e5[_0x79e973(0x180)])[_0x79e973(0x181)]>0x0&&{'params':_0x3559e5[_0x79e973(0x180)]}};return await handleSingleObjectOutput(_0x42f98e,_0x3eafef),0x0;}catch(_0x595ece){if(_0x595ece instanceof SDKError)return console[_0x79e973(0x144)](_0x79e973(0x10a)+_0x595ece[_0x79e973(0x122)]),_0x595ece[_0x79e973(0x117)]&&console[_0x79e973(0x144)](_0x79e973(0x120)+_0x595ece[_0x79e973(0x117)]),0x1;throw _0x595ece;}}}export class WorkflowTasksCommand extends BaseCommand{[a39_0x45ce2a(0x100)]='workflow:tasks';[a39_0x45ce2a(0x137)]=a39_0x45ce2a(0x161);async[a39_0x45ce2a(0x10d)](_0x1fcf68){const _0x301c52=a39_0x45ce2a,{options:_0x44ee02,args:_0x4fec7e,tdx:_0x313b0d}=_0x1fcf68,_0x21433a=_0x4fec7e[0x0];if(!_0x21433a)return console[_0x301c52(0x144)](_0x301c52(0xfe)),0x1;try{const _0x58a69c=_0x44ee02['includeSubtasks'];_0x44ee02[_0x301c52(0x13d)]&&(console['error'](_0x301c52(0x139)+_0x21433a),_0x58a69c&&console[_0x301c52(0x144)](_0x301c52(0x17f)));const _0x5ee804=await withSpinner(_0x301c52(0x19d),()=>_0x313b0d[_0x301c52(0x106)][_0x301c52(0x146)](_0x21433a,_0x58a69c||![]),{'verbose':_0x44ee02[_0x301c52(0x13d)]}),_0x41af19=_0x5ee804[_0x301c52(0x17c)];return console[_0x301c52(0x144)](_0x301c52(0x128)+_0x41af19[_0x301c52(0x181)]+_0x301c52(0x154)+(_0x41af19[_0x301c52(0x181)]!==0x1?'s':'')),await handleSDKOutput(_0x41af19,_0x44ee02),0x0;}catch(_0xa1ed8f){if(_0xa1ed8f instanceof SDKError)return console['error']('Error:\x20'+_0xa1ed8f[_0x301c52(0x122)]),_0xa1ed8f[_0x301c52(0x117)]&&console[_0x301c52(0x144)](_0x301c52(0x120)+_0xa1ed8f['cause']),0x1;throw _0xa1ed8f;}}}export class WorkflowLogsCommand extends BaseCommand{[a39_0x45ce2a(0x100)]=a39_0x45ce2a(0x108);[a39_0x45ce2a(0x137)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async['execute'](_0x2f2680){const _0x3a9fee=a39_0x45ce2a,{options:_0x379084,args:_0x378729,tdx:_0x4f2e61}=_0x2f2680,_0x16849f=_0x378729[0x0];let _0x1c3936=_0x378729[0x1];if(!_0x16849f)return console['error'](_0x3a9fee(0xfe)),0x1;try{_0x379084[_0x3a9fee(0x13d)]&&(console[_0x3a9fee(0x144)](_0x3a9fee(0x139)+_0x16849f),_0x1c3936&&console['error'](_0x3a9fee(0x151)+_0x1c3936));const _0x179bde=await withSpinner(_0x3a9fee(0x13b),()=>_0x4f2e61[_0x3a9fee(0x106)][_0x3a9fee(0x171)](_0x16849f,_0x1c3936),{'verbose':_0x379084[_0x3a9fee(0x13d)]}),_0x4b40f9=_0x179bde[_0x3a9fee(0x17c)];if(_0x4b40f9[_0x3a9fee(0x181)]===0x0)return console[_0x3a9fee(0x144)](_0x3a9fee(0x193)),0x0;if(!_0x1c3936&&(_0x379084[_0x3a9fee(0x111)]||_0x379084[_0x3a9fee(0x19b)]))return await handleSDKOutput(_0x4b40f9,_0x379084),0x0;if(!_0x1c3936){const _0x557e1b=_0x4b40f9[_0x3a9fee(0x113)](_0xe5e24d=>({'title':_0xe5e24d['taskName']+'\x20('+formatBytes(_0xe5e24d['fileSize'])+')','value':_0xe5e24d[_0x3a9fee(0x16c)]})),_0x147bae=await a39_0xd55755({'type':_0x3a9fee(0x131),'name':'task','message':_0x3a9fee(0x116),'choices':_0x557e1b});if(!_0x147bae[_0x3a9fee(0x188)])return console['error'](_0x3a9fee(0x138)),0x0;_0x1c3936=_0x147bae[_0x3a9fee(0x188)];}const _0x75cf4b=await withSpinner('Downloading\x20logs...',()=>_0x4f2e61[_0x3a9fee(0x106)][_0x3a9fee(0x114)](_0x16849f,_0x1c3936),{'verbose':_0x379084[_0x3a9fee(0x13d)]}),_0x4377cb=_0x75cf4b[_0x3a9fee(0x17c)];return _0x4377cb?console['log'](_0x4377cb):console[_0x3a9fee(0x144)](_0x3a9fee(0x15d)),0x0;}catch(_0x446d4d){if(_0x446d4d instanceof SDKError)return console['error'](_0x3a9fee(0x10a)+_0x446d4d['message']),_0x446d4d[_0x3a9fee(0x117)]&&console[_0x3a9fee(0x144)]('\x20\x20Cause:\x20'+_0x446d4d['cause']),0x1;throw _0x446d4d;}}}export class WorkflowKillCommand extends BaseCommand{[a39_0x45ce2a(0x100)]=a39_0x45ce2a(0x123);[a39_0x45ce2a(0x137)]=a39_0x45ce2a(0x12c);async[a39_0x45ce2a(0x10d)](_0x2a2b00){const _0x560501=a39_0x45ce2a,{options:_0x4fe925,args:_0x588606,tdx:_0x3ac4cc}=_0x2a2b00,_0x112a82=_0x588606[0x0];if(!_0x112a82)return console['error'](_0x560501(0xfe)),0x1;try{const _0x5c6fee=_0x4fe925[_0x560501(0xfb)];_0x4fe925['verbose']&&(console[_0x560501(0x144)](_0x560501(0x139)+_0x112a82),_0x5c6fee&&console[_0x560501(0x144)](_0x560501(0x17a)+_0x5c6fee));if(!_0x4fe925[_0x560501(0x182)]){const _0x3ebb6a=await confirm(_0x560501(0x170)+_0x112a82+'?');if(!_0x3ebb6a)return console[_0x560501(0x144)]('Cancelled'),0x0;}const _0x24c53a=await withSpinner(_0x560501(0x119),()=>_0x3ac4cc[_0x560501(0x106)][_0x560501(0x18b)](_0x112a82,_0x5c6fee),{'verbose':_0x4fe925['verbose']}),_0x2a6590=_0x24c53a[_0x560501(0x17c)];return console[_0x560501(0x144)]('✔\x20'+_0x2a6590),0x0;}catch(_0x475b49){if(_0x475b49 instanceof SDKError)return console['error'](_0x560501(0x10a)+_0x475b49['message']),_0x475b49[_0x560501(0x117)]&&console[_0x560501(0x144)]('\x20\x20Cause:\x20'+_0x475b49[_0x560501(0x117)]),0x1;throw _0x475b49;}}}export class WorkflowRetryCommand extends BaseCommand{[a39_0x45ce2a(0x100)]=a39_0x45ce2a(0x142);[a39_0x45ce2a(0x137)]=a39_0x45ce2a(0x153);async[a39_0x45ce2a(0x10d)](_0x465286){const _0x1e88e7=a39_0x45ce2a,{options:_0x2ea6ea,args:_0x2a7838,tdx:_0x466012}=_0x465286,_0x2f214a=_0x2a7838[0x0];if(!_0x2f214a)return console[_0x1e88e7(0x144)](_0x1e88e7(0x15b)),console[_0x1e88e7(0x144)](_0x1e88e7(0x11c)),0x1;let _0x152624=![],_0xd97149=_0x2f214a;if(_0x2f214a[_0x1e88e7(0x12d)](_0x1e88e7(0x10b)))_0x152624=!![],_0xd97149=_0x2f214a['substring'](0x8);else{if(_0x2f214a[_0x1e88e7(0x12d)](_0x1e88e7(0x121)))_0x152624=![],_0xd97149=_0x2f214a['substring'](0x8);else return console[_0x1e88e7(0x144)](_0x1e88e7(0x196)),console[_0x1e88e7(0x144)](_0x1e88e7(0x11c)),0x1;}try{const _0x3a7937=_0x2ea6ea[_0x1e88e7(0x148)],_0x13c0d1=_0x2ea6ea['resumeFrom'],_0x3a5738=_0x2ea6ea[_0x1e88e7(0x180)],_0x4a8b02=_0x2ea6ea[_0x1e88e7(0x184)];_0x2ea6ea['verbose']&&(console[_0x1e88e7(0x144)](_0x1e88e7(0x13c)+(_0x152624?_0x1e88e7(0x13e):_0x1e88e7(0x110))+'\x20'+_0xd97149),_0x3a7937&&console[_0x1e88e7(0x144)](_0x1e88e7(0x183)+_0x3a7937),_0x13c0d1&&console[_0x1e88e7(0x144)](_0x1e88e7(0x12e)+_0x13c0d1),_0x3a5738&&console[_0x1e88e7(0x144)]('Params:\x20'+_0x3a5738),_0x4a8b02&&console['error']('Force:\x20yes'));let _0x1d22c4;if(_0x3a5738)try{if(_0x3a5738[_0x1e88e7(0x12d)]('@')){const _0x4ff6d6=await import('fs/promises'),_0x42d61b=_0x3a5738[_0x1e88e7(0x10e)](0x1),_0x217dfa=await _0x4ff6d6[_0x1e88e7(0x143)](_0x42d61b,_0x1e88e7(0x141));_0x1d22c4=JSON[_0x1e88e7(0x1a4)](_0x217dfa);}else _0x1d22c4=JSON['parse'](_0x3a5738);}catch{return console['error']('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x2ea6ea[_0x1e88e7(0x182)]){const _0x401b38=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x152624?_0x1e88e7(0x13e):'attempt')+'\x20'+_0xd97149+'?');if(!_0x401b38)return console[_0x1e88e7(0x144)]('Cancelled'),0x0;}let _0x5e2bac;_0x152624?_0x5e2bac=await withSpinner(_0x1e88e7(0x177),()=>_0x466012[_0x1e88e7(0x106)][_0x1e88e7(0x16b)](_0xd97149,{'fromTask':_0x3a7937,'retryParams':_0x1d22c4}),{'verbose':_0x2ea6ea[_0x1e88e7(0x13d)]}):_0x5e2bac=await withSpinner(_0x1e88e7(0x178),()=>_0x466012[_0x1e88e7(0x106)][_0x1e88e7(0x157)](_0xd97149,{'resumeFrom':_0x13c0d1,'retryParams':_0x1d22c4,'force':_0x4a8b02}),{'verbose':_0x2ea6ea[_0x1e88e7(0x13d)]});const _0x42b784=_0x5e2bac[_0x1e88e7(0x17c)];return console[_0x1e88e7(0x144)](_0x1e88e7(0x14f)),console[_0x1e88e7(0x144)](_0x1e88e7(0x17b)+_0x42b784[_0x1e88e7(0x101)]),console['error'](_0x1e88e7(0xff)+_0x42b784[_0x1e88e7(0x1a0)]),0x0;}catch(_0x4b9c97){if(_0x4b9c97 instanceof SDKError)return console[_0x1e88e7(0x144)](_0x1e88e7(0x10a)+_0x4b9c97[_0x1e88e7(0x122)]),_0x4b9c97['cause']&&console[_0x1e88e7(0x144)](_0x1e88e7(0x120)+_0x4b9c97[_0x1e88e7(0x117)]),0x1;throw _0x4b9c97;}}}function a39_0x98fb(_0x28c68d,_0x353cc1){const _0x4d225b=a39_0x4d22();return a39_0x98fb=function(_0x98fbfe,_0x225509){_0x98fbfe=_0x98fbfe-0xfb;let _0x50faf4=_0x4d225b[_0x98fbfe];return _0x50faf4;},a39_0x98fb(_0x28c68d,_0x353cc1);}export class WorkflowRunCommand extends BaseCommand{[a39_0x45ce2a(0x100)]=a39_0x45ce2a(0x169);['description']=a39_0x45ce2a(0x175);async[a39_0x45ce2a(0x10d)](_0x1bc5ee){const _0x24b836=a39_0x45ce2a,{options:_0x1ae8a8,args:_0x3a7dab,tdx:_0x3ecc45}=_0x1bc5ee,_0x37bd30=_0x3a7dab[0x0];if(!_0x37bd30)return console[_0x24b836(0x144)](_0x24b836(0x191)),console['error'](_0x24b836(0x13a)),0x1;const _0x2474be=_0x1ae8a8[_0x24b836(0x186)],_0x17f19a=_0x1ae8a8[_0x24b836(0x127)],_0x116fd2={};if(_0x2474be&&Array[_0x24b836(0x13f)](_0x2474be))for(const _0x15deb6 of _0x2474be){const _0x1db8dd=_0x15deb6[_0x24b836(0x159)]('=');if(_0x1db8dd===-0x1)return console[_0x24b836(0x144)](_0x24b836(0x15a)+_0x15deb6),console[_0x24b836(0x144)](_0x24b836(0x105)),0x1;const _0x269af6=_0x15deb6[_0x24b836(0x10e)](0x0,_0x1db8dd),_0x9f9a81=_0x15deb6[_0x24b836(0x10e)](_0x1db8dd+0x1);try{_0x116fd2[_0x269af6]=JSON[_0x24b836(0x1a4)](_0x9f9a81);}catch{_0x116fd2[_0x269af6]=_0x9f9a81;}}_0x1ae8a8[_0x24b836(0x13d)]&&(console[_0x24b836(0x144)]('Workflow:\x20'+_0x37bd30),Object[_0x24b836(0x173)](_0x116fd2)[_0x24b836(0x181)]>0x0&&console[_0x24b836(0x144)](_0x24b836(0x14e)+JSON[_0x24b836(0x19c)](_0x116fd2)),_0x17f19a&&console[_0x24b836(0x144)](_0x24b836(0x140)+_0x17f19a));const _0x29dd01=await withSpinner('Starting\x20workflow\x20run...',()=>_0x3ecc45[_0x24b836(0x106)][_0x24b836(0x133)](_0x37bd30,_0x116fd2,{'sessionTime':_0x17f19a}),{'verbose':_0x1ae8a8['verbose']}),_0x5798fe=_0x29dd01['data'];return console['error'](_0x24b836(0x165)),console[_0x24b836(0x144)]('\x20\x20Attempt\x20ID:\x20'+_0x5798fe['id']),console[_0x24b836(0x144)](_0x24b836(0xff)+_0x5798fe[_0x24b836(0x1a0)]),console[_0x24b836(0x144)]('\x20\x20Project:\x20'+_0x5798fe['project']?.[_0x24b836(0x100)]),console[_0x24b836(0x144)](_0x24b836(0x11a)+_0x5798fe['workflow']?.[_0x24b836(0x100)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a39_0x45ce2a(0x100)]='workflow:download';[a39_0x45ce2a(0x137)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async['execute'](_0x19feac){const _0x2a9cb9=a39_0x45ce2a,{options:_0x5f1a4d,args:_0x1615ce,tdx:_0x25b3ca}=_0x19feac,_0x2c405d=_0x1615ce[0x0],_0xdbc244=_0x1615ce[0x1]||'.';if(!_0x2c405d)return console['error'](_0x2a9cb9(0x1a3)),console[_0x2a9cb9(0x144)](_0x2a9cb9(0x197)),0x1;const _0x392e60=_0x5f1a4d[_0x2a9cb9(0x187)];_0x5f1a4d[_0x2a9cb9(0x13d)]&&(console[_0x2a9cb9(0x144)](_0x2a9cb9(0x11b)+_0x2c405d),console['error'](_0x2a9cb9(0x15f)+_0xdbc244),_0x392e60&&console[_0x2a9cb9(0x144)](_0x2a9cb9(0x11e)+_0x392e60));const _0x3249cc=await withSpinner(_0x2a9cb9(0x104)+_0x2c405d+_0x2a9cb9(0x198),()=>_0x25b3ca[_0x2a9cb9(0x106)][_0x2a9cb9(0x129)](_0x2c405d,_0xdbc244,{'revision':_0x392e60}),{'verbose':_0x5f1a4d['verbose']}),_0xf7d96e=_0x3249cc[_0x2a9cb9(0x17c)];return console[_0x2a9cb9(0x144)](_0x2a9cb9(0x136)+_0xf7d96e[_0x2a9cb9(0x15c)]),console[_0x2a9cb9(0x144)](_0x2a9cb9(0x172)+_0xf7d96e['revision']),console[_0x2a9cb9(0x144)]('\x20\x20Files\x20extracted:\x20'+_0xf7d96e[_0x2a9cb9(0x163)]),console[_0x2a9cb9(0x144)]('\x20\x20Location:\x20'+_0xdbc244+'/'+_0xf7d96e[_0x2a9cb9(0x15c)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a39_0x45ce2a(0x100)]=a39_0x45ce2a(0x195);[a39_0x45ce2a(0x137)]=a39_0x45ce2a(0x179);async[a39_0x45ce2a(0x10d)](_0x1bb7fb){const _0x1f23c9=a39_0x45ce2a,{options:_0x50f872,args:_0x1ae0ca,tdx:_0x536fc0}=_0x1bb7fb;let _0x281777='.',_0x278a24=_0x50f872['name'];if(_0x1ae0ca[0x0]){const {promises:_0x590158}=await import('fs');try{const _0x898bd1=await _0x590158[_0x1f23c9(0x162)](_0x1ae0ca[0x0]);if(_0x898bd1['isDirectory']())_0x281777=_0x1ae0ca[0x0];else return console[_0x1f23c9(0x144)](_0x1f23c9(0x10a)+_0x1ae0ca[0x0]+_0x1f23c9(0x192)),0x1;}catch{_0x278a24=_0x1ae0ca[0x0],_0x281777='.';}}const _0x53a532=_0x50f872[_0x1f23c9(0x187)],_0x50cb54=_0x50f872['skipValidation'];_0x50f872[_0x1f23c9(0x13d)]&&(console[_0x1f23c9(0x144)](_0x1f23c9(0x168)+_0x281777),_0x278a24&&console['error']('Project\x20name:\x20'+_0x278a24),_0x53a532&&console[_0x1f23c9(0x144)](_0x1f23c9(0x11e)+_0x53a532),_0x50cb54&&console[_0x1f23c9(0x144)](_0x1f23c9(0x176)));const _0x385d7e=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x536fc0['workflow'][_0x1f23c9(0x18e)](_0x281777,{'projectName':_0x278a24,'revision':_0x53a532,'skipValidation':_0x50cb54}),{'verbose':_0x50f872['verbose']}),_0x4d2098=_0x385d7e[_0x1f23c9(0x17c)];return console[_0x1f23c9(0x144)]('✔\x20Pushed\x20'+_0x4d2098[_0x1f23c9(0x15c)]),console[_0x1f23c9(0x144)]('\x20\x20Project\x20ID:\x20'+_0x4d2098[_0x1f23c9(0x12f)]),console[_0x1f23c9(0x144)]('\x20\x20Revision:\x20'+_0x4d2098[_0x1f23c9(0x187)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a39_0x45ce2a(0x16d);[a39_0x45ce2a(0x137)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a39_0x45ce2a(0x10d)](_0x1276dd){const _0x38166a=a39_0x45ce2a,{options:_0x196661,args:_0x385547,tdx:_0x5a5adb}=_0x1276dd,_0xe4ddcd=_0x385547[0x0];if(!_0xe4ddcd)return console[_0x38166a(0x144)](_0x38166a(0x15e)),console['error']('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x196661[_0x38166a(0x13d)]&&console['error'](_0x38166a(0x11b)+_0xe4ddcd);if(!_0x196661[_0x38166a(0x182)]){const _0xea6c38=await confirm(_0x38166a(0x132)+_0xe4ddcd+_0x38166a(0x160));if(!_0xea6c38)return console[_0x38166a(0x144)](_0x38166a(0x138)),0x0;}const _0x12c042=await withSpinner(_0x38166a(0x135)+_0xe4ddcd+_0x38166a(0x198),()=>_0x5a5adb[_0x38166a(0x106)][_0x38166a(0x145)](_0xe4ddcd),{'verbose':_0x196661[_0x38166a(0x13d)]}),_0x349199=_0x12c042['data'];return console[_0x38166a(0x144)](_0x38166a(0xfc)+_0x349199[_0x38166a(0x15c)]),console[_0x38166a(0x144)](_0x38166a(0x174)+_0x349199[_0x38166a(0x12f)]),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x50be89,_0x2db1ff){const _0x40b9f6=a40_0x4b6d,_0xca5c0f=_0x50be89();while(!![]){try{const _0xf49faf=-parseInt(_0x40b9f6(0xec))/0x1*(parseInt(_0x40b9f6(0xee))/0x2)+-parseInt(_0x40b9f6(0xdb))/0x3*(parseInt(_0x40b9f6(0xe7))/0x4)+-parseInt(_0x40b9f6(0xe1))/0x5+-parseInt(_0x40b9f6(0xe4))/0x6*(parseInt(_0x40b9f6(0xdd))/0x7)+parseInt(_0x40b9f6(0xe6))/0x8+-parseInt(_0x40b9f6(0xdf))/0x9*(-parseInt(_0x40b9f6(0xef))/0xa)+-parseInt(_0x40b9f6(0xde))/0xb*(-parseInt(_0x40b9f6(0xeb))/0xc);if(_0xf49faf===_0x2db1ff)break;else _0xca5c0f['push'](_0xca5c0f['shift']());}catch(_0x4ab72c){_0xca5c0f['push'](_0xca5c0f['shift']());}}}(a40_0x2dd3,0xa2cd3));import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';import{getAPIKey}from'./config.js';function a40_0x4b6d(_0x587cee,_0x264bc0){const _0x2dd39a=a40_0x2dd3();return a40_0x4b6d=function(_0x4b6d32,_0x36172d){_0x4b6d32=_0x4b6d32-0xda;let _0x231c9f=_0x2dd39a[_0x4b6d32];return _0x231c9f;},a40_0x4b6d(_0x587cee,_0x264bc0);}export function getVersion(){const _0x712df4=a40_0x4b6d;try{const _0x4c97be=fileURLToPath(import.meta[_0x712df4(0xea)]),_0x2889e2=dirname(_0x4c97be),_0x4a9758=join(_0x2889e2,_0x712df4(0xed)),_0x5c18bc=JSON['parse'](readFileSync(_0x4a9758,_0x712df4(0xe5)));return _0x5c18bc['version'];}catch{return _0x712df4(0xe3);}}export function getUserAgent(){const _0x501190=a40_0x4b6d,_0x9e5b95=getVersion(),_0x2e6500=platform(),_0x3dfc2c=process[_0x501190(0xe8)][_0x501190(0xe9)]('v','');return _0x501190(0xdc)+_0x9e5b95+'\x20('+_0x2e6500+_0x501190(0xda)+_0x3dfc2c+')';}function a40_0x2dd3(){const _0x4b90a9=['version','replace','url','48XcsUKQ','1471nOlhqZ','../../package.json','1658PPGAKr','13370QGdNpz',';\x20node/','78519zuJlrs','tdx/','5194cnrQFu','6892325qFSNpf','7848csMBYX','TD1\x20','5680975nhMhNT','tdx','0.0.0','1974KLWprs','utf-8','1990144NytURS','100ZNgHhP'];a40_0x2dd3=function(){return _0x4b90a9;};return a40_0x2dd3();}export function getAuthHeaders(_0x1f5d46,_0x3fda2e){const _0x1e4476=a40_0x4b6d,_0x912be3=getVersion(),_0x179128={'User-Agent':getUserAgent(),'X-TD-Client':_0x1e4476(0xe2),'X-TD-Client-Version':_0x912be3};return _0x3fda2e&&(_0x179128['Authorization']=_0x1e4476(0xe0)+_0x3fda2e),_0x179128;}export function toHeaderRecord(_0x5e2286){const _0x44e570={};for(const [_0x3c8b90,_0x3a4824]of Object['entries'](_0x5e2286)){_0x3a4824!==undefined&&(_0x44e570[_0x3c8b90]=_0x3a4824);}return _0x44e570;}export function getTrinoHeaders(_0x5ab16d,_0x28c7d7){const _0x517fdd=getAuthHeaders(_0x5ab16d,_0x28c7d7),_0x4bdc1f=toHeaderRecord(_0x517fdd);return delete _0x4bdc1f['Authorization'],_0x28c7d7&&(_0x4bdc1f['X-Trino-User']=_0x28c7d7),_0x4bdc1f;}export function hasAPIKey(_0x22ab61){const _0x39fd5b=getAPIKey(_0x22ab61);return _0x39fd5b!==undefined&&_0x39fd5b['length']>0x0;}
|
package/dist/core/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x54ed9f,_0x1a7c88){const _0x42b903=a41_0x833a,_0x1a8387=_0x54ed9f();while(!![]){try{const _0x3333c9=parseInt(_0x42b903(0xe2))/0x1+parseInt(_0x42b903(0xe1))/0x2+parseInt(_0x42b903(0xd8))/0x3+-parseInt(_0x42b903(0xe7))/0x4+-parseInt(_0x42b903(0xfd))/0x5+parseInt(_0x42b903(0x109))/0x6+-parseInt(_0x42b903(0xeb))/0x7;if(_0x3333c9===_0x1a7c88)break;else _0x1a8387['push'](_0x1a8387['shift']());}catch(_0x22c090){_0x1a8387['push'](_0x1a8387['shift']());}}}(a41_0x3883,0x1e1c5));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a41_0x203c3e from'node:fs';import*as a41_0x5bfa4e 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 a41_0x400bbb from'chalk';export function getConfigDir(){const _0xa56b6d=a41_0x833a;return process[_0xa56b6d(0x118)][_0xa56b6d(0xf9)]||join(homedir(),_0xa56b6d(0xf2),_0xa56b6d(0xe8));}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getConfigFilePath(_0x48b245){const _0x58ad22=a41_0x833a,_0x553bea=getConfigDir();return _0x48b245?a41_0x5bfa4e[_0x58ad22(0xf8)](_0x553bea,_0x58ad22(0x110)+_0x48b245):getConfigFile();}export function getCacheDir(){const _0x7d2f7d=a41_0x833a;return process[_0x7d2f7d(0x118)][_0x7d2f7d(0x10f)]||join(homedir(),_0x7d2f7d(0xe4),_0x7d2f7d(0xe8));}export function getLLMProjectCacheFile(_0x535758){const _0x3cb794=a41_0x833a,_0x96ee97=_0x535758?_0x3cb794(0xde)+_0x535758:_0x3cb794(0xe9);return join(getCacheDir(),_0x96ee97);}export function readCachedLLMProject(_0x2a31ab){const _0x539f8c=a41_0x833a;try{const _0x4f3cf5=getLLMProjectCacheFile(_0x2a31ab);if(!existsSync(_0x4f3cf5))return null;const _0x50221b=readFileSync(_0x4f3cf5,_0x539f8c(0x116))[_0x539f8c(0xf4)]();try{const _0x2c6e43=JSON[_0x539f8c(0xdc)](_0x50221b);if(_0x2c6e43&&typeof _0x2c6e43['id']===_0x539f8c(0xef)&&typeof _0x2c6e43['name']===_0x539f8c(0xef))return _0x2c6e43;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x4931d0,_0x279047,_0x56ed59){const _0x5af5e6=a41_0x833a;try{const _0x549eb9=getCacheDir(),_0x276fb9=getLLMProjectCacheFile(_0x56ed59);!existsSync(_0x549eb9)&&mkdirSync(_0x549eb9,{'recursive':!![]});const _0x2f9a67={'name':_0x4931d0,'id':_0x279047};writeFileSync(_0x276fb9,JSON['stringify'](_0x2f9a67),_0x5af5e6(0x116));}catch{}}function a41_0x833a(_0x42da7e,_0x3188dc){const _0x3883ec=a41_0x3883();return a41_0x833a=function(_0x833a1e,_0x80b4e2){_0x833a1e=_0x833a1e-0xd7;let _0x136f3d=_0x3883ec[_0x833a1e];return _0x136f3d;},a41_0x833a(_0x42da7e,_0x3188dc);}export function parseEnvFile(_0x217744){const _0x2c1ec6=a41_0x833a,_0x393c8a={};for(const _0x5c3af6 of _0x217744[_0x2c1ec6(0x100)]('\x0a')){const _0x4e19e7=_0x5c3af6[_0x2c1ec6(0xf4)]();if(!_0x4e19e7||_0x4e19e7['startsWith']('#'))continue;const _0x3e877c=_0x4e19e7['match'](/^([^=]+)=(.*)$/);if(_0x3e877c){const _0x30e303=_0x3e877c[0x1][_0x2c1ec6(0xf4)]();let _0x3373e7=_0x3e877c[0x2][_0x2c1ec6(0xf4)]();(_0x3373e7[_0x2c1ec6(0x10c)]('\x22')&&_0x3373e7[_0x2c1ec6(0x101)]('\x22')||_0x3373e7['startsWith']('\x27')&&_0x3373e7[_0x2c1ec6(0x101)]('\x27'))&&(_0x3373e7=_0x3373e7[_0x2c1ec6(0x102)](0x1,-0x1)),_0x393c8a[_0x30e303]=_0x3373e7;}}return _0x393c8a;}export function readUserConfig(){const _0x171903=a41_0x833a,_0x1030aa=getConfigFile();if(!existsSync(_0x1030aa))return{};try{const _0x2aaf21=readFileSync(_0x1030aa,_0x171903(0x116));return parseEnvFile(_0x2aaf21);}catch(_0x1198ea){return console[_0x171903(0x107)](_0x171903(0xe5)+_0x1030aa+':',_0x1198ea),{};}}export function resolveSite(_0x57ecf0){const _0xbcd862=a41_0x833a,_0x3c218f=[_0xbcd862(0x111),'jp01','eu01',_0xbcd862(0xee),_0xbcd862(0xd7),_0xbcd862(0xea),_0xbcd862(0xfe),'stg-us01',_0xbcd862(0xf1),_0xbcd862(0xf6)];if(_0x3c218f['includes'](_0x57ecf0))return _0x57ecf0;if(_0x57ecf0 in SITE_ALIASES)return SITE_ALIASES[_0x57ecf0];return console[_0xbcd862(0x107)]('Warning:\x20Unknown\x20site\x20\x27'+_0x57ecf0+_0xbcd862(0x112)),_0xbcd862(0x111);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x12bf30,_0x232627){const _0x198e2d=a41_0x833a,_0x4629ab=_0x232627||getActiveProfileName();if(_0x4629ab){const _0x16d445='TDX_API_KEY_'+normalizeProfileForEnvVar(_0x4629ab);if(process['env'][_0x16d445])return process[_0x198e2d(0x118)][_0x16d445];}if(process[_0x198e2d(0x118)][_0x198e2d(0x10d)])return process[_0x198e2d(0x118)][_0x198e2d(0x10d)];if(process[_0x198e2d(0x118)][_0x198e2d(0x119)])return process['env'][_0x198e2d(0x119)];const _0x595e6d=_0x12bf30[_0x198e2d(0xe6)]()['replace'](/-/g,'_'),_0x4d285f=_0x198e2d(0x103)+_0x595e6d;if(_0x4629ab){const _0xf57b66=loadProfileEnv(_0x4629ab);if(_0xf57b66){if(_0xf57b66[_0x4d285f])return _0xf57b66[_0x4d285f];if(_0xf57b66[_0x198e2d(0x119)])return _0xf57b66['TD_API_KEY'];}}const _0x4fe018=loadUserConfigOnce();if(_0x4fe018[_0x4d285f])return _0x4fe018[_0x4d285f];if(_0x4fe018[_0x198e2d(0x119)])return _0x4fe018[_0x198e2d(0x119)];return undefined;}export function normalizeProfileForEnvVar(_0x42c519){const _0x3d691f=a41_0x833a;return _0x42c519['toUpperCase']()[_0x3d691f(0xd9)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x43f8d9,_0x482fd1){const _0x8968e=a41_0x833a,_0x40bd8b=_0x482fd1||getActiveProfileName()||undefined;if(_0x40bd8b){const _0xf8c8af=_0x8968e(0xf3)+normalizeProfileForEnvVar(_0x40bd8b);if(process['env'][_0xf8c8af])return{'apiKey':process[_0x8968e(0x118)][_0xf8c8af],'source':_0xf8c8af+_0x8968e(0xf5),'isDeprecated':![]};const _0x369fa5=getCachedCredential(_0x43f8d9,_0x40bd8b);if(_0x369fa5)return{'apiKey':_0x369fa5,'source':'keychain\x20(profile:\x20'+_0x40bd8b+')','isDeprecated':![]};const _0x27a858=await getKeychainAPIKey(_0x40bd8b);if(_0x27a858)return setCachedCredential(_0x27a858,_0x43f8d9,_0x40bd8b),{'apiKey':_0x27a858,'source':_0x8968e(0x117)+_0x40bd8b+')','isDeprecated':![]};}if(process[_0x8968e(0x118)]['TDX_API_KEY'])return{'apiKey':process[_0x8968e(0x118)]['TDX_API_KEY'],'source':_0x8968e(0x104),'isDeprecated':![]};if(!_0x40bd8b){const _0x4ab35c=getCachedCredential(_0x43f8d9,undefined);if(_0x4ab35c)return{'apiKey':_0x4ab35c,'source':_0x8968e(0xf0),'isDeprecated':![]};const _0x22bf36=await getKeychainAPIKey(undefined);if(_0x22bf36)return setCachedCredential(_0x22bf36,_0x43f8d9,undefined),{'apiKey':_0x22bf36,'source':'keychain','isDeprecated':![]};}if(process['env'][_0x8968e(0x119)])return{'apiKey':process[_0x8968e(0x118)][_0x8968e(0x119)],'source':_0x8968e(0xdf),'isDeprecated':!![]};const _0x5d5714=getLegacyEnvAPIKey(_0x43f8d9,_0x40bd8b);if(_0x5d5714){const _0x3ea1d7=await isKeychainAvailable();if(_0x3ea1d7)try{await saveKeychainAPIKey(_0x5d5714,_0x40bd8b),setCachedCredential(_0x5d5714,_0x43f8d9,_0x40bd8b);const _0x5e7955=getConfigFilePath(_0x40bd8b);cleanupLegacyEnvFile(_0x5e7955)&&console[_0x8968e(0x107)](a41_0x400bbb[_0x8968e(0x114)](_0x8968e(0xe0)));}catch(_0x9d5035){console['warn'](a41_0x400bbb[_0x8968e(0x114)](_0x8968e(0x113)+_0x9d5035));}const _0x977d25=_0x40bd8b?_0x8968e(0xdd)+_0x40bd8b+')':'legacy\x20.env\x20file';return{'apiKey':_0x5d5714,'source':_0x977d25,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x5dea54,_0x485f6d,_0x4da6ea=!![]){const _0x269adf=a41_0x833a,_0x743aa6=await resolveAPIKeyAsync(_0x5dea54,_0x485f6d);if(!_0x743aa6)return undefined;if(_0x4da6ea&&_0x743aa6['isDeprecated']&&_0x743aa6[_0x269adf(0xfb)]['includes'](_0x269adf(0x119))){const _0xef2ef7=_0x485f6d||getActiveProfileName()||undefined,_0x55cdbe=_0xef2ef7?_0x269adf(0xf3)+normalizeProfileForEnvVar(_0xef2ef7):_0x269adf(0xf7);console[_0x269adf(0x107)](a41_0x400bbb[_0x269adf(0x114)]('Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a'+(_0x269adf(0xda)+_0x55cdbe+').')));}return _0x743aa6[_0x269adf(0x10a)];}function getLegacyEnvAPIKey(_0x5c6a24,_0x288296){const _0xfe9b61=a41_0x833a,_0x1ad602=_0x5c6a24['toUpperCase']()[_0xfe9b61(0xd9)](/-/g,'_'),_0x2865aa=_0xfe9b61(0x103)+_0x1ad602;if(_0x288296){const _0x351f9b=loadProfileEnv(_0x288296);if(_0x351f9b){if(_0x351f9b[_0x2865aa])return _0x351f9b[_0x2865aa];if(_0x351f9b[_0xfe9b61(0x119)])return _0x351f9b[_0xfe9b61(0x119)];}}const _0x4b1778=loadUserConfigOnce();if(_0x4b1778[_0x2865aa])return _0x4b1778[_0x2865aa];if(_0x4b1778[_0xfe9b61(0x119)])return _0x4b1778[_0xfe9b61(0x119)];return undefined;}function cleanupLegacyEnvFile(_0x3ac9ca){const _0x320573=a41_0x833a;if(!existsSync(_0x3ac9ca))return![];try{const _0xe9a0e7=readFileSync(_0x3ac9ca,_0x320573(0x116)),_0x1d3602=_0xe9a0e7['split']('\x0a'),_0x200e96=_0x1d3602['filter'](_0x32a585=>{const _0x2526a4=_0x320573,_0xc9f365=_0x32a585[_0x2526a4(0xf4)]();if(!_0xc9f365||_0xc9f365[_0x2526a4(0x10c)]('#'))return!![];const [_0x5c37db]=_0xc9f365[_0x2526a4(0x100)]('=');return!_0x5c37db[_0x2526a4(0x10c)](_0x2526a4(0x119));}),_0x5d8a8e=_0x200e96['some'](_0x6e1be7=>{const _0x22bfdb=_0x320573,_0x163495=_0x6e1be7[_0x22bfdb(0xf4)]();return _0x163495&&!_0x163495['startsWith']('#');});if(!_0x5d8a8e)return unlinkSync(_0x3ac9ca),!![];return writeFileSync(_0x3ac9ca,_0x200e96[_0x320573(0xf8)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function a41_0x3883(){const _0x20e7c4=['utf-8','keychain\x20(profile:\x20','env','TD_API_KEY','ap03','160212YUkcUF','replace','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','profile','parse','legacy\x20.env\x20file\x20(profile:\x20','llm_default_project.','TD_API_KEY\x20env\x20var\x20(deprecated)','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','184748qmnrrL','207095YiWXPA','entries','.cache','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','toUpperCase','248112PuhDDG','tdx','llm_default_project','dev-us01','1292172jDJHZb','Warning:\x20Failed\x20to\x20load\x20','.env','ap02','string','keychain','stg-jp01','.config','TDX_API_KEY_','trim','\x20env\x20var','stg-ap03','TDX_API_KEY_<PROFILE>','join','TDX_CONFIG_DIR','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','source','Warning:\x20Failed\x20to\x20read\x20','901520IxnrRR','dev-eu01','jp01','split','endsWith','slice','TD_API_KEY_','TDX_API_KEY\x20env\x20var','tdx.json','apiKeys','warn','readFileSync','1184328kPXerD','apiKey','existsSync','startsWith','TDX_API_KEY','eu01','TDX_CACHE_DIR','.env.','us01','\x27,\x20defaulting\x20to\x20us01','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','yellow','map'];a41_0x3883=function(){return _0x20e7c4;};return a41_0x3883();}function loadProfileEnv(_0x1dde30){const _0x2686b8=a41_0x833a,_0x26e18d=a41_0x5bfa4e['join'](getConfigDir(),_0x2686b8(0x110)+_0x1dde30);if(a41_0x203c3e[_0x2686b8(0x10b)](_0x26e18d)){validateSecureFilePermissions(_0x26e18d);try{const _0x1ce63f=a41_0x203c3e[_0x2686b8(0x108)](_0x26e18d,_0x2686b8(0x116));return parseEnvFile(_0x1ce63f);}catch(_0x22427e){console[_0x2686b8(0x107)](_0x2686b8(0xec)+_0x26e18d+':\x20'+_0x22427e);}}const _0x496fbf=a41_0x5bfa4e[_0x2686b8(0xf8)](getConfigDir(),'profiles',_0x1dde30,_0x2686b8(0xed));if(a41_0x203c3e['existsSync'](_0x496fbf)){validateSecureFilePermissions(_0x496fbf);try{const _0x558916=a41_0x203c3e['readFileSync'](_0x496fbf,_0x2686b8(0x116));return parseEnvFile(_0x558916);}catch(_0x9d157f){return console[_0x2686b8(0x107)]('Warning:\x20Failed\x20to\x20load\x20'+_0x496fbf+':\x20'+_0x9d157f),null;}}return null;}function getActiveProfileName(){const _0x2e87bc=a41_0x833a,_0x4fcd61=a41_0x5bfa4e['join'](getConfigDir(),_0x2e87bc(0x105));if(!a41_0x203c3e[_0x2e87bc(0x10b)](_0x4fcd61))return null;try{const _0x3e97c5=a41_0x203c3e[_0x2e87bc(0x108)](_0x4fcd61,_0x2e87bc(0x116)),_0x1f461f=JSON[_0x2e87bc(0xdc)](_0x3e97c5);return _0x1f461f[_0x2e87bc(0xdb)]||null;}catch{return null;}}export function saveAPIKey(_0x109c98,_0x1198a0,_0x226ade){const _0x15bca9=a41_0x833a,_0x260e14=getConfigDir(),_0x2e7fc3=getConfigFilePath(_0x226ade);!existsSync(_0x260e14)&&mkdirSync(_0x260e14,{'recursive':!![],'mode':0x1c0});let _0x38f6c6={};if(existsSync(_0x2e7fc3))try{const _0x222bb3=readFileSync(_0x2e7fc3,_0x15bca9(0x116));_0x38f6c6=parseEnvFile(_0x222bb3);}catch(_0x20e0c5){console[_0x15bca9(0x107)](_0x15bca9(0xfc)+_0x2e7fc3+':',_0x20e0c5);}const _0x484959=_0x109c98[_0x15bca9(0xe6)]()[_0x15bca9(0xd9)](/-/g,'_');_0x38f6c6['TD_API_KEY_'+_0x484959]=_0x1198a0;const _0x2e7cd5=Object[_0x15bca9(0xe3)](_0x38f6c6)[_0x15bca9(0x115)](([_0x574118,_0x10d285])=>_0x574118+'='+_0x10d285);writeFileSync(_0x2e7fc3,_0x2e7cd5[_0x15bca9(0xf8)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x581870,_0x1f034d,_0x5702a7){const _0x2a39f9=a41_0x833a;await saveKeychainAPIKey(_0x581870,_0x5702a7),setCachedCredential(_0x581870,_0x1f034d,_0x5702a7);const _0x109bd4=getConfigFilePath(_0x5702a7);cleanupLegacyEnvFile(_0x109bd4)&&console[_0x2a39f9(0x107)](a41_0x400bbb[_0x2a39f9(0x114)](_0x2a39f9(0xfa)));}export function loadConfig(){const _0x532b28=a41_0x833a,_0x14f4b8={'apiKeys':{},'defaultSite':_0x532b28(0x111)},_0x1895a6=['us01',_0x532b28(0xff),_0x532b28(0x10e),_0x532b28(0xee),_0x532b28(0xd7),'dev-us01','dev-eu01','stg-us01','stg-jp01',_0x532b28(0xf6)];for(const _0xdb83c6 of _0x1895a6){const _0x5a1ad6=getAPIKey(_0xdb83c6);_0x5a1ad6&&(_0x14f4b8[_0x532b28(0x106)][_0xdb83c6]=_0x5a1ad6);}return _0x14f4b8;}
|
|
1
|
+
(function(_0xa1bd48,_0x3111cb){const _0x4258f3=a41_0xfd6b,_0x16cf26=_0xa1bd48();while(!![]){try{const _0x44de3b=-parseInt(_0x4258f3(0x115))/0x1+parseInt(_0x4258f3(0x11b))/0x2*(-parseInt(_0x4258f3(0xe5))/0x3)+-parseInt(_0x4258f3(0xf3))/0x4*(-parseInt(_0x4258f3(0x118))/0x5)+-parseInt(_0x4258f3(0x105))/0x6*(parseInt(_0x4258f3(0xe8))/0x7)+-parseInt(_0x4258f3(0x11c))/0x8+parseInt(_0x4258f3(0x100))/0x9*(-parseInt(_0x4258f3(0x10a))/0xa)+parseInt(_0x4258f3(0x10c))/0xb;if(_0x44de3b===_0x3111cb)break;else _0x16cf26['push'](_0x16cf26['shift']());}catch(_0x339aa9){_0x16cf26['push'](_0x16cf26['shift']());}}}(a41_0x1ea4,0x7d8c8));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a41_0x386cfc from'node:fs';import*as a41_0x5d9678 from'node:path';import{SITE_ALIASES}from'../types/index.js';function a41_0xfd6b(_0x2b183d,_0x588562){const _0x1ea4c2=a41_0x1ea4();return a41_0xfd6b=function(_0xfd6be9,_0x238464){_0xfd6be9=_0xfd6be9-0xdf;let _0x169bce=_0x1ea4c2[_0xfd6be9];return _0x169bce;},a41_0xfd6b(_0x2b183d,_0x588562);}import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';function a41_0x1ea4(){const _0x263745=['apiKey','match','74PdcXSB','5194000vSriFl','name','legacy\x20.env\x20file\x20(profile:\x20','join','llm_default_project.','some','stringify','readFileSync','split','TD_API_KEY_','Warning:\x20Failed\x20to\x20load\x20','Warning:\x20Failed\x20to\x20read\x20','TDX_API_KEY_<PROFILE>','slice','TDX_CONFIG_DIR','TDX_API_KEY\x20env\x20var','isDeprecated','17841qqTPgi','TDX_API_KEY','string','32123AUAjef','ap02','yellow','dev-us01','source','existsSync','.env.','legacy\x20.env\x20file','stg-us01','TDX_API_KEY_','utf-8','4rLZQGj','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','apiKeys','.cache','toUpperCase','keychain','dev-eu01','warn','includes','env','TD_API_KEY\x20env\x20var\x20(deprecated)','startsWith','9TIejmi','endsWith','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','us01','906XiOuLw','ap03','keychain\x20(profile:\x20','\x27,\x20defaulting\x20to\x20us01','eu01','468670RMCLFd','stg-ap03','15857435YckQGr','tdx.json','jp01','trim','stg-jp01','tdx','llm_default_project','.env','parse','126120ZhAOOc','TD_API_KEY','replace','4039390mVxGZo'];a41_0x1ea4=function(){return _0x263745;};return a41_0x1ea4();}import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a41_0xd66928 from'chalk';export function getConfigDir(){const _0x3568f6=a41_0xfd6b;return process['env'][_0x3568f6(0xe2)]||join(homedir(),'.config',_0x3568f6(0x111));}export function getConfigFile(){const _0x5d7935=a41_0xfd6b;return join(getConfigDir(),_0x5d7935(0x113));}export function getConfigFilePath(_0x5d86b5){const _0x155358=a41_0xfd6b,_0xce49fd=getConfigDir();return _0x5d86b5?a41_0x5d9678[_0x155358(0x11f)](_0xce49fd,_0x155358(0xee)+_0x5d86b5):getConfigFile();}export function getCacheDir(){const _0x3b765c=a41_0xfd6b;return process[_0x3b765c(0xfd)]['TDX_CACHE_DIR']||join(homedir(),_0x3b765c(0xf7),'tdx');}export function getLLMProjectCacheFile(_0x5b87da){const _0x181c8d=a41_0xfd6b,_0x17a8bb=_0x5b87da?_0x181c8d(0x120)+_0x5b87da:_0x181c8d(0x112);return join(getCacheDir(),_0x17a8bb);}export function readCachedLLMProject(_0x386283){const _0xd1f8e2=a41_0xfd6b;try{const _0x2dc2ae=getLLMProjectCacheFile(_0x386283);if(!existsSync(_0x2dc2ae))return null;const _0x312778=readFileSync(_0x2dc2ae,_0xd1f8e2(0xf2))['trim']();try{const _0x266ec7=JSON[_0xd1f8e2(0x114)](_0x312778);if(_0x266ec7&&typeof _0x266ec7['id']===_0xd1f8e2(0xe7)&&typeof _0x266ec7[_0xd1f8e2(0x11d)]===_0xd1f8e2(0xe7))return _0x266ec7;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x29d687,_0x303536,_0x258a22){const _0x1b4c4e=a41_0xfd6b;try{const _0x452772=getCacheDir(),_0x235f0f=getLLMProjectCacheFile(_0x258a22);!existsSync(_0x452772)&&mkdirSync(_0x452772,{'recursive':!![]});const _0x5268cb={'name':_0x29d687,'id':_0x303536};writeFileSync(_0x235f0f,JSON[_0x1b4c4e(0x122)](_0x5268cb),'utf-8');}catch{}}export function parseEnvFile(_0x4b2461){const _0x5dfbf6=a41_0xfd6b,_0x47b974={};for(const _0x394081 of _0x4b2461[_0x5dfbf6(0x124)]('\x0a')){const _0x27944a=_0x394081['trim']();if(!_0x27944a||_0x27944a[_0x5dfbf6(0xff)]('#'))continue;const _0x30b0ac=_0x27944a[_0x5dfbf6(0x11a)](/^([^=]+)=(.*)$/);if(_0x30b0ac){const _0x4f371d=_0x30b0ac[0x1][_0x5dfbf6(0x10f)]();let _0x365ea6=_0x30b0ac[0x2]['trim']();(_0x365ea6['startsWith']('\x22')&&_0x365ea6['endsWith']('\x22')||_0x365ea6[_0x5dfbf6(0xff)]('\x27')&&_0x365ea6[_0x5dfbf6(0x101)]('\x27'))&&(_0x365ea6=_0x365ea6[_0x5dfbf6(0xe1)](0x1,-0x1)),_0x47b974[_0x4f371d]=_0x365ea6;}}return _0x47b974;}export function readUserConfig(){const _0x2e7293=a41_0xfd6b,_0x224e52=getConfigFile();if(!existsSync(_0x224e52))return{};try{const _0x3c6d8c=readFileSync(_0x224e52,_0x2e7293(0xf2));return parseEnvFile(_0x3c6d8c);}catch(_0x353d88){return console[_0x2e7293(0xfb)](_0x2e7293(0xf4)+_0x224e52+':',_0x353d88),{};}}export function resolveSite(_0x3d25c9){const _0x25efaa=a41_0xfd6b,_0x186039=['us01',_0x25efaa(0x10e),_0x25efaa(0x109),'ap02',_0x25efaa(0x106),_0x25efaa(0xeb),'dev-eu01',_0x25efaa(0xf0),_0x25efaa(0x110),_0x25efaa(0x10b)];if(_0x186039[_0x25efaa(0xfc)](_0x3d25c9))return _0x3d25c9;if(_0x3d25c9 in SITE_ALIASES)return SITE_ALIASES[_0x3d25c9];return console[_0x25efaa(0xfb)]('Warning:\x20Unknown\x20site\x20\x27'+_0x3d25c9+_0x25efaa(0x108)),'us01';}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x67ffb3,_0x42440b){const _0x47f19b=a41_0xfd6b,_0x2dabac=_0x42440b||getActiveProfileName();if(_0x2dabac){const _0x36817b=_0x47f19b(0xf1)+normalizeProfileForEnvVar(_0x2dabac);if(process[_0x47f19b(0xfd)][_0x36817b])return process[_0x47f19b(0xfd)][_0x36817b];}if(process[_0x47f19b(0xfd)]['TDX_API_KEY'])return process[_0x47f19b(0xfd)][_0x47f19b(0xe6)];if(process[_0x47f19b(0xfd)][_0x47f19b(0x116)])return process[_0x47f19b(0xfd)][_0x47f19b(0x116)];const _0x37f3a4=_0x67ffb3[_0x47f19b(0xf8)]()[_0x47f19b(0x117)](/-/g,'_'),_0x2d2990=_0x47f19b(0x125)+_0x37f3a4;if(_0x2dabac){const _0x2bfb4a=loadProfileEnv(_0x2dabac);if(_0x2bfb4a){if(_0x2bfb4a[_0x2d2990])return _0x2bfb4a[_0x2d2990];if(_0x2bfb4a['TD_API_KEY'])return _0x2bfb4a[_0x47f19b(0x116)];}}const _0x5f04c8=loadUserConfigOnce();if(_0x5f04c8[_0x2d2990])return _0x5f04c8[_0x2d2990];if(_0x5f04c8[_0x47f19b(0x116)])return _0x5f04c8[_0x47f19b(0x116)];return undefined;}export function normalizeProfileForEnvVar(_0x1ddfbf){const _0x149a81=a41_0xfd6b;return _0x1ddfbf[_0x149a81(0xf8)]()[_0x149a81(0x117)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x61faf4,_0x4fcdcf){const _0x37c054=a41_0xfd6b,_0x233e8d=_0x4fcdcf||getActiveProfileName()||undefined;if(_0x233e8d){const _0x50e293=_0x37c054(0xf1)+normalizeProfileForEnvVar(_0x233e8d);if(process[_0x37c054(0xfd)][_0x50e293])return{'apiKey':process[_0x37c054(0xfd)][_0x50e293],'source':_0x50e293+'\x20env\x20var','isDeprecated':![]};const _0x38fa73=getCachedCredential(_0x61faf4,_0x233e8d);if(_0x38fa73)return{'apiKey':_0x38fa73,'source':'keychain\x20(profile:\x20'+_0x233e8d+')','isDeprecated':![]};const _0x1aea28=await getKeychainAPIKey(_0x233e8d);if(_0x1aea28)return setCachedCredential(_0x1aea28,_0x61faf4,_0x233e8d),{'apiKey':_0x1aea28,'source':_0x37c054(0x107)+_0x233e8d+')','isDeprecated':![]};}if(process[_0x37c054(0xfd)][_0x37c054(0xe6)])return{'apiKey':process[_0x37c054(0xfd)][_0x37c054(0xe6)],'source':_0x37c054(0xe3),'isDeprecated':![]};if(!_0x233e8d){const _0x36b92e=getCachedCredential(_0x61faf4,undefined);if(_0x36b92e)return{'apiKey':_0x36b92e,'source':_0x37c054(0xf9),'isDeprecated':![]};const _0x44c746=await getKeychainAPIKey(undefined);if(_0x44c746)return setCachedCredential(_0x44c746,_0x61faf4,undefined),{'apiKey':_0x44c746,'source':'keychain','isDeprecated':![]};}if(process[_0x37c054(0xfd)]['TD_API_KEY'])return{'apiKey':process[_0x37c054(0xfd)][_0x37c054(0x116)],'source':_0x37c054(0xfe),'isDeprecated':!![]};const _0x260be1=getLegacyEnvAPIKey(_0x61faf4,_0x233e8d);if(_0x260be1){const _0x560225=await isKeychainAvailable();if(_0x560225)try{await saveKeychainAPIKey(_0x260be1,_0x233e8d),setCachedCredential(_0x260be1,_0x61faf4,_0x233e8d);const _0x1c779a=getConfigFilePath(_0x233e8d);cleanupLegacyEnvFile(_0x1c779a)&&console['warn'](a41_0xd66928[_0x37c054(0xea)](_0x37c054(0x102)));}catch(_0x2d04d9){console[_0x37c054(0xfb)](a41_0xd66928[_0x37c054(0xea)]('⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20'+_0x2d04d9));}const _0xaaaadc=_0x233e8d?_0x37c054(0x11e)+_0x233e8d+')':_0x37c054(0xef);return{'apiKey':_0x260be1,'source':_0xaaaadc,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x3c1e2b,_0x233e20,_0x43fb23=!![]){const _0x358464=a41_0xfd6b,_0x573072=await resolveAPIKeyAsync(_0x3c1e2b,_0x233e20);if(!_0x573072)return undefined;if(_0x43fb23&&_0x573072[_0x358464(0xe4)]&&_0x573072[_0x358464(0xec)]['includes'](_0x358464(0x116))){const _0x3e702d=_0x233e20||getActiveProfileName()||undefined,_0x1d251d=_0x3e702d?_0x358464(0xf1)+normalizeProfileForEnvVar(_0x3e702d):_0x358464(0xe0);console['warn'](a41_0xd66928[_0x358464(0xea)](_0x358464(0xf5)+(_0x358464(0x103)+_0x1d251d+').')));}return _0x573072[_0x358464(0x119)];}function getLegacyEnvAPIKey(_0x3086d3,_0x3e1540){const _0x3d3916=a41_0xfd6b,_0x3c7659=_0x3086d3[_0x3d3916(0xf8)]()[_0x3d3916(0x117)](/-/g,'_'),_0x269293='TD_API_KEY_'+_0x3c7659;if(_0x3e1540){const _0x2abb91=loadProfileEnv(_0x3e1540);if(_0x2abb91){if(_0x2abb91[_0x269293])return _0x2abb91[_0x269293];if(_0x2abb91[_0x3d3916(0x116)])return _0x2abb91[_0x3d3916(0x116)];}}const _0x364f25=loadUserConfigOnce();if(_0x364f25[_0x269293])return _0x364f25[_0x269293];if(_0x364f25[_0x3d3916(0x116)])return _0x364f25[_0x3d3916(0x116)];return undefined;}function cleanupLegacyEnvFile(_0x360d5d){const _0x5808e6=a41_0xfd6b;if(!existsSync(_0x360d5d))return![];try{const _0x4bb7b9=readFileSync(_0x360d5d,_0x5808e6(0xf2)),_0x2e1503=_0x4bb7b9['split']('\x0a'),_0x5ac077=_0x2e1503['filter'](_0x43094d=>{const _0x43cb15=_0x5808e6,_0x194519=_0x43094d['trim']();if(!_0x194519||_0x194519[_0x43cb15(0xff)]('#'))return!![];const [_0x4e318c]=_0x194519[_0x43cb15(0x124)]('=');return!_0x4e318c['startsWith'](_0x43cb15(0x116));}),_0x1bf3a9=_0x5ac077[_0x5808e6(0x121)](_0x242d56=>{const _0x15dd42=_0x5808e6,_0x45d604=_0x242d56[_0x15dd42(0x10f)]();return _0x45d604&&!_0x45d604[_0x15dd42(0xff)]('#');});if(!_0x1bf3a9)return unlinkSync(_0x360d5d),!![];return writeFileSync(_0x360d5d,_0x5ac077[_0x5808e6(0x11f)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x1e7be0){const _0x491c4b=a41_0xfd6b,_0x7f17aa=a41_0x5d9678[_0x491c4b(0x11f)](getConfigDir(),_0x491c4b(0xee)+_0x1e7be0);if(a41_0x386cfc['existsSync'](_0x7f17aa)){validateSecureFilePermissions(_0x7f17aa);try{const _0x235e02=a41_0x386cfc[_0x491c4b(0x123)](_0x7f17aa,_0x491c4b(0xf2));return parseEnvFile(_0x235e02);}catch(_0x196029){console[_0x491c4b(0xfb)]('Warning:\x20Failed\x20to\x20load\x20'+_0x7f17aa+':\x20'+_0x196029);}}const _0x314bbb=a41_0x5d9678[_0x491c4b(0x11f)](getConfigDir(),'profiles',_0x1e7be0,_0x491c4b(0x113));if(a41_0x386cfc[_0x491c4b(0xed)](_0x314bbb)){validateSecureFilePermissions(_0x314bbb);try{const _0x252345=a41_0x386cfc[_0x491c4b(0x123)](_0x314bbb,_0x491c4b(0xf2));return parseEnvFile(_0x252345);}catch(_0x1a688b){return console[_0x491c4b(0xfb)](_0x491c4b(0x126)+_0x314bbb+':\x20'+_0x1a688b),null;}}return null;}function getActiveProfileName(){const _0x534ca8=a41_0xfd6b,_0x488e71=a41_0x5d9678[_0x534ca8(0x11f)](getConfigDir(),_0x534ca8(0x10d));if(!a41_0x386cfc[_0x534ca8(0xed)](_0x488e71))return null;try{const _0x465db7=a41_0x386cfc[_0x534ca8(0x123)](_0x488e71,'utf-8'),_0x1713b4=JSON[_0x534ca8(0x114)](_0x465db7);return _0x1713b4['profile']||null;}catch{return null;}}export function saveAPIKey(_0x16f1b2,_0x378124,_0x102f12){const _0x4f01b8=a41_0xfd6b,_0x5bde3c=getConfigDir(),_0xa21f9d=getConfigFilePath(_0x102f12);!existsSync(_0x5bde3c)&&mkdirSync(_0x5bde3c,{'recursive':!![],'mode':0x1c0});let _0x185ac3={};if(existsSync(_0xa21f9d))try{const _0xec4e95=readFileSync(_0xa21f9d,_0x4f01b8(0xf2));_0x185ac3=parseEnvFile(_0xec4e95);}catch(_0x2cef38){console['warn'](_0x4f01b8(0xdf)+_0xa21f9d+':',_0x2cef38);}const _0x2e8fe6=_0x16f1b2[_0x4f01b8(0xf8)]()[_0x4f01b8(0x117)](/-/g,'_');_0x185ac3[_0x4f01b8(0x125)+_0x2e8fe6]=_0x378124;const _0xef828f=Object['entries'](_0x185ac3)['map'](([_0x16dfe3,_0x1333bd])=>_0x16dfe3+'='+_0x1333bd);writeFileSync(_0xa21f9d,_0xef828f[_0x4f01b8(0x11f)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x17ac25,_0x573286,_0x5ee184){const _0x1677ed=a41_0xfd6b;await saveKeychainAPIKey(_0x17ac25,_0x5ee184),setCachedCredential(_0x17ac25,_0x573286,_0x5ee184);const _0x53cba2=getConfigFilePath(_0x5ee184);cleanupLegacyEnvFile(_0x53cba2)&&console[_0x1677ed(0xfb)](a41_0xd66928[_0x1677ed(0xea)]('⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file'));}export function loadConfig(){const _0x1c85af=a41_0xfd6b,_0xca609a={'apiKeys':{},'defaultSite':'us01'},_0x3d11f7=[_0x1c85af(0x104),_0x1c85af(0x10e),_0x1c85af(0x109),_0x1c85af(0xe9),_0x1c85af(0x106),'dev-us01',_0x1c85af(0xfa),_0x1c85af(0xf0),_0x1c85af(0x110),_0x1c85af(0x10b)];for(const _0x655e4e of _0x3d11f7){const _0x119229=getAPIKey(_0x655e4e);_0x119229&&(_0xca609a[_0x1c85af(0xf6)][_0x655e4e]=_0x119229);}return _0xca609a;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5098c2,_0x5c9e53){const _0x47239e=a42_0x126c,_0x460c48=_0x5098c2();while(!![]){try{const _0x2bae31=parseInt(_0x47239e(0xf3))/0x1+-parseInt(_0x47239e(0xe6))/0x2*(-parseInt(_0x47239e(0xf0))/0x3)+-parseInt(_0x47239e(0xe5))/0x4*(-parseInt(_0x47239e(0xe7))/0x5)+parseInt(_0x47239e(0xf1))/0x6*(parseInt(_0x47239e(0xf2))/0x7)+-parseInt(_0x47239e(0xe9))/0x8*(parseInt(_0x47239e(0xed))/0x9)+-parseInt(_0x47239e(0xf5))/0xa+-parseInt(_0x47239e(0xee))/0xb;if(_0x2bae31===_0x5c9e53)break;else _0x460c48['push'](_0x460c48['shift']());}catch(_0x3f8231){_0x460c48['push'](_0x460c48['shift']());}}}(a42_0x9c74,0x1c2d7));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x7a0de7,_0x8e8f27){const _0x55fc17=a42_0x126c,_0x35dfc7=_0x7a0de7||'__default_site__',_0x494609=_0x8e8f27||_0x55fc17(0xf6);return _0x35dfc7+':'+_0x494609;}function a42_0x126c(_0x204fa4,_0x3c8a52){const _0x9c744d=a42_0x9c74();return a42_0x126c=function(_0x126c5f,_0x11de78){_0x126c5f=_0x126c5f-0xe5;let _0x27789d=_0x9c744d[_0x126c5f];return _0x27789d;},a42_0x126c(_0x204fa4,_0x3c8a52);}function a42_0x9c74(){const _0x3a2359=['143541enpJbN','1883376YEFNCo','loadedAt','2994ezOHPF','78bzlhOz','77763LUZnRU','23536VNXkBx','apiKey','634830GVjOxH','__default_profile__','779704DUWoAT','326JlpHkv','5xmBywX','now','88JmfDIK','set','delete','get'];a42_0x9c74=function(){return _0x3a2359;};return a42_0x9c74();}export function getCachedCredential(_0x358084,_0x213fc2){const _0x4d5e9f=a42_0x126c,_0x2f1227=getCacheKey(_0x358084,_0x213fc2),_0x430cce=cache[_0x4d5e9f(0xec)](_0x2f1227);if(!_0x430cce)return null;if(Date[_0x4d5e9f(0xe8)]()-_0x430cce[_0x4d5e9f(0xef)]>CACHE_TTL_MS)return cache[_0x4d5e9f(0xeb)](_0x2f1227),null;return _0x430cce[_0x4d5e9f(0xf4)];}export function setCachedCredential(_0x42cd68,_0x308692,_0x27af86){const _0x12e65e=a42_0x126c,_0xa09910=getCacheKey(_0x308692,_0x27af86);cache[_0x12e65e(0xea)](_0xa09910,{'apiKey':_0x42cd68,'loadedAt':Date[_0x12e65e(0xe8)]()});}export function clearCredentialCache(){cache['clear']();}export function clearCachedCredential(_0x9ee0c,_0x9fde1d){const _0x2c2ce3=a42_0x126c,_0x526c04=getCacheKey(_0x9ee0c,_0x9fde1d);cache[_0x2c2ce3(0xeb)](_0x526c04);}
|