@treasuredata/tdx 0.7.2 → 0.7.3

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 (111) 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.js +1 -1
  18. package/dist/commands/chat-command.js +1 -1
  19. package/dist/commands/claude-command.js +1 -1
  20. package/dist/commands/claude-statusline-command.js +1 -1
  21. package/dist/commands/claude-usage-command.js +1 -1
  22. package/dist/commands/command.js +1 -1
  23. package/dist/commands/context-command.js +1 -1
  24. package/dist/commands/databases.js +1 -1
  25. package/dist/commands/describe.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/llm-command.js +1 -1
  29. package/dist/commands/llm-proxy.js +1 -1
  30. package/dist/commands/parent-segment-command.d.ts +5 -4
  31. package/dist/commands/parent-segment-command.d.ts.map +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js.map +1 -1
  34. package/dist/commands/profiles-command.js +1 -1
  35. package/dist/commands/query-command.js +1 -1
  36. package/dist/commands/segment-command.js +1 -1
  37. package/dist/commands/segment-create-command.js +1 -1
  38. package/dist/commands/segment-fields-command.js +1 -1
  39. package/dist/commands/segment-pwd-command.js +1 -1
  40. package/dist/commands/segment-update-command.js +1 -1
  41. package/dist/commands/segment-use-command.js +1 -1
  42. package/dist/commands/segments.js +1 -1
  43. package/dist/commands/show.js +1 -1
  44. package/dist/commands/tables.js +1 -1
  45. package/dist/commands/use-command.js +1 -1
  46. package/dist/commands/workflow-command.js +1 -1
  47. package/dist/core/auth.js +1 -1
  48. package/dist/core/config.js +1 -1
  49. package/dist/core/credential-cache.js +1 -1
  50. package/dist/core/global-context.js +1 -1
  51. package/dist/core/keychain.js +1 -1
  52. package/dist/core/profile.js +1 -1
  53. package/dist/core/project-config.js +1 -1
  54. package/dist/core/session.js +1 -1
  55. package/dist/index.js +1 -1
  56. package/dist/proxy/anthropic-adapter.js +1 -1
  57. package/dist/proxy/claude-usage-tracker.js +1 -1
  58. package/dist/proxy/context-signature.js +1 -1
  59. package/dist/proxy/conversation-utils.js +1 -1
  60. package/dist/proxy/server.js +1 -1
  61. package/dist/proxy/session-cache.js +1 -1
  62. package/dist/sdk/api.js +1 -1
  63. package/dist/sdk/engage.js +1 -1
  64. package/dist/sdk/errors.js +1 -1
  65. package/dist/sdk/index.js +1 -1
  66. package/dist/sdk/job.js +1 -1
  67. package/dist/sdk/llm.js +1 -1
  68. package/dist/sdk/query.js +1 -1
  69. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  70. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  71. package/dist/sdk/segment.d.ts.map +1 -1
  72. package/dist/sdk/segment.js +1 -1
  73. package/dist/sdk/segment.js.map +1 -1
  74. package/dist/sdk/workflow.js +1 -1
  75. package/dist/types/cdp.d.ts +1 -0
  76. package/dist/types/cdp.d.ts.map +1 -1
  77. package/dist/types/endpoints.js +1 -1
  78. package/dist/types/index.js +1 -1
  79. package/dist/utils/agent-ref-parser.js +1 -1
  80. package/dist/utils/chat-cache.js +1 -1
  81. package/dist/utils/colors.js +1 -1
  82. package/dist/utils/command-output.js +1 -1
  83. package/dist/utils/constants.js +1 -1
  84. package/dist/utils/diff.js +1 -1
  85. package/dist/utils/fields-display.d.ts +1 -0
  86. package/dist/utils/fields-display.d.ts.map +1 -1
  87. package/dist/utils/fields-display.js +1 -1
  88. package/dist/utils/fields-display.js.map +1 -1
  89. package/dist/utils/file-permissions.js +1 -1
  90. package/dist/utils/format-detector.js +1 -1
  91. package/dist/utils/formatters.js +1 -1
  92. package/dist/utils/json-loader.js +1 -1
  93. package/dist/utils/llm-backup-utils.js +1 -1
  94. package/dist/utils/model-aliases.js +1 -1
  95. package/dist/utils/model-factors.js +1 -1
  96. package/dist/utils/option-validation.js +1 -1
  97. package/dist/utils/port.js +1 -1
  98. package/dist/utils/process.js +1 -1
  99. package/dist/utils/prompt.js +1 -1
  100. package/dist/utils/segment-path-parser.js +1 -1
  101. package/dist/utils/segment-ref-parser.js +1 -1
  102. package/dist/utils/spinner.js +1 -1
  103. package/dist/utils/sql-parser.js +1 -1
  104. package/dist/utils/sse-parser.js +1 -1
  105. package/dist/utils/string-utils.js +1 -1
  106. package/dist/utils/table-ref-parser.js +1 -1
  107. package/dist/utils/tdx-logger.js +1 -1
  108. package/dist/utils/tree-formatter.js +1 -1
  109. package/dist/utils/version-check.js +1 -1
  110. package/dist/utils/workflow-utils.js +1 -1
  111. package/package.json +1 -1
