@fayz-ai/core 0.66.0 → 0.67.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist/{chunk-OYE4ATKB.js → chunk-EG6IXJNY.js} +3 -3
  2. package/dist/{chunk-OYE4ATKB.js.map → chunk-EG6IXJNY.js.map} +1 -1
  3. package/dist/{chunk-HLQTDBV2.js → chunk-JGRPFH56.js} +7 -5
  4. package/dist/chunk-JGRPFH56.js.map +1 -0
  5. package/dist/{chunk-QBJIBL4J.js → chunk-K2P64WBC.js} +3 -3
  6. package/dist/{chunk-QBJIBL4J.js.map → chunk-K2P64WBC.js.map} +1 -1
  7. package/dist/{chunk-6Q5BVKW3.js → chunk-MU2SFXGA.js} +4 -4
  8. package/dist/{chunk-6Q5BVKW3.js.map → chunk-MU2SFXGA.js.map} +1 -1
  9. package/dist/{chunk-VFQMXAZ6.js → chunk-RO7HJJUV.js} +4 -4
  10. package/dist/{chunk-VFQMXAZ6.js.map → chunk-RO7HJJUV.js.map} +1 -1
  11. package/dist/{chunk-QIKUNNMW.js → chunk-TA3Y6ZLC.js} +4 -4
  12. package/dist/{chunk-QIKUNNMW.js.map → chunk-TA3Y6ZLC.js.map} +1 -1
  13. package/dist/{chunk-SFU34NWN.js → chunk-YHSRDP6M.js} +3 -3
  14. package/dist/{chunk-SFU34NWN.js.map → chunk-YHSRDP6M.js.map} +1 -1
  15. package/dist/data/index.js +4 -4
  16. package/dist/i18n/index.js +1 -1
  17. package/dist/i18n/shell-translations.en.d.ts.map +1 -1
  18. package/dist/i18n/shell-translations.pt-br.d.ts.map +1 -1
  19. package/dist/index.js +12 -12
  20. package/dist/integrations/index.js +4 -4
  21. package/dist/plugin/index.js +3 -3
  22. package/dist/{shell-translations.pt-br-UHWZOGGK.js → shell-translations.pt-br-TGSKN57Z.js} +4 -2
  23. package/dist/shell-translations.pt-br-TGSKN57Z.js.map +1 -0
  24. package/dist/testing/index.js +5 -5
  25. package/package.json +1 -1
  26. package/dist/chunk-HLQTDBV2.js.map +0 -1
  27. package/dist/shell-translations.pt-br-UHWZOGGK.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { isConnectorCategory, CONNECTOR_CATEGORIES, requestPlaneSpec, connectorPlanes, invocationPlane, connectorSubscribes, permissionActions, isEventPermission, connectorEntities, connectorSubscribesTo } from './chunk-QIKUNNMW.js';
2
- import { errorMessage } from './chunk-OYE4ATKB.js';
1
+ import { isConnectorCategory, CONNECTOR_CATEGORIES, requestPlaneSpec, connectorPlanes, invocationPlane, connectorSubscribes, permissionActions, isEventPermission, connectorEntities, connectorSubscribesTo } from './chunk-TA3Y6ZLC.js';
2
+ import { errorMessage } from './chunk-EG6IXJNY.js';
3
3
 
4
4
  // src/testing.ts
