@treasuredata/tdx 0.9.0 → 0.9.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 (119) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/client/cdp-api-client.js +1 -1
  6. package/dist/client/engage-api-client.js +1 -1
  7. package/dist/client/http-client.js +1 -1
  8. package/dist/client/llm-api-client.js +1 -1
  9. package/dist/client/rate-limiter.js +1 -1
  10. package/dist/client/td-api-client.js +1 -1
  11. package/dist/client/trino-api-client.js +1 -1
  12. package/dist/client/workflow-client.js +1 -1
  13. package/dist/commands/activations.js +1 -1
  14. package/dist/commands/agent-command.js +1 -1
  15. package/dist/commands/api-command.js +1 -1
  16. package/dist/commands/auth-command.js +1 -1
  17. package/dist/commands/chat-command.js +1 -1
  18. package/dist/commands/claude-command.js +1 -1
  19. package/dist/commands/claude-statusline-command.js +1 -1
  20. package/dist/commands/claude-usage-command.js +1 -1
  21. package/dist/commands/command.js +1 -1
  22. package/dist/commands/connection-command.js +1 -1
  23. package/dist/commands/context-command.js +1 -1
  24. package/dist/commands/databases.js +1 -1
  25. package/dist/commands/describe.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/llm-command.js +1 -1
  30. package/dist/commands/llm-proxy.js +1 -1
  31. package/dist/commands/parent-segment-command.js +1 -1
  32. package/dist/commands/profiles-command.js +1 -1
  33. package/dist/commands/query-command.js +1 -1
  34. package/dist/commands/segment-command.js +1 -1
  35. package/dist/commands/segment-create-command.js +1 -1
  36. package/dist/commands/segment-fields-command.js +1 -1
  37. package/dist/commands/segment-pull-command.js +1 -1
  38. package/dist/commands/segment-push-command.js +1 -1
  39. package/dist/commands/segment-update-command.js +1 -1
  40. package/dist/commands/segment-use-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/tables.js +1 -1
  44. package/dist/commands/use-command.js +1 -1
  45. package/dist/commands/user-command.js +1 -1
  46. package/dist/commands/workflow-command.js +1 -1
  47. package/dist/core/auth.js +1 -1
  48. package/dist/core/config.js +1 -1
  49. package/dist/core/connection-cache.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/index.js +1 -1
  58. package/dist/proxy/anthropic-adapter.js +1 -1
  59. package/dist/proxy/claude-usage-tracker.js +1 -1
  60. package/dist/proxy/context-signature.js +1 -1
  61. package/dist/proxy/conversation-utils.js +1 -1
  62. package/dist/proxy/server.js +1 -1
  63. package/dist/proxy/session-cache.js +1 -1
  64. package/dist/sdk/agent/agent-yaml.d.ts +1 -1
  65. package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
  66. package/dist/sdk/agent/agent-yaml.js +1 -1
  67. package/dist/sdk/agent/agent-yaml.js.map +1 -1
  68. package/dist/sdk/api.js +1 -1
  69. package/dist/sdk/connection.js +1 -1
  70. package/dist/sdk/engage.js +1 -1
  71. package/dist/sdk/errors.js +1 -1
  72. package/dist/sdk/index.js +1 -1
  73. package/dist/sdk/job.js +1 -1
  74. package/dist/sdk/journey.js +1 -1
  75. package/dist/sdk/llm.js +1 -1
  76. package/dist/sdk/query.js +1 -1
  77. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  78. package/dist/sdk/segment/journey-yaml.js +1 -1
  79. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  80. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  81. package/dist/sdk/segment.js +1 -1
  82. package/dist/sdk/user.js +1 -1
  83. package/dist/sdk/workflow.js +1 -1
  84. package/dist/types/endpoints.js +1 -1
  85. package/dist/types/index.js +1 -1
  86. package/dist/utils/agent-config.js +1 -1
  87. package/dist/utils/agent-ref-parser.js +1 -1
  88. package/dist/utils/async.js +1 -1
  89. package/dist/utils/chat-cache.js +1 -1
  90. package/dist/utils/colors.js +1 -1
  91. package/dist/utils/command-output.js +1 -1
  92. package/dist/utils/constants.js +1 -1
  93. package/dist/utils/diff.js +1 -1
  94. package/dist/utils/fields-display.js +1 -1
  95. package/dist/utils/file-permissions.js +1 -1
  96. package/dist/utils/format-detector.js +1 -1
  97. package/dist/utils/formatters.js +1 -1
  98. package/dist/utils/journey-utils.js +1 -1
  99. package/dist/utils/json-loader.js +1 -1
  100. package/dist/utils/llm-backup-utils.js +1 -1
  101. package/dist/utils/model-aliases.js +1 -1
  102. package/dist/utils/model-factors.js +1 -1
  103. package/dist/utils/option-validation.js +1 -1
  104. package/dist/utils/port.js +1 -1
  105. package/dist/utils/process.js +1 -1
  106. package/dist/utils/prompt.js +1 -1
  107. package/dist/utils/segment-path-parser.js +1 -1
  108. package/dist/utils/segment-ref-parser.js +1 -1
  109. package/dist/utils/spinner.js +1 -1
  110. package/dist/utils/sql-parser.js +1 -1
  111. package/dist/utils/sse-parser.js +1 -1
  112. package/dist/utils/string-utils.js +1 -1
  113. package/dist/utils/table-ref-parser.js +1 -1
  114. package/dist/utils/tdx-config.js +1 -1
  115. package/dist/utils/tdx-logger.js +1 -1
  116. package/dist/utils/tree-formatter.js +1 -1
  117. package/dist/utils/version-check.js +1 -1
  118. package/dist/utils/workflow-utils.js +1 -1
  119. package/package.json +1 -1
