(organizationId: string)
| 64 | const BASE = "http://localhost:4788"; |
| 65 | |
| 66 | const addOrgSource = async (organizationId: string): Promise<void> => { |
| 67 | // Register the integration and attach an org-owned connection, on its own |
| 68 | // connection to the shared DB file. WAL makes the committed rows visible to |
| 69 | // the server. Org-owned connections (and their per-connection tools) are |
| 70 | // shared across every member of the tenant. |
| 71 | const seedDb = await createSelfHostDb({ |
| 72 | path: dbPath, |
| 73 | namespace: "executor_selfhost", |
| 74 | version: "1.0.0", |
| 75 | }); |
| 76 | await Effect.runPromise( |
| 77 | Effect.gen(function* () { |
| 78 | const admin = yield* createScopedExecutor("seed", organizationId, "Default"); |
| 79 | yield* admin.openapi.addSpec({ |
| 80 | spec: { kind: "blob", value: TINY_SPEC }, |
| 81 | slug: "tiny", |
| 82 | baseUrl: "", |
| 83 | }); |
| 84 | yield* admin.connections.create({ |
| 85 | owner: "org", |
| 86 | name: ConnectionName.make("shared"), |
| 87 | integration: IntegrationSlug.make("tiny"), |
| 88 | template: AuthTemplateSlug.make("none"), |
| 89 | value: "", |
| 90 | }); |
| 91 | }).pipe(Effect.provide(Layer.succeed(SelfHostDb)(seedDb)), Effect.scoped), |
| 92 | ); |
| 93 | await seedDb.close(); |
| 94 | }; |
| 95 | |
| 96 | test("a user's MCP execute sandbox can reach an org-owned connection's tools", async () => { |
| 97 | const inviteCode = await mintInviteCode(handler); |
no test coverage detected