@treasuredata/tdx 0.9.6 → 0.9.8

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 (123) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/client/cdp-api-client.js +1 -1
  6. package/dist/client/engage-api-client.js +1 -1
  7. package/dist/client/http-client.js +1 -1
  8. package/dist/client/llm-api-client.js +1 -1
  9. package/dist/client/rate-limiter.js +1 -1
  10. package/dist/client/td-api-client.js +1 -1
  11. package/dist/client/trino-api-client.js +1 -1
  12. package/dist/client/workflow-client.js +1 -1
  13. package/dist/commands/activations.js +1 -1
  14. package/dist/commands/agent-command.js +1 -1
  15. package/dist/commands/api-command.js +1 -1
  16. package/dist/commands/auth-command.js +1 -1
  17. package/dist/commands/chat-command.js +1 -1
  18. package/dist/commands/claude-command.js +1 -1
  19. package/dist/commands/claude-statusline-command.js +1 -1
  20. package/dist/commands/claude-usage-command.js +1 -1
  21. package/dist/commands/command.js +1 -1
  22. package/dist/commands/connection-command.js +1 -1
  23. package/dist/commands/context-command.js +1 -1
  24. package/dist/commands/databases.js +1 -1
  25. package/dist/commands/describe.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/llm-command.js +1 -1
  30. package/dist/commands/llm-proxy.js +1 -1
  31. package/dist/commands/parent-segment-command.js +1 -1
  32. package/dist/commands/profiles-command.js +1 -1
  33. package/dist/commands/query-command.js +1 -1
  34. package/dist/commands/segment-command.js +1 -1
  35. package/dist/commands/segment-create-command.js +1 -1
  36. package/dist/commands/segment-fields-command.js +1 -1
  37. package/dist/commands/segment-pull-command.js +1 -1
  38. package/dist/commands/segment-push-command.js +1 -1
  39. package/dist/commands/segment-update-command.js +1 -1
  40. package/dist/commands/segment-use-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/tables.js +1 -1
  44. package/dist/commands/use-command.js +1 -1
  45. package/dist/commands/user-command.js +1 -1
  46. package/dist/commands/workflow-command.js +1 -1
  47. package/dist/core/auth.js +1 -1
  48. package/dist/core/config.js +1 -1
  49. package/dist/core/connection-cache.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/index.js +1 -1
  58. package/dist/proxy/anthropic-adapter.js +1 -1
  59. package/dist/proxy/claude-usage-tracker.js +1 -1
  60. package/dist/proxy/context-signature.js +1 -1
  61. package/dist/proxy/conversation-utils.js +1 -1
  62. package/dist/proxy/server.js +1 -1
  63. package/dist/proxy/session-cache.js +1 -1
  64. package/dist/sdk/agent/agent-yaml.js +1 -1
  65. package/dist/sdk/api.js +1 -1
  66. package/dist/sdk/connection-validator.js +1 -1
  67. package/dist/sdk/connection.js +1 -1
  68. package/dist/sdk/engage.js +1 -1
  69. package/dist/sdk/errors.js +1 -1
  70. package/dist/sdk/index.js +1 -1
  71. package/dist/sdk/job.js +1 -1
  72. package/dist/sdk/journey.js +1 -1
  73. package/dist/sdk/llm.js +1 -1
  74. package/dist/sdk/query.js +1 -1
  75. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  76. package/dist/sdk/segment/journey-yaml.d.ts +53 -18
  77. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  78. package/dist/sdk/segment/journey-yaml.js +1 -1
  79. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  80. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  81. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  82. package/dist/sdk/segment.js +1 -1
  83. package/dist/sdk/user.js +1 -1
  84. package/dist/sdk/workflow.js +1 -1
  85. package/dist/types/endpoints.js +1 -1
  86. package/dist/types/index.js +1 -1
  87. package/dist/utils/agent-config.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/journey-utils.d.ts +30 -0
  100. package/dist/utils/journey-utils.d.ts.map +1 -1
  101. package/dist/utils/journey-utils.js +1 -1
  102. package/dist/utils/journey-utils.js.map +1 -1
  103. package/dist/utils/json-loader.js +1 -1
  104. package/dist/utils/llm-backup-utils.js +1 -1
  105. package/dist/utils/model-aliases.js +1 -1
  106. package/dist/utils/model-factors.js +1 -1
  107. package/dist/utils/option-validation.js +1 -1
  108. package/dist/utils/port.js +1 -1
  109. package/dist/utils/process.js +1 -1
  110. package/dist/utils/prompt.js +1 -1
  111. package/dist/utils/segment-path-parser.js +1 -1
  112. package/dist/utils/segment-ref-parser.js +1 -1
  113. package/dist/utils/spinner.js +1 -1
  114. package/dist/utils/sql-parser.js +1 -1
  115. package/dist/utils/sse-parser.js +1 -1
  116. package/dist/utils/string-utils.js +1 -1
  117. package/dist/utils/table-ref-parser.js +1 -1
  118. package/dist/utils/tdx-config.js +1 -1
  119. package/dist/utils/tdx-logger.js +1 -1
  120. package/dist/utils/tree-formatter.js +1 -1
  121. package/dist/utils/version-check.js +1 -1
  122. package/dist/utils/workflow-utils.js +1 -1
  123. package/package.json +1 -1
