@happyvertical/smrt-app-mcp 0.64.0 → 0.66.0
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/audit-store.js +1 -1
- package/dist/audit-store.js.map +1 -1
- package/dist/manifest.json +1 -1
- package/dist/smrt-knowledge.json +3 -3
- package/package.json +6 -6
package/dist/audit-store.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ObjectRegistry, SmrtCollection, SmrtObject, field, smrt } from "@happyvertical/smrt-core";
|
|
2
2
|
import { TenantScoped, tenantId, withSystemContext, withTenant } from "@happyvertical/smrt-tenancy";
|
|
3
3
|
//#region src/__smrt-register__.ts
|
|
4
|
-
ObjectRegistry.registerPackageManifest(JSON.parse(`{"version":"1.0.0","timestamp":0,"packageName":"@happyvertical/smrt-app-mcp","packageVersion":"0.
|
|
4
|
+
ObjectRegistry.registerPackageManifest(JSON.parse(`{"version":"1.0.0","timestamp":0,"packageName":"@happyvertical/smrt-app-mcp","packageVersion":"0.66.0","objects":{"@happyvertical/smrt-app-mcp:McpCallAudit":{"name":"mcpcallaudit","className":"McpCallAudit","qualifiedName":"@happyvertical/smrt-app-mcp:McpCallAudit","collection":"mcpcallaudits","description":"One persisted MCP tool call. Stores identity, tool, tenant, outcome and argument KEY names only: never argument values or response bodies.","filePath":"src/audit-store.ts","packageName":"@happyvertical/smrt-app-mcp","fields":{"tenantId":{"type":"text","_meta":{"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false},"__statedOptions":["sqlType","nullable","__tenancy","required"],"sqlType":"UUID","nullable":true,"required":false},"required":false},"principalId":{"type":"text","_meta":{"__statedOptions":["nullable","required"],"nullable":true,"required":false},"required":false},"principalKind":{"type":"text","_meta":{"__statedOptions":["nullable","required"],"nullable":true,"required":false},"required":false},"identityIssuer":{"type":"text","_meta":{"__statedOptions":["nullable","required"],"nullable":true,"required":false},"required":false},"identitySubject":{"type":"text","_meta":{"__statedOptions":["nullable","required"],"nullable":true,"required":false},"required":false},"identityClientId":{"type":"text","_meta":{"__statedOptions":["nullable","required"],"nullable":true,"required":false},"required":false},"tool":{"type":"text","_meta":{"__statedOptions":["required","requiredFor","default"],"required":true,"default":"","requiredFor":"identity"},"required":true,"default":""},"outcome":{"type":"text","_meta":{"__statedOptions":["required","default","enum"],"required":true,"default":"allowed"},"required":true,"default":"allowed","enum":["allowed","denied","error"]},"errorCode":{"type":"text","_meta":{"__statedOptions":["nullable","required"],"nullable":true,"required":false},"required":false},"argumentKeys":{"type":"json","_meta":{"__statedOptions":[]},"required":false},"occurredAt":{"type":"datetime","_meta":{"__statedOptions":["required"],"required":true},"required":true}},"methods":{},"decoratorConfig":{"tableName":"smrt_mcp_call_audits","api":false,"mcp":false,"cli":false,"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"McpCallAudit","collectionExportName":"McpCallAuditCollection","validationRules":[{"field":"tool","rule":"required","fieldType":"text"},{"field":"outcome","rule":"required","fieldType":"text"},{"field":"occurredAt","rule":"required","fieldType":"datetime"}],"schema":{"tableName":"smrt_mcp_call_audits","ddl":"CREATE TABLE IF NOT EXISTS \\"smrt_mcp_call_audits\\" (\\n \\"_sync_origin_device_id\\" TEXT,\\n \\"_sync_revision\\" INTEGER,\\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 \\"principal_id\\" TEXT,\\n \\"principal_kind\\" TEXT,\\n \\"identity_issuer\\" TEXT,\\n \\"identity_subject\\" TEXT,\\n \\"identity_client_id\\" TEXT,\\n \\"tool\\" TEXT NOT NULL DEFAULT '',\\n \\"outcome\\" TEXT NOT NULL DEFAULT 'allowed',\\n \\"error_code\\" TEXT,\\n \\"argument_keys\\" JSON,\\n \\"occurred_at\\" TIMESTAMP NOT NULL\\n);","columns":{"_sync_origin_device_id":{"type":"TEXT"},"_sync_revision":{"type":"INTEGER"},"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},"principal_id":{"type":"TEXT","notNull":false,"unique":false},"principal_kind":{"type":"TEXT","notNull":false,"unique":false},"identity_issuer":{"type":"TEXT","notNull":false,"unique":false},"identity_subject":{"type":"TEXT","notNull":false,"unique":false},"identity_client_id":{"type":"TEXT","notNull":false,"unique":false},"tool":{"type":"TEXT","notNull":true,"unique":false,"default":""},"outcome":{"type":"TEXT","notNull":true,"unique":false,"default":"allowed"},"error_code":{"type":"TEXT","notNull":false,"unique":false},"argument_keys":{"type":"JSON","notNull":false,"unique":false},"occurred_at":{"type":"TIMESTAMP","notNull":true,"unique":false}},"indexes":[{"name":"smrt_mcp_call_audits_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"smrt_mcp_call_audits_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"e0a722bb"},"importPath":"@happyvertical/smrt-app-mcp/audit-store"},"@happyvertical/smrt-app-mcp:McpCallAuditCollection":{"name":"mcpcallauditcollection","className":"McpCallAuditCollection","qualifiedName":"@happyvertical/smrt-app-mcp:McpCallAuditCollection","collection":"mcpcallaudits","description":"Tenant-aware persistence and queries for McpCallAudit.","filePath":"src/audit-store.ts","packageName":"@happyvertical/smrt-app-mcp","fields":{},"methods":{"append":{"name":"append","async":true,"parameters":[{"name":"record","type":"McpAuditRecord","optional":false}],"returnType":"Promise<McpCallAudit>","isStatic":false,"isPublic":true},"listAudits":{"name":"listAudits","async":true,"parameters":[{"name":"query","type":"any","optional":false,"typeUnresolved":true}],"returnType":"any","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"smrt_mcp_call_audits","api":false,"mcp":false,"cli":false},"extends":"SmrtCollection","extendsTypeArg":"McpCallAudit","exportName":"McpCallAuditCollection","collectionExportName":"McpCallAuditCollectionCollection","collectionOf":"@happyvertical/smrt-app-mcp:McpCallAudit","inheritedExposure":["api","mcp","cli"],"schema":{"tableName":"smrt_mcp_call_audits","ddl":"CREATE TABLE IF NOT EXISTS \\"smrt_mcp_call_audits\\" (\\n \\"_sync_origin_device_id\\" TEXT,\\n \\"_sync_revision\\" INTEGER,\\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 \\"principal_id\\" TEXT,\\n \\"principal_kind\\" TEXT,\\n \\"identity_issuer\\" TEXT,\\n \\"identity_subject\\" TEXT,\\n \\"identity_client_id\\" TEXT,\\n \\"tool\\" TEXT NOT NULL DEFAULT '',\\n \\"outcome\\" TEXT NOT NULL DEFAULT 'allowed',\\n \\"error_code\\" TEXT,\\n \\"argument_keys\\" JSON,\\n \\"occurred_at\\" TIMESTAMP NOT NULL\\n);","columns":{"_sync_origin_device_id":{"type":"TEXT"},"_sync_revision":{"type":"INTEGER"},"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},"principal_id":{"type":"TEXT","notNull":false,"unique":false},"principal_kind":{"type":"TEXT","notNull":false,"unique":false},"identity_issuer":{"type":"TEXT","notNull":false,"unique":false},"identity_subject":{"type":"TEXT","notNull":false,"unique":false},"identity_client_id":{"type":"TEXT","notNull":false,"unique":false},"tool":{"type":"TEXT","notNull":true,"unique":false,"default":""},"outcome":{"type":"TEXT","notNull":true,"unique":false,"default":"allowed"},"error_code":{"type":"TEXT","notNull":false,"unique":false},"argument_keys":{"type":"JSON","notNull":false,"unique":false},"occurred_at":{"type":"TIMESTAMP","notNull":true,"unique":false}},"indexes":[{"name":"smrt_mcp_call_audits_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"smrt_mcp_call_audits_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"e0a722bb"},"importPath":"@happyvertical/smrt-app-mcp/audit-store"}},"moduleType":"smrt","smrtDependencies":["@happyvertical/smrt-core","@happyvertical/smrt-jobs","@happyvertical/smrt-tenancy"],"stampsConstructors":true}`));
|
|
5
5
|
//#endregion
|
|
6
6
|
//#region src/audit-store.ts
|
|
7
7
|
var __defProp = Object.defineProperty;
|
package/dist/audit-store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-store.js","names":[],"sources":["../src/__smrt-register__.ts","../src/audit-store.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-app-mcp\\\",\\\"packageVersion\\\":\\\"0.64.0\\\",\\\"objects\\\":{\\\"@happyvertical/smrt-app-mcp:McpCallAudit\\\":{\\\"name\\\":\\\"mcpcallaudit\\\",\\\"className\\\":\\\"McpCallAudit\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-app-mcp:McpCallAudit\\\",\\\"collection\\\":\\\"mcpcallaudits\\\",\\\"description\\\":\\\"One persisted MCP tool call. Stores identity, tool, tenant, outcome and argument KEY names only: never argument values or response bodies.\\\",\\\"filePath\\\":\\\"src/audit-store.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-app-mcp\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true,\\\"mode\\\":\\\"optional\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false},\\\"__statedOptions\\\":[\\\"sqlType\\\",\\\"nullable\\\",\\\"__tenancy\\\",\\\"required\\\"],\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"required\\\":false},\\\"required\\\":false},\\\"principalId\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"nullable\\\",\\\"required\\\"],\\\"nullable\\\":true,\\\"required\\\":false},\\\"required\\\":false},\\\"principalKind\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"nullable\\\",\\\"required\\\"],\\\"nullable\\\":true,\\\"required\\\":false},\\\"required\\\":false},\\\"identityIssuer\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"nullable\\\",\\\"required\\\"],\\\"nullable\\\":true,\\\"required\\\":false},\\\"required\\\":false},\\\"identitySubject\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"nullable\\\",\\\"required\\\"],\\\"nullable\\\":true,\\\"required\\\":false},\\\"required\\\":false},\\\"identityClientId\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"nullable\\\",\\\"required\\\"],\\\"nullable\\\":true,\\\"required\\\":false},\\\"required\\\":false},\\\"tool\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"required\\\",\\\"requiredFor\\\",\\\"default\\\"],\\\"required\\\":true,\\\"default\\\":\\\"\\\",\\\"requiredFor\\\":\\\"identity\\\"},\\\"required\\\":true,\\\"default\\\":\\\"\\\"},\\\"outcome\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"required\\\",\\\"default\\\",\\\"enum\\\"],\\\"required\\\":true,\\\"default\\\":\\\"allowed\\\"},\\\"required\\\":true,\\\"default\\\":\\\"allowed\\\",\\\"enum\\\":[\\\"allowed\\\",\\\"denied\\\",\\\"error\\\"]},\\\"errorCode\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"nullable\\\",\\\"required\\\"],\\\"nullable\\\":true,\\\"required\\\":false},\\\"required\\\":false},\\\"argumentKeys\\\":{\\\"type\\\":\\\"json\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[]},\\\"required\\\":false},\\\"occurredAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"required\\\"],\\\"required\\\":true},\\\"required\\\":true}},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"smrt_mcp_call_audits\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"optional\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"McpCallAudit\\\",\\\"collectionExportName\\\":\\\"McpCallAuditCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"tool\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"outcome\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"occurredAt\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"datetime\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"smrt_mcp_call_audits\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"smrt_mcp_call_audits\\\\\\\" (\\\\n \\\\\\\"_sync_origin_device_id\\\\\\\" TEXT,\\\\n \\\\\\\"_sync_revision\\\\\\\" INTEGER,\\\\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 \\\\\\\"principal_id\\\\\\\" TEXT,\\\\n \\\\\\\"principal_kind\\\\\\\" TEXT,\\\\n \\\\\\\"identity_issuer\\\\\\\" TEXT,\\\\n \\\\\\\"identity_subject\\\\\\\" TEXT,\\\\n \\\\\\\"identity_client_id\\\\\\\" TEXT,\\\\n \\\\\\\"tool\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"outcome\\\\\\\" TEXT NOT NULL DEFAULT 'allowed',\\\\n \\\\\\\"error_code\\\\\\\" TEXT,\\\\n \\\\\\\"argument_keys\\\\\\\" JSON,\\\\n \\\\\\\"occurred_at\\\\\\\" TIMESTAMP NOT NULL\\\\n);\\\",\\\"columns\\\":{\\\"_sync_origin_device_id\\\":{\\\"type\\\":\\\"TEXT\\\"},\\\"_sync_revision\\\":{\\\"type\\\":\\\"INTEGER\\\"},\\\"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},\\\"principal_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"principal_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"identity_issuer\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"identity_subject\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"identity_client_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"tool\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"outcome\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"allowed\\\"},\\\"error_code\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"argument_keys\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"occurred_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"smrt_mcp_call_audits_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"smrt_mcp_call_audits_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"e0a722bb\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-app-mcp/audit-store\\\"},\\\"@happyvertical/smrt-app-mcp:McpCallAuditCollection\\\":{\\\"name\\\":\\\"mcpcallauditcollection\\\",\\\"className\\\":\\\"McpCallAuditCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-app-mcp:McpCallAuditCollection\\\",\\\"collection\\\":\\\"mcpcallaudits\\\",\\\"description\\\":\\\"Tenant-aware persistence and queries for McpCallAudit.\\\",\\\"filePath\\\":\\\"src/audit-store.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-app-mcp\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"append\\\":{\\\"name\\\":\\\"append\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"record\\\",\\\"type\\\":\\\"McpAuditRecord\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<McpCallAudit>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"listAudits\\\":{\\\"name\\\":\\\"listAudits\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"query\\\",\\\"type\\\":\\\"any\\\",\\\"optional\\\":false,\\\"typeUnresolved\\\":true}],\\\"returnType\\\":\\\"any\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"smrt_mcp_call_audits\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"McpCallAudit\\\",\\\"exportName\\\":\\\"McpCallAuditCollection\\\",\\\"collectionExportName\\\":\\\"McpCallAuditCollectionCollection\\\",\\\"collectionOf\\\":\\\"@happyvertical/smrt-app-mcp:McpCallAudit\\\",\\\"inheritedExposure\\\":[\\\"api\\\",\\\"mcp\\\",\\\"cli\\\"],\\\"schema\\\":{\\\"tableName\\\":\\\"smrt_mcp_call_audits\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"smrt_mcp_call_audits\\\\\\\" (\\\\n \\\\\\\"_sync_origin_device_id\\\\\\\" TEXT,\\\\n \\\\\\\"_sync_revision\\\\\\\" INTEGER,\\\\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 \\\\\\\"principal_id\\\\\\\" TEXT,\\\\n \\\\\\\"principal_kind\\\\\\\" TEXT,\\\\n \\\\\\\"identity_issuer\\\\\\\" TEXT,\\\\n \\\\\\\"identity_subject\\\\\\\" TEXT,\\\\n \\\\\\\"identity_client_id\\\\\\\" TEXT,\\\\n \\\\\\\"tool\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"outcome\\\\\\\" TEXT NOT NULL DEFAULT 'allowed',\\\\n \\\\\\\"error_code\\\\\\\" TEXT,\\\\n \\\\\\\"argument_keys\\\\\\\" JSON,\\\\n \\\\\\\"occurred_at\\\\\\\" TIMESTAMP NOT NULL\\\\n);\\\",\\\"columns\\\":{\\\"_sync_origin_device_id\\\":{\\\"type\\\":\\\"TEXT\\\"},\\\"_sync_revision\\\":{\\\"type\\\":\\\"INTEGER\\\"},\\\"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},\\\"principal_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"principal_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"identity_issuer\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"identity_subject\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"identity_client_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"tool\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"outcome\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"allowed\\\"},\\\"error_code\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"argument_keys\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"occurred_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"smrt_mcp_call_audits_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"smrt_mcp_call_audits_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"e0a722bb\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-app-mcp/audit-store\\\"}},\\\"moduleType\\\":\\\"smrt\\\",\\\"smrtDependencies\\\":[\\\"@happyvertical/smrt-core\\\",\\\"@happyvertical/smrt-jobs\\\",\\\"@happyvertical/smrt-tenancy\\\"],\\\"stampsConstructors\\\":true}\"));\n","// Self-register this package's manifest for consumers that import via this\n// subpath without the main entry (smrt#1132).\nimport './__smrt-register__.js';\n\nimport {\n field,\n SmrtCollection,\n SmrtObject,\n smrt,\n} from '@happyvertical/smrt-core';\nimport {\n TenantScoped,\n tenantId,\n withSystemContext,\n withTenant,\n} from '@happyvertical/smrt-tenancy';\nimport type {\n McpAuditOutcome,\n McpAuditQuery,\n McpAuditRecord,\n McpAuditSink,\n} from './audit.js';\n\n/**\n * One persisted MCP tool call. Stores identity, tool, tenant, outcome and\n * argument KEY names only: never argument values or response bodies.\n */\n@smrt({\n tableName: 'smrt_mcp_call_audits',\n // Audit rows are read through `McpCallAuditCollection.listAudits`, which\n // requires an explicit tenant; no generated read surface (fail closed).\n api: false,\n mcp: false,\n cli: false,\n})\n@TenantScoped({ mode: 'optional' })\nexport class McpCallAudit extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-app-mcp\";\n /** The tenant the call ran for; `null` for a global/anonymous call. */\n @tenantId({ nullable: true })\n tenantId: string | null | undefined = undefined;\n\n /** The principal id (credential id); `null` for an anonymous call. */\n @field({ type: 'text', nullable: true })\n principalId: string | null = null;\n\n /** The principal kind (agent, owner, user, ...); `null` when unknown. */\n @field({ type: 'text', nullable: true })\n principalKind: string | null = null;\n\n @field({ type: 'text', nullable: true })\n identityIssuer: string | null = null;\n\n @field({ type: 'text', nullable: true })\n identitySubject: string | null = null;\n\n @field({ type: 'text', nullable: true })\n identityClientId: string | null = null;\n\n /**\n * The tool the call named. Required for identity: the record exists to say\n * which tool ran, and `listAudits` looks rows up by it.\n */\n @field({ type: 'text', required: true, requiredFor: 'identity', default: '' })\n tool = '';\n\n @field({ type: 'text', required: true, default: 'allowed' })\n outcome: McpAuditOutcome = 'allowed';\n\n @field({ type: 'text', nullable: true })\n errorCode: string | null = null;\n\n @field({ type: 'json' })\n argumentKeys: string[] = [];\n\n @field({ type: 'datetime', required: true })\n occurredAt: Date = new Date();\n}\n\nconst DEFAULT_LIMIT = 100;\nconst MAX_LIMIT = 500;\n\n/** Tenant-aware persistence and queries for {@link McpCallAudit}. */\nexport class McpCallAuditCollection extends SmrtCollection<McpCallAudit> {\n static readonly _itemClass = McpCallAudit;\n\n /** Persist one record under its own tenant (or the global scope). */\n async append(record: McpAuditRecord): Promise<McpCallAudit> {\n const write = () =>\n this.create({\n tenantId: record.tenantId,\n principalId: record.principalId,\n principalKind: record.principalKind,\n identityIssuer: record.identityIssuer ?? null,\n identitySubject: record.identitySubject ?? null,\n identityClientId: record.identityClientId ?? null,\n tool: record.tool,\n outcome: record.outcome,\n errorCode: record.errorCode ?? null,\n argumentKeys: [...record.argumentKeys],\n occurredAt: record.occurredAt,\n });\n return record.tenantId\n ? withTenant({ tenantId: record.tenantId }, write)\n : withSystemContext(write);\n }\n\n /**\n * Newest-first records for one tenant, optionally narrowed by principal,\n * tool or outcome. `tenantId` is mandatory: `null` lists global rows.\n */\n async listAudits(query: McpAuditQuery & { tenantId: string | null }) {\n if (query.tenantId === undefined) {\n throw new TypeError('listAudits requires an explicit tenantId.');\n }\n const limit = Math.min(\n Math.max(Math.trunc(query.limit ?? DEFAULT_LIMIT), 1),\n MAX_LIMIT,\n );\n const where: Record<string, unknown> = { tenantId: query.tenantId };\n if (query.principalId !== undefined) where.principalId = query.principalId;\n if (query.tool !== undefined) where.tool = query.tool;\n if (query.outcome !== undefined) where.outcome = query.outcome;\n const read = () => this.list({ where, orderBy: 'occurred_at DESC', limit });\n const rows = query.tenantId\n ? await withTenant({ tenantId: query.tenantId }, read)\n : await withSystemContext(read);\n return rows.map((row): McpAuditRecord & { id: string } => ({\n id: String(row.id),\n principalId: row.principalId ?? null,\n principalKind: row.principalKind ?? null,\n tool: row.tool,\n tenantId: row.tenantId ?? null,\n outcome: row.outcome,\n ...(row.errorCode ? { errorCode: row.errorCode } : {}),\n ...(row.identityIssuer ? { identityIssuer: row.identityIssuer } : {}),\n ...(row.identitySubject ? { identitySubject: row.identitySubject } : {}),\n ...(row.identityClientId\n ? { identityClientId: row.identityClientId }\n : {}),\n argumentKeys: Array.isArray(row.argumentKeys) ? row.argumentKeys : [],\n occurredAt: new Date(row.occurredAt),\n }));\n }\n}\n\n/** Options for {@link createSmrtMcpAuditStore}. */\nexport interface SmrtMcpAuditStoreOptions {\n /** SMRT options bag (`{ db }`), the same one `smrtOptions` supplies. */\n smrtOptions: () => Record<string, unknown>;\n}\n\n/**\n * The default persistent audit sink: a SMRT-model-backed, tenant-aware store.\n * Pass it as `auditSink` and read it back with `list`.\n */\nexport function createSmrtMcpAuditStore(\n options: SmrtMcpAuditStoreOptions,\n): McpAuditSink & {\n list(\n query: McpAuditQuery & { tenantId: string | null },\n ): ReturnType<McpCallAuditCollection['listAudits']>;\n} {\n // Resolved per operation: `smrtOptions()` may return request-scoped state\n // (e.g. a transaction-bound db under RLS) that must not outlive its request.\n const get = () =>\n McpCallAuditCollection.create(\n options.smrtOptions() as never,\n ) as Promise<McpCallAuditCollection>;\n return {\n async record(record) {\n await (await get()).append(record);\n },\n async list(query) {\n return (await get()).listAudits(query);\n },\n };\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"audit-store.js","names":[],"sources":["../src/__smrt-register__.ts","../src/audit-store.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-app-mcp\\\",\\\"packageVersion\\\":\\\"0.66.0\\\",\\\"objects\\\":{\\\"@happyvertical/smrt-app-mcp:McpCallAudit\\\":{\\\"name\\\":\\\"mcpcallaudit\\\",\\\"className\\\":\\\"McpCallAudit\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-app-mcp:McpCallAudit\\\",\\\"collection\\\":\\\"mcpcallaudits\\\",\\\"description\\\":\\\"One persisted MCP tool call. Stores identity, tool, tenant, outcome and argument KEY names only: never argument values or response bodies.\\\",\\\"filePath\\\":\\\"src/audit-store.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-app-mcp\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true,\\\"mode\\\":\\\"optional\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false},\\\"__statedOptions\\\":[\\\"sqlType\\\",\\\"nullable\\\",\\\"__tenancy\\\",\\\"required\\\"],\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"required\\\":false},\\\"required\\\":false},\\\"principalId\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"nullable\\\",\\\"required\\\"],\\\"nullable\\\":true,\\\"required\\\":false},\\\"required\\\":false},\\\"principalKind\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"nullable\\\",\\\"required\\\"],\\\"nullable\\\":true,\\\"required\\\":false},\\\"required\\\":false},\\\"identityIssuer\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"nullable\\\",\\\"required\\\"],\\\"nullable\\\":true,\\\"required\\\":false},\\\"required\\\":false},\\\"identitySubject\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"nullable\\\",\\\"required\\\"],\\\"nullable\\\":true,\\\"required\\\":false},\\\"required\\\":false},\\\"identityClientId\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"nullable\\\",\\\"required\\\"],\\\"nullable\\\":true,\\\"required\\\":false},\\\"required\\\":false},\\\"tool\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"required\\\",\\\"requiredFor\\\",\\\"default\\\"],\\\"required\\\":true,\\\"default\\\":\\\"\\\",\\\"requiredFor\\\":\\\"identity\\\"},\\\"required\\\":true,\\\"default\\\":\\\"\\\"},\\\"outcome\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"required\\\",\\\"default\\\",\\\"enum\\\"],\\\"required\\\":true,\\\"default\\\":\\\"allowed\\\"},\\\"required\\\":true,\\\"default\\\":\\\"allowed\\\",\\\"enum\\\":[\\\"allowed\\\",\\\"denied\\\",\\\"error\\\"]},\\\"errorCode\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"nullable\\\",\\\"required\\\"],\\\"nullable\\\":true,\\\"required\\\":false},\\\"required\\\":false},\\\"argumentKeys\\\":{\\\"type\\\":\\\"json\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[]},\\\"required\\\":false},\\\"occurredAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"required\\\"],\\\"required\\\":true},\\\"required\\\":true}},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"smrt_mcp_call_audits\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"tenantScoped\\\":{\\\"mode\\\":\\\"optional\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"McpCallAudit\\\",\\\"collectionExportName\\\":\\\"McpCallAuditCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"tool\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"outcome\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"occurredAt\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"datetime\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"smrt_mcp_call_audits\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"smrt_mcp_call_audits\\\\\\\" (\\\\n \\\\\\\"_sync_origin_device_id\\\\\\\" TEXT,\\\\n \\\\\\\"_sync_revision\\\\\\\" INTEGER,\\\\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 \\\\\\\"principal_id\\\\\\\" TEXT,\\\\n \\\\\\\"principal_kind\\\\\\\" TEXT,\\\\n \\\\\\\"identity_issuer\\\\\\\" TEXT,\\\\n \\\\\\\"identity_subject\\\\\\\" TEXT,\\\\n \\\\\\\"identity_client_id\\\\\\\" TEXT,\\\\n \\\\\\\"tool\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"outcome\\\\\\\" TEXT NOT NULL DEFAULT 'allowed',\\\\n \\\\\\\"error_code\\\\\\\" TEXT,\\\\n \\\\\\\"argument_keys\\\\\\\" JSON,\\\\n \\\\\\\"occurred_at\\\\\\\" TIMESTAMP NOT NULL\\\\n);\\\",\\\"columns\\\":{\\\"_sync_origin_device_id\\\":{\\\"type\\\":\\\"TEXT\\\"},\\\"_sync_revision\\\":{\\\"type\\\":\\\"INTEGER\\\"},\\\"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},\\\"principal_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"principal_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"identity_issuer\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"identity_subject\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"identity_client_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"tool\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"outcome\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"allowed\\\"},\\\"error_code\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"argument_keys\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"occurred_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"smrt_mcp_call_audits_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"smrt_mcp_call_audits_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"e0a722bb\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-app-mcp/audit-store\\\"},\\\"@happyvertical/smrt-app-mcp:McpCallAuditCollection\\\":{\\\"name\\\":\\\"mcpcallauditcollection\\\",\\\"className\\\":\\\"McpCallAuditCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-app-mcp:McpCallAuditCollection\\\",\\\"collection\\\":\\\"mcpcallaudits\\\",\\\"description\\\":\\\"Tenant-aware persistence and queries for McpCallAudit.\\\",\\\"filePath\\\":\\\"src/audit-store.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-app-mcp\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"append\\\":{\\\"name\\\":\\\"append\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"record\\\",\\\"type\\\":\\\"McpAuditRecord\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<McpCallAudit>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"listAudits\\\":{\\\"name\\\":\\\"listAudits\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"query\\\",\\\"type\\\":\\\"any\\\",\\\"optional\\\":false,\\\"typeUnresolved\\\":true}],\\\"returnType\\\":\\\"any\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"smrt_mcp_call_audits\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"McpCallAudit\\\",\\\"exportName\\\":\\\"McpCallAuditCollection\\\",\\\"collectionExportName\\\":\\\"McpCallAuditCollectionCollection\\\",\\\"collectionOf\\\":\\\"@happyvertical/smrt-app-mcp:McpCallAudit\\\",\\\"inheritedExposure\\\":[\\\"api\\\",\\\"mcp\\\",\\\"cli\\\"],\\\"schema\\\":{\\\"tableName\\\":\\\"smrt_mcp_call_audits\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"smrt_mcp_call_audits\\\\\\\" (\\\\n \\\\\\\"_sync_origin_device_id\\\\\\\" TEXT,\\\\n \\\\\\\"_sync_revision\\\\\\\" INTEGER,\\\\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 \\\\\\\"principal_id\\\\\\\" TEXT,\\\\n \\\\\\\"principal_kind\\\\\\\" TEXT,\\\\n \\\\\\\"identity_issuer\\\\\\\" TEXT,\\\\n \\\\\\\"identity_subject\\\\\\\" TEXT,\\\\n \\\\\\\"identity_client_id\\\\\\\" TEXT,\\\\n \\\\\\\"tool\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"outcome\\\\\\\" TEXT NOT NULL DEFAULT 'allowed',\\\\n \\\\\\\"error_code\\\\\\\" TEXT,\\\\n \\\\\\\"argument_keys\\\\\\\" JSON,\\\\n \\\\\\\"occurred_at\\\\\\\" TIMESTAMP NOT NULL\\\\n);\\\",\\\"columns\\\":{\\\"_sync_origin_device_id\\\":{\\\"type\\\":\\\"TEXT\\\"},\\\"_sync_revision\\\":{\\\"type\\\":\\\"INTEGER\\\"},\\\"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},\\\"principal_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"principal_kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"identity_issuer\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"identity_subject\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"identity_client_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"tool\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"outcome\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"allowed\\\"},\\\"error_code\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"argument_keys\\\":{\\\"type\\\":\\\"JSON\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"occurred_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"smrt_mcp_call_audits_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true,\\\"nullsNotDistinct\\\":true},{\\\"name\\\":\\\"smrt_mcp_call_audits_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]}],\\\"version\\\":\\\"e0a722bb\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-app-mcp/audit-store\\\"}},\\\"moduleType\\\":\\\"smrt\\\",\\\"smrtDependencies\\\":[\\\"@happyvertical/smrt-core\\\",\\\"@happyvertical/smrt-jobs\\\",\\\"@happyvertical/smrt-tenancy\\\"],\\\"stampsConstructors\\\":true}\"));\n","// Self-register this package's manifest for consumers that import via this\n// subpath without the main entry (smrt#1132).\nimport './__smrt-register__.js';\n\nimport {\n field,\n SmrtCollection,\n SmrtObject,\n smrt,\n} from '@happyvertical/smrt-core';\nimport {\n TenantScoped,\n tenantId,\n withSystemContext,\n withTenant,\n} from '@happyvertical/smrt-tenancy';\nimport type {\n McpAuditOutcome,\n McpAuditQuery,\n McpAuditRecord,\n McpAuditSink,\n} from './audit.js';\n\n/**\n * One persisted MCP tool call. Stores identity, tool, tenant, outcome and\n * argument KEY names only: never argument values or response bodies.\n */\n@smrt({\n tableName: 'smrt_mcp_call_audits',\n // Audit rows are read through `McpCallAuditCollection.listAudits`, which\n // requires an explicit tenant; no generated read surface (fail closed).\n api: false,\n mcp: false,\n cli: false,\n})\n@TenantScoped({ mode: 'optional' })\nexport class McpCallAudit extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-app-mcp\";\n /** The tenant the call ran for; `null` for a global/anonymous call. */\n @tenantId({ nullable: true })\n tenantId: string | null | undefined = undefined;\n\n /** The principal id (credential id); `null` for an anonymous call. */\n @field({ type: 'text', nullable: true })\n principalId: string | null = null;\n\n /** The principal kind (agent, owner, user, ...); `null` when unknown. */\n @field({ type: 'text', nullable: true })\n principalKind: string | null = null;\n\n @field({ type: 'text', nullable: true })\n identityIssuer: string | null = null;\n\n @field({ type: 'text', nullable: true })\n identitySubject: string | null = null;\n\n @field({ type: 'text', nullable: true })\n identityClientId: string | null = null;\n\n /**\n * The tool the call named. Required for identity: the record exists to say\n * which tool ran, and `listAudits` looks rows up by it.\n */\n @field({ type: 'text', required: true, requiredFor: 'identity', default: '' })\n tool = '';\n\n @field({ type: 'text', required: true, default: 'allowed' })\n outcome: McpAuditOutcome = 'allowed';\n\n @field({ type: 'text', nullable: true })\n errorCode: string | null = null;\n\n @field({ type: 'json' })\n argumentKeys: string[] = [];\n\n @field({ type: 'datetime', required: true })\n occurredAt: Date = new Date();\n}\n\nconst DEFAULT_LIMIT = 100;\nconst MAX_LIMIT = 500;\n\n/** Tenant-aware persistence and queries for {@link McpCallAudit}. */\nexport class McpCallAuditCollection extends SmrtCollection<McpCallAudit> {\n static readonly _itemClass = McpCallAudit;\n\n /** Persist one record under its own tenant (or the global scope). */\n async append(record: McpAuditRecord): Promise<McpCallAudit> {\n const write = () =>\n this.create({\n tenantId: record.tenantId,\n principalId: record.principalId,\n principalKind: record.principalKind,\n identityIssuer: record.identityIssuer ?? null,\n identitySubject: record.identitySubject ?? null,\n identityClientId: record.identityClientId ?? null,\n tool: record.tool,\n outcome: record.outcome,\n errorCode: record.errorCode ?? null,\n argumentKeys: [...record.argumentKeys],\n occurredAt: record.occurredAt,\n });\n return record.tenantId\n ? withTenant({ tenantId: record.tenantId }, write)\n : withSystemContext(write);\n }\n\n /**\n * Newest-first records for one tenant, optionally narrowed by principal,\n * tool or outcome. `tenantId` is mandatory: `null` lists global rows.\n */\n async listAudits(query: McpAuditQuery & { tenantId: string | null }) {\n if (query.tenantId === undefined) {\n throw new TypeError('listAudits requires an explicit tenantId.');\n }\n const limit = Math.min(\n Math.max(Math.trunc(query.limit ?? DEFAULT_LIMIT), 1),\n MAX_LIMIT,\n );\n const where: Record<string, unknown> = { tenantId: query.tenantId };\n if (query.principalId !== undefined) where.principalId = query.principalId;\n if (query.tool !== undefined) where.tool = query.tool;\n if (query.outcome !== undefined) where.outcome = query.outcome;\n const read = () => this.list({ where, orderBy: 'occurred_at DESC', limit });\n const rows = query.tenantId\n ? await withTenant({ tenantId: query.tenantId }, read)\n : await withSystemContext(read);\n return rows.map((row): McpAuditRecord & { id: string } => ({\n id: String(row.id),\n principalId: row.principalId ?? null,\n principalKind: row.principalKind ?? null,\n tool: row.tool,\n tenantId: row.tenantId ?? null,\n outcome: row.outcome,\n ...(row.errorCode ? { errorCode: row.errorCode } : {}),\n ...(row.identityIssuer ? { identityIssuer: row.identityIssuer } : {}),\n ...(row.identitySubject ? { identitySubject: row.identitySubject } : {}),\n ...(row.identityClientId\n ? { identityClientId: row.identityClientId }\n : {}),\n argumentKeys: Array.isArray(row.argumentKeys) ? row.argumentKeys : [],\n occurredAt: new Date(row.occurredAt),\n }));\n }\n}\n\n/** Options for {@link createSmrtMcpAuditStore}. */\nexport interface SmrtMcpAuditStoreOptions {\n /** SMRT options bag (`{ db }`), the same one `smrtOptions` supplies. */\n smrtOptions: () => Record<string, unknown>;\n}\n\n/**\n * The default persistent audit sink: a SMRT-model-backed, tenant-aware store.\n * Pass it as `auditSink` and read it back with `list`.\n */\nexport function createSmrtMcpAuditStore(\n options: SmrtMcpAuditStoreOptions,\n): McpAuditSink & {\n list(\n query: McpAuditQuery & { tenantId: string | null },\n ): ReturnType<McpCallAuditCollection['listAudits']>;\n} {\n // Resolved per operation: `smrtOptions()` may return request-scoped state\n // (e.g. a transaction-bound db under RLS) that must not outlive its request.\n const get = () =>\n McpCallAuditCollection.create(\n options.smrtOptions() as never,\n ) as Promise<McpCallAuditCollection>;\n return {\n async record(record) {\n await (await get()).append(record);\n },\n async list(query) {\n return (await get()).listAudits(query);\n },\n };\n}\n"],"mappings":"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"}
|
package/dist/manifest.json
CHANGED
package/dist/smrt-knowledge.json
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"sensitiveFieldsExcluded": true,
|
|
4
4
|
"generatedAt": "1970-01-01T00:00:00.000Z",
|
|
5
5
|
"packageName": "@happyvertical/smrt-app-mcp",
|
|
6
|
-
"packageVersion": "0.
|
|
6
|
+
"packageVersion": "0.66.0",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
10
|
+
"manifest": "e901176b71121a56ee89f8c23667c578385b95f3a87b2e86f08a2c91ed5156e0",
|
|
11
|
+
"packageJson": "f4184040afcb5bb1976dde3fb01ede7bc6d4bbcc3d14ae7bf60b7e6410d616e3",
|
|
12
12
|
"agents": "d01bdc60d67fd53faaea38d54f2c0fc6b4f1fa225240150d55425faaafe2ac3f",
|
|
13
13
|
"moduleDoc:agents/runtime-loading.md": "4fe25501e5066a0b0f8c26409ce419029965ccad26f2c6e976070f85145900b4"
|
|
14
14
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-app-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.66.0",
|
|
4
4
|
"description": "App-runtime MCP server scaffolding for SMRT apps — `createMcpAppServer` plus transport adapters (SvelteKit today) for exposing a SMRT app's MCP surface over HTTP.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -58,10 +58,10 @@
|
|
|
58
58
|
],
|
|
59
59
|
"author": "HappyVertical",
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@happyvertical/smrt-core": "0.
|
|
62
|
-
"@happyvertical/smrt-jobs": "0.
|
|
63
|
-
"@happyvertical/smrt-tenancy": "0.
|
|
64
|
-
"@happyvertical/sql": "^0.
|
|
61
|
+
"@happyvertical/smrt-core": "0.66.0",
|
|
62
|
+
"@happyvertical/smrt-jobs": "0.66.0",
|
|
63
|
+
"@happyvertical/smrt-tenancy": "0.66.0",
|
|
64
|
+
"@happyvertical/sql": "^0.116.6",
|
|
65
65
|
"@modelcontextprotocol/server": "2.4.0",
|
|
66
66
|
"jose": "^6.2.12",
|
|
67
67
|
"parse5": "8.0.1"
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@modelcontextprotocol/client": "2.4.0",
|
|
71
71
|
"@modelcontextprotocol/conformance": "0.2.0-alpha.11",
|
|
72
72
|
"@modelcontextprotocol/node": "2.1.2",
|
|
73
|
-
"@happyvertical/smrt-vitest": "0.
|
|
73
|
+
"@happyvertical/smrt-vitest": "0.66.0",
|
|
74
74
|
"@types/node": "24.13.6",
|
|
75
75
|
"typescript": "6.0.3",
|
|
76
76
|
"vite": "8.1.6",
|