eve-hub 0.16.244 → 0.16.245

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 (37) hide show
  1. package/channels/eve-roster-user.js +5 -0
  2. package/hub/functions/.well-known/workflow/v1/flow.func/hub/hub.mjs +956 -955
  3. package/hub/functions/.well-known/workflow/v1/flow.func/migrations/control/0009_runtime_mode.sql +19 -0
  4. package/hub/functions/.well-known/workflow/v1/flow.func/migrations/control/meta/_journal.json +7 -0
  5. package/hub/functions/.well-known/workflow/v1/flow.func/migrations/workspace/0031_compiled_snapshots.sql +11 -0
  6. package/hub/functions/.well-known/workflow/v1/flow.func/migrations/workspace/meta/_journal.json +7 -0
  7. package/hub/functions/api/index.func/api/index.mjs +956 -955
  8. package/hub/functions/api/index.func/migrations/control/0009_runtime_mode.sql +19 -0
  9. package/hub/functions/api/index.func/migrations/control/meta/_journal.json +7 -0
  10. package/hub/functions/api/index.func/migrations/workspace/0031_compiled_snapshots.sql +11 -0
  11. package/hub/functions/api/index.func/migrations/workspace/meta/_journal.json +7 -0
  12. package/hub/migrations/control/0009_runtime_mode.sql +19 -0
  13. package/hub/migrations/control/meta/_journal.json +7 -0
  14. package/hub/migrations/workspace/0031_compiled_snapshots.sql +11 -0
  15. package/hub/migrations/workspace/meta/_journal.json +7 -0
  16. package/hub-shared/functions/.well-known/workflow/v1/flow.func/hub/hub.mjs +2409 -2372
  17. package/hub-shared/functions/.well-known/workflow/v1/flow.func/migrations/control/0009_runtime_mode.sql +19 -0
  18. package/hub-shared/functions/.well-known/workflow/v1/flow.func/migrations/control/meta/_journal.json +7 -0
  19. package/hub-shared/functions/.well-known/workflow/v1/flow.func/migrations/workspace/0031_compiled_snapshots.sql +11 -0
  20. package/hub-shared/functions/.well-known/workflow/v1/flow.func/migrations/workspace/meta/_journal.json +7 -0
  21. package/hub-shared/functions/api/index.func/api/index.mjs +2409 -2372
  22. package/hub-shared/functions/api/index.func/migrations/control/0009_runtime_mode.sql +19 -0
  23. package/hub-shared/functions/api/index.func/migrations/control/meta/_journal.json +7 -0
  24. package/hub-shared/functions/api/index.func/migrations/workspace/0031_compiled_snapshots.sql +11 -0
  25. package/hub-shared/functions/api/index.func/migrations/workspace/meta/_journal.json +7 -0
  26. package/hub-shared/migrations/control/0009_runtime_mode.sql +19 -0
  27. package/hub-shared/migrations/control/meta/_journal.json +7 -0
  28. package/hub-shared/migrations/workspace/0031_compiled_snapshots.sql +11 -0
  29. package/hub-shared/migrations/workspace/meta/_journal.json +7 -0
  30. package/package.json +5 -1
  31. package/schedules/tracker-prs-run.d.mts +1 -0
  32. package/schedules/writing-rewrite-run.d.mts +2 -0
  33. package/schedules/writing-rewrite-run.mjs +15 -0
  34. package/schedules/writing-rewrite.d.ts +1 -6
  35. package/schedules/writing-rewrite.js +3 -12
  36. package/tenant-env.d.mts +3 -0
  37. package/tenant-env.mjs +17 -3
@@ -2,6 +2,7 @@ import { eveChannel } from "eve/channels/eve";
2
2
  import { localDev } from "eve/channels/auth";
3
3
  import { getVercelOidcToken } from "@vercel/oidc";
4
4
  import { isHubRequest } from "../hub-oidc.mjs";
5
+ import { sharedAuthenticator } from "../tenant-env.mjs";
5
6
  // The registry relays for the workspace's human and names them in
6
7
  // `x-roster-user`. The name is trusted as a user principal only from the hub:
7
8
  // a local-dev request, or one from the hub (a deployed bot, see hub-oidc.mjs). Resolving it as a user lets user-scoped
@@ -11,6 +12,9 @@ import { isHubRequest } from "../hub-oidc.mjs";
11
12
  // schedules and tools (hosted-hub readDeployment), so a request that passed the hub check may read it too.
12
13
  const dev = localDev();
13
14
  async function rosterUser(req) {
15
+ const shared = sharedAuthenticator();
16
+ if (shared)
17
+ return shared(req);
14
18
  const user = req.headers.get("x-roster-user");
15
19
  if (!user)
16
20
  return null;
@@ -18,6 +22,7 @@ async function rosterUser(req) {
18
22
  return null;
19
23
  return { authenticator: "roster", principalId: `roster:${user}`, principalType: "user", attributes: {}, allowAgentInfo: true };
20
24
  }
25
+ // In a shared process (one deployment loading many workspaces' compiled agents) the process's own sign-in check replaces the hub-identity check above: this process has no BOT_TOKEN of its own.
21
26
  // No turnPolicy: eve's default steers a message into the running turn at its
22
27
  // next step. The registry sends turnPolicy "queue" for a bot's message, so it
23
28
  // waits for the turn to end.