eve-hub 0.6.59 → 0.6.61
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.
- package/CHANGELOG.md +12 -0
- package/hooks/mention-gate.js +7 -3
- package/mention-gate.d.mts +1 -1
- package/mention-gate.mjs +2 -2
- package/package.json +1 -1
- package/world.mjs +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# eve-hub
|
|
2
2
|
|
|
3
|
+
## 0.6.61
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Hosted hub: every database call has a deadline (a read that never answered held the feed for 4 minutes), and the rows Turso counts are metered per request and per hour with an owner alert; slow calls name their instance and statement.
|
|
8
|
+
|
|
9
|
+
## 0.6.60
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- A deployed bot's mention gate uses its own deployment's OIDC token for AI Gateway; a Mac bot's gate gets a project token from the hub, never the owner's OAuth token.
|
|
14
|
+
|
|
3
15
|
## 0.6.59
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/hooks/mention-gate.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getVercelOidcToken } from "@vercel/oidc";
|
|
1
2
|
import { defineHook } from "eve/hooks";
|
|
2
3
|
import { registryBase, registryFetch } from "../registry-fetch.mjs";
|
|
3
4
|
import { credentialCache, hubCredentialLoader, screenInbound } from "../mention-gate.mjs";
|
|
@@ -6,9 +7,12 @@ import { credentialCache, hubCredentialLoader, screenInbound } from "../mention-
|
|
|
6
7
|
// and the delivery whether a reply is needed. On a skip the hub posts
|
|
7
8
|
// "<bot> skipped: <reason>" and the turn is cancelled before any model call.
|
|
8
9
|
// Any failure answers. The hub names the bot from its session and serves its
|
|
9
|
-
// instructions
|
|
10
|
-
// the
|
|
11
|
-
|
|
10
|
+
// instructions, so a deployed bot and a Mac bot run the same code. Its AI Gateway
|
|
11
|
+
// credential is an OIDC token for the workspace's bots project: a deployed bot
|
|
12
|
+
// carries its own, and a Mac bot has none, so it asks the hub for one.
|
|
13
|
+
// See packages/agent-kit/mention-gate.mjs.
|
|
14
|
+
const deploymentToken = async () => ({ ok: true, token: await getVercelOidcToken() });
|
|
15
|
+
const credential = credentialCache(process.env.VERCEL ? deploymentToken : hubCredentialLoader(registryFetch));
|
|
12
16
|
export default defineHook({
|
|
13
17
|
events: {
|
|
14
18
|
async "message.received"(event, ctx) {
|
package/mention-gate.d.mts
CHANGED
|
@@ -3,4 +3,4 @@ export function gateConfig(env?: Record<string, string | undefined>, file?: unkn
|
|
|
3
3
|
export function opensWithHandle(text: string, agent: string): boolean;
|
|
4
4
|
export function cleanReason(reason: unknown): string;
|
|
5
5
|
export function screenInbound(input: { text: string; sessionId: string; agent?: string; registryUrl: string; credential: (opts?: { refresh?: boolean }) => Promise<{ token: string; teamId?: string | null } | null>; instructions?: string; fetchImpl?: typeof fetch; log?: ((line: string) => void) | null }): Promise<{ cancel: boolean; result?: unknown }>;
|
|
6
|
-
export function hubCredentialLoader(fetchHub: (path: string, init: { headers?: Record<string, string> }) => Promise<Response>): (opts?: { refresh?: boolean }) => Promise<{ ok: boolean; token?: string;
|
|
6
|
+
export function hubCredentialLoader(fetchHub: (path: string, init: { headers?: Record<string, string> }) => Promise<Response>): (opts?: { refresh?: boolean }) => Promise<{ ok: boolean; token?: string; error?: string }>;
|
package/mention-gate.mjs
CHANGED
|
@@ -434,7 +434,7 @@ export async function screenInbound({ text, sessionId, agent, registryUrl, instr
|
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
436
|
|
|
437
|
-
// A
|
|
437
|
+
// A Mac bot's AI Gateway credential: the hub mints an OIDC token for the workspace's bots project, asked for with the bot's HUB_TOKEN.
|
|
438
438
|
// `fetchHub(path, init)` is registryFetch. On a refresh it names the token AI Gateway refused, as eve's served credential does.
|
|
439
439
|
export function hubCredentialLoader(fetchHub) {
|
|
440
440
|
let last = null;
|
|
@@ -443,6 +443,6 @@ export function hubCredentialLoader(fetchHub) {
|
|
|
443
443
|
if (!res.ok) return { ok: false, error: `model credential ${res.status}` };
|
|
444
444
|
const c = await res.json();
|
|
445
445
|
last = c.token ?? null;
|
|
446
|
-
return { ok: Boolean(c.token), token: c.token
|
|
446
|
+
return { ok: Boolean(c.token), token: c.token };
|
|
447
447
|
};
|
|
448
448
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eve-hub",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.61",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Bot-side code shared by every hub agent: registry tools, the roster hook, the eve channel, the host sandbox and browser, and model helpers.",
|
|
6
6
|
"type": "module",
|
package/world.mjs
CHANGED
|
@@ -5,7 +5,7 @@ var __export = (target, all) => {
|
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
// ../../hosted-hub/bots/world.ts
|
|
8
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
8
|
+
import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
|
|
9
9
|
import { createVercelQueueWorld } from "eve/world-hub";
|
|
10
10
|
|
|
11
11
|
// ../../hosted-hub/bots/session-codec.ts
|
|
@@ -414,8 +414,10 @@ function reduceChild(member, { type, data = {}, meta: meta4 }, at = Date.parse(m
|
|
|
414
414
|
}
|
|
415
415
|
|
|
416
416
|
// ../../hosted-hub/src/store/db.ts
|
|
417
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
417
418
|
import { createClient, LibsqlError } from "@libsql/client";
|
|
418
419
|
var s = (sql, ...args) => ({ sql, args });
|
|
420
|
+
var running = new AsyncLocalStorage();
|
|
419
421
|
|
|
420
422
|
// ../../hosted-hub/node_modules/zod/v4/classic/external.js
|
|
421
423
|
var external_exports = {};
|
|
@@ -27575,7 +27577,7 @@ async function foldAppend(tx, { runId, name, chunks, firstIndex }) {
|
|
|
27575
27577
|
async function createWorld() {
|
|
27576
27578
|
const url2 = process.env.TURSO_DATABASE_URL;
|
|
27577
27579
|
if (!url2) throw new Error("TURSO_DATABASE_URL is required");
|
|
27578
|
-
const appends = new
|
|
27580
|
+
const appends = new AsyncLocalStorage2();
|
|
27579
27581
|
const authToken = process.env.TURSO_AUTH_TOKEN;
|
|
27580
27582
|
const storage = createTursoWorld({
|
|
27581
27583
|
url: url2,
|