@treasuredata/tdx 0.8.9 → 0.8.11

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 (134) 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.js +1 -1
  5. package/dist/client/cdp-api-client.d.ts +19 -1
  6. package/dist/client/cdp-api-client.d.ts.map +1 -1
  7. package/dist/client/cdp-api-client.js +1 -1
  8. package/dist/client/cdp-api-client.js.map +1 -1
  9. package/dist/client/engage-api-client.js +1 -1
  10. package/dist/client/http-client.js +1 -1
  11. package/dist/client/llm-api-client.js +1 -1
  12. package/dist/client/rate-limiter.js +1 -1
  13. package/dist/client/td-api-client.js +1 -1
  14. package/dist/client/trino-api-client.js +1 -1
  15. package/dist/client/workflow-client.js +1 -1
  16. package/dist/commands/activations.js +1 -1
  17. package/dist/commands/api-command.js +1 -1
  18. package/dist/commands/auth-command.js +1 -1
  19. package/dist/commands/chat-command.js +1 -1
  20. package/dist/commands/claude-command.js +1 -1
  21. package/dist/commands/claude-statusline-command.js +1 -1
  22. package/dist/commands/claude-usage-command.js +1 -1
  23. package/dist/commands/command.js +1 -1
  24. package/dist/commands/connection-command.js +1 -1
  25. package/dist/commands/context-command.js +1 -1
  26. package/dist/commands/databases.js +1 -1
  27. package/dist/commands/describe.js +1 -1
  28. package/dist/commands/engage-command.js +1 -1
  29. package/dist/commands/job-command.js +1 -1
  30. package/dist/commands/journey-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/llm-proxy.js +1 -1
  33. package/dist/commands/parent-segment-command.js +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-pull-command.js +1 -1
  40. package/dist/commands/segment-push-command.d.ts.map +1 -1
  41. package/dist/commands/segment-push-command.js +1 -1
  42. package/dist/commands/segment-push-command.js.map +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segments.js +1 -1
  46. package/dist/commands/show.js +1 -1
  47. package/dist/commands/tables.js +1 -1
  48. package/dist/commands/use-command.js +1 -1
  49. package/dist/commands/user-command.js +1 -1
  50. package/dist/commands/workflow-command.js +1 -1
  51. package/dist/core/auth.js +1 -1
  52. package/dist/core/config.js +1 -1
  53. package/dist/core/connection-cache.js +1 -1
  54. package/dist/core/credential-cache.js +1 -1
  55. package/dist/core/global-context.js +1 -1
  56. package/dist/core/keychain.js +1 -1
  57. package/dist/core/profile.js +1 -1
  58. package/dist/core/project-config.js +1 -1
  59. package/dist/core/session.js +1 -1
  60. package/dist/core/user-cache.js +1 -1
  61. package/dist/index.js +1 -1
  62. package/dist/proxy/anthropic-adapter.js +1 -1
  63. package/dist/proxy/claude-usage-tracker.js +1 -1
  64. package/dist/proxy/context-signature.js +1 -1
  65. package/dist/proxy/conversation-utils.js +1 -1
  66. package/dist/proxy/server.js +1 -1
  67. package/dist/proxy/session-cache.js +1 -1
  68. package/dist/sdk/api.js +1 -1
  69. package/dist/sdk/connection.js +1 -1
  70. package/dist/sdk/engage.js +1 -1
  71. package/dist/sdk/errors.js +1 -1
  72. package/dist/sdk/index.js +1 -1
  73. package/dist/sdk/job.js +1 -1
  74. package/dist/sdk/journey.d.ts +15 -1
  75. package/dist/sdk/journey.d.ts.map +1 -1
  76. package/dist/sdk/journey.js +1 -1
  77. package/dist/sdk/journey.js.map +1 -1
  78. package/dist/sdk/llm.js +1 -1
  79. package/dist/sdk/query.js +1 -1
  80. package/dist/sdk/segment/child-segment-yaml.d.ts +4 -0
  81. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  82. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  83. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  84. package/dist/sdk/segment/journey-yaml.d.ts +11 -0
  85. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  86. package/dist/sdk/segment/journey-yaml.js +1 -1
  87. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  88. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  89. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  90. package/dist/sdk/segment.d.ts +15 -1
  91. package/dist/sdk/segment.d.ts.map +1 -1
  92. package/dist/sdk/segment.js +1 -1
  93. package/dist/sdk/segment.js.map +1 -1
  94. package/dist/sdk/user.js +1 -1
  95. package/dist/sdk/workflow.js +1 -1
  96. package/dist/types/cdp.d.ts +67 -0
  97. package/dist/types/cdp.d.ts.map +1 -1
  98. package/dist/types/endpoints.js +1 -1
  99. package/dist/types/index.d.ts +1 -1
  100. package/dist/types/index.d.ts.map +1 -1
  101. package/dist/types/index.js +1 -1
  102. package/dist/utils/agent-ref-parser.js +1 -1
  103. package/dist/utils/async.js +1 -1
  104. package/dist/utils/chat-cache.js +1 -1
  105. package/dist/utils/colors.js +1 -1
  106. package/dist/utils/command-output.js +1 -1
  107. package/dist/utils/constants.js +1 -1
  108. package/dist/utils/diff.js +1 -1
  109. package/dist/utils/fields-display.js +1 -1
  110. package/dist/utils/file-permissions.js +1 -1
  111. package/dist/utils/format-detector.js +1 -1
  112. package/dist/utils/formatters.js +1 -1
  113. package/dist/utils/journey-utils.js +1 -1
  114. package/dist/utils/json-loader.js +1 -1
  115. package/dist/utils/llm-backup-utils.js +1 -1
  116. package/dist/utils/model-aliases.js +1 -1
  117. package/dist/utils/model-factors.js +1 -1
  118. package/dist/utils/option-validation.js +1 -1
  119. package/dist/utils/port.js +1 -1
  120. package/dist/utils/process.js +1 -1
  121. package/dist/utils/prompt.js +1 -1
  122. package/dist/utils/segment-path-parser.js +1 -1
  123. package/dist/utils/segment-ref-parser.js +1 -1
  124. package/dist/utils/spinner.js +1 -1
  125. package/dist/utils/sql-parser.js +1 -1
  126. package/dist/utils/sse-parser.js +1 -1
  127. package/dist/utils/string-utils.js +1 -1
  128. package/dist/utils/table-ref-parser.js +1 -1
  129. package/dist/utils/tdx-config.js +1 -1
  130. package/dist/utils/tdx-logger.js +1 -1
  131. package/dist/utils/tree-formatter.js +1 -1
  132. package/dist/utils/version-check.js +1 -1
  133. package/dist/utils/workflow-utils.js +1 -1
  134. package/package.json +1 -1
