@treasuredata/tdx 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/dist/build-info.json +2 -2
  2. package/dist/cli.js +1 -1
  3. package/dist/cli.js.map +1 -1
  4. package/dist/client/cdp-api-client.js +1 -1
  5. package/dist/client/engage-api-client.d.ts +57 -0
  6. package/dist/client/engage-api-client.d.ts.map +1 -0
  7. package/dist/client/engage-api-client.js +1 -0
  8. package/dist/client/engage-api-client.js.map +1 -0
  9. package/dist/client/http-client.js +1 -1
  10. package/dist/client/llm-api-client.js +1 -1
  11. package/dist/client/rate-limiter.js +1 -1
  12. package/dist/client/td-api-client.js +1 -1
  13. package/dist/client/trino-api-client.js +1 -1
  14. package/dist/client/workflow-client.js +1 -1
  15. package/dist/commands/activations.js +1 -1
  16. package/dist/commands/api-command.js +1 -1
  17. package/dist/commands/auth-command.js +1 -1
  18. package/dist/commands/chat-command.js +1 -1
  19. package/dist/commands/claude-command.js +1 -1
  20. package/dist/commands/command.js +1 -1
  21. package/dist/commands/context-command.js +1 -1
  22. package/dist/commands/databases.js +1 -1
  23. package/dist/commands/describe.js +1 -1
  24. package/dist/commands/engage-command.d.ts +69 -0
  25. package/dist/commands/engage-command.d.ts.map +1 -0
  26. package/dist/commands/engage-command.js +1 -0
  27. package/dist/commands/engage-command.js.map +1 -0
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/llm-command.js +1 -1
  30. package/dist/commands/llm-proxy.js +1 -1
  31. package/dist/commands/parent-segment-command.js +1 -1
  32. package/dist/commands/profiles-command.js +1 -1
  33. package/dist/commands/query-command.js +1 -1
  34. package/dist/commands/segment-command.js +1 -1
  35. package/dist/commands/segment-create-command.js +1 -1
  36. package/dist/commands/segment-fields-command.js +1 -1
  37. package/dist/commands/segment-pwd-command.js +1 -1
  38. package/dist/commands/segment-update-command.js +1 -1
  39. package/dist/commands/segment-use-command.js +1 -1
  40. package/dist/commands/segments.js +1 -1
  41. package/dist/commands/show.js +1 -1
  42. package/dist/commands/tables.js +1 -1
  43. package/dist/commands/use-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/config.js +1 -1
  47. package/dist/core/credential-cache.js +1 -1
  48. package/dist/core/global-context.js +1 -1
  49. package/dist/core/keychain.js +1 -1
  50. package/dist/core/profile.js +1 -1
  51. package/dist/core/project-config.js +1 -1
  52. package/dist/core/session.js +1 -1
  53. package/dist/index.js +1 -1
  54. package/dist/proxy/anthropic-adapter.js +1 -1
  55. package/dist/proxy/server.js +1 -1
  56. package/dist/proxy/session-cache.js +1 -1
  57. package/dist/sdk/api.js +1 -1
  58. package/dist/sdk/engage.d.ts +152 -0
  59. package/dist/sdk/engage.d.ts.map +1 -0
  60. package/dist/sdk/engage.js +1 -0
  61. package/dist/sdk/engage.js.map +1 -0
  62. package/dist/sdk/errors.js +1 -1
  63. package/dist/sdk/index.d.ts +7 -0
  64. package/dist/sdk/index.d.ts.map +1 -1
  65. package/dist/sdk/index.js +1 -1
  66. package/dist/sdk/index.js.map +1 -1
  67. package/dist/sdk/job.js +1 -1
  68. package/dist/sdk/llm.js +1 -1
  69. package/dist/sdk/query.js +1 -1
  70. package/dist/sdk/segment.js +1 -1
  71. package/dist/sdk/workflow.js +1 -1
  72. package/dist/types/endpoints.d.ts +4 -0
  73. package/dist/types/endpoints.d.ts.map +1 -1
  74. package/dist/types/endpoints.js +1 -1
  75. package/dist/types/endpoints.js.map +1 -1
  76. package/dist/types/engage.d.ts +340 -0
  77. package/dist/types/engage.d.ts.map +1 -0
  78. package/dist/types/engage.js +1 -0
  79. package/dist/types/engage.js.map +1 -0
  80. package/dist/types/index.d.ts +2 -1
  81. package/dist/types/index.d.ts.map +1 -1
  82. package/dist/types/index.js +1 -1
  83. package/dist/utils/agent-ref-parser.js +1 -1
  84. package/dist/utils/chat-cache.js +1 -1
  85. package/dist/utils/colors.js +1 -1
  86. package/dist/utils/command-output.js +1 -1
  87. package/dist/utils/constants.js +1 -1
  88. package/dist/utils/file-permissions.js +1 -1
  89. package/dist/utils/format-detector.js +1 -1
  90. package/dist/utils/formatters.js +1 -1
  91. package/dist/utils/json-loader.js +1 -1
  92. package/dist/utils/llm-backup-utils.js +1 -1
  93. package/dist/utils/model-aliases.js +1 -1
  94. package/dist/utils/option-validation.js +1 -1
  95. package/dist/utils/port.js +1 -1
  96. package/dist/utils/process.js +1 -1
  97. package/dist/utils/prompt.js +1 -1
  98. package/dist/utils/segment-path-parser.js +1 -1
  99. package/dist/utils/segment-ref-parser.js +1 -1
  100. package/dist/utils/spinner.js +1 -1
  101. package/dist/utils/sql-parser.js +1 -1
  102. package/dist/utils/sse-parser.js +1 -1
  103. package/dist/utils/string-utils.js +1 -1
  104. package/dist/utils/table-ref-parser.js +1 -1
  105. package/dist/utils/tdx-logger.js +1 -1
  106. package/dist/utils/tree-formatter.js +1 -1
  107. package/dist/utils/version-check.js +1 -1
  108. package/dist/utils/workflow-utils.js +1 -1
  109. package/package.json +1 -1
