@treasuredata/tdx 0.8.2 → 0.8.4

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 (144) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/client/cdp-api-client.js +1 -1
  8. package/dist/client/engage-api-client.js +1 -1
  9. package/dist/client/http-client.js +1 -1
  10. package/dist/client/llm-api-client.js +1 -1
  11. package/dist/client/rate-limiter.js +1 -1
  12. package/dist/client/td-api-client.js +1 -1
  13. package/dist/client/trino-api-client.js +1 -1
  14. package/dist/client/workflow-client.js +1 -1
  15. package/dist/commands/activations.js +1 -1
  16. package/dist/commands/api-command.js +1 -1
  17. package/dist/commands/auth-command.js +1 -1
  18. package/dist/commands/chat-command.js +1 -1
  19. package/dist/commands/claude-command.js +1 -1
  20. package/dist/commands/claude-statusline-command.js +1 -1
  21. package/dist/commands/claude-usage-command.js +1 -1
  22. package/dist/commands/command.js +1 -1
  23. package/dist/commands/connection-command.js +1 -1
  24. package/dist/commands/context-command.js +1 -1
  25. package/dist/commands/databases.js +1 -1
  26. package/dist/commands/describe.js +1 -1
  27. package/dist/commands/engage-command.js +1 -1
  28. package/dist/commands/job-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.d.ts.map +1 -1
  34. package/dist/commands/query-command.js +1 -1
  35. package/dist/commands/query-command.js.map +1 -1
  36. package/dist/commands/segment-command.d.ts.map +1 -1
  37. package/dist/commands/segment-command.js +1 -1
  38. package/dist/commands/segment-command.js.map +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.d.ts.map +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js.map +1 -1
  44. package/dist/commands/segment-push-command.d.ts.map +1 -1
  45. package/dist/commands/segment-push-command.js +1 -1
  46. package/dist/commands/segment-push-command.js.map +1 -1
  47. package/dist/commands/segment-update-command.js +1 -1
  48. package/dist/commands/segment-use-command.js +1 -1
  49. package/dist/commands/segments.d.ts.map +1 -1
  50. package/dist/commands/segments.js +1 -1
  51. package/dist/commands/segments.js.map +1 -1
  52. package/dist/commands/show.js +1 -1
  53. package/dist/commands/tables.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/config.js +1 -1
  59. package/dist/core/connection-cache.js +1 -1
  60. package/dist/core/credential-cache.js +1 -1
  61. package/dist/core/global-context.js +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/profile.js +1 -1
  64. package/dist/core/project-config.js +1 -1
  65. package/dist/core/session.js +1 -1
  66. package/dist/core/user-cache.js +1 -1
  67. package/dist/index.js +1 -1
  68. package/dist/proxy/anthropic-adapter.d.ts +21 -21
  69. package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
  70. package/dist/proxy/anthropic-adapter.js +1 -1
  71. package/dist/proxy/anthropic-adapter.js.map +1 -1
  72. package/dist/proxy/claude-usage-tracker.js +1 -1
  73. package/dist/proxy/context-signature.js +1 -1
  74. package/dist/proxy/conversation-utils.js +1 -1
  75. package/dist/proxy/conversation-utils.js.map +1 -1
  76. package/dist/proxy/server.d.ts.map +1 -1
  77. package/dist/proxy/server.js +1 -1
  78. package/dist/proxy/server.js.map +1 -1
  79. package/dist/proxy/session-cache.js +1 -1
  80. package/dist/sdk/api.js +1 -1
  81. package/dist/sdk/connection.js +1 -1
  82. package/dist/sdk/engage.js +1 -1
  83. package/dist/sdk/errors.d.ts +18 -0
  84. package/dist/sdk/errors.d.ts.map +1 -1
  85. package/dist/sdk/errors.js +1 -1
  86. package/dist/sdk/errors.js.map +1 -1
  87. package/dist/sdk/index.js +1 -1
  88. package/dist/sdk/job.js +1 -1
  89. package/dist/sdk/llm.js +1 -1
  90. package/dist/sdk/query.js +1 -1
  91. package/dist/sdk/segment/child-segment-yaml.d.ts +24 -5
  92. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  93. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  94. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  95. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  96. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  97. package/dist/sdk/segment.js +1 -1
  98. package/dist/sdk/user.js +1 -1
  99. package/dist/sdk/workflow.js +1 -1
  100. package/dist/types/endpoints.js +1 -1
  101. package/dist/types/index.d.ts +1 -0
  102. package/dist/types/index.d.ts.map +1 -1
  103. package/dist/types/index.js +1 -1
  104. package/dist/utils/agent-ref-parser.js +1 -1
  105. package/dist/utils/async.js +1 -1
  106. package/dist/utils/chat-cache.js +1 -1
  107. package/dist/utils/colors.js +1 -1
  108. package/dist/utils/command-output.js +1 -1
  109. package/dist/utils/constants.js +1 -1
  110. package/dist/utils/diff.js +1 -1
  111. package/dist/utils/fields-display.js +1 -1
  112. package/dist/utils/file-permissions.js +1 -1
  113. package/dist/utils/format-detector.js +1 -1
  114. package/dist/utils/formatters.js +1 -1
  115. package/dist/utils/json-loader.js +1 -1
  116. package/dist/utils/llm-backup-utils.js +1 -1
  117. package/dist/utils/model-aliases.js +1 -1
  118. package/dist/utils/model-factors.js +1 -1
  119. package/dist/utils/option-validation.js +1 -1
  120. package/dist/utils/port.js +1 -1
  121. package/dist/utils/process.d.ts +6 -0
  122. package/dist/utils/process.d.ts.map +1 -1
  123. package/dist/utils/process.js +1 -1
  124. package/dist/utils/process.js.map +1 -1
  125. package/dist/utils/prompt.js +1 -1
  126. package/dist/utils/segment-path-parser.js +1 -1
  127. package/dist/utils/segment-ref-parser.js +1 -1
  128. package/dist/utils/spinner.js +1 -1
  129. package/dist/utils/sql-parser.d.ts +37 -1
  130. package/dist/utils/sql-parser.d.ts.map +1 -1
  131. package/dist/utils/sql-parser.js +1 -1
  132. package/dist/utils/sql-parser.js.map +1 -1
  133. package/dist/utils/sse-parser.js +1 -1
  134. package/dist/utils/string-utils.js +1 -1
  135. package/dist/utils/table-ref-parser.js +1 -1
  136. package/dist/utils/tdx-config.js +1 -1
  137. package/dist/utils/tdx-logger.js +1 -1
  138. package/dist/utils/tree-formatter.d.ts +4 -0
  139. package/dist/utils/tree-formatter.d.ts.map +1 -1
  140. package/dist/utils/tree-formatter.js +1 -1
  141. package/dist/utils/tree-formatter.js.map +1 -1
  142. package/dist/utils/version-check.js +1 -1
  143. package/dist/utils/workflow-utils.js +1 -1
  144. package/package.json +3 -3
