@treasuredata/tdx 0.5.2 → 0.6.0

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 (116) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/client/cdp-api-client.js +1 -1
  8. package/dist/client/engage-api-client.js +1 -1
  9. package/dist/client/http-client.js +1 -1
  10. package/dist/client/llm-api-client.js +1 -1
  11. package/dist/client/rate-limiter.js +1 -1
  12. package/dist/client/td-api-client.js +1 -1
  13. package/dist/client/trino-api-client.js +1 -1
  14. package/dist/client/workflow-client.js +1 -1
  15. package/dist/commands/activations.js +1 -1
  16. package/dist/commands/api-command.js +1 -1
  17. package/dist/commands/auth-command.d.ts.map +1 -1
  18. package/dist/commands/auth-command.js +1 -1
  19. package/dist/commands/auth-command.js.map +1 -1
  20. package/dist/commands/chat-command.js +1 -1
  21. package/dist/commands/claude-command.js +1 -1
  22. package/dist/commands/claude-statusline-command.js +1 -1
  23. package/dist/commands/claude-usage-command.js +1 -1
  24. package/dist/commands/command.d.ts +1 -1
  25. package/dist/commands/command.d.ts.map +1 -1
  26. package/dist/commands/command.js +1 -1
  27. package/dist/commands/command.js.map +1 -1
  28. package/dist/commands/context-command.d.ts.map +1 -1
  29. package/dist/commands/context-command.js +1 -1
  30. package/dist/commands/context-command.js.map +1 -1
  31. package/dist/commands/databases.js +1 -1
  32. package/dist/commands/describe.js +1 -1
  33. package/dist/commands/engage-command.js +1 -1
  34. package/dist/commands/job-command.js +1 -1
  35. package/dist/commands/llm-command.js +1 -1
  36. package/dist/commands/llm-proxy.js +1 -1
  37. package/dist/commands/parent-segment-command.js +1 -1
  38. package/dist/commands/profiles-command.js +1 -1
  39. package/dist/commands/query-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pwd-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/tables.js +1 -1
  49. package/dist/commands/use-command.d.ts +8 -6
  50. package/dist/commands/use-command.d.ts.map +1 -1
  51. package/dist/commands/use-command.js +1 -1
  52. package/dist/commands/use-command.js.map +1 -1
  53. package/dist/commands/workflow-command.js +1 -1
  54. package/dist/core/auth.js +1 -1
  55. package/dist/core/config.d.ts +58 -26
  56. package/dist/core/config.d.ts.map +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/config.js.map +1 -1
  59. package/dist/core/credential-cache.js +1 -1
  60. package/dist/core/global-context.js +1 -1
  61. package/dist/core/keychain.js +1 -1
  62. package/dist/core/profile.d.ts +5 -1
  63. package/dist/core/profile.d.ts.map +1 -1
  64. package/dist/core/profile.js +1 -1
  65. package/dist/core/profile.js.map +1 -1
  66. package/dist/core/project-config.js +1 -1
  67. package/dist/core/session.js +1 -1
  68. package/dist/index.js +1 -1
  69. package/dist/proxy/anthropic-adapter.js +1 -1
  70. package/dist/proxy/claude-usage-tracker.js +1 -1
  71. package/dist/proxy/context-signature.js +1 -1
  72. package/dist/proxy/conversation-utils.js +1 -1
  73. package/dist/proxy/server.js +1 -1
  74. package/dist/proxy/session-cache.js +1 -1
  75. package/dist/sdk/api.js +1 -1
  76. package/dist/sdk/engage.js +1 -1
  77. package/dist/sdk/errors.js +1 -1
  78. package/dist/sdk/index.js +1 -1
  79. package/dist/sdk/job.js +1 -1
  80. package/dist/sdk/llm.d.ts +3 -0
  81. package/dist/sdk/llm.d.ts.map +1 -1
  82. package/dist/sdk/llm.js +1 -1
  83. package/dist/sdk/llm.js.map +1 -1
  84. package/dist/sdk/query.js +1 -1
  85. package/dist/sdk/segment.js +1 -1
  86. package/dist/sdk/workflow.js +1 -1
  87. package/dist/types/endpoints.js +1 -1
  88. package/dist/types/index.js +1 -1
  89. package/dist/utils/agent-ref-parser.js +1 -1
  90. package/dist/utils/chat-cache.js +1 -1
  91. package/dist/utils/colors.js +1 -1
  92. package/dist/utils/command-output.js +1 -1
  93. package/dist/utils/constants.js +1 -1
  94. package/dist/utils/file-permissions.js +1 -1
  95. package/dist/utils/format-detector.js +1 -1
  96. package/dist/utils/formatters.js +1 -1
  97. package/dist/utils/json-loader.js +1 -1
  98. package/dist/utils/llm-backup-utils.js +1 -1
  99. package/dist/utils/model-aliases.js +1 -1
  100. package/dist/utils/model-factors.js +1 -1
  101. package/dist/utils/option-validation.js +1 -1
  102. package/dist/utils/port.js +1 -1
  103. package/dist/utils/process.js +1 -1
  104. package/dist/utils/prompt.js +1 -1
  105. package/dist/utils/segment-path-parser.js +1 -1
  106. package/dist/utils/segment-ref-parser.js +1 -1
  107. package/dist/utils/spinner.js +1 -1
  108. package/dist/utils/sql-parser.js +1 -1
  109. package/dist/utils/sse-parser.js +1 -1
  110. package/dist/utils/string-utils.js +1 -1
  111. package/dist/utils/table-ref-parser.js +1 -1
  112. package/dist/utils/tdx-logger.js +1 -1
  113. package/dist/utils/tree-formatter.js +1 -1
  114. package/dist/utils/version-check.js +1 -1
  115. package/dist/utils/workflow-utils.js +1 -1
  116. package/package.json +1 -1
