@happyvertical/smrt-education 0.57.39 → 0.57.40
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/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +1 -1
- package/dist/smrt-knowledge.json +3 -3
- package/package.json +8 -8
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["links","node","record"],"sources":["../src/__smrt-register__.ts","../src/catalog-capability.ts","../src/catalog-policy.ts","../src/catalog-acquisition-service.ts","../src/catalog-preview.ts","../src/catalog-models.ts","../src/catalog-collections.ts","../src/catalog-database-sync-store.ts","../src/catalog-materialization-service.ts","../src/catalog-read-service.ts","../src/catalog-sync-service.ts","../src/course-source.ts","../src/sources/illustrative-mathematics-parser.ts","../src/sources/oer-commons-rss-parser.ts","../src/hearth-catalog-providers.ts","../src/hearth-easy-peasy-grade4.ts","../src/recipes.ts","../src/sources/easy-peasy-parser.ts","../src/source-import-service.ts","../src/sources/google-drive-adapter.ts","../src/sources/public-illustrative-mathematics-parser.ts","../src/sources/public-illustrative-mathematics-adapter.ts"],"sourcesContent":["// Generated by @happyvertical/smrt-core smrtPlugin at library build time.\n// The package manifest is inlined so self-registration cannot miss when a\n// downstream bundler relocates this module away from dist/manifest.json\n// (https://github.com/happyvertical/smrt/issues/1506,\n// https://github.com/happyvertical/smrt/issues/1507).\nimport { ObjectRegistry } from '@happyvertical/smrt-core';\n\nObjectRegistry.registerPackageManifest(JSON.parse(\"{\\\"version\\\":\\\"1.0.0\\\",\\\"timestamp\\\":0,\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"packageVersion\\\":\\\"0.57.39\\\",\\\"objects\\\":{\\\"@happyvertical/smrt-education:CatalogProviderCollection\\\":{\\\"name\\\":\\\"catalogprovidercollection\\\",\\\"className\\\":\\\"CatalogProviderCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CatalogProviderCollection\\\",\\\"collection\\\":\\\"catalogproviders\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog-collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"CatalogProvider\\\",\\\"exportName\\\":\\\"CatalogProviderCollection\\\",\\\"collectionExportName\\\":\\\"CatalogProviderCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"catalog_providers\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"catalog_providers\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"provider_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"name\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"active\\\\\\\" BOOLEAN NOT NULL DEFAULT TRUE\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"provider_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"active\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":true}},\\\"indexes\\\":[{\\\"name\\\":\\\"catalog_providers_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"catalog_providers_created_at_idx\\\",\\\"columns\\\":[\\\"created_at\\\"]}],\\\"version\\\":\\\"f35557a4\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CatalogResourceCollection\\\":{\\\"name\\\":\\\"catalogresourcecollection\\\",\\\"className\\\":\\\"CatalogResourceCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CatalogResourceCollection\\\",\\\"collection\\\":\\\"catalogresources\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog-collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"CatalogResource\\\",\\\"exportName\\\":\\\"CatalogResourceCollection\\\",\\\"collectionExportName\\\":\\\"CatalogResourceCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"catalog_resources\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"catalog_resources\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"provider_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"stable_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"revision\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"canonical_url\\\\\\\" TEXT,\\\\n \\\\\\\"title\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"supplied_description\\\\\\\" TEXT,\\\\n \\\\\\\"author\\\\\\\" TEXT,\\\\n \\\\\\\"subjects\\\\\\\" TEXT,\\\\n \\\\\\\"grades\\\\\\\" TEXT,\\\\n \\\\\\\"language\\\\\\\" TEXT,\\\\n \\\\\\\"resource_type\\\\\\\" TEXT,\\\\n \\\\\\\"parent_stable_id\\\\\\\" TEXT,\\\\n \\\\\\\"available_formats\\\\\\\" TEXT,\\\\n \\\\\\\"representation\\\\\\\" TEXT,\\\\n \\\\\\\"preview\\\\\\\" TEXT,\\\\n \\\\\\\"license_evidence\\\\\\\" TEXT,\\\\n \\\\\\\"license_state\\\\\\\" TEXT DEFAULT 'unknown',\\\\n \\\\\\\"visibility\\\\\\\" TEXT DEFAULT 'catalog',\\\\n \\\\\\\"last_seen_run_id\\\\\\\" TEXT,\\\\n \\\\\\\"withdrawn_at\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"provider_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"stable_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"revision\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"canonical_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"supplied_description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"author\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"subjects\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"grades\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"language\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"resource_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"parent_stable_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"available_formats\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"representation\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"preview\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"license_evidence\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"license_state\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"unknown\\\"},\\\"visibility\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"catalog\\\"},\\\"last_seen_run_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"withdrawn_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"catalog_resources_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"catalog_resources_created_at_idx\\\",\\\"columns\\\":[\\\"created_at\\\"]}],\\\"version\\\":\\\"6ea66f0d\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CatalogSyncStateCollection\\\":{\\\"name\\\":\\\"catalogsyncstatecollection\\\",\\\"className\\\":\\\"CatalogSyncStateCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CatalogSyncStateCollection\\\",\\\"collection\\\":\\\"catalogsyncstates\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog-collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"CatalogSyncState\\\",\\\"exportName\\\":\\\"CatalogSyncStateCollection\\\",\\\"collectionExportName\\\":\\\"CatalogSyncStateCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"catalog_sync_states\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"catalog_sync_states\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"provider_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"cursor\\\\\\\" TEXT,\\\\n \\\\\\\"run_id\\\\\\\" TEXT,\\\\n \\\\\\\"complete\\\\\\\" BOOLEAN NOT NULL DEFAULT FALSE,\\\\n \\\\\\\"paused\\\\\\\" BOOLEAN NOT NULL DEFAULT FALSE,\\\\n \\\\\\\"pause_reason\\\\\\\" TEXT,\\\\n \\\\\\\"imported_count\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"failures\\\\\\\" TEXT,\\\\n \\\\\\\"last_successful_at\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"provider_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"cursor\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"run_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"complete\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":false},\\\"paused\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":false},\\\"pause_reason\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"imported_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"failures\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"last_successful_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"catalog_sync_states_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"catalog_sync_states_created_at_idx\\\",\\\"columns\\\":[\\\"created_at\\\"]}],\\\"version\\\":\\\"52dc3ee1\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CatalogSelectionCollection\\\":{\\\"name\\\":\\\"catalogselectioncollection\\\",\\\"className\\\":\\\"CatalogSelectionCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CatalogSelectionCollection\\\",\\\"collection\\\":\\\"catalogselections\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog-collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"CatalogSelection\\\",\\\"exportName\\\":\\\"CatalogSelectionCollection\\\",\\\"collectionExportName\\\":\\\"CatalogSelectionCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"catalog_selections\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"catalog_selections\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"resource_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"selected_by_user_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"selected_revision\\\\\\\" TEXT NOT NULL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"resource_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"catalog_resources\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"selected_by_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"selected_revision\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"catalog_selections_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"catalog_selections_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"catalog_selections_resource_id_idx\\\",\\\"columns\\\":[\\\"resource_id\\\"]}],\\\"version\\\":\\\"c6b02eb9\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CatalogAcquisitionCollection\\\":{\\\"name\\\":\\\"catalogacquisitioncollection\\\",\\\"className\\\":\\\"CatalogAcquisitionCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CatalogAcquisitionCollection\\\",\\\"collection\\\":\\\"catalogacquisitions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog-collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"CatalogAcquisition\\\",\\\"exportName\\\":\\\"CatalogAcquisitionCollection\\\",\\\"collectionExportName\\\":\\\"CatalogAcquisitionCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"catalog_acquisitions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"catalog_acquisitions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"resource_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"selection_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"revision\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"format\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"sha256\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"attribution\\\\\\\" TEXT,\\\\n \\\\\\\"notices\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"resource_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"catalog_resources\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"selection_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"catalog_selections\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"revision\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"format\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sha256\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"attribution\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"notices\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"catalog_acquisitions_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"catalog_acquisitions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"catalog_acquisitions_resource_id_idx\\\",\\\"columns\\\":[\\\"resource_id\\\"]},{\\\"name\\\":\\\"catalog_acquisitions_selection_id_idx\\\",\\\"columns\\\":[\\\"selection_id\\\"]}],\\\"version\\\":\\\"ee9c5add\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CatalogProvider\\\":{\\\"name\\\":\\\"catalogprovider\\\",\\\"className\\\":\\\"CatalogProvider\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CatalogProvider\\\",\\\"collection\\\":\\\"catalogproviders\\\",\\\"description\\\":\\\"Globally visible provider registration. Hosts configure adapters and credentials out of band.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"providerId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"name\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"active\\\":{\\\"type\\\":\\\"boolean\\\",\\\"required\\\":true,\\\"default\\\":true}},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"CatalogProvider\\\",\\\"collectionExportName\\\":\\\"CatalogProviderCollection\\\",\\\"displayLabelField\\\":\\\"name\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"providerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"name\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"active\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"boolean\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"catalog_providers\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"catalog_providers\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"provider_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"name\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"active\\\\\\\" BOOLEAN NOT NULL DEFAULT TRUE\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"provider_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"active\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":true}},\\\"indexes\\\":[{\\\"name\\\":\\\"catalog_providers_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"catalog_providers_created_at_idx\\\",\\\"columns\\\":[\\\"created_at\\\"]}],\\\"version\\\":\\\"f35557a4\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CatalogResource\\\":{\\\"name\\\":\\\"catalogresource\\\",\\\"className\\\":\\\"CatalogResource\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CatalogResource\\\",\\\"collection\\\":\\\"catalogresources\\\",\\\"description\\\":\\\"A provider-native record. Rows are intentionally not merged across providers.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"providerId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"stableId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"revision\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"canonicalUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"suppliedDescription\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"author\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"subjects\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"grades\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"language\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"resourceType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"parentStableId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"availableFormats\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"representation\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"preview\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"licenseEvidence\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"licenseState\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"unknown\\\",\\\"enum\\\":[\\\"verified\\\",\\\"unknown\\\",\\\"conflicting\\\",\\\"restricted\\\"]},\\\"visibility\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"catalog\\\",\\\"enum\\\":[\\\"catalog\\\",\\\"teacher\\\"]},\\\"lastSeenRunId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"withdrawnAt\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"getPreview\\\":{\\\"name\\\":\\\"getPreview\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"CatalogPreview | undefined\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setPreview\\\":{\\\"name\\\":\\\"setPreview\\\",\\\"async\\\":false,\\\"parameters\\\":[{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"CatalogPreview | undefined\\\",\\\"optional\\\":false,\\\"unionBranches\\\":[{\\\"type\\\":\\\"CatalogPreview\\\"},{\\\"type\\\":\\\"undefined\\\"}]}],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getRepresentation\\\":{\\\"name\\\":\\\"getRepresentation\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"CatalogResourceRepresentation | undefined\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setRepresentation\\\":{\\\"name\\\":\\\"setRepresentation\\\",\\\"async\\\":false,\\\"parameters\\\":[{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"CatalogResourceRepresentation | undefined\\\",\\\"optional\\\":false,\\\"unionBranches\\\":[{\\\"type\\\":\\\"CatalogResourceRepresentation\\\"},{\\\"type\\\":\\\"undefined\\\"}]}],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"CatalogResource\\\",\\\"collectionExportName\\\":\\\"CatalogResourceCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"providerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"stableId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"revision\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"title\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"catalog_resources\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"catalog_resources\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"provider_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"stable_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"revision\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"canonical_url\\\\\\\" TEXT,\\\\n \\\\\\\"title\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"supplied_description\\\\\\\" TEXT,\\\\n \\\\\\\"author\\\\\\\" TEXT,\\\\n \\\\\\\"subjects\\\\\\\" TEXT,\\\\n \\\\\\\"grades\\\\\\\" TEXT,\\\\n \\\\\\\"language\\\\\\\" TEXT,\\\\n \\\\\\\"resource_type\\\\\\\" TEXT,\\\\n \\\\\\\"parent_stable_id\\\\\\\" TEXT,\\\\n \\\\\\\"available_formats\\\\\\\" TEXT,\\\\n \\\\\\\"representation\\\\\\\" TEXT,\\\\n \\\\\\\"preview\\\\\\\" TEXT,\\\\n \\\\\\\"license_evidence\\\\\\\" TEXT,\\\\n \\\\\\\"license_state\\\\\\\" TEXT DEFAULT 'unknown',\\\\n \\\\\\\"visibility\\\\\\\" TEXT DEFAULT 'catalog',\\\\n \\\\\\\"last_seen_run_id\\\\\\\" TEXT,\\\\n \\\\\\\"withdrawn_at\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"provider_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"stable_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"revision\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"canonical_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"supplied_description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"author\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"subjects\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"grades\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"language\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"resource_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"parent_stable_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"available_formats\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"representation\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"preview\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"license_evidence\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"license_state\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"unknown\\\"},\\\"visibility\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"catalog\\\"},\\\"last_seen_run_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"withdrawn_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"catalog_resources_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"catalog_resources_created_at_idx\\\",\\\"columns\\\":[\\\"created_at\\\"]}],\\\"version\\\":\\\"6ea66f0d\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CatalogSyncState\\\":{\\\"name\\\":\\\"catalogsyncstate\\\",\\\"className\\\":\\\"CatalogSyncState\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CatalogSyncState\\\",\\\"collection\\\":\\\"catalogsyncstates\\\",\\\"description\\\":\\\"Durable per-provider enumeration state. A failed or partial feed is never complete.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"providerId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"cursor\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"runId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"complete\\\":{\\\"type\\\":\\\"boolean\\\",\\\"required\\\":true,\\\"default\\\":false},\\\"paused\\\":{\\\"type\\\":\\\"boolean\\\",\\\"required\\\":true,\\\"default\\\":false},\\\"pauseReason\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"importedCount\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"failures\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"lastSuccessfulAt\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"CatalogSyncState\\\",\\\"collectionExportName\\\":\\\"CatalogSyncStateCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"providerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"complete\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"boolean\\\"},{\\\"field\\\":\\\"paused\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"boolean\\\"},{\\\"field\\\":\\\"importedCount\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"catalog_sync_states\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"catalog_sync_states\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"provider_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"cursor\\\\\\\" TEXT,\\\\n \\\\\\\"run_id\\\\\\\" TEXT,\\\\n \\\\\\\"complete\\\\\\\" BOOLEAN NOT NULL DEFAULT FALSE,\\\\n \\\\\\\"paused\\\\\\\" BOOLEAN NOT NULL DEFAULT FALSE,\\\\n \\\\\\\"pause_reason\\\\\\\" TEXT,\\\\n \\\\\\\"imported_count\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"failures\\\\\\\" TEXT,\\\\n \\\\\\\"last_successful_at\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"provider_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"cursor\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"run_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"complete\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":false},\\\"paused\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":false},\\\"pause_reason\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"imported_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"failures\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"last_successful_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"catalog_sync_states_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"catalog_sync_states_created_at_idx\\\",\\\"columns\\\":[\\\"created_at\\\"]}],\\\"version\\\":\\\"52dc3ee1\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CatalogSelection\\\":{\\\"name\\\":\\\"catalogselection\\\",\\\"className\\\":\\\"CatalogSelection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CatalogSelection\\\",\\\"collection\\\":\\\"catalogselections\\\",\\\"description\\\":\\\"Tenant-owned intent to use a metadata record, distinct from acquiring bytes.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"resourceId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"CatalogResource\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"selectedByUserId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"selectedRevision\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}}},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"CatalogSelection\\\",\\\"collectionExportName\\\":\\\"CatalogSelectionCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"resourceId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"selectedByUserId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"selectedRevision\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"catalog_selections\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"catalog_selections\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"resource_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"selected_by_user_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"selected_revision\\\\\\\" TEXT NOT NULL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"resource_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"catalog_resources\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"selected_by_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"selected_revision\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"catalog_selections_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"catalog_selections_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"catalog_selections_resource_id_idx\\\",\\\"columns\\\":[\\\"resource_id\\\"]}],\\\"version\\\":\\\"c6b02eb9\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CatalogAcquisition\\\":{\\\"name\\\":\\\"catalogacquisition\\\",\\\"className\\\":\\\"CatalogAcquisition\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CatalogAcquisition\\\",\\\"collection\\\":\\\"catalogacquisitions\\\",\\\"description\\\":\\\"A pinned, tenant-owned acquisition record. Bytes belong in a host storage service.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"resourceId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"CatalogResource\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"selectionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"CatalogSelection\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"revision\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"format\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"sha256\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"attribution\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"notices\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"CatalogAcquisition\\\",\\\"collectionExportName\\\":\\\"CatalogAcquisitionCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"resourceId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"selectionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"revision\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"format\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"sha256\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"catalog_acquisitions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"catalog_acquisitions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"resource_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"selection_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"revision\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"format\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"sha256\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"attribution\\\\\\\" TEXT,\\\\n \\\\\\\"notices\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"resource_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"catalog_resources\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"selection_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"catalog_selections\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"revision\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"format\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sha256\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"attribution\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"notices\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"catalog_acquisitions_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"catalog_acquisitions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"catalog_acquisitions_resource_id_idx\\\",\\\"columns\\\":[\\\"resource_id\\\"]},{\\\"name\\\":\\\"catalog_acquisitions_selection_id_idx\\\",\\\"columns\\\":[\\\"selection_id\\\"]}],\\\"version\\\":\\\"ee9c5add\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:Course\\\":{\\\"name\\\":\\\"course\\\",\\\"className\\\":\\\"Course\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:Course\\\",\\\"collection\\\":\\\"courses\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true,\\\"mode\\\":\\\"optional\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"summary\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"description\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sourceKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sourceUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sourceRef\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"license\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"licenseKind\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"own-work\\\",\\\"enum\\\":[\\\"own-work\\\",\\\"open-license\\\",\\\"personal-use-copy\\\",\\\"licensed-for-sharing\\\"]},\\\"licenseNote\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"attestedBy\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"subject\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"tags\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"levelMin\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"levelMax\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"decimal\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"estimatedMinutes\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"online\\\",\\\"enum\\\":[\\\"online\\\",\\\"printable\\\",\\\"kit\\\",\\\"video\\\",\\\"game\\\",\\\"mixed\\\"]},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"draft\\\",\\\"enum\\\":[\\\"draft\\\",\\\"published\\\",\\\"archived\\\"]}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableStrategy\\\":\\\"sti\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"optional\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"Course\\\",\\\"collectionExportName\\\":\\\"CourseCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"title\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"levelMin\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"levelMax\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"difficulty\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"decimal\\\"},{\\\"field\\\":\\\"estimatedMinutes\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"courses\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"courses\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"summary\\\\\\\" TEXT,\\\\n \\\\\\\"description\\\\\\\" TEXT,\\\\n \\\\\\\"source_key\\\\\\\" TEXT,\\\\n \\\\\\\"source_url\\\\\\\" TEXT,\\\\n \\\\\\\"source_ref\\\\\\\" TEXT,\\\\n \\\\\\\"license\\\\\\\" TEXT,\\\\n \\\\\\\"license_kind\\\\\\\" TEXT DEFAULT 'own-work',\\\\n \\\\\\\"license_note\\\\\\\" TEXT,\\\\n \\\\\\\"attested_by\\\\\\\" TEXT,\\\\n \\\\\\\"subject\\\\\\\" TEXT,\\\\n \\\\\\\"tags\\\\\\\" TEXT,\\\\n \\\\\\\"level_min\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"level_max\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'draft'\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"summary\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"license\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"license_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"own-work\\\"},\\\"license_note\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"attested_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"subject\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"tags\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"level_min\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"level_max\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"draft\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"courses_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"courses_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"courses_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"88cc23ab\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:ExternalCourse\\\":{\\\"name\\\":\\\"externalcourse\\\",\\\"className\\\":\\\"ExternalCourse\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:ExternalCourse\\\",\\\"collection\\\":\\\"courses\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true}}},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"summary\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"description\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sourceKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sourceUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sourceRef\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"license\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"licenseKind\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"own-work\\\",\\\"enum\\\":[\\\"own-work\\\",\\\"open-license\\\",\\\"personal-use-copy\\\",\\\"licensed-for-sharing\\\"]},\\\"licenseNote\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"attestedBy\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"subject\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"tags\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"levelMin\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"levelMax\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"decimal\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"estimatedMinutes\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"online\\\",\\\"enum\\\":[\\\"online\\\",\\\"printable\\\",\\\"kit\\\",\\\"video\\\",\\\"game\\\",\\\"mixed\\\"]},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"draft\\\",\\\"enum\\\":[\\\"draft\\\",\\\"published\\\",\\\"archived\\\"]}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"courses\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tableStrategy\\\":\\\"sti\\\"},\\\"extends\\\":\\\"Course\\\",\\\"exportName\\\":\\\"ExternalCourse\\\",\\\"collectionExportName\\\":\\\"ExternalCourseCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"title\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"levelMin\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"levelMax\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"difficulty\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"decimal\\\"},{\\\"field\\\":\\\"estimatedMinutes\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"courses\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"courses\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"summary\\\\\\\" TEXT,\\\\n \\\\\\\"description\\\\\\\" TEXT,\\\\n \\\\\\\"source_key\\\\\\\" TEXT,\\\\n \\\\\\\"source_url\\\\\\\" TEXT,\\\\n \\\\\\\"source_ref\\\\\\\" TEXT,\\\\n \\\\\\\"license\\\\\\\" TEXT,\\\\n \\\\\\\"license_kind\\\\\\\" TEXT DEFAULT 'own-work',\\\\n \\\\\\\"license_note\\\\\\\" TEXT,\\\\n \\\\\\\"attested_by\\\\\\\" TEXT,\\\\n \\\\\\\"subject\\\\\\\" TEXT,\\\\n \\\\\\\"tags\\\\\\\" TEXT,\\\\n \\\\\\\"level_min\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"level_max\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'draft'\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"summary\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"license\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"license_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"own-work\\\"},\\\"license_note\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"attested_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"subject\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"tags\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"level_min\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"level_max\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"draft\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"courses_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"courses_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"courses_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"88cc23ab\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:AuthoredCourse\\\":{\\\"name\\\":\\\"authoredcourse\\\",\\\"className\\\":\\\"AuthoredCourse\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:AuthoredCourse\\\",\\\"collection\\\":\\\"courses\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true}}},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"summary\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"description\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sourceKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sourceUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sourceRef\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"license\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"licenseKind\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"own-work\\\",\\\"enum\\\":[\\\"own-work\\\",\\\"open-license\\\",\\\"personal-use-copy\\\",\\\"licensed-for-sharing\\\"]},\\\"licenseNote\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"attestedBy\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"subject\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"tags\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"levelMin\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"levelMax\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"decimal\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"estimatedMinutes\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"online\\\",\\\"enum\\\":[\\\"online\\\",\\\"printable\\\",\\\"kit\\\",\\\"video\\\",\\\"game\\\",\\\"mixed\\\"]},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"draft\\\",\\\"enum\\\":[\\\"draft\\\",\\\"published\\\",\\\"archived\\\"]}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"courses\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tableStrategy\\\":\\\"sti\\\"},\\\"extends\\\":\\\"Course\\\",\\\"exportName\\\":\\\"AuthoredCourse\\\",\\\"collectionExportName\\\":\\\"AuthoredCourseCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"title\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"levelMin\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"levelMax\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"difficulty\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"decimal\\\"},{\\\"field\\\":\\\"estimatedMinutes\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"courses\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"courses\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"summary\\\\\\\" TEXT,\\\\n \\\\\\\"description\\\\\\\" TEXT,\\\\n \\\\\\\"source_key\\\\\\\" TEXT,\\\\n \\\\\\\"source_url\\\\\\\" TEXT,\\\\n \\\\\\\"source_ref\\\\\\\" TEXT,\\\\n \\\\\\\"license\\\\\\\" TEXT,\\\\n \\\\\\\"license_kind\\\\\\\" TEXT DEFAULT 'own-work',\\\\n \\\\\\\"license_note\\\\\\\" TEXT,\\\\n \\\\\\\"attested_by\\\\\\\" TEXT,\\\\n \\\\\\\"subject\\\\\\\" TEXT,\\\\n \\\\\\\"tags\\\\\\\" TEXT,\\\\n \\\\\\\"level_min\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"level_max\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'draft'\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"summary\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"license\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"license_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"own-work\\\"},\\\"license_note\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"attested_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"subject\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"tags\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"level_min\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"level_max\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"draft\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"courses_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"courses_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"courses_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"88cc23ab\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CourseSection\\\":{\\\"name\\\":\\\"coursesection\\\",\\\"className\\\":\\\"CourseSection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CourseSection\\\",\\\"collection\\\":\\\"coursesections\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true,\\\"mode\\\":\\\"optional\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"courseId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Course\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"optional\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"CourseSection\\\",\\\"collectionExportName\\\":\\\"CourseSectionCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"courseId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"title\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"sortOrder\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"course_sections\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"course_sections\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"course_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"title\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER NOT NULL DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"course_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"courses\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"course_sections_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"course_sections_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"course_sections_course_id_idx\\\",\\\"columns\\\":[\\\"course_id\\\"]}],\\\"version\\\":\\\"e20480d7\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:Lesson\\\":{\\\"name\\\":\\\"lesson\\\",\\\"className\\\":\\\"Lesson\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:Lesson\\\",\\\"collection\\\":\\\"lessons\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true,\\\"mode\\\":\\\"optional\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"sectionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"CourseSection\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"body\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"estimatedMinutes\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"decimal\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"online\\\",\\\"enum\\\":[\\\"online\\\",\\\"printable\\\",\\\"kit\\\",\\\"video\\\",\\\"game\\\",\\\"mixed\\\"]},\\\"completionRule\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"attest\\\",\\\"enum\\\":[\\\"attest\\\",\\\"submit\\\",\\\"score\\\",\\\"external\\\"]},\\\"externalRef\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"externalUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableStrategy\\\":\\\"sti\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"optional\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"Lesson\\\",\\\"collectionExportName\\\":\\\"LessonCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"sectionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"title\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"sortOrder\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"estimatedMinutes\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"difficulty\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"decimal\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lessons\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"section_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"body\\\\\\\" TEXT,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"completion_rule\\\\\\\" TEXT DEFAULT 'attest',\\\\n \\\\\\\"external_ref\\\\\\\" TEXT,\\\\n \\\\\\\"external_url\\\\\\\" TEXT,\\\\n \\\\\\\"video_url\\\\\\\" TEXT,\\\\n \\\\\\\"printable_url\\\\\\\" TEXT,\\\\n \\\\\\\"answer_url\\\\\\\" TEXT,\\\\n \\\\\\\"pages\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"section_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"course_sections\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"completion_rule\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"attest\\\"},\\\"external_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"external_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"video_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"printable_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"answer_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"pages\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"lessons_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"lessons_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"lessons_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lessons_section_id_idx\\\",\\\"columns\\\":[\\\"section_id\\\"]}],\\\"version\\\":\\\"092df043\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:Reading\\\":{\\\"name\\\":\\\"reading\\\",\\\"className\\\":\\\"Reading\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:Reading\\\",\\\"collection\\\":\\\"lessons\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true}}},\\\"sectionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"CourseSection\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"body\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"estimatedMinutes\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"decimal\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"online\\\",\\\"enum\\\":[\\\"online\\\",\\\"printable\\\",\\\"kit\\\",\\\"video\\\",\\\"game\\\",\\\"mixed\\\"]},\\\"completionRule\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"attest\\\",\\\"enum\\\":[\\\"attest\\\",\\\"submit\\\",\\\"score\\\",\\\"external\\\"]},\\\"externalRef\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"externalUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tableStrategy\\\":\\\"sti\\\"},\\\"extends\\\":\\\"Lesson\\\",\\\"exportName\\\":\\\"Reading\\\",\\\"collectionExportName\\\":\\\"ReadingCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"sectionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"title\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"sortOrder\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"estimatedMinutes\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"difficulty\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"decimal\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lessons\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"section_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"body\\\\\\\" TEXT,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"completion_rule\\\\\\\" TEXT DEFAULT 'attest',\\\\n \\\\\\\"external_ref\\\\\\\" TEXT,\\\\n \\\\\\\"external_url\\\\\\\" TEXT,\\\\n \\\\\\\"video_url\\\\\\\" TEXT,\\\\n \\\\\\\"printable_url\\\\\\\" TEXT,\\\\n \\\\\\\"answer_url\\\\\\\" TEXT,\\\\n \\\\\\\"pages\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"section_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"course_sections\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"completion_rule\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"attest\\\"},\\\"external_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"external_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"video_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"printable_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"answer_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"pages\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"lessons_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"lessons_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"lessons_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lessons_section_id_idx\\\",\\\"columns\\\":[\\\"section_id\\\"]}],\\\"version\\\":\\\"9d8b6fcd\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:Video\\\":{\\\"name\\\":\\\"video\\\",\\\"className\\\":\\\"Video\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:Video\\\",\\\"collection\\\":\\\"lessons\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true}}},\\\"sectionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"CourseSection\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"body\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"estimatedMinutes\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"decimal\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"online\\\",\\\"enum\\\":[\\\"online\\\",\\\"printable\\\",\\\"kit\\\",\\\"video\\\",\\\"game\\\",\\\"mixed\\\"]},\\\"completionRule\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"attest\\\",\\\"enum\\\":[\\\"attest\\\",\\\"submit\\\",\\\"score\\\",\\\"external\\\"]},\\\"externalRef\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"externalUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"videoUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tableStrategy\\\":\\\"sti\\\"},\\\"extends\\\":\\\"Lesson\\\",\\\"exportName\\\":\\\"Video\\\",\\\"collectionExportName\\\":\\\"VideoCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"sectionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"title\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"sortOrder\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"estimatedMinutes\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"difficulty\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"decimal\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lessons\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"section_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"body\\\\\\\" TEXT,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"completion_rule\\\\\\\" TEXT DEFAULT 'attest',\\\\n \\\\\\\"external_ref\\\\\\\" TEXT,\\\\n \\\\\\\"external_url\\\\\\\" TEXT,\\\\n \\\\\\\"video_url\\\\\\\" TEXT,\\\\n \\\\\\\"printable_url\\\\\\\" TEXT,\\\\n \\\\\\\"answer_url\\\\\\\" TEXT,\\\\n \\\\\\\"pages\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"section_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"course_sections\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"completion_rule\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"attest\\\"},\\\"external_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"external_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"video_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"printable_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"answer_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"pages\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"lessons_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"lessons_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"lessons_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lessons_section_id_idx\\\",\\\"columns\\\":[\\\"section_id\\\"]}],\\\"version\\\":\\\"9e0ef984\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:Worksheet\\\":{\\\"name\\\":\\\"worksheet\\\",\\\"className\\\":\\\"Worksheet\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:Worksheet\\\",\\\"collection\\\":\\\"lessons\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true}}},\\\"sectionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"CourseSection\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"body\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"estimatedMinutes\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"decimal\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"online\\\",\\\"enum\\\":[\\\"online\\\",\\\"printable\\\",\\\"kit\\\",\\\"video\\\",\\\"game\\\",\\\"mixed\\\"]},\\\"completionRule\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"submit\\\",\\\"enum\\\":[\\\"attest\\\",\\\"submit\\\",\\\"score\\\",\\\"external\\\"]},\\\"externalRef\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"externalUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"printableUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"answerUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"pages\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tableStrategy\\\":\\\"sti\\\"},\\\"extends\\\":\\\"Lesson\\\",\\\"exportName\\\":\\\"Worksheet\\\",\\\"collectionExportName\\\":\\\"WorksheetCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"sectionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"title\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"sortOrder\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"estimatedMinutes\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"difficulty\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"decimal\\\"},{\\\"field\\\":\\\"pages\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lessons\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"section_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"body\\\\\\\" TEXT,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"completion_rule\\\\\\\" TEXT DEFAULT 'attest',\\\\n \\\\\\\"external_ref\\\\\\\" TEXT,\\\\n \\\\\\\"external_url\\\\\\\" TEXT,\\\\n \\\\\\\"video_url\\\\\\\" TEXT,\\\\n \\\\\\\"printable_url\\\\\\\" TEXT,\\\\n \\\\\\\"answer_url\\\\\\\" TEXT,\\\\n \\\\\\\"pages\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"section_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"course_sections\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"completion_rule\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"attest\\\"},\\\"external_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"external_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"video_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"printable_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"answer_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"pages\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"lessons_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"lessons_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"lessons_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lessons_section_id_idx\\\",\\\"columns\\\":[\\\"section_id\\\"]}],\\\"version\\\":\\\"10976938\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:Exercise\\\":{\\\"name\\\":\\\"exercise\\\",\\\"className\\\":\\\"Exercise\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:Exercise\\\",\\\"collection\\\":\\\"lessons\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true}}},\\\"sectionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"CourseSection\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"body\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"estimatedMinutes\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"decimal\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"online\\\",\\\"enum\\\":[\\\"online\\\",\\\"printable\\\",\\\"kit\\\",\\\"video\\\",\\\"game\\\",\\\"mixed\\\"]},\\\"completionRule\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"attest\\\",\\\"enum\\\":[\\\"attest\\\",\\\"submit\\\",\\\"score\\\",\\\"external\\\"]},\\\"externalRef\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"externalUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tableStrategy\\\":\\\"sti\\\"},\\\"extends\\\":\\\"Lesson\\\",\\\"exportName\\\":\\\"Exercise\\\",\\\"collectionExportName\\\":\\\"ExerciseCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"sectionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"title\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"sortOrder\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"estimatedMinutes\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"difficulty\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"decimal\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lessons\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"section_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"body\\\\\\\" TEXT,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"completion_rule\\\\\\\" TEXT DEFAULT 'attest',\\\\n \\\\\\\"external_ref\\\\\\\" TEXT,\\\\n \\\\\\\"external_url\\\\\\\" TEXT,\\\\n \\\\\\\"video_url\\\\\\\" TEXT,\\\\n \\\\\\\"printable_url\\\\\\\" TEXT,\\\\n \\\\\\\"answer_url\\\\\\\" TEXT,\\\\n \\\\\\\"pages\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"section_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"course_sections\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"completion_rule\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"attest\\\"},\\\"external_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"external_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"video_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"printable_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"answer_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"pages\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"lessons_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"lessons_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"lessons_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lessons_section_id_idx\\\",\\\"columns\\\":[\\\"section_id\\\"]}],\\\"version\\\":\\\"145eadbe\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CourseCollection\\\":{\\\"name\\\":\\\"coursecollection\\\",\\\"className\\\":\\\"CourseCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CourseCollection\\\",\\\"collection\\\":\\\"courses\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Course\\\",\\\"exportName\\\":\\\"CourseCollection\\\",\\\"collectionExportName\\\":\\\"CourseCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"courses\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"courses\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"summary\\\\\\\" TEXT,\\\\n \\\\\\\"description\\\\\\\" TEXT,\\\\n \\\\\\\"source_key\\\\\\\" TEXT,\\\\n \\\\\\\"source_url\\\\\\\" TEXT,\\\\n \\\\\\\"source_ref\\\\\\\" TEXT,\\\\n \\\\\\\"license\\\\\\\" TEXT,\\\\n \\\\\\\"license_kind\\\\\\\" TEXT DEFAULT 'own-work',\\\\n \\\\\\\"license_note\\\\\\\" TEXT,\\\\n \\\\\\\"attested_by\\\\\\\" TEXT,\\\\n \\\\\\\"subject\\\\\\\" TEXT,\\\\n \\\\\\\"tags\\\\\\\" TEXT,\\\\n \\\\\\\"level_min\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"level_max\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'draft'\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"summary\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"license\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"license_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"own-work\\\"},\\\"license_note\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"attested_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"subject\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"tags\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"level_min\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"level_max\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"draft\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"courses_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"courses_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"courses_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"88cc23ab\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:ExternalCourseCollection\\\":{\\\"name\\\":\\\"externalcoursecollection\\\",\\\"className\\\":\\\"ExternalCourseCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:ExternalCourseCollection\\\",\\\"collection\\\":\\\"courses\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"courses\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"ExternalCourse\\\",\\\"exportName\\\":\\\"ExternalCourseCollection\\\",\\\"collectionExportName\\\":\\\"ExternalCourseCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"courses\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"courses\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"summary\\\\\\\" TEXT,\\\\n \\\\\\\"description\\\\\\\" TEXT,\\\\n \\\\\\\"source_key\\\\\\\" TEXT,\\\\n \\\\\\\"source_url\\\\\\\" TEXT,\\\\n \\\\\\\"source_ref\\\\\\\" TEXT,\\\\n \\\\\\\"license\\\\\\\" TEXT,\\\\n \\\\\\\"license_kind\\\\\\\" TEXT DEFAULT 'own-work',\\\\n \\\\\\\"license_note\\\\\\\" TEXT,\\\\n \\\\\\\"attested_by\\\\\\\" TEXT,\\\\n \\\\\\\"subject\\\\\\\" TEXT,\\\\n \\\\\\\"tags\\\\\\\" TEXT,\\\\n \\\\\\\"level_min\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"level_max\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'draft'\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"summary\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"license\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"license_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"own-work\\\"},\\\"license_note\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"attested_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"subject\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"tags\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"level_min\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"level_max\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"draft\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"courses_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"courses_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"courses_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"88cc23ab\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:AuthoredCourseCollection\\\":{\\\"name\\\":\\\"authoredcoursecollection\\\",\\\"className\\\":\\\"AuthoredCourseCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:AuthoredCourseCollection\\\",\\\"collection\\\":\\\"courses\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"courses\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"AuthoredCourse\\\",\\\"exportName\\\":\\\"AuthoredCourseCollection\\\",\\\"collectionExportName\\\":\\\"AuthoredCourseCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"courses\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"courses\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"summary\\\\\\\" TEXT,\\\\n \\\\\\\"description\\\\\\\" TEXT,\\\\n \\\\\\\"source_key\\\\\\\" TEXT,\\\\n \\\\\\\"source_url\\\\\\\" TEXT,\\\\n \\\\\\\"source_ref\\\\\\\" TEXT,\\\\n \\\\\\\"license\\\\\\\" TEXT,\\\\n \\\\\\\"license_kind\\\\\\\" TEXT DEFAULT 'own-work',\\\\n \\\\\\\"license_note\\\\\\\" TEXT,\\\\n \\\\\\\"attested_by\\\\\\\" TEXT,\\\\n \\\\\\\"subject\\\\\\\" TEXT,\\\\n \\\\\\\"tags\\\\\\\" TEXT,\\\\n \\\\\\\"level_min\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"level_max\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'draft'\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"summary\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"license\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"license_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"own-work\\\"},\\\"license_note\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"attested_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"subject\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"tags\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"level_min\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"level_max\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"draft\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"courses_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"courses_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"courses_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"88cc23ab\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CourseSectionCollection\\\":{\\\"name\\\":\\\"coursesectioncollection\\\",\\\"className\\\":\\\"CourseSectionCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CourseSectionCollection\\\",\\\"collection\\\":\\\"coursesections\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"CourseSection\\\",\\\"exportName\\\":\\\"CourseSectionCollection\\\",\\\"collectionExportName\\\":\\\"CourseSectionCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"course_sections\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"course_sections\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"course_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"title\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER NOT NULL DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"course_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"courses\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"course_sections_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"course_sections_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"course_sections_course_id_idx\\\",\\\"columns\\\":[\\\"course_id\\\"]}],\\\"version\\\":\\\"e20480d7\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:LessonCollection\\\":{\\\"name\\\":\\\"lessoncollection\\\",\\\"className\\\":\\\"LessonCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:LessonCollection\\\",\\\"collection\\\":\\\"lessons\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Lesson\\\",\\\"exportName\\\":\\\"LessonCollection\\\",\\\"collectionExportName\\\":\\\"LessonCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lessons\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"section_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"body\\\\\\\" TEXT,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"completion_rule\\\\\\\" TEXT DEFAULT 'attest',\\\\n \\\\\\\"external_ref\\\\\\\" TEXT,\\\\n \\\\\\\"external_url\\\\\\\" TEXT,\\\\n \\\\\\\"video_url\\\\\\\" TEXT,\\\\n \\\\\\\"printable_url\\\\\\\" TEXT,\\\\n \\\\\\\"answer_url\\\\\\\" TEXT,\\\\n \\\\\\\"pages\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"section_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"course_sections\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"completion_rule\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"attest\\\"},\\\"external_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"external_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"video_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"printable_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"answer_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"pages\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"lessons_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"lessons_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"lessons_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lessons_section_id_idx\\\",\\\"columns\\\":[\\\"section_id\\\"]}],\\\"version\\\":\\\"092df043\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:ReadingCollection\\\":{\\\"name\\\":\\\"readingcollection\\\",\\\"className\\\":\\\"ReadingCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:ReadingCollection\\\",\\\"collection\\\":\\\"lessons\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Reading\\\",\\\"exportName\\\":\\\"ReadingCollection\\\",\\\"collectionExportName\\\":\\\"ReadingCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lessons\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"section_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"body\\\\\\\" TEXT,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"completion_rule\\\\\\\" TEXT DEFAULT 'attest',\\\\n \\\\\\\"external_ref\\\\\\\" TEXT,\\\\n \\\\\\\"external_url\\\\\\\" TEXT,\\\\n \\\\\\\"video_url\\\\\\\" TEXT,\\\\n \\\\\\\"printable_url\\\\\\\" TEXT,\\\\n \\\\\\\"answer_url\\\\\\\" TEXT,\\\\n \\\\\\\"pages\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"section_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"course_sections\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"completion_rule\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"attest\\\"},\\\"external_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"external_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"video_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"printable_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"answer_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"pages\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"lessons_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"lessons_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"lessons_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lessons_section_id_idx\\\",\\\"columns\\\":[\\\"section_id\\\"]}],\\\"version\\\":\\\"9d8b6fcd\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:VideoCollection\\\":{\\\"name\\\":\\\"videocollection\\\",\\\"className\\\":\\\"VideoCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:VideoCollection\\\",\\\"collection\\\":\\\"lessons\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Video\\\",\\\"exportName\\\":\\\"VideoCollection\\\",\\\"collectionExportName\\\":\\\"VideoCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lessons\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"section_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"body\\\\\\\" TEXT,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"completion_rule\\\\\\\" TEXT DEFAULT 'attest',\\\\n \\\\\\\"external_ref\\\\\\\" TEXT,\\\\n \\\\\\\"external_url\\\\\\\" TEXT,\\\\n \\\\\\\"video_url\\\\\\\" TEXT,\\\\n \\\\\\\"printable_url\\\\\\\" TEXT,\\\\n \\\\\\\"answer_url\\\\\\\" TEXT,\\\\n \\\\\\\"pages\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"section_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"course_sections\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"completion_rule\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"attest\\\"},\\\"external_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"external_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"video_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"printable_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"answer_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"pages\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"lessons_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"lessons_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"lessons_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lessons_section_id_idx\\\",\\\"columns\\\":[\\\"section_id\\\"]}],\\\"version\\\":\\\"9e0ef984\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorksheetCollection\\\":{\\\"name\\\":\\\"worksheetcollection\\\",\\\"className\\\":\\\"WorksheetCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorksheetCollection\\\",\\\"collection\\\":\\\"lessons\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Worksheet\\\",\\\"exportName\\\":\\\"WorksheetCollection\\\",\\\"collectionExportName\\\":\\\"WorksheetCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lessons\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"section_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"body\\\\\\\" TEXT,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"completion_rule\\\\\\\" TEXT DEFAULT 'attest',\\\\n \\\\\\\"external_ref\\\\\\\" TEXT,\\\\n \\\\\\\"external_url\\\\\\\" TEXT,\\\\n \\\\\\\"video_url\\\\\\\" TEXT,\\\\n \\\\\\\"printable_url\\\\\\\" TEXT,\\\\n \\\\\\\"answer_url\\\\\\\" TEXT,\\\\n \\\\\\\"pages\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"section_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"course_sections\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"completion_rule\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"attest\\\"},\\\"external_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"external_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"video_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"printable_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"answer_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"pages\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"lessons_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"lessons_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"lessons_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lessons_section_id_idx\\\",\\\"columns\\\":[\\\"section_id\\\"]}],\\\"version\\\":\\\"10976938\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:ExerciseCollection\\\":{\\\"name\\\":\\\"exercisecollection\\\",\\\"className\\\":\\\"ExerciseCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:ExerciseCollection\\\",\\\"collection\\\":\\\"lessons\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Exercise\\\",\\\"exportName\\\":\\\"ExerciseCollection\\\",\\\"collectionExportName\\\":\\\"ExerciseCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lessons\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"section_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"body\\\\\\\" TEXT,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"completion_rule\\\\\\\" TEXT DEFAULT 'attest',\\\\n \\\\\\\"external_ref\\\\\\\" TEXT,\\\\n \\\\\\\"external_url\\\\\\\" TEXT,\\\\n \\\\\\\"video_url\\\\\\\" TEXT,\\\\n \\\\\\\"printable_url\\\\\\\" TEXT,\\\\n \\\\\\\"answer_url\\\\\\\" TEXT,\\\\n \\\\\\\"pages\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"section_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"course_sections\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"completion_rule\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"attest\\\"},\\\"external_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"external_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"video_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"printable_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"answer_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"pages\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"lessons_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"lessons_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"lessons_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lessons_section_id_idx\\\",\\\"columns\\\":[\\\"section_id\\\"]}],\\\"version\\\":\\\"145eadbe\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:LessonAssetCollection\\\":{\\\"name\\\":\\\"lessonassetcollection\\\",\\\"className\\\":\\\"LessonAssetCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:LessonAssetCollection\\\",\\\"collection\\\":\\\"lessonassets\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"byRight\\\":{\\\"name\\\":\\\"byRight\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"rightId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"opts\\\",\\\"type\\\":\\\"JunctionFilterOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<TItem[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"byLeft\\\":{\\\"name\\\":\\\"byLeft\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"leftId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"opts\\\",\\\"type\\\":\\\"JunctionFilterOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<TItem[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"attach\\\":{\\\"name\\\":\\\"attach\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"leftId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"rightId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"opts\\\",\\\"type\\\":\\\"JunctionAttachOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<TItem>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"detach\\\":{\\\"name\\\":\\\"detach\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"leftId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"rightId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"opts\\\",\\\"type\\\":\\\"JunctionFilterOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setLinks\\\":{\\\"name\\\":\\\"setLinks\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"leftId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"rightIds\\\",\\\"type\\\":\\\"string[]\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"opts\\\",\\\"type\\\":\\\"JunctionAttachOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"lesson_assets\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtJunction\\\",\\\"extendsTypeArg\\\":\\\"LessonAsset\\\",\\\"exportName\\\":\\\"LessonAssetCollection\\\",\\\"collectionExportName\\\":\\\"LessonAssetCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"lesson_assets\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lesson_assets\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"asset_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"relationship\\\\\\\" TEXT NOT NULL DEFAULT 'attachment',\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER NOT NULL DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"asset_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"relationship\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"attachment\\\"},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"lesson_assets_tenant_id_lesson_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"lesson_id\\\",\\\"asset_id\\\",\\\"relationship\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"lesson_assets_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"lesson_assets_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lesson_assets_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]},{\\\"name\\\":\\\"lesson_assets_asset_id_idx\\\",\\\"columns\\\":[\\\"asset_id\\\"]}],\\\"version\\\":\\\"d96385c6\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:LearnerCollection\\\":{\\\"name\\\":\\\"learnercollection\\\",\\\"className\\\":\\\"LearnerCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:LearnerCollection\\\",\\\"collection\\\":\\\"learners\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Learner\\\",\\\"exportName\\\":\\\"LearnerCollection\\\",\\\"collectionExportName\\\":\\\"LearnerCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"learners\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"learners\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"user_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"profile_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"display_name\\\\\\\" TEXT,\\\\n \\\\\\\"birth_date\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"level\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"settings\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"user_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"profile_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"display_name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"birth_date\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"level\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"settings\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"learners_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"learners_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"learners_user_id_idx\\\",\\\"columns\\\":[\\\"user_id\\\"]},{\\\"name\\\":\\\"learners_profile_id_idx\\\",\\\"columns\\\":[\\\"profile_id\\\"]}],\\\"version\\\":\\\"ca9907b5\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CurriculumCollection\\\":{\\\"name\\\":\\\"curriculumcollection\\\",\\\"className\\\":\\\"CurriculumCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CurriculumCollection\\\",\\\"collection\\\":\\\"curriculums\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"curricula\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Curriculum\\\",\\\"exportName\\\":\\\"CurriculumCollection\\\",\\\"collectionExportName\\\":\\\"CurriculumCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"curricula\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"curricula\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"title\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"starts_on\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"ends_on\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'planned'\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"starts_on\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"ends_on\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"planned\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"curricula_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"curricula_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"curricula_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]}],\\\"version\\\":\\\"b7e90cbd\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:EnrollmentCollection\\\":{\\\"name\\\":\\\"enrollmentcollection\\\",\\\"className\\\":\\\"EnrollmentCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:EnrollmentCollection\\\",\\\"collection\\\":\\\"enrollments\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Enrollment\\\",\\\"exportName\\\":\\\"EnrollmentCollection\\\",\\\"collectionExportName\\\":\\\"EnrollmentCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"enrollments\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"enrollments\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"curriculum_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"course_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'planned',\\\\n \\\\\\\"started_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"completed_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"target_minutes_per_week\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER NOT NULL DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"curriculum_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"curricula\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"course_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"courses\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"planned\\\"},\\\"started_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"completed_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"target_minutes_per_week\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"enrollments_tenant_id_curriculum_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"curriculum_id\\\",\\\"course_id\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"enrollments_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"enrollments_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"enrollments_curriculum_id_idx\\\",\\\"columns\\\":[\\\"curriculum_id\\\"]},{\\\"name\\\":\\\"enrollments_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"enrollments_course_id_idx\\\",\\\"columns\\\":[\\\"course_id\\\"]}],\\\"version\\\":\\\"2a34b5ee\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:LessonProgressCollection\\\":{\\\"name\\\":\\\"lessonprogresscollection\\\",\\\"className\\\":\\\"LessonProgressCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:LessonProgressCollection\\\",\\\"collection\\\":\\\"lessonprogresses\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"lesson_progress\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"LessonProgress\\\",\\\"exportName\\\":\\\"LessonProgressCollection\\\",\\\"collectionExportName\\\":\\\"LessonProgressCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"lesson_progress\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lesson_progress\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"enrollment_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'not_started',\\\\n \\\\\\\"started_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"completed_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"time_spent_seconds\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"attempts\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"best_score\\\\\\\" REAL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"enrollment_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"enrollments\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"not_started\\\"},\\\"started_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"completed_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"time_spent_seconds\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"attempts\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"best_score\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"lesson_progress_tenant_id_enrollment_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"enrollment_id\\\",\\\"lesson_id\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"lesson_progress_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"lesson_progress_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lesson_progress_enrollment_id_idx\\\",\\\"columns\\\":[\\\"enrollment_id\\\"]},{\\\"name\\\":\\\"lesson_progress_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"lesson_progress_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]}],\\\"version\\\":\\\"36704fbd\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:SubmissionCollection\\\":{\\\"name\\\":\\\"submissioncollection\\\",\\\"className\\\":\\\"SubmissionCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:SubmissionCollection\\\",\\\"collection\\\":\\\"submissions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Submission\\\",\\\"exportName\\\":\\\"SubmissionCollection\\\",\\\"collectionExportName\\\":\\\"SubmissionCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"submissions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"learner_id\\\\\\\" UUID,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID,\\\\n \\\\\\\"progress_id\\\\\\\" UUID,\\\\n \\\\\\\"submitted_at\\\\\\\" TEXT,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'captured',\\\\n \\\\\\\"notes\\\\\\\" TEXT,\\\\n \\\\\\\"capture_key\\\\\\\" TEXT,\\\\n \\\\\\\"capture_digest\\\\\\\" TEXT,\\\\n \\\\\\\"kind\\\\\\\" TEXT DEFAULT 'completed_work',\\\\n \\\\\\\"previous_submission_id\\\\\\\" UUID,\\\\n \\\\\\\"intake_item_id\\\\\\\" TEXT,\\\\n \\\\\\\"page_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"ocr_text\\\\\\\" TEXT,\\\\n \\\\\\\"extracted\\\\\\\" TEXT,\\\\n \\\\\\\"reported_by\\\\\\\" TEXT DEFAULT 'learner',\\\\n \\\\\\\"evidence_url\\\\\\\" TEXT,\\\\n \\\\\\\"reported_score\\\\\\\" REAL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"progress_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lesson_progress\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"submitted_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"captured\\\"},\\\"notes\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"completed_work\\\"},\\\"previous_submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"intake_item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"page_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"ocr_text\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"extracted\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"learner\\\"},\\\"evidence_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_score\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"submissions_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"submissions_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"submissions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"submissions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"submissions_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]},{\\\"name\\\":\\\"submissions_progress_id_idx\\\",\\\"columns\\\":[\\\"progress_id\\\"]},{\\\"name\\\":\\\"submissions_previous_submission_id_idx\\\",\\\"columns\\\":[\\\"previous_submission_id\\\"]}],\\\"version\\\":\\\"27a21ab4\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:SubmissionIntakeBindingCollection\\\":{\\\"name\\\":\\\"submissionintakebindingcollection\\\",\\\"className\\\":\\\"SubmissionIntakeBindingCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:SubmissionIntakeBindingCollection\\\",\\\"collection\\\":\\\"submissionintakebindings\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"submission_intake_bindings\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"SubmissionIntakeBinding\\\",\\\"exportName\\\":\\\"SubmissionIntakeBindingCollection\\\",\\\"collectionExportName\\\":\\\"SubmissionIntakeBindingCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"submission_intake_bindings\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"submission_intake_bindings\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"intake_item_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"submission_id\\\\\\\" UUID NOT NULL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"intake_item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}}},\\\"indexes\\\":[{\\\"name\\\":\\\"submission_intake_bindings_tenant_id_intake_item_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"intake_item_id\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"submission_intake_bindings_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"submission_intake_bindings_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"submission_intake_bindings_submission_id_idx\\\",\\\"columns\\\":[\\\"submission_id\\\"]}],\\\"version\\\":\\\"7102c909\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:ScannedSubmissionCollection\\\":{\\\"name\\\":\\\"scannedsubmissioncollection\\\",\\\"className\\\":\\\"ScannedSubmissionCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:ScannedSubmissionCollection\\\",\\\"collection\\\":\\\"submissions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"ScannedSubmission\\\",\\\"exportName\\\":\\\"ScannedSubmissionCollection\\\",\\\"collectionExportName\\\":\\\"ScannedSubmissionCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"submissions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"learner_id\\\\\\\" UUID,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID,\\\\n \\\\\\\"progress_id\\\\\\\" UUID,\\\\n \\\\\\\"submitted_at\\\\\\\" TEXT,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'captured',\\\\n \\\\\\\"notes\\\\\\\" TEXT,\\\\n \\\\\\\"capture_key\\\\\\\" TEXT,\\\\n \\\\\\\"capture_digest\\\\\\\" TEXT,\\\\n \\\\\\\"kind\\\\\\\" TEXT DEFAULT 'completed_work',\\\\n \\\\\\\"previous_submission_id\\\\\\\" UUID,\\\\n \\\\\\\"intake_item_id\\\\\\\" TEXT,\\\\n \\\\\\\"page_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"ocr_text\\\\\\\" TEXT,\\\\n \\\\\\\"extracted\\\\\\\" TEXT,\\\\n \\\\\\\"reported_by\\\\\\\" TEXT DEFAULT 'learner',\\\\n \\\\\\\"evidence_url\\\\\\\" TEXT,\\\\n \\\\\\\"reported_score\\\\\\\" REAL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"progress_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lesson_progress\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"submitted_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"captured\\\"},\\\"notes\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"completed_work\\\"},\\\"previous_submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"intake_item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"page_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"ocr_text\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"extracted\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"learner\\\"},\\\"evidence_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_score\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"submissions_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"submissions_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"submissions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"submissions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"submissions_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]},{\\\"name\\\":\\\"submissions_progress_id_idx\\\",\\\"columns\\\":[\\\"progress_id\\\"]},{\\\"name\\\":\\\"submissions_previous_submission_id_idx\\\",\\\"columns\\\":[\\\"previous_submission_id\\\"]}],\\\"version\\\":\\\"7c394510\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:ExternalCompletionCollection\\\":{\\\"name\\\":\\\"externalcompletioncollection\\\",\\\"className\\\":\\\"ExternalCompletionCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:ExternalCompletionCollection\\\",\\\"collection\\\":\\\"submissions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"ExternalCompletion\\\",\\\"exportName\\\":\\\"ExternalCompletionCollection\\\",\\\"collectionExportName\\\":\\\"ExternalCompletionCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"submissions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"learner_id\\\\\\\" UUID,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID,\\\\n \\\\\\\"progress_id\\\\\\\" UUID,\\\\n \\\\\\\"submitted_at\\\\\\\" TEXT,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'captured',\\\\n \\\\\\\"notes\\\\\\\" TEXT,\\\\n \\\\\\\"capture_key\\\\\\\" TEXT,\\\\n \\\\\\\"capture_digest\\\\\\\" TEXT,\\\\n \\\\\\\"kind\\\\\\\" TEXT DEFAULT 'completed_work',\\\\n \\\\\\\"previous_submission_id\\\\\\\" UUID,\\\\n \\\\\\\"intake_item_id\\\\\\\" TEXT,\\\\n \\\\\\\"page_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"ocr_text\\\\\\\" TEXT,\\\\n \\\\\\\"extracted\\\\\\\" TEXT,\\\\n \\\\\\\"reported_by\\\\\\\" TEXT DEFAULT 'learner',\\\\n \\\\\\\"evidence_url\\\\\\\" TEXT,\\\\n \\\\\\\"reported_score\\\\\\\" REAL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"progress_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lesson_progress\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"submitted_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"captured\\\"},\\\"notes\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"completed_work\\\"},\\\"previous_submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"intake_item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"page_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"ocr_text\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"extracted\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"learner\\\"},\\\"evidence_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_score\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"submissions_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"submissions_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"submissions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"submissions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"submissions_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]},{\\\"name\\\":\\\"submissions_progress_id_idx\\\",\\\"columns\\\":[\\\"progress_id\\\"]},{\\\"name\\\":\\\"submissions_previous_submission_id_idx\\\",\\\"columns\\\":[\\\"previous_submission_id\\\"]}],\\\"version\\\":\\\"eff3715d\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:AttestationCollection\\\":{\\\"name\\\":\\\"attestationcollection\\\",\\\"className\\\":\\\"AttestationCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:AttestationCollection\\\",\\\"collection\\\":\\\"submissions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Attestation\\\",\\\"exportName\\\":\\\"AttestationCollection\\\",\\\"collectionExportName\\\":\\\"AttestationCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"submissions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"learner_id\\\\\\\" UUID,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID,\\\\n \\\\\\\"progress_id\\\\\\\" UUID,\\\\n \\\\\\\"submitted_at\\\\\\\" TEXT,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'captured',\\\\n \\\\\\\"notes\\\\\\\" TEXT,\\\\n \\\\\\\"capture_key\\\\\\\" TEXT,\\\\n \\\\\\\"capture_digest\\\\\\\" TEXT,\\\\n \\\\\\\"kind\\\\\\\" TEXT DEFAULT 'completed_work',\\\\n \\\\\\\"previous_submission_id\\\\\\\" UUID,\\\\n \\\\\\\"intake_item_id\\\\\\\" TEXT,\\\\n \\\\\\\"page_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"ocr_text\\\\\\\" TEXT,\\\\n \\\\\\\"extracted\\\\\\\" TEXT,\\\\n \\\\\\\"reported_by\\\\\\\" TEXT DEFAULT 'learner',\\\\n \\\\\\\"evidence_url\\\\\\\" TEXT,\\\\n \\\\\\\"reported_score\\\\\\\" REAL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"progress_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lesson_progress\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"submitted_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"captured\\\"},\\\"notes\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"completed_work\\\"},\\\"previous_submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"intake_item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"page_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"ocr_text\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"extracted\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"learner\\\"},\\\"evidence_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_score\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"submissions_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"submissions_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"submissions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"submissions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"submissions_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]},{\\\"name\\\":\\\"submissions_progress_id_idx\\\",\\\"columns\\\":[\\\"progress_id\\\"]},{\\\"name\\\":\\\"submissions_previous_submission_id_idx\\\",\\\"columns\\\":[\\\"previous_submission_id\\\"]}],\\\"version\\\":\\\"4f3230a3\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:GradeCollection\\\":{\\\"name\\\":\\\"gradecollection\\\",\\\"className\\\":\\\"GradeCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:GradeCollection\\\",\\\"collection\\\":\\\"grades\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Grade\\\",\\\"exportName\\\":\\\"GradeCollection\\\",\\\"collectionExportName\\\":\\\"GradeCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"grades\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"grades\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"submission_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"grader_kind\\\\\\\" TEXT NOT NULL DEFAULT 'auto',\\\\n \\\\\\\"grader_profile_id\\\\\\\" UUID,\\\\n \\\\\\\"score\\\\\\\" REAL,\\\\n \\\\\\\"points_earned\\\\\\\" INTEGER,\\\\n \\\\\\\"points_possible\\\\\\\" INTEGER,\\\\n \\\\\\\"rubric_results\\\\\\\" TEXT,\\\\n \\\\\\\"feedback\\\\\\\" TEXT,\\\\n \\\\\\\"graded_at\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"grader_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"auto\\\"},\\\"grader_profile_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"score\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"points_earned\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"points_possible\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"rubric_results\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"feedback\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"graded_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"grades_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"grades_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"grades_submission_id_idx\\\",\\\"columns\\\":[\\\"submission_id\\\"]},{\\\"name\\\":\\\"grades_grader_profile_id_idx\\\",\\\"columns\\\":[\\\"grader_profile_id\\\"]}],\\\"version\\\":\\\"7d629fec\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:SubmissionAssetCollection\\\":{\\\"name\\\":\\\"submissionassetcollection\\\",\\\"className\\\":\\\"SubmissionAssetCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:SubmissionAssetCollection\\\",\\\"collection\\\":\\\"submissionassets\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"byRight\\\":{\\\"name\\\":\\\"byRight\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"rightId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"opts\\\",\\\"type\\\":\\\"JunctionFilterOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<TItem[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"byLeft\\\":{\\\"name\\\":\\\"byLeft\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"leftId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"opts\\\",\\\"type\\\":\\\"JunctionFilterOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<TItem[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"attach\\\":{\\\"name\\\":\\\"attach\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"leftId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"rightId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"opts\\\",\\\"type\\\":\\\"JunctionAttachOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<TItem>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"detach\\\":{\\\"name\\\":\\\"detach\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"leftId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"rightId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"opts\\\",\\\"type\\\":\\\"JunctionFilterOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setLinks\\\":{\\\"name\\\":\\\"setLinks\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"leftId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"rightIds\\\",\\\"type\\\":\\\"string[]\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"opts\\\",\\\"type\\\":\\\"JunctionAttachOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"submission_assets\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtJunction\\\",\\\"extendsTypeArg\\\":\\\"SubmissionAsset\\\",\\\"exportName\\\":\\\"SubmissionAssetCollection\\\",\\\"collectionExportName\\\":\\\"SubmissionAssetCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"submission_assets\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"submission_assets\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"submission_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"asset_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"relationship\\\\\\\" TEXT NOT NULL DEFAULT 'page',\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER NOT NULL DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"asset_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"relationship\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"page\\\"},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"submission_assets_tenant_id_submission_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"submission_id\\\",\\\"asset_id\\\",\\\"relationship\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"submission_assets_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"submission_assets_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"submission_assets_submission_id_idx\\\",\\\"columns\\\":[\\\"submission_id\\\"]},{\\\"name\\\":\\\"submission_assets_asset_id_idx\\\",\\\"columns\\\":[\\\"asset_id\\\"]}],\\\"version\\\":\\\"d9b61c8a\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CourseSource\\\":{\\\"name\\\":\\\"coursesource\\\",\\\"className\\\":\\\"CourseSource\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CourseSource\\\",\\\"collection\\\":\\\"coursesources\\\",\\\"description\\\":\\\"Host-managed source policy; deliberately has no generated CRUD surface.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/course-source.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"key\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"name\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"kind\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"adapter\\\",\\\"enum\\\":[\\\"manual\\\",\\\"url\\\",\\\"adapter\\\"]},\\\"adapterKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"config\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sharing\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"private\\\",\\\"enum\\\":[\\\"private\\\",\\\"group\\\",\\\"global\\\"]}},\\\"methods\\\":{\\\"getConfig\\\":{\\\"name\\\":\\\"getConfig\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"CourseSourceConfig\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setConfig\\\":{\\\"name\\\":\\\"setConfig\\\",\\\"async\\\":false,\\\"parameters\\\":[{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"CourseSourceConfig\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"cli\\\":false,\\\"mcp\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"CourseSource\\\",\\\"collectionExportName\\\":\\\"CourseSourceCollection\\\",\\\"displayLabelField\\\":\\\"name\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"key\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"name\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"course_sources\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"course_sources\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"key\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"name\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"kind\\\\\\\" TEXT DEFAULT 'adapter',\\\\n \\\\\\\"adapter_key\\\\\\\" TEXT,\\\\n \\\\\\\"config\\\\\\\" TEXT,\\\\n \\\\\\\"sharing\\\\\\\" TEXT DEFAULT 'private'\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"adapter\\\"},\\\"adapter_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"config\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"sharing\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"private\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"course_sources_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"course_sources_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"98177eb3\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CourseSourceCollection\\\":{\\\"name\\\":\\\"coursesourcecollection\\\",\\\"className\\\":\\\"CourseSourceCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CourseSourceCollection\\\",\\\"collection\\\":\\\"coursesources\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/course-source.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"CourseSource\\\",\\\"exportName\\\":\\\"CourseSourceCollection\\\",\\\"collectionExportName\\\":\\\"CourseSourceCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"course_sources\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"course_sources\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"key\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"name\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"kind\\\\\\\" TEXT DEFAULT 'adapter',\\\\n \\\\\\\"adapter_key\\\\\\\" TEXT,\\\\n \\\\\\\"config\\\\\\\" TEXT,\\\\n \\\\\\\"sharing\\\\\\\" TEXT DEFAULT 'private'\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"adapter\\\"},\\\"adapter_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"config\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"sharing\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"private\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"course_sources_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"course_sources_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"98177eb3\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:FamilyIntake\\\":{\\\"name\\\":\\\"familyintake\\\",\\\"className\\\":\\\"FamilyIntake\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:FamilyIntake\\\",\\\"collection\\\":\\\"familyintakes\\\",\\\"description\\\":\\\"Family-owned receipt, independent of learner attribution and ingestion expiry.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/family-intake-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"itemId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"actorUserId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"ownerProfileId\\\":{\\\"type\\\":\\\"crossPackageRef\\\",\\\"required\\\":false,\\\"related\\\":\\\"@happyvertical/smrt-profiles:Profile\\\"},\\\"contentDigest\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sourceJson\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"family_intakes\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"item_id\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"FamilyIntake\\\",\\\"collectionExportName\\\":\\\"FamilyIntakeCollection\\\",\\\"validationRules\\\":[],\\\"schema\\\":{\\\"tableName\\\":\\\"family_intakes\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"family_intakes\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"item_id\\\\\\\" TEXT,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"owner_profile_id\\\\\\\" UUID,\\\\n \\\\\\\"content_digest\\\\\\\" TEXT,\\\\n \\\\\\\"source_json\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"owner_profile_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"content_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"source_json\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"family_intakes_tenant_id_item_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"item_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"family_intakes_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"family_intakes_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"family_intakes_owner_profile_id_idx\\\",\\\"columns\\\":[\\\"owner_profile_id\\\"]}],\\\"version\\\":\\\"2577578b\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:FamilyIntakeCollection\\\":{\\\"name\\\":\\\"familyintakecollection\\\",\\\"className\\\":\\\"FamilyIntakeCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:FamilyIntakeCollection\\\",\\\"collection\\\":\\\"familyintakes\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/family-intake-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"family_intakes\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"FamilyIntake\\\",\\\"exportName\\\":\\\"FamilyIntakeCollection\\\",\\\"collectionExportName\\\":\\\"FamilyIntakeCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"family_intakes\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"family_intakes\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"item_id\\\\\\\" TEXT,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"owner_profile_id\\\\\\\" UUID,\\\\n \\\\\\\"content_digest\\\\\\\" TEXT,\\\\n \\\\\\\"source_json\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"owner_profile_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"content_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"source_json\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"family_intakes_tenant_id_item_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"item_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"family_intakes_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"family_intakes_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"family_intakes_owner_profile_id_idx\\\",\\\"columns\\\":[\\\"owner_profile_id\\\"]}],\\\"version\\\":\\\"2577578b\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:FamilyIntakeAsset\\\":{\\\"name\\\":\\\"familyintakeasset\\\",\\\"className\\\":\\\"FamilyIntakeAsset\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:FamilyIntakeAsset\\\",\\\"collection\\\":\\\"familyintakeassets\\\",\\\"description\\\":\\\"Sole family owner join; adoption borrows this exact immutable original.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/family-intake-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"intakeId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"FamilyIntake\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"assetId\\\":{\\\"type\\\":\\\"crossPackageRef\\\",\\\"required\\\":false,\\\"related\\\":\\\"@happyvertical/smrt-assets:Asset\\\"},\\\"name\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"mimeType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sha256\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"position\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"family_intake_assets\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"intake_id\\\",\\\"asset_id\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"FamilyIntakeAsset\\\",\\\"collectionExportName\\\":\\\"FamilyIntakeAssetCollection\\\",\\\"displayLabelField\\\":\\\"name\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"intakeId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"position\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"family_intake_assets\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"family_intake_assets\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"intake_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"asset_id\\\\\\\" UUID,\\\\n \\\\\\\"name\\\\\\\" TEXT,\\\\n \\\\\\\"mime_type\\\\\\\" TEXT,\\\\n \\\\\\\"sha256\\\\\\\" TEXT,\\\\n \\\\\\\"position\\\\\\\" INTEGER NOT NULL DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"intake_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"family_intakes\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"asset_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"mime_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"sha256\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"position\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"family_intake_assets_tenant_id_intake_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"intake_id\\\",\\\"asset_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"family_intake_assets_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"family_intake_assets_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"family_intake_assets_intake_id_idx\\\",\\\"columns\\\":[\\\"intake_id\\\"]},{\\\"name\\\":\\\"family_intake_assets_asset_id_idx\\\",\\\"columns\\\":[\\\"asset_id\\\"]}],\\\"version\\\":\\\"3811d126\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:FamilyIntakeAssetCollection\\\":{\\\"name\\\":\\\"familyintakeassetcollection\\\",\\\"className\\\":\\\"FamilyIntakeAssetCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:FamilyIntakeAssetCollection\\\",\\\"collection\\\":\\\"familyintakeassets\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/family-intake-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"family_intake_assets\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"FamilyIntakeAsset\\\",\\\"exportName\\\":\\\"FamilyIntakeAssetCollection\\\",\\\"collectionExportName\\\":\\\"FamilyIntakeAssetCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"family_intake_assets\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"family_intake_assets\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"intake_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"asset_id\\\\\\\" UUID,\\\\n \\\\\\\"name\\\\\\\" TEXT,\\\\n \\\\\\\"mime_type\\\\\\\" TEXT,\\\\n \\\\\\\"sha256\\\\\\\" TEXT,\\\\n \\\\\\\"position\\\\\\\" INTEGER NOT NULL DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"intake_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"family_intakes\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"asset_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"mime_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"sha256\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"position\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"family_intake_assets_tenant_id_intake_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"intake_id\\\",\\\"asset_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"family_intake_assets_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"family_intake_assets_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"family_intake_assets_intake_id_idx\\\",\\\"columns\\\":[\\\"intake_id\\\"]},{\\\"name\\\":\\\"family_intake_assets_asset_id_idx\\\",\\\"columns\\\":[\\\"asset_id\\\"]}],\\\"version\\\":\\\"3811d126\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:FamilyIntakeDecision\\\":{\\\"name\\\":\\\"familyintakedecision\\\",\\\"className\\\":\\\"FamilyIntakeDecision\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:FamilyIntakeDecision\\\",\\\"collection\\\":\\\"familyintakedecisions\\\",\\\"description\\\":\\\"Append-only attribution/adoption audit; no marks or learning outcomes.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/family-intake-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"intakeId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"FamilyIntake\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"requestKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sequence\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"actorUserId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"bodyJson\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"family_intake_decisions\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"intake_id\\\",\\\"request_key\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"FamilyIntakeDecision\\\",\\\"collectionExportName\\\":\\\"FamilyIntakeDecisionCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"intakeId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"sequence\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"family_intake_decisions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"family_intake_decisions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"intake_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_key\\\\\\\" TEXT,\\\\n \\\\\\\"sequence\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"body_json\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"intake_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"family_intakes\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"request_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"sequence\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"body_json\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"family_intake_decisions_tenant_id_intake_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"intake_id\\\",\\\"request_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"family_intake_decisions_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"family_intake_decisions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"family_intake_decisions_intake_id_idx\\\",\\\"columns\\\":[\\\"intake_id\\\"]}],\\\"version\\\":\\\"08875c81\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:FamilyIntakeDecisionCollection\\\":{\\\"name\\\":\\\"familyintakedecisioncollection\\\",\\\"className\\\":\\\"FamilyIntakeDecisionCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:FamilyIntakeDecisionCollection\\\",\\\"collection\\\":\\\"familyintakedecisions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/family-intake-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"family_intake_decisions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"FamilyIntakeDecision\\\",\\\"exportName\\\":\\\"FamilyIntakeDecisionCollection\\\",\\\"collectionExportName\\\":\\\"FamilyIntakeDecisionCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"family_intake_decisions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"family_intake_decisions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"intake_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_key\\\\\\\" TEXT,\\\\n \\\\\\\"sequence\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"body_json\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"intake_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"family_intakes\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"request_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"sequence\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"body_json\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"family_intake_decisions_tenant_id_intake_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"intake_id\\\",\\\"request_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"family_intake_decisions_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"family_intake_decisions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"family_intake_decisions_intake_id_idx\\\",\\\"columns\\\":[\\\"intake_id\\\"]}],\\\"version\\\":\\\"08875c81\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:Learner\\\":{\\\"name\\\":\\\"learner\\\",\\\"className\\\":\\\"Learner\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:Learner\\\",\\\"collection\\\":\\\"learners\\\",\\\"description\\\":\\\"A learner is a real user/profile identity with active family membership.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/learners.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"userId\\\":{\\\"type\\\":\\\"crossPackageRef\\\",\\\"required\\\":true,\\\"related\\\":\\\"@happyvertical/smrt-users:User\\\"},\\\"profileId\\\":{\\\"type\\\":\\\"crossPackageRef\\\",\\\"required\\\":true,\\\"related\\\":\\\"@happyvertical/smrt-profiles:Profile\\\"},\\\"displayName\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"birthDate\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"level\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"settings\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"getSettings\\\":{\\\"name\\\":\\\"getSettings\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Record<string, unknown>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setSettings\\\":{\\\"name\\\":\\\"setSettings\\\",\\\"async\\\":false,\\\"parameters\\\":[{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"Record<string, unknown>\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"Learner\\\",\\\"collectionExportName\\\":\\\"LearnerCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"userId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"crossPackageRef\\\"},{\\\"field\\\":\\\"profileId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"crossPackageRef\\\"},{\\\"field\\\":\\\"level\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"learners\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"learners\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"user_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"profile_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"display_name\\\\\\\" TEXT,\\\\n \\\\\\\"birth_date\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"level\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"settings\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"user_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"profile_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"display_name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"birth_date\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"level\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"settings\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"learners_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"learners_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"learners_user_id_idx\\\",\\\"columns\\\":[\\\"user_id\\\"]},{\\\"name\\\":\\\"learners_profile_id_idx\\\",\\\"columns\\\":[\\\"profile_id\\\"]}],\\\"version\\\":\\\"ca9907b5\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:Curriculum\\\":{\\\"name\\\":\\\"curriculum\\\",\\\"className\\\":\\\"Curriculum\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:Curriculum\\\",\\\"collection\\\":\\\"curriculums\\\",\\\"description\\\":\\\"A distinct plan retains its own enrollment history.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/learners.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"startsOn\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"endsOn\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"planned\\\",\\\"enum\\\":[\\\"planned\\\",\\\"active\\\",\\\"completed\\\",\\\"archived\\\"]}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tableName\\\":\\\"curricula\\\",\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"Curriculum\\\",\\\"collectionExportName\\\":\\\"CurriculumCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"title\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"curricula\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"curricula\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"title\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"starts_on\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"ends_on\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'planned'\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"starts_on\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"ends_on\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"planned\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"curricula_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"curricula_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"curricula_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]}],\\\"version\\\":\\\"b7e90cbd\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:Enrollment\\\":{\\\"name\\\":\\\"enrollment\\\",\\\"className\\\":\\\"Enrollment\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:Enrollment\\\",\\\"collection\\\":\\\"enrollments\\\",\\\"description\\\":\\\"One course in one curriculum; a new curriculum means a new enrollment.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/learners.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"curriculumId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Curriculum\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"courseId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Course\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"planned\\\",\\\"enum\\\":[\\\"planned\\\",\\\"active\\\",\\\"paused\\\",\\\"completed\\\",\\\"dropped\\\"]},\\\"startedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"completedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"targetMinutesPerWeek\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"curriculum_id\\\",\\\"course_id\\\"],\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"Enrollment\\\",\\\"collectionExportName\\\":\\\"EnrollmentCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"curriculumId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"courseId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"targetMinutesPerWeek\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"sortOrder\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"enrollments\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"enrollments\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"curriculum_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"course_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'planned',\\\\n \\\\\\\"started_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"completed_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"target_minutes_per_week\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER NOT NULL DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"curriculum_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"curricula\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"course_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"courses\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"planned\\\"},\\\"started_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"completed_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"target_minutes_per_week\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"enrollments_tenant_id_curriculum_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"curriculum_id\\\",\\\"course_id\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"enrollments_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"enrollments_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"enrollments_curriculum_id_idx\\\",\\\"columns\\\":[\\\"curriculum_id\\\"]},{\\\"name\\\":\\\"enrollments_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"enrollments_course_id_idx\\\",\\\"columns\\\":[\\\"course_id\\\"]}],\\\"version\\\":\\\"2a34b5ee\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:LessonProgress\\\":{\\\"name\\\":\\\"lessonprogress\\\",\\\"className\\\":\\\"LessonProgress\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:LessonProgress\\\",\\\"collection\\\":\\\"lessonprogresses\\\",\\\"description\\\":\\\"Progress identity is enrollment + lesson, never learner + lesson.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/learners.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"enrollmentId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Enrollment\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"lessonId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Lesson\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"not_started\\\",\\\"enum\\\":[\\\"not_started\\\",\\\"in_progress\\\",\\\"submitted\\\",\\\"needs_review\\\",\\\"complete\\\",\\\"skipped\\\"]},\\\"startedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"completedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"timeSpentSeconds\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"attempts\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"bestScore\\\":{\\\"type\\\":\\\"decimal\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"nullable\\\":true}}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tableName\\\":\\\"lesson_progress\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"enrollment_id\\\",\\\"lesson_id\\\"],\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"LessonProgress\\\",\\\"collectionExportName\\\":\\\"LessonProgressCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"enrollmentId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"lessonId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"timeSpentSeconds\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"attempts\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"lesson_progress\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lesson_progress\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"enrollment_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'not_started',\\\\n \\\\\\\"started_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"completed_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"time_spent_seconds\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"attempts\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"best_score\\\\\\\" REAL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"enrollment_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"enrollments\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"not_started\\\"},\\\"started_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"completed_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"time_spent_seconds\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"attempts\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"best_score\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"lesson_progress_tenant_id_enrollment_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"enrollment_id\\\",\\\"lesson_id\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"lesson_progress_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"lesson_progress_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lesson_progress_enrollment_id_idx\\\",\\\"columns\\\":[\\\"enrollment_id\\\"]},{\\\"name\\\":\\\"lesson_progress_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"lesson_progress_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]}],\\\"version\\\":\\\"36704fbd\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:LessonAsset\\\":{\\\"name\\\":\\\"lessonasset\\\",\\\"className\\\":\\\"LessonAsset\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:LessonAsset\\\",\\\"collection\\\":\\\"lessonassets\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/lesson-assets.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true,\\\"mode\\\":\\\"optional\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"lessonId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Lesson\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"assetId\\\":{\\\"type\\\":\\\"crossPackageRef\\\",\\\"required\\\":true,\\\"related\\\":\\\"@happyvertical/smrt-assets:Asset\\\"},\\\"relationship\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"attachment\\\",\\\"_meta\\\":{\\\"required\\\":true},\\\"enum\\\":[\\\"printable\\\",\\\"answer-key\\\",\\\"video\\\",\\\"attachment\\\"]},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"lesson_assets\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"lesson_id\\\",\\\"asset_id\\\",\\\"relationship\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"optional\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"LessonAsset\\\",\\\"collectionExportName\\\":\\\"LessonAssetCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"lessonId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"assetId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"crossPackageRef\\\"},{\\\"field\\\":\\\"relationship\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"sortOrder\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"lesson_assets\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lesson_assets\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"asset_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"relationship\\\\\\\" TEXT NOT NULL DEFAULT 'attachment',\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER NOT NULL DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"asset_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"relationship\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"attachment\\\"},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"lesson_assets_tenant_id_lesson_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"lesson_id\\\",\\\"asset_id\\\",\\\"relationship\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"lesson_assets_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"lesson_assets_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lesson_assets_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]},{\\\"name\\\":\\\"lesson_assets_asset_id_idx\\\",\\\"columns\\\":[\\\"asset_id\\\"]}],\\\"version\\\":\\\"d96385c6\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:Submission\\\":{\\\"name\\\":\\\"submission\\\",\\\"className\\\":\\\"Submission\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:Submission\\\",\\\"collection\\\":\\\"submissions\\\",\\\"description\\\":\\\"Evidence that a learner completed one progress item.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/submissions.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"lessonId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Lesson\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"progressId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"LessonProgress\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"submittedAt\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"captured\\\",\\\"enum\\\":[\\\"captured\\\",\\\"extracting\\\",\\\"needs_review\\\",\\\"graded\\\",\\\"rejected\\\"]},\\\"notes\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"captureKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"captureDigest\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"completed_work\\\",\\\"_meta\\\":{\\\"required\\\":true},\\\"enum\\\":[\\\"blank_reference\\\",\\\"completed_work\\\"]},\\\"previousSubmissionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"Submission\\\",\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"intakeItemId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"nullable\\\":true}}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableStrategy\\\":\\\"sti\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"Submission\\\",\\\"collectionExportName\\\":\\\"SubmissionCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"lessonId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"progressId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"kind\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"submissions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"learner_id\\\\\\\" UUID,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID,\\\\n \\\\\\\"progress_id\\\\\\\" UUID,\\\\n \\\\\\\"submitted_at\\\\\\\" TEXT,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'captured',\\\\n \\\\\\\"notes\\\\\\\" TEXT,\\\\n \\\\\\\"capture_key\\\\\\\" TEXT,\\\\n \\\\\\\"capture_digest\\\\\\\" TEXT,\\\\n \\\\\\\"kind\\\\\\\" TEXT DEFAULT 'completed_work',\\\\n \\\\\\\"previous_submission_id\\\\\\\" UUID,\\\\n \\\\\\\"intake_item_id\\\\\\\" TEXT,\\\\n \\\\\\\"page_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"ocr_text\\\\\\\" TEXT,\\\\n \\\\\\\"extracted\\\\\\\" TEXT,\\\\n \\\\\\\"reported_by\\\\\\\" TEXT DEFAULT 'learner',\\\\n \\\\\\\"evidence_url\\\\\\\" TEXT,\\\\n \\\\\\\"reported_score\\\\\\\" REAL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"progress_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lesson_progress\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"submitted_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"captured\\\"},\\\"notes\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"completed_work\\\"},\\\"previous_submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"intake_item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"page_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"ocr_text\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"extracted\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"learner\\\"},\\\"evidence_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_score\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"submissions_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"submissions_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"submissions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"submissions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"submissions_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]},{\\\"name\\\":\\\"submissions_progress_id_idx\\\",\\\"columns\\\":[\\\"progress_id\\\"]},{\\\"name\\\":\\\"submissions_previous_submission_id_idx\\\",\\\"columns\\\":[\\\"previous_submission_id\\\"]}],\\\"version\\\":\\\"27a21ab4\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:SubmissionIntakeBinding\\\":{\\\"name\\\":\\\"submissionintakebinding\\\",\\\"className\\\":\\\"SubmissionIntakeBinding\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:SubmissionIntakeBinding\\\",\\\"collection\\\":\\\"submissionintakebindings\\\",\\\"description\\\":\\\"Durable tenant/item claim for trusted ingestion receipts. This separate table keeps ordinary uploads (which have no intake item) out of the uniqueness key.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/submissions.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"intakeItemId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"submissionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Submission\\\",\\\"_meta\\\":{\\\"required\\\":true}}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"submission_intake_bindings\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"intake_item_id\\\"],\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"SubmissionIntakeBinding\\\",\\\"collectionExportName\\\":\\\"SubmissionIntakeBindingCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"intakeItemId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"submissionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"submission_intake_bindings\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"submission_intake_bindings\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"intake_item_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"submission_id\\\\\\\" UUID NOT NULL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"intake_item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}}},\\\"indexes\\\":[{\\\"name\\\":\\\"submission_intake_bindings_tenant_id_intake_item_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"intake_item_id\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"submission_intake_bindings_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"submission_intake_bindings_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"submission_intake_bindings_submission_id_idx\\\",\\\"columns\\\":[\\\"submission_id\\\"]}],\\\"version\\\":\\\"7102c909\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:ScannedSubmission\\\":{\\\"name\\\":\\\"scannedsubmission\\\",\\\"className\\\":\\\"ScannedSubmission\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:ScannedSubmission\\\",\\\"collection\\\":\\\"submissions\\\",\\\"description\\\":\\\"Photos or scans of work submitted for review.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/submissions.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"lessonId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Lesson\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"progressId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"LessonProgress\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"submittedAt\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"captured\\\",\\\"enum\\\":[\\\"captured\\\",\\\"extracting\\\",\\\"needs_review\\\",\\\"graded\\\",\\\"rejected\\\"]},\\\"notes\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"captureKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"captureDigest\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"completed_work\\\",\\\"_meta\\\":{\\\"required\\\":true},\\\"enum\\\":[\\\"blank_reference\\\",\\\"completed_work\\\"]},\\\"previousSubmissionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"Submission\\\",\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"intakeItemId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"pageCount\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"ocrText\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"extracted\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getExtracted\\\":{\\\"name\\\":\\\"getExtracted\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Record<string, unknown>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setExtracted\\\":{\\\"name\\\":\\\"setExtracted\\\",\\\"async\\\":false,\\\"parameters\\\":[{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"Record<string, unknown>\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tableStrategy\\\":\\\"sti\\\"},\\\"extends\\\":\\\"Submission\\\",\\\"exportName\\\":\\\"ScannedSubmission\\\",\\\"collectionExportName\\\":\\\"ScannedSubmissionCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"lessonId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"progressId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"kind\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"pageCount\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"submissions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"learner_id\\\\\\\" UUID,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID,\\\\n \\\\\\\"progress_id\\\\\\\" UUID,\\\\n \\\\\\\"submitted_at\\\\\\\" TEXT,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'captured',\\\\n \\\\\\\"notes\\\\\\\" TEXT,\\\\n \\\\\\\"capture_key\\\\\\\" TEXT,\\\\n \\\\\\\"capture_digest\\\\\\\" TEXT,\\\\n \\\\\\\"kind\\\\\\\" TEXT DEFAULT 'completed_work',\\\\n \\\\\\\"previous_submission_id\\\\\\\" UUID,\\\\n \\\\\\\"intake_item_id\\\\\\\" TEXT,\\\\n \\\\\\\"page_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"ocr_text\\\\\\\" TEXT,\\\\n \\\\\\\"extracted\\\\\\\" TEXT,\\\\n \\\\\\\"reported_by\\\\\\\" TEXT DEFAULT 'learner',\\\\n \\\\\\\"evidence_url\\\\\\\" TEXT,\\\\n \\\\\\\"reported_score\\\\\\\" REAL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"progress_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lesson_progress\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"submitted_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"captured\\\"},\\\"notes\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"completed_work\\\"},\\\"previous_submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"intake_item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"page_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"ocr_text\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"extracted\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"learner\\\"},\\\"evidence_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_score\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"submissions_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"submissions_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"submissions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"submissions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"submissions_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]},{\\\"name\\\":\\\"submissions_progress_id_idx\\\",\\\"columns\\\":[\\\"progress_id\\\"]},{\\\"name\\\":\\\"submissions_previous_submission_id_idx\\\",\\\"columns\\\":[\\\"previous_submission_id\\\"]}],\\\"version\\\":\\\"7c394510\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:ExternalCompletion\\\":{\\\"name\\\":\\\"externalcompletion\\\",\\\"className\\\":\\\"ExternalCompletion\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:ExternalCompletion\\\",\\\"collection\\\":\\\"submissions\\\",\\\"description\\\":\\\"Completion reported by the learner, guardian, or external source.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/submissions.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"lessonId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Lesson\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"progressId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"LessonProgress\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"submittedAt\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"captured\\\",\\\"enum\\\":[\\\"captured\\\",\\\"extracting\\\",\\\"needs_review\\\",\\\"graded\\\",\\\"rejected\\\"]},\\\"notes\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"captureKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"captureDigest\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"completed_work\\\",\\\"_meta\\\":{\\\"required\\\":true},\\\"enum\\\":[\\\"blank_reference\\\",\\\"completed_work\\\"]},\\\"previousSubmissionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"Submission\\\",\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"intakeItemId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"reportedBy\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"learner\\\",\\\"enum\\\":[\\\"learner\\\",\\\"guardian\\\",\\\"source\\\"]},\\\"evidenceUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"reportedScore\\\":{\\\"type\\\":\\\"decimal\\\",\\\"required\\\":false,\\\"_meta\\\":{}}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tableStrategy\\\":\\\"sti\\\"},\\\"extends\\\":\\\"Submission\\\",\\\"exportName\\\":\\\"ExternalCompletion\\\",\\\"collectionExportName\\\":\\\"ExternalCompletionCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"lessonId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"progressId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"kind\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"submissions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"learner_id\\\\\\\" UUID,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID,\\\\n \\\\\\\"progress_id\\\\\\\" UUID,\\\\n \\\\\\\"submitted_at\\\\\\\" TEXT,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'captured',\\\\n \\\\\\\"notes\\\\\\\" TEXT,\\\\n \\\\\\\"capture_key\\\\\\\" TEXT,\\\\n \\\\\\\"capture_digest\\\\\\\" TEXT,\\\\n \\\\\\\"kind\\\\\\\" TEXT DEFAULT 'completed_work',\\\\n \\\\\\\"previous_submission_id\\\\\\\" UUID,\\\\n \\\\\\\"intake_item_id\\\\\\\" TEXT,\\\\n \\\\\\\"page_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"ocr_text\\\\\\\" TEXT,\\\\n \\\\\\\"extracted\\\\\\\" TEXT,\\\\n \\\\\\\"reported_by\\\\\\\" TEXT DEFAULT 'learner',\\\\n \\\\\\\"evidence_url\\\\\\\" TEXT,\\\\n \\\\\\\"reported_score\\\\\\\" REAL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"progress_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lesson_progress\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"submitted_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"captured\\\"},\\\"notes\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"completed_work\\\"},\\\"previous_submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"intake_item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"page_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"ocr_text\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"extracted\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"learner\\\"},\\\"evidence_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_score\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"submissions_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"submissions_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"submissions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"submissions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"submissions_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]},{\\\"name\\\":\\\"submissions_progress_id_idx\\\",\\\"columns\\\":[\\\"progress_id\\\"]},{\\\"name\\\":\\\"submissions_previous_submission_id_idx\\\",\\\"columns\\\":[\\\"previous_submission_id\\\"]}],\\\"version\\\":\\\"eff3715d\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:Attestation\\\":{\\\"name\\\":\\\"attestation\\\",\\\"className\\\":\\\"Attestation\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:Attestation\\\",\\\"collection\\\":\\\"submissions\\\",\\\"description\\\":\\\"A guardian's statement that work was completed.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/submissions.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"lessonId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Lesson\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"progressId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"LessonProgress\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"submittedAt\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"captured\\\",\\\"enum\\\":[\\\"captured\\\",\\\"extracting\\\",\\\"needs_review\\\",\\\"graded\\\",\\\"rejected\\\"]},\\\"notes\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"captureKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"captureDigest\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"completed_work\\\",\\\"_meta\\\":{\\\"required\\\":true},\\\"enum\\\":[\\\"blank_reference\\\",\\\"completed_work\\\"]},\\\"previousSubmissionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"Submission\\\",\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"intakeItemId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"nullable\\\":true}}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tableStrategy\\\":\\\"sti\\\"},\\\"extends\\\":\\\"Submission\\\",\\\"exportName\\\":\\\"Attestation\\\",\\\"collectionExportName\\\":\\\"AttestationCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"lessonId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"progressId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"kind\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"submissions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"learner_id\\\\\\\" UUID,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID,\\\\n \\\\\\\"progress_id\\\\\\\" UUID,\\\\n \\\\\\\"submitted_at\\\\\\\" TEXT,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'captured',\\\\n \\\\\\\"notes\\\\\\\" TEXT,\\\\n \\\\\\\"capture_key\\\\\\\" TEXT,\\\\n \\\\\\\"capture_digest\\\\\\\" TEXT,\\\\n \\\\\\\"kind\\\\\\\" TEXT DEFAULT 'completed_work',\\\\n \\\\\\\"previous_submission_id\\\\\\\" UUID,\\\\n \\\\\\\"intake_item_id\\\\\\\" TEXT,\\\\n \\\\\\\"page_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"ocr_text\\\\\\\" TEXT,\\\\n \\\\\\\"extracted\\\\\\\" TEXT,\\\\n \\\\\\\"reported_by\\\\\\\" TEXT DEFAULT 'learner',\\\\n \\\\\\\"evidence_url\\\\\\\" TEXT,\\\\n \\\\\\\"reported_score\\\\\\\" REAL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"progress_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lesson_progress\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"submitted_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"captured\\\"},\\\"notes\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"completed_work\\\"},\\\"previous_submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"intake_item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"page_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"ocr_text\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"extracted\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"learner\\\"},\\\"evidence_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_score\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"submissions_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"submissions_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"submissions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"submissions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"submissions_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]},{\\\"name\\\":\\\"submissions_progress_id_idx\\\",\\\"columns\\\":[\\\"progress_id\\\"]},{\\\"name\\\":\\\"submissions_previous_submission_id_idx\\\",\\\"columns\\\":[\\\"previous_submission_id\\\"]}],\\\"version\\\":\\\"4f3230a3\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:SubmissionAsset\\\":{\\\"name\\\":\\\"submissionasset\\\",\\\"className\\\":\\\"SubmissionAsset\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:SubmissionAsset\\\",\\\"collection\\\":\\\"submissionassets\\\",\\\"description\\\":\\\"The tenant-owned files attached to a submission.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/submissions.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"submissionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Submission\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"assetId\\\":{\\\"type\\\":\\\"crossPackageRef\\\",\\\"required\\\":true,\\\"related\\\":\\\"@happyvertical/smrt-assets:Asset\\\"},\\\"relationship\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"page\\\",\\\"_meta\\\":{\\\"required\\\":true},\\\"enum\\\":[\\\"page\\\",\\\"attachment\\\"]},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"submission_assets\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"submission_id\\\",\\\"asset_id\\\",\\\"relationship\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"SubmissionAsset\\\",\\\"collectionExportName\\\":\\\"SubmissionAssetCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"submissionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"assetId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"crossPackageRef\\\"},{\\\"field\\\":\\\"relationship\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"sortOrder\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"submission_assets\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"submission_assets\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"submission_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"asset_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"relationship\\\\\\\" TEXT NOT NULL DEFAULT 'page',\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER NOT NULL DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"asset_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"relationship\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"page\\\"},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"submission_assets_tenant_id_submission_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"submission_id\\\",\\\"asset_id\\\",\\\"relationship\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"submission_assets_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"submission_assets_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"submission_assets_submission_id_idx\\\",\\\"columns\\\":[\\\"submission_id\\\"]},{\\\"name\\\":\\\"submission_assets_asset_id_idx\\\",\\\"columns\\\":[\\\"asset_id\\\"]}],\\\"version\\\":\\\"d9b61c8a\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:Grade\\\":{\\\"name\\\":\\\"grade\\\",\\\"className\\\":\\\"Grade\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:Grade\\\",\\\"collection\\\":\\\"grades\\\",\\\"description\\\":\\\"An assessment of a submission; the service selects the authoritative grade.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/submissions.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"submissionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Submission\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"graderKind\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"auto\\\",\\\"_meta\\\":{\\\"required\\\":true},\\\"enum\\\":[\\\"auto\\\",\\\"ai\\\",\\\"guardian\\\",\\\"instructor\\\"]},\\\"graderProfileId\\\":{\\\"type\\\":\\\"crossPackageRef\\\",\\\"required\\\":false,\\\"related\\\":\\\"@happyvertical/smrt-profiles:Profile\\\",\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"score\\\":{\\\"type\\\":\\\"decimal\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"pointsEarned\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"pointsPossible\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"rubricResults\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"feedback\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"gradedAt\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"getRubricResults\\\":{\\\"name\\\":\\\"getRubricResults\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Record<string, unknown>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setRubricResults\\\":{\\\"name\\\":\\\"setRubricResults\\\",\\\"async\\\":false,\\\"parameters\\\":[{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"Record<string, unknown>\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"Grade\\\",\\\"collectionExportName\\\":\\\"GradeCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"submissionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"graderKind\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"grades\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"grades\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"submission_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"grader_kind\\\\\\\" TEXT NOT NULL DEFAULT 'auto',\\\\n \\\\\\\"grader_profile_id\\\\\\\" UUID,\\\\n \\\\\\\"score\\\\\\\" REAL,\\\\n \\\\\\\"points_earned\\\\\\\" INTEGER,\\\\n \\\\\\\"points_possible\\\\\\\" INTEGER,\\\\n \\\\\\\"rubric_results\\\\\\\" TEXT,\\\\n \\\\\\\"feedback\\\\\\\" TEXT,\\\\n \\\\\\\"graded_at\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"grader_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"auto\\\"},\\\"grader_profile_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"score\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"points_earned\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"points_possible\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"rubric_results\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"feedback\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"graded_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"grades_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"grades_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"grades_submission_id_idx\\\",\\\"columns\\\":[\\\"submission_id\\\"]},{\\\"name\\\":\\\"grades_grader_profile_id_idx\\\",\\\"columns\\\":[\\\"grader_profile_id\\\"]}],\\\"version\\\":\\\"7d629fec\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:Workbook\\\":{\\\"name\\\":\\\"workbook\\\",\\\"className\\\":\\\"Workbook\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:Workbook\\\",\\\"collection\\\":\\\"workbooks\\\",\\\"description\\\":\\\"Education-owned private workbook record. Mutations go through WorkbookService.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"workbookKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"edition\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"reviewRequired\\\":{\\\"type\\\":\\\"boolean\\\",\\\"required\\\":true,\\\"default\\\":true},\\\"policyVersion\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":1}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbooks\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"learner_id\\\",\\\"workbook_key\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"Workbook\\\",\\\"collectionExportName\\\":\\\"WorkbookCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"reviewRequired\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"boolean\\\"},{\\\"field\\\":\\\"policyVersion\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"workbooks\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbooks\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"workbook_key\\\\\\\" TEXT,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"edition\\\\\\\" TEXT,\\\\n \\\\\\\"review_required\\\\\\\" BOOLEAN NOT NULL DEFAULT TRUE,\\\\n \\\\\\\"policy_version\\\\\\\" INTEGER NOT NULL DEFAULT 1\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"workbook_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"edition\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"review_required\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":true},\\\"policy_version\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":1}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbooks_tenant_id_learner_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"learner_id\\\",\\\"workbook_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbooks_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbooks_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbooks_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]}],\\\"version\\\":\\\"a5b56a39\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookCollection\\\":{\\\"name\\\":\\\"workbookcollection\\\",\\\"className\\\":\\\"WorkbookCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookCollection\\\",\\\"collection\\\":\\\"workbooks\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbooks\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Workbook\\\",\\\"exportName\\\":\\\"WorkbookCollection\\\",\\\"collectionExportName\\\":\\\"WorkbookCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"workbooks\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbooks\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"workbook_key\\\\\\\" TEXT,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"edition\\\\\\\" TEXT,\\\\n \\\\\\\"review_required\\\\\\\" BOOLEAN NOT NULL DEFAULT TRUE,\\\\n \\\\\\\"policy_version\\\\\\\" INTEGER NOT NULL DEFAULT 1\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"workbook_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"edition\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"review_required\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":true},\\\"policy_version\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":1}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbooks_tenant_id_learner_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"learner_id\\\",\\\"workbook_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbooks_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbooks_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbooks_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]}],\\\"version\\\":\\\"a5b56a39\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookActivity\\\":{\\\"name\\\":\\\"workbookactivity\\\",\\\"className\\\":\\\"WorkbookActivity\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookActivity\\\",\\\"collection\\\":\\\"workbookactivities\\\",\\\"description\\\":\\\"Education-owned private workbook record. Mutations go through WorkbookService.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"workbookId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"Workbook\\\",\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"captureKind\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"identified\\\",\\\"_meta\\\":{\\\"required\\\":true,\\\"default\\\":\\\"identified\\\"}},\\\"photoIntakeId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"WorkbookPhotoIntake\\\",\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"enrollmentId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Enrollment\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"lessonId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Lesson\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"pageKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"pageLabel\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_activities\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"workbook_id\\\",\\\"page_key\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"WorkbookActivity\\\",\\\"collectionExportName\\\":\\\"WorkbookActivityCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"captureKind\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"enrollmentId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"lessonId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_activities\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_activities\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"workbook_id\\\\\\\" UUID,\\\\n \\\\\\\"capture_kind\\\\\\\" TEXT NOT NULL DEFAULT 'identified',\\\\n \\\\\\\"photo_intake_id\\\\\\\" UUID,\\\\n \\\\\\\"enrollment_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"page_key\\\\\\\" TEXT,\\\\n \\\\\\\"page_label\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"workbook_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbooks\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"capture_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"identified\\\"},\\\"photo_intake_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_photo_intakes\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"enrollment_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"enrollments\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"page_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"page_label\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_activities_tenant_id_workbook_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"workbook_id\\\",\\\"page_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_activities_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_activities_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_activities_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_activities_workbook_id_idx\\\",\\\"columns\\\":[\\\"workbook_id\\\"]},{\\\"name\\\":\\\"workbook_activities_photo_intake_id_idx\\\",\\\"columns\\\":[\\\"photo_intake_id\\\"]},{\\\"name\\\":\\\"workbook_activities_enrollment_id_idx\\\",\\\"columns\\\":[\\\"enrollment_id\\\"]},{\\\"name\\\":\\\"workbook_activities_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]}],\\\"version\\\":\\\"320c8eb0\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookActivityCollection\\\":{\\\"name\\\":\\\"workbookactivitycollection\\\",\\\"className\\\":\\\"WorkbookActivityCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookActivityCollection\\\",\\\"collection\\\":\\\"workbookactivities\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_activities\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"WorkbookActivity\\\",\\\"exportName\\\":\\\"WorkbookActivityCollection\\\",\\\"collectionExportName\\\":\\\"WorkbookActivityCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_activities\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_activities\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"workbook_id\\\\\\\" UUID,\\\\n \\\\\\\"capture_kind\\\\\\\" TEXT NOT NULL DEFAULT 'identified',\\\\n \\\\\\\"photo_intake_id\\\\\\\" UUID,\\\\n \\\\\\\"enrollment_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"page_key\\\\\\\" TEXT,\\\\n \\\\\\\"page_label\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"workbook_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbooks\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"capture_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"identified\\\"},\\\"photo_intake_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_photo_intakes\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"enrollment_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"enrollments\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"page_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"page_label\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_activities_tenant_id_workbook_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"workbook_id\\\",\\\"page_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_activities_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_activities_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_activities_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_activities_workbook_id_idx\\\",\\\"columns\\\":[\\\"workbook_id\\\"]},{\\\"name\\\":\\\"workbook_activities_photo_intake_id_idx\\\",\\\"columns\\\":[\\\"photo_intake_id\\\"]},{\\\"name\\\":\\\"workbook_activities_enrollment_id_idx\\\",\\\"columns\\\":[\\\"enrollment_id\\\"]},{\\\"name\\\":\\\"workbook_activities_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]}],\\\"version\\\":\\\"320c8eb0\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookWorkFiling\\\":{\\\"name\\\":\\\"workbookworkfiling\\\",\\\"className\\\":\\\"WorkbookWorkFiling\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookWorkFiling\\\",\\\"collection\\\":\\\"workbookworkfilings\\\",\\\"description\\\":\\\"Append-only association; the source work unit and its routing never move.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"sourceActivityId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"WorkbookActivity\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"workbookId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Workbook\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"canonicalActivityId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"WorkbookActivity\\\",\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"previousRevisionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"WorkbookWorkFiling\\\",\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"actorUserId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"requestKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"reason\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"digest\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_work_filings\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"source_activity_id\\\",\\\"request_key\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"WorkbookWorkFiling\\\",\\\"collectionExportName\\\":\\\"WorkbookWorkFilingCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"sourceActivityId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"workbookId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_work_filings\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_work_filings\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"source_activity_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"workbook_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"canonical_activity_id\\\\\\\" UUID,\\\\n \\\\\\\"previous_revision_id\\\\\\\" UUID,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"request_key\\\\\\\" TEXT,\\\\n \\\\\\\"reason\\\\\\\" TEXT,\\\\n \\\\\\\"digest\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"source_activity_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_activities\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"workbook_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbooks\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"canonical_activity_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_activities\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"previous_revision_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_work_filings\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"request_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"reason\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_work_filings_tenant_id_source_activity_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"source_activity_id\\\",\\\"request_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_work_filings_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_work_filings_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_work_filings_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_work_filings_source_activity_id_idx\\\",\\\"columns\\\":[\\\"source_activity_id\\\"]},{\\\"name\\\":\\\"workbook_work_filings_workbook_id_idx\\\",\\\"columns\\\":[\\\"workbook_id\\\"]},{\\\"name\\\":\\\"workbook_work_filings_canonical_activity_id_idx\\\",\\\"columns\\\":[\\\"canonical_activity_id\\\"]},{\\\"name\\\":\\\"workbook_work_filings_previous_revision_id_idx\\\",\\\"columns\\\":[\\\"previous_revision_id\\\"]}],\\\"version\\\":\\\"03e989a0\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookWorkFilingCollection\\\":{\\\"name\\\":\\\"workbookworkfilingcollection\\\",\\\"className\\\":\\\"WorkbookWorkFilingCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookWorkFilingCollection\\\",\\\"collection\\\":\\\"workbookworkfilings\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_work_filings\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"WorkbookWorkFiling\\\",\\\"exportName\\\":\\\"WorkbookWorkFilingCollection\\\",\\\"collectionExportName\\\":\\\"WorkbookWorkFilingCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_work_filings\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_work_filings\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"source_activity_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"workbook_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"canonical_activity_id\\\\\\\" UUID,\\\\n \\\\\\\"previous_revision_id\\\\\\\" UUID,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"request_key\\\\\\\" TEXT,\\\\n \\\\\\\"reason\\\\\\\" TEXT,\\\\n \\\\\\\"digest\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"source_activity_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_activities\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"workbook_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbooks\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"canonical_activity_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_activities\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"previous_revision_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_work_filings\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"request_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"reason\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_work_filings_tenant_id_source_activity_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"source_activity_id\\\",\\\"request_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_work_filings_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_work_filings_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_work_filings_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_work_filings_source_activity_id_idx\\\",\\\"columns\\\":[\\\"source_activity_id\\\"]},{\\\"name\\\":\\\"workbook_work_filings_workbook_id_idx\\\",\\\"columns\\\":[\\\"workbook_id\\\"]},{\\\"name\\\":\\\"workbook_work_filings_canonical_activity_id_idx\\\",\\\"columns\\\":[\\\"canonical_activity_id\\\"]},{\\\"name\\\":\\\"workbook_work_filings_previous_revision_id_idx\\\",\\\"columns\\\":[\\\"previous_revision_id\\\"]}],\\\"version\\\":\\\"03e989a0\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookAttempt\\\":{\\\"name\\\":\\\"workbookattempt\\\",\\\"className\\\":\\\"WorkbookAttempt\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookAttempt\\\",\\\"collection\\\":\\\"workbookattempts\\\",\\\"description\\\":\\\"Education-owned private workbook record. Mutations go through WorkbookService.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"activityId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"WorkbookActivity\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"submissionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Submission\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"previousAttemptId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"WorkbookAttempt\\\",\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"capturedAt\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"episodeId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"reviewRequired\\\":{\\\"type\\\":\\\"boolean\\\",\\\"required\\\":true,\\\"default\\\":true},\\\"policyVersion\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":1},\\\"assistance\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"actorUserId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sourceHashes\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}}},\\\"methods\\\":{\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_attempts\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"submission_id\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"WorkbookAttempt\\\",\\\"collectionExportName\\\":\\\"WorkbookAttemptCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"activityId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"submissionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"reviewRequired\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"boolean\\\"},{\\\"field\\\":\\\"policyVersion\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_attempts\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_attempts\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"activity_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"submission_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"previous_attempt_id\\\\\\\" UUID,\\\\n \\\\\\\"captured_at\\\\\\\" TEXT,\\\\n \\\\\\\"episode_id\\\\\\\" TEXT,\\\\n \\\\\\\"review_required\\\\\\\" BOOLEAN NOT NULL DEFAULT TRUE,\\\\n \\\\\\\"policy_version\\\\\\\" INTEGER NOT NULL DEFAULT 1,\\\\n \\\\\\\"assistance\\\\\\\" TEXT,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"source_hashes\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"activity_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_activities\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"previous_attempt_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_attempts\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"captured_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"episode_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"review_required\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":true},\\\"policy_version\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":1},\\\"assistance\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"source_hashes\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_attempts_tenant_id_submission_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"submission_id\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"workbook_attempts_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_attempts_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_attempts_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_attempts_activity_id_idx\\\",\\\"columns\\\":[\\\"activity_id\\\"]},{\\\"name\\\":\\\"workbook_attempts_submission_id_idx\\\",\\\"columns\\\":[\\\"submission_id\\\"]},{\\\"name\\\":\\\"workbook_attempts_previous_attempt_id_idx\\\",\\\"columns\\\":[\\\"previous_attempt_id\\\"]}],\\\"version\\\":\\\"bd9cdd9f\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookAttemptCollection\\\":{\\\"name\\\":\\\"workbookattemptcollection\\\",\\\"className\\\":\\\"WorkbookAttemptCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookAttemptCollection\\\",\\\"collection\\\":\\\"workbookattempts\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_attempts\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"WorkbookAttempt\\\",\\\"exportName\\\":\\\"WorkbookAttemptCollection\\\",\\\"collectionExportName\\\":\\\"WorkbookAttemptCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_attempts\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_attempts\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"activity_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"submission_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"previous_attempt_id\\\\\\\" UUID,\\\\n \\\\\\\"captured_at\\\\\\\" TEXT,\\\\n \\\\\\\"episode_id\\\\\\\" TEXT,\\\\n \\\\\\\"review_required\\\\\\\" BOOLEAN NOT NULL DEFAULT TRUE,\\\\n \\\\\\\"policy_version\\\\\\\" INTEGER NOT NULL DEFAULT 1,\\\\n \\\\\\\"assistance\\\\\\\" TEXT,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"source_hashes\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"activity_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_activities\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"previous_attempt_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_attempts\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"captured_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"episode_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"review_required\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":true},\\\"policy_version\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":1},\\\"assistance\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"source_hashes\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_attempts_tenant_id_submission_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"submission_id\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"workbook_attempts_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_attempts_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_attempts_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_attempts_activity_id_idx\\\",\\\"columns\\\":[\\\"activity_id\\\"]},{\\\"name\\\":\\\"workbook_attempts_submission_id_idx\\\",\\\"columns\\\":[\\\"submission_id\\\"]},{\\\"name\\\":\\\"workbook_attempts_previous_attempt_id_idx\\\",\\\"columns\\\":[\\\"previous_attempt_id\\\"]}],\\\"version\\\":\\\"bd9cdd9f\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookAssessmentRevision\\\":{\\\"name\\\":\\\"workbookassessmentrevision\\\",\\\"className\\\":\\\"WorkbookAssessmentRevision\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookAssessmentRevision\\\",\\\"collection\\\":\\\"workbookassessmentrevisions\\\",\\\"description\\\":\\\"Education-owned private workbook record. Mutations go through WorkbookService.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"attemptId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"WorkbookAttempt\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"requestKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"requestDigest\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"actorUserId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sourceRevisionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"WorkbookAssessmentRevision\\\",\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"decisionReason\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"supersedesId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"WorkbookAssessmentRevision\\\",\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"assessmentJson\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"recordedAt\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_assessment_revisions\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"attempt_id\\\",\\\"request_key\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"WorkbookAssessmentRevision\\\",\\\"collectionExportName\\\":\\\"WorkbookAssessmentRevisionCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"attemptId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_assessment_revisions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_assessment_revisions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"attempt_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_key\\\\\\\" TEXT,\\\\n \\\\\\\"request_digest\\\\\\\" TEXT,\\\\n \\\\\\\"kind\\\\\\\" TEXT,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"source_revision_id\\\\\\\" UUID,\\\\n \\\\\\\"decision_reason\\\\\\\" TEXT,\\\\n \\\\\\\"supersedes_id\\\\\\\" UUID,\\\\n \\\\\\\"assessment_json\\\\\\\" TEXT,\\\\n \\\\\\\"recorded_at\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"attempt_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_attempts\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"request_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"request_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"source_revision_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_assessment_revisions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"decision_reason\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"supersedes_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_assessment_revisions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"assessment_json\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"recorded_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_assessment_revisions_tenant_id_attempt_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"attempt_id\\\",\\\"request_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_assessment_revisions_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_assessment_revisions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_assessment_revisions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_assessment_revisions_attempt_id_idx\\\",\\\"columns\\\":[\\\"attempt_id\\\"]},{\\\"name\\\":\\\"workbook_assessment_revisions_source_revision_id_idx\\\",\\\"columns\\\":[\\\"source_revision_id\\\"]},{\\\"name\\\":\\\"workbook_assessment_revisions_supersedes_id_idx\\\",\\\"columns\\\":[\\\"supersedes_id\\\"]}],\\\"version\\\":\\\"94b2bd33\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookAssessmentRevisionCollection\\\":{\\\"name\\\":\\\"workbookassessmentrevisioncollection\\\",\\\"className\\\":\\\"WorkbookAssessmentRevisionCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookAssessmentRevisionCollection\\\",\\\"collection\\\":\\\"workbookassessmentrevisions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_assessment_revisions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"WorkbookAssessmentRevision\\\",\\\"exportName\\\":\\\"WorkbookAssessmentRevisionCollection\\\",\\\"collectionExportName\\\":\\\"WorkbookAssessmentRevisionCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_assessment_revisions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_assessment_revisions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"attempt_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_key\\\\\\\" TEXT,\\\\n \\\\\\\"request_digest\\\\\\\" TEXT,\\\\n \\\\\\\"kind\\\\\\\" TEXT,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"source_revision_id\\\\\\\" UUID,\\\\n \\\\\\\"decision_reason\\\\\\\" TEXT,\\\\n \\\\\\\"supersedes_id\\\\\\\" UUID,\\\\n \\\\\\\"assessment_json\\\\\\\" TEXT,\\\\n \\\\\\\"recorded_at\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"attempt_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_attempts\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"request_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"request_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"source_revision_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_assessment_revisions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"decision_reason\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"supersedes_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_assessment_revisions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"assessment_json\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"recorded_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_assessment_revisions_tenant_id_attempt_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"attempt_id\\\",\\\"request_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_assessment_revisions_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_assessment_revisions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_assessment_revisions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_assessment_revisions_attempt_id_idx\\\",\\\"columns\\\":[\\\"attempt_id\\\"]},{\\\"name\\\":\\\"workbook_assessment_revisions_source_revision_id_idx\\\",\\\"columns\\\":[\\\"source_revision_id\\\"]},{\\\"name\\\":\\\"workbook_assessment_revisions_supersedes_id_idx\\\",\\\"columns\\\":[\\\"supersedes_id\\\"]}],\\\"version\\\":\\\"94b2bd33\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookFeedbackRelease\\\":{\\\"name\\\":\\\"workbookfeedbackrelease\\\",\\\"className\\\":\\\"WorkbookFeedbackRelease\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookFeedbackRelease\\\",\\\"collection\\\":\\\"workbookfeedbackreleases\\\",\\\"description\\\":\\\"Education-owned private workbook record. Mutations go through WorkbookService.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"attemptId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"WorkbookAttempt\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"revisionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"WorkbookAssessmentRevision\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"expectedHeadId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"WorkbookAssessmentRevision\\\",\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"requestKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"actorUserId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"recordedAt\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_feedback_releases\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"attempt_id\\\",\\\"request_key\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"WorkbookFeedbackRelease\\\",\\\"collectionExportName\\\":\\\"WorkbookFeedbackReleaseCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"attemptId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"revisionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_feedback_releases\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_feedback_releases\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"attempt_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"revision_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"expected_head_id\\\\\\\" UUID,\\\\n \\\\\\\"request_key\\\\\\\" TEXT,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"recorded_at\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"attempt_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_attempts\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"revision_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_assessment_revisions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"expected_head_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_assessment_revisions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"request_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"recorded_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_feedback_releases_tenant_id_attempt_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"attempt_id\\\",\\\"request_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_feedback_releases_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_feedback_releases_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_feedback_releases_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_feedback_releases_attempt_id_idx\\\",\\\"columns\\\":[\\\"attempt_id\\\"]},{\\\"name\\\":\\\"workbook_feedback_releases_revision_id_idx\\\",\\\"columns\\\":[\\\"revision_id\\\"]},{\\\"name\\\":\\\"workbook_feedback_releases_expected_head_id_idx\\\",\\\"columns\\\":[\\\"expected_head_id\\\"]}],\\\"version\\\":\\\"ebe23baf\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookFeedbackReleaseCollection\\\":{\\\"name\\\":\\\"workbookfeedbackreleasecollection\\\",\\\"className\\\":\\\"WorkbookFeedbackReleaseCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookFeedbackReleaseCollection\\\",\\\"collection\\\":\\\"workbookfeedbackreleases\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_feedback_releases\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"WorkbookFeedbackRelease\\\",\\\"exportName\\\":\\\"WorkbookFeedbackReleaseCollection\\\",\\\"collectionExportName\\\":\\\"WorkbookFeedbackReleaseCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_feedback_releases\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_feedback_releases\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"attempt_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"revision_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"expected_head_id\\\\\\\" UUID,\\\\n \\\\\\\"request_key\\\\\\\" TEXT,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"recorded_at\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"attempt_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_attempts\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"revision_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_assessment_revisions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"expected_head_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_assessment_revisions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"request_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"recorded_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_feedback_releases_tenant_id_attempt_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"attempt_id\\\",\\\"request_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_feedback_releases_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_feedback_releases_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_feedback_releases_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_feedback_releases_attempt_id_idx\\\",\\\"columns\\\":[\\\"attempt_id\\\"]},{\\\"name\\\":\\\"workbook_feedback_releases_revision_id_idx\\\",\\\"columns\\\":[\\\"revision_id\\\"]},{\\\"name\\\":\\\"workbook_feedback_releases_expected_head_id_idx\\\",\\\"columns\\\":[\\\"expected_head_id\\\"]}],\\\"version\\\":\\\"ebe23baf\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookFeedbackDelivery\\\":{\\\"name\\\":\\\"workbookfeedbackdelivery\\\",\\\"className\\\":\\\"WorkbookFeedbackDelivery\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookFeedbackDelivery\\\",\\\"collection\\\":\\\"workbookfeedbackdeliveries\\\",\\\"description\\\":\\\"Authenticated delivery acknowledgment; this does not assert comprehension.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"attemptId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"WorkbookAttempt\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"revisionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"WorkbookAssessmentRevision\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"actorUserId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"requestKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"recordedAt\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_feedback_deliveries\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"attempt_id\\\",\\\"actor_user_id\\\",\\\"revision_id\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"WorkbookFeedbackDelivery\\\",\\\"collectionExportName\\\":\\\"WorkbookFeedbackDeliveryCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"attemptId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"revisionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_feedback_deliveries\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_feedback_deliveries\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"attempt_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"revision_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"request_key\\\\\\\" TEXT,\\\\n \\\\\\\"recorded_at\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"attempt_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_attempts\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"revision_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_assessment_revisions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"request_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"recorded_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_feedback_deliveries_tenant_id_attempt_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"attempt_id\\\",\\\"actor_user_id\\\",\\\"revision_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_feedback_deliveries_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_feedback_deliveries_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_feedback_deliveries_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_feedback_deliveries_attempt_id_idx\\\",\\\"columns\\\":[\\\"attempt_id\\\"]},{\\\"name\\\":\\\"workbook_feedback_deliveries_revision_id_idx\\\",\\\"columns\\\":[\\\"revision_id\\\"]}],\\\"version\\\":\\\"37bfd434\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookFeedbackDeliveryCollection\\\":{\\\"name\\\":\\\"workbookfeedbackdeliverycollection\\\",\\\"className\\\":\\\"WorkbookFeedbackDeliveryCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookFeedbackDeliveryCollection\\\",\\\"collection\\\":\\\"workbookfeedbackdeliveries\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_feedback_deliveries\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"WorkbookFeedbackDelivery\\\",\\\"exportName\\\":\\\"WorkbookFeedbackDeliveryCollection\\\",\\\"collectionExportName\\\":\\\"WorkbookFeedbackDeliveryCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_feedback_deliveries\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_feedback_deliveries\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"attempt_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"revision_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"request_key\\\\\\\" TEXT,\\\\n \\\\\\\"recorded_at\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"attempt_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_attempts\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"revision_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_assessment_revisions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"request_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"recorded_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_feedback_deliveries_tenant_id_attempt_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"attempt_id\\\",\\\"actor_user_id\\\",\\\"revision_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_feedback_deliveries_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_feedback_deliveries_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_feedback_deliveries_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_feedback_deliveries_attempt_id_idx\\\",\\\"columns\\\":[\\\"attempt_id\\\"]},{\\\"name\\\":\\\"workbook_feedback_deliveries_revision_id_idx\\\",\\\"columns\\\":[\\\"revision_id\\\"]}],\\\"version\\\":\\\"37bfd434\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookPhotoIntake\\\":{\\\"name\\\":\\\"workbookphotointake\\\",\\\"className\\\":\\\"WorkbookPhotoIntake\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookPhotoIntake\\\",\\\"collection\\\":\\\"workbookphotointakes\\\",\\\"description\\\":\\\"Durable receipt before any course, enrollment or activity exists.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-photo-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"familyIntakeId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"FamilyIntake\\\"},\\\"itemId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"actorUserId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"contentDigest\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_photo_intakes\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"item_id\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"WorkbookPhotoIntake\\\",\\\"collectionExportName\\\":\\\"WorkbookPhotoIntakeCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_photo_intakes\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_photo_intakes\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"family_intake_id\\\\\\\" UUID,\\\\n \\\\\\\"item_id\\\\\\\" TEXT,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"content_digest\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"family_intake_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"family_intakes\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"content_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_photo_intakes_tenant_id_item_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"item_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_photo_intakes_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_photo_intakes_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_photo_intakes_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_photo_intakes_family_intake_id_idx\\\",\\\"columns\\\":[\\\"family_intake_id\\\"]}],\\\"version\\\":\\\"288020f4\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookPhotoIntakeCollection\\\":{\\\"name\\\":\\\"workbookphotointakecollection\\\",\\\"className\\\":\\\"WorkbookPhotoIntakeCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookPhotoIntakeCollection\\\",\\\"collection\\\":\\\"workbookphotointakes\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-photo-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_photo_intakes\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"WorkbookPhotoIntake\\\",\\\"exportName\\\":\\\"WorkbookPhotoIntakeCollection\\\",\\\"collectionExportName\\\":\\\"WorkbookPhotoIntakeCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_photo_intakes\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_photo_intakes\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"family_intake_id\\\\\\\" UUID,\\\\n \\\\\\\"item_id\\\\\\\" TEXT,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"content_digest\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"family_intake_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"family_intakes\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"content_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_photo_intakes_tenant_id_item_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"item_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_photo_intakes_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_photo_intakes_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_photo_intakes_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_photo_intakes_family_intake_id_idx\\\",\\\"columns\\\":[\\\"family_intake_id\\\"]}],\\\"version\\\":\\\"288020f4\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookPhotoAsset\\\":{\\\"name\\\":\\\"workbookphotoasset\\\",\\\"className\\\":\\\"WorkbookPhotoAsset\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookPhotoAsset\\\",\\\"collection\\\":\\\"workbookphotoassets\\\",\\\"description\\\":\\\"Sole owner join for original photo intake files.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-photo-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"intakeId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"WorkbookPhotoIntake\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"assetId\\\":{\\\"type\\\":\\\"crossPackageRef\\\",\\\"required\\\":false,\\\"related\\\":\\\"@happyvertical/smrt-assets:Asset\\\"},\\\"name\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"mimeType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sha256\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"position\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0}},\\\"methods\\\":{\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_photo_assets\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"intake_id\\\",\\\"asset_id\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"WorkbookPhotoAsset\\\",\\\"collectionExportName\\\":\\\"WorkbookPhotoAssetCollection\\\",\\\"displayLabelField\\\":\\\"name\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"intakeId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"position\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_photo_assets\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_photo_assets\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"intake_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"asset_id\\\\\\\" UUID,\\\\n \\\\\\\"name\\\\\\\" TEXT,\\\\n \\\\\\\"mime_type\\\\\\\" TEXT,\\\\n \\\\\\\"sha256\\\\\\\" TEXT,\\\\n \\\\\\\"position\\\\\\\" INTEGER NOT NULL DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"intake_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_photo_intakes\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"asset_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"mime_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"sha256\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"position\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_photo_assets_tenant_id_intake_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"intake_id\\\",\\\"asset_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_photo_assets_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_photo_assets_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_photo_assets_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_photo_assets_intake_id_idx\\\",\\\"columns\\\":[\\\"intake_id\\\"]},{\\\"name\\\":\\\"workbook_photo_assets_asset_id_idx\\\",\\\"columns\\\":[\\\"asset_id\\\"]}],\\\"version\\\":\\\"9d49acb2\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookPhotoAssetCollection\\\":{\\\"name\\\":\\\"workbookphotoassetcollection\\\",\\\"className\\\":\\\"WorkbookPhotoAssetCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookPhotoAssetCollection\\\",\\\"collection\\\":\\\"workbookphotoassets\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-photo-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_photo_assets\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"WorkbookPhotoAsset\\\",\\\"exportName\\\":\\\"WorkbookPhotoAssetCollection\\\",\\\"collectionExportName\\\":\\\"WorkbookPhotoAssetCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_photo_assets\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_photo_assets\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"intake_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"asset_id\\\\\\\" UUID,\\\\n \\\\\\\"name\\\\\\\" TEXT,\\\\n \\\\\\\"mime_type\\\\\\\" TEXT,\\\\n \\\\\\\"sha256\\\\\\\" TEXT,\\\\n \\\\\\\"position\\\\\\\" INTEGER NOT NULL DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"intake_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_photo_intakes\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"asset_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"mime_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"sha256\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"position\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_photo_assets_tenant_id_intake_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"intake_id\\\",\\\"asset_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_photo_assets_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_photo_assets_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_photo_assets_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_photo_assets_intake_id_idx\\\",\\\"columns\\\":[\\\"intake_id\\\"]},{\\\"name\\\":\\\"workbook_photo_assets_asset_id_idx\\\",\\\"columns\\\":[\\\"asset_id\\\"]}],\\\"version\\\":\\\"9d49acb2\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookPhotoDecision\\\":{\\\"name\\\":\\\"workbookphotodecision\\\",\\\"className\\\":\\\"WorkbookPhotoDecision\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookPhotoDecision\\\",\\\"collection\\\":\\\"workbookphotodecisions\\\",\\\"description\\\":\\\"Immutable provider/guardian/capture decision, retaining provenance and retry key.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-photo-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"intakeId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"WorkbookPhotoIntake\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"requestKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sequence\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"actorUserId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"bodyJson\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}}},\\\"methods\\\":{\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_photo_decisions\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"intake_id\\\",\\\"request_key\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"WorkbookPhotoDecision\\\",\\\"collectionExportName\\\":\\\"WorkbookPhotoDecisionCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"intakeId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"sequence\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_photo_decisions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_photo_decisions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"intake_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_key\\\\\\\" TEXT,\\\\n \\\\\\\"sequence\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"body_json\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"intake_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_photo_intakes\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"request_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"sequence\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"body_json\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_photo_decisions_tenant_id_intake_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"intake_id\\\",\\\"request_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_photo_decisions_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_photo_decisions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_photo_decisions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_photo_decisions_intake_id_idx\\\",\\\"columns\\\":[\\\"intake_id\\\"]}],\\\"version\\\":\\\"4c8b4e5f\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookPhotoDecisionCollection\\\":{\\\"name\\\":\\\"workbookphotodecisioncollection\\\",\\\"className\\\":\\\"WorkbookPhotoDecisionCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookPhotoDecisionCollection\\\",\\\"collection\\\":\\\"workbookphotodecisions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-photo-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_photo_decisions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"WorkbookPhotoDecision\\\",\\\"exportName\\\":\\\"WorkbookPhotoDecisionCollection\\\",\\\"collectionExportName\\\":\\\"WorkbookPhotoDecisionCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_photo_decisions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_photo_decisions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"intake_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_key\\\\\\\" TEXT,\\\\n \\\\\\\"sequence\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"body_json\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"intake_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_photo_intakes\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"request_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"sequence\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"body_json\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_photo_decisions_tenant_id_intake_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"intake_id\\\",\\\"request_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_photo_decisions_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_photo_decisions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_photo_decisions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_photo_decisions_intake_id_idx\\\",\\\"columns\\\":[\\\"intake_id\\\"]}],\\\"version\\\":\\\"4c8b4e5f\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookContextRevision\\\":{\\\"name\\\":\\\"workbookcontextrevision\\\",\\\"className\\\":\\\"WorkbookContextRevision\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookContextRevision\\\",\\\"collection\\\":\\\"workbookcontextrevisions\\\",\\\"description\\\":\\\"Versioned contextual metadata; never edits Workbook identity or learning evidence.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-photo-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"workbookId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Workbook\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"decisionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"WorkbookPhotoDecision\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"metadataJson\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}}},\\\"methods\\\":{\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_context_revisions\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"decision_id\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"WorkbookContextRevision\\\",\\\"collectionExportName\\\":\\\"WorkbookContextRevisionCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"workbookId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"decisionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_context_revisions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_context_revisions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"workbook_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"decision_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"metadata_json\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"workbook_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbooks\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"decision_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_photo_decisions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"metadata_json\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_context_revisions_tenant_id_decision_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"decision_id\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"workbook_context_revisions_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_context_revisions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_context_revisions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_context_revisions_workbook_id_idx\\\",\\\"columns\\\":[\\\"workbook_id\\\"]},{\\\"name\\\":\\\"workbook_context_revisions_decision_id_idx\\\",\\\"columns\\\":[\\\"decision_id\\\"]}],\\\"version\\\":\\\"b1e8b4dc\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookContextRevisionCollection\\\":{\\\"name\\\":\\\"workbookcontextrevisioncollection\\\",\\\"className\\\":\\\"WorkbookContextRevisionCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookContextRevisionCollection\\\",\\\"collection\\\":\\\"workbookcontextrevisions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-photo-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_context_revisions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"WorkbookContextRevision\\\",\\\"exportName\\\":\\\"WorkbookContextRevisionCollection\\\",\\\"collectionExportName\\\":\\\"WorkbookContextRevisionCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_context_revisions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_context_revisions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"workbook_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"decision_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"metadata_json\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"workbook_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbooks\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"decision_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_photo_decisions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"metadata_json\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_context_revisions_tenant_id_decision_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"decision_id\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"workbook_context_revisions_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_context_revisions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_context_revisions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_context_revisions_workbook_id_idx\\\",\\\"columns\\\":[\\\"workbook_id\\\"]},{\\\"name\\\":\\\"workbook_context_revisions_decision_id_idx\\\",\\\"columns\\\":[\\\"decision_id\\\"]}],\\\"version\\\":\\\"b1e8b4dc\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"}},\\\"moduleType\\\":\\\"smrt\\\",\\\"recipes\\\":[{\\\"id\\\":\\\"education.catalog\\\",\\\"className\\\":\\\"EducationCatalogRecipe\\\",\\\"label\\\":\\\"Course catalog\\\",\\\"summary\\\":\\\"Organize courses, sections, lessons, and their authorized learning materials.\\\",\\\"synonyms\\\":[\\\"courses\\\",\\\"lessons\\\",\\\"curriculum catalog\\\"],\\\"models\\\":[\\\"@happyvertical/smrt-education:Course\\\",\\\"@happyvertical/smrt-education:CourseSection\\\",\\\"@happyvertical/smrt-education:Lesson\\\",\\\"@happyvertical/smrt-education:LessonAsset\\\"],\\\"nav\\\":[{\\\"label\\\":\\\"Courses\\\",\\\"model\\\":\\\"@happyvertical/smrt-education:Course\\\",\\\"icon\\\":\\\"folder\\\",\\\"description\\\":\\\"Courses available to this family.\\\",\\\"noun\\\":\\\"course\\\"}],\\\"requires\\\":[],\\\"section\\\":{\\\"id\\\":\\\"education\\\",\\\"label\\\":\\\"Education\\\",\\\"icon\\\":\\\"folder\\\",\\\"description\\\":\\\"Courses and lessons for learning.\\\"},\\\"help\\\":{\\\"markdown\\\":\\\"# Course catalog\\\\n\\\\nManage courses, their sections, and lessons. Private family copies and answer\\\\nkeys remain visible only through the application’s authorized catalog service.\\\\n\\\",\\\"fieldRefs\\\":[]},\\\"runtime\\\":\\\"both\\\",\\\"demo\\\":{\\\"mode\\\":\\\"server\\\",\\\"reasons\\\":[\\\"Needs a server because its package depends on @happyvertical/smrt-agents, @happyvertical/smrt-jobs, @happyvertical/smrt-profiles, @happyvertical/smrt-reports, @happyvertical/smrt-secrets, @happyvertical/smrt-tenancy, @happyvertical/smrt-users, which do not build for a browser (#3615, #3617, #3624, #3625, #3626, #3627).\\\"]}},{\\\"id\\\":\\\"education.learner\\\",\\\"className\\\":\\\"EducationLearnerRecipe\\\",\\\"label\\\":\\\"Learners\\\",\\\"summary\\\":\\\"Plan learner curricula and retain enrollment-scoped progress.\\\",\\\"synonyms\\\":[\\\"learners\\\",\\\"enrollments\\\",\\\"learning progress\\\"],\\\"models\\\":[\\\"@happyvertical/smrt-education:Learner\\\",\\\"@happyvertical/smrt-education:Curriculum\\\",\\\"@happyvertical/smrt-education:Enrollment\\\",\\\"@happyvertical/smrt-education:LessonProgress\\\"],\\\"nav\\\":[{\\\"label\\\":\\\"Learners\\\",\\\"model\\\":\\\"@happyvertical/smrt-education:Learner\\\",\\\"icon\\\":\\\"users\\\",\\\"description\\\":\\\"Authorized learners in this family.\\\",\\\"noun\\\":\\\"learner\\\"}],\\\"requires\\\":[],\\\"section\\\":{\\\"id\\\":\\\"education\\\",\\\"label\\\":\\\"Education\\\",\\\"icon\\\":\\\"folder\\\",\\\"description\\\":\\\"Courses and lessons for learning.\\\"},\\\"help\\\":{\\\"markdown\\\":\\\"# Learners\\\\n\\\\nUse `LearnerService` in an authenticated exact-tenant context to read a learner,\\\\nplan a curriculum as an authorized guardian, enroll in a visible course, and\\\\nstart a lesson. Recipe metadata does not expose model CRUD. Hosts authenticate\\\\nusers, provision family membership, and validate guardian ProfileRelationship\\\\ntypes and effective terms. See `agents/learner-service.md` for the boundary.\\\\n\\\",\\\"fieldRefs\\\":[]},\\\"runtime\\\":\\\"both\\\",\\\"demo\\\":{\\\"mode\\\":\\\"server\\\",\\\"reasons\\\":[\\\"Needs a server because its package depends on @happyvertical/smrt-agents, @happyvertical/smrt-jobs, @happyvertical/smrt-profiles, @happyvertical/smrt-reports, @happyvertical/smrt-secrets, @happyvertical/smrt-tenancy, @happyvertical/smrt-users, which do not build for a browser (#3615, #3617, #3624, #3625, #3626, #3627).\\\"]}}],\\\"smrtDependencies\\\":[\\\"@happyvertical/smrt-assets\\\",\\\"@happyvertical/smrt-core\\\",\\\"@happyvertical/smrt-ingestion\\\",\\\"@happyvertical/smrt-profiles\\\",\\\"@happyvertical/smrt-tenancy\\\",\\\"@happyvertical/smrt-users\\\"],\\\"browser\\\":{\\\"status\\\":\\\"server-only\\\",\\\"issues\\\":[\\\"#3615\\\",\\\"#3617\\\",\\\"#3624\\\",\\\"#3625\\\",\\\"#3626\\\",\\\"#3627\\\"],\\\"via\\\":[\\\"@happyvertical/smrt-agents\\\",\\\"@happyvertical/smrt-jobs\\\",\\\"@happyvertical/smrt-profiles\\\",\\\"@happyvertical/smrt-reports\\\",\\\"@happyvertical/smrt-secrets\\\",\\\"@happyvertical/smrt-tenancy\\\",\\\"@happyvertical/smrt-users\\\"]},\\\"stampsConstructors\\\":true}\"));\n","import type {\n CatalogAcquisitionCapabilityDecision,\n CatalogResourceRepresentation,\n CatalogSourceRecord,\n} from './catalog-contracts.js';\n\n/** Closed observed MIME mapping; icons and file names never establish a format. */\nexport const CATALOG_REPRESENTATION_MEDIA_TYPES = {\n pdf: 'application/pdf',\n zip: 'application/zip',\n docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n} as const;\n/** Bound and validate a complete Content-Type before retaining its canonical token. */\nexport function catalogRepresentationMediaType(value: string): string {\n const token = \"[!#$%&'*+.^_`|~0-9A-Za-z-]+\";\n const quoted = '\"(?:[\\\\x20-\\\\x21\\\\x23-\\\\x5b\\\\x5d-\\\\x7e]|\\\\\\\\[\\\\x20-\\\\x7e])*\"';\n const syntax = new RegExp(\n `^${token}/${token}(?:[ \\t]*;[ \\t]*${token}=(?:${token}|${quoted}))*[ \\t]*$`,\n );\n if (value.length > 512 || !syntax.test(value))\n throw new CatalogRepresentationError();\n return value.split(';', 1)[0].trim().toLowerCase();\n}\nexport function catalogRepresentationFormat(\n mediaType: string,\n): keyof typeof CATALOG_REPRESENTATION_MEDIA_TYPES | undefined {\n const token = catalogRepresentationMediaType(mediaType);\n return Object.entries(CATALOG_REPRESENTATION_MEDIA_TYPES).find(\n ([, mime]) => mime === token,\n )?.[0] as keyof typeof CATALOG_REPRESENTATION_MEDIA_TYPES | undefined;\n}\n\nexport class CatalogRepresentationError extends Error {\n readonly code = 'invalid-representation-metadata';\n constructor() {\n super('Catalog representation metadata is invalid.');\n this.name = 'CatalogRepresentationError';\n }\n}\nfunction object(value: unknown): Record<string, unknown> {\n if (!value || typeof value !== 'object' || Array.isArray(value))\n throw new CatalogRepresentationError();\n return value as Record<string, unknown>;\n}\nfunction keys(\n value: Record<string, unknown>,\n allowed: readonly string[],\n): void {\n if (Object.keys(value).some((key) => !allowed.includes(key)))\n throw new CatalogRepresentationError();\n}\nfunction positive(value: unknown): value is number {\n return typeof value === 'number' && Number.isSafeInteger(value) && value > 0;\n}\n\n/** Missing/null is legacy; malformed present data always throws, never becomes absence. */\nexport function normalizeCatalogRepresentation(\n value: unknown,\n): CatalogResourceRepresentation | undefined {\n if (value === undefined || value === null) return undefined;\n if (typeof value === 'string') {\n if (value.length > 4096) throw new CatalogRepresentationError();\n try {\n value = JSON.parse(value);\n } catch {\n throw new CatalogRepresentationError();\n }\n if (value === null) return undefined;\n }\n const record = object(value);\n keys(record, [\n 'format',\n 'mediaType',\n 'byteLength',\n 'validators',\n 'acquisition',\n ]);\n if (!positive(record.byteLength)) throw new CatalogRepresentationError();\n if (record.format === 'unknown') {\n if (\n record.mediaType !== null &&\n (typeof record.mediaType !== 'string' ||\n catalogRepresentationMediaType(record.mediaType) !== record.mediaType ||\n catalogRepresentationFormat(record.mediaType) !== undefined)\n )\n throw new CatalogRepresentationError();\n } else if (\n typeof record.format !== 'string' ||\n !Object.hasOwn(CATALOG_REPRESENTATION_MEDIA_TYPES, record.format) ||\n CATALOG_REPRESENTATION_MEDIA_TYPES[\n record.format as keyof typeof CATALOG_REPRESENTATION_MEDIA_TYPES\n ] !== record.mediaType\n )\n throw new CatalogRepresentationError();\n const validators = object(record.validators);\n keys(validators, ['etag', 'lastModified']);\n if (\n typeof validators.etag !== 'string' ||\n !/^\"[\\x21\\x23-\\x7e]{1,200}\"$/.test(validators.etag) ||\n typeof validators.lastModified !== 'string' ||\n validators.lastModified.length > 100 ||\n !Number.isFinite(Date.parse(validators.lastModified)) ||\n new Date(validators.lastModified).toUTCString() !== validators.lastModified\n )\n throw new CatalogRepresentationError();\n const capability = object(record.acquisition);\n keys(\n capability,\n record.format === 'unknown' ? ['status', 'reason'] : ['status', 'maxBytes'],\n );\n let acquisition: CatalogResourceRepresentation['acquisition'];\n if (record.format === 'unknown') {\n const reason =\n record.mediaType === null\n ? 'missing-content-type'\n : 'unrecognized-content-type';\n if (capability.status !== 'unknown-format' || capability.reason !== reason)\n throw new CatalogRepresentationError();\n acquisition = { status: 'unknown-format', reason };\n } else if (record.format !== 'pdf') {\n if (\n capability.status !== 'unsupported-format' ||\n capability.maxBytes !== undefined\n )\n throw new CatalogRepresentationError();\n acquisition = { status: 'unsupported-format' };\n } else {\n if (\n !positive(capability.maxBytes) ||\n (capability.status !== 'supported' &&\n capability.status !== 'size-limit') ||\n (capability.status === 'supported') !==\n record.byteLength <= capability.maxBytes\n )\n throw new CatalogRepresentationError();\n acquisition = {\n status: capability.status as 'supported' | 'size-limit',\n maxBytes: capability.maxBytes,\n };\n }\n return {\n format: record.format as CatalogResourceRepresentation['format'],\n mediaType: record.mediaType as CatalogResourceRepresentation['mediaType'],\n byteLength: record.byteLength,\n validators: {\n etag: validators.etag,\n lastModified: validators.lastModified,\n },\n acquisition,\n } as CatalogResourceRepresentation;\n}\n\n/** Read-only preselection guard for NEW downloads. It does not authorize legal use or pinned-byte printing. */\nexport function evaluateCatalogAcquisitionCapability(\n resource: Pick<CatalogSourceRecord, 'availableFormats' | 'representation'>,\n format: string,\n limits?: { maxBytes?: number },\n): CatalogAcquisitionCapabilityDecision {\n let representation: CatalogResourceRepresentation | undefined;\n try {\n representation = normalizeCatalogRepresentation(resource.representation);\n if (limits?.maxBytes !== undefined && !positive(limits.maxBytes))\n throw new CatalogRepresentationError();\n } catch {\n return { allowed: false, reason: 'invalid-representation-metadata' };\n }\n if (representation?.format === 'unknown')\n return {\n allowed: false,\n reason: 'unknown-format',\n byteLength: representation.byteLength,\n };\n if (\n !Array.isArray(resource.availableFormats) ||\n !resource.availableFormats.includes(format)\n )\n return { allowed: false, reason: 'format-unavailable' };\n if (!representation) return { allowed: true, verification: 'legacy' };\n if (representation.format !== format)\n return { allowed: false, reason: 'format-unavailable' };\n if (representation.acquisition.status === 'unsupported-format')\n return {\n allowed: false,\n reason: 'unsupported-format',\n byteLength: representation.byteLength,\n };\n const maxBytes = Math.min(\n representation.acquisition.maxBytes,\n limits?.maxBytes ?? representation.acquisition.maxBytes,\n );\n if (\n representation.acquisition.status === 'size-limit' ||\n representation.byteLength > maxBytes\n )\n return {\n allowed: false,\n reason: 'size-limit',\n maxBytes,\n byteLength: representation.byteLength,\n };\n return { allowed: true, verification: 'observed' };\n}\n","import type {\n CatalogActor,\n CatalogLicenseEvidence,\n CatalogOperation,\n CatalogSourceRecord,\n} from './catalog-contracts.js';\n\nexport interface CatalogPolicyDecision {\n allowed: boolean;\n reason?:\n | 'teacher-material'\n | 'unverified-license'\n | 'operation-not-permitted';\n}\n\n/** Server-side resource policy. UI affordances are advisory and cannot bypass it. */\nexport class CatalogPolicy {\n canView(\n record: Pick<CatalogSourceRecord, 'visibility'>,\n actor: CatalogActor,\n ): boolean {\n return record.visibility === 'catalog' || actor.roles.includes('teacher');\n }\n\n authorize(\n record: Pick<CatalogSourceRecord, 'visibility' | 'licenseEvidence'>,\n operation: CatalogOperation,\n actor: CatalogActor,\n ): CatalogPolicyDecision {\n if (!this.canView(record, actor))\n return { allowed: false, reason: 'teacher-material' };\n const evidence = record.licenseEvidence;\n if (!this.isVerified(evidence))\n return { allowed: false, reason: 'unverified-license' };\n if (!evidence.permittedOperations?.includes(operation))\n return { allowed: false, reason: 'operation-not-permitted' };\n return { allowed: true };\n }\n\n private isVerified(evidence: CatalogLicenseEvidence): boolean {\n return evidence.state === 'verified' && !!evidence.identifier?.trim();\n }\n}\n","import {\n evaluateCatalogAcquisitionCapability,\n normalizeCatalogRepresentation,\n} from './catalog-capability.js';\nimport type {\n CatalogAcquireAdapter,\n CatalogActor,\n CatalogOperation,\n CatalogSourceRecord,\n} from './catalog-contracts.js';\nimport { CatalogPolicy } from './catalog-policy.js';\n\nexport interface CatalogAcquisitionRecord {\n id: string;\n tenantId: string;\n resourceId: string;\n selectionId: string;\n revision: string;\n format: string;\n sha256: string;\n attribution?: string;\n notices?: string;\n}\n\nexport interface CatalogSelectionRecord {\n id: string;\n tenantId: string;\n resourceId: string;\n selectedRevision: string;\n}\n\nexport interface CatalogAcquisitionStore {\n getResource(\n resourceId: string,\n ): Promise<\n (CatalogSourceRecord & { id: string; withdrawnAt: Date | null }) | undefined\n >;\n getSelection(input: {\n tenantId: string;\n selectionId: string;\n }): Promise<CatalogSelectionRecord | undefined>;\n findAcquisition(input: {\n tenantId: string;\n resourceId: string;\n selectionId: string;\n revision: string;\n format: string;\n }): Promise<CatalogAcquisitionRecord | undefined>;\n createAcquisition(\n input: Omit<CatalogAcquisitionRecord, 'id'> & { bytes: Uint8Array },\n ): Promise<CatalogAcquisitionRecord>;\n}\n\nexport interface CatalogAcquisitionRequest {\n tenantId: string;\n actorUserId: string;\n roles: readonly string[];\n resourceId: string;\n selectionId: string;\n revision: string;\n format: string;\n operation: CatalogOperation;\n}\n\nasync function digest(bytes: Uint8Array): Promise<string> {\n const hash = await globalThis.crypto.subtle.digest('SHA-256', bytes);\n return Array.from(new Uint8Array(hash), (byte) =>\n byte.toString(16).padStart(2, '0'),\n ).join('');\n}\n\n/** Explicit, policy-gated selected-content acquisition. Catalog discovery has no route here. */\nexport class CatalogAcquisitionService {\n constructor(\n private readonly store: CatalogAcquisitionStore,\n private readonly adapter: CatalogAcquireAdapter,\n private readonly policy = new CatalogPolicy(),\n ) {}\n\n async acquire(\n request: CatalogAcquisitionRequest,\n ): Promise<CatalogAcquisitionRecord> {\n const actor: CatalogActor = {\n tenantId: request.tenantId,\n actorUserId: request.actorUserId,\n roles: request.roles,\n };\n if (!actor.tenantId.trim() || !actor.actorUserId.trim())\n throw new Error('Trusted tenant and actor identity are required.');\n const resource = await this.store.getResource(request.resourceId);\n if (!resource) throw new Error('Catalog resource was not found.');\n if (resource.withdrawnAt)\n throw new Error('Withdrawn catalog resource cannot be acquired.');\n if (resource.revision !== request.revision)\n throw new Error(\n 'Catalog resource revision is no longer current; reselect it.',\n );\n const selection = await this.store.getSelection({\n tenantId: actor.tenantId,\n selectionId: request.selectionId,\n });\n if (\n !selection ||\n selection.resourceId !== resource.id ||\n selection.selectedRevision !== request.revision\n )\n throw new Error(\n 'A matching tenant selection is required for acquisition.',\n );\n if (!resource.availableFormats?.includes(request.format))\n throw new Error('Requested content format is unavailable.');\n const decision = this.policy.authorize(resource, request.operation, actor);\n if (!decision.allowed)\n throw new Error(`Catalog acquisition denied: ${decision.reason}`);\n const existing = await this.store.findAcquisition({\n tenantId: actor.tenantId,\n resourceId: resource.id,\n selectionId: selection.id,\n revision: request.revision,\n format: request.format,\n });\n if (existing) return existing;\n const capability = evaluateCatalogAcquisitionCapability(\n resource,\n request.format,\n );\n if (!capability.allowed)\n throw new Error(`Catalog acquisition unavailable: ${capability.reason}`);\n const acquired = await this.adapter.acquire({\n providerId: resource.providerId,\n stableId: resource.stableId,\n revision: request.revision,\n format: request.format,\n });\n if (acquired.revision !== request.revision)\n throw new Error('Provider returned an unpinned resource revision.');\n const representation = normalizeCatalogRepresentation(\n resource.representation,\n );\n if (\n representation &&\n acquired.bytes.byteLength !== representation.byteLength\n )\n throw new Error(\n 'Acquired bytes differ from observed representation length.',\n );\n const actualHash = await digest(acquired.bytes);\n if (actualHash !== acquired.sha256.toLowerCase())\n throw new Error('Provider content hash did not match acquired bytes.');\n return await this.store.createAcquisition({\n tenantId: actor.tenantId,\n resourceId: resource.id,\n selectionId: selection.id,\n revision: request.revision,\n format: request.format,\n sha256: actualHash,\n attribution: resource.licenseEvidence.attribution,\n notices: resource.licenseEvidence.exceptions,\n bytes: acquired.bytes,\n });\n }\n}\n","import type { CatalogActor, CatalogSourceRecord } from './catalog-contracts.js';\nimport { CatalogPolicy } from './catalog-policy.js';\n\n/** Publisher preview permission is independent of original-resource permissions. */\nexport interface CatalogPreview {\n providerId: 'illustrative-mathematics';\n stableId: string;\n revision: string;\n /** Official publisher ImageFile identifier, never a caller-supplied URL. */\n reference: string;\n mediaType: 'image/png';\n width: number;\n height: number;\n byteLength: number;\n sha256: string;\n alt: string;\n rights: {\n state: 'verified';\n identifier: 'CC-BY-4.0';\n sourceUrl: string;\n attribution: string;\n retrievedAt: string;\n expiresAt?: string;\n };\n}\n\nexport const CATALOG_PREVIEW_MAX_BYTES = 2 * 1024 * 1024;\nexport const CATALOG_PREVIEW_MAX_DIMENSION = 4096;\n\n/** Parse persisted/untrusted optional metadata. Invalid metadata is unavailable. */\nexport function normalizeCatalogPreview(\n value: unknown,\n): CatalogPreview | undefined {\n try {\n const x = (\n typeof value === 'string' ? JSON.parse(value) : value\n ) as CatalogPreview;\n if (\n !x ||\n x.providerId !== 'illustrative-mathematics' ||\n typeof x.stableId !== 'string' ||\n !x.stableId ||\n x.stableId.length > 1000 ||\n typeof x.revision !== 'string' ||\n !x.revision ||\n x.revision.length > 1000 ||\n typeof x.reference !== 'string' ||\n !/^[a-zA-Z0-9]{20,64}$/.test(x.reference) ||\n x.mediaType !== 'image/png' ||\n !Number.isSafeInteger(x.byteLength) ||\n x.byteLength < 24 ||\n x.byteLength > CATALOG_PREVIEW_MAX_BYTES ||\n ![x.width, x.height].every(\n (n) =>\n Number.isSafeInteger(n) &&\n n > 0 &&\n n <= CATALOG_PREVIEW_MAX_DIMENSION,\n ) ||\n typeof x.sha256 !== 'string' ||\n !/^[a-f0-9]{64}$/.test(x.sha256) ||\n typeof x.alt !== 'string' ||\n !x.alt ||\n x.alt.length > 2000 ||\n x.rights?.state !== 'verified' ||\n x.rights.identifier !== 'CC-BY-4.0' ||\n typeof x.rights.attribution !== 'string' ||\n !x.rights.attribution ||\n x.rights.attribution.length > 4000 ||\n typeof x.rights.sourceUrl !== 'string' ||\n typeof x.rights.retrievedAt !== 'string' ||\n !Number.isFinite(Date.parse(x.rights.retrievedAt)) ||\n (x.rights.expiresAt !== undefined &&\n (typeof x.rights.expiresAt !== 'string' ||\n !Number.isFinite(Date.parse(x.rights.expiresAt))))\n )\n return undefined;\n const source = new URL(x.rights.sourceUrl);\n if (\n source.origin !== 'https://im.kendallhunt.com' ||\n source.search ||\n source.hash ||\n source.username ||\n source.password ||\n !/^\\/k5(?:_es)?\\/families\\/(kindergarten|grade-[1-5])\\/unit-[1-9][0-9]?\\/family-materials\\.html$/.test(\n source.pathname,\n )\n )\n return undefined;\n // Explicit projection prevents unknown fields (including URLs/tokens) escaping.\n return {\n providerId: x.providerId,\n stableId: x.stableId,\n revision: x.revision,\n reference: x.reference,\n mediaType: x.mediaType,\n width: x.width,\n height: x.height,\n byteLength: x.byteLength,\n sha256: x.sha256,\n alt: x.alt,\n rights: {\n state: 'verified',\n identifier: 'CC-BY-4.0',\n sourceUrl: source.href,\n attribution: x.rights.attribution,\n retrievedAt: x.rights.retrievedAt,\n ...(x.rights.expiresAt ? { expiresAt: x.rights.expiresAt } : {}),\n },\n };\n } catch {\n return undefined;\n }\n}\n\n/** Exact source/revision binding; expired or corrupt references are unavailable. */\nexport function catalogPreviewFor(\n record: Pick<\n CatalogSourceRecord,\n 'providerId' | 'stableId' | 'revision' | 'preview'\n >,\n now = Date.now(),\n): CatalogPreview | undefined {\n const preview = normalizeCatalogPreview(record.preview);\n return preview &&\n preview.providerId === record.providerId &&\n preview.stableId === record.stableId &&\n preview.revision === record.revision &&\n (!preview.rights.expiresAt || Date.parse(preview.rights.expiresAt) > now)\n ? preview\n : undefined;\n}\n\n/** Verify complete bounded static 8-bit RGB/RGBA PNG data; never transform originals. */\nexport function catalogPreviewPngDimensions(bytes: Uint8Array): {\n width: number;\n height: number;\n} {\n // Like core's manifest Node host, resolve built-ins only when the server\n // capability is invoked; metadata/model imports must remain browser-safe.\n const host = (\n typeof process === 'undefined'\n ? undefined\n : process.getBuiltinModule?.('node:zlib')\n ) as typeof import('node:zlib') | undefined;\n if (!host)\n throw new Error('Catalog preview verification requires a Node host.');\n const { crc32, inflateSync } = host;\n if (\n bytes.length < 24 ||\n bytes.length > CATALOG_PREVIEW_MAX_BYTES ||\n ![137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82].every(\n (n, i) => bytes[i] === n,\n )\n )\n throw new Error('Invalid catalog preview PNG.');\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n const width = view.getUint32(16),\n height = view.getUint32(20);\n if (\n ![width, height].every((n) => n > 0 && n <= CATALOG_PREVIEW_MAX_DIMENSION)\n )\n throw new Error('Catalog preview dimensions exceed bounds.');\n // Keep the supported subset explicit. Other encodings remain unavailable.\n const channels = bytes[25] === 2 ? 3 : bytes[25] === 6 ? 4 : 0;\n if (\n bytes.length < 45 ||\n bytes[24] !== 8 ||\n !channels ||\n bytes[26] !== 0 ||\n bytes[27] !== 0 ||\n bytes[28] !== 0\n )\n throw new Error('Unsupported catalog preview PNG encoding.');\n const compressed: Uint8Array[] = [];\n let offset = 8;\n let ended = false;\n let idatEnded = false;\n while (offset + 12 <= bytes.length) {\n const length = view.getUint32(offset);\n if (length > bytes.length - offset - 12)\n throw new Error('Truncated catalog preview PNG chunk.');\n const type = String.fromCharCode(...bytes.subarray(offset + 4, offset + 8));\n const end = offset + 12 + length;\n if (\n !/^[a-zA-Z]{2}[A-Z][a-zA-Z]$/.test(type) ||\n crc32(bytes.subarray(offset + 4, end - 4)) !== view.getUint32(end - 4)\n )\n throw new Error('Invalid catalog preview PNG chunk.');\n if (type === 'IHDR') {\n if (offset !== 8 || length !== 13)\n throw new Error('Invalid catalog preview PNG header.');\n } else if (type === 'IDAT') {\n if (idatEnded)\n throw new Error('Invalid catalog preview PNG image ordering.');\n compressed.push(bytes.subarray(offset + 8, end - 4));\n } else {\n if (compressed.length) idatEnded = true;\n if (type === 'IEND') {\n if (length || end !== bytes.length)\n throw new Error('Invalid catalog preview PNG ending.');\n ended = true;\n } else if (type === 'PLTE') {\n if (compressed.length || !length || length > 768 || length % 3)\n throw new Error('Invalid catalog preview PNG palette.');\n } else if (/^[A-Z]/.test(type) || ['acTL', 'fcTL', 'fdAT'].includes(type))\n throw new Error('Unsupported catalog preview PNG chunk.');\n }\n offset = end;\n }\n if (!ended || offset !== bytes.length || !compressed.length)\n throw new Error('Incomplete catalog preview PNG.');\n const stride = width * channels + 1;\n const raw = inflateSync(Buffer.concat(compressed), {\n maxOutputLength: stride * height,\n });\n if (raw.length !== stride * height)\n throw new Error('Invalid catalog preview PNG pixel data.');\n for (let row = 0; row < height; row++)\n if (raw[row * stride] > 4)\n throw new Error('Invalid catalog preview PNG filter.');\n return { width, height };\n}\n\nexport interface CatalogPreviewStore {\n /** Must read through the active actor/tenant-bound executor, never a global write bypass. */\n getResource(\n id: string,\n actor: CatalogActor,\n ): Promise<\n | (CatalogSourceRecord & { id: string; withdrawnAt?: string | null })\n | undefined\n >;\n /** Recheck live session, tenant membership and resource access on EVERY read, including cache hits. */\n authorize(\n actor: CatalogActor,\n resource: CatalogSourceRecord & { id: string },\n ): Promise<boolean>;\n}\nexport interface CatalogPreviewLoader {\n /** Preview-only bytes, bounded by CATALOG_PREVIEW_MAX_BYTES; never acquire the original. */\n loadPreview(preview: CatalogPreview): Promise<Uint8Array>;\n}\n\n/** Authorized serving of public publisher previews with a bounded, short-lived verified-byte cache. */\nexport class CatalogPreviewService {\n private readonly cache = new Map<\n string,\n { bytes: Uint8Array; until: number; width: number; height: number }\n >();\n private cacheBytes = 0;\n constructor(\n private readonly store: CatalogPreviewStore,\n private readonly loader: CatalogPreviewLoader,\n ) {}\n\n async serve(input: {\n actor: CatalogActor;\n resourceId: string;\n revision: string;\n }): Promise<Response> {\n const unavailable = () =>\n new Response(null, {\n status: 404,\n headers: { 'cache-control': 'no-store' },\n });\n const { actor } = input;\n if (!actor.tenantId?.trim() || !actor.actorUserId?.trim())\n return unavailable();\n const record = await this.store.getResource(input.resourceId, actor);\n if (\n !record ||\n record.id !== input.resourceId ||\n record.withdrawnAt ||\n record.revision !== input.revision ||\n !new CatalogPolicy().canView(record, actor) ||\n (await this.store.authorize(actor, record)) !== true\n )\n return unavailable();\n const preview = catalogPreviewFor(record);\n if (!preview) return unavailable();\n const key = preview.sha256;\n const now = Date.now();\n for (const [id, entry] of this.cache)\n if (entry.until <= now) {\n this.cache.delete(id);\n this.cacheBytes -= entry.bytes.length;\n }\n const cached = this.cache.get(key);\n if (\n cached &&\n (cached.bytes.length !== preview.byteLength ||\n cached.width !== preview.width ||\n cached.height !== preview.height)\n )\n return unavailable();\n let bytes = cached?.bytes;\n if (!bytes) {\n try {\n bytes = await this.loader.loadPreview(preview);\n const dimensions = catalogPreviewPngDimensions(bytes);\n const hash = Buffer.from(\n await globalThis.crypto.subtle.digest(\n 'SHA-256',\n Uint8Array.from(bytes),\n ),\n ).toString('hex');\n if (\n bytes.length !== preview.byteLength ||\n dimensions.width !== preview.width ||\n dimensions.height !== preview.height ||\n hash !== preview.sha256\n )\n return unavailable();\n if (!catalogPreviewFor(record)) return unavailable();\n bytes = Uint8Array.from(bytes);\n // Another miss may have populated this key while loading/hash-checking.\n const replaced = this.cache.get(key);\n if (replaced) {\n this.cache.delete(key);\n this.cacheBytes -= replaced.bytes.length;\n }\n while (this.cacheBytes + bytes.length > 16 * 1024 * 1024) {\n const first = this.cache.entries().next().value;\n if (!first) break;\n this.cache.delete(first[0]);\n this.cacheBytes -= first[1].bytes.length;\n }\n this.cache.set(key, {\n bytes,\n ...dimensions,\n until: Math.min(\n now + 60_000,\n preview.rights.expiresAt\n ? Date.parse(preview.rights.expiresAt)\n : Infinity,\n ),\n });\n this.cacheBytes += bytes.length;\n } catch {\n return unavailable();\n }\n }\n if (!catalogPreviewFor(record)) return unavailable();\n return new Response(Uint8Array.from(bytes), {\n headers: {\n 'content-type': 'image/png',\n 'content-length': String(bytes.length),\n 'cache-control': 'private, no-store',\n 'x-content-type-options': 'nosniff',\n 'content-security-policy': \"default-src 'none'; sandbox\",\n },\n });\n }\n}\n","import { field, foreignKey, SmrtObject, smrt } from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport { normalizeCatalogRepresentation } from './catalog-capability.js';\nimport type {\n CatalogLicenseState,\n CatalogResourceRepresentation,\n CatalogVisibility,\n} from './catalog-contracts.js';\nimport {\n type CatalogPreview,\n normalizeCatalogPreview,\n} from './catalog-preview.js';\n\nconst closed = { api: false, mcp: false, cli: false } as const;\n\n/** Globally visible provider registration. Hosts configure adapters and credentials out of band. */\n@smrt({ ...closed })\nexport class CatalogProvider extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-education\";\n @field({ required: true }) providerId = '';\n @field({ required: true }) name = '';\n active = true;\n}\n\n/** A provider-native record. Rows are intentionally not merged across providers. */\n@smrt({ ...closed })\nexport class CatalogResource extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-education\";\n @field({ required: true }) providerId = '';\n @field({ required: true }) stableId = '';\n @field({ required: true }) revision = '';\n canonicalUrl = '';\n @field({ required: true }) title = '';\n suppliedDescription = '';\n author = '';\n subjects = '[]';\n grades = '{}';\n language = '';\n resourceType = '';\n parentStableId = '';\n availableFormats = '[]';\n /** Serialized observed representation; JSON null is legacy absence. */\n representation = 'null';\n /** Exact revision-bound publisher preview, not an original or private asset grant. */\n preview = 'null';\n\n getPreview(): CatalogPreview | undefined {\n return normalizeCatalogPreview(this.preview);\n }\n setPreview(value: CatalogPreview | undefined): void {\n if (value !== undefined && !normalizeCatalogPreview(value))\n throw new Error('Invalid catalog preview metadata.');\n this.preview = JSON.stringify(normalizeCatalogPreview(value) ?? null);\n }\n\n getRepresentation(): CatalogResourceRepresentation | undefined {\n return normalizeCatalogRepresentation(this.representation);\n }\n setRepresentation(value: CatalogResourceRepresentation | undefined): void {\n this.representation = JSON.stringify(\n normalizeCatalogRepresentation(value) ?? null,\n );\n }\n licenseEvidence = '{}';\n licenseState: CatalogLicenseState = 'unknown';\n visibility: CatalogVisibility = 'catalog';\n /** Last durable enumeration generation that observed this provider record. */\n lastSeenRunId = '';\n withdrawnAt = '';\n}\n\n/** Durable per-provider enumeration state. A failed or partial feed is never complete. */\n@smrt({ ...closed })\nexport class CatalogSyncState extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-education\";\n /** Provider-owned stable key, not an internal provider row ID. */\n @field({ required: true }) providerId = '';\n cursor = '';\n /** Persists across interrupted pages so terminal withdrawal is safe on resume. */\n runId = '';\n complete = false;\n paused = false;\n pauseReason = '';\n importedCount = 0;\n failures = '[]';\n lastSuccessfulAt = '';\n}\n\n/** Tenant-owned intent to use a metadata record, distinct from acquiring bytes. */\n@TenantScoped({ mode: 'required' })\n@smrt({ ...closed })\nexport class CatalogSelection extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-education\";\n @tenantId() tenantId = '';\n @foreignKey('CatalogResource', { required: true }) resourceId = '';\n @field({ required: true }) selectedByUserId = '';\n @field({ required: true }) selectedRevision = '';\n}\n\n/** A pinned, tenant-owned acquisition record. Bytes belong in a host storage service. */\n@TenantScoped({ mode: 'required' })\n@smrt({ ...closed })\nexport class CatalogAcquisition extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-education\";\n @tenantId() tenantId = '';\n @foreignKey('CatalogResource', { required: true }) resourceId = '';\n @foreignKey('CatalogSelection', { required: true }) selectionId = '';\n @field({ required: true }) revision = '';\n @field({ required: true }) format = '';\n @field({ required: true }) sha256 = '';\n attribution = '';\n notices = '';\n}\n","import { SmrtCollection } from '@happyvertical/smrt-core';\nimport {\n CatalogAcquisition,\n CatalogProvider,\n CatalogResource,\n CatalogSelection,\n CatalogSyncState,\n} from './catalog-models.js';\n\nexport class CatalogProviderCollection extends SmrtCollection<CatalogProvider> {\n static readonly _itemClass = CatalogProvider;\n}\nexport class CatalogResourceCollection extends SmrtCollection<CatalogResource> {\n static readonly _itemClass = CatalogResource;\n}\nexport class CatalogSyncStateCollection extends SmrtCollection<CatalogSyncState> {\n static readonly _itemClass = CatalogSyncState;\n}\nexport class CatalogSelectionCollection extends SmrtCollection<CatalogSelection> {\n static readonly _itemClass = CatalogSelection;\n}\nexport class CatalogAcquisitionCollection extends SmrtCollection<CatalogAcquisition> {\n static readonly _itemClass = CatalogAcquisition;\n}\n","import type { DatabaseInterface } from '@happyvertical/sql';\nimport { normalizeCatalogRepresentation } from './catalog-capability.js';\nimport {\n CatalogResourceCollection,\n CatalogSyncStateCollection,\n} from './catalog-collections.js';\nimport type {\n CatalogSourceRecord,\n CatalogSyncCheckpoint,\n} from './catalog-contracts.js';\nimport { catalogPreviewFor } from './catalog-preview.js';\nimport type { CatalogSyncStore } from './catalog-sync-service.js';\n\nfunction json(value: unknown): string {\n return JSON.stringify(value ?? null);\n}\n\nfunction checkpoint(row: {\n providerId: string;\n runId: string;\n cursor: string;\n complete: boolean;\n paused: boolean;\n pauseReason: string;\n importedCount: number;\n failures: string;\n lastSuccessfulAt: string;\n}): CatalogSyncCheckpoint {\n let failures: CatalogSyncCheckpoint['failures'] = [];\n try {\n const parsed: unknown = JSON.parse(row.failures);\n if (Array.isArray(parsed)) failures = parsed as typeof failures;\n } catch {\n // A corrupt historical failure ledger stays visible as an incomplete run.\n failures = [\n {\n code: 'invalid-failure-ledger',\n message: 'Stored failure ledger is invalid.',\n },\n ];\n }\n return {\n providerId: row.providerId,\n ...(row.runId ? { runId: row.runId } : {}),\n ...(row.cursor ? { cursor: row.cursor } : {}),\n complete: row.complete,\n ...(row.paused ? { paused: true } : {}),\n ...(row.pauseReason ? { pauseReason: row.pauseReason } : {}),\n importedCount: row.importedCount,\n failures,\n ...(row.lastSuccessfulAt ? { lastSuccessfulAt: row.lastSuccessfulAt } : {}),\n };\n}\n\n/** Default durable store for metadata-only provider synchronization. */\nexport class CatalogDatabaseSyncStore implements CatalogSyncStore {\n constructor(private readonly db: DatabaseInterface) {}\n\n async getCheckpoint(\n providerId: string,\n ): Promise<CatalogSyncCheckpoint | undefined> {\n const states = await CatalogSyncStateCollection.create({ db: this.db });\n const rows = await states.list({ where: { providerId }, limit: 2 });\n if (rows.length > 1)\n throw new Error('Catalog provider has ambiguous sync state.');\n return rows[0] ? checkpoint(rows[0]) : undefined;\n }\n\n async saveCheckpoint(value: CatalogSyncCheckpoint): Promise<void> {\n const states = await CatalogSyncStateCollection.create({ db: this.db });\n const rows = await states.list({\n where: { providerId: value.providerId },\n limit: 2,\n });\n if (rows.length > 1)\n throw new Error('Catalog provider has ambiguous sync state.');\n const fields = {\n providerId: value.providerId,\n runId: value.runId ?? '',\n cursor: value.cursor ?? '',\n complete: value.complete,\n paused: value.paused ?? false,\n pauseReason: value.pauseReason ?? '',\n importedCount: value.importedCount,\n failures: json(value.failures),\n lastSuccessfulAt: value.lastSuccessfulAt ?? '',\n };\n if (rows[0]) {\n Object.assign(rows[0], fields);\n await rows[0].save();\n } else await states.create(fields);\n }\n\n async upsert(record: CatalogSourceRecord, runId: string): Promise<void> {\n const resources = await CatalogResourceCollection.create({ db: this.db });\n const rows = await resources.list({\n where: { providerId: record.providerId, stableId: record.stableId },\n limit: 2,\n });\n if (rows.length > 1)\n throw new Error('Catalog provider record identity is ambiguous.');\n // Retain valid historical evidence even after expiry; read/serve decide availability.\n let preview = catalogPreviewFor(record, Number.NEGATIVE_INFINITY);\n if (record.preview !== undefined && !preview)\n throw new Error('Invalid catalog preview metadata.');\n const previousPreview = rows[0]?.getPreview();\n if (rows[0]?.revision === record.revision && previousPreview) {\n if (\n !preview ||\n JSON.stringify({\n ...preview,\n rights: {\n ...preview.rights,\n retrievedAt: previousPreview.rights.retrievedAt,\n },\n }) !== JSON.stringify(previousPreview)\n )\n throw new Error(\n 'Catalog preview is immutable within a source revision.',\n );\n preview = previousPreview;\n }\n const fields = {\n providerId: record.providerId,\n stableId: record.stableId,\n revision: record.revision,\n canonicalUrl: record.canonicalUrl,\n title: record.title,\n suppliedDescription: record.suppliedDescription ?? '',\n author: record.author ?? '',\n subjects: json(record.subjects ?? []),\n grades: json(record.gradeRange ?? {}),\n language: record.language ?? '',\n resourceType: record.resourceType ?? '',\n parentStableId: record.parentStableId ?? '',\n availableFormats: json(record.availableFormats ?? []),\n representation: json(\n normalizeCatalogRepresentation(record.representation),\n ),\n preview: json(preview),\n licenseEvidence: json(record.licenseEvidence),\n licenseState: record.licenseEvidence.state,\n visibility: record.visibility,\n lastSeenRunId: runId,\n withdrawnAt: '',\n };\n if (rows[0]) {\n Object.assign(rows[0], fields);\n await rows[0].save();\n } else await resources.create(fields);\n }\n\n async withdrawUnseen(providerId: string, runId: string): Promise<number> {\n const resources = await CatalogResourceCollection.create({ db: this.db });\n const rows = await resources.list({ where: { providerId } });\n const timestamp = new Date().toISOString();\n let withdrawn = 0;\n for (const row of rows) {\n if (row.lastSeenRunId === runId || row.withdrawnAt) continue;\n row.withdrawnAt = timestamp;\n await row.save();\n withdrawn++;\n }\n return withdrawn;\n }\n}\n","import { getCurrentTenant } from '@happyvertical/smrt-tenancy';\nimport type { DatabaseInterface } from '@happyvertical/sql';\nimport type { CatalogAcquisitionRecord } from './catalog-acquisition-service.js';\nimport type { CatalogActor, CatalogSourceRecord } from './catalog-contracts.js';\nimport { CatalogPolicy } from './catalog-policy.js';\nimport {\n CourseSectionCollection,\n ExternalCourseCollection,\n LessonAssetCollection,\n ReadingCollection,\n WorksheetCollection,\n} from './collections.js';\nimport type { LearnerRequest } from './learner-service.js';\n\nexport interface CatalogMaterializationStore {\n getResource(\n resourceId: string,\n ): Promise<\n (CatalogSourceRecord & { id: string; withdrawnAt: Date | null }) | undefined\n >;\n getAcquisition(input: {\n tenantId: string;\n acquisitionId: string;\n }): Promise<CatalogAcquisitionRecord | undefined>;\n}\n\n/** Host-owned copy operation; it must retain the pinned bytes and prove a private Asset capability. */\nexport interface CatalogMaterializationStorage {\n ensurePrivateAsset(input: {\n tenantId: string;\n actorUserId: string;\n acquisition: CatalogAcquisitionRecord;\n name: string;\n }): Promise<{ assetId: string }>;\n}\n\nexport interface CatalogEnrollmentPort {\n enroll(\n input: LearnerRequest & { curriculumId: string; courseId: string },\n ): Promise<{\n id: string;\n }>;\n}\n\nexport interface CatalogMaterializationRequest {\n tenantId: string;\n actorUserId: string;\n acquisitionId: string;\n /** Required when provider metadata does not classify a subject. */\n subject?: string;\n courseTitle?: string;\n lessonTitle?: string;\n curriculumId?: string;\n learnerId?: string;\n guardianRelationshipId?: string;\n}\n\n/** Host derives this from current memberships and guardian terms; callers never supply roles. */\nexport type CatalogMaterializationAuthorizer = (input: {\n tenantId: string;\n actorUserId: string;\n executor: DatabaseInterface;\n action: 'education.catalog.materialize';\n}) => Promise<Readonly<{ allowed: boolean; roles: readonly string[] }>>;\n\nexport interface CatalogMaterializationResult {\n courseId: string;\n lessonId: string;\n assetId: string;\n revision: string;\n sha256: string;\n enrollmentId?: string;\n}\n\nasync function identity(...parts: string[]): Promise<string> {\n const digest = await globalThis.crypto.subtle.digest(\n 'SHA-256',\n new TextEncoder().encode(\n JSON.stringify(['smrt.education.catalog.v1', ...parts]),\n ),\n );\n const hex = Array.from(new Uint8Array(digest), (byte) =>\n byte.toString(16).padStart(2, '0'),\n ).join('');\n return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-5${hex.slice(13, 16)}-a${hex.slice(17, 20)}-${hex.slice(20, 32)}`;\n}\n\n/** Both adapter file extensions and MIME media types preserve PDF layout. */\nexport function isPrintableAcquisitionFormat(format: string): boolean {\n return format === 'pdf' || format === 'application/pdf';\n}\n\n/** Creates a private course from an already-authorized, pinned acquisition. */\nexport class CatalogMaterializationService {\n constructor(\n private readonly db: DatabaseInterface,\n private readonly store: CatalogMaterializationStore,\n private readonly storage: CatalogMaterializationStorage,\n private readonly learner: CatalogEnrollmentPort | undefined,\n private readonly authorize: CatalogMaterializationAuthorizer,\n private readonly policy = new CatalogPolicy(),\n ) {}\n\n async materialize(\n request: CatalogMaterializationRequest,\n ): Promise<CatalogMaterializationResult> {\n const active = getCurrentTenant();\n if (\n !request.tenantId?.trim() ||\n !request.actorUserId?.trim() ||\n active?.tenantId !== request.tenantId ||\n active.userId !== request.actorUserId ||\n active.superAdminBypass\n )\n throw new Error('Trusted active tenant and actor identity are required.');\n const authorization = await this.authorize({\n tenantId: request.tenantId,\n actorUserId: request.actorUserId,\n executor: this.db,\n action: 'education.catalog.materialize',\n });\n if (!authorization.allowed || !authorization.roles.includes('guardian'))\n throw new Error('Active guardian authorization is required.');\n const actor: CatalogActor = {\n tenantId: request.tenantId,\n actorUserId: request.actorUserId,\n roles: authorization.roles,\n };\n const acquisition = await this.store.getAcquisition({\n tenantId: actor.tenantId,\n acquisitionId: request.acquisitionId,\n });\n if (!acquisition || acquisition.tenantId !== actor.tenantId)\n throw new Error('Pinned tenant acquisition was not found.');\n const resource = await this.store.getResource(acquisition.resourceId);\n if (!resource || resource.revision !== acquisition.revision)\n throw new Error('Pinned catalog resource revision was not found.');\n if (resource.withdrawnAt)\n throw new Error('Withdrawn catalog resource cannot be materialized.');\n // A teacher may inspect restricted metadata, but this learner-material\n // workflow never promotes it into a course, printable, or asset link.\n if (resource.visibility === 'teacher')\n throw new Error(\n 'Teacher-only material cannot be materialized for learners.',\n );\n const operation = isPrintableAcquisitionFormat(acquisition.format)\n ? 'print'\n : 'download';\n const decision = this.policy.authorize(resource, operation, actor);\n if (!decision.allowed)\n throw new Error(`Current catalog license does not permit ${operation}.`);\n const subject =\n resource.subjects?.find((value) => value.trim()) ??\n request.subject?.trim();\n if (!subject)\n throw new Error('Guardian subject classification is required.');\n const courseId = await identity(\n actor.tenantId,\n resource.providerId,\n resource.stableId,\n );\n const sectionId = await identity(courseId, 'materials');\n const lessonId = await identity(\n courseId,\n acquisition.revision,\n acquisition.format,\n );\n const asset = await this.storage.ensurePrivateAsset({\n tenantId: actor.tenantId,\n actorUserId: actor.actorUserId,\n acquisition,\n name: request.lessonTitle?.trim() || resource.title,\n });\n if (!asset.assetId)\n throw new Error('Materialized private asset is required.');\n if (!this.db.transaction)\n throw new Error('Catalog materialization requires a transaction.');\n await this.db.transaction(async (tx) => {\n const courses = await ExternalCourseCollection.create({ db: tx });\n const sections = await CourseSectionCollection.create({ db: tx });\n const readings = await ReadingCollection.create({ db: tx });\n const worksheets = await WorksheetCollection.create({ db: tx });\n const assets = await LessonAssetCollection.create({ db: tx });\n const course = await courses.get(courseId);\n if (course) {\n if (\n course.tenantId !== actor.tenantId ||\n course.sourceKey !== resource.providerId ||\n course.sourceRef !== resource.stableId ||\n course.licenseKind !== 'personal-use-copy'\n )\n throw new Error(\n 'Existing materialized course ownership cannot change.',\n );\n } else {\n await courses.create({\n id: courseId,\n tenantId: actor.tenantId,\n title: request.courseTitle?.trim() || resource.title,\n subject,\n sourceKey: resource.providerId,\n sourceRef: resource.stableId,\n sourceUrl: resource.canonicalUrl,\n license: resource.licenseEvidence.identifier ?? '',\n licenseKind: 'personal-use-copy',\n licenseNote: [\n resource.licenseEvidence.attribution,\n acquisition.sha256,\n ]\n .filter(Boolean)\n .join('\\n'),\n status: 'draft',\n });\n }\n if (!(await sections.get(sectionId)))\n await sections.create({\n id: sectionId,\n tenantId: actor.tenantId,\n courseId,\n title: 'Materials',\n sortOrder: 0,\n });\n // Acquisition formats are MIME types. Only a layout-preserving PDF is\n // printable; all other formats remain attachments for host-specific use.\n const printable = isPrintableAcquisitionFormat(acquisition.format);\n const lessons = printable ? worksheets : readings;\n if (!(await lessons.get(lessonId)))\n await lessons.create({\n id: lessonId,\n tenantId: actor.tenantId,\n sectionId,\n title: request.lessonTitle?.trim() || resource.title,\n externalRef: `${resource.stableId}@${acquisition.revision}`,\n externalUrl: resource.canonicalUrl,\n sortOrder: 0,\n });\n if (\n !(await assets.get({\n lessonId,\n assetId: asset.assetId,\n tenantId: actor.tenantId,\n }))\n )\n await assets.create({\n tenantId: actor.tenantId,\n lessonId,\n assetId: asset.assetId,\n relationship: printable ? 'printable' : 'attachment',\n });\n });\n let enrollmentId: string | undefined;\n if (request.curriculumId || request.learnerId) {\n if (!this.learner || !request.curriculumId || !request.learnerId)\n throw new Error(\n 'Learner, curriculum, and enrollment service are required.',\n );\n enrollmentId = (\n await this.learner.enroll({\n tenantId: actor.tenantId,\n actorUserId: actor.actorUserId,\n learnerId: request.learnerId,\n ...(request.guardianRelationshipId\n ? { guardianRelationshipId: request.guardianRelationshipId }\n : {}),\n curriculumId: request.curriculumId,\n courseId,\n })\n ).id;\n }\n return {\n courseId,\n lessonId,\n assetId: asset.assetId,\n revision: acquisition.revision,\n sha256: acquisition.sha256,\n ...(enrollmentId ? { enrollmentId } : {}),\n };\n }\n}\n","import { normalizeCatalogRepresentation } from './catalog-capability.js';\nimport type {\n CatalogActor,\n CatalogLicenseEvidence,\n CatalogResourceRepresentation,\n CatalogSourceRecord,\n} from './catalog-contracts.js';\nimport { CatalogPolicy } from './catalog-policy.js';\nimport { type CatalogPreview, catalogPreviewFor } from './catalog-preview.js';\n\nexport interface CatalogReadStore {\n search(input: { query?: string; subject?: string; grade?: string }): Promise<\n readonly (CatalogSourceRecord & {\n id: string;\n withdrawnAt?: string | null;\n })[]\n >;\n}\n\n/** Deliberately metadata-only DTO: credentials, byte locations, and teacher records stay server-side. */\nexport interface CatalogResourceView {\n id: string;\n providerId: string;\n stableId: string;\n revision: string;\n canonicalUrl: string;\n title: string;\n suppliedDescription?: string;\n author?: string;\n subjects?: string[];\n gradeRange?: { min?: string; max?: string };\n language?: string;\n resourceType?: string;\n parentStableId?: string;\n availableFormats?: string[];\n representation?: CatalogResourceRepresentation;\n preview?: CatalogPreview;\n license: Pick<\n CatalogLicenseEvidence,\n | 'state'\n | 'identifier'\n | 'version'\n | 'attribution'\n | 'exceptions'\n | 'retrievedAt'\n >;\n}\n\nexport class CatalogReadService {\n constructor(\n private readonly store: CatalogReadStore,\n private readonly policy = new CatalogPolicy(),\n ) {}\n\n async search(\n actor: CatalogActor,\n filter: { query?: string; subject?: string; grade?: string } = {},\n ): Promise<CatalogResourceView[]> {\n if (!actor.tenantId.trim() || !actor.actorUserId.trim())\n throw new Error('Trusted tenant and actor identity are required.');\n const records = await this.store.search(filter);\n return records\n .filter(\n (record) => !record.withdrawnAt && this.policy.canView(record, actor),\n )\n .map((record) => this.view(record));\n }\n\n private view(\n record: CatalogSourceRecord & { id: string },\n ): CatalogResourceView {\n const { licenseEvidence } = record;\n const representation = normalizeCatalogRepresentation(\n record.representation,\n );\n const preview = catalogPreviewFor(record);\n return {\n id: record.id,\n providerId: record.providerId,\n stableId: record.stableId,\n revision: record.revision,\n canonicalUrl: record.canonicalUrl,\n title: record.title,\n ...(record.suppliedDescription\n ? { suppliedDescription: record.suppliedDescription }\n : {}),\n ...(record.author ? { author: record.author } : {}),\n ...(record.subjects ? { subjects: [...record.subjects] } : {}),\n ...(record.gradeRange ? { gradeRange: { ...record.gradeRange } } : {}),\n ...(record.language ? { language: record.language } : {}),\n ...(record.resourceType ? { resourceType: record.resourceType } : {}),\n ...(record.parentStableId\n ? { parentStableId: record.parentStableId }\n : {}),\n ...(record.availableFormats\n ? { availableFormats: [...record.availableFormats] }\n : {}),\n ...(representation ? { representation } : {}),\n ...(preview ? { preview } : {}),\n license: {\n state: licenseEvidence.state,\n ...(licenseEvidence.identifier\n ? { identifier: licenseEvidence.identifier }\n : {}),\n ...(licenseEvidence.version\n ? { version: licenseEvidence.version }\n : {}),\n ...(licenseEvidence.attribution\n ? { attribution: licenseEvidence.attribution }\n : {}),\n ...(licenseEvidence.exceptions\n ? { exceptions: licenseEvidence.exceptions }\n : {}),\n ...(licenseEvidence.retrievedAt\n ? { retrievedAt: licenseEvidence.retrievedAt }\n : {}),\n },\n };\n }\n}\n","import type {\n CatalogSourceRecord,\n CatalogSyncAdapter,\n CatalogSyncCheckpoint,\n CatalogSyncFailure,\n} from './catalog-contracts.js';\n\nexport interface CatalogSyncStore {\n getCheckpoint(providerId: string): Promise<CatalogSyncCheckpoint | undefined>;\n saveCheckpoint(checkpoint: CatalogSyncCheckpoint): Promise<void>;\n upsert(record: CatalogSourceRecord, runId: string): Promise<void>;\n withdrawUnseen(providerId: string, runId: string): Promise<number>;\n}\n\n/** Policy counts cover only pages processed by the current sync invocation. */\nexport interface CatalogExclusionSummary {\n total: number;\n byCode: { code: string; count: number }[];\n otherCount: number;\n}\nexport interface CatalogFailureSummary {\n total: number;\n historical: boolean;\n historicalCount: number;\n currentCount: number;\n omittedDetailCount: number;\n}\nexport interface CatalogSyncReport extends CatalogSyncCheckpoint {\n withdrawnCount: number;\n /** Invocation-local, bounded, report-only; never a full-generation coverage total. */\n exclusionSummary?: CatalogExclusionSummary;\n /** Historical diagnostics do not imply a current active failure. */\n failureSummary?: CatalogFailureSummary;\n}\n\nconst MAX_FAILURE_CODES = 31;\nconst MAX_POLICY_CODES = 32;\nconst OVERFLOW_CODE = 'additional-failures';\nfunction addCount(left: number, right: number): number {\n const result = left + right;\n if (!Number.isSafeInteger(result))\n throw new Error(\n 'Catalog diagnostic occurrence count exceeds the safe integer bound.',\n );\n return result;\n}\nfunction occurrenceCount(value: unknown): number {\n return typeof value === 'number' && Number.isSafeInteger(value) && value > 0\n ? value\n : 1;\n}\nfunction bounded(value: string, cap: number): string {\n return value.length > cap ? `${value.slice(0, cap - 12)} [truncated]` : value;\n}\ntype CountedFailure = CatalogSyncFailure & {\n count: number;\n omittedDetailCount: number;\n};\nfunction diagnostic(raw: CatalogSyncFailure): CountedFailure {\n const value: Partial<CatalogSyncFailure> =\n raw && typeof raw === 'object' ? raw : {};\n const count = occurrenceCount(value.count);\n const invalidCount = value.count !== undefined && count !== value.count;\n const code =\n typeof value.code === 'string' && value.code\n ? value.code\n : 'invalid-failure-entry';\n const message = `${invalidCount ? 'Invalid legacy occurrence count; counted once. ' : ''}${typeof value.message === 'string' ? value.message : 'Stored failure diagnostic is malformed.'}`;\n const cursor = typeof value.cursor === 'string' ? value.cursor : undefined;\n const truncated =\n code.length > 128 || message.length > 512 || (cursor?.length ?? 0) > 256;\n const suppliedOmitted =\n typeof value.omittedDetailCount === 'number' &&\n Number.isSafeInteger(value.omittedDetailCount) &&\n value.omittedDetailCount >= 0\n ? Math.min(count, value.omittedDetailCount)\n : 0;\n return {\n code: bounded(code, 128),\n message: bounded(message, 512),\n ...(cursor !== undefined ? { cursor: bounded(cursor, 256) } : {}),\n ...(typeof value.retryAfterMs === 'number' &&\n Number.isFinite(value.retryAfterMs) &&\n value.retryAfterMs >= 0\n ? { retryAfterMs: value.retryAfterMs }\n : {}),\n count,\n omittedDetailCount: truncated ? count : suppliedOmitted,\n };\n}\n/** Keep recent per-code facts and exact occurrence totals; declare omitted details. */\nfunction compactFailures(entries: CatalogSyncFailure[]): CountedFailure[] {\n const groups = new Map<string, CountedFailure>();\n let overflowCount = 0;\n for (const raw of entries) {\n const next = diagnostic(raw);\n if (next.code === OVERFLOW_CODE) {\n overflowCount = addCount(overflowCount, next.count);\n continue;\n }\n const previous = groups.get(next.code);\n if (previous) {\n const sameDetail =\n previous.message === next.message &&\n previous.cursor === next.cursor &&\n previous.retryAfterMs === next.retryAfterMs;\n next.omittedDetailCount = addCount(\n sameDetail ? previous.omittedDetailCount : previous.count,\n next.omittedDetailCount,\n );\n next.count = addCount(previous.count, next.count);\n groups.delete(next.code);\n } else if (groups.size === MAX_FAILURE_CODES) {\n const oldest = groups.values().next().value;\n if (oldest) {\n overflowCount = addCount(overflowCount, oldest.count);\n groups.delete(oldest.code);\n }\n }\n groups.set(next.code, next);\n }\n return [\n ...groups.values(),\n ...(overflowCount\n ? [\n {\n code: OVERFLOW_CODE,\n message:\n 'Additional failure diagnostics compacted; full detail is unavailable.',\n count: overflowCount,\n omittedDetailCount: overflowCount,\n },\n ]\n : []),\n ];\n}\nfunction totalFailures(entries: CatalogSyncFailure[]): number {\n return entries.reduce(\n (total, entry) => addCount(total, occurrenceCount(entry.count)),\n 0,\n );\n}\nfunction failure(error: unknown): CatalogSyncFailure {\n const value = error as {\n code?: unknown;\n message?: unknown;\n retryAfterMs?: unknown;\n };\n return {\n code: String(value?.code ?? 'enumeration-failed'),\n message: String(value?.message ?? error),\n ...(typeof value?.retryAfterMs === 'number'\n ? { retryAfterMs: value.retryAfterMs }\n : {}),\n };\n}\n\n/** Durable metadata synchronization. It never invokes a content acquisition adapter. */\nexport class CatalogSyncService {\n constructor(\n private readonly store: CatalogSyncStore,\n private readonly retries = 2,\n private readonly maxPages = 100,\n ) {}\n\n async sync(\n providerId: string,\n adapter: CatalogSyncAdapter,\n ): Promise<CatalogSyncReport> {\n if (!providerId.trim()) throw new Error('A provider ID is required.');\n const saved = await this.store.getCheckpoint(providerId);\n const resuming = saved?.complete === false;\n const runId = resuming\n ? (saved.runId ?? globalThis.crypto.randomUUID())\n : globalThis.crypto.randomUUID();\n let checkpoint: CatalogSyncCheckpoint = {\n providerId,\n cursor: resuming ? saved?.cursor : undefined,\n complete: false,\n importedCount: resuming ? (saved?.importedCount ?? 0) : 0,\n failures: compactFailures(resuming ? (saved?.failures ?? []) : []),\n runId,\n };\n const historicalCount = totalFailures(checkpoint.failures);\n let currentCount = 0;\n let withdrawnCount = 0;\n let policyTotal = 0;\n let otherCount = 0;\n const policyCodes = new Map<string, number>();\n const report = (): CatalogSyncReport => ({\n ...checkpoint,\n withdrawnCount,\n exclusionSummary: {\n total: policyTotal,\n byCode: [...policyCodes].map(([code, count]) => ({ code, count })),\n otherCount,\n },\n failureSummary: {\n total: totalFailures(checkpoint.failures),\n historical: historicalCount > 0,\n historicalCount,\n currentCount,\n omittedDetailCount: checkpoint.failures.reduce(\n (total, entry) => addCount(total, entry.omittedDetailCount ?? 0),\n 0,\n ),\n },\n });\n const pause = async (\n reason: string,\n entries: CatalogSyncFailure[],\n ): Promise<CatalogSyncReport> => {\n currentCount = addCount(\n currentCount,\n totalFailures(entries.map(diagnostic)),\n );\n checkpoint = {\n ...checkpoint,\n complete: false,\n paused: true,\n pauseReason: bounded(reason, 512),\n failures: compactFailures([...checkpoint.failures, ...entries]),\n };\n await this.store.saveCheckpoint(checkpoint);\n return report();\n };\n const cursors = new Set<string>();\n if (checkpoint.cursor) cursors.add(checkpoint.cursor);\n for (let pageCount = 0; pageCount < this.maxPages; pageCount++) {\n let page:\n | Awaited<ReturnType<CatalogSyncAdapter['enumerate']>>\n | undefined;\n let lastFailure: CatalogSyncFailure | undefined;\n for (let attempt = 0; attempt <= this.retries; attempt++) {\n try {\n page = await adapter.enumerate({\n cursor: checkpoint.cursor,\n checkpoint,\n });\n break;\n } catch (error) {\n lastFailure = failure(error);\n }\n }\n if (!page) {\n const terminalFailure = lastFailure ?? {\n code: 'enumeration-failed',\n message: 'Adapter returned no catalog page.',\n };\n return await pause(terminalFailure.message, [terminalFailure]);\n }\n if (page.complete && page.nextCursor)\n throw new Error('A terminal catalog page cannot have a next cursor.');\n if (\n !page.complete &&\n !page.nextCursor &&\n !page.paused &&\n !page.exclusions?.length &&\n !page.policyExclusions?.length\n )\n throw new Error('A partial catalog page requires a next cursor.');\n for (const omission of page.policyExclusions ?? []) {\n const count = occurrenceCount(omission.count);\n policyTotal = addCount(policyTotal, count);\n const code =\n typeof omission.code === 'string' &&\n /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$/.test(omission.code)\n ? omission.code\n : 'invalid-policy-code';\n if (policyCodes.has(code) || policyCodes.size < MAX_POLICY_CODES)\n policyCodes.set(code, addCount(policyCodes.get(code) ?? 0, count));\n else otherCount = addCount(otherCount, count);\n }\n // Current operational failures never advance, withdraw, or claim success.\n // Saved legacy diagnostics remain audit history, without guessed reclassification.\n if (page.paused || page.exclusions?.length) {\n const entries = page.exclusions?.length\n ? page.exclusions\n : [{ code: 'paused', message: 'Catalog source is paused.' }];\n return await pause(entries[0].message, entries);\n }\n for (const record of page.records) {\n if (\n record.providerId !== providerId ||\n !record.stableId ||\n !record.revision\n )\n throw new Error(\n 'Catalog records require matching provider, stable ID, and revision.',\n );\n await this.store.upsert(record, runId);\n }\n checkpoint = {\n ...checkpoint,\n cursor:\n page.nextCursor ?? (page.complete ? undefined : checkpoint.cursor),\n complete: page.complete,\n paused: false,\n pauseReason: undefined,\n importedCount: checkpoint.importedCount + page.records.length,\n };\n if (!page.complete) {\n if (!page.nextCursor) {\n // A valid snapshot can be retained while its declared coverage is\n // explicitly unconfirmed. This is a controlled policy pause, not an\n // access/parse failure, and can never authorize withdrawal.\n checkpoint = {\n ...checkpoint,\n paused: true,\n pauseReason: bounded(\n page.policyExclusions?.[0]?.message ??\n 'Catalog scope is incomplete.',\n 512,\n ),\n };\n await this.store.saveCheckpoint(checkpoint);\n return report();\n }\n if (checkpoint.cursor && cursors.has(checkpoint.cursor))\n return await pause('Catalog source did not advance its cursor.', [\n {\n cursor: checkpoint.cursor,\n code: 'cursor-cycle',\n message: 'Catalog source did not advance its cursor.',\n },\n ]);\n if (checkpoint.cursor) cursors.add(checkpoint.cursor);\n await this.store.saveCheckpoint(checkpoint);\n continue;\n }\n withdrawnCount = await this.store.withdrawUnseen(providerId, runId);\n checkpoint = {\n providerId,\n complete: true,\n importedCount: checkpoint.importedCount,\n failures: checkpoint.failures,\n lastSuccessfulAt: new Date().toISOString(),\n };\n await this.store.saveCheckpoint(checkpoint);\n return report();\n }\n // A controlled invocation budget is a resumable yield, not a source failure.\n checkpoint = {\n ...checkpoint,\n complete: false,\n paused: false,\n pauseReason: undefined,\n };\n await this.store.saveCheckpoint(checkpoint);\n return report();\n }\n}\n","import {\n field,\n SmrtCollection,\n SmrtObject,\n type SmrtSaveOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\n\nexport type SourceSharing = 'private' | 'group' | 'global';\nexport type CourseSourceKind = 'manual' | 'url' | 'adapter';\nexport interface CourseSourceConfig {\n /** Host-recorded written permission for a shared import, never learner input. */\n licenseEvidence?: string;\n}\n\n/** Host-managed source policy; deliberately has no generated CRUD surface. */\n@TenantScoped({ mode: 'required' })\n@smrt({ api: false, cli: false, mcp: false })\nexport class CourseSource extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-education\";\n @tenantId() tenantId = '';\n @field({ required: true }) key = '';\n @field({ required: true }) name = '';\n kind: CourseSourceKind = 'adapter';\n adapterKey = 'easy-peasy';\n config = '{}';\n sharing: SourceSharing = 'private';\n\n constructor(options: Record<string, unknown> = {}) {\n super(options);\n for (const [key, value] of Object.entries(options)) {\n if (Object.hasOwn(this, key))\n (this as unknown as Record<string, unknown>)[key] = value;\n }\n }\n\n getConfig(): CourseSourceConfig {\n const value: unknown = JSON.parse(this.config);\n if (!value || typeof value !== 'object' || Array.isArray(value))\n throw new Error('CourseSource config must be an object.');\n const record = value as Record<string, unknown>;\n if (\n Object.keys(record).some((key) => key !== 'licenseEvidence') ||\n (record.licenseEvidence !== undefined &&\n typeof record.licenseEvidence !== 'string')\n )\n throw new Error('Invalid CourseSource config.');\n return {\n ...(record.licenseEvidence === undefined\n ? {}\n : { licenseEvidence: record.licenseEvidence as string }),\n };\n }\n\n setConfig(value: CourseSourceConfig): void {\n const previous = this.config;\n this.config = JSON.stringify(value);\n try {\n this.getConfig();\n } catch (error) {\n this.config = previous;\n throw error;\n }\n }\n\n override async save(options?: SmrtSaveOptions): Promise<this> {\n if (\n !['private', 'group', 'global'].includes(this.sharing) ||\n !['manual', 'url', 'adapter'].includes(this.kind)\n )\n throw new Error('Invalid CourseSource kind or sharing.');\n this.getConfig();\n return super.save(options);\n }\n}\n\nexport class CourseSourceCollection extends SmrtCollection<CourseSource> {\n static readonly _itemClass = CourseSource;\n}\n","import type { CatalogSourceRecord } from '../catalog-contracts.js';\n\nconst host = 'im.kendallhunt.com';\n\nfunction text(value: string): string {\n return value\n .replace(/<[^>]+>/g, ' ')\n .replace(/\\s+/g, ' ')\n .trim();\n}\n\n/**\n * Parses the publicly linked K-5 family curriculum index published by the IM\n * Certified Kendall Hunt site. It is deliberately metadata-only: unit and\n * lesson pages are not fetched or acquired here.\n */\nexport function parseIllustrativeMathematicsK5Index(\n html: string,\n revision: string,\n pageUrl = 'https://im.kendallhunt.com/k5/curriculum.html',\n): CatalogSourceRecord[] {\n const index = new URL(pageUrl);\n if (index.protocol !== 'https:' || index.hostname !== host)\n throw new Error(\n 'Illustrative Mathematics index must use the official HTTPS host.',\n );\n if (!revision.trim())\n throw new Error('Illustrative Mathematics revision is required.');\n\n const records: CatalogSourceRecord[] = [];\n const seen = new Set<string>();\n const anchors = /<a\\b([^>]*)>([\\s\\S]*?)<\\/a\\s*>/gi;\n for (const match of html.matchAll(anchors)) {\n const href = /\\bhref\\s*=\\s*[\"']([^\"']+)[\"']/i.exec(match[1])?.[1];\n if (!href) continue;\n const url = new URL(href, index);\n const grade =\n /^\\/K5\\/families\\/(kindergarten|grade-[1-5])\\/units\\.html$/i.exec(\n url.pathname,\n )?.[1];\n if (!grade || url.hostname !== host || seen.has(url.pathname)) continue;\n seen.add(url.pathname);\n const gradeLabel =\n grade === 'kindergarten' ? 'K' : grade.slice('grade-'.length);\n records.push({\n providerId: 'illustrative-mathematics',\n stableId: `k5-family-${grade.toLowerCase()}`,\n revision,\n canonicalUrl: url.toString(),\n title: `IM K-5 Math Grade ${gradeLabel}`,\n suppliedDescription: text(match[2]) || undefined,\n subjects: ['mathematics'],\n gradeRange: { min: gradeLabel, max: gradeLabel },\n language: 'en',\n resourceType: 'course',\n availableFormats: ['html'],\n licenseEvidence: {\n state: 'verified',\n identifier: 'CC BY',\n version: '4.0',\n sourceUrl: 'https://creativecommons.org/licenses/by/4.0/',\n retrievedAt: revision,\n permittedOperations: [\n 'link',\n 'adapt',\n 'redistribute',\n 'commercial-use',\n ],\n },\n visibility: 'catalog',\n });\n }\n if (!records.length)\n throw new Error(\n 'Illustrative Mathematics K-5 index has no family-grade links.',\n );\n return records;\n}\n","import type { CatalogSourceRecord } from '../catalog-contracts.js';\n\nconst maximumFeedBytes = 2_000_000;\nconst namedEntities: Readonly<Record<string, string>> = {\n '&': '&',\n ''': \"'\",\n '>': '>',\n '<': '<',\n '"': '\"',\n};\n\nfunction decode(value: string): string {\n return value\n .replace(/<!\\[CDATA\\[([\\s\\S]*?)\\]\\]>/g, '$1')\n .replace(/<[^>]+>/g, ' ')\n .replace(\n /&(?:amp|apos|gt|lt|quot);/g,\n (entity) => namedEntities[entity] ?? entity,\n )\n .replace(/\\s+/g, ' ')\n .trim();\n}\n\nfunction element(xml: string, names: readonly string[]): string | undefined {\n for (const name of names) {\n const match = new RegExp(\n `<${name}\\\\b[^>]*>([\\\\s\\\\S]*?)<\\\\/${name}\\\\s*>`,\n 'i',\n ).exec(xml);\n const value = match ? decode(match[1]) : '';\n if (value) return value;\n }\n return undefined;\n}\n\nfunction elements(xml: string, names: readonly string[]): string[] {\n const values: string[] = [];\n for (const name of names) {\n const expression = new RegExp(\n `<${name}\\\\b[^>]*>([\\\\s\\\\S]*?)<\\\\/${name}\\\\s*>`,\n 'gi',\n );\n for (const match of xml.matchAll(expression)) {\n const value = decode(match[1]);\n if (value) values.push(value);\n }\n }\n return [...new Set(values)];\n}\n\nfunction https(value: string | undefined): string | undefined {\n if (!value) return undefined;\n try {\n const url = new URL(value);\n return url.protocol === 'https:' && !url.username && !url.password\n ? url.toString()\n : undefined;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Parses a configured OER Commons/ISKME RSS or Dublin Core feed without entity\n * expansion or external resolution. The configured feed is authoritative for\n * scope; this parser never represents its page as global catalog coverage.\n */\nexport function parseOerCommonsRssFeed(\n xml: string,\n revision: string,\n): CatalogSourceRecord[] {\n if (new TextEncoder().encode(xml).byteLength > maximumFeedBytes)\n throw new Error('OER Commons RSS feed exceeds the 2 MB metadata limit.');\n if (/<!DOCTYPE|<!ENTITY/i.test(xml))\n throw new Error('OER Commons RSS feed must not contain DTDs or entities.');\n if (!revision.trim())\n throw new Error('OER Commons feed revision is required.');\n\n const records: CatalogSourceRecord[] = [];\n const items = xml.match(/<item\\b[^>]*>[\\s\\S]*?<\\/item\\s*>/gi) ?? [];\n for (const item of items) {\n const canonicalUrl = https(element(item, ['link', 'dc:identifier']));\n const stableId = element(item, ['guid', 'dc:identifier']) ?? canonicalUrl;\n const title = element(item, ['title', 'dc:title']);\n if (!canonicalUrl || !stableId || !title) continue;\n const rights = element(item, ['license', 'dc:rights', 'rights']);\n const licenseUrl = https(rights);\n records.push({\n providerId: 'oer-commons',\n stableId,\n revision: element(item, ['dc:date', 'pubDate']) ?? revision,\n canonicalUrl,\n title,\n suppliedDescription: element(item, ['description', 'dc:description']),\n author: element(item, ['dc:creator', 'author']),\n subjects: elements(item, ['category', 'dc:subject']),\n language: element(item, ['dc:language', 'language']),\n resourceType: element(item, ['dc:type']) ?? 'resource',\n availableFormats: elements(item, ['dc:format']),\n licenseEvidence: rights\n ? {\n // A feed label is provenance, not a license validation decision.\n state: 'unknown',\n identifier: rights,\n ...(licenseUrl ? { sourceUrl: licenseUrl } : {}),\n retrievedAt: revision,\n }\n : { state: 'unknown', retrievedAt: revision },\n visibility: 'catalog',\n });\n }\n if (!records.length)\n throw new Error('OER Commons RSS feed has no complete metadata items.');\n return records;\n}\n","import type {\n CatalogSourceRecord,\n CatalogSyncAdapter,\n CatalogSyncCheckpoint,\n CatalogSyncPage,\n} from './catalog-contracts.js';\nimport { parseIllustrativeMathematicsK5Index } from './sources/illustrative-mathematics-parser.js';\nimport { parseOerCommonsRssFeed } from './sources/oer-commons-rss-parser.js';\n\nexport type HearthCatalogProviderId =\n | 'illustrative-mathematics'\n | 'ck12'\n | 'oer-commons';\n\n/**\n * A host-supplied integration for a provider-approved metadata feed. The\n * provider must approve the exact feed URL and credentials before it is used.\n * This deliberately does not guess a public endpoint or scrape course pages.\n */\nexport interface AuthorizedCatalogFeed {\n providerId: HearthCatalogProviderId;\n metadataFeedUrl: string;\n termsAccepted: true;\n enumerate(input: {\n cursor?: string;\n checkpoint: CatalogSyncCheckpoint;\n }): Promise<CatalogSyncPage>;\n}\n\nexport interface ProviderMetadataResponse {\n ok: boolean;\n status: number;\n url: string;\n headers: { get(name: string): string | null };\n text(): Promise<string>;\n}\nexport type ProviderMetadataFetch = (\n url: string,\n options: {\n redirect: 'error';\n headers: { accept: string };\n signal?: AbortSignal;\n },\n) => Promise<ProviderMetadataResponse>;\n\nconst DEFAULT_METADATA_TIMEOUT_MS = 10_000;\n\nexport interface PublicIllustrativeMathematicsK5Config {\n /** The official K-5 curriculum index; defaults to the published index. */\n indexUrl?: string;\n fetch: ProviderMetadataFetch;\n /** Bounds both the provider request and response-body read. */\n timeoutMs?: number;\n}\nexport interface OerCommonsRssConfig {\n /** An ISKME/OER Commons-approved RSS or DC feed URL for an agreed collection. */\n feedUrl: string;\n fetch: ProviderMetadataFetch;\n /** Bounds both the provider request and response-body read. */\n timeoutMs?: number;\n /** Only set after the feed owner confirms this snapshot is terminal for its scope. */\n terminalSnapshot?: true;\n}\n\nexport interface ProviderFeedRequirement {\n providerId: HearthCatalogProviderId;\n requirement: string;\n}\n\nexport const providerFeedRequirements: readonly ProviderFeedRequirement[] = [\n {\n providerId: 'illustrative-mathematics',\n requirement:\n 'A provider-approved, paginated metadata feed plus written catalog-harvesting permission.',\n },\n {\n providerId: 'ck12',\n requirement:\n 'CK-12-approved catalog-feed access and credentials; ordinary web access is not an enumeration API.',\n },\n {\n providerId: 'oer-commons',\n requirement:\n 'OER Commons-approved paginated metadata-feed access with each record’s publisher and license fields.',\n },\n];\n\nfunction unavailablePage(providerId: HearthCatalogProviderId): CatalogSyncPage {\n const requirement = providerFeedRequirements.find(\n (entry) => entry.providerId === providerId,\n );\n return {\n records: [],\n complete: false,\n paused: true,\n exclusions: [\n {\n code: 'provider_feed_not_configured',\n message: requirement?.requirement ?? 'Provider feed is not configured.',\n },\n ],\n };\n}\n\nfunction retryAfter(\n headers: ProviderMetadataResponse['headers'],\n): number | undefined {\n const value = headers.get('retry-after');\n if (!value) return undefined;\n const seconds = Number(value);\n return Number.isFinite(seconds) && seconds >= 0 ? seconds * 1000 : undefined;\n}\n\nfunction httpsUrl(value: string, provider: string): string {\n let url: URL;\n try {\n url = new URL(value);\n } catch {\n throw new Error(`${provider} metadata URL is invalid.`);\n }\n if (url.protocol !== 'https:' || url.username || url.password || url.port)\n throw new Error(`${provider} metadata URL must be credential-free HTTPS.`);\n return url.toString();\n}\n\nasync function fetchMetadata(\n fetch: ProviderMetadataFetch,\n url: string,\n accept: string,\n timeoutMs = DEFAULT_METADATA_TIMEOUT_MS,\n): Promise<{ body: string; revision: string } | CatalogSyncPage> {\n const controller = new AbortController();\n const bounded = async <T>(operation: Promise<T>): Promise<T> => {\n let timer: ReturnType<typeof setTimeout> | undefined;\n try {\n return await Promise.race([\n operation,\n new Promise<T>((_resolve, reject) => {\n timer = setTimeout(() => {\n controller.abort();\n reject(new Error('Provider metadata request timed out.'));\n }, timeoutMs);\n }),\n ]);\n } finally {\n if (timer) clearTimeout(timer);\n }\n };\n let response: ProviderMetadataResponse;\n try {\n response = await bounded(\n fetch(url, {\n redirect: 'error',\n headers: { accept },\n signal: controller.signal,\n }),\n );\n } catch (error) {\n return {\n records: [],\n complete: false,\n paused: true,\n exclusions: [\n {\n code: 'provider_feed_failed',\n message:\n error instanceof Error ? error.message : 'Metadata request failed.',\n },\n ],\n };\n }\n if (response.status === 429)\n return {\n records: [],\n complete: false,\n exclusions: [\n {\n code: 'provider_rate_limited',\n message: 'Provider metadata request was rate limited.',\n retryAfterMs: retryAfter(response.headers),\n },\n ],\n };\n if (!response.ok)\n return {\n records: [],\n complete: false,\n exclusions: [\n {\n code: 'provider_feed_failed',\n message: `Provider metadata request failed with HTTP ${response.status}.`,\n },\n ],\n };\n if (response.url !== url)\n return {\n records: [],\n complete: false,\n exclusions: [\n {\n code: 'unexpected_provider_redirect',\n message:\n 'Provider metadata response URL did not match the configured URL.',\n },\n ],\n };\n let body: string;\n try {\n body = await bounded(response.text());\n } catch (error) {\n return {\n records: [],\n complete: false,\n paused: true,\n exclusions: [\n {\n code: 'provider_feed_failed',\n message:\n error instanceof Error ? error.message : 'Metadata read failed.',\n },\n ],\n };\n }\n if (new TextEncoder().encode(body).byteLength > 2_000_000)\n return {\n records: [],\n complete: false,\n exclusions: [\n {\n code: 'provider_metadata_oversized',\n message: 'Provider metadata response exceeds 2 MB.',\n },\n ],\n };\n const revision =\n response.headers.get('etag') ?? response.headers.get('last-modified');\n if (!revision)\n return {\n records: [],\n complete: false,\n exclusions: [\n {\n code: 'provider_revision_unavailable',\n message:\n 'Provider metadata response supplied no ETag or Last-Modified revision.',\n },\n ],\n };\n return { body, revision };\n}\n\nfunction validRecord(\n providerId: HearthCatalogProviderId,\n record: CatalogSourceRecord,\n): boolean {\n return (\n record.providerId === providerId &&\n record.stableId.trim().length > 0 &&\n record.revision.trim().length > 0 &&\n record.title.trim().length > 0 &&\n /^https:\\/\\//.test(record.canonicalUrl) &&\n typeof record.licenseEvidence.state === 'string'\n );\n}\n\n/**\n * Protects catalog state from optimistic completion and malformed provider\n * data. An unavailable feed stays explicitly incomplete and resumable.\n */\nexport class AuthorizedCatalogFeedAdapter implements CatalogSyncAdapter {\n constructor(\n private readonly providerId: HearthCatalogProviderId,\n private readonly feed?: AuthorizedCatalogFeed,\n ) {}\n\n async enumerate(input: {\n cursor?: string;\n checkpoint: CatalogSyncCheckpoint;\n }): Promise<CatalogSyncPage> {\n if (!this.feed) return unavailablePage(this.providerId);\n if (\n this.feed.providerId !== this.providerId ||\n this.feed.termsAccepted !== true ||\n !/^https:\\/\\//.test(this.feed.metadataFeedUrl)\n )\n return unavailablePage(this.providerId);\n\n try {\n const page = await this.feed.enumerate(input);\n const malformed = page.records.filter(\n (record) => !validRecord(this.providerId, record),\n );\n if (malformed.length) {\n return {\n records: page.records.filter((record) =>\n validRecord(this.providerId, record),\n ),\n complete: false,\n nextCursor: input.cursor,\n exclusions: [\n ...(page.exclusions ?? []),\n {\n cursor: input.cursor,\n code: 'invalid_provider_metadata',\n message: `${malformed.length} provider records lack required stable metadata or license evidence.`,\n },\n ],\n };\n }\n if (page.complete && page.nextCursor)\n return {\n records: page.records,\n complete: false,\n nextCursor: page.nextCursor,\n exclusions: [\n ...(page.exclusions ?? []),\n {\n cursor: input.cursor,\n code: 'contradictory_terminal_page',\n message:\n 'A terminal provider page cannot also declare a next cursor.',\n },\n ],\n };\n return page;\n } catch (error) {\n return {\n records: [],\n complete: false,\n nextCursor: input.cursor,\n exclusions: [\n {\n cursor: input.cursor,\n code: 'provider_feed_failed',\n message:\n error instanceof Error\n ? error.message\n : 'Provider metadata feed failed without an error message.',\n },\n ],\n };\n }\n }\n}\n\nexport function createIllustrativeMathematicsAdapter(\n feed?: AuthorizedCatalogFeed,\n): CatalogSyncAdapter {\n return new AuthorizedCatalogFeedAdapter('illustrative-mathematics', feed);\n}\n\n/** Enumerates only the public K-5 course index, never claims all IM coverage. */\nexport function createPublicIllustrativeMathematicsK5Adapter(\n config: PublicIllustrativeMathematicsK5Config,\n): CatalogSyncAdapter {\n return {\n async enumerate(input) {\n if (input.cursor)\n return {\n records: [],\n complete: false,\n exclusions: [\n {\n cursor: input.cursor,\n code: 'unsupported_provider_cursor',\n message: 'The public IM K-5 index has no pagination cursor.',\n },\n ],\n };\n const url = httpsUrl(\n config.indexUrl ?? 'https://im.kendallhunt.com/k5/curriculum.html',\n 'Illustrative Mathematics',\n );\n const result = await fetchMetadata(\n config.fetch,\n url,\n 'text/html,application/xhtml+xml',\n config.timeoutMs,\n );\n if ('complete' in result) return result;\n try {\n return {\n records: parseIllustrativeMathematicsK5Index(\n result.body,\n result.revision,\n url,\n ),\n complete: false,\n policyExclusions: [\n {\n code: 'partial_provider_coverage',\n message:\n 'The public IM K-5 index is not a complete IM catalog feed.',\n },\n ],\n };\n } catch (error) {\n return {\n records: [],\n complete: false,\n exclusions: [\n {\n code: 'provider_metadata_invalid',\n message:\n error instanceof Error\n ? error.message\n : 'IM metadata parsing failed.',\n },\n ],\n };\n }\n },\n };\n}\n\nexport function createCk12Adapter(\n feed?: AuthorizedCatalogFeed,\n): CatalogSyncAdapter {\n return new AuthorizedCatalogFeedAdapter('ck12', feed);\n}\n\nexport function createOerCommonsAdapter(\n feed?: AuthorizedCatalogFeed,\n): CatalogSyncAdapter {\n return new AuthorizedCatalogFeedAdapter('oer-commons', feed);\n}\n\n/** Parses an ISKME/OER Commons-approved RSS or Dublin Core collection feed. */\nexport function createOerCommonsRssAdapter(\n config: OerCommonsRssConfig,\n): CatalogSyncAdapter {\n return {\n async enumerate(input) {\n if (input.cursor)\n return {\n records: [],\n complete: false,\n exclusions: [\n {\n cursor: input.cursor,\n code: 'unsupported_provider_cursor',\n message:\n 'Configured OER RSS/DC feeds are snapshot feeds without cursors.',\n },\n ],\n };\n const url = httpsUrl(config.feedUrl, 'OER Commons');\n const result = await fetchMetadata(\n config.fetch,\n url,\n 'application/rss+xml, application/xml, text/xml',\n config.timeoutMs,\n );\n if ('complete' in result) return result;\n try {\n return {\n records: parseOerCommonsRssFeed(result.body, result.revision),\n complete: config.terminalSnapshot === true,\n ...(config.terminalSnapshot === true\n ? {}\n : {\n policyExclusions: [\n {\n code: 'partial_provider_coverage',\n message:\n 'Configured OER feed scope has not been confirmed as terminal.',\n },\n ],\n }),\n };\n } catch (error) {\n return {\n records: [],\n complete: false,\n exclusions: [\n {\n code: 'provider_metadata_invalid',\n message:\n error instanceof Error\n ? error.message\n : 'OER RSS/DC parsing failed.',\n },\n ],\n };\n }\n },\n };\n}\n","import type {\n SourceImportRequest,\n SourceImportResult,\n SourceImportService,\n} from './source-import-service.js';\n\nexport type EasyPeasyGrade4Variant =\n | 'core'\n | 'shared-theme-choice'\n | 'once-weekly';\n\n/**\n * Official source pointers only. Theme rows represent a family choice and are\n * never automatically combined into an enrollment.\n */\nexport interface EasyPeasyGrade4Course {\n courseRef: string;\n title: string;\n pageUrl: string;\n subject: string;\n variant: EasyPeasyGrade4Variant;\n enrollmentMode: 'individual' | 'choose-one-theme';\n}\nexport interface EasyPeasyGrade4Theme {\n themeId: 'theme-1' | 'theme-2' | 'theme-3' | 'theme-4';\n title: string;\n courses: readonly EasyPeasyGrade4Course[];\n}\nexport interface EasyPeasyThemeImportResult {\n themeId: EasyPeasyGrade4Theme['themeId'];\n courseIds: readonly string[];\n}\n\nexport const easyPeasyGrade4Courses: readonly EasyPeasyGrade4Course[] = [\n {\n courseRef: 'grade-4-math',\n title: 'Math 4',\n subject: 'math',\n pageUrl: 'https://allinonehomeschool.com/ep-math-4/',\n variant: 'core',\n enrollmentMode: 'individual',\n },\n {\n courseRef: 'grade-4-reading',\n title: 'Reading 4',\n subject: 'reading',\n pageUrl: 'https://allinonehomeschool.com/reading-4/',\n variant: 'core',\n enrollmentMode: 'individual',\n },\n {\n courseRef: 'grade-4-language-arts',\n title: 'Language Arts 4',\n subject: 'language-arts',\n pageUrl: 'https://allinonehomeschool.com/language-arts-4/',\n variant: 'core',\n enrollmentMode: 'individual',\n },\n {\n courseRef: 'lower-elementary-theme-1',\n title: 'Theme 1: biology and ancient history',\n subject: 'shared-theme',\n pageUrl: 'https://allinonehomeschool.com/history-and-science-themes/',\n variant: 'shared-theme-choice',\n enrollmentMode: 'choose-one-theme',\n },\n {\n courseRef: 'lower-elementary-theme-2',\n title: 'Theme 2: zoology and early American history',\n subject: 'shared-theme',\n pageUrl: 'https://allinonehomeschool.com/history-and-science-themes/',\n variant: 'shared-theme-choice',\n enrollmentMode: 'choose-one-theme',\n },\n {\n courseRef: 'lower-elementary-theme-3',\n title: 'Theme 3: earth science and geography/cultures',\n subject: 'shared-theme',\n pageUrl: 'https://allinonehomeschool.com/history-and-science-themes/',\n variant: 'shared-theme-choice',\n enrollmentMode: 'choose-one-theme',\n },\n {\n courseRef: 'lower-elementary-theme-4',\n title: 'Theme 4: physics/chemistry and modern history',\n subject: 'shared-theme',\n pageUrl: 'https://allinonehomeschool.com/history-and-science-themes/',\n variant: 'shared-theme-choice',\n enrollmentMode: 'choose-one-theme',\n },\n {\n courseRef: 'lower-elementary-computer',\n title: 'Computer: Level 4 placement',\n subject: 'computer',\n pageUrl: 'https://allinonehomeschool.com/computer-fourth-level/',\n variant: 'once-weekly',\n enrollmentMode: 'individual',\n },\n {\n courseRef: 'lower-elementary-thinking',\n title: 'Thinking',\n subject: 'thinking',\n pageUrl: 'https://allinonehomeschool.com/thinking-levels-4-6/',\n variant: 'once-weekly',\n enrollmentMode: 'individual',\n },\n];\n\nexport function grade4Courses(\n variant?: EasyPeasyGrade4Variant,\n): readonly EasyPeasyGrade4Course[] {\n return variant\n ? easyPeasyGrade4Courses.filter((course) => course.variant === variant)\n : easyPeasyGrade4Courses;\n}\n\nfunction themeCourse(\n themeId: EasyPeasyGrade4Theme['themeId'],\n subject: string,\n title: string,\n pageUrl: string,\n): EasyPeasyGrade4Course {\n return {\n courseRef: `${themeId}-${subject}`,\n title,\n subject,\n pageUrl,\n variant: 'shared-theme-choice',\n enrollmentMode: 'individual',\n };\n}\n\n/**\n * Theme constituents are the official lower-level course pointers linked by\n * the source's themes and individual-course pages. A caller imports one theme,\n * never all four rotations.\n */\nexport const easyPeasyGrade4Themes: readonly EasyPeasyGrade4Theme[] = [\n {\n themeId: 'theme-1',\n title: 'Theme 1: biology and ancient history',\n courses: [\n themeCourse(\n 'theme-1',\n 'science',\n 'Science — Biology',\n 'https://allinonehomeschool.com/science-year-1/',\n ),\n themeCourse(\n 'theme-1',\n 'history',\n 'History — Ancient',\n 'https://allinonehomeschool.com/history-year-1/',\n ),\n themeCourse(\n 'theme-1',\n 'bible',\n 'Bible — Old Testament',\n 'https://allinonehomeschool.com/bible-year-1-2/',\n ),\n themeCourse(\n 'theme-1',\n 'art',\n 'Art — Ancient',\n 'https://allinonehomeschool.com/art-year-1/',\n ),\n themeCourse(\n 'theme-1',\n 'music',\n 'Music — Ancient',\n 'https://allinonehomeschool.com/1908-wright-brothers-flight-demonstration/music-year-1/',\n ),\n themeCourse(\n 'theme-1',\n 'pe-health',\n 'PE/Health — Strong and Healthy',\n 'https://allinonehomeschool.com/pehealth-odds/',\n ),\n ],\n },\n {\n themeId: 'theme-2',\n title: 'Theme 2: zoology and early American history',\n courses: [\n themeCourse(\n 'theme-2',\n 'science',\n 'Science — Zoology',\n 'https://allinonehomeschool.com/zoology/',\n ),\n themeCourse(\n 'theme-2',\n 'history',\n 'History — Early American',\n 'https://allinonehomeschool.com/early-american-history/',\n ),\n themeCourse(\n 'theme-2',\n 'bible',\n 'Bible — New Testament',\n 'https://allinonehomeschool.com/bible-newtestament/',\n ),\n themeCourse(\n 'theme-2',\n 'art',\n 'Art — Early American',\n 'https://allinonehomeschool.com/art-early-american/',\n ),\n themeCourse(\n 'theme-2',\n 'music',\n 'Music — Early American',\n 'https://allinonehomeschool.com/music-year-2/',\n ),\n themeCourse(\n 'theme-2',\n 'pe-health',\n 'PE/Health — Exercise and Nutrition',\n 'https://allinonehomeschool.com/pe-health/',\n ),\n ],\n },\n {\n themeId: 'theme-3',\n title: 'Theme 3: earth science and geography/cultures',\n courses: [\n themeCourse(\n 'theme-3',\n 'science',\n 'Science — Earth Science',\n 'https://allinonehomeschool.com/science-earth-science/',\n ),\n themeCourse(\n 'theme-3',\n 'history',\n 'History — Geography and Cultures',\n 'https://allinonehomeschool.com/geography-and-cultures/',\n ),\n themeCourse(\n 'theme-3',\n 'bible',\n 'Bible — Poetry',\n 'https://allinonehomeschool.com/bible-geography-and-cultures/',\n ),\n themeCourse(\n 'theme-3',\n 'art',\n 'Art — Geography and Cultures',\n 'https://allinonehomeschool.com/art-geography-and-cultures/',\n ),\n themeCourse(\n 'theme-3',\n 'music',\n 'Music — Geography and Cultures',\n 'https://allinonehomeschool.com/individual-courses-of-study/music-geography-and-cultures/',\n ),\n themeCourse(\n 'theme-3',\n 'pe-health',\n 'PE/Health — Strong and Healthy',\n 'https://allinonehomeschool.com/pehealth-odds/',\n ),\n ],\n },\n {\n themeId: 'theme-4',\n title: 'Theme 4: physics/chemistry and modern history',\n courses: [\n themeCourse(\n 'theme-4',\n 'science',\n 'Science — Physics and Chemistry',\n 'https://allinonehomeschool.com/science-year-4/',\n ),\n themeCourse(\n 'theme-4',\n 'history',\n 'History — Modern',\n 'https://allinonehomeschool.com/history-year-4/',\n ),\n themeCourse(\n 'theme-4',\n 'bible',\n 'Bible — Prophets',\n 'https://allinonehomeschool.com/bible/',\n ),\n themeCourse(\n 'theme-4',\n 'art',\n 'Art — Modern',\n 'https://allinonehomeschool.com/art-year-4/',\n ),\n themeCourse(\n 'theme-4',\n 'music',\n 'Music — Modern',\n 'https://allinonehomeschool.com/music/',\n ),\n themeCourse(\n 'theme-4',\n 'pe-health',\n 'PE/Health — Exercise and Nutrition',\n 'https://allinonehomeschool.com/pe-health/',\n ),\n ],\n },\n];\n\nexport function grade4Theme(\n themeId: EasyPeasyGrade4Theme['themeId'],\n): EasyPeasyGrade4Theme {\n const theme = easyPeasyGrade4Themes.find(\n (candidate) => candidate.themeId === themeId,\n );\n if (!theme) throw new Error('Unknown Easy Peasy Grade 4 theme.');\n return theme;\n}\n\n/** Calls the public pointer-only importer; it never fetches packets or lesson bodies. */\nexport async function importEasyPeasyGrade4Course(\n service: Pick<SourceImportService, 'importCourse'>,\n request: Omit<SourceImportRequest, 'courseRef' | 'pageUrl'> & {\n courseRef: string;\n },\n): Promise<SourceImportResult> {\n const course = easyPeasyGrade4Courses.find(\n (candidate) => candidate.courseRef === request.courseRef,\n );\n if (!course) throw new Error('Unknown Easy Peasy Grade 4 course reference.');\n if (course.enrollmentMode === 'choose-one-theme')\n throw new Error(\n 'Theme choices are catalog pointers; select an official constituent course before importing lessons.',\n );\n return service.importCourse({\n ...request,\n pageUrl: course.pageUrl,\n subject: course.subject,\n });\n}\n\nexport async function importEasyPeasyGrade4Theme(\n service: Pick<SourceImportService, 'importCourse'>,\n request: Omit<SourceImportRequest, 'courseRef' | 'pageUrl'> & {\n themeId: EasyPeasyGrade4Theme['themeId'];\n },\n): Promise<EasyPeasyThemeImportResult> {\n const theme = grade4Theme(request.themeId);\n const results = await Promise.all(\n theme.courses.map((course) =>\n service.importCourse({\n ...request,\n courseRef: course.courseRef,\n pageUrl: course.pageUrl,\n subject: course.subject,\n }),\n ),\n );\n return {\n themeId: theme.themeId,\n courseIds: results.map((result) => result.courseId),\n };\n}\n","import { SmrtRecipe } from '@happyvertical/smrt-core';\nimport { Course, CourseSection, Lesson } from './catalog.js';\nimport { Curriculum, Enrollment, Learner, LessonProgress } from './learners.js';\nimport { LessonAsset } from './lesson-assets.js';\n\nexport class EducationCatalogRecipe extends SmrtRecipe {\n static id = 'education.catalog';\n static help = './education-catalog.recipe.md';\n static label = 'Course catalog';\n static summary =\n 'Organize courses, sections, lessons, and their authorized learning materials.';\n static synonyms = ['courses', 'lessons', 'curriculum catalog'];\n static section = {\n id: 'education',\n label: 'Education',\n icon: 'folder',\n description: 'Courses and lessons for learning.',\n };\n static models = [Course, CourseSection, Lesson, LessonAsset];\n static runtime = 'both' as const;\n static nav = [\n {\n label: 'Courses',\n model: Course,\n icon: 'folder',\n description: 'Courses available to this family.',\n noun: 'course',\n },\n ];\n}\n\n/** Metadata for host composition; never grants generated CRUD authority. */\nexport class EducationLearnerRecipe extends SmrtRecipe {\n static id = 'education.learner';\n static help = './education-learner.recipe.md';\n static label = 'Learners';\n static summary =\n 'Plan learner curricula and retain enrollment-scoped progress.';\n static synonyms = ['learners', 'enrollments', 'learning progress'];\n static section = {\n id: 'education',\n label: 'Education',\n icon: 'folder',\n description: 'Courses and lessons for learning.',\n };\n static models = [Learner, Curriculum, Enrollment, LessonProgress];\n static runtime = 'both' as const;\n static nav = [\n {\n label: 'Learners',\n model: Learner,\n icon: 'users',\n description: 'Authorized learners in this family.',\n noun: 'learner',\n },\n ];\n}\n","/** A pointer-only representation of an Easy Peasy lesson. */\nexport interface ParsedSourceLesson {\n day: number;\n title: string;\n externalRef: string;\n externalUrl: string;\n worksheet: boolean;\n printableUrl?: string;\n}\n\nexport interface ParsedSourceCourse {\n title: string;\n lessons: ParsedSourceLesson[];\n packetUrl?: string;\n}\n\nconst approvedHosts = new Set([\n 'allinonehomeschool.com',\n 'www.allinonehomeschool.com',\n]);\n\n/**\n * Resolve and constrain source URLs before either fetching or retaining them.\n * Easy Peasy links must remain HTTPS links to the source site; imported data\n * must never become an open redirect or a pointer to a third-party PDF.\n */\nexport function validateEasyPeasyUrl(value: string, baseUrl?: string): string {\n let url: URL;\n try {\n url = new URL(value, baseUrl);\n } catch {\n throw new Error('Easy Peasy URL is invalid.');\n }\n if (url.protocol !== 'https:' || url.port || !approvedHosts.has(url.hostname))\n throw new Error('Easy Peasy URL must use an approved HTTPS source host.');\n if (url.username || url.password)\n throw new Error('Easy Peasy URL must not include credentials.');\n return url.toString();\n}\n\ninterface HeadingMatch {\n index: number;\n end: number;\n text: string;\n /** The official daily container is authoritative even when it lacks a heading. */\n day?: number;\n fragment?: string;\n title?: string;\n containerEnd?: number;\n levelRange?: readonly [number, number];\n hasLessonMarker?: boolean;\n}\n\ninterface LinkMatch {\n href: string;\n text: string;\n}\n\nfunction decodeHtml(value: string): string {\n return value.replace(\n /&(#x[\\da-f]+|#\\d+|amp|apos|gt|lt|nbsp|quot);/gi,\n (entity) => {\n const named: Record<string, string> = {\n '&': '&',\n ''': \"'\",\n '>': '>',\n '<': '<',\n ' ': ' ',\n '"': '\"',\n };\n const lower = entity.toLowerCase();\n if (lower in named) return named[lower];\n const number = lower.startsWith('&#x')\n ? Number.parseInt(lower.slice(3, -1), 16)\n : Number.parseInt(lower.slice(2, -1), 10);\n return Number.isSafeInteger(number) && number <= 0x10ffff\n ? String.fromCodePoint(number)\n : entity;\n },\n );\n}\n\nfunction textContent(value: string): string {\n return decodeHtml(value.replace(/<[^>]*>/g, ' '))\n .replace(/\\s+/g, ' ')\n .trim();\n}\n\nfunction attribute(attributes: string, name: string): string | undefined {\n const match = new RegExp(\n `(?:^|[\\\\t\\\\n\\\\f\\\\r ])${name}\\\\s*=\\\\s*(?:\"([^\"]*)\"|'([^']*)'|([^\\\\s>]+))`,\n 'i',\n ).exec(attributes);\n return match?.[1] ?? match?.[2] ?? match?.[3];\n}\n\n/** Return the end of a div without mistaking a nested layout div for its end. */\nfunction closingDivEnd(html: string, start: number): number {\n const tags = /<\\/?div\\b[^>]*>/gi;\n tags.lastIndex = start;\n let depth = 1;\n for (let tag = tags.exec(html); tag; tag = tags.exec(html)) {\n if (/^<\\/div\\b/i.test(tag[0])) depth -= 1;\n else depth += 1;\n if (depth === 0) return tag.index + tag[0].length;\n }\n return start;\n}\n\nfunction lessonHeadings(html: string): HeadingMatch[] {\n const containers: HeadingMatch[] = [];\n const divs = /<div\\b([^>]*)>/gi;\n for (const match of html.matchAll(divs)) {\n const id = attribute(match[1], 'id');\n const marker = /^(day|week)(\\d+)$/i.exec(id ?? '');\n if (!marker) continue;\n const number = Number.parseInt(marker[2], 10);\n if (!Number.isSafeInteger(number) || number < 1)\n throw new Error(`Easy Peasy daily container is malformed: ${id}`);\n const weekly = marker[1].toLowerCase() === 'week';\n const index = match.index ?? 0;\n const end = index + match[0].length;\n const containerEnd = closingDivEnd(html, end);\n const body = html.slice(end, containerEnd);\n const level = /\\blevels?\\s+(\\d+)\\s*[-–]\\s*(\\d+)\\b/i.exec(textContent(body));\n containers.push({\n index,\n end,\n text: weekly ? `Week ${number}` : `Lesson ${number}`,\n day: number,\n fragment: `${weekly ? 'week' : 'day'}${number}`,\n ...(weekly ? { title: `Week ${number}` } : {}),\n containerEnd,\n ...(level\n ? {\n levelRange: [\n Number.parseInt(level[1], 10),\n Number.parseInt(level[2], 10),\n ] as const,\n }\n : {}),\n hasLessonMarker: new RegExp(\n `\\\\bLessons?\\\\s+${number}(?:\\\\D|$)`,\n 'i',\n ).test(textContent(body)),\n });\n }\n containers.sort((left, right) => left.index - right.index);\n const grade = 4;\n const gradeContainers = containers.filter(\n (container) =>\n !container.levelRange ||\n (container.levelRange[0] <= grade && grade <= container.levelRange[1]),\n );\n const selectedContainers: HeadingMatch[] = [];\n for (const container of gradeContainers) {\n const peers = gradeContainers.filter(\n (candidate) => candidate.day === container.day,\n );\n if (peers[0] !== container) continue;\n if (peers.length === 1) selectedContainers.push(container);\n else {\n const marked = peers.filter((candidate) => candidate.hasLessonMarker);\n if (marked.length !== 1)\n throw new Error(\n `Easy Peasy lesson day is invalid or duplicated: ${container.day}`,\n );\n selectedContainers.push(marked[0]);\n }\n }\n const isInDailyContainer = (index: number): boolean =>\n selectedContainers.some(\n (container) =>\n container.index <= index &&\n index < (container.containerEnd ?? container.end),\n );\n const isDetachedDailyMarker = (index: number, text: string): boolean => {\n const day = /^lesson\\s+(\\d+)\\b/i.exec(text)?.[1];\n if (!day) return false;\n return selectedContainers.some(\n (container) =>\n container.day === Number.parseInt(day, 10) &&\n (container.containerEnd ?? container.end) <= index &&\n !textContent(\n html.slice(container.containerEnd ?? container.end, index),\n ),\n );\n };\n\n const matches: HeadingMatch[] = [...selectedContainers];\n // Some older official pages use a bare layout div for each lesson instead of\n // a day id. Accept only a direct bold child: a nested generic block remains\n // ambiguous and is rejected below.\n const directDivLessons =\n /<div\\b[^>]*>\\s*<(?:strong|b)\\b[^>]*>([\\s\\S]*?)<\\/(?:strong|b)\\s*>/gi;\n const bareDivMarkers: HeadingMatch[] = [];\n for (const match of html.matchAll(directDivLessons)) {\n if (isInDailyContainer(match.index ?? 0)) continue;\n const text = textContent(match[1]);\n if (!/^lesson\\b/i.test(text)) continue;\n if (isDetachedDailyMarker(match.index ?? 0, text)) continue;\n bareDivMarkers.push({\n index: match.index ?? 0,\n end: (match.index ?? 0) + match[0].length,\n text,\n });\n }\n // A lone unlabelled div marker cannot establish a course structure. Older\n // Easy Peasy course pages use a sequence of these divs; accepting a single\n // marker would turn malformed refresh input into a partial import.\n if (bareDivMarkers.length > 1) matches.push(...bareDivMarkers);\n const weeks = /<(?:strong|b)\\b([^>]*)>([\\s\\S]*?)<\\/(?:strong|b)\\s*>/gi;\n for (const match of html.matchAll(weeks)) {\n if (isInDailyContainer(match.index ?? 0)) continue;\n const id = attribute(match[1], 'id');\n const day = /^week(\\d+)$/i.exec(id ?? '')?.[1];\n const text = textContent(match[2]);\n if (!day || !/^week\\s+\\d+\\s*$/i.test(text)) continue;\n const number = Number.parseInt(day, 10);\n if (!Number.isSafeInteger(number) || number < 1)\n throw new Error(`Easy Peasy weekly marker is malformed: ${id}`);\n const statedMatch = /^week\\s+(\\d+)/i.exec(text);\n if (!statedMatch) continue;\n const stated = Number.parseInt(statedMatch[1], 10);\n if (stated !== number)\n throw new Error('Easy Peasy weekly container and marker disagree.');\n matches.push({\n index: match.index ?? 0,\n end: (match.index ?? 0) + match[0].length,\n text,\n day: number,\n fragment: `week${number}`,\n title: `Week ${number}`,\n });\n }\n const headings = /<h[1-6]\\b[^>]*>([\\s\\S]*?)<\\/h[1-6]\\s*>/gi;\n for (const match of html.matchAll(headings)) {\n if (isInDailyContainer(match.index ?? 0)) continue;\n matches.push({\n index: match.index ?? 0,\n end: (match.index ?? 0) + match[0].length,\n text: textContent(match[1]),\n });\n }\n const blocks = /<(p|li)\\b[^>]*>([\\s\\S]*?)<\\/\\1\\s*>/gi;\n for (const block of html.matchAll(blocks)) {\n if (isInDailyContainer(block.index ?? 0)) continue;\n const bold = /<(?:strong|b)\\b[^>]*>([\\s\\S]*?)<\\/(?:strong|b)\\s*>/i.exec(\n block[2],\n );\n if (!bold) continue;\n const text = textContent(bold[1]);\n if (!/^lesson\\b/i.test(text)) continue;\n if (isDetachedDailyMarker(block.index ?? 0, text)) continue;\n const boldIndex = (block.index ?? 0) + block[0].indexOf(bold[0]);\n matches.push({\n index: block.index ?? 0,\n end: boldIndex + bold[0].length,\n text,\n });\n }\n const sorted = matches.sort((left, right) => left.index - right.index);\n const boldMarkers = /<(strong|b)\\b[^>]*>([\\s\\S]*?)<\\/\\1\\s*>/gi;\n for (const marker of html.matchAll(boldMarkers)) {\n if (!/^lesson\\b/i.test(textContent(marker[2]))) continue;\n const index = marker.index ?? 0;\n const end = index + marker[0].length;\n const accountedFor =\n isInDailyContainer(index) ||\n isDetachedDailyMarker(index, textContent(marker[2])) ||\n sorted.some(\n (heading) =>\n /^lesson\\b/i.test(heading.text) &&\n (heading.index === index ||\n (heading.index <= index && end <= heading.end)),\n );\n if (!accountedFor)\n throw new Error('Easy Peasy lesson marker layout is unsupported.');\n }\n return sorted;\n}\n\nfunction lessonMarkerText(segment: string): string | undefined {\n const markers = /<(?:strong|b)\\b[^>]*>([\\s\\S]*?)<\\/(?:strong|b)\\s*>/gi;\n for (const marker of segment.matchAll(markers)) {\n const text = textContent(marker[1]);\n if (/^lesson\\b/i.test(text)) return text;\n }\n return undefined;\n}\n\nfunction parseLessonMarker(value: string): { day: number; worksheet: boolean } {\n const match = /^lesson\\s+(\\d+)\\s*(\\*|\\(\\*\\))?(?:\\s*\\(|\\s*$)/i.exec(value);\n if (!match)\n throw new Error(`Easy Peasy lesson heading is malformed: ${value}`);\n return {\n day: Number.parseInt(match[1], 10),\n worksheet: match[2] === '*' || match[2] === '(*)',\n };\n}\n\n/** Reject incomplete lesson markup before the tolerant extractors can skip it. */\nfunction rejectUnterminatedLessonTags(html: string): void {\n const openings = /<(h[1-6]|strong|b)\\b[^>]*>\\s*(?:<[^>]*>\\s*)*lesson\\b/gi;\n const candidates = [...html.matchAll(openings)];\n for (let index = 0; index < candidates.length; index += 1) {\n const opening = candidates[index];\n const tag = opening[1].toLowerCase();\n const afterOpening = (opening.index ?? 0) + opening[0].length;\n const closing = new RegExp(`<\\\\/${tag}\\\\s*>`, 'i').exec(\n html.slice(afterOpening),\n );\n const closingIndex = closing\n ? afterOpening + (closing.index ?? 0)\n : Number.POSITIVE_INFINITY;\n const nextOpening =\n candidates[index + 1]?.index ?? Number.POSITIVE_INFINITY;\n if (closingIndex > nextOpening || !Number.isFinite(closingIndex))\n throw new Error(\n 'Easy Peasy lesson heading is unterminated or mismatched.',\n );\n }\n}\n\nfunction links(html: string): LinkMatch[] {\n const result: LinkMatch[] = [];\n const anchors = /<a\\b([^>]*)>([\\s\\S]*?)<\\/a\\s*>/gi;\n for (const match of html.matchAll(anchors)) {\n const href = attribute(match[1], 'href');\n if (href)\n result.push({ href: decodeHtml(href), text: textContent(match[2]) });\n }\n return result;\n}\n\nfunction isPdfLink(link: LinkMatch): boolean {\n return /\\.pdf(?:[?#]|$)/i.test(link.href);\n}\n\nfunction isAnswerLink(link: LinkMatch): boolean {\n return /\\banswers?(?:\\s+key)?\\b/i.test(`${link.href} ${link.text}`);\n}\n\nfunction isPacketLink(link: LinkMatch): boolean {\n return /\\b(?:packet|whole course|complete course)\\b/i.test(link.text);\n}\n\nfunction isSupplementalPdfLink(link: LinkMatch): boolean {\n return /\\b(?:directions?|instructions?)\\b/i.test(`${link.href} ${link.text}`);\n}\n\nfunction courseTitle(html: string): string {\n const entryTitle =\n /<h1\\b(?=[^>]*\\bclass=(?:\"[^\"]*\\bentry-title\\b[^\"]*\"|'[^']*\\bentry-title\\b[^']*'|[^\\s>]*\\bentry-title\\b))[^>]*>([\\s\\S]*?)<\\/h1\\s*>/i.exec(\n html,\n )?.[1];\n const h1 = /<h1\\b[^>]*>([\\s\\S]*?)<\\/h1\\s*>/i.exec(html)?.[1];\n const title = /<title\\b[^>]*>([\\s\\S]*?)<\\/title\\s*>/i.exec(html)?.[1];\n const value = textContent(entryTitle ?? h1 ?? title ?? '');\n if (!value) throw new Error('Easy Peasy page has no title.');\n return value;\n}\n\nfunction isApprovedSourcePdf(link: LinkMatch, pageUrl: string): boolean {\n try {\n sourcePdf(link, pageUrl);\n return true;\n } catch {\n return false;\n }\n}\n\nfunction sourcePdf(link: LinkMatch, pageUrl: string): string {\n const url = validateEasyPeasyUrl(link.href, pageUrl);\n const parsed = new URL(url);\n if (!parsed.pathname.startsWith('/wp-content/'))\n throw new Error('Easy Peasy PDF must be hosted under wp-content.');\n if (!/\\.pdf$/i.test(parsed.pathname))\n throw new Error('Easy Peasy printable URL must be a PDF.');\n return url;\n}\n\nfunction canonicalWorksheetLink(\n links: LinkMatch[],\n pageUrl: string,\n): LinkMatch[] {\n if (links.length < 2) return links;\n const stem = (link: LinkMatch): string => {\n const pathname = new URL(link.href, pageUrl).pathname;\n return pathname\n .slice(pathname.lastIndexOf('/') + 1)\n .replace(/\\.pdf$/i, '')\n .toLowerCase();\n };\n const escapeRegex = (value: string): string =>\n value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n const canonical = links.filter((candidate) => {\n const candidateStem = stem(candidate);\n const variant = new RegExp(`^${escapeRegex(candidateStem)}(?:[-_ ]?\\\\d+)$`);\n return links.every(\n (link) => link === candidate || variant.test(stem(link)),\n );\n });\n // Multi-page worksheet variants retain the course-day pointer and one\n // canonical printable URL; unrelated multiple PDFs remain a hard failure.\n return canonical.length === 1 ? canonical : links;\n}\n\ninterface PrintablePointer {\n printableUrl?: string;\n hasSourcePdf: boolean;\n}\n\nfunction printableFor(\n segment: string,\n pageUrl: string,\n day: number,\n): PrintablePointer {\n const pdfLinks = links(segment)\n .filter(isPdfLink)\n .filter(\n (link) =>\n !isAnswerLink(link) &&\n !isPacketLink(link) &&\n !isSupplementalPdfLink(link) &&\n isApprovedSourcePdf(link, pageUrl),\n );\n const ownDay = new RegExp(`(?:day|lesson)[\\\\s_-]*${day}(?:\\\\D|$)`, 'i');\n const dayLinks = pdfLinks.filter((link) =>\n ownDay.test(`${link.href} ${link.text}`),\n );\n const candidates = canonicalWorksheetLink(\n dayLinks.length ? dayLinks : pdfLinks,\n pageUrl,\n );\n if (candidates.length > 1)\n // The course page remains the lesson pointer; this bounded model deliberately\n // retains no printable when the source publishes multiple source PDFs.\n return { hasSourcePdf: true };\n return candidates[0]\n ? { printableUrl: sourcePdf(candidates[0], pageUrl), hasSourcePdf: true }\n : { hasSourcePdf: false };\n}\n\nfunction packetFor(html: string, pageUrl: string): string | undefined {\n const packets = links(html).filter(\n (link) => isPdfLink(link) && !isAnswerLink(link) && isPacketLink(link),\n );\n if (packets.length > 1)\n throw new Error('Easy Peasy page has ambiguous packet PDFs.');\n return packets[0] ? sourcePdf(packets[0], pageUrl) : undefined;\n}\n\n/** Parse only the course title, day pointers, and source-hosted printable links. */\nexport function parseEasyPeasyPage(\n html: string,\n pageUrl: string,\n): ParsedSourceCourse {\n const normalizedPageUrl = validateEasyPeasyUrl(pageUrl);\n const source = html\n .replace(/<!--[\\s\\S]*?-->/g, '')\n .replace(/<(script|style)\\b[^>]*>[\\s\\S]*?<\\/\\1\\s*>/gi, '');\n rejectUnterminatedLessonTags(source);\n const title = courseTitle(source);\n const headings = lessonHeadings(source);\n const lessons: ParsedSourceLesson[] = [];\n const days = new Set<number>();\n\n for (let index = 0; index < headings.length; index += 1) {\n const heading = headings[index];\n if (heading.day === undefined && !/^lesson\\b/i.test(heading.text)) continue;\n const segment = source.slice(heading.end, headings[index + 1]?.index);\n const marker =\n heading.day === undefined ? heading.text : lessonMarkerText(segment);\n let parsedMarker: { day: number; worksheet: boolean } | undefined;\n if (marker) {\n try {\n parsedMarker = parseLessonMarker(marker);\n } catch (error) {\n // A source-controlled day/week container remains authoritative when it\n // includes a decorative nonnumeric \"Lesson\" label.\n if (heading.day === undefined) throw error;\n }\n }\n const day = heading.day ?? parsedMarker?.day;\n if (\n !day ||\n (heading.day !== undefined && parsedMarker && parsedMarker.day !== day)\n )\n throw new Error('Easy Peasy daily container and lesson marker disagree.');\n if (!Number.isSafeInteger(day) || day < 1 || days.has(day))\n throw new Error(`Easy Peasy lesson day is invalid or duplicated: ${day}`);\n days.add(day);\n const printable = printableFor(segment, normalizedPageUrl, day);\n // Some official daily containers put the worksheet asterisk on a child\n // activity label rather than the Lesson marker. A source-hosted printable\n // is sufficient evidence without retaining that activity text.\n const worksheet = parsedMarker?.worksheet ?? printable.hasSourcePdf;\n const page = new URL(normalizedPageUrl);\n page.hash = heading.fragment ?? `lesson-${day}`;\n lessons.push({\n day,\n title: heading.title ?? `Lesson ${day}`,\n externalRef: `lesson:${day}`,\n externalUrl: page.toString(),\n worksheet,\n ...(printable.printableUrl\n ? { printableUrl: printable.printableUrl }\n : {}),\n });\n }\n if (!lessons.length)\n throw new Error('Easy Peasy page has no lesson headings.');\n const packetUrl = packetFor(source, normalizedPageUrl);\n return { title, lessons, ...(packetUrl ? { packetUrl } : {}) };\n}\n","import {\n isEmbeddedDatabase,\n isPostgresDatabase,\n withEmbeddedWriteQueue,\n} from '@happyvertical/smrt-core';\nimport { getCurrentTenant } from '@happyvertical/smrt-tenancy';\nimport type { DatabaseInterface } from '@happyvertical/sql';\nimport { ExternalCourse } from './catalog.js';\nimport { CatalogAuthorizationError } from './catalog-service.js';\nimport {\n CourseCollection,\n CourseSectionCollection,\n ExternalCourseCollection,\n LessonCollection,\n ReadingCollection,\n WorksheetCollection,\n} from './collections.js';\nimport {\n type CourseSource,\n CourseSourceCollection,\n type SourceSharing,\n} from './course-source.js';\nimport {\n parseEasyPeasyPage,\n validateEasyPeasyUrl,\n} from './sources/easy-peasy-parser.js';\n\nexport interface SourceImportRequest {\n tenantId: string;\n actorUserId: string;\n sourceId: string;\n /** Host-stable identity, independent of the page's current URL. */\n courseRef: string;\n /** Optional trusted catalog classification retained on the tenant course. */\n subject?: string;\n pageUrl: string;\n destination: 'private' | 'group';\n}\nexport interface SourceImportAuthorization {\n action: 'education.source.import' | 'education.source.ensure';\n actorTenantId: string;\n actorUserId: string;\n sourceId: string;\n sourceSharing: SourceSharing;\n destination: 'private' | 'group';\n licenseEvidence: string;\n}\nexport type SourceImportAuthorizer = (\n request: SourceImportAuthorization,\n) => boolean | Promise<boolean>;\nexport interface EasyPeasyRegistration {\n /** Supplied by host configuration after its operator accepts the source terms. */\n termsAccepted: true;\n /** Must honor redirect:error and bound response size/time. Never fetch PDFs. */\n fetchPage: (\n url: string,\n options: { redirect: 'error' },\n ) => Promise<{ html: string; url: string }>;\n}\nexport interface SourceImportResult {\n courseId: string;\n lessonIds: string[];\n /** Source-hosted packet link, returned without fetching or persisting its content. */\n packetUrl?: string;\n}\nexport interface EnsureEasyPeasyCourseSourceRequest {\n tenantId: string;\n actorUserId: string;\n}\nexport interface EnsureEasyPeasyCourseSourceResult {\n sourceId: string;\n}\n\nasync function identity(...parts: string[]): Promise<string> {\n const digest = await globalThis.crypto.subtle.digest(\n 'SHA-256',\n new TextEncoder().encode(\n JSON.stringify(['smrt.education.source.v1', ...parts]),\n ),\n );\n const hex = Array.from(new Uint8Array(digest), (byte) =>\n byte.toString(16).padStart(2, '0'),\n ).join('');\n return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-5${hex.slice(13, 16)}-a${hex.slice(17, 20)}-${hex.slice(20, 32)}`;\n}\n\nasync function requireOwnedIdentity(\n db: DatabaseInterface,\n table: string,\n id: string,\n tenantId: string,\n): Promise<void> {\n // A filtered collection get cannot distinguish absence from a corrupt foreign\n // owner at our deterministic ID. Check only to deny; never return that row.\n if (\n (await db.get(table, { id })) &&\n !(await db.get(table, { id, tenant_id: tenantId }))\n )\n throw new CatalogAuthorizationError();\n}\n\nfunction retryable(error: unknown): boolean {\n let current = error;\n let contention = false;\n for (\n let depth = 0;\n depth < 5 && current && typeof current === 'object';\n depth++\n ) {\n const failure = current as {\n code?: unknown;\n cause?: unknown;\n connectionInvalidated?: boolean;\n };\n if (failure.connectionInvalidated) return false;\n contention ||= [\n 'SQLITE_BUSY',\n 'SQLITE_BUSY_SNAPSHOT',\n '40001',\n '40P01',\n ].includes(String(failure.code));\n current = failure.cause;\n }\n return contention;\n}\n\n/** Opt-in, pointer-only import. Host authorization defines family/group roles. */\nexport class SourceImportService {\n private easyPeasy?: Readonly<EasyPeasyRegistration>;\n constructor(\n private readonly db: DatabaseInterface,\n private readonly authorize: SourceImportAuthorizer,\n ) {}\n\n registerEasyPeasy(registration: EasyPeasyRegistration): void {\n if (\n registration.termsAccepted !== true ||\n typeof registration.fetchPage !== 'function'\n )\n throw new Error(\n 'Easy Peasy terms must be accepted by the host before registration.',\n );\n this.easyPeasy = Object.freeze({\n termsAccepted: true,\n fetchPage: registration.fetchPage,\n });\n }\n\n async ensureEasyPeasyCourseSource(\n input: EnsureEasyPeasyCourseSourceRequest,\n ): Promise<EnsureEasyPeasyCourseSourceResult> {\n const request = Object.freeze({ ...input });\n const active = getCurrentTenant();\n if (\n !request.tenantId?.trim() ||\n !request.actorUserId?.trim() ||\n active?.tenantId !== request.tenantId ||\n active.userId !== request.actorUserId ||\n active.superAdminBypass\n )\n throw new CatalogAuthorizationError();\n if (!this.easyPeasy)\n throw new Error('Easy Peasy is not registered by this host.');\n const sourceId = await identity(request.tenantId, 'easy-peasy');\n if (\n (await this.authorize({\n action: 'education.source.ensure',\n actorTenantId: request.tenantId,\n actorUserId: request.actorUserId,\n sourceId,\n sourceSharing: 'private',\n destination: 'private',\n licenseEvidence: '',\n })) !== true\n )\n throw new CatalogAuthorizationError();\n if (!this.db.transaction)\n throw new Error('Source provisioning requires real transactions.');\n const transaction = this.db.transaction;\n return withEmbeddedWriteQueue(\n this.db,\n isEmbeddedDatabase(this.db),\n async () => {\n for (let attempt = 0; ; attempt++) {\n try {\n return await transaction(async (tx) => {\n if (isPostgresDatabase(this.db))\n await tx.query(\n 'SELECT pg_advisory_xact_lock(hashtextextended($1, 0))',\n sourceId,\n );\n const sources = await CourseSourceCollection.create({ db: tx });\n const existing = await sources.get(sourceId);\n if (existing) {\n if (\n existing.tenantId !== request.tenantId ||\n existing.key !== 'easy-peasy' ||\n existing.kind !== 'adapter' ||\n existing.adapterKey !== 'easy-peasy' ||\n existing.sharing !== 'private'\n )\n throw new Error(\n 'Existing Easy Peasy source policy cannot be changed by provisioning.',\n );\n } else {\n await sources.create({\n id: sourceId,\n tenantId: request.tenantId,\n key: 'easy-peasy',\n name: 'Easy Peasy All-in-One Homeschool',\n kind: 'adapter',\n adapterKey: 'easy-peasy',\n sharing: 'private',\n });\n }\n return { sourceId };\n });\n } catch (error) {\n if (attempt >= 3 || !retryable(error)) throw error;\n await new Promise((resolve) =>\n setTimeout(resolve, 5 * 2 ** attempt),\n );\n }\n }\n },\n );\n }\n\n private actor(request: SourceImportRequest): void {\n const active = getCurrentTenant();\n if (\n !request.tenantId?.trim() ||\n !request.actorUserId?.trim() ||\n active?.tenantId !== request.tenantId ||\n active.userId !== request.actorUserId ||\n active.superAdminBypass\n )\n throw new CatalogAuthorizationError();\n if (request.destination !== 'private' && request.destination !== 'group')\n throw new Error(\n 'Only private-family or licensed-group destinations are supported.',\n );\n if (\n !request.sourceId?.trim() ||\n !request.courseRef?.trim() ||\n request.courseRef.length > 256 ||\n (request.subject !== undefined &&\n (!request.subject.trim() || request.subject.length > 256))\n )\n throw new Error('A source and stable course reference are required.');\n }\n\n private async source(\n db: DatabaseInterface,\n request: SourceImportRequest,\n ): Promise<CourseSource> {\n this.actor(request);\n const source = await (await CourseSourceCollection.create({ db })).get(\n request.sourceId,\n );\n if (!source || source.tenantId !== request.tenantId)\n throw new CatalogAuthorizationError();\n if (\n source.kind !== 'adapter' ||\n source.adapterKey !== 'easy-peasy' ||\n !['private', 'group', 'global'].includes(source.sharing)\n )\n throw new Error('Unsupported source policy.');\n const licenseEvidence = source.getConfig().licenseEvidence?.trim() ?? '';\n if (\n request.destination === 'group' &&\n (source.sharing === 'private' || !licenseEvidence)\n )\n throw new Error(\n 'Source sharing and explicit licensing evidence must permit group import.',\n );\n if (\n (await this.authorize({\n action: 'education.source.import',\n actorTenantId: request.tenantId,\n actorUserId: request.actorUserId,\n sourceId: request.sourceId,\n sourceSharing: source.sharing,\n destination: request.destination,\n licenseEvidence,\n })) !== true\n )\n throw new CatalogAuthorizationError();\n this.actor(request);\n return source;\n }\n\n async importCourse(input: SourceImportRequest): Promise<SourceImportResult> {\n // Snapshot caller input before any host callback can mutate it.\n const request = Object.freeze({ ...input });\n this.actor(request);\n const adapter = this.easyPeasy;\n if (!adapter) throw new Error('Easy Peasy is not registered by this host.');\n const registeredSource = await this.source(this.db, request);\n const pageUrl = validateEasyPeasyUrl(request.pageUrl);\n const response = await adapter.fetchPage(pageUrl, { redirect: 'error' });\n if (validateEasyPeasyUrl(response.url) !== pageUrl)\n throw new Error('Unexpected source redirect.');\n if (typeof response.html !== 'string' || response.html.length > 2_000_000)\n throw new Error('Invalid or oversized source page.');\n const parsed = parseEasyPeasyPage(response.html, pageUrl);\n const courseId = await identity(\n request.tenantId,\n String(registeredSource.id),\n request.courseRef,\n );\n return withEmbeddedWriteQueue(\n this.db,\n isEmbeddedDatabase(this.db),\n async () => {\n if (!this.db.transaction)\n throw new Error('Source imports require real transactions.');\n for (let attempt = 0; ; attempt++) {\n try {\n return await this.db.transaction(async (tx) => {\n if (isPostgresDatabase(this.db))\n await tx.query(\n 'SELECT pg_advisory_xact_lock(hashtextextended($1, 0))',\n courseId,\n );\n const source = await this.source(tx, request);\n const courses = await ExternalCourseCollection.create({ db: tx });\n const sections = await CourseSectionCollection.create({ db: tx });\n const lessons = await LessonCollection.create({ db: tx });\n const readings = await ReadingCollection.create({ db: tx });\n const worksheets = await WorksheetCollection.create({ db: tx });\n await requireOwnedIdentity(\n tx,\n 'courses',\n courseId,\n request.tenantId,\n );\n const licenseKind =\n request.destination === 'private'\n ? 'personal-use-copy'\n : 'licensed-for-sharing';\n const existing = await (\n await CourseCollection.create({ db: tx })\n ).get(courseId);\n if (\n existing &&\n (!(existing instanceof ExternalCourse) ||\n existing.tenantId !== request.tenantId ||\n existing.sourceKey !== source.key ||\n existing.sourceRef !== request.courseRef ||\n existing.licenseKind !== licenseKind)\n )\n throw new Error(\n 'Existing course ownership, source, or license cannot be changed by import.',\n );\n if (existing) {\n existing.title = parsed.title;\n existing.sourceUrl = pageUrl;\n if (request.subject) existing.subject = request.subject.trim();\n await existing.save();\n } else {\n await courses.create({\n id: courseId,\n tenantId: request.tenantId,\n title: parsed.title,\n subject: request.subject?.trim() ?? '',\n sourceKey: source.key,\n sourceRef: request.courseRef,\n sourceUrl: pageUrl,\n licenseKind,\n licenseNote: source.getConfig().licenseEvidence ?? '',\n status: 'draft',\n });\n }\n const sectionId = await identity(courseId, 'lessons');\n await requireOwnedIdentity(\n tx,\n 'course_sections',\n sectionId,\n request.tenantId,\n );\n const section = await sections.get(sectionId);\n if (section) {\n if (\n section.tenantId !== request.tenantId ||\n section.courseId !== courseId\n )\n throw new Error(\n 'Existing section ownership cannot be changed by import.',\n );\n } else {\n await sections.create({\n id: sectionId,\n tenantId: request.tenantId,\n courseId,\n title: 'Lessons',\n sortOrder: 0,\n });\n }\n const lessonIds: string[] = [];\n for (const item of parsed.lessons) {\n const id = await identity(courseId, item.externalRef);\n await requireOwnedIdentity(tx, 'lessons', id, request.tenantId);\n const lesson = await lessons.get(id);\n if (lesson) {\n if (\n lesson.tenantId !== request.tenantId ||\n lesson.sectionId !== sectionId ||\n lesson.externalRef !== item.externalRef ||\n 'printableUrl' in lesson !== item.worksheet\n )\n throw new Error(\n 'Existing lesson ownership or kind cannot be changed by import.',\n );\n lesson.title = item.title;\n lesson.externalUrl = item.externalUrl;\n if ('printableUrl' in lesson)\n lesson.printableUrl = item.printableUrl ?? '';\n await lesson.save();\n } else {\n await (item.worksheet ? worksheets : readings).create({\n id,\n tenantId: request.tenantId,\n sectionId,\n title: item.title,\n externalRef: item.externalRef,\n externalUrl: item.externalUrl,\n sortOrder: item.day,\n ...(item.worksheet\n ? { printableUrl: item.printableUrl ?? '' }\n : {}),\n });\n }\n lessonIds.push(id);\n }\n return {\n courseId,\n lessonIds,\n ...(parsed.packetUrl ? { packetUrl: parsed.packetUrl } : {}),\n };\n });\n } catch (error) {\n if (attempt >= 3 || !retryable(error)) throw error;\n await new Promise((resolve) =>\n setTimeout(resolve, 5 * 2 ** attempt),\n );\n }\n }\n },\n );\n }\n}\n","import type {\n DriveAcquisition,\n DriveAcquisitionOptions,\n DriveFileMetadata,\n DriveMetadataPage,\n DriveMetadataPageOptions,\n GoogleDriveProvider,\n} from '@happyvertical/files';\nimport type {\n CatalogAcquireAdapter,\n CatalogSourceRecord,\n CatalogSyncAdapter,\n CatalogSyncPage,\n} from '../catalog-contracts.js';\n\nexport type {\n DriveAcquisition,\n DriveAcquisitionOptions,\n DriveFileMetadata,\n DriveMetadataPage,\n DriveMetadataPageOptions,\n};\n\n/**\n * Metadata-only Google Drive curriculum discovery.\n *\n * This module deliberately accepts the public @happyvertical/files Drive\n * surface as a port. Hosts construct that SDK provider with their own\n * application credentials and pass it here; neither discovery records nor\n * checkpoints contain credentials or downloaded content.\n */\n\nexport const DRIVE_CURRICULUM_SEED_ROOTS = [\n {\n id: '1K_au1upSRuakX55PF3aZzQLHWI70KwZd',\n title: 'Carnival of Collisions (Contact Forces)',\n },\n {\n id: '1N1xFJ2omm-M1TuAxDOXQxZndkw70-KxM',\n title: 'Mission Maglev (Electric and Magnetic Forces)',\n },\n {\n id: '1v0LXs7iky2R4FsiqZkWOjWyJmRu-aVIa',\n title: 'Rocks vs. Big Rigs, Unit-Wide View',\n },\n {\n id: '1sFDNXdw8q-xrhgy8HFAMELXUoqKgp9tu',\n title: 'Operation Space Jump (Gravitational Forces)',\n },\n] as const;\n\nconst GOOGLE_FOLDER_MIME = 'application/vnd.google-apps.folder';\n\n/** The adapter only uses public SDK methods, never a raw Google API client. */\nexport type GoogleDriveFilesClient = Pick<\n GoogleDriveProvider,\n 'listMetadataPage' | 'getMetadataById' | 'acquireById'\n>;\n\nexport interface DriveCatalogRecord extends CatalogSourceRecord {\n providerId: 'google-drive';\n checksum?: string;\n mimeType: string;\n size?: number;\n modifiedTime?: string;\n}\n\nexport interface DriveExclusion {\n stableId: string;\n reason:\n | 'missing-revision'\n | 'shortcut-target-inaccessible'\n | 'shortcut-target-outside-boundary'\n | 'shortcut-target-unsupported';\n}\n\ninterface FolderCursor {\n folderId: string;\n pageToken?: string;\n visibility: 'catalog' | 'teacher';\n}\n\n/** Serializable traversal state; persist it after every returned page. */\nexport interface DriveDiscoveryCheckpoint {\n version: 1;\n roots: string[];\n pendingFolders: FolderCursor[];\n visitedFolders: string[];\n}\n\nexport interface DriveDiscoveryPage {\n records: DriveCatalogRecord[];\n exclusions: DriveExclusion[];\n checkpoint?: DriveDiscoveryCheckpoint;\n complete: boolean;\n}\n\nexport interface DriveDiscoveryOptions {\n /** Defaults to the four owner-authorized curriculum roots. */\n roots?: readonly { id: string; title?: string }[];\n checkpoint?: DriveDiscoveryCheckpoint;\n pageSize?: number;\n /**\n * Exact Drive file IDs the trusted host has reviewed as learner-safe.\n * Folder IDs never grant visibility to their contents.\n */\n studentSafeFileIds?: readonly string[];\n /**\n * Shortcut targets are re-read by ID and must pass this host boundary check\n * before a folder can enter traversal. The secure default is deny.\n */\n authorizeShortcutTarget?: (\n target: DriveFileMetadata,\n context: { sourceFolderId: string; configuredRootIds: readonly string[] },\n ) => boolean | Promise<boolean>;\n}\n\nexport interface DriveSelectionAuthorization {\n stableId: string;\n revision: string;\n exportMimeType?: string;\n /** True only after the host's resource-level license policy allows use. */\n allowed: boolean;\n}\n\nexport interface PinnedDriveContent {\n stableId: string;\n revision?: string;\n checksum?: string;\n sha256: string;\n bytes: Buffer;\n exportMimeType?: string;\n}\n\nfunction uniqueRoots(\n roots: readonly { id: string; title?: string }[],\n): readonly { id: string; title?: string }[] {\n const seen = new Set<string>();\n return roots.filter((root) => {\n if (!root.id || seen.has(root.id)) return false;\n seen.add(root.id);\n return true;\n });\n}\n\nfunction assertPageSize(pageSize: number | undefined): number | undefined {\n if (pageSize === undefined) return undefined;\n if (!Number.isInteger(pageSize) || pageSize < 1 || pageSize > 1_000)\n throw new Error('Drive metadata page size must be between 1 and 1000.');\n return pageSize;\n}\n\nfunction classify(\n name: string,\n inherited: 'catalog' | 'teacher',\n): 'catalog' | 'teacher' {\n const normalized = name\n .replace(/([a-z])([A-Z])/g, '$1 $2')\n .replace(/[_./-]+/g, ' ')\n .toLowerCase();\n if (/\\b(answers?|solutions?|keys?)\\b/.test(normalized)) return 'teacher';\n if (/\\b(teachers?|educators?|instructors?|facilitators?)\\b/.test(normalized))\n return 'teacher';\n return inherited;\n}\n\nfunction isFolder(metadata: DriveFileMetadata): boolean {\n return metadata.mimeType === GOOGLE_FOLDER_MIME;\n}\n\nfunction nativeExportFormats(mimeType: string): string[] {\n if (\n [\n 'application/vnd.google-apps.document',\n 'application/vnd.google-apps.spreadsheet',\n 'application/vnd.google-apps.presentation',\n ].includes(mimeType)\n )\n return ['application/pdf'];\n return [mimeType];\n}\n\nfunction encodeCheckpoint(checkpoint: DriveDiscoveryCheckpoint): string {\n return Buffer.from(JSON.stringify(checkpoint)).toString('base64url');\n}\n\nfunction decodeCheckpoint(\n cursor: string | undefined,\n): DriveDiscoveryCheckpoint | undefined {\n if (!cursor) return undefined;\n try {\n const decoded: unknown = JSON.parse(\n Buffer.from(cursor, 'base64url').toString('utf8'),\n );\n if (!decoded || typeof decoded !== 'object')\n throw new Error('not an object');\n return decoded as DriveDiscoveryCheckpoint;\n } catch {\n throw new Error('Invalid Google Drive discovery cursor.');\n }\n}\n\nfunction toRecord(\n metadata: DriveFileMetadata,\n parentStableId: string,\n inheritedVisibility: 'catalog' | 'teacher',\n studentSafeFileIds: ReadonlySet<string>,\n): DriveCatalogRecord {\n const revision =\n metadata.revisionId ??\n metadata.md5Checksum ??\n metadata.modifiedTime?.toISOString();\n if (!revision)\n throw new Error(`Drive metadata for ${metadata.id} has no revision.`);\n return {\n providerId: 'google-drive',\n stableId: metadata.id,\n revision,\n ...(metadata.md5Checksum ? { checksum: metadata.md5Checksum } : {}),\n canonicalUrl: `https://drive.google.com/open?id=${encodeURIComponent(metadata.id)}`,\n title: metadata.name,\n resourceType: metadata.shortcutDetails\n ? 'shortcut'\n : isFolder(metadata)\n ? 'folder'\n : 'file',\n parentStableId,\n availableFormats: nativeExportFormats(metadata.mimeType),\n mimeType: metadata.mimeType,\n ...(metadata.size === undefined ? {} : { size: metadata.size }),\n ...(metadata.modifiedTime\n ? { modifiedTime: metadata.modifiedTime.toISOString() }\n : {}),\n visibility:\n !isFolder(metadata) &&\n !metadata.shortcutDetails &&\n studentSafeFileIds.has(metadata.id) &&\n classify(metadata.name, inheritedVisibility) === 'catalog'\n ? 'catalog'\n : 'teacher',\n licenseEvidence: { state: 'unknown' },\n };\n}\n\nfunction normalizedCheckpoint(\n options: DriveDiscoveryOptions,\n): DriveDiscoveryCheckpoint {\n const roots = uniqueRoots(options.roots ?? DRIVE_CURRICULUM_SEED_ROOTS).map(\n (root) => root.id,\n );\n if (!roots.length) throw new Error('At least one Drive root is required.');\n const checkpoint = options.checkpoint;\n if (!checkpoint) {\n return {\n version: 1,\n roots,\n pendingFolders: roots.map((folderId) => ({\n folderId,\n visibility: 'catalog',\n })),\n visitedFolders: [],\n };\n }\n if (\n checkpoint.version !== 1 ||\n checkpoint.roots.length !== roots.length ||\n checkpoint.roots.some((root, index) => root !== roots[index])\n )\n throw new Error('Drive checkpoint does not match configured roots.');\n return {\n version: 1,\n roots,\n pendingFolders: checkpoint.pendingFolders.map((folder) => ({ ...folder })),\n visitedFolders: [...checkpoint.visitedFolders],\n };\n}\n\n/**\n * One call reads at most one Drive metadata page. Repeated calls with the\n * returned checkpoint provide durable pagination without content acquisition.\n */\nexport class GoogleDriveCurriculumAdapter\n implements CatalogSyncAdapter, CatalogAcquireAdapter\n{\n static readonly providerId = 'google-drive';\n constructor(\n private readonly drive: GoogleDriveFilesClient,\n private readonly configuration: Omit<\n DriveDiscoveryOptions,\n 'checkpoint'\n > & {\n maxAcquisitionBytes?: number;\n } = {},\n ) {}\n\n async enumerate(input: { cursor?: string }): Promise<CatalogSyncPage> {\n const page = await this.discover({\n ...this.configuration,\n checkpoint: decodeCheckpoint(input.cursor),\n });\n return {\n records: page.records,\n complete: page.complete,\n ...(page.checkpoint\n ? { nextCursor: encodeCheckpoint(page.checkpoint) }\n : {}),\n // Definite boundary/format omissions are policy; unavailable metadata is\n // an operational failure and must not authorize terminal withdrawal.\n policyExclusions: page.exclusions\n .filter(\n (entry) =>\n entry.reason === 'shortcut-target-outside-boundary' ||\n entry.reason === 'shortcut-target-unsupported',\n )\n .map((entry) => ({\n code: entry.reason,\n message: `Google Drive resource ${entry.stableId} was excluded: ${entry.reason}.`,\n })),\n exclusions: page.exclusions\n .filter(\n (entry) =>\n entry.reason !== 'shortcut-target-outside-boundary' &&\n entry.reason !== 'shortcut-target-unsupported',\n )\n .map((entry) => ({\n code: entry.reason,\n message: `Google Drive resource ${entry.stableId} was excluded: ${entry.reason}.`,\n })),\n };\n }\n\n async discover(\n options: DriveDiscoveryOptions = {},\n ): Promise<DriveDiscoveryPage> {\n const checkpoint = normalizedCheckpoint(options);\n const pageSize = assertPageSize(options.pageSize);\n const current = checkpoint.pendingFolders.shift();\n if (!current) return { records: [], exclusions: [], complete: true };\n\n const page = await this.drive.listMetadataPage({\n folderId: current.folderId,\n ...(current.pageToken ? { pageToken: current.pageToken } : {}),\n ...(pageSize === undefined ? {} : { pageSize }),\n });\n const records: DriveCatalogRecord[] = [];\n const exclusions: DriveExclusion[] = [];\n const seenRecordIds = new Set<string>();\n const seenFolders = new Set(checkpoint.visitedFolders);\n seenFolders.add(current.folderId);\n\n const studentSafeFileIds = new Set(options.studentSafeFileIds ?? []);\n for (const entry of page.entries) {\n if (!entry.id || seenRecordIds.has(entry.id)) continue;\n seenRecordIds.add(entry.id);\n if (\n entry.shortcutDetails &&\n entry.shortcutDetails.targetMimeType !== GOOGLE_FOLDER_MIME\n ) {\n // A file shortcut does not establish that its target belongs under a\n // reviewed root or that the target's real parent is learner-safe.\n // Actual files encountered through trusted folder traversal remain\n // eligible for exact-ID allowlisting.\n exclusions.push({\n stableId: entry.shortcutDetails.targetId,\n reason: 'shortcut-target-unsupported',\n });\n continue;\n }\n const inheritedVisibility = classify(entry.name, current.visibility);\n try {\n records.push(\n toRecord(\n entry,\n current.folderId,\n inheritedVisibility,\n studentSafeFileIds,\n ),\n );\n } catch {\n exclusions.push({\n stableId: entry.id,\n reason: 'missing-revision',\n });\n continue;\n }\n const visibility = inheritedVisibility;\n if (entry.shortcutDetails) {\n await this.resolveShortcut(\n entry.shortcutDetails,\n current.folderId,\n visibility,\n checkpoint,\n seenFolders,\n options,\n exclusions,\n );\n } else if (isFolder(entry) && !seenFolders.has(entry.id)) {\n seenFolders.add(entry.id);\n checkpoint.pendingFolders.push({ folderId: entry.id, visibility });\n }\n }\n\n if (page.nextPageToken) {\n checkpoint.pendingFolders.unshift({\n ...current,\n pageToken: page.nextPageToken,\n });\n } else {\n seenFolders.add(current.folderId);\n }\n checkpoint.visitedFolders = [...seenFolders].sort();\n return {\n records,\n exclusions,\n ...(checkpoint.pendingFolders.length ? { checkpoint } : {}),\n complete: checkpoint.pendingFolders.length === 0,\n };\n }\n\n private async resolveShortcut(\n shortcut: NonNullable<DriveFileMetadata['shortcutDetails']>,\n sourceFolderId: string,\n inheritedVisibility: 'catalog' | 'teacher',\n checkpoint: DriveDiscoveryCheckpoint,\n seenFolders: Set<string>,\n options: DriveDiscoveryOptions,\n exclusions: DriveExclusion[],\n ): Promise<void> {\n if (shortcut.targetMimeType !== GOOGLE_FOLDER_MIME) {\n exclusions.push({\n stableId: shortcut.targetId,\n reason: 'shortcut-target-unsupported',\n });\n return;\n }\n let target: DriveFileMetadata;\n try {\n target = await this.drive.getMetadataById(shortcut.targetId);\n } catch {\n exclusions.push({\n stableId: shortcut.targetId,\n reason: 'shortcut-target-inaccessible',\n });\n return;\n }\n if (\n !isFolder(target) ||\n seenFolders.has(target.id) ||\n (await options.authorizeShortcutTarget?.(target, {\n sourceFolderId,\n configuredRootIds: checkpoint.roots,\n })) !== true\n ) {\n exclusions.push({\n stableId: target.id,\n reason: isFolder(target)\n ? 'shortcut-target-outside-boundary'\n : 'shortcut-target-unsupported',\n });\n return;\n }\n seenFolders.add(target.id);\n checkpoint.pendingFolders.push({\n folderId: target.id,\n visibility: classify(target.name, inheritedVisibility),\n });\n }\n\n /**\n * Content is available only after explicit selection and policy approval.\n * A revision is mandatory so retries cannot silently acquire changed bytes.\n */\n async acquireSelected(\n authorization: DriveSelectionAuthorization,\n options: Omit<DriveAcquisitionOptions, 'expectedRevision'>,\n ): Promise<PinnedDriveContent> {\n if (!authorization.allowed)\n throw new Error(\n 'Drive content selection is not authorized by license policy.',\n );\n if (!authorization.stableId || !authorization.revision)\n throw new Error(\n 'Drive selection requires a stable ID and exact revision.',\n );\n if (!Number.isSafeInteger(options.maxBytes) || options.maxBytes < 1)\n throw new Error(\n 'Drive acquisition requires a positive maximum byte limit.',\n );\n const acquisition = await this.drive.acquireById(authorization.stableId, {\n ...options,\n expectedRevision: authorization.revision,\n ...(authorization.exportMimeType\n ? { exportMimeType: authorization.exportMimeType }\n : {}),\n });\n if (acquisition.metadata.id !== authorization.stableId)\n throw new Error('Drive acquisition returned a different resource.');\n if (\n acquisition.metadata.revisionId &&\n acquisition.metadata.revisionId !== authorization.revision\n )\n throw new Error(\n 'Drive acquisition revision changed before content was pinned.',\n );\n if (acquisition.bytes.byteLength > options.maxBytes)\n throw new Error('Drive acquisition exceeds its byte limit.');\n const hash = await globalThis.crypto.subtle.digest(\n 'SHA-256',\n Uint8Array.from(acquisition.bytes),\n );\n const sha256 = Buffer.from(hash).toString('hex');\n if (acquisition.contentHash.toLowerCase() !== sha256)\n throw new Error(\n 'Drive acquisition content hash did not match returned bytes.',\n );\n return {\n stableId: acquisition.metadata.id,\n ...(acquisition.metadata.revisionId\n ? { revision: acquisition.metadata.revisionId }\n : {}),\n ...(acquisition.metadata.md5Checksum\n ? { checksum: acquisition.metadata.md5Checksum }\n : {}),\n sha256,\n bytes: acquisition.bytes,\n ...(acquisition.exportMimeType\n ? { exportMimeType: acquisition.exportMimeType }\n : {}),\n };\n }\n\n async acquire(input: {\n providerId: string;\n stableId: string;\n revision: string;\n format: string;\n }): Promise<{ bytes: Uint8Array; sha256: string; revision: string }> {\n if (input.providerId !== GoogleDriveCurriculumAdapter.providerId)\n throw new Error('Google Drive adapter cannot acquire another provider.');\n const acquired = await this.acquireSelected(\n {\n stableId: input.stableId,\n revision: input.revision,\n exportMimeType: input.format,\n allowed: true,\n },\n { maxBytes: this.configuration.maxAcquisitionBytes ?? 25_000_000 },\n );\n if (acquired.revision !== input.revision)\n throw new Error(\n 'Drive acquisition did not return the selected revision.',\n );\n return {\n bytes: acquired.bytes,\n sha256: acquired.sha256,\n revision: input.revision,\n };\n }\n}\n","/** Strict first-edition hierarchy and public artifact parsing; never executes HTML. */\nexport const IM_ORIGIN = 'https://im.kendallhunt.com';\nexport const IM_ASSET_ORIGIN = 'https://cms-assets.illustrativemathematics.org';\nexport const IM_LICENSE = 'https://creativecommons.org/licenses/by/4.0/';\nexport const IM_ROOTS = [\n '/k5/curriculum.html',\n '/MS/index.html',\n '/HS/index.html',\n];\n\nexport function imText(value: string): string {\n return value\n .replace(/<[^>]*>/g, ' ')\n .replace(/ | /g, ' ')\n .replace(/&/g, '&')\n .replace(/'|'/g, \"'\")\n .replace(/"/g, '\"')\n .replace(/\\s+/g, ' ')\n .trim();\n}\nexport interface ImPageIdentity {\n path: string;\n band: string;\n course?: string;\n unit?: string;\n lesson?: string;\n audience?: string;\n leaf: string;\n}\n/** Canonical paths contain no escapes, queries, credentials, or arbitrary filenames. */\nexport function imPagePath(value: string): ImPageIdentity {\n if (value === '/') return { path: '/', band: '', leaf: '' };\n if (IM_ROOTS.includes(value))\n return { path: value, band: value.split('/')[1], leaf: 'root' };\n const k =\n /^\\/(k5(?:_es)?)\\/(teachers|families)\\/(kindergarten|grade-[1-5])(?:\\/unit-([1-9][0-9]?))?(?:\\/lesson-([1-9][0-9]?))?\\/(units|lessons|resources|preparation|family-materials)\\.html$/i.exec(\n value,\n );\n const m =\n /^\\/(MS(?:_ES)?|HS(?:_ES)?)\\/(teachers|families)\\/([1-4])(?:\\/([1-9][0-9]?))?(?:\\/([1-9][0-9]?))?\\/(index|resources|preparation)\\.html$/i.exec(\n value,\n );\n const x = k ?? m;\n if (!x) throw new Error('Unsupported first-edition hierarchy path.');\n const [, rawBand, audience, course, unit, lesson, leaf] = x;\n const band = rawBand.toLowerCase().startsWith('k5')\n ? rawBand.toLowerCase()\n : rawBand.toUpperCase();\n const isK = band.startsWith('k5');\n if (\n (band.startsWith('MS') && course === '4') ||\n (lesson && (!unit || audience !== 'teachers' || leaf !== 'preparation')) ||\n (!lesson && leaf === 'preparation') ||\n (isK && !unit && !['units', 'resources'].includes(leaf)) ||\n (isK &&\n unit &&\n !lesson &&\n !['lessons', 'resources', 'family-materials'].includes(leaf)) ||\n (!isK && !lesson && !['index', 'resources'].includes(leaf))\n )\n throw new Error('Inconsistent first-edition hierarchy.');\n const path = `/${band}/${audience}/${course}${unit ? `/${isK ? 'unit-' : ''}${unit}` : ''}${lesson ? `/${isK ? 'lesson-' : ''}${lesson}` : ''}/${leaf}.html`;\n return { path, band, audience, course, unit, lesson, leaf };\n}\nexport function imAssetId(url: URL): string | undefined {\n return url.origin === IM_ASSET_ORIGIN &&\n !url.username &&\n !url.password &&\n !url.port &&\n !url.search &&\n !url.hash &&\n /^\\/[a-zA-Z0-9]{20,64}$/.test(url.pathname)\n ? url.pathname.slice(1)\n : undefined;\n}\nexport function imStableId(path: string, assetId?: string): string {\n return `im-first-edition:${path}${assetId ? `#${assetId}` : ''}`;\n}\nexport function imHierarchyTitle(page: ImPageIdentity): string {\n const course = page.band.startsWith('k5')\n ? `Grade ${page.course === 'kindergarten' ? 'K' : page.course?.slice(6)}`\n : page.band.startsWith('MS')\n ? `Grade ${Number(page.course) + 5}`\n : ['', 'Algebra 1', 'Geometry', 'Algebra 2', 'Algebra 1 Supports'][\n Number(page.course)\n ];\n return `IM ${page.band} ${course ?? ''}${page.unit ? ` Unit ${page.unit}` : ''}${page.lesson ? ` Lesson ${page.lesson}` : ''}`.trim();\n}\nexport interface ImArtifact {\n id: string;\n label: string;\n allowed: boolean;\n}\nexport interface ImParsedPage {\n /** Page-scoped instructional ImageFiles; never branding or credited third-party images. */\n previewImage?: { id: string; alt: string };\n children: string[];\n artifacts: ImArtifact[];\n exclusions: { code: string; message: string }[];\n attribution: string;\n notices: string;\n licensed: boolean;\n title: string;\n}\ninterface RoleContainer {\n tag: string;\n parent?: RoleContainer;\n contentStart: number;\n resource: boolean;\n closed: boolean;\n malformed: boolean;\n headings: { tag: string; text: string }[];\n descendantHeadingCount: number;\n cells: string[];\n}\n\n/** A '<' is legal inside a tag only in a closed, quoted attribute value. */\nfunction malformedTagToken(token: string): boolean {\n const prefix = /^<\\/?[a-zA-Z][\\w:-]*/.exec(token);\n if (!prefix) return true;\n const end = token.length - 1;\n let index = prefix[0].length;\n while (index < end) {\n while (index < end && /\\s/.test(token[index])) index++;\n if (index === end || (index === end - 1 && token[index] === '/'))\n return false;\n const nameStart = index;\n while (index < end && !/[\\s\"'<>/=]/.test(token[index])) index++;\n if (index === nameStart) return true;\n while (index < end && /\\s/.test(token[index])) index++;\n if (token[index] !== '=') continue;\n index++;\n while (index < end && /\\s/.test(token[index])) index++;\n const quote = token[index];\n if (quote === '\"' || quote === \"'\") {\n const close = token.indexOf(quote, index + 1);\n if (close < 0 || close >= end) return true;\n index = close + 1;\n } else {\n const valueStart = index;\n while (index < end && !/\\s/.test(token[index])) {\n if (/[\"'`=<>]/.test(token[index])) return true;\n index++;\n }\n if (index === valueStart) return true;\n }\n }\n return false;\n}\n\n/** Bind each link to its own source row/block; headings never cross containers. */\nfunction localArtifactLabels(html: string): Map<number, string> {\n const stack: RoleContainer[] = [];\n const links: {\n start: number;\n owner?: RoleContainer;\n kind?: 'row' | 'resource';\n }[] = [];\n const voidTags = new Set([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n ]);\n const tokens =\n /<\\/?([a-zA-Z][\\w:-]*)(?:\\s+(?:[^>\"']|\"[^\"]*\"|'[^']*')*)?\\s*\\/?>/g;\n const invalidateOwners = () => {\n for (const owner of stack)\n if (owner.resource || owner.tag === 'tr') owner.malformed = true;\n };\n let tokenCount = 0;\n let consumedEnd = 0;\n for (const token of html.matchAll(tokens)) {\n if (++tokenCount > 50_000 || stack.length > 256)\n throw new Error('First-edition role structure exceeds parser bounds.');\n // Unconsumed markup starts are malformed descendants too (e.g. a tag\n // truncated before its '>' and then followed by an ancestor close).\n if (/<[/!]?[a-zA-Z]/.test(html.slice(consumedEnd, token.index)))\n invalidateOwners();\n consumedEnd = token.index + token[0].length;\n const malformed = malformedTagToken(token[0]);\n if (malformed) invalidateOwners();\n const tag = token[1].toLowerCase();\n if (token[0].startsWith('</')) {\n const index = stack.findLastIndex((node) => node.tag === tag);\n if (index < 0) {\n invalidateOwners();\n continue;\n }\n const node = stack[index];\n if (index !== stack.length - 1) {\n invalidateOwners();\n node.malformed = true;\n for (const dangling of stack.slice(index + 1))\n dangling.malformed = true;\n }\n node.closed = true;\n if (/^h[1-6]$/.test(tag)) {\n const content = imText(html.slice(node.contentStart, token.index));\n if (!node.malformed && node.parent?.resource)\n node.parent.headings.push({ tag, text: content });\n const row = stack\n .slice(0, index)\n .findLast((ancestor) => ancestor.tag === 'tr');\n if (row) row.headings.push({ tag, text: content });\n }\n if (tag === 'td' && node.parent?.tag === 'tr')\n node.parent.cells.push(\n imText(html.slice(node.contentStart, token.index)),\n );\n stack.length = index;\n continue;\n }\n // Register headings at OPEN: malformed close recovery must not erase them.\n if (/^h[1-6]$/.test(tag)) {\n for (const owner of stack)\n if (owner.resource || owner.tag === 'tr')\n owner.descendantHeadingCount++;\n }\n const parent = stack.at(-1);\n if (tag === 'a') {\n if (\n parent?.tag === 'td' &&\n parent.parent?.tag === 'tr' &&\n parent.parent.cells.length > 0\n )\n links.push({ start: token.index, owner: parent.parent, kind: 'row' });\n else\n links.push({\n start: token.index,\n owner: parent?.resource ? parent : undefined,\n kind: 'resource',\n });\n }\n if (voidTags.has(tag) || token[0].endsWith('/>')) continue;\n const className =\n /\\sclass\\s*=\\s*[\"']([^\"']*)[\"']/i.exec(token[0])?.[1] ?? '';\n stack.push({\n tag,\n parent,\n contentStart: token.index + token[0].length,\n resource:\n tag === 'div' &&\n className.split(/\\s+/).includes('im-c-row__flex-resource'),\n closed: false,\n malformed,\n headings: [],\n descendantHeadingCount: 0,\n cells: [],\n });\n }\n // Open owners or their descendants at EOF are never a complete source boundary.\n invalidateOwners();\n const labels = new Map<number, string>();\n for (const link of links) {\n const owner = link.owner;\n if (!owner?.closed || owner.malformed) continue;\n if (link.kind === 'row') {\n if (owner.descendantHeadingCount === 0 && owner.headings.length === 0)\n labels.set(link.start, owner.cells[0] ?? '');\n } else if (\n owner.descendantHeadingCount === 1 &&\n owner.headings.length === 1 &&\n /^h[34]$/.test(owner.headings[0].tag)\n )\n labels.set(link.start, owner.headings[0].text);\n }\n return labels;\n}\n\nexport function parseImFirstEditionPage(\n rawHtml: string,\n path: string,\n): ImParsedPage {\n const page = imPagePath(path);\n const html = rawHtml\n .replace(/<!--[\\s\\S]*?-->/g, '')\n .replace(/<(script|style)\\b[^>]*>[\\s\\S]*?<\\/\\1>/gi, '');\n const footer = /<footer\\b[^>]*>([\\s\\S]*?)<\\/footer>/i.exec(html)?.[1] ?? '';\n const licensed =\n /href=[\"']https:\\/\\/creativecommons\\.org\\/licenses\\/by\\/4\\.0\\/[\"']/i.test(\n footer,\n ) &&\n /Illustrative Mathematics/i.test(imText(footer)) &&\n !/licenses\\/(?:by-nc|by-sa|by-nd)|all rights reserved/i.test(footer);\n const paragraphs = [...footer.matchAll(/<p\\b[^>]*>([\\s\\S]*?)<\\/p>/gi)].map(\n (x) => imText(x[1]),\n );\n const attribution = paragraphs\n .filter((s) => /copyright|©|licensed under/i.test(s))\n .join('\\n');\n const notices = paragraphs\n .filter((s) => /name and logo|respective|attribution/i.test(s))\n .join('\\n');\n const children = new Set<string>();\n const exclusions: ImParsedPage['exclusions'] = [];\n const artifacts = new Map<string, ImArtifact>();\n const localLabels = localArtifactLabels(html);\n const anchors = [...html.matchAll(/<a\\b([^>]*)>([\\s\\S]*?)<\\/a\\s*>/gi)];\n if (anchors.length > 4000)\n throw new Error('First-edition page has too many links.');\n for (const anchor of anchors) {\n const href = /\\bhref\\s*=\\s*[\"']([^\"']+)[\"']/i.exec(anchor[1])?.[1];\n if (!href) continue;\n let url: URL;\n try {\n url = new URL(href.replace(/&/g, '&'), IM_ORIGIN + path);\n } catch {\n exclusions.push({\n code: 'invalid_link',\n message: 'Malformed source link.',\n });\n continue;\n }\n if (/oauth_im\\/login/.test(url.pathname)) {\n exclusions.push({\n code: 'login_required',\n message: imText(anchor[2]) || 'Login-gated material.',\n });\n continue;\n }\n if (\n url.hostname === 'accessim.org' ||\n url.hostname.endsWith('.accessim.org')\n ) {\n exclusions.push({\n code: 'different_edition',\n message: 'AccessIM/v.360 is outside the first edition.',\n });\n continue;\n }\n if (url.origin === IM_ASSET_ORIGIN) {\n const id = imAssetId(url);\n if (!id) {\n exclusions.push({\n code: 'invalid_asset_path',\n message: 'Unsupported official asset path.',\n });\n continue;\n }\n const label = localLabels.get(anchor.index) ?? '';\n const allowed =\n /^(Student Task Statements|Student Handouts|Cumulative Practice Problems|Family Support Materials|Family Materials|Learning Targets|Student Task Statement Cover Page)$/i.test(\n label,\n );\n const prior = artifacts.get(id);\n artifacts.set(id, {\n id,\n label,\n allowed:\n allowed && (!prior || (prior.allowed && prior.label === label)),\n });\n continue;\n }\n if (\n url.origin !== IM_ORIGIN ||\n url.username ||\n url.password ||\n url.port ||\n url.search ||\n url.hash ||\n /%|\\\\/.test(href)\n )\n continue;\n let child: ImPageIdentity;\n try {\n child = imPagePath(url.pathname);\n } catch {\n if (\n /^\\/(?:k5(?:_es)?|MS(?:_ES)?|HS(?:_ES)?)\\/(?:teachers|families|students)\\//i.test(\n url.pathname,\n )\n )\n exclusions.push({\n code: 'unsupported_hierarchy_or_html',\n message: `Outside declared PDF hierarchy: ${url.pathname}`,\n });\n continue;\n }\n const sameCourse =\n child.band === page.band &&\n child.audience === page.audience &&\n child.course === page.course;\n const rootChild =\n page.leaf === 'root' &&\n child.band.toLowerCase().replace('_es', '') === page.band.toLowerCase() &&\n child.course &&\n !child.unit &&\n child.leaf !== 'resources';\n const courseChild =\n page.course &&\n !page.unit &&\n page.leaf !== 'resources' &&\n sameCourse &&\n ((child.unit && !child.lesson && child.leaf !== 'resources') ||\n (!child.unit && child.leaf === 'resources'));\n const unitChild =\n page.unit &&\n !page.lesson &&\n !['resources', 'family-materials'].includes(page.leaf) &&\n sameCourse &&\n child.unit === page.unit &&\n ((child.lesson && child.leaf === 'preparation') ||\n (!child.lesson && child.leaf === 'resources'));\n const familyMaterialsChild =\n page.band.startsWith('k5') &&\n page.audience === 'families' &&\n page.unit &&\n !page.lesson &&\n page.leaf !== 'family-materials' &&\n sameCourse &&\n child.unit === page.unit &&\n !child.lesson &&\n child.leaf === 'family-materials';\n if (rootChild || courseChild || unitChild || familyMaterialsChild)\n children.add(child.path);\n }\n if (children.size > 128 || artifacts.size > 128)\n throw new Error('First-edition page exceeds hierarchy/artifact bound.');\n let previewImage: ImParsedPage['previewImage'];\n const main = /<main\\b[^>]*>([\\s\\S]*?)<\\/main>/i.exec(html)?.[1] ?? '';\n // Family instructional content carries the page license. Any additional image\n // credit/license/attribution makes its scope ambiguous, so omit the preview.\n if (\n licensed &&\n attribution &&\n page.audience === 'families' &&\n page.band.startsWith('k5') &&\n page.leaf === 'family-materials' &&\n !/attribution|copyright|licensed|credits?|©|all rights reserved/i.test(\n imText(main),\n )\n ) {\n for (const figure of main.matchAll(\n /<figure\\b([^>]*)>([\\s\\S]*?)<\\/figure>/gi,\n )) {\n if (\n !/class=[\"'][^\"']*\\bembedded-content-image-file\\b/i.test(figure[1]) ||\n !/data-record-model=[\"']ImageFile[\"']/i.test(figure[1])\n )\n continue;\n const caption = /<figcaption\\b[^>]*>([\\s\\S]*?)<\\/figcaption>/i.exec(\n figure[2],\n );\n if (!caption || imText(caption[1])) continue;\n const image = /<img\\b([^>]*)>/i.exec(figure[2])?.[1] ?? '';\n const src = /\\bsrc=[\"']([^\"']+)[\"']/i.exec(image)?.[1];\n const alt = imText(/\\balt=[\"']([^\"']+)[\"']/i.exec(image)?.[1] ?? '');\n // Only publisher-authored instructional diagrams, never photographs or logos.\n if (\n !src ||\n !/\\b(chart|diagram|number line|graph|table|tally)\\b/i.test(alt) ||\n /logo|photo|portrait|©|copyright|credit|license/i.test(alt)\n )\n continue;\n try {\n const id = imAssetId(new URL(src));\n if (id) {\n previewImage = { id, alt };\n break;\n }\n } catch {\n /* Unsupported source is absent. */\n }\n }\n }\n return {\n ...(previewImage ? { previewImage } : {}),\n children: [...children],\n artifacts: [...artifacts.values()],\n exclusions,\n attribution,\n notices,\n licensed,\n title: imText(/<title[^>]*>([\\s\\S]*?)<\\/title>/i.exec(html)?.[1] ?? ''),\n };\n}\n","import {\n CATALOG_REPRESENTATION_MEDIA_TYPES,\n catalogRepresentationFormat,\n catalogRepresentationMediaType,\n normalizeCatalogRepresentation,\n} from '../catalog-capability.js';\nimport type {\n CatalogAcquireAdapter,\n CatalogSourceRecord,\n CatalogSyncAdapter,\n CatalogSyncPage,\n} from '../catalog-contracts.js';\nimport {\n CATALOG_PREVIEW_MAX_BYTES,\n type CatalogPreview,\n type CatalogPreviewLoader,\n catalogPreviewPngDimensions,\n normalizeCatalogPreview,\n} from '../catalog-preview.js';\nimport {\n IM_ASSET_ORIGIN,\n IM_LICENSE,\n IM_ORIGIN,\n IM_ROOTS,\n imHierarchyTitle,\n imPagePath,\n imStableId,\n parseImFirstEditionPage,\n} from './public-illustrative-mathematics-parser.js';\n\nexport interface PublicIllustrativeMathematicsFirstEditionConfig {\n /** Standard fetch, including streaming Response bodies; defaults to global fetch. */\n fetch?: typeof globalThis.fetch;\n /** Per enumeration/acquisition total deadline. Default 20 seconds; maximum 60 seconds. */\n timeoutMs?: number;\n /** Selected PDF cap. Default 32 MiB; maximum 64 MiB. */\n maxPdfBytes?: number;\n}\ninterface Cursor {\n v: 1;\n todo: string[];\n offset: number;\n pageRevision?: string;\n}\ninterface Revision {\n v: 1;\n page: string;\n etag: string;\n length: number;\n modified: string;\n}\nconst PROVIDER = 'illustrative-mathematics';\nconst METADATA_CAP = 2_000_000;\nconst HEADS_PER_PAGE = 4;\nfunction retryDelay(value: string | null): number {\n if (!value) return 60_000;\n const delay = /^[0-9]+$/.test(value)\n ? Number(value) * 1000\n : Date.parse(value) - Date.now();\n return Number.isFinite(delay)\n ? Math.min(3_600_000, Math.max(0, delay))\n : 60_000;\n}\nfunction encode(value: unknown): string {\n return JSON.stringify(value);\n}\nfunction cursor(value?: string): Cursor {\n if (!value) return { v: 1, todo: ['/', ...IM_ROOTS], offset: 0 };\n if (value.length > 64_000) throw new Error('Cursor exceeds its size bound.');\n const x = JSON.parse(value) as Cursor;\n if (\n !x ||\n Object.keys(x).some(\n (k) => !['v', 'todo', 'offset', 'pageRevision'].includes(k),\n ) ||\n x.v !== 1 ||\n !Array.isArray(x.todo) ||\n !x.todo.length ||\n x.todo.length > 384 ||\n !Number.isSafeInteger(x.offset) ||\n x.offset < 0 ||\n x.offset > 128 ||\n (x.pageRevision !== undefined &&\n (typeof x.pageRevision !== 'string' || x.pageRevision.length > 256)) ||\n (x.offset > 0 && !x.pageRevision)\n )\n throw new Error('Invalid first-edition cursor.');\n for (const p of x.todo)\n if (typeof p !== 'string' || p.length > 160 || imPagePath(p).path !== p)\n throw new Error('Invalid cursor hierarchy path.');\n if (new Set(x.todo).size !== x.todo.length)\n throw new Error('Duplicate cursor paths.');\n return x;\n}\nfunction observedMetadata(response: Response) {\n const etag = response.headers.get('etag') ?? '';\n const lengthText = response.headers.get('content-length') ?? '';\n const length = Number(lengthText);\n const modified = response.headers.get('last-modified') ?? '';\n const header = response.headers.get('content-type');\n const mediaType =\n header === null ? null : catalogRepresentationMediaType(header);\n const format =\n mediaType === null\n ? 'unknown'\n : (catalogRepresentationFormat(mediaType) ?? 'unknown');\n if (\n response.headers.has('content-encoding') &&\n response.headers.get('content-encoding') !== 'identity'\n )\n throw new Error('PDF representation is unexpectedly encoded.');\n if (\n !/^\"[\\x21\\x23-\\x7e]{1,200}\"$/.test(etag) ||\n !/^[1-9][0-9]*$/.test(lengthText) ||\n !Number.isSafeInteger(length) ||\n !modified ||\n !Number.isFinite(Date.parse(modified)) ||\n modified.length > 100\n )\n throw new Error(\n 'Metadata requires a strong ETag, positive safe length, and valid Last-Modified metadata.',\n );\n return { etag, length, modified, format, mediaType } as const;\n}\nfunction validators(\n response: Response,\n cap: number,\n): Omit<Revision, 'v' | 'page'> {\n const { format, mediaType, ...metadata } = observedMetadata(response);\n if (format !== 'pdf' || metadata.length > cap)\n throw new Error(\n 'Selected representation requires PDF content type and bounded length.',\n );\n return metadata;\n}\nasync function readBody(response: Response, cap: number): Promise<Uint8Array> {\n const declared = response.headers.get('content-length');\n if (declared && (!/^[0-9]+$/.test(declared) || Number(declared) > cap))\n throw new Error('Response exceeds declared body bound.');\n if (!response.body) throw new Error('Provider response body is missing.');\n const reader = response.body.getReader();\n const chunks: Uint8Array[] = [];\n let size = 0;\n try {\n for (;;) {\n const next = await reader.read();\n if (next.done) break;\n size += next.value.byteLength;\n if (size > cap) throw new Error('Provider streamed body exceeds bound.');\n chunks.push(next.value);\n }\n } catch (error) {\n await reader.cancel().catch(() => {});\n throw error;\n } finally {\n reader.releaseLock();\n }\n const bytes = new Uint8Array(size);\n let offset = 0;\n for (const chunk of chunks) {\n bytes.set(chunk, offset);\n offset += chunk.length;\n }\n return bytes;\n}\nasync function sha256(bytes: Uint8Array): Promise<string> {\n return [\n ...new Uint8Array(await globalThis.crypto.subtle.digest('SHA-256', bytes)),\n ]\n .map((b) => b.toString(16).padStart(2, '0'))\n .join('');\n}\n/**\n * Public first-edition English/linked Spanish K–12 teacher/family hierarchy.\n * Each enumeration reads one HTML page, at most one bounded preview PNG and\n * at most four original asset HEADs. Only an\n * explicit, validated selection can GET PDF bytes; generic acquisition retains\n * policy, tenant isolation, idempotence, attribution and notices.\n */\nexport function createPublicIllustrativeMathematicsFirstEditionAdapter(\n config: PublicIllustrativeMathematicsFirstEditionConfig = {},\n): CatalogSyncAdapter & CatalogAcquireAdapter & CatalogPreviewLoader {\n const fetcher = config.fetch ?? globalThis.fetch;\n const timeout = config.timeoutMs ?? 20_000;\n const pdfCap = config.maxPdfBytes ?? 32 * 1024 * 1024;\n if (\n !Number.isSafeInteger(timeout) ||\n timeout < 1 ||\n timeout > 60_000 ||\n !Number.isSafeInteger(pdfCap) ||\n pdfCap < 5 ||\n pdfCap > 64 * 1024 * 1024\n )\n throw new Error('Invalid first-edition request bounds.');\n async function operation<T>(\n run: (\n request: (\n url: string,\n method: 'GET' | 'HEAD',\n headers?: Record<string, string>,\n ) => Promise<Response>,\n ) => Promise<T>,\n deadline = timeout,\n ): Promise<T> {\n const controller = new AbortController();\n let timer: ReturnType<typeof setTimeout> | undefined;\n try {\n return await Promise.race([\n run(async (url, method, headers = {}) => {\n if (controller.signal.aborted)\n throw new Error('First-edition operation timed out.');\n const response = await fetcher(url, {\n method,\n redirect: 'error',\n signal: controller.signal,\n headers: {\n 'accept-encoding': 'identity',\n accept: url.startsWith(IM_ASSET_ORIGIN)\n ? method === 'HEAD'\n ? Object.values(CATALOG_REPRESENTATION_MEDIA_TYPES).join(', ')\n : 'application/pdf'\n : 'text/html',\n ...headers,\n },\n });\n if (\n !response.ok ||\n response.status !== 200 ||\n response.redirected ||\n response.url !== url\n ) {\n await response.body?.cancel();\n const error = new Error(\n `Official provider request failed: HTTP ${response.status} or unexpected redirect.`,\n );\n Object.assign(error, {\n retryAfterMs:\n response.status === 429\n ? retryDelay(response.headers.get('retry-after'))\n : undefined,\n });\n throw error;\n }\n return response;\n }),\n new Promise<T>((_resolve, reject) => {\n timer = setTimeout(() => {\n controller.abort();\n reject(new Error('First-edition operation timed out.'));\n }, deadline);\n }),\n ]);\n } finally {\n if (timer) clearTimeout(timer);\n controller.abort();\n }\n }\n async function html(\n request: Parameters<Parameters<typeof operation>[0]>[0],\n path: string,\n ) {\n const response = await request(IM_ORIGIN + path, 'GET');\n if (\n !/^text\\/html(?:\\s*;|$)/i.test(response.headers.get('content-type') ?? '')\n )\n throw new Error('Expected official HTML metadata.');\n const bytes = await readBody(response, METADATA_CAP);\n const parsed = parseImFirstEditionPage(\n new TextDecoder('utf-8', { fatal: true }).decode(bytes),\n path,\n );\n // Official HTML includes per-request CSRF tokens and changing weak ETags.\n // Bind the revision to the exact validated source semantics, not session markup.\n const revision = await sha256(\n new TextEncoder().encode(encode({ path, ...parsed })),\n );\n return { parsed, revision };\n }\n return {\n async loadPreview(value) {\n const preview = normalizeCatalogPreview(value);\n if (\n !preview ||\n (preview.rights.expiresAt &&\n Date.parse(preview.rights.expiresAt) <= Date.now())\n )\n throw new Error('Invalid or expired preview.');\n return operation(async (request) => {\n const response = await request(\n IM_ASSET_ORIGIN + '/' + preview.reference,\n 'GET',\n { accept: 'image/png' },\n );\n if (\n response.headers\n .get('content-type')\n ?.split(';')[0]\n .trim()\n .toLowerCase() !== 'image/png'\n ) {\n await response.body?.cancel();\n throw new Error('Preview is not PNG.');\n }\n return readBody(response, CATALOG_PREVIEW_MAX_BYTES);\n });\n },\n async enumerate(input): Promise<CatalogSyncPage> {\n let state: Cursor;\n try {\n state = cursor(input.cursor ?? input.checkpoint.cursor);\n } catch (error) {\n return {\n records: [],\n complete: false,\n paused: true,\n exclusions: [\n { code: 'invalid_provider_cursor', message: String(error) },\n ],\n };\n }\n try {\n const started = performance.now();\n const { result, candidate } = await operation(async (request) => {\n const path = state.todo[0];\n const { parsed, revision } = await html(request, path);\n if (state.pageRevision && state.pageRevision !== revision)\n throw new Error(\n 'Metadata changed during cursor traversal; restart this sync generation.',\n );\n if (state.offset > parsed.artifacts.length)\n throw new Error('Cursor artifact offset exceeds source page.');\n const policyExclusions =\n state.offset === 0 ? [...parsed.exclusions] : [];\n const records: CatalogSourceRecord[] = [];\n const page = imPagePath(path);\n const expectsChildren =\n page.leaf === 'root' ||\n (page.audience === 'teachers' &&\n !page.lesson &&\n ['units', 'lessons', 'index'].includes(page.leaf)) ||\n (page.audience === 'families' &&\n !page.unit &&\n ['units', 'index'].includes(page.leaf));\n if (expectsChildren && !parsed.children.length)\n throw new Error(\n 'Official hierarchy page has no recognized children; coverage is incomplete.',\n );\n if (page.course && state.offset === 0)\n records.push({\n providerId: PROVIDER,\n stableId: imStableId(path),\n revision,\n canonicalUrl: IM_ORIGIN + path,\n title: imHierarchyTitle(page),\n parentStableId: page.lesson\n ? imStableId(\n path.replace(\n /\\/(?:lesson-)?[0-9]+\\/preparation.html$/,\n page.band.startsWith('k5')\n ? '/lessons.html'\n : '/index.html',\n ),\n )\n : page.unit\n ? imStableId(\n `/${page.band}/${page.audience}/${page.course}/${page.band.startsWith('k5') ? 'units' : 'index'}.html`,\n )\n : undefined,\n resourceType: page.lesson\n ? 'lesson'\n : page.unit\n ? 'unit'\n : 'course',\n subjects: ['mathematics'],\n language: page.band.toLowerCase().endsWith('_es') ? 'es' : 'en',\n availableFormats: ['html'],\n visibility: 'teacher',\n licenseEvidence: {\n state: parsed.licensed ? 'verified' : 'unknown',\n sourceUrl: IM_ORIGIN + path,\n permittedOperations: ['link'],\n },\n });\n const slice = parsed.artifacts.slice(\n state.offset,\n state.offset + HEADS_PER_PAGE,\n );\n const results = await Promise.allSettled(\n slice.map(async (asset) => {\n if (!asset.allowed || !parsed.licensed || !parsed.attribution) {\n policyExclusions.push({\n code: !asset.allowed\n ? 'teacher_or_unknown_role'\n : 'unverified_license',\n message: `${asset.id}: ${asset.label || 'Unknown label'}.`,\n });\n return;\n }\n const response = await request(\n `${IM_ASSET_ORIGIN}/${asset.id}`,\n 'HEAD',\n );\n const { format, mediaType, ...metadata } =\n observedMetadata(response);\n const representation = normalizeCatalogRepresentation({\n format,\n mediaType,\n byteLength: metadata.length,\n validators: {\n etag: metadata.etag,\n lastModified: metadata.modified,\n },\n acquisition:\n format === 'unknown'\n ? {\n status: 'unknown-format',\n reason:\n mediaType === null\n ? 'missing-content-type'\n : 'unrecognized-content-type',\n }\n : format !== 'pdf'\n ? { status: 'unsupported-format' }\n : {\n status:\n metadata.length <= pdfCap\n ? 'supported'\n : 'size-limit',\n maxBytes: pdfCap,\n },\n });\n // Retain the published PDF revision encoding; capability limits are not content identity.\n const pinned =\n format === 'pdf'\n ? { v: 1, page: revision, ...metadata }\n : {\n v: 2,\n page: revision,\n ...metadata,\n mediaType,\n };\n const grade = page.band.startsWith('k5')\n ? page.course === 'kindergarten'\n ? 'K'\n : page.course?.slice(6)\n : page.band.startsWith('MS')\n ? String(Number(page.course) + 5)\n : undefined;\n records.push({\n providerId: PROVIDER,\n stableId: imStableId(path, asset.id),\n revision: encode(pinned),\n canonicalUrl: IM_ORIGIN + path,\n title: `${imHierarchyTitle(page)} — ${asset.label}`,\n suppliedDescription: `${parsed.title}. Source label: ${asset.label}.`,\n author: 'Illustrative Mathematics',\n subjects: ['mathematics'],\n gradeRange: grade\n ? { min: grade, max: grade }\n : { min: '9', max: '12' },\n language: page.band.toLowerCase().endsWith('_es') ? 'es' : 'en',\n resourceType: 'student-material',\n parentStableId: imStableId(path),\n availableFormats: format === 'unknown' ? [] : [format],\n representation,\n visibility: 'catalog',\n licenseEvidence: {\n state: 'verified',\n identifier: 'CC BY',\n version: '4.0',\n sourceUrl: IM_ORIGIN + path,\n attribution: `${parsed.attribution}\\n${IM_ORIGIN + path}\\n${IM_LICENSE}`,\n exceptions: `${parsed.notices}\\nOriginal first-edition ${format.toUpperCase()}; no changes made. License: ${IM_LICENSE}`,\n retrievedAt: new Date().toISOString(),\n permittedOperations: [\n 'link',\n 'download',\n 'print',\n 'adapt',\n 'redistribute',\n 'commercial-use',\n ],\n },\n });\n }),\n );\n // Do not advance a cursor or emit a partial page after any failed HEAD.\n const failure = results.find((r) => r.status === 'rejected');\n if (failure?.status === 'rejected') throw failure.reason;\n const end = state.offset + slice.length;\n const next: Cursor =\n end < parsed.artifacts.length\n ? { ...state, offset: end, pageRevision: revision }\n : {\n v: 1,\n todo: [...parsed.children, ...state.todo.slice(1)],\n offset: 0,\n };\n if (next.todo.length > 384 || encode(next).length > 64_000)\n throw new Error('Hierarchy cursor exceeds its durable bound.');\n if (path === '/')\n policyExclusions.push({\n code: 'declared_scope',\n message:\n 'Public first-edition official CMS artifact links with observed PDF/ZIP/DOCX representations explicitly labeled for students/families on official K5/MS/HS teacher/family course, unit, resources and lesson preparation pages, including linked Spanish counterparts and Algebra 1 Supports. HTML-only lessons, external-host artifacts, teacher/login and unknown-role material are excluded; unknown MIME is retained with acquisition denied; malformed MIME or invalid validators pause enumeration; AccessIM/v.360 is excluded.',\n });\n return {\n result: {\n records: records.sort((a, b) =>\n a.stableId.localeCompare(b.stableId),\n ),\n complete: next.todo.length === 0,\n ...(next.todo.length ? { nextCursor: encode(next) } : {}),\n policyExclusions,\n },\n candidate:\n state.offset === 0 && page.course && parsed.previewImage\n ? {\n ...parsed.previewImage,\n path,\n revision,\n attribution: parsed.attribution,\n }\n : undefined,\n };\n });\n // Required HTML/HEAD work has finished. Optional media gets its own short\n // deadline/controller, so a stalled image cannot pause the metadata cursor.\n const previewBudget = Math.min(\n 2000,\n Math.floor(timeout / 4),\n Math.floor(timeout - (performance.now() - started)),\n );\n if (candidate && previewBudget > 0) {\n try {\n const bytes = await operation(async (request) => {\n const response = await request(\n `${IM_ASSET_ORIGIN}/${candidate.id}`,\n 'GET',\n { accept: 'image/png' },\n );\n if (\n response.headers\n .get('content-type')\n ?.split(';')[0]\n .trim()\n .toLowerCase() !== 'image/png'\n ) {\n await response.body?.cancel();\n throw new Error('Preview is not PNG.');\n }\n return readBody(response, CATALOG_PREVIEW_MAX_BYTES);\n }, previewBudget);\n const dimensions = catalogPreviewPngDimensions(bytes);\n const hash = await sha256(bytes);\n const preview: CatalogPreview = {\n providerId: PROVIDER,\n stableId: imStableId(candidate.path),\n revision: `${candidate.revision}:${hash}`,\n reference: candidate.id,\n mediaType: 'image/png',\n ...dimensions,\n byteLength: bytes.length,\n sha256: hash,\n alt: candidate.alt,\n rights: {\n state: 'verified',\n identifier: 'CC-BY-4.0',\n sourceUrl: IM_ORIGIN + candidate.path,\n attribution: candidate.attribution,\n retrievedAt: new Date().toISOString(),\n },\n };\n const record = result.records.find(\n (record) => record.stableId === preview.stableId,\n );\n if (record) {\n record.revision = preview.revision;\n record.preview = preview;\n }\n } catch {\n // Optional preview failure leaves required records and cursor intact.\n }\n }\n return result;\n } catch (error) {\n return {\n records: [],\n complete: false,\n paused: true,\n nextCursor: encode(state),\n exclusions: [\n {\n code: 'provider_metadata_unavailable',\n message: error instanceof Error ? error.message : String(error),\n retryAfterMs: (error as { retryAfterMs?: number }).retryAfterMs,\n },\n ],\n };\n }\n },\n async acquire(input) {\n if (\n input.providerId !== PROVIDER ||\n input.format !== 'pdf' ||\n input.stableId.length > 300 ||\n input.revision.length > 1000\n )\n throw new Error('Unsupported first-edition acquisition.');\n const match = /^im-first-edition:(\\/[^#]+)#([a-zA-Z0-9]{20,64})$/.exec(\n input.stableId,\n );\n if (!match || imPagePath(match[1]).path !== match[1])\n throw new Error('Invalid selected first-edition identity.');\n const selected = JSON.parse(input.revision) as Revision;\n if (\n !selected ||\n Object.keys(selected).sort().join(',') !==\n 'etag,length,modified,page,v' ||\n selected.v !== 1 ||\n typeof selected.page !== 'string' ||\n !/^[a-f0-9]{64}$/.test(selected.page) ||\n typeof selected.etag !== 'string' ||\n !/^\"[\\x21\\x23-\\x7e]{1,200}\"$/.test(selected.etag) ||\n !Number.isSafeInteger(selected.length) ||\n selected.length < 5 ||\n selected.length > pdfCap ||\n typeof selected.modified !== 'string' ||\n selected.modified.length > 100 ||\n !Number.isFinite(Date.parse(selected.modified))\n )\n throw new Error('Invalid selected first-edition revision.');\n return await operation(async (request) => {\n const { parsed, revision } = await html(request, match[1]);\n if (\n revision !== selected.page ||\n !parsed.licensed ||\n !parsed.attribution ||\n !parsed.artifacts.some((a) => a.id === match[2] && a.allowed)\n )\n throw new Error(\n 'Selected artifact, role, license or page revision changed.',\n );\n const response = await request(\n `${IM_ASSET_ORIGIN}/${match[2]}`,\n 'GET',\n {\n 'if-match': selected.etag,\n 'if-unmodified-since': selected.modified,\n },\n );\n const actual = validators(response, pdfCap);\n if (\n actual.etag !== selected.etag ||\n actual.length !== selected.length ||\n actual.modified !== selected.modified\n ) {\n await response.body?.cancel();\n throw new Error('Selected PDF revision changed.');\n }\n const bytes = await readBody(response, pdfCap);\n if (\n bytes.length !== selected.length ||\n new TextDecoder().decode(bytes.subarray(0, 5)) !== '%PDF-'\n )\n throw new Error('Selected body is not the declared PDF.');\n return { bytes, revision: input.revision, sha256: await sha256(bytes) };\n });\n },\n };\n}\n"],"mappings":";;;;AAOA,eAAe,wBAAwB,KAAK,MAAM,m0iTAAozxV,CAAC;;;ACAh2xV,IAAM,qCAAqC;CAChD,KAAK;CACL,KAAK;CACL,MAAM;AACR;AAEO,SAAS,+BAA+B,OAAuB;CACpE,MAAM,QAAQ;CAEd,MAAM,S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IAAM,yBAA2D;CACtE;EACE,WAAW;EACX,OAAO;EACP,SAAS;EACT,SAAS;EACT,SAAS;EACT,gBAAgB;CAClB;CACA;EACE,WAAW;EACX,OAAO;EACP,SAAS;EACT,SAAS;EACT,SAAS;EACT,gBAAgB;CAClB;CACA;EACE,WAAW;EACX,OAAO;EACP,SAAS;EACT,SAAS;EACT,SAAS;EACT,gBAAgB;CAClB;CACA;EACE,WAAW;EACX,OAAO;EACP,SAAS;EACT,SAAS;EACT,SAAS;EACT,gBAAgB;CAClB;CACA;EACE,WAAW;EACX,OAAO;EACP,SAAS;EACT,SAAS;EACT,SAAS;EACT,gBAAgB;CAClB;CACA;EACE,WAAW;EACX,OAAO;EACP,SAAS;EACT,SAAS;EACT,SAAS;EACT,gBAAgB;CAClB;CACA;EACE,WAAW;EACX,OAAO;EACP,SAAS;EACT,SAAS;EACT,SAAS;EACT,gBAAgB;CAClB;CACA;EACE,WAAW;EACX,OAAO;EACP,SAAS;EACT,SAAS;EACT,SAAS;EACT,gBAAgB;CAClB;CACA;EACE,WAAW;EACX,OAAO;EACP,SAAS;EACT,SAAS;EACT,SAAS;EACT,gBAAgB;CAClB;AACF;AAEO,SAAS,cACd,SACkC;CAClC,OAAO,UACH,uBAAuB,QAAQ,WAAW,OAAO,YAAY,OAAO,IACpE;AACN;AAEA,SAAS,YACP,SACA,SACA,OACA,SACuB;CACvB,OAAO;EACL,WAAW,GAAG,QAAO,GAAI;EACzB;EACA;EACA;EACA,SAAS;EACT,gBAAgB;CAClB;AACF;AAOO,IAAM,wBAAyD;CACpE;EACE,SAAS;EACT,OAAO;EACP,SAAS;GACP,YACE,WACA,WACA,qBACA,gDACF;GACA,YACE,WACA,WACA,qBACA,gDACF;GACA,YACE,WACA,SACA,yBACA,gDACF;GACA,YACE,WACA,OACA,iBACA,4CACF;GACA,YACE,WACA,SACA,mBACA,wFACF;GACA,YACE,WACA,aACA,kCACA,+CACF;EACF;CACF;CACA;EACE,SAAS;EACT,OAAO;EACP,SAAS;GACP,YACE,WACA,WACA,qBACA,yCACF;GACA,YACE,WACA,WACA,4BACA,wDACF;GACA,YACE,WACA,SACA,yBACA,oDACF;GACA,YACE,WACA,OACA,wBACA,oDACF;GACA,YACE,WACA,SACA,0BACA,8CACF;GACA,YACE,WACA,aACA,sCACA,2CACF;EACF;CACF;CACA;EACE,SAAS;EACT,OAAO;EACP,SAAS;GACP,YACE,WACA,WACA,2BACA,uDACF;GACA,YACE,WACA,WACA,oCACA,wDACF;GACA,YACE,WACA,SACA,kBACA,8DACF;GACA,YACE,WACA,OACA,gCACA,4DACF;GACA,YACE,WACA,SACA,kCACA,0FACF;GACA,YACE,WACA,aACA,kCACA,+CACF;EACF;CACF;CACA;EACE,SAAS;EACT,OAAO;EACP,SAAS;GACP,YACE,WACA,WACA,mCACA,gDACF;GACA,YACE,WACA,WACA,oBACA,gDACF;GACA,YACE,WACA,SACA,oBACA,uCACF;GACA,YACE,WACA,OACA,gBACA,4CACF;GACA,YACE,WACA,SACA,kBACA,uCACF;GACA,YACE,WACA,aACA,sCACA,2CACF;EACF;CACF;AACF;AAEO,SAAS,YACd,SACsB;CACtB,MAAM,QAAQ,sBAAsB,MACjC,cAAc,UAAU,YAAY,OACvC;CACA,IAAI,CAAC,OAAO,MAAM,IAAI,MAAM,mCAAmC;CAC/D,OAAO;AACT;AAGA,eAAsB,4BACpB,SACA,SAG6B;CAC7B,MAAM,SAAS,uBAAuB,MACnC,cAAc,UAAU,cAAc,QAAQ,SACjD;CACA,IAAI,CAAC,QAAQ,MAAM,IAAI,MAAM,8CAA8C;CAC3E,IAAI,OAAO,mBAAmB,oBAC5B,MAAM,IAAI,MACR,qGACF;CACF,OAAO,QAAQ,aAAa;EAC1B,GAAG;EACH,SAAS,OAAO;EAChB,SAAS,OAAO;CAClB,CAAC;AACH;AAEA,eAAsB,2BACpB,SACA,SAGqC;CACrC,MAAM,QAAQ,YAAY,QAAQ,OAAO;CACzC,MAAM,UAAU,MAAM,QAAQ,IAC5B,MA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CAAC,iBAAiB,KAAK,SAAS,IAAI,KACpC,OAAO,SAAS,SAAS,YACzB,CAAC,6BAA6B,KAAK,SAAS,IAAI,KAChD,CAAC,OAAO,cAAc,SAAS,MAAM,KACrC,SAAS,SAAS,KAClB,SAAS,SAAS,UAClB,OAAO,SAAS,aAAa,YAC7B,SAAS,SAAS,SAAS,OAC3B,CAAC,OAAO,SAAS,KAAK,MAAM,SAAS,QAAQ,CAAC,GAE9C,MAAM,IAAI,MAAM,0CAA0C;GAC5D,OAAO,MAAM,UAAU,OAAO,YAAY;IACxC,MAAM,EAAE,QAAQ,aAAa,MAAM,KAAK,SAAS,MAAM,EAAE;IACzD,IACE,aAAa,SAAS,QACtB,CAAC,OAAO,YACR,CAAC,OAAO,eACR,CAAC,OAAO,UAAU,MAAM,MAAM,EAAE,OAAO,MAAM,MAAM,EAAE,OAAO,GAE5D,MAAM,IAAI,MACR,4DACF;IACF,MAAM,WAAW,MAAM,QACrB,GAAG,gBAAe,GAAI,MAAM,MAC5B,OACA;KACE,YAAY,SAAS;KACrB,uBAAuB,SAAS;IAClC,CACF;IACA,MAAM,SAAS,WAAW,UAAU,MAAM;IAC1C,IACE,OAAO,SAAS,SAAS,QACzB,OAAO,WAAW,SAAS,UAC3B,OAAO,aAAa,SAAS,UAC7B;KACA,MAAM,SAAS,MAAM,OAAO;KAC5B,MAAM,IAAI,MAAM,gCAAgC;IAClD;IACA,MAAM,QAAQ,MAAM,SAAS,UAAU,MAAM;IAC7C,IACE,MAAM,WAAW,SAAS,UAC1B,IAAI,YAAY,CAAA,CAAE,OAAO,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,SAEnD,MAAM,IAAI,MAAM,wCAAwC;IAC1D,OAAO;KAAE;KAAO,UAAU,MAAM;KAAU,QAAQ,MAAM,OAAO,KAAK;IAAE;GACxE,CAAC;EACH;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["links","node","record"],"sources":["../src/__smrt-register__.ts","../src/catalog-capability.ts","../src/catalog-policy.ts","../src/catalog-acquisition-service.ts","../src/catalog-preview.ts","../src/catalog-models.ts","../src/catalog-collections.ts","../src/catalog-database-sync-store.ts","../src/catalog-materialization-service.ts","../src/catalog-read-service.ts","../src/catalog-sync-service.ts","../src/course-source.ts","../src/sources/illustrative-mathematics-parser.ts","../src/sources/oer-commons-rss-parser.ts","../src/hearth-catalog-providers.ts","../src/hearth-easy-peasy-grade4.ts","../src/recipes.ts","../src/sources/easy-peasy-parser.ts","../src/source-import-service.ts","../src/sources/google-drive-adapter.ts","../src/sources/public-illustrative-mathematics-parser.ts","../src/sources/public-illustrative-mathematics-adapter.ts"],"sourcesContent":["// Generated by @happyvertical/smrt-core smrtPlugin at library build time.\n// The package manifest is inlined so self-registration cannot miss when a\n// downstream bundler relocates this module away from dist/manifest.json\n// (https://github.com/happyvertical/smrt/issues/1506,\n// https://github.com/happyvertical/smrt/issues/1507).\nimport { ObjectRegistry } from '@happyvertical/smrt-core';\n\nObjectRegistry.registerPackageManifest(JSON.parse(\"{\\\"version\\\":\\\"1.0.0\\\",\\\"timestamp\\\":0,\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"packageVersion\\\":\\\"0.57.40\\\",\\\"objects\\\":{\\\"@happyvertical/smrt-education:CatalogProviderCollection\\\":{\\\"name\\\":\\\"catalogprovidercollection\\\",\\\"className\\\":\\\"CatalogProviderCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CatalogProviderCollection\\\",\\\"collection\\\":\\\"catalogproviders\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog-collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"CatalogProvider\\\",\\\"exportName\\\":\\\"CatalogProviderCollection\\\",\\\"collectionExportName\\\":\\\"CatalogProviderCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"catalog_providers\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"catalog_providers\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"provider_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"name\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"active\\\\\\\" BOOLEAN NOT NULL DEFAULT TRUE\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"provider_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"active\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":true}},\\\"indexes\\\":[{\\\"name\\\":\\\"catalog_providers_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"catalog_providers_created_at_idx\\\",\\\"columns\\\":[\\\"created_at\\\"]}],\\\"version\\\":\\\"f35557a4\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CatalogResourceCollection\\\":{\\\"name\\\":\\\"catalogresourcecollection\\\",\\\"className\\\":\\\"CatalogResourceCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CatalogResourceCollection\\\",\\\"collection\\\":\\\"catalogresources\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog-collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"CatalogResource\\\",\\\"exportName\\\":\\\"CatalogResourceCollection\\\",\\\"collectionExportName\\\":\\\"CatalogResourceCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"catalog_resources\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"catalog_resources\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"provider_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"stable_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"revision\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"canonical_url\\\\\\\" TEXT,\\\\n \\\\\\\"title\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"supplied_description\\\\\\\" TEXT,\\\\n \\\\\\\"author\\\\\\\" TEXT,\\\\n \\\\\\\"subjects\\\\\\\" TEXT,\\\\n \\\\\\\"grades\\\\\\\" TEXT,\\\\n \\\\\\\"language\\\\\\\" TEXT,\\\\n \\\\\\\"resource_type\\\\\\\" TEXT,\\\\n \\\\\\\"parent_stable_id\\\\\\\" TEXT,\\\\n \\\\\\\"available_formats\\\\\\\" TEXT,\\\\n \\\\\\\"representation\\\\\\\" TEXT,\\\\n \\\\\\\"preview\\\\\\\" TEXT,\\\\n \\\\\\\"license_evidence\\\\\\\" TEXT,\\\\n \\\\\\\"license_state\\\\\\\" TEXT DEFAULT 'unknown',\\\\n \\\\\\\"visibility\\\\\\\" TEXT DEFAULT 'catalog',\\\\n \\\\\\\"last_seen_run_id\\\\\\\" TEXT,\\\\n \\\\\\\"withdrawn_at\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"provider_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"stable_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"revision\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"canonical_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"supplied_description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"author\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"subjects\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"grades\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"language\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"resource_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"parent_stable_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"available_formats\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"representation\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"preview\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"license_evidence\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"license_state\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"unknown\\\"},\\\"visibility\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"catalog\\\"},\\\"last_seen_run_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"withdrawn_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"catalog_resources_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"catalog_resources_created_at_idx\\\",\\\"columns\\\":[\\\"created_at\\\"]}],\\\"version\\\":\\\"6ea66f0d\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CatalogSyncStateCollection\\\":{\\\"name\\\":\\\"catalogsyncstatecollection\\\",\\\"className\\\":\\\"CatalogSyncStateCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CatalogSyncStateCollection\\\",\\\"collection\\\":\\\"catalogsyncstates\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog-collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"CatalogSyncState\\\",\\\"exportName\\\":\\\"CatalogSyncStateCollection\\\",\\\"collectionExportName\\\":\\\"CatalogSyncStateCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"catalog_sync_states\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"catalog_sync_states\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"provider_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"cursor\\\\\\\" TEXT,\\\\n \\\\\\\"run_id\\\\\\\" TEXT,\\\\n \\\\\\\"complete\\\\\\\" BOOLEAN NOT NULL DEFAULT FALSE,\\\\n \\\\\\\"paused\\\\\\\" BOOLEAN NOT NULL DEFAULT FALSE,\\\\n \\\\\\\"pause_reason\\\\\\\" TEXT,\\\\n \\\\\\\"imported_count\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"failures\\\\\\\" TEXT,\\\\n \\\\\\\"last_successful_at\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"provider_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"cursor\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"run_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"complete\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":false},\\\"paused\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":false},\\\"pause_reason\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"imported_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"failures\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"last_successful_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"catalog_sync_states_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"catalog_sync_states_created_at_idx\\\",\\\"columns\\\":[\\\"created_at\\\"]}],\\\"version\\\":\\\"52dc3ee1\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CatalogSelectionCollection\\\":{\\\"name\\\":\\\"catalogselectioncollection\\\",\\\"className\\\":\\\"CatalogSelectionCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CatalogSelectionCollection\\\",\\\"collection\\\":\\\"catalogselections\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog-collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"CatalogSelection\\\",\\\"exportName\\\":\\\"CatalogSelectionCollection\\\",\\\"collectionExportName\\\":\\\"CatalogSelectionCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"catalog_selections\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"catalog_selections\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"resource_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"selected_by_user_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"selected_revision\\\\\\\" TEXT NOT NULL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"resource_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"catalog_resources\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"selected_by_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"selected_revision\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"catalog_selections_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"catalog_selections_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"catalog_selections_resource_id_idx\\\",\\\"columns\\\":[\\\"resource_id\\\"]}],\\\"version\\\":\\\"c6b02eb9\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CatalogAcquisitionCollection\\\":{\\\"name\\\":\\\"catalogacquisitioncollection\\\",\\\"className\\\":\\\"CatalogAcquisitionCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CatalogAcquisitionCollection\\\",\\\"collection\\\":\\\"catalogacquisitions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog-collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"CatalogAcquisition\\\",\\\"exportName\\\":\\\"CatalogAcquisitionCollection\\\",\\\"collectionExportName\\\":\\\"CatalogAcquisitionCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"catalog_acquisitions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"catalog_acquisitions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"resource_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"selection_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"revision\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"format\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"sha256\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"attribution\\\\\\\" TEXT,\\\\n \\\\\\\"notices\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"resource_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"catalog_resources\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"selection_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"catalog_selections\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"revision\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"format\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sha256\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"attribution\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"notices\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"catalog_acquisitions_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"catalog_acquisitions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"catalog_acquisitions_resource_id_idx\\\",\\\"columns\\\":[\\\"resource_id\\\"]},{\\\"name\\\":\\\"catalog_acquisitions_selection_id_idx\\\",\\\"columns\\\":[\\\"selection_id\\\"]}],\\\"version\\\":\\\"ee9c5add\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CatalogProvider\\\":{\\\"name\\\":\\\"catalogprovider\\\",\\\"className\\\":\\\"CatalogProvider\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CatalogProvider\\\",\\\"collection\\\":\\\"catalogproviders\\\",\\\"description\\\":\\\"Globally visible provider registration. Hosts configure adapters and credentials out of band.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"providerId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"name\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"active\\\":{\\\"type\\\":\\\"boolean\\\",\\\"required\\\":true,\\\"default\\\":true}},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"CatalogProvider\\\",\\\"collectionExportName\\\":\\\"CatalogProviderCollection\\\",\\\"displayLabelField\\\":\\\"name\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"providerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"name\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"active\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"boolean\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"catalog_providers\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"catalog_providers\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"provider_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"name\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"active\\\\\\\" BOOLEAN NOT NULL DEFAULT TRUE\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"provider_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"active\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":true}},\\\"indexes\\\":[{\\\"name\\\":\\\"catalog_providers_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"catalog_providers_created_at_idx\\\",\\\"columns\\\":[\\\"created_at\\\"]}],\\\"version\\\":\\\"f35557a4\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CatalogResource\\\":{\\\"name\\\":\\\"catalogresource\\\",\\\"className\\\":\\\"CatalogResource\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CatalogResource\\\",\\\"collection\\\":\\\"catalogresources\\\",\\\"description\\\":\\\"A provider-native record. Rows are intentionally not merged across providers.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"providerId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"stableId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"revision\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"canonicalUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"suppliedDescription\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"author\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"subjects\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"grades\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"language\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"resourceType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"parentStableId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"availableFormats\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"representation\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"preview\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"licenseEvidence\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"licenseState\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"unknown\\\",\\\"enum\\\":[\\\"verified\\\",\\\"unknown\\\",\\\"conflicting\\\",\\\"restricted\\\"]},\\\"visibility\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"catalog\\\",\\\"enum\\\":[\\\"catalog\\\",\\\"teacher\\\"]},\\\"lastSeenRunId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"withdrawnAt\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"getPreview\\\":{\\\"name\\\":\\\"getPreview\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"CatalogPreview | undefined\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setPreview\\\":{\\\"name\\\":\\\"setPreview\\\",\\\"async\\\":false,\\\"parameters\\\":[{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"CatalogPreview | undefined\\\",\\\"optional\\\":false,\\\"unionBranches\\\":[{\\\"type\\\":\\\"CatalogPreview\\\"},{\\\"type\\\":\\\"undefined\\\"}]}],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getRepresentation\\\":{\\\"name\\\":\\\"getRepresentation\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"CatalogResourceRepresentation | undefined\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setRepresentation\\\":{\\\"name\\\":\\\"setRepresentation\\\",\\\"async\\\":false,\\\"parameters\\\":[{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"CatalogResourceRepresentation | undefined\\\",\\\"optional\\\":false,\\\"unionBranches\\\":[{\\\"type\\\":\\\"CatalogResourceRepresentation\\\"},{\\\"type\\\":\\\"undefined\\\"}]}],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"CatalogResource\\\",\\\"collectionExportName\\\":\\\"CatalogResourceCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"providerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"stableId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"revision\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"title\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"catalog_resources\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"catalog_resources\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"provider_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"stable_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"revision\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"canonical_url\\\\\\\" TEXT,\\\\n \\\\\\\"title\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"supplied_description\\\\\\\" TEXT,\\\\n \\\\\\\"author\\\\\\\" TEXT,\\\\n \\\\\\\"subjects\\\\\\\" TEXT,\\\\n \\\\\\\"grades\\\\\\\" TEXT,\\\\n \\\\\\\"language\\\\\\\" TEXT,\\\\n \\\\\\\"resource_type\\\\\\\" TEXT,\\\\n \\\\\\\"parent_stable_id\\\\\\\" TEXT,\\\\n \\\\\\\"available_formats\\\\\\\" TEXT,\\\\n \\\\\\\"representation\\\\\\\" TEXT,\\\\n \\\\\\\"preview\\\\\\\" TEXT,\\\\n \\\\\\\"license_evidence\\\\\\\" TEXT,\\\\n \\\\\\\"license_state\\\\\\\" TEXT DEFAULT 'unknown',\\\\n \\\\\\\"visibility\\\\\\\" TEXT DEFAULT 'catalog',\\\\n \\\\\\\"last_seen_run_id\\\\\\\" TEXT,\\\\n \\\\\\\"withdrawn_at\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"provider_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"stable_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"revision\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"canonical_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"supplied_description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"author\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"subjects\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"grades\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"language\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"resource_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"parent_stable_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"available_formats\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"representation\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"preview\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"license_evidence\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"license_state\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"unknown\\\"},\\\"visibility\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"catalog\\\"},\\\"last_seen_run_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"withdrawn_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"catalog_resources_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"catalog_resources_created_at_idx\\\",\\\"columns\\\":[\\\"created_at\\\"]}],\\\"version\\\":\\\"6ea66f0d\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CatalogSyncState\\\":{\\\"name\\\":\\\"catalogsyncstate\\\",\\\"className\\\":\\\"CatalogSyncState\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CatalogSyncState\\\",\\\"collection\\\":\\\"catalogsyncstates\\\",\\\"description\\\":\\\"Durable per-provider enumeration state. A failed or partial feed is never complete.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"providerId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"cursor\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"runId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"complete\\\":{\\\"type\\\":\\\"boolean\\\",\\\"required\\\":true,\\\"default\\\":false},\\\"paused\\\":{\\\"type\\\":\\\"boolean\\\",\\\"required\\\":true,\\\"default\\\":false},\\\"pauseReason\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"importedCount\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"failures\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"lastSuccessfulAt\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"CatalogSyncState\\\",\\\"collectionExportName\\\":\\\"CatalogSyncStateCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"providerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"complete\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"boolean\\\"},{\\\"field\\\":\\\"paused\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"boolean\\\"},{\\\"field\\\":\\\"importedCount\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"catalog_sync_states\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"catalog_sync_states\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"provider_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"cursor\\\\\\\" TEXT,\\\\n \\\\\\\"run_id\\\\\\\" TEXT,\\\\n \\\\\\\"complete\\\\\\\" BOOLEAN NOT NULL DEFAULT FALSE,\\\\n \\\\\\\"paused\\\\\\\" BOOLEAN NOT NULL DEFAULT FALSE,\\\\n \\\\\\\"pause_reason\\\\\\\" TEXT,\\\\n \\\\\\\"imported_count\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"failures\\\\\\\" TEXT,\\\\n \\\\\\\"last_successful_at\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"provider_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"cursor\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"run_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"complete\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":false},\\\"paused\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":false},\\\"pause_reason\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"imported_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"failures\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"last_successful_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"catalog_sync_states_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"catalog_sync_states_created_at_idx\\\",\\\"columns\\\":[\\\"created_at\\\"]}],\\\"version\\\":\\\"52dc3ee1\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CatalogSelection\\\":{\\\"name\\\":\\\"catalogselection\\\",\\\"className\\\":\\\"CatalogSelection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CatalogSelection\\\",\\\"collection\\\":\\\"catalogselections\\\",\\\"description\\\":\\\"Tenant-owned intent to use a metadata record, distinct from acquiring bytes.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"resourceId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"CatalogResource\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"selectedByUserId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"selectedRevision\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}}},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"CatalogSelection\\\",\\\"collectionExportName\\\":\\\"CatalogSelectionCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"resourceId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"selectedByUserId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"selectedRevision\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"catalog_selections\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"catalog_selections\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"resource_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"selected_by_user_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"selected_revision\\\\\\\" TEXT NOT NULL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"resource_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"catalog_resources\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"selected_by_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"selected_revision\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"catalog_selections_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"catalog_selections_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"catalog_selections_resource_id_idx\\\",\\\"columns\\\":[\\\"resource_id\\\"]}],\\\"version\\\":\\\"c6b02eb9\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CatalogAcquisition\\\":{\\\"name\\\":\\\"catalogacquisition\\\",\\\"className\\\":\\\"CatalogAcquisition\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CatalogAcquisition\\\",\\\"collection\\\":\\\"catalogacquisitions\\\",\\\"description\\\":\\\"A pinned, tenant-owned acquisition record. Bytes belong in a host storage service.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"resourceId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"CatalogResource\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"selectionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"CatalogSelection\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"revision\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"format\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"sha256\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"attribution\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"notices\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"CatalogAcquisition\\\",\\\"collectionExportName\\\":\\\"CatalogAcquisitionCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"resourceId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"selectionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"revision\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"format\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"sha256\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"catalog_acquisitions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"catalog_acquisitions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"resource_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"selection_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"revision\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"format\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"sha256\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"attribution\\\\\\\" TEXT,\\\\n \\\\\\\"notices\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"resource_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"catalog_resources\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"selection_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"catalog_selections\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"revision\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"format\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sha256\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"attribution\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"notices\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"catalog_acquisitions_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"catalog_acquisitions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"catalog_acquisitions_resource_id_idx\\\",\\\"columns\\\":[\\\"resource_id\\\"]},{\\\"name\\\":\\\"catalog_acquisitions_selection_id_idx\\\",\\\"columns\\\":[\\\"selection_id\\\"]}],\\\"version\\\":\\\"ee9c5add\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:Course\\\":{\\\"name\\\":\\\"course\\\",\\\"className\\\":\\\"Course\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:Course\\\",\\\"collection\\\":\\\"courses\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true,\\\"mode\\\":\\\"optional\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"summary\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"description\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sourceKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sourceUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sourceRef\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"license\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"licenseKind\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"own-work\\\",\\\"enum\\\":[\\\"own-work\\\",\\\"open-license\\\",\\\"personal-use-copy\\\",\\\"licensed-for-sharing\\\"]},\\\"licenseNote\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"attestedBy\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"subject\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"tags\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"levelMin\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"levelMax\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"decimal\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"estimatedMinutes\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"online\\\",\\\"enum\\\":[\\\"online\\\",\\\"printable\\\",\\\"kit\\\",\\\"video\\\",\\\"game\\\",\\\"mixed\\\"]},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"draft\\\",\\\"enum\\\":[\\\"draft\\\",\\\"published\\\",\\\"archived\\\"]}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableStrategy\\\":\\\"sti\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"optional\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"Course\\\",\\\"collectionExportName\\\":\\\"CourseCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"title\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"levelMin\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"levelMax\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"difficulty\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"decimal\\\"},{\\\"field\\\":\\\"estimatedMinutes\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"courses\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"courses\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"summary\\\\\\\" TEXT,\\\\n \\\\\\\"description\\\\\\\" TEXT,\\\\n \\\\\\\"source_key\\\\\\\" TEXT,\\\\n \\\\\\\"source_url\\\\\\\" TEXT,\\\\n \\\\\\\"source_ref\\\\\\\" TEXT,\\\\n \\\\\\\"license\\\\\\\" TEXT,\\\\n \\\\\\\"license_kind\\\\\\\" TEXT DEFAULT 'own-work',\\\\n \\\\\\\"license_note\\\\\\\" TEXT,\\\\n \\\\\\\"attested_by\\\\\\\" TEXT,\\\\n \\\\\\\"subject\\\\\\\" TEXT,\\\\n \\\\\\\"tags\\\\\\\" TEXT,\\\\n \\\\\\\"level_min\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"level_max\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'draft'\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"summary\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"license\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"license_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"own-work\\\"},\\\"license_note\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"attested_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"subject\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"tags\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"level_min\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"level_max\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"draft\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"courses_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"courses_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"courses_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"88cc23ab\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:ExternalCourse\\\":{\\\"name\\\":\\\"externalcourse\\\",\\\"className\\\":\\\"ExternalCourse\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:ExternalCourse\\\",\\\"collection\\\":\\\"courses\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true}}},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"summary\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"description\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sourceKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sourceUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sourceRef\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"license\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"licenseKind\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"own-work\\\",\\\"enum\\\":[\\\"own-work\\\",\\\"open-license\\\",\\\"personal-use-copy\\\",\\\"licensed-for-sharing\\\"]},\\\"licenseNote\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"attestedBy\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"subject\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"tags\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"levelMin\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"levelMax\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"decimal\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"estimatedMinutes\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"online\\\",\\\"enum\\\":[\\\"online\\\",\\\"printable\\\",\\\"kit\\\",\\\"video\\\",\\\"game\\\",\\\"mixed\\\"]},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"draft\\\",\\\"enum\\\":[\\\"draft\\\",\\\"published\\\",\\\"archived\\\"]}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"courses\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tableStrategy\\\":\\\"sti\\\"},\\\"extends\\\":\\\"Course\\\",\\\"exportName\\\":\\\"ExternalCourse\\\",\\\"collectionExportName\\\":\\\"ExternalCourseCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"title\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"levelMin\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"levelMax\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"difficulty\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"decimal\\\"},{\\\"field\\\":\\\"estimatedMinutes\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"courses\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"courses\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"summary\\\\\\\" TEXT,\\\\n \\\\\\\"description\\\\\\\" TEXT,\\\\n \\\\\\\"source_key\\\\\\\" TEXT,\\\\n \\\\\\\"source_url\\\\\\\" TEXT,\\\\n \\\\\\\"source_ref\\\\\\\" TEXT,\\\\n \\\\\\\"license\\\\\\\" TEXT,\\\\n \\\\\\\"license_kind\\\\\\\" TEXT DEFAULT 'own-work',\\\\n \\\\\\\"license_note\\\\\\\" TEXT,\\\\n \\\\\\\"attested_by\\\\\\\" TEXT,\\\\n \\\\\\\"subject\\\\\\\" TEXT,\\\\n \\\\\\\"tags\\\\\\\" TEXT,\\\\n \\\\\\\"level_min\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"level_max\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'draft'\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"summary\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"license\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"license_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"own-work\\\"},\\\"license_note\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"attested_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"subject\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"tags\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"level_min\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"level_max\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"draft\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"courses_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"courses_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"courses_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"88cc23ab\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:AuthoredCourse\\\":{\\\"name\\\":\\\"authoredcourse\\\",\\\"className\\\":\\\"AuthoredCourse\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:AuthoredCourse\\\",\\\"collection\\\":\\\"courses\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true}}},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"summary\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"description\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sourceKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sourceUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sourceRef\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"license\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"licenseKind\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"own-work\\\",\\\"enum\\\":[\\\"own-work\\\",\\\"open-license\\\",\\\"personal-use-copy\\\",\\\"licensed-for-sharing\\\"]},\\\"licenseNote\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"attestedBy\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"subject\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"tags\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"levelMin\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"levelMax\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"decimal\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"estimatedMinutes\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"online\\\",\\\"enum\\\":[\\\"online\\\",\\\"printable\\\",\\\"kit\\\",\\\"video\\\",\\\"game\\\",\\\"mixed\\\"]},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"draft\\\",\\\"enum\\\":[\\\"draft\\\",\\\"published\\\",\\\"archived\\\"]}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"courses\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tableStrategy\\\":\\\"sti\\\"},\\\"extends\\\":\\\"Course\\\",\\\"exportName\\\":\\\"AuthoredCourse\\\",\\\"collectionExportName\\\":\\\"AuthoredCourseCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"title\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"levelMin\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"levelMax\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"difficulty\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"decimal\\\"},{\\\"field\\\":\\\"estimatedMinutes\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"courses\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"courses\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"summary\\\\\\\" TEXT,\\\\n \\\\\\\"description\\\\\\\" TEXT,\\\\n \\\\\\\"source_key\\\\\\\" TEXT,\\\\n \\\\\\\"source_url\\\\\\\" TEXT,\\\\n \\\\\\\"source_ref\\\\\\\" TEXT,\\\\n \\\\\\\"license\\\\\\\" TEXT,\\\\n \\\\\\\"license_kind\\\\\\\" TEXT DEFAULT 'own-work',\\\\n \\\\\\\"license_note\\\\\\\" TEXT,\\\\n \\\\\\\"attested_by\\\\\\\" TEXT,\\\\n \\\\\\\"subject\\\\\\\" TEXT,\\\\n \\\\\\\"tags\\\\\\\" TEXT,\\\\n \\\\\\\"level_min\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"level_max\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'draft'\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"summary\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"license\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"license_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"own-work\\\"},\\\"license_note\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"attested_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"subject\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"tags\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"level_min\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"level_max\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"draft\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"courses_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"courses_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"courses_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"88cc23ab\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CourseSection\\\":{\\\"name\\\":\\\"coursesection\\\",\\\"className\\\":\\\"CourseSection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CourseSection\\\",\\\"collection\\\":\\\"coursesections\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true,\\\"mode\\\":\\\"optional\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"courseId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Course\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"optional\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"CourseSection\\\",\\\"collectionExportName\\\":\\\"CourseSectionCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"courseId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"title\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"sortOrder\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"course_sections\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"course_sections\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"course_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"title\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER NOT NULL DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"course_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"courses\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"course_sections_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"course_sections_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"course_sections_course_id_idx\\\",\\\"columns\\\":[\\\"course_id\\\"]}],\\\"version\\\":\\\"e20480d7\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:Lesson\\\":{\\\"name\\\":\\\"lesson\\\",\\\"className\\\":\\\"Lesson\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:Lesson\\\",\\\"collection\\\":\\\"lessons\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true,\\\"mode\\\":\\\"optional\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"sectionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"CourseSection\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"body\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"estimatedMinutes\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"decimal\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"online\\\",\\\"enum\\\":[\\\"online\\\",\\\"printable\\\",\\\"kit\\\",\\\"video\\\",\\\"game\\\",\\\"mixed\\\"]},\\\"completionRule\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"attest\\\",\\\"enum\\\":[\\\"attest\\\",\\\"submit\\\",\\\"score\\\",\\\"external\\\"]},\\\"externalRef\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"externalUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableStrategy\\\":\\\"sti\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"optional\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"Lesson\\\",\\\"collectionExportName\\\":\\\"LessonCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"sectionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"title\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"sortOrder\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"estimatedMinutes\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"difficulty\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"decimal\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lessons\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"section_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"body\\\\\\\" TEXT,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"completion_rule\\\\\\\" TEXT DEFAULT 'attest',\\\\n \\\\\\\"external_ref\\\\\\\" TEXT,\\\\n \\\\\\\"external_url\\\\\\\" TEXT,\\\\n \\\\\\\"video_url\\\\\\\" TEXT,\\\\n \\\\\\\"printable_url\\\\\\\" TEXT,\\\\n \\\\\\\"answer_url\\\\\\\" TEXT,\\\\n \\\\\\\"pages\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"section_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"course_sections\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"completion_rule\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"attest\\\"},\\\"external_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"external_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"video_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"printable_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"answer_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"pages\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"lessons_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"lessons_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"lessons_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lessons_section_id_idx\\\",\\\"columns\\\":[\\\"section_id\\\"]}],\\\"version\\\":\\\"092df043\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:Reading\\\":{\\\"name\\\":\\\"reading\\\",\\\"className\\\":\\\"Reading\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:Reading\\\",\\\"collection\\\":\\\"lessons\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true}}},\\\"sectionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"CourseSection\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"body\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"estimatedMinutes\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"decimal\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"online\\\",\\\"enum\\\":[\\\"online\\\",\\\"printable\\\",\\\"kit\\\",\\\"video\\\",\\\"game\\\",\\\"mixed\\\"]},\\\"completionRule\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"attest\\\",\\\"enum\\\":[\\\"attest\\\",\\\"submit\\\",\\\"score\\\",\\\"external\\\"]},\\\"externalRef\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"externalUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tableStrategy\\\":\\\"sti\\\"},\\\"extends\\\":\\\"Lesson\\\",\\\"exportName\\\":\\\"Reading\\\",\\\"collectionExportName\\\":\\\"ReadingCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"sectionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"title\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"sortOrder\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"estimatedMinutes\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"difficulty\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"decimal\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lessons\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"section_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"body\\\\\\\" TEXT,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"completion_rule\\\\\\\" TEXT DEFAULT 'attest',\\\\n \\\\\\\"external_ref\\\\\\\" TEXT,\\\\n \\\\\\\"external_url\\\\\\\" TEXT,\\\\n \\\\\\\"video_url\\\\\\\" TEXT,\\\\n \\\\\\\"printable_url\\\\\\\" TEXT,\\\\n \\\\\\\"answer_url\\\\\\\" TEXT,\\\\n \\\\\\\"pages\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"section_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"course_sections\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"completion_rule\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"attest\\\"},\\\"external_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"external_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"video_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"printable_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"answer_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"pages\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"lessons_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"lessons_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"lessons_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lessons_section_id_idx\\\",\\\"columns\\\":[\\\"section_id\\\"]}],\\\"version\\\":\\\"9d8b6fcd\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:Video\\\":{\\\"name\\\":\\\"video\\\",\\\"className\\\":\\\"Video\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:Video\\\",\\\"collection\\\":\\\"lessons\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true}}},\\\"sectionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"CourseSection\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"body\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"estimatedMinutes\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"decimal\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"online\\\",\\\"enum\\\":[\\\"online\\\",\\\"printable\\\",\\\"kit\\\",\\\"video\\\",\\\"game\\\",\\\"mixed\\\"]},\\\"completionRule\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"attest\\\",\\\"enum\\\":[\\\"attest\\\",\\\"submit\\\",\\\"score\\\",\\\"external\\\"]},\\\"externalRef\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"externalUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"videoUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tableStrategy\\\":\\\"sti\\\"},\\\"extends\\\":\\\"Lesson\\\",\\\"exportName\\\":\\\"Video\\\",\\\"collectionExportName\\\":\\\"VideoCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"sectionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"title\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"sortOrder\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"estimatedMinutes\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"difficulty\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"decimal\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lessons\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"section_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"body\\\\\\\" TEXT,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"completion_rule\\\\\\\" TEXT DEFAULT 'attest',\\\\n \\\\\\\"external_ref\\\\\\\" TEXT,\\\\n \\\\\\\"external_url\\\\\\\" TEXT,\\\\n \\\\\\\"video_url\\\\\\\" TEXT,\\\\n \\\\\\\"printable_url\\\\\\\" TEXT,\\\\n \\\\\\\"answer_url\\\\\\\" TEXT,\\\\n \\\\\\\"pages\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"section_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"course_sections\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"completion_rule\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"attest\\\"},\\\"external_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"external_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"video_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"printable_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"answer_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"pages\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"lessons_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"lessons_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"lessons_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lessons_section_id_idx\\\",\\\"columns\\\":[\\\"section_id\\\"]}],\\\"version\\\":\\\"9e0ef984\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:Worksheet\\\":{\\\"name\\\":\\\"worksheet\\\",\\\"className\\\":\\\"Worksheet\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:Worksheet\\\",\\\"collection\\\":\\\"lessons\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true}}},\\\"sectionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"CourseSection\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"body\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"estimatedMinutes\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"decimal\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"online\\\",\\\"enum\\\":[\\\"online\\\",\\\"printable\\\",\\\"kit\\\",\\\"video\\\",\\\"game\\\",\\\"mixed\\\"]},\\\"completionRule\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"submit\\\",\\\"enum\\\":[\\\"attest\\\",\\\"submit\\\",\\\"score\\\",\\\"external\\\"]},\\\"externalRef\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"externalUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"printableUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"answerUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"pages\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tableStrategy\\\":\\\"sti\\\"},\\\"extends\\\":\\\"Lesson\\\",\\\"exportName\\\":\\\"Worksheet\\\",\\\"collectionExportName\\\":\\\"WorksheetCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"sectionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"title\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"sortOrder\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"estimatedMinutes\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"difficulty\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"decimal\\\"},{\\\"field\\\":\\\"pages\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lessons\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"section_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"body\\\\\\\" TEXT,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"completion_rule\\\\\\\" TEXT DEFAULT 'attest',\\\\n \\\\\\\"external_ref\\\\\\\" TEXT,\\\\n \\\\\\\"external_url\\\\\\\" TEXT,\\\\n \\\\\\\"video_url\\\\\\\" TEXT,\\\\n \\\\\\\"printable_url\\\\\\\" TEXT,\\\\n \\\\\\\"answer_url\\\\\\\" TEXT,\\\\n \\\\\\\"pages\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"section_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"course_sections\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"completion_rule\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"attest\\\"},\\\"external_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"external_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"video_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"printable_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"answer_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"pages\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"lessons_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"lessons_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"lessons_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lessons_section_id_idx\\\",\\\"columns\\\":[\\\"section_id\\\"]}],\\\"version\\\":\\\"10976938\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:Exercise\\\":{\\\"name\\\":\\\"exercise\\\",\\\"className\\\":\\\"Exercise\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:Exercise\\\",\\\"collection\\\":\\\"lessons\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/catalog.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true}}},\\\"sectionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"CourseSection\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"body\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"estimatedMinutes\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"decimal\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"online\\\",\\\"enum\\\":[\\\"online\\\",\\\"printable\\\",\\\"kit\\\",\\\"video\\\",\\\"game\\\",\\\"mixed\\\"]},\\\"completionRule\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"attest\\\",\\\"enum\\\":[\\\"attest\\\",\\\"submit\\\",\\\"score\\\",\\\"external\\\"]},\\\"externalRef\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"externalUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tableStrategy\\\":\\\"sti\\\"},\\\"extends\\\":\\\"Lesson\\\",\\\"exportName\\\":\\\"Exercise\\\",\\\"collectionExportName\\\":\\\"ExerciseCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"sectionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"title\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"sortOrder\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"estimatedMinutes\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"difficulty\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"decimal\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lessons\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"section_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"body\\\\\\\" TEXT,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"completion_rule\\\\\\\" TEXT DEFAULT 'attest',\\\\n \\\\\\\"external_ref\\\\\\\" TEXT,\\\\n \\\\\\\"external_url\\\\\\\" TEXT,\\\\n \\\\\\\"video_url\\\\\\\" TEXT,\\\\n \\\\\\\"printable_url\\\\\\\" TEXT,\\\\n \\\\\\\"answer_url\\\\\\\" TEXT,\\\\n \\\\\\\"pages\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"section_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"course_sections\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"completion_rule\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"attest\\\"},\\\"external_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"external_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"video_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"printable_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"answer_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"pages\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"lessons_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"lessons_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"lessons_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lessons_section_id_idx\\\",\\\"columns\\\":[\\\"section_id\\\"]}],\\\"version\\\":\\\"145eadbe\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CourseCollection\\\":{\\\"name\\\":\\\"coursecollection\\\",\\\"className\\\":\\\"CourseCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CourseCollection\\\",\\\"collection\\\":\\\"courses\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Course\\\",\\\"exportName\\\":\\\"CourseCollection\\\",\\\"collectionExportName\\\":\\\"CourseCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"courses\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"courses\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"summary\\\\\\\" TEXT,\\\\n \\\\\\\"description\\\\\\\" TEXT,\\\\n \\\\\\\"source_key\\\\\\\" TEXT,\\\\n \\\\\\\"source_url\\\\\\\" TEXT,\\\\n \\\\\\\"source_ref\\\\\\\" TEXT,\\\\n \\\\\\\"license\\\\\\\" TEXT,\\\\n \\\\\\\"license_kind\\\\\\\" TEXT DEFAULT 'own-work',\\\\n \\\\\\\"license_note\\\\\\\" TEXT,\\\\n \\\\\\\"attested_by\\\\\\\" TEXT,\\\\n \\\\\\\"subject\\\\\\\" TEXT,\\\\n \\\\\\\"tags\\\\\\\" TEXT,\\\\n \\\\\\\"level_min\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"level_max\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'draft'\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"summary\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"license\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"license_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"own-work\\\"},\\\"license_note\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"attested_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"subject\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"tags\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"level_min\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"level_max\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"draft\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"courses_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"courses_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"courses_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"88cc23ab\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:ExternalCourseCollection\\\":{\\\"name\\\":\\\"externalcoursecollection\\\",\\\"className\\\":\\\"ExternalCourseCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:ExternalCourseCollection\\\",\\\"collection\\\":\\\"courses\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"courses\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"ExternalCourse\\\",\\\"exportName\\\":\\\"ExternalCourseCollection\\\",\\\"collectionExportName\\\":\\\"ExternalCourseCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"courses\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"courses\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"summary\\\\\\\" TEXT,\\\\n \\\\\\\"description\\\\\\\" TEXT,\\\\n \\\\\\\"source_key\\\\\\\" TEXT,\\\\n \\\\\\\"source_url\\\\\\\" TEXT,\\\\n \\\\\\\"source_ref\\\\\\\" TEXT,\\\\n \\\\\\\"license\\\\\\\" TEXT,\\\\n \\\\\\\"license_kind\\\\\\\" TEXT DEFAULT 'own-work',\\\\n \\\\\\\"license_note\\\\\\\" TEXT,\\\\n \\\\\\\"attested_by\\\\\\\" TEXT,\\\\n \\\\\\\"subject\\\\\\\" TEXT,\\\\n \\\\\\\"tags\\\\\\\" TEXT,\\\\n \\\\\\\"level_min\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"level_max\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'draft'\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"summary\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"license\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"license_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"own-work\\\"},\\\"license_note\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"attested_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"subject\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"tags\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"level_min\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"level_max\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"draft\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"courses_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"courses_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"courses_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"88cc23ab\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:AuthoredCourseCollection\\\":{\\\"name\\\":\\\"authoredcoursecollection\\\",\\\"className\\\":\\\"AuthoredCourseCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:AuthoredCourseCollection\\\",\\\"collection\\\":\\\"courses\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"courses\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"AuthoredCourse\\\",\\\"exportName\\\":\\\"AuthoredCourseCollection\\\",\\\"collectionExportName\\\":\\\"AuthoredCourseCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"courses\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"courses\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"summary\\\\\\\" TEXT,\\\\n \\\\\\\"description\\\\\\\" TEXT,\\\\n \\\\\\\"source_key\\\\\\\" TEXT,\\\\n \\\\\\\"source_url\\\\\\\" TEXT,\\\\n \\\\\\\"source_ref\\\\\\\" TEXT,\\\\n \\\\\\\"license\\\\\\\" TEXT,\\\\n \\\\\\\"license_kind\\\\\\\" TEXT DEFAULT 'own-work',\\\\n \\\\\\\"license_note\\\\\\\" TEXT,\\\\n \\\\\\\"attested_by\\\\\\\" TEXT,\\\\n \\\\\\\"subject\\\\\\\" TEXT,\\\\n \\\\\\\"tags\\\\\\\" TEXT,\\\\n \\\\\\\"level_min\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"level_max\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'draft'\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"summary\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"description\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"source_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"license\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"license_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"own-work\\\"},\\\"license_note\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"attested_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"subject\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"tags\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"level_min\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"level_max\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"draft\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"courses_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"courses_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"courses_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"88cc23ab\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CourseSectionCollection\\\":{\\\"name\\\":\\\"coursesectioncollection\\\",\\\"className\\\":\\\"CourseSectionCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CourseSectionCollection\\\",\\\"collection\\\":\\\"coursesections\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"CourseSection\\\",\\\"exportName\\\":\\\"CourseSectionCollection\\\",\\\"collectionExportName\\\":\\\"CourseSectionCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"course_sections\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"course_sections\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"course_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"title\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER NOT NULL DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"course_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"courses\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"course_sections_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"course_sections_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"course_sections_course_id_idx\\\",\\\"columns\\\":[\\\"course_id\\\"]}],\\\"version\\\":\\\"e20480d7\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:LessonCollection\\\":{\\\"name\\\":\\\"lessoncollection\\\",\\\"className\\\":\\\"LessonCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:LessonCollection\\\",\\\"collection\\\":\\\"lessons\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Lesson\\\",\\\"exportName\\\":\\\"LessonCollection\\\",\\\"collectionExportName\\\":\\\"LessonCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lessons\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"section_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"body\\\\\\\" TEXT,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"completion_rule\\\\\\\" TEXT DEFAULT 'attest',\\\\n \\\\\\\"external_ref\\\\\\\" TEXT,\\\\n \\\\\\\"external_url\\\\\\\" TEXT,\\\\n \\\\\\\"video_url\\\\\\\" TEXT,\\\\n \\\\\\\"printable_url\\\\\\\" TEXT,\\\\n \\\\\\\"answer_url\\\\\\\" TEXT,\\\\n \\\\\\\"pages\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"section_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"course_sections\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"completion_rule\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"attest\\\"},\\\"external_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"external_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"video_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"printable_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"answer_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"pages\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"lessons_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"lessons_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"lessons_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lessons_section_id_idx\\\",\\\"columns\\\":[\\\"section_id\\\"]}],\\\"version\\\":\\\"092df043\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:ReadingCollection\\\":{\\\"name\\\":\\\"readingcollection\\\",\\\"className\\\":\\\"ReadingCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:ReadingCollection\\\",\\\"collection\\\":\\\"lessons\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Reading\\\",\\\"exportName\\\":\\\"ReadingCollection\\\",\\\"collectionExportName\\\":\\\"ReadingCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lessons\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"section_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"body\\\\\\\" TEXT,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"completion_rule\\\\\\\" TEXT DEFAULT 'attest',\\\\n \\\\\\\"external_ref\\\\\\\" TEXT,\\\\n \\\\\\\"external_url\\\\\\\" TEXT,\\\\n \\\\\\\"video_url\\\\\\\" TEXT,\\\\n \\\\\\\"printable_url\\\\\\\" TEXT,\\\\n \\\\\\\"answer_url\\\\\\\" TEXT,\\\\n \\\\\\\"pages\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"section_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"course_sections\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"completion_rule\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"attest\\\"},\\\"external_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"external_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"video_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"printable_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"answer_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"pages\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"lessons_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"lessons_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"lessons_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lessons_section_id_idx\\\",\\\"columns\\\":[\\\"section_id\\\"]}],\\\"version\\\":\\\"9d8b6fcd\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:VideoCollection\\\":{\\\"name\\\":\\\"videocollection\\\",\\\"className\\\":\\\"VideoCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:VideoCollection\\\",\\\"collection\\\":\\\"lessons\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Video\\\",\\\"exportName\\\":\\\"VideoCollection\\\",\\\"collectionExportName\\\":\\\"VideoCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lessons\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"section_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"body\\\\\\\" TEXT,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"completion_rule\\\\\\\" TEXT DEFAULT 'attest',\\\\n \\\\\\\"external_ref\\\\\\\" TEXT,\\\\n \\\\\\\"external_url\\\\\\\" TEXT,\\\\n \\\\\\\"video_url\\\\\\\" TEXT,\\\\n \\\\\\\"printable_url\\\\\\\" TEXT,\\\\n \\\\\\\"answer_url\\\\\\\" TEXT,\\\\n \\\\\\\"pages\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"section_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"course_sections\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"completion_rule\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"attest\\\"},\\\"external_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"external_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"video_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"printable_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"answer_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"pages\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"lessons_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"lessons_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"lessons_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lessons_section_id_idx\\\",\\\"columns\\\":[\\\"section_id\\\"]}],\\\"version\\\":\\\"9e0ef984\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorksheetCollection\\\":{\\\"name\\\":\\\"worksheetcollection\\\",\\\"className\\\":\\\"WorksheetCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorksheetCollection\\\",\\\"collection\\\":\\\"lessons\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Worksheet\\\",\\\"exportName\\\":\\\"WorksheetCollection\\\",\\\"collectionExportName\\\":\\\"WorksheetCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lessons\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"section_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"body\\\\\\\" TEXT,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"completion_rule\\\\\\\" TEXT DEFAULT 'attest',\\\\n \\\\\\\"external_ref\\\\\\\" TEXT,\\\\n \\\\\\\"external_url\\\\\\\" TEXT,\\\\n \\\\\\\"video_url\\\\\\\" TEXT,\\\\n \\\\\\\"printable_url\\\\\\\" TEXT,\\\\n \\\\\\\"answer_url\\\\\\\" TEXT,\\\\n \\\\\\\"pages\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"section_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"course_sections\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"completion_rule\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"attest\\\"},\\\"external_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"external_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"video_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"printable_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"answer_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"pages\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"lessons_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"lessons_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"lessons_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lessons_section_id_idx\\\",\\\"columns\\\":[\\\"section_id\\\"]}],\\\"version\\\":\\\"10976938\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:ExerciseCollection\\\":{\\\"name\\\":\\\"exercisecollection\\\",\\\"className\\\":\\\"ExerciseCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:ExerciseCollection\\\",\\\"collection\\\":\\\"lessons\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Exercise\\\",\\\"exportName\\\":\\\"ExerciseCollection\\\",\\\"collectionExportName\\\":\\\"ExerciseCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"lessons\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lessons\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"section_id\\\\\\\" UUID,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"body\\\\\\\" TEXT,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"estimated_minutes\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"difficulty\\\\\\\" REAL DEFAULT 0,\\\\n \\\\\\\"modality\\\\\\\" TEXT DEFAULT 'online',\\\\n \\\\\\\"completion_rule\\\\\\\" TEXT DEFAULT 'attest',\\\\n \\\\\\\"external_ref\\\\\\\" TEXT,\\\\n \\\\\\\"external_url\\\\\\\" TEXT,\\\\n \\\\\\\"video_url\\\\\\\" TEXT,\\\\n \\\\\\\"printable_url\\\\\\\" TEXT,\\\\n \\\\\\\"answer_url\\\\\\\" TEXT,\\\\n \\\\\\\"pages\\\\\\\" INTEGER DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"section_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"course_sections\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"body\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"estimated_minutes\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"difficulty\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"modality\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"online\\\"},\\\"completion_rule\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"attest\\\"},\\\"external_ref\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"external_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"video_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"printable_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"answer_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"pages\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"lessons_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"lessons_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"lessons_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lessons_section_id_idx\\\",\\\"columns\\\":[\\\"section_id\\\"]}],\\\"version\\\":\\\"145eadbe\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:LessonAssetCollection\\\":{\\\"name\\\":\\\"lessonassetcollection\\\",\\\"className\\\":\\\"LessonAssetCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:LessonAssetCollection\\\",\\\"collection\\\":\\\"lessonassets\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"byRight\\\":{\\\"name\\\":\\\"byRight\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"rightId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"opts\\\",\\\"type\\\":\\\"JunctionFilterOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<TItem[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"byLeft\\\":{\\\"name\\\":\\\"byLeft\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"leftId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"opts\\\",\\\"type\\\":\\\"JunctionFilterOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<TItem[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"attach\\\":{\\\"name\\\":\\\"attach\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"leftId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"rightId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"opts\\\",\\\"type\\\":\\\"JunctionAttachOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<TItem>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"detach\\\":{\\\"name\\\":\\\"detach\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"leftId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"rightId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"opts\\\",\\\"type\\\":\\\"JunctionFilterOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setLinks\\\":{\\\"name\\\":\\\"setLinks\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"leftId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"rightIds\\\",\\\"type\\\":\\\"string[]\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"opts\\\",\\\"type\\\":\\\"JunctionAttachOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"lesson_assets\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtJunction\\\",\\\"extendsTypeArg\\\":\\\"LessonAsset\\\",\\\"exportName\\\":\\\"LessonAssetCollection\\\",\\\"collectionExportName\\\":\\\"LessonAssetCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"lesson_assets\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lesson_assets\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"asset_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"relationship\\\\\\\" TEXT NOT NULL DEFAULT 'attachment',\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER NOT NULL DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"asset_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"relationship\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"attachment\\\"},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"lesson_assets_tenant_id_lesson_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"lesson_id\\\",\\\"asset_id\\\",\\\"relationship\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"lesson_assets_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"lesson_assets_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lesson_assets_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]},{\\\"name\\\":\\\"lesson_assets_asset_id_idx\\\",\\\"columns\\\":[\\\"asset_id\\\"]}],\\\"version\\\":\\\"d96385c6\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:LearnerCollection\\\":{\\\"name\\\":\\\"learnercollection\\\",\\\"className\\\":\\\"LearnerCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:LearnerCollection\\\",\\\"collection\\\":\\\"learners\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Learner\\\",\\\"exportName\\\":\\\"LearnerCollection\\\",\\\"collectionExportName\\\":\\\"LearnerCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"learners\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"learners\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"user_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"profile_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"display_name\\\\\\\" TEXT,\\\\n \\\\\\\"birth_date\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"level\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"settings\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"user_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"profile_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"display_name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"birth_date\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"level\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"settings\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"learners_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"learners_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"learners_user_id_idx\\\",\\\"columns\\\":[\\\"user_id\\\"]},{\\\"name\\\":\\\"learners_profile_id_idx\\\",\\\"columns\\\":[\\\"profile_id\\\"]}],\\\"version\\\":\\\"ca9907b5\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CurriculumCollection\\\":{\\\"name\\\":\\\"curriculumcollection\\\",\\\"className\\\":\\\"CurriculumCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CurriculumCollection\\\",\\\"collection\\\":\\\"curriculums\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"curricula\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Curriculum\\\",\\\"exportName\\\":\\\"CurriculumCollection\\\",\\\"collectionExportName\\\":\\\"CurriculumCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"curricula\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"curricula\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"title\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"starts_on\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"ends_on\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'planned'\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"starts_on\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"ends_on\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"planned\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"curricula_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"curricula_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"curricula_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]}],\\\"version\\\":\\\"b7e90cbd\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:EnrollmentCollection\\\":{\\\"name\\\":\\\"enrollmentcollection\\\",\\\"className\\\":\\\"EnrollmentCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:EnrollmentCollection\\\",\\\"collection\\\":\\\"enrollments\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Enrollment\\\",\\\"exportName\\\":\\\"EnrollmentCollection\\\",\\\"collectionExportName\\\":\\\"EnrollmentCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"enrollments\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"enrollments\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"curriculum_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"course_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'planned',\\\\n \\\\\\\"started_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"completed_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"target_minutes_per_week\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER NOT NULL DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"curriculum_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"curricula\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"course_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"courses\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"planned\\\"},\\\"started_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"completed_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"target_minutes_per_week\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"enrollments_tenant_id_curriculum_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"curriculum_id\\\",\\\"course_id\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"enrollments_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"enrollments_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"enrollments_curriculum_id_idx\\\",\\\"columns\\\":[\\\"curriculum_id\\\"]},{\\\"name\\\":\\\"enrollments_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"enrollments_course_id_idx\\\",\\\"columns\\\":[\\\"course_id\\\"]}],\\\"version\\\":\\\"2a34b5ee\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:LessonProgressCollection\\\":{\\\"name\\\":\\\"lessonprogresscollection\\\",\\\"className\\\":\\\"LessonProgressCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:LessonProgressCollection\\\",\\\"collection\\\":\\\"lessonprogresses\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"lesson_progress\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"LessonProgress\\\",\\\"exportName\\\":\\\"LessonProgressCollection\\\",\\\"collectionExportName\\\":\\\"LessonProgressCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"lesson_progress\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lesson_progress\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"enrollment_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'not_started',\\\\n \\\\\\\"started_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"completed_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"time_spent_seconds\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"attempts\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"best_score\\\\\\\" REAL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"enrollment_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"enrollments\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"not_started\\\"},\\\"started_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"completed_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"time_spent_seconds\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"attempts\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"best_score\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"lesson_progress_tenant_id_enrollment_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"enrollment_id\\\",\\\"lesson_id\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"lesson_progress_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"lesson_progress_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lesson_progress_enrollment_id_idx\\\",\\\"columns\\\":[\\\"enrollment_id\\\"]},{\\\"name\\\":\\\"lesson_progress_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"lesson_progress_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]}],\\\"version\\\":\\\"36704fbd\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:SubmissionCollection\\\":{\\\"name\\\":\\\"submissioncollection\\\",\\\"className\\\":\\\"SubmissionCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:SubmissionCollection\\\",\\\"collection\\\":\\\"submissions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Submission\\\",\\\"exportName\\\":\\\"SubmissionCollection\\\",\\\"collectionExportName\\\":\\\"SubmissionCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"submissions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"learner_id\\\\\\\" UUID,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID,\\\\n \\\\\\\"progress_id\\\\\\\" UUID,\\\\n \\\\\\\"submitted_at\\\\\\\" TEXT,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'captured',\\\\n \\\\\\\"notes\\\\\\\" TEXT,\\\\n \\\\\\\"capture_key\\\\\\\" TEXT,\\\\n \\\\\\\"capture_digest\\\\\\\" TEXT,\\\\n \\\\\\\"kind\\\\\\\" TEXT DEFAULT 'completed_work',\\\\n \\\\\\\"previous_submission_id\\\\\\\" UUID,\\\\n \\\\\\\"intake_item_id\\\\\\\" TEXT,\\\\n \\\\\\\"page_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"ocr_text\\\\\\\" TEXT,\\\\n \\\\\\\"extracted\\\\\\\" TEXT,\\\\n \\\\\\\"reported_by\\\\\\\" TEXT DEFAULT 'learner',\\\\n \\\\\\\"evidence_url\\\\\\\" TEXT,\\\\n \\\\\\\"reported_score\\\\\\\" REAL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"progress_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lesson_progress\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"submitted_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"captured\\\"},\\\"notes\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"completed_work\\\"},\\\"previous_submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"intake_item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"page_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"ocr_text\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"extracted\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"learner\\\"},\\\"evidence_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_score\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"submissions_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"submissions_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"submissions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"submissions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"submissions_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]},{\\\"name\\\":\\\"submissions_progress_id_idx\\\",\\\"columns\\\":[\\\"progress_id\\\"]},{\\\"name\\\":\\\"submissions_previous_submission_id_idx\\\",\\\"columns\\\":[\\\"previous_submission_id\\\"]}],\\\"version\\\":\\\"27a21ab4\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:SubmissionIntakeBindingCollection\\\":{\\\"name\\\":\\\"submissionintakebindingcollection\\\",\\\"className\\\":\\\"SubmissionIntakeBindingCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:SubmissionIntakeBindingCollection\\\",\\\"collection\\\":\\\"submissionintakebindings\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"submission_intake_bindings\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"SubmissionIntakeBinding\\\",\\\"exportName\\\":\\\"SubmissionIntakeBindingCollection\\\",\\\"collectionExportName\\\":\\\"SubmissionIntakeBindingCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"submission_intake_bindings\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"submission_intake_bindings\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"intake_item_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"submission_id\\\\\\\" UUID NOT NULL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"intake_item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}}},\\\"indexes\\\":[{\\\"name\\\":\\\"submission_intake_bindings_tenant_id_intake_item_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"intake_item_id\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"submission_intake_bindings_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"submission_intake_bindings_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"submission_intake_bindings_submission_id_idx\\\",\\\"columns\\\":[\\\"submission_id\\\"]}],\\\"version\\\":\\\"7102c909\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:ScannedSubmissionCollection\\\":{\\\"name\\\":\\\"scannedsubmissioncollection\\\",\\\"className\\\":\\\"ScannedSubmissionCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:ScannedSubmissionCollection\\\",\\\"collection\\\":\\\"submissions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"ScannedSubmission\\\",\\\"exportName\\\":\\\"ScannedSubmissionCollection\\\",\\\"collectionExportName\\\":\\\"ScannedSubmissionCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"submissions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"learner_id\\\\\\\" UUID,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID,\\\\n \\\\\\\"progress_id\\\\\\\" UUID,\\\\n \\\\\\\"submitted_at\\\\\\\" TEXT,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'captured',\\\\n \\\\\\\"notes\\\\\\\" TEXT,\\\\n \\\\\\\"capture_key\\\\\\\" TEXT,\\\\n \\\\\\\"capture_digest\\\\\\\" TEXT,\\\\n \\\\\\\"kind\\\\\\\" TEXT DEFAULT 'completed_work',\\\\n \\\\\\\"previous_submission_id\\\\\\\" UUID,\\\\n \\\\\\\"intake_item_id\\\\\\\" TEXT,\\\\n \\\\\\\"page_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"ocr_text\\\\\\\" TEXT,\\\\n \\\\\\\"extracted\\\\\\\" TEXT,\\\\n \\\\\\\"reported_by\\\\\\\" TEXT DEFAULT 'learner',\\\\n \\\\\\\"evidence_url\\\\\\\" TEXT,\\\\n \\\\\\\"reported_score\\\\\\\" REAL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"progress_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lesson_progress\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"submitted_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"captured\\\"},\\\"notes\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"completed_work\\\"},\\\"previous_submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"intake_item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"page_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"ocr_text\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"extracted\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"learner\\\"},\\\"evidence_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_score\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"submissions_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"submissions_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"submissions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"submissions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"submissions_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]},{\\\"name\\\":\\\"submissions_progress_id_idx\\\",\\\"columns\\\":[\\\"progress_id\\\"]},{\\\"name\\\":\\\"submissions_previous_submission_id_idx\\\",\\\"columns\\\":[\\\"previous_submission_id\\\"]}],\\\"version\\\":\\\"7c394510\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:ExternalCompletionCollection\\\":{\\\"name\\\":\\\"externalcompletioncollection\\\",\\\"className\\\":\\\"ExternalCompletionCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:ExternalCompletionCollection\\\",\\\"collection\\\":\\\"submissions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"ExternalCompletion\\\",\\\"exportName\\\":\\\"ExternalCompletionCollection\\\",\\\"collectionExportName\\\":\\\"ExternalCompletionCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"submissions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"learner_id\\\\\\\" UUID,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID,\\\\n \\\\\\\"progress_id\\\\\\\" UUID,\\\\n \\\\\\\"submitted_at\\\\\\\" TEXT,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'captured',\\\\n \\\\\\\"notes\\\\\\\" TEXT,\\\\n \\\\\\\"capture_key\\\\\\\" TEXT,\\\\n \\\\\\\"capture_digest\\\\\\\" TEXT,\\\\n \\\\\\\"kind\\\\\\\" TEXT DEFAULT 'completed_work',\\\\n \\\\\\\"previous_submission_id\\\\\\\" UUID,\\\\n \\\\\\\"intake_item_id\\\\\\\" TEXT,\\\\n \\\\\\\"page_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"ocr_text\\\\\\\" TEXT,\\\\n \\\\\\\"extracted\\\\\\\" TEXT,\\\\n \\\\\\\"reported_by\\\\\\\" TEXT DEFAULT 'learner',\\\\n \\\\\\\"evidence_url\\\\\\\" TEXT,\\\\n \\\\\\\"reported_score\\\\\\\" REAL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"progress_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lesson_progress\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"submitted_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"captured\\\"},\\\"notes\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"completed_work\\\"},\\\"previous_submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"intake_item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"page_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"ocr_text\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"extracted\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"learner\\\"},\\\"evidence_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_score\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"submissions_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"submissions_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"submissions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"submissions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"submissions_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]},{\\\"name\\\":\\\"submissions_progress_id_idx\\\",\\\"columns\\\":[\\\"progress_id\\\"]},{\\\"name\\\":\\\"submissions_previous_submission_id_idx\\\",\\\"columns\\\":[\\\"previous_submission_id\\\"]}],\\\"version\\\":\\\"eff3715d\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:AttestationCollection\\\":{\\\"name\\\":\\\"attestationcollection\\\",\\\"className\\\":\\\"AttestationCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:AttestationCollection\\\",\\\"collection\\\":\\\"submissions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Attestation\\\",\\\"exportName\\\":\\\"AttestationCollection\\\",\\\"collectionExportName\\\":\\\"AttestationCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"submissions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"learner_id\\\\\\\" UUID,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID,\\\\n \\\\\\\"progress_id\\\\\\\" UUID,\\\\n \\\\\\\"submitted_at\\\\\\\" TEXT,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'captured',\\\\n \\\\\\\"notes\\\\\\\" TEXT,\\\\n \\\\\\\"capture_key\\\\\\\" TEXT,\\\\n \\\\\\\"capture_digest\\\\\\\" TEXT,\\\\n \\\\\\\"kind\\\\\\\" TEXT DEFAULT 'completed_work',\\\\n \\\\\\\"previous_submission_id\\\\\\\" UUID,\\\\n \\\\\\\"intake_item_id\\\\\\\" TEXT,\\\\n \\\\\\\"page_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"ocr_text\\\\\\\" TEXT,\\\\n \\\\\\\"extracted\\\\\\\" TEXT,\\\\n \\\\\\\"reported_by\\\\\\\" TEXT DEFAULT 'learner',\\\\n \\\\\\\"evidence_url\\\\\\\" TEXT,\\\\n \\\\\\\"reported_score\\\\\\\" REAL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"progress_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lesson_progress\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"submitted_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"captured\\\"},\\\"notes\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"completed_work\\\"},\\\"previous_submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"intake_item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"page_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"ocr_text\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"extracted\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"learner\\\"},\\\"evidence_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_score\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"submissions_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"submissions_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"submissions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"submissions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"submissions_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]},{\\\"name\\\":\\\"submissions_progress_id_idx\\\",\\\"columns\\\":[\\\"progress_id\\\"]},{\\\"name\\\":\\\"submissions_previous_submission_id_idx\\\",\\\"columns\\\":[\\\"previous_submission_id\\\"]}],\\\"version\\\":\\\"4f3230a3\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:GradeCollection\\\":{\\\"name\\\":\\\"gradecollection\\\",\\\"className\\\":\\\"GradeCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:GradeCollection\\\",\\\"collection\\\":\\\"grades\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Grade\\\",\\\"exportName\\\":\\\"GradeCollection\\\",\\\"collectionExportName\\\":\\\"GradeCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"grades\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"grades\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"submission_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"grader_kind\\\\\\\" TEXT NOT NULL DEFAULT 'auto',\\\\n \\\\\\\"grader_profile_id\\\\\\\" UUID,\\\\n \\\\\\\"score\\\\\\\" REAL,\\\\n \\\\\\\"points_earned\\\\\\\" INTEGER,\\\\n \\\\\\\"points_possible\\\\\\\" INTEGER,\\\\n \\\\\\\"rubric_results\\\\\\\" TEXT,\\\\n \\\\\\\"feedback\\\\\\\" TEXT,\\\\n \\\\\\\"graded_at\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"grader_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"auto\\\"},\\\"grader_profile_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"score\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"points_earned\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"points_possible\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"rubric_results\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"feedback\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"graded_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"grades_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"grades_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"grades_submission_id_idx\\\",\\\"columns\\\":[\\\"submission_id\\\"]},{\\\"name\\\":\\\"grades_grader_profile_id_idx\\\",\\\"columns\\\":[\\\"grader_profile_id\\\"]}],\\\"version\\\":\\\"7d629fec\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:SubmissionAssetCollection\\\":{\\\"name\\\":\\\"submissionassetcollection\\\",\\\"className\\\":\\\"SubmissionAssetCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:SubmissionAssetCollection\\\",\\\"collection\\\":\\\"submissionassets\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/collections.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"byRight\\\":{\\\"name\\\":\\\"byRight\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"rightId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"opts\\\",\\\"type\\\":\\\"JunctionFilterOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<TItem[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"byLeft\\\":{\\\"name\\\":\\\"byLeft\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"leftId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"opts\\\",\\\"type\\\":\\\"JunctionFilterOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<TItem[]>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"attach\\\":{\\\"name\\\":\\\"attach\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"leftId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"rightId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"opts\\\",\\\"type\\\":\\\"JunctionAttachOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<TItem>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"detach\\\":{\\\"name\\\":\\\"detach\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"leftId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"rightId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"opts\\\",\\\"type\\\":\\\"JunctionFilterOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setLinks\\\":{\\\"name\\\":\\\"setLinks\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"leftId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"rightIds\\\",\\\"type\\\":\\\"string[]\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"opts\\\",\\\"type\\\":\\\"JunctionAttachOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"submission_assets\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtJunction\\\",\\\"extendsTypeArg\\\":\\\"SubmissionAsset\\\",\\\"exportName\\\":\\\"SubmissionAssetCollection\\\",\\\"collectionExportName\\\":\\\"SubmissionAssetCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"submission_assets\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"submission_assets\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"submission_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"asset_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"relationship\\\\\\\" TEXT NOT NULL DEFAULT 'page',\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER NOT NULL DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"asset_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"relationship\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"page\\\"},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"submission_assets_tenant_id_submission_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"submission_id\\\",\\\"asset_id\\\",\\\"relationship\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"submission_assets_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"submission_assets_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"submission_assets_submission_id_idx\\\",\\\"columns\\\":[\\\"submission_id\\\"]},{\\\"name\\\":\\\"submission_assets_asset_id_idx\\\",\\\"columns\\\":[\\\"asset_id\\\"]}],\\\"version\\\":\\\"d9b61c8a\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CourseSource\\\":{\\\"name\\\":\\\"coursesource\\\",\\\"className\\\":\\\"CourseSource\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CourseSource\\\",\\\"collection\\\":\\\"coursesources\\\",\\\"description\\\":\\\"Host-managed source policy; deliberately has no generated CRUD surface.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/course-source.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"key\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"name\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"kind\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"adapter\\\",\\\"enum\\\":[\\\"manual\\\",\\\"url\\\",\\\"adapter\\\"]},\\\"adapterKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"config\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sharing\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"private\\\",\\\"enum\\\":[\\\"private\\\",\\\"group\\\",\\\"global\\\"]}},\\\"methods\\\":{\\\"getConfig\\\":{\\\"name\\\":\\\"getConfig\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"CourseSourceConfig\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setConfig\\\":{\\\"name\\\":\\\"setConfig\\\",\\\"async\\\":false,\\\"parameters\\\":[{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"CourseSourceConfig\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"cli\\\":false,\\\"mcp\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"CourseSource\\\",\\\"collectionExportName\\\":\\\"CourseSourceCollection\\\",\\\"displayLabelField\\\":\\\"name\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"key\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"name\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"course_sources\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"course_sources\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"key\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"name\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"kind\\\\\\\" TEXT DEFAULT 'adapter',\\\\n \\\\\\\"adapter_key\\\\\\\" TEXT,\\\\n \\\\\\\"config\\\\\\\" TEXT,\\\\n \\\\\\\"sharing\\\\\\\" TEXT DEFAULT 'private'\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"adapter\\\"},\\\"adapter_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"config\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"sharing\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"private\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"course_sources_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"course_sources_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"98177eb3\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:CourseSourceCollection\\\":{\\\"name\\\":\\\"coursesourcecollection\\\",\\\"className\\\":\\\"CourseSourceCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:CourseSourceCollection\\\",\\\"collection\\\":\\\"coursesources\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/course-source.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"CourseSource\\\",\\\"exportName\\\":\\\"CourseSourceCollection\\\",\\\"collectionExportName\\\":\\\"CourseSourceCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"course_sources\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"course_sources\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"key\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"name\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"kind\\\\\\\" TEXT DEFAULT 'adapter',\\\\n \\\\\\\"adapter_key\\\\\\\" TEXT,\\\\n \\\\\\\"config\\\\\\\" TEXT,\\\\n \\\\\\\"sharing\\\\\\\" TEXT DEFAULT 'private'\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"adapter\\\"},\\\"adapter_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"config\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"sharing\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"private\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"course_sources_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"course_sources_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"98177eb3\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:FamilyIntake\\\":{\\\"name\\\":\\\"familyintake\\\",\\\"className\\\":\\\"FamilyIntake\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:FamilyIntake\\\",\\\"collection\\\":\\\"familyintakes\\\",\\\"description\\\":\\\"Family-owned receipt, independent of learner attribution and ingestion expiry.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/family-intake-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"itemId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"actorUserId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"ownerProfileId\\\":{\\\"type\\\":\\\"crossPackageRef\\\",\\\"required\\\":false,\\\"related\\\":\\\"@happyvertical/smrt-profiles:Profile\\\"},\\\"contentDigest\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sourceJson\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"family_intakes\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"item_id\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"FamilyIntake\\\",\\\"collectionExportName\\\":\\\"FamilyIntakeCollection\\\",\\\"validationRules\\\":[],\\\"schema\\\":{\\\"tableName\\\":\\\"family_intakes\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"family_intakes\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"item_id\\\\\\\" TEXT,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"owner_profile_id\\\\\\\" UUID,\\\\n \\\\\\\"content_digest\\\\\\\" TEXT,\\\\n \\\\\\\"source_json\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"owner_profile_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"content_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"source_json\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"family_intakes_tenant_id_item_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"item_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"family_intakes_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"family_intakes_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"family_intakes_owner_profile_id_idx\\\",\\\"columns\\\":[\\\"owner_profile_id\\\"]}],\\\"version\\\":\\\"2577578b\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:FamilyIntakeCollection\\\":{\\\"name\\\":\\\"familyintakecollection\\\",\\\"className\\\":\\\"FamilyIntakeCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:FamilyIntakeCollection\\\",\\\"collection\\\":\\\"familyintakes\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/family-intake-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"family_intakes\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"FamilyIntake\\\",\\\"exportName\\\":\\\"FamilyIntakeCollection\\\",\\\"collectionExportName\\\":\\\"FamilyIntakeCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"family_intakes\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"family_intakes\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"item_id\\\\\\\" TEXT,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"owner_profile_id\\\\\\\" UUID,\\\\n \\\\\\\"content_digest\\\\\\\" TEXT,\\\\n \\\\\\\"source_json\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"owner_profile_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"content_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"source_json\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"family_intakes_tenant_id_item_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"item_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"family_intakes_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"family_intakes_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"family_intakes_owner_profile_id_idx\\\",\\\"columns\\\":[\\\"owner_profile_id\\\"]}],\\\"version\\\":\\\"2577578b\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:FamilyIntakeAsset\\\":{\\\"name\\\":\\\"familyintakeasset\\\",\\\"className\\\":\\\"FamilyIntakeAsset\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:FamilyIntakeAsset\\\",\\\"collection\\\":\\\"familyintakeassets\\\",\\\"description\\\":\\\"Sole family owner join; adoption borrows this exact immutable original.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/family-intake-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"intakeId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"FamilyIntake\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"assetId\\\":{\\\"type\\\":\\\"crossPackageRef\\\",\\\"required\\\":false,\\\"related\\\":\\\"@happyvertical/smrt-assets:Asset\\\"},\\\"name\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"mimeType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sha256\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"position\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"family_intake_assets\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"intake_id\\\",\\\"asset_id\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"FamilyIntakeAsset\\\",\\\"collectionExportName\\\":\\\"FamilyIntakeAssetCollection\\\",\\\"displayLabelField\\\":\\\"name\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"intakeId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"position\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"family_intake_assets\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"family_intake_assets\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"intake_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"asset_id\\\\\\\" UUID,\\\\n \\\\\\\"name\\\\\\\" TEXT,\\\\n \\\\\\\"mime_type\\\\\\\" TEXT,\\\\n \\\\\\\"sha256\\\\\\\" TEXT,\\\\n \\\\\\\"position\\\\\\\" INTEGER NOT NULL DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"intake_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"family_intakes\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"asset_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"mime_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"sha256\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"position\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"family_intake_assets_tenant_id_intake_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"intake_id\\\",\\\"asset_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"family_intake_assets_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"family_intake_assets_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"family_intake_assets_intake_id_idx\\\",\\\"columns\\\":[\\\"intake_id\\\"]},{\\\"name\\\":\\\"family_intake_assets_asset_id_idx\\\",\\\"columns\\\":[\\\"asset_id\\\"]}],\\\"version\\\":\\\"3811d126\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:FamilyIntakeAssetCollection\\\":{\\\"name\\\":\\\"familyintakeassetcollection\\\",\\\"className\\\":\\\"FamilyIntakeAssetCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:FamilyIntakeAssetCollection\\\",\\\"collection\\\":\\\"familyintakeassets\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/family-intake-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"family_intake_assets\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"FamilyIntakeAsset\\\",\\\"exportName\\\":\\\"FamilyIntakeAssetCollection\\\",\\\"collectionExportName\\\":\\\"FamilyIntakeAssetCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"family_intake_assets\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"family_intake_assets\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"intake_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"asset_id\\\\\\\" UUID,\\\\n \\\\\\\"name\\\\\\\" TEXT,\\\\n \\\\\\\"mime_type\\\\\\\" TEXT,\\\\n \\\\\\\"sha256\\\\\\\" TEXT,\\\\n \\\\\\\"position\\\\\\\" INTEGER NOT NULL DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"intake_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"family_intakes\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"asset_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"mime_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"sha256\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"position\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"family_intake_assets_tenant_id_intake_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"intake_id\\\",\\\"asset_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"family_intake_assets_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"family_intake_assets_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"family_intake_assets_intake_id_idx\\\",\\\"columns\\\":[\\\"intake_id\\\"]},{\\\"name\\\":\\\"family_intake_assets_asset_id_idx\\\",\\\"columns\\\":[\\\"asset_id\\\"]}],\\\"version\\\":\\\"3811d126\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:FamilyIntakeDecision\\\":{\\\"name\\\":\\\"familyintakedecision\\\",\\\"className\\\":\\\"FamilyIntakeDecision\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:FamilyIntakeDecision\\\",\\\"collection\\\":\\\"familyintakedecisions\\\",\\\"description\\\":\\\"Append-only attribution/adoption audit; no marks or learning outcomes.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/family-intake-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"intakeId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"FamilyIntake\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"requestKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sequence\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"actorUserId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"bodyJson\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"family_intake_decisions\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"intake_id\\\",\\\"request_key\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"FamilyIntakeDecision\\\",\\\"collectionExportName\\\":\\\"FamilyIntakeDecisionCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"intakeId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"sequence\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"family_intake_decisions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"family_intake_decisions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"intake_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_key\\\\\\\" TEXT,\\\\n \\\\\\\"sequence\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"body_json\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"intake_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"family_intakes\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"request_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"sequence\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"body_json\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"family_intake_decisions_tenant_id_intake_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"intake_id\\\",\\\"request_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"family_intake_decisions_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"family_intake_decisions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"family_intake_decisions_intake_id_idx\\\",\\\"columns\\\":[\\\"intake_id\\\"]}],\\\"version\\\":\\\"08875c81\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:FamilyIntakeDecisionCollection\\\":{\\\"name\\\":\\\"familyintakedecisioncollection\\\",\\\"className\\\":\\\"FamilyIntakeDecisionCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:FamilyIntakeDecisionCollection\\\",\\\"collection\\\":\\\"familyintakedecisions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/family-intake-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"family_intake_decisions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"FamilyIntakeDecision\\\",\\\"exportName\\\":\\\"FamilyIntakeDecisionCollection\\\",\\\"collectionExportName\\\":\\\"FamilyIntakeDecisionCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"family_intake_decisions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"family_intake_decisions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"intake_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_key\\\\\\\" TEXT,\\\\n \\\\\\\"sequence\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"body_json\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"intake_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"family_intakes\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"request_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"sequence\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"body_json\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"family_intake_decisions_tenant_id_intake_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"intake_id\\\",\\\"request_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"family_intake_decisions_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"family_intake_decisions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"family_intake_decisions_intake_id_idx\\\",\\\"columns\\\":[\\\"intake_id\\\"]}],\\\"version\\\":\\\"08875c81\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:Learner\\\":{\\\"name\\\":\\\"learner\\\",\\\"className\\\":\\\"Learner\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:Learner\\\",\\\"collection\\\":\\\"learners\\\",\\\"description\\\":\\\"A learner is a real user/profile identity with active family membership.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/learners.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"userId\\\":{\\\"type\\\":\\\"crossPackageRef\\\",\\\"required\\\":true,\\\"related\\\":\\\"@happyvertical/smrt-users:User\\\"},\\\"profileId\\\":{\\\"type\\\":\\\"crossPackageRef\\\",\\\"required\\\":true,\\\"related\\\":\\\"@happyvertical/smrt-profiles:Profile\\\"},\\\"displayName\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"birthDate\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"level\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"settings\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"getSettings\\\":{\\\"name\\\":\\\"getSettings\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Record<string, unknown>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setSettings\\\":{\\\"name\\\":\\\"setSettings\\\",\\\"async\\\":false,\\\"parameters\\\":[{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"Record<string, unknown>\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"Learner\\\",\\\"collectionExportName\\\":\\\"LearnerCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"userId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"crossPackageRef\\\"},{\\\"field\\\":\\\"profileId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"crossPackageRef\\\"},{\\\"field\\\":\\\"level\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"learners\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"learners\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"user_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"profile_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"display_name\\\\\\\" TEXT,\\\\n \\\\\\\"birth_date\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"level\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"settings\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"user_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"profile_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"display_name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"birth_date\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"level\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"settings\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"learners_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"learners_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"learners_user_id_idx\\\",\\\"columns\\\":[\\\"user_id\\\"]},{\\\"name\\\":\\\"learners_profile_id_idx\\\",\\\"columns\\\":[\\\"profile_id\\\"]}],\\\"version\\\":\\\"ca9907b5\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:Curriculum\\\":{\\\"name\\\":\\\"curriculum\\\",\\\"className\\\":\\\"Curriculum\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:Curriculum\\\",\\\"collection\\\":\\\"curriculums\\\",\\\"description\\\":\\\"A distinct plan retains its own enrollment history.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/learners.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"startsOn\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"endsOn\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"planned\\\",\\\"enum\\\":[\\\"planned\\\",\\\"active\\\",\\\"completed\\\",\\\"archived\\\"]}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tableName\\\":\\\"curricula\\\",\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"Curriculum\\\",\\\"collectionExportName\\\":\\\"CurriculumCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"title\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"curricula\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"curricula\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"title\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"starts_on\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"ends_on\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'planned'\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"starts_on\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"ends_on\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"planned\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"curricula_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"curricula_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"curricula_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]}],\\\"version\\\":\\\"b7e90cbd\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:Enrollment\\\":{\\\"name\\\":\\\"enrollment\\\",\\\"className\\\":\\\"Enrollment\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:Enrollment\\\",\\\"collection\\\":\\\"enrollments\\\",\\\"description\\\":\\\"One course in one curriculum; a new curriculum means a new enrollment.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/learners.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"curriculumId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Curriculum\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"courseId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Course\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"planned\\\",\\\"enum\\\":[\\\"planned\\\",\\\"active\\\",\\\"paused\\\",\\\"completed\\\",\\\"dropped\\\"]},\\\"startedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"completedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"targetMinutesPerWeek\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"curriculum_id\\\",\\\"course_id\\\"],\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"Enrollment\\\",\\\"collectionExportName\\\":\\\"EnrollmentCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"curriculumId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"courseId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"targetMinutesPerWeek\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"sortOrder\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"enrollments\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"enrollments\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"curriculum_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"course_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'planned',\\\\n \\\\\\\"started_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"completed_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"target_minutes_per_week\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER NOT NULL DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"curriculum_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"curricula\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"course_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"courses\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"planned\\\"},\\\"started_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"completed_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"target_minutes_per_week\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"enrollments_tenant_id_curriculum_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"curriculum_id\\\",\\\"course_id\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"enrollments_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"enrollments_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"enrollments_curriculum_id_idx\\\",\\\"columns\\\":[\\\"curriculum_id\\\"]},{\\\"name\\\":\\\"enrollments_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"enrollments_course_id_idx\\\",\\\"columns\\\":[\\\"course_id\\\"]}],\\\"version\\\":\\\"2a34b5ee\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:LessonProgress\\\":{\\\"name\\\":\\\"lessonprogress\\\",\\\"className\\\":\\\"LessonProgress\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:LessonProgress\\\",\\\"collection\\\":\\\"lessonprogresses\\\",\\\"description\\\":\\\"Progress identity is enrollment + lesson, never learner + lesson.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/learners.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"enrollmentId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Enrollment\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"lessonId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Lesson\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"not_started\\\",\\\"enum\\\":[\\\"not_started\\\",\\\"in_progress\\\",\\\"submitted\\\",\\\"needs_review\\\",\\\"complete\\\",\\\"skipped\\\"]},\\\"startedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"completedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"timeSpentSeconds\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"attempts\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"bestScore\\\":{\\\"type\\\":\\\"decimal\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"nullable\\\":true}}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tableName\\\":\\\"lesson_progress\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"enrollment_id\\\",\\\"lesson_id\\\"],\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"LessonProgress\\\",\\\"collectionExportName\\\":\\\"LessonProgressCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"enrollmentId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"lessonId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"timeSpentSeconds\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"},{\\\"field\\\":\\\"attempts\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"lesson_progress\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lesson_progress\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"enrollment_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'not_started',\\\\n \\\\\\\"started_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"completed_at\\\\\\\" TIMESTAMP,\\\\n \\\\\\\"time_spent_seconds\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"attempts\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"best_score\\\\\\\" REAL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"enrollment_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"enrollments\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"not_started\\\"},\\\"started_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"completed_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"time_spent_seconds\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"attempts\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"best_score\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"lesson_progress_tenant_id_enrollment_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"enrollment_id\\\",\\\"lesson_id\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"lesson_progress_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"lesson_progress_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lesson_progress_enrollment_id_idx\\\",\\\"columns\\\":[\\\"enrollment_id\\\"]},{\\\"name\\\":\\\"lesson_progress_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"lesson_progress_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]}],\\\"version\\\":\\\"36704fbd\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:LessonAsset\\\":{\\\"name\\\":\\\"lessonasset\\\",\\\"className\\\":\\\"LessonAsset\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:LessonAsset\\\",\\\"collection\\\":\\\"lessonassets\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/lesson-assets.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true,\\\"mode\\\":\\\"optional\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"lessonId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Lesson\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"assetId\\\":{\\\"type\\\":\\\"crossPackageRef\\\",\\\"required\\\":true,\\\"related\\\":\\\"@happyvertical/smrt-assets:Asset\\\"},\\\"relationship\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"attachment\\\",\\\"_meta\\\":{\\\"required\\\":true},\\\"enum\\\":[\\\"printable\\\",\\\"answer-key\\\",\\\"video\\\",\\\"attachment\\\"]},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"lesson_assets\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"lesson_id\\\",\\\"asset_id\\\",\\\"relationship\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"optional\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"LessonAsset\\\",\\\"collectionExportName\\\":\\\"LessonAssetCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"lessonId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"assetId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"crossPackageRef\\\"},{\\\"field\\\":\\\"relationship\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"sortOrder\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"lesson_assets\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"lesson_assets\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"asset_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"relationship\\\\\\\" TEXT NOT NULL DEFAULT 'attachment',\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER NOT NULL DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"asset_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"relationship\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"attachment\\\"},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"lesson_assets_tenant_id_lesson_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"lesson_id\\\",\\\"asset_id\\\",\\\"relationship\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"lesson_assets_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"lesson_assets_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"lesson_assets_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]},{\\\"name\\\":\\\"lesson_assets_asset_id_idx\\\",\\\"columns\\\":[\\\"asset_id\\\"]}],\\\"version\\\":\\\"d96385c6\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:Submission\\\":{\\\"name\\\":\\\"submission\\\",\\\"className\\\":\\\"Submission\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:Submission\\\",\\\"collection\\\":\\\"submissions\\\",\\\"description\\\":\\\"Evidence that a learner completed one progress item.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/submissions.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"lessonId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Lesson\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"progressId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"LessonProgress\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"submittedAt\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"captured\\\",\\\"enum\\\":[\\\"captured\\\",\\\"extracting\\\",\\\"needs_review\\\",\\\"graded\\\",\\\"rejected\\\"]},\\\"notes\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"captureKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"captureDigest\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"completed_work\\\",\\\"_meta\\\":{\\\"required\\\":true},\\\"enum\\\":[\\\"blank_reference\\\",\\\"completed_work\\\"]},\\\"previousSubmissionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"Submission\\\",\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"intakeItemId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"nullable\\\":true}}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableStrategy\\\":\\\"sti\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"Submission\\\",\\\"collectionExportName\\\":\\\"SubmissionCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"lessonId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"progressId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"kind\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"submissions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"learner_id\\\\\\\" UUID,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID,\\\\n \\\\\\\"progress_id\\\\\\\" UUID,\\\\n \\\\\\\"submitted_at\\\\\\\" TEXT,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'captured',\\\\n \\\\\\\"notes\\\\\\\" TEXT,\\\\n \\\\\\\"capture_key\\\\\\\" TEXT,\\\\n \\\\\\\"capture_digest\\\\\\\" TEXT,\\\\n \\\\\\\"kind\\\\\\\" TEXT DEFAULT 'completed_work',\\\\n \\\\\\\"previous_submission_id\\\\\\\" UUID,\\\\n \\\\\\\"intake_item_id\\\\\\\" TEXT,\\\\n \\\\\\\"page_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"ocr_text\\\\\\\" TEXT,\\\\n \\\\\\\"extracted\\\\\\\" TEXT,\\\\n \\\\\\\"reported_by\\\\\\\" TEXT DEFAULT 'learner',\\\\n \\\\\\\"evidence_url\\\\\\\" TEXT,\\\\n \\\\\\\"reported_score\\\\\\\" REAL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"progress_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lesson_progress\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"submitted_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"captured\\\"},\\\"notes\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"completed_work\\\"},\\\"previous_submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"intake_item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"page_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"ocr_text\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"extracted\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"learner\\\"},\\\"evidence_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_score\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"submissions_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"submissions_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"submissions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"submissions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"submissions_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]},{\\\"name\\\":\\\"submissions_progress_id_idx\\\",\\\"columns\\\":[\\\"progress_id\\\"]},{\\\"name\\\":\\\"submissions_previous_submission_id_idx\\\",\\\"columns\\\":[\\\"previous_submission_id\\\"]}],\\\"version\\\":\\\"27a21ab4\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:SubmissionIntakeBinding\\\":{\\\"name\\\":\\\"submissionintakebinding\\\",\\\"className\\\":\\\"SubmissionIntakeBinding\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:SubmissionIntakeBinding\\\",\\\"collection\\\":\\\"submissionintakebindings\\\",\\\"description\\\":\\\"Durable tenant/item claim for trusted ingestion receipts. This separate table keeps ordinary uploads (which have no intake item) out of the uniqueness key.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/submissions.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"intakeItemId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"submissionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Submission\\\",\\\"_meta\\\":{\\\"required\\\":true}}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"submission_intake_bindings\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"intake_item_id\\\"],\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"SubmissionIntakeBinding\\\",\\\"collectionExportName\\\":\\\"SubmissionIntakeBindingCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"intakeItemId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"submissionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"submission_intake_bindings\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"submission_intake_bindings\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"intake_item_id\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"submission_id\\\\\\\" UUID NOT NULL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"intake_item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}}},\\\"indexes\\\":[{\\\"name\\\":\\\"submission_intake_bindings_tenant_id_intake_item_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"intake_item_id\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"submission_intake_bindings_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"submission_intake_bindings_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"submission_intake_bindings_submission_id_idx\\\",\\\"columns\\\":[\\\"submission_id\\\"]}],\\\"version\\\":\\\"7102c909\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:ScannedSubmission\\\":{\\\"name\\\":\\\"scannedsubmission\\\",\\\"className\\\":\\\"ScannedSubmission\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:ScannedSubmission\\\",\\\"collection\\\":\\\"submissions\\\",\\\"description\\\":\\\"Photos or scans of work submitted for review.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/submissions.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"lessonId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Lesson\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"progressId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"LessonProgress\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"submittedAt\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"captured\\\",\\\"enum\\\":[\\\"captured\\\",\\\"extracting\\\",\\\"needs_review\\\",\\\"graded\\\",\\\"rejected\\\"]},\\\"notes\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"captureKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"captureDigest\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"completed_work\\\",\\\"_meta\\\":{\\\"required\\\":true},\\\"enum\\\":[\\\"blank_reference\\\",\\\"completed_work\\\"]},\\\"previousSubmissionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"Submission\\\",\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"intakeItemId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"pageCount\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"ocrText\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"extracted\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getExtracted\\\":{\\\"name\\\":\\\"getExtracted\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Record<string, unknown>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setExtracted\\\":{\\\"name\\\":\\\"setExtracted\\\",\\\"async\\\":false,\\\"parameters\\\":[{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"Record<string, unknown>\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tableStrategy\\\":\\\"sti\\\"},\\\"extends\\\":\\\"Submission\\\",\\\"exportName\\\":\\\"ScannedSubmission\\\",\\\"collectionExportName\\\":\\\"ScannedSubmissionCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"lessonId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"progressId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"kind\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"pageCount\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"submissions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"learner_id\\\\\\\" UUID,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID,\\\\n \\\\\\\"progress_id\\\\\\\" UUID,\\\\n \\\\\\\"submitted_at\\\\\\\" TEXT,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'captured',\\\\n \\\\\\\"notes\\\\\\\" TEXT,\\\\n \\\\\\\"capture_key\\\\\\\" TEXT,\\\\n \\\\\\\"capture_digest\\\\\\\" TEXT,\\\\n \\\\\\\"kind\\\\\\\" TEXT DEFAULT 'completed_work',\\\\n \\\\\\\"previous_submission_id\\\\\\\" UUID,\\\\n \\\\\\\"intake_item_id\\\\\\\" TEXT,\\\\n \\\\\\\"page_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"ocr_text\\\\\\\" TEXT,\\\\n \\\\\\\"extracted\\\\\\\" TEXT,\\\\n \\\\\\\"reported_by\\\\\\\" TEXT DEFAULT 'learner',\\\\n \\\\\\\"evidence_url\\\\\\\" TEXT,\\\\n \\\\\\\"reported_score\\\\\\\" REAL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"progress_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lesson_progress\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"submitted_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"captured\\\"},\\\"notes\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"completed_work\\\"},\\\"previous_submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"intake_item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"page_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"ocr_text\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"extracted\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"learner\\\"},\\\"evidence_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_score\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"submissions_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"submissions_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"submissions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"submissions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"submissions_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]},{\\\"name\\\":\\\"submissions_progress_id_idx\\\",\\\"columns\\\":[\\\"progress_id\\\"]},{\\\"name\\\":\\\"submissions_previous_submission_id_idx\\\",\\\"columns\\\":[\\\"previous_submission_id\\\"]}],\\\"version\\\":\\\"7c394510\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:ExternalCompletion\\\":{\\\"name\\\":\\\"externalcompletion\\\",\\\"className\\\":\\\"ExternalCompletion\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:ExternalCompletion\\\",\\\"collection\\\":\\\"submissions\\\",\\\"description\\\":\\\"Completion reported by the learner, guardian, or external source.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/submissions.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"lessonId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Lesson\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"progressId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"LessonProgress\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"submittedAt\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"captured\\\",\\\"enum\\\":[\\\"captured\\\",\\\"extracting\\\",\\\"needs_review\\\",\\\"graded\\\",\\\"rejected\\\"]},\\\"notes\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"captureKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"captureDigest\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"completed_work\\\",\\\"_meta\\\":{\\\"required\\\":true},\\\"enum\\\":[\\\"blank_reference\\\",\\\"completed_work\\\"]},\\\"previousSubmissionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"Submission\\\",\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"intakeItemId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"reportedBy\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"learner\\\",\\\"enum\\\":[\\\"learner\\\",\\\"guardian\\\",\\\"source\\\"]},\\\"evidenceUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"reportedScore\\\":{\\\"type\\\":\\\"decimal\\\",\\\"required\\\":false,\\\"_meta\\\":{}}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tableStrategy\\\":\\\"sti\\\"},\\\"extends\\\":\\\"Submission\\\",\\\"exportName\\\":\\\"ExternalCompletion\\\",\\\"collectionExportName\\\":\\\"ExternalCompletionCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"lessonId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"progressId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"kind\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"submissions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"learner_id\\\\\\\" UUID,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID,\\\\n \\\\\\\"progress_id\\\\\\\" UUID,\\\\n \\\\\\\"submitted_at\\\\\\\" TEXT,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'captured',\\\\n \\\\\\\"notes\\\\\\\" TEXT,\\\\n \\\\\\\"capture_key\\\\\\\" TEXT,\\\\n \\\\\\\"capture_digest\\\\\\\" TEXT,\\\\n \\\\\\\"kind\\\\\\\" TEXT DEFAULT 'completed_work',\\\\n \\\\\\\"previous_submission_id\\\\\\\" UUID,\\\\n \\\\\\\"intake_item_id\\\\\\\" TEXT,\\\\n \\\\\\\"page_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"ocr_text\\\\\\\" TEXT,\\\\n \\\\\\\"extracted\\\\\\\" TEXT,\\\\n \\\\\\\"reported_by\\\\\\\" TEXT DEFAULT 'learner',\\\\n \\\\\\\"evidence_url\\\\\\\" TEXT,\\\\n \\\\\\\"reported_score\\\\\\\" REAL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"progress_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lesson_progress\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"submitted_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"captured\\\"},\\\"notes\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"completed_work\\\"},\\\"previous_submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"intake_item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"page_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"ocr_text\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"extracted\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"learner\\\"},\\\"evidence_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_score\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"submissions_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"submissions_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"submissions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"submissions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"submissions_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]},{\\\"name\\\":\\\"submissions_progress_id_idx\\\",\\\"columns\\\":[\\\"progress_id\\\"]},{\\\"name\\\":\\\"submissions_previous_submission_id_idx\\\",\\\"columns\\\":[\\\"previous_submission_id\\\"]}],\\\"version\\\":\\\"eff3715d\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:Attestation\\\":{\\\"name\\\":\\\"attestation\\\",\\\"className\\\":\\\"Attestation\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:Attestation\\\",\\\"collection\\\":\\\"submissions\\\",\\\"description\\\":\\\"A guardian's statement that work was completed.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/submissions.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"lessonId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Lesson\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"progressId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"LessonProgress\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"submittedAt\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"captured\\\",\\\"enum\\\":[\\\"captured\\\",\\\"extracting\\\",\\\"needs_review\\\",\\\"graded\\\",\\\"rejected\\\"]},\\\"notes\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"captureKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"captureDigest\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"completed_work\\\",\\\"_meta\\\":{\\\"required\\\":true},\\\"enum\\\":[\\\"blank_reference\\\",\\\"completed_work\\\"]},\\\"previousSubmissionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"Submission\\\",\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"intakeItemId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"nullable\\\":true}}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tableStrategy\\\":\\\"sti\\\"},\\\"extends\\\":\\\"Submission\\\",\\\"exportName\\\":\\\"Attestation\\\",\\\"collectionExportName\\\":\\\"AttestationCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"lessonId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"progressId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"kind\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"submissions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"submissions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"_meta_type\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"_meta_data\\\\\\\" JSON,\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"learner_id\\\\\\\" UUID,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID,\\\\n \\\\\\\"progress_id\\\\\\\" UUID,\\\\n \\\\\\\"submitted_at\\\\\\\" TEXT,\\\\n \\\\\\\"status\\\\\\\" TEXT DEFAULT 'captured',\\\\n \\\\\\\"notes\\\\\\\" TEXT,\\\\n \\\\\\\"capture_key\\\\\\\" TEXT,\\\\n \\\\\\\"capture_digest\\\\\\\" TEXT,\\\\n \\\\\\\"kind\\\\\\\" TEXT DEFAULT 'completed_work',\\\\n \\\\\\\"previous_submission_id\\\\\\\" UUID,\\\\n \\\\\\\"intake_item_id\\\\\\\" TEXT,\\\\n \\\\\\\"page_count\\\\\\\" INTEGER DEFAULT 0,\\\\n \\\\\\\"ocr_text\\\\\\\" TEXT,\\\\n \\\\\\\"extracted\\\\\\\" TEXT,\\\\n \\\\\\\"reported_by\\\\\\\" TEXT DEFAULT 'learner',\\\\n \\\\\\\"evidence_url\\\\\\\" TEXT,\\\\n \\\\\\\"reported_score\\\\\\\" REAL\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"_meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"_meta_data\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"progress_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lesson_progress\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"submitted_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"status\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"captured\\\"},\\\"notes\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"capture_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"completed_work\\\"},\\\"previous_submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"intake_item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"page_count\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"default\\\":0},\\\"ocr_text\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"extracted\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_by\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"default\\\":\\\"learner\\\"},\\\"evidence_url\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false},\\\"reported_score\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"submissions_slug_context_meta_type_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\",\\\"_meta_type\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"submissions_meta_type_idx\\\",\\\"columns\\\":[\\\"_meta_type\\\"]},{\\\"name\\\":\\\"submissions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"submissions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"submissions_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]},{\\\"name\\\":\\\"submissions_progress_id_idx\\\",\\\"columns\\\":[\\\"progress_id\\\"]},{\\\"name\\\":\\\"submissions_previous_submission_id_idx\\\",\\\"columns\\\":[\\\"previous_submission_id\\\"]}],\\\"version\\\":\\\"4f3230a3\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:SubmissionAsset\\\":{\\\"name\\\":\\\"submissionasset\\\",\\\"className\\\":\\\"SubmissionAsset\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:SubmissionAsset\\\",\\\"collection\\\":\\\"submissionassets\\\",\\\"description\\\":\\\"The tenant-owned files attached to a submission.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/submissions.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"submissionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Submission\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"assetId\\\":{\\\"type\\\":\\\"crossPackageRef\\\",\\\"required\\\":true,\\\"related\\\":\\\"@happyvertical/smrt-assets:Asset\\\"},\\\"relationship\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"page\\\",\\\"_meta\\\":{\\\"required\\\":true},\\\"enum\\\":[\\\"page\\\",\\\"attachment\\\"]},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"submission_assets\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"submission_id\\\",\\\"asset_id\\\",\\\"relationship\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"SubmissionAsset\\\",\\\"collectionExportName\\\":\\\"SubmissionAssetCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"submissionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"assetId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"crossPackageRef\\\"},{\\\"field\\\":\\\"relationship\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"sortOrder\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"submission_assets\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"submission_assets\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"submission_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"asset_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"relationship\\\\\\\" TEXT NOT NULL DEFAULT 'page',\\\\n \\\\\\\"sort_order\\\\\\\" INTEGER NOT NULL DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"asset_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"relationship\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"page\\\"},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"submission_assets_tenant_id_submission_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"submission_id\\\",\\\"asset_id\\\",\\\"relationship\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"submission_assets_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"submission_assets_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"submission_assets_submission_id_idx\\\",\\\"columns\\\":[\\\"submission_id\\\"]},{\\\"name\\\":\\\"submission_assets_asset_id_idx\\\",\\\"columns\\\":[\\\"asset_id\\\"]}],\\\"version\\\":\\\"d9b61c8a\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:Grade\\\":{\\\"name\\\":\\\"grade\\\",\\\"className\\\":\\\"Grade\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:Grade\\\",\\\"collection\\\":\\\"grades\\\",\\\"description\\\":\\\"An assessment of a submission; the service selects the authoritative grade.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/submissions.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"submissionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Submission\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"graderKind\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"auto\\\",\\\"_meta\\\":{\\\"required\\\":true},\\\"enum\\\":[\\\"auto\\\",\\\"ai\\\",\\\"guardian\\\",\\\"instructor\\\"]},\\\"graderProfileId\\\":{\\\"type\\\":\\\"crossPackageRef\\\",\\\"required\\\":false,\\\"related\\\":\\\"@happyvertical/smrt-profiles:Profile\\\",\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"score\\\":{\\\"type\\\":\\\"decimal\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"pointsEarned\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"pointsPossible\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"rubricResults\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"feedback\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"gradedAt\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"getRubricResults\\\":{\\\"name\\\":\\\"getRubricResults\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Record<string, unknown>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setRubricResults\\\":{\\\"name\\\":\\\"setRubricResults\\\",\\\"async\\\":false,\\\"parameters\\\":[{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"Record<string, unknown>\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"Grade\\\",\\\"collectionExportName\\\":\\\"GradeCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"submissionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"graderKind\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"grades\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"grades\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"submission_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"grader_kind\\\\\\\" TEXT NOT NULL DEFAULT 'auto',\\\\n \\\\\\\"grader_profile_id\\\\\\\" UUID,\\\\n \\\\\\\"score\\\\\\\" REAL,\\\\n \\\\\\\"points_earned\\\\\\\" INTEGER,\\\\n \\\\\\\"points_possible\\\\\\\" INTEGER,\\\\n \\\\\\\"rubric_results\\\\\\\" TEXT,\\\\n \\\\\\\"feedback\\\\\\\" TEXT,\\\\n \\\\\\\"graded_at\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"grader_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"auto\\\"},\\\"grader_profile_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"score\\\":{\\\"type\\\":\\\"REAL\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"points_earned\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"points_possible\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"rubric_results\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"feedback\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"graded_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"grades_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"grades_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"grades_submission_id_idx\\\",\\\"columns\\\":[\\\"submission_id\\\"]},{\\\"name\\\":\\\"grades_grader_profile_id_idx\\\",\\\"columns\\\":[\\\"grader_profile_id\\\"]}],\\\"version\\\":\\\"7d629fec\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:Workbook\\\":{\\\"name\\\":\\\"workbook\\\",\\\"className\\\":\\\"Workbook\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:Workbook\\\",\\\"collection\\\":\\\"workbooks\\\",\\\"description\\\":\\\"Education-owned private workbook record. Mutations go through WorkbookService.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"workbookKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"edition\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"reviewRequired\\\":{\\\"type\\\":\\\"boolean\\\",\\\"required\\\":true,\\\"default\\\":true},\\\"policyVersion\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":1}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbooks\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"learner_id\\\",\\\"workbook_key\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"Workbook\\\",\\\"collectionExportName\\\":\\\"WorkbookCollection\\\",\\\"displayLabelField\\\":\\\"title\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"reviewRequired\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"boolean\\\"},{\\\"field\\\":\\\"policyVersion\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"workbooks\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbooks\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"workbook_key\\\\\\\" TEXT,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"edition\\\\\\\" TEXT,\\\\n \\\\\\\"review_required\\\\\\\" BOOLEAN NOT NULL DEFAULT TRUE,\\\\n \\\\\\\"policy_version\\\\\\\" INTEGER NOT NULL DEFAULT 1\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"workbook_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"edition\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"review_required\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":true},\\\"policy_version\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":1}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbooks_tenant_id_learner_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"learner_id\\\",\\\"workbook_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbooks_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbooks_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbooks_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]}],\\\"version\\\":\\\"a5b56a39\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookCollection\\\":{\\\"name\\\":\\\"workbookcollection\\\",\\\"className\\\":\\\"WorkbookCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookCollection\\\",\\\"collection\\\":\\\"workbooks\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbooks\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Workbook\\\",\\\"exportName\\\":\\\"WorkbookCollection\\\",\\\"collectionExportName\\\":\\\"WorkbookCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"workbooks\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbooks\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"workbook_key\\\\\\\" TEXT,\\\\n \\\\\\\"title\\\\\\\" TEXT,\\\\n \\\\\\\"edition\\\\\\\" TEXT,\\\\n \\\\\\\"review_required\\\\\\\" BOOLEAN NOT NULL DEFAULT TRUE,\\\\n \\\\\\\"policy_version\\\\\\\" INTEGER NOT NULL DEFAULT 1\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"workbook_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"title\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"edition\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"review_required\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":true},\\\"policy_version\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":1}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbooks_tenant_id_learner_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"learner_id\\\",\\\"workbook_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbooks_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbooks_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbooks_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]}],\\\"version\\\":\\\"a5b56a39\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookActivity\\\":{\\\"name\\\":\\\"workbookactivity\\\",\\\"className\\\":\\\"WorkbookActivity\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookActivity\\\",\\\"collection\\\":\\\"workbookactivities\\\",\\\"description\\\":\\\"Education-owned private workbook record. Mutations go through WorkbookService.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"workbookId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"Workbook\\\",\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"captureKind\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"identified\\\",\\\"_meta\\\":{\\\"required\\\":true,\\\"default\\\":\\\"identified\\\"}},\\\"photoIntakeId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"WorkbookPhotoIntake\\\",\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"enrollmentId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Enrollment\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"lessonId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Lesson\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"pageKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"pageLabel\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_activities\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"workbook_id\\\",\\\"page_key\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"WorkbookActivity\\\",\\\"collectionExportName\\\":\\\"WorkbookActivityCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"captureKind\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"enrollmentId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"lessonId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_activities\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_activities\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"workbook_id\\\\\\\" UUID,\\\\n \\\\\\\"capture_kind\\\\\\\" TEXT NOT NULL DEFAULT 'identified',\\\\n \\\\\\\"photo_intake_id\\\\\\\" UUID,\\\\n \\\\\\\"enrollment_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"page_key\\\\\\\" TEXT,\\\\n \\\\\\\"page_label\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"workbook_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbooks\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"capture_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"identified\\\"},\\\"photo_intake_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_photo_intakes\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"enrollment_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"enrollments\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"page_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"page_label\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_activities_tenant_id_workbook_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"workbook_id\\\",\\\"page_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_activities_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_activities_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_activities_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_activities_workbook_id_idx\\\",\\\"columns\\\":[\\\"workbook_id\\\"]},{\\\"name\\\":\\\"workbook_activities_photo_intake_id_idx\\\",\\\"columns\\\":[\\\"photo_intake_id\\\"]},{\\\"name\\\":\\\"workbook_activities_enrollment_id_idx\\\",\\\"columns\\\":[\\\"enrollment_id\\\"]},{\\\"name\\\":\\\"workbook_activities_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]}],\\\"version\\\":\\\"320c8eb0\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookActivityCollection\\\":{\\\"name\\\":\\\"workbookactivitycollection\\\",\\\"className\\\":\\\"WorkbookActivityCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookActivityCollection\\\",\\\"collection\\\":\\\"workbookactivities\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_activities\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"WorkbookActivity\\\",\\\"exportName\\\":\\\"WorkbookActivityCollection\\\",\\\"collectionExportName\\\":\\\"WorkbookActivityCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_activities\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_activities\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"workbook_id\\\\\\\" UUID,\\\\n \\\\\\\"capture_kind\\\\\\\" TEXT NOT NULL DEFAULT 'identified',\\\\n \\\\\\\"photo_intake_id\\\\\\\" UUID,\\\\n \\\\\\\"enrollment_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"lesson_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"page_key\\\\\\\" TEXT,\\\\n \\\\\\\"page_label\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"workbook_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbooks\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"capture_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"identified\\\"},\\\"photo_intake_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_photo_intakes\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"enrollment_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"enrollments\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"lesson_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"lessons\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"page_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"page_label\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_activities_tenant_id_workbook_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"workbook_id\\\",\\\"page_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_activities_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_activities_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_activities_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_activities_workbook_id_idx\\\",\\\"columns\\\":[\\\"workbook_id\\\"]},{\\\"name\\\":\\\"workbook_activities_photo_intake_id_idx\\\",\\\"columns\\\":[\\\"photo_intake_id\\\"]},{\\\"name\\\":\\\"workbook_activities_enrollment_id_idx\\\",\\\"columns\\\":[\\\"enrollment_id\\\"]},{\\\"name\\\":\\\"workbook_activities_lesson_id_idx\\\",\\\"columns\\\":[\\\"lesson_id\\\"]}],\\\"version\\\":\\\"320c8eb0\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookWorkFiling\\\":{\\\"name\\\":\\\"workbookworkfiling\\\",\\\"className\\\":\\\"WorkbookWorkFiling\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookWorkFiling\\\",\\\"collection\\\":\\\"workbookworkfilings\\\",\\\"description\\\":\\\"Append-only association; the source work unit and its routing never move.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"sourceActivityId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"WorkbookActivity\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"workbookId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Workbook\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"canonicalActivityId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"WorkbookActivity\\\",\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"previousRevisionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"WorkbookWorkFiling\\\",\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"actorUserId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"requestKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"reason\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"digest\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_work_filings\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"source_activity_id\\\",\\\"request_key\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"WorkbookWorkFiling\\\",\\\"collectionExportName\\\":\\\"WorkbookWorkFilingCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"sourceActivityId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"workbookId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_work_filings\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_work_filings\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"source_activity_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"workbook_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"canonical_activity_id\\\\\\\" UUID,\\\\n \\\\\\\"previous_revision_id\\\\\\\" UUID,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"request_key\\\\\\\" TEXT,\\\\n \\\\\\\"reason\\\\\\\" TEXT,\\\\n \\\\\\\"digest\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"source_activity_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_activities\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"workbook_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbooks\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"canonical_activity_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_activities\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"previous_revision_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_work_filings\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"request_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"reason\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_work_filings_tenant_id_source_activity_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"source_activity_id\\\",\\\"request_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_work_filings_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_work_filings_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_work_filings_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_work_filings_source_activity_id_idx\\\",\\\"columns\\\":[\\\"source_activity_id\\\"]},{\\\"name\\\":\\\"workbook_work_filings_workbook_id_idx\\\",\\\"columns\\\":[\\\"workbook_id\\\"]},{\\\"name\\\":\\\"workbook_work_filings_canonical_activity_id_idx\\\",\\\"columns\\\":[\\\"canonical_activity_id\\\"]},{\\\"name\\\":\\\"workbook_work_filings_previous_revision_id_idx\\\",\\\"columns\\\":[\\\"previous_revision_id\\\"]}],\\\"version\\\":\\\"03e989a0\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookWorkFilingCollection\\\":{\\\"name\\\":\\\"workbookworkfilingcollection\\\",\\\"className\\\":\\\"WorkbookWorkFilingCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookWorkFilingCollection\\\",\\\"collection\\\":\\\"workbookworkfilings\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_work_filings\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"WorkbookWorkFiling\\\",\\\"exportName\\\":\\\"WorkbookWorkFilingCollection\\\",\\\"collectionExportName\\\":\\\"WorkbookWorkFilingCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_work_filings\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_work_filings\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"source_activity_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"workbook_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"canonical_activity_id\\\\\\\" UUID,\\\\n \\\\\\\"previous_revision_id\\\\\\\" UUID,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"request_key\\\\\\\" TEXT,\\\\n \\\\\\\"reason\\\\\\\" TEXT,\\\\n \\\\\\\"digest\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"source_activity_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_activities\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"workbook_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbooks\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"canonical_activity_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_activities\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"previous_revision_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_work_filings\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"request_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"reason\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_work_filings_tenant_id_source_activity_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"source_activity_id\\\",\\\"request_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_work_filings_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_work_filings_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_work_filings_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_work_filings_source_activity_id_idx\\\",\\\"columns\\\":[\\\"source_activity_id\\\"]},{\\\"name\\\":\\\"workbook_work_filings_workbook_id_idx\\\",\\\"columns\\\":[\\\"workbook_id\\\"]},{\\\"name\\\":\\\"workbook_work_filings_canonical_activity_id_idx\\\",\\\"columns\\\":[\\\"canonical_activity_id\\\"]},{\\\"name\\\":\\\"workbook_work_filings_previous_revision_id_idx\\\",\\\"columns\\\":[\\\"previous_revision_id\\\"]}],\\\"version\\\":\\\"03e989a0\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookAttempt\\\":{\\\"name\\\":\\\"workbookattempt\\\",\\\"className\\\":\\\"WorkbookAttempt\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookAttempt\\\",\\\"collection\\\":\\\"workbookattempts\\\",\\\"description\\\":\\\"Education-owned private workbook record. Mutations go through WorkbookService.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"activityId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"WorkbookActivity\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"submissionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Submission\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"previousAttemptId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"WorkbookAttempt\\\",\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"capturedAt\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"episodeId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"reviewRequired\\\":{\\\"type\\\":\\\"boolean\\\",\\\"required\\\":true,\\\"default\\\":true},\\\"policyVersion\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":1},\\\"assistance\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"actorUserId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sourceHashes\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}}},\\\"methods\\\":{\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_attempts\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"submission_id\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"WorkbookAttempt\\\",\\\"collectionExportName\\\":\\\"WorkbookAttemptCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"activityId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"submissionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"reviewRequired\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"boolean\\\"},{\\\"field\\\":\\\"policyVersion\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_attempts\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_attempts\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"activity_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"submission_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"previous_attempt_id\\\\\\\" UUID,\\\\n \\\\\\\"captured_at\\\\\\\" TEXT,\\\\n \\\\\\\"episode_id\\\\\\\" TEXT,\\\\n \\\\\\\"review_required\\\\\\\" BOOLEAN NOT NULL DEFAULT TRUE,\\\\n \\\\\\\"policy_version\\\\\\\" INTEGER NOT NULL DEFAULT 1,\\\\n \\\\\\\"assistance\\\\\\\" TEXT,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"source_hashes\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"activity_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_activities\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"previous_attempt_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_attempts\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"captured_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"episode_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"review_required\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":true},\\\"policy_version\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":1},\\\"assistance\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"source_hashes\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_attempts_tenant_id_submission_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"submission_id\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"workbook_attempts_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_attempts_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_attempts_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_attempts_activity_id_idx\\\",\\\"columns\\\":[\\\"activity_id\\\"]},{\\\"name\\\":\\\"workbook_attempts_submission_id_idx\\\",\\\"columns\\\":[\\\"submission_id\\\"]},{\\\"name\\\":\\\"workbook_attempts_previous_attempt_id_idx\\\",\\\"columns\\\":[\\\"previous_attempt_id\\\"]}],\\\"version\\\":\\\"bd9cdd9f\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookAttemptCollection\\\":{\\\"name\\\":\\\"workbookattemptcollection\\\",\\\"className\\\":\\\"WorkbookAttemptCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookAttemptCollection\\\",\\\"collection\\\":\\\"workbookattempts\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_attempts\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"WorkbookAttempt\\\",\\\"exportName\\\":\\\"WorkbookAttemptCollection\\\",\\\"collectionExportName\\\":\\\"WorkbookAttemptCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_attempts\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_attempts\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"activity_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"submission_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"previous_attempt_id\\\\\\\" UUID,\\\\n \\\\\\\"captured_at\\\\\\\" TEXT,\\\\n \\\\\\\"episode_id\\\\\\\" TEXT,\\\\n \\\\\\\"review_required\\\\\\\" BOOLEAN NOT NULL DEFAULT TRUE,\\\\n \\\\\\\"policy_version\\\\\\\" INTEGER NOT NULL DEFAULT 1,\\\\n \\\\\\\"assistance\\\\\\\" TEXT,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"source_hashes\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"activity_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_activities\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"submission_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"submissions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"previous_attempt_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_attempts\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"captured_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"episode_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"review_required\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":true},\\\"policy_version\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":1},\\\"assistance\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"source_hashes\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_attempts_tenant_id_submission_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"submission_id\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"workbook_attempts_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_attempts_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_attempts_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_attempts_activity_id_idx\\\",\\\"columns\\\":[\\\"activity_id\\\"]},{\\\"name\\\":\\\"workbook_attempts_submission_id_idx\\\",\\\"columns\\\":[\\\"submission_id\\\"]},{\\\"name\\\":\\\"workbook_attempts_previous_attempt_id_idx\\\",\\\"columns\\\":[\\\"previous_attempt_id\\\"]}],\\\"version\\\":\\\"bd9cdd9f\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookAssessmentRevision\\\":{\\\"name\\\":\\\"workbookassessmentrevision\\\",\\\"className\\\":\\\"WorkbookAssessmentRevision\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookAssessmentRevision\\\",\\\"collection\\\":\\\"workbookassessmentrevisions\\\",\\\"description\\\":\\\"Education-owned private workbook record. Mutations go through WorkbookService.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"attemptId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"WorkbookAttempt\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"requestKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"requestDigest\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"actorUserId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sourceRevisionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"WorkbookAssessmentRevision\\\",\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"decisionReason\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"supersedesId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"WorkbookAssessmentRevision\\\",\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"assessmentJson\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}},\\\"recordedAt\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_assessment_revisions\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"attempt_id\\\",\\\"request_key\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"WorkbookAssessmentRevision\\\",\\\"collectionExportName\\\":\\\"WorkbookAssessmentRevisionCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"attemptId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_assessment_revisions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_assessment_revisions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"attempt_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_key\\\\\\\" TEXT,\\\\n \\\\\\\"request_digest\\\\\\\" TEXT,\\\\n \\\\\\\"kind\\\\\\\" TEXT,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"source_revision_id\\\\\\\" UUID,\\\\n \\\\\\\"decision_reason\\\\\\\" TEXT,\\\\n \\\\\\\"supersedes_id\\\\\\\" UUID,\\\\n \\\\\\\"assessment_json\\\\\\\" TEXT,\\\\n \\\\\\\"recorded_at\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"attempt_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_attempts\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"request_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"request_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"source_revision_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_assessment_revisions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"decision_reason\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"supersedes_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_assessment_revisions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"assessment_json\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"recorded_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_assessment_revisions_tenant_id_attempt_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"attempt_id\\\",\\\"request_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_assessment_revisions_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_assessment_revisions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_assessment_revisions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_assessment_revisions_attempt_id_idx\\\",\\\"columns\\\":[\\\"attempt_id\\\"]},{\\\"name\\\":\\\"workbook_assessment_revisions_source_revision_id_idx\\\",\\\"columns\\\":[\\\"source_revision_id\\\"]},{\\\"name\\\":\\\"workbook_assessment_revisions_supersedes_id_idx\\\",\\\"columns\\\":[\\\"supersedes_id\\\"]}],\\\"version\\\":\\\"94b2bd33\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookAssessmentRevisionCollection\\\":{\\\"name\\\":\\\"workbookassessmentrevisioncollection\\\",\\\"className\\\":\\\"WorkbookAssessmentRevisionCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookAssessmentRevisionCollection\\\",\\\"collection\\\":\\\"workbookassessmentrevisions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_assessment_revisions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"WorkbookAssessmentRevision\\\",\\\"exportName\\\":\\\"WorkbookAssessmentRevisionCollection\\\",\\\"collectionExportName\\\":\\\"WorkbookAssessmentRevisionCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_assessment_revisions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_assessment_revisions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"attempt_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_key\\\\\\\" TEXT,\\\\n \\\\\\\"request_digest\\\\\\\" TEXT,\\\\n \\\\\\\"kind\\\\\\\" TEXT,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"source_revision_id\\\\\\\" UUID,\\\\n \\\\\\\"decision_reason\\\\\\\" TEXT,\\\\n \\\\\\\"supersedes_id\\\\\\\" UUID,\\\\n \\\\\\\"assessment_json\\\\\\\" TEXT,\\\\n \\\\\\\"recorded_at\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"attempt_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_attempts\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"request_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"request_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"source_revision_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_assessment_revisions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"decision_reason\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"supersedes_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_assessment_revisions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"assessment_json\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"recorded_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_assessment_revisions_tenant_id_attempt_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"attempt_id\\\",\\\"request_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_assessment_revisions_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_assessment_revisions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_assessment_revisions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_assessment_revisions_attempt_id_idx\\\",\\\"columns\\\":[\\\"attempt_id\\\"]},{\\\"name\\\":\\\"workbook_assessment_revisions_source_revision_id_idx\\\",\\\"columns\\\":[\\\"source_revision_id\\\"]},{\\\"name\\\":\\\"workbook_assessment_revisions_supersedes_id_idx\\\",\\\"columns\\\":[\\\"supersedes_id\\\"]}],\\\"version\\\":\\\"94b2bd33\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookFeedbackRelease\\\":{\\\"name\\\":\\\"workbookfeedbackrelease\\\",\\\"className\\\":\\\"WorkbookFeedbackRelease\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookFeedbackRelease\\\",\\\"collection\\\":\\\"workbookfeedbackreleases\\\",\\\"description\\\":\\\"Education-owned private workbook record. Mutations go through WorkbookService.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"attemptId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"WorkbookAttempt\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"revisionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"WorkbookAssessmentRevision\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"expectedHeadId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"WorkbookAssessmentRevision\\\",\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"requestKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"actorUserId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"recordedAt\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_feedback_releases\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"attempt_id\\\",\\\"request_key\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"WorkbookFeedbackRelease\\\",\\\"collectionExportName\\\":\\\"WorkbookFeedbackReleaseCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"attemptId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"revisionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_feedback_releases\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_feedback_releases\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"attempt_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"revision_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"expected_head_id\\\\\\\" UUID,\\\\n \\\\\\\"request_key\\\\\\\" TEXT,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"recorded_at\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"attempt_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_attempts\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"revision_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_assessment_revisions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"expected_head_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_assessment_revisions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"request_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"recorded_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_feedback_releases_tenant_id_attempt_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"attempt_id\\\",\\\"request_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_feedback_releases_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_feedback_releases_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_feedback_releases_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_feedback_releases_attempt_id_idx\\\",\\\"columns\\\":[\\\"attempt_id\\\"]},{\\\"name\\\":\\\"workbook_feedback_releases_revision_id_idx\\\",\\\"columns\\\":[\\\"revision_id\\\"]},{\\\"name\\\":\\\"workbook_feedback_releases_expected_head_id_idx\\\",\\\"columns\\\":[\\\"expected_head_id\\\"]}],\\\"version\\\":\\\"ebe23baf\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookFeedbackReleaseCollection\\\":{\\\"name\\\":\\\"workbookfeedbackreleasecollection\\\",\\\"className\\\":\\\"WorkbookFeedbackReleaseCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookFeedbackReleaseCollection\\\",\\\"collection\\\":\\\"workbookfeedbackreleases\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_feedback_releases\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"WorkbookFeedbackRelease\\\",\\\"exportName\\\":\\\"WorkbookFeedbackReleaseCollection\\\",\\\"collectionExportName\\\":\\\"WorkbookFeedbackReleaseCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_feedback_releases\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_feedback_releases\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"attempt_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"revision_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"expected_head_id\\\\\\\" UUID,\\\\n \\\\\\\"request_key\\\\\\\" TEXT,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"recorded_at\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"attempt_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_attempts\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"revision_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_assessment_revisions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"expected_head_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_assessment_revisions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"request_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"recorded_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_feedback_releases_tenant_id_attempt_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"attempt_id\\\",\\\"request_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_feedback_releases_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_feedback_releases_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_feedback_releases_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_feedback_releases_attempt_id_idx\\\",\\\"columns\\\":[\\\"attempt_id\\\"]},{\\\"name\\\":\\\"workbook_feedback_releases_revision_id_idx\\\",\\\"columns\\\":[\\\"revision_id\\\"]},{\\\"name\\\":\\\"workbook_feedback_releases_expected_head_id_idx\\\",\\\"columns\\\":[\\\"expected_head_id\\\"]}],\\\"version\\\":\\\"ebe23baf\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookFeedbackDelivery\\\":{\\\"name\\\":\\\"workbookfeedbackdelivery\\\",\\\"className\\\":\\\"WorkbookFeedbackDelivery\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookFeedbackDelivery\\\",\\\"collection\\\":\\\"workbookfeedbackdeliveries\\\",\\\"description\\\":\\\"Authenticated delivery acknowledgment; this does not assert comprehension.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"attemptId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"WorkbookAttempt\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"revisionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"WorkbookAssessmentRevision\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"actorUserId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"requestKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"recordedAt\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_feedback_deliveries\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"attempt_id\\\",\\\"actor_user_id\\\",\\\"revision_id\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"WorkbookFeedbackDelivery\\\",\\\"collectionExportName\\\":\\\"WorkbookFeedbackDeliveryCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"attemptId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"revisionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_feedback_deliveries\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_feedback_deliveries\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"attempt_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"revision_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"request_key\\\\\\\" TEXT,\\\\n \\\\\\\"recorded_at\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"attempt_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_attempts\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"revision_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_assessment_revisions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"request_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"recorded_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_feedback_deliveries_tenant_id_attempt_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"attempt_id\\\",\\\"actor_user_id\\\",\\\"revision_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_feedback_deliveries_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_feedback_deliveries_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_feedback_deliveries_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_feedback_deliveries_attempt_id_idx\\\",\\\"columns\\\":[\\\"attempt_id\\\"]},{\\\"name\\\":\\\"workbook_feedback_deliveries_revision_id_idx\\\",\\\"columns\\\":[\\\"revision_id\\\"]}],\\\"version\\\":\\\"37bfd434\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookFeedbackDeliveryCollection\\\":{\\\"name\\\":\\\"workbookfeedbackdeliverycollection\\\",\\\"className\\\":\\\"WorkbookFeedbackDeliveryCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookFeedbackDeliveryCollection\\\",\\\"collection\\\":\\\"workbookfeedbackdeliveries\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_feedback_deliveries\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"WorkbookFeedbackDelivery\\\",\\\"exportName\\\":\\\"WorkbookFeedbackDeliveryCollection\\\",\\\"collectionExportName\\\":\\\"WorkbookFeedbackDeliveryCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_feedback_deliveries\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_feedback_deliveries\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"attempt_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"revision_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"request_key\\\\\\\" TEXT,\\\\n \\\\\\\"recorded_at\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"attempt_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_attempts\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"revision_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_assessment_revisions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"request_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"recorded_at\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_feedback_deliveries_tenant_id_attempt_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"attempt_id\\\",\\\"actor_user_id\\\",\\\"revision_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_feedback_deliveries_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_feedback_deliveries_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_feedback_deliveries_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_feedback_deliveries_attempt_id_idx\\\",\\\"columns\\\":[\\\"attempt_id\\\"]},{\\\"name\\\":\\\"workbook_feedback_deliveries_revision_id_idx\\\",\\\"columns\\\":[\\\"revision_id\\\"]}],\\\"version\\\":\\\"37bfd434\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookPhotoIntake\\\":{\\\"name\\\":\\\"workbookphotointake\\\",\\\"className\\\":\\\"WorkbookPhotoIntake\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookPhotoIntake\\\",\\\"collection\\\":\\\"workbookphotointakes\\\",\\\"description\\\":\\\"Durable receipt before any course, enrollment or activity exists.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-photo-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"familyIntakeId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":false,\\\"related\\\":\\\"FamilyIntake\\\"},\\\"itemId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"actorUserId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"contentDigest\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false}},\\\"methods\\\":{\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_photo_intakes\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"item_id\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"WorkbookPhotoIntake\\\",\\\"collectionExportName\\\":\\\"WorkbookPhotoIntakeCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_photo_intakes\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_photo_intakes\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"family_intake_id\\\\\\\" UUID,\\\\n \\\\\\\"item_id\\\\\\\" TEXT,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"content_digest\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"family_intake_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"family_intakes\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"content_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_photo_intakes_tenant_id_item_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"item_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_photo_intakes_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_photo_intakes_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_photo_intakes_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_photo_intakes_family_intake_id_idx\\\",\\\"columns\\\":[\\\"family_intake_id\\\"]}],\\\"version\\\":\\\"288020f4\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookPhotoIntakeCollection\\\":{\\\"name\\\":\\\"workbookphotointakecollection\\\",\\\"className\\\":\\\"WorkbookPhotoIntakeCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookPhotoIntakeCollection\\\",\\\"collection\\\":\\\"workbookphotointakes\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-photo-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_photo_intakes\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"WorkbookPhotoIntake\\\",\\\"exportName\\\":\\\"WorkbookPhotoIntakeCollection\\\",\\\"collectionExportName\\\":\\\"WorkbookPhotoIntakeCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_photo_intakes\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_photo_intakes\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"family_intake_id\\\\\\\" UUID,\\\\n \\\\\\\"item_id\\\\\\\" TEXT,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"content_digest\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"family_intake_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"family_intakes\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"item_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"content_digest\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_photo_intakes_tenant_id_item_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"item_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_photo_intakes_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_photo_intakes_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_photo_intakes_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_photo_intakes_family_intake_id_idx\\\",\\\"columns\\\":[\\\"family_intake_id\\\"]}],\\\"version\\\":\\\"288020f4\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookPhotoAsset\\\":{\\\"name\\\":\\\"workbookphotoasset\\\",\\\"className\\\":\\\"WorkbookPhotoAsset\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookPhotoAsset\\\",\\\"collection\\\":\\\"workbookphotoassets\\\",\\\"description\\\":\\\"Sole owner join for original photo intake files.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-photo-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"intakeId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"WorkbookPhotoIntake\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"assetId\\\":{\\\"type\\\":\\\"crossPackageRef\\\",\\\"required\\\":false,\\\"related\\\":\\\"@happyvertical/smrt-assets:Asset\\\"},\\\"name\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"mimeType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sha256\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"position\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0}},\\\"methods\\\":{\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_photo_assets\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"intake_id\\\",\\\"asset_id\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"WorkbookPhotoAsset\\\",\\\"collectionExportName\\\":\\\"WorkbookPhotoAssetCollection\\\",\\\"displayLabelField\\\":\\\"name\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"intakeId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"position\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_photo_assets\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_photo_assets\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"intake_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"asset_id\\\\\\\" UUID,\\\\n \\\\\\\"name\\\\\\\" TEXT,\\\\n \\\\\\\"mime_type\\\\\\\" TEXT,\\\\n \\\\\\\"sha256\\\\\\\" TEXT,\\\\n \\\\\\\"position\\\\\\\" INTEGER NOT NULL DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"intake_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_photo_intakes\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"asset_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"mime_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"sha256\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"position\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_photo_assets_tenant_id_intake_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"intake_id\\\",\\\"asset_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_photo_assets_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_photo_assets_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_photo_assets_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_photo_assets_intake_id_idx\\\",\\\"columns\\\":[\\\"intake_id\\\"]},{\\\"name\\\":\\\"workbook_photo_assets_asset_id_idx\\\",\\\"columns\\\":[\\\"asset_id\\\"]}],\\\"version\\\":\\\"9d49acb2\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookPhotoAssetCollection\\\":{\\\"name\\\":\\\"workbookphotoassetcollection\\\",\\\"className\\\":\\\"WorkbookPhotoAssetCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookPhotoAssetCollection\\\",\\\"collection\\\":\\\"workbookphotoassets\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-photo-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_photo_assets\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"WorkbookPhotoAsset\\\",\\\"exportName\\\":\\\"WorkbookPhotoAssetCollection\\\",\\\"collectionExportName\\\":\\\"WorkbookPhotoAssetCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_photo_assets\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_photo_assets\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"intake_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"asset_id\\\\\\\" UUID,\\\\n \\\\\\\"name\\\\\\\" TEXT,\\\\n \\\\\\\"mime_type\\\\\\\" TEXT,\\\\n \\\\\\\"sha256\\\\\\\" TEXT,\\\\n \\\\\\\"position\\\\\\\" INTEGER NOT NULL DEFAULT 0\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"intake_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_photo_intakes\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"asset_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"name\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"mime_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"sha256\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"position\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_photo_assets_tenant_id_intake_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"intake_id\\\",\\\"asset_id\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_photo_assets_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_photo_assets_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_photo_assets_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_photo_assets_intake_id_idx\\\",\\\"columns\\\":[\\\"intake_id\\\"]},{\\\"name\\\":\\\"workbook_photo_assets_asset_id_idx\\\",\\\"columns\\\":[\\\"asset_id\\\"]}],\\\"version\\\":\\\"9d49acb2\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookPhotoDecision\\\":{\\\"name\\\":\\\"workbookphotodecision\\\",\\\"className\\\":\\\"WorkbookPhotoDecision\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookPhotoDecision\\\",\\\"collection\\\":\\\"workbookphotodecisions\\\",\\\"description\\\":\\\"Immutable provider/guardian/capture decision, retaining provenance and retry key.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-photo-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"intakeId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"WorkbookPhotoIntake\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"requestKey\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"sequence\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":true,\\\"default\\\":0},\\\"actorUserId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false},\\\"bodyJson\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}}},\\\"methods\\\":{\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_photo_decisions\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"intake_id\\\",\\\"request_key\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"WorkbookPhotoDecision\\\",\\\"collectionExportName\\\":\\\"WorkbookPhotoDecisionCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"intakeId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"sequence\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"integer\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_photo_decisions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_photo_decisions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"intake_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_key\\\\\\\" TEXT,\\\\n \\\\\\\"sequence\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"body_json\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"intake_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_photo_intakes\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"request_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"sequence\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"body_json\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_photo_decisions_tenant_id_intake_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"intake_id\\\",\\\"request_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_photo_decisions_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_photo_decisions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_photo_decisions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_photo_decisions_intake_id_idx\\\",\\\"columns\\\":[\\\"intake_id\\\"]}],\\\"version\\\":\\\"4c8b4e5f\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookPhotoDecisionCollection\\\":{\\\"name\\\":\\\"workbookphotodecisioncollection\\\",\\\"className\\\":\\\"WorkbookPhotoDecisionCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookPhotoDecisionCollection\\\",\\\"collection\\\":\\\"workbookphotodecisions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-photo-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_photo_decisions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"WorkbookPhotoDecision\\\",\\\"exportName\\\":\\\"WorkbookPhotoDecisionCollection\\\",\\\"collectionExportName\\\":\\\"WorkbookPhotoDecisionCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_photo_decisions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_photo_decisions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"intake_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"request_key\\\\\\\" TEXT,\\\\n \\\\\\\"sequence\\\\\\\" INTEGER NOT NULL DEFAULT 0,\\\\n \\\\\\\"actor_user_id\\\\\\\" TEXT,\\\\n \\\\\\\"body_json\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"intake_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_photo_intakes\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"request_key\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"sequence\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":0},\\\"actor_user_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"body_json\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_photo_decisions_tenant_id_intake_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"intake_id\\\",\\\"request_key\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"workbook_photo_decisions_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_photo_decisions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_photo_decisions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_photo_decisions_intake_id_idx\\\",\\\"columns\\\":[\\\"intake_id\\\"]}],\\\"version\\\":\\\"4c8b4e5f\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookContextRevision\\\":{\\\"name\\\":\\\"workbookcontextrevision\\\",\\\"className\\\":\\\"WorkbookContextRevision\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookContextRevision\\\",\\\"collection\\\":\\\"workbookcontextrevisions\\\",\\\"description\\\":\\\"Versioned contextual metadata; never edits Workbook identity or learning evidence.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-photo-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"learnerId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Learner\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"workbookId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Workbook\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"decisionId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"WorkbookPhotoDecision\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"metadataJson\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{}}},\\\"methods\\\":{\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_context_revisions\\\",\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"decision_id\\\"],\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"}},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"WorkbookContextRevision\\\",\\\"collectionExportName\\\":\\\"WorkbookContextRevisionCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"learnerId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"workbookId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"decisionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_context_revisions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_context_revisions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"workbook_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"decision_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"metadata_json\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"workbook_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbooks\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"decision_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_photo_decisions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"metadata_json\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_context_revisions_tenant_id_decision_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"decision_id\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"workbook_context_revisions_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_context_revisions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_context_revisions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_context_revisions_workbook_id_idx\\\",\\\"columns\\\":[\\\"workbook_id\\\"]},{\\\"name\\\":\\\"workbook_context_revisions_decision_id_idx\\\",\\\"columns\\\":[\\\"decision_id\\\"]}],\\\"version\\\":\\\"b1e8b4dc\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"},\\\"@happyvertical/smrt-education:WorkbookContextRevisionCollection\\\":{\\\"name\\\":\\\"workbookcontextrevisioncollection\\\",\\\"className\\\":\\\"WorkbookContextRevisionCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-education:WorkbookContextRevisionCollection\\\",\\\"collection\\\":\\\"workbookcontextrevisions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/education/src/workbook-photo-models.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-education\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"workbook_context_revisions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"WorkbookContextRevision\\\",\\\"exportName\\\":\\\"WorkbookContextRevisionCollection\\\",\\\"collectionExportName\\\":\\\"WorkbookContextRevisionCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"workbook_context_revisions\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"workbook_context_revisions\\\\\\\" (\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"tenant_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"learner_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"workbook_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"decision_id\\\\\\\" UUID NOT NULL,\\\\n \\\\\\\"metadata_json\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"learner_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"learners\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"workbook_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbooks\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"decision_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"workbook_photo_decisions\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"CASCADE\\\",\\\"onUpdate\\\":\\\"CASCADE\\\"}},\\\"metadata_json\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"workbook_context_revisions_tenant_id_decision_id_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"decision_id\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"workbook_context_revisions_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"workbook_context_revisions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"workbook_context_revisions_learner_id_idx\\\",\\\"columns\\\":[\\\"learner_id\\\"]},{\\\"name\\\":\\\"workbook_context_revisions_workbook_id_idx\\\",\\\"columns\\\":[\\\"workbook_id\\\"]},{\\\"name\\\":\\\"workbook_context_revisions_decision_id_idx\\\",\\\"columns\\\":[\\\"decision_id\\\"]}],\\\"version\\\":\\\"b1e8b4dc\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-education\\\"}},\\\"moduleType\\\":\\\"smrt\\\",\\\"recipes\\\":[{\\\"id\\\":\\\"education.catalog\\\",\\\"className\\\":\\\"EducationCatalogRecipe\\\",\\\"label\\\":\\\"Course catalog\\\",\\\"summary\\\":\\\"Organize courses, sections, lessons, and their authorized learning materials.\\\",\\\"synonyms\\\":[\\\"courses\\\",\\\"lessons\\\",\\\"curriculum catalog\\\"],\\\"models\\\":[\\\"@happyvertical/smrt-education:Course\\\",\\\"@happyvertical/smrt-education:CourseSection\\\",\\\"@happyvertical/smrt-education:Lesson\\\",\\\"@happyvertical/smrt-education:LessonAsset\\\"],\\\"nav\\\":[{\\\"label\\\":\\\"Courses\\\",\\\"model\\\":\\\"@happyvertical/smrt-education:Course\\\",\\\"icon\\\":\\\"folder\\\",\\\"description\\\":\\\"Courses available to this family.\\\",\\\"noun\\\":\\\"course\\\"}],\\\"requires\\\":[],\\\"section\\\":{\\\"id\\\":\\\"education\\\",\\\"label\\\":\\\"Education\\\",\\\"icon\\\":\\\"folder\\\",\\\"description\\\":\\\"Courses and lessons for learning.\\\"},\\\"help\\\":{\\\"markdown\\\":\\\"# Course catalog\\\\n\\\\nManage courses, their sections, and lessons. Private family copies and answer\\\\nkeys remain visible only through the application’s authorized catalog service.\\\\n\\\",\\\"fieldRefs\\\":[]},\\\"runtime\\\":\\\"both\\\",\\\"demo\\\":{\\\"mode\\\":\\\"server\\\",\\\"reasons\\\":[\\\"Needs a server because its package depends on @happyvertical/smrt-agents, @happyvertical/smrt-jobs, @happyvertical/smrt-profiles, @happyvertical/smrt-reports, @happyvertical/smrt-secrets, @happyvertical/smrt-tenancy, @happyvertical/smrt-users, which do not build for a browser (#3615, #3617, #3624, #3625, #3626, #3627).\\\"]}},{\\\"id\\\":\\\"education.learner\\\",\\\"className\\\":\\\"EducationLearnerRecipe\\\",\\\"label\\\":\\\"Learners\\\",\\\"summary\\\":\\\"Plan learner curricula and retain enrollment-scoped progress.\\\",\\\"synonyms\\\":[\\\"learners\\\",\\\"enrollments\\\",\\\"learning progress\\\"],\\\"models\\\":[\\\"@happyvertical/smrt-education:Learner\\\",\\\"@happyvertical/smrt-education:Curriculum\\\",\\\"@happyvertical/smrt-education:Enrollment\\\",\\\"@happyvertical/smrt-education:LessonProgress\\\"],\\\"nav\\\":[{\\\"label\\\":\\\"Learners\\\",\\\"model\\\":\\\"@happyvertical/smrt-education:Learner\\\",\\\"icon\\\":\\\"users\\\",\\\"description\\\":\\\"Authorized learners in this family.\\\",\\\"noun\\\":\\\"learner\\\"}],\\\"requires\\\":[],\\\"section\\\":{\\\"id\\\":\\\"education\\\",\\\"label\\\":\\\"Education\\\",\\\"icon\\\":\\\"folder\\\",\\\"description\\\":\\\"Courses and lessons for learning.\\\"},\\\"help\\\":{\\\"markdown\\\":\\\"# Learners\\\\n\\\\nUse `LearnerService` in an authenticated exact-tenant context to read a learner,\\\\nplan a curriculum as an authorized guardian, enroll in a visible course, and\\\\nstart a lesson. Recipe metadata does not expose model CRUD. Hosts authenticate\\\\nusers, provision family membership, and validate guardian ProfileRelationship\\\\ntypes and effective terms. See `agents/learner-service.md` for the boundary.\\\\n\\\",\\\"fieldRefs\\\":[]},\\\"runtime\\\":\\\"both\\\",\\\"demo\\\":{\\\"mode\\\":\\\"server\\\",\\\"reasons\\\":[\\\"Needs a server because its package depends on @happyvertical/smrt-agents, @happyvertical/smrt-jobs, @happyvertical/smrt-profiles, @happyvertical/smrt-reports, @happyvertical/smrt-secrets, @happyvertical/smrt-tenancy, @happyvertical/smrt-users, which do not build for a browser (#3615, #3617, #3624, #3625, #3626, #3627).\\\"]}}],\\\"smrtDependencies\\\":[\\\"@happyvertical/smrt-assets\\\",\\\"@happyvertical/smrt-core\\\",\\\"@happyvertical/smrt-ingestion\\\",\\\"@happyvertical/smrt-profiles\\\",\\\"@happyvertical/smrt-tenancy\\\",\\\"@happyvertical/smrt-users\\\"],\\\"browser\\\":{\\\"status\\\":\\\"server-only\\\",\\\"issues\\\":[\\\"#3615\\\",\\\"#3617\\\",\\\"#3624\\\",\\\"#3625\\\",\\\"#3626\\\",\\\"#3627\\\"],\\\"via\\\":[\\\"@happyvertical/smrt-agents\\\",\\\"@happyvertical/smrt-jobs\\\",\\\"@happyvertical/smrt-profiles\\\",\\\"@happyvertical/smrt-reports\\\",\\\"@happyvertical/smrt-secrets\\\",\\\"@happyvertical/smrt-tenancy\\\",\\\"@happyvertical/smrt-users\\\"]},\\\"stampsConstructors\\\":true}\"));\n","import type {\n CatalogAcquisitionCapabilityDecision,\n CatalogResourceRepresentation,\n CatalogSourceRecord,\n} from './catalog-contracts.js';\n\n/** Closed observed MIME mapping; icons and file names never establish a format. */\nexport const CATALOG_REPRESENTATION_MEDIA_TYPES = {\n pdf: 'application/pdf',\n zip: 'application/zip',\n docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n} as const;\n/** Bound and validate a complete Content-Type before retaining its canonical token. */\nexport function catalogRepresentationMediaType(value: string): string {\n const token = \"[!#$%&'*+.^_`|~0-9A-Za-z-]+\";\n const quoted = '\"(?:[\\\\x20-\\\\x21\\\\x23-\\\\x5b\\\\x5d-\\\\x7e]|\\\\\\\\[\\\\x20-\\\\x7e])*\"';\n const syntax = new RegExp(\n `^${token}/${token}(?:[ \\t]*;[ \\t]*${token}=(?:${token}|${quoted}))*[ \\t]*$`,\n );\n if (value.length > 512 || !syntax.test(value))\n throw new CatalogRepresentationError();\n return value.split(';', 1)[0].trim().toLowerCase();\n}\nexport function catalogRepresentationFormat(\n mediaType: string,\n): keyof typeof CATALOG_REPRESENTATION_MEDIA_TYPES | undefined {\n const token = catalogRepresentationMediaType(mediaType);\n return Object.entries(CATALOG_REPRESENTATION_MEDIA_TYPES).find(\n ([, mime]) => mime === token,\n )?.[0] as keyof typeof CATALOG_REPRESENTATION_MEDIA_TYPES | undefined;\n}\n\nexport class CatalogRepresentationError extends Error {\n readonly code = 'invalid-representation-metadata';\n constructor() {\n super('Catalog representation metadata is invalid.');\n this.name = 'CatalogRepresentationError';\n }\n}\nfunction object(value: unknown): Record<string, unknown> {\n if (!value || typeof value !== 'object' || Array.isArray(value))\n throw new CatalogRepresentationError();\n return value as Record<string, unknown>;\n}\nfunction keys(\n value: Record<string, unknown>,\n allowed: readonly string[],\n): void {\n if (Object.keys(value).some((key) => !allowed.includes(key)))\n throw new CatalogRepresentationError();\n}\nfunction positive(value: unknown): value is number {\n return typeof value === 'number' && Number.isSafeInteger(value) && value > 0;\n}\n\n/** Missing/null is legacy; malformed present data always throws, never becomes absence. */\nexport function normalizeCatalogRepresentation(\n value: unknown,\n): CatalogResourceRepresentation | undefined {\n if (value === undefined || value === null) return undefined;\n if (typeof value === 'string') {\n if (value.length > 4096) throw new CatalogRepresentationError();\n try {\n value = JSON.parse(value);\n } catch {\n throw new CatalogRepresentationError();\n }\n if (value === null) return undefined;\n }\n const record = object(value);\n keys(record, [\n 'format',\n 'mediaType',\n 'byteLength',\n 'validators',\n 'acquisition',\n ]);\n if (!positive(record.byteLength)) throw new CatalogRepresentationError();\n if (record.format === 'unknown') {\n if (\n record.mediaType !== null &&\n (typeof record.mediaType !== 'string' ||\n catalogRepresentationMediaType(record.mediaType) !== record.mediaType ||\n catalogRepresentationFormat(record.mediaType) !== undefined)\n )\n throw new CatalogRepresentationError();\n } else if (\n typeof record.format !== 'string' ||\n !Object.hasOwn(CATALOG_REPRESENTATION_MEDIA_TYPES, record.format) ||\n CATALOG_REPRESENTATION_MEDIA_TYPES[\n record.format as keyof typeof CATALOG_REPRESENTATION_MEDIA_TYPES\n ] !== record.mediaType\n )\n throw new CatalogRepresentationError();\n const validators = object(record.validators);\n keys(validators, ['etag', 'lastModified']);\n if (\n typeof validators.etag !== 'string' ||\n !/^\"[\\x21\\x23-\\x7e]{1,200}\"$/.test(validators.etag) ||\n typeof validators.lastModified !== 'string' ||\n validators.lastModified.length > 100 ||\n !Number.isFinite(Date.parse(validators.lastModified)) ||\n new Date(validators.lastModified).toUTCString() !== validators.lastModified\n )\n throw new CatalogRepresentationError();\n const capability = object(record.acquisition);\n keys(\n capability,\n record.format === 'unknown' ? ['status', 'reason'] : ['status', 'maxBytes'],\n );\n let acquisition: CatalogResourceRepresentation['acquisition'];\n if (record.format === 'unknown') {\n const reason =\n record.mediaType === null\n ? 'missing-content-type'\n : 'unrecognized-content-type';\n if (capability.status !== 'unknown-format' || capability.reason !== reason)\n throw new CatalogRepresentationError();\n acquisition = { status: 'unknown-format', reason };\n } else if (record.format !== 'pdf') {\n if (\n capability.status !== 'unsupported-format' ||\n capability.maxBytes !== undefined\n )\n throw new CatalogRepresentationError();\n acquisition = { status: 'unsupported-format' };\n } else {\n if (\n !positive(capability.maxBytes) ||\n (capability.status !== 'supported' &&\n capability.status !== 'size-limit') ||\n (capability.status === 'supported') !==\n record.byteLength <= capability.maxBytes\n )\n throw new CatalogRepresentationError();\n acquisition = {\n status: capability.status as 'supported' | 'size-limit',\n maxBytes: capability.maxBytes,\n };\n }\n return {\n format: record.format as CatalogResourceRepresentation['format'],\n mediaType: record.mediaType as CatalogResourceRepresentation['mediaType'],\n byteLength: record.byteLength,\n validators: {\n etag: validators.etag,\n lastModified: validators.lastModified,\n },\n acquisition,\n } as CatalogResourceRepresentation;\n}\n\n/** Read-only preselection guard for NEW downloads. It does not authorize legal use or pinned-byte printing. */\nexport function evaluateCatalogAcquisitionCapability(\n resource: Pick<CatalogSourceRecord, 'availableFormats' | 'representation'>,\n format: string,\n limits?: { maxBytes?: number },\n): CatalogAcquisitionCapabilityDecision {\n let representation: CatalogResourceRepresentation | undefined;\n try {\n representation = normalizeCatalogRepresentation(resource.representation);\n if (limits?.maxBytes !== undefined && !positive(limits.maxBytes))\n throw new CatalogRepresentationError();\n } catch {\n return { allowed: false, reason: 'invalid-representation-metadata' };\n }\n if (representation?.format === 'unknown')\n return {\n allowed: false,\n reason: 'unknown-format',\n byteLength: representation.byteLength,\n };\n if (\n !Array.isArray(resource.availableFormats) ||\n !resource.availableFormats.includes(format)\n )\n return { allowed: false, reason: 'format-unavailable' };\n if (!representation) return { allowed: true, verification: 'legacy' };\n if (representation.format !== format)\n return { allowed: false, reason: 'format-unavailable' };\n if (representation.acquisition.status === 'unsupported-format')\n return {\n allowed: false,\n reason: 'unsupported-format',\n byteLength: representation.byteLength,\n };\n const maxBytes = Math.min(\n representation.acquisition.maxBytes,\n limits?.maxBytes ?? representation.acquisition.maxBytes,\n );\n if (\n representation.acquisition.status === 'size-limit' ||\n representation.byteLength > maxBytes\n )\n return {\n allowed: false,\n reason: 'size-limit',\n maxBytes,\n byteLength: representation.byteLength,\n };\n return { allowed: true, verification: 'observed' };\n}\n","import type {\n CatalogActor,\n CatalogLicenseEvidence,\n CatalogOperation,\n CatalogSourceRecord,\n} from './catalog-contracts.js';\n\nexport interface CatalogPolicyDecision {\n allowed: boolean;\n reason?:\n | 'teacher-material'\n | 'unverified-license'\n | 'operation-not-permitted';\n}\n\n/** Server-side resource policy. UI affordances are advisory and cannot bypass it. */\nexport class CatalogPolicy {\n canView(\n record: Pick<CatalogSourceRecord, 'visibility'>,\n actor: CatalogActor,\n ): boolean {\n return record.visibility === 'catalog' || actor.roles.includes('teacher');\n }\n\n authorize(\n record: Pick<CatalogSourceRecord, 'visibility' | 'licenseEvidence'>,\n operation: CatalogOperation,\n actor: CatalogActor,\n ): CatalogPolicyDecision {\n if (!this.canView(record, actor))\n return { allowed: false, reason: 'teacher-material' };\n const evidence = record.licenseEvidence;\n if (!this.isVerified(evidence))\n return { allowed: false, reason: 'unverified-license' };\n if (!evidence.permittedOperations?.includes(operation))\n return { allowed: false, reason: 'operation-not-permitted' };\n return { allowed: true };\n }\n\n private isVerified(evidence: CatalogLicenseEvidence): boolean {\n return evidence.state === 'verified' && !!evidence.identifier?.trim();\n }\n}\n","import {\n evaluateCatalogAcquisitionCapability,\n normalizeCatalogRepresentation,\n} from './catalog-capability.js';\nimport type {\n CatalogAcquireAdapter,\n CatalogActor,\n CatalogOperation,\n CatalogSourceRecord,\n} from './catalog-contracts.js';\nimport { CatalogPolicy } from './catalog-policy.js';\n\nexport interface CatalogAcquisitionRecord {\n id: string;\n tenantId: string;\n resourceId: string;\n selectionId: string;\n revision: string;\n format: string;\n sha256: string;\n attribution?: string;\n notices?: string;\n}\n\nexport interface CatalogSelectionRecord {\n id: string;\n tenantId: string;\n resourceId: string;\n selectedRevision: string;\n}\n\nexport interface CatalogAcquisitionStore {\n getResource(\n resourceId: string,\n ): Promise<\n (CatalogSourceRecord & { id: string; withdrawnAt: Date | null }) | undefined\n >;\n getSelection(input: {\n tenantId: string;\n selectionId: string;\n }): Promise<CatalogSelectionRecord | undefined>;\n findAcquisition(input: {\n tenantId: string;\n resourceId: string;\n selectionId: string;\n revision: string;\n format: string;\n }): Promise<CatalogAcquisitionRecord | undefined>;\n createAcquisition(\n input: Omit<CatalogAcquisitionRecord, 'id'> & { bytes: Uint8Array },\n ): Promise<CatalogAcquisitionRecord>;\n}\n\nexport interface CatalogAcquisitionRequest {\n tenantId: string;\n actorUserId: string;\n roles: readonly string[];\n resourceId: string;\n selectionId: string;\n revision: string;\n format: string;\n operation: CatalogOperation;\n}\n\nasync function digest(bytes: Uint8Array): Promise<string> {\n const hash = await globalThis.crypto.subtle.digest('SHA-256', bytes);\n return Array.from(new Uint8Array(hash), (byte) =>\n byte.toString(16).padStart(2, '0'),\n ).join('');\n}\n\n/** Explicit, policy-gated selected-content acquisition. Catalog discovery has no route here. */\nexport class CatalogAcquisitionService {\n constructor(\n private readonly store: CatalogAcquisitionStore,\n private readonly adapter: CatalogAcquireAdapter,\n private readonly policy = new CatalogPolicy(),\n ) {}\n\n async acquire(\n request: CatalogAcquisitionRequest,\n ): Promise<CatalogAcquisitionRecord> {\n const actor: CatalogActor = {\n tenantId: request.tenantId,\n actorUserId: request.actorUserId,\n roles: request.roles,\n };\n if (!actor.tenantId.trim() || !actor.actorUserId.trim())\n throw new Error('Trusted tenant and actor identity are required.');\n const resource = await this.store.getResource(request.resourceId);\n if (!resource) throw new Error('Catalog resource was not found.');\n if (resource.withdrawnAt)\n throw new Error('Withdrawn catalog resource cannot be acquired.');\n if (resource.revision !== request.revision)\n throw new Error(\n 'Catalog resource revision is no longer current; reselect it.',\n );\n const selection = await this.store.getSelection({\n tenantId: actor.tenantId,\n selectionId: request.selectionId,\n });\n if (\n !selection ||\n selection.resourceId !== resource.id ||\n selection.selectedRevision !== request.revision\n )\n throw new Error(\n 'A matching tenant selection is required for acquisition.',\n );\n if (!resource.availableFormats?.includes(request.format))\n throw new Error('Requested content format is unavailable.');\n const decision = this.policy.authorize(resource, request.operation, actor);\n if (!decision.allowed)\n throw new Error(`Catalog acquisition denied: ${decision.reason}`);\n const existing = await this.store.findAcquisition({\n tenantId: actor.tenantId,\n resourceId: resource.id,\n selectionId: selection.id,\n revision: request.revision,\n format: request.format,\n });\n if (existing) return existing;\n const capability = evaluateCatalogAcquisitionCapability(\n resource,\n request.format,\n );\n if (!capability.allowed)\n throw new Error(`Catalog acquisition unavailable: ${capability.reason}`);\n const acquired = await this.adapter.acquire({\n providerId: resource.providerId,\n stableId: resource.stableId,\n revision: request.revision,\n format: request.format,\n });\n if (acquired.revision !== request.revision)\n throw new Error('Provider returned an unpinned resource revision.');\n const representation = normalizeCatalogRepresentation(\n resource.representation,\n );\n if (\n representation &&\n acquired.bytes.byteLength !== representation.byteLength\n )\n throw new Error(\n 'Acquired bytes differ from observed representation length.',\n );\n const actualHash = await digest(acquired.bytes);\n if (actualHash !== acquired.sha256.toLowerCase())\n throw new Error('Provider content hash did not match acquired bytes.');\n return await this.store.createAcquisition({\n tenantId: actor.tenantId,\n resourceId: resource.id,\n selectionId: selection.id,\n revision: request.revision,\n format: request.format,\n sha256: actualHash,\n attribution: resource.licenseEvidence.attribution,\n notices: resource.licenseEvidence.exceptions,\n bytes: acquired.bytes,\n });\n }\n}\n","import type { CatalogActor, CatalogSourceRecord } from './catalog-contracts.js';\nimport { CatalogPolicy } from './catalog-policy.js';\n\n/** Publisher preview permission is independent of original-resource permissions. */\nexport interface CatalogPreview {\n providerId: 'illustrative-mathematics';\n stableId: string;\n revision: string;\n /** Official publisher ImageFile identifier, never a caller-supplied URL. */\n reference: string;\n mediaType: 'image/png';\n width: number;\n height: number;\n byteLength: number;\n sha256: string;\n alt: string;\n rights: {\n state: 'verified';\n identifier: 'CC-BY-4.0';\n sourceUrl: string;\n attribution: string;\n retrievedAt: string;\n expiresAt?: string;\n };\n}\n\nexport const CATALOG_PREVIEW_MAX_BYTES = 2 * 1024 * 1024;\nexport const CATALOG_PREVIEW_MAX_DIMENSION = 4096;\n\n/** Parse persisted/untrusted optional metadata. Invalid metadata is unavailable. */\nexport function normalizeCatalogPreview(\n value: unknown,\n): CatalogPreview | undefined {\n try {\n const x = (\n typeof value === 'string' ? JSON.parse(value) : value\n ) as CatalogPreview;\n if (\n !x ||\n x.providerId !== 'illustrative-mathematics' ||\n typeof x.stableId !== 'string' ||\n !x.stableId ||\n x.stableId.length > 1000 ||\n typeof x.revision !== 'string' ||\n !x.revision ||\n x.revision.length > 1000 ||\n typeof x.reference !== 'string' ||\n !/^[a-zA-Z0-9]{20,64}$/.test(x.reference) ||\n x.mediaType !== 'image/png' ||\n !Number.isSafeInteger(x.byteLength) ||\n x.byteLength < 24 ||\n x.byteLength > CATALOG_PREVIEW_MAX_BYTES ||\n ![x.width, x.height].every(\n (n) =>\n Number.isSafeInteger(n) &&\n n > 0 &&\n n <= CATALOG_PREVIEW_MAX_DIMENSION,\n ) ||\n typeof x.sha256 !== 'string' ||\n !/^[a-f0-9]{64}$/.test(x.sha256) ||\n typeof x.alt !== 'string' ||\n !x.alt ||\n x.alt.length > 2000 ||\n x.rights?.state !== 'verified' ||\n x.rights.identifier !== 'CC-BY-4.0' ||\n typeof x.rights.attribution !== 'string' ||\n !x.rights.attribution ||\n x.rights.attribution.length > 4000 ||\n typeof x.rights.sourceUrl !== 'string' ||\n typeof x.rights.retrievedAt !== 'string' ||\n !Number.isFinite(Date.parse(x.rights.retrievedAt)) ||\n (x.rights.expiresAt !== undefined &&\n (typeof x.rights.expiresAt !== 'string' ||\n !Number.isFinite(Date.parse(x.rights.expiresAt))))\n )\n return undefined;\n const source = new URL(x.rights.sourceUrl);\n if (\n source.origin !== 'https://im.kendallhunt.com' ||\n source.search ||\n source.hash ||\n source.username ||\n source.password ||\n !/^\\/k5(?:_es)?\\/families\\/(kindergarten|grade-[1-5])\\/unit-[1-9][0-9]?\\/family-materials\\.html$/.test(\n source.pathname,\n )\n )\n return undefined;\n // Explicit projection prevents unknown fields (including URLs/tokens) escaping.\n return {\n providerId: x.providerId,\n stableId: x.stableId,\n revision: x.revision,\n reference: x.reference,\n mediaType: x.mediaType,\n width: x.width,\n height: x.height,\n byteLength: x.byteLength,\n sha256: x.sha256,\n alt: x.alt,\n rights: {\n state: 'verified',\n identifier: 'CC-BY-4.0',\n sourceUrl: source.href,\n attribution: x.rights.attribution,\n retrievedAt: x.rights.retrievedAt,\n ...(x.rights.expiresAt ? { expiresAt: x.rights.expiresAt } : {}),\n },\n };\n } catch {\n return undefined;\n }\n}\n\n/** Exact source/revision binding; expired or corrupt references are unavailable. */\nexport function catalogPreviewFor(\n record: Pick<\n CatalogSourceRecord,\n 'providerId' | 'stableId' | 'revision' | 'preview'\n >,\n now = Date.now(),\n): CatalogPreview | undefined {\n const preview = normalizeCatalogPreview(record.preview);\n return preview &&\n preview.providerId === record.providerId &&\n preview.stableId === record.stableId &&\n preview.revision === record.revision &&\n (!preview.rights.expiresAt || Date.parse(preview.rights.expiresAt) > now)\n ? preview\n : undefined;\n}\n\n/** Verify complete bounded static 8-bit RGB/RGBA PNG data; never transform originals. */\nexport function catalogPreviewPngDimensions(bytes: Uint8Array): {\n width: number;\n height: number;\n} {\n // Like core's manifest Node host, resolve built-ins only when the server\n // capability is invoked; metadata/model imports must remain browser-safe.\n const host = (\n typeof process === 'undefined'\n ? undefined\n : process.getBuiltinModule?.('node:zlib')\n ) as typeof import('node:zlib') | undefined;\n if (!host)\n throw new Error('Catalog preview verification requires a Node host.');\n const { crc32, inflateSync } = host;\n if (\n bytes.length < 24 ||\n bytes.length > CATALOG_PREVIEW_MAX_BYTES ||\n ![137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82].every(\n (n, i) => bytes[i] === n,\n )\n )\n throw new Error('Invalid catalog preview PNG.');\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n const width = view.getUint32(16),\n height = view.getUint32(20);\n if (\n ![width, height].every((n) => n > 0 && n <= CATALOG_PREVIEW_MAX_DIMENSION)\n )\n throw new Error('Catalog preview dimensions exceed bounds.');\n // Keep the supported subset explicit. Other encodings remain unavailable.\n const channels = bytes[25] === 2 ? 3 : bytes[25] === 6 ? 4 : 0;\n if (\n bytes.length < 45 ||\n bytes[24] !== 8 ||\n !channels ||\n bytes[26] !== 0 ||\n bytes[27] !== 0 ||\n bytes[28] !== 0\n )\n throw new Error('Unsupported catalog preview PNG encoding.');\n const compressed: Uint8Array[] = [];\n let offset = 8;\n let ended = false;\n let idatEnded = false;\n while (offset + 12 <= bytes.length) {\n const length = view.getUint32(offset);\n if (length > bytes.length - offset - 12)\n throw new Error('Truncated catalog preview PNG chunk.');\n const type = String.fromCharCode(...bytes.subarray(offset + 4, offset + 8));\n const end = offset + 12 + length;\n if (\n !/^[a-zA-Z]{2}[A-Z][a-zA-Z]$/.test(type) ||\n crc32(bytes.subarray(offset + 4, end - 4)) !== view.getUint32(end - 4)\n )\n throw new Error('Invalid catalog preview PNG chunk.');\n if (type === 'IHDR') {\n if (offset !== 8 || length !== 13)\n throw new Error('Invalid catalog preview PNG header.');\n } else if (type === 'IDAT') {\n if (idatEnded)\n throw new Error('Invalid catalog preview PNG image ordering.');\n compressed.push(bytes.subarray(offset + 8, end - 4));\n } else {\n if (compressed.length) idatEnded = true;\n if (type === 'IEND') {\n if (length || end !== bytes.length)\n throw new Error('Invalid catalog preview PNG ending.');\n ended = true;\n } else if (type === 'PLTE') {\n if (compressed.length || !length || length > 768 || length % 3)\n throw new Error('Invalid catalog preview PNG palette.');\n } else if (/^[A-Z]/.test(type) || ['acTL', 'fcTL', 'fdAT'].includes(type))\n throw new Error('Unsupported catalog preview PNG chunk.');\n }\n offset = end;\n }\n if (!ended || offset !== bytes.length || !compressed.length)\n throw new Error('Incomplete catalog preview PNG.');\n const stride = width * channels + 1;\n const raw = inflateSync(Buffer.concat(compressed), {\n maxOutputLength: stride * height,\n });\n if (raw.length !== stride * height)\n throw new Error('Invalid catalog preview PNG pixel data.');\n for (let row = 0; row < height; row++)\n if (raw[row * stride] > 4)\n throw new Error('Invalid catalog preview PNG filter.');\n return { width, height };\n}\n\nexport interface CatalogPreviewStore {\n /** Must read through the active actor/tenant-bound executor, never a global write bypass. */\n getResource(\n id: string,\n actor: CatalogActor,\n ): Promise<\n | (CatalogSourceRecord & { id: string; withdrawnAt?: string | null })\n | undefined\n >;\n /** Recheck live session, tenant membership and resource access on EVERY read, including cache hits. */\n authorize(\n actor: CatalogActor,\n resource: CatalogSourceRecord & { id: string },\n ): Promise<boolean>;\n}\nexport interface CatalogPreviewLoader {\n /** Preview-only bytes, bounded by CATALOG_PREVIEW_MAX_BYTES; never acquire the original. */\n loadPreview(preview: CatalogPreview): Promise<Uint8Array>;\n}\n\n/** Authorized serving of public publisher previews with a bounded, short-lived verified-byte cache. */\nexport class CatalogPreviewService {\n private readonly cache = new Map<\n string,\n { bytes: Uint8Array; until: number; width: number; height: number }\n >();\n private cacheBytes = 0;\n constructor(\n private readonly store: CatalogPreviewStore,\n private readonly loader: CatalogPreviewLoader,\n ) {}\n\n async serve(input: {\n actor: CatalogActor;\n resourceId: string;\n revision: string;\n }): Promise<Response> {\n const unavailable = () =>\n new Response(null, {\n status: 404,\n headers: { 'cache-control': 'no-store' },\n });\n const { actor } = input;\n if (!actor.tenantId?.trim() || !actor.actorUserId?.trim())\n return unavailable();\n const record = await this.store.getResource(input.resourceId, actor);\n if (\n !record ||\n record.id !== input.resourceId ||\n record.withdrawnAt ||\n record.revision !== input.revision ||\n !new CatalogPolicy().canView(record, actor) ||\n (await this.store.authorize(actor, record)) !== true\n )\n return unavailable();\n const preview = catalogPreviewFor(record);\n if (!preview) return unavailable();\n const key = preview.sha256;\n const now = Date.now();\n for (const [id, entry] of this.cache)\n if (entry.until <= now) {\n this.cache.delete(id);\n this.cacheBytes -= entry.bytes.length;\n }\n const cached = this.cache.get(key);\n if (\n cached &&\n (cached.bytes.length !== preview.byteLength ||\n cached.width !== preview.width ||\n cached.height !== preview.height)\n )\n return unavailable();\n let bytes = cached?.bytes;\n if (!bytes) {\n try {\n bytes = await this.loader.loadPreview(preview);\n const dimensions = catalogPreviewPngDimensions(bytes);\n const hash = Buffer.from(\n await globalThis.crypto.subtle.digest(\n 'SHA-256',\n Uint8Array.from(bytes),\n ),\n ).toString('hex');\n if (\n bytes.length !== preview.byteLength ||\n dimensions.width !== preview.width ||\n dimensions.height !== preview.height ||\n hash !== preview.sha256\n )\n return unavailable();\n if (!catalogPreviewFor(record)) return unavailable();\n bytes = Uint8Array.from(bytes);\n // Another miss may have populated this key while loading/hash-checking.\n const replaced = this.cache.get(key);\n if (replaced) {\n this.cache.delete(key);\n this.cacheBytes -= replaced.bytes.length;\n }\n while (this.cacheBytes + bytes.length > 16 * 1024 * 1024) {\n const first = this.cache.entries().next().value;\n if (!first) break;\n this.cache.delete(first[0]);\n this.cacheBytes -= first[1].bytes.length;\n }\n this.cache.set(key, {\n bytes,\n ...dimensions,\n until: Math.min(\n now + 60_000,\n preview.rights.expiresAt\n ? Date.parse(preview.rights.expiresAt)\n : Infinity,\n ),\n });\n this.cacheBytes += bytes.length;\n } catch {\n return unavailable();\n }\n }\n if (!catalogPreviewFor(record)) return unavailable();\n return new Response(Uint8Array.from(bytes), {\n headers: {\n 'content-type': 'image/png',\n 'content-length': String(bytes.length),\n 'cache-control': 'private, no-store',\n 'x-content-type-options': 'nosniff',\n 'content-security-policy': \"default-src 'none'; sandbox\",\n },\n });\n }\n}\n","import { field, foreignKey, SmrtObject, smrt } from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport { normalizeCatalogRepresentation } from './catalog-capability.js';\nimport type {\n CatalogLicenseState,\n CatalogResourceRepresentation,\n CatalogVisibility,\n} from './catalog-contracts.js';\nimport {\n type CatalogPreview,\n normalizeCatalogPreview,\n} from './catalog-preview.js';\n\nconst closed = { api: false, mcp: false, cli: false } as const;\n\n/** Globally visible provider registration. Hosts configure adapters and credentials out of band. */\n@smrt({ ...closed })\nexport class CatalogProvider extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-education\";\n @field({ required: true }) providerId = '';\n @field({ required: true }) name = '';\n active = true;\n}\n\n/** A provider-native record. Rows are intentionally not merged across providers. */\n@smrt({ ...closed })\nexport class CatalogResource extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-education\";\n @field({ required: true }) providerId = '';\n @field({ required: true }) stableId = '';\n @field({ required: true }) revision = '';\n canonicalUrl = '';\n @field({ required: true }) title = '';\n suppliedDescription = '';\n author = '';\n subjects = '[]';\n grades = '{}';\n language = '';\n resourceType = '';\n parentStableId = '';\n availableFormats = '[]';\n /** Serialized observed representation; JSON null is legacy absence. */\n representation = 'null';\n /** Exact revision-bound publisher preview, not an original or private asset grant. */\n preview = 'null';\n\n getPreview(): CatalogPreview | undefined {\n return normalizeCatalogPreview(this.preview);\n }\n setPreview(value: CatalogPreview | undefined): void {\n if (value !== undefined && !normalizeCatalogPreview(value))\n throw new Error('Invalid catalog preview metadata.');\n this.preview = JSON.stringify(normalizeCatalogPreview(value) ?? null);\n }\n\n getRepresentation(): CatalogResourceRepresentation | undefined {\n return normalizeCatalogRepresentation(this.representation);\n }\n setRepresentation(value: CatalogResourceRepresentation | undefined): void {\n this.representation = JSON.stringify(\n normalizeCatalogRepresentation(value) ?? null,\n );\n }\n licenseEvidence = '{}';\n licenseState: CatalogLicenseState = 'unknown';\n visibility: CatalogVisibility = 'catalog';\n /** Last durable enumeration generation that observed this provider record. */\n lastSeenRunId = '';\n withdrawnAt = '';\n}\n\n/** Durable per-provider enumeration state. A failed or partial feed is never complete. */\n@smrt({ ...closed })\nexport class CatalogSyncState extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-education\";\n /** Provider-owned stable key, not an internal provider row ID. */\n @field({ required: true }) providerId = '';\n cursor = '';\n /** Persists across interrupted pages so terminal withdrawal is safe on resume. */\n runId = '';\n complete = false;\n paused = false;\n pauseReason = '';\n importedCount = 0;\n failures = '[]';\n lastSuccessfulAt = '';\n}\n\n/** Tenant-owned intent to use a metadata record, distinct from acquiring bytes. */\n@TenantScoped({ mode: 'required' })\n@smrt({ ...closed })\nexport class CatalogSelection extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-education\";\n @tenantId() tenantId = '';\n @foreignKey('CatalogResource', { required: true }) resourceId = '';\n @field({ required: true }) selectedByUserId = '';\n @field({ required: true }) selectedRevision = '';\n}\n\n/** A pinned, tenant-owned acquisition record. Bytes belong in a host storage service. */\n@TenantScoped({ mode: 'required' })\n@smrt({ ...closed })\nexport class CatalogAcquisition extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-education\";\n @tenantId() tenantId = '';\n @foreignKey('CatalogResource', { required: true }) resourceId = '';\n @foreignKey('CatalogSelection', { required: true }) selectionId = '';\n @field({ required: true }) revision = '';\n @field({ required: true }) format = '';\n @field({ required: true }) sha256 = '';\n attribution = '';\n notices = '';\n}\n","import { SmrtCollection } from '@happyvertical/smrt-core';\nimport {\n CatalogAcquisition,\n CatalogProvider,\n CatalogResource,\n CatalogSelection,\n CatalogSyncState,\n} from './catalog-models.js';\n\nexport class CatalogProviderCollection extends SmrtCollection<CatalogProvider> {\n static readonly _itemClass = CatalogProvider;\n}\nexport class CatalogResourceCollection extends SmrtCollection<CatalogResource> {\n static readonly _itemClass = CatalogResource;\n}\nexport class CatalogSyncStateCollection extends SmrtCollection<CatalogSyncState> {\n static readonly _itemClass = CatalogSyncState;\n}\nexport class CatalogSelectionCollection extends SmrtCollection<CatalogSelection> {\n static readonly _itemClass = CatalogSelection;\n}\nexport class CatalogAcquisitionCollection extends SmrtCollection<CatalogAcquisition> {\n static readonly _itemClass = CatalogAcquisition;\n}\n","import type { DatabaseInterface } from '@happyvertical/sql';\nimport { normalizeCatalogRepresentation } from './catalog-capability.js';\nimport {\n CatalogResourceCollection,\n CatalogSyncStateCollection,\n} from './catalog-collections.js';\nimport type {\n CatalogSourceRecord,\n CatalogSyncCheckpoint,\n} from './catalog-contracts.js';\nimport { catalogPreviewFor } from './catalog-preview.js';\nimport type { CatalogSyncStore } from './catalog-sync-service.js';\n\nfunction json(value: unknown): string {\n return JSON.stringify(value ?? null);\n}\n\nfunction checkpoint(row: {\n providerId: string;\n runId: string;\n cursor: string;\n complete: boolean;\n paused: boolean;\n pauseReason: string;\n importedCount: number;\n failures: string;\n lastSuccessfulAt: string;\n}): CatalogSyncCheckpoint {\n let failures: CatalogSyncCheckpoint['failures'] = [];\n try {\n const parsed: unknown = JSON.parse(row.failures);\n if (Array.isArray(parsed)) failures = parsed as typeof failures;\n } catch {\n // A corrupt historical failure ledger stays visible as an incomplete run.\n failures = [\n {\n code: 'invalid-failure-ledger',\n message: 'Stored failure ledger is invalid.',\n },\n ];\n }\n return {\n providerId: row.providerId,\n ...(row.runId ? { runId: row.runId } : {}),\n ...(row.cursor ? { cursor: row.cursor } : {}),\n complete: row.complete,\n ...(row.paused ? { paused: true } : {}),\n ...(row.pauseReason ? { pauseReason: row.pauseReason } : {}),\n importedCount: row.importedCount,\n failures,\n ...(row.lastSuccessfulAt ? { lastSuccessfulAt: row.lastSuccessfulAt } : {}),\n };\n}\n\n/** Default durable store for metadata-only provider synchronization. */\nexport class CatalogDatabaseSyncStore implements CatalogSyncStore {\n constructor(private readonly db: DatabaseInterface) {}\n\n async getCheckpoint(\n providerId: string,\n ): Promise<CatalogSyncCheckpoint | undefined> {\n const states = await CatalogSyncStateCollection.create({ db: this.db });\n const rows = await states.list({ where: { providerId }, limit: 2 });\n if (rows.length > 1)\n throw new Error('Catalog provider has ambiguous sync state.');\n return rows[0] ? checkpoint(rows[0]) : undefined;\n }\n\n async saveCheckpoint(value: CatalogSyncCheckpoint): Promise<void> {\n const states = await CatalogSyncStateCollection.create({ db: this.db });\n const rows = await states.list({\n where: { providerId: value.providerId },\n limit: 2,\n });\n if (rows.length > 1)\n throw new Error('Catalog provider has ambiguous sync state.');\n const fields = {\n providerId: value.providerId,\n runId: value.runId ?? '',\n cursor: value.cursor ?? '',\n complete: value.complete,\n paused: value.paused ?? false,\n pauseReason: value.pauseReason ?? '',\n importedCount: value.importedCount,\n failures: json(value.failures),\n lastSuccessfulAt: value.lastSuccessfulAt ?? '',\n };\n if (rows[0]) {\n Object.assign(rows[0], fields);\n await rows[0].save();\n } else await states.create(fields);\n }\n\n async upsert(record: CatalogSourceRecord, runId: string): Promise<void> {\n const resources = await CatalogResourceCollection.create({ db: this.db });\n const rows = await resources.list({\n where: { providerId: record.providerId, stableId: record.stableId },\n limit: 2,\n });\n if (rows.length > 1)\n throw new Error('Catalog provider record identity is ambiguous.');\n // Retain valid historical evidence even after expiry; read/serve decide availability.\n let preview = catalogPreviewFor(record, Number.NEGATIVE_INFINITY);\n if (record.preview !== undefined && !preview)\n throw new Error('Invalid catalog preview metadata.');\n const previousPreview = rows[0]?.getPreview();\n if (rows[0]?.revision === record.revision && previousPreview) {\n if (\n !preview ||\n JSON.stringify({\n ...preview,\n rights: {\n ...preview.rights,\n retrievedAt: previousPreview.rights.retrievedAt,\n },\n }) !== JSON.stringify(previousPreview)\n )\n throw new Error(\n 'Catalog preview is immutable within a source revision.',\n );\n preview = previousPreview;\n }\n const fields = {\n providerId: record.providerId,\n stableId: record.stableId,\n revision: record.revision,\n canonicalUrl: record.canonicalUrl,\n title: record.title,\n suppliedDescription: record.suppliedDescription ?? '',\n author: record.author ?? '',\n subjects: json(record.subjects ?? []),\n grades: json(record.gradeRange ?? {}),\n language: record.language ?? '',\n resourceType: record.resourceType ?? '',\n parentStableId: record.parentStableId ?? '',\n availableFormats: json(record.availableFormats ?? []),\n representation: json(\n normalizeCatalogRepresentation(record.representation),\n ),\n preview: json(preview),\n licenseEvidence: json(record.licenseEvidence),\n licenseState: record.licenseEvidence.state,\n visibility: record.visibility,\n lastSeenRunId: runId,\n withdrawnAt: '',\n };\n if (rows[0]) {\n Object.assign(rows[0], fields);\n await rows[0].save();\n } else await resources.create(fields);\n }\n\n async withdrawUnseen(providerId: string, runId: string): Promise<number> {\n const resources = await CatalogResourceCollection.create({ db: this.db });\n const rows = await resources.list({ where: { providerId } });\n const timestamp = new Date().toISOString();\n let withdrawn = 0;\n for (const row of rows) {\n if (row.lastSeenRunId === runId || row.withdrawnAt) continue;\n row.withdrawnAt = timestamp;\n await row.save();\n withdrawn++;\n }\n return withdrawn;\n }\n}\n","import { getCurrentTenant } from '@happyvertical/smrt-tenancy';\nimport type { DatabaseInterface } from '@happyvertical/sql';\nimport type { CatalogAcquisitionRecord } from './catalog-acquisition-service.js';\nimport type { CatalogActor, CatalogSourceRecord } from './catalog-contracts.js';\nimport { CatalogPolicy } from './catalog-policy.js';\nimport {\n CourseSectionCollection,\n ExternalCourseCollection,\n LessonAssetCollection,\n ReadingCollection,\n WorksheetCollection,\n} from './collections.js';\nimport type { LearnerRequest } from './learner-service.js';\n\nexport interface CatalogMaterializationStore {\n getResource(\n resourceId: string,\n ): Promise<\n (CatalogSourceRecord & { id: string; withdrawnAt: Date | null }) | undefined\n >;\n getAcquisition(input: {\n tenantId: string;\n acquisitionId: string;\n }): Promise<CatalogAcquisitionRecord | undefined>;\n}\n\n/** Host-owned copy operation; it must retain the pinned bytes and prove a private Asset capability. */\nexport interface CatalogMaterializationStorage {\n ensurePrivateAsset(input: {\n tenantId: string;\n actorUserId: string;\n acquisition: CatalogAcquisitionRecord;\n name: string;\n }): Promise<{ assetId: string }>;\n}\n\nexport interface CatalogEnrollmentPort {\n enroll(\n input: LearnerRequest & { curriculumId: string; courseId: string },\n ): Promise<{\n id: string;\n }>;\n}\n\nexport interface CatalogMaterializationRequest {\n tenantId: string;\n actorUserId: string;\n acquisitionId: string;\n /** Required when provider metadata does not classify a subject. */\n subject?: string;\n courseTitle?: string;\n lessonTitle?: string;\n curriculumId?: string;\n learnerId?: string;\n guardianRelationshipId?: string;\n}\n\n/** Host derives this from current memberships and guardian terms; callers never supply roles. */\nexport type CatalogMaterializationAuthorizer = (input: {\n tenantId: string;\n actorUserId: string;\n executor: DatabaseInterface;\n action: 'education.catalog.materialize';\n}) => Promise<Readonly<{ allowed: boolean; roles: readonly string[] }>>;\n\nexport interface CatalogMaterializationResult {\n courseId: string;\n lessonId: string;\n assetId: string;\n revision: string;\n sha256: string;\n enrollmentId?: string;\n}\n\nasync function identity(...parts: string[]): Promise<string> {\n const digest = await globalThis.crypto.subtle.digest(\n 'SHA-256',\n new TextEncoder().encode(\n JSON.stringify(['smrt.education.catalog.v1', ...parts]),\n ),\n );\n const hex = Array.from(new Uint8Array(digest), (byte) =>\n byte.toString(16).padStart(2, '0'),\n ).join('');\n return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-5${hex.slice(13, 16)}-a${hex.slice(17, 20)}-${hex.slice(20, 32)}`;\n}\n\n/** Both adapter file extensions and MIME media types preserve PDF layout. */\nexport function isPrintableAcquisitionFormat(format: string): boolean {\n return format === 'pdf' || format === 'application/pdf';\n}\n\n/** Creates a private course from an already-authorized, pinned acquisition. */\nexport class CatalogMaterializationService {\n constructor(\n private readonly db: DatabaseInterface,\n private readonly store: CatalogMaterializationStore,\n private readonly storage: CatalogMaterializationStorage,\n private readonly learner: CatalogEnrollmentPort | undefined,\n private readonly authorize: CatalogMaterializationAuthorizer,\n private readonly policy = new CatalogPolicy(),\n ) {}\n\n async materialize(\n request: CatalogMaterializationRequest,\n ): Promise<CatalogMaterializationResult> {\n const active = getCurrentTenant();\n if (\n !request.tenantId?.trim() ||\n !request.actorUserId?.trim() ||\n active?.tenantId !== request.tenantId ||\n active.userId !== request.actorUserId ||\n active.superAdminBypass\n )\n throw new Error('Trusted active tenant and actor identity are required.');\n const authorization = await this.authorize({\n tenantId: request.tenantId,\n actorUserId: request.actorUserId,\n executor: this.db,\n action: 'education.catalog.materialize',\n });\n if (!authorization.allowed || !authorization.roles.includes('guardian'))\n throw new Error('Active guardian authorization is required.');\n const actor: CatalogActor = {\n tenantId: request.tenantId,\n actorUserId: request.actorUserId,\n roles: authorization.roles,\n };\n const acquisition = await this.store.getAcquisition({\n tenantId: actor.tenantId,\n acquisitionId: request.acquisitionId,\n });\n if (!acquisition || acquisition.tenantId !== actor.tenantId)\n throw new Error('Pinned tenant acquisition was not found.');\n const resource = await this.store.getResource(acquisition.resourceId);\n if (!resource || resource.revision !== acquisition.revision)\n throw new Error('Pinned catalog resource revision was not found.');\n if (resource.withdrawnAt)\n throw new Error('Withdrawn catalog resource cannot be materialized.');\n // A teacher may inspect restricted metadata, but this learner-material\n // workflow never promotes it into a course, printable, or asset link.\n if (resource.visibility === 'teacher')\n throw new Error(\n 'Teacher-only material cannot be materialized for learners.',\n );\n const operation = isPrintableAcquisitionFormat(acquisition.format)\n ? 'print'\n : 'download';\n const decision = this.policy.authorize(resource, operation, actor);\n if (!decision.allowed)\n throw new Error(`Current catalog license does not permit ${operation}.`);\n const subject =\n resource.subjects?.find((value) => value.trim()) ??\n request.subject?.trim();\n if (!subject)\n throw new Error('Guardian subject classification is required.');\n const courseId = await identity(\n actor.tenantId,\n resource.providerId,\n resource.stableId,\n );\n const sectionId = await identity(courseId, 'materials');\n const lessonId = await identity(\n courseId,\n acquisition.revision,\n acquisition.format,\n );\n const asset = await this.storage.ensurePrivateAsset({\n tenantId: actor.tenantId,\n actorUserId: actor.actorUserId,\n acquisition,\n name: request.lessonTitle?.trim() || resource.title,\n });\n if (!asset.assetId)\n throw new Error('Materialized private asset is required.');\n if (!this.db.transaction)\n throw new Error('Catalog materialization requires a transaction.');\n await this.db.transaction(async (tx) => {\n const courses = await ExternalCourseCollection.create({ db: tx });\n const sections = await CourseSectionCollection.create({ db: tx });\n const readings = await ReadingCollection.create({ db: tx });\n const worksheets = await WorksheetCollection.create({ db: tx });\n const assets = await LessonAssetCollection.create({ db: tx });\n const course = await courses.get(courseId);\n if (course) {\n if (\n course.tenantId !== actor.tenantId ||\n course.sourceKey !== resource.providerId ||\n course.sourceRef !== resource.stableId ||\n course.licenseKind !== 'personal-use-copy'\n )\n throw new Error(\n 'Existing materialized course ownership cannot change.',\n );\n } else {\n await courses.create({\n id: courseId,\n tenantId: actor.tenantId,\n title: request.courseTitle?.trim() || resource.title,\n subject,\n sourceKey: resource.providerId,\n sourceRef: resource.stableId,\n sourceUrl: resource.canonicalUrl,\n license: resource.licenseEvidence.identifier ?? '',\n licenseKind: 'personal-use-copy',\n licenseNote: [\n resource.licenseEvidence.attribution,\n acquisition.sha256,\n ]\n .filter(Boolean)\n .join('\\n'),\n status: 'draft',\n });\n }\n if (!(await sections.get(sectionId)))\n await sections.create({\n id: sectionId,\n tenantId: actor.tenantId,\n courseId,\n title: 'Materials',\n sortOrder: 0,\n });\n // Acquisition formats are MIME types. Only a layout-preserving PDF is\n // printable; all other formats remain attachments for host-specific use.\n const printable = isPrintableAcquisitionFormat(acquisition.format);\n const lessons = printable ? worksheets : readings;\n if (!(await lessons.get(lessonId)))\n await lessons.create({\n id: lessonId,\n tenantId: actor.tenantId,\n sectionId,\n title: request.lessonTitle?.trim() || resource.title,\n externalRef: `${resource.stableId}@${acquisition.revision}`,\n externalUrl: resource.canonicalUrl,\n sortOrder: 0,\n });\n if (\n !(await assets.get({\n lessonId,\n assetId: asset.assetId,\n tenantId: actor.tenantId,\n }))\n )\n await assets.create({\n tenantId: actor.tenantId,\n lessonId,\n assetId: asset.assetId,\n relationship: printable ? 'printable' : 'attachment',\n });\n });\n let enrollmentId: string | undefined;\n if (request.curriculumId || request.learnerId) {\n if (!this.learner || !request.curriculumId || !request.learnerId)\n throw new Error(\n 'Learner, curriculum, and enrollment service are required.',\n );\n enrollmentId = (\n await this.learner.enroll({\n tenantId: actor.tenantId,\n actorUserId: actor.actorUserId,\n learnerId: request.learnerId,\n ...(request.guardianRelationshipId\n ? { guardianRelationshipId: request.guardianRelationshipId }\n : {}),\n curriculumId: request.curriculumId,\n courseId,\n })\n ).id;\n }\n return {\n courseId,\n lessonId,\n assetId: asset.assetId,\n revision: acquisition.revision,\n sha256: acquisition.sha256,\n ...(enrollmentId ? { enrollmentId } : {}),\n };\n }\n}\n","import { normalizeCatalogRepresentation } from './catalog-capability.js';\nimport type {\n CatalogActor,\n CatalogLicenseEvidence,\n CatalogResourceRepresentation,\n CatalogSourceRecord,\n} from './catalog-contracts.js';\nimport { CatalogPolicy } from './catalog-policy.js';\nimport { type CatalogPreview, catalogPreviewFor } from './catalog-preview.js';\n\nexport interface CatalogReadStore {\n search(input: { query?: string; subject?: string; grade?: string }): Promise<\n readonly (CatalogSourceRecord & {\n id: string;\n withdrawnAt?: string | null;\n })[]\n >;\n}\n\n/** Deliberately metadata-only DTO: credentials, byte locations, and teacher records stay server-side. */\nexport interface CatalogResourceView {\n id: string;\n providerId: string;\n stableId: string;\n revision: string;\n canonicalUrl: string;\n title: string;\n suppliedDescription?: string;\n author?: string;\n subjects?: string[];\n gradeRange?: { min?: string; max?: string };\n language?: string;\n resourceType?: string;\n parentStableId?: string;\n availableFormats?: string[];\n representation?: CatalogResourceRepresentation;\n preview?: CatalogPreview;\n license: Pick<\n CatalogLicenseEvidence,\n | 'state'\n | 'identifier'\n | 'version'\n | 'attribution'\n | 'exceptions'\n | 'retrievedAt'\n >;\n}\n\nexport class CatalogReadService {\n constructor(\n private readonly store: CatalogReadStore,\n private readonly policy = new CatalogPolicy(),\n ) {}\n\n async search(\n actor: CatalogActor,\n filter: { query?: string; subject?: string; grade?: string } = {},\n ): Promise<CatalogResourceView[]> {\n if (!actor.tenantId.trim() || !actor.actorUserId.trim())\n throw new Error('Trusted tenant and actor identity are required.');\n const records = await this.store.search(filter);\n return records\n .filter(\n (record) => !record.withdrawnAt && this.policy.canView(record, actor),\n )\n .map((record) => this.view(record));\n }\n\n private view(\n record: CatalogSourceRecord & { id: string },\n ): CatalogResourceView {\n const { licenseEvidence } = record;\n const representation = normalizeCatalogRepresentation(\n record.representation,\n );\n const preview = catalogPreviewFor(record);\n return {\n id: record.id,\n providerId: record.providerId,\n stableId: record.stableId,\n revision: record.revision,\n canonicalUrl: record.canonicalUrl,\n title: record.title,\n ...(record.suppliedDescription\n ? { suppliedDescription: record.suppliedDescription }\n : {}),\n ...(record.author ? { author: record.author } : {}),\n ...(record.subjects ? { subjects: [...record.subjects] } : {}),\n ...(record.gradeRange ? { gradeRange: { ...record.gradeRange } } : {}),\n ...(record.language ? { language: record.language } : {}),\n ...(record.resourceType ? { resourceType: record.resourceType } : {}),\n ...(record.parentStableId\n ? { parentStableId: record.parentStableId }\n : {}),\n ...(record.availableFormats\n ? { availableFormats: [...record.availableFormats] }\n : {}),\n ...(representation ? { representation } : {}),\n ...(preview ? { preview } : {}),\n license: {\n state: licenseEvidence.state,\n ...(licenseEvidence.identifier\n ? { identifier: licenseEvidence.identifier }\n : {}),\n ...(licenseEvidence.version\n ? { version: licenseEvidence.version }\n : {}),\n ...(licenseEvidence.attribution\n ? { attribution: licenseEvidence.attribution }\n : {}),\n ...(licenseEvidence.exceptions\n ? { exceptions: licenseEvidence.exceptions }\n : {}),\n ...(licenseEvidence.retrievedAt\n ? { retrievedAt: licenseEvidence.retrievedAt }\n : {}),\n },\n };\n }\n}\n","import type {\n CatalogSourceRecord,\n CatalogSyncAdapter,\n CatalogSyncCheckpoint,\n CatalogSyncFailure,\n} from './catalog-contracts.js';\n\nexport interface CatalogSyncStore {\n getCheckpoint(providerId: string): Promise<CatalogSyncCheckpoint | undefined>;\n saveCheckpoint(checkpoint: CatalogSyncCheckpoint): Promise<void>;\n upsert(record: CatalogSourceRecord, runId: string): Promise<void>;\n withdrawUnseen(providerId: string, runId: string): Promise<number>;\n}\n\n/** Policy counts cover only pages processed by the current sync invocation. */\nexport interface CatalogExclusionSummary {\n total: number;\n byCode: { code: string; count: number }[];\n otherCount: number;\n}\nexport interface CatalogFailureSummary {\n total: number;\n historical: boolean;\n historicalCount: number;\n currentCount: number;\n omittedDetailCount: number;\n}\nexport interface CatalogSyncReport extends CatalogSyncCheckpoint {\n withdrawnCount: number;\n /** Invocation-local, bounded, report-only; never a full-generation coverage total. */\n exclusionSummary?: CatalogExclusionSummary;\n /** Historical diagnostics do not imply a current active failure. */\n failureSummary?: CatalogFailureSummary;\n}\n\nconst MAX_FAILURE_CODES = 31;\nconst MAX_POLICY_CODES = 32;\nconst OVERFLOW_CODE = 'additional-failures';\nfunction addCount(left: number, right: number): number {\n const result = left + right;\n if (!Number.isSafeInteger(result))\n throw new Error(\n 'Catalog diagnostic occurrence count exceeds the safe integer bound.',\n );\n return result;\n}\nfunction occurrenceCount(value: unknown): number {\n return typeof value === 'number' && Number.isSafeInteger(value) && value > 0\n ? value\n : 1;\n}\nfunction bounded(value: string, cap: number): string {\n return value.length > cap ? `${value.slice(0, cap - 12)} [truncated]` : value;\n}\ntype CountedFailure = CatalogSyncFailure & {\n count: number;\n omittedDetailCount: number;\n};\nfunction diagnostic(raw: CatalogSyncFailure): CountedFailure {\n const value: Partial<CatalogSyncFailure> =\n raw && typeof raw === 'object' ? raw : {};\n const count = occurrenceCount(value.count);\n const invalidCount = value.count !== undefined && count !== value.count;\n const code =\n typeof value.code === 'string' && value.code\n ? value.code\n : 'invalid-failure-entry';\n const message = `${invalidCount ? 'Invalid legacy occurrence count; counted once. ' : ''}${typeof value.message === 'string' ? value.message : 'Stored failure diagnostic is malformed.'}`;\n const cursor = typeof value.cursor === 'string' ? value.cursor : undefined;\n const truncated =\n code.length > 128 || message.length > 512 || (cursor?.length ?? 0) > 256;\n const suppliedOmitted =\n typeof value.omittedDetailCount === 'number' &&\n Number.isSafeInteger(value.omittedDetailCount) &&\n value.omittedDetailCount >= 0\n ? Math.min(count, value.omittedDetailCount)\n : 0;\n return {\n code: bounded(code, 128),\n message: bounded(message, 512),\n ...(cursor !== undefined ? { cursor: bounded(cursor, 256) } : {}),\n ...(typeof value.retryAfterMs === 'number' &&\n Number.isFinite(value.retryAfterMs) &&\n value.retryAfterMs >= 0\n ? { retryAfterMs: value.retryAfterMs }\n : {}),\n count,\n omittedDetailCount: truncated ? count : suppliedOmitted,\n };\n}\n/** Keep recent per-code facts and exact occurrence totals; declare omitted details. */\nfunction compactFailures(entries: CatalogSyncFailure[]): CountedFailure[] {\n const groups = new Map<string, CountedFailure>();\n let overflowCount = 0;\n for (const raw of entries) {\n const next = diagnostic(raw);\n if (next.code === OVERFLOW_CODE) {\n overflowCount = addCount(overflowCount, next.count);\n continue;\n }\n const previous = groups.get(next.code);\n if (previous) {\n const sameDetail =\n previous.message === next.message &&\n previous.cursor === next.cursor &&\n previous.retryAfterMs === next.retryAfterMs;\n next.omittedDetailCount = addCount(\n sameDetail ? previous.omittedDetailCount : previous.count,\n next.omittedDetailCount,\n );\n next.count = addCount(previous.count, next.count);\n groups.delete(next.code);\n } else if (groups.size === MAX_FAILURE_CODES) {\n const oldest = groups.values().next().value;\n if (oldest) {\n overflowCount = addCount(overflowCount, oldest.count);\n groups.delete(oldest.code);\n }\n }\n groups.set(next.code, next);\n }\n return [\n ...groups.values(),\n ...(overflowCount\n ? [\n {\n code: OVERFLOW_CODE,\n message:\n 'Additional failure diagnostics compacted; full detail is unavailable.',\n count: overflowCount,\n omittedDetailCount: overflowCount,\n },\n ]\n : []),\n ];\n}\nfunction totalFailures(entries: CatalogSyncFailure[]): number {\n return entries.reduce(\n (total, entry) => addCount(total, occurrenceCount(entry.count)),\n 0,\n );\n}\nfunction failure(error: unknown): CatalogSyncFailure {\n const value = error as {\n code?: unknown;\n message?: unknown;\n retryAfterMs?: unknown;\n };\n return {\n code: String(value?.code ?? 'enumeration-failed'),\n message: String(value?.message ?? error),\n ...(typeof value?.retryAfterMs === 'number'\n ? { retryAfterMs: value.retryAfterMs }\n : {}),\n };\n}\n\n/** Durable metadata synchronization. It never invokes a content acquisition adapter. */\nexport class CatalogSyncService {\n constructor(\n private readonly store: CatalogSyncStore,\n private readonly retries = 2,\n private readonly maxPages = 100,\n ) {}\n\n async sync(\n providerId: string,\n adapter: CatalogSyncAdapter,\n ): Promise<CatalogSyncReport> {\n if (!providerId.trim()) throw new Error('A provider ID is required.');\n const saved = await this.store.getCheckpoint(providerId);\n const resuming = saved?.complete === false;\n const runId = resuming\n ? (saved.runId ?? globalThis.crypto.randomUUID())\n : globalThis.crypto.randomUUID();\n let checkpoint: CatalogSyncCheckpoint = {\n providerId,\n cursor: resuming ? saved?.cursor : undefined,\n complete: false,\n importedCount: resuming ? (saved?.importedCount ?? 0) : 0,\n failures: compactFailures(resuming ? (saved?.failures ?? []) : []),\n runId,\n };\n const historicalCount = totalFailures(checkpoint.failures);\n let currentCount = 0;\n let withdrawnCount = 0;\n let policyTotal = 0;\n let otherCount = 0;\n const policyCodes = new Map<string, number>();\n const report = (): CatalogSyncReport => ({\n ...checkpoint,\n withdrawnCount,\n exclusionSummary: {\n total: policyTotal,\n byCode: [...policyCodes].map(([code, count]) => ({ code, count })),\n otherCount,\n },\n failureSummary: {\n total: totalFailures(checkpoint.failures),\n historical: historicalCount > 0,\n historicalCount,\n currentCount,\n omittedDetailCount: checkpoint.failures.reduce(\n (total, entry) => addCount(total, entry.omittedDetailCount ?? 0),\n 0,\n ),\n },\n });\n const pause = async (\n reason: string,\n entries: CatalogSyncFailure[],\n ): Promise<CatalogSyncReport> => {\n currentCount = addCount(\n currentCount,\n totalFailures(entries.map(diagnostic)),\n );\n checkpoint = {\n ...checkpoint,\n complete: false,\n paused: true,\n pauseReason: bounded(reason, 512),\n failures: compactFailures([...checkpoint.failures, ...entries]),\n };\n await this.store.saveCheckpoint(checkpoint);\n return report();\n };\n const cursors = new Set<string>();\n if (checkpoint.cursor) cursors.add(checkpoint.cursor);\n for (let pageCount = 0; pageCount < this.maxPages; pageCount++) {\n let page:\n | Awaited<ReturnType<CatalogSyncAdapter['enumerate']>>\n | undefined;\n let lastFailure: CatalogSyncFailure | undefined;\n for (let attempt = 0; attempt <= this.retries; attempt++) {\n try {\n page = await adapter.enumerate({\n cursor: checkpoint.cursor,\n checkpoint,\n });\n break;\n } catch (error) {\n lastFailure = failure(error);\n }\n }\n if (!page) {\n const terminalFailure = lastFailure ?? {\n code: 'enumeration-failed',\n message: 'Adapter returned no catalog page.',\n };\n return await pause(terminalFailure.message, [terminalFailure]);\n }\n if (page.complete && page.nextCursor)\n throw new Error('A terminal catalog page cannot have a next cursor.');\n if (\n !page.complete &&\n !page.nextCursor &&\n !page.paused &&\n !page.exclusions?.length &&\n !page.policyExclusions?.length\n )\n throw new Error('A partial catalog page requires a next cursor.');\n for (const omission of page.policyExclusions ?? []) {\n const count = occurrenceCount(omission.count);\n policyTotal = addCount(policyTotal, count);\n const code =\n typeof omission.code === 'string' &&\n /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$/.test(omission.code)\n ? omission.code\n : 'invalid-policy-code';\n if (policyCodes.has(code) || policyCodes.size < MAX_POLICY_CODES)\n policyCodes.set(code, addCount(policyCodes.get(code) ?? 0, count));\n else otherCount = addCount(otherCount, count);\n }\n // Current operational failures never advance, withdraw, or claim success.\n // Saved legacy diagnostics remain audit history, without guessed reclassification.\n if (page.paused || page.exclusions?.length) {\n const entries = page.exclusions?.length\n ? page.exclusions\n : [{ code: 'paused', message: 'Catalog source is paused.' }];\n return await pause(entries[0].message, entries);\n }\n for (const record of page.records) {\n if (\n record.providerId !== providerId ||\n !record.stableId ||\n !record.revision\n )\n throw new Error(\n 'Catalog records require matching provider, stable ID, and revision.',\n );\n await this.store.upsert(record, runId);\n }\n checkpoint = {\n ...checkpoint,\n cursor:\n page.nextCursor ?? (page.complete ? undefined : checkpoint.cursor),\n complete: page.complete,\n paused: false,\n pauseReason: undefined,\n importedCount: checkpoint.importedCount + page.records.length,\n };\n if (!page.complete) {\n if (!page.nextCursor) {\n // A valid snapshot can be retained while its declared coverage is\n // explicitly unconfirmed. This is a controlled policy pause, not an\n // access/parse failure, and can never authorize withdrawal.\n checkpoint = {\n ...checkpoint,\n paused: true,\n pauseReason: bounded(\n page.policyExclusions?.[0]?.message ??\n 'Catalog scope is incomplete.',\n 512,\n ),\n };\n await this.store.saveCheckpoint(checkpoint);\n return report();\n }\n if (checkpoint.cursor && cursors.has(checkpoint.cursor))\n return await pause('Catalog source did not advance its cursor.', [\n {\n cursor: checkpoint.cursor,\n code: 'cursor-cycle',\n message: 'Catalog source did not advance its cursor.',\n },\n ]);\n if (checkpoint.cursor) cursors.add(checkpoint.cursor);\n await this.store.saveCheckpoint(checkpoint);\n continue;\n }\n withdrawnCount = await this.store.withdrawUnseen(providerId, runId);\n checkpoint = {\n providerId,\n complete: true,\n importedCount: checkpoint.importedCount,\n failures: checkpoint.failures,\n lastSuccessfulAt: new Date().toISOString(),\n };\n await this.store.saveCheckpoint(checkpoint);\n return report();\n }\n // A controlled invocation budget is a resumable yield, not a source failure.\n checkpoint = {\n ...checkpoint,\n complete: false,\n paused: false,\n pauseReason: undefined,\n };\n await this.store.saveCheckpoint(checkpoint);\n return report();\n }\n}\n","import {\n field,\n SmrtCollection,\n SmrtObject,\n type SmrtSaveOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\n\nexport type SourceSharing = 'private' | 'group' | 'global';\nexport type CourseSourceKind = 'manual' | 'url' | 'adapter';\nexport interface CourseSourceConfig {\n /** Host-recorded written permission for a shared import, never learner input. */\n licenseEvidence?: string;\n}\n\n/** Host-managed source policy; deliberately has no generated CRUD surface. */\n@TenantScoped({ mode: 'required' })\n@smrt({ api: false, cli: false, mcp: false })\nexport class CourseSource extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-education\";\n @tenantId() tenantId = '';\n @field({ required: true }) key = '';\n @field({ required: true }) name = '';\n kind: CourseSourceKind = 'adapter';\n adapterKey = 'easy-peasy';\n config = '{}';\n sharing: SourceSharing = 'private';\n\n constructor(options: Record<string, unknown> = {}) {\n super(options);\n for (const [key, value] of Object.entries(options)) {\n if (Object.hasOwn(this, key))\n (this as unknown as Record<string, unknown>)[key] = value;\n }\n }\n\n getConfig(): CourseSourceConfig {\n const value: unknown = JSON.parse(this.config);\n if (!value || typeof value !== 'object' || Array.isArray(value))\n throw new Error('CourseSource config must be an object.');\n const record = value as Record<string, unknown>;\n if (\n Object.keys(record).some((key) => key !== 'licenseEvidence') ||\n (record.licenseEvidence !== undefined &&\n typeof record.licenseEvidence !== 'string')\n )\n throw new Error('Invalid CourseSource config.');\n return {\n ...(record.licenseEvidence === undefined\n ? {}\n : { licenseEvidence: record.licenseEvidence as string }),\n };\n }\n\n setConfig(value: CourseSourceConfig): void {\n const previous = this.config;\n this.config = JSON.stringify(value);\n try {\n this.getConfig();\n } catch (error) {\n this.config = previous;\n throw error;\n }\n }\n\n override async save(options?: SmrtSaveOptions): Promise<this> {\n if (\n !['private', 'group', 'global'].includes(this.sharing) ||\n !['manual', 'url', 'adapter'].includes(this.kind)\n )\n throw new Error('Invalid CourseSource kind or sharing.');\n this.getConfig();\n return super.save(options);\n }\n}\n\nexport class CourseSourceCollection extends SmrtCollection<CourseSource> {\n static readonly _itemClass = CourseSource;\n}\n","import type { CatalogSourceRecord } from '../catalog-contracts.js';\n\nconst host = 'im.kendallhunt.com';\n\nfunction text(value: string): string {\n return value\n .replace(/<[^>]+>/g, ' ')\n .replace(/\\s+/g, ' ')\n .trim();\n}\n\n/**\n * Parses the publicly linked K-5 family curriculum index published by the IM\n * Certified Kendall Hunt site. It is deliberately metadata-only: unit and\n * lesson pages are not fetched or acquired here.\n */\nexport function parseIllustrativeMathematicsK5Index(\n html: string,\n revision: string,\n pageUrl = 'https://im.kendallhunt.com/k5/curriculum.html',\n): CatalogSourceRecord[] {\n const index = new URL(pageUrl);\n if (index.protocol !== 'https:' || index.hostname !== host)\n throw new Error(\n 'Illustrative Mathematics index must use the official HTTPS host.',\n );\n if (!revision.trim())\n throw new Error('Illustrative Mathematics revision is required.');\n\n const records: CatalogSourceRecord[] = [];\n const seen = new Set<string>();\n const anchors = /<a\\b([^>]*)>([\\s\\S]*?)<\\/a\\s*>/gi;\n for (const match of html.matchAll(anchors)) {\n const href = /\\bhref\\s*=\\s*[\"']([^\"']+)[\"']/i.exec(match[1])?.[1];\n if (!href) continue;\n const url = new URL(href, index);\n const grade =\n /^\\/K5\\/families\\/(kindergarten|grade-[1-5])\\/units\\.html$/i.exec(\n url.pathname,\n )?.[1];\n if (!grade || url.hostname !== host || seen.has(url.pathname)) continue;\n seen.add(url.pathname);\n const gradeLabel =\n grade === 'kindergarten' ? 'K' : grade.slice('grade-'.length);\n records.push({\n providerId: 'illustrative-mathematics',\n stableId: `k5-family-${grade.toLowerCase()}`,\n revision,\n canonicalUrl: url.toString(),\n title: `IM K-5 Math Grade ${gradeLabel}`,\n suppliedDescription: text(match[2]) || undefined,\n subjects: ['mathematics'],\n gradeRange: { min: gradeLabel, max: gradeLabel },\n language: 'en',\n resourceType: 'course',\n availableFormats: ['html'],\n licenseEvidence: {\n state: 'verified',\n identifier: 'CC BY',\n version: '4.0',\n sourceUrl: 'https://creativecommons.org/licenses/by/4.0/',\n retrievedAt: revision,\n permittedOperations: [\n 'link',\n 'adapt',\n 'redistribute',\n 'commercial-use',\n ],\n },\n visibility: 'catalog',\n });\n }\n if (!records.length)\n throw new Error(\n 'Illustrative Mathematics K-5 index has no family-grade links.',\n );\n return records;\n}\n","import type { CatalogSourceRecord } from '../catalog-contracts.js';\n\nconst maximumFeedBytes = 2_000_000;\nconst namedEntities: Readonly<Record<string, string>> = {\n '&': '&',\n ''': \"'\",\n '>': '>',\n '<': '<',\n '"': '\"',\n};\n\nfunction decode(value: string): string {\n return value\n .replace(/<!\\[CDATA\\[([\\s\\S]*?)\\]\\]>/g, '$1')\n .replace(/<[^>]+>/g, ' ')\n .replace(\n /&(?:amp|apos|gt|lt|quot);/g,\n (entity) => namedEntities[entity] ?? entity,\n )\n .replace(/\\s+/g, ' ')\n .trim();\n}\n\nfunction element(xml: string, names: readonly string[]): string | undefined {\n for (const name of names) {\n const match = new RegExp(\n `<${name}\\\\b[^>]*>([\\\\s\\\\S]*?)<\\\\/${name}\\\\s*>`,\n 'i',\n ).exec(xml);\n const value = match ? decode(match[1]) : '';\n if (value) return value;\n }\n return undefined;\n}\n\nfunction elements(xml: string, names: readonly string[]): string[] {\n const values: string[] = [];\n for (const name of names) {\n const expression = new RegExp(\n `<${name}\\\\b[^>]*>([\\\\s\\\\S]*?)<\\\\/${name}\\\\s*>`,\n 'gi',\n );\n for (const match of xml.matchAll(expression)) {\n const value = decode(match[1]);\n if (value) values.push(value);\n }\n }\n return [...new Set(values)];\n}\n\nfunction https(value: string | undefined): string | undefined {\n if (!value) return undefined;\n try {\n const url = new URL(value);\n return url.protocol === 'https:' && !url.username && !url.password\n ? url.toString()\n : undefined;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Parses a configured OER Commons/ISKME RSS or Dublin Core feed without entity\n * expansion or external resolution. The configured feed is authoritative for\n * scope; this parser never represents its page as global catalog coverage.\n */\nexport function parseOerCommonsRssFeed(\n xml: string,\n revision: string,\n): CatalogSourceRecord[] {\n if (new TextEncoder().encode(xml).byteLength > maximumFeedBytes)\n throw new Error('OER Commons RSS feed exceeds the 2 MB metadata limit.');\n if (/<!DOCTYPE|<!ENTITY/i.test(xml))\n throw new Error('OER Commons RSS feed must not contain DTDs or entities.');\n if (!revision.trim())\n throw new Error('OER Commons feed revision is required.');\n\n const records: CatalogSourceRecord[] = [];\n const items = xml.match(/<item\\b[^>]*>[\\s\\S]*?<\\/item\\s*>/gi) ?? [];\n for (const item of items) {\n const canonicalUrl = https(element(item, ['link', 'dc:identifier']));\n const stableId = element(item, ['guid', 'dc:identifier']) ?? canonicalUrl;\n const title = element(item, ['title', 'dc:title']);\n if (!canonicalUrl || !stableId || !title) continue;\n const rights = element(item, ['license', 'dc:rights', 'rights']);\n const licenseUrl = https(rights);\n records.push({\n providerId: 'oer-commons',\n stableId,\n revision: element(item, ['dc:date', 'pubDate']) ?? revision,\n canonicalUrl,\n title,\n suppliedDescription: element(item, ['description', 'dc:description']),\n author: element(item, ['dc:creator', 'author']),\n subjects: elements(item, ['category', 'dc:subject']),\n language: element(item, ['dc:language', 'language']),\n resourceType: element(item, ['dc:type']) ?? 'resource',\n availableFormats: elements(item, ['dc:format']),\n licenseEvidence: rights\n ? {\n // A feed label is provenance, not a license validation decision.\n state: 'unknown',\n identifier: rights,\n ...(licenseUrl ? { sourceUrl: licenseUrl } : {}),\n retrievedAt: revision,\n }\n : { state: 'unknown', retrievedAt: revision },\n visibility: 'catalog',\n });\n }\n if (!records.length)\n throw new Error('OER Commons RSS feed has no complete metadata items.');\n return records;\n}\n","import type {\n CatalogSourceRecord,\n CatalogSyncAdapter,\n CatalogSyncCheckpoint,\n CatalogSyncPage,\n} from './catalog-contracts.js';\nimport { parseIllustrativeMathematicsK5Index } from './sources/illustrative-mathematics-parser.js';\nimport { parseOerCommonsRssFeed } from './sources/oer-commons-rss-parser.js';\n\nexport type HearthCatalogProviderId =\n | 'illustrative-mathematics'\n | 'ck12'\n | 'oer-commons';\n\n/**\n * A host-supplied integration for a provider-approved metadata feed. The\n * provider must approve the exact feed URL and credentials before it is used.\n * This deliberately does not guess a public endpoint or scrape course pages.\n */\nexport interface AuthorizedCatalogFeed {\n providerId: HearthCatalogProviderId;\n metadataFeedUrl: string;\n termsAccepted: true;\n enumerate(input: {\n cursor?: string;\n checkpoint: CatalogSyncCheckpoint;\n }): Promise<CatalogSyncPage>;\n}\n\nexport interface ProviderMetadataResponse {\n ok: boolean;\n status: number;\n url: string;\n headers: { get(name: string): string | null };\n text(): Promise<string>;\n}\nexport type ProviderMetadataFetch = (\n url: string,\n options: {\n redirect: 'error';\n headers: { accept: string };\n signal?: AbortSignal;\n },\n) => Promise<ProviderMetadataResponse>;\n\nconst DEFAULT_METADATA_TIMEOUT_MS = 10_000;\n\nexport interface PublicIllustrativeMathematicsK5Config {\n /** The official K-5 curriculum index; defaults to the published index. */\n indexUrl?: string;\n fetch: ProviderMetadataFetch;\n /** Bounds both the provider request and response-body read. */\n timeoutMs?: number;\n}\nexport interface OerCommonsRssConfig {\n /** An ISKME/OER Commons-approved RSS or DC feed URL for an agreed collection. */\n feedUrl: string;\n fetch: ProviderMetadataFetch;\n /** Bounds both the provider request and response-body read. */\n timeoutMs?: number;\n /** Only set after the feed owner confirms this snapshot is terminal for its scope. */\n terminalSnapshot?: true;\n}\n\nexport interface ProviderFeedRequirement {\n providerId: HearthCatalogProviderId;\n requirement: string;\n}\n\nexport const providerFeedRequirements: readonly ProviderFeedRequirement[] = [\n {\n providerId: 'illustrative-mathematics',\n requirement:\n 'A provider-approved, paginated metadata feed plus written catalog-harvesting permission.',\n },\n {\n providerId: 'ck12',\n requirement:\n 'CK-12-approved catalog-feed access and credentials; ordinary web access is not an enumeration API.',\n },\n {\n providerId: 'oer-commons',\n requirement:\n 'OER Commons-approved paginated metadata-feed access with each record’s publisher and license fields.',\n },\n];\n\nfunction unavailablePage(providerId: HearthCatalogProviderId): CatalogSyncPage {\n const requirement = providerFeedRequirements.find(\n (entry) => entry.providerId === providerId,\n );\n return {\n records: [],\n complete: false,\n paused: true,\n exclusions: [\n {\n code: 'provider_feed_not_configured',\n message: requirement?.requirement ?? 'Provider feed is not configured.',\n },\n ],\n };\n}\n\nfunction retryAfter(\n headers: ProviderMetadataResponse['headers'],\n): number | undefined {\n const value = headers.get('retry-after');\n if (!value) return undefined;\n const seconds = Number(value);\n return Number.isFinite(seconds) && seconds >= 0 ? seconds * 1000 : undefined;\n}\n\nfunction httpsUrl(value: string, provider: string): string {\n let url: URL;\n try {\n url = new URL(value);\n } catch {\n throw new Error(`${provider} metadata URL is invalid.`);\n }\n if (url.protocol !== 'https:' || url.username || url.password || url.port)\n throw new Error(`${provider} metadata URL must be credential-free HTTPS.`);\n return url.toString();\n}\n\nasync function fetchMetadata(\n fetch: ProviderMetadataFetch,\n url: string,\n accept: string,\n timeoutMs = DEFAULT_METADATA_TIMEOUT_MS,\n): Promise<{ body: string; revision: string } | CatalogSyncPage> {\n const controller = new AbortController();\n const bounded = async <T>(operation: Promise<T>): Promise<T> => {\n let timer: ReturnType<typeof setTimeout> | undefined;\n try {\n return await Promise.race([\n operation,\n new Promise<T>((_resolve, reject) => {\n timer = setTimeout(() => {\n controller.abort();\n reject(new Error('Provider metadata request timed out.'));\n }, timeoutMs);\n }),\n ]);\n } finally {\n if (timer) clearTimeout(timer);\n }\n };\n let response: ProviderMetadataResponse;\n try {\n response = await bounded(\n fetch(url, {\n redirect: 'error',\n headers: { accept },\n signal: controller.signal,\n }),\n );\n } catch (error) {\n return {\n records: [],\n complete: false,\n paused: true,\n exclusions: [\n {\n code: 'provider_feed_failed',\n message:\n error instanceof Error ? error.message : 'Metadata request failed.',\n },\n ],\n };\n }\n if (response.status === 429)\n return {\n records: [],\n complete: false,\n exclusions: [\n {\n code: 'provider_rate_limited',\n message: 'Provider metadata request was rate limited.',\n retryAfterMs: retryAfter(response.headers),\n },\n ],\n };\n if (!response.ok)\n return {\n records: [],\n complete: false,\n exclusions: [\n {\n code: 'provider_feed_failed',\n message: `Provider metadata request failed with HTTP ${response.status}.`,\n },\n ],\n };\n if (response.url !== url)\n return {\n records: [],\n complete: false,\n exclusions: [\n {\n code: 'unexpected_provider_redirect',\n message:\n 'Provider metadata response URL did not match the configured URL.',\n },\n ],\n };\n let body: string;\n try {\n body = await bounded(response.text());\n } catch (error) {\n return {\n records: [],\n complete: false,\n paused: true,\n exclusions: [\n {\n code: 'provider_feed_failed',\n message:\n error instanceof Error ? error.message : 'Metadata read failed.',\n },\n ],\n };\n }\n if (new TextEncoder().encode(body).byteLength > 2_000_000)\n return {\n records: [],\n complete: false,\n exclusions: [\n {\n code: 'provider_metadata_oversized',\n message: 'Provider metadata response exceeds 2 MB.',\n },\n ],\n };\n const revision =\n response.headers.get('etag') ?? response.headers.get('last-modified');\n if (!revision)\n return {\n records: [],\n complete: false,\n exclusions: [\n {\n code: 'provider_revision_unavailable',\n message:\n 'Provider metadata response supplied no ETag or Last-Modified revision.',\n },\n ],\n };\n return { body, revision };\n}\n\nfunction validRecord(\n providerId: HearthCatalogProviderId,\n record: CatalogSourceRecord,\n): boolean {\n return (\n record.providerId === providerId &&\n record.stableId.trim().length > 0 &&\n record.revision.trim().length > 0 &&\n record.title.trim().length > 0 &&\n /^https:\\/\\//.test(record.canonicalUrl) &&\n typeof record.licenseEvidence.state === 'string'\n );\n}\n\n/**\n * Protects catalog state from optimistic completion and malformed provider\n * data. An unavailable feed stays explicitly incomplete and resumable.\n */\nexport class AuthorizedCatalogFeedAdapter implements CatalogSyncAdapter {\n constructor(\n private readonly providerId: HearthCatalogProviderId,\n private readonly feed?: AuthorizedCatalogFeed,\n ) {}\n\n async enumerate(input: {\n cursor?: string;\n checkpoint: CatalogSyncCheckpoint;\n }): Promise<CatalogSyncPage> {\n if (!this.feed) return unavailablePage(this.providerId);\n if (\n this.feed.providerId !== this.providerId ||\n this.feed.termsAccepted !== true ||\n !/^https:\\/\\//.test(this.feed.metadataFeedUrl)\n )\n return unavailablePage(this.providerId);\n\n try {\n const page = await this.feed.enumerate(input);\n const malformed = page.records.filter(\n (record) => !validRecord(this.providerId, record),\n );\n if (malformed.length) {\n return {\n records: page.records.filter((record) =>\n validRecord(this.providerId, record),\n ),\n complete: false,\n nextCursor: input.cursor,\n exclusions: [\n ...(page.exclusions ?? []),\n {\n cursor: input.cursor,\n code: 'invalid_provider_metadata',\n message: `${malformed.length} provider records lack required stable metadata or license evidence.`,\n },\n ],\n };\n }\n if (page.complete && page.nextCursor)\n return {\n records: page.records,\n complete: false,\n nextCursor: page.nextCursor,\n exclusions: [\n ...(page.exclusions ?? []),\n {\n cursor: input.cursor,\n code: 'contradictory_terminal_page',\n message:\n 'A terminal provider page cannot also declare a next cursor.',\n },\n ],\n };\n return page;\n } catch (error) {\n return {\n records: [],\n complete: false,\n nextCursor: input.cursor,\n exclusions: [\n {\n cursor: input.cursor,\n code: 'provider_feed_failed',\n message:\n error instanceof Error\n ? error.message\n : 'Provider metadata feed failed without an error message.',\n },\n ],\n };\n }\n }\n}\n\nexport function createIllustrativeMathematicsAdapter(\n feed?: AuthorizedCatalogFeed,\n): CatalogSyncAdapter {\n return new AuthorizedCatalogFeedAdapter('illustrative-mathematics', feed);\n}\n\n/** Enumerates only the public K-5 course index, never claims all IM coverage. */\nexport function createPublicIllustrativeMathematicsK5Adapter(\n config: PublicIllustrativeMathematicsK5Config,\n): CatalogSyncAdapter {\n return {\n async enumerate(input) {\n if (input.cursor)\n return {\n records: [],\n complete: false,\n exclusions: [\n {\n cursor: input.cursor,\n code: 'unsupported_provider_cursor',\n message: 'The public IM K-5 index has no pagination cursor.',\n },\n ],\n };\n const url = httpsUrl(\n config.indexUrl ?? 'https://im.kendallhunt.com/k5/curriculum.html',\n 'Illustrative Mathematics',\n );\n const result = await fetchMetadata(\n config.fetch,\n url,\n 'text/html,application/xhtml+xml',\n config.timeoutMs,\n );\n if ('complete' in result) return result;\n try {\n return {\n records: parseIllustrativeMathematicsK5Index(\n result.body,\n result.revision,\n url,\n ),\n complete: false,\n policyExclusions: [\n {\n code: 'partial_provider_coverage',\n message:\n 'The public IM K-5 index is not a complete IM catalog feed.',\n },\n ],\n };\n } catch (error) {\n return {\n records: [],\n complete: false,\n exclusions: [\n {\n code: 'provider_metadata_invalid',\n message:\n error instanceof Error\n ? error.message\n : 'IM metadata parsing failed.',\n },\n ],\n };\n }\n },\n };\n}\n\nexport function createCk12Adapter(\n feed?: AuthorizedCatalogFeed,\n): CatalogSyncAdapter {\n return new AuthorizedCatalogFeedAdapter('ck12', feed);\n}\n\nexport function createOerCommonsAdapter(\n feed?: AuthorizedCatalogFeed,\n): CatalogSyncAdapter {\n return new AuthorizedCatalogFeedAdapter('oer-commons', feed);\n}\n\n/** Parses an ISKME/OER Commons-approved RSS or Dublin Core collection feed. */\nexport function createOerCommonsRssAdapter(\n config: OerCommonsRssConfig,\n): CatalogSyncAdapter {\n return {\n async enumerate(input) {\n if (input.cursor)\n return {\n records: [],\n complete: false,\n exclusions: [\n {\n cursor: input.cursor,\n code: 'unsupported_provider_cursor',\n message:\n 'Configured OER RSS/DC feeds are snapshot feeds without cursors.',\n },\n ],\n };\n const url = httpsUrl(config.feedUrl, 'OER Commons');\n const result = await fetchMetadata(\n config.fetch,\n url,\n 'application/rss+xml, application/xml, text/xml',\n config.timeoutMs,\n );\n if ('complete' in result) return result;\n try {\n return {\n records: parseOerCommonsRssFeed(result.body, result.revision),\n complete: config.terminalSnapshot === true,\n ...(config.terminalSnapshot === true\n ? {}\n : {\n policyExclusions: [\n {\n code: 'partial_provider_coverage',\n message:\n 'Configured OER feed scope has not been confirmed as terminal.',\n },\n ],\n }),\n };\n } catch (error) {\n return {\n records: [],\n complete: false,\n exclusions: [\n {\n code: 'provider_metadata_invalid',\n message:\n error instanceof Error\n ? error.message\n : 'OER RSS/DC parsing failed.',\n },\n ],\n };\n }\n },\n };\n}\n","import type {\n SourceImportRequest,\n SourceImportResult,\n SourceImportService,\n} from './source-import-service.js';\n\nexport type EasyPeasyGrade4Variant =\n | 'core'\n | 'shared-theme-choice'\n | 'once-weekly';\n\n/**\n * Official source pointers only. Theme rows represent a family choice and are\n * never automatically combined into an enrollment.\n */\nexport interface EasyPeasyGrade4Course {\n courseRef: string;\n title: string;\n pageUrl: string;\n subject: string;\n variant: EasyPeasyGrade4Variant;\n enrollmentMode: 'individual' | 'choose-one-theme';\n}\nexport interface EasyPeasyGrade4Theme {\n themeId: 'theme-1' | 'theme-2' | 'theme-3' | 'theme-4';\n title: string;\n courses: readonly EasyPeasyGrade4Course[];\n}\nexport interface EasyPeasyThemeImportResult {\n themeId: EasyPeasyGrade4Theme['themeId'];\n courseIds: readonly string[];\n}\n\nexport const easyPeasyGrade4Courses: readonly EasyPeasyGrade4Course[] = [\n {\n courseRef: 'grade-4-math',\n title: 'Math 4',\n subject: 'math',\n pageUrl: 'https://allinonehomeschool.com/ep-math-4/',\n variant: 'core',\n enrollmentMode: 'individual',\n },\n {\n courseRef: 'grade-4-reading',\n title: 'Reading 4',\n subject: 'reading',\n pageUrl: 'https://allinonehomeschool.com/reading-4/',\n variant: 'core',\n enrollmentMode: 'individual',\n },\n {\n courseRef: 'grade-4-language-arts',\n title: 'Language Arts 4',\n subject: 'language-arts',\n pageUrl: 'https://allinonehomeschool.com/language-arts-4/',\n variant: 'core',\n enrollmentMode: 'individual',\n },\n {\n courseRef: 'lower-elementary-theme-1',\n title: 'Theme 1: biology and ancient history',\n subject: 'shared-theme',\n pageUrl: 'https://allinonehomeschool.com/history-and-science-themes/',\n variant: 'shared-theme-choice',\n enrollmentMode: 'choose-one-theme',\n },\n {\n courseRef: 'lower-elementary-theme-2',\n title: 'Theme 2: zoology and early American history',\n subject: 'shared-theme',\n pageUrl: 'https://allinonehomeschool.com/history-and-science-themes/',\n variant: 'shared-theme-choice',\n enrollmentMode: 'choose-one-theme',\n },\n {\n courseRef: 'lower-elementary-theme-3',\n title: 'Theme 3: earth science and geography/cultures',\n subject: 'shared-theme',\n pageUrl: 'https://allinonehomeschool.com/history-and-science-themes/',\n variant: 'shared-theme-choice',\n enrollmentMode: 'choose-one-theme',\n },\n {\n courseRef: 'lower-elementary-theme-4',\n title: 'Theme 4: physics/chemistry and modern history',\n subject: 'shared-theme',\n pageUrl: 'https://allinonehomeschool.com/history-and-science-themes/',\n variant: 'shared-theme-choice',\n enrollmentMode: 'choose-one-theme',\n },\n {\n courseRef: 'lower-elementary-computer',\n title: 'Computer: Level 4 placement',\n subject: 'computer',\n pageUrl: 'https://allinonehomeschool.com/computer-fourth-level/',\n variant: 'once-weekly',\n enrollmentMode: 'individual',\n },\n {\n courseRef: 'lower-elementary-thinking',\n title: 'Thinking',\n subject: 'thinking',\n pageUrl: 'https://allinonehomeschool.com/thinking-levels-4-6/',\n variant: 'once-weekly',\n enrollmentMode: 'individual',\n },\n];\n\nexport function grade4Courses(\n variant?: EasyPeasyGrade4Variant,\n): readonly EasyPeasyGrade4Course[] {\n return variant\n ? easyPeasyGrade4Courses.filter((course) => course.variant === variant)\n : easyPeasyGrade4Courses;\n}\n\nfunction themeCourse(\n themeId: EasyPeasyGrade4Theme['themeId'],\n subject: string,\n title: string,\n pageUrl: string,\n): EasyPeasyGrade4Course {\n return {\n courseRef: `${themeId}-${subject}`,\n title,\n subject,\n pageUrl,\n variant: 'shared-theme-choice',\n enrollmentMode: 'individual',\n };\n}\n\n/**\n * Theme constituents are the official lower-level course pointers linked by\n * the source's themes and individual-course pages. A caller imports one theme,\n * never all four rotations.\n */\nexport const easyPeasyGrade4Themes: readonly EasyPeasyGrade4Theme[] = [\n {\n themeId: 'theme-1',\n title: 'Theme 1: biology and ancient history',\n courses: [\n themeCourse(\n 'theme-1',\n 'science',\n 'Science — Biology',\n 'https://allinonehomeschool.com/science-year-1/',\n ),\n themeCourse(\n 'theme-1',\n 'history',\n 'History — Ancient',\n 'https://allinonehomeschool.com/history-year-1/',\n ),\n themeCourse(\n 'theme-1',\n 'bible',\n 'Bible — Old Testament',\n 'https://allinonehomeschool.com/bible-year-1-2/',\n ),\n themeCourse(\n 'theme-1',\n 'art',\n 'Art — Ancient',\n 'https://allinonehomeschool.com/art-year-1/',\n ),\n themeCourse(\n 'theme-1',\n 'music',\n 'Music — Ancient',\n 'https://allinonehomeschool.com/1908-wright-brothers-flight-demonstration/music-year-1/',\n ),\n themeCourse(\n 'theme-1',\n 'pe-health',\n 'PE/Health — Strong and Healthy',\n 'https://allinonehomeschool.com/pehealth-odds/',\n ),\n ],\n },\n {\n themeId: 'theme-2',\n title: 'Theme 2: zoology and early American history',\n courses: [\n themeCourse(\n 'theme-2',\n 'science',\n 'Science — Zoology',\n 'https://allinonehomeschool.com/zoology/',\n ),\n themeCourse(\n 'theme-2',\n 'history',\n 'History — Early American',\n 'https://allinonehomeschool.com/early-american-history/',\n ),\n themeCourse(\n 'theme-2',\n 'bible',\n 'Bible — New Testament',\n 'https://allinonehomeschool.com/bible-newtestament/',\n ),\n themeCourse(\n 'theme-2',\n 'art',\n 'Art — Early American',\n 'https://allinonehomeschool.com/art-early-american/',\n ),\n themeCourse(\n 'theme-2',\n 'music',\n 'Music — Early American',\n 'https://allinonehomeschool.com/music-year-2/',\n ),\n themeCourse(\n 'theme-2',\n 'pe-health',\n 'PE/Health — Exercise and Nutrition',\n 'https://allinonehomeschool.com/pe-health/',\n ),\n ],\n },\n {\n themeId: 'theme-3',\n title: 'Theme 3: earth science and geography/cultures',\n courses: [\n themeCourse(\n 'theme-3',\n 'science',\n 'Science — Earth Science',\n 'https://allinonehomeschool.com/science-earth-science/',\n ),\n themeCourse(\n 'theme-3',\n 'history',\n 'History — Geography and Cultures',\n 'https://allinonehomeschool.com/geography-and-cultures/',\n ),\n themeCourse(\n 'theme-3',\n 'bible',\n 'Bible — Poetry',\n 'https://allinonehomeschool.com/bible-geography-and-cultures/',\n ),\n themeCourse(\n 'theme-3',\n 'art',\n 'Art — Geography and Cultures',\n 'https://allinonehomeschool.com/art-geography-and-cultures/',\n ),\n themeCourse(\n 'theme-3',\n 'music',\n 'Music — Geography and Cultures',\n 'https://allinonehomeschool.com/individual-courses-of-study/music-geography-and-cultures/',\n ),\n themeCourse(\n 'theme-3',\n 'pe-health',\n 'PE/Health — Strong and Healthy',\n 'https://allinonehomeschool.com/pehealth-odds/',\n ),\n ],\n },\n {\n themeId: 'theme-4',\n title: 'Theme 4: physics/chemistry and modern history',\n courses: [\n themeCourse(\n 'theme-4',\n 'science',\n 'Science — Physics and Chemistry',\n 'https://allinonehomeschool.com/science-year-4/',\n ),\n themeCourse(\n 'theme-4',\n 'history',\n 'History — Modern',\n 'https://allinonehomeschool.com/history-year-4/',\n ),\n themeCourse(\n 'theme-4',\n 'bible',\n 'Bible — Prophets',\n 'https://allinonehomeschool.com/bible/',\n ),\n themeCourse(\n 'theme-4',\n 'art',\n 'Art — Modern',\n 'https://allinonehomeschool.com/art-year-4/',\n ),\n themeCourse(\n 'theme-4',\n 'music',\n 'Music — Modern',\n 'https://allinonehomeschool.com/music/',\n ),\n themeCourse(\n 'theme-4',\n 'pe-health',\n 'PE/Health — Exercise and Nutrition',\n 'https://allinonehomeschool.com/pe-health/',\n ),\n ],\n },\n];\n\nexport function grade4Theme(\n themeId: EasyPeasyGrade4Theme['themeId'],\n): EasyPeasyGrade4Theme {\n const theme = easyPeasyGrade4Themes.find(\n (candidate) => candidate.themeId === themeId,\n );\n if (!theme) throw new Error('Unknown Easy Peasy Grade 4 theme.');\n return theme;\n}\n\n/** Calls the public pointer-only importer; it never fetches packets or lesson bodies. */\nexport async function importEasyPeasyGrade4Course(\n service: Pick<SourceImportService, 'importCourse'>,\n request: Omit<SourceImportRequest, 'courseRef' | 'pageUrl'> & {\n courseRef: string;\n },\n): Promise<SourceImportResult> {\n const course = easyPeasyGrade4Courses.find(\n (candidate) => candidate.courseRef === request.courseRef,\n );\n if (!course) throw new Error('Unknown Easy Peasy Grade 4 course reference.');\n if (course.enrollmentMode === 'choose-one-theme')\n throw new Error(\n 'Theme choices are catalog pointers; select an official constituent course before importing lessons.',\n );\n return service.importCourse({\n ...request,\n pageUrl: course.pageUrl,\n subject: course.subject,\n });\n}\n\nexport async function importEasyPeasyGrade4Theme(\n service: Pick<SourceImportService, 'importCourse'>,\n request: Omit<SourceImportRequest, 'courseRef' | 'pageUrl'> & {\n themeId: EasyPeasyGrade4Theme['themeId'];\n },\n): Promise<EasyPeasyThemeImportResult> {\n const theme = grade4Theme(request.themeId);\n const results = await Promise.all(\n theme.courses.map((course) =>\n service.importCourse({\n ...request,\n courseRef: course.courseRef,\n pageUrl: course.pageUrl,\n subject: course.subject,\n }),\n ),\n );\n return {\n themeId: theme.themeId,\n courseIds: results.map((result) => result.courseId),\n };\n}\n","import { SmrtRecipe } from '@happyvertical/smrt-core';\nimport { Course, CourseSection, Lesson } from './catalog.js';\nimport { Curriculum, Enrollment, Learner, LessonProgress } from './learners.js';\nimport { LessonAsset } from './lesson-assets.js';\n\nexport class EducationCatalogRecipe extends SmrtRecipe {\n static id = 'education.catalog';\n static help = './education-catalog.recipe.md';\n static label = 'Course catalog';\n static summary =\n 'Organize courses, sections, lessons, and their authorized learning materials.';\n static synonyms = ['courses', 'lessons', 'curriculum catalog'];\n static section = {\n id: 'education',\n label: 'Education',\n icon: 'folder',\n description: 'Courses and lessons for learning.',\n };\n static models = [Course, CourseSection, Lesson, LessonAsset];\n static runtime = 'both' as const;\n static nav = [\n {\n label: 'Courses',\n model: Course,\n icon: 'folder',\n description: 'Courses available to this family.',\n noun: 'course',\n },\n ];\n}\n\n/** Metadata for host composition; never grants generated CRUD authority. */\nexport class EducationLearnerRecipe extends SmrtRecipe {\n static id = 'education.learner';\n static help = './education-learner.recipe.md';\n static label = 'Learners';\n static summary =\n 'Plan learner curricula and retain enrollment-scoped progress.';\n static synonyms = ['learners', 'enrollments', 'learning progress'];\n static section = {\n id: 'education',\n label: 'Education',\n icon: 'folder',\n description: 'Courses and lessons for learning.',\n };\n static models = [Learner, Curriculum, Enrollment, LessonProgress];\n static runtime = 'both' as const;\n static nav = [\n {\n label: 'Learners',\n model: Learner,\n icon: 'users',\n description: 'Authorized learners in this family.',\n noun: 'learner',\n },\n ];\n}\n","/** A pointer-only representation of an Easy Peasy lesson. */\nexport interface ParsedSourceLesson {\n day: number;\n title: string;\n externalRef: string;\n externalUrl: string;\n worksheet: boolean;\n printableUrl?: string;\n}\n\nexport interface ParsedSourceCourse {\n title: string;\n lessons: ParsedSourceLesson[];\n packetUrl?: string;\n}\n\nconst approvedHosts = new Set([\n 'allinonehomeschool.com',\n 'www.allinonehomeschool.com',\n]);\n\n/**\n * Resolve and constrain source URLs before either fetching or retaining them.\n * Easy Peasy links must remain HTTPS links to the source site; imported data\n * must never become an open redirect or a pointer to a third-party PDF.\n */\nexport function validateEasyPeasyUrl(value: string, baseUrl?: string): string {\n let url: URL;\n try {\n url = new URL(value, baseUrl);\n } catch {\n throw new Error('Easy Peasy URL is invalid.');\n }\n if (url.protocol !== 'https:' || url.port || !approvedHosts.has(url.hostname))\n throw new Error('Easy Peasy URL must use an approved HTTPS source host.');\n if (url.username || url.password)\n throw new Error('Easy Peasy URL must not include credentials.');\n return url.toString();\n}\n\ninterface HeadingMatch {\n index: number;\n end: number;\n text: string;\n /** The official daily container is authoritative even when it lacks a heading. */\n day?: number;\n fragment?: string;\n title?: string;\n containerEnd?: number;\n levelRange?: readonly [number, number];\n hasLessonMarker?: boolean;\n}\n\ninterface LinkMatch {\n href: string;\n text: string;\n}\n\nfunction decodeHtml(value: string): string {\n return value.replace(\n /&(#x[\\da-f]+|#\\d+|amp|apos|gt|lt|nbsp|quot);/gi,\n (entity) => {\n const named: Record<string, string> = {\n '&': '&',\n ''': \"'\",\n '>': '>',\n '<': '<',\n ' ': ' ',\n '"': '\"',\n };\n const lower = entity.toLowerCase();\n if (lower in named) return named[lower];\n const number = lower.startsWith('&#x')\n ? Number.parseInt(lower.slice(3, -1), 16)\n : Number.parseInt(lower.slice(2, -1), 10);\n return Number.isSafeInteger(number) && number <= 0x10ffff\n ? String.fromCodePoint(number)\n : entity;\n },\n );\n}\n\nfunction textContent(value: string): string {\n return decodeHtml(value.replace(/<[^>]*>/g, ' '))\n .replace(/\\s+/g, ' ')\n .trim();\n}\n\nfunction attribute(attributes: string, name: string): string | undefined {\n const match = new RegExp(\n `(?:^|[\\\\t\\\\n\\\\f\\\\r ])${name}\\\\s*=\\\\s*(?:\"([^\"]*)\"|'([^']*)'|([^\\\\s>]+))`,\n 'i',\n ).exec(attributes);\n return match?.[1] ?? match?.[2] ?? match?.[3];\n}\n\n/** Return the end of a div without mistaking a nested layout div for its end. */\nfunction closingDivEnd(html: string, start: number): number {\n const tags = /<\\/?div\\b[^>]*>/gi;\n tags.lastIndex = start;\n let depth = 1;\n for (let tag = tags.exec(html); tag; tag = tags.exec(html)) {\n if (/^<\\/div\\b/i.test(tag[0])) depth -= 1;\n else depth += 1;\n if (depth === 0) return tag.index + tag[0].length;\n }\n return start;\n}\n\nfunction lessonHeadings(html: string): HeadingMatch[] {\n const containers: HeadingMatch[] = [];\n const divs = /<div\\b([^>]*)>/gi;\n for (const match of html.matchAll(divs)) {\n const id = attribute(match[1], 'id');\n const marker = /^(day|week)(\\d+)$/i.exec(id ?? '');\n if (!marker) continue;\n const number = Number.parseInt(marker[2], 10);\n if (!Number.isSafeInteger(number) || number < 1)\n throw new Error(`Easy Peasy daily container is malformed: ${id}`);\n const weekly = marker[1].toLowerCase() === 'week';\n const index = match.index ?? 0;\n const end = index + match[0].length;\n const containerEnd = closingDivEnd(html, end);\n const body = html.slice(end, containerEnd);\n const level = /\\blevels?\\s+(\\d+)\\s*[-–]\\s*(\\d+)\\b/i.exec(textContent(body));\n containers.push({\n index,\n end,\n text: weekly ? `Week ${number}` : `Lesson ${number}`,\n day: number,\n fragment: `${weekly ? 'week' : 'day'}${number}`,\n ...(weekly ? { title: `Week ${number}` } : {}),\n containerEnd,\n ...(level\n ? {\n levelRange: [\n Number.parseInt(level[1], 10),\n Number.parseInt(level[2], 10),\n ] as const,\n }\n : {}),\n hasLessonMarker: new RegExp(\n `\\\\bLessons?\\\\s+${number}(?:\\\\D|$)`,\n 'i',\n ).test(textContent(body)),\n });\n }\n containers.sort((left, right) => left.index - right.index);\n const grade = 4;\n const gradeContainers = containers.filter(\n (container) =>\n !container.levelRange ||\n (container.levelRange[0] <= grade && grade <= container.levelRange[1]),\n );\n const selectedContainers: HeadingMatch[] = [];\n for (const container of gradeContainers) {\n const peers = gradeContainers.filter(\n (candidate) => candidate.day === container.day,\n );\n if (peers[0] !== container) continue;\n if (peers.length === 1) selectedContainers.push(container);\n else {\n const marked = peers.filter((candidate) => candidate.hasLessonMarker);\n if (marked.length !== 1)\n throw new Error(\n `Easy Peasy lesson day is invalid or duplicated: ${container.day}`,\n );\n selectedContainers.push(marked[0]);\n }\n }\n const isInDailyContainer = (index: number): boolean =>\n selectedContainers.some(\n (container) =>\n container.index <= index &&\n index < (container.containerEnd ?? container.end),\n );\n const isDetachedDailyMarker = (index: number, text: string): boolean => {\n const day = /^lesson\\s+(\\d+)\\b/i.exec(text)?.[1];\n if (!day) return false;\n return selectedContainers.some(\n (container) =>\n container.day === Number.parseInt(day, 10) &&\n (container.containerEnd ?? container.end) <= index &&\n !textContent(\n html.slice(container.containerEnd ?? container.end, index),\n ),\n );\n };\n\n const matches: HeadingMatch[] = [...selectedContainers];\n // Some older official pages use a bare layout div for each lesson instead of\n // a day id. Accept only a direct bold child: a nested generic block remains\n // ambiguous and is rejected below.\n const directDivLessons =\n /<div\\b[^>]*>\\s*<(?:strong|b)\\b[^>]*>([\\s\\S]*?)<\\/(?:strong|b)\\s*>/gi;\n const bareDivMarkers: HeadingMatch[] = [];\n for (const match of html.matchAll(directDivLessons)) {\n if (isInDailyContainer(match.index ?? 0)) continue;\n const text = textContent(match[1]);\n if (!/^lesson\\b/i.test(text)) continue;\n if (isDetachedDailyMarker(match.index ?? 0, text)) continue;\n bareDivMarkers.push({\n index: match.index ?? 0,\n end: (match.index ?? 0) + match[0].length,\n text,\n });\n }\n // A lone unlabelled div marker cannot establish a course structure. Older\n // Easy Peasy course pages use a sequence of these divs; accepting a single\n // marker would turn malformed refresh input into a partial import.\n if (bareDivMarkers.length > 1) matches.push(...bareDivMarkers);\n const weeks = /<(?:strong|b)\\b([^>]*)>([\\s\\S]*?)<\\/(?:strong|b)\\s*>/gi;\n for (const match of html.matchAll(weeks)) {\n if (isInDailyContainer(match.index ?? 0)) continue;\n const id = attribute(match[1], 'id');\n const day = /^week(\\d+)$/i.exec(id ?? '')?.[1];\n const text = textContent(match[2]);\n if (!day || !/^week\\s+\\d+\\s*$/i.test(text)) continue;\n const number = Number.parseInt(day, 10);\n if (!Number.isSafeInteger(number) || number < 1)\n throw new Error(`Easy Peasy weekly marker is malformed: ${id}`);\n const statedMatch = /^week\\s+(\\d+)/i.exec(text);\n if (!statedMatch) continue;\n const stated = Number.parseInt(statedMatch[1], 10);\n if (stated !== number)\n throw new Error('Easy Peasy weekly container and marker disagree.');\n matches.push({\n index: match.index ?? 0,\n end: (match.index ?? 0) + match[0].length,\n text,\n day: number,\n fragment: `week${number}`,\n title: `Week ${number}`,\n });\n }\n const headings = /<h[1-6]\\b[^>]*>([\\s\\S]*?)<\\/h[1-6]\\s*>/gi;\n for (const match of html.matchAll(headings)) {\n if (isInDailyContainer(match.index ?? 0)) continue;\n matches.push({\n index: match.index ?? 0,\n end: (match.index ?? 0) + match[0].length,\n text: textContent(match[1]),\n });\n }\n const blocks = /<(p|li)\\b[^>]*>([\\s\\S]*?)<\\/\\1\\s*>/gi;\n for (const block of html.matchAll(blocks)) {\n if (isInDailyContainer(block.index ?? 0)) continue;\n const bold = /<(?:strong|b)\\b[^>]*>([\\s\\S]*?)<\\/(?:strong|b)\\s*>/i.exec(\n block[2],\n );\n if (!bold) continue;\n const text = textContent(bold[1]);\n if (!/^lesson\\b/i.test(text)) continue;\n if (isDetachedDailyMarker(block.index ?? 0, text)) continue;\n const boldIndex = (block.index ?? 0) + block[0].indexOf(bold[0]);\n matches.push({\n index: block.index ?? 0,\n end: boldIndex + bold[0].length,\n text,\n });\n }\n const sorted = matches.sort((left, right) => left.index - right.index);\n const boldMarkers = /<(strong|b)\\b[^>]*>([\\s\\S]*?)<\\/\\1\\s*>/gi;\n for (const marker of html.matchAll(boldMarkers)) {\n if (!/^lesson\\b/i.test(textContent(marker[2]))) continue;\n const index = marker.index ?? 0;\n const end = index + marker[0].length;\n const accountedFor =\n isInDailyContainer(index) ||\n isDetachedDailyMarker(index, textContent(marker[2])) ||\n sorted.some(\n (heading) =>\n /^lesson\\b/i.test(heading.text) &&\n (heading.index === index ||\n (heading.index <= index && end <= heading.end)),\n );\n if (!accountedFor)\n throw new Error('Easy Peasy lesson marker layout is unsupported.');\n }\n return sorted;\n}\n\nfunction lessonMarkerText(segment: string): string | undefined {\n const markers = /<(?:strong|b)\\b[^>]*>([\\s\\S]*?)<\\/(?:strong|b)\\s*>/gi;\n for (const marker of segment.matchAll(markers)) {\n const text = textContent(marker[1]);\n if (/^lesson\\b/i.test(text)) return text;\n }\n return undefined;\n}\n\nfunction parseLessonMarker(value: string): { day: number; worksheet: boolean } {\n const match = /^lesson\\s+(\\d+)\\s*(\\*|\\(\\*\\))?(?:\\s*\\(|\\s*$)/i.exec(value);\n if (!match)\n throw new Error(`Easy Peasy lesson heading is malformed: ${value}`);\n return {\n day: Number.parseInt(match[1], 10),\n worksheet: match[2] === '*' || match[2] === '(*)',\n };\n}\n\n/** Reject incomplete lesson markup before the tolerant extractors can skip it. */\nfunction rejectUnterminatedLessonTags(html: string): void {\n const openings = /<(h[1-6]|strong|b)\\b[^>]*>\\s*(?:<[^>]*>\\s*)*lesson\\b/gi;\n const candidates = [...html.matchAll(openings)];\n for (let index = 0; index < candidates.length; index += 1) {\n const opening = candidates[index];\n const tag = opening[1].toLowerCase();\n const afterOpening = (opening.index ?? 0) + opening[0].length;\n const closing = new RegExp(`<\\\\/${tag}\\\\s*>`, 'i').exec(\n html.slice(afterOpening),\n );\n const closingIndex = closing\n ? afterOpening + (closing.index ?? 0)\n : Number.POSITIVE_INFINITY;\n const nextOpening =\n candidates[index + 1]?.index ?? Number.POSITIVE_INFINITY;\n if (closingIndex > nextOpening || !Number.isFinite(closingIndex))\n throw new Error(\n 'Easy Peasy lesson heading is unterminated or mismatched.',\n );\n }\n}\n\nfunction links(html: string): LinkMatch[] {\n const result: LinkMatch[] = [];\n const anchors = /<a\\b([^>]*)>([\\s\\S]*?)<\\/a\\s*>/gi;\n for (const match of html.matchAll(anchors)) {\n const href = attribute(match[1], 'href');\n if (href)\n result.push({ href: decodeHtml(href), text: textContent(match[2]) });\n }\n return result;\n}\n\nfunction isPdfLink(link: LinkMatch): boolean {\n return /\\.pdf(?:[?#]|$)/i.test(link.href);\n}\n\nfunction isAnswerLink(link: LinkMatch): boolean {\n return /\\banswers?(?:\\s+key)?\\b/i.test(`${link.href} ${link.text}`);\n}\n\nfunction isPacketLink(link: LinkMatch): boolean {\n return /\\b(?:packet|whole course|complete course)\\b/i.test(link.text);\n}\n\nfunction isSupplementalPdfLink(link: LinkMatch): boolean {\n return /\\b(?:directions?|instructions?)\\b/i.test(`${link.href} ${link.text}`);\n}\n\nfunction courseTitle(html: string): string {\n const entryTitle =\n /<h1\\b(?=[^>]*\\bclass=(?:\"[^\"]*\\bentry-title\\b[^\"]*\"|'[^']*\\bentry-title\\b[^']*'|[^\\s>]*\\bentry-title\\b))[^>]*>([\\s\\S]*?)<\\/h1\\s*>/i.exec(\n html,\n )?.[1];\n const h1 = /<h1\\b[^>]*>([\\s\\S]*?)<\\/h1\\s*>/i.exec(html)?.[1];\n const title = /<title\\b[^>]*>([\\s\\S]*?)<\\/title\\s*>/i.exec(html)?.[1];\n const value = textContent(entryTitle ?? h1 ?? title ?? '');\n if (!value) throw new Error('Easy Peasy page has no title.');\n return value;\n}\n\nfunction isApprovedSourcePdf(link: LinkMatch, pageUrl: string): boolean {\n try {\n sourcePdf(link, pageUrl);\n return true;\n } catch {\n return false;\n }\n}\n\nfunction sourcePdf(link: LinkMatch, pageUrl: string): string {\n const url = validateEasyPeasyUrl(link.href, pageUrl);\n const parsed = new URL(url);\n if (!parsed.pathname.startsWith('/wp-content/'))\n throw new Error('Easy Peasy PDF must be hosted under wp-content.');\n if (!/\\.pdf$/i.test(parsed.pathname))\n throw new Error('Easy Peasy printable URL must be a PDF.');\n return url;\n}\n\nfunction canonicalWorksheetLink(\n links: LinkMatch[],\n pageUrl: string,\n): LinkMatch[] {\n if (links.length < 2) return links;\n const stem = (link: LinkMatch): string => {\n const pathname = new URL(link.href, pageUrl).pathname;\n return pathname\n .slice(pathname.lastIndexOf('/') + 1)\n .replace(/\\.pdf$/i, '')\n .toLowerCase();\n };\n const escapeRegex = (value: string): string =>\n value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n const canonical = links.filter((candidate) => {\n const candidateStem = stem(candidate);\n const variant = new RegExp(`^${escapeRegex(candidateStem)}(?:[-_ ]?\\\\d+)$`);\n return links.every(\n (link) => link === candidate || variant.test(stem(link)),\n );\n });\n // Multi-page worksheet variants retain the course-day pointer and one\n // canonical printable URL; unrelated multiple PDFs remain a hard failure.\n return canonical.length === 1 ? canonical : links;\n}\n\ninterface PrintablePointer {\n printableUrl?: string;\n hasSourcePdf: boolean;\n}\n\nfunction printableFor(\n segment: string,\n pageUrl: string,\n day: number,\n): PrintablePointer {\n const pdfLinks = links(segment)\n .filter(isPdfLink)\n .filter(\n (link) =>\n !isAnswerLink(link) &&\n !isPacketLink(link) &&\n !isSupplementalPdfLink(link) &&\n isApprovedSourcePdf(link, pageUrl),\n );\n const ownDay = new RegExp(`(?:day|lesson)[\\\\s_-]*${day}(?:\\\\D|$)`, 'i');\n const dayLinks = pdfLinks.filter((link) =>\n ownDay.test(`${link.href} ${link.text}`),\n );\n const candidates = canonicalWorksheetLink(\n dayLinks.length ? dayLinks : pdfLinks,\n pageUrl,\n );\n if (candidates.length > 1)\n // The course page remains the lesson pointer; this bounded model deliberately\n // retains no printable when the source publishes multiple source PDFs.\n return { hasSourcePdf: true };\n return candidates[0]\n ? { printableUrl: sourcePdf(candidates[0], pageUrl), hasSourcePdf: true }\n : { hasSourcePdf: false };\n}\n\nfunction packetFor(html: string, pageUrl: string): string | undefined {\n const packets = links(html).filter(\n (link) => isPdfLink(link) && !isAnswerLink(link) && isPacketLink(link),\n );\n if (packets.length > 1)\n throw new Error('Easy Peasy page has ambiguous packet PDFs.');\n return packets[0] ? sourcePdf(packets[0], pageUrl) : undefined;\n}\n\n/** Parse only the course title, day pointers, and source-hosted printable links. */\nexport function parseEasyPeasyPage(\n html: string,\n pageUrl: string,\n): ParsedSourceCourse {\n const normalizedPageUrl = validateEasyPeasyUrl(pageUrl);\n const source = html\n .replace(/<!--[\\s\\S]*?-->/g, '')\n .replace(/<(script|style)\\b[^>]*>[\\s\\S]*?<\\/\\1\\s*>/gi, '');\n rejectUnterminatedLessonTags(source);\n const title = courseTitle(source);\n const headings = lessonHeadings(source);\n const lessons: ParsedSourceLesson[] = [];\n const days = new Set<number>();\n\n for (let index = 0; index < headings.length; index += 1) {\n const heading = headings[index];\n if (heading.day === undefined && !/^lesson\\b/i.test(heading.text)) continue;\n const segment = source.slice(heading.end, headings[index + 1]?.index);\n const marker =\n heading.day === undefined ? heading.text : lessonMarkerText(segment);\n let parsedMarker: { day: number; worksheet: boolean } | undefined;\n if (marker) {\n try {\n parsedMarker = parseLessonMarker(marker);\n } catch (error) {\n // A source-controlled day/week container remains authoritative when it\n // includes a decorative nonnumeric \"Lesson\" label.\n if (heading.day === undefined) throw error;\n }\n }\n const day = heading.day ?? parsedMarker?.day;\n if (\n !day ||\n (heading.day !== undefined && parsedMarker && parsedMarker.day !== day)\n )\n throw new Error('Easy Peasy daily container and lesson marker disagree.');\n if (!Number.isSafeInteger(day) || day < 1 || days.has(day))\n throw new Error(`Easy Peasy lesson day is invalid or duplicated: ${day}`);\n days.add(day);\n const printable = printableFor(segment, normalizedPageUrl, day);\n // Some official daily containers put the worksheet asterisk on a child\n // activity label rather than the Lesson marker. A source-hosted printable\n // is sufficient evidence without retaining that activity text.\n const worksheet = parsedMarker?.worksheet ?? printable.hasSourcePdf;\n const page = new URL(normalizedPageUrl);\n page.hash = heading.fragment ?? `lesson-${day}`;\n lessons.push({\n day,\n title: heading.title ?? `Lesson ${day}`,\n externalRef: `lesson:${day}`,\n externalUrl: page.toString(),\n worksheet,\n ...(printable.printableUrl\n ? { printableUrl: printable.printableUrl }\n : {}),\n });\n }\n if (!lessons.length)\n throw new Error('Easy Peasy page has no lesson headings.');\n const packetUrl = packetFor(source, normalizedPageUrl);\n return { title, lessons, ...(packetUrl ? { packetUrl } : {}) };\n}\n","import {\n isEmbeddedDatabase,\n isPostgresDatabase,\n withEmbeddedWriteQueue,\n} from '@happyvertical/smrt-core';\nimport { getCurrentTenant } from '@happyvertical/smrt-tenancy';\nimport type { DatabaseInterface } from '@happyvertical/sql';\nimport { ExternalCourse } from './catalog.js';\nimport { CatalogAuthorizationError } from './catalog-service.js';\nimport {\n CourseCollection,\n CourseSectionCollection,\n ExternalCourseCollection,\n LessonCollection,\n ReadingCollection,\n WorksheetCollection,\n} from './collections.js';\nimport {\n type CourseSource,\n CourseSourceCollection,\n type SourceSharing,\n} from './course-source.js';\nimport {\n parseEasyPeasyPage,\n validateEasyPeasyUrl,\n} from './sources/easy-peasy-parser.js';\n\nexport interface SourceImportRequest {\n tenantId: string;\n actorUserId: string;\n sourceId: string;\n /** Host-stable identity, independent of the page's current URL. */\n courseRef: string;\n /** Optional trusted catalog classification retained on the tenant course. */\n subject?: string;\n pageUrl: string;\n destination: 'private' | 'group';\n}\nexport interface SourceImportAuthorization {\n action: 'education.source.import' | 'education.source.ensure';\n actorTenantId: string;\n actorUserId: string;\n sourceId: string;\n sourceSharing: SourceSharing;\n destination: 'private' | 'group';\n licenseEvidence: string;\n}\nexport type SourceImportAuthorizer = (\n request: SourceImportAuthorization,\n) => boolean | Promise<boolean>;\nexport interface EasyPeasyRegistration {\n /** Supplied by host configuration after its operator accepts the source terms. */\n termsAccepted: true;\n /** Must honor redirect:error and bound response size/time. Never fetch PDFs. */\n fetchPage: (\n url: string,\n options: { redirect: 'error' },\n ) => Promise<{ html: string; url: string }>;\n}\nexport interface SourceImportResult {\n courseId: string;\n lessonIds: string[];\n /** Source-hosted packet link, returned without fetching or persisting its content. */\n packetUrl?: string;\n}\nexport interface EnsureEasyPeasyCourseSourceRequest {\n tenantId: string;\n actorUserId: string;\n}\nexport interface EnsureEasyPeasyCourseSourceResult {\n sourceId: string;\n}\n\nasync function identity(...parts: string[]): Promise<string> {\n const digest = await globalThis.crypto.subtle.digest(\n 'SHA-256',\n new TextEncoder().encode(\n JSON.stringify(['smrt.education.source.v1', ...parts]),\n ),\n );\n const hex = Array.from(new Uint8Array(digest), (byte) =>\n byte.toString(16).padStart(2, '0'),\n ).join('');\n return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-5${hex.slice(13, 16)}-a${hex.slice(17, 20)}-${hex.slice(20, 32)}`;\n}\n\nasync function requireOwnedIdentity(\n db: DatabaseInterface,\n table: string,\n id: string,\n tenantId: string,\n): Promise<void> {\n // A filtered collection get cannot distinguish absence from a corrupt foreign\n // owner at our deterministic ID. Check only to deny; never return that row.\n if (\n (await db.get(table, { id })) &&\n !(await db.get(table, { id, tenant_id: tenantId }))\n )\n throw new CatalogAuthorizationError();\n}\n\nfunction retryable(error: unknown): boolean {\n let current = error;\n let contention = false;\n for (\n let depth = 0;\n depth < 5 && current && typeof current === 'object';\n depth++\n ) {\n const failure = current as {\n code?: unknown;\n cause?: unknown;\n connectionInvalidated?: boolean;\n };\n if (failure.connectionInvalidated) return false;\n contention ||= [\n 'SQLITE_BUSY',\n 'SQLITE_BUSY_SNAPSHOT',\n '40001',\n '40P01',\n ].includes(String(failure.code));\n current = failure.cause;\n }\n return contention;\n}\n\n/** Opt-in, pointer-only import. Host authorization defines family/group roles. */\nexport class SourceImportService {\n private easyPeasy?: Readonly<EasyPeasyRegistration>;\n constructor(\n private readonly db: DatabaseInterface,\n private readonly authorize: SourceImportAuthorizer,\n ) {}\n\n registerEasyPeasy(registration: EasyPeasyRegistration): void {\n if (\n registration.termsAccepted !== true ||\n typeof registration.fetchPage !== 'function'\n )\n throw new Error(\n 'Easy Peasy terms must be accepted by the host before registration.',\n );\n this.easyPeasy = Object.freeze({\n termsAccepted: true,\n fetchPage: registration.fetchPage,\n });\n }\n\n async ensureEasyPeasyCourseSource(\n input: EnsureEasyPeasyCourseSourceRequest,\n ): Promise<EnsureEasyPeasyCourseSourceResult> {\n const request = Object.freeze({ ...input });\n const active = getCurrentTenant();\n if (\n !request.tenantId?.trim() ||\n !request.actorUserId?.trim() ||\n active?.tenantId !== request.tenantId ||\n active.userId !== request.actorUserId ||\n active.superAdminBypass\n )\n throw new CatalogAuthorizationError();\n if (!this.easyPeasy)\n throw new Error('Easy Peasy is not registered by this host.');\n const sourceId = await identity(request.tenantId, 'easy-peasy');\n if (\n (await this.authorize({\n action: 'education.source.ensure',\n actorTenantId: request.tenantId,\n actorUserId: request.actorUserId,\n sourceId,\n sourceSharing: 'private',\n destination: 'private',\n licenseEvidence: '',\n })) !== true\n )\n throw new CatalogAuthorizationError();\n if (!this.db.transaction)\n throw new Error('Source provisioning requires real transactions.');\n const transaction = this.db.transaction;\n return withEmbeddedWriteQueue(\n this.db,\n isEmbeddedDatabase(this.db),\n async () => {\n for (let attempt = 0; ; attempt++) {\n try {\n return await transaction(async (tx) => {\n if (isPostgresDatabase(this.db))\n await tx.query(\n 'SELECT pg_advisory_xact_lock(hashtextextended($1, 0))',\n sourceId,\n );\n const sources = await CourseSourceCollection.create({ db: tx });\n const existing = await sources.get(sourceId);\n if (existing) {\n if (\n existing.tenantId !== request.tenantId ||\n existing.key !== 'easy-peasy' ||\n existing.kind !== 'adapter' ||\n existing.adapterKey !== 'easy-peasy' ||\n existing.sharing !== 'private'\n )\n throw new Error(\n 'Existing Easy Peasy source policy cannot be changed by provisioning.',\n );\n } else {\n await sources.create({\n id: sourceId,\n tenantId: request.tenantId,\n key: 'easy-peasy',\n name: 'Easy Peasy All-in-One Homeschool',\n kind: 'adapter',\n adapterKey: 'easy-peasy',\n sharing: 'private',\n });\n }\n return { sourceId };\n });\n } catch (error) {\n if (attempt >= 3 || !retryable(error)) throw error;\n await new Promise((resolve) =>\n setTimeout(resolve, 5 * 2 ** attempt),\n );\n }\n }\n },\n );\n }\n\n private actor(request: SourceImportRequest): void {\n const active = getCurrentTenant();\n if (\n !request.tenantId?.trim() ||\n !request.actorUserId?.trim() ||\n active?.tenantId !== request.tenantId ||\n active.userId !== request.actorUserId ||\n active.superAdminBypass\n )\n throw new CatalogAuthorizationError();\n if (request.destination !== 'private' && request.destination !== 'group')\n throw new Error(\n 'Only private-family or licensed-group destinations are supported.',\n );\n if (\n !request.sourceId?.trim() ||\n !request.courseRef?.trim() ||\n request.courseRef.length > 256 ||\n (request.subject !== undefined &&\n (!request.subject.trim() || request.subject.length > 256))\n )\n throw new Error('A source and stable course reference are required.');\n }\n\n private async source(\n db: DatabaseInterface,\n request: SourceImportRequest,\n ): Promise<CourseSource> {\n this.actor(request);\n const source = await (await CourseSourceCollection.create({ db })).get(\n request.sourceId,\n );\n if (!source || source.tenantId !== request.tenantId)\n throw new CatalogAuthorizationError();\n if (\n source.kind !== 'adapter' ||\n source.adapterKey !== 'easy-peasy' ||\n !['private', 'group', 'global'].includes(source.sharing)\n )\n throw new Error('Unsupported source policy.');\n const licenseEvidence = source.getConfig().licenseEvidence?.trim() ?? '';\n if (\n request.destination === 'group' &&\n (source.sharing === 'private' || !licenseEvidence)\n )\n throw new Error(\n 'Source sharing and explicit licensing evidence must permit group import.',\n );\n if (\n (await this.authorize({\n action: 'education.source.import',\n actorTenantId: request.tenantId,\n actorUserId: request.actorUserId,\n sourceId: request.sourceId,\n sourceSharing: source.sharing,\n destination: request.destination,\n licenseEvidence,\n })) !== true\n )\n throw new CatalogAuthorizationError();\n this.actor(request);\n return source;\n }\n\n async importCourse(input: SourceImportRequest): Promise<SourceImportResult> {\n // Snapshot caller input before any host callback can mutate it.\n const request = Object.freeze({ ...input });\n this.actor(request);\n const adapter = this.easyPeasy;\n if (!adapter) throw new Error('Easy Peasy is not registered by this host.');\n const registeredSource = await this.source(this.db, request);\n const pageUrl = validateEasyPeasyUrl(request.pageUrl);\n const response = await adapter.fetchPage(pageUrl, { redirect: 'error' });\n if (validateEasyPeasyUrl(response.url) !== pageUrl)\n throw new Error('Unexpected source redirect.');\n if (typeof response.html !== 'string' || response.html.length > 2_000_000)\n throw new Error('Invalid or oversized source page.');\n const parsed = parseEasyPeasyPage(response.html, pageUrl);\n const courseId = await identity(\n request.tenantId,\n String(registeredSource.id),\n request.courseRef,\n );\n return withEmbeddedWriteQueue(\n this.db,\n isEmbeddedDatabase(this.db),\n async () => {\n if (!this.db.transaction)\n throw new Error('Source imports require real transactions.');\n for (let attempt = 0; ; attempt++) {\n try {\n return await this.db.transaction(async (tx) => {\n if (isPostgresDatabase(this.db))\n await tx.query(\n 'SELECT pg_advisory_xact_lock(hashtextextended($1, 0))',\n courseId,\n );\n const source = await this.source(tx, request);\n const courses = await ExternalCourseCollection.create({ db: tx });\n const sections = await CourseSectionCollection.create({ db: tx });\n const lessons = await LessonCollection.create({ db: tx });\n const readings = await ReadingCollection.create({ db: tx });\n const worksheets = await WorksheetCollection.create({ db: tx });\n await requireOwnedIdentity(\n tx,\n 'courses',\n courseId,\n request.tenantId,\n );\n const licenseKind =\n request.destination === 'private'\n ? 'personal-use-copy'\n : 'licensed-for-sharing';\n const existing = await (\n await CourseCollection.create({ db: tx })\n ).get(courseId);\n if (\n existing &&\n (!(existing instanceof ExternalCourse) ||\n existing.tenantId !== request.tenantId ||\n existing.sourceKey !== source.key ||\n existing.sourceRef !== request.courseRef ||\n existing.licenseKind !== licenseKind)\n )\n throw new Error(\n 'Existing course ownership, source, or license cannot be changed by import.',\n );\n if (existing) {\n existing.title = parsed.title;\n existing.sourceUrl = pageUrl;\n if (request.subject) existing.subject = request.subject.trim();\n await existing.save();\n } else {\n await courses.create({\n id: courseId,\n tenantId: request.tenantId,\n title: parsed.title,\n subject: request.subject?.trim() ?? '',\n sourceKey: source.key,\n sourceRef: request.courseRef,\n sourceUrl: pageUrl,\n licenseKind,\n licenseNote: source.getConfig().licenseEvidence ?? '',\n status: 'draft',\n });\n }\n const sectionId = await identity(courseId, 'lessons');\n await requireOwnedIdentity(\n tx,\n 'course_sections',\n sectionId,\n request.tenantId,\n );\n const section = await sections.get(sectionId);\n if (section) {\n if (\n section.tenantId !== request.tenantId ||\n section.courseId !== courseId\n )\n throw new Error(\n 'Existing section ownership cannot be changed by import.',\n );\n } else {\n await sections.create({\n id: sectionId,\n tenantId: request.tenantId,\n courseId,\n title: 'Lessons',\n sortOrder: 0,\n });\n }\n const lessonIds: string[] = [];\n for (const item of parsed.lessons) {\n const id = await identity(courseId, item.externalRef);\n await requireOwnedIdentity(tx, 'lessons', id, request.tenantId);\n const lesson = await lessons.get(id);\n if (lesson) {\n if (\n lesson.tenantId !== request.tenantId ||\n lesson.sectionId !== sectionId ||\n lesson.externalRef !== item.externalRef ||\n 'printableUrl' in lesson !== item.worksheet\n )\n throw new Error(\n 'Existing lesson ownership or kind cannot be changed by import.',\n );\n lesson.title = item.title;\n lesson.externalUrl = item.externalUrl;\n if ('printableUrl' in lesson)\n lesson.printableUrl = item.printableUrl ?? '';\n await lesson.save();\n } else {\n await (item.worksheet ? worksheets : readings).create({\n id,\n tenantId: request.tenantId,\n sectionId,\n title: item.title,\n externalRef: item.externalRef,\n externalUrl: item.externalUrl,\n sortOrder: item.day,\n ...(item.worksheet\n ? { printableUrl: item.printableUrl ?? '' }\n : {}),\n });\n }\n lessonIds.push(id);\n }\n return {\n courseId,\n lessonIds,\n ...(parsed.packetUrl ? { packetUrl: parsed.packetUrl } : {}),\n };\n });\n } catch (error) {\n if (attempt >= 3 || !retryable(error)) throw error;\n await new Promise((resolve) =>\n setTimeout(resolve, 5 * 2 ** attempt),\n );\n }\n }\n },\n );\n }\n}\n","import type {\n DriveAcquisition,\n DriveAcquisitionOptions,\n DriveFileMetadata,\n DriveMetadataPage,\n DriveMetadataPageOptions,\n GoogleDriveProvider,\n} from '@happyvertical/files';\nimport type {\n CatalogAcquireAdapter,\n CatalogSourceRecord,\n CatalogSyncAdapter,\n CatalogSyncPage,\n} from '../catalog-contracts.js';\n\nexport type {\n DriveAcquisition,\n DriveAcquisitionOptions,\n DriveFileMetadata,\n DriveMetadataPage,\n DriveMetadataPageOptions,\n};\n\n/**\n * Metadata-only Google Drive curriculum discovery.\n *\n * This module deliberately accepts the public @happyvertical/files Drive\n * surface as a port. Hosts construct that SDK provider with their own\n * application credentials and pass it here; neither discovery records nor\n * checkpoints contain credentials or downloaded content.\n */\n\nexport const DRIVE_CURRICULUM_SEED_ROOTS = [\n {\n id: '1K_au1upSRuakX55PF3aZzQLHWI70KwZd',\n title: 'Carnival of Collisions (Contact Forces)',\n },\n {\n id: '1N1xFJ2omm-M1TuAxDOXQxZndkw70-KxM',\n title: 'Mission Maglev (Electric and Magnetic Forces)',\n },\n {\n id: '1v0LXs7iky2R4FsiqZkWOjWyJmRu-aVIa',\n title: 'Rocks vs. Big Rigs, Unit-Wide View',\n },\n {\n id: '1sFDNXdw8q-xrhgy8HFAMELXUoqKgp9tu',\n title: 'Operation Space Jump (Gravitational Forces)',\n },\n] as const;\n\nconst GOOGLE_FOLDER_MIME = 'application/vnd.google-apps.folder';\n\n/** The adapter only uses public SDK methods, never a raw Google API client. */\nexport type GoogleDriveFilesClient = Pick<\n GoogleDriveProvider,\n 'listMetadataPage' | 'getMetadataById' | 'acquireById'\n>;\n\nexport interface DriveCatalogRecord extends CatalogSourceRecord {\n providerId: 'google-drive';\n checksum?: string;\n mimeType: string;\n size?: number;\n modifiedTime?: string;\n}\n\nexport interface DriveExclusion {\n stableId: string;\n reason:\n | 'missing-revision'\n | 'shortcut-target-inaccessible'\n | 'shortcut-target-outside-boundary'\n | 'shortcut-target-unsupported';\n}\n\ninterface FolderCursor {\n folderId: string;\n pageToken?: string;\n visibility: 'catalog' | 'teacher';\n}\n\n/** Serializable traversal state; persist it after every returned page. */\nexport interface DriveDiscoveryCheckpoint {\n version: 1;\n roots: string[];\n pendingFolders: FolderCursor[];\n visitedFolders: string[];\n}\n\nexport interface DriveDiscoveryPage {\n records: DriveCatalogRecord[];\n exclusions: DriveExclusion[];\n checkpoint?: DriveDiscoveryCheckpoint;\n complete: boolean;\n}\n\nexport interface DriveDiscoveryOptions {\n /** Defaults to the four owner-authorized curriculum roots. */\n roots?: readonly { id: string; title?: string }[];\n checkpoint?: DriveDiscoveryCheckpoint;\n pageSize?: number;\n /**\n * Exact Drive file IDs the trusted host has reviewed as learner-safe.\n * Folder IDs never grant visibility to their contents.\n */\n studentSafeFileIds?: readonly string[];\n /**\n * Shortcut targets are re-read by ID and must pass this host boundary check\n * before a folder can enter traversal. The secure default is deny.\n */\n authorizeShortcutTarget?: (\n target: DriveFileMetadata,\n context: { sourceFolderId: string; configuredRootIds: readonly string[] },\n ) => boolean | Promise<boolean>;\n}\n\nexport interface DriveSelectionAuthorization {\n stableId: string;\n revision: string;\n exportMimeType?: string;\n /** True only after the host's resource-level license policy allows use. */\n allowed: boolean;\n}\n\nexport interface PinnedDriveContent {\n stableId: string;\n revision?: string;\n checksum?: string;\n sha256: string;\n bytes: Buffer;\n exportMimeType?: string;\n}\n\nfunction uniqueRoots(\n roots: readonly { id: string; title?: string }[],\n): readonly { id: string; title?: string }[] {\n const seen = new Set<string>();\n return roots.filter((root) => {\n if (!root.id || seen.has(root.id)) return false;\n seen.add(root.id);\n return true;\n });\n}\n\nfunction assertPageSize(pageSize: number | undefined): number | undefined {\n if (pageSize === undefined) return undefined;\n if (!Number.isInteger(pageSize) || pageSize < 1 || pageSize > 1_000)\n throw new Error('Drive metadata page size must be between 1 and 1000.');\n return pageSize;\n}\n\nfunction classify(\n name: string,\n inherited: 'catalog' | 'teacher',\n): 'catalog' | 'teacher' {\n const normalized = name\n .replace(/([a-z])([A-Z])/g, '$1 $2')\n .replace(/[_./-]+/g, ' ')\n .toLowerCase();\n if (/\\b(answers?|solutions?|keys?)\\b/.test(normalized)) return 'teacher';\n if (/\\b(teachers?|educators?|instructors?|facilitators?)\\b/.test(normalized))\n return 'teacher';\n return inherited;\n}\n\nfunction isFolder(metadata: DriveFileMetadata): boolean {\n return metadata.mimeType === GOOGLE_FOLDER_MIME;\n}\n\nfunction nativeExportFormats(mimeType: string): string[] {\n if (\n [\n 'application/vnd.google-apps.document',\n 'application/vnd.google-apps.spreadsheet',\n 'application/vnd.google-apps.presentation',\n ].includes(mimeType)\n )\n return ['application/pdf'];\n return [mimeType];\n}\n\nfunction encodeCheckpoint(checkpoint: DriveDiscoveryCheckpoint): string {\n return Buffer.from(JSON.stringify(checkpoint)).toString('base64url');\n}\n\nfunction decodeCheckpoint(\n cursor: string | undefined,\n): DriveDiscoveryCheckpoint | undefined {\n if (!cursor) return undefined;\n try {\n const decoded: unknown = JSON.parse(\n Buffer.from(cursor, 'base64url').toString('utf8'),\n );\n if (!decoded || typeof decoded !== 'object')\n throw new Error('not an object');\n return decoded as DriveDiscoveryCheckpoint;\n } catch {\n throw new Error('Invalid Google Drive discovery cursor.');\n }\n}\n\nfunction toRecord(\n metadata: DriveFileMetadata,\n parentStableId: string,\n inheritedVisibility: 'catalog' | 'teacher',\n studentSafeFileIds: ReadonlySet<string>,\n): DriveCatalogRecord {\n const revision =\n metadata.revisionId ??\n metadata.md5Checksum ??\n metadata.modifiedTime?.toISOString();\n if (!revision)\n throw new Error(`Drive metadata for ${metadata.id} has no revision.`);\n return {\n providerId: 'google-drive',\n stableId: metadata.id,\n revision,\n ...(metadata.md5Checksum ? { checksum: metadata.md5Checksum } : {}),\n canonicalUrl: `https://drive.google.com/open?id=${encodeURIComponent(metadata.id)}`,\n title: metadata.name,\n resourceType: metadata.shortcutDetails\n ? 'shortcut'\n : isFolder(metadata)\n ? 'folder'\n : 'file',\n parentStableId,\n availableFormats: nativeExportFormats(metadata.mimeType),\n mimeType: metadata.mimeType,\n ...(metadata.size === undefined ? {} : { size: metadata.size }),\n ...(metadata.modifiedTime\n ? { modifiedTime: metadata.modifiedTime.toISOString() }\n : {}),\n visibility:\n !isFolder(metadata) &&\n !metadata.shortcutDetails &&\n studentSafeFileIds.has(metadata.id) &&\n classify(metadata.name, inheritedVisibility) === 'catalog'\n ? 'catalog'\n : 'teacher',\n licenseEvidence: { state: 'unknown' },\n };\n}\n\nfunction normalizedCheckpoint(\n options: DriveDiscoveryOptions,\n): DriveDiscoveryCheckpoint {\n const roots = uniqueRoots(options.roots ?? DRIVE_CURRICULUM_SEED_ROOTS).map(\n (root) => root.id,\n );\n if (!roots.length) throw new Error('At least one Drive root is required.');\n const checkpoint = options.checkpoint;\n if (!checkpoint) {\n return {\n version: 1,\n roots,\n pendingFolders: roots.map((folderId) => ({\n folderId,\n visibility: 'catalog',\n })),\n visitedFolders: [],\n };\n }\n if (\n checkpoint.version !== 1 ||\n checkpoint.roots.length !== roots.length ||\n checkpoint.roots.some((root, index) => root !== roots[index])\n )\n throw new Error('Drive checkpoint does not match configured roots.');\n return {\n version: 1,\n roots,\n pendingFolders: checkpoint.pendingFolders.map((folder) => ({ ...folder })),\n visitedFolders: [...checkpoint.visitedFolders],\n };\n}\n\n/**\n * One call reads at most one Drive metadata page. Repeated calls with the\n * returned checkpoint provide durable pagination without content acquisition.\n */\nexport class GoogleDriveCurriculumAdapter\n implements CatalogSyncAdapter, CatalogAcquireAdapter\n{\n static readonly providerId = 'google-drive';\n constructor(\n private readonly drive: GoogleDriveFilesClient,\n private readonly configuration: Omit<\n DriveDiscoveryOptions,\n 'checkpoint'\n > & {\n maxAcquisitionBytes?: number;\n } = {},\n ) {}\n\n async enumerate(input: { cursor?: string }): Promise<CatalogSyncPage> {\n const page = await this.discover({\n ...this.configuration,\n checkpoint: decodeCheckpoint(input.cursor),\n });\n return {\n records: page.records,\n complete: page.complete,\n ...(page.checkpoint\n ? { nextCursor: encodeCheckpoint(page.checkpoint) }\n : {}),\n // Definite boundary/format omissions are policy; unavailable metadata is\n // an operational failure and must not authorize terminal withdrawal.\n policyExclusions: page.exclusions\n .filter(\n (entry) =>\n entry.reason === 'shortcut-target-outside-boundary' ||\n entry.reason === 'shortcut-target-unsupported',\n )\n .map((entry) => ({\n code: entry.reason,\n message: `Google Drive resource ${entry.stableId} was excluded: ${entry.reason}.`,\n })),\n exclusions: page.exclusions\n .filter(\n (entry) =>\n entry.reason !== 'shortcut-target-outside-boundary' &&\n entry.reason !== 'shortcut-target-unsupported',\n )\n .map((entry) => ({\n code: entry.reason,\n message: `Google Drive resource ${entry.stableId} was excluded: ${entry.reason}.`,\n })),\n };\n }\n\n async discover(\n options: DriveDiscoveryOptions = {},\n ): Promise<DriveDiscoveryPage> {\n const checkpoint = normalizedCheckpoint(options);\n const pageSize = assertPageSize(options.pageSize);\n const current = checkpoint.pendingFolders.shift();\n if (!current) return { records: [], exclusions: [], complete: true };\n\n const page = await this.drive.listMetadataPage({\n folderId: current.folderId,\n ...(current.pageToken ? { pageToken: current.pageToken } : {}),\n ...(pageSize === undefined ? {} : { pageSize }),\n });\n const records: DriveCatalogRecord[] = [];\n const exclusions: DriveExclusion[] = [];\n const seenRecordIds = new Set<string>();\n const seenFolders = new Set(checkpoint.visitedFolders);\n seenFolders.add(current.folderId);\n\n const studentSafeFileIds = new Set(options.studentSafeFileIds ?? []);\n for (const entry of page.entries) {\n if (!entry.id || seenRecordIds.has(entry.id)) continue;\n seenRecordIds.add(entry.id);\n if (\n entry.shortcutDetails &&\n entry.shortcutDetails.targetMimeType !== GOOGLE_FOLDER_MIME\n ) {\n // A file shortcut does not establish that its target belongs under a\n // reviewed root or that the target's real parent is learner-safe.\n // Actual files encountered through trusted folder traversal remain\n // eligible for exact-ID allowlisting.\n exclusions.push({\n stableId: entry.shortcutDetails.targetId,\n reason: 'shortcut-target-unsupported',\n });\n continue;\n }\n const inheritedVisibility = classify(entry.name, current.visibility);\n try {\n records.push(\n toRecord(\n entry,\n current.folderId,\n inheritedVisibility,\n studentSafeFileIds,\n ),\n );\n } catch {\n exclusions.push({\n stableId: entry.id,\n reason: 'missing-revision',\n });\n continue;\n }\n const visibility = inheritedVisibility;\n if (entry.shortcutDetails) {\n await this.resolveShortcut(\n entry.shortcutDetails,\n current.folderId,\n visibility,\n checkpoint,\n seenFolders,\n options,\n exclusions,\n );\n } else if (isFolder(entry) && !seenFolders.has(entry.id)) {\n seenFolders.add(entry.id);\n checkpoint.pendingFolders.push({ folderId: entry.id, visibility });\n }\n }\n\n if (page.nextPageToken) {\n checkpoint.pendingFolders.unshift({\n ...current,\n pageToken: page.nextPageToken,\n });\n } else {\n seenFolders.add(current.folderId);\n }\n checkpoint.visitedFolders = [...seenFolders].sort();\n return {\n records,\n exclusions,\n ...(checkpoint.pendingFolders.length ? { checkpoint } : {}),\n complete: checkpoint.pendingFolders.length === 0,\n };\n }\n\n private async resolveShortcut(\n shortcut: NonNullable<DriveFileMetadata['shortcutDetails']>,\n sourceFolderId: string,\n inheritedVisibility: 'catalog' | 'teacher',\n checkpoint: DriveDiscoveryCheckpoint,\n seenFolders: Set<string>,\n options: DriveDiscoveryOptions,\n exclusions: DriveExclusion[],\n ): Promise<void> {\n if (shortcut.targetMimeType !== GOOGLE_FOLDER_MIME) {\n exclusions.push({\n stableId: shortcut.targetId,\n reason: 'shortcut-target-unsupported',\n });\n return;\n }\n let target: DriveFileMetadata;\n try {\n target = await this.drive.getMetadataById(shortcut.targetId);\n } catch {\n exclusions.push({\n stableId: shortcut.targetId,\n reason: 'shortcut-target-inaccessible',\n });\n return;\n }\n if (\n !isFolder(target) ||\n seenFolders.has(target.id) ||\n (await options.authorizeShortcutTarget?.(target, {\n sourceFolderId,\n configuredRootIds: checkpoint.roots,\n })) !== true\n ) {\n exclusions.push({\n stableId: target.id,\n reason: isFolder(target)\n ? 'shortcut-target-outside-boundary'\n : 'shortcut-target-unsupported',\n });\n return;\n }\n seenFolders.add(target.id);\n checkpoint.pendingFolders.push({\n folderId: target.id,\n visibility: classify(target.name, inheritedVisibility),\n });\n }\n\n /**\n * Content is available only after explicit selection and policy approval.\n * A revision is mandatory so retries cannot silently acquire changed bytes.\n */\n async acquireSelected(\n authorization: DriveSelectionAuthorization,\n options: Omit<DriveAcquisitionOptions, 'expectedRevision'>,\n ): Promise<PinnedDriveContent> {\n if (!authorization.allowed)\n throw new Error(\n 'Drive content selection is not authorized by license policy.',\n );\n if (!authorization.stableId || !authorization.revision)\n throw new Error(\n 'Drive selection requires a stable ID and exact revision.',\n );\n if (!Number.isSafeInteger(options.maxBytes) || options.maxBytes < 1)\n throw new Error(\n 'Drive acquisition requires a positive maximum byte limit.',\n );\n const acquisition = await this.drive.acquireById(authorization.stableId, {\n ...options,\n expectedRevision: authorization.revision,\n ...(authorization.exportMimeType\n ? { exportMimeType: authorization.exportMimeType }\n : {}),\n });\n if (acquisition.metadata.id !== authorization.stableId)\n throw new Error('Drive acquisition returned a different resource.');\n if (\n acquisition.metadata.revisionId &&\n acquisition.metadata.revisionId !== authorization.revision\n )\n throw new Error(\n 'Drive acquisition revision changed before content was pinned.',\n );\n if (acquisition.bytes.byteLength > options.maxBytes)\n throw new Error('Drive acquisition exceeds its byte limit.');\n const hash = await globalThis.crypto.subtle.digest(\n 'SHA-256',\n Uint8Array.from(acquisition.bytes),\n );\n const sha256 = Buffer.from(hash).toString('hex');\n if (acquisition.contentHash.toLowerCase() !== sha256)\n throw new Error(\n 'Drive acquisition content hash did not match returned bytes.',\n );\n return {\n stableId: acquisition.metadata.id,\n ...(acquisition.metadata.revisionId\n ? { revision: acquisition.metadata.revisionId }\n : {}),\n ...(acquisition.metadata.md5Checksum\n ? { checksum: acquisition.metadata.md5Checksum }\n : {}),\n sha256,\n bytes: acquisition.bytes,\n ...(acquisition.exportMimeType\n ? { exportMimeType: acquisition.exportMimeType }\n : {}),\n };\n }\n\n async acquire(input: {\n providerId: string;\n stableId: string;\n revision: string;\n format: string;\n }): Promise<{ bytes: Uint8Array; sha256: string; revision: string }> {\n if (input.providerId !== GoogleDriveCurriculumAdapter.providerId)\n throw new Error('Google Drive adapter cannot acquire another provider.');\n const acquired = await this.acquireSelected(\n {\n stableId: input.stableId,\n revision: input.revision,\n exportMimeType: input.format,\n allowed: true,\n },\n { maxBytes: this.configuration.maxAcquisitionBytes ?? 25_000_000 },\n );\n if (acquired.revision !== input.revision)\n throw new Error(\n 'Drive acquisition did not return the selected revision.',\n );\n return {\n bytes: acquired.bytes,\n sha256: acquired.sha256,\n revision: input.revision,\n };\n }\n}\n","/** Strict first-edition hierarchy and public artifact parsing; never executes HTML. */\nexport const IM_ORIGIN = 'https://im.kendallhunt.com';\nexport const IM_ASSET_ORIGIN = 'https://cms-assets.illustrativemathematics.org';\nexport const IM_LICENSE = 'https://creativecommons.org/licenses/by/4.0/';\nexport const IM_ROOTS = [\n '/k5/curriculum.html',\n '/MS/index.html',\n '/HS/index.html',\n];\n\nexport function imText(value: string): string {\n return value\n .replace(/<[^>]*>/g, ' ')\n .replace(/ | /g, ' ')\n .replace(/&/g, '&')\n .replace(/'|'/g, \"'\")\n .replace(/"/g, '\"')\n .replace(/\\s+/g, ' ')\n .trim();\n}\nexport interface ImPageIdentity {\n path: string;\n band: string;\n course?: string;\n unit?: string;\n lesson?: string;\n audience?: string;\n leaf: string;\n}\n/** Canonical paths contain no escapes, queries, credentials, or arbitrary filenames. */\nexport function imPagePath(value: string): ImPageIdentity {\n if (value === '/') return { path: '/', band: '', leaf: '' };\n if (IM_ROOTS.includes(value))\n return { path: value, band: value.split('/')[1], leaf: 'root' };\n const k =\n /^\\/(k5(?:_es)?)\\/(teachers|families)\\/(kindergarten|grade-[1-5])(?:\\/unit-([1-9][0-9]?))?(?:\\/lesson-([1-9][0-9]?))?\\/(units|lessons|resources|preparation|family-materials)\\.html$/i.exec(\n value,\n );\n const m =\n /^\\/(MS(?:_ES)?|HS(?:_ES)?)\\/(teachers|families)\\/([1-4])(?:\\/([1-9][0-9]?))?(?:\\/([1-9][0-9]?))?\\/(index|resources|preparation)\\.html$/i.exec(\n value,\n );\n const x = k ?? m;\n if (!x) throw new Error('Unsupported first-edition hierarchy path.');\n const [, rawBand, audience, course, unit, lesson, leaf] = x;\n const band = rawBand.toLowerCase().startsWith('k5')\n ? rawBand.toLowerCase()\n : rawBand.toUpperCase();\n const isK = band.startsWith('k5');\n if (\n (band.startsWith('MS') && course === '4') ||\n (lesson && (!unit || audience !== 'teachers' || leaf !== 'preparation')) ||\n (!lesson && leaf === 'preparation') ||\n (isK && !unit && !['units', 'resources'].includes(leaf)) ||\n (isK &&\n unit &&\n !lesson &&\n !['lessons', 'resources', 'family-materials'].includes(leaf)) ||\n (!isK && !lesson && !['index', 'resources'].includes(leaf))\n )\n throw new Error('Inconsistent first-edition hierarchy.');\n const path = `/${band}/${audience}/${course}${unit ? `/${isK ? 'unit-' : ''}${unit}` : ''}${lesson ? `/${isK ? 'lesson-' : ''}${lesson}` : ''}/${leaf}.html`;\n return { path, band, audience, course, unit, lesson, leaf };\n}\nexport function imAssetId(url: URL): string | undefined {\n return url.origin === IM_ASSET_ORIGIN &&\n !url.username &&\n !url.password &&\n !url.port &&\n !url.search &&\n !url.hash &&\n /^\\/[a-zA-Z0-9]{20,64}$/.test(url.pathname)\n ? url.pathname.slice(1)\n : undefined;\n}\nexport function imStableId(path: string, assetId?: string): string {\n return `im-first-edition:${path}${assetId ? `#${assetId}` : ''}`;\n}\nexport function imHierarchyTitle(page: ImPageIdentity): string {\n const course = page.band.startsWith('k5')\n ? `Grade ${page.course === 'kindergarten' ? 'K' : page.course?.slice(6)}`\n : page.band.startsWith('MS')\n ? `Grade ${Number(page.course) + 5}`\n : ['', 'Algebra 1', 'Geometry', 'Algebra 2', 'Algebra 1 Supports'][\n Number(page.course)\n ];\n return `IM ${page.band} ${course ?? ''}${page.unit ? ` Unit ${page.unit}` : ''}${page.lesson ? ` Lesson ${page.lesson}` : ''}`.trim();\n}\nexport interface ImArtifact {\n id: string;\n label: string;\n allowed: boolean;\n}\nexport interface ImParsedPage {\n /** Page-scoped instructional ImageFiles; never branding or credited third-party images. */\n previewImage?: { id: string; alt: string };\n children: string[];\n artifacts: ImArtifact[];\n exclusions: { code: string; message: string }[];\n attribution: string;\n notices: string;\n licensed: boolean;\n title: string;\n}\ninterface RoleContainer {\n tag: string;\n parent?: RoleContainer;\n contentStart: number;\n resource: boolean;\n closed: boolean;\n malformed: boolean;\n headings: { tag: string; text: string }[];\n descendantHeadingCount: number;\n cells: string[];\n}\n\n/** A '<' is legal inside a tag only in a closed, quoted attribute value. */\nfunction malformedTagToken(token: string): boolean {\n const prefix = /^<\\/?[a-zA-Z][\\w:-]*/.exec(token);\n if (!prefix) return true;\n const end = token.length - 1;\n let index = prefix[0].length;\n while (index < end) {\n while (index < end && /\\s/.test(token[index])) index++;\n if (index === end || (index === end - 1 && token[index] === '/'))\n return false;\n const nameStart = index;\n while (index < end && !/[\\s\"'<>/=]/.test(token[index])) index++;\n if (index === nameStart) return true;\n while (index < end && /\\s/.test(token[index])) index++;\n if (token[index] !== '=') continue;\n index++;\n while (index < end && /\\s/.test(token[index])) index++;\n const quote = token[index];\n if (quote === '\"' || quote === \"'\") {\n const close = token.indexOf(quote, index + 1);\n if (close < 0 || close >= end) return true;\n index = close + 1;\n } else {\n const valueStart = index;\n while (index < end && !/\\s/.test(token[index])) {\n if (/[\"'`=<>]/.test(token[index])) return true;\n index++;\n }\n if (index === valueStart) return true;\n }\n }\n return false;\n}\n\n/** Bind each link to its own source row/block; headings never cross containers. */\nfunction localArtifactLabels(html: string): Map<number, string> {\n const stack: RoleContainer[] = [];\n const links: {\n start: number;\n owner?: RoleContainer;\n kind?: 'row' | 'resource';\n }[] = [];\n const voidTags = new Set([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n ]);\n const tokens =\n /<\\/?([a-zA-Z][\\w:-]*)(?:\\s+(?:[^>\"']|\"[^\"]*\"|'[^']*')*)?\\s*\\/?>/g;\n const invalidateOwners = () => {\n for (const owner of stack)\n if (owner.resource || owner.tag === 'tr') owner.malformed = true;\n };\n let tokenCount = 0;\n let consumedEnd = 0;\n for (const token of html.matchAll(tokens)) {\n if (++tokenCount > 50_000 || stack.length > 256)\n throw new Error('First-edition role structure exceeds parser bounds.');\n // Unconsumed markup starts are malformed descendants too (e.g. a tag\n // truncated before its '>' and then followed by an ancestor close).\n if (/<[/!]?[a-zA-Z]/.test(html.slice(consumedEnd, token.index)))\n invalidateOwners();\n consumedEnd = token.index + token[0].length;\n const malformed = malformedTagToken(token[0]);\n if (malformed) invalidateOwners();\n const tag = token[1].toLowerCase();\n if (token[0].startsWith('</')) {\n const index = stack.findLastIndex((node) => node.tag === tag);\n if (index < 0) {\n invalidateOwners();\n continue;\n }\n const node = stack[index];\n if (index !== stack.length - 1) {\n invalidateOwners();\n node.malformed = true;\n for (const dangling of stack.slice(index + 1))\n dangling.malformed = true;\n }\n node.closed = true;\n if (/^h[1-6]$/.test(tag)) {\n const content = imText(html.slice(node.contentStart, token.index));\n if (!node.malformed && node.parent?.resource)\n node.parent.headings.push({ tag, text: content });\n const row = stack\n .slice(0, index)\n .findLast((ancestor) => ancestor.tag === 'tr');\n if (row) row.headings.push({ tag, text: content });\n }\n if (tag === 'td' && node.parent?.tag === 'tr')\n node.parent.cells.push(\n imText(html.slice(node.contentStart, token.index)),\n );\n stack.length = index;\n continue;\n }\n // Register headings at OPEN: malformed close recovery must not erase them.\n if (/^h[1-6]$/.test(tag)) {\n for (const owner of stack)\n if (owner.resource || owner.tag === 'tr')\n owner.descendantHeadingCount++;\n }\n const parent = stack.at(-1);\n if (tag === 'a') {\n if (\n parent?.tag === 'td' &&\n parent.parent?.tag === 'tr' &&\n parent.parent.cells.length > 0\n )\n links.push({ start: token.index, owner: parent.parent, kind: 'row' });\n else\n links.push({\n start: token.index,\n owner: parent?.resource ? parent : undefined,\n kind: 'resource',\n });\n }\n if (voidTags.has(tag) || token[0].endsWith('/>')) continue;\n const className =\n /\\sclass\\s*=\\s*[\"']([^\"']*)[\"']/i.exec(token[0])?.[1] ?? '';\n stack.push({\n tag,\n parent,\n contentStart: token.index + token[0].length,\n resource:\n tag === 'div' &&\n className.split(/\\s+/).includes('im-c-row__flex-resource'),\n closed: false,\n malformed,\n headings: [],\n descendantHeadingCount: 0,\n cells: [],\n });\n }\n // Open owners or their descendants at EOF are never a complete source boundary.\n invalidateOwners();\n const labels = new Map<number, string>();\n for (const link of links) {\n const owner = link.owner;\n if (!owner?.closed || owner.malformed) continue;\n if (link.kind === 'row') {\n if (owner.descendantHeadingCount === 0 && owner.headings.length === 0)\n labels.set(link.start, owner.cells[0] ?? '');\n } else if (\n owner.descendantHeadingCount === 1 &&\n owner.headings.length === 1 &&\n /^h[34]$/.test(owner.headings[0].tag)\n )\n labels.set(link.start, owner.headings[0].text);\n }\n return labels;\n}\n\nexport function parseImFirstEditionPage(\n rawHtml: string,\n path: string,\n): ImParsedPage {\n const page = imPagePath(path);\n const html = rawHtml\n .replace(/<!--[\\s\\S]*?-->/g, '')\n .replace(/<(script|style)\\b[^>]*>[\\s\\S]*?<\\/\\1>/gi, '');\n const footer = /<footer\\b[^>]*>([\\s\\S]*?)<\\/footer>/i.exec(html)?.[1] ?? '';\n const licensed =\n /href=[\"']https:\\/\\/creativecommons\\.org\\/licenses\\/by\\/4\\.0\\/[\"']/i.test(\n footer,\n ) &&\n /Illustrative Mathematics/i.test(imText(footer)) &&\n !/licenses\\/(?:by-nc|by-sa|by-nd)|all rights reserved/i.test(footer);\n const paragraphs = [...footer.matchAll(/<p\\b[^>]*>([\\s\\S]*?)<\\/p>/gi)].map(\n (x) => imText(x[1]),\n );\n const attribution = paragraphs\n .filter((s) => /copyright|©|licensed under/i.test(s))\n .join('\\n');\n const notices = paragraphs\n .filter((s) => /name and logo|respective|attribution/i.test(s))\n .join('\\n');\n const children = new Set<string>();\n const exclusions: ImParsedPage['exclusions'] = [];\n const artifacts = new Map<string, ImArtifact>();\n const localLabels = localArtifactLabels(html);\n const anchors = [...html.matchAll(/<a\\b([^>]*)>([\\s\\S]*?)<\\/a\\s*>/gi)];\n if (anchors.length > 4000)\n throw new Error('First-edition page has too many links.');\n for (const anchor of anchors) {\n const href = /\\bhref\\s*=\\s*[\"']([^\"']+)[\"']/i.exec(anchor[1])?.[1];\n if (!href) continue;\n let url: URL;\n try {\n url = new URL(href.replace(/&/g, '&'), IM_ORIGIN + path);\n } catch {\n exclusions.push({\n code: 'invalid_link',\n message: 'Malformed source link.',\n });\n continue;\n }\n if (/oauth_im\\/login/.test(url.pathname)) {\n exclusions.push({\n code: 'login_required',\n message: imText(anchor[2]) || 'Login-gated material.',\n });\n continue;\n }\n if (\n url.hostname === 'accessim.org' ||\n url.hostname.endsWith('.accessim.org')\n ) {\n exclusions.push({\n code: 'different_edition',\n message: 'AccessIM/v.360 is outside the first edition.',\n });\n continue;\n }\n if (url.origin === IM_ASSET_ORIGIN) {\n const id = imAssetId(url);\n if (!id) {\n exclusions.push({\n code: 'invalid_asset_path',\n message: 'Unsupported official asset path.',\n });\n continue;\n }\n const label = localLabels.get(anchor.index) ?? '';\n const allowed =\n /^(Student Task Statements|Student Handouts|Cumulative Practice Problems|Family Support Materials|Family Materials|Learning Targets|Student Task Statement Cover Page)$/i.test(\n label,\n );\n const prior = artifacts.get(id);\n artifacts.set(id, {\n id,\n label,\n allowed:\n allowed && (!prior || (prior.allowed && prior.label === label)),\n });\n continue;\n }\n if (\n url.origin !== IM_ORIGIN ||\n url.username ||\n url.password ||\n url.port ||\n url.search ||\n url.hash ||\n /%|\\\\/.test(href)\n )\n continue;\n let child: ImPageIdentity;\n try {\n child = imPagePath(url.pathname);\n } catch {\n if (\n /^\\/(?:k5(?:_es)?|MS(?:_ES)?|HS(?:_ES)?)\\/(?:teachers|families|students)\\//i.test(\n url.pathname,\n )\n )\n exclusions.push({\n code: 'unsupported_hierarchy_or_html',\n message: `Outside declared PDF hierarchy: ${url.pathname}`,\n });\n continue;\n }\n const sameCourse =\n child.band === page.band &&\n child.audience === page.audience &&\n child.course === page.course;\n const rootChild =\n page.leaf === 'root' &&\n child.band.toLowerCase().replace('_es', '') === page.band.toLowerCase() &&\n child.course &&\n !child.unit &&\n child.leaf !== 'resources';\n const courseChild =\n page.course &&\n !page.unit &&\n page.leaf !== 'resources' &&\n sameCourse &&\n ((child.unit && !child.lesson && child.leaf !== 'resources') ||\n (!child.unit && child.leaf === 'resources'));\n const unitChild =\n page.unit &&\n !page.lesson &&\n !['resources', 'family-materials'].includes(page.leaf) &&\n sameCourse &&\n child.unit === page.unit &&\n ((child.lesson && child.leaf === 'preparation') ||\n (!child.lesson && child.leaf === 'resources'));\n const familyMaterialsChild =\n page.band.startsWith('k5') &&\n page.audience === 'families' &&\n page.unit &&\n !page.lesson &&\n page.leaf !== 'family-materials' &&\n sameCourse &&\n child.unit === page.unit &&\n !child.lesson &&\n child.leaf === 'family-materials';\n if (rootChild || courseChild || unitChild || familyMaterialsChild)\n children.add(child.path);\n }\n if (children.size > 128 || artifacts.size > 128)\n throw new Error('First-edition page exceeds hierarchy/artifact bound.');\n let previewImage: ImParsedPage['previewImage'];\n const main = /<main\\b[^>]*>([\\s\\S]*?)<\\/main>/i.exec(html)?.[1] ?? '';\n // Family instructional content carries the page license. Any additional image\n // credit/license/attribution makes its scope ambiguous, so omit the preview.\n if (\n licensed &&\n attribution &&\n page.audience === 'families' &&\n page.band.startsWith('k5') &&\n page.leaf === 'family-materials' &&\n !/attribution|copyright|licensed|credits?|©|all rights reserved/i.test(\n imText(main),\n )\n ) {\n for (const figure of main.matchAll(\n /<figure\\b([^>]*)>([\\s\\S]*?)<\\/figure>/gi,\n )) {\n if (\n !/class=[\"'][^\"']*\\bembedded-content-image-file\\b/i.test(figure[1]) ||\n !/data-record-model=[\"']ImageFile[\"']/i.test(figure[1])\n )\n continue;\n const caption = /<figcaption\\b[^>]*>([\\s\\S]*?)<\\/figcaption>/i.exec(\n figure[2],\n );\n if (!caption || imText(caption[1])) continue;\n const image = /<img\\b([^>]*)>/i.exec(figure[2])?.[1] ?? '';\n const src = /\\bsrc=[\"']([^\"']+)[\"']/i.exec(image)?.[1];\n const alt = imText(/\\balt=[\"']([^\"']+)[\"']/i.exec(image)?.[1] ?? '');\n // Only publisher-authored instructional diagrams, never photographs or logos.\n if (\n !src ||\n !/\\b(chart|diagram|number line|graph|table|tally)\\b/i.test(alt) ||\n /logo|photo|portrait|©|copyright|credit|license/i.test(alt)\n )\n continue;\n try {\n const id = imAssetId(new URL(src));\n if (id) {\n previewImage = { id, alt };\n break;\n }\n } catch {\n /* Unsupported source is absent. */\n }\n }\n }\n return {\n ...(previewImage ? { previewImage } : {}),\n children: [...children],\n artifacts: [...artifacts.values()],\n exclusions,\n attribution,\n notices,\n licensed,\n title: imText(/<title[^>]*>([\\s\\S]*?)<\\/title>/i.exec(html)?.[1] ?? ''),\n };\n}\n","import {\n CATALOG_REPRESENTATION_MEDIA_TYPES,\n catalogRepresentationFormat,\n catalogRepresentationMediaType,\n normalizeCatalogRepresentation,\n} from '../catalog-capability.js';\nimport type {\n CatalogAcquireAdapter,\n CatalogSourceRecord,\n CatalogSyncAdapter,\n CatalogSyncPage,\n} from '../catalog-contracts.js';\nimport {\n CATALOG_PREVIEW_MAX_BYTES,\n type CatalogPreview,\n type CatalogPreviewLoader,\n catalogPreviewPngDimensions,\n normalizeCatalogPreview,\n} from '../catalog-preview.js';\nimport {\n IM_ASSET_ORIGIN,\n IM_LICENSE,\n IM_ORIGIN,\n IM_ROOTS,\n imHierarchyTitle,\n imPagePath,\n imStableId,\n parseImFirstEditionPage,\n} from './public-illustrative-mathematics-parser.js';\n\nexport interface PublicIllustrativeMathematicsFirstEditionConfig {\n /** Standard fetch, including streaming Response bodies; defaults to global fetch. */\n fetch?: typeof globalThis.fetch;\n /** Per enumeration/acquisition total deadline. Default 20 seconds; maximum 60 seconds. */\n timeoutMs?: number;\n /** Selected PDF cap. Default 32 MiB; maximum 64 MiB. */\n maxPdfBytes?: number;\n}\ninterface Cursor {\n v: 1;\n todo: string[];\n offset: number;\n pageRevision?: string;\n}\ninterface Revision {\n v: 1;\n page: string;\n etag: string;\n length: number;\n modified: string;\n}\nconst PROVIDER = 'illustrative-mathematics';\nconst METADATA_CAP = 2_000_000;\nconst HEADS_PER_PAGE = 4;\nfunction retryDelay(value: string | null): number {\n if (!value) return 60_000;\n const delay = /^[0-9]+$/.test(value)\n ? Number(value) * 1000\n : Date.parse(value) - Date.now();\n return Number.isFinite(delay)\n ? Math.min(3_600_000, Math.max(0, delay))\n : 60_000;\n}\nfunction encode(value: unknown): string {\n return JSON.stringify(value);\n}\nfunction cursor(value?: string): Cursor {\n if (!value) return { v: 1, todo: ['/', ...IM_ROOTS], offset: 0 };\n if (value.length > 64_000) throw new Error('Cursor exceeds its size bound.');\n const x = JSON.parse(value) as Cursor;\n if (\n !x ||\n Object.keys(x).some(\n (k) => !['v', 'todo', 'offset', 'pageRevision'].includes(k),\n ) ||\n x.v !== 1 ||\n !Array.isArray(x.todo) ||\n !x.todo.length ||\n x.todo.length > 384 ||\n !Number.isSafeInteger(x.offset) ||\n x.offset < 0 ||\n x.offset > 128 ||\n (x.pageRevision !== undefined &&\n (typeof x.pageRevision !== 'string' || x.pageRevision.length > 256)) ||\n (x.offset > 0 && !x.pageRevision)\n )\n throw new Error('Invalid first-edition cursor.');\n for (const p of x.todo)\n if (typeof p !== 'string' || p.length > 160 || imPagePath(p).path !== p)\n throw new Error('Invalid cursor hierarchy path.');\n if (new Set(x.todo).size !== x.todo.length)\n throw new Error('Duplicate cursor paths.');\n return x;\n}\nfunction observedMetadata(response: Response) {\n const etag = response.headers.get('etag') ?? '';\n const lengthText = response.headers.get('content-length') ?? '';\n const length = Number(lengthText);\n const modified = response.headers.get('last-modified') ?? '';\n const header = response.headers.get('content-type');\n const mediaType =\n header === null ? null : catalogRepresentationMediaType(header);\n const format =\n mediaType === null\n ? 'unknown'\n : (catalogRepresentationFormat(mediaType) ?? 'unknown');\n if (\n response.headers.has('content-encoding') &&\n response.headers.get('content-encoding') !== 'identity'\n )\n throw new Error('PDF representation is unexpectedly encoded.');\n if (\n !/^\"[\\x21\\x23-\\x7e]{1,200}\"$/.test(etag) ||\n !/^[1-9][0-9]*$/.test(lengthText) ||\n !Number.isSafeInteger(length) ||\n !modified ||\n !Number.isFinite(Date.parse(modified)) ||\n modified.length > 100\n )\n throw new Error(\n 'Metadata requires a strong ETag, positive safe length, and valid Last-Modified metadata.',\n );\n return { etag, length, modified, format, mediaType } as const;\n}\nfunction validators(\n response: Response,\n cap: number,\n): Omit<Revision, 'v' | 'page'> {\n const { format, mediaType, ...metadata } = observedMetadata(response);\n if (format !== 'pdf' || metadata.length > cap)\n throw new Error(\n 'Selected representation requires PDF content type and bounded length.',\n );\n return metadata;\n}\nasync function readBody(response: Response, cap: number): Promise<Uint8Array> {\n const declared = response.headers.get('content-length');\n if (declared && (!/^[0-9]+$/.test(declared) || Number(declared) > cap))\n throw new Error('Response exceeds declared body bound.');\n if (!response.body) throw new Error('Provider response body is missing.');\n const reader = response.body.getReader();\n const chunks: Uint8Array[] = [];\n let size = 0;\n try {\n for (;;) {\n const next = await reader.read();\n if (next.done) break;\n size += next.value.byteLength;\n if (size > cap) throw new Error('Provider streamed body exceeds bound.');\n chunks.push(next.value);\n }\n } catch (error) {\n await reader.cancel().catch(() => {});\n throw error;\n } finally {\n reader.releaseLock();\n }\n const bytes = new Uint8Array(size);\n let offset = 0;\n for (const chunk of chunks) {\n bytes.set(chunk, offset);\n offset += chunk.length;\n }\n return bytes;\n}\nasync function sha256(bytes: Uint8Array): Promise<string> {\n return [\n ...new Uint8Array(await globalThis.crypto.subtle.digest('SHA-256', bytes)),\n ]\n .map((b) => b.toString(16).padStart(2, '0'))\n .join('');\n}\n/**\n * Public first-edition English/linked Spanish K–12 teacher/family hierarchy.\n * Each enumeration reads one HTML page, at most one bounded preview PNG and\n * at most four original asset HEADs. Only an\n * explicit, validated selection can GET PDF bytes; generic acquisition retains\n * policy, tenant isolation, idempotence, attribution and notices.\n */\nexport function createPublicIllustrativeMathematicsFirstEditionAdapter(\n config: PublicIllustrativeMathematicsFirstEditionConfig = {},\n): CatalogSyncAdapter & CatalogAcquireAdapter & CatalogPreviewLoader {\n const fetcher = config.fetch ?? globalThis.fetch;\n const timeout = config.timeoutMs ?? 20_000;\n const pdfCap = config.maxPdfBytes ?? 32 * 1024 * 1024;\n if (\n !Number.isSafeInteger(timeout) ||\n timeout < 1 ||\n timeout > 60_000 ||\n !Number.isSafeInteger(pdfCap) ||\n pdfCap < 5 ||\n pdfCap > 64 * 1024 * 1024\n )\n throw new Error('Invalid first-edition request bounds.');\n async function operation<T>(\n run: (\n request: (\n url: string,\n method: 'GET' | 'HEAD',\n headers?: Record<string, string>,\n ) => Promise<Response>,\n ) => Promise<T>,\n deadline = timeout,\n ): Promise<T> {\n const controller = new AbortController();\n let timer: ReturnType<typeof setTimeout> | undefined;\n try {\n return await Promise.race([\n run(async (url, method, headers = {}) => {\n if (controller.signal.aborted)\n throw new Error('First-edition operation timed out.');\n const response = await fetcher(url, {\n method,\n redirect: 'error',\n signal: controller.signal,\n headers: {\n 'accept-encoding': 'identity',\n accept: url.startsWith(IM_ASSET_ORIGIN)\n ? method === 'HEAD'\n ? Object.values(CATALOG_REPRESENTATION_MEDIA_TYPES).join(', ')\n : 'application/pdf'\n : 'text/html',\n ...headers,\n },\n });\n if (\n !response.ok ||\n response.status !== 200 ||\n response.redirected ||\n response.url !== url\n ) {\n await response.body?.cancel();\n const error = new Error(\n `Official provider request failed: HTTP ${response.status} or unexpected redirect.`,\n );\n Object.assign(error, {\n retryAfterMs:\n response.status === 429\n ? retryDelay(response.headers.get('retry-after'))\n : undefined,\n });\n throw error;\n }\n return response;\n }),\n new Promise<T>((_resolve, reject) => {\n timer = setTimeout(() => {\n controller.abort();\n reject(new Error('First-edition operation timed out.'));\n }, deadline);\n }),\n ]);\n } finally {\n if (timer) clearTimeout(timer);\n controller.abort();\n }\n }\n async function html(\n request: Parameters<Parameters<typeof operation>[0]>[0],\n path: string,\n ) {\n const response = await request(IM_ORIGIN + path, 'GET');\n if (\n !/^text\\/html(?:\\s*;|$)/i.test(response.headers.get('content-type') ?? '')\n )\n throw new Error('Expected official HTML metadata.');\n const bytes = await readBody(response, METADATA_CAP);\n const parsed = parseImFirstEditionPage(\n new TextDecoder('utf-8', { fatal: true }).decode(bytes),\n path,\n );\n // Official HTML includes per-request CSRF tokens and changing weak ETags.\n // Bind the revision to the exact validated source semantics, not session markup.\n const revision = await sha256(\n new TextEncoder().encode(encode({ path, ...parsed })),\n );\n return { parsed, revision };\n }\n return {\n async loadPreview(value) {\n const preview = normalizeCatalogPreview(value);\n if (\n !preview ||\n (preview.rights.expiresAt &&\n Date.parse(preview.rights.expiresAt) <= Date.now())\n )\n throw new Error('Invalid or expired preview.');\n return operation(async (request) => {\n const response = await request(\n IM_ASSET_ORIGIN + '/' + preview.reference,\n 'GET',\n { accept: 'image/png' },\n );\n if (\n response.headers\n .get('content-type')\n ?.split(';')[0]\n .trim()\n .toLowerCase() !== 'image/png'\n ) {\n await response.body?.cancel();\n throw new Error('Preview is not PNG.');\n }\n return readBody(response, CATALOG_PREVIEW_MAX_BYTES);\n });\n },\n async enumerate(input): Promise<CatalogSyncPage> {\n let state: Cursor;\n try {\n state = cursor(input.cursor ?? input.checkpoint.cursor);\n } catch (error) {\n return {\n records: [],\n complete: false,\n paused: true,\n exclusions: [\n { code: 'invalid_provider_cursor', message: String(error) },\n ],\n };\n }\n try {\n const started = performance.now();\n const { result, candidate } = await operation(async (request) => {\n const path = state.todo[0];\n const { parsed, revision } = await html(request, path);\n if (state.pageRevision && state.pageRevision !== revision)\n throw new Error(\n 'Metadata changed during cursor traversal; restart this sync generation.',\n );\n if (state.offset > parsed.artifacts.length)\n throw new Error('Cursor artifact offset exceeds source page.');\n const policyExclusions =\n state.offset === 0 ? [...parsed.exclusions] : [];\n const records: CatalogSourceRecord[] = [];\n const page = imPagePath(path);\n const expectsChildren =\n page.leaf === 'root' ||\n (page.audience === 'teachers' &&\n !page.lesson &&\n ['units', 'lessons', 'index'].includes(page.leaf)) ||\n (page.audience === 'families' &&\n !page.unit &&\n ['units', 'index'].includes(page.leaf));\n if (expectsChildren && !parsed.children.length)\n throw new Error(\n 'Official hierarchy page has no recognized children; coverage is incomplete.',\n );\n if (page.course && state.offset === 0)\n records.push({\n providerId: PROVIDER,\n stableId: imStableId(path),\n revision,\n canonicalUrl: IM_ORIGIN + path,\n title: imHierarchyTitle(page),\n parentStableId: page.lesson\n ? imStableId(\n path.replace(\n /\\/(?:lesson-)?[0-9]+\\/preparation.html$/,\n page.band.startsWith('k5')\n ? '/lessons.html'\n : '/index.html',\n ),\n )\n : page.unit\n ? imStableId(\n `/${page.band}/${page.audience}/${page.course}/${page.band.startsWith('k5') ? 'units' : 'index'}.html`,\n )\n : undefined,\n resourceType: page.lesson\n ? 'lesson'\n : page.unit\n ? 'unit'\n : 'course',\n subjects: ['mathematics'],\n language: page.band.toLowerCase().endsWith('_es') ? 'es' : 'en',\n availableFormats: ['html'],\n visibility: 'teacher',\n licenseEvidence: {\n state: parsed.licensed ? 'verified' : 'unknown',\n sourceUrl: IM_ORIGIN + path,\n permittedOperations: ['link'],\n },\n });\n const slice = parsed.artifacts.slice(\n state.offset,\n state.offset + HEADS_PER_PAGE,\n );\n const results = await Promise.allSettled(\n slice.map(async (asset) => {\n if (!asset.allowed || !parsed.licensed || !parsed.attribution) {\n policyExclusions.push({\n code: !asset.allowed\n ? 'teacher_or_unknown_role'\n : 'unverified_license',\n message: `${asset.id}: ${asset.label || 'Unknown label'}.`,\n });\n return;\n }\n const response = await request(\n `${IM_ASSET_ORIGIN}/${asset.id}`,\n 'HEAD',\n );\n const { format, mediaType, ...metadata } =\n observedMetadata(response);\n const representation = normalizeCatalogRepresentation({\n format,\n mediaType,\n byteLength: metadata.length,\n validators: {\n etag: metadata.etag,\n lastModified: metadata.modified,\n },\n acquisition:\n format === 'unknown'\n ? {\n status: 'unknown-format',\n reason:\n mediaType === null\n ? 'missing-content-type'\n : 'unrecognized-content-type',\n }\n : format !== 'pdf'\n ? { status: 'unsupported-format' }\n : {\n status:\n metadata.length <= pdfCap\n ? 'supported'\n : 'size-limit',\n maxBytes: pdfCap,\n },\n });\n // Retain the published PDF revision encoding; capability limits are not content identity.\n const pinned =\n format === 'pdf'\n ? { v: 1, page: revision, ...metadata }\n : {\n v: 2,\n page: revision,\n ...metadata,\n mediaType,\n };\n const grade = page.band.startsWith('k5')\n ? page.course === 'kindergarten'\n ? 'K'\n : page.course?.slice(6)\n : page.band.startsWith('MS')\n ? String(Number(page.course) + 5)\n : undefined;\n records.push({\n providerId: PROVIDER,\n stableId: imStableId(path, asset.id),\n revision: encode(pinned),\n canonicalUrl: IM_ORIGIN + path,\n title: `${imHierarchyTitle(page)} — ${asset.label}`,\n suppliedDescription: `${parsed.title}. Source label: ${asset.label}.`,\n author: 'Illustrative Mathematics',\n subjects: ['mathematics'],\n gradeRange: grade\n ? { min: grade, max: grade }\n : { min: '9', max: '12' },\n language: page.band.toLowerCase().endsWith('_es') ? 'es' : 'en',\n resourceType: 'student-material',\n parentStableId: imStableId(path),\n availableFormats: format === 'unknown' ? [] : [format],\n representation,\n visibility: 'catalog',\n licenseEvidence: {\n state: 'verified',\n identifier: 'CC BY',\n version: '4.0',\n sourceUrl: IM_ORIGIN + path,\n attribution: `${parsed.attribution}\\n${IM_ORIGIN + path}\\n${IM_LICENSE}`,\n exceptions: `${parsed.notices}\\nOriginal first-edition ${format.toUpperCase()}; no changes made. License: ${IM_LICENSE}`,\n retrievedAt: new Date().toISOString(),\n permittedOperations: [\n 'link',\n 'download',\n 'print',\n 'adapt',\n 'redistribute',\n 'commercial-use',\n ],\n },\n });\n }),\n );\n // Do not advance a cursor or emit a partial page after any failed HEAD.\n const failure = results.find((r) => r.status === 'rejected');\n if (failure?.status === 'rejected') throw failure.reason;\n const end = state.offset + slice.length;\n const next: Cursor =\n end < parsed.artifacts.length\n ? { ...state, offset: end, pageRevision: revision }\n : {\n v: 1,\n todo: [...parsed.children, ...state.todo.slice(1)],\n offset: 0,\n };\n if (next.todo.length > 384 || encode(next).length > 64_000)\n throw new Error('Hierarchy cursor exceeds its durable bound.');\n if (path === '/')\n policyExclusions.push({\n code: 'declared_scope',\n message:\n 'Public first-edition official CMS artifact links with observed PDF/ZIP/DOCX representations explicitly labeled for students/families on official K5/MS/HS teacher/family course, unit, resources and lesson preparation pages, including linked Spanish counterparts and Algebra 1 Supports. HTML-only lessons, external-host artifacts, teacher/login and unknown-role material are excluded; unknown MIME is retained with acquisition denied; malformed MIME or invalid validators pause enumeration; AccessIM/v.360 is excluded.',\n });\n return {\n result: {\n records: records.sort((a, b) =>\n a.stableId.localeCompare(b.stableId),\n ),\n complete: next.todo.length === 0,\n ...(next.todo.length ? { nextCursor: encode(next) } : {}),\n policyExclusions,\n },\n candidate:\n state.offset === 0 && page.course && parsed.previewImage\n ? {\n ...parsed.previewImage,\n path,\n revision,\n attribution: parsed.attribution,\n }\n : undefined,\n };\n });\n // Required HTML/HEAD work has finished. Optional media gets its own short\n // deadline/controller, so a stalled image cannot pause the metadata cursor.\n const previewBudget = Math.min(\n 2000,\n Math.floor(timeout / 4),\n Math.floor(timeout - (performance.now() - started)),\n );\n if (candidate && previewBudget > 0) {\n try {\n const bytes = await operation(async (request) => {\n const response = await request(\n `${IM_ASSET_ORIGIN}/${candidate.id}`,\n 'GET',\n { accept: 'image/png' },\n );\n if (\n response.headers\n .get('content-type')\n ?.split(';')[0]\n .trim()\n .toLowerCase() !== 'image/png'\n ) {\n await response.body?.cancel();\n throw new Error('Preview is not PNG.');\n }\n return readBody(response, CATALOG_PREVIEW_MAX_BYTES);\n }, previewBudget);\n const dimensions = catalogPreviewPngDimensions(bytes);\n const hash = await sha256(bytes);\n const preview: CatalogPreview = {\n providerId: PROVIDER,\n stableId: imStableId(candidate.path),\n revision: `${candidate.revision}:${hash}`,\n reference: candidate.id,\n mediaType: 'image/png',\n ...dimensions,\n byteLength: bytes.length,\n sha256: hash,\n alt: candidate.alt,\n rights: {\n state: 'verified',\n identifier: 'CC-BY-4.0',\n sourceUrl: IM_ORIGIN + candidate.path,\n attribution: candidate.attribution,\n retrievedAt: new Date().toISOString(),\n },\n };\n const record = result.records.find(\n (record) => record.stableId === preview.stableId,\n );\n if (record) {\n record.revision = preview.revision;\n record.preview = preview;\n }\n } catch {\n // Optional preview failure leaves required records and cursor intact.\n }\n }\n return result;\n } catch (error) {\n return {\n records: [],\n complete: false,\n paused: true,\n nextCursor: encode(state),\n exclusions: [\n {\n code: 'provider_metadata_unavailable',\n message: error instanceof Error ? error.message : String(error),\n retryAfterMs: (error as { retryAfterMs?: number }).retryAfterMs,\n },\n ],\n };\n }\n },\n async acquire(input) {\n if (\n input.providerId !== PROVIDER ||\n input.format !== 'pdf' ||\n input.stableId.length > 300 ||\n input.revision.length > 1000\n )\n throw new Error('Unsupported first-edition acquisition.');\n const match = /^im-first-edition:(\\/[^#]+)#([a-zA-Z0-9]{20,64})$/.exec(\n input.stableId,\n );\n if (!match || imPagePath(match[1]).path !== match[1])\n throw new Error('Invalid selected first-edition identity.');\n const selected = JSON.parse(input.revision) as Revision;\n if (\n !selected ||\n Object.keys(selected).sort().join(',') !==\n 'etag,length,modified,page,v' ||\n selected.v !== 1 ||\n typeof selected.page !== 'string' ||\n !/^[a-f0-9]{64}$/.test(selected.page) ||\n typeof selected.etag !== 'string' ||\n !/^\"[\\x21\\x23-\\x7e]{1,200}\"$/.test(selected.etag) ||\n !Number.isSafeInteger(selected.length) ||\n selected.length < 5 ||\n selected.length > pdfCap ||\n typeof selected.modified !== 'string' ||\n selected.modified.length > 100 ||\n !Number.isFinite(Date.parse(selected.modified))\n )\n throw new Error('Invalid selected first-edition revision.');\n return await operation(async (request) => {\n const { parsed, revision } = await html(request, match[1]);\n if (\n revision !== selected.page ||\n !parsed.licensed ||\n !parsed.attribution ||\n !parsed.artifacts.some((a) => a.id === match[2] && a.allowed)\n )\n throw new Error(\n 'Selected artifact, role, license or page revision changed.',\n );\n const response = await request(\n `${IM_ASSET_ORIGIN}/${match[2]}`,\n 'GET',\n {\n 'if-match': selected.etag,\n 'if-unmodified-since': selected.modified,\n },\n );\n const actual = validators(response, pdfCap);\n if (\n actual.etag !== selected.etag ||\n actual.length !== selected.length ||\n actual.modified !== selected.modified\n ) {\n await response.body?.cancel();\n throw new Error('Selected PDF revision changed.');\n }\n const bytes = await readBody(response, pdfCap);\n if (\n bytes.length !== selected.length ||\n new TextDecoder().decode(bytes.subarray(0, 5)) !== '%PDF-'\n )\n throw new Error('Selected body is not the declared PDF.');\n return { bytes, revision: input.revision, sha256: await sha256(bytes) };\n });\n },\n };\n}\n"],"mappings":";;;;AAOA,eAAe,wBAAwB,KAAK,MAAM,m0iTAAozxV,CAAC;;;ACAh2xV,IAAM,qCAAqC;CAChD,KAAK;CACL,KAAK;CACL,MAAM;AACR;AAEO,SAAS,+BAA+B,OAAuB;CACpE,MAAM,QAAQ;CAEd,MAAM,SAAS,IAAI,OACjB,IAAI,MAAK,GAAI,MAAK,gBAAmB,MAAK,MAAO,MAAK,uEACxD;CACA,IAAI,MAAM,SAAS,OAAO,CAAC,OAAO,KAAK,KAAK,GAC1C,MAAM,IAAI,2BAA2B;CACvC,OAAO,MAAM,MAAM,KAAK,CAAC,CAAA,CAAE,EAAC,CAAE,KAAK,CAAA,CAAE,YAAY;AACnD;AACO,SAAS,4BACd,WAC6D;CAC7D,MAAM,QAAQ,+BAA+B,SAAS;CACtD,OAAO,OAAO,QAAQ,kCAAk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;KACE,MAAM;KACN,SACE,iBAAiB,QACb,MAAM,UACN;IACR,CACF;GACF;EACF;CACF,EACF;AACF;AAEO,SAAS,kBACd,MACoB;CACpB,OAAO,IAAI,6BAA6B,QAAQ,IAAI;AACtD;AAEO,SAAS,wBACd,MACoB;CACpB,OAAO,IAAI,6BAA6B,eAAe,IAAI;AAC7D;AAGO,SAAS,2BACd,QACoB;CACpB,OAAO,EACL,MAAM,UAAU,OAAO;EACrB,IAAI,MAAM,QACR,OAAO;GACL,SAAS,CAAC;GACV,UAAU;GACV,YAAY,CACV;IACE,QAAQ,MAAM;IACd,MAAM;IACN,SACE;GACJ,CACF;EACF;EACF,MAAM,MAAM,SAAS,OAAO,SAAS,aAAa;EAClD,MAAM,SAAS,MAAM,cACnB,OAAO,OACP,KACA,kDACA,OAAO,SACT;EACA,IAAI,cAAc,QAAQ,OAAO;EACjC,IAAI;GACF,OAAO;IACL,SAAS,uBAAuB,OAAO,MAAM,OAAO,QAAQ;IAC5D,UAAU,OAAO,qBAAqB;IACtC,GAAI,OAAO,qBAAqB,OAC5B,CAAC,IACD,EACE,kBAAkB,CAChB;KACE,MAAM;KACN,SACE;IACJ,CACF,EACF;GACN;EACF,SAAS,OAAO;GACd,OAAO;IACL,SAAS,CAAC;IACV,UAAU;IACV,YAAY,CACV;KACE,MAAM;KACN,SACE,iBAAiB,QACb,MAAM,UACN;IACR,CACF;GACF;EACF;CACF,EACF;AACF;;;ACtcO,IAAM,yBAA2D;CACtE;EACE,WAAW;EACX,OAAO;EACP,SAAS;EACT,SAAS;EACT,SAAS;EACT,gBAAgB;CAClB;CACA;EACE,WAAW;EACX,OAAO;EACP,SAAS;EACT,SAAS;EACT,SAAS;EACT,gBAAgB;CAClB;CACA;EACE,WAAW;EACX,OAAO;EACP,SAAS;EACT,SAAS;EACT,SAAS;EACT,gBAAgB;CAClB;CACA;EACE,WAAW;EACX,OAAO;EACP,SAAS;EACT,SAAS;EACT,SAAS;EACT,gBAAgB;CAClB;CACA;EACE,WAAW;EACX,OAAO;EACP,SAAS;EACT,SAAS;EACT,SAAS;EACT,gBAAgB;CAClB;CACA;EACE,WAAW;EACX,OAAO;EACP,SAAS;EACT,SAAS;EACT,SAAS;EACT,gBAAgB;CAClB;CACA;EACE,WAAW;EACX,OAAO;EACP,SAAS;EACT,SAAS;EACT,SAAS;EACT,gBAAgB;CAClB;CACA;EACE,WAAW;EACX,OAAO;EACP,SAAS;EACT,SAAS;EACT,SAAS;EACT,gBAAgB;CAClB;CACA;EACE,WAAW;EACX,OAAO;EACP,SAAS;EACT,SAAS;EACT,SAAS;EACT,gBAAgB;CAClB;AACF;AAEO,SAAS,cACd,SACkC;CAClC,OAAO,UACH,uBAAuB,QAAQ,WAAW,OAAO,YAAY,OAAO,IACpE;AACN;AAEA,SAAS,YACP,SACA,SACA,OACA,SACuB;CACvB,OAAO;EACL,WAAW,GAAG,QAAO,GAAI;EACzB;EACA;EACA;EACA,SAAS;EACT,gBAAgB;CAClB;AACF;AAOO,IAAM,wBAAyD;CACpE;EACE,SAAS;EACT,OAAO;EACP,SAAS;GACP,YACE,WACA,WACA,qBACA,gDACF;GACA,YACE,WACA,WACA,qBACA,gDACF;GACA,YACE,WACA,SACA,yBACA,gDACF;GACA,YACE,WACA,OACA,iBACA,4CACF;GACA,YACE,WACA,SACA,mBACA,wFACF;GACA,YACE,WACA,aACA,kCACA,+CACF;EACF;CACF;CACA;EACE,SAAS;EACT,OAAO;EACP,SAAS;GACP,YACE,WACA,WACA,qBACA,yCACF;GACA,YACE,WACA,WACA,4BACA,wDACF;GACA,YACE,WACA,SACA,yBACA,oDACF;GACA,YACE,WACA,OACA,wBACA,oDACF;GACA,YACE,WACA,SACA,0BACA,8CACF;GACA,YACE,WACA,aACA,sCACA,2CACF;EACF;CACF;CACA;EACE,SAAS;EACT,OAAO;EACP,SAAS;GACP,YACE,WACA,WACA,2BACA,uDACF;GACA,YACE,WACA,WACA,oCACA,wDACF;GACA,YACE,WACA,SACA,kBACA,8DACF;GAC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