@@ -1 +1 @@
1
- const a38_0x46362e=a38_0x50fa;(function(_0x445939,_0x5a8f96){const _0x11175a=a38_0x50fa,_0x6ba8a7=_0x445939();while(!![]){try{const _0x5593d7=-parseInt(_0x11175a(0xe8))/0x1*(-parseInt(_0x11175a(0xb7))/0x2)+parseInt(_0x11175a(0xb9))/0x3*(-parseInt(_0x11175a(0xe0))/0x4)+parseInt(_0x11175a(0xba))/0x5+parseInt(_0x11175a(0xd8))/0x6+-parseInt(_0x11175a(0xe1))/0x7+-parseInt(_0x11175a(0xb0))/0x8*(-parseInt(_0x11175a(0xcd))/0x9)+parseInt(_0x11175a(0xaf))/0xa*(-parseInt(_0x11175a(0xc0))/0xb);if(_0x5593d7===_0x5a8f96)break;else _0x6ba8a7['push'](_0x6ba8a7['shift']());}catch(_0x1d4c06){_0x6ba8a7['push'](_0x6ba8a7['shift']());}}}(a38_0x537b,0xf22e2));import{existsSync,statSync}from'fs';import a38_0x560483 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a38_0x537b(){const _0x18c209=['136IOwAmV','fullPath','segmentPath','session','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','folderId','Examples:','3190652sDjZsx','Target\x20path:\x20','3DSaCNk','4610335YvWitU','parentName','config','folderPath','✔\x20Context\x20set\x20to:\x20','isDirectory','3306974qbwZWf','join','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','isAbsolute','slice','resolvePathToResource','dim','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Folder\x20ID:\x20','cyan','description','segment:use','Usage:\x20tdx\x20segment\x20use\x20<path>','721413qSgeJm','Parent\x20ID:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','segments','segment','data','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Resolved\x20relative\x20path\x20to:\x20','log','parentId','864864QXlbNK','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Use:\x20tdx\x20segment\x20use\x20','verbose','Error:\x20Path\x20is\x20required\x0a','Site:\x20','execute','green','2586260laMNZu','12490821EJpUgi','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','error','split','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','1YTwDLq','red','length','\x27...','20DLiHVI'];a38_0x537b=function(){return _0x18c209;};return a38_0x537b();}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';import{findTdxConfig}from'../utils/tdx-config.js';function a38_0x50fa(_0x285e80,_0x59965a){_0x285e80=_0x285e80-0xaf;const _0x537bb2=a38_0x537b();let _0x50fab7=_0x537bb2[_0x285e80];return _0x50fab7;}export class SegmentUseCommand extends BaseCommand{['name']=a38_0x46362e(0xcb);[a38_0x46362e(0xca)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a38_0x46362e(0xde)](_0x20499f){const _0x23387c=a38_0x46362e,{options:_0xf56ac3,args:_0x1db751,tdx:_0x509797}=_0x20499f;if(_0x1db751[_0x23387c(0xea)]===0x0)return console['error'](a38_0x560483[_0x23387c(0xe9)](_0x23387c(0xdc))),console[_0x23387c(0xe5)](_0x23387c(0xcc)),console[_0x23387c(0xe5)](_0x23387c(0xb6)),console[_0x23387c(0xe5)](_0x23387c(0xcf)),console[_0x23387c(0xe5)](_0x23387c(0xe3)),console['error'](_0x23387c(0xc7)),console[_0x23387c(0xe5)]('\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 _0x4ef211=_0x1db751[0x0],_0x46cbc1=_0xf56ac3[_0x23387c(0xb3)];try{if(_0x4ef211==='/')return saveSessionContext({'segment_path':undefined},_0x46cbc1),console['log'](a38_0x560483[_0x23387c(0xdf)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x4ef211)&&statSync(_0x4ef211)[_0x23387c(0xbf)]()){let _0x2426fb;try{_0x2426fb=findTdxConfig(_0x4ef211);}catch{return console[_0x23387c(0xe5)](a38_0x560483[_0x23387c(0xe9)](_0x23387c(0xe4)+_0x4ef211)),console[_0x23387c(0xe5)](a38_0x560483['cyan'](_0x23387c(0xc2))),0x1;}const _0xcc3d37=_0x2426fb[_0x23387c(0xbc)]['parent_segment'];return saveSessionContext({'segment_path':_0xcc3d37,'parent_segment':_0xcc3d37},_0x46cbc1),console[_0x23387c(0xd6)](a38_0x560483[_0x23387c(0xdf)](_0x23387c(0xbe)+a38_0x560483['cyan'](_0xcc3d37))),0x0;}const _0x55b030=_0xf56ac3[_0x23387c(0xb2)];let _0x3a822c=_0x4ef211;const _0x1ea65c=parsePath(_0x4ef211);if(!_0x1ea65c[_0x23387c(0xc3)]){if(!_0x55b030)return console[_0x23387c(0xe5)](a38_0x560483[_0x23387c(0xe9)](_0x23387c(0xe2))),console['error'](a38_0x560483['cyan'](_0x23387c(0xd4))),0x1;if(_0x4ef211==='..'){const _0x1f9066=_0x55b030[_0x23387c(0xe6)]('/')[_0x23387c(0xc4)](0x0,-0x1)['join']('/');_0x3a822c=_0x1f9066||'/';}else _0x4ef211==='.'?_0x3a822c=_0x55b030:_0x3a822c=_0x55b030+'/'+_0x4ef211;_0xf56ac3['verbose']&&console['error'](_0x23387c(0xd5)+_0x3a822c);}if(_0x3a822c==='/'||_0x3a822c==='')return saveSessionContext({'segment_path':undefined},_0x46cbc1),console[_0x23387c(0xd6)](a38_0x560483[_0x23387c(0xdf)](_0x23387c(0xb4))),0x0;_0x3a822c=normalizePath(_0x3a822c);const _0x38f389=parsePath(_0x3a822c)[_0x23387c(0xd1)];if(_0x38f389[_0x23387c(0xea)]===0x0)return saveSessionContext({'segment_path':undefined},_0x46cbc1),console[_0x23387c(0xd6)](a38_0x560483[_0x23387c(0xdf)](_0x23387c(0xb4))),0x0;_0xf56ac3['verbose']&&(console[_0x23387c(0xe5)](_0x23387c(0xdd)+_0xf56ac3['site']),console['error'](_0x23387c(0xb8)+_0x3a822c));const _0x516b6d=await withSpinner('Resolving\x20path\x20\x27'+_0x3a822c+_0x23387c(0xeb),()=>_0x509797[_0x23387c(0xd2)][_0x23387c(0xc5)](_0x3a822c),{'verbose':_0xf56ac3[_0x23387c(0xdb)]}),_0x441267=_0x516b6d[_0x23387c(0xd3)];_0xf56ac3[_0x23387c(0xdb)]&&(console[_0x23387c(0xe5)]('Resolved\x20path\x20type:\x20'+_0x441267['type']),console['error'](_0x23387c(0xce)+_0x441267[_0x23387c(0xd7)]),_0x441267[_0x23387c(0xb5)]&&console[_0x23387c(0xe5)](_0x23387c(0xc8)+_0x441267[_0x23387c(0xb5)]));if(_0x441267['type']===_0x23387c(0xd2))return console[_0x23387c(0xe5)](a38_0x560483[_0x23387c(0xe9)](_0x23387c(0xe7))),console[_0x23387c(0xe5)](_0x23387c(0xd9)),console[_0x23387c(0xe5)](a38_0x560483[_0x23387c(0xc9)](_0x23387c(0xda)+_0x441267[_0x23387c(0xbb)]+(_0x441267[_0x23387c(0xbd)]?'/'+_0x441267[_0x23387c(0xbd)][_0x23387c(0xc1)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x441267[_0x23387c(0xb1)],'parent_segment':_0x441267[_0x23387c(0xbb)]},_0x46cbc1),console[_0x23387c(0xd6)](a38_0x560483[_0x23387c(0xdf)](_0x23387c(0xbe)+a38_0x560483[_0x23387c(0xc9)](_0x441267['fullPath']))),_0xf56ac3[_0x23387c(0xdb)]&&(console[_0x23387c(0xe5)](a38_0x560483[_0x23387c(0xc6)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0x23387c(0xe5)](a38_0x560483[_0x23387c(0xc6)](_0x23387c(0xd0)))),0x0;}catch(_0x4b088f){throw _0x4b088f;}}}
1
+ const a38_0x33ef56=a38_0x3ca1;(function(_0x30d621,_0x29f7ae){const _0x2aae10=a38_0x3ca1,_0x4cfefe=_0x30d621();while(!![]){try{const _0x106bf9=-parseInt(_0x2aae10(0x1fb))/0x1*(parseInt(_0x2aae10(0x1fc))/0x2)+-parseInt(_0x2aae10(0x216))/0x3+-parseInt(_0x2aae10(0x1f4))/0x4+parseInt(_0x2aae10(0x201))/0x5+-parseInt(_0x2aae10(0x20f))/0x6*(parseInt(_0x2aae10(0x21e))/0x7)+-parseInt(_0x2aae10(0x1f9))/0x8*(-parseInt(_0x2aae10(0x1fa))/0x9)+-parseInt(_0x2aae10(0x218))/0xa*(-parseInt(_0x2aae10(0x219))/0xb);if(_0x106bf9===_0x29f7ae)break;else _0x4cfefe['push'](_0x4cfefe['shift']());}catch(_0xa9e88a){_0x4cfefe['push'](_0x4cfefe['shift']());}}}(a38_0x4660,0x45988));import{existsSync,statSync}from'fs';import a38_0x123e7f from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a38_0x4660(){const _0xf0c3da=['✔\x20Context\x20set\x20to:\x20','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','green','length','dim','Folder\x20ID:\x20','red','site','12Jdywii','parentId','type','Resolving\x20path\x20\x27','fullPath','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','parentName','851373owXllj','isDirectory','15603770QfUNTd','11tLHtZS','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Error:\x20Path\x20is\x20required\x0a','parent_segment','1514492XdAaZe','folderId','join','cyan','description','\x27...','verbose','1793144HUiZKL','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','log','Parent\x20ID:\x20','180848FTnfBZ','63PfVZnG','7507ObvcoI','110cjOPCh','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','execute','config','Usage:\x20tdx\x20segment\x20use\x20<path>','720595yrFPuy','isAbsolute','segments','error','segment','name'];a38_0x4660=function(){return _0xf0c3da;};return a38_0x4660();}function a38_0x3ca1(_0x524380,_0x4e019d){_0x524380=_0x524380-0x1f1;const _0x466064=a38_0x4660();let _0x3ca109=_0x466064[_0x524380];return _0x3ca109;}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{[a38_0x33ef56(0x206)]='segment:use';[a38_0x33ef56(0x1f1)]=a38_0x33ef56(0x1f5);async[a38_0x33ef56(0x1fe)](_0x284c50){const _0x249e67=a38_0x33ef56,{options:_0x36711f,args:_0xb55470,tdx:_0x51eea6}=_0x284c50;if(_0xb55470[_0x249e67(0x20a)]===0x0)return console[_0x249e67(0x204)](a38_0x123e7f[_0x249e67(0x20d)](_0x249e67(0x21c))),console[_0x249e67(0x204)](_0x249e67(0x200)),console[_0x249e67(0x204)]('Examples:'),console[_0x249e67(0x204)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console[_0x249e67(0x204)](_0x249e67(0x1f6)),console['error']('\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 _0x52b5af=_0xb55470[0x0],_0x40d6d7=_0x36711f['session'];try{if(_0x52b5af==='/')return saveSessionContext({'segment_path':undefined},_0x40d6d7),console[_0x249e67(0x1f7)](a38_0x123e7f[_0x249e67(0x209)](_0x249e67(0x21b))),0x0;if(existsSync(_0x52b5af)&&statSync(_0x52b5af)[_0x249e67(0x217)]()){let _0x1cc70d;try{_0x1cc70d=findTdxConfig(_0x52b5af);}catch{return console[_0x249e67(0x204)](a38_0x123e7f[_0x249e67(0x20d)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x52b5af)),console['error'](a38_0x123e7f[_0x249e67(0x221)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x16b717=_0x1cc70d[_0x249e67(0x1ff)][_0x249e67(0x21d)];return saveSessionContext({'segment_path':_0x16b717,'parent_segment':_0x16b717},_0x40d6d7),console[_0x249e67(0x1f7)](a38_0x123e7f[_0x249e67(0x209)](_0x249e67(0x207)+a38_0x123e7f['cyan'](_0x16b717))),0x0;}const _0x50f9f1=_0x36711f['segmentPath'];let _0x2783c7=_0x52b5af;const _0x58b704=parsePath(_0x52b5af);if(!_0x58b704[_0x249e67(0x202)]){if(!_0x50f9f1)return console[_0x249e67(0x204)](a38_0x123e7f[_0x249e67(0x20d)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0x249e67(0x204)](a38_0x123e7f[_0x249e67(0x221)](_0x249e67(0x1fd))),0x1;if(_0x52b5af==='..'){const _0x2f1723=_0x50f9f1['split']('/')['slice'](0x0,-0x1)[_0x249e67(0x220)]('/');_0x2783c7=_0x2f1723||'/';}else _0x52b5af==='.'?_0x2783c7=_0x50f9f1:_0x2783c7=_0x50f9f1+'/'+_0x52b5af;_0x36711f[_0x249e67(0x1f3)]&&console[_0x249e67(0x204)]('Resolved\x20relative\x20path\x20to:\x20'+_0x2783c7);}if(_0x2783c7==='/'||_0x2783c7==='')return saveSessionContext({'segment_path':undefined},_0x40d6d7),console[_0x249e67(0x1f7)](a38_0x123e7f['green'](_0x249e67(0x21b))),0x0;_0x2783c7=normalizePath(_0x2783c7);const _0x5646a8=parsePath(_0x2783c7)[_0x249e67(0x203)];if(_0x5646a8[_0x249e67(0x20a)]===0x0)return saveSessionContext({'segment_path':undefined},_0x40d6d7),console[_0x249e67(0x1f7)](a38_0x123e7f[_0x249e67(0x209)](_0x249e67(0x21b))),0x0;_0x36711f[_0x249e67(0x1f3)]&&(console[_0x249e67(0x204)]('Site:\x20'+_0x36711f[_0x249e67(0x20e)]),console['error']('Target\x20path:\x20'+_0x2783c7));const _0x31badf=await withSpinner(_0x249e67(0x212)+_0x2783c7+_0x249e67(0x1f2),()=>_0x51eea6[_0x249e67(0x205)]['resolvePathToResource'](_0x2783c7),{'verbose':_0x36711f[_0x249e67(0x1f3)]}),_0x2d1ee4=_0x31badf['data'];_0x36711f[_0x249e67(0x1f3)]&&(console[_0x249e67(0x204)]('Resolved\x20path\x20type:\x20'+_0x2d1ee4[_0x249e67(0x211)]),console[_0x249e67(0x204)](_0x249e67(0x1f8)+_0x2d1ee4[_0x249e67(0x210)]),_0x2d1ee4[_0x249e67(0x21f)]&&console[_0x249e67(0x204)](_0x249e67(0x20c)+_0x2d1ee4['folderId']));if(_0x2d1ee4['type']==='segment')return console[_0x249e67(0x204)](a38_0x123e7f['red'](_0x249e67(0x21a))),console[_0x249e67(0x204)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x249e67(0x204)](a38_0x123e7f['cyan']('Use:\x20tdx\x20segment\x20use\x20'+_0x2d1ee4[_0x249e67(0x215)]+(_0x2d1ee4['folderPath']?'/'+_0x2d1ee4['folderPath'][_0x249e67(0x220)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x2d1ee4[_0x249e67(0x213)],'parent_segment':_0x2d1ee4[_0x249e67(0x215)]},_0x40d6d7),console[_0x249e67(0x1f7)](a38_0x123e7f[_0x249e67(0x209)](_0x249e67(0x207)+a38_0x123e7f['cyan'](_0x2d1ee4['fullPath']))),_0x36711f[_0x249e67(0x1f3)]&&(console[_0x249e67(0x204)](a38_0x123e7f[_0x249e67(0x20b)](_0x249e67(0x214))),console[_0x249e67(0x204)](a38_0x123e7f[_0x249e67(0x20b)](_0x249e67(0x208)))),0x0;}catch(_0x50935d){throw _0x50935d;}}}
@@ -1 +1 @@
1
- function a39_0x3fea(_0x267333,_0x933628){_0x267333=_0x267333-0x182;const _0x310b13=a39_0x310b();let _0x3fea23=_0x310b13[_0x267333];return _0x3fea23;}const a39_0x3308cc=a39_0x3fea;function a39_0x310b(){const _0x2c2bf1=[',\x20and\x20','(not\x20set)','34QwsjjT','/e/','sort','length','localeCompare','7458lFZyZZ','327699XlVXIa','segment','all','49777IggmJs','Parent\x20ID:\x20','\x20segment','site','Resolving\x20path\x20\x27','1102326dqbLkT','journey','No\x20items\x20match\x20pattern:\x20','jsonl','message','parentId','Site:\x20','description','/app/ps/','\x20folder','Folder\x20ID:\x20','248664UAqaOe','\x20matching\x20\x27','48IjksFT','Folder/pattern\x20arg:\x20','listWithPattern','\x20journey','folder','cause','folderId','Parent\x20segment\x20context:\x20','name','json','error','filter','log','Listing\x20folders,\x20segments,\x20and\x20journeys...','✔\x20Found\x20','664155dKbCzf','execute','List\x20folders\x20and\x20child\x20segments','resolvePathToResource','maxDepth','listUnified','(empty)','\x27...','journeyBundleName','Resolving\x20parent\x20segment\x20\x27','format','/j/da','listJourneysFromParentSegment','Error:\x20No\x20parent\x20segment\x20context\x20set.','map','includes','dim','verbose','Error:\x20','segments','9jYXfTA','replace','web','\x5c$&','test','5027880SqKCIh','Recursive\x20mode:\x20enabled','data','Building\x20hierarchy\x20tree...','listRecursive'];a39_0x310b=function(){return _0x2c2bf1;};return a39_0x310b();}(function(_0x325b4a,_0x1dc35b){const _0x2a0d11=a39_0x3fea,_0x421a16=_0x325b4a();while(!![]){try{const _0x29ab8a=-parseInt(_0x2a0d11(0x1b3))/0x1*(parseInt(_0x2a0d11(0x1ae))/0x2)+-parseInt(_0x2a0d11(0x1a2))/0x3*(parseInt(_0x2a0d11(0x1c7))/0x4)+parseInt(_0x2a0d11(0x18e))/0x5+-parseInt(_0x2a0d11(0x1bc))/0x6+-parseInt(_0x2a0d11(0x1b7))/0x7*(parseInt(_0x2a0d11(0x1c9))/0x8)+parseInt(_0x2a0d11(0x1b4))/0x9+parseInt(_0x2a0d11(0x1a7))/0xa;if(_0x29ab8a===_0x1dc35b)break;else _0x421a16['push'](_0x421a16['shift']());}catch(_0x7dac3b){_0x421a16['push'](_0x421a16['shift']());}}}(a39_0x310b,0x20507));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{getConsoleNextUrl}from'../types/endpoints.js';import a39_0x5c3ac7 from'chalk';export class SegmentsCommand extends BaseCommand{[a39_0x3308cc(0x187)]=a39_0x3308cc(0x1a1);[a39_0x3308cc(0x1c3)]=a39_0x3308cc(0x190);async[a39_0x3308cc(0x18f)](_0x22ed8a){const _0x3d1a2d=a39_0x3308cc,{options:_0xca5f9c,args:_0x37d0e9}=_0x22ed8a,_0x1e33c2=_0xca5f9c['recursive'],_0x1c980d=_0x37d0e9[0x0];try{const _0x5533a2=_0xca5f9c['parentSegment'];_0xca5f9c['verbose']&&(console[_0x3d1a2d(0x189)](_0x3d1a2d(0x1c2)+_0xca5f9c[_0x3d1a2d(0x1ba)]),console[_0x3d1a2d(0x189)](_0x3d1a2d(0x186)+(_0x5533a2||_0x3d1a2d(0x1ad))),_0x1c980d&&console[_0x3d1a2d(0x189)](_0x3d1a2d(0x1ca)+_0x1c980d),_0x1e33c2&&console[_0x3d1a2d(0x189)](_0x3d1a2d(0x1a8)));if(!_0x5533a2)return console[_0x3d1a2d(0x189)](_0x3d1a2d(0x19b)),console[_0x3d1a2d(0x189)](''),console[_0x3d1a2d(0x189)]('Set\x20a\x20parent\x20segment\x20context\x20first:'),console[_0x3d1a2d(0x189)]('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console[_0x3d1a2d(0x189)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x3d1a2d(0x189)](''),console['error']('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x1ca4b0=_0x1c980d&&(_0x1c980d[_0x3d1a2d(0x19d)]('*')||_0x1c980d[_0x3d1a2d(0x19d)]('?'));if(_0x1ca4b0)return await this[_0x3d1a2d(0x1cb)](_0x22ed8a,_0x5533a2,_0x1c980d);const _0xda96dc=_0x1c980d?_0x5533a2+'/'+_0x1c980d:_0x5533a2;return _0x1e33c2?await this['listRecursive'](_0x22ed8a,_0xda96dc):await this[_0x3d1a2d(0x193)](_0x22ed8a,_0xda96dc);}catch(_0x3227d2){if(_0x3227d2 instanceof SDKError)return console[_0x3d1a2d(0x189)](_0x3d1a2d(0x1a0)+_0x3227d2[_0x3d1a2d(0x1c0)]),_0x3227d2['cause']&&console[_0x3d1a2d(0x189)]('\x20\x20Cause:\x20'+_0x3227d2[_0x3d1a2d(0x184)]),0x1;throw _0x3227d2;}}async[a39_0x3308cc(0x1cb)](_0x1abef9,_0x1cd02d,_0x144b4a){const _0x58da2d=a39_0x3308cc,{options:_0x1dfcf5,tdx:_0x4ff5a9}=_0x1abef9,_0x46fbe8=_0x1dfcf5[_0x58da2d(0x1a4)],_0x15d553=await withSpinner(_0x58da2d(0x197)+_0x1cd02d+_0x58da2d(0x195),()=>_0x4ff5a9['segment']['resolvePathToResource'](_0x1cd02d),{'verbose':_0x1dfcf5[_0x58da2d(0x19f)]}),_0xd5183b=_0x15d553[_0x58da2d(0x1a9)],_0x578c27=await withSpinner(_0x58da2d(0x18c),()=>Promise[_0x58da2d(0x1b6)]([_0x4ff5a9[_0x58da2d(0x1b5)][_0x58da2d(0x193)](_0xd5183b[_0x58da2d(0x1c1)],_0xd5183b['folderId']),_0x4ff5a9[_0x58da2d(0x1bd)][_0x58da2d(0x19a)](_0xd5183b[_0x58da2d(0x1c1)])]),{'verbose':_0x1dfcf5['verbose']}),[_0x498acc,_0x5a84d3]=_0x578c27[_0x58da2d(0x1a9)],{folders:_0x282472,segments:_0x5f49ff}=_0x498acc,_0x35cdb1=_0x144b4a[_0x58da2d(0x1a3)](/[.+^${}()|[\]\\]/g,_0x58da2d(0x1a5))['replace'](/\*/g,'.*')[_0x58da2d(0x1a3)](/\?/g,'.'),_0x7e6399=new RegExp('^'+_0x35cdb1+'$','i'),_0x84496=_0x282472['filter'](_0x24f39e=>_0x7e6399['test'](_0x24f39e[_0x58da2d(0x187)])),_0xebb353=_0x5f49ff[_0x58da2d(0x18a)](_0x53b3c1=>_0x7e6399[_0x58da2d(0x1a6)](_0x53b3c1[_0x58da2d(0x187)])),_0x2759f4=_0x5a84d3[_0x58da2d(0x18a)](_0x14a667=>_0x7e6399[_0x58da2d(0x1a6)](_0x14a667['journeyBundleName'])),_0x4f8cd8=_0x84496[_0x58da2d(0x1b1)]+_0xebb353[_0x58da2d(0x1b1)]+_0x2759f4[_0x58da2d(0x1b1)];console[_0x58da2d(0x189)](_0x58da2d(0x18d)+_0x84496['length']+_0x58da2d(0x1c5)+(_0x84496[_0x58da2d(0x1b1)]!==0x1?'s':'')+',\x20'+_0xebb353['length']+'\x20segment'+(_0xebb353[_0x58da2d(0x1b1)]!==0x1?'s':'')+_0x58da2d(0x1ac)+_0x2759f4[_0x58da2d(0x1b1)]+'\x20journey'+(_0x2759f4[_0x58da2d(0x1b1)]!==0x1?'s':'')+_0x58da2d(0x1c8)+_0x144b4a+'\x27');const _0x2f35b8=_0x6b4ac4=>{const _0x27065f=_0x58da2d;return getConsoleNextUrl(_0x1dfcf5['site'],'/app/ps/'+_0xd5183b['parentId']+_0x27065f(0x1af)+_0x6b4ac4);},_0x2f10d5=_0x1dfcf5[_0x58da2d(0x198)]===_0x58da2d(0x188)||_0x1dfcf5[_0x58da2d(0x198)]===_0x58da2d(0x1bf);if(_0x2f10d5){const _0x1b9c9a=[..._0x84496[_0x58da2d(0x19c)](_0x53d5a7=>({..._0x53d5a7,'type':_0x58da2d(0x183)})),..._0xebb353[_0x58da2d(0x19c)](_0x47a051=>({..._0x47a051,'type':_0x58da2d(0x1b5),'url':_0x2f35b8(_0x47a051['id'])})),..._0x2759f4[_0x58da2d(0x19c)](_0x3ebc66=>({..._0x3ebc66,'name':_0x3ebc66[_0x58da2d(0x196)],'type':_0x58da2d(0x1bd)}))]['sort']((_0x1a9505,_0x3d6916)=>_0x1a9505[_0x58da2d(0x187)][_0x58da2d(0x1b2)](_0x3d6916[_0x58da2d(0x187)]));await handleSDKOutput(_0x1b9c9a,_0x1dfcf5);}else{if(_0x4f8cd8===0x0)console['log'](_0x58da2d(0x1be)+_0x144b4a);else{console[_0x58da2d(0x18b)](a39_0x5c3ac7[_0x58da2d(0x19e)]('['+_0x1cd02d+']\x20matching\x20\x27'+_0x144b4a+'\x27'));const _0x477c93=formatFlatList(_0x84496,_0xebb353,{'showMetadata':!![],'showUrl':_0x46fbe8,'getSegmentUrl':_0x2f35b8},_0x2759f4);console[_0x58da2d(0x18b)](_0x477c93);}}return 0x0;}async[a39_0x3308cc(0x193)](_0x5037c9,_0x1f69ce){const _0xab70a7=a39_0x3308cc,{options:_0x3e1430,tdx:_0x3f255e}=_0x5037c9,_0x3866f2=_0x3e1430['web'],_0x7238b1=await withSpinner(_0xab70a7(0x1bb)+_0x1f69ce+_0xab70a7(0x195),()=>_0x3f255e[_0xab70a7(0x1b5)][_0xab70a7(0x191)](_0x1f69ce),{'verbose':_0x3e1430[_0xab70a7(0x19f)]}),_0x34c542=_0x7238b1[_0xab70a7(0x1a9)];_0x3e1430['verbose']&&(console['error'](_0xab70a7(0x1b8)+_0x34c542[_0xab70a7(0x1c1)]),_0x34c542[_0xab70a7(0x185)]&&console[_0xab70a7(0x189)](_0xab70a7(0x1c6)+_0x34c542[_0xab70a7(0x185)]));const _0x586999=await withSpinner(_0xab70a7(0x18c),()=>Promise[_0xab70a7(0x1b6)]([_0x3f255e['segment'][_0xab70a7(0x193)](_0x34c542['parentId'],_0x34c542['folderId']),_0x3f255e['journey'][_0xab70a7(0x19a)](_0x34c542['parentId'])]),{'verbose':_0x3e1430[_0xab70a7(0x19f)]}),[_0x243f1b,_0xe19a38]=_0x586999['data'],{folders:_0x2f3edf,segments:_0x439ce6}=_0x243f1b,_0x156ca3=_0x2f3edf[_0xab70a7(0x1b1)]+_0x439ce6[_0xab70a7(0x1b1)]+_0xe19a38[_0xab70a7(0x1b1)];console[_0xab70a7(0x189)](_0xab70a7(0x18d)+_0x2f3edf['length']+_0xab70a7(0x1c5)+(_0x2f3edf[_0xab70a7(0x1b1)]!==0x1?'s':'')+',\x20'+_0x439ce6[_0xab70a7(0x1b1)]+_0xab70a7(0x1b9)+(_0x439ce6[_0xab70a7(0x1b1)]!==0x1?'s':'')+_0xab70a7(0x1ac)+_0xe19a38['length']+_0xab70a7(0x182)+(_0xe19a38[_0xab70a7(0x1b1)]!==0x1?'s':''));const _0x2a1cf6=_0x1a99ba=>{const _0x47f88b=_0xab70a7;return getConsoleNextUrl(_0x3e1430['site'],'/app/ps/'+_0x34c542[_0x47f88b(0x1c1)]+_0x47f88b(0x1af)+_0x1a99ba);},_0xff7459=_0x2443f5=>{const _0x4e9d33=_0xab70a7;return getConsoleNextUrl(_0x3e1430[_0x4e9d33(0x1ba)],_0x4e9d33(0x1c4)+_0x34c542[_0x4e9d33(0x1c1)]+'/e/'+_0x2443f5+_0x4e9d33(0x199));},_0x559094=_0x3e1430[_0xab70a7(0x198)]===_0xab70a7(0x188)||_0x3e1430[_0xab70a7(0x198)]===_0xab70a7(0x1bf);if(_0x559094){const _0x58a151=[..._0x2f3edf['map'](_0x34668b=>({..._0x34668b,'type':_0xab70a7(0x183)})),..._0x439ce6[_0xab70a7(0x19c)](_0x799741=>({..._0x799741,'type':_0xab70a7(0x1b5),'url':_0x2a1cf6(_0x799741['id'])})),..._0xe19a38[_0xab70a7(0x19c)](_0x22c1de=>({..._0x22c1de,'name':_0x22c1de[_0xab70a7(0x196)],'type':_0xab70a7(0x1bd),'url':_0xff7459(_0x22c1de['id'])}))][_0xab70a7(0x1b0)]((_0x12f44f,_0x1d13c0)=>_0x12f44f['name'][_0xab70a7(0x1b2)](_0x1d13c0[_0xab70a7(0x187)]));await handleSDKOutput(_0x58a151,_0x3e1430);}else{if(_0x156ca3===0x0)console[_0xab70a7(0x18b)](a39_0x5c3ac7[_0xab70a7(0x19e)]('['+_0x1f69ce+']')),console['log'](_0xab70a7(0x194));else{console['log'](a39_0x5c3ac7['dim']('['+_0x1f69ce+']'));const _0x2f5643=formatFlatList(_0x2f3edf,_0x439ce6,{'showMetadata':!![],'showUrl':_0x3866f2,'getSegmentUrl':_0x2a1cf6,'getJourneyUrl':_0xff7459},_0xe19a38);console[_0xab70a7(0x18b)](_0x2f5643);}}return 0x0;}async[a39_0x3308cc(0x1ab)](_0x2a9254,_0x47437a){const _0xee8fb8=a39_0x3308cc,{options:_0x4cc7d2,tdx:_0x238f7f}=_0x2a9254,_0x516831=_0x4cc7d2['web'],_0x3a1201=await withSpinner(_0xee8fb8(0x1bb)+_0x47437a+_0xee8fb8(0x195),()=>_0x238f7f[_0xee8fb8(0x1b5)][_0xee8fb8(0x191)](_0x47437a),{'verbose':_0x4cc7d2[_0xee8fb8(0x19f)]}),_0x3bc76a=_0x3a1201[_0xee8fb8(0x1a9)];_0x4cc7d2['verbose']&&(console['error']('Parent\x20ID:\x20'+_0x3bc76a[_0xee8fb8(0x1c1)]),_0x3bc76a[_0xee8fb8(0x185)]&&console[_0xee8fb8(0x189)](_0xee8fb8(0x1c6)+_0x3bc76a[_0xee8fb8(0x185)]));const _0x4dc54c=_0x4cc7d2[_0xee8fb8(0x192)]||0xa,_0x2c734e=await withSpinner(_0xee8fb8(0x1aa),()=>_0x238f7f[_0xee8fb8(0x1b5)]['listRecursive'](_0x3bc76a[_0xee8fb8(0x1c1)],_0x3bc76a['folderId'],0x0,_0x4dc54c),{'verbose':_0x4cc7d2[_0xee8fb8(0x19f)]}),_0xb93cd8=_0x2c734e[_0xee8fb8(0x1a9)];console['error']('✔\x20Built\x20tree\x20with\x20'+_0xb93cd8[_0xee8fb8(0x1b1)]+'\x20top-level\x20items');const _0x2860d8=_0x33c7ea=>{const _0x3dae8d=_0xee8fb8;return getConsoleNextUrl(_0x4cc7d2[_0x3dae8d(0x1ba)],'/app/ps/'+_0x3bc76a[_0x3dae8d(0x1c1)]+_0x3dae8d(0x1af)+_0x33c7ea);};if(_0x4cc7d2['format']===_0xee8fb8(0x188)||_0x4cc7d2[_0xee8fb8(0x198)]==='jsonl')await handleSDKOutput(_0xb93cd8,_0x4cc7d2);else{console[_0xee8fb8(0x18b)](a39_0x5c3ac7[_0xee8fb8(0x19e)]('['+_0x47437a+']'));const _0x1b16b7=formatTree(_0xb93cd8,{'showMetadata':!![],'showUrl':_0x516831,'getSegmentUrl':_0x2860d8});console[_0xee8fb8(0x18b)](_0x1b16b7);}return 0x0;}}
1
+ const a39_0x53fa8b=a39_0x4e69;(function(_0x256d9c,_0x3d4496){const _0x32bb89=a39_0x4e69,_0x5bf877=_0x256d9c();while(!![]){try{const _0x48f8c2=parseInt(_0x32bb89(0x15a))/0x1*(parseInt(_0x32bb89(0x17e))/0x2)+-parseInt(_0x32bb89(0x15b))/0x3*(-parseInt(_0x32bb89(0x172))/0x4)+parseInt(_0x32bb89(0x18f))/0x5+parseInt(_0x32bb89(0x18a))/0x6+parseInt(_0x32bb89(0x177))/0x7+parseInt(_0x32bb89(0x180))/0x8*(-parseInt(_0x32bb89(0x149))/0x9)+-parseInt(_0x32bb89(0x157))/0xa;if(_0x48f8c2===_0x3d4496)break;else _0x5bf877['push'](_0x5bf877['shift']());}catch(_0x12af9b){_0x5bf877['push'](_0x5bf877['shift']());}}}(a39_0x2fd3,0xef3c7));import{BaseCommand}from'./command.js';function a39_0x2fd3(){const _0x56ac2b=['test','Folder\x20ID:\x20','/app/ps/','Resolving\x20path\x20\x27','verbose','18873540MbaJlv','segment','name','21288HHwsab','12KjWWlW','Folder/pattern\x20arg:\x20','parentId','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','\x20\x20Cause:\x20','List\x20folders\x20and\x20child\x20segments','sort','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22',']\x20matching\x20\x27','folderId','recursive','Site:\x20','jsonl','journeyBundleName','site','length','maxDepth','Listing\x20folders,\x20segments,\x20and\x20journeys...','web','data','✔\x20Built\x20tree\x20with\x20','\x5c$&','json','1437208krLEDv','listRecursive','log','Resolving\x20parent\x20segment\x20\x27','/e/','8318387ELNRAB','resolvePathToResource','Error:\x20','listUnified','filter','(not\x20set)','parentSegment','94HHGwCH','Parent\x20ID:\x20','15196960EHAMQb','segments','cause','\x20folder','error','\x20segment','map','message','listJourneysFromParentSegment','format','3786888YOdqWG','✔\x20Found\x20','dim','folder','\x20matching\x20\x27','2548260ViItMB','Building\x20hierarchy\x20tree...','replace','description','all','Error:\x20No\x20parent\x20segment\x20context\x20set.','/j/da','9rPjjHV','\x20top-level\x20items','journey','listWithPattern','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','localeCompare','\x20journey',',\x20and\x20','\x27...'];a39_0x2fd3=function(){return _0x56ac2b;};return a39_0x2fd3();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';function a39_0x4e69(_0x2fbbc4,_0x209544){_0x2fbbc4=_0x2fbbc4-0x147;const _0x2fd376=a39_0x2fd3();let _0x4e6981=_0x2fd376[_0x2fbbc4];return _0x4e6981;}import{getConsoleNextUrl}from'../types/endpoints.js';import a39_0xc83a89 from'chalk';export class SegmentsCommand extends BaseCommand{[a39_0x53fa8b(0x159)]=a39_0x53fa8b(0x181);[a39_0x53fa8b(0x192)]=a39_0x53fa8b(0x160);async['execute'](_0x57d704){const _0x4b0782=a39_0x53fa8b,{options:_0x1814e6,args:_0x185bcc}=_0x57d704,_0x984a49=_0x1814e6[_0x4b0782(0x165)],_0x45fe6e=_0x185bcc[0x0];try{const _0x514adf=_0x1814e6[_0x4b0782(0x17d)];_0x1814e6[_0x4b0782(0x156)]&&(console['error'](_0x4b0782(0x166)+_0x1814e6[_0x4b0782(0x169)]),console[_0x4b0782(0x184)]('Parent\x20segment\x20context:\x20'+(_0x514adf||_0x4b0782(0x17c))),_0x45fe6e&&console[_0x4b0782(0x184)](_0x4b0782(0x15c)+_0x45fe6e),_0x984a49&&console['error']('Recursive\x20mode:\x20enabled'));if(!_0x514adf)return console[_0x4b0782(0x184)](_0x4b0782(0x147)),console[_0x4b0782(0x184)](''),console[_0x4b0782(0x184)]('Set\x20a\x20parent\x20segment\x20context\x20first:'),console[_0x4b0782(0x184)](_0x4b0782(0x162)),console[_0x4b0782(0x184)](_0x4b0782(0x14d)),console['error'](''),console[_0x4b0782(0x184)](_0x4b0782(0x15e)),0x1;const _0x461404=_0x45fe6e&&(_0x45fe6e['includes']('*')||_0x45fe6e['includes']('?'));if(_0x461404)return await this[_0x4b0782(0x14c)](_0x57d704,_0x514adf,_0x45fe6e);const _0x391a76=_0x45fe6e?_0x514adf+'/'+_0x45fe6e:_0x514adf;return _0x984a49?await this[_0x4b0782(0x173)](_0x57d704,_0x391a76):await this['listUnified'](_0x57d704,_0x391a76);}catch(_0x357baa){if(_0x357baa instanceof SDKError)return console['error'](_0x4b0782(0x179)+_0x357baa[_0x4b0782(0x187)]),_0x357baa[_0x4b0782(0x182)]&&console['error'](_0x4b0782(0x15f)+_0x357baa[_0x4b0782(0x182)]),0x1;throw _0x357baa;}}async[a39_0x53fa8b(0x14c)](_0x353c6f,_0xe72d54,_0x4e0f7d){const _0x3a33d2=a39_0x53fa8b,{options:_0x58746a,tdx:_0x4cf140}=_0x353c6f,_0x530a9d=_0x58746a[_0x3a33d2(0x16d)],_0x481bec=await withSpinner(_0x3a33d2(0x175)+_0xe72d54+'\x27...',()=>_0x4cf140[_0x3a33d2(0x158)][_0x3a33d2(0x178)](_0xe72d54),{'verbose':_0x58746a[_0x3a33d2(0x156)]}),_0x108d84=_0x481bec[_0x3a33d2(0x16e)],_0x106e51=await withSpinner(_0x3a33d2(0x16c),()=>Promise[_0x3a33d2(0x193)]([_0x4cf140[_0x3a33d2(0x158)][_0x3a33d2(0x17a)](_0x108d84[_0x3a33d2(0x15d)],_0x108d84[_0x3a33d2(0x164)]),_0x4cf140[_0x3a33d2(0x14b)]['listJourneysFromParentSegment'](_0x108d84[_0x3a33d2(0x15d)])]),{'verbose':_0x58746a['verbose']}),[_0x431270,_0x5de8c6]=_0x106e51[_0x3a33d2(0x16e)],{folders:_0x4c16bb,segments:_0x4b0791}=_0x431270,_0x39723e=_0x4e0f7d[_0x3a33d2(0x191)](/[.+^${}()|[\]\\]/g,_0x3a33d2(0x170))['replace'](/\*/g,'.*')[_0x3a33d2(0x191)](/\?/g,'.'),_0x4f9e59=new RegExp('^'+_0x39723e+'$','i'),_0x23d3a2=_0x4c16bb[_0x3a33d2(0x17b)](_0x666709=>_0x4f9e59[_0x3a33d2(0x152)](_0x666709[_0x3a33d2(0x159)])),_0x96b134=_0x4b0791[_0x3a33d2(0x17b)](_0x4633aa=>_0x4f9e59[_0x3a33d2(0x152)](_0x4633aa[_0x3a33d2(0x159)])),_0x432a1b=_0x5de8c6[_0x3a33d2(0x17b)](_0x3f63fb=>_0x4f9e59[_0x3a33d2(0x152)](_0x3f63fb['journeyBundleName'])),_0x28c4ad=_0x23d3a2[_0x3a33d2(0x16a)]+_0x96b134[_0x3a33d2(0x16a)]+_0x432a1b[_0x3a33d2(0x16a)];console[_0x3a33d2(0x184)](_0x3a33d2(0x18b)+_0x23d3a2[_0x3a33d2(0x16a)]+_0x3a33d2(0x183)+(_0x23d3a2[_0x3a33d2(0x16a)]!==0x1?'s':'')+',\x20'+_0x96b134[_0x3a33d2(0x16a)]+_0x3a33d2(0x185)+(_0x96b134[_0x3a33d2(0x16a)]!==0x1?'s':'')+_0x3a33d2(0x150)+_0x432a1b[_0x3a33d2(0x16a)]+_0x3a33d2(0x14f)+(_0x432a1b['length']!==0x1?'s':'')+_0x3a33d2(0x18e)+_0x4e0f7d+'\x27');const _0x409973=_0x156b6b=>{const _0x517c34=_0x3a33d2;return getConsoleNextUrl(_0x58746a[_0x517c34(0x169)],_0x517c34(0x154)+_0x108d84[_0x517c34(0x15d)]+'/e/'+_0x156b6b);},_0x5bca8c=_0x58746a[_0x3a33d2(0x189)]===_0x3a33d2(0x171)||_0x58746a[_0x3a33d2(0x189)]==='jsonl';if(_0x5bca8c){const _0x2f65e2=[..._0x23d3a2[_0x3a33d2(0x186)](_0x320217=>({..._0x320217,'type':_0x3a33d2(0x18d)})),..._0x96b134[_0x3a33d2(0x186)](_0x25c8f8=>({..._0x25c8f8,'type':_0x3a33d2(0x158),'url':_0x409973(_0x25c8f8['id'])})),..._0x432a1b['map'](_0x2645d8=>({..._0x2645d8,'name':_0x2645d8[_0x3a33d2(0x168)],'type':_0x3a33d2(0x14b)}))]['sort']((_0x127640,_0xc2bc00)=>_0x127640[_0x3a33d2(0x159)][_0x3a33d2(0x14e)](_0xc2bc00['name']));await handleSDKOutput(_0x2f65e2,_0x58746a);}else{if(_0x28c4ad===0x0)console[_0x3a33d2(0x174)]('No\x20items\x20match\x20pattern:\x20'+_0x4e0f7d);else{console[_0x3a33d2(0x174)](a39_0xc83a89[_0x3a33d2(0x18c)]('['+_0xe72d54+_0x3a33d2(0x163)+_0x4e0f7d+'\x27'));const _0x2afa27=formatFlatList(_0x23d3a2,_0x96b134,{'showMetadata':!![],'showUrl':_0x530a9d,'getSegmentUrl':_0x409973},_0x432a1b);console['log'](_0x2afa27);}}return 0x0;}async[a39_0x53fa8b(0x17a)](_0x52b47a,_0x5c857a){const _0x545121=a39_0x53fa8b,{options:_0x1e6d64,tdx:_0x344d8c}=_0x52b47a,_0x5406db=_0x1e6d64[_0x545121(0x16d)],_0x26cf6a=await withSpinner(_0x545121(0x155)+_0x5c857a+_0x545121(0x151),()=>_0x344d8c[_0x545121(0x158)][_0x545121(0x178)](_0x5c857a),{'verbose':_0x1e6d64['verbose']}),_0x5baa10=_0x26cf6a[_0x545121(0x16e)];_0x1e6d64['verbose']&&(console[_0x545121(0x184)](_0x545121(0x17f)+_0x5baa10[_0x545121(0x15d)]),_0x5baa10[_0x545121(0x164)]&&console[_0x545121(0x184)](_0x545121(0x153)+_0x5baa10[_0x545121(0x164)]));const _0x2de2be=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>Promise[_0x545121(0x193)]([_0x344d8c['segment'][_0x545121(0x17a)](_0x5baa10[_0x545121(0x15d)],_0x5baa10['folderId']),_0x344d8c[_0x545121(0x14b)][_0x545121(0x188)](_0x5baa10['parentId'])]),{'verbose':_0x1e6d64[_0x545121(0x156)]}),[_0x385717,_0x4c1b66]=_0x2de2be[_0x545121(0x16e)],{folders:_0x420397,segments:_0x92c755}=_0x385717,_0xca1e65=_0x420397[_0x545121(0x16a)]+_0x92c755['length']+_0x4c1b66['length'];console[_0x545121(0x184)]('✔\x20Found\x20'+_0x420397['length']+_0x545121(0x183)+(_0x420397[_0x545121(0x16a)]!==0x1?'s':'')+',\x20'+_0x92c755['length']+_0x545121(0x185)+(_0x92c755[_0x545121(0x16a)]!==0x1?'s':'')+',\x20and\x20'+_0x4c1b66[_0x545121(0x16a)]+'\x20journey'+(_0x4c1b66['length']!==0x1?'s':''));const _0x4aa8d8=_0x1b15d0=>{const _0x5478f2=_0x545121;return getConsoleNextUrl(_0x1e6d64[_0x5478f2(0x169)],_0x5478f2(0x154)+_0x5baa10[_0x5478f2(0x15d)]+_0x5478f2(0x176)+_0x1b15d0);},_0x1b87b2=_0x2dd37a=>{const _0x229907=_0x545121;return getConsoleNextUrl(_0x1e6d64[_0x229907(0x169)],_0x229907(0x154)+_0x5baa10[_0x229907(0x15d)]+'/e/'+_0x2dd37a+_0x229907(0x148));},_0x24fddd=_0x1e6d64['format']==='json'||_0x1e6d64['format']===_0x545121(0x167);if(_0x24fddd){const _0x316dfb=[..._0x420397['map'](_0x1b7409=>({..._0x1b7409,'type':_0x545121(0x18d)})),..._0x92c755[_0x545121(0x186)](_0x385ed2=>({..._0x385ed2,'type':_0x545121(0x158),'url':_0x4aa8d8(_0x385ed2['id'])})),..._0x4c1b66['map'](_0x18223b=>({..._0x18223b,'name':_0x18223b[_0x545121(0x168)],'type':_0x545121(0x14b),'url':_0x1b87b2(_0x18223b['id'])}))][_0x545121(0x161)]((_0x2db6e2,_0x24dde8)=>_0x2db6e2[_0x545121(0x159)]['localeCompare'](_0x24dde8[_0x545121(0x159)]));await handleSDKOutput(_0x316dfb,_0x1e6d64);}else{if(_0xca1e65===0x0)console[_0x545121(0x174)](a39_0xc83a89[_0x545121(0x18c)]('['+_0x5c857a+']')),console['log']('(empty)');else{console[_0x545121(0x174)](a39_0xc83a89['dim']('['+_0x5c857a+']'));const _0x7b37ac=formatFlatList(_0x420397,_0x92c755,{'showMetadata':!![],'showUrl':_0x5406db,'getSegmentUrl':_0x4aa8d8,'getJourneyUrl':_0x1b87b2},_0x4c1b66);console[_0x545121(0x174)](_0x7b37ac);}}return 0x0;}async[a39_0x53fa8b(0x173)](_0x155d04,_0x1ac6a1){const _0x2e213e=a39_0x53fa8b,{options:_0x40a042,tdx:_0x5874ca}=_0x155d04,_0x41a118=_0x40a042['web'],_0x4b7638=await withSpinner(_0x2e213e(0x155)+_0x1ac6a1+_0x2e213e(0x151),()=>_0x5874ca[_0x2e213e(0x158)][_0x2e213e(0x178)](_0x1ac6a1),{'verbose':_0x40a042[_0x2e213e(0x156)]}),_0x627271=_0x4b7638[_0x2e213e(0x16e)];_0x40a042[_0x2e213e(0x156)]&&(console['error'](_0x2e213e(0x17f)+_0x627271['parentId']),_0x627271[_0x2e213e(0x164)]&&console[_0x2e213e(0x184)](_0x2e213e(0x153)+_0x627271['folderId']));const _0x597bff=_0x40a042[_0x2e213e(0x16b)]||0xa,_0x268e41=await withSpinner(_0x2e213e(0x190),()=>_0x5874ca[_0x2e213e(0x158)][_0x2e213e(0x173)](_0x627271[_0x2e213e(0x15d)],_0x627271[_0x2e213e(0x164)],0x0,_0x597bff),{'verbose':_0x40a042[_0x2e213e(0x156)]}),_0x137d53=_0x268e41[_0x2e213e(0x16e)];console[_0x2e213e(0x184)](_0x2e213e(0x16f)+_0x137d53[_0x2e213e(0x16a)]+_0x2e213e(0x14a));const _0x15ec94=_0x3cf842=>{const _0x3f3f99=_0x2e213e;return getConsoleNextUrl(_0x40a042['site'],_0x3f3f99(0x154)+_0x627271[_0x3f3f99(0x15d)]+_0x3f3f99(0x176)+_0x3cf842);};if(_0x40a042['format']===_0x2e213e(0x171)||_0x40a042['format']==='jsonl')await handleSDKOutput(_0x137d53,_0x40a042);else{console[_0x2e213e(0x174)](a39_0xc83a89[_0x2e213e(0x18c)]('['+_0x1ac6a1+']'));const _0x39dcb9=formatTree(_0x137d53,{'showMetadata':!![],'showUrl':_0x41a118,'getSegmentUrl':_0x15ec94});console[_0x2e213e(0x174)](_0x39dcb9);}return 0x0;}}
@@ -1 +1 @@
1
- function a40_0x2c1b(){const _0x8bb2ea=['49881062iEJTJY','✔\x20Retrieved\x20','verbose','6tVswLh','error','Usage:\x20tdx\x20show\x20<database.table>','Error:\x20','validate','171785MXtEfy','message','execute','1293542NtIkmh','args','24NoUwHf','\x20\x20Cause:\x20','\x20row','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','1234081kEDBQH','catalog','Site:\x20','\x20from\x20','data','database','length','showTable','30Bheryd','41670BWrRXU','Limit:\x20','table','limit','Querying\x20','Show\x20table\x20contents','2467896pTOgQt','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','...','description','site','2281517YfrqbT','show','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','query','cause','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','1737XwZJQE','Catalog:\x20','Database:\x20'];a40_0x2c1b=function(){return _0x8bb2ea;};return a40_0x2c1b();}function a40_0x36a7(_0x372f6f,_0x345ea1){_0x372f6f=_0x372f6f-0xba;const _0x2c1bf9=a40_0x2c1b();let _0x36a790=_0x2c1bf9[_0x372f6f];return _0x36a790;}const a40_0x53d727=a40_0x36a7;(function(_0x24efbc,_0x14ef30){const _0x35efe9=a40_0x36a7,_0x35b90b=_0x24efbc();while(!![]){try{const _0x4a7717=-parseInt(_0x35efe9(0xe5))/0x1+-parseInt(_0x35efe9(0xdf))/0x2*(parseInt(_0x35efe9(0xd7))/0x3)+parseInt(_0x35efe9(0xc6))/0x4+-parseInt(_0x35efe9(0xdc))/0x5*(parseInt(_0x35efe9(0xbf))/0x6)+-parseInt(_0x35efe9(0xcb))/0x7*(parseInt(_0x35efe9(0xe1))/0x8)+-parseInt(_0x35efe9(0xd1))/0x9*(parseInt(_0x35efe9(0xc0))/0xa)+parseInt(_0x35efe9(0xd4))/0xb;if(_0x4a7717===_0x14ef30)break;else _0x35b90b['push'](_0x35b90b['shift']());}catch(_0x838bb3){_0x35b90b['push'](_0x35b90b['shift']());}}}(a40_0x2c1b,0xa39e8));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{['name']=a40_0x53d727(0xcc);[a40_0x53d727(0xc9)]=a40_0x53d727(0xc5);async[a40_0x53d727(0xde)](_0xe21075){return this['showTable'](_0xe21075);}async[a40_0x53d727(0xbe)](_0x344b29){const _0x493038=a40_0x53d727,{options:_0x34e850,args:_0x39b41a,tdx:_0x16bd43}=_0x344b29;let _0x3a3561;try{_0x3a3561=parseTableReference(_0x39b41a[0x0]);const _0x4cde3a=_0x34e850['database'];!_0x3a3561[_0x493038(0xbc)]&&_0x4cde3a&&(_0x3a3561[_0x493038(0xbc)]=_0x4cde3a);const _0x53c576=validateTableDescribeReference(_0x3a3561);if(_0x53c576)return console[_0x493038(0xd8)](_0x493038(0xda)+_0x53c576),console[_0x493038(0xd8)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x493038(0xd8)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x493038(0xd8)](_0x493038(0xcd)),0x1;}catch(_0xca235a){return console[_0x493038(0xd8)](_0x493038(0xda)+_0xca235a[_0x493038(0xdd)]),console[_0x493038(0xd8)](_0x493038(0xd9)),console[_0x493038(0xd8)](_0x493038(0xd0)),console[_0x493038(0xd8)](_0x493038(0xcd)),0x1;}const _0x31e71a=_0x3a3561[_0x493038(0xe6)],_0x58dc67=_0x3a3561[_0x493038(0xbc)],_0x41b943=_0x3a3561[_0x493038(0xc2)],_0x206981=resolveLimit(_0x34e850[_0x493038(0xc3)],DEFAULT_DISPLAY_LIMIT);try{_0x34e850[_0x493038(0xd6)]&&(console['error'](_0x493038(0xe7)+_0x34e850[_0x493038(0xca)]),_0x31e71a&&console[_0x493038(0xd8)](_0x493038(0xd2)+_0x31e71a),console[_0x493038(0xd8)](_0x493038(0xd3)+_0x58dc67),console[_0x493038(0xd8)]('Table:\x20'+_0x41b943),console[_0x493038(0xd8)](_0x493038(0xc1)+_0x206981));const _0xae430c=_0x31e71a?_0x31e71a+'.'+_0x58dc67+'.'+_0x41b943:_0x58dc67+'.'+_0x41b943,_0x185642=await withSpinner(_0x493038(0xc4)+_0xae430c+_0x493038(0xc8),()=>_0x16bd43[_0x493038(0xce)]['showTable'](_0x58dc67,_0x41b943,_0x206981,_0x31e71a),{'verbose':_0x34e850[_0x493038(0xd6)]}),_0x2c9320=_0x185642[_0x493038(0xbb)],_0x3443fd=_0x2c9320['data'];return _0x3443fd['length']===0x0?console[_0x493038(0xd8)](_0x493038(0xc7)):console[_0x493038(0xd8)](_0x493038(0xd5)+_0x3443fd[_0x493038(0xbd)]+_0x493038(0xe3)+(_0x3443fd[_0x493038(0xbd)]!==0x1?'s':'')+_0x493038(0xba)+_0xae430c),await handleSDKOutput(_0x3443fd,_0x34e850),0x0;}catch(_0xd29b9a){if(_0xd29b9a instanceof SDKError)return console[_0x493038(0xd8)](_0x493038(0xda)+_0xd29b9a['message']),_0xd29b9a[_0x493038(0xcf)]&&console[_0x493038(0xd8)](_0x493038(0xe2)+_0xd29b9a[_0x493038(0xcf)]),0x1;throw _0xd29b9a;}}[a40_0x53d727(0xdb)](_0x2b65cd){const _0x1f0488=a40_0x53d727;if(_0x2b65cd[_0x1f0488(0xe0)]['length']===0x0)return'Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';if(_0x2b65cd[_0x1f0488(0xe0)]['length']>0x1)return _0x1f0488(0xe4);return undefined;}}
1
+ const a40_0x1ffe54=a40_0x41fc;(function(_0x3ff6f4,_0x1a24f5){const _0x354ed6=a40_0x41fc,_0x520101=_0x3ff6f4();while(!![]){try{const _0x3c8d63=parseInt(_0x354ed6(0x1ad))/0x1+parseInt(_0x354ed6(0x19a))/0x2*(parseInt(_0x354ed6(0x1b6))/0x3)+-parseInt(_0x354ed6(0x1b7))/0x4*(parseInt(_0x354ed6(0x1a8))/0x5)+parseInt(_0x354ed6(0x1ba))/0x6*(parseInt(_0x354ed6(0x1c0))/0x7)+-parseInt(_0x354ed6(0x1aa))/0x8+-parseInt(_0x354ed6(0x199))/0x9*(-parseInt(_0x354ed6(0x198))/0xa)+parseInt(_0x354ed6(0x1a2))/0xb*(-parseInt(_0x354ed6(0x1ac))/0xc);if(_0x3c8d63===_0x1a24f5)break;else _0x520101['push'](_0x520101['shift']());}catch(_0x5704cc){_0x520101['push'](_0x520101['shift']());}}}(a40_0x14f4,0x2421c));function a40_0x41fc(_0x51ec57,_0x3f4386){_0x51ec57=_0x51ec57-0x196;const _0x14f4c7=a40_0x14f4();let _0x41fcce=_0x14f4c7[_0x51ec57];return _0x41fcce;}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';function a40_0x14f4(){const _0x36055a=['6369ORUSEG','show','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','Querying\x20','description','Table:\x20','73220fIuaRW','Database:\x20','2263040NjmVwl','limit','4164tCLFBZ','164405FDcXTE','Catalog:\x20','showTable','\x20\x20Cause:\x20','Site:\x20','message','Error:\x20','table','catalog','27849DofNzR','44keasqx','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','Show\x20table\x20contents','6TzFtsJ','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','✔\x20Retrieved\x20','cause','data','database','1695344Uactvw','\x20from\x20','length','args','validate','\x20row','37610kbkFis','369QFKbQo','50humWyE','error','Usage:\x20tdx\x20show\x20<database.table>','...','Limit:\x20','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','verbose','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'];a40_0x14f4=function(){return _0x36055a;};return a40_0x14f4();}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{['name']=a40_0x1ffe54(0x1a3);[a40_0x1ffe54(0x1a6)]=a40_0x1ffe54(0x1b9);async['execute'](_0xfa6654){const _0x33fdb8=a40_0x1ffe54;return this[_0x33fdb8(0x1af)](_0xfa6654);}async[a40_0x1ffe54(0x1af)](_0x1d42bc){const _0x4be7ab=a40_0x1ffe54,{options:_0x22fde4,args:_0x4a12d9,tdx:_0x16e0ed}=_0x1d42bc;let _0x2dee9e;try{_0x2dee9e=parseTableReference(_0x4a12d9[0x0]);const _0x2a0c97=_0x22fde4[_0x4be7ab(0x1bf)];!_0x2dee9e[_0x4be7ab(0x1bf)]&&_0x2a0c97&&(_0x2dee9e[_0x4be7ab(0x1bf)]=_0x2a0c97);const _0x50cbbb=validateTableDescribeReference(_0x2dee9e);if(_0x50cbbb)return console['error'](_0x4be7ab(0x1b3)+_0x50cbbb),console['error'](_0x4be7ab(0x19c)),console['error'](_0x4be7ab(0x1a1)),console[_0x4be7ab(0x19b)](_0x4be7ab(0x1b8)),0x1;}catch(_0x391213){return console[_0x4be7ab(0x19b)](_0x4be7ab(0x1b3)+_0x391213[_0x4be7ab(0x1b2)]),console[_0x4be7ab(0x19b)](_0x4be7ab(0x19c)),console[_0x4be7ab(0x19b)](_0x4be7ab(0x1a1)),console[_0x4be7ab(0x19b)](_0x4be7ab(0x1b8)),0x1;}const _0x496129=_0x2dee9e[_0x4be7ab(0x1b5)],_0x3c788c=_0x2dee9e['database'],_0x470a05=_0x2dee9e[_0x4be7ab(0x1b4)],_0x4a6e9=resolveLimit(_0x22fde4[_0x4be7ab(0x1ab)],DEFAULT_DISPLAY_LIMIT);try{_0x22fde4[_0x4be7ab(0x1a0)]&&(console['error'](_0x4be7ab(0x1b1)+_0x22fde4['site']),_0x496129&&console[_0x4be7ab(0x19b)](_0x4be7ab(0x1ae)+_0x496129),console[_0x4be7ab(0x19b)](_0x4be7ab(0x1a9)+_0x3c788c),console[_0x4be7ab(0x19b)](_0x4be7ab(0x1a7)+_0x470a05),console[_0x4be7ab(0x19b)](_0x4be7ab(0x19e)+_0x4a6e9));const _0xc312da=_0x496129?_0x496129+'.'+_0x3c788c+'.'+_0x470a05:_0x3c788c+'.'+_0x470a05,_0x15826e=await withSpinner(_0x4be7ab(0x1a5)+_0xc312da+_0x4be7ab(0x19d),()=>_0x16e0ed['query'][_0x4be7ab(0x1af)](_0x3c788c,_0x470a05,_0x4a6e9,_0x496129),{'verbose':_0x22fde4[_0x4be7ab(0x1a0)]}),_0x2c3c04=_0x15826e[_0x4be7ab(0x1be)],_0x21d14f=_0x2c3c04[_0x4be7ab(0x1be)];return _0x21d14f[_0x4be7ab(0x1c2)]===0x0?console['error'](_0x4be7ab(0x19f)):console[_0x4be7ab(0x19b)](_0x4be7ab(0x1bc)+_0x21d14f[_0x4be7ab(0x1c2)]+_0x4be7ab(0x197)+(_0x21d14f[_0x4be7ab(0x1c2)]!==0x1?'s':'')+_0x4be7ab(0x1c1)+_0xc312da),await handleSDKOutput(_0x21d14f,_0x22fde4),0x0;}catch(_0x166ffa){if(_0x166ffa instanceof SDKError)return console[_0x4be7ab(0x19b)](_0x4be7ab(0x1b3)+_0x166ffa[_0x4be7ab(0x1b2)]),_0x166ffa[_0x4be7ab(0x1bd)]&&console[_0x4be7ab(0x19b)](_0x4be7ab(0x1b0)+_0x166ffa['cause']),0x1;throw _0x166ffa;}}[a40_0x1ffe54(0x196)](_0xbe421b){const _0x52e1b3=a40_0x1ffe54;if(_0xbe421b['args']['length']===0x0)return _0x52e1b3(0x1bb);if(_0xbe421b[_0x52e1b3(0x1c3)]['length']>0x1)return _0x52e1b3(0x1a4);return undefined;}}
@@ -1 +1 @@
1
- const a41_0x4f03e4=a41_0xc176;(function(_0x35f175,_0x44d775){const _0x516f33=a41_0xc176,_0x3f98a2=_0x35f175();while(!![]){try{const _0x422985=parseInt(_0x516f33(0x165))/0x1+-parseInt(_0x516f33(0x162))/0x2*(-parseInt(_0x516f33(0x159))/0x3)+parseInt(_0x516f33(0x160))/0x4+-parseInt(_0x516f33(0x168))/0x5+parseInt(_0x516f33(0x143))/0x6+parseInt(_0x516f33(0x157))/0x7*(-parseInt(_0x516f33(0x15b))/0x8)+-parseInt(_0x516f33(0x16d))/0x9;if(_0x422985===_0x44d775)break;else _0x3f98a2['push'](_0x3f98a2['shift']());}catch(_0x2ce784){_0x3f98a2['push'](_0x3f98a2['shift']());}}}(a41_0x3f4f,0xadf4c));import{BaseCommand}from'./command.js';function a41_0xc176(_0x29b1cf,_0x5984e3){_0x29b1cf=_0x29b1cf-0x140;const _0x3f4f5e=a41_0x3f4f();let _0xc176a2=_0x3f4f5e[_0x29b1cf];return _0xc176a2;}function a41_0x3f4f(){const _0xa97729=['18125253nGUznD','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','tables','description','2630586BEoOOU','Error:\x20','listTables','Listing\x20tables...','table','Error:\x20Pattern\x20\x27','Database\x20\x27','✖\x20No\x20tables\x20found','Site:\x20','Or\x20use\x20--in\x20flag:','Database:\x20','\x20\x20Use:\x20tdx\x20tables\x20\x22','error','List\x20tables\x20in\x20a\x20database','site','message','Database\x20pattern:\x20','✔\x20Found\x20','name','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','14fwKzwZ','\x20\x20Cause:\x20','1185933pDQPBs','.*\x22','1097184gPgdja','includes','query','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','921612aJbtKJ','\x20table','6xCMkxa','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','data','1271838IdEAiK','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','verbose','629340XAUJMI','Note:\x20\x27','length','cause','database'];a41_0x3f4f=function(){return _0xa97729;};return a41_0x3f4f();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a41_0x4f03e4(0x155)]=a41_0x4f03e4(0x141);[a41_0x4f03e4(0x142)]=a41_0x4f03e4(0x150);async['execute'](_0x192709){const _0x2c6ddb=a41_0x4f03e4,{options:_0x374d18,args:_0x33d65d,tdx:_0x321665}=_0x192709;let _0x4cc67e;if(_0x33d65d[_0x2c6ddb(0x16a)]===0x0)_0x4cc67e={'database':undefined,'table':undefined,'original':''};else{if(_0x33d65d[_0x2c6ddb(0x16a)]===0x1)try{_0x4cc67e=parseTableReference(_0x33d65d[0x0]);if(_0x4cc67e[_0x2c6ddb(0x147)]&&!_0x4cc67e['database']&&!_0x4cc67e['table'][_0x2c6ddb(0x15c)]('*')&&!_0x4cc67e[_0x2c6ddb(0x147)][_0x2c6ddb(0x15c)]('?'))return console['error'](_0x2c6ddb(0x148)+_0x33d65d[0x0]+'\x27\x20is\x20ambiguous.'),console[_0x2c6ddb(0x14f)](_0x2c6ddb(0x15f)+_0x4cc67e['table']+'\x27?'),console[_0x2c6ddb(0x14f)](_0x2c6ddb(0x14e)+_0x4cc67e['table']+_0x2c6ddb(0x15a)),console['error']('\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'+_0x4cc67e[_0x2c6ddb(0x147)]),console[_0x2c6ddb(0x14f)]('\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20'+_0x4cc67e[_0x2c6ddb(0x147)]),console[_0x2c6ddb(0x14f)](''),console[_0x2c6ddb(0x14f)](_0x2c6ddb(0x169)+_0x33d65d[0x0]+'\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27'+_0x4cc67e['table']+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x3d08e9){return console[_0x2c6ddb(0x14f)](_0x2c6ddb(0x144)+_0x3d08e9[_0x2c6ddb(0x152)]),0x1;}else return console[_0x2c6ddb(0x14f)]('Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'),console[_0x2c6ddb(0x14f)](_0x2c6ddb(0x15e)),console[_0x2c6ddb(0x14f)](_0x2c6ddb(0x163)),console[_0x2c6ddb(0x14f)](_0x2c6ddb(0x140)),console[_0x2c6ddb(0x14f)]('\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases'),console[_0x2c6ddb(0x14f)](_0x2c6ddb(0x14c)),console[_0x2c6ddb(0x14f)](_0x2c6ddb(0x166)),0x1;}const _0x15738f=_0x374d18[_0x2c6ddb(0x16c)];!_0x4cc67e['database']&&_0x15738f&&(_0x4cc67e[_0x2c6ddb(0x16c)]=_0x15738f);try{const _0x31764a=_0x1828bd=>_0x1828bd&&(_0x1828bd[_0x2c6ddb(0x15c)]('*')||_0x1828bd[_0x2c6ddb(0x15c)]('?')),_0x53181f=_0x31764a(_0x4cc67e['database']);_0x374d18['verbose']&&(console[_0x2c6ddb(0x14f)](_0x2c6ddb(0x14b)+_0x374d18[_0x2c6ddb(0x151)]),_0x4cc67e[_0x2c6ddb(0x16c)]?_0x53181f?console['error'](_0x2c6ddb(0x153)+_0x4cc67e['database']):console['error'](_0x2c6ddb(0x14d)+_0x4cc67e[_0x2c6ddb(0x16c)]):console[_0x2c6ddb(0x14f)]('Database:\x20all'),_0x4cc67e[_0x2c6ddb(0x147)]&&console['error']('Table\x20pattern:\x20'+_0x4cc67e[_0x2c6ddb(0x147)]));const _0x18ddf4=_0x4cc67e[_0x2c6ddb(0x16c)]&&!_0x53181f?_0x4cc67e[_0x2c6ddb(0x16c)]:undefined,_0xa9f8d5=_0x53181f?_0x4cc67e[_0x2c6ddb(0x16c)]:undefined,_0x406a14=_0x4cc67e[_0x2c6ddb(0x147)],_0x30a47f=resolveLimit(_0x374d18['limit'],DEFAULT_LISTING_LIMIT),_0x4617b6=await withSpinner(_0x2c6ddb(0x146),()=>_0x321665[_0x2c6ddb(0x15d)][_0x2c6ddb(0x145)](_0x18ddf4,_0x406a14,_0xa9f8d5,_0x30a47f),{'verbose':_0x374d18[_0x2c6ddb(0x167)]}),_0x23e335=_0x4617b6[_0x2c6ddb(0x164)];if(_0x23e335[_0x2c6ddb(0x16a)]===0x0&&_0x4cc67e[_0x2c6ddb(0x16c)]&&!_0x53181f)return console[_0x2c6ddb(0x14f)](_0x2c6ddb(0x14a)),console[_0x2c6ddb(0x14f)](_0x2c6ddb(0x149)+_0x4cc67e['database']+_0x2c6ddb(0x156)),0x1;return console[_0x2c6ddb(0x14f)](_0x2c6ddb(0x154)+_0x23e335[_0x2c6ddb(0x16a)]+_0x2c6ddb(0x161)+(_0x23e335[_0x2c6ddb(0x16a)]!==0x1?'s':'')),await handleSDKOutput(_0x23e335,{..._0x374d18,'limit':_0x30a47f}),0x0;}catch(_0x52cfdb){if(_0x52cfdb instanceof SDKError)return console[_0x2c6ddb(0x14f)](_0x2c6ddb(0x144)+_0x52cfdb[_0x2c6ddb(0x152)]),_0x52cfdb[_0x2c6ddb(0x16b)]&&console[_0x2c6ddb(0x14f)](_0x2c6ddb(0x158)+_0x52cfdb[_0x2c6ddb(0x16b)]),0x1;throw _0x52cfdb;}}['validate'](_0x48421d){return undefined;}}
1
+ const a41_0x16fc83=a41_0x1579;(function(_0x286e63,_0x46cfb8){const _0x4b8017=a41_0x1579,_0x579b56=_0x286e63();while(!![]){try{const _0x5c5ad9=parseInt(_0x4b8017(0xb8))/0x1+-parseInt(_0x4b8017(0xcb))/0x2+-parseInt(_0x4b8017(0xbb))/0x3+-parseInt(_0x4b8017(0xca))/0x4+parseInt(_0x4b8017(0xc5))/0x5*(-parseInt(_0x4b8017(0xd4))/0x6)+-parseInt(_0x4b8017(0xb4))/0x7*(parseInt(_0x4b8017(0xc8))/0x8)+parseInt(_0x4b8017(0xbf))/0x9;if(_0x5c5ad9===_0x46cfb8)break;else _0x579b56['push'](_0x579b56['shift']());}catch(_0x10b995){_0x579b56['push'](_0x579b56['shift']());}}}(a41_0x379e,0x2fc04));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';function a41_0x1579(_0x7f8420,_0x1052b1){_0x7f8420=_0x7f8420-0xa7;const _0x379e79=a41_0x379e();let _0x157951=_0x379e79[_0x7f8420];return _0x157951;}function a41_0x379e(){const _0x4a6355=['\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','message','Database\x20\x27','verbose','2232EAeqnA','tables','limit','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','site','Site:\x20','execute','Or\x20use\x20--in\x20flag:','data','\x20\x20Cause:\x20','Error:\x20Pattern\x20\x27','includes','.*\x22','7749FtIGKH','Error:\x20','Database\x20pattern:\x20','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','327144wXKBXZ','error','List\x20tables\x20in\x20a\x20database','604299QBwFNa','✔\x20Found\x20','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','\x20\x20Use:\x20tdx\x20tables\x20\x22','4898655KBKFrm','✖\x20No\x20tables\x20found','cause','table','length','name','650InetWI','Database:\x20all','Listing\x20tables...','360dUfXme','query','415652nwDqbN','544660igUibF','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','\x20table','Table\x20pattern:\x20','database'];a41_0x379e=function(){return _0x4a6355;};return a41_0x379e();}import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a41_0x16fc83(0xc4)]=a41_0x16fc83(0xd5);['description']=a41_0x16fc83(0xba);async[a41_0x16fc83(0xad)](_0x4965b2){const _0x2ba173=a41_0x16fc83,{options:_0x566776,args:_0x2467a9,tdx:_0x1aeeb0}=_0x4965b2;let _0x5196a6;if(_0x2467a9[_0x2ba173(0xc3)]===0x0)_0x5196a6={'database':undefined,'table':undefined,'original':''};else{if(_0x2467a9['length']===0x1)try{_0x5196a6=parseTableReference(_0x2467a9[0x0]);if(_0x5196a6['table']&&!_0x5196a6[_0x2ba173(0xcf)]&&!_0x5196a6[_0x2ba173(0xc2)][_0x2ba173(0xb2)]('*')&&!_0x5196a6[_0x2ba173(0xc2)]['includes']('?'))return console[_0x2ba173(0xb9)](_0x2ba173(0xb1)+_0x2467a9[0x0]+'\x27\x20is\x20ambiguous.'),console[_0x2ba173(0xb9)](_0x2ba173(0xb7)+_0x5196a6[_0x2ba173(0xc2)]+'\x27?'),console[_0x2ba173(0xb9)](_0x2ba173(0xbe)+_0x5196a6[_0x2ba173(0xc2)]+_0x2ba173(0xb3)),console[_0x2ba173(0xb9)](_0x2ba173(0xa8)+_0x5196a6[_0x2ba173(0xc2)]),console[_0x2ba173(0xb9)]('\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20'+_0x5196a6[_0x2ba173(0xc2)]),console[_0x2ba173(0xb9)](''),console[_0x2ba173(0xb9)]('Note:\x20\x27'+_0x2467a9[0x0]+_0x2ba173(0xaa)+_0x5196a6[_0x2ba173(0xc2)]+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x11b7ca){return console[_0x2ba173(0xb9)](_0x2ba173(0xb5)+_0x11b7ca['message']),0x1;}else return console[_0x2ba173(0xb9)]('Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'),console['error'](_0x2ba173(0xd0)),console[_0x2ba173(0xb9)](_0x2ba173(0xa9)),console[_0x2ba173(0xb9)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console['error'](_0x2ba173(0xcc)),console[_0x2ba173(0xb9)](_0x2ba173(0xae)),console[_0x2ba173(0xb9)]('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0x308617=_0x566776[_0x2ba173(0xcf)];!_0x5196a6['database']&&_0x308617&&(_0x5196a6[_0x2ba173(0xcf)]=_0x308617);try{const _0x41b362=_0x130abb=>_0x130abb&&(_0x130abb[_0x2ba173(0xb2)]('*')||_0x130abb[_0x2ba173(0xb2)]('?')),_0x3f2905=_0x41b362(_0x5196a6[_0x2ba173(0xcf)]);_0x566776[_0x2ba173(0xd3)]&&(console['error'](_0x2ba173(0xac)+_0x566776[_0x2ba173(0xab)]),_0x5196a6[_0x2ba173(0xcf)]?_0x3f2905?console[_0x2ba173(0xb9)](_0x2ba173(0xb6)+_0x5196a6[_0x2ba173(0xcf)]):console[_0x2ba173(0xb9)]('Database:\x20'+_0x5196a6[_0x2ba173(0xcf)]):console['error'](_0x2ba173(0xc6)),_0x5196a6[_0x2ba173(0xc2)]&&console[_0x2ba173(0xb9)](_0x2ba173(0xce)+_0x5196a6[_0x2ba173(0xc2)]));const _0x5e44ef=_0x5196a6['database']&&!_0x3f2905?_0x5196a6[_0x2ba173(0xcf)]:undefined,_0x4aa89a=_0x3f2905?_0x5196a6['database']:undefined,_0x35a42b=_0x5196a6['table'],_0x1a77e6=resolveLimit(_0x566776[_0x2ba173(0xa7)],DEFAULT_LISTING_LIMIT),_0x21b0c6=await withSpinner(_0x2ba173(0xc7),()=>_0x1aeeb0[_0x2ba173(0xc9)]['listTables'](_0x5e44ef,_0x35a42b,_0x4aa89a,_0x1a77e6),{'verbose':_0x566776['verbose']}),_0x34f68f=_0x21b0c6[_0x2ba173(0xaf)];if(_0x34f68f[_0x2ba173(0xc3)]===0x0&&_0x5196a6[_0x2ba173(0xcf)]&&!_0x3f2905)return console[_0x2ba173(0xb9)](_0x2ba173(0xc0)),console['error'](_0x2ba173(0xd2)+_0x5196a6[_0x2ba173(0xcf)]+_0x2ba173(0xbd)),0x1;return console[_0x2ba173(0xb9)](_0x2ba173(0xbc)+_0x34f68f['length']+_0x2ba173(0xcd)+(_0x34f68f[_0x2ba173(0xc3)]!==0x1?'s':'')),await handleSDKOutput(_0x34f68f,{..._0x566776,'limit':_0x1a77e6}),0x0;}catch(_0x105b4c){if(_0x105b4c instanceof SDKError)return console[_0x2ba173(0xb9)](_0x2ba173(0xb5)+_0x105b4c[_0x2ba173(0xd1)]),_0x105b4c['cause']&&console[_0x2ba173(0xb9)](_0x2ba173(0xb0)+_0x105b4c[_0x2ba173(0xc1)]),0x1;throw _0x105b4c;}}['validate'](_0x10228d){return undefined;}}
@@ -1 +1 @@
1
- function a42_0x3f9f(){const _0x1a3ac7=['60807tqJLQl','llm_agent','128VZKpiM','Session\x20agent\x20set\x20to:\x20','148ApgsjB','\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','Session\x20engage_workspace\x20set\x20to:\x20','5752UxoQHp','Session\x20database\x20set\x20to:\x20','use','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','parent_segment','Error:\x20Profile\x20\x27','7125700CQZlng','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','toString','includes','(session:\x20','display','name','2659240oopEfX','execute','displayWithSources','join','message','dim','Session\x20llm_project\x20set\x20to:\x20','11835YFwtiP','6wqWFiV','llm_project','\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','debug','Session\x20parent_segment\x20set\x20to:\x20','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace','validate','cleared','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','\x27\x20does\x20not\x20exist','engage_workspace','Session\x20profile\x20set\x20to:\x20','length','15358nGsgoq','profile','18573467Udmojb','session','1714419wXZEVX','green','12QYTKQz','Invalid\x20resource:\x20','database','.\x20Must\x20be\x20one\x20of:\x20','error','log'];a42_0x3f9f=function(){return _0x1a3ac7;};return a42_0x3f9f();}const a42_0x3fd59e=a42_0xe761;(function(_0x545040,_0x58dd40){const _0x1e1483=a42_0xe761,_0x3ada3f=_0x545040();while(!![]){try{const _0x4b8e6b=parseInt(_0x1e1483(0x1cc))/0x1*(parseInt(_0x1e1483(0x1a5))/0x2)+-parseInt(_0x1e1483(0x1a3))/0x3*(-parseInt(_0x1e1483(0x1a7))/0x4)+-parseInt(_0x1e1483(0x1b7))/0x5*(-parseInt(_0x1e1483(0x1bf))/0x6)+-parseInt(_0x1e1483(0x1d0))/0x7+parseInt(_0x1e1483(0x1aa))/0x8*(parseInt(_0x1e1483(0x1be))/0x9)+-parseInt(_0x1e1483(0x1b0))/0xa+-parseInt(_0x1e1483(0x1ce))/0xb*(parseInt(_0x1e1483(0x19d))/0xc);if(_0x4b8e6b===_0x58dd40)break;else _0x3ada3f['push'](_0x3ada3f['shift']());}catch(_0x36e84e){_0x3ada3f['push'](_0x3ada3f['shift']());}}}(a42_0x3f9f,0x89bf6));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{parseAgentRef}from'../utils/agent-ref-parser.js';import a42_0x3127bd from'chalk';function a42_0xe761(_0x3d77d8,_0x4004ad){_0x3d77d8=_0x3d77d8-0x19c;const _0x3f9f96=a42_0x3f9f();let _0xe761a1=_0x3f9f96[_0x3d77d8];return _0xe761a1;}export class UseCommand extends BaseCommand{[a42_0x3fd59e(0x1b6)]=a42_0x3fd59e(0x1ac);['description']='Set\x20session-level\x20context';[a42_0x3fd59e(0x1c5)](_0x20fba1){const _0x442e43=a42_0x3fd59e,{args:_0x5e6be6}=_0x20fba1;if(_0x5e6be6[_0x442e43(0x1cb)]===0x0)return undefined;if(_0x5e6be6[_0x442e43(0x1cb)]===0x1)return _0x442e43(0x1b1)+_0x442e43(0x1c1)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a'+_0x442e43(0x1a8)+_0x442e43(0x1c7);const _0x432e85=_0x5e6be6[0x0],_0x2397f4=['database',_0x442e43(0x1ae),'llm_project','agent',_0x442e43(0x1cd),_0x442e43(0x1c9)];if(!_0x2397f4[_0x442e43(0x1b3)](_0x432e85))return _0x442e43(0x19e)+_0x432e85+_0x442e43(0x1a0)+_0x2397f4[_0x442e43(0x1ba)](',\x20');return undefined;}async[a42_0x3fd59e(0x1b8)](_0x4063bc){const _0x3a7253=a42_0x3fd59e,{args:_0x5a54bb,options:_0xe7ca36}=_0x4063bc,_0x9fc924=_0xe7ca36[_0x3a7253(0x1c2)],_0x1b821c=_0xe7ca36['clear'];cleanExpiredSessions();try{if(_0x1b821c){clearSessionContext(_0xe7ca36[_0x3a7253(0x1cf)]);const _0x3b3403=_0xe7ca36[_0x3a7253(0x1cf)]||getCurrentSessionPID()[_0x3a7253(0x1b2)]();return console['log']('Session\x20context\x20'+a42_0x3127bd[_0x3a7253(0x19c)](_0x3a7253(0x1c6))+'\x20'+a42_0x3127bd['dim'](_0x3a7253(0x1b4)+_0x3b3403+')')),0x0;}if(_0x5a54bb[_0x3a7253(0x1cb)]===0x0){const _0x1eff2a=new GlobalContext(_0xe7ca36);return _0x9fc924?_0x1eff2a[_0x3a7253(0x1b9)]():_0x1eff2a[_0x3a7253(0x1b5)](),console[_0x3a7253(0x1a2)](a42_0x3127bd[_0x3a7253(0x1bc)]('\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>')),console[_0x3a7253(0x1a2)](a42_0x3127bd[_0x3a7253(0x1bc)](_0x3a7253(0x1c4))),0x0;}const _0x157499=_0x5a54bb[0x0],_0x583e8d=_0x5a54bb[0x1];if(_0x157499===_0x3a7253(0x1cd)){if(!profileExists(_0x583e8d))return console['error'](_0x3a7253(0x1af)+_0x583e8d+_0x3a7253(0x1c8)),console['error']('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x5c6b3b=_0xe7ca36['session']||getCurrentSessionPID()['toString']();return saveSessionContext({'profile':_0x583e8d},_0xe7ca36['session']),console[_0x3a7253(0x1a2)](_0x3a7253(0x1ca)+a42_0x3127bd[_0x3a7253(0x19c)](_0x583e8d)+'\x20'+a42_0x3127bd[_0x3a7253(0x1bc)](_0x3a7253(0x1b4)+_0x5c6b3b+')')),console[_0x3a7253(0x1a2)](a42_0x3127bd[_0x3a7253(0x1bc)](_0x3a7253(0x1ad))),0x0;}const _0x6217e0={},_0x58505f=_0xe7ca36['session']||getCurrentSessionPID()[_0x3a7253(0x1b2)]();switch(_0x157499){case _0x3a7253(0x19f):_0x6217e0[_0x3a7253(0x19f)]=_0x583e8d,console[_0x3a7253(0x1a2)](_0x3a7253(0x1ab)+a42_0x3127bd[_0x3a7253(0x19c)](_0x583e8d)+'\x20'+a42_0x3127bd['dim'](_0x3a7253(0x1b4)+_0x58505f+')'));break;case _0x3a7253(0x1ae):_0x6217e0['parent_segment']=_0x583e8d,console[_0x3a7253(0x1a2)](_0x3a7253(0x1c3)+a42_0x3127bd[_0x3a7253(0x19c)](_0x583e8d)+'\x20'+a42_0x3127bd['dim'](_0x3a7253(0x1b4)+_0x58505f+')'));break;case'llm_project':_0x6217e0['llm_project']=_0x583e8d,console['log'](_0x3a7253(0x1bd)+a42_0x3127bd['green'](_0x583e8d)+'\x20'+a42_0x3127bd[_0x3a7253(0x1bc)](_0x3a7253(0x1b4)+_0x58505f+')'));break;case'agent':{const {projectName:_0x581b91,agentName:_0x2182ab}=parseAgentRef(_0x583e8d);_0x2182ab?(_0x6217e0[_0x3a7253(0x1c0)]=_0x581b91,_0x6217e0[_0x3a7253(0x1a4)]=_0x2182ab,console['log']('Session\x20llm_project\x20set\x20to:\x20'+a42_0x3127bd[_0x3a7253(0x19c)](_0x581b91)+'\x20'+a42_0x3127bd[_0x3a7253(0x1bc)](_0x3a7253(0x1b4)+_0x58505f+')')),console[_0x3a7253(0x1a2)]('Session\x20agent\x20set\x20to:\x20'+a42_0x3127bd['green'](_0x2182ab)+'\x20'+a42_0x3127bd['dim'](_0x3a7253(0x1b4)+_0x58505f+')'))):(_0x6217e0[_0x3a7253(0x1a4)]=_0x583e8d,console['log'](_0x3a7253(0x1a6)+a42_0x3127bd['green'](_0x583e8d)+'\x20'+a42_0x3127bd['dim'](_0x3a7253(0x1b4)+_0x58505f+')')));break;}case'engage_workspace':_0x6217e0[_0x3a7253(0x1c9)]=_0x583e8d,console[_0x3a7253(0x1a2)](_0x3a7253(0x1a9)+a42_0x3127bd[_0x3a7253(0x19c)](_0x583e8d)+'\x20'+a42_0x3127bd[_0x3a7253(0x1bc)](_0x3a7253(0x1b4)+_0x58505f+')'));break;}return saveSessionContext(_0x6217e0,_0xe7ca36['session']),console['log'](a42_0x3127bd[_0x3a7253(0x1bc)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides')),0x0;}catch(_0x300f1f){return _0x300f1f instanceof Error&&console[_0x3a7253(0x1a1)]('Error:\x20'+_0x300f1f[_0x3a7253(0x1bb)]),0x1;}}}
1
+ const a42_0x3ce89a=a42_0x25ea;(function(_0x2a8ba8,_0xece194){const _0x35e192=a42_0x25ea,_0x10c518=_0x2a8ba8();while(!![]){try{const _0x29f753=parseInt(_0x35e192(0x8c))/0x1+parseInt(_0x35e192(0x7f))/0x2+parseInt(_0x35e192(0x89))/0x3+parseInt(_0x35e192(0x8a))/0x4+-parseInt(_0x35e192(0x86))/0x5*(parseInt(_0x35e192(0x65))/0x6)+parseInt(_0x35e192(0x85))/0x7*(-parseInt(_0x35e192(0x79))/0x8)+parseInt(_0x35e192(0x78))/0x9*(parseInt(_0x35e192(0x81))/0xa);if(_0x29f753===_0xece194)break;else _0x10c518['push'](_0x10c518['shift']());}catch(_0x59ff52){_0x10c518['push'](_0x10c518['shift']());}}}(a42_0x587b,0x35535));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';function a42_0x587b(){const _0x1d8f27=['Resources:\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace','Invalid\x20resource:\x20','debug','profile','Set\x20session-level\x20context','error','validate','llm_project','green','296415IsopMO','130936FdbhRd','description','dim','log','database','displayWithSources','82464VxOsaK','clear','50TLOpGL','Session\x20database\x20set\x20to:\x20','Session\x20profile\x20set\x20to:\x20','Session\x20agent\x20set\x20to:\x20','182JnQvOo','465Gjvuus','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','agent','867486BdDUXf','377688WpHxOy','parent_segment','229498jxpPCc','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','cleared','llm_agent','length','engage_workspace','\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Session\x20llm_project\x20set\x20to:\x20','11292pDYJSn','use','display','(session:\x20','.\x20Must\x20be\x20one\x20of:\x20','Session\x20parent_segment\x20set\x20to:\x20','name','toString','session','\x27\x20does\x20not\x20exist'];a42_0x587b=function(){return _0x1d8f27;};return a42_0x587b();}function a42_0x25ea(_0x14a696,_0x135e5a){_0x14a696=_0x14a696-0x65;const _0x587bf9=a42_0x587b();let _0x25ea99=_0x587bf9[_0x14a696];return _0x25ea99;}import{profileExists}from'../core/profile.js';import{GlobalContext}from'../core/global-context.js';import{parseAgentRef}from'../utils/agent-ref-parser.js';import a42_0x28bf2e from'chalk';export class UseCommand extends BaseCommand{[a42_0x3ce89a(0x6b)]=a42_0x3ce89a(0x66);[a42_0x3ce89a(0x7a)]=a42_0x3ce89a(0x73);[a42_0x3ce89a(0x75)](_0x2007f0){const _0x4c0612=a42_0x3ce89a,{args:_0x28e928}=_0x2007f0;if(_0x28e928[_0x4c0612(0x91)]===0x0)return undefined;if(_0x28e928[_0x4c0612(0x91)]===0x1)return _0x4c0612(0x8e)+'\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'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a'+_0x4c0612(0x93)+_0x4c0612(0x8d);const _0x3c65e1=_0x28e928[0x0],_0x353b04=[_0x4c0612(0x7d),_0x4c0612(0x8b),_0x4c0612(0x76),_0x4c0612(0x88),'profile',_0x4c0612(0x92)];if(!_0x353b04['includes'](_0x3c65e1))return _0x4c0612(0x70)+_0x3c65e1+_0x4c0612(0x69)+_0x353b04['join'](',\x20');return undefined;}async['execute'](_0x3bfde5){const _0x36e366=a42_0x3ce89a,{args:_0x40728b,options:_0x30d9b5}=_0x3bfde5,_0x574d24=_0x30d9b5[_0x36e366(0x71)],_0x1f5ff6=_0x30d9b5[_0x36e366(0x80)];cleanExpiredSessions();try{if(_0x1f5ff6){clearSessionContext(_0x30d9b5[_0x36e366(0x6d)]);const _0x4297a5=_0x30d9b5[_0x36e366(0x6d)]||getCurrentSessionPID()['toString']();return console[_0x36e366(0x7c)]('Session\x20context\x20'+a42_0x28bf2e[_0x36e366(0x77)](_0x36e366(0x8f))+'\x20'+a42_0x28bf2e[_0x36e366(0x7b)]('(session:\x20'+_0x4297a5+')')),0x0;}if(_0x40728b['length']===0x0){const _0x3950f2=new GlobalContext(_0x30d9b5);return _0x574d24?_0x3950f2[_0x36e366(0x7e)]():_0x3950f2[_0x36e366(0x67)](),console['log'](a42_0x28bf2e[_0x36e366(0x7b)]('\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>')),console[_0x36e366(0x7c)](a42_0x28bf2e[_0x36e366(0x7b)](_0x36e366(0x6f))),0x0;}const _0x5a2aa9=_0x40728b[0x0],_0x5cf776=_0x40728b[0x1];if(_0x5a2aa9===_0x36e366(0x72)){if(!profileExists(_0x5cf776))return console[_0x36e366(0x74)]('Error:\x20Profile\x20\x27'+_0x5cf776+_0x36e366(0x6e)),console['error'](_0x36e366(0x87)),0x1;const _0x283d63=_0x30d9b5[_0x36e366(0x6d)]||getCurrentSessionPID()[_0x36e366(0x6c)]();return saveSessionContext({'profile':_0x5cf776},_0x30d9b5['session']),console[_0x36e366(0x7c)](_0x36e366(0x83)+a42_0x28bf2e[_0x36e366(0x77)](_0x5cf776)+'\x20'+a42_0x28bf2e[_0x36e366(0x7b)]('(session:\x20'+_0x283d63+')')),console[_0x36e366(0x7c)](a42_0x28bf2e[_0x36e366(0x7b)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides')),0x0;}const _0x53e3e9={},_0x394bab=_0x30d9b5['session']||getCurrentSessionPID()[_0x36e366(0x6c)]();switch(_0x5a2aa9){case _0x36e366(0x7d):_0x53e3e9['database']=_0x5cf776,console[_0x36e366(0x7c)](_0x36e366(0x82)+a42_0x28bf2e['green'](_0x5cf776)+'\x20'+a42_0x28bf2e[_0x36e366(0x7b)](_0x36e366(0x68)+_0x394bab+')'));break;case _0x36e366(0x8b):_0x53e3e9['parent_segment']=_0x5cf776,console[_0x36e366(0x7c)](_0x36e366(0x6a)+a42_0x28bf2e[_0x36e366(0x77)](_0x5cf776)+'\x20'+a42_0x28bf2e[_0x36e366(0x7b)]('(session:\x20'+_0x394bab+')'));break;case _0x36e366(0x76):_0x53e3e9[_0x36e366(0x76)]=_0x5cf776,console[_0x36e366(0x7c)]('Session\x20llm_project\x20set\x20to:\x20'+a42_0x28bf2e['green'](_0x5cf776)+'\x20'+a42_0x28bf2e[_0x36e366(0x7b)]('(session:\x20'+_0x394bab+')'));break;case _0x36e366(0x88):{const {projectName:_0x2c8a12,agentName:_0xce4d5b}=parseAgentRef(_0x5cf776);_0xce4d5b?(_0x53e3e9[_0x36e366(0x76)]=_0x2c8a12,_0x53e3e9[_0x36e366(0x90)]=_0xce4d5b,console[_0x36e366(0x7c)](_0x36e366(0x95)+a42_0x28bf2e['green'](_0x2c8a12)+'\x20'+a42_0x28bf2e[_0x36e366(0x7b)]('(session:\x20'+_0x394bab+')')),console[_0x36e366(0x7c)](_0x36e366(0x84)+a42_0x28bf2e['green'](_0xce4d5b)+'\x20'+a42_0x28bf2e['dim']('(session:\x20'+_0x394bab+')'))):(_0x53e3e9[_0x36e366(0x90)]=_0x5cf776,console[_0x36e366(0x7c)]('Session\x20agent\x20set\x20to:\x20'+a42_0x28bf2e[_0x36e366(0x77)](_0x5cf776)+'\x20'+a42_0x28bf2e['dim'](_0x36e366(0x68)+_0x394bab+')')));break;}case _0x36e366(0x92):_0x53e3e9[_0x36e366(0x92)]=_0x5cf776,console['log']('Session\x20engage_workspace\x20set\x20to:\x20'+a42_0x28bf2e[_0x36e366(0x77)](_0x5cf776)+'\x20'+a42_0x28bf2e['dim'](_0x36e366(0x68)+_0x394bab+')'));break;}return saveSessionContext(_0x53e3e9,_0x30d9b5[_0x36e366(0x6d)]),console['log'](a42_0x28bf2e['dim'](_0x36e366(0x94))),0x0;}catch(_0x89cb93){return _0x89cb93 instanceof Error&&console[_0x36e366(0x74)]('Error:\x20'+_0x89cb93['message']),0x1;}}}
@@ -1 +1 @@
1
- const a43_0x249d60=a43_0x3645;(function(_0x4e52e3,_0x46f969){const _0x3faedc=a43_0x3645,_0x99d13a=_0x4e52e3();while(!![]){try{const _0x49366e=-parseInt(_0x3faedc(0x158))/0x1+-parseInt(_0x3faedc(0x153))/0x2+-parseInt(_0x3faedc(0x152))/0x3+-parseInt(_0x3faedc(0x151))/0x4*(-parseInt(_0x3faedc(0x15c))/0x5)+-parseInt(_0x3faedc(0x149))/0x6+parseInt(_0x3faedc(0x14d))/0x7+parseInt(_0x3faedc(0x15d))/0x8*(parseInt(_0x3faedc(0x14a))/0x9);if(_0x49366e===_0x46f969)break;else _0x99d13a['push'](_0x99d13a['shift']());}catch(_0x48985f){_0x99d13a['push'](_0x99d13a['shift']());}}}(a43_0x45b0,0x2d996));function a43_0x3645(_0xb0f238,_0x378d78){_0xb0f238=_0xb0f238-0x148;const _0x45b0ae=a43_0x45b0();let _0x364515=_0x45b0ae[_0xb0f238];return _0x364515;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class UserCommand extends BaseCommand{[a43_0x249d60(0x14e)]=a43_0x249d60(0x163);['description']=a43_0x249d60(0x14c);async[a43_0x249d60(0x156)](_0x26d44c){const _0x3d7157=a43_0x249d60,{options:_0x3fc8f2,tdx:_0x2ecd94}=_0x26d44c;try{const _0x3f2592=await withSpinner(_0x3d7157(0x150),()=>_0x2ecd94[_0x3d7157(0x163)]['getCurrent'](),{'verbose':_0x3fc8f2[_0x3d7157(0x155)]}),_0x461561=_0x3f2592[_0x3d7157(0x154)];return await handleSingleObjectOutput(_0x461561,_0x3fc8f2),0x0;}catch(_0x59be69){if(_0x59be69 instanceof SDKError)return console[_0x3d7157(0x15a)](_0x3d7157(0x161)+_0x59be69[_0x3d7157(0x157)]),_0x59be69[_0x3d7157(0x160)]&&console[_0x3d7157(0x15a)]('\x20\x20Cause:\x20'+_0x59be69['cause']),0x1;throw _0x59be69;}}}function a43_0x45b0(){const _0x3e73fb=['407912ympCUD','data','verbose','execute','message','150365cmtzTi','List\x20all\x20users\x20in\x20the\x20account','error','description','351635pPKvKi','5721456ztlWjn','user\x20list','length','cause','Error:\x20','list','user','Listing\x20users...','2212932nhfDzf','9VbyaEJ','\x20user','Show\x20current\x20user\x20information','1261498eUMrWl','name','✔\x20Found\x20','Fetching\x20user\x20info...','12wYRESe','589380EmLmkH'];a43_0x45b0=function(){return _0x3e73fb;};return a43_0x45b0();}export class UserListCommand extends BaseCommand{[a43_0x249d60(0x14e)]=a43_0x249d60(0x15e);[a43_0x249d60(0x15b)]=a43_0x249d60(0x159);async[a43_0x249d60(0x156)](_0x13eff4){const _0x320f44=a43_0x249d60,{options:_0x23cb98,tdx:_0x562ed9}=_0x13eff4;try{const _0x1f2a75=await withSpinner(_0x320f44(0x148),()=>_0x562ed9[_0x320f44(0x163)][_0x320f44(0x162)](),{'verbose':_0x23cb98[_0x320f44(0x155)]}),_0x20a0c4=_0x1f2a75['data'];return console['error'](_0x320f44(0x14f)+_0x20a0c4[_0x320f44(0x15f)]+_0x320f44(0x14b)+(_0x20a0c4[_0x320f44(0x15f)]!==0x1?'s':'')),await handleSDKOutput(_0x20a0c4,_0x23cb98),0x0;}catch(_0x25ee31){if(_0x25ee31 instanceof SDKError)return console['error']('Error:\x20'+_0x25ee31['message']),_0x25ee31['cause']&&console[_0x320f44(0x15a)]('\x20\x20Cause:\x20'+_0x25ee31[_0x320f44(0x160)]),0x1;throw _0x25ee31;}}}
1
+ const a43_0x2be610=a43_0xf680;function a43_0xf680(_0x31e569,_0x3326a0){_0x31e569=_0x31e569-0xca;const _0x55b41f=a43_0x55b4();let _0xf680f5=_0x55b41f[_0x31e569];return _0xf680f5;}(function(_0x5e0f94,_0x6ecafb){const _0xb3bb45=a43_0xf680,_0x17788b=_0x5e0f94();while(!![]){try{const _0x470054=-parseInt(_0xb3bb45(0xdb))/0x1+-parseInt(_0xb3bb45(0xcc))/0x2+-parseInt(_0xb3bb45(0xcd))/0x3+-parseInt(_0xb3bb45(0xde))/0x4+-parseInt(_0xb3bb45(0xdd))/0x5*(-parseInt(_0xb3bb45(0xd3))/0x6)+parseInt(_0xb3bb45(0xe4))/0x7+parseInt(_0xb3bb45(0xe3))/0x8;if(_0x470054===_0x6ecafb)break;else _0x17788b['push'](_0x17788b['shift']());}catch(_0x5e2251){_0x17788b['push'](_0x17788b['shift']());}}}(a43_0x55b4,0x91c7c));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a43_0x55b4(){const _0x1697f1=['error','user','\x20\x20Cause:\x20','getCurrent','364199WlNCsY','length','16820NmiOlH','3637656MmVNhj','verbose','Fetching\x20user\x20info...','execute','user\x20list','18448032HUgWnS','1678110eQoETP','✔\x20Found\x20','\x20user','1671832ZWJhPe','2474223waIojq','description','data','name','list','cause','1758enbElT','Show\x20current\x20user\x20information','Listing\x20users...','Error:\x20'];a43_0x55b4=function(){return _0x1697f1;};return a43_0x55b4();}import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class UserCommand extends BaseCommand{[a43_0x2be610(0xd0)]=a43_0x2be610(0xd8);[a43_0x2be610(0xce)]=a43_0x2be610(0xd4);async['execute'](_0x73fd51){const _0x43bd8e=a43_0x2be610,{options:_0x373a34,tdx:_0x5b7f8b}=_0x73fd51;try{const _0x267352=await withSpinner(_0x43bd8e(0xe0),()=>_0x5b7f8b[_0x43bd8e(0xd8)][_0x43bd8e(0xda)](),{'verbose':_0x373a34[_0x43bd8e(0xdf)]}),_0x24c2bd=_0x267352[_0x43bd8e(0xcf)];return await handleSingleObjectOutput(_0x24c2bd,_0x373a34),0x0;}catch(_0x2847c4){if(_0x2847c4 instanceof SDKError)return console[_0x43bd8e(0xd7)]('Error:\x20'+_0x2847c4['message']),_0x2847c4[_0x43bd8e(0xd2)]&&console[_0x43bd8e(0xd7)](_0x43bd8e(0xd9)+_0x2847c4['cause']),0x1;throw _0x2847c4;}}}export class UserListCommand extends BaseCommand{[a43_0x2be610(0xd0)]=a43_0x2be610(0xe2);[a43_0x2be610(0xce)]='List\x20all\x20users\x20in\x20the\x20account';async[a43_0x2be610(0xe1)](_0x7b073d){const _0x5b044f=a43_0x2be610,{options:_0x3c7e1a,tdx:_0x26625}=_0x7b073d;try{const _0xfaaf60=await withSpinner(_0x5b044f(0xd5),()=>_0x26625[_0x5b044f(0xd8)][_0x5b044f(0xd1)](),{'verbose':_0x3c7e1a[_0x5b044f(0xdf)]}),_0x33d4b9=_0xfaaf60[_0x5b044f(0xcf)];return console['error'](_0x5b044f(0xca)+_0x33d4b9[_0x5b044f(0xdc)]+_0x5b044f(0xcb)+(_0x33d4b9[_0x5b044f(0xdc)]!==0x1?'s':'')),await handleSDKOutput(_0x33d4b9,_0x3c7e1a),0x0;}catch(_0x1a7940){if(_0x1a7940 instanceof SDKError)return console[_0x5b044f(0xd7)](_0x5b044f(0xd6)+_0x1a7940['message']),_0x1a7940[_0x5b044f(0xd2)]&&console[_0x5b044f(0xd7)](_0x5b044f(0xd9)+_0x1a7940['cause']),0x1;throw _0x1a7940;}}}
@@ -1 +1 @@
1
- const a44_0x16383b=a44_0x3f12;(function(_0x263e41,_0x400f82){const _0xe93d38=a44_0x3f12,_0x6da8bc=_0x263e41();while(!![]){try{const _0x33bf3b=parseInt(_0xe93d38(0x96))/0x1*(-parseInt(_0xe93d38(0xa3))/0x2)+parseInt(_0xe93d38(0xf2))/0x3*(parseInt(_0xe93d38(0xf7))/0x4)+-parseInt(_0xe93d38(0xb2))/0x5+-parseInt(_0xe93d38(0xbb))/0x6+parseInt(_0xe93d38(0xc9))/0x7+-parseInt(_0xe93d38(0xdc))/0x8+parseInt(_0xe93d38(0xd1))/0x9;if(_0x33bf3b===_0x400f82)break;else _0x6da8bc['push'](_0x6da8bc['shift']());}catch(_0x524d1d){_0x6da8bc['push'](_0x6da8bc['shift']());}}}(a44_0x5e5d,0x7265b));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 a44_0x210539 from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a44_0x16383b(0xb3)]=a44_0x16383b(0xd5);[a44_0x16383b(0xde)]=a44_0x16383b(0xd7);async[a44_0x16383b(0x121)](_0x5cc5f){const _0x5423e6=a44_0x16383b,{options:_0x27e056,args:_0x51547b,tdx:_0x264647}=_0x5cc5f,_0x545d4d=_0x51547b[0x0];try{_0x27e056[_0x5423e6(0x10d)]&&_0x545d4d&&console[_0x5423e6(0xdf)](_0x5423e6(0x10b)+_0x545d4d);const _0x1f63b3=await withSpinner(_0x5423e6(0x112),()=>_0x264647[_0x5423e6(0x10f)][_0x5423e6(0x87)](_0x545d4d,{'limit':_0x27e056[_0x5423e6(0xb8)]}),{'verbose':_0x27e056['verbose']}),_0x3c5f87=_0x1f63b3['data'];return console[_0x5423e6(0xdf)](_0x5423e6(0xbd)+_0x3c5f87[_0x5423e6(0x118)]+_0x5423e6(0x105)+(_0x3c5f87[_0x5423e6(0x118)]!==0x1?'s':'')),await handleSDKOutput(_0x3c5f87,_0x27e056),0x0;}catch(_0x1dec0d){if(_0x1dec0d instanceof SDKError)return console[_0x5423e6(0xdf)](_0x5423e6(0xf4)+_0x1dec0d[_0x5423e6(0x8c)]),_0x1dec0d['cause']&&console[_0x5423e6(0xdf)](_0x5423e6(0xb1)+_0x1dec0d[_0x5423e6(0xbf)]),0x1;throw _0x1dec0d;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a44_0x16383b(0xb3)]=a44_0x16383b(0x124);[a44_0x16383b(0xde)]='List\x20workflows';async[a44_0x16383b(0x121)](_0x5452ba){const _0x3148b4=a44_0x16383b,{options:_0x3c269a,args:_0x31a0a3,tdx:_0x37af11}=_0x5452ba,_0x5253da=_0x31a0a3[0x0];try{_0x3c269a[_0x3148b4(0x10d)]&&_0x5253da&&console[_0x3148b4(0xdf)](_0x3148b4(0x122)+_0x5253da);const _0xd1661e=await withSpinner(_0x3148b4(0x10e),()=>_0x37af11['workflow'][_0x3148b4(0x107)](_0x5253da,{'limit':_0x3c269a[_0x3148b4(0xb8)]}),{'verbose':_0x3c269a[_0x3148b4(0x10d)]}),_0x5609eb=_0xd1661e[_0x3148b4(0xb7)];return console[_0x3148b4(0xdf)](_0x3148b4(0xbd)+_0x5609eb[_0x3148b4(0x118)]+_0x3148b4(0xc1)+(_0x5609eb['length']!==0x1?'s':'')),await handleSDKOutput(_0x5609eb,_0x3c269a),0x0;}catch(_0x36a81a){if(_0x36a81a instanceof SDKError)return console['error'](_0x3148b4(0xf4)+_0x36a81a[_0x3148b4(0x8c)]),_0x36a81a['cause']&&console[_0x3148b4(0xdf)](_0x3148b4(0xb1)+_0x36a81a[_0x3148b4(0xbf)]),0x1;throw _0x36a81a;}}}function a44_0x5e5d(){const _0x28166a=['workflow:kill','\x22?\x20This\x20cannot\x20be\x20undone.','List\x20workflow\x20execution\x20sessions','Retry\x20a\x20session\x20or\x20attempt','kill','Error:\x20Invalid\x20parameter\x20format:\x20','...','stringify','log','23mTuaUv','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Error:\x20Project\x20name\x20is\x20required','\x20\x20Revision:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Including\x20subtasks:\x20yes','workflow:delete','\x20\x20Project\x20ID:\x20','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','parse','split','\x20session','retryAttemptName','59886hFLOzi','Project:\x20','Session\x20time:\x20','fileSize','Error:\x20Attempt\x20ID\x20is\x20required','json','\x20is\x20not\x20a\x20directory','projectId','projectName','getTime','workflow:sessions','stat','done','running','\x20\x20Cause:\x20','1247905eFDvNc','name','\x20task','Getting\x20attempt\x20tasks...','Filter:\x20','data','limit','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','substring','5179044hQYUBZ','Pushing\x20workflow\x20project...','✔\x20Found\x20','task','cause','revision','\x20workflow','✔\x20Downloaded\x20','Error:\x20Workflow\x20identifier\x20is\x20required','project','logs','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','delete','Include\x20retried:\x20yes','6144257PFOZSl','cancelRequested','attempt','canceling','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Resume\x20from:\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','reason','19123542biCsBs','Filter:\x20project=','isArray','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','workflow:projects','createdAt','List\x20all\x20workflow\x20projects','format','utf-8','finishedAt','attemptId','6113264UhAIyc','Project\x20directory:\x20','description','error','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Kill\x20a\x20running\x20attempt','success','Show\x20specific\x20attempt\x20details','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','From\x20task:\x20','No\x20log\x20content\x20found','map','params','Task\x20name:\x20','workflow:push','Retrying\x20session...','param','✔\x20Retry\x20started','retryAttempt','Show\x20tasks\x20for\x20an\x20attempt','\x20\x20Location:\x20','sessionTime','21OohWyl','Deleting\x20project\x20','Error:\x20','List\x20workflow\x20attempts','workflow:attempts','18048OFpkmT','yes','index','skipValidation','taskName','status','filesExtracted','attempt:','Attempt\x20ID:\x20','fs/promises','workflow:retry','✔\x20Pushed\x20','Expected\x20format:\x20--param\x20key=value','attempts','\x20project','Reason:\x20','workflows','\x20\x20Workflow:\x20','download','Validation:\x20skipped','Pattern:\x20','Listing\x20workflow\x20sessions...','verbose','Listing\x20workflows...','workflow','startsWith','workflow:attempt','Listing\x20workflow\x20projects...','Parameters:\x20','session:','workflow:logs','Start\x20a\x20workflow\x20run','Starting\x20workflow\x20run...','length','✔\x20Deleted\x20project\x20','includeSubtasks','includeRetried','Revision:\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','retrySession','Show\x20logs\x20for\x20a\x20workflow\x20attempt','sessions','execute','Project\x20filter:\x20','sessionId','workflow:workflows','session','Listing\x20workflow\x20attempts...','readFile','Target:\x20','keys','\x20attempt','force','from','\x20\x20Session\x20ID:\x20','projects','select','Error:\x20Invalid\x20JSON\x20in\x20--params','\x20\x20Attempt\x20ID:\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','message'];a44_0x5e5d=function(){return _0x28166a;};return a44_0x5e5d();}export class WorkflowSessionsCommand extends BaseCommand{[a44_0x16383b(0xb3)]=a44_0x16383b(0xad);[a44_0x16383b(0xde)]=a44_0x16383b(0x8f);async[a44_0x16383b(0x121)](_0x37ef64){const _0x44f5ab=a44_0x16383b,{options:_0x5ed4a0,args:_0x260cf0,tdx:_0x44fbd8}=_0x37ef64;let _0x433ffc,_0x56b037;if(_0x260cf0[0x0]){const _0x40f46f=_0x260cf0[0x0][_0x44f5ab(0xa0)]('.');if(_0x40f46f[_0x44f5ab(0x118)]===0x1)_0x433ffc=_0x40f46f[0x0];else{if(_0x40f46f['length']===0x2)[_0x433ffc,_0x56b037]=_0x40f46f;else return console[_0x44f5ab(0xdf)]('Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),0x1;}}try{if(_0x5ed4a0[_0x44f5ab(0x10d)]){if(_0x433ffc&&_0x56b037)console['error'](_0x44f5ab(0xb6)+_0x433ffc+'.'+_0x56b037);else _0x433ffc&&console['error'](_0x44f5ab(0xd2)+_0x433ffc);const _0xd04765=_0x5ed4a0[_0x44f5ab(0xfc)];_0xd04765&&console[_0x44f5ab(0xdf)]('Status:\x20'+_0xd04765);}const _0x26968f=await withSpinner(_0x44f5ab(0x10c),()=>_0x44fbd8[_0x44f5ab(0x10f)][_0x44f5ab(0x120)]({'projectName':_0x433ffc,'workflowName':_0x56b037,'status':_0x5ed4a0['status'],'fromTime':_0x5ed4a0[_0x44f5ab(0x85)],'toTime':_0x5ed4a0['to'],'limit':_0x5ed4a0[_0x44f5ab(0xb8)]}),{'verbose':_0x5ed4a0[_0x44f5ab(0x10d)]}),_0x280687=_0x26968f[_0x44f5ab(0xb7)];return console[_0x44f5ab(0xdf)]('✔\x20Found\x20'+_0x280687[_0x44f5ab(0x118)]+_0x44f5ab(0xa1)+(_0x280687[_0x44f5ab(0x118)]!==0x1?'s':'')),await handleSDKOutput(_0x280687,_0x5ed4a0),0x0;}catch(_0x4634f0){if(_0x4634f0 instanceof SDKError)return console[_0x44f5ab(0xdf)](_0x44f5ab(0xf4)+_0x4634f0[_0x44f5ab(0x8c)]),_0x4634f0['cause']&&console['error'](_0x44f5ab(0xb1)+_0x4634f0[_0x44f5ab(0xbf)]),0x1;throw _0x4634f0;}}}export class WorkflowAttemptsCommand extends BaseCommand{['name']=a44_0x16383b(0xf6);['description']=a44_0x16383b(0xf5);async['execute'](_0x3812a1){const _0x257218=a44_0x16383b,{options:_0x2671c8,args:_0x4eaf41,tdx:_0x3a40a5}=_0x3812a1;let _0x1b32dd,_0x1ef97f;if(_0x4eaf41[0x0]){const _0x27d70a=_0x4eaf41[0x0][_0x257218(0xa0)]('.');if(_0x27d70a[_0x257218(0x118)]===0x1)_0x1b32dd=_0x27d70a[0x0];else{if(_0x27d70a[_0x257218(0x118)]===0x2)[_0x1b32dd,_0x1ef97f]=_0x27d70a;else return console[_0x257218(0xdf)]('Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),0x1;}}try{const _0x44c3c6=_0x2671c8[_0x257218(0x11b)];if(_0x2671c8[_0x257218(0x10d)]){if(_0x1b32dd&&_0x1ef97f)console['error'](_0x257218(0xb6)+_0x1b32dd+'.'+_0x1ef97f);else _0x1b32dd&&console[_0x257218(0xdf)](_0x257218(0xd2)+_0x1b32dd);_0x44c3c6&&console[_0x257218(0xdf)](_0x257218(0xc8));}const _0x5d105e=await withSpinner(_0x257218(0x126),()=>_0x3a40a5[_0x257218(0x10f)][_0x257218(0x104)]({'projectName':_0x1b32dd,'workflowName':_0x1ef97f,'includeRetried':_0x44c3c6,'limit':_0x2671c8[_0x257218(0xb8)]}),{'verbose':_0x2671c8[_0x257218(0x10d)]}),_0x3d400c=_0x5d105e[_0x257218(0xb7)];return console['error'](_0x257218(0xbd)+_0x3d400c['length']+_0x257218(0x83)+(_0x3d400c[_0x257218(0x118)]!==0x1?'s':'')),await handleSDKOutput(_0x3d400c,_0x2671c8),0x0;}catch(_0x267a4b){if(_0x267a4b instanceof SDKError)return console[_0x257218(0xdf)](_0x257218(0xf4)+_0x267a4b['message']),_0x267a4b[_0x257218(0xbf)]&&console['error'](_0x257218(0xb1)+_0x267a4b[_0x257218(0xbf)]),0x1;throw _0x267a4b;}}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a44_0x16383b(0x111);[a44_0x16383b(0xde)]=a44_0x16383b(0xe3);async[a44_0x16383b(0x121)](_0x589922){const _0x41c770=a44_0x16383b,{options:_0x55d90b,args:_0x4a68a6,tdx:_0x5e67c1}=_0x589922,_0x2952f0=_0x4a68a6[0x0];if(!_0x2952f0)return console[_0x41c770(0xdf)](_0x41c770(0xa7)),0x1;try{_0x55d90b[_0x41c770(0x10d)]&&console['error'](_0x41c770(0xff)+_0x2952f0);const _0x12d7cc=await withSpinner('Getting\x20attempt\x20details...',()=>_0x5e67c1['workflow'][_0x41c770(0xcb)](_0x2952f0),{'verbose':_0x55d90b[_0x41c770(0x10d)]}),_0x2932fa=_0x12d7cc[_0x41c770(0xb7)];let _0x5d37c1;!_0x2932fa[_0x41c770(0xaf)]?_0x5d37c1=_0x2932fa[_0x41c770(0xca)]?_0x41c770(0xcc):_0x41c770(0xb0):_0x5d37c1=_0x2932fa[_0x41c770(0xe2)]?'success':_0x41c770(0xdf);let _0x58c0e2;if(_0x2932fa['createdAt']&&_0x2932fa[_0x41c770(0xda)]){const _0x435560=new Date(_0x2932fa[_0x41c770(0xd6)])[_0x41c770(0xac)](),_0x406eb5=new Date(_0x2932fa[_0x41c770(0xda)])['getTime']();_0x58c0e2=Math['round']((_0x406eb5-_0x435560)/0x3e8);}const _0x3dddb3={'attempt_id':_0x2932fa['id'],'status':_0x5d37c1,..._0x2932fa[_0x41c770(0xf9)]!==undefined&&{'index':_0x2932fa[_0x41c770(0xf9)]},..._0x2932fa[_0x41c770(0xc4)]&&{'project':_0x2932fa['project'][_0x41c770(0xb3)]},..._0x2932fa[_0x41c770(0x10f)]&&{'workflow':_0x2932fa[_0x41c770(0x10f)][_0x41c770(0xb3)]},..._0x2932fa[_0x41c770(0x123)]&&{'session_id':_0x2932fa[_0x41c770(0x123)]},..._0x2932fa[_0x41c770(0xf1)]&&{'session_time':_0x2932fa[_0x41c770(0xf1)]},..._0x2932fa[_0x41c770(0xa2)]&&{'retry_attempt':_0x2932fa[_0x41c770(0xa2)]},..._0x58c0e2!==undefined&&{'duration_sec':_0x58c0e2},..._0x2932fa[_0x41c770(0xd6)]&&{'created_at':_0x2932fa[_0x41c770(0xd6)]},..._0x2932fa[_0x41c770(0xda)]&&{'finished_at':_0x2932fa[_0x41c770(0xda)]},...Object[_0x41c770(0x82)](_0x2932fa[_0x41c770(0xe8)])[_0x41c770(0x118)]>0x0&&{'params':_0x2932fa[_0x41c770(0xe8)]}};return await handleSingleObjectOutput(_0x3dddb3,_0x55d90b),0x0;}catch(_0x55c629){if(_0x55c629 instanceof SDKError)return console[_0x41c770(0xdf)]('Error:\x20'+_0x55c629[_0x41c770(0x8c)]),_0x55c629[_0x41c770(0xbf)]&&console['error']('\x20\x20Cause:\x20'+_0x55c629[_0x41c770(0xbf)]),0x1;throw _0x55c629;}}}export class WorkflowTasksCommand extends BaseCommand{['name']='workflow:tasks';[a44_0x16383b(0xde)]=a44_0x16383b(0xef);async[a44_0x16383b(0x121)](_0x4457dc){const _0x49ee9e=a44_0x16383b,{options:_0x3734a3,args:_0x34ee58,tdx:_0x4c30a3}=_0x4457dc,_0x354d24=_0x34ee58[0x0];if(!_0x354d24)return console[_0x49ee9e(0xdf)](_0x49ee9e(0xa7)),0x1;try{const _0x3504b8=_0x3734a3[_0x49ee9e(0x11a)];_0x3734a3['verbose']&&(console[_0x49ee9e(0xdf)]('Attempt\x20ID:\x20'+_0x354d24),_0x3504b8&&console[_0x49ee9e(0xdf)](_0x49ee9e(0x9b)));const _0x57d41c=await withSpinner(_0x49ee9e(0xb5),()=>_0x4c30a3['workflow']['tasks'](_0x354d24,_0x3504b8||![]),{'verbose':_0x3734a3['verbose']}),_0x24bc0a=_0x57d41c[_0x49ee9e(0xb7)];return console[_0x49ee9e(0xdf)](_0x49ee9e(0xbd)+_0x24bc0a[_0x49ee9e(0x118)]+_0x49ee9e(0xb4)+(_0x24bc0a[_0x49ee9e(0x118)]!==0x1?'s':'')),await handleSDKOutput(_0x24bc0a,_0x3734a3),0x0;}catch(_0x5c1d28){if(_0x5c1d28 instanceof SDKError)return console[_0x49ee9e(0xdf)](_0x49ee9e(0xf4)+_0x5c1d28[_0x49ee9e(0x8c)]),_0x5c1d28[_0x49ee9e(0xbf)]&&console['error'](_0x49ee9e(0xb1)+_0x5c1d28[_0x49ee9e(0xbf)]),0x1;throw _0x5c1d28;}}}export class WorkflowLogsCommand extends BaseCommand{[a44_0x16383b(0xb3)]=a44_0x16383b(0x115);['description']=a44_0x16383b(0x11f);async[a44_0x16383b(0x121)](_0x53e90d){const _0x2df433=a44_0x16383b,{options:_0x46b1c6,args:_0x132e90,tdx:_0x3c5cce}=_0x53e90d,_0x50187b=_0x132e90[0x0];let _0xcbaaa6=_0x132e90[0x1];if(!_0x50187b)return console[_0x2df433(0xdf)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{_0x46b1c6['verbose']&&(console['error']('Attempt\x20ID:\x20'+_0x50187b),_0xcbaaa6&&console['error'](_0x2df433(0xe9)+_0xcbaaa6));const _0x2eb8dd=await withSpinner('Fetching\x20log\x20files...',()=>_0x3c5cce[_0x2df433(0x10f)]['logFiles'](_0x50187b,_0xcbaaa6),{'verbose':_0x46b1c6[_0x2df433(0x10d)]}),_0x1ed0ee=_0x2eb8dd['data'];if(_0x1ed0ee[_0x2df433(0x118)]===0x0)return console[_0x2df433(0xdf)](_0x2df433(0x11d)),0x0;if(!_0xcbaaa6&&(_0x46b1c6[_0x2df433(0xa8)]||_0x46b1c6[_0x2df433(0xd8)]))return await handleSDKOutput(_0x1ed0ee,_0x46b1c6),0x0;if(!_0xcbaaa6){const _0x41c615=_0x1ed0ee[_0x2df433(0xe7)](_0x54608d=>({'title':_0x54608d[_0x2df433(0xfb)]+'\x20('+formatBytes(_0x54608d[_0x2df433(0xa6)])+')','value':_0x54608d['taskName']})),_0x4ea3a8=await a44_0x210539({'type':_0x2df433(0x88),'name':'task','message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x41c615});if(!_0x4ea3a8[_0x2df433(0xbe)])return console[_0x2df433(0xdf)]('Cancelled'),0x0;_0xcbaaa6=_0x4ea3a8[_0x2df433(0xbe)];}const _0x1cc2f8=await withSpinner('Downloading\x20logs...',()=>_0x3c5cce[_0x2df433(0x10f)][_0x2df433(0xc5)](_0x50187b,_0xcbaaa6),{'verbose':_0x46b1c6[_0x2df433(0x10d)]}),_0x47d34b=_0x1cc2f8[_0x2df433(0xb7)];return _0x47d34b?console[_0x2df433(0x95)](_0x47d34b):console[_0x2df433(0xdf)](_0x2df433(0xe6)),0x0;}catch(_0x17ba09){if(_0x17ba09 instanceof SDKError)return console[_0x2df433(0xdf)](_0x2df433(0xf4)+_0x17ba09[_0x2df433(0x8c)]),_0x17ba09['cause']&&console['error'](_0x2df433(0xb1)+_0x17ba09['cause']),0x1;throw _0x17ba09;}}}export class WorkflowKillCommand extends BaseCommand{[a44_0x16383b(0xb3)]=a44_0x16383b(0x8d);['description']=a44_0x16383b(0xe1);async[a44_0x16383b(0x121)](_0x54c24d){const _0x240e34=a44_0x16383b,{options:_0x566222,args:_0x40b127,tdx:_0x4d8465}=_0x54c24d,_0x544350=_0x40b127[0x0];if(!_0x544350)return console[_0x240e34(0xdf)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x13a890=_0x566222[_0x240e34(0xd0)];_0x566222[_0x240e34(0x10d)]&&(console[_0x240e34(0xdf)](_0x240e34(0xff)+_0x544350),_0x13a890&&console['error'](_0x240e34(0x106)+_0x13a890));if(!_0x566222[_0x240e34(0xf8)]){const _0x189b2e=await confirm(_0x240e34(0xb9)+_0x544350+'?');if(!_0x189b2e)return console['error']('Cancelled'),0x0;}const _0x11a16f=await withSpinner('Killing\x20attempt...',()=>_0x4d8465['workflow'][_0x240e34(0x91)](_0x544350,_0x13a890),{'verbose':_0x566222[_0x240e34(0x10d)]}),_0x5f20ae=_0x11a16f[_0x240e34(0xb7)];return console[_0x240e34(0xdf)]('✔\x20'+_0x5f20ae),0x0;}catch(_0x5b94c4){if(_0x5b94c4 instanceof SDKError)return console['error'](_0x240e34(0xf4)+_0x5b94c4[_0x240e34(0x8c)]),_0x5b94c4[_0x240e34(0xbf)]&&console[_0x240e34(0xdf)](_0x240e34(0xb1)+_0x5b94c4[_0x240e34(0xbf)]),0x1;throw _0x5b94c4;}}}export class WorkflowRetryCommand extends BaseCommand{[a44_0x16383b(0xb3)]=a44_0x16383b(0x101);[a44_0x16383b(0xde)]=a44_0x16383b(0x90);async[a44_0x16383b(0x121)](_0x30679b){const _0x16589e=a44_0x16383b,{options:_0x3ae809,args:_0x5e6450,tdx:_0x141df6}=_0x30679b,_0x17fd86=_0x5e6450[0x0];if(!_0x17fd86)return console[_0x16589e(0xdf)](_0x16589e(0xe0)),console[_0x16589e(0xdf)](_0x16589e(0xc6)),0x1;let _0x341955=![],_0x541a41=_0x17fd86;if(_0x17fd86[_0x16589e(0x110)](_0x16589e(0x114)))_0x341955=!![],_0x541a41=_0x17fd86[_0x16589e(0xba)](0x8);else{if(_0x17fd86['startsWith'](_0x16589e(0xfe)))_0x341955=![],_0x541a41=_0x17fd86[_0x16589e(0xba)](0x8);else return console[_0x16589e(0xdf)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0x16589e(0xdf)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}try{const _0x11cc20=_0x3ae809['fromTask'],_0x4418ca=_0x3ae809['resumeFrom'],_0x1b2402=_0x3ae809['params'],_0x312ac3=_0x3ae809[_0x16589e(0x84)];_0x3ae809['verbose']&&(console[_0x16589e(0xdf)](_0x16589e(0x81)+(_0x341955?_0x16589e(0x125):'attempt')+'\x20'+_0x541a41),_0x11cc20&&console[_0x16589e(0xdf)](_0x16589e(0xe5)+_0x11cc20),_0x4418ca&&console[_0x16589e(0xdf)](_0x16589e(0xce)+_0x4418ca),_0x1b2402&&console[_0x16589e(0xdf)]('Params:\x20'+_0x1b2402),_0x312ac3&&console['error']('Force:\x20yes'));let _0x1a60e9;if(_0x1b2402)try{if(_0x1b2402[_0x16589e(0x110)]('@')){const _0xb395ff=await import(_0x16589e(0x100)),_0x1919eb=_0x1b2402[_0x16589e(0xba)](0x1),_0x2ab894=await _0xb395ff[_0x16589e(0x80)](_0x1919eb,_0x16589e(0xd9));_0x1a60e9=JSON[_0x16589e(0x9f)](_0x2ab894);}else _0x1a60e9=JSON['parse'](_0x1b2402);}catch{return console[_0x16589e(0xdf)](_0x16589e(0x89)),0x1;}if(!_0x3ae809[_0x16589e(0xf8)]){const _0x418eec=await confirm(_0x16589e(0xd4)+(_0x341955?_0x16589e(0x125):_0x16589e(0xcb))+'\x20'+_0x541a41+'?');if(!_0x418eec)return console[_0x16589e(0xdf)]('Cancelled'),0x0;}let _0x2c5cfc;_0x341955?_0x2c5cfc=await withSpinner(_0x16589e(0xeb),()=>_0x141df6[_0x16589e(0x10f)][_0x16589e(0x11e)](_0x541a41,{'fromTask':_0x11cc20,'retryParams':_0x1a60e9}),{'verbose':_0x3ae809['verbose']}):_0x2c5cfc=await withSpinner('Retrying\x20attempt...',()=>_0x141df6[_0x16589e(0x10f)][_0x16589e(0xee)](_0x541a41,{'resumeFrom':_0x4418ca,'retryParams':_0x1a60e9,'force':_0x312ac3}),{'verbose':_0x3ae809[_0x16589e(0x10d)]});const _0x462d46=_0x2c5cfc[_0x16589e(0xb7)];return console[_0x16589e(0xdf)](_0x16589e(0xed)),console[_0x16589e(0xdf)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x462d46[_0x16589e(0xdb)]),console['error'](_0x16589e(0x86)+_0x462d46[_0x16589e(0x123)]),0x0;}catch(_0xac485e){if(_0xac485e instanceof SDKError)return console[_0x16589e(0xdf)](_0x16589e(0xf4)+_0xac485e['message']),_0xac485e['cause']&&console['error']('\x20\x20Cause:\x20'+_0xac485e[_0x16589e(0xbf)]),0x1;throw _0xac485e;}}}function a44_0x3f12(_0x5d86a1,_0xc2ecc0){_0x5d86a1=_0x5d86a1-0x80;const _0x5e5da7=a44_0x5e5d();let _0x3f1251=_0x5e5da7[_0x5d86a1];return _0x3f1251;}export class WorkflowRunCommand extends BaseCommand{['name']='workflow:run';[a44_0x16383b(0xde)]=a44_0x16383b(0x116);async[a44_0x16383b(0x121)](_0x43b471){const _0xf2da62=a44_0x16383b,{options:_0x20b7cc,args:_0x49a86e,tdx:_0x3739f5}=_0x43b471,_0x12fbe2=_0x49a86e[0x0];if(!_0x12fbe2)return console[_0xf2da62(0xdf)](_0xf2da62(0xc3)),console[_0xf2da62(0xdf)]('Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]'),0x1;const _0x2b27e9=_0x20b7cc[_0xf2da62(0xec)],_0x3c22b2=_0x20b7cc['sessionTime'],_0x4ac0e3={};if(_0x2b27e9&&Array[_0xf2da62(0xd3)](_0x2b27e9))for(const _0x3d11be of _0x2b27e9){const _0x2604cf=_0x3d11be['indexOf']('=');if(_0x2604cf===-0x1)return console[_0xf2da62(0xdf)](_0xf2da62(0x92)+_0x3d11be),console[_0xf2da62(0xdf)](_0xf2da62(0x103)),0x1;const _0x2566c2=_0x3d11be[_0xf2da62(0xba)](0x0,_0x2604cf),_0x18247f=_0x3d11be[_0xf2da62(0xba)](_0x2604cf+0x1);try{_0x4ac0e3[_0x2566c2]=JSON[_0xf2da62(0x9f)](_0x18247f);}catch{_0x4ac0e3[_0x2566c2]=_0x18247f;}}_0x20b7cc['verbose']&&(console['error']('Workflow:\x20'+_0x12fbe2),Object[_0xf2da62(0x82)](_0x4ac0e3)[_0xf2da62(0x118)]>0x0&&console[_0xf2da62(0xdf)](_0xf2da62(0x113)+JSON[_0xf2da62(0x94)](_0x4ac0e3)),_0x3c22b2&&console[_0xf2da62(0xdf)](_0xf2da62(0xa5)+_0x3c22b2));const _0x3a4ae1=await withSpinner(_0xf2da62(0x117),()=>_0x3739f5[_0xf2da62(0x10f)]['run'](_0x12fbe2,_0x4ac0e3,{'sessionTime':_0x3c22b2}),{'verbose':_0x20b7cc['verbose']}),_0x46340c=_0x3a4ae1['data'];return console['error']('✔\x20Workflow\x20run\x20started'),console[_0xf2da62(0xdf)](_0xf2da62(0x8a)+_0x46340c['id']),console['error'](_0xf2da62(0x86)+_0x46340c[_0xf2da62(0x123)]),console[_0xf2da62(0xdf)]('\x20\x20Project:\x20'+_0x46340c[_0xf2da62(0xc4)]?.[_0xf2da62(0xb3)]),console['error'](_0xf2da62(0x108)+_0x46340c[_0xf2da62(0x10f)]?.[_0xf2da62(0xb3)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']='workflow:download';[a44_0x16383b(0xde)]=a44_0x16383b(0xcf);async[a44_0x16383b(0x121)](_0x5525a7){const _0x2e9b9c=a44_0x16383b,{options:_0x7d48dc,args:_0x2cf29e,tdx:_0x401a5e}=_0x5525a7,_0x47dcf2=_0x2cf29e[0x0],_0x2129b3=_0x2cf29e[0x1]||'.';if(!_0x47dcf2)return console[_0x2e9b9c(0xdf)](_0x2e9b9c(0x98)),console[_0x2e9b9c(0xdf)](_0x2e9b9c(0xe4)),0x1;const _0x5dbd3a=_0x7d48dc['revision'];_0x7d48dc[_0x2e9b9c(0x10d)]&&(console[_0x2e9b9c(0xdf)](_0x2e9b9c(0xa4)+_0x47dcf2),console['error']('Output\x20directory:\x20'+_0x2129b3),_0x5dbd3a&&console['error'](_0x2e9b9c(0x11c)+_0x5dbd3a));const _0x22c702=await withSpinner('Downloading\x20project\x20'+_0x47dcf2+_0x2e9b9c(0x93),()=>_0x401a5e['workflow'][_0x2e9b9c(0x109)](_0x47dcf2,_0x2129b3,{'revision':_0x5dbd3a}),{'verbose':_0x7d48dc[_0x2e9b9c(0x10d)]}),_0x26d570=_0x22c702[_0x2e9b9c(0xb7)];return console['error'](_0x2e9b9c(0xc2)+_0x26d570[_0x2e9b9c(0xab)]),console[_0x2e9b9c(0xdf)](_0x2e9b9c(0x99)+_0x26d570['revision']),console[_0x2e9b9c(0xdf)]('\x20\x20Files\x20extracted:\x20'+_0x26d570[_0x2e9b9c(0xfd)]),console[_0x2e9b9c(0xdf)](_0x2e9b9c(0xf0)+_0x2129b3+'/'+_0x26d570[_0x2e9b9c(0xab)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{['name']=a44_0x16383b(0xea);[a44_0x16383b(0xde)]=a44_0x16383b(0x9e);async[a44_0x16383b(0x121)](_0x667f53){const _0x4b5a8b=a44_0x16383b,{options:_0x1f876b,args:_0x45cac5,tdx:_0x593855}=_0x667f53;let _0x5ca53b='.',_0x5a8a5a=_0x1f876b[_0x4b5a8b(0xb3)];if(_0x45cac5[0x0]){const {promises:_0x1773f8}=await import('fs');try{const _0x2ea449=await _0x1773f8[_0x4b5a8b(0xae)](_0x45cac5[0x0]);if(_0x2ea449['isDirectory']())_0x5ca53b=_0x45cac5[0x0];else return console[_0x4b5a8b(0xdf)]('Error:\x20'+_0x45cac5[0x0]+_0x4b5a8b(0xa9)),0x1;}catch{_0x5a8a5a=_0x45cac5[0x0],_0x5ca53b='.';}}const _0x51bd47=_0x1f876b['revision'],_0x487e11=_0x1f876b[_0x4b5a8b(0xfa)];_0x1f876b['verbose']&&(console[_0x4b5a8b(0xdf)](_0x4b5a8b(0xdd)+_0x5ca53b),_0x5a8a5a&&console[_0x4b5a8b(0xdf)]('Project\x20name:\x20'+_0x5a8a5a),_0x51bd47&&console[_0x4b5a8b(0xdf)](_0x4b5a8b(0x11c)+_0x51bd47),_0x487e11&&console[_0x4b5a8b(0xdf)](_0x4b5a8b(0x10a)));const _0xfcbec=await withSpinner(_0x4b5a8b(0xbc),()=>_0x593855['workflow']['push'](_0x5ca53b,{'projectName':_0x5a8a5a,'revision':_0x51bd47,'skipValidation':_0x487e11}),{'verbose':_0x1f876b['verbose']}),_0x995a01=_0xfcbec[_0x4b5a8b(0xb7)];return console[_0x4b5a8b(0xdf)](_0x4b5a8b(0x102)+_0x995a01[_0x4b5a8b(0xab)]),console[_0x4b5a8b(0xdf)](_0x4b5a8b(0x9d)+_0x995a01[_0x4b5a8b(0xaa)]),console['error'](_0x4b5a8b(0x99)+_0x995a01[_0x4b5a8b(0xc0)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a44_0x16383b(0xb3)]=a44_0x16383b(0x9c);[a44_0x16383b(0xde)]=a44_0x16383b(0xcd);async[a44_0x16383b(0x121)](_0x38d1ef){const _0x4338cb=a44_0x16383b,{options:_0x254838,args:_0x592624,tdx:_0x5b2de8}=_0x38d1ef,_0x5cdc1c=_0x592624[0x0];if(!_0x5cdc1c)return console[_0x4338cb(0xdf)](_0x4338cb(0x97)),console[_0x4338cb(0xdf)](_0x4338cb(0x8b)),0x1;_0x254838[_0x4338cb(0x10d)]&&console['error'](_0x4338cb(0xa4)+_0x5cdc1c);if(!_0x254838[_0x4338cb(0xf8)]){const _0x2ffe1c=await confirm(_0x4338cb(0x9a)+_0x5cdc1c+_0x4338cb(0x8e));if(!_0x2ffe1c)return console['error']('Cancelled'),0x0;}const _0x43defc=await withSpinner(_0x4338cb(0xf3)+_0x5cdc1c+'...',()=>_0x5b2de8[_0x4338cb(0x10f)][_0x4338cb(0xc7)](_0x5cdc1c),{'verbose':_0x254838[_0x4338cb(0x10d)]}),_0x523887=_0x43defc[_0x4338cb(0xb7)];return console[_0x4338cb(0xdf)](_0x4338cb(0x119)+_0x523887[_0x4338cb(0xab)]),console['error'](_0x4338cb(0x9d)+_0x523887[_0x4338cb(0xaa)]),0x0;}}
1
+ const a44_0x420978=a44_0x3380;(function(_0x436ee7,_0xcc96ac){const _0x4fbeb1=a44_0x3380,_0x3aa054=_0x436ee7();while(!![]){try{const _0x3b7a09=parseInt(_0x4fbeb1(0x181))/0x1*(parseInt(_0x4fbeb1(0x147))/0x2)+-parseInt(_0x4fbeb1(0x162))/0x3+-parseInt(_0x4fbeb1(0x1a8))/0x4*(parseInt(_0x4fbeb1(0x159))/0x5)+-parseInt(_0x4fbeb1(0x167))/0x6*(-parseInt(_0x4fbeb1(0x18d))/0x7)+parseInt(_0x4fbeb1(0x1d0))/0x8+parseInt(_0x4fbeb1(0x1a4))/0x9*(parseInt(_0x4fbeb1(0x1d6))/0xa)+-parseInt(_0x4fbeb1(0x138))/0xb;if(_0x3b7a09===_0xcc96ac)break;else _0x3aa054['push'](_0x3aa054['shift']());}catch(_0x5e272b){_0x3aa054['push'](_0x3aa054['shift']());}}}(a44_0x58de,0x23a6e));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{formatBytes}from'../utils/formatters.js';function a44_0x3380(_0x18f1c0,_0x53c563){_0x18f1c0=_0x18f1c0-0x12f;const _0x58de1e=a44_0x58de();let _0x338095=_0x58de1e[_0x18f1c0];return _0x338095;}import a44_0xaa63bf from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a44_0x420978(0x19b)]=a44_0x420978(0x14c);[a44_0x420978(0x13f)]=a44_0x420978(0x194);async['execute'](_0x3a81c4){const _0x288280=a44_0x420978,{options:_0x3f53f5,args:_0x3b93f5,tdx:_0x2eda88}=_0x3a81c4,_0x415913=_0x3b93f5[0x0];try{_0x3f53f5[_0x288280(0x179)]&&_0x415913&&console[_0x288280(0x1bb)](_0x288280(0x156)+_0x415913);const _0xfc46e9=await withSpinner(_0x288280(0x184),()=>_0x2eda88[_0x288280(0x1d4)]['projects'](_0x415913,{'limit':_0x3f53f5['limit']}),{'verbose':_0x3f53f5[_0x288280(0x179)]}),_0x428148=_0xfc46e9['data'];return console['error'](_0x288280(0x19f)+_0x428148[_0x288280(0x153)]+_0x288280(0x12f)+(_0x428148[_0x288280(0x153)]!==0x1?'s':'')),await handleSDKOutput(_0x428148,_0x3f53f5),0x0;}catch(_0x54ecac){if(_0x54ecac instanceof SDKError)return console[_0x288280(0x1bb)](_0x288280(0x139)+_0x54ecac[_0x288280(0x132)]),_0x54ecac[_0x288280(0x1c8)]&&console['error'](_0x288280(0x1dd)+_0x54ecac[_0x288280(0x1c8)]),0x1;throw _0x54ecac;}}}function a44_0x58de(){const _0x3f929a=['kill','name','includeSubtasks','Getting\x20attempt\x20tasks...','workflow:tasks','✔\x20Found\x20','format','Filter:\x20','fs/promises','success','32715bHRLir','log','workflows','\x20\x20Session\x20ID:\x20','692Vlqsrq','Resume\x20from:\x20','✔\x20Downloaded\x20','Fetching\x20log\x20files...','Session\x20time:\x20','finishedAt','Status:\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Workflow:\x20','Filter:\x20project=','Revision:\x20','List\x20workflow\x20attempts','Retrying\x20attempt...','workflow:sessions','Show\x20specific\x20attempt\x20details','filesExtracted','cancelRequested','startsWith','From\x20task:\x20','error','sessionTime','attempts','Params:\x20','Including\x20subtasks:\x20yes','getTime','keys','Output\x20directory:\x20','skipValidation','projectId','project','split','Error:\x20Invalid\x20parameter\x20format:\x20','cause','\x20\x20Revision:\x20','attemptId','revision','run','Retrying\x20session...','workflow:logs','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','234112ivMfHV','projectName','done','taskName','workflow','workflow:attempts','130WePvVx','Project:\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','substring','Select\x20a\x20task\x20to\x20view\x20logs:','Getting\x20attempt\x20details...','workflow:kill','\x20\x20Cause:\x20','\x20project','isDirectory','Show\x20tasks\x20for\x20an\x20attempt','message','utf-8','session','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Reason:\x20','status','1514546cVWVuj','Error:\x20','Listing\x20workflow\x20sessions...','resumeFrom','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','retryAttempt','reason','description','Target:\x20','List\x20workflow\x20execution\x20sessions','map','Project\x20filter:\x20','canceling','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Cancelled','2CzuegM','retryAttemptName','workflow:delete','download','fileSize','workflow:projects','execute','Start\x20a\x20workflow\x20run','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','params','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','\x20\x20Project\x20ID:\x20','length','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','...','Pattern:\x20','limit','Downloading\x20project\x20','3985CLdznP','\x20session','✔\x20Retry\x20started','workflow:workflows','✔\x20Pushed\x20','Task\x20name:\x20','\x20attempt','Listing\x20workflow\x20attempts...','Parameters:\x20','98433Xazleh','\x20is\x20not\x20a\x20directory','retrySession','attempt','Killing\x20attempt...','660LatTrq','Error:\x20Attempt\x20ID\x20is\x20required','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Retry\x20a\x20session\x20or\x20attempt','No\x20log\x20files\x20found\x20for\x20this\x20attempt','tasks','\x20workflow','sessionId','sessions','indexOf','createdAt','✔\x20Workflow\x20run\x20started','includeRetried','\x20\x20Workflow:\x20','index','yes','logs','Project\x20name:\x20','verbose','Validation:\x20skipped','Expected\x20format:\x20--param\x20key=value','parse','\x20\x20Project:\x20','stat','workflow:retry','workflow:download','142159mxTkdW','json','Attempt\x20ID:\x20','Listing\x20workflow\x20projects...','select','force','\x20\x20Location:\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','param','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','round','task','15001SkqTfA','logFiles','data','Include\x20retried:\x20yes','Force:\x20yes','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Downloading\x20logs...','List\x20all\x20workflow\x20projects','Error:\x20Project\x20name\x20is\x20required','\x20\x20New\x20attempt\x20ID:\x20','readFile','from','Error:\x20Invalid\x20JSON\x20in\x20--params'];a44_0x58de=function(){return _0x3f929a;};return a44_0x58de();}export class WorkflowWorkflowsCommand extends BaseCommand{['name']=a44_0x420978(0x15c);['description']='List\x20workflows';async[a44_0x420978(0x14d)](_0x4968bb){const _0x51829b=a44_0x420978,{options:_0x3f4228,args:_0x4de953,tdx:_0x40ced1}=_0x4968bb,_0x355950=_0x4de953[0x0];try{_0x3f4228[_0x51829b(0x179)]&&_0x355950&&console[_0x51829b(0x1bb)](_0x51829b(0x143)+_0x355950);const _0x416a99=await withSpinner('Listing\x20workflows...',()=>_0x40ced1[_0x51829b(0x1d4)][_0x51829b(0x1a6)](_0x355950,{'limit':_0x3f4228[_0x51829b(0x157)]}),{'verbose':_0x3f4228[_0x51829b(0x179)]}),_0xa99b3d=_0x416a99[_0x51829b(0x18f)];return console[_0x51829b(0x1bb)](_0x51829b(0x19f)+_0xa99b3d[_0x51829b(0x153)]+_0x51829b(0x16d)+(_0xa99b3d[_0x51829b(0x153)]!==0x1?'s':'')),await handleSDKOutput(_0xa99b3d,_0x3f4228),0x0;}catch(_0x56d1f0){if(_0x56d1f0 instanceof SDKError)return console[_0x51829b(0x1bb)](_0x51829b(0x139)+_0x56d1f0['message']),_0x56d1f0[_0x51829b(0x1c8)]&&console['error'](_0x51829b(0x1dd)+_0x56d1f0[_0x51829b(0x1c8)]),0x1;throw _0x56d1f0;}}}export class WorkflowSessionsCommand extends BaseCommand{[a44_0x420978(0x19b)]=a44_0x420978(0x1b5);[a44_0x420978(0x13f)]=a44_0x420978(0x141);async[a44_0x420978(0x14d)](_0x13db09){const _0x3ee065=a44_0x420978,{options:_0x45e656,args:_0x46e6c7,tdx:_0x1ed711}=_0x13db09;let _0x3a1528,_0x255211;if(_0x46e6c7[0x0]){const _0x3b233d=_0x46e6c7[0x0][_0x3ee065(0x1c6)]('.');if(_0x3b233d[_0x3ee065(0x153)]===0x1)_0x3a1528=_0x3b233d[0x0];else{if(_0x3b233d[_0x3ee065(0x153)]===0x2)[_0x3a1528,_0x255211]=_0x3b233d;else return console[_0x3ee065(0x1bb)](_0x3ee065(0x145)),0x1;}}try{if(_0x45e656[_0x3ee065(0x179)]){if(_0x3a1528&&_0x255211)console[_0x3ee065(0x1bb)](_0x3ee065(0x1a1)+_0x3a1528+'.'+_0x255211);else _0x3a1528&&console[_0x3ee065(0x1bb)](_0x3ee065(0x1b1)+_0x3a1528);const _0x33eb01=_0x45e656['status'];_0x33eb01&&console[_0x3ee065(0x1bb)](_0x3ee065(0x1ae)+_0x33eb01);}const _0x217693=await withSpinner(_0x3ee065(0x13a),()=>_0x1ed711[_0x3ee065(0x1d4)][_0x3ee065(0x16f)]({'projectName':_0x3a1528,'workflowName':_0x255211,'status':_0x45e656[_0x3ee065(0x137)],'fromTime':_0x45e656[_0x3ee065(0x198)],'toTime':_0x45e656['to'],'limit':_0x45e656[_0x3ee065(0x157)]}),{'verbose':_0x45e656['verbose']}),_0x25f482=_0x217693[_0x3ee065(0x18f)];return console[_0x3ee065(0x1bb)]('✔\x20Found\x20'+_0x25f482[_0x3ee065(0x153)]+_0x3ee065(0x15a)+(_0x25f482['length']!==0x1?'s':'')),await handleSDKOutput(_0x25f482,_0x45e656),0x0;}catch(_0x18b2e0){if(_0x18b2e0 instanceof SDKError)return console[_0x3ee065(0x1bb)](_0x3ee065(0x139)+_0x18b2e0['message']),_0x18b2e0[_0x3ee065(0x1c8)]&&console[_0x3ee065(0x1bb)](_0x3ee065(0x1dd)+_0x18b2e0[_0x3ee065(0x1c8)]),0x1;throw _0x18b2e0;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a44_0x420978(0x19b)]=a44_0x420978(0x1d5);[a44_0x420978(0x13f)]=a44_0x420978(0x1b3);async[a44_0x420978(0x14d)](_0x2255c9){const _0x3e31b0=a44_0x420978,{options:_0x3a1f9c,args:_0x5dc258,tdx:_0x58066f}=_0x2255c9;let _0x3d7115,_0x291d7f;if(_0x5dc258[0x0]){const _0x5c1c19=_0x5dc258[0x0][_0x3e31b0(0x1c6)]('.');if(_0x5c1c19[_0x3e31b0(0x153)]===0x1)_0x3d7115=_0x5c1c19[0x0];else{if(_0x5c1c19[_0x3e31b0(0x153)]===0x2)[_0x3d7115,_0x291d7f]=_0x5c1c19;else return console[_0x3e31b0(0x1bb)](_0x3e31b0(0x145)),0x1;}}try{const _0x49f9a6=_0x3a1f9c[_0x3e31b0(0x173)];if(_0x3a1f9c[_0x3e31b0(0x179)]){if(_0x3d7115&&_0x291d7f)console['error'](_0x3e31b0(0x1a1)+_0x3d7115+'.'+_0x291d7f);else _0x3d7115&&console[_0x3e31b0(0x1bb)](_0x3e31b0(0x1b1)+_0x3d7115);_0x49f9a6&&console[_0x3e31b0(0x1bb)](_0x3e31b0(0x190));}const _0x16fe55=await withSpinner(_0x3e31b0(0x160),()=>_0x58066f['workflow'][_0x3e31b0(0x1bd)]({'projectName':_0x3d7115,'workflowName':_0x291d7f,'includeRetried':_0x49f9a6,'limit':_0x3a1f9c['limit']}),{'verbose':_0x3a1f9c['verbose']}),_0x125bd0=_0x16fe55['data'];return console[_0x3e31b0(0x1bb)](_0x3e31b0(0x19f)+_0x125bd0[_0x3e31b0(0x153)]+_0x3e31b0(0x15f)+(_0x125bd0[_0x3e31b0(0x153)]!==0x1?'s':'')),await handleSDKOutput(_0x125bd0,_0x3a1f9c),0x0;}catch(_0x2f6964){if(_0x2f6964 instanceof SDKError)return console[_0x3e31b0(0x1bb)](_0x3e31b0(0x139)+_0x2f6964['message']),_0x2f6964[_0x3e31b0(0x1c8)]&&console[_0x3e31b0(0x1bb)](_0x3e31b0(0x1dd)+_0x2f6964['cause']),0x1;throw _0x2f6964;}}}export class WorkflowAttemptCommand extends BaseCommand{[a44_0x420978(0x19b)]='workflow:attempt';[a44_0x420978(0x13f)]=a44_0x420978(0x1b6);async[a44_0x420978(0x14d)](_0x28075e){const _0x54e125=a44_0x420978,{options:_0x2b4b8c,args:_0x56d4e2,tdx:_0x462ebf}=_0x28075e,_0x420926=_0x56d4e2[0x0];if(!_0x420926)return console['error'](_0x54e125(0x168)),0x1;try{_0x2b4b8c[_0x54e125(0x179)]&&console[_0x54e125(0x1bb)]('Attempt\x20ID:\x20'+_0x420926);const _0x2a14da=await withSpinner(_0x54e125(0x1db),()=>_0x462ebf[_0x54e125(0x1d4)]['attempt'](_0x420926),{'verbose':_0x2b4b8c[_0x54e125(0x179)]}),_0x588fc7=_0x2a14da[_0x54e125(0x18f)];let _0x35c5cb;!_0x588fc7[_0x54e125(0x1d2)]?_0x35c5cb=_0x588fc7[_0x54e125(0x1b8)]?_0x54e125(0x144):'running':_0x35c5cb=_0x588fc7[_0x54e125(0x1a3)]?_0x54e125(0x1a3):_0x54e125(0x1bb);let _0x22a59d;if(_0x588fc7[_0x54e125(0x171)]&&_0x588fc7[_0x54e125(0x1ad)]){const _0x62d31c=new Date(_0x588fc7['createdAt'])[_0x54e125(0x1c0)](),_0x2a9405=new Date(_0x588fc7[_0x54e125(0x1ad)])[_0x54e125(0x1c0)]();_0x22a59d=Math[_0x54e125(0x18b)]((_0x2a9405-_0x62d31c)/0x3e8);}const _0x1e67d8={'attempt_id':_0x588fc7['id'],'status':_0x35c5cb,..._0x588fc7[_0x54e125(0x175)]!==undefined&&{'index':_0x588fc7['index']},..._0x588fc7[_0x54e125(0x1c5)]&&{'project':_0x588fc7['project'][_0x54e125(0x19b)]},..._0x588fc7[_0x54e125(0x1d4)]&&{'workflow':_0x588fc7[_0x54e125(0x1d4)][_0x54e125(0x19b)]},..._0x588fc7[_0x54e125(0x16e)]&&{'session_id':_0x588fc7[_0x54e125(0x16e)]},..._0x588fc7['sessionTime']&&{'session_time':_0x588fc7['sessionTime']},..._0x588fc7[_0x54e125(0x148)]&&{'retry_attempt':_0x588fc7[_0x54e125(0x148)]},..._0x22a59d!==undefined&&{'duration_sec':_0x22a59d},..._0x588fc7[_0x54e125(0x171)]&&{'created_at':_0x588fc7[_0x54e125(0x171)]},..._0x588fc7[_0x54e125(0x1ad)]&&{'finished_at':_0x588fc7[_0x54e125(0x1ad)]},...Object[_0x54e125(0x1c1)](_0x588fc7['params'])[_0x54e125(0x153)]>0x0&&{'params':_0x588fc7[_0x54e125(0x150)]}};return await handleSingleObjectOutput(_0x1e67d8,_0x2b4b8c),0x0;}catch(_0x59c5a4){if(_0x59c5a4 instanceof SDKError)return console['error'](_0x54e125(0x139)+_0x59c5a4[_0x54e125(0x132)]),_0x59c5a4['cause']&&console['error'](_0x54e125(0x1dd)+_0x59c5a4['cause']),0x1;throw _0x59c5a4;}}}export class WorkflowTasksCommand extends BaseCommand{[a44_0x420978(0x19b)]=a44_0x420978(0x19e);[a44_0x420978(0x13f)]=a44_0x420978(0x131);async[a44_0x420978(0x14d)](_0x1e5d28){const _0x18dc82=a44_0x420978,{options:_0x560939,args:_0x404da9,tdx:_0x4847ed}=_0x1e5d28,_0x21d5c9=_0x404da9[0x0];if(!_0x21d5c9)return console[_0x18dc82(0x1bb)](_0x18dc82(0x168)),0x1;try{const _0x592753=_0x560939[_0x18dc82(0x19c)];_0x560939[_0x18dc82(0x179)]&&(console[_0x18dc82(0x1bb)](_0x18dc82(0x183)+_0x21d5c9),_0x592753&&console['error'](_0x18dc82(0x1bf)));const _0x4befa2=await withSpinner(_0x18dc82(0x19d),()=>_0x4847ed['workflow'][_0x18dc82(0x16c)](_0x21d5c9,_0x592753||![]),{'verbose':_0x560939['verbose']}),_0x698963=_0x4befa2['data'];return console['error']('✔\x20Found\x20'+_0x698963['length']+'\x20task'+(_0x698963['length']!==0x1?'s':'')),await handleSDKOutput(_0x698963,_0x560939),0x0;}catch(_0xe4428b){if(_0xe4428b instanceof SDKError)return console[_0x18dc82(0x1bb)](_0x18dc82(0x139)+_0xe4428b[_0x18dc82(0x132)]),_0xe4428b['cause']&&console[_0x18dc82(0x1bb)](_0x18dc82(0x1dd)+_0xe4428b['cause']),0x1;throw _0xe4428b;}}}export class WorkflowLogsCommand extends BaseCommand{[a44_0x420978(0x19b)]=a44_0x420978(0x1ce);[a44_0x420978(0x13f)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async['execute'](_0x1e6aa2){const _0xe8597d=a44_0x420978,{options:_0x204332,args:_0x4a02ed,tdx:_0x211a9b}=_0x1e6aa2,_0x5bb89c=_0x4a02ed[0x0];let _0x5e92e4=_0x4a02ed[0x1];if(!_0x5bb89c)return console[_0xe8597d(0x1bb)](_0xe8597d(0x168)),0x1;try{_0x204332[_0xe8597d(0x179)]&&(console[_0xe8597d(0x1bb)](_0xe8597d(0x183)+_0x5bb89c),_0x5e92e4&&console[_0xe8597d(0x1bb)](_0xe8597d(0x15e)+_0x5e92e4));const _0x2bed93=await withSpinner(_0xe8597d(0x1ab),()=>_0x211a9b['workflow'][_0xe8597d(0x18e)](_0x5bb89c,_0x5e92e4),{'verbose':_0x204332[_0xe8597d(0x179)]}),_0x3ae453=_0x2bed93[_0xe8597d(0x18f)];if(_0x3ae453[_0xe8597d(0x153)]===0x0)return console['error'](_0xe8597d(0x16b)),0x0;if(!_0x5e92e4&&(_0x204332[_0xe8597d(0x182)]||_0x204332[_0xe8597d(0x1a0)]))return await handleSDKOutput(_0x3ae453,_0x204332),0x0;if(!_0x5e92e4){const _0x11a7fb=_0x3ae453[_0xe8597d(0x142)](_0x32770d=>({'title':_0x32770d['taskName']+'\x20('+formatBytes(_0x32770d[_0xe8597d(0x14b)])+')','value':_0x32770d[_0xe8597d(0x1d3)]})),_0x1e3554=await a44_0xaa63bf({'type':_0xe8597d(0x185),'name':_0xe8597d(0x18c),'message':_0xe8597d(0x1da),'choices':_0x11a7fb});if(!_0x1e3554[_0xe8597d(0x18c)])return console['error']('Cancelled'),0x0;_0x5e92e4=_0x1e3554[_0xe8597d(0x18c)];}const _0x25a624=await withSpinner(_0xe8597d(0x193),()=>_0x211a9b[_0xe8597d(0x1d4)][_0xe8597d(0x177)](_0x5bb89c,_0x5e92e4),{'verbose':_0x204332[_0xe8597d(0x179)]}),_0x8e30f2=_0x25a624[_0xe8597d(0x18f)];return _0x8e30f2?console[_0xe8597d(0x1a5)](_0x8e30f2):console['error']('No\x20log\x20content\x20found'),0x0;}catch(_0x34d964){if(_0x34d964 instanceof SDKError)return console[_0xe8597d(0x1bb)](_0xe8597d(0x139)+_0x34d964['message']),_0x34d964[_0xe8597d(0x1c8)]&&console[_0xe8597d(0x1bb)](_0xe8597d(0x1dd)+_0x34d964[_0xe8597d(0x1c8)]),0x1;throw _0x34d964;}}}export class WorkflowKillCommand extends BaseCommand{['name']=a44_0x420978(0x1dc);['description']='Kill\x20a\x20running\x20attempt';async[a44_0x420978(0x14d)](_0x3d6be8){const _0x2a4ac7=a44_0x420978,{options:_0x4a4739,args:_0x2fd175,tdx:_0x19c179}=_0x3d6be8,_0xc303d1=_0x2fd175[0x0];if(!_0xc303d1)return console['error'](_0x2a4ac7(0x168)),0x1;try{const _0x3cba6f=_0x4a4739[_0x2a4ac7(0x13e)];_0x4a4739[_0x2a4ac7(0x179)]&&(console[_0x2a4ac7(0x1bb)](_0x2a4ac7(0x183)+_0xc303d1),_0x3cba6f&&console[_0x2a4ac7(0x1bb)](_0x2a4ac7(0x136)+_0x3cba6f));if(!_0x4a4739[_0x2a4ac7(0x176)]){const _0x5103a7=await confirm(_0x2a4ac7(0x1cf)+_0xc303d1+'?');if(!_0x5103a7)return console[_0x2a4ac7(0x1bb)](_0x2a4ac7(0x146)),0x0;}const _0x26079f=await withSpinner(_0x2a4ac7(0x166),()=>_0x19c179[_0x2a4ac7(0x1d4)][_0x2a4ac7(0x19a)](_0xc303d1,_0x3cba6f),{'verbose':_0x4a4739['verbose']}),_0x43fd5d=_0x26079f[_0x2a4ac7(0x18f)];return console[_0x2a4ac7(0x1bb)]('✔\x20'+_0x43fd5d),0x0;}catch(_0x299e81){if(_0x299e81 instanceof SDKError)return console[_0x2a4ac7(0x1bb)]('Error:\x20'+_0x299e81[_0x2a4ac7(0x132)]),_0x299e81[_0x2a4ac7(0x1c8)]&&console[_0x2a4ac7(0x1bb)](_0x2a4ac7(0x1dd)+_0x299e81[_0x2a4ac7(0x1c8)]),0x1;throw _0x299e81;}}}export class WorkflowRetryCommand extends BaseCommand{[a44_0x420978(0x19b)]=a44_0x420978(0x17f);[a44_0x420978(0x13f)]=a44_0x420978(0x16a);async[a44_0x420978(0x14d)](_0x2ed65e){const _0x5b44f4=a44_0x420978,{options:_0x455e79,args:_0x3a1a7a,tdx:_0x8f5c54}=_0x2ed65e,_0x11e4bb=_0x3a1a7a[0x0];if(!_0x11e4bb)return console[_0x5b44f4(0x1bb)](_0x5b44f4(0x18a)),console[_0x5b44f4(0x1bb)](_0x5b44f4(0x14f)),0x1;let _0x2a5bf4=![],_0x33c36f=_0x11e4bb;if(_0x11e4bb[_0x5b44f4(0x1b9)]('session:'))_0x2a5bf4=!![],_0x33c36f=_0x11e4bb[_0x5b44f4(0x1d9)](0x8);else{if(_0x11e4bb[_0x5b44f4(0x1b9)]('attempt:'))_0x2a5bf4=![],_0x33c36f=_0x11e4bb[_0x5b44f4(0x1d9)](0x8);else return console[_0x5b44f4(0x1bb)](_0x5b44f4(0x1af)),console[_0x5b44f4(0x1bb)](_0x5b44f4(0x14f)),0x1;}try{const _0x370226=_0x455e79['fromTask'],_0x4bc10d=_0x455e79[_0x5b44f4(0x13b)],_0x34cb64=_0x455e79[_0x5b44f4(0x150)],_0x4c7559=_0x455e79[_0x5b44f4(0x186)];_0x455e79[_0x5b44f4(0x179)]&&(console[_0x5b44f4(0x1bb)](_0x5b44f4(0x140)+(_0x2a5bf4?_0x5b44f4(0x134):_0x5b44f4(0x165))+'\x20'+_0x33c36f),_0x370226&&console['error'](_0x5b44f4(0x1ba)+_0x370226),_0x4bc10d&&console[_0x5b44f4(0x1bb)](_0x5b44f4(0x1a9)+_0x4bc10d),_0x34cb64&&console['error'](_0x5b44f4(0x1be)+_0x34cb64),_0x4c7559&&console['error'](_0x5b44f4(0x191)));let _0x40df87;if(_0x34cb64)try{if(_0x34cb64[_0x5b44f4(0x1b9)]('@')){const _0x1e9c12=await import(_0x5b44f4(0x1a2)),_0x2c44e7=_0x34cb64[_0x5b44f4(0x1d9)](0x1),_0x1d984e=await _0x1e9c12[_0x5b44f4(0x197)](_0x2c44e7,_0x5b44f4(0x133));_0x40df87=JSON[_0x5b44f4(0x17c)](_0x1d984e);}else _0x40df87=JSON['parse'](_0x34cb64);}catch{return console[_0x5b44f4(0x1bb)](_0x5b44f4(0x199)),0x1;}if(!_0x455e79[_0x5b44f4(0x176)]){const _0x2e800e=await confirm(_0x5b44f4(0x192)+(_0x2a5bf4?_0x5b44f4(0x134):_0x5b44f4(0x165))+'\x20'+_0x33c36f+'?');if(!_0x2e800e)return console[_0x5b44f4(0x1bb)](_0x5b44f4(0x146)),0x0;}let _0x166ed8;_0x2a5bf4?_0x166ed8=await withSpinner(_0x5b44f4(0x1cd),()=>_0x8f5c54['workflow'][_0x5b44f4(0x164)](_0x33c36f,{'fromTask':_0x370226,'retryParams':_0x40df87}),{'verbose':_0x455e79[_0x5b44f4(0x179)]}):_0x166ed8=await withSpinner(_0x5b44f4(0x1b4),()=>_0x8f5c54[_0x5b44f4(0x1d4)][_0x5b44f4(0x13d)](_0x33c36f,{'resumeFrom':_0x4bc10d,'retryParams':_0x40df87,'force':_0x4c7559}),{'verbose':_0x455e79['verbose']});const _0x44e0af=_0x166ed8[_0x5b44f4(0x18f)];return console[_0x5b44f4(0x1bb)](_0x5b44f4(0x15b)),console[_0x5b44f4(0x1bb)](_0x5b44f4(0x196)+_0x44e0af[_0x5b44f4(0x1ca)]),console[_0x5b44f4(0x1bb)](_0x5b44f4(0x1a7)+_0x44e0af[_0x5b44f4(0x16e)]),0x0;}catch(_0x5f3f87){if(_0x5f3f87 instanceof SDKError)return console['error'](_0x5b44f4(0x139)+_0x5f3f87[_0x5b44f4(0x132)]),_0x5f3f87[_0x5b44f4(0x1c8)]&&console['error'](_0x5b44f4(0x1dd)+_0x5f3f87[_0x5b44f4(0x1c8)]),0x1;throw _0x5f3f87;}}}export class WorkflowRunCommand extends BaseCommand{[a44_0x420978(0x19b)]='workflow:run';[a44_0x420978(0x13f)]=a44_0x420978(0x14e);async['execute'](_0x54637f){const _0xbc7d81=a44_0x420978,{options:_0x204299,args:_0x18192f,tdx:_0x568d66}=_0x54637f,_0x5764a4=_0x18192f[0x0];if(!_0x5764a4)return console[_0xbc7d81(0x1bb)]('Error:\x20Workflow\x20identifier\x20is\x20required'),console[_0xbc7d81(0x1bb)](_0xbc7d81(0x13c)),0x1;const _0x44779e=_0x204299[_0xbc7d81(0x189)],_0x3ce8bb=_0x204299[_0xbc7d81(0x1bc)],_0x45d622={};if(_0x44779e&&Array['isArray'](_0x44779e))for(const _0x5ae0b7 of _0x44779e){const _0x223b36=_0x5ae0b7[_0xbc7d81(0x170)]('=');if(_0x223b36===-0x1)return console[_0xbc7d81(0x1bb)](_0xbc7d81(0x1c7)+_0x5ae0b7),console['error'](_0xbc7d81(0x17b)),0x1;const _0x1bf525=_0x5ae0b7[_0xbc7d81(0x1d9)](0x0,_0x223b36),_0x488a66=_0x5ae0b7[_0xbc7d81(0x1d9)](_0x223b36+0x1);try{_0x45d622[_0x1bf525]=JSON['parse'](_0x488a66);}catch{_0x45d622[_0x1bf525]=_0x488a66;}}_0x204299[_0xbc7d81(0x179)]&&(console[_0xbc7d81(0x1bb)](_0xbc7d81(0x1b0)+_0x5764a4),Object[_0xbc7d81(0x1c1)](_0x45d622)[_0xbc7d81(0x153)]>0x0&&console[_0xbc7d81(0x1bb)](_0xbc7d81(0x161)+JSON['stringify'](_0x45d622)),_0x3ce8bb&&console[_0xbc7d81(0x1bb)](_0xbc7d81(0x1ac)+_0x3ce8bb));const _0x23fcd2=await withSpinner('Starting\x20workflow\x20run...',()=>_0x568d66[_0xbc7d81(0x1d4)][_0xbc7d81(0x1cc)](_0x5764a4,_0x45d622,{'sessionTime':_0x3ce8bb}),{'verbose':_0x204299[_0xbc7d81(0x179)]}),_0xe86a14=_0x23fcd2['data'];return console[_0xbc7d81(0x1bb)](_0xbc7d81(0x172)),console[_0xbc7d81(0x1bb)]('\x20\x20Attempt\x20ID:\x20'+_0xe86a14['id']),console['error'](_0xbc7d81(0x1a7)+_0xe86a14[_0xbc7d81(0x16e)]),console[_0xbc7d81(0x1bb)](_0xbc7d81(0x17d)+_0xe86a14['project']?.[_0xbc7d81(0x19b)]),console[_0xbc7d81(0x1bb)](_0xbc7d81(0x174)+_0xe86a14[_0xbc7d81(0x1d4)]?.[_0xbc7d81(0x19b)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a44_0x420978(0x180);[a44_0x420978(0x13f)]=a44_0x420978(0x151);async[a44_0x420978(0x14d)](_0x436c94){const _0x5c7811=a44_0x420978,{options:_0x2aa518,args:_0x29e581,tdx:_0x561a35}=_0x436c94,_0x417d26=_0x29e581[0x0],_0x1a7226=_0x29e581[0x1]||'.';if(!_0x417d26)return console[_0x5c7811(0x1bb)](_0x5c7811(0x195)),console[_0x5c7811(0x1bb)](_0x5c7811(0x1d8)),0x1;const _0x385b4c=_0x2aa518['revision'];_0x2aa518[_0x5c7811(0x179)]&&(console[_0x5c7811(0x1bb)](_0x5c7811(0x1d7)+_0x417d26),console['error'](_0x5c7811(0x1c2)+_0x1a7226),_0x385b4c&&console['error'](_0x5c7811(0x1b2)+_0x385b4c));const _0x41f797=await withSpinner(_0x5c7811(0x158)+_0x417d26+_0x5c7811(0x155),()=>_0x561a35[_0x5c7811(0x1d4)][_0x5c7811(0x14a)](_0x417d26,_0x1a7226,{'revision':_0x385b4c}),{'verbose':_0x2aa518[_0x5c7811(0x179)]}),_0x56f341=_0x41f797[_0x5c7811(0x18f)];return console[_0x5c7811(0x1bb)](_0x5c7811(0x1aa)+_0x56f341[_0x5c7811(0x1d1)]),console[_0x5c7811(0x1bb)](_0x5c7811(0x1c9)+_0x56f341['revision']),console[_0x5c7811(0x1bb)]('\x20\x20Files\x20extracted:\x20'+_0x56f341[_0x5c7811(0x1b7)]),console[_0x5c7811(0x1bb)](_0x5c7811(0x187)+_0x1a7226+'/'+_0x56f341[_0x5c7811(0x1d1)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a44_0x420978(0x19b)]='workflow:push';['description']='Push\x20workflow\x20project\x20to\x20Treasure\x20Data';async[a44_0x420978(0x14d)](_0x588dc4){const _0x4e1266=a44_0x420978,{options:_0x4bc32d,args:_0x4311af,tdx:_0x374bc6}=_0x588dc4;let _0x550af5='.',_0x534360=_0x4bc32d[_0x4e1266(0x19b)];if(_0x4311af[0x0]){const {promises:_0x472409}=await import('fs');try{const _0x467293=await _0x472409[_0x4e1266(0x17e)](_0x4311af[0x0]);if(_0x467293[_0x4e1266(0x130)]())_0x550af5=_0x4311af[0x0];else return console[_0x4e1266(0x1bb)]('Error:\x20'+_0x4311af[0x0]+_0x4e1266(0x163)),0x1;}catch{_0x534360=_0x4311af[0x0],_0x550af5='.';}}const _0x170866=_0x4bc32d[_0x4e1266(0x1cb)],_0x1a4a6a=_0x4bc32d[_0x4e1266(0x1c3)];_0x4bc32d['verbose']&&(console['error']('Project\x20directory:\x20'+_0x550af5),_0x534360&&console[_0x4e1266(0x1bb)](_0x4e1266(0x178)+_0x534360),_0x170866&&console[_0x4e1266(0x1bb)](_0x4e1266(0x1b2)+_0x170866),_0x1a4a6a&&console[_0x4e1266(0x1bb)](_0x4e1266(0x17a)));const _0x1e21cd=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x374bc6[_0x4e1266(0x1d4)]['push'](_0x550af5,{'projectName':_0x534360,'revision':_0x170866,'skipValidation':_0x1a4a6a}),{'verbose':_0x4bc32d[_0x4e1266(0x179)]}),_0x43f635=_0x1e21cd[_0x4e1266(0x18f)];return console[_0x4e1266(0x1bb)](_0x4e1266(0x15d)+_0x43f635[_0x4e1266(0x1d1)]),console[_0x4e1266(0x1bb)](_0x4e1266(0x152)+_0x43f635[_0x4e1266(0x1c4)]),console[_0x4e1266(0x1bb)]('\x20\x20Revision:\x20'+_0x43f635[_0x4e1266(0x1cb)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a44_0x420978(0x19b)]=a44_0x420978(0x149);['description']=a44_0x420978(0x169);async['execute'](_0x34aca9){const _0x28d8c8=a44_0x420978,{options:_0x3fddb0,args:_0x43dcb2,tdx:_0x3af4e6}=_0x34aca9,_0x4adb57=_0x43dcb2[0x0];if(!_0x4adb57)return console[_0x28d8c8(0x1bb)](_0x28d8c8(0x135)),console[_0x28d8c8(0x1bb)](_0x28d8c8(0x188)),0x1;_0x3fddb0['verbose']&&console[_0x28d8c8(0x1bb)]('Project:\x20'+_0x4adb57);if(!_0x3fddb0[_0x28d8c8(0x176)]){const _0x4ff7f4=await confirm(_0x28d8c8(0x154)+_0x4adb57+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x4ff7f4)return console['error'](_0x28d8c8(0x146)),0x0;}const _0xa193eb=await withSpinner('Deleting\x20project\x20'+_0x4adb57+_0x28d8c8(0x155),()=>_0x3af4e6[_0x28d8c8(0x1d4)]['delete'](_0x4adb57),{'verbose':_0x3fddb0[_0x28d8c8(0x179)]}),_0x52ce0f=_0xa193eb[_0x28d8c8(0x18f)];return console['error']('✔\x20Deleted\x20project\x20'+_0x52ce0f[_0x28d8c8(0x1d1)]),console[_0x28d8c8(0x1bb)](_0x28d8c8(0x152)+_0x52ce0f['projectId']),0x0;}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x503778,_0x44804b){const _0xdd5eef=a45_0x4c30,_0x278333=_0x503778();while(!![]){try{const _0x5e8b31=parseInt(_0xdd5eef(0x149))/0x1+-parseInt(_0xdd5eef(0x13f))/0x2+parseInt(_0xdd5eef(0x14a))/0x3*(-parseInt(_0xdd5eef(0x150))/0x4)+parseInt(_0xdd5eef(0x143))/0x5*(-parseInt(_0xdd5eef(0x14d))/0x6)+-parseInt(_0xdd5eef(0x142))/0x7+-parseInt(_0xdd5eef(0x141))/0x8+parseInt(_0xdd5eef(0x14e))/0x9;if(_0x5e8b31===_0x44804b)break;else _0x278333['push'](_0x278333['shift']());}catch(_0x3d322d){_0x278333['push'](_0x278333['shift']());}}}(a45_0x149a,0xac936));import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';function a45_0x4c30(_0x428462,_0x4a0a4c){_0x428462=_0x428462-0x13d;const _0x149aaa=a45_0x149a();let _0x4c309e=_0x149aaa[_0x428462];return _0x4c309e;}import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x2c3f5c=a45_0x4c30;try{const _0xafb4f9=fileURLToPath(import.meta.url),_0x1a53de=dirname(_0xafb4f9),_0x20146d=join(_0x1a53de,_0x2c3f5c(0x145)),_0x39adff=JSON[_0x2c3f5c(0x148)](readFileSync(_0x20146d,_0x2c3f5c(0x147)));return _0x39adff[_0x2c3f5c(0x144)];}catch{return _0x2c3f5c(0x14f);}}export function getUserAgent(){const _0x5f35be=a45_0x4c30,_0x27be85=getVersion(),_0x56ce82=platform(),_0x23592a=process[_0x5f35be(0x144)][_0x5f35be(0x13e)]('v','');return _0x5f35be(0x14b)+_0x27be85+'\x20('+_0x56ce82+_0x5f35be(0x140)+_0x23592a+')';}export function getAuthHeaders(_0x527423,_0x6d5b47){const _0x3f5d62=a45_0x4c30,_0xd933d9=getVersion(),_0x44b7af={'User-Agent':getUserAgent(),'X-TD-Client':_0x3f5d62(0x151),'X-TD-Client-Version':_0xd933d9};return _0x6d5b47&&(_0x44b7af[_0x3f5d62(0x14c)]='TD1\x20'+_0x6d5b47),_0x44b7af;}export function toHeaderRecord(_0x5344c8){const _0xfcd8ac=a45_0x4c30,_0x2a5a70={};for(const [_0x36c676,_0x5c4aa3]of Object[_0xfcd8ac(0x146)](_0x5344c8)){_0x5c4aa3!==undefined&&(_0x2a5a70[_0x36c676]=_0x5c4aa3);}return _0x2a5a70;}export function getTrinoHeaders(_0x1fe294,_0x468e4a){const _0x3ff48a=a45_0x4c30,_0x16dbb1=getAuthHeaders(_0x1fe294,_0x468e4a),_0x512646=toHeaderRecord(_0x16dbb1);return delete _0x512646[_0x3ff48a(0x14c)],_0x468e4a&&(_0x512646[_0x3ff48a(0x13d)]=_0x468e4a),_0x512646;}function a45_0x149a(){const _0x239e40=['683932tUFgFZ','tdx','X-Trino-User','replace','2256336joJggY',';\x20node/','2929600rEHcFJ','1773975CfFgqL','5MJgaRj','version','../../package.json','entries','utf-8','parse','918367YHkxeG','9BVtZcE','tdx/','Authorization','1685874qMYpFk','20972016oDsXAJ','0.0.0'];a45_0x149a=function(){return _0x239e40;};return a45_0x149a();}export function hasAPIKey(_0x369f15){const _0x6ebd1a=getAPIKey(_0x369f15);return _0x6ebd1a!==undefined&&_0x6ebd1a['length']>0x0;}
1
+ (function(_0x4931f1,_0x25407a){const _0x410425=a45_0x10ac,_0x579526=_0x4931f1();while(!![]){try{const _0x3a0dc2=-parseInt(_0x410425(0x72))/0x1+parseInt(_0x410425(0x75))/0x2*(parseInt(_0x410425(0x6d))/0x3)+-parseInt(_0x410425(0x67))/0x4*(-parseInt(_0x410425(0x7c))/0x5)+-parseInt(_0x410425(0x74))/0x6*(parseInt(_0x410425(0x6c))/0x7)+parseInt(_0x410425(0x73))/0x8+parseInt(_0x410425(0x78))/0x9+parseInt(_0x410425(0x6b))/0xa;if(_0x3a0dc2===_0x25407a)break;else _0x579526['push'](_0x579526['shift']());}catch(_0x4dea02){_0x579526['push'](_0x579526['shift']());}}}(a45_0x5215,0x827fa));import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';function a45_0x10ac(_0x26acbd,_0x409212){_0x26acbd=_0x26acbd-0x67;const _0x521575=a45_0x5215();let _0x10ac6f=_0x521575[_0x26acbd];return _0x10ac6f;}import{dirname,join}from'path';import{getAPIKey}from'./config.js';function a45_0x5215(){const _0x3b35b1=['21xhtRMb','length','replace','0.0.0','tdx/','1063731OVXPAR','495760njRyKD','8508FzFkUu','300302DdQnPf','Authorization','parse','2358531YxcGfY','../../package.json','tdx','version','25yhqSbM','105148ChJmSL',';\x20node/','entries','TD1\x20','10176860FTFOCK','4571NPqzQE'];a45_0x5215=function(){return _0x3b35b1;};return a45_0x5215();}export function getVersion(){const _0x186cc1=a45_0x10ac;try{const _0x3e023e=fileURLToPath(import.meta.url),_0x4352ab=dirname(_0x3e023e),_0x2dc75c=join(_0x4352ab,_0x186cc1(0x79)),_0x10c28e=JSON[_0x186cc1(0x77)](readFileSync(_0x2dc75c,'utf-8'));return _0x10c28e['version'];}catch{return _0x186cc1(0x70);}}export function getUserAgent(){const _0x3803b2=a45_0x10ac,_0x26e606=getVersion(),_0xbb05d9=platform(),_0x336bad=process[_0x3803b2(0x7b)][_0x3803b2(0x6f)]('v','');return _0x3803b2(0x71)+_0x26e606+'\x20('+_0xbb05d9+_0x3803b2(0x68)+_0x336bad+')';}export function getAuthHeaders(_0x142681,_0x54ee29){const _0x1a0310=a45_0x10ac,_0xa95032=getVersion(),_0x3cda51={'User-Agent':getUserAgent(),'X-TD-Client':_0x1a0310(0x7a),'X-TD-Client-Version':_0xa95032};return _0x54ee29&&(_0x3cda51['Authorization']=_0x1a0310(0x6a)+_0x54ee29),_0x3cda51;}export function toHeaderRecord(_0x325084){const _0x5c256b=a45_0x10ac,_0x25e4ae={};for(const [_0xa3ed10,_0x4b8c06]of Object[_0x5c256b(0x69)](_0x325084)){_0x4b8c06!==undefined&&(_0x25e4ae[_0xa3ed10]=_0x4b8c06);}return _0x25e4ae;}export function getTrinoHeaders(_0x2b275b,_0x4f486c){const _0x2a7159=a45_0x10ac,_0x13781a=getAuthHeaders(_0x2b275b,_0x4f486c),_0x29a3a6=toHeaderRecord(_0x13781a);return delete _0x29a3a6[_0x2a7159(0x76)],_0x4f486c&&(_0x29a3a6['X-Trino-User']=_0x4f486c),_0x29a3a6;}export function hasAPIKey(_0x1bd5f7){const _0x57f136=a45_0x10ac,_0x4b20a7=getAPIKey(_0x1bd5f7);return _0x4b20a7!==undefined&&_0x4b20a7[_0x57f136(0x6e)]>0x0;}
@@ -1 +1 @@
1
- (function(_0xd44700,_0x1e2b76){const _0x3d2517=a46_0x455e,_0x3a192e=_0xd44700();while(!![]){try{const _0x10d5f4=-parseInt(_0x3d2517(0x1d6))/0x1*(parseInt(_0x3d2517(0x1eb))/0x2)+-parseInt(_0x3d2517(0x1ee))/0x3+parseInt(_0x3d2517(0x1f1))/0x4*(-parseInt(_0x3d2517(0x1d4))/0x5)+-parseInt(_0x3d2517(0x1cb))/0x6+-parseInt(_0x3d2517(0x1df))/0x7+-parseInt(_0x3d2517(0x1c8))/0x8*(parseInt(_0x3d2517(0x1cf))/0x9)+-parseInt(_0x3d2517(0x1d9))/0xa*(-parseInt(_0x3d2517(0x1d0))/0xb);if(_0x10d5f4===_0x1e2b76)break;else _0x3a192e['push'](_0x3a192e['shift']());}catch(_0x50b168){_0x3a192e['push'](_0x3a192e['shift']());}}}(a46_0x150e,0x6c3cd));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a46_0x4b4054 from'node:fs';import*as a46_0x3ba6ea 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 a46_0xdb86fc from'chalk';export function getConfigDir(){const _0x505a27=a46_0x455e;return process[_0x505a27(0x1ab)]['TDX_CONFIG_DIR']||join(homedir(),_0x505a27(0x1bd),_0x505a27(0x1b4));}export function getConfigFile(){const _0x26d68a=a46_0x455e;return join(getConfigDir(),_0x26d68a(0x1c4));}export function getConfigFilePath(_0x529418){const _0x210fba=a46_0x455e,_0x56123e=getConfigDir();return _0x529418?a46_0x3ba6ea['join'](_0x56123e,_0x210fba(0x1d8)+_0x529418):getConfigFile();}export function getCacheDir(){const _0x333100=a46_0x455e;return process[_0x333100(0x1ab)]['TDX_CACHE_DIR']||join(homedir(),_0x333100(0x1e3),'tdx');}export function getLLMProjectCacheFile(_0x51dd82){const _0x2cf61c=a46_0x455e,_0xee818e=_0x51dd82?'llm_default_project.'+_0x51dd82:_0x2cf61c(0x1ea);return join(getCacheDir(),_0xee818e);}export function readCachedLLMProject(_0x3430d5){const _0x11acf7=a46_0x455e;try{const _0x4c2c16=getLLMProjectCacheFile(_0x3430d5);if(!existsSync(_0x4c2c16))return null;const _0x22e017=readFileSync(_0x4c2c16,_0x11acf7(0x1cd))['trim']();try{const _0x3ff4f4=JSON[_0x11acf7(0x1e6)](_0x22e017);if(_0x3ff4f4&&typeof _0x3ff4f4['id']===_0x11acf7(0x1ed)&&typeof _0x3ff4f4[_0x11acf7(0x1ac)]===_0x11acf7(0x1ed))return _0x3ff4f4;}catch{}return null;}catch{return null;}}function a46_0x455e(_0x41d9c0,_0x1752e3){_0x41d9c0=_0x41d9c0-0x1aa;const _0x150efc=a46_0x150e();let _0x455e00=_0x150efc[_0x41d9c0];return _0x455e00;}export function writeCachedLLMProject(_0x4f54b9,_0x4e5e83,_0xe79617){const _0x2a1ffc=a46_0x455e;try{const _0x2adede=getCacheDir(),_0x462c57=getLLMProjectCacheFile(_0xe79617);!existsSync(_0x2adede)&&mkdirSync(_0x2adede,{'recursive':!![]});const _0x23826d={'name':_0x4f54b9,'id':_0x4e5e83};writeFileSync(_0x462c57,JSON[_0x2a1ffc(0x1ae)](_0x23826d),'utf-8');}catch{}}export function getLLMAgentCacheFile(_0x1a76e1){const _0x8130b=_0x1a76e1?'llm_default_agent.'+_0x1a76e1:'llm_default_agent';return join(getCacheDir(),_0x8130b);}export function readCachedLLMAgent(_0x242903){const _0x300ed7=a46_0x455e;try{const _0x321a67=getLLMAgentCacheFile(_0x242903);if(!existsSync(_0x321a67))return null;const _0x3edbf6=readFileSync(_0x321a67,_0x300ed7(0x1cd))[_0x300ed7(0x1d5)]();try{const _0xb68f32=JSON[_0x300ed7(0x1e6)](_0x3edbf6);if(_0xb68f32&&typeof _0xb68f32['id']===_0x300ed7(0x1ed)&&typeof _0xb68f32[_0x300ed7(0x1ac)]==='string'&&typeof _0xb68f32['projectId']===_0x300ed7(0x1ed))return _0xb68f32;}catch{}return null;}catch{return null;}}export function writeCachedLLMAgent(_0x2f233c,_0x44cebd,_0x315910,_0x11d0a6){try{const _0x15a6fe=getCacheDir(),_0x5f578c=getLLMAgentCacheFile(_0x11d0a6);!existsSync(_0x15a6fe)&&mkdirSync(_0x15a6fe,{'recursive':!![]});const _0xa7b6c6={'name':_0x2f233c,'id':_0x44cebd,'projectId':_0x315910};writeFileSync(_0x5f578c,JSON['stringify'](_0xa7b6c6),'utf-8');}catch{}}export function clearCachedLLMAgent(_0x1bef79){try{const _0x32e0ff=getLLMAgentCacheFile(_0x1bef79);existsSync(_0x32e0ff)&&unlinkSync(_0x32e0ff);}catch{}}export function getAccountInfoCacheFile(_0x18fadf){const _0x5ec345=a46_0x455e,_0x5d1691=_0x18fadf?_0x5ec345(0x1c5)+_0x18fadf+_0x5ec345(0x1e4):_0x5ec345(0x1c6);return join(getCacheDir(),_0x5d1691);}export function readCachedAccountInfo(_0x3291dd){const _0x4d2347=a46_0x455e;try{const _0x1d3ed6=getAccountInfoCacheFile(_0x3291dd);if(!existsSync(_0x1d3ed6))return null;const _0x5822ce=readFileSync(_0x1d3ed6,_0x4d2347(0x1cd))[_0x4d2347(0x1d5)](),_0x55db5e=JSON[_0x4d2347(0x1e6)](_0x5822ce);if(_0x55db5e&&typeof _0x55db5e['site']==='string'&&typeof _0x55db5e[_0x4d2347(0x1b7)]===_0x4d2347(0x1db))return _0x55db5e;return null;}catch{return null;}}export function writeCachedAccountInfo(_0xb60133,_0xbb3055,_0x190043){const _0x19f002=a46_0x455e;try{const _0x19aef5=getCacheDir(),_0x483244=getAccountInfoCacheFile(_0x190043);!existsSync(_0x19aef5)&&mkdirSync(_0x19aef5,{'recursive':!![]});const _0x5f13c8={'site':_0xb60133,'accountId':_0xbb3055,'cachedAt':new Date()['toISOString']()};writeFileSync(_0x483244,JSON['stringify'](_0x5f13c8),_0x19f002(0x1cd));}catch{}}export function parseEnvFile(_0x24a612){const _0x4edd9e=a46_0x455e,_0x1395c5={};for(const _0x531bf0 of _0x24a612[_0x4edd9e(0x1bc)]('\x0a')){const _0x3c9fe2=_0x531bf0[_0x4edd9e(0x1d5)]();if(!_0x3c9fe2||_0x3c9fe2['startsWith']('#'))continue;const _0x42cc93=_0x3c9fe2['match'](/^([^=]+)=(.*)$/);if(_0x42cc93){const _0x4d31de=_0x42cc93[0x1][_0x4edd9e(0x1d5)]();let _0x4247f7=_0x42cc93[0x2][_0x4edd9e(0x1d5)]();(_0x4247f7['startsWith']('\x22')&&_0x4247f7[_0x4edd9e(0x1d2)]('\x22')||_0x4247f7['startsWith']('\x27')&&_0x4247f7[_0x4edd9e(0x1d2)]('\x27'))&&(_0x4247f7=_0x4247f7['slice'](0x1,-0x1)),_0x1395c5[_0x4d31de]=_0x4247f7;}}return _0x1395c5;}export function readUserConfig(){const _0x308b5c=a46_0x455e,_0x39e367=getConfigFile();if(!existsSync(_0x39e367))return{};try{const _0x2eee92=readFileSync(_0x39e367,_0x308b5c(0x1cd));return parseEnvFile(_0x2eee92);}catch(_0x5d46e6){return console[_0x308b5c(0x1ce)](_0x308b5c(0x1aa)+_0x39e367+':',_0x5d46e6),{};}}export function resolveSite(_0x33191e){const _0x207be9=a46_0x455e,_0x54ea8b=['us01','jp01',_0x207be9(0x1b9),_0x207be9(0x1e9),_0x207be9(0x1ba),_0x207be9(0x1dd),_0x207be9(0x1b8),_0x207be9(0x1d7),_0x207be9(0x1f0),_0x207be9(0x1c7)];if(_0x54ea8b['includes'](_0x33191e))return _0x33191e;if(_0x33191e in SITE_ALIASES)return SITE_ALIASES[_0x33191e];return console[_0x207be9(0x1ce)](_0x207be9(0x1f2)+_0x33191e+_0x207be9(0x1bf)),_0x207be9(0x1e8);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}function a46_0x150e(){const _0x1dc5f1=['ap02','llm_default_project','6SJvWrN','profile','string','23013JUhhRr','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','stg-jp01','8tJlaZn','Warning:\x20Unknown\x20site\x20\x27','keychain','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','env','name','legacy\x20.env\x20file','stringify','yellow','map','replace','keychain\x20(profile:\x20','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','tdx','TD_API_KEY\x20env\x20var\x20(deprecated)','TDX_API_KEY','accountId','dev-eu01','eu01','ap03','TDX_API_KEY_<PROFILE>','split','.config','TD_API_KEY_','\x27,\x20defaulting\x20to\x20us01','includes','Warning:\x20Failed\x20to\x20load\x20','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','toUpperCase','.env','account_info.','account_info.json','stg-ap03','8OmNNXU','readFileSync','join','4186134IRhQdT','TDX_API_KEY_','utf-8','warn','5765301HLiTUv','11Cnaqys','filter','endsWith','profiles','959205DiiYen','trim','4586GHQYKe','stg-us01','.env.','29282170AQbZug','legacy\x20.env\x20file\x20(profile:\x20','number','existsSync','dev-us01','TDX_API_KEY\x20env\x20var','5190409oNidBE','startsWith','apiKey','TD_API_KEY','.cache','.json','apiKeys','parse','source','us01'];a46_0x150e=function(){return _0x1dc5f1;};return a46_0x150e();}export function getAPIKey(_0x290cf4,_0x18f296){const _0x15a840=a46_0x455e,_0x439cfe=_0x18f296||getActiveProfileName();if(_0x439cfe){const _0x2af58a=_0x15a840(0x1cc)+normalizeProfileForEnvVar(_0x439cfe);if(process[_0x15a840(0x1ab)][_0x2af58a])return process[_0x15a840(0x1ab)][_0x2af58a];}if(process[_0x15a840(0x1ab)][_0x15a840(0x1b6)])return process[_0x15a840(0x1ab)]['TDX_API_KEY'];if(process['env']['TD_API_KEY'])return process['env'][_0x15a840(0x1e2)];const _0x1948e6=_0x290cf4[_0x15a840(0x1c3)]()[_0x15a840(0x1b1)](/-/g,'_'),_0x27d2c5='TD_API_KEY_'+_0x1948e6;if(_0x439cfe){const _0x5e01e7=loadProfileEnv(_0x439cfe);if(_0x5e01e7){if(_0x5e01e7[_0x27d2c5])return _0x5e01e7[_0x27d2c5];if(_0x5e01e7[_0x15a840(0x1e2)])return _0x5e01e7['TD_API_KEY'];}}const _0x1c63ca=loadUserConfigOnce();if(_0x1c63ca[_0x27d2c5])return _0x1c63ca[_0x27d2c5];if(_0x1c63ca['TD_API_KEY'])return _0x1c63ca['TD_API_KEY'];return undefined;}export function normalizeProfileForEnvVar(_0x46f1f){const _0x17c62d=a46_0x455e;return _0x46f1f[_0x17c62d(0x1c3)]()[_0x17c62d(0x1b1)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x4954de,_0x2bb592){const _0x249936=a46_0x455e,_0x3c1b02=_0x2bb592||getActiveProfileName()||undefined;if(_0x3c1b02){const _0xd432a2=_0x249936(0x1cc)+normalizeProfileForEnvVar(_0x3c1b02);if(process[_0x249936(0x1ab)][_0xd432a2])return{'apiKey':process['env'][_0xd432a2],'source':_0xd432a2+'\x20env\x20var','isDeprecated':![]};const _0x556e21=getCachedCredential(_0x4954de,_0x3c1b02);if(_0x556e21)return{'apiKey':_0x556e21,'source':'keychain\x20(profile:\x20'+_0x3c1b02+')','isDeprecated':![]};const _0x37076d=await getKeychainAPIKey(_0x3c1b02);if(_0x37076d)return setCachedCredential(_0x37076d,_0x4954de,_0x3c1b02),{'apiKey':_0x37076d,'source':_0x249936(0x1b2)+_0x3c1b02+')','isDeprecated':![]};}if(process['env'][_0x249936(0x1b6)])return{'apiKey':process[_0x249936(0x1ab)]['TDX_API_KEY'],'source':_0x249936(0x1de),'isDeprecated':![]};if(!_0x3c1b02){const _0x4d95a7=getCachedCredential(_0x4954de,undefined);if(_0x4d95a7)return{'apiKey':_0x4d95a7,'source':'keychain','isDeprecated':![]};const _0x5f44ad=await getKeychainAPIKey(undefined);if(_0x5f44ad)return setCachedCredential(_0x5f44ad,_0x4954de,undefined),{'apiKey':_0x5f44ad,'source':_0x249936(0x1f3),'isDeprecated':![]};}if(process[_0x249936(0x1ab)]['TD_API_KEY'])return{'apiKey':process['env'][_0x249936(0x1e2)],'source':_0x249936(0x1b5),'isDeprecated':!![]};const _0x2271f5=getLegacyEnvAPIKey(_0x4954de,_0x3c1b02);if(_0x2271f5){const _0x4e62fe=await isKeychainAvailable();if(_0x4e62fe)try{await saveKeychainAPIKey(_0x2271f5,_0x3c1b02),setCachedCredential(_0x2271f5,_0x4954de,_0x3c1b02);const _0x20416a=getConfigFilePath(_0x3c1b02);cleanupLegacyEnvFile(_0x20416a)&&console[_0x249936(0x1ce)](a46_0xdb86fc[_0x249936(0x1af)](_0x249936(0x1c2)));}catch(_0x1244bb){console[_0x249936(0x1ce)](a46_0xdb86fc['yellow']('⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20'+_0x1244bb));}const _0x4e5026=_0x3c1b02?_0x249936(0x1da)+_0x3c1b02+')':_0x249936(0x1ad);return{'apiKey':_0x2271f5,'source':_0x4e5026,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x2b199f,_0x3c2687,_0x263ef8=!![]){const _0x22b169=a46_0x455e,_0x4a5fd7=await resolveAPIKeyAsync(_0x2b199f,_0x3c2687);if(!_0x4a5fd7)return undefined;if(_0x263ef8&&_0x4a5fd7['isDeprecated']&&_0x4a5fd7[_0x22b169(0x1e7)][_0x22b169(0x1c0)](_0x22b169(0x1e2))){const _0x37f486=_0x3c2687||getActiveProfileName()||undefined,_0x3d7eac=_0x37f486?'TDX_API_KEY_'+normalizeProfileForEnvVar(_0x37f486):_0x22b169(0x1bb);console[_0x22b169(0x1ce)](a46_0xdb86fc[_0x22b169(0x1af)](_0x22b169(0x1b3)+('\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20'+_0x3d7eac+').')));}return _0x4a5fd7[_0x22b169(0x1e1)];}function getLegacyEnvAPIKey(_0x59d29d,_0x4bae80){const _0xfdaedc=a46_0x455e,_0x4c4127=_0x59d29d[_0xfdaedc(0x1c3)]()[_0xfdaedc(0x1b1)](/-/g,'_'),_0x3ccc25=_0xfdaedc(0x1be)+_0x4c4127;if(_0x4bae80){const _0x597007=loadProfileEnv(_0x4bae80);if(_0x597007){if(_0x597007[_0x3ccc25])return _0x597007[_0x3ccc25];if(_0x597007['TD_API_KEY'])return _0x597007[_0xfdaedc(0x1e2)];}}const _0x11f2fa=loadUserConfigOnce();if(_0x11f2fa[_0x3ccc25])return _0x11f2fa[_0x3ccc25];if(_0x11f2fa['TD_API_KEY'])return _0x11f2fa[_0xfdaedc(0x1e2)];return undefined;}function cleanupLegacyEnvFile(_0x5db281){const _0x1e333b=a46_0x455e;if(!existsSync(_0x5db281))return![];try{const _0x194aa2=readFileSync(_0x5db281,_0x1e333b(0x1cd)),_0x20c0b4=_0x194aa2[_0x1e333b(0x1bc)]('\x0a'),_0x5113f1=_0x20c0b4[_0x1e333b(0x1d1)](_0x2ef571=>{const _0x58e9af=_0x1e333b,_0x3ca357=_0x2ef571['trim']();if(!_0x3ca357||_0x3ca357[_0x58e9af(0x1e0)]('#'))return!![];const [_0x50ac71]=_0x3ca357[_0x58e9af(0x1bc)]('=');return!_0x50ac71[_0x58e9af(0x1e0)](_0x58e9af(0x1e2));}),_0x421b9e=_0x5113f1['some'](_0x4787c7=>{const _0x4df17b=_0x1e333b,_0x3f8d18=_0x4787c7[_0x4df17b(0x1d5)]();return _0x3f8d18&&!_0x3f8d18[_0x4df17b(0x1e0)]('#');});if(!_0x421b9e)return unlinkSync(_0x5db281),!![];return writeFileSync(_0x5db281,_0x5113f1[_0x1e333b(0x1ca)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x2dba29){const _0x59d2aa=a46_0x455e,_0xb010e3=a46_0x3ba6ea['join'](getConfigDir(),_0x59d2aa(0x1d8)+_0x2dba29);if(a46_0x4b4054[_0x59d2aa(0x1dc)](_0xb010e3)){validateSecureFilePermissions(_0xb010e3);try{const _0x1a2318=a46_0x4b4054[_0x59d2aa(0x1c9)](_0xb010e3,'utf-8');return parseEnvFile(_0x1a2318);}catch(_0x2867ca){console[_0x59d2aa(0x1ce)](_0x59d2aa(0x1c1)+_0xb010e3+':\x20'+_0x2867ca);}}const _0x648241=a46_0x3ba6ea[_0x59d2aa(0x1ca)](getConfigDir(),_0x59d2aa(0x1d3),_0x2dba29,_0x59d2aa(0x1c4));if(a46_0x4b4054['existsSync'](_0x648241)){validateSecureFilePermissions(_0x648241);try{const _0x3d5929=a46_0x4b4054[_0x59d2aa(0x1c9)](_0x648241,_0x59d2aa(0x1cd));return parseEnvFile(_0x3d5929);}catch(_0x4d6c68){return console[_0x59d2aa(0x1ce)](_0x59d2aa(0x1c1)+_0x648241+':\x20'+_0x4d6c68),null;}}return null;}function getActiveProfileName(){const _0x33d99b=a46_0x455e,_0x46a0c5=a46_0x3ba6ea[_0x33d99b(0x1ca)](getConfigDir(),'tdx.json');if(!a46_0x4b4054[_0x33d99b(0x1dc)](_0x46a0c5))return null;try{const _0x31e1a4=a46_0x4b4054[_0x33d99b(0x1c9)](_0x46a0c5,_0x33d99b(0x1cd)),_0x453097=JSON['parse'](_0x31e1a4);return _0x453097[_0x33d99b(0x1ec)]||null;}catch{return null;}}export function saveAPIKey(_0x7ac853,_0x3d20cb,_0x5e9dab){const _0x39eafd=a46_0x455e,_0x584012=getConfigDir(),_0x157ecf=getConfigFilePath(_0x5e9dab);!existsSync(_0x584012)&&mkdirSync(_0x584012,{'recursive':!![],'mode':0x1c0});let _0x24cdc6={};if(existsSync(_0x157ecf))try{const _0x53696b=readFileSync(_0x157ecf,'utf-8');_0x24cdc6=parseEnvFile(_0x53696b);}catch(_0x15ab34){console[_0x39eafd(0x1ce)]('Warning:\x20Failed\x20to\x20read\x20'+_0x157ecf+':',_0x15ab34);}const _0x4430c0=_0x7ac853[_0x39eafd(0x1c3)]()[_0x39eafd(0x1b1)](/-/g,'_');_0x24cdc6[_0x39eafd(0x1be)+_0x4430c0]=_0x3d20cb;const _0x1de105=Object['entries'](_0x24cdc6)[_0x39eafd(0x1b0)](([_0x3e91b4,_0x4831d6])=>_0x3e91b4+'='+_0x4831d6);writeFileSync(_0x157ecf,_0x1de105[_0x39eafd(0x1ca)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x4395ca,_0x224f5d,_0x15e99e){const _0x4ba267=a46_0x455e;await saveKeychainAPIKey(_0x4395ca,_0x15e99e),setCachedCredential(_0x4395ca,_0x224f5d,_0x15e99e);const _0x492a2c=getConfigFilePath(_0x15e99e);cleanupLegacyEnvFile(_0x492a2c)&&console['warn'](a46_0xdb86fc[_0x4ba267(0x1af)](_0x4ba267(0x1ef)));}export function loadConfig(){const _0xe65587=a46_0x455e,_0x23395d={'apiKeys':{},'defaultSite':_0xe65587(0x1e8)},_0x436271=[_0xe65587(0x1e8),'jp01','eu01',_0xe65587(0x1e9),_0xe65587(0x1ba),_0xe65587(0x1dd),_0xe65587(0x1b8),_0xe65587(0x1d7),_0xe65587(0x1f0),'stg-ap03'];for(const _0xfd0d05 of _0x436271){const _0x8bcba=getAPIKey(_0xfd0d05);_0x8bcba&&(_0x23395d[_0xe65587(0x1e5)][_0xfd0d05]=_0x8bcba);}return _0x23395d;}
1
+ (function(_0x903339,_0x167dab){const _0x134b79=a46_0x1a39,_0x4cce8f=_0x903339();while(!![]){try{const _0x1e2d68=-parseInt(_0x134b79(0xdf))/0x1*(-parseInt(_0x134b79(0xc7))/0x2)+-parseInt(_0x134b79(0xce))/0x3+parseInt(_0x134b79(0xfd))/0x4*(-parseInt(_0x134b79(0xe4))/0x5)+-parseInt(_0x134b79(0xe8))/0x6+parseInt(_0x134b79(0xf2))/0x7*(parseInt(_0x134b79(0xe6))/0x8)+-parseInt(_0x134b79(0x10c))/0x9*(-parseInt(_0x134b79(0xd2))/0xa)+-parseInt(_0x134b79(0xe7))/0xb;if(_0x1e2d68===_0x167dab)break;else _0x4cce8f['push'](_0x4cce8f['shift']());}catch(_0x392f6e){_0x4cce8f['push'](_0x4cce8f['shift']());}}}(a46_0x3f81,0xbbadd));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a46_0x37d773 from'node:fs';import*as a46_0x584d87 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 a46_0x3111ca from'chalk';export function getConfigDir(){const _0x10d218=a46_0x1a39;return process[_0x10d218(0x104)][_0x10d218(0xea)]||join(homedir(),_0x10d218(0xe0),_0x10d218(0xf3));}export function getConfigFile(){const _0x13010a=a46_0x1a39;return join(getConfigDir(),_0x13010a(0xe3));}export function getConfigFilePath(_0x17deea){const _0x131534=a46_0x1a39,_0x2f1b81=getConfigDir();return _0x17deea?a46_0x584d87[_0x131534(0xc2)](_0x2f1b81,_0x131534(0xf7)+_0x17deea):getConfigFile();}export function getCacheDir(){const _0x1cadf5=a46_0x1a39;return process[_0x1cadf5(0x104)][_0x1cadf5(0xde)]||join(homedir(),_0x1cadf5(0xdd),_0x1cadf5(0xf3));}function a46_0x1a39(_0x4c0219,_0x5d206c){_0x4c0219=_0x4c0219-0xbf;const _0x3f81ba=a46_0x3f81();let _0x1a3943=_0x3f81ba[_0x4c0219];return _0x1a3943;}export function getLLMProjectCacheFile(_0x57ffc2){const _0x3e7d6a=a46_0x1a39,_0x53cabd=_0x57ffc2?_0x3e7d6a(0xeb)+_0x57ffc2:'llm_default_project';return join(getCacheDir(),_0x53cabd);}export function readCachedLLMProject(_0x362d81){const _0x5c7510=a46_0x1a39;try{const _0x3ef308=getLLMProjectCacheFile(_0x362d81);if(!existsSync(_0x3ef308))return null;const _0x3dcc1d=readFileSync(_0x3ef308,_0x5c7510(0xec))['trim']();try{const _0x565a1d=JSON[_0x5c7510(0xd8)](_0x3dcc1d);if(_0x565a1d&&typeof _0x565a1d['id']==='string'&&typeof _0x565a1d[_0x5c7510(0xbf)]===_0x5c7510(0x100))return _0x565a1d;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x6b1151,_0x348e11,_0x2e9a64){const _0x19de0=a46_0x1a39;try{const _0x5df532=getCacheDir(),_0x4d1c2e=getLLMProjectCacheFile(_0x2e9a64);!existsSync(_0x5df532)&&mkdirSync(_0x5df532,{'recursive':!![]});const _0x5b404a={'name':_0x6b1151,'id':_0x348e11};writeFileSync(_0x4d1c2e,JSON[_0x19de0(0xc0)](_0x5b404a),_0x19de0(0xec));}catch{}}export function getLLMAgentCacheFile(_0x53347a){const _0x568779=a46_0x1a39,_0x5ce78e=_0x53347a?_0x568779(0xc8)+_0x53347a:'llm_default_agent';return join(getCacheDir(),_0x5ce78e);}export function readCachedLLMAgent(_0x12cee1){const _0xafc3b9=a46_0x1a39;try{const _0x3930d6=getLLMAgentCacheFile(_0x12cee1);if(!existsSync(_0x3930d6))return null;const _0x40b9a6=readFileSync(_0x3930d6,_0xafc3b9(0xec))[_0xafc3b9(0x106)]();try{const _0x42875d=JSON[_0xafc3b9(0xd8)](_0x40b9a6);if(_0x42875d&&typeof _0x42875d['id']===_0xafc3b9(0x100)&&typeof _0x42875d[_0xafc3b9(0xbf)]===_0xafc3b9(0x100)&&typeof _0x42875d['projectId']===_0xafc3b9(0x100))return _0x42875d;}catch{}return null;}catch{return null;}}export function writeCachedLLMAgent(_0x56f568,_0x1d397f,_0x194672,_0x286a27){const _0x5dfac5=a46_0x1a39;try{const _0x5a9bca=getCacheDir(),_0x5a56be=getLLMAgentCacheFile(_0x286a27);!existsSync(_0x5a9bca)&&mkdirSync(_0x5a9bca,{'recursive':!![]});const _0x367ed7={'name':_0x56f568,'id':_0x1d397f,'projectId':_0x194672};writeFileSync(_0x5a56be,JSON[_0x5dfac5(0xc0)](_0x367ed7),'utf-8');}catch{}}export function clearCachedLLMAgent(_0x3455a5){try{const _0x166a33=getLLMAgentCacheFile(_0x3455a5);existsSync(_0x166a33)&&unlinkSync(_0x166a33);}catch{}}export function getAccountInfoCacheFile(_0x204ff6){const _0x25083b=a46_0x1a39,_0x1335e7=_0x204ff6?_0x25083b(0xcb)+_0x204ff6+'.json':_0x25083b(0xfc);return join(getCacheDir(),_0x1335e7);}export function readCachedAccountInfo(_0x1842a2){const _0x5a713d=a46_0x1a39;try{const _0x22e16b=getAccountInfoCacheFile(_0x1842a2);if(!existsSync(_0x22e16b))return null;const _0x4ef6e2=readFileSync(_0x22e16b,_0x5a713d(0xec))[_0x5a713d(0x106)](),_0x174bb7=JSON[_0x5a713d(0xd8)](_0x4ef6e2);if(_0x174bb7&&typeof _0x174bb7['site']===_0x5a713d(0x100)&&typeof _0x174bb7[_0x5a713d(0xf0)]===_0x5a713d(0xdb))return _0x174bb7;return null;}catch{return null;}}export function writeCachedAccountInfo(_0xc0bc84,_0x4c286a,_0x220c6a){const _0x582a84=a46_0x1a39;try{const _0x12d366=getCacheDir(),_0x964248=getAccountInfoCacheFile(_0x220c6a);!existsSync(_0x12d366)&&mkdirSync(_0x12d366,{'recursive':!![]});const _0x50d2bf={'site':_0xc0bc84,'accountId':_0x4c286a,'cachedAt':new Date()[_0x582a84(0xd3)]()};writeFileSync(_0x964248,JSON['stringify'](_0x50d2bf),'utf-8');}catch{}}export function parseEnvFile(_0x592711){const _0x532594=a46_0x1a39,_0x47eaba={};for(const _0x15a5d4 of _0x592711[_0x532594(0xf6)]('\x0a')){const _0x37dfbd=_0x15a5d4[_0x532594(0x106)]();if(!_0x37dfbd||_0x37dfbd[_0x532594(0xfb)]('#'))continue;const _0x35a225=_0x37dfbd[_0x532594(0xf1)](/^([^=]+)=(.*)$/);if(_0x35a225){const _0x330f29=_0x35a225[0x1][_0x532594(0x106)]();let _0x57f46a=_0x35a225[0x2]['trim']();(_0x57f46a[_0x532594(0xfb)]('\x22')&&_0x57f46a[_0x532594(0x105)]('\x22')||_0x57f46a[_0x532594(0xfb)]('\x27')&&_0x57f46a[_0x532594(0x105)]('\x27'))&&(_0x57f46a=_0x57f46a[_0x532594(0xcd)](0x1,-0x1)),_0x47eaba[_0x330f29]=_0x57f46a;}}return _0x47eaba;}export function readUserConfig(){const _0x4edc5d=a46_0x1a39,_0xc00d5f=getConfigFile();if(!existsSync(_0xc00d5f))return{};try{const _0x182be5=readFileSync(_0xc00d5f,'utf-8');return parseEnvFile(_0x182be5);}catch(_0x69d59c){return console[_0x4edc5d(0x107)](_0x4edc5d(0xef)+_0xc00d5f+':',_0x69d59c),{};}}export function resolveSite(_0x1a5f41){const _0x3898a3=a46_0x1a39,_0x244e25=[_0x3898a3(0xd9),_0x3898a3(0xf4),'eu01',_0x3898a3(0xd1),_0x3898a3(0xf9),'dev-us01','dev-eu01',_0x3898a3(0x10f),_0x3898a3(0xc9),_0x3898a3(0xfa)];if(_0x244e25[_0x3898a3(0xdc)](_0x1a5f41))return _0x1a5f41;if(_0x1a5f41 in SITE_ALIASES)return SITE_ALIASES[_0x1a5f41];return console[_0x3898a3(0x107)](_0x3898a3(0x108)+_0x1a5f41+'\x27,\x20defaulting\x20to\x20us01'),_0x3898a3(0xd9);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}function a46_0x3f81(){const _0x4683c9=['stg-jp01','\x20env\x20var','account_info.','tdx.json','slice','1128075DWRFUw','existsSync','Warning:\x20Failed\x20to\x20load\x20','ap02','170QACaUO','toISOString','replace','TDX_API_KEY_','entries','TD_API_KEY','parse','us01','Warning:\x20Failed\x20to\x20read\x20','number','includes','.cache','TDX_CACHE_DIR','1051MyShZD','.config','TDX_API_KEY','readFileSync','.env','151105WbQJWv','TD_API_KEY_','6712sAvGrF','1073501RyluTU','5076024FNDHCf','toUpperCase','TDX_CONFIG_DIR','llm_default_project.','utf-8','legacy\x20.env\x20file\x20(profile:\x20','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','accountId','match','3983KJFXtE','tdx','jp01','dev-eu01','split','.env.','apiKey','ap03','stg-ap03','startsWith','account_info.json','68GsSqKr','yellow','TDX_API_KEY\x20env\x20var','string','TDX_API_KEY_<PROFILE>','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','legacy\x20.env\x20file','env','endsWith','trim','warn','Warning:\x20Unknown\x20site\x20\x27','profile','keychain','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','811035YpvGek','keychain\x20(profile:\x20','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','stg-us01','name','stringify','apiKeys','join','TD_API_KEY\x20env\x20var\x20(deprecated)','filter','eu01','some','1128ADgVdF','llm_default_agent.'];a46_0x3f81=function(){return _0x4683c9;};return a46_0x3f81();}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x5ca396,_0x1dd942){const _0xd70ad2=a46_0x1a39,_0x161f36=_0x1dd942||getActiveProfileName();if(_0x161f36){const _0x5b5380=_0xd70ad2(0xd5)+normalizeProfileForEnvVar(_0x161f36);if(process[_0xd70ad2(0x104)][_0x5b5380])return process[_0xd70ad2(0x104)][_0x5b5380];}if(process['env']['TDX_API_KEY'])return process['env'][_0xd70ad2(0xe1)];if(process[_0xd70ad2(0x104)]['TD_API_KEY'])return process[_0xd70ad2(0x104)]['TD_API_KEY'];const _0x5e6015=_0x5ca396[_0xd70ad2(0xe9)]()[_0xd70ad2(0xd4)](/-/g,'_'),_0x170352=_0xd70ad2(0xe5)+_0x5e6015;if(_0x161f36){const _0x18c6ba=loadProfileEnv(_0x161f36);if(_0x18c6ba){if(_0x18c6ba[_0x170352])return _0x18c6ba[_0x170352];if(_0x18c6ba['TD_API_KEY'])return _0x18c6ba[_0xd70ad2(0xd7)];}}const _0x372d6e=loadUserConfigOnce();if(_0x372d6e[_0x170352])return _0x372d6e[_0x170352];if(_0x372d6e['TD_API_KEY'])return _0x372d6e[_0xd70ad2(0xd7)];return undefined;}export function normalizeProfileForEnvVar(_0x51c5cd){const _0x1f79c4=a46_0x1a39;return _0x51c5cd[_0x1f79c4(0xe9)]()[_0x1f79c4(0xd4)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x15aedc,_0x4d4862){const _0x7eb041=a46_0x1a39,_0x28a21e=_0x4d4862||getActiveProfileName()||undefined;if(_0x28a21e){const _0x41726a='TDX_API_KEY_'+normalizeProfileForEnvVar(_0x28a21e);if(process[_0x7eb041(0x104)][_0x41726a])return{'apiKey':process[_0x7eb041(0x104)][_0x41726a],'source':_0x41726a+_0x7eb041(0xca),'isDeprecated':![]};const _0x4dc74c=getCachedCredential(_0x15aedc,_0x28a21e);if(_0x4dc74c)return{'apiKey':_0x4dc74c,'source':_0x7eb041(0x10d)+_0x28a21e+')','isDeprecated':![]};const _0xb6098f=await getKeychainAPIKey(_0x28a21e);if(_0xb6098f)return setCachedCredential(_0xb6098f,_0x15aedc,_0x28a21e),{'apiKey':_0xb6098f,'source':_0x7eb041(0x10d)+_0x28a21e+')','isDeprecated':![]};}if(process[_0x7eb041(0x104)][_0x7eb041(0xe1)])return{'apiKey':process[_0x7eb041(0x104)][_0x7eb041(0xe1)],'source':_0x7eb041(0xff),'isDeprecated':![]};if(!_0x28a21e){const _0x3976b4=getCachedCredential(_0x15aedc,undefined);if(_0x3976b4)return{'apiKey':_0x3976b4,'source':_0x7eb041(0x10a),'isDeprecated':![]};const _0x4a43bf=await getKeychainAPIKey(undefined);if(_0x4a43bf)return setCachedCredential(_0x4a43bf,_0x15aedc,undefined),{'apiKey':_0x4a43bf,'source':_0x7eb041(0x10a),'isDeprecated':![]};}if(process[_0x7eb041(0x104)][_0x7eb041(0xd7)])return{'apiKey':process[_0x7eb041(0x104)][_0x7eb041(0xd7)],'source':_0x7eb041(0xc3),'isDeprecated':!![]};const _0x4f761a=getLegacyEnvAPIKey(_0x15aedc,_0x28a21e);if(_0x4f761a){const _0x478791=await isKeychainAvailable();if(_0x478791)try{await saveKeychainAPIKey(_0x4f761a,_0x28a21e),setCachedCredential(_0x4f761a,_0x15aedc,_0x28a21e);const _0x21bde0=getConfigFilePath(_0x28a21e);cleanupLegacyEnvFile(_0x21bde0)&&console[_0x7eb041(0x107)](a46_0x3111ca[_0x7eb041(0xfe)](_0x7eb041(0xee)));}catch(_0x2c4230){console[_0x7eb041(0x107)](a46_0x3111ca[_0x7eb041(0xfe)](_0x7eb041(0x102)+_0x2c4230));}const _0x12f902=_0x28a21e?_0x7eb041(0xed)+_0x28a21e+')':_0x7eb041(0x103);return{'apiKey':_0x4f761a,'source':_0x12f902,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x17040a,_0x4557ca,_0x593b2a=!![]){const _0x50579a=a46_0x1a39,_0x4e17bf=await resolveAPIKeyAsync(_0x17040a,_0x4557ca);if(!_0x4e17bf)return undefined;if(_0x593b2a&&_0x4e17bf['isDeprecated']&&_0x4e17bf['source']['includes'](_0x50579a(0xd7))){const _0x2da098=_0x4557ca||getActiveProfileName()||undefined,_0xf1f622=_0x2da098?_0x50579a(0xd5)+normalizeProfileForEnvVar(_0x2da098):_0x50579a(0x101);console['warn'](a46_0x3111ca[_0x50579a(0xfe)]('Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a'+(_0x50579a(0x10e)+_0xf1f622+').')));}return _0x4e17bf[_0x50579a(0xf8)];}function getLegacyEnvAPIKey(_0x18b4cf,_0x1c98b9){const _0x544d18=a46_0x1a39,_0x2847de=_0x18b4cf['toUpperCase']()[_0x544d18(0xd4)](/-/g,'_'),_0x564eb5=_0x544d18(0xe5)+_0x2847de;if(_0x1c98b9){const _0x2680a2=loadProfileEnv(_0x1c98b9);if(_0x2680a2){if(_0x2680a2[_0x564eb5])return _0x2680a2[_0x564eb5];if(_0x2680a2['TD_API_KEY'])return _0x2680a2[_0x544d18(0xd7)];}}const _0x62b082=loadUserConfigOnce();if(_0x62b082[_0x564eb5])return _0x62b082[_0x564eb5];if(_0x62b082[_0x544d18(0xd7)])return _0x62b082[_0x544d18(0xd7)];return undefined;}function cleanupLegacyEnvFile(_0xcebabd){const _0x36ae34=a46_0x1a39;if(!existsSync(_0xcebabd))return![];try{const _0x432297=readFileSync(_0xcebabd,_0x36ae34(0xec)),_0x515b19=_0x432297[_0x36ae34(0xf6)]('\x0a'),_0x284bca=_0x515b19[_0x36ae34(0xc4)](_0x5b3327=>{const _0x39f4f9=_0x36ae34,_0x4c2724=_0x5b3327[_0x39f4f9(0x106)]();if(!_0x4c2724||_0x4c2724[_0x39f4f9(0xfb)]('#'))return!![];const [_0x111ef5]=_0x4c2724[_0x39f4f9(0xf6)]('=');return!_0x111ef5['startsWith'](_0x39f4f9(0xd7));}),_0x4843e2=_0x284bca[_0x36ae34(0xc6)](_0x28fcd7=>{const _0x5aed93=_0x36ae34,_0x22aec1=_0x28fcd7[_0x5aed93(0x106)]();return _0x22aec1&&!_0x22aec1[_0x5aed93(0xfb)]('#');});if(!_0x4843e2)return unlinkSync(_0xcebabd),!![];return writeFileSync(_0xcebabd,_0x284bca[_0x36ae34(0xc2)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x28e125){const _0x13c82a=a46_0x1a39,_0x24a31e=a46_0x584d87[_0x13c82a(0xc2)](getConfigDir(),_0x13c82a(0xf7)+_0x28e125);if(a46_0x37d773[_0x13c82a(0xcf)](_0x24a31e)){validateSecureFilePermissions(_0x24a31e);try{const _0x87351f=a46_0x37d773[_0x13c82a(0xe2)](_0x24a31e,_0x13c82a(0xec));return parseEnvFile(_0x87351f);}catch(_0x59556e){console[_0x13c82a(0x107)](_0x13c82a(0xd0)+_0x24a31e+':\x20'+_0x59556e);}}const _0x528a9c=a46_0x584d87['join'](getConfigDir(),'profiles',_0x28e125,'.env');if(a46_0x37d773[_0x13c82a(0xcf)](_0x528a9c)){validateSecureFilePermissions(_0x528a9c);try{const _0x50b4ad=a46_0x37d773[_0x13c82a(0xe2)](_0x528a9c,_0x13c82a(0xec));return parseEnvFile(_0x50b4ad);}catch(_0x3053a4){return console['warn'](_0x13c82a(0xd0)+_0x528a9c+':\x20'+_0x3053a4),null;}}return null;}function getActiveProfileName(){const _0x3b1734=a46_0x1a39,_0x54556e=a46_0x584d87[_0x3b1734(0xc2)](getConfigDir(),_0x3b1734(0xcc));if(!a46_0x37d773[_0x3b1734(0xcf)](_0x54556e))return null;try{const _0x353531=a46_0x37d773['readFileSync'](_0x54556e,_0x3b1734(0xec)),_0x484dd3=JSON[_0x3b1734(0xd8)](_0x353531);return _0x484dd3[_0x3b1734(0x109)]||null;}catch{return null;}}export function saveAPIKey(_0x2d52d7,_0x5ede16,_0xb1fff){const _0x2d9752=a46_0x1a39,_0x1d58a2=getConfigDir(),_0x486c85=getConfigFilePath(_0xb1fff);!existsSync(_0x1d58a2)&&mkdirSync(_0x1d58a2,{'recursive':!![],'mode':0x1c0});let _0x96ec0c={};if(existsSync(_0x486c85))try{const _0x8af149=readFileSync(_0x486c85,_0x2d9752(0xec));_0x96ec0c=parseEnvFile(_0x8af149);}catch(_0x5ad7cc){console[_0x2d9752(0x107)](_0x2d9752(0xda)+_0x486c85+':',_0x5ad7cc);}const _0x17820b=_0x2d52d7['toUpperCase']()[_0x2d9752(0xd4)](/-/g,'_');_0x96ec0c[_0x2d9752(0xe5)+_0x17820b]=_0x5ede16;const _0x19867f=Object[_0x2d9752(0xd6)](_0x96ec0c)['map'](([_0xf1fd5a,_0x29d3f5])=>_0xf1fd5a+'='+_0x29d3f5);writeFileSync(_0x486c85,_0x19867f['join']('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x49f232,_0x57014f,_0x50550a){const _0x319e57=a46_0x1a39;await saveKeychainAPIKey(_0x49f232,_0x50550a),setCachedCredential(_0x49f232,_0x57014f,_0x50550a);const _0x4ee2d4=getConfigFilePath(_0x50550a);cleanupLegacyEnvFile(_0x4ee2d4)&&console[_0x319e57(0x107)](a46_0x3111ca[_0x319e57(0xfe)](_0x319e57(0x10b)));}export function loadConfig(){const _0x22e100=a46_0x1a39,_0x290cf3={'apiKeys':{},'defaultSite':'us01'},_0x23ce64=[_0x22e100(0xd9),_0x22e100(0xf4),_0x22e100(0xc5),'ap02',_0x22e100(0xf9),'dev-us01',_0x22e100(0xf5),_0x22e100(0x10f),'stg-jp01',_0x22e100(0xfa)];for(const _0xeb023 of _0x23ce64){const _0x177af2=getAPIKey(_0xeb023);_0x177af2&&(_0x290cf3[_0x22e100(0xc1)][_0xeb023]=_0x177af2);}return _0x290cf3;}
@@ -1 +1 @@
1
- (function(_0x43d34c,_0x568624){const _0x6e616d=a47_0x3ed7,_0x229566=_0x43d34c();while(!![]){try{const _0x15651c=parseInt(_0x6e616d(0x1a3))/0x1*(parseInt(_0x6e616d(0x1a2))/0x2)+-parseInt(_0x6e616d(0x19d))/0x3*(parseInt(_0x6e616d(0x1a0))/0x4)+parseInt(_0x6e616d(0x19b))/0x5*(-parseInt(_0x6e616d(0x19f))/0x6)+parseInt(_0x6e616d(0x1a9))/0x7+-parseInt(_0x6e616d(0x1aa))/0x8*(parseInt(_0x6e616d(0x1a4))/0x9)+parseInt(_0x6e616d(0x19c))/0xa+parseInt(_0x6e616d(0x19e))/0xb;if(_0x15651c===_0x568624)break;else _0x229566['push'](_0x229566['shift']());}catch(_0x8eab7f){_0x229566['push'](_0x229566['shift']());}}}(a47_0x2e15,0x6172d));function a47_0x3ed7(_0x44327c,_0x6f8541){_0x44327c=_0x44327c-0x19b;const _0x2e157f=a47_0x2e15();let _0x3ed7c2=_0x2e157f[_0x44327c];return _0x3ed7c2;}import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';import{getCacheDir}from'./config.js';function a47_0x2e15(){const _0x206da9=['stringify','.json','utf-8','now','3145870gmhtBU','2224lPpDON','1945JHWoKl','5530010DqOoAA','79026qRnyrw','3836789bIcrdu','5568fRUtpm','48marKnK','connections','2yPcZVb','125911ZiqeMC','12978PAflIK'];a47_0x2e15=function(){return _0x206da9;};return a47_0x2e15();}function getCacheFilePath(_0x3984a4){const _0x58d076=a47_0x3ed7,_0x373963=_0x3984a4||'default';return join(getCacheDir(),'connections-'+_0x373963+_0x58d076(0x1a6));}export function loadCachedConnections(_0x138f6e){const _0x41a7a3=a47_0x3ed7,_0x305543=getCacheFilePath(_0x138f6e);if(!existsSync(_0x305543))return null;try{const _0x55ca1d=readFileSync(_0x305543,_0x41a7a3(0x1a7)),_0x53c127=JSON['parse'](_0x55ca1d);return _0x53c127[_0x41a7a3(0x1a1)];}catch{return null;}}export function saveCachedConnections(_0x28306d,_0x5f3dc5){const _0x15a6ce=a47_0x3ed7,_0x297a1b=getCacheDir();!existsSync(_0x297a1b)&&mkdirSync(_0x297a1b,{'recursive':!![]});const _0x1f55ed=getCacheFilePath(_0x28306d),_0x13a906={'connections':_0x5f3dc5,'cachedAt':Date[_0x15a6ce(0x1a8)]()};writeFileSync(_0x1f55ed,JSON[_0x15a6ce(0x1a5)](_0x13a906,null,0x2),'utf-8');}export function clearConnectionCache(_0x552d8d){const _0x179f27=getCacheFilePath(_0x552d8d);if(existsSync(_0x179f27))try{unlinkSync(_0x179f27);}catch{}}
1
+ (function(_0xdf601,_0x359f62){const _0x169fb1=a47_0x2f5f,_0x294bcd=_0xdf601();while(!![]){try{const _0x4915b0=parseInt(_0x169fb1(0x1c6))/0x1+parseInt(_0x169fb1(0x1c8))/0x2*(-parseInt(_0x169fb1(0x1c1))/0x3)+-parseInt(_0x169fb1(0x1cb))/0x4+-parseInt(_0x169fb1(0x1c9))/0x5+parseInt(_0x169fb1(0x1c7))/0x6+-parseInt(_0x169fb1(0x1ce))/0x7+parseInt(_0x169fb1(0x1cd))/0x8;if(_0x4915b0===_0x359f62)break;else _0x294bcd['push'](_0x294bcd['shift']());}catch(_0xf35d9f){_0x294bcd['push'](_0x294bcd['shift']());}}}(a47_0x5628,0x2b61a));function a47_0x5628(){const _0x518aa3=['parse','12UCdLUu','stringify','default','connections-','utf-8','39447pZzAtO','1422240jsxguU','52594aKKWCi','1648745ZgBeZq','.json','449476jzqTGq','now','5236344iydlJC','1442238myWLQT','connections'];a47_0x5628=function(){return _0x518aa3;};return a47_0x5628();}import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';import{getCacheDir}from'./config.js';function getCacheFilePath(_0x234c36){const _0x1a834a=a47_0x2f5f,_0x479610=_0x234c36||_0x1a834a(0x1c3);return join(getCacheDir(),_0x1a834a(0x1c4)+_0x479610+_0x1a834a(0x1ca));}function a47_0x2f5f(_0x288ba1,_0x2057f4){_0x288ba1=_0x288ba1-0x1bf;const _0x5628f4=a47_0x5628();let _0x2f5f20=_0x5628f4[_0x288ba1];return _0x2f5f20;}export function loadCachedConnections(_0x388fe0){const _0x1124fe=a47_0x2f5f,_0x35a7e9=getCacheFilePath(_0x388fe0);if(!existsSync(_0x35a7e9))return null;try{const _0x473614=readFileSync(_0x35a7e9,_0x1124fe(0x1c5)),_0x5ada23=JSON[_0x1124fe(0x1c0)](_0x473614);return _0x5ada23[_0x1124fe(0x1bf)];}catch{return null;}}export function saveCachedConnections(_0x472292,_0x1049a1){const _0x3e60fa=a47_0x2f5f,_0x43561d=getCacheDir();!existsSync(_0x43561d)&&mkdirSync(_0x43561d,{'recursive':!![]});const _0x5a8495=getCacheFilePath(_0x472292),_0x369402={'connections':_0x1049a1,'cachedAt':Date[_0x3e60fa(0x1cc)]()};writeFileSync(_0x5a8495,JSON[_0x3e60fa(0x1c2)](_0x369402,null,0x2),_0x3e60fa(0x1c5));}export function clearConnectionCache(_0x132a81){const _0x127ba6=getCacheFilePath(_0x132a81);if(existsSync(_0x127ba6))try{unlinkSync(_0x127ba6);}catch{}}