@treasuredata/tdx 0.10.0 → 0.10.1

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 (135) 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/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/api-command.js +1 -1
  8. package/dist/commands/auth-command.js +1 -1
  9. package/dist/commands/chat-command.js +1 -1
  10. package/dist/commands/claude-command.js +1 -1
  11. package/dist/commands/claude-statusline-command.js +1 -1
  12. package/dist/commands/claude-usage-command.js +1 -1
  13. package/dist/commands/command.js +1 -1
  14. package/dist/commands/connection-command.js +1 -1
  15. package/dist/commands/context-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/llm-proxy.js +1 -1
  24. package/dist/commands/parent-segment-command.js +1 -1
  25. package/dist/commands/profiles-command.js +1 -1
  26. package/dist/commands/query-command.js +1 -1
  27. package/dist/commands/segment-command.js +1 -1
  28. package/dist/commands/segment-create-command.js +1 -1
  29. package/dist/commands/segment-fields-command.js +1 -1
  30. package/dist/commands/segment-pull-command.js +1 -1
  31. package/dist/commands/segment-push-command.js +1 -1
  32. package/dist/commands/segment-update-command.js +1 -1
  33. package/dist/commands/segment-use-command.js +1 -1
  34. package/dist/commands/segment-validate-command.js +1 -1
  35. package/dist/commands/segments.js +1 -1
  36. package/dist/commands/show.js +1 -1
  37. package/dist/commands/tables.js +1 -1
  38. package/dist/commands/use-command.js +1 -1
  39. package/dist/commands/user-command.js +1 -1
  40. package/dist/commands/workflow-command.js +1 -1
  41. package/dist/core/auth.js +1 -1
  42. package/dist/core/command-output.js +1 -1
  43. package/dist/core/config.js +1 -1
  44. package/dist/core/connection-cache.js +1 -1
  45. package/dist/core/constants.js +1 -1
  46. package/dist/core/credential-cache.js +1 -1
  47. package/dist/core/global-context.js +1 -1
  48. package/dist/core/keychain.js +1 -1
  49. package/dist/core/profile.js +1 -1
  50. package/dist/core/project-config.js +1 -1
  51. package/dist/core/session.js +1 -1
  52. package/dist/core/user-cache.js +1 -1
  53. package/dist/index.js +1 -1
  54. package/dist/proxy/anthropic-adapter.js +1 -1
  55. package/dist/proxy/claude-usage-tracker.js +1 -1
  56. package/dist/proxy/context-signature.js +1 -1
  57. package/dist/proxy/conversation-utils.js +1 -1
  58. package/dist/proxy/server.js +1 -1
  59. package/dist/proxy/session-cache.js +1 -1
  60. package/dist/sdk/agent/agent-config.js +1 -1
  61. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  62. package/dist/sdk/agent/agent-yaml.js +1 -1
  63. package/dist/sdk/api.js +1 -1
  64. package/dist/sdk/client/cdp-api-client.js +1 -1
  65. package/dist/sdk/client/endpoints.js +1 -1
  66. package/dist/sdk/client/engage-api-client.js +1 -1
  67. package/dist/sdk/client/http-client.js +1 -1
  68. package/dist/sdk/client/llm-api-client.js +1 -1
  69. package/dist/sdk/client/rate-limiter.js +1 -1
  70. package/dist/sdk/client/td-api-client.js +1 -1
  71. package/dist/sdk/client/trino-api-client.js +1 -1
  72. package/dist/sdk/client/workflow-client.js +1 -1
  73. package/dist/sdk/connection-validator.js +1 -1
  74. package/dist/sdk/connection.js +1 -1
  75. package/dist/sdk/engage.js +1 -1
  76. package/dist/sdk/errors.js +1 -1
  77. package/dist/sdk/index.js +1 -1
  78. package/dist/sdk/io/index.js +1 -1
  79. package/dist/sdk/io/node-filesystem.js +1 -1
  80. package/dist/sdk/job.js +1 -1
  81. package/dist/sdk/journey.js +1 -1
  82. package/dist/sdk/llm/chat-cache.js +1 -1
  83. package/dist/sdk/llm/index.js +1 -1
  84. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  85. package/dist/sdk/llm/model-aliases.js +1 -1
  86. package/dist/sdk/llm/model-factors.js +1 -1
  87. package/dist/sdk/query/index.js +1 -1
  88. package/dist/sdk/query/sql-parser.js +1 -1
  89. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  90. package/dist/sdk/segment/fields-display.js +1 -1
  91. package/dist/sdk/segment/file-discovery.js +1 -1
  92. package/dist/sdk/segment/journey-utils.js +1 -1
  93. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  94. package/dist/sdk/segment/journey-yaml.js +1 -1
  95. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  96. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  97. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  98. package/dist/sdk/segment/pull-workflow.js +1 -1
  99. package/dist/sdk/segment/push-workflow.js +1 -1
  100. package/dist/sdk/segment/push-workflow.js.map +1 -1
  101. package/dist/sdk/segment/resolution-context.js +1 -1
  102. package/dist/sdk/segment/segment-path-parser.js +1 -1
  103. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  104. package/dist/sdk/segment/target-resolution.js +1 -1
  105. package/dist/sdk/segment/tdx-config.js +1 -1
  106. package/dist/sdk/segment/validate-files.js +1 -1
  107. package/dist/sdk/segment/yaml-validator.js +1 -1
  108. package/dist/sdk/segment.js +1 -1
  109. package/dist/sdk/types/cdp.d.ts +5 -2
  110. package/dist/sdk/types/cdp.d.ts.map +1 -1
  111. package/dist/sdk/types/index.js +1 -1
  112. package/dist/sdk/types/progress.js +1 -1
  113. package/dist/sdk/user.js +1 -1
  114. package/dist/sdk/util/format-detector.js +1 -1
  115. package/dist/sdk/util/formatters.js +1 -1
  116. package/dist/sdk/util/index.js +1 -1
  117. package/dist/sdk/util/tree-formatter.js +1 -1
  118. package/dist/sdk/workflow/index.js +1 -1
  119. package/dist/sdk/workflow/workflow-utils.js +1 -1
  120. package/dist/utils/async.js +1 -1
  121. package/dist/utils/colors.js +1 -1
  122. package/dist/utils/diff.js +1 -1
  123. package/dist/utils/file-permissions.js +1 -1
  124. package/dist/utils/json-loader.js +1 -1
  125. package/dist/utils/option-validation.js +1 -1
  126. package/dist/utils/port.js +1 -1
  127. package/dist/utils/process.js +1 -1
  128. package/dist/utils/prompt.js +1 -1
  129. package/dist/utils/spinner.js +1 -1
  130. package/dist/utils/sse-parser.js +1 -1
  131. package/dist/utils/string-utils.js +1 -1
  132. package/dist/utils/table-ref-parser.js +1 -1
  133. package/dist/utils/tdx-logger.js +1 -1
  134. package/dist/utils/version-check.js +1 -1
  135. package/package.json +1 -1
