@treasuredata/tdx 0.8.1 → 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/client/cdp-api-client.js +1 -1
  8. package/dist/client/engage-api-client.js +1 -1
  9. package/dist/client/http-client.js +1 -1
  10. package/dist/client/llm-api-client.js +1 -1
  11. package/dist/client/rate-limiter.js +1 -1
  12. package/dist/client/td-api-client.js +1 -1
  13. package/dist/client/trino-api-client.js +1 -1
  14. package/dist/client/workflow-client.js +1 -1
  15. package/dist/commands/activations.js +1 -1
  16. package/dist/commands/api-command.js +1 -1
  17. package/dist/commands/auth-command.js +1 -1
  18. package/dist/commands/chat-command.js +1 -1
  19. package/dist/commands/claude-command.d.ts.map +1 -1
  20. package/dist/commands/claude-command.js +1 -1
  21. package/dist/commands/claude-command.js.map +1 -1
  22. package/dist/commands/claude-statusline-command.js +1 -1
  23. package/dist/commands/claude-usage-command.js +1 -1
  24. package/dist/commands/command.js +1 -1
  25. package/dist/commands/connection-command.js +1 -1
  26. package/dist/commands/context-command.js +1 -1
  27. package/dist/commands/databases.js +1 -1
  28. package/dist/commands/describe.js +1 -1
  29. package/dist/commands/engage-command.js +1 -1
  30. package/dist/commands/job-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.js +1 -1
  41. package/dist/commands/segment-update-command.js +1 -1
  42. package/dist/commands/segment-use-command.js +1 -1
  43. package/dist/commands/segments.js +1 -1
  44. package/dist/commands/show.js +1 -1
  45. package/dist/commands/tables.js +1 -1
  46. package/dist/commands/use-command.js +1 -1
  47. package/dist/commands/user-command.js +1 -1
  48. package/dist/commands/workflow-command.js +1 -1
  49. package/dist/core/auth.js +1 -1
  50. package/dist/core/config.js +1 -1
  51. package/dist/core/connection-cache.js +1 -1
  52. package/dist/core/credential-cache.js +1 -1
  53. package/dist/core/global-context.js +1 -1
  54. package/dist/core/keychain.js +1 -1
  55. package/dist/core/profile.js +1 -1
  56. package/dist/core/project-config.js +1 -1
  57. package/dist/core/session.js +1 -1
  58. package/dist/core/user-cache.js +1 -1
  59. package/dist/index.js +1 -1
  60. package/dist/proxy/anthropic-adapter.d.ts +11 -19
  61. package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
  62. package/dist/proxy/anthropic-adapter.js +1 -1
  63. package/dist/proxy/anthropic-adapter.js.map +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/context-signature.js +1 -1
  66. package/dist/proxy/conversation-utils.js +1 -1
  67. package/dist/proxy/conversation-utils.js.map +1 -1
  68. package/dist/proxy/server.d.ts.map +1 -1
  69. package/dist/proxy/server.js +1 -1
  70. package/dist/proxy/server.js.map +1 -1
  71. package/dist/proxy/session-cache.js +1 -1
  72. package/dist/sdk/api.js +1 -1
  73. package/dist/sdk/connection.js +1 -1
  74. package/dist/sdk/engage.js +1 -1
  75. package/dist/sdk/errors.js +1 -1
  76. package/dist/sdk/index.js +1 -1
  77. package/dist/sdk/job.js +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.js +1 -1
  81. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  82. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  83. package/dist/sdk/segment.js +1 -1
  84. package/dist/sdk/user.js +1 -1
  85. package/dist/sdk/workflow.js +1 -1
  86. package/dist/types/endpoints.js +1 -1
  87. package/dist/types/index.js +1 -1
  88. package/dist/utils/agent-ref-parser.js +1 -1
  89. package/dist/utils/async.js +1 -1
  90. package/dist/utils/chat-cache.js +1 -1
  91. package/dist/utils/colors.js +1 -1
  92. package/dist/utils/command-output.js +1 -1
  93. package/dist/utils/constants.js +1 -1
  94. package/dist/utils/diff.js +1 -1
  95. package/dist/utils/fields-display.js +1 -1
  96. package/dist/utils/file-permissions.js +1 -1
  97. package/dist/utils/format-detector.js +1 -1
  98. package/dist/utils/formatters.js +1 -1
  99. package/dist/utils/json-loader.js +1 -1
  100. package/dist/utils/llm-backup-utils.js +1 -1
  101. package/dist/utils/model-aliases.js +1 -1
  102. package/dist/utils/model-factors.js +1 -1
  103. package/dist/utils/option-validation.js +1 -1
  104. package/dist/utils/port.js +1 -1
  105. package/dist/utils/process.js +1 -1
  106. package/dist/utils/prompt.js +1 -1
  107. package/dist/utils/segment-path-parser.js +1 -1
  108. package/dist/utils/segment-ref-parser.js +1 -1
  109. package/dist/utils/spinner.js +1 -1
  110. package/dist/utils/sql-parser.js +1 -1
  111. package/dist/utils/sse-parser.js +1 -1
  112. package/dist/utils/string-utils.js +1 -1
  113. package/dist/utils/table-ref-parser.js +1 -1
  114. package/dist/utils/tdx-config.js +1 -1
  115. package/dist/utils/tdx-logger.js +1 -1
  116. package/dist/utils/tree-formatter.js +1 -1
  117. package/dist/utils/version-check.js +1 -1
  118. package/dist/utils/workflow-utils.js +1 -1
  119. package/package.json +1 -1
