@treasuredata/tdx 0.1.19 → 0.1.20
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/README.md +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +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.map +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/anthropic-adapter.js.map +1 -1
- package/dist/proxy/server.d.ts.map +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/server.js.map +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/database.js +1 -1
- package/dist/sdk/errors.d.ts +3 -1
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment.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/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a23_0x43a657=a23_0x26df;(function(_0x5d4cfc,_0x2c6eee){const _0x569e75=a23_0x26df,_0x2daac2=_0x5d4cfc();while(!![]){try{const _0x2042a5=-parseInt(_0x569e75(0x117))/0x1+-parseInt(_0x569e75(0xf1))/0x2*(-parseInt(_0x569e75(0x104))/0x3)+parseInt(_0x569e75(0x112))/0x4+-parseInt(_0x569e75(0xf9))/0x5+parseInt(_0x569e75(0xf4))/0x6+parseInt(_0x569e75(0x101))/0x7*(-parseInt(_0x569e75(0x109))/0x8)+-parseInt(_0x569e75(0x111))/0x9*(-parseInt(_0x569e75(0x114))/0xa);if(_0x2042a5===_0x2c6eee)break;else _0x2daac2['push'](_0x2daac2['shift']());}catch(_0x32b074){_0x2daac2['push'](_0x2daac2['shift']());}}}(a23_0x44e5,0xcc20c));import{BaseCommand}from'./command.js';function a23_0x26df(_0x305635,_0x47a499){const _0x44e5b4=a23_0x44e5();return a23_0x26df=function(_0x26df72,_0x5c9c57){_0x26df72=_0x26df72-0xea;let _0x54941a=_0x44e5b4[_0x26df72];return _0x54941a;},a23_0x26df(_0x305635,_0x47a499);}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{[a23_0x43a657(0xef)]=a23_0x43a657(0xf6);[a23_0x43a657(0xeb)]=a23_0x43a657(0xfa);async[a23_0x43a657(0xf0)](_0x14fc89){const _0x173704=a23_0x43a657,{options:_0x110b4c,args:_0x1979b5,tdx:_0x56d797}=_0x14fc89,_0x2dc352=_0x110b4c;if(_0x1979b5[_0x173704(0x110)]===0x0)return console[_0x173704(0xea)](_0x173704(0x102)),console[_0x173704(0xea)](_0x173704(0x116)),console[_0x173704(0xea)](_0x173704(0x113)),console[_0x173704(0xea)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x173704(0xea)](_0x173704(0xf7)),console[_0x173704(0xea)](_0x173704(0xed)),0x1;const _0x5e81dd=_0x1979b5[0x0],_0x99540a=_0x110b4c['segmentPath'];let _0x136bf6=_0x5e81dd;_0x99540a&&!_0x5e81dd[_0x173704(0x10c)]('/')&&(_0x136bf6=_0x99540a+'/'+_0x5e81dd,_0x2dc352[_0x173704(0x115)]&&console[_0x173704(0xea)]('Resolved\x20relative\x20path\x20to:\x20'+_0x136bf6));const _0x30ae8f=parsePath(_0x136bf6);if(_0x30ae8f[_0x173704(0xf8)][_0x173704(0x110)]<0x2)return console[_0x173704(0xea)](_0x173704(0xec)),console['error'](_0x173704(0x10d)),0x1;const _0x10125b=_0x30ae8f[_0x173704(0xf8)][0x0],_0x550b4a=getBaseName(_0x136bf6),_0x3a31d=getParentPath(_0x136bf6);_0x2dc352['verbose']&&(console['error']('Site:\x20'+_0x2dc352[_0x173704(0xee)]),console['error'](_0x173704(0x106)+_0x136bf6),console[_0x173704(0xea)](_0x173704(0x10a)+_0x10125b),console[_0x173704(0xea)]('Segment\x20name:\x20'+_0x550b4a),console[_0x173704(0xea)]('Parent\x20path:\x20'+_0x3a31d));const _0x3be583=await withSpinner(_0x173704(0x118)+_0x10125b+'\x27...',()=>_0x56d797['segment']['resolveParentId'](_0x10125b),{'verbose':_0x2dc352['verbose']}),_0x28ca06=_0x3be583['data'];let _0x33b74e;if(_0x30ae8f['segments'][_0x173704(0x110)]>0x2){const _0x5ceb47=await withSpinner(_0x173704(0xf2)+_0x3a31d+'\x27...',()=>_0x56d797[_0x173704(0xfc)][_0x173704(0x100)](_0x3a31d),{'verbose':_0x2dc352[_0x173704(0x115)]}),_0x5699a8=_0x5ceb47[_0x173704(0x108)];if(_0x5699a8['type']!==_0x173704(0xfe)&&_0x5699a8[_0x173704(0x10f)]!==_0x173704(0xfd))return console[_0x173704(0xea)](_0x173704(0x10b)),0x1;_0x33b74e=_0x5699a8['folderId'];}else{if(_0x2dc352[_0x173704(0xfe)]){const _0xbab09e=await withSpinner('Resolving\x20folder\x20\x27'+_0x2dc352[_0x173704(0xfe)]+'\x27...',()=>_0x56d797[_0x173704(0xfc)][_0x173704(0x107)](_0x28ca06,_0x2dc352[_0x173704(0xfe)]),{'verbose':_0x2dc352[_0x173704(0x115)]});_0x33b74e=_0xbab09e['data'];}}_0x2dc352['verbose']&&_0x33b74e&&console[_0x173704(0xea)]('Resolved\x20folder\x20ID:\x20'+_0x33b74e);const _0x2e4b61=await loadJSONFromOptions(_0x2dc352[_0x173704(0x10e)],_0x2dc352[_0x173704(0xf5)]),_0x35e800={'name':_0x550b4a,'description':_0x2dc352[_0x173704(0xeb)],'rule':_0x2e4b61,'kind':_0x2dc352['kind']!==undefined?parseInt(_0x2dc352[_0x173704(0x103)],0xa):undefined,'isVisible':_0x2dc352[_0x173704(0xff)]?![]:undefined,'segmentFolderId':_0x33b74e,'countPopulation':_0x2dc352['noCountPopulation']?![]:undefined},_0x345e04=await withSpinner('Creating\x20segment\x20\x27'+_0x550b4a+_0x173704(0xf3),()=>_0x56d797[_0x173704(0xfc)][_0x173704(0xfb)](_0x28ca06,_0x35e800),{'verbose':_0x2dc352[_0x173704(0x115)]}),_0x1996d1=_0x345e04[_0x173704(0x108)];return console['error']('✔\x20Created\x20segment\x20\x27'+_0x1996d1['name']+'\x27\x20with\x20ID:\x20'+_0x1996d1['id']),_0x136bf6!==_0x5e81dd&&console[_0x173704(0xea)](_0x173704(0x105)+_0x136bf6),await handleSDKOutput([_0x1996d1],_0x2dc352),0x0;}}function a23_0x44e5(){const _0x4270fc=['site','name','execute','45566TbcdaV','Resolving\x20folder\x20path\x20\x27','\x27...','6302190chDMeo','ruleFile','segment:create','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','segments','2779090RLYLNc','Create\x20child\x20segment\x20with\x20filtering\x20rules','createSegment','segment','parent','folder','invisible','resolvePathToResource','11003629LVnZGp','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','kind','147ARgwck','\x20\x20\x20Path:\x20','Target\x20path:\x20','resolveFolderId','data','8fhdhdu','Parent:\x20','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','includes','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','rule','type','length','2302821wyJZIc','3233312ePaLBp','Examples:','20EATFks','verbose','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','522925XTBIIl','Resolving\x20parent\x20segment\x20\x27','error','description','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'];a23_0x44e5=function(){return _0x4270fc;};return a23_0x44e5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a24_0x58fb(){const _0x295bb2=['3453461wVhTwX','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','2vVZcGj','\x20field','data','length','7gNceaK','segment','\x27...','verbose','List\x20available\x20fields\x20for\x20segmentation','execute','3285032npUMEx','351011YyPtPV','626890NXbFjx','segment:fields','Site:\x20','description','Error:\x20Parent\x20segment\x20name\x20is\x20required','error','178284cVDHZN','1907840RWagjD','9TjDrde','listFields','name','39VuhBXy','Listing\x20fields\x20for\x20\x27','1248054GczSBq','✔\x20Found\x20'];a24_0x58fb=function(){return _0x295bb2;};return a24_0x58fb();}function a24_0x1edb(_0x39a57f,_0x42fb57){const _0x58fbe1=a24_0x58fb();return a24_0x1edb=function(_0x1edb0b,_0x3e5a48){_0x1edb0b=_0x1edb0b-0x1e1;let _0x123366=_0x58fbe1[_0x1edb0b];return _0x123366;},a24_0x1edb(_0x39a57f,_0x42fb57);}const a24_0x3084f3=a24_0x1edb;(function(_0x214e8b,_0x37405e){const _0x32d0c1=a24_0x1edb,_0x37c93d=_0x214e8b();while(!![]){try{const _0x2e8e19=parseInt(_0x32d0c1(0x1f1))/0x1*(-parseInt(_0x32d0c1(0x1e6))/0x2)+parseInt(_0x32d0c1(0x1fd))/0x3*(-parseInt(_0x32d0c1(0x1f8))/0x4)+parseInt(_0x32d0c1(0x1f2))/0x5+parseInt(_0x32d0c1(0x1e2))/0x6*(parseInt(_0x32d0c1(0x1ea))/0x7)+-parseInt(_0x32d0c1(0x1f0))/0x8*(-parseInt(_0x32d0c1(0x1fa))/0x9)+parseInt(_0x32d0c1(0x1f9))/0xa+parseInt(_0x32d0c1(0x1e4))/0xb;if(_0x2e8e19===_0x37405e)break;else _0x37c93d['push'](_0x37c93d['shift']());}catch(_0x2feb34){_0x37c93d['push'](_0x37c93d['shift']());}}}(a24_0x58fb,0x4db6d));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{[a24_0x3084f3(0x1fc)]=a24_0x3084f3(0x1f3);[a24_0x3084f3(0x1f5)]=a24_0x3084f3(0x1ee);async[a24_0x3084f3(0x1ef)](_0x595363){const _0x341730=a24_0x3084f3,{options:_0x345524,args:_0x530d95,tdx:_0x34e76e}=_0x595363;if(_0x530d95[_0x341730(0x1e9)]===0x0)return console[_0x341730(0x1f7)](_0x341730(0x1f6)),console[_0x341730(0x1f7)](_0x341730(0x1e5)),0x1;const _0x322d4d=_0x530d95[0x0];_0x345524[_0x341730(0x1ed)]&&(console['error'](_0x341730(0x1f4)+_0x345524['site']),console[_0x341730(0x1f7)]('Parent\x20segment:\x20'+_0x322d4d));const _0x4ac02e=await withSpinner(_0x341730(0x1e1)+_0x322d4d+_0x341730(0x1ec),()=>_0x34e76e[_0x341730(0x1eb)][_0x341730(0x1fb)](_0x322d4d),{'verbose':_0x345524[_0x341730(0x1ed)]}),_0x39e6c0=_0x4ac02e[_0x341730(0x1e8)];return console[_0x341730(0x1f7)](_0x341730(0x1e3)+_0x39e6c0[_0x341730(0x1e9)]+_0x341730(0x1e7)+(_0x39e6c0[_0x341730(0x1e9)]!==0x1?'s':'')),await handleSDKOutput(_0x39e6c0,_0x345524),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x55da45=a25_0xc014;function a25_0xc014(_0x3940af,_0x4b01c1){const _0x2e97bc=a25_0x2e97();return a25_0xc014=function(_0xc01454,_0x5cfe1f){_0xc01454=_0xc01454-0x1db;let _0x53a551=_0x2e97bc[_0xc01454];return _0x53a551;},a25_0xc014(_0x3940af,_0x4b01c1);}(function(_0x50c5ff,_0x54bda0){const _0x54935d=a25_0xc014,_0x193ba0=_0x50c5ff();while(!![]){try{const _0x2560e4=-parseInt(_0x54935d(0x1ec))/0x1*(parseInt(_0x54935d(0x1e4))/0x2)+parseInt(_0x54935d(0x1f1))/0x3*(parseInt(_0x54935d(0x1f0))/0x4)+-parseInt(_0x54935d(0x1e8))/0x5*(-parseInt(_0x54935d(0x1de))/0x6)+-parseInt(_0x54935d(0x1dc))/0x7+parseInt(_0x54935d(0x1df))/0x8*(-parseInt(_0x54935d(0x1e0))/0x9)+parseInt(_0x54935d(0x1eb))/0xa*(-parseInt(_0x54935d(0x1e6))/0xb)+-parseInt(_0x54935d(0x1ea))/0xc*(-parseInt(_0x54935d(0x1e9))/0xd);if(_0x2560e4===_0x54bda0)break;else _0x193ba0['push'](_0x193ba0['shift']());}catch(_0x1a0a3e){_0x193ba0['push'](_0x193ba0['shift']());}}}(a25_0x2e97,0x5f823));import{BaseCommand}from'./command.js';function a25_0x2e97(){const _0x1bdb44=['log','stringify','json','1766pQooIi','\x20\x20Path:\x20','22627MUkHwZ','Context\x20details:','15pILJjs','26fvxtEk','5097684ZTFHzN','420WdeHfN','687qAXcjL','format','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','error','2466388eYPLNn','3MnRtUV','jsonl','root','1907850XhOcFq','segment:pwd','1295634CdqUtT','288NvRxgU','189315jEAjFw'];a25_0x2e97=function(){return _0x1bdb44;};return a25_0x2e97();}export class SegmentPwdCommand extends BaseCommand{['name']=a25_0x55da45(0x1dd);['description']='Show\x20current\x20segment/folder\x20context';async['execute'](_0x1e29e5){const _0x3f2a6f=a25_0x55da45,{options:_0x1be658}=_0x1e29e5;try{const _0x5cf156=_0x1be658['segmentPath'];if(!_0x5cf156)return _0x1be658['format']===_0x3f2a6f(0x1e3)||_0x1be658[_0x3f2a6f(0x1ed)]===_0x3f2a6f(0x1f2)?console[_0x3f2a6f(0x1e1)](JSON['stringify']({'path':'/','type':_0x3f2a6f(0x1db)})):console[_0x3f2a6f(0x1e1)]('/'),0x0;if(_0x1be658[_0x3f2a6f(0x1ed)]===_0x3f2a6f(0x1e3)||_0x1be658[_0x3f2a6f(0x1ed)]===_0x3f2a6f(0x1f2)){const _0xb9accf={'path':_0x5cf156};console[_0x3f2a6f(0x1e1)](JSON[_0x3f2a6f(0x1e2)](_0xb9accf));}else console[_0x3f2a6f(0x1e1)](_0x5cf156),_0x1be658['verbose']&&(console[_0x3f2a6f(0x1ef)](''),console[_0x3f2a6f(0x1ef)](_0x3f2a6f(0x1e7)),console[_0x3f2a6f(0x1ef)](_0x3f2a6f(0x1e5)+_0x5cf156),console['error'](''),console['error'](_0x3f2a6f(0x1ee)),console[_0x3f2a6f(0x1ef)]('Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources'));return 0x0;}catch(_0x25d969){throw _0x25d969;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a26_0x1431(){const _0x304dfa=['Parent\x20ID:\x20','name','kind','Segment\x20ID\x20missing\x20from\x20resolved\x20path','parentId','\x20\x20\x20Path:\x20','segment','data','9002076fzMvzf','2690733UlTkMz','folder','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','1288301ThAurQ','segmentPath','verbose','segment:update','\x27...','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','type','1353088XlIAma','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','2mgPbwf','277700bZhITJ','5ijCHEg','Resolved\x20relative\x20path\x20to:\x20','error','Update\x20existing\x20child\x20segment','Examples:','Segment\x20ID:\x20','65942cGjNul','Resolved\x20type:\x20','includes','4870592vwHbQJ','8orSJXX','✔\x20Updated\x20segment\x20\x27','INTERNAL','180XsBhMR'];a26_0x1431=function(){return _0x304dfa;};return a26_0x1431();}const a26_0x3f7489=a26_0x29c0;function a26_0x29c0(_0x599c94,_0x262f54){const _0x14312e=a26_0x1431();return a26_0x29c0=function(_0x29c0c1,_0x3bcc69){_0x29c0c1=_0x29c0c1-0x11e;let _0x5af9ef=_0x14312e[_0x29c0c1];return _0x5af9ef;},a26_0x29c0(_0x599c94,_0x262f54);}(function(_0x2668b4,_0x1a4a9f){const _0x16691b=a26_0x29c0,_0x46b035=_0x2668b4();while(!![]){try{const _0x5bafc5=parseInt(_0x16691b(0x120))/0x1+-parseInt(_0x16691b(0x13e))/0x2*(-parseInt(_0x16691b(0x131))/0x3)+-parseInt(_0x16691b(0x123))/0x4*(parseInt(_0x16691b(0x140))/0x5)+parseInt(_0x16691b(0x130))/0x6+parseInt(_0x16691b(0x134))/0x7*(parseInt(_0x16691b(0x124))/0x8)+parseInt(_0x16691b(0x127))/0x9*(-parseInt(_0x16691b(0x13f))/0xa)+-parseInt(_0x16691b(0x13c))/0xb;if(_0x5bafc5===_0x1a4a9f)break;else _0x46b035['push'](_0x46b035['shift']());}catch(_0x28d44f){_0x46b035['push'](_0x46b035['shift']());}}}(a26_0x1431,0xb7652));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{[a26_0x3f7489(0x129)]=a26_0x3f7489(0x137);['description']=a26_0x3f7489(0x143);async['execute'](_0x1c296a){const _0x5ead8c=a26_0x3f7489,{options:_0x1ef7c4,args:_0x24e026,tdx:_0xc98ddd}=_0x1c296a,_0x34fa81=_0x1ef7c4;if(_0x24e026['length']===0x0)return console[_0x5ead8c(0x142)](_0x5ead8c(0x133)),console[_0x5ead8c(0x142)](_0x5ead8c(0x13d)),console[_0x5ead8c(0x142)](_0x5ead8c(0x11e)),console[_0x5ead8c(0x142)](_0x5ead8c(0x139)),console[_0x5ead8c(0x142)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x1d1331=_0x24e026[0x0],_0xef423a=_0x1ef7c4[_0x5ead8c(0x135)];let _0x560257=_0x1d1331;_0xef423a&&!_0x1d1331[_0x5ead8c(0x122)]('/')&&(_0x560257=_0xef423a+'/'+_0x1d1331,_0x34fa81[_0x5ead8c(0x136)]&&console['error'](_0x5ead8c(0x141)+_0x560257));const _0x3c09d0=await withSpinner('Resolving\x20path\x20\x27'+_0x560257+_0x5ead8c(0x138),()=>_0xc98ddd[_0x5ead8c(0x12e)]['resolvePathToResource'](_0x560257),{'verbose':_0x34fa81['verbose']}),_0x41216e=_0x3c09d0[_0x5ead8c(0x12f)];_0x34fa81[_0x5ead8c(0x136)]&&console[_0x5ead8c(0x142)](_0x5ead8c(0x121)+_0x41216e['type']);if(_0x41216e['type']!=='segment')return console['error']('Error:\x20Cannot\x20update\x20'+_0x41216e[_0x5ead8c(0x13b)]+_0x5ead8c(0x13a)),console[_0x5ead8c(0x142)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x41216e['segmentId'])throw new SDKError(ErrorCode[_0x5ead8c(0x126)],_0x5ead8c(0x12b));const _0xae20e3=_0x41216e[_0x5ead8c(0x12c)],_0x217529=_0x41216e['segmentId'];_0x34fa81[_0x5ead8c(0x136)]&&(console[_0x5ead8c(0x142)](_0x5ead8c(0x128)+_0xae20e3),console[_0x5ead8c(0x142)](_0x5ead8c(0x11f)+_0x217529));let _0x20eec1;if(_0x34fa81['folder']){const _0x35d1ea=_0x34fa81[_0x5ead8c(0x132)],_0x39964a=await withSpinner('Resolving\x20folder\x20\x27'+_0x35d1ea+_0x5ead8c(0x138),()=>_0xc98ddd[_0x5ead8c(0x12e)]['resolveFolderId'](_0xae20e3,_0x35d1ea),{'verbose':_0x34fa81['verbose']});_0x20eec1=parseInt(_0x39964a['data'],0xa),_0x34fa81[_0x5ead8c(0x136)]&&console[_0x5ead8c(0x142)]('Resolved\x20folder\x20ID:\x20'+_0x20eec1);}const _0x343c27=await loadJSONFromOptions(_0x34fa81['rule'],_0x34fa81['ruleFile']),_0x58bee9={'name':_0x34fa81['name'],'description':_0x34fa81['description'],'rule':_0x343c27,'kind':_0x34fa81[_0x5ead8c(0x12a)]!==undefined?parseInt(_0x34fa81['kind'],0xa):undefined,'segmentFolderId':_0x20eec1},_0x8c33a2=await withSpinner('Updating\x20segment\x20\x27'+_0x41216e['segmentName']+'\x27...',()=>_0xc98ddd[_0x5ead8c(0x12e)]['updateSegmentById'](_0xae20e3,_0x217529,_0x58bee9),{'verbose':_0x34fa81['verbose']}),_0x123a0a=_0x8c33a2['data'];return console[_0x5ead8c(0x142)](_0x5ead8c(0x125)+_0x123a0a['name']+'\x27'),_0x560257!==_0x1d1331&&console[_0x5ead8c(0x142)](_0x5ead8c(0x12d)+_0x560257),await handleSDKOutput([_0x123a0a],_0x34fa81),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a27_0xa9f964=a27_0x1e3c;(function(_0x407e2d,_0x453b2e){const _0x234114=a27_0x1e3c,_0x4c1c86=_0x407e2d();while(!![]){try{const _0x23ee26=parseInt(_0x234114(0xbf))/0x1+-parseInt(_0x234114(0xe1))/0x2*(parseInt(_0x234114(0xc3))/0x3)+parseInt(_0x234114(0xb4))/0x4+-parseInt(_0x234114(0xda))/0x5*(parseInt(_0x234114(0xe6))/0x6)+-parseInt(_0x234114(0xb7))/0x7*(parseInt(_0x234114(0xe4))/0x8)+parseInt(_0x234114(0xe8))/0x9*(-parseInt(_0x234114(0xbc))/0xa)+-parseInt(_0x234114(0xe7))/0xb*(-parseInt(_0x234114(0xc4))/0xc);if(_0x23ee26===_0x453b2e)break;else _0x4c1c86['push'](_0x4c1c86['shift']());}catch(_0x3d151b){_0x4c1c86['push'](_0x4c1c86['shift']());}}}(a27_0x10c2,0x66f35));function a27_0x10c2(){const _0x2677fa=['Use:\x20tdx\x20segment\x20use\x20','Usage:\x20tdx\x20segment\x20use\x20<path>','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','description','name','split','segment','resolvePathToResource','Examples:','slice','Folder\x20ID:\x20','error','Error:\x20Path\x20is\x20required','292425tqPyji','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','type','Context\x20cleared.\x20Back\x20to\x20root.','parentId','folderId','isAbsolute','2wPlrgg','Parent\x20ID:\x20','session','5741224gzxlpy','Target\x20path:\x20','48bBjYCU','4562932XwyWgn','2978253dZoejv','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','2868512qCuXyH','folderPath','segments','7ClnLQk','segmentPath','data','Context\x20set\x20to:\x20','verbose','10VgUWFT','Resolving\x20path\x20\x27','Resolved\x20path\x20type:\x20','300392TFIEtp','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','length','segment:use','971463gmTSaI','36iZTkKL','execute','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','site','join','Site:\x20','log','fullPath'];a27_0x10c2=function(){return _0x2677fa;};return a27_0x10c2();}import{BaseCommand}from'./command.js';function a27_0x1e3c(_0x3acff6,_0x2c81f6){const _0x10c23e=a27_0x10c2();return a27_0x1e3c=function(_0x1e3c07,_0x54dcb8){_0x1e3c07=_0x1e3c07-0xb3;let _0x807984=_0x10c23e[_0x1e3c07];return _0x807984;},a27_0x1e3c(_0x3acff6,_0x2c81f6);}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_0xa9f964(0xd1)]=a27_0xa9f964(0xc2);[a27_0xa9f964(0xd0)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a27_0xa9f964(0xc5)](_0x4378c7){const _0xedca74=a27_0xa9f964,{options:_0x4f7472,args:_0x343bb5,tdx:_0x22c34a}=_0x4378c7;if(_0x343bb5[_0xedca74(0xc1)]===0x0)return console[_0xedca74(0xd8)](_0xedca74(0xd9)),console['error'](_0xedca74(0xcd)),console[_0xedca74(0xd8)](_0xedca74(0xd5)),console[_0xedca74(0xd8)](_0xedca74(0xce)),console[_0xedca74(0xd8)](_0xedca74(0xb3)),console['error'](_0xedca74(0xdb)),console[_0xedca74(0xd8)]('\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 _0x353338=_0x343bb5[0x0],_0x45dce4=_0x4f7472[_0xedca74(0xe3)];try{if(_0x353338==='/')return saveSessionContext({'segment_path':undefined},_0x45dce4),console[_0xedca74(0xca)](_0xedca74(0xdd)),0x0;const _0x55b01c=_0x4f7472[_0xedca74(0xb8)];let _0xd6f10f=_0x353338;const _0x5eafcc=parsePath(_0x353338);if(!_0x5eafcc[_0xedca74(0xe0)]){if(!_0x55b01c)return console[_0xedca74(0xd8)](_0xedca74(0xc0)),console[_0xedca74(0xd8)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>'),0x1;if(_0x353338==='..'){const _0x2d1175=_0x55b01c[_0xedca74(0xd2)]('/')[_0xedca74(0xd6)](0x0,-0x1)[_0xedca74(0xc8)]('/');_0xd6f10f=_0x2d1175||'/';}else _0x353338==='.'?_0xd6f10f=_0x55b01c:_0xd6f10f=_0x55b01c+'/'+_0x353338;_0x4f7472[_0xedca74(0xbb)]&&console[_0xedca74(0xd8)](_0xedca74(0xea)+_0xd6f10f);}if(_0xd6f10f==='/'||_0xd6f10f==='')return saveSessionContext({'segment_path':undefined},_0x45dce4),console[_0xedca74(0xca)](_0xedca74(0xdd)),0x0;_0xd6f10f=normalizePath(_0xd6f10f);const _0x5c3fb1=parsePath(_0xd6f10f)[_0xedca74(0xb6)];if(_0x5c3fb1['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x45dce4),console[_0xedca74(0xca)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;_0x4f7472['verbose']&&(console[_0xedca74(0xd8)](_0xedca74(0xc9)+_0x4f7472[_0xedca74(0xc7)]),console[_0xedca74(0xd8)](_0xedca74(0xe5)+_0xd6f10f));const _0xd21dc5=await withSpinner(_0xedca74(0xbd)+_0xd6f10f+'\x27...',()=>_0x22c34a[_0xedca74(0xd3)][_0xedca74(0xd4)](_0xd6f10f),{'verbose':_0x4f7472['verbose']}),_0x5c1ab2=_0xd21dc5[_0xedca74(0xb9)];_0x4f7472['verbose']&&(console['error'](_0xedca74(0xbe)+_0x5c1ab2[_0xedca74(0xdc)]),console[_0xedca74(0xd8)](_0xedca74(0xe2)+_0x5c1ab2[_0xedca74(0xde)]),_0x5c1ab2[_0xedca74(0xdf)]&&console[_0xedca74(0xd8)](_0xedca74(0xd7)+_0x5c1ab2[_0xedca74(0xdf)]));if(_0x5c1ab2['type']===_0xedca74(0xd3))return console[_0xedca74(0xd8)](_0xedca74(0xcf)),console['error']('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0xedca74(0xd8)](_0xedca74(0xcc)+_0x5c1ab2['parentName']+(_0x5c1ab2[_0xedca74(0xb5)]?'/'+_0x5c1ab2[_0xedca74(0xb5)]['join']('/'):'')),0x1;return saveSessionContext({'segment_path':_0x5c1ab2[_0xedca74(0xcb)],'parent_segment':_0x5c1ab2['parentName']},_0x45dce4),console[_0xedca74(0xca)](_0xedca74(0xba)+_0x5c1ab2[_0xedca74(0xcb)]),_0x4f7472['verbose']&&(console[_0xedca74(0xd8)](_0xedca74(0xc6)),console[_0xedca74(0xd8)]('Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context'),console[_0xedca74(0xd8)](_0xedca74(0xe9))),0x0;}catch(_0x141dd8){throw _0x141dd8;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x1d8708=a28_0x8d64;function a28_0x8d64(_0x247444,_0x2bbc76){const _0x15861f=a28_0x1586();return a28_0x8d64=function(_0x8d64fd,_0x5108aa){_0x8d64fd=_0x8d64fd-0x1d4;let _0x5665db=_0x15861f[_0x8d64fd];return _0x5665db;},a28_0x8d64(_0x247444,_0x2bbc76);}(function(_0x5622e1,_0x34c727){const _0x1a5fd0=a28_0x8d64,_0x30a0da=_0x5622e1();while(!![]){try{const _0xbf5170=parseInt(_0x1a5fd0(0x1f6))/0x1+-parseInt(_0x1a5fd0(0x205))/0x2+-parseInt(_0x1a5fd0(0x214))/0x3*(parseInt(_0x1a5fd0(0x1de))/0x4)+parseInt(_0x1a5fd0(0x204))/0x5+-parseInt(_0x1a5fd0(0x1ec))/0x6*(-parseInt(_0x1a5fd0(0x1d4))/0x7)+-parseInt(_0x1a5fd0(0x1f3))/0x8+parseInt(_0x1a5fd0(0x1d8))/0x9;if(_0xbf5170===_0x34c727)break;else _0x30a0da['push'](_0x30a0da['shift']());}catch(_0x123ec3){_0x30a0da['push'](_0x30a0da['shift']());}}}(a28_0x1586,0x55c13));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 a28_0x1586(){const _0x5e0a0b=['jsonl','229467OJXjat','\x20segment','map','name','json','239792xWGLlN','resolvePathToResource','verbose','segmentPath','5070627NFetxS','✔\x20Built\x20tree\x20with\x20','includes','population','Building\x20hierarchy\x20tree...','\x20folder','28kXwrBR','cause','listParents','description','\x20parent\x20segment','(empty)','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','message','length','✔\x20Found\x20','error','\x20top-level\x20items','Current\x20context:\x20','listUnified','60ZdyiFo','replace','maxDepth','\x5c$&','localeCompare','data','\x27...','4238352qrHTnV','attributes','Resolving\x20context\x20path\x20\x27','492830YfFhvA','recursive','segment','parentId','Parent\x20ID:\x20','segments','Path/pattern\x20arg:\x20','listRecursive','dim','sort','format','log','Folder\x20ID:\x20','folder','2427475RDnKYt','935640rwRoXH','folderId','Site:\x20','[parent\x20segments]','\x20\x20Cause:\x20','site','👥\x20','Listing\x20parent\x20segments...','Recursive\x20mode:\x20enabled','listParentsWithPattern','Error:\x20','No\x20parent\x20segments\x20match\x20pattern:\x20','filter','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/'];a28_0x1586=function(){return _0x5e0a0b;};return a28_0x1586();}import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{formatRows}from'../utils/formatters.js';import a28_0x3ddf56 from'chalk';export class SegmentsCommand extends BaseCommand{[a28_0x1d8708(0x217)]=a28_0x1d8708(0x1fb);[a28_0x1d8708(0x1e1)]='List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments';async['execute'](_0x555277){const _0x17c6eb=a28_0x1d8708,{options:_0x5ea423,args:_0x4e2e2d}=_0x555277,_0x43e6ce=_0x5ea423[_0x17c6eb(0x1f7)],_0x28b896=_0x4e2e2d[0x0];try{const _0x3ca76a=_0x5ea423[_0x17c6eb(0x1d7)];_0x5ea423['verbose']&&(console['error'](_0x17c6eb(0x207)+_0x5ea423[_0x17c6eb(0x20a)]),console['error'](_0x17c6eb(0x1ea)+(_0x3ca76a||'/')),_0x28b896&&console[_0x17c6eb(0x1e8)](_0x17c6eb(0x1fc)+_0x28b896),_0x43e6ce&&console[_0x17c6eb(0x1e8)](_0x17c6eb(0x20d)));if(_0x28b896){const _0x5e6156=_0x28b896[_0x17c6eb(0x1da)]('*')||_0x28b896[_0x17c6eb(0x1da)]('?');if(_0x5e6156&&!_0x3ca76a)return await this[_0x17c6eb(0x20e)](_0x555277,_0x28b896);else return _0x5e6156?(console[_0x17c6eb(0x1e8)](_0x17c6eb(0x1e4)),console[_0x17c6eb(0x1e8)](_0x17c6eb(0x212)),0x1):_0x43e6ce?await this[_0x17c6eb(0x1fd)](_0x555277,_0x28b896):await this['listUnified'](_0x555277,_0x28b896);}if(!_0x3ca76a)return await this[_0x17c6eb(0x1e0)](_0x555277);return _0x43e6ce?await this[_0x17c6eb(0x1fd)](_0x555277,_0x3ca76a):await this['listUnified'](_0x555277,_0x3ca76a);}catch(_0x2f467b){if(_0x2f467b instanceof SDKError)return console[_0x17c6eb(0x1e8)](_0x17c6eb(0x20f)+_0x2f467b[_0x17c6eb(0x1e5)]),_0x2f467b[_0x17c6eb(0x1df)]&&console[_0x17c6eb(0x1e8)](_0x17c6eb(0x209)+_0x2f467b[_0x17c6eb(0x1df)]),0x1;throw _0x2f467b;}}async['listParentsWithPattern'](_0x281817,_0x2eb61c){const _0x13b371=a28_0x1d8708,{options:_0x45ea1c,tdx:_0x22ea53}=_0x281817,_0x1627ef=await withSpinner('Listing\x20parent\x20segments\x20matching\x20\x27'+_0x2eb61c+_0x13b371(0x1f2),()=>_0x22ea53['segment'][_0x13b371(0x1e0)](),{'verbose':_0x45ea1c['verbose']}),_0x449c1a=_0x1627ef[_0x13b371(0x1f1)],_0x3cba78=_0x2eb61c[_0x13b371(0x1ed)](/[.+^${}()|[\]\\]/g,_0x13b371(0x1ef))[_0x13b371(0x1ed)](/\*/g,'.*')[_0x13b371(0x1ed)](/\?/g,'.'),_0x13ffc5=new RegExp('^'+_0x3cba78+'$','i'),_0xfb0ae6=_0x449c1a[_0x13b371(0x211)](_0x48f576=>_0x13ffc5['test'](_0x48f576[_0x13b371(0x1f4)]['name']));console[_0x13b371(0x1e8)]('✔\x20Found\x20'+_0xfb0ae6['length']+_0x13b371(0x1e2)+(_0xfb0ae6[_0x13b371(0x1e6)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x2eb61c+'\x27');if(_0x45ea1c['format']==='json'||_0x45ea1c['format']===_0x13b371(0x213))await handleSDKOutput(_0xfb0ae6,_0x45ea1c);else{if(_0xfb0ae6[_0x13b371(0x1e6)]===0x0)console[_0x13b371(0x201)](_0x13b371(0x210)+_0x2eb61c);else{console['log'](_0x13b371(0x208));for(const _0x588037 of _0xfb0ae6){const _0x57d285=_0x588037['attributes'][_0x13b371(0x1db)]?a28_0x3ddf56[_0x13b371(0x1fe)]('\x20('+formatRows(_0x588037['attributes'][_0x13b371(0x1db)])+')'):'';console[_0x13b371(0x201)](_0x13b371(0x20b)+_0x588037[_0x13b371(0x1f4)][_0x13b371(0x217)]+_0x57d285);}}}return 0x0;}async[a28_0x1d8708(0x1e0)](_0x4f5467){const _0x89939c=a28_0x1d8708,{options:_0x2952a6,tdx:_0x34ffc8}=_0x4f5467,_0x406bf0=await withSpinner(_0x89939c(0x20c),()=>_0x34ffc8[_0x89939c(0x1f8)][_0x89939c(0x1e0)](),{'verbose':_0x2952a6[_0x89939c(0x1d6)]}),_0x527580=_0x406bf0[_0x89939c(0x1f1)];console[_0x89939c(0x1e8)](_0x89939c(0x1e7)+_0x527580[_0x89939c(0x1e6)]+'\x20parent\x20segment'+(_0x527580[_0x89939c(0x1e6)]!==0x1?'s':''));if(_0x2952a6['format']===_0x89939c(0x218)||_0x2952a6[_0x89939c(0x200)]==='jsonl')await handleSDKOutput(_0x527580,_0x2952a6);else{console['log']('[parent\x20segments]');for(const _0x272e7c of _0x527580){const _0x2417b6=_0x272e7c['attributes'][_0x89939c(0x1db)]?a28_0x3ddf56[_0x89939c(0x1fe)]('\x20('+formatRows(_0x272e7c[_0x89939c(0x1f4)]['population'])+')'):'';console[_0x89939c(0x201)]('👥\x20'+_0x272e7c[_0x89939c(0x1f4)][_0x89939c(0x217)]+_0x2417b6);}}return 0x0;}async[a28_0x1d8708(0x1eb)](_0x5c36d9,_0x1a3e2c){const _0x269e0a=a28_0x1d8708,{options:_0x222754,tdx:_0x1b9a97}=_0x5c36d9,_0x1b548e=await withSpinner(_0x269e0a(0x1f5)+_0x1a3e2c+_0x269e0a(0x1f2),()=>_0x1b9a97['segment'][_0x269e0a(0x1d5)](_0x1a3e2c),{'verbose':_0x222754['verbose']}),_0x30818d=_0x1b548e[_0x269e0a(0x1f1)];_0x222754[_0x269e0a(0x1d6)]&&(console['error'](_0x269e0a(0x1fa)+_0x30818d[_0x269e0a(0x1f9)]),_0x30818d['folderId']&&console[_0x269e0a(0x1e8)](_0x269e0a(0x202)+_0x30818d[_0x269e0a(0x206)]));const _0x2d52df=await withSpinner('Listing\x20folders\x20and\x20segments...',()=>_0x1b9a97[_0x269e0a(0x1f8)]['listUnified'](_0x30818d['parentId'],_0x30818d['folderId']),{'verbose':_0x222754[_0x269e0a(0x1d6)]}),{folders:_0x5059de,segments:_0x3a7d7d}=_0x2d52df[_0x269e0a(0x1f1)],_0x581aba=_0x5059de[_0x269e0a(0x1e6)]+_0x3a7d7d[_0x269e0a(0x1e6)];console[_0x269e0a(0x1e8)](_0x269e0a(0x1e7)+_0x5059de['length']+_0x269e0a(0x1dd)+(_0x5059de[_0x269e0a(0x1e6)]!==0x1?'s':'')+'\x20and\x20'+_0x3a7d7d[_0x269e0a(0x1e6)]+_0x269e0a(0x215)+(_0x3a7d7d[_0x269e0a(0x1e6)]!==0x1?'s':''));if(_0x222754[_0x269e0a(0x200)]===_0x269e0a(0x218)||_0x222754[_0x269e0a(0x200)]==='jsonl'){const _0x12d1fc=[..._0x5059de[_0x269e0a(0x216)](_0x333b0=>({..._0x333b0,'type':_0x269e0a(0x203)})),..._0x3a7d7d['map'](_0x198047=>({..._0x198047,'type':_0x269e0a(0x1f8)}))][_0x269e0a(0x1ff)]((_0x15446a,_0x279398)=>_0x15446a['name'][_0x269e0a(0x1f0)](_0x279398[_0x269e0a(0x217)]));await handleSDKOutput(_0x12d1fc,_0x222754);}else{if(_0x581aba===0x0)console[_0x269e0a(0x201)](a28_0x3ddf56[_0x269e0a(0x1fe)]('[/'+_0x1a3e2c+']')),console[_0x269e0a(0x201)](_0x269e0a(0x1e3));else{console[_0x269e0a(0x201)](a28_0x3ddf56['dim']('[/'+_0x1a3e2c+']'));const _0xee204c=formatFlatList(_0x5059de,_0x3a7d7d,{'showMetadata':!![]});console[_0x269e0a(0x201)](_0xee204c);}}return 0x0;}async[a28_0x1d8708(0x1fd)](_0x1c8cb2,_0xa9d52d){const _0x397d17=a28_0x1d8708,{options:_0x3f0efa,tdx:_0x5173d5}=_0x1c8cb2,_0x636780=await withSpinner(_0x397d17(0x1f5)+_0xa9d52d+_0x397d17(0x1f2),()=>_0x5173d5[_0x397d17(0x1f8)]['resolvePathToResource'](_0xa9d52d),{'verbose':_0x3f0efa[_0x397d17(0x1d6)]}),_0x4196fc=_0x636780[_0x397d17(0x1f1)];_0x3f0efa['verbose']&&(console[_0x397d17(0x1e8)]('Parent\x20ID:\x20'+_0x4196fc[_0x397d17(0x1f9)]),_0x4196fc[_0x397d17(0x206)]&&console[_0x397d17(0x1e8)](_0x397d17(0x202)+_0x4196fc[_0x397d17(0x206)]));const _0x42f196=_0x3f0efa[_0x397d17(0x1ee)]||0xa,_0xc4d9c8=await withSpinner(_0x397d17(0x1dc),()=>_0x5173d5[_0x397d17(0x1f8)]['listRecursive'](_0x4196fc[_0x397d17(0x1f9)],_0x4196fc[_0x397d17(0x206)],0x0,_0x42f196),{'verbose':_0x3f0efa[_0x397d17(0x1d6)]}),_0x3b2e86=_0xc4d9c8[_0x397d17(0x1f1)];console[_0x397d17(0x1e8)](_0x397d17(0x1d9)+_0x3b2e86[_0x397d17(0x1e6)]+_0x397d17(0x1e9));if(_0x3f0efa['format']==='json'||_0x3f0efa[_0x397d17(0x200)]===_0x397d17(0x213))await handleSDKOutput(_0x3b2e86,_0x3f0efa);else{console['log'](a28_0x3ddf56['dim']('[/'+_0xa9d52d+']'));const _0x53c644=formatTree(_0x3b2e86,{'showMetadata':!![]});console[_0x397d17(0x201)](_0x53c644);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x2ed005=a29_0x45da;(function(_0x366bc0,_0x41cb5e){const _0x400166=a29_0x45da,_0x48c37a=_0x366bc0();while(!![]){try{const _0x5ca2da=parseInt(_0x400166(0xef))/0x1*(parseInt(_0x400166(0xce))/0x2)+parseInt(_0x400166(0xde))/0x3+-parseInt(_0x400166(0xf6))/0x4*(-parseInt(_0x400166(0xd1))/0x5)+-parseInt(_0x400166(0xe1))/0x6+-parseInt(_0x400166(0xe4))/0x7*(parseInt(_0x400166(0xe7))/0x8)+parseInt(_0x400166(0xd7))/0x9+parseInt(_0x400166(0xe3))/0xa*(-parseInt(_0x400166(0xe0))/0xb);if(_0x5ca2da===_0x41cb5e)break;else _0x48c37a['push'](_0x48c37a['shift']());}catch(_0x4475f4){_0x48c37a['push'](_0x48c37a['shift']());}}}(a29_0x129b,0x64247));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a29_0x129b(){const _0x515a6a=['20992VymsEy','\x20from\x20','validate','4050845wUYVHM','site','showTable','Catalog:\x20','length','\x20\x20Cause:\x20','1136070kOSqCu','args','description','verbose','execute','cause','error','1758132qfYget','message','11aYWYSj','2245890wWdREC','Table:\x20','12790220IVCWFg','287qYNQAg','show','limit','19352BhSOUL','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','Limit:\x20','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','...','\x20row','data','61bThTpG','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','Querying\x20','Error:\x20','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','database','name','4wbsNFO','Show\x20table\x20contents','Usage:\x20tdx\x20show\x20<database.table>'];a29_0x129b=function(){return _0x515a6a;};return a29_0x129b();}function a29_0x45da(_0x5768fc,_0x37d803){const _0x129b8b=a29_0x129b();return a29_0x45da=function(_0x45da4b,_0x595d81){_0x45da4b=_0x45da4b-0xcc;let _0x2b2c2a=_0x129b8b[_0x45da4b];return _0x2b2c2a;},a29_0x45da(_0x5768fc,_0x37d803);}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class ShowCommand extends BaseCommand{[a29_0x2ed005(0xf5)]=a29_0x2ed005(0xe5);[a29_0x2ed005(0xd9)]=a29_0x2ed005(0xcc);async[a29_0x2ed005(0xdb)](_0x1a9b4e){const _0x1881e3=a29_0x2ed005;return this[_0x1881e3(0xd3)](_0x1a9b4e);}async['showTable'](_0x417e38){const _0xc7b28a=a29_0x2ed005,{options:_0x57eb8e,args:_0x312e2a,tdx:_0x5878e4}=_0x417e38;let _0x3f6029;try{_0x3f6029=parseTableReference(_0x312e2a[0x0]);const _0x245aa2=_0x57eb8e[_0xc7b28a(0xf4)];!_0x3f6029[_0xc7b28a(0xf4)]&&_0x245aa2&&(_0x3f6029[_0xc7b28a(0xf4)]=_0x245aa2);const _0x1c9f39=validateTableDescribeReference(_0x3f6029);if(_0x1c9f39)return console[_0xc7b28a(0xdd)](_0xc7b28a(0xf2)+_0x1c9f39),console[_0xc7b28a(0xdd)](_0xc7b28a(0xcd)),console[_0xc7b28a(0xdd)](_0xc7b28a(0xf0)),console[_0xc7b28a(0xdd)](_0xc7b28a(0xe8)),0x1;}catch(_0x113032){return console[_0xc7b28a(0xdd)](_0xc7b28a(0xf2)+_0x113032[_0xc7b28a(0xdf)]),console[_0xc7b28a(0xdd)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0xc7b28a(0xdd)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0xc7b28a(0xdd)](_0xc7b28a(0xe8)),0x1;}const _0x57ed77=_0x3f6029['catalog'],_0x403a72=_0x3f6029[_0xc7b28a(0xf4)],_0x34eba1=_0x3f6029['table'],_0x326ff7=_0x57eb8e[_0xc7b28a(0xe6)];try{_0x57eb8e[_0xc7b28a(0xda)]&&(console[_0xc7b28a(0xdd)]('Site:\x20'+_0x57eb8e[_0xc7b28a(0xd2)]),_0x57ed77&&console[_0xc7b28a(0xdd)](_0xc7b28a(0xd4)+_0x57ed77),console[_0xc7b28a(0xdd)]('Database:\x20'+_0x403a72),console[_0xc7b28a(0xdd)](_0xc7b28a(0xe2)+_0x34eba1),console[_0xc7b28a(0xdd)](_0xc7b28a(0xea)+_0x326ff7));const _0x3c01c3=_0x57ed77?_0x57ed77+'.'+_0x403a72+'.'+_0x34eba1:_0x403a72+'.'+_0x34eba1,_0x4190a7=await withSpinner(_0xc7b28a(0xf1)+_0x3c01c3+_0xc7b28a(0xec),()=>_0x5878e4['table'][_0xc7b28a(0xe5)](_0x403a72,_0x34eba1,_0x326ff7,_0x57ed77),{'verbose':_0x57eb8e[_0xc7b28a(0xda)]}),_0x470334=_0x4190a7[_0xc7b28a(0xee)],_0x256a34=_0x470334[_0xc7b28a(0xee)];return _0x256a34[_0xc7b28a(0xd5)]===0x0?console[_0xc7b28a(0xdd)](_0xc7b28a(0xe9)):console['error']('✔\x20Retrieved\x20'+_0x256a34[_0xc7b28a(0xd5)]+_0xc7b28a(0xed)+(_0x256a34['length']!==0x1?'s':'')+_0xc7b28a(0xcf)+_0x3c01c3),await handleSDKOutput(_0x256a34,_0x57eb8e),0x0;}catch(_0x56c664){if(_0x56c664 instanceof SDKError)return console['error']('Error:\x20'+_0x56c664[_0xc7b28a(0xdf)]),_0x56c664[_0xc7b28a(0xdc)]&&console['error'](_0xc7b28a(0xd6)+_0x56c664['cause']),0x1;throw _0x56c664;}}[a29_0x2ed005(0xd0)](_0x18d4a9){const _0xc8b005=a29_0x2ed005;if(_0x18d4a9[_0xc8b005(0xd8)]['length']===0x0)return _0xc8b005(0xeb);if(_0x18d4a9[_0xc8b005(0xd8)][_0xc8b005(0xd5)]>0x1)return _0xc8b005(0xf3);return undefined;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x57ce4f=a30_0x66f7;(function(_0x4fb914,_0x3b4879){const _0x440eb3=a30_0x66f7,_0x177ee0=_0x4fb914();while(!![]){try{const _0x57524e=-parseInt(_0x440eb3(0x1e5))/0x1*(-parseInt(_0x440eb3(0x20a))/0x2)+parseInt(_0x440eb3(0x1fb))/0x3+-parseInt(_0x440eb3(0x1f5))/0x4*(parseInt(_0x440eb3(0x1eb))/0x5)+-parseInt(_0x440eb3(0x1dd))/0x6*(-parseInt(_0x440eb3(0x1f4))/0x7)+parseInt(_0x440eb3(0x1e9))/0x8*(-parseInt(_0x440eb3(0x1ec))/0x9)+-parseInt(_0x440eb3(0x1f7))/0xa+parseInt(_0x440eb3(0x1fa))/0xb*(parseInt(_0x440eb3(0x1ff))/0xc);if(_0x57524e===_0x3b4879)break;else _0x177ee0['push'](_0x177ee0['shift']());}catch(_0x3bbc0c){_0x177ee0['push'](_0x177ee0['shift']());}}}(a30_0x3843,0x7fb0b));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a30_0x66f7(_0x1adf66,_0x199bef){const _0x3843eb=a30_0x3843();return a30_0x66f7=function(_0x66f787,_0x10d051){_0x66f787=_0x66f787-0x1dc;let _0x12d822=_0x3843eb[_0x66f787];return _0x12d822;},a30_0x66f7(_0x1adf66,_0x199bef);}function a30_0x3843(){const _0x40fdd9=['6712gNGSAD','Error:\x20','470580aLmLIt','6219EzzUOa','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','error','Database:\x20','verbose','List\x20tables\x20in\x20a\x20database','list','length','189JEazLb','44OEfIxg','\x20table','2979870ixckPV','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','\x27\x20across\x20all\x20databases.','33flXInI','1225131dQsRUx','execute','database','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','4161408OqbIzd','message','includes','table','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','✖\x20No\x20tables\x20found','tables','data','\x27\x20is\x20ambiguous.','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','34welyso','Or\x20use\x20--in\x20flag:','113430wRpiwo','cause','Site:\x20','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','\x20\x20Cause:\x20','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','validate','28051JOJrya','Listing\x20tables...','\x20\x20Use:\x20tdx\x20tables\x20\x22','name'];a30_0x3843=function(){return _0x40fdd9;};return a30_0x3843();}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_0x57ce4f(0x1e8)]=a30_0x57ce4f(0x205);['description']=a30_0x57ce4f(0x1f1);async[a30_0x57ce4f(0x1fc)](_0x36511f){const _0x2b99b5=a30_0x57ce4f,{options:_0x299824,args:_0x12ef74,tdx:_0x270f70}=_0x36511f;let _0x10bf38;if(_0x12ef74[_0x2b99b5(0x1f3)]===0x0)_0x10bf38={'database':undefined,'table':undefined,'original':''};else{if(_0x12ef74['length']===0x1)try{_0x10bf38=parseTableReference(_0x12ef74[0x0]);if(_0x10bf38[_0x2b99b5(0x202)]&&!_0x10bf38[_0x2b99b5(0x1fd)]&&!_0x10bf38['table'][_0x2b99b5(0x201)]('*')&&!_0x10bf38[_0x2b99b5(0x202)][_0x2b99b5(0x201)]('?'))return console[_0x2b99b5(0x1ee)]('Error:\x20Pattern\x20\x27'+_0x12ef74[0x0]+_0x2b99b5(0x207)),console[_0x2b99b5(0x1ee)](_0x2b99b5(0x1fe)+_0x10bf38['table']+'\x27?'),console[_0x2b99b5(0x1ee)](_0x2b99b5(0x1e7)+_0x10bf38[_0x2b99b5(0x202)]+'.*\x22'),console[_0x2b99b5(0x1ee)](_0x2b99b5(0x209)+_0x10bf38[_0x2b99b5(0x202)]),console[_0x2b99b5(0x1ee)](_0x2b99b5(0x1e3)+_0x10bf38[_0x2b99b5(0x202)]),console[_0x2b99b5(0x1ee)](''),console['error']('Note:\x20\x27'+_0x12ef74[0x0]+'\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27'+_0x10bf38[_0x2b99b5(0x202)]+_0x2b99b5(0x1f9)),0x1;}catch(_0x258a29){return console[_0x2b99b5(0x1ee)]('Error:\x20'+_0x258a29[_0x2b99b5(0x200)]),0x1;}else return console['error'](_0x2b99b5(0x1e0)),console[_0x2b99b5(0x1ee)](_0x2b99b5(0x1e2)),console[_0x2b99b5(0x1ee)](_0x2b99b5(0x203)),console[_0x2b99b5(0x1ee)](_0x2b99b5(0x1ed)),console['error'](_0x2b99b5(0x1f8)),console[_0x2b99b5(0x1ee)](_0x2b99b5(0x1dc)),console[_0x2b99b5(0x1ee)]('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0x463c0b=_0x299824['database'];!_0x10bf38['database']&&_0x463c0b&&(_0x10bf38[_0x2b99b5(0x1fd)]=_0x463c0b);try{const _0x2a8625=_0x49649e=>_0x49649e&&(_0x49649e[_0x2b99b5(0x201)]('*')||_0x49649e[_0x2b99b5(0x201)]('?')),_0x406835=_0x2a8625(_0x10bf38[_0x2b99b5(0x1fd)]);_0x299824[_0x2b99b5(0x1f0)]&&(console['error'](_0x2b99b5(0x1df)+_0x299824['site']),_0x10bf38['database']?_0x406835?console[_0x2b99b5(0x1ee)]('Database\x20pattern:\x20'+_0x10bf38['database']):console[_0x2b99b5(0x1ee)](_0x2b99b5(0x1ef)+_0x10bf38[_0x2b99b5(0x1fd)]):console['error']('Database:\x20all'),_0x10bf38[_0x2b99b5(0x202)]&&console[_0x2b99b5(0x1ee)]('Table\x20pattern:\x20'+_0x10bf38[_0x2b99b5(0x202)]));const _0x1b1f44=_0x10bf38[_0x2b99b5(0x1fd)]&&!_0x406835?_0x10bf38[_0x2b99b5(0x1fd)]:undefined,_0x136fff=_0x406835?_0x10bf38[_0x2b99b5(0x1fd)]:undefined,_0x1380ae=_0x10bf38[_0x2b99b5(0x202)],_0x11ace5=await withSpinner(_0x2b99b5(0x1e6),()=>_0x270f70[_0x2b99b5(0x202)][_0x2b99b5(0x1f2)](_0x1b1f44,_0x1380ae,_0x136fff),{'verbose':_0x299824[_0x2b99b5(0x1f0)]}),_0x342b37=_0x11ace5[_0x2b99b5(0x206)];if(_0x342b37[_0x2b99b5(0x1f3)]===0x0&&_0x10bf38[_0x2b99b5(0x1fd)]&&!_0x406835)return console[_0x2b99b5(0x1ee)](_0x2b99b5(0x204)),console[_0x2b99b5(0x1ee)]('Database\x20\x27'+_0x10bf38[_0x2b99b5(0x1fd)]+_0x2b99b5(0x208)),0x1;return console[_0x2b99b5(0x1ee)]('✔\x20Found\x20'+_0x342b37[_0x2b99b5(0x1f3)]+_0x2b99b5(0x1f6)+(_0x342b37[_0x2b99b5(0x1f3)]!==0x1?'s':'')),await handleSDKOutput(_0x342b37,_0x299824),0x0;}catch(_0x533898){if(_0x533898 instanceof SDKError)return console[_0x2b99b5(0x1ee)](_0x2b99b5(0x1ea)+_0x533898[_0x2b99b5(0x200)]),_0x533898[_0x2b99b5(0x1de)]&&console[_0x2b99b5(0x1ee)](_0x2b99b5(0x1e1)+_0x533898[_0x2b99b5(0x1de)]),0x1;throw _0x533898;}}[a30_0x57ce4f(0x1e4)](_0xd6b237){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a31_0x44d7(){const _0x59ae44=['includes','log','use','9952QfqHaA','6396840jrPHVn','length','database','40611ERWCXx','Session\x20database\x20set\x20to:\x20','Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a','Invalid\x20resource:\x20','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a','8yKuCgy','toString','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','description','validate','parent_segment','23480ATCwVj','18pJyAju','message','profile','\x20(session:\x20','execute','495890ZbdZxx','166329wtekMo','776044nZotsV','error','\x27\x20does\x20not\x20exist','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','56ljHYiI','session','join','3916cocIwo','llm_project'];a31_0x44d7=function(){return _0x59ae44;};return a31_0x44d7();}const a31_0x28a7c0=a31_0x4895;(function(_0x296314,_0x313378){const _0x4212c2=a31_0x4895,_0x48c865=_0x296314();while(!![]){try{const _0x40eedf=parseInt(_0x4212c2(0x186))/0x1+parseInt(_0x4212c2(0x19d))/0x2*(-parseInt(_0x4212c2(0x198))/0x3)+parseInt(_0x4212c2(0x187))/0x4+parseInt(_0x4212c2(0x1a9))/0x5*(parseInt(_0x4212c2(0x1a4))/0x6)+parseInt(_0x4212c2(0x18c))/0x7*(parseInt(_0x4212c2(0x194))/0x8)+parseInt(_0x4212c2(0x195))/0x9+parseInt(_0x4212c2(0x1a3))/0xa*(-parseInt(_0x4212c2(0x18f))/0xb);if(_0x40eedf===_0x313378)break;else _0x48c865['push'](_0x48c865['shift']());}catch(_0x276242){_0x48c865['push'](_0x48c865['shift']());}}}(a31_0x44d7,0x77466));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';function a31_0x4895(_0x2ca8d7,_0x473e04){const _0x44d782=a31_0x44d7();return a31_0x4895=function(_0x48956f,_0x1058fa){_0x48956f=_0x48956f-0x186;let _0x57ad4=_0x44d782[_0x48956f];return _0x57ad4;},a31_0x4895(_0x2ca8d7,_0x473e04);}import{profileExists}from'../core/profile.js';export class UseCommand extends BaseCommand{['name']=a31_0x28a7c0(0x193);[a31_0x28a7c0(0x1a0)]='Set\x20session-level\x20context';[a31_0x28a7c0(0x1a1)](_0x37af02){const _0x5a8e9c=a31_0x28a7c0,{args:_0x5a019e}=_0x37af02;if(_0x5a019e[_0x5a8e9c(0x196)]<0x2)return _0x5a8e9c(0x18a)+_0x5a8e9c(0x19c)+_0x5a8e9c(0x19a)+_0x5a8e9c(0x19f);const _0x14fa7b=_0x5a019e[0x0],_0x3a21f1=['database','parent_segment',_0x5a8e9c(0x190),_0x5a8e9c(0x1a6)];if(!_0x3a21f1[_0x5a8e9c(0x191)](_0x14fa7b))return _0x5a8e9c(0x19b)+_0x14fa7b+'.\x20Must\x20be\x20one\x20of:\x20'+_0x3a21f1[_0x5a8e9c(0x18e)](',\x20');return undefined;}async[a31_0x28a7c0(0x1a8)](_0x2678c2){const _0x2da156=a31_0x28a7c0,{args:_0xc4f6c5,options:_0x2598dc}=_0x2678c2;try{const _0x326bab=_0xc4f6c5[0x0],_0x10fe52=_0xc4f6c5[0x1];if(_0x326bab===_0x2da156(0x1a6)){if(!profileExists(_0x10fe52))return console[_0x2da156(0x188)]('Error:\x20Profile\x20\x27'+_0x10fe52+_0x2da156(0x189)),console[_0x2da156(0x188)]('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x3374a8=_0x2598dc[_0x2da156(0x18d)]||getCurrentSessionPID()[_0x2da156(0x19e)]();return saveSessionContext({'profile':_0x10fe52},_0x2598dc[_0x2da156(0x18d)]),console[_0x2da156(0x192)]('Session\x20profile\x20set\x20to:\x20'+_0x10fe52+_0x2da156(0x1a7)+_0x3374a8+')'),console['log'](_0x2da156(0x18b)),0x0;}const _0x5cc6ec={},_0x1f9cfc=_0x2598dc[_0x2da156(0x18d)]||getCurrentSessionPID()[_0x2da156(0x19e)]();switch(_0x326bab){case _0x2da156(0x197):_0x5cc6ec['database']=_0x10fe52,console[_0x2da156(0x192)](_0x2da156(0x199)+_0x10fe52+'\x20(session:\x20'+_0x1f9cfc+')');break;case _0x2da156(0x1a2):_0x5cc6ec[_0x2da156(0x1a2)]=_0x10fe52,console[_0x2da156(0x192)]('Session\x20parent_segment\x20set\x20to:\x20'+_0x10fe52+_0x2da156(0x1a7)+_0x1f9cfc+')');break;case _0x2da156(0x190):_0x5cc6ec[_0x2da156(0x190)]=_0x10fe52,console['log']('Session\x20llm_project\x20set\x20to:\x20'+_0x10fe52+'\x20(session:\x20'+_0x1f9cfc+')');break;}return saveSessionContext(_0x5cc6ec,_0x2598dc['session']),console[_0x2da156(0x192)](_0x2da156(0x18b)),0x0;}catch(_0x195e86){return _0x195e86 instanceof Error&&console[_0x2da156(0x188)]('Error:\x20'+_0x195e86[_0x2da156(0x1a5)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a32_0x13ff80=a32_0x5a7c;function a32_0x5650(){const _0x239ed5=['1808004FulWes','filesExtracted','Downloading\x20project\x20','stat','...','workflow:retry','attemptId','Validation:\x20skipped','532HfWQDg','workflow:kill','3082408KmOBAi','Listing\x20workflow\x20sessions...','session:','startsWith','includeSubtasks','fromTask','\x20log\x20entr','✔\x20Deleted\x20project\x20','Error:\x20Attempt\x20ID\x20and\x20task\x20name\x20are\x20required','workflow:sessions','61554DZgkQR','attempts','1gOtmpy','attempt','workflow:logs','length','session','retrySession','Killing\x20attempt...','\x20\x20Files\x20extracted:\x20','error','from','includeRetried','Cancelled','\x20session','logs','name','6720420qjNbXg','Attempt\x20ID:\x20','Retry\x20a\x20session\x20or\x20attempt','workflow:push','15hfhVpu','cause','workflow:projects','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','split','Task\x20name:\x20','Params:\x20','\x20\x20Cause:\x20','List\x20workflow\x20execution\x20sessions','Show\x20tasks\x20for\x20an\x20attempt','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','data','fs/promises','skipValidation','Filter:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Project\x20directory:\x20','limit','Pattern:\x20','Error:\x20','projectId','\x20is\x20not\x20a\x20directory','reason','Kill\x20a\x20running\x20attempt','Listing\x20workflows...','delete','workflow:download','ies','projects','Project\x20name:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','From\x20task:\x20','verbose','Revision:\x20','params','execute','Including\x20subtasks:\x20yes','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','yes','retryAttempt','Usage:\x20workflow:delete\x20<project-name-or-id>','\x20\x20New\x20attempt\x20ID:\x20','Listing\x20workflow\x20attempts...','substring','Getting\x20attempt\x20details...','✔\x20Retry\x20started','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','3952201SSTboB','workflow','178348YxHapD','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','workflow:attempts','revision','parse','Filter:\x20project=','9XjZyrE','List\x20workflow\x20attempts','projectName','Listing\x20workflow\x20projects...','workflow:attempt','Error:\x20Attempt\x20ID\x20is\x20required','Getting\x20attempt\x20tasks...','\x20\x20Project\x20ID:\x20','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','Getting\x20task\x20logs...','\x20\x20Location:\x20','✔\x20Found\x20','Project:\x20','sessionId','status','Deleting\x20project\x20','Include\x20retried:\x20yes','readFile','workflow:tasks','Resume\x20from:\x20','workflows','Target:\x20','Reason:\x20','Show\x20logs\x20for\x20a\x20specific\x20task','\x20\x20Session\x20ID:\x20','message','\x20workflow','description','\x22?\x20This\x20cannot\x20be\x20undone.','\x20task','Output\x20directory:\x20','8330440SWjJBP','workflow:workflows','offset'];a32_0x5650=function(){return _0x239ed5;};return a32_0x5650();}(function(_0x38fc14,_0x320c5b){const _0x4d5dd8=a32_0x5a7c,_0x27c79c=_0x38fc14();while(!![]){try{const _0x31442c=-parseInt(_0x4d5dd8(0x111))/0x1*(-parseInt(_0x4d5dd8(0xfb))/0x2)+parseInt(_0x4d5dd8(0x124))/0x3*(parseInt(_0x4d5dd8(0x156))/0x4)+parseInt(_0x4d5dd8(0x120))/0x5+-parseInt(_0x4d5dd8(0x10f))/0x6*(parseInt(_0x4d5dd8(0x103))/0x7)+-parseInt(_0x4d5dd8(0x105))/0x8+parseInt(_0x4d5dd8(0x15c))/0x9*(-parseInt(_0x4d5dd8(0xf8))/0xa)+parseInt(_0x4d5dd8(0x154))/0xb;if(_0x31442c===_0x320c5b)break;else _0x27c79c['push'](_0x27c79c['shift']());}catch(_0x1ca565){_0x27c79c['push'](_0x27c79c['shift']());}}}(a32_0x5650,0xcb31b));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_0x13ff80(0x11f)]=a32_0x13ff80(0x126);[a32_0x13ff80(0xf4)]='List\x20all\x20workflow\x20projects';async[a32_0x13ff80(0x148)](_0x1ae513){const _0x8a1b40=a32_0x13ff80,{options:_0x3794aa,args:_0xb24461,tdx:_0xc37ca}=_0x1ae513,_0x4c8a83=_0xb24461[0x0];try{_0x3794aa[_0x8a1b40(0x145)]&&_0x4c8a83&&console[_0x8a1b40(0x119)](_0x8a1b40(0x137)+_0x4c8a83);const _0x50b48a=await withSpinner(_0x8a1b40(0x15f),()=>_0xc37ca[_0x8a1b40(0x155)][_0x8a1b40(0x141)](_0x4c8a83,{'limit':_0x3794aa[_0x8a1b40(0x136)]}),{'verbose':_0x3794aa[_0x8a1b40(0x145)]}),_0x3c7808=_0x50b48a[_0x8a1b40(0x130)];return console[_0x8a1b40(0x119)](_0x8a1b40(0x167)+_0x3c7808[_0x8a1b40(0x114)]+'\x20project'+(_0x3c7808[_0x8a1b40(0x114)]!==0x1?'s':'')),await handleSDKOutput(_0x3c7808,_0x3794aa),0x0;}catch(_0x4e6155){if(_0x4e6155 instanceof SDKError)return console[_0x8a1b40(0x119)](_0x8a1b40(0x138)+_0x4e6155['message']),_0x4e6155['cause']&&console['error'](_0x8a1b40(0x12b)+_0x4e6155[_0x8a1b40(0x125)]),0x1;throw _0x4e6155;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0xf9);[a32_0x13ff80(0xf4)]='List\x20workflows';async[a32_0x13ff80(0x148)](_0x218d40){const _0x35a413=a32_0x13ff80,{options:_0x1c213e,args:_0x32c627,tdx:_0x5e2cd4}=_0x218d40,_0x510e4d=_0x32c627[0x0];try{_0x1c213e[_0x35a413(0x145)]&&_0x510e4d&&console[_0x35a413(0x119)]('Project\x20filter:\x20'+_0x510e4d);const _0x118bfe=await withSpinner(_0x35a413(0x13d),()=>_0x5e2cd4[_0x35a413(0x155)][_0x35a413(0xed)](_0x510e4d,{'limit':_0x1c213e[_0x35a413(0x136)]}),{'verbose':_0x1c213e[_0x35a413(0x145)]}),_0x1e67fe=_0x118bfe['data'];return console[_0x35a413(0x119)]('✔\x20Found\x20'+_0x1e67fe['length']+_0x35a413(0xf3)+(_0x1e67fe[_0x35a413(0x114)]!==0x1?'s':'')),await handleSDKOutput(_0x1e67fe,_0x1c213e),0x0;}catch(_0x5ecb87){if(_0x5ecb87 instanceof SDKError)return console[_0x35a413(0x119)](_0x35a413(0x138)+_0x5ecb87['message']),_0x5ecb87[_0x35a413(0x125)]&&console['error'](_0x35a413(0x12b)+_0x5ecb87[_0x35a413(0x125)]),0x1;throw _0x5ecb87;}}}export class WorkflowSessionsCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x10e);[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x12c);async[a32_0x13ff80(0x148)](_0xaf36fc){const _0x28725c=a32_0x13ff80,{options:_0x5c90a0,args:_0x136d07,tdx:_0x408895}=_0xaf36fc;let _0x47c1e0,_0x20ad01;if(_0x136d07[0x0]){const _0x13e519=_0x136d07[0x0]['split']('.');if(_0x13e519['length']===0x1)_0x47c1e0=_0x13e519[0x0];else{if(_0x13e519['length']===0x2)[_0x47c1e0,_0x20ad01]=_0x13e519;else return console['error']('Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),0x1;}}try{if(_0x5c90a0[_0x28725c(0x145)]){if(_0x47c1e0&&_0x20ad01)console[_0x28725c(0x119)](_0x28725c(0x133)+_0x47c1e0+'.'+_0x20ad01);else _0x47c1e0&&console[_0x28725c(0x119)](_0x28725c(0x15b)+_0x47c1e0);const _0x198866=_0x5c90a0['status'];_0x198866&&console[_0x28725c(0x119)]('Status:\x20'+_0x198866);}const _0x3c0cd1=await withSpinner(_0x28725c(0x106),()=>_0x408895[_0x28725c(0x155)]['sessions']({'projectName':_0x47c1e0,'workflowName':_0x20ad01,'status':_0x5c90a0[_0x28725c(0xe7)],'fromTime':_0x5c90a0[_0x28725c(0x11a)],'toTime':_0x5c90a0['to'],'limit':_0x5c90a0[_0x28725c(0x136)]}),{'verbose':_0x5c90a0[_0x28725c(0x145)]}),_0x5ad890=_0x3c0cd1['data'];return console['error'](_0x28725c(0x167)+_0x5ad890[_0x28725c(0x114)]+_0x28725c(0x11d)+(_0x5ad890[_0x28725c(0x114)]!==0x1?'s':'')),await handleSDKOutput(_0x5ad890,_0x5c90a0),0x0;}catch(_0x380fef){if(_0x380fef instanceof SDKError)return console[_0x28725c(0x119)](_0x28725c(0x138)+_0x380fef[_0x28725c(0xf2)]),_0x380fef[_0x28725c(0x125)]&&console[_0x28725c(0x119)](_0x28725c(0x12b)+_0x380fef[_0x28725c(0x125)]),0x1;throw _0x380fef;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x158);[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x15d);async[a32_0x13ff80(0x148)](_0x4c98a6){const _0x58e37c=a32_0x13ff80,{options:_0x355e9b,args:_0x107bf8,tdx:_0x56cd15}=_0x4c98a6;let _0x75b718,_0x48a118;if(_0x107bf8[0x0]){const _0xf53be2=_0x107bf8[0x0][_0x58e37c(0x128)]('.');if(_0xf53be2['length']===0x1)_0x75b718=_0xf53be2[0x0];else{if(_0xf53be2['length']===0x2)[_0x75b718,_0x48a118]=_0xf53be2;else return console[_0x58e37c(0x119)](_0x58e37c(0x127)),0x1;}}try{const _0x5408eb=_0x355e9b[_0x58e37c(0x11b)];if(_0x355e9b[_0x58e37c(0x145)]){if(_0x75b718&&_0x48a118)console[_0x58e37c(0x119)](_0x58e37c(0x133)+_0x75b718+'.'+_0x48a118);else _0x75b718&&console['error'](_0x58e37c(0x15b)+_0x75b718);_0x5408eb&&console[_0x58e37c(0x119)](_0x58e37c(0xe9));}const _0x1d3fb0=await withSpinner(_0x58e37c(0x14f),()=>_0x56cd15[_0x58e37c(0x155)][_0x58e37c(0x110)]({'projectName':_0x75b718,'workflowName':_0x48a118,'includeRetried':_0x5408eb,'limit':_0x355e9b[_0x58e37c(0x136)]}),{'verbose':_0x355e9b[_0x58e37c(0x145)]}),_0x2a381a=_0x1d3fb0[_0x58e37c(0x130)];return console[_0x58e37c(0x119)](_0x58e37c(0x167)+_0x2a381a[_0x58e37c(0x114)]+'\x20attempt'+(_0x2a381a['length']!==0x1?'s':'')),await handleSDKOutput(_0x2a381a,_0x355e9b),0x0;}catch(_0x36b994){if(_0x36b994 instanceof SDKError)return console[_0x58e37c(0x119)](_0x58e37c(0x138)+_0x36b994[_0x58e37c(0xf2)]),_0x36b994[_0x58e37c(0x125)]&&console[_0x58e37c(0x119)](_0x58e37c(0x12b)+_0x36b994[_0x58e37c(0x125)]),0x1;throw _0x36b994;}}}function a32_0x5a7c(_0x17f220,_0x46dd2a){const _0x565092=a32_0x5650();return a32_0x5a7c=function(_0x5a7cd3,_0x2aed99){_0x5a7cd3=_0x5a7cd3-0xe7;let _0x288da4=_0x565092[_0x5a7cd3];return _0x288da4;},a32_0x5a7c(_0x17f220,_0x46dd2a);}export class WorkflowAttemptCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x160);['description']='Show\x20specific\x20attempt\x20details';async[a32_0x13ff80(0x148)](_0x4eada8){const _0x3d970f=a32_0x13ff80,{options:_0x3d4748,args:_0x43f41b,tdx:_0xb3d9aa}=_0x4eada8,_0x151153=_0x43f41b[0x0];if(!_0x151153)return console['error'](_0x3d970f(0x161)),0x1;try{_0x3d4748[_0x3d970f(0x145)]&&console[_0x3d970f(0x119)](_0x3d970f(0x121)+_0x151153);const _0x1b0957=await withSpinner(_0x3d970f(0x151),()=>_0xb3d9aa['workflow'][_0x3d970f(0x112)](_0x151153),{'verbose':_0x3d4748[_0x3d970f(0x145)]}),_0x244aef=_0x1b0957[_0x3d970f(0x130)];return await handleSDKOutput([_0x244aef],_0x3d4748),0x0;}catch(_0x55e1cb){if(_0x55e1cb instanceof SDKError)return console['error'](_0x3d970f(0x138)+_0x55e1cb[_0x3d970f(0xf2)]),_0x55e1cb[_0x3d970f(0x125)]&&console[_0x3d970f(0x119)](_0x3d970f(0x12b)+_0x55e1cb[_0x3d970f(0x125)]),0x1;throw _0x55e1cb;}}}export class WorkflowTasksCommand extends BaseCommand{['name']=a32_0x13ff80(0xeb);[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x12d);async[a32_0x13ff80(0x148)](_0x411203){const _0x111478=a32_0x13ff80,{options:_0x302353,args:_0x385396,tdx:_0xc9feaa}=_0x411203,_0x248ccf=_0x385396[0x0];if(!_0x248ccf)return console[_0x111478(0x119)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x479ac0=_0x302353[_0x111478(0x109)];_0x302353[_0x111478(0x145)]&&(console[_0x111478(0x119)]('Attempt\x20ID:\x20'+_0x248ccf),_0x479ac0&&console[_0x111478(0x119)](_0x111478(0x149)));const _0x46ab0f=await withSpinner(_0x111478(0x162),()=>_0xc9feaa[_0x111478(0x155)]['tasks'](_0x248ccf,_0x479ac0||![]),{'verbose':_0x302353['verbose']}),_0x565b78=_0x46ab0f[_0x111478(0x130)];return console[_0x111478(0x119)](_0x111478(0x167)+_0x565b78[_0x111478(0x114)]+_0x111478(0xf6)+(_0x565b78[_0x111478(0x114)]!==0x1?'s':'')),await handleSDKOutput(_0x565b78,_0x302353),0x0;}catch(_0xcf9d32){if(_0xcf9d32 instanceof SDKError)return console[_0x111478(0x119)](_0x111478(0x138)+_0xcf9d32[_0x111478(0xf2)]),_0xcf9d32['cause']&&console[_0x111478(0x119)](_0x111478(0x12b)+_0xcf9d32[_0x111478(0x125)]),0x1;throw _0xcf9d32;}}}export class WorkflowLogsCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x113);['description']=a32_0x13ff80(0xf0);async[a32_0x13ff80(0x148)](_0x46ba21){const _0x189977=a32_0x13ff80,{options:_0x23aebc,args:_0x15791d,tdx:_0x319b1b}=_0x46ba21,_0x5f4048=_0x15791d[0x0],_0x1005d7=_0x15791d[0x1];if(!_0x5f4048||!_0x1005d7)return console['error'](_0x189977(0x10d)),0x1;try{_0x23aebc[_0x189977(0x145)]&&(console[_0x189977(0x119)](_0x189977(0x121)+_0x5f4048),console[_0x189977(0x119)](_0x189977(0x129)+_0x1005d7));const _0x2c2c22=_0x23aebc[_0x189977(0xfa)],_0x3e2e39=await withSpinner(_0x189977(0x165),()=>_0x319b1b[_0x189977(0x155)][_0x189977(0x11e)](_0x5f4048,_0x1005d7,{'offset':_0x2c2c22,'limit':_0x23aebc[_0x189977(0x136)]}),{'verbose':_0x23aebc[_0x189977(0x145)]}),_0x457f02=_0x3e2e39[_0x189977(0x130)];return console[_0x189977(0x119)](_0x189977(0x167)+_0x457f02[_0x189977(0x114)]+_0x189977(0x10b)+(_0x457f02[_0x189977(0x114)]!==0x1?_0x189977(0x140):'y')),await handleSDKOutput(_0x457f02,_0x23aebc),0x0;}catch(_0x57e868){if(_0x57e868 instanceof SDKError)return console[_0x189977(0x119)](_0x189977(0x138)+_0x57e868[_0x189977(0xf2)]),_0x57e868['cause']&&console[_0x189977(0x119)](_0x189977(0x12b)+_0x57e868['cause']),0x1;throw _0x57e868;}}}export class WorkflowKillCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x104);[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x13c);async[a32_0x13ff80(0x148)](_0x291f6c){const _0x20bf25=a32_0x13ff80,{options:_0xad14f5,args:_0x18e9cb,tdx:_0x1ab9ef}=_0x291f6c,_0x1fc624=_0x18e9cb[0x0];if(!_0x1fc624)return console[_0x20bf25(0x119)](_0x20bf25(0x161)),0x1;try{const _0x302565=_0xad14f5[_0x20bf25(0x13b)];_0xad14f5[_0x20bf25(0x145)]&&(console[_0x20bf25(0x119)](_0x20bf25(0x121)+_0x1fc624),_0x302565&&console['error'](_0x20bf25(0xef)+_0x302565));if(!_0xad14f5['yes']){const _0x3d7018=await confirm(_0x20bf25(0x12f)+_0x1fc624+'?');if(!_0x3d7018)return console['error']('Cancelled'),0x0;}const _0x498b51=await withSpinner(_0x20bf25(0x117),()=>_0x1ab9ef['workflow']['kill'](_0x1fc624,_0x302565),{'verbose':_0xad14f5[_0x20bf25(0x145)]}),_0x2a5d24=_0x498b51[_0x20bf25(0x130)];return console[_0x20bf25(0x119)]('✔\x20'+_0x2a5d24),0x0;}catch(_0x244f53){if(_0x244f53 instanceof SDKError)return console[_0x20bf25(0x119)](_0x20bf25(0x138)+_0x244f53[_0x20bf25(0xf2)]),_0x244f53[_0x20bf25(0x125)]&&console[_0x20bf25(0x119)](_0x20bf25(0x12b)+_0x244f53['cause']),0x1;throw _0x244f53;}}}export class WorkflowRetryCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x100);[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x122);async[a32_0x13ff80(0x148)](_0x3a5c9d){const _0x23fe0c=a32_0x13ff80,{options:_0x4d3ab2,args:_0x56c616,tdx:_0x6ec883}=_0x3a5c9d,_0x35135b=_0x56c616[0x0];if(!_0x35135b)return console[_0x23fe0c(0x119)](_0x23fe0c(0x14a)),console[_0x23fe0c(0x119)](_0x23fe0c(0x143)),0x1;let _0x7c7eb4=![],_0x1c7b4b=_0x35135b;if(_0x35135b[_0x23fe0c(0x108)](_0x23fe0c(0x107)))_0x7c7eb4=!![],_0x1c7b4b=_0x35135b[_0x23fe0c(0x150)](0x8);else{if(_0x35135b[_0x23fe0c(0x108)]('attempt:'))_0x7c7eb4=![],_0x1c7b4b=_0x35135b[_0x23fe0c(0x150)](0x8);else return console[_0x23fe0c(0x119)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console['error']('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}try{const _0x53b80f=_0x4d3ab2[_0x23fe0c(0x10a)],_0x26dfd7=_0x4d3ab2['resumeFrom'],_0x4f2d6f=_0x4d3ab2[_0x23fe0c(0x147)],_0xf664e8=_0x4d3ab2['force'];_0x4d3ab2[_0x23fe0c(0x145)]&&(console[_0x23fe0c(0x119)](_0x23fe0c(0xee)+(_0x7c7eb4?'session':_0x23fe0c(0x112))+'\x20'+_0x1c7b4b),_0x53b80f&&console['error'](_0x23fe0c(0x144)+_0x53b80f),_0x26dfd7&&console[_0x23fe0c(0x119)](_0x23fe0c(0xec)+_0x26dfd7),_0x4f2d6f&&console[_0x23fe0c(0x119)](_0x23fe0c(0x12a)+_0x4f2d6f),_0xf664e8&&console[_0x23fe0c(0x119)]('Force:\x20yes'));let _0x529e18;if(_0x4f2d6f)try{if(_0x4f2d6f[_0x23fe0c(0x108)]('@')){const _0x481a5c=await import(_0x23fe0c(0x131)),_0x2032f0=_0x4f2d6f[_0x23fe0c(0x150)](0x1),_0x299c2b=await _0x481a5c[_0x23fe0c(0xea)](_0x2032f0,'utf-8');_0x529e18=JSON['parse'](_0x299c2b);}else _0x529e18=JSON[_0x23fe0c(0x15a)](_0x4f2d6f);}catch{return console[_0x23fe0c(0x119)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x4d3ab2[_0x23fe0c(0x14b)]){const _0x3afedf=await confirm(_0x23fe0c(0x134)+(_0x7c7eb4?_0x23fe0c(0x115):_0x23fe0c(0x112))+'\x20'+_0x1c7b4b+'?');if(!_0x3afedf)return console[_0x23fe0c(0x119)](_0x23fe0c(0x11c)),0x0;}let _0x10fa48;_0x7c7eb4?_0x10fa48=await withSpinner('Retrying\x20session...',()=>_0x6ec883[_0x23fe0c(0x155)][_0x23fe0c(0x116)](_0x1c7b4b,{'fromTask':_0x53b80f,'retryParams':_0x529e18}),{'verbose':_0x4d3ab2[_0x23fe0c(0x145)]}):_0x10fa48=await withSpinner('Retrying\x20attempt...',()=>_0x6ec883['workflow'][_0x23fe0c(0x14c)](_0x1c7b4b,{'resumeFrom':_0x26dfd7,'retryParams':_0x529e18,'force':_0xf664e8}),{'verbose':_0x4d3ab2['verbose']});const _0x273fbb=_0x10fa48['data'];return console[_0x23fe0c(0x119)](_0x23fe0c(0x152)),console[_0x23fe0c(0x119)](_0x23fe0c(0x14e)+_0x273fbb[_0x23fe0c(0x101)]),console[_0x23fe0c(0x119)](_0x23fe0c(0xf1)+_0x273fbb[_0x23fe0c(0x169)]),0x0;}catch(_0x3c068a){if(_0x3c068a instanceof SDKError)return console[_0x23fe0c(0x119)](_0x23fe0c(0x138)+_0x3c068a[_0x23fe0c(0xf2)]),_0x3c068a['cause']&&console['error'](_0x23fe0c(0x12b)+_0x3c068a[_0x23fe0c(0x125)]),0x1;throw _0x3c068a;}}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a32_0x13ff80(0x13f);[a32_0x13ff80(0xf4)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a32_0x13ff80(0x148)](_0x569239){const _0x12cd62=a32_0x13ff80,{options:_0x42c0e7,args:_0xc604cb,tdx:_0x3f3c4a}=_0x569239,_0x2cbfa5=_0xc604cb[0x0],_0x3cce60=_0xc604cb[0x1]||'.';if(!_0x2cbfa5)return console['error']('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x12cd62(0x157)),0x1;const _0x1ad6a7=_0x42c0e7[_0x12cd62(0x159)];_0x42c0e7[_0x12cd62(0x145)]&&(console[_0x12cd62(0x119)](_0x12cd62(0x168)+_0x2cbfa5),console['error'](_0x12cd62(0xf7)+_0x3cce60),_0x1ad6a7&&console['error']('Revision:\x20'+_0x1ad6a7));const _0x30aedd=await withSpinner(_0x12cd62(0xfd)+_0x2cbfa5+_0x12cd62(0xff),()=>_0x3f3c4a[_0x12cd62(0x155)]['download'](_0x2cbfa5,_0x3cce60,{'revision':_0x1ad6a7}),{'verbose':_0x42c0e7[_0x12cd62(0x145)]}),_0x5df2f0=_0x30aedd['data'];return console[_0x12cd62(0x119)]('✔\x20Downloaded\x20'+_0x5df2f0['projectName']),console[_0x12cd62(0x119)]('\x20\x20Revision:\x20'+_0x5df2f0[_0x12cd62(0x159)]),console[_0x12cd62(0x119)](_0x12cd62(0x118)+_0x5df2f0[_0x12cd62(0xfc)]),console[_0x12cd62(0x119)](_0x12cd62(0x166)+_0x3cce60+'/'+_0x5df2f0['projectName']),0x0;}}export class WorkflowPushCommand extends BaseCommand{['name']=a32_0x13ff80(0x123);[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x164);async['execute'](_0x15a28a){const _0x371bde=a32_0x13ff80,{options:_0x292120,args:_0x389934,tdx:_0x553069}=_0x15a28a;let _0xb02b5d='.',_0x301b63=_0x292120[_0x371bde(0x11f)];if(_0x389934[0x0]){const {promises:_0x34381f}=await import('fs');try{const _0x90c398=await _0x34381f[_0x371bde(0xfe)](_0x389934[0x0]);if(_0x90c398['isDirectory']())_0xb02b5d=_0x389934[0x0];else return console[_0x371bde(0x119)](_0x371bde(0x138)+_0x389934[0x0]+_0x371bde(0x13a)),0x1;}catch{_0x301b63=_0x389934[0x0],_0xb02b5d='.';}}const _0x598583=_0x292120['revision'],_0x4d0813=_0x292120[_0x371bde(0x132)];_0x292120[_0x371bde(0x145)]&&(console[_0x371bde(0x119)](_0x371bde(0x135)+_0xb02b5d),_0x301b63&&console[_0x371bde(0x119)](_0x371bde(0x142)+_0x301b63),_0x598583&&console[_0x371bde(0x119)](_0x371bde(0x146)+_0x598583),_0x4d0813&&console['error'](_0x371bde(0x102)));const _0x2ce089=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x553069['workflow']['push'](_0xb02b5d,{'projectName':_0x301b63,'revision':_0x598583,'skipValidation':_0x4d0813}),{'verbose':_0x292120[_0x371bde(0x145)]}),_0x24ec96=_0x2ce089['data'];return console[_0x371bde(0x119)]('✔\x20Pushed\x20'+_0x24ec96[_0x371bde(0x15e)]),console[_0x371bde(0x119)](_0x371bde(0x163)+_0x24ec96[_0x371bde(0x139)]),console[_0x371bde(0x119)]('\x20\x20Revision:\x20'+_0x24ec96['revision']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a32_0x13ff80(0x11f)]='workflow:delete';[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x153);async[a32_0x13ff80(0x148)](_0xe45c45){const _0x4193ea=a32_0x13ff80,{options:_0x1518c2,args:_0x1c3784,tdx:_0x4620b9}=_0xe45c45,_0x2804e8=_0x1c3784[0x0];if(!_0x2804e8)return console['error'](_0x4193ea(0x12e)),console[_0x4193ea(0x119)](_0x4193ea(0x14d)),0x1;_0x1518c2[_0x4193ea(0x145)]&&console[_0x4193ea(0x119)]('Project:\x20'+_0x2804e8);if(!_0x1518c2['yes']){const _0x1eb0a5=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x2804e8+_0x4193ea(0xf5));if(!_0x1eb0a5)return console[_0x4193ea(0x119)](_0x4193ea(0x11c)),0x0;}const _0x205c8f=await withSpinner(_0x4193ea(0xe8)+_0x2804e8+_0x4193ea(0xff),()=>_0x4620b9[_0x4193ea(0x155)][_0x4193ea(0x13e)](_0x2804e8),{'verbose':_0x1518c2['verbose']}),_0x2bac2a=_0x205c8f[_0x4193ea(0x130)];return console[_0x4193ea(0x119)](_0x4193ea(0x10c)+_0x2bac2a[_0x4193ea(0x15e)]),console[_0x4193ea(0x119)]('\x20\x20Project\x20ID:\x20'+_0x2bac2a[_0x4193ea(0x139)]),0x0;}}
|
|
1
|
+
const a32_0x5b5461=a32_0xe2d5;(function(_0x3485a8,_0x25379c){const _0x22b278=a32_0xe2d5,_0x2820d8=_0x3485a8();while(!![]){try{const _0x544298=-parseInt(_0x22b278(0xf4))/0x1+parseInt(_0x22b278(0xf3))/0x2*(-parseInt(_0x22b278(0x113))/0x3)+parseInt(_0x22b278(0x131))/0x4+parseInt(_0x22b278(0xf1))/0x5*(parseInt(_0x22b278(0xe2))/0x6)+parseInt(_0x22b278(0xfe))/0x7+-parseInt(_0x22b278(0xd7))/0x8*(-parseInt(_0x22b278(0xde))/0x9)+-parseInt(_0x22b278(0x10c))/0xa;if(_0x544298===_0x25379c)break;else _0x2820d8['push'](_0x2820d8['shift']());}catch(_0x7ce750){_0x2820d8['push'](_0x2820d8['shift']());}}}(a32_0x2d8f,0x9515e));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{['name']=a32_0x5b5461(0x12d);['description']=a32_0x5b5461(0xd6);async['execute'](_0x5bd498){const _0x596ef1=a32_0x5b5461,{options:_0x108ffe,args:_0x579e0d,tdx:_0x2572d9}=_0x5bd498,_0x30e5bd=_0x579e0d[0x0];try{_0x108ffe[_0x596ef1(0x108)]&&_0x30e5bd&&console[_0x596ef1(0x12a)](_0x596ef1(0xd5)+_0x30e5bd);const _0x1ff21b=await withSpinner(_0x596ef1(0xcf),()=>_0x2572d9[_0x596ef1(0xd1)][_0x596ef1(0xed)](_0x30e5bd,{'limit':_0x108ffe[_0x596ef1(0x120)]}),{'verbose':_0x108ffe['verbose']}),_0x39dfe7=_0x1ff21b[_0x596ef1(0x13f)];return console[_0x596ef1(0x12a)](_0x596ef1(0x121)+_0x39dfe7[_0x596ef1(0x130)]+_0x596ef1(0x142)+(_0x39dfe7[_0x596ef1(0x130)]!==0x1?'s':'')),await handleSDKOutput(_0x39dfe7,_0x108ffe),0x0;}catch(_0x296d7a){if(_0x296d7a instanceof SDKError)return console['error'](_0x596ef1(0xdd)+_0x296d7a['message']),_0x296d7a[_0x596ef1(0x135)]&&console[_0x596ef1(0x12a)](_0x596ef1(0x102)+_0x296d7a['cause']),0x1;throw _0x296d7a;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a32_0x5b5461(0x126)]='workflow:workflows';[a32_0x5b5461(0x123)]=a32_0x5b5461(0x103);async[a32_0x5b5461(0x101)](_0x32483b){const _0x498118=a32_0x5b5461,{options:_0x25a848,args:_0x5ed856,tdx:_0x358239}=_0x32483b,_0x314694=_0x5ed856[0x0];try{_0x25a848[_0x498118(0x108)]&&_0x314694&&console[_0x498118(0x12a)](_0x498118(0xfb)+_0x314694);const _0xdda83d=await withSpinner(_0x498118(0xf8),()=>_0x358239[_0x498118(0xd1)][_0x498118(0xea)](_0x314694,{'limit':_0x25a848['limit']}),{'verbose':_0x25a848[_0x498118(0x108)]}),_0x4679fc=_0xdda83d[_0x498118(0x13f)];return console['error'](_0x498118(0x121)+_0x4679fc[_0x498118(0x130)]+_0x498118(0x128)+(_0x4679fc[_0x498118(0x130)]!==0x1?'s':'')),await handleSDKOutput(_0x4679fc,_0x25a848),0x0;}catch(_0x2c57b5){if(_0x2c57b5 instanceof SDKError)return console['error'](_0x498118(0xdd)+_0x2c57b5[_0x498118(0xd8)]),_0x2c57b5['cause']&&console[_0x498118(0x12a)]('\x20\x20Cause:\x20'+_0x2c57b5[_0x498118(0x135)]),0x1;throw _0x2c57b5;}}}export class WorkflowSessionsCommand extends BaseCommand{[a32_0x5b5461(0x126)]=a32_0x5b5461(0xf6);['description']=a32_0x5b5461(0x116);async[a32_0x5b5461(0x101)](_0x32fa05){const _0x5d0f96=a32_0x5b5461,{options:_0x2c413d,args:_0x30df00,tdx:_0x5850c8}=_0x32fa05;let _0x26e0c8,_0x535b00;if(_0x30df00[0x0]){const _0x5622ba=_0x30df00[0x0][_0x5d0f96(0xe8)]('.');if(_0x5622ba[_0x5d0f96(0x130)]===0x1)_0x26e0c8=_0x5622ba[0x0];else{if(_0x5622ba[_0x5d0f96(0x130)]===0x2)[_0x26e0c8,_0x535b00]=_0x5622ba;else return console[_0x5d0f96(0x12a)](_0x5d0f96(0x132)),0x1;}}try{if(_0x2c413d[_0x5d0f96(0x108)]){if(_0x26e0c8&&_0x535b00)console[_0x5d0f96(0x12a)](_0x5d0f96(0x148)+_0x26e0c8+'.'+_0x535b00);else _0x26e0c8&&console[_0x5d0f96(0x12a)]('Filter:\x20project='+_0x26e0c8);const _0x5d6280=_0x2c413d[_0x5d0f96(0xcd)];_0x5d6280&&console['error'](_0x5d0f96(0xf0)+_0x5d6280);}const _0x2eeab0=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x5850c8[_0x5d0f96(0xd1)][_0x5d0f96(0xd0)]({'projectName':_0x26e0c8,'workflowName':_0x535b00,'status':_0x2c413d[_0x5d0f96(0xcd)],'fromTime':_0x2c413d[_0x5d0f96(0x11c)],'toTime':_0x2c413d['to'],'limit':_0x2c413d[_0x5d0f96(0x120)]}),{'verbose':_0x2c413d[_0x5d0f96(0x108)]}),_0x278f38=_0x2eeab0['data'];return console['error'](_0x5d0f96(0x121)+_0x278f38[_0x5d0f96(0x130)]+_0x5d0f96(0x12c)+(_0x278f38[_0x5d0f96(0x130)]!==0x1?'s':'')),await handleSDKOutput(_0x278f38,_0x2c413d),0x0;}catch(_0x3af399){if(_0x3af399 instanceof SDKError)return console[_0x5d0f96(0x12a)]('Error:\x20'+_0x3af399[_0x5d0f96(0xd8)]),_0x3af399[_0x5d0f96(0x135)]&&console[_0x5d0f96(0x12a)](_0x5d0f96(0x102)+_0x3af399[_0x5d0f96(0x135)]),0x1;throw _0x3af399;}}}export class WorkflowAttemptsCommand extends BaseCommand{['name']=a32_0x5b5461(0x109);[a32_0x5b5461(0x123)]=a32_0x5b5461(0xcb);async[a32_0x5b5461(0x101)](_0x4a4db3){const _0x259d58=a32_0x5b5461,{options:_0x2676d2,args:_0x4c4857,tdx:_0xe63ab7}=_0x4a4db3;let _0xf92844,_0x20b103;if(_0x4c4857[0x0]){const _0x2115d3=_0x4c4857[0x0][_0x259d58(0xe8)]('.');if(_0x2115d3[_0x259d58(0x130)]===0x1)_0xf92844=_0x2115d3[0x0];else{if(_0x2115d3[_0x259d58(0x130)]===0x2)[_0xf92844,_0x20b103]=_0x2115d3;else return console[_0x259d58(0x12a)](_0x259d58(0x132)),0x1;}}try{const _0x207b27=_0x2676d2[_0x259d58(0x11a)];if(_0x2676d2[_0x259d58(0x108)]){if(_0xf92844&&_0x20b103)console[_0x259d58(0x12a)](_0x259d58(0x148)+_0xf92844+'.'+_0x20b103);else _0xf92844&&console[_0x259d58(0x12a)](_0x259d58(0xd9)+_0xf92844);_0x207b27&&console[_0x259d58(0x12a)](_0x259d58(0x111));}const _0x52656f=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0xe63ab7[_0x259d58(0xd1)]['attempts']({'projectName':_0xf92844,'workflowName':_0x20b103,'includeRetried':_0x207b27,'limit':_0x2676d2[_0x259d58(0x120)]}),{'verbose':_0x2676d2['verbose']}),_0x267007=_0x52656f[_0x259d58(0x13f)];return console[_0x259d58(0x12a)](_0x259d58(0x121)+_0x267007[_0x259d58(0x130)]+'\x20attempt'+(_0x267007[_0x259d58(0x130)]!==0x1?'s':'')),await handleSDKOutput(_0x267007,_0x2676d2),0x0;}catch(_0x272463){if(_0x272463 instanceof SDKError)return console[_0x259d58(0x12a)](_0x259d58(0xdd)+_0x272463['message']),_0x272463[_0x259d58(0x135)]&&console[_0x259d58(0x12a)](_0x259d58(0x102)+_0x272463[_0x259d58(0x135)]),0x1;throw _0x272463;}}}export class WorkflowAttemptCommand extends BaseCommand{[a32_0x5b5461(0x126)]='workflow:attempt';[a32_0x5b5461(0x123)]=a32_0x5b5461(0x125);async[a32_0x5b5461(0x101)](_0x5f2558){const _0x4eecc0=a32_0x5b5461,{options:_0x132e38,args:_0x845f9b,tdx:_0x40e17a}=_0x5f2558,_0x5e030c=_0x845f9b[0x0];if(!_0x5e030c)return console[_0x4eecc0(0x12a)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{_0x132e38['verbose']&&console[_0x4eecc0(0x12a)](_0x4eecc0(0x115)+_0x5e030c);const _0x268cd0=await withSpinner('Getting\x20attempt\x20details...',()=>_0x40e17a[_0x4eecc0(0xd1)][_0x4eecc0(0xd3)](_0x5e030c),{'verbose':_0x132e38[_0x4eecc0(0x108)]}),_0x271bef=_0x268cd0['data'];return await handleSDKOutput([_0x271bef],_0x132e38),0x0;}catch(_0x1b647e){if(_0x1b647e instanceof SDKError)return console[_0x4eecc0(0x12a)](_0x4eecc0(0xdd)+_0x1b647e[_0x4eecc0(0xd8)]),_0x1b647e[_0x4eecc0(0x135)]&&console['error'](_0x4eecc0(0x102)+_0x1b647e[_0x4eecc0(0x135)]),0x1;throw _0x1b647e;}}}export class WorkflowTasksCommand extends BaseCommand{[a32_0x5b5461(0x126)]=a32_0x5b5461(0x13a);[a32_0x5b5461(0x123)]='Show\x20tasks\x20for\x20an\x20attempt';async[a32_0x5b5461(0x101)](_0x3193b0){const _0x59cf73=a32_0x5b5461,{options:_0x5634a2,args:_0x2e7e32,tdx:_0x4eb8f0}=_0x3193b0,_0x39ab5e=_0x2e7e32[0x0];if(!_0x39ab5e)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x41f35e=_0x5634a2['includeSubtasks'];_0x5634a2['verbose']&&(console[_0x59cf73(0x12a)](_0x59cf73(0x115)+_0x39ab5e),_0x41f35e&&console['error']('Including\x20subtasks:\x20yes'));const _0x284ae2=await withSpinner(_0x59cf73(0xdc),()=>_0x4eb8f0[_0x59cf73(0xd1)][_0x59cf73(0xf9)](_0x39ab5e,_0x41f35e||![]),{'verbose':_0x5634a2['verbose']}),_0xf08d6=_0x284ae2[_0x59cf73(0x13f)];return console[_0x59cf73(0x12a)](_0x59cf73(0x121)+_0xf08d6[_0x59cf73(0x130)]+'\x20task'+(_0xf08d6['length']!==0x1?'s':'')),await handleSDKOutput(_0xf08d6,_0x5634a2),0x0;}catch(_0x46bc9b){if(_0x46bc9b instanceof SDKError)return console[_0x59cf73(0x12a)](_0x59cf73(0xdd)+_0x46bc9b[_0x59cf73(0xd8)]),_0x46bc9b[_0x59cf73(0x135)]&&console[_0x59cf73(0x12a)](_0x59cf73(0x102)+_0x46bc9b['cause']),0x1;throw _0x46bc9b;}}}function a32_0x2d8f(){const _0x50b2dc=['Usage:\x20workflow:delete\x20<project-name-or-id>','From\x20task:\x20','length','3125564sWmZHm','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','workflow:retry','Output\x20directory:\x20','cause','Error:\x20Project\x20name\x20is\x20required','readFile','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','attemptId','workflow:tasks','revision','Task\x20name:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','data','Error:\x20Invalid\x20JSON\x20in\x20--params','parse','\x20project','✔\x20Pushed\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Deleting\x20project\x20','✔\x20Retry\x20started','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Filter:\x20','Killing\x20attempt...','projectId','Show\x20logs\x20for\x20a\x20specific\x20task','List\x20workflow\x20attempts','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','status','\x20\x20Revision:\x20','Listing\x20workflow\x20projects...','sessions','workflow','...','attempt','skipValidation','Pattern:\x20','List\x20all\x20workflow\x20projects','144VhItmW','message','Filter:\x20project=','offset','Validation:\x20skipped','Getting\x20attempt\x20tasks...','Error:\x20','74133nwQKEj','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','startsWith','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','1842phZvLX','retryAttempt','ies','session','filesExtracted','\x20\x20Project\x20ID:\x20','split','\x20\x20New\x20attempt\x20ID:\x20','workflows','retrySession','resumeFrom','projects','sessionId','isDirectory','Status:\x20','18110vUZmjd','session:','34PqSbBa','813269ohAyYx','params','workflow:sessions','Cancelled','Listing\x20workflows...','tasks','workflow:delete','Project\x20filter:\x20','reason','Error:\x20Attempt\x20ID\x20is\x20required','6541423SdWKak','\x20\x20Files\x20extracted:\x20','projectName','execute','\x20\x20Cause:\x20','List\x20workflows','attempt:','Error:\x20Attempt\x20ID\x20and\x20task\x20name\x20are\x20required','delete','Downloading\x20project\x20','verbose','workflow:attempts','\x20\x20Session\x20ID:\x20','workflow:download','9398200ZLsjAu','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','yes','✔\x20Deleted\x20project\x20','Force:\x20yes','Include\x20retried:\x20yes','Project:\x20','108063WxKEAF','fromTask','Attempt\x20ID:\x20','List\x20workflow\x20execution\x20sessions','Reason:\x20','Getting\x20task\x20logs...','push','includeRetried','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','from','substring','workflow:logs','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','limit','✔\x20Found\x20','Retrying\x20attempt...','description','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Show\x20specific\x20attempt\x20details','name','Revision:\x20','\x20workflow','stat','error','Resume\x20from:\x20','\x20session','workflow:projects'];a32_0x2d8f=function(){return _0x50b2dc;};return a32_0x2d8f();}export class WorkflowLogsCommand extends BaseCommand{[a32_0x5b5461(0x126)]=a32_0x5b5461(0x11e);[a32_0x5b5461(0x123)]=a32_0x5b5461(0x14b);async[a32_0x5b5461(0x101)](_0x53888a){const _0x2d77b3=a32_0x5b5461,{options:_0x508472,args:_0x189840,tdx:_0x1e9df3}=_0x53888a,_0x117754=_0x189840[0x0],_0x46194=_0x189840[0x1];if(!_0x117754||!_0x46194)return console[_0x2d77b3(0x12a)](_0x2d77b3(0x105)),0x1;try{_0x508472[_0x2d77b3(0x108)]&&(console[_0x2d77b3(0x12a)](_0x2d77b3(0x115)+_0x117754),console[_0x2d77b3(0x12a)](_0x2d77b3(0x13c)+_0x46194));const _0x4cef2d=_0x508472[_0x2d77b3(0xda)],_0x50b1f4=await withSpinner(_0x2d77b3(0x118),()=>_0x1e9df3['workflow']['logs'](_0x117754,_0x46194,{'offset':_0x4cef2d,'limit':_0x508472[_0x2d77b3(0x120)]}),{'verbose':_0x508472['verbose']}),_0x800e72=_0x50b1f4['data'];return console[_0x2d77b3(0x12a)](_0x2d77b3(0x121)+_0x800e72['length']+'\x20log\x20entr'+(_0x800e72[_0x2d77b3(0x130)]!==0x1?_0x2d77b3(0xe4):'y')),await handleSDKOutput(_0x800e72,_0x508472),0x0;}catch(_0x3c7f9d){if(_0x3c7f9d instanceof SDKError)return console[_0x2d77b3(0x12a)](_0x2d77b3(0xdd)+_0x3c7f9d[_0x2d77b3(0xd8)]),_0x3c7f9d[_0x2d77b3(0x135)]&&console[_0x2d77b3(0x12a)](_0x2d77b3(0x102)+_0x3c7f9d['cause']),0x1;throw _0x3c7f9d;}}}export class WorkflowKillCommand extends BaseCommand{[a32_0x5b5461(0x126)]='workflow:kill';[a32_0x5b5461(0x123)]='Kill\x20a\x20running\x20attempt';async['execute'](_0x5db412){const _0x10e89e=a32_0x5b5461,{options:_0x4398ce,args:_0x2f6697,tdx:_0x200867}=_0x5db412,_0x2d92b9=_0x2f6697[0x0];if(!_0x2d92b9)return console[_0x10e89e(0x12a)](_0x10e89e(0xfd)),0x1;try{const _0x52ac7d=_0x4398ce[_0x10e89e(0xfc)];_0x4398ce[_0x10e89e(0x108)]&&(console[_0x10e89e(0x12a)]('Attempt\x20ID:\x20'+_0x2d92b9),_0x52ac7d&&console['error'](_0x10e89e(0x117)+_0x52ac7d));if(!_0x4398ce['yes']){const _0xbe267a=await confirm(_0x10e89e(0x124)+_0x2d92b9+'?');if(!_0xbe267a)return console[_0x10e89e(0x12a)](_0x10e89e(0xf7)),0x0;}const _0x1ca29a=await withSpinner(_0x10e89e(0x149),()=>_0x200867[_0x10e89e(0xd1)]['kill'](_0x2d92b9,_0x52ac7d),{'verbose':_0x4398ce['verbose']}),_0x49622e=_0x1ca29a['data'];return console[_0x10e89e(0x12a)]('✔\x20'+_0x49622e),0x0;}catch(_0x2c28b0){if(_0x2c28b0 instanceof SDKError)return console[_0x10e89e(0x12a)](_0x10e89e(0xdd)+_0x2c28b0[_0x10e89e(0xd8)]),_0x2c28b0[_0x10e89e(0x135)]&&console[_0x10e89e(0x12a)](_0x10e89e(0x102)+_0x2c28b0['cause']),0x1;throw _0x2c28b0;}}}export class WorkflowRetryCommand extends BaseCommand{['name']=a32_0x5b5461(0x133);['description']='Retry\x20a\x20session\x20or\x20attempt';async[a32_0x5b5461(0x101)](_0x3fb1ba){const _0x33dd78=a32_0x5b5461,{options:_0x5e15d1,args:_0x156af1,tdx:_0x2953a0}=_0x3fb1ba,_0x4430cc=_0x156af1[0x0];if(!_0x4430cc)return console['error'](_0x33dd78(0xdf)),console[_0x33dd78(0x12a)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x14ac69=![],_0x351e35=_0x4430cc;if(_0x4430cc[_0x33dd78(0xe0)](_0x33dd78(0xf2)))_0x14ac69=!![],_0x351e35=_0x4430cc['substring'](0x8);else{if(_0x4430cc[_0x33dd78(0xe0)](_0x33dd78(0x104)))_0x14ac69=![],_0x351e35=_0x4430cc[_0x33dd78(0x11d)](0x8);else return console[_0x33dd78(0x12a)](_0x33dd78(0x13e)),console[_0x33dd78(0x12a)](_0x33dd78(0x11b)),0x1;}try{const _0x360263=_0x5e15d1[_0x33dd78(0x114)],_0x5d1623=_0x5e15d1[_0x33dd78(0xec)],_0x55b610=_0x5e15d1[_0x33dd78(0xf5)],_0x57f378=_0x5e15d1['force'];_0x5e15d1[_0x33dd78(0x108)]&&(console[_0x33dd78(0x12a)]('Target:\x20'+(_0x14ac69?_0x33dd78(0xe5):_0x33dd78(0xd3))+'\x20'+_0x351e35),_0x360263&&console[_0x33dd78(0x12a)](_0x33dd78(0x12f)+_0x360263),_0x5d1623&&console['error'](_0x33dd78(0x12b)+_0x5d1623),_0x55b610&&console[_0x33dd78(0x12a)]('Params:\x20'+_0x55b610),_0x57f378&&console[_0x33dd78(0x12a)](_0x33dd78(0x110)));let _0x401235;if(_0x55b610)try{if(_0x55b610['startsWith']('@')){const _0x4a8f06=await import('fs/promises'),_0x9bd2f5=_0x55b610[_0x33dd78(0x11d)](0x1),_0x37ad23=await _0x4a8f06[_0x33dd78(0x137)](_0x9bd2f5,'utf-8');_0x401235=JSON[_0x33dd78(0x141)](_0x37ad23);}else _0x401235=JSON[_0x33dd78(0x141)](_0x55b610);}catch{return console[_0x33dd78(0x12a)](_0x33dd78(0x140)),0x1;}if(!_0x5e15d1['yes']){const _0x8c3740=await confirm(_0x33dd78(0x147)+(_0x14ac69?'session':_0x33dd78(0xd3))+'\x20'+_0x351e35+'?');if(!_0x8c3740)return console['error'](_0x33dd78(0xf7)),0x0;}let _0xa02ee5;_0x14ac69?_0xa02ee5=await withSpinner('Retrying\x20session...',()=>_0x2953a0['workflow'][_0x33dd78(0xeb)](_0x351e35,{'fromTask':_0x360263,'retryParams':_0x401235}),{'verbose':_0x5e15d1[_0x33dd78(0x108)]}):_0xa02ee5=await withSpinner(_0x33dd78(0x122),()=>_0x2953a0['workflow'][_0x33dd78(0xe3)](_0x351e35,{'resumeFrom':_0x5d1623,'retryParams':_0x401235,'force':_0x57f378}),{'verbose':_0x5e15d1['verbose']});const _0x16d256=_0xa02ee5['data'];return console[_0x33dd78(0x12a)](_0x33dd78(0x146)),console[_0x33dd78(0x12a)](_0x33dd78(0xe9)+_0x16d256[_0x33dd78(0x139)]),console[_0x33dd78(0x12a)](_0x33dd78(0x10a)+_0x16d256[_0x33dd78(0xee)]),0x0;}catch(_0x520c7e){if(_0x520c7e instanceof SDKError)return console[_0x33dd78(0x12a)]('Error:\x20'+_0x520c7e[_0x33dd78(0xd8)]),_0x520c7e[_0x33dd78(0x135)]&&console['error'](_0x33dd78(0x102)+_0x520c7e['cause']),0x1;throw _0x520c7e;}}}export class WorkflowDownloadCommand extends BaseCommand{[a32_0x5b5461(0x126)]=a32_0x5b5461(0x10b);['description']=a32_0x5b5461(0xe1);async[a32_0x5b5461(0x101)](_0x14785e){const _0x180417=a32_0x5b5461,{options:_0x2279d9,args:_0x3e2cec,tdx:_0xac173d}=_0x14785e,_0x5b9755=_0x3e2cec[0x0],_0x525ac9=_0x3e2cec[0x1]||'.';if(!_0x5b9755)return console['error'](_0x180417(0x136)),console['error'](_0x180417(0x10d)),0x1;const _0x2ca220=_0x2279d9['revision'];_0x2279d9[_0x180417(0x108)]&&(console['error'](_0x180417(0x112)+_0x5b9755),console[_0x180417(0x12a)](_0x180417(0x134)+_0x525ac9),_0x2ca220&&console['error'](_0x180417(0x127)+_0x2ca220));const _0xa4eafb=await withSpinner(_0x180417(0x107)+_0x5b9755+'...',()=>_0xac173d[_0x180417(0xd1)]['download'](_0x5b9755,_0x525ac9,{'revision':_0x2ca220}),{'verbose':_0x2279d9[_0x180417(0x108)]}),_0x1eae64=_0xa4eafb[_0x180417(0x13f)];return console[_0x180417(0x12a)]('✔\x20Downloaded\x20'+_0x1eae64[_0x180417(0x100)]),console[_0x180417(0x12a)](_0x180417(0xce)+_0x1eae64[_0x180417(0x13b)]),console[_0x180417(0x12a)](_0x180417(0xff)+_0x1eae64[_0x180417(0xe6)]),console['error']('\x20\x20Location:\x20'+_0x525ac9+'/'+_0x1eae64['projectName']),0x0;}}export class WorkflowPushCommand extends BaseCommand{['name']='workflow:push';['description']=a32_0x5b5461(0xcc);async[a32_0x5b5461(0x101)](_0x564029){const _0x172551=a32_0x5b5461,{options:_0x523c06,args:_0x1a641f,tdx:_0x248290}=_0x564029;let _0x45750d='.',_0x4e7c19=_0x523c06[_0x172551(0x126)];if(_0x1a641f[0x0]){const {promises:_0x3b7d53}=await import('fs');try{const _0x337112=await _0x3b7d53[_0x172551(0x129)](_0x1a641f[0x0]);if(_0x337112[_0x172551(0xef)]())_0x45750d=_0x1a641f[0x0];else return console[_0x172551(0x12a)]('Error:\x20'+_0x1a641f[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x4e7c19=_0x1a641f[0x0],_0x45750d='.';}}const _0x434fb4=_0x523c06[_0x172551(0x13b)],_0x2ea97a=_0x523c06[_0x172551(0xd4)];_0x523c06[_0x172551(0x108)]&&(console[_0x172551(0x12a)]('Project\x20directory:\x20'+_0x45750d),_0x4e7c19&&console['error']('Project\x20name:\x20'+_0x4e7c19),_0x434fb4&&console[_0x172551(0x12a)]('Revision:\x20'+_0x434fb4),_0x2ea97a&&console[_0x172551(0x12a)](_0x172551(0xdb)));const _0x51a75c=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x248290[_0x172551(0xd1)][_0x172551(0x119)](_0x45750d,{'projectName':_0x4e7c19,'revision':_0x434fb4,'skipValidation':_0x2ea97a}),{'verbose':_0x523c06[_0x172551(0x108)]}),_0x5909bf=_0x51a75c[_0x172551(0x13f)];return console['error'](_0x172551(0x143)+_0x5909bf[_0x172551(0x100)]),console[_0x172551(0x12a)](_0x172551(0xe7)+_0x5909bf['projectId']),console[_0x172551(0x12a)](_0x172551(0xce)+_0x5909bf[_0x172551(0x13b)]),0x0;}}function a32_0xe2d5(_0x4aa0ca,_0x33417d){const _0x2d8ff1=a32_0x2d8f();return a32_0xe2d5=function(_0xe2d5ac,_0x4dd646){_0xe2d5ac=_0xe2d5ac-0xcb;let _0x1d23d0=_0x2d8ff1[_0xe2d5ac];return _0x1d23d0;},a32_0xe2d5(_0x4aa0ca,_0x33417d);}export class WorkflowDeleteCommand extends BaseCommand{[a32_0x5b5461(0x126)]=a32_0x5b5461(0xfa);[a32_0x5b5461(0x123)]=a32_0x5b5461(0x144);async['execute'](_0x55af6f){const _0x5ea8f3=a32_0x5b5461,{options:_0xf78f2f,args:_0x1cf046,tdx:_0x441f4b}=_0x55af6f,_0x4daff0=_0x1cf046[0x0];if(!_0x4daff0)return console[_0x5ea8f3(0x12a)](_0x5ea8f3(0x138)),console['error'](_0x5ea8f3(0x12e)),0x1;_0xf78f2f['verbose']&&console[_0x5ea8f3(0x12a)]('Project:\x20'+_0x4daff0);if(!_0xf78f2f[_0x5ea8f3(0x10e)]){const _0x205d70=await confirm(_0x5ea8f3(0x11f)+_0x4daff0+_0x5ea8f3(0x13d));if(!_0x205d70)return console[_0x5ea8f3(0x12a)](_0x5ea8f3(0xf7)),0x0;}const _0x4cb097=await withSpinner(_0x5ea8f3(0x145)+_0x4daff0+_0x5ea8f3(0xd2),()=>_0x441f4b[_0x5ea8f3(0xd1)][_0x5ea8f3(0x106)](_0x4daff0),{'verbose':_0xf78f2f[_0x5ea8f3(0x108)]}),_0x472af6=_0x4cb097[_0x5ea8f3(0x13f)];return console['error'](_0x5ea8f3(0x10f)+_0x472af6[_0x5ea8f3(0x100)]),console['error'](_0x5ea8f3(0xe7)+_0x472af6[_0x5ea8f3(0x14a)]),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x29fa8d,_0x5c06a4){const _0x102387=a33_0x732b,_0x187463=_0x29fa8d();while(!![]){try{const _0x1a2b0d=-parseInt(_0x102387(0x1cf))/0x1+parseInt(_0x102387(0x1dc))/0x2*(parseInt(_0x102387(0x1d8))/0x3)+-parseInt(_0x102387(0x1d2))/0x4*(-parseInt(_0x102387(0x1d9))/0x5)+-parseInt(_0x102387(0x1d0))/0x6*(parseInt(_0x102387(0x1d7))/0x7)+parseInt(_0x102387(0x1cb))/0x8+-parseInt(_0x102387(0x1da))/0x9*(parseInt(_0x102387(0x1d4))/0xa)+-parseInt(_0x102387(0x1cd))/0xb*(parseInt(_0x102387(0x1d6))/0xc);if(_0x1a2b0d===_0x5c06a4)break;else _0x187463['push'](_0x187463['shift']());}catch(_0x2517d1){_0x187463['push'](_0x187463['shift']());}}}(a33_0x3524,0x4cc21));import{platform}from'os';function a33_0x732b(_0x3372cc,_0xf3d538){const _0x3524d4=a33_0x3524();return a33_0x732b=function(_0x732b09,_0x3cde92){_0x732b09=_0x732b09-0x1c8;let _0x3e0f94=_0x3524d4[_0x732b09];return _0x3e0f94;},a33_0x732b(_0x3372cc,_0xf3d538);}import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';function a33_0x3524(){const _0x192dc2=['350PnkQIz','18ruCgVJ',';\x20node/','268TRWNtd','Authorization','0.0.0','utf-8','tdx','3523616SokCrt','X-Trino-User','14806cawlvF','parse','185916YqAJWc','917646sQETWm','version','35408UPEKMy','TD1\x20','2404210ozKiZW','entries','2868lqpOFt','7ZiUaVl','8859aAdAxi'];a33_0x3524=function(){return _0x192dc2;};return a33_0x3524();}import{getAPIKey}from'./config.js';export function getVersion(){const _0x3f7052=a33_0x732b;try{const _0x429521=fileURLToPath(import.meta['url']),_0x383889=dirname(_0x429521),_0x495f10=join(_0x383889,'../../package.json'),_0x3bbcf1=JSON[_0x3f7052(0x1ce)](readFileSync(_0x495f10,_0x3f7052(0x1c9)));return _0x3bbcf1[_0x3f7052(0x1d1)];}catch{return _0x3f7052(0x1c8);}}export function getUserAgent(){const _0x1f9edc=a33_0x732b,_0x2d87e4=getVersion(),_0x4f463d=platform(),_0x356da9=process[_0x1f9edc(0x1d1)]['replace']('v','');return'tdx/'+_0x2d87e4+'\x20('+_0x4f463d+_0x1f9edc(0x1db)+_0x356da9+')';}export function getAuthHeaders(_0x573404,_0x30c2ec){const _0x4c198d=a33_0x732b,_0x20aa10=getVersion(),_0x1cd34b={'User-Agent':getUserAgent(),'X-TD-Client':_0x4c198d(0x1ca),'X-TD-Client-Version':_0x20aa10};return _0x30c2ec&&(_0x1cd34b[_0x4c198d(0x1dd)]=_0x4c198d(0x1d3)+_0x30c2ec),_0x1cd34b;}export function toHeaderRecord(_0x3baf30){const _0x55b7bc=a33_0x732b,_0x535d3d={};for(const [_0x2674df,_0x247de7]of Object[_0x55b7bc(0x1d5)](_0x3baf30)){_0x247de7!==undefined&&(_0x535d3d[_0x2674df]=_0x247de7);}return _0x535d3d;}export function getTrinoHeaders(_0x271c9f,_0xdf354){const _0xde2d69=a33_0x732b,_0x136dbd=getAuthHeaders(_0x271c9f,_0xdf354),_0x54f389=toHeaderRecord(_0x136dbd);return delete _0x54f389[_0xde2d69(0x1dd)],_0xdf354&&(_0x54f389[_0xde2d69(0x1cc)]=_0xdf354),_0x54f389;}export function hasAPIKey(_0x5060f9){const _0x2381d1=getAPIKey(_0x5060f9);return _0x2381d1!==undefined&&_0x2381d1['length']>0x0;}
|