@aotter/mantle-runtime 0.1.0-alpha.9 → 0.1.2-alpha.2
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/README.md +74 -4
- package/dist/MantleRuntime.js +14 -6
- package/dist/MantleRuntime.js.map +1 -1
- package/dist/domain/model/EntryRow.d.ts +16 -16
- package/dist/domain/model/EntryRow.d.ts.map +1 -1
- package/dist/domain/model/EntryRow.js +34 -0
- package/dist/domain/model/EntryRow.js.map +1 -1
- package/dist/domain/port/DatabaseDriver.d.ts +2 -2
- package/dist/domain/port/DatabaseDriver.d.ts.map +1 -1
- package/dist/domain/port/EntryReader.d.ts +38 -3
- package/dist/domain/port/EntryReader.d.ts.map +1 -1
- package/dist/domain/port/EntryRepository.d.ts +13 -6
- package/dist/domain/port/EntryRepository.d.ts.map +1 -1
- package/dist/domain/port/index.d.ts +2 -2
- package/dist/domain/port/index.d.ts.map +1 -1
- package/dist/domain/port/index.js.map +1 -1
- package/dist/domain/service/CallableCapabilityProjector.d.ts +28 -0
- package/dist/domain/service/CallableCapabilityProjector.d.ts.map +1 -0
- package/dist/domain/service/CallableCapabilityProjector.js +67 -0
- package/dist/domain/service/CallableCapabilityProjector.js.map +1 -0
- package/dist/domain/service/EntryMutationDiagnostics.d.ts.map +1 -1
- package/dist/domain/service/EntryMutationDiagnostics.js +11 -1
- package/dist/domain/service/EntryMutationDiagnostics.js.map +1 -1
- package/dist/domain/service/PathMatcher.d.ts +7 -0
- package/dist/domain/service/PathMatcher.d.ts.map +1 -1
- package/dist/domain/service/PathMatcher.js +56 -0
- package/dist/domain/service/PathMatcher.js.map +1 -1
- package/dist/domain/service/RuntimePlanCompiler.d.ts +7 -2
- package/dist/domain/service/RuntimePlanCompiler.d.ts.map +1 -1
- package/dist/domain/service/RuntimePlanCompiler.js +1 -0
- package/dist/domain/service/RuntimePlanCompiler.js.map +1 -1
- package/dist/domain/service/index.d.ts +1 -0
- package/dist/domain/service/index.d.ts.map +1 -1
- package/dist/domain/service/index.js +1 -0
- package/dist/domain/service/index.js.map +1 -1
- package/dist/domain/service/io/JoinedEntryReader.d.ts.map +1 -1
- package/dist/domain/service/io/JoinedEntryReader.js +2 -3
- package/dist/domain/service/io/JoinedEntryReader.js.map +1 -1
- package/dist/index.d.ts +12 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/boot/SqliteMigrationRunner.d.ts +1 -0
- package/dist/infrastructure/boot/SqliteMigrationRunner.d.ts.map +1 -1
- package/dist/infrastructure/boot/SqliteMigrationRunner.js +71 -12
- package/dist/infrastructure/boot/SqliteMigrationRunner.js.map +1 -1
- package/dist/infrastructure/boot/bootState.d.ts +2 -0
- package/dist/infrastructure/boot/bootState.d.ts.map +1 -1
- package/dist/infrastructure/boot/bootState.js +3 -1
- package/dist/infrastructure/boot/bootState.js.map +1 -1
- package/dist/infrastructure/boot/canonicalMigrations.d.ts +4 -15
- package/dist/infrastructure/boot/canonicalMigrations.d.ts.map +1 -1
- package/dist/infrastructure/boot/canonicalMigrations.js +14 -200
- package/dist/infrastructure/boot/canonicalMigrations.js.map +1 -1
- package/dist/infrastructure/boot/index.d.ts +2 -2
- package/dist/infrastructure/boot/index.d.ts.map +1 -1
- package/dist/infrastructure/boot/index.js +2 -2
- package/dist/infrastructure/boot/index.js.map +1 -1
- package/dist/infrastructure/http/createMantleRequestHandler.d.ts +3 -0
- package/dist/infrastructure/http/createMantleRequestHandler.d.ts.map +1 -1
- package/dist/infrastructure/http/createMantleRequestHandler.js +36 -15
- package/dist/infrastructure/http/createMantleRequestHandler.js.map +1 -1
- package/dist/infrastructure/http/readJsonBody.d.ts +8 -0
- package/dist/infrastructure/http/readJsonBody.d.ts.map +1 -0
- package/dist/infrastructure/http/readJsonBody.js +36 -0
- package/dist/infrastructure/http/readJsonBody.js.map +1 -0
- package/dist/infrastructure/mcp/McpJsonRpcDispatcher.d.ts +22 -17
- package/dist/infrastructure/mcp/McpJsonRpcDispatcher.d.ts.map +1 -1
- package/dist/infrastructure/mcp/McpJsonRpcDispatcher.js +89 -86
- package/dist/infrastructure/mcp/McpJsonRpcDispatcher.js.map +1 -1
- package/dist/infrastructure/mcp/McpToolCatalog.d.ts +11 -9
- package/dist/infrastructure/mcp/McpToolCatalog.d.ts.map +1 -1
- package/dist/infrastructure/mcp/McpToolCatalog.js +70 -80
- package/dist/infrastructure/mcp/McpToolCatalog.js.map +1 -1
- package/dist/infrastructure/persistence/DatabaseEntryRepository.d.ts +15 -20
- package/dist/infrastructure/persistence/DatabaseEntryRepository.d.ts.map +1 -1
- package/dist/infrastructure/persistence/DatabaseEntryRepository.js +291 -331
- package/dist/infrastructure/persistence/DatabaseEntryRepository.js.map +1 -1
- package/dist/infrastructure/persistence/DatabaseSiteConfigRepository.d.ts +2 -0
- package/dist/infrastructure/persistence/DatabaseSiteConfigRepository.d.ts.map +1 -1
- package/dist/infrastructure/persistence/DatabaseSiteConfigRepository.js +5 -1
- package/dist/infrastructure/persistence/DatabaseSiteConfigRepository.js.map +1 -1
- package/dist/infrastructure/persistence/LifecycleHookingEntryRepository.d.ts +2 -2
- package/dist/infrastructure/persistence/LifecycleHookingEntryRepository.d.ts.map +1 -1
- package/dist/infrastructure/persistence/LifecycleHookingEntryRepository.js +5 -5
- package/dist/infrastructure/persistence/LifecycleHookingEntryRepository.js.map +1 -1
- package/dist/infrastructure/persistence/Pagination.d.ts +6 -0
- package/dist/infrastructure/persistence/Pagination.d.ts.map +1 -1
- package/dist/infrastructure/persistence/Pagination.js +25 -0
- package/dist/infrastructure/persistence/Pagination.js.map +1 -1
- package/dist/infrastructure/storage/SqliteMantleStorageAdapter.d.ts +15 -1
- package/dist/infrastructure/storage/SqliteMantleStorageAdapter.d.ts.map +1 -1
- package/dist/infrastructure/storage/SqliteMantleStorageAdapter.js +64 -9
- package/dist/infrastructure/storage/SqliteMantleStorageAdapter.js.map +1 -1
- package/dist/infrastructure/storage/SqliteMigrationArtifact.d.ts +19 -0
- package/dist/infrastructure/storage/SqliteMigrationArtifact.d.ts.map +1 -0
- package/dist/infrastructure/storage/SqliteMigrationArtifact.js +41 -0
- package/dist/infrastructure/storage/SqliteMigrationArtifact.js.map +1 -0
- package/dist/infrastructure/storage/SqliteSchemaTables.d.ts +23 -0
- package/dist/infrastructure/storage/SqliteSchemaTables.d.ts.map +1 -0
- package/dist/infrastructure/storage/SqliteSchemaTables.js +244 -0
- package/dist/infrastructure/storage/SqliteSchemaTables.js.map +1 -0
- package/dist/infrastructure/storage/SqliteViewCompiler.d.ts +3 -5
- package/dist/infrastructure/storage/SqliteViewCompiler.d.ts.map +1 -1
- package/dist/infrastructure/storage/SqliteViewCompiler.js +20 -51
- package/dist/infrastructure/storage/SqliteViewCompiler.js.map +1 -1
- package/dist/infrastructure/testing/HttpBenchmarkHarness.d.ts +26 -1
- package/dist/infrastructure/testing/HttpBenchmarkHarness.d.ts.map +1 -1
- package/dist/infrastructure/testing/HttpBenchmarkHarness.js +27 -12
- package/dist/infrastructure/testing/HttpBenchmarkHarness.js.map +1 -1
- package/dist/infrastructure/testing/IndexCoverageHarness.d.ts.map +1 -1
- package/dist/infrastructure/testing/IndexCoverageHarness.js +19 -31
- package/dist/infrastructure/testing/IndexCoverageHarness.js.map +1 -1
- package/dist/infrastructure/testing/StorageConformance.d.ts +32 -0
- package/dist/infrastructure/testing/StorageConformance.d.ts.map +1 -0
- package/dist/infrastructure/testing/StorageConformance.js +306 -0
- package/dist/infrastructure/testing/StorageConformance.js.map +1 -0
- package/dist/testing-storage.d.ts +3 -0
- package/dist/testing-storage.d.ts.map +1 -0
- package/dist/testing-storage.js +3 -0
- package/dist/testing-storage.js.map +1 -0
- package/dist/usecase/content/ArchiveUseCase.js +4 -4
- package/dist/usecase/content/ArchiveUseCase.js.map +1 -1
- package/dist/usecase/content/DeleteEntryUseCase.js +4 -4
- package/dist/usecase/content/DeleteEntryUseCase.js.map +1 -1
- package/dist/usecase/content/GetEntryUseCase.d.ts +1 -2
- package/dist/usecase/content/GetEntryUseCase.d.ts.map +1 -1
- package/dist/usecase/content/GetEntryUseCase.js +2 -6
- package/dist/usecase/content/GetEntryUseCase.js.map +1 -1
- package/dist/usecase/content/ListEntriesUseCase.d.ts +1 -1
- package/dist/usecase/content/ListEntriesUseCase.d.ts.map +1 -1
- package/dist/usecase/content/ListEntriesUseCase.js +18 -2
- package/dist/usecase/content/ListEntriesUseCase.js.map +1 -1
- package/dist/usecase/content/RequestPublishUseCase.js +4 -4
- package/dist/usecase/content/RequestPublishUseCase.js.map +1 -1
- package/dist/usecase/content/UnpublishUseCase.js +4 -4
- package/dist/usecase/content/UnpublishUseCase.js.map +1 -1
- package/dist/usecase/content/UpdateDraftUseCase.js +4 -4
- package/dist/usecase/content/UpdateDraftUseCase.js.map +1 -1
- package/dist/usecase/dto/content/index.d.ts +8 -5
- package/dist/usecase/dto/content/index.d.ts.map +1 -1
- package/dist/usecase/media/DeleteMediaAssetUseCase.d.ts +3 -3
- package/dist/usecase/media/DeleteMediaAssetUseCase.d.ts.map +1 -1
- package/dist/usecase/media/DeleteMediaAssetUseCase.js +35 -19
- package/dist/usecase/media/DeleteMediaAssetUseCase.js.map +1 -1
- package/dist/usecase/procedure/InvokeBuiltinUseCase.d.ts +8 -2
- package/dist/usecase/procedure/InvokeBuiltinUseCase.d.ts.map +1 -1
- package/dist/usecase/procedure/InvokeBuiltinUseCase.js +98 -16
- package/dist/usecase/procedure/InvokeBuiltinUseCase.js.map +1 -1
- package/dist/usecase/procedure/InvokeProcedureUseCase.js +2 -2
- package/dist/usecase/procedure/InvokeProcedureUseCase.js.map +1 -1
- package/dist/usecase/site/UpdateSiteSettingsUseCase.d.ts.map +1 -1
- package/dist/usecase/site/UpdateSiteSettingsUseCase.js +8 -1
- package/dist/usecase/site/UpdateSiteSettingsUseCase.js.map +1 -1
- package/package.json +9 -5
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { DatabaseDriver, Migration } from "../../domain/port/DatabaseDriver.js";
|
|
1
|
+
import type { Migration } from "../../domain/port/DatabaseDriver.js";
|
|
3
2
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* v0.1.0 onwards.
|
|
3
|
+
* SQLite infrastructure migrations. Schema content tables are compiled from
|
|
4
|
+
* the RuntimePlan and intentionally live outside this list. This is the
|
|
5
|
+
* pre-beta native-table baseline; once released, migration ids are append-only.
|
|
8
6
|
*/
|
|
9
7
|
export declare const CANONICAL_MIGRATIONS: readonly Migration[];
|
|
10
|
-
/** Keep Schema logical tables exact across manifest additions, edits, and removals. */
|
|
11
|
-
export declare function reconcileSchemaSqlViews(db: DatabaseDriver, schemas: Iterable<SchemaManifest>): Promise<void>;
|
|
12
|
-
export declare function schemaIndexMigrations(schemas: Iterable<SchemaManifest>): readonly Migration[];
|
|
13
|
-
/**
|
|
14
|
-
* Drop generated indexes no longer declared by the current manifests.
|
|
15
|
-
* Keep generated columns: SQLite cannot remove them safely across the
|
|
16
|
-
* D1 versions Mantle supports, and unused virtual columns are harmless.
|
|
17
|
-
*/
|
|
18
|
-
export declare function reconcileSchemaIndexes(db: DatabaseDriver, current: readonly Migration[], schemas: Iterable<SchemaManifest>): Promise<void>;
|
|
19
8
|
//# sourceMappingURL=canonicalMigrations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonicalMigrations.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/boot/canonicalMigrations.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"canonicalMigrations.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/boot/canonicalMigrations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAErE;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,SAAS,EAmRpD,CAAC"}
|
|
@@ -1,32 +1,15 @@
|
|
|
1
|
-
import { buildDdl, buildSchemaSqlView, dropSchemaSqlViewSql, } from "@aotter/mantle-spec";
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* v0.1.0 onwards.
|
|
2
|
+
* SQLite infrastructure migrations. Schema content tables are compiled from
|
|
3
|
+
* the RuntimePlan and intentionally live outside this list. This is the
|
|
4
|
+
* pre-beta native-table baseline; once released, migration ids are append-only.
|
|
7
5
|
*/
|
|
8
6
|
export const CANONICAL_MIGRATIONS = [
|
|
9
7
|
{
|
|
10
8
|
id: "0001-init",
|
|
11
|
-
description: "v0.1.0
|
|
9
|
+
description: "v0.1.0 infrastructure: site_config + Better Auth tables (ADR-0014)",
|
|
12
10
|
// SQLite: Better Auth serializes Date → ISO 8601 string and
|
|
13
11
|
// boolean → 0/1, so date columns are TEXT and booleans INTEGER.
|
|
14
12
|
sql: `
|
|
15
|
-
CREATE TABLE IF NOT EXISTS entries (
|
|
16
|
-
id TEXT PRIMARY KEY,
|
|
17
|
-
collection TEXT NOT NULL,
|
|
18
|
-
status TEXT NOT NULL,
|
|
19
|
-
version INTEGER NOT NULL DEFAULT 1,
|
|
20
|
-
data TEXT NOT NULL,
|
|
21
|
-
author_id TEXT,
|
|
22
|
-
created_at INTEGER NOT NULL,
|
|
23
|
-
updated_at INTEGER NOT NULL
|
|
24
|
-
);
|
|
25
|
-
CREATE INDEX IF NOT EXISTS entries_by_collection_updated
|
|
26
|
-
ON entries (collection, updated_at DESC);
|
|
27
|
-
CREATE INDEX IF NOT EXISTS entries_by_collection_status
|
|
28
|
-
ON entries (collection, status);
|
|
29
|
-
|
|
30
13
|
CREATE TABLE IF NOT EXISTS site_config (
|
|
31
14
|
key TEXT PRIMARY KEY,
|
|
32
15
|
value TEXT NOT NULL
|
|
@@ -275,191 +258,22 @@ export const CANONICAL_MIGRATIONS = [
|
|
|
275
258
|
`,
|
|
276
259
|
},
|
|
277
260
|
{
|
|
278
|
-
id: "0004-
|
|
279
|
-
description: "
|
|
280
|
-
sql: `
|
|
281
|
-
ALTER TABLE entries ADD COLUMN entry_locale TEXT
|
|
282
|
-
GENERATED ALWAYS AS (json_extract(data, '$.locale')) VIRTUAL;
|
|
283
|
-
|
|
284
|
-
CREATE INDEX IF NOT EXISTS entries_published_updated
|
|
285
|
-
ON entries (updated_at DESC, id DESC)
|
|
286
|
-
WHERE status = 'published';
|
|
287
|
-
CREATE INDEX IF NOT EXISTS entries_published_locale_updated
|
|
288
|
-
ON entries (entry_locale, updated_at DESC, id DESC)
|
|
289
|
-
WHERE status = 'published';
|
|
290
|
-
CREATE INDEX IF NOT EXISTS entries_published_collection_updated
|
|
291
|
-
ON entries (collection, updated_at DESC, id DESC)
|
|
292
|
-
WHERE status = 'published';
|
|
293
|
-
CREATE INDEX IF NOT EXISTS entries_published_collection_locale_updated
|
|
294
|
-
ON entries (collection, entry_locale, updated_at DESC, id DESC)
|
|
295
|
-
WHERE status = 'published';
|
|
296
|
-
`,
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
id: "0005-admin-entry-list-access-paths",
|
|
300
|
-
description: "Keyset indexes for bounded admin entry listing",
|
|
301
|
-
sql: `
|
|
302
|
-
CREATE INDEX IF NOT EXISTS entries_by_collection_updated_id
|
|
303
|
-
ON entries (collection, updated_at DESC, id DESC);
|
|
304
|
-
CREATE INDEX IF NOT EXISTS entries_by_collection_status_updated_id
|
|
305
|
-
ON entries (collection, status, updated_at DESC, id DESC);
|
|
306
|
-
|
|
307
|
-
DROP INDEX IF EXISTS entries_by_collection_updated;
|
|
308
|
-
DROP INDEX IF EXISTS entries_by_collection_status;
|
|
309
|
-
DROP INDEX IF EXISTS entries_published_collection_updated;
|
|
310
|
-
`,
|
|
311
|
-
},
|
|
312
|
-
{
|
|
313
|
-
id: "0006-schema-sql-views",
|
|
314
|
-
description: "Track Schema logical SQL views",
|
|
315
|
-
sql: `
|
|
316
|
-
CREATE TABLE IF NOT EXISTS _mantle_schema_views (
|
|
317
|
-
name TEXT PRIMARY KEY NOT NULL
|
|
318
|
-
);
|
|
319
|
-
`,
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
id: "0007-boot-state",
|
|
323
|
-
description: "Skip unchanged boot reconciliation on cold Worker isolates",
|
|
261
|
+
id: "0004-native-schema-storage",
|
|
262
|
+
description: "Track the prepared RuntimePlan and native Schema-table storage",
|
|
324
263
|
sql: `
|
|
325
264
|
CREATE TABLE IF NOT EXISTS _mantle_boot_state (
|
|
326
265
|
id TEXT PRIMARY KEY NOT NULL,
|
|
327
266
|
fingerprint TEXT NOT NULL
|
|
328
267
|
);
|
|
268
|
+
CREATE TABLE IF NOT EXISTS _mantle_schema_tables (
|
|
269
|
+
name TEXT PRIMARY KEY NOT NULL,
|
|
270
|
+
projection TEXT NOT NULL
|
|
271
|
+
);
|
|
272
|
+
CREATE TABLE IF NOT EXISTS _mantle_storage_state (
|
|
273
|
+
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
274
|
+
fingerprint TEXT NOT NULL
|
|
275
|
+
);
|
|
329
276
|
`,
|
|
330
277
|
},
|
|
331
278
|
];
|
|
332
|
-
/** Keep Schema logical tables exact across manifest additions, edits, and removals. */
|
|
333
|
-
export async function reconcileSchemaSqlViews(db, schemas) {
|
|
334
|
-
const views = [...schemas]
|
|
335
|
-
.sort((a, b) => a.metadata.name.localeCompare(b.metadata.name))
|
|
336
|
-
.map(buildSchemaSqlView);
|
|
337
|
-
const desired = new Set(views.map((view) => view.name));
|
|
338
|
-
const tracked = await db.prepare("SELECT name FROM _mantle_schema_views").all();
|
|
339
|
-
for (const { name } of tracked) {
|
|
340
|
-
if (desired.has(name))
|
|
341
|
-
continue;
|
|
342
|
-
await db.prepare(dropSchemaSqlViewSql(name)).run();
|
|
343
|
-
await db.prepare("DELETE FROM _mantle_schema_views WHERE name = ?").bind(name).run();
|
|
344
|
-
}
|
|
345
|
-
for (const view of views) {
|
|
346
|
-
await db.prepare(view.dropSql).run();
|
|
347
|
-
await db.prepare(view.createSql).run();
|
|
348
|
-
await db.prepare("INSERT OR IGNORE INTO _mantle_schema_views(name) VALUES (?)")
|
|
349
|
-
.bind(view.name)
|
|
350
|
-
.run();
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
export function schemaIndexMigrations(schemas) {
|
|
354
|
-
const migrations = [];
|
|
355
|
-
const ordered = [...schemas].sort((a, b) => a.metadata.name.localeCompare(b.metadata.name));
|
|
356
|
-
for (const schema of ordered) {
|
|
357
|
-
const ddl = buildDdl(schema);
|
|
358
|
-
for (const column of ddl.columns) {
|
|
359
|
-
migrations.push({
|
|
360
|
-
id: `schema-index-v2:column:${column.name}`,
|
|
361
|
-
description: `Generated Schema-index column ${column.name}`,
|
|
362
|
-
sql: column.sql,
|
|
363
|
-
});
|
|
364
|
-
}
|
|
365
|
-
for (const index of ddl.indexes) {
|
|
366
|
-
migrations.push({
|
|
367
|
-
id: `schema-index-v2:index:${index.name}`,
|
|
368
|
-
description: `Manifest Schema index ${index.name}`,
|
|
369
|
-
sql: index.sql,
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
return migrations;
|
|
374
|
-
}
|
|
375
|
-
const SCHEMA_INDEX_V2_PREFIX = "schema-index-v2:index:";
|
|
376
|
-
const LEGACY_UNIQUE_INDEX_PREFIX = "schema-unique-index:";
|
|
377
|
-
const SAFE_SCHEMA_INDEX_V2 = /^m2[uir]_[0-9a-f]+_[0-9a-f]+_[0-9a-f]+(?:__[0-9a-f]+_[0-9a-f]+)*$/;
|
|
378
|
-
const SAFE_LEGACY_UNIQUE_INDEX = /^uq_[a-z0-9_.-]+(?:__[a-z0-9_.-]+)+$/i;
|
|
379
|
-
/**
|
|
380
|
-
* Drop generated indexes no longer declared by the current manifests.
|
|
381
|
-
* Keep generated columns: SQLite cannot remove them safely across the
|
|
382
|
-
* D1 versions Mantle supports, and unused virtual columns are harmless.
|
|
383
|
-
*/
|
|
384
|
-
export async function reconcileSchemaIndexes(db, current, schemas) {
|
|
385
|
-
const desiredV2 = new Set(current
|
|
386
|
-
.map((migration) => migration.id)
|
|
387
|
-
.filter((id) => id.startsWith(SCHEMA_INDEX_V2_PREFIX)));
|
|
388
|
-
const legacyExpectations = legacyUniqueIndexExpectations(schemas);
|
|
389
|
-
const appliedV2 = await db
|
|
390
|
-
.prepare(`SELECT id FROM _migrations WHERE id LIKE 'schema-index-v2:index:%'`)
|
|
391
|
-
.all();
|
|
392
|
-
const appliedLegacy = await db
|
|
393
|
-
.prepare(`SELECT id FROM _migrations WHERE id LIKE 'schema-unique-index:%'`)
|
|
394
|
-
.all();
|
|
395
|
-
const desiredLegacy = await matchingLegacyUniqueIndexes(db, appliedLegacy, legacyExpectations);
|
|
396
|
-
await dropStaleIndexes(db, appliedV2, desiredV2, SCHEMA_INDEX_V2_PREFIX, SAFE_SCHEMA_INDEX_V2);
|
|
397
|
-
await dropStaleIndexes(db, appliedLegacy, desiredLegacy, LEGACY_UNIQUE_INDEX_PREFIX, SAFE_LEGACY_UNIQUE_INDEX);
|
|
398
|
-
}
|
|
399
|
-
function legacyUniqueIndexExpectations(schemas) {
|
|
400
|
-
const expectations = new Map();
|
|
401
|
-
for (const schema of schemas) {
|
|
402
|
-
for (const fields of schema.spec.uniqueIndexes ?? []) {
|
|
403
|
-
if (fields.length === 0)
|
|
404
|
-
continue;
|
|
405
|
-
const flattened = fields.map((field) => field.replace(/\./g, "_"));
|
|
406
|
-
const id = `${LEGACY_UNIQUE_INDEX_PREFIX}uq_${schema.metadata.name}__${flattened.join("__")}`;
|
|
407
|
-
const columns = flattened.map((field) => `${schema.metadata.name}__${field}`);
|
|
408
|
-
const ambiguous = schema.metadata.name.includes("__") ||
|
|
409
|
-
fields.some((field) => /[._]/.test(field));
|
|
410
|
-
const previous = expectations.get(id);
|
|
411
|
-
if (ambiguous ||
|
|
412
|
-
previous === null ||
|
|
413
|
-
(previous !== undefined && !sameStrings(previous, columns))) {
|
|
414
|
-
expectations.set(id, null);
|
|
415
|
-
}
|
|
416
|
-
else {
|
|
417
|
-
expectations.set(id, columns);
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
return expectations;
|
|
422
|
-
}
|
|
423
|
-
/**
|
|
424
|
-
* Alpha.59 flattened dots and joined tuples with `__`, so migration ids alone
|
|
425
|
-
* cannot prove that a legacy physical index still represents today's tuple.
|
|
426
|
-
* Retain only unambiguous declarations whose ordered physical columns match.
|
|
427
|
-
*/
|
|
428
|
-
async function matchingLegacyUniqueIndexes(db, applied, expectedById) {
|
|
429
|
-
const matching = new Set();
|
|
430
|
-
for (const { id } of applied) {
|
|
431
|
-
const expected = expectedById.get(id);
|
|
432
|
-
if (!expected)
|
|
433
|
-
continue;
|
|
434
|
-
const indexName = id.slice(LEGACY_UNIQUE_INDEX_PREFIX.length);
|
|
435
|
-
if (!SAFE_LEGACY_UNIQUE_INDEX.test(indexName))
|
|
436
|
-
continue;
|
|
437
|
-
const actual = await db
|
|
438
|
-
.prepare(`PRAGMA index_info("${indexName}")`)
|
|
439
|
-
.all();
|
|
440
|
-
const columns = [...actual]
|
|
441
|
-
.sort((a, b) => a.seqno - b.seqno)
|
|
442
|
-
.map(({ name }) => name);
|
|
443
|
-
if (sameStrings(columns, expected))
|
|
444
|
-
matching.add(id);
|
|
445
|
-
}
|
|
446
|
-
return matching;
|
|
447
|
-
}
|
|
448
|
-
function sameStrings(a, b) {
|
|
449
|
-
return a.length === b.length && a.every((value, index) => value === b[index]);
|
|
450
|
-
}
|
|
451
|
-
async function dropStaleIndexes(db, applied, desired, prefix, safeName) {
|
|
452
|
-
for (const { id } of applied) {
|
|
453
|
-
if (desired.has(id))
|
|
454
|
-
continue;
|
|
455
|
-
const indexName = id.slice(prefix.length);
|
|
456
|
-
if (!safeName.test(indexName)) {
|
|
457
|
-
throw new Error(`unsafe generated Schema-index identifier: ${indexName}`);
|
|
458
|
-
}
|
|
459
|
-
await db.batch([
|
|
460
|
-
db.prepare(`DROP INDEX IF EXISTS "${indexName}"`),
|
|
461
|
-
db.prepare(`DELETE FROM _migrations WHERE id = ?`).bind(id),
|
|
462
|
-
]);
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
279
|
//# sourceMappingURL=canonicalMigrations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonicalMigrations.js","sourceRoot":"","sources":["../../../src/infrastructure/boot/canonicalMigrations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"canonicalMigrations.js","sourceRoot":"","sources":["../../../src/infrastructure/boot/canonicalMigrations.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAyB;IACxD;QACE,EAAE,EAAE,WAAW;QACf,WAAW,EACT,oEAAoE;QACtE,4DAA4D;QAC5D,gEAAgE;QAChE,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuNJ;KACF;IACD;QACE,EAAE,EAAE,mBAAmB;QACvB,WAAW,EACT,mNAAmN;QACrN,GAAG,EAAE;;;;;;;;;;;;KAYJ;KACF;IACD;QACE,EAAE,EAAE,4BAA4B;QAChC,WAAW,EACT,6FAA6F;QAC/F,GAAG,EAAE;;;;;;;;;KASJ;KACF;IACD;QACE,EAAE,EAAE,4BAA4B;QAChC,WAAW,EAAE,gEAAgE;QAC7E,GAAG,EAAE;;;;;;;;;;;;;KAaJ;KACF;CACF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { CANONICAL_MIGRATIONS
|
|
1
|
+
export { CANONICAL_MIGRATIONS } from "./canonicalMigrations.js";
|
|
2
2
|
export { bootFingerprint, isBootCurrent, markBootCurrent } from "./bootState.js";
|
|
3
|
-
export { SqliteMigrationRunner } from "./SqliteMigrationRunner.js";
|
|
3
|
+
export { SqliteMigrationRunner, splitSqlStatements } from "./SqliteMigrationRunner.js";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/boot/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/boot/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { CANONICAL_MIGRATIONS
|
|
1
|
+
export { CANONICAL_MIGRATIONS } from "./canonicalMigrations.js";
|
|
2
2
|
export { bootFingerprint, isBootCurrent, markBootCurrent } from "./bootState.js";
|
|
3
|
-
export { SqliteMigrationRunner } from "./SqliteMigrationRunner.js";
|
|
3
|
+
export { SqliteMigrationRunner, splitSqlStatements } from "./SqliteMigrationRunner.js";
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/infrastructure/boot/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/infrastructure/boot/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -5,6 +5,9 @@ export declare const MANTLE_VIEW_ROUTE_PREFIX = "/api/views";
|
|
|
5
5
|
export interface MantleRequestHandlerOptions {
|
|
6
6
|
readonly plan: RuntimePlan;
|
|
7
7
|
readonly getRuntime: () => Promise<MantleRuntime>;
|
|
8
|
+
/** Disable when the host accepts credentials outside Cookie/Authorization. */
|
|
9
|
+
readonly allowSharedViewCache?: boolean;
|
|
10
|
+
readonly publicCacheTag?: string;
|
|
8
11
|
}
|
|
9
12
|
export type MantleRequestHandler = (request: Request, context?: HandlerContext) => Promise<Response | null>;
|
|
10
13
|
/** Map the portable public View/HTTP Trigger surface onto Web Requests. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createMantleRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/http/createMantleRequestHandler.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAG3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"createMantleRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/http/createMantleRequestHandler.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAG3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAS/E,eAAO,MAAM,wBAAwB,eAAe,CAAC;AAErD,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,OAAO,CAAC,aAAa,CAAC,CAAC;IAClD,8EAA8E;IAC9E,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IACxC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,MAAM,oBAAoB,GAAG,CACjC,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,cAAc,KACrB,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;AAE9B,2EAA2E;AAC3E,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,2BAA2B,GACnC,oBAAoB,CAiCtB"}
|
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
import { DiagnosticError, HTTP_STATUS_BY_CODE, VIEW_PARAMS_RESERVED, httpStatusFor, redactForWire, runtimeDiagnostic, } from "@aotter/mantle-spec";
|
|
2
2
|
import { evaluateAuthAll } from "../../domain/service/AuthPredicateEvaluator.js";
|
|
3
|
-
import {
|
|
3
|
+
import { compileRouteMatcher } from "../../domain/service/PathMatcher.js";
|
|
4
4
|
import { ViewParamCoercionError, coerceViewParams, } from "../../domain/service/ViewParamCoercer.js";
|
|
5
|
+
import { JsonBodyTooLargeError, readJsonBody } from "./readJsonBody.js";
|
|
5
6
|
const [PAGE_PARAM, SHOW_PARAM] = VIEW_PARAMS_RESERVED;
|
|
6
7
|
export const MANTLE_VIEW_ROUTE_PREFIX = "/api/views";
|
|
7
8
|
/** Map the portable public View/HTTP Trigger surface onto Web Requests. */
|
|
8
9
|
export function createMantleRequestHandler(options) {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
const routesByMethod = new Map();
|
|
11
|
+
for (const route of options.plan.httpRoutes) {
|
|
12
|
+
const routes = routesByMethod.get(route.method) ?? [];
|
|
13
|
+
routes.push(route);
|
|
14
|
+
routesByMethod.set(route.method, routes);
|
|
15
|
+
}
|
|
16
|
+
const triggers = new Map([...routesByMethod].map(([method, routes]) => [method, compileRouteMatcher(routes)]));
|
|
13
17
|
const views = new Map(Object.values(options.plan.views)
|
|
14
18
|
.filter(({ manifest }) => manifest.spec.surface === "public")
|
|
15
19
|
.map((view) => [`${MANTLE_VIEW_ROUTE_PREFIX}/${view.name}`, view]));
|
|
16
20
|
return async (request, context = { user: null, staff: null, env: {} }) => {
|
|
17
21
|
const url = new URL(request.url);
|
|
18
22
|
const view = request.method === "GET" ? views.get(url.pathname) : undefined;
|
|
19
|
-
const trigger = view ?
|
|
23
|
+
const trigger = view ? null : triggers.get(request.method)?.(url.pathname);
|
|
20
24
|
if (!view && !trigger)
|
|
21
25
|
return null;
|
|
22
26
|
try {
|
|
23
27
|
const runtime = await options.getRuntime();
|
|
24
28
|
if (view)
|
|
25
|
-
return handleView(request, runtime, view.name, view.manifest, context);
|
|
26
|
-
|
|
27
|
-
return handleTrigger(request, runtime, trigger.trigger, trigger.path, pathParams, context);
|
|
29
|
+
return handleView(request, runtime, view.name, view.manifest, context, options);
|
|
30
|
+
return handleTrigger(request, runtime, trigger.route.trigger, trigger.route.path, trigger.params, context);
|
|
28
31
|
}
|
|
29
32
|
catch (error) {
|
|
30
33
|
return errorResponse(error, `${request.method} ${url.pathname}`);
|
|
@@ -37,7 +40,15 @@ async function handleTrigger(request, runtime, trigger, triggerPath, pathParams,
|
|
|
37
40
|
try {
|
|
38
41
|
body = await readBody(request);
|
|
39
42
|
}
|
|
40
|
-
catch {
|
|
43
|
+
catch (error) {
|
|
44
|
+
if (error instanceof JsonBodyTooLargeError) {
|
|
45
|
+
return diagnosticResponse(runtimeDiagnostic({
|
|
46
|
+
code: "INPUT_VALIDATION_FAILED",
|
|
47
|
+
severity: "error",
|
|
48
|
+
path: `${pathPrefix}#/body`,
|
|
49
|
+
message: error.message,
|
|
50
|
+
}), 413);
|
|
51
|
+
}
|
|
41
52
|
return diagnosticResponse(runtimeDiagnostic({
|
|
42
53
|
code: "INPUT_VALIDATION_FAILED",
|
|
43
54
|
severity: "error",
|
|
@@ -56,7 +67,7 @@ async function handleTrigger(request, runtime, trigger, triggerPath, pathParams,
|
|
|
56
67
|
? Response.json({ ok: true, data: result.data })
|
|
57
68
|
: diagnosticResponse(result.diagnostic);
|
|
58
69
|
}
|
|
59
|
-
async function handleView(request, runtime, view, manifest, context) {
|
|
70
|
+
async function handleView(request, runtime, view, manifest, context, options) {
|
|
60
71
|
const pathPrefix = `GET ${MANTLE_VIEW_ROUTE_PREFIX}/${view}`;
|
|
61
72
|
const search = new URL(request.url).searchParams;
|
|
62
73
|
let params;
|
|
@@ -89,16 +100,26 @@ async function handleView(request, runtime, view, manifest, context) {
|
|
|
89
100
|
ctx: context,
|
|
90
101
|
pathPrefix,
|
|
91
102
|
});
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
103
|
+
if (!result.ok)
|
|
104
|
+
return diagnosticResponse(result.diagnostic);
|
|
105
|
+
const cache = manifest.spec.cache;
|
|
106
|
+
const shared = cache
|
|
107
|
+
&& options.allowSharedViewCache === true
|
|
108
|
+
&& request.headers.get("cookie") === null
|
|
109
|
+
&& request.headers.get("authorization") === null;
|
|
110
|
+
return Response.json({ ok: true, data: result.result }, shared ? {
|
|
111
|
+
headers: {
|
|
112
|
+
"cache-control": `public, max-age=0, s-maxage=${cache.sharedMaxAge}`,
|
|
113
|
+
...(options.publicCacheTag ? { "cache-tag": options.publicCacheTag } : {}),
|
|
114
|
+
},
|
|
115
|
+
} : undefined);
|
|
95
116
|
}
|
|
96
117
|
async function readBody(request) {
|
|
97
118
|
if (["GET", "DELETE", "HEAD"].includes(request.method))
|
|
98
119
|
return {};
|
|
99
120
|
if (!(request.headers.get("content-type") ?? "").includes("json"))
|
|
100
121
|
return {};
|
|
101
|
-
const value = await request
|
|
122
|
+
const value = await readJsonBody(request);
|
|
102
123
|
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
103
124
|
throw new TypeError("expected a JSON object");
|
|
104
125
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createMantleRequestHandler.js","sourceRoot":"","sources":["../../../src/infrastructure/http/createMantleRequestHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,aAAa,EACb,iBAAiB,GAElB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACjF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"createMantleRequestHandler.js","sourceRoot":"","sources":["../../../src/infrastructure/http/createMantleRequestHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,aAAa,EACb,iBAAiB,GAElB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE1E,OAAO,EACL,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,0CAA0C,CAAC;AAElD,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAExE,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,GAAG,oBAAoB,CAAC;AACtD,MAAM,CAAC,MAAM,wBAAwB,GAAG,YAAY,CAAC;AAerD,2EAA2E;AAC3E,MAAM,UAAU,0BAA0B,CACxC,OAAoC;IAEpC,MAAM,cAAc,GAAG,IAAI,GAAG,EAA+C,CAAC;IAC9E,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;QAC5C,MAAM,MAAM,GAAG,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACtD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnB,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;IACD,MAAM,QAAQ,GAAG,IAAI,GAAG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AAU,CAAC,CAAC;IAClF,OAAO,CAAC,KAAK,CAAC,gBAAgB,SAAS,mBAAmB,EAAE,KAAK,CAAC,CAAC;IACnE,OAAO,kBAAkB,CAAC,iBAAiB,CAAC;QAC1C,IAAI,EAAE,gBAAgB;QACtB,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,6BAA6B;KACvC,CAAC,EAAE,GAAG,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** JSON control-plane payloads; media bytes use the direct-upload transport. */
|
|
2
|
+
export declare const MAX_JSON_BODY_BYTES: number;
|
|
3
|
+
export declare class JsonBodyTooLargeError extends Error {
|
|
4
|
+
constructor();
|
|
5
|
+
}
|
|
6
|
+
/** Count actual bytes, including requests without a trustworthy Content-Length. */
|
|
7
|
+
export declare function readJsonBody(request: Request): Promise<unknown>;
|
|
8
|
+
//# sourceMappingURL=readJsonBody.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readJsonBody.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/http/readJsonBody.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,eAAO,MAAM,mBAAmB,QAAc,CAAC;AAE/C,qBAAa,qBAAsB,SAAQ,KAAK;;CAK/C;AAED,mFAAmF;AACnF,wBAAsB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAsBrE"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** JSON control-plane payloads; media bytes use the direct-upload transport. */
|
|
2
|
+
export const MAX_JSON_BODY_BYTES = 1024 * 1024;
|
|
3
|
+
export class JsonBodyTooLargeError extends Error {
|
|
4
|
+
constructor() {
|
|
5
|
+
super("JSON request body exceeds 1 MiB.");
|
|
6
|
+
this.name = "JsonBodyTooLargeError";
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
/** Count actual bytes, including requests without a trustworthy Content-Length. */
|
|
10
|
+
export async function readJsonBody(request) {
|
|
11
|
+
if (!request.body)
|
|
12
|
+
return JSON.parse("");
|
|
13
|
+
const reader = request.body.getReader();
|
|
14
|
+
const decoder = new TextDecoder();
|
|
15
|
+
let bytes = 0;
|
|
16
|
+
let text = "";
|
|
17
|
+
try {
|
|
18
|
+
for (;;) {
|
|
19
|
+
const { done, value } = await reader.read();
|
|
20
|
+
if (done)
|
|
21
|
+
break;
|
|
22
|
+
bytes += value.byteLength;
|
|
23
|
+
if (bytes > MAX_JSON_BODY_BYTES) {
|
|
24
|
+
// Do not wait for a remote producer (or a tee's other branch) to finish.
|
|
25
|
+
void reader.cancel().catch(() => { });
|
|
26
|
+
throw new JsonBodyTooLargeError();
|
|
27
|
+
}
|
|
28
|
+
text += decoder.decode(value, { stream: true });
|
|
29
|
+
}
|
|
30
|
+
return JSON.parse(text + decoder.decode());
|
|
31
|
+
}
|
|
32
|
+
finally {
|
|
33
|
+
reader.releaseLock();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=readJsonBody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readJsonBody.js","sourceRoot":"","sources":["../../../src/infrastructure/http/readJsonBody.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,GAAG,IAAI,CAAC;AAE/C,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC9C;QACE,KAAK,CAAC,kCAAkC,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,CAAC;CACF;AAED,mFAAmF;AACnF,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,OAAgB;IACjD,IAAI,CAAC,OAAO,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACzC,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;IACxC,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;IAClC,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,IAAI,GAAG,EAAE,CAAC;IACd,IAAI,CAAC;QACH,SAAS,CAAC;YACR,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;YAC5C,IAAI,IAAI;gBAAE,MAAM;YAChB,KAAK,IAAI,KAAK,CAAC,UAAU,CAAC;YAC1B,IAAI,KAAK,GAAG,mBAAmB,EAAE,CAAC;gBAChC,yEAAyE;gBACzE,KAAK,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;gBACrC,MAAM,IAAI,qBAAqB,EAAE,CAAC;YACpC,CAAC;YACD,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QAClD,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC7C,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,WAAW,EAAE,CAAC;IACvB,CAAC;AACH,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Diagnostic, type MediaPurposePolicy, type SchemaManifest, type SiteIcon } from "@aotter/mantle-spec";
|
|
2
2
|
import type { HandlerContext } from "../../domain/model/HandlerContext.js";
|
|
3
|
-
import { ArchiveUseCase, CreateDraftUseCase, DeleteEntryUseCase, GetEntryUseCase,
|
|
3
|
+
import { ArchiveUseCase, CreateDraftUseCase, DeleteEntryUseCase, GetEntryUseCase, RequestPublishUseCase, UnpublishUseCase, UpdateDraftUseCase } from "../../usecase/content/index.js";
|
|
4
4
|
import { CommitMediaUploadUseCase, CreateMediaUploadUseCase } from "../../usecase/media/index.js";
|
|
5
5
|
import { ExecuteViewUseCase } from "../../usecase/view/index.js";
|
|
6
|
-
import {
|
|
6
|
+
import type { RuntimeCallableCapability } from "../../domain/service/CallableCapabilityProjector.js";
|
|
7
7
|
import { type McpToolSurface } from "./McpToolCatalog.js";
|
|
8
8
|
export declare const MCP_PROTOCOL_VERSION = "2025-11-25";
|
|
9
9
|
export interface McpServerInfo {
|
|
@@ -22,7 +22,6 @@ export interface McpServerInfo {
|
|
|
22
22
|
* assembly root assembles these alongside everything else).
|
|
23
23
|
*/
|
|
24
24
|
export interface McpUseCases {
|
|
25
|
-
readonly listEntries: ListEntriesUseCase;
|
|
26
25
|
readonly getEntry: GetEntryUseCase;
|
|
27
26
|
readonly createDraft: CreateDraftUseCase;
|
|
28
27
|
readonly updateDraft: UpdateDraftUseCase;
|
|
@@ -31,11 +30,22 @@ export interface McpUseCases {
|
|
|
31
30
|
readonly archive: ArchiveUseCase;
|
|
32
31
|
readonly deleteEntry: DeleteEntryUseCase;
|
|
33
32
|
readonly executeView?: Pick<ExecuteViewUseCase, "execute">;
|
|
34
|
-
/** Optional.
|
|
35
|
-
*
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
/** Optional. Trigger-backed callable capabilities route through the
|
|
34
|
+
* runtime's shared Trigger invocation chokepoint. */
|
|
35
|
+
readonly invokeTrigger?: {
|
|
36
|
+
execute(request: {
|
|
37
|
+
readonly trigger: string;
|
|
38
|
+
readonly input: unknown;
|
|
39
|
+
readonly ctx: HandlerContext;
|
|
40
|
+
readonly pathPrefix?: string;
|
|
41
|
+
}): Promise<{
|
|
42
|
+
readonly ok: true;
|
|
43
|
+
readonly data: unknown;
|
|
44
|
+
} | {
|
|
45
|
+
readonly ok: false;
|
|
46
|
+
readonly diagnostic: Diagnostic;
|
|
47
|
+
}>;
|
|
48
|
+
};
|
|
39
49
|
/** Optional. When set, `create_media_upload` and
|
|
40
50
|
* `commit_media_upload` appear in the catalog and route here.
|
|
41
51
|
* `purposes` is the declared taxonomy (#272 shape — name +
|
|
@@ -60,21 +70,16 @@ export declare class McpJsonRpcDispatcher {
|
|
|
60
70
|
* collection name. */
|
|
61
71
|
private readonly schemaBySegment;
|
|
62
72
|
private readonly readOnlyCollections;
|
|
63
|
-
private readonly
|
|
64
|
-
/** tool-name → Procedure manifest, for MCP triggers (#281). */
|
|
65
|
-
private readonly procedureByToolName;
|
|
73
|
+
private readonly capabilityByToolName;
|
|
66
74
|
constructor(useCases: McpUseCases, schemas: ReadonlyArray<SchemaManifest>, options?: {
|
|
67
75
|
readonly surface?: McpToolSurface;
|
|
68
|
-
readonly
|
|
69
|
-
/** Procedures exposed on this MCP surface via
|
|
70
|
-
* `Trigger.source.kind: "mcp"` (#281). Adapter pre-filters
|
|
71
|
-
* by surface; dispatcher trusts the slice. */
|
|
72
|
-
readonly procedures?: ReadonlyArray<ProcedureManifest>;
|
|
76
|
+
readonly capabilities?: readonly RuntimeCallableCapability[];
|
|
73
77
|
readonly serverInfo?: McpServerInfo;
|
|
74
78
|
});
|
|
75
79
|
dispatch(req: Request, ctx: HandlerContext): Promise<Response>;
|
|
76
80
|
private handleToolCall;
|
|
77
81
|
private dispatchToolByName;
|
|
82
|
+
private assertStaffRole;
|
|
78
83
|
private assertEntryMutable;
|
|
79
84
|
}
|
|
80
85
|
//# sourceMappingURL=McpJsonRpcDispatcher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpJsonRpcDispatcher.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/mcp/McpJsonRpcDispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"McpJsonRpcDispatcher.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/mcp/McpJsonRpcDispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,QAAQ,EAEd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,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