eve-hub 0.6.58 → 0.6.60
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 +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# eve-hub
|
|
2
2
|
|
|
3
|
+
## 0.6.60
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 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.
|
|
8
|
+
|
|
9
|
+
## 0.6.59
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Hosted onboarding: each teammate approves GitHub once, and the hub's commits (a workspace's first files, version bumps, added bots) are made as them; the update card gets an Approve GitHub button.
|
|
14
|
+
|
|
3
15
|
## 0.6.58
|
|
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.60",
|
|
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
|
@@ -27045,7 +27045,7 @@ var HostedUpdate = object2({
|
|
|
27045
27045
|
/** `updated`: the move was a commit that is not an update to the hub's release (a memory or instructions edit); `commit` is it. */
|
|
27046
27046
|
plain: boolean5().optional(),
|
|
27047
27047
|
/**
|
|
27048
|
-
* `kind`: sign-in (the owner signs in again) | build (`url` is the failed build) | other. A failed build also carries
|
|
27048
|
+
* `kind`: sign-in (the owner signs in again) | github (the owner approves GitHub: the app asks `githubConsent` for a fresh link) | build (`url` is the failed build) | other. A failed build also carries
|
|
27049
27049
|
* what Vercel says of it once the hub has read it: the `step` that failed, the `sha` it built, and the `log`'s last lines.
|
|
27050
27050
|
*/
|
|
27051
27051
|
error: maybe(object2({
|
|
@@ -27198,7 +27198,7 @@ var Upgrade = external_exports.object({
|
|
|
27198
27198
|
ref: external_exports.string().nullable().default(null),
|
|
27199
27199
|
deployment: external_exports.string().nullable().default(null),
|
|
27200
27200
|
at: external_exports.string(),
|
|
27201
|
-
error: external_exports.object({ kind: external_exports.enum(["sign-in", "other"]), message: external_exports.string() }).nullable().default(null)
|
|
27201
|
+
error: external_exports.object({ kind: external_exports.enum(["sign-in", "github", "other"]), message: external_exports.string() }).nullable().default(null)
|
|
27202
27202
|
});
|
|
27203
27203
|
var Failure = external_exports.object({ step: external_exports.string().nullable(), message: external_exports.string().nullable(), log: external_exports.array(external_exports.string()) });
|
|
27204
27204
|
var Attempt = external_exports.object({ id: external_exports.string().nullable(), key: external_exports.string().nullable(), state: external_exports.string(), url: external_exports.string(), failure: Failure.nullable().default(null) });
|