@@ -1 +1 @@
1
- const a40_0x256c5d=a40_0x27be;(function(_0x4f19d1,_0x15267b){const _0x1a058b=a40_0x27be,_0x372f08=_0x4f19d1();while(!![]){try{const _0x23e78f=-parseInt(_0x1a058b(0xf8))/0x1*(parseInt(_0x1a058b(0xf0))/0x2)+parseInt(_0x1a058b(0xdb))/0x3+-parseInt(_0x1a058b(0xfb))/0x4*(-parseInt(_0x1a058b(0xef))/0x5)+parseInt(_0x1a058b(0xf1))/0x6+parseInt(_0x1a058b(0xea))/0x7+-parseInt(_0x1a058b(0xee))/0x8*(parseInt(_0x1a058b(0xe5))/0x9)+-parseInt(_0x1a058b(0xf2))/0xa;if(_0x23e78f===_0x15267b)break;else _0x372f08['push'](_0x372f08['shift']());}catch(_0x58273e){_0x372f08['push'](_0x372f08['shift']());}}}(a40_0x21b4,0x43f33));import{BaseCommand}from'./command.js';function a40_0x27be(_0xa8a014,_0x54e42a){_0xa8a014=_0xa8a014-0xd0;const _0x21b4e9=a40_0x21b4();let _0x27be21=_0x21b4e9[_0xa8a014];return _0x27be21;}import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists}from'../core/profile.js';import{GlobalContext}from'../core/global-context.js';import a40_0x371e4a from'chalk';function a40_0x21b4(){const _0x7c3add=['Error:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','1359fjRMMh','Error:\x20Profile\x20\x27','engage_workspace','parent_segment','.\x20Must\x20be\x20one\x20of:\x20','2858863MJipfJ','\x27\x20does\x20not\x20exist','execute','cleared','27176GvYJEf','35ofFhkQ','4WssGsE','2303082hMHmaA','1596840zFSxGo','join','description','Session\x20profile\x20set\x20to:\x20','message','includes','149449ALtthk','green','dim','61444DgsWTw','validate','Set\x20session-level\x20context','log','Session\x20llm_project\x20set\x20to:\x20','displayWithSources','profile','debug','session','use','\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','length','Invalid\x20resource:\x20','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','llm_project','1050207eqeoUD','toString','database','(session:\x20','Session\x20parent_segment\x20set\x20to:\x20','error','Session\x20database\x20set\x20to:\x20','Session\x20engage_workspace\x20set\x20to:\x20'];a40_0x21b4=function(){return _0x7c3add;};return a40_0x21b4();}export class UseCommand extends BaseCommand{['name']=a40_0x256c5d(0xd5);[a40_0x256c5d(0xf4)]=a40_0x256c5d(0xfd);[a40_0x256c5d(0xfc)](_0x344b31){const _0x577015=a40_0x256c5d,{args:_0x1ec5a2}=_0x344b31;if(_0x1ec5a2[_0x577015(0xd7)]===0x0)return undefined;if(_0x1ec5a2[_0x577015(0xd7)]===0x1)return'Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a'+_0x577015(0xd6)+_0x577015(0xe4)+'\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace\x0a'+'\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options';const _0x2fb3b7=_0x1ec5a2[0x0],_0x5159f4=['database',_0x577015(0xe8),_0x577015(0xda),_0x577015(0xd2),'engage_workspace'];if(!_0x5159f4[_0x577015(0xf7)](_0x2fb3b7))return _0x577015(0xd8)+_0x2fb3b7+_0x577015(0xe9)+_0x5159f4[_0x577015(0xf3)](',\x20');return undefined;}async[a40_0x256c5d(0xec)](_0x306dc0){const _0x3a2f51=a40_0x256c5d,{args:_0x270331,options:_0x54d1c5}=_0x306dc0,_0x2ecdfd=_0x54d1c5[_0x3a2f51(0xd3)],_0xc8264=_0x54d1c5['clear'];cleanExpiredSessions();try{if(_0xc8264){clearSessionContext(_0x54d1c5[_0x3a2f51(0xd4)]);const _0x8f8b55=_0x54d1c5['session']||getCurrentSessionPID()[_0x3a2f51(0xdc)]();return console[_0x3a2f51(0xfe)]('Session\x20context\x20'+a40_0x371e4a[_0x3a2f51(0xf9)](_0x3a2f51(0xed))+'\x20'+a40_0x371e4a[_0x3a2f51(0xfa)]('(session:\x20'+_0x8f8b55+')')),0x0;}if(_0x270331[_0x3a2f51(0xd7)]===0x0){const _0x521ed5=new GlobalContext(_0x54d1c5);return _0x2ecdfd?_0x521ed5[_0x3a2f51(0xd1)]():_0x521ed5['display'](),console['log'](a40_0x371e4a[_0x3a2f51(0xfa)]('\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>')),console['log'](a40_0x371e4a[_0x3a2f51(0xfa)]('Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace')),0x0;}const _0x1bbbcf=_0x270331[0x0],_0x1d9c2a=_0x270331[0x1];if(_0x1bbbcf===_0x3a2f51(0xd2)){if(!profileExists(_0x1d9c2a))return console[_0x3a2f51(0xe0)](_0x3a2f51(0xe6)+_0x1d9c2a+_0x3a2f51(0xeb)),console[_0x3a2f51(0xe0)]('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x334f0b=_0x54d1c5[_0x3a2f51(0xd4)]||getCurrentSessionPID()[_0x3a2f51(0xdc)]();return saveSessionContext({'profile':_0x1d9c2a},_0x54d1c5[_0x3a2f51(0xd4)]),console[_0x3a2f51(0xfe)](_0x3a2f51(0xf5)+a40_0x371e4a['green'](_0x1d9c2a)+'\x20'+a40_0x371e4a[_0x3a2f51(0xfa)](_0x3a2f51(0xde)+_0x334f0b+')')),console[_0x3a2f51(0xfe)](a40_0x371e4a[_0x3a2f51(0xfa)](_0x3a2f51(0xd9))),0x0;}const _0x1e4d27={},_0x165133=_0x54d1c5['session']||getCurrentSessionPID()[_0x3a2f51(0xdc)]();switch(_0x1bbbcf){case _0x3a2f51(0xdd):_0x1e4d27[_0x3a2f51(0xdd)]=_0x1d9c2a,console[_0x3a2f51(0xfe)](_0x3a2f51(0xe1)+a40_0x371e4a[_0x3a2f51(0xf9)](_0x1d9c2a)+'\x20'+a40_0x371e4a['dim'](_0x3a2f51(0xde)+_0x165133+')'));break;case _0x3a2f51(0xe8):_0x1e4d27['parent_segment']=_0x1d9c2a,console[_0x3a2f51(0xfe)](_0x3a2f51(0xdf)+a40_0x371e4a['green'](_0x1d9c2a)+'\x20'+a40_0x371e4a['dim']('(session:\x20'+_0x165133+')'));break;case _0x3a2f51(0xda):_0x1e4d27[_0x3a2f51(0xda)]=_0x1d9c2a,console[_0x3a2f51(0xfe)](_0x3a2f51(0xd0)+a40_0x371e4a[_0x3a2f51(0xf9)](_0x1d9c2a)+'\x20'+a40_0x371e4a[_0x3a2f51(0xfa)](_0x3a2f51(0xde)+_0x165133+')'));break;case _0x3a2f51(0xe7):_0x1e4d27['engage_workspace']=_0x1d9c2a,console[_0x3a2f51(0xfe)](_0x3a2f51(0xe2)+a40_0x371e4a[_0x3a2f51(0xf9)](_0x1d9c2a)+'\x20'+a40_0x371e4a[_0x3a2f51(0xfa)]('(session:\x20'+_0x165133+')'));break;}return saveSessionContext(_0x1e4d27,_0x54d1c5[_0x3a2f51(0xd4)]),console[_0x3a2f51(0xfe)](a40_0x371e4a['dim'](_0x3a2f51(0xd9))),0x0;}catch(_0x5ce6a8){return _0x5ce6a8 instanceof Error&&console[_0x3a2f51(0xe0)](_0x3a2f51(0xe3)+_0x5ce6a8[_0x3a2f51(0xf6)]),0x1;}}}
1
+ const a40_0x11cf41=a40_0x2740;(function(_0x2d84e7,_0x30a9c8){const _0x32d780=a40_0x2740,_0x5d771f=_0x2d84e7();while(!![]){try{const _0x3052b9=parseInt(_0x32d780(0x136))/0x1+-parseInt(_0x32d780(0x141))/0x2+-parseInt(_0x32d780(0x137))/0x3+parseInt(_0x32d780(0x12d))/0x4+-parseInt(_0x32d780(0x131))/0x5*(-parseInt(_0x32d780(0x130))/0x6)+parseInt(_0x32d780(0x12f))/0x7*(-parseInt(_0x32d780(0x12c))/0x8)+parseInt(_0x32d780(0x128))/0x9*(-parseInt(_0x32d780(0x143))/0xa);if(_0x3052b9===_0x30a9c8)break;else _0x5d771f['push'](_0x5d771f['shift']());}catch(_0x293901){_0x5d771f['push'](_0x5d771f['shift']());}}}(a40_0x3a89,0x32238));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists}from'../core/profile.js';function a40_0x3a89(){const _0x17f919=['Session\x20llm_project\x20set\x20to:\x20','toString','error','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','(session:\x20','database','cleared','Session\x20database\x20set\x20to:\x20','green','9xozBLb','engage_workspace','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace','Session\x20parent_segment\x20set\x20to:\x20','250040CDsNnv','726484jBFbdj','.\x20Must\x20be\x20one\x20of:\x20','7aDaLLM','18WkwsWH','267440lcrKrj','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','dim','execute','llm_project','341316LfRlWy','159987aTiSUX','displayWithSources','validate','Session\x20engage_workspace\x20set\x20to:\x20','Error:\x20','Session\x20context\x20','Invalid\x20resource:\x20','Session\x20profile\x20set\x20to:\x20','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','description','23876gCVadW','session','3815110YILpwy','includes','clear','log','Set\x20session-level\x20context','length','debug','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','\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','parent_segment','name'];a40_0x3a89=function(){return _0x17f919;};return a40_0x3a89();}import{GlobalContext}from'../core/global-context.js';function a40_0x2740(_0x4090e2,_0x5110c4){_0x4090e2=_0x4090e2-0x125;const _0x3a8953=a40_0x3a89();let _0x274066=_0x3a8953[_0x4090e2];return _0x274066;}import a40_0x52ddde from'chalk';export class UseCommand extends BaseCommand{[a40_0x11cf41(0x14e)]='use';[a40_0x11cf41(0x140)]=a40_0x11cf41(0x147);[a40_0x11cf41(0x139)](_0x4a9822){const _0x308ac7=a40_0x11cf41,{args:_0x411333}=_0x4a9822;if(_0x411333[_0x308ac7(0x148)]===0x0)return undefined;if(_0x411333[_0x308ac7(0x148)]===0x1)return _0x308ac7(0x14a)+_0x308ac7(0x14c)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a'+'\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace\x0a'+_0x308ac7(0x13f);const _0x32df1b=_0x411333[0x0],_0x28d01f=[_0x308ac7(0x154),_0x308ac7(0x14d),_0x308ac7(0x135),'profile',_0x308ac7(0x129)];if(!_0x28d01f[_0x308ac7(0x144)](_0x32df1b))return _0x308ac7(0x13d)+_0x32df1b+_0x308ac7(0x12e)+_0x28d01f['join'](',\x20');return undefined;}async[a40_0x11cf41(0x134)](_0x173f98){const _0x53a669=a40_0x11cf41,{args:_0x4f060e,options:_0x14a63d}=_0x173f98,_0x388278=_0x14a63d[_0x53a669(0x149)],_0x38f799=_0x14a63d[_0x53a669(0x145)];cleanExpiredSessions();try{if(_0x38f799){clearSessionContext(_0x14a63d[_0x53a669(0x142)]);const _0x15241c=_0x14a63d[_0x53a669(0x142)]||getCurrentSessionPID()[_0x53a669(0x150)]();return console[_0x53a669(0x146)](_0x53a669(0x13c)+a40_0x52ddde[_0x53a669(0x127)](_0x53a669(0x125))+'\x20'+a40_0x52ddde['dim'](_0x53a669(0x153)+_0x15241c+')')),0x0;}if(_0x4f060e[_0x53a669(0x148)]===0x0){const _0x10904f=new GlobalContext(_0x14a63d);return _0x388278?_0x10904f[_0x53a669(0x138)]():_0x10904f['display'](),console['log'](a40_0x52ddde[_0x53a669(0x133)](_0x53a669(0x14b))),console[_0x53a669(0x146)](a40_0x52ddde[_0x53a669(0x133)](_0x53a669(0x12a))),0x0;}const _0x27021f=_0x4f060e[0x0],_0x2c7116=_0x4f060e[0x1];if(_0x27021f==='profile'){if(!profileExists(_0x2c7116))return console[_0x53a669(0x151)]('Error:\x20Profile\x20\x27'+_0x2c7116+'\x27\x20does\x20not\x20exist'),console['error'](_0x53a669(0x152)),0x1;const _0x3c60c7=_0x14a63d['session']||getCurrentSessionPID()[_0x53a669(0x150)]();return saveSessionContext({'profile':_0x2c7116},_0x14a63d[_0x53a669(0x142)]),console[_0x53a669(0x146)](_0x53a669(0x13e)+a40_0x52ddde['green'](_0x2c7116)+'\x20'+a40_0x52ddde[_0x53a669(0x133)](_0x53a669(0x153)+_0x3c60c7+')')),console[_0x53a669(0x146)](a40_0x52ddde[_0x53a669(0x133)](_0x53a669(0x132))),0x0;}const _0x17a117={},_0x2286b5=_0x14a63d[_0x53a669(0x142)]||getCurrentSessionPID()[_0x53a669(0x150)]();switch(_0x27021f){case _0x53a669(0x154):_0x17a117[_0x53a669(0x154)]=_0x2c7116,console[_0x53a669(0x146)](_0x53a669(0x126)+a40_0x52ddde[_0x53a669(0x127)](_0x2c7116)+'\x20'+a40_0x52ddde[_0x53a669(0x133)](_0x53a669(0x153)+_0x2286b5+')'));break;case _0x53a669(0x14d):_0x17a117['parent_segment']=_0x2c7116,console['log'](_0x53a669(0x12b)+a40_0x52ddde[_0x53a669(0x127)](_0x2c7116)+'\x20'+a40_0x52ddde['dim'](_0x53a669(0x153)+_0x2286b5+')'));break;case _0x53a669(0x135):_0x17a117['llm_project']=_0x2c7116,console[_0x53a669(0x146)](_0x53a669(0x14f)+a40_0x52ddde['green'](_0x2c7116)+'\x20'+a40_0x52ddde['dim']('(session:\x20'+_0x2286b5+')'));break;case _0x53a669(0x129):_0x17a117[_0x53a669(0x129)]=_0x2c7116,console[_0x53a669(0x146)](_0x53a669(0x13a)+a40_0x52ddde['green'](_0x2c7116)+'\x20'+a40_0x52ddde[_0x53a669(0x133)](_0x53a669(0x153)+_0x2286b5+')'));break;}return saveSessionContext(_0x17a117,_0x14a63d[_0x53a669(0x142)]),console['log'](a40_0x52ddde['dim'](_0x53a669(0x132))),0x0;}catch(_0x176c0b){return _0x176c0b instanceof Error&&console[_0x53a669(0x151)](_0x53a669(0x13b)+_0x176c0b['message']),0x1;}}}
@@ -1 +1 @@
1
- function a41_0x350a(_0x99d23d,_0x5a80c2){_0x99d23d=_0x99d23d-0x174;const _0x57bb3d=a41_0x57bb();let _0x350a1c=_0x57bb3d[_0x99d23d];return _0x350a1c;}const a41_0x599ba9=a41_0x350a;(function(_0x2d7de4,_0x3e828c){const _0xba9dd3=a41_0x350a,_0x19582c=_0x2d7de4();while(!![]){try{const _0x574fdb=-parseInt(_0xba9dd3(0x18c))/0x1*(parseInt(_0xba9dd3(0x188))/0x2)+-parseInt(_0xba9dd3(0x184))/0x3+-parseInt(_0xba9dd3(0x176))/0x4*(-parseInt(_0xba9dd3(0x17f))/0x5)+parseInt(_0xba9dd3(0x177))/0x6*(-parseInt(_0xba9dd3(0x180))/0x7)+-parseInt(_0xba9dd3(0x18e))/0x8*(parseInt(_0xba9dd3(0x179))/0x9)+-parseInt(_0xba9dd3(0x182))/0xa*(-parseInt(_0xba9dd3(0x181))/0xb)+parseInt(_0xba9dd3(0x186))/0xc;if(_0x574fdb===_0x3e828c)break;else _0x19582c['push'](_0x19582c['shift']());}catch(_0x4d8387){_0x19582c['push'](_0x19582c['shift']());}}}(a41_0x57bb,0x5e940));function a41_0x57bb(){const _0x12b877=['data','error','\x20\x20Cause:\x20','Fetching\x20user\x20info...','3025485REGLnN','443401RHzBdU','11Mzcrrg','5988830jroBuc','length','1802856bhYPHw','cause','15662916AQNMmM','Listing\x20users...','1414hvkUDE','name','verbose','user','917wxIbna','getCurrent','5460248oefZex','\x20user','✔\x20Found\x20','message','execute','description','4MXbZEr','18hXWvai','List\x20all\x20users\x20in\x20the\x20account','9RJLify','Error:\x20'];a41_0x57bb=function(){return _0x12b877;};return a41_0x57bb();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class UserCommand extends BaseCommand{['name']='user';[a41_0x599ba9(0x175)]='Show\x20current\x20user\x20information';async[a41_0x599ba9(0x174)](_0x256a1c){const _0x3a330b=a41_0x599ba9,{options:_0x48bbd4,tdx:_0x4161dd}=_0x256a1c;try{const _0x342db5=await withSpinner(_0x3a330b(0x17e),()=>_0x4161dd[_0x3a330b(0x18b)][_0x3a330b(0x18d)](),{'verbose':_0x48bbd4[_0x3a330b(0x18a)]}),_0x35dc5a=_0x342db5['data'];return await handleSingleObjectOutput(_0x35dc5a,_0x48bbd4),0x0;}catch(_0x176ed1){if(_0x176ed1 instanceof SDKError)return console['error'](_0x3a330b(0x17a)+_0x176ed1[_0x3a330b(0x191)]),_0x176ed1['cause']&&console[_0x3a330b(0x17c)](_0x3a330b(0x17d)+_0x176ed1[_0x3a330b(0x185)]),0x1;throw _0x176ed1;}}}export class UserListCommand extends BaseCommand{[a41_0x599ba9(0x189)]='user\x20list';[a41_0x599ba9(0x175)]=a41_0x599ba9(0x178);async[a41_0x599ba9(0x174)](_0x32bbce){const _0x4cb8b4=a41_0x599ba9,{options:_0x2b3fb1,tdx:_0x22262d}=_0x32bbce;try{const _0x1cd67c=await withSpinner(_0x4cb8b4(0x187),()=>_0x22262d[_0x4cb8b4(0x18b)]['list'](),{'verbose':_0x2b3fb1[_0x4cb8b4(0x18a)]}),_0x5b4ce5=_0x1cd67c[_0x4cb8b4(0x17b)];return console[_0x4cb8b4(0x17c)](_0x4cb8b4(0x190)+_0x5b4ce5['length']+_0x4cb8b4(0x18f)+(_0x5b4ce5[_0x4cb8b4(0x183)]!==0x1?'s':'')),await handleSDKOutput(_0x5b4ce5,_0x2b3fb1),0x0;}catch(_0x5d6612){if(_0x5d6612 instanceof SDKError)return console[_0x4cb8b4(0x17c)](_0x4cb8b4(0x17a)+_0x5d6612[_0x4cb8b4(0x191)]),_0x5d6612[_0x4cb8b4(0x185)]&&console['error'](_0x4cb8b4(0x17d)+_0x5d6612['cause']),0x1;throw _0x5d6612;}}}
1
+ const a41_0x2d75ce=a41_0x207c;(function(_0x18fb97,_0x5268a1){const _0x1ee3ff=a41_0x207c,_0x5384df=_0x18fb97();while(!![]){try{const _0x28ffe0=parseInt(_0x1ee3ff(0x88))/0x1*(-parseInt(_0x1ee3ff(0x97))/0x2)+parseInt(_0x1ee3ff(0x8f))/0x3+parseInt(_0x1ee3ff(0x85))/0x4+parseInt(_0x1ee3ff(0x89))/0x5+parseInt(_0x1ee3ff(0x91))/0x6+parseInt(_0x1ee3ff(0x99))/0x7*(parseInt(_0x1ee3ff(0x87))/0x8)+-parseInt(_0x1ee3ff(0x93))/0x9;if(_0x28ffe0===_0x5268a1)break;else _0x5384df['push'](_0x5384df['shift']());}catch(_0x2318b8){_0x5384df['push'](_0x5384df['shift']());}}}(a41_0x56f1,0xc75a6));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a41_0x207c(_0x1162a4,_0x436543){_0x1162a4=_0x1162a4-0x82;const _0x56f1e3=a41_0x56f1();let _0x207c8d=_0x56f1e3[_0x1162a4];return _0x207c8d;}import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';function a41_0x56f1(){const _0x4cf161=['114112NfZiVi','2LRSHSR','4524035bReLaL','List\x20all\x20users\x20in\x20the\x20account','error','✔\x20Found\x20','\x20\x20Cause:\x20','description','1908507wrVwQf','user','2715264pOiARv','data','29631195saJWsL','length','verbose','user\x20list','375434BzPRda','Error:\x20','644knCzrd','name','execute','message','Listing\x20users...','Show\x20current\x20user\x20information','4714124MBjYvI','cause'];a41_0x56f1=function(){return _0x4cf161;};return a41_0x56f1();}import{withSpinner}from'../utils/spinner.js';export class UserCommand extends BaseCommand{[a41_0x2d75ce(0x9a)]='user';[a41_0x2d75ce(0x8e)]=a41_0x2d75ce(0x84);async[a41_0x2d75ce(0x9b)](_0x1d24c2){const _0x43ebfb=a41_0x2d75ce,{options:_0x305053,tdx:_0x204cba}=_0x1d24c2;try{const _0x4db13d=await withSpinner('Fetching\x20user\x20info...',()=>_0x204cba[_0x43ebfb(0x90)]['getCurrent'](),{'verbose':_0x305053[_0x43ebfb(0x95)]}),_0x28111a=_0x4db13d[_0x43ebfb(0x92)];return await handleSingleObjectOutput(_0x28111a,_0x305053),0x0;}catch(_0x5990db){if(_0x5990db instanceof SDKError)return console[_0x43ebfb(0x8b)]('Error:\x20'+_0x5990db[_0x43ebfb(0x82)]),_0x5990db[_0x43ebfb(0x86)]&&console[_0x43ebfb(0x8b)](_0x43ebfb(0x8d)+_0x5990db[_0x43ebfb(0x86)]),0x1;throw _0x5990db;}}}export class UserListCommand extends BaseCommand{[a41_0x2d75ce(0x9a)]=a41_0x2d75ce(0x96);[a41_0x2d75ce(0x8e)]=a41_0x2d75ce(0x8a);async[a41_0x2d75ce(0x9b)](_0x4df1a0){const _0x36052f=a41_0x2d75ce,{options:_0x3985a0,tdx:_0x296588}=_0x4df1a0;try{const _0x3420da=await withSpinner(_0x36052f(0x83),()=>_0x296588[_0x36052f(0x90)]['list'](),{'verbose':_0x3985a0[_0x36052f(0x95)]}),_0x6dc245=_0x3420da[_0x36052f(0x92)];return console[_0x36052f(0x8b)](_0x36052f(0x8c)+_0x6dc245['length']+'\x20user'+(_0x6dc245[_0x36052f(0x94)]!==0x1?'s':'')),await handleSDKOutput(_0x6dc245,_0x3985a0),0x0;}catch(_0x371c33){if(_0x371c33 instanceof SDKError)return console['error'](_0x36052f(0x98)+_0x371c33[_0x36052f(0x82)]),_0x371c33['cause']&&console[_0x36052f(0x8b)](_0x36052f(0x8d)+_0x371c33['cause']),0x1;throw _0x371c33;}}}
@@ -1 +1 @@
1
- const a42_0x156904=a42_0x1e46;(function(_0xe7ed5b,_0xf6eb17){const _0x5b8b08=a42_0x1e46,_0x3b0b7e=_0xe7ed5b();while(!![]){try{const _0x1136be=parseInt(_0x5b8b08(0x10c))/0x1+-parseInt(_0x5b8b08(0x144))/0x2*(-parseInt(_0x5b8b08(0x11a))/0x3)+-parseInt(_0x5b8b08(0x164))/0x4+-parseInt(_0x5b8b08(0x141))/0x5*(parseInt(_0x5b8b08(0x114))/0x6)+parseInt(_0x5b8b08(0x159))/0x7*(parseInt(_0x5b8b08(0x11c))/0x8)+-parseInt(_0x5b8b08(0x11f))/0x9*(-parseInt(_0x5b8b08(0x130))/0xa)+-parseInt(_0x5b8b08(0x146))/0xb;if(_0x1136be===_0xf6eb17)break;else _0x3b0b7e['push'](_0x3b0b7e['shift']());}catch(_0x507c9f){_0x3b0b7e['push'](_0x3b0b7e['shift']());}}}(a42_0x21bc,0x1c78b));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{formatBytes}from'../utils/formatters.js';import a42_0x4a61c9 from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a42_0x156904(0x16e)]='workflow:projects';[a42_0x156904(0xe6)]='List\x20all\x20workflow\x20projects';async[a42_0x156904(0xee)](_0x57aff0){const _0x5093ec=a42_0x156904,{options:_0x3ac4ee,args:_0x324958,tdx:_0x215dac}=_0x57aff0,_0x1a7ce6=_0x324958[0x0];try{_0x3ac4ee[_0x5093ec(0x142)]&&_0x1a7ce6&&console[_0x5093ec(0x115)](_0x5093ec(0x12f)+_0x1a7ce6);const _0x4a4ad7=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x215dac[_0x5093ec(0xd7)][_0x5093ec(0x112)](_0x1a7ce6,{'limit':_0x3ac4ee[_0x5093ec(0x16b)]}),{'verbose':_0x3ac4ee['verbose']}),_0x35a3e5=_0x4a4ad7[_0x5093ec(0x17c)];return console[_0x5093ec(0x115)]('✔\x20Found\x20'+_0x35a3e5[_0x5093ec(0x178)]+_0x5093ec(0x17b)+(_0x35a3e5[_0x5093ec(0x178)]!==0x1?'s':'')),await handleSDKOutput(_0x35a3e5,_0x3ac4ee),0x0;}catch(_0x51edb2){if(_0x51edb2 instanceof SDKError)return console[_0x5093ec(0x115)](_0x5093ec(0xef)+_0x51edb2[_0x5093ec(0x172)]),_0x51edb2[_0x5093ec(0x167)]&&console[_0x5093ec(0x115)](_0x5093ec(0xeb)+_0x51edb2[_0x5093ec(0x167)]),0x1;throw _0x51edb2;}}}function a42_0x1e46(_0x32830b,_0x4576d4){_0x32830b=_0x32830b-0xd7;const _0x21bc15=a42_0x21bc();let _0x1e466a=_0x21bc15[_0x32830b];return _0x1e466a;}export class WorkflowWorkflowsCommand extends BaseCommand{[a42_0x156904(0x16e)]='workflow:workflows';['description']=a42_0x156904(0x162);async[a42_0x156904(0xee)](_0x263b44){const _0x4da715=a42_0x156904,{options:_0x3fae1d,args:_0x2d4cf7,tdx:_0x3c3056}=_0x263b44,_0x2df236=_0x2d4cf7[0x0];try{_0x3fae1d['verbose']&&_0x2df236&&console[_0x4da715(0x115)](_0x4da715(0xe3)+_0x2df236);const _0xfcd6e5=await withSpinner('Listing\x20workflows...',()=>_0x3c3056[_0x4da715(0xd7)]['workflows'](_0x2df236,{'limit':_0x3fae1d['limit']}),{'verbose':_0x3fae1d[_0x4da715(0x142)]}),_0x5ef791=_0xfcd6e5['data'];return console['error'](_0x4da715(0xfa)+_0x5ef791['length']+_0x4da715(0x125)+(_0x5ef791[_0x4da715(0x178)]!==0x1?'s':'')),await handleSDKOutput(_0x5ef791,_0x3fae1d),0x0;}catch(_0x18ff41){if(_0x18ff41 instanceof SDKError)return console[_0x4da715(0x115)](_0x4da715(0xef)+_0x18ff41[_0x4da715(0x172)]),_0x18ff41[_0x4da715(0x167)]&&console['error'](_0x4da715(0xeb)+_0x18ff41[_0x4da715(0x167)]),0x1;throw _0x18ff41;}}}export class WorkflowSessionsCommand extends BaseCommand{[a42_0x156904(0x16e)]=a42_0x156904(0x135);['description']='List\x20workflow\x20execution\x20sessions';async[a42_0x156904(0xee)](_0x4aecbf){const _0x4d2a07=a42_0x156904,{options:_0x5f5635,args:_0x5d7021,tdx:_0x1f97fa}=_0x4aecbf;let _0x23670b,_0x165d1b;if(_0x5d7021[0x0]){const _0x4639b7=_0x5d7021[0x0][_0x4d2a07(0xf1)]('.');if(_0x4639b7[_0x4d2a07(0x178)]===0x1)_0x23670b=_0x4639b7[0x0];else{if(_0x4639b7[_0x4d2a07(0x178)]===0x2)[_0x23670b,_0x165d1b]=_0x4639b7;else return console[_0x4d2a07(0x115)](_0x4d2a07(0x15b)),0x1;}}try{if(_0x5f5635[_0x4d2a07(0x142)]){if(_0x23670b&&_0x165d1b)console[_0x4d2a07(0x115)](_0x4d2a07(0xec)+_0x23670b+'.'+_0x165d1b);else _0x23670b&&console['error'](_0x4d2a07(0x10a)+_0x23670b);const _0x3184b0=_0x5f5635[_0x4d2a07(0x15d)];_0x3184b0&&console[_0x4d2a07(0x115)](_0x4d2a07(0x111)+_0x3184b0);}const _0x2993d7=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x1f97fa[_0x4d2a07(0xd7)][_0x4d2a07(0x15e)]({'projectName':_0x23670b,'workflowName':_0x165d1b,'status':_0x5f5635[_0x4d2a07(0x15d)],'fromTime':_0x5f5635['from'],'toTime':_0x5f5635['to'],'limit':_0x5f5635[_0x4d2a07(0x16b)]}),{'verbose':_0x5f5635[_0x4d2a07(0x142)]}),_0x5df41f=_0x2993d7['data'];return console['error'](_0x4d2a07(0xfa)+_0x5df41f['length']+_0x4d2a07(0xda)+(_0x5df41f['length']!==0x1?'s':'')),await handleSDKOutput(_0x5df41f,_0x5f5635),0x0;}catch(_0x3a0b72){if(_0x3a0b72 instanceof SDKError)return console[_0x4d2a07(0x115)]('Error:\x20'+_0x3a0b72['message']),_0x3a0b72['cause']&&console[_0x4d2a07(0x115)](_0x4d2a07(0xeb)+_0x3a0b72[_0x4d2a07(0x167)]),0x1;throw _0x3a0b72;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a42_0x156904(0x16e)]='workflow:attempts';['description']='List\x20workflow\x20attempts';async[a42_0x156904(0xee)](_0x4a50ce){const _0x20fdeb=a42_0x156904,{options:_0x355961,args:_0x42f742,tdx:_0x16bda7}=_0x4a50ce;let _0x3baae9,_0xed6e13;if(_0x42f742[0x0]){const _0x2ce0bb=_0x42f742[0x0]['split']('.');if(_0x2ce0bb[_0x20fdeb(0x178)]===0x1)_0x3baae9=_0x2ce0bb[0x0];else{if(_0x2ce0bb[_0x20fdeb(0x178)]===0x2)[_0x3baae9,_0xed6e13]=_0x2ce0bb;else return console[_0x20fdeb(0x115)](_0x20fdeb(0x15b)),0x1;}}try{const _0x1d1f75=_0x355961[_0x20fdeb(0x145)];if(_0x355961[_0x20fdeb(0x142)]){if(_0x3baae9&&_0xed6e13)console[_0x20fdeb(0x115)](_0x20fdeb(0xec)+_0x3baae9+'.'+_0xed6e13);else _0x3baae9&&console['error']('Filter:\x20project='+_0x3baae9);_0x1d1f75&&console[_0x20fdeb(0x115)](_0x20fdeb(0x166));}const _0x4c76a5=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x16bda7['workflow'][_0x20fdeb(0xfd)]({'projectName':_0x3baae9,'workflowName':_0xed6e13,'includeRetried':_0x1d1f75,'limit':_0x355961[_0x20fdeb(0x16b)]}),{'verbose':_0x355961['verbose']}),_0x3bb4e8=_0x4c76a5[_0x20fdeb(0x17c)];return console[_0x20fdeb(0x115)](_0x20fdeb(0xfa)+_0x3bb4e8[_0x20fdeb(0x178)]+_0x20fdeb(0x156)+(_0x3bb4e8[_0x20fdeb(0x178)]!==0x1?'s':'')),await handleSDKOutput(_0x3bb4e8,_0x355961),0x0;}catch(_0x4c50a7){if(_0x4c50a7 instanceof SDKError)return console[_0x20fdeb(0x115)](_0x20fdeb(0xef)+_0x4c50a7[_0x20fdeb(0x172)]),_0x4c50a7[_0x20fdeb(0x167)]&&console[_0x20fdeb(0x115)](_0x20fdeb(0xeb)+_0x4c50a7[_0x20fdeb(0x167)]),0x1;throw _0x4c50a7;}}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a42_0x156904(0x132);[a42_0x156904(0xe6)]=a42_0x156904(0x13e);async[a42_0x156904(0xee)](_0x4727df){const _0x5c8c46=a42_0x156904,{options:_0x39bc3a,args:_0x2b3be0,tdx:_0x2efed2}=_0x4727df,_0x83b2a8=_0x2b3be0[0x0];if(!_0x83b2a8)return console[_0x5c8c46(0x115)](_0x5c8c46(0x10f)),0x1;try{_0x39bc3a[_0x5c8c46(0x142)]&&console[_0x5c8c46(0x115)](_0x5c8c46(0x173)+_0x83b2a8);const _0x15bcfc=await withSpinner(_0x5c8c46(0x109),()=>_0x2efed2['workflow'][_0x5c8c46(0xf4)](_0x83b2a8),{'verbose':_0x39bc3a[_0x5c8c46(0x142)]}),_0x31dfbc=_0x15bcfc[_0x5c8c46(0x17c)];let _0x41109d;!_0x31dfbc[_0x5c8c46(0x151)]?_0x41109d=_0x31dfbc[_0x5c8c46(0xed)]?_0x5c8c46(0x119):_0x5c8c46(0x17a):_0x41109d=_0x31dfbc[_0x5c8c46(0x14a)]?_0x5c8c46(0x14a):_0x5c8c46(0x115);let _0x4af5cd;if(_0x31dfbc[_0x5c8c46(0x11b)]&&_0x31dfbc[_0x5c8c46(0x129)]){const _0x51053b=new Date(_0x31dfbc[_0x5c8c46(0x11b)])['getTime'](),_0x3f7539=new Date(_0x31dfbc['finishedAt'])[_0x5c8c46(0x137)]();_0x4af5cd=Math[_0x5c8c46(0x16f)]((_0x3f7539-_0x51053b)/0x3e8);}const _0x116645={'attempt_id':_0x31dfbc['id'],'status':_0x41109d,..._0x31dfbc[_0x5c8c46(0x12c)]!==undefined&&{'index':_0x31dfbc['index']},..._0x31dfbc[_0x5c8c46(0x100)]&&{'project':_0x31dfbc[_0x5c8c46(0x100)][_0x5c8c46(0x16e)]},..._0x31dfbc['workflow']&&{'workflow':_0x31dfbc['workflow'][_0x5c8c46(0x16e)]},..._0x31dfbc['sessionId']&&{'session_id':_0x31dfbc[_0x5c8c46(0x179)]},..._0x31dfbc['sessionTime']&&{'session_time':_0x31dfbc[_0x5c8c46(0xe5)]},..._0x31dfbc[_0x5c8c46(0xfc)]&&{'retry_attempt':_0x31dfbc[_0x5c8c46(0xfc)]},..._0x4af5cd!==undefined&&{'duration_sec':_0x4af5cd},..._0x31dfbc[_0x5c8c46(0x11b)]&&{'created_at':_0x31dfbc[_0x5c8c46(0x11b)]},..._0x31dfbc[_0x5c8c46(0x129)]&&{'finished_at':_0x31dfbc[_0x5c8c46(0x129)]},...Object[_0x5c8c46(0x148)](_0x31dfbc[_0x5c8c46(0x150)])[_0x5c8c46(0x178)]>0x0&&{'params':_0x31dfbc['params']}};return await handleSingleObjectOutput(_0x116645,_0x39bc3a),0x0;}catch(_0x3014cb){if(_0x3014cb instanceof SDKError)return console['error'](_0x5c8c46(0xef)+_0x3014cb[_0x5c8c46(0x172)]),_0x3014cb['cause']&&console[_0x5c8c46(0x115)](_0x5c8c46(0xeb)+_0x3014cb[_0x5c8c46(0x167)]),0x1;throw _0x3014cb;}}}export class WorkflowTasksCommand extends BaseCommand{['name']='workflow:tasks';[a42_0x156904(0xe6)]=a42_0x156904(0x128);async[a42_0x156904(0xee)](_0x525465){const _0xc1c97e=a42_0x156904,{options:_0x514b3b,args:_0x14ec59,tdx:_0x4bc769}=_0x525465,_0x2e2f74=_0x14ec59[0x0];if(!_0x2e2f74)return console[_0xc1c97e(0x115)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x7805c6=_0x514b3b[_0xc1c97e(0xf0)];_0x514b3b[_0xc1c97e(0x142)]&&(console[_0xc1c97e(0x115)](_0xc1c97e(0x173)+_0x2e2f74),_0x7805c6&&console[_0xc1c97e(0x115)]('Including\x20subtasks:\x20yes'));const _0x4e6227=await withSpinner(_0xc1c97e(0x176),()=>_0x4bc769[_0xc1c97e(0xd7)][_0xc1c97e(0x113)](_0x2e2f74,_0x7805c6||![]),{'verbose':_0x514b3b[_0xc1c97e(0x142)]}),_0x29b7b7=_0x4e6227[_0xc1c97e(0x17c)];return console[_0xc1c97e(0x115)](_0xc1c97e(0xfa)+_0x29b7b7[_0xc1c97e(0x178)]+_0xc1c97e(0xff)+(_0x29b7b7[_0xc1c97e(0x178)]!==0x1?'s':'')),await handleSDKOutput(_0x29b7b7,_0x514b3b),0x0;}catch(_0x6d3d5f){if(_0x6d3d5f instanceof SDKError)return console[_0xc1c97e(0x115)]('Error:\x20'+_0x6d3d5f['message']),_0x6d3d5f[_0xc1c97e(0x167)]&&console['error'](_0xc1c97e(0xeb)+_0x6d3d5f[_0xc1c97e(0x167)]),0x1;throw _0x6d3d5f;}}}export class WorkflowLogsCommand extends BaseCommand{[a42_0x156904(0x16e)]=a42_0x156904(0x157);[a42_0x156904(0xe6)]=a42_0x156904(0x160);async[a42_0x156904(0xee)](_0x489160){const _0x38ab2e=a42_0x156904,{options:_0x5b486f,args:_0x11f0f9,tdx:_0x4fd6e6}=_0x489160,_0x37d896=_0x11f0f9[0x0];let _0xc2f30b=_0x11f0f9[0x1];if(!_0x37d896)return console[_0x38ab2e(0x115)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{_0x5b486f[_0x38ab2e(0x142)]&&(console['error']('Attempt\x20ID:\x20'+_0x37d896),_0xc2f30b&&console[_0x38ab2e(0x115)](_0x38ab2e(0x118)+_0xc2f30b));const _0x338697=await withSpinner(_0x38ab2e(0x131),()=>_0x4fd6e6['workflow'][_0x38ab2e(0x121)](_0x37d896,_0xc2f30b),{'verbose':_0x5b486f[_0x38ab2e(0x142)]}),_0x5cfaac=_0x338697[_0x38ab2e(0x17c)];if(_0x5cfaac[_0x38ab2e(0x178)]===0x0)return console[_0x38ab2e(0x115)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0xc2f30b&&(_0x5b486f[_0x38ab2e(0x16d)]||_0x5b486f[_0x38ab2e(0xd8)]))return await handleSDKOutput(_0x5cfaac,_0x5b486f),0x0;if(!_0xc2f30b){const _0x5cd6dd=_0x5cfaac[_0x38ab2e(0x120)](_0x741ee3=>({'title':_0x741ee3['taskName']+'\x20('+formatBytes(_0x741ee3[_0x38ab2e(0x104)])+')','value':_0x741ee3['taskName']})),_0x4de044=await a42_0x4a61c9({'type':_0x38ab2e(0xde),'name':_0x38ab2e(0x14e),'message':_0x38ab2e(0x13c),'choices':_0x5cd6dd});if(!_0x4de044['task'])return console['error'](_0x38ab2e(0x14f)),0x0;_0xc2f30b=_0x4de044[_0x38ab2e(0x14e)];}const _0x2f58e5=await withSpinner(_0x38ab2e(0x165),()=>_0x4fd6e6[_0x38ab2e(0xd7)][_0x38ab2e(0xf7)](_0x37d896,_0xc2f30b),{'verbose':_0x5b486f[_0x38ab2e(0x142)]}),_0x3a963=_0x2f58e5[_0x38ab2e(0x17c)];return _0x3a963?console[_0x38ab2e(0xf2)](_0x3a963):console[_0x38ab2e(0x115)](_0x38ab2e(0x101)),0x0;}catch(_0x4a6364){if(_0x4a6364 instanceof SDKError)return console[_0x38ab2e(0x115)](_0x38ab2e(0xef)+_0x4a6364[_0x38ab2e(0x172)]),_0x4a6364[_0x38ab2e(0x167)]&&console[_0x38ab2e(0x115)]('\x20\x20Cause:\x20'+_0x4a6364['cause']),0x1;throw _0x4a6364;}}}export class WorkflowKillCommand extends BaseCommand{[a42_0x156904(0x16e)]=a42_0x156904(0x10b);[a42_0x156904(0xe6)]='Kill\x20a\x20running\x20attempt';async['execute'](_0x5c1a78){const _0x6912b2=a42_0x156904,{options:_0x273d83,args:_0x4251f8,tdx:_0x58af14}=_0x5c1a78,_0x35f8ea=_0x4251f8[0x0];if(!_0x35f8ea)return console[_0x6912b2(0x115)](_0x6912b2(0x10f)),0x1;try{const _0x397b1d=_0x273d83[_0x6912b2(0x171)];_0x273d83[_0x6912b2(0x142)]&&(console[_0x6912b2(0x115)](_0x6912b2(0x173)+_0x35f8ea),_0x397b1d&&console[_0x6912b2(0x115)](_0x6912b2(0x16c)+_0x397b1d));if(!_0x273d83['yes']){const _0x1c6437=await confirm(_0x6912b2(0x12a)+_0x35f8ea+'?');if(!_0x1c6437)return console[_0x6912b2(0x115)](_0x6912b2(0x14f)),0x0;}const _0x3b46c6=await withSpinner(_0x6912b2(0x134),()=>_0x58af14[_0x6912b2(0xd7)][_0x6912b2(0x14b)](_0x35f8ea,_0x397b1d),{'verbose':_0x273d83[_0x6912b2(0x142)]}),_0x386ab2=_0x3b46c6['data'];return console[_0x6912b2(0x115)]('✔\x20'+_0x386ab2),0x0;}catch(_0x12bfcd){if(_0x12bfcd instanceof SDKError)return console['error']('Error:\x20'+_0x12bfcd[_0x6912b2(0x172)]),_0x12bfcd[_0x6912b2(0x167)]&&console[_0x6912b2(0x115)]('\x20\x20Cause:\x20'+_0x12bfcd[_0x6912b2(0x167)]),0x1;throw _0x12bfcd;}}}export class WorkflowRetryCommand extends BaseCommand{[a42_0x156904(0x16e)]=a42_0x156904(0x14c);['description']=a42_0x156904(0x12e);async['execute'](_0xc9f372){const _0x2820b7=a42_0x156904,{options:_0xc4beed,args:_0x328950,tdx:_0x5cd5c9}=_0xc9f372,_0x2980da=_0x328950[0x0];if(!_0x2980da)return console[_0x2820b7(0x115)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x2820b7(0x115)](_0x2820b7(0x158)),0x1;let _0xad8040=![],_0x186bf1=_0x2980da;if(_0x2980da['startsWith'](_0x2820b7(0x124)))_0xad8040=!![],_0x186bf1=_0x2980da[_0x2820b7(0x13a)](0x8);else{if(_0x2980da[_0x2820b7(0x10d)](_0x2820b7(0xe1)))_0xad8040=![],_0x186bf1=_0x2980da[_0x2820b7(0x13a)](0x8);else return console[_0x2820b7(0x115)](_0x2820b7(0x12b)),console['error'](_0x2820b7(0x158)),0x1;}try{const _0x5138e0=_0xc4beed[_0x2820b7(0x14d)],_0x5f395d=_0xc4beed[_0x2820b7(0x15c)],_0x40c359=_0xc4beed[_0x2820b7(0x150)],_0x7658bb=_0xc4beed[_0x2820b7(0x11e)];_0xc4beed[_0x2820b7(0x142)]&&(console[_0x2820b7(0x115)](_0x2820b7(0x138)+(_0xad8040?'session':_0x2820b7(0xf4))+'\x20'+_0x186bf1),_0x5138e0&&console[_0x2820b7(0x115)]('From\x20task:\x20'+_0x5138e0),_0x5f395d&&console[_0x2820b7(0x115)](_0x2820b7(0x10e)+_0x5f395d),_0x40c359&&console[_0x2820b7(0x115)](_0x2820b7(0xe9)+_0x40c359),_0x7658bb&&console[_0x2820b7(0x115)](_0x2820b7(0x147)));let _0x3a6298;if(_0x40c359)try{if(_0x40c359[_0x2820b7(0x10d)]('@')){const _0x5ef934=await import(_0x2820b7(0x13f)),_0x2b4052=_0x40c359[_0x2820b7(0x13a)](0x1),_0x16db2e=await _0x5ef934[_0x2820b7(0x123)](_0x2b4052,_0x2820b7(0xe0));_0x3a6298=JSON[_0x2820b7(0x13b)](_0x16db2e);}else _0x3a6298=JSON['parse'](_0x40c359);}catch{return console[_0x2820b7(0x115)](_0x2820b7(0x126)),0x1;}if(!_0xc4beed[_0x2820b7(0x122)]){const _0x1de667=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0xad8040?_0x2820b7(0x174):'attempt')+'\x20'+_0x186bf1+'?');if(!_0x1de667)return console['error'](_0x2820b7(0x14f)),0x0;}let _0x190d93;_0xad8040?_0x190d93=await withSpinner('Retrying\x20session...',()=>_0x5cd5c9['workflow'][_0x2820b7(0x106)](_0x186bf1,{'fromTask':_0x5138e0,'retryParams':_0x3a6298}),{'verbose':_0xc4beed[_0x2820b7(0x142)]}):_0x190d93=await withSpinner('Retrying\x20attempt...',()=>_0x5cd5c9[_0x2820b7(0xd7)]['retryAttempt'](_0x186bf1,{'resumeFrom':_0x5f395d,'retryParams':_0x3a6298,'force':_0x7658bb}),{'verbose':_0xc4beed[_0x2820b7(0x142)]});const _0x58af0f=_0x190d93[_0x2820b7(0x17c)];return console['error'](_0x2820b7(0x175)),console[_0x2820b7(0x115)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x58af0f[_0x2820b7(0x110)]),console[_0x2820b7(0x115)]('\x20\x20Session\x20ID:\x20'+_0x58af0f['sessionId']),0x0;}catch(_0x3310d5){if(_0x3310d5 instanceof SDKError)return console[_0x2820b7(0x115)](_0x2820b7(0xef)+_0x3310d5[_0x2820b7(0x172)]),_0x3310d5[_0x2820b7(0x167)]&&console[_0x2820b7(0x115)](_0x2820b7(0xeb)+_0x3310d5[_0x2820b7(0x167)]),0x1;throw _0x3310d5;}}}export class WorkflowRunCommand extends BaseCommand{['name']=a42_0x156904(0x136);[a42_0x156904(0xe6)]='Start\x20a\x20workflow\x20run';async[a42_0x156904(0xee)](_0x4ed008){const _0x1a03c0=a42_0x156904,{options:_0x2b0e11,args:_0x5b5d69,tdx:_0x5c88f0}=_0x4ed008,_0x4b803a=_0x5b5d69[0x0];if(!_0x4b803a)return console[_0x1a03c0(0x115)](_0x1a03c0(0xfe)),console[_0x1a03c0(0x115)]('Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]'),0x1;const _0x3564d4=_0x2b0e11[_0x1a03c0(0xfb)],_0x5a3c41=_0x2b0e11[_0x1a03c0(0xe5)],_0x4a36f0={};if(_0x3564d4&&Array[_0x1a03c0(0x102)](_0x3564d4))for(const _0x512f0f of _0x3564d4){const _0x2e2c76=_0x512f0f[_0x1a03c0(0xe4)]('=');if(_0x2e2c76===-0x1)return console['error'](_0x1a03c0(0x13d)+_0x512f0f),console['error'](_0x1a03c0(0xd9)),0x1;const _0x550674=_0x512f0f[_0x1a03c0(0x13a)](0x0,_0x2e2c76),_0x14465f=_0x512f0f[_0x1a03c0(0x13a)](_0x2e2c76+0x1);try{_0x4a36f0[_0x550674]=JSON['parse'](_0x14465f);}catch{_0x4a36f0[_0x550674]=_0x14465f;}}_0x2b0e11[_0x1a03c0(0x142)]&&(console[_0x1a03c0(0x115)](_0x1a03c0(0xf9)+_0x4b803a),Object[_0x1a03c0(0x148)](_0x4a36f0)[_0x1a03c0(0x178)]>0x0&&console[_0x1a03c0(0x115)]('Parameters:\x20'+JSON[_0x1a03c0(0x133)](_0x4a36f0)),_0x5a3c41&&console[_0x1a03c0(0x115)]('Session\x20time:\x20'+_0x5a3c41));const _0x466e32=await withSpinner(_0x1a03c0(0x15f),()=>_0x5c88f0['workflow'][_0x1a03c0(0xf8)](_0x4b803a,_0x4a36f0,{'sessionTime':_0x5a3c41}),{'verbose':_0x2b0e11['verbose']}),_0x497e55=_0x466e32['data'];return console[_0x1a03c0(0x115)]('✔\x20Workflow\x20run\x20started'),console[_0x1a03c0(0x115)](_0x1a03c0(0x169)+_0x497e55['id']),console[_0x1a03c0(0x115)](_0x1a03c0(0x105)+_0x497e55[_0x1a03c0(0x179)]),console[_0x1a03c0(0x115)](_0x1a03c0(0x127)+_0x497e55['project']?.[_0x1a03c0(0x16e)]),console[_0x1a03c0(0x115)]('\x20\x20Workflow:\x20'+_0x497e55[_0x1a03c0(0xd7)]?.[_0x1a03c0(0x16e)]),0x0;}}function a42_0x21bc(){const _0x46a2e4=['workflow:kill','131258iARuOx','startsWith','Resume\x20from:\x20','Error:\x20Attempt\x20ID\x20is\x20required','attemptId','Status:\x20','projects','tasks','6mSruOA','error','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','\x20\x20Revision:\x20','Task\x20name:\x20','canceling','133674nGoqNF','createdAt','664ZFCEZF','Usage:\x20workflow:delete\x20<project-name-or-id>','force','378vKATZq','map','logFiles','yes','readFile','session:','\x20workflow','Error:\x20Invalid\x20JSON\x20in\x20--params','\x20\x20Project:\x20','Show\x20tasks\x20for\x20an\x20attempt','finishedAt','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','index','skipValidation','Retry\x20a\x20session\x20or\x20attempt','Pattern:\x20','43990nxhdfw','Fetching\x20log\x20files...','workflow:attempt','stringify','Killing\x20attempt...','workflow:sessions','workflow:run','getTime','Target:\x20','projectName','substring','parse','Select\x20a\x20task\x20to\x20view\x20logs:','Error:\x20Invalid\x20parameter\x20format:\x20','Show\x20specific\x20attempt\x20details','fs/promises','✔\x20Pushed\x20','1068265XVXdcy','verbose','revision','4kgneVh','includeRetried','1194402KEFcqh','Force:\x20yes','keys','workflow:push','success','kill','workflow:retry','fromTask','task','Cancelled','params','done','Pushing\x20workflow\x20project...','filesExtracted','Revision:\x20','projectId','\x20attempt','workflow:logs','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','10073jonwfj','Output\x20directory:\x20','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','resumeFrom','status','sessions','Starting\x20workflow\x20run...','Show\x20logs\x20for\x20a\x20workflow\x20attempt','isDirectory','List\x20workflows','✔\x20Downloaded\x20','342860yPZloA','Downloading\x20logs...','Include\x20retried:\x20yes','cause','Validation:\x20skipped','\x20\x20Attempt\x20ID:\x20','✔\x20Deleted\x20project\x20','limit','Reason:\x20','json','name','round','workflow:download','reason','message','Attempt\x20ID:\x20','session','✔\x20Retry\x20started','Getting\x20attempt\x20tasks...','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','length','sessionId','running','\x20project','data','workflow','format','Expected\x20format:\x20--param\x20key=value','\x20session','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Project\x20name:\x20','select','\x20\x20Project\x20ID:\x20','utf-8','attempt:','\x22?\x20This\x20cannot\x20be\x20undone.','Project\x20filter:\x20','indexOf','sessionTime','description','workflow:delete','delete','Params:\x20','Error:\x20Project\x20name\x20is\x20required','\x20\x20Cause:\x20','Filter:\x20','cancelRequested','execute','Error:\x20','includeSubtasks','split','log','stat','attempt','Project:\x20','\x20\x20Location:\x20','logs','run','Workflow:\x20','✔\x20Found\x20','param','retryAttemptName','attempts','Error:\x20Workflow\x20identifier\x20is\x20required','\x20task','project','No\x20log\x20content\x20found','isArray','Project\x20directory:\x20','fileSize','\x20\x20Session\x20ID:\x20','retrySession','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Downloading\x20project\x20','Getting\x20attempt\x20details...','Filter:\x20project='];a42_0x21bc=function(){return _0x46a2e4;};return a42_0x21bc();}export class WorkflowDownloadCommand extends BaseCommand{['name']=a42_0x156904(0x170);[a42_0x156904(0xe6)]=a42_0x156904(0x177);async['execute'](_0x186bb6){const _0x458228=a42_0x156904,{options:_0x217e57,args:_0x1131e3,tdx:_0x26bb66}=_0x186bb6,_0x3345bf=_0x1131e3[0x0],_0x357208=_0x1131e3[0x1]||'.';if(!_0x3345bf)return console[_0x458228(0x115)](_0x458228(0xea)),console[_0x458228(0x115)](_0x458228(0xdb)),0x1;const _0x4fdc9f=_0x217e57[_0x458228(0x143)];_0x217e57[_0x458228(0x142)]&&(console[_0x458228(0x115)](_0x458228(0xf5)+_0x3345bf),console['error'](_0x458228(0x15a)+_0x357208),_0x4fdc9f&&console['error'](_0x458228(0x154)+_0x4fdc9f));const _0x452d24=await withSpinner(_0x458228(0x108)+_0x3345bf+'...',()=>_0x26bb66[_0x458228(0xd7)]['download'](_0x3345bf,_0x357208,{'revision':_0x4fdc9f}),{'verbose':_0x217e57[_0x458228(0x142)]}),_0x17c1c4=_0x452d24[_0x458228(0x17c)];return console[_0x458228(0x115)](_0x458228(0x163)+_0x17c1c4[_0x458228(0x139)]),console[_0x458228(0x115)](_0x458228(0x117)+_0x17c1c4[_0x458228(0x143)]),console[_0x458228(0x115)]('\x20\x20Files\x20extracted:\x20'+_0x17c1c4[_0x458228(0x153)]),console[_0x458228(0x115)](_0x458228(0xf6)+_0x357208+'/'+_0x17c1c4[_0x458228(0x139)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{['name']=a42_0x156904(0x149);[a42_0x156904(0xe6)]=a42_0x156904(0x116);async[a42_0x156904(0xee)](_0x1731d7){const _0xc77304=a42_0x156904,{options:_0x48223d,args:_0x2ac8d7,tdx:_0x440153}=_0x1731d7;let _0x28a560='.',_0x2792d8=_0x48223d[_0xc77304(0x16e)];if(_0x2ac8d7[0x0]){const {promises:_0x1e2150}=await import('fs');try{const _0x48cfa4=await _0x1e2150[_0xc77304(0xf3)](_0x2ac8d7[0x0]);if(_0x48cfa4[_0xc77304(0x161)]())_0x28a560=_0x2ac8d7[0x0];else return console['error'](_0xc77304(0xef)+_0x2ac8d7[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x2792d8=_0x2ac8d7[0x0],_0x28a560='.';}}const _0x39798a=_0x48223d[_0xc77304(0x143)],_0x51d6b6=_0x48223d[_0xc77304(0x12d)];_0x48223d[_0xc77304(0x142)]&&(console[_0xc77304(0x115)](_0xc77304(0x103)+_0x28a560),_0x2792d8&&console[_0xc77304(0x115)](_0xc77304(0xdd)+_0x2792d8),_0x39798a&&console[_0xc77304(0x115)]('Revision:\x20'+_0x39798a),_0x51d6b6&&console[_0xc77304(0x115)](_0xc77304(0x168)));const _0x2185dc=await withSpinner(_0xc77304(0x152),()=>_0x440153[_0xc77304(0xd7)]['push'](_0x28a560,{'projectName':_0x2792d8,'revision':_0x39798a,'skipValidation':_0x51d6b6}),{'verbose':_0x48223d[_0xc77304(0x142)]}),_0x308212=_0x2185dc[_0xc77304(0x17c)];return console[_0xc77304(0x115)](_0xc77304(0x140)+_0x308212[_0xc77304(0x139)]),console['error'](_0xc77304(0xdf)+_0x308212['projectId']),console[_0xc77304(0x115)](_0xc77304(0x117)+_0x308212[_0xc77304(0x143)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a42_0x156904(0x16e)]=a42_0x156904(0xe7);[a42_0x156904(0xe6)]=a42_0x156904(0x107);async[a42_0x156904(0xee)](_0x5d2ca3){const _0x4e969b=a42_0x156904,{options:_0x44270d,args:_0x47bca9,tdx:_0x11e1f3}=_0x5d2ca3,_0x279ee3=_0x47bca9[0x0];if(!_0x279ee3)return console[_0x4e969b(0x115)](_0x4e969b(0xdc)),console[_0x4e969b(0x115)](_0x4e969b(0x11d)),0x1;_0x44270d[_0x4e969b(0x142)]&&console[_0x4e969b(0x115)]('Project:\x20'+_0x279ee3);if(!_0x44270d[_0x4e969b(0x122)]){const _0xf69cab=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x279ee3+_0x4e969b(0xe2));if(!_0xf69cab)return console['error'](_0x4e969b(0x14f)),0x0;}const _0x2051e1=await withSpinner('Deleting\x20project\x20'+_0x279ee3+'...',()=>_0x11e1f3[_0x4e969b(0xd7)][_0x4e969b(0xe8)](_0x279ee3),{'verbose':_0x44270d[_0x4e969b(0x142)]}),_0x213d5f=_0x2051e1[_0x4e969b(0x17c)];return console[_0x4e969b(0x115)](_0x4e969b(0x16a)+_0x213d5f[_0x4e969b(0x139)]),console['error'](_0x4e969b(0xdf)+_0x213d5f[_0x4e969b(0x155)]),0x0;}}
1
+ const a42_0x39f797=a42_0x8e82;(function(_0x3920f7,_0x589d9d){const _0x23c633=a42_0x8e82,_0x50fc2b=_0x3920f7();while(!![]){try{const _0x465694=parseInt(_0x23c633(0x15d))/0x1*(-parseInt(_0x23c633(0x136))/0x2)+parseInt(_0x23c633(0x163))/0x3+-parseInt(_0x23c633(0x162))/0x4+-parseInt(_0x23c633(0x164))/0x5+parseInt(_0x23c633(0x156))/0x6+-parseInt(_0x23c633(0x17f))/0x7+parseInt(_0x23c633(0x1bd))/0x8;if(_0x465694===_0x589d9d)break;else _0x50fc2b['push'](_0x50fc2b['shift']());}catch(_0xd68cfb){_0x50fc2b['push'](_0x50fc2b['shift']());}}}(a42_0x2484,0xc4f08));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a42_0x2484(){const _0x4254f4=['filesExtracted','download','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','task','Error:\x20Invalid\x20JSON\x20in\x20--params','Deleting\x20project\x20','retryAttempt','\x20\x20Project\x20ID:\x20','✔\x20Found\x20','yes','projectName','workflow:retry','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','\x20project','Select\x20a\x20task\x20to\x20view\x20logs:','reason','workflow:sessions','Target:\x20','\x20task','\x20\x20Cause:\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','attempt','length','Listing\x20workflows...','List\x20workflow\x20attempts','workflow:attempt','From\x20task:\x20','workflow:projects','Include\x20retried:\x20yes','canceling','Resume\x20from:\x20','from','cause','Project\x20filter:\x20','map','122TSVTEM','data','List\x20workflows','status','params','Project\x20directory:\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','session','Listing\x20workflow\x20attempts...','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','workflow:tasks','finishedAt','List\x20all\x20workflow\x20projects','Project:\x20','\x20\x20Project:\x20','\x20attempt','sessions','readFile','isDirectory','\x20workflow','\x20\x20Files\x20extracted:\x20','Getting\x20attempt\x20details...','tasks','Project\x20name:\x20','Downloading\x20project\x20','retryAttemptName','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','✔\x20Downloaded\x20','workflow:attempts','Parameters:\x20','workflow:download','Attempt\x20ID:\x20','8028306INUmnF','getTime','keys','push','✔\x20Deleted\x20project\x20','Start\x20a\x20workflow\x20run','limit','4413hLBTIU','Revision:\x20','Listing\x20workflow\x20projects...','Error:\x20Project\x20name\x20is\x20required','workflow','4435172SaSIpU','2982765JBWTPW','5212945ZIWCdF','\x22?\x20This\x20cannot\x20be\x20undone.','Kill\x20a\x20running\x20attempt','Status:\x20','description','utf-8','\x20session','force','success','workflow:kill','Output\x20directory:\x20','Task\x20name:\x20','Retry\x20a\x20session\x20or\x20attempt','param','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','fromTask','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','stringify','\x20\x20Location:\x20','Expected\x20format:\x20--param\x20key=value','\x20\x20Workflow:\x20','resumeFrom','Cancelled','substring','Retrying\x20session...','Listing\x20workflow\x20sessions...','1291465xxdonF','\x20\x20Session\x20ID:\x20','delete','workflow:run','Reason:\x20','taskName','Including\x20subtasks:\x20yes','✔\x20Pushed\x20','sessionTime','split','Killing\x20attempt...','✔\x20Retry\x20started','Validation:\x20skipped','Error:\x20Attempt\x20ID\x20is\x20required','project','Error:\x20','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','startsWith','select','indexOf','retrySession','projects','logFiles','fs/promises','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Filter:\x20project=','workflow:workflows','sessionId','parse','isArray','done','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','round','message','createdAt','index','Pattern:\x20','\x20\x20New\x20attempt\x20ID:\x20','execute','Workflow:\x20','workflow:delete','Session\x20time:\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','verbose','log','attempts','includeSubtasks','fileSize','projectId','Filter:\x20','cancelRequested','format','name','error','stat','No\x20log\x20content\x20found','Force:\x20yes','Retrying\x20attempt...','Show\x20specific\x20attempt\x20details','Fetching\x20log\x20files...','revision','session:','8635424bdNzSo','run','...','Getting\x20attempt\x20tasks...','Starting\x20workflow\x20run...'];a42_0x2484=function(){return _0x4254f4;};return a42_0x2484();}import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a42_0x8e82(_0x4c8d42,_0x53aa68){_0x4c8d42=_0x4c8d42-0x129;const _0x248410=a42_0x2484();let _0x8e82ac=_0x248410[_0x4c8d42];return _0x8e82ac;}import{confirm}from'../utils/prompt.js';import{formatBytes}from'../utils/formatters.js';import a42_0x5bf2b7 from'prompts';export class WorkflowProjectsCommand extends BaseCommand{['name']=a42_0x39f797(0x12e);[a42_0x39f797(0x168)]=a42_0x39f797(0x142);async['execute'](_0x1b4d49){const _0x3d3501=a42_0x39f797,{options:_0x33d8b4,args:_0x4eaf7f,tdx:_0x37d261}=_0x1b4d49,_0x1bb152=_0x4eaf7f[0x0];try{_0x33d8b4[_0x3d3501(0x1aa)]&&_0x1bb152&&console[_0x3d3501(0x1b4)](_0x3d3501(0x1a3)+_0x1bb152);const _0x56f2bf=await withSpinner(_0x3d3501(0x15f),()=>_0x37d261[_0x3d3501(0x161)][_0x3d3501(0x194)](_0x1bb152,{'limit':_0x33d8b4['limit']}),{'verbose':_0x33d8b4['verbose']}),_0x2d3ff0=_0x56f2bf[_0x3d3501(0x137)];return console['error'](_0x3d3501(0x1ca)+_0x2d3ff0['length']+_0x3d3501(0x1cf)+(_0x2d3ff0[_0x3d3501(0x129)]!==0x1?'s':'')),await handleSDKOutput(_0x2d3ff0,_0x33d8b4),0x0;}catch(_0x3220cb){if(_0x3220cb instanceof SDKError)return console['error'](_0x3d3501(0x18e)+_0x3220cb['message']),_0x3220cb[_0x3d3501(0x133)]&&console[_0x3d3501(0x1b4)](_0x3d3501(0x1d5)+_0x3220cb[_0x3d3501(0x133)]),0x1;throw _0x3220cb;}}}export class WorkflowWorkflowsCommand extends BaseCommand{['name']=a42_0x39f797(0x199);[a42_0x39f797(0x168)]=a42_0x39f797(0x138);async[a42_0x39f797(0x1a5)](_0x1de52f){const _0x130f2e=a42_0x39f797,{options:_0x2e4481,args:_0x11b098,tdx:_0x459d0a}=_0x1de52f,_0x39e360=_0x11b098[0x0];try{_0x2e4481[_0x130f2e(0x1aa)]&&_0x39e360&&console[_0x130f2e(0x1b4)](_0x130f2e(0x134)+_0x39e360);const _0x19cd4a=await withSpinner(_0x130f2e(0x12a),()=>_0x459d0a[_0x130f2e(0x161)]['workflows'](_0x39e360,{'limit':_0x2e4481[_0x130f2e(0x15c)]}),{'verbose':_0x2e4481[_0x130f2e(0x1aa)]}),_0x4cfc59=_0x19cd4a[_0x130f2e(0x137)];return console['error'](_0x130f2e(0x1ca)+_0x4cfc59[_0x130f2e(0x129)]+_0x130f2e(0x149)+(_0x4cfc59['length']!==0x1?'s':'')),await handleSDKOutput(_0x4cfc59,_0x2e4481),0x0;}catch(_0x541d8c){if(_0x541d8c instanceof SDKError)return console[_0x130f2e(0x1b4)](_0x130f2e(0x18e)+_0x541d8c[_0x130f2e(0x1a0)]),_0x541d8c[_0x130f2e(0x133)]&&console[_0x130f2e(0x1b4)](_0x130f2e(0x1d5)+_0x541d8c['cause']),0x1;throw _0x541d8c;}}}export class WorkflowSessionsCommand extends BaseCommand{[a42_0x39f797(0x1b3)]=a42_0x39f797(0x1d2);[a42_0x39f797(0x168)]='List\x20workflow\x20execution\x20sessions';async[a42_0x39f797(0x1a5)](_0x2e6194){const _0x180c1b=a42_0x39f797,{options:_0x34588e,args:_0x3e4015,tdx:_0x32396e}=_0x2e6194;let _0x249508,_0x113cce;if(_0x3e4015[0x0]){const _0x4facd8=_0x3e4015[0x0][_0x180c1b(0x188)]('.');if(_0x4facd8['length']===0x1)_0x249508=_0x4facd8[0x0];else{if(_0x4facd8[_0x180c1b(0x129)]===0x2)[_0x249508,_0x113cce]=_0x4facd8;else return console[_0x180c1b(0x1b4)](_0x180c1b(0x175)),0x1;}}try{if(_0x34588e[_0x180c1b(0x1aa)]){if(_0x249508&&_0x113cce)console[_0x180c1b(0x1b4)](_0x180c1b(0x1b0)+_0x249508+'.'+_0x113cce);else _0x249508&&console[_0x180c1b(0x1b4)](_0x180c1b(0x198)+_0x249508);const _0xb6ba37=_0x34588e['status'];_0xb6ba37&&console[_0x180c1b(0x1b4)](_0x180c1b(0x167)+_0xb6ba37);}const _0x2f3ee7=await withSpinner(_0x180c1b(0x17e),()=>_0x32396e[_0x180c1b(0x161)][_0x180c1b(0x146)]({'projectName':_0x249508,'workflowName':_0x113cce,'status':_0x34588e[_0x180c1b(0x139)],'fromTime':_0x34588e[_0x180c1b(0x132)],'toTime':_0x34588e['to'],'limit':_0x34588e[_0x180c1b(0x15c)]}),{'verbose':_0x34588e[_0x180c1b(0x1aa)]}),_0x32e662=_0x2f3ee7[_0x180c1b(0x137)];return console[_0x180c1b(0x1b4)](_0x180c1b(0x1ca)+_0x32e662[_0x180c1b(0x129)]+_0x180c1b(0x16a)+(_0x32e662[_0x180c1b(0x129)]!==0x1?'s':'')),await handleSDKOutput(_0x32e662,_0x34588e),0x0;}catch(_0xef145c){if(_0xef145c instanceof SDKError)return console[_0x180c1b(0x1b4)](_0x180c1b(0x18e)+_0xef145c[_0x180c1b(0x1a0)]),_0xef145c[_0x180c1b(0x133)]&&console[_0x180c1b(0x1b4)]('\x20\x20Cause:\x20'+_0xef145c[_0x180c1b(0x133)]),0x1;throw _0xef145c;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a42_0x39f797(0x1b3)]=a42_0x39f797(0x152);['description']=a42_0x39f797(0x12b);async[a42_0x39f797(0x1a5)](_0x46d81b){const _0x410008=a42_0x39f797,{options:_0xc20a89,args:_0x2bc835,tdx:_0x176a30}=_0x46d81b;let _0x5c52be,_0x5269f9;if(_0x2bc835[0x0]){const _0x44eeb6=_0x2bc835[0x0][_0x410008(0x188)]('.');if(_0x44eeb6['length']===0x1)_0x5c52be=_0x44eeb6[0x0];else{if(_0x44eeb6['length']===0x2)[_0x5c52be,_0x5269f9]=_0x44eeb6;else return console['error'](_0x410008(0x175)),0x1;}}try{const _0x155b60=_0xc20a89['includeRetried'];if(_0xc20a89[_0x410008(0x1aa)]){if(_0x5c52be&&_0x5269f9)console[_0x410008(0x1b4)]('Filter:\x20'+_0x5c52be+'.'+_0x5269f9);else _0x5c52be&&console[_0x410008(0x1b4)]('Filter:\x20project='+_0x5c52be);_0x155b60&&console[_0x410008(0x1b4)](_0x410008(0x12f));}const _0x8bb38=await withSpinner(_0x410008(0x13e),()=>_0x176a30[_0x410008(0x161)][_0x410008(0x1ac)]({'projectName':_0x5c52be,'workflowName':_0x5269f9,'includeRetried':_0x155b60,'limit':_0xc20a89[_0x410008(0x15c)]}),{'verbose':_0xc20a89[_0x410008(0x1aa)]}),_0x13fadb=_0x8bb38[_0x410008(0x137)];return console[_0x410008(0x1b4)]('✔\x20Found\x20'+_0x13fadb[_0x410008(0x129)]+_0x410008(0x145)+(_0x13fadb[_0x410008(0x129)]!==0x1?'s':'')),await handleSDKOutput(_0x13fadb,_0xc20a89),0x0;}catch(_0x132dda){if(_0x132dda instanceof SDKError)return console[_0x410008(0x1b4)](_0x410008(0x18e)+_0x132dda[_0x410008(0x1a0)]),_0x132dda[_0x410008(0x133)]&&console[_0x410008(0x1b4)](_0x410008(0x1d5)+_0x132dda[_0x410008(0x133)]),0x1;throw _0x132dda;}}}export class WorkflowAttemptCommand extends BaseCommand{[a42_0x39f797(0x1b3)]=a42_0x39f797(0x12c);['description']=a42_0x39f797(0x1b9);async[a42_0x39f797(0x1a5)](_0x32b9b2){const _0x1f0d37=a42_0x39f797,{options:_0xa79d6,args:_0xd96fe7,tdx:_0x1617fd}=_0x32b9b2,_0xf87d31=_0xd96fe7[0x0];if(!_0xf87d31)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{_0xa79d6[_0x1f0d37(0x1aa)]&&console['error'](_0x1f0d37(0x155)+_0xf87d31);const _0x299458=await withSpinner(_0x1f0d37(0x14b),()=>_0x1617fd[_0x1f0d37(0x161)][_0x1f0d37(0x1d7)](_0xf87d31),{'verbose':_0xa79d6[_0x1f0d37(0x1aa)]}),_0x3a165a=_0x299458[_0x1f0d37(0x137)];let _0x4ecb5a;!_0x3a165a[_0x1f0d37(0x19d)]?_0x4ecb5a=_0x3a165a[_0x1f0d37(0x1b1)]?_0x1f0d37(0x130):'running':_0x4ecb5a=_0x3a165a[_0x1f0d37(0x16c)]?_0x1f0d37(0x16c):_0x1f0d37(0x1b4);let _0x3e12d2;if(_0x3a165a[_0x1f0d37(0x1a1)]&&_0x3a165a[_0x1f0d37(0x141)]){const _0x592cce=new Date(_0x3a165a[_0x1f0d37(0x1a1)])[_0x1f0d37(0x157)](),_0x5c3452=new Date(_0x3a165a['finishedAt'])[_0x1f0d37(0x157)]();_0x3e12d2=Math[_0x1f0d37(0x19f)]((_0x5c3452-_0x592cce)/0x3e8);}const _0x3f6796={'attempt_id':_0x3a165a['id'],'status':_0x4ecb5a,..._0x3a165a[_0x1f0d37(0x1a2)]!==undefined&&{'index':_0x3a165a[_0x1f0d37(0x1a2)]},..._0x3a165a['project']&&{'project':_0x3a165a[_0x1f0d37(0x18d)][_0x1f0d37(0x1b3)]},..._0x3a165a[_0x1f0d37(0x161)]&&{'workflow':_0x3a165a['workflow']['name']},..._0x3a165a[_0x1f0d37(0x19a)]&&{'session_id':_0x3a165a[_0x1f0d37(0x19a)]},..._0x3a165a[_0x1f0d37(0x187)]&&{'session_time':_0x3a165a[_0x1f0d37(0x187)]},..._0x3a165a['retryAttemptName']&&{'retry_attempt':_0x3a165a[_0x1f0d37(0x14f)]},..._0x3e12d2!==undefined&&{'duration_sec':_0x3e12d2},..._0x3a165a[_0x1f0d37(0x1a1)]&&{'created_at':_0x3a165a[_0x1f0d37(0x1a1)]},..._0x3a165a[_0x1f0d37(0x141)]&&{'finished_at':_0x3a165a[_0x1f0d37(0x141)]},...Object['keys'](_0x3a165a[_0x1f0d37(0x13a)])[_0x1f0d37(0x129)]>0x0&&{'params':_0x3a165a[_0x1f0d37(0x13a)]}};return await handleSingleObjectOutput(_0x3f6796,_0xa79d6),0x0;}catch(_0x9c1a09){if(_0x9c1a09 instanceof SDKError)return console[_0x1f0d37(0x1b4)]('Error:\x20'+_0x9c1a09['message']),_0x9c1a09[_0x1f0d37(0x133)]&&console[_0x1f0d37(0x1b4)](_0x1f0d37(0x1d5)+_0x9c1a09['cause']),0x1;throw _0x9c1a09;}}}export class WorkflowTasksCommand extends BaseCommand{[a42_0x39f797(0x1b3)]=a42_0x39f797(0x140);[a42_0x39f797(0x168)]='Show\x20tasks\x20for\x20an\x20attempt';async[a42_0x39f797(0x1a5)](_0x57a816){const _0x4c5d10=a42_0x39f797,{options:_0x2f8556,args:_0x295561,tdx:_0x5239f2}=_0x57a816,_0x171ed3=_0x295561[0x0];if(!_0x171ed3)return console[_0x4c5d10(0x1b4)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x2afe2f=_0x2f8556[_0x4c5d10(0x1ad)];_0x2f8556[_0x4c5d10(0x1aa)]&&(console[_0x4c5d10(0x1b4)](_0x4c5d10(0x155)+_0x171ed3),_0x2afe2f&&console[_0x4c5d10(0x1b4)](_0x4c5d10(0x185)));const _0x52f74f=await withSpinner(_0x4c5d10(0x1c0),()=>_0x5239f2[_0x4c5d10(0x161)][_0x4c5d10(0x14c)](_0x171ed3,_0x2afe2f||![]),{'verbose':_0x2f8556['verbose']}),_0x3ee4f3=_0x52f74f[_0x4c5d10(0x137)];return console[_0x4c5d10(0x1b4)](_0x4c5d10(0x1ca)+_0x3ee4f3['length']+_0x4c5d10(0x1d4)+(_0x3ee4f3[_0x4c5d10(0x129)]!==0x1?'s':'')),await handleSDKOutput(_0x3ee4f3,_0x2f8556),0x0;}catch(_0x55527c){if(_0x55527c instanceof SDKError)return console[_0x4c5d10(0x1b4)](_0x4c5d10(0x18e)+_0x55527c[_0x4c5d10(0x1a0)]),_0x55527c[_0x4c5d10(0x133)]&&console[_0x4c5d10(0x1b4)](_0x4c5d10(0x1d5)+_0x55527c[_0x4c5d10(0x133)]),0x1;throw _0x55527c;}}}export class WorkflowLogsCommand extends BaseCommand{[a42_0x39f797(0x1b3)]='workflow:logs';[a42_0x39f797(0x168)]=a42_0x39f797(0x172);async[a42_0x39f797(0x1a5)](_0xea38bc){const _0x3503dd=a42_0x39f797,{options:_0x2dd129,args:_0x5c004a,tdx:_0x3ce5f0}=_0xea38bc,_0x418f11=_0x5c004a[0x0];let _0x4257fa=_0x5c004a[0x1];if(!_0x418f11)return console['error'](_0x3503dd(0x18c)),0x1;try{_0x2dd129['verbose']&&(console['error'](_0x3503dd(0x155)+_0x418f11),_0x4257fa&&console[_0x3503dd(0x1b4)](_0x3503dd(0x16f)+_0x4257fa));const _0x5e03fd=await withSpinner(_0x3503dd(0x1ba),()=>_0x3ce5f0[_0x3503dd(0x161)][_0x3503dd(0x195)](_0x418f11,_0x4257fa),{'verbose':_0x2dd129['verbose']}),_0x218ff2=_0x5e03fd[_0x3503dd(0x137)];if(_0x218ff2[_0x3503dd(0x129)]===0x0)return console[_0x3503dd(0x1b4)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x4257fa&&(_0x2dd129['json']||_0x2dd129[_0x3503dd(0x1b2)]))return await handleSDKOutput(_0x218ff2,_0x2dd129),0x0;if(!_0x4257fa){const _0x34ebed=_0x218ff2[_0x3503dd(0x135)](_0x2b391e=>({'title':_0x2b391e[_0x3503dd(0x184)]+'\x20('+formatBytes(_0x2b391e[_0x3503dd(0x1ae)])+')','value':_0x2b391e[_0x3503dd(0x184)]})),_0x8c324f=await a42_0x5bf2b7({'type':_0x3503dd(0x191),'name':'task','message':_0x3503dd(0x1d0),'choices':_0x34ebed});if(!_0x8c324f[_0x3503dd(0x1c5)])return console['error']('Cancelled'),0x0;_0x4257fa=_0x8c324f[_0x3503dd(0x1c5)];}const _0x169a88=await withSpinner('Downloading\x20logs...',()=>_0x3ce5f0[_0x3503dd(0x161)]['logs'](_0x418f11,_0x4257fa),{'verbose':_0x2dd129[_0x3503dd(0x1aa)]}),_0x510a74=_0x169a88['data'];return _0x510a74?console[_0x3503dd(0x1ab)](_0x510a74):console[_0x3503dd(0x1b4)](_0x3503dd(0x1b6)),0x0;}catch(_0x5a951d){if(_0x5a951d instanceof SDKError)return console[_0x3503dd(0x1b4)](_0x3503dd(0x18e)+_0x5a951d[_0x3503dd(0x1a0)]),_0x5a951d['cause']&&console['error'](_0x3503dd(0x1d5)+_0x5a951d[_0x3503dd(0x133)]),0x1;throw _0x5a951d;}}}export class WorkflowKillCommand extends BaseCommand{[a42_0x39f797(0x1b3)]=a42_0x39f797(0x16d);[a42_0x39f797(0x168)]=a42_0x39f797(0x166);async['execute'](_0x293725){const _0x3967bc=a42_0x39f797,{options:_0x47bd0f,args:_0x2b6241,tdx:_0xaf9659}=_0x293725,_0x351073=_0x2b6241[0x0];if(!_0x351073)return console[_0x3967bc(0x1b4)](_0x3967bc(0x18c)),0x1;try{const _0x158be4=_0x47bd0f[_0x3967bc(0x1d1)];_0x47bd0f[_0x3967bc(0x1aa)]&&(console['error'](_0x3967bc(0x155)+_0x351073),_0x158be4&&console[_0x3967bc(0x1b4)](_0x3967bc(0x183)+_0x158be4));if(!_0x47bd0f[_0x3967bc(0x1cb)]){const _0x4c63b7=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x351073+'?');if(!_0x4c63b7)return console[_0x3967bc(0x1b4)]('Cancelled'),0x0;}const _0x41f858=await withSpinner(_0x3967bc(0x189),()=>_0xaf9659[_0x3967bc(0x161)]['kill'](_0x351073,_0x158be4),{'verbose':_0x47bd0f[_0x3967bc(0x1aa)]}),_0x2c23cc=_0x41f858[_0x3967bc(0x137)];return console[_0x3967bc(0x1b4)]('✔\x20'+_0x2c23cc),0x0;}catch(_0x505e55){if(_0x505e55 instanceof SDKError)return console['error'](_0x3967bc(0x18e)+_0x505e55[_0x3967bc(0x1a0)]),_0x505e55[_0x3967bc(0x133)]&&console['error'](_0x3967bc(0x1d5)+_0x505e55[_0x3967bc(0x133)]),0x1;throw _0x505e55;}}}export class WorkflowRetryCommand extends BaseCommand{[a42_0x39f797(0x1b3)]=a42_0x39f797(0x1cd);[a42_0x39f797(0x168)]=a42_0x39f797(0x170);async[a42_0x39f797(0x1a5)](_0x2e388f){const _0x9fe2a7=a42_0x39f797,{options:_0x1c7042,args:_0x3c16cf,tdx:_0x2cb50d}=_0x2e388f,_0x57ac57=_0x3c16cf[0x0];if(!_0x57ac57)return console[_0x9fe2a7(0x1b4)](_0x9fe2a7(0x173)),console[_0x9fe2a7(0x1b4)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x42c9b3=![],_0x353b6a=_0x57ac57;if(_0x57ac57[_0x9fe2a7(0x190)](_0x9fe2a7(0x1bc)))_0x42c9b3=!![],_0x353b6a=_0x57ac57[_0x9fe2a7(0x17c)](0x8);else{if(_0x57ac57[_0x9fe2a7(0x190)]('attempt:'))_0x42c9b3=![],_0x353b6a=_0x57ac57['substring'](0x8);else return console[_0x9fe2a7(0x1b4)](_0x9fe2a7(0x1a9)),console[_0x9fe2a7(0x1b4)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}try{const _0x156947=_0x1c7042[_0x9fe2a7(0x174)],_0x5b629a=_0x1c7042[_0x9fe2a7(0x17a)],_0x566df3=_0x1c7042[_0x9fe2a7(0x13a)],_0x446a48=_0x1c7042[_0x9fe2a7(0x16b)];_0x1c7042[_0x9fe2a7(0x1aa)]&&(console[_0x9fe2a7(0x1b4)](_0x9fe2a7(0x1d3)+(_0x42c9b3?_0x9fe2a7(0x13d):_0x9fe2a7(0x1d7))+'\x20'+_0x353b6a),_0x156947&&console[_0x9fe2a7(0x1b4)](_0x9fe2a7(0x12d)+_0x156947),_0x5b629a&&console['error'](_0x9fe2a7(0x131)+_0x5b629a),_0x566df3&&console['error']('Params:\x20'+_0x566df3),_0x446a48&&console[_0x9fe2a7(0x1b4)](_0x9fe2a7(0x1b7)));let _0x359d24;if(_0x566df3)try{if(_0x566df3[_0x9fe2a7(0x190)]('@')){const _0x18581d=await import(_0x9fe2a7(0x196)),_0x2bd7e7=_0x566df3[_0x9fe2a7(0x17c)](0x1),_0x10cbe4=await _0x18581d[_0x9fe2a7(0x147)](_0x2bd7e7,_0x9fe2a7(0x169));_0x359d24=JSON[_0x9fe2a7(0x19b)](_0x10cbe4);}else _0x359d24=JSON[_0x9fe2a7(0x19b)](_0x566df3);}catch{return console[_0x9fe2a7(0x1b4)](_0x9fe2a7(0x1c6)),0x1;}if(!_0x1c7042['yes']){const _0x595840=await confirm(_0x9fe2a7(0x1ce)+(_0x42c9b3?_0x9fe2a7(0x13d):_0x9fe2a7(0x1d7))+'\x20'+_0x353b6a+'?');if(!_0x595840)return console[_0x9fe2a7(0x1b4)](_0x9fe2a7(0x17b)),0x0;}let _0x44de84;_0x42c9b3?_0x44de84=await withSpinner(_0x9fe2a7(0x17d),()=>_0x2cb50d['workflow'][_0x9fe2a7(0x193)](_0x353b6a,{'fromTask':_0x156947,'retryParams':_0x359d24}),{'verbose':_0x1c7042[_0x9fe2a7(0x1aa)]}):_0x44de84=await withSpinner(_0x9fe2a7(0x1b8),()=>_0x2cb50d[_0x9fe2a7(0x161)][_0x9fe2a7(0x1c8)](_0x353b6a,{'resumeFrom':_0x5b629a,'retryParams':_0x359d24,'force':_0x446a48}),{'verbose':_0x1c7042['verbose']});const _0x41a19d=_0x44de84[_0x9fe2a7(0x137)];return console[_0x9fe2a7(0x1b4)](_0x9fe2a7(0x18a)),console[_0x9fe2a7(0x1b4)](_0x9fe2a7(0x1a4)+_0x41a19d['attemptId']),console[_0x9fe2a7(0x1b4)](_0x9fe2a7(0x180)+_0x41a19d[_0x9fe2a7(0x19a)]),0x0;}catch(_0x1db62b){if(_0x1db62b instanceof SDKError)return console[_0x9fe2a7(0x1b4)](_0x9fe2a7(0x18e)+_0x1db62b[_0x9fe2a7(0x1a0)]),_0x1db62b[_0x9fe2a7(0x133)]&&console[_0x9fe2a7(0x1b4)](_0x9fe2a7(0x1d5)+_0x1db62b[_0x9fe2a7(0x133)]),0x1;throw _0x1db62b;}}}export class WorkflowRunCommand extends BaseCommand{[a42_0x39f797(0x1b3)]=a42_0x39f797(0x182);['description']=a42_0x39f797(0x15b);async[a42_0x39f797(0x1a5)](_0x1d029a){const _0x5d0bd2=a42_0x39f797,{options:_0x4e18c2,args:_0x260ef3,tdx:_0x21cb39}=_0x1d029a,_0x4856b9=_0x260ef3[0x0];if(!_0x4856b9)return console[_0x5d0bd2(0x1b4)]('Error:\x20Workflow\x20identifier\x20is\x20required'),console[_0x5d0bd2(0x1b4)](_0x5d0bd2(0x13f)),0x1;const _0x4c2eb7=_0x4e18c2[_0x5d0bd2(0x171)],_0x2cc344=_0x4e18c2['sessionTime'],_0x4f5c71={};if(_0x4c2eb7&&Array[_0x5d0bd2(0x19c)](_0x4c2eb7))for(const _0x137414 of _0x4c2eb7){const _0x5ea00d=_0x137414[_0x5d0bd2(0x192)]('=');if(_0x5ea00d===-0x1)return console['error']('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x137414),console[_0x5d0bd2(0x1b4)](_0x5d0bd2(0x178)),0x1;const _0x264985=_0x137414[_0x5d0bd2(0x17c)](0x0,_0x5ea00d),_0x5d72ff=_0x137414['substring'](_0x5ea00d+0x1);try{_0x4f5c71[_0x264985]=JSON['parse'](_0x5d72ff);}catch{_0x4f5c71[_0x264985]=_0x5d72ff;}}_0x4e18c2[_0x5d0bd2(0x1aa)]&&(console[_0x5d0bd2(0x1b4)](_0x5d0bd2(0x1a6)+_0x4856b9),Object[_0x5d0bd2(0x158)](_0x4f5c71)[_0x5d0bd2(0x129)]>0x0&&console[_0x5d0bd2(0x1b4)](_0x5d0bd2(0x153)+JSON[_0x5d0bd2(0x176)](_0x4f5c71)),_0x2cc344&&console[_0x5d0bd2(0x1b4)](_0x5d0bd2(0x1a8)+_0x2cc344));const _0x56fbd3=await withSpinner(_0x5d0bd2(0x1c1),()=>_0x21cb39[_0x5d0bd2(0x161)][_0x5d0bd2(0x1be)](_0x4856b9,_0x4f5c71,{'sessionTime':_0x2cc344}),{'verbose':_0x4e18c2[_0x5d0bd2(0x1aa)]}),_0x396907=_0x56fbd3[_0x5d0bd2(0x137)];return console['error']('✔\x20Workflow\x20run\x20started'),console[_0x5d0bd2(0x1b4)]('\x20\x20Attempt\x20ID:\x20'+_0x396907['id']),console[_0x5d0bd2(0x1b4)](_0x5d0bd2(0x180)+_0x396907[_0x5d0bd2(0x19a)]),console[_0x5d0bd2(0x1b4)](_0x5d0bd2(0x144)+_0x396907[_0x5d0bd2(0x18d)]?.[_0x5d0bd2(0x1b3)]),console['error'](_0x5d0bd2(0x179)+_0x396907[_0x5d0bd2(0x161)]?.['name']),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a42_0x39f797(0x1b3)]=a42_0x39f797(0x154);[a42_0x39f797(0x168)]=a42_0x39f797(0x19e);async[a42_0x39f797(0x1a5)](_0x1ef631){const _0x143c4f=a42_0x39f797,{options:_0x40f896,args:_0x5bea16,tdx:_0x786312}=_0x1ef631,_0x5486c2=_0x5bea16[0x0],_0x17ccf7=_0x5bea16[0x1]||'.';if(!_0x5486c2)return console[_0x143c4f(0x1b4)](_0x143c4f(0x160)),console['error'](_0x143c4f(0x1d6)),0x1;const _0x1ca5ba=_0x40f896[_0x143c4f(0x1bb)];_0x40f896[_0x143c4f(0x1aa)]&&(console[_0x143c4f(0x1b4)](_0x143c4f(0x143)+_0x5486c2),console[_0x143c4f(0x1b4)](_0x143c4f(0x16e)+_0x17ccf7),_0x1ca5ba&&console[_0x143c4f(0x1b4)](_0x143c4f(0x15e)+_0x1ca5ba));const _0x2f181c=await withSpinner(_0x143c4f(0x14e)+_0x5486c2+'...',()=>_0x786312['workflow'][_0x143c4f(0x1c3)](_0x5486c2,_0x17ccf7,{'revision':_0x1ca5ba}),{'verbose':_0x40f896[_0x143c4f(0x1aa)]}),_0x4ab919=_0x2f181c[_0x143c4f(0x137)];return console[_0x143c4f(0x1b4)](_0x143c4f(0x151)+_0x4ab919[_0x143c4f(0x1cc)]),console[_0x143c4f(0x1b4)]('\x20\x20Revision:\x20'+_0x4ab919['revision']),console[_0x143c4f(0x1b4)](_0x143c4f(0x14a)+_0x4ab919[_0x143c4f(0x1c2)]),console['error'](_0x143c4f(0x177)+_0x17ccf7+'/'+_0x4ab919['projectName']),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a42_0x39f797(0x1b3)]='workflow:push';[a42_0x39f797(0x168)]=a42_0x39f797(0x18f);async['execute'](_0x1472f4){const _0x55d288=a42_0x39f797,{options:_0x21eb68,args:_0x6aba06,tdx:_0x36c0ea}=_0x1472f4;let _0x39c88c='.',_0x8346c9=_0x21eb68[_0x55d288(0x1b3)];if(_0x6aba06[0x0]){const {promises:_0x223423}=await import('fs');try{const _0x2673ea=await _0x223423[_0x55d288(0x1b5)](_0x6aba06[0x0]);if(_0x2673ea[_0x55d288(0x148)]())_0x39c88c=_0x6aba06[0x0];else return console[_0x55d288(0x1b4)](_0x55d288(0x18e)+_0x6aba06[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x8346c9=_0x6aba06[0x0],_0x39c88c='.';}}const _0x4de704=_0x21eb68[_0x55d288(0x1bb)],_0x4a2148=_0x21eb68['skipValidation'];_0x21eb68[_0x55d288(0x1aa)]&&(console[_0x55d288(0x1b4)](_0x55d288(0x13b)+_0x39c88c),_0x8346c9&&console[_0x55d288(0x1b4)](_0x55d288(0x14d)+_0x8346c9),_0x4de704&&console[_0x55d288(0x1b4)](_0x55d288(0x15e)+_0x4de704),_0x4a2148&&console[_0x55d288(0x1b4)](_0x55d288(0x18b)));const _0x905cd6=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x36c0ea[_0x55d288(0x161)][_0x55d288(0x159)](_0x39c88c,{'projectName':_0x8346c9,'revision':_0x4de704,'skipValidation':_0x4a2148}),{'verbose':_0x21eb68[_0x55d288(0x1aa)]}),_0x58c06a=_0x905cd6[_0x55d288(0x137)];return console[_0x55d288(0x1b4)](_0x55d288(0x186)+_0x58c06a[_0x55d288(0x1cc)]),console[_0x55d288(0x1b4)](_0x55d288(0x1c9)+_0x58c06a[_0x55d288(0x1af)]),console[_0x55d288(0x1b4)]('\x20\x20Revision:\x20'+_0x58c06a[_0x55d288(0x1bb)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a42_0x39f797(0x1a7);[a42_0x39f797(0x168)]=a42_0x39f797(0x197);async[a42_0x39f797(0x1a5)](_0x309088){const _0x211340=a42_0x39f797,{options:_0x3baa0c,args:_0x39800a,tdx:_0x2d115d}=_0x309088,_0x4ec221=_0x39800a[0x0];if(!_0x4ec221)return console[_0x211340(0x1b4)](_0x211340(0x150)),console[_0x211340(0x1b4)](_0x211340(0x13c)),0x1;_0x3baa0c[_0x211340(0x1aa)]&&console[_0x211340(0x1b4)]('Project:\x20'+_0x4ec221);if(!_0x3baa0c[_0x211340(0x1cb)]){const _0x217fea=await confirm(_0x211340(0x1c4)+_0x4ec221+_0x211340(0x165));if(!_0x217fea)return console['error']('Cancelled'),0x0;}const _0xa7a6c9=await withSpinner(_0x211340(0x1c7)+_0x4ec221+_0x211340(0x1bf),()=>_0x2d115d['workflow'][_0x211340(0x181)](_0x4ec221),{'verbose':_0x3baa0c['verbose']}),_0x36a2a1=_0xa7a6c9[_0x211340(0x137)];return console[_0x211340(0x1b4)](_0x211340(0x15a)+_0x36a2a1[_0x211340(0x1cc)]),console['error'](_0x211340(0x1c9)+_0x36a2a1[_0x211340(0x1af)]),0x0;}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x1ab9d4,_0x2b4812){const _0x10f8c4=a43_0x3427,_0x4fad36=_0x1ab9d4();while(!![]){try{const _0x1634f7=parseInt(_0x10f8c4(0x14a))/0x1+parseInt(_0x10f8c4(0x151))/0x2+parseInt(_0x10f8c4(0x153))/0x3*(parseInt(_0x10f8c4(0x14c))/0x4)+parseInt(_0x10f8c4(0x14d))/0x5*(parseInt(_0x10f8c4(0x158))/0x6)+parseInt(_0x10f8c4(0x157))/0x7*(-parseInt(_0x10f8c4(0x156))/0x8)+parseInt(_0x10f8c4(0x146))/0x9*(-parseInt(_0x10f8c4(0x14f))/0xa)+-parseInt(_0x10f8c4(0x144))/0xb*(-parseInt(_0x10f8c4(0x154))/0xc);if(_0x1634f7===_0x2b4812)break;else _0x4fad36['push'](_0x4fad36['shift']());}catch(_0x389f81){_0x4fad36['push'](_0x4fad36['shift']());}}}(a43_0x40ad,0x9d51f));import{platform}from'os';function a43_0x3427(_0x1f8df5,_0x23ba69){_0x1f8df5=_0x1f8df5-0x144;const _0x40ad40=a43_0x40ad();let _0x342704=_0x40ad40[_0x1f8df5];return _0x342704;}import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x4cf2e1=a43_0x3427;try{const _0x5fe0b1=fileURLToPath(import.meta.url),_0x96f38=dirname(_0x5fe0b1),_0x2d49dd=join(_0x96f38,_0x4cf2e1(0x159)),_0x404471=JSON[_0x4cf2e1(0x147)](readFileSync(_0x2d49dd,_0x4cf2e1(0x148)));return _0x404471[_0x4cf2e1(0x152)];}catch{return'0.0.0';}}export function getUserAgent(){const _0x37f526=a43_0x3427,_0x376d2f=getVersion(),_0x5f0f10=platform(),_0x2cbf0f=process[_0x37f526(0x152)][_0x37f526(0x14e)]('v','');return _0x37f526(0x149)+_0x376d2f+'\x20('+_0x5f0f10+_0x37f526(0x150)+_0x2cbf0f+')';}function a43_0x40ad(){const _0x108ded=['1125685MezWFE','entries','3028IwgPzF','1503195jBcsUp','replace','4670OkEaIq',';\x20node/','334064DTMOaN','version','1011KgzWcN','14604iaaRNl','X-Trino-User','4913464OiXeKM','7aDCoFO','6wdGpcC','../../package.json','length','2629eNIAmb','Authorization','16974RmytTD','parse','utf-8','tdx/'];a43_0x40ad=function(){return _0x108ded;};return a43_0x40ad();}export function getAuthHeaders(_0x2111a4,_0x19b8c7){const _0x5e3332=a43_0x3427,_0x2af36e=getVersion(),_0xb28cfa={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x2af36e};return _0x19b8c7&&(_0xb28cfa[_0x5e3332(0x145)]='TD1\x20'+_0x19b8c7),_0xb28cfa;}export function toHeaderRecord(_0x22cc17){const _0x22931e=a43_0x3427,_0x3bb9c5={};for(const [_0x4c61cf,_0x29ee5c]of Object[_0x22931e(0x14b)](_0x22cc17)){_0x29ee5c!==undefined&&(_0x3bb9c5[_0x4c61cf]=_0x29ee5c);}return _0x3bb9c5;}export function getTrinoHeaders(_0x53ca7a,_0x1dc4d0){const _0x1aabcf=a43_0x3427,_0x1f4e0f=getAuthHeaders(_0x53ca7a,_0x1dc4d0),_0x2e5216=toHeaderRecord(_0x1f4e0f);return delete _0x2e5216[_0x1aabcf(0x145)],_0x1dc4d0&&(_0x2e5216[_0x1aabcf(0x155)]=_0x1dc4d0),_0x2e5216;}export function hasAPIKey(_0x46d44f){const _0x115a1d=a43_0x3427,_0x131c15=getAPIKey(_0x46d44f);return _0x131c15!==undefined&&_0x131c15[_0x115a1d(0x15a)]>0x0;}
1
+ (function(_0x2163d1,_0x377641){const _0x16f7fd=a43_0x1ee0,_0x2adf34=_0x2163d1();while(!![]){try{const _0x178c9d=parseInt(_0x16f7fd(0x166))/0x1*(-parseInt(_0x16f7fd(0x15c))/0x2)+parseInt(_0x16f7fd(0x157))/0x3*(-parseInt(_0x16f7fd(0x163))/0x4)+parseInt(_0x16f7fd(0x168))/0x5*(-parseInt(_0x16f7fd(0x159))/0x6)+parseInt(_0x16f7fd(0x16a))/0x7*(-parseInt(_0x16f7fd(0x15e))/0x8)+-parseInt(_0x16f7fd(0x154))/0x9+-parseInt(_0x16f7fd(0x160))/0xa*(parseInt(_0x16f7fd(0x167))/0xb)+-parseInt(_0x16f7fd(0x165))/0xc*(-parseInt(_0x16f7fd(0x162))/0xd);if(_0x178c9d===_0x377641)break;else _0x2adf34['push'](_0x2adf34['shift']());}catch(_0x1641eb){_0x2adf34['push'](_0x2adf34['shift']());}}}(a43_0x37f3,0x75e18));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 _0x275dbc=a43_0x1ee0;try{const _0x20a56a=fileURLToPath(import.meta.url),_0x48bfc8=dirname(_0x20a56a),_0x1625cd=join(_0x48bfc8,_0x275dbc(0x15a)),_0x34bb0a=JSON[_0x275dbc(0x164)](readFileSync(_0x1625cd,_0x275dbc(0x153)));return _0x34bb0a[_0x275dbc(0x161)];}catch{return _0x275dbc(0x158);}}export function getUserAgent(){const _0x3ec246=a43_0x1ee0,_0x6541df=getVersion(),_0x4274e9=platform(),_0x61e39f=process[_0x3ec246(0x161)][_0x3ec246(0x15d)]('v','');return _0x3ec246(0x15f)+_0x6541df+'\x20('+_0x4274e9+_0x3ec246(0x15b)+_0x61e39f+')';}export function getAuthHeaders(_0x42c366,_0x34ed11){const _0x2d1b21=a43_0x1ee0,_0xef58c8=getVersion(),_0x5d1496={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0xef58c8};return _0x34ed11&&(_0x5d1496[_0x2d1b21(0x169)]=_0x2d1b21(0x155)+_0x34ed11),_0x5d1496;}function a43_0x1ee0(_0xa52498,_0x37c398){_0xa52498=_0xa52498-0x153;const _0x37f376=a43_0x37f3();let _0x1ee02b=_0x37f376[_0xa52498];return _0x1ee02b;}function a43_0x37f3(){const _0x501544=[';\x20node/','18EikwTe','replace','2456kGZaOm','tdx/','1476050lHztgQ','version','104TCcsVN','31076QfAWGG','parse','5143464qpAMbl','95548LXgGlq','22DLrLvP','160780DvDssV','Authorization','7259pIpLZm','utf-8','6076935uHKDRS','TD1\x20','length','72pGjTed','0.0.0','114iaJznS','../../package.json'];a43_0x37f3=function(){return _0x501544;};return a43_0x37f3();}export function toHeaderRecord(_0x43078b){const _0x358d4d={};for(const [_0x317ed3,_0x28e152]of Object['entries'](_0x43078b)){_0x28e152!==undefined&&(_0x358d4d[_0x317ed3]=_0x28e152);}return _0x358d4d;}export function getTrinoHeaders(_0xeab393,_0x45c457){const _0x1316cc=getAuthHeaders(_0xeab393,_0x45c457),_0x1eb818=toHeaderRecord(_0x1316cc);return delete _0x1eb818['Authorization'],_0x45c457&&(_0x1eb818['X-Trino-User']=_0x45c457),_0x1eb818;}export function hasAPIKey(_0xfdc5f4){const _0x1f7ef9=a43_0x1ee0,_0xf34c10=getAPIKey(_0xfdc5f4);return _0xf34c10!==undefined&&_0xf34c10[_0x1f7ef9(0x156)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x212435,_0x3a6a4a){const _0x262874=a44_0x5c04,_0x1b1541=_0x212435();while(!![]){try{const _0x2b6091=-parseInt(_0x262874(0x133))/0x1*(-parseInt(_0x262874(0x150))/0x2)+-parseInt(_0x262874(0x13e))/0x3+parseInt(_0x262874(0x10e))/0x4*(-parseInt(_0x262874(0x112))/0x5)+parseInt(_0x262874(0x149))/0x6+parseInt(_0x262874(0x14a))/0x7+-parseInt(_0x262874(0x129))/0x8*(parseInt(_0x262874(0x144))/0x9)+-parseInt(_0x262874(0x115))/0xa;if(_0x2b6091===_0x3a6a4a)break;else _0x1b1541['push'](_0x1b1541['shift']());}catch(_0x35b532){_0x1b1541['push'](_0x1b1541['shift']());}}}(a44_0x360e,0x303ff));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a44_0x22665a from'node:fs';import*as a44_0x4a9945 from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a44_0x73ef6f from'chalk';export function getConfigDir(){const _0x59a4c0=a44_0x5c04;return process['env'][_0x59a4c0(0x14c)]||join(homedir(),'.config',_0x59a4c0(0x146));}function a44_0x5c04(_0x58a07e,_0x3733c9){_0x58a07e=_0x58a07e-0x10a;const _0x360ea7=a44_0x360e();let _0x5c048f=_0x360ea7[_0x58a07e];return _0x5c048f;}export function getConfigFile(){const _0x446b4b=a44_0x5c04;return join(getConfigDir(),_0x446b4b(0x14e));}export function getConfigFilePath(_0x1b28ad){const _0x131826=getConfigDir();return _0x1b28ad?a44_0x4a9945['join'](_0x131826,'.env.'+_0x1b28ad):getConfigFile();}export function getCacheDir(){const _0x3ff32f=a44_0x5c04;return process[_0x3ff32f(0x145)]['TDX_CACHE_DIR']||join(homedir(),_0x3ff32f(0x116),_0x3ff32f(0x146));}export function getLLMProjectCacheFile(_0x22bd7e){const _0x2a1da3=a44_0x5c04,_0x1f6859=_0x22bd7e?_0x2a1da3(0x111)+_0x22bd7e:_0x2a1da3(0x138);return join(getCacheDir(),_0x1f6859);}export function readCachedLLMProject(_0x59d84e){const _0x5ab48b=a44_0x5c04;try{const _0x3885d1=getLLMProjectCacheFile(_0x59d84e);if(!existsSync(_0x3885d1))return null;const _0x27e772=readFileSync(_0x3885d1,_0x5ab48b(0x139))['trim']();try{const _0x20faed=JSON[_0x5ab48b(0x126)](_0x27e772);if(_0x20faed&&typeof _0x20faed['id']===_0x5ab48b(0x13b)&&typeof _0x20faed['name']===_0x5ab48b(0x13b))return _0x20faed;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x4faa55,_0x2ab7b8,_0x39849c){const _0x52cfda=a44_0x5c04;try{const _0xbac300=getCacheDir(),_0x22ce46=getLLMProjectCacheFile(_0x39849c);!existsSync(_0xbac300)&&mkdirSync(_0xbac300,{'recursive':!![]});const _0x2a1297={'name':_0x4faa55,'id':_0x2ab7b8};writeFileSync(_0x22ce46,JSON[_0x52cfda(0x10b)](_0x2a1297),'utf-8');}catch{}}export function getAccountInfoCacheFile(_0x19a775){const _0x4a6f64=a44_0x5c04,_0x1ca38f=_0x19a775?_0x4a6f64(0x12e)+_0x19a775+'.json':_0x4a6f64(0x121);return join(getCacheDir(),_0x1ca38f);}export function readCachedAccountInfo(_0x1e0aa2){const _0x13349e=a44_0x5c04;try{const _0x32abf7=getAccountInfoCacheFile(_0x1e0aa2);if(!existsSync(_0x32abf7))return null;const _0x121956=readFileSync(_0x32abf7,_0x13349e(0x139))[_0x13349e(0x117)](),_0x14121c=JSON['parse'](_0x121956);if(_0x14121c&&typeof _0x14121c[_0x13349e(0x114)]==='string'&&typeof _0x14121c[_0x13349e(0x122)]===_0x13349e(0x152))return _0x14121c;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x1da3a7,_0x48b8b0,_0x32db6d){const _0x3bdb29=a44_0x5c04;try{const _0x20ee96=getCacheDir(),_0x331ecf=getAccountInfoCacheFile(_0x32db6d);!existsSync(_0x20ee96)&&mkdirSync(_0x20ee96,{'recursive':!![]});const _0x58943f={'site':_0x1da3a7,'accountId':_0x48b8b0,'cachedAt':new Date()[_0x3bdb29(0x11c)]()};writeFileSync(_0x331ecf,JSON['stringify'](_0x58943f),_0x3bdb29(0x139));}catch{}}export function parseEnvFile(_0x5ad1f9){const _0x483f98=a44_0x5c04,_0x4ee6b1={};for(const _0x335211 of _0x5ad1f9[_0x483f98(0x14d)]('\x0a')){const _0x814cae=_0x335211[_0x483f98(0x117)]();if(!_0x814cae||_0x814cae[_0x483f98(0x13a)]('#'))continue;const _0x3fa316=_0x814cae[_0x483f98(0x11a)](/^([^=]+)=(.*)$/);if(_0x3fa316){const _0x22f9ee=_0x3fa316[0x1][_0x483f98(0x117)]();let _0xd95fcc=_0x3fa316[0x2][_0x483f98(0x117)]();(_0xd95fcc['startsWith']('\x22')&&_0xd95fcc['endsWith']('\x22')||_0xd95fcc[_0x483f98(0x13a)]('\x27')&&_0xd95fcc[_0x483f98(0x13f)]('\x27'))&&(_0xd95fcc=_0xd95fcc['slice'](0x1,-0x1)),_0x4ee6b1[_0x22f9ee]=_0xd95fcc;}}return _0x4ee6b1;}export function readUserConfig(){const _0x157de3=a44_0x5c04,_0x3ad9a9=getConfigFile();if(!existsSync(_0x3ad9a9))return{};try{const _0x5a90b5=readFileSync(_0x3ad9a9,_0x157de3(0x139));return parseEnvFile(_0x5a90b5);}catch(_0xef6218){return console[_0x157de3(0x10a)]('Warning:\x20Failed\x20to\x20read\x20config\x20file\x20'+_0x3ad9a9+':',_0xef6218),{};}}export function resolveSite(_0x39b4a0){const _0x539ec7=a44_0x5c04,_0x424196=[_0x539ec7(0x110),_0x539ec7(0x10d),_0x539ec7(0x125),_0x539ec7(0x142),_0x539ec7(0x12b),'dev-us01','dev-eu01',_0x539ec7(0x124),'stg-jp01','stg-ap03'];if(_0x424196[_0x539ec7(0x151)](_0x39b4a0))return _0x39b4a0;if(_0x39b4a0 in SITE_ALIASES)return SITE_ALIASES[_0x39b4a0];return console[_0x539ec7(0x10a)](_0x539ec7(0x13d)+_0x39b4a0+'\x27,\x20defaulting\x20to\x20us01'),_0x539ec7(0x110);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x59b5be,_0x395827){const _0x593ad3=a44_0x5c04,_0x53ce23=_0x395827||getActiveProfileName();if(_0x53ce23){const _0x35f512=_0x593ad3(0x119)+normalizeProfileForEnvVar(_0x53ce23);if(process[_0x593ad3(0x145)][_0x35f512])return process[_0x593ad3(0x145)][_0x35f512];}if(process[_0x593ad3(0x145)][_0x593ad3(0x11d)])return process[_0x593ad3(0x145)][_0x593ad3(0x11d)];if(process[_0x593ad3(0x145)][_0x593ad3(0x113)])return process['env']['TD_API_KEY'];const _0x43b1f6=_0x59b5be[_0x593ad3(0x137)]()[_0x593ad3(0x12f)](/-/g,'_'),_0x175777='TD_API_KEY_'+_0x43b1f6;if(_0x53ce23){const _0x501163=loadProfileEnv(_0x53ce23);if(_0x501163){if(_0x501163[_0x175777])return _0x501163[_0x175777];if(_0x501163[_0x593ad3(0x113)])return _0x501163[_0x593ad3(0x113)];}}const _0x5e68d6=loadUserConfigOnce();if(_0x5e68d6[_0x175777])return _0x5e68d6[_0x175777];if(_0x5e68d6[_0x593ad3(0x113)])return _0x5e68d6['TD_API_KEY'];return undefined;}export function normalizeProfileForEnvVar(_0x4e306c){const _0x456167=a44_0x5c04;return _0x4e306c[_0x456167(0x137)]()[_0x456167(0x12f)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x31a9e3,_0x92b62c){const _0x17d2ff=a44_0x5c04,_0x28c3ae=_0x92b62c||getActiveProfileName()||undefined;if(_0x28c3ae){const _0x12c143=_0x17d2ff(0x119)+normalizeProfileForEnvVar(_0x28c3ae);if(process[_0x17d2ff(0x145)][_0x12c143])return{'apiKey':process[_0x17d2ff(0x145)][_0x12c143],'source':_0x12c143+_0x17d2ff(0x147),'isDeprecated':![]};const _0x2d18a4=getCachedCredential(_0x31a9e3,_0x28c3ae);if(_0x2d18a4)return{'apiKey':_0x2d18a4,'source':_0x17d2ff(0x11f)+_0x28c3ae+')','isDeprecated':![]};const _0x51fcd2=await getKeychainAPIKey(_0x28c3ae);if(_0x51fcd2)return setCachedCredential(_0x51fcd2,_0x31a9e3,_0x28c3ae),{'apiKey':_0x51fcd2,'source':_0x17d2ff(0x11f)+_0x28c3ae+')','isDeprecated':![]};}if(process['env'][_0x17d2ff(0x11d)])return{'apiKey':process[_0x17d2ff(0x145)][_0x17d2ff(0x11d)],'source':'TDX_API_KEY\x20env\x20var','isDeprecated':![]};if(!_0x28c3ae){const _0x4f7dc6=getCachedCredential(_0x31a9e3,undefined);if(_0x4f7dc6)return{'apiKey':_0x4f7dc6,'source':_0x17d2ff(0x12a),'isDeprecated':![]};const _0x18bed5=await getKeychainAPIKey(undefined);if(_0x18bed5)return setCachedCredential(_0x18bed5,_0x31a9e3,undefined),{'apiKey':_0x18bed5,'source':_0x17d2ff(0x12a),'isDeprecated':![]};}if(process[_0x17d2ff(0x145)][_0x17d2ff(0x113)])return{'apiKey':process[_0x17d2ff(0x145)]['TD_API_KEY'],'source':_0x17d2ff(0x12d),'isDeprecated':!![]};const _0x373cd2=getLegacyEnvAPIKey(_0x31a9e3,_0x28c3ae);if(_0x373cd2){const _0x595a37=await isKeychainAvailable();if(_0x595a37)try{await saveKeychainAPIKey(_0x373cd2,_0x28c3ae),setCachedCredential(_0x373cd2,_0x31a9e3,_0x28c3ae);const _0x4debcf=getConfigFilePath(_0x28c3ae);cleanupLegacyEnvFile(_0x4debcf)&&console[_0x17d2ff(0x10a)](a44_0x73ef6f[_0x17d2ff(0x140)](_0x17d2ff(0x10c)));}catch(_0x3f240e){console[_0x17d2ff(0x10a)](a44_0x73ef6f['yellow']('⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20'+_0x3f240e));}const _0x11e73f=_0x28c3ae?_0x17d2ff(0x130)+_0x28c3ae+')':_0x17d2ff(0x123);return{'apiKey':_0x373cd2,'source':_0x11e73f,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x28c9eb,_0x5418cd,_0xbae211=!![]){const _0x4c2ad1=a44_0x5c04,_0x52cd31=await resolveAPIKeyAsync(_0x28c9eb,_0x5418cd);if(!_0x52cd31)return undefined;if(_0xbae211&&_0x52cd31[_0x4c2ad1(0x14b)]&&_0x52cd31['source']['includes'](_0x4c2ad1(0x113))){const _0x43303e=_0x5418cd||getActiveProfileName()||undefined,_0x41e42e=_0x43303e?_0x4c2ad1(0x119)+normalizeProfileForEnvVar(_0x43303e):_0x4c2ad1(0x12c);console[_0x4c2ad1(0x10a)](a44_0x73ef6f[_0x4c2ad1(0x140)](_0x4c2ad1(0x148)+('\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20'+_0x41e42e+').')));}return _0x52cd31[_0x4c2ad1(0x135)];}function getLegacyEnvAPIKey(_0x25fdfc,_0x41f8f9){const _0x50552c=a44_0x5c04,_0x410991=_0x25fdfc[_0x50552c(0x137)]()['replace'](/-/g,'_'),_0x227dea=_0x50552c(0x136)+_0x410991;if(_0x41f8f9){const _0x5107da=loadProfileEnv(_0x41f8f9);if(_0x5107da){if(_0x5107da[_0x227dea])return _0x5107da[_0x227dea];if(_0x5107da[_0x50552c(0x113)])return _0x5107da[_0x50552c(0x113)];}}const _0x19b04e=loadUserConfigOnce();if(_0x19b04e[_0x227dea])return _0x19b04e[_0x227dea];if(_0x19b04e['TD_API_KEY'])return _0x19b04e['TD_API_KEY'];return undefined;}function cleanupLegacyEnvFile(_0x366408){const _0x105885=a44_0x5c04;if(!existsSync(_0x366408))return![];try{const _0x4fc30b=readFileSync(_0x366408,'utf-8'),_0x549b3d=_0x4fc30b['split']('\x0a'),_0x2180a1=_0x549b3d['filter'](_0x487757=>{const _0x5e31a5=a44_0x5c04,_0x53a5e0=_0x487757[_0x5e31a5(0x117)]();if(!_0x53a5e0||_0x53a5e0['startsWith']('#'))return!![];const [_0x94a9ba]=_0x53a5e0['split']('=');return!_0x94a9ba[_0x5e31a5(0x13a)](_0x5e31a5(0x113));}),_0x13343d=_0x2180a1[_0x105885(0x143)](_0x1acaae=>{const _0x42889a=_0x105885,_0x4d7e25=_0x1acaae[_0x42889a(0x117)]();return _0x4d7e25&&!_0x4d7e25['startsWith']('#');});if(!_0x13343d)return unlinkSync(_0x366408),!![];return writeFileSync(_0x366408,_0x2180a1[_0x105885(0x128)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function a44_0x360e(){const _0x1c6cb9=['TD_API_KEY','site','264240UyKlMq','.cache','trim','existsSync','TDX_API_KEY_','match','map','toISOString','TDX_API_KEY','dev-eu01','keychain\x20(profile:\x20','Warning:\x20Failed\x20to\x20load\x20','account_info.json','accountId','legacy\x20.env\x20file','stg-us01','eu01','parse','tdx.json','join','25768TqxFiH','keychain','ap03','TDX_API_KEY_<PROFILE>','TD_API_KEY\x20env\x20var\x20(deprecated)','account_info.','replace','legacy\x20.env\x20file\x20(profile:\x20','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','profiles','2HvHcYL','profile','apiKey','TD_API_KEY_','toUpperCase','llm_default_project','utf-8','startsWith','string','apiKeys','Warning:\x20Unknown\x20site\x20\x27','686403djQBCI','endsWith','yellow','readFileSync','ap02','some','198FTvJJp','env','tdx','\x20env\x20var','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','1764336xVwmOD','2062620hHLVwp','isDeprecated','TDX_CONFIG_DIR','split','.env','.env.','135242zhlgPG','includes','number','warn','stringify','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','jp01','40048uCIHIw','entries','us01','llm_default_project.','100xzifKC'];a44_0x360e=function(){return _0x1c6cb9;};return a44_0x360e();}function loadProfileEnv(_0x1bd0a7){const _0x4558ea=a44_0x5c04,_0x34b099=a44_0x4a9945[_0x4558ea(0x128)](getConfigDir(),_0x4558ea(0x14f)+_0x1bd0a7);if(a44_0x22665a['existsSync'](_0x34b099)){validateSecureFilePermissions(_0x34b099);try{const _0xf8117a=a44_0x22665a[_0x4558ea(0x141)](_0x34b099,_0x4558ea(0x139));return parseEnvFile(_0xf8117a);}catch(_0x4d696c){console['warn'](_0x4558ea(0x120)+_0x34b099+':\x20'+_0x4d696c);}}const _0x37463a=a44_0x4a9945['join'](getConfigDir(),_0x4558ea(0x132),_0x1bd0a7,_0x4558ea(0x14e));if(a44_0x22665a[_0x4558ea(0x118)](_0x37463a)){validateSecureFilePermissions(_0x37463a);try{const _0x35e17f=a44_0x22665a[_0x4558ea(0x141)](_0x37463a,_0x4558ea(0x139));return parseEnvFile(_0x35e17f);}catch(_0x54c061){return console['warn'](_0x4558ea(0x120)+_0x37463a+':\x20'+_0x54c061),null;}}return null;}function getActiveProfileName(){const _0x359101=a44_0x5c04,_0x5974dd=a44_0x4a9945[_0x359101(0x128)](getConfigDir(),_0x359101(0x127));if(!a44_0x22665a[_0x359101(0x118)](_0x5974dd))return null;try{const _0x221742=a44_0x22665a[_0x359101(0x141)](_0x5974dd,_0x359101(0x139)),_0x5ba67b=JSON['parse'](_0x221742);return _0x5ba67b[_0x359101(0x134)]||null;}catch{return null;}}export function saveAPIKey(_0x2f590b,_0x58b6ca,_0x207b3d){const _0x349ca3=a44_0x5c04,_0xfa70d0=getConfigDir(),_0x2ddf15=getConfigFilePath(_0x207b3d);!existsSync(_0xfa70d0)&&mkdirSync(_0xfa70d0,{'recursive':!![],'mode':0x1c0});let _0x1c0b03={};if(existsSync(_0x2ddf15))try{const _0x2df91c=readFileSync(_0x2ddf15,_0x349ca3(0x139));_0x1c0b03=parseEnvFile(_0x2df91c);}catch(_0xe91c9a){console['warn']('Warning:\x20Failed\x20to\x20read\x20'+_0x2ddf15+':',_0xe91c9a);}const _0x3fc4d4=_0x2f590b[_0x349ca3(0x137)]()[_0x349ca3(0x12f)](/-/g,'_');_0x1c0b03[_0x349ca3(0x136)+_0x3fc4d4]=_0x58b6ca;const _0x4bc6ba=Object[_0x349ca3(0x10f)](_0x1c0b03)[_0x349ca3(0x11b)](([_0xc95e83,_0x34001a])=>_0xc95e83+'='+_0x34001a);writeFileSync(_0x2ddf15,_0x4bc6ba[_0x349ca3(0x128)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x15cfe5,_0x2a83af,_0x3c7a8d){const _0x492c4c=a44_0x5c04;await saveKeychainAPIKey(_0x15cfe5,_0x3c7a8d),setCachedCredential(_0x15cfe5,_0x2a83af,_0x3c7a8d);const _0x296d11=getConfigFilePath(_0x3c7a8d);cleanupLegacyEnvFile(_0x296d11)&&console[_0x492c4c(0x10a)](a44_0x73ef6f[_0x492c4c(0x140)](_0x492c4c(0x131)));}export function loadConfig(){const _0x2366cd=a44_0x5c04,_0x2be9e4={'apiKeys':{},'defaultSite':_0x2366cd(0x110)},_0x5171f0=[_0x2366cd(0x110),'jp01',_0x2366cd(0x125),_0x2366cd(0x142),'ap03','dev-us01',_0x2366cd(0x11e),_0x2366cd(0x124),'stg-jp01','stg-ap03'];for(const _0x289a44 of _0x5171f0){const _0x2b4555=getAPIKey(_0x289a44);_0x2b4555&&(_0x2be9e4[_0x2366cd(0x13c)][_0x289a44]=_0x2b4555);}return _0x2be9e4;}
1
+ (function(_0x5e949d,_0x3cf7ad){const _0x2550f1=a44_0x5e06,_0x2cb161=_0x5e949d();while(!![]){try{const _0x222244=-parseInt(_0x2550f1(0x21a))/0x1*(parseInt(_0x2550f1(0x201))/0x2)+parseInt(_0x2550f1(0x217))/0x3+-parseInt(_0x2550f1(0x20a))/0x4+parseInt(_0x2550f1(0x206))/0x5*(-parseInt(_0x2550f1(0x1ec))/0x6)+parseInt(_0x2550f1(0x228))/0x7*(parseInt(_0x2550f1(0x1f2))/0x8)+parseInt(_0x2550f1(0x22b))/0x9*(parseInt(_0x2550f1(0x205))/0xa)+parseInt(_0x2550f1(0x232))/0xb;if(_0x222244===_0x3cf7ad)break;else _0x2cb161['push'](_0x2cb161['shift']());}catch(_0x444c51){_0x2cb161['push'](_0x2cb161['shift']());}}}(a44_0x5656,0x373cd));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a44_0x109aa1 from'node:fs';import*as a44_0x591638 from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a44_0x29ee18 from'chalk';export function getConfigDir(){const _0xf672ff=a44_0x5e06;return process[_0xf672ff(0x1eb)]['TDX_CONFIG_DIR']||join(homedir(),_0xf672ff(0x20b),_0xf672ff(0x222));}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getConfigFilePath(_0x4095d1){const _0x540ae1=a44_0x5e06,_0x2803e0=getConfigDir();return _0x4095d1?a44_0x591638['join'](_0x2803e0,_0x540ae1(0x210)+_0x4095d1):getConfigFile();}export function getCacheDir(){const _0x7d0be4=a44_0x5e06;return process[_0x7d0be4(0x1eb)][_0x7d0be4(0x21b)]||join(homedir(),_0x7d0be4(0x214),_0x7d0be4(0x222));}export function getLLMProjectCacheFile(_0x3defe5){const _0x3f4053=a44_0x5e06,_0x22904c=_0x3defe5?'llm_default_project.'+_0x3defe5:_0x3f4053(0x236);return join(getCacheDir(),_0x22904c);}export function readCachedLLMProject(_0x13d459){const _0x429d12=a44_0x5e06;try{const _0x573811=getLLMProjectCacheFile(_0x13d459);if(!existsSync(_0x573811))return null;const _0x5292b2=readFileSync(_0x573811,_0x429d12(0x220))[_0x429d12(0x202)]();try{const _0x38c048=JSON[_0x429d12(0x223)](_0x5292b2);if(_0x38c048&&typeof _0x38c048['id']==='string'&&typeof _0x38c048['name']==='string')return _0x38c048;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x1eb588,_0x3351f6,_0x301843){const _0x5de73a=a44_0x5e06;try{const _0x39d291=getCacheDir(),_0x3b186e=getLLMProjectCacheFile(_0x301843);!existsSync(_0x39d291)&&mkdirSync(_0x39d291,{'recursive':!![]});const _0x28ba07={'name':_0x1eb588,'id':_0x3351f6};writeFileSync(_0x3b186e,JSON[_0x5de73a(0x229)](_0x28ba07),_0x5de73a(0x220));}catch{}}export function getAccountInfoCacheFile(_0xa69011){const _0xa3a771=a44_0x5e06,_0x4a8b5d=_0xa69011?_0xa3a771(0x208)+_0xa69011+'.json':_0xa3a771(0x212);return join(getCacheDir(),_0x4a8b5d);}export function readCachedAccountInfo(_0x5793b7){const _0x40ec77=a44_0x5e06;try{const _0x3ae676=getAccountInfoCacheFile(_0x5793b7);if(!existsSync(_0x3ae676))return null;const _0x2c6cf1=readFileSync(_0x3ae676,_0x40ec77(0x220))[_0x40ec77(0x202)](),_0x4902dc=JSON[_0x40ec77(0x223)](_0x2c6cf1);if(_0x4902dc&&typeof _0x4902dc[_0x40ec77(0x22e)]===_0x40ec77(0x224)&&typeof _0x4902dc[_0x40ec77(0x1ee)]===_0x40ec77(0x1f8))return _0x4902dc;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x14cec1,_0x3a1904,_0x227ab8){const _0x4ae3d5=a44_0x5e06;try{const _0x72a38d=getCacheDir(),_0x34e523=getAccountInfoCacheFile(_0x227ab8);!existsSync(_0x72a38d)&&mkdirSync(_0x72a38d,{'recursive':!![]});const _0x2fe800={'site':_0x14cec1,'accountId':_0x3a1904,'cachedAt':new Date()['toISOString']()};writeFileSync(_0x34e523,JSON[_0x4ae3d5(0x229)](_0x2fe800),_0x4ae3d5(0x220));}catch{}}export function parseEnvFile(_0x101b49){const _0x2a7727=a44_0x5e06,_0xa5601a={};for(const _0x146462 of _0x101b49[_0x2a7727(0x215)]('\x0a')){const _0x1cbc02=_0x146462['trim']();if(!_0x1cbc02||_0x1cbc02[_0x2a7727(0x22c)]('#'))continue;const _0x2b77aa=_0x1cbc02['match'](/^([^=]+)=(.*)$/);if(_0x2b77aa){const _0x264ed8=_0x2b77aa[0x1]['trim']();let _0x11b28f=_0x2b77aa[0x2][_0x2a7727(0x202)]();(_0x11b28f[_0x2a7727(0x22c)]('\x22')&&_0x11b28f[_0x2a7727(0x22a)]('\x22')||_0x11b28f[_0x2a7727(0x22c)]('\x27')&&_0x11b28f[_0x2a7727(0x22a)]('\x27'))&&(_0x11b28f=_0x11b28f[_0x2a7727(0x1fd)](0x1,-0x1)),_0xa5601a[_0x264ed8]=_0x11b28f;}}return _0xa5601a;}export function readUserConfig(){const _0xf85e51=a44_0x5e06,_0x1c14b1=getConfigFile();if(!existsSync(_0x1c14b1))return{};try{const _0x1ec1f1=readFileSync(_0x1c14b1,_0xf85e51(0x220));return parseEnvFile(_0x1ec1f1);}catch(_0x485a5e){return console[_0xf85e51(0x200)]('Warning:\x20Failed\x20to\x20read\x20config\x20file\x20'+_0x1c14b1+':',_0x485a5e),{};}}export function resolveSite(_0x49f1b7){const _0x4f1210=a44_0x5e06,_0x41e011=[_0x4f1210(0x22f),_0x4f1210(0x238),_0x4f1210(0x237),_0x4f1210(0x235),_0x4f1210(0x21c),_0x4f1210(0x221),_0x4f1210(0x22d),'stg-us01',_0x4f1210(0x211),_0x4f1210(0x1fb)];if(_0x41e011[_0x4f1210(0x207)](_0x49f1b7))return _0x49f1b7;if(_0x49f1b7 in SITE_ALIASES)return SITE_ALIASES[_0x49f1b7];return console[_0x4f1210(0x200)](_0x4f1210(0x233)+_0x49f1b7+_0x4f1210(0x230)),'us01';}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x5f4900,_0x1020a1){const _0x6df608=a44_0x5e06,_0xccf861=_0x1020a1||getActiveProfileName();if(_0xccf861){const _0x3930cf=_0x6df608(0x20f)+normalizeProfileForEnvVar(_0xccf861);if(process[_0x6df608(0x1eb)][_0x3930cf])return process[_0x6df608(0x1eb)][_0x3930cf];}if(process[_0x6df608(0x1eb)][_0x6df608(0x20d)])return process[_0x6df608(0x1eb)][_0x6df608(0x20d)];if(process['env'][_0x6df608(0x1f7)])return process[_0x6df608(0x1eb)][_0x6df608(0x1f7)];const _0x583948=_0x5f4900[_0x6df608(0x1f0)]()[_0x6df608(0x227)](/-/g,'_'),_0x5d3c38=_0x6df608(0x1ed)+_0x583948;if(_0xccf861){const _0x2e03a9=loadProfileEnv(_0xccf861);if(_0x2e03a9){if(_0x2e03a9[_0x5d3c38])return _0x2e03a9[_0x5d3c38];if(_0x2e03a9['TD_API_KEY'])return _0x2e03a9[_0x6df608(0x1f7)];}}const _0xe83948=loadUserConfigOnce();if(_0xe83948[_0x5d3c38])return _0xe83948[_0x5d3c38];if(_0xe83948['TD_API_KEY'])return _0xe83948[_0x6df608(0x1f7)];return undefined;}function a44_0x5656(){const _0x2a3283=['profiles','legacy\x20.env\x20file\x20(profile:\x20','TD_API_KEY','number','filter','.env','stg-ap03','TDX_API_KEY\x20env\x20var','slice','keychain','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','warn','694256rsEUky','trim','yellow','Warning:\x20Failed\x20to\x20read\x20','208170gEZOhl','5vCzvcE','includes','account_info.','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','177440jdqmdX','.config','isDeprecated','TDX_API_KEY','some','TDX_API_KEY_','.env.','stg-jp01','account_info.json','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','.cache','split','map','595245iqKAWs','apiKey','stg-us01','1eVFHqE','TDX_CACHE_DIR','ap03','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','source','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','utf-8','dev-us01','tdx','parse','string','keychain\x20(profile:\x20','readFileSync','replace','7aZFwWr','stringify','endsWith','54SorjBO','startsWith','dev-eu01','site','us01','\x27,\x20defaulting\x20to\x20us01','apiKeys','1944074FtqQfy','Warning:\x20Unknown\x20site\x20\x27','profile','ap02','llm_default_project','eu01','jp01','existsSync','env','1104618XZJgYl','TD_API_KEY_','accountId','legacy\x20.env\x20file','toUpperCase','join','2414344lJNFBk','Warning:\x20Failed\x20to\x20load\x20','TDX_API_KEY_<PROFILE>'];a44_0x5656=function(){return _0x2a3283;};return a44_0x5656();}export function normalizeProfileForEnvVar(_0x9a38e6){const _0xb30002=a44_0x5e06;return _0x9a38e6[_0xb30002(0x1f0)]()[_0xb30002(0x227)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0xe7d261,_0x120acc){const _0x570887=a44_0x5e06,_0x459f9f=_0x120acc||getActiveProfileName()||undefined;if(_0x459f9f){const _0x22904f=_0x570887(0x20f)+normalizeProfileForEnvVar(_0x459f9f);if(process[_0x570887(0x1eb)][_0x22904f])return{'apiKey':process[_0x570887(0x1eb)][_0x22904f],'source':_0x22904f+'\x20env\x20var','isDeprecated':![]};const _0x7cb189=getCachedCredential(_0xe7d261,_0x459f9f);if(_0x7cb189)return{'apiKey':_0x7cb189,'source':_0x570887(0x225)+_0x459f9f+')','isDeprecated':![]};const _0x500c32=await getKeychainAPIKey(_0x459f9f);if(_0x500c32)return setCachedCredential(_0x500c32,_0xe7d261,_0x459f9f),{'apiKey':_0x500c32,'source':_0x570887(0x225)+_0x459f9f+')','isDeprecated':![]};}if(process[_0x570887(0x1eb)][_0x570887(0x20d)])return{'apiKey':process[_0x570887(0x1eb)][_0x570887(0x20d)],'source':_0x570887(0x1fc),'isDeprecated':![]};if(!_0x459f9f){const _0x503e3c=getCachedCredential(_0xe7d261,undefined);if(_0x503e3c)return{'apiKey':_0x503e3c,'source':_0x570887(0x1fe),'isDeprecated':![]};const _0x1828dd=await getKeychainAPIKey(undefined);if(_0x1828dd)return setCachedCredential(_0x1828dd,_0xe7d261,undefined),{'apiKey':_0x1828dd,'source':_0x570887(0x1fe),'isDeprecated':![]};}if(process[_0x570887(0x1eb)]['TD_API_KEY'])return{'apiKey':process[_0x570887(0x1eb)]['TD_API_KEY'],'source':'TD_API_KEY\x20env\x20var\x20(deprecated)','isDeprecated':!![]};const _0x3ac8b9=getLegacyEnvAPIKey(_0xe7d261,_0x459f9f);if(_0x3ac8b9){const _0x22a175=await isKeychainAvailable();if(_0x22a175)try{await saveKeychainAPIKey(_0x3ac8b9,_0x459f9f),setCachedCredential(_0x3ac8b9,_0xe7d261,_0x459f9f);const _0x12a447=getConfigFilePath(_0x459f9f);cleanupLegacyEnvFile(_0x12a447)&&console[_0x570887(0x200)](a44_0x29ee18[_0x570887(0x203)](_0x570887(0x1ff)));}catch(_0x1509f0){console[_0x570887(0x200)](a44_0x29ee18[_0x570887(0x203)](_0x570887(0x21f)+_0x1509f0));}const _0x32a74e=_0x459f9f?_0x570887(0x1f6)+_0x459f9f+')':_0x570887(0x1ef);return{'apiKey':_0x3ac8b9,'source':_0x32a74e,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x4c31dd,_0x3d790d,_0x376d6e=!![]){const _0x4499b5=a44_0x5e06,_0x189c40=await resolveAPIKeyAsync(_0x4c31dd,_0x3d790d);if(!_0x189c40)return undefined;if(_0x376d6e&&_0x189c40[_0x4499b5(0x20c)]&&_0x189c40[_0x4499b5(0x21e)][_0x4499b5(0x207)](_0x4499b5(0x1f7))){const _0x512f41=_0x3d790d||getActiveProfileName()||undefined,_0x4e96b4=_0x512f41?_0x4499b5(0x20f)+normalizeProfileForEnvVar(_0x512f41):_0x4499b5(0x1f4);console['warn'](a44_0x29ee18[_0x4499b5(0x203)](_0x4499b5(0x21d)+(_0x4499b5(0x209)+_0x4e96b4+').')));}return _0x189c40[_0x4499b5(0x218)];}function getLegacyEnvAPIKey(_0x5ee33b,_0x3eb35d){const _0x2af41f=a44_0x5e06,_0x26b156=_0x5ee33b[_0x2af41f(0x1f0)]()['replace'](/-/g,'_'),_0x1fac2f='TD_API_KEY_'+_0x26b156;if(_0x3eb35d){const _0x2585ec=loadProfileEnv(_0x3eb35d);if(_0x2585ec){if(_0x2585ec[_0x1fac2f])return _0x2585ec[_0x1fac2f];if(_0x2585ec[_0x2af41f(0x1f7)])return _0x2585ec['TD_API_KEY'];}}const _0x4b936d=loadUserConfigOnce();if(_0x4b936d[_0x1fac2f])return _0x4b936d[_0x1fac2f];if(_0x4b936d[_0x2af41f(0x1f7)])return _0x4b936d[_0x2af41f(0x1f7)];return undefined;}function cleanupLegacyEnvFile(_0x3adf83){const _0x5ec01d=a44_0x5e06;if(!existsSync(_0x3adf83))return![];try{const _0x488ff5=readFileSync(_0x3adf83,_0x5ec01d(0x220)),_0x56da53=_0x488ff5[_0x5ec01d(0x215)]('\x0a'),_0xf949a6=_0x56da53[_0x5ec01d(0x1f9)](_0xfaedf0=>{const _0x50180a=_0x5ec01d,_0x3be377=_0xfaedf0['trim']();if(!_0x3be377||_0x3be377[_0x50180a(0x22c)]('#'))return!![];const [_0x4a035a]=_0x3be377[_0x50180a(0x215)]('=');return!_0x4a035a[_0x50180a(0x22c)]('TD_API_KEY');}),_0x2ce9ec=_0xf949a6[_0x5ec01d(0x20e)](_0x3dd2f1=>{const _0x34369b=_0x5ec01d,_0x4f0038=_0x3dd2f1[_0x34369b(0x202)]();return _0x4f0038&&!_0x4f0038[_0x34369b(0x22c)]('#');});if(!_0x2ce9ec)return unlinkSync(_0x3adf83),!![];return writeFileSync(_0x3adf83,_0xf949a6[_0x5ec01d(0x1f1)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x1f49b5){const _0x7a22db=a44_0x5e06,_0x3fb985=a44_0x591638[_0x7a22db(0x1f1)](getConfigDir(),_0x7a22db(0x210)+_0x1f49b5);if(a44_0x109aa1['existsSync'](_0x3fb985)){validateSecureFilePermissions(_0x3fb985);try{const _0x3e01d9=a44_0x109aa1[_0x7a22db(0x226)](_0x3fb985,_0x7a22db(0x220));return parseEnvFile(_0x3e01d9);}catch(_0x5773e3){console[_0x7a22db(0x200)]('Warning:\x20Failed\x20to\x20load\x20'+_0x3fb985+':\x20'+_0x5773e3);}}const _0x3cd008=a44_0x591638['join'](getConfigDir(),_0x7a22db(0x1f5),_0x1f49b5,_0x7a22db(0x1fa));if(a44_0x109aa1[_0x7a22db(0x1ea)](_0x3cd008)){validateSecureFilePermissions(_0x3cd008);try{const _0x8c885a=a44_0x109aa1[_0x7a22db(0x226)](_0x3cd008,'utf-8');return parseEnvFile(_0x8c885a);}catch(_0x5cfd61){return console[_0x7a22db(0x200)](_0x7a22db(0x1f3)+_0x3cd008+':\x20'+_0x5cfd61),null;}}return null;}function getActiveProfileName(){const _0x3d51bb=a44_0x5e06,_0x357b17=a44_0x591638['join'](getConfigDir(),'tdx.json');if(!a44_0x109aa1[_0x3d51bb(0x1ea)](_0x357b17))return null;try{const _0x7495a6=a44_0x109aa1[_0x3d51bb(0x226)](_0x357b17,_0x3d51bb(0x220)),_0x3e91ff=JSON[_0x3d51bb(0x223)](_0x7495a6);return _0x3e91ff[_0x3d51bb(0x234)]||null;}catch{return null;}}export function saveAPIKey(_0x16cd82,_0x294b85,_0x2baab1){const _0x4ef280=a44_0x5e06,_0xcecf38=getConfigDir(),_0xa37cad=getConfigFilePath(_0x2baab1);!existsSync(_0xcecf38)&&mkdirSync(_0xcecf38,{'recursive':!![],'mode':0x1c0});let _0x490dd9={};if(existsSync(_0xa37cad))try{const _0x6a46de=readFileSync(_0xa37cad,_0x4ef280(0x220));_0x490dd9=parseEnvFile(_0x6a46de);}catch(_0x380996){console[_0x4ef280(0x200)](_0x4ef280(0x204)+_0xa37cad+':',_0x380996);}const _0x26b3ac=_0x16cd82['toUpperCase']()['replace'](/-/g,'_');_0x490dd9['TD_API_KEY_'+_0x26b3ac]=_0x294b85;const _0x324a92=Object['entries'](_0x490dd9)[_0x4ef280(0x216)](([_0x399ea3,_0x43e721])=>_0x399ea3+'='+_0x43e721);writeFileSync(_0xa37cad,_0x324a92[_0x4ef280(0x1f1)]('\x0a')+'\x0a',{'mode':0x180});}function a44_0x5e06(_0x3d5c93,_0x161d2c){_0x3d5c93=_0x3d5c93-0x1ea;const _0x56567a=a44_0x5656();let _0x5e064d=_0x56567a[_0x3d5c93];return _0x5e064d;}export async function saveAPIKeyAsync(_0x44f705,_0x207a81,_0x13385a){const _0x37e5d5=a44_0x5e06;await saveKeychainAPIKey(_0x44f705,_0x13385a),setCachedCredential(_0x44f705,_0x207a81,_0x13385a);const _0x2c716f=getConfigFilePath(_0x13385a);cleanupLegacyEnvFile(_0x2c716f)&&console[_0x37e5d5(0x200)](a44_0x29ee18[_0x37e5d5(0x203)](_0x37e5d5(0x213)));}export function loadConfig(){const _0x4eef1e=a44_0x5e06,_0x5d4e91={'apiKeys':{},'defaultSite':'us01'},_0x24af2a=[_0x4eef1e(0x22f),_0x4eef1e(0x238),_0x4eef1e(0x237),_0x4eef1e(0x235),'ap03',_0x4eef1e(0x221),_0x4eef1e(0x22d),_0x4eef1e(0x219),_0x4eef1e(0x211),_0x4eef1e(0x1fb)];for(const _0x574afa of _0x24af2a){const _0x4257dd=getAPIKey(_0x574afa);_0x4257dd&&(_0x5d4e91[_0x4eef1e(0x231)][_0x574afa]=_0x4257dd);}return _0x5d4e91;}
@@ -1 +1 @@
1
- (function(_0x1def00,_0x34a79d){const _0x28a525=a45_0x13aa,_0x2afebc=_0x1def00();while(!![]){try{const _0x40cd47=-parseInt(_0x28a525(0x1e8))/0x1+parseInt(_0x28a525(0x1f1))/0x2+parseInt(_0x28a525(0x1e7))/0x3*(-parseInt(_0x28a525(0x1ec))/0x4)+parseInt(_0x28a525(0x1e2))/0x5*(-parseInt(_0x28a525(0x1ee))/0x6)+parseInt(_0x28a525(0x1e3))/0x7+-parseInt(_0x28a525(0x1e4))/0x8+parseInt(_0x28a525(0x1e6))/0x9;if(_0x40cd47===_0x34a79d)break;else _0x2afebc['push'](_0x2afebc['shift']());}catch(_0x349079){_0x2afebc['push'](_0x2afebc['shift']());}}}(a45_0x2484,0x39689));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';function a45_0x2484(){const _0x3ee367=['10exfipG','597975IQgEDC','611760sqFHZz','utf-8','12663018bgCjbq','2004FeAxoW','413512NRcCHf','now','stringify','connections-','2800uANQKA','connections','1104114ahoVof','parse','.json','136676FnaIjO'];a45_0x2484=function(){return _0x3ee367;};return a45_0x2484();}import{getCacheDir}from'./config.js';function getCacheFilePath(_0xfcbef1){const _0x302e1f=a45_0x13aa,_0x37e911=_0xfcbef1||'default';return join(getCacheDir(),_0x302e1f(0x1eb)+_0x37e911+_0x302e1f(0x1f0));}export function loadCachedConnections(_0x9ea7f0){const _0x277502=a45_0x13aa,_0x2675e1=getCacheFilePath(_0x9ea7f0);if(!existsSync(_0x2675e1))return null;try{const _0x25418b=readFileSync(_0x2675e1,_0x277502(0x1e5)),_0x5ef95f=JSON[_0x277502(0x1ef)](_0x25418b);return _0x5ef95f[_0x277502(0x1ed)];}catch{return null;}}export function saveCachedConnections(_0x4e8706,_0x239eed){const _0x112e09=a45_0x13aa,_0x54a145=getCacheDir();!existsSync(_0x54a145)&&mkdirSync(_0x54a145,{'recursive':!![]});const _0x52e36b=getCacheFilePath(_0x4e8706),_0x2f3cfb={'connections':_0x239eed,'cachedAt':Date[_0x112e09(0x1e9)]()};writeFileSync(_0x52e36b,JSON[_0x112e09(0x1ea)](_0x2f3cfb,null,0x2),_0x112e09(0x1e5));}function a45_0x13aa(_0x19ae77,_0x400e4e){_0x19ae77=_0x19ae77-0x1e2;const _0x248438=a45_0x2484();let _0x13aaed=_0x248438[_0x19ae77];return _0x13aaed;}export function clearConnectionCache(_0xb49644){const _0x56c0ee=getCacheFilePath(_0xb49644);if(existsSync(_0x56c0ee))try{unlinkSync(_0x56c0ee);}catch{}}
1
+ (function(_0x4665c2,_0x4aaa9f){const _0x556b44=a45_0x2aac,_0x20ddcb=_0x4665c2();while(!![]){try{const _0x54058a=-parseInt(_0x556b44(0x80))/0x1+-parseInt(_0x556b44(0x81))/0x2+-parseInt(_0x556b44(0x7d))/0x3*(-parseInt(_0x556b44(0x8a))/0x4)+parseInt(_0x556b44(0x83))/0x5*(parseInt(_0x556b44(0x84))/0x6)+-parseInt(_0x556b44(0x8c))/0x7*(parseInt(_0x556b44(0x7c))/0x8)+-parseInt(_0x556b44(0x89))/0x9*(-parseInt(_0x556b44(0x88))/0xa)+-parseInt(_0x556b44(0x82))/0xb*(-parseInt(_0x556b44(0x85))/0xc);if(_0x54058a===_0x4aaa9f)break;else _0x20ddcb['push'](_0x20ddcb['shift']());}catch(_0x4b63d8){_0x20ddcb['push'](_0x20ddcb['shift']());}}}(a45_0xc883,0x6c2d5));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';import{getCacheDir}from'./config.js';function a45_0x2aac(_0x515bb4,_0x43c071){_0x515bb4=_0x515bb4-0x7c;const _0xc8832d=a45_0xc883();let _0x2aacc6=_0xc8832d[_0x515bb4];return _0x2aacc6;}function a45_0xc883(){const _0x5b41c0=['221625NeUODs','12248uiNLHd','.json','637ONFoAs','71904KZOFwY','3qJqZsP','parse','stringify','816578fwLCyJ','215866uombDS','22ButDhV','145EeEJIG','93798hHRtze','9340308AGuzQI','utf-8','connections-','70GkkDDo'];a45_0xc883=function(){return _0x5b41c0;};return a45_0xc883();}function getCacheFilePath(_0x3f1c12){const _0x470dda=a45_0x2aac,_0x1b0a9a=_0x3f1c12||'default';return join(getCacheDir(),_0x470dda(0x87)+_0x1b0a9a+_0x470dda(0x8b));}export function loadCachedConnections(_0x40d767){const _0x277817=a45_0x2aac,_0x408b83=getCacheFilePath(_0x40d767);if(!existsSync(_0x408b83))return null;try{const _0x57275e=readFileSync(_0x408b83,_0x277817(0x86)),_0x3f5ea9=JSON[_0x277817(0x7e)](_0x57275e);return _0x3f5ea9['connections'];}catch{return null;}}export function saveCachedConnections(_0x1d3ecc,_0xa1e60f){const _0x1202ba=a45_0x2aac,_0x1335c0=getCacheDir();!existsSync(_0x1335c0)&&mkdirSync(_0x1335c0,{'recursive':!![]});const _0x50557a=getCacheFilePath(_0x1d3ecc),_0x2d5de8={'connections':_0xa1e60f,'cachedAt':Date['now']()};writeFileSync(_0x50557a,JSON[_0x1202ba(0x7f)](_0x2d5de8,null,0x2),_0x1202ba(0x86));}export function clearConnectionCache(_0x4d527f){const _0x15a723=getCacheFilePath(_0x4d527f);if(existsSync(_0x15a723))try{unlinkSync(_0x15a723);}catch{}}
@@ -1 +1 @@
1
- (function(_0x1c1974,_0x1cdb1d){const _0x140d32=a46_0xfbf5,_0x13f39b=_0x1c1974();while(!![]){try{const _0x183e73=parseInt(_0x140d32(0x1db))/0x1*(-parseInt(_0x140d32(0x1ce))/0x2)+-parseInt(_0x140d32(0x1d0))/0x3+-parseInt(_0x140d32(0x1d9))/0x4*(parseInt(_0x140d32(0x1d8))/0x5)+parseInt(_0x140d32(0x1dd))/0x6+parseInt(_0x140d32(0x1cc))/0x7*(-parseInt(_0x140d32(0x1da))/0x8)+parseInt(_0x140d32(0x1de))/0x9+-parseInt(_0x140d32(0x1cf))/0xa*(-parseInt(_0x140d32(0x1dc))/0xb);if(_0x183e73===_0x1cdb1d)break;else _0x13f39b['push'](_0x13f39b['shift']());}catch(_0x2ce83){_0x13f39b['push'](_0x13f39b['shift']());}}}(a46_0x5cfd,0x88b4f));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function a46_0xfbf5(_0x310d3b,_0x5bc320){_0x310d3b=_0x310d3b-0x1cc;const _0x5cfd1a=a46_0x5cfd();let _0xfbf5a6=_0x5cfd1a[_0x310d3b];return _0xfbf5a6;}function getCacheKey(_0x57f6fe,_0x60f720){const _0x5491d7=a46_0xfbf5,_0x3f8d8a=_0x57f6fe||_0x5491d7(0x1d6),_0x5519bf=_0x60f720||_0x5491d7(0x1d3);return _0x3f8d8a+':'+_0x5519bf;}export function getCachedCredential(_0x62260b,_0x4f6de4){const _0x18f81e=a46_0xfbf5,_0x4c3f3f=getCacheKey(_0x62260b,_0x4f6de4),_0x24e5f0=cache['get'](_0x4c3f3f);if(!_0x24e5f0)return null;if(Date[_0x18f81e(0x1d7)]()-_0x24e5f0[_0x18f81e(0x1d2)]>CACHE_TTL_MS)return cache[_0x18f81e(0x1cd)](_0x4c3f3f),null;return _0x24e5f0[_0x18f81e(0x1d4)];}export function setCachedCredential(_0x55185a,_0x10cfb9,_0x2ac16e){const _0x57aa37=a46_0xfbf5,_0x3333ca=getCacheKey(_0x10cfb9,_0x2ac16e);cache[_0x57aa37(0x1d1)](_0x3333ca,{'apiKey':_0x55185a,'loadedAt':Date[_0x57aa37(0x1d7)]()});}export function clearCredentialCache(){const _0x7d862d=a46_0xfbf5;cache[_0x7d862d(0x1d5)]();}function a46_0x5cfd(){const _0x180317=['31715BJNypX','668CPMUBN','7134024IUeOCE','103654gLTAvI','21317461WiIgAE','6417066eHhLyk','6896250ONHahT','7gxNQlW','delete','4hLrNwu','10RdZHUK','3166257kWDren','set','loadedAt','__default_profile__','apiKey','clear','__default_site__','now'];a46_0x5cfd=function(){return _0x180317;};return a46_0x5cfd();}export function clearCachedCredential(_0x419a27,_0x5f4c7e){const _0xf49479=a46_0xfbf5,_0x2e4659=getCacheKey(_0x419a27,_0x5f4c7e);cache[_0xf49479(0x1cd)](_0x2e4659);}
1
+ function a46_0x1248(_0x43b036,_0x345dd9){_0x43b036=_0x43b036-0xfd;const _0x1753d3=a46_0x1753();let _0x124867=_0x1753d3[_0x43b036];return _0x124867;}(function(_0x4143d6,_0x27200b){const _0xe959ad=a46_0x1248,_0x387487=_0x4143d6();while(!![]){try{const _0x442211=parseInt(_0xe959ad(0x100))/0x1+parseInt(_0xe959ad(0x109))/0x2*(-parseInt(_0xe959ad(0x10b))/0x3)+-parseInt(_0xe959ad(0x10c))/0x4*(-parseInt(_0xe959ad(0x107))/0x5)+parseInt(_0xe959ad(0xfe))/0x6*(-parseInt(_0xe959ad(0x102))/0x7)+-parseInt(_0xe959ad(0x10a))/0x8*(parseInt(_0xe959ad(0x10d))/0x9)+parseInt(_0xe959ad(0x105))/0xa+-parseInt(_0xe959ad(0xfd))/0xb*(-parseInt(_0xe959ad(0x103))/0xc);if(_0x442211===_0x27200b)break;else _0x387487['push'](_0x387487['shift']());}catch(_0x3478a5){_0x387487['push'](_0x387487['shift']());}}}(a46_0x1753,0xcfeaf));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x2c79ab,_0x4a021c){const _0x2d12ad=a46_0x1248,_0x2a2b41=_0x2c79ab||_0x2d12ad(0x104),_0x183fd0=_0x4a021c||_0x2d12ad(0x106);return _0x2a2b41+':'+_0x183fd0;}function a46_0x1753(){const _0x7a7978=['980958ginBCH','4twndeS','9846CoSvyG','apiKey','253ChdEPq','6rbiIIo','set','249831WVvWPX','clear','11673095TczuiE','739920pwKVIC','__default_site__','11121240LCctBW','__default_profile__','6099985oKERZv','delete','6eRJSsu','3656nzoxIj'];a46_0x1753=function(){return _0x7a7978;};return a46_0x1753();}export function getCachedCredential(_0x394ae5,_0x1ca7dd){const _0x5f00c9=a46_0x1248,_0x34e2c5=getCacheKey(_0x394ae5,_0x1ca7dd),_0x52b345=cache['get'](_0x34e2c5);if(!_0x52b345)return null;if(Date['now']()-_0x52b345['loadedAt']>CACHE_TTL_MS)return cache[_0x5f00c9(0x108)](_0x34e2c5),null;return _0x52b345[_0x5f00c9(0x10e)];}export function setCachedCredential(_0x2cdb61,_0x23fcd6,_0xe0db7d){const _0x59607d=a46_0x1248,_0x3059e4=getCacheKey(_0x23fcd6,_0xe0db7d);cache[_0x59607d(0xff)](_0x3059e4,{'apiKey':_0x2cdb61,'loadedAt':Date['now']()});}export function clearCredentialCache(){const _0x2b5df9=a46_0x1248;cache[_0x2b5df9(0x101)]();}export function clearCachedCredential(_0x127522,_0x23d714){const _0x33c221=a46_0x1248,_0x26da3b=getCacheKey(_0x127522,_0x23d714);cache[_0x33c221(0x108)](_0x26da3b);}
@@ -1 +1 @@
1
- const a47_0x5a1520=a47_0x356e;(function(_0x59a241,_0x419120){const _0x5c2359=a47_0x356e,_0x2d3348=_0x59a241();while(!![]){try{const _0x4e4990=parseInt(_0x5c2359(0x16a))/0x1+parseInt(_0x5c2359(0x140))/0x2+-parseInt(_0x5c2359(0x15b))/0x3+parseInt(_0x5c2359(0x160))/0x4+parseInt(_0x5c2359(0x169))/0x5*(parseInt(_0x5c2359(0x13e))/0x6)+-parseInt(_0x5c2359(0x14c))/0x7+parseInt(_0x5c2359(0x16d))/0x8;if(_0x4e4990===_0x419120)break;else _0x2d3348['push'](_0x2d3348['shift']());}catch(_0x401397){_0x2d3348['push'](_0x2d3348['shift']());}}}(a47_0x2b46,0x28240));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 a47_0x1377ce from'node:fs';function a47_0x356e(_0x63b287,_0x4d971c){_0x63b287=_0x63b287-0x135;const _0x2b4673=a47_0x2b46();let _0x356ed5=_0x2b4673[_0x63b287];return _0x356ed5;}function a47_0x2b46(){const _0x31aefc=['us01','1018824DzlBlQ','join','profile','getParameters','replace','activeProfile','CLI\x20flag:\x20--','existsSync','apiKey','entries','toString','displayWithSources','project','segmentPath','Global','Profile\x20Credentials','global','24xkvvra','sessions','48524IOZVDU','logLevel','INFO','display','not\x20set','configFiles','sessionId','verbose','.env','getSource','profile:\x20','default','2034270QneVlA','session','segment_path','(session:\x20',':\x20none','llmProject','utf-8','log','layers','cliFlags','loadGlobalConfig','database','readFileSync','string','parse','666303uHdhxN','parent_segment',':\x20none\x20(using\x20session:\x20','resolveAPIKeyAsync','Profile','960460ejFjmg','globalCredentials','tdx.json','Session','profiles','site','\x0a[configuration\x20files]','(active)','parentSegment','125445oaPAeh','185041IfpJda','llm_project'];a47_0x2b46=function(){return _0x31aefc;};return a47_0x2b46();}import*as a47_0x59f632 from'node:path';export class GlobalContext{['site'];[a47_0x5a1520(0x157)];[a47_0x5a1520(0x15c)];[a47_0x5a1520(0x14e)];[a47_0x5a1520(0x16b)];[a47_0x5a1520(0x135)];['verbose'];[a47_0x5a1520(0x141)];[a47_0x5a1520(0x16f)];['layers'];['activeProfile'];['sessionId'];['configFiles'];constructor(_0x24ab02){const _0x4f0158=a47_0x5a1520;this[_0x4f0158(0x146)]=_0x24ab02[_0x4f0158(0x14d)]||getCurrentSessionPID()[_0x4f0158(0x137)]();const _0x3eba9f=loadSessionContext(_0x24ab02[_0x4f0158(0x14d)]),_0x422504=loadProjectConfig(),_0x32a6e3=this[_0x4f0158(0x156)]();this['activeProfile']=_0x24ab02[_0x4f0158(0x16f)]||_0x3eba9f?.['profile']||_0x32a6e3['profile']||getActiveProfile();const _0x16d404=this['activeProfile']?loadProfile(this[_0x4f0158(0x172)]):null,_0x20e042=_0x496d7a=>{const _0x468e56=_0x4f0158;if(!_0x496d7a)return{};const _0xbc251d=_0x496d7a,_0x3c8f74={};for(const [_0xc095ce,_0x13741f]of Object[_0x468e56(0x136)](_0xbc251d)){typeof _0x13741f===_0x468e56(0x159)&&(_0x3c8f74[_0xc095ce]=_0x13741f);}return _0x3c8f74;},_0x37676d={};if(_0x24ab02['site']&&_0x24ab02['site']!==_0x4f0158(0x16c))_0x37676d[_0x4f0158(0x165)]=_0x24ab02[_0x4f0158(0x165)];const _0x534f5f=_0x3eba9f?.[_0x4f0158(0x157)],_0x5db9a7=_0x422504?.[_0x4f0158(0x157)],_0x183cee=_0x16d404?.['config']?.[_0x4f0158(0x157)],_0xee4b9d=_0x32a6e3[_0x4f0158(0x157)];_0x24ab02[_0x4f0158(0x157)]&&(_0x24ab02[_0x4f0158(0x157)]!==_0x534f5f&&_0x24ab02['database']!==_0x5db9a7&&_0x24ab02['database']!==_0x183cee&&_0x24ab02[_0x4f0158(0x157)]!==_0xee4b9d)&&(_0x37676d['database']=_0x24ab02['database']);if(_0x24ab02[_0x4f0158(0x168)])_0x37676d[_0x4f0158(0x15c)]=_0x24ab02[_0x4f0158(0x168)];if(_0x24ab02['llmProject'])_0x37676d[_0x4f0158(0x16b)]=_0x24ab02['llmProject'];if(_0x24ab02['profile'])_0x37676d[_0x4f0158(0x16f)]=_0x24ab02['profile'];this[_0x4f0158(0x154)]={'cliFlags':_0x37676d,'session':_0x20e042(_0x3eba9f),'project':_0x20e042(_0x422504),'profile':_0x20e042(_0x16d404?.['config']),'global':_0x20e042(_0x32a6e3)};const _0x2b93af={...this[_0x4f0158(0x154)][_0x4f0158(0x13d)],...this[_0x4f0158(0x154)][_0x4f0158(0x16f)],...this[_0x4f0158(0x154)]['project'],...this[_0x4f0158(0x154)]['session'],...this[_0x4f0158(0x154)]['cliFlags']},_0x2471e0=_0x2b93af[_0x4f0158(0x165)]||_0x4f0158(0x16c);this[_0x4f0158(0x165)]=resolveSite(_0x2471e0),this[_0x4f0158(0x157)]=_0x2b93af[_0x4f0158(0x157)],this[_0x4f0158(0x15c)]=_0x2b93af[_0x4f0158(0x15c)],this[_0x4f0158(0x14e)]=_0x2b93af[_0x4f0158(0x14e)],this[_0x4f0158(0x16b)]=_0x2b93af[_0x4f0158(0x16b)],this[_0x4f0158(0x147)]=_0x24ab02['verbose']||![],this[_0x4f0158(0x141)]=_0x24ab02[_0x4f0158(0x141)]??LogLevel[_0x4f0158(0x142)],this[_0x4f0158(0x16f)]=this[_0x4f0158(0x172)]||undefined,this[_0x4f0158(0x135)]=getAPIKey(this[_0x4f0158(0x165)],this[_0x4f0158(0x172)]||undefined);const _0x14e2b0=getConfigDir(),_0x18379f=a47_0x59f632[_0x4f0158(0x16e)](_0x14e2b0,_0x4f0158(0x13f),this['sessionId']+'.json'),_0xa6a430=findProjectConfigPath(),_0x387d7b=a47_0x59f632[_0x4f0158(0x16e)](_0x14e2b0,_0x4f0158(0x162)),_0xa28297=a47_0x59f632[_0x4f0158(0x16e)](_0x14e2b0,_0x4f0158(0x148));let _0x34b2f1=null,_0x336300=null;this['activeProfile']&&(_0x34b2f1=a47_0x59f632[_0x4f0158(0x16e)](_0x14e2b0,_0x4f0158(0x164),this[_0x4f0158(0x172)],_0x4f0158(0x162)),_0x336300=a47_0x59f632[_0x4f0158(0x16e)](_0x14e2b0,_0x4f0158(0x164),this[_0x4f0158(0x172)],_0x4f0158(0x148))),this['configFiles']={'session':a47_0x1377ce[_0x4f0158(0x174)](_0x18379f)?_0x18379f:null,'project':_0xa6a430,'profile':_0x34b2f1&&a47_0x1377ce[_0x4f0158(0x174)](_0x34b2f1)?_0x34b2f1:null,'profileCredentials':_0x336300&&a47_0x1377ce[_0x4f0158(0x174)](_0x336300)?_0x336300:null,'global':a47_0x1377ce[_0x4f0158(0x174)](_0x387d7b)?_0x387d7b:null,'globalCredentials':a47_0x1377ce[_0x4f0158(0x174)](_0xa28297)?_0xa28297:null};}['getSource'](_0x4a9766,_0x4c233a){const _0x2bdeea=a47_0x5a1520;if(!_0x4c233a)return _0x2bdeea(0x144);const _0x370203=_0x4c233a;if(this[_0x2bdeea(0x154)][_0x2bdeea(0x155)][_0x4a9766]===_0x370203){if(_0x4a9766===_0x2bdeea(0x165)&&_0x370203===_0x2bdeea(0x16c)&&!this[_0x2bdeea(0x154)][_0x2bdeea(0x14d)][_0x2bdeea(0x165)]&&!this[_0x2bdeea(0x154)]['project'][_0x2bdeea(0x165)]&&!this['layers'][_0x2bdeea(0x16f)][_0x2bdeea(0x165)]&&!this['layers']['global']['site'])return _0x2bdeea(0x14b);return _0x2bdeea(0x173)+_0x4a9766[_0x2bdeea(0x171)](/_/g,'-');}if(this[_0x2bdeea(0x154)][_0x2bdeea(0x14d)][_0x4a9766]===_0x370203)return _0x2bdeea(0x14d);if(this[_0x2bdeea(0x154)]['project'][_0x4a9766]===_0x370203)return'project';if(this['layers'][_0x2bdeea(0x16f)][_0x4a9766]===_0x370203)return _0x2bdeea(0x14a)+this[_0x2bdeea(0x172)];if(this[_0x2bdeea(0x154)]['global'][_0x4a9766]===_0x370203)return _0x2bdeea(0x13d);return _0x2bdeea(0x14b);}[a47_0x5a1520(0x156)](){const _0x2f7d6c=a47_0x5a1520,_0x14ecb5=a47_0x59f632[_0x2f7d6c(0x16e)](getConfigDir(),_0x2f7d6c(0x162));if(!a47_0x1377ce[_0x2f7d6c(0x174)](_0x14ecb5))return{};try{const _0x278a07=a47_0x1377ce[_0x2f7d6c(0x158)](_0x14ecb5,_0x2f7d6c(0x152));return JSON[_0x2f7d6c(0x15a)](_0x278a07);}catch{return{};}}['injectIntoOptions'](_0x27df46){const _0x30d3ab=a47_0x5a1520;_0x27df46[_0x30d3ab(0x165)]=this[_0x30d3ab(0x165)],!_0x27df46[_0x30d3ab(0x157)]&&this[_0x30d3ab(0x157)]&&(_0x27df46[_0x30d3ab(0x157)]=this[_0x30d3ab(0x157)]),!_0x27df46[_0x30d3ab(0x168)]&&this[_0x30d3ab(0x15c)]&&(_0x27df46[_0x30d3ab(0x168)]=this[_0x30d3ab(0x15c)]),!_0x27df46[_0x30d3ab(0x13a)]&&this[_0x30d3ab(0x14e)]&&(_0x27df46[_0x30d3ab(0x13a)]=this[_0x30d3ab(0x14e)]),!_0x27df46['llmProject']&&this[_0x30d3ab(0x16b)]&&(_0x27df46[_0x30d3ab(0x151)]=this[_0x30d3ab(0x16b)]);}['getParameters'](){const _0x5dc2ca=a47_0x5a1520;return[{'key':_0x5dc2ca(0x165),'value':this[_0x5dc2ca(0x165)]},{'key':'database','value':this[_0x5dc2ca(0x157)]},{'key':'parent_segment','value':this['parent_segment']},{'key':'segment_path','value':this[_0x5dc2ca(0x14e)]},{'key':_0x5dc2ca(0x16b),'value':this[_0x5dc2ca(0x16b)]},{'key':_0x5dc2ca(0x16f),'value':this[_0x5dc2ca(0x172)]||undefined}];}[a47_0x5a1520(0x143)](){const _0x3b0d44=a47_0x5a1520;console['log']('[context]');for(const {key:_0x373262,value:_0x459d8a}of this[_0x3b0d44(0x170)]()){_0x459d8a&&console['log'](_0x373262+':\x20'+_0x459d8a);}}[a47_0x5a1520(0x138)](){const _0x105071=a47_0x5a1520;console[_0x105071(0x153)]('[context]');for(const {key:_0x355776,value:_0x4927e8}of this[_0x105071(0x170)]()){if(_0x4927e8){const _0x476dc9=_0x355776===_0x105071(0x16f)?_0x105071(0x167):'('+this[_0x105071(0x149)](_0x355776,_0x4927e8)+')';console[_0x105071(0x153)](_0x355776+':\x20'+_0x4927e8+'\x20'+_0x476dc9);}}console['log'](_0x105071(0x166));const _0x5520fc=[{'label':_0x105071(0x163),'path':this['configFiles'][_0x105071(0x14d)],'extra':_0x105071(0x14f)+this['sessionId']+')'},{'label':'Project','path':this[_0x105071(0x145)][_0x105071(0x139)]},{'label':_0x105071(0x15f),'path':this[_0x105071(0x145)][_0x105071(0x16f)]},{'label':_0x105071(0x13c),'path':this[_0x105071(0x145)]['profileCredentials']},{'label':_0x105071(0x13b),'path':this['configFiles'][_0x105071(0x13d)]},{'label':'Global\x20Credentials','path':this[_0x105071(0x145)][_0x105071(0x161)]}];for(const {label:_0x3c1f1e,path:_0x4e216a,extra:_0x866383}of _0x5520fc){if(_0x4e216a)console[_0x105071(0x153)](_0x3c1f1e+':\x20'+_0x4e216a+'\x20✓'+(_0x866383?'\x20'+_0x866383:''));else{if(_0x3c1f1e===_0x105071(0x163))console[_0x105071(0x153)](_0x3c1f1e+_0x105071(0x15d)+this[_0x105071(0x146)]+')');else(_0x3c1f1e==='Project'||_0x3c1f1e===_0x105071(0x13b))&&console[_0x105071(0x153)](_0x3c1f1e+_0x105071(0x150));}}}async['resolveAPIKeyAsync'](){const _0x52be6b=a47_0x5a1520;return this['apiKey']=await getAPIKeyAsync(this['site'],this[_0x52be6b(0x172)]||undefined),this[_0x52be6b(0x135)];}static async['createAsync'](_0x2d8fab){const _0x4f2cd6=a47_0x5a1520,_0x23a813=new GlobalContext(_0x2d8fab);return await _0x23a813[_0x4f2cd6(0x15e)](),_0x23a813;}}
1
+ const a47_0x424067=a47_0x2f35;(function(_0x32c2e5,_0x17c4ce){const _0x4075db=a47_0x2f35,_0x4c58c6=_0x32c2e5();while(!![]){try{const _0x443241=-parseInt(_0x4075db(0x1f6))/0x1*(parseInt(_0x4075db(0x1eb))/0x2)+parseInt(_0x4075db(0x1ed))/0x3+parseInt(_0x4075db(0x1bf))/0x4*(-parseInt(_0x4075db(0x1d5))/0x5)+-parseInt(_0x4075db(0x1fc))/0x6*(parseInt(_0x4075db(0x1bc))/0x7)+parseInt(_0x4075db(0x1c7))/0x8*(-parseInt(_0x4075db(0x1c8))/0x9)+-parseInt(_0x4075db(0x1bb))/0xa*(-parseInt(_0x4075db(0x1dc))/0xb)+-parseInt(_0x4075db(0x1c3))/0xc*(-parseInt(_0x4075db(0x1f9))/0xd);if(_0x443241===_0x17c4ce)break;else _0x4c58c6['push'](_0x4c58c6['shift']());}catch(_0x495606){_0x4c58c6['push'](_0x4c58c6['shift']());}}}(a47_0x2eda,0x27788));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';function a47_0x2f35(_0x50a203,_0x4211b){_0x50a203=_0x50a203-0x1bb;const _0x2eda20=a47_0x2eda();let _0x2f35ef=_0x2eda20[_0x50a203];return _0x2f35ef;}import*as a47_0x27eed0 from'node:fs';import*as a47_0x73bf1d from'node:path';function a47_0x2eda(){const _0x1ee67c=['globalCredentials','3848NQCIxQ','1647eeRGxC','project',':\x20none\x20(using\x20session:\x20','verbose','getSource','Session','parentSegment','llmProject','resolveAPIKeyAsync','parse','profile',':\x20none','.json','10lqYigH','[context]','Global','log','Profile','INFO','display','8426XgThTP','.env','logLevel','profileCredentials','default','global','utf-8','loadGlobalConfig','configFiles','tdx.json','layers','(active)','activeProfile','database','segmentPath','4rzBmEw','Project','242976lDvcYe','profiles','site','sessionId','config','(session:\x20','cliFlags','join','us01','136731NLJfiI','\x0a[configuration\x20files]','existsSync','13BCFsyM','segment_path','getParameters','336jbqPvA','llm_project','createAsync','2400TptaCy','14784WiFFbc','CLI\x20flag:\x20--','apiKey','377628aYSQoT','sessions','Global\x20Credentials','displayWithSources','6784932wEboBK','session','parent_segment'];a47_0x2eda=function(){return _0x1ee67c;};return a47_0x2eda();}export class GlobalContext{['site'];['database'];[a47_0x424067(0x1c5)];['segment_path'];['llm_project'];[a47_0x424067(0x1be)];[a47_0x424067(0x1cb)];[a47_0x424067(0x1de)];[a47_0x424067(0x1d2)];['layers'];[a47_0x424067(0x1e8)];[a47_0x424067(0x1f0)];[a47_0x424067(0x1e4)];constructor(_0x2f8a0a){const _0x3ac789=a47_0x424067;this[_0x3ac789(0x1f0)]=_0x2f8a0a[_0x3ac789(0x1c4)]||getCurrentSessionPID()['toString']();const _0x2051b0=loadSessionContext(_0x2f8a0a['session']),_0x3db0c9=loadProjectConfig(),_0x56e0aa=this[_0x3ac789(0x1e3)]();this[_0x3ac789(0x1e8)]=_0x2f8a0a[_0x3ac789(0x1d2)]||_0x2051b0?.['profile']||_0x56e0aa['profile']||getActiveProfile();const _0x153fa8=this[_0x3ac789(0x1e8)]?loadProfile(this[_0x3ac789(0x1e8)]):null,_0xfad3d8=_0x429b85=>{if(!_0x429b85)return{};const _0x406443=_0x429b85,_0x50d90c={};for(const [_0x4dbc54,_0x374279]of Object['entries'](_0x406443)){typeof _0x374279==='string'&&(_0x50d90c[_0x4dbc54]=_0x374279);}return _0x50d90c;},_0x11ce83={};if(_0x2f8a0a[_0x3ac789(0x1ef)]&&_0x2f8a0a[_0x3ac789(0x1ef)]!==_0x3ac789(0x1f5))_0x11ce83['site']=_0x2f8a0a[_0x3ac789(0x1ef)];const _0x145c3c=_0x2051b0?.['database'],_0x2a7537=_0x3db0c9?.['database'],_0x135445=_0x153fa8?.[_0x3ac789(0x1f1)]?.['database'],_0x26f4ac=_0x56e0aa['database'];_0x2f8a0a['database']&&(_0x2f8a0a[_0x3ac789(0x1e9)]!==_0x145c3c&&_0x2f8a0a[_0x3ac789(0x1e9)]!==_0x2a7537&&_0x2f8a0a[_0x3ac789(0x1e9)]!==_0x135445&&_0x2f8a0a[_0x3ac789(0x1e9)]!==_0x26f4ac)&&(_0x11ce83['database']=_0x2f8a0a[_0x3ac789(0x1e9)]);if(_0x2f8a0a[_0x3ac789(0x1ce)])_0x11ce83[_0x3ac789(0x1c5)]=_0x2f8a0a['parentSegment'];if(_0x2f8a0a[_0x3ac789(0x1cf)])_0x11ce83['llm_project']=_0x2f8a0a[_0x3ac789(0x1cf)];if(_0x2f8a0a[_0x3ac789(0x1d2)])_0x11ce83[_0x3ac789(0x1d2)]=_0x2f8a0a[_0x3ac789(0x1d2)];this['layers']={'cliFlags':_0x11ce83,'session':_0xfad3d8(_0x2051b0),'project':_0xfad3d8(_0x3db0c9),'profile':_0xfad3d8(_0x153fa8?.[_0x3ac789(0x1f1)]),'global':_0xfad3d8(_0x56e0aa)};const _0x526790={...this['layers'][_0x3ac789(0x1e1)],...this[_0x3ac789(0x1e6)]['profile'],...this[_0x3ac789(0x1e6)][_0x3ac789(0x1c9)],...this[_0x3ac789(0x1e6)][_0x3ac789(0x1c4)],...this[_0x3ac789(0x1e6)][_0x3ac789(0x1f3)]},_0x514ac2=_0x526790[_0x3ac789(0x1ef)]||_0x3ac789(0x1f5);this['site']=resolveSite(_0x514ac2),this[_0x3ac789(0x1e9)]=_0x526790[_0x3ac789(0x1e9)],this[_0x3ac789(0x1c5)]=_0x526790['parent_segment'],this['segment_path']=_0x526790[_0x3ac789(0x1fa)],this[_0x3ac789(0x1fd)]=_0x526790[_0x3ac789(0x1fd)],this[_0x3ac789(0x1cb)]=_0x2f8a0a['verbose']||![],this[_0x3ac789(0x1de)]=_0x2f8a0a[_0x3ac789(0x1de)]??LogLevel[_0x3ac789(0x1da)],this[_0x3ac789(0x1d2)]=this['activeProfile']||undefined,this[_0x3ac789(0x1be)]=getAPIKey(this[_0x3ac789(0x1ef)],this['activeProfile']||undefined);const _0x4bc2ca=getConfigDir(),_0x221872=a47_0x73bf1d[_0x3ac789(0x1f4)](_0x4bc2ca,_0x3ac789(0x1c0),this[_0x3ac789(0x1f0)]+_0x3ac789(0x1d4)),_0x457ff3=findProjectConfigPath(),_0x397f73=a47_0x73bf1d['join'](_0x4bc2ca,_0x3ac789(0x1e5)),_0x158ea7=a47_0x73bf1d[_0x3ac789(0x1f4)](_0x4bc2ca,_0x3ac789(0x1dd));let _0x2d7a8e=null,_0x310d41=null;this['activeProfile']&&(_0x2d7a8e=a47_0x73bf1d['join'](_0x4bc2ca,_0x3ac789(0x1ee),this[_0x3ac789(0x1e8)],_0x3ac789(0x1e5)),_0x310d41=a47_0x73bf1d[_0x3ac789(0x1f4)](_0x4bc2ca,'profiles',this[_0x3ac789(0x1e8)],_0x3ac789(0x1dd))),this[_0x3ac789(0x1e4)]={'session':a47_0x27eed0[_0x3ac789(0x1f8)](_0x221872)?_0x221872:null,'project':_0x457ff3,'profile':_0x2d7a8e&&a47_0x27eed0['existsSync'](_0x2d7a8e)?_0x2d7a8e:null,'profileCredentials':_0x310d41&&a47_0x27eed0[_0x3ac789(0x1f8)](_0x310d41)?_0x310d41:null,'global':a47_0x27eed0[_0x3ac789(0x1f8)](_0x397f73)?_0x397f73:null,'globalCredentials':a47_0x27eed0[_0x3ac789(0x1f8)](_0x158ea7)?_0x158ea7:null};}[a47_0x424067(0x1cc)](_0x34d363,_0x3bbe16){const _0x7c8317=a47_0x424067;if(!_0x3bbe16)return'not\x20set';const _0x1563cb=_0x3bbe16;if(this[_0x7c8317(0x1e6)]['cliFlags'][_0x34d363]===_0x1563cb){if(_0x34d363===_0x7c8317(0x1ef)&&_0x1563cb===_0x7c8317(0x1f5)&&!this['layers'][_0x7c8317(0x1c4)]['site']&&!this[_0x7c8317(0x1e6)][_0x7c8317(0x1c9)][_0x7c8317(0x1ef)]&&!this[_0x7c8317(0x1e6)][_0x7c8317(0x1d2)]['site']&&!this[_0x7c8317(0x1e6)]['global'][_0x7c8317(0x1ef)])return _0x7c8317(0x1e0);return _0x7c8317(0x1bd)+_0x34d363['replace'](/_/g,'-');}if(this['layers'][_0x7c8317(0x1c4)][_0x34d363]===_0x1563cb)return'session';if(this['layers']['project'][_0x34d363]===_0x1563cb)return _0x7c8317(0x1c9);if(this[_0x7c8317(0x1e6)][_0x7c8317(0x1d2)][_0x34d363]===_0x1563cb)return'profile:\x20'+this[_0x7c8317(0x1e8)];if(this[_0x7c8317(0x1e6)][_0x7c8317(0x1e1)][_0x34d363]===_0x1563cb)return'global';return'default';}[a47_0x424067(0x1e3)](){const _0x8e6a01=a47_0x424067,_0x787919=a47_0x73bf1d[_0x8e6a01(0x1f4)](getConfigDir(),'tdx.json');if(!a47_0x27eed0[_0x8e6a01(0x1f8)](_0x787919))return{};try{const _0x3db00d=a47_0x27eed0['readFileSync'](_0x787919,_0x8e6a01(0x1e2));return JSON[_0x8e6a01(0x1d1)](_0x3db00d);}catch{return{};}}['injectIntoOptions'](_0x53c870){const _0x41f2ce=a47_0x424067;_0x53c870[_0x41f2ce(0x1ef)]=this[_0x41f2ce(0x1ef)],!_0x53c870[_0x41f2ce(0x1e9)]&&this[_0x41f2ce(0x1e9)]&&(_0x53c870[_0x41f2ce(0x1e9)]=this[_0x41f2ce(0x1e9)]),!_0x53c870[_0x41f2ce(0x1ce)]&&this['parent_segment']&&(_0x53c870[_0x41f2ce(0x1ce)]=this[_0x41f2ce(0x1c5)]),!_0x53c870['segmentPath']&&this[_0x41f2ce(0x1fa)]&&(_0x53c870[_0x41f2ce(0x1ea)]=this['segment_path']),!_0x53c870[_0x41f2ce(0x1cf)]&&this['llm_project']&&(_0x53c870['llmProject']=this[_0x41f2ce(0x1fd)]);}['getParameters'](){const _0xb86dc8=a47_0x424067;return[{'key':'site','value':this['site']},{'key':_0xb86dc8(0x1e9),'value':this[_0xb86dc8(0x1e9)]},{'key':'parent_segment','value':this[_0xb86dc8(0x1c5)]},{'key':_0xb86dc8(0x1fa),'value':this['segment_path']},{'key':_0xb86dc8(0x1fd),'value':this['llm_project']},{'key':_0xb86dc8(0x1d2),'value':this[_0xb86dc8(0x1e8)]||undefined}];}[a47_0x424067(0x1db)](){const _0x3cd632=a47_0x424067;console[_0x3cd632(0x1d8)](_0x3cd632(0x1d6));for(const {key:_0x23c8d2,value:_0x261bca}of this[_0x3cd632(0x1fb)]()){_0x261bca&&console['log'](_0x23c8d2+':\x20'+_0x261bca);}}[a47_0x424067(0x1c2)](){const _0x226042=a47_0x424067;console[_0x226042(0x1d8)](_0x226042(0x1d6));for(const {key:_0x216cd4,value:_0x5546e0}of this[_0x226042(0x1fb)]()){if(_0x5546e0){const _0x57a548=_0x216cd4===_0x226042(0x1d2)?_0x226042(0x1e7):'('+this['getSource'](_0x216cd4,_0x5546e0)+')';console[_0x226042(0x1d8)](_0x216cd4+':\x20'+_0x5546e0+'\x20'+_0x57a548);}}console[_0x226042(0x1d8)](_0x226042(0x1f7));const _0x508b61=[{'label':_0x226042(0x1cd),'path':this['configFiles'][_0x226042(0x1c4)],'extra':_0x226042(0x1f2)+this[_0x226042(0x1f0)]+')'},{'label':'Project','path':this[_0x226042(0x1e4)]['project']},{'label':_0x226042(0x1d9),'path':this[_0x226042(0x1e4)][_0x226042(0x1d2)]},{'label':'Profile\x20Credentials','path':this[_0x226042(0x1e4)][_0x226042(0x1df)]},{'label':_0x226042(0x1d7),'path':this['configFiles'][_0x226042(0x1e1)]},{'label':_0x226042(0x1c1),'path':this[_0x226042(0x1e4)][_0x226042(0x1c6)]}];for(const {label:_0x1dc5ee,path:_0x40ee12,extra:_0x59b0cc}of _0x508b61){if(_0x40ee12)console[_0x226042(0x1d8)](_0x1dc5ee+':\x20'+_0x40ee12+'\x20✓'+(_0x59b0cc?'\x20'+_0x59b0cc:''));else{if(_0x1dc5ee==='Session')console[_0x226042(0x1d8)](_0x1dc5ee+_0x226042(0x1ca)+this[_0x226042(0x1f0)]+')');else(_0x1dc5ee===_0x226042(0x1ec)||_0x1dc5ee===_0x226042(0x1d7))&&console['log'](_0x1dc5ee+_0x226042(0x1d3));}}}async['resolveAPIKeyAsync'](){const _0x174247=a47_0x424067;return this[_0x174247(0x1be)]=await getAPIKeyAsync(this[_0x174247(0x1ef)],this['activeProfile']||undefined),this[_0x174247(0x1be)];}static async[a47_0x424067(0x1fe)](_0xb586ec){const _0x190f94=a47_0x424067,_0x5068b7=new GlobalContext(_0xb586ec);return await _0x5068b7[_0x190f94(0x1d0)](),_0x5068b7;}}
@@ -1 +1 @@
1
- const a48_0x5d6fc9=a48_0x5d3f;function a48_0x5d3f(_0x2871af,_0x55db21){_0x2871af=_0x2871af-0x68;const _0x424d93=a48_0x424d();let _0x5d3fdb=_0x424d93[_0x2871af];return _0x5d3fdb;}(function(_0x4d09e0,_0x4fe412){const _0x5161e=a48_0x5d3f,_0x2914e2=_0x4d09e0();while(!![]){try{const _0x1ef7ea=-parseInt(_0x5161e(0x73))/0x1+-parseInt(_0x5161e(0x6f))/0x2+parseInt(_0x5161e(0x77))/0x3+-parseInt(_0x5161e(0x6c))/0x4+-parseInt(_0x5161e(0x88))/0x5*(-parseInt(_0x5161e(0x78))/0x6)+-parseInt(_0x5161e(0x81))/0x7*(-parseInt(_0x5161e(0x82))/0x8)+parseInt(_0x5161e(0x68))/0x9*(parseInt(_0x5161e(0x6d))/0xa);if(_0x1ef7ea===_0x4fe412)break;else _0x2914e2['push'](_0x2914e2['shift']());}catch(_0x5ce023){_0x2914e2['push'](_0x2914e2['shift']());}}}(a48_0x424d,0xb3f6c));function a48_0x424d(){const _0x2e6e82=['not\x20supported','access','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.','3317461YiTcZd','8voHqRa','error','cannot\x20find','not\x20found','not\x20available',':api_key','25GckiRs','-25293','7706583JbmejS','restricted','could\x20not\x20be\x20found','includes','4185484blJLjY','10wTBvEx','__keychain_test__','2070566sUdZqS','message','-25300','setPassword','566480amDWEb','System\x20keychain\x20is\x20not\x20available','tdx','deletePassword','3940713pZcLiR','889782ADAUWb','unavailable','access_denied','getPassword','reason','toLowerCase'];a48_0x424d=function(){return _0x2e6e82;};return a48_0x424d();}const SERVICE_NAME=a48_0x5d6fc9(0x75);let keyringModule=null,keyringLoadError=null;async function getKeyring(){if(keyringModule!==null)return keyringModule;if(keyringLoadError!==null)return null;try{const _0x4f33bb=await import('@zowe/secrets-for-zowe-sdk');return keyringModule=_0x4f33bb['keyring'],keyringModule;}catch(_0x373a4e){return keyringLoadError=_0x373a4e instanceof Error?_0x373a4e:new Error(String(_0x373a4e)),null;}}function getAccountName(_0x7c504a){const _0x49a16c=a48_0x5d6fc9,_0x548a68=_0x7c504a||'';return'profile:'+_0x548a68+_0x49a16c(0x87);}export async function getKeychainAPIKey(_0xf4f1bd){const _0x1d7943=a48_0x5d6fc9,_0x2b8c31=await getKeychainAPIKeyWithStatus(_0xf4f1bd);if(_0x2b8c31['success'])return _0x2b8c31['value'];return _0x2b8c31[_0x1d7943(0x7c)]===_0x1d7943(0x7a)&&console[_0x1d7943(0x83)]('Warning:\x20'+_0x2b8c31[_0x1d7943(0x70)]),null;}export async function getKeychainAPIKeyWithStatus(_0x803b94){const _0x16614d=a48_0x5d6fc9;try{const _0x2266a0=await getKeyring();if(!_0x2266a0)return{'success':![],'reason':'unavailable'};const _0x572ca8=getAccountName(_0x803b94),_0x39cc65=await _0x2266a0[_0x16614d(0x7b)](SERVICE_NAME,_0x572ca8);if(_0x39cc65)return{'success':!![],'value':_0x39cc65};return{'success':![],'reason':'not_found'};}catch(_0x4ba4cf){const _0x3599ec=_0x4ba4cf instanceof Error?_0x4ba4cf[_0x16614d(0x70)]:String(_0x4ba4cf);if(_0x3599ec[_0x16614d(0x6b)](_0x16614d(0x71))||_0x3599ec['toLowerCase']()['includes'](_0x16614d(0x6a))||_0x3599ec[_0x16614d(0x7d)]()[_0x16614d(0x6b)](_0x16614d(0x85)))return{'success':![],'reason':'not_found'};if(_0x3599ec['includes'](_0x16614d(0x89))||_0x3599ec[_0x16614d(0x7d)]()[_0x16614d(0x6b)](_0x16614d(0x69))||_0x3599ec[_0x16614d(0x7d)]()['includes'](_0x16614d(0x7f)))return{'success':![],'reason':_0x16614d(0x7a),'message':_0x16614d(0x80)};return{'success':![],'reason':_0x16614d(0x79),'message':_0x3599ec};}}export async function saveKeychainAPIKey(_0x31a725,_0xf5a247){const _0x126419=a48_0x5d6fc9,_0x404933=await getKeyring();if(!_0x404933)throw new Error(_0x126419(0x74));const _0x3b917c=getAccountName(_0xf5a247);await _0x404933[_0x126419(0x72)](SERVICE_NAME,_0x3b917c,_0x31a725);}export async function deleteKeychainAPIKey(_0x3742bf){const _0x4be0b5=a48_0x5d6fc9;try{const _0x18d22c=await getKeyring();if(!_0x18d22c)return![];const _0x384c04=getAccountName(_0x3742bf);return await _0x18d22c[_0x4be0b5(0x76)](SERVICE_NAME,_0x384c04);}catch{return![];}}export async function isKeychainAvailable(){const _0x289c8c=a48_0x5d6fc9;try{const _0x2e1ad2=await getKeyring();if(!_0x2e1ad2)return![];return await _0x2e1ad2['getPassword'](SERVICE_NAME,_0x289c8c(0x6e)),!![];}catch(_0xa4e025){const _0x248013=_0xa4e025 instanceof Error?_0xa4e025[_0x289c8c(0x70)][_0x289c8c(0x7d)]():'';if(_0x248013[_0x289c8c(0x6b)](_0x289c8c(0x86))||_0x248013['includes'](_0x289c8c(0x7e))||_0x248013[_0x289c8c(0x6b)](_0x289c8c(0x84)))return![];return!![];}}
1
+ const a48_0x1a8029=a48_0x4d2f;(function(_0x2e7982,_0x5d4971){const _0x2a8e3d=a48_0x4d2f,_0x2a85e2=_0x2e7982();while(!![]){try{const _0x5dff3d=parseInt(_0x2a8e3d(0x10f))/0x1*(-parseInt(_0x2a8e3d(0x12a))/0x2)+-parseInt(_0x2a8e3d(0x11c))/0x3+parseInt(_0x2a8e3d(0x124))/0x4*(-parseInt(_0x2a8e3d(0x11b))/0x5)+parseInt(_0x2a8e3d(0x127))/0x6*(parseInt(_0x2a8e3d(0x114))/0x7)+parseInt(_0x2a8e3d(0x11a))/0x8+parseInt(_0x2a8e3d(0x12c))/0x9*(parseInt(_0x2a8e3d(0x122))/0xa)+parseInt(_0x2a8e3d(0x129))/0xb;if(_0x5dff3d===_0x5d4971)break;else _0x2a85e2['push'](_0x2a85e2['shift']());}catch(_0x292e2b){_0x2a85e2['push'](_0x2a85e2['shift']());}}}(a48_0x45f0,0x51d75));const SERVICE_NAME=a48_0x1a8029(0x115);let keyringModule=null,keyringLoadError=null;async function getKeyring(){const _0x56b0c8=a48_0x1a8029;if(keyringModule!==null)return keyringModule;if(keyringLoadError!==null)return null;try{const _0x53922f=await import(_0x56b0c8(0x125));return keyringModule=_0x53922f['keyring'],keyringModule;}catch(_0x150918){return keyringLoadError=_0x150918 instanceof Error?_0x150918:new Error(String(_0x150918)),null;}}function getAccountName(_0x43fb43){const _0x20d7f9=a48_0x1a8029,_0x4555f7=_0x43fb43||'';return _0x20d7f9(0x10c)+_0x4555f7+_0x20d7f9(0x11f);}export async function getKeychainAPIKey(_0x509b3b){const _0x3b36b7=a48_0x1a8029,_0x46d504=await getKeychainAPIKeyWithStatus(_0x509b3b);if(_0x46d504[_0x3b36b7(0x10e)])return _0x46d504[_0x3b36b7(0x12e)];return _0x46d504[_0x3b36b7(0x118)]===_0x3b36b7(0x121)&&console['error']('Warning:\x20'+_0x46d504[_0x3b36b7(0x111)]),null;}export async function getKeychainAPIKeyWithStatus(_0x1b9b90){const _0x4c9c12=a48_0x1a8029;try{const _0x3d1450=await getKeyring();if(!_0x3d1450)return{'success':![],'reason':_0x4c9c12(0x12b)};const _0x5a037c=getAccountName(_0x1b9b90),_0x3feae0=await _0x3d1450[_0x4c9c12(0x110)](SERVICE_NAME,_0x5a037c);if(_0x3feae0)return{'success':!![],'value':_0x3feae0};return{'success':![],'reason':'not_found'};}catch(_0x101150){const _0x458fe8=_0x101150 instanceof Error?_0x101150[_0x4c9c12(0x111)]:String(_0x101150);if(_0x458fe8[_0x4c9c12(0x112)](_0x4c9c12(0x126))||_0x458fe8[_0x4c9c12(0x123)]()[_0x4c9c12(0x112)](_0x4c9c12(0x12d))||_0x458fe8[_0x4c9c12(0x123)]()[_0x4c9c12(0x112)](_0x4c9c12(0x11e)))return{'success':![],'reason':_0x4c9c12(0x11d)};if(_0x458fe8[_0x4c9c12(0x112)](_0x4c9c12(0x119))||_0x458fe8[_0x4c9c12(0x123)]()[_0x4c9c12(0x112)]('restricted')||_0x458fe8[_0x4c9c12(0x123)]()['includes'](_0x4c9c12(0x117)))return{'success':![],'reason':_0x4c9c12(0x121),'message':'Keychain\x20access\x20denied.\x20The\x20API\x20key\x20exists\x20but\x20cannot\x20be\x20accessed.\x20Try\x20running\x20\x22tdx\x20auth\x20setup\x22\x20to\x20re-authenticate,\x20or\x20check\x20your\x20keychain\x20permissions\x20for\x20\x22tdx\x22.'};return{'success':![],'reason':_0x4c9c12(0x12b),'message':_0x458fe8};}}function a48_0x45f0(){const _0x2ee4b1=['deletePassword','access','reason','-25293','2015680hcUZyj','65yzohlt','44166YpVRAy','not_found','not\x20found',':api_key','not\x20available','access_denied','441880XsNNfv','toLowerCase','195620rnKxQA','@zowe/secrets-for-zowe-sdk','-25300','18QkrXOM','setPassword','5661546tvsgIu','38SYKdLh','unavailable','90XUKWdx','could\x20not\x20be\x20found','value','__keychain_test__','cannot\x20find','profile:','not\x20supported','success','27605GJTdap','getPassword','message','includes','System\x20keychain\x20is\x20not\x20available','703913fCVRKJ','tdx'];a48_0x45f0=function(){return _0x2ee4b1;};return a48_0x45f0();}function a48_0x4d2f(_0x3b10f8,_0x2b49c2){_0x3b10f8=_0x3b10f8-0x10a;const _0x45f0bd=a48_0x45f0();let _0x4d2fa5=_0x45f0bd[_0x3b10f8];return _0x4d2fa5;}export async function saveKeychainAPIKey(_0xbf05b8,_0x604a79){const _0x4541a7=a48_0x1a8029,_0x47e0d1=await getKeyring();if(!_0x47e0d1)throw new Error(_0x4541a7(0x113));const _0x149e82=getAccountName(_0x604a79);await _0x47e0d1[_0x4541a7(0x128)](SERVICE_NAME,_0x149e82,_0xbf05b8);}export async function deleteKeychainAPIKey(_0x5f6d8c){const _0xb6dcd3=a48_0x1a8029;try{const _0x4c7cdd=await getKeyring();if(!_0x4c7cdd)return![];const _0x3a8b00=getAccountName(_0x5f6d8c);return await _0x4c7cdd[_0xb6dcd3(0x116)](SERVICE_NAME,_0x3a8b00);}catch{return![];}}export async function isKeychainAvailable(){const _0x8bfb93=a48_0x1a8029;try{const _0x52d001=await getKeyring();if(!_0x52d001)return![];return await _0x52d001[_0x8bfb93(0x110)](SERVICE_NAME,_0x8bfb93(0x10a)),!![];}catch(_0x595eec){const _0x5996b3=_0x595eec instanceof Error?_0x595eec[_0x8bfb93(0x111)][_0x8bfb93(0x123)]():'';if(_0x5996b3[_0x8bfb93(0x112)](_0x8bfb93(0x120))||_0x5996b3['includes'](_0x8bfb93(0x10d))||_0x5996b3[_0x8bfb93(0x112)](_0x8bfb93(0x10b)))return![];return!![];}}
@@ -1 +1 @@
1
- (function(_0x14edcc,_0x79d69f){const _0x1d7080=a49_0x550d,_0x676650=_0x14edcc();while(!![]){try{const _0x5bd332=parseInt(_0x1d7080(0x16b))/0x1+-parseInt(_0x1d7080(0x165))/0x2+parseInt(_0x1d7080(0x19c))/0x3+parseInt(_0x1d7080(0x182))/0x4*(parseInt(_0x1d7080(0x184))/0x5)+-parseInt(_0x1d7080(0x19f))/0x6*(parseInt(_0x1d7080(0x17f))/0x7)+-parseInt(_0x1d7080(0x179))/0x8+-parseInt(_0x1d7080(0x161))/0x9*(-parseInt(_0x1d7080(0x1a9))/0xa);if(_0x5bd332===_0x79d69f)break;else _0x676650['push'](_0x676650['shift']());}catch(_0x51f7c6){_0x676650['push'](_0x676650['shift']());}}}(a49_0x23d9,0x1a864));import*as a49_0x22f3ce from'node:fs';import*as a49_0x36a497 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(_0xc383a2){const _0x9fc9c6=a49_0x550d,_0x24d528={};if(!_0xc383a2)return _0x24d528;for(const [_0x3498e6,_0x223faf]of Object[_0x9fc9c6(0x176)](_0xc383a2)){_0x3498e6!==_0x9fc9c6(0x194)&&_0x223faf!==undefined&&(_0x24d528[_0x3498e6]=_0x223faf);}return _0x24d528;}export function getProfilesDir(){const _0x5d0cb9=a49_0x550d;return a49_0x36a497[_0x5d0cb9(0x1ac)](getConfigDir(),'profiles');}function getProfileDir(_0x54fc2f){return a49_0x36a497['join'](getProfilesDir(),_0x54fc2f);}function getProfileConfigPath(_0x3d349f){const _0x551229=a49_0x550d;return a49_0x36a497['join'](getProfileDir(_0x3d349f),_0x551229(0x185));}function a49_0x550d(_0x35b655,_0x2afbc5){_0x35b655=_0x35b655-0x161;const _0x23d98f=a49_0x23d9();let _0x550d3e=_0x23d98f[_0x35b655];return _0x550d3e;}function getProfileEnvPath(_0x5ea058){const _0x59f1fa=a49_0x550d;return a49_0x36a497[_0x59f1fa(0x1ac)](getProfileDir(_0x5ea058),_0x59f1fa(0x166));}function getGlobalConfigPath(){const _0x9c5ac=a49_0x550d;return a49_0x36a497[_0x9c5ac(0x1ac)](getConfigDir(),_0x9c5ac(0x185));}function validateProfileName(_0x332825){const _0x3ac29c=a49_0x550d;if(!/^[a-zA-Z0-9_-]+$/[_0x3ac29c(0x1a8)](_0x332825))throw new Error(_0x3ac29c(0x16e)+_0x332825+_0x3ac29c(0x18b));}function validateProfileConfig(_0x5e2aa3,_0x19bdc8){const _0x5661af=a49_0x550d;if(typeof _0x5e2aa3!==_0x5661af(0x199)||_0x5e2aa3===null)throw new Error(_0x5661af(0x181)+_0x19bdc8+_0x5661af(0x162));const _0x4e89f=['description','site',_0x5661af(0x169),_0x5661af(0x1a7),_0x5661af(0x16a),'llm_agent'],_0xe1653e=_0x5e2aa3;for(const _0x9931e9 of Object[_0x5661af(0x168)](_0xe1653e)){!_0x4e89f[_0x5661af(0x192)](_0x9931e9)&&console[_0x5661af(0x19b)](_0x5661af(0x1a6)+_0x19bdc8+_0x5661af(0x171)+_0x9931e9+'\x27\x20will\x20be\x20ignored');}if(_0xe1653e[_0x5661af(0x194)]!==undefined&&typeof _0xe1653e[_0x5661af(0x194)]!==_0x5661af(0x19e))throw new Error(_0x5661af(0x181)+_0x19bdc8+'\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string');if(_0xe1653e[_0x5661af(0x189)]!==undefined&&typeof _0xe1653e[_0x5661af(0x189)]!=='string')throw new Error(_0x5661af(0x181)+_0x19bdc8+_0x5661af(0x172));if(_0xe1653e[_0x5661af(0x169)]!==undefined&&typeof _0xe1653e[_0x5661af(0x169)]!==_0x5661af(0x19e))throw new Error(_0x5661af(0x181)+_0x19bdc8+_0x5661af(0x19a));if(_0xe1653e[_0x5661af(0x1a7)]!==undefined&&typeof _0xe1653e[_0x5661af(0x1a7)]!==_0x5661af(0x19e))throw new Error(_0x5661af(0x181)+_0x19bdc8+'\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string');if(_0xe1653e[_0x5661af(0x16a)]!==undefined&&typeof _0xe1653e['llm_project']!==_0x5661af(0x19e))throw new Error('Profile\x20\x27'+_0x19bdc8+_0x5661af(0x177));if(_0xe1653e[_0x5661af(0x1aa)]!==undefined&&typeof _0xe1653e[_0x5661af(0x1aa)]!==_0x5661af(0x19e))throw new Error(_0x5661af(0x181)+_0x19bdc8+_0x5661af(0x17a));return!![];}function loadProfilesFromTdxJson(_0x2573d,_0x2e68d3){const _0x2ea34f=a49_0x550d;if(!a49_0x22f3ce[_0x2ea34f(0x197)](_0x2573d))return[];try{const _0x5a3da5=a49_0x22f3ce['readFileSync'](_0x2573d,_0x2ea34f(0x1a0)),_0xd3f6bd=JSON['parse'](_0x5a3da5);if(!_0xd3f6bd['profiles']||typeof _0xd3f6bd['profiles']!=='object')return[];const _0x2a363b=[];for(const [_0x4bde6b,_0x258d89]of Object[_0x2ea34f(0x176)](_0xd3f6bd['profiles'])){try{validateProfileConfig(_0x258d89,_0x4bde6b);const _0x16e16c=getNewCredentialPath(_0x4bde6b),_0x366b04=getOldCredentialPath(_0x4bde6b),_0x56396d=a49_0x22f3ce[_0x2ea34f(0x197)](_0x16e16c)||a49_0x22f3ce[_0x2ea34f(0x197)](_0x366b04);_0x2a363b[_0x2ea34f(0x187)]({'name':_0x4bde6b,'config':_0x258d89,'metadata':{'name':_0x4bde6b,'createdAt':new Date()[_0x2ea34f(0x164)]()},'hasCredentials':_0x56396d,'scope':_0x2e68d3});}catch(_0x5624b1){_0x5624b1 instanceof Error&&(console['warn'](_0x2ea34f(0x174)+_0x2573d+':'),console[_0x2ea34f(0x19b)]('\x20\x20'+_0x5624b1[_0x2ea34f(0x188)]+'\x0a'));}}return _0x2a363b;}catch(_0x166af5){return _0x166af5 instanceof SyntaxError?(console[_0x2ea34f(0x19b)](_0x2ea34f(0x170)+_0x2573d+_0x2ea34f(0x186)),console[_0x2ea34f(0x19b)](_0x2ea34f(0x17d)+_0x166af5[_0x2ea34f(0x188)]+'\x0a')):console[_0x2ea34f(0x19b)]('\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20'+_0x2573d+':\x20'+_0x166af5+'\x0a'),[];}}export function getNewCredentialPath(_0x576753){const _0x348de=a49_0x550d;return a49_0x36a497[_0x348de(0x1ac)](getConfigDir(),_0x348de(0x1a4)+_0x576753);}function getOldCredentialPath(_0x42d984){const _0x52890c=a49_0x550d;return a49_0x36a497[_0x52890c(0x1ac)](getProfilesDir(),_0x42d984,_0x52890c(0x166));}function loadProfilesFromTdxJsonFiles(){const _0x2db0f6=a49_0x550d,_0x3c7a40=[],_0x382dd6=findProjectConfigPath();_0x382dd6&&_0x3c7a40[_0x2db0f6(0x187)](...loadProfilesFromTdxJson(_0x382dd6,_0x2db0f6(0x196)));const _0x294602=a49_0x36a497[_0x2db0f6(0x1ac)](getConfigDir(),_0x2db0f6(0x185));return _0x3c7a40[_0x2db0f6(0x187)](...loadProfilesFromTdxJson(_0x294602,'user')),_0x3c7a40;}function loadProfilesFromDirectories(){const _0x439708=a49_0x550d,_0x516dcf=getProfilesDir();if(!a49_0x22f3ce[_0x439708(0x197)](_0x516dcf))return[];try{return a49_0x22f3ce[_0x439708(0x16c)](_0x516dcf,{'withFileTypes':!![]})[_0x439708(0x1a3)](_0x3c240a=>_0x3c240a[_0x439708(0x190)]())[_0x439708(0x19d)](_0x582b83=>_0x582b83[_0x439708(0x16f)])[_0x439708(0x1a3)](_0x5526d8=>{const _0x5e25db=getProfileConfigPath(_0x5526d8),_0xdef307=getProfileEnvPath(_0x5526d8);return a49_0x22f3ce['existsSync'](_0x5e25db)||a49_0x22f3ce['existsSync'](_0xdef307);})[_0x439708(0x19d)](_0x342002=>{const _0x15d53d=_0x439708,_0x3b8cc2=loadProfileFromDirectory(_0x342002);if(_0x3b8cc2)return{..._0x3b8cc2,'scope':_0x15d53d(0x1ab)};return null;})[_0x439708(0x1a3)](_0x9445d4=>_0x9445d4!==null);}catch{return[];}}function loadProfileFromDirectory(_0x552c99){const _0x505173=a49_0x550d,_0x2a1fef=getProfileConfigPath(_0x552c99),_0x286e1f=getOldCredentialPath(_0x552c99);if(!a49_0x22f3ce[_0x505173(0x197)](_0x2a1fef)&&!a49_0x22f3ce[_0x505173(0x197)](_0x286e1f))return null;let _0x3e018f={},_0x2c6d69={'name':_0x552c99,'createdAt':new Date()['toISOString']()};if(a49_0x22f3ce[_0x505173(0x197)](_0x2a1fef))try{const _0x4d0014=a49_0x22f3ce[_0x505173(0x18f)](_0x2a1fef,_0x505173(0x1a0)),_0x958f4b=JSON[_0x505173(0x191)](_0x4d0014),{metadata:_0x203d81,..._0x578ccc}=_0x958f4b;_0x3e018f=_0x578ccc,_0x203d81&&(_0x2c6d69=_0x203d81);}catch{}return{'name':_0x552c99,'config':_0x3e018f,'metadata':_0x2c6d69,'hasCredentials':a49_0x22f3ce[_0x505173(0x197)](_0x286e1f),'scope':'directory'};}export function listProfiles(){const _0x2c0e67=a49_0x550d,_0x50611c=loadProfilesFromTdxJsonFiles(),_0x3118fd=loadProfilesFromDirectories();if(_0x3118fd[_0x2c0e67(0x183)]>0x0){const _0x2de443=_0x3118fd[_0x2c0e67(0x19d)](_0x42b2e7=>_0x42b2e7[_0x2c0e67(0x16f)])[_0x2c0e67(0x1ac)](',\x20'),_0x36b230=getConfigDir();console[_0x2c0e67(0x19b)]('\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20'+_0x2de443),console[_0x2c0e67(0x19b)](_0x2c0e67(0x1a5)),console[_0x2c0e67(0x19b)](_0x2c0e67(0x173)+a49_0x36a497[_0x2c0e67(0x1ac)](_0x36b230,_0x2c0e67(0x185))),console[_0x2c0e67(0x19b)](_0x2c0e67(0x198)),console[_0x2c0e67(0x19b)](_0x2c0e67(0x18d));}const _0x531969=[..._0x50611c,..._0x3118fd],_0x4fbd50=new Map();for(const _0x5732b0 of _0x531969){!_0x4fbd50['has'](_0x5732b0['name'])&&_0x4fbd50[_0x2c0e67(0x1a1)](_0x5732b0[_0x2c0e67(0x16f)],_0x5732b0);}return Array['from'](_0x4fbd50[_0x2c0e67(0x167)]())[_0x2c0e67(0x17e)]((_0x4c201c,_0x2ef7e7)=>_0x4c201c[_0x2c0e67(0x16f)][_0x2c0e67(0x180)](_0x2ef7e7[_0x2c0e67(0x16f)]));}export function profileExists(_0x21bb50){const _0x5edc9a=listProfiles();return _0x5edc9a['some'](_0x4a64e3=>_0x4a64e3['name']===_0x21bb50);}export function loadProfile(_0x381ed9){validateProfileName(_0x381ed9);const _0x133803=listProfiles(),_0x3f851f=_0x133803['find'](_0x3bef5e=>_0x3bef5e['name']===_0x381ed9);return _0x3f851f||null;}export function saveProfile(_0x26cb0e,_0x46e0d0,_0x231ffd=![]){saveProfileToUserConfig(_0x26cb0e,_0x46e0d0);}export function deleteProfile(_0xf7635c){const _0x18980c=a49_0x550d;validateProfileName(_0xf7635c);const _0x45ec73=getProfileDir(_0xf7635c);if(!a49_0x22f3ce[_0x18980c(0x197)](_0x45ec73))throw new Error(_0x18980c(0x18a)+_0xf7635c+_0x18980c(0x178));a49_0x22f3ce[_0x18980c(0x18e)](_0x45ec73,{'recursive':!![],'force':!![]});}function a49_0x23d9(){const _0x299d3c=['Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','Warning:\x20Profile\x20\x27','parent_segment','test','122590qYszSq','llm_agent','directory','join','243CkEtSN','\x27:\x20config\x20must\x20be\x20an\x20object','stringify','toISOString','420700mfKSFs','.env','values','keys','database','llm_project','75569kUDBpH','readdirSync','profiles','Invalid\x20profile\x20name:\x20','name','\x0aWarning:\x20Failed\x20to\x20parse\x20','\x27:\x20unknown\x20config\x20key\x20\x27','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','\x20\x201.\x20Edit:\x20','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','entries','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','\x20does\x20not\x20exist','1535752kuLLjJ','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string',',\x20creating\x20new\x20file','profile','Error:\x20','sort','1421pOXzGF','localeCompare','Profile\x20\x27','5788Cedrvv','length','450qmhbwc','tdx.json',':\x20Invalid\x20JSON\x20syntax','push','message','site','Profile\x20','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore.','\x20\x20mv\x20\x22','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','rmSync','readFileSync','isDirectory','parse','includes','\x20already\x20exists','description','Warning:\x20Failed\x20to\x20parse\x20','local','existsSync','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','object','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','warn','225186nDxLZH','map','string','2982WeddUx','utf-8','set','To\x20migrate:','filter','.env.'];a49_0x23d9=function(){return _0x299d3c;};return a49_0x23d9();}export function saveProfileToUserConfig(_0x4208d1,_0x32d18a){const _0x42e8b6=a49_0x550d;validateProfileName(_0x4208d1);const _0x15fd6c=getGlobalConfigPath(),_0x4f1178=getConfigDir();!a49_0x22f3ce['existsSync'](_0x4f1178)&&createSecureDirectory(_0x4f1178);let _0xa5dc29={};if(a49_0x22f3ce['existsSync'](_0x15fd6c))try{const _0xeafb03=a49_0x22f3ce[_0x42e8b6(0x18f)](_0x15fd6c,_0x42e8b6(0x1a0));_0xa5dc29=JSON['parse'](_0xeafb03);}catch{console[_0x42e8b6(0x19b)](_0x42e8b6(0x195)+_0x15fd6c+_0x42e8b6(0x17b));}!_0xa5dc29[_0x42e8b6(0x16d)]&&(_0xa5dc29[_0x42e8b6(0x16d)]={}),_0xa5dc29[_0x42e8b6(0x16d)][_0x4208d1]=_0x32d18a,writeSecureFile(_0x15fd6c,JSON[_0x42e8b6(0x163)](_0xa5dc29,null,0x2));}export function getActiveProfile(){const _0x183679=a49_0x550d,_0x5dc2a3=loadSessionContext();if(_0x5dc2a3?.[_0x183679(0x17c)])return _0x5dc2a3['profile'];const _0x3c7ee0=getGlobalConfigPath();if(!a49_0x22f3ce[_0x183679(0x197)](_0x3c7ee0))return null;try{const _0x5530e3=a49_0x22f3ce['readFileSync'](_0x3c7ee0,_0x183679(0x1a0)),_0x143148=JSON[_0x183679(0x191)](_0x5530e3);return _0x143148['profile']||null;}catch{return null;}}export function createProfile(_0x998d5f,_0x47a901){const _0x4255ad=a49_0x550d;validateProfileName(_0x998d5f);if(profileExists(_0x998d5f))throw new Error('Profile\x20'+_0x998d5f+_0x4255ad(0x193));saveProfile(_0x998d5f,_0x47a901);}export function saveProfileCredentials(_0x28ab2e,_0x3c3792){const _0x5cac81=a49_0x550d;validateProfileName(_0x28ab2e);if(!profileExists(_0x28ab2e))throw new Error(_0x5cac81(0x18a)+_0x28ab2e+_0x5cac81(0x178));const _0x46779b=getNewCredentialPath(_0x28ab2e);writeSecureFile(_0x46779b,_0x3c3792);}export function loadProfileCredentials(_0x2c9918){const _0x12e4e5=a49_0x550d;validateProfileName(_0x2c9918);const _0x1a5a5f=getNewCredentialPath(_0x2c9918);if(a49_0x22f3ce[_0x12e4e5(0x197)](_0x1a5a5f))try{return a49_0x22f3ce[_0x12e4e5(0x18f)](_0x1a5a5f,_0x12e4e5(0x1a0));}catch{}const _0x3a1254=getOldCredentialPath(_0x2c9918);if(a49_0x22f3ce[_0x12e4e5(0x197)](_0x3a1254)){console[_0x12e4e5(0x19b)](_0x12e4e5(0x175)+_0x2c9918+'\x27'),console[_0x12e4e5(0x19b)](_0x12e4e5(0x1a2)),console[_0x12e4e5(0x19b)](_0x12e4e5(0x18c)+_0x3a1254+'\x22\x20\x22'+_0x1a5a5f+'\x22'),console[_0x12e4e5(0x19b)]('Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a');try{return a49_0x22f3ce[_0x12e4e5(0x18f)](_0x3a1254,_0x12e4e5(0x1a0));}catch{return null;}}return null;}
1
+ (function(_0x2b9000,_0x1dae18){const _0x17ae64=a49_0x1b58,_0x3b9e02=_0x2b9000();while(!![]){try{const _0x2085da=parseInt(_0x17ae64(0x199))/0x1*(parseInt(_0x17ae64(0x190))/0x2)+parseInt(_0x17ae64(0x1bd))/0x3*(-parseInt(_0x17ae64(0x1af))/0x4)+-parseInt(_0x17ae64(0x1c0))/0x5*(-parseInt(_0x17ae64(0x1b9))/0x6)+parseInt(_0x17ae64(0x1b8))/0x7+parseInt(_0x17ae64(0x19f))/0x8*(parseInt(_0x17ae64(0x197))/0x9)+parseInt(_0x17ae64(0x1a8))/0xa*(-parseInt(_0x17ae64(0x1d2))/0xb)+-parseInt(_0x17ae64(0x18c))/0xc;if(_0x2085da===_0x1dae18)break;else _0x3b9e02['push'](_0x3b9e02['shift']());}catch(_0x1e3fbb){_0x3b9e02['push'](_0x3b9e02['shift']());}}}(a49_0x3135,0x2219a));import*as a49_0x44ca24 from'node:fs';import*as a49_0x4db323 from'node:path';function a49_0x1b58(_0x5a1e3b,_0x4b08ae){_0x5a1e3b=_0x5a1e3b-0x188;const _0x31352e=a49_0x3135();let _0x1b5823=_0x31352e[_0x5a1e3b];return _0x1b5823;}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(_0x143761){const _0x2fd1e8=a49_0x1b58,_0x12896f={};if(!_0x143761)return _0x12896f;for(const [_0x145a72,_0x26cfa7]of Object['entries'](_0x143761)){_0x145a72!==_0x2fd1e8(0x1c2)&&_0x26cfa7!==undefined&&(_0x12896f[_0x145a72]=_0x26cfa7);}return _0x12896f;}export function getProfilesDir(){const _0x3ddca2=a49_0x1b58;return a49_0x4db323[_0x3ddca2(0x1c4)](getConfigDir(),_0x3ddca2(0x1bc));}function getProfileDir(_0x331824){return a49_0x4db323['join'](getProfilesDir(),_0x331824);}function getProfileConfigPath(_0x19921d){const _0x1d13fe=a49_0x1b58;return a49_0x4db323[_0x1d13fe(0x1c4)](getProfileDir(_0x19921d),'tdx.json');}function getProfileEnvPath(_0x144ca9){const _0x588265=a49_0x1b58;return a49_0x4db323[_0x588265(0x1c4)](getProfileDir(_0x144ca9),_0x588265(0x1be));}function getGlobalConfigPath(){const _0x4bd75d=a49_0x1b58;return a49_0x4db323[_0x4bd75d(0x1c4)](getConfigDir(),'tdx.json');}function a49_0x3135(){const _0x4d1db2=['2356563jthbFo','Error:\x20','Profile\x20','values','.env.','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','toISOString','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','1123980QoWXTn','test','\x20already\x20exists','profile','498ZoWpYu','stringify','local','warn','has','sort',',\x20creating\x20new\x20file','117PhjamF','site','362FgJaKX','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','Profile\x20\x27','push','llm_project','utf-8','85736brugjF','parse','existsSync','\x0aWarning:\x20Failed\x20to\x20parse\x20','some','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','map','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','tdx.json','10fliyFQ','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','user','message','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','object','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','836nQKEPn','readFileSync','\x27:\x20unknown\x20config\x20key\x20\x27','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore.','isDirectory','readdirSync','name','filter','llm_agent','1057427QxGnVh','42qsfWGE','rmSync','from','profiles','417TgHxBA','.env','string','68645pXGIIO','parent_segment','description','\x20\x201.\x20Edit:\x20','join','keys','length','set','localeCompare','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','directory','database','Invalid\x20profile\x20name:\x20','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','find','Warning:\x20Profile\x20\x27','\x27:\x20config\x20must\x20be\x20an\x20object'];a49_0x3135=function(){return _0x4d1db2;};return a49_0x3135();}function validateProfileName(_0x5b7ca0){const _0x32dcc0=a49_0x1b58;if(!/^[a-zA-Z0-9_-]+$/[_0x32dcc0(0x18d)](_0x5b7ca0))throw new Error(_0x32dcc0(0x1cc)+_0x5b7ca0+_0x32dcc0(0x1b2));}function validateProfileConfig(_0x1ac2af,_0x1eb6d3){const _0x4999af=a49_0x1b58;if(typeof _0x1ac2af!==_0x4999af(0x1ad)||_0x1ac2af===null)throw new Error('Profile\x20\x27'+_0x1eb6d3+_0x4999af(0x1d1));const _0x34aea=[_0x4999af(0x1c2),_0x4999af(0x198),'database',_0x4999af(0x1c1),_0x4999af(0x19d),_0x4999af(0x1b7)],_0x2d199c=_0x1ac2af;for(const _0x45d804 of Object[_0x4999af(0x1c5)](_0x2d199c)){!_0x34aea['includes'](_0x45d804)&&console[_0x4999af(0x193)](_0x4999af(0x1d0)+_0x1eb6d3+_0x4999af(0x1b1)+_0x45d804+'\x27\x20will\x20be\x20ignored');}if(_0x2d199c['description']!==undefined&&typeof _0x2d199c[_0x4999af(0x1c2)]!==_0x4999af(0x1bf))throw new Error(_0x4999af(0x19b)+_0x1eb6d3+_0x4999af(0x1ac));if(_0x2d199c[_0x4999af(0x198)]!==undefined&&typeof _0x2d199c[_0x4999af(0x198)]!==_0x4999af(0x1bf))throw new Error('Profile\x20\x27'+_0x1eb6d3+_0x4999af(0x19a));if(_0x2d199c[_0x4999af(0x1cb)]!==undefined&&typeof _0x2d199c[_0x4999af(0x1cb)]!==_0x4999af(0x1bf))throw new Error(_0x4999af(0x19b)+_0x1eb6d3+_0x4999af(0x1ce));if(_0x2d199c[_0x4999af(0x1c1)]!==undefined&&typeof _0x2d199c[_0x4999af(0x1c1)]!=='string')throw new Error(_0x4999af(0x19b)+_0x1eb6d3+_0x4999af(0x1ae));if(_0x2d199c[_0x4999af(0x19d)]!==undefined&&typeof _0x2d199c['llm_project']!==_0x4999af(0x1bf))throw new Error('Profile\x20\x27'+_0x1eb6d3+'\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string');if(_0x2d199c['llm_agent']!==undefined&&typeof _0x2d199c['llm_agent']!==_0x4999af(0x1bf))throw new Error(_0x4999af(0x19b)+_0x1eb6d3+_0x4999af(0x1a9));return!![];}function loadProfilesFromTdxJson(_0x2f6b0f,_0x1e37aa){const _0x545f2f=a49_0x1b58;if(!a49_0x44ca24[_0x545f2f(0x1a1)](_0x2f6b0f))return[];try{const _0x5b3d8b=a49_0x44ca24[_0x545f2f(0x1b0)](_0x2f6b0f,_0x545f2f(0x19e)),_0x403826=JSON['parse'](_0x5b3d8b);if(!_0x403826['profiles']||typeof _0x403826[_0x545f2f(0x1bc)]!==_0x545f2f(0x1ad))return[];const _0x480682=[];for(const [_0x42cda8,_0x5ec230]of Object['entries'](_0x403826[_0x545f2f(0x1bc)])){try{validateProfileConfig(_0x5ec230,_0x42cda8);const _0x50cd1d=getNewCredentialPath(_0x42cda8),_0x9aa25d=getOldCredentialPath(_0x42cda8),_0x5f49d5=a49_0x44ca24[_0x545f2f(0x1a1)](_0x50cd1d)||a49_0x44ca24[_0x545f2f(0x1a1)](_0x9aa25d);_0x480682[_0x545f2f(0x19c)]({'name':_0x42cda8,'config':_0x5ec230,'metadata':{'name':_0x42cda8,'createdAt':new Date()[_0x545f2f(0x18a)]()},'hasCredentials':_0x5f49d5,'scope':_0x1e37aa});}catch(_0x22becd){_0x22becd instanceof Error&&(console['warn']('\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20'+_0x2f6b0f+':'),console['warn']('\x20\x20'+_0x22becd[_0x545f2f(0x1ab)]+'\x0a'));}}return _0x480682;}catch(_0x2141c1){return _0x2141c1 instanceof SyntaxError?(console[_0x545f2f(0x193)](_0x545f2f(0x1a2)+_0x2f6b0f+':\x20Invalid\x20JSON\x20syntax'),console[_0x545f2f(0x193)](_0x545f2f(0x1d3)+_0x2141c1['message']+'\x0a')):console[_0x545f2f(0x193)](_0x545f2f(0x1a4)+_0x2f6b0f+':\x20'+_0x2141c1+'\x0a'),[];}}export function getNewCredentialPath(_0x4b5c5f){const _0x48ee15=a49_0x1b58;return a49_0x4db323[_0x48ee15(0x1c4)](getConfigDir(),_0x48ee15(0x188)+_0x4b5c5f);}function getOldCredentialPath(_0xfc7e92){const _0x58c428=a49_0x1b58;return a49_0x4db323['join'](getProfilesDir(),_0xfc7e92,_0x58c428(0x1be));}function loadProfilesFromTdxJsonFiles(){const _0x2ce0fa=a49_0x1b58,_0x3d9f73=[],_0x3295fe=findProjectConfigPath();_0x3295fe&&_0x3d9f73[_0x2ce0fa(0x19c)](...loadProfilesFromTdxJson(_0x3295fe,_0x2ce0fa(0x192)));const _0x262414=a49_0x4db323['join'](getConfigDir(),_0x2ce0fa(0x1a7));return _0x3d9f73['push'](...loadProfilesFromTdxJson(_0x262414,_0x2ce0fa(0x1aa))),_0x3d9f73;}function loadProfilesFromDirectories(){const _0x46bbff=a49_0x1b58,_0x3bc63a=getProfilesDir();if(!a49_0x44ca24[_0x46bbff(0x1a1)](_0x3bc63a))return[];try{return a49_0x44ca24[_0x46bbff(0x1b4)](_0x3bc63a,{'withFileTypes':!![]})[_0x46bbff(0x1b6)](_0x326e47=>_0x326e47[_0x46bbff(0x1b3)]())[_0x46bbff(0x1a5)](_0x74152e=>_0x74152e[_0x46bbff(0x1b5)])['filter'](_0x5f1e70=>{const _0x168098=_0x46bbff,_0x3990db=getProfileConfigPath(_0x5f1e70),_0x1a5695=getProfileEnvPath(_0x5f1e70);return a49_0x44ca24[_0x168098(0x1a1)](_0x3990db)||a49_0x44ca24[_0x168098(0x1a1)](_0x1a5695);})[_0x46bbff(0x1a5)](_0x2634c0=>{const _0x180234=_0x46bbff,_0x44c36a=loadProfileFromDirectory(_0x2634c0);if(_0x44c36a)return{..._0x44c36a,'scope':_0x180234(0x1ca)};return null;})[_0x46bbff(0x1b6)](_0x3abd7b=>_0x3abd7b!==null);}catch{return[];}}function loadProfileFromDirectory(_0x9d7f52){const _0x5476dc=a49_0x1b58,_0x4b9bed=getProfileConfigPath(_0x9d7f52),_0x8b35f7=getOldCredentialPath(_0x9d7f52);if(!a49_0x44ca24['existsSync'](_0x4b9bed)&&!a49_0x44ca24[_0x5476dc(0x1a1)](_0x8b35f7))return null;let _0xf61580={},_0x42b680={'name':_0x9d7f52,'createdAt':new Date()[_0x5476dc(0x18a)]()};if(a49_0x44ca24[_0x5476dc(0x1a1)](_0x4b9bed))try{const _0x1de0dd=a49_0x44ca24[_0x5476dc(0x1b0)](_0x4b9bed,_0x5476dc(0x19e)),_0x1a554a=JSON['parse'](_0x1de0dd),{metadata:_0x2207b6,..._0x58f0f7}=_0x1a554a;_0xf61580=_0x58f0f7,_0x2207b6&&(_0x42b680=_0x2207b6);}catch{}return{'name':_0x9d7f52,'config':_0xf61580,'metadata':_0x42b680,'hasCredentials':a49_0x44ca24[_0x5476dc(0x1a1)](_0x8b35f7),'scope':_0x5476dc(0x1ca)};}export function listProfiles(){const _0x11cee4=a49_0x1b58,_0xfc961a=loadProfilesFromTdxJsonFiles(),_0x257610=loadProfilesFromDirectories();if(_0x257610[_0x11cee4(0x1c6)]>0x0){const _0x167a61=_0x257610[_0x11cee4(0x1a5)](_0x145078=>_0x145078[_0x11cee4(0x1b5)])['join'](',\x20'),_0x4789a1=getConfigDir();console['warn'](_0x11cee4(0x18b)+_0x167a61),console[_0x11cee4(0x193)](_0x11cee4(0x1cd)),console[_0x11cee4(0x193)](_0x11cee4(0x1c3)+a49_0x4db323['join'](_0x4789a1,_0x11cee4(0x1a7))),console[_0x11cee4(0x193)](_0x11cee4(0x1c9)),console['warn'](_0x11cee4(0x1a6));}const _0x319f3e=[..._0xfc961a,..._0x257610],_0x417a84=new Map();for(const _0x3c8f9d of _0x319f3e){!_0x417a84[_0x11cee4(0x194)](_0x3c8f9d[_0x11cee4(0x1b5)])&&_0x417a84[_0x11cee4(0x1c7)](_0x3c8f9d[_0x11cee4(0x1b5)],_0x3c8f9d);}return Array[_0x11cee4(0x1bb)](_0x417a84[_0x11cee4(0x1d5)]())[_0x11cee4(0x195)]((_0x4eb01a,_0x4f96f6)=>_0x4eb01a[_0x11cee4(0x1b5)][_0x11cee4(0x1c8)](_0x4f96f6[_0x11cee4(0x1b5)]));}export function profileExists(_0x10b49c){const _0x395e77=a49_0x1b58,_0x6962f=listProfiles();return _0x6962f[_0x395e77(0x1a3)](_0x11d14f=>_0x11d14f[_0x395e77(0x1b5)]===_0x10b49c);}export function loadProfile(_0xc72be0){const _0x31b6fb=a49_0x1b58;validateProfileName(_0xc72be0);const _0x903faf=listProfiles(),_0x54431c=_0x903faf[_0x31b6fb(0x1cf)](_0x657b2a=>_0x657b2a[_0x31b6fb(0x1b5)]===_0xc72be0);return _0x54431c||null;}export function saveProfile(_0x42a969,_0x3f05f3,_0x4f9cee=![]){saveProfileToUserConfig(_0x42a969,_0x3f05f3);}export function deleteProfile(_0x4d7a91){const _0x2ce155=a49_0x1b58;validateProfileName(_0x4d7a91);const _0x22b709=getProfileDir(_0x4d7a91);if(!a49_0x44ca24['existsSync'](_0x22b709))throw new Error(_0x2ce155(0x1d4)+_0x4d7a91+'\x20does\x20not\x20exist');a49_0x44ca24[_0x2ce155(0x1ba)](_0x22b709,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x457f37,_0x375e01){const _0x3bd3f9=a49_0x1b58;validateProfileName(_0x457f37);const _0x140d49=getGlobalConfigPath(),_0x5e71b7=getConfigDir();!a49_0x44ca24[_0x3bd3f9(0x1a1)](_0x5e71b7)&&createSecureDirectory(_0x5e71b7);let _0x5cc281={};if(a49_0x44ca24[_0x3bd3f9(0x1a1)](_0x140d49))try{const _0xa317a8=a49_0x44ca24[_0x3bd3f9(0x1b0)](_0x140d49,_0x3bd3f9(0x19e));_0x5cc281=JSON[_0x3bd3f9(0x1a0)](_0xa317a8);}catch{console['warn']('Warning:\x20Failed\x20to\x20parse\x20'+_0x140d49+_0x3bd3f9(0x196));}!_0x5cc281[_0x3bd3f9(0x1bc)]&&(_0x5cc281[_0x3bd3f9(0x1bc)]={}),_0x5cc281[_0x3bd3f9(0x1bc)][_0x457f37]=_0x375e01,writeSecureFile(_0x140d49,JSON[_0x3bd3f9(0x191)](_0x5cc281,null,0x2));}export function getActiveProfile(){const _0x50ac4e=a49_0x1b58,_0x4f24fb=loadSessionContext();if(_0x4f24fb?.[_0x50ac4e(0x18f)])return _0x4f24fb['profile'];const _0x16562f=getGlobalConfigPath();if(!a49_0x44ca24[_0x50ac4e(0x1a1)](_0x16562f))return null;try{const _0xd754=a49_0x44ca24['readFileSync'](_0x16562f,'utf-8'),_0x4882d2=JSON[_0x50ac4e(0x1a0)](_0xd754);return _0x4882d2['profile']||null;}catch{return null;}}export function createProfile(_0x2542b5,_0x3eeda5){const _0x3e64e0=a49_0x1b58;validateProfileName(_0x2542b5);if(profileExists(_0x2542b5))throw new Error(_0x3e64e0(0x1d4)+_0x2542b5+_0x3e64e0(0x18e));saveProfile(_0x2542b5,_0x3eeda5);}export function saveProfileCredentials(_0x2c57f7,_0x5b349c){validateProfileName(_0x2c57f7);if(!profileExists(_0x2c57f7))throw new Error('Profile\x20'+_0x2c57f7+'\x20does\x20not\x20exist');const _0x12bc68=getNewCredentialPath(_0x2c57f7);writeSecureFile(_0x12bc68,_0x5b349c);}export function loadProfileCredentials(_0x4d9da3){const _0x230d40=a49_0x1b58;validateProfileName(_0x4d9da3);const _0x3028c2=getNewCredentialPath(_0x4d9da3);if(a49_0x44ca24[_0x230d40(0x1a1)](_0x3028c2))try{return a49_0x44ca24[_0x230d40(0x1b0)](_0x3028c2,_0x230d40(0x19e));}catch{}const _0x3caf7e=getOldCredentialPath(_0x4d9da3);if(a49_0x44ca24[_0x230d40(0x1a1)](_0x3caf7e)){console[_0x230d40(0x193)](_0x230d40(0x189)+_0x4d9da3+'\x27'),console[_0x230d40(0x193)]('To\x20migrate:'),console[_0x230d40(0x193)]('\x20\x20mv\x20\x22'+_0x3caf7e+'\x22\x20\x22'+_0x3028c2+'\x22'),console['warn']('Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a');try{return a49_0x44ca24[_0x230d40(0x1b0)](_0x3caf7e,'utf-8');}catch{return null;}}return null;}