@happyvertical/smrt-core 0.60.8 → 0.60.10
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 +36 -0
- package/agents/browser-entry.md +10 -0
- package/agents/change-feed.md +33 -0
- package/agents/object-runtime.md +8 -0
- package/agents/schema-paths.md +6 -0
- package/dist/browser.d.ts +2 -1
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +3 -2
- package/dist/byo-inference.d.ts +55 -0
- package/dist/byo-inference.d.ts.map +1 -0
- package/dist/byo-inference.js +113 -0
- package/dist/byo-inference.js.map +1 -0
- package/dist/cascade.d.ts +17 -3
- package/dist/cascade.d.ts.map +1 -1
- package/dist/cascade.js +30 -15
- package/dist/cascade.js.map +1 -1
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +8 -4
- package/dist/collection.js.map +1 -1
- package/dist/embedded-write-queue.d.ts +18 -7
- package/dist/embedded-write-queue.d.ts.map +1 -1
- package/dist/embedded-write-queue.js +40 -10
- package/dist/embedded-write-queue.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/manifest/static-manifest.d.ts.map +1 -1
- package/dist/manifest/static-manifest.js +25 -7
- package/dist/manifest/static-manifest.js.map +1 -1
- package/dist/manifest/store.js +1 -1
- package/dist/manifest/store.js.map +1 -1
- package/dist/manifest.json +39 -7
- package/dist/migrations/differ.d.ts +4 -0
- package/dist/migrations/differ.d.ts.map +1 -1
- package/dist/migrations/differ.js +25 -9
- package/dist/migrations/differ.js.map +1 -1
- package/dist/migrations/orchestrate.d.ts +1 -1
- package/dist/migrations/orchestrate.d.ts.map +1 -1
- package/dist/migrations/orchestrate.js +5 -14
- package/dist/migrations/orchestrate.js.map +1 -1
- package/dist/native-duckdb.d.ts.map +1 -1
- package/dist/native-duckdb.js +5 -1
- package/dist/native-duckdb.js.map +1 -1
- package/dist/object.d.ts +26 -0
- package/dist/object.d.ts.map +1 -1
- package/dist/object.js +215 -55
- package/dist/object.js.map +1 -1
- package/dist/schema/generator.d.ts.map +1 -1
- package/dist/schema/generator.js +8 -4
- package/dist/schema/generator.js.map +1 -1
- package/dist/scripts/browser-entry-evaluation.mjs +63 -8
- package/dist/scripts/browser-unbundled-dev.mjs +5 -2
- package/dist/scripts/fixtures/browser-pglite-cascade.ts +107 -0
- package/dist/scripts/fixtures/pglite-peer/package.json +9 -0
- package/dist/scripts/fixtures/pglite-peer/peer.js +1 -0
- package/dist/scripts/fixtures/pglite-peer/pnpm-lock.yaml +22 -0
- package/dist/scripts/fixtures/pglite-peer/pnpm-workspace.yaml +1 -0
- package/dist/smrt-knowledge.json +20 -11
- package/dist/smrt-knowledge.okf.md +181 -0
- package/dist/sync-device.d.ts +6 -0
- package/dist/sync-device.d.ts.map +1 -0
- package/dist/sync-device.js +18 -0
- package/dist/sync-device.js.map +1 -0
- package/dist/sync-tombstones.d.ts +30 -0
- package/dist/sync-tombstones.d.ts.map +1 -0
- package/dist/sync-tombstones.js +112 -0
- package/dist/sync-tombstones.js.map +1 -0
- package/dist/system/schema.d.ts +5 -1
- package/dist/system/schema.d.ts.map +1 -1
- package/dist/system/schema.js +21 -4
- package/dist/system/schema.js.map +1 -1
- package/package.json +16 -11
|
@@ -196,7 +196,7 @@ export declare function migrateSmrtSchemas(options: MigrateSmrtSchemasOptions):
|
|
|
196
196
|
* public entry point (`migrations/index.ts` re-exports names explicitly).
|
|
197
197
|
*
|
|
198
198
|
* @param diff - Schema diff to materialize.
|
|
199
|
-
* @param db - Database whose
|
|
199
|
+
* @param db - Database whose adapter selects the DDL strategy.
|
|
200
200
|
* @param engineHint - Explicit engine when `db.url` is empty or ambiguous.
|
|
201
201
|
* @returns Ordered, executable DDL statements.
|
|
202
202
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrate.d.ts","sourceRoot":"","sources":["../../src/migrations/orchestrate.ts"],"names":[],"mappings":"AAA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,OAAO,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,EACpD,EAAE,EAAE,iBAAiB,EACrB,UAAU,CAAC,EAAE,cAAc,GAC1B,MAAM,EAAE,CAsCV"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getDDLStrategy } from "../schema/ddl/index.js";
|
|
2
2
|
import { ObjectRegistry } from "../registry.js";
|
|
3
3
|
import { planForeignKeyCreation } from "../schema/foreign-key-planner.js";
|
|
4
|
-
import { generateSchemaDiff, getSQLFromChanges, hasActionableChanges } from "./differ.js";
|
|
4
|
+
import { generateSchemaDiff, getSQLFromChanges, hasActionableChanges, resolveMigrationEngine } from "./differ.js";
|
|
5
5
|
import { createMigrationDefinition, generateMigrationTimestamp } from "./generator.js";
|
|
6
6
|
import { MigrationTracker } from "./tracker.js";
|
|
7
7
|
//#region src/migrations/orchestrate.ts
|
|
@@ -92,7 +92,7 @@ async function migrateSmrtSchemas(options) {
|
|
|
92
92
|
};
|
|
93
93
|
const tracker = new MigrationTracker({
|
|
94
94
|
db: options.db,
|
|
95
|
-
engineHint: options.engineHint,
|
|
95
|
+
engineHint: resolveMigrationEngine(options.db, options.engineHint),
|
|
96
96
|
lockTimeout: options.lockTimeout,
|
|
97
97
|
statementTimeout: options.statementTimeout,
|
|
98
98
|
useConcurrentIndexes: options.useConcurrentIndexes ?? true
|
|
@@ -117,15 +117,6 @@ async function migrateSmrtSchemas(options) {
|
|
|
117
117
|
hasManualDrift: pending.hasManualDrift
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
|
-
/** Mirror of the `getDatabaseUrl` helper in class.ts — some adapters
|
|
121
|
-
* (JSON, certain in-memory wrappers) leave `db.url` undefined and expose
|
|
122
|
-
* the URL on `db.config?.url` instead. Detecting the engine from a raw
|
|
123
|
-
* `db.url` would throw or silently fall through to the sqlite default.
|
|
124
|
-
*/
|
|
125
|
-
function resolveDatabaseUrl(db) {
|
|
126
|
-
const dbWithConfig = db;
|
|
127
|
-
return db.url || dbWithConfig.config?.url || "";
|
|
128
|
-
}
|
|
129
120
|
/**
|
|
130
121
|
* Materialize the diff into the engine-correct SQL statements.
|
|
131
122
|
*
|
|
@@ -144,12 +135,12 @@ function resolveDatabaseUrl(db) {
|
|
|
144
135
|
* public entry point (`migrations/index.ts` re-exports names explicitly).
|
|
145
136
|
*
|
|
146
137
|
* @param diff - Schema diff to materialize.
|
|
147
|
-
* @param db - Database whose
|
|
138
|
+
* @param db - Database whose adapter selects the DDL strategy.
|
|
148
139
|
* @param engineHint - Explicit engine when `db.url` is empty or ambiguous.
|
|
149
140
|
* @returns Ordered, executable DDL statements.
|
|
150
141
|
*/
|
|
151
142
|
function collectStatementsFromDiff(diff, db, engineHint) {
|
|
152
|
-
const strategy = getDDLStrategy(
|
|
143
|
+
const strategy = getDDLStrategy(resolveMigrationEngine(db, engineHint));
|
|
153
144
|
const statements = [];
|
|
154
145
|
const tablePlan = planForeignKeyCreation(diff.added_tables, strategy.engine);
|
|
155
146
|
statements.push(...getSQLFromChanges(diff.changes.filter((change) => change.phase === "pre_foreign_key")));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrate.js","names":[],"sources":["../../src/migrations/orchestrate.ts"],"sourcesContent":["/**\n * High-level \"make my SMRT app's schema match its database\" orchestration.\n *\n * Wraps `ObjectRegistry.getAllSchemasAsDefinitions()` → `generateSchemaDiff`\n * → `MigrationTracker.applyAll`. Apps that just want to run pending\n * schema changes call `migrateSmrtSchemas({ db, packageName, version })`\n * and don't have to assemble the migration definition by hand.\n *\n * The migration name is timestamped, so re-running on an up-to-date\n * database is a no-op (the diff is empty, no statements are generated,\n * `applied: false` is returned).\n */\nimport type { DatabaseInterface } from '@happyvertical/sql';\nimport { ObjectRegistry } from '../registry.js';\nimport { detectEngine, getDDLStrategy } from '../schema/ddl/index.js';\nimport type { DatabaseEngine } from '../schema/ddl/types.js';\nimport { planForeignKeyCreation } from '../schema/foreign-key-planner.js';\nimport type { MigrationResult, SchemaChange } from '../schema/types.js';\nimport {\n generateSchemaDiff,\n getSQLFromChanges,\n hasActionableChanges,\n} from './differ.js';\nimport {\n createMigrationDefinition,\n generateMigrationTimestamp,\n} from './generator.js';\nimport { MigrationTracker } from './tracker.js';\n\nexport interface MigrateSmrtSchemasOptions {\n db: DatabaseInterface;\n /** Stored on the migration record so the audit log shows which app applied it. */\n packageName: string;\n /**\n * Stored on the migration record. Typically the app's package.json\n * version. Optional because most apps don't have a runtime-readable\n * version handy and would hardcode a stale string if forced to supply\n * one — `'unknown'` is honest. Pass an explicit value when you can\n * (e.g. `version: process.env.APP_VERSION`).\n */\n version?: string;\n /** Override the description on the synthetic migration definition. */\n description?: string;\n /** Override the migration name (default: `<timestamp>_smrt_schema_sync`). */\n name?: string;\n /** Forwarded to MigrationTracker — defaults to true for pg-safe runs. */\n postgresSafe?: boolean;\n /** Forwarded to MigrationTracker — defaults to true. */\n reconcile?: boolean;\n /** Forwarded to MigrationTracker — defaults to true for `CREATE INDEX CONCURRENTLY`. */\n useConcurrentIndexes?: boolean;\n /**\n * Forwarded to MigrationTracker (Postgres lock timeout, milliseconds).\n * Lets apps that customize tracker timeouts directly preserve their\n * tuning when going through the orchestrator. Falls back to the\n * tracker's default (30000ms) when omitted.\n */\n lockTimeout?: number;\n /**\n * Forwarded to MigrationTracker (Postgres statement timeout, ms). Falls\n * back to the tracker's default (60000ms) when omitted.\n */\n statementTimeout?: number;\n /**\n * Explicit engine hint forwarded to `detectEngine`, `SchemaComparer`, and\n * `MigrationTracker`. Useful when `db.url` doesn't unambiguously identify\n * the engine (e.g. the JSON adapter, which uses DuckDB internally and may\n * not be recognizable by URL alone). All three layers honor the same hint\n * so the generated DDL, drift comparison, and execution path stay\n * consistent — without it, an empty-URL connection could produce\n * Postgres-flavored DDL but run through the SQLite tracker path.\n *\n * Typed as `DatabaseEngine` so unsupported values (e.g. `'mysql'`) fail at\n * compile time rather than silently falling back to `'sqlite'` at runtime.\n */\n engineHint?: DatabaseEngine;\n /**\n * Confirm that historical PostgreSQL Date writers used UTC wall times before\n * reinterpreting legacy TIMESTAMP/TEXT/JSON columns as TIMESTAMPTZ.\n */\n postgresTimestampMigration?: { legacyTimezone: 'UTC' };\n /**\n * Store empty or whitespace-only text as NULL when converging a nullable\n * legacy `text` column to a typed column (#3226). See\n * `DiffOptions.emptyTextAsNull`.\n */\n emptyTextAsNull?: boolean;\n /** Explicitly allow relaxing live column constraints. */\n relaxColumns?: boolean;\n}\n\nexport interface MigrateSmrtSchemasResult {\n applied: boolean;\n results: MigrationResult[];\n statements: string[];\n schemaCount: number;\n /**\n * Schema changes the orchestrator detected but cannot apply automatically\n * (incompatible type mismatches, SQLite type upgrades that require table\n * recreation, etc.). Empty when the schema is fully reconciled. Inspect\n * this to surface a \"manual migration required\" warning in CLI output.\n */\n unactionableChanges: SchemaChange[];\n /**\n * Convenience: `unactionableChanges.length > 0`. Lets a caller write\n * `if (result.hasManualDrift) ...` without iterating the array first,\n * and makes the case visible to anyone scanning the result shape (the\n * full array is easy to gloss over when `applied: false`).\n */\n hasManualDrift: boolean;\n}\n\nexport interface PendingSchemaStatementsResult {\n diff: Awaited<ReturnType<typeof generateSchemaDiff>>;\n statements: string[];\n schemaCount: number;\n hasChanges: boolean;\n /**\n * Schema changes the differ detected but that have no executable SQL\n * (incompatible `type_mismatch` entries, or `type_upgrade` entries whose\n * only generated SQL is an advisory comment because the engine cannot\n * upgrade the column in place — e.g. SQLite type widening). Surfacing\n * these lets status commands distinguish \"no drift\" from \"drift the\n * orchestrator can't fix on its own.\"\n */\n unactionableChanges: SchemaChange[];\n /**\n * Convenience: `unactionableChanges.length > 0`. Mirrors the\n * `MigrateSmrtSchemasResult.hasManualDrift` shortcut.\n */\n hasManualDrift: boolean;\n}\n\n/**\n * Compute the SQL statements needed to bring `db` in sync with the\n * currently-registered SMRT object schemas. Pure inspection — no writes.\n *\n * Useful for status commands (\"how far behind is the schema?\") and as the\n * inner step of `migrateSmrtSchemas`.\n *\n * **Note on the returned `statements`:** these are the engine-correct DDL\n * statements as the differ + DDL strategy produce them, *prior to* any\n * Postgres-specific rewrites the `MigrationTracker` applies at execution\n * time (e.g. rewriting `CREATE INDEX` → `CREATE INDEX CONCURRENTLY` and\n * moving CONCURRENTLY statements outside the surrounding transaction).\n * The list is suitable for preview/status/\"what would change?\" use cases.\n * For the exact byte-for-byte SQL the tracker ran, inspect the\n * `MigrationResult`s from `migrateSmrtSchemas` or the tracker's own logs.\n */\nexport async function getPendingSchemaStatements(\n db: DatabaseInterface,\n options: {\n engineHint?: DatabaseEngine;\n postgresTimestampMigration?: { legacyTimezone: 'UTC' };\n emptyTextAsNull?: boolean;\n /** Explicitly allow relaxing live column constraints. */\n relaxColumns?: boolean;\n } = {},\n): Promise<PendingSchemaStatementsResult> {\n const schemas = ObjectRegistry.getAllSchemasAsDefinitions();\n // Forward engineHint into the diff itself so the SchemaComparer's\n // existing-table SQL (ALTER/index drift) uses the same DDL strategy\n // we use for newly-added tables — otherwise the two halves of the\n // statement list can land on different engines (split-brain) when\n // `db.url` is empty or ambiguous.\n const diff = await generateSchemaDiff(db, schemas, {\n engineHint: options.engineHint,\n postgresTimestampMigration: options.postgresTimestampMigration,\n emptyTextAsNull: options.emptyTextAsNull,\n relaxColumns: options.relaxColumns,\n });\n const statements = collectStatementsFromDiff(diff, db, options.engineHint);\n const unactionableChanges = collectUnactionableChanges(diff);\n return {\n diff,\n schemaCount: Object.keys(schemas).length,\n statements,\n hasChanges: hasActionableChanges(diff),\n unactionableChanges,\n hasManualDrift: unactionableChanges.length > 0,\n };\n}\n\n/**\n * Apply any pending schema changes from `ObjectRegistry` to `db`.\n *\n * Returns `applied: false` (with no error) if the database is already in\n * sync. Throws on the first migration failure with the underlying error\n * preserved (callers should let it propagate to the CLI).\n *\n * **Note on the returned `statements`:** mirrors `getPendingSchemaStatements`\n * — the list is the planned DDL, prior to Postgres-specific tracker rewrites\n * (CONCURRENTLY, transaction reordering). The actual executed SQL is\n * tracked in the returned `results`.\n *\n * **Note on `applied` semantics under `reconcile: true` (the default):**\n * the tracker may re-execute a migration that is already in `completed`\n * state when the checksum matches — that counts as `applied: true` in the\n * returned `MigrationResult`. So `result.applied === true` means \"the\n * tracker ran the migration\", not specifically \"the database changed for\n * the first time.\" Pass `reconcile: false` if you need to distinguish a\n * fresh apply from a reconcile-replay over an existing completed record.\n *\n * **Note on repeated failures:** the migration name defaults to a fresh\n * timestamp on every call, so a sequence of failed runs leaves one\n * `failed` row in `_smrt_schema_migrations` per attempt. Pass an explicit\n * `name` if you want to overwrite the same record across retries.\n *\n * **Note on `unactionableChanges`:** the differ can detect schema drift\n * the migration step can't auto-resolve — incompatible type mismatches,\n * SQLite type widening that needs table recreation, etc. Those changes\n * appear in `result.unactionableChanges` and are NOT applied (the\n * statements list is filtered to executable DDL only). When the diff\n * contains *only* unactionable changes, the function returns\n * `applied: false` with a populated `unactionableChanges` so callers can\n * surface a \"manual migration required\" signal. Without inspecting that\n * field, the result would look indistinguishable from \"already in sync.\"\n */\nexport async function migrateSmrtSchemas(\n options: MigrateSmrtSchemasOptions,\n): Promise<MigrateSmrtSchemasResult> {\n const pending = await getPendingSchemaStatements(options.db, {\n engineHint: options.engineHint,\n postgresTimestampMigration: options.postgresTimestampMigration,\n emptyTextAsNull: options.emptyTextAsNull,\n relaxColumns: options.relaxColumns,\n });\n if (!pending.hasChanges || pending.statements.length === 0) {\n return {\n applied: false,\n results: [],\n statements: [],\n schemaCount: pending.schemaCount,\n unactionableChanges: pending.unactionableChanges,\n hasManualDrift: pending.hasManualDrift,\n };\n }\n\n const tracker = new MigrationTracker({\n db: options.db,\n engineHint: options.engineHint,\n lockTimeout: options.lockTimeout,\n statementTimeout: options.statementTimeout,\n useConcurrentIndexes: options.useConcurrentIndexes ?? true,\n });\n const migration = createMigrationDefinition(\n options.name ?? `${generateMigrationTimestamp()}_smrt_schema_sync`,\n pending.statements,\n [],\n {\n description: options.description ?? 'Synchronize SMRT object schemas',\n packageName: options.packageName,\n version: options.version ?? 'unknown',\n },\n );\n\n const results = await tracker.applyAll([migration], {\n postgresSafe: options.postgresSafe ?? true,\n reconcile: options.reconcile ?? true,\n });\n\n const failed = results.find((result) => !result.success);\n if (failed) {\n throw failed.error instanceof Error\n ? failed.error\n : new Error(String(failed.error ?? `Migration ${failed.name} failed`));\n }\n\n const applied = results.some(\n (result) => result.applied !== false && result.skipped !== true,\n );\n\n return {\n applied,\n results,\n statements: pending.statements,\n schemaCount: pending.schemaCount,\n unactionableChanges: pending.unactionableChanges,\n hasManualDrift: pending.hasManualDrift,\n };\n}\n\n/** Mirror of the `getDatabaseUrl` helper in class.ts — some adapters\n * (JSON, certain in-memory wrappers) leave `db.url` undefined and expose\n * the URL on `db.config?.url` instead. Detecting the engine from a raw\n * `db.url` would throw or silently fall through to the sqlite default.\n */\nfunction resolveDatabaseUrl(db: DatabaseInterface): string {\n const dbWithConfig = db as DatabaseInterface & {\n config?: { url?: string };\n };\n return db.url || dbWithConfig.config?.url || '';\n}\n\n/**\n * Materialize the diff into the engine-correct SQL statements.\n *\n * For new tables we delegate to the engine's `DDLStrategy` so column types\n * (`REAL` → `DOUBLE PRECISION` on Postgres, `JSON` → `JSONB`, etc.),\n * partial-index `WHERE` clauses, and trigger syntax all match what the\n * SchemaComparer would expect on subsequent runs. Emitting the raw\n * abstract `SchemaDefinition.ddl` here would cause immediate type-drift\n * migrations on Postgres/DuckDB.\n *\n * Column/index/trigger changes for existing tables continue to come from\n * `getSQLFromDiff`, which is already engine-aware via the differ's per-\n * change `sqlStatements`.\n *\n * Exported for statement-ordering tests; it is not part of the package's\n * public entry point (`migrations/index.ts` re-exports names explicitly).\n *\n * @param diff - Schema diff to materialize.\n * @param db - Database whose URL selects the DDL strategy.\n * @param engineHint - Explicit engine when `db.url` is empty or ambiguous.\n * @returns Ordered, executable DDL statements.\n */\nexport function collectStatementsFromDiff(\n diff: Awaited<ReturnType<typeof generateSchemaDiff>>,\n db: DatabaseInterface,\n engineHint?: DatabaseEngine,\n): string[] {\n const strategy = getDDLStrategy(\n detectEngine(resolveDatabaseUrl(db), engineHint),\n );\n const statements: string[] = [];\n const tablePlan = planForeignKeyCreation(diff.added_tables, strategy.engine);\n // #2608: the pre-R11 uuid convergence has to precede *every* foreign-key\n // statement. `planForeignKeyCreation` only defers the constraints inside a\n // mutual cycle, so an acyclic new child table keeps its FK **inline in\n // CREATE TABLE** — a fresh `uuid` child pointing at a legacy `text` parent\n // would fail with SQLSTATE 42804 before the parent could be converted.\n // Conversions only ever rewrite columns that already exist, so they are\n // safe to run ahead of every CREATE TABLE in this batch.\n statements.push(\n ...getSQLFromChanges(\n diff.changes.filter((change) => change.phase === 'pre_foreign_key'),\n ),\n );\n for (const schema of tablePlan.schemas) {\n statements.push(strategy.generateCreateTable(schema));\n statements.push(...strategy.generateIndexes(schema));\n statements.push(...strategy.generateTriggers(schema));\n }\n statements.push(...tablePlan.deferredStatements);\n statements.push(\n ...getSQLFromChanges(\n diff.changes.filter((change) => change.phase !== 'pre_foreign_key'),\n ),\n );\n // Drop empty and comment-only entries. SQLite type-widening upgrades\n // surface as `-- SQLite: Type upgrade for X requires table recreation`\n // — passing those through to the tracker records a successful migration\n // without actually fixing the column, so the same drift re-appears on\n // every subsequent run. Those changes are surfaced separately via\n // `unactionableChanges` so callers can prompt for manual remediation.\n return statements.filter((statement) => {\n const trimmed = statement.trim();\n if (trimmed.length === 0) return false;\n return !isCommentOnlySql(trimmed);\n });\n}\n\n/**\n * True if `sql` contains no executable DDL — only line comments (`--`)\n * and/or block comments (`/* … */`). Used to discard advisory comments\n * the differ emits when a column upgrade can't be performed in place\n * (e.g. SQLite type widening). Defensive: strips block comments first so\n * a future differ that emits `/* type_upgrade: no-op */` doesn't slip\n * through.\n */\nfunction isCommentOnlySql(sql: string): boolean {\n // Strip /* ... */ block comments (non-greedy, spans newlines).\n const withoutBlockComments = sql.replace(/\\/\\*[\\s\\S]*?\\*\\//g, '');\n const lines = withoutBlockComments\n .split('\\n')\n .map((line) => line.trim())\n .filter((line) => line.length > 0);\n if (lines.length === 0) return sql.trim().length > 0;\n return lines.every((line) => line.startsWith('--'));\n}\n\n/**\n * True if `sql` is an advisory comment that says *nothing needs to happen* —\n * as opposed to one that says a human has to act.\n *\n * The differ emits both kinds. \"This SQLite column already stores JSON as\n * TEXT\" and \"#2370: this column is rebuilt together with its sibling\" are\n * no-ops; \"requires table recreation\" / \"blocked: …\" are real manual drift.\n * Treating the first kind as drift makes a fully auto-repairable migration\n * report `hasManualDrift: true`.\n *\n * Keep in sync with `classifyTypeUpgradeSql`'s `noop` arm in\n * `@happyvertical/smrt-cli` (`src/commands/db-migrate-actions.ts`), which\n * applies the same rule on the CLI side.\n */\nfunction isNoOpAdvisorySql(sql: string): boolean {\n const trimmed = sql.trim();\n return (\n /no change needed/i.test(trimmed) || /already stores .* as /i.test(trimmed)\n );\n}\n\n/**\n * Surface changes the differ produced but that the migrator cannot apply\n * automatically — `type_mismatch` entries (the differ explicitly gives up on\n * these), `type_upgrade`/`alter_column` entries whose generated SQL is\n * advisory-comment-only (a SQLite rebuild that would be unsafe, an in-place\n * constraint change SQLite cannot perform), and warning-level report-only\n * advisories (an orphan NOT NULL column that will break inserts, a required\n * column that could not be enforced, a stale unique constraint, a relaxation\n * the caller has not opted into). Info-level advisories (a harmless orphan\n * column, a stale default) and comments that mean \"already handled\" (the\n * no-op advisories a table rebuild leaves on covered siblings, #2370) are\n * deliberately excluded so `hasManualDrift` keeps meaning \"something needs\n * an operator\". Callers use this to distinguish \"schema is in sync\" from\n * \"schema is drifted but we can't fix it from here\".\n */\nfunction collectUnactionableChanges(\n diff: Awaited<ReturnType<typeof generateSchemaDiff>>,\n): SchemaChange[] {\n const unactionable: SchemaChange[] = [];\n for (const change of diff.changes) {\n if (change.type === 'type_mismatch') {\n unactionable.push(change);\n continue;\n }\n const statements = change.sqlStatements ?? (change.sql ? [change.sql] : []);\n if (statements.length === 0) {\n if (change.advisory?.severity === 'warning') {\n unactionable.push(change);\n }\n continue;\n }\n if (\n statements.every((stmt) => isCommentOnlySql(stmt.trim())) &&\n !statements.every((stmt) => isNoOpAdvisorySql(stmt))\n ) {\n unactionable.push(change);\n }\n }\n return unactionable;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqJA,eAAsB,2BACpB,IACA,UAMI,CAAC,GACmC;CACxC,MAAM,UAAU,eAAe,2BAA2B;CAM1D,MAAM,OAAO,MAAM,mBAAmB,IAAI,SAAS;EACjD,YAAY,QAAQ;EACpB,4BAA4B,QAAQ;EACpC,iBAAiB,QAAQ;EACzB,cAAc,QAAQ;CACxB,CAAC;CACD,MAAM,aAAa,0BAA0B,MAAM,IAAI,QAAQ,UAAU;CACzE,MAAM,sBAAsB,2BAA2B,IAAI;CAC3D,OAAO;EACL;EACA,aAAa,OAAO,KAAK,OAAO,CAAC,CAAC;EAClC;EACA,YAAY,qBAAqB,IAAI;EACrC;EACA,gBAAgB,oBAAoB,SAAS;CAC/C;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,eAAsB,mBACpB,SACmC;CACnC,MAAM,UAAU,MAAM,2BAA2B,QAAQ,IAAI;EAC3D,YAAY,QAAQ;EACpB,4BAA4B,QAAQ;EACpC,iBAAiB,QAAQ;EACzB,cAAc,QAAQ;CACxB,CAAC;CACD,IAAI,CAAC,QAAQ,cAAc,QAAQ,WAAW,WAAW,GACvD,OAAO;EACL,SAAS;EACT,SAAS,CAAC;EACV,YAAY,CAAC;EACb,aAAa,QAAQ;EACrB,qBAAqB,QAAQ;EAC7B,gBAAgB,QAAQ;CAC1B;CAGF,MAAM,UAAU,IAAI,iBAAiB;EACnC,IAAI,QAAQ;EACZ,YAAY,QAAQ;EACpB,aAAa,QAAQ;EACrB,kBAAkB,QAAQ;EAC1B,sBAAsB,QAAQ,wBAAwB;CACxD,CAAC;CACD,MAAM,YAAY,0BAChB,QAAQ,QAAQ,GAAG,2BAA2B,EAAE,oBAChD,QAAQ,YACR,CAAC,GACD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,iBAAiB,CACpE,CACF;CAOA,OAAO,WAAW,QAAQ,cAAc;EACtC,MAAM,UAAU,UAAU,KAAK;EAC/B,IAAI,QAAQ,WAAW,GAAG,OAAO;EACjC,OAAO,CAAC,iBAAiB,OAAO;CAClC,CAAC;AACH;;;;;;;;;AAUA,SAAS,iBAAiB,KAAsB;CAG9C,MAAM,QADuB,IAAI,QAAQ,qBAAqB,EAChD,CAAA,CACX,MAAM,IAAI,CAAC,CACX,KAAK,SAAS,KAAK,KAAK,CAAC,CAAC,CAC1B,QAAQ,SAAS,KAAK,SAAS,CAAC;CACnC,IAAI,MAAM,WAAW,GAAG,OAAO,IAAI,KAAK,CAAC,CAAC,SAAS;CACnD,OAAO,MAAM,OAAO,SAAS,KAAK,WAAW,IAAI,CAAC;AACpD;;;;;;;;;;;;;;;AAgBA,SAAS,kBAAkB,KAAsB;CAC/C,MAAM,UAAU,IAAI,KAAK;CACzB,OACE,oBAAoB,KAAK,OAAO,KAAK,yBAAyB,KAAK,OAAO;AAE9E;;;;;;;;;;;;;;;;AAiBA,SAAS,2BACP,MACgB;CAChB,MAAM,eAA+B,CAAC;CACtC,KAAK,MAAM,UAAU,KAAK,SAAS;EACjC,IAAI,OAAO,SAAS,iBAAiB;GACnC,aAAa,KAAK,MAAM;GACxB;EACF;EACA,MAAM,aAAa,OAAO,kBAAkB,OAAO,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;EACzE,IAAI,WAAW,WAAW,GAAG;GAC3B,IAAI,OAAO,UAAU,aAAa,WAChC,aAAa,KAAK,MAAM;GAE1B;EACF;EACA,IACE,WAAW,OAAO,SAAS,iBAAiB,KAAK,KAAK,CAAC,CAAC,KACxD,CAAC,WAAW,OAAO,SAAS,kBAAkB,IAAI,CAAC,GAEnD,aAAa,KAAK,MAAM;CAE5B;CACA,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"orchestrate.js","names":[],"sources":["../../src/migrations/orchestrate.ts"],"sourcesContent":["/**\n * High-level \"make my SMRT app's schema match its database\" orchestration.\n *\n * Wraps `ObjectRegistry.getAllSchemasAsDefinitions()` → `generateSchemaDiff`\n * → `MigrationTracker.applyAll`. Apps that just want to run pending\n * schema changes call `migrateSmrtSchemas({ db, packageName, version })`\n * and don't have to assemble the migration definition by hand.\n *\n * The migration name is timestamped, so re-running on an up-to-date\n * database is a no-op (the diff is empty, no statements are generated,\n * `applied: false` is returned).\n */\nimport type { DatabaseInterface } from '@happyvertical/sql';\nimport { ObjectRegistry } from '../registry.js';\nimport { getDDLStrategy } from '../schema/ddl/index.js';\nimport type { DatabaseEngine } from '../schema/ddl/types.js';\nimport { planForeignKeyCreation } from '../schema/foreign-key-planner.js';\nimport type { MigrationResult, SchemaChange } from '../schema/types.js';\nimport {\n generateSchemaDiff,\n getSQLFromChanges,\n hasActionableChanges,\n resolveMigrationEngine,\n} from './differ.js';\nimport {\n createMigrationDefinition,\n generateMigrationTimestamp,\n} from './generator.js';\nimport { MigrationTracker } from './tracker.js';\n\nexport interface MigrateSmrtSchemasOptions {\n db: DatabaseInterface;\n /** Stored on the migration record so the audit log shows which app applied it. */\n packageName: string;\n /**\n * Stored on the migration record. Typically the app's package.json\n * version. Optional because most apps don't have a runtime-readable\n * version handy and would hardcode a stale string if forced to supply\n * one — `'unknown'` is honest. Pass an explicit value when you can\n * (e.g. `version: process.env.APP_VERSION`).\n */\n version?: string;\n /** Override the description on the synthetic migration definition. */\n description?: string;\n /** Override the migration name (default: `<timestamp>_smrt_schema_sync`). */\n name?: string;\n /** Forwarded to MigrationTracker — defaults to true for pg-safe runs. */\n postgresSafe?: boolean;\n /** Forwarded to MigrationTracker — defaults to true. */\n reconcile?: boolean;\n /** Forwarded to MigrationTracker — defaults to true for `CREATE INDEX CONCURRENTLY`. */\n useConcurrentIndexes?: boolean;\n /**\n * Forwarded to MigrationTracker (Postgres lock timeout, milliseconds).\n * Lets apps that customize tracker timeouts directly preserve their\n * tuning when going through the orchestrator. Falls back to the\n * tracker's default (30000ms) when omitted.\n */\n lockTimeout?: number;\n /**\n * Forwarded to MigrationTracker (Postgres statement timeout, ms). Falls\n * back to the tracker's default (60000ms) when omitted.\n */\n statementTimeout?: number;\n /**\n * Explicit engine hint forwarded to `detectEngine`, `SchemaComparer`, and\n * `MigrationTracker`. Useful when `db.url` doesn't unambiguously identify\n * the engine (e.g. the JSON adapter, which uses DuckDB internally and may\n * not be recognizable by URL alone). All three layers honor the same hint\n * so the generated DDL, drift comparison, and execution path stay\n * consistent — without it, an empty-URL connection could produce\n * Postgres-flavored DDL but run through the SQLite tracker path.\n *\n * Typed as `DatabaseEngine` so unsupported values (e.g. `'mysql'`) fail at\n * compile time rather than silently falling back to `'sqlite'` at runtime.\n */\n engineHint?: DatabaseEngine;\n /**\n * Confirm that historical PostgreSQL Date writers used UTC wall times before\n * reinterpreting legacy TIMESTAMP/TEXT/JSON columns as TIMESTAMPTZ.\n */\n postgresTimestampMigration?: { legacyTimezone: 'UTC' };\n /**\n * Store empty or whitespace-only text as NULL when converging a nullable\n * legacy `text` column to a typed column (#3226). See\n * `DiffOptions.emptyTextAsNull`.\n */\n emptyTextAsNull?: boolean;\n /** Explicitly allow relaxing live column constraints. */\n relaxColumns?: boolean;\n}\n\nexport interface MigrateSmrtSchemasResult {\n applied: boolean;\n results: MigrationResult[];\n statements: string[];\n schemaCount: number;\n /**\n * Schema changes the orchestrator detected but cannot apply automatically\n * (incompatible type mismatches, SQLite type upgrades that require table\n * recreation, etc.). Empty when the schema is fully reconciled. Inspect\n * this to surface a \"manual migration required\" warning in CLI output.\n */\n unactionableChanges: SchemaChange[];\n /**\n * Convenience: `unactionableChanges.length > 0`. Lets a caller write\n * `if (result.hasManualDrift) ...` without iterating the array first,\n * and makes the case visible to anyone scanning the result shape (the\n * full array is easy to gloss over when `applied: false`).\n */\n hasManualDrift: boolean;\n}\n\nexport interface PendingSchemaStatementsResult {\n diff: Awaited<ReturnType<typeof generateSchemaDiff>>;\n statements: string[];\n schemaCount: number;\n hasChanges: boolean;\n /**\n * Schema changes the differ detected but that have no executable SQL\n * (incompatible `type_mismatch` entries, or `type_upgrade` entries whose\n * only generated SQL is an advisory comment because the engine cannot\n * upgrade the column in place — e.g. SQLite type widening). Surfacing\n * these lets status commands distinguish \"no drift\" from \"drift the\n * orchestrator can't fix on its own.\"\n */\n unactionableChanges: SchemaChange[];\n /**\n * Convenience: `unactionableChanges.length > 0`. Mirrors the\n * `MigrateSmrtSchemasResult.hasManualDrift` shortcut.\n */\n hasManualDrift: boolean;\n}\n\n/**\n * Compute the SQL statements needed to bring `db` in sync with the\n * currently-registered SMRT object schemas. Pure inspection — no writes.\n *\n * Useful for status commands (\"how far behind is the schema?\") and as the\n * inner step of `migrateSmrtSchemas`.\n *\n * **Note on the returned `statements`:** these are the engine-correct DDL\n * statements as the differ + DDL strategy produce them, *prior to* any\n * Postgres-specific rewrites the `MigrationTracker` applies at execution\n * time (e.g. rewriting `CREATE INDEX` → `CREATE INDEX CONCURRENTLY` and\n * moving CONCURRENTLY statements outside the surrounding transaction).\n * The list is suitable for preview/status/\"what would change?\" use cases.\n * For the exact byte-for-byte SQL the tracker ran, inspect the\n * `MigrationResult`s from `migrateSmrtSchemas` or the tracker's own logs.\n */\nexport async function getPendingSchemaStatements(\n db: DatabaseInterface,\n options: {\n engineHint?: DatabaseEngine;\n postgresTimestampMigration?: { legacyTimezone: 'UTC' };\n emptyTextAsNull?: boolean;\n /** Explicitly allow relaxing live column constraints. */\n relaxColumns?: boolean;\n } = {},\n): Promise<PendingSchemaStatementsResult> {\n const schemas = ObjectRegistry.getAllSchemasAsDefinitions();\n // Forward engineHint into the diff itself so the SchemaComparer's\n // existing-table SQL (ALTER/index drift) uses the same DDL strategy\n // we use for newly-added tables — otherwise the two halves of the\n // statement list can land on different engines (split-brain) when\n // `db.url` is empty or ambiguous.\n const diff = await generateSchemaDiff(db, schemas, {\n engineHint: options.engineHint,\n postgresTimestampMigration: options.postgresTimestampMigration,\n emptyTextAsNull: options.emptyTextAsNull,\n relaxColumns: options.relaxColumns,\n });\n const statements = collectStatementsFromDiff(diff, db, options.engineHint);\n const unactionableChanges = collectUnactionableChanges(diff);\n return {\n diff,\n schemaCount: Object.keys(schemas).length,\n statements,\n hasChanges: hasActionableChanges(diff),\n unactionableChanges,\n hasManualDrift: unactionableChanges.length > 0,\n };\n}\n\n/**\n * Apply any pending schema changes from `ObjectRegistry` to `db`.\n *\n * Returns `applied: false` (with no error) if the database is already in\n * sync. Throws on the first migration failure with the underlying error\n * preserved (callers should let it propagate to the CLI).\n *\n * **Note on the returned `statements`:** mirrors `getPendingSchemaStatements`\n * — the list is the planned DDL, prior to Postgres-specific tracker rewrites\n * (CONCURRENTLY, transaction reordering). The actual executed SQL is\n * tracked in the returned `results`.\n *\n * **Note on `applied` semantics under `reconcile: true` (the default):**\n * the tracker may re-execute a migration that is already in `completed`\n * state when the checksum matches — that counts as `applied: true` in the\n * returned `MigrationResult`. So `result.applied === true` means \"the\n * tracker ran the migration\", not specifically \"the database changed for\n * the first time.\" Pass `reconcile: false` if you need to distinguish a\n * fresh apply from a reconcile-replay over an existing completed record.\n *\n * **Note on repeated failures:** the migration name defaults to a fresh\n * timestamp on every call, so a sequence of failed runs leaves one\n * `failed` row in `_smrt_schema_migrations` per attempt. Pass an explicit\n * `name` if you want to overwrite the same record across retries.\n *\n * **Note on `unactionableChanges`:** the differ can detect schema drift\n * the migration step can't auto-resolve — incompatible type mismatches,\n * SQLite type widening that needs table recreation, etc. Those changes\n * appear in `result.unactionableChanges` and are NOT applied (the\n * statements list is filtered to executable DDL only). When the diff\n * contains *only* unactionable changes, the function returns\n * `applied: false` with a populated `unactionableChanges` so callers can\n * surface a \"manual migration required\" signal. Without inspecting that\n * field, the result would look indistinguishable from \"already in sync.\"\n */\nexport async function migrateSmrtSchemas(\n options: MigrateSmrtSchemasOptions,\n): Promise<MigrateSmrtSchemasResult> {\n const pending = await getPendingSchemaStatements(options.db, {\n engineHint: options.engineHint,\n postgresTimestampMigration: options.postgresTimestampMigration,\n emptyTextAsNull: options.emptyTextAsNull,\n relaxColumns: options.relaxColumns,\n });\n if (!pending.hasChanges || pending.statements.length === 0) {\n return {\n applied: false,\n results: [],\n statements: [],\n schemaCount: pending.schemaCount,\n unactionableChanges: pending.unactionableChanges,\n hasManualDrift: pending.hasManualDrift,\n };\n }\n\n const tracker = new MigrationTracker({\n db: options.db,\n engineHint: resolveMigrationEngine(options.db, options.engineHint),\n lockTimeout: options.lockTimeout,\n statementTimeout: options.statementTimeout,\n useConcurrentIndexes: options.useConcurrentIndexes ?? true,\n });\n const migration = createMigrationDefinition(\n options.name ?? `${generateMigrationTimestamp()}_smrt_schema_sync`,\n pending.statements,\n [],\n {\n description: options.description ?? 'Synchronize SMRT object schemas',\n packageName: options.packageName,\n version: options.version ?? 'unknown',\n },\n );\n\n const results = await tracker.applyAll([migration], {\n postgresSafe: options.postgresSafe ?? true,\n reconcile: options.reconcile ?? true,\n });\n\n const failed = results.find((result) => !result.success);\n if (failed) {\n throw failed.error instanceof Error\n ? failed.error\n : new Error(String(failed.error ?? `Migration ${failed.name} failed`));\n }\n\n const applied = results.some(\n (result) => result.applied !== false && result.skipped !== true,\n );\n\n return {\n applied,\n results,\n statements: pending.statements,\n schemaCount: pending.schemaCount,\n unactionableChanges: pending.unactionableChanges,\n hasManualDrift: pending.hasManualDrift,\n };\n}\n\n/**\n * Materialize the diff into the engine-correct SQL statements.\n *\n * For new tables we delegate to the engine's `DDLStrategy` so column types\n * (`REAL` → `DOUBLE PRECISION` on Postgres, `JSON` → `JSONB`, etc.),\n * partial-index `WHERE` clauses, and trigger syntax all match what the\n * SchemaComparer would expect on subsequent runs. Emitting the raw\n * abstract `SchemaDefinition.ddl` here would cause immediate type-drift\n * migrations on Postgres/DuckDB.\n *\n * Column/index/trigger changes for existing tables continue to come from\n * `getSQLFromDiff`, which is already engine-aware via the differ's per-\n * change `sqlStatements`.\n *\n * Exported for statement-ordering tests; it is not part of the package's\n * public entry point (`migrations/index.ts` re-exports names explicitly).\n *\n * @param diff - Schema diff to materialize.\n * @param db - Database whose adapter selects the DDL strategy.\n * @param engineHint - Explicit engine when `db.url` is empty or ambiguous.\n * @returns Ordered, executable DDL statements.\n */\nexport function collectStatementsFromDiff(\n diff: Awaited<ReturnType<typeof generateSchemaDiff>>,\n db: DatabaseInterface,\n engineHint?: DatabaseEngine,\n): string[] {\n const strategy = getDDLStrategy(resolveMigrationEngine(db, engineHint));\n const statements: string[] = [];\n const tablePlan = planForeignKeyCreation(diff.added_tables, strategy.engine);\n // #2608: the pre-R11 uuid convergence has to precede *every* foreign-key\n // statement. `planForeignKeyCreation` only defers the constraints inside a\n // mutual cycle, so an acyclic new child table keeps its FK **inline in\n // CREATE TABLE** — a fresh `uuid` child pointing at a legacy `text` parent\n // would fail with SQLSTATE 42804 before the parent could be converted.\n // Conversions only ever rewrite columns that already exist, so they are\n // safe to run ahead of every CREATE TABLE in this batch.\n statements.push(\n ...getSQLFromChanges(\n diff.changes.filter((change) => change.phase === 'pre_foreign_key'),\n ),\n );\n for (const schema of tablePlan.schemas) {\n statements.push(strategy.generateCreateTable(schema));\n statements.push(...strategy.generateIndexes(schema));\n statements.push(...strategy.generateTriggers(schema));\n }\n statements.push(...tablePlan.deferredStatements);\n statements.push(\n ...getSQLFromChanges(\n diff.changes.filter((change) => change.phase !== 'pre_foreign_key'),\n ),\n );\n // Drop empty and comment-only entries. SQLite type-widening upgrades\n // surface as `-- SQLite: Type upgrade for X requires table recreation`\n // — passing those through to the tracker records a successful migration\n // without actually fixing the column, so the same drift re-appears on\n // every subsequent run. Those changes are surfaced separately via\n // `unactionableChanges` so callers can prompt for manual remediation.\n return statements.filter((statement) => {\n const trimmed = statement.trim();\n if (trimmed.length === 0) return false;\n return !isCommentOnlySql(trimmed);\n });\n}\n\n/**\n * True if `sql` contains no executable DDL — only line comments (`--`)\n * and/or block comments (`/* … */`). Used to discard advisory comments\n * the differ emits when a column upgrade can't be performed in place\n * (e.g. SQLite type widening). Defensive: strips block comments first so\n * a future differ that emits `/* type_upgrade: no-op */` doesn't slip\n * through.\n */\nfunction isCommentOnlySql(sql: string): boolean {\n // Strip /* ... */ block comments (non-greedy, spans newlines).\n const withoutBlockComments = sql.replace(/\\/\\*[\\s\\S]*?\\*\\//g, '');\n const lines = withoutBlockComments\n .split('\\n')\n .map((line) => line.trim())\n .filter((line) => line.length > 0);\n if (lines.length === 0) return sql.trim().length > 0;\n return lines.every((line) => line.startsWith('--'));\n}\n\n/**\n * True if `sql` is an advisory comment that says *nothing needs to happen* —\n * as opposed to one that says a human has to act.\n *\n * The differ emits both kinds. \"This SQLite column already stores JSON as\n * TEXT\" and \"#2370: this column is rebuilt together with its sibling\" are\n * no-ops; \"requires table recreation\" / \"blocked: …\" are real manual drift.\n * Treating the first kind as drift makes a fully auto-repairable migration\n * report `hasManualDrift: true`.\n *\n * Keep in sync with `classifyTypeUpgradeSql`'s `noop` arm in\n * `@happyvertical/smrt-cli` (`src/commands/db-migrate-actions.ts`), which\n * applies the same rule on the CLI side.\n */\nfunction isNoOpAdvisorySql(sql: string): boolean {\n const trimmed = sql.trim();\n return (\n /no change needed/i.test(trimmed) || /already stores .* as /i.test(trimmed)\n );\n}\n\n/**\n * Surface changes the differ produced but that the migrator cannot apply\n * automatically — `type_mismatch` entries (the differ explicitly gives up on\n * these), `type_upgrade`/`alter_column` entries whose generated SQL is\n * advisory-comment-only (a SQLite rebuild that would be unsafe, an in-place\n * constraint change SQLite cannot perform), and warning-level report-only\n * advisories (an orphan NOT NULL column that will break inserts, a required\n * column that could not be enforced, a stale unique constraint, a relaxation\n * the caller has not opted into). Info-level advisories (a harmless orphan\n * column, a stale default) and comments that mean \"already handled\" (the\n * no-op advisories a table rebuild leaves on covered siblings, #2370) are\n * deliberately excluded so `hasManualDrift` keeps meaning \"something needs\n * an operator\". Callers use this to distinguish \"schema is in sync\" from\n * \"schema is drifted but we can't fix it from here\".\n */\nfunction collectUnactionableChanges(\n diff: Awaited<ReturnType<typeof generateSchemaDiff>>,\n): SchemaChange[] {\n const unactionable: SchemaChange[] = [];\n for (const change of diff.changes) {\n if (change.type === 'type_mismatch') {\n unactionable.push(change);\n continue;\n }\n const statements = change.sqlStatements ?? (change.sql ? [change.sql] : []);\n if (statements.length === 0) {\n if (change.advisory?.severity === 'warning') {\n unactionable.push(change);\n }\n continue;\n }\n if (\n statements.every((stmt) => isCommentOnlySql(stmt.trim())) &&\n !statements.every((stmt) => isNoOpAdvisorySql(stmt))\n ) {\n unactionable.push(change);\n }\n }\n return unactionable;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAsJA,eAAsB,2BACpB,IACA,UAMI,CAAC,GACmC;CACxC,MAAM,UAAU,eAAe,2BAA2B;CAM1D,MAAM,OAAO,MAAM,mBAAmB,IAAI,SAAS;EACjD,YAAY,QAAQ;EACpB,4BAA4B,QAAQ;EACpC,iBAAiB,QAAQ;EACzB,cAAc,QAAQ;CACxB,CAAC;CACD,MAAM,aAAa,0BAA0B,MAAM,IAAI,QAAQ,UAAU;CACzE,MAAM,sBAAsB,2BAA2B,IAAI;CAC3D,OAAO;EACL;EACA,aAAa,OAAO,KAAK,OAAO,CAAC,CAAC;EAClC;EACA,YAAY,qBAAqB,IAAI;EACrC;EACA,gBAAgB,oBAAoB,SAAS;CAC/C;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,eAAsB,mBACpB,SACmC;CACnC,MAAM,UAAU,MAAM,2BAA2B,QAAQ,IAAI;EAC3D,YAAY,QAAQ;EACpB,4BAA4B,QAAQ;EACpC,iBAAiB,QAAQ;EACzB,cAAc,QAAQ;CACxB,CAAC;CACD,IAAI,CAAC,QAAQ,cAAc,QAAQ,WAAW,WAAW,GACvD,OAAO;EACL,SAAS;EACT,SAAS,CAAC;EACV,YAAY,CAAC;EACb,aAAa,QAAQ;EACrB,qBAAqB,QAAQ;EAC7B,gBAAgB,QAAQ;CAC1B;CAGF,MAAM,UAAU,IAAI,iBAAiB;EACnC,IAAI,QAAQ;EACZ,YAAY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|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native-duckdb.d.ts","sourceRoot":"","sources":["../src/native-duckdb.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;
|
|
1
|
+
{"version":3,"file":"native-duckdb.d.ts","sourceRoot":"","sources":["../src/native-duckdb.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAqBH,mEAAmE;AACnE,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAQxD;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAU7E;AAED,gFAAgF;AAChF,wBAAgB,yBAAyB,CACvC,EAAE,EAAE,OAAO,EACX,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAKT"}
|
package/dist/native-duckdb.js
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* path; it is never treated as native by guesswork.
|
|
18
18
|
*/
|
|
19
19
|
var nativeClients = /* @__PURE__ */ new WeakSet();
|
|
20
|
+
var jsonClients = /* @__PURE__ */ new WeakSet();
|
|
20
21
|
function duckDbClientOf(db) {
|
|
21
22
|
const client = db?.client;
|
|
22
23
|
if (client === null || typeof client !== "object") return void 0;
|
|
@@ -25,7 +26,10 @@ function duckDbClientOf(db) {
|
|
|
25
26
|
/** Whether `db` carries a capability only the JSON adapter has. */
|
|
26
27
|
function isJsonAdapterHandle(db) {
|
|
27
28
|
const handle = db;
|
|
28
|
-
|
|
29
|
+
const client = duckDbClientOf(db);
|
|
30
|
+
const isJson = typeof handle?.inferSchemaFromJSON === "function" || typeof handle?.getTableLoadErrors === "function";
|
|
31
|
+
if (isJson && client) jsonClients.add(client);
|
|
32
|
+
return isJson || client !== void 0 && jsonClients.has(client);
|
|
29
33
|
}
|
|
30
34
|
/**
|
|
31
35
|
* Remember `db`'s client when `db` is positively a native DuckDB root: a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native-duckdb.js","names":[],"sources":["../src/native-duckdb.ts"],"sourcesContent":["/**\n * Positive identification of the NATIVE DuckDB adapter (#3737).\n *\n * The JSON adapter wraps the same `DuckDBConnection` class and the same SQL\n * dialect, but persists a table to `<table>.json` only from its own\n * insert/update/upsert/delete, so a raw write there is lost on the next\n * process. Only a root native handle can be told apart structurally: it\n * exposes `getTableSchema`, which the JSON adapter does not. A transaction\n * handle exposes neither marker (it carries the root's `client` and nothing\n * more), so it is recognized through its client once the root was noted.\n *\n * Roots are noted wherever core sees one before binding to a transaction:\n * `SmrtClass.initialize()`, `withDatabase()` (the handle being swapped out)\n * and `withEmbeddedWriteTransaction()`. A transaction handle whose root core\n * never saw stays unidentified, and its writers keep the adapter `upsert`\n * path; it is never treated as native by guesswork.\n */\n\nconst nativeClients = new WeakSet<object>();\n\ninterface AdapterHandle {\n client?: unknown;\n getTableSchema?: unknown;\n inferSchemaFromJSON?: unknown;\n getTableLoadErrors?: unknown;\n}\n\nfunction duckDbClientOf(db: unknown): object | undefined {\n const client = (db as AdapterHandle | null | undefined)?.client;\n if (client === null || typeof client !== 'object') return undefined;\n const name = (\n client as { constructor?: { name?: string } }\n ).constructor?.name?.toLowerCase();\n return name?.includes('duckdb') ? client : undefined;\n}\n\n/** Whether `db` carries a capability only the JSON adapter has. */\nexport function isJsonAdapterHandle(db: unknown): boolean {\n const handle = db as AdapterHandle | null | undefined;\n
|
|
1
|
+
{"version":3,"file":"native-duckdb.js","names":[],"sources":["../src/native-duckdb.ts"],"sourcesContent":["/**\n * Positive identification of the NATIVE DuckDB adapter (#3737).\n *\n * The JSON adapter wraps the same `DuckDBConnection` class and the same SQL\n * dialect, but persists a table to `<table>.json` only from its own\n * insert/update/upsert/delete, so a raw write there is lost on the next\n * process. Only a root native handle can be told apart structurally: it\n * exposes `getTableSchema`, which the JSON adapter does not. A transaction\n * handle exposes neither marker (it carries the root's `client` and nothing\n * more), so it is recognized through its client once the root was noted.\n *\n * Roots are noted wherever core sees one before binding to a transaction:\n * `SmrtClass.initialize()`, `withDatabase()` (the handle being swapped out)\n * and `withEmbeddedWriteTransaction()`. A transaction handle whose root core\n * never saw stays unidentified, and its writers keep the adapter `upsert`\n * path; it is never treated as native by guesswork.\n */\n\nconst nativeClients = new WeakSet<object>();\nconst jsonClients = new WeakSet<object>();\n\ninterface AdapterHandle {\n client?: unknown;\n getTableSchema?: unknown;\n inferSchemaFromJSON?: unknown;\n getTableLoadErrors?: unknown;\n}\n\nfunction duckDbClientOf(db: unknown): object | undefined {\n const client = (db as AdapterHandle | null | undefined)?.client;\n if (client === null || typeof client !== 'object') return undefined;\n const name = (\n client as { constructor?: { name?: string } }\n ).constructor?.name?.toLowerCase();\n return name?.includes('duckdb') ? client : undefined;\n}\n\n/** Whether `db` carries a capability only the JSON adapter has. */\nexport function isJsonAdapterHandle(db: unknown): boolean {\n const handle = db as AdapterHandle | null | undefined;\n const client = duckDbClientOf(db);\n const isJson =\n typeof handle?.inferSchemaFromJSON === 'function' ||\n typeof handle?.getTableLoadErrors === 'function';\n if (isJson && client) jsonClients.add(client);\n return isJson || (client !== undefined && jsonClients.has(client));\n}\n\n/**\n * Remember `db`'s client when `db` is positively a native DuckDB root: a\n * DuckDB client, no JSON-only capability, and the native structural marker or\n * an explicit `duckdb` engine hint. A `json` hint never registers.\n */\nexport function noteNativeDuckDbHandle(db: unknown, engineHint?: string): void {\n if (engineHint === 'json' || isJsonAdapterHandle(db)) return;\n const client = duckDbClientOf(db);\n if (!client) return;\n if (\n typeof (db as AdapterHandle).getTableSchema === 'function' ||\n engineHint === 'duckdb'\n ) {\n nativeClients.add(client);\n }\n}\n\n/** Whether `db` (a root or any of its transaction handles) is native DuckDB. */\nexport function isKnownNativeDuckDbHandle(\n db: unknown,\n engineHint?: string,\n): boolean {\n if (engineHint === 'json' || isJsonAdapterHandle(db)) return false;\n noteNativeDuckDbHandle(db, engineHint);\n const client = duckDbClientOf(db);\n return client !== undefined && nativeClients.has(client);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,IAAM,gCAAgB,IAAI,QAAgB;AAC1C,IAAM,8BAAc,IAAI,QAAgB;AASxC,SAAS,eAAe,IAAiC;CACvD,MAAM,SAAU,IAAyC;CACzD,IAAI,WAAW,QAAQ,OAAO,WAAW,UAAU,OAAO,KAAA;CAI1D,QAFE,OACA,aAAa,MAAM,YAAY,EAAA,EACpB,SAAS,QAAQ,IAAI,SAAS,KAAA;AAC7C;;AAGA,SAAgB,oBAAoB,IAAsB;CACxD,MAAM,SAAS;CACf,MAAM,SAAS,eAAe,EAAE;CAChC,MAAM,SACJ,OAAO,QAAQ,wBAAwB,cACvC,OAAO,QAAQ,uBAAuB;CACxC,IAAI,UAAU,QAAQ,YAAY,IAAI,MAAM;CAC5C,OAAO,UAAW,WAAW,KAAA,KAAa,YAAY,IAAI,MAAM;AAClE;;;;;;AAOA,SAAgB,uBAAuB,IAAa,YAA2B;CAC7E,IAAI,eAAe,UAAU,oBAAoB,EAAE,GAAG;CACtD,MAAM,SAAS,eAAe,EAAE;CAChC,IAAI,CAAC,QAAQ;CACb,IACE,OAAQ,GAAqB,mBAAmB,cAChD,eAAe,UAEf,cAAc,IAAI,MAAM;AAE5B;;AAGA,SAAgB,0BACd,IACA,YACS;CACT,IAAI,eAAe,UAAU,oBAAoB,EAAE,GAAG,OAAO;CAC7D,uBAAuB,IAAI,UAAU;CACrC,MAAM,SAAS,eAAe,EAAE;CAChC,OAAO,WAAW,KAAA,KAAa,cAAc,IAAI,MAAM;AACzD"}
|
package/dist/object.d.ts
CHANGED
|
@@ -5,6 +5,17 @@ import { type DatabaseErrorClassification } from "./db-errors.js";
|
|
|
5
5
|
import { type EvaluateOptions, type EvaluationResult } from "./decisions.js";
|
|
6
6
|
import type { GenerateEmbeddingsOptions } from "./embeddings/types.js";
|
|
7
7
|
import { type ToolCall, type ToolCallResult } from "./tools/tool-executor.js";
|
|
8
|
+
/** Per-row metadata for an explicitly tracked object. */
|
|
9
|
+
export interface SmrtSyncMetadata {
|
|
10
|
+
readonly originDeviceId: string;
|
|
11
|
+
readonly revision: number;
|
|
12
|
+
readonly tombstone: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** Revision supplied by a trusted sync caller. */
|
|
15
|
+
export interface SmrtSyncWrite {
|
|
16
|
+
originDeviceId: string;
|
|
17
|
+
revision: number;
|
|
18
|
+
}
|
|
8
19
|
/** Optional optimistic-concurrency guard for persisted-object saves. */
|
|
9
20
|
export interface SmrtSaveOptions {
|
|
10
21
|
/**
|
|
@@ -12,6 +23,9 @@ export interface SmrtSaveOptions {
|
|
|
12
23
|
* `RUNTIME_REVISION_CONFLICT` without writing the row.
|
|
13
24
|
*/
|
|
14
25
|
expectedUpdatedAt?: Date | string;
|
|
26
|
+
/** Opt this row into tracking with the configured local device. */
|
|
27
|
+
trackSync?: boolean;
|
|
28
|
+
sync?: SmrtSyncWrite;
|
|
15
29
|
}
|
|
16
30
|
/** Optional optimistic-concurrency guard for irreversible deletes. */
|
|
17
31
|
export interface SmrtDeleteOptions {
|
|
@@ -20,6 +34,8 @@ export interface SmrtDeleteOptions {
|
|
|
20
34
|
* `RUNTIME_REVISION_CONFLICT` before any durable cascade is committed.
|
|
21
35
|
*/
|
|
22
36
|
expectedUpdatedAt?: Date | string;
|
|
37
|
+
/** Apply a deletion revision from a trusted sync caller. */
|
|
38
|
+
sync?: SmrtSyncWrite;
|
|
23
39
|
}
|
|
24
40
|
/**
|
|
25
41
|
* Options for SmrtObject initialization
|
|
@@ -172,6 +188,7 @@ export declare class SmrtObject extends SmrtClass {
|
|
|
172
188
|
* (issue #1472).
|
|
173
189
|
*/
|
|
174
190
|
private _persisted;
|
|
191
|
+
private _explicitId;
|
|
175
192
|
/**
|
|
176
193
|
* When set (and the object is not yet persisted), `save()` performs a plain
|
|
177
194
|
* INSERT instead of an upsert, so ANY collision — primary key or natural
|
|
@@ -223,6 +240,13 @@ export declare class SmrtObject extends SmrtClass {
|
|
|
223
240
|
* Last update timestamp
|
|
224
241
|
*/
|
|
225
242
|
updated_at: Date | null | undefined;
|
|
243
|
+
private _syncMetadata;
|
|
244
|
+
/** Sync state read from or committed to the backing row. */
|
|
245
|
+
get syncMetadata(): SmrtSyncMetadata | null;
|
|
246
|
+
/** @internal Read only from a physical row, never from model input or STI JSON. */
|
|
247
|
+
hydrateSyncMetadata(row: Record<string, unknown>): void;
|
|
248
|
+
private normalizeSyncRowId;
|
|
249
|
+
private nextSyncMetadata;
|
|
226
250
|
/**
|
|
227
251
|
* Creates a new SmrtObject instance
|
|
228
252
|
*
|
|
@@ -893,6 +917,7 @@ export declare class SmrtObject extends SmrtClass {
|
|
|
893
917
|
* (plain INSERT) or `'upsert'` (natural-key upsert, identity adopted).
|
|
894
918
|
*/
|
|
895
919
|
private writeNaturalKeyRow;
|
|
920
|
+
private adoptNaturalKeyRow;
|
|
896
921
|
private scopePartialConflictFilter;
|
|
897
922
|
/**
|
|
898
923
|
* Refuse a natural-key collision with a row owned by someone else. Every
|
|
@@ -900,6 +925,7 @@ export declare class SmrtObject extends SmrtClass {
|
|
|
900
925
|
* unset counts as NULL (a global save never adopts a tenant's row).
|
|
901
926
|
*/
|
|
902
927
|
private assertSameNaturalKeyOwner;
|
|
928
|
+
private trackedIdentityWriteError;
|
|
903
929
|
/**
|
|
904
930
|
* PostgreSQL: `INSERT … ON CONFLICT (conflict) DO NOTHING RETURNING id`.
|
|
905
931
|
* Values are serialized exactly as the SDK's insert does (undefined
|
package/dist/object.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../src/object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAYzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAS,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAS,CAAC;AAOpC,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