@sesamespace/hivemind 0.8.6 → 0.8.7

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.
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Watchdog
3
- } from "./chunk-K7YQY253.js";
3
+ } from "./chunk-SIVKWEBG.js";
4
4
  import {
5
5
  defaultSentinelConfig,
6
6
  loadConfig
7
- } from "./chunk-S4QRR3ZJ.js";
7
+ } from "./chunk-KYNTNQXV.js";
8
8
 
9
9
  // packages/cli/src/commands/watchdog.ts
10
10
  import { resolve } from "path";
@@ -76,4 +76,4 @@ Options:
76
76
  export {
77
77
  runWatchdogCommand
78
78
  };
79
- //# sourceMappingURL=chunk-WIJHKLB3.js.map
79
+ //# sourceMappingURL=chunk-EJDVSTQU.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SesameClient,
3
3
  getClaudeCodeOAuthToken
4
- } from "./chunk-S4QRR3ZJ.js";
4
+ } from "./chunk-KYNTNQXV.js";
5
5
 
6
6
  // packages/cli/src/commands/init.ts
7
7
  import { resolve, dirname } from "path";
@@ -359,4 +359,4 @@ Options:
359
359
  export {
360
360
  runInitCommand
361
361
  };
362
- //# sourceMappingURL=chunk-LSLF7AGW.js.map
362
+ //# sourceMappingURL=chunk-FWXELKMS.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  FleetManager
3
- } from "./chunk-K7YQY253.js";
3
+ } from "./chunk-SIVKWEBG.js";
4
4
 
5
5
  // packages/cli/src/commands/fleet.ts
6
6
  function formatUptime(seconds) {
@@ -183,4 +183,4 @@ Commands:
183
183
  export {
184
184
  runFleetCommand
185
185
  };
186
- //# sourceMappingURL=chunk-AYHCHIM2.js.map
186
+ //# sourceMappingURL=chunk-HY4VNB7P.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  startPipeline
3
- } from "./chunk-S4QRR3ZJ.js";
3
+ } from "./chunk-KYNTNQXV.js";
4
4
 
5
5
  // packages/cli/src/commands/start.ts
6
6
  import { resolve } from "path";
@@ -66,4 +66,4 @@ Options:
66
66
  export {
67
67
  runStartCommand
68
68
  };
69
- //# sourceMappingURL=chunk-CJ4Y2BCE.js.map
69
+ //# sourceMappingURL=chunk-ISMZKQVP.js.map
@@ -97,6 +97,7 @@ var LLMClient = class {
97
97
  temperature;
98
98
  apiKey;
99
99
  provider;
100
+ isOAuth;
100
101
  constructor(config) {
101
102
  this.baseUrl = config.base_url;
102
103
  this.model = config.model;
@@ -104,10 +105,12 @@ var LLMClient = class {
104
105
  this.temperature = config.temperature;
105
106
  this.apiKey = config.api_key ?? "";
106
107
  this.provider = config.provider ?? "openai";
108
+ this.isOAuth = false;
107
109
  if (this.provider === "anthropic" && !this.apiKey) {
108
110
  const token = getClaudeCodeOAuthToken();
109
111
  if (token) {
110
112
  this.apiKey = token;
113
+ this.isOAuth = true;
111
114
  if (!this.baseUrl || this.baseUrl.includes("openrouter")) {
112
115
  this.baseUrl = "https://api.anthropic.com";
113
116
  }
@@ -210,13 +213,19 @@ var LLMClient = class {
210
213
  console.log(`[llm] Retry ${attempt}/${MAX_RETRIES} after ${delayMs}ms...`);
211
214
  await new Promise((r) => setTimeout(r, delayMs));
212
215
  }
216
+ const headers = {
217
+ "Content-Type": "application/json",
218
+ "anthropic-version": "2023-06-01"
219
+ };
220
+ if (this.isOAuth) {
221
+ headers["Authorization"] = `Bearer ${this.apiKey}`;
222
+ headers["anthropic-beta"] = "oauth-2025-04-20";
223
+ } else {
224
+ headers["x-api-key"] = this.apiKey;
225
+ }
213
226
  const resp = await fetch(`${this.baseUrl}/v1/messages`, {
214
227
  method: "POST",
215
- headers: {
216
- "Content-Type": "application/json",
217
- "x-api-key": this.apiKey,
218
- "anthropic-version": "2023-06-01"
219
- },
228
+ headers,
220
229
  body: JSON.stringify(body)
221
230
  });
222
231
  if (!resp.ok) {
@@ -7384,4 +7393,4 @@ smol-toml/dist/index.js:
7384
7393
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7385
7394
  *)
7386
7395
  */
7387
- //# sourceMappingURL=chunk-S4QRR3ZJ.js.map
7396
+ //# sourceMappingURL=chunk-KYNTNQXV.js.map