feat: MCP apps render and run inline in threads (#16236)
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
6ecb82dc42
commit
4d976d1fc2
83 files changed
+4990
-55
No files matched your search
@@ -72,6 +72,7 @@ import Migration0055 from "./Migrations/055_OrchestrationV2.ts";
|
||||
import Migration0056 from "./Migrations/056_RemoveRedundantProjectionIndexes.ts";
|
||||
import Migration0057 from "./Migrations/057_ScheduledTaskWebhooks.ts";
|
||||
import Migration0058 from "./Migrations/058_WebhookRelayDeliveries.ts";
|
||||
import Migration0059 from "./Migrations/059_McpAppModelContext.ts";
|
||||
|
||||
/**
|
||||
* Migration loader with all migrations defined inline.
|
||||
@@ -144,6 +145,7 @@ export const migrationEntries = [
|
||||
[56, "RemoveRedundantProjectionIndexes", Migration0056],
|
||||
[57, "ScheduledTaskWebhooks", Migration0057],
|
||||
[58, "WebhookRelayDeliveries", Migration0058],
|
||||
[59, "McpAppModelContext", Migration0059],
|
||||
] as const;
|
||||
|
||||
export const migrationManifest = migrationEntries.map(([id, name]) => [id, name] as const);
|
||||
|
||||
@@ -13,7 +13,7 @@ layer("055_OrchestrationV2", (it) => {
|
||||
Effect.sync(() => {
|
||||
assert.deepStrictEqual(
|
||||
migrationEntries.map(([id]) => id),
|
||||
Array.from({ length: 58 }, (_, index) => index + 1),
|
||||
Array.from({ length: 59 }, (_, index) => index + 1),
|
||||
);
|
||||
}),
|
||||
);
|
||||
@@ -30,6 +30,7 @@ layer("055_OrchestrationV2", (it) => {
|
||||
[56, "RemoveRedundantProjectionIndexes"],
|
||||
[57, "ScheduledTaskWebhooks"],
|
||||
[58, "WebhookRelayDeliveries"],
|
||||
[59, "McpAppModelContext"],
|
||||
]);
|
||||
assert.deepStrictEqual(yield* runMigrations(), []);
|
||||
|
||||
@@ -54,6 +55,7 @@ layer("055_OrchestrationV2", (it) => {
|
||||
{ migration_id: 56, name: "RemoveRedundantProjectionIndexes" },
|
||||
{ migration_id: 57, name: "ScheduledTaskWebhooks" },
|
||||
{ migration_id: 58, name: "WebhookRelayDeliveries" },
|
||||
{ migration_id: 59, name: "McpAppModelContext" },
|
||||
]);
|
||||
|
||||
const tables = yield* sql<{ readonly name: string }>`
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import * as Effect from "effect/Effect";
|
||||
import * as SqlClient from "effect/sql/SqlClient";
|
||||
|
||||
export default Effect.gen(function* () {
|
||||
const sql = yield* SqlClient.SqlClient;
|
||||
|
||||
// The latest context each MCP App gave the agent (`ui/update-model-context`),
|
||||
// one row per app, replaced on every update and sent with the thread's next
|
||||
// turn.
|
||||
yield* sql`
|
||||
CREATE TABLE IF NOT EXISTS mcp_app_model_context (
|
||||
thread_id TEXT NOT NULL,
|
||||
item_id TEXT NOT NULL,
|
||||
server TEXT NOT NULL,
|
||||
tool TEXT NOT NULL,
|
||||
text TEXT NOT NULL,
|
||||
updated_at TEXT NOT NULL,
|
||||
PRIMARY KEY (thread_id, item_id)
|
||||
)
|
||||
`;
|
||||
});
|
||||
@@ -39,6 +39,7 @@ describe("V2 preview upgrade", () => {
|
||||
[56, "RemoveRedundantProjectionIndexes"],
|
||||
[57, "ScheduledTaskWebhooks"],
|
||||
[58, "WebhookRelayDeliveries"],
|
||||
[59, "McpAppModelContext"],
|
||||
]);
|
||||
assert.deepStrictEqual(yield* runMigrations(), []);
|
||||
assert.deepStrictEqual(yield* sql`SELECT * FROM orchestration_v2_legacy_imports`, imports);
|
||||
@@ -120,6 +121,7 @@ describe("V2 preview upgrade", () => {
|
||||
[56, "RemoveRedundantProjectionIndexes"],
|
||||
[57, "ScheduledTaskWebhooks"],
|
||||
[58, "WebhookRelayDeliveries"],
|
||||
[59, "McpAppModelContext"],
|
||||
]);
|
||||
}).pipe(Effect.provide(NodeSqliteClient.layer({ filename: ":memory:" }))),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user