@treasuredata/tdx 0.2.5 → 0.2.6

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.
Files changed (83) hide show
  1. package/dist/build-info.json +2 -2
  2. package/dist/cli.js +1 -1
  3. package/dist/client/cdp-client.js +1 -1
  4. package/dist/client/http-client.js +1 -1
  5. package/dist/client/llm-client.js +1 -1
  6. package/dist/client/rate-limiter.js +1 -1
  7. package/dist/client/td-client.js +1 -1
  8. package/dist/client/trino-client.js +1 -1
  9. package/dist/client/workflow-client.js +1 -1
  10. package/dist/commands/activations.js +1 -1
  11. package/dist/commands/api-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/context-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/job-command.js +1 -1
  19. package/dist/commands/llm-command.js +1 -1
  20. package/dist/commands/llm-proxy.js +1 -1
  21. package/dist/commands/parent-segment-command.js +1 -1
  22. package/dist/commands/profiles-command.js +1 -1
  23. package/dist/commands/query-command.js +1 -1
  24. package/dist/commands/segment-command.js +1 -1
  25. package/dist/commands/segment-create-command.js +1 -1
  26. package/dist/commands/segment-fields-command.js +1 -1
  27. package/dist/commands/segment-pwd-command.js +1 -1
  28. package/dist/commands/segment-update-command.js +1 -1
  29. package/dist/commands/segment-use-command.js +1 -1
  30. package/dist/commands/segments.js +1 -1
  31. package/dist/commands/show.js +1 -1
  32. package/dist/commands/tables.js +1 -1
  33. package/dist/commands/use-command.js +1 -1
  34. package/dist/commands/workflow-command.js +1 -1
  35. package/dist/core/auth.js +1 -1
  36. package/dist/core/config.js +1 -1
  37. package/dist/core/global-context.js +1 -1
  38. package/dist/core/profile.js +1 -1
  39. package/dist/core/project-config.js +1 -1
  40. package/dist/core/session.js +1 -1
  41. package/dist/index.js +1 -1
  42. package/dist/proxy/anthropic-adapter.js +1 -1
  43. package/dist/proxy/server.js +1 -1
  44. package/dist/proxy/server.js.map +1 -1
  45. package/dist/proxy/session-cache.js +1 -1
  46. package/dist/sdk/api.js +1 -1
  47. package/dist/sdk/database.js +1 -1
  48. package/dist/sdk/errors.js +1 -1
  49. package/dist/sdk/index.js +1 -1
  50. package/dist/sdk/job.js +1 -1
  51. package/dist/sdk/llm.js +1 -1
  52. package/dist/sdk/query.js +1 -1
  53. package/dist/sdk/segment.js +1 -1
  54. package/dist/sdk/table.js +1 -1
  55. package/dist/sdk/workflow.js +1 -1
  56. package/dist/types/endpoints.js +1 -1
  57. package/dist/types/index.js +1 -1
  58. package/dist/utils/agent-ref-parser.js +1 -1
  59. package/dist/utils/chat-cache.js +1 -1
  60. package/dist/utils/colors.js +1 -1
  61. package/dist/utils/command-output.js +1 -1
  62. package/dist/utils/constants.js +1 -1
  63. package/dist/utils/file-permissions.js +1 -1
  64. package/dist/utils/format-detector.js +1 -1
  65. package/dist/utils/formatters.js +1 -1
  66. package/dist/utils/json-loader.js +1 -1
  67. package/dist/utils/model-aliases.js +1 -1
  68. package/dist/utils/option-validation.js +1 -1
  69. package/dist/utils/port.js +1 -1
  70. package/dist/utils/process.js +1 -1
  71. package/dist/utils/prompt.js +1 -1
  72. package/dist/utils/segment-path-parser.js +1 -1
  73. package/dist/utils/segment-ref-parser.js +1 -1
  74. package/dist/utils/spinner.js +1 -1
  75. package/dist/utils/sql-parser.js +1 -1
  76. package/dist/utils/sse-parser.js +1 -1
  77. package/dist/utils/string-utils.js +1 -1
  78. package/dist/utils/table-ref-parser.js +1 -1
  79. package/dist/utils/tdx-logger.js +1 -1
  80. package/dist/utils/tree-formatter.js +1 -1
  81. package/dist/utils/version-check.js +1 -1
  82. package/dist/utils/workflow-utils.js +1 -1
  83. package/package.json +1 -1