5
5
  var PluginContractError = class extends Error {
@@ -290,5 +290,5 @@ function assertConnectorContract(connector) {
290
290
  }
291
291
 
292
292
  export { PluginContractError, assertConnectorContract, assertPluginManifestContract, bespokeConnectorTables };
293
- //# sourceMappingURL=chunk-6Q5BVKW3.js.map
294
- //# sourceMappingURL=chunk-6Q5BVKW3.js.map
293
+ //# sourceMappingURL=chunk-MU2SFXGA.js.map
294
+ //# sourceMappingURL=chunk-MU2SFXGA.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/testing.ts"],"names":[],"mappings":";;;;AA2BO,IAAM,mBAAA,GAAN,cAAkC,KAAA,CAAM;AAAA,EAC7C,YAAY,OAAA,EAAiB;AAC3B,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,qBAAA;AAAA,EACd;AACF;AAEA,SAAS,IAAA,CAAK,OAAe,GAAA,EAAoB;AAC/C,EAAA,MAAM,IAAI,mBAAA,CAAoB,CAAA,CAAA,EAAI,KAAK,CAAA,EAAA,EAAK,GAAG,CAAA,CAAE,CAAA;AACnD;AAEA,SAAS,eAAe,CAAA,EAAyB;AAC/C,EAAA,OAAO,OAAO,CAAA,KAA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B,CAAC,CAAA,4BAAA,CAA8B,CAAA;AAC1H,IAAA,KAAA,MAAW,IAAA,IAAQ,IAAI,QAAA,EAAU;AAC/B,MAAA,IAAI,CAAC,QAAA,CAAS,GAAA,CAAI,IAAI,CAAA,EAAG,IAAA,CAAK,KAAA,EAAO,CAAA,aAAA,EAAgB,CAAC,CAAA,uBAAA,EAA0B,IAAI,CAAA,CAAA,CAAG,CAAA;AAAA,IACzF;AAAA,EACF;AACF","file":"chunk-6Q5BVKW3.js","sourcesContent":["// ---------------------------------------------------------------------------\n// Plugin contract assertions — the integrity half of the deploy gate.\n// ---------------------------------------------------------------------------\n// Framework-agnostic runtime checks (no test-runner dependency) that any\n// plugin's *.test.ts calls to prove its manifest/connector conform to the\n// platform contract BEFORE it can ship. A plugin that fails these would break\n// the host app at mount time (missing route component, duplicate ids, malformed\n// settings tab). Pair with a capability test (does the plugin do its job?) — see\n// docs/plugins/PLUGIN-PATTERNS.md → capability anatomy. These throw on the first violation.\nimport { errorMessage } from './lib/error-message'\nimport type { PluginManifest } from './types/plugins'\nimport type { Connector } from './integrations'\nimport {\n CONNECTOR_CATEGORIES,\n connectorEntities,\n connectorPlanes,\n connectorSubscribes,\n connectorSubscribesTo,\n grants,\n invocationPlane,\n isConnectorCategory,\n isEventPermission,\n permissionActions,\n requestPlaneSpec,\n} from './integrations'\nimport type { ConnectorPermission } from './integrations'\n\nexport class PluginContractError extends Error {\n constructor(message: string) {\n super(message)\n this.name = 'PluginContractError'\n }\n}\n\nfunction fail(scope: string, msg: string): never {\n throw new PluginContractError(`[${scope}] ${msg}`)\n}\n\nfunction nonEmptyString(v: unknown): v is string {\n return typeof v === 'string' && v.trim().length > 0\n}\n\n/**\n * Assert a PluginManifest is structurally sound enough to mount safely.\n * Checks identity, navigation/route wiring, settings tabs, declared features,\n * and id uniqueness. Throws PluginContractError on the first problem.\n */\n/**\n * A function component, or one of React's component objects — `React.lazy`,\n * `memo`, `forwardRef` — which are objects tagged with `$$typeof`. A page that\n * loads with its route is a `React.lazy`, and it is as much a component as the\n * function it resolves to.\n */\nfunction isComponentType(value: unknown): boolean {\n if (typeof value === 'function') return true\n return typeof value === 'object' && value !== null && '$$typeof' in value\n}\n\nexport function assertPluginManifestContract(manifest: PluginManifest): void {\n const id = manifest?.id\n const scope = nonEmptyString(id) ? id : '<unknown plugin>'\n\n for (const field of ['id', 'name', 'icon', 'version'] as const) {\n if (!nonEmptyString(manifest?.[field])) fail(scope, `manifest.${field} must be a non-empty string`)\n }\n\n if (!Array.isArray(manifest.navigation)) fail(scope, 'manifest.navigation must be an array (use [] for settings-only plugins)')\n if (!Array.isArray(manifest.routes)) fail(scope, 'manifest.routes must be an array (use [] for settings-only plugins)')\n\n // Every nav entry must point at a route; every route needs a path + component.\n for (const [i, nav] of manifest.navigation.entries()) {\n if (!nonEmptyString((nav as any)?.route)) fail(scope, `navigation[${i}].route must be a non-empty string`)\n }\n const routePaths = new Set<string>()\n for (const [i, route] of manifest.routes.entries()) {\n if (!nonEmptyString((route as any)?.path)) fail(scope, `routes[${i}].path must be a non-empty string`)\n if (!isComponentType((route as any)?.component)) fail(scope, `routes[${i}].component must be a component`)\n if (routePaths.has((route as any).path)) fail(scope, `duplicate route path \"${(route as any).path}\"`)\n routePaths.add((route as any).path)\n }\n // A nav entry that links to a route the plugin doesn't declare is dead UI.\n for (const [i, nav] of manifest.navigation.entries()) {\n const r = (nav as any).route\n if (routePaths.size > 0 && !routePaths.has(r)) {\n fail(scope, `navigation[${i}].route \"${r}\" has no matching route in manifest.routes`)\n }\n }\n\n // Settings tabs (the only UI surface integrations need) must be renderable.\n const settingIds = new Set<string>()\n for (const [i, tab] of (manifest.settings ?? []).entries()) {\n if (!nonEmptyString((tab as any)?.id)) fail(scope, `settings[${i}].id must be a non-empty string`)\n if (!nonEmptyString((tab as any)?.label)) fail(scope, `settings[${i}].label must be a non-empty string`)\n if (!isComponentType((tab as any)?.component)) fail(scope, `settings[${i}].component must be a component`)\n if (settingIds.has((tab as any).id)) fail(scope, `duplicate settings tab id \"${(tab as any).id}\"`)\n settingIds.add((tab as any).id)\n }\n\n for (const [i, feat] of (manifest.declaredFeatures ?? []).entries()) {\n if (!nonEmptyString((feat as any)?.id)) fail(scope, `declaredFeatures[${i}].id must be a non-empty string`)\n }\n\n for (const [i, src] of (manifest.emitsFrom ?? []).entries()) {\n if (!nonEmptyString(src?.table)) fail(scope, `emitsFrom[${i}].table must be a non-empty string`)\n if (!nonEmptyString(src?.entityKey)) fail(scope, `emitsFrom[${i}].entityKey must be a non-empty string`)\n for (const action of src.actions ?? []) {\n if (!EVENT_ACTIONS.has(action)) fail(scope, `emitsFrom[${i}] has unknown action \"${action}\"`)\n }\n }\n\n const functionSlugs = new Set<string>()\n for (const [i, fn] of (manifest.functions ?? []).entries()) {\n if (!SLUG.test(fn?.slug ?? '')) fail(scope, `functions[${i}].slug must be kebab-case — it becomes the deployed function name`)\n if (functionSlugs.has(fn.slug)) fail(scope, `duplicate function slug \"${fn.slug}\"`)\n functionSlugs.add(fn.slug)\n if (typeof fn.verifyJwt !== 'boolean') fail(scope, `functions[${i}].verifyJwt must be a boolean`)\n if (!FUNCTION_INGRESS.has(fn.ingress)) fail(scope, `functions[${i}].ingress \"${fn.ingress}\" is not one of ${[...FUNCTION_INGRESS].join(', ')}`)\n // The ingress authenticates by signature, not by a caller JWT it does not have.\n if (fn.ingress === 'fayz' && fn.verifyJwt) fail(scope, `functions[${i}] is reached through the Fayz ingress, so verifyJwt must be false`)\n for (const secret of fn.secrets ?? []) {\n // A name, never a value — this is the shape that keeps a key out of git.\n if (!SECRET_NAME.test(secret)) fail(scope, `functions[${i}].secrets must name secrets (SCREAMING_SNAKE_CASE), never carry their values`)\n }\n }\n\n for (const [i, def] of (manifest.connectors ?? []).entries()) {\n // An unlisted category renders NO badge rather than a wrong one, so the\n // mistake is invisible in a screenshot. Caught here instead.\n if (def.category !== undefined && !isConnectorCategory(def.category)) {\n fail(\n scope,\n `connectors[${i}].category \"${def.category}\" is not a catalogue category — ` +\n `use one of ${CONNECTOR_CATEGORIES.join(', ')}, taken from the catalogue row with this connector's slug.`,\n )\n }\n for (const pattern of def.subscribesTo ?? []) {\n if (!nonEmptyString(pattern)) fail(scope, `connectors[${i}].subscribesTo must hold non-empty patterns`)\n // Only a trailing star is honoured; see eventKeyMatches.\n if (pattern.includes('*') && !pattern.endsWith('*')) {\n fail(scope, `connectors[${i}].subscribesTo \"${pattern}\" — \"*\" is only honoured at the end`)\n }\n }\n\n assertConnectorPermissions(scope, `connectors[${i}]`, def)\n // The request plane's two fields are required THERE and meaningless\n // elsewhere. Checked at the manifest so a connector cannot reach a buyer\n // with an undeclared budget — the failure would otherwise be a spinner.\n if ((def.planes ?? []).includes('request')) {\n try {\n requestPlaneSpec(def)\n } catch (error) {\n fail(scope, `connectors[${i}] ${errorMessage(error)}`)\n }\n } else if (def.latencyBudgetMs !== undefined || def.onFailure !== undefined) {\n fail(\n scope,\n `connectors[${i}] declares latencyBudgetMs/onFailure but is not on the request plane — ` +\n `nothing enforces them, so they read as a guarantee that does not exist.`,\n )\n }\n // Authorization vs configuration. Both declarations end up on the same row,\n // and a key in both is a value with two owners: the connect form would write\n // it and the settings form would overwrite it.\n const fieldKeys = new Set((def.fields ?? []).map((f) => f.key))\n const settingKeys = new Set<string>()\n for (const [j, setting] of (def.settings ?? []).entries()) {\n const at = `connectors[${i}].settings[${j}]`\n if (!nonEmptyString(setting?.key)) fail(scope, `${at}.key must be a non-empty string`)\n if (!nonEmptyString(setting?.label)) fail(scope, `${at}.label must be a non-empty string`)\n if (!SETTING_TYPES.has(setting.type)) {\n fail(scope, `${at}.type \"${setting.type}\" is not one of ${[...SETTING_TYPES].join(', ')}`)\n }\n if (settingKeys.has(setting.key)) fail(scope, `${at} duplicates settings key \"${setting.key}\"`)\n settingKeys.add(setting.key)\n if (fieldKeys.has(setting.key)) {\n fail(\n scope,\n `${at}.key \"${setting.key}\" is also a credential field — a key either authorizes the ` +\n `connection (fields) or configures it (settings), never both.`,\n )\n }\n if (setting.type === 'select' || setting.type === 'multi-select') {\n if (!Array.isArray(setting.options) || setting.options.length === 0) {\n fail(scope, `${at} is a ${setting.type} and must declare options — that is what replaces a free-text box`)\n }\n for (const [k, option] of setting.options.entries()) {\n if (!nonEmptyString(option?.value)) fail(scope, `${at}.options[${k}].value must be a non-empty string`)\n if (!nonEmptyString(option?.label)) fail(scope, `${at}.options[${k}].label must be a non-empty string`)\n }\n }\n if (setting.pattern !== undefined) {\n if (setting.type !== 'text') fail(scope, `${at}.pattern only applies to a text setting`)\n try {\n new RegExp(setting.pattern)\n } catch {\n fail(scope, `${at}.pattern is not a valid regular expression`)\n }\n // A refusal with no sentence is a form that says no and not why.\n if (!nonEmptyString(setting.patternHint)) fail(scope, `${at} declares a pattern, so it must declare patternHint`)\n }\n }\n // Declared settings nobody can read or write are a screen that renders empty.\n if (settingKeys.size > 0) {\n if (typeof def.getSettings !== 'function') fail(scope, `connectors[${i}] declares settings but no getSettings()`)\n if (typeof def.saveSettings !== 'function') fail(scope, `connectors[${i}] declares settings but no saveSettings()`)\n }\n\n // \"Acionado em quais momentos\" — a moment on a plane the connector does not\n // have is a promise the code cannot keep.\n const planes = new Set(connectorPlanes(def))\n const momentKeys = new Set<string>()\n for (const [j, moment] of (def.invokedAt ?? []).entries()) {\n const at = `connectors[${i}].invokedAt[${j}]`\n if (!nonEmptyString(moment?.key)) fail(scope, `${at}.key must be a non-empty string`)\n if (!nonEmptyString(moment?.label)) fail(scope, `${at}.label must be a non-empty string`)\n if (momentKeys.has(moment.key)) fail(scope, `${at} duplicates key \"${moment.key}\"`)\n momentKeys.add(moment.key)\n const plane = invocationPlane(moment)\n if (!planes.has(plane)) {\n fail(scope, `${at} is declared on the ${plane} plane, which connectors[${i}].planes does not include`)\n }\n if (moment.trigger !== undefined) {\n if (plane !== 'sync') fail(scope, `${at}.trigger only applies to a sync moment`)\n if (!TRIGGERS.has(moment.trigger)) fail(scope, `${at} has unknown trigger \"${moment.trigger}\"`)\n }\n // A moment that reaches something the connector never asked for is the\n // screen answering \"quando ele age\" with access nobody consented to.\n const declared = new Set((def.permissions ?? []).map((p) => p.resource))\n for (const resource of moment.touches ?? []) {\n if (!declared.has(resource)) {\n fail(\n scope,\n `${at}.touches names \"${resource}\", which connectors[${i}].permissions does not declare — ` +\n `a call site cannot reach what the consent view never showed.`,\n )\n }\n }\n }\n\n for (const [j, auto] of (def.managedAutomations ?? []).entries()) {\n if (!nonEmptyString(auto?.eventKey)) fail(scope, `connectors[${i}].managedAutomations[${j}].eventKey must be a non-empty string`)\n if (!nonEmptyString(auto?.label)) fail(scope, `connectors[${i}].managedAutomations[${j}].label must be a non-empty string`)\n // The screen would promise a reaction the ingress never delivers.\n if (!connectorSubscribes(def, auto.eventKey)) {\n fail(scope, `connectors[${i}].managedAutomations[${j}] fires on \"${auto.eventKey}\", which no subscribesTo pattern covers`)\n }\n }\n }\n\n // A connector brings a ConnectorDefinition, not a pair of tables.\n for (const [i, mig] of (manifest.migrations ?? []).entries()) {\n for (const table of bespokeConnectorTables(mig?.sql)) {\n fail(\n scope,\n `migrations[${i}] (\"${mig?.id ?? '?'}\") creates public.${table} — a connector's own ` +\n `*_integrations / *_sync_log table. Store the connection in connections / ` +\n `sync_runs via createConnectionStore('<connector-id>'): two accounts are two ` +\n `rows separated by instance_key, and connector-specific counters go in stats.`,\n )\n }\n }\n\n // A plugin that contributes nothing mountable is almost always a mistake.\n // (Connector-only addon plugins contribute via `connectors` instead.)\n if (\n manifest.navigation.length === 0 &&\n manifest.routes.length === 0 &&\n (manifest.settings ?? []).length === 0 &&\n (manifest.connectors ?? []).length === 0\n ) {\n fail(scope, 'plugin contributes no navigation, routes, settings, or connectors — it would mount but do nothing')\n }\n}\n\n/**\n * What a connector says it needs — and the four ways that declaration can\n * contradict the ones that already existed.\n *\n * The feature this guards is a consent view. Its whole value is that the list it\n * shows is the list, so every way of ending up with two lists is refused here:\n *\n * 1. an action that does not exist for the resource kind (`listen` on a\n * record type, `write` on an event) — a word the reader would have to guess at;\n * 2. a `data` permission naming a resource the legacy `entities` never listed,\n * or an entity with no permission — the \"writes to an entity it never\n * listed\" case, in both directions;\n * 3. a `listen` permission the legacy `subscribesTo` does not name, or a\n * `subscribesTo` pattern no permission explains — the connector would be\n * delivered facts the consent view never showed, or shown facts the ingress\n * filters out;\n * 4. two permissions for the same resource — two rows, two reasons, and no\n * answer to which one the tenant agreed to.\n *\n * Rules 2 and 3 only bite when BOTH declarations are present. A connector built\n * against an older core declares only the legacy fields and is unaffected; a\n * connector written today declares only `permissions` and both are derived from\n * it. What is refused is saying both things and saying them differently.\n */\nfunction assertConnectorPermissions(\n scope: string,\n path: string,\n def: { permissions?: ConnectorPermission[]; entities?: string[]; subscribesTo?: string[] },\n): void {\n const permissions = def.permissions\n if (permissions === undefined) return\n if (!Array.isArray(permissions)) fail(scope, `${path}.permissions must be an array`)\n\n const seen = new Set<string>()\n for (const [j, permission] of permissions.entries()) {\n const at = `${path}.permissions[${j}]`\n if (permission?.kind !== 'data' && permission?.kind !== 'event') {\n fail(scope, `${at}.kind must be \"data\" or \"event\"`)\n }\n if (!nonEmptyString(permission.resource)) fail(scope, `${at}.resource must be a non-empty string`)\n // The reason is the only part a tenant can actually judge; a blank one turns\n // the screen back into the schema dump it exists to replace.\n if (!nonEmptyString(permission.reason)) {\n fail(scope, `${at} must declare a reason — the sentence the tenant judges before authorizing`)\n }\n if (!Array.isArray(permission.actions) || permission.actions.length === 0) {\n fail(scope, `${at}.actions must name at least one action — a resource with no access is not a permission`)\n }\n const legal = permissionActions(permission.kind)\n for (const action of permission.actions) {\n if (!legal.includes(action)) {\n fail(scope, `${at} asks for \"${action}\" on the ${permission.kind} resource \"${permission.resource}\", which only admits ${legal.join(', ')}`)\n }\n }\n if (isEventPermission(permission) && permission.resource.includes('*') && !permission.resource.endsWith('*')) {\n fail(scope, `${at}.resource \"${permission.resource}\" — \"*\" is only honoured at the end`)\n }\n const key = `${permission.kind}:${permission.resource}`\n if (seen.has(key)) fail(scope, `${at} repeats \"${key}\" — one resource, one row, one reason`)\n seen.add(key)\n }\n\n // (2) data permissions ↔ the legacy entities list.\n if (def.entities !== undefined) {\n const declared = new Set(connectorEntities({ permissions }))\n const legacy = new Set(def.entities)\n for (const entity of declared) {\n if (!legacy.has(entity)) {\n fail(\n scope,\n `${path}.permissions reaches \"${entity}\", which ${path}.entities does not list — ` +\n `the two describe the same access and must name the same set (drop entities; it is derived).`,\n )\n }\n }\n for (const entity of legacy) {\n if (!declared.has(entity)) {\n fail(\n scope,\n `${path}.entities lists \"${entity}\" with no permission saying what it does with it — ` +\n `a record type on the consent view with no read/write is a name, not a declaration.`,\n )\n }\n }\n }\n\n // (3) listen permissions ↔ the legacy subscribesTo list.\n if (def.subscribesTo !== undefined) {\n const declared = new Set(connectorSubscribesTo({ permissions }))\n const legacy = new Set(def.subscribesTo)\n for (const pattern of declared) {\n if (!legacy.has(pattern)) {\n fail(\n scope,\n `${path}.permissions listens to \"${pattern}\", which ${path}.subscribesTo does not — ` +\n `the ingress filters on that list, so the consent view would promise a fact never delivered.`,\n )\n }\n }\n for (const pattern of legacy) {\n if (!declared.has(pattern)) {\n fail(\n scope,\n `${path}.subscribesTo asks for \"${pattern}\" with no listen permission explaining it — ` +\n `the connector would receive a fact the tenant was never shown.`,\n )\n }\n }\n }\n}\n\n/**\n * `CREATE TABLE [IF NOT EXISTS] [schema.]name` where name ends in `_integrations`\n * or `_sync_log` — the pair four connectors each reinvented before\n * `connections` / `sync_runs` existed (FAY-1376). Neither generic table\n * matches, so a connector that stores its connection in them creates nothing.\n *\n * Deliberately duplicated in scripts/check-connector-tables.mjs, which scans the\n * .sql files themselves: that runs in the `contracts` CI job with no install and\n * no build, so it cannot import this. This half catches SQL declared inline on a\n * manifest, which no .sql walk would see. The two are held in agreement by one\n * case table, asserted from both sides — see\n * packages/core/test/integrations/connector-tables.test.ts.\n */\nconst BESPOKE_CONNECTOR_TABLE =\n /\\bcreate\\s+table\\s+(?:if\\s+not\\s+exists\\s+)?(?:[a-z0-9_]+\\s*\\.\\s*)?([a-z0-9_]*(?:_integrations|_sync_log))\\b/gi\n\n/** Table names a CREATE TABLE in this SQL would bring back. Empty = conformant. */\nexport function bespokeConnectorTables(sql: unknown): string[] {\n const text = typeof sql === 'string' ? sql.replace(/\"/g, '') : ''\n const found = new Set<string>()\n for (const m of text.matchAll(BESPOKE_CONNECTOR_TABLE)) found.add(m[1].toLowerCase())\n return [...found]\n}\n\nconst EVENT_ACTIONS = new Set(['created', 'updated', 'deleted'])\nconst FUNCTION_INGRESS = new Set(['fayz', 'none'])\nconst SLUG = /^[a-z0-9][a-z0-9-]*$/\nconst SECRET_NAME = /^[A-Z][A-Z0-9_]*$/\n\nconst SETTING_TYPES = new Set(['text', 'select', 'multi-select', 'toggle'])\nconst AUTH_KINDS = new Set(['oauth', 'api-key', 'mtls'])\nconst DIRECTIONS = new Set(['inbound', 'outbound', 'bidirectional'])\nconst TRIGGERS = new Set(['on-write', 'scheduled', 'manual', 'webhook'])\n\n/**\n * Assert an integration Connector descriptor is well-formed: identity present,\n * a known auth kind, and at least one capability with a valid direction +\n * trigger set. This is the contract a connector must satisfy BEFORE its\n * data-plane (edge function) exists — the TDD anchor for an integration.\n */\nexport function assertConnectorContract(connector: Connector): void {\n const scope = nonEmptyString(connector?.id) ? `connector:${connector.id}` : '<unknown connector>'\n for (const field of ['id', 'provider', 'pluginId'] as const) {\n if (!nonEmptyString(connector?.[field])) fail(scope, `connector.${field} must be a non-empty string`)\n }\n if (!AUTH_KINDS.has(connector.authKind)) fail(scope, `connector.authKind \"${connector.authKind}\" is not one of ${[...AUTH_KINDS].join(', ')}`)\n if (!Array.isArray(connector.capabilities) || connector.capabilities.length === 0) {\n fail(scope, 'connector.capabilities must list at least one capability')\n }\n for (const [i, cap] of connector.capabilities.entries()) {\n if (!nonEmptyString(cap?.entity)) fail(scope, `capabilities[${i}].entity must be a non-empty string`)\n if (!DIRECTIONS.has(cap.direction)) fail(scope, `capabilities[${i}].direction \"${cap.direction}\" is invalid`)\n if (!Array.isArray(cap.triggers) || cap.triggers.length === 0) fail(scope, `capabilities[${i}].triggers must be non-empty`)\n for (const trig of cap.triggers) {\n if (!TRIGGERS.has(trig)) fail(scope, `capabilities[${i}] has unknown trigger \"${trig}\"`)\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/testing.ts"],"names":[],"mappings":";;;;AA2BO,IAAM,mBAAA,GAAN,cAAkC,KAAA,CAAM;AAAA,EAC7C,YAAY,OAAA,EAAiB;AAC3B,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,qBAAA;AAAA,EACd;AACF;AAEA,SAAS,IAAA,CAAK,OAAe,GAAA,EAAoB;AAC/C,EAAA,MAAM,IAAI,mBAAA,CAAoB,CAAA,CAAA,EAAI,KAAK,CAAA,EAAA,EAAK,GAAG,CAAA,CAAE,CAAA;AACnD;AAEA,SAAS,eAAe,CAAA,EAAyB;AAC/C,EAAA,OAAO,OAAO,CAAA,KAAM,QAAA,IAAY,CAAA,CAAE,IAAA,GAAO,MAAA,GAAS,CAAA;AACpD;AAaA,SAAS,gBAAgB,KAAA,EAAyB;AAChD,EAAA,IAAI,OAAO,KAAA,KAAU,UAAA,EAAY,OAAO,IAAA;AACxC,EAAA,OAAO,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,KAAU,QAAQ,UAAA,IAAc,KAAA;AACtE;AAEO,SAAS,6BAA6B,QAAA,EAAgC;AAC3E,EAAA,MAAM,KAAK,QAAA,EAAU,EAAA;AACrB,EAAA,MAAM,KAAA,GAAQ,cAAA,CAAe,EAAE,CAAA,GAAI,EAAA,GAAK,kBAAA;AAExC,EAAA,KAAA,MAAW,SAAS,CAAC,IAAA,EAAM,MAAA,EAAQ,MAAA,EAAQ,SAAS,CAAA,EAAY;AAC9D,IAAA,IAAI,CAAC,cAAA,CAAe,QAAA,GAAW,KAAK,CAAC,GAAG,IAAA,CAAK,KAAA,EAAO,CAAA,SAAA,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IAAA,IAAA,CAAK,OAAO,0DAA0D,CAAA;AAAA,EACxE;AACA,EAAA,KAAA,MAAW,CAAC,CAAA,EAAG,GAAG,KAAK,SAAA,CAAU,YAAA,CAAa,SAAQ,EAAG;AACvD,IAAA,IAAI,CAAC,eAAe,GAAA,EAAK,MAAM,GAAG,IAAA,CAAK,KAAA,EAAO,CAAA,aAAA,EAAgB,CAAC,CAAA,mCAAA,CAAqC,CAAA;AACpG,IAAA,IAAI,CAAC,UAAA,CAAW,GAAA,CAAI,GAAA,CAAI,SAAS,CAAA,EAAG,IAAA,CAAK,KAAA,EAAO,CAAA,aAAA,EAAgB,CAAC,CAAA,aAAA,EAAgB,GAAA,CAAI,SAAS,CAAA,YAAA,CAAc,CAAA;AAC5G,IAAA,IAAI,CAAC,KAAA,CAAM,OAAA,CAAQ,GAAA,CAAI,QAAQ,CAAA,IAAK,GAAA,CAAI,QAAA,CAAS,MAAA,KAAW,CAAA,EAAG,IAAA,CAAK,KAAA,EAAO,CAAA,aAAA,EAAgB,CAAC,CAAA,4BAAA,CAA8B,CAAA;AAC1H,IAAA,KAAA,MAAW,IAAA,IAAQ,IAAI,QAAA,EAAU;AAC/B,MAAA,IAAI,CAAC,QAAA,CAAS,GAAA,CAAI,IAAI,CAAA,EAAG,IAAA,CAAK,KAAA,EAAO,CAAA,aAAA,EAAgB,CAAC,CAAA,uBAAA,EAA0B,IAAI,CAAA,CAAA,CAAG,CAAA;AAAA,IACzF;AAAA,EACF;AACF","file":"chunk-MU2SFXGA.js","sourcesContent":["// ---------------------------------------------------------------------------\n// Plugin contract assertions — the integrity half of the deploy gate.\n// ---------------------------------------------------------------------------\n// Framework-agnostic runtime checks (no test-runner dependency) that any\n// plugin's *.test.ts calls to prove its manifest/connector conform to the\n// platform contract BEFORE it can ship. A plugin that fails these would break\n// the host app at mount time (missing route component, duplicate ids, malformed\n// settings tab). Pair with a capability test (does the plugin do its job?) — see\n// docs/plugins/PLUGIN-PATTERNS.md → capability anatomy. These throw on the first violation.\nimport { errorMessage } from './lib/error-message'\nimport type { PluginManifest } from './types/plugins'\nimport type { Connector } from './integrations'\nimport {\n CONNECTOR_CATEGORIES,\n connectorEntities,\n connectorPlanes,\n connectorSubscribes,\n connectorSubscribesTo,\n grants,\n invocationPlane,\n isConnectorCategory,\n isEventPermission,\n permissionActions,\n requestPlaneSpec,\n} from './integrations'\nimport type { ConnectorPermission } from './integrations'\n\nexport class PluginContractError extends Error {\n constructor(message: string) {\n super(message)\n this.name = 'PluginContractError'\n }\n}\n\nfunction fail(scope: string, msg: string): never {\n throw new PluginContractError(`[${scope}] ${msg}`)\n}\n\nfunction nonEmptyString(v: unknown): v is string {\n return typeof v === 'string' && v.trim().length > 0\n}\n\n/**\n * Assert a PluginManifest is structurally sound enough to mount safely.\n * Checks identity, navigation/route wiring, settings tabs, declared features,\n * and id uniqueness. Throws PluginContractError on the first problem.\n */\n/**\n * A function component, or one of React's component objects — `React.lazy`,\n * `memo`, `forwardRef` — which are objects tagged with `$$typeof`. A page that\n * loads with its route is a `React.lazy`, and it is as much a component as the\n * function it resolves to.\n */\nfunction isComponentType(value: unknown): boolean {\n if (typeof value === 'function') return true\n return typeof value === 'object' && value !== null && '$$typeof' in value\n}\n\nexport function assertPluginManifestContract(manifest: PluginManifest): void {\n const id = manifest?.id\n const scope = nonEmptyString(id) ? id : '<unknown plugin>'\n\n for (const field of ['id', 'name', 'icon', 'version'] as const) {\n if (!nonEmptyString(manifest?.[field])) fail(scope, `manifest.${field} must be a non-empty string`)\n }\n\n if (!Array.isArray(manifest.navigation)) fail(scope, 'manifest.navigation must be an array (use [] for settings-only plugins)')\n if (!Array.isArray(manifest.routes)) fail(scope, 'manifest.routes must be an array (use [] for settings-only plugins)')\n\n // Every nav entry must point at a route; every route needs a path + component.\n for (const [i, nav] of manifest.navigation.entries()) {\n if (!nonEmptyString((nav as any)?.route)) fail(scope, `navigation[${i}].route must be a non-empty string`)\n }\n const routePaths = new Set<string>()\n for (const [i, route] of manifest.routes.entries()) {\n if (!nonEmptyString((route as any)?.path)) fail(scope, `routes[${i}].path must be a non-empty string`)\n if (!isComponentType((route as any)?.component)) fail(scope, `routes[${i}].component must be a component`)\n if (routePaths.has((route as any).path)) fail(scope, `duplicate route path \"${(route as any).path}\"`)\n routePaths.add((route as any).path)\n }\n // A nav entry that links to a route the plugin doesn't declare is dead UI.\n for (const [i, nav] of manifest.navigation.entries()) {\n const r = (nav as any).route\n if (routePaths.size > 0 && !routePaths.has(r)) {\n fail(scope, `navigation[${i}].route \"${r}\" has no matching route in manifest.routes`)\n }\n }\n\n // Settings tabs (the only UI surface integrations need) must be renderable.\n const settingIds = new Set<string>()\n for (const [i, tab] of (manifest.settings ?? []).entries()) {\n if (!nonEmptyString((tab as any)?.id)) fail(scope, `settings[${i}].id must be a non-empty string`)\n if (!nonEmptyString((tab as any)?.label)) fail(scope, `settings[${i}].label must be a non-empty string`)\n if (!isComponentType((tab as any)?.component)) fail(scope, `settings[${i}].component must be a component`)\n if (settingIds.has((tab as any).id)) fail(scope, `duplicate settings tab id \"${(tab as any).id}\"`)\n settingIds.add((tab as any).id)\n }\n\n for (const [i, feat] of (manifest.declaredFeatures ?? []).entries()) {\n if (!nonEmptyString((feat as any)?.id)) fail(scope, `declaredFeatures[${i}].id must be a non-empty string`)\n }\n\n for (const [i, src] of (manifest.emitsFrom ?? []).entries()) {\n if (!nonEmptyString(src?.table)) fail(scope, `emitsFrom[${i}].table must be a non-empty string`)\n if (!nonEmptyString(src?.entityKey)) fail(scope, `emitsFrom[${i}].entityKey must be a non-empty string`)\n for (const action of src.actions ?? []) {\n if (!EVENT_ACTIONS.has(action)) fail(scope, `emitsFrom[${i}] has unknown action \"${action}\"`)\n }\n }\n\n const functionSlugs = new Set<string>()\n for (const [i, fn] of (manifest.functions ?? []).entries()) {\n if (!SLUG.test(fn?.slug ?? '')) fail(scope, `functions[${i}].slug must be kebab-case — it becomes the deployed function name`)\n if (functionSlugs.has(fn.slug)) fail(scope, `duplicate function slug \"${fn.slug}\"`)\n functionSlugs.add(fn.slug)\n if (typeof fn.verifyJwt !== 'boolean') fail(scope, `functions[${i}].verifyJwt must be a boolean`)\n if (!FUNCTION_INGRESS.has(fn.ingress)) fail(scope, `functions[${i}].ingress \"${fn.ingress}\" is not one of ${[...FUNCTION_INGRESS].join(', ')}`)\n // The ingress authenticates by signature, not by a caller JWT it does not have.\n if (fn.ingress === 'fayz' && fn.verifyJwt) fail(scope, `functions[${i}] is reached through the Fayz ingress, so verifyJwt must be false`)\n for (const secret of fn.secrets ?? []) {\n // A name, never a value — this is the shape that keeps a key out of git.\n if (!SECRET_NAME.test(secret)) fail(scope, `functions[${i}].secrets must name secrets (SCREAMING_SNAKE_CASE), never carry their values`)\n }\n }\n\n for (const [i, def] of (manifest.connectors ?? []).entries()) {\n // An unlisted category renders NO badge rather than a wrong one, so the\n // mistake is invisible in a screenshot. Caught here instead.\n if (def.category !== undefined && !isConnectorCategory(def.category)) {\n fail(\n scope,\n `connectors[${i}].category \"${def.category}\" is not a catalogue category — ` +\n `use one of ${CONNECTOR_CATEGORIES.join(', ')}, taken from the catalogue row with this connector's slug.`,\n )\n }\n for (const pattern of def.subscribesTo ?? []) {\n if (!nonEmptyString(pattern)) fail(scope, `connectors[${i}].subscribesTo must hold non-empty patterns`)\n // Only a trailing star is honoured; see eventKeyMatches.\n if (pattern.includes('*') && !pattern.endsWith('*')) {\n fail(scope, `connectors[${i}].subscribesTo \"${pattern}\" — \"*\" is only honoured at the end`)\n }\n }\n\n assertConnectorPermissions(scope, `connectors[${i}]`, def)\n // The request plane's two fields are required THERE and meaningless\n // elsewhere. Checked at the manifest so a connector cannot reach a buyer\n // with an undeclared budget — the failure would otherwise be a spinner.\n if ((def.planes ?? []).includes('request')) {\n try {\n requestPlaneSpec(def)\n } catch (error) {\n fail(scope, `connectors[${i}] ${errorMessage(error)}`)\n }\n } else if (def.latencyBudgetMs !== undefined || def.onFailure !== undefined) {\n fail(\n scope,\n `connectors[${i}] declares latencyBudgetMs/onFailure but is not on the request plane — ` +\n `nothing enforces them, so they read as a guarantee that does not exist.`,\n )\n }\n // Authorization vs configuration. Both declarations end up on the same row,\n // and a key in both is a value with two owners: the connect form would write\n // it and the settings form would overwrite it.\n const fieldKeys = new Set((def.fields ?? []).map((f) => f.key))\n const settingKeys = new Set<string>()\n for (const [j, setting] of (def.settings ?? []).entries()) {\n const at = `connectors[${i}].settings[${j}]`\n if (!nonEmptyString(setting?.key)) fail(scope, `${at}.key must be a non-empty string`)\n if (!nonEmptyString(setting?.label)) fail(scope, `${at}.label must be a non-empty string`)\n if (!SETTING_TYPES.has(setting.type)) {\n fail(scope, `${at}.type \"${setting.type}\" is not one of ${[...SETTING_TYPES].join(', ')}`)\n }\n if (settingKeys.has(setting.key)) fail(scope, `${at} duplicates settings key \"${setting.key}\"`)\n settingKeys.add(setting.key)\n if (fieldKeys.has(setting.key)) {\n fail(\n scope,\n `${at}.key \"${setting.key}\" is also a credential field — a key either authorizes the ` +\n `connection (fields) or configures it (settings), never both.`,\n )\n }\n if (setting.type === 'select' || setting.type === 'multi-select') {\n if (!Array.isArray(setting.options) || setting.options.length === 0) {\n fail(scope, `${at} is a ${setting.type} and must declare options — that is what replaces a free-text box`)\n }\n for (const [k, option] of setting.options.entries()) {\n if (!nonEmptyString(option?.value)) fail(scope, `${at}.options[${k}].value must be a non-empty string`)\n if (!nonEmptyString(option?.label)) fail(scope, `${at}.options[${k}].label must be a non-empty string`)\n }\n }\n if (setting.pattern !== undefined) {\n if (setting.type !== 'text') fail(scope, `${at}.pattern only applies to a text setting`)\n try {\n new RegExp(setting.pattern)\n } catch {\n fail(scope, `${at}.pattern is not a valid regular expression`)\n }\n // A refusal with no sentence is a form that says no and not why.\n if (!nonEmptyString(setting.patternHint)) fail(scope, `${at} declares a pattern, so it must declare patternHint`)\n }\n }\n // Declared settings nobody can read or write are a screen that renders empty.\n if (settingKeys.size > 0) {\n if (typeof def.getSettings !== 'function') fail(scope, `connectors[${i}] declares settings but no getSettings()`)\n if (typeof def.saveSettings !== 'function') fail(scope, `connectors[${i}] declares settings but no saveSettings()`)\n }\n\n // \"Acionado em quais momentos\" — a moment on a plane the connector does not\n // have is a promise the code cannot keep.\n const planes = new Set(connectorPlanes(def))\n const momentKeys = new Set<string>()\n for (const [j, moment] of (def.invokedAt ?? []).entries()) {\n const at = `connectors[${i}].invokedAt[${j}]`\n if (!nonEmptyString(moment?.key)) fail(scope, `${at}.key must be a non-empty string`)\n if (!nonEmptyString(moment?.label)) fail(scope, `${at}.label must be a non-empty string`)\n if (momentKeys.has(moment.key)) fail(scope, `${at} duplicates key \"${moment.key}\"`)\n momentKeys.add(moment.key)\n const plane = invocationPlane(moment)\n if (!planes.has(plane)) {\n fail(scope, `${at} is declared on the ${plane} plane, which connectors[${i}].planes does not include`)\n }\n if (moment.trigger !== undefined) {\n if (plane !== 'sync') fail(scope, `${at}.trigger only applies to a sync moment`)\n if (!TRIGGERS.has(moment.trigger)) fail(scope, `${at} has unknown trigger \"${moment.trigger}\"`)\n }\n // A moment that reaches something the connector never asked for is the\n // screen answering \"quando ele age\" with access nobody consented to.\n const declared = new Set((def.permissions ?? []).map((p) => p.resource))\n for (const resource of moment.touches ?? []) {\n if (!declared.has(resource)) {\n fail(\n scope,\n `${at}.touches names \"${resource}\", which connectors[${i}].permissions does not declare — ` +\n `a call site cannot reach what the consent view never showed.`,\n )\n }\n }\n }\n\n for (const [j, auto] of (def.managedAutomations ?? []).entries()) {\n if (!nonEmptyString(auto?.eventKey)) fail(scope, `connectors[${i}].managedAutomations[${j}].eventKey must be a non-empty string`)\n if (!nonEmptyString(auto?.label)) fail(scope, `connectors[${i}].managedAutomations[${j}].label must be a non-empty string`)\n // The screen would promise a reaction the ingress never delivers.\n if (!connectorSubscribes(def, auto.eventKey)) {\n fail(scope, `connectors[${i}].managedAutomations[${j}] fires on \"${auto.eventKey}\", which no subscribesTo pattern covers`)\n }\n }\n }\n\n // A connector brings a ConnectorDefinition, not a pair of tables.\n for (const [i, mig] of (manifest.migrations ?? []).entries()) {\n for (const table of bespokeConnectorTables(mig?.sql)) {\n fail(\n scope,\n `migrations[${i}] (\"${mig?.id ?? '?'}\") creates public.${table} — a connector's own ` +\n `*_integrations / *_sync_log table. Store the connection in connections / ` +\n `sync_runs via createConnectionStore('<connector-id>'): two accounts are two ` +\n `rows separated by instance_key, and connector-specific counters go in stats.`,\n )\n }\n }\n\n // A plugin that contributes nothing mountable is almost always a mistake.\n // (Connector-only addon plugins contribute via `connectors` instead.)\n if (\n manifest.navigation.length === 0 &&\n manifest.routes.length === 0 &&\n (manifest.settings ?? []).length === 0 &&\n (manifest.connectors ?? []).length === 0\n ) {\n fail(scope, 'plugin contributes no navigation, routes, settings, or connectors — it would mount but do nothing')\n }\n}\n\n/**\n * What a connector says it needs — and the four ways that declaration can\n * contradict the ones that already existed.\n *\n * The feature this guards is a consent view. Its whole value is that the list it\n * shows is the list, so every way of ending up with two lists is refused here:\n *\n * 1. an action that does not exist for the resource kind (`listen` on a\n * record type, `write` on an event) — a word the reader would have to guess at;\n * 2. a `data` permission naming a resource the legacy `entities` never listed,\n * or an entity with no permission — the \"writes to an entity it never\n * listed\" case, in both directions;\n * 3. a `listen` permission the legacy `subscribesTo` does not name, or a\n * `subscribesTo` pattern no permission explains — the connector would be\n * delivered facts the consent view never showed, or shown facts the ingress\n * filters out;\n * 4. two permissions for the same resource — two rows, two reasons, and no\n * answer to which one the tenant agreed to.\n *\n * Rules 2 and 3 only bite when BOTH declarations are present. A connector built\n * against an older core declares only the legacy fields and is unaffected; a\n * connector written today declares only `permissions` and both are derived from\n * it. What is refused is saying both things and saying them differently.\n */\nfunction assertConnectorPermissions(\n scope: string,\n path: string,\n def: { permissions?: ConnectorPermission[]; entities?: string[]; subscribesTo?: string[] },\n): void {\n const permissions = def.permissions\n if (permissions === undefined) return\n if (!Array.isArray(permissions)) fail(scope, `${path}.permissions must be an array`)\n\n const seen = new Set<string>()\n for (const [j, permission] of permissions.entries()) {\n const at = `${path}.permissions[${j}]`\n if (permission?.kind !== 'data' && permission?.kind !== 'event') {\n fail(scope, `${at}.kind must be \"data\" or \"event\"`)\n }\n if (!nonEmptyString(permission.resource)) fail(scope, `${at}.resource must be a non-empty string`)\n // The reason is the only part a tenant can actually judge; a blank one turns\n // the screen back into the schema dump it exists to replace.\n if (!nonEmptyString(permission.reason)) {\n fail(scope, `${at} must declare a reason — the sentence the tenant judges before authorizing`)\n }\n if (!Array.isArray(permission.actions) || permission.actions.length === 0) {\n fail(scope, `${at}.actions must name at least one action — a resource with no access is not a permission`)\n }\n const legal = permissionActions(permission.kind)\n for (const action of permission.actions) {\n if (!legal.includes(action)) {\n fail(scope, `${at} asks for \"${action}\" on the ${permission.kind} resource \"${permission.resource}\", which only admits ${legal.join(', ')}`)\n }\n }\n if (isEventPermission(permission) && permission.resource.includes('*') && !permission.resource.endsWith('*')) {\n fail(scope, `${at}.resource \"${permission.resource}\" — \"*\" is only honoured at the end`)\n }\n const key = `${permission.kind}:${permission.resource}`\n if (seen.has(key)) fail(scope, `${at} repeats \"${key}\" — one resource, one row, one reason`)\n seen.add(key)\n }\n\n // (2) data permissions ↔ the legacy entities list.\n if (def.entities !== undefined) {\n const declared = new Set(connectorEntities({ permissions }))\n const legacy = new Set(def.entities)\n for (const entity of declared) {\n if (!legacy.has(entity)) {\n fail(\n scope,\n `${path}.permissions reaches \"${entity}\", which ${path}.entities does not list — ` +\n `the two describe the same access and must name the same set (drop entities; it is derived).`,\n )\n }\n }\n for (const entity of legacy) {\n if (!declared.has(entity)) {\n fail(\n scope,\n `${path}.entities lists \"${entity}\" with no permission saying what it does with it — ` +\n `a record type on the consent view with no read/write is a name, not a declaration.`,\n )\n }\n }\n }\n\n // (3) listen permissions ↔ the legacy subscribesTo list.\n if (def.subscribesTo !== undefined) {\n const declared = new Set(connectorSubscribesTo({ permissions }))\n const legacy = new Set(def.subscribesTo)\n for (const pattern of declared) {\n if (!legacy.has(pattern)) {\n fail(\n scope,\n `${path}.permissions listens to \"${pattern}\", which ${path}.subscribesTo does not — ` +\n `the ingress filters on that list, so the consent view would promise a fact never delivered.`,\n )\n }\n }\n for (const pattern of legacy) {\n if (!declared.has(pattern)) {\n fail(\n scope,\n `${path}.subscribesTo asks for \"${pattern}\" with no listen permission explaining it — ` +\n `the connector would receive a fact the tenant was never shown.`,\n )\n }\n }\n }\n}\n\n/**\n * `CREATE TABLE [IF NOT EXISTS] [schema.]name` where name ends in `_integrations`\n * or `_sync_log` — the pair four connectors each reinvented before\n * `connections` / `sync_runs` existed (FAY-1376). Neither generic table\n * matches, so a connector that stores its connection in them creates nothing.\n *\n * Deliberately duplicated in scripts/check-connector-tables.mjs, which scans the\n * .sql files themselves: that runs in the `contracts` CI job with no install and\n * no build, so it cannot import this. This half catches SQL declared inline on a\n * manifest, which no .sql walk would see. The two are held in agreement by one\n * case table, asserted from both sides — see\n * packages/core/test/integrations/connector-tables.test.ts.\n */\nconst BESPOKE_CONNECTOR_TABLE =\n /\\bcreate\\s+table\\s+(?:if\\s+not\\s+exists\\s+)?(?:[a-z0-9_]+\\s*\\.\\s*)?([a-z0-9_]*(?:_integrations|_sync_log))\\b/gi\n\n/** Table names a CREATE TABLE in this SQL would bring back. Empty = conformant. */\nexport function bespokeConnectorTables(sql: unknown): string[] {\n const text = typeof sql === 'string' ? sql.replace(/\"/g, '') : ''\n const found = new Set<string>()\n for (const m of text.matchAll(BESPOKE_CONNECTOR_TABLE)) found.add(m[1].toLowerCase())\n return [...found]\n}\n\nconst EVENT_ACTIONS = new Set(['created', 'updated', 'deleted'])\nconst FUNCTION_INGRESS = new Set(['fayz', 'none'])\nconst SLUG = /^[a-z0-9][a-z0-9-]*$/\nconst SECRET_NAME = /^[A-Z][A-Z0-9_]*$/\n\nconst SETTING_TYPES = new Set(['text', 'select', 'multi-select', 'toggle'])\nconst AUTH_KINDS = new Set(['oauth', 'api-key', 'mtls'])\nconst DIRECTIONS = new Set(['inbound', 'outbound', 'bidirectional'])\nconst TRIGGERS = new Set(['on-write', 'scheduled', 'manual', 'webhook'])\n\n/**\n * Assert an integration Connector descriptor is well-formed: identity present,\n * a known auth kind, and at least one capability with a valid direction +\n * trigger set. This is the contract a connector must satisfy BEFORE its\n * data-plane (edge function) exists — the TDD anchor for an integration.\n */\nexport function assertConnectorContract(connector: Connector): void {\n const scope = nonEmptyString(connector?.id) ? `connector:${connector.id}` : '<unknown connector>'\n for (const field of ['id', 'provider', 'pluginId'] as const) {\n if (!nonEmptyString(connector?.[field])) fail(scope, `connector.${field} must be a non-empty string`)\n }\n if (!AUTH_KINDS.has(connector.authKind)) fail(scope, `connector.authKind \"${connector.authKind}\" is not one of ${[...AUTH_KINDS].join(', ')}`)\n if (!Array.isArray(connector.capabilities) || connector.capabilities.length === 0) {\n fail(scope, 'connector.capabilities must list at least one capability')\n }\n for (const [i, cap] of connector.capabilities.entries()) {\n if (!nonEmptyString(cap?.entity)) fail(scope, `capabilities[${i}].entity must be a non-empty string`)\n if (!DIRECTIONS.has(cap.direction)) fail(scope, `capabilities[${i}].direction \"${cap.direction}\" is invalid`)\n if (!Array.isArray(cap.triggers) || cap.triggers.length === 0) fail(scope, `capabilities[${i}].triggers must be non-empty`)\n for (const trig of cap.triggers) {\n if (!TRIGGERS.has(trig)) fail(scope, `capabilities[${i}] has unknown trigger \"${trig}\"`)\n }\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
- import { globalCache, getActiveTenantId, getSupabaseClientOptional, parseRangeFilter, matchesRange, assertWrote, stableKey, DEFAULT_CACHE_TTL, getScopedResource, createSupabaseProvider, resolveUnitScope, applyUnitScope, applyRangeToQuery, isFilterObject, clearGlobalCache } from './chunk-SFU34NWN.js';
1
+ import { globalCache, getActiveTenantId, getSupabaseClientOptional, parseRangeFilter, matchesRange, assertWrote, stableKey, DEFAULT_CACHE_TTL, getScopedResource, createSupabaseProvider, resolveUnitScope, applyUnitScope, applyRangeToQuery, isFilterObject, clearGlobalCache } from './chunk-YHSRDP6M.js';
2
2
  import { declaredCustomFields, validateEntityRecordData } from './chunk-EWKX4VUM.js';
3
- import { toDataError, DataError, errorMessage } from './chunk-OYE4ATKB.js';
3
+ import { toDataError, DataError, errorMessage } from './chunk-EG6IXJNY.js';
4
4
  import * as React from 'react';
5
5
 
6
6
  // src/data/count.ts
@@ -1870,5 +1870,5 @@ async function bulkRemove(provider, ids, options) {
1870
1870
  }
1871
1871
 
1872
1872
  export { CustomFieldsError, DATA_CHANGED_EVENT, FIELDS_TABLE, attachPersistentCache, bulkCreate, bulkRemove, cacheKeyFor, cachePrefixFor, clearCustomFieldsCache, countByTenant, createArchetypeProvider, createEventBus, createFayzApiProvider, createMockProvider, dataCall, dataQuery, emitDataChanged, eventBus, getActiveUnitId, getPersistentCache, invalidateCount, isKnownMissing, isUnitMode, localList, matchesDataChange, mergeCustomFields, onDataChanged, registerDataTelemetry, rememberIfMissing, replicaKeyFor, resetActiveUnit, resetMissingObjects, resolveCustomFields, resolveDataProvider, setActiveUnitId, setUnitMode, subscribeActiveUnit, syncReplica, useActiveUnitId, useDataChanged, useUnitMode, validateCustomFields, withCache, withOffline };
1873
- //# sourceMappingURL=chunk-VFQMXAZ6.js.map
1874
- //# sourceMappingURL=chunk-VFQMXAZ6.js.map
1873
+ //# sourceMappingURL=chunk-RO7HJJUV.js.map
1874
+ //# sourceMappingURL=chunk-RO7HJJUV.js.map