@@ -1 +1 @@
1
- function a42_0x16d6(_0x174730,_0x15dc8f){_0x174730=_0x174730-0xc6;const _0x23b895=a42_0x23b8();let _0x16d61d=_0x23b895[_0x174730];return _0x16d61d;}const a42_0x483236=a42_0x16d6;(function(_0x13e9c5,_0x4c2018){const _0x34594c=a42_0x16d6,_0x316fa1=_0x13e9c5();while(!![]){try{const _0x5cfc2b=parseInt(_0x34594c(0xf3))/0x1*(parseInt(_0x34594c(0xf0))/0x2)+parseInt(_0x34594c(0xee))/0x3+parseInt(_0x34594c(0xe9))/0x4*(-parseInt(_0x34594c(0xe6))/0x5)+-parseInt(_0x34594c(0xe5))/0x6+-parseInt(_0x34594c(0xec))/0x7+parseInt(_0x34594c(0xe3))/0x8*(parseInt(_0x34594c(0xea))/0x9)+-parseInt(_0x34594c(0xf5))/0xa*(-parseInt(_0x34594c(0xc6))/0xb);if(_0x5cfc2b===_0x4c2018)break;else _0x316fa1['push'](_0x316fa1['shift']());}catch(_0x42c09b){_0x316fa1['push'](_0x316fa1['shift']());}}}(a42_0x23b8,0x1b062));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists}from'../core/profile.js';import{GlobalContext}from'../core/global-context.js';function a42_0x23b8(){const _0x4b9cd4=['Session\x20profile\x20set\x20to:\x20','name','execute','Session\x20llm_project\x20set\x20to:\x20','Error:\x20Profile\x20\x27','Session\x20parent_segment\x20set\x20to:\x20','clear','Session\x20engage_workspace\x20set\x20to:\x20','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','Session\x20agent\x20set\x20to:\x20','database','toString','validate','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','message','42744GEiDZC','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace','1232340JkPsDx','5WZtWcz','log','llm_agent','420632IhrtTK','333lpmCot','debug','1385748qEFqOB','session','655707jsohWv','agent','2kXciHF','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','displayWithSources','163963kEWUls','Error:\x20','129930zoPGeY','cleared','.\x20Must\x20be\x20one\x20of:\x20','description','green','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','33VGzlTW','Session\x20context\x20','includes','(session:\x20','error','\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','engage_workspace','join','dim','parent_segment','llm_project','length'];a42_0x23b8=function(){return _0x4b9cd4;};return a42_0x23b8();}import{parseAgentRef}from'../utils/agent-ref-parser.js';import a42_0x31a87a from'chalk';export class UseCommand extends BaseCommand{[a42_0x483236(0xd3)]='use';[a42_0x483236(0xf8)]='Set\x20session-level\x20context';[a42_0x483236(0xde)](_0x199086){const _0x36e2db=a42_0x483236,{args:_0x35ab75}=_0x199086;if(_0x35ab75[_0x36e2db(0xd1)]===0x0)return undefined;if(_0x35ab75[_0x36e2db(0xd1)]===0x1)return _0x36e2db(0xf1)+_0x36e2db(0xcb)+_0x36e2db(0xfa)+_0x36e2db(0xe1)+'\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options';const _0x385657=_0x35ab75[0x0],_0x2d7850=[_0x36e2db(0xdc),_0x36e2db(0xcf),_0x36e2db(0xd0),_0x36e2db(0xef),'profile',_0x36e2db(0xcc)];if(!_0x2d7850[_0x36e2db(0xc8)](_0x385657))return'Invalid\x20resource:\x20'+_0x385657+_0x36e2db(0xf7)+_0x2d7850[_0x36e2db(0xcd)](',\x20');return undefined;}async[a42_0x483236(0xd4)](_0x3f4aac){const _0x2c4f6c=a42_0x483236,{args:_0x1dca08,options:_0x1235bb}=_0x3f4aac,_0x2d4720=_0x1235bb[_0x2c4f6c(0xeb)],_0x22a50a=_0x1235bb[_0x2c4f6c(0xd8)];cleanExpiredSessions();try{if(_0x22a50a){clearSessionContext(_0x1235bb[_0x2c4f6c(0xed)]);const _0x465171=_0x1235bb[_0x2c4f6c(0xed)]||getCurrentSessionPID()[_0x2c4f6c(0xdd)]();return console[_0x2c4f6c(0xe7)](_0x2c4f6c(0xc7)+a42_0x31a87a[_0x2c4f6c(0xf9)](_0x2c4f6c(0xf6))+'\x20'+a42_0x31a87a[_0x2c4f6c(0xce)](_0x2c4f6c(0xc9)+_0x465171+')')),0x0;}if(_0x1dca08[_0x2c4f6c(0xd1)]===0x0){const _0x16b05c=new GlobalContext(_0x1235bb);return _0x2d4720?_0x16b05c[_0x2c4f6c(0xf2)]():_0x16b05c['display'](),console['log'](a42_0x31a87a[_0x2c4f6c(0xce)](_0x2c4f6c(0xdf))),console[_0x2c4f6c(0xe7)](a42_0x31a87a['dim'](_0x2c4f6c(0xe4))),0x0;}const _0x42d63d=_0x1dca08[0x0],_0x2cb995=_0x1dca08[0x1];if(_0x42d63d==='profile'){if(!profileExists(_0x2cb995))return console[_0x2c4f6c(0xca)](_0x2c4f6c(0xd6)+_0x2cb995+'\x27\x20does\x20not\x20exist'),console[_0x2c4f6c(0xca)](_0x2c4f6c(0xda)),0x1;const _0x48af84=_0x1235bb[_0x2c4f6c(0xed)]||getCurrentSessionPID()[_0x2c4f6c(0xdd)]();return saveSessionContext({'profile':_0x2cb995},_0x1235bb[_0x2c4f6c(0xed)]),console[_0x2c4f6c(0xe7)](_0x2c4f6c(0xd2)+a42_0x31a87a['green'](_0x2cb995)+'\x20'+a42_0x31a87a[_0x2c4f6c(0xce)](_0x2c4f6c(0xc9)+_0x48af84+')')),console['log'](a42_0x31a87a[_0x2c4f6c(0xce)](_0x2c4f6c(0xe0))),0x0;}const _0x19c5f6={},_0x57761b=_0x1235bb[_0x2c4f6c(0xed)]||getCurrentSessionPID()[_0x2c4f6c(0xdd)]();switch(_0x42d63d){case'database':_0x19c5f6['database']=_0x2cb995,console[_0x2c4f6c(0xe7)]('Session\x20database\x20set\x20to:\x20'+a42_0x31a87a[_0x2c4f6c(0xf9)](_0x2cb995)+'\x20'+a42_0x31a87a[_0x2c4f6c(0xce)](_0x2c4f6c(0xc9)+_0x57761b+')'));break;case'parent_segment':_0x19c5f6['parent_segment']=_0x2cb995,console[_0x2c4f6c(0xe7)](_0x2c4f6c(0xd7)+a42_0x31a87a[_0x2c4f6c(0xf9)](_0x2cb995)+'\x20'+a42_0x31a87a[_0x2c4f6c(0xce)](_0x2c4f6c(0xc9)+_0x57761b+')'));break;case _0x2c4f6c(0xd0):_0x19c5f6[_0x2c4f6c(0xd0)]=_0x2cb995,console[_0x2c4f6c(0xe7)](_0x2c4f6c(0xd5)+a42_0x31a87a['green'](_0x2cb995)+'\x20'+a42_0x31a87a[_0x2c4f6c(0xce)](_0x2c4f6c(0xc9)+_0x57761b+')'));break;case _0x2c4f6c(0xef):{const {projectName:_0x2ccec5,agentName:_0x188d7a}=parseAgentRef(_0x2cb995);_0x188d7a?(_0x19c5f6[_0x2c4f6c(0xd0)]=_0x2ccec5,_0x19c5f6[_0x2c4f6c(0xe8)]=_0x188d7a,console[_0x2c4f6c(0xe7)](_0x2c4f6c(0xd5)+a42_0x31a87a[_0x2c4f6c(0xf9)](_0x2ccec5)+'\x20'+a42_0x31a87a['dim'](_0x2c4f6c(0xc9)+_0x57761b+')')),console[_0x2c4f6c(0xe7)](_0x2c4f6c(0xdb)+a42_0x31a87a[_0x2c4f6c(0xf9)](_0x188d7a)+'\x20'+a42_0x31a87a['dim'](_0x2c4f6c(0xc9)+_0x57761b+')'))):(_0x19c5f6[_0x2c4f6c(0xe8)]=_0x2cb995,console['log'](_0x2c4f6c(0xdb)+a42_0x31a87a[_0x2c4f6c(0xf9)](_0x2cb995)+'\x20'+a42_0x31a87a[_0x2c4f6c(0xce)]('(session:\x20'+_0x57761b+')')));break;}case _0x2c4f6c(0xcc):_0x19c5f6[_0x2c4f6c(0xcc)]=_0x2cb995,console[_0x2c4f6c(0xe7)](_0x2c4f6c(0xd9)+a42_0x31a87a[_0x2c4f6c(0xf9)](_0x2cb995)+'\x20'+a42_0x31a87a['dim']('(session:\x20'+_0x57761b+')'));break;}return saveSessionContext(_0x19c5f6,_0x1235bb[_0x2c4f6c(0xed)]),console[_0x2c4f6c(0xe7)](a42_0x31a87a[_0x2c4f6c(0xce)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides')),0x0;}catch(_0x3b2214){return _0x3b2214 instanceof Error&&console[_0x2c4f6c(0xca)](_0x2c4f6c(0xf4)+_0x3b2214[_0x2c4f6c(0xe2)]),0x1;}}}
1
+ const a42_0x58251d=a42_0x37dc;(function(_0x5806c3,_0x11dd96){const _0x4e40a5=a42_0x37dc,_0x4523d9=_0x5806c3();while(!![]){try{const _0xdba4f0=parseInt(_0x4e40a5(0x1f5))/0x1*(-parseInt(_0x4e40a5(0x202))/0x2)+parseInt(_0x4e40a5(0x200))/0x3+parseInt(_0x4e40a5(0x20b))/0x4*(parseInt(_0x4e40a5(0x211))/0x5)+parseInt(_0x4e40a5(0x221))/0x6*(parseInt(_0x4e40a5(0x1fb))/0x7)+parseInt(_0x4e40a5(0x1fe))/0x8*(-parseInt(_0x4e40a5(0x216))/0x9)+-parseInt(_0x4e40a5(0x212))/0xa+parseInt(_0x4e40a5(0x205))/0xb;if(_0xdba4f0===_0x11dd96)break;else _0x4523d9['push'](_0x4523d9['shift']());}catch(_0x18dfa1){_0x4523d9['push'](_0x4523d9['shift']());}}}(a42_0x5481,0x76b9b));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists}from'../core/profile.js';import{GlobalContext}from'../core/global-context.js';import{parseAgentRef}from'../utils/agent-ref-parser.js';function a42_0x5481(){const _0x4e5e73=['8171416uFwXqv','displayWithSources','\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','session','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','length','25136ThYomH','description','validate','clear','error','engage_workspace','445EDvFvh','2642070fGJEjf','Session\x20engage_workspace\x20set\x20to:\x20','llm_agent','cleared','26253XEFDIr','Set\x20session-level\x20context','parent_segment','debug','Session\x20database\x20set\x20to:\x20','display','toString','\x27\x20does\x20not\x20exist','llm_project','database','green','12qzTFWo','execute','log','use','Session\x20llm_project\x20set\x20to:\x20','profile','name','Session\x20agent\x20set\x20to:\x20','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','message','Session\x20context\x20','3814NGEFVk','Session\x20profile\x20set\x20to:\x20','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Session\x20parent_segment\x20set\x20to:\x20','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','includes','456904sWrhyS','agent','Error:\x20','2056JRFWWr','dim','568641Cwrraf','(session:\x20','64PQqghu','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options'];a42_0x5481=function(){return _0x4e5e73;};return a42_0x5481();}function a42_0x37dc(_0x3fca37,_0x1ab139){_0x3fca37=_0x3fca37-0x1f4;const _0x5481df=a42_0x5481();let _0x37dc8c=_0x5481df[_0x3fca37];return _0x37dc8c;}import a42_0x2a98a5 from'chalk';export class UseCommand extends BaseCommand{[a42_0x58251d(0x227)]=a42_0x58251d(0x224);[a42_0x58251d(0x20c)]=a42_0x58251d(0x217);[a42_0x58251d(0x20d)](_0x1f8812){const _0x14abb4=a42_0x58251d,{args:_0xd71706}=_0x1f8812;if(_0xd71706[_0x14abb4(0x20a)]===0x0)return undefined;if(_0xd71706[_0x14abb4(0x20a)]===0x1)return _0x14abb4(0x1f9)+'\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'+_0x14abb4(0x203)+_0x14abb4(0x207)+_0x14abb4(0x204);const _0x519f63=_0xd71706[0x0],_0x26e8c5=[_0x14abb4(0x21f),_0x14abb4(0x218),_0x14abb4(0x21e),_0x14abb4(0x1fc),_0x14abb4(0x226),_0x14abb4(0x210)];if(!_0x26e8c5[_0x14abb4(0x1fa)](_0x519f63))return'Invalid\x20resource:\x20'+_0x519f63+'.\x20Must\x20be\x20one\x20of:\x20'+_0x26e8c5['join'](',\x20');return undefined;}async[a42_0x58251d(0x222)](_0x1dabff){const _0x3a984d=a42_0x58251d,{args:_0x3f47cf,options:_0x532292}=_0x1dabff,_0x477d7a=_0x532292[_0x3a984d(0x219)],_0x81af7c=_0x532292[_0x3a984d(0x20e)];cleanExpiredSessions();try{if(_0x81af7c){clearSessionContext(_0x532292[_0x3a984d(0x208)]);const _0x349a6c=_0x532292[_0x3a984d(0x208)]||getCurrentSessionPID()[_0x3a984d(0x21c)]();return console[_0x3a984d(0x223)](_0x3a984d(0x1f4)+a42_0x2a98a5[_0x3a984d(0x220)](_0x3a984d(0x215))+'\x20'+a42_0x2a98a5[_0x3a984d(0x1ff)]('(session:\x20'+_0x349a6c+')')),0x0;}if(_0x3f47cf[_0x3a984d(0x20a)]===0x0){const _0x536fb5=new GlobalContext(_0x532292);return _0x477d7a?_0x536fb5[_0x3a984d(0x206)]():_0x536fb5[_0x3a984d(0x21b)](),console[_0x3a984d(0x223)](a42_0x2a98a5['dim'](_0x3a984d(0x229))),console[_0x3a984d(0x223)](a42_0x2a98a5[_0x3a984d(0x1ff)]('Resources:\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace')),0x0;}const _0x16707d=_0x3f47cf[0x0],_0x1ecfea=_0x3f47cf[0x1];if(_0x16707d===_0x3a984d(0x226)){if(!profileExists(_0x1ecfea))return console[_0x3a984d(0x20f)]('Error:\x20Profile\x20\x27'+_0x1ecfea+_0x3a984d(0x21d)),console[_0x3a984d(0x20f)](_0x3a984d(0x209)),0x1;const _0x1de8f6=_0x532292[_0x3a984d(0x208)]||getCurrentSessionPID()[_0x3a984d(0x21c)]();return saveSessionContext({'profile':_0x1ecfea},_0x532292['session']),console[_0x3a984d(0x223)](_0x3a984d(0x1f6)+a42_0x2a98a5[_0x3a984d(0x220)](_0x1ecfea)+'\x20'+a42_0x2a98a5[_0x3a984d(0x1ff)](_0x3a984d(0x201)+_0x1de8f6+')')),console['log'](a42_0x2a98a5[_0x3a984d(0x1ff)](_0x3a984d(0x1f7))),0x0;}const _0x1754fa={},_0xabbb75=_0x532292[_0x3a984d(0x208)]||getCurrentSessionPID()[_0x3a984d(0x21c)]();switch(_0x16707d){case _0x3a984d(0x21f):_0x1754fa[_0x3a984d(0x21f)]=_0x1ecfea,console['log'](_0x3a984d(0x21a)+a42_0x2a98a5[_0x3a984d(0x220)](_0x1ecfea)+'\x20'+a42_0x2a98a5[_0x3a984d(0x1ff)](_0x3a984d(0x201)+_0xabbb75+')'));break;case _0x3a984d(0x218):_0x1754fa[_0x3a984d(0x218)]=_0x1ecfea,console['log'](_0x3a984d(0x1f8)+a42_0x2a98a5['green'](_0x1ecfea)+'\x20'+a42_0x2a98a5[_0x3a984d(0x1ff)](_0x3a984d(0x201)+_0xabbb75+')'));break;case _0x3a984d(0x21e):_0x1754fa[_0x3a984d(0x21e)]=_0x1ecfea,console['log'](_0x3a984d(0x225)+a42_0x2a98a5['green'](_0x1ecfea)+'\x20'+a42_0x2a98a5[_0x3a984d(0x1ff)](_0x3a984d(0x201)+_0xabbb75+')'));break;case _0x3a984d(0x1fc):{const {projectName:_0x2e4a4d,agentName:_0xc09c1e}=parseAgentRef(_0x1ecfea);_0xc09c1e?(_0x1754fa[_0x3a984d(0x21e)]=_0x2e4a4d,_0x1754fa[_0x3a984d(0x214)]=_0xc09c1e,console[_0x3a984d(0x223)](_0x3a984d(0x225)+a42_0x2a98a5[_0x3a984d(0x220)](_0x2e4a4d)+'\x20'+a42_0x2a98a5['dim'](_0x3a984d(0x201)+_0xabbb75+')')),console[_0x3a984d(0x223)](_0x3a984d(0x228)+a42_0x2a98a5['green'](_0xc09c1e)+'\x20'+a42_0x2a98a5[_0x3a984d(0x1ff)](_0x3a984d(0x201)+_0xabbb75+')'))):(_0x1754fa['llm_agent']=_0x1ecfea,console[_0x3a984d(0x223)]('Session\x20agent\x20set\x20to:\x20'+a42_0x2a98a5[_0x3a984d(0x220)](_0x1ecfea)+'\x20'+a42_0x2a98a5[_0x3a984d(0x1ff)]('(session:\x20'+_0xabbb75+')')));break;}case _0x3a984d(0x210):_0x1754fa[_0x3a984d(0x210)]=_0x1ecfea,console[_0x3a984d(0x223)](_0x3a984d(0x213)+a42_0x2a98a5[_0x3a984d(0x220)](_0x1ecfea)+'\x20'+a42_0x2a98a5[_0x3a984d(0x1ff)](_0x3a984d(0x201)+_0xabbb75+')'));break;}return saveSessionContext(_0x1754fa,_0x532292[_0x3a984d(0x208)]),console[_0x3a984d(0x223)](a42_0x2a98a5['dim'](_0x3a984d(0x1f7))),0x0;}catch(_0xff3a42){return _0xff3a42 instanceof Error&&console[_0x3a984d(0x20f)](_0x3a984d(0x1fd)+_0xff3a42[_0x3a984d(0x22a)]),0x1;}}}
@@ -1 +1 @@
1
- const a43_0x4c971b=a43_0x8c4c;(function(_0x28e80e,_0x1999ce){const _0x580d27=a43_0x8c4c,_0x17a59a=_0x28e80e();while(!![]){try{const _0x2af664=-parseInt(_0x580d27(0x10c))/0x1*(parseInt(_0x580d27(0x108))/0x2)+parseInt(_0x580d27(0x105))/0x3*(parseInt(_0x580d27(0x119))/0x4)+-parseInt(_0x580d27(0x104))/0x5+parseInt(_0x580d27(0x11c))/0x6*(-parseInt(_0x580d27(0x114))/0x7)+-parseInt(_0x580d27(0x109))/0x8*(parseInt(_0x580d27(0x10b))/0x9)+-parseInt(_0x580d27(0x11a))/0xa+parseInt(_0x580d27(0x113))/0xb*(parseInt(_0x580d27(0x111))/0xc);if(_0x2af664===_0x1999ce)break;else _0x17a59a['push'](_0x17a59a['shift']());}catch(_0x1657da){_0x17a59a['push'](_0x17a59a['shift']());}}}(a43_0x1e18,0x671b5));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';function a43_0x1e18(){const _0x456475=['Show\x20current\x20user\x20information','cause','84YbwYqG','Fetching\x20user\x20info...','2903791XoCEbm','21STnhHs','Error:\x20','user','getCurrent','description','8IJBnyj','7483900ntSYWJ','\x20user','168306sobKsD','Listing\x20users...','message','length','\x20\x20Cause:\x20','3540270tFdPHj','1177383kAzBQn','error','execute','8TxEMEI','56RoYPRE','list','608733HXxkmL','49102tfdAXF','name','data'];a43_0x1e18=function(){return _0x456475;};return a43_0x1e18();}function a43_0x8c4c(_0x5b69b7,_0x330f6d){_0x5b69b7=_0x5b69b7-0x100;const _0x1e187e=a43_0x1e18();let _0x8c4c2=_0x1e187e[_0x5b69b7];return _0x8c4c2;}import{withSpinner}from'../utils/spinner.js';export class UserCommand extends BaseCommand{[a43_0x4c971b(0x10d)]=a43_0x4c971b(0x116);[a43_0x4c971b(0x118)]=a43_0x4c971b(0x10f);async[a43_0x4c971b(0x107)](_0x17def5){const _0x5d3567=a43_0x4c971b,{options:_0x34997e,tdx:_0x257c76}=_0x17def5;try{const _0x4d4361=await withSpinner(_0x5d3567(0x112),()=>_0x257c76['user'][_0x5d3567(0x117)](),{'verbose':_0x34997e['verbose']}),_0x3ba207=_0x4d4361['data'];return await handleSingleObjectOutput(_0x3ba207,_0x34997e),0x0;}catch(_0x1e9984){if(_0x1e9984 instanceof SDKError)return console['error']('Error:\x20'+_0x1e9984[_0x5d3567(0x101)]),_0x1e9984[_0x5d3567(0x110)]&&console[_0x5d3567(0x106)](_0x5d3567(0x103)+_0x1e9984[_0x5d3567(0x110)]),0x1;throw _0x1e9984;}}}export class UserListCommand extends BaseCommand{[a43_0x4c971b(0x10d)]='user\x20list';[a43_0x4c971b(0x118)]='List\x20all\x20users\x20in\x20the\x20account';async['execute'](_0x34ab59){const _0x5d4800=a43_0x4c971b,{options:_0x536341,tdx:_0x61c1e1}=_0x34ab59;try{const _0x335f4c=await withSpinner(_0x5d4800(0x100),()=>_0x61c1e1[_0x5d4800(0x116)][_0x5d4800(0x10a)](),{'verbose':_0x536341['verbose']}),_0x45296a=_0x335f4c[_0x5d4800(0x10e)];return console[_0x5d4800(0x106)]('✔\x20Found\x20'+_0x45296a[_0x5d4800(0x102)]+_0x5d4800(0x11b)+(_0x45296a[_0x5d4800(0x102)]!==0x1?'s':'')),await handleSDKOutput(_0x45296a,_0x536341),0x0;}catch(_0x48d23c){if(_0x48d23c instanceof SDKError)return console[_0x5d4800(0x106)](_0x5d4800(0x115)+_0x48d23c['message']),_0x48d23c[_0x5d4800(0x110)]&&console['error']('\x20\x20Cause:\x20'+_0x48d23c[_0x5d4800(0x110)]),0x1;throw _0x48d23c;}}}
1
+ const a43_0x4f1ab2=a43_0x1200;(function(_0x378487,_0x710e97){const _0x4caa47=a43_0x1200,_0x2e37ac=_0x378487();while(!![]){try{const _0x8e30b2=parseInt(_0x4caa47(0x121))/0x1*(parseInt(_0x4caa47(0x122))/0x2)+parseInt(_0x4caa47(0x110))/0x3+parseInt(_0x4caa47(0x11a))/0x4+parseInt(_0x4caa47(0x115))/0x5+parseInt(_0x4caa47(0x112))/0x6*(parseInt(_0x4caa47(0x125))/0x7)+parseInt(_0x4caa47(0x123))/0x8+-parseInt(_0x4caa47(0x129))/0x9*(parseInt(_0x4caa47(0x10f))/0xa);if(_0x8e30b2===_0x710e97)break;else _0x2e37ac['push'](_0x2e37ac['shift']());}catch(_0x2c41ea){_0x2e37ac['push'](_0x2e37ac['shift']());}}}(a43_0x147f,0xd8684));import{BaseCommand}from'./command.js';function a43_0x1200(_0x1d388b,_0x19dd41){_0x1d388b=_0x1d388b-0x10f;const _0x147fd3=a43_0x147f();let _0x1200b1=_0x147fd3[_0x1d388b];return _0x1200b1;}function a43_0x147f(){const _0x1ecf11=['1866836mkBEqb','Show\x20current\x20user\x20information','cause','user\x20list','✔\x20Found\x20','\x20user','length','36UXuuMp','34Hjplgp','4776960fibyNa','description','7fAQPvn','verbose','Listing\x20users...','name','6696lvMnNA','error','39070dVfCVp','3473682Angdcr','data','2375652JraiEb','getCurrent','Fetching\x20user\x20info...','5874675ChyiSH','execute','list','List\x20all\x20users\x20in\x20the\x20account','user'];a43_0x147f=function(){return _0x1ecf11;};return a43_0x147f();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class UserCommand extends BaseCommand{['name']='user';[a43_0x4f1ab2(0x124)]=a43_0x4f1ab2(0x11b);async[a43_0x4f1ab2(0x116)](_0x51c475){const _0x58c754=a43_0x4f1ab2,{options:_0x6bbcb3,tdx:_0x5587e8}=_0x51c475;try{const _0x47ed71=await withSpinner(_0x58c754(0x114),()=>_0x5587e8[_0x58c754(0x119)][_0x58c754(0x113)](),{'verbose':_0x6bbcb3[_0x58c754(0x126)]}),_0xdbf004=_0x47ed71[_0x58c754(0x111)];return await handleSingleObjectOutput(_0xdbf004,_0x6bbcb3),0x0;}catch(_0x5d524e){if(_0x5d524e instanceof SDKError)return console[_0x58c754(0x12a)]('Error:\x20'+_0x5d524e['message']),_0x5d524e['cause']&&console[_0x58c754(0x12a)]('\x20\x20Cause:\x20'+_0x5d524e['cause']),0x1;throw _0x5d524e;}}}export class UserListCommand extends BaseCommand{[a43_0x4f1ab2(0x128)]=a43_0x4f1ab2(0x11d);[a43_0x4f1ab2(0x124)]=a43_0x4f1ab2(0x118);async[a43_0x4f1ab2(0x116)](_0x747840){const _0x33156c=a43_0x4f1ab2,{options:_0x3c03d5,tdx:_0x3213ae}=_0x747840;try{const _0x337ec1=await withSpinner(_0x33156c(0x127),()=>_0x3213ae[_0x33156c(0x119)][_0x33156c(0x117)](),{'verbose':_0x3c03d5[_0x33156c(0x126)]}),_0x11c57e=_0x337ec1[_0x33156c(0x111)];return console[_0x33156c(0x12a)](_0x33156c(0x11e)+_0x11c57e[_0x33156c(0x120)]+_0x33156c(0x11f)+(_0x11c57e[_0x33156c(0x120)]!==0x1?'s':'')),await handleSDKOutput(_0x11c57e,_0x3c03d5),0x0;}catch(_0x2fb15){if(_0x2fb15 instanceof SDKError)return console[_0x33156c(0x12a)]('Error:\x20'+_0x2fb15['message']),_0x2fb15[_0x33156c(0x11c)]&&console['error']('\x20\x20Cause:\x20'+_0x2fb15['cause']),0x1;throw _0x2fb15;}}}
@@ -1 +1 @@
1
- const a44_0x271447=a44_0x1a3a;(function(_0x46a887,_0x5c17cd){const _0xeecdff=a44_0x1a3a,_0x2dd917=_0x46a887();while(!![]){try{const _0x4290c5=parseInt(_0xeecdff(0xb8))/0x1+-parseInt(_0xeecdff(0xcf))/0x2*(-parseInt(_0xeecdff(0xb4))/0x3)+parseInt(_0xeecdff(0x106))/0x4*(-parseInt(_0xeecdff(0xca))/0x5)+parseInt(_0xeecdff(0xd7))/0x6*(parseInt(_0xeecdff(0x11f))/0x7)+parseInt(_0xeecdff(0xd4))/0x8*(-parseInt(_0xeecdff(0x126))/0x9)+-parseInt(_0xeecdff(0x155))/0xa*(parseInt(_0xeecdff(0xe8))/0xb)+parseInt(_0xeecdff(0x146))/0xc;if(_0x4290c5===_0x5c17cd)break;else _0x2dd917['push'](_0x2dd917['shift']());}catch(_0x4c2a83){_0x2dd917['push'](_0x2dd917['shift']());}}}(a44_0x2d94,0x607e1));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{formatBytes}from'../utils/formatters.js';import a44_0x4f8c1e from'prompts';export class WorkflowProjectsCommand extends BaseCommand{['name']='workflow:projects';['description']=a44_0x271447(0x152);async[a44_0x271447(0xe1)](_0x2ad5fc){const _0x55d7c3=a44_0x271447,{options:_0x2fb7e1,args:_0x23d384,tdx:_0x3c65f3}=_0x2ad5fc,_0x468963=_0x23d384[0x0];try{_0x2fb7e1['verbose']&&_0x468963&&console['error'](_0x55d7c3(0x114)+_0x468963);const _0x2efaf6=await withSpinner(_0x55d7c3(0x158),()=>_0x3c65f3[_0x55d7c3(0xfe)][_0x55d7c3(0x112)](_0x468963,{'limit':_0x2fb7e1[_0x55d7c3(0x118)]}),{'verbose':_0x2fb7e1[_0x55d7c3(0x12c)]}),_0x3c2197=_0x2efaf6[_0x55d7c3(0xcd)];return console[_0x55d7c3(0x147)](_0x55d7c3(0xc2)+_0x3c2197[_0x55d7c3(0xd9)]+'\x20project'+(_0x3c2197[_0x55d7c3(0xd9)]!==0x1?'s':'')),await handleSDKOutput(_0x3c2197,_0x2fb7e1),0x0;}catch(_0x290bf4){if(_0x290bf4 instanceof SDKError)return console[_0x55d7c3(0x147)]('Error:\x20'+_0x290bf4[_0x55d7c3(0xb3)]),_0x290bf4[_0x55d7c3(0x137)]&&console[_0x55d7c3(0x147)]('\x20\x20Cause:\x20'+_0x290bf4[_0x55d7c3(0x137)]),0x1;throw _0x290bf4;}}}export class WorkflowWorkflowsCommand extends BaseCommand{['name']=a44_0x271447(0xf7);[a44_0x271447(0x13a)]='List\x20workflows';async[a44_0x271447(0xe1)](_0x413459){const _0x5a880a=a44_0x271447,{options:_0xcd8dde,args:_0x59b274,tdx:_0x160855}=_0x413459,_0x1f084e=_0x59b274[0x0];try{_0xcd8dde['verbose']&&_0x1f084e&&console[_0x5a880a(0x147)]('Project\x20filter:\x20'+_0x1f084e);const _0x44cc12=await withSpinner(_0x5a880a(0x11a),()=>_0x160855[_0x5a880a(0xfe)][_0x5a880a(0xf2)](_0x1f084e,{'limit':_0xcd8dde[_0x5a880a(0x118)]}),{'verbose':_0xcd8dde[_0x5a880a(0x12c)]}),_0x135bbe=_0x44cc12[_0x5a880a(0xcd)];return console[_0x5a880a(0x147)](_0x5a880a(0xc2)+_0x135bbe[_0x5a880a(0xd9)]+_0x5a880a(0x15d)+(_0x135bbe[_0x5a880a(0xd9)]!==0x1?'s':'')),await handleSDKOutput(_0x135bbe,_0xcd8dde),0x0;}catch(_0xf27f5f){if(_0xf27f5f instanceof SDKError)return console[_0x5a880a(0x147)]('Error:\x20'+_0xf27f5f['message']),_0xf27f5f[_0x5a880a(0x137)]&&console['error']('\x20\x20Cause:\x20'+_0xf27f5f[_0x5a880a(0x137)]),0x1;throw _0xf27f5f;}}}export class WorkflowSessionsCommand extends BaseCommand{['name']=a44_0x271447(0x135);[a44_0x271447(0x13a)]='List\x20workflow\x20execution\x20sessions';async[a44_0x271447(0xe1)](_0x10e029){const _0x5b3c54=a44_0x271447,{options:_0x276483,args:_0x1b86c6,tdx:_0x454643}=_0x10e029;let _0x2dcbf4,_0x175076;if(_0x1b86c6[0x0]){const _0x47e6d0=_0x1b86c6[0x0]['split']('.');if(_0x47e6d0[_0x5b3c54(0xd9)]===0x1)_0x2dcbf4=_0x47e6d0[0x0];else{if(_0x47e6d0[_0x5b3c54(0xd9)]===0x2)[_0x2dcbf4,_0x175076]=_0x47e6d0;else return console[_0x5b3c54(0x147)](_0x5b3c54(0x124)),0x1;}}try{if(_0x276483['verbose']){if(_0x2dcbf4&&_0x175076)console[_0x5b3c54(0x147)]('Filter:\x20'+_0x2dcbf4+'.'+_0x175076);else _0x2dcbf4&&console[_0x5b3c54(0x147)](_0x5b3c54(0xdc)+_0x2dcbf4);const _0x4de504=_0x276483[_0x5b3c54(0x13f)];_0x4de504&&console[_0x5b3c54(0x147)](_0x5b3c54(0xc5)+_0x4de504);}const _0x32d872=await withSpinner(_0x5b3c54(0xd5),()=>_0x454643[_0x5b3c54(0xfe)]['sessions']({'projectName':_0x2dcbf4,'workflowName':_0x175076,'status':_0x276483[_0x5b3c54(0x13f)],'fromTime':_0x276483[_0x5b3c54(0xf1)],'toTime':_0x276483['to'],'limit':_0x276483[_0x5b3c54(0x118)]}),{'verbose':_0x276483[_0x5b3c54(0x12c)]}),_0x35839d=_0x32d872[_0x5b3c54(0xcd)];return console['error'](_0x5b3c54(0xc2)+_0x35839d['length']+_0x5b3c54(0xe2)+(_0x35839d['length']!==0x1?'s':'')),await handleSDKOutput(_0x35839d,_0x276483),0x0;}catch(_0x4794c1){if(_0x4794c1 instanceof SDKError)return console[_0x5b3c54(0x147)]('Error:\x20'+_0x4794c1[_0x5b3c54(0xb3)]),_0x4794c1[_0x5b3c54(0x137)]&&console[_0x5b3c54(0x147)](_0x5b3c54(0x131)+_0x4794c1[_0x5b3c54(0x137)]),0x1;throw _0x4794c1;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a44_0x271447(0x128)]=a44_0x271447(0xce);['description']=a44_0x271447(0x121);async['execute'](_0x5bf5cf){const _0x5ad73c=a44_0x271447,{options:_0x3c40cd,args:_0x1bfca7,tdx:_0x4d2fd8}=_0x5bf5cf;let _0x5bb682,_0x21855b;if(_0x1bfca7[0x0]){const _0x4f95ea=_0x1bfca7[0x0][_0x5ad73c(0x15c)]('.');if(_0x4f95ea['length']===0x1)_0x5bb682=_0x4f95ea[0x0];else{if(_0x4f95ea[_0x5ad73c(0xd9)]===0x2)[_0x5bb682,_0x21855b]=_0x4f95ea;else return console[_0x5ad73c(0x147)]('Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),0x1;}}try{const _0xc6ea24=_0x3c40cd[_0x5ad73c(0x13e)];if(_0x3c40cd[_0x5ad73c(0x12c)]){if(_0x5bb682&&_0x21855b)console[_0x5ad73c(0x147)](_0x5ad73c(0x151)+_0x5bb682+'.'+_0x21855b);else _0x5bb682&&console[_0x5ad73c(0x147)](_0x5ad73c(0xdc)+_0x5bb682);_0xc6ea24&&console[_0x5ad73c(0x147)](_0x5ad73c(0xd1));}const _0x3c1346=await withSpinner(_0x5ad73c(0x120),()=>_0x4d2fd8[_0x5ad73c(0xfe)][_0x5ad73c(0x12b)]({'projectName':_0x5bb682,'workflowName':_0x21855b,'includeRetried':_0xc6ea24,'limit':_0x3c40cd['limit']}),{'verbose':_0x3c40cd[_0x5ad73c(0x12c)]}),_0x244aa0=_0x3c1346['data'];return console[_0x5ad73c(0x147)]('✔\x20Found\x20'+_0x244aa0[_0x5ad73c(0xd9)]+'\x20attempt'+(_0x244aa0[_0x5ad73c(0xd9)]!==0x1?'s':'')),await handleSDKOutput(_0x244aa0,_0x3c40cd),0x0;}catch(_0x69f973){if(_0x69f973 instanceof SDKError)return console[_0x5ad73c(0x147)](_0x5ad73c(0x11e)+_0x69f973[_0x5ad73c(0xb3)]),_0x69f973['cause']&&console[_0x5ad73c(0x147)]('\x20\x20Cause:\x20'+_0x69f973[_0x5ad73c(0x137)]),0x1;throw _0x69f973;}}}export class WorkflowAttemptCommand extends BaseCommand{[a44_0x271447(0x128)]=a44_0x271447(0x127);['description']=a44_0x271447(0xec);async[a44_0x271447(0xe1)](_0x18c456){const _0x2be13c=a44_0x271447,{options:_0x300f2d,args:_0x63ec86,tdx:_0x5a8892}=_0x18c456,_0x190f6f=_0x63ec86[0x0];if(!_0x190f6f)return console[_0x2be13c(0x147)](_0x2be13c(0x109)),0x1;try{_0x300f2d[_0x2be13c(0x12c)]&&console[_0x2be13c(0x147)]('Attempt\x20ID:\x20'+_0x190f6f);const _0xca2161=await withSpinner(_0x2be13c(0xae),()=>_0x5a8892['workflow'][_0x2be13c(0xc9)](_0x190f6f),{'verbose':_0x300f2d[_0x2be13c(0x12c)]}),_0x531e5f=_0xca2161[_0x2be13c(0xcd)];let _0x3cc539;!_0x531e5f[_0x2be13c(0x141)]?_0x3cc539=_0x531e5f[_0x2be13c(0x133)]?'canceling':_0x2be13c(0xd8):_0x3cc539=_0x531e5f[_0x2be13c(0x110)]?'success':_0x2be13c(0x147);let _0xaa7c9a;if(_0x531e5f[_0x2be13c(0x123)]&&_0x531e5f[_0x2be13c(0xd0)]){const _0x93afc1=new Date(_0x531e5f[_0x2be13c(0x123)])['getTime'](),_0x43f794=new Date(_0x531e5f[_0x2be13c(0xd0)])[_0x2be13c(0x148)]();_0xaa7c9a=Math[_0x2be13c(0x116)]((_0x43f794-_0x93afc1)/0x3e8);}const _0x3f8d9c={'attempt_id':_0x531e5f['id'],'status':_0x3cc539,..._0x531e5f['index']!==undefined&&{'index':_0x531e5f[_0x2be13c(0x129)]},..._0x531e5f[_0x2be13c(0xf4)]&&{'project':_0x531e5f[_0x2be13c(0xf4)][_0x2be13c(0x128)]},..._0x531e5f['workflow']&&{'workflow':_0x531e5f['workflow'][_0x2be13c(0x128)]},..._0x531e5f['sessionId']&&{'session_id':_0x531e5f[_0x2be13c(0xb5)]},..._0x531e5f[_0x2be13c(0xf9)]&&{'session_time':_0x531e5f[_0x2be13c(0xf9)]},..._0x531e5f[_0x2be13c(0x10d)]&&{'retry_attempt':_0x531e5f[_0x2be13c(0x10d)]},..._0xaa7c9a!==undefined&&{'duration_sec':_0xaa7c9a},..._0x531e5f[_0x2be13c(0x123)]&&{'created_at':_0x531e5f['createdAt']},..._0x531e5f[_0x2be13c(0xd0)]&&{'finished_at':_0x531e5f['finishedAt']},...Object['keys'](_0x531e5f[_0x2be13c(0xf0)])['length']>0x0&&{'params':_0x531e5f['params']}};return await handleSingleObjectOutput(_0x3f8d9c,_0x300f2d),0x0;}catch(_0x18204c){if(_0x18204c instanceof SDKError)return console[_0x2be13c(0x147)](_0x2be13c(0x11e)+_0x18204c[_0x2be13c(0xb3)]),_0x18204c[_0x2be13c(0x137)]&&console[_0x2be13c(0x147)](_0x2be13c(0x131)+_0x18204c[_0x2be13c(0x137)]),0x1;throw _0x18204c;}}}export class WorkflowTasksCommand extends BaseCommand{['name']=a44_0x271447(0xde);[a44_0x271447(0x13a)]=a44_0x271447(0xe4);async['execute'](_0x2581b4){const _0xd8661a=a44_0x271447,{options:_0x5e9065,args:_0x5cfae0,tdx:_0x5a65ca}=_0x2581b4,_0x15f336=_0x5cfae0[0x0];if(!_0x15f336)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x587a89=_0x5e9065[_0xd8661a(0x10c)];_0x5e9065[_0xd8661a(0x12c)]&&(console[_0xd8661a(0x147)](_0xd8661a(0x11d)+_0x15f336),_0x587a89&&console['error'](_0xd8661a(0x10a)));const _0x4d062b=await withSpinner(_0xd8661a(0x130),()=>_0x5a65ca[_0xd8661a(0xfe)]['tasks'](_0x15f336,_0x587a89||![]),{'verbose':_0x5e9065[_0xd8661a(0x12c)]}),_0x2d1fc2=_0x4d062b[_0xd8661a(0xcd)];return console[_0xd8661a(0x147)](_0xd8661a(0xc2)+_0x2d1fc2[_0xd8661a(0xd9)]+_0xd8661a(0x107)+(_0x2d1fc2['length']!==0x1?'s':'')),await handleSDKOutput(_0x2d1fc2,_0x5e9065),0x0;}catch(_0x54eff9){if(_0x54eff9 instanceof SDKError)return console['error']('Error:\x20'+_0x54eff9[_0xd8661a(0xb3)]),_0x54eff9['cause']&&console[_0xd8661a(0x147)](_0xd8661a(0x131)+_0x54eff9[_0xd8661a(0x137)]),0x1;throw _0x54eff9;}}}function a44_0x1a3a(_0x166b8c,_0x484563){_0x166b8c=_0x166b8c-0xad;const _0x2d9492=a44_0x2d94();let _0x1a3a7e=_0x2d9492[_0x166b8c];return _0x1a3a7e;}export class WorkflowLogsCommand extends BaseCommand{[a44_0x271447(0x128)]=a44_0x271447(0x12a);[a44_0x271447(0x13a)]=a44_0x271447(0x136);async[a44_0x271447(0xe1)](_0x3225af){const _0x1e28d1=a44_0x271447,{options:_0x196a10,args:_0x2820dd,tdx:_0x3e461c}=_0x3225af,_0x50f105=_0x2820dd[0x0];let _0x1f3787=_0x2820dd[0x1];if(!_0x50f105)return console[_0x1e28d1(0x147)](_0x1e28d1(0x109)),0x1;try{_0x196a10[_0x1e28d1(0x12c)]&&(console['error'](_0x1e28d1(0x11d)+_0x50f105),_0x1f3787&&console[_0x1e28d1(0x147)]('Task\x20name:\x20'+_0x1f3787));const _0x34821c=await withSpinner('Fetching\x20log\x20files...',()=>_0x3e461c[_0x1e28d1(0xfe)][_0x1e28d1(0x14c)](_0x50f105,_0x1f3787),{'verbose':_0x196a10[_0x1e28d1(0x12c)]}),_0x3ad980=_0x34821c['data'];if(_0x3ad980[_0x1e28d1(0xd9)]===0x0)return console[_0x1e28d1(0x147)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x1f3787&&(_0x196a10[_0x1e28d1(0x13c)]||_0x196a10[_0x1e28d1(0xbd)]))return await handleSDKOutput(_0x3ad980,_0x196a10),0x0;if(!_0x1f3787){const _0x163109=_0x3ad980[_0x1e28d1(0x119)](_0x162795=>({'title':_0x162795[_0x1e28d1(0xe7)]+'\x20('+formatBytes(_0x162795[_0x1e28d1(0x14e)])+')','value':_0x162795[_0x1e28d1(0xe7)]})),_0xa54e0c=await a44_0x4f8c1e({'type':_0x1e28d1(0xfd),'name':'task','message':_0x1e28d1(0x12e),'choices':_0x163109});if(!_0xa54e0c[_0x1e28d1(0x122)])return console[_0x1e28d1(0x147)]('Cancelled'),0x0;_0x1f3787=_0xa54e0c[_0x1e28d1(0x122)];}const _0xef422e=await withSpinner(_0x1e28d1(0x11b),()=>_0x3e461c['workflow'][_0x1e28d1(0xb6)](_0x50f105,_0x1f3787),{'verbose':_0x196a10[_0x1e28d1(0x12c)]}),_0x323800=_0xef422e['data'];return _0x323800?console[_0x1e28d1(0x144)](_0x323800):console[_0x1e28d1(0x147)](_0x1e28d1(0xc8)),0x0;}catch(_0x2e7e21){if(_0x2e7e21 instanceof SDKError)return console[_0x1e28d1(0x147)](_0x1e28d1(0x11e)+_0x2e7e21[_0x1e28d1(0xb3)]),_0x2e7e21[_0x1e28d1(0x137)]&&console[_0x1e28d1(0x147)]('\x20\x20Cause:\x20'+_0x2e7e21['cause']),0x1;throw _0x2e7e21;}}}export class WorkflowKillCommand extends BaseCommand{[a44_0x271447(0x128)]='workflow:kill';[a44_0x271447(0x13a)]='Kill\x20a\x20running\x20attempt';async[a44_0x271447(0xe1)](_0x148128){const _0x4f018e=a44_0x271447,{options:_0x19d615,args:_0x584af8,tdx:_0x7cbde9}=_0x148128,_0x5dedb3=_0x584af8[0x0];if(!_0x5dedb3)return console[_0x4f018e(0x147)](_0x4f018e(0x109)),0x1;try{const _0x247cce=_0x19d615[_0x4f018e(0xf5)];_0x19d615[_0x4f018e(0x12c)]&&(console[_0x4f018e(0x147)](_0x4f018e(0x11d)+_0x5dedb3),_0x247cce&&console[_0x4f018e(0x147)](_0x4f018e(0x13b)+_0x247cce));if(!_0x19d615[_0x4f018e(0x103)]){const _0x1c3734=await confirm(_0x4f018e(0xbe)+_0x5dedb3+'?');if(!_0x1c3734)return console['error'](_0x4f018e(0x15e)),0x0;}const _0x1ccb2e=await withSpinner(_0x4f018e(0xc4),()=>_0x7cbde9[_0x4f018e(0xfe)][_0x4f018e(0xc0)](_0x5dedb3,_0x247cce),{'verbose':_0x19d615[_0x4f018e(0x12c)]}),_0x58df25=_0x1ccb2e[_0x4f018e(0xcd)];return console[_0x4f018e(0x147)]('✔\x20'+_0x58df25),0x0;}catch(_0x48e167){if(_0x48e167 instanceof SDKError)return console[_0x4f018e(0x147)]('Error:\x20'+_0x48e167[_0x4f018e(0xb3)]),_0x48e167['cause']&&console[_0x4f018e(0x147)](_0x4f018e(0x131)+_0x48e167['cause']),0x1;throw _0x48e167;}}}export class WorkflowRetryCommand extends BaseCommand{[a44_0x271447(0x128)]=a44_0x271447(0xda);[a44_0x271447(0x13a)]=a44_0x271447(0x115);async[a44_0x271447(0xe1)](_0xde2a87){const _0x45ef13=a44_0x271447,{options:_0x27d47e,args:_0x243763,tdx:_0x552c5f}=_0xde2a87,_0x703f49=_0x243763[0x0];if(!_0x703f49)return console[_0x45ef13(0x147)](_0x45ef13(0xf6)),console[_0x45ef13(0x147)](_0x45ef13(0x11c)),0x1;let _0x5b459c=![],_0x1b328e=_0x703f49;if(_0x703f49[_0x45ef13(0xb7)](_0x45ef13(0x150)))_0x5b459c=!![],_0x1b328e=_0x703f49[_0x45ef13(0xee)](0x8);else{if(_0x703f49[_0x45ef13(0xb7)](_0x45ef13(0xbf)))_0x5b459c=![],_0x1b328e=_0x703f49[_0x45ef13(0xee)](0x8);else return console[_0x45ef13(0x147)](_0x45ef13(0xdd)),console[_0x45ef13(0x147)](_0x45ef13(0x11c)),0x1;}try{const _0x2a26a3=_0x27d47e[_0x45ef13(0x113)],_0x476350=_0x27d47e[_0x45ef13(0xed)],_0x4f39dc=_0x27d47e[_0x45ef13(0xf0)],_0x4062c1=_0x27d47e[_0x45ef13(0xd2)];_0x27d47e[_0x45ef13(0x12c)]&&(console['error'](_0x45ef13(0x10e)+(_0x5b459c?_0x45ef13(0x15a):_0x45ef13(0xc9))+'\x20'+_0x1b328e),_0x2a26a3&&console[_0x45ef13(0x147)](_0x45ef13(0xe5)+_0x2a26a3),_0x476350&&console[_0x45ef13(0x147)](_0x45ef13(0xb1)+_0x476350),_0x4f39dc&&console[_0x45ef13(0x147)](_0x45ef13(0xbb)+_0x4f39dc),_0x4062c1&&console['error'](_0x45ef13(0xe3)));let _0x10adf0;if(_0x4f39dc)try{if(_0x4f39dc[_0x45ef13(0xb7)]('@')){const _0x462977=await import(_0x45ef13(0x111)),_0x596bb7=_0x4f39dc[_0x45ef13(0xee)](0x1),_0x1b2c6a=await _0x462977[_0x45ef13(0x104)](_0x596bb7,_0x45ef13(0xc6));_0x10adf0=JSON['parse'](_0x1b2c6a);}else _0x10adf0=JSON[_0x45ef13(0xb9)](_0x4f39dc);}catch{return console['error'](_0x45ef13(0x142)),0x1;}if(!_0x27d47e[_0x45ef13(0x103)]){const _0x1f8c16=await confirm(_0x45ef13(0xba)+(_0x5b459c?_0x45ef13(0x15a):'attempt')+'\x20'+_0x1b328e+'?');if(!_0x1f8c16)return console[_0x45ef13(0x147)]('Cancelled'),0x0;}let _0x5694b8;_0x5b459c?_0x5694b8=await withSpinner('Retrying\x20session...',()=>_0x552c5f[_0x45ef13(0xfe)][_0x45ef13(0x14f)](_0x1b328e,{'fromTask':_0x2a26a3,'retryParams':_0x10adf0}),{'verbose':_0x27d47e[_0x45ef13(0x12c)]}):_0x5694b8=await withSpinner(_0x45ef13(0xfb),()=>_0x552c5f['workflow']['retryAttempt'](_0x1b328e,{'resumeFrom':_0x476350,'retryParams':_0x10adf0,'force':_0x4062c1}),{'verbose':_0x27d47e['verbose']});const _0x43065e=_0x5694b8[_0x45ef13(0xcd)];return console[_0x45ef13(0x147)](_0x45ef13(0xc7)),console['error'](_0x45ef13(0xf3)+_0x43065e[_0x45ef13(0xaf)]),console[_0x45ef13(0x147)]('\x20\x20Session\x20ID:\x20'+_0x43065e[_0x45ef13(0xb5)]),0x0;}catch(_0x352464){if(_0x352464 instanceof SDKError)return console[_0x45ef13(0x147)]('Error:\x20'+_0x352464[_0x45ef13(0xb3)]),_0x352464['cause']&&console['error']('\x20\x20Cause:\x20'+_0x352464[_0x45ef13(0x137)]),0x1;throw _0x352464;}}}export class WorkflowRunCommand extends BaseCommand{[a44_0x271447(0x128)]=a44_0x271447(0xbc);[a44_0x271447(0x13a)]=a44_0x271447(0x157);async[a44_0x271447(0xe1)](_0xcd2458){const _0xd08258=a44_0x271447,{options:_0x5bd1d3,args:_0x112132,tdx:_0x2f630f}=_0xcd2458,_0x22bc5c=_0x112132[0x0];if(!_0x22bc5c)return console[_0xd08258(0x147)](_0xd08258(0x125)),console[_0xd08258(0x147)](_0xd08258(0x100)),0x1;const _0x528259=_0x5bd1d3[_0xd08258(0x153)],_0xcad821=_0x5bd1d3[_0xd08258(0xf9)],_0x39bb23={};if(_0x528259&&Array[_0xd08258(0xef)](_0x528259))for(const _0x1c4af3 of _0x528259){const _0x41fd30=_0x1c4af3[_0xd08258(0xcc)]('=');if(_0x41fd30===-0x1)return console['error']('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x1c4af3),console[_0xd08258(0x147)](_0xd08258(0xeb)),0x1;const _0x5df491=_0x1c4af3[_0xd08258(0xee)](0x0,_0x41fd30),_0x5a837c=_0x1c4af3[_0xd08258(0xee)](_0x41fd30+0x1);try{_0x39bb23[_0x5df491]=JSON[_0xd08258(0xb9)](_0x5a837c);}catch{_0x39bb23[_0x5df491]=_0x5a837c;}}_0x5bd1d3[_0xd08258(0x12c)]&&(console[_0xd08258(0x147)]('Workflow:\x20'+_0x22bc5c),Object[_0xd08258(0xe0)](_0x39bb23)['length']>0x0&&console[_0xd08258(0x147)]('Parameters:\x20'+JSON[_0xd08258(0xff)](_0x39bb23)),_0xcad821&&console[_0xd08258(0x147)](_0xd08258(0x117)+_0xcad821));const _0x23a877=await withSpinner(_0xd08258(0x105),()=>_0x2f630f['workflow'][_0xd08258(0x13d)](_0x22bc5c,_0x39bb23,{'sessionTime':_0xcad821}),{'verbose':_0x5bd1d3['verbose']}),_0x21fbe4=_0x23a877[_0xd08258(0xcd)];return console[_0xd08258(0x147)](_0xd08258(0xc1)),console[_0xd08258(0x147)](_0xd08258(0xd6)+_0x21fbe4['id']),console[_0xd08258(0x147)](_0xd08258(0x102)+_0x21fbe4['sessionId']),console[_0xd08258(0x147)](_0xd08258(0x12f)+_0x21fbe4[_0xd08258(0xf4)]?.[_0xd08258(0x128)]),console[_0xd08258(0x147)](_0xd08258(0xfc)+_0x21fbe4[_0xd08258(0xfe)]?.[_0xd08258(0x128)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a44_0x271447(0x149);[a44_0x271447(0x13a)]=a44_0x271447(0x140);async[a44_0x271447(0xe1)](_0x350c87){const _0x5b9918=a44_0x271447,{options:_0xaead21,args:_0x503bd1,tdx:_0x220b32}=_0x350c87,_0x30c1d7=_0x503bd1[0x0],_0x4a04c4=_0x503bd1[0x1]||'.';if(!_0x30c1d7)return console[_0x5b9918(0x147)](_0x5b9918(0xe6)),console[_0x5b9918(0x147)](_0x5b9918(0x12d)),0x1;const _0x561d40=_0xaead21[_0x5b9918(0x10b)];_0xaead21[_0x5b9918(0x12c)]&&(console[_0x5b9918(0x147)](_0x5b9918(0x101)+_0x30c1d7),console['error']('Output\x20directory:\x20'+_0x4a04c4),_0x561d40&&console[_0x5b9918(0x147)](_0x5b9918(0x139)+_0x561d40));const _0x440045=await withSpinner(_0x5b9918(0xdf)+_0x30c1d7+'...',()=>_0x220b32[_0x5b9918(0xfe)][_0x5b9918(0xcb)](_0x30c1d7,_0x4a04c4,{'revision':_0x561d40}),{'verbose':_0xaead21['verbose']}),_0x5cd4cc=_0x440045['data'];return console[_0x5b9918(0x147)](_0x5b9918(0x15b)+_0x5cd4cc[_0x5b9918(0x154)]),console[_0x5b9918(0x147)](_0x5b9918(0x134)+_0x5cd4cc['revision']),console[_0x5b9918(0x147)](_0x5b9918(0x14d)+_0x5cd4cc[_0x5b9918(0x10f)]),console['error']('\x20\x20Location:\x20'+_0x4a04c4+'/'+_0x5cd4cc[_0x5b9918(0x154)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a44_0x271447(0x128)]=a44_0x271447(0xfa);[a44_0x271447(0x13a)]=a44_0x271447(0xd3);async['execute'](_0x4f7190){const _0x4106b6=a44_0x271447,{options:_0x4459f5,args:_0x547981,tdx:_0x4bfe6a}=_0x4f7190;let _0x1a2806='.',_0x2ec197=_0x4459f5['name'];if(_0x547981[0x0]){const {promises:_0x33e313}=await import('fs');try{const _0x2adc85=await _0x33e313[_0x4106b6(0xad)](_0x547981[0x0]);if(_0x2adc85['isDirectory']())_0x1a2806=_0x547981[0x0];else return console[_0x4106b6(0x147)](_0x4106b6(0x11e)+_0x547981[0x0]+_0x4106b6(0x159)),0x1;}catch{_0x2ec197=_0x547981[0x0],_0x1a2806='.';}}const _0x460f46=_0x4459f5[_0x4106b6(0x10b)],_0x4ae9e1=_0x4459f5[_0x4106b6(0xea)];_0x4459f5[_0x4106b6(0x12c)]&&(console['error'](_0x4106b6(0xdb)+_0x1a2806),_0x2ec197&&console[_0x4106b6(0x147)](_0x4106b6(0xc3)+_0x2ec197),_0x460f46&&console[_0x4106b6(0x147)](_0x4106b6(0x139)+_0x460f46),_0x4ae9e1&&console[_0x4106b6(0x147)]('Validation:\x20skipped'));const _0x5e1890=await withSpinner(_0x4106b6(0x145),()=>_0x4bfe6a[_0x4106b6(0xfe)][_0x4106b6(0xe9)](_0x1a2806,{'projectName':_0x2ec197,'revision':_0x460f46,'skipValidation':_0x4ae9e1}),{'verbose':_0x4459f5[_0x4106b6(0x12c)]}),_0x5ec865=_0x5e1890[_0x4106b6(0xcd)];return console[_0x4106b6(0x147)](_0x4106b6(0xf8)+_0x5ec865['projectName']),console[_0x4106b6(0x147)]('\x20\x20Project\x20ID:\x20'+_0x5ec865[_0x4106b6(0x14a)]),console['error'](_0x4106b6(0x134)+_0x5ec865[_0x4106b6(0x10b)]),0x0;}}function a44_0x2d94(){const _0x205a86=['Pushing\x20workflow\x20project...','20969616psMdrO','error','getTime','workflow:download','projectId','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','logFiles','\x20\x20Files\x20extracted:\x20','fileSize','retrySession','session:','Filter:\x20','List\x20all\x20workflow\x20projects','param','projectName','46590LipLOZ','...','Start\x20a\x20workflow\x20run','Listing\x20workflow\x20projects...','\x20is\x20not\x20a\x20directory','session','✔\x20Downloaded\x20','split','\x20workflow','Cancelled','stat','Getting\x20attempt\x20details...','attemptId','delete','Resume\x20from:\x20','Deleting\x20project\x20','message','387FJFEkR','sessionId','logs','startsWith','40695mgmiHB','parse','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Params:\x20','workflow:run','format','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','attempt:','kill','✔\x20Workflow\x20run\x20started','✔\x20Found\x20','Project\x20name:\x20','Killing\x20attempt...','Status:\x20','utf-8','✔\x20Retry\x20started','No\x20log\x20content\x20found','attempt','3763125SZMqkt','download','indexOf','data','workflow:attempts','5834hCoXZY','finishedAt','Include\x20retried:\x20yes','force','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','8MjrcIz','Listing\x20workflow\x20sessions...','\x20\x20Attempt\x20ID:\x20','276riymIP','running','length','workflow:retry','Project\x20directory:\x20','Filter:\x20project=','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','workflow:tasks','Downloading\x20project\x20','keys','execute','\x20session','Force:\x20yes','Show\x20tasks\x20for\x20an\x20attempt','From\x20task:\x20','Error:\x20Project\x20name\x20is\x20required','taskName','1529KxoFma','push','skipValidation','Expected\x20format:\x20--param\x20key=value','Show\x20specific\x20attempt\x20details','resumeFrom','substring','isArray','params','from','workflows','\x20\x20New\x20attempt\x20ID:\x20','project','reason','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','workflow:workflows','✔\x20Pushed\x20','sessionTime','workflow:push','Retrying\x20attempt...','\x20\x20Workflow:\x20','select','workflow','stringify','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','Project:\x20','\x20\x20Session\x20ID:\x20','yes','readFile','Starting\x20workflow\x20run...','4CvUxNP','\x20task','\x20\x20Project\x20ID:\x20','Error:\x20Attempt\x20ID\x20is\x20required','Including\x20subtasks:\x20yes','revision','includeSubtasks','retryAttemptName','Target:\x20','filesExtracted','success','fs/promises','projects','fromTask','Pattern:\x20','Retry\x20a\x20session\x20or\x20attempt','round','Session\x20time:\x20','limit','map','Listing\x20workflows...','Downloading\x20logs...','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Attempt\x20ID:\x20','Error:\x20','56014AkbsJl','Listing\x20workflow\x20attempts...','List\x20workflow\x20attempts','task','createdAt','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Error:\x20Workflow\x20identifier\x20is\x20required','6633801oLZxjS','workflow:attempt','name','index','workflow:logs','attempts','verbose','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Select\x20a\x20task\x20to\x20view\x20logs:','\x20\x20Project:\x20','Getting\x20attempt\x20tasks...','\x20\x20Cause:\x20','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','cancelRequested','\x20\x20Revision:\x20','workflow:sessions','Show\x20logs\x20for\x20a\x20workflow\x20attempt','cause','Usage:\x20workflow:delete\x20<project-name-or-id>','Revision:\x20','description','Reason:\x20','json','run','includeRetried','status','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','done','Error:\x20Invalid\x20JSON\x20in\x20--params','\x22?\x20This\x20cannot\x20be\x20undone.','log'];a44_0x2d94=function(){return _0x205a86;};return a44_0x2d94();}export class WorkflowDeleteCommand extends BaseCommand{[a44_0x271447(0x128)]='workflow:delete';[a44_0x271447(0x13a)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a44_0x271447(0xe1)](_0x54f39e){const _0x29fed9=a44_0x271447,{options:_0xb45b2c,args:_0x15addd,tdx:_0x4b49a6}=_0x54f39e,_0x36661a=_0x15addd[0x0];if(!_0x36661a)return console[_0x29fed9(0x147)](_0x29fed9(0x132)),console[_0x29fed9(0x147)](_0x29fed9(0x138)),0x1;_0xb45b2c['verbose']&&console['error']('Project:\x20'+_0x36661a);if(!_0xb45b2c[_0x29fed9(0x103)]){const _0x304e72=await confirm(_0x29fed9(0x14b)+_0x36661a+_0x29fed9(0x143));if(!_0x304e72)return console[_0x29fed9(0x147)](_0x29fed9(0x15e)),0x0;}const _0x52d3cb=await withSpinner(_0x29fed9(0xb2)+_0x36661a+_0x29fed9(0x156),()=>_0x4b49a6[_0x29fed9(0xfe)][_0x29fed9(0xb0)](_0x36661a),{'verbose':_0xb45b2c['verbose']}),_0x5bafdf=_0x52d3cb[_0x29fed9(0xcd)];return console[_0x29fed9(0x147)]('✔\x20Deleted\x20project\x20'+_0x5bafdf[_0x29fed9(0x154)]),console[_0x29fed9(0x147)](_0x29fed9(0x108)+_0x5bafdf[_0x29fed9(0x14a)]),0x0;}}
1
+ const a44_0x42df42=a44_0xaa61;(function(_0x4cc158,_0x40bbc7){const _0x5b6317=a44_0xaa61,_0x5bacf6=_0x4cc158();while(!![]){try{const _0x1d46c6=-parseInt(_0x5b6317(0x128))/0x1+-parseInt(_0x5b6317(0x18c))/0x2+parseInt(_0x5b6317(0x133))/0x3*(parseInt(_0x5b6317(0x168))/0x4)+parseInt(_0x5b6317(0x141))/0x5*(-parseInt(_0x5b6317(0x1b3))/0x6)+-parseInt(_0x5b6317(0x166))/0x7+-parseInt(_0x5b6317(0x130))/0x8+parseInt(_0x5b6317(0x1a8))/0x9;if(_0x1d46c6===_0x40bbc7)break;else _0x5bacf6['push'](_0x5bacf6['shift']());}catch(_0x46bbaf){_0x5bacf6['push'](_0x5bacf6['shift']());}}}(a44_0x19e3,0xe06f7));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';function a44_0xaa61(_0x389cb0,_0x3bfba4){_0x389cb0=_0x389cb0-0x11f;const _0x19e385=a44_0x19e3();let _0xaa61b8=_0x19e385[_0x389cb0];return _0xaa61b8;}import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{formatBytes}from'../utils/formatters.js';import a44_0x10c99b from'prompts';function a44_0x19e3(){const _0x4a91c1=['task','Task\x20name:\x20','38157687wvzLQo','Status:\x20','Filter:\x20project=','round','\x20\x20Attempt\x20ID:\x20','Retry\x20a\x20session\x20or\x20attempt','\x20\x20Files\x20extracted:\x20','includeSubtasks','startsWith','keys','sessions','8601732gvVDQg','description','running','\x20session','Target:\x20','Starting\x20workflow\x20run...','project','execute','run','Validation:\x20skipped','Output\x20directory:\x20','\x20attempt','cause','canceling','kill','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','force','index','651363kjVZoB','download','Fetching\x20log\x20files...','From\x20task:\x20','\x20\x20Project\x20ID:\x20','workflow:delete','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Resume\x20from:\x20','4579912qHsnbn','\x20\x20Workflow:\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','37779FoUIaW','projectId','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','workflow:tasks','workflow:run','isArray','Error:\x20Project\x20name\x20is\x20required','Error:\x20Invalid\x20parameter\x20format:\x20','Error:\x20Invalid\x20JSON\x20in\x20--params','Listing\x20workflow\x20attempts...','Expected\x20format:\x20--param\x20key=value','stat','workflow:kill','verbose','5AEGdUj','getTime','success','param','Getting\x20attempt\x20tasks...','projects','Listing\x20workflow\x20sessions...','isDirectory','push','✔\x20Retry\x20started','map','workflows','retryAttempt','Pattern:\x20','attempt','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Session\x20time:\x20','length','delete','Start\x20a\x20workflow\x20run','error','\x20is\x20not\x20a\x20directory','\x20\x20Session\x20ID:\x20','Pushing\x20workflow\x20project...','name','Listing\x20workflows...','✔\x20Downloaded\x20','\x20\x20Project:\x20','session','yes','log','Revision:\x20','No\x20log\x20content\x20found','attempt:','Retrying\x20session...','stringify','\x20workflow','11043130uXFJPH','fileSize','532gpBKqk','from','Error:\x20','sessionTime','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Project\x20directory:\x20','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','status','Params:\x20','createdAt','indexOf','Downloading\x20logs...','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','finishedAt','Include\x20retried:\x20yes','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','split','taskName','tasks','params','Downloading\x20project\x20','sessionId','data','\x20\x20Cause:\x20','includeRetried','message','revision','Cancelled','Getting\x20attempt\x20details...','workflow:download','Error:\x20Attempt\x20ID\x20is\x20required','session:','workflow:sessions','Retrying\x20attempt...','workflow:attempts','✔\x20Deleted\x20project\x20','1520522lcNWXZ','attempts','...','resumeFrom','workflow','\x20\x20Location:\x20','parse','substring','\x22?\x20This\x20cannot\x20be\x20undone.','workflow:logs','Project:\x20','\x20\x20Revision:\x20','workflow:workflows','select','Parameters:\x20','logs','Killing\x20attempt...','✔\x20Found\x20','Force:\x20yes','projectName','Attempt\x20ID:\x20','limit','filesExtracted','workflow:projects','retryAttemptName','Workflow:\x20'];a44_0x19e3=function(){return _0x4a91c1;};return a44_0x19e3();}export class WorkflowProjectsCommand extends BaseCommand{['name']=a44_0x42df42(0x1a3);['description']='List\x20all\x20workflow\x20projects';async['execute'](_0x5b524b){const _0x4dc3a8=a44_0x42df42,{options:_0x5c09f3,args:_0x8f6c67,tdx:_0xda7bea}=_0x5b524b,_0x2d22b6=_0x8f6c67[0x0];try{_0x5c09f3[_0x4dc3a8(0x140)]&&_0x2d22b6&&console[_0x4dc3a8(0x155)](_0x4dc3a8(0x14e)+_0x2d22b6);const _0x204f5a=await withSpinner('Listing\x20workflow\x20projects...',()=>_0xda7bea[_0x4dc3a8(0x190)][_0x4dc3a8(0x146)](_0x2d22b6,{'limit':_0x5c09f3[_0x4dc3a8(0x1a1)]}),{'verbose':_0x5c09f3[_0x4dc3a8(0x140)]}),_0x420973=_0x204f5a['data'];return console[_0x4dc3a8(0x155)](_0x4dc3a8(0x19d)+_0x420973['length']+'\x20project'+(_0x420973[_0x4dc3a8(0x152)]!==0x1?'s':'')),await handleSDKOutput(_0x420973,_0x5c09f3),0x0;}catch(_0x36fede){if(_0x36fede instanceof SDKError)return console['error'](_0x4dc3a8(0x16a)+_0x36fede[_0x4dc3a8(0x181)]),_0x36fede[_0x4dc3a8(0x122)]&&console[_0x4dc3a8(0x155)]('\x20\x20Cause:\x20'+_0x36fede[_0x4dc3a8(0x122)]),0x1;throw _0x36fede;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a44_0x42df42(0x159)]=a44_0x42df42(0x198);['description']='List\x20workflows';async[a44_0x42df42(0x1ba)](_0x1803ec){const _0x159ac3=a44_0x42df42,{options:_0x3b40bc,args:_0x46e5f6,tdx:_0x19436d}=_0x1803ec,_0xaa6357=_0x46e5f6[0x0];try{_0x3b40bc[_0x159ac3(0x140)]&&_0xaa6357&&console[_0x159ac3(0x155)]('Project\x20filter:\x20'+_0xaa6357);const _0x2192e6=await withSpinner(_0x159ac3(0x15a),()=>_0x19436d[_0x159ac3(0x190)][_0x159ac3(0x14c)](_0xaa6357,{'limit':_0x3b40bc['limit']}),{'verbose':_0x3b40bc[_0x159ac3(0x140)]}),_0x2e6ce9=_0x2192e6[_0x159ac3(0x17e)];return console[_0x159ac3(0x155)]('✔\x20Found\x20'+_0x2e6ce9[_0x159ac3(0x152)]+_0x159ac3(0x165)+(_0x2e6ce9['length']!==0x1?'s':'')),await handleSDKOutput(_0x2e6ce9,_0x3b40bc),0x0;}catch(_0x167dfe){if(_0x167dfe instanceof SDKError)return console[_0x159ac3(0x155)](_0x159ac3(0x16a)+_0x167dfe[_0x159ac3(0x181)]),_0x167dfe['cause']&&console['error']('\x20\x20Cause:\x20'+_0x167dfe[_0x159ac3(0x122)]),0x1;throw _0x167dfe;}}}export class WorkflowSessionsCommand extends BaseCommand{[a44_0x42df42(0x159)]=a44_0x42df42(0x188);[a44_0x42df42(0x1b4)]='List\x20workflow\x20execution\x20sessions';async[a44_0x42df42(0x1ba)](_0x4ca8a0){const _0x470be2=a44_0x42df42,{options:_0x8038bd,args:_0x59cbef,tdx:_0x4e009d}=_0x4ca8a0;let _0x3e8a45,_0x520018;if(_0x59cbef[0x0]){const _0x5af0ee=_0x59cbef[0x0][_0x470be2(0x178)]('.');if(_0x5af0ee[_0x470be2(0x152)]===0x1)_0x3e8a45=_0x5af0ee[0x0];else{if(_0x5af0ee[_0x470be2(0x152)]===0x2)[_0x3e8a45,_0x520018]=_0x5af0ee;else return console[_0x470be2(0x155)](_0x470be2(0x16e)),0x1;}}try{if(_0x8038bd['verbose']){if(_0x3e8a45&&_0x520018)console[_0x470be2(0x155)]('Filter:\x20'+_0x3e8a45+'.'+_0x520018);else _0x3e8a45&&console[_0x470be2(0x155)](_0x470be2(0x1aa)+_0x3e8a45);const _0x11005d=_0x8038bd[_0x470be2(0x16f)];_0x11005d&&console[_0x470be2(0x155)](_0x470be2(0x1a9)+_0x11005d);}const _0x9bba30=await withSpinner(_0x470be2(0x147),()=>_0x4e009d[_0x470be2(0x190)][_0x470be2(0x1b2)]({'projectName':_0x3e8a45,'workflowName':_0x520018,'status':_0x8038bd['status'],'fromTime':_0x8038bd[_0x470be2(0x169)],'toTime':_0x8038bd['to'],'limit':_0x8038bd['limit']}),{'verbose':_0x8038bd[_0x470be2(0x140)]}),_0x27cfce=_0x9bba30[_0x470be2(0x17e)];return console[_0x470be2(0x155)](_0x470be2(0x19d)+_0x27cfce[_0x470be2(0x152)]+_0x470be2(0x1b6)+(_0x27cfce['length']!==0x1?'s':'')),await handleSDKOutput(_0x27cfce,_0x8038bd),0x0;}catch(_0x535896){if(_0x535896 instanceof SDKError)return console[_0x470be2(0x155)](_0x470be2(0x16a)+_0x535896[_0x470be2(0x181)]),_0x535896[_0x470be2(0x122)]&&console['error'](_0x470be2(0x17f)+_0x535896[_0x470be2(0x122)]),0x1;throw _0x535896;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a44_0x42df42(0x159)]=a44_0x42df42(0x18a);[a44_0x42df42(0x1b4)]='List\x20workflow\x20attempts';async[a44_0x42df42(0x1ba)](_0x3ef5f6){const _0x40405a=a44_0x42df42,{options:_0x395bb8,args:_0x39348d,tdx:_0x3e77ec}=_0x3ef5f6;let _0x347b23,_0x4b0b03;if(_0x39348d[0x0]){const _0x296e5c=_0x39348d[0x0][_0x40405a(0x178)]('.');if(_0x296e5c[_0x40405a(0x152)]===0x1)_0x347b23=_0x296e5c[0x0];else{if(_0x296e5c[_0x40405a(0x152)]===0x2)[_0x347b23,_0x4b0b03]=_0x296e5c;else return console['error'](_0x40405a(0x16e)),0x1;}}try{const _0x10bd22=_0x395bb8[_0x40405a(0x180)];if(_0x395bb8[_0x40405a(0x140)]){if(_0x347b23&&_0x4b0b03)console['error']('Filter:\x20'+_0x347b23+'.'+_0x4b0b03);else _0x347b23&&console[_0x40405a(0x155)]('Filter:\x20project='+_0x347b23);_0x10bd22&&console['error'](_0x40405a(0x176));}const _0x509fdb=await withSpinner(_0x40405a(0x13c),()=>_0x3e77ec[_0x40405a(0x190)][_0x40405a(0x18d)]({'projectName':_0x347b23,'workflowName':_0x4b0b03,'includeRetried':_0x10bd22,'limit':_0x395bb8[_0x40405a(0x1a1)]}),{'verbose':_0x395bb8['verbose']}),_0xf3ba64=_0x509fdb[_0x40405a(0x17e)];return console[_0x40405a(0x155)](_0x40405a(0x19d)+_0xf3ba64[_0x40405a(0x152)]+_0x40405a(0x121)+(_0xf3ba64[_0x40405a(0x152)]!==0x1?'s':'')),await handleSDKOutput(_0xf3ba64,_0x395bb8),0x0;}catch(_0xc751c6){if(_0xc751c6 instanceof SDKError)return console['error'](_0x40405a(0x16a)+_0xc751c6[_0x40405a(0x181)]),_0xc751c6[_0x40405a(0x122)]&&console['error']('\x20\x20Cause:\x20'+_0xc751c6[_0x40405a(0x122)]),0x1;throw _0xc751c6;}}}export class WorkflowAttemptCommand extends BaseCommand{[a44_0x42df42(0x159)]='workflow:attempt';[a44_0x42df42(0x1b4)]='Show\x20specific\x20attempt\x20details';async['execute'](_0x342a11){const _0x2d2d7a=a44_0x42df42,{options:_0x203b6a,args:_0x42f9a9,tdx:_0x36122f}=_0x342a11,_0x1abec7=_0x42f9a9[0x0];if(!_0x1abec7)return console['error'](_0x2d2d7a(0x186)),0x1;try{_0x203b6a['verbose']&&console[_0x2d2d7a(0x155)]('Attempt\x20ID:\x20'+_0x1abec7);const _0x11dbd9=await withSpinner(_0x2d2d7a(0x184),()=>_0x36122f[_0x2d2d7a(0x190)]['attempt'](_0x1abec7),{'verbose':_0x203b6a[_0x2d2d7a(0x140)]}),_0x2ddd4f=_0x11dbd9[_0x2d2d7a(0x17e)];let _0x43708a;!_0x2ddd4f['done']?_0x43708a=_0x2ddd4f['cancelRequested']?_0x2d2d7a(0x123):_0x2d2d7a(0x1b5):_0x43708a=_0x2ddd4f[_0x2d2d7a(0x143)]?'success':_0x2d2d7a(0x155);let _0x5f34f0;if(_0x2ddd4f['createdAt']&&_0x2ddd4f[_0x2d2d7a(0x175)]){const _0x517c71=new Date(_0x2ddd4f['createdAt'])[_0x2d2d7a(0x142)](),_0x5e1200=new Date(_0x2ddd4f[_0x2d2d7a(0x175)])['getTime']();_0x5f34f0=Math[_0x2d2d7a(0x1ab)]((_0x5e1200-_0x517c71)/0x3e8);}const _0x5b87f2={'attempt_id':_0x2ddd4f['id'],'status':_0x43708a,..._0x2ddd4f[_0x2d2d7a(0x127)]!==undefined&&{'index':_0x2ddd4f[_0x2d2d7a(0x127)]},..._0x2ddd4f[_0x2d2d7a(0x1b9)]&&{'project':_0x2ddd4f[_0x2d2d7a(0x1b9)][_0x2d2d7a(0x159)]},..._0x2ddd4f['workflow']&&{'workflow':_0x2ddd4f['workflow'][_0x2d2d7a(0x159)]},..._0x2ddd4f[_0x2d2d7a(0x17d)]&&{'session_id':_0x2ddd4f[_0x2d2d7a(0x17d)]},..._0x2ddd4f[_0x2d2d7a(0x16b)]&&{'session_time':_0x2ddd4f[_0x2d2d7a(0x16b)]},..._0x2ddd4f[_0x2d2d7a(0x1a4)]&&{'retry_attempt':_0x2ddd4f['retryAttemptName']},..._0x5f34f0!==undefined&&{'duration_sec':_0x5f34f0},..._0x2ddd4f[_0x2d2d7a(0x171)]&&{'created_at':_0x2ddd4f['createdAt']},..._0x2ddd4f[_0x2d2d7a(0x175)]&&{'finished_at':_0x2ddd4f[_0x2d2d7a(0x175)]},...Object['keys'](_0x2ddd4f[_0x2d2d7a(0x17b)])[_0x2d2d7a(0x152)]>0x0&&{'params':_0x2ddd4f[_0x2d2d7a(0x17b)]}};return await handleSingleObjectOutput(_0x5b87f2,_0x203b6a),0x0;}catch(_0x35864f){if(_0x35864f instanceof SDKError)return console[_0x2d2d7a(0x155)](_0x2d2d7a(0x16a)+_0x35864f[_0x2d2d7a(0x181)]),_0x35864f['cause']&&console[_0x2d2d7a(0x155)](_0x2d2d7a(0x17f)+_0x35864f[_0x2d2d7a(0x122)]),0x1;throw _0x35864f;}}}export class WorkflowTasksCommand extends BaseCommand{[a44_0x42df42(0x159)]=a44_0x42df42(0x136);['description']='Show\x20tasks\x20for\x20an\x20attempt';async['execute'](_0x2350f6){const _0x476517=a44_0x42df42,{options:_0x57848c,args:_0x22cfec,tdx:_0x224b1a}=_0x2350f6,_0x392131=_0x22cfec[0x0];if(!_0x392131)return console[_0x476517(0x155)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x58ee4d=_0x57848c[_0x476517(0x1af)];_0x57848c[_0x476517(0x140)]&&(console[_0x476517(0x155)](_0x476517(0x1a0)+_0x392131),_0x58ee4d&&console[_0x476517(0x155)]('Including\x20subtasks:\x20yes'));const _0x33a131=await withSpinner(_0x476517(0x145),()=>_0x224b1a[_0x476517(0x190)][_0x476517(0x17a)](_0x392131,_0x58ee4d||![]),{'verbose':_0x57848c[_0x476517(0x140)]}),_0x56f81a=_0x33a131['data'];return console[_0x476517(0x155)]('✔\x20Found\x20'+_0x56f81a[_0x476517(0x152)]+'\x20task'+(_0x56f81a[_0x476517(0x152)]!==0x1?'s':'')),await handleSDKOutput(_0x56f81a,_0x57848c),0x0;}catch(_0x5c1097){if(_0x5c1097 instanceof SDKError)return console[_0x476517(0x155)](_0x476517(0x16a)+_0x5c1097['message']),_0x5c1097[_0x476517(0x122)]&&console[_0x476517(0x155)](_0x476517(0x17f)+_0x5c1097['cause']),0x1;throw _0x5c1097;}}}export class WorkflowLogsCommand extends BaseCommand{[a44_0x42df42(0x159)]=a44_0x42df42(0x195);[a44_0x42df42(0x1b4)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async['execute'](_0x300189){const _0x4ed597=a44_0x42df42,{options:_0x52be97,args:_0x24c13a,tdx:_0x45e5bc}=_0x300189,_0x4bc590=_0x24c13a[0x0];let _0x171e98=_0x24c13a[0x1];if(!_0x4bc590)return console['error'](_0x4ed597(0x186)),0x1;try{_0x52be97[_0x4ed597(0x140)]&&(console[_0x4ed597(0x155)](_0x4ed597(0x1a0)+_0x4bc590),_0x171e98&&console[_0x4ed597(0x155)](_0x4ed597(0x1a7)+_0x171e98));const _0x172236=await withSpinner(_0x4ed597(0x12a),()=>_0x45e5bc[_0x4ed597(0x190)]['logFiles'](_0x4bc590,_0x171e98),{'verbose':_0x52be97['verbose']}),_0x429e64=_0x172236['data'];if(_0x429e64['length']===0x0)return console[_0x4ed597(0x155)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x171e98&&(_0x52be97['json']||_0x52be97['format']))return await handleSDKOutput(_0x429e64,_0x52be97),0x0;if(!_0x171e98){const _0x224b57=_0x429e64[_0x4ed597(0x14b)](_0x1bc1e9=>({'title':_0x1bc1e9[_0x4ed597(0x179)]+'\x20('+formatBytes(_0x1bc1e9[_0x4ed597(0x167)])+')','value':_0x1bc1e9[_0x4ed597(0x179)]})),_0x17fd44=await a44_0x10c99b({'type':_0x4ed597(0x199),'name':_0x4ed597(0x1a6),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x224b57});if(!_0x17fd44[_0x4ed597(0x1a6)])return console[_0x4ed597(0x155)](_0x4ed597(0x183)),0x0;_0x171e98=_0x17fd44[_0x4ed597(0x1a6)];}const _0x3adf24=await withSpinner(_0x4ed597(0x173),()=>_0x45e5bc[_0x4ed597(0x190)][_0x4ed597(0x19b)](_0x4bc590,_0x171e98),{'verbose':_0x52be97['verbose']}),_0x3a2fe0=_0x3adf24[_0x4ed597(0x17e)];return _0x3a2fe0?console[_0x4ed597(0x15f)](_0x3a2fe0):console[_0x4ed597(0x155)](_0x4ed597(0x161)),0x0;}catch(_0x1d18d6){if(_0x1d18d6 instanceof SDKError)return console[_0x4ed597(0x155)](_0x4ed597(0x16a)+_0x1d18d6['message']),_0x1d18d6[_0x4ed597(0x122)]&&console[_0x4ed597(0x155)](_0x4ed597(0x17f)+_0x1d18d6['cause']),0x1;throw _0x1d18d6;}}}export class WorkflowKillCommand extends BaseCommand{['name']=a44_0x42df42(0x13f);[a44_0x42df42(0x1b4)]='Kill\x20a\x20running\x20attempt';async['execute'](_0x54ab75){const _0x35cb34=a44_0x42df42,{options:_0xfced00,args:_0x44d0c3,tdx:_0x742a1b}=_0x54ab75,_0x5dc081=_0x44d0c3[0x0];if(!_0x5dc081)return console[_0x35cb34(0x155)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x6b13b5=_0xfced00['reason'];_0xfced00[_0x35cb34(0x140)]&&(console[_0x35cb34(0x155)]('Attempt\x20ID:\x20'+_0x5dc081),_0x6b13b5&&console[_0x35cb34(0x155)]('Reason:\x20'+_0x6b13b5));if(!_0xfced00['yes']){const _0x13b223=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x5dc081+'?');if(!_0x13b223)return console[_0x35cb34(0x155)]('Cancelled'),0x0;}const _0x5c1520=await withSpinner(_0x35cb34(0x19c),()=>_0x742a1b[_0x35cb34(0x190)][_0x35cb34(0x124)](_0x5dc081,_0x6b13b5),{'verbose':_0xfced00['verbose']}),_0x4b98bb=_0x5c1520[_0x35cb34(0x17e)];return console[_0x35cb34(0x155)]('✔\x20'+_0x4b98bb),0x0;}catch(_0x5ab95f){if(_0x5ab95f instanceof SDKError)return console['error'](_0x35cb34(0x16a)+_0x5ab95f['message']),_0x5ab95f[_0x35cb34(0x122)]&&console[_0x35cb34(0x155)](_0x35cb34(0x17f)+_0x5ab95f[_0x35cb34(0x122)]),0x1;throw _0x5ab95f;}}}export class WorkflowRetryCommand extends BaseCommand{[a44_0x42df42(0x159)]='workflow:retry';[a44_0x42df42(0x1b4)]=a44_0x42df42(0x1ad);async[a44_0x42df42(0x1ba)](_0x2809b1){const _0x1486c9=a44_0x42df42,{options:_0xa205d7,args:_0x170c50,tdx:_0x421607}=_0x2809b1,_0xe38162=_0x170c50[0x0];if(!_0xe38162)return console[_0x1486c9(0x155)](_0x1486c9(0x12e)),console[_0x1486c9(0x155)](_0x1486c9(0x125)),0x1;let _0x32ae69=![],_0x1c1612=_0xe38162;if(_0xe38162[_0x1486c9(0x1b0)](_0x1486c9(0x187)))_0x32ae69=!![],_0x1c1612=_0xe38162[_0x1486c9(0x193)](0x8);else{if(_0xe38162['startsWith'](_0x1486c9(0x162)))_0x32ae69=![],_0x1c1612=_0xe38162['substring'](0x8);else return console[_0x1486c9(0x155)](_0x1486c9(0x177)),console[_0x1486c9(0x155)](_0x1486c9(0x125)),0x1;}try{const _0x1a4e1f=_0xa205d7['fromTask'],_0x1110fe=_0xa205d7[_0x1486c9(0x18f)],_0x3ba348=_0xa205d7[_0x1486c9(0x17b)],_0x4fe210=_0xa205d7[_0x1486c9(0x126)];_0xa205d7['verbose']&&(console['error'](_0x1486c9(0x1b7)+(_0x32ae69?_0x1486c9(0x15d):_0x1486c9(0x14f))+'\x20'+_0x1c1612),_0x1a4e1f&&console[_0x1486c9(0x155)](_0x1486c9(0x12b)+_0x1a4e1f),_0x1110fe&&console[_0x1486c9(0x155)](_0x1486c9(0x12f)+_0x1110fe),_0x3ba348&&console['error'](_0x1486c9(0x170)+_0x3ba348),_0x4fe210&&console[_0x1486c9(0x155)](_0x1486c9(0x19e)));let _0x1d91ee;if(_0x3ba348)try{if(_0x3ba348[_0x1486c9(0x1b0)]('@')){const _0x13fe70=await import('fs/promises'),_0x57fef9=_0x3ba348[_0x1486c9(0x193)](0x1),_0x154ce7=await _0x13fe70['readFile'](_0x57fef9,'utf-8');_0x1d91ee=JSON[_0x1486c9(0x192)](_0x154ce7);}else _0x1d91ee=JSON[_0x1486c9(0x192)](_0x3ba348);}catch{return console['error'](_0x1486c9(0x13b)),0x1;}if(!_0xa205d7[_0x1486c9(0x15e)]){const _0x364d65=await confirm(_0x1486c9(0x135)+(_0x32ae69?_0x1486c9(0x15d):_0x1486c9(0x14f))+'\x20'+_0x1c1612+'?');if(!_0x364d65)return console[_0x1486c9(0x155)](_0x1486c9(0x183)),0x0;}let _0x2a2d9f;_0x32ae69?_0x2a2d9f=await withSpinner(_0x1486c9(0x163),()=>_0x421607[_0x1486c9(0x190)]['retrySession'](_0x1c1612,{'fromTask':_0x1a4e1f,'retryParams':_0x1d91ee}),{'verbose':_0xa205d7['verbose']}):_0x2a2d9f=await withSpinner(_0x1486c9(0x189),()=>_0x421607[_0x1486c9(0x190)][_0x1486c9(0x14d)](_0x1c1612,{'resumeFrom':_0x1110fe,'retryParams':_0x1d91ee,'force':_0x4fe210}),{'verbose':_0xa205d7['verbose']});const _0x139c5a=_0x2a2d9f[_0x1486c9(0x17e)];return console['error'](_0x1486c9(0x14a)),console[_0x1486c9(0x155)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x139c5a['attemptId']),console[_0x1486c9(0x155)](_0x1486c9(0x157)+_0x139c5a[_0x1486c9(0x17d)]),0x0;}catch(_0x62c43f){if(_0x62c43f instanceof SDKError)return console[_0x1486c9(0x155)](_0x1486c9(0x16a)+_0x62c43f[_0x1486c9(0x181)]),_0x62c43f[_0x1486c9(0x122)]&&console[_0x1486c9(0x155)]('\x20\x20Cause:\x20'+_0x62c43f[_0x1486c9(0x122)]),0x1;throw _0x62c43f;}}}export class WorkflowRunCommand extends BaseCommand{[a44_0x42df42(0x159)]=a44_0x42df42(0x137);[a44_0x42df42(0x1b4)]=a44_0x42df42(0x154);async[a44_0x42df42(0x1ba)](_0x3ab4b4){const _0x1bb862=a44_0x42df42,{options:_0x3e45a,args:_0xcca38b,tdx:_0x21805c}=_0x3ab4b4,_0x3f71a0=_0xcca38b[0x0];if(!_0x3f71a0)return console[_0x1bb862(0x155)]('Error:\x20Workflow\x20identifier\x20is\x20required'),console[_0x1bb862(0x155)]('Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]'),0x1;const _0xea7b8=_0x3e45a[_0x1bb862(0x144)],_0xf9f64d=_0x3e45a[_0x1bb862(0x16b)],_0x2d1ff0={};if(_0xea7b8&&Array[_0x1bb862(0x138)](_0xea7b8))for(const _0x14bbe4 of _0xea7b8){const _0x144d36=_0x14bbe4[_0x1bb862(0x172)]('=');if(_0x144d36===-0x1)return console[_0x1bb862(0x155)](_0x1bb862(0x13a)+_0x14bbe4),console['error'](_0x1bb862(0x13d)),0x1;const _0x435ca9=_0x14bbe4['substring'](0x0,_0x144d36),_0x21da68=_0x14bbe4[_0x1bb862(0x193)](_0x144d36+0x1);try{_0x2d1ff0[_0x435ca9]=JSON['parse'](_0x21da68);}catch{_0x2d1ff0[_0x435ca9]=_0x21da68;}}_0x3e45a[_0x1bb862(0x140)]&&(console[_0x1bb862(0x155)](_0x1bb862(0x1a5)+_0x3f71a0),Object[_0x1bb862(0x1b1)](_0x2d1ff0)['length']>0x0&&console[_0x1bb862(0x155)](_0x1bb862(0x19a)+JSON[_0x1bb862(0x164)](_0x2d1ff0)),_0xf9f64d&&console[_0x1bb862(0x155)](_0x1bb862(0x151)+_0xf9f64d));const _0x580105=await withSpinner(_0x1bb862(0x1b8),()=>_0x21805c[_0x1bb862(0x190)][_0x1bb862(0x1bb)](_0x3f71a0,_0x2d1ff0,{'sessionTime':_0xf9f64d}),{'verbose':_0x3e45a['verbose']}),_0x29a9ff=_0x580105[_0x1bb862(0x17e)];return console[_0x1bb862(0x155)]('✔\x20Workflow\x20run\x20started'),console[_0x1bb862(0x155)](_0x1bb862(0x1ac)+_0x29a9ff['id']),console[_0x1bb862(0x155)](_0x1bb862(0x157)+_0x29a9ff[_0x1bb862(0x17d)]),console[_0x1bb862(0x155)](_0x1bb862(0x15c)+_0x29a9ff[_0x1bb862(0x1b9)]?.[_0x1bb862(0x159)]),console[_0x1bb862(0x155)](_0x1bb862(0x131)+_0x29a9ff['workflow']?.['name']),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a44_0x42df42(0x159)]=a44_0x42df42(0x185);['description']='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a44_0x42df42(0x1ba)](_0x2c21f7){const _0x47aab4=a44_0x42df42,{options:_0x1997fc,args:_0x2239c0,tdx:_0x2feee1}=_0x2c21f7,_0x372245=_0x2239c0[0x0],_0x1b9055=_0x2239c0[0x1]||'.';if(!_0x372245)return console[_0x47aab4(0x155)](_0x47aab4(0x139)),console['error']('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x3d6f3a=_0x1997fc[_0x47aab4(0x182)];_0x1997fc[_0x47aab4(0x140)]&&(console[_0x47aab4(0x155)](_0x47aab4(0x196)+_0x372245),console[_0x47aab4(0x155)](_0x47aab4(0x120)+_0x1b9055),_0x3d6f3a&&console[_0x47aab4(0x155)](_0x47aab4(0x160)+_0x3d6f3a));const _0x1768f9=await withSpinner(_0x47aab4(0x17c)+_0x372245+_0x47aab4(0x18e),()=>_0x2feee1['workflow'][_0x47aab4(0x129)](_0x372245,_0x1b9055,{'revision':_0x3d6f3a}),{'verbose':_0x1997fc[_0x47aab4(0x140)]}),_0x2b4f6c=_0x1768f9[_0x47aab4(0x17e)];return console[_0x47aab4(0x155)](_0x47aab4(0x15b)+_0x2b4f6c['projectName']),console[_0x47aab4(0x155)](_0x47aab4(0x197)+_0x2b4f6c[_0x47aab4(0x182)]),console['error'](_0x47aab4(0x1ae)+_0x2b4f6c[_0x47aab4(0x1a2)]),console['error'](_0x47aab4(0x191)+_0x1b9055+'/'+_0x2b4f6c[_0x47aab4(0x19f)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{['name']='workflow:push';[a44_0x42df42(0x1b4)]='Push\x20workflow\x20project\x20to\x20Treasure\x20Data';async[a44_0x42df42(0x1ba)](_0x567dbc){const _0x24cb23=a44_0x42df42,{options:_0x4eda32,args:_0x549380,tdx:_0x25e0c2}=_0x567dbc;let _0x7a18eb='.',_0x329cad=_0x4eda32['name'];if(_0x549380[0x0]){const {promises:_0x3606e3}=await import('fs');try{const _0x568346=await _0x3606e3[_0x24cb23(0x13e)](_0x549380[0x0]);if(_0x568346[_0x24cb23(0x148)]())_0x7a18eb=_0x549380[0x0];else return console['error']('Error:\x20'+_0x549380[0x0]+_0x24cb23(0x156)),0x1;}catch{_0x329cad=_0x549380[0x0],_0x7a18eb='.';}}const _0x49154d=_0x4eda32[_0x24cb23(0x182)],_0x4ddd7d=_0x4eda32['skipValidation'];_0x4eda32[_0x24cb23(0x140)]&&(console[_0x24cb23(0x155)](_0x24cb23(0x16d)+_0x7a18eb),_0x329cad&&console[_0x24cb23(0x155)]('Project\x20name:\x20'+_0x329cad),_0x49154d&&console[_0x24cb23(0x155)](_0x24cb23(0x160)+_0x49154d),_0x4ddd7d&&console[_0x24cb23(0x155)](_0x24cb23(0x11f)));const _0x35bbd5=await withSpinner(_0x24cb23(0x158),()=>_0x25e0c2['workflow'][_0x24cb23(0x149)](_0x7a18eb,{'projectName':_0x329cad,'revision':_0x49154d,'skipValidation':_0x4ddd7d}),{'verbose':_0x4eda32['verbose']}),_0x44e0d6=_0x35bbd5[_0x24cb23(0x17e)];return console[_0x24cb23(0x155)]('✔\x20Pushed\x20'+_0x44e0d6[_0x24cb23(0x19f)]),console[_0x24cb23(0x155)](_0x24cb23(0x12c)+_0x44e0d6[_0x24cb23(0x134)]),console[_0x24cb23(0x155)](_0x24cb23(0x197)+_0x44e0d6[_0x24cb23(0x182)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a44_0x42df42(0x159)]=a44_0x42df42(0x12d);[a44_0x42df42(0x1b4)]=a44_0x42df42(0x16c);async[a44_0x42df42(0x1ba)](_0x21708a){const _0x36fae7=a44_0x42df42,{options:_0x3d6478,args:_0x551280,tdx:_0x33977b}=_0x21708a,_0x28b06d=_0x551280[0x0];if(!_0x28b06d)return console[_0x36fae7(0x155)](_0x36fae7(0x150)),console[_0x36fae7(0x155)](_0x36fae7(0x132)),0x1;_0x3d6478[_0x36fae7(0x140)]&&console[_0x36fae7(0x155)]('Project:\x20'+_0x28b06d);if(!_0x3d6478['yes']){const _0x2bcac6=await confirm(_0x36fae7(0x174)+_0x28b06d+_0x36fae7(0x194));if(!_0x2bcac6)return console['error'](_0x36fae7(0x183)),0x0;}const _0x59786c=await withSpinner('Deleting\x20project\x20'+_0x28b06d+_0x36fae7(0x18e),()=>_0x33977b[_0x36fae7(0x190)][_0x36fae7(0x153)](_0x28b06d),{'verbose':_0x3d6478[_0x36fae7(0x140)]}),_0x4042e1=_0x59786c['data'];return console['error'](_0x36fae7(0x18b)+_0x4042e1[_0x36fae7(0x19f)]),console[_0x36fae7(0x155)](_0x36fae7(0x12c)+_0x4042e1[_0x36fae7(0x134)]),0x0;}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x1a797e,_0x19d84d){const _0x3a5d65=a45_0x1c06,_0x35bbdc=_0x1a797e();while(!![]){try{const _0x517578=-parseInt(_0x3a5d65(0x173))/0x1+parseInt(_0x3a5d65(0x16f))/0x2*(parseInt(_0x3a5d65(0x16e))/0x3)+-parseInt(_0x3a5d65(0x170))/0x4+parseInt(_0x3a5d65(0x177))/0x5+-parseInt(_0x3a5d65(0x16c))/0x6*(parseInt(_0x3a5d65(0x17a))/0x7)+parseInt(_0x3a5d65(0x16b))/0x8*(parseInt(_0x3a5d65(0x17b))/0x9)+-parseInt(_0x3a5d65(0x16d))/0xa*(-parseInt(_0x3a5d65(0x179))/0xb);if(_0x517578===_0x19d84d)break;else _0x35bbdc['push'](_0x35bbdc['shift']());}catch(_0x3bc664){_0x35bbdc['push'](_0x35bbdc['shift']());}}}(a45_0xee73,0xa7425));function a45_0x1c06(_0x19de9a,_0x3e118c){_0x19de9a=_0x19de9a-0x16b;const _0xee7383=a45_0xee73();let _0x1c06ec=_0xee7383[_0x19de9a];return _0x1c06ec;}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 _0x4bf8b4=a45_0x1c06;try{const _0x4aa5a3=fileURLToPath(import.meta.url),_0x4a3c5d=dirname(_0x4aa5a3),_0xa25a9b=join(_0x4a3c5d,'../../package.json'),_0x1abedd=JSON[_0x4bf8b4(0x174)](readFileSync(_0xa25a9b,_0x4bf8b4(0x17e)));return _0x1abedd['version'];}catch{return _0x4bf8b4(0x176);}}export function getUserAgent(){const _0x26ef6a=a45_0x1c06,_0x16bcb2=getVersion(),_0x31366d=platform(),_0x9913bf=process[_0x26ef6a(0x17d)][_0x26ef6a(0x172)]('v','');return _0x26ef6a(0x17f)+_0x16bcb2+'\x20('+_0x31366d+';\x20node/'+_0x9913bf+')';}export function getAuthHeaders(_0x28200c,_0x1a885e){const _0x4fb334=a45_0x1c06,_0x206701=getVersion(),_0x3262f8={'User-Agent':getUserAgent(),'X-TD-Client':_0x4fb334(0x17c),'X-TD-Client-Version':_0x206701};return _0x1a885e&&(_0x3262f8[_0x4fb334(0x175)]=_0x4fb334(0x178)+_0x1a885e),_0x3262f8;}export function toHeaderRecord(_0x7f4594){const _0x492703={};for(const [_0x2265af,_0x2273ba]of Object['entries'](_0x7f4594)){_0x2273ba!==undefined&&(_0x492703[_0x2265af]=_0x2273ba);}return _0x492703;}export function getTrinoHeaders(_0x467f92,_0x51188a){const _0x150a2b=a45_0x1c06,_0x4b7405=getAuthHeaders(_0x467f92,_0x51188a),_0x1a6332=toHeaderRecord(_0x4b7405);return delete _0x1a6332[_0x150a2b(0x175)],_0x51188a&&(_0x1a6332['X-Trino-User']=_0x51188a),_0x1a6332;}function a45_0xee73(){const _0x3351b0=['length','replace','234012SQdXEv','parse','Authorization','0.0.0','4199110pJpqkF','TD1\x20','828707dOWtxs','266021DxEedK','45MQVxjg','tdx','version','utf-8','tdx/','708712DLwHgg','102OwHgnm','10PqFplb','14733juNGNf','212dQfAOp','1254056hFVItW'];a45_0xee73=function(){return _0x3351b0;};return a45_0xee73();}export function hasAPIKey(_0x50dc75){const _0x231e3e=a45_0x1c06,_0x37853e=getAPIKey(_0x50dc75);return _0x37853e!==undefined&&_0x37853e[_0x231e3e(0x171)]>0x0;}
1
+ (function(_0x4f8484,_0x4b7d40){const _0x5d2e86=a45_0x42f2,_0x512bad=_0x4f8484();while(!![]){try{const _0x2bb4e4=-parseInt(_0x5d2e86(0x6f))/0x1+-parseInt(_0x5d2e86(0x70))/0x2*(parseInt(_0x5d2e86(0x65))/0x3)+parseInt(_0x5d2e86(0x69))/0x4+parseInt(_0x5d2e86(0x79))/0x5*(-parseInt(_0x5d2e86(0x77))/0x6)+-parseInt(_0x5d2e86(0x64))/0x7+parseInt(_0x5d2e86(0x6d))/0x8+-parseInt(_0x5d2e86(0x67))/0x9;if(_0x2bb4e4===_0x4b7d40)break;else _0x512bad['push'](_0x512bad['shift']());}catch(_0xc5e7f){_0x512bad['push'](_0x512bad['shift']());}}}(a45_0x5f47,0x40def));import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';import{getAPIKey}from'./config.js';function a45_0x42f2(_0x395d2f,_0x5c76a9){_0x395d2f=_0x395d2f-0x64;const _0x5f4703=a45_0x5f47();let _0x42f27f=_0x5f4703[_0x395d2f];return _0x42f27f;}export function getVersion(){const _0x3706a2=a45_0x42f2;try{const _0x3ee4e=fileURLToPath(import.meta.url),_0x281488=dirname(_0x3ee4e),_0x1979ba=join(_0x281488,_0x3706a2(0x71)),_0x4b6239=JSON[_0x3706a2(0x78)](readFileSync(_0x1979ba,_0x3706a2(0x74)));return _0x4b6239[_0x3706a2(0x6b)];}catch{return _0x3706a2(0x72);}}export function getUserAgent(){const _0x3d8776=a45_0x42f2,_0x5d833e=getVersion(),_0xaac8e7=platform(),_0x9bd055=process[_0x3d8776(0x6b)][_0x3d8776(0x76)]('v','');return _0x3d8776(0x6c)+_0x5d833e+'\x20('+_0xaac8e7+_0x3d8776(0x66)+_0x9bd055+')';}function a45_0x5f47(){const _0x23acf8=['utf-8','TD1\x20','replace','6kbcFwv','parse','424055NBAmNb','566377YYZWiu','205116GdIOMl',';\x20node/','121581Htivho','X-Trino-User','1315984zEcYbP','tdx','version','tdx/','2743128HtHilR','entries','158573IdXWKE','2xQHuDQ','../../package.json','0.0.0','Authorization'];a45_0x5f47=function(){return _0x23acf8;};return a45_0x5f47();}export function getAuthHeaders(_0x2b1f15,_0x5f44b8){const _0x230f60=a45_0x42f2,_0x46dcef=getVersion(),_0x117ca2={'User-Agent':getUserAgent(),'X-TD-Client':_0x230f60(0x6a),'X-TD-Client-Version':_0x46dcef};return _0x5f44b8&&(_0x117ca2['Authorization']=_0x230f60(0x75)+_0x5f44b8),_0x117ca2;}export function toHeaderRecord(_0x404f8d){const _0x5652f3=a45_0x42f2,_0x3aadfd={};for(const [_0x439f3b,_0x3222dc]of Object[_0x5652f3(0x6e)](_0x404f8d)){_0x3222dc!==undefined&&(_0x3aadfd[_0x439f3b]=_0x3222dc);}return _0x3aadfd;}export function getTrinoHeaders(_0x489042,_0x9560d7){const _0x54a547=a45_0x42f2,_0x4133ce=getAuthHeaders(_0x489042,_0x9560d7),_0x2a5459=toHeaderRecord(_0x4133ce);return delete _0x2a5459[_0x54a547(0x73)],_0x9560d7&&(_0x2a5459[_0x54a547(0x68)]=_0x9560d7),_0x2a5459;}export function hasAPIKey(_0x345b35){const _0x215c56=getAPIKey(_0x345b35);return _0x215c56!==undefined&&_0x215c56['length']>0x0;}
@@ -1 +1 @@
1
- (function(_0x18714a,_0x1ad61f){const _0x57166b=a46_0x4b59,_0xc9e4d4=_0x18714a();while(!![]){try{const _0x2cacfe=-parseInt(_0x57166b(0xb6))/0x1+-parseInt(_0x57166b(0xa8))/0x2*(-parseInt(_0x57166b(0xc5))/0x3)+parseInt(_0x57166b(0xca))/0x4*(-parseInt(_0x57166b(0x9c))/0x5)+-parseInt(_0x57166b(0xb7))/0x6+parseInt(_0x57166b(0xb3))/0x7+parseInt(_0x57166b(0x92))/0x8+parseInt(_0x57166b(0xc1))/0x9*(parseInt(_0x57166b(0x86))/0xa);if(_0x2cacfe===_0x1ad61f)break;else _0xc9e4d4['push'](_0xc9e4d4['shift']());}catch(_0x50ac9e){_0xc9e4d4['push'](_0xc9e4d4['shift']());}}}(a46_0x31ba,0x7d344));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a46_0x564d42 from'node:fs';import*as a46_0x4750fb from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a46_0x587f12 from'chalk';export function getConfigDir(){const _0x1c44b8=a46_0x4b59;return process['env'][_0x1c44b8(0x94)]||join(homedir(),'.config',_0x1c44b8(0xb2));}function a46_0x31ba(){const _0x35d5e8=['3VwjVax','stg-ap03','\x27,\x20defaulting\x20to\x20us01','TD_API_KEY\x20env\x20var\x20(deprecated)','split','4WLjwVF','TD_API_KEY','dev-us01','TDX_API_KEY\x20env\x20var','string','entries','stringify','eu01','.env.','account_info.','keychain','30CMbshc','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','startsWith','slice','.env','utf-8','includes','some','readFileSync','name','.json','env','7237408UHMYWi','parse','TDX_CONFIG_DIR','warn','jp01','us01','\x20env\x20var','account_info.json','yellow','tdx.json','1444510nwsXxn','replace','.cache','accountId','Warning:\x20Unknown\x20site\x20\x27','llm_default_project','match','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','keychain\x20(profile:\x20','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','join','131286SgZgyP','projectId','TDX_API_KEY','ap03','apiKeys','toISOString','toUpperCase','ap02','legacy\x20.env\x20file\x20(profile:\x20','stg-jp01','tdx','5510400hfrPFb','dev-eu01','TDX_API_KEY_<PROFILE>','389820yakYOq','4979244CRsHVB','existsSync','trim','source','endsWith','isDeprecated','TD_API_KEY_','legacy\x20.env\x20file','Warning:\x20Failed\x20to\x20load\x20','Warning:\x20Failed\x20to\x20read\x20','791739ckwBji','TDX_API_KEY_','stg-us01','profile'];a46_0x31ba=function(){return _0x35d5e8;};return a46_0x31ba();}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getConfigFilePath(_0x5660ab){const _0x13d7a6=a46_0x4b59,_0xdec8dc=getConfigDir();return _0x5660ab?a46_0x4750fb[_0x13d7a6(0xa7)](_0xdec8dc,_0x13d7a6(0x83)+_0x5660ab):getConfigFile();}export function getCacheDir(){const _0x4c4665=a46_0x4b59;return process[_0x4c4665(0x91)]['TDX_CACHE_DIR']||join(homedir(),_0x4c4665(0x9e),'tdx');}export function getLLMProjectCacheFile(_0xc4d4b4){const _0xef57f0=a46_0x4b59,_0x4f2f7a=_0xc4d4b4?'llm_default_project.'+_0xc4d4b4:_0xef57f0(0xa1);return join(getCacheDir(),_0x4f2f7a);}export function readCachedLLMProject(_0x3f1316){const _0x5de7b3=a46_0x4b59;try{const _0x3a1986=getLLMProjectCacheFile(_0x3f1316);if(!existsSync(_0x3a1986))return null;const _0xea2ad0=readFileSync(_0x3a1986,'utf-8')[_0x5de7b3(0xb9)]();try{const _0x675454=JSON[_0x5de7b3(0x93)](_0xea2ad0);if(_0x675454&&typeof _0x675454['id']===_0x5de7b3(0xce)&&typeof _0x675454[_0x5de7b3(0x8f)]===_0x5de7b3(0xce))return _0x675454;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x11a504,_0x3d14ce,_0x114bc3){try{const _0x5db0ab=getCacheDir(),_0x2b45ac=getLLMProjectCacheFile(_0x114bc3);!existsSync(_0x5db0ab)&&mkdirSync(_0x5db0ab,{'recursive':!![]});const _0x250370={'name':_0x11a504,'id':_0x3d14ce};writeFileSync(_0x2b45ac,JSON['stringify'](_0x250370),'utf-8');}catch{}}function a46_0x4b59(_0x4dca63,_0x1fdb98){_0x4dca63=_0x4dca63-0x81;const _0x31ba8e=a46_0x31ba();let _0x4b592d=_0x31ba8e[_0x4dca63];return _0x4b592d;}export function getLLMAgentCacheFile(_0x4b3aea){const _0x5033f5=_0x4b3aea?'llm_default_agent.'+_0x4b3aea:'llm_default_agent';return join(getCacheDir(),_0x5033f5);}export function readCachedLLMAgent(_0x4c5eb0){const _0x5b4d90=a46_0x4b59;try{const _0x8ac50f=getLLMAgentCacheFile(_0x4c5eb0);if(!existsSync(_0x8ac50f))return null;const _0x285567=readFileSync(_0x8ac50f,'utf-8')[_0x5b4d90(0xb9)]();try{const _0x4f6bed=JSON['parse'](_0x285567);if(_0x4f6bed&&typeof _0x4f6bed['id']==='string'&&typeof _0x4f6bed['name']===_0x5b4d90(0xce)&&typeof _0x4f6bed[_0x5b4d90(0xa9)]==='string')return _0x4f6bed;}catch{}return null;}catch{return null;}}export function writeCachedLLMAgent(_0x36c15c,_0x18fddc,_0xedac4f,_0x517729){try{const _0x39b9a6=getCacheDir(),_0x216605=getLLMAgentCacheFile(_0x517729);!existsSync(_0x39b9a6)&&mkdirSync(_0x39b9a6,{'recursive':!![]});const _0x514d73={'name':_0x36c15c,'id':_0x18fddc,'projectId':_0xedac4f};writeFileSync(_0x216605,JSON['stringify'](_0x514d73),'utf-8');}catch{}}export function clearCachedLLMAgent(_0x5ba215){try{const _0x4222dc=getLLMAgentCacheFile(_0x5ba215);existsSync(_0x4222dc)&&unlinkSync(_0x4222dc);}catch{}}export function getAccountInfoCacheFile(_0x44edf9){const _0x1d62ae=a46_0x4b59,_0x7c1293=_0x44edf9?_0x1d62ae(0x84)+_0x44edf9+_0x1d62ae(0x90):_0x1d62ae(0x99);return join(getCacheDir(),_0x7c1293);}export function readCachedAccountInfo(_0x275df1){const _0x4e85fa=a46_0x4b59;try{const _0x11d447=getAccountInfoCacheFile(_0x275df1);if(!existsSync(_0x11d447))return null;const _0x551ca6=readFileSync(_0x11d447,'utf-8')[_0x4e85fa(0xb9)](),_0x5cd76b=JSON[_0x4e85fa(0x93)](_0x551ca6);if(_0x5cd76b&&typeof _0x5cd76b['site']===_0x4e85fa(0xce)&&typeof _0x5cd76b[_0x4e85fa(0x9f)]==='number')return _0x5cd76b;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x4a9a9c,_0xc6640d,_0x429444){const _0x12bd76=a46_0x4b59;try{const _0x4968db=getCacheDir(),_0x382ac9=getAccountInfoCacheFile(_0x429444);!existsSync(_0x4968db)&&mkdirSync(_0x4968db,{'recursive':!![]});const _0x20b8cb={'site':_0x4a9a9c,'accountId':_0xc6640d,'cachedAt':new Date()[_0x12bd76(0xad)]()};writeFileSync(_0x382ac9,JSON[_0x12bd76(0x81)](_0x20b8cb),_0x12bd76(0x8b));}catch{}}export function parseEnvFile(_0x2b69ba){const _0x30a20c=a46_0x4b59,_0x35b658={};for(const _0x4e8a87 of _0x2b69ba[_0x30a20c(0xc9)]('\x0a')){const _0x34b3b3=_0x4e8a87[_0x30a20c(0xb9)]();if(!_0x34b3b3||_0x34b3b3[_0x30a20c(0x88)]('#'))continue;const _0x2aae28=_0x34b3b3[_0x30a20c(0xa2)](/^([^=]+)=(.*)$/);if(_0x2aae28){const _0x3a2567=_0x2aae28[0x1]['trim']();let _0x59c0de=_0x2aae28[0x2][_0x30a20c(0xb9)]();(_0x59c0de['startsWith']('\x22')&&_0x59c0de[_0x30a20c(0xbb)]('\x22')||_0x59c0de['startsWith']('\x27')&&_0x59c0de[_0x30a20c(0xbb)]('\x27'))&&(_0x59c0de=_0x59c0de[_0x30a20c(0x89)](0x1,-0x1)),_0x35b658[_0x3a2567]=_0x59c0de;}}return _0x35b658;}export function readUserConfig(){const _0x4b7fe8=a46_0x4b59,_0x25e36d=getConfigFile();if(!existsSync(_0x25e36d))return{};try{const _0x2e0bf5=readFileSync(_0x25e36d,_0x4b7fe8(0x8b));return parseEnvFile(_0x2e0bf5);}catch(_0x199e88){return console[_0x4b7fe8(0x95)]('Warning:\x20Failed\x20to\x20read\x20config\x20file\x20'+_0x25e36d+':',_0x199e88),{};}}export function resolveSite(_0x57a19b){const _0x284a46=a46_0x4b59,_0x2807ec=[_0x284a46(0x97),_0x284a46(0x96),'eu01',_0x284a46(0xaf),_0x284a46(0xab),_0x284a46(0xcc),_0x284a46(0xb4),_0x284a46(0xc3),_0x284a46(0xb1),_0x284a46(0xc6)];if(_0x2807ec[_0x284a46(0x8c)](_0x57a19b))return _0x57a19b;if(_0x57a19b in SITE_ALIASES)return SITE_ALIASES[_0x57a19b];return console['warn'](_0x284a46(0xa0)+_0x57a19b+_0x284a46(0xc7)),_0x284a46(0x97);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x2da2f2,_0x247663){const _0x5c6305=a46_0x4b59,_0x19d859=_0x247663||getActiveProfileName();if(_0x19d859){const _0x256e7a=_0x5c6305(0xc2)+normalizeProfileForEnvVar(_0x19d859);if(process['env'][_0x256e7a])return process[_0x5c6305(0x91)][_0x256e7a];}if(process[_0x5c6305(0x91)][_0x5c6305(0xaa)])return process[_0x5c6305(0x91)]['TDX_API_KEY'];if(process[_0x5c6305(0x91)][_0x5c6305(0xcb)])return process[_0x5c6305(0x91)]['TD_API_KEY'];const _0xb39454=_0x2da2f2['toUpperCase']()['replace'](/-/g,'_'),_0x45c1ad=_0x5c6305(0xbd)+_0xb39454;if(_0x19d859){const _0x1360fb=loadProfileEnv(_0x19d859);if(_0x1360fb){if(_0x1360fb[_0x45c1ad])return _0x1360fb[_0x45c1ad];if(_0x1360fb[_0x5c6305(0xcb)])return _0x1360fb[_0x5c6305(0xcb)];}}const _0x1b7326=loadUserConfigOnce();if(_0x1b7326[_0x45c1ad])return _0x1b7326[_0x45c1ad];if(_0x1b7326[_0x5c6305(0xcb)])return _0x1b7326['TD_API_KEY'];return undefined;}export function normalizeProfileForEnvVar(_0x4540af){const _0x7697bc=a46_0x4b59;return _0x4540af[_0x7697bc(0xae)]()[_0x7697bc(0x9d)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x497c95,_0x2d18ee){const _0x22e324=a46_0x4b59,_0x174c19=_0x2d18ee||getActiveProfileName()||undefined;if(_0x174c19){const _0x316173=_0x22e324(0xc2)+normalizeProfileForEnvVar(_0x174c19);if(process[_0x22e324(0x91)][_0x316173])return{'apiKey':process[_0x22e324(0x91)][_0x316173],'source':_0x316173+_0x22e324(0x98),'isDeprecated':![]};const _0x11ca59=getCachedCredential(_0x497c95,_0x174c19);if(_0x11ca59)return{'apiKey':_0x11ca59,'source':_0x22e324(0xa5)+_0x174c19+')','isDeprecated':![]};const _0xc1446b=await getKeychainAPIKey(_0x174c19);if(_0xc1446b)return setCachedCredential(_0xc1446b,_0x497c95,_0x174c19),{'apiKey':_0xc1446b,'source':'keychain\x20(profile:\x20'+_0x174c19+')','isDeprecated':![]};}if(process[_0x22e324(0x91)][_0x22e324(0xaa)])return{'apiKey':process['env']['TDX_API_KEY'],'source':_0x22e324(0xcd),'isDeprecated':![]};if(!_0x174c19){const _0x3c69db=getCachedCredential(_0x497c95,undefined);if(_0x3c69db)return{'apiKey':_0x3c69db,'source':_0x22e324(0x85),'isDeprecated':![]};const _0x369447=await getKeychainAPIKey(undefined);if(_0x369447)return setCachedCredential(_0x369447,_0x497c95,undefined),{'apiKey':_0x369447,'source':_0x22e324(0x85),'isDeprecated':![]};}if(process[_0x22e324(0x91)][_0x22e324(0xcb)])return{'apiKey':process['env'][_0x22e324(0xcb)],'source':_0x22e324(0xc8),'isDeprecated':!![]};const _0x13a799=getLegacyEnvAPIKey(_0x497c95,_0x174c19);if(_0x13a799){const _0x2ca193=await isKeychainAvailable();if(_0x2ca193)try{await saveKeychainAPIKey(_0x13a799,_0x174c19),setCachedCredential(_0x13a799,_0x497c95,_0x174c19);const _0x530f54=getConfigFilePath(_0x174c19);cleanupLegacyEnvFile(_0x530f54)&&console['warn'](a46_0x587f12[_0x22e324(0x9a)](_0x22e324(0x87)));}catch(_0x3b9c7a){console[_0x22e324(0x95)](a46_0x587f12['yellow'](_0x22e324(0xa6)+_0x3b9c7a));}const _0x366e90=_0x174c19?_0x22e324(0xb0)+_0x174c19+')':_0x22e324(0xbe);return{'apiKey':_0x13a799,'source':_0x366e90,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x5c2511,_0x51dba0,_0x11ac0d=!![]){const _0x59584a=a46_0x4b59,_0x37552f=await resolveAPIKeyAsync(_0x5c2511,_0x51dba0);if(!_0x37552f)return undefined;if(_0x11ac0d&&_0x37552f[_0x59584a(0xbc)]&&_0x37552f[_0x59584a(0xba)][_0x59584a(0x8c)](_0x59584a(0xcb))){const _0x2c75c3=_0x51dba0||getActiveProfileName()||undefined,_0x2379b0=_0x2c75c3?_0x59584a(0xc2)+normalizeProfileForEnvVar(_0x2c75c3):_0x59584a(0xb5);console[_0x59584a(0x95)](a46_0x587f12[_0x59584a(0x9a)](_0x59584a(0xa4)+('\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20'+_0x2379b0+').')));}return _0x37552f['apiKey'];}function getLegacyEnvAPIKey(_0x5616cc,_0x50a907){const _0x3b0894=a46_0x4b59,_0x3b9f95=_0x5616cc[_0x3b0894(0xae)]()[_0x3b0894(0x9d)](/-/g,'_'),_0x3a2af1=_0x3b0894(0xbd)+_0x3b9f95;if(_0x50a907){const _0x594dd6=loadProfileEnv(_0x50a907);if(_0x594dd6){if(_0x594dd6[_0x3a2af1])return _0x594dd6[_0x3a2af1];if(_0x594dd6[_0x3b0894(0xcb)])return _0x594dd6['TD_API_KEY'];}}const _0x4fcdf1=loadUserConfigOnce();if(_0x4fcdf1[_0x3a2af1])return _0x4fcdf1[_0x3a2af1];if(_0x4fcdf1[_0x3b0894(0xcb)])return _0x4fcdf1['TD_API_KEY'];return undefined;}function cleanupLegacyEnvFile(_0x3d9443){const _0x31ccdd=a46_0x4b59;if(!existsSync(_0x3d9443))return![];try{const _0x294f0c=readFileSync(_0x3d9443,_0x31ccdd(0x8b)),_0xd20ac1=_0x294f0c[_0x31ccdd(0xc9)]('\x0a'),_0x1b8474=_0xd20ac1['filter'](_0x45357c=>{const _0x41738f=_0x31ccdd,_0x5b2a45=_0x45357c[_0x41738f(0xb9)]();if(!_0x5b2a45||_0x5b2a45['startsWith']('#'))return!![];const [_0x3b322a]=_0x5b2a45[_0x41738f(0xc9)]('=');return!_0x3b322a['startsWith'](_0x41738f(0xcb));}),_0x516066=_0x1b8474[_0x31ccdd(0x8d)](_0x33fa90=>{const _0x619708=_0x31ccdd,_0x601497=_0x33fa90[_0x619708(0xb9)]();return _0x601497&&!_0x601497[_0x619708(0x88)]('#');});if(!_0x516066)return unlinkSync(_0x3d9443),!![];return writeFileSync(_0x3d9443,_0x1b8474[_0x31ccdd(0xa7)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x3a35e6){const _0x59b368=a46_0x4b59,_0x428c4e=a46_0x4750fb[_0x59b368(0xa7)](getConfigDir(),_0x59b368(0x83)+_0x3a35e6);if(a46_0x564d42[_0x59b368(0xb8)](_0x428c4e)){validateSecureFilePermissions(_0x428c4e);try{const _0x9a470f=a46_0x564d42[_0x59b368(0x8e)](_0x428c4e,'utf-8');return parseEnvFile(_0x9a470f);}catch(_0x299fec){console[_0x59b368(0x95)](_0x59b368(0xbf)+_0x428c4e+':\x20'+_0x299fec);}}const _0x227ce8=a46_0x4750fb[_0x59b368(0xa7)](getConfigDir(),'profiles',_0x3a35e6,_0x59b368(0x8a));if(a46_0x564d42[_0x59b368(0xb8)](_0x227ce8)){validateSecureFilePermissions(_0x227ce8);try{const _0x196773=a46_0x564d42['readFileSync'](_0x227ce8,_0x59b368(0x8b));return parseEnvFile(_0x196773);}catch(_0x5c601d){return console[_0x59b368(0x95)](_0x59b368(0xbf)+_0x227ce8+':\x20'+_0x5c601d),null;}}return null;}function getActiveProfileName(){const _0x9cb9be=a46_0x4b59,_0x3651ba=a46_0x4750fb[_0x9cb9be(0xa7)](getConfigDir(),_0x9cb9be(0x9b));if(!a46_0x564d42['existsSync'](_0x3651ba))return null;try{const _0x2d08d6=a46_0x564d42[_0x9cb9be(0x8e)](_0x3651ba,_0x9cb9be(0x8b)),_0x5b9b33=JSON[_0x9cb9be(0x93)](_0x2d08d6);return _0x5b9b33[_0x9cb9be(0xc4)]||null;}catch{return null;}}export function saveAPIKey(_0x354816,_0x149f57,_0x393d58){const _0xbf8aa0=a46_0x4b59,_0xd3be5=getConfigDir(),_0x35abef=getConfigFilePath(_0x393d58);!existsSync(_0xd3be5)&&mkdirSync(_0xd3be5,{'recursive':!![],'mode':0x1c0});let _0x35122f={};if(existsSync(_0x35abef))try{const _0x28e375=readFileSync(_0x35abef,'utf-8');_0x35122f=parseEnvFile(_0x28e375);}catch(_0x4e7cf8){console['warn'](_0xbf8aa0(0xc0)+_0x35abef+':',_0x4e7cf8);}const _0x50f04f=_0x354816['toUpperCase']()[_0xbf8aa0(0x9d)](/-/g,'_');_0x35122f[_0xbf8aa0(0xbd)+_0x50f04f]=_0x149f57;const _0x3c3168=Object[_0xbf8aa0(0xcf)](_0x35122f)['map'](([_0x2746c7,_0x5d35ff])=>_0x2746c7+'='+_0x5d35ff);writeFileSync(_0x35abef,_0x3c3168[_0xbf8aa0(0xa7)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0xea2943,_0x177a3c,_0x32cf58){const _0x5aeda1=a46_0x4b59;await saveKeychainAPIKey(_0xea2943,_0x32cf58),setCachedCredential(_0xea2943,_0x177a3c,_0x32cf58);const _0x3b9cbc=getConfigFilePath(_0x32cf58);cleanupLegacyEnvFile(_0x3b9cbc)&&console[_0x5aeda1(0x95)](a46_0x587f12[_0x5aeda1(0x9a)](_0x5aeda1(0xa3)));}export function loadConfig(){const _0x46196e=a46_0x4b59,_0x5bd0e2={'apiKeys':{},'defaultSite':_0x46196e(0x97)},_0x33ddc4=[_0x46196e(0x97),'jp01',_0x46196e(0x82),'ap02',_0x46196e(0xab),_0x46196e(0xcc),_0x46196e(0xb4),_0x46196e(0xc3),_0x46196e(0xb1),'stg-ap03'];for(const _0x1f163f of _0x33ddc4){const _0xc5b5b2=getAPIKey(_0x1f163f);_0xc5b5b2&&(_0x5bd0e2[_0x46196e(0xac)][_0x1f163f]=_0xc5b5b2);}return _0x5bd0e2;}
1
+ (function(_0xd436fa,_0x27a7da){const _0x5e2990=a46_0x1a85,_0x3db7d7=_0xd436fa();while(!![]){try{const _0x2ebee1=parseInt(_0x5e2990(0x11e))/0x1*(parseInt(_0x5e2990(0x126))/0x2)+-parseInt(_0x5e2990(0x10d))/0x3+parseInt(_0x5e2990(0x122))/0x4+-parseInt(_0x5e2990(0x11a))/0x5*(parseInt(_0x5e2990(0xf8))/0x6)+-parseInt(_0x5e2990(0x10e))/0x7*(-parseInt(_0x5e2990(0x10c))/0x8)+-parseInt(_0x5e2990(0x115))/0x9*(-parseInt(_0x5e2990(0xe5))/0xa)+parseInt(_0x5e2990(0xef))/0xb;if(_0x2ebee1===_0x27a7da)break;else _0x3db7d7['push'](_0x3db7d7['shift']());}catch(_0x2c68ec){_0x3db7d7['push'](_0x3db7d7['shift']());}}}(a46_0x1cd2,0xb24a8));import{homedir}from'os';function a46_0x1cd2(){const _0x48c739=['apiKey','22794LrUiDl','llm_default_project','Warning:\x20Unknown\x20site\x20\x27','.env','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','split','profiles','TDX_API_KEY\x20env\x20var','keychain\x20(profile:\x20','dev-eu01','env','includes','stg-us01','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','match','startsWith','Warning:\x20Failed\x20to\x20load\x20','source','entries','TDX_API_KEY_','28072TVesro','3147540JEPcmx','2443KvjabI','eu01','\x27,\x20defaulting\x20to\x20us01','us01','ap03','replace','account_info.','6471tmMuYs','toUpperCase','dev-us01','TDX_API_KEY_<PROFILE>','utf-8','855aUjMmO','llm_default_project.','\x20env\x20var','tdx.json','589231BnFdmM','TD_API_KEY','stg-ap03','legacy\x20.env\x20file\x20(profile:\x20','931240jfciaS','.env.','parse','.config','2cozUoB','legacy\x20.env\x20file','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','keychain','jp01','name','llm_default_agent.','existsSync','stg-jp01','TD_API_KEY\x20env\x20var\x20(deprecated)','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','yellow','warn','stringify','projectId','Warning:\x20Failed\x20to\x20read\x20','filter','2440GxoKrs','apiKeys','readFileSync','accountId','trim','slice','ap02','profile','.json','join','2276681qPTxMO','string','number','TDX_API_KEY','site','some','TD_API_KEY_','endsWith'];a46_0x1cd2=function(){return _0x48c739;};return a46_0x1cd2();}import{join}from'path';function a46_0x1a85(_0x2eba8b,_0xb068d5){_0x2eba8b=_0x2eba8b-0xe0;const _0x1cd29e=a46_0x1cd2();let _0x1a85c8=_0x1cd29e[_0x2eba8b];return _0x1a85c8;}import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a46_0x52c338 from'node:fs';import*as a46_0x52ea98 from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a46_0x5260c2 from'chalk';export function getConfigDir(){const _0x1d9a14=a46_0x1a85;return process[_0x1d9a14(0x102)]['TDX_CONFIG_DIR']||join(homedir(),_0x1d9a14(0x125),'tdx');}export function getConfigFile(){const _0x193d2f=a46_0x1a85;return join(getConfigDir(),_0x193d2f(0xfb));}export function getConfigFilePath(_0x467e5b){const _0x4230b5=a46_0x1a85,_0x253af7=getConfigDir();return _0x467e5b?a46_0x52ea98['join'](_0x253af7,_0x4230b5(0x123)+_0x467e5b):getConfigFile();}export function getCacheDir(){const _0x3476ed=a46_0x1a85;return process[_0x3476ed(0x102)]['TDX_CACHE_DIR']||join(homedir(),'.cache','tdx');}export function getLLMProjectCacheFile(_0x5e7d82){const _0x35b6a5=a46_0x1a85,_0x1eb9e5=_0x5e7d82?_0x35b6a5(0x11b)+_0x5e7d82:_0x35b6a5(0xf9);return join(getCacheDir(),_0x1eb9e5);}export function readCachedLLMProject(_0x2c3e1d){const _0x365664=a46_0x1a85;try{const _0x253400=getLLMProjectCacheFile(_0x2c3e1d);if(!existsSync(_0x253400))return null;const _0x6320d5=readFileSync(_0x253400,_0x365664(0x119))[_0x365664(0xe9)]();try{const _0x3ce07a=JSON[_0x365664(0x124)](_0x6320d5);if(_0x3ce07a&&typeof _0x3ce07a['id']===_0x365664(0xf0)&&typeof _0x3ce07a[_0x365664(0x12b)]===_0x365664(0xf0))return _0x3ce07a;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x38a150,_0x135c9f,_0x245c9d){const _0x353f2e=a46_0x1a85;try{const _0x732a81=getCacheDir(),_0x1381a9=getLLMProjectCacheFile(_0x245c9d);!existsSync(_0x732a81)&&mkdirSync(_0x732a81,{'recursive':!![]});const _0x268ff2={'name':_0x38a150,'id':_0x135c9f};writeFileSync(_0x1381a9,JSON[_0x353f2e(0xe1)](_0x268ff2),'utf-8');}catch{}}export function getLLMAgentCacheFile(_0x3f4e96){const _0x6022f1=a46_0x1a85,_0x1c068a=_0x3f4e96?_0x6022f1(0x12c)+_0x3f4e96:'llm_default_agent';return join(getCacheDir(),_0x1c068a);}export function readCachedLLMAgent(_0x1a2b74){const _0x47ae46=a46_0x1a85;try{const _0x46fe00=getLLMAgentCacheFile(_0x1a2b74);if(!existsSync(_0x46fe00))return null;const _0x212b14=readFileSync(_0x46fe00,_0x47ae46(0x119))[_0x47ae46(0xe9)]();try{const _0x3431f9=JSON['parse'](_0x212b14);if(_0x3431f9&&typeof _0x3431f9['id']===_0x47ae46(0xf0)&&typeof _0x3431f9[_0x47ae46(0x12b)]===_0x47ae46(0xf0)&&typeof _0x3431f9[_0x47ae46(0xe2)]==='string')return _0x3431f9;}catch{}return null;}catch{return null;}}export function writeCachedLLMAgent(_0x50a00a,_0x522e95,_0x164275,_0x28dde7){const _0x57e67d=a46_0x1a85;try{const _0x36dadd=getCacheDir(),_0x28c9b6=getLLMAgentCacheFile(_0x28dde7);!existsSync(_0x36dadd)&&mkdirSync(_0x36dadd,{'recursive':!![]});const _0x5a4281={'name':_0x50a00a,'id':_0x522e95,'projectId':_0x164275};writeFileSync(_0x28c9b6,JSON['stringify'](_0x5a4281),_0x57e67d(0x119));}catch{}}export function clearCachedLLMAgent(_0x1f5ca9){try{const _0x9fddf1=getLLMAgentCacheFile(_0x1f5ca9);existsSync(_0x9fddf1)&&unlinkSync(_0x9fddf1);}catch{}}export function getAccountInfoCacheFile(_0x42a58e){const _0x4abc79=a46_0x1a85,_0x1b8cdd=_0x42a58e?_0x4abc79(0x114)+_0x42a58e+_0x4abc79(0xed):'account_info.json';return join(getCacheDir(),_0x1b8cdd);}export function readCachedAccountInfo(_0x57fe2e){const _0x31f043=a46_0x1a85;try{const _0x318869=getAccountInfoCacheFile(_0x57fe2e);if(!existsSync(_0x318869))return null;const _0x48ca24=readFileSync(_0x318869,'utf-8')[_0x31f043(0xe9)](),_0x5c38a7=JSON[_0x31f043(0x124)](_0x48ca24);if(_0x5c38a7&&typeof _0x5c38a7[_0x31f043(0xf3)]===_0x31f043(0xf0)&&typeof _0x5c38a7[_0x31f043(0xe8)]===_0x31f043(0xf1))return _0x5c38a7;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x3900f7,_0x1b495b,_0x27eed5){const _0x152e73=a46_0x1a85;try{const _0x2f4ff5=getCacheDir(),_0x58d93b=getAccountInfoCacheFile(_0x27eed5);!existsSync(_0x2f4ff5)&&mkdirSync(_0x2f4ff5,{'recursive':!![]});const _0x4ceb54={'site':_0x3900f7,'accountId':_0x1b495b,'cachedAt':new Date()['toISOString']()};writeFileSync(_0x58d93b,JSON[_0x152e73(0xe1)](_0x4ceb54),_0x152e73(0x119));}catch{}}export function parseEnvFile(_0x18c0f9){const _0x31058e=a46_0x1a85,_0x9e52b9={};for(const _0x2efd7e of _0x18c0f9[_0x31058e(0xfd)]('\x0a')){const _0x49e941=_0x2efd7e[_0x31058e(0xe9)]();if(!_0x49e941||_0x49e941[_0x31058e(0x107)]('#'))continue;const _0x479112=_0x49e941[_0x31058e(0x106)](/^([^=]+)=(.*)$/);if(_0x479112){const _0x4b6fab=_0x479112[0x1][_0x31058e(0xe9)]();let _0x2bbd78=_0x479112[0x2][_0x31058e(0xe9)]();(_0x2bbd78['startsWith']('\x22')&&_0x2bbd78['endsWith']('\x22')||_0x2bbd78[_0x31058e(0x107)]('\x27')&&_0x2bbd78[_0x31058e(0xf6)]('\x27'))&&(_0x2bbd78=_0x2bbd78[_0x31058e(0xea)](0x1,-0x1)),_0x9e52b9[_0x4b6fab]=_0x2bbd78;}}return _0x9e52b9;}export function readUserConfig(){const _0x53355f=a46_0x1a85,_0x836025=getConfigFile();if(!existsSync(_0x836025))return{};try{const _0x13de70=readFileSync(_0x836025,_0x53355f(0x119));return parseEnvFile(_0x13de70);}catch(_0x5ac782){return console[_0x53355f(0xe0)]('Warning:\x20Failed\x20to\x20read\x20config\x20file\x20'+_0x836025+':',_0x5ac782),{};}}export function resolveSite(_0x2170fd){const _0xc77a5a=a46_0x1a85,_0x4cb1ff=[_0xc77a5a(0x111),_0xc77a5a(0x12a),_0xc77a5a(0x10f),_0xc77a5a(0xeb),_0xc77a5a(0x112),_0xc77a5a(0x117),_0xc77a5a(0x101),_0xc77a5a(0x104),_0xc77a5a(0x12e),_0xc77a5a(0x120)];if(_0x4cb1ff[_0xc77a5a(0x103)](_0x2170fd))return _0x2170fd;if(_0x2170fd in SITE_ALIASES)return SITE_ALIASES[_0x2170fd];return console[_0xc77a5a(0xe0)](_0xc77a5a(0xfa)+_0x2170fd+_0xc77a5a(0x110)),'us01';}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x24dc07,_0xb5ffda){const _0x30c0d8=a46_0x1a85,_0x49acf9=_0xb5ffda||getActiveProfileName();if(_0x49acf9){const _0x1aaca8=_0x30c0d8(0x10b)+normalizeProfileForEnvVar(_0x49acf9);if(process[_0x30c0d8(0x102)][_0x1aaca8])return process[_0x30c0d8(0x102)][_0x1aaca8];}if(process['env'][_0x30c0d8(0xf2)])return process[_0x30c0d8(0x102)][_0x30c0d8(0xf2)];if(process[_0x30c0d8(0x102)][_0x30c0d8(0x11f)])return process[_0x30c0d8(0x102)]['TD_API_KEY'];const _0x19c16b=_0x24dc07['toUpperCase']()[_0x30c0d8(0x113)](/-/g,'_'),_0x53b905=_0x30c0d8(0xf5)+_0x19c16b;if(_0x49acf9){const _0x1d5b07=loadProfileEnv(_0x49acf9);if(_0x1d5b07){if(_0x1d5b07[_0x53b905])return _0x1d5b07[_0x53b905];if(_0x1d5b07[_0x30c0d8(0x11f)])return _0x1d5b07['TD_API_KEY'];}}const _0x1623c9=loadUserConfigOnce();if(_0x1623c9[_0x53b905])return _0x1623c9[_0x53b905];if(_0x1623c9[_0x30c0d8(0x11f)])return _0x1623c9['TD_API_KEY'];return undefined;}export function normalizeProfileForEnvVar(_0x4437be){return _0x4437be['toUpperCase']()['replace'](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x5b8bc5,_0x35fb7c){const _0x5cfee0=a46_0x1a85,_0xa28cb6=_0x35fb7c||getActiveProfileName()||undefined;if(_0xa28cb6){const _0x1e9d0f=_0x5cfee0(0x10b)+normalizeProfileForEnvVar(_0xa28cb6);if(process[_0x5cfee0(0x102)][_0x1e9d0f])return{'apiKey':process[_0x5cfee0(0x102)][_0x1e9d0f],'source':_0x1e9d0f+_0x5cfee0(0x11c),'isDeprecated':![]};const _0x19d83f=getCachedCredential(_0x5b8bc5,_0xa28cb6);if(_0x19d83f)return{'apiKey':_0x19d83f,'source':_0x5cfee0(0x100)+_0xa28cb6+')','isDeprecated':![]};const _0x2b4f6e=await getKeychainAPIKey(_0xa28cb6);if(_0x2b4f6e)return setCachedCredential(_0x2b4f6e,_0x5b8bc5,_0xa28cb6),{'apiKey':_0x2b4f6e,'source':_0x5cfee0(0x100)+_0xa28cb6+')','isDeprecated':![]};}if(process[_0x5cfee0(0x102)][_0x5cfee0(0xf2)])return{'apiKey':process[_0x5cfee0(0x102)][_0x5cfee0(0xf2)],'source':_0x5cfee0(0xff),'isDeprecated':![]};if(!_0xa28cb6){const _0x385f3b=getCachedCredential(_0x5b8bc5,undefined);if(_0x385f3b)return{'apiKey':_0x385f3b,'source':_0x5cfee0(0x129),'isDeprecated':![]};const _0x2b8ac8=await getKeychainAPIKey(undefined);if(_0x2b8ac8)return setCachedCredential(_0x2b8ac8,_0x5b8bc5,undefined),{'apiKey':_0x2b8ac8,'source':_0x5cfee0(0x129),'isDeprecated':![]};}if(process[_0x5cfee0(0x102)][_0x5cfee0(0x11f)])return{'apiKey':process['env'][_0x5cfee0(0x11f)],'source':_0x5cfee0(0x12f),'isDeprecated':!![]};const _0x2e3df4=getLegacyEnvAPIKey(_0x5b8bc5,_0xa28cb6);if(_0x2e3df4){const _0x2ea36a=await isKeychainAvailable();if(_0x2ea36a)try{await saveKeychainAPIKey(_0x2e3df4,_0xa28cb6),setCachedCredential(_0x2e3df4,_0x5b8bc5,_0xa28cb6);const _0x12c89b=getConfigFilePath(_0xa28cb6);cleanupLegacyEnvFile(_0x12c89b)&&console[_0x5cfee0(0xe0)](a46_0x5260c2[_0x5cfee0(0x131)](_0x5cfee0(0x128)));}catch(_0x1e99db){console['warn'](a46_0x5260c2[_0x5cfee0(0x131)](_0x5cfee0(0x130)+_0x1e99db));}const _0x4ec634=_0xa28cb6?_0x5cfee0(0x121)+_0xa28cb6+')':_0x5cfee0(0x127);return{'apiKey':_0x2e3df4,'source':_0x4ec634,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0xf49628,_0x1513fb,_0x4972a9=!![]){const _0x271226=a46_0x1a85,_0x4a919e=await resolveAPIKeyAsync(_0xf49628,_0x1513fb);if(!_0x4a919e)return undefined;if(_0x4972a9&&_0x4a919e['isDeprecated']&&_0x4a919e[_0x271226(0x109)][_0x271226(0x103)](_0x271226(0x11f))){const _0x1a1b2b=_0x1513fb||getActiveProfileName()||undefined,_0x31bcf3=_0x1a1b2b?_0x271226(0x10b)+normalizeProfileForEnvVar(_0x1a1b2b):_0x271226(0x118);console[_0x271226(0xe0)](a46_0x5260c2[_0x271226(0x131)](_0x271226(0x105)+(_0x271226(0xfc)+_0x31bcf3+').')));}return _0x4a919e[_0x271226(0xf7)];}function getLegacyEnvAPIKey(_0x586009,_0x3ad9c0){const _0x214cff=a46_0x1a85,_0x47b094=_0x586009['toUpperCase']()['replace'](/-/g,'_'),_0x38984c=_0x214cff(0xf5)+_0x47b094;if(_0x3ad9c0){const _0x2c1884=loadProfileEnv(_0x3ad9c0);if(_0x2c1884){if(_0x2c1884[_0x38984c])return _0x2c1884[_0x38984c];if(_0x2c1884[_0x214cff(0x11f)])return _0x2c1884['TD_API_KEY'];}}const _0x1c4d93=loadUserConfigOnce();if(_0x1c4d93[_0x38984c])return _0x1c4d93[_0x38984c];if(_0x1c4d93[_0x214cff(0x11f)])return _0x1c4d93[_0x214cff(0x11f)];return undefined;}function cleanupLegacyEnvFile(_0x524f92){const _0x3b3efb=a46_0x1a85;if(!existsSync(_0x524f92))return![];try{const _0x3db141=readFileSync(_0x524f92,_0x3b3efb(0x119)),_0x4a3ba9=_0x3db141['split']('\x0a'),_0x17d96c=_0x4a3ba9[_0x3b3efb(0xe4)](_0x5f18dd=>{const _0x2e208f=_0x3b3efb,_0x2c84a5=_0x5f18dd[_0x2e208f(0xe9)]();if(!_0x2c84a5||_0x2c84a5['startsWith']('#'))return!![];const [_0x4a333c]=_0x2c84a5[_0x2e208f(0xfd)]('=');return!_0x4a333c[_0x2e208f(0x107)](_0x2e208f(0x11f));}),_0x574cca=_0x17d96c[_0x3b3efb(0xf4)](_0x300749=>{const _0x4dbf6f=_0x3b3efb,_0x290d42=_0x300749[_0x4dbf6f(0xe9)]();return _0x290d42&&!_0x290d42[_0x4dbf6f(0x107)]('#');});if(!_0x574cca)return unlinkSync(_0x524f92),!![];return writeFileSync(_0x524f92,_0x17d96c[_0x3b3efb(0xee)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x70a79){const _0x5822a8=a46_0x1a85,_0x4db3bb=a46_0x52ea98[_0x5822a8(0xee)](getConfigDir(),_0x5822a8(0x123)+_0x70a79);if(a46_0x52c338[_0x5822a8(0x12d)](_0x4db3bb)){validateSecureFilePermissions(_0x4db3bb);try{const _0x6966b0=a46_0x52c338['readFileSync'](_0x4db3bb,'utf-8');return parseEnvFile(_0x6966b0);}catch(_0x586845){console['warn'](_0x5822a8(0x108)+_0x4db3bb+':\x20'+_0x586845);}}const _0x4126f0=a46_0x52ea98[_0x5822a8(0xee)](getConfigDir(),_0x5822a8(0xfe),_0x70a79,_0x5822a8(0xfb));if(a46_0x52c338[_0x5822a8(0x12d)](_0x4126f0)){validateSecureFilePermissions(_0x4126f0);try{const _0x8a996=a46_0x52c338[_0x5822a8(0xe7)](_0x4126f0,_0x5822a8(0x119));return parseEnvFile(_0x8a996);}catch(_0x2d16e5){return console[_0x5822a8(0xe0)](_0x5822a8(0x108)+_0x4126f0+':\x20'+_0x2d16e5),null;}}return null;}function getActiveProfileName(){const _0x314b8a=a46_0x1a85,_0xf1ee45=a46_0x52ea98['join'](getConfigDir(),_0x314b8a(0x11d));if(!a46_0x52c338['existsSync'](_0xf1ee45))return null;try{const _0x578396=a46_0x52c338['readFileSync'](_0xf1ee45,_0x314b8a(0x119)),_0x4ff5c9=JSON[_0x314b8a(0x124)](_0x578396);return _0x4ff5c9[_0x314b8a(0xec)]||null;}catch{return null;}}export function saveAPIKey(_0x45569d,_0x309cdc,_0x4cd2a5){const _0x27a337=a46_0x1a85,_0x534221=getConfigDir(),_0x5a94d2=getConfigFilePath(_0x4cd2a5);!existsSync(_0x534221)&&mkdirSync(_0x534221,{'recursive':!![],'mode':0x1c0});let _0x17527f={};if(existsSync(_0x5a94d2))try{const _0x352d9a=readFileSync(_0x5a94d2,_0x27a337(0x119));_0x17527f=parseEnvFile(_0x352d9a);}catch(_0x77d532){console[_0x27a337(0xe0)](_0x27a337(0xe3)+_0x5a94d2+':',_0x77d532);}const _0x33ef4e=_0x45569d[_0x27a337(0x116)]()[_0x27a337(0x113)](/-/g,'_');_0x17527f['TD_API_KEY_'+_0x33ef4e]=_0x309cdc;const _0x555e5a=Object[_0x27a337(0x10a)](_0x17527f)['map'](([_0x2a01fc,_0xcc149])=>_0x2a01fc+'='+_0xcc149);writeFileSync(_0x5a94d2,_0x555e5a[_0x27a337(0xee)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x56ae71,_0x5e9b53,_0x29cf07){await saveKeychainAPIKey(_0x56ae71,_0x29cf07),setCachedCredential(_0x56ae71,_0x5e9b53,_0x29cf07);const _0x1e3598=getConfigFilePath(_0x29cf07);cleanupLegacyEnvFile(_0x1e3598)&&console['warn'](a46_0x5260c2['yellow']('⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file'));}export function loadConfig(){const _0x5d1554=a46_0x1a85,_0x2cb514={'apiKeys':{},'defaultSite':_0x5d1554(0x111)},_0x593eb4=[_0x5d1554(0x111),'jp01',_0x5d1554(0x10f),_0x5d1554(0xeb),_0x5d1554(0x112),'dev-us01',_0x5d1554(0x101),_0x5d1554(0x104),_0x5d1554(0x12e),_0x5d1554(0x120)];for(const _0x4d2d10 of _0x593eb4){const _0x1743d8=getAPIKey(_0x4d2d10);_0x1743d8&&(_0x2cb514[_0x5d1554(0xe6)][_0x4d2d10]=_0x1743d8);}return _0x2cb514;}
@@ -1 +1 @@
1
- (function(_0xe9d3e3,_0x4c0163){const _0x20bbb7=a47_0x1574,_0x9bc1d8=_0xe9d3e3();while(!![]){try{const _0x2c746b=-parseInt(_0x20bbb7(0xa9))/0x1+-parseInt(_0x20bbb7(0xb0))/0x2+-parseInt(_0x20bbb7(0xb9))/0x3*(-parseInt(_0x20bbb7(0xa8))/0x4)+-parseInt(_0x20bbb7(0xb5))/0x5*(parseInt(_0x20bbb7(0xb8))/0x6)+-parseInt(_0x20bbb7(0xad))/0x7*(-parseInt(_0x20bbb7(0xae))/0x8)+parseInt(_0x20bbb7(0xb1))/0x9+parseInt(_0x20bbb7(0xaf))/0xa*(parseInt(_0x20bbb7(0xb3))/0xb);if(_0x2c746b===_0x4c0163)break;else _0x9bc1d8['push'](_0x9bc1d8['shift']());}catch(_0x11cf7b){_0x9bc1d8['push'](_0x9bc1d8['shift']());}}}(a47_0x3dfd,0x5a35b));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';import{getCacheDir}from'./config.js';function getCacheFilePath(_0x3b7bb3){const _0x3e0787=a47_0x1574,_0x49c65c=_0x3b7bb3||_0x3e0787(0xac);return join(getCacheDir(),_0x3e0787(0xb6)+_0x49c65c+_0x3e0787(0xb7));}function a47_0x3dfd(){const _0x25f1df=['connections-','.json','6LHZBYG','36xAikel','136060HgMFli','675547NkXnGI','now','utf-8','default','47474bbmpke','808VwtnxG','10bQYkNW','323908YRjNiq','385947AfcDGM','parse','2501136PrMNGM','stringify','782105sHvTjn'];a47_0x3dfd=function(){return _0x25f1df;};return a47_0x3dfd();}export function loadCachedConnections(_0x535154){const _0x1ad7cf=a47_0x1574,_0x30048c=getCacheFilePath(_0x535154);if(!existsSync(_0x30048c))return null;try{const _0x3b293c=readFileSync(_0x30048c,_0x1ad7cf(0xab)),_0x1d3c0c=JSON[_0x1ad7cf(0xb2)](_0x3b293c);return _0x1d3c0c['connections'];}catch{return null;}}function a47_0x1574(_0x1e9fae,_0x2443b9){_0x1e9fae=_0x1e9fae-0xa8;const _0x3dfda7=a47_0x3dfd();let _0x1574ee=_0x3dfda7[_0x1e9fae];return _0x1574ee;}export function saveCachedConnections(_0x47cda0,_0x570f4e){const _0x50db98=a47_0x1574,_0x14e5bc=getCacheDir();!existsSync(_0x14e5bc)&&mkdirSync(_0x14e5bc,{'recursive':!![]});const _0x4bda62=getCacheFilePath(_0x47cda0),_0x3813bd={'connections':_0x570f4e,'cachedAt':Date[_0x50db98(0xaa)]()};writeFileSync(_0x4bda62,JSON[_0x50db98(0xb4)](_0x3813bd,null,0x2),_0x50db98(0xab));}export function clearConnectionCache(_0xe14baa){const _0x1c258b=getCacheFilePath(_0xe14baa);if(existsSync(_0x1c258b))try{unlinkSync(_0x1c258b);}catch{}}
1
+ (function(_0x2af3dd,_0x542f46){const _0x1ab041=a47_0x2291,_0x5ce68c=_0x2af3dd();while(!![]){try{const _0xeb068=-parseInt(_0x1ab041(0x14c))/0x1+-parseInt(_0x1ab041(0x14a))/0x2+-parseInt(_0x1ab041(0x14b))/0x3+parseInt(_0x1ab041(0x14f))/0x4+-parseInt(_0x1ab041(0x151))/0x5+-parseInt(_0x1ab041(0x150))/0x6+parseInt(_0x1ab041(0x14d))/0x7;if(_0xeb068===_0x542f46)break;else _0x5ce68c['push'](_0x5ce68c['shift']());}catch(_0x3c8517){_0x5ce68c['push'](_0x5ce68c['shift']());}}}(a47_0x4f7b,0x36137));function a47_0x2291(_0x55e171,_0x502e1a){_0x55e171=_0x55e171-0x14a;const _0x4f7b34=a47_0x4f7b();let _0x229137=_0x4f7b34[_0x55e171];return _0x229137;}import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';import{getCacheDir}from'./config.js';function a47_0x4f7b(){const _0x3f26be=['now','stringify','368276zBNFTZ','21069DjgjXd','348651YmXwCX','7470491NTfonm','connections-','315424CWeVBv','1846134WAFgGp','385365gPJqMf'];a47_0x4f7b=function(){return _0x3f26be;};return a47_0x4f7b();}function getCacheFilePath(_0x47a38a){const _0x4273e2=a47_0x2291,_0x35b64b=_0x47a38a||'default';return join(getCacheDir(),_0x4273e2(0x14e)+_0x35b64b+'.json');}export function loadCachedConnections(_0x3d763a){const _0x3f16af=getCacheFilePath(_0x3d763a);if(!existsSync(_0x3f16af))return null;try{const _0x53ddd7=readFileSync(_0x3f16af,'utf-8'),_0x506ae9=JSON['parse'](_0x53ddd7);return _0x506ae9['connections'];}catch{return null;}}export function saveCachedConnections(_0x4dfff5,_0x2895c5){const _0x262e70=a47_0x2291,_0x376f62=getCacheDir();!existsSync(_0x376f62)&&mkdirSync(_0x376f62,{'recursive':!![]});const _0x3cb952=getCacheFilePath(_0x4dfff5),_0x421976={'connections':_0x2895c5,'cachedAt':Date[_0x262e70(0x152)]()};writeFileSync(_0x3cb952,JSON[_0x262e70(0x153)](_0x421976,null,0x2),'utf-8');}export function clearConnectionCache(_0x59752c){const _0x532842=getCacheFilePath(_0x59752c);if(existsSync(_0x532842))try{unlinkSync(_0x532842);}catch{}}
@@ -1 +1 @@
1
- function a48_0x2f15(){const _0x201e25=['894DhZfSH','11428835mIisOn','2273898fnBgrG','4807445jgzTJb','8730zqvSQL','now','1190DVXNce','3933BrsvFJ','set','get','8SQhzPy','33yEidIt','__default_site__','12676vHLrcE','apiKey','__default_profile__','loadedAt','clear','delete','90461ysTuBY'];a48_0x2f15=function(){return _0x201e25;};return a48_0x2f15();}(function(_0x495c0b,_0x433950){const _0x3b5ef9=a48_0x56ba,_0xd6758b=_0x495c0b();while(!![]){try{const _0x207ca2=-parseInt(_0x3b5ef9(0xd7))/0x1*(-parseInt(_0x3b5ef9(0xdd))/0x2)+-parseInt(_0x3b5ef9(0xe2))/0x3*(-parseInt(_0x3b5ef9(0xd0))/0x4)+-parseInt(_0x3b5ef9(0xda))/0x5+parseInt(_0x3b5ef9(0xd9))/0x6+-parseInt(_0x3b5ef9(0xd6))/0x7*(parseInt(_0x3b5ef9(0xe1))/0x8)+-parseInt(_0x3b5ef9(0xde))/0x9*(parseInt(_0x3b5ef9(0xdb))/0xa)+parseInt(_0x3b5ef9(0xd8))/0xb;if(_0x207ca2===_0x433950)break;else _0xd6758b['push'](_0xd6758b['shift']());}catch(_0x45da7a){_0xd6758b['push'](_0xd6758b['shift']());}}}(a48_0x2f15,0x9986c));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x158e8f,_0x168947){const _0x3bd554=a48_0x56ba,_0x1ccd27=_0x158e8f||_0x3bd554(0xe3),_0x5df7b0=_0x168947||_0x3bd554(0xd2);return _0x1ccd27+':'+_0x5df7b0;}export function getCachedCredential(_0x9f79ad,_0x454d71){const _0x572e00=a48_0x56ba,_0x40de79=getCacheKey(_0x9f79ad,_0x454d71),_0xaa42de=cache[_0x572e00(0xe0)](_0x40de79);if(!_0xaa42de)return null;if(Date['now']()-_0xaa42de[_0x572e00(0xd3)]>CACHE_TTL_MS)return cache[_0x572e00(0xd5)](_0x40de79),null;return _0xaa42de[_0x572e00(0xd1)];}export function setCachedCredential(_0x470db1,_0x107169,_0x2aa609){const _0x497066=a48_0x56ba,_0x3c2bcb=getCacheKey(_0x107169,_0x2aa609);cache[_0x497066(0xdf)](_0x3c2bcb,{'apiKey':_0x470db1,'loadedAt':Date[_0x497066(0xdc)]()});}export function clearCredentialCache(){const _0x1f289b=a48_0x56ba;cache[_0x1f289b(0xd4)]();}function a48_0x56ba(_0x313f00,_0x1f95f3){_0x313f00=_0x313f00-0xd0;const _0x2f15db=a48_0x2f15();let _0x56ba9c=_0x2f15db[_0x313f00];return _0x56ba9c;}export function clearCachedCredential(_0x11d938,_0x4a2314){const _0x42b9f3=getCacheKey(_0x11d938,_0x4a2314);cache['delete'](_0x42b9f3);}
1
+ (function(_0x4cc95e,_0x49c458){const _0x340c5f=a48_0xf135,_0x660386=_0x4cc95e();while(!![]){try{const _0x36d8e7=-parseInt(_0x340c5f(0x1cc))/0x1+-parseInt(_0x340c5f(0x1c7))/0x2*(-parseInt(_0x340c5f(0x1cf))/0x3)+parseInt(_0x340c5f(0x1ca))/0x4*(-parseInt(_0x340c5f(0x1d6))/0x5)+-parseInt(_0x340c5f(0x1d1))/0x6+parseInt(_0x340c5f(0x1d0))/0x7*(-parseInt(_0x340c5f(0x1c8))/0x8)+parseInt(_0x340c5f(0x1ce))/0x9*(parseInt(_0x340c5f(0x1d2))/0xa)+parseInt(_0x340c5f(0x1d5))/0xb;if(_0x36d8e7===_0x49c458)break;else _0x660386['push'](_0x660386['shift']());}catch(_0x4c2f2e){_0x660386['push'](_0x660386['shift']());}}}(a48_0x3f12,0x8eccb));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x58863a,_0x437600){const _0x21d191=a48_0xf135,_0x3f2f83=_0x58863a||_0x21d191(0x1cd),_0x5b07a3=_0x437600||_0x21d191(0x1c6);return _0x3f2f83+':'+_0x5b07a3;}export function getCachedCredential(_0x3ffc39,_0x30e9c4){const _0x1e3eb7=a48_0xf135,_0x549ae3=getCacheKey(_0x3ffc39,_0x30e9c4),_0x352262=cache[_0x1e3eb7(0x1d3)](_0x549ae3);if(!_0x352262)return null;if(Date['now']()-_0x352262[_0x1e3eb7(0x1c3)]>CACHE_TTL_MS)return cache[_0x1e3eb7(0x1c5)](_0x549ae3),null;return _0x352262[_0x1e3eb7(0x1d4)];}function a48_0x3f12(){const _0x1caf74=['__default_profile__','135762Xwerqz','296SBbOZn','set','132FLlGfA','now','614253QSoCyA','__default_site__','36189qeanVe','30TjNpPd','2989gaMaoU','1041066pVPSYj','50WuhPzI','get','apiKey','18393793NlICGC','148880sxXcoL','loadedAt','clear','delete'];a48_0x3f12=function(){return _0x1caf74;};return a48_0x3f12();}export function setCachedCredential(_0x25fec0,_0x423a5b,_0x57f2df){const _0x4c4ded=a48_0xf135,_0x45c4e7=getCacheKey(_0x423a5b,_0x57f2df);cache[_0x4c4ded(0x1c9)](_0x45c4e7,{'apiKey':_0x25fec0,'loadedAt':Date[_0x4c4ded(0x1cb)]()});}function a48_0xf135(_0x30a1e2,_0x15de77){_0x30a1e2=_0x30a1e2-0x1c3;const _0x3f12e9=a48_0x3f12();let _0xf135=_0x3f12e9[_0x30a1e2];return _0xf135;}export function clearCredentialCache(){const _0x31cf98=a48_0xf135;cache[_0x31cf98(0x1c4)]();}export function clearCachedCredential(_0x7c67dd,_0x2ca385){const _0x381b49=a48_0xf135,_0x41424b=getCacheKey(_0x7c67dd,_0x2ca385);cache[_0x381b49(0x1c5)](_0x41424b);}
@@ -1 +1 @@
1
- const a49_0x50363a=a49_0x1d74;(function(_0x4ef9bf,_0x4a2428){const _0x5ab585=a49_0x1d74,_0x5bffc8=_0x4ef9bf();while(!![]){try{const _0x5ae1c9=parseInt(_0x5ab585(0x18f))/0x1+-parseInt(_0x5ab585(0x1b2))/0x2*(-parseInt(_0x5ab585(0x1a3))/0x3)+-parseInt(_0x5ab585(0x18d))/0x4*(parseInt(_0x5ab585(0x1b5))/0x5)+-parseInt(_0x5ab585(0x18c))/0x6+-parseInt(_0x5ab585(0x18a))/0x7+-parseInt(_0x5ab585(0x190))/0x8*(-parseInt(_0x5ab585(0x1c3))/0x9)+parseInt(_0x5ab585(0x18b))/0xa;if(_0x5ae1c9===_0x4a2428)break;else _0x5bffc8['push'](_0x5bffc8['shift']());}catch(_0x32fe32){_0x5bffc8['push'](_0x5bffc8['shift']());}}}(a49_0x37af,0x4212e));import{resolveSite,getAPIKey,getAPIKeyAsync,getConfigDir}from'./config.js';function a49_0x1d74(_0xa42ea3,_0x1227e5){_0xa42ea3=_0xa42ea3-0x181;const _0x37af9e=a49_0x37af();let _0x1d7402=_0x37af9e[_0xa42ea3];return _0x1d7402;}import{loadSessionContext,getCurrentSessionPID}from'./session.js';function a49_0x37af(){const _0x7b600=['site','default','apiKey','utf-8','829983gGekQC','3206780ulhmOY','2401788procNL','65672ghQcoQ','config','20891TkzdEl','371264teFKBY','Profile\x20Credentials','[context]','llm_agent','project','displayWithSources','CLI\x20flag:\x20--','loadGlobalConfig','Global\x20Credentials','display','.json','parentSegment','globalCredentials','verbose','sessionId','readFileSync','profile','.env','llm_project','8274oShpDw','\x0a[configuration\x20files]',':\x20none','tdx.json','llmAgent','createAsync','layers','replace','injectIntoOptions','profileCredentials','segment_path','activeProfile','profile:\x20','log','llmProject','288kpStCo','segmentPath','Global','140JzoUfm','(session:\x20','Project','(active)','parent_segment','us01','cliFlags','configFiles','join','resolveAPIKeyAsync','parse','existsSync','session','getSource','99ylADmj','database','sessions',':\x20none\x20(using\x20session:\x20','global','string','getParameters','logLevel','profiles'];a49_0x37af=function(){return _0x7b600;};return a49_0x37af();}import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';import{getActiveProfile,loadProfile}from'./profile.js';import{LogLevel}from'../utils/tdx-logger.js';import*as a49_0x43804 from'node:fs';import*as a49_0x492958 from'node:path';export class GlobalContext{[a49_0x50363a(0x186)];[a49_0x50363a(0x1c4)];[a49_0x50363a(0x1b9)];['segment_path'];[a49_0x50363a(0x1a2)];[a49_0x50363a(0x193)];[a49_0x50363a(0x188)];[a49_0x50363a(0x19d)];['logLevel'];[a49_0x50363a(0x1a0)];[a49_0x50363a(0x1a9)];['activeProfile'];[a49_0x50363a(0x19e)];['configFiles'];constructor(_0xbd8015){const _0x41190b=a49_0x50363a;this['sessionId']=_0xbd8015[_0x41190b(0x1c1)]||getCurrentSessionPID()['toString']();const _0x47cce8=loadSessionContext(_0xbd8015['session']),_0x291291=loadProjectConfig(),_0x53523f=this[_0x41190b(0x197)]();this[_0x41190b(0x1ae)]=_0xbd8015[_0x41190b(0x1a0)]||_0x47cce8?.[_0x41190b(0x1a0)]||_0x53523f[_0x41190b(0x1a0)]||getActiveProfile();const _0x50923a=this[_0x41190b(0x1ae)]?loadProfile(this['activeProfile']):null,_0x384d01=_0x45f907=>{const _0x252b88=_0x41190b;if(!_0x45f907)return{};const _0x5db94=_0x45f907,_0x1d1e66={};for(const [_0xf7d842,_0x406aa4]of Object['entries'](_0x5db94)){typeof _0x406aa4===_0x252b88(0x182)&&(_0x1d1e66[_0xf7d842]=_0x406aa4);}return _0x1d1e66;},_0x279d7c={};if(_0xbd8015[_0x41190b(0x186)]&&_0xbd8015['site']!=='us01')_0x279d7c[_0x41190b(0x186)]=_0xbd8015[_0x41190b(0x186)];const _0x35bacb=_0x47cce8?.['database'],_0x5a9be1=_0x291291?.[_0x41190b(0x1c4)],_0x4916d3=_0x50923a?.[_0x41190b(0x18e)]?.[_0x41190b(0x1c4)],_0x38f8af=_0x53523f['database'];_0xbd8015[_0x41190b(0x1c4)]&&(_0xbd8015['database']!==_0x35bacb&&_0xbd8015[_0x41190b(0x1c4)]!==_0x5a9be1&&_0xbd8015[_0x41190b(0x1c4)]!==_0x4916d3&&_0xbd8015[_0x41190b(0x1c4)]!==_0x38f8af)&&(_0x279d7c[_0x41190b(0x1c4)]=_0xbd8015[_0x41190b(0x1c4)]);if(_0xbd8015[_0x41190b(0x19b)])_0x279d7c[_0x41190b(0x1b9)]=_0xbd8015[_0x41190b(0x19b)];if(_0xbd8015[_0x41190b(0x1b1)])_0x279d7c[_0x41190b(0x1a2)]=_0xbd8015[_0x41190b(0x1b1)];if(_0xbd8015[_0x41190b(0x1a7)])_0x279d7c[_0x41190b(0x193)]=_0xbd8015['llmAgent'];if(_0xbd8015[_0x41190b(0x1a0)])_0x279d7c[_0x41190b(0x1a0)]=_0xbd8015['profile'];this['layers']={'cliFlags':_0x279d7c,'session':_0x384d01(_0x47cce8),'project':_0x384d01(_0x291291),'profile':_0x384d01(_0x50923a?.[_0x41190b(0x18e)]),'global':_0x384d01(_0x53523f)};const _0x4b51a9={...this[_0x41190b(0x1a9)][_0x41190b(0x181)],...this['layers'][_0x41190b(0x1a0)],...this[_0x41190b(0x1a9)]['project'],...this[_0x41190b(0x1a9)][_0x41190b(0x1c1)],...this['layers']['cliFlags']},_0x4c1a61=_0x4b51a9['site']||_0x41190b(0x1ba);this[_0x41190b(0x186)]=resolveSite(_0x4c1a61),this[_0x41190b(0x1c4)]=_0x4b51a9[_0x41190b(0x1c4)],this['parent_segment']=_0x4b51a9[_0x41190b(0x1b9)],this[_0x41190b(0x1ad)]=_0x4b51a9[_0x41190b(0x1ad)],this[_0x41190b(0x1a2)]=_0x4b51a9[_0x41190b(0x1a2)],this['llm_agent']=_0x4b51a9[_0x41190b(0x193)],this[_0x41190b(0x19d)]=_0xbd8015[_0x41190b(0x19d)]||![],this['logLevel']=_0xbd8015[_0x41190b(0x184)]??LogLevel['INFO'],this[_0x41190b(0x1a0)]=this[_0x41190b(0x1ae)]||undefined,this['apiKey']=getAPIKey(this[_0x41190b(0x186)],this[_0x41190b(0x1ae)]||undefined);const _0x5263d7=getConfigDir(),_0x15d377=a49_0x492958['join'](_0x5263d7,_0x41190b(0x1c5),this[_0x41190b(0x19e)]+_0x41190b(0x19a)),_0x1caa42=findProjectConfigPath(),_0x4921c1=a49_0x492958[_0x41190b(0x1bd)](_0x5263d7,'tdx.json'),_0x5c88b0=a49_0x492958['join'](_0x5263d7,_0x41190b(0x1a1));let _0x265b62=null,_0x3da0a0=null;this[_0x41190b(0x1ae)]&&(_0x265b62=a49_0x492958[_0x41190b(0x1bd)](_0x5263d7,'profiles',this[_0x41190b(0x1ae)],_0x41190b(0x1a6)),_0x3da0a0=a49_0x492958[_0x41190b(0x1bd)](_0x5263d7,_0x41190b(0x185),this[_0x41190b(0x1ae)],_0x41190b(0x1a1))),this[_0x41190b(0x1bc)]={'session':a49_0x43804[_0x41190b(0x1c0)](_0x15d377)?_0x15d377:null,'project':_0x1caa42,'profile':_0x265b62&&a49_0x43804[_0x41190b(0x1c0)](_0x265b62)?_0x265b62:null,'profileCredentials':_0x3da0a0&&a49_0x43804[_0x41190b(0x1c0)](_0x3da0a0)?_0x3da0a0:null,'global':a49_0x43804['existsSync'](_0x4921c1)?_0x4921c1:null,'globalCredentials':a49_0x43804[_0x41190b(0x1c0)](_0x5c88b0)?_0x5c88b0:null};}[a49_0x50363a(0x1c2)](_0x4a0420,_0x29b9b9){const _0x660e0d=a49_0x50363a;if(!_0x29b9b9)return'not\x20set';const _0x1d70fb=_0x29b9b9;if(this['layers'][_0x660e0d(0x1bb)][_0x4a0420]===_0x1d70fb){if(_0x4a0420==='site'&&_0x1d70fb===_0x660e0d(0x1ba)&&!this[_0x660e0d(0x1a9)][_0x660e0d(0x1c1)][_0x660e0d(0x186)]&&!this['layers'][_0x660e0d(0x194)]['site']&&!this['layers'][_0x660e0d(0x1a0)]['site']&&!this[_0x660e0d(0x1a9)]['global']['site'])return _0x660e0d(0x187);return _0x660e0d(0x196)+_0x4a0420[_0x660e0d(0x1aa)](/_/g,'-');}if(this[_0x660e0d(0x1a9)][_0x660e0d(0x1c1)][_0x4a0420]===_0x1d70fb)return _0x660e0d(0x1c1);if(this['layers'][_0x660e0d(0x194)][_0x4a0420]===_0x1d70fb)return _0x660e0d(0x194);if(this[_0x660e0d(0x1a9)]['profile'][_0x4a0420]===_0x1d70fb)return _0x660e0d(0x1af)+this[_0x660e0d(0x1ae)];if(this[_0x660e0d(0x1a9)][_0x660e0d(0x181)][_0x4a0420]===_0x1d70fb)return _0x660e0d(0x181);return _0x660e0d(0x187);}['loadGlobalConfig'](){const _0x56cc30=a49_0x50363a,_0xbf5c5e=a49_0x492958['join'](getConfigDir(),_0x56cc30(0x1a6));if(!a49_0x43804[_0x56cc30(0x1c0)](_0xbf5c5e))return{};try{const _0x3f18ad=a49_0x43804[_0x56cc30(0x19f)](_0xbf5c5e,_0x56cc30(0x189));return JSON[_0x56cc30(0x1bf)](_0x3f18ad);}catch{return{};}}[a49_0x50363a(0x1ab)](_0x32823b){const _0x4107a8=a49_0x50363a;_0x32823b[_0x4107a8(0x186)]=this[_0x4107a8(0x186)],!_0x32823b['database']&&this[_0x4107a8(0x1c4)]&&(_0x32823b[_0x4107a8(0x1c4)]=this[_0x4107a8(0x1c4)]),!_0x32823b[_0x4107a8(0x19b)]&&this[_0x4107a8(0x1b9)]&&(_0x32823b[_0x4107a8(0x19b)]=this[_0x4107a8(0x1b9)]),!_0x32823b[_0x4107a8(0x1b3)]&&this[_0x4107a8(0x1ad)]&&(_0x32823b['segmentPath']=this['segment_path']),!_0x32823b['llmProject']&&this[_0x4107a8(0x1a2)]&&(_0x32823b[_0x4107a8(0x1b1)]=this[_0x4107a8(0x1a2)]),!_0x32823b[_0x4107a8(0x1a7)]&&this['llm_agent']&&(_0x32823b[_0x4107a8(0x1a7)]=this[_0x4107a8(0x193)]);}[a49_0x50363a(0x183)](){const _0x4e5384=a49_0x50363a;return[{'key':_0x4e5384(0x186),'value':this[_0x4e5384(0x186)]},{'key':_0x4e5384(0x1c4),'value':this[_0x4e5384(0x1c4)]},{'key':'parent_segment','value':this[_0x4e5384(0x1b9)]},{'key':_0x4e5384(0x1ad),'value':this[_0x4e5384(0x1ad)]},{'key':_0x4e5384(0x1a2),'value':this['llm_project']},{'key':'llm_agent','value':this['llm_agent']},{'key':_0x4e5384(0x1a0),'value':this[_0x4e5384(0x1ae)]||undefined}];}[a49_0x50363a(0x199)](){const _0x36d410=a49_0x50363a;console[_0x36d410(0x1b0)](_0x36d410(0x192));for(const {key:_0x3dc13d,value:_0x39874a}of this['getParameters']()){_0x39874a&&console[_0x36d410(0x1b0)](_0x3dc13d+':\x20'+_0x39874a);}}[a49_0x50363a(0x195)](){const _0xe91270=a49_0x50363a;console[_0xe91270(0x1b0)](_0xe91270(0x192));for(const {key:_0x4ea6c5,value:_0x73c2dc}of this[_0xe91270(0x183)]()){if(_0x73c2dc){const _0x50f3dd=_0x4ea6c5===_0xe91270(0x1a0)?_0xe91270(0x1b8):'('+this[_0xe91270(0x1c2)](_0x4ea6c5,_0x73c2dc)+')';console[_0xe91270(0x1b0)](_0x4ea6c5+':\x20'+_0x73c2dc+'\x20'+_0x50f3dd);}}console['log'](_0xe91270(0x1a4));const _0x6280b6=[{'label':'Session','path':this[_0xe91270(0x1bc)][_0xe91270(0x1c1)],'extra':_0xe91270(0x1b6)+this[_0xe91270(0x19e)]+')'},{'label':_0xe91270(0x1b7),'path':this['configFiles'][_0xe91270(0x194)]},{'label':'Profile','path':this[_0xe91270(0x1bc)][_0xe91270(0x1a0)]},{'label':_0xe91270(0x191),'path':this[_0xe91270(0x1bc)][_0xe91270(0x1ac)]},{'label':_0xe91270(0x1b4),'path':this[_0xe91270(0x1bc)][_0xe91270(0x181)]},{'label':_0xe91270(0x198),'path':this[_0xe91270(0x1bc)][_0xe91270(0x19c)]}];for(const {label:_0x1911e1,path:_0x5ce6ad,extra:_0x45bfdf}of _0x6280b6){if(_0x5ce6ad)console['log'](_0x1911e1+':\x20'+_0x5ce6ad+'\x20✓'+(_0x45bfdf?'\x20'+_0x45bfdf:''));else{if(_0x1911e1==='Session')console['log'](_0x1911e1+_0xe91270(0x1c6)+this['sessionId']+')');else(_0x1911e1===_0xe91270(0x1b7)||_0x1911e1===_0xe91270(0x1b4))&&console[_0xe91270(0x1b0)](_0x1911e1+_0xe91270(0x1a5));}}}async[a49_0x50363a(0x1be)](){const _0x4294e9=a49_0x50363a;return this[_0x4294e9(0x188)]=await getAPIKeyAsync(this[_0x4294e9(0x186)],this['activeProfile']||undefined),this[_0x4294e9(0x188)];}static async[a49_0x50363a(0x1a8)](_0x11650a){const _0x5e6e9e=a49_0x50363a,_0x961569=new GlobalContext(_0x11650a);return await _0x961569[_0x5e6e9e(0x1be)](),_0x961569;}}
1
+ function a49_0x1d89(){const _0x448cf2=['string','replace','configFiles','sessionId','llm_project','.env','tdx.json','config','resolveAPIKeyAsync','793532MOWxWl','profiles','CLI\x20flag:\x20--','parentSegment','getParameters','us01','existsSync','activeProfile','(session:\x20','layers','segment_path','\x0a[configuration\x20files]','51335889YBBrHq','join','not\x20set','createAsync','.json','segmentPath','Global\x20Credentials','project','1mMwhxo','toString','llm_agent','global','4701144owOvxL',':\x20none','apiKey','logLevel','Project','7255661CEsdao','parse','default','4500plKOpv','verbose','globalCredentials','parent_segment','profile:\x20','displayWithSources','getSource','log','18714KGLaLq','entries','llmProject','Profile','cliFlags',':\x20none\x20(using\x20session:\x20','Profile\x20Credentials','session','Session','database','profile','151630FjqZWL','370pMOueN','readFileSync','llmAgent','site','[context]','1383gnkKHv','738YLjmhv'];a49_0x1d89=function(){return _0x448cf2;};return a49_0x1d89();}const a49_0x5c4fa5=a49_0x3d4a;(function(_0x2fc0cc,_0x32d20e){const _0x38a9ad=a49_0x3d4a,_0x161156=_0x2fc0cc();while(!![]){try{const _0x34e92e=parseInt(_0x38a9ad(0xe4))/0x1*(-parseInt(_0x38a9ad(0xd0))/0x2)+-parseInt(_0x38a9ad(0xc5))/0x3*(parseInt(_0x38a9ad(0xf0))/0x4)+parseInt(_0x38a9ad(0x104))/0x5*(-parseInt(_0x38a9ad(0xf8))/0x6)+-parseInt(_0x38a9ad(0xed))/0x7+-parseInt(_0x38a9ad(0xe8))/0x8+parseInt(_0x38a9ad(0xc6))/0x9*(-parseInt(_0x38a9ad(0x103))/0xa)+parseInt(_0x38a9ad(0xdc))/0xb;if(_0x34e92e===_0x32d20e)break;else _0x161156['push'](_0x161156['shift']());}catch(_0xaf189e){_0x161156['push'](_0x161156['shift']());}}}(a49_0x1d89,0x9f772));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 a49_0x3f3261 from'node:fs';function a49_0x3d4a(_0xd59b6c,_0x703af4){_0xd59b6c=_0xd59b6c-0xc5;const _0x1d897e=a49_0x1d89();let _0x3d4a49=_0x1d897e[_0xd59b6c];return _0x3d4a49;}import*as a49_0x5dba86 from'node:path';export class GlobalContext{['site'];['database'];[a49_0x5c4fa5(0xf3)];[a49_0x5c4fa5(0xda)];[a49_0x5c4fa5(0xcb)];['llm_agent'];[a49_0x5c4fa5(0xea)];['verbose'];['logLevel'];[a49_0x5c4fa5(0x102)];['layers'];['activeProfile'];[a49_0x5c4fa5(0xca)];[a49_0x5c4fa5(0xc9)];constructor(_0x51bf34){const _0x17d245=a49_0x5c4fa5;this[_0x17d245(0xca)]=_0x51bf34[_0x17d245(0xff)]||getCurrentSessionPID()[_0x17d245(0xe5)]();const _0x51640b=loadSessionContext(_0x51bf34[_0x17d245(0xff)]),_0x19ea70=loadProjectConfig(),_0x38e5c7=this['loadGlobalConfig']();this['activeProfile']=_0x51bf34[_0x17d245(0x102)]||_0x51640b?.[_0x17d245(0x102)]||_0x38e5c7[_0x17d245(0x102)]||getActiveProfile();const _0x1e19e7=this[_0x17d245(0xd7)]?loadProfile(this['activeProfile']):null,_0x1547a3=_0x1e194b=>{const _0x1e8d72=_0x17d245;if(!_0x1e194b)return{};const _0x53c42c=_0x1e194b,_0x4f4fdf={};for(const [_0x57617e,_0x1cd6b5]of Object[_0x1e8d72(0xf9)](_0x53c42c)){typeof _0x1cd6b5===_0x1e8d72(0xc7)&&(_0x4f4fdf[_0x57617e]=_0x1cd6b5);}return _0x4f4fdf;},_0xc72888={};if(_0x51bf34[_0x17d245(0x107)]&&_0x51bf34[_0x17d245(0x107)]!==_0x17d245(0xd5))_0xc72888[_0x17d245(0x107)]=_0x51bf34['site'];const _0x4bf784=_0x51640b?.[_0x17d245(0x101)],_0x361fcc=_0x19ea70?.[_0x17d245(0x101)],_0x5995ca=_0x1e19e7?.[_0x17d245(0xce)]?.[_0x17d245(0x101)],_0x10841c=_0x38e5c7[_0x17d245(0x101)];_0x51bf34[_0x17d245(0x101)]&&(_0x51bf34[_0x17d245(0x101)]!==_0x4bf784&&_0x51bf34[_0x17d245(0x101)]!==_0x361fcc&&_0x51bf34[_0x17d245(0x101)]!==_0x5995ca&&_0x51bf34['database']!==_0x10841c)&&(_0xc72888[_0x17d245(0x101)]=_0x51bf34['database']);if(_0x51bf34[_0x17d245(0xd3)])_0xc72888['parent_segment']=_0x51bf34[_0x17d245(0xd3)];if(_0x51bf34['llmProject'])_0xc72888['llm_project']=_0x51bf34[_0x17d245(0xfa)];if(_0x51bf34[_0x17d245(0x106)])_0xc72888[_0x17d245(0xe6)]=_0x51bf34[_0x17d245(0x106)];if(_0x51bf34[_0x17d245(0x102)])_0xc72888['profile']=_0x51bf34['profile'];this['layers']={'cliFlags':_0xc72888,'session':_0x1547a3(_0x51640b),'project':_0x1547a3(_0x19ea70),'profile':_0x1547a3(_0x1e19e7?.[_0x17d245(0xce)]),'global':_0x1547a3(_0x38e5c7)};const _0x3366a8={...this['layers'][_0x17d245(0xe7)],...this[_0x17d245(0xd9)][_0x17d245(0x102)],...this['layers'][_0x17d245(0xe3)],...this[_0x17d245(0xd9)][_0x17d245(0xff)],...this[_0x17d245(0xd9)]['cliFlags']},_0x422c82=_0x3366a8[_0x17d245(0x107)]||_0x17d245(0xd5);this[_0x17d245(0x107)]=resolveSite(_0x422c82),this[_0x17d245(0x101)]=_0x3366a8[_0x17d245(0x101)],this[_0x17d245(0xf3)]=_0x3366a8['parent_segment'],this[_0x17d245(0xda)]=_0x3366a8[_0x17d245(0xda)],this['llm_project']=_0x3366a8['llm_project'],this[_0x17d245(0xe6)]=_0x3366a8[_0x17d245(0xe6)],this[_0x17d245(0xf1)]=_0x51bf34[_0x17d245(0xf1)]||![],this['logLevel']=_0x51bf34[_0x17d245(0xeb)]??LogLevel['INFO'],this[_0x17d245(0x102)]=this[_0x17d245(0xd7)]||undefined,this[_0x17d245(0xea)]=getAPIKey(this[_0x17d245(0x107)],this['activeProfile']||undefined);const _0x507942=getConfigDir(),_0x49c279=a49_0x5dba86[_0x17d245(0xdd)](_0x507942,'sessions',this[_0x17d245(0xca)]+_0x17d245(0xe0)),_0x542516=findProjectConfigPath(),_0x2a804b=a49_0x5dba86[_0x17d245(0xdd)](_0x507942,_0x17d245(0xcd)),_0x5d0a46=a49_0x5dba86[_0x17d245(0xdd)](_0x507942,_0x17d245(0xcc));let _0x31b9b1=null,_0x1d9143=null;this[_0x17d245(0xd7)]&&(_0x31b9b1=a49_0x5dba86[_0x17d245(0xdd)](_0x507942,_0x17d245(0xd1),this['activeProfile'],_0x17d245(0xcd)),_0x1d9143=a49_0x5dba86[_0x17d245(0xdd)](_0x507942,_0x17d245(0xd1),this['activeProfile'],_0x17d245(0xcc))),this['configFiles']={'session':a49_0x3f3261[_0x17d245(0xd6)](_0x49c279)?_0x49c279:null,'project':_0x542516,'profile':_0x31b9b1&&a49_0x3f3261[_0x17d245(0xd6)](_0x31b9b1)?_0x31b9b1:null,'profileCredentials':_0x1d9143&&a49_0x3f3261['existsSync'](_0x1d9143)?_0x1d9143:null,'global':a49_0x3f3261['existsSync'](_0x2a804b)?_0x2a804b:null,'globalCredentials':a49_0x3f3261[_0x17d245(0xd6)](_0x5d0a46)?_0x5d0a46:null};}['getSource'](_0x2481d5,_0x5e9a2a){const _0x260cc0=a49_0x5c4fa5;if(!_0x5e9a2a)return _0x260cc0(0xde);const _0x75abdc=_0x5e9a2a;if(this[_0x260cc0(0xd9)][_0x260cc0(0xfc)][_0x2481d5]===_0x75abdc){if(_0x2481d5===_0x260cc0(0x107)&&_0x75abdc===_0x260cc0(0xd5)&&!this[_0x260cc0(0xd9)]['session']['site']&&!this[_0x260cc0(0xd9)][_0x260cc0(0xe3)][_0x260cc0(0x107)]&&!this[_0x260cc0(0xd9)][_0x260cc0(0x102)][_0x260cc0(0x107)]&&!this[_0x260cc0(0xd9)][_0x260cc0(0xe7)][_0x260cc0(0x107)])return _0x260cc0(0xef);return _0x260cc0(0xd2)+_0x2481d5[_0x260cc0(0xc8)](/_/g,'-');}if(this['layers'][_0x260cc0(0xff)][_0x2481d5]===_0x75abdc)return'session';if(this[_0x260cc0(0xd9)][_0x260cc0(0xe3)][_0x2481d5]===_0x75abdc)return _0x260cc0(0xe3);if(this['layers'][_0x260cc0(0x102)][_0x2481d5]===_0x75abdc)return _0x260cc0(0xf4)+this[_0x260cc0(0xd7)];if(this['layers'][_0x260cc0(0xe7)][_0x2481d5]===_0x75abdc)return _0x260cc0(0xe7);return _0x260cc0(0xef);}['loadGlobalConfig'](){const _0x284379=a49_0x5c4fa5,_0x6ece72=a49_0x5dba86[_0x284379(0xdd)](getConfigDir(),'tdx.json');if(!a49_0x3f3261['existsSync'](_0x6ece72))return{};try{const _0x285a66=a49_0x3f3261[_0x284379(0x105)](_0x6ece72,'utf-8');return JSON[_0x284379(0xee)](_0x285a66);}catch{return{};}}['injectIntoOptions'](_0x549818){const _0x4de05c=a49_0x5c4fa5;_0x549818[_0x4de05c(0x107)]=this[_0x4de05c(0x107)],!_0x549818[_0x4de05c(0x101)]&&this[_0x4de05c(0x101)]&&(_0x549818[_0x4de05c(0x101)]=this['database']),!_0x549818[_0x4de05c(0xd3)]&&this[_0x4de05c(0xf3)]&&(_0x549818[_0x4de05c(0xd3)]=this[_0x4de05c(0xf3)]),!_0x549818[_0x4de05c(0xe1)]&&this[_0x4de05c(0xda)]&&(_0x549818[_0x4de05c(0xe1)]=this['segment_path']),!_0x549818[_0x4de05c(0xfa)]&&this[_0x4de05c(0xcb)]&&(_0x549818[_0x4de05c(0xfa)]=this[_0x4de05c(0xcb)]),!_0x549818[_0x4de05c(0x106)]&&this[_0x4de05c(0xe6)]&&(_0x549818[_0x4de05c(0x106)]=this[_0x4de05c(0xe6)]);}[a49_0x5c4fa5(0xd4)](){const _0x563241=a49_0x5c4fa5;return[{'key':_0x563241(0x107),'value':this[_0x563241(0x107)]},{'key':'database','value':this[_0x563241(0x101)]},{'key':_0x563241(0xf3),'value':this['parent_segment']},{'key':_0x563241(0xda),'value':this['segment_path']},{'key':_0x563241(0xcb),'value':this[_0x563241(0xcb)]},{'key':_0x563241(0xe6),'value':this[_0x563241(0xe6)]},{'key':_0x563241(0x102),'value':this['activeProfile']||undefined}];}['display'](){const _0x4eb5bc=a49_0x5c4fa5;console[_0x4eb5bc(0xf7)](_0x4eb5bc(0x108));for(const {key:_0xc1f70b,value:_0x23ae0a}of this[_0x4eb5bc(0xd4)]()){_0x23ae0a&&console[_0x4eb5bc(0xf7)](_0xc1f70b+':\x20'+_0x23ae0a);}}[a49_0x5c4fa5(0xf5)](){const _0x528f22=a49_0x5c4fa5;console[_0x528f22(0xf7)](_0x528f22(0x108));for(const {key:_0xb9fdb5,value:_0xd915d7}of this['getParameters']()){if(_0xd915d7){const _0x3132cc=_0xb9fdb5==='profile'?'(active)':'('+this[_0x528f22(0xf6)](_0xb9fdb5,_0xd915d7)+')';console[_0x528f22(0xf7)](_0xb9fdb5+':\x20'+_0xd915d7+'\x20'+_0x3132cc);}}console[_0x528f22(0xf7)](_0x528f22(0xdb));const _0x4e7a03=[{'label':_0x528f22(0x100),'path':this[_0x528f22(0xc9)][_0x528f22(0xff)],'extra':_0x528f22(0xd8)+this['sessionId']+')'},{'label':_0x528f22(0xec),'path':this[_0x528f22(0xc9)][_0x528f22(0xe3)]},{'label':_0x528f22(0xfb),'path':this[_0x528f22(0xc9)][_0x528f22(0x102)]},{'label':_0x528f22(0xfe),'path':this[_0x528f22(0xc9)]['profileCredentials']},{'label':'Global','path':this[_0x528f22(0xc9)]['global']},{'label':_0x528f22(0xe2),'path':this[_0x528f22(0xc9)][_0x528f22(0xf2)]}];for(const {label:_0x14d143,path:_0x11b3d7,extra:_0x2d9339}of _0x4e7a03){if(_0x11b3d7)console[_0x528f22(0xf7)](_0x14d143+':\x20'+_0x11b3d7+'\x20✓'+(_0x2d9339?'\x20'+_0x2d9339:''));else{if(_0x14d143==='Session')console[_0x528f22(0xf7)](_0x14d143+_0x528f22(0xfd)+this[_0x528f22(0xca)]+')');else(_0x14d143===_0x528f22(0xec)||_0x14d143==='Global')&&console[_0x528f22(0xf7)](_0x14d143+_0x528f22(0xe9));}}}async[a49_0x5c4fa5(0xcf)](){const _0x5ca14e=a49_0x5c4fa5;return this[_0x5ca14e(0xea)]=await getAPIKeyAsync(this[_0x5ca14e(0x107)],this['activeProfile']||undefined),this[_0x5ca14e(0xea)];}static async[a49_0x5c4fa5(0xdf)](_0x721c76){const _0x45afa7=new GlobalContext(_0x721c76);return await _0x45afa7['resolveAPIKeyAsync'](),_0x45afa7;}}
@@ -1 +1 @@
1
- const a50_0x32c86e=a50_0x2b6d;(function(_0x31fb2c,_0x4c8002){const _0xea4db9=a50_0x2b6d,_0x22839a=_0x31fb2c();while(!![]){try{const _0x831fdd=parseInt(_0xea4db9(0x213))/0x1+parseInt(_0xea4db9(0x207))/0x2+-parseInt(_0xea4db9(0x203))/0x3*(parseInt(_0xea4db9(0x204))/0x4)+-parseInt(_0xea4db9(0x20f))/0x5+parseInt(_0xea4db9(0x20b))/0x6+parseInt(_0xea4db9(0x208))/0x7*(parseInt(_0xea4db9(0x1fc))/0x8)+-parseInt(_0xea4db9(0x20d))/0x9;if(_0x831fdd===_0x4c8002)break;else _0x22839a['push'](_0x22839a['shift']());}catch(_0x3b5ce7){_0x22839a['push'](_0x22839a['shift']());}}}(a50_0x49de,0x3482e));const SERVICE_NAME=a50_0x32c86e(0x200);let keyringModule=null,keyringLoadError=null;async function getKeyring(){const _0x2ae3d3=a50_0x32c86e;if(keyringModule!==null)return keyringModule;if(keyringLoadError!==null)return null;try{const _0x44a67c=await import(_0x2ae3d3(0x1fe));return keyringModule=_0x44a67c[_0x2ae3d3(0x1f6)],keyringModule;}catch(_0x58a05f){return keyringLoadError=_0x58a05f instanceof Error?_0x58a05f:new Error(String(_0x58a05f)),null;}}function getAccountName(_0x3e544b){const _0x3e8a8f=a50_0x32c86e,_0x3a25ef=_0x3e544b||'';return _0x3e8a8f(0x1fb)+_0x3a25ef+_0x3e8a8f(0x20a);}export async function getKeychainAPIKey(_0x65dee7){const _0x2604cb=a50_0x32c86e,_0x25681a=await getKeychainAPIKeyWithStatus(_0x65dee7);if(_0x25681a[_0x2604cb(0x212)])return _0x25681a[_0x2604cb(0x206)];return _0x25681a['reason']===_0x2604cb(0x201)&&console[_0x2604cb(0x1fd)]('Warning:\x20'+_0x25681a[_0x2604cb(0x1f8)]),null;}function a50_0x2b6d(_0x2e93ae,_0x15ef89){_0x2e93ae=_0x2e93ae-0x1f3;const _0x49defd=a50_0x49de();let _0x2b6da1=_0x49defd[_0x2e93ae];return _0x2b6da1;}export async function getKeychainAPIKeyWithStatus(_0x2efd5f){const _0x1ff808=a50_0x32c86e;try{const _0x453f5e=await getKeyring();if(!_0x453f5e)return{'success':![],'reason':_0x1ff808(0x1fa)};const _0x39bf08=getAccountName(_0x2efd5f),_0x513a57=await _0x453f5e[_0x1ff808(0x205)](SERVICE_NAME,_0x39bf08);if(_0x513a57)return{'success':!![],'value':_0x513a57};return{'success':![],'reason':_0x1ff808(0x1f7)};}catch(_0x267b61){const _0x190999=_0x267b61 instanceof Error?_0x267b61['message']:String(_0x267b61);if(_0x190999[_0x1ff808(0x20c)](_0x1ff808(0x209))||_0x190999[_0x1ff808(0x1f4)]()[_0x1ff808(0x20c)](_0x1ff808(0x1f9))||_0x190999[_0x1ff808(0x1f4)]()[_0x1ff808(0x20c)](_0x1ff808(0x1ff)))return{'success':![],'reason':_0x1ff808(0x1f7)};if(_0x190999['includes'](_0x1ff808(0x1f5))||_0x190999[_0x1ff808(0x1f4)]()[_0x1ff808(0x20c)]('restricted')||_0x190999[_0x1ff808(0x1f4)]()[_0x1ff808(0x20c)](_0x1ff808(0x210)))return{'success':![],'reason':'access_denied','message':_0x1ff808(0x20e)};return{'success':![],'reason':_0x1ff808(0x1fa),'message':_0x190999};}}export async function saveKeychainAPIKey(_0x6a4287,_0xf1ada0){const _0x4d4667=a50_0x32c86e,_0x7836b6=await getKeyring();if(!_0x7836b6)throw new Error(_0x4d4667(0x211));const _0xcd2deb=getAccountName(_0xf1ada0);await _0x7836b6[_0x4d4667(0x1f3)](SERVICE_NAME,_0xcd2deb,_0x6a4287);}function a50_0x49de(){const _0x2af8cf=['247950kayfrY','setPassword','toLowerCase','-25293','keyring','not_found','message','could\x20not\x20be\x20found','unavailable','profile:','8AbYRJa','error','@zowe/secrets-for-zowe-sdk','not\x20found','tdx','access_denied','cannot\x20find','3PFQYmy','1282452KXIvxS','getPassword','value','364742HLumRD','768208cWrZqP','-25300',':api_key','2306562ENrxwn','includes','2897001dLMQsN','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.','334520vYrWpD','access','System\x20keychain\x20is\x20not\x20available','success'];a50_0x49de=function(){return _0x2af8cf;};return a50_0x49de();}export async function deleteKeychainAPIKey(_0x45b650){try{const _0x190911=await getKeyring();if(!_0x190911)return![];const _0x5e77a9=getAccountName(_0x45b650);return await _0x190911['deletePassword'](SERVICE_NAME,_0x5e77a9);}catch{return![];}}export async function isKeychainAvailable(){const _0x45089d=a50_0x32c86e;try{const _0x1c8632=await getKeyring();if(!_0x1c8632)return![];return await _0x1c8632[_0x45089d(0x205)](SERVICE_NAME,'__keychain_test__'),!![];}catch(_0x43deeb){const _0x2e07e5=_0x43deeb instanceof Error?_0x43deeb['message'][_0x45089d(0x1f4)]():'';if(_0x2e07e5[_0x45089d(0x20c)]('not\x20available')||_0x2e07e5['includes']('not\x20supported')||_0x2e07e5[_0x45089d(0x20c)](_0x45089d(0x202)))return![];return!![];}}
1
+ const a50_0xcfdb5a=a50_0x3ccc;(function(_0x564466,_0x2ea1af){const _0x15cd88=a50_0x3ccc,_0x5bdeb9=_0x564466();while(!![]){try{const _0xe8c34=-parseInt(_0x15cd88(0xd0))/0x1+parseInt(_0x15cd88(0xe3))/0x2+-parseInt(_0x15cd88(0xd7))/0x3+parseInt(_0x15cd88(0xe8))/0x4+-parseInt(_0x15cd88(0xe5))/0x5+parseInt(_0x15cd88(0xd3))/0x6+parseInt(_0x15cd88(0xdc))/0x7;if(_0xe8c34===_0x2ea1af)break;else _0x5bdeb9['push'](_0x5bdeb9['shift']());}catch(_0x541d37){_0x5bdeb9['push'](_0x5bdeb9['shift']());}}}(a50_0x3d33,0xa4bd8));const SERVICE_NAME=a50_0xcfdb5a(0xd9);let keyringModule=null,keyringLoadError=null;async function getKeyring(){const _0x25680e=a50_0xcfdb5a;if(keyringModule!==null)return keyringModule;if(keyringLoadError!==null)return null;try{const _0x2200d1=await import(_0x25680e(0xde));return keyringModule=_0x2200d1[_0x25680e(0xd8)],keyringModule;}catch(_0x3c945b){return keyringLoadError=_0x3c945b instanceof Error?_0x3c945b:new Error(String(_0x3c945b)),null;}}function getAccountName(_0x5d250b){const _0x30bd0f=a50_0xcfdb5a,_0x4f235f=_0x5d250b||'';return _0x30bd0f(0xdd)+_0x4f235f+_0x30bd0f(0xd2);}function a50_0x3ccc(_0xf29e2f,_0x3efd9b){_0xf29e2f=_0xf29e2f-0xca;const _0x3d335a=a50_0x3d33();let _0x3ccc2e=_0x3d335a[_0xf29e2f];return _0x3ccc2e;}export async function getKeychainAPIKey(_0x512c0d){const _0x55d235=a50_0xcfdb5a,_0x378fc2=await getKeychainAPIKeyWithStatus(_0x512c0d);if(_0x378fc2['success'])return _0x378fc2[_0x55d235(0xed)];return _0x378fc2[_0x55d235(0xcf)]===_0x55d235(0xe0)&&console[_0x55d235(0xcc)](_0x55d235(0xcb)+_0x378fc2[_0x55d235(0xec)]),null;}function a50_0x3d33(){const _0x197e09=['11339062YjrePv','profile:','@zowe/secrets-for-zowe-sdk','-25300','access_denied','not\x20supported','not\x20available','353318DXhKib','restricted','4701595RAzfwp','not_found','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.','2891520Ujsvdp','toLowerCase','could\x20not\x20be\x20found','cannot\x20find','message','value','-25293','Warning:\x20','error','System\x20keychain\x20is\x20not\x20available','deletePassword','reason','340216MoxbrA','includes',':api_key','4282098gckjwz','getPassword','__keychain_test__','unavailable','3833331IWPQeW','keyring','tdx','setPassword','not\x20found'];a50_0x3d33=function(){return _0x197e09;};return a50_0x3d33();}export async function getKeychainAPIKeyWithStatus(_0x5dab52){const _0x2229f3=a50_0xcfdb5a;try{const _0x5eae59=await getKeyring();if(!_0x5eae59)return{'success':![],'reason':_0x2229f3(0xd6)};const _0x2124ab=getAccountName(_0x5dab52),_0x62d65a=await _0x5eae59[_0x2229f3(0xd4)](SERVICE_NAME,_0x2124ab);if(_0x62d65a)return{'success':!![],'value':_0x62d65a};return{'success':![],'reason':_0x2229f3(0xe6)};}catch(_0x1bbc82){const _0x5de58f=_0x1bbc82 instanceof Error?_0x1bbc82[_0x2229f3(0xec)]:String(_0x1bbc82);if(_0x5de58f[_0x2229f3(0xd1)](_0x2229f3(0xdf))||_0x5de58f['toLowerCase']()[_0x2229f3(0xd1)](_0x2229f3(0xea))||_0x5de58f[_0x2229f3(0xe9)]()[_0x2229f3(0xd1)](_0x2229f3(0xdb)))return{'success':![],'reason':_0x2229f3(0xe6)};if(_0x5de58f[_0x2229f3(0xd1)](_0x2229f3(0xca))||_0x5de58f[_0x2229f3(0xe9)]()['includes'](_0x2229f3(0xe4))||_0x5de58f[_0x2229f3(0xe9)]()['includes']('access'))return{'success':![],'reason':_0x2229f3(0xe0),'message':_0x2229f3(0xe7)};return{'success':![],'reason':_0x2229f3(0xd6),'message':_0x5de58f};}}export async function saveKeychainAPIKey(_0x5e04bb,_0x59586e){const _0x224170=a50_0xcfdb5a,_0x17e0a7=await getKeyring();if(!_0x17e0a7)throw new Error(_0x224170(0xcd));const _0x2887e1=getAccountName(_0x59586e);await _0x17e0a7[_0x224170(0xda)](SERVICE_NAME,_0x2887e1,_0x5e04bb);}export async function deleteKeychainAPIKey(_0x2cea0f){const _0x4e2572=a50_0xcfdb5a;try{const _0x34114e=await getKeyring();if(!_0x34114e)return![];const _0x175355=getAccountName(_0x2cea0f);return await _0x34114e[_0x4e2572(0xce)](SERVICE_NAME,_0x175355);}catch{return![];}}export async function isKeychainAvailable(){const _0x3937ce=a50_0xcfdb5a;try{const _0x3c6599=await getKeyring();if(!_0x3c6599)return![];return await _0x3c6599[_0x3937ce(0xd4)](SERVICE_NAME,_0x3937ce(0xd5)),!![];}catch(_0x1d9477){const _0x4dd6e6=_0x1d9477 instanceof Error?_0x1d9477[_0x3937ce(0xec)][_0x3937ce(0xe9)]():'';if(_0x4dd6e6[_0x3937ce(0xd1)](_0x3937ce(0xe2))||_0x4dd6e6[_0x3937ce(0xd1)](_0x3937ce(0xe1))||_0x4dd6e6[_0x3937ce(0xd1)](_0x3937ce(0xeb)))return![];return!![];}}
@@ -1 +1 @@
1
- (function(_0x418104,_0x5dda4f){const _0x1fcf73=a51_0x2fd5,_0x378f45=_0x418104();while(!![]){try{const _0x3e280d=-parseInt(_0x1fcf73(0x20b))/0x1*(parseInt(_0x1fcf73(0x209))/0x2)+parseInt(_0x1fcf73(0x200))/0x3*(-parseInt(_0x1fcf73(0x205))/0x4)+-parseInt(_0x1fcf73(0x22d))/0x5*(parseInt(_0x1fcf73(0x20e))/0x6)+-parseInt(_0x1fcf73(0x238))/0x7*(-parseInt(_0x1fcf73(0x1fa))/0x8)+parseInt(_0x1fcf73(0x22a))/0x9+parseInt(_0x1fcf73(0x1fb))/0xa+parseInt(_0x1fcf73(0x215))/0xb;if(_0x3e280d===_0x5dda4f)break;else _0x378f45['push'](_0x378f45['shift']());}catch(_0x34bcce){_0x378f45['push'](_0x378f45['shift']());}}}(a51_0x271e,0x6dae6));import*as a51_0x5c4355 from'node:fs';import*as a51_0x1b793b from'node:path';import{getConfigDir}from'./config.js';import{createSecureDirectory,writeSecureFile}from'../utils/file-permissions.js';import{findProjectConfigPath}from'./project-config.js';import{loadSessionContext}from'./session.js';export function getProfileParams(_0x4c425a){const _0x255fd9=a51_0x2fd5,_0x262524={};if(!_0x4c425a)return _0x262524;for(const [_0x3c3c0e,_0x5438bf]of Object[_0x255fd9(0x236)](_0x4c425a)){_0x3c3c0e!==_0x255fd9(0x21d)&&_0x5438bf!==undefined&&(_0x262524[_0x3c3c0e]=_0x5438bf);}return _0x262524;}export function getProfilesDir(){return a51_0x1b793b['join'](getConfigDir(),'profiles');}function a51_0x2fd5(_0x1694da,_0x583dc5){_0x1694da=_0x1694da-0x1f0;const _0x271e07=a51_0x271e();let _0x2fd50c=_0x271e07[_0x1694da];return _0x2fd50c;}function getProfileDir(_0x3345a0){const _0x2435f5=a51_0x2fd5;return a51_0x1b793b[_0x2435f5(0x225)](getProfilesDir(),_0x3345a0);}function getProfileConfigPath(_0x4ab2fc){const _0x3d121b=a51_0x2fd5;return a51_0x1b793b[_0x3d121b(0x225)](getProfileDir(_0x4ab2fc),_0x3d121b(0x220));}function getProfileEnvPath(_0x5bf5bc){const _0x466684=a51_0x2fd5;return a51_0x1b793b[_0x466684(0x225)](getProfileDir(_0x5bf5bc),_0x466684(0x203));}function getGlobalConfigPath(){const _0x12f45b=a51_0x2fd5;return a51_0x1b793b[_0x12f45b(0x225)](getConfigDir(),_0x12f45b(0x220));}function validateProfileName(_0x2b1da8){const _0x2465b3=a51_0x2fd5;if(!/^[a-zA-Z0-9_-]+$/[_0x2465b3(0x1f7)](_0x2b1da8))throw new Error(_0x2465b3(0x20d)+_0x2b1da8+'.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore.');}function a51_0x271e(){const _0x2c05d9=['776855EDCsET','warn','parse','find','localeCompare','stringify','filter','Profile\x20\x27','utf-8','entries','llm_agent','22267bKIEVD','string','from','existsSync','profile','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','map','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','name','includes','rmSync','test','\x0aWarning:\x20Failed\x20to\x20parse\x20',':\x20Invalid\x20JSON\x20syntax','392wSiwWR','3541280esABKY','.env.','To\x20migrate:','readdirSync','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','180YzUXkN','\x20already\x20exists',',\x20creating\x20new\x20file','.env','profiles','30700SDIsEa','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','toISOString','\x27\x20will\x20be\x20ignored','1200674LJYIkM','readFileSync','1EUkuOg','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','Invalid\x20profile\x20name:\x20','6dNKnDv','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','has','Warning:\x20Failed\x20to\x20parse\x20','site','Profile\x20','directory','3218666ngaYED','message','push','length','sort','some','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','description','database','user','tdx.json','\x20\x20mv\x20\x22','\x20\x201.\x20Edit:\x20','\x20does\x20not\x20exist','object','join','keys','isDirectory','parent_segment','\x27:\x20config\x20must\x20be\x20an\x20object','7765731FgSrMP','llm_project','set'];a51_0x271e=function(){return _0x2c05d9;};return a51_0x271e();}function validateProfileConfig(_0x301759,_0x50ee4a){const _0x515207=a51_0x2fd5;if(typeof _0x301759!==_0x515207(0x224)||_0x301759===null)throw new Error(_0x515207(0x234)+_0x50ee4a+_0x515207(0x229));const _0x3d790b=['description',_0x515207(0x212),_0x515207(0x21e),'parent_segment','llm_project',_0x515207(0x237)],_0x2b56fe=_0x301759;for(const _0x481e9a of Object[_0x515207(0x226)](_0x2b56fe)){!_0x3d790b[_0x515207(0x1f5)](_0x481e9a)&&console['warn']('Warning:\x20Profile\x20\x27'+_0x50ee4a+'\x27:\x20unknown\x20config\x20key\x20\x27'+_0x481e9a+_0x515207(0x208));}if(_0x2b56fe[_0x515207(0x21d)]!==undefined&&typeof _0x2b56fe[_0x515207(0x21d)]!==_0x515207(0x239))throw new Error('Profile\x20\x27'+_0x50ee4a+_0x515207(0x206));if(_0x2b56fe[_0x515207(0x212)]!==undefined&&typeof _0x2b56fe[_0x515207(0x212)]!==_0x515207(0x239))throw new Error(_0x515207(0x234)+_0x50ee4a+_0x515207(0x21b));if(_0x2b56fe[_0x515207(0x21e)]!==undefined&&typeof _0x2b56fe[_0x515207(0x21e)]!=='string')throw new Error(_0x515207(0x234)+_0x50ee4a+_0x515207(0x1f1));if(_0x2b56fe[_0x515207(0x228)]!==undefined&&typeof _0x2b56fe['parent_segment']!==_0x515207(0x239))throw new Error(_0x515207(0x234)+_0x50ee4a+_0x515207(0x20c));if(_0x2b56fe[_0x515207(0x22b)]!==undefined&&typeof _0x2b56fe[_0x515207(0x22b)]!==_0x515207(0x239))throw new Error('Profile\x20\x27'+_0x50ee4a+'\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string');if(_0x2b56fe[_0x515207(0x237)]!==undefined&&typeof _0x2b56fe[_0x515207(0x237)]!==_0x515207(0x239))throw new Error(_0x515207(0x234)+_0x50ee4a+'\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string');return!![];}function loadProfilesFromTdxJson(_0xbae7ce,_0x330cad){const _0x2d8832=a51_0x2fd5;if(!a51_0x5c4355[_0x2d8832(0x23b)](_0xbae7ce))return[];try{const _0x54bc95=a51_0x5c4355[_0x2d8832(0x20a)](_0xbae7ce,_0x2d8832(0x235)),_0x2fdded=JSON['parse'](_0x54bc95);if(!_0x2fdded[_0x2d8832(0x204)]||typeof _0x2fdded[_0x2d8832(0x204)]!==_0x2d8832(0x224))return[];const _0xb3869f=[];for(const [_0x3c0708,_0x1320b4]of Object[_0x2d8832(0x236)](_0x2fdded['profiles'])){try{validateProfileConfig(_0x1320b4,_0x3c0708);const _0x419ac8=getNewCredentialPath(_0x3c0708),_0x70e3e5=getOldCredentialPath(_0x3c0708),_0x3e9afb=a51_0x5c4355[_0x2d8832(0x23b)](_0x419ac8)||a51_0x5c4355[_0x2d8832(0x23b)](_0x70e3e5);_0xb3869f[_0x2d8832(0x217)]({'name':_0x3c0708,'config':_0x1320b4,'metadata':{'name':_0x3c0708,'createdAt':new Date()[_0x2d8832(0x207)]()},'hasCredentials':_0x3e9afb,'scope':_0x330cad});}catch(_0x32e3da){_0x32e3da instanceof Error&&(console[_0x2d8832(0x22e)](_0x2d8832(0x20f)+_0xbae7ce+':'),console[_0x2d8832(0x22e)]('\x20\x20'+_0x32e3da[_0x2d8832(0x216)]+'\x0a'));}}return _0xb3869f;}catch(_0x5152f7){return _0x5152f7 instanceof SyntaxError?(console[_0x2d8832(0x22e)](_0x2d8832(0x1f8)+_0xbae7ce+_0x2d8832(0x1f9)),console[_0x2d8832(0x22e)]('Error:\x20'+_0x5152f7[_0x2d8832(0x216)]+'\x0a')):console['warn']('\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20'+_0xbae7ce+':\x20'+_0x5152f7+'\x0a'),[];}}export function getNewCredentialPath(_0x33ca63){const _0x4e1bad=a51_0x2fd5;return a51_0x1b793b['join'](getConfigDir(),_0x4e1bad(0x1fc)+_0x33ca63);}function getOldCredentialPath(_0x120ce4){const _0x51a7f2=a51_0x2fd5;return a51_0x1b793b[_0x51a7f2(0x225)](getProfilesDir(),_0x120ce4,_0x51a7f2(0x203));}function loadProfilesFromTdxJsonFiles(){const _0x270b39=a51_0x2fd5,_0x1b2b70=[],_0x5abe01=findProjectConfigPath();_0x5abe01&&_0x1b2b70[_0x270b39(0x217)](...loadProfilesFromTdxJson(_0x5abe01,'local'));const _0x5ebf3a=a51_0x1b793b[_0x270b39(0x225)](getConfigDir(),_0x270b39(0x220));return _0x1b2b70[_0x270b39(0x217)](...loadProfilesFromTdxJson(_0x5ebf3a,_0x270b39(0x21f))),_0x1b2b70;}function loadProfilesFromDirectories(){const _0x1eeee5=a51_0x2fd5,_0x3c7bdd=getProfilesDir();if(!a51_0x5c4355[_0x1eeee5(0x23b)](_0x3c7bdd))return[];try{return a51_0x5c4355[_0x1eeee5(0x1fe)](_0x3c7bdd,{'withFileTypes':!![]})[_0x1eeee5(0x233)](_0xb8c9d9=>_0xb8c9d9[_0x1eeee5(0x227)]())['map'](_0x4c9ac5=>_0x4c9ac5[_0x1eeee5(0x1f4)])[_0x1eeee5(0x233)](_0x3da2c4=>{const _0x3c756c=_0x1eeee5,_0x54f76f=getProfileConfigPath(_0x3da2c4),_0x224218=getProfileEnvPath(_0x3da2c4);return a51_0x5c4355[_0x3c756c(0x23b)](_0x54f76f)||a51_0x5c4355[_0x3c756c(0x23b)](_0x224218);})['map'](_0x3a3d5a=>{const _0x11ed56=loadProfileFromDirectory(_0x3a3d5a);if(_0x11ed56)return{..._0x11ed56,'scope':'directory'};return null;})[_0x1eeee5(0x233)](_0x3e4b59=>_0x3e4b59!==null);}catch{return[];}}function loadProfileFromDirectory(_0x573615){const _0xc2168c=a51_0x2fd5,_0x4a7c91=getProfileConfigPath(_0x573615),_0x446466=getOldCredentialPath(_0x573615);if(!a51_0x5c4355['existsSync'](_0x4a7c91)&&!a51_0x5c4355[_0xc2168c(0x23b)](_0x446466))return null;let _0x1feb58={},_0x46eb8f={'name':_0x573615,'createdAt':new Date()[_0xc2168c(0x207)]()};if(a51_0x5c4355[_0xc2168c(0x23b)](_0x4a7c91))try{const _0x5b3adf=a51_0x5c4355[_0xc2168c(0x20a)](_0x4a7c91,'utf-8'),_0x422053=JSON[_0xc2168c(0x22f)](_0x5b3adf),{metadata:_0x4bcd53,..._0xd891a5}=_0x422053;_0x1feb58=_0xd891a5,_0x4bcd53&&(_0x46eb8f=_0x4bcd53);}catch{}return{'name':_0x573615,'config':_0x1feb58,'metadata':_0x46eb8f,'hasCredentials':a51_0x5c4355['existsSync'](_0x446466),'scope':_0xc2168c(0x214)};}export function listProfiles(){const _0x5685b3=a51_0x2fd5,_0x1fc4b2=loadProfilesFromTdxJsonFiles(),_0x46236c=loadProfilesFromDirectories();if(_0x46236c[_0x5685b3(0x218)]>0x0){const _0x12dd83=_0x46236c[_0x5685b3(0x1f2)](_0x503ba0=>_0x503ba0['name'])[_0x5685b3(0x225)](',\x20'),_0x38b5b0=getConfigDir();console[_0x5685b3(0x22e)](_0x5685b3(0x1ff)+_0x12dd83),console[_0x5685b3(0x22e)](_0x5685b3(0x21c)),console[_0x5685b3(0x22e)](_0x5685b3(0x222)+a51_0x1b793b[_0x5685b3(0x225)](_0x38b5b0,_0x5685b3(0x220))),console['warn']('\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)'),console[_0x5685b3(0x22e)]('\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a');}const _0x592e94=[..._0x1fc4b2,..._0x46236c],_0xdb308a=new Map();for(const _0xb93113 of _0x592e94){!_0xdb308a[_0x5685b3(0x210)](_0xb93113['name'])&&_0xdb308a[_0x5685b3(0x22c)](_0xb93113[_0x5685b3(0x1f4)],_0xb93113);}return Array[_0x5685b3(0x23a)](_0xdb308a['values']())[_0x5685b3(0x219)]((_0x58e992,_0x5046bb)=>_0x58e992['name'][_0x5685b3(0x231)](_0x5046bb['name']));}export function profileExists(_0x253020){const _0x1ef22c=a51_0x2fd5,_0x2b2e94=listProfiles();return _0x2b2e94[_0x1ef22c(0x21a)](_0x151d23=>_0x151d23[_0x1ef22c(0x1f4)]===_0x253020);}export function loadProfile(_0x436e41){const _0x3181b5=a51_0x2fd5;validateProfileName(_0x436e41);const _0xf5635e=listProfiles(),_0x238fb3=_0xf5635e[_0x3181b5(0x230)](_0x43180f=>_0x43180f[_0x3181b5(0x1f4)]===_0x436e41);return _0x238fb3||null;}export function saveProfile(_0x248c8e,_0x52dda1,_0x29f63f=![]){saveProfileToUserConfig(_0x248c8e,_0x52dda1);}export function deleteProfile(_0x18be57){const _0x5700ab=a51_0x2fd5;validateProfileName(_0x18be57);const _0x4a2ca7=getProfileDir(_0x18be57);if(!a51_0x5c4355[_0x5700ab(0x23b)](_0x4a2ca7))throw new Error(_0x5700ab(0x213)+_0x18be57+_0x5700ab(0x223));a51_0x5c4355[_0x5700ab(0x1f6)](_0x4a2ca7,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x394ebf,_0x467593){const _0x28be9f=a51_0x2fd5;validateProfileName(_0x394ebf);const _0x48d4a6=getGlobalConfigPath(),_0x3826ce=getConfigDir();!a51_0x5c4355[_0x28be9f(0x23b)](_0x3826ce)&&createSecureDirectory(_0x3826ce);let _0x3c86e6={};if(a51_0x5c4355[_0x28be9f(0x23b)](_0x48d4a6))try{const _0x11e3f9=a51_0x5c4355[_0x28be9f(0x20a)](_0x48d4a6,_0x28be9f(0x235));_0x3c86e6=JSON[_0x28be9f(0x22f)](_0x11e3f9);}catch{console['warn'](_0x28be9f(0x211)+_0x48d4a6+_0x28be9f(0x202));}!_0x3c86e6[_0x28be9f(0x204)]&&(_0x3c86e6[_0x28be9f(0x204)]={}),_0x3c86e6[_0x28be9f(0x204)][_0x394ebf]=_0x467593,writeSecureFile(_0x48d4a6,JSON[_0x28be9f(0x232)](_0x3c86e6,null,0x2));}export function getActiveProfile(){const _0x35b673=a51_0x2fd5,_0x18ec5a=loadSessionContext();if(_0x18ec5a?.[_0x35b673(0x1f0)])return _0x18ec5a[_0x35b673(0x1f0)];const _0x244dc5=getGlobalConfigPath();if(!a51_0x5c4355[_0x35b673(0x23b)](_0x244dc5))return null;try{const _0x3fcbf3=a51_0x5c4355['readFileSync'](_0x244dc5,_0x35b673(0x235)),_0x17fc86=JSON[_0x35b673(0x22f)](_0x3fcbf3);return _0x17fc86[_0x35b673(0x1f0)]||null;}catch{return null;}}export function createProfile(_0x260c18,_0x315abc){const _0x34b749=a51_0x2fd5;validateProfileName(_0x260c18);if(profileExists(_0x260c18))throw new Error(_0x34b749(0x213)+_0x260c18+_0x34b749(0x201));saveProfile(_0x260c18,_0x315abc);}export function saveProfileCredentials(_0x46e9e0,_0x35bf33){const _0x300c55=a51_0x2fd5;validateProfileName(_0x46e9e0);if(!profileExists(_0x46e9e0))throw new Error(_0x300c55(0x213)+_0x46e9e0+_0x300c55(0x223));const _0x3f112c=getNewCredentialPath(_0x46e9e0);writeSecureFile(_0x3f112c,_0x35bf33);}export function loadProfileCredentials(_0x4773ec){const _0xfa50b7=a51_0x2fd5;validateProfileName(_0x4773ec);const _0x2d924b=getNewCredentialPath(_0x4773ec);if(a51_0x5c4355[_0xfa50b7(0x23b)](_0x2d924b))try{return a51_0x5c4355['readFileSync'](_0x2d924b,_0xfa50b7(0x235));}catch{}const _0x49f10a=getOldCredentialPath(_0x4773ec);if(a51_0x5c4355[_0xfa50b7(0x23b)](_0x49f10a)){console[_0xfa50b7(0x22e)]('\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27'+_0x4773ec+'\x27'),console[_0xfa50b7(0x22e)](_0xfa50b7(0x1fd)),console['warn'](_0xfa50b7(0x221)+_0x49f10a+'\x22\x20\x22'+_0x2d924b+'\x22'),console['warn'](_0xfa50b7(0x1f3));try{return a51_0x5c4355['readFileSync'](_0x49f10a,_0xfa50b7(0x235));}catch{return null;}}return null;}
1
+ (function(_0x4b34c6,_0x45e08c){const _0x156db8=a51_0x16e8,_0x42e71a=_0x4b34c6();while(!![]){try{const _0x53206f=parseInt(_0x156db8(0x125))/0x1*(parseInt(_0x156db8(0x126))/0x2)+-parseInt(_0x156db8(0x11d))/0x3*(-parseInt(_0x156db8(0x13f))/0x4)+-parseInt(_0x156db8(0xf5))/0x5+parseInt(_0x156db8(0x129))/0x6*(-parseInt(_0x156db8(0xfa))/0x7)+parseInt(_0x156db8(0x13b))/0x8*(-parseInt(_0x156db8(0x13e))/0x9)+parseInt(_0x156db8(0x10b))/0xa+parseInt(_0x156db8(0x104))/0xb;if(_0x53206f===_0x45e08c)break;else _0x42e71a['push'](_0x42e71a['shift']());}catch(_0x4ce3db){_0x42e71a['push'](_0x42e71a['shift']());}}}(a51_0x991f,0xba703));import*as a51_0x3e5160 from'node:fs';import*as a51_0x1ccbdd from'node:path';import{getConfigDir}from'./config.js';function a51_0x991f(){const _0xcfea68=['11215qzunDL','34CClvJL','message','.env.','6phEslm','\x22\x20\x22','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','keys','warn','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','llm_project','name','existsSync','readFileSync','set','Invalid\x20profile\x20name:\x20','\x20\x20mv\x20\x22','stringify','Warning:\x20Failed\x20to\x20parse\x20','site','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','parent_segment','60824XAKWeZ','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','map','1431ShXJDm','3580euvlXJ','Error:\x20','3377445APaavf','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','length','filter','localeCompare','5259758QaHyff','utf-8','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string',',\x20creating\x20new\x20file','readdirSync','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','directory','profiles','\x0aWarning:\x20Failed\x20to\x20parse\x20','find','14151808rWkWUM','join','\x20already\x20exists','from','string','.env','\x20does\x20not\x20exist','10343880rhacLB','local','database','\x27\x20will\x20be\x20ignored','Profile\x20','push','\x27:\x20unknown\x20config\x20key\x20\x27','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','Warning:\x20Profile\x20\x27','test','values','isDirectory','parse','entries','\x20\x201.\x20Edit:\x20','Profile\x20\x27','llm_agent','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','2976IxYEVv','description','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','has','tdx.json','profile','some',':\x20Invalid\x20JSON\x20syntax'];a51_0x991f=function(){return _0xcfea68;};return a51_0x991f();}import{createSecureDirectory,writeSecureFile}from'../utils/file-permissions.js';import{findProjectConfigPath}from'./project-config.js';import{loadSessionContext}from'./session.js';export function getProfileParams(_0xf737f0){const _0x73f2cb=a51_0x16e8,_0x40aa10={};if(!_0xf737f0)return _0x40aa10;for(const [_0x4df796,_0x2a9666]of Object[_0x73f2cb(0x118)](_0xf737f0)){_0x4df796!==_0x73f2cb(0x11e)&&_0x2a9666!==undefined&&(_0x40aa10[_0x4df796]=_0x2a9666);}return _0x40aa10;}export function getProfilesDir(){const _0x1752fc=a51_0x16e8;return a51_0x1ccbdd[_0x1752fc(0x105)](getConfigDir(),_0x1752fc(0x101));}function getProfileDir(_0xce7546){const _0x1033ac=a51_0x16e8;return a51_0x1ccbdd[_0x1033ac(0x105)](getProfilesDir(),_0xce7546);}function getProfileConfigPath(_0x484993){const _0x5b4239=a51_0x16e8;return a51_0x1ccbdd[_0x5b4239(0x105)](getProfileDir(_0x484993),_0x5b4239(0x121));}function getProfileEnvPath(_0x3c9085){const _0x48d900=a51_0x16e8;return a51_0x1ccbdd[_0x48d900(0x105)](getProfileDir(_0x3c9085),_0x48d900(0x109));}function getGlobalConfigPath(){const _0x5af9c2=a51_0x16e8;return a51_0x1ccbdd[_0x5af9c2(0x105)](getConfigDir(),'tdx.json');}function validateProfileName(_0x27ef39){const _0x3cf043=a51_0x16e8;if(!/^[a-zA-Z0-9_-]+$/[_0x3cf043(0x114)](_0x27ef39))throw new Error(_0x3cf043(0x134)+_0x27ef39+'.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore.');}function validateProfileConfig(_0x2885e9,_0x32aae8){const _0x277e91=a51_0x16e8;if(typeof _0x2885e9!=='object'||_0x2885e9===null)throw new Error('Profile\x20\x27'+_0x32aae8+'\x27:\x20config\x20must\x20be\x20an\x20object');const _0xf95715=['description',_0x277e91(0x138),_0x277e91(0x10d),_0x277e91(0x13a),'llm_project',_0x277e91(0x11b)],_0x488fe4=_0x2885e9;for(const _0x100ddd of Object[_0x277e91(0x12c)](_0x488fe4)){!_0xf95715['includes'](_0x100ddd)&&console[_0x277e91(0x12d)](_0x277e91(0x113)+_0x32aae8+_0x277e91(0x111)+_0x100ddd+_0x277e91(0x10e));}if(_0x488fe4[_0x277e91(0x11e)]!==undefined&&typeof _0x488fe4['description']!==_0x277e91(0x108))throw new Error(_0x277e91(0x11a)+_0x32aae8+_0x277e91(0x112));if(_0x488fe4[_0x277e91(0x138)]!==undefined&&typeof _0x488fe4[_0x277e91(0x138)]!=='string')throw new Error(_0x277e91(0x11a)+_0x32aae8+_0x277e91(0xfc));if(_0x488fe4[_0x277e91(0x10d)]!==undefined&&typeof _0x488fe4[_0x277e91(0x10d)]!==_0x277e91(0x108))throw new Error(_0x277e91(0x11a)+_0x32aae8+_0x277e91(0xf6));if(_0x488fe4['parent_segment']!==undefined&&typeof _0x488fe4[_0x277e91(0x13a)]!==_0x277e91(0x108))throw new Error('Profile\x20\x27'+_0x32aae8+_0x277e91(0x11f));if(_0x488fe4[_0x277e91(0x12f)]!==undefined&&typeof _0x488fe4['llm_project']!==_0x277e91(0x108))throw new Error(_0x277e91(0x11a)+_0x32aae8+_0x277e91(0x12b));if(_0x488fe4[_0x277e91(0x11b)]!==undefined&&typeof _0x488fe4[_0x277e91(0x11b)]!==_0x277e91(0x108))throw new Error(_0x277e91(0x11a)+_0x32aae8+'\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string');return!![];}function a51_0x16e8(_0x710f7d,_0x3b17e6){_0x710f7d=_0x710f7d-0xf5;const _0x991f17=a51_0x991f();let _0x16e889=_0x991f17[_0x710f7d];return _0x16e889;}function loadProfilesFromTdxJson(_0x41dc16,_0x4d28ad){const _0x5245bc=a51_0x16e8;if(!a51_0x3e5160['existsSync'](_0x41dc16))return[];try{const _0x29d5a7=a51_0x3e5160[_0x5245bc(0x132)](_0x41dc16,'utf-8'),_0x4c7e27=JSON[_0x5245bc(0x117)](_0x29d5a7);if(!_0x4c7e27[_0x5245bc(0x101)]||typeof _0x4c7e27['profiles']!=='object')return[];const _0x50b4d6=[];for(const [_0xcd3aa4,_0x4d6463]of Object[_0x5245bc(0x118)](_0x4c7e27[_0x5245bc(0x101)])){try{validateProfileConfig(_0x4d6463,_0xcd3aa4);const _0x55cf22=getNewCredentialPath(_0xcd3aa4),_0x145854=getOldCredentialPath(_0xcd3aa4),_0x2a0fcf=a51_0x3e5160[_0x5245bc(0x131)](_0x55cf22)||a51_0x3e5160[_0x5245bc(0x131)](_0x145854);_0x50b4d6['push']({'name':_0xcd3aa4,'config':_0x4d6463,'metadata':{'name':_0xcd3aa4,'createdAt':new Date()['toISOString']()},'hasCredentials':_0x2a0fcf,'scope':_0x4d28ad});}catch(_0x4213db){_0x4213db instanceof Error&&(console['warn']('\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20'+_0x41dc16+':'),console[_0x5245bc(0x12d)]('\x20\x20'+_0x4213db[_0x5245bc(0x127)]+'\x0a'));}}return _0x50b4d6;}catch(_0x3367de){return _0x3367de instanceof SyntaxError?(console[_0x5245bc(0x12d)](_0x5245bc(0x102)+_0x41dc16+_0x5245bc(0x124)),console[_0x5245bc(0x12d)](_0x5245bc(0x140)+_0x3367de[_0x5245bc(0x127)]+'\x0a')):console[_0x5245bc(0x12d)](_0x5245bc(0x11c)+_0x41dc16+':\x20'+_0x3367de+'\x0a'),[];}}export function getNewCredentialPath(_0x4130c7){const _0x2208fe=a51_0x16e8;return a51_0x1ccbdd[_0x2208fe(0x105)](getConfigDir(),_0x2208fe(0x128)+_0x4130c7);}function getOldCredentialPath(_0x591d12){const _0xb312ce=a51_0x16e8;return a51_0x1ccbdd['join'](getProfilesDir(),_0x591d12,_0xb312ce(0x109));}function loadProfilesFromTdxJsonFiles(){const _0x17c580=a51_0x16e8,_0x326b73=[],_0x2bc99a=findProjectConfigPath();_0x2bc99a&&_0x326b73[_0x17c580(0x110)](...loadProfilesFromTdxJson(_0x2bc99a,_0x17c580(0x10c)));const _0x54b4a0=a51_0x1ccbdd[_0x17c580(0x105)](getConfigDir(),_0x17c580(0x121));return _0x326b73[_0x17c580(0x110)](...loadProfilesFromTdxJson(_0x54b4a0,'user')),_0x326b73;}function loadProfilesFromDirectories(){const _0x2220a5=a51_0x16e8,_0x4d0720=getProfilesDir();if(!a51_0x3e5160['existsSync'](_0x4d0720))return[];try{return a51_0x3e5160[_0x2220a5(0xfe)](_0x4d0720,{'withFileTypes':!![]})['filter'](_0x29666f=>_0x29666f[_0x2220a5(0x116)]())[_0x2220a5(0x13d)](_0x541a44=>_0x541a44[_0x2220a5(0x130)])[_0x2220a5(0xf8)](_0x54b07d=>{const _0x41436e=_0x2220a5,_0x1039f7=getProfileConfigPath(_0x54b07d),_0x27818c=getProfileEnvPath(_0x54b07d);return a51_0x3e5160[_0x41436e(0x131)](_0x1039f7)||a51_0x3e5160[_0x41436e(0x131)](_0x27818c);})[_0x2220a5(0x13d)](_0x31c272=>{const _0x4ad23b=loadProfileFromDirectory(_0x31c272);if(_0x4ad23b)return{..._0x4ad23b,'scope':'directory'};return null;})['filter'](_0x5d8a29=>_0x5d8a29!==null);}catch{return[];}}function loadProfileFromDirectory(_0xfebc5c){const _0x280f84=a51_0x16e8,_0x317a5c=getProfileConfigPath(_0xfebc5c),_0x56fb2f=getOldCredentialPath(_0xfebc5c);if(!a51_0x3e5160[_0x280f84(0x131)](_0x317a5c)&&!a51_0x3e5160['existsSync'](_0x56fb2f))return null;let _0xc71aae={},_0xa467a={'name':_0xfebc5c,'createdAt':new Date()['toISOString']()};if(a51_0x3e5160[_0x280f84(0x131)](_0x317a5c))try{const _0x10b6ed=a51_0x3e5160[_0x280f84(0x132)](_0x317a5c,_0x280f84(0xfb)),_0x75d489=JSON[_0x280f84(0x117)](_0x10b6ed),{metadata:_0xda3b7c,..._0xd658ca}=_0x75d489;_0xc71aae=_0xd658ca,_0xda3b7c&&(_0xa467a=_0xda3b7c);}catch{}return{'name':_0xfebc5c,'config':_0xc71aae,'metadata':_0xa467a,'hasCredentials':a51_0x3e5160[_0x280f84(0x131)](_0x56fb2f),'scope':_0x280f84(0x100)};}export function listProfiles(){const _0x418406=a51_0x16e8,_0x49ec6a=loadProfilesFromTdxJsonFiles(),_0x1af178=loadProfilesFromDirectories();if(_0x1af178[_0x418406(0xf7)]>0x0){const _0x34eafd=_0x1af178[_0x418406(0x13d)](_0x247ced=>_0x247ced[_0x418406(0x130)])[_0x418406(0x105)](',\x20'),_0x22019b=getConfigDir();console[_0x418406(0x12d)]('\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20'+_0x34eafd),console['warn']('Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:'),console[_0x418406(0x12d)](_0x418406(0x119)+a51_0x1ccbdd[_0x418406(0x105)](_0x22019b,_0x418406(0x121))),console[_0x418406(0x12d)](_0x418406(0x12e)),console[_0x418406(0x12d)](_0x418406(0x13c));}const _0x5f4d5d=[..._0x49ec6a,..._0x1af178],_0x4b3fbc=new Map();for(const _0x49908e of _0x5f4d5d){!_0x4b3fbc[_0x418406(0x120)](_0x49908e[_0x418406(0x130)])&&_0x4b3fbc[_0x418406(0x133)](_0x49908e[_0x418406(0x130)],_0x49908e);}return Array[_0x418406(0x107)](_0x4b3fbc[_0x418406(0x115)]())['sort']((_0x444961,_0x3885cf)=>_0x444961[_0x418406(0x130)][_0x418406(0xf9)](_0x3885cf[_0x418406(0x130)]));}export function profileExists(_0x29328c){const _0x5a8293=a51_0x16e8,_0x129c96=listProfiles();return _0x129c96[_0x5a8293(0x123)](_0xf59936=>_0xf59936[_0x5a8293(0x130)]===_0x29328c);}export function loadProfile(_0x5e6db0){const _0xcd0f72=a51_0x16e8;validateProfileName(_0x5e6db0);const _0xe10be1=listProfiles(),_0x83bb87=_0xe10be1[_0xcd0f72(0x103)](_0x1079a3=>_0x1079a3[_0xcd0f72(0x130)]===_0x5e6db0);return _0x83bb87||null;}export function saveProfile(_0x1acf27,_0x5432da,_0x3f0997=![]){saveProfileToUserConfig(_0x1acf27,_0x5432da);}export function deleteProfile(_0x1ef648){const _0xb5db0c=a51_0x16e8;validateProfileName(_0x1ef648);const _0x4fd7c8=getProfileDir(_0x1ef648);if(!a51_0x3e5160[_0xb5db0c(0x131)](_0x4fd7c8))throw new Error(_0xb5db0c(0x10f)+_0x1ef648+_0xb5db0c(0x10a));a51_0x3e5160['rmSync'](_0x4fd7c8,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x58f038,_0xd6473d){const _0x4bbe17=a51_0x16e8;validateProfileName(_0x58f038);const _0x4b758d=getGlobalConfigPath(),_0x5b4b55=getConfigDir();!a51_0x3e5160[_0x4bbe17(0x131)](_0x5b4b55)&&createSecureDirectory(_0x5b4b55);let _0x2c61d9={};if(a51_0x3e5160['existsSync'](_0x4b758d))try{const _0x511eff=a51_0x3e5160[_0x4bbe17(0x132)](_0x4b758d,'utf-8');_0x2c61d9=JSON[_0x4bbe17(0x117)](_0x511eff);}catch{console[_0x4bbe17(0x12d)](_0x4bbe17(0x137)+_0x4b758d+_0x4bbe17(0xfd));}!_0x2c61d9[_0x4bbe17(0x101)]&&(_0x2c61d9[_0x4bbe17(0x101)]={}),_0x2c61d9[_0x4bbe17(0x101)][_0x58f038]=_0xd6473d,writeSecureFile(_0x4b758d,JSON[_0x4bbe17(0x136)](_0x2c61d9,null,0x2));}export function getActiveProfile(){const _0x4f4cbc=a51_0x16e8,_0x416e5a=loadSessionContext();if(_0x416e5a?.[_0x4f4cbc(0x122)])return _0x416e5a[_0x4f4cbc(0x122)];const _0x570301=getGlobalConfigPath();if(!a51_0x3e5160[_0x4f4cbc(0x131)](_0x570301))return null;try{const _0x5d055c=a51_0x3e5160[_0x4f4cbc(0x132)](_0x570301,_0x4f4cbc(0xfb)),_0x76783d=JSON['parse'](_0x5d055c);return _0x76783d[_0x4f4cbc(0x122)]||null;}catch{return null;}}export function createProfile(_0x12c3a6,_0x3e5dd2){const _0x3cf7bc=a51_0x16e8;validateProfileName(_0x12c3a6);if(profileExists(_0x12c3a6))throw new Error('Profile\x20'+_0x12c3a6+_0x3cf7bc(0x106));saveProfile(_0x12c3a6,_0x3e5dd2);}export function saveProfileCredentials(_0x14011b,_0x202998){const _0x54ada6=a51_0x16e8;validateProfileName(_0x14011b);if(!profileExists(_0x14011b))throw new Error('Profile\x20'+_0x14011b+_0x54ada6(0x10a));const _0x52de9e=getNewCredentialPath(_0x14011b);writeSecureFile(_0x52de9e,_0x202998);}export function loadProfileCredentials(_0x33f98c){const _0x14f753=a51_0x16e8;validateProfileName(_0x33f98c);const _0x2baf66=getNewCredentialPath(_0x33f98c);if(a51_0x3e5160['existsSync'](_0x2baf66))try{return a51_0x3e5160[_0x14f753(0x132)](_0x2baf66,_0x14f753(0xfb));}catch{}const _0x4d7ac4=getOldCredentialPath(_0x33f98c);if(a51_0x3e5160[_0x14f753(0x131)](_0x4d7ac4)){console['warn'](_0x14f753(0x139)+_0x33f98c+'\x27'),console[_0x14f753(0x12d)]('To\x20migrate:'),console[_0x14f753(0x12d)](_0x14f753(0x135)+_0x4d7ac4+_0x14f753(0x12a)+_0x2baf66+'\x22'),console['warn'](_0x14f753(0xff));try{return a51_0x3e5160[_0x14f753(0x132)](_0x4d7ac4,_0x14f753(0xfb));}catch{return null;}}return null;}
@@ -1 +1 @@
1
- const a52_0x47a68a=a52_0x1ba7;(function(_0xe3c10c,_0x2f7500){const _0x44f0e6=a52_0x1ba7,_0x86609a=_0xe3c10c();while(!![]){try{const _0x1ede2b=parseInt(_0x44f0e6(0x1e8))/0x1*(parseInt(_0x44f0e6(0x1ed))/0x2)+parseInt(_0x44f0e6(0x201))/0x3+-parseInt(_0x44f0e6(0x1ee))/0x4*(parseInt(_0x44f0e6(0x1ec))/0x5)+parseInt(_0x44f0e6(0x1fb))/0x6*(parseInt(_0x44f0e6(0x1e5))/0x7)+parseInt(_0x44f0e6(0x1f0))/0x8*(parseInt(_0x44f0e6(0x1f9))/0x9)+-parseInt(_0x44f0e6(0x1e7))/0xa*(-parseInt(_0x44f0e6(0x203))/0xb)+-parseInt(_0x44f0e6(0x202))/0xc;if(_0x1ede2b===_0x2f7500)break;else _0x86609a['push'](_0x86609a['shift']());}catch(_0xbed1dc){_0x86609a['push'](_0x86609a['shift']());}}}(a52_0x543d,0x45a9f));import*as a52_0x2c719d from'node:fs';import*as a52_0xeacbd4 from'node:path';const PROJECT_CONFIG_FILENAME=a52_0x47a68a(0x1ef);export function findProjectConfigPath(_0x69acc3){const _0x2dd587=a52_0x47a68a;let _0x85569d=_0x69acc3||process[_0x2dd587(0x1f3)]();while(!![]){const _0x67c295=a52_0xeacbd4[_0x2dd587(0x1eb)](_0x85569d,PROJECT_CONFIG_FILENAME);if(a52_0x2c719d[_0x2dd587(0x1e3)](_0x67c295))return _0x67c295;const _0x77a38e=a52_0xeacbd4[_0x2dd587(0x1e9)](_0x85569d);if(_0x77a38e===_0x85569d)return null;_0x85569d=_0x77a38e;}}export function loadProjectConfig(_0x782eaf){const _0x1ba6e6=a52_0x47a68a,_0x4483c3=findProjectConfigPath(_0x782eaf);if(!_0x4483c3)return null;try{const _0x47d725=a52_0x2c719d[_0x1ba6e6(0x1f5)](_0x4483c3,_0x1ba6e6(0x204)),_0x2f52f9=JSON['parse'](_0x47d725),_0x36c4fd=JSON[_0x1ba6e6(0x1f6)](_0x2f52f9);if(_0x36c4fd[_0x1ba6e6(0x1fa)](_0x1ba6e6(0x1fe))||_0x36c4fd[_0x1ba6e6(0x1fa)](_0x1ba6e6(0x200))||_0x36c4fd['includes'](_0x1ba6e6(0x1e6)))throw new Error(_0x1ba6e6(0x1f7)+_0x4483c3+_0x1ba6e6(0x1fc)+_0x1ba6e6(0x1fd));const {metadata:_0x5485af,profile:_0x4efd8e,..._0x142071}=_0x2f52f9;return _0x4efd8e&&console['warn']('Warning:\x20\x27profile\x27\x20field\x20in\x20'+_0x4483c3+_0x1ba6e6(0x1ea)+_0x1ba6e6(0x1f2)),_0x142071;}catch(_0x189fa2){if(_0x189fa2 instanceof Error&&_0x1ba6e6(0x1f4)in _0x189fa2&&_0x189fa2[_0x1ba6e6(0x1f4)]===_0x1ba6e6(0x1e4))return null;throw new Error('Failed\x20to\x20load\x20project\x20config\x20from\x20'+_0x4483c3+':\x20'+_0x189fa2);}}function a52_0x1ba7(_0x26bcbd,_0x437df1){_0x26bcbd=_0x26bcbd-0x1e3;const _0x543d1c=a52_0x543d();let _0x1ba72a=_0x543d1c[_0x26bcbd];return _0x1ba72a;}function a52_0x543d(){const _0x45eca4=['API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.','36bcQrNm','includes','3225234YsdcdD',').\x20','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','TD_API_KEY','profile','apiKey','480444ZGbFAZ','17151432kJhhEV','5008982ntgoQp','utf-8','existsSync','ENOENT','7fcnaDt','api_key','10iGFoBj','10477UCqIPe','dirname','\x20is\x20ignored.\x20','join','28055vEorxA','74lUApWe','172gKNTAR','tdx.json','830408mPkrsu','writeFileSync','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','cwd','code','readFileSync','stringify','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20('];a52_0x543d=function(){return _0x45eca4;};return a52_0x543d();}export function saveProjectConfig(_0x597448,_0x5edc94){const _0x4d0907=a52_0x47a68a,_0x466f07=_0x5edc94||process[_0x4d0907(0x1f3)](),_0x15dee0=a52_0xeacbd4['join'](_0x466f07,PROJECT_CONFIG_FILENAME),_0x36f88c=JSON['stringify'](_0x597448);if(_0x36f88c[_0x4d0907(0x1fa)](_0x4d0907(0x1fe))||_0x36f88c[_0x4d0907(0x1fa)](_0x4d0907(0x200))||_0x36f88c['includes'](_0x4d0907(0x1e6)))throw new Error(_0x4d0907(0x1f8));if(_0x4d0907(0x1ff)in _0x597448)throw new Error('\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.');a52_0x2c719d[_0x4d0907(0x1f1)](_0x15dee0,JSON[_0x4d0907(0x1f6)](_0x597448,null,0x2));}export function hasProjectConfig(_0x591ad8){return findProjectConfigPath(_0x591ad8)!==null;}export function getProjectRoot(_0x2bc24d){const _0x132176=a52_0x47a68a,_0x2db9f7=findProjectConfigPath(_0x2bc24d);return _0x2db9f7?a52_0xeacbd4[_0x132176(0x1e9)](_0x2db9f7):null;}
1
+ (function(_0x169645,_0x23d61d){const _0xb84b69=a52_0x3608,_0xc5c1d4=_0x169645();while(!![]){try{const _0x507f97=parseInt(_0xb84b69(0x16d))/0x1+parseInt(_0xb84b69(0x17b))/0x2+-parseInt(_0xb84b69(0x177))/0x3*(parseInt(_0xb84b69(0x178))/0x4)+parseInt(_0xb84b69(0x160))/0x5*(-parseInt(_0xb84b69(0x162))/0x6)+parseInt(_0xb84b69(0x16c))/0x7*(parseInt(_0xb84b69(0x170))/0x8)+-parseInt(_0xb84b69(0x173))/0x9*(parseInt(_0xb84b69(0x16e))/0xa)+-parseInt(_0xb84b69(0x179))/0xb;if(_0x507f97===_0x23d61d)break;else _0xc5c1d4['push'](_0xc5c1d4['shift']());}catch(_0x546628){_0xc5c1d4['push'](_0xc5c1d4['shift']());}}}(a52_0x9bb8,0x68d1f));function a52_0x9bb8(){const _0x243be1=['includes','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','4866GbFHfM','1696OJMBOm','1310529GKGIaB','api_key','889316HemeXi','join',').\x20','code','4105elhuLP','dirname','624Yqtuhp','warn','utf-8','existsSync','Warning:\x20\x27profile\x27\x20field\x20in\x20','cwd','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','apiKey','\x20is\x20ignored.\x20','ENOENT','91pStIpf','663061yLHUqZ','69990ENXGRF','TD_API_KEY','278056BkkNcN','stringify','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','306RuAzyN'];a52_0x9bb8=function(){return _0x243be1;};return a52_0x9bb8();}import*as a52_0x54a8ba from'node:fs';import*as a52_0x230202 from'node:path';const PROJECT_CONFIG_FILENAME='tdx.json';function a52_0x3608(_0x302a32,_0x451939){_0x302a32=_0x302a32-0x15d;const _0x9bb8d0=a52_0x9bb8();let _0x360862=_0x9bb8d0[_0x302a32];return _0x360862;}export function findProjectConfigPath(_0xa42b8a){const _0x5ba737=a52_0x3608;let _0x5b3193=_0xa42b8a||process[_0x5ba737(0x167)]();while(!![]){const _0x280853=a52_0x230202[_0x5ba737(0x15d)](_0x5b3193,PROJECT_CONFIG_FILENAME);if(a52_0x54a8ba[_0x5ba737(0x165)](_0x280853))return _0x280853;const _0x3967bf=a52_0x230202[_0x5ba737(0x161)](_0x5b3193);if(_0x3967bf===_0x5b3193)return null;_0x5b3193=_0x3967bf;}}export function loadProjectConfig(_0x582025){const _0x3758ef=a52_0x3608,_0x434423=findProjectConfigPath(_0x582025);if(!_0x434423)return null;try{const _0x3826d7=a52_0x54a8ba['readFileSync'](_0x434423,_0x3758ef(0x164)),_0x1d5ec0=JSON['parse'](_0x3826d7),_0x3f8fdd=JSON['stringify'](_0x1d5ec0);if(_0x3f8fdd[_0x3758ef(0x174)]('TD_API_KEY')||_0x3f8fdd[_0x3758ef(0x174)](_0x3758ef(0x169))||_0x3f8fdd[_0x3758ef(0x174)](_0x3758ef(0x17a)))throw new Error(_0x3758ef(0x168)+_0x434423+_0x3758ef(0x15e)+_0x3758ef(0x172));const {metadata:_0x5b91c8,profile:_0x28ebb4,..._0x133809}=_0x1d5ec0;return _0x28ebb4&&console[_0x3758ef(0x163)](_0x3758ef(0x166)+_0x434423+_0x3758ef(0x16a)+_0x3758ef(0x176)),_0x133809;}catch(_0x44ced3){if(_0x44ced3 instanceof Error&&_0x3758ef(0x15f)in _0x44ced3&&_0x44ced3[_0x3758ef(0x15f)]===_0x3758ef(0x16b))return null;throw new Error('Failed\x20to\x20load\x20project\x20config\x20from\x20'+_0x434423+':\x20'+_0x44ced3);}}export function saveProjectConfig(_0x6c9c74,_0x342e59){const _0x1779ff=a52_0x3608,_0x3eea96=_0x342e59||process[_0x1779ff(0x167)](),_0x357c42=a52_0x230202[_0x1779ff(0x15d)](_0x3eea96,PROJECT_CONFIG_FILENAME),_0x35c444=JSON[_0x1779ff(0x171)](_0x6c9c74);if(_0x35c444[_0x1779ff(0x174)](_0x1779ff(0x16f))||_0x35c444['includes'](_0x1779ff(0x169))||_0x35c444[_0x1779ff(0x174)](_0x1779ff(0x17a)))throw new Error(_0x1779ff(0x175));if('profile'in _0x6c9c74)throw new Error('\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.');a52_0x54a8ba['writeFileSync'](_0x357c42,JSON[_0x1779ff(0x171)](_0x6c9c74,null,0x2));}export function hasProjectConfig(_0x109369){return findProjectConfigPath(_0x109369)!==null;}export function getProjectRoot(_0x36803b){const _0x2aad05=a52_0x3608,_0xfc61a1=findProjectConfigPath(_0x36803b);return _0xfc61a1?a52_0x230202[_0x2aad05(0x161)](_0xfc61a1):null;}