@@ -1 +1 @@
1
- const a33_0x5b03c7=a33_0x5286;(function(_0x2c4a0e,_0x89a59e){const _0x41cf79=a33_0x5286,_0x417a94=_0x2c4a0e();while(!![]){try{const _0x538f9d=-parseInt(_0x41cf79(0x17b))/0x1*(-parseInt(_0x41cf79(0x182))/0x2)+-parseInt(_0x41cf79(0x15a))/0x3*(-parseInt(_0x41cf79(0x17d))/0x4)+-parseInt(_0x41cf79(0x179))/0x5+parseInt(_0x41cf79(0x167))/0x6*(parseInt(_0x41cf79(0x186))/0x7)+parseInt(_0x41cf79(0x180))/0x8+parseInt(_0x41cf79(0x15b))/0x9+-parseInt(_0x41cf79(0x165))/0xa;if(_0x538f9d===_0x89a59e)break;else _0x417a94['push'](_0x417a94['shift']());}catch(_0xeac73c){_0x417a94['push'](_0x417a94['shift']());}}}(a33_0x2434,0x6a056));function a33_0x5286(_0x444542,_0x4556cc){const _0x2434c2=a33_0x2434();return a33_0x5286=function(_0x528643,_0x589e74){_0x528643=_0x528643-0x15a;let _0x21e425=_0x2434c2[_0x528643];return _0x21e425;},a33_0x5286(_0x444542,_0x4556cc);}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a33_0x2434(){const _0x41720e=['Resolved\x20relative\x20path\x20to:\x20','parentId','segmentName','Error:\x20Cannot\x20update\x20','folder','Examples:','Updating\x20segment\x20\x27','Resolving\x20path\x20\x27','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','11703580QvrDCB','✔\x20Updated\x20segment\x20\x27','6sdOyZj','resolvePathToResource','Resolving\x20folder\x20\x27','includes','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Parent\x20ID:\x20','segmentId','rule','segment','Resolved\x20type:\x20','error','description','type','Update\x20existing\x20child\x20segment','name','segmentPath','3317610LPtbYD','kind','7451ZGEuYY','\x20\x20\x20Path:\x20','164AEWfKC','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','5613936hFJvqB','verbose','218WAtkLF','data','\x27...','execute','369383loaPZp','INTERNAL','Segment\x20ID\x20missing\x20from\x20resolved\x20path','13083weJXmD','4704039xJctfu'];a33_0x2434=function(){return _0x41720e;};return a33_0x2434();}import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{['name']='segment:update';['description']=a33_0x5b03c7(0x176);async[a33_0x5b03c7(0x185)](_0x5968b6){const _0x71a443=a33_0x5b03c7,{options:_0x422bcb,args:_0x3c32b8,tdx:_0x30dcf9}=_0x5968b6,_0x3ef725=_0x422bcb;if(_0x3c32b8['length']===0x0)return console['error'](_0x71a443(0x17e)),console[_0x71a443(0x173)](_0x71a443(0x164)),console['error'](_0x71a443(0x161)),console[_0x71a443(0x173)](_0x71a443(0x17f)),console[_0x71a443(0x173)](_0x71a443(0x16b)),0x1;const _0x4514a2=_0x3c32b8[0x0],_0x4145d1=_0x422bcb[_0x71a443(0x178)];let _0x3762ae=_0x4514a2;_0x4145d1&&!_0x4514a2[_0x71a443(0x16a)]('/')&&(_0x3762ae=_0x4145d1+'/'+_0x4514a2,_0x3ef725[_0x71a443(0x181)]&&console[_0x71a443(0x173)](_0x71a443(0x15c)+_0x3762ae));const _0x10f093=await withSpinner(_0x71a443(0x163)+_0x3762ae+_0x71a443(0x184),()=>_0x30dcf9[_0x71a443(0x171)][_0x71a443(0x168)](_0x3762ae),{'verbose':_0x3ef725[_0x71a443(0x181)]}),_0x5bc475=_0x10f093[_0x71a443(0x183)];_0x3ef725[_0x71a443(0x181)]&&console[_0x71a443(0x173)](_0x71a443(0x172)+_0x5bc475[_0x71a443(0x175)]);if(_0x5bc475['type']!==_0x71a443(0x171))return console[_0x71a443(0x173)](_0x71a443(0x15f)+_0x5bc475[_0x71a443(0x175)]+_0x71a443(0x16d)),console[_0x71a443(0x173)](_0x71a443(0x16c)),0x1;if(!_0x5bc475[_0x71a443(0x16f)])throw new SDKError(ErrorCode[_0x71a443(0x187)],_0x71a443(0x188));const _0x494b63=_0x5bc475[_0x71a443(0x15d)],_0x5128b8=_0x5bc475[_0x71a443(0x16f)];_0x3ef725[_0x71a443(0x181)]&&(console[_0x71a443(0x173)](_0x71a443(0x16e)+_0x494b63),console['error']('Segment\x20ID:\x20'+_0x5128b8));let _0x2409a9;if(_0x3ef725[_0x71a443(0x160)]){const _0x717ad9=_0x3ef725[_0x71a443(0x160)],_0x245248=await withSpinner(_0x71a443(0x169)+_0x717ad9+_0x71a443(0x184),()=>_0x30dcf9[_0x71a443(0x171)]['resolveFolderId'](_0x494b63,_0x717ad9),{'verbose':_0x3ef725[_0x71a443(0x181)]});_0x2409a9=parseInt(_0x245248[_0x71a443(0x183)],0xa),_0x3ef725['verbose']&&console[_0x71a443(0x173)]('Resolved\x20folder\x20ID:\x20'+_0x2409a9);}const _0x475745=await loadJSONFromOptions(_0x3ef725[_0x71a443(0x170)],_0x3ef725['ruleFile']),_0xc60f3={'name':_0x3ef725[_0x71a443(0x177)],'description':_0x3ef725[_0x71a443(0x174)],'rule':_0x475745,'kind':_0x3ef725[_0x71a443(0x17a)]!==undefined?parseInt(_0x3ef725['kind'],0xa):undefined,'segmentFolderId':_0x2409a9},_0x5f02fd=await withSpinner(_0x71a443(0x162)+_0x5bc475[_0x71a443(0x15e)]+_0x71a443(0x184),()=>_0x30dcf9[_0x71a443(0x171)]['updateSegmentById'](_0x494b63,_0x5128b8,_0xc60f3),{'verbose':_0x3ef725[_0x71a443(0x181)]}),_0x3ab508=_0x5f02fd[_0x71a443(0x183)];return console[_0x71a443(0x173)](_0x71a443(0x166)+_0x3ab508[_0x71a443(0x177)]+'\x27'),_0x3762ae!==_0x4514a2&&console[_0x71a443(0x173)](_0x71a443(0x17c)+_0x3762ae),await handleSDKOutput([_0x3ab508],_0x3ef725),0x0;}}
1
+ const a33_0x3d7663=a33_0x497f;(function(_0x51520b,_0x170201){const _0x3f3f58=a33_0x497f,_0x5da74d=_0x51520b();while(!![]){try{const _0xf682f6=parseInt(_0x3f3f58(0x171))/0x1*(parseInt(_0x3f3f58(0x190))/0x2)+-parseInt(_0x3f3f58(0x18f))/0x3*(-parseInt(_0x3f3f58(0x19b))/0x4)+parseInt(_0x3f3f58(0x17e))/0x5*(-parseInt(_0x3f3f58(0x175))/0x6)+-parseInt(_0x3f3f58(0x186))/0x7+parseInt(_0x3f3f58(0x195))/0x8+parseInt(_0x3f3f58(0x17d))/0x9*(-parseInt(_0x3f3f58(0x197))/0xa)+parseInt(_0x3f3f58(0x179))/0xb*(parseInt(_0x3f3f58(0x189))/0xc);if(_0xf682f6===_0x170201)break;else _0x5da74d['push'](_0x5da74d['shift']());}catch(_0x526a2e){_0x5da74d['push'](_0x5da74d['shift']());}}}(a33_0x2721,0x5d4e3));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a33_0x497f(_0xef85f7,_0x410b94){const _0x2721ca=a33_0x2721();return a33_0x497f=function(_0x497f95,_0x1f5cc1){_0x497f95=_0x497f95-0x16c;let _0x361a34=_0x2721ca[_0x497f95];return _0x361a34;},a33_0x497f(_0xef85f7,_0x410b94);}import{loadJSONFromOptions}from'../utils/json-loader.js';function a33_0x2721(){const _0x4296cf=['Resolved\x20type:\x20','segmentName','includes','type','✔\x20Updated\x20segment\x20\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','4927258FhqdMP','kind','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','84jjlIWH','folder','description','updateSegmentById','segment','Resolving\x20folder\x20\x27','73443BHaHAw','2oNtPav','rule','length','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Examples:','1313008AkdOrT','Resolving\x20path\x20\x27','3602930CaNBCf','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','segmentId','112EQEwTW','verbose','\x20\x20\x20Path:\x20','segment:update','segmentPath','Updating\x20segment\x20\x27','407455MdYell','name','\x27...','Resolved\x20folder\x20ID:\x20','78CPeKEI','Error:\x20Cannot\x20update\x20','INTERNAL','ruleFile','536063WtETBm','Update\x20existing\x20child\x20segment','Resolved\x20relative\x20path\x20to:\x20','Segment\x20ID:\x20','9lWYgHk','58390CDRXmi','error'];a33_0x2721=function(){return _0x4296cf;};return a33_0x2721();}import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{[a33_0x3d7663(0x172)]=a33_0x3d7663(0x16e);[a33_0x3d7663(0x18b)]=a33_0x3d7663(0x17a);async['execute'](_0x43babc){const _0x3b14ba=a33_0x3d7663,{options:_0x2075d9,args:_0x1bdd33,tdx:_0x4981db}=_0x43babc,_0x5ecf16=_0x2075d9;if(_0x1bdd33[_0x3b14ba(0x192)]===0x0)return console[_0x3b14ba(0x17f)](_0x3b14ba(0x185)),console[_0x3b14ba(0x17f)](_0x3b14ba(0x193)),console[_0x3b14ba(0x17f)](_0x3b14ba(0x194)),console['error'](_0x3b14ba(0x199)),console['error'](_0x3b14ba(0x198)),0x1;const _0x16acf3=_0x1bdd33[0x0],_0x22bb09=_0x2075d9[_0x3b14ba(0x16f)];let _0x252cfb=_0x16acf3;_0x22bb09&&!_0x16acf3[_0x3b14ba(0x182)]('/')&&(_0x252cfb=_0x22bb09+'/'+_0x16acf3,_0x5ecf16[_0x3b14ba(0x16c)]&&console[_0x3b14ba(0x17f)](_0x3b14ba(0x17b)+_0x252cfb));const _0x565762=await withSpinner(_0x3b14ba(0x196)+_0x252cfb+'\x27...',()=>_0x4981db[_0x3b14ba(0x18d)]['resolvePathToResource'](_0x252cfb),{'verbose':_0x5ecf16['verbose']}),_0x3c799d=_0x565762['data'];_0x5ecf16['verbose']&&console[_0x3b14ba(0x17f)](_0x3b14ba(0x180)+_0x3c799d[_0x3b14ba(0x183)]);if(_0x3c799d[_0x3b14ba(0x183)]!=='segment')return console[_0x3b14ba(0x17f)](_0x3b14ba(0x176)+_0x3c799d[_0x3b14ba(0x183)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x3b14ba(0x17f)](_0x3b14ba(0x188)),0x1;if(!_0x3c799d[_0x3b14ba(0x19a)])throw new SDKError(ErrorCode[_0x3b14ba(0x177)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x487ab9=_0x3c799d['parentId'],_0x235cbe=_0x3c799d['segmentId'];_0x5ecf16[_0x3b14ba(0x16c)]&&(console[_0x3b14ba(0x17f)]('Parent\x20ID:\x20'+_0x487ab9),console[_0x3b14ba(0x17f)](_0x3b14ba(0x17c)+_0x235cbe));let _0x46f15c;if(_0x5ecf16[_0x3b14ba(0x18a)]){const _0x2a460f=_0x5ecf16[_0x3b14ba(0x18a)],_0x17a257=await withSpinner(_0x3b14ba(0x18e)+_0x2a460f+_0x3b14ba(0x173),()=>_0x4981db['segment']['resolveFolderId'](_0x487ab9,_0x2a460f),{'verbose':_0x5ecf16['verbose']});_0x46f15c=parseInt(_0x17a257['data'],0xa),_0x5ecf16[_0x3b14ba(0x16c)]&&console[_0x3b14ba(0x17f)](_0x3b14ba(0x174)+_0x46f15c);}const _0x74a750=await loadJSONFromOptions(_0x5ecf16[_0x3b14ba(0x191)],_0x5ecf16[_0x3b14ba(0x178)]),_0x191f98={'name':_0x5ecf16['name'],'description':_0x5ecf16[_0x3b14ba(0x18b)],'rule':_0x74a750,'kind':_0x5ecf16[_0x3b14ba(0x187)]!==undefined?parseInt(_0x5ecf16['kind'],0xa):undefined,'segmentFolderId':_0x46f15c},_0x267fe3=await withSpinner(_0x3b14ba(0x170)+_0x3c799d[_0x3b14ba(0x181)]+'\x27...',()=>_0x4981db['segment'][_0x3b14ba(0x18c)](_0x487ab9,_0x235cbe,_0x191f98),{'verbose':_0x5ecf16['verbose']}),_0x41b497=_0x267fe3['data'];return console[_0x3b14ba(0x17f)](_0x3b14ba(0x184)+_0x41b497['name']+'\x27'),_0x252cfb!==_0x16acf3&&console[_0x3b14ba(0x17f)](_0x3b14ba(0x16d)+_0x252cfb),await handleSDKOutput([_0x41b497],_0x5ecf16),0x0;}}
@@ -1 +1 @@
1
- const a34_0x2ea5d6=a34_0x440c;(function(_0x465ecd,_0x36fb8d){const _0xd235d9=a34_0x440c,_0x141fae=_0x465ecd();while(!![]){try{const _0x1d3547=-parseInt(_0xd235d9(0x19e))/0x1+-parseInt(_0xd235d9(0x18f))/0x2+parseInt(_0xd235d9(0x190))/0x3+parseInt(_0xd235d9(0x19b))/0x4+-parseInt(_0xd235d9(0x196))/0x5*(parseInt(_0xd235d9(0x192))/0x6)+-parseInt(_0xd235d9(0x176))/0x7*(-parseInt(_0xd235d9(0x189))/0x8)+parseInt(_0xd235d9(0x1a2))/0x9*(-parseInt(_0xd235d9(0x186))/0xa);if(_0x1d3547===_0x36fb8d)break;else _0x141fae['push'](_0x141fae['shift']());}catch(_0x170716){_0x141fae['push'](_0x141fae['shift']());}}}(a34_0x2885,0xbc663));import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';function a34_0x440c(_0x464e94,_0x2216cd){const _0x2885ce=a34_0x2885();return a34_0x440c=function(_0x440cbc,_0xd58f48){_0x440cbc=_0x440cbc-0x170;let _0x494a50=_0x2885ce[_0x440cbc];return _0x494a50;},a34_0x440c(_0x464e94,_0x2216cd);}import{parsePath,normalizePath}from'../utils/segment-path-parser.js';export class SegmentUseCommand extends BaseCommand{[a34_0x2ea5d6(0x199)]=a34_0x2ea5d6(0x170);[a34_0x2ea5d6(0x173)]=a34_0x2ea5d6(0x193);async[a34_0x2ea5d6(0x17e)](_0x18d4b5){const _0x594406=a34_0x2ea5d6,{options:_0x471ee0,args:_0xe995ba,tdx:_0x59f583}=_0x18d4b5;if(_0xe995ba[_0x594406(0x194)]===0x0)return console[_0x594406(0x17d)](_0x594406(0x18d)),console[_0x594406(0x17d)](_0x594406(0x17c)),console[_0x594406(0x17d)]('Examples:'),console[_0x594406(0x17d)](_0x594406(0x18b)),console['error'](_0x594406(0x181)),console['error'](_0x594406(0x188)),console[_0x594406(0x17d)](_0x594406(0x183)),0x1;const _0x25c772=_0xe995ba[0x0],_0x3151ab=_0x471ee0[_0x594406(0x19a)];try{if(_0x25c772==='/')return saveSessionContext({'segment_path':undefined},_0x3151ab),console['log'](_0x594406(0x187)),0x0;const _0x49c0dd=_0x471ee0[_0x594406(0x177)];let _0x42b274=_0x25c772;const _0x568244=parsePath(_0x25c772);if(!_0x568244['isAbsolute']){if(!_0x49c0dd)return console[_0x594406(0x17d)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.'),console['error'](_0x594406(0x19c)),0x1;if(_0x25c772==='..'){const _0x888f3e=_0x49c0dd[_0x594406(0x198)]('/')[_0x594406(0x195)](0x0,-0x1)['join']('/');_0x42b274=_0x888f3e||'/';}else _0x25c772==='.'?_0x42b274=_0x49c0dd:_0x42b274=_0x49c0dd+'/'+_0x25c772;_0x471ee0['verbose']&&console['error'](_0x594406(0x178)+_0x42b274);}if(_0x42b274==='/'||_0x42b274==='')return saveSessionContext({'segment_path':undefined},_0x3151ab),console[_0x594406(0x17a)](_0x594406(0x187)),0x0;_0x42b274=normalizePath(_0x42b274);const _0x3cf025=parsePath(_0x42b274)[_0x594406(0x179)];if(_0x3cf025['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x3151ab),console[_0x594406(0x17a)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;_0x471ee0[_0x594406(0x17b)]&&(console['error'](_0x594406(0x17f)+_0x471ee0['site']),console[_0x594406(0x17d)](_0x594406(0x18e)+_0x42b274));const _0x2fd319=await withSpinner('Resolving\x20path\x20\x27'+_0x42b274+_0x594406(0x1a0),()=>_0x59f583['segment']['resolvePathToResource'](_0x42b274),{'verbose':_0x471ee0[_0x594406(0x17b)]}),_0x273672=_0x2fd319[_0x594406(0x19f)];_0x471ee0[_0x594406(0x17b)]&&(console[_0x594406(0x17d)](_0x594406(0x172)+_0x273672[_0x594406(0x184)]),console['error'](_0x594406(0x182)+_0x273672['parentId']),_0x273672[_0x594406(0x175)]&&console[_0x594406(0x17d)](_0x594406(0x180)+_0x273672[_0x594406(0x175)]));if(_0x273672[_0x594406(0x184)]===_0x594406(0x174))return console[_0x594406(0x17d)](_0x594406(0x197)),console[_0x594406(0x17d)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x594406(0x17d)](_0x594406(0x1a1)+_0x273672['parentName']+(_0x273672[_0x594406(0x171)]?'/'+_0x273672['folderPath'][_0x594406(0x185)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x273672[_0x594406(0x191)],'parent_segment':_0x273672[_0x594406(0x18c)]},_0x3151ab),console[_0x594406(0x17a)](_0x594406(0x18a)+_0x273672[_0x594406(0x191)]),_0x471ee0['verbose']&&(console[_0x594406(0x17d)](_0x594406(0x19d)),console[_0x594406(0x17d)]('Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context'),console[_0x594406(0x17d)]('Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters')),0x0;}catch(_0x59d4bf){throw _0x59d4bf;}}}function a34_0x2885(){const _0x4d847f=['6HgzvhJ','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','length','slice','1179385gctYzu','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','split','name','session','4631500QTktdh','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','434102xTshOj','data','\x27...','Use:\x20tdx\x20segment\x20use\x20','54eDjMLA','segment:use','folderPath','Resolved\x20path\x20type:\x20','description','segment','folderId','7qHRXmJ','segmentPath','Resolved\x20relative\x20path\x20to:\x20','segments','log','verbose','Usage:\x20tdx\x20segment\x20use\x20<path>','error','execute','Site:\x20','Folder\x20ID:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Parent\x20ID:\x20','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','type','join','3033370QQbgBz','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\x20#\x20Clear\x20context','11170584vNlgxj','Context\x20set\x20to:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','parentName','Error:\x20Path\x20is\x20required','Target\x20path:\x20','1359868jEtDgu','4162260ngoxcq','fullPath'];a34_0x2885=function(){return _0x4d847f;};return a34_0x2885();}
1
+ const a34_0x13a0f5=a34_0x1123;(function(_0x440141,_0x382d8e){const _0x3ac302=a34_0x1123,_0x56dcd4=_0x440141();while(!![]){try{const _0x1421f8=-parseInt(_0x3ac302(0x15f))/0x1+-parseInt(_0x3ac302(0x14a))/0x2+-parseInt(_0x3ac302(0x158))/0x3+-parseInt(_0x3ac302(0x153))/0x4*(parseInt(_0x3ac302(0x159))/0x5)+-parseInt(_0x3ac302(0x14c))/0x6+-parseInt(_0x3ac302(0x15b))/0x7+parseInt(_0x3ac302(0x140))/0x8;if(_0x1421f8===_0x382d8e)break;else _0x56dcd4['push'](_0x56dcd4['shift']());}catch(_0x4bff1b){_0x56dcd4['push'](_0x56dcd4['shift']());}}}(a34_0x255c,0xe2a68));import{BaseCommand}from'./command.js';function a34_0x255c(){const _0x6d464=['Context\x20cleared.\x20Back\x20to\x20root.','Use:\x20tdx\x20segment\x20use\x20','\x27...','Resolved\x20path\x20type:\x20','segment','56018824Bhcstj','segment:use','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','segments','resolvePathToResource','data','parentId','error','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','1910514Bzntyz','segmentPath','4289214vImsmV','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','length','Examples:','fullPath','log','Target\x20path:\x20','1703944GbkBrW','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','split','Context\x20set\x20to:\x20','description','3350811kgeawE','10PRUUlQ','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','12241964iNwFtt','verbose','Folder\x20ID:\x20','isAbsolute','686106USlGNi','Site:\x20','type','folderPath','session','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','site','name','parentName','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20segment\x20use\x20<path>'];a34_0x255c=function(){return _0x6d464;};return a34_0x255c();}import{saveSessionContext}from'../core/session.js';function a34_0x1123(_0x409511,_0x52831e){const _0x255cc6=a34_0x255c();return a34_0x1123=function(_0x112357,_0x2d8176){_0x112357=_0x112357-0x13c;let _0x372cc0=_0x255cc6[_0x112357];return _0x372cc0;},a34_0x1123(_0x409511,_0x52831e);}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';export class SegmentUseCommand extends BaseCommand{[a34_0x13a0f5(0x166)]=a34_0x13a0f5(0x141);[a34_0x13a0f5(0x157)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async['execute'](_0x4f2a16){const _0x337a59=a34_0x13a0f5,{options:_0x3bad5a,args:_0x11ee1b,tdx:_0x123d5f}=_0x4f2a16;if(_0x11ee1b[_0x337a59(0x14e)]===0x0)return console[_0x337a59(0x147)]('Error:\x20Path\x20is\x20required'),console['error'](_0x337a59(0x169)),console[_0x337a59(0x147)](_0x337a59(0x14f)),console[_0x337a59(0x147)](_0x337a59(0x148)),console[_0x337a59(0x147)](_0x337a59(0x142)),console[_0x337a59(0x147)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console[_0x337a59(0x147)]('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x129842=_0x11ee1b[0x0],_0x55a14e=_0x3bad5a[_0x337a59(0x163)];try{if(_0x129842==='/')return saveSessionContext({'segment_path':undefined},_0x55a14e),console[_0x337a59(0x151)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;const _0x3b1f32=_0x3bad5a[_0x337a59(0x14b)];let _0x3b71d5=_0x129842;const _0x4a998e=parsePath(_0x129842);if(!_0x4a998e[_0x337a59(0x15e)]){if(!_0x3b1f32)return console[_0x337a59(0x147)](_0x337a59(0x14d)),console['error'](_0x337a59(0x164)),0x1;if(_0x129842==='..'){const _0x54b7d0=_0x3b1f32[_0x337a59(0x155)]('/')['slice'](0x0,-0x1)['join']('/');_0x3b71d5=_0x54b7d0||'/';}else _0x129842==='.'?_0x3b71d5=_0x3b1f32:_0x3b71d5=_0x3b1f32+'/'+_0x129842;_0x3bad5a['verbose']&&console[_0x337a59(0x147)](_0x337a59(0x168)+_0x3b71d5);}if(_0x3b71d5==='/'||_0x3b71d5==='')return saveSessionContext({'segment_path':undefined},_0x55a14e),console[_0x337a59(0x151)](_0x337a59(0x16a)),0x0;_0x3b71d5=normalizePath(_0x3b71d5);const _0x2b5f4b=parsePath(_0x3b71d5)[_0x337a59(0x143)];if(_0x2b5f4b['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x55a14e),console[_0x337a59(0x151)](_0x337a59(0x16a)),0x0;_0x3bad5a[_0x337a59(0x15c)]&&(console[_0x337a59(0x147)](_0x337a59(0x160)+_0x3bad5a[_0x337a59(0x165)]),console[_0x337a59(0x147)](_0x337a59(0x152)+_0x3b71d5));const _0x5360c8=await withSpinner('Resolving\x20path\x20\x27'+_0x3b71d5+_0x337a59(0x13d),()=>_0x123d5f[_0x337a59(0x13f)][_0x337a59(0x144)](_0x3b71d5),{'verbose':_0x3bad5a[_0x337a59(0x15c)]}),_0x391364=_0x5360c8[_0x337a59(0x145)];_0x3bad5a[_0x337a59(0x15c)]&&(console[_0x337a59(0x147)](_0x337a59(0x13e)+_0x391364[_0x337a59(0x161)]),console[_0x337a59(0x147)]('Parent\x20ID:\x20'+_0x391364[_0x337a59(0x146)]),_0x391364['folderId']&&console['error'](_0x337a59(0x15d)+_0x391364['folderId']));if(_0x391364[_0x337a59(0x161)]===_0x337a59(0x13f))return console[_0x337a59(0x147)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.'),console[_0x337a59(0x147)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x337a59(0x147)](_0x337a59(0x13c)+_0x391364[_0x337a59(0x167)]+(_0x391364['folderPath']?'/'+_0x391364[_0x337a59(0x162)]['join']('/'):'')),0x1;return saveSessionContext({'segment_path':_0x391364[_0x337a59(0x150)],'parent_segment':_0x391364[_0x337a59(0x167)]},_0x55a14e),console[_0x337a59(0x151)](_0x337a59(0x156)+_0x391364[_0x337a59(0x150)]),_0x3bad5a[_0x337a59(0x15c)]&&(console[_0x337a59(0x147)](_0x337a59(0x154)),console[_0x337a59(0x147)](_0x337a59(0x15a)),console[_0x337a59(0x147)](_0x337a59(0x149))),0x0;}catch(_0x28344f){throw _0x28344f;}}}
@@ -1 +1 @@
1
- const a35_0x2cd70d=a35_0x38a7;(function(_0x490ca8,_0x30abc4){const _0xc3bcb6=a35_0x38a7,_0x385b92=_0x490ca8();while(!![]){try{const _0xd574e2=parseInt(_0xc3bcb6(0x13c))/0x1+-parseInt(_0xc3bcb6(0x167))/0x2*(-parseInt(_0xc3bcb6(0x16c))/0x3)+parseInt(_0xc3bcb6(0x156))/0x4*(parseInt(_0xc3bcb6(0x171))/0x5)+-parseInt(_0xc3bcb6(0x13d))/0x6*(parseInt(_0xc3bcb6(0x16f))/0x7)+parseInt(_0xc3bcb6(0x16b))/0x8*(parseInt(_0xc3bcb6(0x173))/0x9)+parseInt(_0xc3bcb6(0x147))/0xa*(-parseInt(_0xc3bcb6(0x14d))/0xb)+-parseInt(_0xc3bcb6(0x13b))/0xc*(-parseInt(_0xc3bcb6(0x176))/0xd);if(_0xd574e2===_0x30abc4)break;else _0x385b92['push'](_0x385b92['shift']());}catch(_0x2a8097){_0x385b92['push'](_0x385b92['shift']());}}}(a35_0xb337,0xc2bee));import{BaseCommand}from'./command.js';function a35_0xb337(){const _0x5ce687=['folderId','Building\x20hierarchy\x20tree...','filter','👥\x20','46108bwaGNE','\x20top-level\x20items','replace','length','No\x20parent\x20segments\x20match\x20pattern:\x20','\x20matching\x20\x27','log','json','name','listParentsWithPattern','verbose','\x5c$&','Site:\x20','Listing\x20parent\x20segments\x20matching\x20\x27','Folder\x20ID:\x20','map','cause','2cLKbOk','✔\x20Found\x20','[parent\x20segments]','folder','8872lTeOQr','2790321jgrZKZ','data','dim','63392Xmlxgf','includes','5dPlACf','Parent\x20ID:\x20','11826HJxFRw','Recursive\x20mode:\x20enabled','\x20parent\x20segment','4716517vStRZW','Current\x20context:\x20','\x27...','message','\x20segment','Error:\x20','Listing\x20folders\x20and\x20segments...','test','site','Resolving\x20context\x20path\x20\x27','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','jsonl','segmentPath','12qKHgWH','31120EznOwx','468wlYNsD','error','Listing\x20parent\x20segments...','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','population','attributes','format','segment','execute','listRecursive','12887430RBnpvA','description','localeCompare','(empty)','\x20\x20Cause:\x20','listUnified','11ZxLGni','parentId','resolvePathToResource','listParents','segments'];a35_0xb337=function(){return _0x5ce687;};return a35_0xb337();}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 a35_0x517637 from'chalk';function a35_0x38a7(_0x592f64,_0x153a32){const _0xb3371=a35_0xb337();return a35_0x38a7=function(_0x38a760,_0x984b5b){_0x38a760=_0x38a760-0x132;let _0x28a995=_0xb3371[_0x38a760];return _0x28a995;},a35_0x38a7(_0x592f64,_0x153a32);}export class SegmentsCommand extends BaseCommand{[a35_0x2cd70d(0x15e)]=a35_0x2cd70d(0x151);[a35_0x2cd70d(0x148)]=a35_0x2cd70d(0x138);async[a35_0x2cd70d(0x145)](_0x32c079){const _0x2f4d56=a35_0x2cd70d,{options:_0x8d3bf1,args:_0x4b9250}=_0x32c079,_0x14c8be=_0x8d3bf1['recursive'],_0x5587a1=_0x4b9250[0x0];try{const _0x8bcbff=_0x8d3bf1[_0x2f4d56(0x13a)];_0x8d3bf1['verbose']&&(console['error'](_0x2f4d56(0x162)+_0x8d3bf1[_0x2f4d56(0x136)]),console[_0x2f4d56(0x13e)](_0x2f4d56(0x177)+(_0x8bcbff||'/')),_0x5587a1&&console[_0x2f4d56(0x13e)]('Path/pattern\x20arg:\x20'+_0x5587a1),_0x14c8be&&console[_0x2f4d56(0x13e)](_0x2f4d56(0x174)));if(_0x5587a1){const _0x417d8a=_0x5587a1[_0x2f4d56(0x170)]('*')||_0x5587a1[_0x2f4d56(0x170)]('?');if(_0x417d8a&&!_0x8bcbff)return await this['listParentsWithPattern'](_0x32c079,_0x5587a1);else return _0x417d8a?(console['error']('Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).'),console[_0x2f4d56(0x13e)](_0x2f4d56(0x140)),0x1):_0x14c8be?await this[_0x2f4d56(0x146)](_0x32c079,_0x5587a1):await this[_0x2f4d56(0x14c)](_0x32c079,_0x5587a1);}if(!_0x8bcbff)return await this[_0x2f4d56(0x150)](_0x32c079);return _0x14c8be?await this[_0x2f4d56(0x146)](_0x32c079,_0x8bcbff):await this[_0x2f4d56(0x14c)](_0x32c079,_0x8bcbff);}catch(_0x1f2480){if(_0x1f2480 instanceof SDKError)return console[_0x2f4d56(0x13e)](_0x2f4d56(0x133)+_0x1f2480[_0x2f4d56(0x179)]),_0x1f2480[_0x2f4d56(0x166)]&&console['error'](_0x2f4d56(0x14b)+_0x1f2480['cause']),0x1;throw _0x1f2480;}}async[a35_0x2cd70d(0x15f)](_0x2f4c84,_0x53f5e3){const _0x22067d=a35_0x2cd70d,{options:_0x4641e4,tdx:_0x3a87a1}=_0x2f4c84,_0x5b1c52=await withSpinner(_0x22067d(0x163)+_0x53f5e3+_0x22067d(0x178),()=>_0x3a87a1['segment']['listParents'](),{'verbose':_0x4641e4[_0x22067d(0x160)]}),_0x3972d8=_0x5b1c52[_0x22067d(0x16d)],_0x3e59a7=_0x53f5e3['replace'](/[.+^${}()|[\]\\]/g,_0x22067d(0x161))[_0x22067d(0x158)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x125ab6=new RegExp('^'+_0x3e59a7+'$','i'),_0x4ace1d=_0x3972d8[_0x22067d(0x154)](_0x364745=>_0x125ab6[_0x22067d(0x135)](_0x364745['attributes'][_0x22067d(0x15e)]));console[_0x22067d(0x13e)](_0x22067d(0x168)+_0x4ace1d[_0x22067d(0x159)]+'\x20parent\x20segment'+(_0x4ace1d[_0x22067d(0x159)]!==0x1?'s':'')+_0x22067d(0x15b)+_0x53f5e3+'\x27');if(_0x4641e4[_0x22067d(0x143)]==='json'||_0x4641e4[_0x22067d(0x143)]===_0x22067d(0x139))await handleSDKOutput(_0x4ace1d,_0x4641e4);else{if(_0x4ace1d[_0x22067d(0x159)]===0x0)console[_0x22067d(0x15c)](_0x22067d(0x15a)+_0x53f5e3);else{console[_0x22067d(0x15c)](_0x22067d(0x169));for(const _0x30403e of _0x4ace1d){const _0x245571=_0x30403e[_0x22067d(0x142)][_0x22067d(0x141)]?a35_0x517637[_0x22067d(0x16e)]('\x20('+formatRows(_0x30403e['attributes'][_0x22067d(0x141)])+')'):'';console[_0x22067d(0x15c)](_0x22067d(0x155)+_0x30403e[_0x22067d(0x142)][_0x22067d(0x15e)]+_0x245571);}}}return 0x0;}async[a35_0x2cd70d(0x150)](_0xedbe8){const _0x33ac11=a35_0x2cd70d,{options:_0x5f37c5,tdx:_0x44ca54}=_0xedbe8,_0x31cfdf=await withSpinner(_0x33ac11(0x13f),()=>_0x44ca54['segment'][_0x33ac11(0x150)](),{'verbose':_0x5f37c5[_0x33ac11(0x160)]}),_0x28c788=_0x31cfdf[_0x33ac11(0x16d)];console['error'](_0x33ac11(0x168)+_0x28c788['length']+_0x33ac11(0x175)+(_0x28c788['length']!==0x1?'s':''));if(_0x5f37c5[_0x33ac11(0x143)]===_0x33ac11(0x15d)||_0x5f37c5['format']===_0x33ac11(0x139))await handleSDKOutput(_0x28c788,_0x5f37c5);else{console[_0x33ac11(0x15c)](_0x33ac11(0x169));for(const _0x43e477 of _0x28c788){const _0x895312=_0x43e477[_0x33ac11(0x142)][_0x33ac11(0x141)]?a35_0x517637['dim']('\x20('+formatRows(_0x43e477[_0x33ac11(0x142)][_0x33ac11(0x141)])+')'):'';console[_0x33ac11(0x15c)](_0x33ac11(0x155)+_0x43e477[_0x33ac11(0x142)][_0x33ac11(0x15e)]+_0x895312);}}return 0x0;}async[a35_0x2cd70d(0x14c)](_0xde92e1,_0x3a434c){const _0x26d10c=a35_0x2cd70d,{options:_0x40c8fc,tdx:_0x5de674}=_0xde92e1,_0x36c382=await withSpinner(_0x26d10c(0x137)+_0x3a434c+'\x27...',()=>_0x5de674[_0x26d10c(0x144)][_0x26d10c(0x14f)](_0x3a434c),{'verbose':_0x40c8fc[_0x26d10c(0x160)]}),_0x1cfb36=_0x36c382[_0x26d10c(0x16d)];_0x40c8fc[_0x26d10c(0x160)]&&(console[_0x26d10c(0x13e)](_0x26d10c(0x172)+_0x1cfb36['parentId']),_0x1cfb36[_0x26d10c(0x152)]&&console[_0x26d10c(0x13e)](_0x26d10c(0x164)+_0x1cfb36[_0x26d10c(0x152)]));const _0xa17f51=await withSpinner(_0x26d10c(0x134),()=>_0x5de674[_0x26d10c(0x144)][_0x26d10c(0x14c)](_0x1cfb36[_0x26d10c(0x14e)],_0x1cfb36['folderId']),{'verbose':_0x40c8fc[_0x26d10c(0x160)]}),{folders:_0x2ff21b,segments:_0x2014a2}=_0xa17f51['data'],_0x424232=_0x2ff21b['length']+_0x2014a2[_0x26d10c(0x159)];console[_0x26d10c(0x13e)](_0x26d10c(0x168)+_0x2ff21b[_0x26d10c(0x159)]+'\x20folder'+(_0x2ff21b['length']!==0x1?'s':'')+'\x20and\x20'+_0x2014a2[_0x26d10c(0x159)]+_0x26d10c(0x132)+(_0x2014a2[_0x26d10c(0x159)]!==0x1?'s':''));if(_0x40c8fc['format']===_0x26d10c(0x15d)||_0x40c8fc[_0x26d10c(0x143)]===_0x26d10c(0x139)){const _0x58fa95=[..._0x2ff21b[_0x26d10c(0x165)](_0x302f2a=>({..._0x302f2a,'type':_0x26d10c(0x16a)})),..._0x2014a2['map'](_0x52e2bb=>({..._0x52e2bb,'type':_0x26d10c(0x144)}))]['sort']((_0x5c3322,_0x106666)=>_0x5c3322[_0x26d10c(0x15e)][_0x26d10c(0x149)](_0x106666[_0x26d10c(0x15e)]));await handleSDKOutput(_0x58fa95,_0x40c8fc);}else{if(_0x424232===0x0)console['log'](a35_0x517637[_0x26d10c(0x16e)]('[/'+_0x3a434c+']')),console[_0x26d10c(0x15c)](_0x26d10c(0x14a));else{console['log'](a35_0x517637['dim']('[/'+_0x3a434c+']'));const _0x1069b8=formatFlatList(_0x2ff21b,_0x2014a2,{'showMetadata':!![]});console[_0x26d10c(0x15c)](_0x1069b8);}}return 0x0;}async['listRecursive'](_0x55f412,_0x2f7913){const _0x446b8a=a35_0x2cd70d,{options:_0x588eec,tdx:_0x3f6a9e}=_0x55f412,_0x241967=await withSpinner(_0x446b8a(0x137)+_0x2f7913+'\x27...',()=>_0x3f6a9e[_0x446b8a(0x144)][_0x446b8a(0x14f)](_0x2f7913),{'verbose':_0x588eec[_0x446b8a(0x160)]}),_0x4b203d=_0x241967['data'];_0x588eec[_0x446b8a(0x160)]&&(console['error'](_0x446b8a(0x172)+_0x4b203d[_0x446b8a(0x14e)]),_0x4b203d[_0x446b8a(0x152)]&&console[_0x446b8a(0x13e)](_0x446b8a(0x164)+_0x4b203d[_0x446b8a(0x152)]));const _0x34babb=_0x588eec['maxDepth']||0xa,_0x5e1587=await withSpinner(_0x446b8a(0x153),()=>_0x3f6a9e[_0x446b8a(0x144)][_0x446b8a(0x146)](_0x4b203d[_0x446b8a(0x14e)],_0x4b203d[_0x446b8a(0x152)],0x0,_0x34babb),{'verbose':_0x588eec[_0x446b8a(0x160)]}),_0x4a6491=_0x5e1587['data'];console[_0x446b8a(0x13e)]('✔\x20Built\x20tree\x20with\x20'+_0x4a6491[_0x446b8a(0x159)]+_0x446b8a(0x157));if(_0x588eec[_0x446b8a(0x143)]===_0x446b8a(0x15d)||_0x588eec[_0x446b8a(0x143)]===_0x446b8a(0x139))await handleSDKOutput(_0x4a6491,_0x588eec);else{console[_0x446b8a(0x15c)](a35_0x517637['dim']('[/'+_0x2f7913+']'));const _0x5158b2=formatTree(_0x4a6491,{'showMetadata':!![]});console['log'](_0x5158b2);}return 0x0;}}
1
+ const a35_0x62aa24=a35_0x5d36;(function(_0x5992f7,_0x52dee2){const _0x356130=a35_0x5d36,_0x1aba37=_0x5992f7();while(!![]){try{const _0x145204=parseInt(_0x356130(0x145))/0x1*(-parseInt(_0x356130(0x14f))/0x2)+-parseInt(_0x356130(0x158))/0x3+-parseInt(_0x356130(0x134))/0x4+-parseInt(_0x356130(0x135))/0x5+parseInt(_0x356130(0x123))/0x6*(-parseInt(_0x356130(0x12a))/0x7)+-parseInt(_0x356130(0x11a))/0x8*(-parseInt(_0x356130(0x153))/0x9)+parseInt(_0x356130(0x149))/0xa;if(_0x145204===_0x52dee2)break;else _0x1aba37['push'](_0x1aba37['shift']());}catch(_0x59f413){_0x1aba37['push'](_0x1aba37['shift']());}}}(a35_0x4e98,0x32b0b));function a35_0x4e98(){const _0x2c6d7e=['Path/pattern\x20arg:\x20','includes','👥\x20','882846hlLLhV','Resolving\x20context\x20path\x20\x27','Building\x20hierarchy\x20tree...','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','segments','parentId','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','jsonl','56LABhku','format','sort','log','map','No\x20parent\x20segments\x20match\x20pattern:\x20','folderId','(empty)','name','6MIqzDb','listUnified','\x20top-level\x20items','\x27...','✔\x20Found\x20','localeCompare','verbose','109277NYoiTx','segment','Listing\x20parent\x20segments\x20matching\x20\x27','attributes','Current\x20context:\x20','execute','json','cause','error','folder','1046168pPLjMU','912190DTRVcc','listRecursive','recursive','length','Parent\x20ID:\x20','\x20segment','data','listParentsWithPattern','\x20parent\x20segment','\x20and\x20','test','listParents','maxDepth','\x5c$&','✔\x20Built\x20tree\x20with\x20','\x20matching\x20\x27','1kbglGa','\x20folder','resolvePathToResource','Error:\x20','7771540PkRWhb','Recursive\x20mode:\x20enabled','[parent\x20segments]','replace','site','population','218566qRGgxO','description','dim','Folder\x20ID:\x20','377523mWJpMs','message'];a35_0x4e98=function(){return _0x2c6d7e;};return a35_0x4e98();}function a35_0x5d36(_0x3240b3,_0x2b9522){const _0x4e98a0=a35_0x4e98();return a35_0x5d36=function(_0x5d3625,_0x3b61e3){_0x5d3625=_0x5d3625-0x115;let _0x5220f8=_0x4e98a0[_0x5d3625];return _0x5220f8;},a35_0x5d36(_0x3240b3,_0x2b9522);}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 a35_0x5a45b2 from'chalk';export class SegmentsCommand extends BaseCommand{[a35_0x62aa24(0x122)]=a35_0x62aa24(0x116);[a35_0x62aa24(0x150)]=a35_0x62aa24(0x118);async[a35_0x62aa24(0x12f)](_0x528916){const _0x31a5e5=a35_0x62aa24,{options:_0x4c2948,args:_0x3da71c}=_0x528916,_0x559eaf=_0x4c2948[_0x31a5e5(0x137)],_0xdf1cab=_0x3da71c[0x0];try{const _0x2c71cd=_0x4c2948['segmentPath'];_0x4c2948[_0x31a5e5(0x129)]&&(console[_0x31a5e5(0x132)]('Site:\x20'+_0x4c2948[_0x31a5e5(0x14d)]),console[_0x31a5e5(0x132)](_0x31a5e5(0x12e)+(_0x2c71cd||'/')),_0xdf1cab&&console['error'](_0x31a5e5(0x155)+_0xdf1cab),_0x559eaf&&console[_0x31a5e5(0x132)](_0x31a5e5(0x14a)));if(_0xdf1cab){const _0x55c43d=_0xdf1cab['includes']('*')||_0xdf1cab[_0x31a5e5(0x156)]('?');if(_0x55c43d&&!_0x2c71cd)return await this[_0x31a5e5(0x13c)](_0x528916,_0xdf1cab);else return _0x55c43d?(console['error'](_0x31a5e5(0x115)),console[_0x31a5e5(0x132)]('Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/'),0x1):_0x559eaf?await this[_0x31a5e5(0x136)](_0x528916,_0xdf1cab):await this[_0x31a5e5(0x124)](_0x528916,_0xdf1cab);}if(!_0x2c71cd)return await this[_0x31a5e5(0x140)](_0x528916);return _0x559eaf?await this[_0x31a5e5(0x136)](_0x528916,_0x2c71cd):await this[_0x31a5e5(0x124)](_0x528916,_0x2c71cd);}catch(_0x4bedd6){if(_0x4bedd6 instanceof SDKError)return console[_0x31a5e5(0x132)](_0x31a5e5(0x148)+_0x4bedd6[_0x31a5e5(0x154)]),_0x4bedd6[_0x31a5e5(0x131)]&&console['error']('\x20\x20Cause:\x20'+_0x4bedd6[_0x31a5e5(0x131)]),0x1;throw _0x4bedd6;}}async[a35_0x62aa24(0x13c)](_0x3228ba,_0x1388c4){const _0xd3f276=a35_0x62aa24,{options:_0x1d79ed,tdx:_0x5224c9}=_0x3228ba,_0x690247=await withSpinner(_0xd3f276(0x12c)+_0x1388c4+_0xd3f276(0x126),()=>_0x5224c9[_0xd3f276(0x12b)][_0xd3f276(0x140)](),{'verbose':_0x1d79ed['verbose']}),_0x3b65dd=_0x690247['data'],_0x290729=_0x1388c4[_0xd3f276(0x14c)](/[.+^${}()|[\]\\]/g,_0xd3f276(0x142))[_0xd3f276(0x14c)](/\*/g,'.*')[_0xd3f276(0x14c)](/\?/g,'.'),_0xb60d29=new RegExp('^'+_0x290729+'$','i'),_0x516c65=_0x3b65dd['filter'](_0xe42ba3=>_0xb60d29[_0xd3f276(0x13f)](_0xe42ba3[_0xd3f276(0x12d)][_0xd3f276(0x122)]));console[_0xd3f276(0x132)](_0xd3f276(0x127)+_0x516c65[_0xd3f276(0x138)]+_0xd3f276(0x13d)+(_0x516c65[_0xd3f276(0x138)]!==0x1?'s':'')+_0xd3f276(0x144)+_0x1388c4+'\x27');if(_0x1d79ed[_0xd3f276(0x11b)]===_0xd3f276(0x130)||_0x1d79ed['format']===_0xd3f276(0x119))await handleSDKOutput(_0x516c65,_0x1d79ed);else{if(_0x516c65[_0xd3f276(0x138)]===0x0)console[_0xd3f276(0x11d)](_0xd3f276(0x11f)+_0x1388c4);else{console[_0xd3f276(0x11d)]('[parent\x20segments]');for(const _0x5a6a74 of _0x516c65){const _0x5727b0=_0x5a6a74[_0xd3f276(0x12d)][_0xd3f276(0x14e)]?a35_0x5a45b2[_0xd3f276(0x151)]('\x20('+formatRows(_0x5a6a74[_0xd3f276(0x12d)][_0xd3f276(0x14e)])+')'):'';console[_0xd3f276(0x11d)]('👥\x20'+_0x5a6a74[_0xd3f276(0x12d)][_0xd3f276(0x122)]+_0x5727b0);}}}return 0x0;}async[a35_0x62aa24(0x140)](_0x45cb84){const _0x1f3ec5=a35_0x62aa24,{options:_0x43e5bf,tdx:_0x4a1938}=_0x45cb84,_0x383b37=await withSpinner('Listing\x20parent\x20segments...',()=>_0x4a1938[_0x1f3ec5(0x12b)][_0x1f3ec5(0x140)](),{'verbose':_0x43e5bf['verbose']}),_0x5af6aa=_0x383b37[_0x1f3ec5(0x13b)];console['error'](_0x1f3ec5(0x127)+_0x5af6aa[_0x1f3ec5(0x138)]+_0x1f3ec5(0x13d)+(_0x5af6aa[_0x1f3ec5(0x138)]!==0x1?'s':''));if(_0x43e5bf[_0x1f3ec5(0x11b)]==='json'||_0x43e5bf[_0x1f3ec5(0x11b)]===_0x1f3ec5(0x119))await handleSDKOutput(_0x5af6aa,_0x43e5bf);else{console[_0x1f3ec5(0x11d)](_0x1f3ec5(0x14b));for(const _0xcced33 of _0x5af6aa){const _0x408e6a=_0xcced33[_0x1f3ec5(0x12d)][_0x1f3ec5(0x14e)]?a35_0x5a45b2['dim']('\x20('+formatRows(_0xcced33['attributes']['population'])+')'):'';console[_0x1f3ec5(0x11d)](_0x1f3ec5(0x157)+_0xcced33[_0x1f3ec5(0x12d)][_0x1f3ec5(0x122)]+_0x408e6a);}}return 0x0;}async[a35_0x62aa24(0x124)](_0x430207,_0x5e33c6){const _0x179f8f=a35_0x62aa24,{options:_0x206918,tdx:_0x86edd5}=_0x430207,_0x5a3e6a=await withSpinner('Resolving\x20context\x20path\x20\x27'+_0x5e33c6+_0x179f8f(0x126),()=>_0x86edd5[_0x179f8f(0x12b)]['resolvePathToResource'](_0x5e33c6),{'verbose':_0x206918['verbose']}),_0x2050a6=_0x5a3e6a[_0x179f8f(0x13b)];_0x206918[_0x179f8f(0x129)]&&(console[_0x179f8f(0x132)](_0x179f8f(0x139)+_0x2050a6[_0x179f8f(0x117)]),_0x2050a6[_0x179f8f(0x120)]&&console['error'](_0x179f8f(0x152)+_0x2050a6[_0x179f8f(0x120)]));const _0x5a6fce=await withSpinner('Listing\x20folders\x20and\x20segments...',()=>_0x86edd5[_0x179f8f(0x12b)]['listUnified'](_0x2050a6[_0x179f8f(0x117)],_0x2050a6[_0x179f8f(0x120)]),{'verbose':_0x206918[_0x179f8f(0x129)]}),{folders:_0x322eb5,segments:_0x369fb5}=_0x5a6fce[_0x179f8f(0x13b)],_0xe0a4ea=_0x322eb5[_0x179f8f(0x138)]+_0x369fb5['length'];console['error']('✔\x20Found\x20'+_0x322eb5[_0x179f8f(0x138)]+_0x179f8f(0x146)+(_0x322eb5[_0x179f8f(0x138)]!==0x1?'s':'')+_0x179f8f(0x13e)+_0x369fb5[_0x179f8f(0x138)]+_0x179f8f(0x13a)+(_0x369fb5[_0x179f8f(0x138)]!==0x1?'s':''));if(_0x206918[_0x179f8f(0x11b)]==='json'||_0x206918[_0x179f8f(0x11b)]===_0x179f8f(0x119)){const _0x4c15dc=[..._0x322eb5['map'](_0x5d4cd9=>({..._0x5d4cd9,'type':_0x179f8f(0x133)})),..._0x369fb5[_0x179f8f(0x11e)](_0x3af00b=>({..._0x3af00b,'type':_0x179f8f(0x12b)}))][_0x179f8f(0x11c)]((_0xc709e5,_0x46b1c6)=>_0xc709e5[_0x179f8f(0x122)][_0x179f8f(0x128)](_0x46b1c6[_0x179f8f(0x122)]));await handleSDKOutput(_0x4c15dc,_0x206918);}else{if(_0xe0a4ea===0x0)console[_0x179f8f(0x11d)](a35_0x5a45b2[_0x179f8f(0x151)]('[/'+_0x5e33c6+']')),console[_0x179f8f(0x11d)](_0x179f8f(0x121));else{console[_0x179f8f(0x11d)](a35_0x5a45b2[_0x179f8f(0x151)]('[/'+_0x5e33c6+']'));const _0x555480=formatFlatList(_0x322eb5,_0x369fb5,{'showMetadata':!![]});console['log'](_0x555480);}}return 0x0;}async[a35_0x62aa24(0x136)](_0x8d14be,_0x4267e9){const _0x47997b=a35_0x62aa24,{options:_0x11824d,tdx:_0x554330}=_0x8d14be,_0x12bfbf=await withSpinner(_0x47997b(0x159)+_0x4267e9+_0x47997b(0x126),()=>_0x554330[_0x47997b(0x12b)][_0x47997b(0x147)](_0x4267e9),{'verbose':_0x11824d[_0x47997b(0x129)]}),_0x187cf7=_0x12bfbf['data'];_0x11824d['verbose']&&(console[_0x47997b(0x132)](_0x47997b(0x139)+_0x187cf7[_0x47997b(0x117)]),_0x187cf7[_0x47997b(0x120)]&&console[_0x47997b(0x132)](_0x47997b(0x152)+_0x187cf7['folderId']));const _0x4b654a=_0x11824d[_0x47997b(0x141)]||0xa,_0x54d40b=await withSpinner(_0x47997b(0x15a),()=>_0x554330[_0x47997b(0x12b)]['listRecursive'](_0x187cf7['parentId'],_0x187cf7[_0x47997b(0x120)],0x0,_0x4b654a),{'verbose':_0x11824d['verbose']}),_0x5eec9c=_0x54d40b[_0x47997b(0x13b)];console[_0x47997b(0x132)](_0x47997b(0x143)+_0x5eec9c['length']+_0x47997b(0x125));if(_0x11824d['format']===_0x47997b(0x130)||_0x11824d[_0x47997b(0x11b)]===_0x47997b(0x119))await handleSDKOutput(_0x5eec9c,_0x11824d);else{console[_0x47997b(0x11d)](a35_0x5a45b2[_0x47997b(0x151)]('[/'+_0x4267e9+']'));const _0x435baa=formatTree(_0x5eec9c,{'showMetadata':!![]});console[_0x47997b(0x11d)](_0x435baa);}return 0x0;}}
@@ -1 +1 @@
1
- function a36_0x4a36(){const _0x3dba42=['showTable','description','execute','message','error','database','\x20\x20Cause:\x20','Site:\x20','3064965tqeutK','limit','data','Error:\x20','Table:\x20','args','name','2414154dxeXYP','✔\x20Retrieved\x20','1053634QmqUfb','length','7ulpbbJ','...','2329268FwFvBa','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','1739600lirvbO','validate','5eiJZGx','Usage:\x20tdx\x20show\x20<database.table>','Database:\x20','Limit:\x20','Catalog:\x20','show','site','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','cause','catalog','verbose','14540418nhxULp','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','7011432ZeiNnP','\x20row'];a36_0x4a36=function(){return _0x3dba42;};return a36_0x4a36();}const a36_0x2a7532=a36_0x2860;(function(_0x298647,_0xb35a72){const _0x2324fb=a36_0x2860,_0x3a789d=_0x298647();while(!![]){try{const _0x521fce=-parseInt(_0x2324fb(0x17d))/0x1+parseInt(_0x2324fb(0x183))/0x2+parseInt(_0x2324fb(0x174))/0x3+parseInt(_0x2324fb(0x181))/0x4*(-parseInt(_0x2324fb(0x15d))/0x5)+-parseInt(_0x2324fb(0x17b))/0x6*(parseInt(_0x2324fb(0x17f))/0x7)+-parseInt(_0x2324fb(0x16a))/0x8+parseInt(_0x2324fb(0x168))/0x9;if(_0x521fce===_0xb35a72)break;else _0x3a789d['push'](_0x3a789d['shift']());}catch(_0x8e3d93){_0x3a789d['push'](_0x3a789d['shift']());}}}(a36_0x4a36,0x909be));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a36_0x2860(_0x22d2e7,_0x9ca8ca){const _0x4a36ec=a36_0x4a36();return a36_0x2860=function(_0x28601f,_0x4528cf){_0x28601f=_0x28601f-0x15c;let _0x245cde=_0x4a36ec[_0x28601f];return _0x245cde;},a36_0x2860(_0x22d2e7,_0x9ca8ca);}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{[a36_0x2a7532(0x17a)]=a36_0x2a7532(0x162);[a36_0x2a7532(0x16d)]='Show\x20table\x20contents';async[a36_0x2a7532(0x16e)](_0x4c5b0e){return this['showTable'](_0x4c5b0e);}async[a36_0x2a7532(0x16c)](_0x42844b){const _0xf9103b=a36_0x2a7532,{options:_0x5ace61,args:_0x4fa4eb,tdx:_0x2c3e3c}=_0x42844b;let _0x44b6c4;try{_0x44b6c4=parseTableReference(_0x4fa4eb[0x0]);const _0x552724=_0x5ace61[_0xf9103b(0x171)];!_0x44b6c4[_0xf9103b(0x171)]&&_0x552724&&(_0x44b6c4[_0xf9103b(0x171)]=_0x552724);const _0x47f365=validateTableDescribeReference(_0x44b6c4);if(_0x47f365)return console[_0xf9103b(0x170)](_0xf9103b(0x177)+_0x47f365),console[_0xf9103b(0x170)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0xf9103b(0x170)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x1ff059){return console[_0xf9103b(0x170)](_0xf9103b(0x177)+_0x1ff059['message']),console['error'](_0xf9103b(0x15e)),console[_0xf9103b(0x170)](_0xf9103b(0x182)),console[_0xf9103b(0x170)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x295268=_0x44b6c4[_0xf9103b(0x166)],_0x42323b=_0x44b6c4[_0xf9103b(0x171)],_0x56bcf1=_0x44b6c4['table'],_0x11a30b=resolveLimit(_0x5ace61[_0xf9103b(0x175)],DEFAULT_DISPLAY_LIMIT);try{_0x5ace61[_0xf9103b(0x167)]&&(console['error'](_0xf9103b(0x173)+_0x5ace61[_0xf9103b(0x163)]),_0x295268&&console[_0xf9103b(0x170)](_0xf9103b(0x161)+_0x295268),console[_0xf9103b(0x170)](_0xf9103b(0x15f)+_0x42323b),console['error'](_0xf9103b(0x178)+_0x56bcf1),console[_0xf9103b(0x170)](_0xf9103b(0x160)+_0x11a30b));const _0x2faa26=_0x295268?_0x295268+'.'+_0x42323b+'.'+_0x56bcf1:_0x42323b+'.'+_0x56bcf1,_0x362534=await withSpinner('Querying\x20'+_0x2faa26+_0xf9103b(0x180),()=>_0x2c3e3c['query']['showTable'](_0x42323b,_0x56bcf1,_0x11a30b,_0x295268),{'verbose':_0x5ace61[_0xf9103b(0x167)]}),_0x457b58=_0x362534[_0xf9103b(0x176)],_0x4b178a=_0x457b58[_0xf9103b(0x176)];return _0x4b178a[_0xf9103b(0x17e)]===0x0?console[_0xf9103b(0x170)](_0xf9103b(0x169)):console[_0xf9103b(0x170)](_0xf9103b(0x17c)+_0x4b178a[_0xf9103b(0x17e)]+_0xf9103b(0x16b)+(_0x4b178a[_0xf9103b(0x17e)]!==0x1?'s':'')+'\x20from\x20'+_0x2faa26),await handleSDKOutput(_0x4b178a,_0x5ace61),0x0;}catch(_0x44e18f){if(_0x44e18f instanceof SDKError)return console['error']('Error:\x20'+_0x44e18f[_0xf9103b(0x16f)]),_0x44e18f[_0xf9103b(0x165)]&&console[_0xf9103b(0x170)](_0xf9103b(0x172)+_0x44e18f[_0xf9103b(0x165)]),0x1;throw _0x44e18f;}}[a36_0x2a7532(0x15c)](_0x458850){const _0x1d5383=a36_0x2a7532;if(_0x458850['args'][_0x1d5383(0x17e)]===0x0)return _0x1d5383(0x164);if(_0x458850[_0x1d5383(0x179)][_0x1d5383(0x17e)]>0x1)return'Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';return undefined;}}
1
+ const a36_0x26bb2a=a36_0x1994;(function(_0x57524a,_0x5593ee){const _0x38eeb0=a36_0x1994,_0x18796c=_0x57524a();while(!![]){try{const _0x2bf22e=parseInt(_0x38eeb0(0xbf))/0x1+parseInt(_0x38eeb0(0xc4))/0x2*(parseInt(_0x38eeb0(0xb5))/0x3)+parseInt(_0x38eeb0(0xba))/0x4+-parseInt(_0x38eeb0(0xbb))/0x5*(-parseInt(_0x38eeb0(0xa9))/0x6)+-parseInt(_0x38eeb0(0xaf))/0x7+parseInt(_0x38eeb0(0xb3))/0x8*(-parseInt(_0x38eeb0(0xa5))/0x9)+-parseInt(_0x38eeb0(0xae))/0xa;if(_0x2bf22e===_0x5593ee)break;else _0x18796c['push'](_0x18796c['shift']());}catch(_0x1e1e0d){_0x18796c['push'](_0x18796c['shift']());}}}(a36_0xbfbf,0x416a0));function a36_0xbfbf(){const _0x2e36ab=['site','✔\x20Retrieved\x20','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','1663624enoUkm','2935VfQHXT','args','Usage:\x20tdx\x20show\x20<database.table>','\x20from\x20','187576AAWLSC','length','limit','database','data','126508NHMaUl','execute','showTable','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','Table:\x20','Error:\x20','Limit:\x20','Site:\x20','show','Show\x20table\x20contents','90HryabC','message','validate','Querying\x20','3426RbPFMT','description','Database:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','verbose','1047280GFXhpL','2378313cQsJqR','error','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','table','231592IrrWbq','\x20row','3btDtSB','\x20\x20Cause:\x20'];a36_0xbfbf=function(){return _0x2e36ab;};return a36_0xbfbf();}function a36_0x1994(_0x52fc72,_0x3cd730){const _0xbfbfd6=a36_0xbfbf();return a36_0x1994=function(_0x19948e,_0xf668db){_0x19948e=_0x19948e-0x9e;let _0x470232=_0xbfbfd6[_0x19948e];return _0x470232;},a36_0x1994(_0x52fc72,_0x3cd730);}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';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{['name']=a36_0x26bb2a(0xa3);[a36_0x26bb2a(0xaa)]=a36_0x26bb2a(0xa4);async[a36_0x26bb2a(0xc5)](_0x1b56e9){return this['showTable'](_0x1b56e9);}async[a36_0x26bb2a(0xc6)](_0x31dcf5){const _0x667108=a36_0x26bb2a,{options:_0x399eed,args:_0x25ffce,tdx:_0x225cda}=_0x31dcf5;let _0x528f73;try{_0x528f73=parseTableReference(_0x25ffce[0x0]);const _0x33be1c=_0x399eed[_0x667108(0xc2)];!_0x528f73[_0x667108(0xc2)]&&_0x33be1c&&(_0x528f73['database']=_0x33be1c);const _0x210942=validateTableDescribeReference(_0x528f73);if(_0x210942)return console['error'](_0x667108(0xa0)+_0x210942),console[_0x667108(0xb0)](_0x667108(0xbd)),console['error'](_0x667108(0xac)),console[_0x667108(0xb0)](_0x667108(0xc7)),0x1;}catch(_0x4838ca){return console[_0x667108(0xb0)](_0x667108(0xa0)+_0x4838ca[_0x667108(0xa6)]),console[_0x667108(0xb0)](_0x667108(0xbd)),console[_0x667108(0xb0)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x667108(0xb0)](_0x667108(0xc7)),0x1;}const _0x418c37=_0x528f73['catalog'],_0x1f7c8d=_0x528f73['database'],_0xacc322=_0x528f73[_0x667108(0xb2)],_0x4e7352=resolveLimit(_0x399eed[_0x667108(0xc1)],DEFAULT_DISPLAY_LIMIT);try{_0x399eed[_0x667108(0xad)]&&(console[_0x667108(0xb0)](_0x667108(0xa2)+_0x399eed[_0x667108(0xb7)]),_0x418c37&&console['error']('Catalog:\x20'+_0x418c37),console[_0x667108(0xb0)](_0x667108(0xab)+_0x1f7c8d),console[_0x667108(0xb0)](_0x667108(0x9f)+_0xacc322),console[_0x667108(0xb0)](_0x667108(0xa1)+_0x4e7352));const _0x376431=_0x418c37?_0x418c37+'.'+_0x1f7c8d+'.'+_0xacc322:_0x1f7c8d+'.'+_0xacc322,_0x444dbb=await withSpinner(_0x667108(0xa8)+_0x376431+'...',()=>_0x225cda['query']['showTable'](_0x1f7c8d,_0xacc322,_0x4e7352,_0x418c37),{'verbose':_0x399eed[_0x667108(0xad)]}),_0x73163=_0x444dbb['data'],_0x903a6=_0x73163[_0x667108(0xc3)];return _0x903a6[_0x667108(0xc0)]===0x0?console[_0x667108(0xb0)](_0x667108(0x9e)):console[_0x667108(0xb0)](_0x667108(0xb8)+_0x903a6[_0x667108(0xc0)]+_0x667108(0xb4)+(_0x903a6[_0x667108(0xc0)]!==0x1?'s':'')+_0x667108(0xbe)+_0x376431),await handleSDKOutput(_0x903a6,_0x399eed),0x0;}catch(_0x3cce75){if(_0x3cce75 instanceof SDKError)return console[_0x667108(0xb0)]('Error:\x20'+_0x3cce75[_0x667108(0xa6)]),_0x3cce75['cause']&&console[_0x667108(0xb0)](_0x667108(0xb6)+_0x3cce75['cause']),0x1;throw _0x3cce75;}}[a36_0x26bb2a(0xa7)](_0x33d6ca){const _0x40ebd0=a36_0x26bb2a;if(_0x33d6ca[_0x40ebd0(0xbc)]['length']===0x0)return _0x40ebd0(0xb9);if(_0x33d6ca['args'][_0x40ebd0(0xc0)]>0x1)return _0x40ebd0(0xb1);return undefined;}}
@@ -1 +1 @@
1
- const a37_0x3e6f87=a37_0x27c7;(function(_0x1d7b2f,_0x4720e5){const _0x51fe2b=a37_0x27c7,_0x618738=_0x1d7b2f();while(!![]){try{const _0x41ad1e=parseInt(_0x51fe2b(0x1aa))/0x1+parseInt(_0x51fe2b(0x1a2))/0x2+-parseInt(_0x51fe2b(0x1ce))/0x3+-parseInt(_0x51fe2b(0x1a1))/0x4*(-parseInt(_0x51fe2b(0x1a6))/0x5)+parseInt(_0x51fe2b(0x1b8))/0x6*(parseInt(_0x51fe2b(0x1b0))/0x7)+parseInt(_0x51fe2b(0x1ca))/0x8+-parseInt(_0x51fe2b(0x1bb))/0x9;if(_0x41ad1e===_0x4720e5)break;else _0x618738['push'](_0x618738['shift']());}catch(_0x5f4444){_0x618738['push'](_0x618738['shift']());}}}(a37_0x1ba3,0xa2fac));function a37_0x27c7(_0x354c23,_0x4f09cf){const _0x1ba373=a37_0x1ba3();return a37_0x27c7=function(_0x27c743,_0x599761){_0x27c743=_0x27c743-0x19f;let _0x3984d0=_0x1ba373[_0x27c743];return _0x3984d0;},a37_0x27c7(_0x354c23,_0x4f09cf);}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a37_0x3e6f87(0x1af)]='tables';[a37_0x3e6f87(0x1be)]='List\x20tables\x20in\x20a\x20database';async[a37_0x3e6f87(0x1b5)](_0x5d77a6){const _0x446412=a37_0x3e6f87,{options:_0x1f06e9,args:_0x141231,tdx:_0x573fa3}=_0x5d77a6;let _0x51d1a2;if(_0x141231[_0x446412(0x1ac)]===0x0)_0x51d1a2={'database':undefined,'table':undefined,'original':''};else{if(_0x141231[_0x446412(0x1ac)]===0x1)try{_0x51d1a2=parseTableReference(_0x141231[0x0]);if(_0x51d1a2[_0x446412(0x1b6)]&&!_0x51d1a2[_0x446412(0x1b3)]&&!_0x51d1a2[_0x446412(0x1b6)][_0x446412(0x1c4)]('*')&&!_0x51d1a2['table'][_0x446412(0x1c4)]('?'))return console[_0x446412(0x1b7)](_0x446412(0x1a5)+_0x141231[0x0]+_0x446412(0x1c9)),console[_0x446412(0x1b7)](_0x446412(0x1d0)+_0x51d1a2[_0x446412(0x1b6)]+'\x27?'),console['error'](_0x446412(0x1bc)+_0x51d1a2[_0x446412(0x1b6)]+_0x446412(0x1a9)),console['error'](_0x446412(0x1c3)+_0x51d1a2[_0x446412(0x1b6)]),console[_0x446412(0x1b7)](_0x446412(0x1a3)+_0x51d1a2[_0x446412(0x1b6)]),console[_0x446412(0x1b7)](''),console[_0x446412(0x1b7)]('Note:\x20\x27'+_0x141231[0x0]+_0x446412(0x19f)+_0x51d1a2[_0x446412(0x1b6)]+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x1167d1){return console[_0x446412(0x1b7)](_0x446412(0x1ae)+_0x1167d1['message']),0x1;}else return console[_0x446412(0x1b7)](_0x446412(0x1cd)),console[_0x446412(0x1b7)](_0x446412(0x1a4)),console['error']('\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),console[_0x446412(0x1b7)](_0x446412(0x1ad)),console['error'](_0x446412(0x1c5)),console[_0x446412(0x1b7)](_0x446412(0x1c7)),console['error'](_0x446412(0x1ba)),0x1;}const _0x2b34c6=_0x1f06e9['database'];!_0x51d1a2[_0x446412(0x1b3)]&&_0x2b34c6&&(_0x51d1a2['database']=_0x2b34c6);try{const _0xa46414=_0x4661b9=>_0x4661b9&&(_0x4661b9[_0x446412(0x1c4)]('*')||_0x4661b9['includes']('?')),_0x3b7d6b=_0xa46414(_0x51d1a2[_0x446412(0x1b3)]);_0x1f06e9['verbose']&&(console['error'](_0x446412(0x1cb)+_0x1f06e9[_0x446412(0x1a8)]),_0x51d1a2[_0x446412(0x1b3)]?_0x3b7d6b?console[_0x446412(0x1b7)](_0x446412(0x1cc)+_0x51d1a2[_0x446412(0x1b3)]):console[_0x446412(0x1b7)](_0x446412(0x1c0)+_0x51d1a2[_0x446412(0x1b3)]):console['error'](_0x446412(0x1bf)),_0x51d1a2['table']&&console[_0x446412(0x1b7)](_0x446412(0x1c2)+_0x51d1a2[_0x446412(0x1b6)]));const _0x2f09b7=_0x51d1a2[_0x446412(0x1b3)]&&!_0x3b7d6b?_0x51d1a2[_0x446412(0x1b3)]:undefined,_0x5f3d29=_0x3b7d6b?_0x51d1a2['database']:undefined,_0x3e9ce1=_0x51d1a2['table'],_0x5a4d33=resolveLimit(_0x1f06e9[_0x446412(0x1c6)],DEFAULT_LISTING_LIMIT),_0x172a44=await withSpinner(_0x446412(0x1d2),()=>_0x573fa3[_0x446412(0x1b2)][_0x446412(0x1a0)](_0x2f09b7,_0x3e9ce1,_0x5f3d29,_0x5a4d33),{'verbose':_0x1f06e9[_0x446412(0x1b1)]}),_0xbd2da7=_0x172a44[_0x446412(0x1b4)];if(_0xbd2da7[_0x446412(0x1ac)]===0x0&&_0x51d1a2[_0x446412(0x1b3)]&&!_0x3b7d6b)return console[_0x446412(0x1b7)](_0x446412(0x1ab)),console[_0x446412(0x1b7)](_0x446412(0x1c1)+_0x51d1a2['database']+_0x446412(0x1a7)),0x1;return console[_0x446412(0x1b7)](_0x446412(0x1cf)+_0xbd2da7[_0x446412(0x1ac)]+_0x446412(0x1d1)+(_0xbd2da7[_0x446412(0x1ac)]!==0x1?'s':'')),await handleSDKOutput(_0xbd2da7,{..._0x1f06e9,'limit':_0x5a4d33}),0x0;}catch(_0x5f2f3d){if(_0x5f2f3d instanceof SDKError)return console['error'](_0x446412(0x1ae)+_0x5f2f3d['message']),_0x5f2f3d['cause']&&console[_0x446412(0x1b7)](_0x446412(0x1bd)+_0x5f2f3d[_0x446412(0x1b9)]),0x1;throw _0x5f2f3d;}}[a37_0x3e6f87(0x1c8)](_0x3bd763){return undefined;}}function a37_0x1ba3(){const _0x14fe7c=['Error:\x20','name','70fsGxOk','verbose','query','database','data','execute','table','error','521970AJGOIo','cause','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','20404269qDxZfJ','\x20\x20Use:\x20tdx\x20tables\x20\x22','\x20\x20Cause:\x20','description','Database:\x20all','Database:\x20','Database\x20\x27','Table\x20pattern:\x20','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','includes','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','limit','Or\x20use\x20--in\x20flag:','validate','\x27\x20is\x20ambiguous.','2671464uhQtqn','Site:\x20','Database\x20pattern:\x20','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','989253cyNaWT','✔\x20Found\x20','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','\x20table','Listing\x20tables...','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','listTables','12BWrrde','749804MiuWIP','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','Error:\x20Pattern\x20\x27','1001690pPLjhU','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','site','.*\x22','1084657YVMevG','✖\x20No\x20tables\x20found','length','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'];a37_0x1ba3=function(){return _0x14fe7c;};return a37_0x1ba3();}
1
+ function a37_0x2caf(_0x3c579d,_0x3e40ee){const _0x5dc1d9=a37_0x5dc1();return a37_0x2caf=function(_0x2caffc,_0x2ded92){_0x2caffc=_0x2caffc-0x123;let _0x56487b=_0x5dc1d9[_0x2caffc];return _0x56487b;},a37_0x2caf(_0x3c579d,_0x3e40ee);}const a37_0x5f5094=a37_0x2caf;(function(_0x54dd4a,_0x1e8558){const _0x265d3e=a37_0x2caf,_0xb39a1b=_0x54dd4a();while(!![]){try{const _0x115be0=-parseInt(_0x265d3e(0x142))/0x1+-parseInt(_0x265d3e(0x134))/0x2*(-parseInt(_0x265d3e(0x123))/0x3)+parseInt(_0x265d3e(0x13f))/0x4*(parseInt(_0x265d3e(0x13d))/0x5)+-parseInt(_0x265d3e(0x132))/0x6+parseInt(_0x265d3e(0x149))/0x7+-parseInt(_0x265d3e(0x138))/0x8+parseInt(_0x265d3e(0x14e))/0x9*(parseInt(_0x265d3e(0x144))/0xa);if(_0x115be0===_0x1e8558)break;else _0xb39a1b['push'](_0xb39a1b['shift']());}catch(_0x33bf2d){_0xb39a1b['push'](_0xb39a1b['shift']());}}}(a37_0x5dc1,0x7fe80));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';function a37_0x5dc1(){const _0x2de4a8=['site','\x27\x20across\x20all\x20databases.','message','limit','table','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','Database\x20pattern:\x20','2853972Njltun','Table\x20pattern:\x20','36ccLwOf','\x20\x20Cause:\x20','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Database\x20\x27','2981136GYuDda','Error:\x20','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','Site:\x20','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','830975wAroKo','verbose','4hWvHnV','includes','✖\x20No\x20tables\x20found','126618xeTaic','cause','59790WTdbFg','error','\x27\x20is\x20ambiguous.','name','Or\x20use\x20--in\x20flag:','6936034cXgARL','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','Database:\x20','query','database','225xCkTik','32049RqXzhI','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','length','.*\x22','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','listTables','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'];a37_0x5dc1=function(){return _0x2de4a8;};return a37_0x5dc1();}import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a37_0x5f5094(0x147)]='tables';['description']='List\x20tables\x20in\x20a\x20database';async['execute'](_0x47bc85){const _0x26809e=a37_0x5f5094,{options:_0x38ac5a,args:_0x4ad844,tdx:_0x2e98ef}=_0x47bc85;let _0x428e0f;if(_0x4ad844['length']===0x0)_0x428e0f={'database':undefined,'table':undefined,'original':''};else{if(_0x4ad844[_0x26809e(0x126)]===0x1)try{_0x428e0f=parseTableReference(_0x4ad844[0x0]);if(_0x428e0f[_0x26809e(0x12f)]&&!_0x428e0f[_0x26809e(0x14d)]&&!_0x428e0f['table'][_0x26809e(0x140)]('*')&&!_0x428e0f[_0x26809e(0x12f)][_0x26809e(0x140)]('?'))return console['error']('Error:\x20Pattern\x20\x27'+_0x4ad844[0x0]+_0x26809e(0x146)),console[_0x26809e(0x145)](_0x26809e(0x12a)+_0x428e0f[_0x26809e(0x12f)]+'\x27?'),console[_0x26809e(0x145)]('\x20\x20Use:\x20tdx\x20tables\x20\x22'+_0x428e0f['table']+_0x26809e(0x127)),console[_0x26809e(0x145)](_0x26809e(0x13c)+_0x428e0f[_0x26809e(0x12f)]),console[_0x26809e(0x145)](_0x26809e(0x130)+_0x428e0f[_0x26809e(0x12f)]),console[_0x26809e(0x145)](''),console['error']('Note:\x20\x27'+_0x4ad844[0x0]+'\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27'+_0x428e0f['table']+_0x26809e(0x12c)),0x1;}catch(_0x4c5c28){return console[_0x26809e(0x145)](_0x26809e(0x139)+_0x4c5c28['message']),0x1;}else return console[_0x26809e(0x145)](_0x26809e(0x124)),console['error'](_0x26809e(0x14a)),console[_0x26809e(0x145)](_0x26809e(0x136)),console['error'](_0x26809e(0x128)),console[_0x26809e(0x145)](_0x26809e(0x13a)),console[_0x26809e(0x145)](_0x26809e(0x148)),console['error'](_0x26809e(0x125)),0x1;}const _0x3ae665=_0x38ac5a[_0x26809e(0x14d)];!_0x428e0f[_0x26809e(0x14d)]&&_0x3ae665&&(_0x428e0f[_0x26809e(0x14d)]=_0x3ae665);try{const _0x19d56a=_0x35423d=>_0x35423d&&(_0x35423d[_0x26809e(0x140)]('*')||_0x35423d[_0x26809e(0x140)]('?')),_0x593764=_0x19d56a(_0x428e0f[_0x26809e(0x14d)]);_0x38ac5a[_0x26809e(0x13e)]&&(console[_0x26809e(0x145)](_0x26809e(0x13b)+_0x38ac5a[_0x26809e(0x12b)]),_0x428e0f[_0x26809e(0x14d)]?_0x593764?console[_0x26809e(0x145)](_0x26809e(0x131)+_0x428e0f[_0x26809e(0x14d)]):console[_0x26809e(0x145)](_0x26809e(0x14b)+_0x428e0f['database']):console['error']('Database:\x20all'),_0x428e0f[_0x26809e(0x12f)]&&console['error'](_0x26809e(0x133)+_0x428e0f[_0x26809e(0x12f)]));const _0x254259=_0x428e0f[_0x26809e(0x14d)]&&!_0x593764?_0x428e0f['database']:undefined,_0x4ec0fe=_0x593764?_0x428e0f[_0x26809e(0x14d)]:undefined,_0x1c1d70=_0x428e0f[_0x26809e(0x12f)],_0x3ed4ff=resolveLimit(_0x38ac5a[_0x26809e(0x12e)],DEFAULT_LISTING_LIMIT),_0xf49eb5=await withSpinner('Listing\x20tables...',()=>_0x2e98ef[_0x26809e(0x14c)][_0x26809e(0x129)](_0x254259,_0x1c1d70,_0x4ec0fe,_0x3ed4ff),{'verbose':_0x38ac5a[_0x26809e(0x13e)]}),_0x1f6cda=_0xf49eb5['data'];if(_0x1f6cda['length']===0x0&&_0x428e0f[_0x26809e(0x14d)]&&!_0x593764)return console['error'](_0x26809e(0x141)),console[_0x26809e(0x145)](_0x26809e(0x137)+_0x428e0f[_0x26809e(0x14d)]+'\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables'),0x1;return console['error']('✔\x20Found\x20'+_0x1f6cda[_0x26809e(0x126)]+'\x20table'+(_0x1f6cda['length']!==0x1?'s':'')),await handleSDKOutput(_0x1f6cda,{..._0x38ac5a,'limit':_0x3ed4ff}),0x0;}catch(_0x119986){if(_0x119986 instanceof SDKError)return console[_0x26809e(0x145)](_0x26809e(0x139)+_0x119986[_0x26809e(0x12d)]),_0x119986[_0x26809e(0x143)]&&console[_0x26809e(0x145)](_0x26809e(0x135)+_0x119986[_0x26809e(0x143)]),0x1;throw _0x119986;}}['validate'](_0x1db0e3){return undefined;}}
@@ -1,12 +1,14 @@
1
1
  /**
2
- * Use command - Set session-level context overrides
2
+ * Use command - Set session-level context overrides or show current context
3
3
  *
4
4
  * Usage:
5
- * tdx use database <name>
6
- * tdx use parent_segment <name>
7
- * tdx use llm_project <name>
8
- * tdx use profile <name>
9
- * tdx use engage_workspace <name>
5
+ * tdx use # Show current context
6
+ * tdx use --clear # Clear session context
7
+ * tdx use database <name> # Set session database
8
+ * tdx use parent_segment <name> # Set session parent segment
9
+ * tdx use llm_project <name> # Set session LLM project
10
+ * tdx use profile <name> # Set session profile
11
+ * tdx use engage_workspace <name> # Set session workspace
10
12
  */
11
13
  import { BaseCommand, type CommandContext } from "./command.js";
12
14
  export declare class UseCommand extends BaseCommand {
@@ -1 +1 @@
1
- {"version":3,"file":"use-command.d.ts","sourceRoot":"","sources":["../../src/commands/use-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAIhE,qBAAa,UAAW,SAAQ,WAAW;IACzC,QAAQ,CAAC,IAAI,SAAS;IACtB,QAAQ,CAAC,WAAW,+BAA+B;IAEnD,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS;IA6BzD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAiExD"}
1
+ {"version":3,"file":"use-command.d.ts","sourceRoot":"","sources":["../../src/commands/use-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAWhE,qBAAa,UAAW,SAAQ,WAAW;IACzC,QAAQ,CAAC,IAAI,SAAS;IACtB,QAAQ,CAAC,WAAW,+BAA+B;IAEnD,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS;IAoCzD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CA2GxD"}
@@ -1 +1 @@
1
- const a38_0x46dbd0=a38_0x53fd;(function(_0x11e4dd,_0x281a42){const _0x1c2e9a=a38_0x53fd,_0x370f95=_0x11e4dd();while(!![]){try{const _0x3c374f=-parseInt(_0x1c2e9a(0xd1))/0x1+-parseInt(_0x1c2e9a(0xdd))/0x2*(parseInt(_0x1c2e9a(0xcb))/0x3)+parseInt(_0x1c2e9a(0xd7))/0x4*(-parseInt(_0x1c2e9a(0xce))/0x5)+parseInt(_0x1c2e9a(0xd5))/0x6*(parseInt(_0x1c2e9a(0xe3))/0x7)+parseInt(_0x1c2e9a(0xea))/0x8*(-parseInt(_0x1c2e9a(0xcf))/0x9)+-parseInt(_0x1c2e9a(0xe2))/0xa*(-parseInt(_0x1c2e9a(0xde))/0xb)+parseInt(_0x1c2e9a(0xeb))/0xc;if(_0x3c374f===_0x281a42)break;else _0x370f95['push'](_0x370f95['shift']());}catch(_0x486421){_0x370f95['push'](_0x370f95['shift']());}}}(a38_0x1024,0x4b7bb));import{BaseCommand}from'./command.js';function a38_0x53fd(_0x354584,_0x10d628){const _0x10246c=a38_0x1024();return a38_0x53fd=function(_0x53fd95,_0x9cb112){_0x53fd95=_0x53fd95-0xc8;let _0x45b233=_0x10246c[_0x53fd95];return _0x45b233;},a38_0x53fd(_0x354584,_0x10d628);}import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';import{profileExists}from'../core/profile.js';export class UseCommand extends BaseCommand{[a38_0x46dbd0(0xec)]=a38_0x46dbd0(0xee);[a38_0x46dbd0(0xd8)]=a38_0x46dbd0(0xd0);[a38_0x46dbd0(0xcd)](_0x20e80b){const _0x934bbd=a38_0x46dbd0,{args:_0xfee644}=_0x20e80b;if(_0xfee644[_0x934bbd(0xd3)]<0x2)return _0x934bbd(0xc9)+_0x934bbd(0xc8)+'Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a'+_0x934bbd(0xe4);const _0x5bc808=_0xfee644[0x0],_0x556b44=[_0x934bbd(0xca),'parent_segment',_0x934bbd(0xe9),'profile',_0x934bbd(0xda)];if(!_0x556b44[_0x934bbd(0xe5)](_0x5bc808))return _0x934bbd(0xcc)+_0x5bc808+_0x934bbd(0xdf)+_0x556b44[_0x934bbd(0xef)](',\x20');return undefined;}async['execute'](_0x59e16c){const _0x1733cb=a38_0x46dbd0,{args:_0x2f9fb8,options:_0x4299b7}=_0x59e16c;try{const _0x4ff3fb=_0x2f9fb8[0x0],_0x5f2507=_0x2f9fb8[0x1];if(_0x4ff3fb===_0x1733cb(0xe7)){if(!profileExists(_0x5f2507))return console[_0x1733cb(0xd2)](_0x1733cb(0xe1)+_0x5f2507+'\x27\x20does\x20not\x20exist'),console[_0x1733cb(0xd2)](_0x1733cb(0xdc)),0x1;const _0x171c5f=_0x4299b7[_0x1733cb(0xe8)]||getCurrentSessionPID()['toString']();return saveSessionContext({'profile':_0x5f2507},_0x4299b7['session']),console['log'](_0x1733cb(0xd4)+_0x5f2507+_0x1733cb(0xf1)+_0x171c5f+')'),console['log']('\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}const _0x249155={},_0x3c63c6=_0x4299b7['session']||getCurrentSessionPID()[_0x1733cb(0xd6)]();switch(_0x4ff3fb){case'database':_0x249155[_0x1733cb(0xca)]=_0x5f2507,console['log'](_0x1733cb(0xd9)+_0x5f2507+_0x1733cb(0xf1)+_0x3c63c6+')');break;case'parent_segment':_0x249155[_0x1733cb(0xe0)]=_0x5f2507,console[_0x1733cb(0xdb)]('Session\x20parent_segment\x20set\x20to:\x20'+_0x5f2507+'\x20(session:\x20'+_0x3c63c6+')');break;case'llm_project':_0x249155[_0x1733cb(0xe9)]=_0x5f2507,console[_0x1733cb(0xdb)]('Session\x20llm_project\x20set\x20to:\x20'+_0x5f2507+_0x1733cb(0xf1)+_0x3c63c6+')');break;case _0x1733cb(0xda):_0x249155['engage_workspace']=_0x5f2507,console[_0x1733cb(0xdb)](_0x1733cb(0xe6)+_0x5f2507+_0x1733cb(0xf1)+_0x3c63c6+')');break;}return saveSessionContext(_0x249155,_0x4299b7[_0x1733cb(0xe8)]),console[_0x1733cb(0xdb)](_0x1733cb(0xed)),0x0;}catch(_0x353537){return _0x353537 instanceof Error&&console[_0x1733cb(0xd2)](_0x1733cb(0xf0)+_0x353537['message']),0x1;}}}function a38_0x1024(){const _0x2e5cfc=['Error:\x20Profile\x20\x27','10KZJIaa','7UIGgDp','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','includes','Session\x20engage_workspace\x20set\x20to:\x20','profile','session','llm_project','2432MgJKqq','5727216RhYRaK','name','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','use','join','Error:\x20','\x20(session:\x20','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','database','1649211YLMuKm','Invalid\x20resource:\x20','validate','1038425VucAJV','1701WdTqRL','Set\x20session-level\x20context','284227GTqGks','error','length','Session\x20profile\x20set\x20to:\x20','2426406RRasFB','toString','4URAXHu','description','Session\x20database\x20set\x20to:\x20','engage_workspace','log','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','2uPuYFL','5792765Kigiab','.\x20Must\x20be\x20one\x20of:\x20','parent_segment'];a38_0x1024=function(){return _0x2e5cfc;};return a38_0x1024();}
1
+ function a38_0x1492(){const _0x19a30d=['parent_segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','9955kotdVD','green','\x27\x20does\x20not\x20exist','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','toString','Error:\x20','displayWithSources','length','llm_project','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','8185324EsdeTr','Error:\x20Profile\x20\x27','(session:\x20','display','name','Set\x20session-level\x20context','use','933256cTLzNX','318bBJqao','11478fixTMX','Session\x20llm_project\x20set\x20to:\x20','6495636bsVgpN','Session\x20profile\x20set\x20to:\x20','4760928wcVPUQ','profile','Session\x20database\x20set\x20to:\x20','dim','description','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','includes','cleared','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context\x0a','Session\x20context\x20','log','Session\x20engage_workspace\x20set\x20to:\x20','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','debug','database','error','.\x20Must\x20be\x20one\x20of:\x20','engage_workspace','1170KrnHva','message','2691306VcJipq','session'];a38_0x1492=function(){return _0x19a30d;};return a38_0x1492();}const a38_0x5577a5=a38_0x28cf;(function(_0x344801,_0x242be4){const _0x346555=a38_0x28cf,_0x241edc=_0x344801();while(!![]){try{const _0x2051c6=parseInt(_0x346555(0x9b))/0x1+-parseInt(_0x346555(0x9d))/0x2*(parseInt(_0x346555(0x9c))/0x3)+parseInt(_0x346555(0x9f))/0x4+-parseInt(_0x346555(0x8a))/0x5*(-parseInt(_0x346555(0x84))/0x6)+-parseInt(_0x346555(0x94))/0x7+-parseInt(_0x346555(0xa1))/0x8+parseInt(_0x346555(0x86))/0x9;if(_0x2051c6===_0x242be4)break;else _0x241edc['push'](_0x241edc['shift']());}catch(_0x5b662c){_0x241edc['push'](_0x241edc['shift']());}}}(a38_0x1492,0xd4cee));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists}from'../core/profile.js';function a38_0x28cf(_0x24085c,_0x210c92){const _0x1492f5=a38_0x1492();return a38_0x28cf=function(_0x28cfa4,_0x3b6423){_0x28cfa4=_0x28cfa4-0x82;let _0x259a9f=_0x1492f5[_0x28cfa4];return _0x259a9f;},a38_0x28cf(_0x24085c,_0x210c92);}import{GlobalContext}from'../core/global-context.js';import a38_0x4ab48a from'chalk';export class UseCommand extends BaseCommand{[a38_0x5577a5(0x98)]=a38_0x5577a5(0x9a);[a38_0x5577a5(0xa5)]=a38_0x5577a5(0x99);['validate'](_0x59b136){const _0x3ecdee=a38_0x5577a5,{args:_0x2016d5}=_0x59b136;if(_0x2016d5[_0x3ecdee(0x91)]===0x0)return undefined;if(_0x2016d5[_0x3ecdee(0x91)]===0x1)return'Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a'+_0x3ecdee(0xa9)+_0x3ecdee(0x89)+'\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace\x0a'+_0x3ecdee(0xad);const _0x3eae19=_0x2016d5[0x0],_0x52291c=[_0x3ecdee(0xaf),_0x3ecdee(0x88),_0x3ecdee(0x92),_0x3ecdee(0xa2),_0x3ecdee(0x83)];if(!_0x52291c[_0x3ecdee(0xa7)](_0x3eae19))return'Invalid\x20resource:\x20'+_0x3eae19+_0x3ecdee(0x82)+_0x52291c['join'](',\x20');return undefined;}async['execute'](_0x1e4000){const _0x955b41=a38_0x5577a5,{args:_0x2657e3,options:_0x2624ca}=_0x1e4000,_0x983ca1=_0x2624ca[_0x955b41(0xae)],_0x416361=_0x2624ca['clear'];cleanExpiredSessions();try{if(_0x416361){clearSessionContext(_0x2624ca[_0x955b41(0x87)]);const _0x20e3ae=_0x2624ca['session']||getCurrentSessionPID()[_0x955b41(0x8e)]();return console[_0x955b41(0xab)](_0x955b41(0xaa)+a38_0x4ab48a['green'](_0x955b41(0xa8))+'\x20'+a38_0x4ab48a[_0x955b41(0xa4)]('(session:\x20'+_0x20e3ae+')')),0x0;}if(_0x2657e3['length']===0x0){const _0x212188=new GlobalContext(_0x2624ca);return _0x983ca1?_0x212188[_0x955b41(0x90)]():_0x212188[_0x955b41(0x97)](),console['log'](a38_0x4ab48a[_0x955b41(0xa4)](_0x955b41(0xa6))),console['log'](a38_0x4ab48a['dim']('Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace')),0x0;}const _0x47c0e5=_0x2657e3[0x0],_0x19eae6=_0x2657e3[0x1];if(_0x47c0e5==='profile'){if(!profileExists(_0x19eae6))return console[_0x955b41(0xb0)](_0x955b41(0x95)+_0x19eae6+_0x955b41(0x8c)),console[_0x955b41(0xb0)](_0x955b41(0x93)),0x1;const _0x4b7126=_0x2624ca[_0x955b41(0x87)]||getCurrentSessionPID()[_0x955b41(0x8e)]();return saveSessionContext({'profile':_0x19eae6},_0x2624ca['session']),console[_0x955b41(0xab)](_0x955b41(0xa0)+a38_0x4ab48a[_0x955b41(0x8b)](_0x19eae6)+'\x20'+a38_0x4ab48a['dim'](_0x955b41(0x96)+_0x4b7126+')')),console[_0x955b41(0xab)](a38_0x4ab48a[_0x955b41(0xa4)](_0x955b41(0x8d))),0x0;}const _0x9fd08={},_0x47bb76=_0x2624ca[_0x955b41(0x87)]||getCurrentSessionPID()[_0x955b41(0x8e)]();switch(_0x47c0e5){case _0x955b41(0xaf):_0x9fd08[_0x955b41(0xaf)]=_0x19eae6,console[_0x955b41(0xab)](_0x955b41(0xa3)+a38_0x4ab48a[_0x955b41(0x8b)](_0x19eae6)+'\x20'+a38_0x4ab48a[_0x955b41(0xa4)]('(session:\x20'+_0x47bb76+')'));break;case'parent_segment':_0x9fd08[_0x955b41(0x88)]=_0x19eae6,console[_0x955b41(0xab)]('Session\x20parent_segment\x20set\x20to:\x20'+a38_0x4ab48a[_0x955b41(0x8b)](_0x19eae6)+'\x20'+a38_0x4ab48a[_0x955b41(0xa4)](_0x955b41(0x96)+_0x47bb76+')'));break;case _0x955b41(0x92):_0x9fd08[_0x955b41(0x92)]=_0x19eae6,console[_0x955b41(0xab)](_0x955b41(0x9e)+a38_0x4ab48a[_0x955b41(0x8b)](_0x19eae6)+'\x20'+a38_0x4ab48a[_0x955b41(0xa4)](_0x955b41(0x96)+_0x47bb76+')'));break;case'engage_workspace':_0x9fd08[_0x955b41(0x83)]=_0x19eae6,console[_0x955b41(0xab)](_0x955b41(0xac)+a38_0x4ab48a[_0x955b41(0x8b)](_0x19eae6)+'\x20'+a38_0x4ab48a['dim']('(session:\x20'+_0x47bb76+')'));break;}return saveSessionContext(_0x9fd08,_0x2624ca['session']),console[_0x955b41(0xab)](a38_0x4ab48a[_0x955b41(0xa4)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides')),0x0;}catch(_0x2b0548){return _0x2b0548 instanceof Error&&console[_0x955b41(0xb0)](_0x955b41(0x8f)+_0x2b0548[_0x955b41(0x85)]),0x1;}}}
@@ -1 +1 @@
1
- {"version":3,"file":"use-command.js","sourceRoot":"","sources":["../../src/commands/use-command.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"use-command.js","sourceRoot":"","sources":["../../src/commands/use-command.ts"],"names":[],"mappings":"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"}
@@ -1 +1 @@
1
- const a39_0x3c450e=a39_0x7745;(function(_0x541168,_0x37f565){const _0x4400fe=a39_0x7745,_0x5ba092=_0x541168();while(!![]){try{const _0x5221bf=parseInt(_0x4400fe(0x149))/0x1+parseInt(_0x4400fe(0x12b))/0x2*(parseInt(_0x4400fe(0xea))/0x3)+parseInt(_0x4400fe(0x148))/0x4*(parseInt(_0x4400fe(0x10e))/0x5)+parseInt(_0x4400fe(0x10c))/0x6+parseInt(_0x4400fe(0x141))/0x7+-parseInt(_0x4400fe(0xbd))/0x8*(-parseInt(_0x4400fe(0xc5))/0x9)+-parseInt(_0x4400fe(0xff))/0xa;if(_0x5221bf===_0x37f565)break;else _0x5ba092['push'](_0x5ba092['shift']());}catch(_0x5aab48){_0x5ba092['push'](_0x5ba092['shift']());}}}(a39_0x3fe2,0xa5dcd));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{formatBytes}from'../utils/formatters.js';import a39_0x28a9f1 from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a39_0x3c450e(0x113)]=a39_0x3c450e(0xd8);[a39_0x3c450e(0x13f)]=a39_0x3c450e(0x11f);async[a39_0x3c450e(0xd3)](_0x31a1e8){const _0x291c5f=a39_0x3c450e,{options:_0x51c43c,args:_0x1ddf16,tdx:_0x41190a}=_0x31a1e8,_0x57453e=_0x1ddf16[0x0];try{_0x51c43c[_0x291c5f(0x121)]&&_0x57453e&&console['error']('Pattern:\x20'+_0x57453e);const _0x209eaf=await withSpinner(_0x291c5f(0xcc),()=>_0x41190a[_0x291c5f(0xda)]['projects'](_0x57453e,{'limit':_0x51c43c[_0x291c5f(0xab)]}),{'verbose':_0x51c43c[_0x291c5f(0x121)]}),_0xf3ea6d=_0x209eaf[_0x291c5f(0xa9)];return console[_0x291c5f(0xc3)]('✔\x20Found\x20'+_0xf3ea6d[_0x291c5f(0x13c)]+_0x291c5f(0xe9)+(_0xf3ea6d[_0x291c5f(0x13c)]!==0x1?'s':'')),await handleSDKOutput(_0xf3ea6d,_0x51c43c),0x0;}catch(_0x2c829b){if(_0x2c829b instanceof SDKError)return console[_0x291c5f(0xc3)]('Error:\x20'+_0x2c829b[_0x291c5f(0x134)]),_0x2c829b[_0x291c5f(0x143)]&&console['error'](_0x291c5f(0xbf)+_0x2c829b[_0x291c5f(0x143)]),0x1;throw _0x2c829b;}}}export class WorkflowWorkflowsCommand extends BaseCommand{['name']=a39_0x3c450e(0xfc);[a39_0x3c450e(0x13f)]=a39_0x3c450e(0xba);async[a39_0x3c450e(0xd3)](_0x34b19d){const _0x2e5171=a39_0x3c450e,{options:_0x5a8cf9,args:_0x40f590,tdx:_0x3df6f8}=_0x34b19d,_0x49bee4=_0x40f590[0x0];try{_0x5a8cf9[_0x2e5171(0x121)]&&_0x49bee4&&console[_0x2e5171(0xc3)]('Project\x20filter:\x20'+_0x49bee4);const _0x2eb733=await withSpinner(_0x2e5171(0xc2),()=>_0x3df6f8['workflow']['workflows'](_0x49bee4,{'limit':_0x5a8cf9[_0x2e5171(0xab)]}),{'verbose':_0x5a8cf9[_0x2e5171(0x121)]}),_0x3a3f9f=_0x2eb733['data'];return console['error'](_0x2e5171(0xae)+_0x3a3f9f[_0x2e5171(0x13c)]+_0x2e5171(0xf6)+(_0x3a3f9f['length']!==0x1?'s':'')),await handleSDKOutput(_0x3a3f9f,_0x5a8cf9),0x0;}catch(_0x203a02){if(_0x203a02 instanceof SDKError)return console[_0x2e5171(0xc3)]('Error:\x20'+_0x203a02[_0x2e5171(0x134)]),_0x203a02[_0x2e5171(0x143)]&&console['error'](_0x2e5171(0xbf)+_0x203a02['cause']),0x1;throw _0x203a02;}}}export class WorkflowSessionsCommand extends BaseCommand{['name']=a39_0x3c450e(0xf0);[a39_0x3c450e(0x13f)]=a39_0x3c450e(0xe8);async[a39_0x3c450e(0xd3)](_0x71cc96){const _0x24a01c=a39_0x3c450e,{options:_0x41dc1b,args:_0x269514,tdx:_0x133501}=_0x71cc96;let _0x289809,_0x52816e;if(_0x269514[0x0]){const _0x40826d=_0x269514[0x0][_0x24a01c(0x11b)]('.');if(_0x40826d['length']===0x1)_0x289809=_0x40826d[0x0];else{if(_0x40826d[_0x24a01c(0x13c)]===0x2)[_0x289809,_0x52816e]=_0x40826d;else return console[_0x24a01c(0xc3)]('Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),0x1;}}try{if(_0x41dc1b[_0x24a01c(0x121)]){if(_0x289809&&_0x52816e)console[_0x24a01c(0xc3)](_0x24a01c(0x118)+_0x289809+'.'+_0x52816e);else _0x289809&&console[_0x24a01c(0xc3)]('Filter:\x20project='+_0x289809);const _0xe480a3=_0x41dc1b[_0x24a01c(0x122)];_0xe480a3&&console[_0x24a01c(0xc3)](_0x24a01c(0xeb)+_0xe480a3);}const _0x179c11=await withSpinner(_0x24a01c(0x115),()=>_0x133501[_0x24a01c(0xda)][_0x24a01c(0xe0)]({'projectName':_0x289809,'workflowName':_0x52816e,'status':_0x41dc1b['status'],'fromTime':_0x41dc1b[_0x24a01c(0x114)],'toTime':_0x41dc1b['to'],'limit':_0x41dc1b[_0x24a01c(0xab)]}),{'verbose':_0x41dc1b[_0x24a01c(0x121)]}),_0x4993d6=_0x179c11[_0x24a01c(0xa9)];return console[_0x24a01c(0xc3)](_0x24a01c(0xae)+_0x4993d6[_0x24a01c(0x13c)]+_0x24a01c(0xd9)+(_0x4993d6['length']!==0x1?'s':'')),await handleSDKOutput(_0x4993d6,_0x41dc1b),0x0;}catch(_0x1d5f39){if(_0x1d5f39 instanceof SDKError)return console[_0x24a01c(0xc3)](_0x24a01c(0x144)+_0x1d5f39[_0x24a01c(0x134)]),_0x1d5f39['cause']&&console[_0x24a01c(0xc3)](_0x24a01c(0xbf)+_0x1d5f39[_0x24a01c(0x143)]),0x1;throw _0x1d5f39;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a39_0x3c450e(0x113)]=a39_0x3c450e(0x133);[a39_0x3c450e(0x13f)]='List\x20workflow\x20attempts';async[a39_0x3c450e(0xd3)](_0x5ac0e8){const _0x47603c=a39_0x3c450e,{options:_0x235d73,args:_0x49bd5b,tdx:_0x3317ec}=_0x5ac0e8;let _0x3556f7,_0x1863fa;if(_0x49bd5b[0x0]){const _0x317663=_0x49bd5b[0x0]['split']('.');if(_0x317663['length']===0x1)_0x3556f7=_0x317663[0x0];else{if(_0x317663['length']===0x2)[_0x3556f7,_0x1863fa]=_0x317663;else return console[_0x47603c(0xc3)]('Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),0x1;}}try{const _0x2ee1cb=_0x235d73[_0x47603c(0xd2)];if(_0x235d73[_0x47603c(0x121)]){if(_0x3556f7&&_0x1863fa)console['error'](_0x47603c(0x118)+_0x3556f7+'.'+_0x1863fa);else _0x3556f7&&console[_0x47603c(0xc3)](_0x47603c(0xa8)+_0x3556f7);_0x2ee1cb&&console[_0x47603c(0xc3)]('Include\x20retried:\x20yes');}const _0x3e9b3c=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x3317ec['workflow'][_0x47603c(0xb3)]({'projectName':_0x3556f7,'workflowName':_0x1863fa,'includeRetried':_0x2ee1cb,'limit':_0x235d73[_0x47603c(0xab)]}),{'verbose':_0x235d73['verbose']}),_0x4828c0=_0x3e9b3c['data'];return console[_0x47603c(0xc3)](_0x47603c(0xae)+_0x4828c0[_0x47603c(0x13c)]+_0x47603c(0x129)+(_0x4828c0[_0x47603c(0x13c)]!==0x1?'s':'')),await handleSDKOutput(_0x4828c0,_0x235d73),0x0;}catch(_0x5f03ca){if(_0x5f03ca instanceof SDKError)return console[_0x47603c(0xc3)](_0x47603c(0x144)+_0x5f03ca[_0x47603c(0x134)]),_0x5f03ca[_0x47603c(0x143)]&&console[_0x47603c(0xc3)](_0x47603c(0xbf)+_0x5f03ca[_0x47603c(0x143)]),0x1;throw _0x5f03ca;}}}export class WorkflowAttemptCommand extends BaseCommand{[a39_0x3c450e(0x113)]=a39_0x3c450e(0xdd);['description']=a39_0x3c450e(0xb1);async[a39_0x3c450e(0xd3)](_0x54f11f){const _0x49c84b=a39_0x3c450e,{options:_0x23bf15,args:_0x51e2fe,tdx:_0x3b95f8}=_0x54f11f,_0x261ec7=_0x51e2fe[0x0];if(!_0x261ec7)return console[_0x49c84b(0xc3)](_0x49c84b(0xef)),0x1;try{_0x23bf15[_0x49c84b(0x121)]&&console[_0x49c84b(0xc3)]('Attempt\x20ID:\x20'+_0x261ec7);const _0x474c81=await withSpinner('Getting\x20attempt\x20details...',()=>_0x3b95f8[_0x49c84b(0xda)][_0x49c84b(0xb6)](_0x261ec7),{'verbose':_0x23bf15[_0x49c84b(0x121)]}),_0x3145df=_0x474c81['data'];let _0x5a3e1a;!_0x3145df[_0x49c84b(0x108)]?_0x5a3e1a=_0x3145df[_0x49c84b(0xce)]?_0x49c84b(0xc1):_0x49c84b(0x142):_0x5a3e1a=_0x3145df[_0x49c84b(0xd0)]?_0x49c84b(0xd0):_0x49c84b(0xc3);let _0x4bff19;if(_0x3145df[_0x49c84b(0xaf)]&&_0x3145df[_0x49c84b(0x101)]){const _0x458cbe=new Date(_0x3145df['createdAt'])[_0x49c84b(0xd7)](),_0x8eb221=new Date(_0x3145df[_0x49c84b(0x101)])[_0x49c84b(0xd7)]();_0x4bff19=Math[_0x49c84b(0xd1)]((_0x8eb221-_0x458cbe)/0x3e8);}const _0x437974={'attempt_id':_0x3145df['id'],'status':_0x5a3e1a,..._0x3145df[_0x49c84b(0xf8)]!==undefined&&{'index':_0x3145df['index']},..._0x3145df[_0x49c84b(0xdc)]&&{'project':_0x3145df[_0x49c84b(0xdc)][_0x49c84b(0x113)]},..._0x3145df[_0x49c84b(0xda)]&&{'workflow':_0x3145df[_0x49c84b(0xda)]['name']},..._0x3145df[_0x49c84b(0xad)]&&{'session_id':_0x3145df['sessionId']},..._0x3145df[_0x49c84b(0x13b)]&&{'session_time':_0x3145df[_0x49c84b(0x13b)]},..._0x3145df[_0x49c84b(0xc0)]&&{'retry_attempt':_0x3145df[_0x49c84b(0xc0)]},..._0x4bff19!==undefined&&{'duration_sec':_0x4bff19},..._0x3145df[_0x49c84b(0xaf)]&&{'created_at':_0x3145df['createdAt']},..._0x3145df[_0x49c84b(0x101)]&&{'finished_at':_0x3145df[_0x49c84b(0x101)]},...Object['keys'](_0x3145df[_0x49c84b(0x11d)])['length']>0x0&&{'params':_0x3145df[_0x49c84b(0x11d)]}};return await handleSingleObjectOutput(_0x437974,_0x23bf15),0x0;}catch(_0x1a10f8){if(_0x1a10f8 instanceof SDKError)return console[_0x49c84b(0xc3)](_0x49c84b(0x144)+_0x1a10f8[_0x49c84b(0x134)]),_0x1a10f8[_0x49c84b(0x143)]&&console[_0x49c84b(0xc3)](_0x49c84b(0xbf)+_0x1a10f8['cause']),0x1;throw _0x1a10f8;}}}export class WorkflowTasksCommand extends BaseCommand{[a39_0x3c450e(0x113)]=a39_0x3c450e(0x14c);[a39_0x3c450e(0x13f)]=a39_0x3c450e(0xcd);async[a39_0x3c450e(0xd3)](_0x245bf6){const _0xb5c832=a39_0x3c450e,{options:_0x21515e,args:_0x5de713,tdx:_0x5cb612}=_0x245bf6,_0x3faa15=_0x5de713[0x0];if(!_0x3faa15)return console['error'](_0xb5c832(0xef)),0x1;try{const _0x48b9b6=_0x21515e[_0xb5c832(0x13d)];_0x21515e[_0xb5c832(0x121)]&&(console[_0xb5c832(0xc3)](_0xb5c832(0xb4)+_0x3faa15),_0x48b9b6&&console[_0xb5c832(0xc3)]('Including\x20subtasks:\x20yes'));const _0x34262d=await withSpinner(_0xb5c832(0x125),()=>_0x5cb612[_0xb5c832(0xda)][_0xb5c832(0x140)](_0x3faa15,_0x48b9b6||![]),{'verbose':_0x21515e['verbose']}),_0x11df42=_0x34262d[_0xb5c832(0xa9)];return console[_0xb5c832(0xc3)](_0xb5c832(0xae)+_0x11df42[_0xb5c832(0x13c)]+_0xb5c832(0xdb)+(_0x11df42['length']!==0x1?'s':'')),await handleSDKOutput(_0x11df42,_0x21515e),0x0;}catch(_0x4b6009){if(_0x4b6009 instanceof SDKError)return console['error'](_0xb5c832(0x144)+_0x4b6009[_0xb5c832(0x134)]),_0x4b6009[_0xb5c832(0x143)]&&console[_0xb5c832(0xc3)](_0xb5c832(0xbf)+_0x4b6009[_0xb5c832(0x143)]),0x1;throw _0x4b6009;}}}function a39_0x3fe2(){const _0x51f4be=['Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','✔\x20Workflow\x20run\x20started','Resume\x20from:\x20','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','task','attempt:','workflow:attempts','message','param','yes','workflow:logs','force','workflow:push','filesExtracted','sessionTime','length','includeSubtasks','Select\x20a\x20task\x20to\x20view\x20logs:','description','tasks','6664476IfpgIc','running','cause','Error:\x20','session:','...','Retry\x20a\x20session\x20or\x20attempt','36476xKsRAp','66276kHayVR','Error:\x20Invalid\x20JSON\x20in\x20--params','retrySession','workflow:tasks','retryAttempt','Starting\x20workflow\x20run...','Filter:\x20project=','data','resumeFrom','limit','Target:\x20','sessionId','✔\x20Found\x20','createdAt','delete','Show\x20specific\x20attempt\x20details','Project:\x20','attempts','Attempt\x20ID:\x20','projectName','attempt','json','download','From\x20task:\x20','List\x20workflows','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Downloading\x20logs...','32VjhGNd','projectId','\x20\x20Cause:\x20','retryAttemptName','canceling','Listing\x20workflows...','error','workflow:delete','2833101wLhTlR','utf-8','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','No\x20log\x20files\x20found\x20for\x20this\x20attempt','logs','taskName','Listing\x20workflow\x20projects...','Show\x20tasks\x20for\x20an\x20attempt','cancelRequested','Downloading\x20project\x20','success','round','includeRetried','execute','substring','reason','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','getTime','workflow:projects','\x20session','workflow','\x20task','project','workflow:attempt','Revision:\x20','Error:\x20Invalid\x20parameter\x20format:\x20','sessions','Killing\x20attempt...','✔\x20Downloaded\x20','\x22?\x20This\x20cannot\x20be\x20undone.','workflow:run','Pushing\x20workflow\x20project...','workflow:retry','session','List\x20workflow\x20execution\x20sessions','\x20project','987219PjBhCD','Status:\x20','skipValidation','keys','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Error:\x20Attempt\x20ID\x20is\x20required','workflow:sessions','\x20\x20Session\x20ID:\x20','stat','Deleting\x20project\x20','Project\x20directory:\x20','attemptId','\x20workflow','✔\x20Retry\x20started','index','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Fetching\x20log\x20files...','map','workflow:workflows','Kill\x20a\x20running\x20attempt','Retrying\x20attempt...','37827310IBTURR','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','finishedAt','Project\x20name:\x20','Retrying\x20session...','log','✔\x20Pushed\x20','Start\x20a\x20workflow\x20run','\x20\x20Attempt\x20ID:\x20','done','kill','\x20\x20Project:\x20','Workflow:\x20','4512792ktwPfU','\x20\x20Project\x20ID:\x20','605UQKaeg','parse','workflow:kill','Error:\x20Workflow\x20identifier\x20is\x20required','revision','name','from','Listing\x20workflow\x20sessions...','startsWith','Parameters:\x20','Filter:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','push','split','Force:\x20yes','params','Task\x20name:\x20','List\x20all\x20workflow\x20projects','stringify','verbose','status','Session\x20time:\x20','isArray','Getting\x20attempt\x20tasks...','Validation:\x20skipped','Params:\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','\x20attempt','Cancelled','2PUVVPu','indexOf'];a39_0x3fe2=function(){return _0x51f4be;};return a39_0x3fe2();}export class WorkflowLogsCommand extends BaseCommand{[a39_0x3c450e(0x113)]=a39_0x3c450e(0x137);[a39_0x3c450e(0x13f)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a39_0x3c450e(0xd3)](_0x425a50){const _0xcb8c18=a39_0x3c450e,{options:_0x246b7a,args:_0x48d80,tdx:_0x5d9d1e}=_0x425a50,_0x1ce1c9=_0x48d80[0x0];let _0x32b86d=_0x48d80[0x1];if(!_0x1ce1c9)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{_0x246b7a[_0xcb8c18(0x121)]&&(console[_0xcb8c18(0xc3)](_0xcb8c18(0xb4)+_0x1ce1c9),_0x32b86d&&console[_0xcb8c18(0xc3)](_0xcb8c18(0x11e)+_0x32b86d));const _0x590830=await withSpinner(_0xcb8c18(0xfa),()=>_0x5d9d1e[_0xcb8c18(0xda)]['logFiles'](_0x1ce1c9,_0x32b86d),{'verbose':_0x246b7a['verbose']}),_0x546059=_0x590830['data'];if(_0x546059['length']===0x0)return console[_0xcb8c18(0xc3)](_0xcb8c18(0xc9)),0x0;if(!_0x32b86d&&(_0x246b7a[_0xcb8c18(0xb7)]||_0x246b7a['format']))return await handleSDKOutput(_0x546059,_0x246b7a),0x0;if(!_0x32b86d){const _0x1a974a=_0x546059[_0xcb8c18(0xfb)](_0x38df33=>({'title':_0x38df33[_0xcb8c18(0xcb)]+'\x20('+formatBytes(_0x38df33['fileSize'])+')','value':_0x38df33[_0xcb8c18(0xcb)]})),_0x340d67=await a39_0x28a9f1({'type':'select','name':'task','message':_0xcb8c18(0x13e),'choices':_0x1a974a});if(!_0x340d67[_0xcb8c18(0x131)])return console[_0xcb8c18(0xc3)](_0xcb8c18(0x12a)),0x0;_0x32b86d=_0x340d67[_0xcb8c18(0x131)];}const _0x4f9a2a=await withSpinner(_0xcb8c18(0xbc),()=>_0x5d9d1e['workflow'][_0xcb8c18(0xca)](_0x1ce1c9,_0x32b86d),{'verbose':_0x246b7a[_0xcb8c18(0x121)]}),_0x1b8481=_0x4f9a2a['data'];return _0x1b8481?console[_0xcb8c18(0x104)](_0x1b8481):console[_0xcb8c18(0xc3)]('No\x20log\x20content\x20found'),0x0;}catch(_0xbc3b89){if(_0xbc3b89 instanceof SDKError)return console[_0xcb8c18(0xc3)](_0xcb8c18(0x144)+_0xbc3b89[_0xcb8c18(0x134)]),_0xbc3b89['cause']&&console[_0xcb8c18(0xc3)](_0xcb8c18(0xbf)+_0xbc3b89[_0xcb8c18(0x143)]),0x1;throw _0xbc3b89;}}}export class WorkflowKillCommand extends BaseCommand{['name']=a39_0x3c450e(0x110);[a39_0x3c450e(0x13f)]=a39_0x3c450e(0xfd);async[a39_0x3c450e(0xd3)](_0x4bd777){const _0x2418a8=a39_0x3c450e,{options:_0x4c0424,args:_0x4ea6d3,tdx:_0x13e47b}=_0x4bd777,_0x1ce11e=_0x4ea6d3[0x0];if(!_0x1ce11e)return console[_0x2418a8(0xc3)](_0x2418a8(0xef)),0x1;try{const _0x1e9ac2=_0x4c0424[_0x2418a8(0xd5)];_0x4c0424[_0x2418a8(0x121)]&&(console[_0x2418a8(0xc3)](_0x2418a8(0xb4)+_0x1ce11e),_0x1e9ac2&&console[_0x2418a8(0xc3)]('Reason:\x20'+_0x1e9ac2));if(!_0x4c0424['yes']){const _0x228dd0=await confirm(_0x2418a8(0x119)+_0x1ce11e+'?');if(!_0x228dd0)return console[_0x2418a8(0xc3)](_0x2418a8(0x12a)),0x0;}const _0x1abcc9=await withSpinner(_0x2418a8(0xe1),()=>_0x13e47b[_0x2418a8(0xda)][_0x2418a8(0x109)](_0x1ce11e,_0x1e9ac2),{'verbose':_0x4c0424['verbose']}),_0x5a9242=_0x1abcc9[_0x2418a8(0xa9)];return console[_0x2418a8(0xc3)]('✔\x20'+_0x5a9242),0x0;}catch(_0x3949cd){if(_0x3949cd instanceof SDKError)return console['error'](_0x2418a8(0x144)+_0x3949cd[_0x2418a8(0x134)]),_0x3949cd[_0x2418a8(0x143)]&&console['error'](_0x2418a8(0xbf)+_0x3949cd[_0x2418a8(0x143)]),0x1;throw _0x3949cd;}}}export class WorkflowRetryCommand extends BaseCommand{[a39_0x3c450e(0x113)]=a39_0x3c450e(0xe6);[a39_0x3c450e(0x13f)]=a39_0x3c450e(0x147);async['execute'](_0x36b346){const _0x38bf80=a39_0x3c450e,{options:_0xb0cf9f,args:_0x15f51f,tdx:_0x572a55}=_0x36b346,_0x3e5da8=_0x15f51f[0x0];if(!_0x3e5da8)return console[_0x38bf80(0xc3)](_0x38bf80(0xf9)),console['error'](_0x38bf80(0xc8)),0x1;let _0x43c96d=![],_0xa2a293=_0x3e5da8;if(_0x3e5da8['startsWith'](_0x38bf80(0x145)))_0x43c96d=!![],_0xa2a293=_0x3e5da8['substring'](0x8);else{if(_0x3e5da8[_0x38bf80(0x116)](_0x38bf80(0x132)))_0x43c96d=![],_0xa2a293=_0x3e5da8[_0x38bf80(0xd4)](0x8);else return console[_0x38bf80(0xc3)](_0x38bf80(0xbb)),console['error']('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}try{const _0x2037e8=_0xb0cf9f['fromTask'],_0x156de9=_0xb0cf9f[_0x38bf80(0xaa)],_0x4cbb37=_0xb0cf9f[_0x38bf80(0x11d)],_0x401ebe=_0xb0cf9f[_0x38bf80(0x138)];_0xb0cf9f[_0x38bf80(0x121)]&&(console[_0x38bf80(0xc3)](_0x38bf80(0xac)+(_0x43c96d?'session':_0x38bf80(0xb6))+'\x20'+_0xa2a293),_0x2037e8&&console['error'](_0x38bf80(0xb9)+_0x2037e8),_0x156de9&&console[_0x38bf80(0xc3)](_0x38bf80(0x12f)+_0x156de9),_0x4cbb37&&console[_0x38bf80(0xc3)](_0x38bf80(0x127)+_0x4cbb37),_0x401ebe&&console[_0x38bf80(0xc3)](_0x38bf80(0x11c)));let _0x579bcf;if(_0x4cbb37)try{if(_0x4cbb37['startsWith']('@')){const _0x1bbeb0=await import('fs/promises'),_0x250998=_0x4cbb37[_0x38bf80(0xd4)](0x1),_0x40ddf=await _0x1bbeb0['readFile'](_0x250998,_0x38bf80(0xc6));_0x579bcf=JSON[_0x38bf80(0x10f)](_0x40ddf);}else _0x579bcf=JSON['parse'](_0x4cbb37);}catch{return console[_0x38bf80(0xc3)](_0x38bf80(0x14a)),0x1;}if(!_0xb0cf9f[_0x38bf80(0x136)]){const _0x2f8b4d=await confirm(_0x38bf80(0xd6)+(_0x43c96d?_0x38bf80(0xe7):_0x38bf80(0xb6))+'\x20'+_0xa2a293+'?');if(!_0x2f8b4d)return console[_0x38bf80(0xc3)](_0x38bf80(0x12a)),0x0;}let _0x44567f;_0x43c96d?_0x44567f=await withSpinner(_0x38bf80(0x103),()=>_0x572a55[_0x38bf80(0xda)][_0x38bf80(0x14b)](_0xa2a293,{'fromTask':_0x2037e8,'retryParams':_0x579bcf}),{'verbose':_0xb0cf9f[_0x38bf80(0x121)]}):_0x44567f=await withSpinner(_0x38bf80(0xfe),()=>_0x572a55[_0x38bf80(0xda)][_0x38bf80(0x14d)](_0xa2a293,{'resumeFrom':_0x156de9,'retryParams':_0x579bcf,'force':_0x401ebe}),{'verbose':_0xb0cf9f[_0x38bf80(0x121)]});const _0x28bcd8=_0x44567f['data'];return console[_0x38bf80(0xc3)](_0x38bf80(0xf7)),console[_0x38bf80(0xc3)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x28bcd8[_0x38bf80(0xf5)]),console['error'](_0x38bf80(0xf1)+_0x28bcd8[_0x38bf80(0xad)]),0x0;}catch(_0x5b56c3){if(_0x5b56c3 instanceof SDKError)return console[_0x38bf80(0xc3)](_0x38bf80(0x144)+_0x5b56c3[_0x38bf80(0x134)]),_0x5b56c3[_0x38bf80(0x143)]&&console[_0x38bf80(0xc3)](_0x38bf80(0xbf)+_0x5b56c3['cause']),0x1;throw _0x5b56c3;}}}export class WorkflowRunCommand extends BaseCommand{[a39_0x3c450e(0x113)]=a39_0x3c450e(0xe4);[a39_0x3c450e(0x13f)]=a39_0x3c450e(0x106);async[a39_0x3c450e(0xd3)](_0x592084){const _0x206e80=a39_0x3c450e,{options:_0x54c7f9,args:_0x56c13f,tdx:_0x47b837}=_0x592084,_0xac3e22=_0x56c13f[0x0];if(!_0xac3e22)return console['error'](_0x206e80(0x111)),console[_0x206e80(0xc3)](_0x206e80(0xc7)),0x1;const _0x37fc5b=_0x54c7f9[_0x206e80(0x135)],_0x4fa03b=_0x54c7f9['sessionTime'],_0x247563={};if(_0x37fc5b&&Array[_0x206e80(0x124)](_0x37fc5b))for(const _0x200198 of _0x37fc5b){const _0x36c50a=_0x200198[_0x206e80(0x12c)]('=');if(_0x36c50a===-0x1)return console[_0x206e80(0xc3)](_0x206e80(0xdf)+_0x200198),console[_0x206e80(0xc3)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x129426=_0x200198[_0x206e80(0xd4)](0x0,_0x36c50a),_0x26ab30=_0x200198['substring'](_0x36c50a+0x1);try{_0x247563[_0x129426]=JSON[_0x206e80(0x10f)](_0x26ab30);}catch{_0x247563[_0x129426]=_0x26ab30;}}_0x54c7f9[_0x206e80(0x121)]&&(console[_0x206e80(0xc3)](_0x206e80(0x10b)+_0xac3e22),Object[_0x206e80(0xed)](_0x247563)[_0x206e80(0x13c)]>0x0&&console[_0x206e80(0xc3)](_0x206e80(0x117)+JSON[_0x206e80(0x120)](_0x247563)),_0x4fa03b&&console[_0x206e80(0xc3)](_0x206e80(0x123)+_0x4fa03b));const _0x2e02a0=await withSpinner(_0x206e80(0x14e),()=>_0x47b837[_0x206e80(0xda)]['run'](_0xac3e22,_0x247563,{'sessionTime':_0x4fa03b}),{'verbose':_0x54c7f9['verbose']}),_0x2ba102=_0x2e02a0[_0x206e80(0xa9)];return console[_0x206e80(0xc3)](_0x206e80(0x12e)),console['error'](_0x206e80(0x107)+_0x2ba102['id']),console[_0x206e80(0xc3)]('\x20\x20Session\x20ID:\x20'+_0x2ba102['sessionId']),console['error'](_0x206e80(0x10a)+_0x2ba102[_0x206e80(0xdc)]?.['name']),console[_0x206e80(0xc3)]('\x20\x20Workflow:\x20'+_0x2ba102[_0x206e80(0xda)]?.[_0x206e80(0x113)]),0x0;}}function a39_0x7745(_0x1efa60,_0x1703ee){const _0x3fe258=a39_0x3fe2();return a39_0x7745=function(_0x77456a,_0x3eb568){_0x77456a=_0x77456a-0xa8;let _0x98f521=_0x3fe258[_0x77456a];return _0x98f521;},a39_0x7745(_0x1efa60,_0x1703ee);}export class WorkflowDownloadCommand extends BaseCommand{[a39_0x3c450e(0x113)]='workflow:download';[a39_0x3c450e(0x13f)]=a39_0x3c450e(0x100);async['execute'](_0xa8a85){const _0x24b83c=a39_0x3c450e,{options:_0xe69e9a,args:_0x3615fc,tdx:_0x341884}=_0xa8a85,_0x3d38ff=_0x3615fc[0x0],_0x562db5=_0x3615fc[0x1]||'.';if(!_0x3d38ff)return console[_0x24b83c(0xc3)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x24b83c(0xc3)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x3a734d=_0xe69e9a[_0x24b83c(0x112)];_0xe69e9a['verbose']&&(console['error'](_0x24b83c(0xb2)+_0x3d38ff),console[_0x24b83c(0xc3)]('Output\x20directory:\x20'+_0x562db5),_0x3a734d&&console[_0x24b83c(0xc3)](_0x24b83c(0xde)+_0x3a734d));const _0x5ca4ba=await withSpinner(_0x24b83c(0xcf)+_0x3d38ff+_0x24b83c(0x146),()=>_0x341884['workflow'][_0x24b83c(0xb8)](_0x3d38ff,_0x562db5,{'revision':_0x3a734d}),{'verbose':_0xe69e9a['verbose']}),_0x2ebb5b=_0x5ca4ba[_0x24b83c(0xa9)];return console[_0x24b83c(0xc3)](_0x24b83c(0xe2)+_0x2ebb5b[_0x24b83c(0xb5)]),console[_0x24b83c(0xc3)]('\x20\x20Revision:\x20'+_0x2ebb5b[_0x24b83c(0x112)]),console[_0x24b83c(0xc3)]('\x20\x20Files\x20extracted:\x20'+_0x2ebb5b[_0x24b83c(0x13a)]),console[_0x24b83c(0xc3)]('\x20\x20Location:\x20'+_0x562db5+'/'+_0x2ebb5b[_0x24b83c(0xb5)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{['name']=a39_0x3c450e(0x139);[a39_0x3c450e(0x13f)]=a39_0x3c450e(0x130);async[a39_0x3c450e(0xd3)](_0x59ded1){const _0x42cf66=a39_0x3c450e,{options:_0x325b6f,args:_0x27e3d0,tdx:_0x4674ed}=_0x59ded1;let _0xbd77f='.',_0x17825f=_0x325b6f[_0x42cf66(0x113)];if(_0x27e3d0[0x0]){const {promises:_0x434aff}=await import('fs');try{const _0x499998=await _0x434aff[_0x42cf66(0xf2)](_0x27e3d0[0x0]);if(_0x499998['isDirectory']())_0xbd77f=_0x27e3d0[0x0];else return console[_0x42cf66(0xc3)](_0x42cf66(0x144)+_0x27e3d0[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x17825f=_0x27e3d0[0x0],_0xbd77f='.';}}const _0x2c0286=_0x325b6f[_0x42cf66(0x112)],_0x3d4c5f=_0x325b6f[_0x42cf66(0xec)];_0x325b6f[_0x42cf66(0x121)]&&(console['error'](_0x42cf66(0xf4)+_0xbd77f),_0x17825f&&console[_0x42cf66(0xc3)](_0x42cf66(0x102)+_0x17825f),_0x2c0286&&console['error'](_0x42cf66(0xde)+_0x2c0286),_0x3d4c5f&&console[_0x42cf66(0xc3)](_0x42cf66(0x126)));const _0x4f1187=await withSpinner(_0x42cf66(0xe5),()=>_0x4674ed[_0x42cf66(0xda)][_0x42cf66(0x11a)](_0xbd77f,{'projectName':_0x17825f,'revision':_0x2c0286,'skipValidation':_0x3d4c5f}),{'verbose':_0x325b6f[_0x42cf66(0x121)]}),_0x37dbfd=_0x4f1187[_0x42cf66(0xa9)];return console[_0x42cf66(0xc3)](_0x42cf66(0x105)+_0x37dbfd[_0x42cf66(0xb5)]),console[_0x42cf66(0xc3)](_0x42cf66(0x10d)+_0x37dbfd[_0x42cf66(0xbe)]),console[_0x42cf66(0xc3)]('\x20\x20Revision:\x20'+_0x37dbfd[_0x42cf66(0x112)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a39_0x3c450e(0x113)]=a39_0x3c450e(0xc4);['description']=a39_0x3c450e(0xee);async[a39_0x3c450e(0xd3)](_0x170f57){const _0x5eac27=a39_0x3c450e,{options:_0x2a7867,args:_0x19c99a,tdx:_0x34de81}=_0x170f57,_0x132f04=_0x19c99a[0x0];if(!_0x132f04)return console['error']('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x5eac27(0xc3)](_0x5eac27(0x128)),0x1;_0x2a7867[_0x5eac27(0x121)]&&console[_0x5eac27(0xc3)](_0x5eac27(0xb2)+_0x132f04);if(!_0x2a7867[_0x5eac27(0x136)]){const _0x2ec0f9=await confirm(_0x5eac27(0x12d)+_0x132f04+_0x5eac27(0xe3));if(!_0x2ec0f9)return console['error']('Cancelled'),0x0;}const _0x1a8f00=await withSpinner(_0x5eac27(0xf3)+_0x132f04+_0x5eac27(0x146),()=>_0x34de81[_0x5eac27(0xda)][_0x5eac27(0xb0)](_0x132f04),{'verbose':_0x2a7867[_0x5eac27(0x121)]}),_0x215a7d=_0x1a8f00['data'];return console['error']('✔\x20Deleted\x20project\x20'+_0x215a7d[_0x5eac27(0xb5)]),console[_0x5eac27(0xc3)](_0x5eac27(0x10d)+_0x215a7d[_0x5eac27(0xbe)]),0x0;}}
1
+ const a39_0x1cfa1b=a39_0x162c;(function(_0x4a52bd,_0x33c10f){const _0x2434a9=a39_0x162c,_0x3f497a=_0x4a52bd();while(!![]){try{const _0x2efe78=parseInt(_0x2434a9(0xc6))/0x1*(parseInt(_0x2434a9(0x7c))/0x2)+-parseInt(_0x2434a9(0xf0))/0x3+-parseInt(_0x2434a9(0xb2))/0x4+parseInt(_0x2434a9(0xfb))/0x5*(-parseInt(_0x2434a9(0xd5))/0x6)+parseInt(_0x2434a9(0xf8))/0x7+parseInt(_0x2434a9(0x90))/0x8+-parseInt(_0x2434a9(0xe7))/0x9;if(_0x2efe78===_0x33c10f)break;else _0x3f497a['push'](_0x3f497a['shift']());}catch(_0x50c92f){_0x3f497a['push'](_0x3f497a['shift']());}}}(a39_0x74fa,0x85db9));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{formatBytes}from'../utils/formatters.js';import a39_0x5c9109 from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a39_0x1cfa1b(0xae)]=a39_0x1cfa1b(0xc4);[a39_0x1cfa1b(0x8b)]=a39_0x1cfa1b(0xf4);async[a39_0x1cfa1b(0x6c)](_0x4d7f73){const _0xec089=a39_0x1cfa1b,{options:_0x1c99b4,args:_0x4488f7,tdx:_0x20a615}=_0x4d7f73,_0x3895e8=_0x4488f7[0x0];try{_0x1c99b4['verbose']&&_0x3895e8&&console[_0xec089(0xd0)](_0xec089(0x92)+_0x3895e8);const _0x4da450=await withSpinner(_0xec089(0x98),()=>_0x20a615[_0xec089(0x8d)]['projects'](_0x3895e8,{'limit':_0x1c99b4['limit']}),{'verbose':_0x1c99b4[_0xec089(0xd1)]}),_0x3d5ee0=_0x4da450[_0xec089(0xbf)];return console['error'](_0xec089(0xc3)+_0x3d5ee0[_0xec089(0x8e)]+_0xec089(0x8f)+(_0x3d5ee0['length']!==0x1?'s':'')),await handleSDKOutput(_0x3d5ee0,_0x1c99b4),0x0;}catch(_0x1e537b){if(_0x1e537b instanceof SDKError)return console[_0xec089(0xd0)](_0xec089(0xd9)+_0x1e537b[_0xec089(0xa3)]),_0x1e537b[_0xec089(0xe5)]&&console[_0xec089(0xd0)](_0xec089(0xa6)+_0x1e537b[_0xec089(0xe5)]),0x1;throw _0x1e537b;}}}function a39_0x162c(_0x4c449b,_0x308d06){const _0x74fa40=a39_0x74fa();return a39_0x162c=function(_0x162c06,_0x3e4ef0){_0x162c06=_0x162c06-0x6c;let _0x22e6f7=_0x74fa40[_0x162c06];return _0x22e6f7;},a39_0x162c(_0x4c449b,_0x308d06);}export class WorkflowWorkflowsCommand extends BaseCommand{['name']=a39_0x1cfa1b(0xe8);[a39_0x1cfa1b(0x8b)]=a39_0x1cfa1b(0xab);async['execute'](_0x354bb2){const _0x27f291=a39_0x1cfa1b,{options:_0x3dd62c,args:_0x37b027,tdx:_0x268dec}=_0x354bb2,_0x4ecda5=_0x37b027[0x0];try{_0x3dd62c['verbose']&&_0x4ecda5&&console[_0x27f291(0xd0)](_0x27f291(0x86)+_0x4ecda5);const _0x33da69=await withSpinner(_0x27f291(0xf1),()=>_0x268dec[_0x27f291(0x8d)][_0x27f291(0xc2)](_0x4ecda5,{'limit':_0x3dd62c['limit']}),{'verbose':_0x3dd62c[_0x27f291(0xd1)]}),_0x2e10d0=_0x33da69[_0x27f291(0xbf)];return console[_0x27f291(0xd0)](_0x27f291(0xc3)+_0x2e10d0[_0x27f291(0x8e)]+_0x27f291(0x77)+(_0x2e10d0[_0x27f291(0x8e)]!==0x1?'s':'')),await handleSDKOutput(_0x2e10d0,_0x3dd62c),0x0;}catch(_0x42fb63){if(_0x42fb63 instanceof SDKError)return console['error']('Error:\x20'+_0x42fb63['message']),_0x42fb63[_0x27f291(0xe5)]&&console[_0x27f291(0xd0)](_0x27f291(0xa6)+_0x42fb63['cause']),0x1;throw _0x42fb63;}}}export class WorkflowSessionsCommand extends BaseCommand{['name']=a39_0x1cfa1b(0xa2);[a39_0x1cfa1b(0x8b)]=a39_0x1cfa1b(0xac);async[a39_0x1cfa1b(0x6c)](_0x819cd0){const _0x3b6420=a39_0x1cfa1b,{options:_0x145b87,args:_0x5b5c43,tdx:_0x3a0743}=_0x819cd0;let _0x393b5c,_0x19649c;if(_0x5b5c43[0x0]){const _0x474aac=_0x5b5c43[0x0][_0x3b6420(0xe9)]('.');if(_0x474aac[_0x3b6420(0x8e)]===0x1)_0x393b5c=_0x474aac[0x0];else{if(_0x474aac['length']===0x2)[_0x393b5c,_0x19649c]=_0x474aac;else return console[_0x3b6420(0xd0)]('Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),0x1;}}try{if(_0x145b87['verbose']){if(_0x393b5c&&_0x19649c)console[_0x3b6420(0xd0)](_0x3b6420(0xeb)+_0x393b5c+'.'+_0x19649c);else _0x393b5c&&console[_0x3b6420(0xd0)](_0x3b6420(0x83)+_0x393b5c);const _0x36f2af=_0x145b87['status'];_0x36f2af&&console[_0x3b6420(0xd0)](_0x3b6420(0xbd)+_0x36f2af);}const _0x1fc51a=await withSpinner(_0x3b6420(0xcc),()=>_0x3a0743['workflow']['sessions']({'projectName':_0x393b5c,'workflowName':_0x19649c,'status':_0x145b87['status'],'fromTime':_0x145b87['from'],'toTime':_0x145b87['to'],'limit':_0x145b87[_0x3b6420(0xe4)]}),{'verbose':_0x145b87[_0x3b6420(0xd1)]}),_0x1fa401=_0x1fc51a[_0x3b6420(0xbf)];return console['error'](_0x3b6420(0xc3)+_0x1fa401[_0x3b6420(0x8e)]+_0x3b6420(0x93)+(_0x1fa401[_0x3b6420(0x8e)]!==0x1?'s':'')),await handleSDKOutput(_0x1fa401,_0x145b87),0x0;}catch(_0x524569){if(_0x524569 instanceof SDKError)return console['error'](_0x3b6420(0xd9)+_0x524569['message']),_0x524569['cause']&&console['error'](_0x3b6420(0xa6)+_0x524569[_0x3b6420(0xe5)]),0x1;throw _0x524569;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a39_0x1cfa1b(0xae)]='workflow:attempts';[a39_0x1cfa1b(0x8b)]=a39_0x1cfa1b(0xb6);async['execute'](_0x22cb79){const _0x1a8ed3=a39_0x1cfa1b,{options:_0xde39d6,args:_0x1ac037,tdx:_0x26fe0b}=_0x22cb79;let _0x5bbebb,_0x176cc0;if(_0x1ac037[0x0]){const _0x44124e=_0x1ac037[0x0][_0x1a8ed3(0xe9)]('.');if(_0x44124e[_0x1a8ed3(0x8e)]===0x1)_0x5bbebb=_0x44124e[0x0];else{if(_0x44124e['length']===0x2)[_0x5bbebb,_0x176cc0]=_0x44124e;else return console['error'](_0x1a8ed3(0xee)),0x1;}}try{const _0x33a5b6=_0xde39d6['includeRetried'];if(_0xde39d6[_0x1a8ed3(0xd1)]){if(_0x5bbebb&&_0x176cc0)console['error'](_0x1a8ed3(0xeb)+_0x5bbebb+'.'+_0x176cc0);else _0x5bbebb&&console[_0x1a8ed3(0xd0)]('Filter:\x20project='+_0x5bbebb);_0x33a5b6&&console[_0x1a8ed3(0xd0)](_0x1a8ed3(0xc5));}const _0x222b45=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x26fe0b[_0x1a8ed3(0x8d)][_0x1a8ed3(0xb8)]({'projectName':_0x5bbebb,'workflowName':_0x176cc0,'includeRetried':_0x33a5b6,'limit':_0xde39d6[_0x1a8ed3(0xe4)]}),{'verbose':_0xde39d6[_0x1a8ed3(0xd1)]}),_0x31898e=_0x222b45[_0x1a8ed3(0xbf)];return console['error'](_0x1a8ed3(0xc3)+_0x31898e[_0x1a8ed3(0x8e)]+_0x1a8ed3(0xdf)+(_0x31898e['length']!==0x1?'s':'')),await handleSDKOutput(_0x31898e,_0xde39d6),0x0;}catch(_0x16fcc1){if(_0x16fcc1 instanceof SDKError)return console[_0x1a8ed3(0xd0)](_0x1a8ed3(0xd9)+_0x16fcc1[_0x1a8ed3(0xa3)]),_0x16fcc1[_0x1a8ed3(0xe5)]&&console[_0x1a8ed3(0xd0)](_0x1a8ed3(0xa6)+_0x16fcc1['cause']),0x1;throw _0x16fcc1;}}}export class WorkflowAttemptCommand extends BaseCommand{[a39_0x1cfa1b(0xae)]='workflow:attempt';[a39_0x1cfa1b(0x8b)]='Show\x20specific\x20attempt\x20details';async[a39_0x1cfa1b(0x6c)](_0x4c3fe1){const _0x302e32=a39_0x1cfa1b,{options:_0xa67dce,args:_0x3216db,tdx:_0x58ecf8}=_0x4c3fe1,_0x1055b8=_0x3216db[0x0];if(!_0x1055b8)return console['error'](_0x302e32(0xf9)),0x1;try{_0xa67dce[_0x302e32(0xd1)]&&console[_0x302e32(0xd0)]('Attempt\x20ID:\x20'+_0x1055b8);const _0x36d313=await withSpinner(_0x302e32(0xdb),()=>_0x58ecf8['workflow'][_0x302e32(0xa8)](_0x1055b8),{'verbose':_0xa67dce[_0x302e32(0xd1)]}),_0x5a4fb8=_0x36d313['data'];let _0x237273;!_0x5a4fb8[_0x302e32(0xb9)]?_0x237273=_0x5a4fb8[_0x302e32(0x95)]?_0x302e32(0x9e):'running':_0x237273=_0x5a4fb8[_0x302e32(0xe3)]?'success':_0x302e32(0xd0);let _0x2c7d87;if(_0x5a4fb8[_0x302e32(0x79)]&&_0x5a4fb8[_0x302e32(0x94)]){const _0x5c050=new Date(_0x5a4fb8[_0x302e32(0x79)])['getTime'](),_0x255570=new Date(_0x5a4fb8[_0x302e32(0x94)])[_0x302e32(0x96)]();_0x2c7d87=Math['round']((_0x255570-_0x5c050)/0x3e8);}const _0x49d4bf={'attempt_id':_0x5a4fb8['id'],'status':_0x237273,..._0x5a4fb8[_0x302e32(0x88)]!==undefined&&{'index':_0x5a4fb8['index']},..._0x5a4fb8[_0x302e32(0xe2)]&&{'project':_0x5a4fb8[_0x302e32(0xe2)]['name']},..._0x5a4fb8[_0x302e32(0x8d)]&&{'workflow':_0x5a4fb8[_0x302e32(0x8d)][_0x302e32(0xae)]},..._0x5a4fb8[_0x302e32(0xd7)]&&{'session_id':_0x5a4fb8[_0x302e32(0xd7)]},..._0x5a4fb8[_0x302e32(0xf5)]&&{'session_time':_0x5a4fb8['sessionTime']},..._0x5a4fb8[_0x302e32(0x10c)]&&{'retry_attempt':_0x5a4fb8[_0x302e32(0x10c)]},..._0x2c7d87!==undefined&&{'duration_sec':_0x2c7d87},..._0x5a4fb8[_0x302e32(0x79)]&&{'created_at':_0x5a4fb8['createdAt']},..._0x5a4fb8['finishedAt']&&{'finished_at':_0x5a4fb8[_0x302e32(0x94)]},...Object[_0x302e32(0x82)](_0x5a4fb8[_0x302e32(0xc7)])['length']>0x0&&{'params':_0x5a4fb8[_0x302e32(0xc7)]}};return await handleSingleObjectOutput(_0x49d4bf,_0xa67dce),0x0;}catch(_0x55a47f){if(_0x55a47f instanceof SDKError)return console[_0x302e32(0xd0)](_0x302e32(0xd9)+_0x55a47f['message']),_0x55a47f['cause']&&console[_0x302e32(0xd0)](_0x302e32(0xa6)+_0x55a47f['cause']),0x1;throw _0x55a47f;}}}export class WorkflowTasksCommand extends BaseCommand{['name']=a39_0x1cfa1b(0xc8);[a39_0x1cfa1b(0x8b)]=a39_0x1cfa1b(0x10a);async['execute'](_0x2fa61b){const _0xea7804=a39_0x1cfa1b,{options:_0x128b47,args:_0x1e9160,tdx:_0x84ca62}=_0x2fa61b,_0x29e2f4=_0x1e9160[0x0];if(!_0x29e2f4)return console[_0xea7804(0xd0)](_0xea7804(0xf9)),0x1;try{const _0x3dc862=_0x128b47[_0xea7804(0x6f)];_0x128b47[_0xea7804(0xd1)]&&(console[_0xea7804(0xd0)](_0xea7804(0xef)+_0x29e2f4),_0x3dc862&&console['error'](_0xea7804(0xc0)));const _0x4a6bc2=await withSpinner(_0xea7804(0xa4),()=>_0x84ca62['workflow'][_0xea7804(0x87)](_0x29e2f4,_0x3dc862||![]),{'verbose':_0x128b47[_0xea7804(0xd1)]}),_0x15428d=_0x4a6bc2[_0xea7804(0xbf)];return console[_0xea7804(0xd0)]('✔\x20Found\x20'+_0x15428d[_0xea7804(0x8e)]+_0xea7804(0xe0)+(_0x15428d['length']!==0x1?'s':'')),await handleSDKOutput(_0x15428d,_0x128b47),0x0;}catch(_0x47055a){if(_0x47055a instanceof SDKError)return console['error']('Error:\x20'+_0x47055a[_0xea7804(0xa3)]),_0x47055a[_0xea7804(0xe5)]&&console[_0xea7804(0xd0)]('\x20\x20Cause:\x20'+_0x47055a['cause']),0x1;throw _0x47055a;}}}export class WorkflowLogsCommand extends BaseCommand{[a39_0x1cfa1b(0xae)]=a39_0x1cfa1b(0x10d);[a39_0x1cfa1b(0x8b)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a39_0x1cfa1b(0x6c)](_0x35d439){const _0x1a5bcc=a39_0x1cfa1b,{options:_0x3c0fd2,args:_0x20310c,tdx:_0x32a0ba}=_0x35d439,_0xa3ed96=_0x20310c[0x0];let _0x258481=_0x20310c[0x1];if(!_0xa3ed96)return console[_0x1a5bcc(0xd0)](_0x1a5bcc(0xf9)),0x1;try{_0x3c0fd2['verbose']&&(console[_0x1a5bcc(0xd0)]('Attempt\x20ID:\x20'+_0xa3ed96),_0x258481&&console['error'](_0x1a5bcc(0x8c)+_0x258481));const _0x457ef5=await withSpinner(_0x1a5bcc(0x71),()=>_0x32a0ba['workflow']['logFiles'](_0xa3ed96,_0x258481),{'verbose':_0x3c0fd2[_0x1a5bcc(0xd1)]}),_0x1c9d7f=_0x457ef5[_0x1a5bcc(0xbf)];if(_0x1c9d7f['length']===0x0)return console['error'](_0x1a5bcc(0xda)),0x0;if(!_0x258481&&(_0x3c0fd2['json']||_0x3c0fd2[_0x1a5bcc(0x100)]))return await handleSDKOutput(_0x1c9d7f,_0x3c0fd2),0x0;if(!_0x258481){const _0x5cfd74=_0x1c9d7f[_0x1a5bcc(0xfa)](_0x35c857=>({'title':_0x35c857[_0x1a5bcc(0x85)]+'\x20('+formatBytes(_0x35c857[_0x1a5bcc(0xb4)])+')','value':_0x35c857['taskName']})),_0x2b3aff=await a39_0x5c9109({'type':_0x1a5bcc(0xa0),'name':_0x1a5bcc(0x9b),'message':_0x1a5bcc(0x103),'choices':_0x5cfd74});if(!_0x2b3aff[_0x1a5bcc(0x9b)])return console[_0x1a5bcc(0xd0)](_0x1a5bcc(0x104)),0x0;_0x258481=_0x2b3aff[_0x1a5bcc(0x9b)];}const _0x4ab8bc=await withSpinner(_0x1a5bcc(0x9a),()=>_0x32a0ba[_0x1a5bcc(0x8d)]['logs'](_0xa3ed96,_0x258481),{'verbose':_0x3c0fd2[_0x1a5bcc(0xd1)]}),_0x5d9f64=_0x4ab8bc['data'];return _0x5d9f64?console[_0x1a5bcc(0xd2)](_0x5d9f64):console[_0x1a5bcc(0xd0)](_0x1a5bcc(0xde)),0x0;}catch(_0x28f4ce){if(_0x28f4ce instanceof SDKError)return console[_0x1a5bcc(0xd0)]('Error:\x20'+_0x28f4ce[_0x1a5bcc(0xa3)]),_0x28f4ce['cause']&&console[_0x1a5bcc(0xd0)](_0x1a5bcc(0xa6)+_0x28f4ce['cause']),0x1;throw _0x28f4ce;}}}function a39_0x74fa(){const _0x537e27=['2012169NFhseR','Listing\x20workflows...','...','reason','List\x20all\x20workflow\x20projects','sessionTime','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Error:\x20Invalid\x20parameter\x20format:\x20','4292302UkVJVc','Error:\x20Attempt\x20ID\x20is\x20required','map','6005IJMjas','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Kill\x20a\x20running\x20attempt','param','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','format','session:','attemptId','Select\x20a\x20task\x20to\x20view\x20logs:','Cancelled','Starting\x20workflow\x20run...','stringify','readFile','resumeFrom','Target:\x20','Show\x20tasks\x20for\x20an\x20attempt','Error:\x20Invalid\x20JSON\x20in\x20--params','retryAttemptName','workflow:logs','isArray','session','execute','retrySession','\x22?\x20This\x20cannot\x20be\x20undone.','includeSubtasks','Pushing\x20workflow\x20project...','Fetching\x20log\x20files...','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','utf-8','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','\x20\x20New\x20attempt\x20ID:\x20','Project\x20name:\x20','\x20workflow','\x20\x20Session\x20ID:\x20','createdAt','Deleting\x20project\x20','\x20is\x20not\x20a\x20directory','596iegKWk','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','kill','Workflow:\x20','Retry\x20a\x20session\x20or\x20attempt','retryAttempt','keys','Filter:\x20project=','projectName','taskName','Project\x20filter:\x20','tasks','index','indexOf','revision','description','Task\x20name:\x20','workflow','length','\x20project','8557872RbccSt','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Pattern:\x20','\x20session','finishedAt','cancelRequested','getTime','Retrying\x20session...','Listing\x20workflow\x20projects...','From\x20task:\x20','Downloading\x20logs...','task','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','\x20\x20Revision:\x20','canceling','Expected\x20format:\x20--param\x20key=value','select','workflow:kill','workflow:sessions','message','Getting\x20attempt\x20tasks...','\x20\x20Project\x20ID:\x20','\x20\x20Cause:\x20','Output\x20directory:\x20','attempt','Parameters:\x20','substring','List\x20workflows','List\x20workflow\x20execution\x20sessions','push','name','parse','\x20\x20Project:\x20','✔\x20Downloaded\x20','163848GjgiWF','fromTask','fileSize','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','List\x20workflow\x20attempts','\x20\x20Workflow:\x20','attempts','done','Usage:\x20workflow:delete\x20<project-name-or-id>','Killing\x20attempt...','✔\x20Deleted\x20project\x20','Status:\x20','delete','data','Including\x20subtasks:\x20yes','workflow:download','workflows','✔\x20Found\x20','workflow:projects','Include\x20retried:\x20yes','3019apJQLl','params','workflow:tasks','filesExtracted','stat','yes','Listing\x20workflow\x20sessions...','isDirectory','skipValidation','workflow:delete','error','verbose','log','Project:\x20','Validation:\x20skipped','2982mzABoP','Resume\x20from:\x20','sessionId','startsWith','Error:\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Getting\x20attempt\x20details...','Project\x20directory:\x20','projectId','No\x20log\x20content\x20found','\x20attempt','\x20task','✔\x20Pushed\x20','project','success','limit','cause','✔\x20Retry\x20started','6531471WCYNZn','workflow:workflows','split','Error:\x20Workflow\x20identifier\x20is\x20required','Filter:\x20','run','Params:\x20','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Attempt\x20ID:\x20'];a39_0x74fa=function(){return _0x537e27;};return a39_0x74fa();}export class WorkflowKillCommand extends BaseCommand{[a39_0x1cfa1b(0xae)]=a39_0x1cfa1b(0xa1);[a39_0x1cfa1b(0x8b)]=a39_0x1cfa1b(0xfd);async[a39_0x1cfa1b(0x6c)](_0x332c26){const _0x24dbfb=a39_0x1cfa1b,{options:_0xf0eee5,args:_0x1736d4,tdx:_0x14ce6a}=_0x332c26,_0x2b6801=_0x1736d4[0x0];if(!_0x2b6801)return console[_0x24dbfb(0xd0)](_0x24dbfb(0xf9)),0x1;try{const _0x4e9071=_0xf0eee5[_0x24dbfb(0xf3)];_0xf0eee5['verbose']&&(console[_0x24dbfb(0xd0)](_0x24dbfb(0xef)+_0x2b6801),_0x4e9071&&console[_0x24dbfb(0xd0)]('Reason:\x20'+_0x4e9071));if(!_0xf0eee5[_0x24dbfb(0xcb)]){const _0x31bd6a=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x2b6801+'?');if(!_0x31bd6a)return console[_0x24dbfb(0xd0)]('Cancelled'),0x0;}const _0x1f9034=await withSpinner(_0x24dbfb(0xbb),()=>_0x14ce6a[_0x24dbfb(0x8d)][_0x24dbfb(0x7e)](_0x2b6801,_0x4e9071),{'verbose':_0xf0eee5['verbose']}),_0x2f8d05=_0x1f9034['data'];return console['error']('✔\x20'+_0x2f8d05),0x0;}catch(_0x491d5f){if(_0x491d5f instanceof SDKError)return console[_0x24dbfb(0xd0)](_0x24dbfb(0xd9)+_0x491d5f[_0x24dbfb(0xa3)]),_0x491d5f[_0x24dbfb(0xe5)]&&console['error']('\x20\x20Cause:\x20'+_0x491d5f[_0x24dbfb(0xe5)]),0x1;throw _0x491d5f;}}}export class WorkflowRetryCommand extends BaseCommand{[a39_0x1cfa1b(0xae)]='workflow:retry';[a39_0x1cfa1b(0x8b)]=a39_0x1cfa1b(0x80);async['execute'](_0xfadd89){const _0x1422e2=a39_0x1cfa1b,{options:_0x6a1cda,args:_0x598469,tdx:_0x13749f}=_0xfadd89,_0x563b11=_0x598469[0x0];if(!_0x563b11)return console[_0x1422e2(0xd0)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x1422e2(0xd0)](_0x1422e2(0xf6)),0x1;let _0x15fc1e=![],_0x1c2af3=_0x563b11;if(_0x563b11[_0x1422e2(0xd8)](_0x1422e2(0x101)))_0x15fc1e=!![],_0x1c2af3=_0x563b11[_0x1422e2(0xaa)](0x8);else{if(_0x563b11['startsWith']('attempt:'))_0x15fc1e=![],_0x1c2af3=_0x563b11[_0x1422e2(0xaa)](0x8);else return console['error']('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0x1422e2(0xd0)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}try{const _0x315025=_0x6a1cda[_0x1422e2(0xb3)],_0x32a679=_0x6a1cda[_0x1422e2(0x108)],_0xedf111=_0x6a1cda[_0x1422e2(0xc7)],_0x32dd33=_0x6a1cda['force'];_0x6a1cda[_0x1422e2(0xd1)]&&(console[_0x1422e2(0xd0)](_0x1422e2(0x109)+(_0x15fc1e?'session':_0x1422e2(0xa8))+'\x20'+_0x1c2af3),_0x315025&&console['error'](_0x1422e2(0x99)+_0x315025),_0x32a679&&console[_0x1422e2(0xd0)](_0x1422e2(0xd6)+_0x32a679),_0xedf111&&console[_0x1422e2(0xd0)](_0x1422e2(0xed)+_0xedf111),_0x32dd33&&console[_0x1422e2(0xd0)]('Force:\x20yes'));let _0x3b1514;if(_0xedf111)try{if(_0xedf111[_0x1422e2(0xd8)]('@')){const _0x3d2430=await import('fs/promises'),_0x1d6825=_0xedf111[_0x1422e2(0xaa)](0x1),_0x385e66=await _0x3d2430[_0x1422e2(0x107)](_0x1d6825,_0x1422e2(0x73));_0x3b1514=JSON[_0x1422e2(0xaf)](_0x385e66);}else _0x3b1514=JSON[_0x1422e2(0xaf)](_0xedf111);}catch{return console['error'](_0x1422e2(0x10b)),0x1;}if(!_0x6a1cda[_0x1422e2(0xcb)]){const _0x133c9e=await confirm(_0x1422e2(0x9c)+(_0x15fc1e?_0x1422e2(0x10f):_0x1422e2(0xa8))+'\x20'+_0x1c2af3+'?');if(!_0x133c9e)return console[_0x1422e2(0xd0)](_0x1422e2(0x104)),0x0;}let _0x5b5eb9;_0x15fc1e?_0x5b5eb9=await withSpinner(_0x1422e2(0x97),()=>_0x13749f['workflow'][_0x1422e2(0x6d)](_0x1c2af3,{'fromTask':_0x315025,'retryParams':_0x3b1514}),{'verbose':_0x6a1cda['verbose']}):_0x5b5eb9=await withSpinner('Retrying\x20attempt...',()=>_0x13749f['workflow'][_0x1422e2(0x81)](_0x1c2af3,{'resumeFrom':_0x32a679,'retryParams':_0x3b1514,'force':_0x32dd33}),{'verbose':_0x6a1cda['verbose']});const _0x5e1ad1=_0x5b5eb9[_0x1422e2(0xbf)];return console[_0x1422e2(0xd0)](_0x1422e2(0xe6)),console[_0x1422e2(0xd0)](_0x1422e2(0x75)+_0x5e1ad1[_0x1422e2(0x102)]),console[_0x1422e2(0xd0)](_0x1422e2(0x78)+_0x5e1ad1['sessionId']),0x0;}catch(_0x389905){if(_0x389905 instanceof SDKError)return console[_0x1422e2(0xd0)](_0x1422e2(0xd9)+_0x389905[_0x1422e2(0xa3)]),_0x389905[_0x1422e2(0xe5)]&&console[_0x1422e2(0xd0)]('\x20\x20Cause:\x20'+_0x389905['cause']),0x1;throw _0x389905;}}}export class WorkflowRunCommand extends BaseCommand{[a39_0x1cfa1b(0xae)]='workflow:run';[a39_0x1cfa1b(0x8b)]='Start\x20a\x20workflow\x20run';async[a39_0x1cfa1b(0x6c)](_0x85e53f){const _0x4aae77=a39_0x1cfa1b,{options:_0x14a041,args:_0x2b2794,tdx:_0x438ea1}=_0x85e53f,_0x3b692f=_0x2b2794[0x0];if(!_0x3b692f)return console[_0x4aae77(0xd0)](_0x4aae77(0xea)),console['error'](_0x4aae77(0xff)),0x1;const _0x2ac0c7=_0x14a041[_0x4aae77(0xfe)],_0x2728a2=_0x14a041[_0x4aae77(0xf5)],_0x7381cf={};if(_0x2ac0c7&&Array[_0x4aae77(0x10e)](_0x2ac0c7))for(const _0x311096 of _0x2ac0c7){const _0xba45ef=_0x311096[_0x4aae77(0x89)]('=');if(_0xba45ef===-0x1)return console[_0x4aae77(0xd0)](_0x4aae77(0xf7)+_0x311096),console[_0x4aae77(0xd0)](_0x4aae77(0x9f)),0x1;const _0x32f107=_0x311096[_0x4aae77(0xaa)](0x0,_0xba45ef),_0x287a57=_0x311096[_0x4aae77(0xaa)](_0xba45ef+0x1);try{_0x7381cf[_0x32f107]=JSON[_0x4aae77(0xaf)](_0x287a57);}catch{_0x7381cf[_0x32f107]=_0x287a57;}}_0x14a041[_0x4aae77(0xd1)]&&(console[_0x4aae77(0xd0)](_0x4aae77(0x7f)+_0x3b692f),Object[_0x4aae77(0x82)](_0x7381cf)[_0x4aae77(0x8e)]>0x0&&console[_0x4aae77(0xd0)](_0x4aae77(0xa9)+JSON[_0x4aae77(0x106)](_0x7381cf)),_0x2728a2&&console[_0x4aae77(0xd0)]('Session\x20time:\x20'+_0x2728a2));const _0x2b5d0c=await withSpinner(_0x4aae77(0x105),()=>_0x438ea1['workflow'][_0x4aae77(0xec)](_0x3b692f,_0x7381cf,{'sessionTime':_0x2728a2}),{'verbose':_0x14a041[_0x4aae77(0xd1)]}),_0x325e44=_0x2b5d0c[_0x4aae77(0xbf)];return console[_0x4aae77(0xd0)]('✔\x20Workflow\x20run\x20started'),console[_0x4aae77(0xd0)]('\x20\x20Attempt\x20ID:\x20'+_0x325e44['id']),console[_0x4aae77(0xd0)]('\x20\x20Session\x20ID:\x20'+_0x325e44[_0x4aae77(0xd7)]),console[_0x4aae77(0xd0)](_0x4aae77(0xb0)+_0x325e44[_0x4aae77(0xe2)]?.[_0x4aae77(0xae)]),console['error'](_0x4aae77(0xb7)+_0x325e44[_0x4aae77(0x8d)]?.[_0x4aae77(0xae)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a39_0x1cfa1b(0xc1);[a39_0x1cfa1b(0x8b)]=a39_0x1cfa1b(0x91);async[a39_0x1cfa1b(0x6c)](_0x46d27c){const _0x19e9bc=a39_0x1cfa1b,{options:_0x43f42d,args:_0x3d4ed4,tdx:_0x1c2705}=_0x46d27c,_0x3182be=_0x3d4ed4[0x0],_0x4e6c5f=_0x3d4ed4[0x1]||'.';if(!_0x3182be)return console[_0x19e9bc(0xd0)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x19e9bc(0xd0)](_0x19e9bc(0xb5)),0x1;const _0xa82d2e=_0x43f42d[_0x19e9bc(0x8a)];_0x43f42d['verbose']&&(console[_0x19e9bc(0xd0)](_0x19e9bc(0xd3)+_0x3182be),console[_0x19e9bc(0xd0)](_0x19e9bc(0xa7)+_0x4e6c5f),_0xa82d2e&&console[_0x19e9bc(0xd0)]('Revision:\x20'+_0xa82d2e));const _0x20b1a3=await withSpinner('Downloading\x20project\x20'+_0x3182be+_0x19e9bc(0xf2),()=>_0x1c2705[_0x19e9bc(0x8d)]['download'](_0x3182be,_0x4e6c5f,{'revision':_0xa82d2e}),{'verbose':_0x43f42d[_0x19e9bc(0xd1)]}),_0x5dbc66=_0x20b1a3['data'];return console['error'](_0x19e9bc(0xb1)+_0x5dbc66[_0x19e9bc(0x84)]),console['error'](_0x19e9bc(0x9d)+_0x5dbc66[_0x19e9bc(0x8a)]),console[_0x19e9bc(0xd0)]('\x20\x20Files\x20extracted:\x20'+_0x5dbc66[_0x19e9bc(0xc9)]),console['error']('\x20\x20Location:\x20'+_0x4e6c5f+'/'+_0x5dbc66[_0x19e9bc(0x84)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{['name']='workflow:push';[a39_0x1cfa1b(0x8b)]=a39_0x1cfa1b(0x72);async[a39_0x1cfa1b(0x6c)](_0xc29135){const _0xcbc79b=a39_0x1cfa1b,{options:_0x6833ba,args:_0x353580,tdx:_0xf3e083}=_0xc29135;let _0x20f515='.',_0x5ac5a8=_0x6833ba[_0xcbc79b(0xae)];if(_0x353580[0x0]){const {promises:_0x2f1c0f}=await import('fs');try{const _0x2e7bed=await _0x2f1c0f[_0xcbc79b(0xca)](_0x353580[0x0]);if(_0x2e7bed[_0xcbc79b(0xcd)]())_0x20f515=_0x353580[0x0];else return console[_0xcbc79b(0xd0)](_0xcbc79b(0xd9)+_0x353580[0x0]+_0xcbc79b(0x7b)),0x1;}catch{_0x5ac5a8=_0x353580[0x0],_0x20f515='.';}}const _0x4e5b91=_0x6833ba['revision'],_0x22d39c=_0x6833ba[_0xcbc79b(0xce)];_0x6833ba['verbose']&&(console[_0xcbc79b(0xd0)](_0xcbc79b(0xdc)+_0x20f515),_0x5ac5a8&&console['error'](_0xcbc79b(0x76)+_0x5ac5a8),_0x4e5b91&&console[_0xcbc79b(0xd0)]('Revision:\x20'+_0x4e5b91),_0x22d39c&&console[_0xcbc79b(0xd0)](_0xcbc79b(0xd4)));const _0x259373=await withSpinner(_0xcbc79b(0x70),()=>_0xf3e083[_0xcbc79b(0x8d)][_0xcbc79b(0xad)](_0x20f515,{'projectName':_0x5ac5a8,'revision':_0x4e5b91,'skipValidation':_0x22d39c}),{'verbose':_0x6833ba[_0xcbc79b(0xd1)]}),_0x1b38cc=_0x259373[_0xcbc79b(0xbf)];return console[_0xcbc79b(0xd0)](_0xcbc79b(0xe1)+_0x1b38cc[_0xcbc79b(0x84)]),console[_0xcbc79b(0xd0)](_0xcbc79b(0xa5)+_0x1b38cc[_0xcbc79b(0xdd)]),console[_0xcbc79b(0xd0)](_0xcbc79b(0x9d)+_0x1b38cc[_0xcbc79b(0x8a)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a39_0x1cfa1b(0xae)]=a39_0x1cfa1b(0xcf);[a39_0x1cfa1b(0x8b)]=a39_0x1cfa1b(0x7d);async[a39_0x1cfa1b(0x6c)](_0x458d4c){const _0x47c610=a39_0x1cfa1b,{options:_0x53bc43,args:_0x5c42a1,tdx:_0x40e319}=_0x458d4c,_0x59c09d=_0x5c42a1[0x0];if(!_0x59c09d)return console[_0x47c610(0xd0)](_0x47c610(0x74)),console[_0x47c610(0xd0)](_0x47c610(0xba)),0x1;_0x53bc43[_0x47c610(0xd1)]&&console['error'](_0x47c610(0xd3)+_0x59c09d);if(!_0x53bc43[_0x47c610(0xcb)]){const _0x389325=await confirm(_0x47c610(0xfc)+_0x59c09d+_0x47c610(0x6e));if(!_0x389325)return console[_0x47c610(0xd0)](_0x47c610(0x104)),0x0;}const _0x3cf246=await withSpinner(_0x47c610(0x7a)+_0x59c09d+_0x47c610(0xf2),()=>_0x40e319[_0x47c610(0x8d)][_0x47c610(0xbe)](_0x59c09d),{'verbose':_0x53bc43[_0x47c610(0xd1)]}),_0x361492=_0x3cf246['data'];return console[_0x47c610(0xd0)](_0x47c610(0xbc)+_0x361492['projectName']),console['error'](_0x47c610(0xa5)+_0x361492[_0x47c610(0xdd)]),0x0;}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x63309e,_0x2dea2b){const _0x3e662a=a40_0x2123,_0x5f0183=_0x63309e();while(!![]){try{const _0x11abfd=-parseInt(_0x3e662a(0x1ca))/0x1+-parseInt(_0x3e662a(0x1ba))/0x2+parseInt(_0x3e662a(0x1cd))/0x3+parseInt(_0x3e662a(0x1c3))/0x4+parseInt(_0x3e662a(0x1c4))/0x5*(parseInt(_0x3e662a(0x1cc))/0x6)+-parseInt(_0x3e662a(0x1bd))/0x7*(parseInt(_0x3e662a(0x1cb))/0x8)+parseInt(_0x3e662a(0x1c5))/0x9;if(_0x11abfd===_0x2dea2b)break;else _0x5f0183['push'](_0x5f0183['shift']());}catch(_0x149ebe){_0x5f0183['push'](_0x5f0183['shift']());}}}(a40_0x53f9,0x830fa));import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x1077c4=a40_0x2123;try{const _0x577206=fileURLToPath(import.meta[_0x1077c4(0x1bf)]),_0x4a8d65=dirname(_0x577206),_0x344d90=join(_0x4a8d65,_0x1077c4(0x1c1)),_0x4ccb6d=JSON['parse'](readFileSync(_0x344d90,'utf-8'));return _0x4ccb6d[_0x1077c4(0x1be)];}catch{return _0x1077c4(0x1c8);}}export function getUserAgent(){const _0x2b6a8c=a40_0x2123,_0x17d5b2=getVersion(),_0xcb3457=platform(),_0x98a0f1=process[_0x2b6a8c(0x1be)][_0x2b6a8c(0x1c2)]('v','');return _0x2b6a8c(0x1c9)+_0x17d5b2+'\x20('+_0xcb3457+_0x2b6a8c(0x1c6)+_0x98a0f1+')';}function a40_0x2123(_0x437a95,_0xc02b6d){const _0x53f9c7=a40_0x53f9();return a40_0x2123=function(_0x2123e4,_0x29946e){_0x2123e4=_0x2123e4-0x1b9;let _0x39e187=_0x53f9c7[_0x2123e4];return _0x39e187;},a40_0x2123(_0x437a95,_0xc02b6d);}export function getAuthHeaders(_0x496e90,_0x4956da){const _0x44f1af=a40_0x2123,_0x77b474=getVersion(),_0x512981={'User-Agent':getUserAgent(),'X-TD-Client':_0x44f1af(0x1bb),'X-TD-Client-Version':_0x77b474};return _0x4956da&&(_0x512981[_0x44f1af(0x1c0)]=_0x44f1af(0x1b9)+_0x4956da),_0x512981;}export function toHeaderRecord(_0x3a73f1){const _0x16dd93=a40_0x2123,_0x209b9f={};for(const [_0x39d246,_0x3830b1]of Object[_0x16dd93(0x1bc)](_0x3a73f1)){_0x3830b1!==undefined&&(_0x209b9f[_0x39d246]=_0x3830b1);}return _0x209b9f;}export function getTrinoHeaders(_0x568d9b,_0x239222){const _0x557c42=getAuthHeaders(_0x568d9b,_0x239222),_0x6dd319=toHeaderRecord(_0x557c42);return delete _0x6dd319['Authorization'],_0x239222&&(_0x6dd319['X-Trino-User']=_0x239222),_0x6dd319;}export function hasAPIKey(_0x731ad6){const _0x48548c=a40_0x2123,_0x17284a=getAPIKey(_0x731ad6);return _0x17284a!==undefined&&_0x17284a[_0x48548c(0x1c7)]>0x0;}function a40_0x53f9(){const _0x2f5318=['0.0.0','tdx/','868819eaLetJ','8EpazVp','6kArNyl','950277OCYBmg','TD1\x20','2081714IImjaP','tdx','entries','4835201dyYviB','version','url','Authorization','../../package.json','replace','1244516iLghdl','2839540EmdlYM','17473041cfCaLY',';\x20node/','length'];a40_0x53f9=function(){return _0x2f5318;};return a40_0x53f9();}
1
+ (function(_0x559715,_0x1bf261){const _0x3fa2ef=a40_0x4559,_0x84b949=_0x559715();while(!![]){try{const _0x30f975=-parseInt(_0x3fa2ef(0x73))/0x1*(-parseInt(_0x3fa2ef(0x7b))/0x2)+parseInt(_0x3fa2ef(0x85))/0x3+-parseInt(_0x3fa2ef(0x88))/0x4+-parseInt(_0x3fa2ef(0x86))/0x5*(-parseInt(_0x3fa2ef(0x70))/0x6)+-parseInt(_0x3fa2ef(0x83))/0x7*(-parseInt(_0x3fa2ef(0x71))/0x8)+-parseInt(_0x3fa2ef(0x82))/0x9*(parseInt(_0x3fa2ef(0x7c))/0xa)+parseInt(_0x3fa2ef(0x78))/0xb*(-parseInt(_0x3fa2ef(0x81))/0xc);if(_0x30f975===_0x1bf261)break;else _0x84b949['push'](_0x84b949['shift']());}catch(_0x19cb70){_0x84b949['push'](_0x84b949['shift']());}}}(a40_0x2e1f,0x2d11e));import{platform}from'os';import{readFileSync}from'fs';function a40_0x4559(_0x2679d8,_0x27ed72){const _0x2e1f28=a40_0x2e1f();return a40_0x4559=function(_0x455926,_0x435463){_0x455926=_0x455926-0x70;let _0x393a1e=_0x2e1f28[_0x455926];return _0x393a1e;},a40_0x4559(_0x2679d8,_0x27ed72);}import{fileURLToPath}from'url';import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0xb273bb=a40_0x4559;try{const _0x110a84=fileURLToPath(import.meta[_0xb273bb(0x89)]),_0x1925ca=dirname(_0x110a84),_0x4c495b=join(_0x1925ca,_0xb273bb(0x7d)),_0xcd34df=JSON[_0xb273bb(0x75)](readFileSync(_0x4c495b,_0xb273bb(0x7f)));return _0xcd34df['version'];}catch{return _0xb273bb(0x8a);}}function a40_0x2e1f(){const _0x594c4a=['tdx','2101LqdWnZ','tdx/','version','58myNmTA','10sCBrAK','../../package.json','TD1\x20','utf-8','entries','9096lbmTqr','3024711kjzDFn','224yByrZS','Authorization','786993CrATav','5inqUEB',';\x20node/','544700qaSYMf','url','0.0.0','1392618vtUPvZ','34664XcsLoP','replace','5812GfWiuf','X-Trino-User','parse','length'];a40_0x2e1f=function(){return _0x594c4a;};return a40_0x2e1f();}export function getUserAgent(){const _0x5d9123=a40_0x4559,_0x33837c=getVersion(),_0x46a8e5=platform(),_0x517852=process[_0x5d9123(0x7a)][_0x5d9123(0x72)]('v','');return _0x5d9123(0x79)+_0x33837c+'\x20('+_0x46a8e5+_0x5d9123(0x87)+_0x517852+')';}export function getAuthHeaders(_0x4caa32,_0x5573d0){const _0x28eeb8=a40_0x4559,_0x59361d=getVersion(),_0x252f29={'User-Agent':getUserAgent(),'X-TD-Client':_0x28eeb8(0x77),'X-TD-Client-Version':_0x59361d};return _0x5573d0&&(_0x252f29[_0x28eeb8(0x84)]=_0x28eeb8(0x7e)+_0x5573d0),_0x252f29;}export function toHeaderRecord(_0x163286){const _0x13fa97=a40_0x4559,_0x3d6856={};for(const [_0x1008e2,_0x2830d]of Object[_0x13fa97(0x80)](_0x163286)){_0x2830d!==undefined&&(_0x3d6856[_0x1008e2]=_0x2830d);}return _0x3d6856;}export function getTrinoHeaders(_0x3a5e21,_0x266092){const _0x482886=a40_0x4559,_0x372f6c=getAuthHeaders(_0x3a5e21,_0x266092),_0x112b21=toHeaderRecord(_0x372f6c);return delete _0x112b21[_0x482886(0x84)],_0x266092&&(_0x112b21[_0x482886(0x74)]=_0x266092),_0x112b21;}export function hasAPIKey(_0xb6e8ba){const _0x3ce3e4=a40_0x4559,_0x1f7b81=getAPIKey(_0xb6e8ba);return _0x1f7b81!==undefined&&_0x1f7b81[_0x3ce3e4(0x76)]>0x0;}