@treasuredata/tdx 0.1.15 → 0.1.16
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/cli.js +1 -1
- package/dist/client/cdp-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-client.js +1 -1
- package/dist/client/trino-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/chat-command.js +1 -1
- package/dist/commands/claude-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/job-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.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/global-context.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.d.ts +1 -0
- package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/anthropic-adapter.js.map +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/database.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.js +1 -1
- package/dist/sdk/table.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/model-aliases.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/tree-formatter.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a27_0x11164a=a27_0x1258;function a27_0x1258(_0x3a67e2,_0x36bb2a){const _0x40c9b8=a27_0x40c9();return a27_0x1258=function(_0x125855,_0x5b77a9){_0x125855=_0x125855-0xba;let _0x30044c=_0x40c9b8[_0x125855];return _0x30044c;},a27_0x1258(_0x3a67e2,_0x36bb2a);}function a27_0x40c9(){const _0x38d5d5=['Context\x20cleared.\x20Back\x20to\x20root.','resolvePathToResource','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','segment','segmentPath','execute','Site:\x20','Usage:\x20tdx\x20segment\x20use\x20<path>','join','Parent\x20ID:\x20','Examples:','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','length','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','315845dfvnRa','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','329418mQJFbW','site','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','3771901KYplxa','slice','data','823616PTzfdh','description','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','parentName','14FRRZLj','log','folderId','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','verbose','Use:\x20tdx\x20segment\x20use\x20','segments','fullPath','parentId','type','Resolved\x20path\x20type:\x20','Resolving\x20path\x20\x27','session','Target\x20path:\x20','72gnzjvd','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','folderPath','26244252ymDVyH','name','Resolved\x20relative\x20path\x20to:\x20','949324YYtNFz','error','7542736VXjbGd'];a27_0x40c9=function(){return _0x38d5d5;};return a27_0x40c9();}(function(_0x3faf78,_0x26443d){const _0x37df89=a27_0x1258,_0x451c2d=_0x3faf78();while(!![]){try{const _0x1eb383=-parseInt(_0x37df89(0xd2))/0x1+-parseInt(_0x37df89(0xbe))/0x2*(parseInt(_0x37df89(0xe6))/0x3)+parseInt(_0x37df89(0xba))/0x4+-parseInt(_0x37df89(0xe4))/0x5*(-parseInt(_0x37df89(0xcc))/0x6)+-parseInt(_0x37df89(0xea))/0x7+-parseInt(_0x37df89(0xd4))/0x8+parseInt(_0x37df89(0xcf))/0x9;if(_0x1eb383===_0x26443d)break;else _0x451c2d['push'](_0x451c2d['shift']());}catch(_0x40221a){_0x451c2d['push'](_0x451c2d['shift']());}}}(a27_0x40c9,0xa6175));import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';export class SegmentUseCommand extends BaseCommand{[a27_0x11164a(0xd0)]='segment:use';[a27_0x11164a(0xbb)]=a27_0x11164a(0xe8);async[a27_0x11164a(0xdb)](_0x4932ad){const _0x5ceb23=a27_0x11164a,{options:_0x49b034,args:_0x1e5cee,tdx:_0x4ffeb6}=_0x4932ad;if(_0x1e5cee[_0x5ceb23(0xe2)]===0x0)return console['error']('Error:\x20Path\x20is\x20required'),console[_0x5ceb23(0xd3)](_0x5ceb23(0xdd)),console['error'](_0x5ceb23(0xe0)),console[_0x5ceb23(0xd3)](_0x5ceb23(0xc1)),console[_0x5ceb23(0xd3)](_0x5ceb23(0xe5)),console[_0x5ceb23(0xd3)](_0x5ceb23(0xe9)),console['error']('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x5a520d=_0x1e5cee[0x0],_0x22090f=_0x49b034[_0x5ceb23(0xca)];try{if(_0x5a520d==='/')return saveSessionContext({'segment_path':undefined},_0x22090f),console['log'](_0x5ceb23(0xd5)),0x0;const _0x5226de=_0x49b034[_0x5ceb23(0xda)];let _0x4705ae=_0x5a520d;const _0x3e4d42=parsePath(_0x5a520d);if(!_0x3e4d42['isAbsolute']){if(!_0x5226de)return console[_0x5ceb23(0xd3)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.'),console[_0x5ceb23(0xd3)](_0x5ceb23(0xcd)),0x1;if(_0x5a520d==='..'){const _0x5d4d0a=_0x5226de['split']('/')[_0x5ceb23(0xeb)](0x0,-0x1)[_0x5ceb23(0xde)]('/');_0x4705ae=_0x5d4d0a||'/';}else _0x5a520d==='.'?_0x4705ae=_0x5226de:_0x4705ae=_0x5226de+'/'+_0x5a520d;_0x49b034[_0x5ceb23(0xc2)]&&console[_0x5ceb23(0xd3)](_0x5ceb23(0xd1)+_0x4705ae);}if(_0x4705ae==='/'||_0x4705ae==='')return saveSessionContext({'segment_path':undefined},_0x22090f),console[_0x5ceb23(0xbf)](_0x5ceb23(0xd5)),0x0;_0x4705ae=normalizePath(_0x4705ae);const _0x53b865=parsePath(_0x4705ae)[_0x5ceb23(0xc4)];if(_0x53b865[_0x5ceb23(0xe2)]===0x0)return saveSessionContext({'segment_path':undefined},_0x22090f),console['log']('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;_0x49b034['verbose']&&(console[_0x5ceb23(0xd3)](_0x5ceb23(0xdc)+_0x49b034[_0x5ceb23(0xe7)]),console[_0x5ceb23(0xd3)](_0x5ceb23(0xcb)+_0x4705ae));const _0x4d99f1=await withSpinner(_0x5ceb23(0xc9)+_0x4705ae+'\x27...',()=>_0x4ffeb6[_0x5ceb23(0xd9)][_0x5ceb23(0xd6)](_0x4705ae),{'verbose':_0x49b034[_0x5ceb23(0xc2)]}),_0x17ff94=_0x4d99f1[_0x5ceb23(0xec)];_0x49b034[_0x5ceb23(0xc2)]&&(console[_0x5ceb23(0xd3)](_0x5ceb23(0xc8)+_0x17ff94[_0x5ceb23(0xc7)]),console['error'](_0x5ceb23(0xdf)+_0x17ff94[_0x5ceb23(0xc6)]),_0x17ff94[_0x5ceb23(0xc0)]&&console[_0x5ceb23(0xd3)]('Folder\x20ID:\x20'+_0x17ff94['folderId']));if(_0x17ff94[_0x5ceb23(0xc7)]==='segment')return console[_0x5ceb23(0xd3)](_0x5ceb23(0xbc)),console[_0x5ceb23(0xd3)](_0x5ceb23(0xe1)),console[_0x5ceb23(0xd3)](_0x5ceb23(0xc3)+_0x17ff94['parentName']+(_0x17ff94['folderPath']?'/'+_0x17ff94[_0x5ceb23(0xce)]['join']('/'):'')),0x1;return saveSessionContext({'segment_path':_0x17ff94[_0x5ceb23(0xc5)],'parent_segment':_0x17ff94[_0x5ceb23(0xbd)]},_0x22090f),console[_0x5ceb23(0xbf)]('Context\x20set\x20to:\x20'+_0x17ff94[_0x5ceb23(0xc5)]),_0x49b034[_0x5ceb23(0xc2)]&&(console[_0x5ceb23(0xd3)](_0x5ceb23(0xd8)),console[_0x5ceb23(0xd3)](_0x5ceb23(0xd7)),console[_0x5ceb23(0xd3)](_0x5ceb23(0xe3))),0x0;}catch(_0x278f8c){throw _0x278f8c;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a28_0x34baa7=a28_0x2f66;(function(_0x1eab11,_0x5694af){const _0x4d3c33=a28_0x2f66,_0x473b8d=_0x1eab11();while(!![]){try{const _0x58e2b0=-parseInt(_0x4d3c33(0x21d))/0x1+-parseInt(_0x4d3c33(0x1f3))/0x2*(-parseInt(_0x4d3c33(0x20f))/0x3)+-parseInt(_0x4d3c33(0x223))/0x4+parseInt(_0x4d3c33(0x20b))/0x5*(-parseInt(_0x4d3c33(0x21f))/0x6)+-parseInt(_0x4d3c33(0x210))/0x7*(parseInt(_0x4d3c33(0x1e9))/0x8)+parseInt(_0x4d3c33(0x222))/0x9+parseInt(_0x4d3c33(0x209))/0xa;if(_0x58e2b0===_0x5694af)break;else _0x473b8d['push'](_0x473b8d['shift']());}catch(_0x1ea52f){_0x473b8d['push'](_0x473b8d['shift']());}}}(a28_0x4f7b,0xa4811));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a28_0x2f66(_0xe58cb1,_0x1a82b3){const _0x4f7b3e=a28_0x4f7b();return a28_0x2f66=function(_0x2f6676,_0xb75d8){_0x2f6676=_0x2f6676-0x1e5;let _0x130d4f=_0x4f7b3e[_0x2f6676];return _0x130d4f;},a28_0x2f66(_0xe58cb1,_0x1a82b3);}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 a28_0x2df25f from'chalk';export class SegmentsCommand extends BaseCommand{[a28_0x34baa7(0x202)]=a28_0x34baa7(0x1ff);['description']='List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments';async[a28_0x34baa7(0x216)](_0x42f665){const _0x448f4b=a28_0x34baa7,{options:_0x3e93f5,args:_0x4389d3}=_0x42f665,_0x4d8630=_0x3e93f5[_0x448f4b(0x1ef)],_0x5c861e=_0x4389d3[0x0];try{const _0x5c9e56=_0x3e93f5['segmentPath'];_0x3e93f5[_0x448f4b(0x20c)]&&(console[_0x448f4b(0x208)]('Site:\x20'+_0x3e93f5[_0x448f4b(0x1ee)]),console[_0x448f4b(0x208)]('Current\x20context:\x20'+(_0x5c9e56||'/')),_0x5c861e&&console['error'](_0x448f4b(0x1ed)+_0x5c861e),_0x4d8630&&console[_0x448f4b(0x208)]('Recursive\x20mode:\x20enabled'));if(_0x5c861e){const _0x5d1a16=_0x5c861e['includes']('*')||_0x5c861e['includes']('?');if(_0x5d1a16&&!_0x5c9e56)return await this[_0x448f4b(0x1fa)](_0x42f665,_0x5c861e);else return _0x5d1a16?(console[_0x448f4b(0x208)](_0x448f4b(0x214)),console[_0x448f4b(0x208)]('Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/'),0x1):_0x4d8630?await this[_0x448f4b(0x20d)](_0x42f665,_0x5c861e):await this['listUnified'](_0x42f665,_0x5c861e);}if(!_0x5c9e56)return await this[_0x448f4b(0x213)](_0x42f665);return _0x4d8630?await this['listRecursive'](_0x42f665,_0x5c9e56):await this[_0x448f4b(0x1e8)](_0x42f665,_0x5c9e56);}catch(_0x5375d9){if(_0x5375d9 instanceof SDKError)return console[_0x448f4b(0x208)](_0x448f4b(0x1f4)+_0x5375d9[_0x448f4b(0x1f0)]),_0x5375d9[_0x448f4b(0x1f6)]&&console['error'](_0x448f4b(0x217)+_0x5375d9[_0x448f4b(0x1f6)]),0x1;throw _0x5375d9;}}async[a28_0x34baa7(0x1fa)](_0x44839d,_0x20460c){const _0x14607a=a28_0x34baa7,{options:_0x2e06ef,tdx:_0x5dfec7}=_0x44839d,_0x1a0b19=await withSpinner(_0x14607a(0x1fb)+_0x20460c+'\x27...',()=>_0x5dfec7[_0x14607a(0x224)][_0x14607a(0x213)](),{'verbose':_0x2e06ef['verbose']}),_0x96f0b9=_0x1a0b19['data'],_0x4a2e02=_0x20460c[_0x14607a(0x201)](/[.+^${}()|[\]\\]/g,_0x14607a(0x21e))[_0x14607a(0x201)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x1b9650=new RegExp('^'+_0x4a2e02+'$','i'),_0x169ef7=_0x96f0b9[_0x14607a(0x1e5)](_0x4c571f=>_0x1b9650[_0x14607a(0x1f1)](_0x4c571f[_0x14607a(0x1ea)]['name']));console[_0x14607a(0x208)]('✔\x20Found\x20'+_0x169ef7[_0x14607a(0x21b)]+'\x20parent\x20segment'+(_0x169ef7[_0x14607a(0x21b)]!==0x1?'s':'')+_0x14607a(0x20a)+_0x20460c+'\x27');if(_0x2e06ef[_0x14607a(0x211)]===_0x14607a(0x221)||_0x2e06ef[_0x14607a(0x211)]===_0x14607a(0x219))await handleSDKOutput(_0x169ef7,_0x2e06ef);else{if(_0x169ef7['length']===0x0)console[_0x14607a(0x1ec)](_0x14607a(0x1f2)+_0x20460c);else{console['log'](_0x14607a(0x21a));for(const _0x1272dd of _0x169ef7){const _0x37fd17=_0x1272dd[_0x14607a(0x1ea)][_0x14607a(0x1fc)]?a28_0x2df25f[_0x14607a(0x205)]('\x20('+formatRows(_0x1272dd[_0x14607a(0x1ea)][_0x14607a(0x1fc)])+')'):'';console[_0x14607a(0x1ec)]('👥\x20'+_0x1272dd[_0x14607a(0x1ea)][_0x14607a(0x202)]+_0x37fd17);}}}return 0x0;}async[a28_0x34baa7(0x213)](_0x55ce6e){const _0x5d4b46=a28_0x34baa7,{options:_0x1f75f8,tdx:_0x5b9d1e}=_0x55ce6e,_0x27768d=await withSpinner(_0x5d4b46(0x204),()=>_0x5b9d1e[_0x5d4b46(0x224)][_0x5d4b46(0x213)](),{'verbose':_0x1f75f8['verbose']}),_0x5ea374=_0x27768d['data'];console['error']('✔\x20Found\x20'+_0x5ea374[_0x5d4b46(0x21b)]+'\x20parent\x20segment'+(_0x5ea374[_0x5d4b46(0x21b)]!==0x1?'s':''));if(_0x1f75f8['format']===_0x5d4b46(0x221)||_0x1f75f8[_0x5d4b46(0x211)]==='jsonl')await handleSDKOutput(_0x5ea374,_0x1f75f8);else{console[_0x5d4b46(0x1ec)](_0x5d4b46(0x21a));for(const _0x3b7c83 of _0x5ea374){const _0x2e9ade=_0x3b7c83[_0x5d4b46(0x1ea)][_0x5d4b46(0x1fc)]?a28_0x2df25f[_0x5d4b46(0x205)]('\x20('+formatRows(_0x3b7c83[_0x5d4b46(0x1ea)][_0x5d4b46(0x1fc)])+')'):'';console['log'](_0x5d4b46(0x1f8)+_0x3b7c83['attributes'][_0x5d4b46(0x202)]+_0x2e9ade);}}return 0x0;}async['listUnified'](_0x1cc21d,_0x1120e9){const _0x18849d=a28_0x34baa7,{options:_0x438bf0,tdx:_0x283ee7}=_0x1cc21d,_0x301f07=await withSpinner(_0x18849d(0x218)+_0x1120e9+'\x27...',()=>_0x283ee7[_0x18849d(0x224)]['resolvePathToResource'](_0x1120e9),{'verbose':_0x438bf0[_0x18849d(0x20c)]}),_0x3c991c=_0x301f07[_0x18849d(0x1fe)];_0x438bf0[_0x18849d(0x20c)]&&(console[_0x18849d(0x208)](_0x18849d(0x1f9)+_0x3c991c[_0x18849d(0x200)]),_0x3c991c[_0x18849d(0x20e)]&&console[_0x18849d(0x208)](_0x18849d(0x207)+_0x3c991c[_0x18849d(0x20e)]));const _0x1e75d2=await withSpinner(_0x18849d(0x212),()=>_0x283ee7[_0x18849d(0x224)][_0x18849d(0x1e8)](_0x3c991c['parentId'],_0x3c991c[_0x18849d(0x20e)]),{'verbose':_0x438bf0['verbose']}),{folders:_0x36e239,segments:_0x586df0}=_0x1e75d2[_0x18849d(0x1fe)],_0x2ff133=_0x36e239[_0x18849d(0x21b)]+_0x586df0['length'];console[_0x18849d(0x208)](_0x18849d(0x206)+_0x36e239[_0x18849d(0x21b)]+'\x20folder'+(_0x36e239['length']!==0x1?'s':'')+'\x20and\x20'+_0x586df0[_0x18849d(0x21b)]+_0x18849d(0x220)+(_0x586df0['length']!==0x1?'s':''));if(_0x438bf0[_0x18849d(0x211)]===_0x18849d(0x221)||_0x438bf0[_0x18849d(0x211)]===_0x18849d(0x219)){const _0xabccc2=[..._0x36e239['map'](_0x2d07f3=>({..._0x2d07f3,'type':_0x18849d(0x203)})),..._0x586df0[_0x18849d(0x1e7)](_0x2d6517=>({..._0x2d6517,'type':_0x18849d(0x224)}))][_0x18849d(0x215)]((_0x586aeb,_0x3c79f1)=>_0x586aeb[_0x18849d(0x202)][_0x18849d(0x1e6)](_0x3c79f1[_0x18849d(0x202)]));await handleSDKOutput(_0xabccc2,_0x438bf0);}else{if(_0x2ff133===0x0)console[_0x18849d(0x1ec)](a28_0x2df25f[_0x18849d(0x205)]('[/'+_0x1120e9+']')),console[_0x18849d(0x1ec)](_0x18849d(0x21c));else{console[_0x18849d(0x1ec)](a28_0x2df25f[_0x18849d(0x205)]('[/'+_0x1120e9+']'));const _0xd3286a=formatFlatList(_0x36e239,_0x586df0,{'showMetadata':!![]});console[_0x18849d(0x1ec)](_0xd3286a);}}return 0x0;}async[a28_0x34baa7(0x20d)](_0x3e896f,_0x3fd5e6){const _0x5900e9=a28_0x34baa7,{options:_0x30f81e,tdx:_0x1c248a}=_0x3e896f,_0x4c4d54=await withSpinner('Resolving\x20context\x20path\x20\x27'+_0x3fd5e6+_0x5900e9(0x1eb),()=>_0x1c248a[_0x5900e9(0x224)]['resolvePathToResource'](_0x3fd5e6),{'verbose':_0x30f81e[_0x5900e9(0x20c)]}),_0xb6f80e=_0x4c4d54[_0x5900e9(0x1fe)];_0x30f81e['verbose']&&(console[_0x5900e9(0x208)](_0x5900e9(0x1f9)+_0xb6f80e[_0x5900e9(0x200)]),_0xb6f80e[_0x5900e9(0x20e)]&&console['error'](_0x5900e9(0x207)+_0xb6f80e[_0x5900e9(0x20e)]));const _0x58eb8c=_0x30f81e[_0x5900e9(0x1f5)]||0xa,_0x2395d1=await withSpinner(_0x5900e9(0x1fd),()=>_0x1c248a[_0x5900e9(0x224)]['listRecursive'](_0xb6f80e['parentId'],_0xb6f80e['folderId'],0x0,_0x58eb8c),{'verbose':_0x30f81e['verbose']}),_0x5456ff=_0x2395d1['data'];console[_0x5900e9(0x208)]('✔\x20Built\x20tree\x20with\x20'+_0x5456ff[_0x5900e9(0x21b)]+_0x5900e9(0x1f7));if(_0x30f81e['format']===_0x5900e9(0x221)||_0x30f81e[_0x5900e9(0x211)]===_0x5900e9(0x219))await handleSDKOutput(_0x5456ff,_0x30f81e);else{console[_0x5900e9(0x1ec)](a28_0x2df25f['dim']('[/'+_0x3fd5e6+']'));const _0x21e9f8=formatTree(_0x5456ff,{'showMetadata':!![]});console[_0x5900e9(0x1ec)](_0x21e9f8);}return 0x0;}}function a28_0x4f7b(){const _0x414a2b=['json','1033128TvGSWU','196964vFfxoU','segment','filter','localeCompare','map','listUnified','1827792NDTmMP','attributes','\x27...','log','Path/pattern\x20arg:\x20','site','recursive','message','test','No\x20parent\x20segments\x20match\x20pattern:\x20','2FhmmDq','Error:\x20','maxDepth','cause','\x20top-level\x20items','👥\x20','Parent\x20ID:\x20','listParentsWithPattern','Listing\x20parent\x20segments\x20matching\x20\x27','population','Building\x20hierarchy\x20tree...','data','segments','parentId','replace','name','folder','Listing\x20parent\x20segments...','dim','✔\x20Found\x20','Folder\x20ID:\x20','error','16259330uxSGmS','\x20matching\x20\x27','1996525RauyxL','verbose','listRecursive','folderId','1510503NoZhfW','28ZMTIop','format','Listing\x20folders\x20and\x20segments...','listParents','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','sort','execute','\x20\x20Cause:\x20','Resolving\x20context\x20path\x20\x27','jsonl','[parent\x20segments]','length','(empty)','207975zQxrZM','\x5c$&','6gVOhdZ','\x20segment'];a28_0x4f7b=function(){return _0x414a2b;};return a28_0x4f7b();}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a29_0x461745=a29_0x14f2;function a29_0x4cf8(){const _0x5868a0=['Database:\x20','verbose','Table:\x20','args','\x20\x20Cause:\x20','743788VirWwJ','Limit:\x20','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','database','length','table','data','\x20row','2438530wBHMrg','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','1521xiXsrb','843270kbQzOd','1848300tJDkbE','272964DjXaGF','Show\x20table\x20contents','message','Querying\x20','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','cause','show','showTable','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','validate','\x20from\x20','name','error','limit','Site:\x20','23224ORwiSU','Usage:\x20tdx\x20show\x20<database.table>','execute','68968lVuGOl','Error:\x20','21AltEYW','site'];a29_0x4cf8=function(){return _0x5868a0;};return a29_0x4cf8();}(function(_0xc44888,_0x25c752){const _0x1eff81=a29_0x14f2,_0x5e82e7=_0xc44888();while(!![]){try{const _0xa718aa=parseInt(_0x1eff81(0x1b1))/0x1+parseInt(_0x1eff81(0x1ba))/0x2+-parseInt(_0x1eff81(0x1c7))/0x3+parseInt(_0x1eff81(0x1c6))/0x4+-parseInt(_0x1eff81(0x1c2))/0x5+parseInt(_0x1eff81(0x1c5))/0x6*(parseInt(_0x1eff81(0x1b3))/0x7)+parseInt(_0x1eff81(0x1ae))/0x8*(-parseInt(_0x1eff81(0x1c4))/0x9);if(_0xa718aa===_0x25c752)break;else _0x5e82e7['push'](_0x5e82e7['shift']());}catch(_0x3367aa){_0x5e82e7['push'](_0x5e82e7['shift']());}}}(a29_0x4cf8,0x3e527));import{BaseCommand}from'./command.js';function a29_0x14f2(_0x509498,_0x3439b4){const _0x4cf884=a29_0x4cf8();return a29_0x14f2=function(_0x14f26c,_0x3023cf){_0x14f26c=_0x14f26c-0x1a6;let _0x457882=_0x4cf884[_0x14f26c];return _0x457882;},a29_0x14f2(_0x509498,_0x3439b4);}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class ShowCommand extends BaseCommand{[a29_0x461745(0x1aa)]=a29_0x461745(0x1cd);['description']=a29_0x461745(0x1c8);async[a29_0x461745(0x1b0)](_0x2729bf){const _0x51ac5a=a29_0x461745;return this[_0x51ac5a(0x1a6)](_0x2729bf);}async['showTable'](_0x4eefe7){const _0x23382f=a29_0x461745,{options:_0x3a7ef6,args:_0x31f914,tdx:_0x2f861a}=_0x4eefe7;let _0x47172a;try{_0x47172a=parseTableReference(_0x31f914[0x0]);const _0xee5188=_0x3a7ef6['database'];!_0x47172a[_0x23382f(0x1bd)]&&_0xee5188&&(_0x47172a[_0x23382f(0x1bd)]=_0xee5188);const _0x4e5ea4=validateTableDescribeReference(_0x47172a);if(_0x4e5ea4)return console[_0x23382f(0x1ab)](_0x23382f(0x1b2)+_0x4e5ea4),console[_0x23382f(0x1ab)](_0x23382f(0x1af)),console[_0x23382f(0x1ab)](_0x23382f(0x1c3)),console[_0x23382f(0x1ab)](_0x23382f(0x1cb)),0x1;}catch(_0x1f5f10){return console[_0x23382f(0x1ab)](_0x23382f(0x1b2)+_0x1f5f10[_0x23382f(0x1c9)]),console[_0x23382f(0x1ab)](_0x23382f(0x1af)),console[_0x23382f(0x1ab)](_0x23382f(0x1c3)),console['error'](_0x23382f(0x1cb)),0x1;}const _0x1abd27=_0x47172a['catalog'],_0x53b250=_0x47172a[_0x23382f(0x1bd)],_0x520768=_0x47172a[_0x23382f(0x1bf)],_0x4a3259=_0x3a7ef6[_0x23382f(0x1ac)];try{_0x3a7ef6[_0x23382f(0x1b6)]&&(console[_0x23382f(0x1ab)](_0x23382f(0x1ad)+_0x3a7ef6[_0x23382f(0x1b4)]),_0x1abd27&&console[_0x23382f(0x1ab)]('Catalog:\x20'+_0x1abd27),console[_0x23382f(0x1ab)](_0x23382f(0x1b5)+_0x53b250),console['error'](_0x23382f(0x1b7)+_0x520768),console[_0x23382f(0x1ab)](_0x23382f(0x1bb)+_0x4a3259));const _0x25dde7=_0x1abd27?_0x1abd27+'.'+_0x53b250+'.'+_0x520768:_0x53b250+'.'+_0x520768,_0x737159=await withSpinner(_0x23382f(0x1ca)+_0x25dde7+'...',()=>_0x2f861a[_0x23382f(0x1bf)][_0x23382f(0x1cd)](_0x53b250,_0x520768,_0x4a3259,_0x1abd27),{'verbose':_0x3a7ef6[_0x23382f(0x1b6)]}),_0x9d8686=_0x737159[_0x23382f(0x1c0)],_0x41cece=_0x9d8686['data'];return _0x41cece[_0x23382f(0x1be)]===0x0?console[_0x23382f(0x1ab)](_0x23382f(0x1bc)):console['error']('✔\x20Retrieved\x20'+_0x41cece[_0x23382f(0x1be)]+_0x23382f(0x1c1)+(_0x41cece[_0x23382f(0x1be)]!==0x1?'s':'')+_0x23382f(0x1a9)+_0x25dde7),await handleSDKOutput(_0x41cece,_0x3a7ef6),0x0;}catch(_0x110f5f){if(_0x110f5f instanceof SDKError)return console[_0x23382f(0x1ab)](_0x23382f(0x1b2)+_0x110f5f[_0x23382f(0x1c9)]),_0x110f5f['cause']&&console[_0x23382f(0x1ab)](_0x23382f(0x1b9)+_0x110f5f[_0x23382f(0x1cc)]),0x1;throw _0x110f5f;}}[a29_0x461745(0x1a8)](_0x30ec61){const _0x23e8ab=a29_0x461745;if(_0x30ec61['args'][_0x23e8ab(0x1be)]===0x0)return _0x23e8ab(0x1a7);if(_0x30ec61[_0x23e8ab(0x1b8)][_0x23e8ab(0x1be)]>0x1)return'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';return undefined;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a30_0x4004(){const _0x26827f=['validate','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','Error:\x20','.*\x22','cause','list','Database\x20pattern:\x20','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','Database:\x20','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','\x20\x20Use:\x20tdx\x20tables\x20\x22','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','verbose','300IAbnyF','length','\x20table','site','277096OQAWIO','description','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','473886WeKePZ','357302BGNhtr','error','Note:\x20\x27','27ehDIpC','execute','table','\x27\x20across\x20all\x20databases.','includes','name','1250136mZefHL','450366Cmjbrp','✖\x20No\x20tables\x20found','Listing\x20tables...','tables','3308207poTwum','55adFhob','18296qpxvwt','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','database','message','219OREUTS','✔\x20Found\x20','Table\x20pattern:\x20','data'];a30_0x4004=function(){return _0x26827f;};return a30_0x4004();}const a30_0x132627=a30_0x5284;function a30_0x5284(_0x4eb0fa,_0x146682){const _0x4004da=a30_0x4004();return a30_0x5284=function(_0x5284b0,_0x138ad7){_0x5284b0=_0x5284b0-0xcc;let _0x2e9a17=_0x4004da[_0x5284b0];return _0x2e9a17;},a30_0x5284(_0x4eb0fa,_0x146682);}(function(_0x34bc5d,_0x10ab6b){const _0x33eda3=a30_0x5284,_0x27d77b=_0x34bc5d();while(!![]){try{const _0x30f8fd=parseInt(_0x33eda3(0xd5))/0x1+-parseInt(_0x33eda3(0xe3))/0x2+parseInt(_0x33eda3(0xee))/0x3*(-parseInt(_0x33eda3(0xe9))/0x4)+parseInt(_0x33eda3(0xe8))/0x5*(parseInt(_0x33eda3(0xd8))/0x6)+parseInt(_0x33eda3(0xe7))/0x7+parseInt(_0x33eda3(0xe2))/0x8*(parseInt(_0x33eda3(0xdc))/0x9)+-parseInt(_0x33eda3(0xd1))/0xa*(parseInt(_0x33eda3(0xd9))/0xb);if(_0x30f8fd===_0x10ab6b)break;else _0x27d77b['push'](_0x27d77b['shift']());}catch(_0x2cca15){_0x27d77b['push'](_0x27d77b['shift']());}}}(a30_0x4004,0x87310));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a30_0x132627(0xe1)]=a30_0x132627(0xe6);[a30_0x132627(0xd6)]='List\x20tables\x20in\x20a\x20database';async[a30_0x132627(0xdd)](_0x1572f4){const _0x1f80ae=a30_0x132627,{options:_0x32e0c6,args:_0x51d474,tdx:_0x52b47e}=_0x1572f4;let _0x1e65b8;if(_0x51d474[_0x1f80ae(0xd2)]===0x0)_0x1e65b8={'database':undefined,'table':undefined,'original':''};else{if(_0x51d474[_0x1f80ae(0xd2)]===0x1)try{_0x1e65b8=parseTableReference(_0x51d474[0x0]);if(_0x1e65b8['table']&&!_0x1e65b8[_0x1f80ae(0xec)]&&!_0x1e65b8[_0x1f80ae(0xde)]['includes']('*')&&!_0x1e65b8[_0x1f80ae(0xde)]['includes']('?'))return console[_0x1f80ae(0xda)]('Error:\x20Pattern\x20\x27'+_0x51d474[0x0]+'\x27\x20is\x20ambiguous.'),console['error'](_0x1f80ae(0xd7)+_0x1e65b8[_0x1f80ae(0xde)]+'\x27?'),console['error'](_0x1f80ae(0xce)+_0x1e65b8[_0x1f80ae(0xde)]+_0x1f80ae(0xf5)),console[_0x1f80ae(0xda)]('\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'+_0x1e65b8[_0x1f80ae(0xde)]),console['error']('\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20'+_0x1e65b8[_0x1f80ae(0xde)]),console[_0x1f80ae(0xda)](''),console[_0x1f80ae(0xda)](_0x1f80ae(0xdb)+_0x51d474[0x0]+'\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27'+_0x1e65b8[_0x1f80ae(0xde)]+_0x1f80ae(0xdf)),0x1;}catch(_0xcfc31a){return console[_0x1f80ae(0xda)](_0x1f80ae(0xf4)+_0xcfc31a[_0x1f80ae(0xed)]),0x1;}else return console[_0x1f80ae(0xda)](_0x1f80ae(0xeb)),console[_0x1f80ae(0xda)](_0x1f80ae(0xea)),console['error'](_0x1f80ae(0xcd)),console[_0x1f80ae(0xda)](_0x1f80ae(0xcf)),console[_0x1f80ae(0xda)](_0x1f80ae(0xf3)),console[_0x1f80ae(0xda)]('Or\x20use\x20--in\x20flag:'),console[_0x1f80ae(0xda)]('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0xfa84df=_0x32e0c6[_0x1f80ae(0xec)];!_0x1e65b8[_0x1f80ae(0xec)]&&_0xfa84df&&(_0x1e65b8[_0x1f80ae(0xec)]=_0xfa84df);try{const _0x5f1bac=_0x6313dc=>_0x6313dc&&(_0x6313dc[_0x1f80ae(0xe0)]('*')||_0x6313dc[_0x1f80ae(0xe0)]('?')),_0x520e75=_0x5f1bac(_0x1e65b8['database']);_0x32e0c6[_0x1f80ae(0xd0)]&&(console[_0x1f80ae(0xda)]('Site:\x20'+_0x32e0c6[_0x1f80ae(0xd4)]),_0x1e65b8[_0x1f80ae(0xec)]?_0x520e75?console[_0x1f80ae(0xda)](_0x1f80ae(0xf8)+_0x1e65b8[_0x1f80ae(0xec)]):console[_0x1f80ae(0xda)](_0x1f80ae(0xcc)+_0x1e65b8[_0x1f80ae(0xec)]):console[_0x1f80ae(0xda)]('Database:\x20all'),_0x1e65b8[_0x1f80ae(0xde)]&&console[_0x1f80ae(0xda)](_0x1f80ae(0xf0)+_0x1e65b8['table']));const _0x283565=_0x1e65b8[_0x1f80ae(0xec)]&&!_0x520e75?_0x1e65b8[_0x1f80ae(0xec)]:undefined,_0x52cfc1=_0x520e75?_0x1e65b8[_0x1f80ae(0xec)]:undefined,_0x3452bb=_0x1e65b8['table'],_0xd0945c=await withSpinner(_0x1f80ae(0xe5),()=>_0x52b47e['table'][_0x1f80ae(0xf7)](_0x283565,_0x3452bb,_0x52cfc1),{'verbose':_0x32e0c6[_0x1f80ae(0xd0)]}),_0x161c23=_0xd0945c[_0x1f80ae(0xf1)];if(_0x161c23['length']===0x0&&_0x1e65b8[_0x1f80ae(0xec)]&&!_0x520e75)return console[_0x1f80ae(0xda)](_0x1f80ae(0xe4)),console['error']('Database\x20\x27'+_0x1e65b8[_0x1f80ae(0xec)]+_0x1f80ae(0xf9)),0x1;return console[_0x1f80ae(0xda)](_0x1f80ae(0xef)+_0x161c23[_0x1f80ae(0xd2)]+_0x1f80ae(0xd3)+(_0x161c23['length']!==0x1?'s':'')),await handleSDKOutput(_0x161c23,_0x32e0c6),0x0;}catch(_0x271898){if(_0x271898 instanceof SDKError)return console['error']('Error:\x20'+_0x271898[_0x1f80ae(0xed)]),_0x271898['cause']&&console['error']('\x20\x20Cause:\x20'+_0x271898[_0x1f80ae(0xf6)]),0x1;throw _0x271898;}}[a30_0x132627(0xf2)](_0x13c38a){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a31_0x2044(_0x9b03a3,_0x17e313){const _0x213f63=a31_0x213f();return a31_0x2044=function(_0x20447f,_0x2123dd){_0x20447f=_0x20447f-0x172;let _0x306ad4=_0x213f63[_0x20447f];return _0x306ad4;},a31_0x2044(_0x9b03a3,_0x17e313);}const a31_0x1613dd=a31_0x2044;function a31_0x213f(){const _0x326654=['validate','join','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','execute','Session\x20database\x20set\x20to:\x20','5768yvWHoZ','9rcldlP','Invalid\x20resource:\x20','toString','1206340brihrx','5399530xRzKKG','Session\x20llm_project\x20set\x20to:\x20','699014XQRHAW','245pFwUUO','description','session','includes','llm_project','3sQhFzT','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','6109776fcYpjB','Error:\x20Profile\x20\x27','parent_segment','log','\x27\x20does\x20not\x20exist','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','use','error','Error:\x20','41556053gLPteL','2100744mvMgVD','profile','database','\x20(session:\x20','.\x20Must\x20be\x20one\x20of:\x20','length','name','28jIAIYH','Session\x20profile\x20set\x20to:\x20'];a31_0x213f=function(){return _0x326654;};return a31_0x213f();}(function(_0x18fd28,_0x436ec0){const _0x3ffc30=a31_0x2044,_0x1ca7ef=_0x18fd28();while(!![]){try{const _0x1569a8=-parseInt(_0x3ffc30(0x192))/0x1+-parseInt(_0x3ffc30(0x195))/0x2*(parseInt(_0x3ffc30(0x174))/0x3)+parseInt(_0x3ffc30(0x18e))/0x4*(parseInt(_0x3ffc30(0x196))/0x5)+-parseInt(_0x3ffc30(0x176))/0x6+parseInt(_0x3ffc30(0x187))/0x7*(-parseInt(_0x3ffc30(0x180))/0x8)+-parseInt(_0x3ffc30(0x18f))/0x9*(-parseInt(_0x3ffc30(0x193))/0xa)+parseInt(_0x3ffc30(0x17f))/0xb;if(_0x1569a8===_0x436ec0)break;else _0x1ca7ef['push'](_0x1ca7ef['shift']());}catch(_0x17837e){_0x1ca7ef['push'](_0x1ca7ef['shift']());}}}(a31_0x213f,0xba80f));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';import{profileExists}from'../core/profile.js';export class UseCommand extends BaseCommand{[a31_0x1613dd(0x186)]=a31_0x1613dd(0x17c);[a31_0x1613dd(0x197)]='Set\x20session-level\x20context';[a31_0x1613dd(0x189)](_0xa54840){const _0x622c10=a31_0x1613dd,{args:_0x175d6b}=_0xa54840;if(_0x175d6b[_0x622c10(0x185)]<0x2)return _0x622c10(0x18b)+'Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a'+'Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a'+_0x622c10(0x17b);const _0x46a0d4=_0x175d6b[0x0],_0x44505c=[_0x622c10(0x182),_0x622c10(0x178),_0x622c10(0x173),_0x622c10(0x181)];if(!_0x44505c[_0x622c10(0x172)](_0x46a0d4))return _0x622c10(0x190)+_0x46a0d4+_0x622c10(0x184)+_0x44505c[_0x622c10(0x18a)](',\x20');return undefined;}async[a31_0x1613dd(0x18c)](_0xab0fc7){const _0x1acc5c=a31_0x1613dd,{args:_0xd6bed6,options:_0xaeda1c}=_0xab0fc7;try{const _0x2c6bfd=_0xd6bed6[0x0],_0x2b7c5e=_0xd6bed6[0x1];if(_0x2c6bfd===_0x1acc5c(0x181)){if(!profileExists(_0x2b7c5e))return console[_0x1acc5c(0x17d)](_0x1acc5c(0x177)+_0x2b7c5e+_0x1acc5c(0x17a)),console['error']('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x46df0e=_0xaeda1c[_0x1acc5c(0x198)]||getCurrentSessionPID()[_0x1acc5c(0x191)]();return saveSessionContext({'profile':_0x2b7c5e},_0xaeda1c[_0x1acc5c(0x198)]),console[_0x1acc5c(0x179)](_0x1acc5c(0x188)+_0x2b7c5e+_0x1acc5c(0x183)+_0x46df0e+')'),console['log'](_0x1acc5c(0x175)),0x0;}const _0x49561a={},_0x5ca48=_0xaeda1c['session']||getCurrentSessionPID()[_0x1acc5c(0x191)]();switch(_0x2c6bfd){case _0x1acc5c(0x182):_0x49561a[_0x1acc5c(0x182)]=_0x2b7c5e,console[_0x1acc5c(0x179)](_0x1acc5c(0x18d)+_0x2b7c5e+_0x1acc5c(0x183)+_0x5ca48+')');break;case _0x1acc5c(0x178):_0x49561a[_0x1acc5c(0x178)]=_0x2b7c5e,console[_0x1acc5c(0x179)]('Session\x20parent_segment\x20set\x20to:\x20'+_0x2b7c5e+'\x20(session:\x20'+_0x5ca48+')');break;case _0x1acc5c(0x173):_0x49561a['llm_project']=_0x2b7c5e,console['log'](_0x1acc5c(0x194)+_0x2b7c5e+'\x20(session:\x20'+_0x5ca48+')');break;}return saveSessionContext(_0x49561a,_0xaeda1c[_0x1acc5c(0x198)]),console[_0x1acc5c(0x179)](_0x1acc5c(0x175)),0x0;}catch(_0x1e69dd){return _0x1e69dd instanceof Error&&console[_0x1acc5c(0x17d)](_0x1acc5c(0x17e)+_0x1e69dd['message']),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a32_0x1beda1=a32_0x3086;(function(_0x2fd3cc,_0x526b3f){const _0x5ba895=a32_0x3086,_0x2f9f75=_0x2fd3cc();while(!![]){try{const _0x3eb4b4=parseInt(_0x5ba895(0xa5))/0x1+-parseInt(_0x5ba895(0x89))/0x2+parseInt(_0x5ba895(0xdd))/0x3+parseInt(_0x5ba895(0xfd))/0x4*(parseInt(_0x5ba895(0xb8))/0x5)+-parseInt(_0x5ba895(0xe9))/0x6+parseInt(_0x5ba895(0x97))/0x7*(-parseInt(_0x5ba895(0xe2))/0x8)+parseInt(_0x5ba895(0xf8))/0x9;if(_0x3eb4b4===_0x526b3f)break;else _0x2f9f75['push'](_0x2f9f75['shift']());}catch(_0x36aad4){_0x2f9f75['push'](_0x2f9f75['shift']());}}}(a32_0x1186,0x532d3));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';export class WorkflowProjectsCommand extends BaseCommand{[a32_0x1beda1(0x92)]='workflow:projects';['description']=a32_0x1beda1(0x8b);async['execute'](_0x1a95db){const _0x245293=a32_0x1beda1,{options:_0x5b7c39,args:_0x29b04a,tdx:_0x172190}=_0x1a95db,_0x10a886=_0x29b04a[0x0];try{_0x5b7c39[_0x245293(0xa2)]&&_0x10a886&&console[_0x245293(0xba)]('Pattern:\x20'+_0x10a886);const _0xa905f7=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x172190[_0x245293(0xcc)]['projects'](_0x10a886,{'limit':_0x5b7c39[_0x245293(0xaa)]}),{'verbose':_0x5b7c39[_0x245293(0xa2)]}),_0x57fc43=_0xa905f7[_0x245293(0xdf)];return console[_0x245293(0xba)]('✔\x20Found\x20'+_0x57fc43['length']+'\x20project'+(_0x57fc43[_0x245293(0xa7)]!==0x1?'s':'')),await handleSDKOutput(_0x57fc43,_0x5b7c39),0x0;}catch(_0x32ef27){if(_0x32ef27 instanceof SDKError)return console[_0x245293(0xba)]('Error:\x20'+_0x32ef27[_0x245293(0xe0)]),_0x32ef27['cause']&&console[_0x245293(0xba)](_0x245293(0xaf)+_0x32ef27[_0x245293(0xd6)]),0x1;throw _0x32ef27;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a32_0x1beda1(0x92)]=a32_0x1beda1(0x96);['description']='List\x20workflows';async['execute'](_0x4cc66a){const _0x4a261b=a32_0x1beda1,{options:_0x15ac58,args:_0x88dab3,tdx:_0x51b37a}=_0x4cc66a,_0x1dd055=_0x88dab3[0x0];try{_0x15ac58['verbose']&&_0x1dd055&&console[_0x4a261b(0xba)]('Project\x20filter:\x20'+_0x1dd055);const _0xde1583=await withSpinner(_0x4a261b(0xd4),()=>_0x51b37a[_0x4a261b(0xcc)][_0x4a261b(0xe5)](_0x1dd055,{'limit':_0x15ac58[_0x4a261b(0xaa)]}),{'verbose':_0x15ac58[_0x4a261b(0xa2)]}),_0x390e68=_0xde1583['data'];return console[_0x4a261b(0xba)](_0x4a261b(0xde)+_0x390e68['length']+_0x4a261b(0xdc)+(_0x390e68[_0x4a261b(0xa7)]!==0x1?'s':'')),await handleSDKOutput(_0x390e68,_0x15ac58),0x0;}catch(_0x4f4078){if(_0x4f4078 instanceof SDKError)return console[_0x4a261b(0xba)](_0x4a261b(0xe8)+_0x4f4078[_0x4a261b(0xe0)]),_0x4f4078[_0x4a261b(0xd6)]&&console[_0x4a261b(0xba)](_0x4a261b(0xaf)+_0x4f4078[_0x4a261b(0xd6)]),0x1;throw _0x4f4078;}}}export class WorkflowSessionsCommand extends BaseCommand{[a32_0x1beda1(0x92)]='workflow:sessions';[a32_0x1beda1(0xff)]='List\x20workflow\x20execution\x20sessions';async[a32_0x1beda1(0x84)](_0x576087){const _0x2c4c9c=a32_0x1beda1,{options:_0x65c073,args:_0x204f70,tdx:_0x23144d}=_0x576087;let _0x4b10d6,_0x567f9a;if(_0x204f70[0x0]){const _0x5e5dcb=_0x204f70[0x0][_0x2c4c9c(0x94)]('.');if(_0x5e5dcb[_0x2c4c9c(0xa7)]===0x1)_0x4b10d6=_0x5e5dcb[0x0];else{if(_0x5e5dcb[_0x2c4c9c(0xa7)]===0x2)[_0x4b10d6,_0x567f9a]=_0x5e5dcb;else return console[_0x2c4c9c(0xba)](_0x2c4c9c(0xc4)),0x1;}}try{if(_0x65c073[_0x2c4c9c(0xa2)]){if(_0x4b10d6&&_0x567f9a)console[_0x2c4c9c(0xba)](_0x2c4c9c(0x90)+_0x4b10d6+'.'+_0x567f9a);else _0x4b10d6&&console[_0x2c4c9c(0xba)](_0x2c4c9c(0x87)+_0x4b10d6);const _0x3a0777=_0x65c073[_0x2c4c9c(0xc2)];_0x3a0777&&console[_0x2c4c9c(0xba)](_0x2c4c9c(0xf5)+_0x3a0777);}const _0x2d9dc9=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x23144d[_0x2c4c9c(0xcc)][_0x2c4c9c(0x8c)]({'projectName':_0x4b10d6,'workflowName':_0x567f9a,'status':_0x65c073[_0x2c4c9c(0xc2)],'fromTime':_0x65c073[_0x2c4c9c(0xb9)],'toTime':_0x65c073['to'],'limit':_0x65c073[_0x2c4c9c(0xaa)]}),{'verbose':_0x65c073[_0x2c4c9c(0xa2)]}),_0x14ea06=_0x2d9dc9['data'];return console[_0x2c4c9c(0xba)](_0x2c4c9c(0xde)+_0x14ea06[_0x2c4c9c(0xa7)]+_0x2c4c9c(0xd9)+(_0x14ea06['length']!==0x1?'s':'')),await handleSDKOutput(_0x14ea06,_0x65c073),0x0;}catch(_0x2cfd68){if(_0x2cfd68 instanceof SDKError)return console[_0x2c4c9c(0xba)]('Error:\x20'+_0x2cfd68['message']),_0x2cfd68[_0x2c4c9c(0xd6)]&&console['error']('\x20\x20Cause:\x20'+_0x2cfd68[_0x2c4c9c(0xd6)]),0x1;throw _0x2cfd68;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a32_0x1beda1(0x92)]=a32_0x1beda1(0xed);['description']=a32_0x1beda1(0xf0);async[a32_0x1beda1(0x84)](_0x1bffeb){const _0xb71afd=a32_0x1beda1,{options:_0x16a6d7,args:_0x5e5650,tdx:_0x96937a}=_0x1bffeb;let _0x2c2b19,_0x2da148;if(_0x5e5650[0x0]){const _0x169d45=_0x5e5650[0x0][_0xb71afd(0x94)]('.');if(_0x169d45[_0xb71afd(0xa7)]===0x1)_0x2c2b19=_0x169d45[0x0];else{if(_0x169d45[_0xb71afd(0xa7)]===0x2)[_0x2c2b19,_0x2da148]=_0x169d45;else return console[_0xb71afd(0xba)](_0xb71afd(0xc4)),0x1;}}try{const _0x372dd5=_0x16a6d7['includeRetried'];if(_0x16a6d7[_0xb71afd(0xa2)]){if(_0x2c2b19&&_0x2da148)console[_0xb71afd(0xba)](_0xb71afd(0x90)+_0x2c2b19+'.'+_0x2da148);else _0x2c2b19&&console[_0xb71afd(0xba)](_0xb71afd(0x87)+_0x2c2b19);_0x372dd5&&console[_0xb71afd(0xba)](_0xb71afd(0xc7));}const _0x2787a9=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x96937a[_0xb71afd(0xcc)]['attempts']({'projectName':_0x2c2b19,'workflowName':_0x2da148,'includeRetried':_0x372dd5,'limit':_0x16a6d7[_0xb71afd(0xaa)]}),{'verbose':_0x16a6d7[_0xb71afd(0xa2)]}),_0x55189c=_0x2787a9['data'];return console[_0xb71afd(0xba)](_0xb71afd(0xde)+_0x55189c[_0xb71afd(0xa7)]+'\x20attempt'+(_0x55189c['length']!==0x1?'s':'')),await handleSDKOutput(_0x55189c,_0x16a6d7),0x0;}catch(_0xedb67a){if(_0xedb67a instanceof SDKError)return console['error']('Error:\x20'+_0xedb67a[_0xb71afd(0xe0)]),_0xedb67a[_0xb71afd(0xd6)]&&console[_0xb71afd(0xba)](_0xb71afd(0xaf)+_0xedb67a[_0xb71afd(0xd6)]),0x1;throw _0xedb67a;}}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a32_0x1beda1(0xea);[a32_0x1beda1(0xff)]='Show\x20specific\x20attempt\x20details';async[a32_0x1beda1(0x84)](_0x3930bd){const _0x59c8ef=a32_0x1beda1,{options:_0x4b3b41,args:_0x3aa951,tdx:_0x59837d}=_0x3930bd,_0x59e934=_0x3aa951[0x0];if(!_0x59e934)return console[_0x59c8ef(0xba)](_0x59c8ef(0x91)),0x1;try{_0x4b3b41[_0x59c8ef(0xa2)]&&console[_0x59c8ef(0xba)](_0x59c8ef(0xbe)+_0x59e934);const _0x2b1053=await withSpinner(_0x59c8ef(0xca),()=>_0x59837d['workflow']['attempt'](_0x59e934),{'verbose':_0x4b3b41[_0x59c8ef(0xa2)]}),_0x70bfa9=_0x2b1053[_0x59c8ef(0xdf)];return await handleSDKOutput([_0x70bfa9],_0x4b3b41),0x0;}catch(_0x1c572e){if(_0x1c572e instanceof SDKError)return console[_0x59c8ef(0xba)](_0x59c8ef(0xe8)+_0x1c572e[_0x59c8ef(0xe0)]),_0x1c572e['cause']&&console[_0x59c8ef(0xba)](_0x59c8ef(0xaf)+_0x1c572e[_0x59c8ef(0xd6)]),0x1;throw _0x1c572e;}}}export class WorkflowTasksCommand extends BaseCommand{['name']='workflow:tasks';[a32_0x1beda1(0xff)]=a32_0x1beda1(0x88);async['execute'](_0x2ee953){const _0x5ca35a=a32_0x1beda1,{options:_0x393601,args:_0x2e7d6f,tdx:_0x32d91d}=_0x2ee953,_0x49ca40=_0x2e7d6f[0x0];if(!_0x49ca40)return console[_0x5ca35a(0xba)](_0x5ca35a(0x91)),0x1;try{const _0x227e96=_0x393601[_0x5ca35a(0xfc)];_0x393601[_0x5ca35a(0xa2)]&&(console[_0x5ca35a(0xba)](_0x5ca35a(0xbe)+_0x49ca40),_0x227e96&&console[_0x5ca35a(0xba)](_0x5ca35a(0xa8)));const _0x5c0b18=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x32d91d[_0x5ca35a(0xcc)][_0x5ca35a(0x86)](_0x49ca40,_0x227e96||![]),{'verbose':_0x393601['verbose']}),_0x5b2c4c=_0x5c0b18[_0x5ca35a(0xdf)];return console[_0x5ca35a(0xba)](_0x5ca35a(0xde)+_0x5b2c4c[_0x5ca35a(0xa7)]+'\x20task'+(_0x5b2c4c[_0x5ca35a(0xa7)]!==0x1?'s':'')),await handleSDKOutput(_0x5b2c4c,_0x393601),0x0;}catch(_0x2db4b2){if(_0x2db4b2 instanceof SDKError)return console['error'](_0x5ca35a(0xe8)+_0x2db4b2[_0x5ca35a(0xe0)]),_0x2db4b2[_0x5ca35a(0xd6)]&&console[_0x5ca35a(0xba)]('\x20\x20Cause:\x20'+_0x2db4b2[_0x5ca35a(0xd6)]),0x1;throw _0x2db4b2;}}}function a32_0x3086(_0x841e55,_0x5dd4d2){const _0x118661=a32_0x1186();return a32_0x3086=function(_0x3086a0,_0x24863f){_0x3086a0=_0x3086a0-0x83;let _0x7268b2=_0x118661[_0x3086a0];return _0x7268b2;},a32_0x3086(_0x841e55,_0x5dd4d2);}export class WorkflowLogsCommand extends BaseCommand{[a32_0x1beda1(0x92)]='workflow:logs';[a32_0x1beda1(0xff)]=a32_0x1beda1(0xf3);async[a32_0x1beda1(0x84)](_0x4cb8b1){const _0x2e26c3=a32_0x1beda1,{options:_0x2e647e,args:_0x486f36,tdx:_0x57320f}=_0x4cb8b1,_0x3cc726=_0x486f36[0x0],_0x27b6a8=_0x486f36[0x1];if(!_0x3cc726||!_0x27b6a8)return console[_0x2e26c3(0xba)](_0x2e26c3(0xc8)),0x1;try{_0x2e647e[_0x2e26c3(0xa2)]&&(console[_0x2e26c3(0xba)](_0x2e26c3(0xbe)+_0x3cc726),console['error'](_0x2e26c3(0x99)+_0x27b6a8));const _0x3c6090=_0x2e647e[_0x2e26c3(0x98)],_0x4f5db2=await withSpinner(_0x2e26c3(0xac),()=>_0x57320f[_0x2e26c3(0xcc)][_0x2e26c3(0x95)](_0x3cc726,_0x27b6a8,{'offset':_0x3c6090,'limit':_0x2e647e[_0x2e26c3(0xaa)]}),{'verbose':_0x2e647e['verbose']}),_0x1bb2b6=_0x4f5db2[_0x2e26c3(0xdf)];return console[_0x2e26c3(0xba)](_0x2e26c3(0xde)+_0x1bb2b6[_0x2e26c3(0xa7)]+'\x20log\x20entr'+(_0x1bb2b6[_0x2e26c3(0xa7)]!==0x1?_0x2e26c3(0xce):'y')),await handleSDKOutput(_0x1bb2b6,_0x2e647e),0x0;}catch(_0x80c2ac){if(_0x80c2ac instanceof SDKError)return console['error']('Error:\x20'+_0x80c2ac[_0x2e26c3(0xe0)]),_0x80c2ac['cause']&&console[_0x2e26c3(0xba)](_0x2e26c3(0xaf)+_0x80c2ac[_0x2e26c3(0xd6)]),0x1;throw _0x80c2ac;}}}export class WorkflowKillCommand extends BaseCommand{[a32_0x1beda1(0x92)]=a32_0x1beda1(0xc0);[a32_0x1beda1(0xff)]=a32_0x1beda1(0x8a);async[a32_0x1beda1(0x84)](_0x3a7e7f){const _0x266adf=a32_0x1beda1,{options:_0x483c8d,args:_0x12dc95,tdx:_0x1cd750}=_0x3a7e7f,_0x538e1d=_0x12dc95[0x0];if(!_0x538e1d)return console[_0x266adf(0xba)](_0x266adf(0x91)),0x1;try{const _0x1a3c15=_0x483c8d[_0x266adf(0xb3)];_0x483c8d['verbose']&&(console[_0x266adf(0xba)](_0x266adf(0xbe)+_0x538e1d),_0x1a3c15&&console['error']('Reason:\x20'+_0x1a3c15));if(!_0x483c8d[_0x266adf(0xe6)]){const _0x307432=await confirm(_0x266adf(0xc3)+_0x538e1d+'?');if(!_0x307432)return console[_0x266adf(0xba)](_0x266adf(0xcf)),0x0;}const _0x2033dd=await withSpinner(_0x266adf(0xe7),()=>_0x1cd750[_0x266adf(0xcc)]['kill'](_0x538e1d,_0x1a3c15),{'verbose':_0x483c8d[_0x266adf(0xa2)]}),_0xcc4b81=_0x2033dd['data'];return console['error']('✔\x20'+_0xcc4b81),0x0;}catch(_0x1edf34){if(_0x1edf34 instanceof SDKError)return console[_0x266adf(0xba)](_0x266adf(0xe8)+_0x1edf34[_0x266adf(0xe0)]),_0x1edf34[_0x266adf(0xd6)]&&console[_0x266adf(0xba)]('\x20\x20Cause:\x20'+_0x1edf34['cause']),0x1;throw _0x1edf34;}}}export class WorkflowRetryCommand extends BaseCommand{[a32_0x1beda1(0x92)]=a32_0x1beda1(0xb7);[a32_0x1beda1(0xff)]=a32_0x1beda1(0xae);async['execute'](_0x128cd2){const _0x4a1b7a=a32_0x1beda1,{options:_0x5b58cd,args:_0x29bba2,tdx:_0x34d5e9}=_0x128cd2,_0x3cf964=_0x29bba2[0x0];if(!_0x3cf964)return console[_0x4a1b7a(0xba)](_0x4a1b7a(0xe4)),console[_0x4a1b7a(0xba)](_0x4a1b7a(0x8d)),0x1;let _0x1d7c29=![],_0x5273af=_0x3cf964;if(_0x3cf964['startsWith'](_0x4a1b7a(0xbc)))_0x1d7c29=!![],_0x5273af=_0x3cf964[_0x4a1b7a(0xa1)](0x8);else{if(_0x3cf964[_0x4a1b7a(0xd5)](_0x4a1b7a(0x85)))_0x1d7c29=![],_0x5273af=_0x3cf964[_0x4a1b7a(0xa1)](0x8);else return console['error']('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0x4a1b7a(0xba)](_0x4a1b7a(0x8d)),0x1;}try{const _0x325724=_0x5b58cd[_0x4a1b7a(0xdb)],_0xcf05bb=_0x5b58cd[_0x4a1b7a(0xc6)],_0x4a9b55=_0x5b58cd[_0x4a1b7a(0xef)],_0x37d19b=_0x5b58cd['force'];_0x5b58cd[_0x4a1b7a(0xa2)]&&(console[_0x4a1b7a(0xba)](_0x4a1b7a(0xa9)+(_0x1d7c29?_0x4a1b7a(0xb6):_0x4a1b7a(0x83))+'\x20'+_0x5273af),_0x325724&&console[_0x4a1b7a(0xba)](_0x4a1b7a(0xb5)+_0x325724),_0xcf05bb&&console[_0x4a1b7a(0xba)](_0x4a1b7a(0xa3)+_0xcf05bb),_0x4a9b55&&console['error']('Params:\x20'+_0x4a9b55),_0x37d19b&&console[_0x4a1b7a(0xba)](_0x4a1b7a(0xfa)));let _0x598591;if(_0x4a9b55)try{if(_0x4a9b55[_0x4a1b7a(0xd5)]('@')){const _0x2df587=await import(_0x4a1b7a(0xf6)),_0x41de86=_0x4a9b55['substring'](0x1),_0x217380=await _0x2df587[_0x4a1b7a(0x8f)](_0x41de86,_0x4a1b7a(0xbb));_0x598591=JSON[_0x4a1b7a(0xd0)](_0x217380);}else _0x598591=JSON['parse'](_0x4a9b55);}catch{return console[_0x4a1b7a(0xba)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x5b58cd[_0x4a1b7a(0xe6)]){const _0x476458=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x1d7c29?_0x4a1b7a(0xb6):'attempt')+'\x20'+_0x5273af+'?');if(!_0x476458)return console[_0x4a1b7a(0xba)](_0x4a1b7a(0xcf)),0x0;}let _0x268694;_0x1d7c29?_0x268694=await withSpinner(_0x4a1b7a(0x9f),()=>_0x34d5e9[_0x4a1b7a(0xcc)][_0x4a1b7a(0x93)](_0x5273af,{'fromTask':_0x325724,'retryParams':_0x598591}),{'verbose':_0x5b58cd[_0x4a1b7a(0xa2)]}):_0x268694=await withSpinner(_0x4a1b7a(0xda),()=>_0x34d5e9['workflow'][_0x4a1b7a(0x9c)](_0x5273af,{'resumeFrom':_0xcf05bb,'retryParams':_0x598591,'force':_0x37d19b}),{'verbose':_0x5b58cd['verbose']});const _0x2ed374=_0x268694[_0x4a1b7a(0xdf)];return console['error'](_0x4a1b7a(0xeb)),console[_0x4a1b7a(0xba)](_0x4a1b7a(0xfe)+_0x2ed374[_0x4a1b7a(0x9a)]),console['error'](_0x4a1b7a(0xb0)+_0x2ed374[_0x4a1b7a(0xd2)]),0x0;}catch(_0x201d86){if(_0x201d86 instanceof SDKError)return console[_0x4a1b7a(0xba)](_0x4a1b7a(0xe8)+_0x201d86[_0x4a1b7a(0xe0)]),_0x201d86['cause']&&console[_0x4a1b7a(0xba)](_0x4a1b7a(0xaf)+_0x201d86[_0x4a1b7a(0xd6)]),0x1;throw _0x201d86;}}}export class WorkflowDownloadCommand extends BaseCommand{[a32_0x1beda1(0x92)]=a32_0x1beda1(0xab);['description']='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a32_0x1beda1(0x84)](_0x109b12){const _0x3b7288=a32_0x1beda1,{options:_0x3d4b5e,args:_0x43bc44,tdx:_0x44e541}=_0x109b12,_0x5653d8=_0x43bc44[0x0],_0x33f3d9=_0x43bc44[0x1]||'.';if(!_0x5653d8)return console['error'](_0x3b7288(0x9d)),console[_0x3b7288(0xba)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x5d5442=_0x3d4b5e[_0x3b7288(0xf2)];_0x3d4b5e[_0x3b7288(0xa2)]&&(console[_0x3b7288(0xba)](_0x3b7288(0xad)+_0x5653d8),console['error'](_0x3b7288(0xb1)+_0x33f3d9),_0x5d5442&&console[_0x3b7288(0xba)](_0x3b7288(0xc5)+_0x5d5442));const _0x227799=await withSpinner(_0x3b7288(0xf4)+_0x5653d8+_0x3b7288(0xb4),()=>_0x44e541[_0x3b7288(0xcc)][_0x3b7288(0x9b)](_0x5653d8,_0x33f3d9,{'revision':_0x5d5442}),{'verbose':_0x3d4b5e['verbose']}),_0x51655b=_0x227799[_0x3b7288(0xdf)];return console['error'](_0x3b7288(0xd7)+_0x51655b[_0x3b7288(0xbf)]),console['error']('\x20\x20Revision:\x20'+_0x51655b[_0x3b7288(0xf2)]),console[_0x3b7288(0xba)](_0x3b7288(0xc9)+_0x51655b[_0x3b7288(0x8e)]),console[_0x3b7288(0xba)](_0x3b7288(0xee)+_0x33f3d9+'/'+_0x51655b[_0x3b7288(0xbf)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{['name']=a32_0x1beda1(0xf1);['description']=a32_0x1beda1(0xe3);async[a32_0x1beda1(0x84)](_0x526942){const _0x500ee8=a32_0x1beda1,{options:_0x144368,args:_0x338346,tdx:_0x913bd7}=_0x526942;let _0x2de593='.',_0x225409=_0x144368['name'];if(_0x338346[0x0]){const {promises:_0x20d5bd}=await import('fs');try{const _0x1c58a6=await _0x20d5bd[_0x500ee8(0xa4)](_0x338346[0x0]);if(_0x1c58a6[_0x500ee8(0xf9)]())_0x2de593=_0x338346[0x0];else return console[_0x500ee8(0xba)](_0x500ee8(0xe8)+_0x338346[0x0]+_0x500ee8(0xd8)),0x1;}catch{_0x225409=_0x338346[0x0],_0x2de593='.';}}const _0x5bc5fd=_0x144368[_0x500ee8(0xf2)],_0x2cfc1d=_0x144368[_0x500ee8(0xb2)];_0x144368[_0x500ee8(0xa2)]&&(console[_0x500ee8(0xba)]('Project\x20directory:\x20'+_0x2de593),_0x225409&&console['error']('Project\x20name:\x20'+_0x225409),_0x5bc5fd&&console[_0x500ee8(0xba)](_0x500ee8(0xc5)+_0x5bc5fd),_0x2cfc1d&&console[_0x500ee8(0xba)](_0x500ee8(0xa6)));const _0x9389da=await withSpinner(_0x500ee8(0xcb),()=>_0x913bd7[_0x500ee8(0xcc)][_0x500ee8(0xfb)](_0x2de593,{'projectName':_0x225409,'revision':_0x5bc5fd,'skipValidation':_0x2cfc1d}),{'verbose':_0x144368[_0x500ee8(0xa2)]}),_0x3e2393=_0x9389da['data'];return console[_0x500ee8(0xba)]('✔\x20Pushed\x20'+_0x3e2393[_0x500ee8(0xbf)]),console[_0x500ee8(0xba)](_0x500ee8(0xc1)+_0x3e2393[_0x500ee8(0xec)]),console[_0x500ee8(0xba)](_0x500ee8(0x9e)+_0x3e2393[_0x500ee8(0xf2)]),0x0;}}function a32_0x1186(){const _0x289ccc=['name','retrySession','split','logs','workflow:workflows','406tZGsib','offset','Task\x20name:\x20','attemptId','download','retryAttempt','Error:\x20Project\x20name\x20is\x20required','\x20\x20Revision:\x20','Retrying\x20session...','\x22?\x20This\x20cannot\x20be\x20undone.','substring','verbose','Resume\x20from:\x20','stat','637603pakcIg','Validation:\x20skipped','length','Including\x20subtasks:\x20yes','Target:\x20','limit','workflow:download','Getting\x20task\x20logs...','Project:\x20','Retry\x20a\x20session\x20or\x20attempt','\x20\x20Cause:\x20','\x20\x20Session\x20ID:\x20','Output\x20directory:\x20','skipValidation','reason','...','From\x20task:\x20','session','workflow:retry','5ZItKrn','from','error','utf-8','session:','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Attempt\x20ID:\x20','projectName','workflow:kill','\x20\x20Project\x20ID:\x20','status','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Revision:\x20','resumeFrom','Include\x20retried:\x20yes','Error:\x20Attempt\x20ID\x20and\x20task\x20name\x20are\x20required','\x20\x20Files\x20extracted:\x20','Getting\x20attempt\x20details...','Pushing\x20workflow\x20project...','workflow','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','ies','Cancelled','parse','workflow:delete','sessionId','Usage:\x20workflow:delete\x20<project-name-or-id>','Listing\x20workflows...','startsWith','cause','✔\x20Downloaded\x20','\x20is\x20not\x20a\x20directory','\x20session','Retrying\x20attempt...','fromTask','\x20workflow','918945NGkHTe','✔\x20Found\x20','data','message','Deleting\x20project\x20','13880sYOwMq','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','workflows','yes','Killing\x20attempt...','Error:\x20','3988194kQXhjo','workflow:attempt','✔\x20Retry\x20started','projectId','workflow:attempts','\x20\x20Location:\x20','params','List\x20workflow\x20attempts','workflow:push','revision','Show\x20logs\x20for\x20a\x20specific\x20task','Downloading\x20project\x20','Status:\x20','fs/promises','✔\x20Deleted\x20project\x20','1060794LkPgOH','isDirectory','Force:\x20yes','push','includeSubtasks','1747304sOKdGK','\x20\x20New\x20attempt\x20ID:\x20','description','attempt','execute','attempt:','tasks','Filter:\x20project=','Show\x20tasks\x20for\x20an\x20attempt','785180wjkATu','Kill\x20a\x20running\x20attempt','List\x20all\x20workflow\x20projects','sessions','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','filesExtracted','readFile','Filter:\x20','Error:\x20Attempt\x20ID\x20is\x20required'];a32_0x1186=function(){return _0x289ccc;};return a32_0x1186();}export class WorkflowDeleteCommand extends BaseCommand{[a32_0x1beda1(0x92)]=a32_0x1beda1(0xd1);[a32_0x1beda1(0xff)]=a32_0x1beda1(0xbd);async[a32_0x1beda1(0x84)](_0x21bb06){const _0x10e76c=a32_0x1beda1,{options:_0x4a45e0,args:_0x52c63f,tdx:_0x10bbca}=_0x21bb06,_0x2b7082=_0x52c63f[0x0];if(!_0x2b7082)return console[_0x10e76c(0xba)](_0x10e76c(0xcd)),console[_0x10e76c(0xba)](_0x10e76c(0xd3)),0x1;_0x4a45e0[_0x10e76c(0xa2)]&&console[_0x10e76c(0xba)](_0x10e76c(0xad)+_0x2b7082);if(!_0x4a45e0[_0x10e76c(0xe6)]){const _0x500162=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x2b7082+_0x10e76c(0xa0));if(!_0x500162)return console[_0x10e76c(0xba)]('Cancelled'),0x0;}const _0x1f7922=await withSpinner(_0x10e76c(0xe1)+_0x2b7082+_0x10e76c(0xb4),()=>_0x10bbca['workflow']['delete'](_0x2b7082),{'verbose':_0x4a45e0[_0x10e76c(0xa2)]}),_0x915d0d=_0x1f7922[_0x10e76c(0xdf)];return console[_0x10e76c(0xba)](_0x10e76c(0xf7)+_0x915d0d['projectName']),console[_0x10e76c(0xba)](_0x10e76c(0xc1)+_0x915d0d[_0x10e76c(0xec)]),0x0;}}
|
|
1
|
+
const a32_0x36fa37=a32_0x3536;(function(_0x50f280,_0x15b4a9){const _0x51ce25=a32_0x3536,_0x5efccd=_0x50f280();while(!![]){try{const _0xe4469f=-parseInt(_0x51ce25(0x231))/0x1+-parseInt(_0x51ce25(0x227))/0x2*(parseInt(_0x51ce25(0x1fc))/0x3)+-parseInt(_0x51ce25(0x22d))/0x4+parseInt(_0x51ce25(0x258))/0x5+-parseInt(_0x51ce25(0x24b))/0x6*(parseInt(_0x51ce25(0x249))/0x7)+parseInt(_0x51ce25(0x24d))/0x8*(parseInt(_0x51ce25(0x253))/0x9)+parseInt(_0x51ce25(0x217))/0xa;if(_0xe4469f===_0x15b4a9)break;else _0x5efccd['push'](_0x5efccd['shift']());}catch(_0x45cb57){_0x5efccd['push'](_0x5efccd['shift']());}}}(a32_0x15ab,0x2a4bc));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a32_0x15ab(){const _0x14cd3f=['workflow:logs','kill','cause','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','error','\x20\x20Location:\x20','workflow:attempts','Validation:\x20skipped','Project\x20filter:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Deleting\x20project\x20','28dBPtrj','✔\x20Found\x20','311874VOyhXd','Project:\x20','546528ukkGYP','isDirectory','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Filter:\x20project=','sessions','Error:\x20Attempt\x20ID\x20is\x20required','9lvrsPJ','session','Listing\x20workflow\x20sessions...','Listing\x20workflow\x20attempts...','\x20session','713600dxIKPT','\x22?\x20This\x20cannot\x20be\x20undone.','status','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','utf-8','✔\x20Downloaded\x20','Getting\x20attempt\x20tasks...','fromTask','Pattern:\x20','name','sessionId','Listing\x20workflows...','Project\x20directory:\x20','Kill\x20a\x20running\x20attempt','Reason:\x20','session:','List\x20workflows','workflow:push','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','message','\x20\x20Revision:\x20','filesExtracted','Listing\x20workflow\x20projects...','Attempt\x20ID:\x20','✔\x20Deleted\x20project\x20','\x20log\x20entr','Downloading\x20project\x20','offset','Revision:\x20','attempt:','Task\x20name:\x20','\x20\x20New\x20attempt\x20ID:\x20','push','List\x20workflow\x20execution\x20sessions','Show\x20logs\x20for\x20a\x20specific\x20task','workflow:delete','List\x20all\x20workflow\x20projects','Getting\x20attempt\x20details...','length','869502XYgWXt','revision','Params:\x20','Killing\x20attempt...','description','\x20\x20Cause:\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','Show\x20tasks\x20for\x20an\x20attempt','workflow:retry','logs','data','includeRetried','...','Error:\x20Project\x20name\x20is\x20required','limit','attemptId','Error:\x20Invalid\x20JSON\x20in\x20--params','\x20project','resumeFrom','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Force:\x20yes','from','workflows','workflow:tasks','From\x20task:\x20','split','verbose','8774700GutBQT','\x20\x20Project\x20ID:\x20','Retrying\x20session...','yes','workflow:kill','retryAttempt','workflow:projects','execute','force','reason','substring','projectName','workflow:sessions','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','parse','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','2NiyhDA','Show\x20specific\x20attempt\x20details','startsWith','Cancelled','\x20\x20Session\x20ID:\x20','Target:\x20','335296jzsKMQ','workflow','\x20task','fs/promises','333688FIESju','ies','Resume\x20from:\x20','workflow:download','Error:\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Output\x20directory:\x20','stat','params','\x20workflow','Filter:\x20','attempt'];a32_0x15ab=function(){return _0x14cd3f;};return a32_0x15ab();}import{confirm}from'../utils/prompt.js';export class WorkflowProjectsCommand extends BaseCommand{[a32_0x36fa37(0x1de)]=a32_0x36fa37(0x21d);[a32_0x36fa37(0x200)]=a32_0x36fa37(0x1f9);async['execute'](_0x58de6d){const _0x352807=a32_0x36fa37,{options:_0x58cef6,args:_0x163a65,tdx:_0x43e602}=_0x58de6d,_0x133a58=_0x163a65[0x0];try{_0x58cef6[_0x352807(0x216)]&&_0x133a58&&console['error'](_0x352807(0x1dd)+_0x133a58);const _0x598774=await withSpinner(_0x352807(0x1eb),()=>_0x43e602[_0x352807(0x22e)]['projects'](_0x133a58,{'limit':_0x58cef6[_0x352807(0x20a)]}),{'verbose':_0x58cef6[_0x352807(0x216)]}),_0x4e296c=_0x598774[_0x352807(0x206)];return console['error'](_0x352807(0x24a)+_0x4e296c[_0x352807(0x1fb)]+_0x352807(0x20d)+(_0x4e296c['length']!==0x1?'s':'')),await handleSDKOutput(_0x4e296c,_0x58cef6),0x0;}catch(_0x460aa7){if(_0x460aa7 instanceof SDKError)return console[_0x352807(0x242)]('Error:\x20'+_0x460aa7[_0x352807(0x1e8)]),_0x460aa7[_0x352807(0x23f)]&&console[_0x352807(0x242)](_0x352807(0x201)+_0x460aa7['cause']),0x1;throw _0x460aa7;}}}export class WorkflowWorkflowsCommand extends BaseCommand{['name']='workflow:workflows';[a32_0x36fa37(0x200)]=a32_0x36fa37(0x1e5);async['execute'](_0x363945){const _0x12f047=a32_0x36fa37,{options:_0x19f234,args:_0x56fbc7,tdx:_0x17140b}=_0x363945,_0x2363b7=_0x56fbc7[0x0];try{_0x19f234[_0x12f047(0x216)]&&_0x2363b7&&console[_0x12f047(0x242)](_0x12f047(0x246)+_0x2363b7);const _0x39248f=await withSpinner(_0x12f047(0x1e0),()=>_0x17140b[_0x12f047(0x22e)][_0x12f047(0x212)](_0x2363b7,{'limit':_0x19f234[_0x12f047(0x20a)]}),{'verbose':_0x19f234[_0x12f047(0x216)]}),_0x3b2906=_0x39248f[_0x12f047(0x206)];return console[_0x12f047(0x242)](_0x12f047(0x24a)+_0x3b2906['length']+_0x12f047(0x23a)+(_0x3b2906[_0x12f047(0x1fb)]!==0x1?'s':'')),await handleSDKOutput(_0x3b2906,_0x19f234),0x0;}catch(_0x27f0e9){if(_0x27f0e9 instanceof SDKError)return console[_0x12f047(0x242)](_0x12f047(0x235)+_0x27f0e9[_0x12f047(0x1e8)]),_0x27f0e9[_0x12f047(0x23f)]&&console[_0x12f047(0x242)]('\x20\x20Cause:\x20'+_0x27f0e9[_0x12f047(0x23f)]),0x1;throw _0x27f0e9;}}}export class WorkflowSessionsCommand extends BaseCommand{['name']=a32_0x36fa37(0x223);[a32_0x36fa37(0x200)]=a32_0x36fa37(0x1f6);async[a32_0x36fa37(0x21e)](_0x544792){const _0x58972c=a32_0x36fa37,{options:_0x5beeb9,args:_0xdc7e7b,tdx:_0x36c980}=_0x544792;let _0x58dfb4,_0x3988b7;if(_0xdc7e7b[0x0]){const _0x2d256e=_0xdc7e7b[0x0]['split']('.');if(_0x2d256e[_0x58972c(0x1fb)]===0x1)_0x58dfb4=_0x2d256e[0x0];else{if(_0x2d256e['length']===0x2)[_0x58dfb4,_0x3988b7]=_0x2d256e;else return console['error'](_0x58972c(0x241)),0x1;}}try{if(_0x5beeb9['verbose']){if(_0x58dfb4&&_0x3988b7)console[_0x58972c(0x242)](_0x58972c(0x23b)+_0x58dfb4+'.'+_0x3988b7);else _0x58dfb4&&console['error'](_0x58972c(0x250)+_0x58dfb4);const _0x4a3d3e=_0x5beeb9[_0x58972c(0x1d7)];_0x4a3d3e&&console[_0x58972c(0x242)]('Status:\x20'+_0x4a3d3e);}const _0x118fa3=await withSpinner(_0x58972c(0x255),()=>_0x36c980[_0x58972c(0x22e)][_0x58972c(0x251)]({'projectName':_0x58dfb4,'workflowName':_0x3988b7,'status':_0x5beeb9[_0x58972c(0x1d7)],'fromTime':_0x5beeb9[_0x58972c(0x211)],'toTime':_0x5beeb9['to'],'limit':_0x5beeb9[_0x58972c(0x20a)]}),{'verbose':_0x5beeb9[_0x58972c(0x216)]}),_0x5cc460=_0x118fa3[_0x58972c(0x206)];return console[_0x58972c(0x242)](_0x58972c(0x24a)+_0x5cc460[_0x58972c(0x1fb)]+_0x58972c(0x257)+(_0x5cc460['length']!==0x1?'s':'')),await handleSDKOutput(_0x5cc460,_0x5beeb9),0x0;}catch(_0x5ae9aa){if(_0x5ae9aa instanceof SDKError)return console[_0x58972c(0x242)](_0x58972c(0x235)+_0x5ae9aa[_0x58972c(0x1e8)]),_0x5ae9aa[_0x58972c(0x23f)]&&console[_0x58972c(0x242)]('\x20\x20Cause:\x20'+_0x5ae9aa[_0x58972c(0x23f)]),0x1;throw _0x5ae9aa;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a32_0x36fa37(0x1de)]=a32_0x36fa37(0x244);['description']='List\x20workflow\x20attempts';async[a32_0x36fa37(0x21e)](_0x26c3b3){const _0x14750e=a32_0x36fa37,{options:_0xcdd28e,args:_0x5ad534,tdx:_0x70b5b7}=_0x26c3b3;let _0x490ea3,_0x509425;if(_0x5ad534[0x0]){const _0x255c24=_0x5ad534[0x0][_0x14750e(0x215)]('.');if(_0x255c24[_0x14750e(0x1fb)]===0x1)_0x490ea3=_0x255c24[0x0];else{if(_0x255c24[_0x14750e(0x1fb)]===0x2)[_0x490ea3,_0x509425]=_0x255c24;else return console[_0x14750e(0x242)](_0x14750e(0x241)),0x1;}}try{const _0x599a06=_0xcdd28e[_0x14750e(0x207)];if(_0xcdd28e[_0x14750e(0x216)]){if(_0x490ea3&&_0x509425)console[_0x14750e(0x242)](_0x14750e(0x23b)+_0x490ea3+'.'+_0x509425);else _0x490ea3&&console[_0x14750e(0x242)]('Filter:\x20project='+_0x490ea3);_0x599a06&&console[_0x14750e(0x242)]('Include\x20retried:\x20yes');}const _0x23f15f=await withSpinner(_0x14750e(0x256),()=>_0x70b5b7[_0x14750e(0x22e)]['attempts']({'projectName':_0x490ea3,'workflowName':_0x509425,'includeRetried':_0x599a06,'limit':_0xcdd28e[_0x14750e(0x20a)]}),{'verbose':_0xcdd28e[_0x14750e(0x216)]}),_0x3f412d=_0x23f15f['data'];return console['error']('✔\x20Found\x20'+_0x3f412d[_0x14750e(0x1fb)]+'\x20attempt'+(_0x3f412d[_0x14750e(0x1fb)]!==0x1?'s':'')),await handleSDKOutput(_0x3f412d,_0xcdd28e),0x0;}catch(_0x1c4302){if(_0x1c4302 instanceof SDKError)return console[_0x14750e(0x242)](_0x14750e(0x235)+_0x1c4302[_0x14750e(0x1e8)]),_0x1c4302[_0x14750e(0x23f)]&&console[_0x14750e(0x242)]('\x20\x20Cause:\x20'+_0x1c4302[_0x14750e(0x23f)]),0x1;throw _0x1c4302;}}}export class WorkflowAttemptCommand extends BaseCommand{[a32_0x36fa37(0x1de)]='workflow:attempt';[a32_0x36fa37(0x200)]=a32_0x36fa37(0x228);async['execute'](_0x4f80db){const _0x128103=a32_0x36fa37,{options:_0x93675f,args:_0x4123d5,tdx:_0x5f2a54}=_0x4f80db,_0x58f2f9=_0x4123d5[0x0];if(!_0x58f2f9)return console[_0x128103(0x242)](_0x128103(0x252)),0x1;try{_0x93675f['verbose']&&console['error']('Attempt\x20ID:\x20'+_0x58f2f9);const _0x3139ab=await withSpinner(_0x128103(0x1fa),()=>_0x5f2a54[_0x128103(0x22e)][_0x128103(0x23c)](_0x58f2f9),{'verbose':_0x93675f[_0x128103(0x216)]}),_0x403245=_0x3139ab[_0x128103(0x206)];return await handleSDKOutput([_0x403245],_0x93675f),0x0;}catch(_0x2b847d){if(_0x2b847d instanceof SDKError)return console[_0x128103(0x242)]('Error:\x20'+_0x2b847d['message']),_0x2b847d[_0x128103(0x23f)]&&console[_0x128103(0x242)](_0x128103(0x201)+_0x2b847d[_0x128103(0x23f)]),0x1;throw _0x2b847d;}}}function a32_0x3536(_0x5349d1,_0x310b30){const _0x15ab39=a32_0x15ab();return a32_0x3536=function(_0x35364f,_0x147f0c){_0x35364f=_0x35364f-0x1d6;let _0x437f85=_0x15ab39[_0x35364f];return _0x437f85;},a32_0x3536(_0x5349d1,_0x310b30);}export class WorkflowTasksCommand extends BaseCommand{[a32_0x36fa37(0x1de)]=a32_0x36fa37(0x213);['description']=a32_0x36fa37(0x203);async[a32_0x36fa37(0x21e)](_0x2113f9){const _0x1b32ee=a32_0x36fa37,{options:_0x1afcc2,args:_0x26c2d2,tdx:_0x42b38c}=_0x2113f9,_0x5d470e=_0x26c2d2[0x0];if(!_0x5d470e)return console[_0x1b32ee(0x242)](_0x1b32ee(0x252)),0x1;try{const _0x150f35=_0x1afcc2['includeSubtasks'];_0x1afcc2[_0x1b32ee(0x216)]&&(console[_0x1b32ee(0x242)](_0x1b32ee(0x1ec)+_0x5d470e),_0x150f35&&console[_0x1b32ee(0x242)]('Including\x20subtasks:\x20yes'));const _0x23b115=await withSpinner(_0x1b32ee(0x1db),()=>_0x42b38c[_0x1b32ee(0x22e)]['tasks'](_0x5d470e,_0x150f35||![]),{'verbose':_0x1afcc2[_0x1b32ee(0x216)]}),_0x522d0d=_0x23b115[_0x1b32ee(0x206)];return console[_0x1b32ee(0x242)]('✔\x20Found\x20'+_0x522d0d[_0x1b32ee(0x1fb)]+_0x1b32ee(0x22f)+(_0x522d0d[_0x1b32ee(0x1fb)]!==0x1?'s':'')),await handleSDKOutput(_0x522d0d,_0x1afcc2),0x0;}catch(_0x9b0242){if(_0x9b0242 instanceof SDKError)return console[_0x1b32ee(0x242)](_0x1b32ee(0x235)+_0x9b0242[_0x1b32ee(0x1e8)]),_0x9b0242[_0x1b32ee(0x23f)]&&console['error'](_0x1b32ee(0x201)+_0x9b0242[_0x1b32ee(0x23f)]),0x1;throw _0x9b0242;}}}export class WorkflowLogsCommand extends BaseCommand{[a32_0x36fa37(0x1de)]=a32_0x36fa37(0x23d);[a32_0x36fa37(0x200)]=a32_0x36fa37(0x1f7);async[a32_0x36fa37(0x21e)](_0x4bf76a){const _0xc36122=a32_0x36fa37,{options:_0x2cdbb3,args:_0x416c8b,tdx:_0x287bbf}=_0x4bf76a,_0xa4dcde=_0x416c8b[0x0],_0x1eaba2=_0x416c8b[0x1];if(!_0xa4dcde||!_0x1eaba2)return console[_0xc36122(0x242)]('Error:\x20Attempt\x20ID\x20and\x20task\x20name\x20are\x20required'),0x1;try{_0x2cdbb3[_0xc36122(0x216)]&&(console[_0xc36122(0x242)]('Attempt\x20ID:\x20'+_0xa4dcde),console[_0xc36122(0x242)](_0xc36122(0x1f3)+_0x1eaba2));const _0xe4fb38=_0x2cdbb3[_0xc36122(0x1f0)],_0x419753=await withSpinner('Getting\x20task\x20logs...',()=>_0x287bbf['workflow'][_0xc36122(0x205)](_0xa4dcde,_0x1eaba2,{'offset':_0xe4fb38,'limit':_0x2cdbb3[_0xc36122(0x20a)]}),{'verbose':_0x2cdbb3['verbose']}),_0x4d8c84=_0x419753[_0xc36122(0x206)];return console['error'](_0xc36122(0x24a)+_0x4d8c84[_0xc36122(0x1fb)]+_0xc36122(0x1ee)+(_0x4d8c84[_0xc36122(0x1fb)]!==0x1?_0xc36122(0x232):'y')),await handleSDKOutput(_0x4d8c84,_0x2cdbb3),0x0;}catch(_0x266399){if(_0x266399 instanceof SDKError)return console['error'](_0xc36122(0x235)+_0x266399['message']),_0x266399[_0xc36122(0x23f)]&&console[_0xc36122(0x242)](_0xc36122(0x201)+_0x266399[_0xc36122(0x23f)]),0x1;throw _0x266399;}}}export class WorkflowKillCommand extends BaseCommand{[a32_0x36fa37(0x1de)]=a32_0x36fa37(0x21b);[a32_0x36fa37(0x200)]=a32_0x36fa37(0x1e2);async['execute'](_0x5cd58e){const _0x57265f=a32_0x36fa37,{options:_0x23e819,args:_0x4678df,tdx:_0x477690}=_0x5cd58e,_0x2f829b=_0x4678df[0x0];if(!_0x2f829b)return console['error'](_0x57265f(0x252)),0x1;try{const _0x37e56=_0x23e819[_0x57265f(0x220)];_0x23e819[_0x57265f(0x216)]&&(console['error'](_0x57265f(0x1ec)+_0x2f829b),_0x37e56&&console[_0x57265f(0x242)](_0x57265f(0x1e3)+_0x37e56));if(!_0x23e819[_0x57265f(0x21a)]){const _0xc00208=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x2f829b+'?');if(!_0xc00208)return console[_0x57265f(0x242)](_0x57265f(0x22a)),0x0;}const _0x90b140=await withSpinner(_0x57265f(0x1ff),()=>_0x477690[_0x57265f(0x22e)][_0x57265f(0x23e)](_0x2f829b,_0x37e56),{'verbose':_0x23e819[_0x57265f(0x216)]}),_0x58c252=_0x90b140[_0x57265f(0x206)];return console[_0x57265f(0x242)]('✔\x20'+_0x58c252),0x0;}catch(_0x3ec6c5){if(_0x3ec6c5 instanceof SDKError)return console[_0x57265f(0x242)](_0x57265f(0x235)+_0x3ec6c5['message']),_0x3ec6c5[_0x57265f(0x23f)]&&console[_0x57265f(0x242)](_0x57265f(0x201)+_0x3ec6c5['cause']),0x1;throw _0x3ec6c5;}}}export class WorkflowRetryCommand extends BaseCommand{[a32_0x36fa37(0x1de)]=a32_0x36fa37(0x204);[a32_0x36fa37(0x200)]='Retry\x20a\x20session\x20or\x20attempt';async[a32_0x36fa37(0x21e)](_0x16cde7){const _0xc481d5=a32_0x36fa37,{options:_0x70c818,args:_0x20a5f8,tdx:_0x3ec46e}=_0x16cde7,_0x33ec1d=_0x20a5f8[0x0];if(!_0x33ec1d)return console['error'](_0xc481d5(0x20f)),console[_0xc481d5(0x242)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x565141=![],_0x5952a9=_0x33ec1d;if(_0x33ec1d[_0xc481d5(0x229)](_0xc481d5(0x1e4)))_0x565141=!![],_0x5952a9=_0x33ec1d[_0xc481d5(0x221)](0x8);else{if(_0x33ec1d[_0xc481d5(0x229)](_0xc481d5(0x1f2)))_0x565141=![],_0x5952a9=_0x33ec1d[_0xc481d5(0x221)](0x8);else return console[_0xc481d5(0x242)](_0xc481d5(0x226)),console[_0xc481d5(0x242)](_0xc481d5(0x224)),0x1;}try{const _0x3bba61=_0x70c818[_0xc481d5(0x1dc)],_0x59ca0b=_0x70c818[_0xc481d5(0x20e)],_0x466eb3=_0x70c818[_0xc481d5(0x239)],_0x12e206=_0x70c818[_0xc481d5(0x21f)];_0x70c818['verbose']&&(console[_0xc481d5(0x242)](_0xc481d5(0x22c)+(_0x565141?_0xc481d5(0x254):_0xc481d5(0x23c))+'\x20'+_0x5952a9),_0x3bba61&&console['error'](_0xc481d5(0x214)+_0x3bba61),_0x59ca0b&&console[_0xc481d5(0x242)](_0xc481d5(0x233)+_0x59ca0b),_0x466eb3&&console[_0xc481d5(0x242)](_0xc481d5(0x1fe)+_0x466eb3),_0x12e206&&console[_0xc481d5(0x242)](_0xc481d5(0x210)));let _0x33f252;if(_0x466eb3)try{if(_0x466eb3[_0xc481d5(0x229)]('@')){const _0x4cf502=await import(_0xc481d5(0x230)),_0x3d6118=_0x466eb3['substring'](0x1),_0x1199dd=await _0x4cf502['readFile'](_0x3d6118,_0xc481d5(0x1d9));_0x33f252=JSON[_0xc481d5(0x225)](_0x1199dd);}else _0x33f252=JSON['parse'](_0x466eb3);}catch{return console[_0xc481d5(0x242)](_0xc481d5(0x20c)),0x1;}if(!_0x70c818['yes']){const _0x16e7ef=await confirm(_0xc481d5(0x240)+(_0x565141?'session':_0xc481d5(0x23c))+'\x20'+_0x5952a9+'?');if(!_0x16e7ef)return console[_0xc481d5(0x242)](_0xc481d5(0x22a)),0x0;}let _0x3a03c2;_0x565141?_0x3a03c2=await withSpinner(_0xc481d5(0x219),()=>_0x3ec46e['workflow']['retrySession'](_0x5952a9,{'fromTask':_0x3bba61,'retryParams':_0x33f252}),{'verbose':_0x70c818[_0xc481d5(0x216)]}):_0x3a03c2=await withSpinner('Retrying\x20attempt...',()=>_0x3ec46e['workflow'][_0xc481d5(0x21c)](_0x5952a9,{'resumeFrom':_0x59ca0b,'retryParams':_0x33f252,'force':_0x12e206}),{'verbose':_0x70c818[_0xc481d5(0x216)]});const _0x2e61ef=_0x3a03c2[_0xc481d5(0x206)];return console['error']('✔\x20Retry\x20started'),console[_0xc481d5(0x242)](_0xc481d5(0x1f4)+_0x2e61ef[_0xc481d5(0x20b)]),console[_0xc481d5(0x242)](_0xc481d5(0x22b)+_0x2e61ef[_0xc481d5(0x1df)]),0x0;}catch(_0x44c06a){if(_0x44c06a instanceof SDKError)return console[_0xc481d5(0x242)](_0xc481d5(0x235)+_0x44c06a[_0xc481d5(0x1e8)]),_0x44c06a[_0xc481d5(0x23f)]&&console[_0xc481d5(0x242)](_0xc481d5(0x201)+_0x44c06a['cause']),0x1;throw _0x44c06a;}}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a32_0x36fa37(0x234);['description']='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a32_0x36fa37(0x21e)](_0x20c7aa){const _0x366331=a32_0x36fa37,{options:_0x266831,args:_0x26f3c7,tdx:_0x4c8b0c}=_0x20c7aa,_0x137e0a=_0x26f3c7[0x0],_0x32b8db=_0x26f3c7[0x1]||'.';if(!_0x137e0a)return console[_0x366331(0x242)](_0x366331(0x209)),console[_0x366331(0x242)](_0x366331(0x236)),0x1;const _0x283ae3=_0x266831[_0x366331(0x1fd)];_0x266831[_0x366331(0x216)]&&(console[_0x366331(0x242)](_0x366331(0x24c)+_0x137e0a),console['error'](_0x366331(0x237)+_0x32b8db),_0x283ae3&&console[_0x366331(0x242)](_0x366331(0x1f1)+_0x283ae3));const _0x3b0d7b=await withSpinner(_0x366331(0x1ef)+_0x137e0a+_0x366331(0x208),()=>_0x4c8b0c[_0x366331(0x22e)]['download'](_0x137e0a,_0x32b8db,{'revision':_0x283ae3}),{'verbose':_0x266831[_0x366331(0x216)]}),_0x5dbb37=_0x3b0d7b['data'];return console[_0x366331(0x242)](_0x366331(0x1da)+_0x5dbb37[_0x366331(0x222)]),console[_0x366331(0x242)]('\x20\x20Revision:\x20'+_0x5dbb37[_0x366331(0x1fd)]),console[_0x366331(0x242)]('\x20\x20Files\x20extracted:\x20'+_0x5dbb37[_0x366331(0x1ea)]),console[_0x366331(0x242)](_0x366331(0x243)+_0x32b8db+'/'+_0x5dbb37[_0x366331(0x222)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a32_0x36fa37(0x1de)]=a32_0x36fa37(0x1e6);[a32_0x36fa37(0x200)]=a32_0x36fa37(0x1d8);async[a32_0x36fa37(0x21e)](_0x10c031){const _0x713543=a32_0x36fa37,{options:_0x201c86,args:_0x3d42e2,tdx:_0x51d5f4}=_0x10c031;let _0x742bdc='.',_0x143087=_0x201c86[_0x713543(0x1de)];if(_0x3d42e2[0x0]){const {promises:_0x1d2fdc}=await import('fs');try{const _0x517e9f=await _0x1d2fdc[_0x713543(0x238)](_0x3d42e2[0x0]);if(_0x517e9f[_0x713543(0x24e)]())_0x742bdc=_0x3d42e2[0x0];else return console[_0x713543(0x242)](_0x713543(0x235)+_0x3d42e2[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x143087=_0x3d42e2[0x0],_0x742bdc='.';}}const _0x226879=_0x201c86[_0x713543(0x1fd)],_0x159376=_0x201c86['skipValidation'];_0x201c86[_0x713543(0x216)]&&(console[_0x713543(0x242)](_0x713543(0x1e1)+_0x742bdc),_0x143087&&console[_0x713543(0x242)]('Project\x20name:\x20'+_0x143087),_0x226879&&console[_0x713543(0x242)](_0x713543(0x1f1)+_0x226879),_0x159376&&console['error'](_0x713543(0x245)));const _0x46b209=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x51d5f4[_0x713543(0x22e)][_0x713543(0x1f5)](_0x742bdc,{'projectName':_0x143087,'revision':_0x226879,'skipValidation':_0x159376}),{'verbose':_0x201c86[_0x713543(0x216)]}),_0x3ddb69=_0x46b209[_0x713543(0x206)];return console[_0x713543(0x242)]('✔\x20Pushed\x20'+_0x3ddb69[_0x713543(0x222)]),console[_0x713543(0x242)](_0x713543(0x218)+_0x3ddb69['projectId']),console[_0x713543(0x242)](_0x713543(0x1e9)+_0x3ddb69[_0x713543(0x1fd)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a32_0x36fa37(0x1de)]=a32_0x36fa37(0x1f8);[a32_0x36fa37(0x200)]=a32_0x36fa37(0x247);async[a32_0x36fa37(0x21e)](_0x234ab7){const _0x4fddad=a32_0x36fa37,{options:_0xfe1ca3,args:_0x161a23,tdx:_0x5c3c14}=_0x234ab7,_0xa9ed53=_0x161a23[0x0];if(!_0xa9ed53)return console['error'](_0x4fddad(0x1e7)),console[_0x4fddad(0x242)](_0x4fddad(0x202)),0x1;_0xfe1ca3['verbose']&&console[_0x4fddad(0x242)](_0x4fddad(0x24c)+_0xa9ed53);if(!_0xfe1ca3[_0x4fddad(0x21a)]){const _0x335cb6=await confirm(_0x4fddad(0x24f)+_0xa9ed53+_0x4fddad(0x1d6));if(!_0x335cb6)return console[_0x4fddad(0x242)](_0x4fddad(0x22a)),0x0;}const _0x46902f=await withSpinner(_0x4fddad(0x248)+_0xa9ed53+_0x4fddad(0x208),()=>_0x5c3c14[_0x4fddad(0x22e)]['delete'](_0xa9ed53),{'verbose':_0xfe1ca3[_0x4fddad(0x216)]}),_0x12830c=_0x46902f[_0x4fddad(0x206)];return console[_0x4fddad(0x242)](_0x4fddad(0x1ed)+_0x12830c['projectName']),console[_0x4fddad(0x242)](_0x4fddad(0x218)+_0x12830c['projectId']),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2fc283,_0x2c6456){const _0x3a0ba3=a33_0x52da,_0x2e8238=_0x2fc283();while(!![]){try{const _0x379ee4=parseInt(_0x3a0ba3(0x1df))/0x1+parseInt(_0x3a0ba3(0x1ec))/0x2+parseInt(_0x3a0ba3(0x1e8))/0x3+-parseInt(_0x3a0ba3(0x1f5))/0x4*(parseInt(_0x3a0ba3(0x1f1))/0x5)+-parseInt(_0x3a0ba3(0x1f3))/0x6*(parseInt(_0x3a0ba3(0x1f4))/0x7)+parseInt(_0x3a0ba3(0x1e4))/0x8+-parseInt(_0x3a0ba3(0x1ea))/0x9*(parseInt(_0x3a0ba3(0x1e6))/0xa);if(_0x379ee4===_0x2c6456)break;else _0x2e8238['push'](_0x2e8238['shift']());}catch(_0x132d6e){_0x2e8238['push'](_0x2e8238['shift']());}}}(a33_0x4184,0x1aadc));import{platform}from'os';function a33_0x52da(_0x5da9d7,_0x3e7fb9){const _0x4184a9=a33_0x4184();return a33_0x52da=function(_0x52da3b,_0x38c47c){_0x52da3b=_0x52da3b-0x1de;let _0x250fe9=_0x4184a9[_0x52da3b];return _0x250fe9;},a33_0x52da(_0x5da9d7,_0x3e7fb9);}import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x4198b3=a33_0x52da;try{const _0x1145e3=fileURLToPath(import.meta[_0x4198b3(0x1eb)]),_0x234488=dirname(_0x1145e3),_0x9fc7fc=join(_0x234488,_0x4198b3(0x1ee)),_0x61bff8=JSON[_0x4198b3(0x1f0)](readFileSync(_0x9fc7fc,_0x4198b3(0x1e3)));return _0x61bff8[_0x4198b3(0x1e9)];}catch{return _0x4198b3(0x1de);}}function a33_0x4184(){const _0x17a373=['../../package.json','X-Trino-User','parse','45mSWJGf','tdx','12QFqaTR','24997QeAQaX','37388oadDxt','0.0.0','216780BRhBcR','length','Authorization',';\x20node/','utf-8','201480yXAPrN','entries','1465810GEHZCq','replace','209361MhFxsT','version','9CHOIeh','url','70740qWRYxU','TD1\x20'];a33_0x4184=function(){return _0x17a373;};return a33_0x4184();}export function getUserAgent(){const _0x11bc9b=a33_0x52da,_0x4f0da3=getVersion(),_0x54fecc=platform(),_0x1afadc=process[_0x11bc9b(0x1e9)][_0x11bc9b(0x1e7)]('v','');return'tdx/'+_0x4f0da3+'\x20('+_0x54fecc+_0x11bc9b(0x1e2)+_0x1afadc+')';}export function getAuthHeaders(_0x5b155b,_0x3e102){const _0x1683f6=a33_0x52da,_0x2cb131=getVersion(),_0x4b68d1={'User-Agent':getUserAgent(),'X-TD-Client':_0x1683f6(0x1f2),'X-TD-Client-Version':_0x2cb131};return _0x3e102&&(_0x4b68d1[_0x1683f6(0x1e1)]=_0x1683f6(0x1ed)+_0x3e102),_0x4b68d1;}export function toHeaderRecord(_0x24b27f){const _0x35c5ae=a33_0x52da,_0x5f32aa={};for(const [_0x335412,_0x36a2b0]of Object[_0x35c5ae(0x1e5)](_0x24b27f)){_0x36a2b0!==undefined&&(_0x5f32aa[_0x335412]=_0x36a2b0);}return _0x5f32aa;}export function getTrinoHeaders(_0x199e7a,_0x41333a){const _0x4dae6d=a33_0x52da,_0x103518=getAuthHeaders(_0x199e7a,_0x41333a),_0x4d9948=toHeaderRecord(_0x103518);return delete _0x4d9948[_0x4dae6d(0x1e1)],_0x41333a&&(_0x4d9948[_0x4dae6d(0x1ef)]=_0x41333a),_0x4d9948;}export function hasAPIKey(_0x24278d){const _0x4a1165=a33_0x52da,_0x9d8b91=getAPIKey(_0x24278d);return _0x9d8b91!==undefined&&_0x9d8b91[_0x4a1165(0x1e0)]>0x0;}
|
package/dist/core/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xa0a373,_0x2f9f44){const _0x8b725d=a34_0x1aad,_0x520cc9=_0xa0a373();while(!![]){try{const _0x5eb845=-parseInt(_0x8b725d(0x1a0))/0x1+-parseInt(_0x8b725d(0x182))/0x2+-parseInt(_0x8b725d(0x188))/0x3+-parseInt(_0x8b725d(0x1a3))/0x4+parseInt(_0x8b725d(0x1a7))/0x5+parseInt(_0x8b725d(0x1a8))/0x6+parseInt(_0x8b725d(0x195))/0x7;if(_0x5eb845===_0x2f9f44)break;else _0x520cc9['push'](_0x520cc9['shift']());}catch(_0x20a444){_0x520cc9['push'](_0x520cc9['shift']());}}}(a34_0x11d7,0xda39f));function a34_0x1aad(_0x40e450,_0x112a4f){const _0x11d7be=a34_0x11d7();return a34_0x1aad=function(_0x1aadc1,_0x251983){_0x1aadc1=_0x1aadc1-0x178;let _0x26628d=_0x11d7be[_0x1aadc1];return _0x26628d;},a34_0x1aad(_0x40e450,_0x112a4f);}import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync}from'fs';import*as a34_0x550d4a from'node:fs';import*as a34_0x499b73 from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';export function getConfigDir(){const _0x5d4140=a34_0x1aad;return process[_0x5d4140(0x1a1)][_0x5d4140(0x194)]||join(homedir(),_0x5d4140(0x18b),_0x5d4140(0x186));}export function getConfigFile(){const _0x3e7670=a34_0x1aad;return join(getConfigDir(),_0x3e7670(0x179));}export function getCacheDir(){const _0x71ad54=a34_0x1aad;return process[_0x71ad54(0x1a1)][_0x71ad54(0x183)]||join(homedir(),'.cache',_0x71ad54(0x186));}export function getLLMProjectCacheFile(){return join(getCacheDir(),'llm_default_project');}export function readCachedLLMProject(){const _0x17f442=a34_0x1aad;try{const _0x5888ce=getLLMProjectCacheFile();if(!existsSync(_0x5888ce))return null;return readFileSync(_0x5888ce,_0x17f442(0x17f))[_0x17f442(0x1a2)]();}catch{return null;}}export function writeCachedLLMProject(_0x57392a){const _0x1b0616=a34_0x1aad;try{const _0x77afbf=getCacheDir(),_0x1a823f=getLLMProjectCacheFile();!existsSync(_0x77afbf)&&mkdirSync(_0x77afbf,{'recursive':!![]}),writeFileSync(_0x1a823f,_0x57392a,_0x1b0616(0x17f));}catch(_0x51d52d){console[_0x1b0616(0x19b)](_0x1b0616(0x17b),_0x51d52d);}}export function parseEnvFile(_0xba41e5){const _0xfba6a7=a34_0x1aad,_0x48183e={};for(const _0x3bd33d of _0xba41e5[_0xfba6a7(0x1a4)]('\x0a')){const _0x3e571b=_0x3bd33d[_0xfba6a7(0x1a2)]();if(!_0x3e571b||_0x3e571b[_0xfba6a7(0x1aa)]('#'))continue;const _0x4323bc=_0x3e571b['match'](/^([^=]+)=(.*)$/);if(_0x4323bc){const _0x465cfc=_0x4323bc[0x1]['trim']();let _0x548c97=_0x4323bc[0x2][_0xfba6a7(0x1a2)]();(_0x548c97[_0xfba6a7(0x1aa)]('\x22')&&_0x548c97['endsWith']('\x22')||_0x548c97[_0xfba6a7(0x1aa)]('\x27')&&_0x548c97['endsWith']('\x27'))&&(_0x548c97=_0x548c97[_0xfba6a7(0x19f)](0x1,-0x1)),_0x48183e[_0x465cfc]=_0x548c97;}}return _0x48183e;}function a34_0x11d7(){const _0x151342=['Warning:\x20Failed\x20to\x20cache\x20LLM\x20project\x20name:','us01','ap03','.env.','utf-8','dev-us01','global:\x20','1509626bgsAgq','TDX_CACHE_DIR','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','\x20(TD_API_KEY)','tdx','TD_API_KEY','1947732DyCoKm','join','eu01','.config','stg-jp01','entries','profiles','replace','dev-eu01','toUpperCase','jp01','profile','TDX_CONFIG_DIR','29470147HGdtCW','\x27,\x20defaulting\x20to\x20us01','env:\x20TD_API_KEY','stg-us01','readFileSync','tdx.json','error','TD_API_KEY_','env:\x20','profile:\x20','slice','1244990VpEXHm','env','trim','6454188kutZCH','split','parse','stg-ap03','4570365AhCdAr','194130ZqafMJ','existsSync','startsWith','Warning:\x20Failed\x20to\x20load\x20','includes','ap02','.env','warn'];a34_0x11d7=function(){return _0x151342;};return a34_0x11d7();}export function readUserConfig(){const _0x54adbd=a34_0x1aad,_0x4a71ad=getConfigFile();if(!existsSync(_0x4a71ad))return{};try{const _0x3c9993=readFileSync(_0x4a71ad,_0x54adbd(0x17f));return parseEnvFile(_0x3c9993);}catch(_0x5e8687){return console[_0x54adbd(0x17a)](_0x54adbd(0x184)+_0x4a71ad+':',_0x5e8687),{};}}export function resolveSite(_0x7d2e6f){const _0x384f28=a34_0x1aad,_0x121e6b=[_0x384f28(0x17c),'jp01',_0x384f28(0x18a),_0x384f28(0x178),_0x384f28(0x17d),_0x384f28(0x180),_0x384f28(0x190),_0x384f28(0x198),_0x384f28(0x18c),_0x384f28(0x1a6)];if(_0x121e6b[_0x384f28(0x1ac)](_0x7d2e6f))return _0x7d2e6f;if(_0x7d2e6f in SITE_ALIASES)return SITE_ALIASES[_0x7d2e6f];return console[_0x384f28(0x17a)]('Warning:\x20Unknown\x20site\x20\x27'+_0x7d2e6f+_0x384f28(0x196)),_0x384f28(0x17c);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x3305ee,_0x1174af){const _0x472b01=a34_0x1aad,_0x560df4=_0x3305ee[_0x472b01(0x191)]()['replace'](/-/g,'_'),_0x2a41f2=_0x472b01(0x19c)+_0x560df4;if(process[_0x472b01(0x1a1)][_0x2a41f2])return process['env'][_0x2a41f2];if(process[_0x472b01(0x1a1)]['TD_API_KEY'])return process[_0x472b01(0x1a1)]['TD_API_KEY'];const _0x56b502=_0x1174af||getActiveProfileName();if(_0x56b502){const _0x4ab3f9=loadProfileEnv(_0x56b502);if(_0x4ab3f9){if(_0x4ab3f9[_0x2a41f2])return _0x4ab3f9[_0x2a41f2];if(_0x4ab3f9['TD_API_KEY'])return _0x4ab3f9[_0x472b01(0x187)];}}const _0x40604a=loadUserConfigOnce();if(_0x40604a[_0x2a41f2])return _0x40604a[_0x2a41f2];if(_0x40604a[_0x472b01(0x187)])return _0x40604a[_0x472b01(0x187)];return undefined;}export function getAPIKeySource(_0x235915,_0x1be513){const _0x14fb39=a34_0x1aad,_0x3a93a1=_0x14fb39(0x19c)+_0x235915[_0x14fb39(0x191)]()['replace'](/-/g,'_');if(process['env'][_0x3a93a1])return _0x14fb39(0x19d)+_0x3a93a1;if(process[_0x14fb39(0x1a1)][_0x14fb39(0x187)])return _0x14fb39(0x197);const _0x3742e2=_0x1be513||getActiveProfileName();if(_0x3742e2){const _0x5d89bc=loadProfileEnv(_0x3742e2);if(_0x5d89bc){if(_0x5d89bc[_0x3a93a1])return _0x14fb39(0x19e)+_0x3742e2+'\x20('+_0x3a93a1+')';if(_0x5d89bc[_0x14fb39(0x187)])return _0x14fb39(0x19e)+_0x3742e2+_0x14fb39(0x185);}}const _0xd435eb=loadUserConfigOnce(),_0xa1f3c7=getConfigFile();if(_0xd435eb[_0x3a93a1])return _0x14fb39(0x181)+_0xa1f3c7+'\x20('+_0x3a93a1+')';if(_0xd435eb[_0x14fb39(0x187)])return _0x14fb39(0x181)+_0xa1f3c7+_0x14fb39(0x185);return null;}function loadProfileEnv(_0x4812c1){const _0x4515b4=a34_0x1aad,_0x75ae65=a34_0x499b73[_0x4515b4(0x189)](getConfigDir(),_0x4515b4(0x17e)+_0x4812c1);if(a34_0x550d4a[_0x4515b4(0x1a9)](_0x75ae65)){validateSecureFilePermissions(_0x75ae65);try{const _0x5d1d8c=a34_0x550d4a[_0x4515b4(0x199)](_0x75ae65,'utf-8');return parseEnvFile(_0x5d1d8c);}catch(_0x3f503e){console['warn'](_0x4515b4(0x1ab)+_0x75ae65+':\x20'+_0x3f503e);}}const _0x31379e=a34_0x499b73[_0x4515b4(0x189)](getConfigDir(),_0x4515b4(0x18e),_0x4812c1,_0x4515b4(0x179));if(a34_0x550d4a[_0x4515b4(0x1a9)](_0x31379e)){validateSecureFilePermissions(_0x31379e);try{const _0x5d6c66=a34_0x550d4a[_0x4515b4(0x199)](_0x31379e,_0x4515b4(0x17f));return parseEnvFile(_0x5d6c66);}catch(_0x32340c){return console['warn'](_0x4515b4(0x1ab)+_0x31379e+':\x20'+_0x32340c),null;}}return null;}function getActiveProfileName(){const _0x1a2ac6=a34_0x1aad,_0xf386d4=a34_0x499b73[_0x1a2ac6(0x189)](getConfigDir(),_0x1a2ac6(0x19a));if(!a34_0x550d4a[_0x1a2ac6(0x1a9)](_0xf386d4))return null;try{const _0x3acacb=a34_0x550d4a['readFileSync'](_0xf386d4,'utf-8'),_0x2de4ee=JSON[_0x1a2ac6(0x1a5)](_0x3acacb);return _0x2de4ee[_0x1a2ac6(0x193)]||null;}catch{return null;}}export function saveAPIKey(_0x481498,_0x5e7c0a){const _0x15facd=a34_0x1aad,_0x4e0e35=getConfigDir(),_0x1b28e4=getConfigFile();!existsSync(_0x4e0e35)&&mkdirSync(_0x4e0e35,{'recursive':!![],'mode':0x1c0});const _0x2e3e05=readUserConfig(),_0x3b84de=_0x481498[_0x15facd(0x191)]()[_0x15facd(0x18f)](/-/g,'_');_0x2e3e05[_0x15facd(0x19c)+_0x3b84de]=_0x5e7c0a;const _0x405119=Object[_0x15facd(0x18d)](_0x2e3e05)['map'](([_0x443a95,_0x40c682])=>_0x443a95+'='+_0x40c682);writeFileSync(_0x1b28e4,_0x405119['join']('\x0a')+'\x0a',{'mode':0x180});}export function loadConfig(){const _0x5843b0=a34_0x1aad,_0x527721={'apiKeys':{},'defaultSite':_0x5843b0(0x17c)},_0x369d6d=[_0x5843b0(0x17c),_0x5843b0(0x192),_0x5843b0(0x18a),_0x5843b0(0x178),'ap03',_0x5843b0(0x180),_0x5843b0(0x190),_0x5843b0(0x198),'stg-jp01',_0x5843b0(0x1a6)];for(const _0x18cf2c of _0x369d6d){const _0x446147=getAPIKey(_0x18cf2c);_0x446147&&(_0x527721['apiKeys'][_0x18cf2c]=_0x446147);}return _0x527721;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a35_0x4389(_0x5ad661,_0x40171c){const _0x353832=a35_0x3538();return a35_0x4389=function(_0x4389e5,_0x35ac65){_0x4389e5=_0x4389e5-0x9e;let _0xaba38e=_0x353832[_0x4389e5];return _0xaba38e;},a35_0x4389(_0x5ad661,_0x40171c);}function a35_0x3538(){const _0x5c95d7=['activeProfile','866999Ouokla','50fMHAoN','2453008dlTupE','apiKey','Profile','llm_project','globalCredentials','tdx.json','segmentPath','2361508kQcAne','project',':\x20none\x20(using\x20session:\x20','session','join','[context]','global','verbose','Global\x20Credentials','segment_path','profile:\x20','display','2004399azxArD','2229075NZEQtG','cliFlags','llmProject','Profile\x20Credentials',':\x20none','parse','parent_segment','ppid','injectIntoOptions','12sqxtAz','loadGlobalConfig','.json','configFiles','sessions','.env','getSource','replace','profiles','sessionId','\x0a[configuration\x20files]','string','database','(active)','config','layers','default','existsSync','814631rDUHjr','parentSegment','readFileSync','profile','1938cJKcCJ','1029SKEBjN','not\x20set','Project','site','profileCredentials','Session','getParameters','log'];a35_0x3538=function(){return _0x5c95d7;};return a35_0x3538();}const a35_0x306e5b=a35_0x4389;(function(_0x309902,_0x37a7b2){const _0x7af5f5=a35_0x4389,_0x586516=_0x309902();while(!![]){try{const _0x50fbc2=-parseInt(_0x7af5f5(0xa3))/0x1+parseInt(_0x7af5f5(0xa7))/0x2*(parseInt(_0x7af5f5(0xa8))/0x3)+-parseInt(_0x7af5f5(0xba))/0x4+parseInt(_0x7af5f5(0xc7))/0x5+-parseInt(_0x7af5f5(0xd0))/0x6*(-parseInt(_0x7af5f5(0xb1))/0x7)+-parseInt(_0x7af5f5(0xb3))/0x8+-parseInt(_0x7af5f5(0xc6))/0x9*(-parseInt(_0x7af5f5(0xb2))/0xa);if(_0x50fbc2===_0x37a7b2)break;else _0x586516['push'](_0x586516['shift']());}catch(_0x4e84a2){_0x586516['push'](_0x586516['shift']());}}}(a35_0x3538,0x68729));import{resolveSite,getAPIKey,getConfigDir}from'./config.js';import{loadSessionContext}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';import{getActiveProfile,loadProfile}from'./profile.js';import*as a35_0x4561e4 from'node:fs';import*as a35_0x261548 from'node:path';export class GlobalContext{['site'];[a35_0x306e5b(0xdc)];['parent_segment'];[a35_0x306e5b(0xc3)];['llm_project'];[a35_0x306e5b(0xb4)];[a35_0x306e5b(0xc1)];[a35_0x306e5b(0xa0)];[a35_0x306e5b(0xb0)];[a35_0x306e5b(0xd9)];[a35_0x306e5b(0xd3)];constructor(_0x5e6efb){const _0x124179=a35_0x306e5b;this[_0x124179(0xd9)]=_0x5e6efb[_0x124179(0xbd)]||process[_0x124179(0xce)]['toString']();const _0x294e8c=loadSessionContext(_0x5e6efb[_0x124179(0xbd)]),_0x586ff6=loadProjectConfig(),_0x4efeca=this[_0x124179(0xd1)]();this[_0x124179(0xb0)]=_0x5e6efb[_0x124179(0xa6)]||_0x294e8c?.[_0x124179(0xa6)]||_0x4efeca[_0x124179(0xa6)]||getActiveProfile();const _0x287081=this[_0x124179(0xb0)]?loadProfile(this['activeProfile']):null,_0x3eb94c=_0x1c10f6=>{const _0x4029b7=_0x124179;if(!_0x1c10f6)return{};const _0x2a0efa=_0x1c10f6,_0x2b7539={};for(const [_0x390d59,_0x25b583]of Object['entries'](_0x2a0efa)){typeof _0x25b583===_0x4029b7(0xdb)&&(_0x2b7539[_0x390d59]=_0x25b583);}return _0x2b7539;},_0x267161={};if(_0x5e6efb['site']&&_0x5e6efb[_0x124179(0xab)]!=='us01')_0x267161['site']=_0x5e6efb[_0x124179(0xab)];const _0x5a1451=_0x294e8c?.['database'],_0x3220f8=_0x586ff6?.['database'],_0x13913d=_0x287081?.[_0x124179(0x9f)]?.['database'],_0x593ffe=_0x4efeca[_0x124179(0xdc)];_0x5e6efb['database']&&(_0x5e6efb[_0x124179(0xdc)]!==_0x5a1451&&_0x5e6efb[_0x124179(0xdc)]!==_0x3220f8&&_0x5e6efb[_0x124179(0xdc)]!==_0x13913d&&_0x5e6efb[_0x124179(0xdc)]!==_0x593ffe)&&(_0x267161[_0x124179(0xdc)]=_0x5e6efb['database']);if(_0x5e6efb[_0x124179(0xa4)])_0x267161[_0x124179(0xcd)]=_0x5e6efb[_0x124179(0xa4)];if(_0x5e6efb[_0x124179(0xc9)])_0x267161['llm_project']=_0x5e6efb[_0x124179(0xc9)];if(_0x5e6efb[_0x124179(0xa6)])_0x267161[_0x124179(0xa6)]=_0x5e6efb[_0x124179(0xa6)];this[_0x124179(0xa0)]={'cliFlags':_0x267161,'session':_0x3eb94c(_0x294e8c),'project':_0x3eb94c(_0x586ff6),'profile':_0x3eb94c(_0x287081?.[_0x124179(0x9f)]),'global':_0x3eb94c(_0x4efeca)};const _0x6370d7={...this[_0x124179(0xa0)]['global'],...this[_0x124179(0xa0)]['profile'],...this[_0x124179(0xa0)]['project'],...this[_0x124179(0xa0)][_0x124179(0xbd)],...this['layers'][_0x124179(0xc8)]},_0x5d75ab=_0x6370d7[_0x124179(0xab)]||'us01';this[_0x124179(0xab)]=resolveSite(_0x5d75ab),this[_0x124179(0xdc)]=_0x6370d7[_0x124179(0xdc)],this[_0x124179(0xcd)]=_0x6370d7[_0x124179(0xcd)],this[_0x124179(0xc3)]=_0x6370d7[_0x124179(0xc3)],this['llm_project']=_0x6370d7[_0x124179(0xb6)],this['verbose']=_0x5e6efb[_0x124179(0xc1)]||![],this[_0x124179(0xb4)]=getAPIKey(this[_0x124179(0xab)],this['activeProfile']||undefined);const _0x2dfe44=getConfigDir(),_0xca478e=a35_0x261548[_0x124179(0xbe)](_0x2dfe44,_0x124179(0xd4),this['sessionId']+_0x124179(0xd2)),_0x32214f=findProjectConfigPath(),_0x5c86ac=a35_0x261548[_0x124179(0xbe)](_0x2dfe44,_0x124179(0xb8)),_0x4fa03f=a35_0x261548[_0x124179(0xbe)](_0x2dfe44,_0x124179(0xd5));let _0x19c44b=null,_0x37221d=null;this['activeProfile']&&(_0x19c44b=a35_0x261548[_0x124179(0xbe)](_0x2dfe44,_0x124179(0xd8),this[_0x124179(0xb0)],'tdx.json'),_0x37221d=a35_0x261548[_0x124179(0xbe)](_0x2dfe44,_0x124179(0xd8),this[_0x124179(0xb0)],'.env')),this[_0x124179(0xd3)]={'session':a35_0x4561e4[_0x124179(0xa2)](_0xca478e)?_0xca478e:null,'project':_0x32214f,'profile':_0x19c44b&&a35_0x4561e4[_0x124179(0xa2)](_0x19c44b)?_0x19c44b:null,'profileCredentials':_0x37221d&&a35_0x4561e4['existsSync'](_0x37221d)?_0x37221d:null,'global':a35_0x4561e4[_0x124179(0xa2)](_0x5c86ac)?_0x5c86ac:null,'globalCredentials':a35_0x4561e4[_0x124179(0xa2)](_0x4fa03f)?_0x4fa03f:null};}['getSource'](_0x56dd06,_0x4702bc){const _0x5e57bf=a35_0x306e5b;if(!_0x4702bc)return _0x5e57bf(0xa9);const _0x4d42e0=_0x4702bc;if(this[_0x5e57bf(0xa0)][_0x5e57bf(0xc8)][_0x56dd06]===_0x4d42e0){if(_0x56dd06===_0x5e57bf(0xab)&&_0x4d42e0==='us01'&&!this[_0x5e57bf(0xa0)][_0x5e57bf(0xbd)][_0x5e57bf(0xab)]&&!this[_0x5e57bf(0xa0)][_0x5e57bf(0xbb)][_0x5e57bf(0xab)]&&!this[_0x5e57bf(0xa0)][_0x5e57bf(0xa6)]['site']&&!this['layers'][_0x5e57bf(0xc0)]['site'])return _0x5e57bf(0xa1);return'CLI\x20flag:\x20--'+_0x56dd06[_0x5e57bf(0xd7)](/_/g,'-');}if(this[_0x5e57bf(0xa0)][_0x5e57bf(0xbd)][_0x56dd06]===_0x4d42e0)return _0x5e57bf(0xbd);if(this[_0x5e57bf(0xa0)][_0x5e57bf(0xbb)][_0x56dd06]===_0x4d42e0)return _0x5e57bf(0xbb);if(this['layers'][_0x5e57bf(0xa6)][_0x56dd06]===_0x4d42e0)return _0x5e57bf(0xc4)+this['activeProfile'];if(this['layers'][_0x5e57bf(0xc0)][_0x56dd06]===_0x4d42e0)return _0x5e57bf(0xc0);return _0x5e57bf(0xa1);}[a35_0x306e5b(0xd1)](){const _0x1eccde=a35_0x306e5b,_0x375570=a35_0x261548[_0x1eccde(0xbe)](getConfigDir(),'tdx.json');if(!a35_0x4561e4['existsSync'](_0x375570))return{};try{const _0x5150d7=a35_0x4561e4[_0x1eccde(0xa5)](_0x375570,'utf-8');return JSON[_0x1eccde(0xcc)](_0x5150d7);}catch{return{};}}[a35_0x306e5b(0xcf)](_0x5cd565){const _0x51dbeb=a35_0x306e5b;_0x5cd565[_0x51dbeb(0xab)]=this[_0x51dbeb(0xab)],!_0x5cd565[_0x51dbeb(0xdc)]&&this[_0x51dbeb(0xdc)]&&(_0x5cd565[_0x51dbeb(0xdc)]=this[_0x51dbeb(0xdc)]),!_0x5cd565['parentSegment']&&this[_0x51dbeb(0xcd)]&&(_0x5cd565[_0x51dbeb(0xa4)]=this[_0x51dbeb(0xcd)]),!_0x5cd565[_0x51dbeb(0xb9)]&&this[_0x51dbeb(0xc3)]&&(_0x5cd565[_0x51dbeb(0xb9)]=this[_0x51dbeb(0xc3)]),!_0x5cd565[_0x51dbeb(0xc9)]&&this[_0x51dbeb(0xb6)]&&(_0x5cd565[_0x51dbeb(0xc9)]=this[_0x51dbeb(0xb6)]);}[a35_0x306e5b(0xae)](){const _0x238224=a35_0x306e5b;return[{'key':_0x238224(0xab),'value':this[_0x238224(0xab)]},{'key':'database','value':this['database']},{'key':_0x238224(0xcd),'value':this['parent_segment']},{'key':_0x238224(0xc3),'value':this[_0x238224(0xc3)]},{'key':_0x238224(0xb6),'value':this['llm_project']},{'key':'profile','value':this['activeProfile']||undefined}];}[a35_0x306e5b(0xc5)](){const _0x1ce2c4=a35_0x306e5b;console[_0x1ce2c4(0xaf)]('[context]');for(const {key:_0x59ba39,value:_0x20756f}of this['getParameters']()){_0x20756f&&console['log'](_0x59ba39+':\x20'+_0x20756f);}}['displayWithSources'](){const _0x2314cb=a35_0x306e5b;console[_0x2314cb(0xaf)](_0x2314cb(0xbf));for(const {key:_0x5c8f80,value:_0x14ea19}of this[_0x2314cb(0xae)]()){if(_0x14ea19){const _0x1bbe5e=_0x5c8f80==='profile'?_0x2314cb(0x9e):'('+this[_0x2314cb(0xd6)](_0x5c8f80,_0x14ea19)+')';console[_0x2314cb(0xaf)](_0x5c8f80+':\x20'+_0x14ea19+'\x20'+_0x1bbe5e);}}console[_0x2314cb(0xaf)](_0x2314cb(0xda));const _0x26679b=[{'label':_0x2314cb(0xad),'path':this[_0x2314cb(0xd3)]['session'],'extra':'(session:\x20'+this[_0x2314cb(0xd9)]+')'},{'label':'Project','path':this[_0x2314cb(0xd3)]['project']},{'label':_0x2314cb(0xb5),'path':this[_0x2314cb(0xd3)]['profile']},{'label':_0x2314cb(0xca),'path':this['configFiles'][_0x2314cb(0xac)]},{'label':'Global','path':this[_0x2314cb(0xd3)][_0x2314cb(0xc0)]},{'label':_0x2314cb(0xc2),'path':this[_0x2314cb(0xd3)][_0x2314cb(0xb7)]}];for(const {label:_0x1bd5fe,path:_0x444c34,extra:_0x167fff}of _0x26679b){if(_0x444c34)console['log'](_0x1bd5fe+':\x20'+_0x444c34+'\x20✓'+(_0x167fff?'\x20'+_0x167fff:''));else{if(_0x1bd5fe===_0x2314cb(0xad))console[_0x2314cb(0xaf)](_0x1bd5fe+_0x2314cb(0xbc)+this[_0x2314cb(0xd9)]+')');else(_0x1bd5fe===_0x2314cb(0xaa)||_0x1bd5fe==='Global')&&console['log'](_0x1bd5fe+_0x2314cb(0xcb));}}}}
|