@@ -1 +1 @@
1
- const a27_0x4ea326=a27_0x4f26;(function(_0x47f1f5,_0x7c0191){const _0x17302c=a27_0x4f26,_0x158d0b=_0x47f1f5();while(!![]){try{const _0x4776b0=-parseInt(_0x17302c(0x154))/0x1+parseInt(_0x17302c(0x150))/0x2+-parseInt(_0x17302c(0x157))/0x3+parseInt(_0x17302c(0x14b))/0x4*(-parseInt(_0x17302c(0x14e))/0x5)+parseInt(_0x17302c(0x145))/0x6*(parseInt(_0x17302c(0x149))/0x7)+parseInt(_0x17302c(0x169))/0x8+parseInt(_0x17302c(0x147))/0x9;if(_0x4776b0===_0x7c0191)break;else _0x158d0b['push'](_0x158d0b['shift']());}catch(_0x337799){_0x158d0b['push'](_0x158d0b['shift']());}}}(a27_0xef06,0xbb63c));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a27_0x4f26(_0x35cc63,_0x2b0667){const _0xef06eb=a27_0xef06();return a27_0x4f26=function(_0x4f26da,_0xb9c0aa){_0x4f26da=_0x4f26da-0x145;let _0x5f41ee=_0xef06eb[_0x4f26da];return _0x5f41ee;},a27_0x4f26(_0x35cc63,_0x2b0667);}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{['name']=a27_0x4ea326(0x15d);[a27_0x4ea326(0x148)]=a27_0x4ea326(0x161);async['execute'](_0x3c2585){const _0x5ec769=a27_0x4ea326,{options:_0x15beb3,args:_0x3ee667,tdx:_0x54ee85}=_0x3c2585,_0x5ec885=_0x15beb3;if(_0x3ee667['length']===0x0)return console[_0x5ec769(0x151)](_0x5ec769(0x16a)),console[_0x5ec769(0x151)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x5ec769(0x151)](_0x5ec769(0x15a)),console[_0x5ec769(0x151)](_0x5ec769(0x14f)),console[_0x5ec769(0x151)](_0x5ec769(0x16c)),0x1;const _0xaa977f=_0x3ee667[0x0],_0x43261c=_0x15beb3[_0x5ec769(0x15b)];let _0x216c69=_0xaa977f;_0x43261c&&!_0xaa977f[_0x5ec769(0x16e)]('/')&&(_0x216c69=_0x43261c+'/'+_0xaa977f,_0x5ec885[_0x5ec769(0x163)]&&console[_0x5ec769(0x151)](_0x5ec769(0x146)+_0x216c69));const _0x1cda58=await withSpinner(_0x5ec769(0x164)+_0x216c69+_0x5ec769(0x171),()=>_0x54ee85[_0x5ec769(0x159)][_0x5ec769(0x15f)](_0x216c69),{'verbose':_0x5ec885[_0x5ec769(0x163)]}),_0x3f9225=_0x1cda58['data'];_0x5ec885[_0x5ec769(0x163)]&&console[_0x5ec769(0x151)](_0x5ec769(0x15c)+_0x3f9225[_0x5ec769(0x14a)]);if(_0x3f9225[_0x5ec769(0x14a)]!==_0x5ec769(0x159))return console[_0x5ec769(0x151)](_0x5ec769(0x153)+_0x3f9225[_0x5ec769(0x14a)]+_0x5ec769(0x152)),console[_0x5ec769(0x151)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x3f9225[_0x5ec769(0x14d)])throw new SDKError(ErrorCode[_0x5ec769(0x16b)],_0x5ec769(0x168));const _0xf38fc3=_0x3f9225[_0x5ec769(0x15e)],_0x23f6bb=_0x3f9225[_0x5ec769(0x14d)];_0x5ec885[_0x5ec769(0x163)]&&(console['error']('Parent\x20ID:\x20'+_0xf38fc3),console[_0x5ec769(0x151)]('Segment\x20ID:\x20'+_0x23f6bb));let _0x126a3b;if(_0x5ec885['folder']){const _0x18f7e0=_0x5ec885[_0x5ec769(0x162)],_0x1670c8=await withSpinner(_0x5ec769(0x167)+_0x18f7e0+_0x5ec769(0x171),()=>_0x54ee85[_0x5ec769(0x159)][_0x5ec769(0x166)](_0xf38fc3,_0x18f7e0),{'verbose':_0x5ec885[_0x5ec769(0x163)]});_0x126a3b=parseInt(_0x1670c8[_0x5ec769(0x155)],0xa),_0x5ec885[_0x5ec769(0x163)]&&console[_0x5ec769(0x151)](_0x5ec769(0x165)+_0x126a3b);}const _0x245444=await loadJSONFromOptions(_0x5ec885[_0x5ec769(0x160)],_0x5ec885[_0x5ec769(0x14c)]),_0x31ed1f={'name':_0x5ec885[_0x5ec769(0x158)],'description':_0x5ec885[_0x5ec769(0x148)],'rule':_0x245444,'kind':_0x5ec885[_0x5ec769(0x170)]!==undefined?parseInt(_0x5ec885[_0x5ec769(0x170)],0xa):undefined,'segmentFolderId':_0x126a3b},_0x261458=await withSpinner(_0x5ec769(0x156)+_0x3f9225[_0x5ec769(0x16d)]+_0x5ec769(0x171),()=>_0x54ee85[_0x5ec769(0x159)]['updateSegmentById'](_0xf38fc3,_0x23f6bb,_0x31ed1f),{'verbose':_0x5ec885['verbose']}),_0x3bd63d=_0x261458[_0x5ec769(0x155)];return console[_0x5ec769(0x151)](_0x5ec769(0x16f)+_0x3bd63d[_0x5ec769(0x158)]+'\x27'),_0x216c69!==_0xaa977f&&console['error']('\x20\x20\x20Path:\x20'+_0x216c69),await handleSDKOutput([_0x3bd63d],_0x5ec885),0x0;}}function a27_0xef06(){const _0x578ac0=['data','Updating\x20segment\x20\x27','3088119vtOLzX','name','segment','Examples:','segmentPath','Resolved\x20type:\x20','segment:update','parentId','resolvePathToResource','rule','Update\x20existing\x20child\x20segment','folder','verbose','Resolving\x20path\x20\x27','Resolved\x20folder\x20ID:\x20','resolveFolderId','Resolving\x20folder\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','5966048QSHvyL','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','INTERNAL','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','segmentName','includes','✔\x20Updated\x20segment\x20\x27','kind','\x27...','2224758akkpBn','Resolved\x20relative\x20path\x20to:\x20','11031021OcrYwN','description','14iBbDrv','type','656pEtBAi','ruleFile','segmentId','23515daKsSF','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','487912CzCARl','error','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Error:\x20Cannot\x20update\x20','388754UyGyCJ'];a27_0xef06=function(){return _0x578ac0;};return a27_0xef06();}
1
+ function a29_0x3492(){const _0x4e2960=['segmentPath','1253505hzOarS','7947544qOEsFK','segment:update','execute','length','type','segmentName','rule','\x27...','1048594XPDFtA','resolveFolderId','Segment\x20ID:\x20','description','segmentId','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','segment','name','includes','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Update\x20existing\x20child\x20segment','resolvePathToResource','verbose','Parent\x20ID:\x20','kind','Resolving\x20folder\x20\x27','Error:\x20Cannot\x20update\x20','folder','16540DjYlkQ','7hNVPWJ','parentId','Resolved\x20folder\x20ID:\x20','936OiDbMC','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','77276sZxBzZ','Resolved\x20relative\x20path\x20to:\x20','Examples:','INTERNAL','Resolving\x20path\x20\x27','\x20\x20\x20Path:\x20','error','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','ruleFile','Resolved\x20type:\x20','9542790adnuiY','122879fZFdVn'];a29_0x3492=function(){return _0x4e2960;};return a29_0x3492();}const a29_0x3f246d=a29_0x2968;(function(_0x367863,_0x3c2e74){const _0x35222e=a29_0x2968,_0x32b4c9=_0x367863();while(!![]){try{const _0x26ee13=parseInt(_0x35222e(0x7c))/0x1+-parseInt(_0x35222e(0x87))/0x2+parseInt(_0x35222e(0x7e))/0x3+-parseInt(_0x35222e(0x71))/0x4+parseInt(_0x35222e(0x99))/0x5*(parseInt(_0x35222e(0x6f))/0x6)+parseInt(_0x35222e(0x9a))/0x7*(-parseInt(_0x35222e(0x7f))/0x8)+parseInt(_0x35222e(0x7b))/0x9;if(_0x26ee13===_0x3c2e74)break;else _0x32b4c9['push'](_0x32b4c9['shift']());}catch(_0xd5337){_0x32b4c9['push'](_0x32b4c9['shift']());}}}(a29_0x3492,0x8d9ad));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a29_0x2968(_0x5d2e13,_0x112d47){const _0x34920a=a29_0x3492();return a29_0x2968=function(_0x2968fa,_0x2d1402){_0x2968fa=_0x2968fa-0x6f;let _0x4b173e=_0x34920a[_0x2968fa];return _0x4b173e;},a29_0x2968(_0x5d2e13,_0x112d47);}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{[a29_0x3f246d(0x8e)]=a29_0x3f246d(0x80);[a29_0x3f246d(0x8a)]=a29_0x3f246d(0x91);async[a29_0x3f246d(0x81)](_0x512695){const _0x4e5483=a29_0x3f246d,{options:_0x20e819,args:_0x293934,tdx:_0x5c2df9}=_0x512695,_0x27c4ed=_0x20e819;if(_0x293934[_0x4e5483(0x82)]===0x0)return console['error'](_0x4e5483(0x70)),console['error'](_0x4e5483(0x8c)),console[_0x4e5483(0x77)](_0x4e5483(0x73)),console[_0x4e5483(0x77)](_0x4e5483(0x90)),console[_0x4e5483(0x77)](_0x4e5483(0x78)),0x1;const _0x47d42b=_0x293934[0x0],_0x14d8c2=_0x20e819[_0x4e5483(0x7d)];let _0x4eef28=_0x47d42b;_0x14d8c2&&!_0x47d42b[_0x4e5483(0x8f)]('/')&&(_0x4eef28=_0x14d8c2+'/'+_0x47d42b,_0x27c4ed['verbose']&&console[_0x4e5483(0x77)](_0x4e5483(0x72)+_0x4eef28));const _0x3f40d7=await withSpinner(_0x4e5483(0x75)+_0x4eef28+_0x4e5483(0x86),()=>_0x5c2df9[_0x4e5483(0x8d)][_0x4e5483(0x92)](_0x4eef28),{'verbose':_0x27c4ed[_0x4e5483(0x93)]}),_0x3cd6e4=_0x3f40d7['data'];_0x27c4ed[_0x4e5483(0x93)]&&console['error'](_0x4e5483(0x7a)+_0x3cd6e4[_0x4e5483(0x83)]);if(_0x3cd6e4[_0x4e5483(0x83)]!==_0x4e5483(0x8d))return console[_0x4e5483(0x77)](_0x4e5483(0x97)+_0x3cd6e4[_0x4e5483(0x83)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x4e5483(0x77)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x3cd6e4[_0x4e5483(0x8b)])throw new SDKError(ErrorCode[_0x4e5483(0x74)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x88fd3d=_0x3cd6e4[_0x4e5483(0x9b)],_0xf812e6=_0x3cd6e4['segmentId'];_0x27c4ed['verbose']&&(console['error'](_0x4e5483(0x94)+_0x88fd3d),console[_0x4e5483(0x77)](_0x4e5483(0x89)+_0xf812e6));let _0x4f2a98;if(_0x27c4ed[_0x4e5483(0x98)]){const _0x24ecdc=_0x27c4ed[_0x4e5483(0x98)],_0x258161=await withSpinner(_0x4e5483(0x96)+_0x24ecdc+_0x4e5483(0x86),()=>_0x5c2df9[_0x4e5483(0x8d)][_0x4e5483(0x88)](_0x88fd3d,_0x24ecdc),{'verbose':_0x27c4ed[_0x4e5483(0x93)]});_0x4f2a98=parseInt(_0x258161['data'],0xa),_0x27c4ed[_0x4e5483(0x93)]&&console[_0x4e5483(0x77)](_0x4e5483(0x9c)+_0x4f2a98);}const _0x547667=await loadJSONFromOptions(_0x27c4ed[_0x4e5483(0x85)],_0x27c4ed[_0x4e5483(0x79)]),_0x4fdf46={'name':_0x27c4ed[_0x4e5483(0x8e)],'description':_0x27c4ed['description'],'rule':_0x547667,'kind':_0x27c4ed[_0x4e5483(0x95)]!==undefined?parseInt(_0x27c4ed[_0x4e5483(0x95)],0xa):undefined,'segmentFolderId':_0x4f2a98},_0xce04da=await withSpinner('Updating\x20segment\x20\x27'+_0x3cd6e4[_0x4e5483(0x84)]+'\x27...',()=>_0x5c2df9[_0x4e5483(0x8d)]['updateSegmentById'](_0x88fd3d,_0xf812e6,_0x4fdf46),{'verbose':_0x27c4ed[_0x4e5483(0x93)]}),_0x4947c3=_0xce04da['data'];return console[_0x4e5483(0x77)]('✔\x20Updated\x20segment\x20\x27'+_0x4947c3[_0x4e5483(0x8e)]+'\x27'),_0x4eef28!==_0x47d42b&&console[_0x4e5483(0x77)](_0x4e5483(0x76)+_0x4eef28),await handleSDKOutput([_0x4947c3],_0x27c4ed),0x0;}}
@@ -1 +1 @@
1
- const a28_0x4d9f16=a28_0x37e1;function a28_0x37e1(_0x7c8dbf,_0xeb48fc){const _0x2fe9e3=a28_0x2fe9();return a28_0x37e1=function(_0x37e1cd,_0x3f067a){_0x37e1cd=_0x37e1cd-0x15f;let _0x896ae1=_0x2fe9e3[_0x37e1cd];return _0x896ae1;},a28_0x37e1(_0x7c8dbf,_0xeb48fc);}(function(_0x57ad55,_0x193d35){const _0x1f38f6=a28_0x37e1,_0x291c45=_0x57ad55();while(!![]){try{const _0x882518=parseInt(_0x1f38f6(0x160))/0x1*(-parseInt(_0x1f38f6(0x17c))/0x2)+parseInt(_0x1f38f6(0x17a))/0x3+parseInt(_0x1f38f6(0x17b))/0x4*(parseInt(_0x1f38f6(0x180))/0x5)+parseInt(_0x1f38f6(0x16b))/0x6*(-parseInt(_0x1f38f6(0x161))/0x7)+-parseInt(_0x1f38f6(0x169))/0x8+-parseInt(_0x1f38f6(0x18a))/0x9*(parseInt(_0x1f38f6(0x171))/0xa)+parseInt(_0x1f38f6(0x189))/0xb;if(_0x882518===_0x193d35)break;else _0x291c45['push'](_0x291c45['shift']());}catch(_0x2d1063){_0x291c45['push'](_0x291c45['shift']());}}}(a28_0x2fe9,0x2652c));import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';export class SegmentUseCommand extends BaseCommand{['name']=a28_0x4d9f16(0x18d);[a28_0x4d9f16(0x167)]=a28_0x4d9f16(0x17d);async[a28_0x4d9f16(0x183)](_0xebed9b){const _0x2cce9f=a28_0x4d9f16,{options:_0x25d644,args:_0x233e23,tdx:_0x1de6be}=_0xebed9b;if(_0x233e23[_0x2cce9f(0x175)]===0x0)return console[_0x2cce9f(0x16a)](_0x2cce9f(0x16c)),console[_0x2cce9f(0x16a)](_0x2cce9f(0x162)),console[_0x2cce9f(0x16a)](_0x2cce9f(0x16e)),console[_0x2cce9f(0x16a)](_0x2cce9f(0x18f)),console[_0x2cce9f(0x16a)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console['error'](_0x2cce9f(0x192)),console['error'](_0x2cce9f(0x178)),0x1;const _0x27372b=_0x233e23[0x0],_0x1720ad=_0x25d644['session'];try{if(_0x27372b==='/')return saveSessionContext({'segment_path':undefined},_0x1720ad),console[_0x2cce9f(0x18c)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;const _0x52c470=_0x25d644[_0x2cce9f(0x181)];let _0x23431b=_0x27372b;const _0x26ddd6=parsePath(_0x27372b);if(!_0x26ddd6[_0x2cce9f(0x173)]){if(!_0x52c470)return console[_0x2cce9f(0x16a)](_0x2cce9f(0x172)),console[_0x2cce9f(0x16a)](_0x2cce9f(0x174)),0x1;if(_0x27372b==='..'){const _0x35fae8=_0x52c470[_0x2cce9f(0x170)]('/')[_0x2cce9f(0x190)](0x0,-0x1)[_0x2cce9f(0x179)]('/');_0x23431b=_0x35fae8||'/';}else _0x27372b==='.'?_0x23431b=_0x52c470:_0x23431b=_0x52c470+'/'+_0x27372b;_0x25d644[_0x2cce9f(0x166)]&&console['error'](_0x2cce9f(0x191)+_0x23431b);}if(_0x23431b==='/'||_0x23431b==='')return saveSessionContext({'segment_path':undefined},_0x1720ad),console[_0x2cce9f(0x18c)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;_0x23431b=normalizePath(_0x23431b);const _0x2723cb=parsePath(_0x23431b)[_0x2cce9f(0x188)];if(_0x2723cb[_0x2cce9f(0x175)]===0x0)return saveSessionContext({'segment_path':undefined},_0x1720ad),console[_0x2cce9f(0x18c)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;_0x25d644['verbose']&&(console[_0x2cce9f(0x16a)]('Site:\x20'+_0x25d644['site']),console['error']('Target\x20path:\x20'+_0x23431b));const _0x109f1e=await withSpinner(_0x2cce9f(0x185)+_0x23431b+_0x2cce9f(0x184),()=>_0x1de6be[_0x2cce9f(0x17f)][_0x2cce9f(0x16d)](_0x23431b),{'verbose':_0x25d644['verbose']}),_0x262cf9=_0x109f1e[_0x2cce9f(0x182)];_0x25d644['verbose']&&(console['error'](_0x2cce9f(0x18b)+_0x262cf9[_0x2cce9f(0x17e)]),console[_0x2cce9f(0x16a)](_0x2cce9f(0x176)+_0x262cf9['parentId']),_0x262cf9[_0x2cce9f(0x186)]&&console[_0x2cce9f(0x16a)](_0x2cce9f(0x177)+_0x262cf9['folderId']));if(_0x262cf9[_0x2cce9f(0x17e)]==='segment')return console[_0x2cce9f(0x16a)](_0x2cce9f(0x164)),console[_0x2cce9f(0x16a)](_0x2cce9f(0x18e)),console[_0x2cce9f(0x16a)]('Use:\x20tdx\x20segment\x20use\x20'+_0x262cf9['parentName']+(_0x262cf9[_0x2cce9f(0x16f)]?'/'+_0x262cf9[_0x2cce9f(0x16f)]['join']('/'):'')),0x1;return saveSessionContext({'segment_path':_0x262cf9['fullPath'],'parent_segment':_0x262cf9[_0x2cce9f(0x168)]},_0x1720ad),console['log'](_0x2cce9f(0x187)+_0x262cf9[_0x2cce9f(0x15f)]),_0x25d644['verbose']&&(console['error'](_0x2cce9f(0x163)),console[_0x2cce9f(0x16a)](_0x2cce9f(0x165)),console['error'](_0x2cce9f(0x193))),0x0;}catch(_0xcdc2b9){throw _0xcdc2b9;}}}function a28_0x2fe9(){const _0x277013=['type','segment','105FBLUMr','segmentPath','data','execute','\x27...','Resolving\x20path\x20\x27','folderId','Context\x20set\x20to:\x20','segments','5544143YBPAtF','130581aORrKX','Resolved\x20path\x20type:\x20','log','segment:use','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','slice','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','fullPath','139KgfEXz','13069CaFrkv','Usage:\x20tdx\x20segment\x20use\x20<path>','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','verbose','description','parentName','781904YcCtqL','error','774dqGTzY','Error:\x20Path\x20is\x20required','resolvePathToResource','Examples:','folderPath','split','140mXcoxp','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','isAbsolute','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','length','Parent\x20ID:\x20','Folder\x20ID:\x20','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','join','254322oNyOlP','54636RbdbFc','2546qRvESL','Set\x20current\x20segment/folder\x20context\x20for\x20navigation'];a28_0x2fe9=function(){return _0x277013;};return a28_0x2fe9();}
1
+ const a30_0x554f5b=a30_0x5302;(function(_0x25228c,_0x468309){const _0x1e891e=a30_0x5302,_0x5751b9=_0x25228c();while(!![]){try{const _0x526a40=parseInt(_0x1e891e(0x13b))/0x1+parseInt(_0x1e891e(0x129))/0x2+-parseInt(_0x1e891e(0x139))/0x3*(-parseInt(_0x1e891e(0x133))/0x4)+parseInt(_0x1e891e(0x12e))/0x5+-parseInt(_0x1e891e(0x11e))/0x6+parseInt(_0x1e891e(0x119))/0x7+-parseInt(_0x1e891e(0x140))/0x8;if(_0x526a40===_0x468309)break;else _0x5751b9['push'](_0x5751b9['shift']());}catch(_0x223bef){_0x5751b9['push'](_0x5751b9['shift']());}}}(a30_0x2bf0,0x4b3d7));import{BaseCommand}from'./command.js';function a30_0x5302(_0x367b7c,_0x50711d){const _0x2bf07e=a30_0x2bf0();return a30_0x5302=function(_0x53024f,_0x45b3ae){_0x53024f=_0x53024f-0x118;let _0x29a011=_0x2bf07e[_0x53024f];return _0x29a011;},a30_0x5302(_0x367b7c,_0x50711d);}import{saveSessionContext}from'../core/session.js';function a30_0x2bf0(){const _0x3cff95=['Use:\x20tdx\x20segment\x20use\x20','248775HkRbXo','verbose','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Context\x20cleared.\x20Back\x20to\x20root.','Target\x20path:\x20','4ZQvBpR','session','type','segments','Examples:','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','644322vIWOfm','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','184901SfwTjN','description','segment','folderId','slice','7758256vaqnDm','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','length','isAbsolute','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','join','3474065qbBXwQ','Error:\x20Path\x20is\x20required','error','Resolved\x20path\x20type:\x20','parentName','9846imWdTt','Usage:\x20tdx\x20segment\x20use\x20<path>','segment:use','Folder\x20ID:\x20','Resolving\x20path\x20\x27','segmentPath','fullPath','split','log','Resolved\x20relative\x20path\x20to:\x20','name','667762LVmgwT','folderPath','execute','\x27...'];a30_0x2bf0=function(){return _0x3cff95;};return a30_0x2bf0();}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';export class SegmentUseCommand extends BaseCommand{[a30_0x554f5b(0x128)]=a30_0x554f5b(0x120);[a30_0x554f5b(0x13c)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a30_0x554f5b(0x12b)](_0x181e75){const _0xcd741d=a30_0x554f5b,{options:_0x179352,args:_0x516345,tdx:_0x1eb7e8}=_0x181e75;if(_0x516345[_0xcd741d(0x142)]===0x0)return console[_0xcd741d(0x11b)](_0xcd741d(0x11a)),console[_0xcd741d(0x11b)](_0xcd741d(0x11f)),console[_0xcd741d(0x11b)](_0xcd741d(0x137)),console[_0xcd741d(0x11b)](_0xcd741d(0x138)),console[_0xcd741d(0x11b)](_0xcd741d(0x145)),console[_0xcd741d(0x11b)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console[_0xcd741d(0x11b)](_0xcd741d(0x144)),0x1;const _0x4e5bd2=_0x516345[0x0],_0x34a375=_0x179352[_0xcd741d(0x134)];try{if(_0x4e5bd2==='/')return saveSessionContext({'segment_path':undefined},_0x34a375),console[_0xcd741d(0x126)](_0xcd741d(0x131)),0x0;const _0x458f85=_0x179352[_0xcd741d(0x123)];let _0x1d53fd=_0x4e5bd2;const _0x95aef8=parsePath(_0x4e5bd2);if(!_0x95aef8[_0xcd741d(0x143)]){if(!_0x458f85)return console[_0xcd741d(0x11b)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.'),console[_0xcd741d(0x11b)](_0xcd741d(0x13a)),0x1;if(_0x4e5bd2==='..'){const _0x1859f3=_0x458f85[_0xcd741d(0x125)]('/')[_0xcd741d(0x13f)](0x0,-0x1)[_0xcd741d(0x118)]('/');_0x1d53fd=_0x1859f3||'/';}else _0x4e5bd2==='.'?_0x1d53fd=_0x458f85:_0x1d53fd=_0x458f85+'/'+_0x4e5bd2;_0x179352[_0xcd741d(0x12f)]&&console[_0xcd741d(0x11b)](_0xcd741d(0x127)+_0x1d53fd);}if(_0x1d53fd==='/'||_0x1d53fd==='')return saveSessionContext({'segment_path':undefined},_0x34a375),console['log'](_0xcd741d(0x131)),0x0;_0x1d53fd=normalizePath(_0x1d53fd);const _0x5e2393=parsePath(_0x1d53fd)[_0xcd741d(0x136)];if(_0x5e2393['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x34a375),console[_0xcd741d(0x126)](_0xcd741d(0x131)),0x0;_0x179352[_0xcd741d(0x12f)]&&(console[_0xcd741d(0x11b)]('Site:\x20'+_0x179352['site']),console['error'](_0xcd741d(0x132)+_0x1d53fd));const _0x143ca0=await withSpinner(_0xcd741d(0x122)+_0x1d53fd+_0xcd741d(0x12c),()=>_0x1eb7e8[_0xcd741d(0x13d)]['resolvePathToResource'](_0x1d53fd),{'verbose':_0x179352[_0xcd741d(0x12f)]}),_0x1751d9=_0x143ca0['data'];_0x179352[_0xcd741d(0x12f)]&&(console[_0xcd741d(0x11b)](_0xcd741d(0x11c)+_0x1751d9[_0xcd741d(0x135)]),console[_0xcd741d(0x11b)]('Parent\x20ID:\x20'+_0x1751d9['parentId']),_0x1751d9['folderId']&&console[_0xcd741d(0x11b)](_0xcd741d(0x121)+_0x1751d9[_0xcd741d(0x13e)]));if(_0x1751d9[_0xcd741d(0x135)]===_0xcd741d(0x13d))return console[_0xcd741d(0x11b)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.'),console[_0xcd741d(0x11b)](_0xcd741d(0x130)),console[_0xcd741d(0x11b)](_0xcd741d(0x12d)+_0x1751d9[_0xcd741d(0x11d)]+(_0x1751d9[_0xcd741d(0x12a)]?'/'+_0x1751d9[_0xcd741d(0x12a)][_0xcd741d(0x118)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x1751d9[_0xcd741d(0x124)],'parent_segment':_0x1751d9[_0xcd741d(0x11d)]},_0x34a375),console[_0xcd741d(0x126)]('Context\x20set\x20to:\x20'+_0x1751d9[_0xcd741d(0x124)]),_0x179352[_0xcd741d(0x12f)]&&(console[_0xcd741d(0x11b)](_0xcd741d(0x141)),console[_0xcd741d(0x11b)]('Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context'),console[_0xcd741d(0x11b)]('Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters')),0x0;}catch(_0xd2b103){throw _0xd2b103;}}}
@@ -1 +1 @@
1
- const a29_0xf84c78=a29_0x80df;(function(_0x5f22ce,_0x567c60){const _0x425bcc=a29_0x80df,_0x1bb071=_0x5f22ce();while(!![]){try{const _0x148448=-parseInt(_0x425bcc(0x165))/0x1*(parseInt(_0x425bcc(0x175))/0x2)+-parseInt(_0x425bcc(0x15c))/0x3+parseInt(_0x425bcc(0x171))/0x4*(parseInt(_0x425bcc(0x142))/0x5)+-parseInt(_0x425bcc(0x14b))/0x6*(parseInt(_0x425bcc(0x148))/0x7)+parseInt(_0x425bcc(0x178))/0x8+parseInt(_0x425bcc(0x153))/0x9+parseInt(_0x425bcc(0x149))/0xa;if(_0x148448===_0x567c60)break;else _0x1bb071['push'](_0x1bb071['shift']());}catch(_0x18b141){_0x1bb071['push'](_0x1bb071['shift']());}}}(a29_0x2907,0xf347d));function a29_0x80df(_0x4937e3,_0x7cbc5f){const _0x2907ca=a29_0x2907();return a29_0x80df=function(_0x80dfcd,_0x3baaaf){_0x80dfcd=_0x80dfcd-0x140;let _0x3f0f7e=_0x2907ca[_0x80dfcd];return _0x3f0f7e;},a29_0x80df(_0x4937e3,_0x7cbc5f);}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{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{formatRows}from'../utils/formatters.js';function a29_0x2907(){const _0x25f8bc=['Folder\x20ID:\x20','log','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','42pikVBK','13477020xqpmum','No\x20parent\x20segments\x20match\x20pattern:\x20','797058ZLErAj','error','map','\x20parent\x20segment','listUnified','\x20segment','cause','localeCompare','5730579fzXXRp','replace','description','recursive','Listing\x20parent\x20segments...','Recursive\x20mode:\x20enabled','(empty)','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','site','1915956gavIbJ','sort','resolvePathToResource','folder','folderId','Listing\x20folders\x20and\x20segments...','segment','parentId','Listing\x20parent\x20segments\x20matching\x20\x27','7177KbNYGU','Building\x20hierarchy\x20tree...','verbose','listParents','✔\x20Built\x20tree\x20with\x20','Parent\x20ID:\x20','message','\x20matching\x20\x27','✔\x20Found\x20','Path/pattern\x20arg:\x20','json','listRecursive','12ARfVaJ','Resolving\x20context\x20path\x20\x27','data','segmentPath','76ookmQT','test','dim','2537088NPxiZR','listParentsWithPattern','execute','length','\x27...','population','👥\x20','jsonl','attributes','Error:\x20','[parent\x20segments]','name','672240nkxlRR','includes','format'];a29_0x2907=function(){return _0x25f8bc;};return a29_0x2907();}import a29_0x31bb3b from'chalk';export class SegmentsCommand extends BaseCommand{[a29_0xf84c78(0x141)]='segments';[a29_0xf84c78(0x155)]='List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments';async[a29_0xf84c78(0x17a)](_0x35932b){const _0x298757=a29_0xf84c78,{options:_0x2e3d50,args:_0x516794}=_0x35932b,_0x4d7ac2=_0x2e3d50[_0x298757(0x156)],_0x22a0b2=_0x516794[0x0];try{const _0x3b6876=_0x2e3d50[_0x298757(0x174)];_0x2e3d50[_0x298757(0x167)]&&(console['error']('Site:\x20'+_0x2e3d50[_0x298757(0x15b)]),console[_0x298757(0x14c)]('Current\x20context:\x20'+(_0x3b6876||'/')),_0x22a0b2&&console[_0x298757(0x14c)](_0x298757(0x16e)+_0x22a0b2),_0x4d7ac2&&console[_0x298757(0x14c)](_0x298757(0x158)));if(_0x22a0b2){const _0x508ffb=_0x22a0b2[_0x298757(0x143)]('*')||_0x22a0b2[_0x298757(0x143)]('?');if(_0x508ffb&&!_0x3b6876)return await this[_0x298757(0x179)](_0x35932b,_0x22a0b2);else return _0x508ffb?(console['error'](_0x298757(0x147)),console[_0x298757(0x14c)](_0x298757(0x15a)),0x1):_0x4d7ac2?await this['listRecursive'](_0x35932b,_0x22a0b2):await this[_0x298757(0x14f)](_0x35932b,_0x22a0b2);}if(!_0x3b6876)return await this[_0x298757(0x168)](_0x35932b);return _0x4d7ac2?await this[_0x298757(0x170)](_0x35932b,_0x3b6876):await this['listUnified'](_0x35932b,_0x3b6876);}catch(_0x12d0a0){if(_0x12d0a0 instanceof SDKError)return console[_0x298757(0x14c)](_0x298757(0x181)+_0x12d0a0[_0x298757(0x16b)]),_0x12d0a0[_0x298757(0x151)]&&console['error']('\x20\x20Cause:\x20'+_0x12d0a0[_0x298757(0x151)]),0x1;throw _0x12d0a0;}}async[a29_0xf84c78(0x179)](_0x542cd3,_0x575c69){const _0x2cc558=a29_0xf84c78,{options:_0x1b73c7,tdx:_0x169208}=_0x542cd3,_0x4ae15b=await withSpinner(_0x2cc558(0x164)+_0x575c69+'\x27...',()=>_0x169208[_0x2cc558(0x162)][_0x2cc558(0x168)](),{'verbose':_0x1b73c7['verbose']}),_0x580af9=_0x4ae15b[_0x2cc558(0x173)],_0x58abcc=_0x575c69['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')[_0x2cc558(0x154)](/\?/g,'.'),_0x5d7f7b=new RegExp('^'+_0x58abcc+'$','i'),_0x9d1c20=_0x580af9['filter'](_0x494d78=>_0x5d7f7b[_0x2cc558(0x176)](_0x494d78['attributes']['name']));console[_0x2cc558(0x14c)](_0x2cc558(0x16d)+_0x9d1c20[_0x2cc558(0x17b)]+_0x2cc558(0x14e)+(_0x9d1c20[_0x2cc558(0x17b)]!==0x1?'s':'')+_0x2cc558(0x16c)+_0x575c69+'\x27');if(_0x1b73c7[_0x2cc558(0x144)]==='json'||_0x1b73c7[_0x2cc558(0x144)]==='jsonl')await handleSDKOutput(_0x9d1c20,_0x1b73c7);else{if(_0x9d1c20[_0x2cc558(0x17b)]===0x0)console['log'](_0x2cc558(0x14a)+_0x575c69);else{console['log'](_0x2cc558(0x140));for(const _0x4bb183 of _0x9d1c20){const _0x4288e8=_0x4bb183['attributes'][_0x2cc558(0x17d)]?a29_0x31bb3b[_0x2cc558(0x177)]('\x20('+formatRows(_0x4bb183[_0x2cc558(0x180)]['population'])+')'):'';console[_0x2cc558(0x146)](_0x2cc558(0x17e)+_0x4bb183[_0x2cc558(0x180)][_0x2cc558(0x141)]+_0x4288e8);}}}return 0x0;}async[a29_0xf84c78(0x168)](_0x57a3b7){const _0x545582=a29_0xf84c78,{options:_0x4c5534,tdx:_0x16ae57}=_0x57a3b7,_0x8eaba5=await withSpinner(_0x545582(0x157),()=>_0x16ae57[_0x545582(0x162)][_0x545582(0x168)](),{'verbose':_0x4c5534[_0x545582(0x167)]}),_0x5093d3=_0x8eaba5[_0x545582(0x173)];console[_0x545582(0x14c)](_0x545582(0x16d)+_0x5093d3[_0x545582(0x17b)]+'\x20parent\x20segment'+(_0x5093d3[_0x545582(0x17b)]!==0x1?'s':''));if(_0x4c5534[_0x545582(0x144)]===_0x545582(0x16f)||_0x4c5534[_0x545582(0x144)]===_0x545582(0x17f))await handleSDKOutput(_0x5093d3,_0x4c5534);else{console[_0x545582(0x146)](_0x545582(0x140));for(const _0x3ce9a4 of _0x5093d3){const _0x550058=_0x3ce9a4[_0x545582(0x180)]['population']?a29_0x31bb3b[_0x545582(0x177)]('\x20('+formatRows(_0x3ce9a4['attributes'][_0x545582(0x17d)])+')'):'';console[_0x545582(0x146)](_0x545582(0x17e)+_0x3ce9a4[_0x545582(0x180)][_0x545582(0x141)]+_0x550058);}}return 0x0;}async[a29_0xf84c78(0x14f)](_0x655df9,_0x48a473){const _0x545d08=a29_0xf84c78,{options:_0x237186,tdx:_0x832194}=_0x655df9,_0x144a87=await withSpinner(_0x545d08(0x172)+_0x48a473+'\x27...',()=>_0x832194[_0x545d08(0x162)][_0x545d08(0x15e)](_0x48a473),{'verbose':_0x237186['verbose']}),_0x39cdd3=_0x144a87[_0x545d08(0x173)];_0x237186['verbose']&&(console[_0x545d08(0x14c)](_0x545d08(0x16a)+_0x39cdd3[_0x545d08(0x163)]),_0x39cdd3['folderId']&&console[_0x545d08(0x14c)](_0x545d08(0x145)+_0x39cdd3[_0x545d08(0x160)]));const _0x509565=await withSpinner(_0x545d08(0x161),()=>_0x832194['segment'][_0x545d08(0x14f)](_0x39cdd3[_0x545d08(0x163)],_0x39cdd3['folderId']),{'verbose':_0x237186[_0x545d08(0x167)]}),{folders:_0x58ec9c,segments:_0xd45f12}=_0x509565[_0x545d08(0x173)],_0x5c1c49=_0x58ec9c['length']+_0xd45f12[_0x545d08(0x17b)];console['error'](_0x545d08(0x16d)+_0x58ec9c[_0x545d08(0x17b)]+'\x20folder'+(_0x58ec9c[_0x545d08(0x17b)]!==0x1?'s':'')+'\x20and\x20'+_0xd45f12['length']+_0x545d08(0x150)+(_0xd45f12['length']!==0x1?'s':''));if(_0x237186['format']===_0x545d08(0x16f)||_0x237186[_0x545d08(0x144)]===_0x545d08(0x17f)){const _0x15d6fb=[..._0x58ec9c[_0x545d08(0x14d)](_0x34da7a=>({..._0x34da7a,'type':_0x545d08(0x15f)})),..._0xd45f12['map'](_0x4ac27d=>({..._0x4ac27d,'type':_0x545d08(0x162)}))][_0x545d08(0x15d)]((_0x3a4699,_0x37715f)=>_0x3a4699[_0x545d08(0x141)][_0x545d08(0x152)](_0x37715f[_0x545d08(0x141)]));await handleSDKOutput(_0x15d6fb,_0x237186);}else{if(_0x5c1c49===0x0)console[_0x545d08(0x146)](a29_0x31bb3b[_0x545d08(0x177)]('[/'+_0x48a473+']')),console[_0x545d08(0x146)](_0x545d08(0x159));else{console[_0x545d08(0x146)](a29_0x31bb3b[_0x545d08(0x177)]('[/'+_0x48a473+']'));const _0xeede00=formatFlatList(_0x58ec9c,_0xd45f12,{'showMetadata':!![]});console[_0x545d08(0x146)](_0xeede00);}}return 0x0;}async['listRecursive'](_0x5bb62e,_0x427637){const _0x40c732=a29_0xf84c78,{options:_0x4a5b33,tdx:_0x1ae9ad}=_0x5bb62e,_0x25e233=await withSpinner(_0x40c732(0x172)+_0x427637+_0x40c732(0x17c),()=>_0x1ae9ad[_0x40c732(0x162)]['resolvePathToResource'](_0x427637),{'verbose':_0x4a5b33[_0x40c732(0x167)]}),_0x251f67=_0x25e233['data'];_0x4a5b33[_0x40c732(0x167)]&&(console['error'](_0x40c732(0x16a)+_0x251f67[_0x40c732(0x163)]),_0x251f67[_0x40c732(0x160)]&&console[_0x40c732(0x14c)](_0x40c732(0x145)+_0x251f67['folderId']));const _0x3279c6=_0x4a5b33['maxDepth']||0xa,_0x59d7d9=await withSpinner(_0x40c732(0x166),()=>_0x1ae9ad[_0x40c732(0x162)][_0x40c732(0x170)](_0x251f67['parentId'],_0x251f67['folderId'],0x0,_0x3279c6),{'verbose':_0x4a5b33[_0x40c732(0x167)]}),_0x3faf71=_0x59d7d9[_0x40c732(0x173)];console[_0x40c732(0x14c)](_0x40c732(0x169)+_0x3faf71[_0x40c732(0x17b)]+'\x20top-level\x20items');if(_0x4a5b33[_0x40c732(0x144)]===_0x40c732(0x16f)||_0x4a5b33[_0x40c732(0x144)]===_0x40c732(0x17f))await handleSDKOutput(_0x3faf71,_0x4a5b33);else{console[_0x40c732(0x146)](a29_0x31bb3b[_0x40c732(0x177)]('[/'+_0x427637+']'));const _0x40d2f9=formatTree(_0x3faf71,{'showMetadata':!![]});console[_0x40c732(0x146)](_0x40d2f9);}return 0x0;}}
1
+ const a31_0x2315f9=a31_0x470b;(function(_0xd886ae,_0xdc90bb){const _0xbedd4a=a31_0x470b,_0x37586f=_0xd886ae();while(!![]){try{const _0x5d4062=-parseInt(_0xbedd4a(0xb3))/0x1+-parseInt(_0xbedd4a(0xc3))/0x2*(-parseInt(_0xbedd4a(0xc7))/0x3)+-parseInt(_0xbedd4a(0xcd))/0x4+-parseInt(_0xbedd4a(0xb0))/0x5*(parseInt(_0xbedd4a(0xdc))/0x6)+-parseInt(_0xbedd4a(0xe9))/0x7*(parseInt(_0xbedd4a(0xdf))/0x8)+parseInt(_0xbedd4a(0xab))/0x9+parseInt(_0xbedd4a(0xc4))/0xa;if(_0x5d4062===_0xdc90bb)break;else _0x37586f['push'](_0x37586f['shift']());}catch(_0x1a00fd){_0x37586f['push'](_0x37586f['shift']());}}}(a31_0x490a,0x9193d));import{BaseCommand}from'./command.js';function a31_0x470b(_0x3233aa,_0x1a2e8a){const _0x490a00=a31_0x490a();return a31_0x470b=function(_0x470b54,_0x308469){_0x470b54=_0x470b54-0xaa;let _0x18a913=_0x490a00[_0x470b54];return _0x18a913;},a31_0x470b(_0x3233aa,_0x1a2e8a);}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a31_0x490a(){const _0x531d32=['Error:\x20','10049652GLwHtd','\x20top-level\x20items','sort','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','replace','3170vscSuu','listRecursive','Resolving\x20context\x20path\x20\x27','288913keRHlL','json','population','Building\x20hierarchy\x20tree...','error','\x20matching\x20\x27','segment','folder','Site:\x20','attributes','\x20and\x20','Listing\x20parent\x20segments\x20matching\x20\x27','\x20parent\x20segment','Current\x20context:\x20','listUnified','jsonl','1129266VAJQJH','11628480cfMzRl','\x20\x20Cause:\x20','localeCompare','3JISEuh','length','(empty)','parentId','dim','recursive','2768744gzuzXl','Path/pattern\x20arg:\x20','listParents','name','data','👥\x20','[parent\x20segments]','log','execute','Listing\x20folders\x20and\x20segments...','segments','format','maxDepth','listParentsWithPattern','folderId','8214PTFPMk','cause','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','3190232OwKNkz','\x27...','includes','Folder\x20ID:\x20','verbose','resolvePathToResource','Parent\x20ID:\x20','✔\x20Found\x20','map','\x20segment','7KOCsTM','\x20folder','\x5c$&','message'];a31_0x490a=function(){return _0x531d32;};return a31_0x490a();}import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{formatRows}from'../utils/formatters.js';import a31_0x136c25 from'chalk';export class SegmentsCommand extends BaseCommand{[a31_0x2315f9(0xd0)]=a31_0x2315f9(0xd7);['description']=a31_0x2315f9(0xae);async[a31_0x2315f9(0xd5)](_0x38ce9b){const _0x44a376=a31_0x2315f9,{options:_0x4f1838,args:_0x45175c}=_0x38ce9b,_0x5aa442=_0x4f1838[_0x44a376(0xcc)],_0x552262=_0x45175c[0x0];try{const _0x2aa8cb=_0x4f1838['segmentPath'];_0x4f1838['verbose']&&(console[_0x44a376(0xb7)](_0x44a376(0xbb)+_0x4f1838['site']),console[_0x44a376(0xb7)](_0x44a376(0xc0)+(_0x2aa8cb||'/')),_0x552262&&console[_0x44a376(0xb7)](_0x44a376(0xce)+_0x552262),_0x5aa442&&console[_0x44a376(0xb7)]('Recursive\x20mode:\x20enabled'));if(_0x552262){const _0x32ad29=_0x552262['includes']('*')||_0x552262[_0x44a376(0xe1)]('?');if(_0x32ad29&&!_0x2aa8cb)return await this[_0x44a376(0xda)](_0x38ce9b,_0x552262);else return _0x32ad29?(console['error'](_0x44a376(0xde)),console[_0x44a376(0xb7)]('Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/'),0x1):_0x5aa442?await this[_0x44a376(0xb1)](_0x38ce9b,_0x552262):await this['listUnified'](_0x38ce9b,_0x552262);}if(!_0x2aa8cb)return await this[_0x44a376(0xcf)](_0x38ce9b);return _0x5aa442?await this[_0x44a376(0xb1)](_0x38ce9b,_0x2aa8cb):await this[_0x44a376(0xc1)](_0x38ce9b,_0x2aa8cb);}catch(_0x16a366){if(_0x16a366 instanceof SDKError)return console[_0x44a376(0xb7)](_0x44a376(0xaa)+_0x16a366[_0x44a376(0xec)]),_0x16a366[_0x44a376(0xdd)]&&console[_0x44a376(0xb7)](_0x44a376(0xc5)+_0x16a366[_0x44a376(0xdd)]),0x1;throw _0x16a366;}}async[a31_0x2315f9(0xda)](_0x3b2268,_0x447504){const _0x272f9a=a31_0x2315f9,{options:_0x729398,tdx:_0x57b4f3}=_0x3b2268,_0x277dee=await withSpinner(_0x272f9a(0xbe)+_0x447504+_0x272f9a(0xe0),()=>_0x57b4f3['segment'][_0x272f9a(0xcf)](),{'verbose':_0x729398['verbose']}),_0x4e99c4=_0x277dee[_0x272f9a(0xd1)],_0x25894b=_0x447504[_0x272f9a(0xaf)](/[.+^${}()|[\]\\]/g,_0x272f9a(0xeb))[_0x272f9a(0xaf)](/\*/g,'.*')[_0x272f9a(0xaf)](/\?/g,'.'),_0x54ca89=new RegExp('^'+_0x25894b+'$','i'),_0x45a72d=_0x4e99c4['filter'](_0x59a9ef=>_0x54ca89['test'](_0x59a9ef['attributes'][_0x272f9a(0xd0)]));console['error'](_0x272f9a(0xe6)+_0x45a72d[_0x272f9a(0xc8)]+_0x272f9a(0xbf)+(_0x45a72d[_0x272f9a(0xc8)]!==0x1?'s':'')+_0x272f9a(0xb8)+_0x447504+'\x27');if(_0x729398[_0x272f9a(0xd8)]==='json'||_0x729398['format']==='jsonl')await handleSDKOutput(_0x45a72d,_0x729398);else{if(_0x45a72d[_0x272f9a(0xc8)]===0x0)console['log']('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x447504);else{console['log'](_0x272f9a(0xd3));for(const _0x15df5f of _0x45a72d){const _0x449a15=_0x15df5f[_0x272f9a(0xbc)][_0x272f9a(0xb5)]?a31_0x136c25[_0x272f9a(0xcb)]('\x20('+formatRows(_0x15df5f[_0x272f9a(0xbc)][_0x272f9a(0xb5)])+')'):'';console[_0x272f9a(0xd4)](_0x272f9a(0xd2)+_0x15df5f[_0x272f9a(0xbc)][_0x272f9a(0xd0)]+_0x449a15);}}}return 0x0;}async[a31_0x2315f9(0xcf)](_0x8c70d0){const _0x566041=a31_0x2315f9,{options:_0x26e370,tdx:_0x1d724b}=_0x8c70d0,_0xc9762e=await withSpinner('Listing\x20parent\x20segments...',()=>_0x1d724b[_0x566041(0xb9)][_0x566041(0xcf)](),{'verbose':_0x26e370['verbose']}),_0x32bacb=_0xc9762e[_0x566041(0xd1)];console['error'](_0x566041(0xe6)+_0x32bacb['length']+_0x566041(0xbf)+(_0x32bacb[_0x566041(0xc8)]!==0x1?'s':''));if(_0x26e370[_0x566041(0xd8)]===_0x566041(0xb4)||_0x26e370[_0x566041(0xd8)]===_0x566041(0xc2))await handleSDKOutput(_0x32bacb,_0x26e370);else{console[_0x566041(0xd4)]('[parent\x20segments]');for(const _0x923320 of _0x32bacb){const _0x9b79a3=_0x923320[_0x566041(0xbc)][_0x566041(0xb5)]?a31_0x136c25['dim']('\x20('+formatRows(_0x923320['attributes'][_0x566041(0xb5)])+')'):'';console[_0x566041(0xd4)](_0x566041(0xd2)+_0x923320[_0x566041(0xbc)]['name']+_0x9b79a3);}}return 0x0;}async['listUnified'](_0x468c84,_0x3c521b){const _0x1baa6c=a31_0x2315f9,{options:_0x131077,tdx:_0x1a2b52}=_0x468c84,_0x4fd0b2=await withSpinner(_0x1baa6c(0xb2)+_0x3c521b+_0x1baa6c(0xe0),()=>_0x1a2b52['segment'][_0x1baa6c(0xe4)](_0x3c521b),{'verbose':_0x131077[_0x1baa6c(0xe3)]}),_0x1310cf=_0x4fd0b2['data'];_0x131077['verbose']&&(console[_0x1baa6c(0xb7)](_0x1baa6c(0xe5)+_0x1310cf[_0x1baa6c(0xca)]),_0x1310cf[_0x1baa6c(0xdb)]&&console[_0x1baa6c(0xb7)](_0x1baa6c(0xe2)+_0x1310cf[_0x1baa6c(0xdb)]));const _0x1594cf=await withSpinner(_0x1baa6c(0xd6),()=>_0x1a2b52[_0x1baa6c(0xb9)][_0x1baa6c(0xc1)](_0x1310cf[_0x1baa6c(0xca)],_0x1310cf[_0x1baa6c(0xdb)]),{'verbose':_0x131077['verbose']}),{folders:_0x595817,segments:_0x5c7aea}=_0x1594cf[_0x1baa6c(0xd1)],_0x10d614=_0x595817[_0x1baa6c(0xc8)]+_0x5c7aea[_0x1baa6c(0xc8)];console[_0x1baa6c(0xb7)](_0x1baa6c(0xe6)+_0x595817[_0x1baa6c(0xc8)]+_0x1baa6c(0xea)+(_0x595817[_0x1baa6c(0xc8)]!==0x1?'s':'')+_0x1baa6c(0xbd)+_0x5c7aea[_0x1baa6c(0xc8)]+_0x1baa6c(0xe8)+(_0x5c7aea[_0x1baa6c(0xc8)]!==0x1?'s':''));if(_0x131077[_0x1baa6c(0xd8)]===_0x1baa6c(0xb4)||_0x131077[_0x1baa6c(0xd8)]===_0x1baa6c(0xc2)){const _0x4f7f3f=[..._0x595817[_0x1baa6c(0xe7)](_0x3df5d1=>({..._0x3df5d1,'type':_0x1baa6c(0xba)})),..._0x5c7aea[_0x1baa6c(0xe7)](_0xfd609b=>({..._0xfd609b,'type':_0x1baa6c(0xb9)}))][_0x1baa6c(0xad)]((_0x10ebfc,_0x12af22)=>_0x10ebfc[_0x1baa6c(0xd0)][_0x1baa6c(0xc6)](_0x12af22[_0x1baa6c(0xd0)]));await handleSDKOutput(_0x4f7f3f,_0x131077);}else{if(_0x10d614===0x0)console['log'](a31_0x136c25['dim']('[/'+_0x3c521b+']')),console[_0x1baa6c(0xd4)](_0x1baa6c(0xc9));else{console[_0x1baa6c(0xd4)](a31_0x136c25[_0x1baa6c(0xcb)]('[/'+_0x3c521b+']'));const _0x5488bc=formatFlatList(_0x595817,_0x5c7aea,{'showMetadata':!![]});console[_0x1baa6c(0xd4)](_0x5488bc);}}return 0x0;}async[a31_0x2315f9(0xb1)](_0x181bda,_0xf68f98){const _0x24ac29=a31_0x2315f9,{options:_0x337820,tdx:_0x273435}=_0x181bda,_0x3ea522=await withSpinner(_0x24ac29(0xb2)+_0xf68f98+_0x24ac29(0xe0),()=>_0x273435[_0x24ac29(0xb9)][_0x24ac29(0xe4)](_0xf68f98),{'verbose':_0x337820[_0x24ac29(0xe3)]}),_0x43c776=_0x3ea522['data'];_0x337820[_0x24ac29(0xe3)]&&(console[_0x24ac29(0xb7)]('Parent\x20ID:\x20'+_0x43c776[_0x24ac29(0xca)]),_0x43c776[_0x24ac29(0xdb)]&&console[_0x24ac29(0xb7)](_0x24ac29(0xe2)+_0x43c776[_0x24ac29(0xdb)]));const _0x464389=_0x337820[_0x24ac29(0xd9)]||0xa,_0x4cca9f=await withSpinner(_0x24ac29(0xb6),()=>_0x273435[_0x24ac29(0xb9)][_0x24ac29(0xb1)](_0x43c776[_0x24ac29(0xca)],_0x43c776['folderId'],0x0,_0x464389),{'verbose':_0x337820[_0x24ac29(0xe3)]}),_0x1af143=_0x4cca9f['data'];console[_0x24ac29(0xb7)]('✔\x20Built\x20tree\x20with\x20'+_0x1af143[_0x24ac29(0xc8)]+_0x24ac29(0xac));if(_0x337820[_0x24ac29(0xd8)]===_0x24ac29(0xb4)||_0x337820[_0x24ac29(0xd8)]===_0x24ac29(0xc2))await handleSDKOutput(_0x1af143,_0x337820);else{console[_0x24ac29(0xd4)](a31_0x136c25[_0x24ac29(0xcb)]('[/'+_0xf68f98+']'));const _0x41f465=formatTree(_0x1af143,{'showMetadata':!![]});console[_0x24ac29(0xd4)](_0x41f465);}return 0x0;}}
@@ -1 +1 @@
1
- const a30_0x27b6a9=a30_0x1bbd;(function(_0x502da1,_0x1b1702){const _0x188db0=a30_0x1bbd,_0x31228b=_0x502da1();while(!![]){try{const _0x3ef125=-parseInt(_0x188db0(0xbc))/0x1+parseInt(_0x188db0(0xb6))/0x2*(-parseInt(_0x188db0(0xca))/0x3)+parseInt(_0x188db0(0xc2))/0x4+parseInt(_0x188db0(0xb1))/0x5+parseInt(_0x188db0(0xcf))/0x6*(-parseInt(_0x188db0(0xc6))/0x7)+parseInt(_0x188db0(0xb2))/0x8+-parseInt(_0x188db0(0xbb))/0x9*(-parseInt(_0x188db0(0xc7))/0xa);if(_0x3ef125===_0x1b1702)break;else _0x31228b['push'](_0x31228b['shift']());}catch(_0x43a616){_0x31228b['push'](_0x31228b['shift']());}}}(a30_0x96ea,0x65c32));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a30_0x96ea(){const _0x1c6314=['✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','33692lTQnJW','Site:\x20','site','execute','name','67950akNNNm','656366WnVSTF','table','\x20\x20Cause:\x20','Show\x20table\x20contents','error','args','2798792ENNynp','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','data','✔\x20Retrieved\x20','21CvgEJs','1440BxVpfD','message','cause','105hOdyEc','Usage:\x20tdx\x20show\x20<database.table>','\x20row','show','showTable','1604838ZYUMgA','Catalog:\x20','...','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','database','Error:\x20','length','1233580hciASi','3452792KquALt','\x20from\x20','Querying\x20'];a30_0x96ea=function(){return _0x1c6314;};return a30_0x96ea();}function a30_0x1bbd(_0x11d40d,_0x3796db){const _0x96ea17=a30_0x96ea();return a30_0x1bbd=function(_0x1bbd77,_0x26ff0b){_0x1bbd77=_0x1bbd77-0xab;let _0x53a665=_0x96ea17[_0x1bbd77];return _0x53a665;},a30_0x1bbd(_0x11d40d,_0x3796db);}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{[a30_0x27b6a9(0xba)]=a30_0x27b6a9(0xcd);['description']=a30_0x27b6a9(0xbf);async[a30_0x27b6a9(0xb9)](_0x48d375){return this['showTable'](_0x48d375);}async[a30_0x27b6a9(0xce)](_0x336e98){const _0x2ea7e2=a30_0x27b6a9,{options:_0x559687,args:_0x3cc433,tdx:_0x52a9db}=_0x336e98;let _0x862563;try{_0x862563=parseTableReference(_0x3cc433[0x0]);const _0x16fa75=_0x559687[_0x2ea7e2(0xae)];!_0x862563[_0x2ea7e2(0xae)]&&_0x16fa75&&(_0x862563[_0x2ea7e2(0xae)]=_0x16fa75);const _0x9e819b=validateTableDescribeReference(_0x862563);if(_0x9e819b)return console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xaf)+_0x9e819b),console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xcb)),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x2ea7e2(0xc0)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x4baa9b){return console[_0x2ea7e2(0xc0)]('Error:\x20'+_0x4baa9b[_0x2ea7e2(0xc8)]),console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xcb)),console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xc3)),console[_0x2ea7e2(0xc0)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x2fb66d=_0x862563['catalog'],_0x96c9ed=_0x862563[_0x2ea7e2(0xae)],_0x42df2d=_0x862563[_0x2ea7e2(0xbd)],_0x473758=resolveLimit(_0x559687['limit'],DEFAULT_DISPLAY_LIMIT);try{_0x559687['verbose']&&(console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xb7)+_0x559687[_0x2ea7e2(0xb8)]),_0x2fb66d&&console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xab)+_0x2fb66d),console[_0x2ea7e2(0xc0)]('Database:\x20'+_0x96c9ed),console[_0x2ea7e2(0xc0)]('Table:\x20'+_0x42df2d),console[_0x2ea7e2(0xc0)]('Limit:\x20'+_0x473758));const _0x3d8619=_0x2fb66d?_0x2fb66d+'.'+_0x96c9ed+'.'+_0x42df2d:_0x96c9ed+'.'+_0x42df2d,_0xc6fca3=await withSpinner(_0x2ea7e2(0xb4)+_0x3d8619+_0x2ea7e2(0xac),()=>_0x52a9db['query'][_0x2ea7e2(0xce)](_0x96c9ed,_0x42df2d,_0x473758,_0x2fb66d),{'verbose':_0x559687['verbose']}),_0x2fbacd=_0xc6fca3[_0x2ea7e2(0xc4)],_0x3dfe09=_0x2fbacd[_0x2ea7e2(0xc4)];return _0x3dfe09[_0x2ea7e2(0xb0)]===0x0?console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xb5)):console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xc5)+_0x3dfe09['length']+_0x2ea7e2(0xcc)+(_0x3dfe09[_0x2ea7e2(0xb0)]!==0x1?'s':'')+_0x2ea7e2(0xb3)+_0x3d8619),await handleSDKOutput(_0x3dfe09,_0x559687),0x0;}catch(_0x21d4f4){if(_0x21d4f4 instanceof SDKError)return console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xaf)+_0x21d4f4[_0x2ea7e2(0xc8)]),_0x21d4f4[_0x2ea7e2(0xc9)]&&console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xbe)+_0x21d4f4[_0x2ea7e2(0xc9)]),0x1;throw _0x21d4f4;}}['validate'](_0x20a777){const _0x18f656=a30_0x27b6a9;if(_0x20a777['args']['length']===0x0)return'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';if(_0x20a777[_0x18f656(0xc1)]['length']>0x1)return _0x18f656(0xad);return undefined;}}
1
+ const a32_0x31f7c0=a32_0x873d;function a32_0x402d(){const _0x2a9251=['showTable','description','3554388jDPDIY','8JyotZz','args','length','error','verbose','20663460JCHRGS','\x20from\x20','Limit:\x20','Table:\x20','query','\x20row','3813KyVCNK','358VcDpPT','catalog','data','table','show','validate','database','...','262402KZfdeP','\x20\x20Cause:\x20','limit','Error:\x20','2434116VUlwwF','4238073PACrgf','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','Usage:\x20tdx\x20show\x20<database.table>','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','✔\x20Retrieved\x20','cause','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','Catalog:\x20','3MAfWwa','4726445mPmVhO','message'];a32_0x402d=function(){return _0x2a9251;};return a32_0x402d();}(function(_0x907893,_0x1697dc){const _0x50cc56=a32_0x873d,_0x240ec4=_0x907893();while(!![]){try{const _0x390a53=-parseInt(_0x50cc56(0x189))/0x1*(-parseInt(_0x50cc56(0x18a))/0x2)+parseInt(_0x50cc56(0x178))/0x3*(parseInt(_0x50cc56(0x17d))/0x4)+parseInt(_0x50cc56(0x179))/0x5+-parseInt(_0x50cc56(0x16f))/0x6+parseInt(_0x50cc56(0x16b))/0x7+-parseInt(_0x50cc56(0x17e))/0x8*(-parseInt(_0x50cc56(0x170))/0x9)+-parseInt(_0x50cc56(0x183))/0xa;if(_0x390a53===_0x1697dc)break;else _0x240ec4['push'](_0x240ec4['shift']());}catch(_0x21ea15){_0x240ec4['push'](_0x240ec4['shift']());}}}(a32_0x402d,0x86f3c));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 a32_0x873d(_0x101d2d,_0x1ad4ac){const _0x402d75=a32_0x402d();return a32_0x873d=function(_0x873d08,_0x3b7d2a){_0x873d08=_0x873d08-0x167;let _0x3faa33=_0x402d75[_0x873d08];return _0x3faa33;},a32_0x873d(_0x101d2d,_0x1ad4ac);}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{['name']=a32_0x31f7c0(0x167);[a32_0x31f7c0(0x17c)]='Show\x20table\x20contents';async['execute'](_0x3d0c3c){const _0x11d7cb=a32_0x31f7c0;return this[_0x11d7cb(0x17b)](_0x3d0c3c);}async[a32_0x31f7c0(0x17b)](_0x1c7ef6){const _0x46c0d5=a32_0x31f7c0,{options:_0x432405,args:_0x2406b5,tdx:_0x3f1f53}=_0x1c7ef6;let _0x58d60b;try{_0x58d60b=parseTableReference(_0x2406b5[0x0]);const _0x28bad2=_0x432405[_0x46c0d5(0x169)];!_0x58d60b[_0x46c0d5(0x169)]&&_0x28bad2&&(_0x58d60b[_0x46c0d5(0x169)]=_0x28bad2);const _0x516d3c=validateTableDescribeReference(_0x58d60b);if(_0x516d3c)return console[_0x46c0d5(0x181)](_0x46c0d5(0x16e)+_0x516d3c),console[_0x46c0d5(0x181)](_0x46c0d5(0x172)),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console['error'](_0x46c0d5(0x171)),0x1;}catch(_0x21e33f){return console[_0x46c0d5(0x181)](_0x46c0d5(0x16e)+_0x21e33f[_0x46c0d5(0x17a)]),console['error'](_0x46c0d5(0x172)),console[_0x46c0d5(0x181)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x46c0d5(0x181)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x1a706d=_0x58d60b[_0x46c0d5(0x18b)],_0x4496ec=_0x58d60b['database'],_0x26e21c=_0x58d60b[_0x46c0d5(0x18d)],_0x54fcc8=resolveLimit(_0x432405[_0x46c0d5(0x16d)],DEFAULT_DISPLAY_LIMIT);try{_0x432405['verbose']&&(console[_0x46c0d5(0x181)]('Site:\x20'+_0x432405['site']),_0x1a706d&&console['error'](_0x46c0d5(0x177)+_0x1a706d),console[_0x46c0d5(0x181)]('Database:\x20'+_0x4496ec),console['error'](_0x46c0d5(0x186)+_0x26e21c),console[_0x46c0d5(0x181)](_0x46c0d5(0x185)+_0x54fcc8));const _0x4d51eb=_0x1a706d?_0x1a706d+'.'+_0x4496ec+'.'+_0x26e21c:_0x4496ec+'.'+_0x26e21c,_0x4cc5e8=await withSpinner('Querying\x20'+_0x4d51eb+_0x46c0d5(0x16a),()=>_0x3f1f53[_0x46c0d5(0x187)][_0x46c0d5(0x17b)](_0x4496ec,_0x26e21c,_0x54fcc8,_0x1a706d),{'verbose':_0x432405[_0x46c0d5(0x182)]}),_0x83646d=_0x4cc5e8[_0x46c0d5(0x18c)],_0x1a99bb=_0x83646d[_0x46c0d5(0x18c)];return _0x1a99bb[_0x46c0d5(0x180)]===0x0?console[_0x46c0d5(0x181)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x46c0d5(0x181)](_0x46c0d5(0x174)+_0x1a99bb[_0x46c0d5(0x180)]+_0x46c0d5(0x188)+(_0x1a99bb[_0x46c0d5(0x180)]!==0x1?'s':'')+_0x46c0d5(0x184)+_0x4d51eb),await handleSDKOutput(_0x1a99bb,_0x432405),0x0;}catch(_0x293e4e){if(_0x293e4e instanceof SDKError)return console[_0x46c0d5(0x181)]('Error:\x20'+_0x293e4e['message']),_0x293e4e[_0x46c0d5(0x175)]&&console[_0x46c0d5(0x181)](_0x46c0d5(0x16c)+_0x293e4e['cause']),0x1;throw _0x293e4e;}}[a32_0x31f7c0(0x168)](_0x5512a2){const _0x4fd1df=a32_0x31f7c0;if(_0x5512a2[_0x4fd1df(0x17f)]['length']===0x0)return _0x4fd1df(0x176);if(_0x5512a2['args'][_0x4fd1df(0x180)]>0x1)return _0x4fd1df(0x173);return undefined;}}
@@ -1 +1 @@
1
- const a31_0x50aa3c=a31_0xface;(function(_0x9e0b0,_0x1dd120){const _0x1ac5bd=a31_0xface,_0x39ec5f=_0x9e0b0();while(!![]){try{const _0x3818ef=parseInt(_0x1ac5bd(0x8f))/0x1+parseInt(_0x1ac5bd(0x8a))/0x2+parseInt(_0x1ac5bd(0x94))/0x3+-parseInt(_0x1ac5bd(0x9e))/0x4*(parseInt(_0x1ac5bd(0x92))/0x5)+parseInt(_0x1ac5bd(0x9f))/0x6*(parseInt(_0x1ac5bd(0xae))/0x7)+parseInt(_0x1ac5bd(0xa1))/0x8*(-parseInt(_0x1ac5bd(0xb8))/0x9)+parseInt(_0x1ac5bd(0x95))/0xa;if(_0x3818ef===_0x1dd120)break;else _0x39ec5f['push'](_0x39ec5f['shift']());}catch(_0x16cf00){_0x39ec5f['push'](_0x39ec5f['shift']());}}}(a31_0x53d6,0xe67d7));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 a31_0x53d6(){const _0x42254e=['Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','database','limit','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','.*\x22','✖\x20No\x20tables\x20found','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','Database\x20\x27','1779001sBHsWS','Error:\x20Pattern\x20\x27','listTables','Database:\x20all','table','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','Site:\x20','\x20\x20Use:\x20tdx\x20tables\x20\x22','\x27\x20is\x20ambiguous.','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','14103486dpqMOY','114406rmTVZm','site','cause','✔\x20Found\x20','Listing\x20tables...','422194XncjOe','execute','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','32105qeDhWa','List\x20tables\x20in\x20a\x20database','5562633gPrTfq','12231290qVOgqF','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Error:\x20','Or\x20use\x20--in\x20flag:','data','message','includes','Table\x20pattern:\x20','verbose','968EtBsos','12AkyrDT','description','8DYSouh','error','length','name'];a31_0x53d6=function(){return _0x42254e;};return a31_0x53d6();}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';function a31_0xface(_0x415ec7,_0x5387ec){const _0x53d618=a31_0x53d6();return a31_0xface=function(_0xface7d,_0x39c5ae){_0xface7d=_0xface7d-0x8a;let _0x3f9806=_0x53d618[_0xface7d];return _0x3f9806;},a31_0xface(_0x415ec7,_0x5387ec);}import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a31_0x50aa3c(0xa4)]='tables';[a31_0x50aa3c(0xa0)]=a31_0x50aa3c(0x93);async[a31_0x50aa3c(0x90)](_0x37cfa4){const _0x31cad6=a31_0x50aa3c,{options:_0x1315b1,args:_0x55dcee,tdx:_0x5f52a9}=_0x37cfa4;let _0x266494;if(_0x55dcee[_0x31cad6(0xa3)]===0x0)_0x266494={'database':undefined,'table':undefined,'original':''};else{if(_0x55dcee[_0x31cad6(0xa3)]===0x1)try{_0x266494=parseTableReference(_0x55dcee[0x0]);if(_0x266494[_0x31cad6(0xb2)]&&!_0x266494[_0x31cad6(0xa7)]&&!_0x266494[_0x31cad6(0xb2)][_0x31cad6(0x9b)]('*')&&!_0x266494[_0x31cad6(0xb2)][_0x31cad6(0x9b)]('?'))return console['error'](_0x31cad6(0xaf)+_0x55dcee[0x0]+_0x31cad6(0xb6)),console[_0x31cad6(0xa2)](_0x31cad6(0xa5)+_0x266494[_0x31cad6(0xb2)]+'\x27?'),console[_0x31cad6(0xa2)](_0x31cad6(0xb5)+_0x266494[_0x31cad6(0xb2)]+_0x31cad6(0xaa)),console[_0x31cad6(0xa2)](_0x31cad6(0x91)+_0x266494[_0x31cad6(0xb2)]),console[_0x31cad6(0xa2)](_0x31cad6(0xb7)+_0x266494['table']),console['error'](''),console[_0x31cad6(0xa2)]('Note:\x20\x27'+_0x55dcee[0x0]+'\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27'+_0x266494['table']+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x381f49){return console[_0x31cad6(0xa2)]('Error:\x20'+_0x381f49[_0x31cad6(0x9a)]),0x1;}else return console[_0x31cad6(0xa2)](_0x31cad6(0xac)),console[_0x31cad6(0xa2)](_0x31cad6(0xa6)),console[_0x31cad6(0xa2)]('\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),console['error'](_0x31cad6(0xa9)),console[_0x31cad6(0xa2)](_0x31cad6(0xb3)),console[_0x31cad6(0xa2)](_0x31cad6(0x98)),console[_0x31cad6(0xa2)](_0x31cad6(0x96)),0x1;}const _0x22afcd=_0x1315b1[_0x31cad6(0xa7)];!_0x266494[_0x31cad6(0xa7)]&&_0x22afcd&&(_0x266494[_0x31cad6(0xa7)]=_0x22afcd);try{const _0x12cb1c=_0x272d7e=>_0x272d7e&&(_0x272d7e['includes']('*')||_0x272d7e[_0x31cad6(0x9b)]('?')),_0x2473bf=_0x12cb1c(_0x266494[_0x31cad6(0xa7)]);_0x1315b1[_0x31cad6(0x9d)]&&(console[_0x31cad6(0xa2)](_0x31cad6(0xb4)+_0x1315b1[_0x31cad6(0x8b)]),_0x266494[_0x31cad6(0xa7)]?_0x2473bf?console[_0x31cad6(0xa2)]('Database\x20pattern:\x20'+_0x266494[_0x31cad6(0xa7)]):console[_0x31cad6(0xa2)]('Database:\x20'+_0x266494[_0x31cad6(0xa7)]):console['error'](_0x31cad6(0xb1)),_0x266494['table']&&console[_0x31cad6(0xa2)](_0x31cad6(0x9c)+_0x266494['table']));const _0x3217e7=_0x266494['database']&&!_0x2473bf?_0x266494[_0x31cad6(0xa7)]:undefined,_0x17b7e6=_0x2473bf?_0x266494[_0x31cad6(0xa7)]:undefined,_0x5362c8=_0x266494['table'],_0xb9b217=resolveLimit(_0x1315b1[_0x31cad6(0xa8)],DEFAULT_LISTING_LIMIT),_0x1c75e8=await withSpinner(_0x31cad6(0x8e),()=>_0x5f52a9['query'][_0x31cad6(0xb0)](_0x3217e7,_0x5362c8,_0x17b7e6,_0xb9b217),{'verbose':_0x1315b1[_0x31cad6(0x9d)]}),_0x47e065=_0x1c75e8[_0x31cad6(0x99)];if(_0x47e065[_0x31cad6(0xa3)]===0x0&&_0x266494[_0x31cad6(0xa7)]&&!_0x2473bf)return console[_0x31cad6(0xa2)](_0x31cad6(0xab)),console[_0x31cad6(0xa2)](_0x31cad6(0xad)+_0x266494[_0x31cad6(0xa7)]+'\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables'),0x1;return console['error'](_0x31cad6(0x8d)+_0x47e065[_0x31cad6(0xa3)]+'\x20table'+(_0x47e065[_0x31cad6(0xa3)]!==0x1?'s':'')),await handleSDKOutput(_0x47e065,{..._0x1315b1,'limit':_0xb9b217}),0x0;}catch(_0x3eb98b){if(_0x3eb98b instanceof SDKError)return console[_0x31cad6(0xa2)](_0x31cad6(0x97)+_0x3eb98b['message']),_0x3eb98b['cause']&&console[_0x31cad6(0xa2)]('\x20\x20Cause:\x20'+_0x3eb98b[_0x31cad6(0x8c)]),0x1;throw _0x3eb98b;}}['validate'](_0x36fbf0){return undefined;}}
1
+ const a33_0x261aa7=a33_0x57d2;(function(_0x11ca61,_0x5211cd){const _0x5be1da=a33_0x57d2,_0x3376f9=_0x11ca61();while(!![]){try{const _0x4aef81=parseInt(_0x5be1da(0x13b))/0x1*(parseInt(_0x5be1da(0x121))/0x2)+-parseInt(_0x5be1da(0x13c))/0x3+-parseInt(_0x5be1da(0x117))/0x4*(parseInt(_0x5be1da(0x11c))/0x5)+parseInt(_0x5be1da(0x119))/0x6*(parseInt(_0x5be1da(0x133))/0x7)+parseInt(_0x5be1da(0x131))/0x8*(parseInt(_0x5be1da(0x129))/0x9)+-parseInt(_0x5be1da(0x10e))/0xa+-parseInt(_0x5be1da(0x110))/0xb*(parseInt(_0x5be1da(0x114))/0xc);if(_0x4aef81===_0x5211cd)break;else _0x3376f9['push'](_0x3376f9['shift']());}catch(_0x5e7dcc){_0x3376f9['push'](_0x3376f9['shift']());}}}(a33_0x4cab,0x73dd3));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a33_0x4cab(){const _0x1aaa5b=['\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','6763356Fhdrnq','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','data','\x20\x20Cause:\x20','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','verbose','8sNmuQX','Database:\x20','7Bvyibi','execute','Table\x20pattern:\x20','Listing\x20tables...','\x20table','✔\x20Found\x20','length','Error:\x20Pattern\x20\x27','727561xwQBkR','474741PXMTQj','✖\x20No\x20tables\x20found','database','5342630YYoucp','List\x20tables\x20in\x20a\x20database','36894SocRvI','limit','error','\x27\x20is\x20ambiguous.','804sRxkvt','name','Database\x20\x27','1775168xKUupy','site','4802076PZDkbd','includes','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','10IISjqE','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','query','table','message','2vGbvrU','Database:\x20all','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','cause','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','description','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables'];a33_0x4cab=function(){return _0x1aaa5b;};return a33_0x4cab();}import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';function a33_0x57d2(_0x61d51e,_0xe5c8a7){const _0x4cab57=a33_0x4cab();return a33_0x57d2=function(_0x57d244,_0x4a4bb8){_0x57d244=_0x57d244-0x10c;let _0x5ea630=_0x4cab57[_0x57d244];return _0x5ea630;},a33_0x57d2(_0x61d51e,_0xe5c8a7);}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a33_0x261aa7(0x115)]='tables';[a33_0x261aa7(0x126)]=a33_0x261aa7(0x10f);async[a33_0x261aa7(0x134)](_0x591ccf){const _0x302901=a33_0x261aa7,{options:_0x3e603d,args:_0x4f59e3,tdx:_0x2095d1}=_0x591ccf;let _0x350f87;if(_0x4f59e3[_0x302901(0x139)]===0x0)_0x350f87={'database':undefined,'table':undefined,'original':''};else{if(_0x4f59e3[_0x302901(0x139)]===0x1)try{_0x350f87=parseTableReference(_0x4f59e3[0x0]);if(_0x350f87[_0x302901(0x11f)]&&!_0x350f87[_0x302901(0x10d)]&&!_0x350f87['table']['includes']('*')&&!_0x350f87[_0x302901(0x11f)]['includes']('?'))return console['error'](_0x302901(0x13a)+_0x4f59e3[0x0]+_0x302901(0x113)),console[_0x302901(0x112)](_0x302901(0x11b)+_0x350f87[_0x302901(0x11f)]+'\x27?'),console[_0x302901(0x112)]('\x20\x20Use:\x20tdx\x20tables\x20\x22'+_0x350f87[_0x302901(0x11f)]+'.*\x22'),console[_0x302901(0x112)](_0x302901(0x11d)+_0x350f87['table']),console['error'](_0x302901(0x12f)+_0x350f87['table']),console[_0x302901(0x112)](''),console[_0x302901(0x112)]('Note:\x20\x27'+_0x4f59e3[0x0]+_0x302901(0x12a)+_0x350f87['table']+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x4a82a7){return console[_0x302901(0x112)]('Error:\x20'+_0x4a82a7[_0x302901(0x120)]),0x1;}else return console[_0x302901(0x112)]('Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'),console[_0x302901(0x112)](_0x302901(0x128)),console['error'](_0x302901(0x125)),console['error'](_0x302901(0x123)),console[_0x302901(0x112)](_0x302901(0x12e)),console[_0x302901(0x112)]('Or\x20use\x20--in\x20flag:'),console['error'](_0x302901(0x12b)),0x1;}const _0x174c15=_0x3e603d[_0x302901(0x10d)];!_0x350f87[_0x302901(0x10d)]&&_0x174c15&&(_0x350f87[_0x302901(0x10d)]=_0x174c15);try{const _0x286f10=_0x2d2e17=>_0x2d2e17&&(_0x2d2e17[_0x302901(0x11a)]('*')||_0x2d2e17[_0x302901(0x11a)]('?')),_0x3648ce=_0x286f10(_0x350f87[_0x302901(0x10d)]);_0x3e603d['verbose']&&(console[_0x302901(0x112)]('Site:\x20'+_0x3e603d[_0x302901(0x118)]),_0x350f87['database']?_0x3648ce?console['error']('Database\x20pattern:\x20'+_0x350f87['database']):console['error'](_0x302901(0x132)+_0x350f87[_0x302901(0x10d)]):console[_0x302901(0x112)](_0x302901(0x122)),_0x350f87[_0x302901(0x11f)]&&console['error'](_0x302901(0x135)+_0x350f87[_0x302901(0x11f)]));const _0x31e246=_0x350f87['database']&&!_0x3648ce?_0x350f87[_0x302901(0x10d)]:undefined,_0x223da5=_0x3648ce?_0x350f87[_0x302901(0x10d)]:undefined,_0x4fce35=_0x350f87[_0x302901(0x11f)],_0x5b1841=resolveLimit(_0x3e603d[_0x302901(0x111)],DEFAULT_LISTING_LIMIT),_0x4c8248=await withSpinner(_0x302901(0x136),()=>_0x2095d1[_0x302901(0x11e)]['listTables'](_0x31e246,_0x4fce35,_0x223da5,_0x5b1841),{'verbose':_0x3e603d[_0x302901(0x130)]}),_0x3d9fa9=_0x4c8248[_0x302901(0x12c)];if(_0x3d9fa9[_0x302901(0x139)]===0x0&&_0x350f87[_0x302901(0x10d)]&&!_0x3648ce)return console[_0x302901(0x112)](_0x302901(0x10c)),console[_0x302901(0x112)](_0x302901(0x116)+_0x350f87['database']+_0x302901(0x127)),0x1;return console[_0x302901(0x112)](_0x302901(0x138)+_0x3d9fa9[_0x302901(0x139)]+_0x302901(0x137)+(_0x3d9fa9[_0x302901(0x139)]!==0x1?'s':'')),await handleSDKOutput(_0x3d9fa9,{..._0x3e603d,'limit':_0x5b1841}),0x0;}catch(_0x514cc3){if(_0x514cc3 instanceof SDKError)return console['error']('Error:\x20'+_0x514cc3[_0x302901(0x120)]),_0x514cc3[_0x302901(0x124)]&&console[_0x302901(0x112)](_0x302901(0x12d)+_0x514cc3['cause']),0x1;throw _0x514cc3;}}['validate'](_0x272b42){return undefined;}}
@@ -1 +1 @@
1
- function a32_0x5830(_0x1bbeaf,_0x1d3458){const _0x5a4526=a32_0x5a45();return a32_0x5830=function(_0x583086,_0x3fe8d7){_0x583086=_0x583086-0xac;let _0x4e446a=_0x5a4526[_0x583086];return _0x4e446a;},a32_0x5830(_0x1bbeaf,_0x1d3458);}const a32_0xae3c99=a32_0x5830;function a32_0x5a45(){const _0x4003e3=['join','database','execute','Session\x20llm_project\x20set\x20to:\x20','\x27\x20does\x20not\x20exist','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','length','763978woypLJ','8kOJwdU','Session\x20parent_segment\x20set\x20to:\x20','log','\x20(session:\x20','5312916dIRfCW','error','291TCPRTq','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','profile','1606ahmszn','name','139454fgwRTn','Invalid\x20resource:\x20','session','155276eErmGP','Error:\x20Profile\x20\x27','Session\x20database\x20set\x20to:\x20','parent_segment','toString','2912904WlsHLf','12954700doNBPZ','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a','llm_project','15KBvqEx','.\x20Must\x20be\x20one\x20of:\x20'];a32_0x5a45=function(){return _0x4003e3;};return a32_0x5a45();}(function(_0x35fb66,_0x5a1a06){const _0x56c582=a32_0x5830,_0x57d8f6=_0x35fb66();while(!![]){try{const _0x392bd5=parseInt(_0x56c582(0xcc))/0x1+parseInt(_0x56c582(0xb3))/0x2*(-parseInt(_0x56c582(0xb0))/0x3)+-parseInt(_0x56c582(0xb8))/0x4*(parseInt(_0x56c582(0xc1))/0x5)+parseInt(_0x56c582(0xae))/0x6+parseInt(_0x56c582(0xb5))/0x7*(-parseInt(_0x56c582(0xcd))/0x8)+parseInt(_0x56c582(0xbd))/0x9+-parseInt(_0x56c582(0xbe))/0xa;if(_0x392bd5===_0x5a1a06)break;else _0x57d8f6['push'](_0x57d8f6['shift']());}catch(_0x4519d4){_0x57d8f6['push'](_0x57d8f6['shift']());}}}(a32_0x5a45,0x71214));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';import{profileExists}from'../core/profile.js';export class UseCommand extends BaseCommand{[a32_0xae3c99(0xb4)]='use';['description']='Set\x20session-level\x20context';['validate'](_0x1e094c){const _0x2ec330=a32_0xae3c99,{args:_0x46339e}=_0x1e094c;if(_0x46339e[_0x2ec330(0xcb)]<0x2)return _0x2ec330(0xb1)+_0x2ec330(0xbf)+_0x2ec330(0xc9)+'\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options';const _0x27411f=_0x46339e[0x0],_0x1fbad1=[_0x2ec330(0xc4),_0x2ec330(0xbb),_0x2ec330(0xc0),'profile'];if(!_0x1fbad1['includes'](_0x27411f))return _0x2ec330(0xb6)+_0x27411f+_0x2ec330(0xc2)+_0x1fbad1[_0x2ec330(0xc3)](',\x20');return undefined;}async[a32_0xae3c99(0xc5)](_0x24a3d6){const _0x1c498c=a32_0xae3c99,{args:_0x10de50,options:_0x292726}=_0x24a3d6;try{const _0x5cc847=_0x10de50[0x0],_0x3eec8e=_0x10de50[0x1];if(_0x5cc847===_0x1c498c(0xb2)){if(!profileExists(_0x3eec8e))return console['error'](_0x1c498c(0xb9)+_0x3eec8e+_0x1c498c(0xc7)),console[_0x1c498c(0xaf)](_0x1c498c(0xca)),0x1;const _0x4b7329=_0x292726[_0x1c498c(0xb7)]||getCurrentSessionPID()[_0x1c498c(0xbc)]();return saveSessionContext({'profile':_0x3eec8e},_0x292726['session']),console['log']('Session\x20profile\x20set\x20to:\x20'+_0x3eec8e+_0x1c498c(0xad)+_0x4b7329+')'),console[_0x1c498c(0xac)](_0x1c498c(0xc8)),0x0;}const _0x50344d={},_0x45936d=_0x292726['session']||getCurrentSessionPID()[_0x1c498c(0xbc)]();switch(_0x5cc847){case _0x1c498c(0xc4):_0x50344d[_0x1c498c(0xc4)]=_0x3eec8e,console[_0x1c498c(0xac)](_0x1c498c(0xba)+_0x3eec8e+_0x1c498c(0xad)+_0x45936d+')');break;case _0x1c498c(0xbb):_0x50344d['parent_segment']=_0x3eec8e,console[_0x1c498c(0xac)](_0x1c498c(0xce)+_0x3eec8e+_0x1c498c(0xad)+_0x45936d+')');break;case'llm_project':_0x50344d['llm_project']=_0x3eec8e,console[_0x1c498c(0xac)](_0x1c498c(0xc6)+_0x3eec8e+_0x1c498c(0xad)+_0x45936d+')');break;}return saveSessionContext(_0x50344d,_0x292726[_0x1c498c(0xb7)]),console[_0x1c498c(0xac)]('\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}catch(_0x414d8d){return _0x414d8d instanceof Error&&console['error']('Error:\x20'+_0x414d8d['message']),0x1;}}}
1
+ const a34_0x4a8b8a=a34_0x3012;(function(_0x51796c,_0x536497){const _0x23db93=a34_0x3012,_0x240bba=_0x51796c();while(!![]){try{const _0x3cc0ac=parseInt(_0x23db93(0x187))/0x1+parseInt(_0x23db93(0x17f))/0x2+parseInt(_0x23db93(0x199))/0x3*(-parseInt(_0x23db93(0x188))/0x4)+-parseInt(_0x23db93(0x18b))/0x5+parseInt(_0x23db93(0x18e))/0x6*(parseInt(_0x23db93(0x198))/0x7)+-parseInt(_0x23db93(0x17e))/0x8+parseInt(_0x23db93(0x19c))/0x9;if(_0x3cc0ac===_0x536497)break;else _0x240bba['push'](_0x240bba['shift']());}catch(_0xc66ae1){_0x240bba['push'](_0x240bba['shift']());}}}(a34_0x291a,0x4c9ad));import{BaseCommand}from'./command.js';function a34_0x3012(_0x1f4c63,_0x373da6){const _0x291a76=a34_0x291a();return a34_0x3012=function(_0x3012b5,_0x3e1744){_0x3012b5=_0x3012b5-0x17d;let _0x296ad6=_0x291a76[_0x3012b5];return _0x296ad6;},a34_0x3012(_0x1f4c63,_0x373da6);}function a34_0x291a(){const _0xe14b44=['Session\x20database\x20set\x20to:\x20','\x20(session:\x20','445970sneuOL','140SybKsY','error','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a','932485qVQAmm','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','llm_project','581718NauxTH','name','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','database','use','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','Session\x20llm_project\x20set\x20to:\x20','Error:\x20Profile\x20\x27','Invalid\x20resource:\x20','.\x20Must\x20be\x20one\x20of:\x20','7phgzHV','34905PhSTmf','length','session','5849937YkGsTq','toString','parent_segment','join','Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a','Session\x20parent_segment\x20set\x20to:\x20','3106352CCYRrI','205746zIgPcm','log','validate','\x27\x20does\x20not\x20exist','profile','includes'];a34_0x291a=function(){return _0xe14b44;};return a34_0x291a();}import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';import{profileExists}from'../core/profile.js';export class UseCommand extends BaseCommand{[a34_0x4a8b8a(0x18f)]=a34_0x4a8b8a(0x192);['description']='Set\x20session-level\x20context';[a34_0x4a8b8a(0x181)](_0x44e0c6){const _0x3e1d61=a34_0x4a8b8a,{args:_0x121607}=_0x44e0c6;if(_0x121607[_0x3e1d61(0x19a)]<0x2)return _0x3e1d61(0x193)+_0x3e1d61(0x18a)+_0x3e1d61(0x1a0)+_0x3e1d61(0x18c);const _0x53d820=_0x121607[0x0],_0x5854a6=[_0x3e1d61(0x191),_0x3e1d61(0x19e),_0x3e1d61(0x18d),'profile'];if(!_0x5854a6[_0x3e1d61(0x184)](_0x53d820))return _0x3e1d61(0x196)+_0x53d820+_0x3e1d61(0x197)+_0x5854a6[_0x3e1d61(0x19f)](',\x20');return undefined;}async['execute'](_0x32c451){const _0x59a070=a34_0x4a8b8a,{args:_0x3c869b,options:_0x3db02c}=_0x32c451;try{const _0x342fb8=_0x3c869b[0x0],_0x1870e8=_0x3c869b[0x1];if(_0x342fb8===_0x59a070(0x183)){if(!profileExists(_0x1870e8))return console[_0x59a070(0x189)](_0x59a070(0x195)+_0x1870e8+_0x59a070(0x182)),console[_0x59a070(0x189)]('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x4a395d=_0x3db02c[_0x59a070(0x19b)]||getCurrentSessionPID()[_0x59a070(0x19d)]();return saveSessionContext({'profile':_0x1870e8},_0x3db02c[_0x59a070(0x19b)]),console[_0x59a070(0x180)]('Session\x20profile\x20set\x20to:\x20'+_0x1870e8+_0x59a070(0x186)+_0x4a395d+')'),console[_0x59a070(0x180)](_0x59a070(0x190)),0x0;}const _0x19f078={},_0x4a8bfd=_0x3db02c['session']||getCurrentSessionPID()[_0x59a070(0x19d)]();switch(_0x342fb8){case _0x59a070(0x191):_0x19f078[_0x59a070(0x191)]=_0x1870e8,console[_0x59a070(0x180)](_0x59a070(0x185)+_0x1870e8+_0x59a070(0x186)+_0x4a8bfd+')');break;case _0x59a070(0x19e):_0x19f078[_0x59a070(0x19e)]=_0x1870e8,console[_0x59a070(0x180)](_0x59a070(0x17d)+_0x1870e8+_0x59a070(0x186)+_0x4a8bfd+')');break;case'llm_project':_0x19f078[_0x59a070(0x18d)]=_0x1870e8,console[_0x59a070(0x180)](_0x59a070(0x194)+_0x1870e8+'\x20(session:\x20'+_0x4a8bfd+')');break;}return saveSessionContext(_0x19f078,_0x3db02c[_0x59a070(0x19b)]),console[_0x59a070(0x180)]('\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}catch(_0x178b72){return _0x178b72 instanceof Error&&console['error']('Error:\x20'+_0x178b72['message']),0x1;}}}
@@ -1 +1 @@
1
- const a33_0x48c3d9=a33_0x305a;(function(_0x3ee415,_0x248ee3){const _0x5aaee9=a33_0x305a,_0xb49bbc=_0x3ee415();while(!![]){try{const _0x202d61=parseInt(_0x5aaee9(0xc1))/0x1+-parseInt(_0x5aaee9(0x136))/0x2*(-parseInt(_0x5aaee9(0x103))/0x3)+parseInt(_0x5aaee9(0xb7))/0x4*(parseInt(_0x5aaee9(0xf1))/0x5)+-parseInt(_0x5aaee9(0x113))/0x6+-parseInt(_0x5aaee9(0xdd))/0x7+parseInt(_0x5aaee9(0xee))/0x8+parseInt(_0x5aaee9(0xa6))/0x9;if(_0x202d61===_0x248ee3)break;else _0xb49bbc['push'](_0xb49bbc['shift']());}catch(_0x12a791){_0xb49bbc['push'](_0xb49bbc['shift']());}}}(a33_0xfa05,0x93ec0));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a33_0xfa05(){const _0x1f1334=['Getting\x20attempt\x20details...','taskName','\x20\x20Cause:\x20','attempt:','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','stat','sessions','18868HJBGmt','Attempt\x20ID:\x20','Cancelled','✔\x20Found\x20','index','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Kill\x20a\x20running\x20attempt','workflow:download','sessionTime','Output\x20directory:\x20','727911sbdRNO','isArray','Session\x20time:\x20','logs','workflow:retry','limit','logFiles','includeSubtasks','\x20\x20Project:\x20','Status:\x20','from','params','Project\x20directory:\x20','fromTask','workflow:logs','\x20\x20New\x20attempt\x20ID:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Error:\x20','name','keys','execute','select','filesExtracted','\x20\x20Files\x20extracted:\x20','Resume\x20from:\x20','✔\x20Retry\x20started','✔\x20Deleted\x20project\x20','retrySession','3062157CywKJA','workflow:sessions','Getting\x20attempt\x20tasks...','running','log','Start\x20a\x20workflow\x20run','\x20attempt','format','parse','List\x20workflow\x20attempts','\x20session','Select\x20a\x20task\x20to\x20view\x20logs:','utf-8','Filter:\x20project=','\x20\x20Attempt\x20ID:\x20','done','canceling','3853712BKBfoA','\x20\x20Location:\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','40YSYpDw','Show\x20tasks\x20for\x20an\x20attempt','Pushing\x20workflow\x20project...','Parameters:\x20','task','List\x20all\x20workflow\x20projects','\x20project','revision','Error:\x20Invalid\x20JSON\x20in\x20--params','projectId','No\x20log\x20content\x20found','workflow','retryAttemptName','Usage:\x20workflow:delete\x20<project-name-or-id>','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Retrying\x20session...','round','status','6EeNoDT','\x20is\x20not\x20a\x20directory','split','push','success','Pattern:\x20','✔\x20Workflow\x20run\x20started','projects','Listing\x20workflow\x20sessions...','workflow:push','session','workflow:attempts','param','run','workflow:run','readFile','5916684Lbtxgr','project','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','\x20\x20Session\x20ID:\x20','Revision:\x20','List\x20workflows','finishedAt','substring','Downloading\x20project\x20','sessionId','✔\x20Pushed\x20','Error:\x20Workflow\x20identifier\x20is\x20required','yes','Show\x20logs\x20for\x20a\x20workflow\x20attempt','length','cause','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','workflow:workflows','Including\x20subtasks:\x20yes','Error:\x20Attempt\x20ID\x20is\x20required','Deleting\x20project\x20','List\x20workflow\x20execution\x20sessions','Show\x20specific\x20attempt\x20details','verbose','message','Filter:\x20','Starting\x20workflow\x20run...','Expected\x20format:\x20--param\x20key=value','description','Task\x20name:\x20','Listing\x20workflow\x20projects...','error','Validation:\x20skipped','Reason:\x20','attempts','429874yJZJcz','isDirectory','data','Killing\x20attempt...','\x20\x20Revision:\x20','skipValidation','Listing\x20workflows...','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Listing\x20workflow\x20attempts...','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','tasks','\x20workflow','getTime','startsWith','workflows','Retrying\x20attempt...','projectName','delete','json','attempt','workflow:delete','...','\x20\x20Project\x20ID:\x20','3169962JTttsj','kill','Project\x20filter:\x20','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','workflow:projects','Downloading\x20logs...','createdAt','fs/promises','resumeFrom','\x20\x20Workflow:\x20'];a33_0xfa05=function(){return _0x1f1334;};return a33_0xfa05();}import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{formatBytes}from'../utils/formatters.js';import a33_0x1168db from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a33_0x48c3d9(0xd3)]=a33_0x48c3d9(0xaa);[a33_0x48c3d9(0x12f)]=a33_0x48c3d9(0xf6);async[a33_0x48c3d9(0xd5)](_0x588de8){const _0x3620fc=a33_0x48c3d9,{options:_0x3549ef,args:_0x55beb5,tdx:_0x170dff}=_0x588de8,_0x5a12f9=_0x55beb5[0x0];try{_0x3549ef['verbose']&&_0x5a12f9&&console[_0x3620fc(0x132)](_0x3620fc(0x108)+_0x5a12f9);const _0x57b8a5=await withSpinner(_0x3620fc(0x131),()=>_0x170dff[_0x3620fc(0xfc)][_0x3620fc(0x10a)](_0x5a12f9,{'limit':_0x3549ef[_0x3620fc(0xc6)]}),{'verbose':_0x3549ef['verbose']}),_0x284b20=_0x57b8a5[_0x3620fc(0x138)];return console['error'](_0x3620fc(0xba)+_0x284b20['length']+_0x3620fc(0xf7)+(_0x284b20[_0x3620fc(0x121)]!==0x1?'s':'')),await handleSDKOutput(_0x284b20,_0x3549ef),0x0;}catch(_0x5dbd3d){if(_0x5dbd3d instanceof SDKError)return console[_0x3620fc(0x132)](_0x3620fc(0xd2)+_0x5dbd3d['message']),_0x5dbd3d[_0x3620fc(0x122)]&&console[_0x3620fc(0x132)](_0x3620fc(0xb2)+_0x5dbd3d[_0x3620fc(0x122)]),0x1;throw _0x5dbd3d;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a33_0x48c3d9(0xd3)]=a33_0x48c3d9(0x124);[a33_0x48c3d9(0x12f)]=a33_0x48c3d9(0x118);async[a33_0x48c3d9(0xd5)](_0x577329){const _0x433e26=a33_0x48c3d9,{options:_0x5b456a,args:_0x58e365,tdx:_0x35dd53}=_0x577329,_0x46a6d3=_0x58e365[0x0];try{_0x5b456a[_0x433e26(0x12a)]&&_0x46a6d3&&console[_0x433e26(0x132)](_0x433e26(0xa8)+_0x46a6d3);const _0x3d510f=await withSpinner(_0x433e26(0x13c),()=>_0x35dd53['workflow'][_0x433e26(0x144)](_0x46a6d3,{'limit':_0x5b456a[_0x433e26(0xc6)]}),{'verbose':_0x5b456a[_0x433e26(0x12a)]}),_0x5a92a6=_0x3d510f[_0x433e26(0x138)];return console[_0x433e26(0x132)]('✔\x20Found\x20'+_0x5a92a6[_0x433e26(0x121)]+_0x433e26(0x141)+(_0x5a92a6[_0x433e26(0x121)]!==0x1?'s':'')),await handleSDKOutput(_0x5a92a6,_0x5b456a),0x0;}catch(_0x5f033a){if(_0x5f033a instanceof SDKError)return console[_0x433e26(0x132)](_0x433e26(0xd2)+_0x5f033a[_0x433e26(0x12b)]),_0x5f033a[_0x433e26(0x122)]&&console['error'](_0x433e26(0xb2)+_0x5f033a[_0x433e26(0x122)]),0x1;throw _0x5f033a;}}}export class WorkflowSessionsCommand extends BaseCommand{['name']=a33_0x48c3d9(0xde);[a33_0x48c3d9(0x12f)]=a33_0x48c3d9(0x128);async[a33_0x48c3d9(0xd5)](_0x17a850){const _0x1e20dc=a33_0x48c3d9,{options:_0x5f1fbc,args:_0x190c3c,tdx:_0x3d3787}=_0x17a850;let _0x589c76,_0x567512;if(_0x190c3c[0x0]){const _0x3b203e=_0x190c3c[0x0][_0x1e20dc(0x105)]('.');if(_0x3b203e['length']===0x1)_0x589c76=_0x3b203e[0x0];else{if(_0x3b203e[_0x1e20dc(0x121)]===0x2)[_0x589c76,_0x567512]=_0x3b203e;else return console['error'](_0x1e20dc(0xbc)),0x1;}}try{if(_0x5f1fbc[_0x1e20dc(0x12a)]){if(_0x589c76&&_0x567512)console[_0x1e20dc(0x132)](_0x1e20dc(0x12c)+_0x589c76+'.'+_0x567512);else _0x589c76&&console['error'](_0x1e20dc(0xea)+_0x589c76);const _0x5e6066=_0x5f1fbc[_0x1e20dc(0x102)];_0x5e6066&&console['error'](_0x1e20dc(0xca)+_0x5e6066);}const _0x2020ab=await withSpinner(_0x1e20dc(0x10b),()=>_0x3d3787[_0x1e20dc(0xfc)][_0x1e20dc(0xb6)]({'projectName':_0x589c76,'workflowName':_0x567512,'status':_0x5f1fbc[_0x1e20dc(0x102)],'fromTime':_0x5f1fbc[_0x1e20dc(0xcb)],'toTime':_0x5f1fbc['to'],'limit':_0x5f1fbc[_0x1e20dc(0xc6)]}),{'verbose':_0x5f1fbc[_0x1e20dc(0x12a)]}),_0x5a4aeb=_0x2020ab['data'];return console[_0x1e20dc(0x132)](_0x1e20dc(0xba)+_0x5a4aeb['length']+_0x1e20dc(0xe7)+(_0x5a4aeb['length']!==0x1?'s':'')),await handleSDKOutput(_0x5a4aeb,_0x5f1fbc),0x0;}catch(_0x16e0bb){if(_0x16e0bb instanceof SDKError)return console[_0x1e20dc(0x132)](_0x1e20dc(0xd2)+_0x16e0bb['message']),_0x16e0bb[_0x1e20dc(0x122)]&&console[_0x1e20dc(0x132)](_0x1e20dc(0xb2)+_0x16e0bb[_0x1e20dc(0x122)]),0x1;throw _0x16e0bb;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a33_0x48c3d9(0xd3)]=a33_0x48c3d9(0x10e);[a33_0x48c3d9(0x12f)]=a33_0x48c3d9(0xe6);async[a33_0x48c3d9(0xd5)](_0xed4504){const _0x5d0b64=a33_0x48c3d9,{options:_0x21cbdf,args:_0x484ba7,tdx:_0x14ea71}=_0xed4504;let _0x3b9699,_0x1a3204;if(_0x484ba7[0x0]){const _0x4dcac1=_0x484ba7[0x0]['split']('.');if(_0x4dcac1[_0x5d0b64(0x121)]===0x1)_0x3b9699=_0x4dcac1[0x0];else{if(_0x4dcac1[_0x5d0b64(0x121)]===0x2)[_0x3b9699,_0x1a3204]=_0x4dcac1;else return console[_0x5d0b64(0x132)](_0x5d0b64(0xbc)),0x1;}}try{const _0x382568=_0x21cbdf['includeRetried'];if(_0x21cbdf[_0x5d0b64(0x12a)]){if(_0x3b9699&&_0x1a3204)console[_0x5d0b64(0x132)](_0x5d0b64(0x12c)+_0x3b9699+'.'+_0x1a3204);else _0x3b9699&&console[_0x5d0b64(0x132)](_0x5d0b64(0xea)+_0x3b9699);_0x382568&&console[_0x5d0b64(0x132)]('Include\x20retried:\x20yes');}const _0x54575d=await withSpinner(_0x5d0b64(0x13e),()=>_0x14ea71[_0x5d0b64(0xfc)][_0x5d0b64(0x135)]({'projectName':_0x3b9699,'workflowName':_0x1a3204,'includeRetried':_0x382568,'limit':_0x21cbdf['limit']}),{'verbose':_0x21cbdf['verbose']}),_0x2804e7=_0x54575d[_0x5d0b64(0x138)];return console[_0x5d0b64(0x132)](_0x5d0b64(0xba)+_0x2804e7['length']+_0x5d0b64(0xe3)+(_0x2804e7['length']!==0x1?'s':'')),await handleSDKOutput(_0x2804e7,_0x21cbdf),0x0;}catch(_0x2801fc){if(_0x2801fc instanceof SDKError)return console[_0x5d0b64(0x132)](_0x5d0b64(0xd2)+_0x2801fc[_0x5d0b64(0x12b)]),_0x2801fc['cause']&&console[_0x5d0b64(0x132)](_0x5d0b64(0xb2)+_0x2801fc[_0x5d0b64(0x122)]),0x1;throw _0x2801fc;}}}export class WorkflowAttemptCommand extends BaseCommand{['name']='workflow:attempt';['description']=a33_0x48c3d9(0x129);async[a33_0x48c3d9(0xd5)](_0x1332aa){const _0x219213=a33_0x48c3d9,{options:_0x335465,args:_0x2679c0,tdx:_0x2a2bef}=_0x1332aa,_0x17973f=_0x2679c0[0x0];if(!_0x17973f)return console['error'](_0x219213(0x126)),0x1;try{_0x335465[_0x219213(0x12a)]&&console['error'](_0x219213(0xb8)+_0x17973f);const _0x77eae9=await withSpinner(_0x219213(0xb0),()=>_0x2a2bef[_0x219213(0xfc)][_0x219213(0xa2)](_0x17973f),{'verbose':_0x335465[_0x219213(0x12a)]}),_0x152a16=_0x77eae9[_0x219213(0x138)];let _0x206178;!_0x152a16[_0x219213(0xec)]?_0x206178=_0x152a16['cancelRequested']?_0x219213(0xed):_0x219213(0xe0):_0x206178=_0x152a16[_0x219213(0x107)]?'success':_0x219213(0x132);let _0x48f20a;if(_0x152a16[_0x219213(0xac)]&&_0x152a16[_0x219213(0x119)]){const _0x5a9c9f=new Date(_0x152a16[_0x219213(0xac)])['getTime'](),_0x3fd334=new Date(_0x152a16['finishedAt'])[_0x219213(0x142)]();_0x48f20a=Math[_0x219213(0x101)]((_0x3fd334-_0x5a9c9f)/0x3e8);}const _0xbc3869={'attempt_id':_0x152a16['id'],'status':_0x206178,..._0x152a16[_0x219213(0xbb)]!==undefined&&{'index':_0x152a16[_0x219213(0xbb)]},..._0x152a16['project']&&{'project':_0x152a16[_0x219213(0x114)]['name']},..._0x152a16['workflow']&&{'workflow':_0x152a16['workflow'][_0x219213(0xd3)]},..._0x152a16[_0x219213(0x11c)]&&{'session_id':_0x152a16[_0x219213(0x11c)]},..._0x152a16[_0x219213(0xbf)]&&{'session_time':_0x152a16[_0x219213(0xbf)]},..._0x152a16[_0x219213(0xfd)]&&{'retry_attempt':_0x152a16[_0x219213(0xfd)]},..._0x48f20a!==undefined&&{'duration_sec':_0x48f20a},..._0x152a16['createdAt']&&{'created_at':_0x152a16[_0x219213(0xac)]},..._0x152a16[_0x219213(0x119)]&&{'finished_at':_0x152a16[_0x219213(0x119)]},...Object[_0x219213(0xd4)](_0x152a16[_0x219213(0xcc)])[_0x219213(0x121)]>0x0&&{'params':_0x152a16[_0x219213(0xcc)]}};return await handleSingleObjectOutput(_0xbc3869,_0x335465),0x0;}catch(_0x47e241){if(_0x47e241 instanceof SDKError)return console[_0x219213(0x132)](_0x219213(0xd2)+_0x47e241[_0x219213(0x12b)]),_0x47e241['cause']&&console[_0x219213(0x132)](_0x219213(0xb2)+_0x47e241[_0x219213(0x122)]),0x1;throw _0x47e241;}}}export class WorkflowTasksCommand extends BaseCommand{[a33_0x48c3d9(0xd3)]='workflow:tasks';[a33_0x48c3d9(0x12f)]=a33_0x48c3d9(0xf2);async[a33_0x48c3d9(0xd5)](_0x1fadd5){const _0x57a1d5=a33_0x48c3d9,{options:_0x1aa160,args:_0x14ea4c,tdx:_0x3cf404}=_0x1fadd5,_0x218ec1=_0x14ea4c[0x0];if(!_0x218ec1)return console[_0x57a1d5(0x132)](_0x57a1d5(0x126)),0x1;try{const _0x265350=_0x1aa160[_0x57a1d5(0xc8)];_0x1aa160[_0x57a1d5(0x12a)]&&(console[_0x57a1d5(0x132)]('Attempt\x20ID:\x20'+_0x218ec1),_0x265350&&console['error'](_0x57a1d5(0x125)));const _0x275ab6=await withSpinner(_0x57a1d5(0xdf),()=>_0x3cf404[_0x57a1d5(0xfc)][_0x57a1d5(0x140)](_0x218ec1,_0x265350||![]),{'verbose':_0x1aa160[_0x57a1d5(0x12a)]}),_0x39ac4a=_0x275ab6[_0x57a1d5(0x138)];return console['error']('✔\x20Found\x20'+_0x39ac4a[_0x57a1d5(0x121)]+'\x20task'+(_0x39ac4a[_0x57a1d5(0x121)]!==0x1?'s':'')),await handleSDKOutput(_0x39ac4a,_0x1aa160),0x0;}catch(_0x2add6f){if(_0x2add6f instanceof SDKError)return console['error'](_0x57a1d5(0xd2)+_0x2add6f[_0x57a1d5(0x12b)]),_0x2add6f['cause']&&console['error'](_0x57a1d5(0xb2)+_0x2add6f['cause']),0x1;throw _0x2add6f;}}}export class WorkflowLogsCommand extends BaseCommand{[a33_0x48c3d9(0xd3)]=a33_0x48c3d9(0xcf);[a33_0x48c3d9(0x12f)]=a33_0x48c3d9(0x120);async[a33_0x48c3d9(0xd5)](_0x3a1c65){const _0x505d17=a33_0x48c3d9,{options:_0x12e3e3,args:_0x57f56e,tdx:_0x3a6022}=_0x3a1c65,_0x280573=_0x57f56e[0x0];let _0x279987=_0x57f56e[0x1];if(!_0x280573)return console[_0x505d17(0x132)](_0x505d17(0x126)),0x1;try{_0x12e3e3['verbose']&&(console[_0x505d17(0x132)]('Attempt\x20ID:\x20'+_0x280573),_0x279987&&console[_0x505d17(0x132)](_0x505d17(0x130)+_0x279987));const _0x49414b=await withSpinner('Fetching\x20log\x20files...',()=>_0x3a6022['workflow'][_0x505d17(0xc7)](_0x280573,_0x279987),{'verbose':_0x12e3e3[_0x505d17(0x12a)]}),_0x399b2a=_0x49414b[_0x505d17(0x138)];if(_0x399b2a['length']===0x0)return console[_0x505d17(0x132)](_0x505d17(0x13d)),0x0;if(!_0x279987&&(_0x12e3e3[_0x505d17(0xa1)]||_0x12e3e3[_0x505d17(0xe4)]))return await handleSDKOutput(_0x399b2a,_0x12e3e3),0x0;if(!_0x279987){const _0x8e0e04=_0x399b2a['map'](_0x547490=>({'title':_0x547490[_0x505d17(0xb1)]+'\x20('+formatBytes(_0x547490['fileSize'])+')','value':_0x547490[_0x505d17(0xb1)]})),_0x40db2d=await a33_0x1168db({'type':_0x505d17(0xd6),'name':_0x505d17(0xf5),'message':_0x505d17(0xe8),'choices':_0x8e0e04});if(!_0x40db2d[_0x505d17(0xf5)])return console[_0x505d17(0x132)](_0x505d17(0xb9)),0x0;_0x279987=_0x40db2d[_0x505d17(0xf5)];}const _0x44d221=await withSpinner(_0x505d17(0xab),()=>_0x3a6022[_0x505d17(0xfc)][_0x505d17(0xc4)](_0x280573,_0x279987),{'verbose':_0x12e3e3['verbose']}),_0x44ef3c=_0x44d221[_0x505d17(0x138)];return _0x44ef3c?console[_0x505d17(0xe1)](_0x44ef3c):console['error'](_0x505d17(0xfb)),0x0;}catch(_0x47f371){if(_0x47f371 instanceof SDKError)return console['error'](_0x505d17(0xd2)+_0x47f371[_0x505d17(0x12b)]),_0x47f371[_0x505d17(0x122)]&&console['error'](_0x505d17(0xb2)+_0x47f371['cause']),0x1;throw _0x47f371;}}}export class WorkflowKillCommand extends BaseCommand{[a33_0x48c3d9(0xd3)]='workflow:kill';[a33_0x48c3d9(0x12f)]=a33_0x48c3d9(0xbd);async[a33_0x48c3d9(0xd5)](_0x5b4ad9){const _0x52b8d2=a33_0x48c3d9,{options:_0xfa7999,args:_0x33f995,tdx:_0x1ab792}=_0x5b4ad9,_0x5bc8d3=_0x33f995[0x0];if(!_0x5bc8d3)return console[_0x52b8d2(0x132)](_0x52b8d2(0x126)),0x1;try{const _0x4be424=_0xfa7999['reason'];_0xfa7999[_0x52b8d2(0x12a)]&&(console[_0x52b8d2(0x132)](_0x52b8d2(0xb8)+_0x5bc8d3),_0x4be424&&console[_0x52b8d2(0x132)](_0x52b8d2(0x134)+_0x4be424));if(!_0xfa7999[_0x52b8d2(0x11f)]){const _0x1bebe7=await confirm(_0x52b8d2(0xb4)+_0x5bc8d3+'?');if(!_0x1bebe7)return console['error'](_0x52b8d2(0xb9)),0x0;}const _0x50ebf0=await withSpinner(_0x52b8d2(0x139),()=>_0x1ab792[_0x52b8d2(0xfc)][_0x52b8d2(0xa7)](_0x5bc8d3,_0x4be424),{'verbose':_0xfa7999[_0x52b8d2(0x12a)]}),_0x131291=_0x50ebf0['data'];return console[_0x52b8d2(0x132)]('✔\x20'+_0x131291),0x0;}catch(_0x101b89){if(_0x101b89 instanceof SDKError)return console['error'](_0x52b8d2(0xd2)+_0x101b89[_0x52b8d2(0x12b)]),_0x101b89[_0x52b8d2(0x122)]&&console[_0x52b8d2(0x132)](_0x52b8d2(0xb2)+_0x101b89[_0x52b8d2(0x122)]),0x1;throw _0x101b89;}}}export class WorkflowRetryCommand extends BaseCommand{[a33_0x48c3d9(0xd3)]=a33_0x48c3d9(0xc5);[a33_0x48c3d9(0x12f)]='Retry\x20a\x20session\x20or\x20attempt';async['execute'](_0x1ca467){const _0x5e6e09=a33_0x48c3d9,{options:_0x278a46,args:_0x3a8a69,tdx:_0x59ba07}=_0x1ca467,_0x620549=_0x3a8a69[0x0];if(!_0x620549)return console['error']('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x5e6e09(0x132)](_0x5e6e09(0x115)),0x1;let _0x5234f9=![],_0x21397a=_0x620549;if(_0x620549[_0x5e6e09(0x143)]('session:'))_0x5234f9=!![],_0x21397a=_0x620549['substring'](0x8);else{if(_0x620549[_0x5e6e09(0x143)](_0x5e6e09(0xb3)))_0x5234f9=![],_0x21397a=_0x620549[_0x5e6e09(0x11a)](0x8);else return console[_0x5e6e09(0x132)](_0x5e6e09(0xf0)),console[_0x5e6e09(0x132)](_0x5e6e09(0x115)),0x1;}try{const _0x287825=_0x278a46[_0x5e6e09(0xce)],_0x2b2980=_0x278a46[_0x5e6e09(0xae)],_0x21c983=_0x278a46[_0x5e6e09(0xcc)],_0x19f7e1=_0x278a46['force'];_0x278a46[_0x5e6e09(0x12a)]&&(console[_0x5e6e09(0x132)]('Target:\x20'+(_0x5234f9?_0x5e6e09(0x10d):_0x5e6e09(0xa2))+'\x20'+_0x21397a),_0x287825&&console['error']('From\x20task:\x20'+_0x287825),_0x2b2980&&console[_0x5e6e09(0x132)](_0x5e6e09(0xd9)+_0x2b2980),_0x21c983&&console['error']('Params:\x20'+_0x21c983),_0x19f7e1&&console[_0x5e6e09(0x132)]('Force:\x20yes'));let _0x517df1;if(_0x21c983)try{if(_0x21c983[_0x5e6e09(0x143)]('@')){const _0x33069a=await import(_0x5e6e09(0xad)),_0x39a851=_0x21c983[_0x5e6e09(0x11a)](0x1),_0x1aafe8=await _0x33069a[_0x5e6e09(0x112)](_0x39a851,_0x5e6e09(0xe9));_0x517df1=JSON[_0x5e6e09(0xe5)](_0x1aafe8);}else _0x517df1=JSON[_0x5e6e09(0xe5)](_0x21c983);}catch{return console[_0x5e6e09(0x132)](_0x5e6e09(0xf9)),0x1;}if(!_0x278a46[_0x5e6e09(0x11f)]){const _0x4e4750=await confirm(_0x5e6e09(0xff)+(_0x5234f9?_0x5e6e09(0x10d):'attempt')+'\x20'+_0x21397a+'?');if(!_0x4e4750)return console[_0x5e6e09(0x132)](_0x5e6e09(0xb9)),0x0;}let _0x5aba2e;_0x5234f9?_0x5aba2e=await withSpinner(_0x5e6e09(0x100),()=>_0x59ba07['workflow'][_0x5e6e09(0xdc)](_0x21397a,{'fromTask':_0x287825,'retryParams':_0x517df1}),{'verbose':_0x278a46['verbose']}):_0x5aba2e=await withSpinner(_0x5e6e09(0x9e),()=>_0x59ba07[_0x5e6e09(0xfc)]['retryAttempt'](_0x21397a,{'resumeFrom':_0x2b2980,'retryParams':_0x517df1,'force':_0x19f7e1}),{'verbose':_0x278a46['verbose']});const _0x5f4021=_0x5aba2e['data'];return console[_0x5e6e09(0x132)](_0x5e6e09(0xda)),console['error'](_0x5e6e09(0xd0)+_0x5f4021['attemptId']),console[_0x5e6e09(0x132)](_0x5e6e09(0x116)+_0x5f4021['sessionId']),0x0;}catch(_0x18e5ed){if(_0x18e5ed instanceof SDKError)return console[_0x5e6e09(0x132)](_0x5e6e09(0xd2)+_0x18e5ed[_0x5e6e09(0x12b)]),_0x18e5ed[_0x5e6e09(0x122)]&&console[_0x5e6e09(0x132)](_0x5e6e09(0xb2)+_0x18e5ed[_0x5e6e09(0x122)]),0x1;throw _0x18e5ed;}}}export class WorkflowRunCommand extends BaseCommand{[a33_0x48c3d9(0xd3)]=a33_0x48c3d9(0x111);[a33_0x48c3d9(0x12f)]=a33_0x48c3d9(0xe2);async[a33_0x48c3d9(0xd5)](_0x4dc74c){const _0x3050d6=a33_0x48c3d9,{options:_0x51f998,args:_0x1be16e,tdx:_0x29f903}=_0x4dc74c,_0x4127a3=_0x1be16e[0x0];if(!_0x4127a3)return console[_0x3050d6(0x132)](_0x3050d6(0x11e)),console['error']('Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]'),0x1;const _0xee8cde=_0x51f998[_0x3050d6(0x10f)],_0x3691e3=_0x51f998[_0x3050d6(0xbf)],_0x27142a={};if(_0xee8cde&&Array[_0x3050d6(0xc2)](_0xee8cde))for(const _0x5a61a7 of _0xee8cde){const _0x263c7b=_0x5a61a7['indexOf']('=');if(_0x263c7b===-0x1)return console[_0x3050d6(0x132)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x5a61a7),console[_0x3050d6(0x132)](_0x3050d6(0x12e)),0x1;const _0x251000=_0x5a61a7[_0x3050d6(0x11a)](0x0,_0x263c7b),_0x166821=_0x5a61a7[_0x3050d6(0x11a)](_0x263c7b+0x1);try{_0x27142a[_0x251000]=JSON[_0x3050d6(0xe5)](_0x166821);}catch{_0x27142a[_0x251000]=_0x166821;}}_0x51f998['verbose']&&(console['error']('Workflow:\x20'+_0x4127a3),Object[_0x3050d6(0xd4)](_0x27142a)[_0x3050d6(0x121)]>0x0&&console['error'](_0x3050d6(0xf4)+JSON['stringify'](_0x27142a)),_0x3691e3&&console[_0x3050d6(0x132)](_0x3050d6(0xc3)+_0x3691e3));const _0x5725fc=await withSpinner(_0x3050d6(0x12d),()=>_0x29f903['workflow'][_0x3050d6(0x110)](_0x4127a3,_0x27142a,{'sessionTime':_0x3691e3}),{'verbose':_0x51f998[_0x3050d6(0x12a)]}),_0x15426b=_0x5725fc[_0x3050d6(0x138)];return console[_0x3050d6(0x132)](_0x3050d6(0x109)),console[_0x3050d6(0x132)](_0x3050d6(0xeb)+_0x15426b['id']),console[_0x3050d6(0x132)]('\x20\x20Session\x20ID:\x20'+_0x15426b['sessionId']),console[_0x3050d6(0x132)](_0x3050d6(0xc9)+_0x15426b[_0x3050d6(0x114)]?.['name']),console[_0x3050d6(0x132)](_0x3050d6(0xaf)+_0x15426b[_0x3050d6(0xfc)]?.[_0x3050d6(0xd3)]),0x0;}}function a33_0x305a(_0x3718da,_0x438f1c){const _0xfa050e=a33_0xfa05();return a33_0x305a=function(_0x305a52,_0xe83703){_0x305a52=_0x305a52-0x9e;let _0xc6fd85=_0xfa050e[_0x305a52];return _0xc6fd85;},a33_0x305a(_0x3718da,_0x438f1c);}export class WorkflowDownloadCommand extends BaseCommand{[a33_0x48c3d9(0xd3)]=a33_0x48c3d9(0xbe);['description']='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a33_0x48c3d9(0xd5)](_0x597f83){const _0x5f4278=a33_0x48c3d9,{options:_0x470812,args:_0x95f041,tdx:_0x3e5880}=_0x597f83,_0x4b71bc=_0x95f041[0x0],_0x43c34a=_0x95f041[0x1]||'.';if(!_0x4b71bc)return console[_0x5f4278(0x132)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x5f4278(0x132)](_0x5f4278(0x123)),0x1;const _0x31be0a=_0x470812[_0x5f4278(0xf8)];_0x470812['verbose']&&(console[_0x5f4278(0x132)]('Project:\x20'+_0x4b71bc),console['error'](_0x5f4278(0xc0)+_0x43c34a),_0x31be0a&&console[_0x5f4278(0x132)](_0x5f4278(0x117)+_0x31be0a));const _0x438fb2=await withSpinner(_0x5f4278(0x11b)+_0x4b71bc+_0x5f4278(0xa4),()=>_0x3e5880['workflow']['download'](_0x4b71bc,_0x43c34a,{'revision':_0x31be0a}),{'verbose':_0x470812[_0x5f4278(0x12a)]}),_0x1fc01d=_0x438fb2['data'];return console[_0x5f4278(0x132)]('✔\x20Downloaded\x20'+_0x1fc01d[_0x5f4278(0x9f)]),console[_0x5f4278(0x132)](_0x5f4278(0x13a)+_0x1fc01d['revision']),console[_0x5f4278(0x132)](_0x5f4278(0xd8)+_0x1fc01d[_0x5f4278(0xd7)]),console['error'](_0x5f4278(0xef)+_0x43c34a+'/'+_0x1fc01d[_0x5f4278(0x9f)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a33_0x48c3d9(0xd3)]=a33_0x48c3d9(0x10c);[a33_0x48c3d9(0x12f)]='Push\x20workflow\x20project\x20to\x20Treasure\x20Data';async[a33_0x48c3d9(0xd5)](_0x31d51f){const _0x35fdb2=a33_0x48c3d9,{options:_0x5b78e7,args:_0x34c444,tdx:_0x4425ca}=_0x31d51f;let _0x66505='.',_0x47b163=_0x5b78e7['name'];if(_0x34c444[0x0]){const {promises:_0x7615f}=await import('fs');try{const _0x1c4743=await _0x7615f[_0x35fdb2(0xb5)](_0x34c444[0x0]);if(_0x1c4743[_0x35fdb2(0x137)]())_0x66505=_0x34c444[0x0];else return console['error'](_0x35fdb2(0xd2)+_0x34c444[0x0]+_0x35fdb2(0x104)),0x1;}catch{_0x47b163=_0x34c444[0x0],_0x66505='.';}}const _0x36bf69=_0x5b78e7[_0x35fdb2(0xf8)],_0x3ff6aa=_0x5b78e7[_0x35fdb2(0x13b)];_0x5b78e7[_0x35fdb2(0x12a)]&&(console['error'](_0x35fdb2(0xcd)+_0x66505),_0x47b163&&console[_0x35fdb2(0x132)]('Project\x20name:\x20'+_0x47b163),_0x36bf69&&console[_0x35fdb2(0x132)](_0x35fdb2(0x117)+_0x36bf69),_0x3ff6aa&&console['error'](_0x35fdb2(0x133)));const _0x3501b0=await withSpinner(_0x35fdb2(0xf3),()=>_0x4425ca[_0x35fdb2(0xfc)][_0x35fdb2(0x106)](_0x66505,{'projectName':_0x47b163,'revision':_0x36bf69,'skipValidation':_0x3ff6aa}),{'verbose':_0x5b78e7[_0x35fdb2(0x12a)]}),_0xc1b913=_0x3501b0['data'];return console[_0x35fdb2(0x132)](_0x35fdb2(0x11d)+_0xc1b913[_0x35fdb2(0x9f)]),console[_0x35fdb2(0x132)]('\x20\x20Project\x20ID:\x20'+_0xc1b913['projectId']),console[_0x35fdb2(0x132)](_0x35fdb2(0x13a)+_0xc1b913[_0x35fdb2(0xf8)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a33_0x48c3d9(0xa3);['description']=a33_0x48c3d9(0x13f);async[a33_0x48c3d9(0xd5)](_0x2906a6){const _0x251bb3=a33_0x48c3d9,{options:_0x486199,args:_0x3f7fa2,tdx:_0x4995d6}=_0x2906a6,_0x3f3c67=_0x3f7fa2[0x0];if(!_0x3f3c67)return console['error'](_0x251bb3(0xa9)),console['error'](_0x251bb3(0xfe)),0x1;_0x486199['verbose']&&console['error']('Project:\x20'+_0x3f3c67);if(!_0x486199[_0x251bb3(0x11f)]){const _0x1d35ab=await confirm(_0x251bb3(0xd1)+_0x3f3c67+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x1d35ab)return console[_0x251bb3(0x132)]('Cancelled'),0x0;}const _0xf68021=await withSpinner(_0x251bb3(0x127)+_0x3f3c67+_0x251bb3(0xa4),()=>_0x4995d6[_0x251bb3(0xfc)][_0x251bb3(0xa0)](_0x3f3c67),{'verbose':_0x486199[_0x251bb3(0x12a)]}),_0x512199=_0xf68021['data'];return console[_0x251bb3(0x132)](_0x251bb3(0xdb)+_0x512199[_0x251bb3(0x9f)]),console['error'](_0x251bb3(0xa5)+_0x512199[_0x251bb3(0xfa)]),0x0;}}
1
+ const a35_0x3cf62c=a35_0x2913;(function(_0x5322d4,_0x538645){const _0x4d7b0b=a35_0x2913,_0x202953=_0x5322d4();while(!![]){try{const _0x5135aa=parseInt(_0x4d7b0b(0x224))/0x1*(parseInt(_0x4d7b0b(0x286))/0x2)+-parseInt(_0x4d7b0b(0x1f1))/0x3*(parseInt(_0x4d7b0b(0x1fa))/0x4)+-parseInt(_0x4d7b0b(0x1d9))/0x5*(parseInt(_0x4d7b0b(0x254))/0x6)+-parseInt(_0x4d7b0b(0x1ff))/0x7*(-parseInt(_0x4d7b0b(0x25f))/0x8)+-parseInt(_0x4d7b0b(0x1d8))/0x9*(-parseInt(_0x4d7b0b(0x21a))/0xa)+-parseInt(_0x4d7b0b(0x21f))/0xb*(parseInt(_0x4d7b0b(0x289))/0xc)+parseInt(_0x4d7b0b(0x27b))/0xd;if(_0x5135aa===_0x538645)break;else _0x202953['push'](_0x202953['shift']());}catch(_0x1f2416){_0x202953['push'](_0x202953['shift']());}}}(a35_0x4653,0x3b284));function a35_0x4653(){const _0x2ba9d7=['keys','\x20project','Resume\x20from:\x20','Retrying\x20session...','readFile','✔\x20Found\x20','Error:\x20Workflow\x20identifier\x20is\x20required','328EfxdOS','Listing\x20workflows...','\x20workflow','Revision:\x20','status','2576rEUgGX','logs','List\x20workflow\x20execution\x20sessions','running','Listing\x20workflow\x20projects...','round','map','✔\x20Pushed\x20','sessionId','Show\x20logs\x20for\x20a\x20workflow\x20attempt','kill','createdAt','List\x20all\x20workflow\x20projects','workflow:kill','Project\x20filter:\x20','success','skipValidation','isDirectory','projects','Start\x20a\x20workflow\x20run','workflows','attempt','Select\x20a\x20task\x20to\x20view\x20logs:','\x20\x20Location:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Fetching\x20log\x20files...','246550mYjxCS','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','cause','length','Params:\x20','59939vaGegn','Error:\x20Project\x20name\x20is\x20required','Task\x20name:\x20','includeSubtasks','Expected\x20format:\x20--param\x20key=value','2osCibp','\x20\x20Revision:\x20','run','task','execute','Getting\x20attempt\x20tasks...','Error:\x20Invalid\x20JSON\x20in\x20--params','✔\x20Retry\x20started','projectId','stringify','sessionTime','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Cancelled','\x20\x20Attempt\x20ID:\x20','Kill\x20a\x20running\x20attempt','attempt:','index','Killing\x20attempt...','\x20\x20Workflow:\x20','retrySession','push','Status:\x20','Filter:\x20','\x20\x20Cause:\x20','workflow:retry','cancelRequested','stat','workflow:attempt','includeRetried','utf-8','logFiles','\x20\x20Session\x20ID:\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','name','attemptId','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','workflow','Target:\x20','retryAttemptName','Project\x20directory:\x20','session:','Error:\x20Attempt\x20ID\x20is\x20required','indexOf','\x20attempt','error','workflow:delete','Workflow:\x20','Getting\x20attempt\x20details...','6906godWVT','select','✔\x20Downloaded\x20','done','\x22?\x20This\x20cannot\x20be\x20undone.','Starting\x20workflow\x20run...','taskName','\x20\x20Project:\x20','workflow:run','Filter:\x20project=','project','344HziDER','Include\x20retried:\x20yes','List\x20workflows','download','getTime','startsWith','params','split','Error:\x20Invalid\x20parameter\x20format:\x20','verbose','Parameters:\x20','Reason:\x20','From\x20task:\x20','fromTask','Error:\x20','json','parse','workflow:attempts','Downloading\x20logs...','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','message','retryAttempt','finishedAt','workflow:workflows','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','✔\x20Workflow\x20run\x20started','projectName','\x20task','8060299mYTpFQ','Show\x20specific\x20attempt\x20details','delete','workflow:tasks','Session\x20time:\x20','\x20is\x20not\x20a\x20directory','Attempt\x20ID:\x20','session','Project\x20name:\x20','data','Validation:\x20skipped','133954BTMndw','description','filesExtracted','960qeBexE','Deleting\x20project\x20','72ADcYCo','835bapDdZ','yes','revision','limit','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','workflow:sessions','substring','Listing\x20workflow\x20sessions...','fileSize','from','workflow:projects','\x20\x20Project\x20ID:\x20','Show\x20tasks\x20for\x20an\x20attempt','Project:\x20','isArray','reason','...','fs/promises','attempts','Force:\x20yes','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','\x20\x20Files\x20extracted:\x20','workflow:push','workflow:download','3534mQWywA','Output\x20directory:\x20'];a35_0x4653=function(){return _0x2ba9d7;};return a35_0x4653();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{formatBytes}from'../utils/formatters.js';import a35_0xc912cc from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a35_0x3cf62c(0x245)]=a35_0x3cf62c(0x1e3);['description']=a35_0x3cf62c(0x20b);async[a35_0x3cf62c(0x228)](_0x26f315){const _0x5d38bf=a35_0x3cf62c,{options:_0x4bdf19,args:_0xb6efd,tdx:_0x5771f6}=_0x26f315,_0xb585=_0xb6efd[0x0];try{_0x4bdf19[_0x5d38bf(0x268)]&&_0xb585&&console[_0x5d38bf(0x250)]('Pattern:\x20'+_0xb585);const _0x30798a=await withSpinner(_0x5d38bf(0x203),()=>_0x5771f6[_0x5d38bf(0x248)][_0x5d38bf(0x211)](_0xb585,{'limit':_0x4bdf19[_0x5d38bf(0x1dc)]}),{'verbose':_0x4bdf19[_0x5d38bf(0x268)]}),_0x22c1c2=_0x30798a['data'];return console[_0x5d38bf(0x250)](_0x5d38bf(0x1f8)+_0x22c1c2[_0x5d38bf(0x21d)]+_0x5d38bf(0x1f4)+(_0x22c1c2[_0x5d38bf(0x21d)]!==0x1?'s':'')),await handleSDKOutput(_0x22c1c2,_0x4bdf19),0x0;}catch(_0x2e4e36){if(_0x2e4e36 instanceof SDKError)return console[_0x5d38bf(0x250)](_0x5d38bf(0x26d)+_0x2e4e36['message']),_0x2e4e36[_0x5d38bf(0x21c)]&&console[_0x5d38bf(0x250)](_0x5d38bf(0x23b)+_0x2e4e36[_0x5d38bf(0x21c)]),0x1;throw _0x2e4e36;}}}export class WorkflowWorkflowsCommand extends BaseCommand{['name']=a35_0x3cf62c(0x276);[a35_0x3cf62c(0x287)]=a35_0x3cf62c(0x261);async[a35_0x3cf62c(0x228)](_0x3840a6){const _0x50503a=a35_0x3cf62c,{options:_0x1532fc,args:_0x470778,tdx:_0x740225}=_0x3840a6,_0x3f6a76=_0x470778[0x0];try{_0x1532fc['verbose']&&_0x3f6a76&&console[_0x50503a(0x250)](_0x50503a(0x20d)+_0x3f6a76);const _0x44f216=await withSpinner(_0x50503a(0x1fb),()=>_0x740225['workflow'][_0x50503a(0x213)](_0x3f6a76,{'limit':_0x1532fc[_0x50503a(0x1dc)]}),{'verbose':_0x1532fc[_0x50503a(0x268)]}),_0x454102=_0x44f216[_0x50503a(0x284)];return console[_0x50503a(0x250)](_0x50503a(0x1f8)+_0x454102[_0x50503a(0x21d)]+_0x50503a(0x1fc)+(_0x454102[_0x50503a(0x21d)]!==0x1?'s':'')),await handleSDKOutput(_0x454102,_0x1532fc),0x0;}catch(_0x2e5bdd){if(_0x2e5bdd instanceof SDKError)return console[_0x50503a(0x250)](_0x50503a(0x26d)+_0x2e5bdd[_0x50503a(0x273)]),_0x2e5bdd['cause']&&console[_0x50503a(0x250)]('\x20\x20Cause:\x20'+_0x2e5bdd['cause']),0x1;throw _0x2e5bdd;}}}export class WorkflowSessionsCommand extends BaseCommand{['name']=a35_0x3cf62c(0x1de);['description']=a35_0x3cf62c(0x201);async[a35_0x3cf62c(0x228)](_0x547412){const _0x18e464=a35_0x3cf62c,{options:_0x1023b7,args:_0x4670f1,tdx:_0x58c606}=_0x547412;let _0x53433,_0x3c4a4e;if(_0x4670f1[0x0]){const _0x2d85af=_0x4670f1[0x0][_0x18e464(0x266)]('.');if(_0x2d85af[_0x18e464(0x21d)]===0x1)_0x53433=_0x2d85af[0x0];else{if(_0x2d85af[_0x18e464(0x21d)]===0x2)[_0x53433,_0x3c4a4e]=_0x2d85af;else return console[_0x18e464(0x250)](_0x18e464(0x1dd)),0x1;}}try{if(_0x1023b7[_0x18e464(0x268)]){if(_0x53433&&_0x3c4a4e)console[_0x18e464(0x250)](_0x18e464(0x23a)+_0x53433+'.'+_0x3c4a4e);else _0x53433&&console[_0x18e464(0x250)](_0x18e464(0x25d)+_0x53433);const _0x21b76a=_0x1023b7[_0x18e464(0x1fe)];_0x21b76a&&console[_0x18e464(0x250)](_0x18e464(0x239)+_0x21b76a);}const _0x5b9b6f=await withSpinner(_0x18e464(0x1e0),()=>_0x58c606[_0x18e464(0x248)]['sessions']({'projectName':_0x53433,'workflowName':_0x3c4a4e,'status':_0x1023b7[_0x18e464(0x1fe)],'fromTime':_0x1023b7[_0x18e464(0x1e2)],'toTime':_0x1023b7['to'],'limit':_0x1023b7['limit']}),{'verbose':_0x1023b7[_0x18e464(0x268)]}),_0x52cf80=_0x5b9b6f[_0x18e464(0x284)];return console['error'](_0x18e464(0x1f8)+_0x52cf80[_0x18e464(0x21d)]+'\x20session'+(_0x52cf80['length']!==0x1?'s':'')),await handleSDKOutput(_0x52cf80,_0x1023b7),0x0;}catch(_0x55d834){if(_0x55d834 instanceof SDKError)return console[_0x18e464(0x250)](_0x18e464(0x26d)+_0x55d834[_0x18e464(0x273)]),_0x55d834['cause']&&console[_0x18e464(0x250)]('\x20\x20Cause:\x20'+_0x55d834[_0x18e464(0x21c)]),0x1;throw _0x55d834;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a35_0x3cf62c(0x245)]=a35_0x3cf62c(0x270);[a35_0x3cf62c(0x287)]='List\x20workflow\x20attempts';async['execute'](_0x37f712){const _0x3422e8=a35_0x3cf62c,{options:_0x296c35,args:_0x45250e,tdx:_0x37a30a}=_0x37f712;let _0x816204,_0x24aa24;if(_0x45250e[0x0]){const _0x502ad3=_0x45250e[0x0][_0x3422e8(0x266)]('.');if(_0x502ad3[_0x3422e8(0x21d)]===0x1)_0x816204=_0x502ad3[0x0];else{if(_0x502ad3['length']===0x2)[_0x816204,_0x24aa24]=_0x502ad3;else return console[_0x3422e8(0x250)]('Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),0x1;}}try{const _0x7bfd49=_0x296c35[_0x3422e8(0x240)];if(_0x296c35[_0x3422e8(0x268)]){if(_0x816204&&_0x24aa24)console[_0x3422e8(0x250)](_0x3422e8(0x23a)+_0x816204+'.'+_0x24aa24);else _0x816204&&console[_0x3422e8(0x250)](_0x3422e8(0x25d)+_0x816204);_0x7bfd49&&console[_0x3422e8(0x250)](_0x3422e8(0x260));}const _0x2f7118=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x37a30a[_0x3422e8(0x248)][_0x3422e8(0x1eb)]({'projectName':_0x816204,'workflowName':_0x24aa24,'includeRetried':_0x7bfd49,'limit':_0x296c35[_0x3422e8(0x1dc)]}),{'verbose':_0x296c35[_0x3422e8(0x268)]}),_0x4c8f0b=_0x2f7118['data'];return console[_0x3422e8(0x250)]('✔\x20Found\x20'+_0x4c8f0b[_0x3422e8(0x21d)]+_0x3422e8(0x24f)+(_0x4c8f0b[_0x3422e8(0x21d)]!==0x1?'s':'')),await handleSDKOutput(_0x4c8f0b,_0x296c35),0x0;}catch(_0x16f1ea){if(_0x16f1ea instanceof SDKError)return console[_0x3422e8(0x250)]('Error:\x20'+_0x16f1ea['message']),_0x16f1ea[_0x3422e8(0x21c)]&&console['error']('\x20\x20Cause:\x20'+_0x16f1ea[_0x3422e8(0x21c)]),0x1;throw _0x16f1ea;}}}export class WorkflowAttemptCommand extends BaseCommand{[a35_0x3cf62c(0x245)]=a35_0x3cf62c(0x23f);[a35_0x3cf62c(0x287)]=a35_0x3cf62c(0x27c);async['execute'](_0x151e8f){const _0x308eb4=a35_0x3cf62c,{options:_0x10b150,args:_0x5f1213,tdx:_0x907a27}=_0x151e8f,_0x211950=_0x5f1213[0x0];if(!_0x211950)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{_0x10b150[_0x308eb4(0x268)]&&console[_0x308eb4(0x250)](_0x308eb4(0x281)+_0x211950);const _0x1630d7=await withSpinner(_0x308eb4(0x253),()=>_0x907a27[_0x308eb4(0x248)][_0x308eb4(0x214)](_0x211950),{'verbose':_0x10b150[_0x308eb4(0x268)]}),_0x4e3933=_0x1630d7[_0x308eb4(0x284)];let _0x11fa24;!_0x4e3933[_0x308eb4(0x257)]?_0x11fa24=_0x4e3933[_0x308eb4(0x23d)]?'canceling':_0x308eb4(0x202):_0x11fa24=_0x4e3933[_0x308eb4(0x20e)]?_0x308eb4(0x20e):_0x308eb4(0x250);let _0x30e8dc;if(_0x4e3933[_0x308eb4(0x20a)]&&_0x4e3933['finishedAt']){const _0x33e249=new Date(_0x4e3933[_0x308eb4(0x20a)])[_0x308eb4(0x263)](),_0x2d90d7=new Date(_0x4e3933[_0x308eb4(0x275)])[_0x308eb4(0x263)]();_0x30e8dc=Math[_0x308eb4(0x204)]((_0x2d90d7-_0x33e249)/0x3e8);}const _0x472b13={'attempt_id':_0x4e3933['id'],'status':_0x11fa24,..._0x4e3933[_0x308eb4(0x234)]!==undefined&&{'index':_0x4e3933[_0x308eb4(0x234)]},..._0x4e3933[_0x308eb4(0x25e)]&&{'project':_0x4e3933[_0x308eb4(0x25e)][_0x308eb4(0x245)]},..._0x4e3933[_0x308eb4(0x248)]&&{'workflow':_0x4e3933[_0x308eb4(0x248)]['name']},..._0x4e3933[_0x308eb4(0x207)]&&{'session_id':_0x4e3933[_0x308eb4(0x207)]},..._0x4e3933[_0x308eb4(0x22e)]&&{'session_time':_0x4e3933[_0x308eb4(0x22e)]},..._0x4e3933[_0x308eb4(0x24a)]&&{'retry_attempt':_0x4e3933[_0x308eb4(0x24a)]},..._0x30e8dc!==undefined&&{'duration_sec':_0x30e8dc},..._0x4e3933[_0x308eb4(0x20a)]&&{'created_at':_0x4e3933[_0x308eb4(0x20a)]},..._0x4e3933[_0x308eb4(0x275)]&&{'finished_at':_0x4e3933[_0x308eb4(0x275)]},...Object[_0x308eb4(0x1f3)](_0x4e3933[_0x308eb4(0x265)])[_0x308eb4(0x21d)]>0x0&&{'params':_0x4e3933[_0x308eb4(0x265)]}};return await handleSingleObjectOutput(_0x472b13,_0x10b150),0x0;}catch(_0x55ee96){if(_0x55ee96 instanceof SDKError)return console[_0x308eb4(0x250)](_0x308eb4(0x26d)+_0x55ee96['message']),_0x55ee96[_0x308eb4(0x21c)]&&console[_0x308eb4(0x250)](_0x308eb4(0x23b)+_0x55ee96['cause']),0x1;throw _0x55ee96;}}}export class WorkflowTasksCommand extends BaseCommand{[a35_0x3cf62c(0x245)]=a35_0x3cf62c(0x27e);[a35_0x3cf62c(0x287)]=a35_0x3cf62c(0x1e5);async[a35_0x3cf62c(0x228)](_0x4484fc){const _0x54ca74=a35_0x3cf62c,{options:_0x3c01c8,args:_0x3340d6,tdx:_0x46bd50}=_0x4484fc,_0x5e9334=_0x3340d6[0x0];if(!_0x5e9334)return console[_0x54ca74(0x250)](_0x54ca74(0x24d)),0x1;try{const _0x8fb230=_0x3c01c8[_0x54ca74(0x222)];_0x3c01c8[_0x54ca74(0x268)]&&(console[_0x54ca74(0x250)](_0x54ca74(0x281)+_0x5e9334),_0x8fb230&&console['error']('Including\x20subtasks:\x20yes'));const _0x3dc63a=await withSpinner(_0x54ca74(0x229),()=>_0x46bd50[_0x54ca74(0x248)]['tasks'](_0x5e9334,_0x8fb230||![]),{'verbose':_0x3c01c8['verbose']}),_0x53c4fc=_0x3dc63a[_0x54ca74(0x284)];return console[_0x54ca74(0x250)]('✔\x20Found\x20'+_0x53c4fc[_0x54ca74(0x21d)]+_0x54ca74(0x27a)+(_0x53c4fc[_0x54ca74(0x21d)]!==0x1?'s':'')),await handleSDKOutput(_0x53c4fc,_0x3c01c8),0x0;}catch(_0x3ebead){if(_0x3ebead instanceof SDKError)return console[_0x54ca74(0x250)](_0x54ca74(0x26d)+_0x3ebead[_0x54ca74(0x273)]),_0x3ebead[_0x54ca74(0x21c)]&&console[_0x54ca74(0x250)](_0x54ca74(0x23b)+_0x3ebead[_0x54ca74(0x21c)]),0x1;throw _0x3ebead;}}}export class WorkflowLogsCommand extends BaseCommand{[a35_0x3cf62c(0x245)]='workflow:logs';[a35_0x3cf62c(0x287)]=a35_0x3cf62c(0x208);async[a35_0x3cf62c(0x228)](_0xd03cd3){const _0x2b270a=a35_0x3cf62c,{options:_0x49763c,args:_0x185e71,tdx:_0x936d51}=_0xd03cd3,_0x14d876=_0x185e71[0x0];let _0x524794=_0x185e71[0x1];if(!_0x14d876)return console[_0x2b270a(0x250)](_0x2b270a(0x24d)),0x1;try{_0x49763c['verbose']&&(console[_0x2b270a(0x250)]('Attempt\x20ID:\x20'+_0x14d876),_0x524794&&console[_0x2b270a(0x250)](_0x2b270a(0x221)+_0x524794));const _0x1abc62=await withSpinner(_0x2b270a(0x219),()=>_0x936d51['workflow'][_0x2b270a(0x242)](_0x14d876,_0x524794),{'verbose':_0x49763c[_0x2b270a(0x268)]}),_0x45045d=_0x1abc62[_0x2b270a(0x284)];if(_0x45045d['length']===0x0)return console[_0x2b270a(0x250)](_0x2b270a(0x244)),0x0;if(!_0x524794&&(_0x49763c[_0x2b270a(0x26e)]||_0x49763c['format']))return await handleSDKOutput(_0x45045d,_0x49763c),0x0;if(!_0x524794){const _0x435497=_0x45045d[_0x2b270a(0x205)](_0x3c616f=>({'title':_0x3c616f[_0x2b270a(0x25a)]+'\x20('+formatBytes(_0x3c616f[_0x2b270a(0x1e1)])+')','value':_0x3c616f[_0x2b270a(0x25a)]})),_0x326be9=await a35_0xc912cc({'type':_0x2b270a(0x255),'name':_0x2b270a(0x227),'message':_0x2b270a(0x215),'choices':_0x435497});if(!_0x326be9[_0x2b270a(0x227)])return console['error'](_0x2b270a(0x230)),0x0;_0x524794=_0x326be9['task'];}const _0x50d916=await withSpinner(_0x2b270a(0x271),()=>_0x936d51[_0x2b270a(0x248)][_0x2b270a(0x200)](_0x14d876,_0x524794),{'verbose':_0x49763c[_0x2b270a(0x268)]}),_0x440185=_0x50d916[_0x2b270a(0x284)];return _0x440185?console['log'](_0x440185):console[_0x2b270a(0x250)]('No\x20log\x20content\x20found'),0x0;}catch(_0x497643){if(_0x497643 instanceof SDKError)return console[_0x2b270a(0x250)](_0x2b270a(0x26d)+_0x497643['message']),_0x497643['cause']&&console[_0x2b270a(0x250)](_0x2b270a(0x23b)+_0x497643[_0x2b270a(0x21c)]),0x1;throw _0x497643;}}}export class WorkflowKillCommand extends BaseCommand{[a35_0x3cf62c(0x245)]=a35_0x3cf62c(0x20c);[a35_0x3cf62c(0x287)]=a35_0x3cf62c(0x232);async['execute'](_0x85f27a){const _0x303543=a35_0x3cf62c,{options:_0x520c47,args:_0x5e3681,tdx:_0x51db58}=_0x85f27a,_0x4aa3c4=_0x5e3681[0x0];if(!_0x4aa3c4)return console[_0x303543(0x250)](_0x303543(0x24d)),0x1;try{const _0x45563c=_0x520c47[_0x303543(0x1e8)];_0x520c47[_0x303543(0x268)]&&(console[_0x303543(0x250)]('Attempt\x20ID:\x20'+_0x4aa3c4),_0x45563c&&console['error'](_0x303543(0x26a)+_0x45563c));if(!_0x520c47[_0x303543(0x1da)]){const _0x3b327b=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x4aa3c4+'?');if(!_0x3b327b)return console[_0x303543(0x250)]('Cancelled'),0x0;}const _0x4209d9=await withSpinner(_0x303543(0x235),()=>_0x51db58[_0x303543(0x248)][_0x303543(0x209)](_0x4aa3c4,_0x45563c),{'verbose':_0x520c47[_0x303543(0x268)]}),_0x44960e=_0x4209d9[_0x303543(0x284)];return console[_0x303543(0x250)]('✔\x20'+_0x44960e),0x0;}catch(_0xc572e7){if(_0xc572e7 instanceof SDKError)return console[_0x303543(0x250)](_0x303543(0x26d)+_0xc572e7['message']),_0xc572e7[_0x303543(0x21c)]&&console[_0x303543(0x250)](_0x303543(0x23b)+_0xc572e7[_0x303543(0x21c)]),0x1;throw _0xc572e7;}}}function a35_0x2913(_0x445a63,_0x391be5){const _0x4653c9=a35_0x4653();return a35_0x2913=function(_0x2913a8,_0x3b9cd2){_0x2913a8=_0x2913a8-0x1d7;let _0x45a29d=_0x4653c9[_0x2913a8];return _0x45a29d;},a35_0x2913(_0x445a63,_0x391be5);}export class WorkflowRetryCommand extends BaseCommand{[a35_0x3cf62c(0x245)]=a35_0x3cf62c(0x23c);['description']='Retry\x20a\x20session\x20or\x20attempt';async[a35_0x3cf62c(0x228)](_0x1bb0df){const _0x3d7c68=a35_0x3cf62c,{options:_0x57e48f,args:_0x45d1bc,tdx:_0x148e69}=_0x1bb0df,_0x45168f=_0x45d1bc[0x0];if(!_0x45168f)return console[_0x3d7c68(0x250)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console['error'](_0x3d7c68(0x217)),0x1;let _0x257beb=![],_0x566ea2=_0x45168f;if(_0x45168f[_0x3d7c68(0x264)](_0x3d7c68(0x24c)))_0x257beb=!![],_0x566ea2=_0x45168f['substring'](0x8);else{if(_0x45168f[_0x3d7c68(0x264)](_0x3d7c68(0x233)))_0x257beb=![],_0x566ea2=_0x45168f[_0x3d7c68(0x1df)](0x8);else return console[_0x3d7c68(0x250)](_0x3d7c68(0x22f)),console[_0x3d7c68(0x250)](_0x3d7c68(0x217)),0x1;}try{const _0x122dbc=_0x57e48f[_0x3d7c68(0x26c)],_0x6624f8=_0x57e48f['resumeFrom'],_0x3ff2be=_0x57e48f[_0x3d7c68(0x265)],_0x2cf428=_0x57e48f['force'];_0x57e48f['verbose']&&(console['error'](_0x3d7c68(0x249)+(_0x257beb?_0x3d7c68(0x282):_0x3d7c68(0x214))+'\x20'+_0x566ea2),_0x122dbc&&console[_0x3d7c68(0x250)](_0x3d7c68(0x26b)+_0x122dbc),_0x6624f8&&console['error'](_0x3d7c68(0x1f5)+_0x6624f8),_0x3ff2be&&console[_0x3d7c68(0x250)](_0x3d7c68(0x21e)+_0x3ff2be),_0x2cf428&&console[_0x3d7c68(0x250)](_0x3d7c68(0x1ec)));let _0x5d4049;if(_0x3ff2be)try{if(_0x3ff2be[_0x3d7c68(0x264)]('@')){const _0xd166b6=await import(_0x3d7c68(0x1ea)),_0x36b491=_0x3ff2be[_0x3d7c68(0x1df)](0x1),_0x250a5c=await _0xd166b6[_0x3d7c68(0x1f7)](_0x36b491,_0x3d7c68(0x241));_0x5d4049=JSON[_0x3d7c68(0x26f)](_0x250a5c);}else _0x5d4049=JSON[_0x3d7c68(0x26f)](_0x3ff2be);}catch{return console[_0x3d7c68(0x250)](_0x3d7c68(0x22a)),0x1;}if(!_0x57e48f[_0x3d7c68(0x1da)]){const _0x82a213=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x257beb?_0x3d7c68(0x282):_0x3d7c68(0x214))+'\x20'+_0x566ea2+'?');if(!_0x82a213)return console['error'](_0x3d7c68(0x230)),0x0;}let _0x1c35ea;_0x257beb?_0x1c35ea=await withSpinner(_0x3d7c68(0x1f6),()=>_0x148e69[_0x3d7c68(0x248)][_0x3d7c68(0x237)](_0x566ea2,{'fromTask':_0x122dbc,'retryParams':_0x5d4049}),{'verbose':_0x57e48f[_0x3d7c68(0x268)]}):_0x1c35ea=await withSpinner('Retrying\x20attempt...',()=>_0x148e69['workflow'][_0x3d7c68(0x274)](_0x566ea2,{'resumeFrom':_0x6624f8,'retryParams':_0x5d4049,'force':_0x2cf428}),{'verbose':_0x57e48f[_0x3d7c68(0x268)]});const _0x452364=_0x1c35ea[_0x3d7c68(0x284)];return console[_0x3d7c68(0x250)](_0x3d7c68(0x22b)),console[_0x3d7c68(0x250)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x452364[_0x3d7c68(0x246)]),console['error'](_0x3d7c68(0x243)+_0x452364['sessionId']),0x0;}catch(_0x9746ee){if(_0x9746ee instanceof SDKError)return console[_0x3d7c68(0x250)]('Error:\x20'+_0x9746ee['message']),_0x9746ee['cause']&&console[_0x3d7c68(0x250)]('\x20\x20Cause:\x20'+_0x9746ee[_0x3d7c68(0x21c)]),0x1;throw _0x9746ee;}}}export class WorkflowRunCommand extends BaseCommand{[a35_0x3cf62c(0x245)]=a35_0x3cf62c(0x25c);[a35_0x3cf62c(0x287)]=a35_0x3cf62c(0x212);async[a35_0x3cf62c(0x228)](_0x597ef0){const _0x16e7bc=a35_0x3cf62c,{options:_0x2266f8,args:_0x30fc9c,tdx:_0x1d9bc4}=_0x597ef0,_0x5c415b=_0x30fc9c[0x0];if(!_0x5c415b)return console[_0x16e7bc(0x250)](_0x16e7bc(0x1f9)),console[_0x16e7bc(0x250)]('Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]'),0x1;const _0x214223=_0x2266f8['param'],_0x920f6d=_0x2266f8[_0x16e7bc(0x22e)],_0xe78c02={};if(_0x214223&&Array[_0x16e7bc(0x1e7)](_0x214223))for(const _0x16b5ce of _0x214223){const _0x41d6ae=_0x16b5ce[_0x16e7bc(0x24e)]('=');if(_0x41d6ae===-0x1)return console[_0x16e7bc(0x250)](_0x16e7bc(0x267)+_0x16b5ce),console[_0x16e7bc(0x250)](_0x16e7bc(0x223)),0x1;const _0xcf02bc=_0x16b5ce[_0x16e7bc(0x1df)](0x0,_0x41d6ae),_0x277445=_0x16b5ce['substring'](_0x41d6ae+0x1);try{_0xe78c02[_0xcf02bc]=JSON[_0x16e7bc(0x26f)](_0x277445);}catch{_0xe78c02[_0xcf02bc]=_0x277445;}}_0x2266f8[_0x16e7bc(0x268)]&&(console[_0x16e7bc(0x250)](_0x16e7bc(0x252)+_0x5c415b),Object[_0x16e7bc(0x1f3)](_0xe78c02)[_0x16e7bc(0x21d)]>0x0&&console[_0x16e7bc(0x250)](_0x16e7bc(0x269)+JSON[_0x16e7bc(0x22d)](_0xe78c02)),_0x920f6d&&console[_0x16e7bc(0x250)](_0x16e7bc(0x27f)+_0x920f6d));const _0x1f5d8e=await withSpinner(_0x16e7bc(0x259),()=>_0x1d9bc4[_0x16e7bc(0x248)][_0x16e7bc(0x226)](_0x5c415b,_0xe78c02,{'sessionTime':_0x920f6d}),{'verbose':_0x2266f8['verbose']}),_0x4fc653=_0x1f5d8e[_0x16e7bc(0x284)];return console[_0x16e7bc(0x250)](_0x16e7bc(0x278)),console[_0x16e7bc(0x250)](_0x16e7bc(0x231)+_0x4fc653['id']),console[_0x16e7bc(0x250)]('\x20\x20Session\x20ID:\x20'+_0x4fc653[_0x16e7bc(0x207)]),console[_0x16e7bc(0x250)](_0x16e7bc(0x25b)+_0x4fc653[_0x16e7bc(0x25e)]?.[_0x16e7bc(0x245)]),console[_0x16e7bc(0x250)](_0x16e7bc(0x236)+_0x4fc653[_0x16e7bc(0x248)]?.[_0x16e7bc(0x245)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a35_0x3cf62c(0x245)]=a35_0x3cf62c(0x1f0);[a35_0x3cf62c(0x287)]=a35_0x3cf62c(0x272);async[a35_0x3cf62c(0x228)](_0x92a5d8){const _0x7c2447=a35_0x3cf62c,{options:_0x205ffa,args:_0x44ceb8,tdx:_0x312525}=_0x92a5d8,_0x8a69ca=_0x44ceb8[0x0],_0x3740d4=_0x44ceb8[0x1]||'.';if(!_0x8a69ca)return console[_0x7c2447(0x250)](_0x7c2447(0x220)),console[_0x7c2447(0x250)](_0x7c2447(0x247)),0x1;const _0x1ae417=_0x205ffa[_0x7c2447(0x1db)];_0x205ffa[_0x7c2447(0x268)]&&(console[_0x7c2447(0x250)]('Project:\x20'+_0x8a69ca),console['error'](_0x7c2447(0x1f2)+_0x3740d4),_0x1ae417&&console[_0x7c2447(0x250)]('Revision:\x20'+_0x1ae417));const _0x268d35=await withSpinner('Downloading\x20project\x20'+_0x8a69ca+_0x7c2447(0x1e9),()=>_0x312525[_0x7c2447(0x248)][_0x7c2447(0x262)](_0x8a69ca,_0x3740d4,{'revision':_0x1ae417}),{'verbose':_0x205ffa[_0x7c2447(0x268)]}),_0x233f3b=_0x268d35[_0x7c2447(0x284)];return console['error'](_0x7c2447(0x256)+_0x233f3b['projectName']),console[_0x7c2447(0x250)](_0x7c2447(0x225)+_0x233f3b[_0x7c2447(0x1db)]),console[_0x7c2447(0x250)](_0x7c2447(0x1ee)+_0x233f3b[_0x7c2447(0x288)]),console['error'](_0x7c2447(0x216)+_0x3740d4+'/'+_0x233f3b[_0x7c2447(0x279)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a35_0x3cf62c(0x245)]=a35_0x3cf62c(0x1ef);[a35_0x3cf62c(0x287)]=a35_0x3cf62c(0x21b);async[a35_0x3cf62c(0x228)](_0x52e892){const _0x195f9d=a35_0x3cf62c,{options:_0x1e8ff9,args:_0x2bef6c,tdx:_0x2a0c9b}=_0x52e892;let _0x1cbfdf='.',_0x27d6dc=_0x1e8ff9[_0x195f9d(0x245)];if(_0x2bef6c[0x0]){const {promises:_0x43d1a7}=await import('fs');try{const _0x5599ae=await _0x43d1a7[_0x195f9d(0x23e)](_0x2bef6c[0x0]);if(_0x5599ae[_0x195f9d(0x210)]())_0x1cbfdf=_0x2bef6c[0x0];else return console[_0x195f9d(0x250)](_0x195f9d(0x26d)+_0x2bef6c[0x0]+_0x195f9d(0x280)),0x1;}catch{_0x27d6dc=_0x2bef6c[0x0],_0x1cbfdf='.';}}const _0x38399f=_0x1e8ff9['revision'],_0x51e32e=_0x1e8ff9[_0x195f9d(0x20f)];_0x1e8ff9[_0x195f9d(0x268)]&&(console[_0x195f9d(0x250)](_0x195f9d(0x24b)+_0x1cbfdf),_0x27d6dc&&console[_0x195f9d(0x250)](_0x195f9d(0x283)+_0x27d6dc),_0x38399f&&console[_0x195f9d(0x250)](_0x195f9d(0x1fd)+_0x38399f),_0x51e32e&&console['error'](_0x195f9d(0x285)));const _0x5e2dd8=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x2a0c9b[_0x195f9d(0x248)][_0x195f9d(0x238)](_0x1cbfdf,{'projectName':_0x27d6dc,'revision':_0x38399f,'skipValidation':_0x51e32e}),{'verbose':_0x1e8ff9['verbose']}),_0x187a64=_0x5e2dd8[_0x195f9d(0x284)];return console[_0x195f9d(0x250)](_0x195f9d(0x206)+_0x187a64[_0x195f9d(0x279)]),console[_0x195f9d(0x250)](_0x195f9d(0x1e4)+_0x187a64[_0x195f9d(0x22c)]),console['error'](_0x195f9d(0x225)+_0x187a64[_0x195f9d(0x1db)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a35_0x3cf62c(0x245)]=a35_0x3cf62c(0x251);[a35_0x3cf62c(0x287)]=a35_0x3cf62c(0x277);async[a35_0x3cf62c(0x228)](_0x2b6c31){const _0x57e507=a35_0x3cf62c,{options:_0x51ddb0,args:_0x3ec870,tdx:_0x3e2176}=_0x2b6c31,_0x2ed3fe=_0x3ec870[0x0];if(!_0x2ed3fe)return console[_0x57e507(0x250)](_0x57e507(0x1ed)),console['error']('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x51ddb0['verbose']&&console[_0x57e507(0x250)](_0x57e507(0x1e6)+_0x2ed3fe);if(!_0x51ddb0[_0x57e507(0x1da)]){const _0x852ef5=await confirm(_0x57e507(0x218)+_0x2ed3fe+_0x57e507(0x258));if(!_0x852ef5)return console[_0x57e507(0x250)](_0x57e507(0x230)),0x0;}const _0x4858be=await withSpinner(_0x57e507(0x1d7)+_0x2ed3fe+_0x57e507(0x1e9),()=>_0x3e2176[_0x57e507(0x248)][_0x57e507(0x27d)](_0x2ed3fe),{'verbose':_0x51ddb0[_0x57e507(0x268)]}),_0x3bf51c=_0x4858be[_0x57e507(0x284)];return console['error']('✔\x20Deleted\x20project\x20'+_0x3bf51c[_0x57e507(0x279)]),console[_0x57e507(0x250)](_0x57e507(0x1e4)+_0x3bf51c[_0x57e507(0x22c)]),0x0;}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x8de3,_0x5c8269){const _0x4d8651=a34_0x3d75,_0x4dbaed=_0x8de3();while(!![]){try{const _0x13e9a6=-parseInt(_0x4d8651(0x95))/0x1*(-parseInt(_0x4d8651(0x99))/0x2)+-parseInt(_0x4d8651(0xa4))/0x3+-parseInt(_0x4d8651(0x97))/0x4*(-parseInt(_0x4d8651(0x92))/0x5)+-parseInt(_0x4d8651(0x9b))/0x6*(parseInt(_0x4d8651(0x9d))/0x7)+parseInt(_0x4d8651(0x98))/0x8+-parseInt(_0x4d8651(0xa7))/0x9+parseInt(_0x4d8651(0xa0))/0xa*(parseInt(_0x4d8651(0x91))/0xb);if(_0x13e9a6===_0x5c8269)break;else _0x4dbaed['push'](_0x4dbaed['shift']());}catch(_0x16d2df){_0x4dbaed['push'](_0x4dbaed['shift']());}}}(a34_0x55f5,0x79293));function a34_0x55f5(){const _0x4ca923=['version','tdx/','7LcgGwg','parse','976264cQkeNr','246640QSOSpr','197000RkMyoq','url','54LUxJFB','utf-8','46347EbuxGF','../../package.json','TD1\x20','230WQJxci',';\x20node/','replace','Authorization','1925373IjzRJr','entries','0.0.0','7730271slPnZk','522346gZuPwe','5dQMBHX'];a34_0x55f5=function(){return _0x4ca923;};return a34_0x55f5();}import{platform}from'os';function a34_0x3d75(_0x5e2daf,_0x4ebbbf){const _0x55f543=a34_0x55f5();return a34_0x3d75=function(_0x3d75e5,_0x5e4a4e){_0x3d75e5=_0x3d75e5-0x91;let _0x579231=_0x55f543[_0x3d75e5];return _0x579231;},a34_0x3d75(_0x5e2daf,_0x4ebbbf);}import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x187c8b=a34_0x3d75;try{const _0x41fdcd=fileURLToPath(import.meta[_0x187c8b(0x9a)]),_0x436639=dirname(_0x41fdcd),_0x47c047=join(_0x436639,_0x187c8b(0x9e)),_0x18de1c=JSON[_0x187c8b(0x96)](readFileSync(_0x47c047,_0x187c8b(0x9c)));return _0x18de1c[_0x187c8b(0x93)];}catch{return _0x187c8b(0xa6);}}export function getUserAgent(){const _0x49b379=a34_0x3d75,_0x53ecda=getVersion(),_0x293b50=platform(),_0xf07140=process[_0x49b379(0x93)][_0x49b379(0xa2)]('v','');return _0x49b379(0x94)+_0x53ecda+'\x20('+_0x293b50+_0x49b379(0xa1)+_0xf07140+')';}export function getAuthHeaders(_0x17a392,_0x58c2f7){const _0x321ccb=a34_0x3d75,_0x2619f7=getVersion(),_0x5af15a={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x2619f7};return _0x58c2f7&&(_0x5af15a[_0x321ccb(0xa3)]=_0x321ccb(0x9f)+_0x58c2f7),_0x5af15a;}export function toHeaderRecord(_0x39575b){const _0x7cc04c=a34_0x3d75,_0x30b3c0={};for(const [_0x4332f6,_0xd89715]of Object[_0x7cc04c(0xa5)](_0x39575b)){_0xd89715!==undefined&&(_0x30b3c0[_0x4332f6]=_0xd89715);}return _0x30b3c0;}export function getTrinoHeaders(_0x3a89e1,_0x5e0493){const _0x48812e=a34_0x3d75,_0x354580=getAuthHeaders(_0x3a89e1,_0x5e0493),_0x62b5cd=toHeaderRecord(_0x354580);return delete _0x62b5cd[_0x48812e(0xa3)],_0x5e0493&&(_0x62b5cd['X-Trino-User']=_0x5e0493),_0x62b5cd;}export function hasAPIKey(_0x2b3cec){const _0x373966=getAPIKey(_0x2b3cec);return _0x373966!==undefined&&_0x373966['length']>0x0;}
1
+ (function(_0x29858d,_0x55a7ee){const _0x1a39c0=a36_0x1ac7,_0x453310=_0x29858d();while(!![]){try{const _0x3d6d43=parseInt(_0x1a39c0(0xda))/0x1+parseInt(_0x1a39c0(0xd8))/0x2+parseInt(_0x1a39c0(0xd4))/0x3*(-parseInt(_0x1a39c0(0xdc))/0x4)+-parseInt(_0x1a39c0(0xde))/0x5*(parseInt(_0x1a39c0(0xe1))/0x6)+-parseInt(_0x1a39c0(0xe2))/0x7*(parseInt(_0x1a39c0(0xe0))/0x8)+parseInt(_0x1a39c0(0xd1))/0x9*(parseInt(_0x1a39c0(0xdb))/0xa)+parseInt(_0x1a39c0(0xd2))/0xb;if(_0x3d6d43===_0x55a7ee)break;else _0x453310['push'](_0x453310['shift']());}catch(_0x2a2d8f){_0x453310['push'](_0x453310['shift']());}}}(a36_0x1999,0xa7d2c));import{platform}from'os';function a36_0x1999(){const _0x191f12=['tdx/','91336OHmoig','1589442PUqrNn','406lNeIao',';\x20node/','version','16686AxOqVw','13227665RCsuqL','0.0.0','3iezECn','parse','url','Authorization','987422noVSMo','tdx','206053nXrdlh','4280ZCMhzG','1146292chJkQq','X-Trino-User','20CvKmXT'];a36_0x1999=function(){return _0x191f12;};return a36_0x1999();}import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';function a36_0x1ac7(_0x4cc9c1,_0x5a355b){const _0x1999d1=a36_0x1999();return a36_0x1ac7=function(_0x1ac73e,_0x3f5670){_0x1ac73e=_0x1ac73e-0xd0;let _0x40a86=_0x1999d1[_0x1ac73e];return _0x40a86;},a36_0x1ac7(_0x4cc9c1,_0x5a355b);}import{getAPIKey}from'./config.js';export function getVersion(){const _0x121185=a36_0x1ac7;try{const _0x160f5f=fileURLToPath(import.meta[_0x121185(0xd6)]),_0x231361=dirname(_0x160f5f),_0x5d461c=join(_0x231361,'../../package.json'),_0x5219b2=JSON[_0x121185(0xd5)](readFileSync(_0x5d461c,'utf-8'));return _0x5219b2[_0x121185(0xd0)];}catch{return _0x121185(0xd3);}}export function getUserAgent(){const _0x39f848=a36_0x1ac7,_0x1ae0bc=getVersion(),_0x55224b=platform(),_0x57225b=process['version']['replace']('v','');return _0x39f848(0xdf)+_0x1ae0bc+'\x20('+_0x55224b+_0x39f848(0xe3)+_0x57225b+')';}export function getAuthHeaders(_0x2f1448,_0x491fd1){const _0x176f0d=a36_0x1ac7,_0x3cbc98=getVersion(),_0x57ab28={'User-Agent':getUserAgent(),'X-TD-Client':_0x176f0d(0xd9),'X-TD-Client-Version':_0x3cbc98};return _0x491fd1&&(_0x57ab28[_0x176f0d(0xd7)]='TD1\x20'+_0x491fd1),_0x57ab28;}export function toHeaderRecord(_0x29482b){const _0x3f6707={};for(const [_0x5c8a30,_0x395ec1]of Object['entries'](_0x29482b)){_0x395ec1!==undefined&&(_0x3f6707[_0x5c8a30]=_0x395ec1);}return _0x3f6707;}export function getTrinoHeaders(_0x3bd200,_0x3c4fd2){const _0x1faec8=a36_0x1ac7,_0x2ab049=getAuthHeaders(_0x3bd200,_0x3c4fd2),_0x53cb5c=toHeaderRecord(_0x2ab049);return delete _0x53cb5c[_0x1faec8(0xd7)],_0x3c4fd2&&(_0x53cb5c[_0x1faec8(0xdd)]=_0x3c4fd2),_0x53cb5c;}export function hasAPIKey(_0x5d1712){const _0x512b1f=getAPIKey(_0x5d1712);return _0x512b1f!==undefined&&_0x512b1f['length']>0x0;}
@@ -1 +1 @@
1
- (function(_0x5615d7,_0xd79c9d){const _0x15195a=a35_0x1449,_0x41b542=_0x5615d7();while(!![]){try{const _0x25c14e=parseInt(_0x15195a(0x190))/0x1+parseInt(_0x15195a(0x1a1))/0x2+-parseInt(_0x15195a(0x16a))/0x3*(-parseInt(_0x15195a(0x177))/0x4)+parseInt(_0x15195a(0x19f))/0x5+parseInt(_0x15195a(0x197))/0x6*(-parseInt(_0x15195a(0x188))/0x7)+-parseInt(_0x15195a(0x16b))/0x8*(parseInt(_0x15195a(0x194))/0x9)+-parseInt(_0x15195a(0x16c))/0xa;if(_0x25c14e===_0xd79c9d)break;else _0x41b542['push'](_0x41b542['shift']());}catch(_0x3fc5ba){_0x41b542['push'](_0x41b542['shift']());}}}(a35_0x60ab,0x743a0));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a35_0x49734b from'node:fs';import*as a35_0x54bfb3 from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a35_0x171a70 from'chalk';export function getConfigDir(){const _0x8190d2=a35_0x1449;return process[_0x8190d2(0x1a2)][_0x8190d2(0x178)]||join(homedir(),'.config',_0x8190d2(0x1a4));}export function getConfigFile(){const _0x23f04a=a35_0x1449;return join(getConfigDir(),_0x23f04a(0x198));}export function getConfigFilePath(_0x4517e3){const _0x464f7d=a35_0x1449,_0x16cc29=getConfigDir();return _0x4517e3?a35_0x54bfb3['join'](_0x16cc29,_0x464f7d(0x192)+_0x4517e3):getConfigFile();}export function getCacheDir(){const _0x3c1544=a35_0x1449;return process[_0x3c1544(0x1a2)][_0x3c1544(0x1a5)]||join(homedir(),_0x3c1544(0x193),_0x3c1544(0x1a4));}export function getLLMProjectCacheFile(){return join(getCacheDir(),'llm_default_project');}export function readCachedLLMProject(){const _0x3e53b4=a35_0x1449;try{const _0x7a4fbc=getLLMProjectCacheFile();if(!existsSync(_0x7a4fbc))return null;return readFileSync(_0x7a4fbc,_0x3e53b4(0x167))[_0x3e53b4(0x184)]();}catch{return null;}}export function writeCachedLLMProject(_0x1e350f){const _0x4d5bd3=a35_0x1449;try{const _0x17fa18=getCacheDir(),_0x3f6330=getLLMProjectCacheFile();!existsSync(_0x17fa18)&&mkdirSync(_0x17fa18,{'recursive':!![]}),writeFileSync(_0x3f6330,_0x1e350f,'utf-8');}catch(_0x125d72){console[_0x4d5bd3(0x179)](_0x4d5bd3(0x189),_0x125d72);}}export function parseEnvFile(_0x586511){const _0x1ea985=a35_0x1449,_0x260c94={};for(const _0xa635bc of _0x586511['split']('\x0a')){const _0x1e0bec=_0xa635bc[_0x1ea985(0x184)]();if(!_0x1e0bec||_0x1e0bec[_0x1ea985(0x18e)]('#'))continue;const _0x1ab98a=_0x1e0bec['match'](/^([^=]+)=(.*)$/);if(_0x1ab98a){const _0x2c9742=_0x1ab98a[0x1][_0x1ea985(0x184)]();let _0x303718=_0x1ab98a[0x2][_0x1ea985(0x184)]();(_0x303718[_0x1ea985(0x18e)]('\x22')&&_0x303718[_0x1ea985(0x18f)]('\x22')||_0x303718[_0x1ea985(0x18e)]('\x27')&&_0x303718[_0x1ea985(0x18f)]('\x27'))&&(_0x303718=_0x303718['slice'](0x1,-0x1)),_0x260c94[_0x2c9742]=_0x303718;}}return _0x260c94;}export function readUserConfig(){const _0x487874=a35_0x1449,_0xed822a=getConfigFile();if(!existsSync(_0xed822a))return{};try{const _0xded79a=readFileSync(_0xed822a,'utf-8');return parseEnvFile(_0xded79a);}catch(_0x4d5157){return console[_0x487874(0x18c)](_0x487874(0x186)+_0xed822a+':',_0x4d5157),{};}}export function resolveSite(_0x398778){const _0x4e1a44=a35_0x1449,_0xd01ac2=[_0x4e1a44(0x169),'jp01',_0x4e1a44(0x19e),'ap02',_0x4e1a44(0x172),_0x4e1a44(0x16e),_0x4e1a44(0x18b),_0x4e1a44(0x19a),_0x4e1a44(0x185),_0x4e1a44(0x168)];if(_0xd01ac2[_0x4e1a44(0x19c)](_0x398778))return _0x398778;if(_0x398778 in SITE_ALIASES)return SITE_ALIASES[_0x398778];return console[_0x4e1a44(0x18c)](_0x4e1a44(0x171)+_0x398778+_0x4e1a44(0x16d)),_0x4e1a44(0x169);}let cachedUserConfig=null;function a35_0x60ab(){const _0x5658d1=['toUpperCase','.env.','.cache','693nwXDop','profile:\x20','existsSync','6kRRgGV','.env','yellow','stg-us01','\x20(TD_API_KEY)','includes','replace','eu01','4736490muJuOW','join','1538064XoYWnP','env','filter','tdx','TDX_CACHE_DIR','TD_API_KEY','utf-8','stg-ap03','us01','5058cbKZHP','96464uenWMJ','12360740PRUApU','\x27,\x20defaulting\x20to\x20us01','dev-us01','Warning:\x20Failed\x20to\x20read\x20','ap02','Warning:\x20Unknown\x20site\x20\x27','ap03','split','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','global:\x20','jp01','1816eeYtNM','TDX_CONFIG_DIR','error','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','env:\x20','Warning:\x20Failed\x20to\x20load\x20','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','map','profiles','env:\x20TD_API_KEY','profile','apiKeys','some','trim','stg-jp01','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','readFileSync','4287710OhpByc','Warning:\x20Failed\x20to\x20cache\x20LLM\x20project\x20name:','TD_API_KEY_','dev-eu01','warn','entries','startsWith','endsWith','771360YLQWCs'];a35_0x60ab=function(){return _0x5658d1;};return a35_0x60ab();}export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x5a6213,_0x53a75e){const _0x15456a=a35_0x1449,_0x1d9fc3=_0x5a6213[_0x15456a(0x191)]()[_0x15456a(0x19d)](/-/g,'_'),_0x53b878=_0x15456a(0x18a)+_0x1d9fc3;if(process[_0x15456a(0x1a2)][_0x53b878])return process[_0x15456a(0x1a2)][_0x53b878];if(process[_0x15456a(0x1a2)][_0x15456a(0x1a6)])return process[_0x15456a(0x1a2)][_0x15456a(0x1a6)];const _0x24ec87=_0x53a75e||getActiveProfileName();if(_0x24ec87){const _0x1ab4d=loadProfileEnv(_0x24ec87);if(_0x1ab4d){if(_0x1ab4d[_0x53b878])return _0x1ab4d[_0x53b878];if(_0x1ab4d[_0x15456a(0x1a6)])return _0x1ab4d['TD_API_KEY'];}}const _0x76bae6=loadUserConfigOnce();if(_0x76bae6[_0x53b878])return _0x76bae6[_0x53b878];if(_0x76bae6[_0x15456a(0x1a6)])return _0x76bae6[_0x15456a(0x1a6)];return undefined;}export async function getAPIKeyAsync(_0x397817,_0x2cf431){const _0x122ac3=a35_0x1449,_0x3afead=_0x397817[_0x122ac3(0x191)]()['replace'](/-/g,'_'),_0x126544=_0x122ac3(0x18a)+_0x3afead;if(process[_0x122ac3(0x1a2)][_0x126544])return process['env'][_0x126544];if(process[_0x122ac3(0x1a2)]['TD_API_KEY'])return process[_0x122ac3(0x1a2)][_0x122ac3(0x1a6)];const _0x4075e6=_0x2cf431||getActiveProfileName()||undefined,_0x5c1e9e=getCachedCredential(_0x397817,_0x4075e6);if(_0x5c1e9e)return _0x5c1e9e;const _0x466f0c=await getKeychainAPIKey(_0x4075e6);if(_0x466f0c)return setCachedCredential(_0x466f0c,_0x397817,_0x4075e6),_0x466f0c;const _0x26cc30=getLegacyEnvAPIKey(_0x397817,_0x4075e6);if(_0x26cc30){const _0x4c29da=await isKeychainAvailable();if(_0x4c29da)try{await saveKeychainAPIKey(_0x26cc30,_0x4075e6),setCachedCredential(_0x26cc30,_0x397817,_0x4075e6);const _0x33b5a1=getConfigFilePath(_0x4075e6);cleanupLegacyEnvFile(_0x33b5a1)&&console[_0x122ac3(0x18c)](a35_0x171a70[_0x122ac3(0x199)](_0x122ac3(0x174)));}catch(_0x3e0ad0){console[_0x122ac3(0x18c)](a35_0x171a70['yellow'](_0x122ac3(0x17d)+_0x3e0ad0));}return _0x26cc30;}return undefined;}function getLegacyEnvAPIKey(_0x58a166,_0x5b2eb3){const _0x494851=a35_0x1449,_0x5d6906=_0x58a166[_0x494851(0x191)]()[_0x494851(0x19d)](/-/g,'_'),_0x3efc7a='TD_API_KEY_'+_0x5d6906;if(_0x5b2eb3){const _0x5e1538=loadProfileEnv(_0x5b2eb3);if(_0x5e1538){if(_0x5e1538[_0x3efc7a])return _0x5e1538[_0x3efc7a];if(_0x5e1538[_0x494851(0x1a6)])return _0x5e1538[_0x494851(0x1a6)];}}const _0x25420c=loadUserConfigOnce();if(_0x25420c[_0x3efc7a])return _0x25420c[_0x3efc7a];if(_0x25420c[_0x494851(0x1a6)])return _0x25420c[_0x494851(0x1a6)];return undefined;}function a35_0x1449(_0x6e8452,_0x1458ae){const _0x60ab45=a35_0x60ab();return a35_0x1449=function(_0x144930,_0x1989c8){_0x144930=_0x144930-0x167;let _0x33240c=_0x60ab45[_0x144930];return _0x33240c;},a35_0x1449(_0x6e8452,_0x1458ae);}function cleanupLegacyEnvFile(_0x47274e){const _0x41e92e=a35_0x1449;if(!existsSync(_0x47274e))return![];try{const _0x457e54=readFileSync(_0x47274e,_0x41e92e(0x167)),_0x471b61=_0x457e54[_0x41e92e(0x173)]('\x0a'),_0x8585ea=_0x471b61[_0x41e92e(0x1a3)](_0x17707c=>{const _0x2bda13=_0x41e92e,_0x2ef4b2=_0x17707c['trim']();if(!_0x2ef4b2||_0x2ef4b2['startsWith']('#'))return!![];const [_0x1f839a]=_0x2ef4b2[_0x2bda13(0x173)]('=');return!_0x1f839a[_0x2bda13(0x18e)](_0x2bda13(0x1a6));}),_0x301e88=_0x8585ea[_0x41e92e(0x183)](_0x4e470b=>{const _0x200d0f=_0x41e92e,_0x12aad8=_0x4e470b[_0x200d0f(0x184)]();return _0x12aad8&&!_0x12aad8[_0x200d0f(0x18e)]('#');});if(!_0x301e88)return unlinkSync(_0x47274e),!![];return writeFileSync(_0x47274e,_0x8585ea[_0x41e92e(0x1a0)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}export function getAPIKeySource(_0x2ff2ef,_0x32ed73){const _0x156384=a35_0x1449,_0x1f0a2f=_0x156384(0x18a)+_0x2ff2ef['toUpperCase']()[_0x156384(0x19d)](/-/g,'_');if(process[_0x156384(0x1a2)][_0x1f0a2f])return _0x156384(0x17b)+_0x1f0a2f;if(process[_0x156384(0x1a2)][_0x156384(0x1a6)])return _0x156384(0x180);const _0x25a2f7=_0x32ed73||getActiveProfileName();if(_0x25a2f7){const _0x287876=loadProfileEnv(_0x25a2f7);if(_0x287876){if(_0x287876[_0x1f0a2f])return _0x156384(0x195)+_0x25a2f7+'\x20('+_0x1f0a2f+')';if(_0x287876[_0x156384(0x1a6)])return'profile:\x20'+_0x25a2f7+_0x156384(0x19b);}}const _0x2f459b=loadUserConfigOnce(),_0x561da9=getConfigFile();if(_0x2f459b[_0x1f0a2f])return _0x156384(0x175)+_0x561da9+'\x20('+_0x1f0a2f+')';if(_0x2f459b['TD_API_KEY'])return _0x156384(0x175)+_0x561da9+_0x156384(0x19b);return null;}function loadProfileEnv(_0x5050a2){const _0x5a23e6=a35_0x1449,_0xa3364a=a35_0x54bfb3['join'](getConfigDir(),_0x5a23e6(0x192)+_0x5050a2);if(a35_0x49734b['existsSync'](_0xa3364a)){validateSecureFilePermissions(_0xa3364a);try{const _0x47300b=a35_0x49734b[_0x5a23e6(0x187)](_0xa3364a,_0x5a23e6(0x167));return parseEnvFile(_0x47300b);}catch(_0x15786f){console['warn'](_0x5a23e6(0x17c)+_0xa3364a+':\x20'+_0x15786f);}}const _0x4a79c7=a35_0x54bfb3[_0x5a23e6(0x1a0)](getConfigDir(),_0x5a23e6(0x17f),_0x5050a2,_0x5a23e6(0x198));if(a35_0x49734b[_0x5a23e6(0x196)](_0x4a79c7)){validateSecureFilePermissions(_0x4a79c7);try{const _0x179e42=a35_0x49734b[_0x5a23e6(0x187)](_0x4a79c7,_0x5a23e6(0x167));return parseEnvFile(_0x179e42);}catch(_0x26eb34){return console[_0x5a23e6(0x18c)]('Warning:\x20Failed\x20to\x20load\x20'+_0x4a79c7+':\x20'+_0x26eb34),null;}}return null;}function getActiveProfileName(){const _0x2ccaa5=a35_0x1449,_0x4fd05c=a35_0x54bfb3[_0x2ccaa5(0x1a0)](getConfigDir(),'tdx.json');if(!a35_0x49734b[_0x2ccaa5(0x196)](_0x4fd05c))return null;try{const _0x270a93=a35_0x49734b[_0x2ccaa5(0x187)](_0x4fd05c,_0x2ccaa5(0x167)),_0x37c170=JSON['parse'](_0x270a93);return _0x37c170[_0x2ccaa5(0x181)]||null;}catch{return null;}}export function saveAPIKey(_0xf2a6c2,_0x4a05d4,_0x5b6e78){const _0x563ff0=a35_0x1449,_0x5e6593=getConfigDir(),_0x17efdd=getConfigFilePath(_0x5b6e78);!existsSync(_0x5e6593)&&mkdirSync(_0x5e6593,{'recursive':!![],'mode':0x1c0});let _0x30c510={};if(existsSync(_0x17efdd))try{const _0x383d6c=readFileSync(_0x17efdd,_0x563ff0(0x167));_0x30c510=parseEnvFile(_0x383d6c);}catch(_0xe95289){console[_0x563ff0(0x18c)](_0x563ff0(0x16f)+_0x17efdd+':',_0xe95289);}const _0x15a376=_0xf2a6c2[_0x563ff0(0x191)]()[_0x563ff0(0x19d)](/-/g,'_');_0x30c510[_0x563ff0(0x18a)+_0x15a376]=_0x4a05d4;const _0x35d762=Object[_0x563ff0(0x18d)](_0x30c510)[_0x563ff0(0x17e)](([_0xd74214,_0x2e1725])=>_0xd74214+'='+_0x2e1725);writeFileSync(_0x17efdd,_0x35d762['join']('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x47a14f,_0x55d434,_0x5a7826){const _0x4aa043=a35_0x1449;await saveKeychainAPIKey(_0x47a14f,_0x5a7826),setCachedCredential(_0x47a14f,_0x55d434,_0x5a7826);const _0x2ec649=getConfigFilePath(_0x5a7826);cleanupLegacyEnvFile(_0x2ec649)&&console['warn'](a35_0x171a70['yellow'](_0x4aa043(0x17a)));}export function loadConfig(){const _0x41ddb7=a35_0x1449,_0x2e30cc={'apiKeys':{},'defaultSite':_0x41ddb7(0x169)},_0x1dfef4=[_0x41ddb7(0x169),_0x41ddb7(0x176),'eu01',_0x41ddb7(0x170),_0x41ddb7(0x172),_0x41ddb7(0x16e),_0x41ddb7(0x18b),'stg-us01','stg-jp01',_0x41ddb7(0x168)];for(const _0x5413db of _0x1dfef4){const _0x47796b=getAPIKey(_0x5413db);_0x47796b&&(_0x2e30cc[_0x41ddb7(0x182)][_0x5413db]=_0x47796b);}return _0x2e30cc;}
1
+ (function(_0x5bf511,_0x1c94b4){const _0x1b7cfd=a37_0x51c2,_0x4fb9c6=_0x5bf511();while(!![]){try{const _0x3f1b2a=-parseInt(_0x1b7cfd(0x196))/0x1+parseInt(_0x1b7cfd(0x1a9))/0x2*(-parseInt(_0x1b7cfd(0x1b5))/0x3)+-parseInt(_0x1b7cfd(0x182))/0x4+parseInt(_0x1b7cfd(0x19a))/0x5*(parseInt(_0x1b7cfd(0x1bf))/0x6)+-parseInt(_0x1b7cfd(0x189))/0x7+parseInt(_0x1b7cfd(0x180))/0x8*(-parseInt(_0x1b7cfd(0x1b8))/0x9)+-parseInt(_0x1b7cfd(0x193))/0xa*(-parseInt(_0x1b7cfd(0x17f))/0xb);if(_0x3f1b2a===_0x1c94b4)break;else _0x4fb9c6['push'](_0x4fb9c6['shift']());}catch(_0x5ede4b){_0x4fb9c6['push'](_0x4fb9c6['shift']());}}}(a37_0x2054,0x663ea));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a37_0x29b120 from'node:fs';import*as a37_0x39bd82 from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';function a37_0x2054(){const _0x9d757e=['match','filter','.env.','stg-ap03','profiles','193056xOoHIP','Warning:\x20Unknown\x20site\x20\x27','.config','297SAshbh','tdx.json','TDX_CONFIG_DIR','profile:\x20','jp01','.env','error','158628dovZqh','join','4191MuHtHm','127304cUCCdY','stg-jp01','2694672gzCeHQ','ap02','warn','stg-us01','Warning:\x20Failed\x20to\x20load\x20','env:\x20TD_API_KEY','TD_API_KEY','1091958HOLAVW','slice','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','yellow','entries','dev-us01','readFileSync','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','replace','\x20(TD_API_KEY)','59890MyMrga','us01','endsWith','555578Lwvlxw','existsSync','split','llm_default_project','155ItFhCw','Warning:\x20Failed\x20to\x20read\x20','some','tdx','eu01','env','utf-8','Warning:\x20Failed\x20to\x20cache\x20LLM\x20project\x20name:','startsWith','trim','TD_API_KEY_','parse','TDX_CACHE_DIR','ap03','.cache','24oZDlYo','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','includes','dev-eu01','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','global:\x20','toUpperCase'];a37_0x2054=function(){return _0x9d757e;};return a37_0x2054();}import a37_0x513692 from'chalk';export function getConfigDir(){const _0x22a6fa=a37_0x51c2;return process[_0x22a6fa(0x19f)][_0x22a6fa(0x1ba)]||join(homedir(),_0x22a6fa(0x1b7),'tdx');}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getConfigFilePath(_0x18ede6){const _0x3fc16b=a37_0x51c2,_0x30fa10=getConfigDir();return _0x18ede6?a37_0x39bd82[_0x3fc16b(0x1c0)](_0x30fa10,_0x3fc16b(0x1b2)+_0x18ede6):getConfigFile();}export function getCacheDir(){const _0x1c296f=a37_0x51c2;return process['env'][_0x1c296f(0x1a6)]||join(homedir(),_0x1c296f(0x1a8),_0x1c296f(0x19d));}export function getLLMProjectCacheFile(){const _0x1130db=a37_0x51c2;return join(getCacheDir(),_0x1130db(0x199));}export function readCachedLLMProject(){const _0x30b7a8=a37_0x51c2;try{const _0x2dad85=getLLMProjectCacheFile();if(!existsSync(_0x2dad85))return null;return readFileSync(_0x2dad85,'utf-8')[_0x30b7a8(0x1a3)]();}catch{return null;}}export function writeCachedLLMProject(_0x58fbb1){const _0x3a987a=a37_0x51c2;try{const _0x23bcdb=getCacheDir(),_0x2143b4=getLLMProjectCacheFile();!existsSync(_0x23bcdb)&&mkdirSync(_0x23bcdb,{'recursive':!![]}),writeFileSync(_0x2143b4,_0x58fbb1,'utf-8');}catch(_0x378475){console[_0x3a987a(0x1be)](_0x3a987a(0x1a1),_0x378475);}}export function parseEnvFile(_0x4a1b6d){const _0x532da5=a37_0x51c2,_0x2164ed={};for(const _0x3a9753 of _0x4a1b6d[_0x532da5(0x198)]('\x0a')){const _0xac9944=_0x3a9753[_0x532da5(0x1a3)]();if(!_0xac9944||_0xac9944['startsWith']('#'))continue;const _0xd8e080=_0xac9944[_0x532da5(0x1b0)](/^([^=]+)=(.*)$/);if(_0xd8e080){const _0x220392=_0xd8e080[0x1]['trim']();let _0x430f3f=_0xd8e080[0x2][_0x532da5(0x1a3)]();(_0x430f3f[_0x532da5(0x1a2)]('\x22')&&_0x430f3f[_0x532da5(0x195)]('\x22')||_0x430f3f['startsWith']('\x27')&&_0x430f3f['endsWith']('\x27'))&&(_0x430f3f=_0x430f3f[_0x532da5(0x18a)](0x1,-0x1)),_0x2164ed[_0x220392]=_0x430f3f;}}return _0x2164ed;}export function readUserConfig(){const _0x313f7d=a37_0x51c2,_0xccff9=getConfigFile();if(!existsSync(_0xccff9))return{};try{const _0x38a17b=readFileSync(_0xccff9,_0x313f7d(0x1a0));return parseEnvFile(_0x38a17b);}catch(_0x589649){return console[_0x313f7d(0x184)](_0x313f7d(0x1aa)+_0xccff9+':',_0x589649),{};}}export function resolveSite(_0xbf1ea9){const _0xa40daf=a37_0x51c2,_0x192c06=[_0xa40daf(0x194),'jp01',_0xa40daf(0x19e),_0xa40daf(0x183),_0xa40daf(0x1a7),_0xa40daf(0x18e),'dev-eu01',_0xa40daf(0x185),_0xa40daf(0x181),'stg-ap03'];if(_0x192c06[_0xa40daf(0x1ab)](_0xbf1ea9))return _0xbf1ea9;if(_0xbf1ea9 in SITE_ALIASES)return SITE_ALIASES[_0xbf1ea9];return console[_0xa40daf(0x184)](_0xa40daf(0x1b6)+_0xbf1ea9+'\x27,\x20defaulting\x20to\x20us01'),'us01';}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x579364,_0x501d9b){const _0x576564=a37_0x51c2,_0x195398=_0x579364[_0x576564(0x1af)]()[_0x576564(0x191)](/-/g,'_'),_0x29ca54=_0x576564(0x1a4)+_0x195398;if(process[_0x576564(0x19f)][_0x29ca54])return process['env'][_0x29ca54];if(process[_0x576564(0x19f)][_0x576564(0x188)])return process[_0x576564(0x19f)][_0x576564(0x188)];const _0x4fc1a8=_0x501d9b||getActiveProfileName();if(_0x4fc1a8){const _0x44761a=loadProfileEnv(_0x4fc1a8);if(_0x44761a){if(_0x44761a[_0x29ca54])return _0x44761a[_0x29ca54];if(_0x44761a[_0x576564(0x188)])return _0x44761a[_0x576564(0x188)];}}const _0x68f00c=loadUserConfigOnce();if(_0x68f00c[_0x29ca54])return _0x68f00c[_0x29ca54];if(_0x68f00c['TD_API_KEY'])return _0x68f00c['TD_API_KEY'];return undefined;}export async function getAPIKeyAsync(_0x54658b,_0x5e963e){const _0x276158=a37_0x51c2,_0x68f8c9=_0x54658b[_0x276158(0x1af)]()[_0x276158(0x191)](/-/g,'_'),_0x1518ee=_0x276158(0x1a4)+_0x68f8c9;if(process[_0x276158(0x19f)][_0x1518ee])return process[_0x276158(0x19f)][_0x1518ee];if(process['env']['TD_API_KEY'])return process[_0x276158(0x19f)][_0x276158(0x188)];const _0x198ee7=_0x5e963e||getActiveProfileName()||undefined,_0x5a8953=getCachedCredential(_0x54658b,_0x198ee7);if(_0x5a8953)return _0x5a8953;const _0x2bd551=await getKeychainAPIKey(_0x198ee7);if(_0x2bd551)return setCachedCredential(_0x2bd551,_0x54658b,_0x198ee7),_0x2bd551;const _0x5ece44=getLegacyEnvAPIKey(_0x54658b,_0x198ee7);if(_0x5ece44){const _0x268bf7=await isKeychainAvailable();if(_0x268bf7)try{await saveKeychainAPIKey(_0x5ece44,_0x198ee7),setCachedCredential(_0x5ece44,_0x54658b,_0x198ee7);const _0x5d6e5a=getConfigFilePath(_0x198ee7);cleanupLegacyEnvFile(_0x5d6e5a)&&console[_0x276158(0x184)](a37_0x513692[_0x276158(0x18c)](_0x276158(0x18b)));}catch(_0x406298){console[_0x276158(0x184)](a37_0x513692[_0x276158(0x18c)](_0x276158(0x190)+_0x406298));}return _0x5ece44;}return undefined;}function getLegacyEnvAPIKey(_0x1d94f0,_0x5b4d37){const _0x28ec5d=a37_0x51c2,_0xd21e2a=_0x1d94f0[_0x28ec5d(0x1af)]()[_0x28ec5d(0x191)](/-/g,'_'),_0x59e6ee=_0x28ec5d(0x1a4)+_0xd21e2a;if(_0x5b4d37){const _0x55a85a=loadProfileEnv(_0x5b4d37);if(_0x55a85a){if(_0x55a85a[_0x59e6ee])return _0x55a85a[_0x59e6ee];if(_0x55a85a[_0x28ec5d(0x188)])return _0x55a85a[_0x28ec5d(0x188)];}}const _0x6c1fc5=loadUserConfigOnce();if(_0x6c1fc5[_0x59e6ee])return _0x6c1fc5[_0x59e6ee];if(_0x6c1fc5[_0x28ec5d(0x188)])return _0x6c1fc5[_0x28ec5d(0x188)];return undefined;}function cleanupLegacyEnvFile(_0x24730d){const _0x24894b=a37_0x51c2;if(!existsSync(_0x24730d))return![];try{const _0x330f67=readFileSync(_0x24730d,_0x24894b(0x1a0)),_0x381392=_0x330f67[_0x24894b(0x198)]('\x0a'),_0x474d03=_0x381392[_0x24894b(0x1b1)](_0x1be98f=>{const _0x5c90a9=_0x24894b,_0x4cdd94=_0x1be98f[_0x5c90a9(0x1a3)]();if(!_0x4cdd94||_0x4cdd94[_0x5c90a9(0x1a2)]('#'))return!![];const [_0x5deb59]=_0x4cdd94['split']('=');return!_0x5deb59['startsWith'](_0x5c90a9(0x188));}),_0x370bdc=_0x474d03[_0x24894b(0x19c)](_0x31e9d4=>{const _0x57e48a=_0x24894b,_0x555be7=_0x31e9d4[_0x57e48a(0x1a3)]();return _0x555be7&&!_0x555be7[_0x57e48a(0x1a2)]('#');});if(!_0x370bdc)return unlinkSync(_0x24730d),!![];return writeFileSync(_0x24730d,_0x474d03[_0x24894b(0x1c0)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}export function getAPIKeySource(_0x183e7a,_0x5ec9b8){const _0x4e1973=a37_0x51c2,_0x5f5b0e=_0x4e1973(0x1a4)+_0x183e7a[_0x4e1973(0x1af)]()[_0x4e1973(0x191)](/-/g,'_');if(process[_0x4e1973(0x19f)][_0x5f5b0e])return'env:\x20'+_0x5f5b0e;if(process[_0x4e1973(0x19f)][_0x4e1973(0x188)])return _0x4e1973(0x187);const _0x15e2c0=_0x5ec9b8||getActiveProfileName();if(_0x15e2c0){const _0x36fe2b=loadProfileEnv(_0x15e2c0);if(_0x36fe2b){if(_0x36fe2b[_0x5f5b0e])return _0x4e1973(0x1bb)+_0x15e2c0+'\x20('+_0x5f5b0e+')';if(_0x36fe2b[_0x4e1973(0x188)])return _0x4e1973(0x1bb)+_0x15e2c0+_0x4e1973(0x192);}}const _0x30cfd7=loadUserConfigOnce(),_0xb72b9d=getConfigFile();if(_0x30cfd7[_0x5f5b0e])return _0x4e1973(0x1ae)+_0xb72b9d+'\x20('+_0x5f5b0e+')';if(_0x30cfd7[_0x4e1973(0x188)])return _0x4e1973(0x1ae)+_0xb72b9d+_0x4e1973(0x192);return null;}function loadProfileEnv(_0x1d7e81){const _0x10d7c9=a37_0x51c2,_0x43562c=a37_0x39bd82['join'](getConfigDir(),'.env.'+_0x1d7e81);if(a37_0x29b120[_0x10d7c9(0x197)](_0x43562c)){validateSecureFilePermissions(_0x43562c);try{const _0x5ae5ac=a37_0x29b120['readFileSync'](_0x43562c,_0x10d7c9(0x1a0));return parseEnvFile(_0x5ae5ac);}catch(_0x3342bd){console['warn'](_0x10d7c9(0x186)+_0x43562c+':\x20'+_0x3342bd);}}const _0x46dace=a37_0x39bd82['join'](getConfigDir(),_0x10d7c9(0x1b4),_0x1d7e81,_0x10d7c9(0x1bd));if(a37_0x29b120['existsSync'](_0x46dace)){validateSecureFilePermissions(_0x46dace);try{const _0x3510ae=a37_0x29b120[_0x10d7c9(0x18f)](_0x46dace,_0x10d7c9(0x1a0));return parseEnvFile(_0x3510ae);}catch(_0x2abdce){return console[_0x10d7c9(0x184)](_0x10d7c9(0x186)+_0x46dace+':\x20'+_0x2abdce),null;}}return null;}function a37_0x51c2(_0x50cacc,_0x147d64){const _0x205443=a37_0x2054();return a37_0x51c2=function(_0x51c2d8,_0x492418){_0x51c2d8=_0x51c2d8-0x17f;let _0x3cb4d3=_0x205443[_0x51c2d8];return _0x3cb4d3;},a37_0x51c2(_0x50cacc,_0x147d64);}function getActiveProfileName(){const _0x292bfc=a37_0x51c2,_0x5f4259=a37_0x39bd82[_0x292bfc(0x1c0)](getConfigDir(),_0x292bfc(0x1b9));if(!a37_0x29b120['existsSync'](_0x5f4259))return null;try{const _0x280cc8=a37_0x29b120[_0x292bfc(0x18f)](_0x5f4259,_0x292bfc(0x1a0)),_0x51a846=JSON[_0x292bfc(0x1a5)](_0x280cc8);return _0x51a846['profile']||null;}catch{return null;}}export function saveAPIKey(_0x4a5d60,_0x13fba6,_0x5a803f){const _0xb1ecac=a37_0x51c2,_0x40e822=getConfigDir(),_0x2a0f14=getConfigFilePath(_0x5a803f);!existsSync(_0x40e822)&&mkdirSync(_0x40e822,{'recursive':!![],'mode':0x1c0});let _0x253a40={};if(existsSync(_0x2a0f14))try{const _0x590b56=readFileSync(_0x2a0f14,_0xb1ecac(0x1a0));_0x253a40=parseEnvFile(_0x590b56);}catch(_0xad335c){console['warn'](_0xb1ecac(0x19b)+_0x2a0f14+':',_0xad335c);}const _0x39fdfe=_0x4a5d60['toUpperCase']()[_0xb1ecac(0x191)](/-/g,'_');_0x253a40[_0xb1ecac(0x1a4)+_0x39fdfe]=_0x13fba6;const _0x586e18=Object[_0xb1ecac(0x18d)](_0x253a40)['map'](([_0x4df722,_0x54c205])=>_0x4df722+'='+_0x54c205);writeFileSync(_0x2a0f14,_0x586e18['join']('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x445e1b,_0x5bc4d3,_0x25c645){const _0x4b728d=a37_0x51c2;await saveKeychainAPIKey(_0x445e1b,_0x25c645),setCachedCredential(_0x445e1b,_0x5bc4d3,_0x25c645);const _0x3d3a77=getConfigFilePath(_0x25c645);cleanupLegacyEnvFile(_0x3d3a77)&&console['warn'](a37_0x513692['yellow'](_0x4b728d(0x1ad)));}export function loadConfig(){const _0x48bb45=a37_0x51c2,_0x571b8f={'apiKeys':{},'defaultSite':'us01'},_0x26944c=[_0x48bb45(0x194),_0x48bb45(0x1bc),'eu01',_0x48bb45(0x183),_0x48bb45(0x1a7),_0x48bb45(0x18e),_0x48bb45(0x1ac),_0x48bb45(0x185),_0x48bb45(0x181),_0x48bb45(0x1b3)];for(const _0x3a7efe of _0x26944c){const _0x46c3ef=getAPIKey(_0x3a7efe);_0x46c3ef&&(_0x571b8f['apiKeys'][_0x3a7efe]=_0x46c3ef);}return _0x571b8f;}
@@ -1 +1 @@
1
- (function(_0x5a084c,_0x5b0320){const _0x32ef8d=a36_0x2ed8,_0x535c86=_0x5a084c();while(!![]){try{const _0x1fe22a=parseInt(_0x32ef8d(0x14a))/0x1+parseInt(_0x32ef8d(0x155))/0x2+-parseInt(_0x32ef8d(0x152))/0x3+-parseInt(_0x32ef8d(0x151))/0x4+parseInt(_0x32ef8d(0x153))/0x5+-parseInt(_0x32ef8d(0x14d))/0x6*(-parseInt(_0x32ef8d(0x148))/0x7)+-parseInt(_0x32ef8d(0x14b))/0x8*(parseInt(_0x32ef8d(0x14c))/0x9);if(_0x1fe22a===_0x5b0320)break;else _0x535c86['push'](_0x535c86['shift']());}catch(_0x283370){_0x535c86['push'](_0x535c86['shift']());}}}(a36_0x2732,0x3c85f));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x590ac3,_0x1e47a4){const _0x291e99=a36_0x2ed8,_0x1e9eb9=_0x590ac3||_0x291e99(0x150),_0x1c4aff=_0x1e47a4||_0x291e99(0x14e);return _0x1e9eb9+':'+_0x1c4aff;}function a36_0x2732(){const _0xe01dab=['334708Qndnwg','1148187OrFCJo','1080980NFMLfv','loadedAt','915398KDLnbd','1827mlVFXg','clear','126988HNQrle','1573728WnlAts','9RgyzuY','2532QkPuKU','__default_profile__','get','__default_site__'];a36_0x2732=function(){return _0xe01dab;};return a36_0x2732();}export function getCachedCredential(_0x5cd11d,_0x155a5d){const _0x2243ff=a36_0x2ed8,_0x26f7a1=getCacheKey(_0x5cd11d,_0x155a5d),_0xb97da5=cache[_0x2243ff(0x14f)](_0x26f7a1);if(!_0xb97da5)return null;if(Date['now']()-_0xb97da5[_0x2243ff(0x154)]>CACHE_TTL_MS)return cache['delete'](_0x26f7a1),null;return _0xb97da5['apiKey'];}export function setCachedCredential(_0x2ef53f,_0x2c12d2,_0x34c6d6){const _0x4176ff=getCacheKey(_0x2c12d2,_0x34c6d6);cache['set'](_0x4176ff,{'apiKey':_0x2ef53f,'loadedAt':Date['now']()});}function a36_0x2ed8(_0x296f70,_0x2be0d1){const _0x2732a9=a36_0x2732();return a36_0x2ed8=function(_0x2ed859,_0x27684b){_0x2ed859=_0x2ed859-0x148;let _0x4c94a7=_0x2732a9[_0x2ed859];return _0x4c94a7;},a36_0x2ed8(_0x296f70,_0x2be0d1);}export function clearCredentialCache(){const _0x59de4f=a36_0x2ed8;cache[_0x59de4f(0x149)]();}export function clearCachedCredential(_0xb47d3c,_0xe4d209){const _0x236ee3=getCacheKey(_0xb47d3c,_0xe4d209);cache['delete'](_0x236ee3);}
1
+ (function(_0x584b63,_0x43e8a9){const _0x2fda41=a38_0xa39d,_0x1a4c62=_0x584b63();while(!![]){try{const _0x58b75d=-parseInt(_0x2fda41(0x1aa))/0x1+-parseInt(_0x2fda41(0x1af))/0x2+-parseInt(_0x2fda41(0x1ab))/0x3+parseInt(_0x2fda41(0x1ac))/0x4+parseInt(_0x2fda41(0x1b1))/0x5*(parseInt(_0x2fda41(0x1ae))/0x6)+-parseInt(_0x2fda41(0x1ad))/0x7+parseInt(_0x2fda41(0x1b6))/0x8;if(_0x58b75d===_0x43e8a9)break;else _0x1a4c62['push'](_0x1a4c62['shift']());}catch(_0x137f2e){_0x1a4c62['push'](_0x1a4c62['shift']());}}}(a38_0x1d46,0xcc695));function a38_0x1d46(){const _0x4ffd9b=['1570688WDqwTs','1554mPBzwH','1224534JLLgRM','apiKey','10025NLXaHA','delete','now','set','__default_site__','8891296zxoDnW','450547TLAfHl','1433193eFNHUF','3885964mUiUvB'];a38_0x1d46=function(){return _0x4ffd9b;};return a38_0x1d46();}function a38_0xa39d(_0xd79138,_0x4f734e){const _0x1d4612=a38_0x1d46();return a38_0xa39d=function(_0xa39d12,_0x84edee){_0xa39d12=_0xa39d12-0x1aa;let _0x34ec02=_0x1d4612[_0xa39d12];return _0x34ec02;},a38_0xa39d(_0xd79138,_0x4f734e);}const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x22a245,_0x44535f){const _0x5a1b48=a38_0xa39d,_0x4885bc=_0x22a245||_0x5a1b48(0x1b5),_0x1a19ac=_0x44535f||'__default_profile__';return _0x4885bc+':'+_0x1a19ac;}export function getCachedCredential(_0x80d98b,_0x13229d){const _0x472c70=a38_0xa39d,_0x1a7bcb=getCacheKey(_0x80d98b,_0x13229d),_0x34e161=cache['get'](_0x1a7bcb);if(!_0x34e161)return null;if(Date[_0x472c70(0x1b3)]()-_0x34e161['loadedAt']>CACHE_TTL_MS)return cache['delete'](_0x1a7bcb),null;return _0x34e161[_0x472c70(0x1b0)];}export function setCachedCredential(_0x59b399,_0x2f27ef,_0x760fb3){const _0x588ac8=a38_0xa39d,_0x4ff758=getCacheKey(_0x2f27ef,_0x760fb3);cache[_0x588ac8(0x1b4)](_0x4ff758,{'apiKey':_0x59b399,'loadedAt':Date['now']()});}export function clearCredentialCache(){cache['clear']();}export function clearCachedCredential(_0x50119a,_0x268d19){const _0x27a941=a38_0xa39d,_0x4a91f2=getCacheKey(_0x50119a,_0x268d19);cache[_0x27a941(0x1b2)](_0x4a91f2);}