@@ -1 +1 @@
1
- function a36_0x4a31(_0x5e8aee,_0x521124){_0x5e8aee=_0x5e8aee-0x1ef;const _0x2f76e0=a36_0x2f76();let _0x4a31ba=_0x2f76e0[_0x5e8aee];return _0x4a31ba;}const a36_0x3d6d08=a36_0x4a31;(function(_0x54c53a,_0x1febf6){const _0x1ffe68=a36_0x4a31,_0x1051c8=_0x54c53a();while(!![]){try{const _0x36684e=-parseInt(_0x1ffe68(0x205))/0x1*(-parseInt(_0x1ffe68(0x214))/0x2)+parseInt(_0x1ffe68(0x209))/0x3*(-parseInt(_0x1ffe68(0x1fc))/0x4)+-parseInt(_0x1ffe68(0x1f4))/0x5+parseInt(_0x1ffe68(0x206))/0x6*(-parseInt(_0x1ffe68(0x1fb))/0x7)+parseInt(_0x1ffe68(0x1ff))/0x8*(-parseInt(_0x1ffe68(0x21e))/0x9)+parseInt(_0x1ffe68(0x1f6))/0xa*(-parseInt(_0x1ffe68(0x21a))/0xb)+parseInt(_0x1ffe68(0x204))/0xc;if(_0x36684e===_0x1febf6)break;else _0x1051c8['push'](_0x1051c8['shift']());}catch(_0x52439e){_0x1051c8['push'](_0x1051c8['shift']());}}}(a36_0x2f76,0x4a03f));import{existsSync,statSync}from'fs';import a36_0x2c3f7d from'chalk';import{BaseCommand}from'./command.js';function a36_0x2f76(){const _0xb5a3e2=['Set\x20current\x20segment/folder\x20context\x20for\x20navigation','red','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Resolved\x20relative\x20path\x20to:\x20','Parent\x20ID:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','parentId','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','fullPath','288loZmWa','Resolved\x20path\x20type:\x20','segments','Error:\x20Path\x20is\x20required\x0a','type','Site:\x20','4004JzUVAu','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','folderPath','parent_segment','9lLuMBv','length','segmentPath','cyan','join','Folder\x20ID:\x20','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','name','data','execute','error','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','✔\x20Context\x20set\x20to:\x20','slice','description','Target\x20path:\x20','Use:\x20tdx\x20segment\x20use\x20','1375560PzvqcO','verbose','9460iDRlZa','folderId','site','parentName','resolvePathToResource','7042HAxAaQ','188EVARMs','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Resolving\x20path\x20\x27','1850216EQpPbz','\x27...','segment','dim','green','16571256XZeFwb','2875ktiAAM','1278cFDFUJ','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','27240JryqYL','log'];a36_0x2f76=function(){return _0xb5a3e2;};return a36_0x2f76();}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{[a36_0x3d6d08(0x225)]='segment:use';[a36_0x3d6d08(0x1f1)]=a36_0x3d6d08(0x20b);async[a36_0x3d6d08(0x227)](_0x3704f8){const _0x42cae0=a36_0x3d6d08,{options:_0x1f7ca4,args:_0x13ad55,tdx:_0x527ce8}=_0x3704f8;if(_0x13ad55[_0x42cae0(0x21f)]===0x0)return console[_0x42cae0(0x228)](a36_0x2c3f7d[_0x42cae0(0x20c)](_0x42cae0(0x217))),console[_0x42cae0(0x228)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x42cae0(0x228)]('Examples:'),console['error'](_0x42cae0(0x229)),console[_0x42cae0(0x228)](_0x42cae0(0x20d)),console[_0x42cae0(0x228)](_0x42cae0(0x208)),console[_0x42cae0(0x228)]('\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 _0x3f9fbe=_0x13ad55[0x0],_0x4e0a33=_0x1f7ca4['session'];try{if(_0x3f9fbe==='/')return saveSessionContext({'segment_path':undefined},_0x4e0a33),console[_0x42cae0(0x20a)](a36_0x2c3f7d[_0x42cae0(0x203)](_0x42cae0(0x224))),0x0;if(existsSync(_0x3f9fbe)&&statSync(_0x3f9fbe)['isDirectory']()){let _0xb2d265;try{_0xb2d265=findTdxConfig(_0x3f9fbe);}catch{return console[_0x42cae0(0x228)](a36_0x2c3f7d['red']('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x3f9fbe)),console[_0x42cae0(0x228)](a36_0x2c3f7d[_0x42cae0(0x221)](_0x42cae0(0x210))),0x1;}const _0x467817=_0xb2d265['config'][_0x42cae0(0x21d)];return saveSessionContext({'segment_path':_0x467817,'parent_segment':_0x467817},_0x4e0a33),console[_0x42cae0(0x20a)](a36_0x2c3f7d[_0x42cae0(0x203)]('✔\x20Context\x20set\x20to:\x20'+a36_0x2c3f7d[_0x42cae0(0x221)](_0x467817))),0x0;}const _0x1a16f8=_0x1f7ca4[_0x42cae0(0x220)];let _0x25e4a3=_0x3f9fbe;const _0x3b199e=parsePath(_0x3f9fbe);if(!_0x3b199e['isAbsolute']){if(!_0x1a16f8)return console['error'](a36_0x2c3f7d[_0x42cae0(0x20c)](_0x42cae0(0x22a))),console[_0x42cae0(0x228)](a36_0x2c3f7d[_0x42cae0(0x221)](_0x42cae0(0x1fd))),0x1;if(_0x3f9fbe==='..'){const _0x1efa94=_0x1a16f8['split']('/')[_0x42cae0(0x1f0)](0x0,-0x1)['join']('/');_0x25e4a3=_0x1efa94||'/';}else _0x3f9fbe==='.'?_0x25e4a3=_0x1a16f8:_0x25e4a3=_0x1a16f8+'/'+_0x3f9fbe;_0x1f7ca4[_0x42cae0(0x1f5)]&&console[_0x42cae0(0x228)](_0x42cae0(0x20e)+_0x25e4a3);}if(_0x25e4a3==='/'||_0x25e4a3==='')return saveSessionContext({'segment_path':undefined},_0x4e0a33),console[_0x42cae0(0x20a)](a36_0x2c3f7d[_0x42cae0(0x203)](_0x42cae0(0x224))),0x0;_0x25e4a3=normalizePath(_0x25e4a3);const _0x39a2c5=parsePath(_0x25e4a3)[_0x42cae0(0x216)];if(_0x39a2c5[_0x42cae0(0x21f)]===0x0)return saveSessionContext({'segment_path':undefined},_0x4e0a33),console[_0x42cae0(0x20a)](a36_0x2c3f7d[_0x42cae0(0x203)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x1f7ca4[_0x42cae0(0x1f5)]&&(console[_0x42cae0(0x228)](_0x42cae0(0x219)+_0x1f7ca4[_0x42cae0(0x1f8)]),console[_0x42cae0(0x228)](_0x42cae0(0x1f2)+_0x25e4a3));const _0xeb7a0b=await withSpinner(_0x42cae0(0x1fe)+_0x25e4a3+_0x42cae0(0x200),()=>_0x527ce8[_0x42cae0(0x201)][_0x42cae0(0x1fa)](_0x25e4a3),{'verbose':_0x1f7ca4[_0x42cae0(0x1f5)]}),_0x391784=_0xeb7a0b[_0x42cae0(0x226)];_0x1f7ca4[_0x42cae0(0x1f5)]&&(console[_0x42cae0(0x228)](_0x42cae0(0x215)+_0x391784[_0x42cae0(0x218)]),console[_0x42cae0(0x228)](_0x42cae0(0x20f)+_0x391784[_0x42cae0(0x211)]),_0x391784['folderId']&&console['error'](_0x42cae0(0x223)+_0x391784[_0x42cae0(0x1f7)]));if(_0x391784[_0x42cae0(0x218)]===_0x42cae0(0x201))return console[_0x42cae0(0x228)](a36_0x2c3f7d[_0x42cae0(0x20c)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x42cae0(0x228)](_0x42cae0(0x207)),console['error'](a36_0x2c3f7d[_0x42cae0(0x221)](_0x42cae0(0x1f3)+_0x391784[_0x42cae0(0x1f9)]+(_0x391784[_0x42cae0(0x21c)]?'/'+_0x391784[_0x42cae0(0x21c)][_0x42cae0(0x222)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x391784[_0x42cae0(0x213)],'parent_segment':_0x391784[_0x42cae0(0x1f9)]},_0x4e0a33),console['log'](a36_0x2c3f7d['green'](_0x42cae0(0x1ef)+a36_0x2c3f7d[_0x42cae0(0x221)](_0x391784[_0x42cae0(0x213)]))),_0x1f7ca4[_0x42cae0(0x1f5)]&&(console[_0x42cae0(0x228)](a36_0x2c3f7d[_0x42cae0(0x202)](_0x42cae0(0x212))),console[_0x42cae0(0x228)](a36_0x2c3f7d[_0x42cae0(0x202)](_0x42cae0(0x21b)))),0x0;}catch(_0x683eb3){throw _0x683eb3;}}}
1
+ const a36_0x5b7f9f=a36_0x251e;(function(_0x228886,_0x42f8a4){const _0x561087=a36_0x251e,_0x35ce1c=_0x228886();while(!![]){try{const _0x4bbe39=-parseInt(_0x561087(0x1f8))/0x1+-parseInt(_0x561087(0x20b))/0x2*(-parseInt(_0x561087(0x1ea))/0x3)+-parseInt(_0x561087(0x21d))/0x4+parseInt(_0x561087(0x203))/0x5+parseInt(_0x561087(0x20e))/0x6*(parseInt(_0x561087(0x201))/0x7)+-parseInt(_0x561087(0x21b))/0x8+parseInt(_0x561087(0x20a))/0x9;if(_0x4bbe39===_0x42f8a4)break;else _0x35ce1c['push'](_0x35ce1c['shift']());}catch(_0xf72b3a){_0x35ce1c['push'](_0x35ce1c['shift']());}}}(a36_0x322e,0x1d2a5));import{existsSync,statSync}from'fs';function a36_0x322e(){const _0x206729=['18273idTmnW','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','error','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','Parent\x20ID:\x20','isDirectory','green','length','red','376089jGpOdW','Resolving\x20path\x20\x27','558970KvlCWe','\x27...','data','folderId','log','✔\x20Context\x20set\x20to:\x20','isAbsolute','227907awmmBQ','457706laXmGa','session','Resolved\x20relative\x20path\x20to:\x20','12EqzAVl','Examples:','Use:\x20tdx\x20segment\x20use\x20','site','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','folderPath','segment:use','Folder\x20ID:\x20','parentName','split','config','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','segment','1316440TLsTLW','dim','684540mwgUFF','fullPath','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','type','Target\x20path:\x20','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','3katwzr','Site:\x20','slice','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','join','cyan','verbose','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','parentId','Usage:\x20tdx\x20segment\x20use\x20<path>','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','execute','Resolved\x20path\x20type:\x20'];a36_0x322e=function(){return _0x206729;};return a36_0x322e();}import a36_0x1d002c 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';function a36_0x251e(_0x2d385c,_0x8d2b01){_0x2d385c=_0x2d385c-0x1e9;const _0x322ee3=a36_0x322e();let _0x251ebf=_0x322ee3[_0x2d385c];return _0x251ebf;}export class SegmentUseCommand extends BaseCommand{['name']=a36_0x5b7f9f(0x214);['description']=a36_0x5b7f9f(0x212);async[a36_0x5b7f9f(0x1f6)](_0x2b4e43){const _0x20fab5=a36_0x5b7f9f,{options:_0x4846e4,args:_0x202d25,tdx:_0x45c4f5}=_0x2b4e43;if(_0x202d25[_0x20fab5(0x1ff)]===0x0)return console['error'](a36_0x1d002c[_0x20fab5(0x200)]('Error:\x20Path\x20is\x20required\x0a')),console['error'](_0x20fab5(0x1f3)),console['error'](_0x20fab5(0x20f)),console[_0x20fab5(0x1fa)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x20fab5(0x1fa)](_0x20fab5(0x1ed)),console['error'](_0x20fab5(0x21f)),console[_0x20fab5(0x1fa)](_0x20fab5(0x1f1)),0x1;const _0x454480=_0x202d25[0x0],_0x120ede=_0x4846e4[_0x20fab5(0x20c)];try{if(_0x454480==='/')return saveSessionContext({'segment_path':undefined},_0x120ede),console['log'](a36_0x1d002c[_0x20fab5(0x1fe)](_0x20fab5(0x1f5))),0x0;if(existsSync(_0x454480)&&statSync(_0x454480)[_0x20fab5(0x1fd)]()){let _0x672d87;try{_0x672d87=findTdxConfig(_0x454480);}catch{return console[_0x20fab5(0x1fa)](a36_0x1d002c[_0x20fab5(0x200)](_0x20fab5(0x1f4)+_0x454480)),console['error'](a36_0x1d002c[_0x20fab5(0x1ef)](_0x20fab5(0x1f9))),0x1;}const _0x13ce47=_0x672d87[_0x20fab5(0x218)]['parent_segment'];return saveSessionContext({'segment_path':_0x13ce47,'parent_segment':_0x13ce47},_0x120ede),console[_0x20fab5(0x207)](a36_0x1d002c[_0x20fab5(0x1fe)](_0x20fab5(0x208)+a36_0x1d002c[_0x20fab5(0x1ef)](_0x13ce47))),0x0;}const _0x1520e9=_0x4846e4['segmentPath'];let _0x49fa3a=_0x454480;const _0x175249=parsePath(_0x454480);if(!_0x175249[_0x20fab5(0x209)]){if(!_0x1520e9)return console[_0x20fab5(0x1fa)](a36_0x1d002c[_0x20fab5(0x200)](_0x20fab5(0x1fb))),console[_0x20fab5(0x1fa)](a36_0x1d002c['cyan'](_0x20fab5(0x1e9))),0x1;if(_0x454480==='..'){const _0x12ca7c=_0x1520e9[_0x20fab5(0x217)]('/')[_0x20fab5(0x1ec)](0x0,-0x1)[_0x20fab5(0x1ee)]('/');_0x49fa3a=_0x12ca7c||'/';}else _0x454480==='.'?_0x49fa3a=_0x1520e9:_0x49fa3a=_0x1520e9+'/'+_0x454480;_0x4846e4[_0x20fab5(0x1f0)]&&console[_0x20fab5(0x1fa)](_0x20fab5(0x20d)+_0x49fa3a);}if(_0x49fa3a==='/'||_0x49fa3a==='')return saveSessionContext({'segment_path':undefined},_0x120ede),console['log'](a36_0x1d002c[_0x20fab5(0x1fe)](_0x20fab5(0x1f5))),0x0;_0x49fa3a=normalizePath(_0x49fa3a);const _0x4c4657=parsePath(_0x49fa3a)['segments'];if(_0x4c4657[_0x20fab5(0x1ff)]===0x0)return saveSessionContext({'segment_path':undefined},_0x120ede),console[_0x20fab5(0x207)](a36_0x1d002c[_0x20fab5(0x1fe)](_0x20fab5(0x1f5))),0x0;_0x4846e4[_0x20fab5(0x1f0)]&&(console[_0x20fab5(0x1fa)](_0x20fab5(0x1eb)+_0x4846e4[_0x20fab5(0x211)]),console[_0x20fab5(0x1fa)](_0x20fab5(0x221)+_0x49fa3a));const _0x3db3de=await withSpinner(_0x20fab5(0x202)+_0x49fa3a+_0x20fab5(0x204),()=>_0x45c4f5[_0x20fab5(0x21a)]['resolvePathToResource'](_0x49fa3a),{'verbose':_0x4846e4[_0x20fab5(0x1f0)]}),_0x3204bd=_0x3db3de[_0x20fab5(0x205)];_0x4846e4[_0x20fab5(0x1f0)]&&(console[_0x20fab5(0x1fa)](_0x20fab5(0x1f7)+_0x3204bd[_0x20fab5(0x220)]),console['error'](_0x20fab5(0x1fc)+_0x3204bd[_0x20fab5(0x1f2)]),_0x3204bd[_0x20fab5(0x206)]&&console[_0x20fab5(0x1fa)](_0x20fab5(0x215)+_0x3204bd['folderId']));if(_0x3204bd['type']===_0x20fab5(0x21a))return console[_0x20fab5(0x1fa)](a36_0x1d002c['red']('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console['error'](_0x20fab5(0x219)),console['error'](a36_0x1d002c['cyan'](_0x20fab5(0x210)+_0x3204bd[_0x20fab5(0x216)]+(_0x3204bd[_0x20fab5(0x213)]?'/'+_0x3204bd[_0x20fab5(0x213)][_0x20fab5(0x1ee)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x3204bd['fullPath'],'parent_segment':_0x3204bd[_0x20fab5(0x216)]},_0x120ede),console[_0x20fab5(0x207)](a36_0x1d002c['green'](_0x20fab5(0x208)+a36_0x1d002c[_0x20fab5(0x1ef)](_0x3204bd[_0x20fab5(0x21e)]))),_0x4846e4[_0x20fab5(0x1f0)]&&(console[_0x20fab5(0x1fa)](a36_0x1d002c[_0x20fab5(0x21c)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console['error'](a36_0x1d002c[_0x20fab5(0x21c)]('Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters'))),0x0;}catch(_0x2e3b77){throw _0x2e3b77;}}}
@@ -1 +1 @@
1
- function a37_0x3a17(_0x3c7bbf,_0x1ab79c){_0x3c7bbf=_0x3c7bbf-0x188;const _0x3995dd=a37_0x3995();let _0x3a1702=_0x3995dd[_0x3c7bbf];return _0x3a1702;}const a37_0x29e46f=a37_0x3a17;(function(_0x33833e,_0x159e9b){const _0x137fce=a37_0x3a17,_0x2d6542=_0x33833e();while(!![]){try{const _0x124d58=-parseInt(_0x137fce(0x18a))/0x1+parseInt(_0x137fce(0x198))/0x2*(-parseInt(_0x137fce(0x195))/0x3)+-parseInt(_0x137fce(0x1ba))/0x4+parseInt(_0x137fce(0x1a7))/0x5*(-parseInt(_0x137fce(0x199))/0x6)+-parseInt(_0x137fce(0x1b6))/0x7*(parseInt(_0x137fce(0x18c))/0x8)+parseInt(_0x137fce(0x191))/0x9+parseInt(_0x137fce(0x19a))/0xa;if(_0x124d58===_0x159e9b)break;else _0x2d6542['push'](_0x2d6542['shift']());}catch(_0x4ea24f){_0x2d6542['push'](_0x2d6542['shift']());}}}(a37_0x3995,0xb7101));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a37_0x3995(){const _0x34c58d=['resolvePathToResource','json','replace','cause','✔\x20Found\x20','segment','parentId','\x20top-level\x20items','map','Site:\x20','Folder\x20ID:\x20','(empty)','folderId','694178DeglPr','recursive','3307032ItCUve','Folder/pattern\x20arg:\x20','\x20segment','localeCompare','No\x20items\x20match\x20pattern:\x20','12378717gxMSeJ','jsonl','site','listUnified','66975vzPCOV','error','\x27...','4pPQubJ','90dSQsTy','31916670nCVugM','sort','\x20\x20Cause:\x20','Resolving\x20parent\x20segment\x20\x27','dim','Set\x20a\x20parent\x20segment\x20context\x20first:','\x20folder','\x20and\x20','log','length','Resolving\x20path\x20\x27','listRecursive','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','286095qPTOhx','segments','\x5c$&','Error:\x20No\x20parent\x20segment\x20context\x20set.','includes','(not\x20set)','filter','Parent\x20ID:\x20','verbose','name','description','format','Recursive\x20mode:\x20enabled','✔\x20Built\x20tree\x20with\x20','\x20matching\x20\x27','14eyWBFX','test','folder','message','5573536ZGtPTa','data','Listing\x20folders\x20and\x20segments...'];a37_0x3995=function(){return _0x34c58d;};return a37_0x3995();}import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import a37_0x4d2c2b from'chalk';export class SegmentsCommand extends BaseCommand{[a37_0x29e46f(0x1b0)]=a37_0x29e46f(0x1a8);[a37_0x29e46f(0x1b1)]='List\x20folders\x20and\x20child\x20segments';async['execute'](_0x32f553){const _0x5e8bf8=a37_0x29e46f,{options:_0x40ceee,args:_0xae8271}=_0x32f553,_0x122ccb=_0x40ceee[_0x5e8bf8(0x18b)],_0x508e96=_0xae8271[0x0];try{const _0x5d3c61=_0x40ceee['parentSegment'];_0x40ceee[_0x5e8bf8(0x1af)]&&(console[_0x5e8bf8(0x196)](_0x5e8bf8(0x1c6)+_0x40ceee[_0x5e8bf8(0x193)]),console[_0x5e8bf8(0x196)]('Parent\x20segment\x20context:\x20'+(_0x5d3c61||_0x5e8bf8(0x1ac))),_0x508e96&&console[_0x5e8bf8(0x196)](_0x5e8bf8(0x18d)+_0x508e96),_0x122ccb&&console[_0x5e8bf8(0x196)](_0x5e8bf8(0x1b3)));if(!_0x5d3c61)return console['error'](_0x5e8bf8(0x1aa)),console['error'](''),console[_0x5e8bf8(0x196)](_0x5e8bf8(0x19f)),console[_0x5e8bf8(0x196)](_0x5e8bf8(0x1a6)),console[_0x5e8bf8(0x196)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x5e8bf8(0x196)](''),console[_0x5e8bf8(0x196)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x478429=_0x508e96&&(_0x508e96[_0x5e8bf8(0x1ab)]('*')||_0x508e96['includes']('?'));if(_0x478429)return await this['listWithPattern'](_0x32f553,_0x5d3c61,_0x508e96);const _0x441c34=_0x508e96?_0x5d3c61+'/'+_0x508e96:_0x5d3c61;return _0x122ccb?await this[_0x5e8bf8(0x1a5)](_0x32f553,_0x441c34):await this[_0x5e8bf8(0x194)](_0x32f553,_0x441c34);}catch(_0x255e79){if(_0x255e79 instanceof SDKError)return console['error']('Error:\x20'+_0x255e79[_0x5e8bf8(0x1b9)]),_0x255e79[_0x5e8bf8(0x1c0)]&&console[_0x5e8bf8(0x196)](_0x5e8bf8(0x19c)+_0x255e79[_0x5e8bf8(0x1c0)]),0x1;throw _0x255e79;}}async['listWithPattern'](_0x34ca3c,_0x3de115,_0x127d25){const _0x184080=a37_0x29e46f,{options:_0x1ab20b,tdx:_0x250571}=_0x34ca3c,_0x3d08a2=await withSpinner(_0x184080(0x19d)+_0x3de115+_0x184080(0x197),()=>_0x250571['segment'][_0x184080(0x1bd)](_0x3de115),{'verbose':_0x1ab20b[_0x184080(0x1af)]}),_0xabd2f8=_0x3d08a2[_0x184080(0x1bb)],_0xd5c14f=await withSpinner(_0x184080(0x1bc),()=>_0x250571['segment']['listUnified'](_0xabd2f8[_0x184080(0x1c3)],_0xabd2f8[_0x184080(0x189)]),{'verbose':_0x1ab20b[_0x184080(0x1af)]}),{folders:_0x27e50a,segments:_0x276e2c}=_0xd5c14f['data'],_0x57bafe=_0x127d25['replace'](/[.+^${}()|[\]\\]/g,_0x184080(0x1a9))[_0x184080(0x1bf)](/\*/g,'.*')[_0x184080(0x1bf)](/\?/g,'.'),_0x3bee43=new RegExp('^'+_0x57bafe+'$','i'),_0x298b5a=_0x27e50a[_0x184080(0x1ad)](_0x1b8222=>_0x3bee43[_0x184080(0x1b7)](_0x1b8222[_0x184080(0x1b0)])),_0x1a2fd1=_0x276e2c[_0x184080(0x1ad)](_0xc7b2dc=>_0x3bee43[_0x184080(0x1b7)](_0xc7b2dc[_0x184080(0x1b0)])),_0x2a338e=_0x298b5a[_0x184080(0x1a3)]+_0x1a2fd1[_0x184080(0x1a3)];console['error'](_0x184080(0x1c1)+_0x298b5a[_0x184080(0x1a3)]+_0x184080(0x1a0)+(_0x298b5a[_0x184080(0x1a3)]!==0x1?'s':'')+_0x184080(0x1a1)+_0x1a2fd1[_0x184080(0x1a3)]+_0x184080(0x18e)+(_0x1a2fd1[_0x184080(0x1a3)]!==0x1?'s':'')+_0x184080(0x1b5)+_0x127d25+'\x27');if(_0x1ab20b[_0x184080(0x1b2)]===_0x184080(0x1be)||_0x1ab20b[_0x184080(0x1b2)]==='jsonl'){const _0x4ac194=[..._0x298b5a[_0x184080(0x1c5)](_0x19e662=>({..._0x19e662,'type':_0x184080(0x1b8)})),..._0x1a2fd1[_0x184080(0x1c5)](_0xf74acc=>({..._0xf74acc,'type':'segment'}))][_0x184080(0x19b)]((_0x4d0473,_0x5e2c9b)=>_0x4d0473[_0x184080(0x1b0)][_0x184080(0x18f)](_0x5e2c9b['name']));await handleSDKOutput(_0x4ac194,_0x1ab20b);}else{if(_0x2a338e===0x0)console['log'](_0x184080(0x190)+_0x127d25);else{console[_0x184080(0x1a2)](a37_0x4d2c2b[_0x184080(0x19e)]('['+_0x3de115+']\x20matching\x20\x27'+_0x127d25+'\x27'));const _0x2701c1=formatFlatList(_0x298b5a,_0x1a2fd1,{'showMetadata':!![]});console[_0x184080(0x1a2)](_0x2701c1);}}return 0x0;}async['listUnified'](_0xd3353e,_0x39aa1a){const _0x279cbc=a37_0x29e46f,{options:_0x3c5c24,tdx:_0x4b906c}=_0xd3353e,_0x181a88=await withSpinner('Resolving\x20path\x20\x27'+_0x39aa1a+_0x279cbc(0x197),()=>_0x4b906c[_0x279cbc(0x1c2)][_0x279cbc(0x1bd)](_0x39aa1a),{'verbose':_0x3c5c24[_0x279cbc(0x1af)]}),_0x4836a0=_0x181a88[_0x279cbc(0x1bb)];_0x3c5c24['verbose']&&(console[_0x279cbc(0x196)]('Parent\x20ID:\x20'+_0x4836a0[_0x279cbc(0x1c3)]),_0x4836a0['folderId']&&console['error'](_0x279cbc(0x1c7)+_0x4836a0['folderId']));const _0x78038f=await withSpinner(_0x279cbc(0x1bc),()=>_0x4b906c[_0x279cbc(0x1c2)][_0x279cbc(0x194)](_0x4836a0[_0x279cbc(0x1c3)],_0x4836a0[_0x279cbc(0x189)]),{'verbose':_0x3c5c24[_0x279cbc(0x1af)]}),{folders:_0x4de99d,segments:_0x4197fe}=_0x78038f[_0x279cbc(0x1bb)],_0x415d37=_0x4de99d[_0x279cbc(0x1a3)]+_0x4197fe[_0x279cbc(0x1a3)];console[_0x279cbc(0x196)]('✔\x20Found\x20'+_0x4de99d[_0x279cbc(0x1a3)]+_0x279cbc(0x1a0)+(_0x4de99d['length']!==0x1?'s':'')+'\x20and\x20'+_0x4197fe[_0x279cbc(0x1a3)]+_0x279cbc(0x18e)+(_0x4197fe[_0x279cbc(0x1a3)]!==0x1?'s':''));if(_0x3c5c24['format']===_0x279cbc(0x1be)||_0x3c5c24['format']===_0x279cbc(0x192)){const _0x35ab98=[..._0x4de99d['map'](_0x223e98=>({..._0x223e98,'type':_0x279cbc(0x1b8)})),..._0x4197fe[_0x279cbc(0x1c5)](_0x167597=>({..._0x167597,'type':_0x279cbc(0x1c2)}))][_0x279cbc(0x19b)]((_0x41cf38,_0x24e87f)=>_0x41cf38['name'][_0x279cbc(0x18f)](_0x24e87f['name']));await handleSDKOutput(_0x35ab98,_0x3c5c24);}else{if(_0x415d37===0x0)console[_0x279cbc(0x1a2)](a37_0x4d2c2b[_0x279cbc(0x19e)]('['+_0x39aa1a+']')),console[_0x279cbc(0x1a2)](_0x279cbc(0x188));else{console['log'](a37_0x4d2c2b[_0x279cbc(0x19e)]('['+_0x39aa1a+']'));const _0x4d3858=formatFlatList(_0x4de99d,_0x4197fe,{'showMetadata':!![]});console[_0x279cbc(0x1a2)](_0x4d3858);}}return 0x0;}async[a37_0x29e46f(0x1a5)](_0x43c857,_0x3f0884){const _0x42f24f=a37_0x29e46f,{options:_0x2b0dbf,tdx:_0xbf84f7}=_0x43c857,_0x2b4026=await withSpinner(_0x42f24f(0x1a4)+_0x3f0884+_0x42f24f(0x197),()=>_0xbf84f7[_0x42f24f(0x1c2)][_0x42f24f(0x1bd)](_0x3f0884),{'verbose':_0x2b0dbf[_0x42f24f(0x1af)]}),_0x1b5395=_0x2b4026[_0x42f24f(0x1bb)];_0x2b0dbf[_0x42f24f(0x1af)]&&(console[_0x42f24f(0x196)](_0x42f24f(0x1ae)+_0x1b5395[_0x42f24f(0x1c3)]),_0x1b5395[_0x42f24f(0x189)]&&console[_0x42f24f(0x196)]('Folder\x20ID:\x20'+_0x1b5395[_0x42f24f(0x189)]));const _0x2d230d=_0x2b0dbf['maxDepth']||0xa,_0x5ec9f4=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0xbf84f7[_0x42f24f(0x1c2)][_0x42f24f(0x1a5)](_0x1b5395['parentId'],_0x1b5395[_0x42f24f(0x189)],0x0,_0x2d230d),{'verbose':_0x2b0dbf[_0x42f24f(0x1af)]}),_0x4c7410=_0x5ec9f4[_0x42f24f(0x1bb)];console[_0x42f24f(0x196)](_0x42f24f(0x1b4)+_0x4c7410[_0x42f24f(0x1a3)]+_0x42f24f(0x1c4));if(_0x2b0dbf['format']==='json'||_0x2b0dbf[_0x42f24f(0x1b2)]===_0x42f24f(0x192))await handleSDKOutput(_0x4c7410,_0x2b0dbf);else{console['log'](a37_0x4d2c2b[_0x42f24f(0x19e)]('['+_0x3f0884+']'));const _0x70fe31=formatTree(_0x4c7410,{'showMetadata':!![]});console[_0x42f24f(0x1a2)](_0x70fe31);}return 0x0;}}
1
+ function a37_0x9a11(){const _0x392808=['1403710USJBgk','Resolving\x20path\x20\x27','message','listWithPattern','\x20top-level\x20items','cause','\x20and\x20','parentSegment','format','Set\x20a\x20parent\x20segment\x20context\x20first:','name','site','data','27tPLKZu','4496260jhlswS','description','jsonl','segment','recursive','\x20folder','resolvePathToResource','Folder\x20ID:\x20','\x27...','330BwxNyK','4869176SBJKhS','includes','execute','Listing\x20folders\x20and\x20segments...','json','listUnified','dim','Folder/pattern\x20arg:\x20','map','test','2RgINQW','List\x20folders\x20and\x20child\x20segments','(empty)','Parent\x20ID:\x20','6tOlOSq','localeCompare','parentId','sort','Building\x20hierarchy\x20tree...','1105762bjrDCe','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','log','Site:\x20','error','\x20segment','\x5c$&','5472700pjTYHA','Resolving\x20parent\x20segment\x20\x27','Recursive\x20mode:\x20enabled','folder','length','(not\x20set)','listRecursive','No\x20items\x20match\x20pattern:\x20','filter','Parent\x20segment\x20context:\x20','folderId','verbose','replace','✔\x20Built\x20tree\x20with\x20','segments','1077927EDigFY'];a37_0x9a11=function(){return _0x392808;};return a37_0x9a11();}const a37_0x1bd8c=a37_0xeb6b;(function(_0x1c1db8,_0x210ee1){const _0x2d9a84=a37_0xeb6b,_0x54ba72=_0x1c1db8();while(!![]){try{const _0x4097d0=-parseInt(_0x2d9a84(0x1e5))/0x1*(-parseInt(_0x2d9a84(0x1ac))/0x2)+-parseInt(_0x2d9a84(0x1c2))/0x3+parseInt(_0x2d9a84(0x1b3))/0x4+-parseInt(_0x2d9a84(0x1d1))/0x5+-parseInt(_0x2d9a84(0x1a7))/0x6*(-parseInt(_0x2d9a84(0x1c3))/0x7)+-parseInt(_0x2d9a84(0x1db))/0x8+parseInt(_0x2d9a84(0x1d0))/0x9*(-parseInt(_0x2d9a84(0x1da))/0xa);if(_0x4097d0===_0x210ee1)break;else _0x54ba72['push'](_0x54ba72['shift']());}catch(_0x1de155){_0x54ba72['push'](_0x54ba72['shift']());}}}(a37_0x9a11,0xc50f8));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a37_0xeb6b(_0x4fc77e,_0x48567c){_0x4fc77e=_0x4fc77e-0x1a7;const _0x9a118e=a37_0x9a11();let _0xeb6b7c=_0x9a118e[_0x4fc77e];return _0xeb6b7c;}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import a37_0x3b7547 from'chalk';export class SegmentsCommand extends BaseCommand{['name']=a37_0x1bd8c(0x1c1);[a37_0x1bd8c(0x1d2)]=a37_0x1bd8c(0x1e6);async[a37_0x1bd8c(0x1dd)](_0x54c796){const _0x5cff9f=a37_0x1bd8c,{options:_0x55bae1,args:_0x496169}=_0x54c796,_0x53d089=_0x55bae1[_0x5cff9f(0x1d5)],_0x1834aa=_0x496169[0x0];try{const _0x40164c=_0x55bae1[_0x5cff9f(0x1ca)];_0x55bae1[_0x5cff9f(0x1be)]&&(console['error'](_0x5cff9f(0x1af)+_0x55bae1[_0x5cff9f(0x1ce)]),console[_0x5cff9f(0x1b0)](_0x5cff9f(0x1bc)+(_0x40164c||_0x5cff9f(0x1b8))),_0x1834aa&&console[_0x5cff9f(0x1b0)](_0x5cff9f(0x1e2)+_0x1834aa),_0x53d089&&console[_0x5cff9f(0x1b0)](_0x5cff9f(0x1b5)));if(!_0x40164c)return console[_0x5cff9f(0x1b0)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console['error'](''),console[_0x5cff9f(0x1b0)](_0x5cff9f(0x1cc)),console[_0x5cff9f(0x1b0)](_0x5cff9f(0x1ad)),console[_0x5cff9f(0x1b0)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x5cff9f(0x1b0)](''),console[_0x5cff9f(0x1b0)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x35cabe=_0x1834aa&&(_0x1834aa[_0x5cff9f(0x1dc)]('*')||_0x1834aa['includes']('?'));if(_0x35cabe)return await this[_0x5cff9f(0x1c6)](_0x54c796,_0x40164c,_0x1834aa);const _0x2e9742=_0x1834aa?_0x40164c+'/'+_0x1834aa:_0x40164c;return _0x53d089?await this[_0x5cff9f(0x1b9)](_0x54c796,_0x2e9742):await this[_0x5cff9f(0x1e0)](_0x54c796,_0x2e9742);}catch(_0x285293){if(_0x285293 instanceof SDKError)return console[_0x5cff9f(0x1b0)]('Error:\x20'+_0x285293[_0x5cff9f(0x1c5)]),_0x285293['cause']&&console[_0x5cff9f(0x1b0)]('\x20\x20Cause:\x20'+_0x285293[_0x5cff9f(0x1c8)]),0x1;throw _0x285293;}}async[a37_0x1bd8c(0x1c6)](_0x385c7f,_0x32616d,_0x2c519f){const _0x4ba7f6=a37_0x1bd8c,{options:_0x109568,tdx:_0x3a4865}=_0x385c7f,_0x3eb955=await withSpinner(_0x4ba7f6(0x1b4)+_0x32616d+_0x4ba7f6(0x1d9),()=>_0x3a4865['segment'][_0x4ba7f6(0x1d7)](_0x32616d),{'verbose':_0x109568[_0x4ba7f6(0x1be)]}),_0x40c734=_0x3eb955['data'],_0x24ee75=await withSpinner(_0x4ba7f6(0x1de),()=>_0x3a4865['segment'][_0x4ba7f6(0x1e0)](_0x40c734[_0x4ba7f6(0x1a9)],_0x40c734['folderId']),{'verbose':_0x109568[_0x4ba7f6(0x1be)]}),{folders:_0x36a304,segments:_0x557fc5}=_0x24ee75[_0x4ba7f6(0x1cf)],_0x42450c=_0x2c519f[_0x4ba7f6(0x1bf)](/[.+^${}()|[\]\\]/g,_0x4ba7f6(0x1b2))[_0x4ba7f6(0x1bf)](/\*/g,'.*')[_0x4ba7f6(0x1bf)](/\?/g,'.'),_0x1bf2dd=new RegExp('^'+_0x42450c+'$','i'),_0x3fbf05=_0x36a304[_0x4ba7f6(0x1bb)](_0x48e4ee=>_0x1bf2dd[_0x4ba7f6(0x1e4)](_0x48e4ee[_0x4ba7f6(0x1cd)])),_0x1fad7f=_0x557fc5[_0x4ba7f6(0x1bb)](_0x48ca15=>_0x1bf2dd[_0x4ba7f6(0x1e4)](_0x48ca15[_0x4ba7f6(0x1cd)])),_0x274765=_0x3fbf05['length']+_0x1fad7f['length'];console[_0x4ba7f6(0x1b0)]('✔\x20Found\x20'+_0x3fbf05['length']+_0x4ba7f6(0x1d6)+(_0x3fbf05[_0x4ba7f6(0x1b7)]!==0x1?'s':'')+_0x4ba7f6(0x1c9)+_0x1fad7f['length']+_0x4ba7f6(0x1b1)+(_0x1fad7f['length']!==0x1?'s':'')+'\x20matching\x20\x27'+_0x2c519f+'\x27');if(_0x109568[_0x4ba7f6(0x1cb)]===_0x4ba7f6(0x1df)||_0x109568[_0x4ba7f6(0x1cb)]==='jsonl'){const _0x44130c=[..._0x3fbf05[_0x4ba7f6(0x1e3)](_0x4e911b=>({..._0x4e911b,'type':_0x4ba7f6(0x1b6)})),..._0x1fad7f[_0x4ba7f6(0x1e3)](_0x231f42=>({..._0x231f42,'type':_0x4ba7f6(0x1d4)}))][_0x4ba7f6(0x1aa)]((_0x28148c,_0x1291de)=>_0x28148c['name'][_0x4ba7f6(0x1a8)](_0x1291de[_0x4ba7f6(0x1cd)]));await handleSDKOutput(_0x44130c,_0x109568);}else{if(_0x274765===0x0)console[_0x4ba7f6(0x1ae)](_0x4ba7f6(0x1ba)+_0x2c519f);else{console[_0x4ba7f6(0x1ae)](a37_0x3b7547[_0x4ba7f6(0x1e1)]('['+_0x32616d+']\x20matching\x20\x27'+_0x2c519f+'\x27'));const _0x2a6410=formatFlatList(_0x3fbf05,_0x1fad7f,{'showMetadata':!![]});console['log'](_0x2a6410);}}return 0x0;}async[a37_0x1bd8c(0x1e0)](_0xe51b97,_0x289873){const _0x479a49=a37_0x1bd8c,{options:_0xf58c68,tdx:_0x78484f}=_0xe51b97,_0x12a503=await withSpinner(_0x479a49(0x1c4)+_0x289873+'\x27...',()=>_0x78484f['segment'][_0x479a49(0x1d7)](_0x289873),{'verbose':_0xf58c68[_0x479a49(0x1be)]}),_0x2a2c92=_0x12a503[_0x479a49(0x1cf)];_0xf58c68[_0x479a49(0x1be)]&&(console['error']('Parent\x20ID:\x20'+_0x2a2c92[_0x479a49(0x1a9)]),_0x2a2c92[_0x479a49(0x1bd)]&&console[_0x479a49(0x1b0)](_0x479a49(0x1d8)+_0x2a2c92[_0x479a49(0x1bd)]));const _0x11ef13=await withSpinner('Listing\x20folders\x20and\x20segments...',()=>_0x78484f[_0x479a49(0x1d4)][_0x479a49(0x1e0)](_0x2a2c92['parentId'],_0x2a2c92[_0x479a49(0x1bd)]),{'verbose':_0xf58c68['verbose']}),{folders:_0x43b342,segments:_0x57a2c8}=_0x11ef13[_0x479a49(0x1cf)],_0x5e2899=_0x43b342[_0x479a49(0x1b7)]+_0x57a2c8[_0x479a49(0x1b7)];console['error']('✔\x20Found\x20'+_0x43b342[_0x479a49(0x1b7)]+'\x20folder'+(_0x43b342[_0x479a49(0x1b7)]!==0x1?'s':'')+_0x479a49(0x1c9)+_0x57a2c8[_0x479a49(0x1b7)]+'\x20segment'+(_0x57a2c8[_0x479a49(0x1b7)]!==0x1?'s':''));if(_0xf58c68[_0x479a49(0x1cb)]==='json'||_0xf58c68[_0x479a49(0x1cb)]===_0x479a49(0x1d3)){const _0x1c02aa=[..._0x43b342['map'](_0x5aa05c=>({..._0x5aa05c,'type':_0x479a49(0x1b6)})),..._0x57a2c8[_0x479a49(0x1e3)](_0x135d6e=>({..._0x135d6e,'type':'segment'}))][_0x479a49(0x1aa)]((_0x772996,_0x43df46)=>_0x772996[_0x479a49(0x1cd)][_0x479a49(0x1a8)](_0x43df46['name']));await handleSDKOutput(_0x1c02aa,_0xf58c68);}else{if(_0x5e2899===0x0)console[_0x479a49(0x1ae)](a37_0x3b7547[_0x479a49(0x1e1)]('['+_0x289873+']')),console[_0x479a49(0x1ae)](_0x479a49(0x1e7));else{console[_0x479a49(0x1ae)](a37_0x3b7547[_0x479a49(0x1e1)]('['+_0x289873+']'));const _0x202084=formatFlatList(_0x43b342,_0x57a2c8,{'showMetadata':!![]});console[_0x479a49(0x1ae)](_0x202084);}}return 0x0;}async[a37_0x1bd8c(0x1b9)](_0x3ae208,_0xe7bd9e){const _0x3bf8e1=a37_0x1bd8c,{options:_0x3e1517,tdx:_0x56e350}=_0x3ae208,_0x5b049c=await withSpinner(_0x3bf8e1(0x1c4)+_0xe7bd9e+_0x3bf8e1(0x1d9),()=>_0x56e350[_0x3bf8e1(0x1d4)]['resolvePathToResource'](_0xe7bd9e),{'verbose':_0x3e1517[_0x3bf8e1(0x1be)]}),_0x147730=_0x5b049c[_0x3bf8e1(0x1cf)];_0x3e1517['verbose']&&(console[_0x3bf8e1(0x1b0)](_0x3bf8e1(0x1e8)+_0x147730[_0x3bf8e1(0x1a9)]),_0x147730[_0x3bf8e1(0x1bd)]&&console[_0x3bf8e1(0x1b0)](_0x3bf8e1(0x1d8)+_0x147730[_0x3bf8e1(0x1bd)]));const _0xe143d=_0x3e1517['maxDepth']||0xa,_0xa7273e=await withSpinner(_0x3bf8e1(0x1ab),()=>_0x56e350['segment']['listRecursive'](_0x147730[_0x3bf8e1(0x1a9)],_0x147730[_0x3bf8e1(0x1bd)],0x0,_0xe143d),{'verbose':_0x3e1517[_0x3bf8e1(0x1be)]}),_0x127407=_0xa7273e['data'];console[_0x3bf8e1(0x1b0)](_0x3bf8e1(0x1c0)+_0x127407[_0x3bf8e1(0x1b7)]+_0x3bf8e1(0x1c7));if(_0x3e1517[_0x3bf8e1(0x1cb)]===_0x3bf8e1(0x1df)||_0x3e1517[_0x3bf8e1(0x1cb)]===_0x3bf8e1(0x1d3))await handleSDKOutput(_0x127407,_0x3e1517);else{console[_0x3bf8e1(0x1ae)](a37_0x3b7547[_0x3bf8e1(0x1e1)]('['+_0xe7bd9e+']'));const _0x4153b9=formatTree(_0x127407,{'showMetadata':!![]});console[_0x3bf8e1(0x1ae)](_0x4153b9);}return 0x0;}}
@@ -1 +1 @@
1
- const a38_0x4b9e4f=a38_0x43b1;function a38_0x43b1(_0x569e6a,_0x2e1f6d){_0x569e6a=_0x569e6a-0x188;const _0x1f7bdb=a38_0x1f7b();let _0x43b1b0=_0x1f7bdb[_0x569e6a];return _0x43b1b0;}(function(_0x3f3591,_0x21f0bb){const _0x135b9e=a38_0x43b1,_0x4e52b9=_0x3f3591();while(!![]){try{const _0x2302ea=-parseInt(_0x135b9e(0x19e))/0x1*(-parseInt(_0x135b9e(0x1a1))/0x2)+-parseInt(_0x135b9e(0x1a4))/0x3+parseInt(_0x135b9e(0x193))/0x4+-parseInt(_0x135b9e(0x1a7))/0x5*(-parseInt(_0x135b9e(0x1a0))/0x6)+parseInt(_0x135b9e(0x196))/0x7*(-parseInt(_0x135b9e(0x191))/0x8)+parseInt(_0x135b9e(0x1a8))/0x9*(parseInt(_0x135b9e(0x1ab))/0xa)+-parseInt(_0x135b9e(0x1ac))/0xb;if(_0x2302ea===_0x21f0bb)break;else _0x4e52b9['push'](_0x4e52b9['shift']());}catch(_0x5e82a1){_0x4e52b9['push'](_0x4e52b9['shift']());}}}(a38_0x1f7b,0x36a47));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{[a38_0x4b9e4f(0x1b0)]=a38_0x4b9e4f(0x1ae);[a38_0x4b9e4f(0x197)]='Show\x20table\x20contents';async['execute'](_0x3bf012){return this['showTable'](_0x3bf012);}async[a38_0x4b9e4f(0x190)](_0x2a8025){const _0x24b5a6=a38_0x4b9e4f,{options:_0x19d7e2,args:_0x2d13b6,tdx:_0x569e66}=_0x2a8025;let _0x1d82f4;try{_0x1d82f4=parseTableReference(_0x2d13b6[0x0]);const _0x14ce30=_0x19d7e2['database'];!_0x1d82f4[_0x24b5a6(0x18e)]&&_0x14ce30&&(_0x1d82f4['database']=_0x14ce30);const _0x37a39a=validateTableDescribeReference(_0x1d82f4);if(_0x37a39a)return console[_0x24b5a6(0x19c)]('Error:\x20'+_0x37a39a),console['error'](_0x24b5a6(0x1a3)),console[_0x24b5a6(0x19c)](_0x24b5a6(0x18c)),console[_0x24b5a6(0x19c)](_0x24b5a6(0x18d)),0x1;}catch(_0x443c39){return console[_0x24b5a6(0x19c)](_0x24b5a6(0x1af)+_0x443c39[_0x24b5a6(0x1aa)]),console[_0x24b5a6(0x19c)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x24b5a6(0x19c)](_0x24b5a6(0x18c)),console['error'](_0x24b5a6(0x18d)),0x1;}const _0x24871c=_0x1d82f4[_0x24b5a6(0x1a5)],_0x3c7659=_0x1d82f4[_0x24b5a6(0x18e)],_0x2f759d=_0x1d82f4[_0x24b5a6(0x189)],_0x443e2e=resolveLimit(_0x19d7e2['limit'],DEFAULT_DISPLAY_LIMIT);try{_0x19d7e2[_0x24b5a6(0x188)]&&(console[_0x24b5a6(0x19c)](_0x24b5a6(0x1a6)+_0x19d7e2[_0x24b5a6(0x194)]),_0x24871c&&console['error'](_0x24b5a6(0x18b)+_0x24871c),console[_0x24b5a6(0x19c)](_0x24b5a6(0x198)+_0x3c7659),console['error']('Table:\x20'+_0x2f759d),console[_0x24b5a6(0x19c)](_0x24b5a6(0x1a2)+_0x443e2e));const _0x2e6057=_0x24871c?_0x24871c+'.'+_0x3c7659+'.'+_0x2f759d:_0x3c7659+'.'+_0x2f759d,_0x28c833=await withSpinner(_0x24b5a6(0x19d)+_0x2e6057+_0x24b5a6(0x18f),()=>_0x569e66[_0x24b5a6(0x19f)][_0x24b5a6(0x190)](_0x3c7659,_0x2f759d,_0x443e2e,_0x24871c),{'verbose':_0x19d7e2[_0x24b5a6(0x188)]}),_0x2aa608=_0x28c833[_0x24b5a6(0x199)],_0x32c570=_0x2aa608[_0x24b5a6(0x199)];return _0x32c570[_0x24b5a6(0x1a9)]===0x0?console[_0x24b5a6(0x19c)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x24b5a6(0x19c)]('✔\x20Retrieved\x20'+_0x32c570[_0x24b5a6(0x1a9)]+_0x24b5a6(0x195)+(_0x32c570[_0x24b5a6(0x1a9)]!==0x1?'s':'')+_0x24b5a6(0x192)+_0x2e6057),await handleSDKOutput(_0x32c570,_0x19d7e2),0x0;}catch(_0x14d7b0){if(_0x14d7b0 instanceof SDKError)return console[_0x24b5a6(0x19c)](_0x24b5a6(0x1af)+_0x14d7b0[_0x24b5a6(0x1aa)]),_0x14d7b0[_0x24b5a6(0x19b)]&&console[_0x24b5a6(0x19c)]('\x20\x20Cause:\x20'+_0x14d7b0[_0x24b5a6(0x19b)]),0x1;throw _0x14d7b0;}}[a38_0x4b9e4f(0x19a)](_0x11886c){const _0x242acc=a38_0x4b9e4f;if(_0x11886c[_0x242acc(0x1ad)][_0x242acc(0x1a9)]===0x0)return _0x242acc(0x18a);if(_0x11886c[_0x242acc(0x1ad)][_0x242acc(0x1a9)]>0x1)return'Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';return undefined;}}function a38_0x1f7b(){const _0x1a2ea5=['310cKvShf','2050026YmLEPs','args','show','Error:\x20','name','verbose','table','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','Catalog:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','database','...','showTable','26016ldEory','\x20from\x20','152612SUCywW','site','\x20row','42QiIxIO','description','Database:\x20','data','validate','cause','error','Querying\x20','25NiZSom','query','6wirzLc','526moHwgI','Limit:\x20','Usage:\x20tdx\x20show\x20<database.table>','498048QiuOuC','catalog','Site:\x20','1905040AWAijA','49347fPSVDt','length','message'];a38_0x1f7b=function(){return _0x1a2ea5;};return a38_0x1f7b();}
1
+ const a38_0x5a833c=a38_0xfed1;function a38_0x5484(){const _0x2e774d=['Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','verbose','data','3619233pjAwbv','table','name','40576gubmyf','420827lETtQa','1538481rHsXNO','110TFXGND','409746NFsuWf','Querying\x20','length','site','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','\x20\x20Cause:\x20','error','execute','database','Usage:\x20tdx\x20show\x20<database.table>','query','✔\x20Retrieved\x20','315455xxGFYn','cause','Catalog:\x20','8HzwICl','Limit:\x20','args','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','show','6ThnKHo','catalog','\x20from\x20','Error:\x20','...','showTable','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','message','limit','\x20row','Site:\x20','12RgpbmN','2611040mEHvBn','description'];a38_0x5484=function(){return _0x2e774d;};return a38_0x5484();}(function(_0x279e26,_0x1576fd){const _0x115bf6=a38_0xfed1,_0x12a9e0=_0x279e26();while(!![]){try{const _0x181d63=-parseInt(_0x115bf6(0x18d))/0x1+-parseInt(_0x115bf6(0x189))/0x2*(-parseInt(_0x115bf6(0x17f))/0x3)+parseInt(_0x115bf6(0x180))/0x4+-parseInt(_0x115bf6(0x199))/0x5+-parseInt(_0x115bf6(0x1a1))/0x6*(-parseInt(_0x115bf6(0x18b))/0x7)+parseInt(_0x115bf6(0x19c))/0x8*(parseInt(_0x115bf6(0x186))/0x9)+-parseInt(_0x115bf6(0x18c))/0xa*(parseInt(_0x115bf6(0x18a))/0xb);if(_0x181d63===_0x1576fd)break;else _0x12a9e0['push'](_0x12a9e0['shift']());}catch(_0x46370d){_0x12a9e0['push'](_0x12a9e0['shift']());}}}(a38_0x5484,0x70d58));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a38_0xfed1(_0x2c150f,_0x402cce){_0x2c150f=_0x2c150f-0x17d;const _0x548450=a38_0x5484();let _0xfed1d7=_0x548450[_0x2c150f];return _0xfed1d7;}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{[a38_0x5a833c(0x188)]=a38_0x5a833c(0x1a0);[a38_0x5a833c(0x181)]='Show\x20table\x20contents';async[a38_0x5a833c(0x194)](_0x5db902){const _0x53866a=a38_0x5a833c;return this[_0x53866a(0x1a6)](_0x5db902);}async['showTable'](_0x15396b){const _0x4a9f42=a38_0x5a833c,{options:_0x3b924c,args:_0x6334e5,tdx:_0x32ca37}=_0x15396b;let _0x23c81c;try{_0x23c81c=parseTableReference(_0x6334e5[0x0]);const _0x558518=_0x3b924c[_0x4a9f42(0x195)];!_0x23c81c['database']&&_0x558518&&(_0x23c81c['database']=_0x558518);const _0xd8ab4b=validateTableDescribeReference(_0x23c81c);if(_0xd8ab4b)return console[_0x4a9f42(0x193)]('Error:\x20'+_0xd8ab4b),console[_0x4a9f42(0x193)](_0x4a9f42(0x196)),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x4a9f42(0x193)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x55f681){return console[_0x4a9f42(0x193)](_0x4a9f42(0x1a4)+_0x55f681[_0x4a9f42(0x1a8)]),console[_0x4a9f42(0x193)](_0x4a9f42(0x196)),console[_0x4a9f42(0x193)](_0x4a9f42(0x183)),console[_0x4a9f42(0x193)](_0x4a9f42(0x19f)),0x1;}const _0x5b4995=_0x23c81c[_0x4a9f42(0x1a2)],_0x2355d5=_0x23c81c[_0x4a9f42(0x195)],_0x390c77=_0x23c81c[_0x4a9f42(0x187)],_0x3bc5e7=resolveLimit(_0x3b924c[_0x4a9f42(0x1a9)],DEFAULT_DISPLAY_LIMIT);try{_0x3b924c[_0x4a9f42(0x184)]&&(console[_0x4a9f42(0x193)](_0x4a9f42(0x17e)+_0x3b924c[_0x4a9f42(0x190)]),_0x5b4995&&console[_0x4a9f42(0x193)](_0x4a9f42(0x19b)+_0x5b4995),console['error']('Database:\x20'+_0x2355d5),console[_0x4a9f42(0x193)]('Table:\x20'+_0x390c77),console[_0x4a9f42(0x193)](_0x4a9f42(0x19d)+_0x3bc5e7));const _0x5ac9a6=_0x5b4995?_0x5b4995+'.'+_0x2355d5+'.'+_0x390c77:_0x2355d5+'.'+_0x390c77,_0x599bd2=await withSpinner(_0x4a9f42(0x18e)+_0x5ac9a6+_0x4a9f42(0x1a5),()=>_0x32ca37[_0x4a9f42(0x197)][_0x4a9f42(0x1a6)](_0x2355d5,_0x390c77,_0x3bc5e7,_0x5b4995),{'verbose':_0x3b924c['verbose']}),_0x2038e2=_0x599bd2[_0x4a9f42(0x185)],_0x38fde2=_0x2038e2[_0x4a9f42(0x185)];return _0x38fde2[_0x4a9f42(0x18f)]===0x0?console[_0x4a9f42(0x193)](_0x4a9f42(0x1a7)):console[_0x4a9f42(0x193)](_0x4a9f42(0x198)+_0x38fde2[_0x4a9f42(0x18f)]+_0x4a9f42(0x17d)+(_0x38fde2[_0x4a9f42(0x18f)]!==0x1?'s':'')+_0x4a9f42(0x1a3)+_0x5ac9a6),await handleSDKOutput(_0x38fde2,_0x3b924c),0x0;}catch(_0x125562){if(_0x125562 instanceof SDKError)return console[_0x4a9f42(0x193)](_0x4a9f42(0x1a4)+_0x125562['message']),_0x125562[_0x4a9f42(0x19a)]&&console[_0x4a9f42(0x193)](_0x4a9f42(0x192)+_0x125562['cause']),0x1;throw _0x125562;}}['validate'](_0x41fa42){const _0x5d97e5=a38_0x5a833c;if(_0x41fa42[_0x5d97e5(0x19e)][_0x5d97e5(0x18f)]===0x0)return _0x5d97e5(0x182);if(_0x41fa42[_0x5d97e5(0x19e)][_0x5d97e5(0x18f)]>0x1)return _0x5d97e5(0x191);return undefined;}}
@@ -1 +1 @@
1
- const a39_0x1890e4=a39_0x31e8;(function(_0x588f0f,_0x128852){const _0x5f14a9=a39_0x31e8,_0x3d6720=_0x588f0f();while(!![]){try{const _0x3ac88d=parseInt(_0x5f14a9(0x1a2))/0x1*(-parseInt(_0x5f14a9(0x199))/0x2)+parseInt(_0x5f14a9(0x1c9))/0x3+-parseInt(_0x5f14a9(0x1b1))/0x4*(-parseInt(_0x5f14a9(0x1cc))/0x5)+parseInt(_0x5f14a9(0x1ca))/0x6+-parseInt(_0x5f14a9(0x198))/0x7*(parseInt(_0x5f14a9(0x1af))/0x8)+-parseInt(_0x5f14a9(0x1c1))/0x9*(-parseInt(_0x5f14a9(0x1be))/0xa)+-parseInt(_0x5f14a9(0x1b8))/0xb;if(_0x3ac88d===_0x128852)break;else _0x3d6720['push'](_0x3d6720['shift']());}catch(_0x4dee2d){_0x3d6720['push'](_0x3d6720['shift']());}}}(a39_0x440e,0xc0b4c));import{BaseCommand}from'./command.js';function a39_0x440e(){const _0x25df38=['data','✖\x20No\x20tables\x20found','name','listTables','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','validate','\x27\x20across\x20all\x20databases.','site','8sDMBgM','Database:\x20all','284mQEmYT','Database:\x20','database','Listing\x20tables...','\x27\x20is\x20ambiguous.','cause','tables','10059104PKXsWV','\x20\x20Use:\x20tdx\x20tables\x20\x22','error','\x20\x20Cause:\x20','Database\x20\x27','Or\x20use\x20--in\x20flag:','1910YChqct','Error:\x20','Site:\x20','54666eEHQiB','execute','List\x20tables\x20in\x20a\x20database','.*\x22','query','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','Table\x20pattern:\x20','includes','186048iIMsbj','8779446uMvNUu','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','65165fHSWXB','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','7352135tJefqh','566YtXVlw','length','description','table','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','message','✔\x20Found\x20','limit','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','3027pOjekL','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','verbose','Note:\x20\x27'];a39_0x440e=function(){return _0x25df38;};return a39_0x440e();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a39_0x31e8(_0xef005f,_0x3ca978){_0xef005f=_0xef005f-0x197;const _0x440e4b=a39_0x440e();let _0x31e87a=_0x440e4b[_0xef005f];return _0x31e87a;}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{[a39_0x1890e4(0x1a9)]=a39_0x1890e4(0x1b7);[a39_0x1890e4(0x19b)]=a39_0x1890e4(0x1c3);async[a39_0x1890e4(0x1c2)](_0x435d1f){const _0x44b3b2=a39_0x1890e4,{options:_0x8b2f8e,args:_0x44bc47,tdx:_0x2c5c7e}=_0x435d1f;let _0xdbe48f;if(_0x44bc47[_0x44b3b2(0x19a)]===0x0)_0xdbe48f={'database':undefined,'table':undefined,'original':''};else{if(_0x44bc47[_0x44b3b2(0x19a)]===0x1)try{_0xdbe48f=parseTableReference(_0x44bc47[0x0]);if(_0xdbe48f[_0x44b3b2(0x19c)]&&!_0xdbe48f['database']&&!_0xdbe48f['table'][_0x44b3b2(0x1c8)]('*')&&!_0xdbe48f['table'][_0x44b3b2(0x1c8)]('?'))return console['error']('Error:\x20Pattern\x20\x27'+_0x44bc47[0x0]+_0x44b3b2(0x1b5)),console[_0x44b3b2(0x1ba)](_0x44b3b2(0x1ce)+_0xdbe48f['table']+'\x27?'),console[_0x44b3b2(0x1ba)](_0x44b3b2(0x1b9)+_0xdbe48f[_0x44b3b2(0x19c)]+_0x44b3b2(0x1c4)),console[_0x44b3b2(0x1ba)](_0x44b3b2(0x1cb)+_0xdbe48f[_0x44b3b2(0x19c)]),console[_0x44b3b2(0x1ba)](_0x44b3b2(0x19d)+_0xdbe48f[_0x44b3b2(0x19c)]),console['error'](''),console[_0x44b3b2(0x1ba)](_0x44b3b2(0x1a6)+_0x44bc47[0x0]+_0x44b3b2(0x1c6)+_0xdbe48f[_0x44b3b2(0x19c)]+_0x44b3b2(0x1ad)),0x1;}catch(_0x51ae8f){return console[_0x44b3b2(0x1ba)](_0x44b3b2(0x1bf)+_0x51ae8f[_0x44b3b2(0x19e)]),0x1;}else return console[_0x44b3b2(0x1ba)](_0x44b3b2(0x1ab)),console[_0x44b3b2(0x1ba)](_0x44b3b2(0x197)),console[_0x44b3b2(0x1ba)](_0x44b3b2(0x1cd)),console[_0x44b3b2(0x1ba)](_0x44b3b2(0x1a3)),console[_0x44b3b2(0x1ba)]('\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases'),console[_0x44b3b2(0x1ba)](_0x44b3b2(0x1bd)),console['error'](_0x44b3b2(0x1a4)),0x1;}const _0x41b085=_0x8b2f8e[_0x44b3b2(0x1b3)];!_0xdbe48f['database']&&_0x41b085&&(_0xdbe48f[_0x44b3b2(0x1b3)]=_0x41b085);try{const _0x469996=_0x90722=>_0x90722&&(_0x90722[_0x44b3b2(0x1c8)]('*')||_0x90722[_0x44b3b2(0x1c8)]('?')),_0x4a3dd6=_0x469996(_0xdbe48f[_0x44b3b2(0x1b3)]);_0x8b2f8e[_0x44b3b2(0x1a5)]&&(console[_0x44b3b2(0x1ba)](_0x44b3b2(0x1c0)+_0x8b2f8e[_0x44b3b2(0x1ae)]),_0xdbe48f[_0x44b3b2(0x1b3)]?_0x4a3dd6?console[_0x44b3b2(0x1ba)]('Database\x20pattern:\x20'+_0xdbe48f[_0x44b3b2(0x1b3)]):console[_0x44b3b2(0x1ba)](_0x44b3b2(0x1b2)+_0xdbe48f[_0x44b3b2(0x1b3)]):console[_0x44b3b2(0x1ba)](_0x44b3b2(0x1b0)),_0xdbe48f[_0x44b3b2(0x19c)]&&console[_0x44b3b2(0x1ba)](_0x44b3b2(0x1c7)+_0xdbe48f[_0x44b3b2(0x19c)]));const _0x3a1a41=_0xdbe48f[_0x44b3b2(0x1b3)]&&!_0x4a3dd6?_0xdbe48f[_0x44b3b2(0x1b3)]:undefined,_0x40fdda=_0x4a3dd6?_0xdbe48f['database']:undefined,_0x453396=_0xdbe48f[_0x44b3b2(0x19c)],_0x4802b6=resolveLimit(_0x8b2f8e[_0x44b3b2(0x1a0)],DEFAULT_LISTING_LIMIT),_0x37ed9a=await withSpinner(_0x44b3b2(0x1b4),()=>_0x2c5c7e[_0x44b3b2(0x1c5)][_0x44b3b2(0x1aa)](_0x3a1a41,_0x453396,_0x40fdda,_0x4802b6),{'verbose':_0x8b2f8e[_0x44b3b2(0x1a5)]}),_0x349024=_0x37ed9a[_0x44b3b2(0x1a7)];if(_0x349024[_0x44b3b2(0x19a)]===0x0&&_0xdbe48f[_0x44b3b2(0x1b3)]&&!_0x4a3dd6)return console[_0x44b3b2(0x1ba)](_0x44b3b2(0x1a8)),console[_0x44b3b2(0x1ba)](_0x44b3b2(0x1bc)+_0xdbe48f[_0x44b3b2(0x1b3)]+_0x44b3b2(0x1a1)),0x1;return console[_0x44b3b2(0x1ba)](_0x44b3b2(0x19f)+_0x349024[_0x44b3b2(0x19a)]+'\x20table'+(_0x349024[_0x44b3b2(0x19a)]!==0x1?'s':'')),await handleSDKOutput(_0x349024,{..._0x8b2f8e,'limit':_0x4802b6}),0x0;}catch(_0x1350d1){if(_0x1350d1 instanceof SDKError)return console[_0x44b3b2(0x1ba)](_0x44b3b2(0x1bf)+_0x1350d1[_0x44b3b2(0x19e)]),_0x1350d1[_0x44b3b2(0x1b6)]&&console['error'](_0x44b3b2(0x1bb)+_0x1350d1[_0x44b3b2(0x1b6)]),0x1;throw _0x1350d1;}}[a39_0x1890e4(0x1ac)](_0x286120){return undefined;}}
1
+ const a39_0x237ccd=a39_0x5051;(function(_0x1a7c1f,_0x8d4533){const _0x5b5044=a39_0x5051,_0x59f6fb=_0x1a7c1f();while(!![]){try{const _0x2b4fc9=parseInt(_0x5b5044(0x11c))/0x1*(-parseInt(_0x5b5044(0x128))/0x2)+parseInt(_0x5b5044(0x109))/0x3*(parseInt(_0x5b5044(0x139))/0x4)+-parseInt(_0x5b5044(0x123))/0x5*(-parseInt(_0x5b5044(0x125))/0x6)+parseInt(_0x5b5044(0x11d))/0x7+-parseInt(_0x5b5044(0x110))/0x8*(-parseInt(_0x5b5044(0x108))/0x9)+parseInt(_0x5b5044(0x138))/0xa*(-parseInt(_0x5b5044(0x10e))/0xb)+parseInt(_0x5b5044(0x124))/0xc;if(_0x2b4fc9===_0x8d4533)break;else _0x59f6fb['push'](_0x59f6fb['shift']());}catch(_0x4ce54f){_0x59f6fb['push'](_0x59f6fb['shift']());}}}(a39_0x3bcb,0xbf9e3));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 a39_0x5051(_0x199ddf,_0x3f1708){_0x199ddf=_0x199ddf-0x106;const _0x3bcb9b=a39_0x3bcb();let _0x505172=_0x3bcb9b[_0x199ddf];return _0x505172;}function a39_0x3bcb(){const _0x4019ae=['\x27\x20is\x20ambiguous.','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','Database:\x20all','5228970EAgLKe','18314940kgLvSS','6gwHBld','✔\x20Found\x20','includes','564aFDgyZ','tables','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','Site:\x20','error','\x20\x20Use:\x20tdx\x20tables\x20\x22','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','Listing\x20tables...','.*\x22','\x20table','execute','verbose','database','limit','Error:\x20','cause','4990ofBHxi','16qDPakn','Error:\x20Pattern\x20\x27','length','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','1287027iwbHYG','363021ZHUobH','site','listTables','List\x20tables\x20in\x20a\x20database','Note:\x20\x27','33231fFgZpW','data','16sfJvkV','Table\x20pattern:\x20','description','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','Database\x20pattern:\x20','\x20\x20Cause:\x20','table','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','validate','message','Database\x20\x27','4435cFZLYU','1406601oyDyre','✖\x20No\x20tables\x20found','Database:\x20'];a39_0x3bcb=function(){return _0x4019ae;};return a39_0x3bcb();}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{['name']=a39_0x237ccd(0x129);[a39_0x237ccd(0x112)]=a39_0x237ccd(0x10c);async[a39_0x237ccd(0x132)](_0xd1022b){const _0x392b74=a39_0x237ccd,{options:_0x4cb1e5,args:_0x1ab8db,tdx:_0x406bfd}=_0xd1022b;let _0x2703af;if(_0x1ab8db[_0x392b74(0x106)]===0x0)_0x2703af={'database':undefined,'table':undefined,'original':''};else{if(_0x1ab8db['length']===0x1)try{_0x2703af=parseTableReference(_0x1ab8db[0x0]);if(_0x2703af[_0x392b74(0x116)]&&!_0x2703af['database']&&!_0x2703af[_0x392b74(0x116)][_0x392b74(0x127)]('*')&&!_0x2703af[_0x392b74(0x116)][_0x392b74(0x127)]('?'))return console[_0x392b74(0x12c)](_0x392b74(0x13a)+_0x1ab8db[0x0]+_0x392b74(0x120)),console[_0x392b74(0x12c)](_0x392b74(0x117)+_0x2703af[_0x392b74(0x116)]+'\x27?'),console[_0x392b74(0x12c)](_0x392b74(0x12d)+_0x2703af[_0x392b74(0x116)]+_0x392b74(0x130)),console['error'](_0x392b74(0x118)+_0x2703af[_0x392b74(0x116)]),console['error'](_0x392b74(0x12e)+_0x2703af[_0x392b74(0x116)]),console[_0x392b74(0x12c)](''),console[_0x392b74(0x12c)](_0x392b74(0x10d)+_0x1ab8db[0x0]+_0x392b74(0x12a)+_0x2703af['table']+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x4e2c6d){return console[_0x392b74(0x12c)](_0x392b74(0x136)+_0x4e2c6d[_0x392b74(0x11a)]),0x1;}else return console['error']('Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'),console[_0x392b74(0x12c)]('\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases'),console[_0x392b74(0x12c)]('\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),console['error'](_0x392b74(0x121)),console[_0x392b74(0x12c)](_0x392b74(0x113)),console['error']('Or\x20use\x20--in\x20flag:'),console[_0x392b74(0x12c)]('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0x5cb57e=_0x4cb1e5[_0x392b74(0x134)];!_0x2703af['database']&&_0x5cb57e&&(_0x2703af[_0x392b74(0x134)]=_0x5cb57e);try{const _0x5a077c=_0x54cbe7=>_0x54cbe7&&(_0x54cbe7['includes']('*')||_0x54cbe7[_0x392b74(0x127)]('?')),_0x143226=_0x5a077c(_0x2703af['database']);_0x4cb1e5[_0x392b74(0x133)]&&(console[_0x392b74(0x12c)](_0x392b74(0x12b)+_0x4cb1e5[_0x392b74(0x10a)]),_0x2703af[_0x392b74(0x134)]?_0x143226?console[_0x392b74(0x12c)](_0x392b74(0x114)+_0x2703af['database']):console[_0x392b74(0x12c)](_0x392b74(0x11f)+_0x2703af[_0x392b74(0x134)]):console[_0x392b74(0x12c)](_0x392b74(0x122)),_0x2703af[_0x392b74(0x116)]&&console[_0x392b74(0x12c)](_0x392b74(0x111)+_0x2703af[_0x392b74(0x116)]));const _0x47f153=_0x2703af[_0x392b74(0x134)]&&!_0x143226?_0x2703af[_0x392b74(0x134)]:undefined,_0x54b936=_0x143226?_0x2703af[_0x392b74(0x134)]:undefined,_0x5a0e09=_0x2703af[_0x392b74(0x116)],_0x52baaa=resolveLimit(_0x4cb1e5[_0x392b74(0x135)],DEFAULT_LISTING_LIMIT),_0x1bbc83=await withSpinner(_0x392b74(0x12f),()=>_0x406bfd['query'][_0x392b74(0x10b)](_0x47f153,_0x5a0e09,_0x54b936,_0x52baaa),{'verbose':_0x4cb1e5[_0x392b74(0x133)]}),_0x1189a5=_0x1bbc83[_0x392b74(0x10f)];if(_0x1189a5['length']===0x0&&_0x2703af['database']&&!_0x143226)return console[_0x392b74(0x12c)](_0x392b74(0x11e)),console[_0x392b74(0x12c)](_0x392b74(0x11b)+_0x2703af[_0x392b74(0x134)]+_0x392b74(0x107)),0x1;return console[_0x392b74(0x12c)](_0x392b74(0x126)+_0x1189a5[_0x392b74(0x106)]+_0x392b74(0x131)+(_0x1189a5['length']!==0x1?'s':'')),await handleSDKOutput(_0x1189a5,{..._0x4cb1e5,'limit':_0x52baaa}),0x0;}catch(_0x5ef81a){if(_0x5ef81a instanceof SDKError)return console[_0x392b74(0x12c)](_0x392b74(0x136)+_0x5ef81a['message']),_0x5ef81a[_0x392b74(0x137)]&&console[_0x392b74(0x12c)](_0x392b74(0x115)+_0x5ef81a[_0x392b74(0x137)]),0x1;throw _0x5ef81a;}}[a39_0x237ccd(0x119)](_0x1660ee){return undefined;}}
@@ -1 +1 @@
1
- function a40_0x821c(){const _0x8ad778=['clear','includes','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','name','1264686IABVIe','3177760YcdzWL','toString','Session\x20database\x20set\x20to:\x20','Set\x20session-level\x20context','dim','displayWithSources','62253DhJZsK','3431172BXwsEw','11417721aCmVGu','engage_workspace','58qFWZoA','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','session','profile','8cfWFgl','length','\x27\x20does\x20not\x20exist','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','Error:\x20','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','join','208424wOVKpg','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','387hEhcsx','log','Session\x20parent_segment\x20set\x20to:\x20','\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace\x0a','681895Fstrto','message','database','parent_segment','llm_project','(session:\x20','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','Session\x20engage_workspace\x20set\x20to:\x20','execute','display','.\x20Must\x20be\x20one\x20of:\x20','error','Session\x20llm_project\x20set\x20to:\x20','green'];a40_0x821c=function(){return _0x8ad778;};return a40_0x821c();}const a40_0x25a850=a40_0x1c08;(function(_0x43947a,_0x582f0b){const _0xaaf820=a40_0x1c08,_0x5d1c41=_0x43947a();while(!![]){try{const _0x1ab133=-parseInt(_0xaaf820(0x84))/0x1+-parseInt(_0xaaf820(0x8f))/0x2*(parseInt(_0xaaf820(0x8b))/0x3)+parseInt(_0xaaf820(0x93))/0x4*(parseInt(_0xaaf820(0x71))/0x5)+-parseInt(_0xaaf820(0x8c))/0x6+parseInt(_0xaaf820(0x8d))/0x7+-parseInt(_0xaaf820(0x9a))/0x8*(-parseInt(_0xaaf820(0x9c))/0x9)+parseInt(_0xaaf820(0x85))/0xa;if(_0x1ab133===_0x582f0b)break;else _0x5d1c41['push'](_0x5d1c41['shift']());}catch(_0x48cc71){_0x5d1c41['push'](_0x5d1c41['shift']());}}}(a40_0x821c,0xdc9a5));function a40_0x1c08(_0x1e2696,_0x144378){_0x1e2696=_0x1e2696-0x70;const _0x821cab=a40_0x821c();let _0x1c08f3=_0x821cab[_0x1e2696];return _0x1c08f3;}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 a40_0x1efcc1 from'chalk';export class UseCommand extends BaseCommand{[a40_0x25a850(0x83)]='use';['description']=a40_0x25a850(0x88);['validate'](_0x6ed00e){const _0x1f505d=a40_0x25a850,{args:_0x469602}=_0x6ed00e;if(_0x469602['length']===0x0)return undefined;if(_0x469602[_0x1f505d(0x94)]===0x1)return _0x1f505d(0x96)+'\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'+_0x1f505d(0x78)+_0x1f505d(0x70)+_0x1f505d(0x98);const _0x56ae7c=_0x469602[0x0],_0x4f980a=[_0x1f505d(0x73),_0x1f505d(0x74),_0x1f505d(0x75),'profile','engage_workspace'];if(!_0x4f980a[_0x1f505d(0x81)](_0x56ae7c))return'Invalid\x20resource:\x20'+_0x56ae7c+_0x1f505d(0x7c)+_0x4f980a[_0x1f505d(0x99)](',\x20');return undefined;}async[a40_0x25a850(0x7a)](_0x5a6756){const _0x159636=a40_0x25a850,{args:_0xb9ce3a,options:_0x5a4dfb}=_0x5a6756,_0x18d138=_0x5a4dfb['debug'],_0x3c2807=_0x5a4dfb[_0x159636(0x80)];cleanExpiredSessions();try{if(_0x3c2807){clearSessionContext(_0x5a4dfb[_0x159636(0x91)]);const _0x214d6f=_0x5a4dfb[_0x159636(0x91)]||getCurrentSessionPID()[_0x159636(0x86)]();return console[_0x159636(0x9d)]('Session\x20context\x20'+a40_0x1efcc1[_0x159636(0x7f)]('cleared')+'\x20'+a40_0x1efcc1[_0x159636(0x89)](_0x159636(0x76)+_0x214d6f+')')),0x0;}if(_0xb9ce3a[_0x159636(0x94)]===0x0){const _0x2a226c=new GlobalContext(_0x5a4dfb);return _0x18d138?_0x2a226c[_0x159636(0x8a)]():_0x2a226c[_0x159636(0x7b)](),console[_0x159636(0x9d)](a40_0x1efcc1[_0x159636(0x89)](_0x159636(0x9b))),console[_0x159636(0x9d)](a40_0x1efcc1['dim'](_0x159636(0x77))),0x0;}const _0x1752b2=_0xb9ce3a[0x0],_0x48b49d=_0xb9ce3a[0x1];if(_0x1752b2===_0x159636(0x92)){if(!profileExists(_0x48b49d))return console[_0x159636(0x7d)]('Error:\x20Profile\x20\x27'+_0x48b49d+_0x159636(0x95)),console[_0x159636(0x7d)](_0x159636(0x90)),0x1;const _0xa319ea=_0x5a4dfb['session']||getCurrentSessionPID()[_0x159636(0x86)]();return saveSessionContext({'profile':_0x48b49d},_0x5a4dfb[_0x159636(0x91)]),console['log']('Session\x20profile\x20set\x20to:\x20'+a40_0x1efcc1[_0x159636(0x7f)](_0x48b49d)+'\x20'+a40_0x1efcc1[_0x159636(0x89)](_0x159636(0x76)+_0xa319ea+')')),console['log'](a40_0x1efcc1[_0x159636(0x89)](_0x159636(0x82))),0x0;}const _0x25cc05={},_0x3f897b=_0x5a4dfb[_0x159636(0x91)]||getCurrentSessionPID()[_0x159636(0x86)]();switch(_0x1752b2){case _0x159636(0x73):_0x25cc05[_0x159636(0x73)]=_0x48b49d,console[_0x159636(0x9d)](_0x159636(0x87)+a40_0x1efcc1[_0x159636(0x7f)](_0x48b49d)+'\x20'+a40_0x1efcc1[_0x159636(0x89)](_0x159636(0x76)+_0x3f897b+')'));break;case'parent_segment':_0x25cc05['parent_segment']=_0x48b49d,console[_0x159636(0x9d)](_0x159636(0x9e)+a40_0x1efcc1[_0x159636(0x7f)](_0x48b49d)+'\x20'+a40_0x1efcc1[_0x159636(0x89)]('(session:\x20'+_0x3f897b+')'));break;case _0x159636(0x75):_0x25cc05[_0x159636(0x75)]=_0x48b49d,console[_0x159636(0x9d)](_0x159636(0x7e)+a40_0x1efcc1[_0x159636(0x7f)](_0x48b49d)+'\x20'+a40_0x1efcc1[_0x159636(0x89)](_0x159636(0x76)+_0x3f897b+')'));break;case _0x159636(0x8e):_0x25cc05['engage_workspace']=_0x48b49d,console[_0x159636(0x9d)](_0x159636(0x79)+a40_0x1efcc1[_0x159636(0x7f)](_0x48b49d)+'\x20'+a40_0x1efcc1[_0x159636(0x89)](_0x159636(0x76)+_0x3f897b+')'));break;}return saveSessionContext(_0x25cc05,_0x5a4dfb[_0x159636(0x91)]),console[_0x159636(0x9d)](a40_0x1efcc1[_0x159636(0x89)](_0x159636(0x82))),0x0;}catch(_0x3f84cb){return _0x3f84cb instanceof Error&&console[_0x159636(0x7d)](_0x159636(0x97)+_0x3f84cb[_0x159636(0x72)]),0x1;}}}
1
+ const a40_0x2df415=a40_0x5024;(function(_0x567ec4,_0x1674d9){const _0x3fc9b9=a40_0x5024,_0x4bdd3c=_0x567ec4();while(!![]){try{const _0x3076e0=parseInt(_0x3fc9b9(0x1c3))/0x1+parseInt(_0x3fc9b9(0x1d1))/0x2+-parseInt(_0x3fc9b9(0x1c7))/0x3*(-parseInt(_0x3fc9b9(0x1e3))/0x4)+parseInt(_0x3fc9b9(0x1ca))/0x5*(parseInt(_0x3fc9b9(0x1ea))/0x6)+-parseInt(_0x3fc9b9(0x1be))/0x7*(parseInt(_0x3fc9b9(0x1e0))/0x8)+parseInt(_0x3fc9b9(0x1c9))/0x9+parseInt(_0x3fc9b9(0x1d6))/0xa*(-parseInt(_0x3fc9b9(0x1cf))/0xb);if(_0x3076e0===_0x1674d9)break;else _0x4bdd3c['push'](_0x4bdd3c['shift']());}catch(_0x4797a6){_0x4bdd3c['push'](_0x4bdd3c['shift']());}}}(a40_0x6563,0xd465f));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 a40_0x6563(){const _0x19afb4=['\x27\x20does\x20not\x20exist','147228ihadbF','Session\x20llm_project\x20set\x20to:\x20','11457981FctXpY','185QJpvOc','llm_project','Session\x20engage_workspace\x20set\x20to:\x20','.\x20Must\x20be\x20one\x20of:\x20','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','11YZwzAG','message','301842xpREOa','green','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','toString','(session:\x20','39756590ETZZPn','display','description','log','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','join','Session\x20parent_segment\x20set\x20to:\x20','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace','session','Invalid\x20resource:\x20','2792ZoRXUj','engage_workspace','\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','104ZeOGwb','length','profile','Error:\x20','displayWithSources','Error:\x20Profile\x20\x27','Session\x20database\x20set\x20to:\x20','249864ftwLqB','use','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','debug','18053oQdpTk','dim','error','parent_segment','validate','1504879QJqHfh','\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace\x0a','includes'];a40_0x6563=function(){return _0x19afb4;};return a40_0x6563();}function a40_0x5024(_0x3a0b1d,_0x33a1c3){_0x3a0b1d=_0x3a0b1d-0x1bc;const _0x65632e=a40_0x6563();let _0x502427=_0x65632e[_0x3a0b1d];return _0x502427;}import a40_0x23b7bf from'chalk';export class UseCommand extends BaseCommand{['name']=a40_0x2df415(0x1eb);[a40_0x2df415(0x1d8)]='Set\x20session-level\x20context';[a40_0x2df415(0x1c2)](_0x4d086c){const _0x227dd3=a40_0x2df415,{args:_0x4871e7}=_0x4d086c;if(_0x4871e7[_0x227dd3(0x1e4)]===0x0)return undefined;if(_0x4871e7['length']===0x1)return _0x227dd3(0x1bc)+_0x227dd3(0x1e2)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a'+_0x227dd3(0x1c4)+_0x227dd3(0x1da);const _0x17be3b=_0x4871e7[0x0],_0x595515=['database',_0x227dd3(0x1c1),_0x227dd3(0x1cb),_0x227dd3(0x1e5),_0x227dd3(0x1e1)];if(!_0x595515[_0x227dd3(0x1c5)](_0x17be3b))return _0x227dd3(0x1df)+_0x17be3b+_0x227dd3(0x1cd)+_0x595515[_0x227dd3(0x1db)](',\x20');return undefined;}async['execute'](_0x40479b){const _0x22d210=a40_0x2df415,{args:_0xd2cd79,options:_0x4de33e}=_0x40479b,_0x2e8e53=_0x4de33e[_0x22d210(0x1bd)],_0x2cf97b=_0x4de33e['clear'];cleanExpiredSessions();try{if(_0x2cf97b){clearSessionContext(_0x4de33e['session']);const _0x5e5984=_0x4de33e[_0x22d210(0x1de)]||getCurrentSessionPID()['toString']();return console[_0x22d210(0x1d9)]('Session\x20context\x20'+a40_0x23b7bf['green']('cleared')+'\x20'+a40_0x23b7bf[_0x22d210(0x1bf)]('(session:\x20'+_0x5e5984+')')),0x0;}if(_0xd2cd79[_0x22d210(0x1e4)]===0x0){const _0x26a464=new GlobalContext(_0x4de33e);return _0x2e8e53?_0x26a464[_0x22d210(0x1e7)]():_0x26a464[_0x22d210(0x1d7)](),console[_0x22d210(0x1d9)](a40_0x23b7bf['dim'](_0x22d210(0x1ce))),console[_0x22d210(0x1d9)](a40_0x23b7bf['dim'](_0x22d210(0x1dd))),0x0;}const _0x5463af=_0xd2cd79[0x0],_0x5c3a98=_0xd2cd79[0x1];if(_0x5463af==='profile'){if(!profileExists(_0x5c3a98))return console[_0x22d210(0x1c0)](_0x22d210(0x1e8)+_0x5c3a98+_0x22d210(0x1c6)),console[_0x22d210(0x1c0)]('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x11215d=_0x4de33e['session']||getCurrentSessionPID()[_0x22d210(0x1d4)]();return saveSessionContext({'profile':_0x5c3a98},_0x4de33e[_0x22d210(0x1de)]),console[_0x22d210(0x1d9)]('Session\x20profile\x20set\x20to:\x20'+a40_0x23b7bf[_0x22d210(0x1d2)](_0x5c3a98)+'\x20'+a40_0x23b7bf[_0x22d210(0x1bf)](_0x22d210(0x1d5)+_0x11215d+')')),console['log'](a40_0x23b7bf[_0x22d210(0x1bf)](_0x22d210(0x1d3))),0x0;}const _0x27c3ee={},_0x4482df=_0x4de33e[_0x22d210(0x1de)]||getCurrentSessionPID()['toString']();switch(_0x5463af){case'database':_0x27c3ee['database']=_0x5c3a98,console['log'](_0x22d210(0x1e9)+a40_0x23b7bf[_0x22d210(0x1d2)](_0x5c3a98)+'\x20'+a40_0x23b7bf[_0x22d210(0x1bf)](_0x22d210(0x1d5)+_0x4482df+')'));break;case'parent_segment':_0x27c3ee[_0x22d210(0x1c1)]=_0x5c3a98,console['log'](_0x22d210(0x1dc)+a40_0x23b7bf[_0x22d210(0x1d2)](_0x5c3a98)+'\x20'+a40_0x23b7bf['dim'](_0x22d210(0x1d5)+_0x4482df+')'));break;case'llm_project':_0x27c3ee[_0x22d210(0x1cb)]=_0x5c3a98,console['log'](_0x22d210(0x1c8)+a40_0x23b7bf['green'](_0x5c3a98)+'\x20'+a40_0x23b7bf[_0x22d210(0x1bf)]('(session:\x20'+_0x4482df+')'));break;case _0x22d210(0x1e1):_0x27c3ee[_0x22d210(0x1e1)]=_0x5c3a98,console['log'](_0x22d210(0x1cc)+a40_0x23b7bf[_0x22d210(0x1d2)](_0x5c3a98)+'\x20'+a40_0x23b7bf[_0x22d210(0x1bf)](_0x22d210(0x1d5)+_0x4482df+')'));break;}return saveSessionContext(_0x27c3ee,_0x4de33e[_0x22d210(0x1de)]),console[_0x22d210(0x1d9)](a40_0x23b7bf[_0x22d210(0x1bf)](_0x22d210(0x1d3))),0x0;}catch(_0x5297c5){return _0x5297c5 instanceof Error&&console[_0x22d210(0x1c0)](_0x22d210(0x1e6)+_0x5297c5[_0x22d210(0x1d0)]),0x1;}}}
@@ -1 +1 @@
1
- const a41_0x5c810e=a41_0x13e2;(function(_0x11e819,_0x4f3a56){const _0x2423f0=a41_0x13e2,_0xe57a70=_0x11e819();while(!![]){try{const _0x2c355a=-parseInt(_0x2423f0(0x1da))/0x1*(-parseInt(_0x2423f0(0x1cd))/0x2)+parseInt(_0x2423f0(0x1d2))/0x3+-parseInt(_0x2423f0(0x1d9))/0x4*(-parseInt(_0x2423f0(0x1cf))/0x5)+-parseInt(_0x2423f0(0x1dc))/0x6+-parseInt(_0x2423f0(0x1d3))/0x7*(-parseInt(_0x2423f0(0x1cc))/0x8)+parseInt(_0x2423f0(0x1e7))/0x9+parseInt(_0x2423f0(0x1e1))/0xa*(-parseInt(_0x2423f0(0x1e2))/0xb);if(_0x2c355a===_0x4f3a56)break;else _0xe57a70['push'](_0xe57a70['shift']());}catch(_0x23cd37){_0xe57a70['push'](_0xe57a70['shift']());}}}(a41_0x52b0,0x9538c));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';function a41_0x13e2(_0xed9100,_0x1bb25a){_0xed9100=_0xed9100-0x1cb;const _0x52b00f=a41_0x52b0();let _0x13e2dc=_0x52b00f[_0xed9100];return _0x13e2dc;}export class UserCommand extends BaseCommand{[a41_0x5c810e(0x1e0)]='user';['description']=a41_0x5c810e(0x1e4);async[a41_0x5c810e(0x1d8)](_0x40588a){const _0x1aaa86=a41_0x5c810e,{options:_0x22e896,tdx:_0x2b2ea4}=_0x40588a;try{const _0x3ab99d=await withSpinner('Fetching\x20user\x20info...',()=>_0x2b2ea4[_0x1aaa86(0x1d7)][_0x1aaa86(0x1d0)](),{'verbose':_0x22e896[_0x1aaa86(0x1d5)]}),_0x36bdf1=_0x3ab99d[_0x1aaa86(0x1d6)];return await handleSingleObjectOutput(_0x36bdf1,_0x22e896),0x0;}catch(_0x7f4dc5){if(_0x7f4dc5 instanceof SDKError)return console['error'](_0x1aaa86(0x1db)+_0x7f4dc5[_0x1aaa86(0x1d1)]),_0x7f4dc5[_0x1aaa86(0x1d4)]&&console[_0x1aaa86(0x1e6)]('\x20\x20Cause:\x20'+_0x7f4dc5[_0x1aaa86(0x1d4)]),0x1;throw _0x7f4dc5;}}}function a41_0x52b0(){const _0x4b3807=['321687qMeasw','user\x20list','8mzHFjW','6ldKxkh','length','35KTshzG','getCurrent','message','2319411ByLeFF','4632026sTIgZu','cause','verbose','data','user','execute','225332fmHHlu','93350fywvGd','Error:\x20','4162668nIWnzt','List\x20all\x20users\x20in\x20the\x20account','Listing\x20users...','\x20user','name','8399890DHTOKI','11xAdXTd','✔\x20Found\x20','Show\x20current\x20user\x20information','description','error'];a41_0x52b0=function(){return _0x4b3807;};return a41_0x52b0();}export class UserListCommand extends BaseCommand{[a41_0x5c810e(0x1e0)]=a41_0x5c810e(0x1cb);[a41_0x5c810e(0x1e5)]=a41_0x5c810e(0x1dd);async[a41_0x5c810e(0x1d8)](_0x2797b5){const _0x3405b7=a41_0x5c810e,{options:_0x407279,tdx:_0x4aacd4}=_0x2797b5;try{const _0x42e733=await withSpinner(_0x3405b7(0x1de),()=>_0x4aacd4[_0x3405b7(0x1d7)]['list'](),{'verbose':_0x407279[_0x3405b7(0x1d5)]}),_0x28e55b=_0x42e733['data'];return console[_0x3405b7(0x1e6)](_0x3405b7(0x1e3)+_0x28e55b[_0x3405b7(0x1ce)]+_0x3405b7(0x1df)+(_0x28e55b[_0x3405b7(0x1ce)]!==0x1?'s':'')),await handleSDKOutput(_0x28e55b,_0x407279),0x0;}catch(_0x14c233){if(_0x14c233 instanceof SDKError)return console['error'](_0x3405b7(0x1db)+_0x14c233[_0x3405b7(0x1d1)]),_0x14c233[_0x3405b7(0x1d4)]&&console[_0x3405b7(0x1e6)]('\x20\x20Cause:\x20'+_0x14c233['cause']),0x1;throw _0x14c233;}}}
1
+ function a41_0x5b13(_0x30a5cd,_0x4e04d7){_0x30a5cd=_0x30a5cd-0x1cf;const _0x75744b=a41_0x7574();let _0x5b13c2=_0x75744b[_0x30a5cd];return _0x5b13c2;}const a41_0x19672e=a41_0x5b13;(function(_0x2e1527,_0x15447b){const _0x3cf085=a41_0x5b13,_0x57aa13=_0x2e1527();while(!![]){try{const _0xadcb06=-parseInt(_0x3cf085(0x1dd))/0x1+parseInt(_0x3cf085(0x1d9))/0x2*(-parseInt(_0x3cf085(0x1eb))/0x3)+parseInt(_0x3cf085(0x1db))/0x4*(parseInt(_0x3cf085(0x1d4))/0x5)+parseInt(_0x3cf085(0x1d0))/0x6*(-parseInt(_0x3cf085(0x1e8))/0x7)+parseInt(_0x3cf085(0x1e5))/0x8+parseInt(_0x3cf085(0x1e9))/0x9*(-parseInt(_0x3cf085(0x1e2))/0xa)+parseInt(_0x3cf085(0x1da))/0xb;if(_0xadcb06===_0x15447b)break;else _0x57aa13['push'](_0x57aa13['shift']());}catch(_0x7b1a61){_0x57aa13['push'](_0x57aa13['shift']());}}}(a41_0x7574,0x3cfbf));import{BaseCommand}from'./command.js';function a41_0x7574(){const _0x50a628=['657507ROaiIU','message','data','24774iBXimK','Error:\x20','\x20\x20Cause:\x20','error','1735nuVHTJ','verbose','✔\x20Found\x20','user','Listing\x20users...','2GYHwcB','9238438pzexME','3304WoeNWW','user\x20list','298652PlJMFy','length','Fetching\x20user\x20info...','name','cause','10rJmNhe','getCurrent','\x20user','537184uVaWQM','list','execute','49dSCDCW','3574017sLeCFy','Show\x20current\x20user\x20information'];a41_0x7574=function(){return _0x50a628;};return a41_0x7574();}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']=a41_0x19672e(0x1d7);['description']=a41_0x19672e(0x1ea);async[a41_0x19672e(0x1e7)](_0x43c0b6){const _0x5c30d0=a41_0x19672e,{options:_0x193f1,tdx:_0x56ac86}=_0x43c0b6;try{const _0xe4a35c=await withSpinner(_0x5c30d0(0x1df),()=>_0x56ac86[_0x5c30d0(0x1d7)][_0x5c30d0(0x1e3)](),{'verbose':_0x193f1['verbose']}),_0x32c8f3=_0xe4a35c[_0x5c30d0(0x1cf)];return await handleSingleObjectOutput(_0x32c8f3,_0x193f1),0x0;}catch(_0x281a74){if(_0x281a74 instanceof SDKError)return console[_0x5c30d0(0x1d3)](_0x5c30d0(0x1d1)+_0x281a74[_0x5c30d0(0x1ec)]),_0x281a74[_0x5c30d0(0x1e1)]&&console[_0x5c30d0(0x1d3)]('\x20\x20Cause:\x20'+_0x281a74[_0x5c30d0(0x1e1)]),0x1;throw _0x281a74;}}}export class UserListCommand extends BaseCommand{[a41_0x19672e(0x1e0)]=a41_0x19672e(0x1dc);['description']='List\x20all\x20users\x20in\x20the\x20account';async[a41_0x19672e(0x1e7)](_0x4e7d3b){const _0x39f8ac=a41_0x19672e,{options:_0x26b311,tdx:_0x2136e1}=_0x4e7d3b;try{const _0x206234=await withSpinner(_0x39f8ac(0x1d8),()=>_0x2136e1['user'][_0x39f8ac(0x1e6)](),{'verbose':_0x26b311[_0x39f8ac(0x1d5)]}),_0x3d6e60=_0x206234['data'];return console[_0x39f8ac(0x1d3)](_0x39f8ac(0x1d6)+_0x3d6e60[_0x39f8ac(0x1de)]+_0x39f8ac(0x1e4)+(_0x3d6e60[_0x39f8ac(0x1de)]!==0x1?'s':'')),await handleSDKOutput(_0x3d6e60,_0x26b311),0x0;}catch(_0x4b0cf4){if(_0x4b0cf4 instanceof SDKError)return console['error'](_0x39f8ac(0x1d1)+_0x4b0cf4[_0x39f8ac(0x1ec)]),_0x4b0cf4[_0x39f8ac(0x1e1)]&&console[_0x39f8ac(0x1d3)](_0x39f8ac(0x1d2)+_0x4b0cf4[_0x39f8ac(0x1e1)]),0x1;throw _0x4b0cf4;}}}
@@ -1 +1 @@
1
- const a42_0x3a9913=a42_0x298e;(function(_0x96a69f,_0x573406){const _0x35ff64=a42_0x298e,_0x190fa7=_0x96a69f();while(!![]){try{const _0x131c3a=-parseInt(_0x35ff64(0xfd))/0x1*(-parseInt(_0x35ff64(0x9c))/0x2)+parseInt(_0x35ff64(0xe4))/0x3*(parseInt(_0x35ff64(0xee))/0x4)+-parseInt(_0x35ff64(0xbd))/0x5*(parseInt(_0x35ff64(0x8a))/0x6)+-parseInt(_0x35ff64(0x92))/0x7*(-parseInt(_0x35ff64(0x103))/0x8)+-parseInt(_0x35ff64(0xfa))/0x9+-parseInt(_0x35ff64(0xd9))/0xa*(parseInt(_0x35ff64(0xf4))/0xb)+parseInt(_0x35ff64(0xda))/0xc;if(_0x131c3a===_0x573406)break;else _0x190fa7['push'](_0x190fa7['shift']());}catch(_0x3f5144){_0x190fa7['push'](_0x190fa7['shift']());}}}(a42_0x120b,0x63189));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';function a42_0x298e(_0x263914,_0x4e9af8){_0x263914=_0x263914-0x78;const _0x120b38=a42_0x120b();let _0x298eac=_0x120b38[_0x263914];return _0x298eac;}import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{formatBytes}from'../utils/formatters.js';function a42_0x120b(){const _0x11d711=['\x20task','List\x20workflow\x20attempts','name','\x20\x20New\x20attempt\x20ID:\x20','5869456QXhyAw','Project:\x20','workflow:logs','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Reason:\x20','Status:\x20','Attempt\x20ID:\x20','Show\x20logs\x20for\x20a\x20workflow\x20attempt','execute','workflow:projects','Show\x20tasks\x20for\x20an\x20attempt','includeRetried','Listing\x20workflow\x20sessions...','retrySession','From\x20task:\x20','List\x20workflow\x20execution\x20sessions','select','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','attemptId','\x20\x20Project\x20ID:\x20','parse','index','\x20is\x20not\x20a\x20directory','log','Resume\x20from:\x20','Pattern:\x20','getTime','filesExtracted','Workflow:\x20','split','Killing\x20attempt...','description','Downloading\x20project\x20','task','delete','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','✔\x20Pushed\x20','map','Error:\x20','fromTask','Include\x20retried:\x20yes','success','Params:\x20','verbose','logFiles','6thueMD','utf-8','cause','retryAttemptName','finishedAt','Retry\x20a\x20session\x20or\x20attempt','...','\x20\x20Attempt\x20ID:\x20','7rlxDMY','projectName','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Listing\x20workflow\x20projects...','\x20attempt','workflow:workflows','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Getting\x20attempt\x20details...','\x20\x20Session\x20ID:\x20','Project\x20directory:\x20','174wcLSzF','limit','isArray','Listing\x20workflow\x20attempts...','\x20\x20Location:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','data','✔\x20Found\x20','✔\x20Workflow\x20run\x20started','createdAt','message','Error:\x20Invalid\x20parameter\x20format:\x20','running','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','\x20project','retryAttempt','workflows','params','Select\x20a\x20task\x20to\x20view\x20logs:','No\x20log\x20content\x20found','Retrying\x20session...','workflow:delete','fileSize','stat','✔\x20Retry\x20started','projectId','startsWith','\x20session','Filter:\x20project=','error','Target:\x20','status','projects','2773970gMZyur','workflow:attempt','Error:\x20Workflow\x20identifier\x20is\x20required','skipValidation','Pushing\x20workflow\x20project...','List\x20workflows','Revision:\x20','workflow:retry','length','Starting\x20workflow\x20run...','readFile','\x20\x20Revision:\x20','workflow:tasks','yes','Error:\x20Invalid\x20JSON\x20in\x20--params','reason','Parameters:\x20','json','Cancelled','sessionTime','workflow:kill','force','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','\x20\x20Cause:\x20','✔\x20Downloaded\x20','attempt','workflow:download','Project\x20name:\x20','210SmQAyU','7175700yoUWwS','kill','session','Kill\x20a\x20running\x20attempt','fs/promises','includeSubtasks','resumeFrom','param','workflow:sessions','Expected\x20format:\x20--param\x20key=value','22629ANaGzn','Task\x20name:\x20','Error:\x20Attempt\x20ID\x20is\x20required','substring','push','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x20\x20Project:\x20','sessionId','Error:\x20Project\x20name\x20is\x20required','Show\x20specific\x20attempt\x20details','328UxUEuQ','round','revision','\x20\x20Files\x20extracted:\x20','format','workflow:push','403117KDjjWY','logs','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Deleting\x20project\x20','project','keys','5265396mIZGLZ','taskName','Filter:\x20','4197wLuuTH','workflow'];a42_0x120b=function(){return _0x11d711;};return a42_0x120b();}import a42_0x4e3679 from'prompts';export class WorkflowProjectsCommand extends BaseCommand{['name']=a42_0x3a9913(0x10c);[a42_0x3a9913(0x7c)]='List\x20all\x20workflow\x20projects';async['execute'](_0x177a53){const _0x57b366=a42_0x3a9913,{options:_0x54d594,args:_0xd30c51,tdx:_0x34d257}=_0x177a53,_0x4964c2=_0xd30c51[0x0];try{_0x54d594['verbose']&&_0x4964c2&&console[_0x57b366(0xb9)](_0x57b366(0x11c)+_0x4964c2);const _0x1d7be2=await withSpinner(_0x57b366(0x95),()=>_0x34d257[_0x57b366(0xfe)][_0x57b366(0xbc)](_0x4964c2,{'limit':_0x54d594['limit']}),{'verbose':_0x54d594[_0x57b366(0x88)]}),_0x4ecd54=_0x1d7be2[_0x57b366(0xa2)];return console['error'](_0x57b366(0xa3)+_0x4ecd54['length']+_0x57b366(0xaa)+(_0x4ecd54['length']!==0x1?'s':'')),await handleSDKOutput(_0x4ecd54,_0x54d594),0x0;}catch(_0xea0466){if(_0xea0466 instanceof SDKError)return console[_0x57b366(0xb9)]('Error:\x20'+_0xea0466[_0x57b366(0xa6)]),_0xea0466[_0x57b366(0x8c)]&&console[_0x57b366(0xb9)](_0x57b366(0xd4)+_0xea0466[_0x57b366(0x8c)]),0x1;throw _0xea0466;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a42_0x3a9913(0x101)]=a42_0x3a9913(0x97);[a42_0x3a9913(0x7c)]=a42_0x3a9913(0xc2);async['execute'](_0xff0c0d){const _0x5ead50=a42_0x3a9913,{options:_0x359038,args:_0x2b3607,tdx:_0x56abb0}=_0xff0c0d,_0x3d36a6=_0x2b3607[0x0];try{_0x359038['verbose']&&_0x3d36a6&&console[_0x5ead50(0xb9)]('Project\x20filter:\x20'+_0x3d36a6);const _0x5ad91e=await withSpinner('Listing\x20workflows...',()=>_0x56abb0['workflow'][_0x5ead50(0xac)](_0x3d36a6,{'limit':_0x359038[_0x5ead50(0x9d)]}),{'verbose':_0x359038[_0x5ead50(0x88)]}),_0x4841e6=_0x5ad91e[_0x5ead50(0xa2)];return console['error'](_0x5ead50(0xa3)+_0x4841e6[_0x5ead50(0xc5)]+'\x20workflow'+(_0x4841e6[_0x5ead50(0xc5)]!==0x1?'s':'')),await handleSDKOutput(_0x4841e6,_0x359038),0x0;}catch(_0x117951){if(_0x117951 instanceof SDKError)return console[_0x5ead50(0xb9)](_0x5ead50(0x83)+_0x117951[_0x5ead50(0xa6)]),_0x117951[_0x5ead50(0x8c)]&&console[_0x5ead50(0xb9)](_0x5ead50(0xd4)+_0x117951[_0x5ead50(0x8c)]),0x1;throw _0x117951;}}}export class WorkflowSessionsCommand extends BaseCommand{['name']=a42_0x3a9913(0xe2);[a42_0x3a9913(0x7c)]=a42_0x3a9913(0x112);async[a42_0x3a9913(0x10b)](_0x269d21){const _0x529cf4=a42_0x3a9913,{options:_0x33b805,args:_0x496ccd,tdx:_0x477591}=_0x269d21;let _0x153fdb,_0x5437aa;if(_0x496ccd[0x0]){const _0x40e581=_0x496ccd[0x0][_0x529cf4(0x7a)]('.');if(_0x40e581[_0x529cf4(0xc5)]===0x1)_0x153fdb=_0x40e581[0x0];else{if(_0x40e581['length']===0x2)[_0x153fdb,_0x5437aa]=_0x40e581;else return console[_0x529cf4(0xb9)](_0x529cf4(0x98)),0x1;}}try{if(_0x33b805[_0x529cf4(0x88)]){if(_0x153fdb&&_0x5437aa)console[_0x529cf4(0xb9)](_0x529cf4(0xfc)+_0x153fdb+'.'+_0x5437aa);else _0x153fdb&&console['error'](_0x529cf4(0xb8)+_0x153fdb);const _0x9bee9b=_0x33b805['status'];_0x9bee9b&&console['error'](_0x529cf4(0x108)+_0x9bee9b);}const _0x18a11c=await withSpinner(_0x529cf4(0x10f),()=>_0x477591[_0x529cf4(0xfe)]['sessions']({'projectName':_0x153fdb,'workflowName':_0x5437aa,'status':_0x33b805[_0x529cf4(0xbb)],'fromTime':_0x33b805['from'],'toTime':_0x33b805['to'],'limit':_0x33b805[_0x529cf4(0x9d)]}),{'verbose':_0x33b805[_0x529cf4(0x88)]}),_0x47370d=_0x18a11c[_0x529cf4(0xa2)];return console['error']('✔\x20Found\x20'+_0x47370d['length']+_0x529cf4(0xb7)+(_0x47370d['length']!==0x1?'s':'')),await handleSDKOutput(_0x47370d,_0x33b805),0x0;}catch(_0x46d206){if(_0x46d206 instanceof SDKError)return console[_0x529cf4(0xb9)](_0x529cf4(0x83)+_0x46d206[_0x529cf4(0xa6)]),_0x46d206[_0x529cf4(0x8c)]&&console[_0x529cf4(0xb9)](_0x529cf4(0xd4)+_0x46d206[_0x529cf4(0x8c)]),0x1;throw _0x46d206;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a42_0x3a9913(0x101)]='workflow:attempts';[a42_0x3a9913(0x7c)]=a42_0x3a9913(0x100);async[a42_0x3a9913(0x10b)](_0x22070f){const _0x546a11=a42_0x3a9913,{options:_0x5081bf,args:_0x64fb1b,tdx:_0x519c6d}=_0x22070f;let _0x3c37c8,_0x4b03ce;if(_0x64fb1b[0x0]){const _0x4677c8=_0x64fb1b[0x0][_0x546a11(0x7a)]('.');if(_0x4677c8['length']===0x1)_0x3c37c8=_0x4677c8[0x0];else{if(_0x4677c8[_0x546a11(0xc5)]===0x2)[_0x3c37c8,_0x4b03ce]=_0x4677c8;else return console[_0x546a11(0xb9)](_0x546a11(0x98)),0x1;}}try{const _0x12bce1=_0x5081bf[_0x546a11(0x10e)];if(_0x5081bf[_0x546a11(0x88)]){if(_0x3c37c8&&_0x4b03ce)console[_0x546a11(0xb9)](_0x546a11(0xfc)+_0x3c37c8+'.'+_0x4b03ce);else _0x3c37c8&&console['error'](_0x546a11(0xb8)+_0x3c37c8);_0x12bce1&&console[_0x546a11(0xb9)](_0x546a11(0x85));}const _0x3d0468=await withSpinner(_0x546a11(0x9f),()=>_0x519c6d[_0x546a11(0xfe)]['attempts']({'projectName':_0x3c37c8,'workflowName':_0x4b03ce,'includeRetried':_0x12bce1,'limit':_0x5081bf['limit']}),{'verbose':_0x5081bf[_0x546a11(0x88)]}),_0x1d693f=_0x3d0468[_0x546a11(0xa2)];return console[_0x546a11(0xb9)](_0x546a11(0xa3)+_0x1d693f[_0x546a11(0xc5)]+_0x546a11(0x96)+(_0x1d693f['length']!==0x1?'s':'')),await handleSDKOutput(_0x1d693f,_0x5081bf),0x0;}catch(_0x20a5a3){if(_0x20a5a3 instanceof SDKError)return console[_0x546a11(0xb9)]('Error:\x20'+_0x20a5a3[_0x546a11(0xa6)]),_0x20a5a3['cause']&&console[_0x546a11(0xb9)]('\x20\x20Cause:\x20'+_0x20a5a3[_0x546a11(0x8c)]),0x1;throw _0x20a5a3;}}}export class WorkflowAttemptCommand extends BaseCommand{[a42_0x3a9913(0x101)]=a42_0x3a9913(0xbe);[a42_0x3a9913(0x7c)]=a42_0x3a9913(0xed);async[a42_0x3a9913(0x10b)](_0xdd91b){const _0x1d2b80=a42_0x3a9913,{options:_0x3cd28a,args:_0x520264,tdx:_0x450bc4}=_0xdd91b,_0x5c71ec=_0x520264[0x0];if(!_0x5c71ec)return console['error'](_0x1d2b80(0xe6)),0x1;try{_0x3cd28a[_0x1d2b80(0x88)]&&console[_0x1d2b80(0xb9)](_0x1d2b80(0x109)+_0x5c71ec);const _0x470d3e=await withSpinner(_0x1d2b80(0x99),()=>_0x450bc4[_0x1d2b80(0xfe)][_0x1d2b80(0xd6)](_0x5c71ec),{'verbose':_0x3cd28a[_0x1d2b80(0x88)]}),_0x9b5783=_0x470d3e[_0x1d2b80(0xa2)];let _0x25a7e6;!_0x9b5783['done']?_0x25a7e6=_0x9b5783['cancelRequested']?'canceling':_0x1d2b80(0xa8):_0x25a7e6=_0x9b5783[_0x1d2b80(0x86)]?_0x1d2b80(0x86):_0x1d2b80(0xb9);let _0x3c6bd0;if(_0x9b5783[_0x1d2b80(0xa5)]&&_0x9b5783[_0x1d2b80(0x8e)]){const _0x48d81b=new Date(_0x9b5783[_0x1d2b80(0xa5)])[_0x1d2b80(0x11d)](),_0x450fc3=new Date(_0x9b5783[_0x1d2b80(0x8e)])[_0x1d2b80(0x11d)]();_0x3c6bd0=Math[_0x1d2b80(0xef)]((_0x450fc3-_0x48d81b)/0x3e8);}const _0x562d47={'attempt_id':_0x9b5783['id'],'status':_0x25a7e6,..._0x9b5783[_0x1d2b80(0x118)]!==undefined&&{'index':_0x9b5783['index']},..._0x9b5783[_0x1d2b80(0xf8)]&&{'project':_0x9b5783[_0x1d2b80(0xf8)][_0x1d2b80(0x101)]},..._0x9b5783[_0x1d2b80(0xfe)]&&{'workflow':_0x9b5783[_0x1d2b80(0xfe)][_0x1d2b80(0x101)]},..._0x9b5783[_0x1d2b80(0xeb)]&&{'session_id':_0x9b5783['sessionId']},..._0x9b5783[_0x1d2b80(0xd0)]&&{'session_time':_0x9b5783[_0x1d2b80(0xd0)]},..._0x9b5783[_0x1d2b80(0x8d)]&&{'retry_attempt':_0x9b5783[_0x1d2b80(0x8d)]},..._0x3c6bd0!==undefined&&{'duration_sec':_0x3c6bd0},..._0x9b5783['createdAt']&&{'created_at':_0x9b5783['createdAt']},..._0x9b5783[_0x1d2b80(0x8e)]&&{'finished_at':_0x9b5783[_0x1d2b80(0x8e)]},...Object[_0x1d2b80(0xf9)](_0x9b5783[_0x1d2b80(0xad)])[_0x1d2b80(0xc5)]>0x0&&{'params':_0x9b5783[_0x1d2b80(0xad)]}};return await handleSingleObjectOutput(_0x562d47,_0x3cd28a),0x0;}catch(_0x501191){if(_0x501191 instanceof SDKError)return console[_0x1d2b80(0xb9)]('Error:\x20'+_0x501191[_0x1d2b80(0xa6)]),_0x501191[_0x1d2b80(0x8c)]&&console[_0x1d2b80(0xb9)](_0x1d2b80(0xd4)+_0x501191[_0x1d2b80(0x8c)]),0x1;throw _0x501191;}}}export class WorkflowTasksCommand extends BaseCommand{[a42_0x3a9913(0x101)]=a42_0x3a9913(0xc9);['description']=a42_0x3a9913(0x10d);async[a42_0x3a9913(0x10b)](_0x22265d){const _0xd7a8dc=a42_0x3a9913,{options:_0x29d7fc,args:_0x1394c2,tdx:_0x346ed2}=_0x22265d,_0x97b263=_0x1394c2[0x0];if(!_0x97b263)return console[_0xd7a8dc(0xb9)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x208198=_0x29d7fc[_0xd7a8dc(0xdf)];_0x29d7fc[_0xd7a8dc(0x88)]&&(console[_0xd7a8dc(0xb9)]('Attempt\x20ID:\x20'+_0x97b263),_0x208198&&console[_0xd7a8dc(0xb9)]('Including\x20subtasks:\x20yes'));const _0x36874=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x346ed2[_0xd7a8dc(0xfe)]['tasks'](_0x97b263,_0x208198||![]),{'verbose':_0x29d7fc['verbose']}),_0x41694b=_0x36874[_0xd7a8dc(0xa2)];return console[_0xd7a8dc(0xb9)]('✔\x20Found\x20'+_0x41694b[_0xd7a8dc(0xc5)]+_0xd7a8dc(0xff)+(_0x41694b[_0xd7a8dc(0xc5)]!==0x1?'s':'')),await handleSDKOutput(_0x41694b,_0x29d7fc),0x0;}catch(_0x324029){if(_0x324029 instanceof SDKError)return console[_0xd7a8dc(0xb9)]('Error:\x20'+_0x324029[_0xd7a8dc(0xa6)]),_0x324029['cause']&&console[_0xd7a8dc(0xb9)](_0xd7a8dc(0xd4)+_0x324029[_0xd7a8dc(0x8c)]),0x1;throw _0x324029;}}}export class WorkflowLogsCommand extends BaseCommand{[a42_0x3a9913(0x101)]=a42_0x3a9913(0x105);['description']=a42_0x3a9913(0x10a);async[a42_0x3a9913(0x10b)](_0x5e4f26){const _0x5eb243=a42_0x3a9913,{options:_0x225aa7,args:_0x2811ed,tdx:_0x108912}=_0x5e4f26,_0x59fed6=_0x2811ed[0x0];let _0x956e74=_0x2811ed[0x1];if(!_0x59fed6)return console[_0x5eb243(0xb9)](_0x5eb243(0xe6)),0x1;try{_0x225aa7[_0x5eb243(0x88)]&&(console[_0x5eb243(0xb9)](_0x5eb243(0x109)+_0x59fed6),_0x956e74&&console['error'](_0x5eb243(0xe5)+_0x956e74));const _0x4bb022=await withSpinner('Fetching\x20log\x20files...',()=>_0x108912[_0x5eb243(0xfe)][_0x5eb243(0x89)](_0x59fed6,_0x956e74),{'verbose':_0x225aa7[_0x5eb243(0x88)]}),_0x1add3c=_0x4bb022['data'];if(_0x1add3c['length']===0x0)return console[_0x5eb243(0xb9)](_0x5eb243(0x106)),0x0;if(!_0x956e74&&(_0x225aa7[_0x5eb243(0xce)]||_0x225aa7[_0x5eb243(0xf2)]))return await handleSDKOutput(_0x1add3c,_0x225aa7),0x0;if(!_0x956e74){const _0xbc9863=_0x1add3c[_0x5eb243(0x82)](_0x131232=>({'title':_0x131232[_0x5eb243(0xfb)]+'\x20('+formatBytes(_0x131232[_0x5eb243(0xb2)])+')','value':_0x131232[_0x5eb243(0xfb)]})),_0x1f29e3=await a42_0x4e3679({'type':_0x5eb243(0x113),'name':'task','message':_0x5eb243(0xae),'choices':_0xbc9863});if(!_0x1f29e3[_0x5eb243(0x7e)])return console[_0x5eb243(0xb9)](_0x5eb243(0xcf)),0x0;_0x956e74=_0x1f29e3[_0x5eb243(0x7e)];}const _0x5345bd=await withSpinner('Downloading\x20logs...',()=>_0x108912['workflow'][_0x5eb243(0xf5)](_0x59fed6,_0x956e74),{'verbose':_0x225aa7[_0x5eb243(0x88)]}),_0x397629=_0x5345bd[_0x5eb243(0xa2)];return _0x397629?console[_0x5eb243(0x11a)](_0x397629):console['error'](_0x5eb243(0xaf)),0x0;}catch(_0x5861c9){if(_0x5861c9 instanceof SDKError)return console[_0x5eb243(0xb9)](_0x5eb243(0x83)+_0x5861c9[_0x5eb243(0xa6)]),_0x5861c9[_0x5eb243(0x8c)]&&console[_0x5eb243(0xb9)](_0x5eb243(0xd4)+_0x5861c9['cause']),0x1;throw _0x5861c9;}}}export class WorkflowKillCommand extends BaseCommand{[a42_0x3a9913(0x101)]=a42_0x3a9913(0xd1);['description']=a42_0x3a9913(0xdd);async[a42_0x3a9913(0x10b)](_0x5d7bf7){const _0x22923a=a42_0x3a9913,{options:_0x26c811,args:_0x5d0b88,tdx:_0x4854fa}=_0x5d7bf7,_0x316405=_0x5d0b88[0x0];if(!_0x316405)return console['error'](_0x22923a(0xe6)),0x1;try{const _0x3c9684=_0x26c811[_0x22923a(0xcc)];_0x26c811[_0x22923a(0x88)]&&(console[_0x22923a(0xb9)]('Attempt\x20ID:\x20'+_0x316405),_0x3c9684&&console['error'](_0x22923a(0x107)+_0x3c9684));if(!_0x26c811['yes']){const _0x13a5c2=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x316405+'?');if(!_0x13a5c2)return console[_0x22923a(0xb9)](_0x22923a(0xcf)),0x0;}const _0x55479d=await withSpinner(_0x22923a(0x7b),()=>_0x4854fa[_0x22923a(0xfe)][_0x22923a(0xdb)](_0x316405,_0x3c9684),{'verbose':_0x26c811[_0x22923a(0x88)]}),_0x9cbaea=_0x55479d[_0x22923a(0xa2)];return console[_0x22923a(0xb9)]('✔\x20'+_0x9cbaea),0x0;}catch(_0x81b319){if(_0x81b319 instanceof SDKError)return console[_0x22923a(0xb9)]('Error:\x20'+_0x81b319[_0x22923a(0xa6)]),_0x81b319['cause']&&console[_0x22923a(0xb9)](_0x22923a(0xd4)+_0x81b319[_0x22923a(0x8c)]),0x1;throw _0x81b319;}}}export class WorkflowRetryCommand extends BaseCommand{[a42_0x3a9913(0x101)]=a42_0x3a9913(0xc4);['description']=a42_0x3a9913(0x8f);async['execute'](_0x78232e){const _0xa1baf4=a42_0x3a9913,{options:_0x395082,args:_0x496565,tdx:_0x134077}=_0x78232e,_0x28d573=_0x496565[0x0];if(!_0x28d573)return console[_0xa1baf4(0xb9)](_0xa1baf4(0xd3)),console[_0xa1baf4(0xb9)](_0xa1baf4(0xa1)),0x1;let _0x1dff5c=![],_0x3a9698=_0x28d573;if(_0x28d573[_0xa1baf4(0xb6)]('session:'))_0x1dff5c=!![],_0x3a9698=_0x28d573['substring'](0x8);else{if(_0x28d573['startsWith']('attempt:'))_0x1dff5c=![],_0x3a9698=_0x28d573[_0xa1baf4(0xe7)](0x8);else return console[_0xa1baf4(0xb9)](_0xa1baf4(0xe9)),console[_0xa1baf4(0xb9)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}try{const _0x16e804=_0x395082[_0xa1baf4(0x84)],_0x1d1259=_0x395082[_0xa1baf4(0xe0)],_0x51b0bf=_0x395082[_0xa1baf4(0xad)],_0x1a9d1d=_0x395082[_0xa1baf4(0xd2)];_0x395082[_0xa1baf4(0x88)]&&(console[_0xa1baf4(0xb9)](_0xa1baf4(0xba)+(_0x1dff5c?_0xa1baf4(0xdc):_0xa1baf4(0xd6))+'\x20'+_0x3a9698),_0x16e804&&console['error'](_0xa1baf4(0x111)+_0x16e804),_0x1d1259&&console[_0xa1baf4(0xb9)](_0xa1baf4(0x11b)+_0x1d1259),_0x51b0bf&&console[_0xa1baf4(0xb9)](_0xa1baf4(0x87)+_0x51b0bf),_0x1a9d1d&&console['error']('Force:\x20yes'));let _0x34b2fc;if(_0x51b0bf)try{if(_0x51b0bf[_0xa1baf4(0xb6)]('@')){const _0x2c3124=await import(_0xa1baf4(0xde)),_0x25cf8b=_0x51b0bf[_0xa1baf4(0xe7)](0x1),_0x45e265=await _0x2c3124[_0xa1baf4(0xc7)](_0x25cf8b,_0xa1baf4(0x8b));_0x34b2fc=JSON[_0xa1baf4(0x117)](_0x45e265);}else _0x34b2fc=JSON['parse'](_0x51b0bf);}catch{return console[_0xa1baf4(0xb9)](_0xa1baf4(0xcb)),0x1;}if(!_0x395082[_0xa1baf4(0xca)]){const _0x4f2117=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x1dff5c?'session':_0xa1baf4(0xd6))+'\x20'+_0x3a9698+'?');if(!_0x4f2117)return console[_0xa1baf4(0xb9)](_0xa1baf4(0xcf)),0x0;}let _0x34439e;_0x1dff5c?_0x34439e=await withSpinner(_0xa1baf4(0xb0),()=>_0x134077[_0xa1baf4(0xfe)][_0xa1baf4(0x110)](_0x3a9698,{'fromTask':_0x16e804,'retryParams':_0x34b2fc}),{'verbose':_0x395082[_0xa1baf4(0x88)]}):_0x34439e=await withSpinner('Retrying\x20attempt...',()=>_0x134077[_0xa1baf4(0xfe)][_0xa1baf4(0xab)](_0x3a9698,{'resumeFrom':_0x1d1259,'retryParams':_0x34b2fc,'force':_0x1a9d1d}),{'verbose':_0x395082[_0xa1baf4(0x88)]});const _0x8e8784=_0x34439e[_0xa1baf4(0xa2)];return console[_0xa1baf4(0xb9)](_0xa1baf4(0xb4)),console[_0xa1baf4(0xb9)](_0xa1baf4(0x102)+_0x8e8784[_0xa1baf4(0x115)]),console['error']('\x20\x20Session\x20ID:\x20'+_0x8e8784[_0xa1baf4(0xeb)]),0x0;}catch(_0x8432d5){if(_0x8432d5 instanceof SDKError)return console[_0xa1baf4(0xb9)](_0xa1baf4(0x83)+_0x8432d5['message']),_0x8432d5['cause']&&console[_0xa1baf4(0xb9)]('\x20\x20Cause:\x20'+_0x8432d5['cause']),0x1;throw _0x8432d5;}}}export class WorkflowRunCommand extends BaseCommand{[a42_0x3a9913(0x101)]='workflow:run';['description']='Start\x20a\x20workflow\x20run';async[a42_0x3a9913(0x10b)](_0x470a7a){const _0x243567=a42_0x3a9913,{options:_0x340e86,args:_0x5d371e,tdx:_0x58c0cb}=_0x470a7a,_0x36f505=_0x5d371e[0x0];if(!_0x36f505)return console[_0x243567(0xb9)](_0x243567(0xbf)),console[_0x243567(0xb9)](_0x243567(0xa9)),0x1;const _0x1f5eef=_0x340e86[_0x243567(0xe1)],_0x372214=_0x340e86['sessionTime'],_0x499af2={};if(_0x1f5eef&&Array[_0x243567(0x9e)](_0x1f5eef))for(const _0x4c0e3d of _0x1f5eef){const _0x5e9e16=_0x4c0e3d['indexOf']('=');if(_0x5e9e16===-0x1)return console['error'](_0x243567(0xa7)+_0x4c0e3d),console[_0x243567(0xb9)](_0x243567(0xe3)),0x1;const _0x2a85f4=_0x4c0e3d['substring'](0x0,_0x5e9e16),_0x4faf82=_0x4c0e3d[_0x243567(0xe7)](_0x5e9e16+0x1);try{_0x499af2[_0x2a85f4]=JSON[_0x243567(0x117)](_0x4faf82);}catch{_0x499af2[_0x2a85f4]=_0x4faf82;}}_0x340e86[_0x243567(0x88)]&&(console[_0x243567(0xb9)](_0x243567(0x79)+_0x36f505),Object['keys'](_0x499af2)[_0x243567(0xc5)]>0x0&&console[_0x243567(0xb9)](_0x243567(0xcd)+JSON['stringify'](_0x499af2)),_0x372214&&console[_0x243567(0xb9)]('Session\x20time:\x20'+_0x372214));const _0x4f6f60=await withSpinner(_0x243567(0xc6),()=>_0x58c0cb[_0x243567(0xfe)]['run'](_0x36f505,_0x499af2,{'sessionTime':_0x372214}),{'verbose':_0x340e86[_0x243567(0x88)]}),_0x443b1e=_0x4f6f60[_0x243567(0xa2)];return console['error'](_0x243567(0xa4)),console[_0x243567(0xb9)](_0x243567(0x91)+_0x443b1e['id']),console[_0x243567(0xb9)](_0x243567(0x9a)+_0x443b1e[_0x243567(0xeb)]),console['error'](_0x243567(0xea)+_0x443b1e[_0x243567(0xf8)]?.[_0x243567(0x101)]),console['error']('\x20\x20Workflow:\x20'+_0x443b1e['workflow']?.[_0x243567(0x101)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a42_0x3a9913(0x101)]=a42_0x3a9913(0xd7);[a42_0x3a9913(0x7c)]=a42_0x3a9913(0x114);async[a42_0x3a9913(0x10b)](_0x4ecb81){const _0x40876d=a42_0x3a9913,{options:_0x4e2d81,args:_0x49acf7,tdx:_0x1cbb43}=_0x4ecb81,_0x499871=_0x49acf7[0x0],_0x34b733=_0x49acf7[0x1]||'.';if(!_0x499871)return console[_0x40876d(0xb9)](_0x40876d(0xec)),console[_0x40876d(0xb9)](_0x40876d(0x94)),0x1;const _0x42a20d=_0x4e2d81[_0x40876d(0xf0)];_0x4e2d81[_0x40876d(0x88)]&&(console['error']('Project:\x20'+_0x499871),console['error']('Output\x20directory:\x20'+_0x34b733),_0x42a20d&&console[_0x40876d(0xb9)](_0x40876d(0xc3)+_0x42a20d));const _0x431252=await withSpinner(_0x40876d(0x7d)+_0x499871+_0x40876d(0x90),()=>_0x1cbb43[_0x40876d(0xfe)]['download'](_0x499871,_0x34b733,{'revision':_0x42a20d}),{'verbose':_0x4e2d81[_0x40876d(0x88)]}),_0x1805ec=_0x431252[_0x40876d(0xa2)];return console[_0x40876d(0xb9)](_0x40876d(0xd5)+_0x1805ec[_0x40876d(0x93)]),console[_0x40876d(0xb9)](_0x40876d(0xc8)+_0x1805ec[_0x40876d(0xf0)]),console[_0x40876d(0xb9)](_0x40876d(0xf1)+_0x1805ec[_0x40876d(0x78)]),console[_0x40876d(0xb9)](_0x40876d(0xa0)+_0x34b733+'/'+_0x1805ec[_0x40876d(0x93)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a42_0x3a9913(0x101)]=a42_0x3a9913(0xf3);[a42_0x3a9913(0x7c)]='Push\x20workflow\x20project\x20to\x20Treasure\x20Data';async['execute'](_0x588ee6){const _0x3031b4=a42_0x3a9913,{options:_0x41d739,args:_0x43a82d,tdx:_0x4ac80c}=_0x588ee6;let _0x448cf9='.',_0xc43268=_0x41d739[_0x3031b4(0x101)];if(_0x43a82d[0x0]){const {promises:_0x4e876b}=await import('fs');try{const _0xaa66f7=await _0x4e876b[_0x3031b4(0xb3)](_0x43a82d[0x0]);if(_0xaa66f7['isDirectory']())_0x448cf9=_0x43a82d[0x0];else return console['error'](_0x3031b4(0x83)+_0x43a82d[0x0]+_0x3031b4(0x119)),0x1;}catch{_0xc43268=_0x43a82d[0x0],_0x448cf9='.';}}const _0x17b2cd=_0x41d739['revision'],_0x58a371=_0x41d739[_0x3031b4(0xc0)];_0x41d739['verbose']&&(console['error'](_0x3031b4(0x9b)+_0x448cf9),_0xc43268&&console['error'](_0x3031b4(0xd8)+_0xc43268),_0x17b2cd&&console[_0x3031b4(0xb9)](_0x3031b4(0xc3)+_0x17b2cd),_0x58a371&&console[_0x3031b4(0xb9)]('Validation:\x20skipped'));const _0x364f31=await withSpinner(_0x3031b4(0xc1),()=>_0x4ac80c[_0x3031b4(0xfe)][_0x3031b4(0xe8)](_0x448cf9,{'projectName':_0xc43268,'revision':_0x17b2cd,'skipValidation':_0x58a371}),{'verbose':_0x41d739[_0x3031b4(0x88)]}),_0x5d97cc=_0x364f31['data'];return console[_0x3031b4(0xb9)](_0x3031b4(0x81)+_0x5d97cc[_0x3031b4(0x93)]),console[_0x3031b4(0xb9)](_0x3031b4(0x116)+_0x5d97cc['projectId']),console[_0x3031b4(0xb9)]('\x20\x20Revision:\x20'+_0x5d97cc['revision']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a42_0x3a9913(0x101)]=a42_0x3a9913(0xb1);[a42_0x3a9913(0x7c)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a42_0x3a9913(0x10b)](_0x3e902e){const _0x3f2f89=a42_0x3a9913,{options:_0x499474,args:_0x4d261f,tdx:_0x5e7642}=_0x3e902e,_0x5d5e7b=_0x4d261f[0x0];if(!_0x5d5e7b)return console[_0x3f2f89(0xb9)](_0x3f2f89(0xf6)),console['error']('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x499474[_0x3f2f89(0x88)]&&console['error'](_0x3f2f89(0x104)+_0x5d5e7b);if(!_0x499474['yes']){const _0x452621=await confirm(_0x3f2f89(0x80)+_0x5d5e7b+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x452621)return console[_0x3f2f89(0xb9)](_0x3f2f89(0xcf)),0x0;}const _0x512e5a=await withSpinner(_0x3f2f89(0xf7)+_0x5d5e7b+_0x3f2f89(0x90),()=>_0x5e7642[_0x3f2f89(0xfe)][_0x3f2f89(0x7f)](_0x5d5e7b),{'verbose':_0x499474[_0x3f2f89(0x88)]}),_0x278985=_0x512e5a[_0x3f2f89(0xa2)];return console[_0x3f2f89(0xb9)]('✔\x20Deleted\x20project\x20'+_0x278985[_0x3f2f89(0x93)]),console['error'](_0x3f2f89(0x116)+_0x278985[_0x3f2f89(0xb5)]),0x0;}}
1
+ const a42_0x1c8bd5=a42_0x2a1e;(function(_0x2d8028,_0xe06ef1){const _0xa697a4=a42_0x2a1e,_0x1d6525=_0x2d8028();while(!![]){try{const _0x1701b2=parseInt(_0xa697a4(0xa9))/0x1*(parseInt(_0xa697a4(0xeb))/0x2)+parseInt(_0xa697a4(0xfc))/0x3*(parseInt(_0xa697a4(0x109))/0x4)+parseInt(_0xa697a4(0xd8))/0x5*(parseInt(_0xa697a4(0xb4))/0x6)+-parseInt(_0xa697a4(0x92))/0x7+parseInt(_0xa697a4(0x85))/0x8+parseInt(_0xa697a4(0xfd))/0x9*(-parseInt(_0xa697a4(0xb6))/0xa)+-parseInt(_0xa697a4(0xaf))/0xb*(parseInt(_0xa697a4(0x75))/0xc);if(_0x1701b2===_0xe06ef1)break;else _0x1d6525['push'](_0x1d6525['shift']());}catch(_0x114766){_0x1d6525['push'](_0x1d6525['shift']());}}}(a42_0x2f56,0xba624));function a42_0x2f56(){const _0x5c1cbb=['\x20\x20Project\x20ID:\x20','\x20\x20Session\x20ID:\x20','workflow:retry','workflow:attempt','workflow:download','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Show\x20logs\x20for\x20a\x20workflow\x20attempt','retryAttempt','1705235gFtcaa','substring','\x20attempt','download','attempts','Including\x20subtasks:\x20yes','List\x20workflow\x20execution\x20sessions','\x20\x20Attempt\x20ID:\x20','\x20is\x20not\x20a\x20directory','select','startsWith','Retry\x20a\x20session\x20or\x20attempt','Retrying\x20session...','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Kill\x20a\x20running\x20attempt','cause','Pushing\x20workflow\x20project...','data','workflow:logs','Resume\x20from:\x20','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','workflow:kill','workflow:push','59064ksqrle','Getting\x20attempt\x20tasks...','attemptId','List\x20workflows','Listing\x20workflow\x20sessions...','Listing\x20workflows...','121ntznZF','Pattern:\x20','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','projectName','Getting\x20attempt\x20details...','2817102mjCtzr','taskName','10ZzqGpT','fromTask','attempt:','format','Listing\x20workflow\x20projects...','Downloading\x20project\x20','log','Error:\x20Attempt\x20ID\x20is\x20required','List\x20workflow\x20attempts','delete','✔\x20Retry\x20started','readFile','\x20\x20New\x20attempt\x20ID:\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Start\x20a\x20workflow\x20run','workflow','Session\x20time:\x20','\x20workflow','skipValidation','\x20\x20Project:\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','fileSize','Attempt\x20ID:\x20','...','Error:\x20','\x20\x20Cause:\x20','Killing\x20attempt...','Parameters:\x20','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Workflow:\x20','projectId','workflows','revision','getTime','5RlQtmQ','Reason:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Fetching\x20log\x20files...','resumeFrom','Deleting\x20project\x20','Starting\x20workflow\x20run...','Error:\x20Invalid\x20parameter\x20format:\x20','✔\x20Found\x20','utf-8','includeRetried','\x20\x20Workflow:\x20','task','index','kill','createdAt','Project\x20filter:\x20','isDirectory','workflow:sessions','18xHDFjL','message','\x20\x20Location:\x20','List\x20all\x20workflow\x20projects','includeSubtasks','split','\x22?\x20This\x20cannot\x20be\x20undone.','execute','round','workflow:attempts','force','Params:\x20','Filter:\x20project=','sessionId','project','tasks','logFiles','5793hEeqqI','11035431WZbCPJ','keys','stringify','error','Revision:\x20','parse','attempt','Project:\x20','From\x20task:\x20','verbose','yes','length','1032EZqzGH','Select\x20a\x20task\x20to\x20view\x20logs:','No\x20log\x20content\x20found','Task\x20name:\x20','projects','workflow:delete','retryAttemptName','limit','session','retrySession','stat','workflow:tasks','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Project\x20name:\x20','name','filesExtracted','fs/promises','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','workflow:run','Expected\x20format:\x20--param\x20key=value','workflow:projects','Error:\x20Project\x20name\x20is\x20required','706956tuSfum','Cancelled','description','\x20project','Filter:\x20','done','indexOf','sessions','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','✔\x20Workflow\x20run\x20started','\x20\x20Revision:\x20','finishedAt','params','Force:\x20yes','status','logs','11055552xyLTfM','Validation:\x20skipped','Listing\x20workflow\x20attempts...','push','sessionTime'];a42_0x2f56=function(){return _0x5c1cbb;};return a42_0x2f56();}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 a42_0x5da6d2 from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a42_0x1c8bd5(0x117)]=a42_0x1c8bd5(0x73);[a42_0x1c8bd5(0x77)]=a42_0x1c8bd5(0xee);async[a42_0x1c8bd5(0xf2)](_0x53422b){const _0x25e4b8=a42_0x1c8bd5,{options:_0x5ea0bd,args:_0x25b0d2,tdx:_0x31711f}=_0x53422b,_0x30210e=_0x25b0d2[0x0];try{_0x5ea0bd[_0x25e4b8(0x106)]&&_0x30210e&&console[_0x25e4b8(0x100)](_0x25e4b8(0xb0)+_0x30210e);const _0x94f6db=await withSpinner(_0x25e4b8(0xba),()=>_0x31711f[_0x25e4b8(0xc5)][_0x25e4b8(0x10d)](_0x30210e,{'limit':_0x5ea0bd[_0x25e4b8(0x110)]}),{'verbose':_0x5ea0bd[_0x25e4b8(0x106)]}),_0x3d9a60=_0x94f6db['data'];return console[_0x25e4b8(0x100)](_0x25e4b8(0xe0)+_0x3d9a60['length']+_0x25e4b8(0x78)+(_0x3d9a60[_0x25e4b8(0x108)]!==0x1?'s':'')),await handleSDKOutput(_0x3d9a60,_0x5ea0bd),0x0;}catch(_0x3d573a){if(_0x3d573a instanceof SDKError)return console[_0x25e4b8(0x100)](_0x25e4b8(0xce)+_0x3d573a[_0x25e4b8(0xec)]),_0x3d573a[_0x25e4b8(0xa1)]&&console[_0x25e4b8(0x100)](_0x25e4b8(0xcf)+_0x3d573a[_0x25e4b8(0xa1)]),0x1;throw _0x3d573a;}}}function a42_0x2a1e(_0x2b21ff,_0x46b24c){_0x2b21ff=_0x2b21ff-0x6e;const _0x2f5618=a42_0x2f56();let _0x2a1e68=_0x2f5618[_0x2b21ff];return _0x2a1e68;}export class WorkflowWorkflowsCommand extends BaseCommand{[a42_0x1c8bd5(0x117)]='workflow:workflows';['description']=a42_0x1c8bd5(0xac);async[a42_0x1c8bd5(0xf2)](_0x53b0db){const _0x56b76d=a42_0x1c8bd5,{options:_0x55d7cc,args:_0x3cf8a0,tdx:_0x4b0294}=_0x53b0db,_0x54c00e=_0x3cf8a0[0x0];try{_0x55d7cc[_0x56b76d(0x106)]&&_0x54c00e&&console['error'](_0x56b76d(0xe8)+_0x54c00e);const _0x4c8c4b=await withSpinner(_0x56b76d(0xae),()=>_0x4b0294[_0x56b76d(0xc5)][_0x56b76d(0xd5)](_0x54c00e,{'limit':_0x55d7cc[_0x56b76d(0x110)]}),{'verbose':_0x55d7cc[_0x56b76d(0x106)]}),_0x5ef5b5=_0x4c8c4b['data'];return console[_0x56b76d(0x100)](_0x56b76d(0xe0)+_0x5ef5b5[_0x56b76d(0x108)]+_0x56b76d(0xc7)+(_0x5ef5b5[_0x56b76d(0x108)]!==0x1?'s':'')),await handleSDKOutput(_0x5ef5b5,_0x55d7cc),0x0;}catch(_0x1520b6){if(_0x1520b6 instanceof SDKError)return console[_0x56b76d(0x100)](_0x56b76d(0xce)+_0x1520b6['message']),_0x1520b6['cause']&&console['error'](_0x56b76d(0xcf)+_0x1520b6[_0x56b76d(0xa1)]),0x1;throw _0x1520b6;}}}export class WorkflowSessionsCommand extends BaseCommand{[a42_0x1c8bd5(0x117)]=a42_0x1c8bd5(0xea);[a42_0x1c8bd5(0x77)]=a42_0x1c8bd5(0x98);async['execute'](_0x491616){const _0x51f63e=a42_0x1c8bd5,{options:_0x3f384b,args:_0x5711ad,tdx:_0x2a6315}=_0x491616;let _0x5bf1cc,_0x1ee94e;if(_0x5711ad[0x0]){const _0x2558dc=_0x5711ad[0x0]['split']('.');if(_0x2558dc[_0x51f63e(0x108)]===0x1)_0x5bf1cc=_0x2558dc[0x0];else{if(_0x2558dc[_0x51f63e(0x108)]===0x2)[_0x5bf1cc,_0x1ee94e]=_0x2558dc;else return console[_0x51f63e(0x100)](_0x51f63e(0xd2)),0x1;}}try{if(_0x3f384b[_0x51f63e(0x106)]){if(_0x5bf1cc&&_0x1ee94e)console[_0x51f63e(0x100)](_0x51f63e(0x79)+_0x5bf1cc+'.'+_0x1ee94e);else _0x5bf1cc&&console[_0x51f63e(0x100)](_0x51f63e(0xf7)+_0x5bf1cc);const _0xd49ade=_0x3f384b[_0x51f63e(0x83)];_0xd49ade&&console[_0x51f63e(0x100)]('Status:\x20'+_0xd49ade);}const _0x3bc212=await withSpinner(_0x51f63e(0xad),()=>_0x2a6315[_0x51f63e(0xc5)][_0x51f63e(0x7c)]({'projectName':_0x5bf1cc,'workflowName':_0x1ee94e,'status':_0x3f384b[_0x51f63e(0x83)],'fromTime':_0x3f384b['from'],'toTime':_0x3f384b['to'],'limit':_0x3f384b[_0x51f63e(0x110)]}),{'verbose':_0x3f384b[_0x51f63e(0x106)]}),_0x14da97=_0x3bc212['data'];return console[_0x51f63e(0x100)]('✔\x20Found\x20'+_0x14da97[_0x51f63e(0x108)]+'\x20session'+(_0x14da97['length']!==0x1?'s':'')),await handleSDKOutput(_0x14da97,_0x3f384b),0x0;}catch(_0x47426b){if(_0x47426b instanceof SDKError)return console[_0x51f63e(0x100)](_0x51f63e(0xce)+_0x47426b[_0x51f63e(0xec)]),_0x47426b['cause']&&console['error'](_0x51f63e(0xcf)+_0x47426b['cause']),0x1;throw _0x47426b;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a42_0x1c8bd5(0x117)]=a42_0x1c8bd5(0xf4);[a42_0x1c8bd5(0x77)]=a42_0x1c8bd5(0xbe);async[a42_0x1c8bd5(0xf2)](_0x5618ed){const _0x2ec2e7=a42_0x1c8bd5,{options:_0x47ed37,args:_0x1c16bf,tdx:_0x2ce1eb}=_0x5618ed;let _0x27ff34,_0x51d26f;if(_0x1c16bf[0x0]){const _0x1d0703=_0x1c16bf[0x0][_0x2ec2e7(0xf0)]('.');if(_0x1d0703[_0x2ec2e7(0x108)]===0x1)_0x27ff34=_0x1d0703[0x0];else{if(_0x1d0703[_0x2ec2e7(0x108)]===0x2)[_0x27ff34,_0x51d26f]=_0x1d0703;else return console[_0x2ec2e7(0x100)](_0x2ec2e7(0xd2)),0x1;}}try{const _0x363607=_0x47ed37[_0x2ec2e7(0xe2)];if(_0x47ed37[_0x2ec2e7(0x106)]){if(_0x27ff34&&_0x51d26f)console[_0x2ec2e7(0x100)](_0x2ec2e7(0x79)+_0x27ff34+'.'+_0x51d26f);else _0x27ff34&&console[_0x2ec2e7(0x100)](_0x2ec2e7(0xf7)+_0x27ff34);_0x363607&&console[_0x2ec2e7(0x100)]('Include\x20retried:\x20yes');}const _0x2d3c9f=await withSpinner(_0x2ec2e7(0x87),()=>_0x2ce1eb['workflow'][_0x2ec2e7(0x96)]({'projectName':_0x27ff34,'workflowName':_0x51d26f,'includeRetried':_0x363607,'limit':_0x47ed37['limit']}),{'verbose':_0x47ed37[_0x2ec2e7(0x106)]}),_0x322c4c=_0x2d3c9f['data'];return console['error'](_0x2ec2e7(0xe0)+_0x322c4c['length']+_0x2ec2e7(0x94)+(_0x322c4c[_0x2ec2e7(0x108)]!==0x1?'s':'')),await handleSDKOutput(_0x322c4c,_0x47ed37),0x0;}catch(_0x255910){if(_0x255910 instanceof SDKError)return console[_0x2ec2e7(0x100)](_0x2ec2e7(0xce)+_0x255910[_0x2ec2e7(0xec)]),_0x255910[_0x2ec2e7(0xa1)]&&console[_0x2ec2e7(0x100)](_0x2ec2e7(0xcf)+_0x255910['cause']),0x1;throw _0x255910;}}}export class WorkflowAttemptCommand extends BaseCommand{[a42_0x1c8bd5(0x117)]=a42_0x1c8bd5(0x8d);['description']='Show\x20specific\x20attempt\x20details';async[a42_0x1c8bd5(0xf2)](_0x15f695){const _0x337767=a42_0x1c8bd5,{options:_0x535038,args:_0x15db23,tdx:_0x257ad7}=_0x15f695,_0xef929a=_0x15db23[0x0];if(!_0xef929a)return console[_0x337767(0x100)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{_0x535038[_0x337767(0x106)]&&console[_0x337767(0x100)](_0x337767(0xcc)+_0xef929a);const _0x126822=await withSpinner(_0x337767(0xb3),()=>_0x257ad7[_0x337767(0xc5)][_0x337767(0x103)](_0xef929a),{'verbose':_0x535038[_0x337767(0x106)]}),_0x1eb8fc=_0x126822[_0x337767(0xa3)];let _0x1f110f;!_0x1eb8fc[_0x337767(0x7a)]?_0x1f110f=_0x1eb8fc['cancelRequested']?'canceling':'running':_0x1f110f=_0x1eb8fc['success']?'success':_0x337767(0x100);let _0x241293;if(_0x1eb8fc[_0x337767(0xe7)]&&_0x1eb8fc[_0x337767(0x80)]){const _0x20ff4f=new Date(_0x1eb8fc['createdAt'])[_0x337767(0xd7)](),_0x12b061=new Date(_0x1eb8fc[_0x337767(0x80)])['getTime']();_0x241293=Math[_0x337767(0xf3)]((_0x12b061-_0x20ff4f)/0x3e8);}const _0x14822b={'attempt_id':_0x1eb8fc['id'],'status':_0x1f110f,..._0x1eb8fc[_0x337767(0xe5)]!==undefined&&{'index':_0x1eb8fc[_0x337767(0xe5)]},..._0x1eb8fc['project']&&{'project':_0x1eb8fc[_0x337767(0xf9)][_0x337767(0x117)]},..._0x1eb8fc[_0x337767(0xc5)]&&{'workflow':_0x1eb8fc[_0x337767(0xc5)]['name']},..._0x1eb8fc['sessionId']&&{'session_id':_0x1eb8fc[_0x337767(0xf8)]},..._0x1eb8fc[_0x337767(0x89)]&&{'session_time':_0x1eb8fc['sessionTime']},..._0x1eb8fc[_0x337767(0x10f)]&&{'retry_attempt':_0x1eb8fc['retryAttemptName']},..._0x241293!==undefined&&{'duration_sec':_0x241293},..._0x1eb8fc[_0x337767(0xe7)]&&{'created_at':_0x1eb8fc[_0x337767(0xe7)]},..._0x1eb8fc[_0x337767(0x80)]&&{'finished_at':_0x1eb8fc[_0x337767(0x80)]},...Object[_0x337767(0xfe)](_0x1eb8fc[_0x337767(0x81)])[_0x337767(0x108)]>0x0&&{'params':_0x1eb8fc[_0x337767(0x81)]}};return await handleSingleObjectOutput(_0x14822b,_0x535038),0x0;}catch(_0x3272ac){if(_0x3272ac instanceof SDKError)return console[_0x337767(0x100)](_0x337767(0xce)+_0x3272ac[_0x337767(0xec)]),_0x3272ac[_0x337767(0xa1)]&&console[_0x337767(0x100)](_0x337767(0xcf)+_0x3272ac[_0x337767(0xa1)]),0x1;throw _0x3272ac;}}}export class WorkflowTasksCommand extends BaseCommand{[a42_0x1c8bd5(0x117)]=a42_0x1c8bd5(0x114);[a42_0x1c8bd5(0x77)]='Show\x20tasks\x20for\x20an\x20attempt';async[a42_0x1c8bd5(0xf2)](_0x1dec3e){const _0x1ff6d0=a42_0x1c8bd5,{options:_0x2424fd,args:_0x46c12e,tdx:_0x1e4b03}=_0x1dec3e,_0x209d80=_0x46c12e[0x0];if(!_0x209d80)return console[_0x1ff6d0(0x100)](_0x1ff6d0(0xbd)),0x1;try{const _0x1eb8a8=_0x2424fd[_0x1ff6d0(0xef)];_0x2424fd[_0x1ff6d0(0x106)]&&(console[_0x1ff6d0(0x100)](_0x1ff6d0(0xcc)+_0x209d80),_0x1eb8a8&&console[_0x1ff6d0(0x100)](_0x1ff6d0(0x97)));const _0x402638=await withSpinner(_0x1ff6d0(0xaa),()=>_0x1e4b03[_0x1ff6d0(0xc5)][_0x1ff6d0(0xfa)](_0x209d80,_0x1eb8a8||![]),{'verbose':_0x2424fd[_0x1ff6d0(0x106)]}),_0x52473f=_0x402638[_0x1ff6d0(0xa3)];return console[_0x1ff6d0(0x100)]('✔\x20Found\x20'+_0x52473f['length']+'\x20task'+(_0x52473f['length']!==0x1?'s':'')),await handleSDKOutput(_0x52473f,_0x2424fd),0x0;}catch(_0x22a790){if(_0x22a790 instanceof SDKError)return console[_0x1ff6d0(0x100)]('Error:\x20'+_0x22a790['message']),_0x22a790[_0x1ff6d0(0xa1)]&&console[_0x1ff6d0(0x100)]('\x20\x20Cause:\x20'+_0x22a790[_0x1ff6d0(0xa1)]),0x1;throw _0x22a790;}}}export class WorkflowLogsCommand extends BaseCommand{[a42_0x1c8bd5(0x117)]=a42_0x1c8bd5(0xa4);[a42_0x1c8bd5(0x77)]=a42_0x1c8bd5(0x90);async[a42_0x1c8bd5(0xf2)](_0x3a06b1){const _0x47069b=a42_0x1c8bd5,{options:_0x5f2197,args:_0x161ff5,tdx:_0x589d1b}=_0x3a06b1,_0x1551ee=_0x161ff5[0x0];let _0x504c04=_0x161ff5[0x1];if(!_0x1551ee)return console[_0x47069b(0x100)](_0x47069b(0xbd)),0x1;try{_0x5f2197['verbose']&&(console[_0x47069b(0x100)](_0x47069b(0xcc)+_0x1551ee),_0x504c04&&console[_0x47069b(0x100)](_0x47069b(0x10c)+_0x504c04));const _0x1b1150=await withSpinner(_0x47069b(0xdb),()=>_0x589d1b[_0x47069b(0xc5)][_0x47069b(0xfb)](_0x1551ee,_0x504c04),{'verbose':_0x5f2197[_0x47069b(0x106)]}),_0x295424=_0x1b1150['data'];if(_0x295424[_0x47069b(0x108)]===0x0)return console[_0x47069b(0x100)](_0x47069b(0xca)),0x0;if(!_0x504c04&&(_0x5f2197['json']||_0x5f2197[_0x47069b(0xb9)]))return await handleSDKOutput(_0x295424,_0x5f2197),0x0;if(!_0x504c04){const _0x5d96fb=_0x295424['map'](_0x1d2ec1=>({'title':_0x1d2ec1[_0x47069b(0xb5)]+'\x20('+formatBytes(_0x1d2ec1[_0x47069b(0xcb)])+')','value':_0x1d2ec1[_0x47069b(0xb5)]})),_0x25bb7a=await a42_0x5da6d2({'type':_0x47069b(0x9b),'name':'task','message':_0x47069b(0x10a),'choices':_0x5d96fb});if(!_0x25bb7a['task'])return console[_0x47069b(0x100)](_0x47069b(0x76)),0x0;_0x504c04=_0x25bb7a[_0x47069b(0xe4)];}const _0x761230=await withSpinner('Downloading\x20logs...',()=>_0x589d1b[_0x47069b(0xc5)][_0x47069b(0x84)](_0x1551ee,_0x504c04),{'verbose':_0x5f2197[_0x47069b(0x106)]}),_0x378960=_0x761230[_0x47069b(0xa3)];return _0x378960?console[_0x47069b(0xbc)](_0x378960):console['error'](_0x47069b(0x10b)),0x0;}catch(_0x1a0b85){if(_0x1a0b85 instanceof SDKError)return console['error']('Error:\x20'+_0x1a0b85['message']),_0x1a0b85[_0x47069b(0xa1)]&&console[_0x47069b(0x100)](_0x47069b(0xcf)+_0x1a0b85['cause']),0x1;throw _0x1a0b85;}}}export class WorkflowKillCommand extends BaseCommand{[a42_0x1c8bd5(0x117)]=a42_0x1c8bd5(0xa7);['description']=a42_0x1c8bd5(0xa0);async[a42_0x1c8bd5(0xf2)](_0x106b79){const _0x21d41e=a42_0x1c8bd5,{options:_0x572f13,args:_0x5f1920,tdx:_0x3df405}=_0x106b79,_0x24f392=_0x5f1920[0x0];if(!_0x24f392)return console[_0x21d41e(0x100)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x32b6ec=_0x572f13['reason'];_0x572f13['verbose']&&(console[_0x21d41e(0x100)](_0x21d41e(0xcc)+_0x24f392),_0x32b6ec&&console[_0x21d41e(0x100)](_0x21d41e(0xd9)+_0x32b6ec));if(!_0x572f13[_0x21d41e(0x107)]){const _0x469502=await confirm(_0x21d41e(0x7d)+_0x24f392+'?');if(!_0x469502)return console[_0x21d41e(0x100)](_0x21d41e(0x76)),0x0;}const _0x31a7f6=await withSpinner(_0x21d41e(0xd0),()=>_0x3df405[_0x21d41e(0xc5)][_0x21d41e(0xe6)](_0x24f392,_0x32b6ec),{'verbose':_0x572f13[_0x21d41e(0x106)]}),_0x2eb568=_0x31a7f6[_0x21d41e(0xa3)];return console['error']('✔\x20'+_0x2eb568),0x0;}catch(_0x46358c){if(_0x46358c instanceof SDKError)return console['error']('Error:\x20'+_0x46358c[_0x21d41e(0xec)]),_0x46358c[_0x21d41e(0xa1)]&&console['error'](_0x21d41e(0xcf)+_0x46358c[_0x21d41e(0xa1)]),0x1;throw _0x46358c;}}}export class WorkflowRetryCommand extends BaseCommand{[a42_0x1c8bd5(0x117)]=a42_0x1c8bd5(0x8c);[a42_0x1c8bd5(0x77)]=a42_0x1c8bd5(0x9d);async['execute'](_0x3de1ae){const _0x8043df=a42_0x1c8bd5,{options:_0x26588c,args:_0x2c4448,tdx:_0x35d1c2}=_0x3de1ae,_0x15ec8f=_0x2c4448[0x0];if(!_0x15ec8f)return console[_0x8043df(0x100)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x8043df(0x100)](_0x8043df(0xda)),0x1;let _0x24561d=![],_0x5ca0fb=_0x15ec8f;if(_0x15ec8f['startsWith']('session:'))_0x24561d=!![],_0x5ca0fb=_0x15ec8f['substring'](0x8);else{if(_0x15ec8f[_0x8043df(0x9c)](_0x8043df(0xb8)))_0x24561d=![],_0x5ca0fb=_0x15ec8f['substring'](0x8);else return console[_0x8043df(0x100)](_0x8043df(0x115)),console['error'](_0x8043df(0xda)),0x1;}try{const _0x1f6fb7=_0x26588c[_0x8043df(0xb7)],_0x52e634=_0x26588c[_0x8043df(0xdc)],_0x476ae7=_0x26588c['params'],_0x472322=_0x26588c[_0x8043df(0xf5)];_0x26588c['verbose']&&(console[_0x8043df(0x100)]('Target:\x20'+(_0x24561d?_0x8043df(0x111):'attempt')+'\x20'+_0x5ca0fb),_0x1f6fb7&&console[_0x8043df(0x100)](_0x8043df(0x105)+_0x1f6fb7),_0x52e634&&console[_0x8043df(0x100)](_0x8043df(0xa5)+_0x52e634),_0x476ae7&&console[_0x8043df(0x100)](_0x8043df(0xf6)+_0x476ae7),_0x472322&&console[_0x8043df(0x100)](_0x8043df(0x82)));let _0x46dd4d;if(_0x476ae7)try{if(_0x476ae7[_0x8043df(0x9c)]('@')){const _0x4be510=await import(_0x8043df(0x6f)),_0x109809=_0x476ae7['substring'](0x1),_0x3a169f=await _0x4be510[_0x8043df(0xc1)](_0x109809,_0x8043df(0xe1));_0x46dd4d=JSON[_0x8043df(0x102)](_0x3a169f);}else _0x46dd4d=JSON[_0x8043df(0x102)](_0x476ae7);}catch{return console['error']('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x26588c['yes']){const _0x6e7f33=await confirm(_0x8043df(0x9f)+(_0x24561d?'session':'attempt')+'\x20'+_0x5ca0fb+'?');if(!_0x6e7f33)return console[_0x8043df(0x100)](_0x8043df(0x76)),0x0;}let _0x16574a;_0x24561d?_0x16574a=await withSpinner(_0x8043df(0x9e),()=>_0x35d1c2[_0x8043df(0xc5)][_0x8043df(0x112)](_0x5ca0fb,{'fromTask':_0x1f6fb7,'retryParams':_0x46dd4d}),{'verbose':_0x26588c[_0x8043df(0x106)]}):_0x16574a=await withSpinner('Retrying\x20attempt...',()=>_0x35d1c2[_0x8043df(0xc5)][_0x8043df(0x91)](_0x5ca0fb,{'resumeFrom':_0x52e634,'retryParams':_0x46dd4d,'force':_0x472322}),{'verbose':_0x26588c[_0x8043df(0x106)]});const _0x2267d2=_0x16574a['data'];return console[_0x8043df(0x100)](_0x8043df(0xc0)),console[_0x8043df(0x100)](_0x8043df(0xc2)+_0x2267d2[_0x8043df(0xab)]),console['error'](_0x8043df(0x8b)+_0x2267d2[_0x8043df(0xf8)]),0x0;}catch(_0x44d8eb){if(_0x44d8eb instanceof SDKError)return console['error'](_0x8043df(0xce)+_0x44d8eb['message']),_0x44d8eb[_0x8043df(0xa1)]&&console[_0x8043df(0x100)](_0x8043df(0xcf)+_0x44d8eb[_0x8043df(0xa1)]),0x1;throw _0x44d8eb;}}}export class WorkflowRunCommand extends BaseCommand{[a42_0x1c8bd5(0x117)]=a42_0x1c8bd5(0x71);[a42_0x1c8bd5(0x77)]=a42_0x1c8bd5(0xc4);async[a42_0x1c8bd5(0xf2)](_0x59eea0){const _0x3c55a0=a42_0x1c8bd5,{options:_0x1a39bd,args:_0x85ec4b,tdx:_0x259236}=_0x59eea0,_0x3db4fb=_0x85ec4b[0x0];if(!_0x3db4fb)return console[_0x3c55a0(0x100)]('Error:\x20Workflow\x20identifier\x20is\x20required'),console[_0x3c55a0(0x100)](_0x3c55a0(0xa6)),0x1;const _0x4e1beb=_0x1a39bd['param'],_0x844889=_0x1a39bd['sessionTime'],_0x4f140a={};if(_0x4e1beb&&Array['isArray'](_0x4e1beb))for(const _0x4a3d4e of _0x4e1beb){const _0x3feb3a=_0x4a3d4e[_0x3c55a0(0x7b)]('=');if(_0x3feb3a===-0x1)return console[_0x3c55a0(0x100)](_0x3c55a0(0xdf)+_0x4a3d4e),console[_0x3c55a0(0x100)](_0x3c55a0(0x72)),0x1;const _0x71df3b=_0x4a3d4e[_0x3c55a0(0x93)](0x0,_0x3feb3a),_0x3478d5=_0x4a3d4e[_0x3c55a0(0x93)](_0x3feb3a+0x1);try{_0x4f140a[_0x71df3b]=JSON[_0x3c55a0(0x102)](_0x3478d5);}catch{_0x4f140a[_0x71df3b]=_0x3478d5;}}_0x1a39bd[_0x3c55a0(0x106)]&&(console[_0x3c55a0(0x100)](_0x3c55a0(0xd3)+_0x3db4fb),Object[_0x3c55a0(0xfe)](_0x4f140a)[_0x3c55a0(0x108)]>0x0&&console[_0x3c55a0(0x100)](_0x3c55a0(0xd1)+JSON[_0x3c55a0(0xff)](_0x4f140a)),_0x844889&&console['error'](_0x3c55a0(0xc6)+_0x844889));const _0x2847e3=await withSpinner(_0x3c55a0(0xde),()=>_0x259236[_0x3c55a0(0xc5)]['run'](_0x3db4fb,_0x4f140a,{'sessionTime':_0x844889}),{'verbose':_0x1a39bd[_0x3c55a0(0x106)]}),_0x4a2c03=_0x2847e3[_0x3c55a0(0xa3)];return console[_0x3c55a0(0x100)](_0x3c55a0(0x7e)),console[_0x3c55a0(0x100)](_0x3c55a0(0x99)+_0x4a2c03['id']),console['error']('\x20\x20Session\x20ID:\x20'+_0x4a2c03[_0x3c55a0(0xf8)]),console[_0x3c55a0(0x100)](_0x3c55a0(0xc9)+_0x4a2c03[_0x3c55a0(0xf9)]?.['name']),console[_0x3c55a0(0x100)](_0x3c55a0(0xe3)+_0x4a2c03[_0x3c55a0(0xc5)]?.['name']),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a42_0x1c8bd5(0x8e);[a42_0x1c8bd5(0x77)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a42_0x1c8bd5(0xf2)](_0x44f645){const _0x550997=a42_0x1c8bd5,{options:_0x5b0329,args:_0x430b48,tdx:_0x40be36}=_0x44f645,_0xd17509=_0x430b48[0x0],_0x233159=_0x430b48[0x1]||'.';if(!_0xd17509)return console[_0x550997(0x100)](_0x550997(0x74)),console['error'](_0x550997(0xc3)),0x1;const _0x1ede09=_0x5b0329[_0x550997(0xd6)];_0x5b0329['verbose']&&(console[_0x550997(0x100)](_0x550997(0x104)+_0xd17509),console[_0x550997(0x100)]('Output\x20directory:\x20'+_0x233159),_0x1ede09&&console[_0x550997(0x100)](_0x550997(0x101)+_0x1ede09));const _0x3e8931=await withSpinner(_0x550997(0xbb)+_0xd17509+_0x550997(0xcd),()=>_0x40be36['workflow'][_0x550997(0x95)](_0xd17509,_0x233159,{'revision':_0x1ede09}),{'verbose':_0x5b0329['verbose']}),_0x352b10=_0x3e8931[_0x550997(0xa3)];return console['error']('✔\x20Downloaded\x20'+_0x352b10[_0x550997(0xb2)]),console[_0x550997(0x100)]('\x20\x20Revision:\x20'+_0x352b10[_0x550997(0xd6)]),console['error']('\x20\x20Files\x20extracted:\x20'+_0x352b10[_0x550997(0x6e)]),console[_0x550997(0x100)](_0x550997(0xed)+_0x233159+'/'+_0x352b10['projectName']),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a42_0x1c8bd5(0x117)]=a42_0x1c8bd5(0xa8);[a42_0x1c8bd5(0x77)]=a42_0x1c8bd5(0xb1);async['execute'](_0x5b5986){const _0x3a4b95=a42_0x1c8bd5,{options:_0x2c87ba,args:_0x1fd114,tdx:_0x19558c}=_0x5b5986;let _0xf83cc7='.',_0x3f32df=_0x2c87ba[_0x3a4b95(0x117)];if(_0x1fd114[0x0]){const {promises:_0x3de70e}=await import('fs');try{const _0x4e9a24=await _0x3de70e[_0x3a4b95(0x113)](_0x1fd114[0x0]);if(_0x4e9a24[_0x3a4b95(0xe9)]())_0xf83cc7=_0x1fd114[0x0];else return console[_0x3a4b95(0x100)](_0x3a4b95(0xce)+_0x1fd114[0x0]+_0x3a4b95(0x9a)),0x1;}catch{_0x3f32df=_0x1fd114[0x0],_0xf83cc7='.';}}const _0x3b52a8=_0x2c87ba[_0x3a4b95(0xd6)],_0x4be117=_0x2c87ba[_0x3a4b95(0xc8)];_0x2c87ba[_0x3a4b95(0x106)]&&(console[_0x3a4b95(0x100)]('Project\x20directory:\x20'+_0xf83cc7),_0x3f32df&&console[_0x3a4b95(0x100)](_0x3a4b95(0x116)+_0x3f32df),_0x3b52a8&&console[_0x3a4b95(0x100)](_0x3a4b95(0x101)+_0x3b52a8),_0x4be117&&console['error'](_0x3a4b95(0x86)));const _0x12f6fc=await withSpinner(_0x3a4b95(0xa2),()=>_0x19558c['workflow'][_0x3a4b95(0x88)](_0xf83cc7,{'projectName':_0x3f32df,'revision':_0x3b52a8,'skipValidation':_0x4be117}),{'verbose':_0x2c87ba[_0x3a4b95(0x106)]}),_0x1430b5=_0x12f6fc['data'];return console[_0x3a4b95(0x100)]('✔\x20Pushed\x20'+_0x1430b5['projectName']),console[_0x3a4b95(0x100)](_0x3a4b95(0x8a)+_0x1430b5[_0x3a4b95(0xd4)]),console[_0x3a4b95(0x100)](_0x3a4b95(0x7f)+_0x1430b5[_0x3a4b95(0xd6)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a42_0x1c8bd5(0x10e);[a42_0x1c8bd5(0x77)]=a42_0x1c8bd5(0x8f);async[a42_0x1c8bd5(0xf2)](_0x31c104){const _0x427ea0=a42_0x1c8bd5,{options:_0xf36126,args:_0x25bf31,tdx:_0x5b4a26}=_0x31c104,_0x25741e=_0x25bf31[0x0];if(!_0x25741e)return console['error']('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x427ea0(0x100)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0xf36126[_0x427ea0(0x106)]&&console[_0x427ea0(0x100)](_0x427ea0(0x104)+_0x25741e);if(!_0xf36126['yes']){const _0x1f7585=await confirm(_0x427ea0(0x70)+_0x25741e+_0x427ea0(0xf1));if(!_0x1f7585)return console[_0x427ea0(0x100)](_0x427ea0(0x76)),0x0;}const _0x2449c5=await withSpinner(_0x427ea0(0xdd)+_0x25741e+_0x427ea0(0xcd),()=>_0x5b4a26[_0x427ea0(0xc5)][_0x427ea0(0xbf)](_0x25741e),{'verbose':_0xf36126[_0x427ea0(0x106)]}),_0x5e5d33=_0x2449c5[_0x427ea0(0xa3)];return console['error']('✔\x20Deleted\x20project\x20'+_0x5e5d33['projectName']),console[_0x427ea0(0x100)](_0x427ea0(0x8a)+_0x5e5d33['projectId']),0x0;}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x55111e,_0x598f4e){const _0x549713=a43_0x3bda,_0x2bcb1f=_0x55111e();while(!![]){try{const _0xfbe9b3=parseInt(_0x549713(0x127))/0x1*(parseInt(_0x549713(0x126))/0x2)+parseInt(_0x549713(0x12b))/0x3+parseInt(_0x549713(0x129))/0x4+-parseInt(_0x549713(0x12c))/0x5*(-parseInt(_0x549713(0x130))/0x6)+-parseInt(_0x549713(0x12a))/0x7*(parseInt(_0x549713(0x11f))/0x8)+parseInt(_0x549713(0x12e))/0x9+-parseInt(_0x549713(0x121))/0xa;if(_0xfbe9b3===_0x598f4e)break;else _0x2bcb1f['push'](_0x2bcb1f['shift']());}catch(_0x4a4b38){_0x2bcb1f['push'](_0x2bcb1f['shift']());}}}(a43_0x20de,0x9814c));function a43_0x20de(){const _0x51d29b=['TD1\x20','tdx',';\x20node/','6WBoTwr','75623pwQHlk','utf-8','2846880enndIP','413nzbsWR','2435805dFLglx','15760apHKVr','X-Trino-User','5576625DKrzza','parse','1128LsyCQW','replace','0.0.0','Authorization','113832DUPaXu','version','15002900qYZYsG','length'];a43_0x20de=function(){return _0x51d29b;};return a43_0x20de();}import{platform}from'os';function a43_0x3bda(_0x2d57c3,_0x349487){_0x2d57c3=_0x2d57c3-0x11c;const _0x20de76=a43_0x20de();let _0x3bda49=_0x20de76[_0x2d57c3];return _0x3bda49;}import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x4877cd=a43_0x3bda;try{const _0x56b54d=fileURLToPath(import.meta.url),_0x1db686=dirname(_0x56b54d),_0x548920=join(_0x1db686,'../../package.json'),_0x4ff840=JSON[_0x4877cd(0x12f)](readFileSync(_0x548920,_0x4877cd(0x128)));return _0x4ff840[_0x4877cd(0x120)];}catch{return _0x4877cd(0x11d);}}export function getUserAgent(){const _0x3d0efa=a43_0x3bda,_0x48f22b=getVersion(),_0x5b8b60=platform(),_0x162abd=process[_0x3d0efa(0x120)][_0x3d0efa(0x11c)]('v','');return'tdx/'+_0x48f22b+'\x20('+_0x5b8b60+_0x3d0efa(0x125)+_0x162abd+')';}export function getAuthHeaders(_0x4e009e,_0x55dd72){const _0x1defad=a43_0x3bda,_0x4e8032=getVersion(),_0x3762b2={'User-Agent':getUserAgent(),'X-TD-Client':_0x1defad(0x124),'X-TD-Client-Version':_0x4e8032};return _0x55dd72&&(_0x3762b2[_0x1defad(0x11e)]=_0x1defad(0x123)+_0x55dd72),_0x3762b2;}export function toHeaderRecord(_0x24440c){const _0x274d62={};for(const [_0x306daf,_0x516aa2]of Object['entries'](_0x24440c)){_0x516aa2!==undefined&&(_0x274d62[_0x306daf]=_0x516aa2);}return _0x274d62;}export function getTrinoHeaders(_0x5b4636,_0x34625b){const _0x4e2c1e=a43_0x3bda,_0x4c40cf=getAuthHeaders(_0x5b4636,_0x34625b),_0x10dca9=toHeaderRecord(_0x4c40cf);return delete _0x10dca9[_0x4e2c1e(0x11e)],_0x34625b&&(_0x10dca9[_0x4e2c1e(0x12d)]=_0x34625b),_0x10dca9;}export function hasAPIKey(_0x13be82){const _0x275fce=a43_0x3bda,_0x3879fa=getAPIKey(_0x13be82);return _0x3879fa!==undefined&&_0x3879fa[_0x275fce(0x122)]>0x0;}
1
+ (function(_0xe20d83,_0x5b023e){const _0x4fe4e3=a43_0x3a3f,_0xe5b726=_0xe20d83();while(!![]){try{const _0x184e0d=-parseInt(_0x4fe4e3(0x142))/0x1*(-parseInt(_0x4fe4e3(0x141))/0x2)+-parseInt(_0x4fe4e3(0x13d))/0x3+parseInt(_0x4fe4e3(0x13a))/0x4+parseInt(_0x4fe4e3(0x13e))/0x5+-parseInt(_0x4fe4e3(0x133))/0x6+parseInt(_0x4fe4e3(0x140))/0x7*(parseInt(_0x4fe4e3(0x136))/0x8)+-parseInt(_0x4fe4e3(0x135))/0x9*(parseInt(_0x4fe4e3(0x143))/0xa);if(_0x184e0d===_0x5b023e)break;else _0xe5b726['push'](_0xe5b726['shift']());}catch(_0x410384){_0xe5b726['push'](_0xe5b726['shift']());}}}(a43_0x56a0,0x5c0f0));import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';import{getAPIKey}from'./config.js';function a43_0x3a3f(_0x50cdf7,_0x5404e2){_0x50cdf7=_0x50cdf7-0x132;const _0x56a0b2=a43_0x56a0();let _0x3a3fd4=_0x56a0b2[_0x50cdf7];return _0x3a3fd4;}export function getVersion(){const _0x46ec09=a43_0x3a3f;try{const _0x5314fa=fileURLToPath(import.meta.url),_0x9376a0=dirname(_0x5314fa),_0x181ea8=join(_0x9376a0,_0x46ec09(0x13c)),_0x7223f8=JSON[_0x46ec09(0x134)](readFileSync(_0x181ea8,_0x46ec09(0x13f)));return _0x7223f8['version'];}catch{return _0x46ec09(0x132);}}export function getUserAgent(){const _0x370290=a43_0x3a3f,_0x35ff91=getVersion(),_0x120c10=platform(),_0x290cb4=process[_0x370290(0x139)]['replace']('v','');return'tdx/'+_0x35ff91+'\x20('+_0x120c10+';\x20node/'+_0x290cb4+')';}export function getAuthHeaders(_0x3a5cc1,_0xa0b6ac){const _0x173903=a43_0x3a3f,_0x400b6e=getVersion(),_0x34c19d={'User-Agent':getUserAgent(),'X-TD-Client':_0x173903(0x144),'X-TD-Client-Version':_0x400b6e};return _0xa0b6ac&&(_0x34c19d['Authorization']=_0x173903(0x137)+_0xa0b6ac),_0x34c19d;}function a43_0x56a0(){const _0x402b77=['350413aZPWCo','14adopvH','79055yyxCxt','113590iAEIhy','tdx','X-Trino-User','0.0.0','730002ctIlnE','parse','909VNJkCp','120fswlGu','TD1\x20','length','version','831500nWnOLN','entries','../../package.json','832635cQdDEZ','2056990KiIJZW','utf-8'];a43_0x56a0=function(){return _0x402b77;};return a43_0x56a0();}export function toHeaderRecord(_0xd3f3fd){const _0xbb2a7c=a43_0x3a3f,_0x45401a={};for(const [_0x2117d6,_0x2d13a2]of Object[_0xbb2a7c(0x13b)](_0xd3f3fd)){_0x2d13a2!==undefined&&(_0x45401a[_0x2117d6]=_0x2d13a2);}return _0x45401a;}export function getTrinoHeaders(_0x552b18,_0x46d6f3){const _0x2825a5=a43_0x3a3f,_0x3b8a38=getAuthHeaders(_0x552b18,_0x46d6f3),_0x31507f=toHeaderRecord(_0x3b8a38);return delete _0x31507f['Authorization'],_0x46d6f3&&(_0x31507f[_0x2825a5(0x145)]=_0x46d6f3),_0x31507f;}export function hasAPIKey(_0x1037db){const _0x2ffa55=a43_0x3a3f,_0x5cb6d2=getAPIKey(_0x1037db);return _0x5cb6d2!==undefined&&_0x5cb6d2[_0x2ffa55(0x138)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x1d2129,_0x22241c){const _0x22846b=a44_0x2cba,_0x2a8ce8=_0x1d2129();while(!![]){try{const _0x13b98a=-parseInt(_0x22846b(0x105))/0x1*(parseInt(_0x22846b(0x110))/0x2)+parseInt(_0x22846b(0x146))/0x3+-parseInt(_0x22846b(0x119))/0x4*(parseInt(_0x22846b(0x144))/0x5)+-parseInt(_0x22846b(0x135))/0x6+-parseInt(_0x22846b(0x133))/0x7*(-parseInt(_0x22846b(0x145))/0x8)+parseInt(_0x22846b(0x124))/0x9+-parseInt(_0x22846b(0x14c))/0xa*(-parseInt(_0x22846b(0x116))/0xb);if(_0x13b98a===_0x22241c)break;else _0x2a8ce8['push'](_0x2a8ce8['shift']());}catch(_0x44ff2b){_0x2a8ce8['push'](_0x2a8ce8['shift']());}}}(a44_0x16ef,0xc3771));import{homedir}from'os';import{join}from'path';function a44_0x2cba(_0x526573,_0x51c6c4){_0x526573=_0x526573-0x101;const _0x16efc4=a44_0x16ef();let _0x2cba21=_0x16efc4[_0x526573];return _0x2cba21;}import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a44_0x49280f from'node:fs';import*as a44_0x4cac25 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 a44_0x5e5e1a from'chalk';export function getConfigDir(){const _0x141081=a44_0x2cba;return process[_0x141081(0x11f)][_0x141081(0x13a)]||join(homedir(),_0x141081(0x10d),'tdx');}export function getConfigFile(){const _0x1fb67f=a44_0x2cba;return join(getConfigDir(),_0x1fb67f(0x118));}export function getConfigFilePath(_0xf304ef){const _0x2305d7=a44_0x2cba,_0x5ae963=getConfigDir();return _0xf304ef?a44_0x4cac25[_0x2305d7(0x140)](_0x5ae963,_0x2305d7(0x12d)+_0xf304ef):getConfigFile();}export function getCacheDir(){const _0x537d34=a44_0x2cba;return process[_0x537d34(0x11f)][_0x537d34(0x14f)]||join(homedir(),_0x537d34(0x134),'tdx');}export function getLLMProjectCacheFile(_0x3cdddf){const _0x42a46a=a44_0x2cba,_0x2903f5=_0x3cdddf?_0x42a46a(0x128)+_0x3cdddf:'llm_default_project';return join(getCacheDir(),_0x2903f5);}export function readCachedLLMProject(_0x5ff560){const _0xcd6c01=a44_0x2cba;try{const _0x4f23e1=getLLMProjectCacheFile(_0x5ff560);if(!existsSync(_0x4f23e1))return null;const _0x981ded=readFileSync(_0x4f23e1,_0xcd6c01(0x149))['trim']();try{const _0x2a60cc=JSON[_0xcd6c01(0x139)](_0x981ded);if(_0x2a60cc&&typeof _0x2a60cc['id']==='string'&&typeof _0x2a60cc['name']===_0xcd6c01(0x12a))return _0x2a60cc;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x5cdddc,_0x4ceb84,_0x175b3c){const _0x52fedf=a44_0x2cba;try{const _0x3e5e2d=getCacheDir(),_0x244cc9=getLLMProjectCacheFile(_0x175b3c);!existsSync(_0x3e5e2d)&&mkdirSync(_0x3e5e2d,{'recursive':!![]});const _0x122175={'name':_0x5cdddc,'id':_0x4ceb84};writeFileSync(_0x244cc9,JSON[_0x52fedf(0x148)](_0x122175),_0x52fedf(0x149));}catch{}}export function getAccountInfoCacheFile(_0x12c209){const _0x4b16cd=a44_0x2cba,_0x19be3e=_0x12c209?_0x4b16cd(0x142)+_0x12c209+'.json':_0x4b16cd(0x115);return join(getCacheDir(),_0x19be3e);}export function readCachedAccountInfo(_0x2ee4f2){const _0x5081b8=a44_0x2cba;try{const _0x4d9f22=getAccountInfoCacheFile(_0x2ee4f2);if(!existsSync(_0x4d9f22))return null;const _0x1d1bac=readFileSync(_0x4d9f22,_0x5081b8(0x149))[_0x5081b8(0x111)](),_0x3cab37=JSON[_0x5081b8(0x139)](_0x1d1bac);if(_0x3cab37&&typeof _0x3cab37[_0x5081b8(0x12e)]===_0x5081b8(0x12a)&&typeof _0x3cab37[_0x5081b8(0x12c)]==='number')return _0x3cab37;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x277389,_0x4ce40d,_0x528206){const _0x5f3fe1=a44_0x2cba;try{const _0x17a003=getCacheDir(),_0xb1e107=getAccountInfoCacheFile(_0x528206);!existsSync(_0x17a003)&&mkdirSync(_0x17a003,{'recursive':!![]});const _0x1eff0b={'site':_0x277389,'accountId':_0x4ce40d,'cachedAt':new Date()[_0x5f3fe1(0x137)]()};writeFileSync(_0xb1e107,JSON[_0x5f3fe1(0x148)](_0x1eff0b),_0x5f3fe1(0x149));}catch{}}export function parseEnvFile(_0x15f899){const _0x39bdeb=a44_0x2cba,_0x1ba2dc={};for(const _0x5ea350 of _0x15f899[_0x39bdeb(0x11a)]('\x0a')){const _0x3a3eb6=_0x5ea350[_0x39bdeb(0x111)]();if(!_0x3a3eb6||_0x3a3eb6[_0x39bdeb(0x143)]('#'))continue;const _0x1c2dd5=_0x3a3eb6[_0x39bdeb(0x117)](/^([^=]+)=(.*)$/);if(_0x1c2dd5){const _0x1d49be=_0x1c2dd5[0x1][_0x39bdeb(0x111)]();let _0x3cd321=_0x1c2dd5[0x2]['trim']();(_0x3cd321[_0x39bdeb(0x143)]('\x22')&&_0x3cd321['endsWith']('\x22')||_0x3cd321[_0x39bdeb(0x143)]('\x27')&&_0x3cd321[_0x39bdeb(0x129)]('\x27'))&&(_0x3cd321=_0x3cd321[_0x39bdeb(0x101)](0x1,-0x1)),_0x1ba2dc[_0x1d49be]=_0x3cd321;}}return _0x1ba2dc;}export function readUserConfig(){const _0xc1f757=a44_0x2cba,_0x117543=getConfigFile();if(!existsSync(_0x117543))return{};try{const _0x374578=readFileSync(_0x117543,'utf-8');return parseEnvFile(_0x374578);}catch(_0x12ed3c){return console['warn'](_0xc1f757(0x108)+_0x117543+':',_0x12ed3c),{};}}export function resolveSite(_0x5012f2){const _0x57d9c9=a44_0x2cba,_0x55b7ee=['us01',_0x57d9c9(0x132),_0x57d9c9(0x14b),_0x57d9c9(0x13b),_0x57d9c9(0x136),_0x57d9c9(0x10c),'dev-eu01',_0x57d9c9(0x11b),_0x57d9c9(0x107),'stg-ap03'];if(_0x55b7ee[_0x57d9c9(0x122)](_0x5012f2))return _0x5012f2;if(_0x5012f2 in SITE_ALIASES)return SITE_ALIASES[_0x5012f2];return console[_0x57d9c9(0x138)](_0x57d9c9(0x112)+_0x5012f2+_0x57d9c9(0x13f)),_0x57d9c9(0x10a);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x4c6fa6,_0x1638cf){const _0x30568d=a44_0x2cba,_0xd17bbd=_0x1638cf||getActiveProfileName();if(_0xd17bbd){const _0x4894c7=_0x30568d(0x12f)+normalizeProfileForEnvVar(_0xd17bbd);if(process[_0x30568d(0x11f)][_0x4894c7])return process[_0x30568d(0x11f)][_0x4894c7];}if(process[_0x30568d(0x11f)]['TDX_API_KEY'])return process[_0x30568d(0x11f)][_0x30568d(0x10b)];if(process[_0x30568d(0x11f)][_0x30568d(0x14e)])return process[_0x30568d(0x11f)][_0x30568d(0x14e)];const _0x3caf5b=_0x4c6fa6[_0x30568d(0x10f)]()[_0x30568d(0x106)](/-/g,'_'),_0xbee777=_0x30568d(0x131)+_0x3caf5b;if(_0xd17bbd){const _0x3c3b81=loadProfileEnv(_0xd17bbd);if(_0x3c3b81){if(_0x3c3b81[_0xbee777])return _0x3c3b81[_0xbee777];if(_0x3c3b81[_0x30568d(0x14e)])return _0x3c3b81[_0x30568d(0x14e)];}}const _0x2d4f9a=loadUserConfigOnce();if(_0x2d4f9a[_0xbee777])return _0x2d4f9a[_0xbee777];if(_0x2d4f9a[_0x30568d(0x14e)])return _0x2d4f9a[_0x30568d(0x14e)];return undefined;}export function normalizeProfileForEnvVar(_0x22118f){const _0x1e0665=a44_0x2cba;return _0x22118f[_0x1e0665(0x10f)]()['replace'](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x551329,_0x219906){const _0x17373d=a44_0x2cba,_0x212fcb=_0x219906||getActiveProfileName()||undefined;if(_0x212fcb){const _0x702796=_0x17373d(0x12f)+normalizeProfileForEnvVar(_0x212fcb);if(process[_0x17373d(0x11f)][_0x702796])return{'apiKey':process['env'][_0x702796],'source':_0x702796+'\x20env\x20var','isDeprecated':![]};const _0xf496ec=getCachedCredential(_0x551329,_0x212fcb);if(_0xf496ec)return{'apiKey':_0xf496ec,'source':'keychain\x20(profile:\x20'+_0x212fcb+')','isDeprecated':![]};const _0x15266f=await getKeychainAPIKey(_0x212fcb);if(_0x15266f)return setCachedCredential(_0x15266f,_0x551329,_0x212fcb),{'apiKey':_0x15266f,'source':_0x17373d(0x147)+_0x212fcb+')','isDeprecated':![]};}if(process[_0x17373d(0x11f)][_0x17373d(0x10b)])return{'apiKey':process[_0x17373d(0x11f)][_0x17373d(0x10b)],'source':'TDX_API_KEY\x20env\x20var','isDeprecated':![]};if(!_0x212fcb){const _0x581664=getCachedCredential(_0x551329,undefined);if(_0x581664)return{'apiKey':_0x581664,'source':_0x17373d(0x126),'isDeprecated':![]};const _0x459bb9=await getKeychainAPIKey(undefined);if(_0x459bb9)return setCachedCredential(_0x459bb9,_0x551329,undefined),{'apiKey':_0x459bb9,'source':_0x17373d(0x126),'isDeprecated':![]};}if(process[_0x17373d(0x11f)]['TD_API_KEY'])return{'apiKey':process[_0x17373d(0x11f)]['TD_API_KEY'],'source':_0x17373d(0x130),'isDeprecated':!![]};const _0x4f005b=getLegacyEnvAPIKey(_0x551329,_0x212fcb);if(_0x4f005b){const _0x3ec9f3=await isKeychainAvailable();if(_0x3ec9f3)try{await saveKeychainAPIKey(_0x4f005b,_0x212fcb),setCachedCredential(_0x4f005b,_0x551329,_0x212fcb);const _0x207eae=getConfigFilePath(_0x212fcb);cleanupLegacyEnvFile(_0x207eae)&&console[_0x17373d(0x138)](a44_0x5e5e1a[_0x17373d(0x11c)]('⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage'));}catch(_0x50f9b2){console[_0x17373d(0x138)](a44_0x5e5e1a[_0x17373d(0x11c)](_0x17373d(0x14a)+_0x50f9b2));}const _0x9e4f1b=_0x212fcb?_0x17373d(0x113)+_0x212fcb+')':_0x17373d(0x12b);return{'apiKey':_0x4f005b,'source':_0x9e4f1b,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0xe6e5e7,_0x16b30a,_0x4172d7=!![]){const _0x2b366b=a44_0x2cba,_0x5d63ae=await resolveAPIKeyAsync(_0xe6e5e7,_0x16b30a);if(!_0x5d63ae)return undefined;if(_0x4172d7&&_0x5d63ae[_0x2b366b(0x121)]&&_0x5d63ae[_0x2b366b(0x123)][_0x2b366b(0x122)](_0x2b366b(0x14e))){const _0x5ae047=_0x16b30a||getActiveProfileName()||undefined,_0x3a9bae=_0x5ae047?'TDX_API_KEY_'+normalizeProfileForEnvVar(_0x5ae047):_0x2b366b(0x14d);console[_0x2b366b(0x138)](a44_0x5e5e1a['yellow'](_0x2b366b(0x114)+(_0x2b366b(0x109)+_0x3a9bae+').')));}return _0x5d63ae[_0x2b366b(0x11e)];}function getLegacyEnvAPIKey(_0x364a1f,_0x43422b){const _0x423f58=a44_0x2cba,_0x5acabe=_0x364a1f[_0x423f58(0x10f)]()[_0x423f58(0x106)](/-/g,'_'),_0x3203eb=_0x423f58(0x131)+_0x5acabe;if(_0x43422b){const _0x409a3f=loadProfileEnv(_0x43422b);if(_0x409a3f){if(_0x409a3f[_0x3203eb])return _0x409a3f[_0x3203eb];if(_0x409a3f[_0x423f58(0x14e)])return _0x409a3f[_0x423f58(0x14e)];}}const _0x5a68d8=loadUserConfigOnce();if(_0x5a68d8[_0x3203eb])return _0x5a68d8[_0x3203eb];if(_0x5a68d8['TD_API_KEY'])return _0x5a68d8[_0x423f58(0x14e)];return undefined;}function cleanupLegacyEnvFile(_0x276dd9){const _0x20440c=a44_0x2cba;if(!existsSync(_0x276dd9))return![];try{const _0xee5a22=readFileSync(_0x276dd9,_0x20440c(0x149)),_0x49d7fa=_0xee5a22[_0x20440c(0x11a)]('\x0a'),_0x4bce7c=_0x49d7fa[_0x20440c(0x10e)](_0x3dacc2=>{const _0x49f7dc=_0x20440c,_0xc4ce80=_0x3dacc2['trim']();if(!_0xc4ce80||_0xc4ce80[_0x49f7dc(0x143)]('#'))return!![];const [_0x13aeb6]=_0xc4ce80[_0x49f7dc(0x11a)]('=');return!_0x13aeb6[_0x49f7dc(0x143)](_0x49f7dc(0x14e));}),_0x117b27=_0x4bce7c[_0x20440c(0x102)](_0x454999=>{const _0x3c6638=_0x20440c,_0x2d5d20=_0x454999[_0x3c6638(0x111)]();return _0x2d5d20&&!_0x2d5d20[_0x3c6638(0x143)]('#');});if(!_0x117b27)return unlinkSync(_0x276dd9),!![];return writeFileSync(_0x276dd9,_0x4bce7c[_0x20440c(0x140)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x4cdba8){const _0x4a89d0=a44_0x2cba,_0x651b40=a44_0x4cac25[_0x4a89d0(0x140)](getConfigDir(),'.env.'+_0x4cdba8);if(a44_0x49280f['existsSync'](_0x651b40)){validateSecureFilePermissions(_0x651b40);try{const _0x423694=a44_0x49280f[_0x4a89d0(0x103)](_0x651b40,_0x4a89d0(0x149));return parseEnvFile(_0x423694);}catch(_0x244a70){console['warn'](_0x4a89d0(0x127)+_0x651b40+':\x20'+_0x244a70);}}const _0x31de21=a44_0x4cac25[_0x4a89d0(0x140)](getConfigDir(),_0x4a89d0(0x13d),_0x4cdba8,_0x4a89d0(0x118));if(a44_0x49280f[_0x4a89d0(0x141)](_0x31de21)){validateSecureFilePermissions(_0x31de21);try{const _0x484817=a44_0x49280f['readFileSync'](_0x31de21,'utf-8');return parseEnvFile(_0x484817);}catch(_0xf69764){return console[_0x4a89d0(0x138)](_0x4a89d0(0x127)+_0x31de21+':\x20'+_0xf69764),null;}}return null;}function getActiveProfileName(){const _0x4e0c71=a44_0x2cba,_0x27f871=a44_0x4cac25['join'](getConfigDir(),'tdx.json');if(!a44_0x49280f[_0x4e0c71(0x141)](_0x27f871))return null;try{const _0x3a3960=a44_0x49280f['readFileSync'](_0x27f871,_0x4e0c71(0x149)),_0x29cafe=JSON['parse'](_0x3a3960);return _0x29cafe[_0x4e0c71(0x104)]||null;}catch{return null;}}function a44_0x16ef(){const _0x1d8e70=['site','TDX_API_KEY_','TD_API_KEY\x20env\x20var\x20(deprecated)','TD_API_KEY_','jp01','9849133OLnKxe','.cache','7858224BNhHIT','ap03','toISOString','warn','parse','TDX_CONFIG_DIR','ap02','apiKeys','profiles','entries','\x27,\x20defaulting\x20to\x20us01','join','existsSync','account_info.','startsWith','694725rNTPik','8vGerro','229173aLxJZs','keychain\x20(profile:\x20','stringify','utf-8','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','eu01','3750CLAudg','TDX_API_KEY_<PROFILE>','TD_API_KEY','TDX_CACHE_DIR','slice','some','readFileSync','profile','2FHwzje','replace','stg-jp01','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','us01','TDX_API_KEY','dev-us01','.config','filter','toUpperCase','471202mviChK','trim','Warning:\x20Unknown\x20site\x20\x27','legacy\x20.env\x20file\x20(profile:\x20','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','account_info.json','836YAeXEU','match','.env','4LnLCAC','split','stg-us01','yellow','dev-eu01','apiKey','env','map','isDeprecated','includes','source','10877094WwEscQ','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','keychain','Warning:\x20Failed\x20to\x20load\x20','llm_default_project.','endsWith','string','legacy\x20.env\x20file','accountId','.env.'];a44_0x16ef=function(){return _0x1d8e70;};return a44_0x16ef();}export function saveAPIKey(_0xcf2c67,_0xbef4f0,_0x5b48dd){const _0x27fec8=a44_0x2cba,_0x448d22=getConfigDir(),_0x234fc7=getConfigFilePath(_0x5b48dd);!existsSync(_0x448d22)&&mkdirSync(_0x448d22,{'recursive':!![],'mode':0x1c0});let _0x2319e7={};if(existsSync(_0x234fc7))try{const _0x9bfe99=readFileSync(_0x234fc7,_0x27fec8(0x149));_0x2319e7=parseEnvFile(_0x9bfe99);}catch(_0x1c4895){console[_0x27fec8(0x138)]('Warning:\x20Failed\x20to\x20read\x20'+_0x234fc7+':',_0x1c4895);}const _0x313f60=_0xcf2c67['toUpperCase']()[_0x27fec8(0x106)](/-/g,'_');_0x2319e7[_0x27fec8(0x131)+_0x313f60]=_0xbef4f0;const _0x522e1f=Object[_0x27fec8(0x13e)](_0x2319e7)[_0x27fec8(0x120)](([_0x4b04dc,_0xf399bc])=>_0x4b04dc+'='+_0xf399bc);writeFileSync(_0x234fc7,_0x522e1f[_0x27fec8(0x140)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0xef2aab,_0x3d0058,_0x4822f8){const _0x155065=a44_0x2cba;await saveKeychainAPIKey(_0xef2aab,_0x4822f8),setCachedCredential(_0xef2aab,_0x3d0058,_0x4822f8);const _0xe0d519=getConfigFilePath(_0x4822f8);cleanupLegacyEnvFile(_0xe0d519)&&console[_0x155065(0x138)](a44_0x5e5e1a[_0x155065(0x11c)](_0x155065(0x125)));}export function loadConfig(){const _0x332529=a44_0x2cba,_0x5d9bb0={'apiKeys':{},'defaultSite':_0x332529(0x10a)},_0x476c7d=[_0x332529(0x10a),_0x332529(0x132),'eu01',_0x332529(0x13b),_0x332529(0x136),_0x332529(0x10c),_0x332529(0x11d),_0x332529(0x11b),'stg-jp01','stg-ap03'];for(const _0x364713 of _0x476c7d){const _0x36c5d9=getAPIKey(_0x364713);_0x36c5d9&&(_0x5d9bb0[_0x332529(0x13c)][_0x364713]=_0x36c5d9);}return _0x5d9bb0;}
1
+ (function(_0x31271e,_0x4d2082){const _0x30c5ee=a44_0x1b84,_0x2532d1=_0x31271e();while(!![]){try{const _0x5ea704=parseInt(_0x30c5ee(0x144))/0x1*(parseInt(_0x30c5ee(0x150))/0x2)+-parseInt(_0x30c5ee(0x15e))/0x3*(parseInt(_0x30c5ee(0x13b))/0x4)+parseInt(_0x30c5ee(0x159))/0x5+parseInt(_0x30c5ee(0x128))/0x6+-parseInt(_0x30c5ee(0x160))/0x7+parseInt(_0x30c5ee(0x12e))/0x8+-parseInt(_0x30c5ee(0x16a))/0x9;if(_0x5ea704===_0x4d2082)break;else _0x2532d1['push'](_0x2532d1['shift']());}catch(_0x2edd07){_0x2532d1['push'](_0x2532d1['shift']());}}}(a44_0xc586,0x98d5c));function a44_0xc586(){const _0x30303d=['startsWith','3185184OswShP','Warning:\x20Failed\x20to\x20load\x20','entries','TDX_API_KEY','dev-us01','llm_default_project','isDeprecated','existsSync','.json','us01','number','tdx.json','eu01','1614876IBYCHW','apiKeys','env','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','apiKey','name','TDX_API_KEY_<PROFILE>','tdx','accountId','16143rgXuMu','includes','trim','account_info.','keychain','some','jp01','slice','string','site','warn','.env.','82WQtdsf','readFileSync','endsWith','keychain\x20(profile:\x20','profiles','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','account_info.json','\x20env\x20var','map','4309780oZRlaJ','.env','dev-eu01','TD_API_KEY_','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','3nzSHCQ','split','8270920NVhtXA','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','Warning:\x20Failed\x20to\x20read\x20','source','ap03','join','replace','legacy\x20.env\x20file\x20(profile:\x20','toUpperCase','stringify','8539200tSxICj','toISOString','parse','legacy\x20.env\x20file','TD_API_KEY','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','ap02','llm_default_project.','stg-jp01','TD_API_KEY\x20env\x20var\x20(deprecated)','7428744yOLBLU','utf-8','match','yellow','stg-us01'];a44_0xc586=function(){return _0x30303d;};return a44_0xc586();}import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a44_0x28f01c from'node:fs';import*as a44_0x3e21ee 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 a44_0x28a917 from'chalk';export function getConfigDir(){const _0x41a994=a44_0x1b84;return process[_0x41a994(0x13d)]['TDX_CONFIG_DIR']||join(homedir(),'.config',_0x41a994(0x142));}export function getConfigFile(){const _0x38e9a5=a44_0x1b84;return join(getConfigDir(),_0x38e9a5(0x15a));}export function getConfigFilePath(_0x283766){const _0x233c37=a44_0x1b84,_0x25734b=getConfigDir();return _0x283766?a44_0x3e21ee[_0x233c37(0x165)](_0x25734b,'.env.'+_0x283766):getConfigFile();}export function getCacheDir(){const _0x42e7ee=a44_0x1b84;return process[_0x42e7ee(0x13d)]['TDX_CACHE_DIR']||join(homedir(),'.cache',_0x42e7ee(0x142));}export function getLLMProjectCacheFile(_0x136148){const _0xa36a0d=a44_0x1b84,_0x166701=_0x136148?_0xa36a0d(0x171)+_0x136148:_0xa36a0d(0x133);return join(getCacheDir(),_0x166701);}export function readCachedLLMProject(_0x3cd37b){const _0x15efd7=a44_0x1b84;try{const _0x39711b=getLLMProjectCacheFile(_0x3cd37b);if(!existsSync(_0x39711b))return null;const _0x529848=readFileSync(_0x39711b,_0x15efd7(0x129))[_0x15efd7(0x146)]();try{const _0x422ca8=JSON['parse'](_0x529848);if(_0x422ca8&&typeof _0x422ca8['id']===_0x15efd7(0x14c)&&typeof _0x422ca8[_0x15efd7(0x140)]===_0x15efd7(0x14c))return _0x422ca8;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x562278,_0x510e9a,_0x42425e){const _0x10569c=a44_0x1b84;try{const _0x258db5=getCacheDir(),_0x1e8101=getLLMProjectCacheFile(_0x42425e);!existsSync(_0x258db5)&&mkdirSync(_0x258db5,{'recursive':!![]});const _0x4af50a={'name':_0x562278,'id':_0x510e9a};writeFileSync(_0x1e8101,JSON[_0x10569c(0x169)](_0x4af50a),_0x10569c(0x129));}catch{}}export function getAccountInfoCacheFile(_0x544451){const _0xaca0d9=a44_0x1b84,_0x1ded94=_0x544451?_0xaca0d9(0x147)+_0x544451+_0xaca0d9(0x136):_0xaca0d9(0x156);return join(getCacheDir(),_0x1ded94);}export function readCachedAccountInfo(_0x18b1fc){const _0x215d4a=a44_0x1b84;try{const _0x9ce861=getAccountInfoCacheFile(_0x18b1fc);if(!existsSync(_0x9ce861))return null;const _0x7bf470=readFileSync(_0x9ce861,_0x215d4a(0x129))[_0x215d4a(0x146)](),_0x19a7d6=JSON[_0x215d4a(0x16c)](_0x7bf470);if(_0x19a7d6&&typeof _0x19a7d6[_0x215d4a(0x14d)]===_0x215d4a(0x14c)&&typeof _0x19a7d6[_0x215d4a(0x143)]===_0x215d4a(0x138))return _0x19a7d6;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x1564b7,_0x5a5198,_0x2fd474){const _0x5b13eb=a44_0x1b84;try{const _0x5ead36=getCacheDir(),_0x152ef1=getAccountInfoCacheFile(_0x2fd474);!existsSync(_0x5ead36)&&mkdirSync(_0x5ead36,{'recursive':!![]});const _0x1c5c78={'site':_0x1564b7,'accountId':_0x5a5198,'cachedAt':new Date()[_0x5b13eb(0x16b)]()};writeFileSync(_0x152ef1,JSON[_0x5b13eb(0x169)](_0x1c5c78),'utf-8');}catch{}}export function parseEnvFile(_0x14c9aa){const _0x43b41a=a44_0x1b84,_0x4f492b={};for(const _0x5b4712 of _0x14c9aa[_0x43b41a(0x15f)]('\x0a')){const _0x3ddbeb=_0x5b4712[_0x43b41a(0x146)]();if(!_0x3ddbeb||_0x3ddbeb[_0x43b41a(0x12d)]('#'))continue;const _0x12299a=_0x3ddbeb[_0x43b41a(0x12a)](/^([^=]+)=(.*)$/);if(_0x12299a){const _0x42286c=_0x12299a[0x1][_0x43b41a(0x146)]();let _0x165dce=_0x12299a[0x2]['trim']();(_0x165dce[_0x43b41a(0x12d)]('\x22')&&_0x165dce[_0x43b41a(0x152)]('\x22')||_0x165dce[_0x43b41a(0x12d)]('\x27')&&_0x165dce[_0x43b41a(0x152)]('\x27'))&&(_0x165dce=_0x165dce[_0x43b41a(0x14b)](0x1,-0x1)),_0x4f492b[_0x42286c]=_0x165dce;}}return _0x4f492b;}export function readUserConfig(){const _0x46f285=a44_0x1b84,_0x49baf9=getConfigFile();if(!existsSync(_0x49baf9))return{};try{const _0x32900f=readFileSync(_0x49baf9,_0x46f285(0x129));return parseEnvFile(_0x32900f);}catch(_0x5eb03e){return console[_0x46f285(0x14e)](_0x46f285(0x155)+_0x49baf9+':',_0x5eb03e),{};}}export function resolveSite(_0x3964a3){const _0x399b07=a44_0x1b84,_0x10504a=[_0x399b07(0x137),'jp01',_0x399b07(0x13a),_0x399b07(0x170),'ap03',_0x399b07(0x132),_0x399b07(0x15b),_0x399b07(0x12c),_0x399b07(0x126),'stg-ap03'];if(_0x10504a['includes'](_0x3964a3))return _0x3964a3;if(_0x3964a3 in SITE_ALIASES)return SITE_ALIASES[_0x3964a3];return console[_0x399b07(0x14e)]('Warning:\x20Unknown\x20site\x20\x27'+_0x3964a3+'\x27,\x20defaulting\x20to\x20us01'),_0x399b07(0x137);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x33bbb3,_0xdb0a1d){const _0x4fcfac=a44_0x1b84,_0x129814=_0xdb0a1d||getActiveProfileName();if(_0x129814){const _0x31bab2='TDX_API_KEY_'+normalizeProfileForEnvVar(_0x129814);if(process[_0x4fcfac(0x13d)][_0x31bab2])return process[_0x4fcfac(0x13d)][_0x31bab2];}if(process[_0x4fcfac(0x13d)][_0x4fcfac(0x131)])return process['env'][_0x4fcfac(0x131)];if(process[_0x4fcfac(0x13d)][_0x4fcfac(0x16e)])return process[_0x4fcfac(0x13d)][_0x4fcfac(0x16e)];const _0x215660=_0x33bbb3[_0x4fcfac(0x168)]()[_0x4fcfac(0x166)](/-/g,'_'),_0x316229=_0x4fcfac(0x15c)+_0x215660;if(_0x129814){const _0x1012e5=loadProfileEnv(_0x129814);if(_0x1012e5){if(_0x1012e5[_0x316229])return _0x1012e5[_0x316229];if(_0x1012e5[_0x4fcfac(0x16e)])return _0x1012e5[_0x4fcfac(0x16e)];}}const _0x118e24=loadUserConfigOnce();if(_0x118e24[_0x316229])return _0x118e24[_0x316229];if(_0x118e24['TD_API_KEY'])return _0x118e24[_0x4fcfac(0x16e)];return undefined;}function a44_0x1b84(_0x579bfb,_0x367f9a){_0x579bfb=_0x579bfb-0x126;const _0xc586f7=a44_0xc586();let _0x1b8457=_0xc586f7[_0x579bfb];return _0x1b8457;}export function normalizeProfileForEnvVar(_0x4adacd){const _0x5b9951=a44_0x1b84;return _0x4adacd[_0x5b9951(0x168)]()[_0x5b9951(0x166)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x1dac87,_0x5a8ac4){const _0x386810=a44_0x1b84,_0x279b51=_0x5a8ac4||getActiveProfileName()||undefined;if(_0x279b51){const _0x211abc='TDX_API_KEY_'+normalizeProfileForEnvVar(_0x279b51);if(process[_0x386810(0x13d)][_0x211abc])return{'apiKey':process[_0x386810(0x13d)][_0x211abc],'source':_0x211abc+_0x386810(0x157),'isDeprecated':![]};const _0x5d9f78=getCachedCredential(_0x1dac87,_0x279b51);if(_0x5d9f78)return{'apiKey':_0x5d9f78,'source':'keychain\x20(profile:\x20'+_0x279b51+')','isDeprecated':![]};const _0x12c214=await getKeychainAPIKey(_0x279b51);if(_0x12c214)return setCachedCredential(_0x12c214,_0x1dac87,_0x279b51),{'apiKey':_0x12c214,'source':_0x386810(0x153)+_0x279b51+')','isDeprecated':![]};}if(process[_0x386810(0x13d)][_0x386810(0x131)])return{'apiKey':process[_0x386810(0x13d)]['TDX_API_KEY'],'source':'TDX_API_KEY\x20env\x20var','isDeprecated':![]};if(!_0x279b51){const _0x5426a9=getCachedCredential(_0x1dac87,undefined);if(_0x5426a9)return{'apiKey':_0x5426a9,'source':_0x386810(0x148),'isDeprecated':![]};const _0x1230c7=await getKeychainAPIKey(undefined);if(_0x1230c7)return setCachedCredential(_0x1230c7,_0x1dac87,undefined),{'apiKey':_0x1230c7,'source':'keychain','isDeprecated':![]};}if(process[_0x386810(0x13d)][_0x386810(0x16e)])return{'apiKey':process['env'][_0x386810(0x16e)],'source':_0x386810(0x127),'isDeprecated':!![]};const _0x41f58c=getLegacyEnvAPIKey(_0x1dac87,_0x279b51);if(_0x41f58c){const _0x258d94=await isKeychainAvailable();if(_0x258d94)try{await saveKeychainAPIKey(_0x41f58c,_0x279b51),setCachedCredential(_0x41f58c,_0x1dac87,_0x279b51);const _0x1a605f=getConfigFilePath(_0x279b51);cleanupLegacyEnvFile(_0x1a605f)&&console[_0x386810(0x14e)](a44_0x28a917[_0x386810(0x12b)](_0x386810(0x16f)));}catch(_0x50162e){console['warn'](a44_0x28a917[_0x386810(0x12b)](_0x386810(0x15d)+_0x50162e));}const _0x1dfcd3=_0x279b51?_0x386810(0x167)+_0x279b51+')':_0x386810(0x16d);return{'apiKey':_0x41f58c,'source':_0x1dfcd3,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x2f697c,_0x1f1a16,_0x3e12a1=!![]){const _0x52997c=a44_0x1b84,_0x273ec1=await resolveAPIKeyAsync(_0x2f697c,_0x1f1a16);if(!_0x273ec1)return undefined;if(_0x3e12a1&&_0x273ec1[_0x52997c(0x134)]&&_0x273ec1[_0x52997c(0x163)][_0x52997c(0x145)](_0x52997c(0x16e))){const _0x37be22=_0x1f1a16||getActiveProfileName()||undefined,_0x1cbdf5=_0x37be22?'TDX_API_KEY_'+normalizeProfileForEnvVar(_0x37be22):_0x52997c(0x141);console[_0x52997c(0x14e)](a44_0x28a917[_0x52997c(0x12b)]('Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a'+(_0x52997c(0x13e)+_0x1cbdf5+').')));}return _0x273ec1[_0x52997c(0x13f)];}function getLegacyEnvAPIKey(_0x3affee,_0x58832e){const _0x5e4b7b=a44_0x1b84,_0x5b2404=_0x3affee[_0x5e4b7b(0x168)]()[_0x5e4b7b(0x166)](/-/g,'_'),_0xbba3b3='TD_API_KEY_'+_0x5b2404;if(_0x58832e){const _0x456d73=loadProfileEnv(_0x58832e);if(_0x456d73){if(_0x456d73[_0xbba3b3])return _0x456d73[_0xbba3b3];if(_0x456d73[_0x5e4b7b(0x16e)])return _0x456d73['TD_API_KEY'];}}const _0x58690b=loadUserConfigOnce();if(_0x58690b[_0xbba3b3])return _0x58690b[_0xbba3b3];if(_0x58690b[_0x5e4b7b(0x16e)])return _0x58690b[_0x5e4b7b(0x16e)];return undefined;}function cleanupLegacyEnvFile(_0x46f3a2){const _0x439e4a=a44_0x1b84;if(!existsSync(_0x46f3a2))return![];try{const _0x3d82d5=readFileSync(_0x46f3a2,_0x439e4a(0x129)),_0x32ba9b=_0x3d82d5[_0x439e4a(0x15f)]('\x0a'),_0x226bd3=_0x32ba9b['filter'](_0x46a821=>{const _0x2f5647=_0x439e4a,_0x4c2219=_0x46a821[_0x2f5647(0x146)]();if(!_0x4c2219||_0x4c2219['startsWith']('#'))return!![];const [_0x2ad1dc]=_0x4c2219[_0x2f5647(0x15f)]('=');return!_0x2ad1dc[_0x2f5647(0x12d)]('TD_API_KEY');}),_0x59f355=_0x226bd3[_0x439e4a(0x149)](_0x3c8b76=>{const _0x24f8eb=_0x439e4a,_0xb1deed=_0x3c8b76['trim']();return _0xb1deed&&!_0xb1deed[_0x24f8eb(0x12d)]('#');});if(!_0x59f355)return unlinkSync(_0x46f3a2),!![];return writeFileSync(_0x46f3a2,_0x226bd3['join']('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x5853c8){const _0xf9b379=a44_0x1b84,_0x34cec5=a44_0x3e21ee[_0xf9b379(0x165)](getConfigDir(),_0xf9b379(0x14f)+_0x5853c8);if(a44_0x28f01c[_0xf9b379(0x135)](_0x34cec5)){validateSecureFilePermissions(_0x34cec5);try{const _0x148b0c=a44_0x28f01c['readFileSync'](_0x34cec5,'utf-8');return parseEnvFile(_0x148b0c);}catch(_0x10b597){console[_0xf9b379(0x14e)](_0xf9b379(0x12f)+_0x34cec5+':\x20'+_0x10b597);}}const _0x1c2505=a44_0x3e21ee[_0xf9b379(0x165)](getConfigDir(),_0xf9b379(0x154),_0x5853c8,_0xf9b379(0x15a));if(a44_0x28f01c[_0xf9b379(0x135)](_0x1c2505)){validateSecureFilePermissions(_0x1c2505);try{const _0x504e89=a44_0x28f01c[_0xf9b379(0x151)](_0x1c2505,_0xf9b379(0x129));return parseEnvFile(_0x504e89);}catch(_0x12bbc3){return console[_0xf9b379(0x14e)](_0xf9b379(0x12f)+_0x1c2505+':\x20'+_0x12bbc3),null;}}return null;}function getActiveProfileName(){const _0x776f1c=a44_0x1b84,_0x3e31cc=a44_0x3e21ee[_0x776f1c(0x165)](getConfigDir(),_0x776f1c(0x139));if(!a44_0x28f01c[_0x776f1c(0x135)](_0x3e31cc))return null;try{const _0x46281a=a44_0x28f01c[_0x776f1c(0x151)](_0x3e31cc,_0x776f1c(0x129)),_0x258b0a=JSON[_0x776f1c(0x16c)](_0x46281a);return _0x258b0a['profile']||null;}catch{return null;}}export function saveAPIKey(_0x30ccb5,_0x4bc1b1,_0x3a549c){const _0x2232ab=a44_0x1b84,_0x1bbd9e=getConfigDir(),_0xfb82d=getConfigFilePath(_0x3a549c);!existsSync(_0x1bbd9e)&&mkdirSync(_0x1bbd9e,{'recursive':!![],'mode':0x1c0});let _0x71120c={};if(existsSync(_0xfb82d))try{const _0x7c3b20=readFileSync(_0xfb82d,_0x2232ab(0x129));_0x71120c=parseEnvFile(_0x7c3b20);}catch(_0x48f9af){console[_0x2232ab(0x14e)](_0x2232ab(0x162)+_0xfb82d+':',_0x48f9af);}const _0x385a79=_0x30ccb5[_0x2232ab(0x168)]()['replace'](/-/g,'_');_0x71120c[_0x2232ab(0x15c)+_0x385a79]=_0x4bc1b1;const _0x389e76=Object[_0x2232ab(0x130)](_0x71120c)[_0x2232ab(0x158)](([_0x28a072,_0x5a8575])=>_0x28a072+'='+_0x5a8575);writeFileSync(_0xfb82d,_0x389e76['join']('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x196c37,_0x5ab195,_0x23bc78){const _0x353adc=a44_0x1b84;await saveKeychainAPIKey(_0x196c37,_0x23bc78),setCachedCredential(_0x196c37,_0x5ab195,_0x23bc78);const _0x241716=getConfigFilePath(_0x23bc78);cleanupLegacyEnvFile(_0x241716)&&console['warn'](a44_0x28a917[_0x353adc(0x12b)](_0x353adc(0x161)));}export function loadConfig(){const _0x2deb72=a44_0x1b84,_0x5d35e9={'apiKeys':{},'defaultSite':'us01'},_0x49ec50=[_0x2deb72(0x137),_0x2deb72(0x14a),'eu01',_0x2deb72(0x170),_0x2deb72(0x164),'dev-us01','dev-eu01',_0x2deb72(0x12c),_0x2deb72(0x126),'stg-ap03'];for(const _0xa9b475 of _0x49ec50){const _0x2a233b=getAPIKey(_0xa9b475);_0x2a233b&&(_0x5d35e9[_0x2deb72(0x13c)][_0xa9b475]=_0x2a233b);}return _0x5d35e9;}
@@ -1 +1 @@
1
- (function(_0x4f3fbf,_0x4e6701){const _0x12a22d=a45_0x1508,_0x29eb22=_0x4f3fbf();while(!![]){try{const _0x465632=-parseInt(_0x12a22d(0x18d))/0x1*(-parseInt(_0x12a22d(0x193))/0x2)+-parseInt(_0x12a22d(0x18c))/0x3+parseInt(_0x12a22d(0x18b))/0x4+-parseInt(_0x12a22d(0x189))/0x5*(-parseInt(_0x12a22d(0x191))/0x6)+parseInt(_0x12a22d(0x18e))/0x7*(-parseInt(_0x12a22d(0x18a))/0x8)+-parseInt(_0x12a22d(0x188))/0x9+-parseInt(_0x12a22d(0x183))/0xa*(parseInt(_0x12a22d(0x185))/0xb);if(_0x465632===_0x4e6701)break;else _0x29eb22['push'](_0x29eb22['shift']());}catch(_0x745cf4){_0x29eb22['push'](_0x29eb22['shift']());}}}(a45_0x66fe,0xf2f9f));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';function a45_0x1508(_0x467181,_0x102c7f){_0x467181=_0x467181-0x182;const _0x66fe8f=a45_0x66fe();let _0x150861=_0x66fe8f[_0x467181];return _0x150861;}import{getCacheDir}from'./config.js';function getCacheFilePath(_0x37dfc5){const _0x181068=a45_0x1508,_0x9ad02a=_0x37dfc5||'default';return join(getCacheDir(),_0x181068(0x182)+_0x9ad02a+_0x181068(0x186));}export function loadCachedConnections(_0x566a91){const _0x1929de=a45_0x1508,_0x2524e1=getCacheFilePath(_0x566a91);if(!existsSync(_0x2524e1))return null;try{const _0x411f21=readFileSync(_0x2524e1,_0x1929de(0x187)),_0x5687a6=JSON[_0x1929de(0x192)](_0x411f21);return _0x5687a6[_0x1929de(0x18f)];}catch{return null;}}export function saveCachedConnections(_0x162a4e,_0x252666){const _0x14b017=a45_0x1508,_0x2c9c61=getCacheDir();!existsSync(_0x2c9c61)&&mkdirSync(_0x2c9c61,{'recursive':!![]});const _0x3e4566=getCacheFilePath(_0x162a4e),_0x26b373={'connections':_0x252666,'cachedAt':Date[_0x14b017(0x190)]()};writeFileSync(_0x3e4566,JSON[_0x14b017(0x184)](_0x26b373,null,0x2),_0x14b017(0x187));}export function clearConnectionCache(_0xef4918){const _0x1c1381=getCacheFilePath(_0xef4918);if(existsSync(_0x1c1381))try{unlinkSync(_0x1c1381);}catch{}}function a45_0x66fe(){const _0x50b209=['64158QxFeNn','parse','3593698DrSmrs','connections-','1160bXPyZV','stringify','13013CxffFv','.json','utf-8','13458276HicNTk','865byzeiT','16xyklAj','4027220VurVnE','5246466AfOELd','1ADJNsG','969143izQXoU','connections','now'];a45_0x66fe=function(){return _0x50b209;};return a45_0x66fe();}
1
+ function a45_0x3d18(_0x5ef428,_0x358b05){_0x5ef428=_0x5ef428-0xeb;const _0x5b99d9=a45_0x5b99();let _0x3d1883=_0x5b99d9[_0x5ef428];return _0x3d1883;}(function(_0x5eb756,_0x3d3201){const _0x4174b5=a45_0x3d18,_0x4a980c=_0x5eb756();while(!![]){try{const _0x408869=parseInt(_0x4174b5(0xf4))/0x1*(-parseInt(_0x4174b5(0xed))/0x2)+parseInt(_0x4174b5(0xf0))/0x3+parseInt(_0x4174b5(0xef))/0x4*(-parseInt(_0x4174b5(0xf1))/0x5)+parseInt(_0x4174b5(0xfb))/0x6+parseInt(_0x4174b5(0xec))/0x7+parseInt(_0x4174b5(0xf9))/0x8*(parseInt(_0x4174b5(0xfa))/0x9)+parseInt(_0x4174b5(0xeb))/0xa*(-parseInt(_0x4174b5(0xf3))/0xb);if(_0x408869===_0x3d3201)break;else _0x4a980c['push'](_0x4a980c['shift']());}catch(_0x1b817c){_0x4a980c['push'](_0x4a980c['shift']());}}}(a45_0x5b99,0xd962d));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';import{getCacheDir}from'./config.js';function getCacheFilePath(_0xa8df0){const _0x4e97b2=a45_0x3d18,_0x2fd262=_0xa8df0||_0x4e97b2(0xf8);return join(getCacheDir(),_0x4e97b2(0xf5)+_0x2fd262+_0x4e97b2(0xf2));}function a45_0x5b99(){const _0x2a45c8=['510oAGfrD','8752205nnHNsB','897210EfGzBu','stringify','4LxEHAo','5147964vvNbtt','308015HwWZln','.json','677809WzKFSY','2rgUiJw','connections-','utf-8','connections','default','10328YQBtiB','10485csagND','3128862ZkvcTV'];a45_0x5b99=function(){return _0x2a45c8;};return a45_0x5b99();}export function loadCachedConnections(_0x4980e6){const _0x29c283=a45_0x3d18,_0x48767e=getCacheFilePath(_0x4980e6);if(!existsSync(_0x48767e))return null;try{const _0x5e4f8f=readFileSync(_0x48767e,'utf-8'),_0x543a81=JSON['parse'](_0x5e4f8f);return _0x543a81[_0x29c283(0xf7)];}catch{return null;}}export function saveCachedConnections(_0x3a020f,_0x56a3cb){const _0x201bb4=a45_0x3d18,_0x1f03cf=getCacheDir();!existsSync(_0x1f03cf)&&mkdirSync(_0x1f03cf,{'recursive':!![]});const _0xc3530e=getCacheFilePath(_0x3a020f),_0x5be2cd={'connections':_0x56a3cb,'cachedAt':Date['now']()};writeFileSync(_0xc3530e,JSON[_0x201bb4(0xee)](_0x5be2cd,null,0x2),_0x201bb4(0xf6));}export function clearConnectionCache(_0x50fcd6){const _0x82df9c=getCacheFilePath(_0x50fcd6);if(existsSync(_0x82df9c))try{unlinkSync(_0x82df9c);}catch{}}