@treasuredata/tdx 0.1.15 → 0.1.17

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 (85) hide show
  1. package/README.md +10 -0
  2. package/dist/cli.js +1 -1
  3. package/dist/cli.js.map +1 -1
  4. package/dist/client/cdp-client.js +1 -1
  5. package/dist/client/http-client.js +1 -1
  6. package/dist/client/llm-client.js +1 -1
  7. package/dist/client/rate-limiter.js +1 -1
  8. package/dist/client/td-client.js +1 -1
  9. package/dist/client/trino-client.js +1 -1
  10. package/dist/client/workflow-client.js +1 -1
  11. package/dist/commands/activations.js +1 -1
  12. package/dist/commands/api-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-command.js.map +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/context-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/job-command.js +1 -1
  21. package/dist/commands/llm-command.js +1 -1
  22. package/dist/commands/llm-proxy.js +1 -1
  23. package/dist/commands/parent-segment-command.js +1 -1
  24. package/dist/commands/profiles-command.js +1 -1
  25. package/dist/commands/query-command.js +1 -1
  26. package/dist/commands/segment-command.js +1 -1
  27. package/dist/commands/segment-create-command.js +1 -1
  28. package/dist/commands/segment-fields-command.js +1 -1
  29. package/dist/commands/segment-pwd-command.js +1 -1
  30. package/dist/commands/segment-update-command.js +1 -1
  31. package/dist/commands/segment-use-command.js +1 -1
  32. package/dist/commands/segments.js +1 -1
  33. package/dist/commands/show.js +1 -1
  34. package/dist/commands/tables.js +1 -1
  35. package/dist/commands/use-command.js +1 -1
  36. package/dist/commands/workflow-command.js +1 -1
  37. package/dist/core/auth.js +1 -1
  38. package/dist/core/config.js +1 -1
  39. package/dist/core/global-context.js +1 -1
  40. package/dist/core/profile.js +1 -1
  41. package/dist/core/project-config.js +1 -1
  42. package/dist/core/session.js +1 -1
  43. package/dist/index.js +1 -1
  44. package/dist/proxy/anthropic-adapter.d.ts +21 -2
  45. package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
  46. package/dist/proxy/anthropic-adapter.js +1 -1
  47. package/dist/proxy/anthropic-adapter.js.map +1 -1
  48. package/dist/proxy/server.d.ts.map +1 -1
  49. package/dist/proxy/server.js +1 -1
  50. package/dist/proxy/server.js.map +1 -1
  51. package/dist/sdk/api.js +1 -1
  52. package/dist/sdk/database.js +1 -1
  53. package/dist/sdk/errors.js +1 -1
  54. package/dist/sdk/index.js +1 -1
  55. package/dist/sdk/job.js +1 -1
  56. package/dist/sdk/llm.js +1 -1
  57. package/dist/sdk/query.js +1 -1
  58. package/dist/sdk/segment.js +1 -1
  59. package/dist/sdk/table.js +1 -1
  60. package/dist/sdk/workflow.js +1 -1
  61. package/dist/types/endpoints.js +1 -1
  62. package/dist/types/index.js +1 -1
  63. package/dist/utils/agent-ref-parser.js +1 -1
  64. package/dist/utils/chat-cache.js +1 -1
  65. package/dist/utils/colors.js +1 -1
  66. package/dist/utils/command-output.js +1 -1
  67. package/dist/utils/file-permissions.js +1 -1
  68. package/dist/utils/format-detector.js +1 -1
  69. package/dist/utils/formatters.js +1 -1
  70. package/dist/utils/json-loader.js +1 -1
  71. package/dist/utils/model-aliases.js +1 -1
  72. package/dist/utils/option-validation.js +1 -1
  73. package/dist/utils/port.js +1 -1
  74. package/dist/utils/process.js +1 -1
  75. package/dist/utils/prompt.js +1 -1
  76. package/dist/utils/segment-path-parser.js +1 -1
  77. package/dist/utils/segment-ref-parser.js +1 -1
  78. package/dist/utils/spinner.js +1 -1
  79. package/dist/utils/sql-parser.js +1 -1
  80. package/dist/utils/sse-parser.js +1 -1
  81. package/dist/utils/string-utils.js +1 -1
  82. package/dist/utils/table-ref-parser.js +1 -1
  83. package/dist/utils/tree-formatter.js +1 -1
  84. package/dist/utils/workflow-utils.js +1 -1
  85. package/package.json +1 -1