@@ -1 +1 @@
1
- function a36_0x22d4(){const _0x28ea7b=['\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','name','llm_agent','Session\x20context\x20','engage_workspace','Session\x20llm_project\x20set\x20to:\x20','database','523279GrboYW','session','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','Session\x20agent\x20set\x20to:\x20','execute','join','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context\x0a','Session\x20parent_segment\x20set\x20to:\x20','\x27\x20does\x20not\x20exist','cleared','36029eFampa','dim','Error:\x20Profile\x20\x27','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','agent','green','Session\x20database\x20set\x20to:\x20','displayWithSources','5532040QIWTul','43740Jpdaup','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','(session:\x20','Session\x20profile\x20set\x20to:\x20','display','Session\x20engage_workspace\x20set\x20to:\x20','3ztGGVx','length','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','toString','error','debug','184208kSkBfM','parent_segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','Set\x20session-level\x20context','546918FtNBwZ','profile','354CefEkN','Invalid\x20resource:\x20','\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','.\x20Must\x20be\x20one\x20of:\x20','includes','description','72WEFmcz','153NWDJUQ','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace','log','25575253RkfFUd','llm_project'];a36_0x22d4=function(){return _0x28ea7b;};return a36_0x22d4();}function a36_0xa901(_0x4a1279,_0x25e1bd){_0x4a1279=_0x4a1279-0x14f;const _0x22d425=a36_0x22d4();let _0xa901b8=_0x22d425[_0x4a1279];return _0xa901b8;}const a36_0x3825f5=a36_0xa901;(function(_0x16ed06,_0x35b21b){const _0x3ede21=a36_0xa901,_0x292145=_0x16ed06();while(!![]){try{const _0x441cff=-parseInt(_0x3ede21(0x170))/0x1+-parseInt(_0x3ede21(0x15b))/0x2*(parseInt(_0x3ede21(0x151))/0x3)+parseInt(_0x3ede21(0x163))/0x4*(parseInt(_0x3ede21(0x183))/0x5)+parseInt(_0x3ede21(0x15d))/0x6*(-parseInt(_0x3ede21(0x17a))/0x7)+-parseInt(_0x3ede21(0x157))/0x8*(parseInt(_0x3ede21(0x164))/0x9)+-parseInt(_0x3ede21(0x182))/0xa+parseInt(_0x3ede21(0x167))/0xb;if(_0x441cff===_0x35b21b)break;else _0x292145['push'](_0x292145['shift']());}catch(_0x41f0b8){_0x292145['push'](_0x292145['shift']());}}}(a36_0x22d4,0x6acb6));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'../sdk/agent/agent-ref-parser.js';import a36_0x215e53 from'chalk';export class UseCommand extends BaseCommand{[a36_0x3825f5(0x16a)]='use';[a36_0x3825f5(0x162)]=a36_0x3825f5(0x15a);['validate'](_0x16c64c){const _0x50b581=a36_0x3825f5,{args:_0x360638}=_0x16c64c;if(_0x360638[_0x50b581(0x152)]===0x0)return undefined;if(_0x360638['length']===0x1)return _0x50b581(0x172)+_0x50b581(0x176)+_0x50b581(0x159)+_0x50b581(0x15f)+_0x50b581(0x184);const _0x371200=_0x360638[0x0],_0xf715bf=[_0x50b581(0x16f),_0x50b581(0x158),_0x50b581(0x168),_0x50b581(0x17e),'profile','engage_workspace'];if(!_0xf715bf[_0x50b581(0x161)](_0x371200))return _0x50b581(0x15e)+_0x371200+_0x50b581(0x160)+_0xf715bf[_0x50b581(0x175)](',\x20');return undefined;}async[a36_0x3825f5(0x174)](_0x16f333){const _0x40431a=a36_0x3825f5,{args:_0x4f83fa,options:_0x250b5e}=_0x16f333,_0x4eb385=_0x250b5e[_0x40431a(0x156)],_0x31aad4=_0x250b5e['clear'];cleanExpiredSessions();try{if(_0x31aad4){clearSessionContext(_0x250b5e[_0x40431a(0x171)]);const _0x40b41d=_0x250b5e[_0x40431a(0x171)]||getCurrentSessionPID()[_0x40431a(0x154)]();return console[_0x40431a(0x166)](_0x40431a(0x16c)+a36_0x215e53[_0x40431a(0x17f)](_0x40431a(0x179))+'\x20'+a36_0x215e53[_0x40431a(0x17b)](_0x40431a(0x185)+_0x40b41d+')')),0x0;}if(_0x4f83fa[_0x40431a(0x152)]===0x0){const _0x8e415b=new GlobalContext(_0x250b5e);return _0x4eb385?_0x8e415b[_0x40431a(0x181)]():_0x8e415b[_0x40431a(0x14f)](),console[_0x40431a(0x166)](a36_0x215e53[_0x40431a(0x17b)](_0x40431a(0x169))),console['log'](a36_0x215e53['dim'](_0x40431a(0x165))),0x0;}const _0x42b8a0=_0x4f83fa[0x0],_0x1de4ec=_0x4f83fa[0x1];if(_0x42b8a0===_0x40431a(0x15c)){if(!profileExists(_0x1de4ec))return console[_0x40431a(0x155)](_0x40431a(0x17c)+_0x1de4ec+_0x40431a(0x178)),console[_0x40431a(0x155)](_0x40431a(0x17d)),0x1;const _0x599cae=_0x250b5e['session']||getCurrentSessionPID()[_0x40431a(0x154)]();return saveSessionContext({'profile':_0x1de4ec},_0x250b5e['session']),console[_0x40431a(0x166)](_0x40431a(0x186)+a36_0x215e53['green'](_0x1de4ec)+'\x20'+a36_0x215e53['dim']('(session:\x20'+_0x599cae+')')),console[_0x40431a(0x166)](a36_0x215e53[_0x40431a(0x17b)](_0x40431a(0x153))),0x0;}const _0x25595b={},_0xbc17e4=_0x250b5e[_0x40431a(0x171)]||getCurrentSessionPID()[_0x40431a(0x154)]();switch(_0x42b8a0){case _0x40431a(0x16f):_0x25595b['database']=_0x1de4ec,console[_0x40431a(0x166)](_0x40431a(0x180)+a36_0x215e53[_0x40431a(0x17f)](_0x1de4ec)+'\x20'+a36_0x215e53[_0x40431a(0x17b)](_0x40431a(0x185)+_0xbc17e4+')'));break;case _0x40431a(0x158):_0x25595b['parent_segment']=_0x1de4ec,console[_0x40431a(0x166)](_0x40431a(0x177)+a36_0x215e53[_0x40431a(0x17f)](_0x1de4ec)+'\x20'+a36_0x215e53[_0x40431a(0x17b)](_0x40431a(0x185)+_0xbc17e4+')'));break;case _0x40431a(0x168):_0x25595b['llm_project']=_0x1de4ec,console[_0x40431a(0x166)](_0x40431a(0x16e)+a36_0x215e53[_0x40431a(0x17f)](_0x1de4ec)+'\x20'+a36_0x215e53[_0x40431a(0x17b)](_0x40431a(0x185)+_0xbc17e4+')'));break;case _0x40431a(0x17e):{const {projectName:_0x585e25,agentName:_0x53e70f}=parseAgentRef(_0x1de4ec);_0x53e70f?(_0x25595b[_0x40431a(0x168)]=_0x585e25,_0x25595b[_0x40431a(0x16b)]=_0x53e70f,console[_0x40431a(0x166)](_0x40431a(0x16e)+a36_0x215e53[_0x40431a(0x17f)](_0x585e25)+'\x20'+a36_0x215e53['dim'](_0x40431a(0x185)+_0xbc17e4+')')),console[_0x40431a(0x166)](_0x40431a(0x173)+a36_0x215e53['green'](_0x53e70f)+'\x20'+a36_0x215e53[_0x40431a(0x17b)](_0x40431a(0x185)+_0xbc17e4+')'))):(_0x25595b[_0x40431a(0x16b)]=_0x1de4ec,console[_0x40431a(0x166)](_0x40431a(0x173)+a36_0x215e53[_0x40431a(0x17f)](_0x1de4ec)+'\x20'+a36_0x215e53[_0x40431a(0x17b)](_0x40431a(0x185)+_0xbc17e4+')')));break;}case _0x40431a(0x16d):_0x25595b[_0x40431a(0x16d)]=_0x1de4ec,console[_0x40431a(0x166)](_0x40431a(0x150)+a36_0x215e53[_0x40431a(0x17f)](_0x1de4ec)+'\x20'+a36_0x215e53[_0x40431a(0x17b)]('(session:\x20'+_0xbc17e4+')'));break;}return saveSessionContext(_0x25595b,_0x250b5e['session']),console[_0x40431a(0x166)](a36_0x215e53[_0x40431a(0x17b)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides')),0x0;}catch(_0x230c58){return _0x230c58 instanceof Error&&console[_0x40431a(0x155)]('Error:\x20'+_0x230c58['message']),0x1;}}}
1
+ function a36_0x3b28(_0x10aa67,_0x1bb3e9){_0x10aa67=_0x10aa67-0x1ee;const _0x250077=a36_0x2500();let _0x3b28ea=_0x250077[_0x10aa67];return _0x3b28ea;}const a36_0x5c1b51=a36_0x3b28;(function(_0x2459bf,_0x2fc187){const _0x3b9971=a36_0x3b28,_0x289522=_0x2459bf();while(!![]){try{const _0x4d2cd4=parseInt(_0x3b9971(0x1fa))/0x1+parseInt(_0x3b9971(0x20e))/0x2*(-parseInt(_0x3b9971(0x21a))/0x3)+-parseInt(_0x3b9971(0x1ff))/0x4*(-parseInt(_0x3b9971(0x204))/0x5)+parseInt(_0x3b9971(0x20c))/0x6+-parseInt(_0x3b9971(0x1f3))/0x7*(parseInt(_0x3b9971(0x209))/0x8)+parseInt(_0x3b9971(0x210))/0x9+-parseInt(_0x3b9971(0x1ef))/0xa;if(_0x4d2cd4===_0x2fc187)break;else _0x289522['push'](_0x289522['shift']());}catch(_0x52a4d9){_0x289522['push'](_0x289522['shift']());}}}(a36_0x2500,0x880fe));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'../sdk/agent/agent-ref-parser.js';import a36_0x3a9378 from'chalk';function a36_0x2500(){const _0x2a7ec0=['38455BuuDNe','Session\x20agent\x20set\x20to:\x20','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','execute','join','19904JIcnjo','includes','Session\x20llm_project\x20set\x20to:\x20','30372AUNXJY','Invalid\x20resource:\x20','36CGZCoc','parent_segment','3636225AdgcsR','name','validate','green','profile','Session\x20engage_workspace\x20set\x20to:\x20','length','debug','display','engage_workspace','38079lmfAAk','\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','dim','2581850DrPwWG','description','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','session','1694sNGGqw','.\x20Must\x20be\x20one\x20of:\x20','agent','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace','use','toString','error','875501xOfZXl','database','llm_project','displayWithSources','llm_agent','188Mkmzyv','Session\x20database\x20set\x20to:\x20','Session\x20context\x20','(session:\x20','log'];a36_0x2500=function(){return _0x2a7ec0;};return a36_0x2500();}export class UseCommand extends BaseCommand{[a36_0x5c1b51(0x211)]=a36_0x5c1b51(0x1f7);[a36_0x5c1b51(0x1f0)]='Set\x20session-level\x20context';[a36_0x5c1b51(0x212)](_0x21f7a3){const _0x106991=a36_0x5c1b51,{args:_0x1d30bb}=_0x21f7a3;if(_0x1d30bb[_0x106991(0x216)]===0x0)return undefined;if(_0x1d30bb[_0x106991(0x216)]===0x1)return'Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a'+_0x106991(0x21b)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a'+'\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a'+'\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options';const _0x1e96f1=_0x1d30bb[0x0],_0x4e82c1=[_0x106991(0x1fb),_0x106991(0x20f),_0x106991(0x1fc),_0x106991(0x1f5),_0x106991(0x214),_0x106991(0x219)];if(!_0x4e82c1[_0x106991(0x20a)](_0x1e96f1))return _0x106991(0x20d)+_0x1e96f1+_0x106991(0x1f4)+_0x4e82c1[_0x106991(0x208)](',\x20');return undefined;}async[a36_0x5c1b51(0x207)](_0x13af25){const _0x4b2ba9=a36_0x5c1b51,{args:_0xbca70a,options:_0x59f664}=_0x13af25,_0x3ef782=_0x59f664[_0x4b2ba9(0x217)],_0x1a25d9=_0x59f664['clear'];cleanExpiredSessions();try{if(_0x1a25d9){clearSessionContext(_0x59f664['session']);const _0x35fb37=_0x59f664[_0x4b2ba9(0x1f2)]||getCurrentSessionPID()['toString']();return console[_0x4b2ba9(0x203)](_0x4b2ba9(0x201)+a36_0x3a9378[_0x4b2ba9(0x213)]('cleared')+'\x20'+a36_0x3a9378[_0x4b2ba9(0x1ee)](_0x4b2ba9(0x202)+_0x35fb37+')')),0x0;}if(_0xbca70a[_0x4b2ba9(0x216)]===0x0){const _0x2b5224=new GlobalContext(_0x59f664);return _0x3ef782?_0x2b5224[_0x4b2ba9(0x1fd)]():_0x2b5224[_0x4b2ba9(0x218)](),console[_0x4b2ba9(0x203)](a36_0x3a9378[_0x4b2ba9(0x1ee)](_0x4b2ba9(0x1f1))),console[_0x4b2ba9(0x203)](a36_0x3a9378['dim'](_0x4b2ba9(0x1f6))),0x0;}const _0x1c0b15=_0xbca70a[0x0],_0x266a19=_0xbca70a[0x1];if(_0x1c0b15===_0x4b2ba9(0x214)){if(!profileExists(_0x266a19))return console[_0x4b2ba9(0x1f9)]('Error:\x20Profile\x20\x27'+_0x266a19+'\x27\x20does\x20not\x20exist'),console[_0x4b2ba9(0x1f9)]('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x5d8d44=_0x59f664[_0x4b2ba9(0x1f2)]||getCurrentSessionPID()['toString']();return saveSessionContext({'profile':_0x266a19},_0x59f664['session']),console['log']('Session\x20profile\x20set\x20to:\x20'+a36_0x3a9378[_0x4b2ba9(0x213)](_0x266a19)+'\x20'+a36_0x3a9378['dim']('(session:\x20'+_0x5d8d44+')')),console[_0x4b2ba9(0x203)](a36_0x3a9378['dim'](_0x4b2ba9(0x206))),0x0;}const _0x4bb9c6={},_0x1c70b4=_0x59f664[_0x4b2ba9(0x1f2)]||getCurrentSessionPID()[_0x4b2ba9(0x1f8)]();switch(_0x1c0b15){case _0x4b2ba9(0x1fb):_0x4bb9c6[_0x4b2ba9(0x1fb)]=_0x266a19,console[_0x4b2ba9(0x203)](_0x4b2ba9(0x200)+a36_0x3a9378[_0x4b2ba9(0x213)](_0x266a19)+'\x20'+a36_0x3a9378[_0x4b2ba9(0x1ee)](_0x4b2ba9(0x202)+_0x1c70b4+')'));break;case _0x4b2ba9(0x20f):_0x4bb9c6[_0x4b2ba9(0x20f)]=_0x266a19,console[_0x4b2ba9(0x203)]('Session\x20parent_segment\x20set\x20to:\x20'+a36_0x3a9378[_0x4b2ba9(0x213)](_0x266a19)+'\x20'+a36_0x3a9378[_0x4b2ba9(0x1ee)](_0x4b2ba9(0x202)+_0x1c70b4+')'));break;case _0x4b2ba9(0x1fc):_0x4bb9c6[_0x4b2ba9(0x1fc)]=_0x266a19,console[_0x4b2ba9(0x203)](_0x4b2ba9(0x20b)+a36_0x3a9378[_0x4b2ba9(0x213)](_0x266a19)+'\x20'+a36_0x3a9378[_0x4b2ba9(0x1ee)](_0x4b2ba9(0x202)+_0x1c70b4+')'));break;case _0x4b2ba9(0x1f5):{const {projectName:_0x4f039,agentName:_0xdc5cfb}=parseAgentRef(_0x266a19);_0xdc5cfb?(_0x4bb9c6[_0x4b2ba9(0x1fc)]=_0x4f039,_0x4bb9c6[_0x4b2ba9(0x1fe)]=_0xdc5cfb,console[_0x4b2ba9(0x203)]('Session\x20llm_project\x20set\x20to:\x20'+a36_0x3a9378[_0x4b2ba9(0x213)](_0x4f039)+'\x20'+a36_0x3a9378[_0x4b2ba9(0x1ee)]('(session:\x20'+_0x1c70b4+')')),console[_0x4b2ba9(0x203)](_0x4b2ba9(0x205)+a36_0x3a9378[_0x4b2ba9(0x213)](_0xdc5cfb)+'\x20'+a36_0x3a9378[_0x4b2ba9(0x1ee)](_0x4b2ba9(0x202)+_0x1c70b4+')'))):(_0x4bb9c6['llm_agent']=_0x266a19,console[_0x4b2ba9(0x203)](_0x4b2ba9(0x205)+a36_0x3a9378[_0x4b2ba9(0x213)](_0x266a19)+'\x20'+a36_0x3a9378['dim']('(session:\x20'+_0x1c70b4+')')));break;}case _0x4b2ba9(0x219):_0x4bb9c6[_0x4b2ba9(0x219)]=_0x266a19,console['log'](_0x4b2ba9(0x215)+a36_0x3a9378[_0x4b2ba9(0x213)](_0x266a19)+'\x20'+a36_0x3a9378['dim'](_0x4b2ba9(0x202)+_0x1c70b4+')'));break;}return saveSessionContext(_0x4bb9c6,_0x59f664[_0x4b2ba9(0x1f2)]),console['log'](a36_0x3a9378[_0x4b2ba9(0x1ee)](_0x4b2ba9(0x206))),0x0;}catch(_0x1488ff){return _0x1488ff instanceof Error&&console[_0x4b2ba9(0x1f9)]('Error:\x20'+_0x1488ff['message']),0x1;}}}
@@ -1 +1 @@
1
- const a37_0x4387d5=a37_0x5e3f;(function(_0x1abc40,_0xcfb9f4){const _0x127254=a37_0x5e3f,_0x3994be=_0x1abc40();while(!![]){try{const _0x2a1554=-parseInt(_0x127254(0xab))/0x1*(parseInt(_0x127254(0xb5))/0x2)+-parseInt(_0x127254(0xb6))/0x3+-parseInt(_0x127254(0xa8))/0x4*(-parseInt(_0x127254(0xaa))/0x5)+parseInt(_0x127254(0xa3))/0x6+parseInt(_0x127254(0xb4))/0x7+parseInt(_0x127254(0xb3))/0x8+-parseInt(_0x127254(0xa5))/0x9;if(_0x2a1554===_0xcfb9f4)break;else _0x3994be['push'](_0x3994be['shift']());}catch(_0x4ce35c){_0x3994be['push'](_0x3994be['shift']());}}}(a37_0x1899,0xa13d5));function a37_0x5e3f(_0x2dd520,_0x3ce35f){_0x2dd520=_0x2dd520-0xa0;const _0x18998e=a37_0x1899();let _0x5e3f92=_0x18998e[_0x2dd520];return _0x5e3f92;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a37_0x1899(){const _0x265d19=['data','user','24cgNJRP','message','81145RkFTOS','81509dhZBpf','error','\x20user','description','getCurrent','\x20\x20Cause:\x20','Error:\x20','Show\x20current\x20user\x20information','7181472kdgChd','1242220wnioRE','6rbmFEH','40977pgiEEM','List\x20all\x20users\x20in\x20the\x20account','Listing\x20users...','name','cause','length','user\x20list','5292480KOnMPF','verbose','10223775YeiMMg'];a37_0x1899=function(){return _0x265d19;};return a37_0x1899();}export class UserCommand extends BaseCommand{[a37_0x4387d5(0xb9)]=a37_0x4387d5(0xa7);[a37_0x4387d5(0xae)]=a37_0x4387d5(0xb2);async['execute'](_0x24a814){const _0x194a9f=a37_0x4387d5,{options:_0x293cd4,tdx:_0x184910}=_0x24a814;try{const _0x3572b1=await withSpinner('Fetching\x20user\x20info...',()=>_0x184910[_0x194a9f(0xa7)][_0x194a9f(0xaf)](),{'verbose':_0x293cd4['verbose']}),_0x542f19=_0x3572b1[_0x194a9f(0xa6)];return await handleSingleObjectOutput(_0x542f19,_0x293cd4),0x0;}catch(_0x56be49){if(_0x56be49 instanceof SDKError)return console[_0x194a9f(0xac)](_0x194a9f(0xb1)+_0x56be49[_0x194a9f(0xa9)]),_0x56be49[_0x194a9f(0xa0)]&&console[_0x194a9f(0xac)](_0x194a9f(0xb0)+_0x56be49['cause']),0x1;throw _0x56be49;}}}export class UserListCommand extends BaseCommand{[a37_0x4387d5(0xb9)]=a37_0x4387d5(0xa2);[a37_0x4387d5(0xae)]=a37_0x4387d5(0xb7);async['execute'](_0x5e54cd){const _0x22390d=a37_0x4387d5,{options:_0x5dc59f,tdx:_0x1e09ee}=_0x5e54cd;try{const _0x41b598=await withSpinner(_0x22390d(0xb8),()=>_0x1e09ee['user']['list'](),{'verbose':_0x5dc59f[_0x22390d(0xa4)]}),_0x2f0af4=_0x41b598[_0x22390d(0xa6)];return console['error']('✔\x20Found\x20'+_0x2f0af4[_0x22390d(0xa1)]+_0x22390d(0xad)+(_0x2f0af4[_0x22390d(0xa1)]!==0x1?'s':'')),await handleSDKOutput(_0x2f0af4,_0x5dc59f),0x0;}catch(_0x304dc6){if(_0x304dc6 instanceof SDKError)return console[_0x22390d(0xac)]('Error:\x20'+_0x304dc6[_0x22390d(0xa9)]),_0x304dc6[_0x22390d(0xa0)]&&console['error'](_0x22390d(0xb0)+_0x304dc6[_0x22390d(0xa0)]),0x1;throw _0x304dc6;}}}
1
+ const a37_0x533bd4=a37_0x934c;(function(_0x2c97c6,_0x3328c2){const _0x533b2e=a37_0x934c,_0x39bc73=_0x2c97c6();while(!![]){try{const _0x37dc9a=-parseInt(_0x533b2e(0x112))/0x1+parseInt(_0x533b2e(0x125))/0x2+-parseInt(_0x533b2e(0x124))/0x3+parseInt(_0x533b2e(0x127))/0x4*(parseInt(_0x533b2e(0x11d))/0x5)+parseInt(_0x533b2e(0x11f))/0x6*(parseInt(_0x533b2e(0x114))/0x7)+-parseInt(_0x533b2e(0x123))/0x8*(-parseInt(_0x533b2e(0x11b))/0x9)+parseInt(_0x533b2e(0x11e))/0xa*(-parseInt(_0x533b2e(0x116))/0xb);if(_0x37dc9a===_0x3328c2)break;else _0x39bc73['push'](_0x39bc73['shift']());}catch(_0x44ae26){_0x39bc73['push'](_0x39bc73['shift']());}}}(a37_0x4e4b,0x4c18b));import{BaseCommand}from'./command.js';function a37_0x4e4b(){const _0x5308c6=['user','1967bnjPhP','Fetching\x20user\x20info...','22lwIvHj','data','error','\x20\x20Cause:\x20','name','18PlxqMc','length','135QqQZaV','774910ZhLzPo','9816edIvqE','description','✔\x20Found\x20','verbose','808872IyTItV','433155kfQZJl','458084bweIjV','execute','45572nxiDdj','user\x20list','message','Listing\x20users...','cause','Error:\x20','getCurrent','List\x20all\x20users\x20in\x20the\x20account','587529syphia'];a37_0x4e4b=function(){return _0x5308c6;};return a37_0x4e4b();}function a37_0x934c(_0x2083ae,_0x3aee31){_0x2083ae=_0x2083ae-0x112;const _0x4e4b03=a37_0x4e4b();let _0x934ce5=_0x4e4b03[_0x2083ae];return _0x934ce5;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';export class UserCommand extends BaseCommand{['name']=a37_0x533bd4(0x113);[a37_0x533bd4(0x120)]='Show\x20current\x20user\x20information';async[a37_0x533bd4(0x126)](_0x534f89){const _0x451aac=a37_0x533bd4,{options:_0x1339e8,tdx:_0x4f640c}=_0x534f89;try{const _0x139433=await withSpinner(_0x451aac(0x115),()=>_0x4f640c[_0x451aac(0x113)][_0x451aac(0x12d)](),{'verbose':_0x1339e8[_0x451aac(0x122)]}),_0x16df61=_0x139433[_0x451aac(0x117)];return await handleSingleObjectOutput(_0x16df61,_0x1339e8),0x0;}catch(_0x317a93){if(_0x317a93 instanceof SDKError)return console['error'](_0x451aac(0x12c)+_0x317a93[_0x451aac(0x129)]),_0x317a93[_0x451aac(0x12b)]&&console[_0x451aac(0x118)](_0x451aac(0x119)+_0x317a93[_0x451aac(0x12b)]),0x1;throw _0x317a93;}}}export class UserListCommand extends BaseCommand{[a37_0x533bd4(0x11a)]=a37_0x533bd4(0x128);[a37_0x533bd4(0x120)]=a37_0x533bd4(0x12e);async[a37_0x533bd4(0x126)](_0x39d023){const _0x2ddfcf=a37_0x533bd4,{options:_0x428d34,tdx:_0x538e44}=_0x39d023;try{const _0x26d8d3=await withSpinner(_0x2ddfcf(0x12a),()=>_0x538e44[_0x2ddfcf(0x113)]['list'](),{'verbose':_0x428d34[_0x2ddfcf(0x122)]}),_0x37c7c5=_0x26d8d3['data'];return console[_0x2ddfcf(0x118)](_0x2ddfcf(0x121)+_0x37c7c5[_0x2ddfcf(0x11c)]+'\x20user'+(_0x37c7c5[_0x2ddfcf(0x11c)]!==0x1?'s':'')),await handleSDKOutput(_0x37c7c5,_0x428d34),0x0;}catch(_0x5f0e25){if(_0x5f0e25 instanceof SDKError)return console[_0x2ddfcf(0x118)]('Error:\x20'+_0x5f0e25[_0x2ddfcf(0x129)]),_0x5f0e25[_0x2ddfcf(0x12b)]&&console[_0x2ddfcf(0x118)]('\x20\x20Cause:\x20'+_0x5f0e25['cause']),0x1;throw _0x5f0e25;}}}
@@ -1 +1 @@
1
- const a38_0x5e727e=a38_0x108a;(function(_0x484f9f,_0x553c3e){const _0x322494=a38_0x108a,_0x57085e=_0x484f9f();while(!![]){try{const _0x585b16=-parseInt(_0x322494(0x93))/0x1+parseInt(_0x322494(0xfe))/0x2*(-parseInt(_0x322494(0x6b))/0x3)+-parseInt(_0x322494(0x9e))/0x4+parseInt(_0x322494(0x71))/0x5*(parseInt(_0x322494(0xa8))/0x6)+-parseInt(_0x322494(0xfb))/0x7*(-parseInt(_0x322494(0xdc))/0x8)+-parseInt(_0x322494(0xff))/0x9+parseInt(_0x322494(0xd3))/0xa*(parseInt(_0x322494(0xaa))/0xb);if(_0x585b16===_0x553c3e)break;else _0x57085e['push'](_0x57085e['shift']());}catch(_0x44e364){_0x57085e['push'](_0x57085e['shift']());}}}(a38_0x250b,0xcd284));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a38_0x108a(_0x399218,_0x313702){_0x399218=_0x399218-0x67;const _0x250be3=a38_0x250b();let _0x108ae4=_0x250be3[_0x399218];return _0x108ae4;}import{confirm}from'../utils/prompt.js';import{formatBytes}from'../sdk/util/formatters.js';import a38_0x47f092 from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a38_0x5e727e(0xdd)]='workflow:projects';[a38_0x5e727e(0xb4)]='List\x20all\x20workflow\x20projects';async[a38_0x5e727e(0xfa)](_0x368b69){const _0x508815=a38_0x5e727e,{options:_0x1c1684,args:_0xc4912a,tdx:_0x178ffd}=_0x368b69,_0xf015f1=_0xc4912a[0x0];try{_0x1c1684[_0x508815(0x106)]&&_0xf015f1&&console[_0x508815(0xf7)](_0x508815(0x87)+_0xf015f1);const _0x32f1dd=await withSpinner(_0x508815(0xa9),()=>_0x178ffd[_0x508815(0xb8)][_0x508815(0xc9)](_0xf015f1,{'limit':_0x1c1684[_0x508815(0xb2)]}),{'verbose':_0x1c1684[_0x508815(0x106)]}),_0xeabbb0=_0x32f1dd[_0x508815(0xec)];return console[_0x508815(0xf7)]('✔\x20Found\x20'+_0xeabbb0['length']+_0x508815(0xa6)+(_0xeabbb0[_0x508815(0x7a)]!==0x1?'s':'')),await handleSDKOutput(_0xeabbb0,_0x1c1684),0x0;}catch(_0x39ee09){if(_0x39ee09 instanceof SDKError)return console[_0x508815(0xf7)](_0x508815(0xa5)+_0x39ee09['message']),_0x39ee09[_0x508815(0xd7)]&&console[_0x508815(0xf7)](_0x508815(0xad)+_0x39ee09['cause']),0x1;throw _0x39ee09;}}}function a38_0x250b(){const _0x2d3d3c=['5007642IYgwfu','Listing\x20workflow\x20projects...','176OEVOen','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x20session','\x20\x20Cause:\x20','cancelRequested','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Session\x20time:\x20','startsWith','limit','workflows','description','Listing\x20workflows...','status','workflow:download','workflow','✔\x20Workflow\x20run\x20started','Error:\x20Invalid\x20JSON\x20in\x20--params','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Start\x20a\x20workflow\x20run','yes','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','log','Usage:\x20workflow:delete\x20<project-name-or-id>','✔\x20Deleted\x20project\x20','tasks','attempt:','workflow:sessions','Retrying\x20session...','logs','Attempt\x20ID:\x20','running','projects','workflow:retry','fromTask','Downloading\x20logs...','Downloading\x20project\x20','message','Kill\x20a\x20running\x20attempt','\x20\x20Attempt\x20ID:\x20','Deleting\x20project\x20','logFiles','1237700APxgxU','revision','finishedAt','canceling','cause','Error:\x20Attempt\x20ID\x20is\x20required','Listing\x20workflow\x20sessions...','done','workflow:tasks','5072XvkohW','name','Filter:\x20project=','Project:\x20','delete','List\x20workflows','\x20\x20Revision:\x20','includeSubtasks','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','projectName','Target:\x20','parse','substring','map','data','\x20\x20Files\x20extracted:\x20','workflow:delete','\x20\x20Location:\x20','Reason:\x20','workflow:push','Resume\x20from:\x20','split','From\x20task:\x20','select','List\x20workflow\x20execution\x20sessions','error','createdAt','Output\x20directory:\x20','execute','4809VPLTbA','from','workflow:workflows','834540kDZpQu','3877038dlMkGi','reason','getTime','Error:\x20Workflow\x20identifier\x20is\x20required','workflow:run','Retrying\x20attempt...','indexOf','verbose','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','round','Getting\x20attempt\x20tasks...','filesExtracted','List\x20workflow\x20attempts','Params:\x20','6ckhKDR','task','includeRetried','Show\x20specific\x20attempt\x20details','retryAttemptName','\x20is\x20not\x20a\x20directory','10MWAihz','attempt','Fetching\x20log\x20files...','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Project\x20name:\x20','workflow:attempt','taskName','\x20\x20Session\x20ID:\x20','Select\x20a\x20task\x20to\x20view\x20logs:','length','run','✔\x20Found\x20','Force:\x20yes','Filter:\x20','Project\x20filter:\x20','session','attemptId','\x20\x20New\x20attempt\x20ID:\x20','projectId','sessionTime','success','workflow:logs','Pattern:\x20','\x20workflow','Including\x20subtasks:\x20yes','Getting\x20attempt\x20details...','param','Retry\x20a\x20session\x20or\x20attempt','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Parameters:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','index','sessionId','\x20\x20Project:\x20','1067857uqrTSH','workflow:kill','Revision:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Error:\x20Invalid\x20parameter\x20format:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Cancelled','✔\x20Downloaded\x20','force','\x20\x20Project\x20ID:\x20','project','3646356tKeRdr','workflow:attempts','retryAttempt','Error:\x20Project\x20name\x20is\x20required','isDirectory','...','json','Error:\x20','\x20project','retrySession'];a38_0x250b=function(){return _0x2d3d3c;};return a38_0x250b();}export class WorkflowWorkflowsCommand extends BaseCommand{[a38_0x5e727e(0xdd)]=a38_0x5e727e(0xfd);[a38_0x5e727e(0xb4)]=a38_0x5e727e(0xe1);async[a38_0x5e727e(0xfa)](_0x596d7d){const _0x29e7bc=a38_0x5e727e,{options:_0x5dbca4,args:_0x494551,tdx:_0x4c7430}=_0x596d7d,_0x3f3f52=_0x494551[0x0];try{_0x5dbca4[_0x29e7bc(0x106)]&&_0x3f3f52&&console[_0x29e7bc(0xf7)](_0x29e7bc(0x7f)+_0x3f3f52);const _0x2e21a4=await withSpinner(_0x29e7bc(0xb5),()=>_0x4c7430[_0x29e7bc(0xb8)][_0x29e7bc(0xb3)](_0x3f3f52,{'limit':_0x5dbca4[_0x29e7bc(0xb2)]}),{'verbose':_0x5dbca4['verbose']}),_0x5eaa75=_0x2e21a4[_0x29e7bc(0xec)];return console[_0x29e7bc(0xf7)](_0x29e7bc(0x7c)+_0x5eaa75[_0x29e7bc(0x7a)]+_0x29e7bc(0x88)+(_0x5eaa75[_0x29e7bc(0x7a)]!==0x1?'s':'')),await handleSDKOutput(_0x5eaa75,_0x5dbca4),0x0;}catch(_0x31dfbe){if(_0x31dfbe instanceof SDKError)return console[_0x29e7bc(0xf7)]('Error:\x20'+_0x31dfbe['message']),_0x31dfbe['cause']&&console[_0x29e7bc(0xf7)](_0x29e7bc(0xad)+_0x31dfbe[_0x29e7bc(0xd7)]),0x1;throw _0x31dfbe;}}}export class WorkflowSessionsCommand extends BaseCommand{['name']=a38_0x5e727e(0xc4);[a38_0x5e727e(0xb4)]=a38_0x5e727e(0xf6);async[a38_0x5e727e(0xfa)](_0x3eb742){const _0x44f734=a38_0x5e727e,{options:_0x44c969,args:_0x448008,tdx:_0x1d18ad}=_0x3eb742;let _0x425a78,_0x493d53;if(_0x448008[0x0]){const _0x368942=_0x448008[0x0][_0x44f734(0xf3)]('.');if(_0x368942[_0x44f734(0x7a)]===0x1)_0x425a78=_0x368942[0x0];else{if(_0x368942[_0x44f734(0x7a)]===0x2)[_0x425a78,_0x493d53]=_0x368942;else return console[_0x44f734(0xf7)](_0x44f734(0xaf)),0x1;}}try{if(_0x44c969[_0x44f734(0x106)]){if(_0x425a78&&_0x493d53)console['error'](_0x44f734(0x7e)+_0x425a78+'.'+_0x493d53);else _0x425a78&&console[_0x44f734(0xf7)](_0x44f734(0xde)+_0x425a78);const _0x10ce7d=_0x44c969['status'];_0x10ce7d&&console[_0x44f734(0xf7)]('Status:\x20'+_0x10ce7d);}const _0x7510aa=await withSpinner(_0x44f734(0xd9),()=>_0x1d18ad[_0x44f734(0xb8)]['sessions']({'projectName':_0x425a78,'workflowName':_0x493d53,'status':_0x44c969[_0x44f734(0xb6)],'fromTime':_0x44c969[_0x44f734(0xfc)],'toTime':_0x44c969['to'],'limit':_0x44c969[_0x44f734(0xb2)]}),{'verbose':_0x44c969['verbose']}),_0xbf085f=_0x7510aa[_0x44f734(0xec)];return console[_0x44f734(0xf7)]('✔\x20Found\x20'+_0xbf085f['length']+_0x44f734(0xac)+(_0xbf085f[_0x44f734(0x7a)]!==0x1?'s':'')),await handleSDKOutput(_0xbf085f,_0x44c969),0x0;}catch(_0x42af9d){if(_0x42af9d instanceof SDKError)return console[_0x44f734(0xf7)](_0x44f734(0xa5)+_0x42af9d[_0x44f734(0xce)]),_0x42af9d['cause']&&console['error'](_0x44f734(0xad)+_0x42af9d['cause']),0x1;throw _0x42af9d;}}}export class WorkflowAttemptsCommand extends BaseCommand{['name']=a38_0x5e727e(0x9f);['description']=a38_0x5e727e(0x69);async[a38_0x5e727e(0xfa)](_0x548adc){const _0x13aaea=a38_0x5e727e,{options:_0x545461,args:_0x4ae6a1,tdx:_0x537a60}=_0x548adc;let _0x1f9af0,_0x50e895;if(_0x4ae6a1[0x0]){const _0x35e19d=_0x4ae6a1[0x0][_0x13aaea(0xf3)]('.');if(_0x35e19d[_0x13aaea(0x7a)]===0x1)_0x1f9af0=_0x35e19d[0x0];else{if(_0x35e19d[_0x13aaea(0x7a)]===0x2)[_0x1f9af0,_0x50e895]=_0x35e19d;else return console['error'](_0x13aaea(0xaf)),0x1;}}try{const _0x592247=_0x545461[_0x13aaea(0x6d)];if(_0x545461[_0x13aaea(0x106)]){if(_0x1f9af0&&_0x50e895)console[_0x13aaea(0xf7)](_0x13aaea(0x7e)+_0x1f9af0+'.'+_0x50e895);else _0x1f9af0&&console['error'](_0x13aaea(0xde)+_0x1f9af0);_0x592247&&console[_0x13aaea(0xf7)]('Include\x20retried:\x20yes');}const _0x3aebff=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x537a60[_0x13aaea(0xb8)]['attempts']({'projectName':_0x1f9af0,'workflowName':_0x50e895,'includeRetried':_0x592247,'limit':_0x545461[_0x13aaea(0xb2)]}),{'verbose':_0x545461['verbose']}),_0x300bed=_0x3aebff['data'];return console[_0x13aaea(0xf7)](_0x13aaea(0x7c)+_0x300bed[_0x13aaea(0x7a)]+'\x20attempt'+(_0x300bed[_0x13aaea(0x7a)]!==0x1?'s':'')),await handleSDKOutput(_0x300bed,_0x545461),0x0;}catch(_0x2bb843){if(_0x2bb843 instanceof SDKError)return console[_0x13aaea(0xf7)]('Error:\x20'+_0x2bb843[_0x13aaea(0xce)]),_0x2bb843[_0x13aaea(0xd7)]&&console[_0x13aaea(0xf7)](_0x13aaea(0xad)+_0x2bb843['cause']),0x1;throw _0x2bb843;}}}export class WorkflowAttemptCommand extends BaseCommand{[a38_0x5e727e(0xdd)]=a38_0x5e727e(0x76);[a38_0x5e727e(0xb4)]=a38_0x5e727e(0x6e);async[a38_0x5e727e(0xfa)](_0x327b21){const _0x367061=a38_0x5e727e,{options:_0x160b73,args:_0x3863c5,tdx:_0x25580e}=_0x327b21,_0x282ce4=_0x3863c5[0x0];if(!_0x282ce4)return console[_0x367061(0xf7)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{_0x160b73[_0x367061(0x106)]&&console[_0x367061(0xf7)](_0x367061(0xc7)+_0x282ce4);const _0x5582ab=await withSpinner(_0x367061(0x8a),()=>_0x25580e[_0x367061(0xb8)][_0x367061(0x72)](_0x282ce4),{'verbose':_0x160b73['verbose']}),_0x2f5d55=_0x5582ab[_0x367061(0xec)];let _0x5bef57;!_0x2f5d55[_0x367061(0xda)]?_0x5bef57=_0x2f5d55[_0x367061(0xae)]?_0x367061(0xd6):_0x367061(0xc8):_0x5bef57=_0x2f5d55['success']?_0x367061(0x85):_0x367061(0xf7);let _0x500fbc;if(_0x2f5d55[_0x367061(0xf8)]&&_0x2f5d55[_0x367061(0xd5)]){const _0x29118d=new Date(_0x2f5d55[_0x367061(0xf8)])[_0x367061(0x101)](),_0x471bcf=new Date(_0x2f5d55['finishedAt'])['getTime']();_0x500fbc=Math[_0x367061(0x108)]((_0x471bcf-_0x29118d)/0x3e8);}const _0x27c2fe={'attempt_id':_0x2f5d55['id'],'status':_0x5bef57,..._0x2f5d55[_0x367061(0x90)]!==undefined&&{'index':_0x2f5d55[_0x367061(0x90)]},..._0x2f5d55['project']&&{'project':_0x2f5d55[_0x367061(0x9d)][_0x367061(0xdd)]},..._0x2f5d55[_0x367061(0xb8)]&&{'workflow':_0x2f5d55[_0x367061(0xb8)][_0x367061(0xdd)]},..._0x2f5d55[_0x367061(0x91)]&&{'session_id':_0x2f5d55[_0x367061(0x91)]},..._0x2f5d55[_0x367061(0x84)]&&{'session_time':_0x2f5d55[_0x367061(0x84)]},..._0x2f5d55['retryAttemptName']&&{'retry_attempt':_0x2f5d55[_0x367061(0x6f)]},..._0x500fbc!==undefined&&{'duration_sec':_0x500fbc},..._0x2f5d55[_0x367061(0xf8)]&&{'created_at':_0x2f5d55[_0x367061(0xf8)]},..._0x2f5d55[_0x367061(0xd5)]&&{'finished_at':_0x2f5d55[_0x367061(0xd5)]},...Object['keys'](_0x2f5d55['params'])['length']>0x0&&{'params':_0x2f5d55['params']}};return await handleSingleObjectOutput(_0x27c2fe,_0x160b73),0x0;}catch(_0x30b5f3){if(_0x30b5f3 instanceof SDKError)return console[_0x367061(0xf7)](_0x367061(0xa5)+_0x30b5f3[_0x367061(0xce)]),_0x30b5f3[_0x367061(0xd7)]&&console[_0x367061(0xf7)](_0x367061(0xad)+_0x30b5f3[_0x367061(0xd7)]),0x1;throw _0x30b5f3;}}}export class WorkflowTasksCommand extends BaseCommand{[a38_0x5e727e(0xdd)]=a38_0x5e727e(0xdb);[a38_0x5e727e(0xb4)]='Show\x20tasks\x20for\x20an\x20attempt';async['execute'](_0x5a7daa){const _0x5b047b=a38_0x5e727e,{options:_0x1fd811,args:_0x15bfb4,tdx:_0x551c13}=_0x5a7daa,_0x281b6d=_0x15bfb4[0x0];if(!_0x281b6d)return console[_0x5b047b(0xf7)](_0x5b047b(0xd8)),0x1;try{const _0x59000a=_0x1fd811[_0x5b047b(0xe3)];_0x1fd811[_0x5b047b(0x106)]&&(console[_0x5b047b(0xf7)](_0x5b047b(0xc7)+_0x281b6d),_0x59000a&&console[_0x5b047b(0xf7)](_0x5b047b(0x89)));const _0x270fd5=await withSpinner(_0x5b047b(0x67),()=>_0x551c13[_0x5b047b(0xb8)][_0x5b047b(0xc2)](_0x281b6d,_0x59000a||![]),{'verbose':_0x1fd811['verbose']}),_0x50f8c0=_0x270fd5[_0x5b047b(0xec)];return console['error'](_0x5b047b(0x7c)+_0x50f8c0[_0x5b047b(0x7a)]+'\x20task'+(_0x50f8c0[_0x5b047b(0x7a)]!==0x1?'s':'')),await handleSDKOutput(_0x50f8c0,_0x1fd811),0x0;}catch(_0x44962f){if(_0x44962f instanceof SDKError)return console[_0x5b047b(0xf7)]('Error:\x20'+_0x44962f[_0x5b047b(0xce)]),_0x44962f[_0x5b047b(0xd7)]&&console['error'](_0x5b047b(0xad)+_0x44962f[_0x5b047b(0xd7)]),0x1;throw _0x44962f;}}}export class WorkflowLogsCommand extends BaseCommand{[a38_0x5e727e(0xdd)]=a38_0x5e727e(0x86);[a38_0x5e727e(0xb4)]=a38_0x5e727e(0x8d);async[a38_0x5e727e(0xfa)](_0x3ed9d8){const _0x6f24c2=a38_0x5e727e,{options:_0x22f05a,args:_0x48dbda,tdx:_0x14ce57}=_0x3ed9d8,_0x488bfc=_0x48dbda[0x0];let _0x3d4e04=_0x48dbda[0x1];if(!_0x488bfc)return console['error'](_0x6f24c2(0xd8)),0x1;try{_0x22f05a['verbose']&&(console[_0x6f24c2(0xf7)](_0x6f24c2(0xc7)+_0x488bfc),_0x3d4e04&&console[_0x6f24c2(0xf7)]('Task\x20name:\x20'+_0x3d4e04));const _0xfa7554=await withSpinner(_0x6f24c2(0x73),()=>_0x14ce57[_0x6f24c2(0xb8)][_0x6f24c2(0xd2)](_0x488bfc,_0x3d4e04),{'verbose':_0x22f05a[_0x6f24c2(0x106)]}),_0x12644c=_0xfa7554[_0x6f24c2(0xec)];if(_0x12644c[_0x6f24c2(0x7a)]===0x0)return console[_0x6f24c2(0xf7)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x3d4e04&&(_0x22f05a[_0x6f24c2(0xa4)]||_0x22f05a['format']))return await handleSDKOutput(_0x12644c,_0x22f05a),0x0;if(!_0x3d4e04){const _0x4d87c6=_0x12644c[_0x6f24c2(0xeb)](_0x1bb3e2=>({'title':_0x1bb3e2[_0x6f24c2(0x77)]+'\x20('+formatBytes(_0x1bb3e2['fileSize'])+')','value':_0x1bb3e2[_0x6f24c2(0x77)]})),_0x30c555=await a38_0x47f092({'type':_0x6f24c2(0xf5),'name':_0x6f24c2(0x6c),'message':_0x6f24c2(0x79),'choices':_0x4d87c6});if(!_0x30c555['task'])return console[_0x6f24c2(0xf7)]('Cancelled'),0x0;_0x3d4e04=_0x30c555['task'];}const _0x34220e=await withSpinner(_0x6f24c2(0xcc),()=>_0x14ce57[_0x6f24c2(0xb8)][_0x6f24c2(0xc6)](_0x488bfc,_0x3d4e04),{'verbose':_0x22f05a['verbose']}),_0x14cd93=_0x34220e[_0x6f24c2(0xec)];return _0x14cd93?console[_0x6f24c2(0xbf)](_0x14cd93):console[_0x6f24c2(0xf7)]('No\x20log\x20content\x20found'),0x0;}catch(_0x5493c2){if(_0x5493c2 instanceof SDKError)return console[_0x6f24c2(0xf7)](_0x6f24c2(0xa5)+_0x5493c2['message']),_0x5493c2[_0x6f24c2(0xd7)]&&console[_0x6f24c2(0xf7)](_0x6f24c2(0xad)+_0x5493c2[_0x6f24c2(0xd7)]),0x1;throw _0x5493c2;}}}export class WorkflowKillCommand extends BaseCommand{[a38_0x5e727e(0xdd)]=a38_0x5e727e(0x94);[a38_0x5e727e(0xb4)]=a38_0x5e727e(0xcf);async[a38_0x5e727e(0xfa)](_0x153652){const _0x18fe6e=a38_0x5e727e,{options:_0x26a7a3,args:_0x34e856,tdx:_0x212568}=_0x153652,_0x48039b=_0x34e856[0x0];if(!_0x48039b)return console[_0x18fe6e(0xf7)](_0x18fe6e(0xd8)),0x1;try{const _0x150a5b=_0x26a7a3[_0x18fe6e(0x100)];_0x26a7a3[_0x18fe6e(0x106)]&&(console['error']('Attempt\x20ID:\x20'+_0x48039b),_0x150a5b&&console[_0x18fe6e(0xf7)](_0x18fe6e(0xf0)+_0x150a5b));if(!_0x26a7a3[_0x18fe6e(0xbd)]){const _0x363f49=await confirm(_0x18fe6e(0xe6)+_0x48039b+'?');if(!_0x363f49)return console['error']('Cancelled'),0x0;}const _0x599b1c=await withSpinner('Killing\x20attempt...',()=>_0x212568[_0x18fe6e(0xb8)]['kill'](_0x48039b,_0x150a5b),{'verbose':_0x26a7a3['verbose']}),_0x2e6083=_0x599b1c[_0x18fe6e(0xec)];return console['error']('✔\x20'+_0x2e6083),0x0;}catch(_0x4eddc8){if(_0x4eddc8 instanceof SDKError)return console['error'](_0x18fe6e(0xa5)+_0x4eddc8[_0x18fe6e(0xce)]),_0x4eddc8[_0x18fe6e(0xd7)]&&console[_0x18fe6e(0xf7)](_0x18fe6e(0xad)+_0x4eddc8[_0x18fe6e(0xd7)]),0x1;throw _0x4eddc8;}}}export class WorkflowRetryCommand extends BaseCommand{[a38_0x5e727e(0xdd)]=a38_0x5e727e(0xca);[a38_0x5e727e(0xb4)]=a38_0x5e727e(0x8c);async[a38_0x5e727e(0xfa)](_0x2bf293){const _0x20830b=a38_0x5e727e,{options:_0x56d657,args:_0x3748d9,tdx:_0x5aeccc}=_0x2bf293,_0x5f0a55=_0x3748d9[0x0];if(!_0x5f0a55)return console['error'](_0x20830b(0xe4)),console[_0x20830b(0xf7)](_0x20830b(0x96)),0x1;let _0x1c4c87=![],_0x5cc262=_0x5f0a55;if(_0x5f0a55[_0x20830b(0xb1)]('session:'))_0x1c4c87=!![],_0x5cc262=_0x5f0a55[_0x20830b(0xea)](0x8);else{if(_0x5f0a55[_0x20830b(0xb1)](_0x20830b(0xc3)))_0x1c4c87=![],_0x5cc262=_0x5f0a55[_0x20830b(0xea)](0x8);else return console[_0x20830b(0xf7)](_0x20830b(0xab)),console[_0x20830b(0xf7)](_0x20830b(0x96)),0x1;}try{const _0x33c6c8=_0x56d657[_0x20830b(0xcb)],_0x254025=_0x56d657['resumeFrom'],_0x5edaa2=_0x56d657['params'],_0x4be343=_0x56d657[_0x20830b(0x9b)];_0x56d657[_0x20830b(0x106)]&&(console['error'](_0x20830b(0xe8)+(_0x1c4c87?_0x20830b(0x80):_0x20830b(0x72))+'\x20'+_0x5cc262),_0x33c6c8&&console[_0x20830b(0xf7)](_0x20830b(0xf4)+_0x33c6c8),_0x254025&&console['error'](_0x20830b(0xf2)+_0x254025),_0x5edaa2&&console['error'](_0x20830b(0x6a)+_0x5edaa2),_0x4be343&&console['error'](_0x20830b(0x7d)));let _0x4ab653;if(_0x5edaa2)try{if(_0x5edaa2['startsWith']('@')){const _0x345923=await import('fs/promises'),_0xcddbc4=_0x5edaa2['substring'](0x1),_0x1ee1d3=await _0x345923['readFile'](_0xcddbc4,'utf-8');_0x4ab653=JSON['parse'](_0x1ee1d3);}else _0x4ab653=JSON[_0x20830b(0xe9)](_0x5edaa2);}catch{return console[_0x20830b(0xf7)](_0x20830b(0xba)),0x1;}if(!_0x56d657[_0x20830b(0xbd)]){const _0x51f953=await confirm(_0x20830b(0x107)+(_0x1c4c87?_0x20830b(0x80):'attempt')+'\x20'+_0x5cc262+'?');if(!_0x51f953)return console['error'](_0x20830b(0x99)),0x0;}let _0x5d3f41;_0x1c4c87?_0x5d3f41=await withSpinner(_0x20830b(0xc5),()=>_0x5aeccc[_0x20830b(0xb8)][_0x20830b(0xa7)](_0x5cc262,{'fromTask':_0x33c6c8,'retryParams':_0x4ab653}),{'verbose':_0x56d657[_0x20830b(0x106)]}):_0x5d3f41=await withSpinner(_0x20830b(0x104),()=>_0x5aeccc[_0x20830b(0xb8)][_0x20830b(0xa0)](_0x5cc262,{'resumeFrom':_0x254025,'retryParams':_0x4ab653,'force':_0x4be343}),{'verbose':_0x56d657[_0x20830b(0x106)]});const _0x20d3c1=_0x5d3f41['data'];return console[_0x20830b(0xf7)]('✔\x20Retry\x20started'),console[_0x20830b(0xf7)](_0x20830b(0x82)+_0x20d3c1[_0x20830b(0x81)]),console[_0x20830b(0xf7)](_0x20830b(0x78)+_0x20d3c1['sessionId']),0x0;}catch(_0x340e9e){if(_0x340e9e instanceof SDKError)return console[_0x20830b(0xf7)](_0x20830b(0xa5)+_0x340e9e[_0x20830b(0xce)]),_0x340e9e[_0x20830b(0xd7)]&&console[_0x20830b(0xf7)](_0x20830b(0xad)+_0x340e9e[_0x20830b(0xd7)]),0x1;throw _0x340e9e;}}}export class WorkflowRunCommand extends BaseCommand{[a38_0x5e727e(0xdd)]=a38_0x5e727e(0x103);[a38_0x5e727e(0xb4)]=a38_0x5e727e(0xbc);async[a38_0x5e727e(0xfa)](_0xa76157){const _0x4ecb68=a38_0x5e727e,{options:_0x487e31,args:_0x2caa83,tdx:_0x165d9e}=_0xa76157,_0x23353e=_0x2caa83[0x0];if(!_0x23353e)return console['error'](_0x4ecb68(0x102)),console[_0x4ecb68(0xf7)](_0x4ecb68(0xbe)),0x1;const _0xb1ba7e=_0x487e31[_0x4ecb68(0x8b)],_0x5b4d7f=_0x487e31[_0x4ecb68(0x84)],_0x14fe5c={};if(_0xb1ba7e&&Array['isArray'](_0xb1ba7e))for(const _0x193a51 of _0xb1ba7e){const _0x529f9c=_0x193a51[_0x4ecb68(0x105)]('=');if(_0x529f9c===-0x1)return console['error'](_0x4ecb68(0x97)+_0x193a51),console['error']('Expected\x20format:\x20--param\x20key=value'),0x1;const _0xbf7948=_0x193a51['substring'](0x0,_0x529f9c),_0xc1dc9=_0x193a51[_0x4ecb68(0xea)](_0x529f9c+0x1);try{_0x14fe5c[_0xbf7948]=JSON[_0x4ecb68(0xe9)](_0xc1dc9);}catch{_0x14fe5c[_0xbf7948]=_0xc1dc9;}}_0x487e31[_0x4ecb68(0x106)]&&(console[_0x4ecb68(0xf7)]('Workflow:\x20'+_0x23353e),Object['keys'](_0x14fe5c)[_0x4ecb68(0x7a)]>0x0&&console[_0x4ecb68(0xf7)](_0x4ecb68(0x8e)+JSON['stringify'](_0x14fe5c)),_0x5b4d7f&&console['error'](_0x4ecb68(0xb0)+_0x5b4d7f));const _0xdee048=await withSpinner('Starting\x20workflow\x20run...',()=>_0x165d9e[_0x4ecb68(0xb8)][_0x4ecb68(0x7b)](_0x23353e,_0x14fe5c,{'sessionTime':_0x5b4d7f}),{'verbose':_0x487e31[_0x4ecb68(0x106)]}),_0x162858=_0xdee048['data'];return console[_0x4ecb68(0xf7)](_0x4ecb68(0xb9)),console[_0x4ecb68(0xf7)](_0x4ecb68(0xd0)+_0x162858['id']),console[_0x4ecb68(0xf7)](_0x4ecb68(0x78)+_0x162858[_0x4ecb68(0x91)]),console['error'](_0x4ecb68(0x92)+_0x162858[_0x4ecb68(0x9d)]?.[_0x4ecb68(0xdd)]),console['error']('\x20\x20Workflow:\x20'+_0x162858[_0x4ecb68(0xb8)]?.[_0x4ecb68(0xdd)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a38_0x5e727e(0xdd)]=a38_0x5e727e(0xb7);['description']=a38_0x5e727e(0xbb);async[a38_0x5e727e(0xfa)](_0x3d1153){const _0x2d6c4e=a38_0x5e727e,{options:_0x3a4764,args:_0x5417d9,tdx:_0x11690f}=_0x3d1153,_0x10b1f7=_0x5417d9[0x0],_0x119835=_0x5417d9[0x1]||'.';if(!_0x10b1f7)return console[_0x2d6c4e(0xf7)](_0x2d6c4e(0xa1)),console['error'](_0x2d6c4e(0xe5)),0x1;const _0xa52d3f=_0x3a4764['revision'];_0x3a4764[_0x2d6c4e(0x106)]&&(console[_0x2d6c4e(0xf7)]('Project:\x20'+_0x10b1f7),console[_0x2d6c4e(0xf7)](_0x2d6c4e(0xf9)+_0x119835),_0xa52d3f&&console[_0x2d6c4e(0xf7)](_0x2d6c4e(0x95)+_0xa52d3f));const _0x587208=await withSpinner(_0x2d6c4e(0xcd)+_0x10b1f7+'...',()=>_0x11690f['workflow']['download'](_0x10b1f7,_0x119835,{'revision':_0xa52d3f}),{'verbose':_0x3a4764[_0x2d6c4e(0x106)]}),_0x35ec4c=_0x587208[_0x2d6c4e(0xec)];return console[_0x2d6c4e(0xf7)](_0x2d6c4e(0x9a)+_0x35ec4c[_0x2d6c4e(0xe7)]),console[_0x2d6c4e(0xf7)](_0x2d6c4e(0xe2)+_0x35ec4c['revision']),console['error'](_0x2d6c4e(0xed)+_0x35ec4c[_0x2d6c4e(0x68)]),console['error'](_0x2d6c4e(0xef)+_0x119835+'/'+_0x35ec4c[_0x2d6c4e(0xe7)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{['name']=a38_0x5e727e(0xf1);[a38_0x5e727e(0xb4)]='Push\x20workflow\x20project\x20to\x20Treasure\x20Data';async[a38_0x5e727e(0xfa)](_0x53be0f){const _0xceb945=a38_0x5e727e,{options:_0x28c144,args:_0x488c55,tdx:_0x1f963f}=_0x53be0f;let _0x19cfcf='.',_0x5380a3=_0x28c144[_0xceb945(0xdd)];if(_0x488c55[0x0]){const {promises:_0xccedfc}=await import('fs');try{const _0x365dde=await _0xccedfc['stat'](_0x488c55[0x0]);if(_0x365dde[_0xceb945(0xa2)]())_0x19cfcf=_0x488c55[0x0];else return console[_0xceb945(0xf7)](_0xceb945(0xa5)+_0x488c55[0x0]+_0xceb945(0x70)),0x1;}catch{_0x5380a3=_0x488c55[0x0],_0x19cfcf='.';}}const _0x2d04c0=_0x28c144[_0xceb945(0xd4)],_0x5ed36c=_0x28c144['skipValidation'];_0x28c144[_0xceb945(0x106)]&&(console['error']('Project\x20directory:\x20'+_0x19cfcf),_0x5380a3&&console[_0xceb945(0xf7)](_0xceb945(0x75)+_0x5380a3),_0x2d04c0&&console[_0xceb945(0xf7)](_0xceb945(0x95)+_0x2d04c0),_0x5ed36c&&console[_0xceb945(0xf7)]('Validation:\x20skipped'));const _0x3a21c8=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x1f963f[_0xceb945(0xb8)]['push'](_0x19cfcf,{'projectName':_0x5380a3,'revision':_0x2d04c0,'skipValidation':_0x5ed36c}),{'verbose':_0x28c144[_0xceb945(0x106)]}),_0x4619f2=_0x3a21c8[_0xceb945(0xec)];return console[_0xceb945(0xf7)]('✔\x20Pushed\x20'+_0x4619f2[_0xceb945(0xe7)]),console[_0xceb945(0xf7)](_0xceb945(0x9c)+_0x4619f2[_0xceb945(0x83)]),console['error'](_0xceb945(0xe2)+_0x4619f2[_0xceb945(0xd4)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a38_0x5e727e(0xee);[a38_0x5e727e(0xb4)]=a38_0x5e727e(0x74);async[a38_0x5e727e(0xfa)](_0x3d009a){const _0x4b4f70=a38_0x5e727e,{options:_0x4930a5,args:_0x5682d7,tdx:_0x28e261}=_0x3d009a,_0x5d7968=_0x5682d7[0x0];if(!_0x5d7968)return console['error']('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x4b4f70(0xf7)](_0x4b4f70(0xc0)),0x1;_0x4930a5[_0x4b4f70(0x106)]&&console['error'](_0x4b4f70(0xdf)+_0x5d7968);if(!_0x4930a5[_0x4b4f70(0xbd)]){const _0x1193dc=await confirm(_0x4b4f70(0x98)+_0x5d7968+_0x4b4f70(0x8f));if(!_0x1193dc)return console[_0x4b4f70(0xf7)]('Cancelled'),0x0;}const _0x162935=await withSpinner(_0x4b4f70(0xd1)+_0x5d7968+_0x4b4f70(0xa3),()=>_0x28e261[_0x4b4f70(0xb8)][_0x4b4f70(0xe0)](_0x5d7968),{'verbose':_0x4930a5[_0x4b4f70(0x106)]}),_0x49e049=_0x162935['data'];return console['error'](_0x4b4f70(0xc1)+_0x49e049[_0x4b4f70(0xe7)]),console['error'](_0x4b4f70(0x9c)+_0x49e049[_0x4b4f70(0x83)]),0x0;}}
1
+ const a38_0x4895b1=a38_0x1264;(function(_0x2e55ce,_0x1e7747){const _0x4aada2=a38_0x1264,_0xbc6a7b=_0x2e55ce();while(!![]){try{const _0x24b309=-parseInt(_0x4aada2(0x116))/0x1*(-parseInt(_0x4aada2(0x135))/0x2)+parseInt(_0x4aada2(0x13f))/0x3*(parseInt(_0x4aada2(0x180))/0x4)+parseInt(_0x4aada2(0x133))/0x5*(-parseInt(_0x4aada2(0x165))/0x6)+parseInt(_0x4aada2(0xfe))/0x7+parseInt(_0x4aada2(0x144))/0x8*(parseInt(_0x4aada2(0x14b))/0x9)+parseInt(_0x4aada2(0xfa))/0xa+-parseInt(_0x4aada2(0x142))/0xb;if(_0x24b309===_0x1e7747)break;else _0xbc6a7b['push'](_0xbc6a7b['shift']());}catch(_0x177f9c){_0xbc6a7b['push'](_0xbc6a7b['shift']());}}}(a38_0x3f09,0x83788));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{formatBytes}from'../sdk/util/formatters.js';import a38_0x24aa26 from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a38_0x4895b1(0x15a)]=a38_0x4895b1(0x18a);[a38_0x4895b1(0x13d)]=a38_0x4895b1(0x196);async['execute'](_0x20589c){const _0xb22deb=a38_0x4895b1,{options:_0x843d14,args:_0x5c0bae,tdx:_0x16010b}=_0x20589c,_0x14507f=_0x5c0bae[0x0];try{_0x843d14[_0xb22deb(0x17e)]&&_0x14507f&&console['error'](_0xb22deb(0x15e)+_0x14507f);const _0x36f672=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x16010b[_0xb22deb(0x113)][_0xb22deb(0x141)](_0x14507f,{'limit':_0x843d14[_0xb22deb(0x14f)]}),{'verbose':_0x843d14[_0xb22deb(0x17e)]}),_0x239c77=_0x36f672[_0xb22deb(0x187)];return console[_0xb22deb(0xf1)]('✔\x20Found\x20'+_0x239c77[_0xb22deb(0x158)]+_0xb22deb(0x183)+(_0x239c77[_0xb22deb(0x158)]!==0x1?'s':'')),await handleSDKOutput(_0x239c77,_0x843d14),0x0;}catch(_0x51f249){if(_0x51f249 instanceof SDKError)return console[_0xb22deb(0xf1)]('Error:\x20'+_0x51f249[_0xb22deb(0x166)]),_0x51f249[_0xb22deb(0x112)]&&console[_0xb22deb(0xf1)](_0xb22deb(0x123)+_0x51f249['cause']),0x1;throw _0x51f249;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a38_0x4895b1(0x15a)]=a38_0x4895b1(0x18c);['description']='List\x20workflows';async[a38_0x4895b1(0x105)](_0x22bd65){const _0x53ba88=a38_0x4895b1,{options:_0x46a026,args:_0x4a7b30,tdx:_0x3611e8}=_0x22bd65,_0x3b8009=_0x4a7b30[0x0];try{_0x46a026[_0x53ba88(0x17e)]&&_0x3b8009&&console[_0x53ba88(0xf1)](_0x53ba88(0x185)+_0x3b8009);const _0x4bc264=await withSpinner('Listing\x20workflows...',()=>_0x3611e8[_0x53ba88(0x113)][_0x53ba88(0xf6)](_0x3b8009,{'limit':_0x46a026['limit']}),{'verbose':_0x46a026[_0x53ba88(0x17e)]}),_0x79db6e=_0x4bc264[_0x53ba88(0x187)];return console[_0x53ba88(0xf1)](_0x53ba88(0x178)+_0x79db6e[_0x53ba88(0x158)]+_0x53ba88(0x147)+(_0x79db6e[_0x53ba88(0x158)]!==0x1?'s':'')),await handleSDKOutput(_0x79db6e,_0x46a026),0x0;}catch(_0x574540){if(_0x574540 instanceof SDKError)return console[_0x53ba88(0xf1)](_0x53ba88(0x15f)+_0x574540[_0x53ba88(0x166)]),_0x574540[_0x53ba88(0x112)]&&console[_0x53ba88(0xf1)](_0x53ba88(0x123)+_0x574540[_0x53ba88(0x112)]),0x1;throw _0x574540;}}}export class WorkflowSessionsCommand extends BaseCommand{[a38_0x4895b1(0x15a)]=a38_0x4895b1(0x172);[a38_0x4895b1(0x13d)]=a38_0x4895b1(0x11f);async['execute'](_0x2defd5){const _0x484df0=a38_0x4895b1,{options:_0x20be6c,args:_0x4c22bb,tdx:_0xd460ab}=_0x2defd5;let _0x2c7dd7,_0x3a2f06;if(_0x4c22bb[0x0]){const _0x1f7ab6=_0x4c22bb[0x0][_0x484df0(0x104)]('.');if(_0x1f7ab6['length']===0x1)_0x2c7dd7=_0x1f7ab6[0x0];else{if(_0x1f7ab6[_0x484df0(0x158)]===0x2)[_0x2c7dd7,_0x3a2f06]=_0x1f7ab6;else return console['error']('Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),0x1;}}try{if(_0x20be6c['verbose']){if(_0x2c7dd7&&_0x3a2f06)console[_0x484df0(0xf1)](_0x484df0(0x106)+_0x2c7dd7+'.'+_0x3a2f06);else _0x2c7dd7&&console[_0x484df0(0xf1)]('Filter:\x20project='+_0x2c7dd7);const _0x183c21=_0x20be6c[_0x484df0(0x12c)];_0x183c21&&console[_0x484df0(0xf1)](_0x484df0(0x10a)+_0x183c21);}const _0x52dedb=await withSpinner(_0x484df0(0x14d),()=>_0xd460ab[_0x484df0(0x113)][_0x484df0(0x131)]({'projectName':_0x2c7dd7,'workflowName':_0x3a2f06,'status':_0x20be6c[_0x484df0(0x12c)],'fromTime':_0x20be6c['from'],'toTime':_0x20be6c['to'],'limit':_0x20be6c[_0x484df0(0x14f)]}),{'verbose':_0x20be6c[_0x484df0(0x17e)]}),_0x1bdbcd=_0x52dedb[_0x484df0(0x187)];return console['error']('✔\x20Found\x20'+_0x1bdbcd[_0x484df0(0x158)]+_0x484df0(0x153)+(_0x1bdbcd[_0x484df0(0x158)]!==0x1?'s':'')),await handleSDKOutput(_0x1bdbcd,_0x20be6c),0x0;}catch(_0x8111a6){if(_0x8111a6 instanceof SDKError)return console[_0x484df0(0xf1)](_0x484df0(0x15f)+_0x8111a6[_0x484df0(0x166)]),_0x8111a6[_0x484df0(0x112)]&&console[_0x484df0(0xf1)](_0x484df0(0x123)+_0x8111a6[_0x484df0(0x112)]),0x1;throw _0x8111a6;}}}export class WorkflowAttemptsCommand extends BaseCommand{['name']=a38_0x4895b1(0x114);['description']=a38_0x4895b1(0x12e);async[a38_0x4895b1(0x105)](_0x16c45c){const _0x1a3857=a38_0x4895b1,{options:_0x3aeccd,args:_0x55bb94,tdx:_0x238a07}=_0x16c45c;let _0x121351,_0x400c2b;if(_0x55bb94[0x0]){const _0x1b92e9=_0x55bb94[0x0][_0x1a3857(0x104)]('.');if(_0x1b92e9[_0x1a3857(0x158)]===0x1)_0x121351=_0x1b92e9[0x0];else{if(_0x1b92e9[_0x1a3857(0x158)]===0x2)[_0x121351,_0x400c2b]=_0x1b92e9;else return console['error'](_0x1a3857(0xf3)),0x1;}}try{const _0x129892=_0x3aeccd[_0x1a3857(0xfd)];if(_0x3aeccd['verbose']){if(_0x121351&&_0x400c2b)console[_0x1a3857(0xf1)]('Filter:\x20'+_0x121351+'.'+_0x400c2b);else _0x121351&&console[_0x1a3857(0xf1)](_0x1a3857(0x11c)+_0x121351);_0x129892&&console[_0x1a3857(0xf1)](_0x1a3857(0x18b));}const _0x58354e=await withSpinner(_0x1a3857(0x190),()=>_0x238a07[_0x1a3857(0x113)][_0x1a3857(0x15b)]({'projectName':_0x121351,'workflowName':_0x400c2b,'includeRetried':_0x129892,'limit':_0x3aeccd['limit']}),{'verbose':_0x3aeccd[_0x1a3857(0x17e)]}),_0x4d8092=_0x58354e[_0x1a3857(0x187)];return console[_0x1a3857(0xf1)](_0x1a3857(0x178)+_0x4d8092['length']+_0x1a3857(0x103)+(_0x4d8092[_0x1a3857(0x158)]!==0x1?'s':'')),await handleSDKOutput(_0x4d8092,_0x3aeccd),0x0;}catch(_0x5f25bc){if(_0x5f25bc instanceof SDKError)return console[_0x1a3857(0xf1)](_0x1a3857(0x15f)+_0x5f25bc[_0x1a3857(0x166)]),_0x5f25bc[_0x1a3857(0x112)]&&console[_0x1a3857(0xf1)](_0x1a3857(0x123)+_0x5f25bc['cause']),0x1;throw _0x5f25bc;}}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a38_0x4895b1(0x10e);[a38_0x4895b1(0x13d)]='Show\x20specific\x20attempt\x20details';async[a38_0x4895b1(0x105)](_0x182425){const _0x10c1a4=a38_0x4895b1,{options:_0x3c73d7,args:_0x34b27e,tdx:_0x35d790}=_0x182425,_0x1f4e46=_0x34b27e[0x0];if(!_0x1f4e46)return console['error'](_0x10c1a4(0x156)),0x1;try{_0x3c73d7[_0x10c1a4(0x17e)]&&console[_0x10c1a4(0xf1)](_0x10c1a4(0x13b)+_0x1f4e46);const _0x52255d=await withSpinner(_0x10c1a4(0xf2),()=>_0x35d790[_0x10c1a4(0x113)][_0x10c1a4(0x174)](_0x1f4e46),{'verbose':_0x3c73d7[_0x10c1a4(0x17e)]}),_0x4ac566=_0x52255d[_0x10c1a4(0x187)];let _0x4714ca;!_0x4ac566[_0x10c1a4(0x149)]?_0x4714ca=_0x4ac566[_0x10c1a4(0x146)]?_0x10c1a4(0x138):_0x10c1a4(0x119):_0x4714ca=_0x4ac566[_0x10c1a4(0x110)]?_0x10c1a4(0x110):_0x10c1a4(0xf1);let _0x32035f;if(_0x4ac566[_0x10c1a4(0x155)]&&_0x4ac566[_0x10c1a4(0x145)]){const _0x1e73d5=new Date(_0x4ac566[_0x10c1a4(0x155)])[_0x10c1a4(0x17c)](),_0xc29046=new Date(_0x4ac566[_0x10c1a4(0x145)])[_0x10c1a4(0x17c)]();_0x32035f=Math[_0x10c1a4(0x186)]((_0xc29046-_0x1e73d5)/0x3e8);}const _0x571630={'attempt_id':_0x4ac566['id'],'status':_0x4714ca,..._0x4ac566[_0x10c1a4(0x11a)]!==undefined&&{'index':_0x4ac566[_0x10c1a4(0x11a)]},..._0x4ac566['project']&&{'project':_0x4ac566[_0x10c1a4(0x117)][_0x10c1a4(0x15a)]},..._0x4ac566[_0x10c1a4(0x113)]&&{'workflow':_0x4ac566[_0x10c1a4(0x113)][_0x10c1a4(0x15a)]},..._0x4ac566[_0x10c1a4(0x162)]&&{'session_id':_0x4ac566['sessionId']},..._0x4ac566[_0x10c1a4(0x16a)]&&{'session_time':_0x4ac566['sessionTime']},..._0x4ac566[_0x10c1a4(0xf8)]&&{'retry_attempt':_0x4ac566[_0x10c1a4(0xf8)]},..._0x32035f!==undefined&&{'duration_sec':_0x32035f},..._0x4ac566['createdAt']&&{'created_at':_0x4ac566[_0x10c1a4(0x155)]},..._0x4ac566[_0x10c1a4(0x145)]&&{'finished_at':_0x4ac566[_0x10c1a4(0x145)]},...Object[_0x10c1a4(0x179)](_0x4ac566[_0x10c1a4(0x118)])[_0x10c1a4(0x158)]>0x0&&{'params':_0x4ac566[_0x10c1a4(0x118)]}};return await handleSingleObjectOutput(_0x571630,_0x3c73d7),0x0;}catch(_0x370915){if(_0x370915 instanceof SDKError)return console[_0x10c1a4(0xf1)](_0x10c1a4(0x15f)+_0x370915[_0x10c1a4(0x166)]),_0x370915[_0x10c1a4(0x112)]&&console['error'](_0x10c1a4(0x123)+_0x370915[_0x10c1a4(0x112)]),0x1;throw _0x370915;}}}export class WorkflowTasksCommand extends BaseCommand{['name']=a38_0x4895b1(0x132);[a38_0x4895b1(0x13d)]='Show\x20tasks\x20for\x20an\x20attempt';async[a38_0x4895b1(0x105)](_0x585e3b){const _0x3ea582=a38_0x4895b1,{options:_0x235eef,args:_0xa1fcdf,tdx:_0x4b19f3}=_0x585e3b,_0x3541dd=_0xa1fcdf[0x0];if(!_0x3541dd)return console[_0x3ea582(0xf1)](_0x3ea582(0x156)),0x1;try{const _0x1c6955=_0x235eef[_0x3ea582(0x140)];_0x235eef[_0x3ea582(0x17e)]&&(console['error'](_0x3ea582(0x13b)+_0x3541dd),_0x1c6955&&console['error']('Including\x20subtasks:\x20yes'));const _0x25cc96=await withSpinner(_0x3ea582(0x177),()=>_0x4b19f3[_0x3ea582(0x113)][_0x3ea582(0x192)](_0x3541dd,_0x1c6955||![]),{'verbose':_0x235eef[_0x3ea582(0x17e)]}),_0x3bdc66=_0x25cc96[_0x3ea582(0x187)];return console[_0x3ea582(0xf1)]('✔\x20Found\x20'+_0x3bdc66['length']+'\x20task'+(_0x3bdc66[_0x3ea582(0x158)]!==0x1?'s':'')),await handleSDKOutput(_0x3bdc66,_0x235eef),0x0;}catch(_0x580a83){if(_0x580a83 instanceof SDKError)return console['error'](_0x3ea582(0x15f)+_0x580a83[_0x3ea582(0x166)]),_0x580a83['cause']&&console[_0x3ea582(0xf1)](_0x3ea582(0x123)+_0x580a83[_0x3ea582(0x112)]),0x1;throw _0x580a83;}}}export class WorkflowLogsCommand extends BaseCommand{[a38_0x4895b1(0x15a)]=a38_0x4895b1(0x10c);[a38_0x4895b1(0x13d)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a38_0x4895b1(0x105)](_0x234662){const _0x4f90c2=a38_0x4895b1,{options:_0x51aab8,args:_0x4c5172,tdx:_0x48e05d}=_0x234662,_0x380240=_0x4c5172[0x0];let _0x40be1b=_0x4c5172[0x1];if(!_0x380240)return console[_0x4f90c2(0xf1)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{_0x51aab8[_0x4f90c2(0x17e)]&&(console[_0x4f90c2(0xf1)](_0x4f90c2(0x13b)+_0x380240),_0x40be1b&&console[_0x4f90c2(0xf1)](_0x4f90c2(0x197)+_0x40be1b));const _0x5de5b1=await withSpinner(_0x4f90c2(0x10d),()=>_0x48e05d[_0x4f90c2(0x113)][_0x4f90c2(0x164)](_0x380240,_0x40be1b),{'verbose':_0x51aab8[_0x4f90c2(0x17e)]}),_0x15e77b=_0x5de5b1[_0x4f90c2(0x187)];if(_0x15e77b[_0x4f90c2(0x158)]===0x0)return console[_0x4f90c2(0xf1)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x40be1b&&(_0x51aab8[_0x4f90c2(0xf0)]||_0x51aab8[_0x4f90c2(0x168)]))return await handleSDKOutput(_0x15e77b,_0x51aab8),0x0;if(!_0x40be1b){const _0x500541=_0x15e77b[_0x4f90c2(0x16d)](_0x3635ee=>({'title':_0x3635ee[_0x4f90c2(0x161)]+'\x20('+formatBytes(_0x3635ee[_0x4f90c2(0x184)])+')','value':_0x3635ee[_0x4f90c2(0x161)]})),_0x4c21c5=await a38_0x24aa26({'type':_0x4f90c2(0x194),'name':'task','message':_0x4f90c2(0x17b),'choices':_0x500541});if(!_0x4c21c5[_0x4f90c2(0x181)])return console['error'](_0x4f90c2(0x18e)),0x0;_0x40be1b=_0x4c21c5[_0x4f90c2(0x181)];}const _0x13cf09=await withSpinner(_0x4f90c2(0x120),()=>_0x48e05d[_0x4f90c2(0x113)][_0x4f90c2(0x14e)](_0x380240,_0x40be1b),{'verbose':_0x51aab8[_0x4f90c2(0x17e)]}),_0xeea322=_0x13cf09[_0x4f90c2(0x187)];return _0xeea322?console[_0x4f90c2(0x101)](_0xeea322):console['error'](_0x4f90c2(0x115)),0x0;}catch(_0x48eafc){if(_0x48eafc instanceof SDKError)return console[_0x4f90c2(0xf1)]('Error:\x20'+_0x48eafc[_0x4f90c2(0x166)]),_0x48eafc[_0x4f90c2(0x112)]&&console['error']('\x20\x20Cause:\x20'+_0x48eafc[_0x4f90c2(0x112)]),0x1;throw _0x48eafc;}}}export class WorkflowKillCommand extends BaseCommand{[a38_0x4895b1(0x15a)]=a38_0x4895b1(0x125);['description']=a38_0x4895b1(0x154);async[a38_0x4895b1(0x105)](_0x4b806b){const _0x2e441f=a38_0x4895b1,{options:_0x566496,args:_0x4b9b30,tdx:_0x282182}=_0x4b806b,_0x354dd6=_0x4b9b30[0x0];if(!_0x354dd6)return console[_0x2e441f(0xf1)](_0x2e441f(0x156)),0x1;try{const _0x355cb4=_0x566496['reason'];_0x566496[_0x2e441f(0x17e)]&&(console[_0x2e441f(0xf1)]('Attempt\x20ID:\x20'+_0x354dd6),_0x355cb4&&console[_0x2e441f(0xf1)](_0x2e441f(0x143)+_0x355cb4));if(!_0x566496[_0x2e441f(0x16e)]){const _0x3bb362=await confirm(_0x2e441f(0x109)+_0x354dd6+'?');if(!_0x3bb362)return console[_0x2e441f(0xf1)]('Cancelled'),0x0;}const _0x394d15=await withSpinner(_0x2e441f(0x12d),()=>_0x282182[_0x2e441f(0x113)][_0x2e441f(0x152)](_0x354dd6,_0x355cb4),{'verbose':_0x566496[_0x2e441f(0x17e)]}),_0x4f0425=_0x394d15[_0x2e441f(0x187)];return console[_0x2e441f(0xf1)]('✔\x20'+_0x4f0425),0x0;}catch(_0x333e58){if(_0x333e58 instanceof SDKError)return console[_0x2e441f(0xf1)](_0x2e441f(0x15f)+_0x333e58['message']),_0x333e58[_0x2e441f(0x112)]&&console[_0x2e441f(0xf1)](_0x2e441f(0x123)+_0x333e58[_0x2e441f(0x112)]),0x1;throw _0x333e58;}}}export class WorkflowRetryCommand extends BaseCommand{['name']=a38_0x4895b1(0x17a);[a38_0x4895b1(0x13d)]=a38_0x4895b1(0x12a);async[a38_0x4895b1(0x105)](_0x1fbc4a){const _0xa8421b=a38_0x4895b1,{options:_0x1e1b51,args:_0x25099e,tdx:_0x2266b6}=_0x1fbc4a,_0x51dbc8=_0x25099e[0x0];if(!_0x51dbc8)return console[_0xa8421b(0xf1)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0xa8421b(0xf1)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x4f1644=![],_0x4d1eee=_0x51dbc8;if(_0x51dbc8['startsWith'](_0xa8421b(0x127)))_0x4f1644=!![],_0x4d1eee=_0x51dbc8[_0xa8421b(0x137)](0x8);else{if(_0x51dbc8[_0xa8421b(0x199)](_0xa8421b(0x15c)))_0x4f1644=![],_0x4d1eee=_0x51dbc8['substring'](0x8);else return console[_0xa8421b(0xf1)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0xa8421b(0xf1)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}try{const _0x38d37c=_0x1e1b51[_0xa8421b(0x193)],_0x2b7f4b=_0x1e1b51['resumeFrom'],_0x5b3033=_0x1e1b51[_0xa8421b(0x118)],_0x544444=_0x1e1b51[_0xa8421b(0x148)];_0x1e1b51[_0xa8421b(0x17e)]&&(console[_0xa8421b(0xf1)](_0xa8421b(0xfc)+(_0x4f1644?'session':_0xa8421b(0x174))+'\x20'+_0x4d1eee),_0x38d37c&&console[_0xa8421b(0xf1)]('From\x20task:\x20'+_0x38d37c),_0x2b7f4b&&console[_0xa8421b(0xf1)](_0xa8421b(0xfb)+_0x2b7f4b),_0x5b3033&&console[_0xa8421b(0xf1)](_0xa8421b(0xff)+_0x5b3033),_0x544444&&console[_0xa8421b(0xf1)](_0xa8421b(0x10f)));let _0x4de464;if(_0x5b3033)try{if(_0x5b3033[_0xa8421b(0x199)]('@')){const _0x2ba7f3=await import(_0xa8421b(0x139)),_0x1a4e15=_0x5b3033[_0xa8421b(0x137)](0x1),_0x4564c6=await _0x2ba7f3[_0xa8421b(0x195)](_0x1a4e15,_0xa8421b(0x128));_0x4de464=JSON[_0xa8421b(0x102)](_0x4564c6);}else _0x4de464=JSON['parse'](_0x5b3033);}catch{return console[_0xa8421b(0xf1)](_0xa8421b(0x16f)),0x1;}if(!_0x1e1b51[_0xa8421b(0x16e)]){const _0x613308=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x4f1644?_0xa8421b(0x13a):_0xa8421b(0x174))+'\x20'+_0x4d1eee+'?');if(!_0x613308)return console['error'](_0xa8421b(0x18e)),0x0;}let _0x257163;_0x4f1644?_0x257163=await withSpinner(_0xa8421b(0x159),()=>_0x2266b6['workflow']['retrySession'](_0x4d1eee,{'fromTask':_0x38d37c,'retryParams':_0x4de464}),{'verbose':_0x1e1b51['verbose']}):_0x257163=await withSpinner(_0xa8421b(0x16c),()=>_0x2266b6[_0xa8421b(0x113)][_0xa8421b(0x134)](_0x4d1eee,{'resumeFrom':_0x2b7f4b,'retryParams':_0x4de464,'force':_0x544444}),{'verbose':_0x1e1b51[_0xa8421b(0x17e)]});const _0x466c2c=_0x257163[_0xa8421b(0x187)];return console[_0xa8421b(0xf1)]('✔\x20Retry\x20started'),console[_0xa8421b(0xf1)](_0xa8421b(0x173)+_0x466c2c[_0xa8421b(0x124)]),console[_0xa8421b(0xf1)](_0xa8421b(0x189)+_0x466c2c[_0xa8421b(0x162)]),0x0;}catch(_0x593e2d){if(_0x593e2d instanceof SDKError)return console[_0xa8421b(0xf1)](_0xa8421b(0x15f)+_0x593e2d[_0xa8421b(0x166)]),_0x593e2d[_0xa8421b(0x112)]&&console[_0xa8421b(0xf1)]('\x20\x20Cause:\x20'+_0x593e2d['cause']),0x1;throw _0x593e2d;}}}export class WorkflowRunCommand extends BaseCommand{['name']='workflow:run';[a38_0x4895b1(0x13d)]=a38_0x4895b1(0x19a);async[a38_0x4895b1(0x105)](_0x27441d){const _0x43f9b3=a38_0x4895b1,{options:_0x2f1b81,args:_0x2f02fc,tdx:_0x4ffdf8}=_0x27441d,_0x2d8899=_0x2f02fc[0x0];if(!_0x2d8899)return console['error']('Error:\x20Workflow\x20identifier\x20is\x20required'),console[_0x43f9b3(0xf1)](_0x43f9b3(0x11b)),0x1;const _0x3af8b9=_0x2f1b81[_0x43f9b3(0x12f)],_0x26aa46=_0x2f1b81[_0x43f9b3(0x16a)],_0x113097={};if(_0x3af8b9&&Array['isArray'](_0x3af8b9))for(const _0x19260a of _0x3af8b9){const _0x3a9246=_0x19260a[_0x43f9b3(0x157)]('=');if(_0x3a9246===-0x1)return console['error'](_0x43f9b3(0x167)+_0x19260a),console['error'](_0x43f9b3(0x14a)),0x1;const _0x54b650=_0x19260a[_0x43f9b3(0x137)](0x0,_0x3a9246),_0x28a061=_0x19260a[_0x43f9b3(0x137)](_0x3a9246+0x1);try{_0x113097[_0x54b650]=JSON[_0x43f9b3(0x102)](_0x28a061);}catch{_0x113097[_0x54b650]=_0x28a061;}}_0x2f1b81[_0x43f9b3(0x17e)]&&(console[_0x43f9b3(0xf1)]('Workflow:\x20'+_0x2d8899),Object['keys'](_0x113097)[_0x43f9b3(0x158)]>0x0&&console[_0x43f9b3(0xf1)](_0x43f9b3(0x182)+JSON[_0x43f9b3(0x122)](_0x113097)),_0x26aa46&&console[_0x43f9b3(0xf1)]('Session\x20time:\x20'+_0x26aa46));const _0x172a75=await withSpinner(_0x43f9b3(0x160),()=>_0x4ffdf8['workflow'][_0x43f9b3(0x171)](_0x2d8899,_0x113097,{'sessionTime':_0x26aa46}),{'verbose':_0x2f1b81[_0x43f9b3(0x17e)]}),_0x3399ed=_0x172a75['data'];return console['error'](_0x43f9b3(0x130)),console[_0x43f9b3(0xf1)]('\x20\x20Attempt\x20ID:\x20'+_0x3399ed['id']),console[_0x43f9b3(0xf1)](_0x43f9b3(0x189)+_0x3399ed[_0x43f9b3(0x162)]),console[_0x43f9b3(0xf1)](_0x43f9b3(0x16b)+_0x3399ed[_0x43f9b3(0x117)]?.[_0x43f9b3(0x15a)]),console['error'](_0x43f9b3(0x14c)+_0x3399ed['workflow']?.[_0x43f9b3(0x15a)]),0x0;}}function a38_0x1264(_0x224c51,_0x1ffaa3){_0x224c51=_0x224c51-0xf0;const _0x3f09a4=a38_0x3f09();let _0x126461=_0x3f09a4[_0x224c51];return _0x126461;}export class WorkflowDownloadCommand extends BaseCommand{['name']=a38_0x4895b1(0x10b);[a38_0x4895b1(0x13d)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a38_0x4895b1(0x105)](_0x369f16){const _0x5b5a69=a38_0x4895b1,{options:_0x58f256,args:_0x24f6c1,tdx:_0x22679d}=_0x369f16,_0x53e000=_0x24f6c1[0x0],_0x444bf0=_0x24f6c1[0x1]||'.';if(!_0x53e000)return console[_0x5b5a69(0xf1)](_0x5b5a69(0x108)),console[_0x5b5a69(0xf1)](_0x5b5a69(0x111)),0x1;const _0x1bd0f1=_0x58f256[_0x5b5a69(0x170)];_0x58f256[_0x5b5a69(0x17e)]&&(console['error'](_0x5b5a69(0x18d)+_0x53e000),console[_0x5b5a69(0xf1)](_0x5b5a69(0x163)+_0x444bf0),_0x1bd0f1&&console[_0x5b5a69(0xf1)]('Revision:\x20'+_0x1bd0f1));const _0x2c7b6a=await withSpinner(_0x5b5a69(0x175)+_0x53e000+_0x5b5a69(0x17f),()=>_0x22679d['workflow']['download'](_0x53e000,_0x444bf0,{'revision':_0x1bd0f1}),{'verbose':_0x58f256['verbose']}),_0x345786=_0x2c7b6a[_0x5b5a69(0x187)];return console['error']('✔\x20Downloaded\x20'+_0x345786[_0x5b5a69(0x11e)]),console[_0x5b5a69(0xf1)](_0x5b5a69(0x191)+_0x345786['revision']),console[_0x5b5a69(0xf1)](_0x5b5a69(0x13c)+_0x345786['filesExtracted']),console[_0x5b5a69(0xf1)](_0x5b5a69(0x121)+_0x444bf0+'/'+_0x345786[_0x5b5a69(0x11e)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a38_0x4895b1(0x15a)]=a38_0x4895b1(0x13e);['description']=a38_0x4895b1(0xf9);async[a38_0x4895b1(0x105)](_0x2d02dc){const _0x127d5e=a38_0x4895b1,{options:_0x40162b,args:_0x288178,tdx:_0x5946e1}=_0x2d02dc;let _0x5f2405='.',_0x49cde4=_0x40162b[_0x127d5e(0x15a)];if(_0x288178[0x0]){const {promises:_0xe25278}=await import('fs');try{const _0x32ef57=await _0xe25278['stat'](_0x288178[0x0]);if(_0x32ef57['isDirectory']())_0x5f2405=_0x288178[0x0];else return console[_0x127d5e(0xf1)]('Error:\x20'+_0x288178[0x0]+_0x127d5e(0x107)),0x1;}catch{_0x49cde4=_0x288178[0x0],_0x5f2405='.';}}const _0x146d30=_0x40162b[_0x127d5e(0x170)],_0xebbd95=_0x40162b[_0x127d5e(0x11d)];_0x40162b[_0x127d5e(0x17e)]&&(console[_0x127d5e(0xf1)](_0x127d5e(0x18f)+_0x5f2405),_0x49cde4&&console['error'](_0x127d5e(0x176)+_0x49cde4),_0x146d30&&console[_0x127d5e(0xf1)](_0x127d5e(0x198)+_0x146d30),_0xebbd95&&console[_0x127d5e(0xf1)](_0x127d5e(0x169)));const _0x1fdf6c=await withSpinner(_0x127d5e(0x188),()=>_0x5946e1['workflow'][_0x127d5e(0xf5)](_0x5f2405,{'projectName':_0x49cde4,'revision':_0x146d30,'skipValidation':_0xebbd95}),{'verbose':_0x40162b[_0x127d5e(0x17e)]}),_0x38b2d7=_0x1fdf6c[_0x127d5e(0x187)];return console[_0x127d5e(0xf1)](_0x127d5e(0x12b)+_0x38b2d7[_0x127d5e(0x11e)]),console[_0x127d5e(0xf1)](_0x127d5e(0x151)+_0x38b2d7[_0x127d5e(0x15d)]),console[_0x127d5e(0xf1)](_0x127d5e(0x191)+_0x38b2d7[_0x127d5e(0x170)]),0x0;}}function a38_0x3f09(){const _0xa31877=['sessions','workflow:tasks','10zpXvvO','retryAttempt','1921060MvSFdY','\x22?\x20This\x20cannot\x20be\x20undone.','substring','canceling','fs/promises','session','Attempt\x20ID:\x20','\x20\x20Files\x20extracted:\x20','description','workflow:push','95055iOqTID','includeSubtasks','projects','22033308eppsGK','Reason:\x20','456qsxTlS','finishedAt','cancelRequested','\x20workflow','force','done','Expected\x20format:\x20--param\x20key=value','41454JspKSo','\x20\x20Workflow:\x20','Listing\x20workflow\x20sessions...','logs','limit','✔\x20Deleted\x20project\x20','\x20\x20Project\x20ID:\x20','kill','\x20session','Kill\x20a\x20running\x20attempt','createdAt','Error:\x20Attempt\x20ID\x20is\x20required','indexOf','length','Retrying\x20session...','name','attempts','attempt:','projectId','Pattern:\x20','Error:\x20','Starting\x20workflow\x20run...','taskName','sessionId','Output\x20directory:\x20','logFiles','589146thwYPU','message','Error:\x20Invalid\x20parameter\x20format:\x20','format','Validation:\x20skipped','sessionTime','\x20\x20Project:\x20','Retrying\x20attempt...','map','yes','Error:\x20Invalid\x20JSON\x20in\x20--params','revision','run','workflow:sessions','\x20\x20New\x20attempt\x20ID:\x20','attempt','Downloading\x20project\x20','Project\x20name:\x20','Getting\x20attempt\x20tasks...','✔\x20Found\x20','keys','workflow:retry','Select\x20a\x20task\x20to\x20view\x20logs:','getTime','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','verbose','...','100wixXgV','task','Parameters:\x20','\x20project','fileSize','Project\x20filter:\x20','round','data','Pushing\x20workflow\x20project...','\x20\x20Session\x20ID:\x20','workflow:projects','Include\x20retried:\x20yes','workflow:workflows','Project:\x20','Cancelled','Project\x20directory:\x20','Listing\x20workflow\x20attempts...','\x20\x20Revision:\x20','tasks','fromTask','select','readFile','List\x20all\x20workflow\x20projects','Task\x20name:\x20','Revision:\x20','startsWith','Start\x20a\x20workflow\x20run','json','error','Getting\x20attempt\x20details...','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','push','workflows','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','retryAttemptName','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','1742360utmyUu','Resume\x20from:\x20','Target:\x20','includeRetried','3839367sRjNdj','Params:\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','log','parse','\x20attempt','split','execute','Filter:\x20','\x20is\x20not\x20a\x20directory','Error:\x20Project\x20name\x20is\x20required','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Status:\x20','workflow:download','workflow:logs','Fetching\x20log\x20files...','workflow:attempt','Force:\x20yes','success','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','cause','workflow','workflow:attempts','No\x20log\x20content\x20found','1bTddNc','project','params','running','index','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','Filter:\x20project=','skipValidation','projectName','List\x20workflow\x20execution\x20sessions','Downloading\x20logs...','\x20\x20Location:\x20','stringify','\x20\x20Cause:\x20','attemptId','workflow:kill','workflow:delete','session:','utf-8','delete','Retry\x20a\x20session\x20or\x20attempt','✔\x20Pushed\x20','status','Killing\x20attempt...','List\x20workflow\x20attempts','param','✔\x20Workflow\x20run\x20started'];a38_0x3f09=function(){return _0xa31877;};return a38_0x3f09();}export class WorkflowDeleteCommand extends BaseCommand{[a38_0x4895b1(0x15a)]=a38_0x4895b1(0x126);[a38_0x4895b1(0x13d)]=a38_0x4895b1(0xf4);async[a38_0x4895b1(0x105)](_0x644d3b){const _0x40d573=a38_0x4895b1,{options:_0x150535,args:_0x1e78bf,tdx:_0x289701}=_0x644d3b,_0x5529be=_0x1e78bf[0x0];if(!_0x5529be)return console[_0x40d573(0xf1)](_0x40d573(0xf7)),console[_0x40d573(0xf1)](_0x40d573(0x100)),0x1;_0x150535[_0x40d573(0x17e)]&&console[_0x40d573(0xf1)](_0x40d573(0x18d)+_0x5529be);if(!_0x150535[_0x40d573(0x16e)]){const _0x18822c=await confirm(_0x40d573(0x17d)+_0x5529be+_0x40d573(0x136));if(!_0x18822c)return console[_0x40d573(0xf1)](_0x40d573(0x18e)),0x0;}const _0x2590ce=await withSpinner('Deleting\x20project\x20'+_0x5529be+'...',()=>_0x289701[_0x40d573(0x113)][_0x40d573(0x129)](_0x5529be),{'verbose':_0x150535['verbose']}),_0x1d238d=_0x2590ce[_0x40d573(0x187)];return console[_0x40d573(0xf1)](_0x40d573(0x150)+_0x1d238d[_0x40d573(0x11e)]),console[_0x40d573(0xf1)](_0x40d573(0x151)+_0x1d238d[_0x40d573(0x15d)]),0x0;}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0xde30e3,_0xebfc46){const _0x7b163f=a39_0x99af,_0xa41ed7=_0xde30e3();while(!![]){try{const _0x53f5af=-parseInt(_0x7b163f(0x17f))/0x1+-parseInt(_0x7b163f(0x17c))/0x2*(-parseInt(_0x7b163f(0x187))/0x3)+-parseInt(_0x7b163f(0x182))/0x4+-parseInt(_0x7b163f(0x181))/0x5*(-parseInt(_0x7b163f(0x189))/0x6)+-parseInt(_0x7b163f(0x180))/0x7*(-parseInt(_0x7b163f(0x186))/0x8)+-parseInt(_0x7b163f(0x18a))/0x9+-parseInt(_0x7b163f(0x18b))/0xa;if(_0x53f5af===_0xebfc46)break;else _0xa41ed7['push'](_0xa41ed7['shift']());}catch(_0x499fc9){_0xa41ed7['push'](_0xa41ed7['shift']());}}}(a39_0x1364,0xe200c));import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';function a39_0x1364(){const _0x39bd21=['1505073mVmLgT','595kqQBJK','1473490TwzhtL','2194928bdQJFx','../../package.json','Authorization','parse','89624tXiHUT','3oGElMF','replace','30gIXJnQ','4893777KfWyvO','5648370YVNGmZ','X-Trino-User','entries','TD1\x20','tdx/','3324716BxBHzH','version',';\x20node/'];a39_0x1364=function(){return _0x39bd21;};return a39_0x1364();}import{getAPIKey}from'./config.js';export function getVersion(){const _0x573ccb=a39_0x99af;try{const _0x23b297=fileURLToPath(import.meta.url),_0x33dc81=dirname(_0x23b297),_0x21d325=join(_0x33dc81,_0x573ccb(0x183)),_0x283793=JSON[_0x573ccb(0x185)](readFileSync(_0x21d325,'utf-8'));return _0x283793[_0x573ccb(0x17d)];}catch{return'0.0.0';}}export function getUserAgent(){const _0x54c68c=a39_0x99af,_0x30b1ef=getVersion(),_0x526d92=platform(),_0x16eea0=process[_0x54c68c(0x17d)][_0x54c68c(0x188)]('v','');return _0x54c68c(0x17b)+_0x30b1ef+'\x20('+_0x526d92+_0x54c68c(0x17e)+_0x16eea0+')';}export function getAuthHeaders(_0x2649ac,_0xa76aeb){const _0x556862=a39_0x99af,_0x212bf5=getVersion(),_0x320258={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x212bf5};return _0xa76aeb&&(_0x320258[_0x556862(0x184)]=_0x556862(0x17a)+_0xa76aeb),_0x320258;}function a39_0x99af(_0x179352,_0x21353c){_0x179352=_0x179352-0x17a;const _0x13640c=a39_0x1364();let _0x99af6d=_0x13640c[_0x179352];return _0x99af6d;}export function toHeaderRecord(_0x427a2e){const _0x213531=a39_0x99af,_0x19d94b={};for(const [_0x22b421,_0x352d07]of Object[_0x213531(0x18d)](_0x427a2e)){_0x352d07!==undefined&&(_0x19d94b[_0x22b421]=_0x352d07);}return _0x19d94b;}export function getTrinoHeaders(_0x673b41,_0x2b263b){const _0x48bfd9=a39_0x99af,_0x273043=getAuthHeaders(_0x673b41,_0x2b263b),_0x3d162f=toHeaderRecord(_0x273043);return delete _0x3d162f[_0x48bfd9(0x184)],_0x2b263b&&(_0x3d162f[_0x48bfd9(0x18c)]=_0x2b263b),_0x3d162f;}export function hasAPIKey(_0x21bb59){const _0xc94c9b=getAPIKey(_0x21bb59);return _0xc94c9b!==undefined&&_0xc94c9b['length']>0x0;}
1
+ function a39_0x1f1c(){const _0x204abb=['438FvMyRT','tdx','31414vSqTAM','TD1\x20','entries','X-Trino-User','length','Authorization','2324dBQUGa','version','replace','parse','24702700PUJBvs','tdx/',';\x20node/','6682711leNmft','18VilYLs','89XUUOzc','11271072ssyqGE','../../package.json','utf-8','7167048ffqMWc','3385570DtDVPv'];a39_0x1f1c=function(){return _0x204abb;};return a39_0x1f1c();}function a39_0x10b8(_0x1a07f1,_0x553b8b){_0x1a07f1=_0x1a07f1-0x17d;const _0x1f1ca5=a39_0x1f1c();let _0x10b880=_0x1f1ca5[_0x1a07f1];return _0x10b880;}(function(_0x398534,_0x2e90d0){const _0x45a062=a39_0x10b8,_0x38ada2=_0x398534();while(!![]){try{const _0x446c1d=parseInt(_0x45a062(0x186))/0x1*(parseInt(_0x45a062(0x18e))/0x2)+-parseInt(_0x45a062(0x18c))/0x3*(-parseInt(_0x45a062(0x17d))/0x4)+parseInt(_0x45a062(0x18b))/0x5+parseInt(_0x45a062(0x18a))/0x6+parseInt(_0x45a062(0x184))/0x7+parseInt(_0x45a062(0x187))/0x8+-parseInt(_0x45a062(0x185))/0x9*(parseInt(_0x45a062(0x181))/0xa);if(_0x446c1d===_0x2e90d0)break;else _0x38ada2['push'](_0x38ada2['shift']());}catch(_0x6a1366){_0x38ada2['push'](_0x38ada2['shift']());}}}(a39_0x1f1c,0xbdcac));import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x4213c1=a39_0x10b8;try{const _0x5e9730=fileURLToPath(import.meta.url),_0x4b8ebb=dirname(_0x5e9730),_0xc6be22=join(_0x4b8ebb,_0x4213c1(0x188)),_0x130938=JSON[_0x4213c1(0x180)](readFileSync(_0xc6be22,_0x4213c1(0x189)));return _0x130938[_0x4213c1(0x17e)];}catch{return'0.0.0';}}export function getUserAgent(){const _0xc386be=a39_0x10b8,_0xdad918=getVersion(),_0x32e5e8=platform(),_0x5bd069=process['version'][_0xc386be(0x17f)]('v','');return _0xc386be(0x182)+_0xdad918+'\x20('+_0x32e5e8+_0xc386be(0x183)+_0x5bd069+')';}export function getAuthHeaders(_0x3ef7d0,_0x4905f1){const _0x4e2272=a39_0x10b8,_0x51e745=getVersion(),_0x23114e={'User-Agent':getUserAgent(),'X-TD-Client':_0x4e2272(0x18d),'X-TD-Client-Version':_0x51e745};return _0x4905f1&&(_0x23114e['Authorization']=_0x4e2272(0x18f)+_0x4905f1),_0x23114e;}export function toHeaderRecord(_0x190302){const _0x3d0710=a39_0x10b8,_0x548581={};for(const [_0x582842,_0x50da4e]of Object[_0x3d0710(0x190)](_0x190302)){_0x50da4e!==undefined&&(_0x548581[_0x582842]=_0x50da4e);}return _0x548581;}export function getTrinoHeaders(_0x27b7d2,_0x5c0826){const _0x5d0701=a39_0x10b8,_0x447215=getAuthHeaders(_0x27b7d2,_0x5c0826),_0x322080=toHeaderRecord(_0x447215);return delete _0x322080[_0x5d0701(0x193)],_0x5c0826&&(_0x322080[_0x5d0701(0x191)]=_0x5c0826),_0x322080;}export function hasAPIKey(_0x458293){const _0x151524=a39_0x10b8,_0x747c79=getAPIKey(_0x458293);return _0x747c79!==undefined&&_0x747c79[_0x151524(0x192)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x3e6ba8,_0x5989c9){const _0x4d954c=a40_0x561d,_0x25a516=_0x3e6ba8();while(!![]){try{const _0x35a677=parseInt(_0x4d954c(0x197))/0x1*(parseInt(_0x4d954c(0x1a6))/0x2)+-parseInt(_0x4d954c(0x1bd))/0x3*(parseInt(_0x4d954c(0x185))/0x4)+parseInt(_0x4d954c(0x1a5))/0x5*(-parseInt(_0x4d954c(0x1a8))/0x6)+-parseInt(_0x4d954c(0x19d))/0x7*(-parseInt(_0x4d954c(0x1a1))/0x8)+parseInt(_0x4d954c(0x18d))/0x9+parseInt(_0x4d954c(0x192))/0xa*(-parseInt(_0x4d954c(0x19e))/0xb)+-parseInt(_0x4d954c(0x188))/0xc*(parseInt(_0x4d954c(0x183))/0xd);if(_0x35a677===_0x5989c9)break;else _0x25a516['push'](_0x25a516['shift']());}catch(_0x27757d){_0x25a516['push'](_0x25a516['shift']());}}}(a40_0x6eb0,0xb5603));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a40_0x1cde58 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x16ae86){const _0x38ee7d=a40_0x561d;return _0x16ae86[_0x38ee7d(0x1ae)]===_0x38ee7d(0x1ab)||_0x16ae86[_0x38ee7d(0x1ae)]==='jsonl'||_0x16ae86['format']===_0x38ee7d(0x1a0)||_0x16ae86['format']===_0x38ee7d(0x1c4)||_0x16ae86[_0x38ee7d(0x1ab)]===!![]||_0x16ae86[_0x38ee7d(0x1c0)]===!![]||_0x16ae86['tsv']===!![]||_0x16ae86[_0x38ee7d(0x1c4)]===!![];}export function parseOutputOptions(_0x3e3dd8){const _0x5bf5ab=a40_0x561d;return{'format':_0x3e3dd8[_0x5bf5ab(0x1ae)]||_0x5bf5ab(0x1c4),'output':_0x3e3dd8[_0x5bf5ab(0x189)]||'','limit':_0x3e3dd8['limit'],'color':_0x3e3dd8[_0x5bf5ab(0x1b6)],'noColor':_0x3e3dd8[_0x5bf5ab(0x18a)]};}function a40_0x561d(_0x435e79,_0x4ba477){_0x435e79=_0x435e79-0x181;const _0x6eb0b8=a40_0x6eb0();let _0x561d10=_0x6eb0b8[_0x435e79];return _0x561d10;}function convertSDKResultToQueryResult(_0x16c984){const _0x483399=a40_0x561d,_0x595e40=[];if(_0x16c984[_0x483399(0x1bf)]>0x0){const _0x4b9d69=_0x16c984[0x0];for(const [_0x342e0f,_0x2fb444]of Object[_0x483399(0x18c)](_0x4b9d69)){let _0x13cc43=_0x483399(0x1b4);if(typeof _0x2fb444===_0x483399(0x1c5))_0x13cc43=Number[_0x483399(0x184)](_0x2fb444)?'bigint':_0x483399(0x190);else{if(typeof _0x2fb444===_0x483399(0x19f))_0x13cc43='boolean';else _0x2fb444===null&&(_0x13cc43='varchar');}_0x595e40[_0x483399(0x19c)]({'name':_0x342e0f,'type':_0x13cc43});}}return{'queryId':'sdk-result','columns':_0x595e40,'data':_0x16c984,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x16c984[_0x483399(0x1bf)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x1aa148,_0x440d46){const _0x239f7c=convertSDKResultToQueryResult(_0x1aa148);return formatQueryOutput(_0x239f7c,_0x440d46);}export async function formatQueryOutput(_0x130935,_0x2f0caf){const _0xdf8c19=a40_0x561d,{format:_0x3ceb91,limit:_0x28240e,output:_0x39fe93,color:_0x29e74d,noColor:_0x1965b6}=_0x2f0caf,_0x248285=Boolean(_0x39fe93)&&!_0x29e74d,_0x34c438={'color':_0x29e74d,'noColor':_0x1965b6||_0x248285};if(_0x3ceb91===_0xdf8c19(0x1c4)){const _0x30aa8b=shouldUseLess(_0x3ceb91,_0x39fe93);return formatAsTable(_0x130935,_0x28240e,_0x30aa8b,_0x34c438);}else{if(_0x3ceb91===_0xdf8c19(0x1ab))return formatAsJSON(_0x130935,_0x34c438);else return _0x3ceb91==='jsonl'?formatAsJSONL(_0x130935,_0x34c438):formatQueryResult(_0x130935,_0x3ceb91);}}function shouldUseLess(_0x1b9bbe,_0x26d50a){const _0x1494eb=a40_0x561d;return _0x1b9bbe===_0x1494eb(0x1c4)&&process[_0x1494eb(0x1af)][_0x1494eb(0x1aa)]&&!_0x26d50a;}export function resolveOutputOptions(_0x785107){const _0x37268d=a40_0x561d,_0x578938=resolveOutputFormat(_0x785107[_0x37268d(0x1ae)],_0x785107[_0x37268d(0x189)],_0x37268d(0x1c4));let _0x3e20fe=typeof _0x785107[_0x37268d(0x1ac)]==='number'?_0x785107[_0x37268d(0x1ac)]:parseInt(_0x785107['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x493ce2=_0x785107['output']||'';return shouldUseLess(_0x578938,_0x493ce2)&&(_0x3e20fe=Infinity),{'format':_0x578938,'output':_0x493ce2,'limit':_0x3e20fe,'color':_0x785107[_0x37268d(0x1b6)],'noColor':_0x785107[_0x37268d(0x18a)]};}export function writeOutput(_0x16b688,_0x37188f,_0x369f28){const _0x55a47c=a40_0x561d;return _0x37188f?(writeFileSync(_0x37188f,_0x16b688),console[_0x55a47c(0x1b7)](_0x55a47c(0x1a3)+_0x37188f),Promise[_0x55a47c(0x1c6)]()):shouldUseLess(_0x369f28||'','')?new Promise(_0x1e897d=>{const _0x40673a=_0x55a47c,_0x2d92d1=spawn(_0x40673a(0x19a),[_0x40673a(0x193)],{'stdio':[_0x40673a(0x1b0),_0x40673a(0x187),_0x40673a(0x187)]});let _0xb0979b=![];_0x2d92d1['on']('error',()=>{const _0x229f06=_0x40673a;!_0xb0979b&&(_0xb0979b=!![],console[_0x229f06(0x1a7)](_0x16b688),_0x1e897d());}),_0x2d92d1['on']('close',()=>{!_0xb0979b&&(_0xb0979b=!![],_0x1e897d());}),_0x2d92d1['on']('spawn',()=>{const _0x68e868=_0x40673a;!_0xb0979b&&_0x2d92d1[_0x68e868(0x1a2)]&&(_0x2d92d1[_0x68e868(0x1a2)]['on'](_0x68e868(0x1b7),()=>{}),_0x2d92d1['stdin'][_0x68e868(0x1ad)](_0x16b688),_0x2d92d1[_0x68e868(0x1a2)][_0x68e868(0x1b9)]());}),!_0x2d92d1[_0x40673a(0x1a2)]&&(!_0xb0979b&&(_0xb0979b=!![],console[_0x40673a(0x1a7)](_0x16b688),_0x1e897d()));}):(console[_0x55a47c(0x1a7)](_0x16b688),Promise['resolve']());}export async function handleSDKOutput(_0x368407,_0x5bf566){const _0x53de14=a40_0x561d,_0x18c97d=resolveOutputOptions(_0x5bf566),_0x5623a5=await formatSDKOutput(_0x368407,_0x18c97d);await writeOutput(_0x5623a5,_0x18c97d[_0x53de14(0x189)]||undefined,_0x18c97d[_0x53de14(0x1ae)]);}export async function handleQueryOutput(_0xf81137,_0x1b27eb){const _0x20a4f1=a40_0x561d,_0x313073=resolveOutputOptions(_0x1b27eb),_0x564f05=await formatQueryOutput(_0xf81137,_0x313073);await writeOutput(_0x564f05,_0x313073[_0x20a4f1(0x189)]||undefined,_0x313073[_0x20a4f1(0x1ae)]);}async function formatSingleObject(_0x2e01d5,_0x4cfef4){const _0x4a1d19=a40_0x561d,{format:_0x889cae,color:_0x2a539d,noColor:_0x16e98f}=_0x4cfef4,_0x203ca7={'color':_0x2a539d,'noColor':_0x16e98f};if(_0x889cae==='json'){if(shouldUseColor(_0x203ca7))return colorizeJSON(_0x2e01d5,_0x203ca7);return JSON[_0x4a1d19(0x18f)](_0x2e01d5,null,0x2);}else{if(_0x889cae===_0x4a1d19(0x1c0)){if(shouldUseColor(_0x203ca7))return colorizeJSONCompact(_0x2e01d5,_0x203ca7);return JSON[_0x4a1d19(0x18f)](_0x2e01d5);}else{if(_0x889cae===_0x4a1d19(0x1a0))return Object[_0x4a1d19(0x18c)](_0x2e01d5)[_0x4a1d19(0x198)](([_0x52aa3a,_0x573388])=>_0x52aa3a+'\x09'+_0x573388)['join']('\x0a');else{const _0xb7f940=Object[_0x4a1d19(0x18c)](_0x2e01d5);if(_0xb7f940[_0x4a1d19(0x1bf)]===0x0)return _0x4a1d19(0x18b);const _0x48b720=_0x2e01d5[_0x4a1d19(0x1c8)],_0x3887d6=_0x2e01d5[_0x4a1d19(0x1b3)],_0x166f38=_0x2e01d5['params'],_0xdcdb71=_0x2e01d5[_0x4a1d19(0x196)],_0x2f2b94=_0x3887d6?typeof _0x3887d6===_0x4a1d19(0x1b8)?_0x3887d6:JSON[_0x4a1d19(0x18f)](_0x3887d6,null,0x2):undefined,_0x307d3f=_0x166f38&&Object[_0x4a1d19(0x1c3)](_0x166f38)[_0x4a1d19(0x1bf)]>0x0?JSON[_0x4a1d19(0x18f)](_0x166f38,null,0x2):undefined,_0x5e1214=_0xdcdb71&&Object[_0x4a1d19(0x1c3)](_0xdcdb71)['length']>0x0?JSON['stringify'](_0xdcdb71,null,0x2):undefined,_0x2183bb=_0xb7f940[_0x4a1d19(0x1be)](([_0x16c10b])=>_0x16c10b!==_0x4a1d19(0x1c8)&&_0x16c10b!==_0x4a1d19(0x1b3)&&_0x16c10b!==_0x4a1d19(0x1a4)&&_0x16c10b!==_0x4a1d19(0x196)),_0x794f90=Math[_0x4a1d19(0x191)](..._0x2183bb['map'](([_0x3c53fe])=>_0x3c53fe[_0x4a1d19(0x1bf)])),_0xd8d064=Math['max'](..._0x2183bb[_0x4a1d19(0x198)](([,_0x6f17f8])=>{const _0x21226e=_0x4a1d19;try{const _0x5284e4=_0x6f17f8===null||_0x6f17f8===undefined?'':typeof _0x6f17f8==='object'?JSON['stringify'](_0x6f17f8):String(_0x6f17f8),_0x30947c=_0x5284e4[_0x21226e(0x1bb)]('\x0a');return Math[_0x21226e(0x191)](..._0x30947c[_0x21226e(0x198)](_0x1e923f=>_0x1e923f['length']),0x0);}catch{return 0x0;}}),0x14),_0x5606e6=[];_0x5606e6[_0x4a1d19(0x19c)](colorBorder('┌─'+'─'[_0x4a1d19(0x18e)](_0x794f90)+'─┬─'+'─'[_0x4a1d19(0x18e)](_0xd8d064)+'─┐',_0x203ca7)),_0x2183bb[_0x4a1d19(0x1c7)](([_0x28e4ff,_0x2e6eac])=>{const _0x4a0152=_0x4a1d19;let _0x14767d;try{_0x14767d=_0x2e6eac===null||_0x2e6eac===undefined?'':typeof _0x2e6eac===_0x4a0152(0x1b1)?JSON[_0x4a0152(0x18f)](_0x2e6eac):String(_0x2e6eac);}catch{_0x14767d=_0x4a0152(0x195);}const _0x1f78bb=_0x28e4ff[_0x4a0152(0x194)](_0x794f90),_0x51305f=_0x14767d[_0x4a0152(0x1bb)]('\x0a');_0x51305f[_0x4a0152(0x1c7)]((_0x4d4663,_0x53fbd7)=>{const _0x1c0ca2=_0x4a0152,_0x267866=colorBorder('│',_0x203ca7);_0x53fbd7===0x0?_0x5606e6[_0x1c0ca2(0x19c)](_0x267866+'\x20'+_0x1f78bb+'\x20'+_0x267866+'\x20'+_0x4d4663[_0x1c0ca2(0x194)](_0xd8d064)+'\x20'+_0x267866):_0x5606e6['push'](_0x267866+'\x20'+'\x20'[_0x1c0ca2(0x18e)](_0x794f90)+'\x20'+_0x267866+'\x20'+_0x4d4663['padEnd'](_0xd8d064)+'\x20'+_0x267866);});}),_0x5606e6['push'](colorBorder('└─'+'─'[_0x4a1d19(0x18e)](_0x794f90)+_0x4a1d19(0x1ba)+'─'[_0x4a1d19(0x18e)](_0xd8d064)+'─┘',_0x203ca7));_0x2f2b94&&(_0x5606e6[_0x4a1d19(0x19c)](''),_0x5606e6[_0x4a1d19(0x19c)](String(a40_0x1cde58['yellow'][_0x4a1d19(0x1b2)](_0x4a1d19(0x1c2)))),_0x5606e6[_0x4a1d19(0x19c)](_0x2f2b94));_0x307d3f&&(_0x5606e6[_0x4a1d19(0x19c)](''),_0x5606e6[_0x4a1d19(0x19c)](String(a40_0x1cde58[_0x4a1d19(0x182)][_0x4a1d19(0x1b2)](_0x4a1d19(0x1bc)))),_0x5606e6['push'](_0x307d3f));_0x5e1214&&(_0x5606e6[_0x4a1d19(0x19c)](''),_0x5606e6[_0x4a1d19(0x19c)](String(a40_0x1cde58[_0x4a1d19(0x19b)][_0x4a1d19(0x1b2)]('[rule]'))),_0x5606e6[_0x4a1d19(0x19c)](_0x5e1214));if(_0x48b720){if(_0x48b720[_0x4a1d19(0x1b5)]){_0x5606e6[_0x4a1d19(0x19c)](''),_0x5606e6[_0x4a1d19(0x19c)](String(a40_0x1cde58[_0x4a1d19(0x181)][_0x4a1d19(0x1b2)](_0x4a1d19(0x1c1))));const _0x4838b1=_0x48b720['stderr'][_0x4a1d19(0x1bb)]('\x0a');_0x4838b1[_0x4a1d19(0x1c7)](_0x364580=>{const _0x411402=_0x4a1d19;_0x364580[_0x411402(0x199)]()&&_0x5606e6[_0x411402(0x19c)](_0x364580);});}if(_0x48b720['cmdout']){_0x5606e6[_0x4a1d19(0x19c)](''),_0x5606e6[_0x4a1d19(0x19c)](String(a40_0x1cde58[_0x4a1d19(0x186)][_0x4a1d19(0x1b2)]('[logs]')));const _0x22b0a8=_0x48b720[_0x4a1d19(0x1a9)]['split']('\x0a');_0x22b0a8[_0x4a1d19(0x1c7)](_0x5ea084=>{const _0x4f3c20=_0x4a1d19;_0x5ea084[_0x4f3c20(0x199)]()&&_0x5606e6[_0x4f3c20(0x19c)](_0x5ea084);});}}return _0x5606e6['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x11363b,_0x261219){const _0x5d9406=a40_0x561d;if(_0x261219[_0x5d9406(0x1ae)]===_0x5d9406(0x1c4)){await handleSDKOutput([_0x11363b],_0x261219);return;}const _0x41f635=resolveOutputOptions(_0x261219),_0x3e46dc=await formatSingleObject(_0x11363b,_0x41f635);await writeOutput(_0x3e46dc,_0x41f635[_0x5d9406(0x189)]||undefined,_0x41f635['format']);}function a40_0x6eb0(){const _0x4a4c91=['less','magenta','push','1941926RXEfQT','5071ovwAWF','boolean','tsv','24uruXXS','stdin','Results\x20saved\x20to\x20','params','522065MYvdww','1346416zFOxwd','log','6CexoIL','cmdout','isTTY','json','limit','write','format','stdout','pipe','object','bold','query','varchar','stderr','color','error','string','end','─┴─','split','[params]','3MUSSkK','filter','length','jsonl','[error]','[query]','keys','table','number','resolve','forEach','debug','red','blue','13PqJGnq','isInteger','545492MmCscd','cyan','inherit','14939076GPwlsn','output','noColor','No\x20data','entries','6067332FdbuLp','repeat','stringify','double','max','13540spUYCa','-FXRSn','padEnd','[Object]','rule','2ycnQoX','map','trim'];a40_0x6eb0=function(){return _0x4a4c91;};return a40_0x6eb0();}
1
+ function a40_0x3e5f(_0x35a151,_0x22e398){_0x35a151=_0x35a151-0xa0;const _0x1ad2c2=a40_0x1ad2();let _0x3e5f4e=_0x1ad2c2[_0x35a151];return _0x3e5f4e;}(function(_0x23a0c7,_0x528892){const _0x2d4c8a=a40_0x3e5f,_0x35c408=_0x23a0c7();while(!![]){try{const _0x1c68ad=-parseInt(_0x2d4c8a(0xcf))/0x1+parseInt(_0x2d4c8a(0xc7))/0x2*(-parseInt(_0x2d4c8a(0xe0))/0x3)+parseInt(_0x2d4c8a(0xd1))/0x4*(parseInt(_0x2d4c8a(0xbf))/0x5)+-parseInt(_0x2d4c8a(0xcc))/0x6+parseInt(_0x2d4c8a(0xe3))/0x7*(parseInt(_0x2d4c8a(0xe2))/0x8)+-parseInt(_0x2d4c8a(0xd5))/0x9+parseInt(_0x2d4c8a(0xca))/0xa;if(_0x1c68ad===_0x528892)break;else _0x35c408['push'](_0x35c408['shift']());}catch(_0x581ac1){_0x35c408['push'](_0x35c408['shift']());}}}(a40_0x1ad2,0x994fc));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a40_0x423a01 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x5e1c53){const _0x13a272=a40_0x3e5f;return _0x5e1c53[_0x13a272(0xd7)]==='json'||_0x5e1c53['format']==='jsonl'||_0x5e1c53['format']===_0x13a272(0xba)||_0x5e1c53['format']===_0x13a272(0xbc)||_0x5e1c53[_0x13a272(0xb9)]===!![]||_0x5e1c53[_0x13a272(0xb0)]===!![]||_0x5e1c53[_0x13a272(0xba)]===!![]||_0x5e1c53[_0x13a272(0xbc)]===!![];}export function parseOutputOptions(_0x496e1c){const _0x2541ff=a40_0x3e5f;return{'format':_0x496e1c[_0x2541ff(0xd7)]||'table','output':_0x496e1c['output']||'','limit':_0x496e1c['limit'],'color':_0x496e1c[_0x2541ff(0xcd)],'noColor':_0x496e1c[_0x2541ff(0xa1)]};}function a40_0x1ad2(){const _0x12ee2e=['repeat','[logs]','2uOtSIB','red','padEnd','33278740uyXgns','bold','4131408pjXwkv','color','forEach','644746EAyocs','split','1496836NNHxTV','string','push','─┬─','10312866gXDrcL','pipe','format','inherit','entries','stringify','number','Results\x20saved\x20to\x20','cmdout','error','log','2526819rHPhSy','length','304wtVBVv','45563FLRylr','output','map','limit','noColor','bigint','resolve','object','─┴─','[query]','varchar','stderr','trim','stdin','filter','isInteger','debug','stdout','[error]','jsonl','sdk-result','query','blue','close','spawn','boolean','double','end','json','tsv','join','table','params','magenta','5OYzMPB','[Object]','rule','[params]','cyan','No\x20data'];a40_0x1ad2=function(){return _0x12ee2e;};return a40_0x1ad2();}function convertSDKResultToQueryResult(_0xf373e9){const _0x1a5517=a40_0x3e5f,_0x834c2b=[];if(_0xf373e9[_0x1a5517(0xe1)]>0x0){const _0x33daf1=_0xf373e9[0x0];for(const [_0x2c5c2f,_0x1cbca7]of Object[_0x1a5517(0xd9)](_0x33daf1)){let _0x1d278d=_0x1a5517(0xa7);if(typeof _0x1cbca7===_0x1a5517(0xdb))_0x1d278d=Number[_0x1a5517(0xac)](_0x1cbca7)?_0x1a5517(0xa2):_0x1a5517(0xb7);else{if(typeof _0x1cbca7==='boolean')_0x1d278d=_0x1a5517(0xb6);else _0x1cbca7===null&&(_0x1d278d=_0x1a5517(0xa7));}_0x834c2b[_0x1a5517(0xd3)]({'name':_0x2c5c2f,'type':_0x1d278d});}}return{'queryId':_0x1a5517(0xb1),'columns':_0x834c2b,'data':_0xf373e9,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0xf373e9[_0x1a5517(0xe1)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x1cb56d,_0x4f3951){const _0x2439da=convertSDKResultToQueryResult(_0x1cb56d);return formatQueryOutput(_0x2439da,_0x4f3951);}export async function formatQueryOutput(_0x37c27f,_0x47d0a6){const _0x5bd665=a40_0x3e5f,{format:_0x278c0a,limit:_0x426261,output:_0x58dcc8,color:_0x5ca2d3,noColor:_0x2af0d7}=_0x47d0a6,_0x4a96b8=Boolean(_0x58dcc8)&&!_0x5ca2d3,_0x22c862={'color':_0x5ca2d3,'noColor':_0x2af0d7||_0x4a96b8};if(_0x278c0a===_0x5bd665(0xbc)){const _0x4dabd8=shouldUseLess(_0x278c0a,_0x58dcc8);return formatAsTable(_0x37c27f,_0x426261,_0x4dabd8,_0x22c862);}else{if(_0x278c0a===_0x5bd665(0xb9))return formatAsJSON(_0x37c27f,_0x22c862);else return _0x278c0a==='jsonl'?formatAsJSONL(_0x37c27f,_0x22c862):formatQueryResult(_0x37c27f,_0x278c0a);}}function shouldUseLess(_0x117540,_0x2784e1){const _0x4029d6=a40_0x3e5f;return _0x117540===_0x4029d6(0xbc)&&process[_0x4029d6(0xae)]['isTTY']&&!_0x2784e1;}export function resolveOutputOptions(_0xc7f40d){const _0x417ca7=a40_0x3e5f,_0x4c45cb=resolveOutputFormat(_0xc7f40d['format'],_0xc7f40d[_0x417ca7(0xe4)],_0x417ca7(0xbc));let _0x14f532=typeof _0xc7f40d[_0x417ca7(0xa0)]==='number'?_0xc7f40d[_0x417ca7(0xa0)]:parseInt(_0xc7f40d[_0x417ca7(0xa0)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x43fcb5=_0xc7f40d['output']||'';return shouldUseLess(_0x4c45cb,_0x43fcb5)&&(_0x14f532=Infinity),{'format':_0x4c45cb,'output':_0x43fcb5,'limit':_0x14f532,'color':_0xc7f40d[_0x417ca7(0xcd)],'noColor':_0xc7f40d[_0x417ca7(0xa1)]};}export function writeOutput(_0x50f498,_0x121a4a,_0x439065){const _0x23a24a=a40_0x3e5f;return _0x121a4a?(writeFileSync(_0x121a4a,_0x50f498),console[_0x23a24a(0xde)](_0x23a24a(0xdc)+_0x121a4a),Promise[_0x23a24a(0xa3)]()):shouldUseLess(_0x439065||'','')?new Promise(_0x50c00f=>{const _0x3da216=_0x23a24a,_0x5cdad1=spawn('less',['-FXRSn'],{'stdio':[_0x3da216(0xd6),_0x3da216(0xd8),_0x3da216(0xd8)]});let _0x5eac3a=![];_0x5cdad1['on'](_0x3da216(0xde),()=>{const _0x3e7905=_0x3da216;!_0x5eac3a&&(_0x5eac3a=!![],console[_0x3e7905(0xdf)](_0x50f498),_0x50c00f());}),_0x5cdad1['on'](_0x3da216(0xb4),()=>{!_0x5eac3a&&(_0x5eac3a=!![],_0x50c00f());}),_0x5cdad1['on'](_0x3da216(0xb5),()=>{const _0x1e8679=_0x3da216;!_0x5eac3a&&_0x5cdad1[_0x1e8679(0xaa)]&&(_0x5cdad1[_0x1e8679(0xaa)]['on'](_0x1e8679(0xde),()=>{}),_0x5cdad1['stdin']['write'](_0x50f498),_0x5cdad1[_0x1e8679(0xaa)][_0x1e8679(0xb8)]());}),!_0x5cdad1[_0x3da216(0xaa)]&&(!_0x5eac3a&&(_0x5eac3a=!![],console[_0x3da216(0xdf)](_0x50f498),_0x50c00f()));}):(console[_0x23a24a(0xdf)](_0x50f498),Promise[_0x23a24a(0xa3)]());}export async function handleSDKOutput(_0x3fac5e,_0x326888){const _0xe31b3c=a40_0x3e5f,_0x5eaa66=resolveOutputOptions(_0x326888),_0x35f05d=await formatSDKOutput(_0x3fac5e,_0x5eaa66);await writeOutput(_0x35f05d,_0x5eaa66[_0xe31b3c(0xe4)]||undefined,_0x5eaa66['format']);}export async function handleQueryOutput(_0x380788,_0x1a79d6){const _0x455870=a40_0x3e5f,_0x40df34=resolveOutputOptions(_0x1a79d6),_0x3a485f=await formatQueryOutput(_0x380788,_0x40df34);await writeOutput(_0x3a485f,_0x40df34[_0x455870(0xe4)]||undefined,_0x40df34[_0x455870(0xd7)]);}async function formatSingleObject(_0x2b2bd2,_0x3652c2){const _0x48331c=a40_0x3e5f,{format:_0x5f2e18,color:_0x34c490,noColor:_0x1f6b0c}=_0x3652c2,_0x579e28={'color':_0x34c490,'noColor':_0x1f6b0c};if(_0x5f2e18===_0x48331c(0xb9)){if(shouldUseColor(_0x579e28))return colorizeJSON(_0x2b2bd2,_0x579e28);return JSON[_0x48331c(0xda)](_0x2b2bd2,null,0x2);}else{if(_0x5f2e18==='jsonl'){if(shouldUseColor(_0x579e28))return colorizeJSONCompact(_0x2b2bd2,_0x579e28);return JSON[_0x48331c(0xda)](_0x2b2bd2);}else{if(_0x5f2e18===_0x48331c(0xba))return Object[_0x48331c(0xd9)](_0x2b2bd2)[_0x48331c(0xe5)](([_0x29cbbe,_0x248c37])=>_0x29cbbe+'\x09'+_0x248c37)['join']('\x0a');else{const _0xa50922=Object[_0x48331c(0xd9)](_0x2b2bd2);if(_0xa50922[_0x48331c(0xe1)]===0x0)return _0x48331c(0xc4);const _0x4cb974=_0x2b2bd2[_0x48331c(0xad)],_0x1d98dd=_0x2b2bd2['query'],_0x3ee1b8=_0x2b2bd2[_0x48331c(0xbd)],_0x35aa32=_0x2b2bd2[_0x48331c(0xc1)],_0x5a056d=_0x1d98dd?typeof _0x1d98dd===_0x48331c(0xd2)?_0x1d98dd:JSON[_0x48331c(0xda)](_0x1d98dd,null,0x2):undefined,_0x2d723d=_0x3ee1b8&&Object['keys'](_0x3ee1b8)['length']>0x0?JSON[_0x48331c(0xda)](_0x3ee1b8,null,0x2):undefined,_0x5bd0f1=_0x35aa32&&Object['keys'](_0x35aa32)[_0x48331c(0xe1)]>0x0?JSON[_0x48331c(0xda)](_0x35aa32,null,0x2):undefined,_0x55cd7d=_0xa50922[_0x48331c(0xab)](([_0x38da6a])=>_0x38da6a!==_0x48331c(0xad)&&_0x38da6a!==_0x48331c(0xb2)&&_0x38da6a!==_0x48331c(0xbd)&&_0x38da6a!=='rule'),_0x84afb2=Math['max'](..._0x55cd7d['map'](([_0x568cc4])=>_0x568cc4['length'])),_0x2ef430=Math['max'](..._0x55cd7d[_0x48331c(0xe5)](([,_0x108450])=>{const _0x4f689a=_0x48331c;try{const _0x49bacf=_0x108450===null||_0x108450===undefined?'':typeof _0x108450===_0x4f689a(0xa4)?JSON[_0x4f689a(0xda)](_0x108450):String(_0x108450),_0x309807=_0x49bacf['split']('\x0a');return Math['max'](..._0x309807[_0x4f689a(0xe5)](_0x32ae56=>_0x32ae56['length']),0x0);}catch{return 0x0;}}),0x14),_0xd7378f=[];_0xd7378f[_0x48331c(0xd3)](colorBorder('┌─'+'─'['repeat'](_0x84afb2)+_0x48331c(0xd4)+'─'[_0x48331c(0xc5)](_0x2ef430)+'─┐',_0x579e28)),_0x55cd7d[_0x48331c(0xce)](([_0x182020,_0x5f53eb])=>{const _0x43fbee=_0x48331c;let _0x2677d1;try{_0x2677d1=_0x5f53eb===null||_0x5f53eb===undefined?'':typeof _0x5f53eb==='object'?JSON['stringify'](_0x5f53eb):String(_0x5f53eb);}catch{_0x2677d1=_0x43fbee(0xc0);}const _0x44df2d=_0x182020['padEnd'](_0x84afb2),_0xce7856=_0x2677d1['split']('\x0a');_0xce7856[_0x43fbee(0xce)]((_0x4cea48,_0x261afb)=>{const _0x4d2803=_0x43fbee,_0x8affba=colorBorder('│',_0x579e28);_0x261afb===0x0?_0xd7378f[_0x4d2803(0xd3)](_0x8affba+'\x20'+_0x44df2d+'\x20'+_0x8affba+'\x20'+_0x4cea48['padEnd'](_0x2ef430)+'\x20'+_0x8affba):_0xd7378f[_0x4d2803(0xd3)](_0x8affba+'\x20'+'\x20'['repeat'](_0x84afb2)+'\x20'+_0x8affba+'\x20'+_0x4cea48[_0x4d2803(0xc9)](_0x2ef430)+'\x20'+_0x8affba);});}),_0xd7378f[_0x48331c(0xd3)](colorBorder('└─'+'─'[_0x48331c(0xc5)](_0x84afb2)+_0x48331c(0xa5)+'─'[_0x48331c(0xc5)](_0x2ef430)+'─┘',_0x579e28));_0x5a056d&&(_0xd7378f[_0x48331c(0xd3)](''),_0xd7378f[_0x48331c(0xd3)](String(a40_0x423a01['yellow'][_0x48331c(0xcb)](_0x48331c(0xa6)))),_0xd7378f[_0x48331c(0xd3)](_0x5a056d));_0x2d723d&&(_0xd7378f[_0x48331c(0xd3)](''),_0xd7378f[_0x48331c(0xd3)](String(a40_0x423a01[_0x48331c(0xb3)][_0x48331c(0xcb)](_0x48331c(0xc2)))),_0xd7378f['push'](_0x2d723d));_0x5bd0f1&&(_0xd7378f[_0x48331c(0xd3)](''),_0xd7378f['push'](String(a40_0x423a01[_0x48331c(0xbe)][_0x48331c(0xcb)]('[rule]'))),_0xd7378f[_0x48331c(0xd3)](_0x5bd0f1));if(_0x4cb974){if(_0x4cb974[_0x48331c(0xa8)]){_0xd7378f[_0x48331c(0xd3)](''),_0xd7378f['push'](String(a40_0x423a01[_0x48331c(0xc8)][_0x48331c(0xcb)](_0x48331c(0xaf))));const _0x1da3bf=_0x4cb974[_0x48331c(0xa8)][_0x48331c(0xd0)]('\x0a');_0x1da3bf[_0x48331c(0xce)](_0x5258dc=>{const _0x306bb0=_0x48331c;_0x5258dc[_0x306bb0(0xa9)]()&&_0xd7378f[_0x306bb0(0xd3)](_0x5258dc);});}if(_0x4cb974['cmdout']){_0xd7378f[_0x48331c(0xd3)](''),_0xd7378f[_0x48331c(0xd3)](String(a40_0x423a01[_0x48331c(0xc3)][_0x48331c(0xcb)](_0x48331c(0xc6))));const _0x54dc92=_0x4cb974[_0x48331c(0xdd)][_0x48331c(0xd0)]('\x0a');_0x54dc92[_0x48331c(0xce)](_0x562e84=>{const _0x2a5945=_0x48331c;_0x562e84['trim']()&&_0xd7378f[_0x2a5945(0xd3)](_0x562e84);});}}return _0xd7378f[_0x48331c(0xbb)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x39abf8,_0x4c1168){const _0x4a277b=a40_0x3e5f;if(_0x4c1168[_0x4a277b(0xd7)]==='table'){await handleSDKOutput([_0x39abf8],_0x4c1168);return;}const _0x3ad2f7=resolveOutputOptions(_0x4c1168),_0x6c793=await formatSingleObject(_0x39abf8,_0x3ad2f7);await writeOutput(_0x6c793,_0x3ad2f7[_0x4a277b(0xe4)]||undefined,_0x3ad2f7[_0x4a277b(0xd7)]);}
@@ -1 +1 @@
1
- (function(_0x99bdb8,_0x51c578){const _0x4826d9=a41_0x5ec1,_0x403bb0=_0x99bdb8();while(!![]){try{const _0x557180=-parseInt(_0x4826d9(0x187))/0x1+-parseInt(_0x4826d9(0x181))/0x2+parseInt(_0x4826d9(0x15b))/0x3*(-parseInt(_0x4826d9(0x14c))/0x4)+-parseInt(_0x4826d9(0x151))/0x5+parseInt(_0x4826d9(0x191))/0x6*(-parseInt(_0x4826d9(0x171))/0x7)+parseInt(_0x4826d9(0x14f))/0x8*(parseInt(_0x4826d9(0x158))/0x9)+-parseInt(_0x4826d9(0x196))/0xa*(-parseInt(_0x4826d9(0x172))/0xb);if(_0x557180===_0x51c578)break;else _0x403bb0['push'](_0x403bb0['shift']());}catch(_0x2a80b6){_0x403bb0['push'](_0x403bb0['shift']());}}}(a41_0x5ae4,0xebe32));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a41_0x141d83 from'node:fs';import*as a41_0x4cecec from'node:path';import{SITE_ALIASES}from'../sdk/types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a41_0x5244a1 from'chalk';export function getConfigDir(){return process['env']['TDX_CONFIG_DIR']||join(homedir(),'.config','tdx');}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getConfigFilePath(_0x1b8830){const _0x1ae03a=a41_0x5ec1,_0x587ea3=getConfigDir();return _0x1b8830?a41_0x4cecec[_0x1ae03a(0x179)](_0x587ea3,_0x1ae03a(0x197)+_0x1b8830):getConfigFile();}export function getCacheDir(){return process['env']['TDX_CACHE_DIR']||join(homedir(),'.cache','tdx');}export function getLLMProjectCacheFile(_0x47d360){const _0x46c867=a41_0x5ec1,_0x2d565e=_0x47d360?'llm_default_project.'+_0x47d360:_0x46c867(0x17a);return join(getCacheDir(),_0x2d565e);}export function readCachedLLMProject(_0x555fc5){const _0x287ca8=a41_0x5ec1;try{const _0x3281df=getLLMProjectCacheFile(_0x555fc5);if(!existsSync(_0x3281df))return null;const _0x34d128=readFileSync(_0x3281df,'utf-8')[_0x287ca8(0x165)]();try{const _0x59a9b5=JSON[_0x287ca8(0x194)](_0x34d128);if(_0x59a9b5&&typeof _0x59a9b5['id']===_0x287ca8(0x185)&&typeof _0x59a9b5[_0x287ca8(0x162)]===_0x287ca8(0x185))return _0x59a9b5;}catch{}return null;}catch{return null;}}function a41_0x5ec1(_0xb538a6,_0x5b9095){_0xb538a6=_0xb538a6-0x147;const _0x5ae454=a41_0x5ae4();let _0x5ec1e4=_0x5ae454[_0xb538a6];return _0x5ec1e4;}export function writeCachedLLMProject(_0x8396b9,_0x8a28af,_0x3343ae){const _0x9d10eb=a41_0x5ec1;try{const _0x2e9b4f=getCacheDir(),_0xd39677=getLLMProjectCacheFile(_0x3343ae);!existsSync(_0x2e9b4f)&&mkdirSync(_0x2e9b4f,{'recursive':!![]});const _0x512ae1={'name':_0x8396b9,'id':_0x8a28af};writeFileSync(_0xd39677,JSON[_0x9d10eb(0x14a)](_0x512ae1),_0x9d10eb(0x176));}catch{}}export function getLLMAgentCacheFile(_0x1fd800){const _0x399a4a=a41_0x5ec1,_0x1c7c41=_0x1fd800?_0x399a4a(0x195)+_0x1fd800:_0x399a4a(0x149);return join(getCacheDir(),_0x1c7c41);}export function readCachedLLMAgent(_0x59feb8){const _0x211060=a41_0x5ec1;try{const _0x49bb51=getLLMAgentCacheFile(_0x59feb8);if(!existsSync(_0x49bb51))return null;const _0x4097c0=readFileSync(_0x49bb51,_0x211060(0x176))[_0x211060(0x165)]();try{const _0x213196=JSON[_0x211060(0x194)](_0x4097c0);if(_0x213196&&typeof _0x213196['id']==='string'&&typeof _0x213196[_0x211060(0x162)]===_0x211060(0x185)&&typeof _0x213196[_0x211060(0x16b)]===_0x211060(0x185))return _0x213196;}catch{}return null;}catch{return null;}}export function writeCachedLLMAgent(_0x23d20a,_0x421153,_0x1a5472,_0x1be2b1){const _0xfe1470=a41_0x5ec1;try{const _0x2b305a=getCacheDir(),_0x12ebee=getLLMAgentCacheFile(_0x1be2b1);!existsSync(_0x2b305a)&&mkdirSync(_0x2b305a,{'recursive':!![]});const _0x2f8218={'name':_0x23d20a,'id':_0x421153,'projectId':_0x1a5472};writeFileSync(_0x12ebee,JSON[_0xfe1470(0x14a)](_0x2f8218),_0xfe1470(0x176));}catch{}}export function clearCachedLLMAgent(_0x5bb859){try{const _0x26146e=getLLMAgentCacheFile(_0x5bb859);existsSync(_0x26146e)&&unlinkSync(_0x26146e);}catch{}}export function getAccountInfoCacheFile(_0x42446c){const _0x529c34=a41_0x5ec1,_0x40d317=_0x42446c?'account_info.'+_0x42446c+_0x529c34(0x18b):_0x529c34(0x17d);return join(getCacheDir(),_0x40d317);}export function readCachedAccountInfo(_0x2d32fa){const _0x378f3e=a41_0x5ec1;try{const _0x4179be=getAccountInfoCacheFile(_0x2d32fa);if(!existsSync(_0x4179be))return null;const _0x1114eb=readFileSync(_0x4179be,_0x378f3e(0x176))[_0x378f3e(0x165)](),_0x451529=JSON[_0x378f3e(0x194)](_0x1114eb);if(_0x451529&&typeof _0x451529['site']===_0x378f3e(0x185)&&typeof _0x451529['accountId']===_0x378f3e(0x14d))return _0x451529;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x1d7c91,_0xf829a3,_0x10454e){const _0xe5272=a41_0x5ec1;try{const _0x160c06=getCacheDir(),_0x120246=getAccountInfoCacheFile(_0x10454e);!existsSync(_0x160c06)&&mkdirSync(_0x160c06,{'recursive':!![]});const _0x26454d={'site':_0x1d7c91,'accountId':_0xf829a3,'cachedAt':new Date()[_0xe5272(0x174)]()};writeFileSync(_0x120246,JSON[_0xe5272(0x14a)](_0x26454d),_0xe5272(0x176));}catch{}}export function parseEnvFile(_0x1eb02d){const _0x1f3334=a41_0x5ec1,_0x30427d={};for(const _0x1feba4 of _0x1eb02d[_0x1f3334(0x16f)]('\x0a')){const _0x35cd8e=_0x1feba4[_0x1f3334(0x165)]();if(!_0x35cd8e||_0x35cd8e[_0x1f3334(0x164)]('#'))continue;const _0x3bad2b=_0x35cd8e[_0x1f3334(0x16d)](/^([^=]+)=(.*)$/);if(_0x3bad2b){const _0x3b41c7=_0x3bad2b[0x1][_0x1f3334(0x165)]();let _0x219413=_0x3bad2b[0x2][_0x1f3334(0x165)]();(_0x219413[_0x1f3334(0x164)]('\x22')&&_0x219413[_0x1f3334(0x177)]('\x22')||_0x219413[_0x1f3334(0x164)]('\x27')&&_0x219413[_0x1f3334(0x177)]('\x27'))&&(_0x219413=_0x219413[_0x1f3334(0x15e)](0x1,-0x1)),_0x30427d[_0x3b41c7]=_0x219413;}}return _0x30427d;}export function readUserConfig(){const _0x16dab8=a41_0x5ec1,_0x1e9a50=getConfigFile();if(!existsSync(_0x1e9a50))return{};try{const _0x3503f5=readFileSync(_0x1e9a50,'utf-8');return parseEnvFile(_0x3503f5);}catch(_0x2c2d37){return console[_0x16dab8(0x153)](_0x16dab8(0x186)+_0x1e9a50+':',_0x2c2d37),{};}}export function resolveSite(_0x358066){const _0x44b554=a41_0x5ec1,_0x1e1c96=[_0x44b554(0x189),_0x44b554(0x178),_0x44b554(0x16c),_0x44b554(0x14b),_0x44b554(0x15c),'dev-us01',_0x44b554(0x182),_0x44b554(0x157),_0x44b554(0x14e),'stg-ap03'];if(_0x1e1c96['includes'](_0x358066))return _0x358066;if(_0x358066 in SITE_ALIASES)return SITE_ALIASES[_0x358066];return console[_0x44b554(0x153)](_0x44b554(0x180)+_0x358066+_0x44b554(0x193)),_0x44b554(0x189);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x535551,_0x16c067){const _0x2a8255=a41_0x5ec1,_0x5282b8=_0x16c067||getActiveProfileName();if(_0x5282b8){const _0x1d9829=_0x2a8255(0x18d)+normalizeProfileForEnvVar(_0x5282b8);if(process[_0x2a8255(0x192)][_0x1d9829])return process['env'][_0x1d9829];}if(process[_0x2a8255(0x192)][_0x2a8255(0x190)])return process[_0x2a8255(0x192)]['TDX_API_KEY'];if(process[_0x2a8255(0x192)]['TD_API_KEY'])return process[_0x2a8255(0x192)]['TD_API_KEY'];const _0x290ba3=_0x535551[_0x2a8255(0x17b)]()[_0x2a8255(0x156)](/-/g,'_'),_0x147304='TD_API_KEY_'+_0x290ba3;if(_0x5282b8){const _0x530d1b=loadProfileEnv(_0x5282b8);if(_0x530d1b){if(_0x530d1b[_0x147304])return _0x530d1b[_0x147304];if(_0x530d1b[_0x2a8255(0x147)])return _0x530d1b[_0x2a8255(0x147)];}}const _0x5f271a=loadUserConfigOnce();if(_0x5f271a[_0x147304])return _0x5f271a[_0x147304];if(_0x5f271a[_0x2a8255(0x147)])return _0x5f271a[_0x2a8255(0x147)];return undefined;}export function normalizeProfileForEnvVar(_0x4526e5){const _0xaa7328=a41_0x5ec1;return _0x4526e5[_0xaa7328(0x17b)]()['replace'](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x4c6812,_0x53de2a){const _0x58bb1f=a41_0x5ec1,_0xe11b16=_0x53de2a||getActiveProfileName()||undefined;if(_0xe11b16){const _0x5eb4f7=_0x58bb1f(0x18d)+normalizeProfileForEnvVar(_0xe11b16);if(process[_0x58bb1f(0x192)][_0x5eb4f7])return{'apiKey':process[_0x58bb1f(0x192)][_0x5eb4f7],'source':_0x5eb4f7+'\x20env\x20var','isDeprecated':![]};const _0x5b4361=getCachedCredential(_0x4c6812,_0xe11b16);if(_0x5b4361)return{'apiKey':_0x5b4361,'source':_0x58bb1f(0x159)+_0xe11b16+')','isDeprecated':![]};const _0x539a4e=await getKeychainAPIKey(_0xe11b16);if(_0x539a4e)return setCachedCredential(_0x539a4e,_0x4c6812,_0xe11b16),{'apiKey':_0x539a4e,'source':'keychain\x20(profile:\x20'+_0xe11b16+')','isDeprecated':![]};}if(process[_0x58bb1f(0x192)][_0x58bb1f(0x190)])return{'apiKey':process[_0x58bb1f(0x192)][_0x58bb1f(0x190)],'source':_0x58bb1f(0x154),'isDeprecated':![]};if(!_0xe11b16){const _0x4841b8=getCachedCredential(_0x4c6812,undefined);if(_0x4841b8)return{'apiKey':_0x4841b8,'source':_0x58bb1f(0x163),'isDeprecated':![]};const _0x2613f9=await getKeychainAPIKey(undefined);if(_0x2613f9)return setCachedCredential(_0x2613f9,_0x4c6812,undefined),{'apiKey':_0x2613f9,'source':_0x58bb1f(0x163),'isDeprecated':![]};}if(process[_0x58bb1f(0x192)][_0x58bb1f(0x147)])return{'apiKey':process[_0x58bb1f(0x192)][_0x58bb1f(0x147)],'source':_0x58bb1f(0x148),'isDeprecated':!![]};const _0x82081a=getLegacyEnvAPIKey(_0x4c6812,_0xe11b16);if(_0x82081a){const _0x563dd2=await isKeychainAvailable();if(_0x563dd2)try{await saveKeychainAPIKey(_0x82081a,_0xe11b16),setCachedCredential(_0x82081a,_0x4c6812,_0xe11b16);const _0x225084=getConfigFilePath(_0xe11b16);cleanupLegacyEnvFile(_0x225084)&&console[_0x58bb1f(0x153)](a41_0x5244a1[_0x58bb1f(0x16e)](_0x58bb1f(0x168)));}catch(_0x2e6e06){console[_0x58bb1f(0x153)](a41_0x5244a1[_0x58bb1f(0x16e)](_0x58bb1f(0x18c)+_0x2e6e06));}const _0x26369e=_0xe11b16?_0x58bb1f(0x166)+_0xe11b16+')':_0x58bb1f(0x17f);return{'apiKey':_0x82081a,'source':_0x26369e,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x499dc7,_0x38a928,_0x5a61cd=!![]){const _0x27dc21=a41_0x5ec1,_0x2c6579=await resolveAPIKeyAsync(_0x499dc7,_0x38a928);if(!_0x2c6579)return undefined;if(_0x5a61cd&&_0x2c6579[_0x27dc21(0x152)]&&_0x2c6579['source'][_0x27dc21(0x15f)]('TD_API_KEY')){const _0x5d9533=_0x38a928||getActiveProfileName()||undefined,_0x4d0c4c=_0x5d9533?'TDX_API_KEY_'+normalizeProfileForEnvVar(_0x5d9533):_0x27dc21(0x15d);console[_0x27dc21(0x153)](a41_0x5244a1[_0x27dc21(0x16e)]('Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a'+(_0x27dc21(0x17c)+_0x4d0c4c+').')));}return _0x2c6579[_0x27dc21(0x184)];}function getLegacyEnvAPIKey(_0x2b167b,_0x522bc1){const _0x5a89f1=a41_0x5ec1,_0x5b2be8=_0x2b167b[_0x5a89f1(0x17b)]()[_0x5a89f1(0x156)](/-/g,'_'),_0x476699='TD_API_KEY_'+_0x5b2be8;if(_0x522bc1){const _0x565910=loadProfileEnv(_0x522bc1);if(_0x565910){if(_0x565910[_0x476699])return _0x565910[_0x476699];if(_0x565910['TD_API_KEY'])return _0x565910[_0x5a89f1(0x147)];}}const _0x475bd6=loadUserConfigOnce();if(_0x475bd6[_0x476699])return _0x475bd6[_0x476699];if(_0x475bd6[_0x5a89f1(0x147)])return _0x475bd6['TD_API_KEY'];return undefined;}function a41_0x5ae4(){const _0x515e33=['llm_default_agent.','2888790ljZoRh','.env.','TD_API_KEY','TD_API_KEY\x20env\x20var\x20(deprecated)','llm_default_agent','stringify','ap02','353048LTqbJu','number','stg-jp01','11334168XBFqzu','filter','4397840ASuEnt','isDeprecated','warn','TDX_API_KEY\x20env\x20var','tdx.json','replace','stg-us01','9EWMTBQ','keychain\x20(profile:\x20','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','24RkbbVs','ap03','TDX_API_KEY_<PROFILE>','slice','includes','apiKeys','entries','name','keychain','startsWith','trim','legacy\x20.env\x20file\x20(profile:\x20','TD_API_KEY_','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','.env','profiles','projectId','eu01','match','yellow','split','some','3997DhOspf','165mcnaZb','stg-ap03','toISOString','existsSync','utf-8','endsWith','jp01','join','llm_default_project','toUpperCase','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','account_info.json','dev-us01','legacy\x20.env\x20file','Warning:\x20Unknown\x20site\x20\x27','782370LJQNqb','dev-eu01','readFileSync','apiKey','string','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','1680330IDREph','Warning:\x20Failed\x20to\x20load\x20','us01','Warning:\x20Failed\x20to\x20read\x20','.json','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','TDX_API_KEY_','profile','map','TDX_API_KEY','11838NhgMDa','env','\x27,\x20defaulting\x20to\x20us01','parse'];a41_0x5ae4=function(){return _0x515e33;};return a41_0x5ae4();}function cleanupLegacyEnvFile(_0x2ec346){const _0x4b160e=a41_0x5ec1;if(!existsSync(_0x2ec346))return![];try{const _0x2b7bc3=readFileSync(_0x2ec346,_0x4b160e(0x176)),_0x343caa=_0x2b7bc3[_0x4b160e(0x16f)]('\x0a'),_0x33b4a7=_0x343caa[_0x4b160e(0x150)](_0x46e8f6=>{const _0x58b08d=_0x4b160e,_0x408aee=_0x46e8f6[_0x58b08d(0x165)]();if(!_0x408aee||_0x408aee[_0x58b08d(0x164)]('#'))return!![];const [_0x38d3ec]=_0x408aee[_0x58b08d(0x16f)]('=');return!_0x38d3ec['startsWith']('TD_API_KEY');}),_0x293dac=_0x33b4a7[_0x4b160e(0x170)](_0x4c59ad=>{const _0x3e8e47=_0x4b160e,_0x1e7110=_0x4c59ad['trim']();return _0x1e7110&&!_0x1e7110[_0x3e8e47(0x164)]('#');});if(!_0x293dac)return unlinkSync(_0x2ec346),!![];return writeFileSync(_0x2ec346,_0x33b4a7[_0x4b160e(0x179)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x36c520){const _0x18b927=a41_0x5ec1,_0x330ea5=a41_0x4cecec['join'](getConfigDir(),_0x18b927(0x197)+_0x36c520);if(a41_0x141d83[_0x18b927(0x175)](_0x330ea5)){validateSecureFilePermissions(_0x330ea5);try{const _0x417b6c=a41_0x141d83['readFileSync'](_0x330ea5,_0x18b927(0x176));return parseEnvFile(_0x417b6c);}catch(_0x139948){console[_0x18b927(0x153)](_0x18b927(0x188)+_0x330ea5+':\x20'+_0x139948);}}const _0x30f670=a41_0x4cecec['join'](getConfigDir(),_0x18b927(0x16a),_0x36c520,_0x18b927(0x169));if(a41_0x141d83[_0x18b927(0x175)](_0x30f670)){validateSecureFilePermissions(_0x30f670);try{const _0x1f215a=a41_0x141d83['readFileSync'](_0x30f670,_0x18b927(0x176));return parseEnvFile(_0x1f215a);}catch(_0x5e1d44){return console[_0x18b927(0x153)](_0x18b927(0x188)+_0x30f670+':\x20'+_0x5e1d44),null;}}return null;}function getActiveProfileName(){const _0xff5c5=a41_0x5ec1,_0x4e0a6a=a41_0x4cecec[_0xff5c5(0x179)](getConfigDir(),_0xff5c5(0x155));if(!a41_0x141d83[_0xff5c5(0x175)](_0x4e0a6a))return null;try{const _0x2f4b9c=a41_0x141d83[_0xff5c5(0x183)](_0x4e0a6a,'utf-8'),_0x31c9cc=JSON[_0xff5c5(0x194)](_0x2f4b9c);return _0x31c9cc[_0xff5c5(0x18e)]||null;}catch{return null;}}export function saveAPIKey(_0x2e59db,_0x3fa367,_0x39f627){const _0x1bfd10=a41_0x5ec1,_0x55c93c=getConfigDir(),_0x573091=getConfigFilePath(_0x39f627);!existsSync(_0x55c93c)&&mkdirSync(_0x55c93c,{'recursive':!![],'mode':0x1c0});let _0x4d41b6={};if(existsSync(_0x573091))try{const _0x3a6042=readFileSync(_0x573091,_0x1bfd10(0x176));_0x4d41b6=parseEnvFile(_0x3a6042);}catch(_0x19de8d){console['warn'](_0x1bfd10(0x18a)+_0x573091+':',_0x19de8d);}const _0x37ed71=_0x2e59db[_0x1bfd10(0x17b)]()[_0x1bfd10(0x156)](/-/g,'_');_0x4d41b6[_0x1bfd10(0x167)+_0x37ed71]=_0x3fa367;const _0x1a1e5f=Object[_0x1bfd10(0x161)](_0x4d41b6)[_0x1bfd10(0x18f)](([_0x5c5ae4,_0x478268])=>_0x5c5ae4+'='+_0x478268);writeFileSync(_0x573091,_0x1a1e5f[_0x1bfd10(0x179)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x57498b,_0x4243fc,_0x353d23){const _0x405609=a41_0x5ec1;await saveKeychainAPIKey(_0x57498b,_0x353d23),setCachedCredential(_0x57498b,_0x4243fc,_0x353d23);const _0x203a2c=getConfigFilePath(_0x353d23);cleanupLegacyEnvFile(_0x203a2c)&&console['warn'](a41_0x5244a1['yellow'](_0x405609(0x15a)));}export function loadConfig(){const _0x17d6d8=a41_0x5ec1,_0x2f6dc8={'apiKeys':{},'defaultSite':_0x17d6d8(0x189)},_0x13ee99=['us01',_0x17d6d8(0x178),_0x17d6d8(0x16c),_0x17d6d8(0x14b),_0x17d6d8(0x15c),_0x17d6d8(0x17e),_0x17d6d8(0x182),_0x17d6d8(0x157),'stg-jp01',_0x17d6d8(0x173)];for(const _0x25e955 of _0x13ee99){const _0x585e4d=getAPIKey(_0x25e955);_0x585e4d&&(_0x2f6dc8[_0x17d6d8(0x160)][_0x25e955]=_0x585e4d);}return _0x2f6dc8;}
1
+ (function(_0x34ce87,_0x1b9586){const _0x40cb84=a41_0x1941,_0x3974a7=_0x34ce87();while(!![]){try{const _0x23bf76=-parseInt(_0x40cb84(0x190))/0x1+parseInt(_0x40cb84(0x180))/0x2*(parseInt(_0x40cb84(0x18d))/0x3)+-parseInt(_0x40cb84(0x18c))/0x4*(parseInt(_0x40cb84(0x1a0))/0x5)+parseInt(_0x40cb84(0x187))/0x6*(-parseInt(_0x40cb84(0x19c))/0x7)+parseInt(_0x40cb84(0x1bc))/0x8+-parseInt(_0x40cb84(0x16e))/0x9+parseInt(_0x40cb84(0x177))/0xa*(parseInt(_0x40cb84(0x1b8))/0xb);if(_0x23bf76===_0x1b9586)break;else _0x3974a7['push'](_0x3974a7['shift']());}catch(_0x38b4b9){_0x3974a7['push'](_0x3974a7['shift']());}}}(a41_0x46e8,0x37fa0));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a41_0x47ecfc from'node:fs';import*as a41_0x1c58db from'node:path';import{SITE_ALIASES}from'../sdk/types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a41_0x260bf3 from'chalk';export function getConfigDir(){const _0x429a32=a41_0x1941;return process[_0x429a32(0x185)][_0x429a32(0x1bd)]||join(homedir(),_0x429a32(0x1a9),'tdx');}export function getConfigFile(){const _0x4af8b8=a41_0x1941;return join(getConfigDir(),_0x4af8b8(0x17b));}export function getConfigFilePath(_0x4a6c69){const _0x5db917=a41_0x1941,_0xc3f290=getConfigDir();return _0x4a6c69?a41_0x1c58db[_0x5db917(0x192)](_0xc3f290,_0x5db917(0x16d)+_0x4a6c69):getConfigFile();}function a41_0x1941(_0x341fa4,_0x2af9c7){_0x341fa4=_0x341fa4-0x16c;const _0x46e814=a41_0x46e8();let _0x19414=_0x46e814[_0x341fa4];return _0x19414;}export function getCacheDir(){const _0x176f3e=a41_0x1941;return process['env']['TDX_CACHE_DIR']||join(homedir(),_0x176f3e(0x1bb),_0x176f3e(0x199));}function a41_0x46e8(){const _0x1205f8=['TD_API_KEY_','stg-ap03','llm_default_project','tdx','readFileSync','account_info.json','784iMdeeL','\x20env\x20var','yellow','tdx.json','106225KrONyO','some','profiles','\x27,\x20defaulting\x20to\x20us01','ap02','warn','trim','startsWith','source','.config','legacy\x20.env\x20file','existsSync','stringify','endsWith','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','match','TD_API_KEY','Warning:\x20Failed\x20to\x20load\x20','apiKey','utf-8','projectId','profile','legacy\x20.env\x20file\x20(profile:\x20','keychain\x20(profile:\x20','921217wMyyOj','stg-jp01','keychain','.cache','1983200VjxHhN','TDX_CONFIG_DIR','name','.env.','863316uJzhWq','includes','llm_default_project.','us01','jp01','Warning:\x20Unknown\x20site\x20\x27','dev-us01','llm_default_agent','apiKeys','40JZiTNO','TDX_API_KEY','map','parse','.env','ap03','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','entries','filter','103364twTXvW','split','replace','Warning:\x20Failed\x20to\x20read\x20','account_info.','env','TD_API_KEY\x20env\x20var\x20(deprecated)','15720ZadgHT','site','stg-us01','eu01','string','16tzTOuQ','9GHzjRs','isDeprecated','dev-eu01','34310naUPZk','llm_default_agent.','join','TDX_API_KEY_','TDX_API_KEY\x20env\x20var','toUpperCase'];a41_0x46e8=function(){return _0x1205f8;};return a41_0x46e8();}export function getLLMProjectCacheFile(_0x362946){const _0x3db845=a41_0x1941,_0xe0bb0d=_0x362946?_0x3db845(0x170)+_0x362946:_0x3db845(0x198);return join(getCacheDir(),_0xe0bb0d);}export function readCachedLLMProject(_0x1f2125){const _0xd747ea=a41_0x1941;try{const _0x2395d9=getLLMProjectCacheFile(_0x1f2125);if(!existsSync(_0x2395d9))return null;const _0x1a3d19=readFileSync(_0x2395d9,_0xd747ea(0x1b3))['trim']();try{const _0x2ab1e9=JSON['parse'](_0x1a3d19);if(_0x2ab1e9&&typeof _0x2ab1e9['id']==='string'&&typeof _0x2ab1e9[_0xd747ea(0x16c)]===_0xd747ea(0x18b))return _0x2ab1e9;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x323b43,_0x57a544,_0x4a7fc2){const _0x13e90d=a41_0x1941;try{const _0x140901=getCacheDir(),_0x3397fc=getLLMProjectCacheFile(_0x4a7fc2);!existsSync(_0x140901)&&mkdirSync(_0x140901,{'recursive':!![]});const _0x3ccfda={'name':_0x323b43,'id':_0x57a544};writeFileSync(_0x3397fc,JSON[_0x13e90d(0x1ac)](_0x3ccfda),_0x13e90d(0x1b3));}catch{}}export function getLLMAgentCacheFile(_0x2cbc98){const _0x5201a3=a41_0x1941,_0x1c3a4c=_0x2cbc98?_0x5201a3(0x191)+_0x2cbc98:_0x5201a3(0x175);return join(getCacheDir(),_0x1c3a4c);}export function readCachedLLMAgent(_0xde4ad){const _0x38333e=a41_0x1941;try{const _0x46302f=getLLMAgentCacheFile(_0xde4ad);if(!existsSync(_0x46302f))return null;const _0x2e7e2d=readFileSync(_0x46302f,'utf-8')['trim']();try{const _0x38c328=JSON[_0x38333e(0x17a)](_0x2e7e2d);if(_0x38c328&&typeof _0x38c328['id']===_0x38333e(0x18b)&&typeof _0x38c328[_0x38333e(0x16c)]===_0x38333e(0x18b)&&typeof _0x38c328[_0x38333e(0x1b4)]===_0x38333e(0x18b))return _0x38c328;}catch{}return null;}catch{return null;}}export function writeCachedLLMAgent(_0x10f93c,_0x477383,_0x44f7d8,_0x2256bb){const _0x1461e8=a41_0x1941;try{const _0x282f08=getCacheDir(),_0x1e982a=getLLMAgentCacheFile(_0x2256bb);!existsSync(_0x282f08)&&mkdirSync(_0x282f08,{'recursive':!![]});const _0x2ec408={'name':_0x10f93c,'id':_0x477383,'projectId':_0x44f7d8};writeFileSync(_0x1e982a,JSON['stringify'](_0x2ec408),_0x1461e8(0x1b3));}catch{}}export function clearCachedLLMAgent(_0x70e935){try{const _0x557fa9=getLLMAgentCacheFile(_0x70e935);existsSync(_0x557fa9)&&unlinkSync(_0x557fa9);}catch{}}export function getAccountInfoCacheFile(_0x4f087b){const _0x403c5c=a41_0x1941,_0xf19dcb=_0x4f087b?_0x403c5c(0x184)+_0x4f087b+'.json':_0x403c5c(0x19b);return join(getCacheDir(),_0xf19dcb);}export function readCachedAccountInfo(_0x5a194b){const _0x334913=a41_0x1941;try{const _0x40ca42=getAccountInfoCacheFile(_0x5a194b);if(!existsSync(_0x40ca42))return null;const _0x25e460=readFileSync(_0x40ca42,_0x334913(0x1b3))[_0x334913(0x1a6)](),_0x5a649b=JSON[_0x334913(0x17a)](_0x25e460);if(_0x5a649b&&typeof _0x5a649b[_0x334913(0x188)]==='string'&&typeof _0x5a649b['accountId']==='number')return _0x5a649b;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x439a26,_0x1dfd2c,_0x2308df){const _0x1e24ec=a41_0x1941;try{const _0x5e2a85=getCacheDir(),_0x6e15b6=getAccountInfoCacheFile(_0x2308df);!existsSync(_0x5e2a85)&&mkdirSync(_0x5e2a85,{'recursive':!![]});const _0xee34fa={'site':_0x439a26,'accountId':_0x1dfd2c,'cachedAt':new Date()['toISOString']()};writeFileSync(_0x6e15b6,JSON[_0x1e24ec(0x1ac)](_0xee34fa),_0x1e24ec(0x1b3));}catch{}}export function parseEnvFile(_0x501e59){const _0x48caad=a41_0x1941,_0x3944d5={};for(const _0x43c7da of _0x501e59[_0x48caad(0x181)]('\x0a')){const _0x4a0fc8=_0x43c7da[_0x48caad(0x1a6)]();if(!_0x4a0fc8||_0x4a0fc8[_0x48caad(0x1a7)]('#'))continue;const _0x255c7d=_0x4a0fc8[_0x48caad(0x1af)](/^([^=]+)=(.*)$/);if(_0x255c7d){const _0x5799c9=_0x255c7d[0x1][_0x48caad(0x1a6)]();let _0x35196a=_0x255c7d[0x2]['trim']();(_0x35196a[_0x48caad(0x1a7)]('\x22')&&_0x35196a[_0x48caad(0x1ad)]('\x22')||_0x35196a[_0x48caad(0x1a7)]('\x27')&&_0x35196a[_0x48caad(0x1ad)]('\x27'))&&(_0x35196a=_0x35196a['slice'](0x1,-0x1)),_0x3944d5[_0x5799c9]=_0x35196a;}}return _0x3944d5;}export function readUserConfig(){const _0x5807b2=a41_0x1941,_0xbd6704=getConfigFile();if(!existsSync(_0xbd6704))return{};try{const _0x97ee12=readFileSync(_0xbd6704,'utf-8');return parseEnvFile(_0x97ee12);}catch(_0x50c73b){return console[_0x5807b2(0x1a5)]('Warning:\x20Failed\x20to\x20read\x20config\x20file\x20'+_0xbd6704+':',_0x50c73b),{};}}export function resolveSite(_0x3635ee){const _0x37e462=a41_0x1941,_0x20423e=[_0x37e462(0x171),_0x37e462(0x172),_0x37e462(0x18a),'ap02','ap03',_0x37e462(0x174),_0x37e462(0x18f),_0x37e462(0x189),'stg-jp01',_0x37e462(0x197)];if(_0x20423e[_0x37e462(0x16f)](_0x3635ee))return _0x3635ee;if(_0x3635ee in SITE_ALIASES)return SITE_ALIASES[_0x3635ee];return console[_0x37e462(0x1a5)](_0x37e462(0x173)+_0x3635ee+_0x37e462(0x1a3)),_0x37e462(0x171);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x45a14f,_0x52a6d6){const _0x196c80=a41_0x1941,_0x4b76ad=_0x52a6d6||getActiveProfileName();if(_0x4b76ad){const _0xe54417=_0x196c80(0x193)+normalizeProfileForEnvVar(_0x4b76ad);if(process['env'][_0xe54417])return process['env'][_0xe54417];}if(process['env']['TDX_API_KEY'])return process[_0x196c80(0x185)]['TDX_API_KEY'];if(process[_0x196c80(0x185)][_0x196c80(0x1b0)])return process['env']['TD_API_KEY'];const _0x4b8c44=_0x45a14f[_0x196c80(0x195)]()[_0x196c80(0x182)](/-/g,'_'),_0x16892f='TD_API_KEY_'+_0x4b8c44;if(_0x4b76ad){const _0x1867d4=loadProfileEnv(_0x4b76ad);if(_0x1867d4){if(_0x1867d4[_0x16892f])return _0x1867d4[_0x16892f];if(_0x1867d4[_0x196c80(0x1b0)])return _0x1867d4[_0x196c80(0x1b0)];}}const _0x1874c5=loadUserConfigOnce();if(_0x1874c5[_0x16892f])return _0x1874c5[_0x16892f];if(_0x1874c5['TD_API_KEY'])return _0x1874c5[_0x196c80(0x1b0)];return undefined;}export function normalizeProfileForEnvVar(_0x156fe1){const _0x4b9f47=a41_0x1941;return _0x156fe1[_0x4b9f47(0x195)]()[_0x4b9f47(0x182)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x3487d3,_0x458c23){const _0x426212=a41_0x1941,_0x246e5f=_0x458c23||getActiveProfileName()||undefined;if(_0x246e5f){const _0x523560=_0x426212(0x193)+normalizeProfileForEnvVar(_0x246e5f);if(process[_0x426212(0x185)][_0x523560])return{'apiKey':process['env'][_0x523560],'source':_0x523560+_0x426212(0x19d),'isDeprecated':![]};const _0x46edc6=getCachedCredential(_0x3487d3,_0x246e5f);if(_0x46edc6)return{'apiKey':_0x46edc6,'source':_0x426212(0x1b7)+_0x246e5f+')','isDeprecated':![]};const _0x1a02c8=await getKeychainAPIKey(_0x246e5f);if(_0x1a02c8)return setCachedCredential(_0x1a02c8,_0x3487d3,_0x246e5f),{'apiKey':_0x1a02c8,'source':_0x426212(0x1b7)+_0x246e5f+')','isDeprecated':![]};}if(process[_0x426212(0x185)][_0x426212(0x178)])return{'apiKey':process['env'][_0x426212(0x178)],'source':_0x426212(0x194),'isDeprecated':![]};if(!_0x246e5f){const _0x560d33=getCachedCredential(_0x3487d3,undefined);if(_0x560d33)return{'apiKey':_0x560d33,'source':'keychain','isDeprecated':![]};const _0x495207=await getKeychainAPIKey(undefined);if(_0x495207)return setCachedCredential(_0x495207,_0x3487d3,undefined),{'apiKey':_0x495207,'source':_0x426212(0x1ba),'isDeprecated':![]};}if(process[_0x426212(0x185)][_0x426212(0x1b0)])return{'apiKey':process[_0x426212(0x185)][_0x426212(0x1b0)],'source':_0x426212(0x186),'isDeprecated':!![]};const _0x484ab4=getLegacyEnvAPIKey(_0x3487d3,_0x246e5f);if(_0x484ab4){const _0x3bc993=await isKeychainAvailable();if(_0x3bc993)try{await saveKeychainAPIKey(_0x484ab4,_0x246e5f),setCachedCredential(_0x484ab4,_0x3487d3,_0x246e5f);const _0x255dcc=getConfigFilePath(_0x246e5f);cleanupLegacyEnvFile(_0x255dcc)&&console[_0x426212(0x1a5)](a41_0x260bf3['yellow'](_0x426212(0x17d)));}catch(_0x1fca78){console[_0x426212(0x1a5)](a41_0x260bf3[_0x426212(0x19e)](_0x426212(0x1ae)+_0x1fca78));}const _0x5d5291=_0x246e5f?_0x426212(0x1b6)+_0x246e5f+')':_0x426212(0x1aa);return{'apiKey':_0x484ab4,'source':_0x5d5291,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x8dc943,_0x45c10b,_0xd9b880=!![]){const _0xc3a49c=a41_0x1941,_0x37ff3c=await resolveAPIKeyAsync(_0x8dc943,_0x45c10b);if(!_0x37ff3c)return undefined;if(_0xd9b880&&_0x37ff3c[_0xc3a49c(0x18e)]&&_0x37ff3c[_0xc3a49c(0x1a8)][_0xc3a49c(0x16f)]('TD_API_KEY')){const _0x23a4ca=_0x45c10b||getActiveProfileName()||undefined,_0x27b6e4=_0x23a4ca?'TDX_API_KEY_'+normalizeProfileForEnvVar(_0x23a4ca):'TDX_API_KEY_<PROFILE>';console[_0xc3a49c(0x1a5)](a41_0x260bf3[_0xc3a49c(0x19e)]('Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a'+('\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20'+_0x27b6e4+').')));}return _0x37ff3c[_0xc3a49c(0x1b2)];}function getLegacyEnvAPIKey(_0x4781df,_0x5ad3e5){const _0x2583d3=a41_0x1941,_0x2e0ade=_0x4781df[_0x2583d3(0x195)]()[_0x2583d3(0x182)](/-/g,'_'),_0x165aeb=_0x2583d3(0x196)+_0x2e0ade;if(_0x5ad3e5){const _0x2e13c2=loadProfileEnv(_0x5ad3e5);if(_0x2e13c2){if(_0x2e13c2[_0x165aeb])return _0x2e13c2[_0x165aeb];if(_0x2e13c2[_0x2583d3(0x1b0)])return _0x2e13c2[_0x2583d3(0x1b0)];}}const _0x3c7de6=loadUserConfigOnce();if(_0x3c7de6[_0x165aeb])return _0x3c7de6[_0x165aeb];if(_0x3c7de6[_0x2583d3(0x1b0)])return _0x3c7de6[_0x2583d3(0x1b0)];return undefined;}function cleanupLegacyEnvFile(_0x18b2ab){const _0x3ad3a5=a41_0x1941;if(!existsSync(_0x18b2ab))return![];try{const _0x3b7b6c=readFileSync(_0x18b2ab,'utf-8'),_0xf271dc=_0x3b7b6c['split']('\x0a'),_0x29a3b1=_0xf271dc[_0x3ad3a5(0x17f)](_0x5c2277=>{const _0x551046=_0x3ad3a5,_0x4bd7ae=_0x5c2277['trim']();if(!_0x4bd7ae||_0x4bd7ae[_0x551046(0x1a7)]('#'))return!![];const [_0x240d1f]=_0x4bd7ae[_0x551046(0x181)]('=');return!_0x240d1f[_0x551046(0x1a7)](_0x551046(0x1b0));}),_0x52f352=_0x29a3b1[_0x3ad3a5(0x1a1)](_0x437655=>{const _0x2d7618=_0x3ad3a5,_0xdee8aa=_0x437655[_0x2d7618(0x1a6)]();return _0xdee8aa&&!_0xdee8aa[_0x2d7618(0x1a7)]('#');});if(!_0x52f352)return unlinkSync(_0x18b2ab),!![];return writeFileSync(_0x18b2ab,_0x29a3b1['join']('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x5048e6){const _0x39463c=a41_0x1941,_0x56034b=a41_0x1c58db[_0x39463c(0x192)](getConfigDir(),_0x39463c(0x16d)+_0x5048e6);if(a41_0x47ecfc['existsSync'](_0x56034b)){validateSecureFilePermissions(_0x56034b);try{const _0x3b01a3=a41_0x47ecfc['readFileSync'](_0x56034b,_0x39463c(0x1b3));return parseEnvFile(_0x3b01a3);}catch(_0x43d86e){console[_0x39463c(0x1a5)](_0x39463c(0x1b1)+_0x56034b+':\x20'+_0x43d86e);}}const _0x43f9b7=a41_0x1c58db[_0x39463c(0x192)](getConfigDir(),_0x39463c(0x1a2),_0x5048e6,'.env');if(a41_0x47ecfc['existsSync'](_0x43f9b7)){validateSecureFilePermissions(_0x43f9b7);try{const _0x16ad4f=a41_0x47ecfc[_0x39463c(0x19a)](_0x43f9b7,_0x39463c(0x1b3));return parseEnvFile(_0x16ad4f);}catch(_0x562488){return console[_0x39463c(0x1a5)]('Warning:\x20Failed\x20to\x20load\x20'+_0x43f9b7+':\x20'+_0x562488),null;}}return null;}function getActiveProfileName(){const _0x1a09c4=a41_0x1941,_0x466839=a41_0x1c58db[_0x1a09c4(0x192)](getConfigDir(),_0x1a09c4(0x19f));if(!a41_0x47ecfc[_0x1a09c4(0x1ab)](_0x466839))return null;try{const _0x55bbd6=a41_0x47ecfc[_0x1a09c4(0x19a)](_0x466839,'utf-8'),_0x150c37=JSON[_0x1a09c4(0x17a)](_0x55bbd6);return _0x150c37[_0x1a09c4(0x1b5)]||null;}catch{return null;}}export function saveAPIKey(_0x4ba521,_0x405bee,_0x1a1375){const _0x28774f=a41_0x1941,_0xbb8bc1=getConfigDir(),_0x4847e3=getConfigFilePath(_0x1a1375);!existsSync(_0xbb8bc1)&&mkdirSync(_0xbb8bc1,{'recursive':!![],'mode':0x1c0});let _0x45b17d={};if(existsSync(_0x4847e3))try{const _0x5d9261=readFileSync(_0x4847e3,'utf-8');_0x45b17d=parseEnvFile(_0x5d9261);}catch(_0x297118){console[_0x28774f(0x1a5)](_0x28774f(0x183)+_0x4847e3+':',_0x297118);}const _0x52b533=_0x4ba521[_0x28774f(0x195)]()['replace'](/-/g,'_');_0x45b17d[_0x28774f(0x196)+_0x52b533]=_0x405bee;const _0xa9e851=Object[_0x28774f(0x17e)](_0x45b17d)[_0x28774f(0x179)](([_0x1af122,_0x187de8])=>_0x1af122+'='+_0x187de8);writeFileSync(_0x4847e3,_0xa9e851[_0x28774f(0x192)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x163853,_0x59f678,_0x411328){const _0xd5ea2=a41_0x1941;await saveKeychainAPIKey(_0x163853,_0x411328),setCachedCredential(_0x163853,_0x59f678,_0x411328);const _0x4a207f=getConfigFilePath(_0x411328);cleanupLegacyEnvFile(_0x4a207f)&&console[_0xd5ea2(0x1a5)](a41_0x260bf3['yellow']('⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file'));}export function loadConfig(){const _0x211122=a41_0x1941,_0x1b2a30={'apiKeys':{},'defaultSite':'us01'},_0x39eac3=['us01',_0x211122(0x172),_0x211122(0x18a),_0x211122(0x1a4),_0x211122(0x17c),'dev-us01',_0x211122(0x18f),_0x211122(0x189),_0x211122(0x1b9),_0x211122(0x197)];for(const _0x58b8c6 of _0x39eac3){const _0x10c29b=getAPIKey(_0x58b8c6);_0x10c29b&&(_0x1b2a30[_0x211122(0x176)][_0x58b8c6]=_0x10c29b);}return _0x1b2a30;}
@@ -1 +1 @@
1
- function a42_0x3fe4(){const _0x5342ee=['parse','16keFURf','40404hfeNEV','default','3415830kcOTKb','88MMELeQ','stringify','616315QHxWSP','connections','utf-8','161545tOLSJr','18761427psEpij','connections-','.json','2895305yeeRwA','618854AcLRVQ'];a42_0x3fe4=function(){return _0x5342ee;};return a42_0x3fe4();}(function(_0x1522a3,_0x38ea05){const _0x501d02=a42_0x69ed,_0x76fcac=_0x1522a3();while(!![]){try{const _0xf4d29c=-parseInt(_0x501d02(0x142))/0x1+-parseInt(_0x501d02(0x13a))/0x2+-parseInt(_0x501d02(0x13d))/0x3+parseInt(_0x501d02(0x140))/0x4*(parseInt(_0x501d02(0x145))/0x5)+-parseInt(_0x501d02(0x13f))/0x6+-parseInt(_0x501d02(0x149))/0x7*(parseInt(_0x501d02(0x13c))/0x8)+parseInt(_0x501d02(0x146))/0x9;if(_0xf4d29c===_0x38ea05)break;else _0x76fcac['push'](_0x76fcac['shift']());}catch(_0x2c1dc5){_0x76fcac['push'](_0x76fcac['shift']());}}}(a42_0x3fe4,0x70388));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';import{getCacheDir}from'./config.js';function a42_0x69ed(_0x7f4aa0,_0x2aca27){_0x7f4aa0=_0x7f4aa0-0x13a;const _0x3fe474=a42_0x3fe4();let _0x69ed52=_0x3fe474[_0x7f4aa0];return _0x69ed52;}function getCacheFilePath(_0x1749cd){const _0x1180c0=a42_0x69ed,_0x34529d=_0x1749cd||_0x1180c0(0x13e);return join(getCacheDir(),_0x1180c0(0x147)+_0x34529d+_0x1180c0(0x148));}export function loadCachedConnections(_0x3bc4f9){const _0x38a45a=a42_0x69ed,_0x15b448=getCacheFilePath(_0x3bc4f9);if(!existsSync(_0x15b448))return null;try{const _0x1abfe2=readFileSync(_0x15b448,_0x38a45a(0x144)),_0x2c416f=JSON[_0x38a45a(0x13b)](_0x1abfe2);return _0x2c416f[_0x38a45a(0x143)];}catch{return null;}}export function saveCachedConnections(_0x3e9ab3,_0x5cc6be){const _0x1cc7b0=a42_0x69ed,_0x46db87=getCacheDir();!existsSync(_0x46db87)&&mkdirSync(_0x46db87,{'recursive':!![]});const _0x4a62f3=getCacheFilePath(_0x3e9ab3),_0x208bdd={'connections':_0x5cc6be,'cachedAt':Date['now']()};writeFileSync(_0x4a62f3,JSON[_0x1cc7b0(0x141)](_0x208bdd,null,0x2),'utf-8');}export function clearConnectionCache(_0x570582){const _0x4af335=getCacheFilePath(_0x570582);if(existsSync(_0x4af335))try{unlinkSync(_0x4af335);}catch{}}
1
+ function a42_0x45c5(){const _0x4453de=['connections-','802770DNVfaJ','now','default','6TKPbDS','519XgdcWH','utf-8','489735rHEPUG','16VHlUqN','65420MTehyS','410752GoCTpv','.json','connections','372429NZRjkx','parse','1008511bAumBO','stringify','2260JDqqtP'];a42_0x45c5=function(){return _0x4453de;};return a42_0x45c5();}(function(_0x5ba975,_0x2dac71){const _0x4c6d06=a42_0x57f6,_0x28100b=_0x5ba975();while(!![]){try{const _0x176540=-parseInt(_0x4c6d06(0x16e))/0x1+parseInt(_0x4c6d06(0x16f))/0x2+-parseInt(_0x4c6d06(0x17c))/0x3*(-parseInt(_0x4c6d06(0x176))/0x4)+-parseInt(_0x4c6d06(0x16c))/0x5+parseInt(_0x4c6d06(0x17b))/0x6*(parseInt(_0x4c6d06(0x174))/0x7)+-parseInt(_0x4c6d06(0x16d))/0x8*(parseInt(_0x4c6d06(0x172))/0x9)+-parseInt(_0x4c6d06(0x178))/0xa;if(_0x176540===_0x2dac71)break;else _0x28100b['push'](_0x28100b['shift']());}catch(_0x2d1aa2){_0x28100b['push'](_0x28100b['shift']());}}}(a42_0x45c5,0x1d7d4));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';import{getCacheDir}from'./config.js';function getCacheFilePath(_0xad2b77){const _0x2de3b5=a42_0x57f6,_0x790f61=_0xad2b77||_0x2de3b5(0x17a);return join(getCacheDir(),_0x2de3b5(0x177)+_0x790f61+_0x2de3b5(0x170));}export function loadCachedConnections(_0xc86313){const _0x538213=a42_0x57f6,_0x475be4=getCacheFilePath(_0xc86313);if(!existsSync(_0x475be4))return null;try{const _0x43b1db=readFileSync(_0x475be4,'utf-8'),_0x41b632=JSON[_0x538213(0x173)](_0x43b1db);return _0x41b632[_0x538213(0x171)];}catch{return null;}}function a42_0x57f6(_0x3279d4,_0x5a3746){_0x3279d4=_0x3279d4-0x16c;const _0x45c5b4=a42_0x45c5();let _0x57f6b3=_0x45c5b4[_0x3279d4];return _0x57f6b3;}export function saveCachedConnections(_0xe4f7e1,_0x5a9346){const _0x34cd33=a42_0x57f6,_0x195362=getCacheDir();!existsSync(_0x195362)&&mkdirSync(_0x195362,{'recursive':!![]});const _0x60412a=getCacheFilePath(_0xe4f7e1),_0x2ccced={'connections':_0x5a9346,'cachedAt':Date[_0x34cd33(0x179)]()};writeFileSync(_0x60412a,JSON[_0x34cd33(0x175)](_0x2ccced,null,0x2),_0x34cd33(0x17d));}export function clearConnectionCache(_0x578854){const _0x23776b=getCacheFilePath(_0x578854);if(existsSync(_0x23776b))try{unlinkSync(_0x23776b);}catch{}}
@@ -1 +1 @@
1
- (function(_0x2b9b89,_0x247e85){const _0x140516=a43_0x43a1,_0x288d75=_0x2b9b89();while(!![]){try{const _0x285bf9=parseInt(_0x140516(0xd3))/0x1*(-parseInt(_0x140516(0xd2))/0x2)+-parseInt(_0x140516(0xd7))/0x3+-parseInt(_0x140516(0xd8))/0x4+-parseInt(_0x140516(0xd6))/0x5*(parseInt(_0x140516(0xd0))/0x6)+parseInt(_0x140516(0xd1))/0x7+-parseInt(_0x140516(0xd5))/0x8+parseInt(_0x140516(0xd4))/0x9;if(_0x285bf9===_0x247e85)break;else _0x288d75['push'](_0x288d75['shift']());}catch(_0x26ae3f){_0x288d75['push'](_0x288d75['shift']());}}}(a43_0x1149,0x45e49));export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;function a43_0x43a1(_0x148dc2,_0x1d3d1d){_0x148dc2=_0x148dc2-0xd0;const _0x114968=a43_0x1149();let _0x43a14e=_0x114968[_0x148dc2];return _0x43a14e;}export function resolveLimit(_0x1dd467,_0x8b8136){const _0x1091b9=a43_0x43a1;if(_0x1dd467===undefined)return _0x8b8136;if(typeof _0x1dd467===_0x1091b9(0xd9))return _0x1dd467;return parseInt(_0x1dd467,0xa);}function a43_0x1149(){const _0x4df944=['50HMagbY','1329843DXYIfW','1136452vmNeFB','number','36822lpukzt','2912812BqELNF','8WYmuFt','94138TsfMKL','9661347VKXcjV','304016gOxqKP'];a43_0x1149=function(){return _0x4df944;};return a43_0x1149();}
1
+ function a43_0x6bb8(_0x49fc27,_0x2d4866){_0x49fc27=_0x49fc27-0x141;const _0x13afda=a43_0x13af();let _0x6bb851=_0x13afda[_0x49fc27];return _0x6bb851;}(function(_0x5079bc,_0x244b0c){const _0x46f39f=a43_0x6bb8,_0x3db2f3=_0x5079bc();while(!![]){try{const _0x577952=-parseInt(_0x46f39f(0x147))/0x1+parseInt(_0x46f39f(0x145))/0x2+parseInt(_0x46f39f(0x148))/0x3+parseInt(_0x46f39f(0x141))/0x4+-parseInt(_0x46f39f(0x142))/0x5*(-parseInt(_0x46f39f(0x144))/0x6)+-parseInt(_0x46f39f(0x143))/0x7+-parseInt(_0x46f39f(0x146))/0x8;if(_0x577952===_0x244b0c)break;else _0x3db2f3['push'](_0x3db2f3['shift']());}catch(_0x24dd88){_0x3db2f3['push'](_0x3db2f3['shift']());}}}(a43_0x13af,0x1ea47));export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;function a43_0x13af(){const _0x479b5d=['861020adMEPc','295442nympeR','6wisvFC','167450loWxZO','1375752wktXVz','234170nPfRqz','232842UqmFfG','number','961252kLqrad'];a43_0x13af=function(){return _0x479b5d;};return a43_0x13af();}export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x3fface,_0x42d29b){const _0x348ab8=a43_0x6bb8;if(_0x3fface===undefined)return _0x42d29b;if(typeof _0x3fface===_0x348ab8(0x149))return _0x3fface;return parseInt(_0x3fface,0xa);}
@@ -1 +1 @@
1
- (function(_0x26ef2d,_0x227cf6){const _0x271816=a44_0x1094,_0x25d7f6=_0x26ef2d();while(!![]){try{const _0xd79140=-parseInt(_0x271816(0x163))/0x1+parseInt(_0x271816(0x15a))/0x2*(-parseInt(_0x271816(0x15d))/0x3)+parseInt(_0x271816(0x157))/0x4+parseInt(_0x271816(0x159))/0x5*(parseInt(_0x271816(0x155))/0x6)+-parseInt(_0x271816(0x160))/0x7+parseInt(_0x271816(0x161))/0x8+parseInt(_0x271816(0x15f))/0x9;if(_0xd79140===_0x227cf6)break;else _0x25d7f6['push'](_0x25d7f6['shift']());}catch(_0x3de63e){_0x25d7f6['push'](_0x25d7f6['shift']());}}}(a44_0x4c74,0xa9021));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x438447,_0x570d5a){const _0x585736=a44_0x1094,_0x5a1b12=_0x438447||_0x585736(0x164),_0x2e2389=_0x570d5a||'__default_profile__';return _0x5a1b12+':'+_0x2e2389;}export function getCachedCredential(_0xc4d750,_0x51e2f7){const _0x4472bb=a44_0x1094,_0x4c4aea=getCacheKey(_0xc4d750,_0x51e2f7),_0x527c8d=cache[_0x4472bb(0x15e)](_0x4c4aea);if(!_0x527c8d)return null;if(Date[_0x4472bb(0x15b)]()-_0x527c8d[_0x4472bb(0x158)]>CACHE_TTL_MS)return cache[_0x4472bb(0x156)](_0x4c4aea),null;return _0x527c8d[_0x4472bb(0x162)];}export function setCachedCredential(_0x347030,_0x571175,_0x728982){const _0x41560e=a44_0x1094,_0x4aad84=getCacheKey(_0x571175,_0x728982);cache['set'](_0x4aad84,{'apiKey':_0x347030,'loadedAt':Date[_0x41560e(0x15b)]()});}export function clearCredentialCache(){const _0x173542=a44_0x1094;cache[_0x173542(0x15c)]();}export function clearCachedCredential(_0x17fa51,_0x161b66){const _0x4b9e17=a44_0x1094,_0x2cabac=getCacheKey(_0x17fa51,_0x161b66);cache[_0x4b9e17(0x156)](_0x2cabac);}function a44_0x1094(_0x326241,_0x3df62d){_0x326241=_0x326241-0x155;const _0x4c746e=a44_0x4c74();let _0x109450=_0x4c746e[_0x326241];return _0x109450;}function a44_0x4c74(){const _0x3d9ab5=['__default_site__','406962XLyxdr','delete','2247600VlbOCA','loadedAt','20HlOkaM','14ATzcsg','now','clear','355731otgHQg','get','3066786QdSfiO','1152900ODSpzN','8725232AbEece','apiKey','577620PqYWTt'];a44_0x4c74=function(){return _0x3d9ab5;};return a44_0x4c74();}
1
+ function a44_0x200c(){const _0x1a1e3d=['692032EtOZmQ','12iSsHtY','now','5vYmzaG','2142497ZjpxVh','59564KEfUUR','set','apiKey','get','14850522IfxVAm','2823282hhwNAq','260jlzbJm','__default_profile__','delete','2099260OBVBpA','8PwRErQ','1654026BXNrEe'];a44_0x200c=function(){return _0x1a1e3d;};return a44_0x200c();}function a44_0x5c6b(_0x57b7af,_0x4a4ab8){_0x57b7af=_0x57b7af-0x12e;const _0x200c56=a44_0x200c();let _0x5c6bfd=_0x200c56[_0x57b7af];return _0x5c6bfd;}(function(_0x40eba5,_0x48ee8f){const _0x13b584=a44_0x5c6b,_0x16b4a8=_0x40eba5();while(!![]){try{const _0x448873=parseInt(_0x13b584(0x13b))/0x1*(-parseInt(_0x13b584(0x137))/0x2)+-parseInt(_0x13b584(0x12f))/0x3+-parseInt(_0x13b584(0x133))/0x4+-parseInt(_0x13b584(0x139))/0x5*(parseInt(_0x13b584(0x135))/0x6)+-parseInt(_0x13b584(0x13a))/0x7+-parseInt(_0x13b584(0x134))/0x8*(-parseInt(_0x13b584(0x12e))/0x9)+parseInt(_0x13b584(0x130))/0xa*(parseInt(_0x13b584(0x136))/0xb);if(_0x448873===_0x48ee8f)break;else _0x16b4a8['push'](_0x16b4a8['shift']());}catch(_0x3b1b30){_0x16b4a8['push'](_0x16b4a8['shift']());}}}(a44_0x200c,0xd705f));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x2b78a9,_0x59ced6){const _0x2173cc=a44_0x5c6b,_0x31ab0c=_0x2b78a9||'__default_site__',_0x4cae07=_0x59ced6||_0x2173cc(0x131);return _0x31ab0c+':'+_0x4cae07;}export function getCachedCredential(_0x296505,_0x2455ab){const _0x16d0d5=a44_0x5c6b,_0x465371=getCacheKey(_0x296505,_0x2455ab),_0xb47f00=cache[_0x16d0d5(0x13e)](_0x465371);if(!_0xb47f00)return null;if(Date[_0x16d0d5(0x138)]()-_0xb47f00['loadedAt']>CACHE_TTL_MS)return cache[_0x16d0d5(0x132)](_0x465371),null;return _0xb47f00[_0x16d0d5(0x13d)];}export function setCachedCredential(_0x4dc0e5,_0xebc030,_0x2f09e8){const _0x46a502=a44_0x5c6b,_0x941f37=getCacheKey(_0xebc030,_0x2f09e8);cache[_0x46a502(0x13c)](_0x941f37,{'apiKey':_0x4dc0e5,'loadedAt':Date[_0x46a502(0x138)]()});}export function clearCredentialCache(){cache['clear']();}export function clearCachedCredential(_0x5d6754,_0xa3974){const _0x1f5e92=a44_0x5c6b,_0x3c09be=getCacheKey(_0x5d6754,_0xa3974);cache[_0x1f5e92(0x132)](_0x3c09be);}
@@ -1 +1 @@
1
- const a45_0x2cc051=a45_0x1662;function a45_0x49e0(){const _0x344a39=['1798546RpHOHl','activeProfile','516wvaeIm','llmProject','parentSegment','loadGlobalConfig','session','llm_project','136tONlue','layers','apiKey','Profile','verbose','Session',':\x20none\x20(using\x20session:\x20','1oTjSnW','getParameters','segmentPath','toString','global','entries','1389717hLUGmY','site','2203870wnyjFT','profile:\x20','Profile\x20Credentials','config','displayWithSources','sessions','41756lzmHUT','.env','us01','5588394KBVVIf','existsSync','parent_segment','string','273693IjcNLo','54yIocak','project','tdx.json','globalCredentials','CLI\x20flag:\x20--','logLevel','join','resolveAPIKeyAsync','configFiles','.json','database','profiles','segment_path','llm_agent','sessionId','(active)','replace','readFileSync',':\x20none','5cicHjR','default','44724Vpmrbn','log','INFO','profile','[context]','\x0a[configuration\x20files]','cliFlags','parse','llmAgent'];a45_0x49e0=function(){return _0x344a39;};return a45_0x49e0();}(function(_0x527af1,_0x16593d){const _0x1113bc=a45_0x1662,_0x4c3dd4=_0x527af1();while(!![]){try{const _0x1ee965=-parseInt(_0x1113bc(0x1af))/0x1*(-parseInt(_0x1113bc(0x1a0))/0x2)+parseInt(_0x1113bc(0x1c5))/0x3*(parseInt(_0x1113bc(0x1da))/0x4)+-parseInt(_0x1113bc(0x1d8))/0x5*(parseInt(_0x1113bc(0x1c0))/0x6)+parseInt(_0x1113bc(0x1c4))/0x7*(parseInt(_0x1113bc(0x1a8))/0x8)+-parseInt(_0x1113bc(0x1b5))/0x9+-parseInt(_0x1113bc(0x1b7))/0xa+-parseInt(_0x1113bc(0x1bd))/0xb*(-parseInt(_0x1113bc(0x1a2))/0xc);if(_0x1ee965===_0x16593d)break;else _0x4c3dd4['push'](_0x4c3dd4['shift']());}catch(_0x17ffcf){_0x4c3dd4['push'](_0x4c3dd4['shift']());}}}(a45_0x49e0,0x97ea3));import{resolveSite,getAPIKey,getAPIKeyAsync,getConfigDir}from'./config.js';import{loadSessionContext,getCurrentSessionPID}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';import{getActiveProfile,loadProfile}from'./profile.js';import{LogLevel}from'../utils/tdx-logger.js';import*as a45_0x1342d4 from'node:fs';function a45_0x1662(_0x16887c,_0x483b79){_0x16887c=_0x16887c-0x1a0;const _0x49e0ae=a45_0x49e0();let _0x16627b=_0x49e0ae[_0x16887c];return _0x16627b;}import*as a45_0x1c0615 from'node:path';export class GlobalContext{[a45_0x2cc051(0x1b6)];[a45_0x2cc051(0x1cf)];[a45_0x2cc051(0x1c2)];[a45_0x2cc051(0x1d1)];['llm_project'];[a45_0x2cc051(0x1d2)];[a45_0x2cc051(0x1aa)];[a45_0x2cc051(0x1ac)];['logLevel'];[a45_0x2cc051(0x1dd)];['layers'];[a45_0x2cc051(0x1a1)];[a45_0x2cc051(0x1d3)];[a45_0x2cc051(0x1cd)];constructor(_0x544ae4){const _0x1b4957=a45_0x2cc051;this['sessionId']=_0x544ae4['session']||getCurrentSessionPID()[_0x1b4957(0x1b2)]();const _0x257019=loadSessionContext(_0x544ae4[_0x1b4957(0x1a6)]),_0x3df432=loadProjectConfig(),_0x4b04d7=this[_0x1b4957(0x1a5)]();this[_0x1b4957(0x1a1)]=_0x544ae4[_0x1b4957(0x1dd)]||_0x257019?.[_0x1b4957(0x1dd)]||_0x4b04d7[_0x1b4957(0x1dd)]||getActiveProfile();const _0x3c7490=this['activeProfile']?loadProfile(this[_0x1b4957(0x1a1)]):null,_0x44bf72=_0x5517cc=>{const _0x3d2e46=_0x1b4957;if(!_0x5517cc)return{};const _0x5e40fb=_0x5517cc,_0x4ffb8c={};for(const [_0x688647,_0x4676a4]of Object[_0x3d2e46(0x1b4)](_0x5e40fb)){typeof _0x4676a4===_0x3d2e46(0x1c3)&&(_0x4ffb8c[_0x688647]=_0x4676a4);}return _0x4ffb8c;},_0x155564={};if(_0x544ae4['site']&&_0x544ae4[_0x1b4957(0x1b6)]!=='us01')_0x155564['site']=_0x544ae4[_0x1b4957(0x1b6)];const _0xb5f249=_0x257019?.[_0x1b4957(0x1cf)],_0x10ecce=_0x3df432?.[_0x1b4957(0x1cf)],_0x560f3c=_0x3c7490?.['config']?.['database'],_0x499718=_0x4b04d7[_0x1b4957(0x1cf)];_0x544ae4[_0x1b4957(0x1cf)]&&(_0x544ae4['database']!==_0xb5f249&&_0x544ae4[_0x1b4957(0x1cf)]!==_0x10ecce&&_0x544ae4[_0x1b4957(0x1cf)]!==_0x560f3c&&_0x544ae4['database']!==_0x499718)&&(_0x155564[_0x1b4957(0x1cf)]=_0x544ae4[_0x1b4957(0x1cf)]);if(_0x544ae4['parentSegment'])_0x155564['parent_segment']=_0x544ae4[_0x1b4957(0x1a4)];if(_0x544ae4[_0x1b4957(0x1a3)])_0x155564[_0x1b4957(0x1a7)]=_0x544ae4[_0x1b4957(0x1a3)];if(_0x544ae4[_0x1b4957(0x1e2)])_0x155564[_0x1b4957(0x1d2)]=_0x544ae4[_0x1b4957(0x1e2)];if(_0x544ae4[_0x1b4957(0x1dd)])_0x155564[_0x1b4957(0x1dd)]=_0x544ae4[_0x1b4957(0x1dd)];this[_0x1b4957(0x1a9)]={'cliFlags':_0x155564,'session':_0x44bf72(_0x257019),'project':_0x44bf72(_0x3df432),'profile':_0x44bf72(_0x3c7490?.[_0x1b4957(0x1ba)]),'global':_0x44bf72(_0x4b04d7)};const _0x12768f={...this['layers'][_0x1b4957(0x1b3)],...this[_0x1b4957(0x1a9)][_0x1b4957(0x1dd)],...this[_0x1b4957(0x1a9)][_0x1b4957(0x1c6)],...this['layers'][_0x1b4957(0x1a6)],...this['layers'][_0x1b4957(0x1e0)]},_0x3c2956=_0x12768f[_0x1b4957(0x1b6)]||_0x1b4957(0x1bf);this[_0x1b4957(0x1b6)]=resolveSite(_0x3c2956),this[_0x1b4957(0x1cf)]=_0x12768f['database'],this[_0x1b4957(0x1c2)]=_0x12768f[_0x1b4957(0x1c2)],this[_0x1b4957(0x1d1)]=_0x12768f[_0x1b4957(0x1d1)],this[_0x1b4957(0x1a7)]=_0x12768f[_0x1b4957(0x1a7)],this['llm_agent']=_0x12768f['llm_agent'],this[_0x1b4957(0x1ac)]=_0x544ae4[_0x1b4957(0x1ac)]||![],this[_0x1b4957(0x1ca)]=_0x544ae4[_0x1b4957(0x1ca)]??LogLevel[_0x1b4957(0x1dc)],this['profile']=this[_0x1b4957(0x1a1)]||undefined,this[_0x1b4957(0x1aa)]=getAPIKey(this[_0x1b4957(0x1b6)],this[_0x1b4957(0x1a1)]||undefined);const _0x154806=getConfigDir(),_0x5adb67=a45_0x1c0615[_0x1b4957(0x1cb)](_0x154806,_0x1b4957(0x1bc),this[_0x1b4957(0x1d3)]+_0x1b4957(0x1ce)),_0x507348=findProjectConfigPath(),_0x32f49e=a45_0x1c0615['join'](_0x154806,_0x1b4957(0x1c7)),_0x4e6136=a45_0x1c0615[_0x1b4957(0x1cb)](_0x154806,_0x1b4957(0x1be));let _0x5056cc=null,_0x26f1f3=null;this[_0x1b4957(0x1a1)]&&(_0x5056cc=a45_0x1c0615['join'](_0x154806,_0x1b4957(0x1d0),this[_0x1b4957(0x1a1)],'tdx.json'),_0x26f1f3=a45_0x1c0615[_0x1b4957(0x1cb)](_0x154806,_0x1b4957(0x1d0),this[_0x1b4957(0x1a1)],_0x1b4957(0x1be))),this[_0x1b4957(0x1cd)]={'session':a45_0x1342d4[_0x1b4957(0x1c1)](_0x5adb67)?_0x5adb67:null,'project':_0x507348,'profile':_0x5056cc&&a45_0x1342d4['existsSync'](_0x5056cc)?_0x5056cc:null,'profileCredentials':_0x26f1f3&&a45_0x1342d4[_0x1b4957(0x1c1)](_0x26f1f3)?_0x26f1f3:null,'global':a45_0x1342d4[_0x1b4957(0x1c1)](_0x32f49e)?_0x32f49e:null,'globalCredentials':a45_0x1342d4[_0x1b4957(0x1c1)](_0x4e6136)?_0x4e6136:null};}['getSource'](_0xaa4d27,_0x182f01){const _0x52eda3=a45_0x2cc051;if(!_0x182f01)return'not\x20set';const _0x5b1859=_0x182f01;if(this['layers']['cliFlags'][_0xaa4d27]===_0x5b1859){if(_0xaa4d27==='site'&&_0x5b1859===_0x52eda3(0x1bf)&&!this[_0x52eda3(0x1a9)][_0x52eda3(0x1a6)][_0x52eda3(0x1b6)]&&!this['layers']['project']['site']&&!this[_0x52eda3(0x1a9)]['profile'][_0x52eda3(0x1b6)]&&!this['layers']['global']['site'])return _0x52eda3(0x1d9);return _0x52eda3(0x1c9)+_0xaa4d27[_0x52eda3(0x1d5)](/_/g,'-');}if(this[_0x52eda3(0x1a9)][_0x52eda3(0x1a6)][_0xaa4d27]===_0x5b1859)return'session';if(this['layers'][_0x52eda3(0x1c6)][_0xaa4d27]===_0x5b1859)return _0x52eda3(0x1c6);if(this[_0x52eda3(0x1a9)]['profile'][_0xaa4d27]===_0x5b1859)return _0x52eda3(0x1b8)+this['activeProfile'];if(this[_0x52eda3(0x1a9)][_0x52eda3(0x1b3)][_0xaa4d27]===_0x5b1859)return _0x52eda3(0x1b3);return _0x52eda3(0x1d9);}[a45_0x2cc051(0x1a5)](){const _0x43c58b=a45_0x2cc051,_0x4923ae=a45_0x1c0615['join'](getConfigDir(),'tdx.json');if(!a45_0x1342d4[_0x43c58b(0x1c1)](_0x4923ae))return{};try{const _0x37656c=a45_0x1342d4[_0x43c58b(0x1d6)](_0x4923ae,'utf-8');return JSON[_0x43c58b(0x1e1)](_0x37656c);}catch{return{};}}['injectIntoOptions'](_0x2423e7){const _0x33975d=a45_0x2cc051;_0x2423e7[_0x33975d(0x1b6)]=this['site'],!_0x2423e7[_0x33975d(0x1cf)]&&this[_0x33975d(0x1cf)]&&(_0x2423e7[_0x33975d(0x1cf)]=this[_0x33975d(0x1cf)]),!_0x2423e7['parentSegment']&&this[_0x33975d(0x1c2)]&&(_0x2423e7[_0x33975d(0x1a4)]=this[_0x33975d(0x1c2)]),!_0x2423e7[_0x33975d(0x1b1)]&&this[_0x33975d(0x1d1)]&&(_0x2423e7[_0x33975d(0x1b1)]=this[_0x33975d(0x1d1)]),!_0x2423e7[_0x33975d(0x1a3)]&&this['llm_project']&&(_0x2423e7['llmProject']=this['llm_project']),!_0x2423e7['llmAgent']&&this[_0x33975d(0x1d2)]&&(_0x2423e7[_0x33975d(0x1e2)]=this[_0x33975d(0x1d2)]);}[a45_0x2cc051(0x1b0)](){const _0x110c39=a45_0x2cc051;return[{'key':_0x110c39(0x1b6),'value':this[_0x110c39(0x1b6)]},{'key':_0x110c39(0x1cf),'value':this[_0x110c39(0x1cf)]},{'key':_0x110c39(0x1c2),'value':this[_0x110c39(0x1c2)]},{'key':'segment_path','value':this[_0x110c39(0x1d1)]},{'key':_0x110c39(0x1a7),'value':this[_0x110c39(0x1a7)]},{'key':_0x110c39(0x1d2),'value':this[_0x110c39(0x1d2)]},{'key':_0x110c39(0x1dd),'value':this['activeProfile']||undefined}];}['display'](){const _0x2d3cec=a45_0x2cc051;console[_0x2d3cec(0x1db)](_0x2d3cec(0x1de));for(const {key:_0x3c27fe,value:_0x5606aa}of this[_0x2d3cec(0x1b0)]()){_0x5606aa&&console['log'](_0x3c27fe+':\x20'+_0x5606aa);}}[a45_0x2cc051(0x1bb)](){const _0x35430a=a45_0x2cc051;console[_0x35430a(0x1db)](_0x35430a(0x1de));for(const {key:_0x3ab757,value:_0x4ac68b}of this[_0x35430a(0x1b0)]()){if(_0x4ac68b){const _0x33d838=_0x3ab757==='profile'?_0x35430a(0x1d4):'('+this['getSource'](_0x3ab757,_0x4ac68b)+')';console[_0x35430a(0x1db)](_0x3ab757+':\x20'+_0x4ac68b+'\x20'+_0x33d838);}}console[_0x35430a(0x1db)](_0x35430a(0x1df));const _0x23c2a1=[{'label':_0x35430a(0x1ad),'path':this[_0x35430a(0x1cd)][_0x35430a(0x1a6)],'extra':'(session:\x20'+this[_0x35430a(0x1d3)]+')'},{'label':'Project','path':this[_0x35430a(0x1cd)][_0x35430a(0x1c6)]},{'label':_0x35430a(0x1ab),'path':this[_0x35430a(0x1cd)][_0x35430a(0x1dd)]},{'label':_0x35430a(0x1b9),'path':this[_0x35430a(0x1cd)]['profileCredentials']},{'label':'Global','path':this[_0x35430a(0x1cd)][_0x35430a(0x1b3)]},{'label':'Global\x20Credentials','path':this[_0x35430a(0x1cd)][_0x35430a(0x1c8)]}];for(const {label:_0x207485,path:_0x21673f,extra:_0x5051db}of _0x23c2a1){if(_0x21673f)console[_0x35430a(0x1db)](_0x207485+':\x20'+_0x21673f+'\x20✓'+(_0x5051db?'\x20'+_0x5051db:''));else{if(_0x207485===_0x35430a(0x1ad))console[_0x35430a(0x1db)](_0x207485+_0x35430a(0x1ae)+this[_0x35430a(0x1d3)]+')');else(_0x207485==='Project'||_0x207485==='Global')&&console[_0x35430a(0x1db)](_0x207485+_0x35430a(0x1d7));}}}async[a45_0x2cc051(0x1cc)](){const _0xd21bae=a45_0x2cc051;return this[_0xd21bae(0x1aa)]=await getAPIKeyAsync(this[_0xd21bae(0x1b6)],this['activeProfile']||undefined),this['apiKey'];}static async['createAsync'](_0x3a4f66){const _0x3cdd21=a45_0x2cc051,_0xe91a1a=new GlobalContext(_0x3a4f66);return await _0xe91a1a[_0x3cdd21(0x1cc)](),_0xe91a1a;}}
1
+ const a45_0x10a47a=a45_0x5527;(function(_0x29abfa,_0x161311){const _0x591e29=a45_0x5527,_0x4ce1d0=_0x29abfa();while(!![]){try{const _0x52cf08=-parseInt(_0x591e29(0x1fc))/0x1+-parseInt(_0x591e29(0x1e8))/0x2*(-parseInt(_0x591e29(0x1ff))/0x3)+parseInt(_0x591e29(0x1f9))/0x4*(-parseInt(_0x591e29(0x202))/0x5)+-parseInt(_0x591e29(0x1c9))/0x6+parseInt(_0x591e29(0x1cf))/0x7+parseInt(_0x591e29(0x1fd))/0x8*(parseInt(_0x591e29(0x1d0))/0x9)+parseInt(_0x591e29(0x1bd))/0xa*(-parseInt(_0x591e29(0x1bf))/0xb);if(_0x52cf08===_0x161311)break;else _0x4ce1d0['push'](_0x4ce1d0['shift']());}catch(_0x348f63){_0x4ce1d0['push'](_0x4ce1d0['shift']());}}}(a45_0x10b2,0x5e252));import{resolveSite,getAPIKey,getAPIKeyAsync,getConfigDir}from'./config.js';import{loadSessionContext,getCurrentSessionPID}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';function a45_0x10b2(){const _0x1111b9=['Global\x20Credentials','CLI\x20flag:\x20--','2335UqZXME','injectIntoOptions','79610GSfiLz','replace','374UBWUoq','join','sessionId','verbose','tdx.json','not\x20set','log','[context]','llmProject','llm_agent','3231714gReZbl','us01','.env','loadGlobalConfig','segment_path','llmAgent','2356781qHuCfP','328311BXKOOF','entries','database','profile','existsSync','project','activeProfile','Project','cliFlags','utf-8','segmentPath','Global','site','(session:\x20','getSource','layers',':\x20none','Profile',':\x20none\x20(using\x20session:\x20','profileCredentials','configFiles','toString','global','Session','8IhxJbT','readFileSync','session','getParameters','parentSegment','default','INFO','globalCredentials','\x0a[configuration\x20files]','parent_segment','profiles','apiKey','display','config','llm_project','logLevel','parse','36wmJVXc','displayWithSources','sessions','88148BvOMVp','40BQkiZW','(active)','576138FqOMTm'];a45_0x10b2=function(){return _0x1111b9;};return a45_0x10b2();}import{getActiveProfile,loadProfile}from'./profile.js';import{LogLevel}from'../utils/tdx-logger.js';function a45_0x5527(_0x26ad33,_0x55c0a8){_0x26ad33=_0x26ad33-0x1bc;const _0x10b223=a45_0x10b2();let _0x552746=_0x10b223[_0x26ad33];return _0x552746;}import*as a45_0x508ae7 from'node:fs';import*as a45_0xbcc856 from'node:path';export class GlobalContext{['site'];['database'];['parent_segment'];[a45_0x10a47a(0x1cd)];['llm_project'];[a45_0x10a47a(0x1c8)];['apiKey'];['verbose'];['logLevel'];[a45_0x10a47a(0x1d3)];[a45_0x10a47a(0x1df)];[a45_0x10a47a(0x1d6)];[a45_0x10a47a(0x1c1)];[a45_0x10a47a(0x1e4)];constructor(_0x48399d){const _0x3516b1=a45_0x10a47a;this[_0x3516b1(0x1c1)]=_0x48399d[_0x3516b1(0x1ea)]||getCurrentSessionPID()[_0x3516b1(0x1e5)]();const _0x940eb9=loadSessionContext(_0x48399d['session']),_0x54dc3b=loadProjectConfig(),_0x1d48f1=this[_0x3516b1(0x1cc)]();this['activeProfile']=_0x48399d[_0x3516b1(0x1d3)]||_0x940eb9?.[_0x3516b1(0x1d3)]||_0x1d48f1[_0x3516b1(0x1d3)]||getActiveProfile();const _0x3f92dd=this['activeProfile']?loadProfile(this[_0x3516b1(0x1d6)]):null,_0x25084e=_0x26841c=>{const _0x163984=_0x3516b1;if(!_0x26841c)return{};const _0xb411c7=_0x26841c,_0x2c9cb1={};for(const [_0x4cdcc7,_0x307d52]of Object[_0x163984(0x1d1)](_0xb411c7)){typeof _0x307d52==='string'&&(_0x2c9cb1[_0x4cdcc7]=_0x307d52);}return _0x2c9cb1;},_0x20950d={};if(_0x48399d['site']&&_0x48399d[_0x3516b1(0x1dc)]!==_0x3516b1(0x1ca))_0x20950d[_0x3516b1(0x1dc)]=_0x48399d[_0x3516b1(0x1dc)];const _0x27ae33=_0x940eb9?.[_0x3516b1(0x1d2)],_0x32036e=_0x54dc3b?.[_0x3516b1(0x1d2)],_0x2d4051=_0x3f92dd?.[_0x3516b1(0x1f5)]?.[_0x3516b1(0x1d2)],_0x10d79f=_0x1d48f1[_0x3516b1(0x1d2)];_0x48399d[_0x3516b1(0x1d2)]&&(_0x48399d[_0x3516b1(0x1d2)]!==_0x27ae33&&_0x48399d[_0x3516b1(0x1d2)]!==_0x32036e&&_0x48399d[_0x3516b1(0x1d2)]!==_0x2d4051&&_0x48399d[_0x3516b1(0x1d2)]!==_0x10d79f)&&(_0x20950d[_0x3516b1(0x1d2)]=_0x48399d[_0x3516b1(0x1d2)]);if(_0x48399d[_0x3516b1(0x1ec)])_0x20950d['parent_segment']=_0x48399d[_0x3516b1(0x1ec)];if(_0x48399d[_0x3516b1(0x1c7)])_0x20950d[_0x3516b1(0x1f6)]=_0x48399d[_0x3516b1(0x1c7)];if(_0x48399d['llmAgent'])_0x20950d['llm_agent']=_0x48399d[_0x3516b1(0x1ce)];if(_0x48399d['profile'])_0x20950d[_0x3516b1(0x1d3)]=_0x48399d[_0x3516b1(0x1d3)];this[_0x3516b1(0x1df)]={'cliFlags':_0x20950d,'session':_0x25084e(_0x940eb9),'project':_0x25084e(_0x54dc3b),'profile':_0x25084e(_0x3f92dd?.[_0x3516b1(0x1f5)]),'global':_0x25084e(_0x1d48f1)};const _0x53ae13={...this[_0x3516b1(0x1df)][_0x3516b1(0x1e6)],...this[_0x3516b1(0x1df)]['profile'],...this[_0x3516b1(0x1df)][_0x3516b1(0x1d5)],...this['layers'][_0x3516b1(0x1ea)],...this['layers']['cliFlags']},_0x2c6377=_0x53ae13[_0x3516b1(0x1dc)]||'us01';this[_0x3516b1(0x1dc)]=resolveSite(_0x2c6377),this['database']=_0x53ae13['database'],this[_0x3516b1(0x1f1)]=_0x53ae13[_0x3516b1(0x1f1)],this[_0x3516b1(0x1cd)]=_0x53ae13[_0x3516b1(0x1cd)],this['llm_project']=_0x53ae13[_0x3516b1(0x1f6)],this[_0x3516b1(0x1c8)]=_0x53ae13['llm_agent'],this['verbose']=_0x48399d[_0x3516b1(0x1c2)]||![],this[_0x3516b1(0x1f7)]=_0x48399d[_0x3516b1(0x1f7)]??LogLevel[_0x3516b1(0x1ee)],this[_0x3516b1(0x1d3)]=this[_0x3516b1(0x1d6)]||undefined,this[_0x3516b1(0x1f3)]=getAPIKey(this[_0x3516b1(0x1dc)],this['activeProfile']||undefined);const _0x5ba18a=getConfigDir(),_0xd496df=a45_0xbcc856[_0x3516b1(0x1c0)](_0x5ba18a,_0x3516b1(0x1fb),this[_0x3516b1(0x1c1)]+'.json'),_0x3222a8=findProjectConfigPath(),_0x4941e2=a45_0xbcc856[_0x3516b1(0x1c0)](_0x5ba18a,_0x3516b1(0x1c3)),_0x495980=a45_0xbcc856[_0x3516b1(0x1c0)](_0x5ba18a,_0x3516b1(0x1cb));let _0x117882=null,_0x30e0cc=null;this[_0x3516b1(0x1d6)]&&(_0x117882=a45_0xbcc856[_0x3516b1(0x1c0)](_0x5ba18a,_0x3516b1(0x1f2),this[_0x3516b1(0x1d6)],'tdx.json'),_0x30e0cc=a45_0xbcc856[_0x3516b1(0x1c0)](_0x5ba18a,_0x3516b1(0x1f2),this[_0x3516b1(0x1d6)],_0x3516b1(0x1cb))),this[_0x3516b1(0x1e4)]={'session':a45_0x508ae7['existsSync'](_0xd496df)?_0xd496df:null,'project':_0x3222a8,'profile':_0x117882&&a45_0x508ae7['existsSync'](_0x117882)?_0x117882:null,'profileCredentials':_0x30e0cc&&a45_0x508ae7[_0x3516b1(0x1d4)](_0x30e0cc)?_0x30e0cc:null,'global':a45_0x508ae7['existsSync'](_0x4941e2)?_0x4941e2:null,'globalCredentials':a45_0x508ae7[_0x3516b1(0x1d4)](_0x495980)?_0x495980:null};}[a45_0x10a47a(0x1de)](_0x7df082,_0x5b8a11){const _0x49c0de=a45_0x10a47a;if(!_0x5b8a11)return _0x49c0de(0x1c4);const _0x4eb87e=_0x5b8a11;if(this[_0x49c0de(0x1df)][_0x49c0de(0x1d8)][_0x7df082]===_0x4eb87e){if(_0x7df082===_0x49c0de(0x1dc)&&_0x4eb87e===_0x49c0de(0x1ca)&&!this['layers'][_0x49c0de(0x1ea)]['site']&&!this[_0x49c0de(0x1df)][_0x49c0de(0x1d5)][_0x49c0de(0x1dc)]&&!this['layers']['profile'][_0x49c0de(0x1dc)]&&!this[_0x49c0de(0x1df)][_0x49c0de(0x1e6)]['site'])return'default';return _0x49c0de(0x201)+_0x7df082[_0x49c0de(0x1be)](/_/g,'-');}if(this[_0x49c0de(0x1df)][_0x49c0de(0x1ea)][_0x7df082]===_0x4eb87e)return _0x49c0de(0x1ea);if(this[_0x49c0de(0x1df)]['project'][_0x7df082]===_0x4eb87e)return'project';if(this[_0x49c0de(0x1df)]['profile'][_0x7df082]===_0x4eb87e)return'profile:\x20'+this['activeProfile'];if(this['layers'][_0x49c0de(0x1e6)][_0x7df082]===_0x4eb87e)return _0x49c0de(0x1e6);return _0x49c0de(0x1ed);}[a45_0x10a47a(0x1cc)](){const _0xb1bb4c=a45_0x10a47a,_0x15b8c6=a45_0xbcc856[_0xb1bb4c(0x1c0)](getConfigDir(),_0xb1bb4c(0x1c3));if(!a45_0x508ae7[_0xb1bb4c(0x1d4)](_0x15b8c6))return{};try{const _0x319c1d=a45_0x508ae7[_0xb1bb4c(0x1e9)](_0x15b8c6,_0xb1bb4c(0x1d9));return JSON[_0xb1bb4c(0x1f8)](_0x319c1d);}catch{return{};}}[a45_0x10a47a(0x1bc)](_0xa0c650){const _0x2047ec=a45_0x10a47a;_0xa0c650[_0x2047ec(0x1dc)]=this[_0x2047ec(0x1dc)],!_0xa0c650[_0x2047ec(0x1d2)]&&this[_0x2047ec(0x1d2)]&&(_0xa0c650['database']=this[_0x2047ec(0x1d2)]),!_0xa0c650[_0x2047ec(0x1ec)]&&this['parent_segment']&&(_0xa0c650['parentSegment']=this[_0x2047ec(0x1f1)]),!_0xa0c650[_0x2047ec(0x1da)]&&this[_0x2047ec(0x1cd)]&&(_0xa0c650[_0x2047ec(0x1da)]=this[_0x2047ec(0x1cd)]),!_0xa0c650[_0x2047ec(0x1c7)]&&this['llm_project']&&(_0xa0c650['llmProject']=this['llm_project']),!_0xa0c650[_0x2047ec(0x1ce)]&&this[_0x2047ec(0x1c8)]&&(_0xa0c650[_0x2047ec(0x1ce)]=this[_0x2047ec(0x1c8)]);}['getParameters'](){const _0x4c5a81=a45_0x10a47a;return[{'key':'site','value':this[_0x4c5a81(0x1dc)]},{'key':'database','value':this[_0x4c5a81(0x1d2)]},{'key':_0x4c5a81(0x1f1),'value':this['parent_segment']},{'key':_0x4c5a81(0x1cd),'value':this[_0x4c5a81(0x1cd)]},{'key':_0x4c5a81(0x1f6),'value':this['llm_project']},{'key':_0x4c5a81(0x1c8),'value':this[_0x4c5a81(0x1c8)]},{'key':_0x4c5a81(0x1d3),'value':this[_0x4c5a81(0x1d6)]||undefined}];}[a45_0x10a47a(0x1f4)](){const _0x2513d0=a45_0x10a47a;console['log'](_0x2513d0(0x1c6));for(const {key:_0x5aeb60,value:_0xb95673}of this[_0x2513d0(0x1eb)]()){_0xb95673&&console['log'](_0x5aeb60+':\x20'+_0xb95673);}}[a45_0x10a47a(0x1fa)](){const _0x4cd72c=a45_0x10a47a;console[_0x4cd72c(0x1c5)](_0x4cd72c(0x1c6));for(const {key:_0x15e8ac,value:_0x27911b}of this['getParameters']()){if(_0x27911b){const _0x3d9cd0=_0x15e8ac==='profile'?_0x4cd72c(0x1fe):'('+this[_0x4cd72c(0x1de)](_0x15e8ac,_0x27911b)+')';console[_0x4cd72c(0x1c5)](_0x15e8ac+':\x20'+_0x27911b+'\x20'+_0x3d9cd0);}}console[_0x4cd72c(0x1c5)](_0x4cd72c(0x1f0));const _0x3dce55=[{'label':'Session','path':this[_0x4cd72c(0x1e4)]['session'],'extra':_0x4cd72c(0x1dd)+this['sessionId']+')'},{'label':'Project','path':this[_0x4cd72c(0x1e4)][_0x4cd72c(0x1d5)]},{'label':_0x4cd72c(0x1e1),'path':this[_0x4cd72c(0x1e4)][_0x4cd72c(0x1d3)]},{'label':'Profile\x20Credentials','path':this[_0x4cd72c(0x1e4)][_0x4cd72c(0x1e3)]},{'label':_0x4cd72c(0x1db),'path':this['configFiles']['global']},{'label':_0x4cd72c(0x200),'path':this[_0x4cd72c(0x1e4)][_0x4cd72c(0x1ef)]}];for(const {label:_0x264858,path:_0x1de609,extra:_0x2c5661}of _0x3dce55){if(_0x1de609)console[_0x4cd72c(0x1c5)](_0x264858+':\x20'+_0x1de609+'\x20✓'+(_0x2c5661?'\x20'+_0x2c5661:''));else{if(_0x264858===_0x4cd72c(0x1e7))console[_0x4cd72c(0x1c5)](_0x264858+_0x4cd72c(0x1e2)+this[_0x4cd72c(0x1c1)]+')');else(_0x264858===_0x4cd72c(0x1d7)||_0x264858===_0x4cd72c(0x1db))&&console[_0x4cd72c(0x1c5)](_0x264858+_0x4cd72c(0x1e0));}}}async['resolveAPIKeyAsync'](){const _0x1ef291=a45_0x10a47a;return this['apiKey']=await getAPIKeyAsync(this[_0x1ef291(0x1dc)],this['activeProfile']||undefined),this['apiKey'];}static async['createAsync'](_0x5068d1){const _0x18295b=new GlobalContext(_0x5068d1);return await _0x18295b['resolveAPIKeyAsync'](),_0x18295b;}}
@@ -1 +1 @@
1
- const a46_0x2d4f3d=a46_0x1953;(function(_0x46e5d6,_0x3ff300){const _0x2a3837=a46_0x1953,_0x49336a=_0x46e5d6();while(!![]){try{const _0x35e84f=parseInt(_0x2a3837(0x141))/0x1+parseInt(_0x2a3837(0x14b))/0x2*(-parseInt(_0x2a3837(0x12c))/0x3)+-parseInt(_0x2a3837(0x148))/0x4*(-parseInt(_0x2a3837(0x147))/0x5)+-parseInt(_0x2a3837(0x144))/0x6*(-parseInt(_0x2a3837(0x12e))/0x7)+-parseInt(_0x2a3837(0x142))/0x8*(-parseInt(_0x2a3837(0x13c))/0x9)+-parseInt(_0x2a3837(0x149))/0xa*(-parseInt(_0x2a3837(0x136))/0xb)+-parseInt(_0x2a3837(0x135))/0xc;if(_0x35e84f===_0x3ff300)break;else _0x49336a['push'](_0x49336a['shift']());}catch(_0x3e8655){_0x49336a['push'](_0x49336a['shift']());}}}(a46_0x1c84,0x18a9a));const SERVICE_NAME=a46_0x2d4f3d(0x143);let keyringModule=null,keyringLoadError=null;async function getKeyring(){const _0x4418e8=a46_0x2d4f3d;if(keyringModule!==null)return keyringModule;if(keyringLoadError!==null)return null;try{const _0x2fc869=await import(_0x4418e8(0x13f));return keyringModule=_0x2fc869[_0x4418e8(0x133)],keyringModule;}catch(_0x185151){return keyringLoadError=_0x185151 instanceof Error?_0x185151:new Error(String(_0x185151)),null;}}function getAccountName(_0x34bf60){const _0x2ba37f=a46_0x2d4f3d,_0x203feb=_0x34bf60||'';return'profile:'+_0x203feb+_0x2ba37f(0x14a);}export async function getKeychainAPIKey(_0x43521f){const _0x5d47b2=a46_0x2d4f3d,_0x2333ce=await getKeychainAPIKeyWithStatus(_0x43521f);if(_0x2333ce[_0x5d47b2(0x12b)])return _0x2333ce[_0x5d47b2(0x140)];return _0x2333ce['reason']===_0x5d47b2(0x13a)&&console[_0x5d47b2(0x13e)]('Warning:\x20'+_0x2333ce[_0x5d47b2(0x145)]),null;}function a46_0x1c84(){const _0x2fc9f4=['26472IAYDWl','120112BaLiUw','tdx','102HDIDZQ','message','could\x20not\x20be\x20found','425660loXKKn','8JyphSI','70ZmwTpC',':api_key','36bwIPmn','__keychain_test__','success','24039odByAm','not_found','16373hCGYKX','deletePassword','toLowerCase','includes','getPassword','keyring','not\x20available','4042932jrcuXS','307252QsNKEj','restricted','not\x20found','-25293','access_denied','unavailable','90jzqxJh','System\x20keychain\x20is\x20not\x20available','error','@zowe/secrets-for-zowe-sdk','value'];a46_0x1c84=function(){return _0x2fc9f4;};return a46_0x1c84();}export async function getKeychainAPIKeyWithStatus(_0x3fd12b){const _0x3a1985=a46_0x2d4f3d;try{const _0xd3e91e=await getKeyring();if(!_0xd3e91e)return{'success':![],'reason':_0x3a1985(0x13b)};const _0x52463e=getAccountName(_0x3fd12b),_0x47f6db=await _0xd3e91e[_0x3a1985(0x132)](SERVICE_NAME,_0x52463e);if(_0x47f6db)return{'success':!![],'value':_0x47f6db};return{'success':![],'reason':'not_found'};}catch(_0x880952){const _0x39b5cb=_0x880952 instanceof Error?_0x880952[_0x3a1985(0x145)]:String(_0x880952);if(_0x39b5cb[_0x3a1985(0x131)]('-25300')||_0x39b5cb['toLowerCase']()['includes'](_0x3a1985(0x146))||_0x39b5cb[_0x3a1985(0x130)]()[_0x3a1985(0x131)](_0x3a1985(0x138)))return{'success':![],'reason':_0x3a1985(0x12d)};if(_0x39b5cb[_0x3a1985(0x131)](_0x3a1985(0x139))||_0x39b5cb[_0x3a1985(0x130)]()[_0x3a1985(0x131)](_0x3a1985(0x137))||_0x39b5cb['toLowerCase']()[_0x3a1985(0x131)]('access'))return{'success':![],'reason':'access_denied','message':'Keychain\x20access\x20denied.\x20The\x20API\x20key\x20exists\x20but\x20cannot\x20be\x20accessed.\x20Try\x20running\x20\x22tdx\x20auth\x20setup\x22\x20to\x20re-authenticate,\x20or\x20check\x20your\x20keychain\x20permissions\x20for\x20\x22tdx\x22.'};return{'success':![],'reason':_0x3a1985(0x13b),'message':_0x39b5cb};}}function a46_0x1953(_0x595662,_0x4f04d3){_0x595662=_0x595662-0x12a;const _0x1c841c=a46_0x1c84();let _0x1953fa=_0x1c841c[_0x595662];return _0x1953fa;}export async function saveKeychainAPIKey(_0x4434a2,_0x1ca857){const _0x191e87=a46_0x2d4f3d,_0x39f9fd=await getKeyring();if(!_0x39f9fd)throw new Error(_0x191e87(0x13d));const _0x3b5cfc=getAccountName(_0x1ca857);await _0x39f9fd['setPassword'](SERVICE_NAME,_0x3b5cfc,_0x4434a2);}export async function deleteKeychainAPIKey(_0x6becda){const _0x3875cc=a46_0x2d4f3d;try{const _0x54fbc1=await getKeyring();if(!_0x54fbc1)return![];const _0x4da1d2=getAccountName(_0x6becda);return await _0x54fbc1[_0x3875cc(0x12f)](SERVICE_NAME,_0x4da1d2);}catch{return![];}}export async function isKeychainAvailable(){const _0x476a30=a46_0x2d4f3d;try{const _0x3cf8bf=await getKeyring();if(!_0x3cf8bf)return![];return await _0x3cf8bf['getPassword'](SERVICE_NAME,_0x476a30(0x12a)),!![];}catch(_0x105843){const _0x1276e0=_0x105843 instanceof Error?_0x105843['message'][_0x476a30(0x130)]():'';if(_0x1276e0[_0x476a30(0x131)](_0x476a30(0x134))||_0x1276e0['includes']('not\x20supported')||_0x1276e0[_0x476a30(0x131)]('cannot\x20find'))return![];return!![];}}
1
+ const a46_0xe4012=a46_0x4720;(function(_0x27af29,_0x230d50){const _0x4f2fba=a46_0x4720,_0x1a45b8=_0x27af29();while(!![]){try{const _0x3ec367=-parseInt(_0x4f2fba(0x10c))/0x1*(-parseInt(_0x4f2fba(0x111))/0x2)+parseInt(_0x4f2fba(0x11b))/0x3+parseInt(_0x4f2fba(0x117))/0x4+parseInt(_0x4f2fba(0x11f))/0x5*(parseInt(_0x4f2fba(0x125))/0x6)+parseInt(_0x4f2fba(0x10f))/0x7+parseInt(_0x4f2fba(0x10a))/0x8*(-parseInt(_0x4f2fba(0x128))/0x9)+-parseInt(_0x4f2fba(0x116))/0xa;if(_0x3ec367===_0x230d50)break;else _0x1a45b8['push'](_0x1a45b8['shift']());}catch(_0x475288){_0x1a45b8['push'](_0x1a45b8['shift']());}}}(a46_0x579e,0x46fab));const SERVICE_NAME=a46_0xe4012(0x11a);let keyringModule=null,keyringLoadError=null;async function getKeyring(){const _0xf95697=a46_0xe4012;if(keyringModule!==null)return keyringModule;if(keyringLoadError!==null)return null;try{const _0x17520f=await import(_0xf95697(0x127));return keyringModule=_0x17520f[_0xf95697(0x122)],keyringModule;}catch(_0x37b050){return keyringLoadError=_0x37b050 instanceof Error?_0x37b050:new Error(String(_0x37b050)),null;}}function getAccountName(_0x40629e){const _0x3bb549=a46_0xe4012,_0x36c4f8=_0x40629e||'';return _0x3bb549(0x11c)+_0x36c4f8+_0x3bb549(0x118);}function a46_0x4720(_0x26b1f6,_0x2187f3){_0x26b1f6=_0x26b1f6-0x107;const _0x579e12=a46_0x579e();let _0x47209f=_0x579e12[_0x26b1f6];return _0x47209f;}export async function getKeychainAPIKey(_0x229ac6){const _0x2cd258=a46_0xe4012,_0x1e8842=await getKeychainAPIKeyWithStatus(_0x229ac6);if(_0x1e8842[_0x2cd258(0x11d)])return _0x1e8842[_0x2cd258(0x126)];return _0x1e8842[_0x2cd258(0x108)]==='access_denied'&&console[_0x2cd258(0x109)](_0x2cd258(0x124)+_0x1e8842['message']),null;}export async function getKeychainAPIKeyWithStatus(_0x33d0f8){const _0x2baa04=a46_0xe4012;try{const _0x588c1a=await getKeyring();if(!_0x588c1a)return{'success':![],'reason':_0x2baa04(0x112)};const _0x2516bb=getAccountName(_0x33d0f8),_0x352f53=await _0x588c1a[_0x2baa04(0x115)](SERVICE_NAME,_0x2516bb);if(_0x352f53)return{'success':!![],'value':_0x352f53};return{'success':![],'reason':_0x2baa04(0x110)};}catch(_0x7ce61c){const _0x5830ac=_0x7ce61c instanceof Error?_0x7ce61c[_0x2baa04(0x113)]:String(_0x7ce61c);if(_0x5830ac['includes']('-25300')||_0x5830ac['toLowerCase']()['includes'](_0x2baa04(0x119))||_0x5830ac[_0x2baa04(0x114)]()['includes'](_0x2baa04(0x10b)))return{'success':![],'reason':_0x2baa04(0x110)};if(_0x5830ac[_0x2baa04(0x120)](_0x2baa04(0x10e))||_0x5830ac[_0x2baa04(0x114)]()[_0x2baa04(0x120)](_0x2baa04(0x11e))||_0x5830ac[_0x2baa04(0x114)]()[_0x2baa04(0x120)]('access'))return{'success':![],'reason':'access_denied','message':'Keychain\x20access\x20denied.\x20The\x20API\x20key\x20exists\x20but\x20cannot\x20be\x20accessed.\x20Try\x20running\x20\x22tdx\x20auth\x20setup\x22\x20to\x20re-authenticate,\x20or\x20check\x20your\x20keychain\x20permissions\x20for\x20\x22tdx\x22.'};return{'success':![],'reason':_0x2baa04(0x112),'message':_0x5830ac};}}function a46_0x579e(){const _0x1ecf42=['unavailable','message','toLowerCase','getPassword','10121300dGLLpc','927068HNHJAv',':api_key','could\x20not\x20be\x20found','tdx','1713849xdcRjv','profile:','success','restricted','5mKwkbP','includes','cannot\x20find','keyring','setPassword','Warning:\x20','836844AzPTEg','value','@zowe/secrets-for-zowe-sdk','1035fdkJQz','deletePassword','reason','error','25432ZACMeo','not\x20found','146592CKxiTZ','not\x20supported','-25293','3029166pdKcfZ','not_found','4INPObW'];a46_0x579e=function(){return _0x1ecf42;};return a46_0x579e();}export async function saveKeychainAPIKey(_0x1d6eeb,_0x179990){const _0x1eaaf9=a46_0xe4012,_0x28b359=await getKeyring();if(!_0x28b359)throw new Error('System\x20keychain\x20is\x20not\x20available');const _0x2ba8e7=getAccountName(_0x179990);await _0x28b359[_0x1eaaf9(0x123)](SERVICE_NAME,_0x2ba8e7,_0x1d6eeb);}export async function deleteKeychainAPIKey(_0x19c168){const _0x3deb89=a46_0xe4012;try{const _0x4d67fb=await getKeyring();if(!_0x4d67fb)return![];const _0x37eb46=getAccountName(_0x19c168);return await _0x4d67fb[_0x3deb89(0x107)](SERVICE_NAME,_0x37eb46);}catch{return![];}}export async function isKeychainAvailable(){const _0x481d00=a46_0xe4012;try{const _0x3a122d=await getKeyring();if(!_0x3a122d)return![];return await _0x3a122d[_0x481d00(0x115)](SERVICE_NAME,'__keychain_test__'),!![];}catch(_0x382bd6){const _0x49fc6c=_0x382bd6 instanceof Error?_0x382bd6[_0x481d00(0x113)][_0x481d00(0x114)]():'';if(_0x49fc6c[_0x481d00(0x120)]('not\x20available')||_0x49fc6c[_0x481d00(0x120)](_0x481d00(0x10d))||_0x49fc6c[_0x481d00(0x120)](_0x481d00(0x121)))return![];return!![];}}