@@ -1 +1 @@
1
- const a26_0x414a0e=a26_0x3258;(function(_0x5d5eda,_0x5e08e6){const _0x56e98c=a26_0x3258,_0x51a8ff=_0x5d5eda();while(!![]){try{const _0x271310=-parseInt(_0x56e98c(0xa5))/0x1*(parseInt(_0x56e98c(0xa9))/0x2)+parseInt(_0x56e98c(0xb0))/0x3+parseInt(_0x56e98c(0xaf))/0x4*(parseInt(_0x56e98c(0x9a))/0x5)+-parseInt(_0x56e98c(0x9c))/0x6+-parseInt(_0x56e98c(0xa1))/0x7*(-parseInt(_0x56e98c(0xa3))/0x8)+-parseInt(_0x56e98c(0x9b))/0x9+-parseInt(_0x56e98c(0xa6))/0xa;if(_0x271310===_0x5e08e6)break;else _0x51a8ff['push'](_0x51a8ff['shift']());}catch(_0x3faf9e){_0x51a8ff['push'](_0x51a8ff['shift']());}}}(a26_0x428d,0xd0d25));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';function a26_0x3258(_0x4172c7,_0x218391){const _0x428dfc=a26_0x428d();return a26_0x3258=function(_0x3258f3,_0x592c0c){_0x3258f3=_0x3258f3-0x96;let _0x101251=_0x428dfc[_0x3258f3];return _0x101251;},a26_0x3258(_0x4172c7,_0x218391);}function a26_0x428d(){const _0x5a6dea=['Error:\x20Cannot\x20update\x20','folder','1463195wBQfuX','294615FBRPaR','2547756ifarUV','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Segment\x20ID:\x20','error','Examples:','727349KXkBuS','Resolving\x20path\x20\x27','56MwQtff','kind','1jHBueB','21464880eSenrm','resolvePathToResource','segmentId','656274lgKOmv','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','segment:update','verbose','✔\x20Updated\x20segment\x20\x27','type','20fDpLEU','4790325AWPikq','name','Parent\x20ID:\x20','parentId','Resolved\x20relative\x20path\x20to:\x20','segment','Resolved\x20folder\x20ID:\x20','length','ruleFile','resolveFolderId','Resolving\x20folder\x20\x27','Update\x20existing\x20child\x20segment','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segmentName','execute','INTERNAL','\x27...','rule','data','description','Resolved\x20type:\x20'];a26_0x428d=function(){return _0x5a6dea;};return a26_0x428d();}export class SegmentUpdateCommand extends BaseCommand{[a26_0x414a0e(0xb1)]=a26_0x414a0e(0xab);[a26_0x414a0e(0x96)]=a26_0x414a0e(0xbb);async[a26_0x414a0e(0xbe)](_0x26f6ca){const _0x2fa747=a26_0x414a0e,{options:_0x27a4d6,args:_0x42cd80,tdx:_0x24c228}=_0x26f6ca,_0x5f2119=_0x27a4d6;if(_0x42cd80[_0x2fa747(0xb7)]===0x0)return console[_0x2fa747(0x9f)](_0x2fa747(0xbc)),console['error'](_0x2fa747(0xaa)),console[_0x2fa747(0x9f)](_0x2fa747(0xa0)),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x2fa747(0x9f)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x117e6c=_0x42cd80[0x0],_0xcf1f5=_0x27a4d6['segmentPath'];let _0x5f11e7=_0x117e6c;_0xcf1f5&&!_0x117e6c['includes']('/')&&(_0x5f11e7=_0xcf1f5+'/'+_0x117e6c,_0x5f2119[_0x2fa747(0xac)]&&console[_0x2fa747(0x9f)](_0x2fa747(0xb4)+_0x5f11e7));const _0x468f3d=await withSpinner(_0x2fa747(0xa2)+_0x5f11e7+_0x2fa747(0xc0),()=>_0x24c228['segment'][_0x2fa747(0xa7)](_0x5f11e7),{'verbose':_0x5f2119['verbose']}),_0x4ec5e5=_0x468f3d['data'];_0x5f2119[_0x2fa747(0xac)]&&console[_0x2fa747(0x9f)](_0x2fa747(0x97)+_0x4ec5e5[_0x2fa747(0xae)]);if(_0x4ec5e5[_0x2fa747(0xae)]!=='segment')return console[_0x2fa747(0x9f)](_0x2fa747(0x98)+_0x4ec5e5[_0x2fa747(0xae)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x2fa747(0x9f)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x4ec5e5[_0x2fa747(0xa8)])throw new SDKError(ErrorCode[_0x2fa747(0xbf)],_0x2fa747(0x9d));const _0x3c01ba=_0x4ec5e5[_0x2fa747(0xb3)],_0x522a56=_0x4ec5e5[_0x2fa747(0xa8)];_0x5f2119['verbose']&&(console[_0x2fa747(0x9f)](_0x2fa747(0xb2)+_0x3c01ba),console[_0x2fa747(0x9f)](_0x2fa747(0x9e)+_0x522a56));let _0x3d2c3e;if(_0x5f2119[_0x2fa747(0x99)]){const _0x435a76=_0x5f2119[_0x2fa747(0x99)],_0x22e761=await withSpinner(_0x2fa747(0xba)+_0x435a76+_0x2fa747(0xc0),()=>_0x24c228[_0x2fa747(0xb5)][_0x2fa747(0xb9)](_0x3c01ba,_0x435a76),{'verbose':_0x5f2119['verbose']});_0x3d2c3e=parseInt(_0x22e761[_0x2fa747(0xc2)],0xa),_0x5f2119['verbose']&&console[_0x2fa747(0x9f)](_0x2fa747(0xb6)+_0x3d2c3e);}const _0x3ef8e4=await loadJSONFromOptions(_0x5f2119[_0x2fa747(0xc1)],_0x5f2119[_0x2fa747(0xb8)]),_0x17b1a2={'name':_0x5f2119[_0x2fa747(0xb1)],'description':_0x5f2119[_0x2fa747(0x96)],'rule':_0x3ef8e4,'kind':_0x5f2119[_0x2fa747(0xa4)]!==undefined?parseInt(_0x5f2119[_0x2fa747(0xa4)],0xa):undefined,'segmentFolderId':_0x3d2c3e},_0x1eca52=await withSpinner('Updating\x20segment\x20\x27'+_0x4ec5e5[_0x2fa747(0xbd)]+_0x2fa747(0xc0),()=>_0x24c228[_0x2fa747(0xb5)]['updateSegmentById'](_0x3c01ba,_0x522a56,_0x17b1a2),{'verbose':_0x5f2119[_0x2fa747(0xac)]}),_0x1fa295=_0x1eca52[_0x2fa747(0xc2)];return console['error'](_0x2fa747(0xad)+_0x1fa295[_0x2fa747(0xb1)]+'\x27'),_0x5f11e7!==_0x117e6c&&console['error']('\x20\x20\x20Path:\x20'+_0x5f11e7),await handleSDKOutput([_0x1fa295],_0x5f2119),0x0;}}
1
+ const a26_0xfe8283=a26_0x569d;(function(_0x3bb0af,_0x32c251){const _0xf79bc1=a26_0x569d,_0x563268=_0x3bb0af();while(!![]){try{const _0x3365af=-parseInt(_0xf79bc1(0xb3))/0x1+parseInt(_0xf79bc1(0x97))/0x2+-parseInt(_0xf79bc1(0x8f))/0x3*(parseInt(_0xf79bc1(0x8c))/0x4)+-parseInt(_0xf79bc1(0xac))/0x5*(parseInt(_0xf79bc1(0x99))/0x6)+-parseInt(_0xf79bc1(0xb1))/0x7*(parseInt(_0xf79bc1(0xa8))/0x8)+-parseInt(_0xf79bc1(0xae))/0x9*(-parseInt(_0xf79bc1(0x9f))/0xa)+parseInt(_0xf79bc1(0x9e))/0xb;if(_0x3365af===_0x32c251)break;else _0x563268['push'](_0x563268['shift']());}catch(_0x104584){_0x563268['push'](_0x563268['shift']());}}}(a26_0x6899,0xecfb7));function a26_0x6899(){const _0x3ab0d9=['Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','rule','error','segment','41536275QssUby','10CKHucp','Segment\x20ID:\x20','segmentName','Resolved\x20folder\x20ID:\x20','execute','Error:\x20Cannot\x20update\x20','verbose','updateSegmentById','\x27...','8zVzWAL','\x20\x20\x20Path:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Update\x20existing\x20child\x20segment','3144755vDmJxC','segmentPath','8997489XPkHuM','type','name','13188875JhajFv','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','571549DuHBgS','description','Updating\x20segment\x20\x27','ruleFile','✔\x20Updated\x20segment\x20\x27','1603116HqkfbH','data','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','6ixalXY','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','parentId','resolveFolderId','folder','includes','INTERNAL','segmentId','162232TAocoO','Resolved\x20type:\x20','6nSJaHZ'];a26_0x6899=function(){return _0x3ab0d9;};return a26_0x6899();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a26_0x569d(_0x1687f6,_0x55fb42){const _0x68990b=a26_0x6899();return a26_0x569d=function(_0x569d7c,_0x4f3be4){_0x569d7c=_0x569d7c-0x89;let _0x27d898=_0x68990b[_0x569d7c];return _0x27d898;},a26_0x569d(_0x1687f6,_0x55fb42);}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_0xfe8283(0xb0)]='segment:update';[a26_0xfe8283(0xb4)]=a26_0xfe8283(0xab);async[a26_0xfe8283(0xa3)](_0x203f85){const _0x5e5b92=a26_0xfe8283,{options:_0x52ff98,args:_0x51ed74,tdx:_0x30a5ba}=_0x203f85,_0xf4d2b2=_0x52ff98;if(_0x51ed74['length']===0x0)return console[_0x5e5b92(0x9c)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x5e5b92(0x9c)](_0x5e5b92(0x9a)),console['error']('Examples:'),console['error'](_0x5e5b92(0x8e)),console['error'](_0x5e5b92(0xb2)),0x1;const _0x14a860=_0x51ed74[0x0],_0x3e693c=_0x52ff98[_0x5e5b92(0xad)];let _0x48eed5=_0x14a860;_0x3e693c&&!_0x14a860[_0x5e5b92(0x94)]('/')&&(_0x48eed5=_0x3e693c+'/'+_0x14a860,_0xf4d2b2[_0x5e5b92(0xa5)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x48eed5));const _0x244c08=await withSpinner('Resolving\x20path\x20\x27'+_0x48eed5+'\x27...',()=>_0x30a5ba[_0x5e5b92(0x9d)]['resolvePathToResource'](_0x48eed5),{'verbose':_0xf4d2b2[_0x5e5b92(0xa5)]}),_0x25b09c=_0x244c08[_0x5e5b92(0x8d)];_0xf4d2b2[_0x5e5b92(0xa5)]&&console[_0x5e5b92(0x9c)](_0x5e5b92(0x98)+_0x25b09c[_0x5e5b92(0xaf)]);if(_0x25b09c[_0x5e5b92(0xaf)]!==_0x5e5b92(0x9d))return console[_0x5e5b92(0x9c)](_0x5e5b92(0xa4)+_0x25b09c[_0x5e5b92(0xaf)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x5e5b92(0x9c)](_0x5e5b92(0x90)),0x1;if(!_0x25b09c['segmentId'])throw new SDKError(ErrorCode[_0x5e5b92(0x95)],_0x5e5b92(0xaa));const _0x1cd958=_0x25b09c[_0x5e5b92(0x91)],_0x4a454f=_0x25b09c[_0x5e5b92(0x96)];_0xf4d2b2[_0x5e5b92(0xa5)]&&(console['error']('Parent\x20ID:\x20'+_0x1cd958),console[_0x5e5b92(0x9c)](_0x5e5b92(0xa0)+_0x4a454f));let _0x2b44d1;if(_0xf4d2b2[_0x5e5b92(0x93)]){const _0x5a3bbb=_0xf4d2b2[_0x5e5b92(0x93)],_0x4f163b=await withSpinner('Resolving\x20folder\x20\x27'+_0x5a3bbb+_0x5e5b92(0xa7),()=>_0x30a5ba[_0x5e5b92(0x9d)][_0x5e5b92(0x92)](_0x1cd958,_0x5a3bbb),{'verbose':_0xf4d2b2[_0x5e5b92(0xa5)]});_0x2b44d1=parseInt(_0x4f163b['data'],0xa),_0xf4d2b2[_0x5e5b92(0xa5)]&&console[_0x5e5b92(0x9c)](_0x5e5b92(0xa2)+_0x2b44d1);}const _0x3369ed=await loadJSONFromOptions(_0xf4d2b2[_0x5e5b92(0x9b)],_0xf4d2b2[_0x5e5b92(0x8a)]),_0x12c008={'name':_0xf4d2b2[_0x5e5b92(0xb0)],'description':_0xf4d2b2['description'],'rule':_0x3369ed,'kind':_0xf4d2b2['kind']!==undefined?parseInt(_0xf4d2b2['kind'],0xa):undefined,'segmentFolderId':_0x2b44d1},_0x20b4b6=await withSpinner(_0x5e5b92(0x89)+_0x25b09c[_0x5e5b92(0xa1)]+_0x5e5b92(0xa7),()=>_0x30a5ba['segment'][_0x5e5b92(0xa6)](_0x1cd958,_0x4a454f,_0x12c008),{'verbose':_0xf4d2b2[_0x5e5b92(0xa5)]}),_0x4dfc88=_0x20b4b6[_0x5e5b92(0x8d)];return console['error'](_0x5e5b92(0x8b)+_0x4dfc88['name']+'\x27'),_0x48eed5!==_0x14a860&&console[_0x5e5b92(0x9c)](_0x5e5b92(0xa9)+_0x48eed5),await handleSDKOutput([_0x4dfc88],_0xf4d2b2),0x0;}}
@@ -1 +1 @@
1
- const a27_0xdf795a=a27_0x5f1e;(function(_0x447e48,_0x25b272){const _0x4e2f19=a27_0x5f1e,_0x2e42d5=_0x447e48();while(!![]){try{const _0x27febf=-parseInt(_0x4e2f19(0xf6))/0x1*(parseInt(_0x4e2f19(0xd5))/0x2)+-parseInt(_0x4e2f19(0xdf))/0x3*(-parseInt(_0x4e2f19(0xe7))/0x4)+parseInt(_0x4e2f19(0xdd))/0x5*(parseInt(_0x4e2f19(0x106))/0x6)+parseInt(_0x4e2f19(0x104))/0x7*(parseInt(_0x4e2f19(0xdc))/0x8)+-parseInt(_0x4e2f19(0xfc))/0x9+parseInt(_0x4e2f19(0x102))/0xa*(-parseInt(_0x4e2f19(0xf2))/0xb)+parseInt(_0x4e2f19(0xe0))/0xc*(parseInt(_0x4e2f19(0xf5))/0xd);if(_0x27febf===_0x25b272)break;else _0x2e42d5['push'](_0x2e42d5['shift']());}catch(_0x20fc95){_0x2e42d5['push'](_0x2e42d5['shift']());}}}(a27_0x1e78,0x48606));import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';function a27_0x1e78(){const _0x4f563c=['\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','264EUQaGC','Resolved\x20relative\x20path\x20to:\x20','Resolved\x20path\x20type:\x20','log','verbose','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','764bzyCEx','folderPath','Usage:\x20tdx\x20segment\x20use\x20<path>','session','site','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','join','3432JogBZT','23930FhNUkK','Site:\x20','3COlKOX','1056mIVkcP','fullPath','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','parentName','segment:use','isAbsolute','folderId','361388RbEaSu','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Target\x20path:\x20','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','segmentPath','error','data','resolvePathToResource','name','description','22KUvFno','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Context\x20set\x20to:\x20','22841UZLZOK','1157DSiNMH','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Context\x20cleared.\x20Back\x20to\x20root.','Use:\x20tdx\x20segment\x20use\x20','parentId','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','863406ReslCF','execute','slice','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','\x27...','261650rWJuRl','Resolving\x20path\x20\x27','7035EFBUYc'];a27_0x1e78=function(){return _0x4f563c;};return a27_0x1e78();}function a27_0x5f1e(_0x5e6148,_0x1c1db3){const _0x1e78ed=a27_0x1e78();return a27_0x5f1e=function(_0x5f1e0a,_0x58002d){_0x5f1e0a=_0x5f1e0a-0xd2;let _0x26d1d7=_0x1e78ed[_0x5f1e0a];return _0x26d1d7;},a27_0x5f1e(_0x5e6148,_0x1c1db3);}import{parsePath,normalizePath}from'../utils/segment-path-parser.js';export class SegmentUseCommand extends BaseCommand{[a27_0xdf795a(0xf0)]=a27_0xdf795a(0xe4);[a27_0xdf795a(0xf1)]=a27_0xdf795a(0xe8);async[a27_0xdf795a(0xfd)](_0x18bb7d){const _0x1eecc1=a27_0xdf795a,{options:_0x2a08d6,args:_0x5ceb14,tdx:_0x1c7d80}=_0x18bb7d;if(_0x5ceb14['length']===0x0)return console[_0x1eecc1(0xed)]('Error:\x20Path\x20is\x20required'),console[_0x1eecc1(0xed)](_0x1eecc1(0xd7)),console[_0x1eecc1(0xed)]('Examples:'),console[_0x1eecc1(0xed)](_0x1eecc1(0xf7)),console['error'](_0x1eecc1(0xe2)),console[_0x1eecc1(0xed)](_0x1eecc1(0x105)),console['error'](_0x1eecc1(0xf3)),0x1;const _0x54a300=_0x5ceb14[0x0],_0x2d2965=_0x2a08d6[_0x1eecc1(0xd8)];try{if(_0x54a300==='/')return saveSessionContext({'segment_path':undefined},_0x2d2965),console['log'](_0x1eecc1(0xf8)),0x0;const _0x32a6f1=_0x2a08d6[_0x1eecc1(0xec)];let _0x280c30=_0x54a300;const _0x1db9d2=parsePath(_0x54a300);if(!_0x1db9d2[_0x1eecc1(0xe5)]){if(!_0x32a6f1)return console[_0x1eecc1(0xed)](_0x1eecc1(0x100)),console[_0x1eecc1(0xed)](_0x1eecc1(0xff)),0x1;if(_0x54a300==='..'){const _0xffad41=_0x32a6f1['split']('/')[_0x1eecc1(0xfe)](0x0,-0x1)['join']('/');_0x280c30=_0xffad41||'/';}else _0x54a300==='.'?_0x280c30=_0x32a6f1:_0x280c30=_0x32a6f1+'/'+_0x54a300;_0x2a08d6[_0x1eecc1(0xd3)]&&console[_0x1eecc1(0xed)](_0x1eecc1(0x107)+_0x280c30);}if(_0x280c30==='/'||_0x280c30==='')return saveSessionContext({'segment_path':undefined},_0x2d2965),console[_0x1eecc1(0xd2)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;_0x280c30=normalizePath(_0x280c30);const _0x4890cb=parsePath(_0x280c30)['segments'];if(_0x4890cb['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x2d2965),console[_0x1eecc1(0xd2)](_0x1eecc1(0xf8)),0x0;_0x2a08d6['verbose']&&(console[_0x1eecc1(0xed)](_0x1eecc1(0xde)+_0x2a08d6[_0x1eecc1(0xd9)]),console[_0x1eecc1(0xed)](_0x1eecc1(0xe9)+_0x280c30));const _0xe55b5b=await withSpinner(_0x1eecc1(0x103)+_0x280c30+_0x1eecc1(0x101),()=>_0x1c7d80['segment'][_0x1eecc1(0xef)](_0x280c30),{'verbose':_0x2a08d6['verbose']}),_0x1a177a=_0xe55b5b[_0x1eecc1(0xee)];_0x2a08d6['verbose']&&(console[_0x1eecc1(0xed)](_0x1eecc1(0x108)+_0x1a177a['type']),console['error']('Parent\x20ID:\x20'+_0x1a177a[_0x1eecc1(0xfa)]),_0x1a177a[_0x1eecc1(0xe6)]&&console[_0x1eecc1(0xed)]('Folder\x20ID:\x20'+_0x1a177a[_0x1eecc1(0xe6)]));if(_0x1a177a['type']==='segment')return console[_0x1eecc1(0xed)](_0x1eecc1(0xd4)),console[_0x1eecc1(0xed)](_0x1eecc1(0xfb)),console['error'](_0x1eecc1(0xf9)+_0x1a177a[_0x1eecc1(0xe3)]+(_0x1a177a[_0x1eecc1(0xd6)]?'/'+_0x1a177a['folderPath'][_0x1eecc1(0xdb)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x1a177a['fullPath'],'parent_segment':_0x1a177a[_0x1eecc1(0xe3)]},_0x2d2965),console[_0x1eecc1(0xd2)](_0x1eecc1(0xf4)+_0x1a177a[_0x1eecc1(0xe1)]),_0x2a08d6[_0x1eecc1(0xd3)]&&(console[_0x1eecc1(0xed)](_0x1eecc1(0xeb)),console[_0x1eecc1(0xed)](_0x1eecc1(0xea)),console['error'](_0x1eecc1(0xda))),0x0;}catch(_0xff220e){throw _0xff220e;}}}
1
+ const a27_0x1fc2cb=a27_0x91e7;(function(_0x56b17e,_0x90cd1f){const _0x2a1635=a27_0x91e7,_0xa908ec=_0x56b17e();while(!![]){try{const _0x4793cf=parseInt(_0x2a1635(0x1a6))/0x1*(parseInt(_0x2a1635(0x1c4))/0x2)+-parseInt(_0x2a1635(0x1c2))/0x3*(parseInt(_0x2a1635(0x1bc))/0x4)+parseInt(_0x2a1635(0x1b0))/0x5+parseInt(_0x2a1635(0x1bb))/0x6+parseInt(_0x2a1635(0x1ca))/0x7+-parseInt(_0x2a1635(0x1b4))/0x8+-parseInt(_0x2a1635(0x1cc))/0x9;if(_0x4793cf===_0x90cd1f)break;else _0xa908ec['push'](_0xa908ec['shift']());}catch(_0x24f17d){_0xa908ec['push'](_0xa908ec['shift']());}}}(a27_0x44e6,0x86902));function a27_0x91e7(_0xfcdcae,_0x41683c){const _0x44e6fd=a27_0x44e6();return a27_0x91e7=function(_0x91e75e,_0x37c8be){_0x91e75e=_0x91e75e-0x1a3;let _0x4c76be=_0x44e6fd[_0x91e75e];return _0x4c76be;},a27_0x91e7(_0xfcdcae,_0x41683c);}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a27_0x44e6(){const _0x85335a=['Error:\x20Path\x20is\x20required','description','7217441FsljYl','Resolved\x20path\x20type:\x20','1397061ewvvbf','verbose','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','slice','session','Context\x20set\x20to:\x20','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','fullPath','Parent\x20ID:\x20','site','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','segment:use','23587TQmcHC','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','Resolving\x20path\x20\x27','\x27...','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','Usage:\x20tdx\x20segment\x20use\x20<path>','name','Context\x20cleared.\x20Back\x20to\x20root.','folderId','552430nXAfmG','segment','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Examples:','6747832wCpsxU','Target\x20path:\x20','Folder\x20ID:\x20','split','segmentPath','error','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','643020uNvBin','348rtTMeu','execute','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','join','log','type','22149uOaLTr','Resolved\x20relative\x20path\x20to:\x20','80sMhEDw','resolvePathToResource','segments','parentId'];a27_0x44e6=function(){return _0x85335a;};return a27_0x44e6();}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';export class SegmentUseCommand extends BaseCommand{[a27_0x1fc2cb(0x1ad)]=a27_0x1fc2cb(0x1a5);[a27_0x1fc2cb(0x1c9)]=a27_0x1fc2cb(0x1ba);async[a27_0x1fc2cb(0x1bd)](_0x6be72){const _0x185b95=a27_0x1fc2cb,{options:_0x1c3586,args:_0x2df347,tdx:_0x4a746e}=_0x6be72;if(_0x2df347['length']===0x0)return console[_0x185b95(0x1b9)](_0x185b95(0x1c8)),console[_0x185b95(0x1b9)](_0x185b95(0x1ac)),console[_0x185b95(0x1b9)](_0x185b95(0x1b3)),console['error'](_0x185b95(0x1ce)),console[_0x185b95(0x1b9)](_0x185b95(0x1b2)),console[_0x185b95(0x1b9)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console['error'](_0x185b95(0x1aa)),0x1;const _0x21aec3=_0x2df347[0x0],_0xa393b2=_0x1c3586[_0x185b95(0x1d0)];try{if(_0x21aec3==='/')return saveSessionContext({'segment_path':undefined},_0xa393b2),console['log'](_0x185b95(0x1ae)),0x0;const _0x1f8b1b=_0x1c3586[_0x185b95(0x1b8)];let _0x39ac2a=_0x21aec3;const _0x54515b=parsePath(_0x21aec3);if(!_0x54515b['isAbsolute']){if(!_0x1f8b1b)return console[_0x185b95(0x1b9)](_0x185b95(0x1be)),console[_0x185b95(0x1b9)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>'),0x1;if(_0x21aec3==='..'){const _0x3a4fc2=_0x1f8b1b[_0x185b95(0x1b7)]('/')[_0x185b95(0x1cf)](0x0,-0x1)['join']('/');_0x39ac2a=_0x3a4fc2||'/';}else _0x21aec3==='.'?_0x39ac2a=_0x1f8b1b:_0x39ac2a=_0x1f8b1b+'/'+_0x21aec3;_0x1c3586['verbose']&&console[_0x185b95(0x1b9)](_0x185b95(0x1c3)+_0x39ac2a);}if(_0x39ac2a==='/'||_0x39ac2a==='')return saveSessionContext({'segment_path':undefined},_0xa393b2),console[_0x185b95(0x1c0)](_0x185b95(0x1ae)),0x0;_0x39ac2a=normalizePath(_0x39ac2a);const _0x426b4f=parsePath(_0x39ac2a)[_0x185b95(0x1c6)];if(_0x426b4f['length']===0x0)return saveSessionContext({'segment_path':undefined},_0xa393b2),console[_0x185b95(0x1c0)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;_0x1c3586[_0x185b95(0x1cd)]&&(console['error']('Site:\x20'+_0x1c3586[_0x185b95(0x1a3)]),console[_0x185b95(0x1b9)](_0x185b95(0x1b5)+_0x39ac2a));const _0x212ff4=await withSpinner(_0x185b95(0x1a8)+_0x39ac2a+_0x185b95(0x1a9),()=>_0x4a746e[_0x185b95(0x1b1)][_0x185b95(0x1c5)](_0x39ac2a),{'verbose':_0x1c3586['verbose']}),_0xcb10ba=_0x212ff4['data'];_0x1c3586[_0x185b95(0x1cd)]&&(console[_0x185b95(0x1b9)](_0x185b95(0x1cb)+_0xcb10ba[_0x185b95(0x1c1)]),console['error'](_0x185b95(0x1d4)+_0xcb10ba[_0x185b95(0x1c7)]),_0xcb10ba[_0x185b95(0x1af)]&&console[_0x185b95(0x1b9)](_0x185b95(0x1b6)+_0xcb10ba[_0x185b95(0x1af)]));if(_0xcb10ba[_0x185b95(0x1c1)]===_0x185b95(0x1b1))return console[_0x185b95(0x1b9)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.'),console[_0x185b95(0x1b9)](_0x185b95(0x1a4)),console[_0x185b95(0x1b9)]('Use:\x20tdx\x20segment\x20use\x20'+_0xcb10ba['parentName']+(_0xcb10ba['folderPath']?'/'+_0xcb10ba['folderPath'][_0x185b95(0x1bf)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0xcb10ba[_0x185b95(0x1d3)],'parent_segment':_0xcb10ba['parentName']},_0xa393b2),console[_0x185b95(0x1c0)](_0x185b95(0x1d1)+_0xcb10ba[_0x185b95(0x1d3)]),_0x1c3586[_0x185b95(0x1cd)]&&(console[_0x185b95(0x1b9)](_0x185b95(0x1d2)),console[_0x185b95(0x1b9)](_0x185b95(0x1a7)),console['error'](_0x185b95(0x1ab))),0x0;}catch(_0x5b9381){throw _0x5b9381;}}}
@@ -1 +1 @@
1
- const a28_0x3746d1=a28_0x3952;function a28_0x3952(_0x22184a,_0x467b29){const _0x49b64e=a28_0x49b6();return a28_0x3952=function(_0x395273,_0x481d38){_0x395273=_0x395273-0xf4;let _0x5567eb=_0x49b64e[_0x395273];return _0x5567eb;},a28_0x3952(_0x22184a,_0x467b29);}(function(_0x4743d2,_0xfd8ede){const _0x5d35a8=a28_0x3952,_0x2bb0ed=_0x4743d2();while(!![]){try{const _0x189c03=-parseInt(_0x5d35a8(0x130))/0x1*(parseInt(_0x5d35a8(0x137))/0x2)+-parseInt(_0x5d35a8(0x117))/0x3+-parseInt(_0x5d35a8(0x12c))/0x4*(-parseInt(_0x5d35a8(0x122))/0x5)+-parseInt(_0x5d35a8(0xfe))/0x6*(parseInt(_0x5d35a8(0x12a))/0x7)+parseInt(_0x5d35a8(0x12e))/0x8*(parseInt(_0x5d35a8(0x131))/0x9)+parseInt(_0x5d35a8(0x10f))/0xa*(parseInt(_0x5d35a8(0x102))/0xb)+parseInt(_0x5d35a8(0x11e))/0xc;if(_0x189c03===_0xfd8ede)break;else _0x2bb0ed['push'](_0x2bb0ed['shift']());}catch(_0x682cb9){_0x2bb0ed['push'](_0x2bb0ed['shift']());}}}(a28_0x49b6,0xc46d5));import{BaseCommand}from'./command.js';function a28_0x49b6(){const _0x4e14a5=['error','\x20top-level\x20items','name','7vdmvAR','format','24gJlPUN','map','744824WlsoMo','segment','1566479QYlbQw','18YymzaV','Folder\x20ID:\x20','Current\x20context:\x20','verbose','resolvePathToResource','json','2lxmrBJ','parentId','listUnified','segments','filter','\x20and\x20','Recursive\x20mode:\x20enabled','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','population','maxDepth','folderId','listParentsWithPattern','folder','includes','log','test','2810256pSsLde','replace','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','👥\x20','47179CpGFES','Listing\x20parent\x20segments...','\x5c$&','segmentPath','localeCompare','dim','site','listParents','[parent\x20segments]','Listing\x20folders\x20and\x20segments...','\x20folder','data','message','2610oyPWkE','execute','length','jsonl','No\x20parent\x20segments\x20match\x20pattern:\x20','✔\x20Built\x20tree\x20with\x20','Site:\x20','Resolving\x20context\x20path\x20\x27','727140XlRuRT','cause','\x20parent\x20segment','Listing\x20parent\x20segments\x20matching\x20\x27','\x27...','listRecursive','recursive','10876500lowHmg','\x20segment','✔\x20Found\x20','description','724825FmYDki','sort','Parent\x20ID:\x20','Building\x20hierarchy\x20tree...','attributes'];a28_0x49b6=function(){return _0x4e14a5;};return a28_0x49b6();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{formatRows}from'../utils/formatters.js';import a28_0x1b3948 from'chalk';export class SegmentsCommand extends BaseCommand{[a28_0x3746d1(0x129)]=a28_0x3746d1(0x13a);[a28_0x3746d1(0x121)]=a28_0x3746d1(0x100);async[a28_0x3746d1(0x110)](_0x12cf55){const _0x1bef50=a28_0x3746d1,{options:_0x1a1437,args:_0x2ed9da}=_0x12cf55,_0x269a6d=_0x1a1437[_0x1bef50(0x11d)],_0x3c3cbc=_0x2ed9da[0x0];try{const _0xd0eedd=_0x1a1437[_0x1bef50(0x105)];_0x1a1437[_0x1bef50(0x134)]&&(console[_0x1bef50(0x127)](_0x1bef50(0x115)+_0x1a1437[_0x1bef50(0x108)]),console[_0x1bef50(0x127)](_0x1bef50(0x133)+(_0xd0eedd||'/')),_0x3c3cbc&&console[_0x1bef50(0x127)]('Path/pattern\x20arg:\x20'+_0x3c3cbc),_0x269a6d&&console[_0x1bef50(0x127)](_0x1bef50(0xf4)));if(_0x3c3cbc){const _0xf1d2e2=_0x3c3cbc[_0x1bef50(0xfb)]('*')||_0x3c3cbc['includes']('?');if(_0xf1d2e2&&!_0xd0eedd)return await this[_0x1bef50(0xf9)](_0x12cf55,_0x3c3cbc);else return _0xf1d2e2?(console[_0x1bef50(0x127)]('Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).'),console['error'](_0x1bef50(0xf5)),0x1):_0x269a6d?await this[_0x1bef50(0x11c)](_0x12cf55,_0x3c3cbc):await this['listUnified'](_0x12cf55,_0x3c3cbc);}if(!_0xd0eedd)return await this[_0x1bef50(0x109)](_0x12cf55);return _0x269a6d?await this[_0x1bef50(0x11c)](_0x12cf55,_0xd0eedd):await this[_0x1bef50(0x139)](_0x12cf55,_0xd0eedd);}catch(_0x4c8c42){if(_0x4c8c42 instanceof SDKError)return console[_0x1bef50(0x127)]('Error:\x20'+_0x4c8c42[_0x1bef50(0x10e)]),_0x4c8c42[_0x1bef50(0x118)]&&console[_0x1bef50(0x127)]('\x20\x20Cause:\x20'+_0x4c8c42['cause']),0x1;throw _0x4c8c42;}}async[a28_0x3746d1(0xf9)](_0x588081,_0x41abc4){const _0x532e5d=a28_0x3746d1,{options:_0x3cad13,tdx:_0xb0ab84}=_0x588081,_0x416b2e=await withSpinner(_0x532e5d(0x11a)+_0x41abc4+_0x532e5d(0x11b),()=>_0xb0ab84[_0x532e5d(0x12f)]['listParents'](),{'verbose':_0x3cad13[_0x532e5d(0x134)]}),_0x12b854=_0x416b2e['data'],_0x293955=_0x41abc4[_0x532e5d(0xff)](/[.+^${}()|[\]\\]/g,_0x532e5d(0x104))[_0x532e5d(0xff)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x34ec72=new RegExp('^'+_0x293955+'$','i'),_0x1c0219=_0x12b854[_0x532e5d(0x13b)](_0x4102b5=>_0x34ec72[_0x532e5d(0xfd)](_0x4102b5[_0x532e5d(0x126)][_0x532e5d(0x129)]));console[_0x532e5d(0x127)](_0x532e5d(0x120)+_0x1c0219['length']+_0x532e5d(0x119)+(_0x1c0219['length']!==0x1?'s':'')+'\x20matching\x20\x27'+_0x41abc4+'\x27');if(_0x3cad13[_0x532e5d(0x12b)]==='json'||_0x3cad13[_0x532e5d(0x12b)]==='jsonl')await handleSDKOutput(_0x1c0219,_0x3cad13);else{if(_0x1c0219['length']===0x0)console[_0x532e5d(0xfc)](_0x532e5d(0x113)+_0x41abc4);else{console['log'](_0x532e5d(0x10a));for(const _0x538fb1 of _0x1c0219){const _0x3c8718=_0x538fb1[_0x532e5d(0x126)][_0x532e5d(0xf6)]?a28_0x1b3948[_0x532e5d(0x107)]('\x20('+formatRows(_0x538fb1['attributes'][_0x532e5d(0xf6)])+')'):'';console['log']('👥\x20'+_0x538fb1['attributes'][_0x532e5d(0x129)]+_0x3c8718);}}}return 0x0;}async[a28_0x3746d1(0x109)](_0x3c8039){const _0x3846ac=a28_0x3746d1,{options:_0x5e3e58,tdx:_0x2f760a}=_0x3c8039,_0x5e906e=await withSpinner(_0x3846ac(0x103),()=>_0x2f760a[_0x3846ac(0x12f)]['listParents'](),{'verbose':_0x5e3e58[_0x3846ac(0x134)]}),_0x271079=_0x5e906e[_0x3846ac(0x10d)];console['error'](_0x3846ac(0x120)+_0x271079[_0x3846ac(0x111)]+_0x3846ac(0x119)+(_0x271079[_0x3846ac(0x111)]!==0x1?'s':''));if(_0x5e3e58[_0x3846ac(0x12b)]===_0x3846ac(0x136)||_0x5e3e58[_0x3846ac(0x12b)]==='jsonl')await handleSDKOutput(_0x271079,_0x5e3e58);else{console[_0x3846ac(0xfc)](_0x3846ac(0x10a));for(const _0x11627c of _0x271079){const _0x32eb71=_0x11627c[_0x3846ac(0x126)][_0x3846ac(0xf6)]?a28_0x1b3948[_0x3846ac(0x107)]('\x20('+formatRows(_0x11627c[_0x3846ac(0x126)]['population'])+')'):'';console['log'](_0x3846ac(0x101)+_0x11627c[_0x3846ac(0x126)]['name']+_0x32eb71);}}return 0x0;}async[a28_0x3746d1(0x139)](_0x7d1723,_0x535367){const _0x27daed=a28_0x3746d1,{options:_0x4a397c,tdx:_0x2f66f3}=_0x7d1723,_0x583350=await withSpinner(_0x27daed(0x116)+_0x535367+'\x27...',()=>_0x2f66f3[_0x27daed(0x12f)][_0x27daed(0x135)](_0x535367),{'verbose':_0x4a397c[_0x27daed(0x134)]}),_0x81a97b=_0x583350[_0x27daed(0x10d)];_0x4a397c[_0x27daed(0x134)]&&(console[_0x27daed(0x127)](_0x27daed(0x124)+_0x81a97b[_0x27daed(0x138)]),_0x81a97b['folderId']&&console[_0x27daed(0x127)](_0x27daed(0x132)+_0x81a97b[_0x27daed(0xf8)]));const _0x2f2efa=await withSpinner(_0x27daed(0x10b),()=>_0x2f66f3[_0x27daed(0x12f)]['listUnified'](_0x81a97b[_0x27daed(0x138)],_0x81a97b[_0x27daed(0xf8)]),{'verbose':_0x4a397c[_0x27daed(0x134)]}),{folders:_0x596cc3,segments:_0x45a825}=_0x2f2efa[_0x27daed(0x10d)],_0x42f408=_0x596cc3[_0x27daed(0x111)]+_0x45a825[_0x27daed(0x111)];console[_0x27daed(0x127)](_0x27daed(0x120)+_0x596cc3[_0x27daed(0x111)]+_0x27daed(0x10c)+(_0x596cc3[_0x27daed(0x111)]!==0x1?'s':'')+_0x27daed(0x13c)+_0x45a825[_0x27daed(0x111)]+_0x27daed(0x11f)+(_0x45a825['length']!==0x1?'s':''));if(_0x4a397c['format']==='json'||_0x4a397c[_0x27daed(0x12b)]===_0x27daed(0x112)){const _0x52cbec=[..._0x596cc3[_0x27daed(0x12d)](_0x9ca0a8=>({..._0x9ca0a8,'type':_0x27daed(0xfa)})),..._0x45a825[_0x27daed(0x12d)](_0x3fa19a=>({..._0x3fa19a,'type':_0x27daed(0x12f)}))][_0x27daed(0x123)]((_0x6ddf1a,_0x25a48a)=>_0x6ddf1a[_0x27daed(0x129)][_0x27daed(0x106)](_0x25a48a['name']));await handleSDKOutput(_0x52cbec,_0x4a397c);}else{if(_0x42f408===0x0)console[_0x27daed(0xfc)](a28_0x1b3948[_0x27daed(0x107)]('[/'+_0x535367+']')),console[_0x27daed(0xfc)]('(empty)');else{console[_0x27daed(0xfc)](a28_0x1b3948[_0x27daed(0x107)]('[/'+_0x535367+']'));const _0x4740a8=formatFlatList(_0x596cc3,_0x45a825,{'showMetadata':!![]});console['log'](_0x4740a8);}}return 0x0;}async[a28_0x3746d1(0x11c)](_0xe6699a,_0x53794f){const _0x51cfdf=a28_0x3746d1,{options:_0xcb14e4,tdx:_0x300780}=_0xe6699a,_0x38e5ab=await withSpinner(_0x51cfdf(0x116)+_0x53794f+_0x51cfdf(0x11b),()=>_0x300780[_0x51cfdf(0x12f)][_0x51cfdf(0x135)](_0x53794f),{'verbose':_0xcb14e4[_0x51cfdf(0x134)]}),_0x519400=_0x38e5ab[_0x51cfdf(0x10d)];_0xcb14e4[_0x51cfdf(0x134)]&&(console[_0x51cfdf(0x127)]('Parent\x20ID:\x20'+_0x519400[_0x51cfdf(0x138)]),_0x519400['folderId']&&console[_0x51cfdf(0x127)]('Folder\x20ID:\x20'+_0x519400[_0x51cfdf(0xf8)]));const _0xb2faaf=_0xcb14e4[_0x51cfdf(0xf7)]||0xa,_0x5e6e27=await withSpinner(_0x51cfdf(0x125),()=>_0x300780[_0x51cfdf(0x12f)][_0x51cfdf(0x11c)](_0x519400[_0x51cfdf(0x138)],_0x519400['folderId'],0x0,_0xb2faaf),{'verbose':_0xcb14e4[_0x51cfdf(0x134)]}),_0x4f126c=_0x5e6e27[_0x51cfdf(0x10d)];console[_0x51cfdf(0x127)](_0x51cfdf(0x114)+_0x4f126c[_0x51cfdf(0x111)]+_0x51cfdf(0x128));if(_0xcb14e4['format']===_0x51cfdf(0x136)||_0xcb14e4[_0x51cfdf(0x12b)]===_0x51cfdf(0x112))await handleSDKOutput(_0x4f126c,_0xcb14e4);else{console[_0x51cfdf(0xfc)](a28_0x1b3948['dim']('[/'+_0x53794f+']'));const _0x541e87=formatTree(_0x4f126c,{'showMetadata':!![]});console[_0x51cfdf(0xfc)](_0x541e87);}return 0x0;}}
1
+ const a28_0x163ce3=a28_0x39c9;(function(_0x1b73a2,_0x4a1023){const _0x3d9558=a28_0x39c9,_0x222009=_0x1b73a2();while(!![]){try{const _0x148b89=parseInt(_0x3d9558(0x8a))/0x1*(parseInt(_0x3d9558(0xa1))/0x2)+parseInt(_0x3d9558(0xb4))/0x3+parseInt(_0x3d9558(0x8b))/0x4+parseInt(_0x3d9558(0xaa))/0x5*(parseInt(_0x3d9558(0x81))/0x6)+-parseInt(_0x3d9558(0x86))/0x7*(parseInt(_0x3d9558(0xb2))/0x8)+-parseInt(_0x3d9558(0xac))/0x9+-parseInt(_0x3d9558(0x8f))/0xa;if(_0x148b89===_0x4a1023)break;else _0x222009['push'](_0x222009['shift']());}catch(_0x38bd0c){_0x222009['push'](_0x222009['shift']());}}}(a28_0xd4b6,0xbcbc6));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_0x39c9(_0xd7309,_0x261a70){const _0xd4b6b2=a28_0xd4b6();return a28_0x39c9=function(_0x39c941,_0x4a34ca){_0x39c941=_0x39c941-0x7a;let _0x4295d3=_0xd4b6b2[_0x39c941];return _0x4295d3;},a28_0x39c9(_0xd7309,_0x261a70);}import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{formatRows}from'../utils/formatters.js';import a28_0x5d7bae from'chalk';export class SegmentsCommand extends BaseCommand{['name']=a28_0x163ce3(0x98);['description']=a28_0x163ce3(0x84);async[a28_0x163ce3(0x9b)](_0x216681){const _0x472b05=a28_0x163ce3,{options:_0x33b123,args:_0x31276a}=_0x216681,_0x226d9f=_0x33b123[_0x472b05(0x97)],_0x5c6302=_0x31276a[0x0];try{const _0x2e8ec9=_0x33b123['segmentPath'];_0x33b123['verbose']&&(console[_0x472b05(0xae)]('Site:\x20'+_0x33b123[_0x472b05(0x82)]),console[_0x472b05(0xae)]('Current\x20context:\x20'+(_0x2e8ec9||'/')),_0x5c6302&&console[_0x472b05(0xae)](_0x472b05(0xb3)+_0x5c6302),_0x226d9f&&console[_0x472b05(0xae)](_0x472b05(0x89)));if(_0x5c6302){const _0xed1af9=_0x5c6302[_0x472b05(0xad)]('*')||_0x5c6302['includes']('?');if(_0xed1af9&&!_0x2e8ec9)return await this[_0x472b05(0xa0)](_0x216681,_0x5c6302);else return _0xed1af9?(console['error'](_0x472b05(0x88)),console[_0x472b05(0xae)](_0x472b05(0xa8)),0x1):_0x226d9f?await this['listRecursive'](_0x216681,_0x5c6302):await this[_0x472b05(0xa3)](_0x216681,_0x5c6302);}if(!_0x2e8ec9)return await this[_0x472b05(0xb9)](_0x216681);return _0x226d9f?await this[_0x472b05(0x8e)](_0x216681,_0x2e8ec9):await this['listUnified'](_0x216681,_0x2e8ec9);}catch(_0x577f35){if(_0x577f35 instanceof SDKError)return console[_0x472b05(0xae)](_0x472b05(0x7f)+_0x577f35[_0x472b05(0x99)]),_0x577f35[_0x472b05(0xa9)]&&console[_0x472b05(0xae)](_0x472b05(0xb6)+_0x577f35[_0x472b05(0xa9)]),0x1;throw _0x577f35;}}async[a28_0x163ce3(0xa0)](_0x563eb4,_0x4727fd){const _0x5dbfa4=a28_0x163ce3,{options:_0x9ede49,tdx:_0x3ccd0e}=_0x563eb4,_0x26849b=await withSpinner(_0x5dbfa4(0xa6)+_0x4727fd+_0x5dbfa4(0x7b),()=>_0x3ccd0e['segment']['listParents'](),{'verbose':_0x9ede49[_0x5dbfa4(0x83)]}),_0x3b8256=_0x26849b[_0x5dbfa4(0x9e)],_0x279990=_0x4727fd[_0x5dbfa4(0x95)](/[.+^${}()|[\]\\]/g,_0x5dbfa4(0x9c))[_0x5dbfa4(0x95)](/\*/g,'.*')['replace'](/\?/g,'.'),_0xc82427=new RegExp('^'+_0x279990+'$','i'),_0xdf5565=_0x3b8256['filter'](_0x5675b5=>_0xc82427[_0x5dbfa4(0x8c)](_0x5675b5[_0x5dbfa4(0x7a)][_0x5dbfa4(0x7d)]));console['error'](_0x5dbfa4(0xa7)+_0xdf5565['length']+_0x5dbfa4(0x96)+(_0xdf5565[_0x5dbfa4(0x90)]!==0x1?'s':'')+_0x5dbfa4(0x9d)+_0x4727fd+'\x27');if(_0x9ede49[_0x5dbfa4(0x7c)]==='json'||_0x9ede49[_0x5dbfa4(0x7c)]===_0x5dbfa4(0xb8))await handleSDKOutput(_0xdf5565,_0x9ede49);else{if(_0xdf5565[_0x5dbfa4(0x90)]===0x0)console[_0x5dbfa4(0x9a)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x4727fd);else{console['log']('[parent\x20segments]');for(const _0x1394f2 of _0xdf5565){const _0x2f25f6=_0x1394f2[_0x5dbfa4(0x7a)]['population']?a28_0x5d7bae['dim']('\x20('+formatRows(_0x1394f2[_0x5dbfa4(0x7a)][_0x5dbfa4(0xa5)])+')'):'';console[_0x5dbfa4(0x9a)]('👥\x20'+_0x1394f2[_0x5dbfa4(0x7a)][_0x5dbfa4(0x7d)]+_0x2f25f6);}}}return 0x0;}async['listParents'](_0x30dbb7){const _0x5b9a89=a28_0x163ce3,{options:_0x405943,tdx:_0x5a519e}=_0x30dbb7,_0x15a755=await withSpinner(_0x5b9a89(0x91),()=>_0x5a519e[_0x5b9a89(0xa2)][_0x5b9a89(0xb9)](),{'verbose':_0x405943[_0x5b9a89(0x83)]}),_0x170e48=_0x15a755[_0x5b9a89(0x9e)];console[_0x5b9a89(0xae)](_0x5b9a89(0xa7)+_0x170e48['length']+_0x5b9a89(0x96)+(_0x170e48[_0x5b9a89(0x90)]!==0x1?'s':''));if(_0x405943[_0x5b9a89(0x7c)]===_0x5b9a89(0x94)||_0x405943[_0x5b9a89(0x7c)]===_0x5b9a89(0xb8))await handleSDKOutput(_0x170e48,_0x405943);else{console[_0x5b9a89(0x9a)]('[parent\x20segments]');for(const _0x27f316 of _0x170e48){const _0x4fd010=_0x27f316[_0x5b9a89(0x7a)]['population']?a28_0x5d7bae[_0x5b9a89(0xa4)]('\x20('+formatRows(_0x27f316[_0x5b9a89(0x7a)]['population'])+')'):'';console[_0x5b9a89(0x9a)]('👥\x20'+_0x27f316[_0x5b9a89(0x7a)]['name']+_0x4fd010);}}return 0x0;}async[a28_0x163ce3(0xa3)](_0x27d7a3,_0x478f38){const _0x82569d=a28_0x163ce3,{options:_0x2f063f,tdx:_0x1c886c}=_0x27d7a3,_0x151722=await withSpinner(_0x82569d(0x9f)+_0x478f38+_0x82569d(0x7b),()=>_0x1c886c['segment']['resolvePathToResource'](_0x478f38),{'verbose':_0x2f063f[_0x82569d(0x83)]}),_0x2ed10e=_0x151722[_0x82569d(0x9e)];_0x2f063f[_0x82569d(0x83)]&&(console[_0x82569d(0xae)]('Parent\x20ID:\x20'+_0x2ed10e['parentId']),_0x2ed10e[_0x82569d(0x85)]&&console[_0x82569d(0xae)](_0x82569d(0xb7)+_0x2ed10e[_0x82569d(0x85)]));const _0x313eaa=await withSpinner('Listing\x20folders\x20and\x20segments...',()=>_0x1c886c[_0x82569d(0xa2)][_0x82569d(0xa3)](_0x2ed10e[_0x82569d(0x8d)],_0x2ed10e[_0x82569d(0x85)]),{'verbose':_0x2f063f['verbose']}),{folders:_0x2ca18e,segments:_0x2b880b}=_0x313eaa[_0x82569d(0x9e)],_0x3a2685=_0x2ca18e[_0x82569d(0x90)]+_0x2b880b[_0x82569d(0x90)];console[_0x82569d(0xae)](_0x82569d(0xa7)+_0x2ca18e[_0x82569d(0x90)]+_0x82569d(0x87)+(_0x2ca18e['length']!==0x1?'s':'')+_0x82569d(0xb5)+_0x2b880b[_0x82569d(0x90)]+'\x20segment'+(_0x2b880b[_0x82569d(0x90)]!==0x1?'s':''));if(_0x2f063f[_0x82569d(0x7c)]==='json'||_0x2f063f[_0x82569d(0x7c)]===_0x82569d(0xb8)){const _0x549407=[..._0x2ca18e[_0x82569d(0x80)](_0xfe3817=>({..._0xfe3817,'type':'folder'})),..._0x2b880b['map'](_0x54582d=>({..._0x54582d,'type':_0x82569d(0xa2)}))][_0x82569d(0xab)]((_0xbe0e44,_0x3ec793)=>_0xbe0e44[_0x82569d(0x7d)][_0x82569d(0xb1)](_0x3ec793[_0x82569d(0x7d)]));await handleSDKOutput(_0x549407,_0x2f063f);}else{if(_0x3a2685===0x0)console[_0x82569d(0x9a)](a28_0x5d7bae[_0x82569d(0xa4)]('[/'+_0x478f38+']')),console[_0x82569d(0x9a)](_0x82569d(0x93));else{console[_0x82569d(0x9a)](a28_0x5d7bae[_0x82569d(0xa4)]('[/'+_0x478f38+']'));const _0x4672e2=formatFlatList(_0x2ca18e,_0x2b880b,{'showMetadata':!![]});console['log'](_0x4672e2);}}return 0x0;}async[a28_0x163ce3(0x8e)](_0x1bc5e9,_0x5e27d9){const _0x35b218=a28_0x163ce3,{options:_0x2a2532,tdx:_0x12b982}=_0x1bc5e9,_0x4102cb=await withSpinner(_0x35b218(0x9f)+_0x5e27d9+'\x27...',()=>_0x12b982[_0x35b218(0xa2)][_0x35b218(0xaf)](_0x5e27d9),{'verbose':_0x2a2532[_0x35b218(0x83)]}),_0x5ace67=_0x4102cb['data'];_0x2a2532[_0x35b218(0x83)]&&(console['error'](_0x35b218(0x7e)+_0x5ace67[_0x35b218(0x8d)]),_0x5ace67[_0x35b218(0x85)]&&console[_0x35b218(0xae)](_0x35b218(0xb7)+_0x5ace67['folderId']));const _0x21430e=_0x2a2532['maxDepth']||0xa,_0x109190=await withSpinner(_0x35b218(0xb0),()=>_0x12b982[_0x35b218(0xa2)][_0x35b218(0x8e)](_0x5ace67[_0x35b218(0x8d)],_0x5ace67[_0x35b218(0x85)],0x0,_0x21430e),{'verbose':_0x2a2532[_0x35b218(0x83)]}),_0x4deed2=_0x109190[_0x35b218(0x9e)];console[_0x35b218(0xae)]('✔\x20Built\x20tree\x20with\x20'+_0x4deed2[_0x35b218(0x90)]+_0x35b218(0x92));if(_0x2a2532[_0x35b218(0x7c)]===_0x35b218(0x94)||_0x2a2532[_0x35b218(0x7c)]==='jsonl')await handleSDKOutput(_0x4deed2,_0x2a2532);else{console[_0x35b218(0x9a)](a28_0x5d7bae['dim']('[/'+_0x5e27d9+']'));const _0x15e747=formatTree(_0x4deed2,{'showMetadata':!![]});console[_0x35b218(0x9a)](_0x15e747);}return 0x0;}}function a28_0xd4b6(){const _0x9c8792=['localeCompare','12227288ovQBWE','Path/pattern\x20arg:\x20','793572JcPEcb','\x20and\x20','\x20\x20Cause:\x20','Folder\x20ID:\x20','jsonl','listParents','attributes','\x27...','format','name','Parent\x20ID:\x20','Error:\x20','map','4056kXSwUL','site','verbose','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','folderId','7wEbvSx','\x20folder','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','Recursive\x20mode:\x20enabled','1eegsoE','4364376KkqKQz','test','parentId','listRecursive','11517520IGkNsT','length','Listing\x20parent\x20segments...','\x20top-level\x20items','(empty)','json','replace','\x20parent\x20segment','recursive','segments','message','log','execute','\x5c$&','\x20matching\x20\x27','data','Resolving\x20context\x20path\x20\x27','listParentsWithPattern','2134766Dznbxm','segment','listUnified','dim','population','Listing\x20parent\x20segments\x20matching\x20\x27','✔\x20Found\x20','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','cause','9385KmRrIV','sort','2147652pNIsDK','includes','error','resolvePathToResource','Building\x20hierarchy\x20tree...'];a28_0xd4b6=function(){return _0x9c8792;};return a28_0xd4b6();}
@@ -1 +1 @@
1
- const a29_0x220310=a29_0xd80d;(function(_0x187a64,_0x5f19d8){const _0x3d424e=a29_0xd80d,_0x222363=_0x187a64();while(!![]){try{const _0x3db084=parseInt(_0x3d424e(0xd5))/0x1+parseInt(_0x3d424e(0xd7))/0x2+-parseInt(_0x3d424e(0xda))/0x3*(-parseInt(_0x3d424e(0xcf))/0x4)+-parseInt(_0x3d424e(0xd6))/0x5+parseInt(_0x3d424e(0xc3))/0x6*(parseInt(_0x3d424e(0xdb))/0x7)+-parseInt(_0x3d424e(0xd2))/0x8*(parseInt(_0x3d424e(0xbc))/0x9)+-parseInt(_0x3d424e(0xba))/0xa*(parseInt(_0x3d424e(0xcd))/0xb);if(_0x3db084===_0x5f19d8)break;else _0x222363['push'](_0x222363['shift']());}catch(_0x6b05c){_0x222363['push'](_0x222363['shift']());}}}(a29_0x31e8,0x8f3c3));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a29_0xd80d(_0x31c0f4,_0x394355){const _0x31e873=a29_0x31e8();return a29_0xd80d=function(_0xd80d6b,_0x3b89fc){_0xd80d6b=_0xd80d6b-0xb5;let _0x3651b5=_0x31e873[_0xd80d6b];return _0x3651b5;},a29_0xd80d(_0x31c0f4,_0x394355);}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{[a29_0x220310(0xc5)]=a29_0x220310(0xd3);['description']='Show\x20table\x20contents';async[a29_0x220310(0xcc)](_0x332942){const _0x4a3287=a29_0x220310;return this[_0x4a3287(0xce)](_0x332942);}async[a29_0x220310(0xce)](_0xeef281){const _0x437521=a29_0x220310,{options:_0x38a984,args:_0xb6759d,tdx:_0x4fbc48}=_0xeef281;let _0x9a7d4b;try{_0x9a7d4b=parseTableReference(_0xb6759d[0x0]);const _0x56bf12=_0x38a984[_0x437521(0xbd)];!_0x9a7d4b[_0x437521(0xbd)]&&_0x56bf12&&(_0x9a7d4b[_0x437521(0xbd)]=_0x56bf12);const _0x2d76aa=validateTableDescribeReference(_0x9a7d4b);if(_0x2d76aa)return console[_0x437521(0xb7)](_0x437521(0xb5)+_0x2d76aa),console[_0x437521(0xb7)](_0x437521(0xbb)),console[_0x437521(0xb7)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x437521(0xb7)](_0x437521(0xd8)),0x1;}catch(_0x12ffcc){return console['error']('Error:\x20'+_0x12ffcc[_0x437521(0xd4)]),console[_0x437521(0xb7)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x437521(0xb7)](_0x437521(0xdc)),console[_0x437521(0xb7)](_0x437521(0xd8)),0x1;}const _0x5a58af=_0x9a7d4b[_0x437521(0xbf)],_0x5b11b9=_0x9a7d4b[_0x437521(0xbd)],_0x51194c=_0x9a7d4b['table'],_0x787a04=resolveLimit(_0x38a984[_0x437521(0xd0)],DEFAULT_DISPLAY_LIMIT);try{_0x38a984[_0x437521(0xc9)]&&(console[_0x437521(0xb7)](_0x437521(0xc4)+_0x38a984[_0x437521(0xb6)]),_0x5a58af&&console[_0x437521(0xb7)]('Catalog:\x20'+_0x5a58af),console[_0x437521(0xb7)]('Database:\x20'+_0x5b11b9),console[_0x437521(0xb7)](_0x437521(0xc0)+_0x51194c),console[_0x437521(0xb7)](_0x437521(0xca)+_0x787a04));const _0x47da2b=_0x5a58af?_0x5a58af+'.'+_0x5b11b9+'.'+_0x51194c:_0x5b11b9+'.'+_0x51194c,_0x24907c=await withSpinner('Querying\x20'+_0x47da2b+_0x437521(0xbe),()=>_0x4fbc48['table'][_0x437521(0xd3)](_0x5b11b9,_0x51194c,_0x787a04,_0x5a58af),{'verbose':_0x38a984['verbose']}),_0x5dfa3e=_0x24907c[_0x437521(0xc8)],_0x33b1fa=_0x5dfa3e[_0x437521(0xc8)];return _0x33b1fa['length']===0x0?console['error'](_0x437521(0xc2)):console[_0x437521(0xb7)](_0x437521(0xc7)+_0x33b1fa['length']+'\x20row'+(_0x33b1fa[_0x437521(0xc1)]!==0x1?'s':'')+_0x437521(0xc6)+_0x47da2b),await handleSDKOutput(_0x33b1fa,_0x38a984),0x0;}catch(_0x58efaf){if(_0x58efaf instanceof SDKError)return console[_0x437521(0xb7)](_0x437521(0xb5)+_0x58efaf[_0x437521(0xd4)]),_0x58efaf[_0x437521(0xb9)]&&console[_0x437521(0xb7)](_0x437521(0xb8)+_0x58efaf['cause']),0x1;throw _0x58efaf;}}[a29_0x220310(0xd1)](_0x243253){const _0x2162f8=a29_0x220310;if(_0x243253['args'][_0x2162f8(0xc1)]===0x0)return _0x2162f8(0xd9);if(_0x243253[_0x2162f8(0xcb)][_0x2162f8(0xc1)]>0x1)return'Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';return undefined;}}function a29_0x31e8(){const _0x3d5cb0=['187ZBOXbr','showTable','40VBVUZm','limit','validate','8mIWIBN','show','message','6304HJOdDv','1696480AZUcFC','2319334ROaSKB','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','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','272589YZZWIw','43428utyIHr','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','Error:\x20','site','error','\x20\x20Cause:\x20','cause','765760LpqCUE','Usage:\x20tdx\x20show\x20<database.table>','3534966SugVMV','database','...','catalog','Table:\x20','length','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','528UJYTTQ','Site:\x20','name','\x20from\x20','✔\x20Retrieved\x20','data','verbose','Limit:\x20','args','execute'];a29_0x31e8=function(){return _0x3d5cb0;};return a29_0x31e8();}
1
+ const a29_0xe3a0af=a29_0xc409;(function(_0xe155d5,_0x2d9598){const _0x33bd8d=a29_0xc409,_0x5cab37=_0xe155d5();while(!![]){try{const _0x4efe2e=-parseInt(_0x33bd8d(0x1ae))/0x1*(-parseInt(_0x33bd8d(0x1c9))/0x2)+parseInt(_0x33bd8d(0x1c8))/0x3*(parseInt(_0x33bd8d(0x1ac))/0x4)+parseInt(_0x33bd8d(0x1ba))/0x5*(-parseInt(_0x33bd8d(0x1bd))/0x6)+-parseInt(_0x33bd8d(0x19f))/0x7*(-parseInt(_0x33bd8d(0x1aa))/0x8)+parseInt(_0x33bd8d(0x1a0))/0x9*(parseInt(_0x33bd8d(0x1bb))/0xa)+parseInt(_0x33bd8d(0x1ab))/0xb*(parseInt(_0x33bd8d(0x1c7))/0xc)+-parseInt(_0x33bd8d(0x1b1))/0xd;if(_0x4efe2e===_0x2d9598)break;else _0x5cab37['push'](_0x5cab37['shift']());}catch(_0x4be57a){_0x5cab37['push'](_0x5cab37['shift']());}}}(a29_0x3be6,0xed967));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a29_0x3be6(){const _0x2c8f10=['Querying\x20','Usage:\x20tdx\x20show\x20<database.table>','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','...','138084imMzHG','159BVZlIx','1104034LsrEFs','Catalog:\x20','cause','args','28679JbTVGa','162YWCnIP','Table:\x20','table','verbose','execute','Limit:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','Database:\x20','database','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','3560aSCdLp','1507tLkiwk','103772SUFvKU','data','1AuOoQh','Show\x20table\x20contents','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','58896955aQmYzj','showTable','show','limit','\x20row','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','message','name','Site:\x20','9580aKxRSJ','106890fXDPUz','length','48pLzQra','validate','\x20\x20Cause:\x20','error','Error:\x20','site'];a29_0x3be6=function(){return _0x2c8f10;};return a29_0x3be6();}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a29_0xc409(_0x3b8161,_0x270089){const _0x3be616=a29_0x3be6();return a29_0xc409=function(_0xc40921,_0x32e00c){_0xc40921=_0xc40921-0x19e;let _0x70411=_0x3be616[_0xc40921];return _0x70411;},a29_0xc409(_0x3b8161,_0x270089);}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{[a29_0xe3a0af(0x1b8)]=a29_0xe3a0af(0x1b3);['description']=a29_0xe3a0af(0x1af);async[a29_0xe3a0af(0x1a4)](_0x5659a9){const _0x12bf14=a29_0xe3a0af;return this[_0x12bf14(0x1b2)](_0x5659a9);}async[a29_0xe3a0af(0x1b2)](_0x88c489){const _0x1d9ab6=a29_0xe3a0af,{options:_0x300e47,args:_0x54b71c,tdx:_0x4091e7}=_0x88c489;let _0x28c4bc;try{_0x28c4bc=parseTableReference(_0x54b71c[0x0]);const _0x21b678=_0x300e47[_0x1d9ab6(0x1a8)];!_0x28c4bc[_0x1d9ab6(0x1a8)]&&_0x21b678&&(_0x28c4bc[_0x1d9ab6(0x1a8)]=_0x21b678);const _0x2e2730=validateTableDescribeReference(_0x28c4bc);if(_0x2e2730)return console['error']('Error:\x20'+_0x2e2730),console[_0x1d9ab6(0x1c0)](_0x1d9ab6(0x1c4)),console['error'](_0x1d9ab6(0x1b6)),console[_0x1d9ab6(0x1c0)](_0x1d9ab6(0x1a6)),0x1;}catch(_0xb4f51b){return console[_0x1d9ab6(0x1c0)](_0x1d9ab6(0x1c1)+_0xb4f51b[_0x1d9ab6(0x1b7)]),console[_0x1d9ab6(0x1c0)](_0x1d9ab6(0x1c4)),console[_0x1d9ab6(0x1c0)](_0x1d9ab6(0x1b6)),console[_0x1d9ab6(0x1c0)](_0x1d9ab6(0x1a6)),0x1;}const _0x1f4612=_0x28c4bc['catalog'],_0x3ee834=_0x28c4bc['database'],_0x4b292e=_0x28c4bc[_0x1d9ab6(0x1a2)],_0x5283ec=resolveLimit(_0x300e47[_0x1d9ab6(0x1b4)],DEFAULT_DISPLAY_LIMIT);try{_0x300e47['verbose']&&(console[_0x1d9ab6(0x1c0)](_0x1d9ab6(0x1b9)+_0x300e47[_0x1d9ab6(0x1c2)]),_0x1f4612&&console[_0x1d9ab6(0x1c0)](_0x1d9ab6(0x1ca)+_0x1f4612),console['error'](_0x1d9ab6(0x1a7)+_0x3ee834),console['error'](_0x1d9ab6(0x1a1)+_0x4b292e),console[_0x1d9ab6(0x1c0)](_0x1d9ab6(0x1a5)+_0x5283ec));const _0xd7f2c0=_0x1f4612?_0x1f4612+'.'+_0x3ee834+'.'+_0x4b292e:_0x3ee834+'.'+_0x4b292e,_0x1fde97=await withSpinner(_0x1d9ab6(0x1c3)+_0xd7f2c0+_0x1d9ab6(0x1c6),()=>_0x4091e7['table'][_0x1d9ab6(0x1b3)](_0x3ee834,_0x4b292e,_0x5283ec,_0x1f4612),{'verbose':_0x300e47[_0x1d9ab6(0x1a3)]}),_0x4e7296=_0x1fde97[_0x1d9ab6(0x1ad)],_0x5bff89=_0x4e7296['data'];return _0x5bff89['length']===0x0?console[_0x1d9ab6(0x1c0)](_0x1d9ab6(0x1b0)):console['error']('✔\x20Retrieved\x20'+_0x5bff89[_0x1d9ab6(0x1bc)]+_0x1d9ab6(0x1b5)+(_0x5bff89['length']!==0x1?'s':'')+'\x20from\x20'+_0xd7f2c0),await handleSDKOutput(_0x5bff89,_0x300e47),0x0;}catch(_0x18980c){if(_0x18980c instanceof SDKError)return console[_0x1d9ab6(0x1c0)](_0x1d9ab6(0x1c1)+_0x18980c[_0x1d9ab6(0x1b7)]),_0x18980c[_0x1d9ab6(0x1cb)]&&console[_0x1d9ab6(0x1c0)](_0x1d9ab6(0x1bf)+_0x18980c[_0x1d9ab6(0x1cb)]),0x1;throw _0x18980c;}}[a29_0xe3a0af(0x1be)](_0x348614){const _0x225162=a29_0xe3a0af;if(_0x348614[_0x225162(0x19e)][_0x225162(0x1bc)]===0x0)return _0x225162(0x1c5);if(_0x348614[_0x225162(0x19e)][_0x225162(0x1bc)]>0x1)return _0x225162(0x1a9);return undefined;}}
@@ -1 +1 @@
1
- const a30_0x4732a2=a30_0x505e;(function(_0x448c8d,_0x5ab373){const _0x5ab634=a30_0x505e,_0x8fde8f=_0x448c8d();while(!![]){try{const _0x685743=-parseInt(_0x5ab634(0x170))/0x1+-parseInt(_0x5ab634(0x147))/0x2*(-parseInt(_0x5ab634(0x16f))/0x3)+parseInt(_0x5ab634(0x179))/0x4+-parseInt(_0x5ab634(0x177))/0x5*(parseInt(_0x5ab634(0x160))/0x6)+parseInt(_0x5ab634(0x14d))/0x7+parseInt(_0x5ab634(0x171))/0x8*(-parseInt(_0x5ab634(0x151))/0x9)+parseInt(_0x5ab634(0x15b))/0xa;if(_0x685743===_0x5ab373)break;else _0x8fde8f['push'](_0x8fde8f['shift']());}catch(_0x156585){_0x8fde8f['push'](_0x8fde8f['shift']());}}}(a30_0x1c0b,0xda5b6));function a30_0x505e(_0x5349bb,_0x5af4f8){const _0x1c0bbf=a30_0x1c0b();return a30_0x505e=function(_0x505ecd,_0x297602){_0x505ecd=_0x505ecd-0x145;let _0x2756e2=_0x1c0bbf[_0x505ecd];return _0x2756e2;},a30_0x505e(_0x5349bb,_0x5af4f8);}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';function a30_0x1c0b(){const _0x310091=['\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','5OYOirQ','limit','1069624UFNXpy','name','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','679826WSFASJ','Database:\x20','\x20\x20Cause:\x20','data','Error:\x20Pattern\x20\x27','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','5061266iSTiLl','Table\x20pattern:\x20','List\x20tables\x20in\x20a\x20database','\x27\x20is\x20ambiguous.','68490kowfQz','description','verbose','list','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','site','Listing\x20tables...','Database\x20pattern:\x20','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','length','10764040KMTydp','\x20table','error','table','Note:\x20\x27','9658842cchUXN','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','message','validate','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','\x20\x20Use:\x20tdx\x20tables\x20\x22','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','Database:\x20all','.*\x22','\x27\x20across\x20all\x20databases.','✔\x20Found\x20','Error:\x20','cause','includes','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','6zJsVgr','189207GvZcGp','56wSUbhV','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','tables','database'];a30_0x1c0b=function(){return _0x310091;};return a30_0x1c0b();}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a30_0x4732a2(0x145)]=a30_0x4732a2(0x174);[a30_0x4732a2(0x152)]=a30_0x4732a2(0x14f);async['execute'](_0x53c057){const _0x1b1db1=a30_0x4732a2,{options:_0x5deca9,args:_0x2c4b7f,tdx:_0x30a65b}=_0x53c057;let _0x108c95;if(_0x2c4b7f['length']===0x0)_0x108c95={'database':undefined,'table':undefined,'original':''};else{if(_0x2c4b7f[_0x1b1db1(0x15a)]===0x1)try{_0x108c95=parseTableReference(_0x2c4b7f[0x0]);if(_0x108c95[_0x1b1db1(0x15e)]&&!_0x108c95[_0x1b1db1(0x175)]&&!_0x108c95[_0x1b1db1(0x15e)][_0x1b1db1(0x16d)]('*')&&!_0x108c95[_0x1b1db1(0x15e)]['includes']('?'))return console[_0x1b1db1(0x15d)](_0x1b1db1(0x14b)+_0x2c4b7f[0x0]+_0x1b1db1(0x150)),console[_0x1b1db1(0x15d)](_0x1b1db1(0x166)+_0x108c95[_0x1b1db1(0x15e)]+'\x27?'),console['error'](_0x1b1db1(0x165)+_0x108c95[_0x1b1db1(0x15e)]+_0x1b1db1(0x168)),console[_0x1b1db1(0x15d)](_0x1b1db1(0x176)+_0x108c95['table']),console[_0x1b1db1(0x15d)](_0x1b1db1(0x173)+_0x108c95[_0x1b1db1(0x15e)]),console[_0x1b1db1(0x15d)](''),console[_0x1b1db1(0x15d)](_0x1b1db1(0x15f)+_0x2c4b7f[0x0]+_0x1b1db1(0x164)+_0x108c95['table']+_0x1b1db1(0x169)),0x1;}catch(_0x14a3d0){return console[_0x1b1db1(0x15d)](_0x1b1db1(0x16b)+_0x14a3d0[_0x1b1db1(0x162)]),0x1;}else return console['error'](_0x1b1db1(0x155)),console[_0x1b1db1(0x15d)](_0x1b1db1(0x161)),console[_0x1b1db1(0x15d)](_0x1b1db1(0x172)),console[_0x1b1db1(0x15d)](_0x1b1db1(0x16e)),console['error'](_0x1b1db1(0x159)),console[_0x1b1db1(0x15d)]('Or\x20use\x20--in\x20flag:'),console[_0x1b1db1(0x15d)](_0x1b1db1(0x14c)),0x1;}const _0x3a9612=_0x5deca9[_0x1b1db1(0x175)];!_0x108c95[_0x1b1db1(0x175)]&&_0x3a9612&&(_0x108c95['database']=_0x3a9612);try{const _0x4c6da7=_0x385782=>_0x385782&&(_0x385782[_0x1b1db1(0x16d)]('*')||_0x385782['includes']('?')),_0x50ad9e=_0x4c6da7(_0x108c95[_0x1b1db1(0x175)]);_0x5deca9[_0x1b1db1(0x153)]&&(console[_0x1b1db1(0x15d)]('Site:\x20'+_0x5deca9[_0x1b1db1(0x156)]),_0x108c95[_0x1b1db1(0x175)]?_0x50ad9e?console[_0x1b1db1(0x15d)](_0x1b1db1(0x158)+_0x108c95['database']):console[_0x1b1db1(0x15d)](_0x1b1db1(0x148)+_0x108c95['database']):console[_0x1b1db1(0x15d)](_0x1b1db1(0x167)),_0x108c95[_0x1b1db1(0x15e)]&&console[_0x1b1db1(0x15d)](_0x1b1db1(0x14e)+_0x108c95[_0x1b1db1(0x15e)]));const _0x332c4b=_0x108c95[_0x1b1db1(0x175)]&&!_0x50ad9e?_0x108c95[_0x1b1db1(0x175)]:undefined,_0x5ca0df=_0x50ad9e?_0x108c95['database']:undefined,_0x5a9424=_0x108c95[_0x1b1db1(0x15e)],_0x281f3e=resolveLimit(_0x5deca9[_0x1b1db1(0x178)],DEFAULT_LISTING_LIMIT),_0x202141=await withSpinner(_0x1b1db1(0x157),()=>_0x30a65b[_0x1b1db1(0x15e)][_0x1b1db1(0x154)](_0x332c4b,_0x5a9424,_0x5ca0df,_0x281f3e),{'verbose':_0x5deca9[_0x1b1db1(0x153)]}),_0x575443=_0x202141[_0x1b1db1(0x14a)];if(_0x575443[_0x1b1db1(0x15a)]===0x0&&_0x108c95[_0x1b1db1(0x175)]&&!_0x50ad9e)return console[_0x1b1db1(0x15d)]('✖\x20No\x20tables\x20found'),console['error']('Database\x20\x27'+_0x108c95[_0x1b1db1(0x175)]+_0x1b1db1(0x146)),0x1;return console[_0x1b1db1(0x15d)](_0x1b1db1(0x16a)+_0x575443['length']+_0x1b1db1(0x15c)+(_0x575443[_0x1b1db1(0x15a)]!==0x1?'s':'')),await handleSDKOutput(_0x575443,{..._0x5deca9,'limit':_0x281f3e}),0x0;}catch(_0xc51dc6){if(_0xc51dc6 instanceof SDKError)return console[_0x1b1db1(0x15d)]('Error:\x20'+_0xc51dc6[_0x1b1db1(0x162)]),_0xc51dc6[_0x1b1db1(0x16c)]&&console[_0x1b1db1(0x15d)](_0x1b1db1(0x149)+_0xc51dc6[_0x1b1db1(0x16c)]),0x1;throw _0xc51dc6;}}[a30_0x4732a2(0x163)](_0x3f5bbd){return undefined;}}
1
+ const a30_0x54564f=a30_0x4c41;function a30_0x4c41(_0x5ba8a0,_0x47a4ed){const _0x42753e=a30_0x4275();return a30_0x4c41=function(_0x4c4129,_0x22d11f){_0x4c4129=_0x4c4129-0x10c;let _0x117355=_0x42753e[_0x4c4129];return _0x117355;},a30_0x4c41(_0x5ba8a0,_0x47a4ed);}(function(_0x393c9e,_0x6cbd74){const _0x2f88ca=a30_0x4c41,_0x240db4=_0x393c9e();while(!![]){try{const _0x5986b0=parseInt(_0x2f88ca(0x126))/0x1*(parseInt(_0x2f88ca(0x11f))/0x2)+-parseInt(_0x2f88ca(0x11d))/0x3+parseInt(_0x2f88ca(0x12c))/0x4+-parseInt(_0x2f88ca(0x139))/0x5+parseInt(_0x2f88ca(0x134))/0x6*(parseInt(_0x2f88ca(0x113))/0x7)+parseInt(_0x2f88ca(0x122))/0x8*(-parseInt(_0x2f88ca(0x129))/0x9)+-parseInt(_0x2f88ca(0x118))/0xa*(-parseInt(_0x2f88ca(0x11b))/0xb);if(_0x5986b0===_0x6cbd74)break;else _0x240db4['push'](_0x240db4['shift']());}catch(_0x3e9852){_0x240db4['push'](_0x240db4['shift']());}}}(a30_0x4275,0x70cca));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';function a30_0x4275(){const _0x46b37d=['list','Database\x20pattern:\x20','11UOyjvD','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','1989516NcGItp','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','150414vROkwb','table','Site:\x20','16MUzUkR','length','limit','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','3PDYnUv','\x20table','Listing\x20tables...','4012542xclDvl','tables','Table\x20pattern:\x20','932532LrXEkk','database','Error:\x20','\x27\x20is\x20ambiguous.','Database:\x20','\x27\x20across\x20all\x20databases.','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','data','5356014FvxcSm','site','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','error','4020115hzntTn','validate','\x20\x20Cause:\x20','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','Database:\x20all','execute','\x20\x20Use:\x20tdx\x20tables\x20\x22','message','✖\x20No\x20tables\x20found','cause','7VblilS','includes','name','✔\x20Found\x20','description','14694740rXRmdf'];a30_0x4275=function(){return _0x46b37d;};return a30_0x4275();}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a30_0x54564f(0x115)]=a30_0x54564f(0x12a);[a30_0x54564f(0x117)]='List\x20tables\x20in\x20a\x20database';async[a30_0x54564f(0x10e)](_0x170d35){const _0x31e011=a30_0x54564f,{options:_0xab6ba9,args:_0x1df1d4,tdx:_0x11f887}=_0x170d35;let _0x33419a;if(_0x1df1d4[_0x31e011(0x123)]===0x0)_0x33419a={'database':undefined,'table':undefined,'original':''};else{if(_0x1df1d4['length']===0x1)try{_0x33419a=parseTableReference(_0x1df1d4[0x0]);if(_0x33419a[_0x31e011(0x120)]&&!_0x33419a['database']&&!_0x33419a[_0x31e011(0x120)]['includes']('*')&&!_0x33419a[_0x31e011(0x120)][_0x31e011(0x114)]('?'))return console[_0x31e011(0x138)]('Error:\x20Pattern\x20\x27'+_0x1df1d4[0x0]+_0x31e011(0x12f)),console[_0x31e011(0x138)](_0x31e011(0x132)+_0x33419a[_0x31e011(0x120)]+'\x27?'),console[_0x31e011(0x138)](_0x31e011(0x10f)+_0x33419a[_0x31e011(0x120)]+'.*\x22'),console[_0x31e011(0x138)]('\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'+_0x33419a[_0x31e011(0x120)]),console[_0x31e011(0x138)](_0x31e011(0x11e)+_0x33419a[_0x31e011(0x120)]),console[_0x31e011(0x138)](''),console['error']('Note:\x20\x27'+_0x1df1d4[0x0]+'\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27'+_0x33419a['table']+_0x31e011(0x131)),0x1;}catch(_0x2caed9){return console[_0x31e011(0x138)](_0x31e011(0x12e)+_0x2caed9[_0x31e011(0x110)]),0x1;}else return console['error'](_0x31e011(0x10c)),console[_0x31e011(0x138)]('\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases'),console[_0x31e011(0x138)](_0x31e011(0x137)),console[_0x31e011(0x138)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console[_0x31e011(0x138)](_0x31e011(0x125)),console[_0x31e011(0x138)]('Or\x20use\x20--in\x20flag:'),console[_0x31e011(0x138)](_0x31e011(0x11c)),0x1;}const _0x2c0c58=_0xab6ba9[_0x31e011(0x12d)];!_0x33419a['database']&&_0x2c0c58&&(_0x33419a[_0x31e011(0x12d)]=_0x2c0c58);try{const _0x3dac34=_0x2569fd=>_0x2569fd&&(_0x2569fd['includes']('*')||_0x2569fd[_0x31e011(0x114)]('?')),_0x3abc54=_0x3dac34(_0x33419a[_0x31e011(0x12d)]);_0xab6ba9['verbose']&&(console[_0x31e011(0x138)](_0x31e011(0x121)+_0xab6ba9[_0x31e011(0x135)]),_0x33419a[_0x31e011(0x12d)]?_0x3abc54?console[_0x31e011(0x138)](_0x31e011(0x11a)+_0x33419a[_0x31e011(0x12d)]):console[_0x31e011(0x138)](_0x31e011(0x130)+_0x33419a[_0x31e011(0x12d)]):console[_0x31e011(0x138)](_0x31e011(0x10d)),_0x33419a['table']&&console[_0x31e011(0x138)](_0x31e011(0x12b)+_0x33419a[_0x31e011(0x120)]));const _0x4460d1=_0x33419a[_0x31e011(0x12d)]&&!_0x3abc54?_0x33419a[_0x31e011(0x12d)]:undefined,_0x56868a=_0x3abc54?_0x33419a[_0x31e011(0x12d)]:undefined,_0x594763=_0x33419a[_0x31e011(0x120)],_0x1035d9=resolveLimit(_0xab6ba9[_0x31e011(0x124)],DEFAULT_LISTING_LIMIT),_0x1cdc21=await withSpinner(_0x31e011(0x128),()=>_0x11f887[_0x31e011(0x120)][_0x31e011(0x119)](_0x4460d1,_0x594763,_0x56868a,_0x1035d9),{'verbose':_0xab6ba9['verbose']}),_0x11f340=_0x1cdc21[_0x31e011(0x133)];if(_0x11f340[_0x31e011(0x123)]===0x0&&_0x33419a['database']&&!_0x3abc54)return console['error'](_0x31e011(0x111)),console[_0x31e011(0x138)]('Database\x20\x27'+_0x33419a[_0x31e011(0x12d)]+_0x31e011(0x136)),0x1;return console[_0x31e011(0x138)](_0x31e011(0x116)+_0x11f340[_0x31e011(0x123)]+_0x31e011(0x127)+(_0x11f340[_0x31e011(0x123)]!==0x1?'s':'')),await handleSDKOutput(_0x11f340,{..._0xab6ba9,'limit':_0x1035d9}),0x0;}catch(_0x1b8615){if(_0x1b8615 instanceof SDKError)return console['error'](_0x31e011(0x12e)+_0x1b8615[_0x31e011(0x110)]),_0x1b8615[_0x31e011(0x112)]&&console[_0x31e011(0x138)](_0x31e011(0x13b)+_0x1b8615[_0x31e011(0x112)]),0x1;throw _0x1b8615;}}[a30_0x54564f(0x13a)](_0x220b25){return undefined;}}
@@ -1 +1 @@
1
- const a31_0x5f02ae=a31_0x17b8;(function(_0x1a240c,_0x38ca91){const _0x2a0d4d=a31_0x17b8,_0x5e13fd=_0x1a240c();while(!![]){try{const _0x16353a=-parseInt(_0x2a0d4d(0x1a8))/0x1*(-parseInt(_0x2a0d4d(0x1bc))/0x2)+parseInt(_0x2a0d4d(0x19a))/0x3*(-parseInt(_0x2a0d4d(0x1af))/0x4)+parseInt(_0x2a0d4d(0x1b8))/0x5*(parseInt(_0x2a0d4d(0x1a2))/0x6)+-parseInt(_0x2a0d4d(0x199))/0x7*(-parseInt(_0x2a0d4d(0x1bb))/0x8)+-parseInt(_0x2a0d4d(0x1bf))/0x9+parseInt(_0x2a0d4d(0x1b1))/0xa*(-parseInt(_0x2a0d4d(0x1b5))/0xb)+parseInt(_0x2a0d4d(0x1bd))/0xc;if(_0x16353a===_0x38ca91)break;else _0x5e13fd['push'](_0x5e13fd['shift']());}catch(_0x51c6b9){_0x5e13fd['push'](_0x5e13fd['shift']());}}}(a31_0x4ebe,0x1f407));import{BaseCommand}from'./command.js';function a31_0x4ebe(){const _0x450982=['149916VFBhnG','join','1062108ClvdWR','includes','Invalid\x20resource:\x20','Session\x20parent_segment\x20set\x20to:\x20','1694nbpAPP','22245PurEQB','Session\x20llm_project\x20set\x20to:\x20','description','name','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','use','parent_segment','length','10872JXvXSs','\x20(session:\x20','log','error','Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a','Error:\x20Profile\x20\x27','6wwZXHS','toString','database','session','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','validate','profile','92cEJcfG','Session\x20database\x20set\x20to:\x20','555910uiDhGa','message','Error:\x20','execute','33qUIErE','.\x20Must\x20be\x20one\x20of:\x20','llm_project','485cPPLrw','Set\x20session-level\x20context','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a','5800pvwxGu','73210mwDYVJ'];a31_0x4ebe=function(){return _0x450982;};return a31_0x4ebe();}import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';import{profileExists}from'../core/profile.js';function a31_0x17b8(_0xa7096,_0x59d498){const _0x4ebead=a31_0x4ebe();return a31_0x17b8=function(_0x17b863,_0x3b1083){_0x17b863=_0x17b863-0x199;let _0xb1abd8=_0x4ebead[_0x17b863];return _0xb1abd8;},a31_0x17b8(_0xa7096,_0x59d498);}export class UseCommand extends BaseCommand{[a31_0x5f02ae(0x19d)]=a31_0x5f02ae(0x19f);[a31_0x5f02ae(0x19c)]=a31_0x5f02ae(0x1b9);[a31_0x5f02ae(0x1ad)](_0x41b3c4){const _0x44fd84=a31_0x5f02ae,{args:_0x4466c6}=_0x41b3c4;if(_0x4466c6[_0x44fd84(0x1a1)]<0x2)return'Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a'+_0x44fd84(0x1ba)+_0x44fd84(0x1a6)+_0x44fd84(0x1ac);const _0x77809e=_0x4466c6[0x0],_0x389338=[_0x44fd84(0x1aa),_0x44fd84(0x1a0),'llm_project',_0x44fd84(0x1ae)];if(!_0x389338[_0x44fd84(0x1c0)](_0x77809e))return _0x44fd84(0x1c1)+_0x77809e+_0x44fd84(0x1b6)+_0x389338[_0x44fd84(0x1be)](',\x20');return undefined;}async[a31_0x5f02ae(0x1b4)](_0x2f3ca8){const _0xbd702d=a31_0x5f02ae,{args:_0x16ea30,options:_0x27b991}=_0x2f3ca8;try{const _0x29f6ff=_0x16ea30[0x0],_0x545ee2=_0x16ea30[0x1];if(_0x29f6ff===_0xbd702d(0x1ae)){if(!profileExists(_0x545ee2))return console[_0xbd702d(0x1a5)](_0xbd702d(0x1a7)+_0x545ee2+'\x27\x20does\x20not\x20exist'),console[_0xbd702d(0x1a5)]('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x3b41=_0x27b991[_0xbd702d(0x1ab)]||getCurrentSessionPID()[_0xbd702d(0x1a9)]();return saveSessionContext({'profile':_0x545ee2},_0x27b991['session']),console[_0xbd702d(0x1a4)]('Session\x20profile\x20set\x20to:\x20'+_0x545ee2+'\x20(session:\x20'+_0x3b41+')'),console['log'](_0xbd702d(0x19e)),0x0;}const _0x1c9fb4={},_0x515c63=_0x27b991['session']||getCurrentSessionPID()['toString']();switch(_0x29f6ff){case _0xbd702d(0x1aa):_0x1c9fb4[_0xbd702d(0x1aa)]=_0x545ee2,console[_0xbd702d(0x1a4)](_0xbd702d(0x1b0)+_0x545ee2+'\x20(session:\x20'+_0x515c63+')');break;case _0xbd702d(0x1a0):_0x1c9fb4[_0xbd702d(0x1a0)]=_0x545ee2,console[_0xbd702d(0x1a4)](_0xbd702d(0x1c2)+_0x545ee2+_0xbd702d(0x1a3)+_0x515c63+')');break;case _0xbd702d(0x1b7):_0x1c9fb4['llm_project']=_0x545ee2,console[_0xbd702d(0x1a4)](_0xbd702d(0x19b)+_0x545ee2+_0xbd702d(0x1a3)+_0x515c63+')');break;}return saveSessionContext(_0x1c9fb4,_0x27b991[_0xbd702d(0x1ab)]),console['log'](_0xbd702d(0x19e)),0x0;}catch(_0x2af0e1){return _0x2af0e1 instanceof Error&&console[_0xbd702d(0x1a5)](_0xbd702d(0x1b3)+_0x2af0e1[_0xbd702d(0x1b2)]),0x1;}}}
1
+ const a31_0x420002=a31_0x246c;function a31_0x4088(){const _0x3dd198=['2706pXoYkF','Session\x20profile\x20set\x20to:\x20','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a','308lDYeTm','7084610PRmhcn','6ehqSTI','parent_segment','session','error','6896fGrraZ','198415TkglOV','toString','profile','Session\x20llm_project\x20set\x20to:\x20','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','includes','join','5357TnuDwG','log','Error:\x20Profile\x20\x27','1354710qYTSrS','5358040canjnw','\x27\x20does\x20not\x20exist','\x20(session:\x20','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','9AzeXZX','Invalid\x20resource:\x20','66fSKehX','execute','Session\x20database\x20set\x20to:\x20','5532JAzPxG','message','length','use','Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a','name','.\x20Must\x20be\x20one\x20of:\x20','Session\x20parent_segment\x20set\x20to:\x20','llm_project','database'];a31_0x4088=function(){return _0x3dd198;};return a31_0x4088();}function a31_0x246c(_0x41aae8,_0x141328){const _0x408883=a31_0x4088();return a31_0x246c=function(_0x246c7c,_0x368569){_0x246c7c=_0x246c7c-0x151;let _0x4d482b=_0x408883[_0x246c7c];return _0x4d482b;},a31_0x246c(_0x41aae8,_0x141328);}(function(_0x5bec95,_0x4056e1){const _0x2e5f54=a31_0x246c,_0xa40d9e=_0x5bec95();while(!![]){try{const _0x4d6609=-parseInt(_0x2e5f54(0x155))/0x1*(-parseInt(_0x2e5f54(0x152))/0x2)+-parseInt(_0x2e5f54(0x16d))/0x3*(parseInt(_0x2e5f54(0x15b))/0x4)+-parseInt(_0x2e5f54(0x15c))/0x5*(-parseInt(_0x2e5f54(0x157))/0x6)+-parseInt(_0x2e5f54(0x166))/0x7+parseInt(_0x2e5f54(0x167))/0x8+-parseInt(_0x2e5f54(0x16b))/0x9*(parseInt(_0x2e5f54(0x156))/0xa)+parseInt(_0x2e5f54(0x163))/0xb*(parseInt(_0x2e5f54(0x170))/0xc);if(_0x4d6609===_0x4056e1)break;else _0xa40d9e['push'](_0xa40d9e['shift']());}catch(_0x3a2c4d){_0xa40d9e['push'](_0xa40d9e['shift']());}}}(a31_0x4088,0x6447e));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';import{profileExists}from'../core/profile.js';export class UseCommand extends BaseCommand{[a31_0x420002(0x175)]=a31_0x420002(0x173);['description']='Set\x20session-level\x20context';['validate'](_0xd28239){const _0x4bd557=a31_0x420002,{args:_0x2b9bda}=_0xd28239;if(_0x2b9bda[_0x4bd557(0x172)]<0x2)return'Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a'+_0x4bd557(0x154)+_0x4bd557(0x174)+_0x4bd557(0x160);const _0x244fbb=_0x2b9bda[0x0],_0xfa02a2=[_0x4bd557(0x151),'parent_segment',_0x4bd557(0x178),_0x4bd557(0x15e)];if(!_0xfa02a2[_0x4bd557(0x161)](_0x244fbb))return _0x4bd557(0x16c)+_0x244fbb+_0x4bd557(0x176)+_0xfa02a2[_0x4bd557(0x162)](',\x20');return undefined;}async[a31_0x420002(0x16e)](_0x11dbde){const _0x4f3a34=a31_0x420002,{args:_0x4c4101,options:_0x5ad2a9}=_0x11dbde;try{const _0xfacafd=_0x4c4101[0x0],_0x530225=_0x4c4101[0x1];if(_0xfacafd===_0x4f3a34(0x15e)){if(!profileExists(_0x530225))return console[_0x4f3a34(0x15a)](_0x4f3a34(0x165)+_0x530225+_0x4f3a34(0x168)),console[_0x4f3a34(0x15a)]('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x25ceb2=_0x5ad2a9['session']||getCurrentSessionPID()[_0x4f3a34(0x15d)]();return saveSessionContext({'profile':_0x530225},_0x5ad2a9[_0x4f3a34(0x159)]),console['log'](_0x4f3a34(0x153)+_0x530225+_0x4f3a34(0x169)+_0x25ceb2+')'),console['log']('\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}const _0x4873ac={},_0x506b1f=_0x5ad2a9[_0x4f3a34(0x159)]||getCurrentSessionPID()[_0x4f3a34(0x15d)]();switch(_0xfacafd){case _0x4f3a34(0x151):_0x4873ac[_0x4f3a34(0x151)]=_0x530225,console[_0x4f3a34(0x164)](_0x4f3a34(0x16f)+_0x530225+_0x4f3a34(0x169)+_0x506b1f+')');break;case _0x4f3a34(0x158):_0x4873ac['parent_segment']=_0x530225,console[_0x4f3a34(0x164)](_0x4f3a34(0x177)+_0x530225+_0x4f3a34(0x169)+_0x506b1f+')');break;case _0x4f3a34(0x178):_0x4873ac[_0x4f3a34(0x178)]=_0x530225,console[_0x4f3a34(0x164)](_0x4f3a34(0x15f)+_0x530225+_0x4f3a34(0x169)+_0x506b1f+')');break;}return saveSessionContext(_0x4873ac,_0x5ad2a9['session']),console[_0x4f3a34(0x164)](_0x4f3a34(0x16a)),0x0;}catch(_0x2ec8f5){return _0x2ec8f5 instanceof Error&&console[_0x4f3a34(0x15a)]('Error:\x20'+_0x2ec8f5[_0x4f3a34(0x171)]),0x1;}}}
@@ -1 +1 @@
1
- const a32_0x4580ee=a32_0x267e;(function(_0x5a9c6e,_0x146e4e){const _0x1eb316=a32_0x267e,_0x5112dd=_0x5a9c6e();while(!![]){try{const _0x8963e2=parseInt(_0x1eb316(0x1a1))/0x1*(parseInt(_0x1eb316(0x1c0))/0x2)+-parseInt(_0x1eb316(0x1f5))/0x3+-parseInt(_0x1eb316(0x1ee))/0x4*(parseInt(_0x1eb316(0x1f1))/0x5)+-parseInt(_0x1eb316(0x19e))/0x6*(-parseInt(_0x1eb316(0x1c9))/0x7)+parseInt(_0x1eb316(0x1d0))/0x8*(parseInt(_0x1eb316(0x195))/0x9)+-parseInt(_0x1eb316(0x19f))/0xa+parseInt(_0x1eb316(0x1e4))/0xb*(parseInt(_0x1eb316(0x1c4))/0xc);if(_0x8963e2===_0x146e4e)break;else _0x5112dd['push'](_0x5112dd['shift']());}catch(_0x2c66e9){_0x5112dd['push'](_0x5112dd['shift']());}}}(a32_0x583e,0x69054));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_0x4580ee(0x1b6);[a32_0x4580ee(0x18a)]='List\x20all\x20workflow\x20projects';async[a32_0x4580ee(0x17d)](_0x4d9650){const _0x275e38=a32_0x4580ee,{options:_0x4d34f9,args:_0x36d016,tdx:_0x110972}=_0x4d9650,_0x3d3cc9=_0x36d016[0x0];try{_0x4d34f9[_0x275e38(0x1d1)]&&_0x3d3cc9&&console[_0x275e38(0x1dd)](_0x275e38(0x1c2)+_0x3d3cc9);const _0x3b4cee=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x110972[_0x275e38(0x1d9)][_0x275e38(0x1ec)](_0x3d3cc9,{'limit':_0x4d34f9[_0x275e38(0x1ef)]}),{'verbose':_0x4d34f9[_0x275e38(0x1d1)]}),_0x280a92=_0x3b4cee[_0x275e38(0x199)];return console[_0x275e38(0x1dd)](_0x275e38(0x1a3)+_0x280a92[_0x275e38(0x1a6)]+_0x275e38(0x1a4)+(_0x280a92[_0x275e38(0x1a6)]!==0x1?'s':'')),await handleSDKOutput(_0x280a92,_0x4d34f9),0x0;}catch(_0x4bbf85){if(_0x4bbf85 instanceof SDKError)return console[_0x275e38(0x1dd)](_0x275e38(0x1cb)+_0x4bbf85[_0x275e38(0x191)]),_0x4bbf85[_0x275e38(0x179)]&&console['error'](_0x275e38(0x1b5)+_0x4bbf85['cause']),0x1;throw _0x4bbf85;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a32_0x4580ee(0x178)]='workflow:workflows';['description']=a32_0x4580ee(0x18e);async[a32_0x4580ee(0x17d)](_0x38510a){const _0x4ccc16=a32_0x4580ee,{options:_0x27ec01,args:_0x30139d,tdx:_0x5bb779}=_0x38510a,_0x5d1fa5=_0x30139d[0x0];try{_0x27ec01[_0x4ccc16(0x1d1)]&&_0x5d1fa5&&console[_0x4ccc16(0x1dd)](_0x4ccc16(0x1be)+_0x5d1fa5);const _0xdc17b2=await withSpinner(_0x4ccc16(0x1f0),()=>_0x5bb779['workflow'][_0x4ccc16(0x173)](_0x5d1fa5,{'limit':_0x27ec01['limit']}),{'verbose':_0x27ec01[_0x4ccc16(0x1d1)]}),_0x1e9258=_0xdc17b2['data'];return console['error'](_0x4ccc16(0x1a3)+_0x1e9258['length']+_0x4ccc16(0x1d2)+(_0x1e9258['length']!==0x1?'s':'')),await handleSDKOutput(_0x1e9258,_0x27ec01),0x0;}catch(_0x1276ff){if(_0x1276ff instanceof SDKError)return console['error'](_0x4ccc16(0x1cb)+_0x1276ff['message']),_0x1276ff[_0x4ccc16(0x179)]&&console[_0x4ccc16(0x1dd)](_0x4ccc16(0x1b5)+_0x1276ff[_0x4ccc16(0x179)]),0x1;throw _0x1276ff;}}}export class WorkflowSessionsCommand extends BaseCommand{['name']='workflow:sessions';[a32_0x4580ee(0x18a)]=a32_0x4580ee(0x1f2);async[a32_0x4580ee(0x17d)](_0x48ab9c){const _0x12d267=a32_0x4580ee,{options:_0x6bf134,args:_0x5a993d,tdx:_0x495fb7}=_0x48ab9c;let _0x1d4c1a,_0x169fce;if(_0x5a993d[0x0]){const _0x4a35b1=_0x5a993d[0x0]['split']('.');if(_0x4a35b1[_0x12d267(0x1a6)]===0x1)_0x1d4c1a=_0x4a35b1[0x0];else{if(_0x4a35b1[_0x12d267(0x1a6)]===0x2)[_0x1d4c1a,_0x169fce]=_0x4a35b1;else return console[_0x12d267(0x1dd)]('Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),0x1;}}try{if(_0x6bf134['verbose']){if(_0x1d4c1a&&_0x169fce)console['error'](_0x12d267(0x1ab)+_0x1d4c1a+'.'+_0x169fce);else _0x1d4c1a&&console['error'](_0x12d267(0x1df)+_0x1d4c1a);const _0x27d314=_0x6bf134[_0x12d267(0x1dc)];_0x27d314&&console[_0x12d267(0x1dd)](_0x12d267(0x17f)+_0x27d314);}const _0x283363=await withSpinner(_0x12d267(0x1ea),()=>_0x495fb7[_0x12d267(0x1d9)][_0x12d267(0x1a0)]({'projectName':_0x1d4c1a,'workflowName':_0x169fce,'status':_0x6bf134[_0x12d267(0x1dc)],'fromTime':_0x6bf134[_0x12d267(0x1cf)],'toTime':_0x6bf134['to'],'limit':_0x6bf134['limit']}),{'verbose':_0x6bf134['verbose']}),_0x14790a=_0x283363[_0x12d267(0x199)];return console[_0x12d267(0x1dd)](_0x12d267(0x1a3)+_0x14790a[_0x12d267(0x1a6)]+_0x12d267(0x1f4)+(_0x14790a['length']!==0x1?'s':'')),await handleSDKOutput(_0x14790a,_0x6bf134),0x0;}catch(_0x19ad0a){if(_0x19ad0a instanceof SDKError)return console['error'](_0x12d267(0x1cb)+_0x19ad0a['message']),_0x19ad0a['cause']&&console[_0x12d267(0x1dd)](_0x12d267(0x1b5)+_0x19ad0a[_0x12d267(0x179)]),0x1;throw _0x19ad0a;}}}export class WorkflowAttemptsCommand extends BaseCommand{['name']=a32_0x4580ee(0x1ac);[a32_0x4580ee(0x18a)]=a32_0x4580ee(0x1aa);async['execute'](_0x5c6a88){const _0x3c8653=a32_0x4580ee,{options:_0x5ba02d,args:_0x5f05fc,tdx:_0x3e46e7}=_0x5c6a88;let _0x545001,_0x5e1773;if(_0x5f05fc[0x0]){const _0x337581=_0x5f05fc[0x0][_0x3c8653(0x1fb)]('.');if(_0x337581[_0x3c8653(0x1a6)]===0x1)_0x545001=_0x337581[0x0];else{if(_0x337581[_0x3c8653(0x1a6)]===0x2)[_0x545001,_0x5e1773]=_0x337581;else return console['error'](_0x3c8653(0x1db)),0x1;}}try{const _0x4d2593=_0x5ba02d[_0x3c8653(0x17a)];if(_0x5ba02d[_0x3c8653(0x1d1)]){if(_0x545001&&_0x5e1773)console[_0x3c8653(0x1dd)](_0x3c8653(0x1ab)+_0x545001+'.'+_0x5e1773);else _0x545001&&console['error'](_0x3c8653(0x1df)+_0x545001);_0x4d2593&&console['error'](_0x3c8653(0x1f6));}const _0x779020=await withSpinner(_0x3c8653(0x189),()=>_0x3e46e7[_0x3c8653(0x1d9)][_0x3c8653(0x1ba)]({'projectName':_0x545001,'workflowName':_0x5e1773,'includeRetried':_0x4d2593,'limit':_0x5ba02d['limit']}),{'verbose':_0x5ba02d[_0x3c8653(0x1d1)]}),_0x1b1ce0=_0x779020[_0x3c8653(0x199)];return console[_0x3c8653(0x1dd)](_0x3c8653(0x1a3)+_0x1b1ce0['length']+_0x3c8653(0x1f8)+(_0x1b1ce0['length']!==0x1?'s':'')),await handleSDKOutput(_0x1b1ce0,_0x5ba02d),0x0;}catch(_0x2f06a1){if(_0x2f06a1 instanceof SDKError)return console[_0x3c8653(0x1dd)](_0x3c8653(0x1cb)+_0x2f06a1['message']),_0x2f06a1[_0x3c8653(0x179)]&&console[_0x3c8653(0x1dd)](_0x3c8653(0x1b5)+_0x2f06a1[_0x3c8653(0x179)]),0x1;throw _0x2f06a1;}}}export class WorkflowAttemptCommand extends BaseCommand{[a32_0x4580ee(0x178)]=a32_0x4580ee(0x1b9);[a32_0x4580ee(0x18a)]='Show\x20specific\x20attempt\x20details';async[a32_0x4580ee(0x17d)](_0x57b273){const _0x184a7a=a32_0x4580ee,{options:_0x45c2a4,args:_0x3a3ea3,tdx:_0x236516}=_0x57b273,_0x72f76a=_0x3a3ea3[0x0];if(!_0x72f76a)return console[_0x184a7a(0x1dd)](_0x184a7a(0x1ce)),0x1;try{_0x45c2a4[_0x184a7a(0x1d1)]&&console[_0x184a7a(0x1dd)]('Attempt\x20ID:\x20'+_0x72f76a);const _0x393d52=await withSpinner(_0x184a7a(0x1bc),()=>_0x236516[_0x184a7a(0x1d9)][_0x184a7a(0x18b)](_0x72f76a),{'verbose':_0x45c2a4[_0x184a7a(0x1d1)]}),_0x2743b2=_0x393d52[_0x184a7a(0x199)];return await handleSDKOutput([_0x2743b2],_0x45c2a4),0x0;}catch(_0x514e93){if(_0x514e93 instanceof SDKError)return console['error'](_0x184a7a(0x1cb)+_0x514e93[_0x184a7a(0x191)]),_0x514e93[_0x184a7a(0x179)]&&console[_0x184a7a(0x1dd)](_0x184a7a(0x1b5)+_0x514e93[_0x184a7a(0x179)]),0x1;throw _0x514e93;}}}function a32_0x267e(_0x26aad9,_0x2e9996){const _0x583e7b=a32_0x583e();return a32_0x267e=function(_0x267ece,_0xf90018){_0x267ece=_0x267ece-0x173;let _0xb4a06a=_0x583e7b[_0x267ece];return _0xb4a06a;},a32_0x267e(_0x26aad9,_0x2e9996);}export class WorkflowTasksCommand extends BaseCommand{[a32_0x4580ee(0x178)]=a32_0x4580ee(0x1b8);[a32_0x4580ee(0x18a)]=a32_0x4580ee(0x184);async[a32_0x4580ee(0x17d)](_0x4022ea){const _0x64cdcb=a32_0x4580ee,{options:_0x10f0db,args:_0x458d9b,tdx:_0x128920}=_0x4022ea,_0x385b70=_0x458d9b[0x0];if(!_0x385b70)return console['error'](_0x64cdcb(0x1ce)),0x1;try{const _0x2d8824=_0x10f0db[_0x64cdcb(0x196)];_0x10f0db[_0x64cdcb(0x1d1)]&&(console[_0x64cdcb(0x1dd)](_0x64cdcb(0x183)+_0x385b70),_0x2d8824&&console[_0x64cdcb(0x1dd)]('Including\x20subtasks:\x20yes'));const _0x68361b=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x128920['workflow'][_0x64cdcb(0x1a5)](_0x385b70,_0x2d8824||![]),{'verbose':_0x10f0db[_0x64cdcb(0x1d1)]}),_0xd0d796=_0x68361b['data'];return console[_0x64cdcb(0x1dd)](_0x64cdcb(0x1a3)+_0xd0d796[_0x64cdcb(0x1a6)]+_0x64cdcb(0x187)+(_0xd0d796[_0x64cdcb(0x1a6)]!==0x1?'s':'')),await handleSDKOutput(_0xd0d796,_0x10f0db),0x0;}catch(_0x36aab3){if(_0x36aab3 instanceof SDKError)return console[_0x64cdcb(0x1dd)](_0x64cdcb(0x1cb)+_0x36aab3[_0x64cdcb(0x191)]),_0x36aab3['cause']&&console[_0x64cdcb(0x1dd)](_0x64cdcb(0x1b5)+_0x36aab3[_0x64cdcb(0x179)]),0x1;throw _0x36aab3;}}}export class WorkflowLogsCommand extends BaseCommand{[a32_0x4580ee(0x178)]=a32_0x4580ee(0x19d);[a32_0x4580ee(0x18a)]=a32_0x4580ee(0x180);async[a32_0x4580ee(0x17d)](_0x438959){const _0x49d900=a32_0x4580ee,{options:_0x4c5f3b,args:_0x4c0e66,tdx:_0x4128f0}=_0x438959,_0x2b07b4=_0x4c0e66[0x0],_0x2ae2b6=_0x4c0e66[0x1];if(!_0x2b07b4||!_0x2ae2b6)return console['error'](_0x49d900(0x18c)),0x1;try{_0x4c5f3b['verbose']&&(console[_0x49d900(0x1dd)](_0x49d900(0x183)+_0x2b07b4),console[_0x49d900(0x1dd)](_0x49d900(0x186)+_0x2ae2b6));const _0x24f333=_0x4c5f3b['offset'],_0x3a3874=await withSpinner(_0x49d900(0x1c3),()=>_0x4128f0[_0x49d900(0x1d9)][_0x49d900(0x1eb)](_0x2b07b4,_0x2ae2b6,{'offset':_0x24f333,'limit':_0x4c5f3b['limit']}),{'verbose':_0x4c5f3b[_0x49d900(0x1d1)]}),_0x3477d3=_0x3a3874[_0x49d900(0x199)];return console[_0x49d900(0x1dd)](_0x49d900(0x1a3)+_0x3477d3[_0x49d900(0x1a6)]+_0x49d900(0x19a)+(_0x3477d3[_0x49d900(0x1a6)]!==0x1?_0x49d900(0x1f9):'y')),await handleSDKOutput(_0x3477d3,_0x4c5f3b),0x0;}catch(_0x3e9032){if(_0x3e9032 instanceof SDKError)return console[_0x49d900(0x1dd)](_0x49d900(0x1cb)+_0x3e9032['message']),_0x3e9032[_0x49d900(0x179)]&&console[_0x49d900(0x1dd)](_0x49d900(0x1b5)+_0x3e9032['cause']),0x1;throw _0x3e9032;}}}function a32_0x583e(){const _0x458448=['Error:\x20Project\x20name\x20is\x20required','✔\x20Pushed\x20','List\x20workflow\x20attempts','Filter:\x20','workflow:attempts','yes','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Reason:\x20','retryAttempt','Validation:\x20skipped','skipValidation','workflow:delete','\x20\x20Cause:\x20','workflow:projects','reason','workflow:tasks','workflow:attempt','attempts','\x20is\x20not\x20a\x20directory','Getting\x20attempt\x20details...','projectId','Project\x20filter:\x20','Cancelled','70744FdmXuJ','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Pattern:\x20','Getting\x20task\x20logs...','5538684yGprCz','resumeFrom','startsWith','projectName','workflow:kill','14QsUiHA','\x20\x20Project\x20ID:\x20','Error:\x20','Error:\x20Invalid\x20JSON\x20in\x20--params','Usage:\x20workflow:delete\x20<project-name-or-id>','Error:\x20Attempt\x20ID\x20is\x20required','from','1673624yNBVxc','verbose','\x20workflow','stat','fs/promises','isDirectory','\x20\x20New\x20attempt\x20ID:\x20','Project\x20name:\x20','workflow:retry','workflow','session:','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','status','error','params','Filter:\x20project=','fromTask','Project\x20directory:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','filesExtracted','22rlnyZv','push','Params:\x20','workflow:download','Retrying\x20attempt...','Pushing\x20workflow\x20project...','Listing\x20workflow\x20sessions...','logs','projects','retrySession','12rONXuL','limit','Listing\x20workflows...','714785YGwGxD','List\x20workflow\x20execution\x20sessions','Kill\x20a\x20running\x20attempt','\x20session','1727052vgHRzm','Include\x20retried:\x20yes','Retry\x20a\x20session\x20or\x20attempt','\x20attempt','ies','Project:\x20','split','✔\x20Deleted\x20project\x20','workflows','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','...','workflow:push','Force:\x20yes','name','cause','includeRetried','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','revision','execute','\x20\x20Location:\x20','Status:\x20','Show\x20logs\x20for\x20a\x20specific\x20task','utf-8','Resume\x20from:\x20','Attempt\x20ID:\x20','Show\x20tasks\x20for\x20an\x20attempt','✔\x20Downloaded\x20','Task\x20name:\x20','\x20task','substring','Listing\x20workflow\x20attempts...','description','attempt','Error:\x20Attempt\x20ID\x20and\x20task\x20name\x20are\x20required','Output\x20directory:\x20','List\x20workflows','delete','Downloading\x20project\x20','message','download','Deleting\x20project\x20','attempt:','36DWpQhm','includeSubtasks','parse','session','data','\x20log\x20entr','Revision:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','workflow:logs','218850EAefuT','4689010VoIHlA','sessions','2amVQmR','\x20\x20Revision:\x20','✔\x20Found\x20','\x20project','tasks','length','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'];a32_0x583e=function(){return _0x458448;};return a32_0x583e();}export class WorkflowKillCommand extends BaseCommand{[a32_0x4580ee(0x178)]=a32_0x4580ee(0x1c8);[a32_0x4580ee(0x18a)]=a32_0x4580ee(0x1f3);async[a32_0x4580ee(0x17d)](_0x25f53e){const _0x322b15=a32_0x4580ee,{options:_0x32293e,args:_0x55bec7,tdx:_0x14fa95}=_0x25f53e,_0x2bf901=_0x55bec7[0x0];if(!_0x2bf901)return console[_0x322b15(0x1dd)](_0x322b15(0x1ce)),0x1;try{const _0x2ae250=_0x32293e[_0x322b15(0x1b7)];_0x32293e['verbose']&&(console[_0x322b15(0x1dd)](_0x322b15(0x183)+_0x2bf901),_0x2ae250&&console['error'](_0x322b15(0x1b0)+_0x2ae250));if(!_0x32293e[_0x322b15(0x1ad)]){const _0x5cd021=await confirm(_0x322b15(0x174)+_0x2bf901+'?');if(!_0x5cd021)return console[_0x322b15(0x1dd)]('Cancelled'),0x0;}const _0xcb2989=await withSpinner('Killing\x20attempt...',()=>_0x14fa95['workflow']['kill'](_0x2bf901,_0x2ae250),{'verbose':_0x32293e[_0x322b15(0x1d1)]}),_0x4f94e3=_0xcb2989[_0x322b15(0x199)];return console[_0x322b15(0x1dd)]('✔\x20'+_0x4f94e3),0x0;}catch(_0x5d29da){if(_0x5d29da instanceof SDKError)return console[_0x322b15(0x1dd)]('Error:\x20'+_0x5d29da[_0x322b15(0x191)]),_0x5d29da[_0x322b15(0x179)]&&console[_0x322b15(0x1dd)](_0x322b15(0x1b5)+_0x5d29da[_0x322b15(0x179)]),0x1;throw _0x5d29da;}}}export class WorkflowRetryCommand extends BaseCommand{['name']=a32_0x4580ee(0x1d8);[a32_0x4580ee(0x18a)]=a32_0x4580ee(0x1f7);async[a32_0x4580ee(0x17d)](_0x4ab6bc){const _0x3a9e45=a32_0x4580ee,{options:_0x274d81,args:_0x426970,tdx:_0x15172c}=_0x4ab6bc,_0x354e1b=_0x426970[0x0];if(!_0x354e1b)return console[_0x3a9e45(0x1dd)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x3a9e45(0x1dd)](_0x3a9e45(0x19c)),0x1;let _0x2dc01e=![],_0x5f0063=_0x354e1b;if(_0x354e1b[_0x3a9e45(0x1c6)](_0x3a9e45(0x1da)))_0x2dc01e=!![],_0x5f0063=_0x354e1b[_0x3a9e45(0x188)](0x8);else{if(_0x354e1b[_0x3a9e45(0x1c6)](_0x3a9e45(0x194)))_0x2dc01e=![],_0x5f0063=_0x354e1b[_0x3a9e45(0x188)](0x8);else return console[_0x3a9e45(0x1dd)](_0x3a9e45(0x17b)),console[_0x3a9e45(0x1dd)](_0x3a9e45(0x19c)),0x1;}try{const _0x534513=_0x274d81[_0x3a9e45(0x1e0)],_0x1d57a2=_0x274d81[_0x3a9e45(0x1c5)],_0x5343e9=_0x274d81[_0x3a9e45(0x1de)],_0x321218=_0x274d81['force'];_0x274d81['verbose']&&(console[_0x3a9e45(0x1dd)]('Target:\x20'+(_0x2dc01e?'session':_0x3a9e45(0x18b))+'\x20'+_0x5f0063),_0x534513&&console['error']('From\x20task:\x20'+_0x534513),_0x1d57a2&&console[_0x3a9e45(0x1dd)](_0x3a9e45(0x182)+_0x1d57a2),_0x5343e9&&console[_0x3a9e45(0x1dd)](_0x3a9e45(0x1e6)+_0x5343e9),_0x321218&&console[_0x3a9e45(0x1dd)](_0x3a9e45(0x177)));let _0x1969d3;if(_0x5343e9)try{if(_0x5343e9[_0x3a9e45(0x1c6)]('@')){const _0x523525=await import(_0x3a9e45(0x1d4)),_0x4be7b5=_0x5343e9[_0x3a9e45(0x188)](0x1),_0x29b5e1=await _0x523525['readFile'](_0x4be7b5,_0x3a9e45(0x181));_0x1969d3=JSON[_0x3a9e45(0x197)](_0x29b5e1);}else _0x1969d3=JSON['parse'](_0x5343e9);}catch{return console[_0x3a9e45(0x1dd)](_0x3a9e45(0x1cc)),0x1;}if(!_0x274d81[_0x3a9e45(0x1ad)]){const _0x24505c=await confirm(_0x3a9e45(0x1af)+(_0x2dc01e?_0x3a9e45(0x198):_0x3a9e45(0x18b))+'\x20'+_0x5f0063+'?');if(!_0x24505c)return console[_0x3a9e45(0x1dd)]('Cancelled'),0x0;}let _0x2e1811;_0x2dc01e?_0x2e1811=await withSpinner('Retrying\x20session...',()=>_0x15172c[_0x3a9e45(0x1d9)][_0x3a9e45(0x1ed)](_0x5f0063,{'fromTask':_0x534513,'retryParams':_0x1969d3}),{'verbose':_0x274d81[_0x3a9e45(0x1d1)]}):_0x2e1811=await withSpinner(_0x3a9e45(0x1e8),()=>_0x15172c['workflow'][_0x3a9e45(0x1b1)](_0x5f0063,{'resumeFrom':_0x1d57a2,'retryParams':_0x1969d3,'force':_0x321218}),{'verbose':_0x274d81[_0x3a9e45(0x1d1)]});const _0x25c90e=_0x2e1811[_0x3a9e45(0x199)];return console[_0x3a9e45(0x1dd)]('✔\x20Retry\x20started'),console[_0x3a9e45(0x1dd)](_0x3a9e45(0x1d6)+_0x25c90e['attemptId']),console[_0x3a9e45(0x1dd)]('\x20\x20Session\x20ID:\x20'+_0x25c90e['sessionId']),0x0;}catch(_0x21510b){if(_0x21510b instanceof SDKError)return console['error'](_0x3a9e45(0x1cb)+_0x21510b[_0x3a9e45(0x191)]),_0x21510b[_0x3a9e45(0x179)]&&console[_0x3a9e45(0x1dd)]('\x20\x20Cause:\x20'+_0x21510b[_0x3a9e45(0x179)]),0x1;throw _0x21510b;}}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a32_0x4580ee(0x1e7);[a32_0x4580ee(0x18a)]=a32_0x4580ee(0x1c1);async[a32_0x4580ee(0x17d)](_0x534480){const _0x5e2da7=a32_0x4580ee,{options:_0x161722,args:_0x2fb3ee,tdx:_0x501481}=_0x534480,_0x20f1ce=_0x2fb3ee[0x0],_0x5ae72d=_0x2fb3ee[0x1]||'.';if(!_0x20f1ce)return console[_0x5e2da7(0x1dd)](_0x5e2da7(0x1a8)),console['error'](_0x5e2da7(0x1ae)),0x1;const _0x534ca3=_0x161722['revision'];_0x161722[_0x5e2da7(0x1d1)]&&(console[_0x5e2da7(0x1dd)]('Project:\x20'+_0x20f1ce),console['error'](_0x5e2da7(0x18d)+_0x5ae72d),_0x534ca3&&console[_0x5e2da7(0x1dd)]('Revision:\x20'+_0x534ca3));const _0x3e3a7e=await withSpinner(_0x5e2da7(0x190)+_0x20f1ce+_0x5e2da7(0x175),()=>_0x501481[_0x5e2da7(0x1d9)][_0x5e2da7(0x192)](_0x20f1ce,_0x5ae72d,{'revision':_0x534ca3}),{'verbose':_0x161722[_0x5e2da7(0x1d1)]}),_0x1931d9=_0x3e3a7e[_0x5e2da7(0x199)];return console[_0x5e2da7(0x1dd)](_0x5e2da7(0x185)+_0x1931d9[_0x5e2da7(0x1c7)]),console[_0x5e2da7(0x1dd)]('\x20\x20Revision:\x20'+_0x1931d9[_0x5e2da7(0x17c)]),console['error']('\x20\x20Files\x20extracted:\x20'+_0x1931d9[_0x5e2da7(0x1e3)]),console[_0x5e2da7(0x1dd)](_0x5e2da7(0x17e)+_0x5ae72d+'/'+_0x1931d9[_0x5e2da7(0x1c7)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a32_0x4580ee(0x178)]=a32_0x4580ee(0x176);[a32_0x4580ee(0x18a)]='Push\x20workflow\x20project\x20to\x20Treasure\x20Data';async[a32_0x4580ee(0x17d)](_0x73a31){const _0x52be1e=a32_0x4580ee,{options:_0x2c50af,args:_0xfabb92,tdx:_0x2b41cf}=_0x73a31;let _0x435bb6='.',_0x362e86=_0x2c50af[_0x52be1e(0x178)];if(_0xfabb92[0x0]){const {promises:_0x2a56ce}=await import('fs');try{const _0xa9b061=await _0x2a56ce[_0x52be1e(0x1d3)](_0xfabb92[0x0]);if(_0xa9b061[_0x52be1e(0x1d5)]())_0x435bb6=_0xfabb92[0x0];else return console[_0x52be1e(0x1dd)]('Error:\x20'+_0xfabb92[0x0]+_0x52be1e(0x1bb)),0x1;}catch{_0x362e86=_0xfabb92[0x0],_0x435bb6='.';}}const _0x59a6d4=_0x2c50af[_0x52be1e(0x17c)],_0x32a792=_0x2c50af[_0x52be1e(0x1b3)];_0x2c50af['verbose']&&(console[_0x52be1e(0x1dd)](_0x52be1e(0x1e1)+_0x435bb6),_0x362e86&&console[_0x52be1e(0x1dd)](_0x52be1e(0x1d7)+_0x362e86),_0x59a6d4&&console['error'](_0x52be1e(0x19b)+_0x59a6d4),_0x32a792&&console['error'](_0x52be1e(0x1b2)));const _0x38d87d=await withSpinner(_0x52be1e(0x1e9),()=>_0x2b41cf[_0x52be1e(0x1d9)][_0x52be1e(0x1e5)](_0x435bb6,{'projectName':_0x362e86,'revision':_0x59a6d4,'skipValidation':_0x32a792}),{'verbose':_0x2c50af[_0x52be1e(0x1d1)]}),_0x112b1f=_0x38d87d[_0x52be1e(0x199)];return console[_0x52be1e(0x1dd)](_0x52be1e(0x1a9)+_0x112b1f['projectName']),console[_0x52be1e(0x1dd)]('\x20\x20Project\x20ID:\x20'+_0x112b1f[_0x52be1e(0x1bd)]),console[_0x52be1e(0x1dd)](_0x52be1e(0x1a2)+_0x112b1f['revision']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a32_0x4580ee(0x1b4);[a32_0x4580ee(0x18a)]=a32_0x4580ee(0x1e2);async[a32_0x4580ee(0x17d)](_0x1492ee){const _0x2e797d=a32_0x4580ee,{options:_0xc48492,args:_0x1256f8,tdx:_0x549ea5}=_0x1492ee,_0x611f88=_0x1256f8[0x0];if(!_0x611f88)return console['error'](_0x2e797d(0x1a7)),console[_0x2e797d(0x1dd)](_0x2e797d(0x1cd)),0x1;_0xc48492[_0x2e797d(0x1d1)]&&console[_0x2e797d(0x1dd)](_0x2e797d(0x1fa)+_0x611f88);if(!_0xc48492['yes']){const _0x42a990=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x611f88+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x42a990)return console[_0x2e797d(0x1dd)](_0x2e797d(0x1bf)),0x0;}const _0x1c06ec=await withSpinner(_0x2e797d(0x193)+_0x611f88+_0x2e797d(0x175),()=>_0x549ea5[_0x2e797d(0x1d9)][_0x2e797d(0x18f)](_0x611f88),{'verbose':_0xc48492['verbose']}),_0x22e196=_0x1c06ec[_0x2e797d(0x199)];return console[_0x2e797d(0x1dd)](_0x2e797d(0x1fc)+_0x22e196[_0x2e797d(0x1c7)]),console['error'](_0x2e797d(0x1ca)+_0x22e196[_0x2e797d(0x1bd)]),0x0;}}
1
+ const a32_0x1bcf71=a32_0x7a82;(function(_0x441218,_0xc891f4){const _0x27d462=a32_0x7a82,_0x3e01e2=_0x441218();while(!![]){try{const _0x13e70e=-parseInt(_0x27d462(0xa1))/0x1*(parseInt(_0x27d462(0xab))/0x2)+-parseInt(_0x27d462(0x91))/0x3+parseInt(_0x27d462(0xcc))/0x4*(-parseInt(_0x27d462(0x93))/0x5)+parseInt(_0x27d462(0xcb))/0x6+-parseInt(_0x27d462(0xef))/0x7*(-parseInt(_0x27d462(0xfe))/0x8)+parseInt(_0x27d462(0xa4))/0x9+parseInt(_0x27d462(0x9c))/0xa*(parseInt(_0x27d462(0x87))/0xb);if(_0x13e70e===_0xc891f4)break;else _0x3e01e2['push'](_0x3e01e2['shift']());}catch(_0x20f3a9){_0x3e01e2['push'](_0x3e01e2['shift']());}}}(a32_0x294f,0xf3464));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a32_0x7a82(_0x4f989c,_0x3d9074){const _0x294f53=a32_0x294f();return a32_0x7a82=function(_0x7a8206,_0x18dbbb){_0x7a8206=_0x7a8206-0x87;let _0x422fb8=_0x294f53[_0x7a8206];return _0x422fb8;},a32_0x7a82(_0x4f989c,_0x3d9074);}import{confirm}from'../utils/prompt.js';export class WorkflowProjectsCommand extends BaseCommand{[a32_0x1bcf71(0xb1)]='workflow:projects';[a32_0x1bcf71(0x100)]='List\x20all\x20workflow\x20projects';async[a32_0x1bcf71(0xc0)](_0xf369e5){const _0x5ae726=a32_0x1bcf71,{options:_0x19d3d7,args:_0x3488db,tdx:_0x4d2c50}=_0xf369e5,_0x20cef1=_0x3488db[0x0];try{_0x19d3d7['verbose']&&_0x20cef1&&console[_0x5ae726(0xe4)](_0x5ae726(0x8e)+_0x20cef1);const _0x1d8bc3=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x4d2c50[_0x5ae726(0x9a)][_0x5ae726(0xed)](_0x20cef1,{'limit':_0x19d3d7[_0x5ae726(0xd8)]}),{'verbose':_0x19d3d7['verbose']}),_0x4c4888=_0x1d8bc3[_0x5ae726(0x99)];return console[_0x5ae726(0xe4)]('✔\x20Found\x20'+_0x4c4888[_0x5ae726(0xc6)]+_0x5ae726(0xb6)+(_0x4c4888['length']!==0x1?'s':'')),await handleSDKOutput(_0x4c4888,_0x19d3d7),0x0;}catch(_0x1ddcf7){if(_0x1ddcf7 instanceof SDKError)return console['error'](_0x5ae726(0xd9)+_0x1ddcf7[_0x5ae726(0xf8)]),_0x1ddcf7[_0x5ae726(0xa5)]&&console[_0x5ae726(0xe4)]('\x20\x20Cause:\x20'+_0x1ddcf7[_0x5ae726(0xa5)]),0x1;throw _0x1ddcf7;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a32_0x1bcf71(0xb1)]='workflow:workflows';[a32_0x1bcf71(0x100)]='List\x20workflows';async[a32_0x1bcf71(0xc0)](_0x16f90b){const _0x4e2075=a32_0x1bcf71,{options:_0x5df9b9,args:_0x52929e,tdx:_0x373c23}=_0x16f90b,_0x4568b1=_0x52929e[0x0];try{_0x5df9b9[_0x4e2075(0xec)]&&_0x4568b1&&console['error'](_0x4e2075(0xe9)+_0x4568b1);const _0x4c07c2=await withSpinner(_0x4e2075(0xd1),()=>_0x373c23['workflow']['workflows'](_0x4568b1,{'limit':_0x5df9b9[_0x4e2075(0xd8)]}),{'verbose':_0x5df9b9[_0x4e2075(0xec)]}),_0x1bbca7=_0x4c07c2[_0x4e2075(0x99)];return console['error'](_0x4e2075(0xda)+_0x1bbca7['length']+_0x4e2075(0xff)+(_0x1bbca7[_0x4e2075(0xc6)]!==0x1?'s':'')),await handleSDKOutput(_0x1bbca7,_0x5df9b9),0x0;}catch(_0x172856){if(_0x172856 instanceof SDKError)return console[_0x4e2075(0xe4)](_0x4e2075(0xd9)+_0x172856[_0x4e2075(0xf8)]),_0x172856[_0x4e2075(0xa5)]&&console[_0x4e2075(0xe4)](_0x4e2075(0xfd)+_0x172856[_0x4e2075(0xa5)]),0x1;throw _0x172856;}}}function a32_0x294f(){const _0x4d5d8b=['retryAttempt','Project\x20filter:\x20','sessionId','parse','verbose','projects','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','97741CigkpT','from','download','\x20is\x20not\x20a\x20directory','session','ies','revision','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','split','message','Retrying\x20session...','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Filter:\x20project=','\x20task','\x20\x20Cause:\x20','200HTnjXB','\x20workflow','description','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','attempt:','List\x20workflow\x20attempts','Error:\x20Attempt\x20ID\x20is\x20required','Params:\x20','stat','11OJSXyN','workflow:attempt','Show\x20logs\x20for\x20a\x20specific\x20task','workflow:attempts','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','push','workflow:download','Pattern:\x20','kill','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','2696997dEUozE','Killing\x20attempt...','440LAqanU','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Attempt\x20ID:\x20','Filter:\x20','Output\x20directory:\x20','workflow:sessions','data','workflow','Task\x20name:\x20','6992350ocQtMF','attempts','Getting\x20attempt\x20details...','\x20attempt','\x20\x20New\x20attempt\x20ID:\x20','25gkFnBC','projectId','Downloading\x20project\x20','8269101rwSSvq','cause','\x20\x20Session\x20ID:\x20','session:','Error:\x20Attempt\x20ID\x20and\x20task\x20name\x20are\x20required','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Listing\x20workflow\x20sessions...','23838nOamey','logs','✔\x20Retry\x20started','Revision:\x20','workflow:delete','Project\x20directory:\x20','name','\x22?\x20This\x20cannot\x20be\x20undone.','Project:\x20','...','utf-8','\x20project','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','Getting\x20attempt\x20tasks...','startsWith','✔\x20Deleted\x20project\x20','\x20\x20Location:\x20','includeRetried','delete','Include\x20retried:\x20yes','execute','Error:\x20Project\x20name\x20is\x20required','Pushing\x20workflow\x20project...','\x20\x20Files\x20extracted:\x20','Retrying\x20attempt...','projectName','length','Listing\x20workflow\x20attempts...','From\x20task:\x20','readFile','Retry\x20a\x20session\x20or\x20attempt','5274138ppxohe','29668bISGOR','\x20\x20Revision:\x20','workflow:push','includeSubtasks','force','Listing\x20workflows...','Cancelled','sessions','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','status','skipValidation','Validation:\x20skipped','limit','Error:\x20','✔\x20Found\x20','Reason:\x20','Status:\x20','yes','fs/promises','retrySession','substring','filesExtracted','Target:\x20','attempt','error','Force:\x20yes','\x20\x20Project\x20ID:\x20','Show\x20specific\x20attempt\x20details'];a32_0x294f=function(){return _0x4d5d8b;};return a32_0x294f();}export class WorkflowSessionsCommand extends BaseCommand{[a32_0x1bcf71(0xb1)]=a32_0x1bcf71(0x98);['description']='List\x20workflow\x20execution\x20sessions';async['execute'](_0x3bb8f5){const _0x391f10=a32_0x1bcf71,{options:_0x306084,args:_0x3d8596,tdx:_0x3c36e4}=_0x3bb8f5;let _0x18116e,_0x46a0a3;if(_0x3d8596[0x0]){const _0x291765=_0x3d8596[0x0][_0x391f10(0xf7)]('.');if(_0x291765[_0x391f10(0xc6)]===0x1)_0x18116e=_0x291765[0x0];else{if(_0x291765[_0x391f10(0xc6)]===0x2)[_0x18116e,_0x46a0a3]=_0x291765;else return console['error']('Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),0x1;}}try{if(_0x306084['verbose']){if(_0x18116e&&_0x46a0a3)console[_0x391f10(0xe4)](_0x391f10(0x96)+_0x18116e+'.'+_0x46a0a3);else _0x18116e&&console[_0x391f10(0xe4)]('Filter:\x20project='+_0x18116e);const _0x2e15bd=_0x306084[_0x391f10(0xd5)];_0x2e15bd&&console['error'](_0x391f10(0xdc)+_0x2e15bd);}const _0x35c43e=await withSpinner(_0x391f10(0xaa),()=>_0x3c36e4[_0x391f10(0x9a)][_0x391f10(0xd3)]({'projectName':_0x18116e,'workflowName':_0x46a0a3,'status':_0x306084[_0x391f10(0xd5)],'fromTime':_0x306084[_0x391f10(0xf0)],'toTime':_0x306084['to'],'limit':_0x306084[_0x391f10(0xd8)]}),{'verbose':_0x306084[_0x391f10(0xec)]}),_0x1bf97f=_0x35c43e[_0x391f10(0x99)];return console[_0x391f10(0xe4)]('✔\x20Found\x20'+_0x1bf97f[_0x391f10(0xc6)]+'\x20session'+(_0x1bf97f[_0x391f10(0xc6)]!==0x1?'s':'')),await handleSDKOutput(_0x1bf97f,_0x306084),0x0;}catch(_0x452c97){if(_0x452c97 instanceof SDKError)return console[_0x391f10(0xe4)](_0x391f10(0xd9)+_0x452c97['message']),_0x452c97[_0x391f10(0xa5)]&&console[_0x391f10(0xe4)](_0x391f10(0xfd)+_0x452c97[_0x391f10(0xa5)]),0x1;throw _0x452c97;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a32_0x1bcf71(0xb1)]=a32_0x1bcf71(0x8a);[a32_0x1bcf71(0x100)]=a32_0x1bcf71(0x103);async[a32_0x1bcf71(0xc0)](_0x3ff956){const _0x42c8cb=a32_0x1bcf71,{options:_0x1c4ade,args:_0x30870d,tdx:_0x785e51}=_0x3ff956;let _0x3a3cbd,_0x503d84;if(_0x30870d[0x0]){const _0x12ddc8=_0x30870d[0x0]['split']('.');if(_0x12ddc8['length']===0x1)_0x3a3cbd=_0x12ddc8[0x0];else{if(_0x12ddc8[_0x42c8cb(0xc6)]===0x2)[_0x3a3cbd,_0x503d84]=_0x12ddc8;else return console[_0x42c8cb(0xe4)]('Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),0x1;}}try{const _0x2cc3fa=_0x1c4ade[_0x42c8cb(0xbd)];if(_0x1c4ade[_0x42c8cb(0xec)]){if(_0x3a3cbd&&_0x503d84)console[_0x42c8cb(0xe4)](_0x42c8cb(0x96)+_0x3a3cbd+'.'+_0x503d84);else _0x3a3cbd&&console[_0x42c8cb(0xe4)](_0x42c8cb(0xfb)+_0x3a3cbd);_0x2cc3fa&&console[_0x42c8cb(0xe4)](_0x42c8cb(0xbf));}const _0x214087=await withSpinner(_0x42c8cb(0xc7),()=>_0x785e51[_0x42c8cb(0x9a)][_0x42c8cb(0x9d)]({'projectName':_0x3a3cbd,'workflowName':_0x503d84,'includeRetried':_0x2cc3fa,'limit':_0x1c4ade['limit']}),{'verbose':_0x1c4ade[_0x42c8cb(0xec)]}),_0xf8df3f=_0x214087[_0x42c8cb(0x99)];return console['error'](_0x42c8cb(0xda)+_0xf8df3f[_0x42c8cb(0xc6)]+_0x42c8cb(0x9f)+(_0xf8df3f['length']!==0x1?'s':'')),await handleSDKOutput(_0xf8df3f,_0x1c4ade),0x0;}catch(_0x3085f1){if(_0x3085f1 instanceof SDKError)return console[_0x42c8cb(0xe4)]('Error:\x20'+_0x3085f1[_0x42c8cb(0xf8)]),_0x3085f1[_0x42c8cb(0xa5)]&&console[_0x42c8cb(0xe4)](_0x42c8cb(0xfd)+_0x3085f1[_0x42c8cb(0xa5)]),0x1;throw _0x3085f1;}}}export class WorkflowAttemptCommand extends BaseCommand{[a32_0x1bcf71(0xb1)]=a32_0x1bcf71(0x88);[a32_0x1bcf71(0x100)]=a32_0x1bcf71(0xe7);async[a32_0x1bcf71(0xc0)](_0x526eec){const _0x2eac7e=a32_0x1bcf71,{options:_0x930b17,args:_0x35feb9,tdx:_0x5e5a09}=_0x526eec,_0x27f24c=_0x35feb9[0x0];if(!_0x27f24c)return console[_0x2eac7e(0xe4)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{_0x930b17[_0x2eac7e(0xec)]&&console[_0x2eac7e(0xe4)](_0x2eac7e(0x95)+_0x27f24c);const _0x157d90=await withSpinner(_0x2eac7e(0x9e),()=>_0x5e5a09[_0x2eac7e(0x9a)][_0x2eac7e(0xe3)](_0x27f24c),{'verbose':_0x930b17[_0x2eac7e(0xec)]}),_0x2589d1=_0x157d90['data'];return await handleSDKOutput([_0x2589d1],_0x930b17),0x0;}catch(_0x166bd2){if(_0x166bd2 instanceof SDKError)return console[_0x2eac7e(0xe4)]('Error:\x20'+_0x166bd2[_0x2eac7e(0xf8)]),_0x166bd2[_0x2eac7e(0xa5)]&&console['error']('\x20\x20Cause:\x20'+_0x166bd2[_0x2eac7e(0xa5)]),0x1;throw _0x166bd2;}}}export class WorkflowTasksCommand extends BaseCommand{['name']='workflow:tasks';[a32_0x1bcf71(0x100)]='Show\x20tasks\x20for\x20an\x20attempt';async[a32_0x1bcf71(0xc0)](_0x4644e7){const _0x47009b=a32_0x1bcf71,{options:_0x2ab3bb,args:_0x581dce,tdx:_0x376f22}=_0x4644e7,_0x47e0aa=_0x581dce[0x0];if(!_0x47e0aa)return console[_0x47009b(0xe4)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x33692d=_0x2ab3bb[_0x47009b(0xcf)];_0x2ab3bb['verbose']&&(console[_0x47009b(0xe4)](_0x47009b(0x95)+_0x47e0aa),_0x33692d&&console[_0x47009b(0xe4)]('Including\x20subtasks:\x20yes'));const _0x411699=await withSpinner(_0x47009b(0xb9),()=>_0x376f22[_0x47009b(0x9a)]['tasks'](_0x47e0aa,_0x33692d||![]),{'verbose':_0x2ab3bb['verbose']}),_0x2b2c90=_0x411699['data'];return console['error']('✔\x20Found\x20'+_0x2b2c90[_0x47009b(0xc6)]+_0x47009b(0xfc)+(_0x2b2c90['length']!==0x1?'s':'')),await handleSDKOutput(_0x2b2c90,_0x2ab3bb),0x0;}catch(_0x293e23){if(_0x293e23 instanceof SDKError)return console[_0x47009b(0xe4)](_0x47009b(0xd9)+_0x293e23[_0x47009b(0xf8)]),_0x293e23[_0x47009b(0xa5)]&&console[_0x47009b(0xe4)]('\x20\x20Cause:\x20'+_0x293e23[_0x47009b(0xa5)]),0x1;throw _0x293e23;}}}export class WorkflowLogsCommand extends BaseCommand{['name']='workflow:logs';[a32_0x1bcf71(0x100)]=a32_0x1bcf71(0x89);async[a32_0x1bcf71(0xc0)](_0x19c826){const _0x394714=a32_0x1bcf71,{options:_0x95bac7,args:_0x3ca96c,tdx:_0x24242b}=_0x19c826,_0x1dfcd5=_0x3ca96c[0x0],_0x52f570=_0x3ca96c[0x1];if(!_0x1dfcd5||!_0x52f570)return console[_0x394714(0xe4)](_0x394714(0xa8)),0x1;try{_0x95bac7[_0x394714(0xec)]&&(console[_0x394714(0xe4)]('Attempt\x20ID:\x20'+_0x1dfcd5),console['error'](_0x394714(0x9b)+_0x52f570));const _0x2aa3b9=_0x95bac7['offset'],_0x4e0ae9=await withSpinner('Getting\x20task\x20logs...',()=>_0x24242b[_0x394714(0x9a)][_0x394714(0xac)](_0x1dfcd5,_0x52f570,{'offset':_0x2aa3b9,'limit':_0x95bac7[_0x394714(0xd8)]}),{'verbose':_0x95bac7[_0x394714(0xec)]}),_0x26f6be=_0x4e0ae9[_0x394714(0x99)];return console[_0x394714(0xe4)](_0x394714(0xda)+_0x26f6be['length']+'\x20log\x20entr'+(_0x26f6be[_0x394714(0xc6)]!==0x1?_0x394714(0xf4):'y')),await handleSDKOutput(_0x26f6be,_0x95bac7),0x0;}catch(_0x41c539){if(_0x41c539 instanceof SDKError)return console[_0x394714(0xe4)](_0x394714(0xd9)+_0x41c539[_0x394714(0xf8)]),_0x41c539[_0x394714(0xa5)]&&console[_0x394714(0xe4)](_0x394714(0xfd)+_0x41c539[_0x394714(0xa5)]),0x1;throw _0x41c539;}}}export class WorkflowKillCommand extends BaseCommand{[a32_0x1bcf71(0xb1)]='workflow:kill';[a32_0x1bcf71(0x100)]='Kill\x20a\x20running\x20attempt';async[a32_0x1bcf71(0xc0)](_0x38941d){const _0xfc6c53=a32_0x1bcf71,{options:_0x38eefc,args:_0x2ac009,tdx:_0x526e5b}=_0x38941d,_0x2042b8=_0x2ac009[0x0];if(!_0x2042b8)return console[_0xfc6c53(0xe4)](_0xfc6c53(0x104)),0x1;try{const _0x23148c=_0x38eefc['reason'];_0x38eefc[_0xfc6c53(0xec)]&&(console[_0xfc6c53(0xe4)]('Attempt\x20ID:\x20'+_0x2042b8),_0x23148c&&console[_0xfc6c53(0xe4)](_0xfc6c53(0xdb)+_0x23148c));if(!_0x38eefc[_0xfc6c53(0xdd)]){const _0x5612f1=await confirm(_0xfc6c53(0xb7)+_0x2042b8+'?');if(!_0x5612f1)return console['error'](_0xfc6c53(0xd2)),0x0;}const _0x4b7684=await withSpinner(_0xfc6c53(0x92),()=>_0x526e5b[_0xfc6c53(0x9a)][_0xfc6c53(0x8f)](_0x2042b8,_0x23148c),{'verbose':_0x38eefc[_0xfc6c53(0xec)]}),_0x5ab130=_0x4b7684[_0xfc6c53(0x99)];return console[_0xfc6c53(0xe4)]('✔\x20'+_0x5ab130),0x0;}catch(_0xfdca3e){if(_0xfdca3e instanceof SDKError)return console[_0xfc6c53(0xe4)](_0xfc6c53(0xd9)+_0xfdca3e[_0xfc6c53(0xf8)]),_0xfdca3e['cause']&&console[_0xfc6c53(0xe4)](_0xfc6c53(0xfd)+_0xfdca3e[_0xfc6c53(0xa5)]),0x1;throw _0xfdca3e;}}}export class WorkflowRetryCommand extends BaseCommand{['name']='workflow:retry';[a32_0x1bcf71(0x100)]=a32_0x1bcf71(0xca);async[a32_0x1bcf71(0xc0)](_0x2b11f6){const _0x16d1eb=a32_0x1bcf71,{options:_0x31a8b2,args:_0x1ae16f,tdx:_0xe2eee}=_0x2b11f6,_0x2386e8=_0x1ae16f[0x0];if(!_0x2386e8)return console[_0x16d1eb(0xe4)](_0x16d1eb(0x94)),console[_0x16d1eb(0xe4)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0xbd9099=![],_0x27d3b9=_0x2386e8;if(_0x2386e8[_0x16d1eb(0xba)](_0x16d1eb(0xa7)))_0xbd9099=!![],_0x27d3b9=_0x2386e8[_0x16d1eb(0xe0)](0x8);else{if(_0x2386e8[_0x16d1eb(0xba)](_0x16d1eb(0x102)))_0xbd9099=![],_0x27d3b9=_0x2386e8[_0x16d1eb(0xe0)](0x8);else return console['error'](_0x16d1eb(0x90)),console['error'](_0x16d1eb(0x101)),0x1;}try{const _0x2fbb33=_0x31a8b2['fromTask'],_0x32bb28=_0x31a8b2['resumeFrom'],_0x29363d=_0x31a8b2['params'],_0x384bc5=_0x31a8b2[_0x16d1eb(0xd0)];_0x31a8b2[_0x16d1eb(0xec)]&&(console[_0x16d1eb(0xe4)](_0x16d1eb(0xe2)+(_0xbd9099?'session':_0x16d1eb(0xe3))+'\x20'+_0x27d3b9),_0x2fbb33&&console[_0x16d1eb(0xe4)](_0x16d1eb(0xc8)+_0x2fbb33),_0x32bb28&&console[_0x16d1eb(0xe4)]('Resume\x20from:\x20'+_0x32bb28),_0x29363d&&console[_0x16d1eb(0xe4)](_0x16d1eb(0x105)+_0x29363d),_0x384bc5&&console[_0x16d1eb(0xe4)](_0x16d1eb(0xe5)));let _0x5a5554;if(_0x29363d)try{if(_0x29363d[_0x16d1eb(0xba)]('@')){const _0x4978f4=await import(_0x16d1eb(0xde)),_0x53db62=_0x29363d[_0x16d1eb(0xe0)](0x1),_0x14c99c=await _0x4978f4[_0x16d1eb(0xc9)](_0x53db62,_0x16d1eb(0xb5));_0x5a5554=JSON[_0x16d1eb(0xeb)](_0x14c99c);}else _0x5a5554=JSON['parse'](_0x29363d);}catch{return console['error']('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x31a8b2[_0x16d1eb(0xdd)]){const _0xd44161=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0xbd9099?_0x16d1eb(0xf3):_0x16d1eb(0xe3))+'\x20'+_0x27d3b9+'?');if(!_0xd44161)return console['error'](_0x16d1eb(0xd2)),0x0;}let _0x6b2c12;_0xbd9099?_0x6b2c12=await withSpinner(_0x16d1eb(0xf9),()=>_0xe2eee['workflow'][_0x16d1eb(0xdf)](_0x27d3b9,{'fromTask':_0x2fbb33,'retryParams':_0x5a5554}),{'verbose':_0x31a8b2[_0x16d1eb(0xec)]}):_0x6b2c12=await withSpinner(_0x16d1eb(0xc4),()=>_0xe2eee[_0x16d1eb(0x9a)][_0x16d1eb(0xe8)](_0x27d3b9,{'resumeFrom':_0x32bb28,'retryParams':_0x5a5554,'force':_0x384bc5}),{'verbose':_0x31a8b2[_0x16d1eb(0xec)]});const _0x1f05dd=_0x6b2c12[_0x16d1eb(0x99)];return console[_0x16d1eb(0xe4)](_0x16d1eb(0xad)),console[_0x16d1eb(0xe4)](_0x16d1eb(0xa0)+_0x1f05dd['attemptId']),console[_0x16d1eb(0xe4)](_0x16d1eb(0xa6)+_0x1f05dd[_0x16d1eb(0xea)]),0x0;}catch(_0x568fd6){if(_0x568fd6 instanceof SDKError)return console[_0x16d1eb(0xe4)]('Error:\x20'+_0x568fd6[_0x16d1eb(0xf8)]),_0x568fd6['cause']&&console[_0x16d1eb(0xe4)](_0x16d1eb(0xfd)+_0x568fd6[_0x16d1eb(0xa5)]),0x1;throw _0x568fd6;}}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a32_0x1bcf71(0x8d);[a32_0x1bcf71(0x100)]=a32_0x1bcf71(0xee);async[a32_0x1bcf71(0xc0)](_0x169e5a){const _0x4e81c7=a32_0x1bcf71,{options:_0x244a61,args:_0x412639,tdx:_0x40531a}=_0x169e5a,_0x56111f=_0x412639[0x0],_0x5ab98b=_0x412639[0x1]||'.';if(!_0x56111f)return console[_0x4e81c7(0xe4)](_0x4e81c7(0xc1)),console[_0x4e81c7(0xe4)](_0x4e81c7(0xd4)),0x1;const _0x831e3e=_0x244a61[_0x4e81c7(0xf5)];_0x244a61[_0x4e81c7(0xec)]&&(console[_0x4e81c7(0xe4)](_0x4e81c7(0xb3)+_0x56111f),console[_0x4e81c7(0xe4)](_0x4e81c7(0x97)+_0x5ab98b),_0x831e3e&&console[_0x4e81c7(0xe4)](_0x4e81c7(0xae)+_0x831e3e));const _0x5e51de=await withSpinner(_0x4e81c7(0xa3)+_0x56111f+'...',()=>_0x40531a[_0x4e81c7(0x9a)][_0x4e81c7(0xf1)](_0x56111f,_0x5ab98b,{'revision':_0x831e3e}),{'verbose':_0x244a61[_0x4e81c7(0xec)]}),_0x244225=_0x5e51de[_0x4e81c7(0x99)];return console[_0x4e81c7(0xe4)]('✔\x20Downloaded\x20'+_0x244225['projectName']),console[_0x4e81c7(0xe4)](_0x4e81c7(0xcd)+_0x244225[_0x4e81c7(0xf5)]),console[_0x4e81c7(0xe4)](_0x4e81c7(0xc3)+_0x244225[_0x4e81c7(0xe1)]),console['error'](_0x4e81c7(0xbc)+_0x5ab98b+'/'+_0x244225[_0x4e81c7(0xc5)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a32_0x1bcf71(0xb1)]=a32_0x1bcf71(0xce);[a32_0x1bcf71(0x100)]=a32_0x1bcf71(0x8b);async[a32_0x1bcf71(0xc0)](_0x55a50a){const _0x5841c6=a32_0x1bcf71,{options:_0x5aa6aa,args:_0x23a1b5,tdx:_0x41b0cd}=_0x55a50a;let _0x4813d2='.',_0x214839=_0x5aa6aa[_0x5841c6(0xb1)];if(_0x23a1b5[0x0]){const {promises:_0x1865a3}=await import('fs');try{const _0x46c0d4=await _0x1865a3[_0x5841c6(0x106)](_0x23a1b5[0x0]);if(_0x46c0d4['isDirectory']())_0x4813d2=_0x23a1b5[0x0];else return console[_0x5841c6(0xe4)](_0x5841c6(0xd9)+_0x23a1b5[0x0]+_0x5841c6(0xf2)),0x1;}catch{_0x214839=_0x23a1b5[0x0],_0x4813d2='.';}}const _0x5df0ca=_0x5aa6aa['revision'],_0xabebe8=_0x5aa6aa[_0x5841c6(0xd6)];_0x5aa6aa['verbose']&&(console[_0x5841c6(0xe4)](_0x5841c6(0xb0)+_0x4813d2),_0x214839&&console[_0x5841c6(0xe4)]('Project\x20name:\x20'+_0x214839),_0x5df0ca&&console[_0x5841c6(0xe4)](_0x5841c6(0xae)+_0x5df0ca),_0xabebe8&&console[_0x5841c6(0xe4)](_0x5841c6(0xd7)));const _0x2af68e=await withSpinner(_0x5841c6(0xc2),()=>_0x41b0cd[_0x5841c6(0x9a)][_0x5841c6(0x8c)](_0x4813d2,{'projectName':_0x214839,'revision':_0x5df0ca,'skipValidation':_0xabebe8}),{'verbose':_0x5aa6aa['verbose']}),_0x3c22f9=_0x2af68e[_0x5841c6(0x99)];return console['error']('✔\x20Pushed\x20'+_0x3c22f9[_0x5841c6(0xc5)]),console[_0x5841c6(0xe4)](_0x5841c6(0xe6)+_0x3c22f9[_0x5841c6(0xa2)]),console[_0x5841c6(0xe4)]('\x20\x20Revision:\x20'+_0x3c22f9[_0x5841c6(0xf5)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a32_0x1bcf71(0xaf);['description']=a32_0x1bcf71(0xa9);async['execute'](_0x1fe3c6){const _0x555f48=a32_0x1bcf71,{options:_0x4044e5,args:_0x375f89,tdx:_0x39820c}=_0x1fe3c6,_0x3b9f2a=_0x375f89[0x0];if(!_0x3b9f2a)return console[_0x555f48(0xe4)](_0x555f48(0xfa)),console[_0x555f48(0xe4)](_0x555f48(0xb8)),0x1;_0x4044e5[_0x555f48(0xec)]&&console[_0x555f48(0xe4)](_0x555f48(0xb3)+_0x3b9f2a);if(!_0x4044e5['yes']){const _0x2b0e60=await confirm(_0x555f48(0xf6)+_0x3b9f2a+_0x555f48(0xb2));if(!_0x2b0e60)return console['error'](_0x555f48(0xd2)),0x0;}const _0x2017e3=await withSpinner('Deleting\x20project\x20'+_0x3b9f2a+_0x555f48(0xb4),()=>_0x39820c[_0x555f48(0x9a)][_0x555f48(0xbe)](_0x3b9f2a),{'verbose':_0x4044e5[_0x555f48(0xec)]}),_0x480afc=_0x2017e3[_0x555f48(0x99)];return console[_0x555f48(0xe4)](_0x555f48(0xbb)+_0x480afc[_0x555f48(0xc5)]),console[_0x555f48(0xe4)](_0x555f48(0xe6)+_0x480afc['projectId']),0x0;}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- function a33_0x382c(_0x44c854,_0x3178f0){const _0x32a2c8=a33_0x32a2();return a33_0x382c=function(_0x382cc1,_0x473f7b){_0x382cc1=_0x382cc1-0x14d;let _0x4aa73f=_0x32a2c8[_0x382cc1];return _0x4aa73f;},a33_0x382c(_0x44c854,_0x3178f0);}(function(_0x5b947d,_0x4f5f0a){const _0x19600b=a33_0x382c,_0x117785=_0x5b947d();while(!![]){try{const _0x5ee498=parseInt(_0x19600b(0x161))/0x1*(parseInt(_0x19600b(0x150))/0x2)+parseInt(_0x19600b(0x154))/0x3*(-parseInt(_0x19600b(0x14e))/0x4)+parseInt(_0x19600b(0x15c))/0x5*(-parseInt(_0x19600b(0x158))/0x6)+parseInt(_0x19600b(0x166))/0x7*(parseInt(_0x19600b(0x167))/0x8)+-parseInt(_0x19600b(0x15d))/0x9*(-parseInt(_0x19600b(0x159))/0xa)+parseInt(_0x19600b(0x15f))/0xb+-parseInt(_0x19600b(0x14f))/0xc*(parseInt(_0x19600b(0x163))/0xd);if(_0x5ee498===_0x4f5f0a)break;else _0x117785['push'](_0x117785['shift']());}catch(_0x322465){_0x117785['push'](_0x117785['shift']());}}}(a33_0x32a2,0xb8b25));import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';function a33_0x32a2(){const _0x542c06=['entries','8wdGJxZ','156cRGjku','339826DdmWPQ','tdx','0.0.0','version','955230JHgoor','Authorization',';\x20node/','utf-8','7182426rbfJvR','399810DvfrJr','url','../../package.json','5tnnYtC','333WwWCkG','TD1\x20','10952073JVwgWD','replace','2rqHRAS','X-Trino-User','237497fXELEu','length','tdx/','7WsLHkb','105112qvxuQC'];a33_0x32a2=function(){return _0x542c06;};return a33_0x32a2();}import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x1b728f=a33_0x382c;try{const _0x4b4405=fileURLToPath(import.meta[_0x1b728f(0x15a)]),_0x37767e=dirname(_0x4b4405),_0xf4c132=join(_0x37767e,_0x1b728f(0x15b)),_0x30a48e=JSON['parse'](readFileSync(_0xf4c132,_0x1b728f(0x157)));return _0x30a48e[_0x1b728f(0x153)];}catch{return _0x1b728f(0x152);}}export function getUserAgent(){const _0x4bae1b=a33_0x382c,_0x58102d=getVersion(),_0x113088=platform(),_0x34bd40=process[_0x4bae1b(0x153)][_0x4bae1b(0x160)]('v','');return _0x4bae1b(0x165)+_0x58102d+'\x20('+_0x113088+_0x4bae1b(0x156)+_0x34bd40+')';}export function getAuthHeaders(_0x1480d3,_0x19941b){const _0x4bbdbe=a33_0x382c,_0xced33e=getVersion(),_0x5df742={'User-Agent':getUserAgent(),'X-TD-Client':_0x4bbdbe(0x151),'X-TD-Client-Version':_0xced33e};return _0x19941b&&(_0x5df742[_0x4bbdbe(0x155)]=_0x4bbdbe(0x15e)+_0x19941b),_0x5df742;}export function toHeaderRecord(_0xe91376){const _0x31cd90=a33_0x382c,_0x3e8987={};for(const [_0x5c4128,_0x49a69c]of Object[_0x31cd90(0x14d)](_0xe91376)){_0x49a69c!==undefined&&(_0x3e8987[_0x5c4128]=_0x49a69c);}return _0x3e8987;}export function getTrinoHeaders(_0x39f0b3,_0x4315de){const _0x41b2a0=a33_0x382c,_0x46b41c=getAuthHeaders(_0x39f0b3,_0x4315de),_0x429f4e=toHeaderRecord(_0x46b41c);return delete _0x429f4e[_0x41b2a0(0x155)],_0x4315de&&(_0x429f4e[_0x41b2a0(0x162)]=_0x4315de),_0x429f4e;}export function hasAPIKey(_0x2292f1){const _0x2fa83c=a33_0x382c,_0x4851f4=getAPIKey(_0x2292f1);return _0x4851f4!==undefined&&_0x4851f4[_0x2fa83c(0x164)]>0x0;}
1
+ (function(_0x58d6b3,_0x192017){const _0x14045c=a33_0xcecb,_0x230e7c=_0x58d6b3();while(!![]){try{const _0x3d9f96=-parseInt(_0x14045c(0x1ec))/0x1*(-parseInt(_0x14045c(0x1e1))/0x2)+-parseInt(_0x14045c(0x1e6))/0x3+-parseInt(_0x14045c(0x1e9))/0x4*(parseInt(_0x14045c(0x1ef))/0x5)+-parseInt(_0x14045c(0x1ea))/0x6*(-parseInt(_0x14045c(0x1eb))/0x7)+parseInt(_0x14045c(0x1f0))/0x8+parseInt(_0x14045c(0x1ed))/0x9+parseInt(_0x14045c(0x1e8))/0xa*(-parseInt(_0x14045c(0x1e4))/0xb);if(_0x3d9f96===_0x192017)break;else _0x230e7c['push'](_0x230e7c['shift']());}catch(_0x174cc3){_0x230e7c['push'](_0x230e7c['shift']());}}}(a33_0x5e4f,0xe44c3));import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';function a33_0x5e4f(){const _0x240086=[';\x20node/','4169295WRKunO','../../package.json','10FNlxsr','12740NBsJWY','66YxAHzm','593005QfSXzB','273oXJLYC','988866RnmLyG','url','5ZAJvYu','14094864TrhPsx','length','entries','X-Trino-User','0.0.0','tdx','Authorization','tdx/','11394SBJoUC','parse','version','22339031wnTBVr'];a33_0x5e4f=function(){return _0x240086;};return a33_0x5e4f();}import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x4129ea=a33_0xcecb;try{const _0xac4596=fileURLToPath(import.meta[_0x4129ea(0x1ee)]),_0xcfa97a=dirname(_0xac4596),_0x34caf5=join(_0xcfa97a,_0x4129ea(0x1e7)),_0x930825=JSON[_0x4129ea(0x1e2)](readFileSync(_0x34caf5,'utf-8'));return _0x930825[_0x4129ea(0x1e3)];}catch{return _0x4129ea(0x1dd);}}export function getUserAgent(){const _0x199668=a33_0xcecb,_0x5d68a7=getVersion(),_0x141d3b=platform(),_0x21dfbd=process[_0x199668(0x1e3)]['replace']('v','');return _0x199668(0x1e0)+_0x5d68a7+'\x20('+_0x141d3b+_0x199668(0x1e5)+_0x21dfbd+')';}export function getAuthHeaders(_0x33379f,_0x43c60d){const _0x250cdb=a33_0xcecb,_0x50439b=getVersion(),_0x34c6de={'User-Agent':getUserAgent(),'X-TD-Client':_0x250cdb(0x1de),'X-TD-Client-Version':_0x50439b};return _0x43c60d&&(_0x34c6de[_0x250cdb(0x1df)]='TD1\x20'+_0x43c60d),_0x34c6de;}export function toHeaderRecord(_0x4e817f){const _0x22e8ed=a33_0xcecb,_0x4c4b45={};for(const [_0x40aff4,_0x53ca9a]of Object[_0x22e8ed(0x1f2)](_0x4e817f)){_0x53ca9a!==undefined&&(_0x4c4b45[_0x40aff4]=_0x53ca9a);}return _0x4c4b45;}export function getTrinoHeaders(_0xecdefe,_0x3a70bc){const _0x2ebd15=a33_0xcecb,_0x399cbd=getAuthHeaders(_0xecdefe,_0x3a70bc),_0xb79c8b=toHeaderRecord(_0x399cbd);return delete _0xb79c8b['Authorization'],_0x3a70bc&&(_0xb79c8b[_0x2ebd15(0x1f3)]=_0x3a70bc),_0xb79c8b;}function a33_0xcecb(_0x1fc2e7,_0x25c33f){const _0x5e4f22=a33_0x5e4f();return a33_0xcecb=function(_0xcecb8a,_0xfb5f9c){_0xcecb8a=_0xcecb8a-0x1dd;let _0x5122c5=_0x5e4f22[_0xcecb8a];return _0x5122c5;},a33_0xcecb(_0x1fc2e7,_0x25c33f);}export function hasAPIKey(_0x60dd12){const _0x3c8f51=a33_0xcecb,_0x56c2f2=getAPIKey(_0x60dd12);return _0x56c2f2!==undefined&&_0x56c2f2[_0x3c8f51(0x1f1)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x70000e,_0xfdfd07){const _0x59570c=a34_0xe7af,_0xb505a8=_0x70000e();while(!![]){try{const _0x18352d=parseInt(_0x59570c(0x157))/0x1+parseInt(_0x59570c(0x134))/0x2*(parseInt(_0x59570c(0x14e))/0x3)+-parseInt(_0x59570c(0x123))/0x4*(-parseInt(_0x59570c(0x127))/0x5)+parseInt(_0x59570c(0x138))/0x6*(parseInt(_0x59570c(0x154))/0x7)+parseInt(_0x59570c(0x141))/0x8+parseInt(_0x59570c(0x156))/0x9*(parseInt(_0x59570c(0x139))/0xa)+-parseInt(_0x59570c(0x14b))/0xb;if(_0x18352d===_0xfdfd07)break;else _0xb505a8['push'](_0xb505a8['shift']());}catch(_0x57decc){_0xb505a8['push'](_0xb505a8['shift']());}}}(a34_0x52a3,0xd4aff));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync}from'fs';import*as a34_0x3c0b8c from'node:fs';import*as a34_0xab6334 from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';export function getConfigDir(){const _0x2e29dd=a34_0xe7af;return process[_0x2e29dd(0x13c)]['TDX_CONFIG_DIR']||join(homedir(),'.config','tdx');}function a34_0xe7af(_0x29c851,_0x3016a9){const _0x52a30c=a34_0x52a3();return a34_0xe7af=function(_0xe7af4e,_0x3844c0){_0xe7af4e=_0xe7af4e-0x11e;let _0x444e13=_0x52a30c[_0xe7af4e];return _0x444e13;},a34_0xe7af(_0x29c851,_0x3016a9);}export function getConfigFile(){const _0x1319e4=a34_0xe7af;return join(getConfigDir(),_0x1319e4(0x12a));}export function getCacheDir(){const _0xd57bba=a34_0xe7af;return process[_0xd57bba(0x13c)][_0xd57bba(0x140)]||join(homedir(),'.cache',_0xd57bba(0x136));}export function getLLMProjectCacheFile(){const _0x28912b=a34_0xe7af;return join(getCacheDir(),_0x28912b(0x13b));}export function readCachedLLMProject(){try{const _0x5bccec=getLLMProjectCacheFile();if(!existsSync(_0x5bccec))return null;return readFileSync(_0x5bccec,'utf-8')['trim']();}catch{return null;}}export function writeCachedLLMProject(_0x278ad3){const _0x523133=a34_0xe7af;try{const _0x29b961=getCacheDir(),_0x596d88=getLLMProjectCacheFile();!existsSync(_0x29b961)&&mkdirSync(_0x29b961,{'recursive':!![]}),writeFileSync(_0x596d88,_0x278ad3,_0x523133(0x146));}catch(_0x2e0f19){console[_0x523133(0x145)](_0x523133(0x155),_0x2e0f19);}}export function parseEnvFile(_0x884a10){const _0x5d2494=a34_0xe7af,_0x4a7620={};for(const _0x598eeb of _0x884a10[_0x5d2494(0x12d)]('\x0a')){const _0x421d83=_0x598eeb[_0x5d2494(0x12f)]();if(!_0x421d83||_0x421d83[_0x5d2494(0x12b)]('#'))continue;const _0x34fb58=_0x421d83[_0x5d2494(0x121)](/^([^=]+)=(.*)$/);if(_0x34fb58){const _0x460c9b=_0x34fb58[0x1]['trim']();let _0xb3c9b4=_0x34fb58[0x2][_0x5d2494(0x12f)]();(_0xb3c9b4['startsWith']('\x22')&&_0xb3c9b4[_0x5d2494(0x14f)]('\x22')||_0xb3c9b4[_0x5d2494(0x12b)]('\x27')&&_0xb3c9b4['endsWith']('\x27'))&&(_0xb3c9b4=_0xb3c9b4[_0x5d2494(0x13f)](0x1,-0x1)),_0x4a7620[_0x460c9b]=_0xb3c9b4;}}return _0x4a7620;}export function readUserConfig(){const _0x4ccea0=a34_0xe7af,_0x4e2337=getConfigFile();if(!existsSync(_0x4e2337))return{};try{const _0x3fb33f=readFileSync(_0x4e2337,_0x4ccea0(0x146));return parseEnvFile(_0x3fb33f);}catch(_0x2ad1d7){return console[_0x4ccea0(0x13d)](_0x4ccea0(0x122)+_0x4e2337+':',_0x2ad1d7),{};}}export function resolveSite(_0x49315a){const _0x5d83ce=a34_0xe7af,_0x3dbf26=['us01','jp01',_0x5d83ce(0x124),_0x5d83ce(0x153),'ap03',_0x5d83ce(0x147),'dev-eu01',_0x5d83ce(0x131),_0x5d83ce(0x13a),_0x5d83ce(0x150)];if(_0x3dbf26[_0x5d83ce(0x133)](_0x49315a))return _0x49315a;if(_0x49315a in SITE_ALIASES)return SITE_ALIASES[_0x49315a];return console[_0x5d83ce(0x13d)]('Warning:\x20Unknown\x20site\x20\x27'+_0x49315a+_0x5d83ce(0x129)),_0x5d83ce(0x137);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x3eb44d,_0x5f41f9){const _0x5d8e92=a34_0xe7af,_0x457705=_0x3eb44d['toUpperCase']()[_0x5d8e92(0x12c)](/-/g,'_'),_0xe42c41=_0x5d8e92(0x130)+_0x457705;if(process[_0x5d8e92(0x13c)][_0xe42c41])return process[_0x5d8e92(0x13c)][_0xe42c41];if(process[_0x5d8e92(0x13c)][_0x5d8e92(0x135)])return process['env'][_0x5d8e92(0x135)];const _0x5570f9=_0x5f41f9||getActiveProfileName();if(_0x5570f9){const _0x273e10=loadProfileEnv(_0x5570f9);if(_0x273e10){if(_0x273e10[_0xe42c41])return _0x273e10[_0xe42c41];if(_0x273e10[_0x5d8e92(0x135)])return _0x273e10[_0x5d8e92(0x135)];}}const _0x11a72c=loadUserConfigOnce();if(_0x11a72c[_0xe42c41])return _0x11a72c[_0xe42c41];if(_0x11a72c[_0x5d8e92(0x135)])return _0x11a72c[_0x5d8e92(0x135)];return undefined;}export function getAPIKeySource(_0x1f45ab,_0x438e91){const _0x4cd312=a34_0xe7af,_0x37e5a5=_0x4cd312(0x130)+_0x1f45ab[_0x4cd312(0x120)]()['replace'](/-/g,'_');if(process[_0x4cd312(0x13c)][_0x37e5a5])return _0x4cd312(0x14c)+_0x37e5a5;if(process[_0x4cd312(0x13c)][_0x4cd312(0x135)])return _0x4cd312(0x148);const _0x36e494=_0x438e91||getActiveProfileName();if(_0x36e494){const _0x173e81=loadProfileEnv(_0x36e494);if(_0x173e81){if(_0x173e81[_0x37e5a5])return _0x4cd312(0x14a)+_0x36e494+'\x20('+_0x37e5a5+')';if(_0x173e81['TD_API_KEY'])return _0x4cd312(0x14a)+_0x36e494+_0x4cd312(0x143);}}const _0x184c70=loadUserConfigOnce(),_0x5b793c=getConfigFile();if(_0x184c70[_0x37e5a5])return _0x4cd312(0x144)+_0x5b793c+'\x20('+_0x37e5a5+')';if(_0x184c70[_0x4cd312(0x135)])return _0x4cd312(0x144)+_0x5b793c+_0x4cd312(0x143);return null;}function loadProfileEnv(_0x4a3216){const _0x531b1f=a34_0xe7af,_0x512763=a34_0xab6334['join'](getConfigDir(),'.env.'+_0x4a3216);if(a34_0x3c0b8c['existsSync'](_0x512763)){validateSecureFilePermissions(_0x512763);try{const _0x380053=a34_0x3c0b8c[_0x531b1f(0x132)](_0x512763,_0x531b1f(0x146));return parseEnvFile(_0x380053);}catch(_0x2eee4e){console[_0x531b1f(0x13d)]('Warning:\x20Failed\x20to\x20load\x20'+_0x512763+':\x20'+_0x2eee4e);}}const _0x2bec90=a34_0xab6334['join'](getConfigDir(),_0x531b1f(0x12e),_0x4a3216,_0x531b1f(0x12a));if(a34_0x3c0b8c[_0x531b1f(0x152)](_0x2bec90)){validateSecureFilePermissions(_0x2bec90);try{const _0x144445=a34_0x3c0b8c[_0x531b1f(0x132)](_0x2bec90,_0x531b1f(0x146));return parseEnvFile(_0x144445);}catch(_0x26407d){return console[_0x531b1f(0x13d)](_0x531b1f(0x142)+_0x2bec90+':\x20'+_0x26407d),null;}}return null;}function getActiveProfileName(){const _0x23a693=a34_0xe7af,_0xac16a9=a34_0xab6334[_0x23a693(0x158)](getConfigDir(),_0x23a693(0x14d));if(!a34_0x3c0b8c[_0x23a693(0x152)](_0xac16a9))return null;try{const _0x15a1f7=a34_0x3c0b8c['readFileSync'](_0xac16a9,_0x23a693(0x146)),_0x320040=JSON[_0x23a693(0x11f)](_0x15a1f7);return _0x320040[_0x23a693(0x125)]||null;}catch{return null;}}function a34_0x52a3(){const _0x2e8333=['slice','TDX_CACHE_DIR','13555080pzoqLR','Warning:\x20Failed\x20to\x20load\x20','\x20(TD_API_KEY)','global:\x20','error','utf-8','dev-us01','env:\x20TD_API_KEY','map','profile:\x20','64884732eYCqlE','env:\x20','tdx.json','1663593fDmOfm','endsWith','stg-ap03','ap03','existsSync','ap02','756707tRyURO','Warning:\x20Failed\x20to\x20cache\x20LLM\x20project\x20name:','135vrAVGt','1077386TPvNBv','join','dev-eu01','parse','toUpperCase','match','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','4fPGtet','eu01','profile','entries','8152735YdgcRI','jp01','\x27,\x20defaulting\x20to\x20us01','.env','startsWith','replace','split','profiles','trim','TD_API_KEY_','stg-us01','readFileSync','includes','2pRSCqp','TD_API_KEY','tdx','us01','90AmNaog','127610xAdkeE','stg-jp01','llm_default_project','env','warn','apiKeys'];a34_0x52a3=function(){return _0x2e8333;};return a34_0x52a3();}export function saveAPIKey(_0x5ee14c,_0x4e1e42){const _0x287fce=a34_0xe7af,_0x5603d1=getConfigDir(),_0x2bf470=getConfigFile();!existsSync(_0x5603d1)&&mkdirSync(_0x5603d1,{'recursive':!![],'mode':0x1c0});const _0x98d531=readUserConfig(),_0x569494=_0x5ee14c[_0x287fce(0x120)]()['replace'](/-/g,'_');_0x98d531[_0x287fce(0x130)+_0x569494]=_0x4e1e42;const _0xe1a7b1=Object[_0x287fce(0x126)](_0x98d531)[_0x287fce(0x149)](([_0x49479f,_0x237c05])=>_0x49479f+'='+_0x237c05);writeFileSync(_0x2bf470,_0xe1a7b1['join']('\x0a')+'\x0a',{'mode':0x180});}export function loadConfig(){const _0x1d5e60=a34_0xe7af,_0x7f1cde={'apiKeys':{},'defaultSite':_0x1d5e60(0x137)},_0x1c204e=[_0x1d5e60(0x137),_0x1d5e60(0x128),'eu01','ap02',_0x1d5e60(0x151),_0x1d5e60(0x147),_0x1d5e60(0x11e),_0x1d5e60(0x131),'stg-jp01','stg-ap03'];for(const _0x1ab6e9 of _0x1c204e){const _0x81d751=getAPIKey(_0x1ab6e9);_0x81d751&&(_0x7f1cde[_0x1d5e60(0x13e)][_0x1ab6e9]=_0x81d751);}return _0x7f1cde;}
1
+ (function(_0xab8721,_0xc04fc9){const _0x2a388b=a34_0x3742,_0x497a0e=_0xab8721();while(!![]){try{const _0x48ca23=-parseInt(_0x2a388b(0x162))/0x1*(-parseInt(_0x2a388b(0x14c))/0x2)+-parseInt(_0x2a388b(0x177))/0x3+-parseInt(_0x2a388b(0x146))/0x4+-parseInt(_0x2a388b(0x16e))/0x5+parseInt(_0x2a388b(0x14e))/0x6+-parseInt(_0x2a388b(0x168))/0x7*(parseInt(_0x2a388b(0x160))/0x8)+parseInt(_0x2a388b(0x17a))/0x9;if(_0x48ca23===_0xc04fc9)break;else _0x497a0e['push'](_0x497a0e['shift']());}catch(_0xe02207){_0x497a0e['push'](_0x497a0e['shift']());}}}(a34_0x485f,0x61713));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync}from'fs';import*as a34_0x4bde2c from'node:fs';import*as a34_0x2f0a6b from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';export function getConfigDir(){const _0x4c6f18=a34_0x3742;return process['env'][_0x4c6f18(0x17b)]||join(homedir(),_0x4c6f18(0x158),_0x4c6f18(0x174));}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getCacheDir(){const _0x108468=a34_0x3742;return process[_0x108468(0x165)][_0x108468(0x150)]||join(homedir(),'.cache',_0x108468(0x174));}export function getLLMProjectCacheFile(){const _0x14f98b=a34_0x3742;return join(getCacheDir(),_0x14f98b(0x171));}export function readCachedLLMProject(){const _0x49c528=a34_0x3742;try{const _0x597bc8=getLLMProjectCacheFile();if(!existsSync(_0x597bc8))return null;return readFileSync(_0x597bc8,_0x49c528(0x15c))['trim']();}catch{return null;}}export function writeCachedLLMProject(_0x4ae0ba){const _0x1bf3df=a34_0x3742;try{const _0x593021=getCacheDir(),_0x29cd07=getLLMProjectCacheFile();!existsSync(_0x593021)&&mkdirSync(_0x593021,{'recursive':!![]}),writeFileSync(_0x29cd07,_0x4ae0ba,_0x1bf3df(0x15c));}catch(_0x40216c){console[_0x1bf3df(0x148)](_0x1bf3df(0x152),_0x40216c);}}function a34_0x3742(_0x4df4b0,_0x28196e){const _0x485f5c=a34_0x485f();return a34_0x3742=function(_0x3742bc,_0x2f39c5){_0x3742bc=_0x3742bc-0x144;let _0x2ef917=_0x485f5c[_0x3742bc];return _0x2ef917;},a34_0x3742(_0x4df4b0,_0x28196e);}export function parseEnvFile(_0x1a9684){const _0x53bb32=a34_0x3742,_0x2c0c2c={};for(const _0x815296 of _0x1a9684['split']('\x0a')){const _0x12c4e7=_0x815296['trim']();if(!_0x12c4e7||_0x12c4e7[_0x53bb32(0x176)]('#'))continue;const _0x29872d=_0x12c4e7[_0x53bb32(0x172)](/^([^=]+)=(.*)$/);if(_0x29872d){const _0x1c08a4=_0x29872d[0x1][_0x53bb32(0x161)]();let _0x301c26=_0x29872d[0x2]['trim']();(_0x301c26[_0x53bb32(0x176)]('\x22')&&_0x301c26[_0x53bb32(0x16a)]('\x22')||_0x301c26[_0x53bb32(0x176)]('\x27')&&_0x301c26['endsWith']('\x27'))&&(_0x301c26=_0x301c26[_0x53bb32(0x16c)](0x1,-0x1)),_0x2c0c2c[_0x1c08a4]=_0x301c26;}}return _0x2c0c2c;}export function readUserConfig(){const _0x1cbe1b=a34_0x3742,_0x119136=getConfigFile();if(!existsSync(_0x119136))return{};try{const _0x5ace11=readFileSync(_0x119136,_0x1cbe1b(0x15c));return parseEnvFile(_0x5ace11);}catch(_0x42a4bb){return console[_0x1cbe1b(0x144)](_0x1cbe1b(0x147)+_0x119136+':',_0x42a4bb),{};}}export function resolveSite(_0x4eb85c){const _0x164ef6=a34_0x3742,_0x49c002=['us01',_0x164ef6(0x155),_0x164ef6(0x15d),'ap02',_0x164ef6(0x15b),'dev-us01',_0x164ef6(0x167),_0x164ef6(0x173),_0x164ef6(0x16f),_0x164ef6(0x169)];if(_0x49c002[_0x164ef6(0x14b)](_0x4eb85c))return _0x4eb85c;if(_0x4eb85c in SITE_ALIASES)return SITE_ALIASES[_0x4eb85c];return console[_0x164ef6(0x144)]('Warning:\x20Unknown\x20site\x20\x27'+_0x4eb85c+'\x27,\x20defaulting\x20to\x20us01'),_0x164ef6(0x14d);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x66f798,_0x503670){const _0x2cff1d=a34_0x3742,_0x21b75f=_0x66f798['toUpperCase']()['replace'](/-/g,'_'),_0x5c7a00=_0x2cff1d(0x166)+_0x21b75f;if(process['env'][_0x5c7a00])return process[_0x2cff1d(0x165)][_0x5c7a00];if(process['env'][_0x2cff1d(0x156)])return process[_0x2cff1d(0x165)]['TD_API_KEY'];const _0x2f8ff8=_0x503670||getActiveProfileName();if(_0x2f8ff8){const _0x50d699=loadProfileEnv(_0x2f8ff8);if(_0x50d699){if(_0x50d699[_0x5c7a00])return _0x50d699[_0x5c7a00];if(_0x50d699[_0x2cff1d(0x156)])return _0x50d699['TD_API_KEY'];}}const _0x16c4b4=loadUserConfigOnce();if(_0x16c4b4[_0x5c7a00])return _0x16c4b4[_0x5c7a00];if(_0x16c4b4[_0x2cff1d(0x156)])return _0x16c4b4[_0x2cff1d(0x156)];return undefined;}export function getAPIKeySource(_0x867363,_0x52ad28){const _0x22dca7=a34_0x3742,_0xb73a35=_0x22dca7(0x166)+_0x867363[_0x22dca7(0x17c)]()[_0x22dca7(0x157)](/-/g,'_');if(process[_0x22dca7(0x165)][_0xb73a35])return _0x22dca7(0x14f)+_0xb73a35;if(process[_0x22dca7(0x165)]['TD_API_KEY'])return _0x22dca7(0x151);const _0x43cfd2=_0x52ad28||getActiveProfileName();if(_0x43cfd2){const _0x33da32=loadProfileEnv(_0x43cfd2);if(_0x33da32){if(_0x33da32[_0xb73a35])return _0x22dca7(0x15a)+_0x43cfd2+'\x20('+_0xb73a35+')';if(_0x33da32['TD_API_KEY'])return _0x22dca7(0x15a)+_0x43cfd2+_0x22dca7(0x16d);}}const _0x6f066b=loadUserConfigOnce(),_0x5115a8=getConfigFile();if(_0x6f066b[_0xb73a35])return _0x22dca7(0x159)+_0x5115a8+'\x20('+_0xb73a35+')';if(_0x6f066b[_0x22dca7(0x156)])return _0x22dca7(0x159)+_0x5115a8+_0x22dca7(0x16d);return null;}function loadProfileEnv(_0xb7e029){const _0x358d7f=a34_0x3742,_0x57143c=a34_0x2f0a6b[_0x358d7f(0x14a)](getConfigDir(),_0x358d7f(0x170)+_0xb7e029);if(a34_0x4bde2c['existsSync'](_0x57143c)){validateSecureFilePermissions(_0x57143c);try{const _0x4bac85=a34_0x4bde2c[_0x358d7f(0x15e)](_0x57143c,_0x358d7f(0x15c));return parseEnvFile(_0x4bac85);}catch(_0x3510f9){console[_0x358d7f(0x144)]('Warning:\x20Failed\x20to\x20load\x20'+_0x57143c+':\x20'+_0x3510f9);}}const _0x22b747=a34_0x2f0a6b[_0x358d7f(0x14a)](getConfigDir(),_0x358d7f(0x154),_0xb7e029,'.env');if(a34_0x4bde2c[_0x358d7f(0x164)](_0x22b747)){validateSecureFilePermissions(_0x22b747);try{const _0x4a7abf=a34_0x4bde2c[_0x358d7f(0x15e)](_0x22b747,'utf-8');return parseEnvFile(_0x4a7abf);}catch(_0x210c8a){return console[_0x358d7f(0x144)](_0x358d7f(0x16b)+_0x22b747+':\x20'+_0x210c8a),null;}}return null;}function getActiveProfileName(){const _0x4d54ea=a34_0x3742,_0x40db3f=a34_0x2f0a6b[_0x4d54ea(0x14a)](getConfigDir(),_0x4d54ea(0x178));if(!a34_0x4bde2c['existsSync'](_0x40db3f))return null;try{const _0x44c8ec=a34_0x4bde2c['readFileSync'](_0x40db3f,_0x4d54ea(0x15c)),_0x2f5ff4=JSON[_0x4d54ea(0x163)](_0x44c8ec);return _0x2f5ff4[_0x4d54ea(0x153)]||null;}catch{return null;}}export function saveAPIKey(_0x2ef120,_0x107a62){const _0xcf342=a34_0x3742,_0x6722dc=getConfigDir(),_0x21dc68=getConfigFile();!existsSync(_0x6722dc)&&mkdirSync(_0x6722dc,{'recursive':!![],'mode':0x1c0});const _0x1ea9ef=readUserConfig(),_0x4177c5=_0x2ef120[_0xcf342(0x17c)]()[_0xcf342(0x157)](/-/g,'_');_0x1ea9ef[_0xcf342(0x166)+_0x4177c5]=_0x107a62;const _0x40c5ec=Object[_0xcf342(0x15f)](_0x1ea9ef)[_0xcf342(0x175)](([_0x2755fa,_0x251075])=>_0x2755fa+'='+_0x251075);writeFileSync(_0x21dc68,_0x40c5ec['join']('\x0a')+'\x0a',{'mode':0x180});}export function loadConfig(){const _0x5bc8e6=a34_0x3742,_0x1d65dd={'apiKeys':{},'defaultSite':_0x5bc8e6(0x14d)},_0x5ddad3=[_0x5bc8e6(0x14d),_0x5bc8e6(0x155),_0x5bc8e6(0x15d),_0x5bc8e6(0x179),_0x5bc8e6(0x15b),_0x5bc8e6(0x149),'dev-eu01','stg-us01','stg-jp01','stg-ap03'];for(const _0x119dcf of _0x5ddad3){const _0x3aa4f3=getAPIKey(_0x119dcf);_0x3aa4f3&&(_0x1d65dd[_0x5bc8e6(0x145)][_0x119dcf]=_0x3aa4f3);}return _0x1d65dd;}function a34_0x485f(){const _0x170d34=['join','includes','2TLCWne','us01','2122374jyNCsz','env:\x20','TDX_CACHE_DIR','env:\x20TD_API_KEY','Warning:\x20Failed\x20to\x20cache\x20LLM\x20project\x20name:','profile','profiles','jp01','TD_API_KEY','replace','.config','global:\x20','profile:\x20','ap03','utf-8','eu01','readFileSync','entries','608NazvXF','trim','557484yqfJOY','parse','existsSync','env','TD_API_KEY_','dev-eu01','21994evVKIW','stg-ap03','endsWith','Warning:\x20Failed\x20to\x20load\x20','slice','\x20(TD_API_KEY)','2042675kuuWqb','stg-jp01','.env.','llm_default_project','match','stg-us01','tdx','map','startsWith','2177124GZtgQM','tdx.json','ap02','14889708lqrNaW','TDX_CONFIG_DIR','toUpperCase','warn','apiKeys','3173868eMqwBc','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','error','dev-us01'];a34_0x485f=function(){return _0x170d34;};return a34_0x485f();}