@@ -1 +1 @@
1
- const a22_0x567610=a22_0x2e85;(function(_0x118e7c,_0x3acafd){const _0x28cb16=a22_0x2e85,_0x58dfe6=_0x118e7c();while(!![]){try{const _0x576002=parseInt(_0x28cb16(0x1be))/0x1*(-parseInt(_0x28cb16(0x1d9))/0x2)+-parseInt(_0x28cb16(0x1f4))/0x3+-parseInt(_0x28cb16(0x1e0))/0x4*(parseInt(_0x28cb16(0x1c4))/0x5)+parseInt(_0x28cb16(0x1f5))/0x6*(-parseInt(_0x28cb16(0x1c3))/0x7)+-parseInt(_0x28cb16(0x214))/0x8+-parseInt(_0x28cb16(0x1b8))/0x9*(-parseInt(_0x28cb16(0x1d6))/0xa)+-parseInt(_0x28cb16(0x1cc))/0xb*(-parseInt(_0x28cb16(0x1c9))/0xc);if(_0x576002===_0x3acafd)break;else _0x58dfe6['push'](_0x58dfe6['shift']());}catch(_0x3505a0){_0x58dfe6['push'](_0x58dfe6['shift']());}}}(a22_0x13c4,0xcdbf4));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';export class SegmentDescribeCommand extends BaseCommand{[a22_0x567610(0x209)]=a22_0x567610(0x1db);[a22_0x567610(0x1e5)]=a22_0x567610(0x1cf);async[a22_0x567610(0x20f)](_0x43b15d){const _0x7ad628=a22_0x567610,{options:_0x4f8367,args:_0x5d266a,tdx:_0x21c4d6}=_0x43b15d;if(_0x5d266a['length']===0x0)return console[_0x7ad628(0x1c7)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x7ad628(0x1c7)](_0x7ad628(0x212)),console[_0x7ad628(0x1c7)](_0x7ad628(0x1ba)),console[_0x7ad628(0x1c7)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x7ad628(0x1c7)](_0x7ad628(0x202)),console[_0x7ad628(0x1c7)](_0x7ad628(0x1e3)),0x1;try{const _0x56c1d7=_0x5d266a[0x0],_0x2b187c=_0x4f8367['segmentPath'];let _0x457ed4=_0x56c1d7;_0x2b187c&&!_0x56c1d7[_0x7ad628(0x20a)]('/')&&(_0x457ed4=_0x2b187c+'/'+_0x56c1d7,_0x4f8367[_0x7ad628(0x213)]&&console['error'](_0x7ad628(0x1af)+_0x457ed4));const _0x1bc5f0=await withSpinner('Resolving\x20path\x20\x27'+_0x457ed4+_0x7ad628(0x21d),()=>_0x21c4d6[_0x7ad628(0x1f0)]['resolvePathToResource'](_0x457ed4),{'verbose':_0x4f8367['verbose']}),_0x14f95d=_0x1bc5f0['data'];_0x4f8367[_0x7ad628(0x213)]&&(console[_0x7ad628(0x1c7)]('Resolved\x20type:\x20'+_0x14f95d[_0x7ad628(0x1b3)]),console['error'](_0x7ad628(0x1c6)+_0x14f95d['parentId']),_0x14f95d[_0x7ad628(0x1ac)]&&console[_0x7ad628(0x1c7)](_0x7ad628(0x1c8)+_0x14f95d[_0x7ad628(0x1ac)]),_0x14f95d['segmentId']&&console[_0x7ad628(0x1c7)](_0x7ad628(0x1c1)+_0x14f95d[_0x7ad628(0x203)]));if(_0x14f95d[_0x7ad628(0x1b3)]==='parent'){const _0x22f3c7=await withSpinner(_0x7ad628(0x208),()=>_0x21c4d6[_0x7ad628(0x1f0)][_0x7ad628(0x1b1)](_0x14f95d[_0x7ad628(0x210)]),{'verbose':_0x4f8367['verbose']});await handleSDKOutput([_0x22f3c7[_0x7ad628(0x1cd)]],_0x4f8367);}else{if(_0x14f95d[_0x7ad628(0x1b3)]===_0x7ad628(0x1ff)){if(!_0x14f95d[_0x7ad628(0x1ac)])throw new SDKError(ErrorCode['INTERNAL'],_0x7ad628(0x1c5));const _0x519e82=await withSpinner(_0x7ad628(0x205),()=>_0x21c4d6[_0x7ad628(0x1f0)][_0x7ad628(0x1ec)](_0x14f95d[_0x7ad628(0x1ac)]),{'verbose':_0x4f8367[_0x7ad628(0x213)]});await handleSDKOutput([_0x519e82['data']],_0x4f8367);}else{if(_0x14f95d['type']===_0x7ad628(0x1f0)){if(!_0x14f95d[_0x7ad628(0x203)])throw new SDKError(ErrorCode[_0x7ad628(0x20c)],_0x7ad628(0x1f3));const _0x498158=await withSpinner('Fetching\x20segment\x20details...',()=>_0x21c4d6[_0x7ad628(0x1f0)][_0x7ad628(0x1ed)](_0x14f95d[_0x7ad628(0x210)],_0x14f95d[_0x7ad628(0x203)]),{'verbose':_0x4f8367[_0x7ad628(0x213)]});await handleSDKOutput([_0x498158[_0x7ad628(0x1cd)]],_0x4f8367);}}}return 0x0;}catch(_0x504582){if(_0x504582 instanceof SDKError)return console['error']('Error:\x20'+_0x504582[_0x7ad628(0x1d5)]),_0x504582[_0x7ad628(0x1f1)]&&console[_0x7ad628(0x1c7)](_0x7ad628(0x1b2)+_0x504582[_0x7ad628(0x1f1)]),0x1;throw _0x504582;}}}function a22_0x2e85(_0x2ccf5f,_0x1dab90){const _0x13c429=a22_0x13c4();return a22_0x2e85=function(_0x2e858c,_0x452781){_0x2e858c=_0x2e858c-0x1ab;let _0xd918c9=_0x13c429[_0x2e858c];return _0xd918c9;},a22_0x2e85(_0x2ccf5f,_0x1dab90);}export class SegmentShowCommand extends BaseCommand{[a22_0x567610(0x209)]=a22_0x567610(0x1eb);['description']=a22_0x567610(0x1ee);async[a22_0x567610(0x20f)](_0x493b47){const _0x558cef=a22_0x567610,{options:_0x1cf9f5,args:_0x15c3db,tdx:_0x4d0f68}=_0x493b47;if(_0x15c3db[_0x558cef(0x200)]===0x0)return console[_0x558cef(0x1c7)](_0x558cef(0x1fa)),console[_0x558cef(0x1c7)](_0x558cef(0x215)),console[_0x558cef(0x1c7)]('Examples:'),console[_0x558cef(0x1c7)](_0x558cef(0x20b)),console[_0x558cef(0x1c7)](_0x558cef(0x204)),console[_0x558cef(0x1c7)]('\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x2789f9=_0x15c3db[0x0],_0x463b12=_0x1cf9f5[_0x558cef(0x1d4)];let _0x38f95e=_0x2789f9;_0x463b12&&!_0x2789f9[_0x558cef(0x20a)]('/')&&(_0x38f95e=_0x463b12+'/'+_0x2789f9,_0x1cf9f5[_0x558cef(0x213)]&&console[_0x558cef(0x1c7)](_0x558cef(0x1af)+_0x38f95e));const _0x558a22=await withSpinner(_0x558cef(0x21c)+_0x38f95e+_0x558cef(0x21d),()=>_0x4d0f68[_0x558cef(0x1f0)][_0x558cef(0x1e6)](_0x38f95e),{'verbose':_0x1cf9f5[_0x558cef(0x213)]}),_0x4690be=_0x558a22[_0x558cef(0x1cd)];_0x1cf9f5[_0x558cef(0x213)]&&(console['error'](_0x558cef(0x1bf)+_0x4690be['type']),console['error'](_0x558cef(0x1c6)+_0x4690be['parentId']));if(_0x4690be[_0x558cef(0x1b3)]==='folder')return console[_0x558cef(0x1c7)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x558cef(0x1c7)]('Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;let _0x19ec7e;if(_0x4690be['type']===_0x558cef(0x219)){const _0x4adc51=await withSpinner(_0x558cef(0x1b5),()=>_0x4d0f68['segment'][_0x558cef(0x1b6)](_0x4690be[_0x558cef(0x210)]),{'verbose':_0x1cf9f5[_0x558cef(0x213)]});_0x19ec7e=_0x4adc51[_0x558cef(0x1cd)];}else{if(!_0x4690be[_0x558cef(0x203)])throw new SDKError(ErrorCode['INTERNAL'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3749b1=await withSpinner(_0x558cef(0x1fd),()=>_0x4d0f68['segment'][_0x558cef(0x1ab)](_0x4690be[_0x558cef(0x210)],_0x4690be['segmentId']),{'verbose':_0x1cf9f5[_0x558cef(0x213)]});_0x19ec7e=_0x3749b1['data'];}const _0x189776=_0x1cf9f5[_0x558cef(0x1b7)],_0x5cd37f=/\bLIMIT\s+\d+/i['test'](_0x19ec7e);!_0x5cd37f&&(_0x19ec7e=_0x19ec7e[_0x558cef(0x1ef)]()[_0x558cef(0x211)](/;+$/,''),_0x19ec7e='SELECT\x20*\x20FROM\x20(\x0a'+_0x19ec7e+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x189776);_0x1cf9f5['verbose']&&console['error']('SQL\x20query:\x0a'+_0x19ec7e);const _0x50f3d4=await withQuerySpinner(_0x558cef(0x1dc),async _0x48d37e=>{const _0xabc15c=_0x558cef,_0xd30914=await _0x4d0f68[_0xabc15c(0x1e4)](_0x19ec7e,{'catalog':'td','schema':'information_schema','onJobId':_0x3b4c59=>{const _0x2e4b7e=_0xabc15c;_0x48d37e[_0x2e4b7e(0x1ce)](_0x3b4c59);}});return _0xd30914;},{'verbose':_0x1cf9f5[_0x558cef(0x213)]}),_0x4b4571=_0x50f3d4[_0x558cef(0x1cd)],_0x2e30c8=_0x4b4571[_0x558cef(0x217)]?_0x558cef(0x201)+_0x4b4571[_0x558cef(0x217)]+']':'';return console['error'](_0x558cef(0x1d7)+_0x4b4571[_0x558cef(0x1c0)][_0x558cef(0x1f8)]['toLocaleString']()+'\x20rows\x20'+(_0x558cef(0x1bd)+formatElapsed(_0x4b4571[_0x558cef(0x1c0)][_0x558cef(0x1e1)])+_0x2e30c8)),await handleQueryOutput(_0x4b4571,_0x1cf9f5),0x0;}catch(_0x2aced3){if(_0x2aced3 instanceof SDKError)return console[_0x558cef(0x1c7)]('✖\x20Query\x20failed\x20['+_0x2aced3[_0x558cef(0x20d)]+']'),console[_0x558cef(0x1c7)]('\x0a'+_0x2aced3[_0x558cef(0x1d5)]),0x1;throw _0x2aced3;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a22_0x567610(0x1f6);[a22_0x567610(0x1e5)]=a22_0x567610(0x1ad);async[a22_0x567610(0x20f)](_0x4b33e9){const _0x48200d=a22_0x567610,{options:_0x27cf97,args:_0xa75120,tdx:_0x345d5f}=_0x4b33e9;if(_0xa75120[_0x48200d(0x200)]===0x0)return console['error'](_0x48200d(0x207)),console[_0x48200d(0x1c7)](_0x48200d(0x1dd)),0x1;const _0x5801a4=_0xa75120[0x0];try{_0x27cf97[_0x48200d(0x213)]&&(console[_0x48200d(0x1c7)](_0x48200d(0x1fe)+_0x27cf97['site']),console[_0x48200d(0x1c7)](_0x48200d(0x1c2)+_0x5801a4));const _0xda88c6=await withSpinner(_0x48200d(0x21b)+_0x5801a4+'\x27...',()=>_0x345d5f['segment'][_0x48200d(0x1f2)](_0x5801a4),{'verbose':_0x27cf97['verbose']}),_0x111189=_0xda88c6[_0x48200d(0x1cd)];_0x27cf97[_0x48200d(0x213)]&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x111189);const _0x1533ac=await withSpinner(_0x48200d(0x1b0)+_0x5801a4+_0x48200d(0x21d),()=>_0x345d5f[_0x48200d(0x1f0)]['listFolders'](_0x111189),{'verbose':_0x27cf97[_0x48200d(0x213)]}),_0x5c011c=_0x1533ac['data'];return console['error']('✔\x20Found\x20'+_0x5c011c[_0x48200d(0x200)]+'\x20folder'+(_0x5c011c[_0x48200d(0x200)]!==0x1?'s':'')),await handleSDKOutput(_0x5c011c,_0x27cf97),0x0;}catch(_0x513dad){if(_0x513dad instanceof SDKError)return console['error'](_0x48200d(0x1b4)+_0x513dad[_0x48200d(0x1d5)]),_0x513dad[_0x48200d(0x1f1)]&&console[_0x48200d(0x1c7)]('\x20\x20Cause:\x20'+_0x513dad[_0x48200d(0x1f1)]),0x1;throw _0x513dad;}}}export class SegmentFolderShowCommand extends BaseCommand{[a22_0x567610(0x209)]=a22_0x567610(0x1d3);[a22_0x567610(0x1e5)]=a22_0x567610(0x21a);async[a22_0x567610(0x20f)](_0x4bc5a6){const _0x37d538=a22_0x567610,{options:_0x37f4b6,args:_0xd99c53,tdx:_0x5070d1}=_0x4bc5a6;if(_0xd99c53[_0x37d538(0x200)]===0x0)return console['error']('Error:\x20Folder\x20reference\x20is\x20required'),console['error']('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x3671df,childId:_0x380c42}=parseSegmentRef(_0xd99c53[0x0]);_0x37f4b6[_0x37d538(0x213)]&&(console['error']('Site:\x20'+_0x37f4b6[_0x37d538(0x1e9)]),console[_0x37d538(0x1c7)](_0x37d538(0x1c2)+_0x3671df),_0x380c42&&console[_0x37d538(0x1c7)](_0x37d538(0x1e7)+_0x380c42));if(!_0x380c42)return console['error'](_0x37d538(0x1ca)),0x1;const _0x45c606=await withSpinner(_0x37d538(0x21b)+_0x3671df+_0x37d538(0x21d),()=>_0x5070d1['segment']['resolveParentId'](_0x3671df),{'verbose':_0x37f4b6[_0x37d538(0x213)]}),_0x49944c=_0x45c606[_0x37d538(0x1cd)];_0x37f4b6['verbose']&&console['error'](_0x37d538(0x1fb)+_0x49944c);const _0x2cc10a=await withSpinner(_0x37d538(0x1f7)+_0x380c42+_0x37d538(0x21d),()=>_0x5070d1['segment']['resolveFolderId'](_0x49944c,_0x380c42),{'verbose':_0x37f4b6[_0x37d538(0x213)]}),_0xd3f284=_0x2cc10a['data'];_0x37f4b6[_0x37d538(0x213)]&&console[_0x37d538(0x1c7)](_0x37d538(0x1ea)+_0xd3f284);const _0x5616c2=await withSpinner(_0x37d538(0x1d2)+_0x380c42+_0x37d538(0x21d),()=>_0x5070d1[_0x37d538(0x1f0)][_0x37d538(0x1ec)](_0xd3f284),{'verbose':_0x37f4b6[_0x37d538(0x213)]});return await handleSDKOutput([_0x5616c2['data']],_0x37f4b6),0x0;}catch(_0x3c9966){if(_0x3c9966 instanceof SDKError)return console[_0x37d538(0x1c7)](_0x37d538(0x1b4)+_0x3c9966[_0x37d538(0x1d5)]),_0x3c9966['cause']&&console[_0x37d538(0x1c7)](_0x37d538(0x1b2)+_0x3c9966[_0x37d538(0x1f1)]),0x1;throw _0x3c9966;}}}export class SegmentSQLCommand extends BaseCommand{[a22_0x567610(0x209)]=a22_0x567610(0x1e2);['description']=a22_0x567610(0x1d8);async[a22_0x567610(0x20f)](_0x2c6ff6){const _0x19f4bc=a22_0x567610,{options:_0x56ed01,args:_0x3455c4,tdx:_0x3178f8}=_0x2c6ff6;if(_0x3455c4['length']===0x0)return console['error'](_0x19f4bc(0x1fa)),console['error'](_0x19f4bc(0x218)),console[_0x19f4bc(0x1c7)](_0x19f4bc(0x1ba)),console['error']('\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22'),console[_0x19f4bc(0x1c7)](_0x19f4bc(0x1df)),console[_0x19f4bc(0x1c7)]('\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x2c113c=_0x3455c4[0x0],_0x38b764=_0x56ed01['segmentPath'];let _0x15140c=_0x2c113c;_0x38b764&&!_0x2c113c[_0x19f4bc(0x20a)]('/')&&(_0x15140c=_0x38b764+'/'+_0x2c113c,_0x56ed01[_0x19f4bc(0x213)]&&console[_0x19f4bc(0x1c7)](_0x19f4bc(0x1af)+_0x15140c));const _0x2d0012=await withSpinner(_0x19f4bc(0x21c)+_0x15140c+'\x27...',()=>_0x3178f8[_0x19f4bc(0x1f0)]['resolvePathToResource'](_0x15140c),{'verbose':_0x56ed01['verbose']}),_0x2ac932=_0x2d0012[_0x19f4bc(0x1cd)];_0x56ed01['verbose']&&(console[_0x19f4bc(0x1c7)]('Resolved\x20type:\x20'+_0x2ac932[_0x19f4bc(0x1b3)]),console['error'](_0x19f4bc(0x1c6)+_0x2ac932[_0x19f4bc(0x210)]));if(_0x2ac932[_0x19f4bc(0x1b3)]===_0x19f4bc(0x1ff))return console[_0x19f4bc(0x1c7)](_0x19f4bc(0x1e8)),console[_0x19f4bc(0x1c7)](_0x19f4bc(0x1d0)),0x1;let _0x4ee4fb;if(_0x2ac932[_0x19f4bc(0x1b3)]==='parent'){const _0x332a8a=await withSpinner(_0x19f4bc(0x1b5),()=>_0x3178f8[_0x19f4bc(0x1f0)][_0x19f4bc(0x1b6)](_0x2ac932[_0x19f4bc(0x210)]),{'verbose':_0x56ed01[_0x19f4bc(0x213)]});_0x4ee4fb=_0x332a8a[_0x19f4bc(0x1cd)];}else{if(!_0x2ac932[_0x19f4bc(0x203)])throw new SDKError(ErrorCode[_0x19f4bc(0x20c)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2659d=await withSpinner(_0x19f4bc(0x1fd),()=>_0x3178f8[_0x19f4bc(0x1f0)][_0x19f4bc(0x1ab)](_0x2ac932[_0x19f4bc(0x210)],_0x2ac932['segmentId']),{'verbose':_0x56ed01[_0x19f4bc(0x213)]});_0x4ee4fb=_0x2659d[_0x19f4bc(0x1cd)];}return _0x56ed01[_0x19f4bc(0x1d1)]==='json'||_0x56ed01['format']==='jsonl'?await handleSDKOutput([{'sql':_0x4ee4fb}],_0x56ed01):console['log'](_0x4ee4fb),0x0;}catch(_0x55625b){if(_0x55625b instanceof SDKError)return console[_0x19f4bc(0x1c7)](_0x19f4bc(0x1b4)+_0x55625b[_0x19f4bc(0x1d5)]),_0x55625b[_0x19f4bc(0x1f1)]&&console[_0x19f4bc(0x1c7)]('\x20\x20Cause:\x20'+_0x55625b[_0x19f4bc(0x1f1)]),0x1;throw _0x55625b;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a22_0x567610(0x209)]=a22_0x567610(0x1bc);['description']='Create\x20segment\x20folder\x20for\x20organization';async[a22_0x567610(0x20f)](_0x3d62c0){const _0x4aab36=a22_0x567610,{options:_0x30294a,args:_0x12f970,tdx:_0x11649b}=_0x3d62c0,_0x508011=_0x30294a;if(_0x12f970[_0x4aab36(0x200)]<0x2)return console[_0x4aab36(0x1c7)](_0x4aab36(0x1b9)),console['error'](_0x4aab36(0x1bb)),0x1;const _0x5350b6=_0x12f970[0x0],_0x1c6206=_0x12f970[0x1];_0x508011[_0x4aab36(0x213)]&&(console[_0x4aab36(0x1c7)](_0x4aab36(0x1fe)+_0x508011[_0x4aab36(0x1e9)]),console[_0x4aab36(0x1c7)](_0x4aab36(0x206)+_0x5350b6),console[_0x4aab36(0x1c7)]('Folder\x20name:\x20'+_0x1c6206));let _0x2f7051;if(_0x508011['parentFolder']){const _0x2dd3a6=_0x508011[_0x4aab36(0x20e)],_0x43f499=await withSpinner(_0x4aab36(0x21b)+_0x5350b6+'\x27...',()=>_0x11649b[_0x4aab36(0x1f0)][_0x4aab36(0x1f2)](_0x5350b6),{'verbose':_0x508011[_0x4aab36(0x213)]}),_0x35025f=_0x43f499[_0x4aab36(0x1cd)],_0x393b21=await withSpinner(_0x4aab36(0x1da)+_0x2dd3a6+_0x4aab36(0x21d),()=>_0x11649b[_0x4aab36(0x1f0)][_0x4aab36(0x1cb)](_0x35025f,_0x2dd3a6),{'verbose':_0x508011[_0x4aab36(0x213)]});_0x2f7051=_0x393b21['data'],_0x508011[_0x4aab36(0x213)]&&console[_0x4aab36(0x1c7)](_0x4aab36(0x1fc)+_0x2f7051);}const _0x1942fe={'name':_0x1c6206,'description':_0x508011[_0x4aab36(0x1e5)],'parentFolderId':_0x2f7051},_0x3d5931=await withSpinner(_0x4aab36(0x1f9)+_0x1c6206+'\x27...',()=>_0x11649b['segment'][_0x4aab36(0x216)](_0x5350b6,_0x1942fe),{'verbose':_0x508011[_0x4aab36(0x213)]}),_0x6e3f4c=_0x3d5931[_0x4aab36(0x1cd)];return console[_0x4aab36(0x1c7)](_0x4aab36(0x1ae)+_0x6e3f4c[_0x4aab36(0x209)]+_0x4aab36(0x1de)+_0x6e3f4c['id']),await handleSDKOutput([_0x6e3f4c],_0x508011),0x0;}}function a22_0x13c4(){const _0x552f57=['90Mghwnc','✔\x20Query\x20completed:\x20Processed\x20','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','582374LmLOns','Resolving\x20parent\x20folder\x20\x27','segment:describe','Executing\x20segment\x20query...','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','\x27\x20with\x20ID:\x20','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','416NjwijK','elapsedTimeMillis','segment:sql','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','query','description','resolvePathToResource','Folder\x20name:\x20','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','site','Resolved\x20folder\x20ID:\x20','segment:show','getFolder','getSegment','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','trim','segment','cause','resolveParentId','Segment\x20ID\x20missing\x20from\x20resolved\x20path','2910171izqkQc','282jmMGuU','segment:folder:list','Resolving\x20folder\x20\x27','processedRows','Creating\x20folder\x20\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolved\x20parent\x20ID:\x20','Resolved\x20parent\x20folder\x20ID:\x20','Fetching\x20SQL\x20for\x20segment...','Site:\x20','folder','length','\x20[Job\x20ID:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','segmentId','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Fetching\x20folder\x20details...','Parent\x20segment:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','Fetching\x20parent\x20segment\x20details...','name','includes','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','INTERNAL','code','parentFolder','execute','parentId','replace','Usage:\x20tdx\x20segment\x20describe\x20<path>','verbose','6511760qWRCYW','Usage:\x20tdx\x20segment\x20show\x20<path>','createFolder','jobId','Usage:\x20tdx\x20segment\x20sql\x20<path>','parent','Show\x20segment\x20folder\x20details','Resolving\x20parent\x20segment\x20\x27','Resolving\x20path\x20\x27','\x27...','getSegmentSQL','folderId','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','✔\x20Created\x20folder\x20\x27','Resolved\x20relative\x20path\x20to:\x20','Listing\x20folders\x20for\x20parent\x20\x27','getParent','\x20\x20Cause:\x20','type','Error:\x20','Fetching\x20SQL\x20for\x20parent\x20segment...','getParentSQL','limit','1668096cbCxFL','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Examples:','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','segment:folder:create','in\x20','4nvVxge','Resolved\x20type:\x20','stats','Segment\x20ID:\x20','Parent\x20name:\x20','32074CcWzZc','19595XNzQaO','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Parent\x20ID:\x20','error','Folder\x20ID:\x20','32956188VrEbiQ','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','resolveFolderId','11IXeUKO','data','setJobId','Show\x20segment\x20or\x20folder\x20details','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','format','Fetching\x20folder\x20\x27','segment:folder:show','segmentPath','message'];a22_0x13c4=function(){return _0x552f57;};return a22_0x13c4();}
1
+ const a22_0x43e269=a22_0x2c81;(function(_0x181fbd,_0x18b3f7){const _0x5179b6=a22_0x2c81,_0x1bb1dc=_0x181fbd();while(!![]){try{const _0x308956=parseInt(_0x5179b6(0x108))/0x1+parseInt(_0x5179b6(0x14d))/0x2+parseInt(_0x5179b6(0x127))/0x3+-parseInt(_0x5179b6(0x152))/0x4*(-parseInt(_0x5179b6(0x128))/0x5)+parseInt(_0x5179b6(0x143))/0x6+-parseInt(_0x5179b6(0x15d))/0x7+-parseInt(_0x5179b6(0x15f))/0x8;if(_0x308956===_0x18b3f7)break;else _0x1bb1dc['push'](_0x1bb1dc['shift']());}catch(_0x33721a){_0x1bb1dc['push'](_0x1bb1dc['shift']());}}}(a22_0x309e,0x2e981));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput}from'../utils/command-output.js';function a22_0x2c81(_0x5a87b4,_0x4b684a){const _0x309eee=a22_0x309e();return a22_0x2c81=function(_0x2c81a3,_0x3f805d){_0x2c81a3=_0x2c81a3-0xf5;let _0x3f348f=_0x309eee[_0x2c81a3];return _0x3f348f;},a22_0x2c81(_0x5a87b4,_0x4b684a);}import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';export class SegmentDescribeCommand extends BaseCommand{[a22_0x43e269(0x134)]=a22_0x43e269(0x105);['description']=a22_0x43e269(0x149);async[a22_0x43e269(0x14c)](_0xe3f6a1){const _0x2c8874=a22_0x43e269,{options:_0x263427,args:_0x108bfd,tdx:_0x53a6ba}=_0xe3f6a1;if(_0x108bfd[_0x2c8874(0x109)]===0x0)return console[_0x2c8874(0x164)](_0x2c8874(0x142)),console[_0x2c8874(0x164)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x2c8874(0x164)]('Examples:'),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x2c8874(0x164)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x32abcc=_0x108bfd[0x0],_0x27ac2b=_0x263427[_0x2c8874(0x121)];let _0x5c38af=_0x32abcc;_0x27ac2b&&!_0x32abcc[_0x2c8874(0xf9)]('/')&&(_0x5c38af=_0x27ac2b+'/'+_0x32abcc,_0x263427[_0x2c8874(0x123)]&&console[_0x2c8874(0x164)]('Resolved\x20relative\x20path\x20to:\x20'+_0x5c38af));const _0x5497ac=await withSpinner(_0x2c8874(0xfd)+_0x5c38af+_0x2c8874(0x10e),()=>_0x53a6ba[_0x2c8874(0x141)][_0x2c8874(0x102)](_0x5c38af),{'verbose':_0x263427['verbose']}),_0x558a21=_0x5497ac[_0x2c8874(0x12c)];_0x263427[_0x2c8874(0x123)]&&(console['error'](_0x2c8874(0x13c)+_0x558a21['type']),console['error'](_0x2c8874(0x15b)+_0x558a21['parentId']),_0x558a21[_0x2c8874(0x14f)]&&console[_0x2c8874(0x164)](_0x2c8874(0xf6)+_0x558a21[_0x2c8874(0x14f)]),_0x558a21[_0x2c8874(0x122)]&&console[_0x2c8874(0x164)](_0x2c8874(0x129)+_0x558a21[_0x2c8874(0x122)]));if(_0x558a21[_0x2c8874(0x157)]===_0x2c8874(0x13d)){const _0x4d450f=await withSpinner(_0x2c8874(0x110),()=>_0x53a6ba[_0x2c8874(0x141)][_0x2c8874(0x119)](_0x558a21[_0x2c8874(0x144)]),{'verbose':_0x263427[_0x2c8874(0x123)]});await handleSDKOutput([_0x4d450f['data']],_0x263427);}else{if(_0x558a21['type']===_0x2c8874(0x114)){if(!_0x558a21[_0x2c8874(0x14f)])throw new SDKError(ErrorCode[_0x2c8874(0x150)],_0x2c8874(0x130));const _0x36cbf1=await withSpinner(_0x2c8874(0x136),()=>_0x53a6ba['segment'][_0x2c8874(0x10f)](_0x558a21[_0x2c8874(0x14f)]),{'verbose':_0x263427[_0x2c8874(0x123)]});await handleSDKOutput([_0x36cbf1[_0x2c8874(0x12c)]],_0x263427);}else{if(_0x558a21[_0x2c8874(0x157)]===_0x2c8874(0x141)){if(!_0x558a21['segmentId'])throw new SDKError(ErrorCode[_0x2c8874(0x150)],_0x2c8874(0x10c));const _0x4fc4f8=await withSpinner(_0x2c8874(0x10d),()=>_0x53a6ba[_0x2c8874(0x141)]['getSegment'](_0x558a21[_0x2c8874(0x144)],_0x558a21['segmentId']),{'verbose':_0x263427[_0x2c8874(0x123)]});await handleSDKOutput([_0x4fc4f8[_0x2c8874(0x12c)]],_0x263427);}}}return 0x0;}catch(_0x3c273b){if(_0x3c273b instanceof SDKError)return console[_0x2c8874(0x164)](_0x2c8874(0xf7)+_0x3c273b['message']),_0x3c273b[_0x2c8874(0x16a)]&&console[_0x2c8874(0x164)](_0x2c8874(0xfb)+_0x3c273b[_0x2c8874(0x16a)]),0x1;throw _0x3c273b;}}}export class SegmentShowCommand extends BaseCommand{[a22_0x43e269(0x134)]=a22_0x43e269(0xf8);['description']=a22_0x43e269(0x117);async[a22_0x43e269(0x14c)](_0x301690){const _0x31db38=a22_0x43e269,{options:_0x41c626,args:_0xd00321,tdx:_0x163a1d}=_0x301690;if(_0xd00321['length']===0x0)return console[_0x31db38(0x164)](_0x31db38(0x13b)),console[_0x31db38(0x164)]('Usage:\x20tdx\x20segment\x20show\x20<path>'),console[_0x31db38(0x164)]('Examples:'),console[_0x31db38(0x164)]('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22'),console['error'](_0x31db38(0x161)),console[_0x31db38(0x164)](_0x31db38(0x125)),0x1;try{const _0x38fef2=_0xd00321[0x0],_0x11fa3e=_0x41c626[_0x31db38(0x121)];let _0x41e696=_0x38fef2;_0x11fa3e&&!_0x38fef2[_0x31db38(0xf9)]('/')&&(_0x41e696=_0x11fa3e+'/'+_0x38fef2,_0x41c626[_0x31db38(0x123)]&&console[_0x31db38(0x164)](_0x31db38(0x11d)+_0x41e696));const _0x1ecbd1=await withSpinner(_0x31db38(0xfd)+_0x41e696+_0x31db38(0x10e),()=>_0x163a1d[_0x31db38(0x141)][_0x31db38(0x102)](_0x41e696),{'verbose':_0x41c626[_0x31db38(0x123)]}),_0x5f0561=_0x1ecbd1[_0x31db38(0x12c)];_0x41c626['verbose']&&(console[_0x31db38(0x164)](_0x31db38(0x13c)+_0x5f0561[_0x31db38(0x157)]),console['error']('Parent\x20ID:\x20'+_0x5f0561[_0x31db38(0x144)]));if(_0x5f0561[_0x31db38(0x157)]===_0x31db38(0x114))return console['error']('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console['error'](_0x31db38(0x15a)),0x1;let _0x4e8e4a;if(_0x5f0561['type']==='parent'){const _0x592a5d=await withSpinner(_0x31db38(0x163),()=>_0x163a1d[_0x31db38(0x141)]['getParentSQL'](_0x5f0561[_0x31db38(0x144)]),{'verbose':_0x41c626[_0x31db38(0x123)]});_0x4e8e4a=_0x592a5d[_0x31db38(0x12c)];}else{if(!_0x5f0561[_0x31db38(0x122)])throw new SDKError(ErrorCode[_0x31db38(0x150)],_0x31db38(0x10c));const _0x2f9856=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x163a1d['segment'][_0x31db38(0x169)](_0x5f0561[_0x31db38(0x144)],_0x5f0561[_0x31db38(0x122)]),{'verbose':_0x41c626[_0x31db38(0x123)]});_0x4e8e4a=_0x2f9856[_0x31db38(0x12c)];}const _0x4ddf7e=_0x41c626[_0x31db38(0xfe)],_0x8b4867=/\bLIMIT\s+\d+/i[_0x31db38(0x14b)](_0x4e8e4a);!_0x8b4867&&(_0x4e8e4a=_0x4e8e4a[_0x31db38(0x104)]()[_0x31db38(0x131)](/;+$/,''),_0x4e8e4a=_0x31db38(0x11b)+_0x4e8e4a+_0x31db38(0x106)+_0x4ddf7e);_0x41c626[_0x31db38(0x123)]&&console[_0x31db38(0x164)](_0x31db38(0x118)+_0x4e8e4a);const _0x320709=await withQuerySpinner(_0x31db38(0x140),async _0x11e928=>{const _0x59d7c=await _0x163a1d['query'](_0x4e8e4a,{'catalog':'td','schema':'information_schema','onJobId':_0x54f212=>{const _0x3ddc6f=a22_0x2c81;_0x11e928[_0x3ddc6f(0x162)](_0x54f212);}});return _0x59d7c;},{'verbose':_0x41c626['verbose']}),_0x44fc09=_0x320709[_0x31db38(0x12c)],_0x1d6035=_0x44fc09[_0x31db38(0x154)]?'\x20[Job\x20ID:\x20'+_0x44fc09['jobId']+']':'';return console[_0x31db38(0x164)](_0x31db38(0x10b)+_0x44fc09[_0x31db38(0x13f)][_0x31db38(0x167)][_0x31db38(0x16b)]()+_0x31db38(0x13e)+(_0x31db38(0x135)+formatElapsed(_0x44fc09[_0x31db38(0x13f)][_0x31db38(0x111)])+_0x1d6035)),await handleQueryOutput(_0x44fc09,_0x41c626),0x0;}catch(_0x1b320b){if(_0x1b320b instanceof SDKError)return console[_0x31db38(0x164)](_0x31db38(0x14e)+_0x1b320b[_0x31db38(0xfc)]+']'),console[_0x31db38(0x164)]('\x0a'+_0x1b320b[_0x31db38(0x12f)]),0x1;throw _0x1b320b;}}}export class SegmentFolderListCommand extends BaseCommand{[a22_0x43e269(0x134)]='segment:folder:list';[a22_0x43e269(0x103)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async['execute'](_0x5b96e6){const _0x13c805=a22_0x43e269,{options:_0x19fcb8,args:_0x409c17,tdx:_0x1fe7c5}=_0x5b96e6;if(_0x409c17['length']===0x0)return console[_0x13c805(0x164)](_0x13c805(0x11c)),console[_0x13c805(0x164)](_0x13c805(0x155)),0x1;const _0x218d20=_0x409c17[0x0];try{_0x19fcb8['verbose']&&(console[_0x13c805(0x164)](_0x13c805(0x137)+_0x19fcb8[_0x13c805(0x115)]),console[_0x13c805(0x164)]('Parent\x20name:\x20'+_0x218d20));const _0x213587=await withSpinner(_0x13c805(0x11e)+_0x218d20+_0x13c805(0x10e),()=>_0x1fe7c5['segment'][_0x13c805(0x166)](_0x218d20),{'verbose':_0x19fcb8[_0x13c805(0x123)]}),_0x934d68=_0x213587['data'];_0x19fcb8[_0x13c805(0x123)]&&console[_0x13c805(0x164)](_0x13c805(0x112)+_0x934d68);const _0x4a554e=await withSpinner(_0x13c805(0x13a)+_0x218d20+_0x13c805(0x10e),()=>_0x1fe7c5[_0x13c805(0x141)][_0x13c805(0x159)](_0x934d68),{'verbose':_0x19fcb8[_0x13c805(0x123)]}),_0x232c5b=_0x4a554e[_0x13c805(0x12c)];return console['error'](_0x13c805(0x147)+_0x232c5b[_0x13c805(0x109)]+_0x13c805(0x138)+(_0x232c5b[_0x13c805(0x109)]!==0x1?'s':'')),await handleSDKOutput(_0x232c5b,_0x19fcb8),0x0;}catch(_0x1243ce){if(_0x1243ce instanceof SDKError)return console['error']('Error:\x20'+_0x1243ce[_0x13c805(0x12f)]),_0x1243ce[_0x13c805(0x16a)]&&console[_0x13c805(0x164)]('\x20\x20Cause:\x20'+_0x1243ce[_0x13c805(0x16a)]),0x1;throw _0x1243ce;}}}export class SegmentFolderShowCommand extends BaseCommand{[a22_0x43e269(0x134)]=a22_0x43e269(0x12d);[a22_0x43e269(0x103)]=a22_0x43e269(0x14a);async[a22_0x43e269(0x14c)](_0x3b7575){const _0x16e446=a22_0x43e269,{options:_0x4acd3a,args:_0x474c5d,tdx:_0x3ee2a3}=_0x3b7575;if(_0x474c5d[_0x16e446(0x109)]===0x0)return console['error'](_0x16e446(0xfa)),console[_0x16e446(0x164)](_0x16e446(0x12a)),0x1;try{const {parentId:_0x1858b9,childId:_0x13eac7}=parseSegmentRef(_0x474c5d[0x0]);_0x4acd3a[_0x16e446(0x123)]&&(console[_0x16e446(0x164)]('Site:\x20'+_0x4acd3a[_0x16e446(0x115)]),console[_0x16e446(0x164)](_0x16e446(0x11a)+_0x1858b9),_0x13eac7&&console[_0x16e446(0x164)]('Folder\x20name:\x20'+_0x13eac7));if(!_0x13eac7)return console[_0x16e446(0x164)](_0x16e446(0x120)),0x1;const _0x4e68cb=await withSpinner(_0x16e446(0x11e)+_0x1858b9+_0x16e446(0x10e),()=>_0x3ee2a3[_0x16e446(0x141)]['resolveParentId'](_0x1858b9),{'verbose':_0x4acd3a['verbose']}),_0x2076d4=_0x4e68cb[_0x16e446(0x12c)];_0x4acd3a[_0x16e446(0x123)]&&console[_0x16e446(0x164)](_0x16e446(0x112)+_0x2076d4);const _0x310f17=await withSpinner(_0x16e446(0x153)+_0x13eac7+_0x16e446(0x10e),()=>_0x3ee2a3['segment']['resolveFolderId'](_0x2076d4,_0x13eac7),{'verbose':_0x4acd3a[_0x16e446(0x123)]}),_0x7d756e=_0x310f17['data'];_0x4acd3a[_0x16e446(0x123)]&&console[_0x16e446(0x164)](_0x16e446(0x101)+_0x7d756e);const _0x1edd91=await withSpinner(_0x16e446(0x160)+_0x13eac7+_0x16e446(0x10e),()=>_0x3ee2a3[_0x16e446(0x141)][_0x16e446(0x10f)](_0x7d756e),{'verbose':_0x4acd3a[_0x16e446(0x123)]});return await handleSDKOutput([_0x1edd91[_0x16e446(0x12c)]],_0x4acd3a),0x0;}catch(_0x154655){if(_0x154655 instanceof SDKError)return console[_0x16e446(0x164)]('Error:\x20'+_0x154655['message']),_0x154655[_0x16e446(0x16a)]&&console['error'](_0x16e446(0xfb)+_0x154655[_0x16e446(0x16a)]),0x1;throw _0x154655;}}}function a22_0x309e(){const _0x33108a=['\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','203454dEhpcm','15IPZgCi','Segment\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','format','data','segment:folder:show','Folder\x20name:\x20','message','Folder\x20ID\x20missing\x20from\x20resolved\x20path','replace','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','log','name','in\x20','Fetching\x20folder\x20details...','Site:\x20','\x20folder','segment:folder:create','Listing\x20folders\x20for\x20parent\x20\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolved\x20type:\x20','parent','\x20rows\x20','stats','Executing\x20segment\x20query...','segment','Error:\x20Path\x20or\x20name\x20is\x20required','2141544gtjVpQ','parentId','parentFolder','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','✔\x20Found\x20','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Show\x20segment\x20or\x20folder\x20details','Show\x20segment\x20folder\x20details','test','execute','410650TdhcXN','✖\x20Query\x20failed\x20[','folderId','INTERNAL','Usage:\x20tdx\x20segment\x20sql\x20<path>','478508mQwaag','Resolving\x20folder\x20\x27','jobId','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Examples:','type','Parent\x20segment:\x20','listFolders','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','Parent\x20ID:\x20','json','875056mQpIEP','resolveFolderId','7280136rBdTwn','Fetching\x20folder\x20\x27','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','setJobId','Fetching\x20SQL\x20for\x20parent\x20segment...','error','segment:sql','resolveParentId','processedRows','\x27\x20with\x20ID:\x20','getSegmentSQL','cause','toLocaleString','Resolving\x20parent\x20folder\x20\x27','Folder\x20ID:\x20','Error:\x20','segment:show','includes','Error:\x20Folder\x20reference\x20is\x20required','\x20\x20Cause:\x20','code','Resolving\x20path\x20\x27','limit','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','getParentSQL','Resolved\x20folder\x20ID:\x20','resolvePathToResource','description','trim','segment:describe','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','236926rykrAP','length','jsonl','✔\x20Query\x20completed:\x20Processed\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Fetching\x20segment\x20details...','\x27...','getFolder','Fetching\x20parent\x20segment\x20details...','elapsedTimeMillis','Resolved\x20parent\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','folder','site','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','SQL\x20query:\x0a','getParent','Parent\x20name:\x20','SELECT\x20*\x20FROM\x20(\x0a','Error:\x20Parent\x20segment\x20name\x20is\x20required','Resolved\x20relative\x20path\x20to:\x20','Resolving\x20parent\x20segment\x20\x27','Creating\x20folder\x20\x27','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','segmentPath','segmentId','verbose','Fetching\x20SQL\x20for\x20segment...'];a22_0x309e=function(){return _0x33108a;};return a22_0x309e();}export class SegmentSQLCommand extends BaseCommand{['name']=a22_0x43e269(0x165);[a22_0x43e269(0x103)]=a22_0x43e269(0x116);async[a22_0x43e269(0x14c)](_0x1fa8e6){const _0x56ef9f=a22_0x43e269,{options:_0x530963,args:_0x2f970b,tdx:_0xf567ca}=_0x1fa8e6;if(_0x2f970b[_0x56ef9f(0x109)]===0x0)return console['error'](_0x56ef9f(0x13b)),console[_0x56ef9f(0x164)](_0x56ef9f(0x151)),console[_0x56ef9f(0x164)](_0x56ef9f(0x156)),console['error'](_0x56ef9f(0xff)),console[_0x56ef9f(0x164)](_0x56ef9f(0x126)),console[_0x56ef9f(0x164)](_0x56ef9f(0x146)),0x1;try{const _0x166a2d=_0x2f970b[0x0],_0x3bcb05=_0x530963[_0x56ef9f(0x121)];let _0x71ed64=_0x166a2d;_0x3bcb05&&!_0x166a2d[_0x56ef9f(0xf9)]('/')&&(_0x71ed64=_0x3bcb05+'/'+_0x166a2d,_0x530963[_0x56ef9f(0x123)]&&console[_0x56ef9f(0x164)](_0x56ef9f(0x11d)+_0x71ed64));const _0x385119=await withSpinner(_0x56ef9f(0xfd)+_0x71ed64+'\x27...',()=>_0xf567ca[_0x56ef9f(0x141)][_0x56ef9f(0x102)](_0x71ed64),{'verbose':_0x530963['verbose']}),_0x735123=_0x385119['data'];_0x530963[_0x56ef9f(0x123)]&&(console[_0x56ef9f(0x164)]('Resolved\x20type:\x20'+_0x735123[_0x56ef9f(0x157)]),console[_0x56ef9f(0x164)](_0x56ef9f(0x15b)+_0x735123[_0x56ef9f(0x144)]));if(_0x735123[_0x56ef9f(0x157)]===_0x56ef9f(0x114))return console[_0x56ef9f(0x164)](_0x56ef9f(0x132)),console[_0x56ef9f(0x164)](_0x56ef9f(0x107)),0x1;let _0x18b505;if(_0x735123[_0x56ef9f(0x157)]==='parent'){const _0x106022=await withSpinner(_0x56ef9f(0x163),()=>_0xf567ca[_0x56ef9f(0x141)][_0x56ef9f(0x100)](_0x735123[_0x56ef9f(0x144)]),{'verbose':_0x530963[_0x56ef9f(0x123)]});_0x18b505=_0x106022[_0x56ef9f(0x12c)];}else{if(!_0x735123[_0x56ef9f(0x122)])throw new SDKError(ErrorCode[_0x56ef9f(0x150)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2816f8=await withSpinner(_0x56ef9f(0x124),()=>_0xf567ca[_0x56ef9f(0x141)][_0x56ef9f(0x169)](_0x735123[_0x56ef9f(0x144)],_0x735123[_0x56ef9f(0x122)]),{'verbose':_0x530963[_0x56ef9f(0x123)]});_0x18b505=_0x2816f8['data'];}return _0x530963[_0x56ef9f(0x12b)]===_0x56ef9f(0x15c)||_0x530963['format']===_0x56ef9f(0x10a)?await handleSDKOutput([{'sql':_0x18b505}],_0x530963):console[_0x56ef9f(0x133)](_0x18b505),0x0;}catch(_0x5e74bf){if(_0x5e74bf instanceof SDKError)return console['error'](_0x56ef9f(0xf7)+_0x5e74bf['message']),_0x5e74bf['cause']&&console[_0x56ef9f(0x164)](_0x56ef9f(0xfb)+_0x5e74bf[_0x56ef9f(0x16a)]),0x1;throw _0x5e74bf;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a22_0x43e269(0x134)]=a22_0x43e269(0x139);['description']='Create\x20segment\x20folder\x20for\x20organization';async[a22_0x43e269(0x14c)](_0x2f29a){const _0x3f09cd=a22_0x43e269,{options:_0x47d47b,args:_0x5abf6f,tdx:_0x4b0a18}=_0x2f29a,_0x3aa974=_0x47d47b;if(_0x5abf6f[_0x3f09cd(0x109)]<0x2)return console['error'](_0x3f09cd(0x148)),console[_0x3f09cd(0x164)](_0x3f09cd(0x113)),0x1;const _0x52273a=_0x5abf6f[0x0],_0x462bbd=_0x5abf6f[0x1];_0x3aa974[_0x3f09cd(0x123)]&&(console['error'](_0x3f09cd(0x137)+_0x3aa974['site']),console[_0x3f09cd(0x164)](_0x3f09cd(0x158)+_0x52273a),console[_0x3f09cd(0x164)](_0x3f09cd(0x12e)+_0x462bbd));let _0x410320;if(_0x3aa974[_0x3f09cd(0x145)]){const _0x538609=_0x3aa974[_0x3f09cd(0x145)],_0x202ff3=await withSpinner(_0x3f09cd(0x11e)+_0x52273a+_0x3f09cd(0x10e),()=>_0x4b0a18[_0x3f09cd(0x141)][_0x3f09cd(0x166)](_0x52273a),{'verbose':_0x3aa974[_0x3f09cd(0x123)]}),_0x5abd43=_0x202ff3[_0x3f09cd(0x12c)],_0x475819=await withSpinner(_0x3f09cd(0xf5)+_0x538609+_0x3f09cd(0x10e),()=>_0x4b0a18[_0x3f09cd(0x141)][_0x3f09cd(0x15e)](_0x5abd43,_0x538609),{'verbose':_0x3aa974[_0x3f09cd(0x123)]});_0x410320=_0x475819[_0x3f09cd(0x12c)],_0x3aa974[_0x3f09cd(0x123)]&&console[_0x3f09cd(0x164)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x410320);}const _0x414dc7={'name':_0x462bbd,'description':_0x3aa974['description'],'parentFolderId':_0x410320},_0x12dd4b=await withSpinner(_0x3f09cd(0x11f)+_0x462bbd+_0x3f09cd(0x10e),()=>_0x4b0a18['segment']['createFolder'](_0x52273a,_0x414dc7),{'verbose':_0x3aa974[_0x3f09cd(0x123)]}),_0x13d5f0=_0x12dd4b['data'];return console[_0x3f09cd(0x164)]('✔\x20Created\x20folder\x20\x27'+_0x13d5f0[_0x3f09cd(0x134)]+_0x3f09cd(0x168)+_0x13d5f0['id']),await handleSDKOutput([_0x13d5f0],_0x3aa974),0x0;}}
@@ -1 +1 @@
1
- const a23_0x1ed19a=a23_0x4397;function a23_0x4e4d(){const _0x4dcbd2=['Parent:\x20','invisible','resolveFolderId','\x27...','data','Target\x20path:\x20','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Resolving\x20parent\x20segment\x20\x27','segments','error','includes','492140NgEcgN','resolveParentId','230900uCbrYg','285699HykuDw','15490330XJDUFG','segment','kind','Segment\x20name:\x20','createSegment','Examples:','30askXvV','Resolved\x20relative\x20path\x20to:\x20','segmentPath','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','type','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Site:\x20','Create\x20child\x20segment\x20with\x20filtering\x20rules','470540hSrwle','segment:create','name','folderId','execute','4YRUuKn','resolvePathToResource','verbose','noCountPopulation','Resolving\x20folder\x20path\x20\x27','parent','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','description','9TExWyI','folder','rule','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','6229680NOpjML','3307824LkVTqD','\x20\x20\x20Path:\x20','length','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'];a23_0x4e4d=function(){return _0x4dcbd2;};return a23_0x4e4d();}(function(_0xac6991,_0x9a1191){const _0x295b08=a23_0x4397,_0x5d3c29=_0xac6991();while(!![]){try{const _0x14bf66=parseInt(_0x295b08(0x165))/0x1*(parseInt(_0x295b08(0x150))/0x2)+parseInt(_0x295b08(0x151))/0x3+parseInt(_0x295b08(0x14e))/0x4+-parseInt(_0x295b08(0x171))/0x5+parseInt(_0x295b08(0x158))/0x6*(parseInt(_0x295b08(0x160))/0x7)+-parseInt(_0x295b08(0x172))/0x8+-parseInt(_0x295b08(0x16d))/0x9*(-parseInt(_0x295b08(0x152))/0xa);if(_0x14bf66===_0x9a1191)break;else _0x5d3c29['push'](_0x5d3c29['shift']());}catch(_0x5a05bf){_0x5d3c29['push'](_0x5d3c29['shift']());}}}(a23_0x4e4d,0xdd23b));import{BaseCommand}from'./command.js';function a23_0x4397(_0x1f07bb,_0x49ee92){const _0x4e4d30=a23_0x4e4d();return a23_0x4397=function(_0x439705,_0x50db00){_0x439705=_0x439705-0x147;let _0x162133=_0x4e4d30[_0x439705];return _0x162133;},a23_0x4397(_0x1f07bb,_0x49ee92);}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{[a23_0x1ed19a(0x162)]=a23_0x1ed19a(0x161);[a23_0x1ed19a(0x16c)]=a23_0x1ed19a(0x15f);async[a23_0x1ed19a(0x164)](_0x1150d4){const _0x5af9d0=a23_0x1ed19a,{options:_0xd0ac96,args:_0xd812e8,tdx:_0x1b1134}=_0x1150d4,_0x4665ac=_0xd0ac96;if(_0xd812e8[_0x5af9d0(0x174)]===0x0)return console[_0x5af9d0(0x14c)](_0x5af9d0(0x16b)),console[_0x5af9d0(0x14c)](_0x5af9d0(0x15b)),console[_0x5af9d0(0x14c)](_0x5af9d0(0x157)),console[_0x5af9d0(0x14c)](_0x5af9d0(0x149)),console[_0x5af9d0(0x14c)](_0x5af9d0(0x175)),console[_0x5af9d0(0x14c)](_0x5af9d0(0x15d)),0x1;const _0x436498=_0xd812e8[0x0],_0x17c84e=_0xd0ac96[_0x5af9d0(0x15a)];let _0x273330=_0x436498;_0x17c84e&&!_0x436498[_0x5af9d0(0x14d)]('/')&&(_0x273330=_0x17c84e+'/'+_0x436498,_0x4665ac[_0x5af9d0(0x167)]&&console['error'](_0x5af9d0(0x159)+_0x273330));const _0x19dc35=parsePath(_0x273330);if(_0x19dc35['segments'][_0x5af9d0(0x174)]<0x2)return console[_0x5af9d0(0x14c)](_0x5af9d0(0x148)),console[_0x5af9d0(0x14c)](_0x5af9d0(0x170)),0x1;const _0x500414=_0x19dc35[_0x5af9d0(0x14b)][0x0],_0x1a8e5e=getBaseName(_0x273330),_0x491066=getParentPath(_0x273330);_0x4665ac[_0x5af9d0(0x167)]&&(console[_0x5af9d0(0x14c)](_0x5af9d0(0x15e)+_0x4665ac['site']),console[_0x5af9d0(0x14c)](_0x5af9d0(0x147)+_0x273330),console['error'](_0x5af9d0(0x176)+_0x500414),console['error'](_0x5af9d0(0x155)+_0x1a8e5e),console[_0x5af9d0(0x14c)]('Parent\x20path:\x20'+_0x491066));const _0x467983=await withSpinner(_0x5af9d0(0x14a)+_0x500414+_0x5af9d0(0x179),()=>_0x1b1134[_0x5af9d0(0x153)][_0x5af9d0(0x14f)](_0x500414),{'verbose':_0x4665ac[_0x5af9d0(0x167)]}),_0xf28d94=_0x467983[_0x5af9d0(0x17a)];let _0x3b69b7;if(_0x19dc35['segments'][_0x5af9d0(0x174)]>0x2){const _0x6e1fcf=await withSpinner(_0x5af9d0(0x169)+_0x491066+_0x5af9d0(0x179),()=>_0x1b1134[_0x5af9d0(0x153)][_0x5af9d0(0x166)](_0x491066),{'verbose':_0x4665ac[_0x5af9d0(0x167)]}),_0x2d263d=_0x6e1fcf[_0x5af9d0(0x17a)];if(_0x2d263d[_0x5af9d0(0x15c)]!==_0x5af9d0(0x16e)&&_0x2d263d[_0x5af9d0(0x15c)]!==_0x5af9d0(0x16a))return console[_0x5af9d0(0x14c)]('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x3b69b7=_0x2d263d[_0x5af9d0(0x163)];}else{if(_0x4665ac[_0x5af9d0(0x16e)]){const _0xb30593=await withSpinner('Resolving\x20folder\x20\x27'+_0x4665ac['folder']+_0x5af9d0(0x179),()=>_0x1b1134[_0x5af9d0(0x153)][_0x5af9d0(0x178)](_0xf28d94,_0x4665ac[_0x5af9d0(0x16e)]),{'verbose':_0x4665ac[_0x5af9d0(0x167)]});_0x3b69b7=_0xb30593[_0x5af9d0(0x17a)];}}_0x4665ac[_0x5af9d0(0x167)]&&_0x3b69b7&&console[_0x5af9d0(0x14c)]('Resolved\x20folder\x20ID:\x20'+_0x3b69b7);const _0x52225b=await loadJSONFromOptions(_0x4665ac[_0x5af9d0(0x16f)],_0x4665ac['ruleFile']),_0x56a18b={'name':_0x1a8e5e,'description':_0x4665ac['description'],'rule':_0x52225b,'kind':_0x4665ac[_0x5af9d0(0x154)]!==undefined?parseInt(_0x4665ac[_0x5af9d0(0x154)],0xa):undefined,'isVisible':_0x4665ac[_0x5af9d0(0x177)]?![]:undefined,'segmentFolderId':_0x3b69b7,'countPopulation':_0x4665ac[_0x5af9d0(0x168)]?![]:undefined},_0x5962a9=await withSpinner('Creating\x20segment\x20\x27'+_0x1a8e5e+_0x5af9d0(0x179),()=>_0x1b1134[_0x5af9d0(0x153)][_0x5af9d0(0x156)](_0xf28d94,_0x56a18b),{'verbose':_0x4665ac[_0x5af9d0(0x167)]}),_0x4c5d88=_0x5962a9[_0x5af9d0(0x17a)];return console[_0x5af9d0(0x14c)]('✔\x20Created\x20segment\x20\x27'+_0x4c5d88[_0x5af9d0(0x162)]+'\x27\x20with\x20ID:\x20'+_0x4c5d88['id']),_0x273330!==_0x436498&&console['error'](_0x5af9d0(0x173)+_0x273330),await handleSDKOutput([_0x4c5d88],_0x4665ac),0x0;}}
1
+ const a23_0x56e567=a23_0x51aa;function a23_0x4e44(){const _0x2bfe0f=['2786PtycMq','kind','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Parent:\x20','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Resolving\x20folder\x20path\x20\x27','resolvePathToResource','Resolved\x20relative\x20path\x20to:\x20','Resolving\x20parent\x20segment\x20\x27','invisible','Create\x20child\x20segment\x20with\x20filtering\x20rules','Creating\x20segment\x20\x27','description','5oNiYpD','Parent\x20path:\x20','24EVoAUf','rule','6912356iEUCQq','segmentPath','verbose','ruleFile','4167KVVFeh','segment','createSegment','1254yyXWmD','Site:\x20','type','Resolving\x20folder\x20\x27','execute','parent','31560oWoASY','error','name','32050EnYPof','noCountPopulation','folder','\x20\x20\x20Path:\x20','site','folderId','Target\x20path:\x20','Segment\x20name:\x20','197308kTOAmp','84hqKSxb','Examples:','segments','data','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','\x27...','10359132WrCQSW','Resolved\x20folder\x20ID:\x20','length','13437263mRZuWw','✔\x20Created\x20segment\x20\x27'];a23_0x4e44=function(){return _0x2bfe0f;};return a23_0x4e44();}(function(_0x1f5f0a,_0x27614c){const _0x37fb7a=a23_0x51aa,_0x5e54ae=_0x1f5f0a();while(!![]){try{const _0xba7bac=parseInt(_0x37fb7a(0x190))/0x1*(-parseInt(_0x37fb7a(0x1ad))/0x2)+-parseInt(_0x37fb7a(0x1bc))/0x3*(parseInt(_0x37fb7a(0x1a1))/0x4)+-parseInt(_0x37fb7a(0x1ba))/0x5*(parseInt(_0x37fb7a(0x1a8))/0x6)+parseInt(_0x37fb7a(0x1ab))/0x7+-parseInt(_0x37fb7a(0x196))/0x8+parseInt(_0x37fb7a(0x18d))/0x9*(-parseInt(_0x37fb7a(0x199))/0xa)+parseInt(_0x37fb7a(0x189))/0xb*(parseInt(_0x37fb7a(0x1a2))/0xc);if(_0xba7bac===_0x27614c)break;else _0x5e54ae['push'](_0x5e54ae['shift']());}catch(_0x2482b2){_0x5e54ae['push'](_0x5e54ae['shift']());}}}(a23_0x4e44,0xeb001));import{BaseCommand}from'./command.js';function a23_0x51aa(_0x16ebf7,_0xf1b3ee){const _0x4e441d=a23_0x4e44();return a23_0x51aa=function(_0x51aaa7,_0x5cba34){_0x51aaa7=_0x51aaa7-0x188;let _0xefebfa=_0x4e441d[_0x51aaa7];return _0xefebfa;},a23_0x51aa(_0x16ebf7,_0xf1b3ee);}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{[a23_0x56e567(0x198)]='segment:create';[a23_0x56e567(0x1b9)]=a23_0x56e567(0x1b7);async[a23_0x56e567(0x194)](_0x5a33d5){const _0xb61423=a23_0x56e567,{options:_0x162a5a,args:_0x1e3751,tdx:_0x31dcef}=_0x5a33d5,_0x2cfbb9=_0x162a5a;if(_0x1e3751['length']===0x0)return console[_0xb61423(0x197)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console['error']('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console['error'](_0xb61423(0x1a3)),console[_0xb61423(0x197)](_0xb61423(0x1af)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0xb61423(0x197)](_0xb61423(0x1b1)),0x1;const _0x4a5ea3=_0x1e3751[0x0],_0x43a180=_0x162a5a[_0xb61423(0x18a)];let _0x2301fe=_0x4a5ea3;_0x43a180&&!_0x4a5ea3['includes']('/')&&(_0x2301fe=_0x43a180+'/'+_0x4a5ea3,_0x2cfbb9[_0xb61423(0x18b)]&&console['error'](_0xb61423(0x1b4)+_0x2301fe));const _0x16e190=parsePath(_0x2301fe);if(_0x16e190['segments'][_0xb61423(0x1aa)]<0x2)return console['error']('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console['error'](_0xb61423(0x1a6)),0x1;const _0x28611f=_0x16e190[_0xb61423(0x1a4)][0x0],_0xb8861d=getBaseName(_0x2301fe),_0x3456f7=getParentPath(_0x2301fe);_0x2cfbb9[_0xb61423(0x18b)]&&(console[_0xb61423(0x197)](_0xb61423(0x191)+_0x2cfbb9[_0xb61423(0x19d)]),console['error'](_0xb61423(0x19f)+_0x2301fe),console[_0xb61423(0x197)](_0xb61423(0x1b0)+_0x28611f),console[_0xb61423(0x197)](_0xb61423(0x1a0)+_0xb8861d),console[_0xb61423(0x197)](_0xb61423(0x1bb)+_0x3456f7));const _0x2fc386=await withSpinner(_0xb61423(0x1b5)+_0x28611f+_0xb61423(0x1a7),()=>_0x31dcef[_0xb61423(0x18e)]['resolveParentId'](_0x28611f),{'verbose':_0x2cfbb9[_0xb61423(0x18b)]}),_0x352d94=_0x2fc386[_0xb61423(0x1a5)];let _0xbf961a;if(_0x16e190[_0xb61423(0x1a4)][_0xb61423(0x1aa)]>0x2){const _0x1caa2a=await withSpinner(_0xb61423(0x1b2)+_0x3456f7+'\x27...',()=>_0x31dcef[_0xb61423(0x18e)][_0xb61423(0x1b3)](_0x3456f7),{'verbose':_0x2cfbb9[_0xb61423(0x18b)]}),_0x13c915=_0x1caa2a[_0xb61423(0x1a5)];if(_0x13c915[_0xb61423(0x192)]!==_0xb61423(0x19b)&&_0x13c915[_0xb61423(0x192)]!==_0xb61423(0x195))return console['error']('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0xbf961a=_0x13c915[_0xb61423(0x19e)];}else{if(_0x2cfbb9['folder']){const _0x4e8ace=await withSpinner(_0xb61423(0x193)+_0x2cfbb9['folder']+_0xb61423(0x1a7),()=>_0x31dcef[_0xb61423(0x18e)]['resolveFolderId'](_0x352d94,_0x2cfbb9[_0xb61423(0x19b)]),{'verbose':_0x2cfbb9[_0xb61423(0x18b)]});_0xbf961a=_0x4e8ace[_0xb61423(0x1a5)];}}_0x2cfbb9[_0xb61423(0x18b)]&&_0xbf961a&&console[_0xb61423(0x197)](_0xb61423(0x1a9)+_0xbf961a);const _0x26c5ce=await loadJSONFromOptions(_0x2cfbb9[_0xb61423(0x188)],_0x2cfbb9[_0xb61423(0x18c)]),_0x5689fa={'name':_0xb8861d,'description':_0x2cfbb9[_0xb61423(0x1b9)],'rule':_0x26c5ce,'kind':_0x2cfbb9['kind']!==undefined?parseInt(_0x2cfbb9[_0xb61423(0x1ae)],0xa):undefined,'isVisible':_0x2cfbb9[_0xb61423(0x1b6)]?![]:undefined,'segmentFolderId':_0xbf961a,'countPopulation':_0x2cfbb9[_0xb61423(0x19a)]?![]:undefined},_0x756e01=await withSpinner(_0xb61423(0x1b8)+_0xb8861d+'\x27...',()=>_0x31dcef[_0xb61423(0x18e)][_0xb61423(0x18f)](_0x352d94,_0x5689fa),{'verbose':_0x2cfbb9[_0xb61423(0x18b)]}),_0x551d97=_0x756e01[_0xb61423(0x1a5)];return console[_0xb61423(0x197)](_0xb61423(0x1ac)+_0x551d97[_0xb61423(0x198)]+'\x27\x20with\x20ID:\x20'+_0x551d97['id']),_0x2301fe!==_0x4a5ea3&&console[_0xb61423(0x197)](_0xb61423(0x19c)+_0x2301fe),await handleSDKOutput([_0x551d97],_0x2cfbb9),0x0;}}
@@ -1 +1 @@
1
- const a24_0x55753b=a24_0x166c;function a24_0x166c(_0x421d05,_0x480524){const _0x191f99=a24_0x191f();return a24_0x166c=function(_0x166c21,_0x5880ca){_0x166c21=_0x166c21-0x16d;let _0x24addb=_0x191f99[_0x166c21];return _0x24addb;},a24_0x166c(_0x421d05,_0x480524);}(function(_0x2a0bef,_0x2ea3fc){const _0x1e68e0=a24_0x166c,_0x51ee66=_0x2a0bef();while(!![]){try{const _0xcb2692=-parseInt(_0x1e68e0(0x181))/0x1+-parseInt(_0x1e68e0(0x174))/0x2*(-parseInt(_0x1e68e0(0x176))/0x3)+parseInt(_0x1e68e0(0x17a))/0x4+-parseInt(_0x1e68e0(0x171))/0x5+-parseInt(_0x1e68e0(0x17b))/0x6+-parseInt(_0x1e68e0(0x178))/0x7+parseInt(_0x1e68e0(0x177))/0x8;if(_0xcb2692===_0x2ea3fc)break;else _0x51ee66['push'](_0x51ee66['shift']());}catch(_0x2d4783){_0x51ee66['push'](_0x51ee66['shift']());}}}(a24_0x191f,0xb50f2));import{BaseCommand}from'./command.js';function a24_0x191f(){const _0x187e4d=['length','Parent\x20segment:\x20','872590oBkXeH','Site:\x20','\x20field','20198wEnERg','description','141Srwluz','9392936urPYvL','1359547qHUxaS','error','5080472ksaSyD','7320894MKLFan','List\x20available\x20fields\x20for\x20segmentation','site','verbose','listFields','\x27...','588382ZUtqXB','Error:\x20Parent\x20segment\x20name\x20is\x20required','data','Listing\x20fields\x20for\x20\x27'];a24_0x191f=function(){return _0x187e4d;};return a24_0x191f();}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{['name']='segment:fields';[a24_0x55753b(0x175)]=a24_0x55753b(0x17c);async['execute'](_0x4a84e3){const _0xec86fc=a24_0x55753b,{options:_0x373bdf,args:_0x4599d9,tdx:_0x5cbb27}=_0x4a84e3;if(_0x4599d9[_0xec86fc(0x16f)]===0x0)return console[_0xec86fc(0x179)](_0xec86fc(0x182)),console['error']('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),0x1;const _0x2f8cc8=_0x4599d9[0x0];_0x373bdf[_0xec86fc(0x17e)]&&(console[_0xec86fc(0x179)](_0xec86fc(0x172)+_0x373bdf[_0xec86fc(0x17d)]),console[_0xec86fc(0x179)](_0xec86fc(0x170)+_0x2f8cc8));const _0x5629ef=await withSpinner(_0xec86fc(0x16e)+_0x2f8cc8+_0xec86fc(0x180),()=>_0x5cbb27['segment'][_0xec86fc(0x17f)](_0x2f8cc8),{'verbose':_0x373bdf[_0xec86fc(0x17e)]}),_0x376559=_0x5629ef[_0xec86fc(0x16d)];return console[_0xec86fc(0x179)]('✔\x20Found\x20'+_0x376559[_0xec86fc(0x16f)]+_0xec86fc(0x173)+(_0x376559[_0xec86fc(0x16f)]!==0x1?'s':'')),await handleSDKOutput(_0x376559,_0x373bdf),0x0;}}
1
+ const a24_0x5329d7=a24_0x2560;(function(_0x114485,_0x310943){const _0x1881d1=a24_0x2560,_0x3b5dd6=_0x114485();while(!![]){try{const _0x2dec3f=parseInt(_0x1881d1(0x1e4))/0x1*(parseInt(_0x1881d1(0x1e1))/0x2)+parseInt(_0x1881d1(0x1e8))/0x3*(-parseInt(_0x1881d1(0x1f7))/0x4)+parseInt(_0x1881d1(0x1f3))/0x5+-parseInt(_0x1881d1(0x1eb))/0x6+-parseInt(_0x1881d1(0x1ea))/0x7+parseInt(_0x1881d1(0x1e2))/0x8+parseInt(_0x1881d1(0x1f1))/0x9;if(_0x2dec3f===_0x310943)break;else _0x3b5dd6['push'](_0x3b5dd6['shift']());}catch(_0x2a0c3c){_0x3b5dd6['push'](_0x3b5dd6['shift']());}}}(a24_0x4132,0x6a7fa));function a24_0x4132(){const _0x1fe830=['Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','✔\x20Found\x20','length','476488yWHdvz','verbose','Parent\x20segment:\x20','Site:\x20','32816rsuSwQ','5049392TRRlaK','site','8dQQDzn','execute','error','listFields','15qeaBRb','segment:fields','520275QXoIRW','4457274RwBEUm','List\x20available\x20fields\x20for\x20segmentation','\x27...','segment','name','data','8542125vRsbdl','\x20field','687345kmWuUP'];a24_0x4132=function(){return _0x1fe830;};return a24_0x4132();}import{BaseCommand}from'./command.js';function a24_0x2560(_0x1da7b9,_0x2a59d6){const _0x413246=a24_0x4132();return a24_0x2560=function(_0x2560f0,_0x3ad551){_0x2560f0=_0x2560f0-0x1e0;let _0x412e87=_0x413246[_0x2560f0];return _0x412e87;},a24_0x2560(_0x1da7b9,_0x2a59d6);}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{[a24_0x5329d7(0x1ef)]=a24_0x5329d7(0x1e9);['description']=a24_0x5329d7(0x1ec);async[a24_0x5329d7(0x1e5)](_0x411011){const _0x34d5f4=a24_0x5329d7,{options:_0x3be565,args:_0x1bc5e0,tdx:_0x2897bc}=_0x411011;if(_0x1bc5e0[_0x34d5f4(0x1f6)]===0x0)return console[_0x34d5f4(0x1e6)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x34d5f4(0x1e6)](_0x34d5f4(0x1f4)),0x1;const _0x451a1b=_0x1bc5e0[0x0];_0x3be565[_0x34d5f4(0x1f8)]&&(console['error'](_0x34d5f4(0x1e0)+_0x3be565[_0x34d5f4(0x1e3)]),console[_0x34d5f4(0x1e6)](_0x34d5f4(0x1f9)+_0x451a1b));const _0x557274=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x451a1b+_0x34d5f4(0x1ed),()=>_0x2897bc[_0x34d5f4(0x1ee)][_0x34d5f4(0x1e7)](_0x451a1b),{'verbose':_0x3be565['verbose']}),_0x8584=_0x557274[_0x34d5f4(0x1f0)];return console[_0x34d5f4(0x1e6)](_0x34d5f4(0x1f5)+_0x8584['length']+_0x34d5f4(0x1f2)+(_0x8584[_0x34d5f4(0x1f6)]!==0x1?'s':'')),await handleSDKOutput(_0x8584,_0x3be565),0x0;}}
@@ -1 +1 @@
1
- const a25_0x532977=a25_0x181a;(function(_0x176155,_0x55db85){const _0x265582=a25_0x181a,_0x450897=_0x176155();while(!![]){try{const _0x42f612=parseInt(_0x265582(0x1a2))/0x1*(parseInt(_0x265582(0x1b2))/0x2)+-parseInt(_0x265582(0x1a3))/0x3*(parseInt(_0x265582(0x1aa))/0x4)+parseInt(_0x265582(0x19b))/0x5*(parseInt(_0x265582(0x1a4))/0x6)+-parseInt(_0x265582(0x1a9))/0x7+parseInt(_0x265582(0x1ae))/0x8+-parseInt(_0x265582(0x1a6))/0x9*(-parseInt(_0x265582(0x19e))/0xa)+parseInt(_0x265582(0x1b1))/0xb*(-parseInt(_0x265582(0x1a0))/0xc);if(_0x42f612===_0x55db85)break;else _0x450897['push'](_0x450897['shift']());}catch(_0x6f1da7){_0x450897['push'](_0x450897['shift']());}}}(a25_0x1194,0x5c57a));function a25_0x1194(){const _0x32c842=['22ogMRMq','segmentPath','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','jsonl','\x20\x20Path:\x20','705JPiUmL','Show\x20current\x20segment/folder\x20context','description','210lvYoke','name','9253644WctedG','execute','26582TdPrlk','5112VCKSOW','31506iqQPuL','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','94644SqXcpr','verbose','log','1601012ESzvPM','412KNlqhd','stringify','error','format','2399760IVQKAr','root','json','11URlCKu'];a25_0x1194=function(){return _0x32c842;};return a25_0x1194();}import{BaseCommand}from'./command.js';function a25_0x181a(_0xe0cb5a,_0x4ed44e){const _0x1194a5=a25_0x1194();return a25_0x181a=function(_0x181a44,_0x1f9f64){_0x181a44=_0x181a44-0x198;let _0xda6cc4=_0x1194a5[_0x181a44];return _0xda6cc4;},a25_0x181a(_0xe0cb5a,_0x4ed44e);}export class SegmentPwdCommand extends BaseCommand{[a25_0x532977(0x19f)]='segment:pwd';[a25_0x532977(0x19d)]=a25_0x532977(0x19c);async[a25_0x532977(0x1a1)](_0x551ee6){const _0x29cb20=a25_0x532977,{options:_0x1b0c92}=_0x551ee6;try{const _0x62594a=_0x1b0c92[_0x29cb20(0x1b3)];if(!_0x62594a)return _0x1b0c92[_0x29cb20(0x1ad)]==='json'||_0x1b0c92['format']===_0x29cb20(0x199)?console[_0x29cb20(0x1a8)](JSON[_0x29cb20(0x1ab)]({'path':'/','type':_0x29cb20(0x1af)})):console[_0x29cb20(0x1a8)]('/'),0x0;if(_0x1b0c92[_0x29cb20(0x1ad)]===_0x29cb20(0x1b0)||_0x1b0c92[_0x29cb20(0x1ad)]===_0x29cb20(0x199)){const _0x124dae={'path':_0x62594a};console[_0x29cb20(0x1a8)](JSON['stringify'](_0x124dae));}else console[_0x29cb20(0x1a8)](_0x62594a),_0x1b0c92[_0x29cb20(0x1a7)]&&(console[_0x29cb20(0x1ac)](''),console[_0x29cb20(0x1ac)]('Context\x20details:'),console['error'](_0x29cb20(0x19a)+_0x62594a),console[_0x29cb20(0x1ac)](''),console[_0x29cb20(0x1ac)](_0x29cb20(0x198)),console['error'](_0x29cb20(0x1a5)));return 0x0;}catch(_0x3d0b21){throw _0x3d0b21;}}}
1
+ const a25_0x20f662=a25_0x5207;(function(_0x4e9130,_0x27bfd1){const _0x4db32b=a25_0x5207,_0x1aa8f0=_0x4e9130();while(!![]){try{const _0xc7dd91=parseInt(_0x4db32b(0x1d7))/0x1*(-parseInt(_0x4db32b(0x1d3))/0x2)+parseInt(_0x4db32b(0x1c9))/0x3+parseInt(_0x4db32b(0x1cb))/0x4+-parseInt(_0x4db32b(0x1cc))/0x5*(parseInt(_0x4db32b(0x1c8))/0x6)+parseInt(_0x4db32b(0x1dc))/0x7+parseInt(_0x4db32b(0x1ce))/0x8+parseInt(_0x4db32b(0x1d8))/0x9*(-parseInt(_0x4db32b(0x1da))/0xa);if(_0xc7dd91===_0x27bfd1)break;else _0x1aa8f0['push'](_0x1aa8f0['shift']());}catch(_0x2f71bd){_0x1aa8f0['push'](_0x1aa8f0['shift']());}}}(a25_0x9798,0x4b4ae));function a25_0x5207(_0x5399f1,_0x42ca3f){const _0x9798af=a25_0x9798();return a25_0x5207=function(_0x52070f,_0x268f6a){_0x52070f=_0x52070f-0x1c8;let _0x4f7c6c=_0x9798af[_0x52070f];return _0x4f7c6c;},a25_0x5207(_0x5399f1,_0x42ca3f);}import{BaseCommand}from'./command.js';function a25_0x9798(){const _0x4a34a1=['root','3417799NIcsDT','format','json','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','jsonl','730326kRFKDi','1718961tAMMMy','segmentPath','1933028phIvtN','5JktmxR','name','683560NXoygP','segment:pwd','Context\x20details:','log','error','103198xevIOB','description','execute','\x20\x20Path:\x20','3zrMMfW','315WplnBe','stringify','298580EZgBBc'];a25_0x9798=function(){return _0x4a34a1;};return a25_0x9798();}export class SegmentPwdCommand extends BaseCommand{[a25_0x20f662(0x1cd)]=a25_0x20f662(0x1cf);[a25_0x20f662(0x1d4)]='Show\x20current\x20segment/folder\x20context';async[a25_0x20f662(0x1d5)](_0x2760ac){const _0x2115fb=a25_0x20f662,{options:_0x1d6317}=_0x2760ac;try{const _0x3904ad=_0x1d6317[_0x2115fb(0x1ca)];if(!_0x3904ad)return _0x1d6317[_0x2115fb(0x1dd)]===_0x2115fb(0x1de)||_0x1d6317['format']===_0x2115fb(0x1e0)?console[_0x2115fb(0x1d1)](JSON[_0x2115fb(0x1d9)]({'path':'/','type':_0x2115fb(0x1db)})):console[_0x2115fb(0x1d1)]('/'),0x0;if(_0x1d6317[_0x2115fb(0x1dd)]===_0x2115fb(0x1de)||_0x1d6317['format']===_0x2115fb(0x1e0)){const _0x5a10be={'path':_0x3904ad};console[_0x2115fb(0x1d1)](JSON['stringify'](_0x5a10be));}else console[_0x2115fb(0x1d1)](_0x3904ad),_0x1d6317['verbose']&&(console[_0x2115fb(0x1d2)](''),console[_0x2115fb(0x1d2)](_0x2115fb(0x1d0)),console['error'](_0x2115fb(0x1d6)+_0x3904ad),console[_0x2115fb(0x1d2)](''),console[_0x2115fb(0x1d2)]('Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters'),console[_0x2115fb(0x1d2)](_0x2115fb(0x1df)));return 0x0;}catch(_0x58714f){throw _0x58714f;}}}
@@ -1 +1 @@
1
- const a26_0x156149=a26_0x4e2e;(function(_0x2cba2b,_0x167b05){const _0x2ca9c3=a26_0x4e2e,_0x18776c=_0x2cba2b();while(!![]){try{const _0x465fe0=parseInt(_0x2ca9c3(0x146))/0x1*(parseInt(_0x2ca9c3(0x142))/0x2)+-parseInt(_0x2ca9c3(0x14a))/0x3+parseInt(_0x2ca9c3(0x14c))/0x4+-parseInt(_0x2ca9c3(0x13e))/0x5*(parseInt(_0x2ca9c3(0x15d))/0x6)+parseInt(_0x2ca9c3(0x143))/0x7*(-parseInt(_0x2ca9c3(0x160))/0x8)+parseInt(_0x2ca9c3(0x151))/0x9+parseInt(_0x2ca9c3(0x153))/0xa;if(_0x465fe0===_0x167b05)break;else _0x18776c['push'](_0x18776c['shift']());}catch(_0x3d1a33){_0x18776c['push'](_0x18776c['shift']());}}}(a26_0x124a,0xc8f1a));import{BaseCommand}from'./command.js';function a26_0x124a(){const _0x1c0746=['INTERNAL','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','rule','2223775aUMCho','error','type','segmentPath','6URGnWO','2115239OVNCAZ','Resolved\x20folder\x20ID:\x20','Resolving\x20path\x20\x27','50001tcWHhz','Update\x20existing\x20child\x20segment','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Updating\x20segment\x20\x27','790503TytEKK','kind','661128HqTwYn','description','resolvePathToResource','ruleFile','data','5175729sbVHeg','length','9431330AXNSkK','Error:\x20Cannot\x20update\x20','Examples:','verbose','segment:update','Segment\x20ID:\x20','folder','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Resolved\x20type:\x20','segment','6KNQzxz','name','segmentName','8htSRGt','Resolving\x20folder\x20\x27','parentId','updateSegmentById','segmentId','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','\x27...'];a26_0x124a=function(){return _0x1c0746;};return a26_0x124a();}function a26_0x4e2e(_0x3f0c31,_0x2623b4){const _0x124ae5=a26_0x124a();return a26_0x4e2e=function(_0x4e2e53,_0x2b5960){_0x4e2e53=_0x4e2e53-0x137;let _0x25f2eb=_0x124ae5[_0x4e2e53];return _0x25f2eb;},a26_0x4e2e(_0x3f0c31,_0x2623b4);}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{[a26_0x156149(0x15e)]=a26_0x156149(0x157);[a26_0x156149(0x14d)]=a26_0x156149(0x147);async['execute'](_0x4466f8){const _0x1d50b0=a26_0x156149,{options:_0x514ca1,args:_0x5f0dd2,tdx:_0x341869}=_0x4466f8,_0x196808=_0x514ca1;if(_0x5f0dd2[_0x1d50b0(0x152)]===0x0)return console[_0x1d50b0(0x13f)](_0x1d50b0(0x148)),console['error'](_0x1d50b0(0x138)),console[_0x1d50b0(0x13f)](_0x1d50b0(0x155)),console[_0x1d50b0(0x13f)](_0x1d50b0(0x13c)),console[_0x1d50b0(0x13f)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x19d515=_0x5f0dd2[0x0],_0x49412a=_0x514ca1[_0x1d50b0(0x141)];let _0x36c5a4=_0x19d515;_0x49412a&&!_0x19d515['includes']('/')&&(_0x36c5a4=_0x49412a+'/'+_0x19d515,_0x196808[_0x1d50b0(0x156)]&&console[_0x1d50b0(0x13f)](_0x1d50b0(0x13b)+_0x36c5a4));const _0x6a6e5d=await withSpinner(_0x1d50b0(0x145)+_0x36c5a4+_0x1d50b0(0x139),()=>_0x341869[_0x1d50b0(0x15c)][_0x1d50b0(0x14e)](_0x36c5a4),{'verbose':_0x196808['verbose']}),_0xf14ed6=_0x6a6e5d[_0x1d50b0(0x150)];_0x196808[_0x1d50b0(0x156)]&&console['error'](_0x1d50b0(0x15b)+_0xf14ed6[_0x1d50b0(0x140)]);if(_0xf14ed6[_0x1d50b0(0x140)]!==_0x1d50b0(0x15c))return console['error'](_0x1d50b0(0x154)+_0xf14ed6[_0x1d50b0(0x140)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x1d50b0(0x13f)](_0x1d50b0(0x15a)),0x1;if(!_0xf14ed6[_0x1d50b0(0x137)])throw new SDKError(ErrorCode[_0x1d50b0(0x13a)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x32e91e=_0xf14ed6[_0x1d50b0(0x162)],_0x104c3e=_0xf14ed6[_0x1d50b0(0x137)];_0x196808['verbose']&&(console[_0x1d50b0(0x13f)]('Parent\x20ID:\x20'+_0x32e91e),console[_0x1d50b0(0x13f)](_0x1d50b0(0x158)+_0x104c3e));let _0x24a484;if(_0x196808[_0x1d50b0(0x159)]){const _0x69d2eb=_0x196808['folder'],_0x1b82b1=await withSpinner(_0x1d50b0(0x161)+_0x69d2eb+'\x27...',()=>_0x341869[_0x1d50b0(0x15c)]['resolveFolderId'](_0x32e91e,_0x69d2eb),{'verbose':_0x196808[_0x1d50b0(0x156)]});_0x24a484=parseInt(_0x1b82b1[_0x1d50b0(0x150)],0xa),_0x196808[_0x1d50b0(0x156)]&&console['error'](_0x1d50b0(0x144)+_0x24a484);}const _0x4ac034=await loadJSONFromOptions(_0x196808[_0x1d50b0(0x13d)],_0x196808[_0x1d50b0(0x14f)]),_0x2801ca={'name':_0x196808[_0x1d50b0(0x15e)],'description':_0x196808[_0x1d50b0(0x14d)],'rule':_0x4ac034,'kind':_0x196808['kind']!==undefined?parseInt(_0x196808[_0x1d50b0(0x14b)],0xa):undefined,'segmentFolderId':_0x24a484},_0x12635d=await withSpinner(_0x1d50b0(0x149)+_0xf14ed6[_0x1d50b0(0x15f)]+_0x1d50b0(0x139),()=>_0x341869['segment'][_0x1d50b0(0x163)](_0x32e91e,_0x104c3e,_0x2801ca),{'verbose':_0x196808['verbose']}),_0x129961=_0x12635d['data'];return console[_0x1d50b0(0x13f)]('✔\x20Updated\x20segment\x20\x27'+_0x129961[_0x1d50b0(0x15e)]+'\x27'),_0x36c5a4!==_0x19d515&&console[_0x1d50b0(0x13f)]('\x20\x20\x20Path:\x20'+_0x36c5a4),await handleSDKOutput([_0x129961],_0x196808),0x0;}}
1
+ const a26_0x3cd972=a26_0x55c7;(function(_0x191788,_0x6b95c1){const _0x557f3a=a26_0x55c7,_0xba089b=_0x191788();while(!![]){try{const _0x28c6be=-parseInt(_0x557f3a(0x171))/0x1+-parseInt(_0x557f3a(0x167))/0x2*(-parseInt(_0x557f3a(0x14d))/0x3)+-parseInt(_0x557f3a(0x157))/0x4*(parseInt(_0x557f3a(0x169))/0x5)+parseInt(_0x557f3a(0x158))/0x6+parseInt(_0x557f3a(0x16e))/0x7+parseInt(_0x557f3a(0x16b))/0x8*(parseInt(_0x557f3a(0x168))/0x9)+-parseInt(_0x557f3a(0x174))/0xa;if(_0x28c6be===_0x6b95c1)break;else _0xba089b['push'](_0xba089b['shift']());}catch(_0x27ebb1){_0xba089b['push'](_0xba089b['shift']());}}}(a26_0x1548,0x438d1));import{BaseCommand}from'./command.js';function a26_0x1548(){const _0x64d201=['kind','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','length','updateSegmentById','execute','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','name','Segment\x20ID:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','data','1059006LduWUJ','63kOxjRF','2360VJhoIr','includes','141080TGDEqD','folder','Update\x20existing\x20child\x20segment','1797999DCeIhJ','✔\x20Updated\x20segment\x20\x27','Error:\x20Cannot\x20update\x20','503129IFOSij','rule','Examples:','365210XpqUau','\x27...','description','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segmentId','Resolved\x20folder\x20ID:\x20','3lDXNIf','Resolved\x20type:\x20','Updating\x20segment\x20\x27','error','parentId','Resolving\x20folder\x20\x27','Parent\x20ID:\x20','segmentName','segment','type','4148ynwkrh','2375988ozbeRN','verbose','INTERNAL','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','\x20\x20\x20Path:\x20'];a26_0x1548=function(){return _0x64d201;};return a26_0x1548();}import{handleSDKOutput}from'../utils/command-output.js';function a26_0x55c7(_0x2467b6,_0x5c3d37){const _0x1548a7=a26_0x1548();return a26_0x55c7=function(_0x55c75f,_0x4f36a3){_0x55c75f=_0x55c75f-0x14d;let _0x5d3ee6=_0x1548a7[_0x55c75f];return _0x5d3ee6;},a26_0x55c7(_0x2467b6,_0x5c3d37);}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{[a26_0x3cd972(0x163)]='segment:update';['description']=a26_0x3cd972(0x16d);async[a26_0x3cd972(0x161)](_0x314c44){const _0x2dd5e7=a26_0x3cd972,{options:_0x30070c,args:_0x1d62ca,tdx:_0x1213ac}=_0x314c44,_0x48d990=_0x30070c;if(_0x1d62ca[_0x2dd5e7(0x15f)]===0x0)return console['error'](_0x2dd5e7(0x177)),console[_0x2dd5e7(0x150)](_0x2dd5e7(0x15b)),console[_0x2dd5e7(0x150)](_0x2dd5e7(0x173)),console[_0x2dd5e7(0x150)](_0x2dd5e7(0x15e)),console[_0x2dd5e7(0x150)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x19e233=_0x1d62ca[0x0],_0x2ef3eb=_0x30070c['segmentPath'];let _0x1ea9e9=_0x19e233;_0x2ef3eb&&!_0x19e233[_0x2dd5e7(0x16a)]('/')&&(_0x1ea9e9=_0x2ef3eb+'/'+_0x19e233,_0x48d990[_0x2dd5e7(0x159)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x1ea9e9));const _0x3d3d80=await withSpinner('Resolving\x20path\x20\x27'+_0x1ea9e9+'\x27...',()=>_0x1213ac['segment']['resolvePathToResource'](_0x1ea9e9),{'verbose':_0x48d990['verbose']}),_0xc820b4=_0x3d3d80['data'];_0x48d990[_0x2dd5e7(0x159)]&&console[_0x2dd5e7(0x150)](_0x2dd5e7(0x14e)+_0xc820b4[_0x2dd5e7(0x156)]);if(_0xc820b4[_0x2dd5e7(0x156)]!==_0x2dd5e7(0x155))return console[_0x2dd5e7(0x150)](_0x2dd5e7(0x170)+_0xc820b4[_0x2dd5e7(0x156)]+_0x2dd5e7(0x162)),console['error']('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0xc820b4['segmentId'])throw new SDKError(ErrorCode[_0x2dd5e7(0x15a)],_0x2dd5e7(0x165));const _0x54a9bf=_0xc820b4[_0x2dd5e7(0x151)],_0x429a6a=_0xc820b4[_0x2dd5e7(0x178)];_0x48d990[_0x2dd5e7(0x159)]&&(console[_0x2dd5e7(0x150)](_0x2dd5e7(0x153)+_0x54a9bf),console[_0x2dd5e7(0x150)](_0x2dd5e7(0x164)+_0x429a6a));let _0x24b871;if(_0x48d990[_0x2dd5e7(0x16c)]){const _0x4e212c=_0x48d990[_0x2dd5e7(0x16c)],_0x3805e3=await withSpinner(_0x2dd5e7(0x152)+_0x4e212c+_0x2dd5e7(0x175),()=>_0x1213ac[_0x2dd5e7(0x155)]['resolveFolderId'](_0x54a9bf,_0x4e212c),{'verbose':_0x48d990['verbose']});_0x24b871=parseInt(_0x3805e3[_0x2dd5e7(0x166)],0xa),_0x48d990[_0x2dd5e7(0x159)]&&console[_0x2dd5e7(0x150)](_0x2dd5e7(0x179)+_0x24b871);}const _0x36fa5c=await loadJSONFromOptions(_0x48d990[_0x2dd5e7(0x172)],_0x48d990['ruleFile']),_0x1ae0cd={'name':_0x48d990[_0x2dd5e7(0x163)],'description':_0x48d990[_0x2dd5e7(0x176)],'rule':_0x36fa5c,'kind':_0x48d990[_0x2dd5e7(0x15d)]!==undefined?parseInt(_0x48d990[_0x2dd5e7(0x15d)],0xa):undefined,'segmentFolderId':_0x24b871},_0x13e072=await withSpinner(_0x2dd5e7(0x14f)+_0xc820b4[_0x2dd5e7(0x154)]+_0x2dd5e7(0x175),()=>_0x1213ac[_0x2dd5e7(0x155)][_0x2dd5e7(0x160)](_0x54a9bf,_0x429a6a,_0x1ae0cd),{'verbose':_0x48d990[_0x2dd5e7(0x159)]}),_0x5afc32=_0x13e072[_0x2dd5e7(0x166)];return console[_0x2dd5e7(0x150)](_0x2dd5e7(0x16f)+_0x5afc32[_0x2dd5e7(0x163)]+'\x27'),_0x1ea9e9!==_0x19e233&&console[_0x2dd5e7(0x150)](_0x2dd5e7(0x15c)+_0x1ea9e9),await handleSDKOutput([_0x5afc32],_0x48d990),0x0;}}
@@ -1 +1 @@
1
- function a27_0xb566(_0x26837e,_0x252558){const _0x26d3d9=a27_0x26d3();return a27_0xb566=function(_0xb566d1,_0x47f7bc){_0xb566d1=_0xb566d1-0x195;let _0x4327b8=_0x26d3d9[_0xb566d1];return _0x4327b8;},a27_0xb566(_0x26837e,_0x252558);}const a27_0x45ba9c=a27_0xb566;(function(_0x2c2f3b,_0x79f54c){const _0x4da0dd=a27_0xb566,_0x492dd5=_0x2c2f3b();while(!![]){try{const _0x2d0aa1=-parseInt(_0x4da0dd(0x198))/0x1+parseInt(_0x4da0dd(0x197))/0x2+-parseInt(_0x4da0dd(0x19c))/0x3+parseInt(_0x4da0dd(0x1a9))/0x4*(parseInt(_0x4da0dd(0x19b))/0x5)+-parseInt(_0x4da0dd(0x1a5))/0x6*(-parseInt(_0x4da0dd(0x1bc))/0x7)+parseInt(_0x4da0dd(0x199))/0x8*(-parseInt(_0x4da0dd(0x1b0))/0x9)+parseInt(_0x4da0dd(0x1ba))/0xa*(-parseInt(_0x4da0dd(0x1b6))/0xb);if(_0x2d0aa1===_0x79f54c)break;else _0x492dd5['push'](_0x492dd5['shift']());}catch(_0x4add94){_0x492dd5['push'](_0x492dd5['shift']());}}}(a27_0x26d3,0x3af04));function a27_0x26d3(){const _0x4e1641=['7prNinl','fullPath','length','Context\x20set\x20to:\x20','type','Error:\x20Path\x20is\x20required','folderPath','execute','name','join','session','split','604532cLRRiq','158929JzdyXZ','24ASfyex','Resolving\x20path\x20\x27','1756210CQVntk','55470hekvXV','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Folder\x20ID:\x20','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','resolvePathToResource','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','error','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','1986834zOKyUw','Resolved\x20relative\x20path\x20to:\x20','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Parent\x20ID:\x20','4dgmVph','slice','verbose','Usage:\x20tdx\x20segment\x20use\x20<path>','Use:\x20tdx\x20segment\x20use\x20','log','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','1439595qFFzIL','Context\x20cleared.\x20Back\x20to\x20root.','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','folderId','parentName','Target\x20path:\x20','407ahsaDW','segment:use','segmentPath','segment','23230xriZbv','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'];a27_0x26d3=function(){return _0x4e1641;};return a27_0x26d3();}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';export class SegmentUseCommand extends BaseCommand{[a27_0x45ba9c(0x1c4)]=a27_0x45ba9c(0x1b7);['description']=a27_0x45ba9c(0x1a7);async[a27_0x45ba9c(0x1c3)](_0x1aca81){const _0x36b10f=a27_0x45ba9c,{options:_0x1f2775,args:_0x19f7c6,tdx:_0x5ba384}=_0x1aca81;if(_0x19f7c6[_0x36b10f(0x1be)]===0x0)return console[_0x36b10f(0x1a2)](_0x36b10f(0x1c1)),console[_0x36b10f(0x1a2)](_0x36b10f(0x1ac)),console[_0x36b10f(0x1a2)]('Examples:'),console[_0x36b10f(0x1a2)](_0x36b10f(0x19d)),console[_0x36b10f(0x1a2)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console[_0x36b10f(0x1a2)](_0x36b10f(0x1bb)),console['error'](_0x36b10f(0x1b2)),0x1;const _0x503ae3=_0x19f7c6[0x0],_0x15b7b5=_0x1f2775[_0x36b10f(0x195)];try{if(_0x503ae3==='/')return saveSessionContext({'segment_path':undefined},_0x15b7b5),console[_0x36b10f(0x1ae)](_0x36b10f(0x1b1)),0x0;const _0x3f6294=_0x1f2775[_0x36b10f(0x1b8)];let _0x2171f5=_0x503ae3;const _0x2d3d7d=parsePath(_0x503ae3);if(!_0x2d3d7d['isAbsolute']){if(!_0x3f6294)return console[_0x36b10f(0x1a2)](_0x36b10f(0x1af)),console['error']('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>'),0x1;if(_0x503ae3==='..'){const _0x1f4fb7=_0x3f6294[_0x36b10f(0x196)]('/')[_0x36b10f(0x1aa)](0x0,-0x1)[_0x36b10f(0x1c5)]('/');_0x2171f5=_0x1f4fb7||'/';}else _0x503ae3==='.'?_0x2171f5=_0x3f6294:_0x2171f5=_0x3f6294+'/'+_0x503ae3;_0x1f2775[_0x36b10f(0x1ab)]&&console[_0x36b10f(0x1a2)](_0x36b10f(0x1a6)+_0x2171f5);}if(_0x2171f5==='/'||_0x2171f5==='')return saveSessionContext({'segment_path':undefined},_0x15b7b5),console[_0x36b10f(0x1ae)](_0x36b10f(0x1b1)),0x0;_0x2171f5=normalizePath(_0x2171f5);const _0x3581b0=parsePath(_0x2171f5)['segments'];if(_0x3581b0[_0x36b10f(0x1be)]===0x0)return saveSessionContext({'segment_path':undefined},_0x15b7b5),console[_0x36b10f(0x1ae)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;_0x1f2775[_0x36b10f(0x1ab)]&&(console[_0x36b10f(0x1a2)]('Site:\x20'+_0x1f2775['site']),console['error'](_0x36b10f(0x1b5)+_0x2171f5));const _0x1b0922=await withSpinner(_0x36b10f(0x19a)+_0x2171f5+'\x27...',()=>_0x5ba384[_0x36b10f(0x1b9)][_0x36b10f(0x1a0)](_0x2171f5),{'verbose':_0x1f2775[_0x36b10f(0x1ab)]}),_0x56047e=_0x1b0922['data'];_0x1f2775[_0x36b10f(0x1ab)]&&(console[_0x36b10f(0x1a2)]('Resolved\x20path\x20type:\x20'+_0x56047e[_0x36b10f(0x1c0)]),console[_0x36b10f(0x1a2)](_0x36b10f(0x1a8)+_0x56047e['parentId']),_0x56047e[_0x36b10f(0x1b3)]&&console[_0x36b10f(0x1a2)](_0x36b10f(0x19e)+_0x56047e['folderId']));if(_0x56047e[_0x36b10f(0x1c0)]===_0x36b10f(0x1b9))return console[_0x36b10f(0x1a2)](_0x36b10f(0x1a4)),console[_0x36b10f(0x1a2)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console['error'](_0x36b10f(0x1ad)+_0x56047e[_0x36b10f(0x1b4)]+(_0x56047e[_0x36b10f(0x1c2)]?'/'+_0x56047e[_0x36b10f(0x1c2)]['join']('/'):'')),0x1;return saveSessionContext({'segment_path':_0x56047e[_0x36b10f(0x1bd)],'parent_segment':_0x56047e[_0x36b10f(0x1b4)]},_0x15b7b5),console[_0x36b10f(0x1ae)](_0x36b10f(0x1bf)+_0x56047e[_0x36b10f(0x1bd)]),_0x1f2775[_0x36b10f(0x1ab)]&&(console[_0x36b10f(0x1a2)](_0x36b10f(0x19f)),console[_0x36b10f(0x1a2)](_0x36b10f(0x1a1)),console[_0x36b10f(0x1a2)](_0x36b10f(0x1a3))),0x0;}catch(_0x52f297){throw _0x52f297;}}}
1
+ const a27_0x8348b4=a27_0x4c00;(function(_0x203811,_0x4b286d){const _0x590c4c=a27_0x4c00,_0x1390eb=_0x203811();while(!![]){try{const _0x213332=-parseInt(_0x590c4c(0x8f))/0x1+-parseInt(_0x590c4c(0x97))/0x2+parseInt(_0x590c4c(0x7d))/0x3+-parseInt(_0x590c4c(0x7e))/0x4+-parseInt(_0x590c4c(0x80))/0x5+parseInt(_0x590c4c(0x92))/0x6*(parseInt(_0x590c4c(0x71))/0x7)+parseInt(_0x590c4c(0x75))/0x8;if(_0x213332===_0x4b286d)break;else _0x1390eb['push'](_0x1390eb['shift']());}catch(_0x3e7627){_0x1390eb['push'](_0x1390eb['shift']());}}}(a27_0x20df,0x483ea));function a27_0x20df(){const _0x2cc423=['folderId','64044ZkniAy','1711348DweyWH','segments','56240Ljcwke','split','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','description','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','execute','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','length','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','parentName','session','folderPath','Use:\x20tdx\x20segment\x20use\x20','segment','498462bfysis','Resolved\x20path\x20type:\x20','log','6eMiGYm','site','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','Usage:\x20tdx\x20segment\x20use\x20<path>','fullPath','38466UjTWfK','Examples:','data','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Error:\x20Path\x20is\x20required','join','segmentPath','error','Resolved\x20relative\x20path\x20to:\x20','slice','Context\x20set\x20to:\x20','resolvePathToResource','verbose','isAbsolute','424571avqvuP','Target\x20path:\x20','Context\x20cleared.\x20Back\x20to\x20root.','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','9365544QSROBq','Parent\x20ID:\x20','\x27...','type','parentId','Resolving\x20path\x20\x27','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>'];a27_0x20df=function(){return _0x2cc423;};return a27_0x20df();}function a27_0x4c00(_0x4957da,_0x6a2fc4){const _0x20df7f=a27_0x20df();return a27_0x4c00=function(_0x4c00d8,_0x5b4025){_0x4c00d8=_0x4c00d8-0x68;let _0x2ee101=_0x20df7f[_0x4c00d8];return _0x2ee101;},a27_0x4c00(_0x4957da,_0x6a2fc4);}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']='segment:use';[a27_0x8348b4(0x83)]=a27_0x8348b4(0x86);async[a27_0x8348b4(0x85)](_0x53dab0){const _0x38bf41=a27_0x8348b4,{options:_0x4aabdc,args:_0x46c390,tdx:_0x850414}=_0x53dab0;if(_0x46c390[_0x38bf41(0x88)]===0x0)return console[_0x38bf41(0x6a)](_0x38bf41(0x9c)),console['error'](_0x38bf41(0x95)),console[_0x38bf41(0x6a)](_0x38bf41(0x98)),console['error'](_0x38bf41(0x9a)),console[_0x38bf41(0x6a)](_0x38bf41(0x87)),console[_0x38bf41(0x6a)](_0x38bf41(0x82)),console[_0x38bf41(0x6a)](_0x38bf41(0x74)),0x1;const _0x56caef=_0x46c390[0x0],_0x164f39=_0x4aabdc[_0x38bf41(0x8b)];try{if(_0x56caef==='/')return saveSessionContext({'segment_path':undefined},_0x164f39),console[_0x38bf41(0x91)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;const _0x53c32e=_0x4aabdc[_0x38bf41(0x69)];let _0x4e990b=_0x56caef;const _0x521396=parsePath(_0x56caef);if(!_0x521396[_0x38bf41(0x70)]){if(!_0x53c32e)return console[_0x38bf41(0x6a)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.'),console[_0x38bf41(0x6a)](_0x38bf41(0x7b)),0x1;if(_0x56caef==='..'){const _0x25f060=_0x53c32e[_0x38bf41(0x81)]('/')[_0x38bf41(0x6c)](0x0,-0x1)[_0x38bf41(0x68)]('/');_0x4e990b=_0x25f060||'/';}else _0x56caef==='.'?_0x4e990b=_0x53c32e:_0x4e990b=_0x53c32e+'/'+_0x56caef;_0x4aabdc[_0x38bf41(0x6f)]&&console[_0x38bf41(0x6a)](_0x38bf41(0x6b)+_0x4e990b);}if(_0x4e990b==='/'||_0x4e990b==='')return saveSessionContext({'segment_path':undefined},_0x164f39),console[_0x38bf41(0x91)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;_0x4e990b=normalizePath(_0x4e990b);const _0x39952c=parsePath(_0x4e990b)[_0x38bf41(0x7f)];if(_0x39952c[_0x38bf41(0x88)]===0x0)return saveSessionContext({'segment_path':undefined},_0x164f39),console[_0x38bf41(0x91)](_0x38bf41(0x73)),0x0;_0x4aabdc['verbose']&&(console[_0x38bf41(0x6a)]('Site:\x20'+_0x4aabdc[_0x38bf41(0x93)]),console[_0x38bf41(0x6a)](_0x38bf41(0x72)+_0x4e990b));const _0x3f9449=await withSpinner(_0x38bf41(0x7a)+_0x4e990b+_0x38bf41(0x77),()=>_0x850414[_0x38bf41(0x8e)][_0x38bf41(0x6e)](_0x4e990b),{'verbose':_0x4aabdc[_0x38bf41(0x6f)]}),_0x12ce0e=_0x3f9449[_0x38bf41(0x99)];_0x4aabdc['verbose']&&(console[_0x38bf41(0x6a)](_0x38bf41(0x90)+_0x12ce0e[_0x38bf41(0x78)]),console[_0x38bf41(0x6a)](_0x38bf41(0x76)+_0x12ce0e[_0x38bf41(0x79)]),_0x12ce0e['folderId']&&console[_0x38bf41(0x6a)]('Folder\x20ID:\x20'+_0x12ce0e[_0x38bf41(0x7c)]));if(_0x12ce0e[_0x38bf41(0x78)]===_0x38bf41(0x8e))return console['error'](_0x38bf41(0x9b)),console[_0x38bf41(0x6a)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x38bf41(0x6a)](_0x38bf41(0x8d)+_0x12ce0e[_0x38bf41(0x8a)]+(_0x12ce0e[_0x38bf41(0x8c)]?'/'+_0x12ce0e[_0x38bf41(0x8c)][_0x38bf41(0x68)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x12ce0e['fullPath'],'parent_segment':_0x12ce0e[_0x38bf41(0x8a)]},_0x164f39),console[_0x38bf41(0x91)](_0x38bf41(0x6d)+_0x12ce0e[_0x38bf41(0x96)]),_0x4aabdc[_0x38bf41(0x6f)]&&(console['error'](_0x38bf41(0x89)),console[_0x38bf41(0x6a)](_0x38bf41(0x84)),console[_0x38bf41(0x6a)](_0x38bf41(0x94))),0x0;}catch(_0x1ea298){throw _0x1ea298;}}}
@@ -1 +1 @@
1
- function a28_0x4b6f(_0x501b05,_0x433bfc){const _0x12122a=a28_0x1212();return a28_0x4b6f=function(_0x4b6f0a,_0x3c7b15){_0x4b6f0a=_0x4b6f0a-0xa5;let _0x331c5d=_0x12122a[_0x4b6f0a];return _0x331c5d;},a28_0x4b6f(_0x501b05,_0x433bfc);}const a28_0x431420=a28_0x4b6f;(function(_0xa40aee,_0x448cac){const _0x131f42=a28_0x4b6f,_0x388bd6=_0xa40aee();while(!![]){try{const _0x815037=parseInt(_0x131f42(0xdd))/0x1+parseInt(_0x131f42(0xd7))/0x2+-parseInt(_0x131f42(0xc0))/0x3*(-parseInt(_0x131f42(0xd4))/0x4)+-parseInt(_0x131f42(0xa7))/0x5*(parseInt(_0x131f42(0xa6))/0x6)+parseInt(_0x131f42(0xc3))/0x7+parseInt(_0x131f42(0xc7))/0x8+-parseInt(_0x131f42(0xaa))/0x9;if(_0x815037===_0x448cac)break;else _0x388bd6['push'](_0x388bd6['shift']());}catch(_0x42c3f8){_0x388bd6['push'](_0x388bd6['shift']());}}}(a28_0x1212,0xa6dea));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';function a28_0x1212(){const _0x35f1cb=['error','attributes','210891IFvQwL','execute','jsonl','8269198vdQRpi','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','\x20segment','\x27...','123328lSDiKp','👥\x20','Building\x20hierarchy\x20tree...','listParents','dim','Error:\x20','[parent\x20segments]','Folder\x20ID:\x20','segments','map','site','sort','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','76cjlxGp','Listing\x20parent\x20segments...','verbose','1695200DdfNaq','resolvePathToResource','(empty)','Path/pattern\x20arg:\x20','\x20top-level\x20items','listParentsWithPattern','255959NmcmOg','listUnified','Listing\x20folders\x20and\x20segments...','format','segmentPath','listRecursive','\x20matching\x20\x27','length','Current\x20context:\x20','cause','log','228lPyizQ','87860PVNOUr','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','Recursive\x20mode:\x20enabled','20562282MsCEAF','segment','population','✔\x20Found\x20','json','folderId','Listing\x20parent\x20segments\x20matching\x20\x27','folder','replace','name','message','includes','filter','data','\x20\x20Cause:\x20','Site:\x20','test','Parent\x20ID:\x20','localeCompare','parentId'];a28_0x1212=function(){return _0x35f1cb;};return a28_0x1212();}import{formatRows}from'../utils/formatters.js';import a28_0x3b2069 from'chalk';export class SegmentsCommand extends BaseCommand{[a28_0x431420(0xb3)]=a28_0x431420(0xcf);['description']=a28_0x431420(0xc4);async[a28_0x431420(0xc1)](_0x29a58b){const _0x3bbdf0=a28_0x431420,{options:_0x1b9450,args:_0x499edb}=_0x29a58b,_0xf2b418=_0x1b9450['recursive'],_0x3f94fe=_0x499edb[0x0];try{const _0x49ba91=_0x1b9450[_0x3bbdf0(0xe1)];_0x1b9450['verbose']&&(console[_0x3bbdf0(0xbe)](_0x3bbdf0(0xb9)+_0x1b9450[_0x3bbdf0(0xd1)]),console[_0x3bbdf0(0xbe)](_0x3bbdf0(0xe5)+(_0x49ba91||'/')),_0x3f94fe&&console[_0x3bbdf0(0xbe)](_0x3bbdf0(0xda)+_0x3f94fe),_0xf2b418&&console[_0x3bbdf0(0xbe)](_0x3bbdf0(0xa9)));if(_0x3f94fe){const _0x4837ae=_0x3f94fe[_0x3bbdf0(0xb5)]('*')||_0x3f94fe[_0x3bbdf0(0xb5)]('?');if(_0x4837ae&&!_0x49ba91)return await this[_0x3bbdf0(0xdc)](_0x29a58b,_0x3f94fe);else return _0x4837ae?(console['error'](_0x3bbdf0(0xa8)),console['error'](_0x3bbdf0(0xd3)),0x1):_0xf2b418?await this[_0x3bbdf0(0xe2)](_0x29a58b,_0x3f94fe):await this[_0x3bbdf0(0xde)](_0x29a58b,_0x3f94fe);}if(!_0x49ba91)return await this[_0x3bbdf0(0xca)](_0x29a58b);return _0xf2b418?await this[_0x3bbdf0(0xe2)](_0x29a58b,_0x49ba91):await this['listUnified'](_0x29a58b,_0x49ba91);}catch(_0x1be689){if(_0x1be689 instanceof SDKError)return console[_0x3bbdf0(0xbe)](_0x3bbdf0(0xcc)+_0x1be689[_0x3bbdf0(0xb4)]),_0x1be689[_0x3bbdf0(0xe6)]&&console['error'](_0x3bbdf0(0xb8)+_0x1be689[_0x3bbdf0(0xe6)]),0x1;throw _0x1be689;}}async[a28_0x431420(0xdc)](_0x4b7c31,_0x713a64){const _0x2a58b9=a28_0x431420,{options:_0x26810f,tdx:_0x2a3d64}=_0x4b7c31,_0x583898=await withSpinner(_0x2a58b9(0xb0)+_0x713a64+_0x2a58b9(0xc6),()=>_0x2a3d64['segment'][_0x2a58b9(0xca)](),{'verbose':_0x26810f[_0x2a58b9(0xd6)]}),_0x4bf466=_0x583898[_0x2a58b9(0xb7)],_0x47483c=_0x713a64[_0x2a58b9(0xb2)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x2a58b9(0xb2)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x16d38e=new RegExp('^'+_0x47483c+'$','i'),_0x5605ab=_0x4bf466[_0x2a58b9(0xb6)](_0x54f47b=>_0x16d38e[_0x2a58b9(0xba)](_0x54f47b[_0x2a58b9(0xbf)][_0x2a58b9(0xb3)]));console[_0x2a58b9(0xbe)](_0x2a58b9(0xad)+_0x5605ab[_0x2a58b9(0xe4)]+'\x20parent\x20segment'+(_0x5605ab[_0x2a58b9(0xe4)]!==0x1?'s':'')+_0x2a58b9(0xe3)+_0x713a64+'\x27');if(_0x26810f[_0x2a58b9(0xe0)]==='json'||_0x26810f[_0x2a58b9(0xe0)]===_0x2a58b9(0xc2))await handleSDKOutput(_0x5605ab,_0x26810f);else{if(_0x5605ab['length']===0x0)console[_0x2a58b9(0xa5)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x713a64);else{console['log'](_0x2a58b9(0xcd));for(const _0x3e48b8 of _0x5605ab){const _0x26f94f=_0x3e48b8[_0x2a58b9(0xbf)]['population']?a28_0x3b2069[_0x2a58b9(0xcb)]('\x20('+formatRows(_0x3e48b8[_0x2a58b9(0xbf)][_0x2a58b9(0xac)])+')'):'';console[_0x2a58b9(0xa5)](_0x2a58b9(0xc8)+_0x3e48b8['attributes']['name']+_0x26f94f);}}}return 0x0;}async['listParents'](_0x412eac){const _0x592155=a28_0x431420,{options:_0x37278e,tdx:_0x243f03}=_0x412eac,_0x1a2c2d=await withSpinner(_0x592155(0xd5),()=>_0x243f03[_0x592155(0xab)]['listParents'](),{'verbose':_0x37278e[_0x592155(0xd6)]}),_0x39e30e=_0x1a2c2d[_0x592155(0xb7)];console['error']('✔\x20Found\x20'+_0x39e30e[_0x592155(0xe4)]+'\x20parent\x20segment'+(_0x39e30e[_0x592155(0xe4)]!==0x1?'s':''));if(_0x37278e[_0x592155(0xe0)]===_0x592155(0xae)||_0x37278e['format']==='jsonl')await handleSDKOutput(_0x39e30e,_0x37278e);else{console[_0x592155(0xa5)](_0x592155(0xcd));for(const _0x49d718 of _0x39e30e){const _0x2c20c0=_0x49d718['attributes'][_0x592155(0xac)]?a28_0x3b2069[_0x592155(0xcb)]('\x20('+formatRows(_0x49d718[_0x592155(0xbf)][_0x592155(0xac)])+')'):'';console[_0x592155(0xa5)]('👥\x20'+_0x49d718[_0x592155(0xbf)][_0x592155(0xb3)]+_0x2c20c0);}}return 0x0;}async[a28_0x431420(0xde)](_0x35403c,_0x4bc16a){const _0x5e6c73=a28_0x431420,{options:_0x3c8f71,tdx:_0x1c7713}=_0x35403c,_0x3ecc10=await withSpinner('Resolving\x20context\x20path\x20\x27'+_0x4bc16a+_0x5e6c73(0xc6),()=>_0x1c7713[_0x5e6c73(0xab)][_0x5e6c73(0xd8)](_0x4bc16a),{'verbose':_0x3c8f71['verbose']}),_0x43512a=_0x3ecc10[_0x5e6c73(0xb7)];_0x3c8f71[_0x5e6c73(0xd6)]&&(console[_0x5e6c73(0xbe)](_0x5e6c73(0xbb)+_0x43512a[_0x5e6c73(0xbd)]),_0x43512a[_0x5e6c73(0xaf)]&&console[_0x5e6c73(0xbe)](_0x5e6c73(0xce)+_0x43512a[_0x5e6c73(0xaf)]));const _0x114c03=await withSpinner(_0x5e6c73(0xdf),()=>_0x1c7713[_0x5e6c73(0xab)][_0x5e6c73(0xde)](_0x43512a[_0x5e6c73(0xbd)],_0x43512a['folderId']),{'verbose':_0x3c8f71[_0x5e6c73(0xd6)]}),{folders:_0x2935c4,segments:_0xbcf2eb}=_0x114c03[_0x5e6c73(0xb7)],_0x1d1b82=_0x2935c4[_0x5e6c73(0xe4)]+_0xbcf2eb[_0x5e6c73(0xe4)];console[_0x5e6c73(0xbe)](_0x5e6c73(0xad)+_0x2935c4[_0x5e6c73(0xe4)]+'\x20folder'+(_0x2935c4[_0x5e6c73(0xe4)]!==0x1?'s':'')+'\x20and\x20'+_0xbcf2eb[_0x5e6c73(0xe4)]+_0x5e6c73(0xc5)+(_0xbcf2eb[_0x5e6c73(0xe4)]!==0x1?'s':''));if(_0x3c8f71[_0x5e6c73(0xe0)]===_0x5e6c73(0xae)||_0x3c8f71['format']==='jsonl'){const _0x4d72f5=[..._0x2935c4[_0x5e6c73(0xd0)](_0x34dbf2=>({..._0x34dbf2,'type':_0x5e6c73(0xb1)})),..._0xbcf2eb[_0x5e6c73(0xd0)](_0x4ec4bf=>({..._0x4ec4bf,'type':_0x5e6c73(0xab)}))][_0x5e6c73(0xd2)]((_0x3d7b93,_0x4297b6)=>_0x3d7b93[_0x5e6c73(0xb3)][_0x5e6c73(0xbc)](_0x4297b6[_0x5e6c73(0xb3)]));await handleSDKOutput(_0x4d72f5,_0x3c8f71);}else{if(_0x1d1b82===0x0)console[_0x5e6c73(0xa5)](a28_0x3b2069[_0x5e6c73(0xcb)]('[/'+_0x4bc16a+']')),console[_0x5e6c73(0xa5)](_0x5e6c73(0xd9));else{console[_0x5e6c73(0xa5)](a28_0x3b2069['dim']('[/'+_0x4bc16a+']'));const _0x1e7ef9=formatFlatList(_0x2935c4,_0xbcf2eb,{'showMetadata':!![]});console[_0x5e6c73(0xa5)](_0x1e7ef9);}}return 0x0;}async[a28_0x431420(0xe2)](_0x2c2a5f,_0x4c4bdc){const _0x1ecda8=a28_0x431420,{options:_0xb4f6a0,tdx:_0x4d955b}=_0x2c2a5f,_0x36e1a8=await withSpinner('Resolving\x20context\x20path\x20\x27'+_0x4c4bdc+'\x27...',()=>_0x4d955b['segment'][_0x1ecda8(0xd8)](_0x4c4bdc),{'verbose':_0xb4f6a0['verbose']}),_0x476d26=_0x36e1a8[_0x1ecda8(0xb7)];_0xb4f6a0[_0x1ecda8(0xd6)]&&(console['error'](_0x1ecda8(0xbb)+_0x476d26[_0x1ecda8(0xbd)]),_0x476d26[_0x1ecda8(0xaf)]&&console[_0x1ecda8(0xbe)](_0x1ecda8(0xce)+_0x476d26['folderId']));const _0x50a3c2=_0xb4f6a0['maxDepth']||0xa,_0x3b3295=await withSpinner(_0x1ecda8(0xc9),()=>_0x4d955b['segment'][_0x1ecda8(0xe2)](_0x476d26[_0x1ecda8(0xbd)],_0x476d26['folderId'],0x0,_0x50a3c2),{'verbose':_0xb4f6a0[_0x1ecda8(0xd6)]}),_0x1e282b=_0x3b3295['data'];console[_0x1ecda8(0xbe)]('✔\x20Built\x20tree\x20with\x20'+_0x1e282b['length']+_0x1ecda8(0xdb));if(_0xb4f6a0[_0x1ecda8(0xe0)]===_0x1ecda8(0xae)||_0xb4f6a0[_0x1ecda8(0xe0)]===_0x1ecda8(0xc2))await handleSDKOutput(_0x1e282b,_0xb4f6a0);else{console[_0x1ecda8(0xa5)](a28_0x3b2069[_0x1ecda8(0xcb)]('[/'+_0x4c4bdc+']'));const _0x1a0bfb=formatTree(_0x1e282b,{'showMetadata':!![]});console[_0x1ecda8(0xa5)](_0x1a0bfb);}return 0x0;}}
1
+ const a28_0x5c2266=a28_0x39ed;function a28_0x39ed(_0x537bbe,_0x3ea9f3){const _0x5a06c9=a28_0x5a06();return a28_0x39ed=function(_0x39ed6f,_0x12fab2){_0x39ed6f=_0x39ed6f-0x104;let _0x295459=_0x5a06c9[_0x39ed6f];return _0x295459;},a28_0x39ed(_0x537bbe,_0x3ea9f3);}(function(_0x33e92e,_0x497abd){const _0x33e3ee=a28_0x39ed,_0x2ef7ad=_0x33e92e();while(!![]){try{const _0x48ff57=parseInt(_0x33e3ee(0x121))/0x1+-parseInt(_0x33e3ee(0x127))/0x2+-parseInt(_0x33e3ee(0x140))/0x3*(-parseInt(_0x33e3ee(0x10e))/0x4)+parseInt(_0x33e3ee(0x13d))/0x5*(-parseInt(_0x33e3ee(0x145))/0x6)+parseInt(_0x33e3ee(0x128))/0x7*(-parseInt(_0x33e3ee(0x10f))/0x8)+-parseInt(_0x33e3ee(0x12c))/0x9*(-parseInt(_0x33e3ee(0x133))/0xa)+-parseInt(_0x33e3ee(0x148))/0xb*(-parseInt(_0x33e3ee(0x123))/0xc);if(_0x48ff57===_0x497abd)break;else _0x2ef7ad['push'](_0x2ef7ad['shift']());}catch(_0x3c8ca4){_0x2ef7ad['push'](_0x2ef7ad['shift']());}}}(a28_0x5a06,0x7fd9c));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';import a28_0x6bbc90 from'chalk';export class SegmentsCommand extends BaseCommand{[a28_0x5c2266(0x107)]=a28_0x5c2266(0x106);[a28_0x5c2266(0x12a)]=a28_0x5c2266(0x12e);async[a28_0x5c2266(0x10c)](_0x5ca625){const _0x3d6bf0=a28_0x5c2266,{options:_0x2b805e,args:_0xb18279}=_0x5ca625,_0x5b1193=_0x2b805e[_0x3d6bf0(0x117)],_0x14dd2f=_0xb18279[0x0];try{const _0x5b7d7b=_0x2b805e[_0x3d6bf0(0x13e)];_0x2b805e[_0x3d6bf0(0x13a)]&&(console[_0x3d6bf0(0x138)]('Site:\x20'+_0x2b805e[_0x3d6bf0(0x10a)]),console[_0x3d6bf0(0x138)](_0x3d6bf0(0x122)+(_0x5b7d7b||'/')),_0x14dd2f&&console[_0x3d6bf0(0x138)](_0x3d6bf0(0x111)+_0x14dd2f),_0x5b1193&&console[_0x3d6bf0(0x138)](_0x3d6bf0(0x12b)));if(_0x14dd2f){const _0x301993=_0x14dd2f[_0x3d6bf0(0x146)]('*')||_0x14dd2f[_0x3d6bf0(0x146)]('?');if(_0x301993&&!_0x5b7d7b)return await this[_0x3d6bf0(0x118)](_0x5ca625,_0x14dd2f);else return _0x301993?(console[_0x3d6bf0(0x138)]('Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).'),console[_0x3d6bf0(0x138)](_0x3d6bf0(0x12f)),0x1):_0x5b1193?await this[_0x3d6bf0(0x109)](_0x5ca625,_0x14dd2f):await this[_0x3d6bf0(0x120)](_0x5ca625,_0x14dd2f);}if(!_0x5b7d7b)return await this[_0x3d6bf0(0x129)](_0x5ca625);return _0x5b1193?await this[_0x3d6bf0(0x109)](_0x5ca625,_0x5b7d7b):await this[_0x3d6bf0(0x120)](_0x5ca625,_0x5b7d7b);}catch(_0x59d1ba){if(_0x59d1ba instanceof SDKError)return console['error']('Error:\x20'+_0x59d1ba[_0x3d6bf0(0x13f)]),_0x59d1ba[_0x3d6bf0(0x110)]&&console[_0x3d6bf0(0x138)](_0x3d6bf0(0x14a)+_0x59d1ba['cause']),0x1;throw _0x59d1ba;}}async[a28_0x5c2266(0x118)](_0xdcea58,_0x344111){const _0x3c6f9a=a28_0x5c2266,{options:_0x4002ab,tdx:_0x7436c5}=_0xdcea58,_0x9a0cfe=await withSpinner(_0x3c6f9a(0x13c)+_0x344111+_0x3c6f9a(0x119),()=>_0x7436c5[_0x3c6f9a(0x141)][_0x3c6f9a(0x129)](),{'verbose':_0x4002ab[_0x3c6f9a(0x13a)]}),_0xc7a196=_0x9a0cfe[_0x3c6f9a(0x114)],_0x106449=_0x344111[_0x3c6f9a(0x126)](/[.+^${}()|[\]\\]/g,_0x3c6f9a(0x149))[_0x3c6f9a(0x126)](/\*/g,'.*')[_0x3c6f9a(0x126)](/\?/g,'.'),_0x5885a9=new RegExp('^'+_0x106449+'$','i'),_0x4f9ef2=_0xc7a196[_0x3c6f9a(0x11d)](_0x3ae503=>_0x5885a9['test'](_0x3ae503[_0x3c6f9a(0x113)][_0x3c6f9a(0x107)]));console[_0x3c6f9a(0x138)]('✔\x20Found\x20'+_0x4f9ef2[_0x3c6f9a(0x131)]+_0x3c6f9a(0x104)+(_0x4f9ef2[_0x3c6f9a(0x131)]!==0x1?'s':'')+_0x3c6f9a(0x11b)+_0x344111+'\x27');if(_0x4002ab[_0x3c6f9a(0x130)]===_0x3c6f9a(0x124)||_0x4002ab['format']===_0x3c6f9a(0x137))await handleSDKOutput(_0x4f9ef2,_0x4002ab);else{if(_0x4f9ef2['length']===0x0)console[_0x3c6f9a(0x11e)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x344111);else{console[_0x3c6f9a(0x11e)](_0x3c6f9a(0x147));for(const _0x4f8e3c of _0x4f9ef2){const _0x47f047=_0x4f8e3c[_0x3c6f9a(0x113)][_0x3c6f9a(0x139)]?a28_0x6bbc90[_0x3c6f9a(0x13b)]('\x20('+formatRows(_0x4f8e3c[_0x3c6f9a(0x113)]['population'])+')'):'';console[_0x3c6f9a(0x11e)]('👥\x20'+_0x4f8e3c[_0x3c6f9a(0x113)][_0x3c6f9a(0x107)]+_0x47f047);}}}return 0x0;}async[a28_0x5c2266(0x129)](_0x265b87){const _0x4bf4b2=a28_0x5c2266,{options:_0x5f346d,tdx:_0x27131c}=_0x265b87,_0xcea1af=await withSpinner(_0x4bf4b2(0x142),()=>_0x27131c[_0x4bf4b2(0x141)]['listParents'](),{'verbose':_0x5f346d[_0x4bf4b2(0x13a)]}),_0x28ad6b=_0xcea1af[_0x4bf4b2(0x114)];console[_0x4bf4b2(0x138)](_0x4bf4b2(0x116)+_0x28ad6b['length']+_0x4bf4b2(0x104)+(_0x28ad6b[_0x4bf4b2(0x131)]!==0x1?'s':''));if(_0x5f346d['format']===_0x4bf4b2(0x124)||_0x5f346d['format']==='jsonl')await handleSDKOutput(_0x28ad6b,_0x5f346d);else{console[_0x4bf4b2(0x11e)](_0x4bf4b2(0x147));for(const _0x52170a of _0x28ad6b){const _0x3f8447=_0x52170a[_0x4bf4b2(0x113)]['population']?a28_0x6bbc90[_0x4bf4b2(0x13b)]('\x20('+formatRows(_0x52170a[_0x4bf4b2(0x113)][_0x4bf4b2(0x139)])+')'):'';console[_0x4bf4b2(0x11e)]('👥\x20'+_0x52170a['attributes'][_0x4bf4b2(0x107)]+_0x3f8447);}}return 0x0;}async[a28_0x5c2266(0x120)](_0x98f116,_0x556130){const _0x10b7c5=a28_0x5c2266,{options:_0x4fd90b,tdx:_0x5507b5}=_0x98f116,_0x11bf62=await withSpinner(_0x10b7c5(0x11c)+_0x556130+'\x27...',()=>_0x5507b5[_0x10b7c5(0x141)]['resolvePathToResource'](_0x556130),{'verbose':_0x4fd90b[_0x10b7c5(0x13a)]}),_0x77c79e=_0x11bf62['data'];_0x4fd90b[_0x10b7c5(0x13a)]&&(console['error'](_0x10b7c5(0x135)+_0x77c79e[_0x10b7c5(0x134)]),_0x77c79e[_0x10b7c5(0x11f)]&&console[_0x10b7c5(0x138)](_0x10b7c5(0x105)+_0x77c79e[_0x10b7c5(0x11f)]));const _0x41ba8e=await withSpinner(_0x10b7c5(0x10d),()=>_0x5507b5['segment']['listUnified'](_0x77c79e[_0x10b7c5(0x134)],_0x77c79e[_0x10b7c5(0x11f)]),{'verbose':_0x4fd90b['verbose']}),{folders:_0x992c0f,segments:_0x22afff}=_0x41ba8e[_0x10b7c5(0x114)],_0x351327=_0x992c0f[_0x10b7c5(0x131)]+_0x22afff[_0x10b7c5(0x131)];console[_0x10b7c5(0x138)](_0x10b7c5(0x116)+_0x992c0f['length']+_0x10b7c5(0x10b)+(_0x992c0f[_0x10b7c5(0x131)]!==0x1?'s':'')+_0x10b7c5(0x12d)+_0x22afff[_0x10b7c5(0x131)]+_0x10b7c5(0x11a)+(_0x22afff['length']!==0x1?'s':''));if(_0x4fd90b[_0x10b7c5(0x130)]===_0x10b7c5(0x124)||_0x4fd90b[_0x10b7c5(0x130)]===_0x10b7c5(0x137)){const _0x413ce6=[..._0x992c0f[_0x10b7c5(0x136)](_0x4b7379=>({..._0x4b7379,'type':_0x10b7c5(0x143)})),..._0x22afff['map'](_0x43e15e=>({..._0x43e15e,'type':_0x10b7c5(0x141)}))][_0x10b7c5(0x125)]((_0x101a10,_0x39015c)=>_0x101a10[_0x10b7c5(0x107)]['localeCompare'](_0x39015c[_0x10b7c5(0x107)]));await handleSDKOutput(_0x413ce6,_0x4fd90b);}else{if(_0x351327===0x0)console['log'](a28_0x6bbc90[_0x10b7c5(0x13b)]('[/'+_0x556130+']')),console[_0x10b7c5(0x11e)](_0x10b7c5(0x115));else{console[_0x10b7c5(0x11e)](a28_0x6bbc90[_0x10b7c5(0x13b)]('[/'+_0x556130+']'));const _0x26059b=formatFlatList(_0x992c0f,_0x22afff,{'showMetadata':!![]});console['log'](_0x26059b);}}return 0x0;}async[a28_0x5c2266(0x109)](_0x1cbb1f,_0x43cf4c){const _0x15f754=a28_0x5c2266,{options:_0x3506e3,tdx:_0x1bda1a}=_0x1cbb1f,_0x1e75bd=await withSpinner(_0x15f754(0x11c)+_0x43cf4c+_0x15f754(0x119),()=>_0x1bda1a[_0x15f754(0x141)][_0x15f754(0x108)](_0x43cf4c),{'verbose':_0x3506e3[_0x15f754(0x13a)]}),_0x2f6b58=_0x1e75bd['data'];_0x3506e3['verbose']&&(console[_0x15f754(0x138)]('Parent\x20ID:\x20'+_0x2f6b58[_0x15f754(0x134)]),_0x2f6b58[_0x15f754(0x11f)]&&console['error'](_0x15f754(0x105)+_0x2f6b58[_0x15f754(0x11f)]));const _0x422f86=_0x3506e3[_0x15f754(0x112)]||0xa,_0x17f3b6=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x1bda1a[_0x15f754(0x141)]['listRecursive'](_0x2f6b58[_0x15f754(0x134)],_0x2f6b58['folderId'],0x0,_0x422f86),{'verbose':_0x3506e3[_0x15f754(0x13a)]}),_0x5696e4=_0x17f3b6[_0x15f754(0x114)];console[_0x15f754(0x138)](_0x15f754(0x144)+_0x5696e4[_0x15f754(0x131)]+_0x15f754(0x132));if(_0x3506e3[_0x15f754(0x130)]===_0x15f754(0x124)||_0x3506e3[_0x15f754(0x130)]===_0x15f754(0x137))await handleSDKOutput(_0x5696e4,_0x3506e3);else{console[_0x15f754(0x11e)](a28_0x6bbc90[_0x15f754(0x13b)]('[/'+_0x43cf4c+']'));const _0xd29824=formatTree(_0x5696e4,{'showMetadata':!![]});console[_0x15f754(0x11e)](_0xd29824);}return 0x0;}}function a28_0x5a06(){const _0xbdd31b=['(empty)','✔\x20Found\x20','recursive','listParentsWithPattern','\x27...','\x20segment','\x20matching\x20\x27','Resolving\x20context\x20path\x20\x27','filter','log','folderId','listUnified','14068mlnofE','Current\x20context:\x20','65676ewWzwm','json','sort','replace','1583318JVvhqO','7XXdkWC','listParents','description','Recursive\x20mode:\x20enabled','8497278UjjOQB','\x20and\x20','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','format','length','\x20top-level\x20items','10SoaFxi','parentId','Parent\x20ID:\x20','map','jsonl','error','population','verbose','dim','Listing\x20parent\x20segments\x20matching\x20\x27','3722855nbXxLf','segmentPath','message','1122DikmYo','segment','Listing\x20parent\x20segments...','folder','✔\x20Built\x20tree\x20with\x20','6JRULtD','includes','[parent\x20segments]','1045yJEGYT','\x5c$&','\x20\x20Cause:\x20','\x20parent\x20segment','Folder\x20ID:\x20','segments','name','resolvePathToResource','listRecursive','site','\x20folder','execute','Listing\x20folders\x20and\x20segments...','9840cYyhnh','2706232UdJwnZ','cause','Path/pattern\x20arg:\x20','maxDepth','attributes','data'];a28_0x5a06=function(){return _0xbdd31b;};return a28_0x5a06();}
@@ -1 +1 @@
1
- function a29_0x5b22(){const _0x706248=['table','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','...','9524kmwKaF','✔\x20Retrieved\x20','Site:\x20','show','message','name','Catalog:\x20','Table:\x20','Show\x20table\x20contents','4579078bNHEuh','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','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','database','\x20from\x20','642642wIuUnq','catalog','795210dexOAq','validate','1215136lPEOMx','args','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','894doKHre','execute','Error:\x20','length','Usage:\x20tdx\x20show\x20<database.table>','1825722ZPtSAN','35NgIywl','772080tHDQvs','cause','site','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','Database:\x20','verbose','error'];a29_0x5b22=function(){return _0x706248;};return a29_0x5b22();}const a29_0x2f0303=a29_0x278c;(function(_0x33e10e,_0x449cf1){const _0x21bf97=a29_0x278c,_0x4ff0b7=_0x33e10e();while(!![]){try{const _0x2cdb7a=parseInt(_0x21bf97(0x15f))/0x1+parseInt(_0x21bf97(0x163))/0x2+-parseInt(_0x21bf97(0x166))/0x3*(-parseInt(_0x21bf97(0x177))/0x4)+parseInt(_0x21bf97(0x16c))/0x5*(-parseInt(_0x21bf97(0x161))/0x6)+-parseInt(_0x21bf97(0x15a))/0x7+parseInt(_0x21bf97(0x16d))/0x8+parseInt(_0x21bf97(0x16b))/0x9;if(_0x2cdb7a===_0x449cf1)break;else _0x4ff0b7['push'](_0x4ff0b7['shift']());}catch(_0x2ca31f){_0x4ff0b7['push'](_0x4ff0b7['shift']());}}}(a29_0x5b22,0xa5561));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';import{withSpinner}from'../utils/spinner.js';function a29_0x278c(_0x4c194e,_0x386870){const _0x5b22e3=a29_0x5b22();return a29_0x278c=function(_0x278c6f,_0x2d0573){_0x278c6f=_0x278c6f-0x153;let _0x30711e=_0x5b22e3[_0x278c6f];return _0x30711e;},a29_0x278c(_0x4c194e,_0x386870);}export class ShowCommand extends BaseCommand{[a29_0x2f0303(0x156)]='show';['description']=a29_0x2f0303(0x159);async[a29_0x2f0303(0x167)](_0x461b18){return this['showTable'](_0x461b18);}async['showTable'](_0x521b5c){const _0x73c251=a29_0x2f0303,{options:_0x35bbba,args:_0x204d91,tdx:_0xe854bd}=_0x521b5c;let _0x235cb4;try{_0x235cb4=parseTableReference(_0x204d91[0x0]);const _0x281c93=_0x35bbba[_0x73c251(0x15d)];!_0x235cb4[_0x73c251(0x15d)]&&_0x281c93&&(_0x235cb4['database']=_0x281c93);const _0x55a693=validateTableDescribeReference(_0x235cb4);if(_0x55a693)return console[_0x73c251(0x173)](_0x73c251(0x168)+_0x55a693),console[_0x73c251(0x173)](_0x73c251(0x16a)),console[_0x73c251(0x173)](_0x73c251(0x170)),console[_0x73c251(0x173)](_0x73c251(0x175)),0x1;}catch(_0x3a3c8a){return console[_0x73c251(0x173)](_0x73c251(0x168)+_0x3a3c8a[_0x73c251(0x155)]),console[_0x73c251(0x173)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x73c251(0x173)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x251c13=_0x235cb4[_0x73c251(0x160)],_0x44bc35=_0x235cb4[_0x73c251(0x15d)],_0x28591e=_0x235cb4[_0x73c251(0x174)],_0x5b08df=_0x35bbba['limit'];try{_0x35bbba['verbose']&&(console[_0x73c251(0x173)](_0x73c251(0x153)+_0x35bbba[_0x73c251(0x16f)]),_0x251c13&&console['error'](_0x73c251(0x157)+_0x251c13),console[_0x73c251(0x173)](_0x73c251(0x171)+_0x44bc35),console['error'](_0x73c251(0x158)+_0x28591e),console[_0x73c251(0x173)]('Limit:\x20'+_0x5b08df));const _0x38bcea=_0x251c13?_0x251c13+'.'+_0x44bc35+'.'+_0x28591e:_0x44bc35+'.'+_0x28591e,_0x4de46f=await withSpinner('Querying\x20'+_0x38bcea+_0x73c251(0x176),()=>_0xe854bd[_0x73c251(0x174)][_0x73c251(0x154)](_0x44bc35,_0x28591e,_0x5b08df,_0x251c13),{'verbose':_0x35bbba[_0x73c251(0x172)]}),_0x4321e5=_0x4de46f['data'],_0x8c00=_0x4321e5['data'];return _0x8c00[_0x73c251(0x169)]===0x0?console['error'](_0x73c251(0x15b)):console[_0x73c251(0x173)](_0x73c251(0x178)+_0x8c00[_0x73c251(0x169)]+'\x20row'+(_0x8c00[_0x73c251(0x169)]!==0x1?'s':'')+_0x73c251(0x15e)+_0x38bcea),await handleSDKOutput(_0x8c00,_0x35bbba),0x0;}catch(_0x57f97f){if(_0x57f97f instanceof SDKError)return console[_0x73c251(0x173)](_0x73c251(0x168)+_0x57f97f[_0x73c251(0x155)]),_0x57f97f[_0x73c251(0x16e)]&&console[_0x73c251(0x173)]('\x20\x20Cause:\x20'+_0x57f97f[_0x73c251(0x16e)]),0x1;throw _0x57f97f;}}[a29_0x2f0303(0x162)](_0x2301ad){const _0x1bcbb7=a29_0x2f0303;if(_0x2301ad[_0x1bcbb7(0x164)][_0x1bcbb7(0x169)]===0x0)return _0x1bcbb7(0x15c);if(_0x2301ad['args']['length']>0x1)return _0x1bcbb7(0x165);return undefined;}}
1
+ const a29_0x1ed28d=a29_0x1a92;(function(_0x20bbdf,_0x43265b){const _0x369a15=a29_0x1a92,_0x279ff0=_0x20bbdf();while(!![]){try{const _0x8f62a4=-parseInt(_0x369a15(0x1cd))/0x1+-parseInt(_0x369a15(0x1e3))/0x2+-parseInt(_0x369a15(0x1c6))/0x3+-parseInt(_0x369a15(0x1d0))/0x4*(parseInt(_0x369a15(0x1e1))/0x5)+-parseInt(_0x369a15(0x1dd))/0x6+parseInt(_0x369a15(0x1d8))/0x7+parseInt(_0x369a15(0x1e6))/0x8;if(_0x8f62a4===_0x43265b)break;else _0x279ff0['push'](_0x279ff0['shift']());}catch(_0x4ddbbe){_0x279ff0['push'](_0x279ff0['shift']());}}}(a29_0xd942,0xe753e));import{BaseCommand}from'./command.js';function a29_0x1a92(_0xb83a23,_0x5aef10){const _0xd94230=a29_0xd942();return a29_0x1a92=function(_0x1a9296,_0x5e3c0a){_0x1a9296=_0x1a9296-0x1c5;let _0x46e14f=_0xd94230[_0x1a9296];return _0x46e14f;},a29_0x1a92(_0xb83a23,_0x5aef10);}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a29_0xd942(){const _0x4fb2b7=['length','message','490856WeBKqi','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','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','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','data','verbose','description','show','4972450eYmoFL','Usage:\x20tdx\x20show\x20<database.table>','error','execute','database','6567360IFXFLf','✔\x20Retrieved\x20','...','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','50TtRvlw','Catalog:\x20','2530518MCtdVq','args','name','35497888GdNFOv','cause','\x20\x20Cause:\x20','validate','1298985LveKJR','Error:\x20','Site:\x20','Limit:\x20','showTable','table','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','180114rHBkvZ'];a29_0xd942=function(){return _0x4fb2b7;};return a29_0xd942();}import{withSpinner}from'../utils/spinner.js';export class ShowCommand extends BaseCommand{[a29_0x1ed28d(0x1e5)]='show';[a29_0x1ed28d(0x1d6)]='Show\x20table\x20contents';async[a29_0x1ed28d(0x1db)](_0x3f1900){const _0x56b62f=a29_0x1ed28d;return this[_0x56b62f(0x1ca)](_0x3f1900);}async['showTable'](_0x5872c3){const _0x1b0f3e=a29_0x1ed28d,{options:_0x2326cf,args:_0x300a4d,tdx:_0x34f8b1}=_0x5872c3;let _0x5a10a6;try{_0x5a10a6=parseTableReference(_0x300a4d[0x0]);const _0x49cde9=_0x2326cf[_0x1b0f3e(0x1dc)];!_0x5a10a6[_0x1b0f3e(0x1dc)]&&_0x49cde9&&(_0x5a10a6[_0x1b0f3e(0x1dc)]=_0x49cde9);const _0x240d76=validateTableDescribeReference(_0x5a10a6);if(_0x240d76)return console[_0x1b0f3e(0x1da)]('Error:\x20'+_0x240d76),console['error'](_0x1b0f3e(0x1d9)),console[_0x1b0f3e(0x1da)](_0x1b0f3e(0x1cc)),console[_0x1b0f3e(0x1da)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x57b5fe){return console['error'](_0x1b0f3e(0x1c7)+_0x57b5fe['message']),console[_0x1b0f3e(0x1da)](_0x1b0f3e(0x1d9)),console['error'](_0x1b0f3e(0x1cc)),console[_0x1b0f3e(0x1da)](_0x1b0f3e(0x1d3)),0x1;}const _0x1fd10f=_0x5a10a6['catalog'],_0x3c7e6f=_0x5a10a6[_0x1b0f3e(0x1dc)],_0x4bf580=_0x5a10a6[_0x1b0f3e(0x1cb)],_0x261382=_0x2326cf['limit'];try{_0x2326cf[_0x1b0f3e(0x1d5)]&&(console[_0x1b0f3e(0x1da)](_0x1b0f3e(0x1c8)+_0x2326cf['site']),_0x1fd10f&&console[_0x1b0f3e(0x1da)](_0x1b0f3e(0x1e2)+_0x1fd10f),console[_0x1b0f3e(0x1da)]('Database:\x20'+_0x3c7e6f),console['error']('Table:\x20'+_0x4bf580),console['error'](_0x1b0f3e(0x1c9)+_0x261382));const _0x4032a0=_0x1fd10f?_0x1fd10f+'.'+_0x3c7e6f+'.'+_0x4bf580:_0x3c7e6f+'.'+_0x4bf580,_0x17d031=await withSpinner('Querying\x20'+_0x4032a0+_0x1b0f3e(0x1df),()=>_0x34f8b1['table'][_0x1b0f3e(0x1d7)](_0x3c7e6f,_0x4bf580,_0x261382,_0x1fd10f),{'verbose':_0x2326cf[_0x1b0f3e(0x1d5)]}),_0x53db01=_0x17d031[_0x1b0f3e(0x1d4)],_0x308f32=_0x53db01['data'];return _0x308f32[_0x1b0f3e(0x1ce)]===0x0?console['error'](_0x1b0f3e(0x1e0)):console['error'](_0x1b0f3e(0x1de)+_0x308f32[_0x1b0f3e(0x1ce)]+'\x20row'+(_0x308f32['length']!==0x1?'s':'')+'\x20from\x20'+_0x4032a0),await handleSDKOutput(_0x308f32,_0x2326cf),0x0;}catch(_0x31d9d1){if(_0x31d9d1 instanceof SDKError)return console[_0x1b0f3e(0x1da)]('Error:\x20'+_0x31d9d1[_0x1b0f3e(0x1cf)]),_0x31d9d1[_0x1b0f3e(0x1e7)]&&console[_0x1b0f3e(0x1da)](_0x1b0f3e(0x1e8)+_0x31d9d1[_0x1b0f3e(0x1e7)]),0x1;throw _0x31d9d1;}}[a29_0x1ed28d(0x1c5)](_0x25db93){const _0x24430c=a29_0x1ed28d;if(_0x25db93[_0x24430c(0x1e4)]['length']===0x0)return _0x24430c(0x1d2);if(_0x25db93[_0x24430c(0x1e4)]['length']>0x1)return _0x24430c(0x1d1);return undefined;}}
@@ -1 +1 @@
1
- const a30_0x5b3315=a30_0x3eac;(function(_0x34a3f8,_0x5a7689){const _0x29cf75=a30_0x3eac,_0xf96673=_0x34a3f8();while(!![]){try{const _0x3712e9=-parseInt(_0x29cf75(0xde))/0x1*(parseInt(_0x29cf75(0xcf))/0x2)+parseInt(_0x29cf75(0xdd))/0x3*(parseInt(_0x29cf75(0xc7))/0x4)+parseInt(_0x29cf75(0xc4))/0x5+-parseInt(_0x29cf75(0xcb))/0x6*(-parseInt(_0x29cf75(0xdf))/0x7)+parseInt(_0x29cf75(0xe5))/0x8*(-parseInt(_0x29cf75(0xb8))/0x9)+parseInt(_0x29cf75(0xe1))/0xa+-parseInt(_0x29cf75(0xc1))/0xb;if(_0x3712e9===_0x5a7689)break;else _0xf96673['push'](_0xf96673['shift']());}catch(_0x3e189e){_0xf96673['push'](_0xf96673['shift']());}}}(a30_0x1437,0x69d78));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';function a30_0x3eac(_0x50965e,_0x42a74f){const _0x1437bd=a30_0x1437();return a30_0x3eac=function(_0x3eacc3,_0x18d77d){_0x3eacc3=_0x3eacc3-0xb7;let _0x367d32=_0x1437bd[_0x3eacc3];return _0x367d32;},a30_0x3eac(_0x50965e,_0x42a74f);}import{withSpinner}from'../utils/spinner.js';function a30_0x1437(){const _0x3c4054=['description','8nUPQkn','\x20table','367191DtVZdB','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','List\x20tables\x20in\x20a\x20database','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','\x27\x20is\x20ambiguous.','table','list','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','4504456otVazF','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','Or\x20use\x20--in\x20flag:','3332035bdqbbo','Listing\x20tables...','\x20\x20Cause:\x20','12GECFjh','Database:\x20','✔\x20Found\x20','verbose','12oDNbfz','includes','Error:\x20Pattern\x20\x27','✖\x20No\x20tables\x20found','36KBgNAc','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','length','Table\x20pattern:\x20','Error:\x20','name','site','database','message','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','Note:\x20\x27','.*\x22','Database\x20\x27','274269BjnPyX','47469fByxOG','577759wkDYWO','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','6325150zpJDZu','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','error'];a30_0x1437=function(){return _0x3c4054;};return a30_0x1437();}export class TablesCommand extends BaseCommand{[a30_0x5b3315(0xd5)]='tables';[a30_0x5b3315(0xe4)]=a30_0x5b3315(0xba);async['execute'](_0x140449){const _0x58af73=a30_0x5b3315,{options:_0x1dc3c3,args:_0x2fc09b,tdx:_0x35ffe3}=_0x140449;let _0x54f8d2;if(_0x2fc09b['length']===0x0)_0x54f8d2={'database':undefined,'table':undefined,'original':''};else{if(_0x2fc09b[_0x58af73(0xd2)]===0x1)try{_0x54f8d2=parseTableReference(_0x2fc09b[0x0]);if(_0x54f8d2[_0x58af73(0xbd)]&&!_0x54f8d2[_0x58af73(0xd7)]&&!_0x54f8d2[_0x58af73(0xbd)]['includes']('*')&&!_0x54f8d2[_0x58af73(0xbd)][_0x58af73(0xcc)]('?'))return console[_0x58af73(0xe3)](_0x58af73(0xcd)+_0x2fc09b[0x0]+_0x58af73(0xbc)),console[_0x58af73(0xe3)](_0x58af73(0xbb)+_0x54f8d2[_0x58af73(0xbd)]+'\x27?'),console['error']('\x20\x20Use:\x20tdx\x20tables\x20\x22'+_0x54f8d2[_0x58af73(0xbd)]+_0x58af73(0xdb)),console['error']('\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'+_0x54f8d2[_0x58af73(0xbd)]),console['error'](_0x58af73(0xd1)+_0x54f8d2['table']),console[_0x58af73(0xe3)](''),console[_0x58af73(0xe3)](_0x58af73(0xda)+_0x2fc09b[0x0]+_0x58af73(0xbf)+_0x54f8d2[_0x58af73(0xbd)]+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x3ea726){return console[_0x58af73(0xe3)](_0x58af73(0xd4)+_0x3ea726[_0x58af73(0xd8)]),0x1;}else return console[_0x58af73(0xe3)](_0x58af73(0xd9)),console[_0x58af73(0xe3)](_0x58af73(0xc2)),console['error'](_0x58af73(0xc0)),console[_0x58af73(0xe3)](_0x58af73(0xe2)),console['error'](_0x58af73(0xb9)),console[_0x58af73(0xe3)](_0x58af73(0xc3)),console[_0x58af73(0xe3)](_0x58af73(0xd0)),0x1;}const _0x13748e=_0x1dc3c3['database'];!_0x54f8d2[_0x58af73(0xd7)]&&_0x13748e&&(_0x54f8d2['database']=_0x13748e);try{const _0x3c7a0e=_0x2d5d4a=>_0x2d5d4a&&(_0x2d5d4a['includes']('*')||_0x2d5d4a[_0x58af73(0xcc)]('?')),_0xe03d4b=_0x3c7a0e(_0x54f8d2[_0x58af73(0xd7)]);_0x1dc3c3[_0x58af73(0xca)]&&(console[_0x58af73(0xe3)]('Site:\x20'+_0x1dc3c3[_0x58af73(0xd6)]),_0x54f8d2['database']?_0xe03d4b?console[_0x58af73(0xe3)]('Database\x20pattern:\x20'+_0x54f8d2[_0x58af73(0xd7)]):console[_0x58af73(0xe3)](_0x58af73(0xc8)+_0x54f8d2[_0x58af73(0xd7)]):console[_0x58af73(0xe3)]('Database:\x20all'),_0x54f8d2['table']&&console[_0x58af73(0xe3)](_0x58af73(0xd3)+_0x54f8d2['table']));const _0x30f36c=_0x54f8d2[_0x58af73(0xd7)]&&!_0xe03d4b?_0x54f8d2[_0x58af73(0xd7)]:undefined,_0x443121=_0xe03d4b?_0x54f8d2[_0x58af73(0xd7)]:undefined,_0x21dd24=_0x54f8d2[_0x58af73(0xbd)],_0x24832a=await withSpinner(_0x58af73(0xc5),()=>_0x35ffe3['table'][_0x58af73(0xbe)](_0x30f36c,_0x21dd24,_0x443121),{'verbose':_0x1dc3c3[_0x58af73(0xca)]}),_0x212f8b=_0x24832a['data'];if(_0x212f8b[_0x58af73(0xd2)]===0x0&&_0x54f8d2[_0x58af73(0xd7)]&&!_0xe03d4b)return console[_0x58af73(0xe3)](_0x58af73(0xce)),console[_0x58af73(0xe3)](_0x58af73(0xdc)+_0x54f8d2[_0x58af73(0xd7)]+_0x58af73(0xe0)),0x1;return console[_0x58af73(0xe3)](_0x58af73(0xc9)+_0x212f8b[_0x58af73(0xd2)]+_0x58af73(0xb7)+(_0x212f8b[_0x58af73(0xd2)]!==0x1?'s':'')),await handleSDKOutput(_0x212f8b,_0x1dc3c3),0x0;}catch(_0x3b8967){if(_0x3b8967 instanceof SDKError)return console[_0x58af73(0xe3)](_0x58af73(0xd4)+_0x3b8967[_0x58af73(0xd8)]),_0x3b8967['cause']&&console['error'](_0x58af73(0xc6)+_0x3b8967['cause']),0x1;throw _0x3b8967;}}['validate'](_0x544919){return undefined;}}
1
+ const a30_0x5e2a56=a30_0x424d;(function(_0x318d62,_0x1accfb){const _0x3f7d72=a30_0x424d,_0x390a1d=_0x318d62();while(!![]){try{const _0x2362a4=-parseInt(_0x3f7d72(0xf0))/0x1*(-parseInt(_0x3f7d72(0x106))/0x2)+-parseInt(_0x3f7d72(0xf2))/0x3*(-parseInt(_0x3f7d72(0xdc))/0x4)+-parseInt(_0x3f7d72(0xd8))/0x5*(parseInt(_0x3f7d72(0xdd))/0x6)+parseInt(_0x3f7d72(0xd7))/0x7*(-parseInt(_0x3f7d72(0xe9))/0x8)+parseInt(_0x3f7d72(0x101))/0x9+parseInt(_0x3f7d72(0xfa))/0xa*(-parseInt(_0x3f7d72(0x108))/0xb)+-parseInt(_0x3f7d72(0xf4))/0xc*(-parseInt(_0x3f7d72(0x10b))/0xd);if(_0x2362a4===_0x1accfb)break;else _0x390a1d['push'](_0x390a1d['shift']());}catch(_0x1a67db){_0x390a1d['push'](_0x390a1d['shift']());}}}(a30_0x47dd,0xaed9c));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a30_0x47dd(){const _0xc92794=['name','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','table','Error:\x20Pattern\x20\x27','\x27\x20is\x20ambiguous.','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','1152056OJSXWe','\x27\x20across\x20all\x20databases.','verbose','length','message','Database:\x20','database','606201GtUQxw','Or\x20use\x20--in\x20flag:','2567043TnxRiU','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','2388xUlXaz','tables','Site:\x20','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','✔\x20Found\x20','Error:\x20','3992750AMbpfI','Database\x20pattern:\x20','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','includes','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','execute','Database:\x20all','5024898UXCZXV','list','data','site','description','2gPzQNB','\x20table','33pSawiE','Database\x20\x27','validate','72475eZqLIf','cause','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','14bGtBUw','356770JszBUK','\x20\x20Cause:\x20','Note:\x20\x27','Listing\x20tables...','4JDIjAc','78jWjimP','error','\x20\x20Use:\x20tdx\x20tables\x20\x22','✖\x20No\x20tables\x20found','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'];a30_0x47dd=function(){return _0xc92794;};return a30_0x47dd();}function a30_0x424d(_0x3e734b,_0x1c4d0b){const _0x47dd61=a30_0x47dd();return a30_0x424d=function(_0x424dd1,_0x50462c){_0x424dd1=_0x424dd1-0xd6;let _0x398ec4=_0x47dd61[_0x424dd1];return _0x398ec4;},a30_0x424d(_0x3e734b,_0x1c4d0b);}import{parseTableReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a30_0x5e2a56(0xe3)]=a30_0x5e2a56(0xf5);[a30_0x5e2a56(0x105)]='List\x20tables\x20in\x20a\x20database';async[a30_0x5e2a56(0xff)](_0x16f315){const _0x1eb65d=a30_0x5e2a56,{options:_0x2c8067,args:_0x53af21,tdx:_0x5b6802}=_0x16f315;let _0x4576f4;if(_0x53af21[_0x1eb65d(0xec)]===0x0)_0x4576f4={'database':undefined,'table':undefined,'original':''};else{if(_0x53af21[_0x1eb65d(0xec)]===0x1)try{_0x4576f4=parseTableReference(_0x53af21[0x0]);if(_0x4576f4[_0x1eb65d(0xe5)]&&!_0x4576f4['database']&&!_0x4576f4['table'][_0x1eb65d(0xfd)]('*')&&!_0x4576f4[_0x1eb65d(0xe5)][_0x1eb65d(0xfd)]('?'))return console['error'](_0x1eb65d(0xe6)+_0x53af21[0x0]+_0x1eb65d(0xe7)),console[_0x1eb65d(0xde)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x4576f4['table']+'\x27?'),console[_0x1eb65d(0xde)](_0x1eb65d(0xdf)+_0x4576f4[_0x1eb65d(0xe5)]+'.*\x22'),console[_0x1eb65d(0xde)](_0x1eb65d(0xe1)+_0x4576f4[_0x1eb65d(0xe5)]),console[_0x1eb65d(0xde)](_0x1eb65d(0xe8)+_0x4576f4[_0x1eb65d(0xe5)]),console[_0x1eb65d(0xde)](''),console['error'](_0x1eb65d(0xda)+_0x53af21[0x0]+_0x1eb65d(0xf7)+_0x4576f4[_0x1eb65d(0xe5)]+_0x1eb65d(0xea)),0x1;}catch(_0x5095fa){return console[_0x1eb65d(0xde)]('Error:\x20'+_0x5095fa[_0x1eb65d(0xed)]),0x1;}else return console['error'](_0x1eb65d(0xe4)),console['error'](_0x1eb65d(0xfe)),console['error']('\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),console[_0x1eb65d(0xde)](_0x1eb65d(0xf3)),console[_0x1eb65d(0xde)](_0x1eb65d(0xfc)),console[_0x1eb65d(0xde)](_0x1eb65d(0xf1)),console[_0x1eb65d(0xde)](_0x1eb65d(0xe2)),0x1;}const _0x5e984e=_0x2c8067[_0x1eb65d(0xef)];!_0x4576f4[_0x1eb65d(0xef)]&&_0x5e984e&&(_0x4576f4[_0x1eb65d(0xef)]=_0x5e984e);try{const _0x44c759=_0x393f6d=>_0x393f6d&&(_0x393f6d[_0x1eb65d(0xfd)]('*')||_0x393f6d[_0x1eb65d(0xfd)]('?')),_0x20b1ff=_0x44c759(_0x4576f4[_0x1eb65d(0xef)]);_0x2c8067['verbose']&&(console[_0x1eb65d(0xde)](_0x1eb65d(0xf6)+_0x2c8067[_0x1eb65d(0x104)]),_0x4576f4[_0x1eb65d(0xef)]?_0x20b1ff?console[_0x1eb65d(0xde)](_0x1eb65d(0xfb)+_0x4576f4['database']):console[_0x1eb65d(0xde)](_0x1eb65d(0xee)+_0x4576f4['database']):console[_0x1eb65d(0xde)](_0x1eb65d(0x100)),_0x4576f4[_0x1eb65d(0xe5)]&&console[_0x1eb65d(0xde)]('Table\x20pattern:\x20'+_0x4576f4[_0x1eb65d(0xe5)]));const _0x6cb1f5=_0x4576f4['database']&&!_0x20b1ff?_0x4576f4['database']:undefined,_0x492d63=_0x20b1ff?_0x4576f4['database']:undefined,_0x32a5d6=_0x4576f4[_0x1eb65d(0xe5)],_0x3b79ea=await withSpinner(_0x1eb65d(0xdb),()=>_0x5b6802[_0x1eb65d(0xe5)][_0x1eb65d(0x102)](_0x6cb1f5,_0x32a5d6,_0x492d63),{'verbose':_0x2c8067[_0x1eb65d(0xeb)]}),_0x3c2c65=_0x3b79ea[_0x1eb65d(0x103)];if(_0x3c2c65['length']===0x0&&_0x4576f4[_0x1eb65d(0xef)]&&!_0x20b1ff)return console[_0x1eb65d(0xde)](_0x1eb65d(0xe0)),console[_0x1eb65d(0xde)](_0x1eb65d(0x109)+_0x4576f4['database']+_0x1eb65d(0xd6)),0x1;return console[_0x1eb65d(0xde)](_0x1eb65d(0xf8)+_0x3c2c65[_0x1eb65d(0xec)]+_0x1eb65d(0x107)+(_0x3c2c65[_0x1eb65d(0xec)]!==0x1?'s':'')),await handleSDKOutput(_0x3c2c65,_0x2c8067),0x0;}catch(_0x3fa4ba){if(_0x3fa4ba instanceof SDKError)return console[_0x1eb65d(0xde)](_0x1eb65d(0xf9)+_0x3fa4ba[_0x1eb65d(0xed)]),_0x3fa4ba[_0x1eb65d(0x10c)]&&console[_0x1eb65d(0xde)](_0x1eb65d(0xd9)+_0x3fa4ba[_0x1eb65d(0x10c)]),0x1;throw _0x3fa4ba;}}[a30_0x5e2a56(0x10a)](_0x222dab){return undefined;}}
@@ -1 +1 @@
1
- const a31_0x16a15e=a31_0x5b85;(function(_0x356cd2,_0x1ab5b7){const _0x1d5c57=a31_0x5b85,_0x5e2913=_0x356cd2();while(!![]){try{const _0x1f8cc2=parseInt(_0x1d5c57(0xfe))/0x1*(-parseInt(_0x1d5c57(0x119))/0x2)+-parseInt(_0x1d5c57(0x11d))/0x3+parseInt(_0x1d5c57(0x104))/0x4+parseInt(_0x1d5c57(0x11a))/0x5+-parseInt(_0x1d5c57(0x110))/0x6+-parseInt(_0x1d5c57(0x10f))/0x7+parseInt(_0x1d5c57(0x101))/0x8;if(_0x1f8cc2===_0x1ab5b7)break;else _0x5e2913['push'](_0x5e2913['shift']());}catch(_0x2699a6){_0x5e2913['push'](_0x5e2913['shift']());}}}(a31_0x4ddb,0xb795a));function a31_0x5b85(_0x51a741,_0x3dd898){const _0x4ddb35=a31_0x4ddb();return a31_0x5b85=function(_0x5b8570,_0x3c3484){_0x5b8570=_0x5b8570-0xfd;let _0x3da9a8=_0x4ddb35[_0x5b8570];return _0x3da9a8;},a31_0x5b85(_0x51a741,_0x3dd898);}import{BaseCommand}from'./command.js';function a31_0x4ddb(){const _0x3d827c=['3041812CMYpIc','toString','profile','description','name','execute','Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','database','llm_project','parent_segment','5232640SsIWee','1257798NghxJn','validate','Invalid\x20resource:\x20','log','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','length','Session\x20database\x20set\x20to:\x20','session','Session\x20parent_segment\x20set\x20to:\x20','1201708lhlwXF','4158980VQPZbG','.\x20Must\x20be\x20one\x20of:\x20','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','2086818mVUiGk','\x20(session:\x20','1OkFeHk','Set\x20session-level\x20context','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a','11306608LTtONb','error','Session\x20llm_project\x20set\x20to:\x20'];a31_0x4ddb=function(){return _0x3d827c;};return a31_0x4ddb();}import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';import{profileExists}from'../core/profile.js';export class UseCommand extends BaseCommand{[a31_0x16a15e(0x108)]='use';[a31_0x16a15e(0x107)]=a31_0x16a15e(0xff);[a31_0x16a15e(0x111)](_0x3fc274){const _0x5b6815=a31_0x16a15e,{args:_0xded94c}=_0x3fc274;if(_0xded94c[_0x5b6815(0x115)]<0x2)return _0x5b6815(0x11c)+_0x5b6815(0x100)+_0x5b6815(0x10a)+'\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options';const _0x3094ba=_0xded94c[0x0],_0x196362=[_0x5b6815(0x10c),_0x5b6815(0x10e),_0x5b6815(0x10d),_0x5b6815(0x106)];if(!_0x196362['includes'](_0x3094ba))return _0x5b6815(0x112)+_0x3094ba+_0x5b6815(0x11b)+_0x196362['join'](',\x20');return undefined;}async[a31_0x16a15e(0x109)](_0x17d904){const _0x209526=a31_0x16a15e,{args:_0x1bd7c2,options:_0x915422}=_0x17d904;try{const _0x358a5d=_0x1bd7c2[0x0],_0x212a41=_0x1bd7c2[0x1];if(_0x358a5d==='profile'){if(!profileExists(_0x212a41))return console[_0x209526(0x102)]('Error:\x20Profile\x20\x27'+_0x212a41+'\x27\x20does\x20not\x20exist'),console[_0x209526(0x102)](_0x209526(0x10b)),0x1;const _0x41479b=_0x915422[_0x209526(0x117)]||getCurrentSessionPID()['toString']();return saveSessionContext({'profile':_0x212a41},_0x915422['session']),console[_0x209526(0x113)]('Session\x20profile\x20set\x20to:\x20'+_0x212a41+_0x209526(0xfd)+_0x41479b+')'),console['log'](_0x209526(0x114)),0x0;}const _0x1bec42={},_0x15b3d3=_0x915422[_0x209526(0x117)]||getCurrentSessionPID()[_0x209526(0x105)]();switch(_0x358a5d){case _0x209526(0x10c):_0x1bec42[_0x209526(0x10c)]=_0x212a41,console[_0x209526(0x113)](_0x209526(0x116)+_0x212a41+'\x20(session:\x20'+_0x15b3d3+')');break;case _0x209526(0x10e):_0x1bec42[_0x209526(0x10e)]=_0x212a41,console[_0x209526(0x113)](_0x209526(0x118)+_0x212a41+_0x209526(0xfd)+_0x15b3d3+')');break;case'llm_project':_0x1bec42[_0x209526(0x10d)]=_0x212a41,console[_0x209526(0x113)](_0x209526(0x103)+_0x212a41+_0x209526(0xfd)+_0x15b3d3+')');break;}return saveSessionContext(_0x1bec42,_0x915422[_0x209526(0x117)]),console['log'](_0x209526(0x114)),0x0;}catch(_0x257d82){return _0x257d82 instanceof Error&&console[_0x209526(0x102)]('Error:\x20'+_0x257d82['message']),0x1;}}}
1
+ function a31_0x1721(_0x3ce16a,_0x1d4c6b){const _0xe38504=a31_0xe385();return a31_0x1721=function(_0x172102,_0x2aa969){_0x172102=_0x172102-0x14c;let _0x1c8ad4=_0xe38504[_0x172102];return _0x1c8ad4;},a31_0x1721(_0x3ce16a,_0x1d4c6b);}const a31_0x3d0a2e=a31_0x1721;(function(_0x33c59e,_0x508e3a){const _0x42ca3b=a31_0x1721,_0x529809=_0x33c59e();while(!![]){try{const _0x543ba=-parseInt(_0x42ca3b(0x14d))/0x1+parseInt(_0x42ca3b(0x159))/0x2+-parseInt(_0x42ca3b(0x14e))/0x3+-parseInt(_0x42ca3b(0x15e))/0x4*(-parseInt(_0x42ca3b(0x16b))/0x5)+parseInt(_0x42ca3b(0x161))/0x6+parseInt(_0x42ca3b(0x154))/0x7*(parseInt(_0x42ca3b(0x14c))/0x8)+parseInt(_0x42ca3b(0x153))/0x9*(-parseInt(_0x42ca3b(0x164))/0xa);if(_0x543ba===_0x508e3a)break;else _0x529809['push'](_0x529809['shift']());}catch(_0x12d5d6){_0x529809['push'](_0x529809['shift']());}}}(a31_0xe385,0xd9483));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';function a31_0xe385(){const _0x12d837=['\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','log','31044yVIBwr','Session\x20database\x20set\x20to:\x20','validate','5344692wGjInQ','name','length','6927380KjbEJB','database','join','Invalid\x20resource:\x20','llm_project','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','includes','395GQJvxv','session','use','\x27\x20does\x20not\x20exist','Error:\x20','description','toString','\x20(session:\x20','8ARYOUC','1284699eXgkfj','3414780FAJZhG','.\x20Must\x20be\x20one\x20of:\x20','execute','error','message','9VTReSU','9161579ygoVeO','profile','Set\x20session-level\x20context','Error:\x20Profile\x20\x27','parent_segment','2385972snbyRF','Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'];a31_0xe385=function(){return _0x12d837;};return a31_0xe385();}import{profileExists}from'../core/profile.js';export class UseCommand extends BaseCommand{[a31_0x3d0a2e(0x162)]=a31_0x3d0a2e(0x16d);[a31_0x3d0a2e(0x170)]=a31_0x3d0a2e(0x156);[a31_0x3d0a2e(0x160)](_0x2c95bc){const _0x5e2afe=a31_0x3d0a2e,{args:_0x174992}=_0x2c95bc;if(_0x174992[_0x5e2afe(0x163)]<0x2)return'Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a'+'Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a'+_0x5e2afe(0x15a)+_0x5e2afe(0x15c);const _0x5d0394=_0x174992[0x0],_0x3f3e9b=[_0x5e2afe(0x165),_0x5e2afe(0x158),_0x5e2afe(0x168),_0x5e2afe(0x155)];if(!_0x3f3e9b[_0x5e2afe(0x16a)](_0x5d0394))return _0x5e2afe(0x167)+_0x5d0394+_0x5e2afe(0x14f)+_0x3f3e9b[_0x5e2afe(0x166)](',\x20');return undefined;}async[a31_0x3d0a2e(0x150)](_0x25c628){const _0xa799e8=a31_0x3d0a2e,{args:_0x2470cc,options:_0x417dfb}=_0x25c628;try{const _0x2b1275=_0x2470cc[0x0],_0xaabab3=_0x2470cc[0x1];if(_0x2b1275==='profile'){if(!profileExists(_0xaabab3))return console['error'](_0xa799e8(0x157)+_0xaabab3+_0xa799e8(0x16e)),console[_0xa799e8(0x151)](_0xa799e8(0x15b)),0x1;const _0x34b1be=_0x417dfb[_0xa799e8(0x16c)]||getCurrentSessionPID()[_0xa799e8(0x171)]();return saveSessionContext({'profile':_0xaabab3},_0x417dfb[_0xa799e8(0x16c)]),console[_0xa799e8(0x15d)]('Session\x20profile\x20set\x20to:\x20'+_0xaabab3+_0xa799e8(0x172)+_0x34b1be+')'),console[_0xa799e8(0x15d)](_0xa799e8(0x169)),0x0;}const _0x52565e={},_0xe178c6=_0x417dfb['session']||getCurrentSessionPID()['toString']();switch(_0x2b1275){case'database':_0x52565e[_0xa799e8(0x165)]=_0xaabab3,console[_0xa799e8(0x15d)](_0xa799e8(0x15f)+_0xaabab3+_0xa799e8(0x172)+_0xe178c6+')');break;case _0xa799e8(0x158):_0x52565e[_0xa799e8(0x158)]=_0xaabab3,console['log']('Session\x20parent_segment\x20set\x20to:\x20'+_0xaabab3+_0xa799e8(0x172)+_0xe178c6+')');break;case'llm_project':_0x52565e['llm_project']=_0xaabab3,console[_0xa799e8(0x15d)]('Session\x20llm_project\x20set\x20to:\x20'+_0xaabab3+_0xa799e8(0x172)+_0xe178c6+')');break;}return saveSessionContext(_0x52565e,_0x417dfb[_0xa799e8(0x16c)]),console[_0xa799e8(0x15d)](_0xa799e8(0x169)),0x0;}catch(_0x4f8c18){return _0x4f8c18 instanceof Error&&console[_0xa799e8(0x151)](_0xa799e8(0x16f)+_0x4f8c18[_0xa799e8(0x152)]),0x1;}}}