@@ -1 +1 @@
1
- const a37_0x57f9ec=a37_0x2ebd;function a37_0x2ebd(_0x809c94,_0x47b220){_0x809c94=_0x809c94-0xd9;const _0x5efbf1=a37_0x5efb();let _0x2ebd7d=_0x5efbf1[_0x809c94];return _0x2ebd7d;}function a37_0x5efb(){const _0x55a902=['Resolving\x20path\x20\x27','556DnAfMQ','Examples:','cyan','2966648VhyhSH','error','split','Resolved\x20path\x20type:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','5714465CYZdEI','verbose','green','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','log','parentName','segments','dim','parentId','Site:\x20','Target\x20path:\x20','5741850bCoYcA','3396381UGMgux','length','Usage:\x20tdx\x20segment\x20use\x20<path>','18244600COWYcq','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','✔\x20Context\x20set\x20to:\x20','site','parent_segment','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','5420DhPbbo','join','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','isAbsolute','Resolved\x20relative\x20path\x20to:\x20','segment:use','Parent\x20ID:\x20','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','type','segmentPath','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','fullPath','folderPath','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','session','folderId','Error:\x20Path\x20is\x20required\x0a','\x27...','config','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','name','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','segment','data','red','2892799CeGDPJ'];a37_0x5efb=function(){return _0x55a902;};return a37_0x5efb();}(function(_0x792c1c,_0x2fe2cd){const _0x15070a=a37_0x2ebd,_0x32d98c=_0x792c1c();while(!![]){try{const _0x198de6=-parseInt(_0x15070a(0x10b))/0x1*(parseInt(_0x15070a(0xee))/0x2)+parseInt(_0x15070a(0xe5))/0x3+parseInt(_0x15070a(0x10e))/0x4+-parseInt(_0x15070a(0xd9))/0x5+-parseInt(_0x15070a(0xe4))/0x6+parseInt(_0x15070a(0x109))/0x7+parseInt(_0x15070a(0xe8))/0x8;if(_0x198de6===_0x2fe2cd)break;else _0x32d98c['push'](_0x32d98c['shift']());}catch(_0x38c171){_0x32d98c['push'](_0x32d98c['shift']());}}}(a37_0x5efb,0xea9e1));import{existsSync,statSync}from'fs';import a37_0x2fd988 from'chalk';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';import{findTdxConfig}from'../utils/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a37_0x57f9ec(0x104)]=a37_0x57f9ec(0xf3);['description']=a37_0x57f9ec(0xfc);async['execute'](_0x1ab260){const _0x457263=a37_0x57f9ec,{options:_0x626290,args:_0x39e60a,tdx:_0x5342d6}=_0x1ab260;if(_0x39e60a['length']===0x0)return console['error'](a37_0x2fd988[_0x457263(0x108)](_0x457263(0xff))),console['error'](_0x457263(0xe7)),console[_0x457263(0x10f)](_0x457263(0x10c)),console[_0x457263(0x10f)](_0x457263(0x103)),console['error'](_0x457263(0x112)),console[_0x457263(0x10f)](_0x457263(0xf5)),console['error'](_0x457263(0xdc)),0x1;const _0x43ee13=_0x39e60a[0x0],_0x144897=_0x626290[_0x457263(0xfd)];try{if(_0x43ee13==='/')return saveSessionContext({'segment_path':undefined},_0x144897),console[_0x457263(0xdd)](a37_0x2fd988['green']('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x43ee13)&&statSync(_0x43ee13)['isDirectory']()){let _0x18c0ce;try{_0x18c0ce=findTdxConfig(_0x43ee13);}catch{return console[_0x457263(0x10f)](a37_0x2fd988[_0x457263(0x108)](_0x457263(0xf9)+_0x43ee13)),console[_0x457263(0x10f)](a37_0x2fd988[_0x457263(0x10d)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x2f2f08=_0x18c0ce[_0x457263(0x101)][_0x457263(0xec)];return saveSessionContext({'segment_path':_0x2f2f08,'parent_segment':_0x2f2f08},_0x144897),console[_0x457263(0xdd)](a37_0x2fd988['green']('✔\x20Context\x20set\x20to:\x20'+a37_0x2fd988[_0x457263(0x10d)](_0x2f2f08))),0x0;}const _0x3a13cc=_0x626290[_0x457263(0xf7)];let _0x8bad44=_0x43ee13;const _0x376989=parsePath(_0x43ee13);if(!_0x376989[_0x457263(0xf1)]){if(!_0x3a13cc)return console['error'](a37_0x2fd988[_0x457263(0x108)](_0x457263(0xe9))),console['error'](a37_0x2fd988['cyan'](_0x457263(0xf8))),0x1;if(_0x43ee13==='..'){const _0x442de8=_0x3a13cc[_0x457263(0x110)]('/')['slice'](0x0,-0x1)[_0x457263(0xef)]('/');_0x8bad44=_0x442de8||'/';}else _0x43ee13==='.'?_0x8bad44=_0x3a13cc:_0x8bad44=_0x3a13cc+'/'+_0x43ee13;_0x626290['verbose']&&console[_0x457263(0x10f)](_0x457263(0xf2)+_0x8bad44);}if(_0x8bad44==='/'||_0x8bad44==='')return saveSessionContext({'segment_path':undefined},_0x144897),console[_0x457263(0xdd)](a37_0x2fd988[_0x457263(0xdb)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x8bad44=normalizePath(_0x8bad44);const _0x346605=parsePath(_0x8bad44)[_0x457263(0xdf)];if(_0x346605[_0x457263(0xe6)]===0x0)return saveSessionContext({'segment_path':undefined},_0x144897),console[_0x457263(0xdd)](a37_0x2fd988[_0x457263(0xdb)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x626290[_0x457263(0xda)]&&(console[_0x457263(0x10f)](_0x457263(0xe2)+_0x626290[_0x457263(0xeb)]),console['error'](_0x457263(0xe3)+_0x8bad44));const _0x69e932=await withSpinner(_0x457263(0x10a)+_0x8bad44+_0x457263(0x100),()=>_0x5342d6[_0x457263(0x106)]['resolvePathToResource'](_0x8bad44),{'verbose':_0x626290['verbose']}),_0x2db396=_0x69e932[_0x457263(0x107)];_0x626290['verbose']&&(console[_0x457263(0x10f)](_0x457263(0x111)+_0x2db396[_0x457263(0xf6)]),console[_0x457263(0x10f)](_0x457263(0xf4)+_0x2db396[_0x457263(0xe1)]),_0x2db396[_0x457263(0xfe)]&&console[_0x457263(0x10f)]('Folder\x20ID:\x20'+_0x2db396[_0x457263(0xfe)]));if(_0x2db396[_0x457263(0xf6)]===_0x457263(0x106))return console[_0x457263(0x10f)](a37_0x2fd988['red'](_0x457263(0x102))),console[_0x457263(0x10f)](_0x457263(0xf0)),console[_0x457263(0x10f)](a37_0x2fd988['cyan']('Use:\x20tdx\x20segment\x20use\x20'+_0x2db396[_0x457263(0xde)]+(_0x2db396[_0x457263(0xfb)]?'/'+_0x2db396[_0x457263(0xfb)][_0x457263(0xef)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x2db396['fullPath'],'parent_segment':_0x2db396[_0x457263(0xde)]},_0x144897),console[_0x457263(0xdd)](a37_0x2fd988[_0x457263(0xdb)](_0x457263(0xea)+a37_0x2fd988['cyan'](_0x2db396[_0x457263(0xfa)]))),_0x626290[_0x457263(0xda)]&&(console['error'](a37_0x2fd988[_0x457263(0xe0)](_0x457263(0xed))),console[_0x457263(0x10f)](a37_0x2fd988[_0x457263(0xe0)](_0x457263(0x105)))),0x0;}catch(_0x411d5e){throw _0x411d5e;}}}
1
+ const a37_0x5b5998=a37_0x1c9b;(function(_0x4b28d4,_0x3cc662){const _0x51f9a6=a37_0x1c9b,_0x3536c4=_0x4b28d4();while(!![]){try{const _0x479d15=parseInt(_0x51f9a6(0x9e))/0x1*(-parseInt(_0x51f9a6(0xce))/0x2)+-parseInt(_0x51f9a6(0xc8))/0x3+-parseInt(_0x51f9a6(0xbc))/0x4*(parseInt(_0x51f9a6(0xbe))/0x5)+parseInt(_0x51f9a6(0xa5))/0x6+-parseInt(_0x51f9a6(0xc7))/0x7*(-parseInt(_0x51f9a6(0xc4))/0x8)+-parseInt(_0x51f9a6(0xcf))/0x9+parseInt(_0x51f9a6(0xaa))/0xa;if(_0x479d15===_0x3cc662)break;else _0x3536c4['push'](_0x3536c4['shift']());}catch(_0x3aa753){_0x3536c4['push'](_0x3536c4['shift']());}}}(a37_0x2156,0xa9679));import{existsSync,statSync}from'fs';import a37_0x536541 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a37_0x1c9b(_0x3cc281,_0x27ce22){_0x3cc281=_0x3cc281-0x96;const _0x21565a=a37_0x2156();let _0x1c9b79=_0x21565a[_0x3cc281];return _0x1c9b79;}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';import{findTdxConfig}from'../utils/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a37_0x5b5998(0xad)]='segment:use';[a37_0x5b5998(0x97)]=a37_0x5b5998(0xa0);async['execute'](_0x337cec){const _0x4c6eba=a37_0x5b5998,{options:_0x1ebb54,args:_0x13c534,tdx:_0x755aca}=_0x337cec;if(_0x13c534['length']===0x0)return console[_0x4c6eba(0xa2)](a37_0x536541[_0x4c6eba(0xb0)](_0x4c6eba(0xaf))),console[_0x4c6eba(0xa2)](_0x4c6eba(0xb7)),console[_0x4c6eba(0xa2)](_0x4c6eba(0x9f)),console[_0x4c6eba(0xa2)](_0x4c6eba(0xac)),console['error'](_0x4c6eba(0xc2)),console[_0x4c6eba(0xa2)](_0x4c6eba(0xb4)),console[_0x4c6eba(0xa2)]('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x3318f3=_0x13c534[0x0],_0x40339a=_0x1ebb54[_0x4c6eba(0xa8)];try{if(_0x3318f3==='/')return saveSessionContext({'segment_path':undefined},_0x40339a),console[_0x4c6eba(0xbb)](a37_0x536541['green']('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x3318f3)&&statSync(_0x3318f3)[_0x4c6eba(0x9d)]()){let _0x21e63b;try{_0x21e63b=findTdxConfig(_0x3318f3);}catch{return console[_0x4c6eba(0xa2)](a37_0x536541['red'](_0x4c6eba(0xbf)+_0x3318f3)),console['error'](a37_0x536541[_0x4c6eba(0xc0)](_0x4c6eba(0x99))),0x1;}const _0x5baf63=_0x21e63b[_0x4c6eba(0x9c)][_0x4c6eba(0xc3)];return saveSessionContext({'segment_path':_0x5baf63,'parent_segment':_0x5baf63},_0x40339a),console['log'](a37_0x536541[_0x4c6eba(0xb6)](_0x4c6eba(0xa3)+a37_0x536541[_0x4c6eba(0xc0)](_0x5baf63))),0x0;}const _0xe18aa4=_0x1ebb54[_0x4c6eba(0xa7)];let _0x92c71e=_0x3318f3;const _0x3b8c55=parsePath(_0x3318f3);if(!_0x3b8c55[_0x4c6eba(0xa6)]){if(!_0xe18aa4)return console[_0x4c6eba(0xa2)](a37_0x536541[_0x4c6eba(0xb0)](_0x4c6eba(0xae))),console[_0x4c6eba(0xa2)](a37_0x536541[_0x4c6eba(0xc0)](_0x4c6eba(0x9a))),0x1;if(_0x3318f3==='..'){const _0x240f13=_0xe18aa4[_0x4c6eba(0xca)]('/')[_0x4c6eba(0xab)](0x0,-0x1)[_0x4c6eba(0xb2)]('/');_0x92c71e=_0x240f13||'/';}else _0x3318f3==='.'?_0x92c71e=_0xe18aa4:_0x92c71e=_0xe18aa4+'/'+_0x3318f3;_0x1ebb54[_0x4c6eba(0xb8)]&&console[_0x4c6eba(0xa2)](_0x4c6eba(0xba)+_0x92c71e);}if(_0x92c71e==='/'||_0x92c71e==='')return saveSessionContext({'segment_path':undefined},_0x40339a),console[_0x4c6eba(0xbb)](a37_0x536541[_0x4c6eba(0xb6)](_0x4c6eba(0xc9))),0x0;_0x92c71e=normalizePath(_0x92c71e);const _0xf9544=parsePath(_0x92c71e)['segments'];if(_0xf9544[_0x4c6eba(0xa4)]===0x0)return saveSessionContext({'segment_path':undefined},_0x40339a),console[_0x4c6eba(0xbb)](a37_0x536541[_0x4c6eba(0xb6)](_0x4c6eba(0xc9))),0x0;_0x1ebb54[_0x4c6eba(0xb8)]&&(console[_0x4c6eba(0xa2)](_0x4c6eba(0xb5)+_0x1ebb54[_0x4c6eba(0xc1)]),console[_0x4c6eba(0xa2)]('Target\x20path:\x20'+_0x92c71e));const _0x15e0bf=await withSpinner('Resolving\x20path\x20\x27'+_0x92c71e+'\x27...',()=>_0x755aca[_0x4c6eba(0x98)][_0x4c6eba(0xb3)](_0x92c71e),{'verbose':_0x1ebb54[_0x4c6eba(0xb8)]}),_0x4f85aa=_0x15e0bf[_0x4c6eba(0xc5)];_0x1ebb54[_0x4c6eba(0xb8)]&&(console[_0x4c6eba(0xa2)]('Resolved\x20path\x20type:\x20'+_0x4f85aa[_0x4c6eba(0xbd)]),console[_0x4c6eba(0xa2)](_0x4c6eba(0xcb)+_0x4f85aa['parentId']),_0x4f85aa[_0x4c6eba(0xcd)]&&console[_0x4c6eba(0xa2)]('Folder\x20ID:\x20'+_0x4f85aa[_0x4c6eba(0xcd)]));if(_0x4f85aa[_0x4c6eba(0xbd)]===_0x4c6eba(0x98))return console['error'](a37_0x536541[_0x4c6eba(0xb0)](_0x4c6eba(0xb9))),console[_0x4c6eba(0xa2)](_0x4c6eba(0xa1)),console[_0x4c6eba(0xa2)](a37_0x536541['cyan']('Use:\x20tdx\x20segment\x20use\x20'+_0x4f85aa[_0x4c6eba(0x96)]+(_0x4f85aa[_0x4c6eba(0xb1)]?'/'+_0x4f85aa[_0x4c6eba(0xb1)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x4f85aa[_0x4c6eba(0xc6)],'parent_segment':_0x4f85aa['parentName']},_0x40339a),console['log'](a37_0x536541['green'](_0x4c6eba(0xa3)+a37_0x536541[_0x4c6eba(0xc0)](_0x4f85aa[_0x4c6eba(0xc6)]))),_0x1ebb54[_0x4c6eba(0xb8)]&&(console[_0x4c6eba(0xa2)](a37_0x536541['dim'](_0x4c6eba(0xcc))),console[_0x4c6eba(0xa2)](a37_0x536541[_0x4c6eba(0x9b)](_0x4c6eba(0xa9)))),0x0;}catch(_0x282103){throw _0x282103;}}}function a37_0x2156(){const _0x301c78=['\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','parent_segment','152SUhoWU','data','fullPath','244657ecBBAm','3894141zZkzhG','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','split','Parent\x20ID:\x20','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','folderId','6OewVsI','6482520INHNoD','parentName','description','segment','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','dim','config','isDirectory','145053arAIsr','Examples:','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','error','✔\x20Context\x20set\x20to:\x20','length','2908374ExaBAy','isAbsolute','segmentPath','session','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','28993640GtBqXT','slice','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','name','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','Error:\x20Path\x20is\x20required\x0a','red','folderPath','join','resolvePathToResource','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Site:\x20','green','Usage:\x20tdx\x20segment\x20use\x20<path>','verbose','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Resolved\x20relative\x20path\x20to:\x20','log','1492DzzxJX','type','12075TXfANN','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','cyan','site'];a37_0x2156=function(){return _0x301c78;};return a37_0x2156();}
@@ -1 +1 @@
1
- const a38_0x59051d=a38_0x550c;(function(_0x177a22,_0x27b67c){const _0x7c7e83=a38_0x550c,_0x2fcc63=_0x177a22();while(!![]){try{const _0x25d1bc=parseInt(_0x7c7e83(0x1cf))/0x1+-parseInt(_0x7c7e83(0x1e0))/0x2*(-parseInt(_0x7c7e83(0x1e2))/0x3)+parseInt(_0x7c7e83(0x1d4))/0x4+-parseInt(_0x7c7e83(0x1bf))/0x5+parseInt(_0x7c7e83(0x1ce))/0x6+parseInt(_0x7c7e83(0x1d1))/0x7*(-parseInt(_0x7c7e83(0x1c7))/0x8)+-parseInt(_0x7c7e83(0x1e5))/0x9*(parseInt(_0x7c7e83(0x1ae))/0xa);if(_0x25d1bc===_0x27b67c)break;else _0x2fcc63['push'](_0x2fcc63['shift']());}catch(_0x290630){_0x2fcc63['push'](_0x2fcc63['shift']());}}}(a38_0x2948,0x45b27));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a38_0x2948(){const _0x3cca9d=['dim','\x20folder','Building\x20hierarchy\x20tree...','journeyBundleName','\x20top-level\x20items','length','15608RRqhdq','segments','No\x20items\x20match\x20pattern:\x20','Resolving\x20path\x20\x27','Folder/pattern\x20arg:\x20','replace','log','1217808ZHRlZT','446847JmCMvL','folder','1638AfDnGP','listJourneysFromParentSegment','site','1406824ZhscIZ','verbose','message','parentId','listUnified','Parent\x20ID:\x20','\x5c$&','jsonl','segment','json','test','maxDepth','108574HYOTQJ','✔\x20Found\x20','24QZiJzb',',\x20and\x20','listWithPattern','3069045VKawqQ','List\x20folders\x20and\x20child\x20segments','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','description','Set\x20a\x20parent\x20segment\x20context\x20first:','Folder\x20ID:\x20','journey','web','Resolving\x20parent\x20segment\x20\x27','filter','\x20journey','error','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','Recursive\x20mode:\x20enabled','folderId','cause','resolvePathToResource','name','\x20segment','Listing\x20folders,\x20segments,\x20and\x20journeys...','Error:\x20','10wcFzUo','\x27...','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','\x20matching\x20\x27','Site:\x20','Error:\x20No\x20parent\x20segment\x20context\x20set.','format','data','localeCompare','listRecursive','/app/ps/','/e/','parentSegment','✔\x20Built\x20tree\x20with\x20','map','(empty)','all','1763995pRuMWo','sort'];a38_0x2948=function(){return _0x3cca9d;};return a38_0x2948();}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a38_0x550c(_0x371373,_0xd1d6cc){_0x371373=_0x371373-0x1a9;const _0x29483c=a38_0x2948();let _0x550c74=_0x29483c[_0x371373];return _0x550c74;}import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{getConsoleNextUrl}from'../types/endpoints.js';import a38_0x3c99bb from'chalk';export class SegmentsCommand extends BaseCommand{[a38_0x59051d(0x1aa)]=a38_0x59051d(0x1c8);[a38_0x59051d(0x1e8)]=a38_0x59051d(0x1e6);async['execute'](_0x46832d){const _0x2675dd=a38_0x59051d,{options:_0xf45623,args:_0x19c784}=_0x46832d,_0x51aba1=_0xf45623['recursive'],_0x22e533=_0x19c784[0x0];try{const _0x5e1cfe=_0xf45623[_0x2675dd(0x1ba)];_0xf45623[_0x2675dd(0x1d5)]&&(console[_0x2675dd(0x1f0)](_0x2675dd(0x1b2)+_0xf45623['site']),console[_0x2675dd(0x1f0)]('Parent\x20segment\x20context:\x20'+(_0x5e1cfe||'(not\x20set)')),_0x22e533&&console[_0x2675dd(0x1f0)](_0x2675dd(0x1cb)+_0x22e533),_0x51aba1&&console[_0x2675dd(0x1f0)](_0x2675dd(0x1f2)));if(!_0x5e1cfe)return console[_0x2675dd(0x1f0)](_0x2675dd(0x1b3)),console[_0x2675dd(0x1f0)](''),console[_0x2675dd(0x1f0)](_0x2675dd(0x1e9)),console['error'](_0x2675dd(0x1b0)),console[_0x2675dd(0x1f0)](_0x2675dd(0x1f1)),console['error'](''),console[_0x2675dd(0x1f0)](_0x2675dd(0x1e7)),0x1;const _0x14b14c=_0x22e533&&(_0x22e533['includes']('*')||_0x22e533['includes']('?'));if(_0x14b14c)return await this[_0x2675dd(0x1e4)](_0x46832d,_0x5e1cfe,_0x22e533);const _0xe97d2b=_0x22e533?_0x5e1cfe+'/'+_0x22e533:_0x5e1cfe;return _0x51aba1?await this[_0x2675dd(0x1b7)](_0x46832d,_0xe97d2b):await this[_0x2675dd(0x1d8)](_0x46832d,_0xe97d2b);}catch(_0x25a182){if(_0x25a182 instanceof SDKError)return console[_0x2675dd(0x1f0)](_0x2675dd(0x1ad)+_0x25a182[_0x2675dd(0x1d6)]),_0x25a182[_0x2675dd(0x1f4)]&&console[_0x2675dd(0x1f0)]('\x20\x20Cause:\x20'+_0x25a182[_0x2675dd(0x1f4)]),0x1;throw _0x25a182;}}async[a38_0x59051d(0x1e4)](_0x5de7a5,_0xeb4099,_0x1909be){const _0x167ce7=a38_0x59051d,{options:_0x53d81f,tdx:_0x3fabab}=_0x5de7a5,_0xf6a9bc=_0x53d81f[_0x167ce7(0x1ec)],_0x95ad8c=await withSpinner(_0x167ce7(0x1ed)+_0xeb4099+_0x167ce7(0x1af),()=>_0x3fabab[_0x167ce7(0x1dc)]['resolvePathToResource'](_0xeb4099),{'verbose':_0x53d81f[_0x167ce7(0x1d5)]}),_0x12d8ba=_0x95ad8c[_0x167ce7(0x1b5)],_0x6ed14d=await withSpinner(_0x167ce7(0x1ac),()=>Promise[_0x167ce7(0x1be)]([_0x3fabab[_0x167ce7(0x1dc)][_0x167ce7(0x1d8)](_0x12d8ba['parentId'],_0x12d8ba[_0x167ce7(0x1f3)]),_0x3fabab[_0x167ce7(0x1eb)][_0x167ce7(0x1d2)](_0x12d8ba[_0x167ce7(0x1d7)])]),{'verbose':_0x53d81f[_0x167ce7(0x1d5)]}),[_0x3f9ec8,_0x4f97a5]=_0x6ed14d[_0x167ce7(0x1b5)],{folders:_0x14ac3d,segments:_0x3034a3}=_0x3f9ec8,_0x419704=_0x1909be[_0x167ce7(0x1cc)](/[.+^${}()|[\]\\]/g,_0x167ce7(0x1da))[_0x167ce7(0x1cc)](/\*/g,'.*')[_0x167ce7(0x1cc)](/\?/g,'.'),_0x50bd9=new RegExp('^'+_0x419704+'$','i'),_0x492796=_0x14ac3d[_0x167ce7(0x1ee)](_0x15c6da=>_0x50bd9[_0x167ce7(0x1de)](_0x15c6da[_0x167ce7(0x1aa)])),_0x5de7dd=_0x3034a3[_0x167ce7(0x1ee)](_0x3e459f=>_0x50bd9[_0x167ce7(0x1de)](_0x3e459f[_0x167ce7(0x1aa)])),_0x2215aa=_0x4f97a5['filter'](_0x90e58c=>_0x50bd9['test'](_0x90e58c['journeyBundleName'])),_0x3e310f=_0x492796[_0x167ce7(0x1c6)]+_0x5de7dd['length']+_0x2215aa['length'];console[_0x167ce7(0x1f0)](_0x167ce7(0x1e1)+_0x492796[_0x167ce7(0x1c6)]+_0x167ce7(0x1c2)+(_0x492796[_0x167ce7(0x1c6)]!==0x1?'s':'')+',\x20'+_0x5de7dd[_0x167ce7(0x1c6)]+'\x20segment'+(_0x5de7dd[_0x167ce7(0x1c6)]!==0x1?'s':'')+_0x167ce7(0x1e3)+_0x2215aa[_0x167ce7(0x1c6)]+_0x167ce7(0x1ef)+(_0x2215aa['length']!==0x1?'s':'')+_0x167ce7(0x1b1)+_0x1909be+'\x27');const _0x5889b1=_0xa62a47=>{const _0x5be402=_0x167ce7;return getConsoleNextUrl(_0x53d81f[_0x5be402(0x1d3)],_0x5be402(0x1b8)+_0x12d8ba[_0x5be402(0x1d7)]+_0x5be402(0x1b9)+_0xa62a47);},_0x17112d=_0x53d81f[_0x167ce7(0x1b4)]===_0x167ce7(0x1dd)||_0x53d81f[_0x167ce7(0x1b4)]===_0x167ce7(0x1db);if(_0x17112d){const _0x340162=[..._0x492796[_0x167ce7(0x1bc)](_0x7a229d=>({..._0x7a229d,'type':_0x167ce7(0x1d0)})),..._0x5de7dd[_0x167ce7(0x1bc)](_0x4c4169=>({..._0x4c4169,'type':'segment','url':_0x5889b1(_0x4c4169['id'])})),..._0x2215aa['map'](_0x2655b8=>({..._0x2655b8,'name':_0x2655b8[_0x167ce7(0x1c4)],'type':_0x167ce7(0x1eb)}))][_0x167ce7(0x1c0)]((_0x11d9f7,_0x14c99f)=>_0x11d9f7[_0x167ce7(0x1aa)][_0x167ce7(0x1b6)](_0x14c99f[_0x167ce7(0x1aa)]));await handleSDKOutput(_0x340162,_0x53d81f);}else{if(_0x3e310f===0x0)console[_0x167ce7(0x1cd)](_0x167ce7(0x1c9)+_0x1909be);else{console[_0x167ce7(0x1cd)](a38_0x3c99bb[_0x167ce7(0x1c1)]('['+_0xeb4099+']\x20matching\x20\x27'+_0x1909be+'\x27'));const _0x3e2efa=formatFlatList(_0x492796,_0x5de7dd,{'showMetadata':!![],'showUrl':_0xf6a9bc,'getSegmentUrl':_0x5889b1},_0x2215aa);console['log'](_0x3e2efa);}}return 0x0;}async[a38_0x59051d(0x1d8)](_0xdb8d12,_0x24eaf4){const _0x3d18c9=a38_0x59051d,{options:_0x21c375,tdx:_0x5af3bd}=_0xdb8d12,_0x569bfc=_0x21c375[_0x3d18c9(0x1ec)],_0x30013e=await withSpinner(_0x3d18c9(0x1ca)+_0x24eaf4+'\x27...',()=>_0x5af3bd['segment'][_0x3d18c9(0x1a9)](_0x24eaf4),{'verbose':_0x21c375['verbose']}),_0x1211ed=_0x30013e[_0x3d18c9(0x1b5)];_0x21c375[_0x3d18c9(0x1d5)]&&(console['error'](_0x3d18c9(0x1d9)+_0x1211ed[_0x3d18c9(0x1d7)]),_0x1211ed[_0x3d18c9(0x1f3)]&&console[_0x3d18c9(0x1f0)](_0x3d18c9(0x1ea)+_0x1211ed['folderId']));const _0x446712=await withSpinner(_0x3d18c9(0x1ac),()=>Promise['all']([_0x5af3bd[_0x3d18c9(0x1dc)][_0x3d18c9(0x1d8)](_0x1211ed[_0x3d18c9(0x1d7)],_0x1211ed[_0x3d18c9(0x1f3)]),_0x5af3bd[_0x3d18c9(0x1eb)]['listJourneysFromParentSegment'](_0x1211ed[_0x3d18c9(0x1d7)])]),{'verbose':_0x21c375[_0x3d18c9(0x1d5)]}),[_0x55937f,_0x1a40fb]=_0x446712[_0x3d18c9(0x1b5)],{folders:_0x55deb4,segments:_0x45064a}=_0x55937f,_0x1cb7fa=_0x55deb4['length']+_0x45064a[_0x3d18c9(0x1c6)]+_0x1a40fb[_0x3d18c9(0x1c6)];console[_0x3d18c9(0x1f0)](_0x3d18c9(0x1e1)+_0x55deb4[_0x3d18c9(0x1c6)]+_0x3d18c9(0x1c2)+(_0x55deb4['length']!==0x1?'s':'')+',\x20'+_0x45064a['length']+_0x3d18c9(0x1ab)+(_0x45064a[_0x3d18c9(0x1c6)]!==0x1?'s':'')+_0x3d18c9(0x1e3)+_0x1a40fb[_0x3d18c9(0x1c6)]+_0x3d18c9(0x1ef)+(_0x1a40fb['length']!==0x1?'s':''));const _0xa00a3d=_0x39c5ae=>{const _0x436e09=_0x3d18c9;return getConsoleNextUrl(_0x21c375[_0x436e09(0x1d3)],_0x436e09(0x1b8)+_0x1211ed[_0x436e09(0x1d7)]+_0x436e09(0x1b9)+_0x39c5ae);},_0x114429=_0x21c375[_0x3d18c9(0x1b4)]===_0x3d18c9(0x1dd)||_0x21c375[_0x3d18c9(0x1b4)]===_0x3d18c9(0x1db);if(_0x114429){const _0x36b7f7=[..._0x55deb4['map'](_0x5b2115=>({..._0x5b2115,'type':_0x3d18c9(0x1d0)})),..._0x45064a[_0x3d18c9(0x1bc)](_0x207ff9=>({..._0x207ff9,'type':_0x3d18c9(0x1dc),'url':_0xa00a3d(_0x207ff9['id'])})),..._0x1a40fb[_0x3d18c9(0x1bc)](_0x2e1f1c=>({..._0x2e1f1c,'name':_0x2e1f1c[_0x3d18c9(0x1c4)],'type':_0x3d18c9(0x1eb)}))][_0x3d18c9(0x1c0)]((_0x4bcffc,_0x593fc5)=>_0x4bcffc['name']['localeCompare'](_0x593fc5[_0x3d18c9(0x1aa)]));await handleSDKOutput(_0x36b7f7,_0x21c375);}else{if(_0x1cb7fa===0x0)console['log'](a38_0x3c99bb[_0x3d18c9(0x1c1)]('['+_0x24eaf4+']')),console[_0x3d18c9(0x1cd)](_0x3d18c9(0x1bd));else{console[_0x3d18c9(0x1cd)](a38_0x3c99bb['dim']('['+_0x24eaf4+']'));const _0x40cc9e=formatFlatList(_0x55deb4,_0x45064a,{'showMetadata':!![],'showUrl':_0x569bfc,'getSegmentUrl':_0xa00a3d},_0x1a40fb);console[_0x3d18c9(0x1cd)](_0x40cc9e);}}return 0x0;}async[a38_0x59051d(0x1b7)](_0xebbe7e,_0x21d3fa){const _0x5a65fc=a38_0x59051d,{options:_0x38d014,tdx:_0xa6774c}=_0xebbe7e,_0x5afdeb=_0x38d014[_0x5a65fc(0x1ec)],_0x4eccdd=await withSpinner(_0x5a65fc(0x1ca)+_0x21d3fa+_0x5a65fc(0x1af),()=>_0xa6774c['segment'][_0x5a65fc(0x1a9)](_0x21d3fa),{'verbose':_0x38d014['verbose']}),_0x3e154f=_0x4eccdd[_0x5a65fc(0x1b5)];_0x38d014[_0x5a65fc(0x1d5)]&&(console[_0x5a65fc(0x1f0)](_0x5a65fc(0x1d9)+_0x3e154f['parentId']),_0x3e154f[_0x5a65fc(0x1f3)]&&console[_0x5a65fc(0x1f0)](_0x5a65fc(0x1ea)+_0x3e154f['folderId']));const _0x148f0c=_0x38d014[_0x5a65fc(0x1df)]||0xa,_0x173687=await withSpinner(_0x5a65fc(0x1c3),()=>_0xa6774c['segment'][_0x5a65fc(0x1b7)](_0x3e154f['parentId'],_0x3e154f[_0x5a65fc(0x1f3)],0x0,_0x148f0c),{'verbose':_0x38d014[_0x5a65fc(0x1d5)]}),_0x4aed55=_0x173687[_0x5a65fc(0x1b5)];console[_0x5a65fc(0x1f0)](_0x5a65fc(0x1bb)+_0x4aed55[_0x5a65fc(0x1c6)]+_0x5a65fc(0x1c5));const _0x2e9282=_0x522bcc=>{const _0x390d92=_0x5a65fc;return getConsoleNextUrl(_0x38d014['site'],_0x390d92(0x1b8)+_0x3e154f[_0x390d92(0x1d7)]+_0x390d92(0x1b9)+_0x522bcc);};if(_0x38d014[_0x5a65fc(0x1b4)]===_0x5a65fc(0x1dd)||_0x38d014['format']===_0x5a65fc(0x1db))await handleSDKOutput(_0x4aed55,_0x38d014);else{console[_0x5a65fc(0x1cd)](a38_0x3c99bb[_0x5a65fc(0x1c1)]('['+_0x21d3fa+']'));const _0x20401e=formatTree(_0x4aed55,{'showMetadata':!![],'showUrl':_0x5afdeb,'getSegmentUrl':_0x2e9282});console['log'](_0x20401e);}return 0x0;}}
1
+ const a38_0x3b69c5=a38_0x1470;(function(_0x26e4a9,_0xda61ac){const _0x3e8a43=a38_0x1470,_0x3ea68b=_0x26e4a9();while(!![]){try{const _0x2790ff=-parseInt(_0x3e8a43(0xe7))/0x1*(-parseInt(_0x3e8a43(0xc4))/0x2)+parseInt(_0x3e8a43(0xcd))/0x3*(-parseInt(_0x3e8a43(0xdb))/0x4)+parseInt(_0x3e8a43(0xe9))/0x5+parseInt(_0x3e8a43(0xe1))/0x6+-parseInt(_0x3e8a43(0xb3))/0x7+parseInt(_0x3e8a43(0xdd))/0x8*(parseInt(_0x3e8a43(0xd5))/0x9)+-parseInt(_0x3e8a43(0xb6))/0xa*(-parseInt(_0x3e8a43(0xf4))/0xb);if(_0x2790ff===_0xda61ac)break;else _0x3ea68b['push'](_0x3ea68b['shift']());}catch(_0x10172d){_0x3ea68b['push'](_0x3ea68b['shift']());}}}(a38_0x3c47,0x5d24a));function a38_0x3c47(){const _0xa6d072=['✔\x20Found\x20','listUnified','all','\x20top-level\x20items','Error:\x20','58172adUFMI','Building\x20hierarchy\x20tree...','8560XiUTtj','Listing\x20folders,\x20segments,\x20and\x20journeys...','\x20journey','maxDepth','1775916rzkPhm','\x27...','folder','length','name','data','15883qoYSwe','listWithPattern','2295440frYjvP','test','log','\x20\x20Cause:\x20','\x20matching\x20\x27','cause','recursive','web','localeCompare','segment','parentId','121whsntw','resolvePathToResource','sort','format','filter','(not\x20set)','replace','error','parentSegment','\x20folder','Resolving\x20path\x20\x27','Recursive\x20mode:\x20enabled','3295901lJZAhF','verbose','description','142280CKpjad','folderId','\x20segment','journeyBundleName','✔\x20Built\x20tree\x20with\x20','Parent\x20segment\x20context:\x20','No\x20items\x20match\x20pattern:\x20','Folder\x20ID:\x20','segments','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22',',\x20and\x20','Parent\x20ID:\x20','/e/','site','20CyvLiF','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','includes','jsonl','json','listJourneysFromParentSegment','\x5c$&','listRecursive','Resolving\x20parent\x20segment\x20\x27','75FnCgSz','message','map','journey','List\x20folders\x20and\x20child\x20segments','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','dim','Folder/pattern\x20arg:\x20','1224qgUmpw'];a38_0x3c47=function(){return _0xa6d072;};return a38_0x3c47();}function a38_0x1470(_0x529163,_0x3b2786){_0x529163=_0x529163-0xab;const _0x3c4751=a38_0x3c47();let _0x147021=_0x3c4751[_0x529163];return _0x147021;}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{getConsoleNextUrl}from'../types/endpoints.js';import a38_0x2b866f from'chalk';export class SegmentsCommand extends BaseCommand{[a38_0x3b69c5(0xe5)]=a38_0x3b69c5(0xbe);[a38_0x3b69c5(0xb5)]=a38_0x3b69c5(0xd1);async['execute'](_0x419a95){const _0x3399f8=a38_0x3b69c5,{options:_0x4db958,args:_0x13f98d}=_0x419a95,_0x49db68=_0x4db958[_0x3399f8(0xef)],_0x715c1a=_0x13f98d[0x0];try{const _0x5857a3=_0x4db958[_0x3399f8(0xaf)];_0x4db958[_0x3399f8(0xb4)]&&(console[_0x3399f8(0xae)]('Site:\x20'+_0x4db958[_0x3399f8(0xc3)]),console[_0x3399f8(0xae)](_0x3399f8(0xbb)+(_0x5857a3||_0x3399f8(0xac))),_0x715c1a&&console['error'](_0x3399f8(0xd4)+_0x715c1a),_0x49db68&&console[_0x3399f8(0xae)](_0x3399f8(0xb2)));if(!_0x5857a3)return console[_0x3399f8(0xae)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x3399f8(0xae)](''),console[_0x3399f8(0xae)]('Set\x20a\x20parent\x20segment\x20context\x20first:'),console[_0x3399f8(0xae)](_0x3399f8(0xbf)),console[_0x3399f8(0xae)](_0x3399f8(0xd2)),console[_0x3399f8(0xae)](''),console[_0x3399f8(0xae)](_0x3399f8(0xc5)),0x1;const _0x3e28f4=_0x715c1a&&(_0x715c1a[_0x3399f8(0xc6)]('*')||_0x715c1a[_0x3399f8(0xc6)]('?'));if(_0x3e28f4)return await this[_0x3399f8(0xe8)](_0x419a95,_0x5857a3,_0x715c1a);const _0x20783e=_0x715c1a?_0x5857a3+'/'+_0x715c1a:_0x5857a3;return _0x49db68?await this[_0x3399f8(0xcb)](_0x419a95,_0x20783e):await this[_0x3399f8(0xd7)](_0x419a95,_0x20783e);}catch(_0x37f8e0){if(_0x37f8e0 instanceof SDKError)return console['error'](_0x3399f8(0xda)+_0x37f8e0[_0x3399f8(0xce)]),_0x37f8e0[_0x3399f8(0xee)]&&console[_0x3399f8(0xae)](_0x3399f8(0xec)+_0x37f8e0[_0x3399f8(0xee)]),0x1;throw _0x37f8e0;}}async[a38_0x3b69c5(0xe8)](_0x36a6e0,_0xb4fe2b,_0x46eea2){const _0x4c6b1e=a38_0x3b69c5,{options:_0x1f5162,tdx:_0x464e43}=_0x36a6e0,_0x2b736b=_0x1f5162[_0x4c6b1e(0xf0)],_0x1948de=await withSpinner(_0x4c6b1e(0xcc)+_0xb4fe2b+'\x27...',()=>_0x464e43['segment'][_0x4c6b1e(0xf5)](_0xb4fe2b),{'verbose':_0x1f5162[_0x4c6b1e(0xb4)]}),_0x526e19=_0x1948de['data'],_0x5ef20a=await withSpinner(_0x4c6b1e(0xde),()=>Promise[_0x4c6b1e(0xd8)]([_0x464e43['segment'][_0x4c6b1e(0xd7)](_0x526e19[_0x4c6b1e(0xf3)],_0x526e19[_0x4c6b1e(0xb7)]),_0x464e43[_0x4c6b1e(0xd0)][_0x4c6b1e(0xc9)](_0x526e19[_0x4c6b1e(0xf3)])]),{'verbose':_0x1f5162[_0x4c6b1e(0xb4)]}),[_0x162f53,_0x2a66e4]=_0x5ef20a[_0x4c6b1e(0xe6)],{folders:_0x34e610,segments:_0x347a2b}=_0x162f53,_0x4ec745=_0x46eea2[_0x4c6b1e(0xad)](/[.+^${}()|[\]\\]/g,_0x4c6b1e(0xca))['replace'](/\*/g,'.*')['replace'](/\?/g,'.'),_0x26055c=new RegExp('^'+_0x4ec745+'$','i'),_0x59d49b=_0x34e610[_0x4c6b1e(0xab)](_0x53dc96=>_0x26055c[_0x4c6b1e(0xea)](_0x53dc96[_0x4c6b1e(0xe5)])),_0x5307da=_0x347a2b[_0x4c6b1e(0xab)](_0x500cc9=>_0x26055c['test'](_0x500cc9['name'])),_0x2b5f8e=_0x2a66e4['filter'](_0x4da842=>_0x26055c[_0x4c6b1e(0xea)](_0x4da842['journeyBundleName'])),_0x464dbe=_0x59d49b[_0x4c6b1e(0xe4)]+_0x5307da[_0x4c6b1e(0xe4)]+_0x2b5f8e['length'];console[_0x4c6b1e(0xae)](_0x4c6b1e(0xd6)+_0x59d49b[_0x4c6b1e(0xe4)]+_0x4c6b1e(0xb0)+(_0x59d49b[_0x4c6b1e(0xe4)]!==0x1?'s':'')+',\x20'+_0x5307da['length']+'\x20segment'+(_0x5307da['length']!==0x1?'s':'')+_0x4c6b1e(0xc0)+_0x2b5f8e[_0x4c6b1e(0xe4)]+_0x4c6b1e(0xdf)+(_0x2b5f8e[_0x4c6b1e(0xe4)]!==0x1?'s':'')+_0x4c6b1e(0xed)+_0x46eea2+'\x27');const _0x358143=_0x17e4c9=>{const _0x5041c4=_0x4c6b1e;return getConsoleNextUrl(_0x1f5162[_0x5041c4(0xc3)],'/app/ps/'+_0x526e19[_0x5041c4(0xf3)]+_0x5041c4(0xc2)+_0x17e4c9);},_0xdb3cac=_0x1f5162[_0x4c6b1e(0xf7)]==='json'||_0x1f5162['format']===_0x4c6b1e(0xc7);if(_0xdb3cac){const _0x3b2219=[..._0x59d49b[_0x4c6b1e(0xcf)](_0x1a2af8=>({..._0x1a2af8,'type':'folder'})),..._0x5307da[_0x4c6b1e(0xcf)](_0x1e9f9d=>({..._0x1e9f9d,'type':_0x4c6b1e(0xf2),'url':_0x358143(_0x1e9f9d['id'])})),..._0x2b5f8e[_0x4c6b1e(0xcf)](_0x5e7f58=>({..._0x5e7f58,'name':_0x5e7f58[_0x4c6b1e(0xb9)],'type':_0x4c6b1e(0xd0)}))][_0x4c6b1e(0xf6)]((_0x423977,_0x38fc6c)=>_0x423977[_0x4c6b1e(0xe5)][_0x4c6b1e(0xf1)](_0x38fc6c['name']));await handleSDKOutput(_0x3b2219,_0x1f5162);}else{if(_0x464dbe===0x0)console[_0x4c6b1e(0xeb)](_0x4c6b1e(0xbc)+_0x46eea2);else{console['log'](a38_0x2b866f[_0x4c6b1e(0xd3)]('['+_0xb4fe2b+']\x20matching\x20\x27'+_0x46eea2+'\x27'));const _0x1771ef=formatFlatList(_0x59d49b,_0x5307da,{'showMetadata':!![],'showUrl':_0x2b736b,'getSegmentUrl':_0x358143},_0x2b5f8e);console['log'](_0x1771ef);}}return 0x0;}async[a38_0x3b69c5(0xd7)](_0x2c85ec,_0x3f7491){const _0xbd05b8=a38_0x3b69c5,{options:_0x4d3def,tdx:_0x56f77f}=_0x2c85ec,_0x9d9bc2=_0x4d3def['web'],_0x520b1a=await withSpinner(_0xbd05b8(0xb1)+_0x3f7491+_0xbd05b8(0xe2),()=>_0x56f77f[_0xbd05b8(0xf2)]['resolvePathToResource'](_0x3f7491),{'verbose':_0x4d3def[_0xbd05b8(0xb4)]}),_0x40b3e9=_0x520b1a[_0xbd05b8(0xe6)];_0x4d3def[_0xbd05b8(0xb4)]&&(console[_0xbd05b8(0xae)](_0xbd05b8(0xc1)+_0x40b3e9[_0xbd05b8(0xf3)]),_0x40b3e9[_0xbd05b8(0xb7)]&&console['error']('Folder\x20ID:\x20'+_0x40b3e9[_0xbd05b8(0xb7)]));const _0x4f2cfc=await withSpinner(_0xbd05b8(0xde),()=>Promise[_0xbd05b8(0xd8)]([_0x56f77f[_0xbd05b8(0xf2)][_0xbd05b8(0xd7)](_0x40b3e9['parentId'],_0x40b3e9[_0xbd05b8(0xb7)]),_0x56f77f[_0xbd05b8(0xd0)][_0xbd05b8(0xc9)](_0x40b3e9[_0xbd05b8(0xf3)])]),{'verbose':_0x4d3def[_0xbd05b8(0xb4)]}),[_0x1e9d52,_0x3ce74c]=_0x4f2cfc[_0xbd05b8(0xe6)],{folders:_0x3a0ccc,segments:_0x56add3}=_0x1e9d52,_0x5b4105=_0x3a0ccc['length']+_0x56add3[_0xbd05b8(0xe4)]+_0x3ce74c[_0xbd05b8(0xe4)];console[_0xbd05b8(0xae)]('✔\x20Found\x20'+_0x3a0ccc[_0xbd05b8(0xe4)]+_0xbd05b8(0xb0)+(_0x3a0ccc[_0xbd05b8(0xe4)]!==0x1?'s':'')+',\x20'+_0x56add3[_0xbd05b8(0xe4)]+_0xbd05b8(0xb8)+(_0x56add3[_0xbd05b8(0xe4)]!==0x1?'s':'')+_0xbd05b8(0xc0)+_0x3ce74c[_0xbd05b8(0xe4)]+_0xbd05b8(0xdf)+(_0x3ce74c[_0xbd05b8(0xe4)]!==0x1?'s':''));const _0x2c8806=_0x4d433d=>{const _0xa984e8=_0xbd05b8;return getConsoleNextUrl(_0x4d3def['site'],'/app/ps/'+_0x40b3e9[_0xa984e8(0xf3)]+_0xa984e8(0xc2)+_0x4d433d);},_0x4489c1=_0x4d3def['format']===_0xbd05b8(0xc8)||_0x4d3def[_0xbd05b8(0xf7)]===_0xbd05b8(0xc7);if(_0x4489c1){const _0x5b5aa7=[..._0x3a0ccc['map'](_0x2debf2=>({..._0x2debf2,'type':_0xbd05b8(0xe3)})),..._0x56add3[_0xbd05b8(0xcf)](_0x2e052c=>({..._0x2e052c,'type':_0xbd05b8(0xf2),'url':_0x2c8806(_0x2e052c['id'])})),..._0x3ce74c[_0xbd05b8(0xcf)](_0x523f56=>({..._0x523f56,'name':_0x523f56[_0xbd05b8(0xb9)],'type':_0xbd05b8(0xd0)}))][_0xbd05b8(0xf6)]((_0x5840cd,_0x446d24)=>_0x5840cd['name'][_0xbd05b8(0xf1)](_0x446d24[_0xbd05b8(0xe5)]));await handleSDKOutput(_0x5b5aa7,_0x4d3def);}else{if(_0x5b4105===0x0)console['log'](a38_0x2b866f[_0xbd05b8(0xd3)]('['+_0x3f7491+']')),console['log']('(empty)');else{console[_0xbd05b8(0xeb)](a38_0x2b866f[_0xbd05b8(0xd3)]('['+_0x3f7491+']'));const _0x1bbcba=formatFlatList(_0x3a0ccc,_0x56add3,{'showMetadata':!![],'showUrl':_0x9d9bc2,'getSegmentUrl':_0x2c8806},_0x3ce74c);console['log'](_0x1bbcba);}}return 0x0;}async[a38_0x3b69c5(0xcb)](_0x335280,_0x2f4ee1){const _0x41d39d=a38_0x3b69c5,{options:_0x34ed96,tdx:_0x228f91}=_0x335280,_0xf1c2f1=_0x34ed96[_0x41d39d(0xf0)],_0xcfdd41=await withSpinner('Resolving\x20path\x20\x27'+_0x2f4ee1+'\x27...',()=>_0x228f91[_0x41d39d(0xf2)]['resolvePathToResource'](_0x2f4ee1),{'verbose':_0x34ed96[_0x41d39d(0xb4)]}),_0x9cb6e1=_0xcfdd41[_0x41d39d(0xe6)];_0x34ed96[_0x41d39d(0xb4)]&&(console[_0x41d39d(0xae)](_0x41d39d(0xc1)+_0x9cb6e1[_0x41d39d(0xf3)]),_0x9cb6e1['folderId']&&console[_0x41d39d(0xae)](_0x41d39d(0xbd)+_0x9cb6e1[_0x41d39d(0xb7)]));const _0x3d2c3f=_0x34ed96[_0x41d39d(0xe0)]||0xa,_0x24befc=await withSpinner(_0x41d39d(0xdc),()=>_0x228f91[_0x41d39d(0xf2)][_0x41d39d(0xcb)](_0x9cb6e1[_0x41d39d(0xf3)],_0x9cb6e1[_0x41d39d(0xb7)],0x0,_0x3d2c3f),{'verbose':_0x34ed96[_0x41d39d(0xb4)]}),_0x1f6d7c=_0x24befc[_0x41d39d(0xe6)];console[_0x41d39d(0xae)](_0x41d39d(0xba)+_0x1f6d7c['length']+_0x41d39d(0xd9));const _0x414bde=_0x1c5bef=>{const _0x3160aa=_0x41d39d;return getConsoleNextUrl(_0x34ed96[_0x3160aa(0xc3)],'/app/ps/'+_0x9cb6e1['parentId']+_0x3160aa(0xc2)+_0x1c5bef);};if(_0x34ed96[_0x41d39d(0xf7)]==='json'||_0x34ed96['format']===_0x41d39d(0xc7))await handleSDKOutput(_0x1f6d7c,_0x34ed96);else{console[_0x41d39d(0xeb)](a38_0x2b866f[_0x41d39d(0xd3)]('['+_0x2f4ee1+']'));const _0x557493=formatTree(_0x1f6d7c,{'showMetadata':!![],'showUrl':_0xf1c2f1,'getSegmentUrl':_0x414bde});console['log'](_0x557493);}return 0x0;}}
@@ -1 +1 @@
1
- const a39_0x4fd869=a39_0x5066;(function(_0x2ce372,_0x3c84d7){const _0x331607=a39_0x5066,_0x9be2d6=_0x2ce372();while(!![]){try{const _0xac2c48=-parseInt(_0x331607(0xbd))/0x1*(parseInt(_0x331607(0xaf))/0x2)+parseInt(_0x331607(0xb9))/0x3+parseInt(_0x331607(0xb3))/0x4+parseInt(_0x331607(0xb0))/0x5+parseInt(_0x331607(0xb5))/0x6*(-parseInt(_0x331607(0xb7))/0x7)+-parseInt(_0x331607(0xcf))/0x8*(-parseInt(_0x331607(0xae))/0x9)+-parseInt(_0x331607(0xbf))/0xa;if(_0xac2c48===_0x3c84d7)break;else _0x9be2d6['push'](_0x9be2d6['shift']());}catch(_0x3e41ed){_0x9be2d6['push'](_0x9be2d6['shift']());}}}(a39_0x3586,0x82eb0));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a39_0x3586(){const _0x33be09=['Show\x20table\x20contents','✔\x20Retrieved\x20','\x20from\x20','\x20\x20Cause:\x20','cause','...','184ibZJTl','validate','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','verbose','database','Site:\x20','query','396783FcGxwq','24fJcqPv','4174685ZAEOmQ','Limit:\x20','limit','3058008nnSNAE','Error:\x20','1267746rVpSvu','execute','7UNQJoL','\x20row','1277406KfJYeO','Database:\x20','length','name','42906iVhjSJ','error','17768390LQLelZ','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','Catalog:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','catalog','description','data','showTable','message','args'];a39_0x3586=function(){return _0x33be09;};return a39_0x3586();}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 a39_0x5066(_0x3e02d6,_0x3a4fd3){_0x3e02d6=_0x3e02d6-0xab;const _0x358625=a39_0x3586();let _0x5066af=_0x358625[_0x3e02d6];return _0x5066af;}export class ShowCommand extends BaseCommand{[a39_0x4fd869(0xbc)]='show';[a39_0x4fd869(0xc4)]=a39_0x4fd869(0xc9);async[a39_0x4fd869(0xb6)](_0xf163b7){return this['showTable'](_0xf163b7);}async[a39_0x4fd869(0xc6)](_0x14d7ea){const _0x59a337=a39_0x4fd869,{options:_0x1c9828,args:_0x1c0dca,tdx:_0x405d60}=_0x14d7ea;let _0x3f49cc;try{_0x3f49cc=parseTableReference(_0x1c0dca[0x0]);const _0x26dcca=_0x1c9828['database'];!_0x3f49cc[_0x59a337(0xab)]&&_0x26dcca&&(_0x3f49cc['database']=_0x26dcca);const _0xf928f=validateTableDescribeReference(_0x3f49cc);if(_0xf928f)return console[_0x59a337(0xbe)](_0x59a337(0xb4)+_0xf928f),console[_0x59a337(0xbe)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x59a337(0xbe)](_0x59a337(0xc2)),console[_0x59a337(0xbe)](_0x59a337(0xc0)),0x1;}catch(_0x3dc35f){return console[_0x59a337(0xbe)](_0x59a337(0xb4)+_0x3dc35f['message']),console[_0x59a337(0xbe)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x59a337(0xbe)](_0x59a337(0xc2)),console[_0x59a337(0xbe)](_0x59a337(0xc0)),0x1;}const _0x167d93=_0x3f49cc[_0x59a337(0xc3)],_0x457c4a=_0x3f49cc[_0x59a337(0xab)],_0x4cc603=_0x3f49cc['table'],_0x229f9c=resolveLimit(_0x1c9828[_0x59a337(0xb2)],DEFAULT_DISPLAY_LIMIT);try{_0x1c9828[_0x59a337(0xd3)]&&(console[_0x59a337(0xbe)](_0x59a337(0xac)+_0x1c9828['site']),_0x167d93&&console[_0x59a337(0xbe)](_0x59a337(0xc1)+_0x167d93),console[_0x59a337(0xbe)](_0x59a337(0xba)+_0x457c4a),console[_0x59a337(0xbe)]('Table:\x20'+_0x4cc603),console[_0x59a337(0xbe)](_0x59a337(0xb1)+_0x229f9c));const _0x56e578=_0x167d93?_0x167d93+'.'+_0x457c4a+'.'+_0x4cc603:_0x457c4a+'.'+_0x4cc603,_0x4c9e37=await withSpinner('Querying\x20'+_0x56e578+_0x59a337(0xce),()=>_0x405d60[_0x59a337(0xad)][_0x59a337(0xc6)](_0x457c4a,_0x4cc603,_0x229f9c,_0x167d93),{'verbose':_0x1c9828[_0x59a337(0xd3)]}),_0xa5cfa1=_0x4c9e37[_0x59a337(0xc5)],_0xf7b6a8=_0xa5cfa1['data'];return _0xf7b6a8[_0x59a337(0xbb)]===0x0?console[_0x59a337(0xbe)](_0x59a337(0xd1)):console[_0x59a337(0xbe)](_0x59a337(0xca)+_0xf7b6a8[_0x59a337(0xbb)]+_0x59a337(0xb8)+(_0xf7b6a8[_0x59a337(0xbb)]!==0x1?'s':'')+_0x59a337(0xcb)+_0x56e578),await handleSDKOutput(_0xf7b6a8,_0x1c9828),0x0;}catch(_0x4f8041){if(_0x4f8041 instanceof SDKError)return console[_0x59a337(0xbe)]('Error:\x20'+_0x4f8041[_0x59a337(0xc7)]),_0x4f8041[_0x59a337(0xcd)]&&console[_0x59a337(0xbe)](_0x59a337(0xcc)+_0x4f8041['cause']),0x1;throw _0x4f8041;}}[a39_0x4fd869(0xd0)](_0x491ac2){const _0x1221a4=a39_0x4fd869;if(_0x491ac2['args']['length']===0x0)return _0x1221a4(0xd2);if(_0x491ac2[_0x1221a4(0xc8)][_0x1221a4(0xbb)]>0x1)return'Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';return undefined;}}
1
+ const a39_0x2d6264=a39_0xa680;(function(_0x26bb49,_0x310e08){const _0x4b40c6=a39_0xa680,_0x1f081a=_0x26bb49();while(!![]){try{const _0x1c4cde=-parseInt(_0x4b40c6(0x19d))/0x1+-parseInt(_0x4b40c6(0x1a2))/0x2*(-parseInt(_0x4b40c6(0x1aa))/0x3)+-parseInt(_0x4b40c6(0x19e))/0x4*(parseInt(_0x4b40c6(0x195))/0x5)+parseInt(_0x4b40c6(0x193))/0x6*(-parseInt(_0x4b40c6(0x18e))/0x7)+parseInt(_0x4b40c6(0x19f))/0x8+parseInt(_0x4b40c6(0x1ae))/0x9+parseInt(_0x4b40c6(0x197))/0xa;if(_0x1c4cde===_0x310e08)break;else _0x1f081a['push'](_0x1f081a['shift']());}catch(_0x568432){_0x1f081a['push'](_0x1f081a['shift']());}}}(a39_0x4030,0xb3552));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a39_0x4030(){const _0x3d4c80=['args','7dbxUjY','cause','Catalog:\x20','error','message','7125168uJArji','...','245PHbWxv','verbose','6549190TjZjTv','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','Usage:\x20tdx\x20show\x20<database.table>','Table:\x20','limit','Limit:\x20','442066NrlDen','7268wYbPbU','3386072uwEpBT','Show\x20table\x20contents','✔\x20Retrieved\x20','1198CdSxsA','catalog','execute','Error:\x20','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','description','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','site','4035LAeDUk','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','length','database','5124060TqjTvK','data','Querying\x20','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','\x20row','Site:\x20'];a39_0x4030=function(){return _0x3d4c80;};return a39_0x4030();}function a39_0xa680(_0x2d2d83,_0x5a5745){_0x2d2d83=_0x2d2d83-0x188;const _0x4030bd=a39_0x4030();let _0xa68023=_0x4030bd[_0x2d2d83];return _0xa68023;}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']='show';[a39_0x2d6264(0x1a7)]=a39_0x2d6264(0x1a0);async[a39_0x2d6264(0x1a4)](_0x49715b){return this['showTable'](_0x49715b);}async['showTable'](_0x4fcece){const _0x4e847c=a39_0x2d6264,{options:_0x110243,args:_0x3a58c4,tdx:_0x833539}=_0x4fcece;let _0x42b887;try{_0x42b887=parseTableReference(_0x3a58c4[0x0]);const _0xa87e44=_0x110243[_0x4e847c(0x1ad)];!_0x42b887[_0x4e847c(0x1ad)]&&_0xa87e44&&(_0x42b887[_0x4e847c(0x1ad)]=_0xa87e44);const _0x4bea94=validateTableDescribeReference(_0x42b887);if(_0x4bea94)return console[_0x4e847c(0x191)](_0x4e847c(0x1a5)+_0x4bea94),console[_0x4e847c(0x191)](_0x4e847c(0x199)),console[_0x4e847c(0x191)](_0x4e847c(0x1ab)),console[_0x4e847c(0x191)](_0x4e847c(0x1a8)),0x1;}catch(_0x1d0c45){return console['error'](_0x4e847c(0x1a5)+_0x1d0c45[_0x4e847c(0x192)]),console['error']('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x4e847c(0x191)](_0x4e847c(0x1ab)),console[_0x4e847c(0x191)](_0x4e847c(0x1a8)),0x1;}const _0x25820e=_0x42b887[_0x4e847c(0x1a3)],_0x7af1bb=_0x42b887[_0x4e847c(0x1ad)],_0x1c3d93=_0x42b887['table'],_0x3c5161=resolveLimit(_0x110243[_0x4e847c(0x19b)],DEFAULT_DISPLAY_LIMIT);try{_0x110243[_0x4e847c(0x196)]&&(console['error'](_0x4e847c(0x18c)+_0x110243[_0x4e847c(0x1a9)]),_0x25820e&&console[_0x4e847c(0x191)](_0x4e847c(0x190)+_0x25820e),console[_0x4e847c(0x191)]('Database:\x20'+_0x7af1bb),console[_0x4e847c(0x191)](_0x4e847c(0x19a)+_0x1c3d93),console[_0x4e847c(0x191)](_0x4e847c(0x19c)+_0x3c5161));const _0x4860ae=_0x25820e?_0x25820e+'.'+_0x7af1bb+'.'+_0x1c3d93:_0x7af1bb+'.'+_0x1c3d93,_0x4a5b20=await withSpinner(_0x4e847c(0x189)+_0x4860ae+_0x4e847c(0x194),()=>_0x833539['query']['showTable'](_0x7af1bb,_0x1c3d93,_0x3c5161,_0x25820e),{'verbose':_0x110243[_0x4e847c(0x196)]}),_0x2185c7=_0x4a5b20[_0x4e847c(0x188)],_0x186eca=_0x2185c7['data'];return _0x186eca[_0x4e847c(0x1ac)]===0x0?console[_0x4e847c(0x191)](_0x4e847c(0x18a)):console[_0x4e847c(0x191)](_0x4e847c(0x1a1)+_0x186eca[_0x4e847c(0x1ac)]+_0x4e847c(0x18b)+(_0x186eca[_0x4e847c(0x1ac)]!==0x1?'s':'')+'\x20from\x20'+_0x4860ae),await handleSDKOutput(_0x186eca,_0x110243),0x0;}catch(_0x11ef3a){if(_0x11ef3a instanceof SDKError)return console[_0x4e847c(0x191)](_0x4e847c(0x1a5)+_0x11ef3a[_0x4e847c(0x192)]),_0x11ef3a[_0x4e847c(0x18f)]&&console['error']('\x20\x20Cause:\x20'+_0x11ef3a[_0x4e847c(0x18f)]),0x1;throw _0x11ef3a;}}['validate'](_0x548b64){const _0x344889=a39_0x2d6264;if(_0x548b64['args'][_0x344889(0x1ac)]===0x0)return _0x344889(0x198);if(_0x548b64[_0x344889(0x18d)][_0x344889(0x1ac)]>0x1)return _0x344889(0x1a6);return undefined;}}
@@ -1 +1 @@
1
- const a40_0x1088d0=a40_0x1248;(function(_0x4db278,_0x368b09){const _0x5d535e=a40_0x1248,_0x57b019=_0x4db278();while(!![]){try{const _0x308473=parseInt(_0x5d535e(0x135))/0x1+-parseInt(_0x5d535e(0x123))/0x2+parseInt(_0x5d535e(0x121))/0x3+parseInt(_0x5d535e(0x132))/0x4*(-parseInt(_0x5d535e(0x131))/0x5)+parseInt(_0x5d535e(0x134))/0x6*(parseInt(_0x5d535e(0x124))/0x7)+parseInt(_0x5d535e(0x14f))/0x8*(parseInt(_0x5d535e(0x129))/0x9)+-parseInt(_0x5d535e(0x12c))/0xa*(-parseInt(_0x5d535e(0x142))/0xb);if(_0x308473===_0x368b09)break;else _0x57b019['push'](_0x57b019['shift']());}catch(_0x4a07a2){_0x57b019['push'](_0x57b019['shift']());}}}(a40_0x18ef,0x3a315));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a40_0x1248(_0x240b75,_0xa62b52){_0x240b75=_0x240b75-0x121;const _0x18ef40=a40_0x18ef();let _0x1248ce=_0x18ef40[_0x240b75];return _0x1248ce;}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';[a40_0x1088d0(0x14a)]=a40_0x1088d0(0x12e);async[a40_0x1088d0(0x136)](_0x4fd57d){const _0x2fe6fb=a40_0x1088d0,{options:_0x46948d,args:_0x200a73,tdx:_0x273e82}=_0x4fd57d;let _0x3d3581;if(_0x200a73[_0x2fe6fb(0x12a)]===0x0)_0x3d3581={'database':undefined,'table':undefined,'original':''};else{if(_0x200a73[_0x2fe6fb(0x12a)]===0x1)try{_0x3d3581=parseTableReference(_0x200a73[0x0]);if(_0x3d3581[_0x2fe6fb(0x133)]&&!_0x3d3581[_0x2fe6fb(0x122)]&&!_0x3d3581['table']['includes']('*')&&!_0x3d3581[_0x2fe6fb(0x133)][_0x2fe6fb(0x13f)]('?'))return console[_0x2fe6fb(0x12d)](_0x2fe6fb(0x137)+_0x200a73[0x0]+_0x2fe6fb(0x13b)),console[_0x2fe6fb(0x12d)](_0x2fe6fb(0x14b)+_0x3d3581[_0x2fe6fb(0x133)]+'\x27?'),console[_0x2fe6fb(0x12d)](_0x2fe6fb(0x145)+_0x3d3581[_0x2fe6fb(0x133)]+_0x2fe6fb(0x12b)),console['error'](_0x2fe6fb(0x151)+_0x3d3581[_0x2fe6fb(0x133)]),console['error']('\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20'+_0x3d3581['table']),console[_0x2fe6fb(0x12d)](''),console[_0x2fe6fb(0x12d)]('Note:\x20\x27'+_0x200a73[0x0]+_0x2fe6fb(0x152)+_0x3d3581[_0x2fe6fb(0x133)]+_0x2fe6fb(0x13d)),0x1;}catch(_0x1c3e85){return console[_0x2fe6fb(0x12d)](_0x2fe6fb(0x130)+_0x1c3e85[_0x2fe6fb(0x141)]),0x1;}else return console[_0x2fe6fb(0x12d)](_0x2fe6fb(0x125)),console[_0x2fe6fb(0x12d)]('\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases'),console['error'](_0x2fe6fb(0x147)),console[_0x2fe6fb(0x12d)](_0x2fe6fb(0x13e)),console[_0x2fe6fb(0x12d)]('\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases'),console['error'](_0x2fe6fb(0x148)),console[_0x2fe6fb(0x12d)](_0x2fe6fb(0x146)),0x1;}const _0x1f12b5=_0x46948d['database'];!_0x3d3581[_0x2fe6fb(0x122)]&&_0x1f12b5&&(_0x3d3581[_0x2fe6fb(0x122)]=_0x1f12b5);try{const _0x4e7ae6=_0x343c0b=>_0x343c0b&&(_0x343c0b['includes']('*')||_0x343c0b[_0x2fe6fb(0x13f)]('?')),_0x1489ba=_0x4e7ae6(_0x3d3581[_0x2fe6fb(0x122)]);_0x46948d['verbose']&&(console[_0x2fe6fb(0x12d)](_0x2fe6fb(0x144)+_0x46948d[_0x2fe6fb(0x127)]),_0x3d3581['database']?_0x1489ba?console[_0x2fe6fb(0x12d)]('Database\x20pattern:\x20'+_0x3d3581['database']):console['error'](_0x2fe6fb(0x14d)+_0x3d3581['database']):console[_0x2fe6fb(0x12d)](_0x2fe6fb(0x140)),_0x3d3581[_0x2fe6fb(0x133)]&&console[_0x2fe6fb(0x12d)](_0x2fe6fb(0x14e)+_0x3d3581[_0x2fe6fb(0x133)]));const _0x1e852e=_0x3d3581[_0x2fe6fb(0x122)]&&!_0x1489ba?_0x3d3581[_0x2fe6fb(0x122)]:undefined,_0x3e3a85=_0x1489ba?_0x3d3581[_0x2fe6fb(0x122)]:undefined,_0x3254e1=_0x3d3581['table'],_0x45dbac=resolveLimit(_0x46948d[_0x2fe6fb(0x126)],DEFAULT_LISTING_LIMIT),_0x43d866=await withSpinner(_0x2fe6fb(0x143),()=>_0x273e82[_0x2fe6fb(0x14c)][_0x2fe6fb(0x139)](_0x1e852e,_0x3254e1,_0x3e3a85,_0x45dbac),{'verbose':_0x46948d['verbose']}),_0x4d73c6=_0x43d866['data'];if(_0x4d73c6[_0x2fe6fb(0x12a)]===0x0&&_0x3d3581[_0x2fe6fb(0x122)]&&!_0x1489ba)return console['error'](_0x2fe6fb(0x150)),console[_0x2fe6fb(0x12d)](_0x2fe6fb(0x13c)+_0x3d3581['database']+_0x2fe6fb(0x13a)),0x1;return console[_0x2fe6fb(0x12d)](_0x2fe6fb(0x128)+_0x4d73c6[_0x2fe6fb(0x12a)]+_0x2fe6fb(0x149)+(_0x4d73c6['length']!==0x1?'s':'')),await handleSDKOutput(_0x4d73c6,{..._0x46948d,'limit':_0x45dbac}),0x0;}catch(_0x48241a){if(_0x48241a instanceof SDKError)return console[_0x2fe6fb(0x12d)]('Error:\x20'+_0x48241a['message']),_0x48241a['cause']&&console[_0x2fe6fb(0x12d)](_0x2fe6fb(0x12f)+_0x48241a['cause']),0x1;throw _0x48241a;}}[a40_0x1088d0(0x138)](_0x145df8){return undefined;}}function a40_0x18ef(){const _0x251069=['746774WOKRed','861JDcWjz','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','limit','site','✔\x20Found\x20','9tnzBZZ','length','.*\x22','11530yLXkNN','error','List\x20tables\x20in\x20a\x20database','\x20\x20Cause:\x20','Error:\x20','648815TObxir','8zLVMYM','table','54EBOlUZ','367199uIbgmI','execute','Error:\x20Pattern\x20\x27','validate','listTables','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','\x27\x20is\x20ambiguous.','Database\x20\x27','\x27\x20across\x20all\x20databases.','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','includes','Database:\x20all','message','3212qCWGdO','Listing\x20tables...','Site:\x20','\x20\x20Use:\x20tdx\x20tables\x20\x22','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Or\x20use\x20--in\x20flag:','\x20table','description','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','query','Database:\x20','Table\x20pattern:\x20','152136bLsgaY','✖\x20No\x20tables\x20found','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','441813DlhiSl','database'];a40_0x18ef=function(){return _0x251069;};return a40_0x18ef();}
1
+ const a40_0x1d1092=a40_0x2c85;(function(_0x1f132e,_0x114026){const _0x33d7b7=a40_0x2c85,_0x47af63=_0x1f132e();while(!![]){try{const _0x3f6df7=-parseInt(_0x33d7b7(0xa4))/0x1+-parseInt(_0x33d7b7(0x81))/0x2*(parseInt(_0x33d7b7(0x98))/0x3)+-parseInt(_0x33d7b7(0x84))/0x4+-parseInt(_0x33d7b7(0x97))/0x5*(parseInt(_0x33d7b7(0x77))/0x6)+-parseInt(_0x33d7b7(0x96))/0x7+parseInt(_0x33d7b7(0x91))/0x8*(parseInt(_0x33d7b7(0x8b))/0x9)+parseInt(_0x33d7b7(0x83))/0xa;if(_0x3f6df7===_0x114026)break;else _0x47af63['push'](_0x47af63['shift']());}catch(_0x59ed71){_0x47af63['push'](_0x47af63['shift']());}}}(a40_0x1492,0xebc51));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';function a40_0x1492(){const _0x561d40=['Database:\x20','\x20\x20Cause:\x20','query','data','68jcNDMJ','\x20table','55536970CuSWGR','4633324HEGqqq','Database\x20\x27','Note:\x20\x27','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','cause','name','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','1735623azsUZI','Error:\x20','tables','Listing\x20tables...','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','72JNoDyl','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','includes','Site:\x20','\x27\x20is\x20ambiguous.','8384530YpfHUD','275LVNKOk','93483aeRzaI','Table\x20pattern:\x20','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','Error:\x20Pattern\x20\x27','message','table','verbose','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','error','validate','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','length','1543682gWQNDW','listTables','.*\x22','148836LsrfxK','database','\x20\x20Use:\x20tdx\x20tables\x20\x22','Database\x20pattern:\x20','execute','✔\x20Found\x20'];a40_0x1492=function(){return _0x561d40;};return a40_0x1492();}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';function a40_0x2c85(_0x2893b8,_0x6f2b6e){_0x2893b8=_0x2893b8-0x75;const _0x1492bd=a40_0x1492();let _0x2c8571=_0x1492bd[_0x2893b8];return _0x2c8571;}import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a40_0x1d1092(0x89)]=a40_0x1d1092(0x8d);['description']='List\x20tables\x20in\x20a\x20database';async[a40_0x1d1092(0x7b)](_0x242f45){const _0x44fb8b=a40_0x1d1092,{options:_0x241314,args:_0x5e3992,tdx:_0x2248b3}=_0x242f45;let _0x497254;if(_0x5e3992[_0x44fb8b(0xa3)]===0x0)_0x497254={'database':undefined,'table':undefined,'original':''};else{if(_0x5e3992[_0x44fb8b(0xa3)]===0x1)try{_0x497254=parseTableReference(_0x5e3992[0x0]);if(_0x497254['table']&&!_0x497254['database']&&!_0x497254[_0x44fb8b(0x9d)][_0x44fb8b(0x93)]('*')&&!_0x497254[_0x44fb8b(0x9d)][_0x44fb8b(0x93)]('?'))return console['error'](_0x44fb8b(0x9b)+_0x5e3992[0x0]+_0x44fb8b(0x95)),console[_0x44fb8b(0xa0)](_0x44fb8b(0x8a)+_0x497254[_0x44fb8b(0x9d)]+'\x27?'),console[_0x44fb8b(0xa0)](_0x44fb8b(0x79)+_0x497254['table']+_0x44fb8b(0x76)),console[_0x44fb8b(0xa0)]('\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'+_0x497254[_0x44fb8b(0x9d)]),console['error'](_0x44fb8b(0xa2)+_0x497254[_0x44fb8b(0x9d)]),console[_0x44fb8b(0xa0)](''),console[_0x44fb8b(0xa0)](_0x44fb8b(0x86)+_0x5e3992[0x0]+_0x44fb8b(0x87)+_0x497254[_0x44fb8b(0x9d)]+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x1eb25e){return console[_0x44fb8b(0xa0)](_0x44fb8b(0x8c)+_0x1eb25e[_0x44fb8b(0x9c)]),0x1;}else return console[_0x44fb8b(0xa0)]('Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'),console[_0x44fb8b(0xa0)](_0x44fb8b(0x9f)),console[_0x44fb8b(0xa0)](_0x44fb8b(0x92)),console['error'](_0x44fb8b(0x90)),console[_0x44fb8b(0xa0)](_0x44fb8b(0x8f)),console[_0x44fb8b(0xa0)]('Or\x20use\x20--in\x20flag:'),console[_0x44fb8b(0xa0)]('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0xfe5c46=_0x241314[_0x44fb8b(0x78)];!_0x497254[_0x44fb8b(0x78)]&&_0xfe5c46&&(_0x497254[_0x44fb8b(0x78)]=_0xfe5c46);try{const _0x15ff89=_0x13d557=>_0x13d557&&(_0x13d557['includes']('*')||_0x13d557[_0x44fb8b(0x93)]('?')),_0x5454bc=_0x15ff89(_0x497254[_0x44fb8b(0x78)]);_0x241314['verbose']&&(console[_0x44fb8b(0xa0)](_0x44fb8b(0x94)+_0x241314['site']),_0x497254[_0x44fb8b(0x78)]?_0x5454bc?console[_0x44fb8b(0xa0)](_0x44fb8b(0x7a)+_0x497254[_0x44fb8b(0x78)]):console[_0x44fb8b(0xa0)](_0x44fb8b(0x7d)+_0x497254[_0x44fb8b(0x78)]):console[_0x44fb8b(0xa0)]('Database:\x20all'),_0x497254[_0x44fb8b(0x9d)]&&console['error'](_0x44fb8b(0x99)+_0x497254[_0x44fb8b(0x9d)]));const _0x476c6a=_0x497254[_0x44fb8b(0x78)]&&!_0x5454bc?_0x497254[_0x44fb8b(0x78)]:undefined,_0x531724=_0x5454bc?_0x497254[_0x44fb8b(0x78)]:undefined,_0x433659=_0x497254[_0x44fb8b(0x9d)],_0x27e421=resolveLimit(_0x241314['limit'],DEFAULT_LISTING_LIMIT),_0x27b6ab=await withSpinner(_0x44fb8b(0x8e),()=>_0x2248b3[_0x44fb8b(0x7f)][_0x44fb8b(0x75)](_0x476c6a,_0x433659,_0x531724,_0x27e421),{'verbose':_0x241314[_0x44fb8b(0x9e)]}),_0x1886ea=_0x27b6ab[_0x44fb8b(0x80)];if(_0x1886ea[_0x44fb8b(0xa3)]===0x0&&_0x497254['database']&&!_0x5454bc)return console[_0x44fb8b(0xa0)]('✖\x20No\x20tables\x20found'),console[_0x44fb8b(0xa0)](_0x44fb8b(0x85)+_0x497254[_0x44fb8b(0x78)]+_0x44fb8b(0x9a)),0x1;return console[_0x44fb8b(0xa0)](_0x44fb8b(0x7c)+_0x1886ea[_0x44fb8b(0xa3)]+_0x44fb8b(0x82)+(_0x1886ea['length']!==0x1?'s':'')),await handleSDKOutput(_0x1886ea,{..._0x241314,'limit':_0x27e421}),0x0;}catch(_0x2c59a8){if(_0x2c59a8 instanceof SDKError)return console[_0x44fb8b(0xa0)](_0x44fb8b(0x8c)+_0x2c59a8['message']),_0x2c59a8[_0x44fb8b(0x88)]&&console['error'](_0x44fb8b(0x7e)+_0x2c59a8['cause']),0x1;throw _0x2c59a8;}}[a40_0x1d1092(0xa1)](_0x59aeb3){return undefined;}}
@@ -1 +1 @@
1
- const a41_0x46c80a=a41_0x5ef0;(function(_0x3bb109,_0x290c8a){const _0x1dad71=a41_0x5ef0,_0x357e1b=_0x3bb109();while(!![]){try{const _0x29e405=-parseInt(_0x1dad71(0x1e5))/0x1+parseInt(_0x1dad71(0x1cc))/0x2+parseInt(_0x1dad71(0x1d7))/0x3+-parseInt(_0x1dad71(0x1cb))/0x4+-parseInt(_0x1dad71(0x1dc))/0x5+parseInt(_0x1dad71(0x1da))/0x6*(parseInt(_0x1dad71(0x1d6))/0x7)+-parseInt(_0x1dad71(0x1db))/0x8*(-parseInt(_0x1dad71(0x1d2))/0x9);if(_0x29e405===_0x290c8a)break;else _0x357e1b['push'](_0x357e1b['shift']());}catch(_0x1d1286){_0x357e1b['push'](_0x357e1b['shift']());}}}(a41_0x5cd2,0x992fc));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';function a41_0x5cd2(){const _0x28f1eb=['join','display','Error:\x20Profile\x20\x27','displayWithSources','\x27\x20does\x20not\x20exist','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','dim','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','cleared','(session:\x20','engage_workspace','database','llm_project','parent_segment','execute','log','Error:\x20','toString','Session\x20llm_project\x20set\x20to:\x20','Invalid\x20resource:\x20','2941904DDtOqk','237836ZysAdt','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','.\x20Must\x20be\x20one\x20of:\x20','description','Session\x20context\x20','Session\x20database\x20set\x20to:\x20','9fnEvBa','\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace\x0a','name','error','14IouYUv','1889157ajVCxo','green','Session\x20engage_workspace\x20set\x20to:\x20','167556pYgimi','10901552UlnIDT','1281900bXFNZG','Session\x20profile\x20set\x20to:\x20','session','profile','length','debug','Set\x20session-level\x20context','use','validate','547875MmclKH','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides'];a41_0x5cd2=function(){return _0x28f1eb;};return a41_0x5cd2();}function a41_0x5ef0(_0x149646,_0x17cb26){_0x149646=_0x149646-0x1ca;const _0x5cd2f0=a41_0x5cd2();let _0x5ef0ce=_0x5cd2f0[_0x149646];return _0x5ef0ce;}import a41_0x2c9ebf from'chalk';export class UseCommand extends BaseCommand{[a41_0x46c80a(0x1d4)]=a41_0x46c80a(0x1e3);[a41_0x46c80a(0x1cf)]=a41_0x46c80a(0x1e2);[a41_0x46c80a(0x1e4)](_0x11b96f){const _0x1a6b97=a41_0x46c80a,{args:_0x2b48ff}=_0x11b96f;if(_0x2b48ff[_0x1a6b97(0x1e0)]===0x0)return undefined;if(_0x2b48ff[_0x1a6b97(0x1e0)]===0x1)return _0x1a6b97(0x1ec)+'\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'+_0x1a6b97(0x1ee)+_0x1a6b97(0x1d3)+_0x1a6b97(0x1cd);const _0x202005=_0x2b48ff[0x0],_0x50baab=['database',_0x1a6b97(0x1f4),_0x1a6b97(0x1f3),_0x1a6b97(0x1df),_0x1a6b97(0x1f1)];if(!_0x50baab['includes'](_0x202005))return _0x1a6b97(0x1ca)+_0x202005+_0x1a6b97(0x1ce)+_0x50baab[_0x1a6b97(0x1e7)](',\x20');return undefined;}async[a41_0x46c80a(0x1f5)](_0x51253b){const _0x442687=a41_0x46c80a,{args:_0x39512b,options:_0xb70db0}=_0x51253b,_0x123baf=_0xb70db0[_0x442687(0x1e1)],_0x1a01b0=_0xb70db0['clear'];cleanExpiredSessions();try{if(_0x1a01b0){clearSessionContext(_0xb70db0['session']);const _0x386fbd=_0xb70db0[_0x442687(0x1de)]||getCurrentSessionPID()[_0x442687(0x1f8)]();return console[_0x442687(0x1f6)](_0x442687(0x1d0)+a41_0x2c9ebf[_0x442687(0x1d8)](_0x442687(0x1ef))+'\x20'+a41_0x2c9ebf[_0x442687(0x1ed)]('(session:\x20'+_0x386fbd+')')),0x0;}if(_0x39512b['length']===0x0){const _0x11abf8=new GlobalContext(_0xb70db0);return _0x123baf?_0x11abf8[_0x442687(0x1ea)]():_0x11abf8[_0x442687(0x1e8)](),console[_0x442687(0x1f6)](a41_0x2c9ebf[_0x442687(0x1ed)]('\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>')),console[_0x442687(0x1f6)](a41_0x2c9ebf[_0x442687(0x1ed)]('Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace')),0x0;}const _0xddff33=_0x39512b[0x0],_0x1600db=_0x39512b[0x1];if(_0xddff33===_0x442687(0x1df)){if(!profileExists(_0x1600db))return console['error'](_0x442687(0x1e9)+_0x1600db+_0x442687(0x1eb)),console[_0x442687(0x1d5)]('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x3f4280=_0xb70db0['session']||getCurrentSessionPID()[_0x442687(0x1f8)]();return saveSessionContext({'profile':_0x1600db},_0xb70db0['session']),console['log'](_0x442687(0x1dd)+a41_0x2c9ebf['green'](_0x1600db)+'\x20'+a41_0x2c9ebf[_0x442687(0x1ed)]('(session:\x20'+_0x3f4280+')')),console[_0x442687(0x1f6)](a41_0x2c9ebf['dim'](_0x442687(0x1e6))),0x0;}const _0xba0e28={},_0x50d09e=_0xb70db0[_0x442687(0x1de)]||getCurrentSessionPID()[_0x442687(0x1f8)]();switch(_0xddff33){case _0x442687(0x1f2):_0xba0e28['database']=_0x1600db,console[_0x442687(0x1f6)](_0x442687(0x1d1)+a41_0x2c9ebf[_0x442687(0x1d8)](_0x1600db)+'\x20'+a41_0x2c9ebf[_0x442687(0x1ed)]('(session:\x20'+_0x50d09e+')'));break;case'parent_segment':_0xba0e28[_0x442687(0x1f4)]=_0x1600db,console[_0x442687(0x1f6)]('Session\x20parent_segment\x20set\x20to:\x20'+a41_0x2c9ebf[_0x442687(0x1d8)](_0x1600db)+'\x20'+a41_0x2c9ebf[_0x442687(0x1ed)](_0x442687(0x1f0)+_0x50d09e+')'));break;case'llm_project':_0xba0e28[_0x442687(0x1f3)]=_0x1600db,console[_0x442687(0x1f6)](_0x442687(0x1f9)+a41_0x2c9ebf[_0x442687(0x1d8)](_0x1600db)+'\x20'+a41_0x2c9ebf[_0x442687(0x1ed)]('(session:\x20'+_0x50d09e+')'));break;case _0x442687(0x1f1):_0xba0e28[_0x442687(0x1f1)]=_0x1600db,console[_0x442687(0x1f6)](_0x442687(0x1d9)+a41_0x2c9ebf[_0x442687(0x1d8)](_0x1600db)+'\x20'+a41_0x2c9ebf[_0x442687(0x1ed)](_0x442687(0x1f0)+_0x50d09e+')'));break;}return saveSessionContext(_0xba0e28,_0xb70db0[_0x442687(0x1de)]),console['log'](a41_0x2c9ebf[_0x442687(0x1ed)](_0x442687(0x1e6))),0x0;}catch(_0x4efe7c){return _0x4efe7c instanceof Error&&console[_0x442687(0x1d5)](_0x442687(0x1f7)+_0x4efe7c['message']),0x1;}}}
1
+ const a41_0x5b9f72=a41_0x45d8;function a41_0x45d8(_0x3856ad,_0x1a7d3a){_0x3856ad=_0x3856ad-0x138;const _0x2652da=a41_0x2652();let _0x45d8e6=_0x2652da[_0x3856ad];return _0x45d8e6;}(function(_0x5b2e86,_0x19f506){const _0xedbb17=a41_0x45d8,_0x5f4154=_0x5b2e86();while(!![]){try{const _0x16d4e2=-parseInt(_0xedbb17(0x13e))/0x1+-parseInt(_0xedbb17(0x14f))/0x2+-parseInt(_0xedbb17(0x155))/0x3+parseInt(_0xedbb17(0x14a))/0x4*(-parseInt(_0xedbb17(0x13a))/0x5)+parseInt(_0xedbb17(0x157))/0x6*(parseInt(_0xedbb17(0x166))/0x7)+-parseInt(_0xedbb17(0x161))/0x8+parseInt(_0xedbb17(0x160))/0x9*(parseInt(_0xedbb17(0x150))/0xa);if(_0x16d4e2===_0x19f506)break;else _0x5f4154['push'](_0x5f4154['shift']());}catch(_0x445c0b){_0x5f4154['push'](_0x5f4154['shift']());}}}(a41_0x2652,0x924d0));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 a41_0x314ea9 from'chalk';function a41_0x2652(){const _0x2c99a6=['join','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','use','Set\x20session-level\x20context','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','701420oIFzow','dim','parent_segment','description','\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace\x0a','271892oNgpwQ','10570wtFJIi','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','toString','(session:\x20','1077939raSeZx','engage_workspace','126pXLLWY','displayWithSources','includes','Invalid\x20resource:\x20','profile','length','validate','Session\x20database\x20set\x20to:\x20','Error:\x20','19287hlhlyl','302288PJKMxX','session','llm_project','Session\x20profile\x20set\x20to:\x20','\x27\x20does\x20not\x20exist','21070bWETnR','log','error','15WQXMEE','green','Error:\x20Profile\x20\x27','Session\x20engage_workspace\x20set\x20to:\x20','670003OClgOa','Session\x20context\x20','database','name','clear','Session\x20llm_project\x20set\x20to:\x20'];a41_0x2652=function(){return _0x2c99a6;};return a41_0x2652();}export class UseCommand extends BaseCommand{[a41_0x5b9f72(0x141)]=a41_0x5b9f72(0x147);[a41_0x5b9f72(0x14d)]=a41_0x5b9f72(0x148);[a41_0x5b9f72(0x15d)](_0x3503fb){const _0x359530=a41_0x5b9f72,{args:_0x32847a}=_0x3503fb;if(_0x32847a[_0x359530(0x15c)]===0x0)return undefined;if(_0x32847a['length']===0x1)return _0x359530(0x146)+'\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'+_0x359530(0x149)+_0x359530(0x14e)+_0x359530(0x151);const _0x1037e8=_0x32847a[0x0],_0x310cd3=[_0x359530(0x140),_0x359530(0x14c),_0x359530(0x163),_0x359530(0x15b),_0x359530(0x156)];if(!_0x310cd3[_0x359530(0x159)](_0x1037e8))return _0x359530(0x15a)+_0x1037e8+'.\x20Must\x20be\x20one\x20of:\x20'+_0x310cd3[_0x359530(0x144)](',\x20');return undefined;}async['execute'](_0x1a4d4d){const _0x4e962d=a41_0x5b9f72,{args:_0x30a886,options:_0x16a333}=_0x1a4d4d,_0x30270a=_0x16a333['debug'],_0x4c1427=_0x16a333[_0x4e962d(0x142)];cleanExpiredSessions();try{if(_0x4c1427){clearSessionContext(_0x16a333[_0x4e962d(0x162)]);const _0xb7dc0c=_0x16a333[_0x4e962d(0x162)]||getCurrentSessionPID()[_0x4e962d(0x153)]();return console[_0x4e962d(0x138)](_0x4e962d(0x13f)+a41_0x314ea9[_0x4e962d(0x13b)]('cleared')+'\x20'+a41_0x314ea9[_0x4e962d(0x14b)](_0x4e962d(0x154)+_0xb7dc0c+')')),0x0;}if(_0x30a886[_0x4e962d(0x15c)]===0x0){const _0x33763f=new GlobalContext(_0x16a333);return _0x30270a?_0x33763f[_0x4e962d(0x158)]():_0x33763f['display'](),console[_0x4e962d(0x138)](a41_0x314ea9[_0x4e962d(0x14b)](_0x4e962d(0x152))),console[_0x4e962d(0x138)](a41_0x314ea9[_0x4e962d(0x14b)](_0x4e962d(0x145))),0x0;}const _0xa88254=_0x30a886[0x0],_0x3959c2=_0x30a886[0x1];if(_0xa88254===_0x4e962d(0x15b)){if(!profileExists(_0x3959c2))return console[_0x4e962d(0x139)](_0x4e962d(0x13c)+_0x3959c2+_0x4e962d(0x165)),console['error']('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x2cf027=_0x16a333[_0x4e962d(0x162)]||getCurrentSessionPID()['toString']();return saveSessionContext({'profile':_0x3959c2},_0x16a333[_0x4e962d(0x162)]),console[_0x4e962d(0x138)](_0x4e962d(0x164)+a41_0x314ea9[_0x4e962d(0x13b)](_0x3959c2)+'\x20'+a41_0x314ea9['dim']('(session:\x20'+_0x2cf027+')')),console[_0x4e962d(0x138)](a41_0x314ea9[_0x4e962d(0x14b)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides')),0x0;}const _0x19e852={},_0x4ce4fd=_0x16a333['session']||getCurrentSessionPID()[_0x4e962d(0x153)]();switch(_0xa88254){case _0x4e962d(0x140):_0x19e852[_0x4e962d(0x140)]=_0x3959c2,console['log'](_0x4e962d(0x15e)+a41_0x314ea9[_0x4e962d(0x13b)](_0x3959c2)+'\x20'+a41_0x314ea9[_0x4e962d(0x14b)](_0x4e962d(0x154)+_0x4ce4fd+')'));break;case _0x4e962d(0x14c):_0x19e852['parent_segment']=_0x3959c2,console[_0x4e962d(0x138)]('Session\x20parent_segment\x20set\x20to:\x20'+a41_0x314ea9[_0x4e962d(0x13b)](_0x3959c2)+'\x20'+a41_0x314ea9[_0x4e962d(0x14b)](_0x4e962d(0x154)+_0x4ce4fd+')'));break;case _0x4e962d(0x163):_0x19e852[_0x4e962d(0x163)]=_0x3959c2,console['log'](_0x4e962d(0x143)+a41_0x314ea9[_0x4e962d(0x13b)](_0x3959c2)+'\x20'+a41_0x314ea9[_0x4e962d(0x14b)]('(session:\x20'+_0x4ce4fd+')'));break;case _0x4e962d(0x156):_0x19e852[_0x4e962d(0x156)]=_0x3959c2,console[_0x4e962d(0x138)](_0x4e962d(0x13d)+a41_0x314ea9[_0x4e962d(0x13b)](_0x3959c2)+'\x20'+a41_0x314ea9['dim']('(session:\x20'+_0x4ce4fd+')'));break;}return saveSessionContext(_0x19e852,_0x16a333['session']),console['log'](a41_0x314ea9[_0x4e962d(0x14b)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides')),0x0;}catch(_0x1d36fe){return _0x1d36fe instanceof Error&&console[_0x4e962d(0x139)](_0x4e962d(0x15f)+_0x1d36fe['message']),0x1;}}}
@@ -1 +1 @@
1
- const a42_0x1ae776=a42_0x10f8;(function(_0x345940,_0x4bb319){const _0x1936bf=a42_0x10f8,_0x5dd3a5=_0x345940();while(!![]){try{const _0x1d2987=-parseInt(_0x1936bf(0x12d))/0x1+parseInt(_0x1936bf(0x13a))/0x2+parseInt(_0x1936bf(0x143))/0x3*(parseInt(_0x1936bf(0x134))/0x4)+parseInt(_0x1936bf(0x12c))/0x5*(parseInt(_0x1936bf(0x145))/0x6)+-parseInt(_0x1936bf(0x136))/0x7+parseInt(_0x1936bf(0x12a))/0x8*(-parseInt(_0x1936bf(0x12b))/0x9)+-parseInt(_0x1936bf(0x140))/0xa*(-parseInt(_0x1936bf(0x128))/0xb);if(_0x1d2987===_0x4bb319)break;else _0x5dd3a5['push'](_0x5dd3a5['shift']());}catch(_0x4c0d1e){_0x5dd3a5['push'](_0x5dd3a5['shift']());}}}(a42_0x4760,0x247b2));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a42_0x4760(){const _0x7b8930=['3126RZSjNe','message','4884011kORCdU','length','735672snzvok','27ALZXJa','5UmnuEE','53989VEqBoc','Show\x20current\x20user\x20information','\x20\x20Cause:\x20','user\x20list','verbose','name','list','60pvFdCa','\x20user','1600354pjchwl','Error:\x20','data','user','384494NrbZKA','cause','description','getCurrent','execute','error','10grsTwJ','✔\x20Found\x20','Listing\x20users...','14229CNCbis','Fetching\x20user\x20info...'];a42_0x4760=function(){return _0x7b8930;};return a42_0x4760();}function a42_0x10f8(_0x54ee91,_0x201c75){_0x54ee91=_0x54ee91-0x127;const _0x476001=a42_0x4760();let _0x10f829=_0x476001[_0x54ee91];return _0x10f829;}import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class UserCommand extends BaseCommand{[a42_0x1ae776(0x132)]='user';['description']=a42_0x1ae776(0x12e);async['execute'](_0x3d130d){const _0x58938b=a42_0x1ae776,{options:_0x197b56,tdx:_0x37b320}=_0x3d130d;try{const _0x3552af=await withSpinner(_0x58938b(0x144),()=>_0x37b320[_0x58938b(0x139)][_0x58938b(0x13d)](),{'verbose':_0x197b56[_0x58938b(0x131)]}),_0x3132bf=_0x3552af['data'];return await handleSingleObjectOutput(_0x3132bf,_0x197b56),0x0;}catch(_0x435e6d){if(_0x435e6d instanceof SDKError)return console[_0x58938b(0x13f)](_0x58938b(0x137)+_0x435e6d[_0x58938b(0x127)]),_0x435e6d[_0x58938b(0x13b)]&&console['error']('\x20\x20Cause:\x20'+_0x435e6d[_0x58938b(0x13b)]),0x1;throw _0x435e6d;}}}export class UserListCommand extends BaseCommand{[a42_0x1ae776(0x132)]=a42_0x1ae776(0x130);[a42_0x1ae776(0x13c)]='List\x20all\x20users\x20in\x20the\x20account';async[a42_0x1ae776(0x13e)](_0x3709f3){const _0x46ce18=a42_0x1ae776,{options:_0x17eeb5,tdx:_0x19a741}=_0x3709f3;try{const _0x227cff=await withSpinner(_0x46ce18(0x142),()=>_0x19a741[_0x46ce18(0x139)][_0x46ce18(0x133)](),{'verbose':_0x17eeb5[_0x46ce18(0x131)]}),_0x48f2c4=_0x227cff[_0x46ce18(0x138)];return console['error'](_0x46ce18(0x141)+_0x48f2c4['length']+_0x46ce18(0x135)+(_0x48f2c4[_0x46ce18(0x129)]!==0x1?'s':'')),await handleSDKOutput(_0x48f2c4,_0x17eeb5),0x0;}catch(_0x3d4fbb){if(_0x3d4fbb instanceof SDKError)return console[_0x46ce18(0x13f)](_0x46ce18(0x137)+_0x3d4fbb[_0x46ce18(0x127)]),_0x3d4fbb[_0x46ce18(0x13b)]&&console[_0x46ce18(0x13f)](_0x46ce18(0x12f)+_0x3d4fbb[_0x46ce18(0x13b)]),0x1;throw _0x3d4fbb;}}}
1
+ const a42_0x5a56dc=a42_0x1222;function a42_0x1222(_0x245769,_0x47c9d5){_0x245769=_0x245769-0x169;const _0x534c9e=a42_0x534c();let _0x12228b=_0x534c9e[_0x245769];return _0x12228b;}function a42_0x534c(){const _0x270b83=['946670TnXKOk','8314009QaplxF','\x20\x20Cause:\x20','user\x20list','data','6662GqvueV','length','name','List\x20all\x20users\x20in\x20the\x20account','description','15SUdqxa','message','100644JczCxJ','getCurrent','12izJvhs','list','453585VXerZg','23576xktpgs','Fetching\x20user\x20info...','21nXhenK','execute','user','1196718nyZZfe','1677tAvOkV','error','cause','Error:\x20','verbose','1962SUoegr','10dWHqtJ'];a42_0x534c=function(){return _0x270b83;};return a42_0x534c();}(function(_0x36fca1,_0x3ce136){const _0x113034=a42_0x1222,_0x5cbef2=_0x36fca1();while(!![]){try{const _0x7e215=parseInt(_0x113034(0x177))/0x1*(-parseInt(_0x113034(0x172))/0x2)+parseInt(_0x113034(0x17d))/0x3+parseInt(_0x113034(0x17b))/0x4*(parseInt(_0x113034(0x16d))/0x5)+parseInt(_0x113034(0x183))/0x6*(-parseInt(_0x113034(0x180))/0x7)+parseInt(_0x113034(0x17e))/0x8*(parseInt(_0x113034(0x16b))/0x9)+-parseInt(_0x113034(0x16c))/0xa*(-parseInt(_0x113034(0x16e))/0xb)+parseInt(_0x113034(0x179))/0xc*(-parseInt(_0x113034(0x184))/0xd);if(_0x7e215===_0x3ce136)break;else _0x5cbef2['push'](_0x5cbef2['shift']());}catch(_0x4bb1fc){_0x5cbef2['push'](_0x5cbef2['shift']());}}}(a42_0x534c,0x5e88f));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';export class UserCommand extends BaseCommand{['name']=a42_0x5a56dc(0x182);['description']='Show\x20current\x20user\x20information';async[a42_0x5a56dc(0x181)](_0x44a0d0){const _0x291ba6=a42_0x5a56dc,{options:_0x3b6e31,tdx:_0x28966e}=_0x44a0d0;try{const _0x415550=await withSpinner(_0x291ba6(0x17f),()=>_0x28966e[_0x291ba6(0x182)][_0x291ba6(0x17a)](),{'verbose':_0x3b6e31[_0x291ba6(0x16a)]}),_0x55b7b7=_0x415550[_0x291ba6(0x171)];return await handleSingleObjectOutput(_0x55b7b7,_0x3b6e31),0x0;}catch(_0x79e311){if(_0x79e311 instanceof SDKError)return console[_0x291ba6(0x185)](_0x291ba6(0x169)+_0x79e311[_0x291ba6(0x178)]),_0x79e311[_0x291ba6(0x186)]&&console['error'](_0x291ba6(0x16f)+_0x79e311[_0x291ba6(0x186)]),0x1;throw _0x79e311;}}}export class UserListCommand extends BaseCommand{[a42_0x5a56dc(0x174)]=a42_0x5a56dc(0x170);[a42_0x5a56dc(0x176)]=a42_0x5a56dc(0x175);async['execute'](_0x53971c){const _0x483634=a42_0x5a56dc,{options:_0x3ef6d4,tdx:_0x1f0172}=_0x53971c;try{const _0x27b60e=await withSpinner('Listing\x20users...',()=>_0x1f0172[_0x483634(0x182)][_0x483634(0x17c)](),{'verbose':_0x3ef6d4[_0x483634(0x16a)]}),_0x5df943=_0x27b60e[_0x483634(0x171)];return console[_0x483634(0x185)]('✔\x20Found\x20'+_0x5df943[_0x483634(0x173)]+'\x20user'+(_0x5df943['length']!==0x1?'s':'')),await handleSDKOutput(_0x5df943,_0x3ef6d4),0x0;}catch(_0x9dab0){if(_0x9dab0 instanceof SDKError)return console[_0x483634(0x185)](_0x483634(0x169)+_0x9dab0['message']),_0x9dab0['cause']&&console[_0x483634(0x185)](_0x483634(0x16f)+_0x9dab0[_0x483634(0x186)]),0x1;throw _0x9dab0;}}}
@@ -1 +1 @@
1
- function a43_0x5c4b(_0xe275ca,_0x22f322){_0xe275ca=_0xe275ca-0x165;const _0x2830a4=a43_0x2830();let _0x5c4b91=_0x2830a4[_0xe275ca];return _0x5c4b91;}const a43_0x5f26a1=a43_0x5c4b;function a43_0x2830(){const _0x49bc2c=['workflow:attempts','session:','Downloading\x20project\x20','✔\x20Downloaded\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','keys','✔\x20Pushed\x20','taskName','fs/promises','attemptId','description','includeRetried','\x20\x20Session\x20ID:\x20','sessions','json','Validation:\x20skipped','cause','Start\x20a\x20workflow\x20run','utf-8','Output\x20directory:\x20','Killing\x20attempt...','length','Expected\x20format:\x20--param\x20key=value','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','run','Error:\x20Invalid\x20JSON\x20in\x20--params','Listing\x20workflow\x20attempts...','split','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Error:\x20Invalid\x20parameter\x20format:\x20','indexOf','Error:\x20Attempt\x20ID\x20is\x20required','Including\x20subtasks:\x20yes','select','Session\x20time:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','retryAttemptName','Include\x20retried:\x20yes','index','workflows','Listing\x20workflow\x20sessions...','attempt','8418MXbVwZ','\x20session','Kill\x20a\x20running\x20attempt','cancelRequested','yes','message','Getting\x20attempt\x20details...','execute','List\x20workflow\x20attempts','Starting\x20workflow\x20run...','substring','name','\x20project','projectName','delete','error','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Downloading\x20logs...','skipValidation','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','\x20\x20New\x20attempt\x20ID:\x20','projectId','282pnbZSA','data','success','isDirectory','List\x20all\x20workflow\x20projects','✔\x20Retry\x20started','project','\x20\x20Project\x20ID:\x20','fromTask','Workflow:\x20','workflow:attempt','Attempt\x20ID:\x20','tasks','✔\x20Deleted\x20project\x20','limit','session','attempts','revision','Project:\x20','sessionId','params','\x20\x20Revision:\x20','340AndLOq','fileSize','sessionTime','Filter:\x20project=','\x20is\x20not\x20a\x20directory','Cancelled','workflow:workflows','7864yTYYBa','No\x20log\x20files\x20found\x20for\x20this\x20attempt','createdAt','6798300WyKwoR','workflow:download','map','status','from','14keMlDe','workflow:kill','35226LjRbCc','5929ZYHYfg','includeSubtasks','Params:\x20','\x20\x20Location:\x20','startsWith','Error:\x20','Reason:\x20','verbose','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Fetching\x20log\x20files...','parse','Pattern:\x20','Status:\x20','resumeFrom','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','workflow:tasks','retrySession','Select\x20a\x20task\x20to\x20view\x20logs:','Project\x20directory:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','workflow','Pushing\x20workflow\x20project...','finishedAt','Usage:\x20workflow:delete\x20<project-name-or-id>','Retrying\x20attempt...','log','canceling','Error:\x20Workflow\x20identifier\x20is\x20required','workflow:delete','isArray','\x20attempt','Deleting\x20project\x20','\x20workflow','attempt:','logs','✔\x20Found\x20','15646455OOQorD','From\x20task:\x20','Filter:\x20','Show\x20specific\x20attempt\x20details','List\x20workflows','reason','task','\x20\x20Attempt\x20ID:\x20','7834473ouULfN','getTime','readFile','logFiles','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','retryAttempt','...','force','\x20task','\x20\x20Cause:\x20','Target:\x20','115740pnsAQT','Project\x20name:\x20','Error:\x20Project\x20name\x20is\x20required','Retrying\x20session...'];a43_0x2830=function(){return _0x49bc2c;};return a43_0x2830();}(function(_0x2f833d,_0xa5914){const _0x16a45e=a43_0x5c4b,_0x51cbce=_0x2f833d();while(!![]){try{const _0x4654de=-parseInt(_0x16a45e(0x1da))/0x1*(-parseInt(_0x16a45e(0x19f))/0x2)+-parseInt(_0x16a45e(0x1dc))/0x3*(parseInt(_0x16a45e(0x1cb))/0x4)+parseInt(_0x16a45e(0x171))/0x5*(parseInt(_0x16a45e(0x1b5))/0x6)+parseInt(_0x16a45e(0x1dd))/0x7*(-parseInt(_0x16a45e(0x1d2))/0x8)+-parseInt(_0x16a45e(0x166))/0x9+parseInt(_0x16a45e(0x1d5))/0xa+parseInt(_0x16a45e(0x201))/0xb;if(_0x4654de===_0xa5914)break;else _0x51cbce['push'](_0x51cbce['shift']());}catch(_0x2875d7){_0x51cbce['push'](_0x51cbce['shift']());}}}(a43_0x2830,0x85c6d));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 a43_0x2c8fc3 from'prompts';export class WorkflowProjectsCommand extends BaseCommand{['name']='workflow:projects';[a43_0x5f26a1(0x17f)]=a43_0x5f26a1(0x1b9);async[a43_0x5f26a1(0x1a6)](_0x40135b){const _0x14c519=a43_0x5f26a1,{options:_0x5772ef,args:_0x4ffc64,tdx:_0x1bdc8c}=_0x40135b,_0x214a64=_0x4ffc64[0x0];try{_0x5772ef[_0x14c519(0x1e4)]&&_0x214a64&&console['error'](_0x14c519(0x1e8)+_0x214a64);const _0x2ff075=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x1bdc8c['workflow']['projects'](_0x214a64,{'limit':_0x5772ef[_0x14c519(0x1c3)]}),{'verbose':_0x5772ef[_0x14c519(0x1e4)]}),_0x38b010=_0x2ff075[_0x14c519(0x1b6)];return console[_0x14c519(0x1ae)]('✔\x20Found\x20'+_0x38b010[_0x14c519(0x18a)]+_0x14c519(0x1ab)+(_0x38b010[_0x14c519(0x18a)]!==0x1?'s':'')),await handleSDKOutput(_0x38b010,_0x5772ef),0x0;}catch(_0x4c3cbc){if(_0x4c3cbc instanceof SDKError)return console['error'](_0x14c519(0x1e2)+_0x4c3cbc[_0x14c519(0x1a4)]),_0x4c3cbc[_0x14c519(0x185)]&&console[_0x14c519(0x1ae)]('\x20\x20Cause:\x20'+_0x4c3cbc['cause']),0x1;throw _0x4c3cbc;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a43_0x5f26a1(0x1aa)]=a43_0x5f26a1(0x1d1);[a43_0x5f26a1(0x17f)]=a43_0x5f26a1(0x205);async[a43_0x5f26a1(0x1a6)](_0x461be9){const _0x57b990=a43_0x5f26a1,{options:_0x5ce71d,args:_0x21d511,tdx:_0x4568ff}=_0x461be9,_0x35343c=_0x21d511[0x0];try{_0x5ce71d[_0x57b990(0x1e4)]&&_0x35343c&&console['error']('Project\x20filter:\x20'+_0x35343c);const _0x484616=await withSpinner('Listing\x20workflows...',()=>_0x4568ff[_0x57b990(0x1f1)][_0x57b990(0x19c)](_0x35343c,{'limit':_0x5ce71d[_0x57b990(0x1c3)]}),{'verbose':_0x5ce71d[_0x57b990(0x1e4)]}),_0x2aaa6c=_0x484616[_0x57b990(0x1b6)];return console['error']('✔\x20Found\x20'+_0x2aaa6c['length']+_0x57b990(0x1fd)+(_0x2aaa6c[_0x57b990(0x18a)]!==0x1?'s':'')),await handleSDKOutput(_0x2aaa6c,_0x5ce71d),0x0;}catch(_0x1d49ed){if(_0x1d49ed instanceof SDKError)return console[_0x57b990(0x1ae)](_0x57b990(0x1e2)+_0x1d49ed[_0x57b990(0x1a4)]),_0x1d49ed[_0x57b990(0x185)]&&console[_0x57b990(0x1ae)](_0x57b990(0x16f)+_0x1d49ed[_0x57b990(0x185)]),0x1;throw _0x1d49ed;}}}export class WorkflowSessionsCommand extends BaseCommand{[a43_0x5f26a1(0x1aa)]='workflow:sessions';[a43_0x5f26a1(0x17f)]='List\x20workflow\x20execution\x20sessions';async[a43_0x5f26a1(0x1a6)](_0x5a7ef4){const _0x4c8dde=a43_0x5f26a1,{options:_0x5b659e,args:_0x244680,tdx:_0x4d2aaa}=_0x5a7ef4;let _0x1db277,_0xa4f03a;if(_0x244680[0x0]){const _0x1675ac=_0x244680[0x0][_0x4c8dde(0x190)]('.');if(_0x1675ac[_0x4c8dde(0x18a)]===0x1)_0x1db277=_0x1675ac[0x0];else{if(_0x1675ac[_0x4c8dde(0x18a)]===0x2)[_0x1db277,_0xa4f03a]=_0x1675ac;else return console[_0x4c8dde(0x1ae)](_0x4c8dde(0x1af)),0x1;}}try{if(_0x5b659e[_0x4c8dde(0x1e4)]){if(_0x1db277&&_0xa4f03a)console[_0x4c8dde(0x1ae)](_0x4c8dde(0x203)+_0x1db277+'.'+_0xa4f03a);else _0x1db277&&console['error'](_0x4c8dde(0x1ce)+_0x1db277);const _0x319590=_0x5b659e[_0x4c8dde(0x1d8)];_0x319590&&console[_0x4c8dde(0x1ae)](_0x4c8dde(0x1e9)+_0x319590);}const _0x35eb5f=await withSpinner(_0x4c8dde(0x19d),()=>_0x4d2aaa[_0x4c8dde(0x1f1)][_0x4c8dde(0x182)]({'projectName':_0x1db277,'workflowName':_0xa4f03a,'status':_0x5b659e[_0x4c8dde(0x1d8)],'fromTime':_0x5b659e[_0x4c8dde(0x1d9)],'toTime':_0x5b659e['to'],'limit':_0x5b659e[_0x4c8dde(0x1c3)]}),{'verbose':_0x5b659e[_0x4c8dde(0x1e4)]}),_0x26737d=_0x35eb5f[_0x4c8dde(0x1b6)];return console[_0x4c8dde(0x1ae)](_0x4c8dde(0x200)+_0x26737d[_0x4c8dde(0x18a)]+_0x4c8dde(0x1a0)+(_0x26737d['length']!==0x1?'s':'')),await handleSDKOutput(_0x26737d,_0x5b659e),0x0;}catch(_0x20bc85){if(_0x20bc85 instanceof SDKError)return console['error']('Error:\x20'+_0x20bc85[_0x4c8dde(0x1a4)]),_0x20bc85[_0x4c8dde(0x185)]&&console[_0x4c8dde(0x1ae)](_0x4c8dde(0x16f)+_0x20bc85[_0x4c8dde(0x185)]),0x1;throw _0x20bc85;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a43_0x5f26a1(0x1aa)]=a43_0x5f26a1(0x175);['description']=a43_0x5f26a1(0x1a7);async[a43_0x5f26a1(0x1a6)](_0x3c5212){const _0x1b7485=a43_0x5f26a1,{options:_0x5cdffd,args:_0x23d2cd,tdx:_0x4958dc}=_0x3c5212;let _0x2dd097,_0x497702;if(_0x23d2cd[0x0]){const _0x465813=_0x23d2cd[0x0][_0x1b7485(0x190)]('.');if(_0x465813[_0x1b7485(0x18a)]===0x1)_0x2dd097=_0x465813[0x0];else{if(_0x465813[_0x1b7485(0x18a)]===0x2)[_0x2dd097,_0x497702]=_0x465813;else return console[_0x1b7485(0x1ae)](_0x1b7485(0x1af)),0x1;}}try{const _0x175afc=_0x5cdffd[_0x1b7485(0x180)];if(_0x5cdffd['verbose']){if(_0x2dd097&&_0x497702)console['error']('Filter:\x20'+_0x2dd097+'.'+_0x497702);else _0x2dd097&&console[_0x1b7485(0x1ae)]('Filter:\x20project='+_0x2dd097);_0x175afc&&console[_0x1b7485(0x1ae)](_0x1b7485(0x19a));}const _0x490d1b=await withSpinner(_0x1b7485(0x18f),()=>_0x4958dc[_0x1b7485(0x1f1)][_0x1b7485(0x1c5)]({'projectName':_0x2dd097,'workflowName':_0x497702,'includeRetried':_0x175afc,'limit':_0x5cdffd[_0x1b7485(0x1c3)]}),{'verbose':_0x5cdffd[_0x1b7485(0x1e4)]}),_0x562e23=_0x490d1b[_0x1b7485(0x1b6)];return console['error'](_0x1b7485(0x200)+_0x562e23[_0x1b7485(0x18a)]+_0x1b7485(0x1fb)+(_0x562e23[_0x1b7485(0x18a)]!==0x1?'s':'')),await handleSDKOutput(_0x562e23,_0x5cdffd),0x0;}catch(_0x1b896f){if(_0x1b896f instanceof SDKError)return console[_0x1b7485(0x1ae)]('Error:\x20'+_0x1b896f['message']),_0x1b896f[_0x1b7485(0x185)]&&console[_0x1b7485(0x1ae)](_0x1b7485(0x16f)+_0x1b896f[_0x1b7485(0x185)]),0x1;throw _0x1b896f;}}}export class WorkflowAttemptCommand extends BaseCommand{[a43_0x5f26a1(0x1aa)]=a43_0x5f26a1(0x1bf);[a43_0x5f26a1(0x17f)]=a43_0x5f26a1(0x204);async[a43_0x5f26a1(0x1a6)](_0x24f4cd){const _0x20b299=a43_0x5f26a1,{options:_0x4fbc45,args:_0x5dea80,tdx:_0x3d46db}=_0x24f4cd,_0xcb8b1c=_0x5dea80[0x0];if(!_0xcb8b1c)return console[_0x20b299(0x1ae)](_0x20b299(0x194)),0x1;try{_0x4fbc45['verbose']&&console[_0x20b299(0x1ae)](_0x20b299(0x1c0)+_0xcb8b1c);const _0x822f96=await withSpinner(_0x20b299(0x1a5),()=>_0x3d46db['workflow'][_0x20b299(0x19e)](_0xcb8b1c),{'verbose':_0x4fbc45[_0x20b299(0x1e4)]}),_0x2802a7=_0x822f96[_0x20b299(0x1b6)];let _0xac40be;!_0x2802a7['done']?_0xac40be=_0x2802a7[_0x20b299(0x1a2)]?_0x20b299(0x1f7):'running':_0xac40be=_0x2802a7[_0x20b299(0x1b7)]?_0x20b299(0x1b7):_0x20b299(0x1ae);let _0x286cdb;if(_0x2802a7[_0x20b299(0x1d4)]&&_0x2802a7[_0x20b299(0x1f3)]){const _0x1d1a44=new Date(_0x2802a7[_0x20b299(0x1d4)])[_0x20b299(0x167)](),_0x11c358=new Date(_0x2802a7['finishedAt'])[_0x20b299(0x167)]();_0x286cdb=Math['round']((_0x11c358-_0x1d1a44)/0x3e8);}const _0xad9bd2={'attempt_id':_0x2802a7['id'],'status':_0xac40be,..._0x2802a7[_0x20b299(0x19b)]!==undefined&&{'index':_0x2802a7[_0x20b299(0x19b)]},..._0x2802a7[_0x20b299(0x1bb)]&&{'project':_0x2802a7[_0x20b299(0x1bb)]['name']},..._0x2802a7[_0x20b299(0x1f1)]&&{'workflow':_0x2802a7['workflow']['name']},..._0x2802a7['sessionId']&&{'session_id':_0x2802a7['sessionId']},..._0x2802a7[_0x20b299(0x1cd)]&&{'session_time':_0x2802a7[_0x20b299(0x1cd)]},..._0x2802a7[_0x20b299(0x199)]&&{'retry_attempt':_0x2802a7[_0x20b299(0x199)]},..._0x286cdb!==undefined&&{'duration_sec':_0x286cdb},..._0x2802a7[_0x20b299(0x1d4)]&&{'created_at':_0x2802a7['createdAt']},..._0x2802a7[_0x20b299(0x1f3)]&&{'finished_at':_0x2802a7[_0x20b299(0x1f3)]},...Object[_0x20b299(0x17a)](_0x2802a7['params'])[_0x20b299(0x18a)]>0x0&&{'params':_0x2802a7['params']}};return await handleSingleObjectOutput(_0xad9bd2,_0x4fbc45),0x0;}catch(_0x50817a){if(_0x50817a instanceof SDKError)return console[_0x20b299(0x1ae)]('Error:\x20'+_0x50817a['message']),_0x50817a[_0x20b299(0x185)]&&console[_0x20b299(0x1ae)](_0x20b299(0x16f)+_0x50817a[_0x20b299(0x185)]),0x1;throw _0x50817a;}}}export class WorkflowTasksCommand extends BaseCommand{[a43_0x5f26a1(0x1aa)]=a43_0x5f26a1(0x1ec);[a43_0x5f26a1(0x17f)]='Show\x20tasks\x20for\x20an\x20attempt';async[a43_0x5f26a1(0x1a6)](_0x26967d){const _0x2114cd=a43_0x5f26a1,{options:_0x5b5d46,args:_0x58941f,tdx:_0x21434a}=_0x26967d,_0x4314d9=_0x58941f[0x0];if(!_0x4314d9)return console[_0x2114cd(0x1ae)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x3a6804=_0x5b5d46[_0x2114cd(0x1de)];_0x5b5d46[_0x2114cd(0x1e4)]&&(console[_0x2114cd(0x1ae)](_0x2114cd(0x1c0)+_0x4314d9),_0x3a6804&&console[_0x2114cd(0x1ae)](_0x2114cd(0x195)));const _0x5ef723=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x21434a[_0x2114cd(0x1f1)][_0x2114cd(0x1c1)](_0x4314d9,_0x3a6804||![]),{'verbose':_0x5b5d46[_0x2114cd(0x1e4)]}),_0x34fffa=_0x5ef723['data'];return console['error'](_0x2114cd(0x200)+_0x34fffa[_0x2114cd(0x18a)]+_0x2114cd(0x16e)+(_0x34fffa[_0x2114cd(0x18a)]!==0x1?'s':'')),await handleSDKOutput(_0x34fffa,_0x5b5d46),0x0;}catch(_0xedcfc0){if(_0xedcfc0 instanceof SDKError)return console[_0x2114cd(0x1ae)]('Error:\x20'+_0xedcfc0[_0x2114cd(0x1a4)]),_0xedcfc0['cause']&&console[_0x2114cd(0x1ae)](_0x2114cd(0x16f)+_0xedcfc0['cause']),0x1;throw _0xedcfc0;}}}export class WorkflowLogsCommand extends BaseCommand{[a43_0x5f26a1(0x1aa)]='workflow:logs';[a43_0x5f26a1(0x17f)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a43_0x5f26a1(0x1a6)](_0x480f97){const _0xb65a70=a43_0x5f26a1,{options:_0x53189d,args:_0x327f28,tdx:_0x3f50e0}=_0x480f97,_0x59425c=_0x327f28[0x0];let _0x25d0f1=_0x327f28[0x1];if(!_0x59425c)return console[_0xb65a70(0x1ae)](_0xb65a70(0x194)),0x1;try{_0x53189d['verbose']&&(console[_0xb65a70(0x1ae)]('Attempt\x20ID:\x20'+_0x59425c),_0x25d0f1&&console[_0xb65a70(0x1ae)]('Task\x20name:\x20'+_0x25d0f1));const _0x4ff6f7=await withSpinner(_0xb65a70(0x1e6),()=>_0x3f50e0[_0xb65a70(0x1f1)][_0xb65a70(0x169)](_0x59425c,_0x25d0f1),{'verbose':_0x53189d[_0xb65a70(0x1e4)]}),_0x116d3e=_0x4ff6f7['data'];if(_0x116d3e['length']===0x0)return console['error'](_0xb65a70(0x1d3)),0x0;if(!_0x25d0f1&&(_0x53189d[_0xb65a70(0x183)]||_0x53189d['format']))return await handleSDKOutput(_0x116d3e,_0x53189d),0x0;if(!_0x25d0f1){const _0x232c90=_0x116d3e[_0xb65a70(0x1d7)](_0x16c960=>({'title':_0x16c960[_0xb65a70(0x17c)]+'\x20('+formatBytes(_0x16c960[_0xb65a70(0x1cc)])+')','value':_0x16c960[_0xb65a70(0x17c)]})),_0x54e0ac=await a43_0x2c8fc3({'type':_0xb65a70(0x196),'name':_0xb65a70(0x207),'message':_0xb65a70(0x1ee),'choices':_0x232c90});if(!_0x54e0ac[_0xb65a70(0x207)])return console[_0xb65a70(0x1ae)](_0xb65a70(0x1d0)),0x0;_0x25d0f1=_0x54e0ac[_0xb65a70(0x207)];}const _0x2dd4c9=await withSpinner(_0xb65a70(0x1b0),()=>_0x3f50e0[_0xb65a70(0x1f1)][_0xb65a70(0x1ff)](_0x59425c,_0x25d0f1),{'verbose':_0x53189d[_0xb65a70(0x1e4)]}),_0x5423bf=_0x2dd4c9[_0xb65a70(0x1b6)];return _0x5423bf?console[_0xb65a70(0x1f6)](_0x5423bf):console[_0xb65a70(0x1ae)]('No\x20log\x20content\x20found'),0x0;}catch(_0x3ce006){if(_0x3ce006 instanceof SDKError)return console[_0xb65a70(0x1ae)](_0xb65a70(0x1e2)+_0x3ce006[_0xb65a70(0x1a4)]),_0x3ce006[_0xb65a70(0x185)]&&console[_0xb65a70(0x1ae)](_0xb65a70(0x16f)+_0x3ce006[_0xb65a70(0x185)]),0x1;throw _0x3ce006;}}}export class WorkflowKillCommand extends BaseCommand{[a43_0x5f26a1(0x1aa)]=a43_0x5f26a1(0x1db);['description']=a43_0x5f26a1(0x1a1);async[a43_0x5f26a1(0x1a6)](_0xfffaa4){const _0x20cdf1=a43_0x5f26a1,{options:_0x2e016a,args:_0x550dab,tdx:_0x19d649}=_0xfffaa4,_0x169a1c=_0x550dab[0x0];if(!_0x169a1c)return console[_0x20cdf1(0x1ae)](_0x20cdf1(0x194)),0x1;try{const _0x50cfed=_0x2e016a[_0x20cdf1(0x206)];_0x2e016a[_0x20cdf1(0x1e4)]&&(console[_0x20cdf1(0x1ae)](_0x20cdf1(0x1c0)+_0x169a1c),_0x50cfed&&console[_0x20cdf1(0x1ae)](_0x20cdf1(0x1e3)+_0x50cfed));if(!_0x2e016a[_0x20cdf1(0x1a3)]){const _0x4d20e1=await confirm(_0x20cdf1(0x179)+_0x169a1c+'?');if(!_0x4d20e1)return console[_0x20cdf1(0x1ae)](_0x20cdf1(0x1d0)),0x0;}const _0x56bc95=await withSpinner(_0x20cdf1(0x189),()=>_0x19d649['workflow']['kill'](_0x169a1c,_0x50cfed),{'verbose':_0x2e016a['verbose']}),_0x131d7f=_0x56bc95[_0x20cdf1(0x1b6)];return console[_0x20cdf1(0x1ae)]('✔\x20'+_0x131d7f),0x0;}catch(_0x1be7d1){if(_0x1be7d1 instanceof SDKError)return console['error'](_0x20cdf1(0x1e2)+_0x1be7d1['message']),_0x1be7d1[_0x20cdf1(0x185)]&&console[_0x20cdf1(0x1ae)]('\x20\x20Cause:\x20'+_0x1be7d1['cause']),0x1;throw _0x1be7d1;}}}export class WorkflowRetryCommand extends BaseCommand{[a43_0x5f26a1(0x1aa)]='workflow:retry';['description']='Retry\x20a\x20session\x20or\x20attempt';async['execute'](_0x4e024c){const _0x111467=a43_0x5f26a1,{options:_0x44d907,args:_0x545da1,tdx:_0x50de7d}=_0x4e024c,_0x499be7=_0x545da1[0x0];if(!_0x499be7)return console[_0x111467(0x1ae)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x111467(0x1ae)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x3af654=![],_0x5763da=_0x499be7;if(_0x499be7[_0x111467(0x1e1)](_0x111467(0x176)))_0x3af654=!![],_0x5763da=_0x499be7[_0x111467(0x1a9)](0x8);else{if(_0x499be7[_0x111467(0x1e1)](_0x111467(0x1fe)))_0x3af654=![],_0x5763da=_0x499be7[_0x111467(0x1a9)](0x8);else return console['error']('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0x111467(0x1ae)](_0x111467(0x1b2)),0x1;}try{const _0x21d1eb=_0x44d907[_0x111467(0x1bd)],_0x280766=_0x44d907[_0x111467(0x1ea)],_0x40497f=_0x44d907[_0x111467(0x1c9)],_0x5334d9=_0x44d907[_0x111467(0x16d)];_0x44d907[_0x111467(0x1e4)]&&(console[_0x111467(0x1ae)](_0x111467(0x170)+(_0x3af654?_0x111467(0x1c4):'attempt')+'\x20'+_0x5763da),_0x21d1eb&&console[_0x111467(0x1ae)](_0x111467(0x202)+_0x21d1eb),_0x280766&&console[_0x111467(0x1ae)]('Resume\x20from:\x20'+_0x280766),_0x40497f&&console[_0x111467(0x1ae)](_0x111467(0x1df)+_0x40497f),_0x5334d9&&console[_0x111467(0x1ae)]('Force:\x20yes'));let _0xc49fec;if(_0x40497f)try{if(_0x40497f[_0x111467(0x1e1)]('@')){const _0x24d842=await import(_0x111467(0x17d)),_0x4d6fcb=_0x40497f[_0x111467(0x1a9)](0x1),_0x357b0e=await _0x24d842[_0x111467(0x168)](_0x4d6fcb,_0x111467(0x187));_0xc49fec=JSON[_0x111467(0x1e7)](_0x357b0e);}else _0xc49fec=JSON[_0x111467(0x1e7)](_0x40497f);}catch{return console[_0x111467(0x1ae)](_0x111467(0x18e)),0x1;}if(!_0x44d907[_0x111467(0x1a3)]){const _0x1ef33f=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x3af654?'session':_0x111467(0x19e))+'\x20'+_0x5763da+'?');if(!_0x1ef33f)return console[_0x111467(0x1ae)](_0x111467(0x1d0)),0x0;}let _0x159ac7;_0x3af654?_0x159ac7=await withSpinner(_0x111467(0x174),()=>_0x50de7d[_0x111467(0x1f1)][_0x111467(0x1ed)](_0x5763da,{'fromTask':_0x21d1eb,'retryParams':_0xc49fec}),{'verbose':_0x44d907[_0x111467(0x1e4)]}):_0x159ac7=await withSpinner(_0x111467(0x1f5),()=>_0x50de7d['workflow'][_0x111467(0x16b)](_0x5763da,{'resumeFrom':_0x280766,'retryParams':_0xc49fec,'force':_0x5334d9}),{'verbose':_0x44d907['verbose']});const _0x244074=_0x159ac7[_0x111467(0x1b6)];return console['error'](_0x111467(0x1ba)),console[_0x111467(0x1ae)](_0x111467(0x1b3)+_0x244074[_0x111467(0x17e)]),console[_0x111467(0x1ae)](_0x111467(0x181)+_0x244074[_0x111467(0x1c8)]),0x0;}catch(_0x4b6bf8){if(_0x4b6bf8 instanceof SDKError)return console['error'](_0x111467(0x1e2)+_0x4b6bf8[_0x111467(0x1a4)]),_0x4b6bf8[_0x111467(0x185)]&&console[_0x111467(0x1ae)](_0x111467(0x16f)+_0x4b6bf8[_0x111467(0x185)]),0x1;throw _0x4b6bf8;}}}export class WorkflowRunCommand extends BaseCommand{[a43_0x5f26a1(0x1aa)]='workflow:run';[a43_0x5f26a1(0x17f)]=a43_0x5f26a1(0x186);async['execute'](_0x2aa402){const _0x5d06cd=a43_0x5f26a1,{options:_0x2e9331,args:_0x4645a8,tdx:_0x44ae0e}=_0x2aa402,_0x53f244=_0x4645a8[0x0];if(!_0x53f244)return console['error'](_0x5d06cd(0x1f8)),console[_0x5d06cd(0x1ae)]('Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]'),0x1;const _0x5199b0=_0x2e9331['param'],_0x58b5a2=_0x2e9331[_0x5d06cd(0x1cd)],_0x8a3a04={};if(_0x5199b0&&Array[_0x5d06cd(0x1fa)](_0x5199b0))for(const _0x5e2e97 of _0x5199b0){const _0x910ff0=_0x5e2e97[_0x5d06cd(0x193)]('=');if(_0x910ff0===-0x1)return console[_0x5d06cd(0x1ae)](_0x5d06cd(0x192)+_0x5e2e97),console[_0x5d06cd(0x1ae)](_0x5d06cd(0x18b)),0x1;const _0x348e6d=_0x5e2e97['substring'](0x0,_0x910ff0),_0xba52cf=_0x5e2e97[_0x5d06cd(0x1a9)](_0x910ff0+0x1);try{_0x8a3a04[_0x348e6d]=JSON[_0x5d06cd(0x1e7)](_0xba52cf);}catch{_0x8a3a04[_0x348e6d]=_0xba52cf;}}_0x2e9331[_0x5d06cd(0x1e4)]&&(console['error'](_0x5d06cd(0x1be)+_0x53f244),Object[_0x5d06cd(0x17a)](_0x8a3a04)[_0x5d06cd(0x18a)]>0x0&&console[_0x5d06cd(0x1ae)]('Parameters:\x20'+JSON['stringify'](_0x8a3a04)),_0x58b5a2&&console[_0x5d06cd(0x1ae)](_0x5d06cd(0x197)+_0x58b5a2));const _0x9ed31b=await withSpinner(_0x5d06cd(0x1a8),()=>_0x44ae0e[_0x5d06cd(0x1f1)][_0x5d06cd(0x18d)](_0x53f244,_0x8a3a04,{'sessionTime':_0x58b5a2}),{'verbose':_0x2e9331[_0x5d06cd(0x1e4)]}),_0x18e5ae=_0x9ed31b['data'];return console[_0x5d06cd(0x1ae)]('✔\x20Workflow\x20run\x20started'),console[_0x5d06cd(0x1ae)](_0x5d06cd(0x165)+_0x18e5ae['id']),console['error'](_0x5d06cd(0x181)+_0x18e5ae[_0x5d06cd(0x1c8)]),console[_0x5d06cd(0x1ae)]('\x20\x20Project:\x20'+_0x18e5ae[_0x5d06cd(0x1bb)]?.[_0x5d06cd(0x1aa)]),console[_0x5d06cd(0x1ae)]('\x20\x20Workflow:\x20'+_0x18e5ae[_0x5d06cd(0x1f1)]?.[_0x5d06cd(0x1aa)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a43_0x5f26a1(0x1aa)]=a43_0x5f26a1(0x1d6);['description']=a43_0x5f26a1(0x191);async['execute'](_0x5c305f){const _0x5a73b2=a43_0x5f26a1,{options:_0x16a212,args:_0x20aeea,tdx:_0x1b422d}=_0x5c305f,_0x4b1f56=_0x20aeea[0x0],_0x2e6717=_0x20aeea[0x1]||'.';if(!_0x4b1f56)return console[_0x5a73b2(0x1ae)](_0x5a73b2(0x173)),console[_0x5a73b2(0x1ae)](_0x5a73b2(0x18c)),0x1;const _0x103582=_0x16a212['revision'];_0x16a212['verbose']&&(console[_0x5a73b2(0x1ae)]('Project:\x20'+_0x4b1f56),console[_0x5a73b2(0x1ae)](_0x5a73b2(0x188)+_0x2e6717),_0x103582&&console[_0x5a73b2(0x1ae)]('Revision:\x20'+_0x103582));const _0x42b9bf=await withSpinner(_0x5a73b2(0x177)+_0x4b1f56+_0x5a73b2(0x16c),()=>_0x1b422d[_0x5a73b2(0x1f1)]['download'](_0x4b1f56,_0x2e6717,{'revision':_0x103582}),{'verbose':_0x16a212[_0x5a73b2(0x1e4)]}),_0x34115d=_0x42b9bf[_0x5a73b2(0x1b6)];return console['error'](_0x5a73b2(0x178)+_0x34115d[_0x5a73b2(0x1ac)]),console['error']('\x20\x20Revision:\x20'+_0x34115d[_0x5a73b2(0x1c6)]),console['error']('\x20\x20Files\x20extracted:\x20'+_0x34115d['filesExtracted']),console[_0x5a73b2(0x1ae)](_0x5a73b2(0x1e0)+_0x2e6717+'/'+_0x34115d['projectName']),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a43_0x5f26a1(0x1aa)]='workflow:push';[a43_0x5f26a1(0x17f)]=a43_0x5f26a1(0x1eb);async[a43_0x5f26a1(0x1a6)](_0x4a0488){const _0x526740=a43_0x5f26a1,{options:_0x12e874,args:_0x23ee61,tdx:_0x3bd47e}=_0x4a0488;let _0x2cc1ab='.',_0x51e260=_0x12e874[_0x526740(0x1aa)];if(_0x23ee61[0x0]){const {promises:_0x3b2494}=await import('fs');try{const _0x461037=await _0x3b2494['stat'](_0x23ee61[0x0]);if(_0x461037[_0x526740(0x1b8)]())_0x2cc1ab=_0x23ee61[0x0];else return console['error']('Error:\x20'+_0x23ee61[0x0]+_0x526740(0x1cf)),0x1;}catch{_0x51e260=_0x23ee61[0x0],_0x2cc1ab='.';}}const _0x4cdf7c=_0x12e874[_0x526740(0x1c6)],_0x5ce026=_0x12e874[_0x526740(0x1b1)];_0x12e874[_0x526740(0x1e4)]&&(console[_0x526740(0x1ae)](_0x526740(0x1ef)+_0x2cc1ab),_0x51e260&&console[_0x526740(0x1ae)](_0x526740(0x172)+_0x51e260),_0x4cdf7c&&console[_0x526740(0x1ae)]('Revision:\x20'+_0x4cdf7c),_0x5ce026&&console[_0x526740(0x1ae)](_0x526740(0x184)));const _0x482fb4=await withSpinner(_0x526740(0x1f2),()=>_0x3bd47e[_0x526740(0x1f1)]['push'](_0x2cc1ab,{'projectName':_0x51e260,'revision':_0x4cdf7c,'skipValidation':_0x5ce026}),{'verbose':_0x12e874[_0x526740(0x1e4)]}),_0x35ee3c=_0x482fb4['data'];return console['error'](_0x526740(0x17b)+_0x35ee3c[_0x526740(0x1ac)]),console[_0x526740(0x1ae)]('\x20\x20Project\x20ID:\x20'+_0x35ee3c[_0x526740(0x1b4)]),console['error'](_0x526740(0x1ca)+_0x35ee3c[_0x526740(0x1c6)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a43_0x5f26a1(0x1f9);[a43_0x5f26a1(0x17f)]=a43_0x5f26a1(0x1f0);async[a43_0x5f26a1(0x1a6)](_0x2a2a64){const _0x20c2a2=a43_0x5f26a1,{options:_0xc9a379,args:_0x4865b6,tdx:_0x41592e}=_0x2a2a64,_0x13dc9b=_0x4865b6[0x0];if(!_0x13dc9b)return console[_0x20c2a2(0x1ae)](_0x20c2a2(0x1e5)),console[_0x20c2a2(0x1ae)](_0x20c2a2(0x1f4)),0x1;_0xc9a379['verbose']&&console[_0x20c2a2(0x1ae)](_0x20c2a2(0x1c7)+_0x13dc9b);if(!_0xc9a379[_0x20c2a2(0x1a3)]){const _0x27a9bf=await confirm(_0x20c2a2(0x16a)+_0x13dc9b+_0x20c2a2(0x198));if(!_0x27a9bf)return console[_0x20c2a2(0x1ae)](_0x20c2a2(0x1d0)),0x0;}const _0x1b139e=await withSpinner(_0x20c2a2(0x1fc)+_0x13dc9b+_0x20c2a2(0x16c),()=>_0x41592e[_0x20c2a2(0x1f1)][_0x20c2a2(0x1ad)](_0x13dc9b),{'verbose':_0xc9a379[_0x20c2a2(0x1e4)]}),_0xda1ed5=_0x1b139e['data'];return console[_0x20c2a2(0x1ae)](_0x20c2a2(0x1c2)+_0xda1ed5[_0x20c2a2(0x1ac)]),console[_0x20c2a2(0x1ae)](_0x20c2a2(0x1bc)+_0xda1ed5[_0x20c2a2(0x1b4)]),0x0;}}
1
+ const a43_0xdb3bee=a43_0x4f89;(function(_0x5cfff0,_0xfb5da5){const _0x3d8357=a43_0x4f89,_0x461c6f=_0x5cfff0();while(!![]){try{const _0x28f5a3=parseInt(_0x3d8357(0xd8))/0x1*(parseInt(_0x3d8357(0x12a))/0x2)+-parseInt(_0x3d8357(0x136))/0x3+-parseInt(_0x3d8357(0xcf))/0x4+-parseInt(_0x3d8357(0x13c))/0x5*(parseInt(_0x3d8357(0xc0))/0x6)+parseInt(_0x3d8357(0x128))/0x7*(parseInt(_0x3d8357(0x124))/0x8)+-parseInt(_0x3d8357(0x138))/0x9+-parseInt(_0x3d8357(0x12b))/0xa*(-parseInt(_0x3d8357(0xbd))/0xb);if(_0x28f5a3===_0xfb5da5)break;else _0x461c6f['push'](_0x461c6f['shift']());}catch(_0x4635d0){_0x461c6f['push'](_0x461c6f['shift']());}}}(a43_0x2ca6,0x87e07));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a43_0x2ca6(){const _0x47c2a0=['Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Show\x20logs\x20for\x20a\x20workflow\x20attempt','607704AflsUH','Pushing\x20workflow\x20project...','\x20workflow','includeSubtasks','error','No\x20log\x20content\x20found','startsWith','\x20\x20Revision:\x20','success','5poeQor','Filter:\x20','tasks','Target:\x20','indexOf','workflow:logs','attempt','stringify','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Force:\x20yes','attempt:','param','workflow:workflows','Session\x20time:\x20','Deleting\x20project\x20','verbose','retrySession','skipValidation','Project\x20name:\x20','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','log','createdAt','format','Listing\x20workflow\x20sessions...','Error:\x20Invalid\x20JSON\x20in\x20--params','stat','Attempt\x20ID:\x20','message','project','retryAttemptName','Resume\x20from:\x20','workflow:delete','Revision:\x20','canceling','kill','projectName','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','session:','\x20\x20Cause:\x20','fileSize','List\x20workflow\x20attempts','data','workflow:kill','Parameters:\x20','Listing\x20workflow\x20projects...','workflow:projects','isDirectory','projectId','Cancelled','✔\x20Found\x20','projects','Show\x20tasks\x20for\x20an\x20attempt','substring','select','\x22?\x20This\x20cannot\x20be\x20undone.','running','\x20\x20Project:\x20','Pattern:\x20','Including\x20subtasks:\x20yes','workflow:attempt','limit','cause','length','Error:\x20Attempt\x20ID\x20is\x20required','List\x20all\x20workflow\x20projects','\x20session','\x20\x20Files\x20extracted:\x20','✔\x20Deleted\x20project\x20','taskName','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Starting\x20workflow\x20run...','execute','✔\x20Workflow\x20run\x20started','workflow:retry','resumeFrom','Downloading\x20project\x20','72dFaWwE','\x20\x20Project\x20ID:\x20','attemptId','run','85155iROlHe','Filter:\x20project=','95474ZwrrtM','26121300frseZB','round','Project\x20filter:\x20','Getting\x20attempt\x20tasks...','workflow:download','Error:\x20Workflow\x20identifier\x20is\x20required','reason','workflow','parse','getTime','isArray','2168010AHOnUU','workflow:tasks','9103149TDsoXf','Reason:\x20','\x20\x20New\x20attempt\x20ID:\x20','Error:\x20','20SVHCfc','Fetching\x20log\x20files...','✔\x20Pushed\x20','Project:\x20','sessionId','session','...','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','json','Listing\x20workflows...','Params:\x20','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','download','Killing\x20attempt...','sessionTime','Listing\x20workflow\x20attempts...','\x20project','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','Include\x20retried:\x20yes','List\x20workflows','Status:\x20','Select\x20a\x20task\x20to\x20view\x20logs:','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','\x20\x20Session\x20ID:\x20','yes','task','finishedAt','List\x20workflow\x20execution\x20sessions','Start\x20a\x20workflow\x20run','Workflow:\x20','\x20\x20Location:\x20','done','\x20is\x20not\x20a\x20directory','✔\x20Downloaded\x20','delete','Error:\x20Invalid\x20parameter\x20format:\x20','keys','params','index','\x20\x20Workflow:\x20','Expected\x20format:\x20--param\x20key=value','✔\x20Retry\x20started','workflow:push','11fzydAE','Error:\x20Project\x20name\x20is\x20required','cancelRequested','776538sRxJis','Project\x20directory:\x20','Show\x20specific\x20attempt\x20details','revision','Output\x20directory:\x20','description','From\x20task:\x20','name','workflows','Getting\x20attempt\x20details...','push','status','split'];a43_0x2ca6=function(){return _0x47c2a0;};return a43_0x2ca6();}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 a43_0x9087d from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a43_0xdb3bee(0xc7)]=a43_0xdb3bee(0x105);[a43_0xdb3bee(0xc5)]=a43_0xdb3bee(0x118);async[a43_0xdb3bee(0x11f)](_0x5386eb){const _0x83db86=a43_0xdb3bee,{options:_0x106953,args:_0x2d4524,tdx:_0x4faee8}=_0x5386eb,_0x5e3a84=_0x2d4524[0x0];try{_0x106953[_0x83db86(0xe7)]&&_0x5e3a84&&console[_0x83db86(0xd3)](_0x83db86(0x111)+_0x5e3a84);const _0x3081a1=await withSpinner(_0x83db86(0x104),()=>_0x4faee8['workflow'][_0x83db86(0x10a)](_0x5e3a84,{'limit':_0x106953[_0x83db86(0x114)]}),{'verbose':_0x106953[_0x83db86(0xe7)]}),_0x1bc9dd=_0x3081a1['data'];return console[_0x83db86(0xd3)](_0x83db86(0x109)+_0x1bc9dd[_0x83db86(0x116)]+_0x83db86(0xa1)+(_0x1bc9dd['length']!==0x1?'s':'')),await handleSDKOutput(_0x1bc9dd,_0x106953),0x0;}catch(_0x377117){if(_0x377117 instanceof SDKError)return console[_0x83db86(0xd3)]('Error:\x20'+_0x377117[_0x83db86(0xf3)]),_0x377117[_0x83db86(0x115)]&&console[_0x83db86(0xd3)](_0x83db86(0xfe)+_0x377117[_0x83db86(0x115)]),0x1;throw _0x377117;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a43_0xdb3bee(0xc7)]=a43_0xdb3bee(0xe4);[a43_0xdb3bee(0xc5)]=a43_0xdb3bee(0xa4);async[a43_0xdb3bee(0x11f)](_0x2bbf5b){const _0x238860=a43_0xdb3bee,{options:_0x1fb142,args:_0x1ee934,tdx:_0x59c391}=_0x2bbf5b,_0x4b4608=_0x1ee934[0x0];try{_0x1fb142[_0x238860(0xe7)]&&_0x4b4608&&console[_0x238860(0xd3)](_0x238860(0x12d)+_0x4b4608);const _0x2d2c50=await withSpinner(_0x238860(0x9a),()=>_0x59c391[_0x238860(0x132)][_0x238860(0xc8)](_0x4b4608,{'limit':_0x1fb142[_0x238860(0x114)]}),{'verbose':_0x1fb142[_0x238860(0xe7)]}),_0x57d3a2=_0x2d2c50[_0x238860(0x101)];return console[_0x238860(0xd3)](_0x238860(0x109)+_0x57d3a2['length']+_0x238860(0xd1)+(_0x57d3a2[_0x238860(0x116)]!==0x1?'s':'')),await handleSDKOutput(_0x57d3a2,_0x1fb142),0x0;}catch(_0x3b7ed4){if(_0x3b7ed4 instanceof SDKError)return console[_0x238860(0xd3)]('Error:\x20'+_0x3b7ed4[_0x238860(0xf3)]),_0x3b7ed4[_0x238860(0x115)]&&console[_0x238860(0xd3)](_0x238860(0xfe)+_0x3b7ed4[_0x238860(0x115)]),0x1;throw _0x3b7ed4;}}}export class WorkflowSessionsCommand extends BaseCommand{['name']='workflow:sessions';[a43_0xdb3bee(0xc5)]=a43_0xdb3bee(0xad);async[a43_0xdb3bee(0x11f)](_0x9c7f49){const _0xb14e60=a43_0xdb3bee,{options:_0x1ac2f7,args:_0x7fb136,tdx:_0x279aff}=_0x9c7f49;let _0x2d1f7f,_0x2e2254;if(_0x7fb136[0x0]){const _0x1484e0=_0x7fb136[0x0][_0xb14e60(0xcc)]('.');if(_0x1484e0[_0xb14e60(0x116)]===0x1)_0x2d1f7f=_0x1484e0[0x0];else{if(_0x1484e0[_0xb14e60(0x116)]===0x2)[_0x2d1f7f,_0x2e2254]=_0x1484e0;else return console['error'](_0xb14e60(0xeb)),0x1;}}try{if(_0x1ac2f7[_0xb14e60(0xe7)]){if(_0x2d1f7f&&_0x2e2254)console['error']('Filter:\x20'+_0x2d1f7f+'.'+_0x2e2254);else _0x2d1f7f&&console[_0xb14e60(0xd3)](_0xb14e60(0x129)+_0x2d1f7f);const _0xc19c4c=_0x1ac2f7[_0xb14e60(0xcb)];_0xc19c4c&&console[_0xb14e60(0xd3)](_0xb14e60(0xa5)+_0xc19c4c);}const _0x18b2e5=await withSpinner(_0xb14e60(0xef),()=>_0x279aff[_0xb14e60(0x132)]['sessions']({'projectName':_0x2d1f7f,'workflowName':_0x2e2254,'status':_0x1ac2f7['status'],'fromTime':_0x1ac2f7['from'],'toTime':_0x1ac2f7['to'],'limit':_0x1ac2f7[_0xb14e60(0x114)]}),{'verbose':_0x1ac2f7[_0xb14e60(0xe7)]}),_0x5b592f=_0x18b2e5[_0xb14e60(0x101)];return console[_0xb14e60(0xd3)]('✔\x20Found\x20'+_0x5b592f['length']+_0xb14e60(0x119)+(_0x5b592f[_0xb14e60(0x116)]!==0x1?'s':'')),await handleSDKOutput(_0x5b592f,_0x1ac2f7),0x0;}catch(_0x85c1df){if(_0x85c1df instanceof SDKError)return console[_0xb14e60(0xd3)]('Error:\x20'+_0x85c1df[_0xb14e60(0xf3)]),_0x85c1df['cause']&&console[_0xb14e60(0xd3)](_0xb14e60(0xfe)+_0x85c1df[_0xb14e60(0x115)]),0x1;throw _0x85c1df;}}}export class WorkflowAttemptsCommand extends BaseCommand{['name']='workflow:attempts';['description']=a43_0xdb3bee(0x100);async['execute'](_0x346f28){const _0x33da45=a43_0xdb3bee,{options:_0x315cef,args:_0x45c97c,tdx:_0x4f17c7}=_0x346f28;let _0x2e12cc,_0x126c27;if(_0x45c97c[0x0]){const _0x4d4368=_0x45c97c[0x0][_0x33da45(0xcc)]('.');if(_0x4d4368[_0x33da45(0x116)]===0x1)_0x2e12cc=_0x4d4368[0x0];else{if(_0x4d4368[_0x33da45(0x116)]===0x2)[_0x2e12cc,_0x126c27]=_0x4d4368;else return console['error'](_0x33da45(0xeb)),0x1;}}try{const _0x492f49=_0x315cef['includeRetried'];if(_0x315cef['verbose']){if(_0x2e12cc&&_0x126c27)console['error'](_0x33da45(0xd9)+_0x2e12cc+'.'+_0x126c27);else _0x2e12cc&&console[_0x33da45(0xd3)]('Filter:\x20project='+_0x2e12cc);_0x492f49&&console[_0x33da45(0xd3)](_0x33da45(0xa3));}const _0x37c480=await withSpinner(_0x33da45(0xa0),()=>_0x4f17c7[_0x33da45(0x132)]['attempts']({'projectName':_0x2e12cc,'workflowName':_0x126c27,'includeRetried':_0x492f49,'limit':_0x315cef[_0x33da45(0x114)]}),{'verbose':_0x315cef['verbose']}),_0x2dca1e=_0x37c480[_0x33da45(0x101)];return console[_0x33da45(0xd3)](_0x33da45(0x109)+_0x2dca1e[_0x33da45(0x116)]+'\x20attempt'+(_0x2dca1e[_0x33da45(0x116)]!==0x1?'s':'')),await handleSDKOutput(_0x2dca1e,_0x315cef),0x0;}catch(_0x55d2a7){if(_0x55d2a7 instanceof SDKError)return console['error'](_0x33da45(0x13b)+_0x55d2a7[_0x33da45(0xf3)]),_0x55d2a7[_0x33da45(0x115)]&&console[_0x33da45(0xd3)](_0x33da45(0xfe)+_0x55d2a7[_0x33da45(0x115)]),0x1;throw _0x55d2a7;}}}export class WorkflowAttemptCommand extends BaseCommand{[a43_0xdb3bee(0xc7)]=a43_0xdb3bee(0x113);[a43_0xdb3bee(0xc5)]=a43_0xdb3bee(0xc2);async[a43_0xdb3bee(0x11f)](_0x2960d5){const _0x421b2e=a43_0xdb3bee,{options:_0x19afce,args:_0x352471,tdx:_0x59a7fe}=_0x2960d5,_0x594796=_0x352471[0x0];if(!_0x594796)return console[_0x421b2e(0xd3)](_0x421b2e(0x117)),0x1;try{_0x19afce[_0x421b2e(0xe7)]&&console[_0x421b2e(0xd3)](_0x421b2e(0xf2)+_0x594796);const _0xfc2917=await withSpinner(_0x421b2e(0xc9),()=>_0x59a7fe[_0x421b2e(0x132)][_0x421b2e(0xde)](_0x594796),{'verbose':_0x19afce[_0x421b2e(0xe7)]}),_0x3eaea9=_0xfc2917[_0x421b2e(0x101)];let _0x5570eb;!_0x3eaea9[_0x421b2e(0xb1)]?_0x5570eb=_0x3eaea9[_0x421b2e(0xbf)]?_0x421b2e(0xf9):_0x421b2e(0x10f):_0x5570eb=_0x3eaea9[_0x421b2e(0xd7)]?_0x421b2e(0xd7):_0x421b2e(0xd3);let _0x1912ad;if(_0x3eaea9[_0x421b2e(0xed)]&&_0x3eaea9[_0x421b2e(0xac)]){const _0x2f7a1b=new Date(_0x3eaea9['createdAt'])[_0x421b2e(0x134)](),_0x2774d2=new Date(_0x3eaea9[_0x421b2e(0xac)])['getTime']();_0x1912ad=Math[_0x421b2e(0x12c)]((_0x2774d2-_0x2f7a1b)/0x3e8);}const _0x53e38d={'attempt_id':_0x3eaea9['id'],'status':_0x5570eb,..._0x3eaea9[_0x421b2e(0xb8)]!==undefined&&{'index':_0x3eaea9[_0x421b2e(0xb8)]},..._0x3eaea9['project']&&{'project':_0x3eaea9[_0x421b2e(0xf4)][_0x421b2e(0xc7)]},..._0x3eaea9[_0x421b2e(0x132)]&&{'workflow':_0x3eaea9[_0x421b2e(0x132)][_0x421b2e(0xc7)]},..._0x3eaea9['sessionId']&&{'session_id':_0x3eaea9[_0x421b2e(0x140)]},..._0x3eaea9['sessionTime']&&{'session_time':_0x3eaea9[_0x421b2e(0x9f)]},..._0x3eaea9['retryAttemptName']&&{'retry_attempt':_0x3eaea9[_0x421b2e(0xf5)]},..._0x1912ad!==undefined&&{'duration_sec':_0x1912ad},..._0x3eaea9[_0x421b2e(0xed)]&&{'created_at':_0x3eaea9[_0x421b2e(0xed)]},..._0x3eaea9['finishedAt']&&{'finished_at':_0x3eaea9[_0x421b2e(0xac)]},...Object[_0x421b2e(0xb6)](_0x3eaea9[_0x421b2e(0xb7)])[_0x421b2e(0x116)]>0x0&&{'params':_0x3eaea9[_0x421b2e(0xb7)]}};return await handleSingleObjectOutput(_0x53e38d,_0x19afce),0x0;}catch(_0xcec737){if(_0xcec737 instanceof SDKError)return console[_0x421b2e(0xd3)](_0x421b2e(0x13b)+_0xcec737[_0x421b2e(0xf3)]),_0xcec737[_0x421b2e(0x115)]&&console['error'](_0x421b2e(0xfe)+_0xcec737['cause']),0x1;throw _0xcec737;}}}export class WorkflowTasksCommand extends BaseCommand{[a43_0xdb3bee(0xc7)]=a43_0xdb3bee(0x137);[a43_0xdb3bee(0xc5)]=a43_0xdb3bee(0x10b);async[a43_0xdb3bee(0x11f)](_0x594be0){const _0x190778=a43_0xdb3bee,{options:_0x33a7e5,args:_0x45c8ee,tdx:_0x384900}=_0x594be0,_0x318380=_0x45c8ee[0x0];if(!_0x318380)return console[_0x190778(0xd3)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x5cbc62=_0x33a7e5[_0x190778(0xd2)];_0x33a7e5[_0x190778(0xe7)]&&(console[_0x190778(0xd3)]('Attempt\x20ID:\x20'+_0x318380),_0x5cbc62&&console[_0x190778(0xd3)](_0x190778(0x112)));const _0x5a6ff1=await withSpinner(_0x190778(0x12e),()=>_0x384900[_0x190778(0x132)][_0x190778(0xda)](_0x318380,_0x5cbc62||![]),{'verbose':_0x33a7e5[_0x190778(0xe7)]}),_0x2fdbe3=_0x5a6ff1['data'];return console[_0x190778(0xd3)]('✔\x20Found\x20'+_0x2fdbe3[_0x190778(0x116)]+'\x20task'+(_0x2fdbe3[_0x190778(0x116)]!==0x1?'s':'')),await handleSDKOutput(_0x2fdbe3,_0x33a7e5),0x0;}catch(_0x5935a9){if(_0x5935a9 instanceof SDKError)return console[_0x190778(0xd3)](_0x190778(0x13b)+_0x5935a9[_0x190778(0xf3)]),_0x5935a9[_0x190778(0x115)]&&console[_0x190778(0xd3)](_0x190778(0xfe)+_0x5935a9[_0x190778(0x115)]),0x1;throw _0x5935a9;}}}export class WorkflowLogsCommand extends BaseCommand{[a43_0xdb3bee(0xc7)]=a43_0xdb3bee(0xdd);[a43_0xdb3bee(0xc5)]=a43_0xdb3bee(0xce);async[a43_0xdb3bee(0x11f)](_0x20642f){const _0x4b9e97=a43_0xdb3bee,{options:_0x55d43a,args:_0x453087,tdx:_0x14e612}=_0x20642f,_0x424e58=_0x453087[0x0];let _0x581c92=_0x453087[0x1];if(!_0x424e58)return console[_0x4b9e97(0xd3)](_0x4b9e97(0x117)),0x1;try{_0x55d43a['verbose']&&(console[_0x4b9e97(0xd3)](_0x4b9e97(0xf2)+_0x424e58),_0x581c92&&console['error']('Task\x20name:\x20'+_0x581c92));const _0x50d52b=await withSpinner(_0x4b9e97(0x13d),()=>_0x14e612['workflow']['logFiles'](_0x424e58,_0x581c92),{'verbose':_0x55d43a['verbose']}),_0x47c0f8=_0x50d52b['data'];if(_0x47c0f8['length']===0x0)return console[_0x4b9e97(0xd3)](_0x4b9e97(0x11d)),0x0;if(!_0x581c92&&(_0x55d43a[_0x4b9e97(0x144)]||_0x55d43a[_0x4b9e97(0xee)]))return await handleSDKOutput(_0x47c0f8,_0x55d43a),0x0;if(!_0x581c92){const _0x28037e=_0x47c0f8['map'](_0x3469f0=>({'title':_0x3469f0['taskName']+'\x20('+formatBytes(_0x3469f0[_0x4b9e97(0xff)])+')','value':_0x3469f0[_0x4b9e97(0x11c)]})),_0x1c6ad7=await a43_0x9087d({'type':_0x4b9e97(0x10d),'name':_0x4b9e97(0xab),'message':_0x4b9e97(0xa6),'choices':_0x28037e});if(!_0x1c6ad7[_0x4b9e97(0xab)])return console[_0x4b9e97(0xd3)]('Cancelled'),0x0;_0x581c92=_0x1c6ad7[_0x4b9e97(0xab)];}const _0x598246=await withSpinner('Downloading\x20logs...',()=>_0x14e612[_0x4b9e97(0x132)]['logs'](_0x424e58,_0x581c92),{'verbose':_0x55d43a['verbose']}),_0x584a5d=_0x598246[_0x4b9e97(0x101)];return _0x584a5d?console[_0x4b9e97(0xec)](_0x584a5d):console[_0x4b9e97(0xd3)](_0x4b9e97(0xd4)),0x0;}catch(_0x34d3a7){if(_0x34d3a7 instanceof SDKError)return console[_0x4b9e97(0xd3)](_0x4b9e97(0x13b)+_0x34d3a7[_0x4b9e97(0xf3)]),_0x34d3a7[_0x4b9e97(0x115)]&&console['error'](_0x4b9e97(0xfe)+_0x34d3a7[_0x4b9e97(0x115)]),0x1;throw _0x34d3a7;}}}export class WorkflowKillCommand extends BaseCommand{[a43_0xdb3bee(0xc7)]=a43_0xdb3bee(0x102);[a43_0xdb3bee(0xc5)]='Kill\x20a\x20running\x20attempt';async[a43_0xdb3bee(0x11f)](_0x44e4fb){const _0x47a385=a43_0xdb3bee,{options:_0xddf6a5,args:_0x11121c,tdx:_0x3bc941}=_0x44e4fb,_0x44defe=_0x11121c[0x0];if(!_0x44defe)return console[_0x47a385(0xd3)](_0x47a385(0x117)),0x1;try{const _0xf379ab=_0xddf6a5[_0x47a385(0x131)];_0xddf6a5[_0x47a385(0xe7)]&&(console['error'](_0x47a385(0xf2)+_0x44defe),_0xf379ab&&console['error'](_0x47a385(0x139)+_0xf379ab));if(!_0xddf6a5[_0x47a385(0xaa)]){const _0x24f04b=await confirm(_0x47a385(0xa8)+_0x44defe+'?');if(!_0x24f04b)return console[_0x47a385(0xd3)](_0x47a385(0x108)),0x0;}const _0x402f32=await withSpinner(_0x47a385(0x9e),()=>_0x3bc941['workflow'][_0x47a385(0xfa)](_0x44defe,_0xf379ab),{'verbose':_0xddf6a5[_0x47a385(0xe7)]}),_0x17ae4f=_0x402f32[_0x47a385(0x101)];return console[_0x47a385(0xd3)]('✔\x20'+_0x17ae4f),0x0;}catch(_0x4c22be){if(_0x4c22be instanceof SDKError)return console['error'](_0x47a385(0x13b)+_0x4c22be[_0x47a385(0xf3)]),_0x4c22be[_0x47a385(0x115)]&&console[_0x47a385(0xd3)](_0x47a385(0xfe)+_0x4c22be['cause']),0x1;throw _0x4c22be;}}}export class WorkflowRetryCommand extends BaseCommand{[a43_0xdb3bee(0xc7)]=a43_0xdb3bee(0x121);['description']='Retry\x20a\x20session\x20or\x20attempt';async['execute'](_0xc8599b){const _0x485688=a43_0xdb3bee,{options:_0x32134b,args:_0x68348d,tdx:_0x33899f}=_0xc8599b,_0x14f698=_0x68348d[0x0];if(!_0x14f698)return console[_0x485688(0xd3)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x485688(0xd3)](_0x485688(0xcd)),0x1;let _0x1bcbc2=![],_0x38f7f8=_0x14f698;if(_0x14f698[_0x485688(0xd5)](_0x485688(0xfd)))_0x1bcbc2=!![],_0x38f7f8=_0x14f698[_0x485688(0x10c)](0x8);else{if(_0x14f698[_0x485688(0xd5)](_0x485688(0xe2)))_0x1bcbc2=![],_0x38f7f8=_0x14f698[_0x485688(0x10c)](0x8);else return console[_0x485688(0xd3)](_0x485688(0xa7)),console['error'](_0x485688(0xcd)),0x1;}try{const _0x3556ee=_0x32134b['fromTask'],_0x315201=_0x32134b[_0x485688(0x122)],_0x404bfc=_0x32134b[_0x485688(0xb7)],_0x378f1a=_0x32134b['force'];_0x32134b[_0x485688(0xe7)]&&(console[_0x485688(0xd3)](_0x485688(0xdb)+(_0x1bcbc2?'session':_0x485688(0xde))+'\x20'+_0x38f7f8),_0x3556ee&&console[_0x485688(0xd3)](_0x485688(0xc6)+_0x3556ee),_0x315201&&console[_0x485688(0xd3)](_0x485688(0xf6)+_0x315201),_0x404bfc&&console['error'](_0x485688(0x9b)+_0x404bfc),_0x378f1a&&console[_0x485688(0xd3)](_0x485688(0xe1)));let _0x34fba5;if(_0x404bfc)try{if(_0x404bfc[_0x485688(0xd5)]('@')){const _0x5a6974=await import('fs/promises'),_0x128f86=_0x404bfc[_0x485688(0x10c)](0x1),_0xeb67fd=await _0x5a6974['readFile'](_0x128f86,'utf-8');_0x34fba5=JSON['parse'](_0xeb67fd);}else _0x34fba5=JSON[_0x485688(0x133)](_0x404bfc);}catch{return console[_0x485688(0xd3)](_0x485688(0xf0)),0x1;}if(!_0x32134b[_0x485688(0xaa)]){const _0x8c0ab2=await confirm(_0x485688(0xe0)+(_0x1bcbc2?_0x485688(0x141):_0x485688(0xde))+'\x20'+_0x38f7f8+'?');if(!_0x8c0ab2)return console['error']('Cancelled'),0x0;}let _0x3404f6;_0x1bcbc2?_0x3404f6=await withSpinner('Retrying\x20session...',()=>_0x33899f[_0x485688(0x132)][_0x485688(0xe8)](_0x38f7f8,{'fromTask':_0x3556ee,'retryParams':_0x34fba5}),{'verbose':_0x32134b[_0x485688(0xe7)]}):_0x3404f6=await withSpinner('Retrying\x20attempt...',()=>_0x33899f[_0x485688(0x132)]['retryAttempt'](_0x38f7f8,{'resumeFrom':_0x315201,'retryParams':_0x34fba5,'force':_0x378f1a}),{'verbose':_0x32134b[_0x485688(0xe7)]});const _0x4ebf2a=_0x3404f6['data'];return console[_0x485688(0xd3)](_0x485688(0xbb)),console[_0x485688(0xd3)](_0x485688(0x13a)+_0x4ebf2a[_0x485688(0x126)]),console[_0x485688(0xd3)](_0x485688(0xa9)+_0x4ebf2a[_0x485688(0x140)]),0x0;}catch(_0x12b305){if(_0x12b305 instanceof SDKError)return console[_0x485688(0xd3)](_0x485688(0x13b)+_0x12b305[_0x485688(0xf3)]),_0x12b305['cause']&&console['error'](_0x485688(0xfe)+_0x12b305['cause']),0x1;throw _0x12b305;}}}export class WorkflowRunCommand extends BaseCommand{['name']='workflow:run';[a43_0xdb3bee(0xc5)]=a43_0xdb3bee(0xae);async[a43_0xdb3bee(0x11f)](_0xbb489c){const _0x1a9eeb=a43_0xdb3bee,{options:_0x19d1cf,args:_0x5646ed,tdx:_0x48272e}=_0xbb489c,_0x174791=_0x5646ed[0x0];if(!_0x174791)return console['error'](_0x1a9eeb(0x130)),console['error'](_0x1a9eeb(0x9c)),0x1;const _0x3c200c=_0x19d1cf[_0x1a9eeb(0xe3)],_0x496337=_0x19d1cf[_0x1a9eeb(0x9f)],_0x28cd92={};if(_0x3c200c&&Array[_0x1a9eeb(0x135)](_0x3c200c))for(const _0xf623a8 of _0x3c200c){const _0x16e389=_0xf623a8[_0x1a9eeb(0xdc)]('=');if(_0x16e389===-0x1)return console[_0x1a9eeb(0xd3)](_0x1a9eeb(0xb5)+_0xf623a8),console[_0x1a9eeb(0xd3)](_0x1a9eeb(0xba)),0x1;const _0x51cece=_0xf623a8['substring'](0x0,_0x16e389),_0x4898e6=_0xf623a8[_0x1a9eeb(0x10c)](_0x16e389+0x1);try{_0x28cd92[_0x51cece]=JSON[_0x1a9eeb(0x133)](_0x4898e6);}catch{_0x28cd92[_0x51cece]=_0x4898e6;}}_0x19d1cf[_0x1a9eeb(0xe7)]&&(console[_0x1a9eeb(0xd3)](_0x1a9eeb(0xaf)+_0x174791),Object[_0x1a9eeb(0xb6)](_0x28cd92)[_0x1a9eeb(0x116)]>0x0&&console[_0x1a9eeb(0xd3)](_0x1a9eeb(0x103)+JSON[_0x1a9eeb(0xdf)](_0x28cd92)),_0x496337&&console[_0x1a9eeb(0xd3)](_0x1a9eeb(0xe5)+_0x496337));const _0x24804a=await withSpinner(_0x1a9eeb(0x11e),()=>_0x48272e[_0x1a9eeb(0x132)][_0x1a9eeb(0x127)](_0x174791,_0x28cd92,{'sessionTime':_0x496337}),{'verbose':_0x19d1cf[_0x1a9eeb(0xe7)]}),_0x50f933=_0x24804a[_0x1a9eeb(0x101)];return console[_0x1a9eeb(0xd3)](_0x1a9eeb(0x120)),console['error']('\x20\x20Attempt\x20ID:\x20'+_0x50f933['id']),console[_0x1a9eeb(0xd3)](_0x1a9eeb(0xa9)+_0x50f933[_0x1a9eeb(0x140)]),console[_0x1a9eeb(0xd3)](_0x1a9eeb(0x110)+_0x50f933[_0x1a9eeb(0xf4)]?.[_0x1a9eeb(0xc7)]),console[_0x1a9eeb(0xd3)](_0x1a9eeb(0xb9)+_0x50f933['workflow']?.[_0x1a9eeb(0xc7)]),0x0;}}function a43_0x4f89(_0x173ba1,_0xecf0d){_0x173ba1=_0x173ba1-0x9a;const _0x2ca629=a43_0x2ca6();let _0x4f89e3=_0x2ca629[_0x173ba1];return _0x4f89e3;}export class WorkflowDownloadCommand extends BaseCommand{[a43_0xdb3bee(0xc7)]=a43_0xdb3bee(0x12f);[a43_0xdb3bee(0xc5)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async['execute'](_0x22de76){const _0x5d6615=a43_0xdb3bee,{options:_0x3a5dae,args:_0x189eac,tdx:_0x170b08}=_0x22de76,_0x17f681=_0x189eac[0x0],_0x55f54b=_0x189eac[0x1]||'.';if(!_0x17f681)return console[_0x5d6615(0xd3)](_0x5d6615(0xbe)),console['error']('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x4a862b=_0x3a5dae[_0x5d6615(0xc3)];_0x3a5dae[_0x5d6615(0xe7)]&&(console[_0x5d6615(0xd3)]('Project:\x20'+_0x17f681),console['error'](_0x5d6615(0xc4)+_0x55f54b),_0x4a862b&&console[_0x5d6615(0xd3)]('Revision:\x20'+_0x4a862b));const _0x54d735=await withSpinner(_0x5d6615(0x123)+_0x17f681+_0x5d6615(0x142),()=>_0x170b08['workflow'][_0x5d6615(0x9d)](_0x17f681,_0x55f54b,{'revision':_0x4a862b}),{'verbose':_0x3a5dae[_0x5d6615(0xe7)]}),_0x2bfe5d=_0x54d735[_0x5d6615(0x101)];return console[_0x5d6615(0xd3)](_0x5d6615(0xb3)+_0x2bfe5d['projectName']),console[_0x5d6615(0xd3)]('\x20\x20Revision:\x20'+_0x2bfe5d[_0x5d6615(0xc3)]),console[_0x5d6615(0xd3)](_0x5d6615(0x11a)+_0x2bfe5d['filesExtracted']),console[_0x5d6615(0xd3)](_0x5d6615(0xb0)+_0x55f54b+'/'+_0x2bfe5d[_0x5d6615(0xfb)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a43_0xdb3bee(0xc7)]=a43_0xdb3bee(0xbc);[a43_0xdb3bee(0xc5)]=a43_0xdb3bee(0xa2);async[a43_0xdb3bee(0x11f)](_0x52bc0d){const _0x4e4506=a43_0xdb3bee,{options:_0x147574,args:_0x5a2743,tdx:_0x487d7d}=_0x52bc0d;let _0x55f1c7='.',_0x4473fc=_0x147574[_0x4e4506(0xc7)];if(_0x5a2743[0x0]){const {promises:_0x484892}=await import('fs');try{const _0x32500d=await _0x484892[_0x4e4506(0xf1)](_0x5a2743[0x0]);if(_0x32500d[_0x4e4506(0x106)]())_0x55f1c7=_0x5a2743[0x0];else return console[_0x4e4506(0xd3)](_0x4e4506(0x13b)+_0x5a2743[0x0]+_0x4e4506(0xb2)),0x1;}catch{_0x4473fc=_0x5a2743[0x0],_0x55f1c7='.';}}const _0x259725=_0x147574[_0x4e4506(0xc3)],_0x1ac870=_0x147574[_0x4e4506(0xe9)];_0x147574['verbose']&&(console['error'](_0x4e4506(0xc1)+_0x55f1c7),_0x4473fc&&console[_0x4e4506(0xd3)](_0x4e4506(0xea)+_0x4473fc),_0x259725&&console[_0x4e4506(0xd3)](_0x4e4506(0xf8)+_0x259725),_0x1ac870&&console[_0x4e4506(0xd3)]('Validation:\x20skipped'));const _0x1e8921=await withSpinner(_0x4e4506(0xd0),()=>_0x487d7d['workflow'][_0x4e4506(0xca)](_0x55f1c7,{'projectName':_0x4473fc,'revision':_0x259725,'skipValidation':_0x1ac870}),{'verbose':_0x147574[_0x4e4506(0xe7)]}),_0x2976b7=_0x1e8921[_0x4e4506(0x101)];return console[_0x4e4506(0xd3)](_0x4e4506(0x13e)+_0x2976b7[_0x4e4506(0xfb)]),console[_0x4e4506(0xd3)]('\x20\x20Project\x20ID:\x20'+_0x2976b7[_0x4e4506(0x107)]),console[_0x4e4506(0xd3)](_0x4e4506(0xd6)+_0x2976b7[_0x4e4506(0xc3)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a43_0xdb3bee(0xf7);[a43_0xdb3bee(0xc5)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a43_0xdb3bee(0x11f)](_0x561d2d){const _0x512ebf=a43_0xdb3bee,{options:_0xbdaabc,args:_0x8d2739,tdx:_0x4f41d2}=_0x561d2d,_0x2b89ee=_0x8d2739[0x0];if(!_0x2b89ee)return console[_0x512ebf(0xd3)](_0x512ebf(0x143)),console[_0x512ebf(0xd3)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0xbdaabc['verbose']&&console[_0x512ebf(0xd3)](_0x512ebf(0x13f)+_0x2b89ee);if(!_0xbdaabc[_0x512ebf(0xaa)]){const _0x7a773=await confirm(_0x512ebf(0xfc)+_0x2b89ee+_0x512ebf(0x10e));if(!_0x7a773)return console[_0x512ebf(0xd3)]('Cancelled'),0x0;}const _0x454505=await withSpinner(_0x512ebf(0xe6)+_0x2b89ee+_0x512ebf(0x142),()=>_0x4f41d2[_0x512ebf(0x132)][_0x512ebf(0xb4)](_0x2b89ee),{'verbose':_0xbdaabc[_0x512ebf(0xe7)]}),_0x8fefbf=_0x454505[_0x512ebf(0x101)];return console['error'](_0x512ebf(0x11b)+_0x8fefbf[_0x512ebf(0xfb)]),console[_0x512ebf(0xd3)](_0x512ebf(0x125)+_0x8fefbf[_0x512ebf(0x107)]),0x0;}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x59017f,_0x2d5e6d){const _0x26c4a9=a44_0x543f,_0x526293=_0x59017f();while(!![]){try{const _0x1ef027=parseInt(_0x26c4a9(0x1c2))/0x1+-parseInt(_0x26c4a9(0x1ce))/0x2+parseInt(_0x26c4a9(0x1d3))/0x3*(parseInt(_0x26c4a9(0x1cc))/0x4)+parseInt(_0x26c4a9(0x1d0))/0x5*(-parseInt(_0x26c4a9(0x1d1))/0x6)+parseInt(_0x26c4a9(0x1c1))/0x7+parseInt(_0x26c4a9(0x1ca))/0x8*(parseInt(_0x26c4a9(0x1c8))/0x9)+parseInt(_0x26c4a9(0x1cf))/0xa*(parseInt(_0x26c4a9(0x1c5))/0xb);if(_0x1ef027===_0x2d5e6d)break;else _0x526293['push'](_0x526293['shift']());}catch(_0x199189){_0x526293['push'](_0x526293['shift']());}}}(a44_0x390f,0x724b1));import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x1aff01=a44_0x543f;try{const _0x17afd1=fileURLToPath(import.meta.url),_0x1d9e7f=dirname(_0x17afd1),_0x2002b2=join(_0x1d9e7f,_0x1aff01(0x1d4)),_0x5a74e3=JSON['parse'](readFileSync(_0x2002b2,_0x1aff01(0x1bf)));return _0x5a74e3[_0x1aff01(0x1c3)];}catch{return _0x1aff01(0x1cb);}}export function getUserAgent(){const _0x4d73d8=a44_0x543f,_0x1922a9=getVersion(),_0x2fabd0=platform(),_0x112e88=process[_0x4d73d8(0x1c3)][_0x4d73d8(0x1c6)]('v','');return _0x4d73d8(0x1c0)+_0x1922a9+'\x20('+_0x2fabd0+_0x4d73d8(0x1d2)+_0x112e88+')';}export function getAuthHeaders(_0x54d5d6,_0x40c20e){const _0x470e39=a44_0x543f,_0xc93385=getVersion(),_0xcbb6a2={'User-Agent':getUserAgent(),'X-TD-Client':_0x470e39(0x1cd),'X-TD-Client-Version':_0xc93385};return _0x40c20e&&(_0xcbb6a2[_0x470e39(0x1c4)]=_0x470e39(0x1c7)+_0x40c20e),_0xcbb6a2;}export function toHeaderRecord(_0x2bbffa){const _0x537223={};for(const [_0x506b58,_0x4db3a8]of Object['entries'](_0x2bbffa)){_0x4db3a8!==undefined&&(_0x537223[_0x506b58]=_0x4db3a8);}return _0x537223;}function a44_0x543f(_0x23d2e2,_0x463ecd){_0x23d2e2=_0x23d2e2-0x1bf;const _0x390f84=a44_0x390f();let _0x543f43=_0x390f84[_0x23d2e2];return _0x543f43;}export function getTrinoHeaders(_0x3df397,_0xed100e){const _0x4686d0=a44_0x543f,_0x53dc0f=getAuthHeaders(_0x3df397,_0xed100e),_0x2da8db=toHeaderRecord(_0x53dc0f);return delete _0x2da8db[_0x4686d0(0x1c4)],_0xed100e&&(_0x2da8db[_0x4686d0(0x1c9)]=_0xed100e),_0x2da8db;}export function hasAPIKey(_0x23ca72){const _0x568f81=getAPIKey(_0x23ca72);return _0x568f81!==undefined&&_0x568f81['length']>0x0;}function a44_0x390f(){const _0x557414=['12uSZGho',';\x20node/','3nByxQL','../../package.json','utf-8','tdx/','3602368dGVvBo','301115JYSWNI','version','Authorization','11dqClCp','replace','TD1\x20','243Kzxzob','X-Trino-User','159304vmRGbj','0.0.0','426796PoRKqF','tdx','786372ygqLpq','391280XUwjGs','1594715DGBBfL'];a44_0x390f=function(){return _0x557414;};return a44_0x390f();}
1
+ (function(_0x4b01a1,_0x462736){const _0x166858=a44_0x4b1b,_0x33d4a7=_0x4b01a1();while(!![]){try{const _0x3617c9=-parseInt(_0x166858(0x178))/0x1*(-parseInt(_0x166858(0x17a))/0x2)+parseInt(_0x166858(0x179))/0x3*(-parseInt(_0x166858(0x17b))/0x4)+parseInt(_0x166858(0x17e))/0x5*(-parseInt(_0x166858(0x181))/0x6)+-parseInt(_0x166858(0x175))/0x7+parseInt(_0x166858(0x173))/0x8*(parseInt(_0x166858(0x17c))/0x9)+parseInt(_0x166858(0x172))/0xa+parseInt(_0x166858(0x182))/0xb;if(_0x3617c9===_0x462736)break;else _0x33d4a7['push'](_0x33d4a7['shift']());}catch(_0x806b73){_0x33d4a7['push'](_0x33d4a7['shift']());}}}(a44_0x3df7,0xcab43));import{platform}from'os';function a44_0x4b1b(_0x10eb44,_0x27ba5a){_0x10eb44=_0x10eb44-0x170;const _0x3df780=a44_0x3df7();let _0x4b1b54=_0x3df780[_0x10eb44];return _0x4b1b54;}import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x20f0cf=a44_0x4b1b;try{const _0x157700=fileURLToPath(import.meta.url),_0x264ef5=dirname(_0x157700),_0x4b847a=join(_0x264ef5,'../../package.json'),_0x54803b=JSON[_0x20f0cf(0x17d)](readFileSync(_0x4b847a,_0x20f0cf(0x17f)));return _0x54803b[_0x20f0cf(0x183)];}catch{return _0x20f0cf(0x174);}}function a44_0x3df7(){const _0xf1a433=['9mvwWEQ','parse','205GwqWPy','utf-8','entries','135114Iimsrx','15852804EWiOAx','version','length','Authorization','tdx','TD1\x20','1278950njrxlQ','11388248EdmszU','0.0.0','6180664zjEyUb',';\x20node/','tdx/','1500fcgWXO','24pydqMn','1262OUgPdW','651292EjMbEh'];a44_0x3df7=function(){return _0xf1a433;};return a44_0x3df7();}export function getUserAgent(){const _0xd560b5=a44_0x4b1b,_0x4ad9ba=getVersion(),_0x21b04e=platform(),_0x414504=process[_0xd560b5(0x183)]['replace']('v','');return _0xd560b5(0x177)+_0x4ad9ba+'\x20('+_0x21b04e+_0xd560b5(0x176)+_0x414504+')';}export function getAuthHeaders(_0x3c8278,_0x47b86f){const _0x3496f7=a44_0x4b1b,_0x42e87a=getVersion(),_0x319e69={'User-Agent':getUserAgent(),'X-TD-Client':_0x3496f7(0x170),'X-TD-Client-Version':_0x42e87a};return _0x47b86f&&(_0x319e69['Authorization']=_0x3496f7(0x171)+_0x47b86f),_0x319e69;}export function toHeaderRecord(_0x5d6ce6){const _0x4a9f91=a44_0x4b1b,_0x57e9de={};for(const [_0x2d7546,_0x42ecf1]of Object[_0x4a9f91(0x180)](_0x5d6ce6)){_0x42ecf1!==undefined&&(_0x57e9de[_0x2d7546]=_0x42ecf1);}return _0x57e9de;}export function getTrinoHeaders(_0x1f7649,_0x24ff44){const _0x37f700=a44_0x4b1b,_0x3627a6=getAuthHeaders(_0x1f7649,_0x24ff44),_0x5b94b5=toHeaderRecord(_0x3627a6);return delete _0x5b94b5[_0x37f700(0x185)],_0x24ff44&&(_0x5b94b5['X-Trino-User']=_0x24ff44),_0x5b94b5;}export function hasAPIKey(_0x1bc5f3){const _0xc380d5=a44_0x4b1b,_0x421330=getAPIKey(_0x1bc5f3);return _0x421330!==undefined&&_0x421330[_0xc380d5(0x184)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x208ad7,_0x2c78a0){const _0x103ab9=a45_0x4312,_0x16b768=_0x208ad7();while(!![]){try{const _0x59efb6=parseInt(_0x103ab9(0x1de))/0x1*(-parseInt(_0x103ab9(0x1df))/0x2)+-parseInt(_0x103ab9(0x1c6))/0x3+parseInt(_0x103ab9(0x196))/0x4*(-parseInt(_0x103ab9(0x1aa))/0x5)+parseInt(_0x103ab9(0x1be))/0x6+-parseInt(_0x103ab9(0x1d0))/0x7*(-parseInt(_0x103ab9(0x1b3))/0x8)+-parseInt(_0x103ab9(0x1a9))/0x9*(parseInt(_0x103ab9(0x19a))/0xa)+-parseInt(_0x103ab9(0x1d1))/0xb*(-parseInt(_0x103ab9(0x1ba))/0xc);if(_0x59efb6===_0x2c78a0)break;else _0x16b768['push'](_0x16b768['shift']());}catch(_0x11dedf){_0x16b768['push'](_0x16b768['shift']());}}}(a45_0x57eb,0x88600));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a45_0x418d12 from'node:fs';import*as a45_0x5bd526 from'node:path';import{SITE_ALIASES}from'../types/index.js';function a45_0x4312(_0x4911e5,_0x12971e){_0x4911e5=_0x4911e5-0x191;const _0x57eb0b=a45_0x57eb();let _0x4312d5=_0x57eb0b[_0x4911e5];return _0x4312d5;}import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a45_0x2cad6f from'chalk';export function getConfigDir(){const _0x199ac0=a45_0x4312;return process[_0x199ac0(0x1d7)]['TDX_CONFIG_DIR']||join(homedir(),_0x199ac0(0x191),_0x199ac0(0x192));}function a45_0x57eb(){const _0x373d43=['ap02','TDX_API_KEY_<PROFILE>','us01','keychain','50532HYHmcr','accountId','legacy\x20.env\x20file\x20(profile:\x20','.env.','5630658SxzaIY','dev-us01','TD_API_KEY','endsWith','stg-ap03','apiKeys','TDX_API_KEY\x20env\x20var','trim','1295040VFCQPM','entries','account_info.','readFileSync','stg-jp01','ap03','eu01','dev-eu01','stringify','\x20env\x20var','650636yGyZIJ','5599wdOILt','isDeprecated','keychain\x20(profile:\x20','Warning:\x20Failed\x20to\x20read\x20','filter','number','env','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','string','TD_API_KEY\x20env\x20var\x20(deprecated)','llm_default_project','some','.json','5GQkSdL','389622yNnNkd','existsSync','toISOString','.config','tdx','toUpperCase','TD_API_KEY_','utf-8','44CmyRYM','stg-us01','replace','map','90JczQvE','match','apiKey','TDX_API_KEY','parse','yellow','TDX_CACHE_DIR','split','tdx.json','startsWith','jp01','slice','includes','llm_default_project.','.env','199935lKfTuv','501580BymFrh','\x27,\x20defaulting\x20to\x20us01','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','name','warn','account_info.json','Warning:\x20Unknown\x20site\x20\x27','TDX_API_KEY_','16rWoXme','join','site'];a45_0x57eb=function(){return _0x373d43;};return a45_0x57eb();}export function getConfigFile(){const _0x5d0c2f=a45_0x4312;return join(getConfigDir(),_0x5d0c2f(0x1a8));}export function getConfigFilePath(_0x45e8ea){const _0x5e7777=a45_0x4312,_0x461d3c=getConfigDir();return _0x45e8ea?a45_0x5bd526[_0x5e7777(0x1b4)](_0x461d3c,'.env.'+_0x45e8ea):getConfigFile();}export function getCacheDir(){const _0x4ebf0c=a45_0x4312;return process['env'][_0x4ebf0c(0x1a0)]||join(homedir(),'.cache',_0x4ebf0c(0x192));}export function getLLMProjectCacheFile(_0x4ece6d){const _0x249136=a45_0x4312,_0x48a987=_0x4ece6d?_0x249136(0x1a7)+_0x4ece6d:_0x249136(0x1db);return join(getCacheDir(),_0x48a987);}export function readCachedLLMProject(_0x5da3cc){const _0xc5f33b=a45_0x4312;try{const _0x171aae=getLLMProjectCacheFile(_0x5da3cc);if(!existsSync(_0x171aae))return null;const _0x2232e3=readFileSync(_0x171aae,'utf-8')['trim']();try{const _0xc333b8=JSON[_0xc5f33b(0x19e)](_0x2232e3);if(_0xc333b8&&typeof _0xc333b8['id']==='string'&&typeof _0xc333b8[_0xc5f33b(0x1ae)]===_0xc5f33b(0x1d9))return _0xc333b8;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x272b47,_0x27dd18,_0x3a9897){const _0x13d812=a45_0x4312;try{const _0x4f2f02=getCacheDir(),_0x4ce124=getLLMProjectCacheFile(_0x3a9897);!existsSync(_0x4f2f02)&&mkdirSync(_0x4f2f02,{'recursive':!![]});const _0x53aa88={'name':_0x272b47,'id':_0x27dd18};writeFileSync(_0x4ce124,JSON[_0x13d812(0x1ce)](_0x53aa88),_0x13d812(0x195));}catch{}}export function getAccountInfoCacheFile(_0xd94134){const _0x279903=a45_0x4312,_0x1d760a=_0xd94134?_0x279903(0x1c8)+_0xd94134+_0x279903(0x1dd):_0x279903(0x1b0);return join(getCacheDir(),_0x1d760a);}export function readCachedAccountInfo(_0x2e5274){const _0x4d7c7c=a45_0x4312;try{const _0x40de0a=getAccountInfoCacheFile(_0x2e5274);if(!existsSync(_0x40de0a))return null;const _0x266dc1=readFileSync(_0x40de0a,_0x4d7c7c(0x195))[_0x4d7c7c(0x1c5)](),_0x497175=JSON[_0x4d7c7c(0x19e)](_0x266dc1);if(_0x497175&&typeof _0x497175[_0x4d7c7c(0x1b5)]===_0x4d7c7c(0x1d9)&&typeof _0x497175[_0x4d7c7c(0x1bb)]===_0x4d7c7c(0x1d6))return _0x497175;return null;}catch{return null;}}export function writeCachedAccountInfo(_0xe1c8af,_0xd7bbae,_0x39315e){const _0x52a23d=a45_0x4312;try{const _0x206f41=getCacheDir(),_0x1f9320=getAccountInfoCacheFile(_0x39315e);!existsSync(_0x206f41)&&mkdirSync(_0x206f41,{'recursive':!![]});const _0x33707d={'site':_0xe1c8af,'accountId':_0xd7bbae,'cachedAt':new Date()[_0x52a23d(0x1e1)]()};writeFileSync(_0x1f9320,JSON[_0x52a23d(0x1ce)](_0x33707d),_0x52a23d(0x195));}catch{}}export function parseEnvFile(_0x40d130){const _0x5b42d6=a45_0x4312,_0x298291={};for(const _0x565f72 of _0x40d130[_0x5b42d6(0x1a1)]('\x0a')){const _0x328aef=_0x565f72[_0x5b42d6(0x1c5)]();if(!_0x328aef||_0x328aef[_0x5b42d6(0x1a3)]('#'))continue;const _0x529d70=_0x328aef[_0x5b42d6(0x19b)](/^([^=]+)=(.*)$/);if(_0x529d70){const _0x93c8f0=_0x529d70[0x1]['trim']();let _0x3880bd=_0x529d70[0x2][_0x5b42d6(0x1c5)]();(_0x3880bd[_0x5b42d6(0x1a3)]('\x22')&&_0x3880bd[_0x5b42d6(0x1c1)]('\x22')||_0x3880bd['startsWith']('\x27')&&_0x3880bd[_0x5b42d6(0x1c1)]('\x27'))&&(_0x3880bd=_0x3880bd[_0x5b42d6(0x1a5)](0x1,-0x1)),_0x298291[_0x93c8f0]=_0x3880bd;}}return _0x298291;}export function readUserConfig(){const _0x14b546=a45_0x4312,_0x466ac3=getConfigFile();if(!existsSync(_0x466ac3))return{};try{const _0x1ae776=readFileSync(_0x466ac3,'utf-8');return parseEnvFile(_0x1ae776);}catch(_0x5b749f){return console[_0x14b546(0x1af)](_0x14b546(0x1ac)+_0x466ac3+':',_0x5b749f),{};}}export function resolveSite(_0x165e4d){const _0x29a0ca=a45_0x4312,_0x4d743f=[_0x29a0ca(0x1b8),_0x29a0ca(0x1a4),_0x29a0ca(0x1cc),_0x29a0ca(0x1b6),_0x29a0ca(0x1cb),_0x29a0ca(0x1bf),_0x29a0ca(0x1cd),_0x29a0ca(0x197),_0x29a0ca(0x1ca),_0x29a0ca(0x1c2)];if(_0x4d743f[_0x29a0ca(0x1a6)](_0x165e4d))return _0x165e4d;if(_0x165e4d in SITE_ALIASES)return SITE_ALIASES[_0x165e4d];return console['warn'](_0x29a0ca(0x1b1)+_0x165e4d+_0x29a0ca(0x1ab)),_0x29a0ca(0x1b8);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x19db1a,_0x367d01){const _0xe8ca85=a45_0x4312,_0x138e61=_0x367d01||getActiveProfileName();if(_0x138e61){const _0x29a555=_0xe8ca85(0x1b2)+normalizeProfileForEnvVar(_0x138e61);if(process[_0xe8ca85(0x1d7)][_0x29a555])return process['env'][_0x29a555];}if(process['env'][_0xe8ca85(0x19d)])return process[_0xe8ca85(0x1d7)][_0xe8ca85(0x19d)];if(process[_0xe8ca85(0x1d7)]['TD_API_KEY'])return process[_0xe8ca85(0x1d7)]['TD_API_KEY'];const _0x1bb6c1=_0x19db1a['toUpperCase']()['replace'](/-/g,'_'),_0x42e993=_0xe8ca85(0x194)+_0x1bb6c1;if(_0x138e61){const _0x49716c=loadProfileEnv(_0x138e61);if(_0x49716c){if(_0x49716c[_0x42e993])return _0x49716c[_0x42e993];if(_0x49716c[_0xe8ca85(0x1c0)])return _0x49716c[_0xe8ca85(0x1c0)];}}const _0x14eb6d=loadUserConfigOnce();if(_0x14eb6d[_0x42e993])return _0x14eb6d[_0x42e993];if(_0x14eb6d[_0xe8ca85(0x1c0)])return _0x14eb6d[_0xe8ca85(0x1c0)];return undefined;}export function normalizeProfileForEnvVar(_0xe8775d){const _0x2f2b2f=a45_0x4312;return _0xe8775d[_0x2f2b2f(0x193)]()[_0x2f2b2f(0x198)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x237504,_0x25f1a6){const _0x3be49e=a45_0x4312,_0x3afbd3=_0x25f1a6||getActiveProfileName()||undefined;if(_0x3afbd3){const _0x1a38d5=_0x3be49e(0x1b2)+normalizeProfileForEnvVar(_0x3afbd3);if(process[_0x3be49e(0x1d7)][_0x1a38d5])return{'apiKey':process[_0x3be49e(0x1d7)][_0x1a38d5],'source':_0x1a38d5+_0x3be49e(0x1cf),'isDeprecated':![]};const _0x2c1d25=getCachedCredential(_0x237504,_0x3afbd3);if(_0x2c1d25)return{'apiKey':_0x2c1d25,'source':_0x3be49e(0x1d3)+_0x3afbd3+')','isDeprecated':![]};const _0x59907f=await getKeychainAPIKey(_0x3afbd3);if(_0x59907f)return setCachedCredential(_0x59907f,_0x237504,_0x3afbd3),{'apiKey':_0x59907f,'source':'keychain\x20(profile:\x20'+_0x3afbd3+')','isDeprecated':![]};}if(process[_0x3be49e(0x1d7)][_0x3be49e(0x19d)])return{'apiKey':process['env'][_0x3be49e(0x19d)],'source':_0x3be49e(0x1c4),'isDeprecated':![]};if(!_0x3afbd3){const _0x2b98fc=getCachedCredential(_0x237504,undefined);if(_0x2b98fc)return{'apiKey':_0x2b98fc,'source':_0x3be49e(0x1b9),'isDeprecated':![]};const _0x256d2c=await getKeychainAPIKey(undefined);if(_0x256d2c)return setCachedCredential(_0x256d2c,_0x237504,undefined),{'apiKey':_0x256d2c,'source':_0x3be49e(0x1b9),'isDeprecated':![]};}if(process[_0x3be49e(0x1d7)][_0x3be49e(0x1c0)])return{'apiKey':process['env'][_0x3be49e(0x1c0)],'source':_0x3be49e(0x1da),'isDeprecated':!![]};const _0x18cd99=getLegacyEnvAPIKey(_0x237504,_0x3afbd3);if(_0x18cd99){const _0x41178f=await isKeychainAvailable();if(_0x41178f)try{await saveKeychainAPIKey(_0x18cd99,_0x3afbd3),setCachedCredential(_0x18cd99,_0x237504,_0x3afbd3);const _0x2a014a=getConfigFilePath(_0x3afbd3);cleanupLegacyEnvFile(_0x2a014a)&&console[_0x3be49e(0x1af)](a45_0x2cad6f[_0x3be49e(0x19f)](_0x3be49e(0x1ad)));}catch(_0x1d75b8){console[_0x3be49e(0x1af)](a45_0x2cad6f[_0x3be49e(0x19f)]('⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20'+_0x1d75b8));}const _0x2eca1a=_0x3afbd3?_0x3be49e(0x1bc)+_0x3afbd3+')':'legacy\x20.env\x20file';return{'apiKey':_0x18cd99,'source':_0x2eca1a,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x488125,_0x3e8155,_0x28f667=!![]){const _0x5dbabf=a45_0x4312,_0x5a2482=await resolveAPIKeyAsync(_0x488125,_0x3e8155);if(!_0x5a2482)return undefined;if(_0x28f667&&_0x5a2482[_0x5dbabf(0x1d2)]&&_0x5a2482['source'][_0x5dbabf(0x1a6)](_0x5dbabf(0x1c0))){const _0x55f995=_0x3e8155||getActiveProfileName()||undefined,_0xd32deb=_0x55f995?'TDX_API_KEY_'+normalizeProfileForEnvVar(_0x55f995):_0x5dbabf(0x1b7);console[_0x5dbabf(0x1af)](a45_0x2cad6f[_0x5dbabf(0x19f)](_0x5dbabf(0x1d8)+('\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20'+_0xd32deb+').')));}return _0x5a2482[_0x5dbabf(0x19c)];}function getLegacyEnvAPIKey(_0x56ce48,_0x2b196a){const _0xdb7b28=a45_0x4312,_0x3db586=_0x56ce48['toUpperCase']()[_0xdb7b28(0x198)](/-/g,'_'),_0x5112d7=_0xdb7b28(0x194)+_0x3db586;if(_0x2b196a){const _0x34cb9e=loadProfileEnv(_0x2b196a);if(_0x34cb9e){if(_0x34cb9e[_0x5112d7])return _0x34cb9e[_0x5112d7];if(_0x34cb9e['TD_API_KEY'])return _0x34cb9e[_0xdb7b28(0x1c0)];}}const _0x32fbda=loadUserConfigOnce();if(_0x32fbda[_0x5112d7])return _0x32fbda[_0x5112d7];if(_0x32fbda['TD_API_KEY'])return _0x32fbda[_0xdb7b28(0x1c0)];return undefined;}function cleanupLegacyEnvFile(_0x5e355){const _0x15285c=a45_0x4312;if(!existsSync(_0x5e355))return![];try{const _0x3c1d4f=readFileSync(_0x5e355,_0x15285c(0x195)),_0x154d17=_0x3c1d4f['split']('\x0a'),_0x47925f=_0x154d17[_0x15285c(0x1d5)](_0x57f856=>{const _0x2e65e6=_0x15285c,_0x267b08=_0x57f856['trim']();if(!_0x267b08||_0x267b08[_0x2e65e6(0x1a3)]('#'))return!![];const [_0x454ad0]=_0x267b08[_0x2e65e6(0x1a1)]('=');return!_0x454ad0[_0x2e65e6(0x1a3)](_0x2e65e6(0x1c0));}),_0x46b5c9=_0x47925f[_0x15285c(0x1dc)](_0x3660ca=>{const _0x435c6f=_0x15285c,_0x40cd05=_0x3660ca[_0x435c6f(0x1c5)]();return _0x40cd05&&!_0x40cd05[_0x435c6f(0x1a3)]('#');});if(!_0x46b5c9)return unlinkSync(_0x5e355),!![];return writeFileSync(_0x5e355,_0x47925f[_0x15285c(0x1b4)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x246712){const _0x810104=a45_0x4312,_0x4357eb=a45_0x5bd526[_0x810104(0x1b4)](getConfigDir(),_0x810104(0x1bd)+_0x246712);if(a45_0x418d12[_0x810104(0x1e0)](_0x4357eb)){validateSecureFilePermissions(_0x4357eb);try{const _0x22723b=a45_0x418d12[_0x810104(0x1c9)](_0x4357eb,_0x810104(0x195));return parseEnvFile(_0x22723b);}catch(_0x1927e9){console['warn']('Warning:\x20Failed\x20to\x20load\x20'+_0x4357eb+':\x20'+_0x1927e9);}}const _0x238bb6=a45_0x5bd526[_0x810104(0x1b4)](getConfigDir(),'profiles',_0x246712,'.env');if(a45_0x418d12[_0x810104(0x1e0)](_0x238bb6)){validateSecureFilePermissions(_0x238bb6);try{const _0x1f6972=a45_0x418d12['readFileSync'](_0x238bb6,_0x810104(0x195));return parseEnvFile(_0x1f6972);}catch(_0x969448){return console[_0x810104(0x1af)]('Warning:\x20Failed\x20to\x20load\x20'+_0x238bb6+':\x20'+_0x969448),null;}}return null;}function getActiveProfileName(){const _0x123f0b=a45_0x4312,_0x6ebe5f=a45_0x5bd526[_0x123f0b(0x1b4)](getConfigDir(),_0x123f0b(0x1a2));if(!a45_0x418d12[_0x123f0b(0x1e0)](_0x6ebe5f))return null;try{const _0x209674=a45_0x418d12[_0x123f0b(0x1c9)](_0x6ebe5f,_0x123f0b(0x195)),_0x2cb42f=JSON[_0x123f0b(0x19e)](_0x209674);return _0x2cb42f['profile']||null;}catch{return null;}}export function saveAPIKey(_0x24fb4a,_0x29ebc9,_0x34dd55){const _0x4af703=a45_0x4312,_0x3b38f2=getConfigDir(),_0x70ca11=getConfigFilePath(_0x34dd55);!existsSync(_0x3b38f2)&&mkdirSync(_0x3b38f2,{'recursive':!![],'mode':0x1c0});let _0x25fa15={};if(existsSync(_0x70ca11))try{const _0x5ef91c=readFileSync(_0x70ca11,'utf-8');_0x25fa15=parseEnvFile(_0x5ef91c);}catch(_0x59eb89){console[_0x4af703(0x1af)](_0x4af703(0x1d4)+_0x70ca11+':',_0x59eb89);}const _0x1d2c5c=_0x24fb4a[_0x4af703(0x193)]()[_0x4af703(0x198)](/-/g,'_');_0x25fa15[_0x4af703(0x194)+_0x1d2c5c]=_0x29ebc9;const _0x38b568=Object[_0x4af703(0x1c7)](_0x25fa15)[_0x4af703(0x199)](([_0x2f8d7b,_0x265151])=>_0x2f8d7b+'='+_0x265151);writeFileSync(_0x70ca11,_0x38b568['join']('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x2f98db,_0x38f4c0,_0x1bf0c3){const _0x2f6747=a45_0x4312;await saveKeychainAPIKey(_0x2f98db,_0x1bf0c3),setCachedCredential(_0x2f98db,_0x38f4c0,_0x1bf0c3);const _0x3ea02a=getConfigFilePath(_0x1bf0c3);cleanupLegacyEnvFile(_0x3ea02a)&&console[_0x2f6747(0x1af)](a45_0x2cad6f['yellow']('⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file'));}export function loadConfig(){const _0x43ac3c=a45_0x4312,_0x3194b9={'apiKeys':{},'defaultSite':_0x43ac3c(0x1b8)},_0xfc977e=['us01',_0x43ac3c(0x1a4),_0x43ac3c(0x1cc),_0x43ac3c(0x1b6),_0x43ac3c(0x1cb),'dev-us01',_0x43ac3c(0x1cd),_0x43ac3c(0x197),_0x43ac3c(0x1ca),_0x43ac3c(0x1c2)];for(const _0x4e8a35 of _0xfc977e){const _0x36f775=getAPIKey(_0x4e8a35);_0x36f775&&(_0x3194b9[_0x43ac3c(0x1c3)][_0x4e8a35]=_0x36f775);}return _0x3194b9;}
1
+ (function(_0x461a0e,_0x5086a0){const _0x3a0cb8=a45_0x4065,_0x54f77c=_0x461a0e();while(!![]){try{const _0x43b2f7=parseInt(_0x3a0cb8(0x1db))/0x1*(parseInt(_0x3a0cb8(0x1da))/0x2)+-parseInt(_0x3a0cb8(0x1d8))/0x3*(parseInt(_0x3a0cb8(0x1cb))/0x4)+parseInt(_0x3a0cb8(0x1d7))/0x5*(-parseInt(_0x3a0cb8(0x1df))/0x6)+parseInt(_0x3a0cb8(0x1e0))/0x7*(-parseInt(_0x3a0cb8(0x1ef))/0x8)+parseInt(_0x3a0cb8(0x1f6))/0x9*(-parseInt(_0x3a0cb8(0x20c))/0xa)+-parseInt(_0x3a0cb8(0x1d1))/0xb*(-parseInt(_0x3a0cb8(0x1d4))/0xc)+parseInt(_0x3a0cb8(0x204))/0xd*(parseInt(_0x3a0cb8(0x1ed))/0xe);if(_0x43b2f7===_0x5086a0)break;else _0x54f77c['push'](_0x54f77c['shift']());}catch(_0x1f72ea){_0x54f77c['push'](_0x54f77c['shift']());}}}(a45_0x8e54,0x8e0f1));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a45_0x109a07 from'node:fs';import*as a45_0x127b04 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 a45_0x2e3f95 from'chalk';export function getConfigDir(){const _0x53b3c9=a45_0x4065;return process[_0x53b3c9(0x1d2)][_0x53b3c9(0x1fc)]||join(homedir(),_0x53b3c9(0x1fa),_0x53b3c9(0x1ce));}export function getConfigFile(){const _0x49cbb2=a45_0x4065;return join(getConfigDir(),_0x49cbb2(0x1e3));}export function getConfigFilePath(_0x572e73){const _0x32ffd0=a45_0x4065,_0x4afa04=getConfigDir();return _0x572e73?a45_0x127b04['join'](_0x4afa04,_0x32ffd0(0x1d6)+_0x572e73):getConfigFile();}export function getCacheDir(){const _0x6d700=a45_0x4065;return process['env']['TDX_CACHE_DIR']||join(homedir(),'.cache',_0x6d700(0x1ce));}export function getLLMProjectCacheFile(_0x468b96){const _0xd75707=a45_0x4065,_0x4c79e1=_0x468b96?'llm_default_project.'+_0x468b96:_0xd75707(0x1cd);return join(getCacheDir(),_0x4c79e1);}export function readCachedLLMProject(_0x518fe9){const _0x1fd72b=a45_0x4065;try{const _0x5783de=getLLMProjectCacheFile(_0x518fe9);if(!existsSync(_0x5783de))return null;const _0x1652ef=readFileSync(_0x5783de,_0x1fd72b(0x1fb))[_0x1fd72b(0x1e1)]();try{const _0x23fc2a=JSON[_0x1fd72b(0x210)](_0x1652ef);if(_0x23fc2a&&typeof _0x23fc2a['id']==='string'&&typeof _0x23fc2a[_0x1fd72b(0x1c8)]===_0x1fd72b(0x203))return _0x23fc2a;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x45fc02,_0x3570f0,_0x433f41){const _0x5fabdb=a45_0x4065;try{const _0x42023b=getCacheDir(),_0x5180a5=getLLMProjectCacheFile(_0x433f41);!existsSync(_0x42023b)&&mkdirSync(_0x42023b,{'recursive':!![]});const _0x47f074={'name':_0x45fc02,'id':_0x3570f0};writeFileSync(_0x5180a5,JSON[_0x5fabdb(0x1fe)](_0x47f074),_0x5fabdb(0x1fb));}catch{}}export function getAccountInfoCacheFile(_0x515493){const _0x1691a9=a45_0x4065,_0x4a86ac=_0x515493?_0x1691a9(0x1f5)+_0x515493+_0x1691a9(0x205):'account_info.json';return join(getCacheDir(),_0x4a86ac);}export function readCachedAccountInfo(_0x3f633c){const _0x3512fa=a45_0x4065;try{const _0x45c5b7=getAccountInfoCacheFile(_0x3f633c);if(!existsSync(_0x45c5b7))return null;const _0x459edc=readFileSync(_0x45c5b7,_0x3512fa(0x1fb))[_0x3512fa(0x1e1)](),_0x263f4a=JSON[_0x3512fa(0x210)](_0x459edc);if(_0x263f4a&&typeof _0x263f4a[_0x3512fa(0x1e6)]===_0x3512fa(0x203)&&typeof _0x263f4a['accountId']===_0x3512fa(0x1c4))return _0x263f4a;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x56a791,_0x414cf0,_0x2ed5f6){const _0x42a863=a45_0x4065;try{const _0xaac387=getCacheDir(),_0x5a66e1=getAccountInfoCacheFile(_0x2ed5f6);!existsSync(_0xaac387)&&mkdirSync(_0xaac387,{'recursive':!![]});const _0x2ab662={'site':_0x56a791,'accountId':_0x414cf0,'cachedAt':new Date()[_0x42a863(0x1ec)]()};writeFileSync(_0x5a66e1,JSON[_0x42a863(0x1fe)](_0x2ab662),_0x42a863(0x1fb));}catch{}}export function parseEnvFile(_0x102e37){const _0x44834f=a45_0x4065,_0x1ab854={};for(const _0x920dba of _0x102e37[_0x44834f(0x1c6)]('\x0a')){const _0x15525d=_0x920dba[_0x44834f(0x1e1)]();if(!_0x15525d||_0x15525d[_0x44834f(0x1e2)]('#'))continue;const _0x4064a3=_0x15525d[_0x44834f(0x1e5)](/^([^=]+)=(.*)$/);if(_0x4064a3){const _0x4b847d=_0x4064a3[0x1][_0x44834f(0x1e1)]();let _0x15d32b=_0x4064a3[0x2][_0x44834f(0x1e1)]();(_0x15d32b['startsWith']('\x22')&&_0x15d32b['endsWith']('\x22')||_0x15d32b['startsWith']('\x27')&&_0x15d32b[_0x44834f(0x1f1)]('\x27'))&&(_0x15d32b=_0x15d32b[_0x44834f(0x1c7)](0x1,-0x1)),_0x1ab854[_0x4b847d]=_0x15d32b;}}return _0x1ab854;}export function readUserConfig(){const _0x4628ba=a45_0x4065,_0x36a4de=getConfigFile();if(!existsSync(_0x36a4de))return{};try{const _0x47e870=readFileSync(_0x36a4de,_0x4628ba(0x1fb));return parseEnvFile(_0x47e870);}catch(_0x1a3dfb){return console[_0x4628ba(0x1c3)](_0x4628ba(0x1ea)+_0x36a4de+':',_0x1a3dfb),{};}}export function resolveSite(_0x501b07){const _0x235a1e=a45_0x4065,_0x445f0a=['us01',_0x235a1e(0x1f9),_0x235a1e(0x1ff),_0x235a1e(0x209),_0x235a1e(0x1f2),_0x235a1e(0x1c9),_0x235a1e(0x1cf),_0x235a1e(0x1e8),_0x235a1e(0x206),'stg-ap03'];if(_0x445f0a[_0x235a1e(0x201)](_0x501b07))return _0x501b07;if(_0x501b07 in SITE_ALIASES)return SITE_ALIASES[_0x501b07];return console['warn']('Warning:\x20Unknown\x20site\x20\x27'+_0x501b07+'\x27,\x20defaulting\x20to\x20us01'),_0x235a1e(0x1f4);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x49653c,_0x2d6737){const _0x1fcfa9=a45_0x4065,_0x3d7046=_0x2d6737||getActiveProfileName();if(_0x3d7046){const _0x36afe5=_0x1fcfa9(0x208)+normalizeProfileForEnvVar(_0x3d7046);if(process[_0x1fcfa9(0x1d2)][_0x36afe5])return process[_0x1fcfa9(0x1d2)][_0x36afe5];}if(process['env']['TDX_API_KEY'])return process['env'][_0x1fcfa9(0x200)];if(process[_0x1fcfa9(0x1d2)][_0x1fcfa9(0x1f7)])return process[_0x1fcfa9(0x1d2)][_0x1fcfa9(0x1f7)];const _0x454f1b=_0x49653c[_0x1fcfa9(0x1ca)]()[_0x1fcfa9(0x20f)](/-/g,'_'),_0x36a47b=_0x1fcfa9(0x20a)+_0x454f1b;if(_0x3d7046){const _0x5e9752=loadProfileEnv(_0x3d7046);if(_0x5e9752){if(_0x5e9752[_0x36a47b])return _0x5e9752[_0x36a47b];if(_0x5e9752[_0x1fcfa9(0x1f7)])return _0x5e9752[_0x1fcfa9(0x1f7)];}}const _0x3e6f09=loadUserConfigOnce();if(_0x3e6f09[_0x36a47b])return _0x3e6f09[_0x36a47b];if(_0x3e6f09[_0x1fcfa9(0x1f7)])return _0x3e6f09[_0x1fcfa9(0x1f7)];return undefined;}export function normalizeProfileForEnvVar(_0x456f3){const _0x46d8dc=a45_0x4065;return _0x456f3['toUpperCase']()[_0x46d8dc(0x20f)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x2904a0,_0x4cd781){const _0xc66ca0=a45_0x4065,_0x389710=_0x4cd781||getActiveProfileName()||undefined;if(_0x389710){const _0x84d73=_0xc66ca0(0x208)+normalizeProfileForEnvVar(_0x389710);if(process['env'][_0x84d73])return{'apiKey':process[_0xc66ca0(0x1d2)][_0x84d73],'source':_0x84d73+'\x20env\x20var','isDeprecated':![]};const _0x278015=getCachedCredential(_0x2904a0,_0x389710);if(_0x278015)return{'apiKey':_0x278015,'source':_0xc66ca0(0x1d3)+_0x389710+')','isDeprecated':![]};const _0x357b02=await getKeychainAPIKey(_0x389710);if(_0x357b02)return setCachedCredential(_0x357b02,_0x2904a0,_0x389710),{'apiKey':_0x357b02,'source':_0xc66ca0(0x1d3)+_0x389710+')','isDeprecated':![]};}if(process[_0xc66ca0(0x1d2)][_0xc66ca0(0x200)])return{'apiKey':process[_0xc66ca0(0x1d2)][_0xc66ca0(0x200)],'source':_0xc66ca0(0x1d0),'isDeprecated':![]};if(!_0x389710){const _0x3054a3=getCachedCredential(_0x2904a0,undefined);if(_0x3054a3)return{'apiKey':_0x3054a3,'source':_0xc66ca0(0x1f3),'isDeprecated':![]};const _0x1b6b64=await getKeychainAPIKey(undefined);if(_0x1b6b64)return setCachedCredential(_0x1b6b64,_0x2904a0,undefined),{'apiKey':_0x1b6b64,'source':_0xc66ca0(0x1f3),'isDeprecated':![]};}if(process[_0xc66ca0(0x1d2)][_0xc66ca0(0x1f7)])return{'apiKey':process['env'][_0xc66ca0(0x1f7)],'source':_0xc66ca0(0x1fd),'isDeprecated':!![]};const _0x2fc6bb=getLegacyEnvAPIKey(_0x2904a0,_0x389710);if(_0x2fc6bb){const _0x5622fd=await isKeychainAvailable();if(_0x5622fd)try{await saveKeychainAPIKey(_0x2fc6bb,_0x389710),setCachedCredential(_0x2fc6bb,_0x2904a0,_0x389710);const _0x19437f=getConfigFilePath(_0x389710);cleanupLegacyEnvFile(_0x19437f)&&console[_0xc66ca0(0x1c3)](a45_0x2e3f95['yellow'](_0xc66ca0(0x20b)));}catch(_0x5107bf){console['warn'](a45_0x2e3f95['yellow'](_0xc66ca0(0x1eb)+_0x5107bf));}const _0x20c3f1=_0x389710?'legacy\x20.env\x20file\x20(profile:\x20'+_0x389710+')':_0xc66ca0(0x202);return{'apiKey':_0x2fc6bb,'source':_0x20c3f1,'isDeprecated':!![]};}return null;}function a45_0x8e54(){const _0x4aebd1=['⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','27240QBDpch','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','Warning:\x20Failed\x20to\x20read\x20','replace','parse','warn','number','isDeprecated','split','slice','name','dev-us01','toUpperCase','18612TuoGNB','yellow','llm_default_project','tdx','dev-eu01','TDX_API_KEY\x20env\x20var','5850152TPdTca','env','keychain\x20(profile:\x20','12SjHukF','profile','.env.','15DDbqCP','591ZvdiBK','join','52PHOILz','16452EyZEgq','existsSync','filter','Warning:\x20Failed\x20to\x20load\x20','731346eKylIQ','259rCUKSV','trim','startsWith','.env','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','match','site','apiKey','stg-us01','entries','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','toISOString','31485202mUxoJS','source','249440ctrzRR','apiKeys','endsWith','ap03','keychain','us01','account_info.','630eXPsWd','TD_API_KEY','map','jp01','.config','utf-8','TDX_CONFIG_DIR','TD_API_KEY\x20env\x20var\x20(deprecated)','stringify','eu01','TDX_API_KEY','includes','legacy\x20.env\x20file','string','13FxZNuG','.json','stg-jp01','tdx.json','TDX_API_KEY_','ap02','TD_API_KEY_'];a45_0x8e54=function(){return _0x4aebd1;};return a45_0x8e54();}export async function getAPIKeyAsync(_0x5730f9,_0x385c6f,_0x4b0343=!![]){const _0x2be38b=a45_0x4065,_0x574658=await resolveAPIKeyAsync(_0x5730f9,_0x385c6f);if(!_0x574658)return undefined;if(_0x4b0343&&_0x574658[_0x2be38b(0x1c5)]&&_0x574658[_0x2be38b(0x1ee)][_0x2be38b(0x201)](_0x2be38b(0x1f7))){const _0x22b913=_0x385c6f||getActiveProfileName()||undefined,_0x3c6add=_0x22b913?_0x2be38b(0x208)+normalizeProfileForEnvVar(_0x22b913):'TDX_API_KEY_<PROFILE>';console[_0x2be38b(0x1c3)](a45_0x2e3f95[_0x2be38b(0x1cc)](_0x2be38b(0x1e4)+(_0x2be38b(0x20d)+_0x3c6add+').')));}return _0x574658[_0x2be38b(0x1e7)];}function getLegacyEnvAPIKey(_0x118ce1,_0x3a14cd){const _0x1267ad=a45_0x4065,_0x311575=_0x118ce1[_0x1267ad(0x1ca)]()[_0x1267ad(0x20f)](/-/g,'_'),_0xcf9ed6='TD_API_KEY_'+_0x311575;if(_0x3a14cd){const _0x490c5e=loadProfileEnv(_0x3a14cd);if(_0x490c5e){if(_0x490c5e[_0xcf9ed6])return _0x490c5e[_0xcf9ed6];if(_0x490c5e[_0x1267ad(0x1f7)])return _0x490c5e['TD_API_KEY'];}}const _0x136500=loadUserConfigOnce();if(_0x136500[_0xcf9ed6])return _0x136500[_0xcf9ed6];if(_0x136500[_0x1267ad(0x1f7)])return _0x136500['TD_API_KEY'];return undefined;}function cleanupLegacyEnvFile(_0x3b9c78){const _0x5efa20=a45_0x4065;if(!existsSync(_0x3b9c78))return![];try{const _0x2ee806=readFileSync(_0x3b9c78,'utf-8'),_0x552286=_0x2ee806[_0x5efa20(0x1c6)]('\x0a'),_0x3f4328=_0x552286[_0x5efa20(0x1dd)](_0x4c8b7f=>{const _0x574696=_0x5efa20,_0xb50c1d=_0x4c8b7f[_0x574696(0x1e1)]();if(!_0xb50c1d||_0xb50c1d[_0x574696(0x1e2)]('#'))return!![];const [_0x1b48ca]=_0xb50c1d[_0x574696(0x1c6)]('=');return!_0x1b48ca['startsWith'](_0x574696(0x1f7));}),_0x19c6ef=_0x3f4328['some'](_0x46de0d=>{const _0x4ad66a=_0x5efa20,_0x5afd20=_0x46de0d[_0x4ad66a(0x1e1)]();return _0x5afd20&&!_0x5afd20[_0x4ad66a(0x1e2)]('#');});if(!_0x19c6ef)return unlinkSync(_0x3b9c78),!![];return writeFileSync(_0x3b9c78,_0x3f4328[_0x5efa20(0x1d9)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x59c756){const _0x4be1cd=a45_0x4065,_0x4355b1=a45_0x127b04[_0x4be1cd(0x1d9)](getConfigDir(),'.env.'+_0x59c756);if(a45_0x109a07[_0x4be1cd(0x1dc)](_0x4355b1)){validateSecureFilePermissions(_0x4355b1);try{const _0x186c88=a45_0x109a07['readFileSync'](_0x4355b1,_0x4be1cd(0x1fb));return parseEnvFile(_0x186c88);}catch(_0x30cb22){console['warn']('Warning:\x20Failed\x20to\x20load\x20'+_0x4355b1+':\x20'+_0x30cb22);}}const _0x244333=a45_0x127b04[_0x4be1cd(0x1d9)](getConfigDir(),'profiles',_0x59c756,_0x4be1cd(0x1e3));if(a45_0x109a07[_0x4be1cd(0x1dc)](_0x244333)){validateSecureFilePermissions(_0x244333);try{const _0x23bbfc=a45_0x109a07['readFileSync'](_0x244333,_0x4be1cd(0x1fb));return parseEnvFile(_0x23bbfc);}catch(_0x2cc1e4){return console['warn'](_0x4be1cd(0x1de)+_0x244333+':\x20'+_0x2cc1e4),null;}}return null;}function getActiveProfileName(){const _0x15cbe3=a45_0x4065,_0x2b96fb=a45_0x127b04[_0x15cbe3(0x1d9)](getConfigDir(),_0x15cbe3(0x207));if(!a45_0x109a07[_0x15cbe3(0x1dc)](_0x2b96fb))return null;try{const _0x550f86=a45_0x109a07['readFileSync'](_0x2b96fb,_0x15cbe3(0x1fb)),_0x70e5ac=JSON[_0x15cbe3(0x210)](_0x550f86);return _0x70e5ac[_0x15cbe3(0x1d5)]||null;}catch{return null;}}function a45_0x4065(_0x223cbe,_0x533849){_0x223cbe=_0x223cbe-0x1c3;const _0x8e547=a45_0x8e54();let _0x406589=_0x8e547[_0x223cbe];return _0x406589;}export function saveAPIKey(_0x4f3609,_0x1b0473,_0x462d3a){const _0x3b4972=a45_0x4065,_0x1f7083=getConfigDir(),_0x5f480e=getConfigFilePath(_0x462d3a);!existsSync(_0x1f7083)&&mkdirSync(_0x1f7083,{'recursive':!![],'mode':0x1c0});let _0x5a455f={};if(existsSync(_0x5f480e))try{const _0x81c501=readFileSync(_0x5f480e,'utf-8');_0x5a455f=parseEnvFile(_0x81c501);}catch(_0x429e62){console[_0x3b4972(0x1c3)](_0x3b4972(0x20e)+_0x5f480e+':',_0x429e62);}const _0x48b38c=_0x4f3609[_0x3b4972(0x1ca)]()[_0x3b4972(0x20f)](/-/g,'_');_0x5a455f[_0x3b4972(0x20a)+_0x48b38c]=_0x1b0473;const _0x6da4d1=Object[_0x3b4972(0x1e9)](_0x5a455f)[_0x3b4972(0x1f8)](([_0x398e82,_0x451c91])=>_0x398e82+'='+_0x451c91);writeFileSync(_0x5f480e,_0x6da4d1[_0x3b4972(0x1d9)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x59a026,_0x294493,_0x5bf292){const _0xc7ad3=a45_0x4065;await saveKeychainAPIKey(_0x59a026,_0x5bf292),setCachedCredential(_0x59a026,_0x294493,_0x5bf292);const _0xcc7d4d=getConfigFilePath(_0x5bf292);cleanupLegacyEnvFile(_0xcc7d4d)&&console['warn'](a45_0x2e3f95[_0xc7ad3(0x1cc)]('⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file'));}export function loadConfig(){const _0x1dfceb=a45_0x4065,_0x17cf43={'apiKeys':{},'defaultSite':'us01'},_0x1e039d=[_0x1dfceb(0x1f4),_0x1dfceb(0x1f9),_0x1dfceb(0x1ff),_0x1dfceb(0x209),_0x1dfceb(0x1f2),_0x1dfceb(0x1c9),'dev-eu01',_0x1dfceb(0x1e8),_0x1dfceb(0x206),'stg-ap03'];for(const _0x4cb5e4 of _0x1e039d){const _0x390c13=getAPIKey(_0x4cb5e4);_0x390c13&&(_0x17cf43[_0x1dfceb(0x1f0)][_0x4cb5e4]=_0x390c13);}return _0x17cf43;}
@@ -1 +1 @@
1
- (function(_0x2b5724,_0x4dcd2e){const _0x3485aa=a46_0x2a22,_0x2aebb6=_0x2b5724();while(!![]){try{const _0x55db0e=parseInt(_0x3485aa(0x106))/0x1+-parseInt(_0x3485aa(0x108))/0x2*(parseInt(_0x3485aa(0x10f))/0x3)+parseInt(_0x3485aa(0x104))/0x4+parseInt(_0x3485aa(0x105))/0x5*(-parseInt(_0x3485aa(0x103))/0x6)+-parseInt(_0x3485aa(0x10d))/0x7+-parseInt(_0x3485aa(0x109))/0x8*(-parseInt(_0x3485aa(0x110))/0x9)+parseInt(_0x3485aa(0x111))/0xa;if(_0x55db0e===_0x4dcd2e)break;else _0x2aebb6['push'](_0x2aebb6['shift']());}catch(_0x5908b5){_0x2aebb6['push'](_0x2aebb6['shift']());}}}(a46_0x2096,0x61d80));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';function a46_0x2a22(_0x997dc5,_0x33bdbc){_0x997dc5=_0x997dc5-0x102;const _0x20964b=a46_0x2096();let _0x2a228b=_0x20964b[_0x997dc5];return _0x2a228b;}import{getCacheDir}from'./config.js';function getCacheFilePath(_0x1711e0){const _0x4bf031=a46_0x2a22,_0x33f850=_0x1711e0||_0x4bf031(0x10a);return join(getCacheDir(),_0x4bf031(0x10b)+_0x33f850+_0x4bf031(0x102));}export function loadCachedConnections(_0x527e58){const _0x316ff3=a46_0x2a22,_0x3e4a64=getCacheFilePath(_0x527e58);if(!existsSync(_0x3e4a64))return null;try{const _0x506fb6=readFileSync(_0x3e4a64,'utf-8'),_0x55d785=JSON[_0x316ff3(0x10c)](_0x506fb6);return _0x55d785['connections'];}catch{return null;}}function a46_0x2096(){const _0x135612=['stringify','453381eAQKHJ','4629771abUoCz','10578190EQsuge','.json','29598JXuRYi','828840SjAHsl','485NIwZBB','34218jOfqkb','now','2ZqIYoH','8BTWDSG','default','connections-','parse','5482890GydTQw'];a46_0x2096=function(){return _0x135612;};return a46_0x2096();}export function saveCachedConnections(_0x1fe16a,_0x929cd6){const _0x3f63d2=a46_0x2a22,_0x3f816a=getCacheDir();!existsSync(_0x3f816a)&&mkdirSync(_0x3f816a,{'recursive':!![]});const _0x306c1c=getCacheFilePath(_0x1fe16a),_0x3933e2={'connections':_0x929cd6,'cachedAt':Date[_0x3f63d2(0x107)]()};writeFileSync(_0x306c1c,JSON[_0x3f63d2(0x10e)](_0x3933e2,null,0x2),'utf-8');}export function clearConnectionCache(_0x1b9200){const _0x5d732b=getCacheFilePath(_0x1b9200);if(existsSync(_0x5d732b))try{unlinkSync(_0x5d732b);}catch{}}
1
+ (function(_0xdd47dd,_0x59bb3a){const _0x390973=a46_0x2489,_0x19271c=_0xdd47dd();while(!![]){try{const _0x54847a=-parseInt(_0x390973(0x10d))/0x1*(-parseInt(_0x390973(0x103))/0x2)+-parseInt(_0x390973(0x10e))/0x3*(-parseInt(_0x390973(0x105))/0x4)+parseInt(_0x390973(0x10c))/0x5*(-parseInt(_0x390973(0x111))/0x6)+parseInt(_0x390973(0x101))/0x7*(-parseInt(_0x390973(0xff))/0x8)+-parseInt(_0x390973(0x110))/0x9*(-parseInt(_0x390973(0x109))/0xa)+-parseInt(_0x390973(0x104))/0xb*(parseInt(_0x390973(0xfe))/0xc)+-parseInt(_0x390973(0xfd))/0xd*(-parseInt(_0x390973(0x102))/0xe);if(_0x54847a===_0x59bb3a)break;else _0x19271c['push'](_0x19271c['shift']());}catch(_0x4c29ab){_0x19271c['push'](_0x19271c['shift']());}}}(a46_0x507a,0x4a0c2));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';import{getCacheDir}from'./config.js';function a46_0x507a(){const _0x5e30fc=['12jVFZux','213176MyqmpJ','connections-','119wWArkX','7629538qnPiwb','93418tpWJDb','5481509RwmJGn','172vaYVHb','now','utf-8','default','130lrhPWf','connections','.json','10dQfKlL','5WFsWFE','19161elGThr','parse','369765zzKVaX','997926uKYtvZ','13IdpmsX'];a46_0x507a=function(){return _0x5e30fc;};return a46_0x507a();}function a46_0x2489(_0x11c91f,_0x46c9fe){_0x11c91f=_0x11c91f-0xfd;const _0x507ae6=a46_0x507a();let _0x248923=_0x507ae6[_0x11c91f];return _0x248923;}function getCacheFilePath(_0x58d7e7){const _0x504c0a=a46_0x2489,_0x1267a1=_0x58d7e7||_0x504c0a(0x108);return join(getCacheDir(),_0x504c0a(0x100)+_0x1267a1+_0x504c0a(0x10b));}export function loadCachedConnections(_0x288a15){const _0x4d252a=a46_0x2489,_0x114c94=getCacheFilePath(_0x288a15);if(!existsSync(_0x114c94))return null;try{const _0x185d63=readFileSync(_0x114c94,_0x4d252a(0x107)),_0x53a4ee=JSON[_0x4d252a(0x10f)](_0x185d63);return _0x53a4ee[_0x4d252a(0x10a)];}catch{return null;}}export function saveCachedConnections(_0x52fb54,_0x56e4dc){const _0x8c3b9a=a46_0x2489,_0x46a938=getCacheDir();!existsSync(_0x46a938)&&mkdirSync(_0x46a938,{'recursive':!![]});const _0x118295=getCacheFilePath(_0x52fb54),_0x462923={'connections':_0x56e4dc,'cachedAt':Date[_0x8c3b9a(0x106)]()};writeFileSync(_0x118295,JSON['stringify'](_0x462923,null,0x2),'utf-8');}export function clearConnectionCache(_0x42e445){const _0x3c11d0=getCacheFilePath(_0x42e445);if(existsSync(_0x3c11d0))try{unlinkSync(_0x3c11d0);}catch{}}
@@ -1 +1 @@
1
- (function(_0x5f3b24,_0x3b4fc9){const _0x545206=a47_0x5bc5,_0x51a6ca=_0x5f3b24();while(!![]){try{const _0x25b1f1=parseInt(_0x545206(0x11f))/0x1*(-parseInt(_0x545206(0x11b))/0x2)+-parseInt(_0x545206(0x11e))/0x3+-parseInt(_0x545206(0x124))/0x4*(-parseInt(_0x545206(0x12b))/0x5)+-parseInt(_0x545206(0x128))/0x6+parseInt(_0x545206(0x11c))/0x7+parseInt(_0x545206(0x127))/0x8*(parseInt(_0x545206(0x129))/0x9)+-parseInt(_0x545206(0x125))/0xa;if(_0x25b1f1===_0x3b4fc9)break;else _0x51a6ca['push'](_0x51a6ca['shift']());}catch(_0x35fbd0){_0x51a6ca['push'](_0x51a6ca['shift']());}}}(a47_0x3d2a,0x426eb));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function a47_0x3d2a(){const _0x5336d9=['1OStKDf','apiKey','__default_profile__','delete','get','1076LsYqsg','186220uXCMzF','set','8YwxOpS','1402050AfyfrI','4287663QyTYRn','clear','4685iDtPAV','loadedAt','91764tjzKoe','967337PRHCCX','__default_site__','889095mtJQra'];a47_0x3d2a=function(){return _0x5336d9;};return a47_0x3d2a();}function getCacheKey(_0x31d007,_0x16f62b){const _0x48228d=a47_0x5bc5,_0x1dda5c=_0x31d007||_0x48228d(0x11d),_0x5d8e50=_0x16f62b||_0x48228d(0x121);return _0x1dda5c+':'+_0x5d8e50;}function a47_0x5bc5(_0x3b545c,_0x11ae30){_0x3b545c=_0x3b545c-0x11a;const _0x3d2a3a=a47_0x3d2a();let _0x5bc5e2=_0x3d2a3a[_0x3b545c];return _0x5bc5e2;}export function getCachedCredential(_0x38ca28,_0x15cfcb){const _0x462de4=a47_0x5bc5,_0x59d005=getCacheKey(_0x38ca28,_0x15cfcb),_0x2a9ebd=cache[_0x462de4(0x123)](_0x59d005);if(!_0x2a9ebd)return null;if(Date['now']()-_0x2a9ebd[_0x462de4(0x11a)]>CACHE_TTL_MS)return cache[_0x462de4(0x122)](_0x59d005),null;return _0x2a9ebd[_0x462de4(0x120)];}export function setCachedCredential(_0x104b0c,_0x313308,_0x5f5ad1){const _0x39fcfe=a47_0x5bc5,_0x36ffeb=getCacheKey(_0x313308,_0x5f5ad1);cache[_0x39fcfe(0x126)](_0x36ffeb,{'apiKey':_0x104b0c,'loadedAt':Date['now']()});}export function clearCredentialCache(){const _0x791be6=a47_0x5bc5;cache[_0x791be6(0x12a)]();}export function clearCachedCredential(_0x4233be,_0x4de235){const _0x54f7ba=a47_0x5bc5,_0x197daa=getCacheKey(_0x4233be,_0x4de235);cache[_0x54f7ba(0x122)](_0x197daa);}
1
+ (function(_0x58d48a,_0xdf5120){const _0xa4d767=a47_0x5793,_0x212eb3=_0x58d48a();while(!![]){try{const _0x34dd0c=-parseInt(_0xa4d767(0x141))/0x1*(parseInt(_0xa4d767(0x13d))/0x2)+parseInt(_0xa4d767(0x13e))/0x3+-parseInt(_0xa4d767(0x138))/0x4*(parseInt(_0xa4d767(0x135))/0x5)+parseInt(_0xa4d767(0x132))/0x6*(-parseInt(_0xa4d767(0x144))/0x7)+parseInt(_0xa4d767(0x13f))/0x8+parseInt(_0xa4d767(0x137))/0x9+parseInt(_0xa4d767(0x143))/0xa*(parseInt(_0xa4d767(0x13b))/0xb);if(_0x34dd0c===_0xdf5120)break;else _0x212eb3['push'](_0x212eb3['shift']());}catch(_0x167e59){_0x212eb3['push'](_0x212eb3['shift']());}}}(a47_0x2a7d,0xdcd61));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x3c38ca,_0x585796){const _0x2aa1da=a47_0x5793,_0xabbe6=_0x3c38ca||_0x2aa1da(0x139),_0x174446=_0x585796||_0x2aa1da(0x131);return _0xabbe6+':'+_0x174446;}function a47_0x2a7d(){const _0x41aaee=['delete','256986myTzuU','set','10nEIanA','160195ecyxpD','__default_profile__','204tFWGyk','apiKey','now','165XiEHuL','clear','16068276mQhAQT','118212tOWEQD','__default_site__','get','671473rmCoSS','loadedAt','10gRVTVa','2867628BSBRmX','9124248suRasR'];a47_0x2a7d=function(){return _0x41aaee;};return a47_0x2a7d();}function a47_0x5793(_0x233024,_0x2f5ee2){_0x233024=_0x233024-0x131;const _0x2a7db0=a47_0x2a7d();let _0x57936f=_0x2a7db0[_0x233024];return _0x57936f;}export function getCachedCredential(_0x2ef48d,_0x4d8ea8){const _0x2d15df=a47_0x5793,_0xeb61e2=getCacheKey(_0x2ef48d,_0x4d8ea8),_0x1546e6=cache[_0x2d15df(0x13a)](_0xeb61e2);if(!_0x1546e6)return null;if(Date['now']()-_0x1546e6[_0x2d15df(0x13c)]>CACHE_TTL_MS)return cache[_0x2d15df(0x140)](_0xeb61e2),null;return _0x1546e6[_0x2d15df(0x133)];}export function setCachedCredential(_0x4a429e,_0x36f435,_0x30fe69){const _0x4c7fc6=a47_0x5793,_0x5ffa17=getCacheKey(_0x36f435,_0x30fe69);cache[_0x4c7fc6(0x142)](_0x5ffa17,{'apiKey':_0x4a429e,'loadedAt':Date[_0x4c7fc6(0x134)]()});}export function clearCredentialCache(){const _0x4c0128=a47_0x5793;cache[_0x4c0128(0x136)]();}export function clearCachedCredential(_0xa35f71,_0xccf6c){const _0x4798d8=a47_0x5793,_0x5bd2b5=getCacheKey(_0xa35f71,_0xccf6c);cache[_0x4798d8(0x140)](_0x5bd2b5);}