@@ -1 +1 @@
1
- const a34_0x1b35a9=a34_0x2f87;(function(_0x4bdce1,_0x1e5d95){const _0x314761=a34_0x2f87,_0x503846=_0x4bdce1();while(!![]){try{const _0x1cc000=-parseInt(_0x314761(0x1bd))/0x1*(-parseInt(_0x314761(0x1c4))/0x2)+-parseInt(_0x314761(0x1a3))/0x3*(-parseInt(_0x314761(0x1b8))/0x4)+parseInt(_0x314761(0x1c9))/0x5*(-parseInt(_0x314761(0x1d0))/0x6)+parseInt(_0x314761(0x1a2))/0x7*(parseInt(_0x314761(0x1b5))/0x8)+-parseInt(_0x314761(0x1c0))/0x9*(parseInt(_0x314761(0x1a4))/0xa)+-parseInt(_0x314761(0x1aa))/0xb+-parseInt(_0x314761(0x19f))/0xc;if(_0x1cc000===_0x1e5d95)break;else _0x503846['push'](_0x503846['shift']());}catch(_0x12a030){_0x503846['push'](_0x503846['shift']());}}}(a34_0x375e,0x4e5aa));function a34_0x375e(){const _0x201df3=['verbose','length','4vEqROE','Folder\x20ID:\x20','Site:\x20','Target\x20path:\x20','split','3KmXEsS','segment','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','81FissVS','Context\x20set\x20to:\x20','parentName','name','380294CxaCmB','slice','error','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','site','5jKkHSr','data','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Resolved\x20path\x20type:\x20','isAbsolute','Context\x20cleared.\x20Back\x20to\x20root.','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','1799778EmIEPE','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','description','5018868ootRvd','Resolved\x20relative\x20path\x20to:\x20','type','3723202LhQbdi','1595499XWSyZp','232460LnDWDk','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Parent\x20ID:\x20','join','fullPath','folderId','4243866vRsYKM','segment:use','Examples:','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','folderPath','Use:\x20tdx\x20segment\x20use\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','log','8lQXvWl'];a34_0x375e=function(){return _0x201df3;};return a34_0x375e();}function a34_0x2f87(_0x2d1cbc,_0x5b7201){const _0x375ea8=a34_0x375e();return a34_0x2f87=function(_0x2f8772,_0x477aca){_0x2f8772=_0x2f8772-0x19e;let _0x66d11=_0x375ea8[_0x2f8772];return _0x66d11;},a34_0x2f87(_0x2d1cbc,_0x5b7201);}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';export class SegmentUseCommand extends BaseCommand{[a34_0x1b35a9(0x1c3)]=a34_0x1b35a9(0x1ab);[a34_0x1b35a9(0x19e)]=a34_0x1b35a9(0x1cb);async['execute'](_0x40ab1e){const _0x42f900=a34_0x1b35a9,{options:_0x423967,args:_0x5d23b4,tdx:_0x3a5e96}=_0x40ab1e;if(_0x5d23b4[_0x42f900(0x1b7)]===0x0)return console[_0x42f900(0x1c6)]('Error:\x20Path\x20is\x20required'),console[_0x42f900(0x1c6)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x42f900(0x1c6)](_0x42f900(0x1ac)),console[_0x42f900(0x1c6)](_0x42f900(0x1b1)),console[_0x42f900(0x1c6)](_0x42f900(0x1ae)),console[_0x42f900(0x1c6)](_0x42f900(0x1b3)),console[_0x42f900(0x1c6)](_0x42f900(0x1cf)),0x1;const _0x274379=_0x5d23b4[0x0],_0x490e88=_0x423967['session'];try{if(_0x274379==='/')return saveSessionContext({'segment_path':undefined},_0x490e88),console[_0x42f900(0x1b4)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;const _0x265404=_0x423967['segmentPath'];let _0x122b31=_0x274379;const _0x5db225=parsePath(_0x274379);if(!_0x5db225[_0x42f900(0x1cd)]){if(!_0x265404)return console[_0x42f900(0x1c6)](_0x42f900(0x1d1)),console[_0x42f900(0x1c6)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>'),0x1;if(_0x274379==='..'){const _0x28af05=_0x265404[_0x42f900(0x1bc)]('/')[_0x42f900(0x1c5)](0x0,-0x1)['join']('/');_0x122b31=_0x28af05||'/';}else _0x274379==='.'?_0x122b31=_0x265404:_0x122b31=_0x265404+'/'+_0x274379;_0x423967[_0x42f900(0x1b6)]&&console[_0x42f900(0x1c6)](_0x42f900(0x1a0)+_0x122b31);}if(_0x122b31==='/'||_0x122b31==='')return saveSessionContext({'segment_path':undefined},_0x490e88),console[_0x42f900(0x1b4)](_0x42f900(0x1ce)),0x0;_0x122b31=normalizePath(_0x122b31);const _0x29a0b6=parsePath(_0x122b31)['segments'];if(_0x29a0b6[_0x42f900(0x1b7)]===0x0)return saveSessionContext({'segment_path':undefined},_0x490e88),console[_0x42f900(0x1b4)](_0x42f900(0x1ce)),0x0;_0x423967[_0x42f900(0x1b6)]&&(console[_0x42f900(0x1c6)](_0x42f900(0x1ba)+_0x423967[_0x42f900(0x1c8)]),console['error'](_0x42f900(0x1bb)+_0x122b31));const _0x17cd2b=await withSpinner('Resolving\x20path\x20\x27'+_0x122b31+'\x27...',()=>_0x3a5e96[_0x42f900(0x1be)]['resolvePathToResource'](_0x122b31),{'verbose':_0x423967[_0x42f900(0x1b6)]}),_0x41cf78=_0x17cd2b[_0x42f900(0x1ca)];_0x423967[_0x42f900(0x1b6)]&&(console[_0x42f900(0x1c6)](_0x42f900(0x1cc)+_0x41cf78['type']),console[_0x42f900(0x1c6)](_0x42f900(0x1a6)+_0x41cf78['parentId']),_0x41cf78[_0x42f900(0x1a9)]&&console['error'](_0x42f900(0x1b9)+_0x41cf78[_0x42f900(0x1a9)]));if(_0x41cf78[_0x42f900(0x1a1)]===_0x42f900(0x1be))return console[_0x42f900(0x1c6)](_0x42f900(0x1a5)),console[_0x42f900(0x1c6)](_0x42f900(0x1ad)),console[_0x42f900(0x1c6)](_0x42f900(0x1b0)+_0x41cf78[_0x42f900(0x1c2)]+(_0x41cf78[_0x42f900(0x1af)]?'/'+_0x41cf78[_0x42f900(0x1af)][_0x42f900(0x1a7)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x41cf78[_0x42f900(0x1a8)],'parent_segment':_0x41cf78[_0x42f900(0x1c2)]},_0x490e88),console[_0x42f900(0x1b4)](_0x42f900(0x1c1)+_0x41cf78[_0x42f900(0x1a8)]),_0x423967['verbose']&&(console[_0x42f900(0x1c6)](_0x42f900(0x1bf)),console[_0x42f900(0x1c6)](_0x42f900(0x1c7)),console[_0x42f900(0x1c6)](_0x42f900(0x1b2))),0x0;}catch(_0x4c10e0){throw _0x4c10e0;}}}
1
+ const a34_0x248d73=a34_0x2b43;function a34_0x5ebb(){const _0x86c964=['713503lWsgvB','7550jSwbgy','Parent\x20ID:\x20','slice','Context\x20cleared.\x20Back\x20to\x20root.','split','36130DhDkni','type','parentName','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','segments','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Context\x20set\x20to:\x20','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Usage:\x20tdx\x20segment\x20use\x20<path>','Use:\x20tdx\x20segment\x20use\x20','description','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','log','1203594WVqURN','segment','3566136iysYZG','isAbsolute','error','20THMwGc','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Folder\x20ID:\x20','resolvePathToResource','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','name','verbose','fullPath','4708045xMWLZE','16542ffPEKZ','segment:use','Target\x20path:\x20','join','session','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','folderPath','parentId','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','segmentPath','40QiGODO','4009592XZnjOq','Site:\x20','length','Error:\x20Path\x20is\x20required'];a34_0x5ebb=function(){return _0x86c964;};return a34_0x5ebb();}function a34_0x2b43(_0x1d0dd3,_0x4e5101){const _0x5ebb38=a34_0x5ebb();return a34_0x2b43=function(_0x2b431f,_0x2658d9){_0x2b431f=_0x2b431f-0x10c;let _0x3cac67=_0x5ebb38[_0x2b431f];return _0x3cac67;},a34_0x2b43(_0x1d0dd3,_0x4e5101);}(function(_0x5ebd94,_0x579af3){const _0x12c906=a34_0x2b43,_0x398543=_0x5ebd94();while(!![]){try{const _0x30e8a8=-parseInt(_0x12c906(0x12d))/0x1*(-parseInt(_0x12c906(0x11a))/0x2)+-parseInt(_0x12c906(0x128))/0x3+parseInt(_0x12c906(0x110))/0x4+parseInt(_0x12c906(0x135))/0x5+parseInt(_0x12c906(0x12a))/0x6+-parseInt(_0x12c906(0x114))/0x7*(parseInt(_0x12c906(0x10f))/0x8)+-parseInt(_0x12c906(0x136))/0x9*(parseInt(_0x12c906(0x115))/0xa);if(_0x30e8a8===_0x579af3)break;else _0x398543['push'](_0x398543['shift']());}catch(_0x4fa3c5){_0x398543['push'](_0x398543['shift']());}}}(a34_0x5ebb,0x92c2a));import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';export class SegmentUseCommand extends BaseCommand{[a34_0x248d73(0x132)]=a34_0x248d73(0x137);[a34_0x248d73(0x125)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async['execute'](_0xc306e9){const _0x791372=a34_0x248d73,{options:_0x4d4fde,args:_0x15ae9a,tdx:_0x28a5d7}=_0xc306e9;if(_0x15ae9a[_0x791372(0x112)]===0x0)return console['error'](_0x791372(0x113)),console['error'](_0x791372(0x123)),console[_0x791372(0x12c)]('Examples:'),console[_0x791372(0x12c)](_0x791372(0x11d)),console['error'](_0x791372(0x10d)),console[_0x791372(0x12c)](_0x791372(0x122)),console[_0x791372(0x12c)](_0x791372(0x131)),0x1;const _0x3bfd19=_0x15ae9a[0x0],_0x37815d=_0x4d4fde[_0x791372(0x13a)];try{if(_0x3bfd19==='/')return saveSessionContext({'segment_path':undefined},_0x37815d),console['log'](_0x791372(0x118)),0x0;const _0x5cac69=_0x4d4fde[_0x791372(0x10e)];let _0xebd14=_0x3bfd19;const _0x370467=parsePath(_0x3bfd19);if(!_0x370467[_0x791372(0x12b)]){if(!_0x5cac69)return console['error'](_0x791372(0x13b)),console[_0x791372(0x12c)](_0x791372(0x11e)),0x1;if(_0x3bfd19==='..'){const _0x1864e8=_0x5cac69[_0x791372(0x119)]('/')[_0x791372(0x117)](0x0,-0x1)['join']('/');_0xebd14=_0x1864e8||'/';}else _0x3bfd19==='.'?_0xebd14=_0x5cac69:_0xebd14=_0x5cac69+'/'+_0x3bfd19;_0x4d4fde[_0x791372(0x133)]&&console[_0x791372(0x12c)]('Resolved\x20relative\x20path\x20to:\x20'+_0xebd14);}if(_0xebd14==='/'||_0xebd14==='')return saveSessionContext({'segment_path':undefined},_0x37815d),console[_0x791372(0x127)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;_0xebd14=normalizePath(_0xebd14);const _0x376a81=parsePath(_0xebd14)[_0x791372(0x11f)];if(_0x376a81['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x37815d),console[_0x791372(0x127)](_0x791372(0x118)),0x0;_0x4d4fde[_0x791372(0x133)]&&(console[_0x791372(0x12c)](_0x791372(0x111)+_0x4d4fde['site']),console[_0x791372(0x12c)](_0x791372(0x138)+_0xebd14));const _0x2f9c38=await withSpinner('Resolving\x20path\x20\x27'+_0xebd14+'\x27...',()=>_0x28a5d7[_0x791372(0x129)][_0x791372(0x130)](_0xebd14),{'verbose':_0x4d4fde[_0x791372(0x133)]}),_0x297d3f=_0x2f9c38['data'];_0x4d4fde[_0x791372(0x133)]&&(console[_0x791372(0x12c)]('Resolved\x20path\x20type:\x20'+_0x297d3f[_0x791372(0x11b)]),console[_0x791372(0x12c)](_0x791372(0x116)+_0x297d3f[_0x791372(0x10c)]),_0x297d3f['folderId']&&console[_0x791372(0x12c)](_0x791372(0x12f)+_0x297d3f['folderId']));if(_0x297d3f['type']===_0x791372(0x129))return console['error'](_0x791372(0x126)),console[_0x791372(0x12c)](_0x791372(0x120)),console[_0x791372(0x12c)](_0x791372(0x124)+_0x297d3f['parentName']+(_0x297d3f[_0x791372(0x13c)]?'/'+_0x297d3f[_0x791372(0x13c)][_0x791372(0x139)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x297d3f[_0x791372(0x134)],'parent_segment':_0x297d3f[_0x791372(0x11c)]},_0x37815d),console[_0x791372(0x127)](_0x791372(0x121)+_0x297d3f[_0x791372(0x134)]),_0x4d4fde['verbose']&&(console[_0x791372(0x12c)](_0x791372(0x12e)),console[_0x791372(0x12c)]('Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context'),console[_0x791372(0x12c)]('Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters')),0x0;}catch(_0xb13ebc){throw _0xb13ebc;}}}
@@ -1 +1 @@
1
- const a35_0x32993d=a35_0x7e66;(function(_0x7d2a06,_0x3f3b01){const _0xea4055=a35_0x7e66,_0x40b6d6=_0x7d2a06();while(!![]){try{const _0x373f88=-parseInt(_0xea4055(0x174))/0x1*(-parseInt(_0xea4055(0x169))/0x2)+parseInt(_0xea4055(0x183))/0x3*(-parseInt(_0xea4055(0x164))/0x4)+parseInt(_0xea4055(0x16e))/0x5*(-parseInt(_0xea4055(0x151))/0x6)+-parseInt(_0xea4055(0x176))/0x7+-parseInt(_0xea4055(0x15e))/0x8*(-parseInt(_0xea4055(0x168))/0x9)+parseInt(_0xea4055(0x171))/0xa+-parseInt(_0xea4055(0x15f))/0xb*(-parseInt(_0xea4055(0x185))/0xc);if(_0x373f88===_0x3f3b01)break;else _0x40b6d6['push'](_0x40b6d6['shift']());}catch(_0x3ad0b4){_0x40b6d6['push'](_0x40b6d6['shift']());}}}(a35_0x27c2,0x7d2b6));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{formatRows}from'../utils/formatters.js';function a35_0x27c2(){const _0x437eaf=['listUnified','jsonl','site','map','segmentPath','listRecursive','Resolving\x20context\x20path\x20\x27','39mHmymr','(empty)','131844pPohuG','\x27...','cause','\x20and\x20','\x20top-level\x20items','Parent\x20ID:\x20','resolvePathToResource','segment','data','parentId','listParents','Current\x20context:\x20','recursive','execute','✔\x20Built\x20tree\x20with\x20','18GKVPcD','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','attributes','log','filter','population','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','\x20matching\x20\x27','format','Building\x20hierarchy\x20tree...','Site:\x20','Error:\x20','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','1845912JHZAgq','143geOmOM','Path/pattern\x20arg:\x20','segments','includes','\x20parent\x20segment','100400mAnWKF','listParentsWithPattern','replace','No\x20parent\x20segments\x20match\x20pattern:\x20','18SqRbYR','4StYwvE','👥\x20','✔\x20Found\x20','sort','verbose','728135CCXbIq','error','folderId','9634220hXAMyB','length','dim','341639hIcFlf','Folder\x20ID:\x20','6825938RmDlAY','name','json','maxDepth','[parent\x20segments]','Listing\x20parent\x20segments...'];a35_0x27c2=function(){return _0x437eaf;};return a35_0x27c2();}function a35_0x7e66(_0xc6c4aa,_0x20197b){const _0x27c28c=a35_0x27c2();return a35_0x7e66=function(_0x7e661e,_0x4b96ff){_0x7e661e=_0x7e661e-0x14d;let _0x43806e=_0x27c28c[_0x7e661e];return _0x43806e;},a35_0x7e66(_0xc6c4aa,_0x20197b);}import a35_0x177d7d from'chalk';export class SegmentsCommand extends BaseCommand{[a35_0x32993d(0x177)]=a35_0x32993d(0x161);['description']=a35_0x32993d(0x157);async[a35_0x32993d(0x14f)](_0x5e50ac){const _0x4f899e=a35_0x32993d,{options:_0x1b89ba,args:_0xf62aea}=_0x5e50ac,_0x58f63b=_0x1b89ba[_0x4f899e(0x14e)],_0x5a3d0e=_0xf62aea[0x0];try{const _0x12b15e=_0x1b89ba[_0x4f899e(0x180)];_0x1b89ba[_0x4f899e(0x16d)]&&(console[_0x4f899e(0x16f)](_0x4f899e(0x15b)+_0x1b89ba[_0x4f899e(0x17e)]),console[_0x4f899e(0x16f)](_0x4f899e(0x14d)+(_0x12b15e||'/')),_0x5a3d0e&&console[_0x4f899e(0x16f)](_0x4f899e(0x160)+_0x5a3d0e),_0x58f63b&&console[_0x4f899e(0x16f)]('Recursive\x20mode:\x20enabled'));if(_0x5a3d0e){const _0x5669e6=_0x5a3d0e[_0x4f899e(0x162)]('*')||_0x5a3d0e['includes']('?');if(_0x5669e6&&!_0x12b15e)return await this[_0x4f899e(0x165)](_0x5e50ac,_0x5a3d0e);else return _0x5669e6?(console[_0x4f899e(0x16f)](_0x4f899e(0x152)),console['error'](_0x4f899e(0x15d)),0x1):_0x58f63b?await this[_0x4f899e(0x181)](_0x5e50ac,_0x5a3d0e):await this[_0x4f899e(0x17c)](_0x5e50ac,_0x5a3d0e);}if(!_0x12b15e)return await this[_0x4f899e(0x18f)](_0x5e50ac);return _0x58f63b?await this[_0x4f899e(0x181)](_0x5e50ac,_0x12b15e):await this['listUnified'](_0x5e50ac,_0x12b15e);}catch(_0x54c154){if(_0x54c154 instanceof SDKError)return console['error'](_0x4f899e(0x15c)+_0x54c154['message']),_0x54c154[_0x4f899e(0x187)]&&console['error']('\x20\x20Cause:\x20'+_0x54c154['cause']),0x1;throw _0x54c154;}}async['listParentsWithPattern'](_0x1ef31d,_0x162f71){const _0x1394af=a35_0x32993d,{options:_0x7896a4,tdx:_0x176873}=_0x1ef31d,_0x545a28=await withSpinner('Listing\x20parent\x20segments\x20matching\x20\x27'+_0x162f71+_0x1394af(0x186),()=>_0x176873[_0x1394af(0x18c)][_0x1394af(0x18f)](),{'verbose':_0x7896a4[_0x1394af(0x16d)]}),_0x60ef03=_0x545a28[_0x1394af(0x18d)],_0x1df808=_0x162f71[_0x1394af(0x166)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x1394af(0x166)](/\*/g,'.*')[_0x1394af(0x166)](/\?/g,'.'),_0x47d18e=new RegExp('^'+_0x1df808+'$','i'),_0x5a5534=_0x60ef03[_0x1394af(0x155)](_0x15d79d=>_0x47d18e['test'](_0x15d79d['attributes']['name']));console[_0x1394af(0x16f)](_0x1394af(0x16b)+_0x5a5534[_0x1394af(0x172)]+_0x1394af(0x163)+(_0x5a5534[_0x1394af(0x172)]!==0x1?'s':'')+_0x1394af(0x158)+_0x162f71+'\x27');if(_0x7896a4[_0x1394af(0x159)]===_0x1394af(0x178)||_0x7896a4[_0x1394af(0x159)]===_0x1394af(0x17d))await handleSDKOutput(_0x5a5534,_0x7896a4);else{if(_0x5a5534[_0x1394af(0x172)]===0x0)console['log'](_0x1394af(0x167)+_0x162f71);else{console[_0x1394af(0x154)]('[parent\x20segments]');for(const _0x1d2a65 of _0x5a5534){const _0x217e00=_0x1d2a65['attributes']['population']?a35_0x177d7d['dim']('\x20('+formatRows(_0x1d2a65['attributes'][_0x1394af(0x156)])+')'):'';console[_0x1394af(0x154)](_0x1394af(0x16a)+_0x1d2a65[_0x1394af(0x153)][_0x1394af(0x177)]+_0x217e00);}}}return 0x0;}async[a35_0x32993d(0x18f)](_0x106c4c){const _0x4c20a8=a35_0x32993d,{options:_0x20e4f3,tdx:_0x533952}=_0x106c4c,_0x2152c4=await withSpinner(_0x4c20a8(0x17b),()=>_0x533952[_0x4c20a8(0x18c)][_0x4c20a8(0x18f)](),{'verbose':_0x20e4f3[_0x4c20a8(0x16d)]}),_0x12cf48=_0x2152c4[_0x4c20a8(0x18d)];console[_0x4c20a8(0x16f)](_0x4c20a8(0x16b)+_0x12cf48[_0x4c20a8(0x172)]+_0x4c20a8(0x163)+(_0x12cf48[_0x4c20a8(0x172)]!==0x1?'s':''));if(_0x20e4f3[_0x4c20a8(0x159)]===_0x4c20a8(0x178)||_0x20e4f3[_0x4c20a8(0x159)]==='jsonl')await handleSDKOutput(_0x12cf48,_0x20e4f3);else{console[_0x4c20a8(0x154)](_0x4c20a8(0x17a));for(const _0x2a718f of _0x12cf48){const _0xf53ce=_0x2a718f[_0x4c20a8(0x153)][_0x4c20a8(0x156)]?a35_0x177d7d[_0x4c20a8(0x173)]('\x20('+formatRows(_0x2a718f[_0x4c20a8(0x153)]['population'])+')'):'';console[_0x4c20a8(0x154)](_0x4c20a8(0x16a)+_0x2a718f[_0x4c20a8(0x153)][_0x4c20a8(0x177)]+_0xf53ce);}}return 0x0;}async[a35_0x32993d(0x17c)](_0x71e6aa,_0x5187ec){const _0xe24ed1=a35_0x32993d,{options:_0x5e3dd8,tdx:_0x461be5}=_0x71e6aa,_0x2f120c=await withSpinner(_0xe24ed1(0x182)+_0x5187ec+_0xe24ed1(0x186),()=>_0x461be5[_0xe24ed1(0x18c)][_0xe24ed1(0x18b)](_0x5187ec),{'verbose':_0x5e3dd8[_0xe24ed1(0x16d)]}),_0x30e807=_0x2f120c['data'];_0x5e3dd8[_0xe24ed1(0x16d)]&&(console['error'](_0xe24ed1(0x18a)+_0x30e807[_0xe24ed1(0x18e)]),_0x30e807[_0xe24ed1(0x170)]&&console['error'](_0xe24ed1(0x175)+_0x30e807[_0xe24ed1(0x170)]));const _0x5717b6=await withSpinner('Listing\x20folders\x20and\x20segments...',()=>_0x461be5[_0xe24ed1(0x18c)][_0xe24ed1(0x17c)](_0x30e807[_0xe24ed1(0x18e)],_0x30e807['folderId']),{'verbose':_0x5e3dd8['verbose']}),{folders:_0xf839ec,segments:_0x5688de}=_0x5717b6[_0xe24ed1(0x18d)],_0x3187fe=_0xf839ec[_0xe24ed1(0x172)]+_0x5688de[_0xe24ed1(0x172)];console['error'](_0xe24ed1(0x16b)+_0xf839ec['length']+'\x20folder'+(_0xf839ec[_0xe24ed1(0x172)]!==0x1?'s':'')+_0xe24ed1(0x188)+_0x5688de[_0xe24ed1(0x172)]+'\x20segment'+(_0x5688de['length']!==0x1?'s':''));if(_0x5e3dd8[_0xe24ed1(0x159)]===_0xe24ed1(0x178)||_0x5e3dd8[_0xe24ed1(0x159)]===_0xe24ed1(0x17d)){const _0x35f2ec=[..._0xf839ec[_0xe24ed1(0x17f)](_0x2e14cc=>({..._0x2e14cc,'type':'folder'})),..._0x5688de['map'](_0x3c66ef=>({..._0x3c66ef,'type':'segment'}))][_0xe24ed1(0x16c)]((_0x539666,_0x2b6bd8)=>_0x539666['name']['localeCompare'](_0x2b6bd8['name']));await handleSDKOutput(_0x35f2ec,_0x5e3dd8);}else{if(_0x3187fe===0x0)console['log'](a35_0x177d7d[_0xe24ed1(0x173)]('[/'+_0x5187ec+']')),console[_0xe24ed1(0x154)](_0xe24ed1(0x184));else{console[_0xe24ed1(0x154)](a35_0x177d7d[_0xe24ed1(0x173)]('[/'+_0x5187ec+']'));const _0x3295fe=formatFlatList(_0xf839ec,_0x5688de,{'showMetadata':!![]});console[_0xe24ed1(0x154)](_0x3295fe);}}return 0x0;}async[a35_0x32993d(0x181)](_0x5c1511,_0x200577){const _0x533414=a35_0x32993d,{options:_0x21a26c,tdx:_0x4a7681}=_0x5c1511,_0x5e46e7=await withSpinner(_0x533414(0x182)+_0x200577+_0x533414(0x186),()=>_0x4a7681[_0x533414(0x18c)][_0x533414(0x18b)](_0x200577),{'verbose':_0x21a26c[_0x533414(0x16d)]}),_0x536ae7=_0x5e46e7[_0x533414(0x18d)];_0x21a26c[_0x533414(0x16d)]&&(console[_0x533414(0x16f)](_0x533414(0x18a)+_0x536ae7[_0x533414(0x18e)]),_0x536ae7[_0x533414(0x170)]&&console[_0x533414(0x16f)](_0x533414(0x175)+_0x536ae7[_0x533414(0x170)]));const _0x3dd628=_0x21a26c[_0x533414(0x179)]||0xa,_0x174fce=await withSpinner(_0x533414(0x15a),()=>_0x4a7681['segment']['listRecursive'](_0x536ae7['parentId'],_0x536ae7[_0x533414(0x170)],0x0,_0x3dd628),{'verbose':_0x21a26c[_0x533414(0x16d)]}),_0x5152bd=_0x174fce[_0x533414(0x18d)];console[_0x533414(0x16f)](_0x533414(0x150)+_0x5152bd[_0x533414(0x172)]+_0x533414(0x189));if(_0x21a26c[_0x533414(0x159)]===_0x533414(0x178)||_0x21a26c[_0x533414(0x159)]===_0x533414(0x17d))await handleSDKOutput(_0x5152bd,_0x21a26c);else{console[_0x533414(0x154)](a35_0x177d7d[_0x533414(0x173)]('[/'+_0x200577+']'));const _0x2fdf78=formatTree(_0x5152bd,{'showMetadata':!![]});console[_0x533414(0x154)](_0x2fdf78);}return 0x0;}}
1
+ const a35_0x3e2f03=a35_0x1431;(function(_0x3034e9,_0x1bd188){const _0x4d4997=a35_0x1431,_0x1f85e7=_0x3034e9();while(!![]){try{const _0x29c6a1=parseInt(_0x4d4997(0x196))/0x1*(parseInt(_0x4d4997(0x198))/0x2)+parseInt(_0x4d4997(0x194))/0x3+-parseInt(_0x4d4997(0x1a3))/0x4+parseInt(_0x4d4997(0x1a5))/0x5+parseInt(_0x4d4997(0x192))/0x6*(parseInt(_0x4d4997(0x1a1))/0x7)+-parseInt(_0x4d4997(0x1a6))/0x8*(-parseInt(_0x4d4997(0x1cb))/0x9)+parseInt(_0x4d4997(0x1cd))/0xa*(-parseInt(_0x4d4997(0x1a9))/0xb);if(_0x29c6a1===_0x1bd188)break;else _0x1f85e7['push'](_0x1f85e7['shift']());}catch(_0x6fb4b){_0x1f85e7['push'](_0x1f85e7['shift']());}}}(a35_0x3dce,0x62048));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a35_0x1431(_0x1b6c95,_0x5c260b){const _0x3dce59=a35_0x3dce();return a35_0x1431=function(_0x143131,_0x1b313e){_0x143131=_0x143131-0x18e;let _0x18bb5d=_0x3dce59[_0x143131];return _0x18bb5d;},a35_0x1431(_0x1b6c95,_0x5c260b);}function a35_0x3dce(){const _0x1d7d7e=['7PcWQwv','\x20folder','2608320Btmvhe','map','1299495IJDFbu','6360nsFneP','Parent\x20ID:\x20','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','33bvUfUI','population','✔\x20Found\x20','Listing\x20parent\x20segments...','\x20matching\x20\x27','jsonl','\x27...','format','length','error','recursive','sort','listParentsWithPattern','resolvePathToResource','Folder\x20ID:\x20','localeCompare','dim','Error:\x20','data','name','includes','Listing\x20folders\x20and\x20segments...','[parent\x20segments]','Resolving\x20context\x20path\x20\x27','👥\x20','\x20\x20Cause:\x20','Building\x20hierarchy\x20tree...','listRecursive','folder','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','(empty)','listUnified','Recursive\x20mode:\x20enabled','cause','2466KNTDFA','test','3412770VqeHOu','log','filter','Current\x20context:\x20','execute','listParents','4002756DeXHfX','Path/pattern\x20arg:\x20','1153983AlFcuC','\x20parent\x20segment','547875CwguQJ','site','2ceuutm','attributes','replace','parentId','verbose','segment','folderId','Listing\x20parent\x20segments\x20matching\x20\x27','json'];a35_0x3dce=function(){return _0x1d7d7e;};return a35_0x3dce();}import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{formatRows}from'../utils/formatters.js';import a35_0x348837 from'chalk';export class SegmentsCommand extends BaseCommand{['name']='segments';['description']='List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments';async[a35_0x3e2f03(0x190)](_0xd6fc57){const _0x1bf110=a35_0x3e2f03,{options:_0x37778f,args:_0x224e74}=_0xd6fc57,_0x4d117d=_0x37778f[_0x1bf110(0x1b3)],_0x355bad=_0x224e74[0x0];try{const _0x319b2c=_0x37778f['segmentPath'];_0x37778f[_0x1bf110(0x19c)]&&(console[_0x1bf110(0x1b2)]('Site:\x20'+_0x37778f[_0x1bf110(0x197)]),console['error'](_0x1bf110(0x18f)+(_0x319b2c||'/')),_0x355bad&&console[_0x1bf110(0x1b2)](_0x1bf110(0x193)+_0x355bad),_0x4d117d&&console['error'](_0x1bf110(0x1c9)));if(_0x355bad){const _0x3afc13=_0x355bad['includes']('*')||_0x355bad[_0x1bf110(0x1bd)]('?');if(_0x3afc13&&!_0x319b2c)return await this[_0x1bf110(0x1b5)](_0xd6fc57,_0x355bad);else return _0x3afc13?(console[_0x1bf110(0x1b2)](_0x1bf110(0x1a8)),console[_0x1bf110(0x1b2)](_0x1bf110(0x1c6)),0x1):_0x4d117d?await this[_0x1bf110(0x1c4)](_0xd6fc57,_0x355bad):await this['listUnified'](_0xd6fc57,_0x355bad);}if(!_0x319b2c)return await this[_0x1bf110(0x191)](_0xd6fc57);return _0x4d117d?await this[_0x1bf110(0x1c4)](_0xd6fc57,_0x319b2c):await this[_0x1bf110(0x1c8)](_0xd6fc57,_0x319b2c);}catch(_0x216d30){if(_0x216d30 instanceof SDKError)return console[_0x1bf110(0x1b2)](_0x1bf110(0x1ba)+_0x216d30['message']),_0x216d30[_0x1bf110(0x1ca)]&&console[_0x1bf110(0x1b2)](_0x1bf110(0x1c2)+_0x216d30[_0x1bf110(0x1ca)]),0x1;throw _0x216d30;}}async['listParentsWithPattern'](_0x3df1f7,_0x401f3f){const _0x36fb0e=a35_0x3e2f03,{options:_0x446146,tdx:_0x3caed8}=_0x3df1f7,_0xc25f02=await withSpinner(_0x36fb0e(0x19f)+_0x401f3f+'\x27...',()=>_0x3caed8[_0x36fb0e(0x19d)][_0x36fb0e(0x191)](),{'verbose':_0x446146[_0x36fb0e(0x19c)]}),_0x231d58=_0xc25f02[_0x36fb0e(0x1bb)],_0xd24145=_0x401f3f['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')[_0x36fb0e(0x19a)](/\?/g,'.'),_0x46d272=new RegExp('^'+_0xd24145+'$','i'),_0x784e5b=_0x231d58[_0x36fb0e(0x18e)](_0xddb1e4=>_0x46d272[_0x36fb0e(0x1cc)](_0xddb1e4[_0x36fb0e(0x199)][_0x36fb0e(0x1bc)]));console[_0x36fb0e(0x1b2)](_0x36fb0e(0x1ab)+_0x784e5b[_0x36fb0e(0x1b1)]+_0x36fb0e(0x195)+(_0x784e5b[_0x36fb0e(0x1b1)]!==0x1?'s':'')+_0x36fb0e(0x1ad)+_0x401f3f+'\x27');if(_0x446146[_0x36fb0e(0x1b0)]===_0x36fb0e(0x1a0)||_0x446146[_0x36fb0e(0x1b0)]===_0x36fb0e(0x1ae))await handleSDKOutput(_0x784e5b,_0x446146);else{if(_0x784e5b[_0x36fb0e(0x1b1)]===0x0)console[_0x36fb0e(0x1ce)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x401f3f);else{console['log'](_0x36fb0e(0x1bf));for(const _0x45ae1a of _0x784e5b){const _0x50ae67=_0x45ae1a['attributes'][_0x36fb0e(0x1aa)]?a35_0x348837[_0x36fb0e(0x1b9)]('\x20('+formatRows(_0x45ae1a[_0x36fb0e(0x199)][_0x36fb0e(0x1aa)])+')'):'';console[_0x36fb0e(0x1ce)](_0x36fb0e(0x1c1)+_0x45ae1a[_0x36fb0e(0x199)][_0x36fb0e(0x1bc)]+_0x50ae67);}}}return 0x0;}async[a35_0x3e2f03(0x191)](_0x30f432){const _0x80e441=a35_0x3e2f03,{options:_0x18e455,tdx:_0x49548f}=_0x30f432,_0x1b1f76=await withSpinner(_0x80e441(0x1ac),()=>_0x49548f['segment'][_0x80e441(0x191)](),{'verbose':_0x18e455[_0x80e441(0x19c)]}),_0x16ac2a=_0x1b1f76[_0x80e441(0x1bb)];console['error'](_0x80e441(0x1ab)+_0x16ac2a['length']+_0x80e441(0x195)+(_0x16ac2a[_0x80e441(0x1b1)]!==0x1?'s':''));if(_0x18e455[_0x80e441(0x1b0)]===_0x80e441(0x1a0)||_0x18e455[_0x80e441(0x1b0)]===_0x80e441(0x1ae))await handleSDKOutput(_0x16ac2a,_0x18e455);else{console['log'](_0x80e441(0x1bf));for(const _0x43972c of _0x16ac2a){const _0x47ac17=_0x43972c['attributes'][_0x80e441(0x1aa)]?a35_0x348837[_0x80e441(0x1b9)]('\x20('+formatRows(_0x43972c[_0x80e441(0x199)][_0x80e441(0x1aa)])+')'):'';console['log'](_0x80e441(0x1c1)+_0x43972c[_0x80e441(0x199)][_0x80e441(0x1bc)]+_0x47ac17);}}return 0x0;}async[a35_0x3e2f03(0x1c8)](_0x591190,_0x5b139d){const _0x136410=a35_0x3e2f03,{options:_0x298eb2,tdx:_0x317cf8}=_0x591190,_0x356612=await withSpinner('Resolving\x20context\x20path\x20\x27'+_0x5b139d+_0x136410(0x1af),()=>_0x317cf8['segment'][_0x136410(0x1b6)](_0x5b139d),{'verbose':_0x298eb2['verbose']}),_0x340740=_0x356612[_0x136410(0x1bb)];_0x298eb2[_0x136410(0x19c)]&&(console[_0x136410(0x1b2)]('Parent\x20ID:\x20'+_0x340740[_0x136410(0x19b)]),_0x340740[_0x136410(0x19e)]&&console[_0x136410(0x1b2)](_0x136410(0x1b7)+_0x340740[_0x136410(0x19e)]));const _0x4923d0=await withSpinner(_0x136410(0x1be),()=>_0x317cf8[_0x136410(0x19d)]['listUnified'](_0x340740[_0x136410(0x19b)],_0x340740[_0x136410(0x19e)]),{'verbose':_0x298eb2[_0x136410(0x19c)]}),{folders:_0xef5518,segments:_0x4f1478}=_0x4923d0[_0x136410(0x1bb)],_0x46bd44=_0xef5518[_0x136410(0x1b1)]+_0x4f1478[_0x136410(0x1b1)];console[_0x136410(0x1b2)](_0x136410(0x1ab)+_0xef5518[_0x136410(0x1b1)]+_0x136410(0x1a2)+(_0xef5518['length']!==0x1?'s':'')+'\x20and\x20'+_0x4f1478['length']+'\x20segment'+(_0x4f1478[_0x136410(0x1b1)]!==0x1?'s':''));if(_0x298eb2[_0x136410(0x1b0)]==='json'||_0x298eb2['format']===_0x136410(0x1ae)){const _0x4cdbb5=[..._0xef5518['map'](_0x316f09=>({..._0x316f09,'type':_0x136410(0x1c5)})),..._0x4f1478[_0x136410(0x1a4)](_0x317db1=>({..._0x317db1,'type':_0x136410(0x19d)}))][_0x136410(0x1b4)]((_0x43107f,_0x3e78fc)=>_0x43107f['name'][_0x136410(0x1b8)](_0x3e78fc[_0x136410(0x1bc)]));await handleSDKOutput(_0x4cdbb5,_0x298eb2);}else{if(_0x46bd44===0x0)console[_0x136410(0x1ce)](a35_0x348837[_0x136410(0x1b9)]('[/'+_0x5b139d+']')),console[_0x136410(0x1ce)](_0x136410(0x1c7));else{console['log'](a35_0x348837[_0x136410(0x1b9)]('[/'+_0x5b139d+']'));const _0x4bc453=formatFlatList(_0xef5518,_0x4f1478,{'showMetadata':!![]});console[_0x136410(0x1ce)](_0x4bc453);}}return 0x0;}async['listRecursive'](_0x40d80d,_0x465048){const _0x4adfc6=a35_0x3e2f03,{options:_0x5def86,tdx:_0x49c364}=_0x40d80d,_0x20ee31=await withSpinner(_0x4adfc6(0x1c0)+_0x465048+_0x4adfc6(0x1af),()=>_0x49c364[_0x4adfc6(0x19d)][_0x4adfc6(0x1b6)](_0x465048),{'verbose':_0x5def86['verbose']}),_0x74f388=_0x20ee31[_0x4adfc6(0x1bb)];_0x5def86[_0x4adfc6(0x19c)]&&(console[_0x4adfc6(0x1b2)](_0x4adfc6(0x1a7)+_0x74f388[_0x4adfc6(0x19b)]),_0x74f388['folderId']&&console[_0x4adfc6(0x1b2)](_0x4adfc6(0x1b7)+_0x74f388[_0x4adfc6(0x19e)]));const _0x519ca1=_0x5def86['maxDepth']||0xa,_0x2d8a9a=await withSpinner(_0x4adfc6(0x1c3),()=>_0x49c364[_0x4adfc6(0x19d)][_0x4adfc6(0x1c4)](_0x74f388[_0x4adfc6(0x19b)],_0x74f388[_0x4adfc6(0x19e)],0x0,_0x519ca1),{'verbose':_0x5def86[_0x4adfc6(0x19c)]}),_0x6bdeb3=_0x2d8a9a['data'];console[_0x4adfc6(0x1b2)]('✔\x20Built\x20tree\x20with\x20'+_0x6bdeb3[_0x4adfc6(0x1b1)]+'\x20top-level\x20items');if(_0x5def86[_0x4adfc6(0x1b0)]==='json'||_0x5def86[_0x4adfc6(0x1b0)]===_0x4adfc6(0x1ae))await handleSDKOutput(_0x6bdeb3,_0x5def86);else{console[_0x4adfc6(0x1ce)](a35_0x348837[_0x4adfc6(0x1b9)]('[/'+_0x465048+']'));const _0x5a1ff3=formatTree(_0x6bdeb3,{'showMetadata':!![]});console[_0x4adfc6(0x1ce)](_0x5a1ff3);}return 0x0;}}
@@ -1 +1 @@
1
- const a36_0x22348f=a36_0x5eec;(function(_0x807d88,_0x55d08a){const _0x37bee6=a36_0x5eec,_0x573c9b=_0x807d88();while(!![]){try{const _0x54551e=parseInt(_0x37bee6(0xb7))/0x1*(-parseInt(_0x37bee6(0xb2))/0x2)+-parseInt(_0x37bee6(0xbd))/0x3*(-parseInt(_0x37bee6(0xaa))/0x4)+-parseInt(_0x37bee6(0xc0))/0x5+parseInt(_0x37bee6(0xa5))/0x6*(-parseInt(_0x37bee6(0x9c))/0x7)+-parseInt(_0x37bee6(0xb8))/0x8*(-parseInt(_0x37bee6(0xad))/0x9)+parseInt(_0x37bee6(0xb9))/0xa*(-parseInt(_0x37bee6(0xae))/0xb)+parseInt(_0x37bee6(0xa8))/0xc;if(_0x54551e===_0x55d08a)break;else _0x573c9b['push'](_0x573c9b['shift']());}catch(_0x742f44){_0x573c9b['push'](_0x573c9b['shift']());}}}(a36_0x1755,0xaade3));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';function a36_0x5eec(_0x2f799c,_0xba3236){const _0x17551c=a36_0x1755();return a36_0x5eec=function(_0x5eec80,_0x4f79a1){_0x5eec80=_0x5eec80-0x9c;let _0x25ea3b=_0x17551c[_0x5eec80];return _0x25ea3b;},a36_0x5eec(_0x2f799c,_0xba3236);}export class ShowCommand extends BaseCommand{[a36_0x22348f(0x9d)]='show';[a36_0x22348f(0xb0)]='Show\x20table\x20contents';async[a36_0x22348f(0xab)](_0x4712ac){return this['showTable'](_0x4712ac);}async[a36_0x22348f(0xbb)](_0x2cf150){const _0x3618f6=a36_0x22348f,{options:_0x5f26b4,args:_0x49b477,tdx:_0x39e1b4}=_0x2cf150;let _0x1b1ddd;try{_0x1b1ddd=parseTableReference(_0x49b477[0x0]);const _0x3e2b2e=_0x5f26b4[_0x3618f6(0xaf)];!_0x1b1ddd[_0x3618f6(0xaf)]&&_0x3e2b2e&&(_0x1b1ddd[_0x3618f6(0xaf)]=_0x3e2b2e);const _0x106b66=validateTableDescribeReference(_0x1b1ddd);if(_0x106b66)return console[_0x3618f6(0xb1)]('Error:\x20'+_0x106b66),console[_0x3618f6(0xb1)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x3618f6(0xb1)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x3618f6(0xb1)](_0x3618f6(0xc2)),0x1;}catch(_0x1c10a9){return console['error']('Error:\x20'+_0x1c10a9[_0x3618f6(0xa0)]),console[_0x3618f6(0xb1)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x3618f6(0xb1)](_0x3618f6(0xba)),console[_0x3618f6(0xb1)](_0x3618f6(0xc2)),0x1;}const _0x2d029d=_0x1b1ddd[_0x3618f6(0xb6)],_0x5ed551=_0x1b1ddd[_0x3618f6(0xaf)],_0x498db2=_0x1b1ddd[_0x3618f6(0xc5)],_0x58a128=resolveLimit(_0x5f26b4[_0x3618f6(0xbc)],DEFAULT_DISPLAY_LIMIT);try{_0x5f26b4[_0x3618f6(0xbe)]&&(console['error'](_0x3618f6(0xa6)+_0x5f26b4['site']),_0x2d029d&&console['error'](_0x3618f6(0xc4)+_0x2d029d),console[_0x3618f6(0xb1)](_0x3618f6(0xc3)+_0x5ed551),console[_0x3618f6(0xb1)](_0x3618f6(0xa7)+_0x498db2),console[_0x3618f6(0xb1)](_0x3618f6(0xa4)+_0x58a128));const _0x2c77ee=_0x2d029d?_0x2d029d+'.'+_0x5ed551+'.'+_0x498db2:_0x5ed551+'.'+_0x498db2,_0x363769=await withSpinner(_0x3618f6(0xb3)+_0x2c77ee+_0x3618f6(0xa9),()=>_0x39e1b4[_0x3618f6(0xbf)]['showTable'](_0x5ed551,_0x498db2,_0x58a128,_0x2d029d),{'verbose':_0x5f26b4[_0x3618f6(0xbe)]}),_0x494754=_0x363769[_0x3618f6(0xa3)],_0x1d6428=_0x494754[_0x3618f6(0xa3)];return _0x1d6428['length']===0x0?console[_0x3618f6(0xb1)](_0x3618f6(0xa2)):console[_0x3618f6(0xb1)]('✔\x20Retrieved\x20'+_0x1d6428[_0x3618f6(0xa1)]+_0x3618f6(0x9f)+(_0x1d6428[_0x3618f6(0xa1)]!==0x1?'s':'')+_0x3618f6(0xc1)+_0x2c77ee),await handleSDKOutput(_0x1d6428,_0x5f26b4),0x0;}catch(_0xc64910){if(_0xc64910 instanceof SDKError)return console['error'](_0x3618f6(0xac)+_0xc64910[_0x3618f6(0xa0)]),_0xc64910['cause']&&console['error'](_0x3618f6(0xb4)+_0xc64910[_0x3618f6(0x9e)]),0x1;throw _0xc64910;}}[a36_0x22348f(0xb5)](_0x37fb39){const _0x55a602=a36_0x22348f;if(_0x37fb39['args'][_0x55a602(0xa1)]===0x0)return'Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';if(_0x37fb39['args'][_0x55a602(0xa1)]>0x1)return'Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';return undefined;}}function a36_0x1755(){const _0x461744=['data','Limit:\x20','1692294sQFtYa','Site:\x20','Table:\x20','28027296cyjIMi','...','523652QOmoVM','execute','Error:\x20','9wXvUDz','308MiYEJj','database','description','error','656364vvEVMg','Querying\x20','\x20\x20Cause:\x20','validate','catalog','1kTVHzZ','2367416daOmYu','462250EnRgyy','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','showTable','limit','3OrIZtm','verbose','query','790210QJHilE','\x20from\x20','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','Database:\x20','Catalog:\x20','table','7GlgFUy','name','cause','\x20row','message','length','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'];a36_0x1755=function(){return _0x461744;};return a36_0x1755();}
1
+ const a36_0x442f59=a36_0x24a8;(function(_0x91a2e2,_0x56b0f1){const _0x689cdd=a36_0x24a8,_0x476f63=_0x91a2e2();while(!![]){try{const _0x1fa2d6=-parseInt(_0x689cdd(0xa4))/0x1*(parseInt(_0x689cdd(0x8f))/0x2)+-parseInt(_0x689cdd(0x8d))/0x3*(parseInt(_0x689cdd(0x99))/0x4)+parseInt(_0x689cdd(0xab))/0x5+-parseInt(_0x689cdd(0x94))/0x6+parseInt(_0x689cdd(0xaa))/0x7*(parseInt(_0x689cdd(0xa1))/0x8)+parseInt(_0x689cdd(0x92))/0x9+parseInt(_0x689cdd(0x90))/0xa;if(_0x1fa2d6===_0x56b0f1)break;else _0x476f63['push'](_0x476f63['shift']());}catch(_0x3340ba){_0x476f63['push'](_0x476f63['shift']());}}}(a36_0x3575,0x7ccd2));function a36_0x3575(){const _0x21a90d=['1734YvTgCY','verbose','346NDclLr','6023760HqyyZh','database','5039937IYpQZx','Usage:\x20tdx\x20show\x20<database.table>','5738400PVFgxJ','error','Querying\x20','table','validate','1844TalrND','length','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','Table:\x20','show','catalog','Database:\x20','1048YGZXnJ','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','Limit:\x20','2591vWSGuz','cause','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','\x20\x20Cause:\x20','args','Catalog:\x20','8141ciXUuZ','4337825fkqzEl','Show\x20table\x20contents','showTable','query','data','Error:\x20','message','execute','site'];a36_0x3575=function(){return _0x21a90d;};return a36_0x3575();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a36_0x24a8(_0x7561ea,_0x48c467){const _0x3575b9=a36_0x3575();return a36_0x24a8=function(_0x24a8a3,_0x5ab2f0){_0x24a8a3=_0x24a8a3-0x8d;let _0x33d951=_0x3575b9[_0x24a8a3];return _0x33d951;},a36_0x24a8(_0x7561ea,_0x48c467);}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_0x442f59(0x9e);['description']=a36_0x442f59(0xac);async[a36_0x442f59(0xb2)](_0x15b7f3){const _0x20920f=a36_0x442f59;return this[_0x20920f(0xad)](_0x15b7f3);}async['showTable'](_0x470d08){const _0x575899=a36_0x442f59,{options:_0x4e031d,args:_0x309a5f,tdx:_0xc2430b}=_0x470d08;let _0x42cdf9;try{_0x42cdf9=parseTableReference(_0x309a5f[0x0]);const _0xc1e0d9=_0x4e031d[_0x575899(0x91)];!_0x42cdf9['database']&&_0xc1e0d9&&(_0x42cdf9['database']=_0xc1e0d9);const _0x3ffa81=validateTableDescribeReference(_0x42cdf9);if(_0x3ffa81)return console[_0x575899(0x95)](_0x575899(0xb0)+_0x3ffa81),console[_0x575899(0x95)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x575899(0x95)](_0x575899(0xa6)),console['error'](_0x575899(0x9c)),0x1;}catch(_0x4d99b3){return console[_0x575899(0x95)](_0x575899(0xb0)+_0x4d99b3[_0x575899(0xb1)]),console[_0x575899(0x95)](_0x575899(0x93)),console[_0x575899(0x95)](_0x575899(0xa6)),console[_0x575899(0x95)](_0x575899(0x9c)),0x1;}const _0x352ba5=_0x42cdf9[_0x575899(0x9f)],_0x2888d2=_0x42cdf9[_0x575899(0x91)],_0x385f11=_0x42cdf9[_0x575899(0x97)],_0x309266=resolveLimit(_0x4e031d['limit'],DEFAULT_DISPLAY_LIMIT);try{_0x4e031d[_0x575899(0x8e)]&&(console['error']('Site:\x20'+_0x4e031d[_0x575899(0xb3)]),_0x352ba5&&console['error'](_0x575899(0xa9)+_0x352ba5),console[_0x575899(0x95)](_0x575899(0xa0)+_0x2888d2),console[_0x575899(0x95)](_0x575899(0x9d)+_0x385f11),console['error'](_0x575899(0xa3)+_0x309266));const _0x4eeb08=_0x352ba5?_0x352ba5+'.'+_0x2888d2+'.'+_0x385f11:_0x2888d2+'.'+_0x385f11,_0x1f3e3e=await withSpinner(_0x575899(0x96)+_0x4eeb08+'...',()=>_0xc2430b[_0x575899(0xae)][_0x575899(0xad)](_0x2888d2,_0x385f11,_0x309266,_0x352ba5),{'verbose':_0x4e031d[_0x575899(0x8e)]}),_0x1facac=_0x1f3e3e[_0x575899(0xaf)],_0x128fbd=_0x1facac[_0x575899(0xaf)];return _0x128fbd[_0x575899(0x9a)]===0x0?console[_0x575899(0x95)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x575899(0x95)]('✔\x20Retrieved\x20'+_0x128fbd[_0x575899(0x9a)]+'\x20row'+(_0x128fbd[_0x575899(0x9a)]!==0x1?'s':'')+'\x20from\x20'+_0x4eeb08),await handleSDKOutput(_0x128fbd,_0x4e031d),0x0;}catch(_0x337053){if(_0x337053 instanceof SDKError)return console[_0x575899(0x95)](_0x575899(0xb0)+_0x337053['message']),_0x337053[_0x575899(0xa5)]&&console['error'](_0x575899(0xa7)+_0x337053[_0x575899(0xa5)]),0x1;throw _0x337053;}}[a36_0x442f59(0x98)](_0x295072){const _0x2022c0=a36_0x442f59;if(_0x295072[_0x2022c0(0xa8)][_0x2022c0(0x9a)]===0x0)return _0x2022c0(0x9b);if(_0x295072['args'][_0x2022c0(0x9a)]>0x1)return _0x2022c0(0xa2);return undefined;}}
@@ -1 +1 @@
1
- const a37_0x1b7a4e=a37_0x9d9c;(function(_0x195012,_0x298875){const _0x40dbbc=a37_0x9d9c,_0x20558b=_0x195012();while(!![]){try{const _0x1cf3b0=parseInt(_0x40dbbc(0x1b0))/0x1*(parseInt(_0x40dbbc(0x189))/0x2)+parseInt(_0x40dbbc(0x19d))/0x3+-parseInt(_0x40dbbc(0x1aa))/0x4*(-parseInt(_0x40dbbc(0x19c))/0x5)+parseInt(_0x40dbbc(0x1a3))/0x6*(parseInt(_0x40dbbc(0x19e))/0x7)+-parseInt(_0x40dbbc(0x193))/0x8+-parseInt(_0x40dbbc(0x190))/0x9*(parseInt(_0x40dbbc(0x194))/0xa)+parseInt(_0x40dbbc(0x1a0))/0xb*(parseInt(_0x40dbbc(0x18b))/0xc);if(_0x1cf3b0===_0x298875)break;else _0x20558b['push'](_0x20558b['shift']());}catch(_0x251510){_0x20558b['push'](_0x20558b['shift']());}}}(a37_0x3123,0x770d4));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a37_0x9d9c(_0x165480,_0x1d4070){const _0x3123d5=a37_0x3123();return a37_0x9d9c=function(_0x9d9c91,_0x1ab92c){_0x9d9c91=_0x9d9c91-0x186;let _0x335358=_0x3123d5[_0x9d9c91];return _0x335358;},a37_0x9d9c(_0x165480,_0x1d4070);}function a37_0x3123(){const _0x1a9241=['Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','3575795AybEcC','1778550FGshyh','182hZjnkp','error','11BOfIKm','✖\x20No\x20tables\x20found','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','47682fetOtY','Database:\x20all','Table\x20pattern:\x20','table','validate','\x27\x20is\x20ambiguous.','database','4TXrfsI','.*\x22','Site:\x20','Note:\x20\x27','cause','\x20table','2184BoxLSF','\x27\x20across\x20all\x20databases.','Error:\x20','verbose','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','Or\x20use\x20--in\x20flag:','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','132ZAQdwh','data','926604poNYxj','includes','message','Error:\x20Pattern\x20\x27','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','9iyfEmn','execute','query','4418552uDDWSD','6960370elFtBp','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','\x20\x20Use:\x20tdx\x20tables\x20\x22','limit','length','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','Database\x20pattern:\x20'];a37_0x3123=function(){return _0x1a9241;};return a37_0x3123();}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{['name']='tables';['description']='List\x20tables\x20in\x20a\x20database';async[a37_0x1b7a4e(0x191)](_0x38e6d4){const _0x3d24bd=a37_0x1b7a4e,{options:_0xf1f1b9,args:_0x4461f5,tdx:_0x1e42de}=_0x38e6d4;let _0x4c03a3;if(_0x4461f5['length']===0x0)_0x4c03a3={'database':undefined,'table':undefined,'original':''};else{if(_0x4461f5['length']===0x1)try{_0x4c03a3=parseTableReference(_0x4461f5[0x0]);if(_0x4c03a3[_0x3d24bd(0x1a6)]&&!_0x4c03a3[_0x3d24bd(0x1a9)]&&!_0x4c03a3['table']['includes']('*')&&!_0x4c03a3['table'][_0x3d24bd(0x18c)]('?'))return console[_0x3d24bd(0x19f)](_0x3d24bd(0x18e)+_0x4461f5[0x0]+_0x3d24bd(0x1a8)),console[_0x3d24bd(0x19f)](_0x3d24bd(0x19b)+_0x4c03a3[_0x3d24bd(0x1a6)]+'\x27?'),console['error'](_0x3d24bd(0x196)+_0x4c03a3[_0x3d24bd(0x1a6)]+_0x3d24bd(0x1ab)),console[_0x3d24bd(0x19f)](_0x3d24bd(0x195)+_0x4c03a3['table']),console['error'](_0x3d24bd(0x188)+_0x4c03a3[_0x3d24bd(0x1a6)]),console[_0x3d24bd(0x19f)](''),console[_0x3d24bd(0x19f)](_0x3d24bd(0x1ad)+_0x4461f5[0x0]+_0x3d24bd(0x186)+_0x4c03a3[_0x3d24bd(0x1a6)]+_0x3d24bd(0x1b1)),0x1;}catch(_0x5133ff){return console[_0x3d24bd(0x19f)](_0x3d24bd(0x1b2)+_0x5133ff[_0x3d24bd(0x18d)]),0x1;}else return console[_0x3d24bd(0x19f)]('Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'),console[_0x3d24bd(0x19f)](_0x3d24bd(0x199)),console[_0x3d24bd(0x19f)](_0x3d24bd(0x1a2)),console[_0x3d24bd(0x19f)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console['error'](_0x3d24bd(0x18f)),console[_0x3d24bd(0x19f)](_0x3d24bd(0x187)),console['error']('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0x486756=_0xf1f1b9[_0x3d24bd(0x1a9)];!_0x4c03a3['database']&&_0x486756&&(_0x4c03a3[_0x3d24bd(0x1a9)]=_0x486756);try{const _0x565380=_0x2cd03c=>_0x2cd03c&&(_0x2cd03c['includes']('*')||_0x2cd03c[_0x3d24bd(0x18c)]('?')),_0x1e7c74=_0x565380(_0x4c03a3['database']);_0xf1f1b9[_0x3d24bd(0x1b3)]&&(console['error'](_0x3d24bd(0x1ac)+_0xf1f1b9['site']),_0x4c03a3['database']?_0x1e7c74?console[_0x3d24bd(0x19f)](_0x3d24bd(0x19a)+_0x4c03a3[_0x3d24bd(0x1a9)]):console[_0x3d24bd(0x19f)]('Database:\x20'+_0x4c03a3[_0x3d24bd(0x1a9)]):console[_0x3d24bd(0x19f)](_0x3d24bd(0x1a4)),_0x4c03a3[_0x3d24bd(0x1a6)]&&console[_0x3d24bd(0x19f)](_0x3d24bd(0x1a5)+_0x4c03a3[_0x3d24bd(0x1a6)]));const _0x283e1f=_0x4c03a3[_0x3d24bd(0x1a9)]&&!_0x1e7c74?_0x4c03a3[_0x3d24bd(0x1a9)]:undefined,_0x34ec04=_0x1e7c74?_0x4c03a3[_0x3d24bd(0x1a9)]:undefined,_0x14147d=_0x4c03a3['table'],_0x1302ab=resolveLimit(_0xf1f1b9[_0x3d24bd(0x197)],DEFAULT_LISTING_LIMIT),_0x2a7392=await withSpinner('Listing\x20tables...',()=>_0x1e42de[_0x3d24bd(0x192)]['listTables'](_0x283e1f,_0x14147d,_0x34ec04,_0x1302ab),{'verbose':_0xf1f1b9[_0x3d24bd(0x1b3)]}),_0x1d842d=_0x2a7392[_0x3d24bd(0x18a)];if(_0x1d842d[_0x3d24bd(0x198)]===0x0&&_0x4c03a3[_0x3d24bd(0x1a9)]&&!_0x1e7c74)return console[_0x3d24bd(0x19f)](_0x3d24bd(0x1a1)),console['error']('Database\x20\x27'+_0x4c03a3[_0x3d24bd(0x1a9)]+_0x3d24bd(0x1b4)),0x1;return console[_0x3d24bd(0x19f)]('✔\x20Found\x20'+_0x1d842d[_0x3d24bd(0x198)]+_0x3d24bd(0x1af)+(_0x1d842d[_0x3d24bd(0x198)]!==0x1?'s':'')),await handleSDKOutput(_0x1d842d,{..._0xf1f1b9,'limit':_0x1302ab}),0x0;}catch(_0x3511b3){if(_0x3511b3 instanceof SDKError)return console['error'](_0x3d24bd(0x1b2)+_0x3511b3[_0x3d24bd(0x18d)]),_0x3511b3['cause']&&console[_0x3d24bd(0x19f)]('\x20\x20Cause:\x20'+_0x3511b3[_0x3d24bd(0x1ae)]),0x1;throw _0x3511b3;}}[a37_0x1b7a4e(0x1a7)](_0x48c920){return undefined;}}
1
+ const a37_0x5cc661=a37_0x1878;(function(_0x142b20,_0x54dbda){const _0x41fc2a=a37_0x1878,_0xcefa25=_0x142b20();while(!![]){try{const _0x593e59=-parseInt(_0x41fc2a(0x124))/0x1+-parseInt(_0x41fc2a(0x122))/0x2*(-parseInt(_0x41fc2a(0x123))/0x3)+-parseInt(_0x41fc2a(0x11f))/0x4+-parseInt(_0x41fc2a(0x10f))/0x5*(parseInt(_0x41fc2a(0x129))/0x6)+-parseInt(_0x41fc2a(0x105))/0x7*(parseInt(_0x41fc2a(0x110))/0x8)+-parseInt(_0x41fc2a(0x120))/0x9*(-parseInt(_0x41fc2a(0x11c))/0xa)+parseInt(_0x41fc2a(0x12d))/0xb;if(_0x593e59===_0x54dbda)break;else _0xcefa25['push'](_0xcefa25['shift']());}catch(_0x41597e){_0xcefa25['push'](_0xcefa25['shift']());}}}(a37_0x48c9,0xd3af8));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';function a37_0x48c9(){const _0x193396=['18729645uyHKDX','cause','Table\x20pattern:\x20','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','.*\x22','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','\x20\x20Cause:\x20','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','site','\x20table','178262SoBejD','table','error','Database:\x20all','✖\x20No\x20tables\x20found','Listing\x20tables...','limit','Note:\x20\x27','listTables','Database\x20\x27','15GYmmcf','264XPnwEL','query','Database:\x20','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Error:\x20','execute','message','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','verbose','length','Or\x20use\x20--in\x20flag:','120GLPtPb','Error:\x20Pattern\x20\x27','\x27\x20is\x20ambiguous.','196012IOvjME','71163TfomEO','tables','14qUwMyV','433737gTATGX','920992szRBQF','✔\x20Found\x20','database','\x27\x20across\x20all\x20databases.','data','264390ppvvik','name','includes','\x20\x20Use:\x20tdx\x20tables\x20\x22'];a37_0x48c9=function(){return _0x193396;};return a37_0x48c9();}function a37_0x1878(_0x2630f5,_0x48d835){const _0x48c9ab=a37_0x48c9();return a37_0x1878=function(_0x187891,_0x3af66b){_0x187891=_0x187891-0x102;let _0x39cc17=_0x48c9ab[_0x187891];return _0x39cc17;},a37_0x1878(_0x2630f5,_0x48d835);}export class TablesCommand extends BaseCommand{[a37_0x5cc661(0x12a)]=a37_0x5cc661(0x121);['description']='List\x20tables\x20in\x20a\x20database';async[a37_0x5cc661(0x116)](_0x1769f0){const _0x5efe05=a37_0x5cc661,{options:_0x5d6210,args:_0x31f77c,tdx:_0x1ebc34}=_0x1769f0;let _0x11fc74;if(_0x31f77c[_0x5efe05(0x11a)]===0x0)_0x11fc74={'database':undefined,'table':undefined,'original':''};else{if(_0x31f77c[_0x5efe05(0x11a)]===0x1)try{_0x11fc74=parseTableReference(_0x31f77c[0x0]);if(_0x11fc74['table']&&!_0x11fc74[_0x5efe05(0x126)]&&!_0x11fc74[_0x5efe05(0x106)]['includes']('*')&&!_0x11fc74['table'][_0x5efe05(0x12b)]('?'))return console[_0x5efe05(0x107)](_0x5efe05(0x11d)+_0x31f77c[0x0]+_0x5efe05(0x11e)),console[_0x5efe05(0x107)](_0x5efe05(0x113)+_0x11fc74[_0x5efe05(0x106)]+'\x27?'),console[_0x5efe05(0x107)](_0x5efe05(0x12c)+_0x11fc74[_0x5efe05(0x106)]+_0x5efe05(0x132)),console[_0x5efe05(0x107)]('\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'+_0x11fc74['table']),console[_0x5efe05(0x107)](_0x5efe05(0x102)+_0x11fc74[_0x5efe05(0x106)]),console[_0x5efe05(0x107)](''),console[_0x5efe05(0x107)](_0x5efe05(0x10c)+_0x31f77c[0x0]+_0x5efe05(0x118)+_0x11fc74[_0x5efe05(0x106)]+_0x5efe05(0x127)),0x1;}catch(_0x89a29b){return console['error'](_0x5efe05(0x115)+_0x89a29b[_0x5efe05(0x117)]),0x1;}else return console[_0x5efe05(0x107)](_0x5efe05(0x130)),console[_0x5efe05(0x107)]('\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases'),console[_0x5efe05(0x107)](_0x5efe05(0x114)),console[_0x5efe05(0x107)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console[_0x5efe05(0x107)](_0x5efe05(0x133)),console[_0x5efe05(0x107)](_0x5efe05(0x11b)),console[_0x5efe05(0x107)](_0x5efe05(0x134)),0x1;}const _0x4e2ea6=_0x5d6210['database'];!_0x11fc74[_0x5efe05(0x126)]&&_0x4e2ea6&&(_0x11fc74['database']=_0x4e2ea6);try{const _0x526f54=_0x430517=>_0x430517&&(_0x430517[_0x5efe05(0x12b)]('*')||_0x430517[_0x5efe05(0x12b)]('?')),_0x2229a3=_0x526f54(_0x11fc74[_0x5efe05(0x126)]);_0x5d6210[_0x5efe05(0x119)]&&(console[_0x5efe05(0x107)]('Site:\x20'+_0x5d6210[_0x5efe05(0x103)]),_0x11fc74[_0x5efe05(0x126)]?_0x2229a3?console[_0x5efe05(0x107)]('Database\x20pattern:\x20'+_0x11fc74[_0x5efe05(0x126)]):console['error'](_0x5efe05(0x112)+_0x11fc74['database']):console[_0x5efe05(0x107)](_0x5efe05(0x108)),_0x11fc74[_0x5efe05(0x106)]&&console[_0x5efe05(0x107)](_0x5efe05(0x12f)+_0x11fc74[_0x5efe05(0x106)]));const _0x1d5871=_0x11fc74[_0x5efe05(0x126)]&&!_0x2229a3?_0x11fc74[_0x5efe05(0x126)]:undefined,_0xb4e708=_0x2229a3?_0x11fc74[_0x5efe05(0x126)]:undefined,_0x2d9f7a=_0x11fc74[_0x5efe05(0x106)],_0x548800=resolveLimit(_0x5d6210[_0x5efe05(0x10b)],DEFAULT_LISTING_LIMIT),_0x42404e=await withSpinner(_0x5efe05(0x10a),()=>_0x1ebc34[_0x5efe05(0x111)][_0x5efe05(0x10d)](_0x1d5871,_0x2d9f7a,_0xb4e708,_0x548800),{'verbose':_0x5d6210[_0x5efe05(0x119)]}),_0x31e01f=_0x42404e[_0x5efe05(0x128)];if(_0x31e01f['length']===0x0&&_0x11fc74[_0x5efe05(0x126)]&&!_0x2229a3)return console[_0x5efe05(0x107)](_0x5efe05(0x109)),console[_0x5efe05(0x107)](_0x5efe05(0x10e)+_0x11fc74[_0x5efe05(0x126)]+_0x5efe05(0x131)),0x1;return console['error'](_0x5efe05(0x125)+_0x31e01f[_0x5efe05(0x11a)]+_0x5efe05(0x104)+(_0x31e01f[_0x5efe05(0x11a)]!==0x1?'s':'')),await handleSDKOutput(_0x31e01f,{..._0x5d6210,'limit':_0x548800}),0x0;}catch(_0x8d8d3e){if(_0x8d8d3e instanceof SDKError)return console[_0x5efe05(0x107)](_0x5efe05(0x115)+_0x8d8d3e[_0x5efe05(0x117)]),_0x8d8d3e[_0x5efe05(0x12e)]&&console[_0x5efe05(0x107)](_0x5efe05(0x135)+_0x8d8d3e[_0x5efe05(0x12e)]),0x1;throw _0x8d8d3e;}}['validate'](_0x99e6df){return undefined;}}
@@ -1 +1 @@
1
- const a38_0x35a266=a38_0x2bd8;(function(_0x3d5952,_0x4c9bdc){const _0x21e91f=a38_0x2bd8,_0x228c62=_0x3d5952();while(!![]){try{const _0x5bf965=-parseInt(_0x21e91f(0x1be))/0x1*(-parseInt(_0x21e91f(0x1e5))/0x2)+parseInt(_0x21e91f(0x1d5))/0x3*(-parseInt(_0x21e91f(0x1bb))/0x4)+parseInt(_0x21e91f(0x1ca))/0x5+-parseInt(_0x21e91f(0x1e0))/0x6*(-parseInt(_0x21e91f(0x1d4))/0x7)+parseInt(_0x21e91f(0x1c2))/0x8+-parseInt(_0x21e91f(0x1e3))/0x9+parseInt(_0x21e91f(0x1cf))/0xa;if(_0x5bf965===_0x4c9bdc)break;else _0x228c62['push'](_0x228c62['shift']());}catch(_0x2059db){_0x228c62['push'](_0x228c62['shift']());}}}(a38_0x2b82,0xca5b2));import{BaseCommand}from'./command.js';function a38_0x2b82(){const _0x304c2b=['Session\x20database\x20set\x20to:\x20','cleared','validate','1760128GufZPA','.\x20Must\x20be\x20one\x20of:\x20','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','length','debug','database','dim','display','3882925Bividy','\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace\x0a','use','log','toString','3968500vTOGMp','error','green','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace','name','7qSEYzR','29916AUrStQ','includes','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','Set\x20session-level\x20context','session','Invalid\x20resource:\x20','(session:\x20','message','displayWithSources','profile','Session\x20context\x20','2429898oTnkvT','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','description','14304168UWyFSU','execute','206ICvthZ','Error:\x20','\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','llm_project','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','parent_segment','112DSMLkG','engage_workspace','Session\x20engage_workspace\x20set\x20to:\x20','8728TIXCZq'];a38_0x2b82=function(){return _0x304c2b;};return a38_0x2b82();}import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists}from'../core/profile.js';import{GlobalContext}from'../core/global-context.js';function a38_0x2bd8(_0x20b7a4,_0x10e914){const _0x2b8224=a38_0x2b82();return a38_0x2bd8=function(_0x2bd8e1,_0x44982a){_0x2bd8e1=_0x2bd8e1-0x1ba;let _0xa21bc5=_0x2b8224[_0x2bd8e1];return _0xa21bc5;},a38_0x2bd8(_0x20b7a4,_0x10e914);}import a38_0x3dbf0a from'chalk';export class UseCommand extends BaseCommand{[a38_0x35a266(0x1d3)]=a38_0x35a266(0x1cc);[a38_0x35a266(0x1e2)]=a38_0x35a266(0x1d8);[a38_0x35a266(0x1c1)](_0x1f454f){const _0x1533d6=a38_0x35a266,{args:_0x1ba1e8}=_0x1f454f;if(_0x1ba1e8[_0x1533d6(0x1c5)]===0x0)return undefined;if(_0x1ba1e8['length']===0x1)return _0x1533d6(0x1e1)+_0x1533d6(0x1e7)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a'+_0x1533d6(0x1cb)+_0x1533d6(0x1e9);const _0x5e36a4=_0x1ba1e8[0x0],_0x412982=[_0x1533d6(0x1c7),_0x1533d6(0x1ba),'llm_project',_0x1533d6(0x1de),_0x1533d6(0x1bc)];if(!_0x412982[_0x1533d6(0x1d6)](_0x5e36a4))return _0x1533d6(0x1da)+_0x5e36a4+_0x1533d6(0x1c3)+_0x412982['join'](',\x20');return undefined;}async[a38_0x35a266(0x1e4)](_0x1f7dd5){const _0x3ad01e=a38_0x35a266,{args:_0x12269d,options:_0x8cf204}=_0x1f7dd5,_0x365f4e=_0x8cf204[_0x3ad01e(0x1c6)],_0x3af6ad=_0x8cf204['clear'];cleanExpiredSessions();try{if(_0x3af6ad){clearSessionContext(_0x8cf204[_0x3ad01e(0x1d9)]);const _0x1e24a3=_0x8cf204[_0x3ad01e(0x1d9)]||getCurrentSessionPID()['toString']();return console[_0x3ad01e(0x1cd)](_0x3ad01e(0x1df)+a38_0x3dbf0a[_0x3ad01e(0x1d1)](_0x3ad01e(0x1c0))+'\x20'+a38_0x3dbf0a[_0x3ad01e(0x1c8)](_0x3ad01e(0x1db)+_0x1e24a3+')')),0x0;}if(_0x12269d[_0x3ad01e(0x1c5)]===0x0){const _0x7431ba=new GlobalContext(_0x8cf204);return _0x365f4e?_0x7431ba[_0x3ad01e(0x1dd)]():_0x7431ba[_0x3ad01e(0x1c9)](),console[_0x3ad01e(0x1cd)](a38_0x3dbf0a[_0x3ad01e(0x1c8)]('\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>')),console['log'](a38_0x3dbf0a[_0x3ad01e(0x1c8)](_0x3ad01e(0x1d2))),0x0;}const _0x5cfe9f=_0x12269d[0x0],_0x31b550=_0x12269d[0x1];if(_0x5cfe9f==='profile'){if(!profileExists(_0x31b550))return console['error']('Error:\x20Profile\x20\x27'+_0x31b550+'\x27\x20does\x20not\x20exist'),console[_0x3ad01e(0x1d0)](_0x3ad01e(0x1d7)),0x1;const _0x5957d9=_0x8cf204[_0x3ad01e(0x1d9)]||getCurrentSessionPID()[_0x3ad01e(0x1ce)]();return saveSessionContext({'profile':_0x31b550},_0x8cf204[_0x3ad01e(0x1d9)]),console[_0x3ad01e(0x1cd)]('Session\x20profile\x20set\x20to:\x20'+a38_0x3dbf0a['green'](_0x31b550)+'\x20'+a38_0x3dbf0a['dim'](_0x3ad01e(0x1db)+_0x5957d9+')')),console[_0x3ad01e(0x1cd)](a38_0x3dbf0a[_0x3ad01e(0x1c8)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides')),0x0;}const _0x4f2c71={},_0x26617d=_0x8cf204['session']||getCurrentSessionPID()[_0x3ad01e(0x1ce)]();switch(_0x5cfe9f){case _0x3ad01e(0x1c7):_0x4f2c71[_0x3ad01e(0x1c7)]=_0x31b550,console[_0x3ad01e(0x1cd)](_0x3ad01e(0x1bf)+a38_0x3dbf0a['green'](_0x31b550)+'\x20'+a38_0x3dbf0a[_0x3ad01e(0x1c8)](_0x3ad01e(0x1db)+_0x26617d+')'));break;case'parent_segment':_0x4f2c71[_0x3ad01e(0x1ba)]=_0x31b550,console[_0x3ad01e(0x1cd)]('Session\x20parent_segment\x20set\x20to:\x20'+a38_0x3dbf0a[_0x3ad01e(0x1d1)](_0x31b550)+'\x20'+a38_0x3dbf0a[_0x3ad01e(0x1c8)](_0x3ad01e(0x1db)+_0x26617d+')'));break;case _0x3ad01e(0x1e8):_0x4f2c71['llm_project']=_0x31b550,console[_0x3ad01e(0x1cd)]('Session\x20llm_project\x20set\x20to:\x20'+a38_0x3dbf0a[_0x3ad01e(0x1d1)](_0x31b550)+'\x20'+a38_0x3dbf0a[_0x3ad01e(0x1c8)](_0x3ad01e(0x1db)+_0x26617d+')'));break;case _0x3ad01e(0x1bc):_0x4f2c71[_0x3ad01e(0x1bc)]=_0x31b550,console['log'](_0x3ad01e(0x1bd)+a38_0x3dbf0a[_0x3ad01e(0x1d1)](_0x31b550)+'\x20'+a38_0x3dbf0a['dim'](_0x3ad01e(0x1db)+_0x26617d+')'));break;}return saveSessionContext(_0x4f2c71,_0x8cf204[_0x3ad01e(0x1d9)]),console[_0x3ad01e(0x1cd)](a38_0x3dbf0a[_0x3ad01e(0x1c8)](_0x3ad01e(0x1c4))),0x0;}catch(_0x43548b){return _0x43548b instanceof Error&&console[_0x3ad01e(0x1d0)](_0x3ad01e(0x1e6)+_0x43548b[_0x3ad01e(0x1dc)]),0x1;}}}
1
+ const a38_0x51b6cd=a38_0x47a2;(function(_0x57716b,_0x4097e3){const _0x76f8e3=a38_0x47a2,_0x1b2242=_0x57716b();while(!![]){try{const _0x5cc1fe=parseInt(_0x76f8e3(0x118))/0x1+parseInt(_0x76f8e3(0x123))/0x2*(-parseInt(_0x76f8e3(0x149))/0x3)+parseInt(_0x76f8e3(0x144))/0x4*(-parseInt(_0x76f8e3(0x12b))/0x5)+parseInt(_0x76f8e3(0x139))/0x6*(parseInt(_0x76f8e3(0x134))/0x7)+-parseInt(_0x76f8e3(0x13a))/0x8+-parseInt(_0x76f8e3(0x14a))/0x9*(parseInt(_0x76f8e3(0x117))/0xa)+parseInt(_0x76f8e3(0x142))/0xb;if(_0x5cc1fe===_0x4097e3)break;else _0x1b2242['push'](_0x1b2242['shift']());}catch(_0x2e359b){_0x1b2242['push'](_0x1b2242['shift']());}}}(a38_0x305c,0x8ecc8));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists}from'../core/profile.js';import{GlobalContext}from'../core/global-context.js';import a38_0x339b25 from'chalk';function a38_0x47a2(_0x5a5596,_0x4ae614){const _0x305c32=a38_0x305c();return a38_0x47a2=function(_0x47a276,_0x2d2dab){_0x47a276=_0x47a276-0x117;let _0x206bfb=_0x305c32[_0x47a276];return _0x206bfb;},a38_0x47a2(_0x5a5596,_0x4ae614);}function a38_0x305c(){const _0x4132f3=['dim','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','2nHtBrC','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Session\x20database\x20set\x20to:\x20','validate','cleared','green','5mHQUrs','display','Session\x20profile\x20set\x20to:\x20','clear','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','execute','message','Session\x20llm_project\x20set\x20to:\x20','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace','217NuDtvs','use','database','error','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','206580zxlzdV','5162936WoBEAx','Session\x20engage_workspace\x20set\x20to:\x20','includes','displayWithSources','llm_project','Error:\x20Profile\x20\x27','toString','log','8052880YXfwNr','(session:\x20','757608ePqZmd','name','description','parent_segment','\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','3049323vsYJhs','61434xxWnBc','530cROtoi','998482wsRzMM','length','join','Error:\x20','Session\x20context\x20','\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace\x0a','engage_workspace','profile','session'];a38_0x305c=function(){return _0x4132f3;};return a38_0x305c();}export class UseCommand extends BaseCommand{[a38_0x51b6cd(0x145)]=a38_0x51b6cd(0x135);[a38_0x51b6cd(0x146)]='Set\x20session-level\x20context';[a38_0x51b6cd(0x128)](_0x3207ee){const _0x68015e=a38_0x51b6cd,{args:_0x29bc7d}=_0x3207ee;if(_0x29bc7d[_0x68015e(0x119)]===0x0)return undefined;if(_0x29bc7d[_0x68015e(0x119)]===0x1)return _0x68015e(0x124)+_0x68015e(0x148)+_0x68015e(0x125)+_0x68015e(0x11d)+_0x68015e(0x122);const _0x108bda=_0x29bc7d[0x0],_0x2d93b5=[_0x68015e(0x136),_0x68015e(0x147),_0x68015e(0x13e),_0x68015e(0x11f),'engage_workspace'];if(!_0x2d93b5[_0x68015e(0x13c)](_0x108bda))return'Invalid\x20resource:\x20'+_0x108bda+'.\x20Must\x20be\x20one\x20of:\x20'+_0x2d93b5[_0x68015e(0x11a)](',\x20');return undefined;}async[a38_0x51b6cd(0x130)](_0x35d496){const _0x1183a9=a38_0x51b6cd,{args:_0x28194f,options:_0x207d7e}=_0x35d496,_0x5c1eb2=_0x207d7e['debug'],_0x121d9f=_0x207d7e[_0x1183a9(0x12e)];cleanExpiredSessions();try{if(_0x121d9f){clearSessionContext(_0x207d7e[_0x1183a9(0x120)]);const _0x2eeee3=_0x207d7e['session']||getCurrentSessionPID()[_0x1183a9(0x140)]();return console['log'](_0x1183a9(0x11c)+a38_0x339b25[_0x1183a9(0x12a)](_0x1183a9(0x129))+'\x20'+a38_0x339b25[_0x1183a9(0x121)](_0x1183a9(0x143)+_0x2eeee3+')')),0x0;}if(_0x28194f['length']===0x0){const _0xe8b380=new GlobalContext(_0x207d7e);return _0x5c1eb2?_0xe8b380[_0x1183a9(0x13d)]():_0xe8b380[_0x1183a9(0x12c)](),console[_0x1183a9(0x141)](a38_0x339b25[_0x1183a9(0x121)](_0x1183a9(0x138))),console[_0x1183a9(0x141)](a38_0x339b25[_0x1183a9(0x121)](_0x1183a9(0x133))),0x0;}const _0x3dc197=_0x28194f[0x0],_0x299566=_0x28194f[0x1];if(_0x3dc197===_0x1183a9(0x11f)){if(!profileExists(_0x299566))return console[_0x1183a9(0x137)](_0x1183a9(0x13f)+_0x299566+'\x27\x20does\x20not\x20exist'),console[_0x1183a9(0x137)](_0x1183a9(0x12f)),0x1;const _0x1450ad=_0x207d7e[_0x1183a9(0x120)]||getCurrentSessionPID()['toString']();return saveSessionContext({'profile':_0x299566},_0x207d7e['session']),console[_0x1183a9(0x141)](_0x1183a9(0x12d)+a38_0x339b25[_0x1183a9(0x12a)](_0x299566)+'\x20'+a38_0x339b25[_0x1183a9(0x121)](_0x1183a9(0x143)+_0x1450ad+')')),console[_0x1183a9(0x141)](a38_0x339b25['dim'](_0x1183a9(0x126))),0x0;}const _0x4acc45={},_0xc3a4ee=_0x207d7e[_0x1183a9(0x120)]||getCurrentSessionPID()[_0x1183a9(0x140)]();switch(_0x3dc197){case _0x1183a9(0x136):_0x4acc45['database']=_0x299566,console[_0x1183a9(0x141)](_0x1183a9(0x127)+a38_0x339b25[_0x1183a9(0x12a)](_0x299566)+'\x20'+a38_0x339b25[_0x1183a9(0x121)](_0x1183a9(0x143)+_0xc3a4ee+')'));break;case _0x1183a9(0x147):_0x4acc45[_0x1183a9(0x147)]=_0x299566,console[_0x1183a9(0x141)]('Session\x20parent_segment\x20set\x20to:\x20'+a38_0x339b25[_0x1183a9(0x12a)](_0x299566)+'\x20'+a38_0x339b25[_0x1183a9(0x121)](_0x1183a9(0x143)+_0xc3a4ee+')'));break;case _0x1183a9(0x13e):_0x4acc45['llm_project']=_0x299566,console[_0x1183a9(0x141)](_0x1183a9(0x132)+a38_0x339b25['green'](_0x299566)+'\x20'+a38_0x339b25[_0x1183a9(0x121)](_0x1183a9(0x143)+_0xc3a4ee+')'));break;case _0x1183a9(0x11e):_0x4acc45[_0x1183a9(0x11e)]=_0x299566,console[_0x1183a9(0x141)](_0x1183a9(0x13b)+a38_0x339b25[_0x1183a9(0x12a)](_0x299566)+'\x20'+a38_0x339b25[_0x1183a9(0x121)](_0x1183a9(0x143)+_0xc3a4ee+')'));break;}return saveSessionContext(_0x4acc45,_0x207d7e[_0x1183a9(0x120)]),console[_0x1183a9(0x141)](a38_0x339b25[_0x1183a9(0x121)](_0x1183a9(0x126))),0x0;}catch(_0x3d88e0){return _0x3d88e0 instanceof Error&&console['error'](_0x1183a9(0x11b)+_0x3d88e0[_0x1183a9(0x131)]),0x1;}}}
@@ -1 +1 @@
1
- const a39_0x495444=a39_0x19fb;function a39_0x1e3f(){const _0x1f127a=['List\x20workflows','done','cause','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','delete','isDirectory','Retry\x20a\x20session\x20or\x20attempt','Resume\x20from:\x20','workflow:retry','Error:\x20Attempt\x20ID\x20is\x20required','6810Pntacd','Project\x20filter:\x20','Error:\x20','\x20\x20Attempt\x20ID:\x20','\x20\x20Location:\x20','session:','fileSize','from','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Show\x20specific\x20attempt\x20details','\x20\x20Project\x20ID:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','success','error','keys','Status:\x20','tasks','Error:\x20Invalid\x20JSON\x20in\x20--params','\x20\x20Cause:\x20','includeSubtasks','Project\x20directory:\x20','Select\x20a\x20task\x20to\x20view\x20logs:','12035647FqQjgF','295FwGXxC','\x20attempt','split','workflow','format','attemptId','12FMINEs','\x20\x20Project:\x20','param','force','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','workflow:push','fs/promises','Starting\x20workflow\x20run...','Revision:\x20','logFiles','✔\x20Found\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Validation:\x20skipped','320698sRNamn','\x20session','select','limit','stat','round','status','length','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Listing\x20workflows...','3022632MPdWak','1870wSYoBU','From\x20task:\x20','workflow:attempt','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','...','params','Listing\x20workflow\x20attempts...','Retrying\x20attempt...','Fetching\x20log\x20files...','Start\x20a\x20workflow\x20run','\x20\x20Revision:\x20','data','\x20\x20Files\x20extracted:\x20','Params:\x20','projects','List\x20workflow\x20attempts','List\x20all\x20workflow\x20projects','workflow:run','createdAt','session','Parameters:\x20','attempt','canceling','yes','✔\x20Deleted\x20project\x20','indexOf','download','sessionTime','execute','finishedAt','Reason:\x20','No\x20log\x20content\x20found','Target:\x20','Filter:\x20','6960384PlrFEf','\x20is\x20not\x20a\x20directory','filesExtracted','workflow:logs','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Downloading\x20logs...','retryAttemptName','description','index','Force:\x20yes','Workflow:\x20','Pattern:\x20','Getting\x20attempt\x20tasks...','18AKGUNT','\x20task','Killing\x20attempt...','Including\x20subtasks:\x20yes','List\x20workflow\x20execution\x20sessions','Kill\x20a\x20running\x20attempt','verbose','Filter:\x20project=','✔\x20Pushed\x20','\x20workflow','Downloading\x20project\x20','\x20\x20Session\x20ID:\x20','Cancelled','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','attempt:','Show\x20tasks\x20for\x20an\x20attempt','attempts','workflow:kill','isArray','workflow:download','Usage:\x20workflow:delete\x20<project-name-or-id>','kill','taskName','projectName','Pushing\x20workflow\x20project...','✔\x20Retry\x20started','push','getTime','Task\x20name:\x20','14YCvFrJ','Project:\x20','task','5870XBFGqI','2SXwWKT','Error:\x20Invalid\x20parameter\x20format:\x20','workflow:attempts','startsWith','includeRetried','substring','Attempt\x20ID:\x20','Output\x20directory:\x20','sessionId','157900UwfcSX','name','logs','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','sessions','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','revision','message','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','project','retryAttempt','Deleting\x20project\x20','workflow:projects','cancelRequested','json','retrySession','map','workflow:sessions','\x20\x20Workflow:\x20','Include\x20retried:\x20yes','parse','\x20\x20New\x20attempt\x20ID:\x20','skipValidation','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'];a39_0x1e3f=function(){return _0x1f127a;};return a39_0x1e3f();}(function(_0x55893f,_0x15f270){const _0x44af56=a39_0x19fb,_0x19989a=_0x55893f();while(!![]){try{const _0x2ced2f=-parseInt(_0x44af56(0x1a4))/0x1*(-parseInt(_0x44af56(0x14f))/0x2)+-parseInt(_0x44af56(0x12e))/0x3*(parseInt(_0x44af56(0x158))/0x4)+-parseInt(_0x44af56(0x191))/0x5*(parseInt(_0x44af56(0x17a))/0x6)+parseInt(_0x44af56(0x14b))/0x7*(parseInt(_0x44af56(0x1ae))/0x8)+parseInt(_0x44af56(0x121))/0x9+parseInt(_0x44af56(0x14e))/0xa*(parseInt(_0x44af56(0x1af))/0xb)+parseInt(_0x44af56(0x197))/0xc*(-parseInt(_0x44af56(0x190))/0xd);if(_0x2ced2f===_0x15f270)break;else _0x19989a['push'](_0x19989a['shift']());}catch(_0x2e8032){_0x19989a['push'](_0x19989a['shift']());}}}(a39_0x1e3f,0xafc10));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';function a39_0x19fb(_0x2130b4,_0x2f832){const _0x1e3ff1=a39_0x1e3f();return a39_0x19fb=function(_0x19fb4d,_0x964387){_0x19fb4d=_0x19fb4d-0x106;let _0x28c373=_0x1e3ff1[_0x19fb4d];return _0x28c373;},a39_0x19fb(_0x2130b4,_0x2f832);}import a39_0x48f917 from'prompts';export class WorkflowProjectsCommand extends BaseCommand{['name']=a39_0x495444(0x164);[a39_0x495444(0x128)]=a39_0x495444(0x10f);async[a39_0x495444(0x11b)](_0x4334d3){const _0x2ae912=a39_0x495444,{options:_0xa627ae,args:_0x5df83e,tdx:_0x2a07b9}=_0x4334d3,_0x4f3b6e=_0x5df83e[0x0];try{_0xa627ae[_0x2ae912(0x134)]&&_0x4f3b6e&&console[_0x2ae912(0x187)](_0x2ae912(0x12c)+_0x4f3b6e);const _0xc4e210=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x2a07b9[_0x2ae912(0x194)][_0x2ae912(0x10d)](_0x4f3b6e,{'limit':_0xa627ae[_0x2ae912(0x1a7)]}),{'verbose':_0xa627ae[_0x2ae912(0x134)]}),_0x2cb39a=_0xc4e210[_0x2ae912(0x10a)];return console[_0x2ae912(0x187)](_0x2ae912(0x1a1)+_0x2cb39a['length']+'\x20project'+(_0x2cb39a['length']!==0x1?'s':'')),await handleSDKOutput(_0x2cb39a,_0xa627ae),0x0;}catch(_0x5a9846){if(_0x5a9846 instanceof SDKError)return console[_0x2ae912(0x187)](_0x2ae912(0x17c)+_0x5a9846[_0x2ae912(0x15f)]),_0x5a9846['cause']&&console[_0x2ae912(0x187)](_0x2ae912(0x18c)+_0x5a9846[_0x2ae912(0x172)]),0x1;throw _0x5a9846;}}}export class WorkflowWorkflowsCommand extends BaseCommand{['name']='workflow:workflows';[a39_0x495444(0x128)]=a39_0x495444(0x170);async[a39_0x495444(0x11b)](_0x570fb0){const _0x36eb8a=a39_0x495444,{options:_0x411b2f,args:_0x14be65,tdx:_0x21dd43}=_0x570fb0,_0x16e23e=_0x14be65[0x0];try{_0x411b2f[_0x36eb8a(0x134)]&&_0x16e23e&&console[_0x36eb8a(0x187)](_0x36eb8a(0x17b)+_0x16e23e);const _0x312c1a=await withSpinner(_0x36eb8a(0x1ad),()=>_0x21dd43['workflow']['workflows'](_0x16e23e,{'limit':_0x411b2f[_0x36eb8a(0x1a7)]}),{'verbose':_0x411b2f[_0x36eb8a(0x134)]}),_0x466f66=_0x312c1a[_0x36eb8a(0x10a)];return console[_0x36eb8a(0x187)](_0x36eb8a(0x1a1)+_0x466f66[_0x36eb8a(0x1ab)]+_0x36eb8a(0x137)+(_0x466f66[_0x36eb8a(0x1ab)]!==0x1?'s':'')),await handleSDKOutput(_0x466f66,_0x411b2f),0x0;}catch(_0x488026){if(_0x488026 instanceof SDKError)return console['error'](_0x36eb8a(0x17c)+_0x488026['message']),_0x488026['cause']&&console[_0x36eb8a(0x187)](_0x36eb8a(0x18c)+_0x488026[_0x36eb8a(0x172)]),0x1;throw _0x488026;}}}export class WorkflowSessionsCommand extends BaseCommand{['name']=a39_0x495444(0x169);[a39_0x495444(0x128)]=a39_0x495444(0x132);async['execute'](_0x3abce5){const _0x53cb17=a39_0x495444,{options:_0x4856e2,args:_0x224ddb,tdx:_0x48e1ce}=_0x3abce5;let _0xae9683,_0x16c0dd;if(_0x224ddb[0x0]){const _0x586a15=_0x224ddb[0x0]['split']('.');if(_0x586a15[_0x53cb17(0x1ab)]===0x1)_0xae9683=_0x586a15[0x0];else{if(_0x586a15['length']===0x2)[_0xae9683,_0x16c0dd]=_0x586a15;else return console[_0x53cb17(0x187)](_0x53cb17(0x19b)),0x1;}}try{if(_0x4856e2[_0x53cb17(0x134)]){if(_0xae9683&&_0x16c0dd)console[_0x53cb17(0x187)](_0x53cb17(0x120)+_0xae9683+'.'+_0x16c0dd);else _0xae9683&&console[_0x53cb17(0x187)](_0x53cb17(0x135)+_0xae9683);const _0x473008=_0x4856e2['status'];_0x473008&&console[_0x53cb17(0x187)](_0x53cb17(0x189)+_0x473008);}const _0x2ca966=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x48e1ce['workflow'][_0x53cb17(0x15c)]({'projectName':_0xae9683,'workflowName':_0x16c0dd,'status':_0x4856e2[_0x53cb17(0x1aa)],'fromTime':_0x4856e2[_0x53cb17(0x181)],'toTime':_0x4856e2['to'],'limit':_0x4856e2['limit']}),{'verbose':_0x4856e2['verbose']}),_0x20db0b=_0x2ca966[_0x53cb17(0x10a)];return console[_0x53cb17(0x187)](_0x53cb17(0x1a1)+_0x20db0b[_0x53cb17(0x1ab)]+_0x53cb17(0x1a5)+(_0x20db0b[_0x53cb17(0x1ab)]!==0x1?'s':'')),await handleSDKOutput(_0x20db0b,_0x4856e2),0x0;}catch(_0x514111){if(_0x514111 instanceof SDKError)return console[_0x53cb17(0x187)](_0x53cb17(0x17c)+_0x514111['message']),_0x514111['cause']&&console[_0x53cb17(0x187)](_0x53cb17(0x18c)+_0x514111[_0x53cb17(0x172)]),0x1;throw _0x514111;}}}export class WorkflowAttemptsCommand extends BaseCommand{['name']=a39_0x495444(0x151);['description']=a39_0x495444(0x10e);async[a39_0x495444(0x11b)](_0xaaa802){const _0x5a2fa1=a39_0x495444,{options:_0x3bc8be,args:_0x4d2d8c,tdx:_0xc9ee8}=_0xaaa802;let _0x2d58d0,_0x705b3e;if(_0x4d2d8c[0x0]){const _0x5e9322=_0x4d2d8c[0x0][_0x5a2fa1(0x193)]('.');if(_0x5e9322[_0x5a2fa1(0x1ab)]===0x1)_0x2d58d0=_0x5e9322[0x0];else{if(_0x5e9322['length']===0x2)[_0x2d58d0,_0x705b3e]=_0x5e9322;else return console['error'](_0x5a2fa1(0x19b)),0x1;}}try{const _0x39213=_0x3bc8be[_0x5a2fa1(0x153)];if(_0x3bc8be['verbose']){if(_0x2d58d0&&_0x705b3e)console[_0x5a2fa1(0x187)](_0x5a2fa1(0x120)+_0x2d58d0+'.'+_0x705b3e);else _0x2d58d0&&console[_0x5a2fa1(0x187)](_0x5a2fa1(0x135)+_0x2d58d0);_0x39213&&console['error'](_0x5a2fa1(0x16b));}const _0x3f86b9=await withSpinner(_0x5a2fa1(0x1b5),()=>_0xc9ee8[_0x5a2fa1(0x194)][_0x5a2fa1(0x13e)]({'projectName':_0x2d58d0,'workflowName':_0x705b3e,'includeRetried':_0x39213,'limit':_0x3bc8be[_0x5a2fa1(0x1a7)]}),{'verbose':_0x3bc8be[_0x5a2fa1(0x134)]}),_0xa9155=_0x3f86b9[_0x5a2fa1(0x10a)];return console[_0x5a2fa1(0x187)]('✔\x20Found\x20'+_0xa9155[_0x5a2fa1(0x1ab)]+_0x5a2fa1(0x192)+(_0xa9155[_0x5a2fa1(0x1ab)]!==0x1?'s':'')),await handleSDKOutput(_0xa9155,_0x3bc8be),0x0;}catch(_0x3e138e){if(_0x3e138e instanceof SDKError)return console[_0x5a2fa1(0x187)](_0x5a2fa1(0x17c)+_0x3e138e[_0x5a2fa1(0x15f)]),_0x3e138e[_0x5a2fa1(0x172)]&&console[_0x5a2fa1(0x187)](_0x5a2fa1(0x18c)+_0x3e138e[_0x5a2fa1(0x172)]),0x1;throw _0x3e138e;}}}export class WorkflowAttemptCommand extends BaseCommand{[a39_0x495444(0x159)]=a39_0x495444(0x1b1);[a39_0x495444(0x128)]=a39_0x495444(0x183);async[a39_0x495444(0x11b)](_0x247a79){const _0x3de7d4=a39_0x495444,{options:_0x42042d,args:_0x4b81c1,tdx:_0x51c19e}=_0x247a79,_0x3c9064=_0x4b81c1[0x0];if(!_0x3c9064)return console[_0x3de7d4(0x187)](_0x3de7d4(0x179)),0x1;try{_0x42042d[_0x3de7d4(0x134)]&&console[_0x3de7d4(0x187)]('Attempt\x20ID:\x20'+_0x3c9064);const _0x557778=await withSpinner('Getting\x20attempt\x20details...',()=>_0x51c19e['workflow'][_0x3de7d4(0x114)](_0x3c9064),{'verbose':_0x42042d[_0x3de7d4(0x134)]}),_0x4b6497=_0x557778['data'];let _0x30d747;!_0x4b6497[_0x3de7d4(0x171)]?_0x30d747=_0x4b6497[_0x3de7d4(0x165)]?_0x3de7d4(0x115):'running':_0x30d747=_0x4b6497[_0x3de7d4(0x186)]?_0x3de7d4(0x186):_0x3de7d4(0x187);let _0xeda6e6;if(_0x4b6497['createdAt']&&_0x4b6497['finishedAt']){const _0x4f15de=new Date(_0x4b6497[_0x3de7d4(0x111)])['getTime'](),_0x3eb38c=new Date(_0x4b6497[_0x3de7d4(0x11c)])[_0x3de7d4(0x149)]();_0xeda6e6=Math[_0x3de7d4(0x1a9)]((_0x3eb38c-_0x4f15de)/0x3e8);}const _0x2e5eff={'attempt_id':_0x4b6497['id'],'status':_0x30d747,..._0x4b6497[_0x3de7d4(0x129)]!==undefined&&{'index':_0x4b6497[_0x3de7d4(0x129)]},..._0x4b6497[_0x3de7d4(0x161)]&&{'project':_0x4b6497['project'][_0x3de7d4(0x159)]},..._0x4b6497[_0x3de7d4(0x194)]&&{'workflow':_0x4b6497[_0x3de7d4(0x194)][_0x3de7d4(0x159)]},..._0x4b6497['sessionId']&&{'session_id':_0x4b6497[_0x3de7d4(0x157)]},..._0x4b6497[_0x3de7d4(0x11a)]&&{'session_time':_0x4b6497[_0x3de7d4(0x11a)]},..._0x4b6497[_0x3de7d4(0x127)]&&{'retry_attempt':_0x4b6497[_0x3de7d4(0x127)]},..._0xeda6e6!==undefined&&{'duration_sec':_0xeda6e6},..._0x4b6497['createdAt']&&{'created_at':_0x4b6497['createdAt']},..._0x4b6497[_0x3de7d4(0x11c)]&&{'finished_at':_0x4b6497[_0x3de7d4(0x11c)]},...Object['keys'](_0x4b6497[_0x3de7d4(0x1b4)])[_0x3de7d4(0x1ab)]>0x0&&{'params':_0x4b6497[_0x3de7d4(0x1b4)]}};return await handleSingleObjectOutput(_0x2e5eff,_0x42042d),0x0;}catch(_0x30ef18){if(_0x30ef18 instanceof SDKError)return console[_0x3de7d4(0x187)]('Error:\x20'+_0x30ef18[_0x3de7d4(0x15f)]),_0x30ef18[_0x3de7d4(0x172)]&&console[_0x3de7d4(0x187)](_0x3de7d4(0x18c)+_0x30ef18[_0x3de7d4(0x172)]),0x1;throw _0x30ef18;}}}export class WorkflowTasksCommand extends BaseCommand{['name']='workflow:tasks';[a39_0x495444(0x128)]=a39_0x495444(0x13d);async[a39_0x495444(0x11b)](_0x373ca2){const _0x40091d=a39_0x495444,{options:_0x38a65c,args:_0x514865,tdx:_0x571867}=_0x373ca2,_0x25c613=_0x514865[0x0];if(!_0x25c613)return console['error'](_0x40091d(0x179)),0x1;try{const _0x313cd5=_0x38a65c[_0x40091d(0x18d)];_0x38a65c[_0x40091d(0x134)]&&(console[_0x40091d(0x187)](_0x40091d(0x155)+_0x25c613),_0x313cd5&&console['error'](_0x40091d(0x131)));const _0x3da60a=await withSpinner(_0x40091d(0x12d),()=>_0x571867[_0x40091d(0x194)][_0x40091d(0x18a)](_0x25c613,_0x313cd5||![]),{'verbose':_0x38a65c[_0x40091d(0x134)]}),_0x4660a6=_0x3da60a[_0x40091d(0x10a)];return console[_0x40091d(0x187)]('✔\x20Found\x20'+_0x4660a6[_0x40091d(0x1ab)]+_0x40091d(0x12f)+(_0x4660a6[_0x40091d(0x1ab)]!==0x1?'s':'')),await handleSDKOutput(_0x4660a6,_0x38a65c),0x0;}catch(_0x169586){if(_0x169586 instanceof SDKError)return console[_0x40091d(0x187)](_0x40091d(0x17c)+_0x169586['message']),_0x169586[_0x40091d(0x172)]&&console[_0x40091d(0x187)]('\x20\x20Cause:\x20'+_0x169586[_0x40091d(0x172)]),0x1;throw _0x169586;}}}export class WorkflowLogsCommand extends BaseCommand{[a39_0x495444(0x159)]=a39_0x495444(0x124);[a39_0x495444(0x128)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a39_0x495444(0x11b)](_0x536d79){const _0x1b1692=a39_0x495444,{options:_0x30d966,args:_0xa256ae,tdx:_0x4dcb5b}=_0x536d79,_0x5a620d=_0xa256ae[0x0];let _0x1d5405=_0xa256ae[0x1];if(!_0x5a620d)return console[_0x1b1692(0x187)](_0x1b1692(0x179)),0x1;try{_0x30d966[_0x1b1692(0x134)]&&(console[_0x1b1692(0x187)](_0x1b1692(0x155)+_0x5a620d),_0x1d5405&&console[_0x1b1692(0x187)](_0x1b1692(0x14a)+_0x1d5405));const _0x5605ec=await withSpinner(_0x1b1692(0x107),()=>_0x4dcb5b['workflow'][_0x1b1692(0x1a0)](_0x5a620d,_0x1d5405),{'verbose':_0x30d966[_0x1b1692(0x134)]}),_0x19e187=_0x5605ec['data'];if(_0x19e187[_0x1b1692(0x1ab)]===0x0)return console[_0x1b1692(0x187)](_0x1b1692(0x125)),0x0;if(!_0x1d5405&&(_0x30d966[_0x1b1692(0x166)]||_0x30d966[_0x1b1692(0x195)]))return await handleSDKOutput(_0x19e187,_0x30d966),0x0;if(!_0x1d5405){const _0x1d81c3=_0x19e187[_0x1b1692(0x168)](_0x2ca0c8=>({'title':_0x2ca0c8[_0x1b1692(0x144)]+'\x20('+formatBytes(_0x2ca0c8[_0x1b1692(0x180)])+')','value':_0x2ca0c8[_0x1b1692(0x144)]})),_0x369248=await a39_0x48f917({'type':_0x1b1692(0x1a6),'name':_0x1b1692(0x14d),'message':_0x1b1692(0x18f),'choices':_0x1d81c3});if(!_0x369248['task'])return console[_0x1b1692(0x187)](_0x1b1692(0x13a)),0x0;_0x1d5405=_0x369248[_0x1b1692(0x14d)];}const _0x3d3bef=await withSpinner(_0x1b1692(0x126),()=>_0x4dcb5b[_0x1b1692(0x194)][_0x1b1692(0x15a)](_0x5a620d,_0x1d5405),{'verbose':_0x30d966[_0x1b1692(0x134)]}),_0x3a34cc=_0x3d3bef[_0x1b1692(0x10a)];return _0x3a34cc?console['log'](_0x3a34cc):console['error'](_0x1b1692(0x11e)),0x0;}catch(_0x34220b){if(_0x34220b instanceof SDKError)return console[_0x1b1692(0x187)](_0x1b1692(0x17c)+_0x34220b['message']),_0x34220b[_0x1b1692(0x172)]&&console['error'](_0x1b1692(0x18c)+_0x34220b[_0x1b1692(0x172)]),0x1;throw _0x34220b;}}}export class WorkflowKillCommand extends BaseCommand{[a39_0x495444(0x159)]=a39_0x495444(0x13f);['description']=a39_0x495444(0x133);async[a39_0x495444(0x11b)](_0x5efa1e){const _0x532bc7=a39_0x495444,{options:_0xb956fc,args:_0x350b50,tdx:_0x2f457e}=_0x5efa1e,_0x4814c9=_0x350b50[0x0];if(!_0x4814c9)return console[_0x532bc7(0x187)](_0x532bc7(0x179)),0x1;try{const _0x196a7a=_0xb956fc['reason'];_0xb956fc['verbose']&&(console[_0x532bc7(0x187)](_0x532bc7(0x155)+_0x4814c9),_0x196a7a&&console[_0x532bc7(0x187)](_0x532bc7(0x11d)+_0x196a7a));if(!_0xb956fc[_0x532bc7(0x116)]){const _0x26e06c=await confirm(_0x532bc7(0x173)+_0x4814c9+'?');if(!_0x26e06c)return console['error']('Cancelled'),0x0;}const _0xd59c0c=await withSpinner(_0x532bc7(0x130),()=>_0x2f457e['workflow'][_0x532bc7(0x143)](_0x4814c9,_0x196a7a),{'verbose':_0xb956fc['verbose']}),_0x115b28=_0xd59c0c[_0x532bc7(0x10a)];return console[_0x532bc7(0x187)]('✔\x20'+_0x115b28),0x0;}catch(_0x3b7b2b){if(_0x3b7b2b instanceof SDKError)return console[_0x532bc7(0x187)](_0x532bc7(0x17c)+_0x3b7b2b[_0x532bc7(0x15f)]),_0x3b7b2b[_0x532bc7(0x172)]&&console[_0x532bc7(0x187)]('\x20\x20Cause:\x20'+_0x3b7b2b[_0x532bc7(0x172)]),0x1;throw _0x3b7b2b;}}}export class WorkflowRetryCommand extends BaseCommand{[a39_0x495444(0x159)]=a39_0x495444(0x178);[a39_0x495444(0x128)]=a39_0x495444(0x176);async[a39_0x495444(0x11b)](_0x1e8ca4){const _0x38d13b=a39_0x495444,{options:_0x17c2c0,args:_0x331d2d,tdx:_0x5de683}=_0x1e8ca4,_0x2f03bf=_0x331d2d[0x0];if(!_0x2f03bf)return console[_0x38d13b(0x187)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x38d13b(0x187)](_0x38d13b(0x1a2)),0x1;let _0x33f8ae=![],_0x2b250c=_0x2f03bf;if(_0x2f03bf['startsWith'](_0x38d13b(0x17f)))_0x33f8ae=!![],_0x2b250c=_0x2f03bf[_0x38d13b(0x154)](0x8);else{if(_0x2f03bf[_0x38d13b(0x152)](_0x38d13b(0x13c)))_0x33f8ae=![],_0x2b250c=_0x2f03bf[_0x38d13b(0x154)](0x8);else return console[_0x38d13b(0x187)](_0x38d13b(0x182)),console['error'](_0x38d13b(0x1a2)),0x1;}try{const _0x140ea2=_0x17c2c0['fromTask'],_0x226090=_0x17c2c0['resumeFrom'],_0x22267e=_0x17c2c0[_0x38d13b(0x1b4)],_0xf37dac=_0x17c2c0[_0x38d13b(0x19a)];_0x17c2c0['verbose']&&(console['error'](_0x38d13b(0x11f)+(_0x33f8ae?_0x38d13b(0x112):_0x38d13b(0x114))+'\x20'+_0x2b250c),_0x140ea2&&console[_0x38d13b(0x187)](_0x38d13b(0x1b0)+_0x140ea2),_0x226090&&console[_0x38d13b(0x187)](_0x38d13b(0x177)+_0x226090),_0x22267e&&console[_0x38d13b(0x187)](_0x38d13b(0x10c)+_0x22267e),_0xf37dac&&console[_0x38d13b(0x187)](_0x38d13b(0x12a)));let _0x178731;if(_0x22267e)try{if(_0x22267e[_0x38d13b(0x152)]('@')){const _0x4eaa13=await import(_0x38d13b(0x19d)),_0x28e8c1=_0x22267e['substring'](0x1),_0x3c3fc6=await _0x4eaa13['readFile'](_0x28e8c1,'utf-8');_0x178731=JSON[_0x38d13b(0x16c)](_0x3c3fc6);}else _0x178731=JSON[_0x38d13b(0x16c)](_0x22267e);}catch{return console[_0x38d13b(0x187)](_0x38d13b(0x18b)),0x1;}if(!_0x17c2c0[_0x38d13b(0x116)]){const _0x4ef34c=await confirm(_0x38d13b(0x160)+(_0x33f8ae?_0x38d13b(0x112):_0x38d13b(0x114))+'\x20'+_0x2b250c+'?');if(!_0x4ef34c)return console[_0x38d13b(0x187)](_0x38d13b(0x13a)),0x0;}let _0x51fda8;_0x33f8ae?_0x51fda8=await withSpinner('Retrying\x20session...',()=>_0x5de683[_0x38d13b(0x194)][_0x38d13b(0x167)](_0x2b250c,{'fromTask':_0x140ea2,'retryParams':_0x178731}),{'verbose':_0x17c2c0[_0x38d13b(0x134)]}):_0x51fda8=await withSpinner(_0x38d13b(0x106),()=>_0x5de683['workflow'][_0x38d13b(0x162)](_0x2b250c,{'resumeFrom':_0x226090,'retryParams':_0x178731,'force':_0xf37dac}),{'verbose':_0x17c2c0[_0x38d13b(0x134)]});const _0x126a3e=_0x51fda8[_0x38d13b(0x10a)];return console['error'](_0x38d13b(0x147)),console['error'](_0x38d13b(0x16d)+_0x126a3e[_0x38d13b(0x196)]),console[_0x38d13b(0x187)](_0x38d13b(0x139)+_0x126a3e[_0x38d13b(0x157)]),0x0;}catch(_0x39f6af){if(_0x39f6af instanceof SDKError)return console[_0x38d13b(0x187)](_0x38d13b(0x17c)+_0x39f6af[_0x38d13b(0x15f)]),_0x39f6af[_0x38d13b(0x172)]&&console[_0x38d13b(0x187)]('\x20\x20Cause:\x20'+_0x39f6af[_0x38d13b(0x172)]),0x1;throw _0x39f6af;}}}export class WorkflowRunCommand extends BaseCommand{['name']=a39_0x495444(0x110);[a39_0x495444(0x128)]=a39_0x495444(0x108);async[a39_0x495444(0x11b)](_0x5a5072){const _0x1d8ac0=a39_0x495444,{options:_0x3b1d14,args:_0x3c4dc2,tdx:_0x47b09e}=_0x5a5072,_0x26bcc8=_0x3c4dc2[0x0];if(!_0x26bcc8)return console[_0x1d8ac0(0x187)]('Error:\x20Workflow\x20identifier\x20is\x20required'),console[_0x1d8ac0(0x187)]('Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]'),0x1;const _0x302e80=_0x3b1d14[_0x1d8ac0(0x199)],_0xf9f836=_0x3b1d14['sessionTime'],_0x4ce36e={};if(_0x302e80&&Array[_0x1d8ac0(0x140)](_0x302e80))for(const _0xdaeac3 of _0x302e80){const _0xd3fc1=_0xdaeac3[_0x1d8ac0(0x118)]('=');if(_0xd3fc1===-0x1)return console[_0x1d8ac0(0x187)](_0x1d8ac0(0x150)+_0xdaeac3),console[_0x1d8ac0(0x187)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x64d7b1=_0xdaeac3[_0x1d8ac0(0x154)](0x0,_0xd3fc1),_0x553dc8=_0xdaeac3[_0x1d8ac0(0x154)](_0xd3fc1+0x1);try{_0x4ce36e[_0x64d7b1]=JSON[_0x1d8ac0(0x16c)](_0x553dc8);}catch{_0x4ce36e[_0x64d7b1]=_0x553dc8;}}_0x3b1d14[_0x1d8ac0(0x134)]&&(console['error'](_0x1d8ac0(0x12b)+_0x26bcc8),Object[_0x1d8ac0(0x188)](_0x4ce36e)[_0x1d8ac0(0x1ab)]>0x0&&console[_0x1d8ac0(0x187)](_0x1d8ac0(0x113)+JSON['stringify'](_0x4ce36e)),_0xf9f836&&console[_0x1d8ac0(0x187)]('Session\x20time:\x20'+_0xf9f836));const _0x2a12b3=await withSpinner(_0x1d8ac0(0x19e),()=>_0x47b09e[_0x1d8ac0(0x194)]['run'](_0x26bcc8,_0x4ce36e,{'sessionTime':_0xf9f836}),{'verbose':_0x3b1d14['verbose']}),_0x20a187=_0x2a12b3['data'];return console[_0x1d8ac0(0x187)]('✔\x20Workflow\x20run\x20started'),console[_0x1d8ac0(0x187)](_0x1d8ac0(0x17d)+_0x20a187['id']),console[_0x1d8ac0(0x187)](_0x1d8ac0(0x139)+_0x20a187[_0x1d8ac0(0x157)]),console['error'](_0x1d8ac0(0x198)+_0x20a187[_0x1d8ac0(0x161)]?.['name']),console[_0x1d8ac0(0x187)](_0x1d8ac0(0x16a)+_0x20a187['workflow']?.[_0x1d8ac0(0x159)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a39_0x495444(0x159)]=a39_0x495444(0x141);[a39_0x495444(0x128)]=a39_0x495444(0x1b2);async[a39_0x495444(0x11b)](_0x318beb){const _0x5aa383=a39_0x495444,{options:_0x430ec9,args:_0x1408de,tdx:_0x59dda5}=_0x318beb,_0x399201=_0x1408de[0x0],_0x58192d=_0x1408de[0x1]||'.';if(!_0x399201)return console[_0x5aa383(0x187)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x5aa383(0x187)](_0x5aa383(0x16f)),0x1;const _0x495592=_0x430ec9[_0x5aa383(0x15e)];_0x430ec9[_0x5aa383(0x134)]&&(console[_0x5aa383(0x187)](_0x5aa383(0x14c)+_0x399201),console['error'](_0x5aa383(0x156)+_0x58192d),_0x495592&&console[_0x5aa383(0x187)](_0x5aa383(0x19f)+_0x495592));const _0xa6dfde=await withSpinner(_0x5aa383(0x138)+_0x399201+_0x5aa383(0x1b3),()=>_0x59dda5[_0x5aa383(0x194)][_0x5aa383(0x119)](_0x399201,_0x58192d,{'revision':_0x495592}),{'verbose':_0x430ec9[_0x5aa383(0x134)]}),_0x5d94b9=_0xa6dfde['data'];return console[_0x5aa383(0x187)]('✔\x20Downloaded\x20'+_0x5d94b9[_0x5aa383(0x145)]),console[_0x5aa383(0x187)](_0x5aa383(0x109)+_0x5d94b9[_0x5aa383(0x15e)]),console[_0x5aa383(0x187)](_0x5aa383(0x10b)+_0x5d94b9[_0x5aa383(0x123)]),console[_0x5aa383(0x187)](_0x5aa383(0x17e)+_0x58192d+'/'+_0x5d94b9[_0x5aa383(0x145)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a39_0x495444(0x159)]=a39_0x495444(0x19c);[a39_0x495444(0x128)]=a39_0x495444(0x15b);async['execute'](_0x296c5f){const _0x304fdc=a39_0x495444,{options:_0x2b23f5,args:_0x259217,tdx:_0x5774ac}=_0x296c5f;let _0xa1ed3f='.',_0x544498=_0x2b23f5[_0x304fdc(0x159)];if(_0x259217[0x0]){const {promises:_0x1814b9}=await import('fs');try{const _0x8f6c3d=await _0x1814b9[_0x304fdc(0x1a8)](_0x259217[0x0]);if(_0x8f6c3d[_0x304fdc(0x175)]())_0xa1ed3f=_0x259217[0x0];else return console[_0x304fdc(0x187)]('Error:\x20'+_0x259217[0x0]+_0x304fdc(0x122)),0x1;}catch{_0x544498=_0x259217[0x0],_0xa1ed3f='.';}}const _0x44dfaa=_0x2b23f5[_0x304fdc(0x15e)],_0x3b34fd=_0x2b23f5[_0x304fdc(0x16e)];_0x2b23f5[_0x304fdc(0x134)]&&(console[_0x304fdc(0x187)](_0x304fdc(0x18e)+_0xa1ed3f),_0x544498&&console[_0x304fdc(0x187)]('Project\x20name:\x20'+_0x544498),_0x44dfaa&&console[_0x304fdc(0x187)](_0x304fdc(0x19f)+_0x44dfaa),_0x3b34fd&&console[_0x304fdc(0x187)](_0x304fdc(0x1a3)));const _0x237171=await withSpinner(_0x304fdc(0x146),()=>_0x5774ac['workflow'][_0x304fdc(0x148)](_0xa1ed3f,{'projectName':_0x544498,'revision':_0x44dfaa,'skipValidation':_0x3b34fd}),{'verbose':_0x2b23f5[_0x304fdc(0x134)]}),_0x501725=_0x237171[_0x304fdc(0x10a)];return console['error'](_0x304fdc(0x136)+_0x501725[_0x304fdc(0x145)]),console[_0x304fdc(0x187)](_0x304fdc(0x184)+_0x501725['projectId']),console[_0x304fdc(0x187)]('\x20\x20Revision:\x20'+_0x501725[_0x304fdc(0x15e)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a39_0x495444(0x159)]='workflow:delete';['description']=a39_0x495444(0x13b);async[a39_0x495444(0x11b)](_0x13c274){const _0x387f47=a39_0x495444,{options:_0x2b8cc2,args:_0x146990,tdx:_0x53aba9}=_0x13c274,_0x7f33dc=_0x146990[0x0];if(!_0x7f33dc)return console[_0x387f47(0x187)](_0x387f47(0x15d)),console[_0x387f47(0x187)](_0x387f47(0x142)),0x1;_0x2b8cc2[_0x387f47(0x134)]&&console[_0x387f47(0x187)](_0x387f47(0x14c)+_0x7f33dc);if(!_0x2b8cc2[_0x387f47(0x116)]){const _0x3ff1ec=await confirm(_0x387f47(0x1ac)+_0x7f33dc+_0x387f47(0x185));if(!_0x3ff1ec)return console['error'](_0x387f47(0x13a)),0x0;}const _0x4c3d4b=await withSpinner(_0x387f47(0x163)+_0x7f33dc+_0x387f47(0x1b3),()=>_0x53aba9[_0x387f47(0x194)][_0x387f47(0x174)](_0x7f33dc),{'verbose':_0x2b8cc2['verbose']}),_0x395671=_0x4c3d4b[_0x387f47(0x10a)];return console['error'](_0x387f47(0x117)+_0x395671[_0x387f47(0x145)]),console[_0x387f47(0x187)](_0x387f47(0x184)+_0x395671['projectId']),0x0;}}
1
+ const a39_0x4e4c1b=a39_0x5e09;(function(_0x2b66e2,_0x4b0832){const _0x2897e6=a39_0x5e09,_0x2d4fce=_0x2b66e2();while(!![]){try{const _0x5ca42d=parseInt(_0x2897e6(0xee))/0x1*(parseInt(_0x2897e6(0xc7))/0x2)+parseInt(_0x2897e6(0xe7))/0x3+-parseInt(_0x2897e6(0x100))/0x4+-parseInt(_0x2897e6(0xbe))/0x5*(-parseInt(_0x2897e6(0x124))/0x6)+parseInt(_0x2897e6(0x119))/0x7+-parseInt(_0x2897e6(0xbd))/0x8+parseInt(_0x2897e6(0x116))/0x9;if(_0x5ca42d===_0x4b0832)break;else _0x2d4fce['push'](_0x2d4fce['shift']());}catch(_0x30b4cc){_0x2d4fce['push'](_0x2d4fce['shift']());}}}(a39_0x5dd6,0x892ba));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_0x34e1af from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a39_0x4e4c1b(0xd5)]=a39_0x4e4c1b(0x10f);[a39_0x4e4c1b(0xb0)]=a39_0x4e4c1b(0x12d);async['execute'](_0x4265f7){const _0x30590c=a39_0x4e4c1b,{options:_0x4bda16,args:_0x143001,tdx:_0x43b51c}=_0x4265f7,_0x42c87b=_0x143001[0x0];try{_0x4bda16[_0x30590c(0xcc)]&&_0x42c87b&&console[_0x30590c(0x110)]('Pattern:\x20'+_0x42c87b);const _0x463eee=await withSpinner(_0x30590c(0x122),()=>_0x43b51c[_0x30590c(0x103)][_0x30590c(0xe3)](_0x42c87b,{'limit':_0x4bda16['limit']}),{'verbose':_0x4bda16[_0x30590c(0xcc)]}),_0x1c03c0=_0x463eee[_0x30590c(0x109)];return console[_0x30590c(0x110)](_0x30590c(0xb3)+_0x1c03c0['length']+_0x30590c(0x149)+(_0x1c03c0[_0x30590c(0x10b)]!==0x1?'s':'')),await handleSDKOutput(_0x1c03c0,_0x4bda16),0x0;}catch(_0x48eaea){if(_0x48eaea instanceof SDKError)return console[_0x30590c(0x110)](_0x30590c(0x118)+_0x48eaea[_0x30590c(0x11f)]),_0x48eaea[_0x30590c(0x102)]&&console[_0x30590c(0x110)](_0x30590c(0xc3)+_0x48eaea[_0x30590c(0x102)]),0x1;throw _0x48eaea;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a39_0x4e4c1b(0xd5)]=a39_0x4e4c1b(0xf2);[a39_0x4e4c1b(0xb0)]=a39_0x4e4c1b(0xfb);async[a39_0x4e4c1b(0xe6)](_0x59c7e6){const _0x218c0f=a39_0x4e4c1b,{options:_0x10bc76,args:_0x2d4f29,tdx:_0x2331ba}=_0x59c7e6,_0x12683f=_0x2d4f29[0x0];try{_0x10bc76[_0x218c0f(0xcc)]&&_0x12683f&&console[_0x218c0f(0x110)](_0x218c0f(0xd6)+_0x12683f);const _0x20ba1=await withSpinner('Listing\x20workflows...',()=>_0x2331ba[_0x218c0f(0x103)][_0x218c0f(0xae)](_0x12683f,{'limit':_0x10bc76[_0x218c0f(0x12b)]}),{'verbose':_0x10bc76[_0x218c0f(0xcc)]}),_0x550718=_0x20ba1[_0x218c0f(0x109)];return console[_0x218c0f(0x110)](_0x218c0f(0xb3)+_0x550718[_0x218c0f(0x10b)]+_0x218c0f(0xb5)+(_0x550718[_0x218c0f(0x10b)]!==0x1?'s':'')),await handleSDKOutput(_0x550718,_0x10bc76),0x0;}catch(_0x167703){if(_0x167703 instanceof SDKError)return console[_0x218c0f(0x110)](_0x218c0f(0x118)+_0x167703[_0x218c0f(0x11f)]),_0x167703[_0x218c0f(0x102)]&&console[_0x218c0f(0x110)](_0x218c0f(0xc3)+_0x167703[_0x218c0f(0x102)]),0x1;throw _0x167703;}}}export class WorkflowSessionsCommand extends BaseCommand{['name']=a39_0x4e4c1b(0x143);[a39_0x4e4c1b(0xb0)]=a39_0x4e4c1b(0x13a);async[a39_0x4e4c1b(0xe6)](_0x2279ed){const _0x2228d9=a39_0x4e4c1b,{options:_0x186f10,args:_0x1b3763,tdx:_0xfff9b5}=_0x2279ed;let _0x289230,_0x295577;if(_0x1b3763[0x0]){const _0x26412c=_0x1b3763[0x0][_0x2228d9(0x108)]('.');if(_0x26412c['length']===0x1)_0x289230=_0x26412c[0x0];else{if(_0x26412c[_0x2228d9(0x10b)]===0x2)[_0x289230,_0x295577]=_0x26412c;else return console[_0x2228d9(0x110)]('Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),0x1;}}try{if(_0x186f10[_0x2228d9(0xcc)]){if(_0x289230&&_0x295577)console[_0x2228d9(0x110)](_0x2228d9(0xe1)+_0x289230+'.'+_0x295577);else _0x289230&&console[_0x2228d9(0x110)](_0x2228d9(0xc6)+_0x289230);const _0x36ad6e=_0x186f10[_0x2228d9(0xff)];_0x36ad6e&&console[_0x2228d9(0x110)]('Status:\x20'+_0x36ad6e);}const _0x8858e7=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0xfff9b5[_0x2228d9(0x103)][_0x2228d9(0x13e)]({'projectName':_0x289230,'workflowName':_0x295577,'status':_0x186f10['status'],'fromTime':_0x186f10[_0x2228d9(0x135)],'toTime':_0x186f10['to'],'limit':_0x186f10[_0x2228d9(0x12b)]}),{'verbose':_0x186f10[_0x2228d9(0xcc)]}),_0x306190=_0x8858e7['data'];return console['error'](_0x2228d9(0xb3)+_0x306190[_0x2228d9(0x10b)]+'\x20session'+(_0x306190[_0x2228d9(0x10b)]!==0x1?'s':'')),await handleSDKOutput(_0x306190,_0x186f10),0x0;}catch(_0x56616d){if(_0x56616d instanceof SDKError)return console[_0x2228d9(0x110)](_0x2228d9(0x118)+_0x56616d[_0x2228d9(0x11f)]),_0x56616d[_0x2228d9(0x102)]&&console['error']('\x20\x20Cause:\x20'+_0x56616d[_0x2228d9(0x102)]),0x1;throw _0x56616d;}}}export class WorkflowAttemptsCommand extends BaseCommand{['name']=a39_0x4e4c1b(0x147);[a39_0x4e4c1b(0xb0)]='List\x20workflow\x20attempts';async[a39_0x4e4c1b(0xe6)](_0x590086){const _0x4d7f2f=a39_0x4e4c1b,{options:_0x43b478,args:_0x19e5d6,tdx:_0x26dc7f}=_0x590086;let _0xb6af3e,_0x5e694e;if(_0x19e5d6[0x0]){const _0x4f221d=_0x19e5d6[0x0][_0x4d7f2f(0x108)]('.');if(_0x4f221d['length']===0x1)_0xb6af3e=_0x4f221d[0x0];else{if(_0x4f221d[_0x4d7f2f(0x10b)]===0x2)[_0xb6af3e,_0x5e694e]=_0x4f221d;else return console[_0x4d7f2f(0x110)](_0x4d7f2f(0x132)),0x1;}}try{const _0x45b590=_0x43b478[_0x4d7f2f(0x133)];if(_0x43b478[_0x4d7f2f(0xcc)]){if(_0xb6af3e&&_0x5e694e)console['error'](_0x4d7f2f(0xe1)+_0xb6af3e+'.'+_0x5e694e);else _0xb6af3e&&console[_0x4d7f2f(0x110)](_0x4d7f2f(0xc6)+_0xb6af3e);_0x45b590&&console['error'](_0x4d7f2f(0x12e));}const _0x1bf344=await withSpinner(_0x4d7f2f(0xb2),()=>_0x26dc7f['workflow'][_0x4d7f2f(0x107)]({'projectName':_0xb6af3e,'workflowName':_0x5e694e,'includeRetried':_0x45b590,'limit':_0x43b478[_0x4d7f2f(0x12b)]}),{'verbose':_0x43b478[_0x4d7f2f(0xcc)]}),_0x25c99e=_0x1bf344[_0x4d7f2f(0x109)];return console['error'](_0x4d7f2f(0xb3)+_0x25c99e['length']+_0x4d7f2f(0xab)+(_0x25c99e[_0x4d7f2f(0x10b)]!==0x1?'s':'')),await handleSDKOutput(_0x25c99e,_0x43b478),0x0;}catch(_0x50d800){if(_0x50d800 instanceof SDKError)return console[_0x4d7f2f(0x110)]('Error:\x20'+_0x50d800[_0x4d7f2f(0x11f)]),_0x50d800['cause']&&console[_0x4d7f2f(0x110)](_0x4d7f2f(0xc3)+_0x50d800[_0x4d7f2f(0x102)]),0x1;throw _0x50d800;}}}export class WorkflowAttemptCommand extends BaseCommand{[a39_0x4e4c1b(0xd5)]=a39_0x4e4c1b(0xeb);[a39_0x4e4c1b(0xb0)]=a39_0x4e4c1b(0xbf);async[a39_0x4e4c1b(0xe6)](_0x1afaf4){const _0x6b57d7=a39_0x4e4c1b,{options:_0x19043f,args:_0x36c1ad,tdx:_0x27132c}=_0x1afaf4,_0x2c288f=_0x36c1ad[0x0];if(!_0x2c288f)return console[_0x6b57d7(0x110)](_0x6b57d7(0xd2)),0x1;try{_0x19043f['verbose']&&console[_0x6b57d7(0x110)](_0x6b57d7(0xad)+_0x2c288f);const _0x3571b6=await withSpinner('Getting\x20attempt\x20details...',()=>_0x27132c[_0x6b57d7(0x103)][_0x6b57d7(0x10a)](_0x2c288f),{'verbose':_0x19043f['verbose']}),_0x40c9ec=_0x3571b6[_0x6b57d7(0x109)];let _0x55b5bd;!_0x40c9ec[_0x6b57d7(0x125)]?_0x55b5bd=_0x40c9ec['cancelRequested']?_0x6b57d7(0xba):'running':_0x55b5bd=_0x40c9ec[_0x6b57d7(0x13f)]?'success':_0x6b57d7(0x110);let _0x565ab9;if(_0x40c9ec[_0x6b57d7(0xf0)]&&_0x40c9ec[_0x6b57d7(0xc4)]){const _0x1ae6f9=new Date(_0x40c9ec[_0x6b57d7(0xf0)])[_0x6b57d7(0x128)](),_0x500497=new Date(_0x40c9ec[_0x6b57d7(0xc4)])['getTime']();_0x565ab9=Math[_0x6b57d7(0x146)]((_0x500497-_0x1ae6f9)/0x3e8);}const _0x13ba41={'attempt_id':_0x40c9ec['id'],'status':_0x55b5bd,..._0x40c9ec[_0x6b57d7(0x127)]!==undefined&&{'index':_0x40c9ec[_0x6b57d7(0x127)]},..._0x40c9ec[_0x6b57d7(0xdc)]&&{'project':_0x40c9ec[_0x6b57d7(0xdc)][_0x6b57d7(0xd5)]},..._0x40c9ec[_0x6b57d7(0x103)]&&{'workflow':_0x40c9ec[_0x6b57d7(0x103)]['name']},..._0x40c9ec[_0x6b57d7(0xf1)]&&{'session_id':_0x40c9ec[_0x6b57d7(0xf1)]},..._0x40c9ec['sessionTime']&&{'session_time':_0x40c9ec['sessionTime']},..._0x40c9ec[_0x6b57d7(0x141)]&&{'retry_attempt':_0x40c9ec[_0x6b57d7(0x141)]},..._0x565ab9!==undefined&&{'duration_sec':_0x565ab9},..._0x40c9ec[_0x6b57d7(0xf0)]&&{'created_at':_0x40c9ec[_0x6b57d7(0xf0)]},..._0x40c9ec[_0x6b57d7(0xc4)]&&{'finished_at':_0x40c9ec[_0x6b57d7(0xc4)]},...Object[_0x6b57d7(0xe0)](_0x40c9ec['params'])[_0x6b57d7(0x10b)]>0x0&&{'params':_0x40c9ec[_0x6b57d7(0x11e)]}};return await handleSingleObjectOutput(_0x13ba41,_0x19043f),0x0;}catch(_0x30c515){if(_0x30c515 instanceof SDKError)return console[_0x6b57d7(0x110)](_0x6b57d7(0x118)+_0x30c515[_0x6b57d7(0x11f)]),_0x30c515[_0x6b57d7(0x102)]&&console[_0x6b57d7(0x110)](_0x6b57d7(0xc3)+_0x30c515['cause']),0x1;throw _0x30c515;}}}export class WorkflowTasksCommand extends BaseCommand{[a39_0x4e4c1b(0xd5)]=a39_0x4e4c1b(0xcd);[a39_0x4e4c1b(0xb0)]=a39_0x4e4c1b(0x152);async[a39_0x4e4c1b(0xe6)](_0x4f3ac6){const _0x462f86=a39_0x4e4c1b,{options:_0x395c14,args:_0x11db3a,tdx:_0x1e5f7e}=_0x4f3ac6,_0x229daf=_0x11db3a[0x0];if(!_0x229daf)return console[_0x462f86(0x110)](_0x462f86(0xd2)),0x1;try{const _0x31ba70=_0x395c14[_0x462f86(0x12c)];_0x395c14[_0x462f86(0xcc)]&&(console['error'](_0x462f86(0xad)+_0x229daf),_0x31ba70&&console['error'](_0x462f86(0x137)));const _0xae374c=await withSpinner(_0x462f86(0xc2),()=>_0x1e5f7e['workflow'][_0x462f86(0xd8)](_0x229daf,_0x31ba70||![]),{'verbose':_0x395c14[_0x462f86(0xcc)]}),_0x16a5eb=_0xae374c[_0x462f86(0x109)];return console[_0x462f86(0x110)](_0x462f86(0xb3)+_0x16a5eb['length']+_0x462f86(0x13b)+(_0x16a5eb['length']!==0x1?'s':'')),await handleSDKOutput(_0x16a5eb,_0x395c14),0x0;}catch(_0x4cb708){if(_0x4cb708 instanceof SDKError)return console[_0x462f86(0x110)](_0x462f86(0x118)+_0x4cb708[_0x462f86(0x11f)]),_0x4cb708[_0x462f86(0x102)]&&console[_0x462f86(0x110)](_0x462f86(0xc3)+_0x4cb708[_0x462f86(0x102)]),0x1;throw _0x4cb708;}}}export class WorkflowLogsCommand extends BaseCommand{[a39_0x4e4c1b(0xd5)]=a39_0x4e4c1b(0xd9);[a39_0x4e4c1b(0xb0)]=a39_0x4e4c1b(0x140);async[a39_0x4e4c1b(0xe6)](_0x1b5e60){const _0x466bc3=a39_0x4e4c1b,{options:_0x324539,args:_0x2baf15,tdx:_0x541b73}=_0x1b5e60,_0x145e04=_0x2baf15[0x0];let _0x1f1802=_0x2baf15[0x1];if(!_0x145e04)return console[_0x466bc3(0x110)](_0x466bc3(0xd2)),0x1;try{_0x324539[_0x466bc3(0xcc)]&&(console['error']('Attempt\x20ID:\x20'+_0x145e04),_0x1f1802&&console['error'](_0x466bc3(0x12f)+_0x1f1802));const _0x27eca8=await withSpinner(_0x466bc3(0x14d),()=>_0x541b73[_0x466bc3(0x103)][_0x466bc3(0xd3)](_0x145e04,_0x1f1802),{'verbose':_0x324539[_0x466bc3(0xcc)]}),_0x17af9c=_0x27eca8['data'];if(_0x17af9c[_0x466bc3(0x10b)]===0x0)return console[_0x466bc3(0x110)](_0x466bc3(0xc1)),0x0;if(!_0x1f1802&&(_0x324539[_0x466bc3(0xcb)]||_0x324539[_0x466bc3(0xdf)]))return await handleSDKOutput(_0x17af9c,_0x324539),0x0;if(!_0x1f1802){const _0x382e77=_0x17af9c['map'](_0x11b21d=>({'title':_0x11b21d[_0x466bc3(0xb9)]+'\x20('+formatBytes(_0x11b21d['fileSize'])+')','value':_0x11b21d['taskName']})),_0x1f1c16=await a39_0x34e1af({'type':'select','name':_0x466bc3(0xde),'message':_0x466bc3(0xb1),'choices':_0x382e77});if(!_0x1f1c16[_0x466bc3(0xde)])return console[_0x466bc3(0x110)](_0x466bc3(0xb6)),0x0;_0x1f1802=_0x1f1c16[_0x466bc3(0xde)];}const _0x374118=await withSpinner(_0x466bc3(0x129),()=>_0x541b73['workflow']['logs'](_0x145e04,_0x1f1802),{'verbose':_0x324539[_0x466bc3(0xcc)]}),_0x1d09a1=_0x374118[_0x466bc3(0x109)];return _0x1d09a1?console[_0x466bc3(0x14e)](_0x1d09a1):console[_0x466bc3(0x110)](_0x466bc3(0x144)),0x0;}catch(_0x36f0c1){if(_0x36f0c1 instanceof SDKError)return console[_0x466bc3(0x110)](_0x466bc3(0x118)+_0x36f0c1['message']),_0x36f0c1[_0x466bc3(0x102)]&&console[_0x466bc3(0x110)]('\x20\x20Cause:\x20'+_0x36f0c1[_0x466bc3(0x102)]),0x1;throw _0x36f0c1;}}}function a39_0x5e09(_0x36fcc6,_0x4ac9a1){const _0x5dd61c=a39_0x5dd6();return a39_0x5e09=function(_0x5e0985,_0xd3e7c){_0x5e0985=_0x5e0985-0xa9;let _0x2e7616=_0x5dd61c[_0x5e0985];return _0x2e7616;},a39_0x5e09(_0x36fcc6,_0x4ac9a1);}export class WorkflowKillCommand extends BaseCommand{['name']=a39_0x4e4c1b(0x142);['description']=a39_0x4e4c1b(0xc5);async[a39_0x4e4c1b(0xe6)](_0x4eb38e){const _0xc77a65=a39_0x4e4c1b,{options:_0x324fd5,args:_0x3a8993,tdx:_0x4dc401}=_0x4eb38e,_0x4586a2=_0x3a8993[0x0];if(!_0x4586a2)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x94166c=_0x324fd5[_0xc77a65(0xa9)];_0x324fd5[_0xc77a65(0xcc)]&&(console[_0xc77a65(0x110)]('Attempt\x20ID:\x20'+_0x4586a2),_0x94166c&&console[_0xc77a65(0x110)](_0xc77a65(0x145)+_0x94166c));if(!_0x324fd5['yes']){const _0x2e533c=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x4586a2+'?');if(!_0x2e533c)return console[_0xc77a65(0x110)](_0xc77a65(0xb6)),0x0;}const _0x4cbca7=await withSpinner(_0xc77a65(0xb4),()=>_0x4dc401[_0xc77a65(0x103)][_0xc77a65(0x14b)](_0x4586a2,_0x94166c),{'verbose':_0x324fd5['verbose']}),_0x2986f9=_0x4cbca7['data'];return console[_0xc77a65(0x110)]('✔\x20'+_0x2986f9),0x0;}catch(_0x20dd87){if(_0x20dd87 instanceof SDKError)return console['error'](_0xc77a65(0x118)+_0x20dd87[_0xc77a65(0x11f)]),_0x20dd87[_0xc77a65(0x102)]&&console[_0xc77a65(0x110)]('\x20\x20Cause:\x20'+_0x20dd87[_0xc77a65(0x102)]),0x1;throw _0x20dd87;}}}export class WorkflowRetryCommand extends BaseCommand{[a39_0x4e4c1b(0xd5)]='workflow:retry';[a39_0x4e4c1b(0xb0)]=a39_0x4e4c1b(0x11c);async[a39_0x4e4c1b(0xe6)](_0x2360c0){const _0x274594=a39_0x4e4c1b,{options:_0x231983,args:_0x3a45f9,tdx:_0x27e98f}=_0x2360c0,_0x356a68=_0x3a45f9[0x0];if(!_0x356a68)return console[_0x274594(0x110)](_0x274594(0x111)),console[_0x274594(0x110)](_0x274594(0x123)),0x1;let _0x13595e=![],_0x3eb9c6=_0x356a68;if(_0x356a68[_0x274594(0x120)]('session:'))_0x13595e=!![],_0x3eb9c6=_0x356a68[_0x274594(0x136)](0x8);else{if(_0x356a68[_0x274594(0x120)](_0x274594(0xac)))_0x13595e=![],_0x3eb9c6=_0x356a68['substring'](0x8);else return console[_0x274594(0x110)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0x274594(0x110)](_0x274594(0x123)),0x1;}try{const _0x5a44b8=_0x231983[_0x274594(0x126)],_0x5acf5a=_0x231983[_0x274594(0xea)],_0x2e3e7a=_0x231983[_0x274594(0x11e)],_0x242d27=_0x231983[_0x274594(0xaf)];_0x231983[_0x274594(0xcc)]&&(console[_0x274594(0x110)](_0x274594(0x14f)+(_0x13595e?_0x274594(0x153):_0x274594(0x10a))+'\x20'+_0x3eb9c6),_0x5a44b8&&console[_0x274594(0x110)](_0x274594(0xf7)+_0x5a44b8),_0x5acf5a&&console['error'](_0x274594(0xb7)+_0x5acf5a),_0x2e3e7a&&console['error'](_0x274594(0xbc)+_0x2e3e7a),_0x242d27&&console[_0x274594(0x110)](_0x274594(0xf8)));let _0x4ff72d;if(_0x2e3e7a)try{if(_0x2e3e7a[_0x274594(0x120)]('@')){const _0x22e8f2=await import(_0x274594(0x139)),_0x504dee=_0x2e3e7a[_0x274594(0x136)](0x1),_0x2ed75c=await _0x22e8f2[_0x274594(0x130)](_0x504dee,_0x274594(0xd7));_0x4ff72d=JSON[_0x274594(0xc8)](_0x2ed75c);}else _0x4ff72d=JSON[_0x274594(0xc8)](_0x2e3e7a);}catch{return console[_0x274594(0x110)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x231983[_0x274594(0xcf)]){const _0x208ea9=await confirm(_0x274594(0xce)+(_0x13595e?_0x274594(0x153):_0x274594(0x10a))+'\x20'+_0x3eb9c6+'?');if(!_0x208ea9)return console[_0x274594(0x110)](_0x274594(0xb6)),0x0;}let _0x3e1780;_0x13595e?_0x3e1780=await withSpinner(_0x274594(0x13d),()=>_0x27e98f['workflow'][_0x274594(0x104)](_0x3eb9c6,{'fromTask':_0x5a44b8,'retryParams':_0x4ff72d}),{'verbose':_0x231983[_0x274594(0xcc)]}):_0x3e1780=await withSpinner(_0x274594(0xd0),()=>_0x27e98f[_0x274594(0x103)][_0x274594(0xfa)](_0x3eb9c6,{'resumeFrom':_0x5acf5a,'retryParams':_0x4ff72d,'force':_0x242d27}),{'verbose':_0x231983[_0x274594(0xcc)]});const _0x424f15=_0x3e1780[_0x274594(0x109)];return console[_0x274594(0x110)]('✔\x20Retry\x20started'),console[_0x274594(0x110)](_0x274594(0x10c)+_0x424f15[_0x274594(0x14a)]),console[_0x274594(0x110)](_0x274594(0xed)+_0x424f15[_0x274594(0xf1)]),0x0;}catch(_0x9b8118){if(_0x9b8118 instanceof SDKError)return console[_0x274594(0x110)](_0x274594(0x118)+_0x9b8118[_0x274594(0x11f)]),_0x9b8118[_0x274594(0x102)]&&console['error'](_0x274594(0xc3)+_0x9b8118[_0x274594(0x102)]),0x1;throw _0x9b8118;}}}export class WorkflowRunCommand extends BaseCommand{[a39_0x4e4c1b(0xd5)]='workflow:run';[a39_0x4e4c1b(0xb0)]=a39_0x4e4c1b(0x138);async[a39_0x4e4c1b(0xe6)](_0x55ec11){const _0x32e847=a39_0x4e4c1b,{options:_0x518a52,args:_0x2ceb55,tdx:_0x48ec82}=_0x55ec11,_0x45f675=_0x2ceb55[0x0];if(!_0x45f675)return console[_0x32e847(0x110)](_0x32e847(0x105)),console[_0x32e847(0x110)](_0x32e847(0x13c)),0x1;const _0xa88616=_0x518a52[_0x32e847(0xda)],_0x4e5fa6=_0x518a52[_0x32e847(0x10e)],_0x298509={};if(_0xa88616&&Array[_0x32e847(0xf3)](_0xa88616))for(const _0x115fa3 of _0xa88616){const _0x5c0b3d=_0x115fa3[_0x32e847(0xf5)]('=');if(_0x5c0b3d===-0x1)return console[_0x32e847(0x110)](_0x32e847(0xd1)+_0x115fa3),console['error']('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x1b49c2=_0x115fa3[_0x32e847(0x136)](0x0,_0x5c0b3d),_0x546294=_0x115fa3['substring'](_0x5c0b3d+0x1);try{_0x298509[_0x1b49c2]=JSON[_0x32e847(0xc8)](_0x546294);}catch{_0x298509[_0x1b49c2]=_0x546294;}}_0x518a52[_0x32e847(0xcc)]&&(console[_0x32e847(0x110)](_0x32e847(0xe9)+_0x45f675),Object[_0x32e847(0xe0)](_0x298509)[_0x32e847(0x10b)]>0x0&&console[_0x32e847(0x110)](_0x32e847(0x11a)+JSON[_0x32e847(0x150)](_0x298509)),_0x4e5fa6&&console[_0x32e847(0x110)]('Session\x20time:\x20'+_0x4e5fa6));const _0x594f44=await withSpinner('Starting\x20workflow\x20run...',()=>_0x48ec82[_0x32e847(0x103)][_0x32e847(0x131)](_0x45f675,_0x298509,{'sessionTime':_0x4e5fa6}),{'verbose':_0x518a52[_0x32e847(0xcc)]}),_0x1f8b99=_0x594f44[_0x32e847(0x109)];return console[_0x32e847(0x110)](_0x32e847(0x113)),console[_0x32e847(0x110)](_0x32e847(0xfc)+_0x1f8b99['id']),console[_0x32e847(0x110)]('\x20\x20Session\x20ID:\x20'+_0x1f8b99[_0x32e847(0xf1)]),console['error'](_0x32e847(0xc0)+_0x1f8b99[_0x32e847(0xdc)]?.[_0x32e847(0xd5)]),console[_0x32e847(0x110)]('\x20\x20Workflow:\x20'+_0x1f8b99[_0x32e847(0x103)]?.['name']),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a39_0x4e4c1b(0x134);[a39_0x4e4c1b(0xb0)]=a39_0x4e4c1b(0x14c);async[a39_0x4e4c1b(0xe6)](_0x442b0f){const _0x5924ff=a39_0x4e4c1b,{options:_0x425a89,args:_0x57afea,tdx:_0xc122be}=_0x442b0f,_0x390742=_0x57afea[0x0],_0x589c2c=_0x57afea[0x1]||'.';if(!_0x390742)return console[_0x5924ff(0x110)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x5924ff(0x110)](_0x5924ff(0xaa)),0x1;const _0x5454da=_0x425a89['revision'];_0x425a89[_0x5924ff(0xcc)]&&(console[_0x5924ff(0x110)](_0x5924ff(0xca)+_0x390742),console[_0x5924ff(0x110)](_0x5924ff(0xd4)+_0x589c2c),_0x5454da&&console[_0x5924ff(0x110)](_0x5924ff(0xf6)+_0x5454da));const _0x169095=await withSpinner(_0x5924ff(0xfe)+_0x390742+_0x5924ff(0xdd),()=>_0xc122be[_0x5924ff(0x103)][_0x5924ff(0xfd)](_0x390742,_0x589c2c,{'revision':_0x5454da}),{'verbose':_0x425a89[_0x5924ff(0xcc)]}),_0x4f6cd0=_0x169095['data'];return console['error'](_0x5924ff(0x11d)+_0x4f6cd0[_0x5924ff(0x115)]),console[_0x5924ff(0x110)]('\x20\x20Revision:\x20'+_0x4f6cd0[_0x5924ff(0x12a)]),console['error']('\x20\x20Files\x20extracted:\x20'+_0x4f6cd0[_0x5924ff(0xe8)]),console[_0x5924ff(0x110)](_0x5924ff(0xef)+_0x589c2c+'/'+_0x4f6cd0['projectName']),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a39_0x4e4c1b(0xd5)]=a39_0x4e4c1b(0x117);['description']='Push\x20workflow\x20project\x20to\x20Treasure\x20Data';async['execute'](_0x209283){const _0x5a5c25=a39_0x4e4c1b,{options:_0x2c041d,args:_0x148e80,tdx:_0x306639}=_0x209283;let _0x244dc8='.',_0x131857=_0x2c041d[_0x5a5c25(0xd5)];if(_0x148e80[0x0]){const {promises:_0x9eb4cf}=await import('fs');try{const _0x4d43a0=await _0x9eb4cf[_0x5a5c25(0x106)](_0x148e80[0x0]);if(_0x4d43a0[_0x5a5c25(0xe4)]())_0x244dc8=_0x148e80[0x0];else return console['error'](_0x5a5c25(0x118)+_0x148e80[0x0]+_0x5a5c25(0xe2)),0x1;}catch{_0x131857=_0x148e80[0x0],_0x244dc8='.';}}const _0x6ffbcc=_0x2c041d['revision'],_0x4668be=_0x2c041d[_0x5a5c25(0x114)];_0x2c041d[_0x5a5c25(0xcc)]&&(console[_0x5a5c25(0x110)](_0x5a5c25(0xe5)+_0x244dc8),_0x131857&&console[_0x5a5c25(0x110)](_0x5a5c25(0xec)+_0x131857),_0x6ffbcc&&console[_0x5a5c25(0x110)](_0x5a5c25(0xf6)+_0x6ffbcc),_0x4668be&&console[_0x5a5c25(0x110)](_0x5a5c25(0x101)));const _0x12d2fe=await withSpinner(_0x5a5c25(0x121),()=>_0x306639['workflow'][_0x5a5c25(0x112)](_0x244dc8,{'projectName':_0x131857,'revision':_0x6ffbcc,'skipValidation':_0x4668be}),{'verbose':_0x2c041d[_0x5a5c25(0xcc)]}),_0x595090=_0x12d2fe['data'];return console[_0x5a5c25(0x110)]('✔\x20Pushed\x20'+_0x595090['projectName']),console[_0x5a5c25(0x110)](_0x5a5c25(0xdb)+_0x595090[_0x5a5c25(0xbb)]),console['error'](_0x5a5c25(0xf9)+_0x595090['revision']),0x0;}}function a39_0x5dd6(){const _0x129b77=['Error:\x20Workflow\x20identifier\x20is\x20required','stat','attempts','split','data','attempt','length','\x20\x20New\x20attempt\x20ID:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','sessionTime','workflow:projects','error','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','push','✔\x20Workflow\x20run\x20started','skipValidation','projectName','415809KbezRq','workflow:push','Error:\x20','6505702ZeVzzn','Parameters:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Retry\x20a\x20session\x20or\x20attempt','✔\x20Downloaded\x20','params','message','startsWith','Pushing\x20workflow\x20project...','Listing\x20workflow\x20projects...','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','57642RFdebj','done','fromTask','index','getTime','Downloading\x20logs...','revision','limit','includeSubtasks','List\x20all\x20workflow\x20projects','Include\x20retried:\x20yes','Task\x20name:\x20','readFile','run','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','includeRetried','workflow:download','from','substring','Including\x20subtasks:\x20yes','Start\x20a\x20workflow\x20run','fs/promises','List\x20workflow\x20execution\x20sessions','\x20task','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','Retrying\x20session...','sessions','success','Show\x20logs\x20for\x20a\x20workflow\x20attempt','retryAttemptName','workflow:kill','workflow:sessions','No\x20log\x20content\x20found','Reason:\x20','round','workflow:attempts','delete','\x20project','attemptId','kill','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Fetching\x20log\x20files...','log','Target:\x20','stringify','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Show\x20tasks\x20for\x20an\x20attempt','session','reason','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','\x20attempt','attempt:','Attempt\x20ID:\x20','workflows','force','description','Select\x20a\x20task\x20to\x20view\x20logs:','Listing\x20workflow\x20attempts...','✔\x20Found\x20','Killing\x20attempt...','\x20workflow','Cancelled','Resume\x20from:\x20','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','taskName','canceling','projectId','Params:\x20','7696472YFdQfI','75WVtImN','Show\x20specific\x20attempt\x20details','\x20\x20Project:\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Getting\x20attempt\x20tasks...','\x20\x20Cause:\x20','finishedAt','Kill\x20a\x20running\x20attempt','Filter:\x20project=','1321034ffwjin','parse','workflow:delete','Project:\x20','json','verbose','workflow:tasks','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','yes','Retrying\x20attempt...','Error:\x20Invalid\x20parameter\x20format:\x20','Error:\x20Attempt\x20ID\x20is\x20required','logFiles','Output\x20directory:\x20','name','Project\x20filter:\x20','utf-8','tasks','workflow:logs','param','\x20\x20Project\x20ID:\x20','project','...','task','format','keys','Filter:\x20','\x20is\x20not\x20a\x20directory','projects','isDirectory','Project\x20directory:\x20','execute','2124708arloxK','filesExtracted','Workflow:\x20','resumeFrom','workflow:attempt','Project\x20name:\x20','\x20\x20Session\x20ID:\x20','1giXXzZ','\x20\x20Location:\x20','createdAt','sessionId','workflow:workflows','isArray','Usage:\x20workflow:delete\x20<project-name-or-id>','indexOf','Revision:\x20','From\x20task:\x20','Force:\x20yes','\x20\x20Revision:\x20','retryAttempt','List\x20workflows','\x20\x20Attempt\x20ID:\x20','download','Downloading\x20project\x20','status','3858144rLixOf','Validation:\x20skipped','cause','workflow','retrySession'];a39_0x5dd6=function(){return _0x129b77;};return a39_0x5dd6();}export class WorkflowDeleteCommand extends BaseCommand{[a39_0x4e4c1b(0xd5)]=a39_0x4e4c1b(0xc9);[a39_0x4e4c1b(0xb0)]=a39_0x4e4c1b(0x11b);async[a39_0x4e4c1b(0xe6)](_0x95820b){const _0x2a5599=a39_0x4e4c1b,{options:_0x34f149,args:_0x4136d2,tdx:_0x4eae24}=_0x95820b,_0x5cda63=_0x4136d2[0x0];if(!_0x5cda63)return console['error'](_0x2a5599(0xb8)),console['error'](_0x2a5599(0xf4)),0x1;_0x34f149['verbose']&&console[_0x2a5599(0x110)](_0x2a5599(0xca)+_0x5cda63);if(!_0x34f149['yes']){const _0x540e5f=await confirm(_0x2a5599(0x151)+_0x5cda63+_0x2a5599(0x10d));if(!_0x540e5f)return console[_0x2a5599(0x110)](_0x2a5599(0xb6)),0x0;}const _0x247118=await withSpinner('Deleting\x20project\x20'+_0x5cda63+_0x2a5599(0xdd),()=>_0x4eae24[_0x2a5599(0x103)][_0x2a5599(0x148)](_0x5cda63),{'verbose':_0x34f149[_0x2a5599(0xcc)]}),_0x5c3aa3=_0x247118[_0x2a5599(0x109)];return console['error']('✔\x20Deleted\x20project\x20'+_0x5c3aa3[_0x2a5599(0x115)]),console['error'](_0x2a5599(0xdb)+_0x5c3aa3['projectId']),0x0;}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x5f1c02,_0x4db5ff){const _0xe75d86=a40_0x225d,_0x330b93=_0x5f1c02();while(!![]){try{const _0xb10d1a=-parseInt(_0xe75d86(0x1e8))/0x1*(-parseInt(_0xe75d86(0x1e1))/0x2)+-parseInt(_0xe75d86(0x1d7))/0x3*(-parseInt(_0xe75d86(0x1e7))/0x4)+-parseInt(_0xe75d86(0x1e2))/0x5+parseInt(_0xe75d86(0x1d6))/0x6*(parseInt(_0xe75d86(0x1da))/0x7)+parseInt(_0xe75d86(0x1df))/0x8+parseInt(_0xe75d86(0x1de))/0x9*(-parseInt(_0xe75d86(0x1d8))/0xa)+parseInt(_0xe75d86(0x1e3))/0xb;if(_0xb10d1a===_0x4db5ff)break;else _0x330b93['push'](_0x330b93['shift']());}catch(_0x1b7d7b){_0x330b93['push'](_0x330b93['shift']());}}}(a40_0x3999,0xeb783));import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';function a40_0x3999(){const _0x3e35da=['891284khVIcx','1303669RQWxaL','entries','version','utf-8','TD1\x20','4795338RRnUVm','3EbMqtb','1860okkTec','tdx','7jrCTwi','url','parse','X-Trino-User','80451KxklNe','873832mfmMnw','tdx/','2qFwRVH','8086350dxHpQT','19904115AcfrDC','0.0.0','Authorization','length'];a40_0x3999=function(){return _0x3e35da;};return a40_0x3999();}function a40_0x225d(_0x4394f7,_0x4bf0b6){const _0x399963=a40_0x3999();return a40_0x225d=function(_0x225d64,_0x55e74e){_0x225d64=_0x225d64-0x1d4;let _0x3473f6=_0x399963[_0x225d64];return _0x3473f6;},a40_0x225d(_0x4394f7,_0x4bf0b6);}import{getAPIKey}from'./config.js';export function getVersion(){const _0x3eae75=a40_0x225d;try{const _0x36daba=fileURLToPath(import.meta[_0x3eae75(0x1db)]),_0x1bad25=dirname(_0x36daba),_0x4b0f14=join(_0x1bad25,'../../package.json'),_0x2fd6fb=JSON[_0x3eae75(0x1dc)](readFileSync(_0x4b0f14,_0x3eae75(0x1d4)));return _0x2fd6fb['version'];}catch{return _0x3eae75(0x1e4);}}export function getUserAgent(){const _0x2b4f00=a40_0x225d,_0x16f12c=getVersion(),_0x388d88=platform(),_0x268acd=process[_0x2b4f00(0x1ea)]['replace']('v','');return _0x2b4f00(0x1e0)+_0x16f12c+'\x20('+_0x388d88+';\x20node/'+_0x268acd+')';}export function getAuthHeaders(_0x18793b,_0x5c1f86){const _0x454614=a40_0x225d,_0x1dab17=getVersion(),_0x44c687={'User-Agent':getUserAgent(),'X-TD-Client':_0x454614(0x1d9),'X-TD-Client-Version':_0x1dab17};return _0x5c1f86&&(_0x44c687['Authorization']=_0x454614(0x1d5)+_0x5c1f86),_0x44c687;}export function toHeaderRecord(_0x3d10f3){const _0x202eda=a40_0x225d,_0x502982={};for(const [_0x511f1c,_0x3aa3d2]of Object[_0x202eda(0x1e9)](_0x3d10f3)){_0x3aa3d2!==undefined&&(_0x502982[_0x511f1c]=_0x3aa3d2);}return _0x502982;}export function getTrinoHeaders(_0x3e10cf,_0x118a02){const _0x363d25=a40_0x225d,_0x5db555=getAuthHeaders(_0x3e10cf,_0x118a02),_0x6c9857=toHeaderRecord(_0x5db555);return delete _0x6c9857[_0x363d25(0x1e5)],_0x118a02&&(_0x6c9857[_0x363d25(0x1dd)]=_0x118a02),_0x6c9857;}export function hasAPIKey(_0x2ab51a){const _0x163ad7=a40_0x225d,_0x35940d=getAPIKey(_0x2ab51a);return _0x35940d!==undefined&&_0x35940d[_0x163ad7(0x1e6)]>0x0;}
1
+ function a40_0x1ec9(_0x11063d,_0x4a468b){const _0x4a5074=a40_0x4a50();return a40_0x1ec9=function(_0x1ec982,_0x3f3c92){_0x1ec982=_0x1ec982-0xa7;let _0x76640c=_0x4a5074[_0x1ec982];return _0x76640c;},a40_0x1ec9(_0x11063d,_0x4a468b);}(function(_0x2f1e7b,_0x1359dd){const _0x22bceb=a40_0x1ec9,_0x4fbee7=_0x2f1e7b();while(!![]){try{const _0x2b947a=parseInt(_0x22bceb(0xab))/0x1*(-parseInt(_0x22bceb(0xb7))/0x2)+-parseInt(_0x22bceb(0xbf))/0x3*(parseInt(_0x22bceb(0xae))/0x4)+parseInt(_0x22bceb(0xbb))/0x5*(-parseInt(_0x22bceb(0xb8))/0x6)+parseInt(_0x22bceb(0xad))/0x7+parseInt(_0x22bceb(0xb3))/0x8*(parseInt(_0x22bceb(0xbe))/0x9)+-parseInt(_0x22bceb(0xbc))/0xa*(parseInt(_0x22bceb(0xba))/0xb)+parseInt(_0x22bceb(0xb5))/0xc*(parseInt(_0x22bceb(0xaf))/0xd);if(_0x2b947a===_0x1359dd)break;else _0x4fbee7['push'](_0x4fbee7['shift']());}catch(_0x465b47){_0x4fbee7['push'](_0x4fbee7['shift']());}}}(a40_0x4a50,0x9e634));import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';function a40_0x4a50(){const _0x344625=['1638455DeVlFI','787292HMjaoj','38357007APFcHL',';\x20node/','utf-8','TD1\x20','9816qqLXUP','../../package.json','12jqvjSg','Authorization','1257518ZyPNSJ','4441542tcRIAo','replace','1353nuXdBy','5mTsFqP','81950PPZqBX','length','7497HhxkqX','18wSaFRP','version','X-Trino-User','0.0.0','tdx','1sbCHmf','parse'];a40_0x4a50=function(){return _0x344625;};return a40_0x4a50();}import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x3c2c86=a40_0x1ec9;try{const _0x3e0b7b=fileURLToPath(import.meta['url']),_0x53b0a0=dirname(_0x3e0b7b),_0x3798a7=join(_0x53b0a0,_0x3c2c86(0xb4)),_0x46e819=JSON[_0x3c2c86(0xac)](readFileSync(_0x3798a7,_0x3c2c86(0xb1)));return _0x46e819[_0x3c2c86(0xa7)];}catch{return _0x3c2c86(0xa9);}}export function getUserAgent(){const _0x364365=a40_0x1ec9,_0x373dc0=getVersion(),_0x1d904b=platform(),_0x8fb5c8=process[_0x364365(0xa7)][_0x364365(0xb9)]('v','');return'tdx/'+_0x373dc0+'\x20('+_0x1d904b+_0x364365(0xb0)+_0x8fb5c8+')';}export function getAuthHeaders(_0x27da04,_0x5610cf){const _0x2b8619=a40_0x1ec9,_0x479352=getVersion(),_0x41eaa8={'User-Agent':getUserAgent(),'X-TD-Client':_0x2b8619(0xaa),'X-TD-Client-Version':_0x479352};return _0x5610cf&&(_0x41eaa8[_0x2b8619(0xb6)]=_0x2b8619(0xb2)+_0x5610cf),_0x41eaa8;}export function toHeaderRecord(_0x44612b){const _0x5c3255={};for(const [_0x3afad0,_0x3487a5]of Object['entries'](_0x44612b)){_0x3487a5!==undefined&&(_0x5c3255[_0x3afad0]=_0x3487a5);}return _0x5c3255;}export function getTrinoHeaders(_0x5209ef,_0xafa042){const _0x303430=a40_0x1ec9,_0xdc9535=getAuthHeaders(_0x5209ef,_0xafa042),_0x5eb84b=toHeaderRecord(_0xdc9535);return delete _0x5eb84b[_0x303430(0xb6)],_0xafa042&&(_0x5eb84b[_0x303430(0xa8)]=_0xafa042),_0x5eb84b;}export function hasAPIKey(_0x3afd89){const _0x312126=a40_0x1ec9,_0x5dc949=getAPIKey(_0x3afd89);return _0x5dc949!==undefined&&_0x5dc949[_0x312126(0xbd)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x54ed9f,_0x1a7c88){const _0x42b903=a41_0x833a,_0x1a8387=_0x54ed9f();while(!![]){try{const _0x3333c9=parseInt(_0x42b903(0xe2))/0x1+parseInt(_0x42b903(0xe1))/0x2+parseInt(_0x42b903(0xd8))/0x3+-parseInt(_0x42b903(0xe7))/0x4+-parseInt(_0x42b903(0xfd))/0x5+parseInt(_0x42b903(0x109))/0x6+-parseInt(_0x42b903(0xeb))/0x7;if(_0x3333c9===_0x1a7c88)break;else _0x1a8387['push'](_0x1a8387['shift']());}catch(_0x22c090){_0x1a8387['push'](_0x1a8387['shift']());}}}(a41_0x3883,0x1e1c5));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a41_0x203c3e from'node:fs';import*as a41_0x5bfa4e from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a41_0x400bbb from'chalk';export function getConfigDir(){const _0xa56b6d=a41_0x833a;return process[_0xa56b6d(0x118)][_0xa56b6d(0xf9)]||join(homedir(),_0xa56b6d(0xf2),_0xa56b6d(0xe8));}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getConfigFilePath(_0x48b245){const _0x58ad22=a41_0x833a,_0x553bea=getConfigDir();return _0x48b245?a41_0x5bfa4e[_0x58ad22(0xf8)](_0x553bea,_0x58ad22(0x110)+_0x48b245):getConfigFile();}export function getCacheDir(){const _0x7d2f7d=a41_0x833a;return process[_0x7d2f7d(0x118)][_0x7d2f7d(0x10f)]||join(homedir(),_0x7d2f7d(0xe4),_0x7d2f7d(0xe8));}export function getLLMProjectCacheFile(_0x535758){const _0x3cb794=a41_0x833a,_0x96ee97=_0x535758?_0x3cb794(0xde)+_0x535758:_0x3cb794(0xe9);return join(getCacheDir(),_0x96ee97);}export function readCachedLLMProject(_0x2a31ab){const _0x539f8c=a41_0x833a;try{const _0x4f3cf5=getLLMProjectCacheFile(_0x2a31ab);if(!existsSync(_0x4f3cf5))return null;const _0x50221b=readFileSync(_0x4f3cf5,_0x539f8c(0x116))[_0x539f8c(0xf4)]();try{const _0x2c6e43=JSON[_0x539f8c(0xdc)](_0x50221b);if(_0x2c6e43&&typeof _0x2c6e43['id']===_0x539f8c(0xef)&&typeof _0x2c6e43['name']===_0x539f8c(0xef))return _0x2c6e43;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x4931d0,_0x279047,_0x56ed59){const _0x5af5e6=a41_0x833a;try{const _0x549eb9=getCacheDir(),_0x276fb9=getLLMProjectCacheFile(_0x56ed59);!existsSync(_0x549eb9)&&mkdirSync(_0x549eb9,{'recursive':!![]});const _0x2f9a67={'name':_0x4931d0,'id':_0x279047};writeFileSync(_0x276fb9,JSON['stringify'](_0x2f9a67),_0x5af5e6(0x116));}catch{}}function a41_0x833a(_0x42da7e,_0x3188dc){const _0x3883ec=a41_0x3883();return a41_0x833a=function(_0x833a1e,_0x80b4e2){_0x833a1e=_0x833a1e-0xd7;let _0x136f3d=_0x3883ec[_0x833a1e];return _0x136f3d;},a41_0x833a(_0x42da7e,_0x3188dc);}export function parseEnvFile(_0x217744){const _0x2c1ec6=a41_0x833a,_0x393c8a={};for(const _0x5c3af6 of _0x217744[_0x2c1ec6(0x100)]('\x0a')){const _0x4e19e7=_0x5c3af6[_0x2c1ec6(0xf4)]();if(!_0x4e19e7||_0x4e19e7['startsWith']('#'))continue;const _0x3e877c=_0x4e19e7['match'](/^([^=]+)=(.*)$/);if(_0x3e877c){const _0x30e303=_0x3e877c[0x1][_0x2c1ec6(0xf4)]();let _0x3373e7=_0x3e877c[0x2][_0x2c1ec6(0xf4)]();(_0x3373e7[_0x2c1ec6(0x10c)]('\x22')&&_0x3373e7[_0x2c1ec6(0x101)]('\x22')||_0x3373e7['startsWith']('\x27')&&_0x3373e7[_0x2c1ec6(0x101)]('\x27'))&&(_0x3373e7=_0x3373e7[_0x2c1ec6(0x102)](0x1,-0x1)),_0x393c8a[_0x30e303]=_0x3373e7;}}return _0x393c8a;}export function readUserConfig(){const _0x171903=a41_0x833a,_0x1030aa=getConfigFile();if(!existsSync(_0x1030aa))return{};try{const _0x2aaf21=readFileSync(_0x1030aa,_0x171903(0x116));return parseEnvFile(_0x2aaf21);}catch(_0x1198ea){return console[_0x171903(0x107)](_0x171903(0xe5)+_0x1030aa+':',_0x1198ea),{};}}export function resolveSite(_0x57ecf0){const _0xbcd862=a41_0x833a,_0x3c218f=[_0xbcd862(0x111),'jp01','eu01',_0xbcd862(0xee),_0xbcd862(0xd7),_0xbcd862(0xea),_0xbcd862(0xfe),'stg-us01',_0xbcd862(0xf1),_0xbcd862(0xf6)];if(_0x3c218f['includes'](_0x57ecf0))return _0x57ecf0;if(_0x57ecf0 in SITE_ALIASES)return SITE_ALIASES[_0x57ecf0];return console[_0xbcd862(0x107)]('Warning:\x20Unknown\x20site\x20\x27'+_0x57ecf0+_0xbcd862(0x112)),_0xbcd862(0x111);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x12bf30,_0x232627){const _0x198e2d=a41_0x833a,_0x4629ab=_0x232627||getActiveProfileName();if(_0x4629ab){const _0x16d445='TDX_API_KEY_'+normalizeProfileForEnvVar(_0x4629ab);if(process['env'][_0x16d445])return process[_0x198e2d(0x118)][_0x16d445];}if(process[_0x198e2d(0x118)][_0x198e2d(0x10d)])return process[_0x198e2d(0x118)][_0x198e2d(0x10d)];if(process[_0x198e2d(0x118)][_0x198e2d(0x119)])return process['env'][_0x198e2d(0x119)];const _0x595e6d=_0x12bf30[_0x198e2d(0xe6)]()['replace'](/-/g,'_'),_0x4d285f=_0x198e2d(0x103)+_0x595e6d;if(_0x4629ab){const _0xf57b66=loadProfileEnv(_0x4629ab);if(_0xf57b66){if(_0xf57b66[_0x4d285f])return _0xf57b66[_0x4d285f];if(_0xf57b66[_0x198e2d(0x119)])return _0xf57b66['TD_API_KEY'];}}const _0x4fe018=loadUserConfigOnce();if(_0x4fe018[_0x4d285f])return _0x4fe018[_0x4d285f];if(_0x4fe018[_0x198e2d(0x119)])return _0x4fe018[_0x198e2d(0x119)];return undefined;}export function normalizeProfileForEnvVar(_0x42c519){const _0x3d691f=a41_0x833a;return _0x42c519['toUpperCase']()[_0x3d691f(0xd9)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x43f8d9,_0x482fd1){const _0x8968e=a41_0x833a,_0x40bd8b=_0x482fd1||getActiveProfileName()||undefined;if(_0x40bd8b){const _0xf8c8af=_0x8968e(0xf3)+normalizeProfileForEnvVar(_0x40bd8b);if(process['env'][_0xf8c8af])return{'apiKey':process[_0x8968e(0x118)][_0xf8c8af],'source':_0xf8c8af+_0x8968e(0xf5),'isDeprecated':![]};const _0x369fa5=getCachedCredential(_0x43f8d9,_0x40bd8b);if(_0x369fa5)return{'apiKey':_0x369fa5,'source':'keychain\x20(profile:\x20'+_0x40bd8b+')','isDeprecated':![]};const _0x27a858=await getKeychainAPIKey(_0x40bd8b);if(_0x27a858)return setCachedCredential(_0x27a858,_0x43f8d9,_0x40bd8b),{'apiKey':_0x27a858,'source':_0x8968e(0x117)+_0x40bd8b+')','isDeprecated':![]};}if(process[_0x8968e(0x118)]['TDX_API_KEY'])return{'apiKey':process[_0x8968e(0x118)]['TDX_API_KEY'],'source':_0x8968e(0x104),'isDeprecated':![]};if(!_0x40bd8b){const _0x4ab35c=getCachedCredential(_0x43f8d9,undefined);if(_0x4ab35c)return{'apiKey':_0x4ab35c,'source':_0x8968e(0xf0),'isDeprecated':![]};const _0x22bf36=await getKeychainAPIKey(undefined);if(_0x22bf36)return setCachedCredential(_0x22bf36,_0x43f8d9,undefined),{'apiKey':_0x22bf36,'source':'keychain','isDeprecated':![]};}if(process['env'][_0x8968e(0x119)])return{'apiKey':process[_0x8968e(0x118)][_0x8968e(0x119)],'source':_0x8968e(0xdf),'isDeprecated':!![]};const _0x5d5714=getLegacyEnvAPIKey(_0x43f8d9,_0x40bd8b);if(_0x5d5714){const _0x3ea1d7=await isKeychainAvailable();if(_0x3ea1d7)try{await saveKeychainAPIKey(_0x5d5714,_0x40bd8b),setCachedCredential(_0x5d5714,_0x43f8d9,_0x40bd8b);const _0x5e7955=getConfigFilePath(_0x40bd8b);cleanupLegacyEnvFile(_0x5e7955)&&console[_0x8968e(0x107)](a41_0x400bbb[_0x8968e(0x114)](_0x8968e(0xe0)));}catch(_0x9d5035){console['warn'](a41_0x400bbb[_0x8968e(0x114)](_0x8968e(0x113)+_0x9d5035));}const _0x977d25=_0x40bd8b?_0x8968e(0xdd)+_0x40bd8b+')':'legacy\x20.env\x20file';return{'apiKey':_0x5d5714,'source':_0x977d25,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x5dea54,_0x485f6d,_0x4da6ea=!![]){const _0x269adf=a41_0x833a,_0x743aa6=await resolveAPIKeyAsync(_0x5dea54,_0x485f6d);if(!_0x743aa6)return undefined;if(_0x4da6ea&&_0x743aa6['isDeprecated']&&_0x743aa6[_0x269adf(0xfb)]['includes'](_0x269adf(0x119))){const _0xef2ef7=_0x485f6d||getActiveProfileName()||undefined,_0x55cdbe=_0xef2ef7?_0x269adf(0xf3)+normalizeProfileForEnvVar(_0xef2ef7):_0x269adf(0xf7);console[_0x269adf(0x107)](a41_0x400bbb[_0x269adf(0x114)]('Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a'+(_0x269adf(0xda)+_0x55cdbe+').')));}return _0x743aa6[_0x269adf(0x10a)];}function getLegacyEnvAPIKey(_0x5c6a24,_0x288296){const _0xfe9b61=a41_0x833a,_0x1ad602=_0x5c6a24['toUpperCase']()[_0xfe9b61(0xd9)](/-/g,'_'),_0x2865aa=_0xfe9b61(0x103)+_0x1ad602;if(_0x288296){const _0x351f9b=loadProfileEnv(_0x288296);if(_0x351f9b){if(_0x351f9b[_0x2865aa])return _0x351f9b[_0x2865aa];if(_0x351f9b[_0xfe9b61(0x119)])return _0x351f9b[_0xfe9b61(0x119)];}}const _0x4b1778=loadUserConfigOnce();if(_0x4b1778[_0x2865aa])return _0x4b1778[_0x2865aa];if(_0x4b1778[_0xfe9b61(0x119)])return _0x4b1778[_0xfe9b61(0x119)];return undefined;}function cleanupLegacyEnvFile(_0x3ac9ca){const _0x320573=a41_0x833a;if(!existsSync(_0x3ac9ca))return![];try{const _0xe9a0e7=readFileSync(_0x3ac9ca,_0x320573(0x116)),_0x1d3602=_0xe9a0e7['split']('\x0a'),_0x200e96=_0x1d3602['filter'](_0x32a585=>{const _0x2526a4=_0x320573,_0xc9f365=_0x32a585[_0x2526a4(0xf4)]();if(!_0xc9f365||_0xc9f365[_0x2526a4(0x10c)]('#'))return!![];const [_0x5c37db]=_0xc9f365[_0x2526a4(0x100)]('=');return!_0x5c37db[_0x2526a4(0x10c)](_0x2526a4(0x119));}),_0x5d8a8e=_0x200e96['some'](_0x6e1be7=>{const _0x22bfdb=_0x320573,_0x163495=_0x6e1be7[_0x22bfdb(0xf4)]();return _0x163495&&!_0x163495['startsWith']('#');});if(!_0x5d8a8e)return unlinkSync(_0x3ac9ca),!![];return writeFileSync(_0x3ac9ca,_0x200e96[_0x320573(0xf8)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function a41_0x3883(){const _0x20e7c4=['utf-8','keychain\x20(profile:\x20','env','TD_API_KEY','ap03','160212YUkcUF','replace','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','profile','parse','legacy\x20.env\x20file\x20(profile:\x20','llm_default_project.','TD_API_KEY\x20env\x20var\x20(deprecated)','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','184748qmnrrL','207095YiWXPA','entries','.cache','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','toUpperCase','248112PuhDDG','tdx','llm_default_project','dev-us01','1292172jDJHZb','Warning:\x20Failed\x20to\x20load\x20','.env','ap02','string','keychain','stg-jp01','.config','TDX_API_KEY_','trim','\x20env\x20var','stg-ap03','TDX_API_KEY_<PROFILE>','join','TDX_CONFIG_DIR','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','source','Warning:\x20Failed\x20to\x20read\x20','901520IxnrRR','dev-eu01','jp01','split','endsWith','slice','TD_API_KEY_','TDX_API_KEY\x20env\x20var','tdx.json','apiKeys','warn','readFileSync','1184328kPXerD','apiKey','existsSync','startsWith','TDX_API_KEY','eu01','TDX_CACHE_DIR','.env.','us01','\x27,\x20defaulting\x20to\x20us01','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','yellow','map'];a41_0x3883=function(){return _0x20e7c4;};return a41_0x3883();}function loadProfileEnv(_0x1dde30){const _0x2686b8=a41_0x833a,_0x26e18d=a41_0x5bfa4e['join'](getConfigDir(),_0x2686b8(0x110)+_0x1dde30);if(a41_0x203c3e[_0x2686b8(0x10b)](_0x26e18d)){validateSecureFilePermissions(_0x26e18d);try{const _0x1ce63f=a41_0x203c3e[_0x2686b8(0x108)](_0x26e18d,_0x2686b8(0x116));return parseEnvFile(_0x1ce63f);}catch(_0x22427e){console[_0x2686b8(0x107)](_0x2686b8(0xec)+_0x26e18d+':\x20'+_0x22427e);}}const _0x496fbf=a41_0x5bfa4e[_0x2686b8(0xf8)](getConfigDir(),'profiles',_0x1dde30,_0x2686b8(0xed));if(a41_0x203c3e['existsSync'](_0x496fbf)){validateSecureFilePermissions(_0x496fbf);try{const _0x558916=a41_0x203c3e['readFileSync'](_0x496fbf,_0x2686b8(0x116));return parseEnvFile(_0x558916);}catch(_0x9d157f){return console[_0x2686b8(0x107)]('Warning:\x20Failed\x20to\x20load\x20'+_0x496fbf+':\x20'+_0x9d157f),null;}}return null;}function getActiveProfileName(){const _0x2e87bc=a41_0x833a,_0x4fcd61=a41_0x5bfa4e['join'](getConfigDir(),_0x2e87bc(0x105));if(!a41_0x203c3e[_0x2e87bc(0x10b)](_0x4fcd61))return null;try{const _0x3e97c5=a41_0x203c3e[_0x2e87bc(0x108)](_0x4fcd61,_0x2e87bc(0x116)),_0x1f461f=JSON[_0x2e87bc(0xdc)](_0x3e97c5);return _0x1f461f[_0x2e87bc(0xdb)]||null;}catch{return null;}}export function saveAPIKey(_0x109c98,_0x1198a0,_0x226ade){const _0x15bca9=a41_0x833a,_0x260e14=getConfigDir(),_0x2e7fc3=getConfigFilePath(_0x226ade);!existsSync(_0x260e14)&&mkdirSync(_0x260e14,{'recursive':!![],'mode':0x1c0});let _0x38f6c6={};if(existsSync(_0x2e7fc3))try{const _0x222bb3=readFileSync(_0x2e7fc3,_0x15bca9(0x116));_0x38f6c6=parseEnvFile(_0x222bb3);}catch(_0x20e0c5){console[_0x15bca9(0x107)](_0x15bca9(0xfc)+_0x2e7fc3+':',_0x20e0c5);}const _0x484959=_0x109c98[_0x15bca9(0xe6)]()[_0x15bca9(0xd9)](/-/g,'_');_0x38f6c6['TD_API_KEY_'+_0x484959]=_0x1198a0;const _0x2e7cd5=Object[_0x15bca9(0xe3)](_0x38f6c6)[_0x15bca9(0x115)](([_0x574118,_0x10d285])=>_0x574118+'='+_0x10d285);writeFileSync(_0x2e7fc3,_0x2e7cd5[_0x15bca9(0xf8)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x581870,_0x1f034d,_0x5702a7){const _0x2a39f9=a41_0x833a;await saveKeychainAPIKey(_0x581870,_0x5702a7),setCachedCredential(_0x581870,_0x1f034d,_0x5702a7);const _0x109bd4=getConfigFilePath(_0x5702a7);cleanupLegacyEnvFile(_0x109bd4)&&console[_0x2a39f9(0x107)](a41_0x400bbb[_0x2a39f9(0x114)](_0x2a39f9(0xfa)));}export function loadConfig(){const _0x532b28=a41_0x833a,_0x14f4b8={'apiKeys':{},'defaultSite':_0x532b28(0x111)},_0x1895a6=['us01',_0x532b28(0xff),_0x532b28(0x10e),_0x532b28(0xee),_0x532b28(0xd7),'dev-us01','dev-eu01','stg-us01','stg-jp01',_0x532b28(0xf6)];for(const _0xdb83c6 of _0x1895a6){const _0x5a1ad6=getAPIKey(_0xdb83c6);_0x5a1ad6&&(_0x14f4b8[_0x532b28(0x106)][_0xdb83c6]=_0x5a1ad6);}return _0x14f4b8;}
1
+ (function(_0x2ec6af,_0x4512bc){const _0x595168=a41_0x45be,_0x2f2e22=_0x2ec6af();while(!![]){try{const _0x25bb55=-parseInt(_0x595168(0x1f5))/0x1*(-parseInt(_0x595168(0x21c))/0x2)+parseInt(_0x595168(0x1f3))/0x3+-parseInt(_0x595168(0x202))/0x4+parseInt(_0x595168(0x204))/0x5+-parseInt(_0x595168(0x211))/0x6+-parseInt(_0x595168(0x225))/0x7+-parseInt(_0x595168(0x207))/0x8*(-parseInt(_0x595168(0x22e))/0x9);if(_0x25bb55===_0x4512bc)break;else _0x2f2e22['push'](_0x2f2e22['shift']());}catch(_0x18eebc){_0x2f2e22['push'](_0x2f2e22['shift']());}}}(a41_0xf5b6,0x98b7e));import{homedir}from'os';import{join}from'path';function a41_0xf5b6(){const _0x11127d=['keychain','TDX_API_KEY_<PROFILE>','llm_default_project.','4307500AEJsjs','parse','5010345cgjNVB','includes','\x27,\x20defaulting\x20to\x20us01','8eUqyZj','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','keychain\x20(profile:\x20','us01','toUpperCase','Warning:\x20Failed\x20to\x20load\x20','Warning:\x20Failed\x20to\x20read\x20','ap03','stg-jp01','isDeprecated','348060wlIaqu','dev-us01','env','TDX_CACHE_DIR','legacy\x20.env\x20file','.env.','match','map','jp01','stg-us01','tdx','344938yqsigF','.cache','tdx.json','stg-ap03','endsWith','profile','apiKeys','TD_API_KEY\x20env\x20var\x20(deprecated)','split','5848129iiBmrv','warn','.config','utf-8','TDX_API_KEY\x20env\x20var','string','readFileSync','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','\x20env\x20var','2451069YNGeeG','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','yellow','existsSync','entries','dev-eu01','TDX_API_KEY','TD_API_KEY','TDX_CONFIG_DIR','stringify','join','.env','342519zuSWty','source','7SgoohW','eu01','trim','TD_API_KEY_','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','filter','TDX_API_KEY_','replace','startsWith','slice'];a41_0xf5b6=function(){return _0x11127d;};return a41_0xf5b6();}import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a41_0x51ed9c from'node:fs';import*as a41_0x4d2422 from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a41_0x4caa9c from'chalk';export function getConfigDir(){const _0x531e1=a41_0x45be;return process['env'][_0x531e1(0x1ef)]||join(homedir(),_0x531e1(0x227),_0x531e1(0x21b));}export function getConfigFile(){const _0x2ea40f=a41_0x45be;return join(getConfigDir(),_0x2ea40f(0x1f2));}export function getConfigFilePath(_0x24ec73){const _0x59180e=a41_0x45be,_0x5b7912=getConfigDir();return _0x24ec73?a41_0x4d2422[_0x59180e(0x1f1)](_0x5b7912,_0x59180e(0x216)+_0x24ec73):getConfigFile();}export function getCacheDir(){const _0x21b556=a41_0x45be;return process[_0x21b556(0x213)][_0x21b556(0x214)]||join(homedir(),_0x21b556(0x21d),_0x21b556(0x21b));}export function getLLMProjectCacheFile(_0x598b02){const _0x44c6c5=a41_0x45be,_0x1f94b9=_0x598b02?_0x44c6c5(0x201)+_0x598b02:'llm_default_project';return join(getCacheDir(),_0x1f94b9);}export function readCachedLLMProject(_0x78116f){const _0x39f322=a41_0x45be;try{const _0x2eb251=getLLMProjectCacheFile(_0x78116f);if(!existsSync(_0x2eb251))return null;const _0x167ba7=readFileSync(_0x2eb251,_0x39f322(0x228))[_0x39f322(0x1f7)]();try{const _0x2ecdc6=JSON[_0x39f322(0x203)](_0x167ba7);if(_0x2ecdc6&&typeof _0x2ecdc6['id']===_0x39f322(0x22a)&&typeof _0x2ecdc6['name']==='string')return _0x2ecdc6;}catch{}return null;}catch{return null;}}function a41_0x45be(_0x3f8cad,_0x241071){const _0xf5b6d=a41_0xf5b6();return a41_0x45be=function(_0x45be97,_0x377274){_0x45be97=_0x45be97-0x1ee;let _0x3899ba=_0xf5b6d[_0x45be97];return _0x3899ba;},a41_0x45be(_0x3f8cad,_0x241071);}export function writeCachedLLMProject(_0x47852c,_0x41c630,_0x312bd0){const _0x39dab1=a41_0x45be;try{const _0x1c1006=getCacheDir(),_0x2d2bfd=getLLMProjectCacheFile(_0x312bd0);!existsSync(_0x1c1006)&&mkdirSync(_0x1c1006,{'recursive':!![]});const _0x18dcdc={'name':_0x47852c,'id':_0x41c630};writeFileSync(_0x2d2bfd,JSON[_0x39dab1(0x1f0)](_0x18dcdc),'utf-8');}catch{}}export function parseEnvFile(_0x269027){const _0x2c8590=a41_0x45be,_0x19dc30={};for(const _0x267804 of _0x269027[_0x2c8590(0x224)]('\x0a')){const _0x59f0ad=_0x267804[_0x2c8590(0x1f7)]();if(!_0x59f0ad||_0x59f0ad['startsWith']('#'))continue;const _0x3b91db=_0x59f0ad[_0x2c8590(0x217)](/^([^=]+)=(.*)$/);if(_0x3b91db){const _0x4950b0=_0x3b91db[0x1]['trim']();let _0x228051=_0x3b91db[0x2]['trim']();(_0x228051['startsWith']('\x22')&&_0x228051[_0x2c8590(0x220)]('\x22')||_0x228051[_0x2c8590(0x1fd)]('\x27')&&_0x228051[_0x2c8590(0x220)]('\x27'))&&(_0x228051=_0x228051[_0x2c8590(0x1fe)](0x1,-0x1)),_0x19dc30[_0x4950b0]=_0x228051;}}return _0x19dc30;}export function readUserConfig(){const _0x87d9d6=a41_0x45be,_0x214e93=getConfigFile();if(!existsSync(_0x214e93))return{};try{const _0x35f8c5=readFileSync(_0x214e93,_0x87d9d6(0x228));return parseEnvFile(_0x35f8c5);}catch(_0x760497){return console['warn'](_0x87d9d6(0x22f)+_0x214e93+':',_0x760497),{};}}export function resolveSite(_0x224c65){const _0x3cef75=a41_0x45be,_0x3a17a5=[_0x3cef75(0x20a),_0x3cef75(0x219),_0x3cef75(0x1f6),'ap02',_0x3cef75(0x20e),_0x3cef75(0x212),_0x3cef75(0x233),_0x3cef75(0x21a),_0x3cef75(0x20f),_0x3cef75(0x21f)];if(_0x3a17a5[_0x3cef75(0x205)](_0x224c65))return _0x224c65;if(_0x224c65 in SITE_ALIASES)return SITE_ALIASES[_0x224c65];return console[_0x3cef75(0x226)]('Warning:\x20Unknown\x20site\x20\x27'+_0x224c65+_0x3cef75(0x206)),'us01';}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x5b2449,_0x3786e5){const _0xadc5b9=a41_0x45be,_0x5e3ff0=_0x3786e5||getActiveProfileName();if(_0x5e3ff0){const _0x496b06=_0xadc5b9(0x1fb)+normalizeProfileForEnvVar(_0x5e3ff0);if(process[_0xadc5b9(0x213)][_0x496b06])return process[_0xadc5b9(0x213)][_0x496b06];}if(process[_0xadc5b9(0x213)][_0xadc5b9(0x234)])return process['env'][_0xadc5b9(0x234)];if(process[_0xadc5b9(0x213)][_0xadc5b9(0x1ee)])return process['env'][_0xadc5b9(0x1ee)];const _0x4a8782=_0x5b2449[_0xadc5b9(0x20b)]()[_0xadc5b9(0x1fc)](/-/g,'_'),_0x23094a=_0xadc5b9(0x1f8)+_0x4a8782;if(_0x5e3ff0){const _0x1fa8d6=loadProfileEnv(_0x5e3ff0);if(_0x1fa8d6){if(_0x1fa8d6[_0x23094a])return _0x1fa8d6[_0x23094a];if(_0x1fa8d6[_0xadc5b9(0x1ee)])return _0x1fa8d6['TD_API_KEY'];}}const _0x5e44d6=loadUserConfigOnce();if(_0x5e44d6[_0x23094a])return _0x5e44d6[_0x23094a];if(_0x5e44d6['TD_API_KEY'])return _0x5e44d6['TD_API_KEY'];return undefined;}export function normalizeProfileForEnvVar(_0x499615){const _0x38332d=a41_0x45be;return _0x499615[_0x38332d(0x20b)]()['replace'](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x1bb9f3,_0x25cf1){const _0x3730d6=a41_0x45be,_0x55f651=_0x25cf1||getActiveProfileName()||undefined;if(_0x55f651){const _0x454b30=_0x3730d6(0x1fb)+normalizeProfileForEnvVar(_0x55f651);if(process[_0x3730d6(0x213)][_0x454b30])return{'apiKey':process[_0x3730d6(0x213)][_0x454b30],'source':_0x454b30+_0x3730d6(0x22d),'isDeprecated':![]};const _0x18f56c=getCachedCredential(_0x1bb9f3,_0x55f651);if(_0x18f56c)return{'apiKey':_0x18f56c,'source':_0x3730d6(0x209)+_0x55f651+')','isDeprecated':![]};const _0x3b4278=await getKeychainAPIKey(_0x55f651);if(_0x3b4278)return setCachedCredential(_0x3b4278,_0x1bb9f3,_0x55f651),{'apiKey':_0x3b4278,'source':_0x3730d6(0x209)+_0x55f651+')','isDeprecated':![]};}if(process['env'][_0x3730d6(0x234)])return{'apiKey':process[_0x3730d6(0x213)]['TDX_API_KEY'],'source':_0x3730d6(0x229),'isDeprecated':![]};if(!_0x55f651){const _0x419f3d=getCachedCredential(_0x1bb9f3,undefined);if(_0x419f3d)return{'apiKey':_0x419f3d,'source':'keychain','isDeprecated':![]};const _0x2536fa=await getKeychainAPIKey(undefined);if(_0x2536fa)return setCachedCredential(_0x2536fa,_0x1bb9f3,undefined),{'apiKey':_0x2536fa,'source':_0x3730d6(0x1ff),'isDeprecated':![]};}if(process[_0x3730d6(0x213)][_0x3730d6(0x1ee)])return{'apiKey':process[_0x3730d6(0x213)][_0x3730d6(0x1ee)],'source':_0x3730d6(0x223),'isDeprecated':!![]};const _0x55f8d0=getLegacyEnvAPIKey(_0x1bb9f3,_0x55f651);if(_0x55f8d0){const _0xf0b245=await isKeychainAvailable();if(_0xf0b245)try{await saveKeychainAPIKey(_0x55f8d0,_0x55f651),setCachedCredential(_0x55f8d0,_0x1bb9f3,_0x55f651);const _0xbd0adb=getConfigFilePath(_0x55f651);cleanupLegacyEnvFile(_0xbd0adb)&&console['warn'](a41_0x4caa9c[_0x3730d6(0x230)]('⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage'));}catch(_0x3d336b){console[_0x3730d6(0x226)](a41_0x4caa9c[_0x3730d6(0x230)]('⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20'+_0x3d336b));}const _0x3f2c06=_0x55f651?'legacy\x20.env\x20file\x20(profile:\x20'+_0x55f651+')':_0x3730d6(0x215);return{'apiKey':_0x55f8d0,'source':_0x3f2c06,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x2cb4cc,_0x124d65,_0x41b527=!![]){const _0x5177b1=a41_0x45be,_0x27cb0f=await resolveAPIKeyAsync(_0x2cb4cc,_0x124d65);if(!_0x27cb0f)return undefined;if(_0x41b527&&_0x27cb0f[_0x5177b1(0x210)]&&_0x27cb0f[_0x5177b1(0x1f4)]['includes'](_0x5177b1(0x1ee))){const _0x38beac=_0x124d65||getActiveProfileName()||undefined,_0x20cb70=_0x38beac?_0x5177b1(0x1fb)+normalizeProfileForEnvVar(_0x38beac):_0x5177b1(0x200);console['warn'](a41_0x4caa9c[_0x5177b1(0x230)](_0x5177b1(0x22c)+(_0x5177b1(0x1f9)+_0x20cb70+').')));}return _0x27cb0f['apiKey'];}function getLegacyEnvAPIKey(_0x177621,_0x582162){const _0x33913a=a41_0x45be,_0x2c7b7d=_0x177621[_0x33913a(0x20b)]()[_0x33913a(0x1fc)](/-/g,'_'),_0x3955f0=_0x33913a(0x1f8)+_0x2c7b7d;if(_0x582162){const _0x3e4ab1=loadProfileEnv(_0x582162);if(_0x3e4ab1){if(_0x3e4ab1[_0x3955f0])return _0x3e4ab1[_0x3955f0];if(_0x3e4ab1['TD_API_KEY'])return _0x3e4ab1[_0x33913a(0x1ee)];}}const _0x49a02c=loadUserConfigOnce();if(_0x49a02c[_0x3955f0])return _0x49a02c[_0x3955f0];if(_0x49a02c['TD_API_KEY'])return _0x49a02c[_0x33913a(0x1ee)];return undefined;}function cleanupLegacyEnvFile(_0x33ff80){const _0x899fe9=a41_0x45be;if(!existsSync(_0x33ff80))return![];try{const _0x6bde02=readFileSync(_0x33ff80,'utf-8'),_0x1fcc0d=_0x6bde02[_0x899fe9(0x224)]('\x0a'),_0x1d9af4=_0x1fcc0d[_0x899fe9(0x1fa)](_0xd7e420=>{const _0x28e54c=_0x899fe9,_0x3214a4=_0xd7e420[_0x28e54c(0x1f7)]();if(!_0x3214a4||_0x3214a4[_0x28e54c(0x1fd)]('#'))return!![];const [_0x1861b8]=_0x3214a4['split']('=');return!_0x1861b8[_0x28e54c(0x1fd)](_0x28e54c(0x1ee));}),_0x1197b4=_0x1d9af4['some'](_0x2ed274=>{const _0x3d0e21=_0x899fe9,_0x35e919=_0x2ed274[_0x3d0e21(0x1f7)]();return _0x35e919&&!_0x35e919[_0x3d0e21(0x1fd)]('#');});if(!_0x1197b4)return unlinkSync(_0x33ff80),!![];return writeFileSync(_0x33ff80,_0x1d9af4['join']('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x569f26){const _0x9b89cb=a41_0x45be,_0x510501=a41_0x4d2422[_0x9b89cb(0x1f1)](getConfigDir(),_0x9b89cb(0x216)+_0x569f26);if(a41_0x51ed9c[_0x9b89cb(0x231)](_0x510501)){validateSecureFilePermissions(_0x510501);try{const _0x1b955c=a41_0x51ed9c['readFileSync'](_0x510501,_0x9b89cb(0x228));return parseEnvFile(_0x1b955c);}catch(_0x393e6d){console['warn'](_0x9b89cb(0x20c)+_0x510501+':\x20'+_0x393e6d);}}const _0x4e3c22=a41_0x4d2422[_0x9b89cb(0x1f1)](getConfigDir(),'profiles',_0x569f26,_0x9b89cb(0x1f2));if(a41_0x51ed9c['existsSync'](_0x4e3c22)){validateSecureFilePermissions(_0x4e3c22);try{const _0x4300ab=a41_0x51ed9c[_0x9b89cb(0x22b)](_0x4e3c22,_0x9b89cb(0x228));return parseEnvFile(_0x4300ab);}catch(_0xac8780){return console[_0x9b89cb(0x226)]('Warning:\x20Failed\x20to\x20load\x20'+_0x4e3c22+':\x20'+_0xac8780),null;}}return null;}function getActiveProfileName(){const _0xf9500=a41_0x45be,_0x138202=a41_0x4d2422['join'](getConfigDir(),_0xf9500(0x21e));if(!a41_0x51ed9c[_0xf9500(0x231)](_0x138202))return null;try{const _0x200fb7=a41_0x51ed9c['readFileSync'](_0x138202,_0xf9500(0x228)),_0x49656d=JSON[_0xf9500(0x203)](_0x200fb7);return _0x49656d[_0xf9500(0x221)]||null;}catch{return null;}}export function saveAPIKey(_0x16ec45,_0x3ea2ea,_0x2f11d3){const _0x228856=a41_0x45be,_0x4c5d6f=getConfigDir(),_0x5f4909=getConfigFilePath(_0x2f11d3);!existsSync(_0x4c5d6f)&&mkdirSync(_0x4c5d6f,{'recursive':!![],'mode':0x1c0});let _0x1aeeec={};if(existsSync(_0x5f4909))try{const _0x3de9d0=readFileSync(_0x5f4909,'utf-8');_0x1aeeec=parseEnvFile(_0x3de9d0);}catch(_0x50c4b7){console[_0x228856(0x226)](_0x228856(0x20d)+_0x5f4909+':',_0x50c4b7);}const _0x597ece=_0x16ec45[_0x228856(0x20b)]()[_0x228856(0x1fc)](/-/g,'_');_0x1aeeec[_0x228856(0x1f8)+_0x597ece]=_0x3ea2ea;const _0x487b0b=Object[_0x228856(0x232)](_0x1aeeec)[_0x228856(0x218)](([_0x289763,_0x29d05d])=>_0x289763+'='+_0x29d05d);writeFileSync(_0x5f4909,_0x487b0b[_0x228856(0x1f1)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x76e3bb,_0x1bdeb4,_0x397c21){const _0xf6bcbe=a41_0x45be;await saveKeychainAPIKey(_0x76e3bb,_0x397c21),setCachedCredential(_0x76e3bb,_0x1bdeb4,_0x397c21);const _0x19b5b5=getConfigFilePath(_0x397c21);cleanupLegacyEnvFile(_0x19b5b5)&&console[_0xf6bcbe(0x226)](a41_0x4caa9c[_0xf6bcbe(0x230)](_0xf6bcbe(0x208)));}export function loadConfig(){const _0x21377e=a41_0x45be,_0x572abc={'apiKeys':{},'defaultSite':_0x21377e(0x20a)},_0x251e74=[_0x21377e(0x20a),_0x21377e(0x219),_0x21377e(0x1f6),'ap02','ap03',_0x21377e(0x212),'dev-eu01',_0x21377e(0x21a),_0x21377e(0x20f),_0x21377e(0x21f)];for(const _0x4edefe of _0x251e74){const _0x135079=getAPIKey(_0x4edefe);_0x135079&&(_0x572abc[_0x21377e(0x222)][_0x4edefe]=_0x135079);}return _0x572abc;}
@@ -1 +1 @@
1
- (function(_0x18dbb0,_0x1a4dd8){const _0x5aa6f0=a42_0x549c,_0x1335ac=_0x18dbb0();while(!![]){try{const _0x11a846=-parseInt(_0x5aa6f0(0xa6))/0x1*(-parseInt(_0x5aa6f0(0xad))/0x2)+-parseInt(_0x5aa6f0(0x9d))/0x3*(-parseInt(_0x5aa6f0(0xaf))/0x4)+-parseInt(_0x5aa6f0(0xac))/0x5*(-parseInt(_0x5aa6f0(0xa3))/0x6)+-parseInt(_0x5aa6f0(0x9e))/0x7*(parseInt(_0x5aa6f0(0xa1))/0x8)+parseInt(_0x5aa6f0(0xaa))/0x9*(-parseInt(_0x5aa6f0(0x9f))/0xa)+-parseInt(_0x5aa6f0(0xa2))/0xb*(parseInt(_0x5aa6f0(0xa7))/0xc)+parseInt(_0x5aa6f0(0xae))/0xd;if(_0x11a846===_0x1a4dd8)break;else _0x1335ac['push'](_0x1335ac['shift']());}catch(_0x3c22c9){_0x1335ac['push'](_0x1335ac['shift']());}}}(a42_0x5adb,0x5233d));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function a42_0x549c(_0x462cc7,_0x5ea253){const _0x5adbe2=a42_0x5adb();return a42_0x549c=function(_0x549cdb,_0x1cad96){_0x549cdb=_0x549cdb-0x9d;let _0x555b66=_0x5adbe2[_0x549cdb];return _0x555b66;},a42_0x549c(_0x462cc7,_0x5ea253);}function getCacheKey(_0x315d48,_0x1997d6){const _0x177390=a42_0x549c,_0x8b9893=_0x315d48||_0x177390(0xa5),_0x3b6e66=_0x1997d6||'__default_profile__';return _0x8b9893+':'+_0x3b6e66;}function a42_0x5adb(){const _0x277a2f=['set','__default_site__','2tVMeGf','192000qTjaJi','delete','clear','198981WaXmkS','now','40aRvWoB','95908eSGvey','17288141fZBctc','776996XTozvq','apiKey','3WPCIgx','5628MrcPEd','250yXWlDP','loadedAt','3112KDjnGV','440KRYCWV','166626jOttoE'];a42_0x5adb=function(){return _0x277a2f;};return a42_0x5adb();}export function getCachedCredential(_0x9c4eed,_0x1e264a){const _0x1a6184=a42_0x549c,_0x4046db=getCacheKey(_0x9c4eed,_0x1e264a),_0x33e511=cache['get'](_0x4046db);if(!_0x33e511)return null;if(Date['now']()-_0x33e511[_0x1a6184(0xa0)]>CACHE_TTL_MS)return cache[_0x1a6184(0xa8)](_0x4046db),null;return _0x33e511[_0x1a6184(0xb0)];}export function setCachedCredential(_0x1b7a24,_0x3d228b,_0x479cea){const _0x570565=a42_0x549c,_0x319047=getCacheKey(_0x3d228b,_0x479cea);cache[_0x570565(0xa4)](_0x319047,{'apiKey':_0x1b7a24,'loadedAt':Date[_0x570565(0xab)]()});}export function clearCredentialCache(){const _0x38af3c=a42_0x549c;cache[_0x38af3c(0xa9)]();}export function clearCachedCredential(_0x157b23,_0x26012d){const _0x451bac=getCacheKey(_0x157b23,_0x26012d);cache['delete'](_0x451bac);}
1
+ (function(_0x486d34,_0x71b37d){const _0xd93ae9=a42_0x8e45,_0x72bf7=_0x486d34();while(!![]){try{const _0x54529a=parseInt(_0xd93ae9(0x1c1))/0x1*(parseInt(_0xd93ae9(0x1ca))/0x2)+-parseInt(_0xd93ae9(0x1bd))/0x3*(parseInt(_0xd93ae9(0x1c3))/0x4)+parseInt(_0xd93ae9(0x1c2))/0x5*(parseInt(_0xd93ae9(0x1b9))/0x6)+parseInt(_0xd93ae9(0x1bf))/0x7*(parseInt(_0xd93ae9(0x1cc))/0x8)+-parseInt(_0xd93ae9(0x1ba))/0x9*(-parseInt(_0xd93ae9(0x1c4))/0xa)+parseInt(_0xd93ae9(0x1c0))/0xb*(parseInt(_0xd93ae9(0x1cd))/0xc)+parseInt(_0xd93ae9(0x1bb))/0xd*(-parseInt(_0xd93ae9(0x1cb))/0xe);if(_0x54529a===_0x71b37d)break;else _0x72bf7['push'](_0x72bf7['shift']());}catch(_0xb298d4){_0x72bf7['push'](_0x72bf7['shift']());}}}(a42_0x11c8,0x1e3c2));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function a42_0x11c8(){const _0x582724=['set','__default_site__','now','76IpHTAh','6018502jfGEAx','16WVwgZG','48zrgkiB','55578nKrKyK','621BbxkdU','13yqEnkO','delete','130653UboXSs','apiKey','323337HMuimU','606496JYAwUU','4852KrsdQY','15CvPGFf','20cYvsOo','35710MjzlLs','clear','get'];a42_0x11c8=function(){return _0x582724;};return a42_0x11c8();}function getCacheKey(_0x30be8c,_0x48ee7d){const _0x161a68=a42_0x8e45,_0x345cb1=_0x30be8c||_0x161a68(0x1c8),_0x38f37d=_0x48ee7d||'__default_profile__';return _0x345cb1+':'+_0x38f37d;}function a42_0x8e45(_0x8b2b3d,_0x5bbb32){const _0x11c899=a42_0x11c8();return a42_0x8e45=function(_0x8e458,_0xc72a8b){_0x8e458=_0x8e458-0x1b9;let _0x27ed49=_0x11c899[_0x8e458];return _0x27ed49;},a42_0x8e45(_0x8b2b3d,_0x5bbb32);}export function getCachedCredential(_0xe5109b,_0x313f5d){const _0x1595bf=a42_0x8e45,_0x35bc3c=getCacheKey(_0xe5109b,_0x313f5d),_0x211c19=cache[_0x1595bf(0x1c6)](_0x35bc3c);if(!_0x211c19)return null;if(Date[_0x1595bf(0x1c9)]()-_0x211c19['loadedAt']>CACHE_TTL_MS)return cache['delete'](_0x35bc3c),null;return _0x211c19[_0x1595bf(0x1be)];}export function setCachedCredential(_0x16bca5,_0x30faec,_0x15b5c7){const _0x14c8f5=a42_0x8e45,_0x39ebd4=getCacheKey(_0x30faec,_0x15b5c7);cache[_0x14c8f5(0x1c7)](_0x39ebd4,{'apiKey':_0x16bca5,'loadedAt':Date['now']()});}export function clearCredentialCache(){const _0x1d35f3=a42_0x8e45;cache[_0x1d35f3(0x1c5)]();}export function clearCachedCredential(_0x25d0a0,_0x20de30){const _0x540beb=a42_0x8e45,_0x184f6e=getCacheKey(_0x25d0a0,_0x20de30);cache[_0x540beb(0x1bc)](_0x184f6e);}