eve-hub 0.16.19 → 0.16.21

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.
@@ -7,6 +7,8 @@ import { isHubRequest } from "../hub-oidc.mjs";
7
7
  // a local-dev request, or one from the hub (a deployed bot, see hub-oidc.mjs). Resolving it as a user lets user-scoped
8
8
  // connections (open_pull_request's OAuth) key tokens to the configured human;
9
9
  // `localDev()` alone is not a user, so eve fails them with principal_required.
10
+ // eve serves `GET /eve/v1/info` only to operator principals; the hub reads it as this user to learn the bot's
11
+ // schedules and tools (hosted-hub readDeployment), so a request that passed the hub check may read it too.
10
12
  const dev = localDev();
11
13
  async function rosterUser(req) {
12
14
  const user = req.headers.get("x-roster-user");
@@ -14,7 +16,7 @@ async function rosterUser(req) {
14
16
  return null;
15
17
  if (!(await dev(req)) && !(await isHubRequest(req, getVercelOidcToken)))
16
18
  return null;
17
- return { authenticator: "roster", principalId: `roster:${user}`, principalType: "user", attributes: {} };
19
+ return { authenticator: "roster", principalId: `roster:${user}`, principalType: "user", attributes: {}, allowAgentInfo: true };
18
20
  }
19
21
  // No turnPolicy: eve's default steers a message into the running turn at its
20
22
  // next step. The registry sends turnPolicy "queue" for a bot's message, so it
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eve-hub",
3
- "version": "0.16.19",
3
+ "version": "0.16.21",
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/vercel.mjs CHANGED
@@ -5,12 +5,17 @@
5
5
  // Vercel build: elsewhere this file's cwd is a person's checkout.
6
6
  import { withEve } from "eve/vercel";
7
7
  import { prepareDeployment } from "./prepare.mjs";
8
+ import { coordinatorOf, readWorkspaceFile } from "./workspace.mjs";
8
9
 
9
- if (process.env.VERCEL) prepareDeployment(process.cwd());
10
+ const dir = process.cwd();
11
+ if (process.env.VERCEL) prepareDeployment(dir);
10
12
 
11
13
  // Each agents/<name>/agent is its own service at /eve/<name>/v1/*. eve
12
- // publishes only its own transport routes, so main's /hub/manifest channel
13
- // route (agents/main/agent/channels/manifest.ts) is routed here.
14
+ // publishes only its own transport routes, so the coordinator's /hub/manifest
15
+ // channel route (agents/<coordinator>/agent/channels/manifest.ts, which
16
+ // prepare.mjs writes) is routed here.
17
+ const coordinator = coordinatorOf(readWorkspaceFile(dir).agents);
18
+ if (!coordinator) throw new Error(`${dir}: hub.workspace.json names no coordinator to serve /hub/manifest`);
14
19
  export default await withEve({
15
- routes: [{ src: "^/hub/manifest$", destination: { type: "service", service: "eve-main" } }],
20
+ routes: [{ src: "^/hub/manifest$", destination: { type: "service", service: `eve-${coordinator}` } }],
16
21
  });