@wildo-ai/external-connectors-public 1.1.10 → 1.1.12
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/esm/app/compose-frontend-app-providers.js.map +1 -1
- package/dist/esm/app/compose-hydrated-frontend-app-providers.js.map +1 -1
- package/dist/esm/app/engine-frontend-app-provider-registry.d.ts.map +1 -1
- package/dist/esm/app/engine-frontend-app-provider-registry.js +4 -7
- package/dist/esm/app/engine-frontend-app-provider-registry.js.map +1 -1
- package/dist/esm/app/frontend-app-provider-module.types.js.map +1 -1
- package/dist/esm/app/frontend-app-provider-registry.types.js.map +1 -1
- package/dist/esm/app/index.d.ts +1 -0
- package/dist/esm/app/index.d.ts.map +1 -1
- package/dist/esm/app/index.js +1 -0
- package/dist/esm/app/index.js.map +1 -1
- package/dist/esm/companion-exports.d.ts +3 -0
- package/dist/esm/companion-exports.d.ts.map +1 -1
- package/dist/esm/companion-exports.js +71 -11
- package/dist/esm/companion-exports.js.map +1 -1
- package/dist/esm/engine-frontend-providers-package.d.ts.map +1 -1
- package/dist/esm/engine-frontend-providers-package.js.map +1 -1
- package/dist/esm/providers/dropbox/dropbox.frontend-app.module.d.ts.map +1 -1
- package/dist/esm/providers/dropbox/dropbox.frontend-app.module.js +19 -2
- package/dist/esm/providers/dropbox/dropbox.frontend-app.module.js.map +1 -1
- package/dist/esm/providers/dropbox/index.js.map +1 -1
- package/dist/esm/providers/google-drive/google-drive.frontend-app.module.d.ts.map +1 -1
- package/dist/esm/providers/google-drive/google-drive.frontend-app.module.js +21 -3
- package/dist/esm/providers/google-drive/google-drive.frontend-app.module.js.map +1 -1
- package/dist/esm/providers/google-drive/index.js.map +1 -1
- package/dist/esm/providers/google-places/google-places.frontend-app.module.d.ts.map +1 -1
- package/dist/esm/providers/google-places/google-places.frontend-app.module.js +8 -2
- package/dist/esm/providers/google-places/google-places.frontend-app.module.js.map +1 -1
- package/dist/esm/providers/microsoft-onedrive/index.js.map +1 -1
- package/dist/esm/providers/microsoft-onedrive/microsoft-onedrive.frontend-app.module.d.ts.map +1 -1
- package/dist/esm/providers/microsoft-onedrive/microsoft-onedrive.frontend-app.module.js +26 -3
- package/dist/esm/providers/microsoft-onedrive/microsoft-onedrive.frontend-app.module.js.map +1 -1
- package/dist/esm/providers/recaptcha/index.js.map +1 -1
- package/dist/esm/providers/recaptcha/recaptcha.frontend-website.module.d.ts.map +1 -1
- package/dist/esm/providers/recaptcha/recaptcha.frontend-website.module.js +15 -6
- package/dist/esm/providers/recaptcha/recaptcha.frontend-website.module.js.map +1 -1
- package/dist/esm/shared/activate-frontend-provider-sdks.d.ts +21 -3
- package/dist/esm/shared/activate-frontend-provider-sdks.d.ts.map +1 -1
- package/dist/esm/shared/activate-frontend-provider-sdks.js +51 -4
- package/dist/esm/shared/activate-frontend-provider-sdks.js.map +1 -1
- package/dist/esm/shared/frontend-provider-consent.d.ts +34 -0
- package/dist/esm/shared/frontend-provider-consent.d.ts.map +1 -1
- package/dist/esm/shared/frontend-provider-consent.js +8 -0
- package/dist/esm/shared/frontend-provider-consent.js.map +1 -1
- package/dist/esm/shared/frontend-provider-on-demand.d.ts +49 -0
- package/dist/esm/shared/frontend-provider-on-demand.d.ts.map +1 -0
- package/dist/esm/shared/frontend-provider-on-demand.js +80 -0
- package/dist/esm/shared/frontend-provider-on-demand.js.map +1 -0
- package/dist/esm/shared/frontend-provider-surface.types.d.ts +37 -1
- package/dist/esm/shared/frontend-provider-surface.types.d.ts.map +1 -1
- package/dist/esm/shared/frontend-provider-surface.types.js +17 -0
- package/dist/esm/shared/frontend-provider-surface.types.js.map +1 -1
- package/dist/esm/shared/hydrate-frontend-providers.d.ts +18 -1
- package/dist/esm/shared/hydrate-frontend-providers.d.ts.map +1 -1
- package/dist/esm/shared/hydrate-frontend-providers.js +46 -5
- package/dist/esm/shared/hydrate-frontend-providers.js.map +1 -1
- package/dist/esm/shared/load-frontend-provider-scripts.js +1 -1
- package/dist/esm/shared/load-frontend-provider-scripts.js.map +1 -1
- package/dist/esm/shared/provider-component-registry.js +2 -2
- package/dist/esm/shared/provider-component-registry.js.map +1 -1
- package/dist/esm/techdoc/compose-frontend-techdoc-providers.js.map +1 -1
- package/dist/esm/techdoc/compose-hydrated-frontend-techdoc-providers.js.map +1 -1
- package/dist/esm/techdoc/engine-frontend-techdoc-provider-registry.js.map +1 -1
- package/dist/esm/techdoc/frontend-techdoc-provider-module.types.js.map +1 -1
- package/dist/esm/techdoc/frontend-techdoc-provider-registry.types.js.map +1 -1
- package/dist/esm/techdoc/index.js.map +1 -1
- package/dist/esm/website/compose-frontend-website-providers.js.map +1 -1
- package/dist/esm/website/compose-hydrated-frontend-website-providers.js.map +1 -1
- package/dist/esm/website/engine-frontend-website-provider-registry.d.ts.map +1 -1
- package/dist/esm/website/engine-frontend-website-provider-registry.js +0 -8
- package/dist/esm/website/engine-frontend-website-provider-registry.js.map +1 -1
- package/dist/esm/website/frontend-website-provider-module.types.js.map +1 -1
- package/dist/esm/website/frontend-website-provider-registry.types.js.map +1 -1
- package/dist/esm/website/index.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +7 -18
- package/dist/esm/providers/posthog/index.d.ts +0 -2
- package/dist/esm/providers/posthog/index.d.ts.map +0 -1
- package/dist/esm/providers/posthog/index.js +0 -2
- package/dist/esm/providers/posthog/index.js.map +0 -1
- package/dist/esm/providers/posthog/posthog-browser-options.d.ts +0 -34
- package/dist/esm/providers/posthog/posthog-browser-options.d.ts.map +0 -1
- package/dist/esm/providers/posthog/posthog-browser-options.js +0 -34
- package/dist/esm/providers/posthog/posthog-browser-options.js.map +0 -1
- package/dist/esm/providers/posthog/posthog.frontend-app.module.d.ts +0 -38
- package/dist/esm/providers/posthog/posthog.frontend-app.module.d.ts.map +0 -1
- package/dist/esm/providers/posthog/posthog.frontend-app.module.js +0 -111
- package/dist/esm/providers/posthog/posthog.frontend-app.module.js.map +0 -1
- package/dist/esm/providers/posthog/posthog.frontend-website.module.d.ts +0 -22
- package/dist/esm/providers/posthog/posthog.frontend-website.module.d.ts.map +0 -1
- package/dist/esm/providers/posthog/posthog.frontend-website.module.js +0 -95
- package/dist/esm/providers/posthog/posthog.frontend-website.module.js.map +0 -1
- package/dist/esm/providers/sentry/sentry.frontend-app.module.d.ts +0 -57
- package/dist/esm/providers/sentry/sentry.frontend-app.module.d.ts.map +0 -1
- package/dist/esm/providers/sentry/sentry.frontend-app.module.js +0 -146
- package/dist/esm/providers/sentry/sentry.frontend-app.module.js.map +0 -1
- package/dist/esm/providers/sentry/sentry.frontend-website.module.d.ts +0 -30
- package/dist/esm/providers/sentry/sentry.frontend-website.module.d.ts.map +0 -1
- package/dist/esm/providers/sentry/sentry.frontend-website.module.js +0 -95
- package/dist/esm/providers/sentry/sentry.frontend-website.module.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose-frontend-app-providers.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"compose-frontend-app-providers.js","sourceRoot":"","sources":["../../../src/app/compose-frontend-app-providers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,uBAAuB,EAC9B,2BAA2B,GAC5B,MAAM,sCAAsC,CAAC;AAY9C,MAAM,UAAU,2BAA2B,CACzC,GAAG,SAA6D;IAEhE,MAAM,QAAQ,GAAG,uBAAuB,CACtC,aAAa,EACb,SAAS,CACV,CAAC;IACF,wFAAwF;IACxF,2BAA2B,CAAC,aAAa,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACtE,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["/**\n * `composeFrontendAppProviders` — frontend-app-facet wrapper around the\n * generic `composeProviderRegistry` core. See\n * `@wildo-ai/saas-models/external-providers/compose-provider-registry.shared`\n * for behavior, conflict policy, and indexing semantics.\n */\n\nimport { composeProviderRegistry,\n assertProviderTierCoherence,\n} from '@wildo-ai/saas-models/public-runtime';\n\nimport type { FrontendAppProviderModule } from './frontend-app-provider-module.types';\nimport type {\n FrontendAppProviderRef,\n FrontendAppProviderRegistry,\n} from './frontend-app-provider-registry.types';\n\nexport interface FrontendAppProviderRegistryFragment {\n readonly modules: ReadonlyMap<FrontendAppProviderRef, FrontendAppProviderModule>;\n}\n\nexport function composeFrontendAppProviders(\n ...fragments: ReadonlyArray<FrontendAppProviderRegistryFragment>\n): FrontendAppProviderRegistry {\n const registry = composeProviderRegistry<FrontendAppProviderRef, FrontendAppProviderModule>(\n 'FrontendApp',\n fragments,\n );\n // #328 — the tier rule holds on every facet: a CATALOGUE provider binds no engine slot.\n assertProviderTierCoherence('FrontendApp', registry.modules.values());\n return registry;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose-hydrated-frontend-app-providers.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"compose-hydrated-frontend-app-providers.js","sourceRoot":"","sources":["../../../src/app/compose-hydrated-frontend-app-providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AASH,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EACL,8BAA8B,GAE/B,MAAM,sCAAsC,CAAC;AAc9C;;;GAGG;AACH,MAAM,UAAU,mCAAmC,CACjD,KAA+D;IAE/D,MAAM,QAAQ,GAAG,8BAA8B,CAA4B,KAAK,CAAC,CAAC;IAClF,MAAM,OAAO,GAAG,IAAI,GAAG,CACrB,CAAC,GAAG,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC;QACnC,GAA6B;QAC7B;YACE,GAAG,MAAM;YACT,wEAAwE;YACxE,sEAAsE;YACtE,kEAAkE;YAClE,0EAA0E;YAC1E,6EAA6E;YAC7E,gEAAgE;YAChE,iEAAiE;YACjE,gFAAgF;YAChF,mEAAmE;YACnE,6CAA6C;YAC7C,oBAAoB,EAAE,MAAM,CAAC,oBAAyD;YACtF,SAAS,EAAE,MAAM,CAAC,SAA4C;YAC9D,iGAAiG;YACjG,kGAAkG;YAClG,8DAA8D;YAC9D,eAAe,EAAE,MAAM,CAAC,eAA4D;SACrF;KACF,CAAC,CACH,CAAC;IACF,OAAO,2BAA2B,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;AAClD,CAAC","sourcesContent":["/**\n * Hydration for the main SaaS-app frontend facet: the DATA channel joined with the\n * CODE channel, composed into the same registry every consumer already reads.\n *\n * `composeFrontendAppProviders` (the fragment-composition core) is unchanged and still the\n * single place the tier rule runs. What is added here is the step BEFORE it —\n * building each module from its served entry and, where the bundle carries it,\n * the provider package's own module — so the registry is no longer produced by\n * casting a JSON entry to a module type.\n *\n * See `../shared/hydrate-frontend-providers.ts` for the join rule and the\n * diagnostics it raises.\n */\n\nimport type { ConsentPurpose, ProviderCapability, ProviderProtocol } from '@wildo-ai/saas-models/public-runtime';\n\nimport type { FrontendAppProviderModule } from './frontend-app-provider-module.types';\nimport type {\n FrontendAppProviderRef,\n FrontendAppProviderRegistry,\n} from './frontend-app-provider-registry.types';\nimport { composeFrontendAppProviders } from './compose-frontend-app-providers';\nimport {\n hydrateFrontendProviderModules,\n type HydrateFrontendProvidersInput,\n} from '../shared/hydrate-frontend-providers';\n\n/**\n * The shape of `generatedFrontendProviderModules` in a\n * `frontend-providers.generated.ts` written by `wildo config sync` for a\n * main SaaS-app frontend service.\n *\n * The key is the provider's `ref` and must equal `module.metadata.ref`; the\n * join refuses a mismatch rather than binding one provider's code to another's\n * configuration. Config sync emits an empty map for a service with no providers,\n * keeping its startup import stable when the last provider is removed.\n */\nexport type GeneratedAppProviderModules = Readonly<Record<string, FrontendAppProviderModule>>;\n\n/**\n * Joins the served provider entries with the bundle's generated modules and\n * composes the result.\n */\nexport function composeHydratedFrontendAppProviders(\n input: HydrateFrontendProvidersInput<FrontendAppProviderModule>,\n): FrontendAppProviderRegistry {\n const hydrated = hydrateFrontendProviderModules<FrontendAppProviderModule>(input);\n const modules = new Map<FrontendAppProviderRef, FrontendAppProviderModule>(\n [...hydrated].map(([ref, module]) => [\n ref as FrontendAppProviderRef,\n {\n ...module,\n // The ONE narrowing on this path, and it is an unchecked cast: the wire\n // carries `string`, the module type is the capability/protocol union.\n // It was left unchecked because that union was extended by module\n // augmentation, so its members did not exist at runtime — no longer true:\n // `ProviderCapability` is the built-in set since #502 and `ProviderProtocol`\n // is `BuiltinProviderProtocol`, and both sets exist at runtime.\n // A runtime check is now possible and not yet written. What does\n // have teeth still runs: `composeFrontendAppProviders` applies the tier rule to\n // every composed module, which is the check that decides whether a\n // capability may bind an engine slot at all.\n providerCapabilities: module.providerCapabilities as ReadonlyArray<ProviderCapability>,\n protocols: module.protocols as ReadonlyArray<ProviderProtocol>,\n // Unchecked for the same reason, and safe for a stronger one (#1702): the consent decision reads\n // these as strings and FAILS CLOSED on any that is not a `ConsentPurpose`, so a wrong member here\n // withholds the provider rather than widening what it may do.\n consentPurposes: module.consentPurposes as ReadonlyArray<ConsentPurpose> | undefined,\n },\n ]),\n );\n return composeFrontendAppProviders({ modules });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine-frontend-app-provider-registry.d.ts","sourceRoot":"","sources":["../../../src/app/engine-frontend-app-provider-registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"engine-frontend-app-provider-registry.d.ts","sourceRoot":"","sources":["../../../src/app/engine-frontend-app-provider-registry.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,kCAAkC,CAAC;AA+B5F,eAAO,MAAM,yCAAyC,EAAE,mCAOvD,CAAC;AAEF,eAAO,MAAM,iCAAiC,8EAE7C,CAAC"}
|
|
@@ -3,11 +3,6 @@ import { GoogleDriveFrontendAppProvider } from '../providers/google-drive/index.
|
|
|
3
3
|
// The owning source directly: a new provider directory gets no intermediary barrel.
|
|
4
4
|
import { GooglePlacesFrontendAppProvider } from '../providers/google-places/google-places.frontend-app.module.js';
|
|
5
5
|
import { MicrosoftOneDriveFrontendAppProvider } from '../providers/microsoft-onedrive/index.js';
|
|
6
|
-
// The owning source directly, as for Sentry: the `posthog` barrel exports the WEBSITE module.
|
|
7
|
-
import { PostHogFrontendAppProvider } from '../providers/posthog/posthog.frontend-app.module.js';
|
|
8
|
-
// The owning source directly — see the note in the website registry: a barrel exporting
|
|
9
|
-
// both of Sentry's surface modules would put the website module in this app bundle.
|
|
10
|
-
import { SentryFrontendAppProvider } from '../providers/sentry/sentry.frontend-app.module.js';
|
|
11
6
|
import { composeFrontendAppProviders } from './compose-frontend-app-providers.js';
|
|
12
7
|
/**
|
|
13
8
|
* The engine's application-tier browser modules: only providers that RUN something in the browser.
|
|
@@ -25,14 +20,16 @@ import { composeFrontendAppProviders } from './compose-frontend-app-providers.js
|
|
|
25
20
|
* "identity-only" frontend presence (a declaration whose only content is a name the ref already owns).
|
|
26
21
|
* A vendor whose BROWSER code a surface does run — Google One Tap, Stripe Elements (#1741) — gets a
|
|
27
22
|
* module then, under a capability that says what it runs.
|
|
23
|
+
*
|
|
24
|
+
* None of these modules loads a vendor npm package: a provider whose browser part needs one is a registry module, whose
|
|
25
|
+
* facet package depends on the SDK and pins it (#2786; Sentry left with #2793, PostHog with #2579). No engine browser
|
|
26
|
+
* module carries a vendor SDK, not even as an optional peer (the backend's remainder is #2791).
|
|
28
27
|
*/
|
|
29
28
|
const frontendAppProviders = [
|
|
30
29
|
DropboxFrontendAppProvider,
|
|
31
30
|
GoogleDriveFrontendAppProvider,
|
|
32
31
|
GooglePlacesFrontendAppProvider,
|
|
33
32
|
MicrosoftOneDriveFrontendAppProvider,
|
|
34
|
-
PostHogFrontendAppProvider,
|
|
35
|
-
SentryFrontendAppProvider,
|
|
36
33
|
];
|
|
37
34
|
export const EngineFrontendAppProviderRegistryFragment = {
|
|
38
35
|
modules: new Map(frontendAppProviders.map((provider) => [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine-frontend-app-provider-registry.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"engine-frontend-app-provider-registry.js","sourceRoot":"","sources":["../../../src/app/engine-frontend-app-provider-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAC3E,oFAAoF;AACpF,OAAO,EAAE,+BAA+B,EAAE,MAAM,8DAA8D,CAAC;AAC/G,OAAO,EAAE,oCAAoC,EAAE,MAAM,iCAAiC,CAAC;AAEvF,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAI/E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,oBAAoB,GAAG;IAC3B,0BAA0B;IAC1B,8BAA8B;IAC9B,+BAA+B;IAC/B,oCAAoC;CAC5B,CAAC;AAEX,MAAM,CAAC,MAAM,yCAAyC,GAAwC;IAC5F,OAAO,EAAE,IAAI,GAAG,CACd,oBAAoB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC;QACrC,QAAQ,CAAC,QAAQ,CAAC,GAA6B;QAC/C,QAAQ;KACT,CAAC,CACH;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,iCAAiC,GAAG,2BAA2B,CAC1E,yCAAyC,CAC1C,CAAC","sourcesContent":["import { DropboxFrontendAppProvider } from '../providers/dropbox';\nimport { GoogleDriveFrontendAppProvider } from '../providers/google-drive';\n// The owning source directly: a new provider directory gets no intermediary barrel.\nimport { GooglePlacesFrontendAppProvider } from '../providers/google-places/google-places.frontend-app.module';\nimport { MicrosoftOneDriveFrontendAppProvider } from '../providers/microsoft-onedrive';\n\nimport { composeFrontendAppProviders } from './compose-frontend-app-providers';\nimport type { FrontendAppProviderRegistryFragment } from './compose-frontend-app-providers';\nimport type { FrontendAppProviderRef } from './frontend-app-provider-registry.types';\n\n/**\n * The engine's application-tier browser modules: only providers that RUN something in the browser.\n *\n * The four sign-in vendors (Apple, GitHub, Google, Microsoft) and Stripe used to have modules here that\n * loaded nothing and declared `SSO_OAUTH2` / `BILLING` only so the sign-in buttons, the identity-links\n * page and the billing components could read a provider display name off them (#1701). Since #1895 that\n * name belongs to the provider REF (`providers.<ref>.displayName`, planned and generated for every\n * declared provider), and those surfaces derive it from the ref they already hold — the configured\n * `auth.socialOAuth2Providers` key, the configured `billing.providerRef`. The modules then carried\n * nothing, while still telling the catalogue that the browser covers sign-in and billing, so they were\n * removed. Sign-in is a redirect to the vendor and checkout / the customer portal are hosted redirects:\n * no vendor code runs on the page. Rejected: keeping them and listing the sign-in buttons from the\n * registry (a module that loads nothing would become a precondition for a button), and a new\n * \"identity-only\" frontend presence (a declaration whose only content is a name the ref already owns).\n * A vendor whose BROWSER code a surface does run — Google One Tap, Stripe Elements (#1741) — gets a\n * module then, under a capability that says what it runs.\n *\n * None of these modules loads a vendor npm package: a provider whose browser part needs one is a registry module, whose\n * facet package depends on the SDK and pins it (#2786; Sentry left with #2793, PostHog with #2579). No engine browser\n * module carries a vendor SDK, not even as an optional peer (the backend's remainder is #2791).\n */\nconst frontendAppProviders = [\n DropboxFrontendAppProvider,\n GoogleDriveFrontendAppProvider,\n GooglePlacesFrontendAppProvider,\n MicrosoftOneDriveFrontendAppProvider,\n] as const;\n\nexport const EngineFrontendAppProviderRegistryFragment: FrontendAppProviderRegistryFragment = {\n modules: new Map(\n frontendAppProviders.map((provider) => [\n provider.metadata.ref as FrontendAppProviderRef,\n provider,\n ]),\n ),\n};\n\nexport const EngineFrontendAppProviderRegistry = composeFrontendAppProviders(\n EngineFrontendAppProviderRegistryFragment,\n);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontend-app-provider-module.types.js","sourceRoot":"","sources":["../../../../src/app/frontend-app-provider-module.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AA+LH,8EAA8E","sourcesContent":["/**\n * `FrontendAppProviderModule` — browser-bound facet of a provider for\n * the main SaaS-app frontend (`AppFrontendType.SAAS_APP`).\n *\n * Intentionally HOLDS NO SECRETS — this type lives in\n * `@wildo-ai/external-connectors-public/app`, the browser-bound side\n * of the trust-zone split.\n *\n * The module is the CODE half of a provider's frontend surface. Its DATA half\n * is `FrontendProviderEntry`, hydrated on first paint via\n * `FrontendAppBootstrapPayload.frontendProviders`; the two are joined at\n * runtime by `composeHydratedFrontendAppProviders` rather than one being cast\n * to the other.\n *\n * The `publicConfig` slice is the only place public configuration flows\n * to the frontend (e.g. a file picker's `appId`, an error monitor's DSN).\n *\n * I18n ownership stays at the consuming frontend surface: provider modules\n * export translation-ready keys on `metadata`, while React/UI code resolves\n * those keys through the app i18n service at render time. Do not freeze\n * localized button labels or provider names into `publicConfig`.\n */\n\nimport type { ConsentPurpose, FileStorageAccepted, ProviderComplianceProfile } from '@wildo-ai/saas-models/public-runtime';\n\nimport type {\n ProviderFrontendCspFootprintDeclaration,\n ProviderFrontendScriptDeclaration,\n ProviderMetadata,\n ProviderCapability,\n ProviderProtocol,\n} from '@wildo-ai/saas-models/public-runtime';\nimport type {\n ProviderFrontendComponents,\n ProviderFrontendPublicConfigSchema,\n ProviderFrontendSdk,\n} from '../shared/frontend-provider-surface.types';\n\n/** @wildo_source:part:start external-connectors.app.frontend-provider-module facet:layer:frontend facet:family:provider */\n/**\n * The browser-bound provider module an application authors for its main\n * SaaS-app frontend.\n *\n * Import from `@wildo-ai/external-connectors-public/app`. The module is a\n * plain object — no class, no registration call: the app re-exports it\n * through its `./frontend-providers` package entry and appends a matching\n * companion contribution; the framework joins it with the provider's hydrated\n * entry on first paint.\n *\n * NEVER put a secret in this object — it ships to the browser. `publicConfig`\n * is the only channel for public runtime configuration (publishable keys,\n * client IDs, picker constraints). Author `metadata` ONLY through\n * `defineProviderMetadata({ ref, packageName, tier, origin })` (#328): it\n * derives the translation-ready display-name key and records the provider's\n * identity — package, tier (an application-owned file picker is CATALOGUE: it\n * binds no engine slot), vendor and origin. Never a frozen localized string,\n * never a hand-written identity.\n *\n * ## Two channels, and which fields ride which\n *\n * `metadata`, `providerCapabilities`, `protocols`, `publicConfig`, `csp` and\n * `scripts` are DATA: they are projected onto the provider's entry, travel as\n * JSON, and are what the CLI reads when it composes the service's\n * Content-Security-Policy — it cannot execute this module, because it is a Node\n * process and this module is browser-bound.\n *\n * `sdk.activate` and `publicConfigSchema` are CODE. They reach a bundle only\n * because the bundle imports this module, through the generated\n * `frontend-providers.generated.ts` that `wildo config sync` writes for each\n * frontend service. They are never serialized; a JSON channel would drop them\n * without a word.\n *\n * A worked module declaring every field is in\n * `frontend-app-provider.example.ts`, beside this file. It lives there rather\n * than in an `@example` block here because the package's typecheck compiles it:\n * the inline version shipped for a session showing three of the CSP footprint's\n * six buckets while the type required all six, and nothing caught it.\n */\nexport interface FrontendAppProviderModule {\n metadata: ProviderMetadata;\n providerCapabilities: ReadonlyArray<ProviderCapability>;\n protocols: ReadonlyArray<ProviderProtocol>;\n /**\n * Public configuration the frontend needs at runtime. Strongly typed\n * via per-providerCapability shapes downstream — the registry stores\n * them as `unknown` so the registry shape stays independent of any one\n * provider's config shape. Declare `publicConfigSchema`\n * beside it to have the framework validate it once, at hydration,\n * instead of each use site coercing it by hand.\n */\n publicConfig?: Readonly<Record<string, unknown>>;\n /**\n * Origins this provider needs the SaaS app's composed CSP to admit.\n *\n * DATA: projected onto the provider entry and read by `resolveCspPolicy`'s\n * provider layer, per service and per environment. Declaring it here is what\n * removes the alternative — hand-editing script / frame / connect origins in\n * every application's config, for every environment.\n *\n * Name only the buckets you reach; the framework fills in the rest. For an\n * endpoint you CANNOT know — one the application configures, such as a\n * monitoring DSN, an analytics host, a self-hosted deployment — declare where\n * it lives instead of guessing what it is:\n *\n * ```ts\n * csp: {\n * derivedOrigins: [\n * { publicConfigKey: 'dsn', bucket: ProviderFrontendCspOriginBucket.CONNECT },\n * ],\n * }\n * ```\n *\n * The framework reads that key out of your own `publicConfig` and takes its\n * URL origin. That is what stops an application authoring the same host twice\n * — once as your configuration, once in its CSP — where the copy that drifts\n * fails only in production, because development is report-only.\n */\n csp?: ProviderFrontendCspFootprintDeclaration;\n /**\n * Third-party `<script>` tags the surface must add for this provider — the\n * case a dynamic `import()` cannot serve, because the vendor ships a\n * global-installing tag rather than an npm module.\n *\n * DATA. Each declared `src`'s origin MUST also appear in `csp.scriptOrigins`\n * — `projectFrontendProviderContribution` refuses the provider otherwise,\n * because the policy it contributes to would block its own script, and only\n * where CSP enforces, so the failure would first appear in production.\n */\n scripts?: ReadonlyArray<ProviderFrontendScriptDeclaration>;\n /**\n * The provider's vendor SDK: which package (DATA) and how to load and start\n * it (CODE).\n *\n * `activate` must reach its package through a DYNAMIC `import()`, so the SDK\n * is a separate chunk and no page pays for a provider it does not use.\n */\n sdk?: ProviderFrontendSdk;\n /**\n * Components this provider contributes, keyed by the capability each fills\n * and loaded on demand. CODE: it reaches a bundle only through the generated\n * `frontend-providers.generated.ts`, never through the JSON entry.\n *\n * Several providers may offer a component for ONE capability — two file\n * pickers, two meeting embeds — and that is the point: the surface presents\n * the choice rather than silently taking whichever the registry happened to\n * index first.\n */\n components?: ProviderFrontendComponents;\n /**\n * The `z_file` storage this provider's file picker fronts (#394 P5). Declare\n * it when the picker delivers a `REMOTE_REFERENCE`: the bytes stay at the\n * vendor, so the FILES row lands in this storage and only a field whose\n * `storageAccepted` names it may receive the link. Leave it undeclared for a\n * picker that delivers bytes — those are ingested into the field's own\n * storage and offered to every field.\n *\n * The backend serves the same storage through an `IFileStorageProvider`\n * keyed by this member that names this provider back as its\n * `connectedProviderRef`; the framework pins the two declarations equal.\n */\n fileStorage?: FileStorageAccepted;\n /**\n * Validator for this provider's own `publicConfig`, as a Standard Schema v1\n * value (a Zod 4 schema satisfies it as-is).\n *\n * CODE, and the answer to a real defect: `publicConfig` is\n * `Record<string, unknown>`, and each consuming site was coercing it by hand,\n * so a renamed key yielded `undefined` and a silently wrong provider. With a\n * schema declared, the framework validates once at hydration and a mismatch\n * says which key and why.\n *\n * MANDATORY for an authored module (#1705): its declared keys are the only\n * list that bounds what a browser is served, so a module without one — or\n * with one whose keys cannot be read without running it (use\n * `defineFrontendPublicConfigSchema` or a Zod object) — is refused at\n * projection, at `wildo config sync` and at hydration. It stays OPTIONAL in\n * this type on purpose: the same type describes a HYDRATED registry entry, and\n * a provider the service declares but whose code this bundle does not carry is\n * data-only and has no schema to hold. The three runtime refusals are the gate.\n */\n publicConfigSchema?: ProviderFrontendPublicConfigSchema;\n /**\n * The vendor's deployment model, processing regions and legal entity — the primitives a\n * processor register and a transfer statement are derived from.\n *\n * OPTIONAL, matching the backend contract, because a provider whose author has not stated them\n * must still load. Absent means the APPLICATION has to declare them on its own register entry,\n * where its contract with the vendor makes them checkable.\n *\n * Why a FRONTEND provider needs this at least as much as a backend one (#345): this module\n * executes in the DATA SUBJECT'S BROWSER. It loads third-party script, may set storage, and\n * talks to the vendor directly — the application's backend never sees the call. Product\n * analytics, error monitoring, a captcha and a payment element are precisely the third-party\n * recipients a privacy notice has to name, and the operator controls them LESS than a backend\n * provider routed through their own infrastructure.\n *\n * See `ProviderComplianceProfileSchema` for each field's meaning and for the refusal that a\n * `VENDOR_HOSTED` provider declaring no region cannot support a transfer statement.\n */\n complianceProfile?: ProviderComplianceProfile;\n /**\n * Consent purposes THIS VENDOR rests on beyond its capabilities' floor (#1702). DATA.\n *\n * ADDITIVE: the provider rests on the union of these and the floor\n * `PROVIDER_CAPABILITY_FRONTEND_CONSENT_CLASSIFICATION` gives each declared capability, so nothing\n * written here can lower what a capability requires. Declare it when the vendor's own processing goes\n * beyond the service the person asked for — Google reCAPTCHA is the measured case, a captcha whose\n * vendor also analyses the visitor for its own purposes — and leave it out otherwise. A consent-based\n * provider's SDK, scripts and components are all withheld until the person grants these.\n */\n consentPurposes?: ReadonlyArray<ConsentPurpose>;\n}\n/** @wildo_source:part:end external-connectors.app.frontend-provider-module */\n"]}
|
|
1
|
+
{"version":3,"file":"frontend-app-provider-module.types.js","sourceRoot":"","sources":["../../../src/app/frontend-app-provider-module.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AA+LH,8EAA8E","sourcesContent":["/**\n * `FrontendAppProviderModule` — browser-bound facet of a provider for\n * the main SaaS-app frontend (`AppFrontendType.SAAS_APP`).\n *\n * Intentionally HOLDS NO SECRETS — this type lives in\n * `@wildo-ai/external-connectors-public/app`, the browser-bound side\n * of the trust-zone split.\n *\n * The module is the CODE half of a provider's frontend surface. Its DATA half\n * is `FrontendProviderEntry`, hydrated on first paint via\n * `FrontendAppBootstrapPayload.frontendProviders`; the two are joined at\n * runtime by `composeHydratedFrontendAppProviders` rather than one being cast\n * to the other.\n *\n * The `publicConfig` slice is the only place public configuration flows\n * to the frontend (e.g. a file picker's `appId`, an error monitor's DSN).\n *\n * I18n ownership stays at the consuming frontend surface: provider modules\n * export translation-ready keys on `metadata`, while React/UI code resolves\n * those keys through the app i18n service at render time. Do not freeze\n * localized button labels or provider names into `publicConfig`.\n */\n\nimport type { ConsentPurpose, FileStorageAccepted, ProviderComplianceProfile } from '@wildo-ai/saas-models/public-runtime';\n\nimport type {\n ProviderFrontendCspFootprintDeclaration,\n ProviderFrontendScriptDeclaration,\n ProviderMetadata,\n ProviderCapability,\n ProviderProtocol,\n} from '@wildo-ai/saas-models/public-runtime';\nimport type {\n ProviderFrontendComponents,\n ProviderFrontendPublicConfigSchema,\n ProviderFrontendSdk,\n} from '../shared/frontend-provider-surface.types';\n\n/** @wildo_source:part:start external-connectors.app.frontend-provider-module facet:layer:frontend facet:family:provider */\n/**\n * The browser-bound provider module an application authors for its main\n * SaaS-app frontend.\n *\n * Import from `@wildo-ai/external-connectors-public/app`. The module is a\n * plain object — no class, no registration call: the app re-exports it\n * through its `./frontend-providers` package entry and appends a matching\n * companion contribution; the framework joins it with the provider's hydrated\n * entry on first paint.\n *\n * NEVER put a secret in this object — it ships to the browser. `publicConfig`\n * is the only channel for public runtime configuration (publishable keys,\n * client IDs, picker constraints). Author `metadata` ONLY through\n * `defineProviderMetadata({ ref, packageName, tier, origin })` (#328): it\n * derives the translation-ready display-name key and records the provider's\n * identity — package, tier (an application-owned file picker is CATALOGUE: it\n * binds no engine slot), vendor and origin. Never a frozen localized string,\n * never a hand-written identity.\n *\n * ## Two channels, and which fields ride which\n *\n * `metadata`, `providerCapabilities`, `protocols`, `publicConfig`, `csp` and\n * `scripts` are DATA: they are projected onto the provider's entry, travel as\n * JSON, and are what the CLI reads when it composes the service's\n * Content-Security-Policy — it cannot execute this module, because it is a Node\n * process and this module is browser-bound.\n *\n * `sdk.activate` and `publicConfigSchema` are CODE. They reach a bundle only\n * because the bundle imports this module, through the generated\n * `frontend-providers.generated.ts` that `wildo config sync` writes for each\n * frontend service. They are never serialized; a JSON channel would drop them\n * without a word.\n *\n * A worked module declaring every field is in\n * `frontend-app-provider.example.ts`, beside this file. It lives there rather\n * than in an `@example` block here because the package's typecheck compiles it:\n * the inline version shipped for a session showing three of the CSP footprint's\n * six buckets while the type required all six, and nothing caught it.\n */\nexport interface FrontendAppProviderModule {\n metadata: ProviderMetadata;\n providerCapabilities: ReadonlyArray<ProviderCapability>;\n protocols: ReadonlyArray<ProviderProtocol>;\n /**\n * Public configuration the frontend needs at runtime. Strongly typed\n * via per-providerCapability shapes downstream — the registry stores\n * them as `unknown` so the registry shape stays independent of any one\n * provider's config shape. Declare `publicConfigSchema`\n * beside it to have the framework validate it once, at hydration,\n * instead of each use site coercing it by hand.\n */\n publicConfig?: Readonly<Record<string, unknown>>;\n /**\n * Origins this provider needs the SaaS app's composed CSP to admit.\n *\n * DATA: projected onto the provider entry and read by `resolveCspPolicy`'s\n * provider layer, per service and per environment. Declaring it here is what\n * removes the alternative — hand-editing script / frame / connect origins in\n * every application's config, for every environment.\n *\n * Name only the buckets you reach; the framework fills in the rest. For an\n * endpoint you CANNOT know — one the application configures, such as a\n * monitoring DSN, an analytics host, a self-hosted deployment — declare where\n * it lives instead of guessing what it is:\n *\n * ```ts\n * csp: {\n * derivedOrigins: [\n * { publicConfigKey: 'dsn', bucket: ProviderFrontendCspOriginBucket.CONNECT },\n * ],\n * }\n * ```\n *\n * The framework reads that key out of your own `publicConfig` and takes its\n * URL origin. That is what stops an application authoring the same host twice\n * — once as your configuration, once in its CSP — where the copy that drifts\n * fails only in production, because development is report-only.\n */\n csp?: ProviderFrontendCspFootprintDeclaration;\n /**\n * Third-party `<script>` tags the surface must add for this provider — the\n * case a dynamic `import()` cannot serve, because the vendor ships a\n * global-installing tag rather than an npm module.\n *\n * DATA. Each declared `src`'s origin MUST also appear in `csp.scriptOrigins`\n * — `projectFrontendProviderContribution` refuses the provider otherwise,\n * because the policy it contributes to would block its own script, and only\n * where CSP enforces, so the failure would first appear in production.\n */\n scripts?: ReadonlyArray<ProviderFrontendScriptDeclaration>;\n /**\n * The provider's vendor SDK: which package (DATA) and how to load and start\n * it (CODE).\n *\n * `activate` must reach its package through a DYNAMIC `import()`, so the SDK\n * is a separate chunk and no page pays for a provider it does not use.\n */\n sdk?: ProviderFrontendSdk;\n /**\n * Components this provider contributes, keyed by the capability each fills\n * and loaded on demand. CODE: it reaches a bundle only through the generated\n * `frontend-providers.generated.ts`, never through the JSON entry.\n *\n * Several providers may offer a component for ONE capability — two file\n * pickers, two meeting embeds — and that is the point: the surface presents\n * the choice rather than silently taking whichever the registry happened to\n * index first.\n */\n components?: ProviderFrontendComponents;\n /**\n * The `z_file` storage this provider's file picker fronts (#394 P5). Declare\n * it when the picker delivers a `REMOTE_REFERENCE`: the bytes stay at the\n * vendor, so the FILES row lands in this storage and only a field whose\n * `storageAccepted` names it may receive the link. Leave it undeclared for a\n * picker that delivers bytes — those are ingested into the field's own\n * storage and offered to every field.\n *\n * The backend serves the same storage through an `IFileStorageProvider`\n * keyed by this member that names this provider back as its\n * `connectedProviderRef`; the framework pins the two declarations equal.\n */\n fileStorage?: FileStorageAccepted;\n /**\n * Validator for this provider's own `publicConfig`, as a Standard Schema v1\n * value (a Zod 4 schema satisfies it as-is).\n *\n * CODE, and the answer to a real defect: `publicConfig` is\n * `Record<string, unknown>`, and each consuming site was coercing it by hand,\n * so a renamed key yielded `undefined` and a silently wrong provider. With a\n * schema declared, the framework validates once at hydration and a mismatch\n * says which key and why.\n *\n * MANDATORY for an authored module (#1705): its declared keys are the only\n * list that bounds what a browser is served, so a module without one — or\n * with one whose keys cannot be read without running it (use\n * `defineFrontendPublicConfigSchema` or a Zod object) — is refused at\n * projection, at `wildo config sync` and at hydration. It stays OPTIONAL in\n * this type on purpose: the same type describes a HYDRATED registry entry, and\n * a provider the service declares but whose code this bundle does not carry is\n * data-only and has no schema to hold. The three runtime refusals are the gate.\n */\n publicConfigSchema?: ProviderFrontendPublicConfigSchema;\n /**\n * The vendor's deployment model, processing regions and legal entity — the primitives a\n * processor register and a transfer statement are derived from.\n *\n * OPTIONAL, matching the backend contract, because a provider whose author has not stated them\n * must still load. Absent means the APPLICATION has to declare them on its own register entry,\n * where its contract with the vendor makes them checkable.\n *\n * Why a FRONTEND provider needs this at least as much as a backend one (#345): this module\n * executes in the DATA SUBJECT'S BROWSER. It loads third-party script, may set storage, and\n * talks to the vendor directly — the application's backend never sees the call. Product\n * analytics, error monitoring, a captcha and a payment element are precisely the third-party\n * recipients a privacy notice has to name, and the operator controls them LESS than a backend\n * provider routed through their own infrastructure.\n *\n * See `ProviderComplianceProfileSchema` for each field's meaning and for the refusal that a\n * `VENDOR_HOSTED` provider declaring no region cannot support a transfer statement.\n */\n complianceProfile?: ProviderComplianceProfile;\n /**\n * Consent purposes THIS VENDOR rests on beyond its capabilities' floor (#1702). DATA.\n *\n * ADDITIVE: the provider rests on the union of these and the floor\n * `PROVIDER_CAPABILITY_FRONTEND_CONSENT_CLASSIFICATION` gives each declared capability, so nothing\n * written here can lower what a capability requires. Declare it when the vendor's own processing goes\n * beyond the service the person asked for — Google reCAPTCHA is the measured case, a captcha whose\n * vendor also analyses the visitor for its own purposes — and leave it out otherwise. A consent-based\n * provider's SDK, scripts and components are all withheld until the person grants these.\n */\n consentPurposes?: ReadonlyArray<ConsentPurpose>;\n}\n/** @wildo_source:part:end external-connectors.app.frontend-provider-module */\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontend-app-provider-registry.types.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"frontend-app-provider-registry.types.js","sourceRoot":"","sources":["../../../src/app/frontend-app-provider-registry.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG","sourcesContent":["/**\n * `FrontendAppProviderRegistry` — composed frontend-app catalog.\n *\n * Mirrors `BackendProviderRegistry` but holds `FrontendAppProviderModule`\n * entries. Consumed at design-time by `defineSaasConfig.providers.frontendApp`\n * (Phase 3) and at runtime by `FrontendProviderRegistryFrontendService`\n * (Phase 6).\n *\n * Phase 0 ships the type only.\n */\n\nimport type { FrontendAppProviderModule } from './frontend-app-provider-module.types';\nimport type { ProviderCapability } from '@wildo-ai/saas-models/public-runtime';\n\nexport type FrontendAppProviderRef = string & {\n readonly __brand: 'FrontendAppProviderRef';\n};\n\nexport interface FrontendAppProviderRegistry {\n readonly modules: ReadonlyMap<FrontendAppProviderRef, FrontendAppProviderModule>;\n\n getProviderByRef(ref: FrontendAppProviderRef): FrontendAppProviderModule | undefined;\n\n getProvidersByProviderCapability(\n providerCapability: ProviderCapability,\n ): ReadonlyArray<FrontendAppProviderModule>;\n\n findProviderByProviderCapability(\n providerCapability: ProviderCapability,\n ): FrontendAppProviderModule | undefined;\n}\n"]}
|
package/dist/esm/app/index.d.ts
CHANGED
|
@@ -14,5 +14,6 @@ export * from '../shared/activate-frontend-provider-sdks';
|
|
|
14
14
|
export * from '../shared/load-frontend-provider-scripts';
|
|
15
15
|
export * from '../shared/frontend-provider-consent';
|
|
16
16
|
export * from '../shared/provider-component-registry';
|
|
17
|
+
export * from '../shared/frontend-provider-on-demand';
|
|
17
18
|
export * from '../providers/google-places/google-places.frontend-app.module';
|
|
18
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/app/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,sCAAsC,CAAC;AACrD,cAAc,wCAAwC,CAAC;AACvD,cAAc,kCAAkC,CAAC;AACjD,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sCAAsC,CAAC;AACrD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,0CAA0C,CAAC;AACzD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AAItD,cAAc,8DAA8D,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/app/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,sCAAsC,CAAC;AACrD,cAAc,wCAAwC,CAAC;AACvD,cAAc,kCAAkC,CAAC;AACjD,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sCAAsC,CAAC;AACrD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,0CAA0C,CAAC;AACzD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AAItD,cAAc,8DAA8D,CAAC"}
|
package/dist/esm/app/index.js
CHANGED
|
@@ -14,6 +14,7 @@ export * from '../shared/activate-frontend-provider-sdks.js';
|
|
|
14
14
|
export * from '../shared/load-frontend-provider-scripts.js';
|
|
15
15
|
export * from '../shared/frontend-provider-consent.js';
|
|
16
16
|
export * from '../shared/provider-component-registry.js';
|
|
17
|
+
export * from '../shared/frontend-provider-on-demand.js';
|
|
17
18
|
// Google Places' address-lookup constants (#561): the operation ids and the region-code limit its adapter, in the
|
|
18
19
|
// facet library, and the backend join test both read. The module has no other surface, so exporting it puts no
|
|
19
20
|
// second facet's code in this bundle.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/app/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,sCAAsC,CAAC;AACrD,cAAc,wCAAwC,CAAC;AACvD,cAAc,kCAAkC,CAAC;AACjD,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sCAAsC,CAAC;AACrD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,0CAA0C,CAAC;AACzD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,kHAAkH;AAClH,+GAA+G;AAC/G,sCAAsC;AACtC,cAAc,8DAA8D,CAAC","sourcesContent":["/**\n * Public surface of `@wildo-ai/external-connectors-public/app`.\n *\n * Browser-bound, no secrets. Phase 1 wires `composeFrontendAppProviders`.\n */\n\nexport * from './frontend-app-provider-module.types';\nexport * from './frontend-app-provider-registry.types';\nexport * from './compose-frontend-app-providers';\nexport * from './engine-frontend-app-provider-registry';\nexport * from './compose-hydrated-frontend-app-providers';\nexport * from '../shared/frontend-provider-surface.types';\nexport * from '../shared/hydrate-frontend-providers';\nexport * from '../shared/activate-frontend-provider-sdks';\nexport * from '../shared/load-frontend-provider-scripts';\nexport * from '../shared/frontend-provider-consent';\nexport * from '../shared/provider-component-registry';\nexport * from '../shared/frontend-provider-on-demand';\n// Google Places' address-lookup constants (#561): the operation ids and the region-code limit its adapter, in the\n// facet library, and the backend join test both read. The module has no other surface, so exporting it puts no\n// second facet's code in this bundle.\nexport * from '../providers/google-places/google-places.frontend-app.module';\n"]}
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
import { AppFrontendType, type ProviderFrontendCspFootprintDeclaration, type ProviderFrontendScriptDeclaration, type ProviderFrontendComponentDescriptor, type ProviderFrontendSdkDescriptor, type ProviderComplianceProfile, type ProviderMetadata } from '@wildo-ai/saas-models/public-runtime';
|
|
40
40
|
import { EngineCapability, type ProviderCompanionContribution, type RuntimeOwnerCompanionExports } from '@wildo-ai/saas-models';
|
|
41
41
|
import type { FileStorageAccepted } from '@wildo-ai/saas-models/public-runtime';
|
|
42
|
+
import { type ProviderFrontendSdkActivationMode } from './shared/frontend-provider-surface.types';
|
|
42
43
|
/**
|
|
43
44
|
* The engine slots a BROWSER module may fill: the ones whose work happens on the page.
|
|
44
45
|
*
|
|
@@ -75,6 +76,8 @@ interface FrontendProviderModuleShape {
|
|
|
75
76
|
sdk?: {
|
|
76
77
|
readonly descriptor: ProviderFrontendSdkDescriptor;
|
|
77
78
|
readonly stoppable?: true;
|
|
79
|
+
readonly activation?: ProviderFrontendSdkActivationMode;
|
|
80
|
+
readonly servesOnDemandContext?: unknown;
|
|
78
81
|
};
|
|
79
82
|
components?: Readonly<Record<string, ProviderFrontendComponentDescriptor & {
|
|
80
83
|
readonly load?: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companion-exports.d.ts","sourceRoot":"","sources":["../../src/companion-exports.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EACL,eAAe,EAIf,KAAK,uCAAuC,EAC5C,KAAK,iCAAiC,EACtC,KAAK,mCAAmC,EACxC,KAAK,6BAA6B,
|
|
1
|
+
{"version":3,"file":"companion-exports.d.ts","sourceRoot":"","sources":["../../src/companion-exports.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EACL,eAAe,EAIf,KAAK,uCAAuC,EAC5C,KAAK,iCAAiC,EACtC,KAAK,mCAAmC,EACxC,KAAK,6BAA6B,EAElC,KAAK,yBAAyB,EAC9B,KA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AAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACzC;AA+LD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mCAAmC,CACjD,MAAM,EAAE,2BAA2B,EACnC,WAAW,EAAE,eAAe,EAC5B,iBAAiB,EAAE,MAAM,GACxB,6BAA6B,CAuF/B;AAED,6FAA6F;AAC7F,eAAO,MAAM,sCAAsC,EAAE,6BAA6B,EAG/E,CAAC;AAEJ,iGAAiG;AACjG,eAAO,MAAM,0CAA0C,EAAE,6BAA6B,EAGnF,CAAC;AAEJ,uGAAuG;AACvG,eAAO,MAAM,0CAA0C,EAAE,6BAA6B,EAGnF,CAAC;AAEJ,sGAAsG;AACtG,eAAO,MAAM,mCAAmC,EAAE,6BAA6B,EAI9E,CAAC;AAEF;;;;GAIG;AACH,QAAA,MAAM,gBAAgB,EAAE,4BAEvB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -36,11 +36,12 @@
|
|
|
36
36
|
* remain the browser-shipped surface; this `./companion` subpath is
|
|
37
37
|
* tooling-only.
|
|
38
38
|
*/
|
|
39
|
-
import { AppFrontendType, normalizeProviderFrontendCspFootprint, } from '@wildo-ai/saas-models/public-runtime';
|
|
39
|
+
import { AppFrontendType, normalizeProviderFrontendCspFootprint, providerFrontendSdkVendorHostedScriptUrl, } from '@wildo-ai/saas-models/public-runtime';
|
|
40
40
|
import { EngineCapability, PROVIDER_CAPABILITY_TO_ENGINE_CAPABILITY, } from '@wildo-ai/saas-models';
|
|
41
|
-
import { admissibleFrontendPublicConfigKeys, normalizeConsentPurposes, readDeclaredPublicConfigKeys } from '@wildo-ai/saas-models/public-runtime';
|
|
41
|
+
import { admissibleFrontendPublicConfigKeys, normalizeConsentPurposes, readDeclaredPublicConfigKeys, readRequiredPublicConfigKeys } from '@wildo-ai/saas-models/public-runtime';
|
|
42
42
|
import { projectFrontendComponentDescriptors } from './shared/frontend-provider-surface.types.js';
|
|
43
|
-
import { consentBasedProviderStopRefusal, unclassifiedFrontendCapabilities, unknownProviderConsentPurposes } from './shared/frontend-provider-consent.js';
|
|
43
|
+
import { consentBasedProviderStopRefusal, consentPurposesRequiredByProvider, unclassifiedFrontendCapabilities, unknownProviderConsentPurposes } from './shared/frontend-provider-consent.js';
|
|
44
|
+
import { onDemandProviderSdkRefusal } from './shared/frontend-provider-on-demand.js';
|
|
44
45
|
import { EngineFrontendAppProviderRegistry } from './app/engine-frontend-app-provider-registry.js';
|
|
45
46
|
import { EngineFrontendTechdocProviderRegistry } from './techdoc/engine-frontend-techdoc-provider-registry.js';
|
|
46
47
|
import { EngineFrontendWebsiteProviderRegistry } from './website/engine-frontend-website-provider-registry.js';
|
|
@@ -73,8 +74,8 @@ export const BROWSER_FILLED_ENGINE_CAPABILITIES = new Set([
|
|
|
73
74
|
* backend discovery export and the runtime registry projection. Among the
|
|
74
75
|
* capabilities a browser may host, only `FRONTEND_ERROR_MONITORING` and
|
|
75
76
|
* `FRONTEND_PRODUCT_ANALYTICS` resolve to a slot; `SSO_OAUTH2`,
|
|
76
|
-
* `FRONTEND_SEARCH`, `FRONTEND_CAPTCHA`, `FRONTEND_FILE_PICKER
|
|
77
|
-
* `FRONTEND_ADDRESS_LOOKUP` are absent from the map, so those providers
|
|
77
|
+
* `FRONTEND_SEARCH`, `FRONTEND_CAPTCHA`, `FRONTEND_FILE_PICKER`,
|
|
78
|
+
* `FRONTEND_ADDRESS_LOOKUP` and `FRONTEND_CHAT_SIGN_IN_COMPLETION` are absent from the map, so those providers
|
|
78
79
|
* contribute no engine slot by construction. A slot outside
|
|
79
80
|
* {@link BROWSER_FILLED_ENGINE_CAPABILITIES} is refused (#1701).
|
|
80
81
|
*/
|
|
@@ -94,7 +95,9 @@ function deriveEngineCapabilities(ref, providerCapabilities) {
|
|
|
94
95
|
}
|
|
95
96
|
/**
|
|
96
97
|
* Refuses a provider whose declared `<script>` origin it did not also grant
|
|
97
|
-
* itself in `csp.scriptOrigins`.
|
|
98
|
+
* itself in `csp.scriptOrigins`. A vendor-hosted SDK loader is a script too,
|
|
99
|
+
* injected by `activate` rather than declared in `scripts`, and is held to the
|
|
100
|
+
* same rule.
|
|
98
101
|
*
|
|
99
102
|
* The three facet module types have carried this rule in prose since the fields
|
|
100
103
|
* landed, and prose is not a check. The failure it prevents is the worst shape
|
|
@@ -119,18 +122,23 @@ function deriveEngineCapabilities(ref, providerCapabilities) {
|
|
|
119
122
|
*/
|
|
120
123
|
function assertDeclaredScriptOriginsAreGranted(module) {
|
|
121
124
|
const declaredScriptOrigins = new Set(module.csp?.scriptOrigins ?? []);
|
|
122
|
-
|
|
125
|
+
const vendorHostedSdkScriptUrl = providerFrontendSdkVendorHostedScriptUrl(module.sdk?.descriptor);
|
|
126
|
+
const scriptSources = [
|
|
127
|
+
...(module.scripts ?? []).map((script) => script.src),
|
|
128
|
+
...(vendorHostedSdkScriptUrl === undefined ? [] : [vendorHostedSdkScriptUrl]),
|
|
129
|
+
];
|
|
130
|
+
for (const src of scriptSources) {
|
|
123
131
|
let origin;
|
|
124
132
|
try {
|
|
125
|
-
origin = new URL(
|
|
133
|
+
origin = new URL(src).origin;
|
|
126
134
|
}
|
|
127
135
|
catch {
|
|
128
136
|
throw new Error(`Frontend provider "${module.metadata.ref}" declares a script whose src is not an absolute URL: `
|
|
129
|
-
+ `"${
|
|
137
|
+
+ `"${src}". A script declaration names a third-party origin, so the framework can neither `
|
|
130
138
|
+ 'resolve it nor grant it in the composed Content-Security-Policy.');
|
|
131
139
|
}
|
|
132
140
|
if (!declaredScriptOrigins.has(origin)) {
|
|
133
|
-
throw new Error(`Frontend provider "${module.metadata.ref}" declares the script "${
|
|
141
|
+
throw new Error(`Frontend provider "${module.metadata.ref}" declares the script "${src}" but does not list `
|
|
134
142
|
+ `"${origin}" in csp.scriptOrigins. The policy this provider contributes to would then block its own `
|
|
135
143
|
+ 'script — and only where CSP enforces, so the failure would first appear in production. Add the '
|
|
136
144
|
+ 'origin to the provider\'s csp.scriptOrigins.');
|
|
@@ -177,11 +185,56 @@ function assertConsentClassificationIsComplete(module) {
|
|
|
177
185
|
* artifact nor a hand-written module list can start one either.
|
|
178
186
|
*/
|
|
179
187
|
function assertConsentBasedProviderIsStoppable(module) {
|
|
180
|
-
// assurance-control: WILDO.PRIVACY.
|
|
188
|
+
// assurance-control: WILDO.PRIVACY.CONSENT_ENFORCEMENT — a consent-based provider must be stoppable when consent is withdrawn
|
|
181
189
|
const refusal = consentBasedProviderStopRefusal(module.metadata.ref, module);
|
|
182
190
|
if (refusal !== undefined)
|
|
183
191
|
throw new Error(refusal);
|
|
184
192
|
}
|
|
193
|
+
/**
|
|
194
|
+
* Refuses a consent-based provider for the technical documentation (#1905): it could never start there.
|
|
195
|
+
*
|
|
196
|
+
* The documentation asks no one for consent. It has no consent surface of its own, and today it reads no signed-in
|
|
197
|
+
* reader's answer, so it starts every provider with no purpose granted (`activateFrontendProviderSdks` defaults the grant
|
|
198
|
+
* to none, and the docs runtime passes none), and a provider resting on a purpose never starts. That is the application's own
|
|
199
|
+
* rule for a person whose answer is not known (`ConsentBasedProviderSdksProvider`: "until preferences arrive nothing is
|
|
200
|
+
* granted, which is why pre-authentication pages start none"). The website differs because it asks: its consent
|
|
201
|
+
* gate (`useWebsiteConsent`) records the visitor's answer, and `useWebsiteProviderSdks` starts the consent-based group on it.
|
|
202
|
+
*
|
|
203
|
+
* So such a declaration would be a provider that silently never appears. Refused here, where the author is, rather
|
|
204
|
+
* than discovered as a missing widget. The remedy: scope the provider to the website or the application, where consent
|
|
205
|
+
* is asked.
|
|
206
|
+
*
|
|
207
|
+
* Rejected:
|
|
208
|
+
* - starting it on an assumed consent: fail open;
|
|
209
|
+
* - passing a signed-in reader's stored `privacy.consentedPurposes` through the docs auth session (the issue's first
|
|
210
|
+
* suggestion): the docs session carries no preferences today, so it needs a new claim or call, and it would still
|
|
211
|
+
* leave every signed-out reader of public docs ungranted, so the provider would run for some readers and silently not
|
|
212
|
+
* for others. No application declares a consent-based docs provider, so nothing needs it yet;
|
|
213
|
+
* - a consent banner on the documentation: a consent surface and its storage are a feature of their own.
|
|
214
|
+
* Either of the last two is a docs consent phase, and building one is what lifts this refusal.
|
|
215
|
+
*/
|
|
216
|
+
function assertConsentBasedProviderCanStartOnSurface(module, serviceType) {
|
|
217
|
+
if (serviceType !== AppFrontendType.TECH_DOC)
|
|
218
|
+
return;
|
|
219
|
+
// assurance-control: WILDO.PRIVACY.CONSENT_ENFORCEMENT — a consent-based provider is not declared where no consent is asked
|
|
220
|
+
const purposes = consentPurposesRequiredByProvider(module);
|
|
221
|
+
if (purposes.length === 0)
|
|
222
|
+
return;
|
|
223
|
+
throw new Error(`Frontend provider "${module.metadata.ref}" rests on consent (${purposes.join(', ')}) and is declared for the technical `
|
|
224
|
+
+ 'documentation, which asks no one for consent, so it would never start there. Declare it for the website or the '
|
|
225
|
+
+ 'application, where consent is asked.');
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Refuses a frontend provider that breaks the on-demand rule (#2790): an on-demand capability whose SDK the surface
|
|
229
|
+
* would start (so no flow's call reaches it), or an on-demand SDK serving no on-demand capability or with no
|
|
230
|
+
* predicate. Here, in the provider package's own `./companion` barrel, because that is what publish loads: the
|
|
231
|
+
* author meets it before the module ships rather than as a provider that is declared and never called.
|
|
232
|
+
*/
|
|
233
|
+
function assertOnDemandRuleIsKept(module) {
|
|
234
|
+
const refusal = onDemandProviderSdkRefusal(module.metadata.ref, module);
|
|
235
|
+
if (refusal !== undefined)
|
|
236
|
+
throw new Error(refusal);
|
|
237
|
+
}
|
|
185
238
|
/**
|
|
186
239
|
* Refuses a frontend provider that declares no `publicConfigSchema` whose keys can be read
|
|
187
240
|
* without running it (#1705).
|
|
@@ -236,7 +289,9 @@ export function projectFrontendProviderContribution(module, serviceType, runtime
|
|
|
236
289
|
assertDeclaredScriptOriginsAreGranted(module);
|
|
237
290
|
assertConsentClassificationIsComplete(module);
|
|
238
291
|
assertConsentBasedProviderIsStoppable(module);
|
|
292
|
+
assertConsentBasedProviderCanStartOnSurface(module, serviceType);
|
|
239
293
|
assertPublicConfigSchemaIsIntrospectable(module);
|
|
294
|
+
assertOnDemandRuleIsKept(module);
|
|
240
295
|
const frontendEntry = {
|
|
241
296
|
metadata: module.metadata,
|
|
242
297
|
providerCapabilities: [...module.providerCapabilities],
|
|
@@ -275,6 +330,11 @@ export function projectFrontendProviderContribution(module, serviceType, runtime
|
|
|
275
330
|
declaredKeys: readDeclaredPublicConfigKeys(module.publicConfigSchema),
|
|
276
331
|
providerCapabilities: module.providerCapabilities,
|
|
277
332
|
})?.slice(),
|
|
333
|
+
// The keys the module cannot run without, as DATA, so the CLI and the doctor can say a declared
|
|
334
|
+
// provider is not configured before any browser tries to start it. ALWAYS written, empty when the module
|
|
335
|
+
// requires nothing: an entry without the list is then recognisably one written before the check existed,
|
|
336
|
+
// never mistaken for "configured". The backend's fallback projection writes it the same way.
|
|
337
|
+
requiredPublicConfigKeys: [...readRequiredPublicConfigKeys(module.publicConfigSchema)],
|
|
278
338
|
// The z_file storage the picker fronts (#394 P5) — an enum member, so it
|
|
279
339
|
// crosses the wire as-is; the chooser filters on it and the hydration join
|
|
280
340
|
// compares it to the CODE side.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companion-exports.js","sourceRoot":"","sources":["../../../src/companion-exports.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EACL,eAAe,EAGf,qCAAqC,GAOtC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,gBAAgB,EAChB,wCAAwC,GAGzC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kCAAkC,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AAElJ,OAAO,EAAE,mCAAmC,EAAE,MAAM,0CAA0C,CAAC;AAC/F,OAAO,EAAE,+BAA+B,EAAE,gCAAgC,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,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for `@wildo-ai/external-connectors-public`.\n *\n * Surfaces the engine's three browser-safe frontend provider registries\n * (`EngineFrontendAppProviderRegistry`, `EngineFrontendTechdocProviderRegistry`,\n * `EngineFrontendWebsiteProviderRegistry`) as a single derived\n * `ProviderCompanionContribution[]`, one entry per registered module,\n * keyed to a frontend service-type via `serviceType` (closed\n * `AppFrontendType` enum).\n *\n * NOT auto-discovered — and this package is now the EXCEPTION rather than the rule,\n * which is the part to read carefully. `discoverSaasProviderCompanionContributions`\n * (platform-config-lib) walks each runtime owner declared in `wildo.saas.config.ts`\n * AND every provider package it depends on, admitting the scraped catalogue,\n * `@wildo-ai/provider-*` and — since #358 — the engine's BACKEND connector package\n * `@wildo-ai/external-connectors-private` by exact name. It does not admit this one.\n * So these arrays reach a generated `provider-catalog.types.ts` / runtime artifact\n * only when an app's frontend `provider-contributions.ts` re-derives them from the\n * same registries — which is exactly the dogfood pattern: Wonder Todos's `app` /\n * `website` `provider-contributions.ts` map `EngineFrontend*ProviderRegistry.modules`\n * and add app-owned entries (e.g. its file-picker provider).\n *\n * A `frontendService` target additionally requires a `frontendEntry` payload for\n * bootstrap materialization, which the discovery validator refuses without — so the\n * frontend case is not merely un-admitted, it carries a payload the backend case\n * has no equivalent of. Admitting this package would have to answer that first.\n *\n * (This paragraph used to end \"Wiring the discovery walker to load engine connector\n * packages directly is a tracked follow-up, not the current contract.\" Half of that\n * shipped in #358 and the sentence did not distinguish the two packages, so it read\n * as false about the backend and true here.)\n *\n * NOT for browser consumption. This module is loaded only by Node-side\n * tooling (`wildo config sync` and the `discoverSaasProviderCompanionContributions`\n * walker). The package's `./app`, `./techdoc`, `./website` subpaths\n * remain the browser-shipped surface; this `./companion` subpath is\n * tooling-only.\n */\n\nimport {\n AppFrontendType,\n type BuiltinProviderCapability,\n type FrontendProviderEntry,\n normalizeProviderFrontendCspFootprint,\n type ProviderFrontendCspFootprintDeclaration,\n type ProviderFrontendScriptDeclaration,\n type ProviderFrontendComponentDescriptor,\n type ProviderFrontendSdkDescriptor,\n type ProviderComplianceProfile,\n type ProviderMetadata,\n} from '@wildo-ai/saas-models/public-runtime';\nimport {\n EngineCapability,\n PROVIDER_CAPABILITY_TO_ENGINE_CAPABILITY,\n type ProviderCompanionContribution,\n type RuntimeOwnerCompanionExports,\n} from '@wildo-ai/saas-models';\nimport { admissibleFrontendPublicConfigKeys, normalizeConsentPurposes, readDeclaredPublicConfigKeys } from '@wildo-ai/saas-models/public-runtime';\nimport type { FileStorageAccepted } from '@wildo-ai/saas-models/public-runtime';\nimport { projectFrontendComponentDescriptors } from './shared/frontend-provider-surface.types';\nimport { consentBasedProviderStopRefusal, unclassifiedFrontendCapabilities, unknownProviderConsentPurposes } from './shared/frontend-provider-consent';\nimport { EngineFrontendAppProviderRegistry } from './app/engine-frontend-app-provider-registry';\nimport { EngineFrontendTechdocProviderRegistry } from './techdoc/engine-frontend-techdoc-provider-registry';\nimport { EngineFrontendWebsiteProviderRegistry } from './website/engine-frontend-website-provider-registry';\n\nconst APP_RUNTIME_IMPORT_PATH = '@wildo-ai/external-connectors-public/app';\nconst TECHDOC_RUNTIME_IMPORT_PATH = '@wildo-ai/external-connectors-public/techdoc';\nconst WEBSITE_RUNTIME_IMPORT_PATH = '@wildo-ai/external-connectors-public/website';\n\n/**\n * The engine slots a BROWSER module may fill: the ones whose work happens on the page.\n *\n * Every other slot (billing, mail, LLM, audit…) is served by a backend part. A frontend contribution\n * used to derive `BILLING` from the Stripe module, which loaded no Stripe code, so the catalogue read\n * the browser as covering the billing slot the backend `stripe` part fills (#1701). The consent\n * classification now refuses `BILLING` on a frontend module, and this set is the second, independent\n * statement: whatever a browser-hosted capability ever maps to, a contribution PROJECTED by\n * `projectFrontendProviderContribution` carries only these slots, and a mapping to any other one is\n * refused there instead of advertised. Today the consent classification refuses first, so the join\n * between the two tables is pinned by a test over both, not by this throw; the throw is what holds if\n * a browser-hosted capability is ever mapped to a backend slot. A hand-written contribution does not\n * pass through here.\n */\nexport const BROWSER_FILLED_ENGINE_CAPABILITIES: ReadonlySet<EngineCapability> = new Set([\n EngineCapability.FRONTEND_ERROR_MONITORING,\n EngineCapability.FRONTEND_PRODUCT_ANALYTICS,\n]);\n\n/**\n * Projects a frontend provider's declared capabilities onto the engine\n * slots it fills, using the canonical\n * `PROVIDER_CAPABILITY_TO_ENGINE_CAPABILITY` map from\n * `@wildo-ai/saas-models` — the single source of truth shared with the\n * backend discovery export and the runtime registry projection. Among the\n * capabilities a browser may host, only `FRONTEND_ERROR_MONITORING` and\n * `FRONTEND_PRODUCT_ANALYTICS` resolve to a slot; `SSO_OAUTH2`,\n * `FRONTEND_SEARCH`, `FRONTEND_CAPTCHA`, `FRONTEND_FILE_PICKER` and\n * `FRONTEND_ADDRESS_LOOKUP` are absent from the map, so those providers\n * contribute no engine slot by construction. A slot outside\n * {@link BROWSER_FILLED_ENGINE_CAPABILITIES} is refused (#1701).\n */\nfunction deriveEngineCapabilities(\n ref: string,\n providerCapabilities: ReadonlyArray<string>,\n): EngineCapability[] {\n const slots = new Set<EngineCapability>();\n for (const cap of providerCapabilities) {\n const slot = PROVIDER_CAPABILITY_TO_ENGINE_CAPABILITY[cap as BuiltinProviderCapability];\n if (!slot) continue;\n if (!BROWSER_FILLED_ENGINE_CAPABILITIES.has(slot)) {\n throw new Error(\n `Frontend provider \"${ref}\" declares \"${cap}\", which fills the backend engine slot \"${slot}\". A browser module `\n + 'fills only a slot whose work happens on the page; the backend part of the same vendor fills this one.',\n );\n }\n slots.add(slot);\n }\n return Array.from(slots);\n}\n\n/**\n * The facet-agnostic view of a frontend provider module this projection reads.\n *\n * Only the DATA half appears here, and that is the contract rather than an\n * omission: this file is loaded by NODE-side tooling (`wildo config sync` and\n * the discovery walker), which cannot execute a browser-bound module's\n * `sdk.activate` and must never try. What it CAN read is the descriptor beside\n * it — which package the SDK lives in — and that is what the bundle-isolation\n * policy, an application's dependency alignment and a human reading a bundle\n * report need.\n */\ninterface FrontendProviderModuleShape {\n metadata: ProviderMetadata;\n providerCapabilities: ReadonlyArray<string>;\n protocols: ReadonlyArray<string>;\n publicConfig?: Readonly<Record<string, unknown>>;\n csp?: ProviderFrontendCspFootprintDeclaration;\n scripts?: ReadonlyArray<ProviderFrontendScriptDeclaration>;\n sdk?: { readonly descriptor: ProviderFrontendSdkDescriptor; readonly stoppable?: true };\n components?: Readonly<Record<string, ProviderFrontendComponentDescriptor & { readonly load?: unknown }>>;\n fileStorage?: FileStorageAccepted;\n publicConfigSchema?: unknown;\n complianceProfile?: ProviderComplianceProfile;\n consentPurposes?: ReadonlyArray<string>;\n}\n\n/**\n * Refuses a provider whose declared `<script>` origin it did not also grant\n * itself in `csp.scriptOrigins`.\n *\n * The three facet module types have carried this rule in prose since the fields\n * landed, and prose is not a check. The failure it prevents is the worst shape\n * this surface has: the provider ships, the script tag is injected, the composed\n * policy does not admit its origin, and the browser refuses it — in PRODUCTION\n * ONLY, because development is report-only. The provider looks configured, the\n * page looks fine locally, and the capability is simply absent for real users.\n *\n * Absolute rather than conditional on the application's own policy, and that is\n * the point: a provider cannot know whether the application it lands in\n * happens to allow-list its vendor, and relying on that is exactly the\n * hand-editing per app, per service, per environment that declaring a footprint\n * exists to remove. Restating an origin the app would have allowed anyway costs\n * nothing — CSP source lists are a union.\n *\n * Thrown, not reported, and only HERE. This runs where the author is: in the\n * provider package's own `./companion` barrel and in the CLI's discovery walk,\n * so `wildo config sync` fails with the provider, the script and the missing\n * origin named. The backend's fallback projection deliberately does NOT repeat\n * it — refusing there would take an application's boot down for a provider\n * authoring mistake, long after the person who could fix it has gone.\n */\nfunction assertDeclaredScriptOriginsAreGranted(module: FrontendProviderModuleShape): void {\n const declaredScriptOrigins = new Set(module.csp?.scriptOrigins ?? []);\n\n for (const script of module.scripts ?? []) {\n let origin: string;\n try {\n origin = new URL(script.src).origin;\n } catch {\n throw new Error(\n `Frontend provider \"${module.metadata.ref}\" declares a script whose src is not an absolute URL: `\n + `\"${script.src}\". A script declaration names a third-party origin, so the framework can neither `\n + 'resolve it nor grant it in the composed Content-Security-Policy.',\n );\n }\n\n if (!declaredScriptOrigins.has(origin)) {\n throw new Error(\n `Frontend provider \"${module.metadata.ref}\" declares the script \"${script.src}\" but does not list `\n + `\"${origin}\" in csp.scriptOrigins. The policy this provider contributes to would then block its own `\n + 'script — and only where CSP enforces, so the failure would first appear in production. Add the '\n + 'origin to the provider\\'s csp.scriptOrigins.',\n );\n }\n }\n}\n\n/**\n * Refuses a frontend provider whose consent classification is incomplete (#1702).\n *\n * Two shapes, both of which used to start the provider without consent and say nothing:\n *\n * - a capability no browser may host — anything `PROVIDER_CAPABILITY_FRONTEND_CONSENT_CLASSIFICATION`\n * marks `browserHosted: false`, or a string that is no capability at all. The consent table used to be\n * total only over `FRONTEND_*`-named members and treated every other capability as needing no\n * consent, so a vendor declaring, say, `LLM_CHAT` on its frontend module fell through unclassified;\n * - a module-level `consentPurposes` entry that is not a `ConsentPurpose`. Normalization would DROP\n * it, and a dropped purpose on an additive field is a lowered floor.\n *\n * Thrown here, where the author is, for the reason `assertDeclaredScriptOriginsAreGranted` gives. The\n * browser runners do not rely on it: they refuse to start such a provider on their own (fail closed), so\n * an entry that bypassed this projection is withheld rather than started.\n */\nfunction assertConsentClassificationIsComplete(module: FrontendProviderModuleShape): void {\n const unclassified = unclassifiedFrontendCapabilities(module);\n if (unclassified.length > 0) {\n throw new Error(\n `Frontend provider \"${module.metadata.ref}\" declares ${unclassified.map((capability) => `\"${capability}\"`).join(', ')}, `\n + 'which has no browser consent classification — no browser surface may host it. A frontend module may '\n + 'declare only capabilities PROVIDER_CAPABILITY_FRONTEND_CONSENT_CLASSIFICATION marks browserHosted; '\n + 'classify a new one there (deciding which consent purposes it rests on) before a frontend module declares it.',\n );\n }\n const unknownPurposes = unknownProviderConsentPurposes(module);\n if (unknownPurposes.length > 0) {\n throw new Error(\n `Frontend provider \"${module.metadata.ref}\" declares consentPurposes ${unknownPurposes.map((purpose) => `\"${purpose}\"`).join(', ')}, `\n + 'which are not members of ConsentPurpose. They would be dropped on the way to the browser, lowering what '\n + 'the provider was meant to rest on.',\n );\n }\n}\n\n/**\n * Refuses a CONSENT-BASED frontend provider that a withdrawal could not stop (#1704): one that injects\n * `<script>` tags, or whose SDK does not declare `stoppable`. The earliest of five applications of the same\n * predicate (`consentBasedProviderStopRefusal`), in the provider package's own `./companion` barrel where\n * the author is; hydration withholds the provider's code and scripts, the SDK runner refuses to start it,\n * the startup script collector skips it and the component registry does not register it, so neither a stale\n * artifact nor a hand-written module list can start one either.\n */\nfunction assertConsentBasedProviderIsStoppable(module: FrontendProviderModuleShape): void {\n // assurance-control: WILDO.PRIVACY.CONSENT_RECORD — a consent-based provider must be stoppable when consent is withdrawn\n const refusal = consentBasedProviderStopRefusal(module.metadata.ref, module);\n if (refusal !== undefined) throw new Error(refusal);\n}\n\n/**\n * Refuses a frontend provider that declares no `publicConfigSchema` whose keys can be read\n * without running it (#1705).\n *\n * Without that list nothing can hold what the provider is served to a set of keys, and \"admit\n * everything\" was the answer: 8 of the 13 engine modules declared none, including the two that run\n * vendor code (PostHog, Sentry), so any key — a secret under an innocent name included — passed\n * through to every browser. The overlay at `wildo config sync` refuses the same absence on the entry\n * (`SCHEMA_NOT_INTROSPECTABLE`) and hydration refuses it on the code module; this is the earliest of\n * the three, in the provider package's own `./companion` barrel, where the author is.\n *\n * Checked on the module's authored `publicConfig` too: a module whose own defaults carry a key its\n * schema does not declare would fail its own schema at hydration and run none of its code.\n */\nfunction assertPublicConfigSchemaIsIntrospectable(module: FrontendProviderModuleShape): void {\n // assurance-control: WILDO.SECURITY.FAIL_CLOSED — a frontend provider with no readable key list is not projected\n const declared = readDeclaredPublicConfigKeys(module.publicConfigSchema);\n if (declared === undefined) {\n throw new Error(\n `Frontend provider \"${module.metadata.ref}\" declares no publicConfigSchema whose keys can be read without running `\n + 'it. Its publicConfig is served to every browser, and without a declared key list nothing can refuse a key it '\n + 'never reads — a secret under an innocent name included. Declare one with `defineFrontendPublicConfigSchema` '\n + '(or a Zod object) listing every key its publicConfig carries.',\n );\n }\n const admissible = new Set(admissibleFrontendPublicConfigKeys({ declaredKeys: declared, providerCapabilities: module.providerCapabilities }));\n const undeclared = Object.keys(module.publicConfig ?? {}).filter((key) => !admissible.has(key));\n if (undeclared.length > 0) {\n throw new Error(\n `Frontend provider \"${module.metadata.ref}\" authors publicConfig ${undeclared.map((key) => `\"${key}\"`).join(', ')}, `\n + 'which its own publicConfigSchema does not declare. Declare the key, or remove it.',\n );\n }\n}\n\n/**\n * Turns a frontend provider module into the companion contribution tooling\n * reads — the ONE place a facet module becomes a discovery record.\n *\n * Exported because the engine is not the only producer. Every\n * `@wildo-ai/provider-<ref>` package's own `./companion` barrel has to do\n * exactly this for its own facet modules, and a projection each package\n * hand-rolls is a projection that drifts: the DATA half of the frontend\n * surface would end up carried by some packages and dropped by others, and a\n * dropped CSP footprint is invisible until a provider is blocked in production.\n *\n * What crosses and what does not is the whole contract. `csp`, `scripts`, the\n * SDK DESCRIPTOR and the `complianceProfile` cross, because tooling has to read\n * them without executing anything — this runs in Node and a facet module is browser-bound. The\n * executable half — `sdk.activate`, `publicConfigSchema` — does NOT, and cannot:\n * the contribution is serialized to JSON on its way into the generated\n * artifact, so a function would be dropped by `JSON.stringify` with no error\n * anywhere. Code reaches a bundle through the generated\n * `frontend-providers.generated.ts` instead.\n */\nexport function projectFrontendProviderContribution(\n module: FrontendProviderModuleShape,\n serviceType: AppFrontendType,\n runtimeImportPath: string,\n): ProviderCompanionContribution {\n assertDeclaredScriptOriginsAreGranted(module);\n assertConsentClassificationIsComplete(module);\n assertConsentBasedProviderIsStoppable(module);\n assertPublicConfigSchemaIsIntrospectable(module);\n\n const frontendEntry: FrontendProviderEntry = {\n metadata: module.metadata,\n providerCapabilities: [...module.providerCapabilities],\n protocols: [...module.protocols],\n publicConfig: module.publicConfig,\n // The DATA half of the frontend surface (#332). It has to travel with the\n // contribution because the CSP of a service is composed by the CLI, from\n // the materialized artifact, long before any browser loads the module that\n // declares it — and the CLI cannot execute that module to ask.\n // Normalized here, once: a provider AUTHORS the buckets it reaches and the\n // wire carries all of them, so the CSP composer never branches on absence\n // and the hydration join compares two shapes of the same kind.\n csp: module.csp === undefined ? undefined : normalizeProviderFrontendCspFootprint(module.csp),\n scripts: module.scripts === undefined ? undefined : [...module.scripts],\n sdk: module.sdk?.descriptor,\n // The DATA half of each contributed component (#380). `load` is stripped\n // HERE rather than left to `JSON.stringify` to drop it: a function that\n // disappears silently on its way through a serializer is the failure this\n // whole two-channel split exists to remove, and stripping it explicitly is\n // what makes the projection's contract readable at the projection.\n //\n // Rebuilt field by field rather than spread-minus-`load`, so a future field\n // on the declaration is a COMPILE decision about whether it crosses the wire\n // instead of one that crosses by default. `sdk` makes the same choice by\n // naming `descriptor`; this is the same rule where the shape is a map.\n components: projectFrontendComponentDescriptors(module.components),\n // The keys the module's `publicConfigSchema` declares, as DATA (#394 P3).\n // The schema itself is CODE and stays behind; this list is what lets\n // `wildo config sync` refuse an application-supplied key the module never\n // reads, at the moment it is typed rather than when a picker opens.\n // UNION with the keys the module's own CAPABILITIES own (#380). A picker\n // declaring `appId` still reads `maxFileSizeMb`, because the framework reads\n // it on the picker's behalf — so a list built from the provider's schema\n // alone refuses the capability's whole vocabulary at the moment it is typed.\n publicConfigKeys: admissibleFrontendPublicConfigKeys({\n declaredKeys: readDeclaredPublicConfigKeys(module.publicConfigSchema),\n providerCapabilities: module.providerCapabilities,\n })?.slice(),\n // The z_file storage the picker fronts (#394 P5) — an enum member, so it\n // crosses the wire as-is; the chooser filters on it and the hydration join\n // compares it to the CODE side.\n fileStorage: module.fileStorage,\n // WHO runs the vendor, WHERE it processes and WHICH legal entity stands behind it (#1743).\n // Every engine facet module has declared this since #345 and this projection used to leave it\n // behind — so the browser vendors a privacy notice most needs to name (reCAPTCHA,\n // Sentry, the Drive/OneDrive/Dropbox pickers) reached no compliance reader at all. Pure DATA,\n // like `csp`, so it crosses as-is and lands in the per-service `frontendProviderBootstraps` of\n // the generated artifact, which is where `listServedFrontendProviderCompliance` reads it.\n complianceProfile: module.complianceProfile,\n // The vendor's purposes BEYOND its capabilities' floor (#1702). DATA, because the browser decides\n // on the hydrated module, whose consent inputs come from this entry — a purpose left behind here\n // would reach no gate. Normalized once; absent stays absent so \"adds nothing\" keeps one spelling.\n consentPurposes: module.consentPurposes === undefined || module.consentPurposes.length === 0\n ? undefined\n : normalizeConsentPurposes(module.consentPurposes),\n };\n return {\n ref: module.metadata.ref,\n identity: {\n packageName: module.metadata.packageName,\n tier: module.metadata.tier,\n vendor: module.metadata.vendor,\n origin: module.metadata.origin,\n },\n runtimeImportPath,\n runtimeTargets: [{ kind: 'frontendService', serviceType }],\n engineCapabilities: deriveEngineCapabilities(module.metadata.ref, module.providerCapabilities),\n providerCapabilities: [...module.providerCapabilities],\n protocols: [...module.protocols],\n // Browser-safe providers cannot own server secrets. The explicit empty\n // shape is authoritative and distinct from an unknown/missing contract.\n secretsContractShape: [],\n frontendEntry,\n };\n}\n\n/** One contribution per `EngineFrontendAppProviderRegistry` module, targeting `SAAS_APP`. */\nexport const engineFrontendAppProviderContributions: ProviderCompanionContribution[] =\n Array.from(EngineFrontendAppProviderRegistry.modules.values()).map((module) =>\n projectFrontendProviderContribution(module, AppFrontendType.SAAS_APP, APP_RUNTIME_IMPORT_PATH),\n );\n\n/** One contribution per `EngineFrontendTechdocProviderRegistry` module, targeting `TECH_DOC`. */\nexport const engineFrontendTechdocProviderContributions: ProviderCompanionContribution[] =\n Array.from(EngineFrontendTechdocProviderRegistry.modules.values()).map((module) =>\n projectFrontendProviderContribution(module, AppFrontendType.TECH_DOC, TECHDOC_RUNTIME_IMPORT_PATH),\n );\n\n/** One contribution per `EngineFrontendWebsiteProviderRegistry` module, targeting `STATIC_WEBSITE`. */\nexport const engineFrontendWebsiteProviderContributions: ProviderCompanionContribution[] =\n Array.from(EngineFrontendWebsiteProviderRegistry.modules.values()).map((module) =>\n projectFrontendProviderContribution(module, AppFrontendType.STATIC_WEBSITE, WEBSITE_RUNTIME_IMPORT_PATH),\n );\n\n/** Stable union — order: app providers, then techdoc, then website (matches the registry imports). */\nexport const engineFrontendProviderContributions: ProviderCompanionContribution[] = [\n ...engineFrontendAppProviderContributions,\n ...engineFrontendTechdocProviderContributions,\n ...engineFrontendWebsiteProviderContributions,\n];\n\n/**\n * Companion-discovery contract — see `RuntimeOwnerCompanionExports`.\n * The framework loader reads `providerContributions` via the package's\n * `./companion` subpath export.\n */\nconst companionExports: RuntimeOwnerCompanionExports = {\n providerContributions: engineFrontendProviderContributions,\n};\n\nexport default companionExports;\n"]}
|
|
1
|
+
{"version":3,"file":"companion-exports.js","sourceRoot":"","sources":["../../src/companion-exports.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EACL,eAAe,EAGf,qCAAqC,EAKrC,wCAAwC,GAGzC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,gBAAgB,EAChB,wCAAwC,GAGzC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kCAAkC,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AAEhL,OAAO,EAAE,mCAAmC,EAA0C,MAAM,0CAA0C,CAAC;AACvI,OAAO,EAAE,+BAA+B,EAAE,iCAAiC,EAAE,gCAAgC,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AAC1L,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,iCAAiC,EAAE,MAAM,6CAA6C,CAAC;AAChG,OAAO,EAAE,qCAAqC,EAAE,MAAM,qDAAqD,CAAC;AAC5G,OAAO,EAAE,qCAAqC,EAAE,MAAM,qDAAqD,CAAC;AAE5G,MAAM,uBAAuB,GAAG,0CAA0C,CAAC;AAC3E,MAAM,2BAA2B,GAAG,8CAA8C,CAAC;AACnF,MAAM,2BAA2B,GAAG,8CAA8C,CAAC;AAEnF;;;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,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAC5E,mCAAmC,CAAC,MAAM,EAAE,eAAe,CAAC,QAAQ,EAAE,uBAAuB,CAAC,CAC/F,CAAC;AAEJ,iGAAiG;AACjG,MAAM,CAAC,MAAM,0CAA0C,GACrD,KAAK,CAAC,IAAI,CAAC,qCAAqC,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAChF,mCAAmC,CAAC,MAAM,EAAE,eAAe,CAAC,QAAQ,EAAE,2BAA2B,CAAC,CACnG,CAAC;AAEJ,uGAAuG;AACvG,MAAM,CAAC,MAAM,0CAA0C,GACrD,KAAK,CAAC,IAAI,CAAC,qCAAqC,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAChF,mCAAmC,CAAC,MAAM,EAAE,eAAe,CAAC,cAAc,EAAE,2BAA2B,CAAC,CACzG,CAAC;AAEJ,sGAAsG;AACtG,MAAM,CAAC,MAAM,mCAAmC,GAAoC;IAClF,GAAG,sCAAsC;IACzC,GAAG,0CAA0C;IAC7C,GAAG,0CAA0C;CAC9C,CAAC;AAEF;;;;GAIG;AACH,MAAM,gBAAgB,GAAiC;IACrD,qBAAqB,EAAE,mCAAmC;CAC3D,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["/**\n * Companion-discovery export for `@wildo-ai/external-connectors-public`.\n *\n * Surfaces the engine's three browser-safe frontend provider registries\n * (`EngineFrontendAppProviderRegistry`, `EngineFrontendTechdocProviderRegistry`,\n * `EngineFrontendWebsiteProviderRegistry`) as a single derived\n * `ProviderCompanionContribution[]`, one entry per registered module,\n * keyed to a frontend service-type via `serviceType` (closed\n * `AppFrontendType` enum).\n *\n * NOT auto-discovered — and this package is now the EXCEPTION rather than the rule,\n * which is the part to read carefully. `discoverSaasProviderCompanionContributions`\n * (platform-config-lib) walks each runtime owner declared in `wildo.saas.config.ts`\n * AND every provider package it depends on, admitting the scraped catalogue,\n * `@wildo-ai/provider-*` and — since #358 — the engine's BACKEND connector package\n * `@wildo-ai/external-connectors-private` by exact name. It does not admit this one.\n * So these arrays reach a generated `provider-catalog.types.ts` / runtime artifact\n * only when an app's frontend `provider-contributions.ts` re-derives them from the\n * same registries — which is exactly the dogfood pattern: Wonder Todos's `app` /\n * `website` `provider-contributions.ts` map `EngineFrontend*ProviderRegistry.modules`\n * and add app-owned entries (e.g. its file-picker provider).\n *\n * A `frontendService` target additionally requires a `frontendEntry` payload for\n * bootstrap materialization, which the discovery validator refuses without — so the\n * frontend case is not merely un-admitted, it carries a payload the backend case\n * has no equivalent of. Admitting this package would have to answer that first.\n *\n * (This paragraph used to end \"Wiring the discovery walker to load engine connector\n * packages directly is a tracked follow-up, not the current contract.\" Half of that\n * shipped in #358 and the sentence did not distinguish the two packages, so it read\n * as false about the backend and true here.)\n *\n * NOT for browser consumption. This module is loaded only by Node-side\n * tooling (`wildo config sync` and the `discoverSaasProviderCompanionContributions`\n * walker). The package's `./app`, `./techdoc`, `./website` subpaths\n * remain the browser-shipped surface; this `./companion` subpath is\n * tooling-only.\n */\n\nimport {\n AppFrontendType,\n type BuiltinProviderCapability,\n type FrontendProviderEntry,\n normalizeProviderFrontendCspFootprint,\n type ProviderFrontendCspFootprintDeclaration,\n type ProviderFrontendScriptDeclaration,\n type ProviderFrontendComponentDescriptor,\n type ProviderFrontendSdkDescriptor,\n providerFrontendSdkVendorHostedScriptUrl,\n type ProviderComplianceProfile,\n type ProviderMetadata,\n} from '@wildo-ai/saas-models/public-runtime';\nimport {\n EngineCapability,\n PROVIDER_CAPABILITY_TO_ENGINE_CAPABILITY,\n type ProviderCompanionContribution,\n type RuntimeOwnerCompanionExports,\n} from '@wildo-ai/saas-models';\nimport { admissibleFrontendPublicConfigKeys, normalizeConsentPurposes, readDeclaredPublicConfigKeys, readRequiredPublicConfigKeys } from '@wildo-ai/saas-models/public-runtime';\nimport type { FileStorageAccepted } from '@wildo-ai/saas-models/public-runtime';\nimport { projectFrontendComponentDescriptors, type ProviderFrontendSdkActivationMode } from './shared/frontend-provider-surface.types';\nimport { consentBasedProviderStopRefusal, consentPurposesRequiredByProvider, unclassifiedFrontendCapabilities, unknownProviderConsentPurposes } from './shared/frontend-provider-consent';\nimport { onDemandProviderSdkRefusal } from './shared/frontend-provider-on-demand';\nimport { EngineFrontendAppProviderRegistry } from './app/engine-frontend-app-provider-registry';\nimport { EngineFrontendTechdocProviderRegistry } from './techdoc/engine-frontend-techdoc-provider-registry';\nimport { EngineFrontendWebsiteProviderRegistry } from './website/engine-frontend-website-provider-registry';\n\nconst APP_RUNTIME_IMPORT_PATH = '@wildo-ai/external-connectors-public/app';\nconst TECHDOC_RUNTIME_IMPORT_PATH = '@wildo-ai/external-connectors-public/techdoc';\nconst WEBSITE_RUNTIME_IMPORT_PATH = '@wildo-ai/external-connectors-public/website';\n\n/**\n * The engine slots a BROWSER module may fill: the ones whose work happens on the page.\n *\n * Every other slot (billing, mail, LLM, audit…) is served by a backend part. A frontend contribution\n * used to derive `BILLING` from the Stripe module, which loaded no Stripe code, so the catalogue read\n * the browser as covering the billing slot the backend `stripe` part fills (#1701). The consent\n * classification now refuses `BILLING` on a frontend module, and this set is the second, independent\n * statement: whatever a browser-hosted capability ever maps to, a contribution PROJECTED by\n * `projectFrontendProviderContribution` carries only these slots, and a mapping to any other one is\n * refused there instead of advertised. Today the consent classification refuses first, so the join\n * between the two tables is pinned by a test over both, not by this throw; the throw is what holds if\n * a browser-hosted capability is ever mapped to a backend slot. A hand-written contribution does not\n * pass through here.\n */\nexport const BROWSER_FILLED_ENGINE_CAPABILITIES: ReadonlySet<EngineCapability> = new Set([\n EngineCapability.FRONTEND_ERROR_MONITORING,\n EngineCapability.FRONTEND_PRODUCT_ANALYTICS,\n]);\n\n/**\n * Projects a frontend provider's declared capabilities onto the engine\n * slots it fills, using the canonical\n * `PROVIDER_CAPABILITY_TO_ENGINE_CAPABILITY` map from\n * `@wildo-ai/saas-models` — the single source of truth shared with the\n * backend discovery export and the runtime registry projection. Among the\n * capabilities a browser may host, only `FRONTEND_ERROR_MONITORING` and\n * `FRONTEND_PRODUCT_ANALYTICS` resolve to a slot; `SSO_OAUTH2`,\n * `FRONTEND_SEARCH`, `FRONTEND_CAPTCHA`, `FRONTEND_FILE_PICKER`,\n * `FRONTEND_ADDRESS_LOOKUP` and `FRONTEND_CHAT_SIGN_IN_COMPLETION` are absent from the map, so those providers\n * contribute no engine slot by construction. A slot outside\n * {@link BROWSER_FILLED_ENGINE_CAPABILITIES} is refused (#1701).\n */\nfunction deriveEngineCapabilities(\n ref: string,\n providerCapabilities: ReadonlyArray<string>,\n): EngineCapability[] {\n const slots = new Set<EngineCapability>();\n for (const cap of providerCapabilities) {\n const slot = PROVIDER_CAPABILITY_TO_ENGINE_CAPABILITY[cap as BuiltinProviderCapability];\n if (!slot) continue;\n if (!BROWSER_FILLED_ENGINE_CAPABILITIES.has(slot)) {\n throw new Error(\n `Frontend provider \"${ref}\" declares \"${cap}\", which fills the backend engine slot \"${slot}\". A browser module `\n + 'fills only a slot whose work happens on the page; the backend part of the same vendor fills this one.',\n );\n }\n slots.add(slot);\n }\n return Array.from(slots);\n}\n\n/**\n * The facet-agnostic view of a frontend provider module this projection reads.\n *\n * Only the DATA half appears here, and that is the contract rather than an\n * omission: this file is loaded by NODE-side tooling (`wildo config sync` and\n * the discovery walker), which cannot execute a browser-bound module's\n * `sdk.activate` and must never try. What it CAN read is the descriptor beside\n * it — which package the SDK lives in — and that is what the bundle-isolation\n * policy, an application's dependency alignment and a human reading a bundle\n * report need.\n */\ninterface FrontendProviderModuleShape {\n metadata: ProviderMetadata;\n providerCapabilities: ReadonlyArray<string>;\n protocols: ReadonlyArray<string>;\n publicConfig?: Readonly<Record<string, unknown>>;\n csp?: ProviderFrontendCspFootprintDeclaration;\n scripts?: ReadonlyArray<ProviderFrontendScriptDeclaration>;\n sdk?: {\n readonly descriptor: ProviderFrontendSdkDescriptor;\n readonly stoppable?: true;\n readonly activation?: ProviderFrontendSdkActivationMode;\n readonly servesOnDemandContext?: unknown;\n };\n components?: Readonly<Record<string, ProviderFrontendComponentDescriptor & { readonly load?: unknown }>>;\n fileStorage?: FileStorageAccepted;\n publicConfigSchema?: unknown;\n complianceProfile?: ProviderComplianceProfile;\n consentPurposes?: ReadonlyArray<string>;\n}\n\n/**\n * Refuses a provider whose declared `<script>` origin it did not also grant\n * itself in `csp.scriptOrigins`. A vendor-hosted SDK loader is a script too,\n * injected by `activate` rather than declared in `scripts`, and is held to the\n * same rule.\n *\n * The three facet module types have carried this rule in prose since the fields\n * landed, and prose is not a check. The failure it prevents is the worst shape\n * this surface has: the provider ships, the script tag is injected, the composed\n * policy does not admit its origin, and the browser refuses it — in PRODUCTION\n * ONLY, because development is report-only. The provider looks configured, the\n * page looks fine locally, and the capability is simply absent for real users.\n *\n * Absolute rather than conditional on the application's own policy, and that is\n * the point: a provider cannot know whether the application it lands in\n * happens to allow-list its vendor, and relying on that is exactly the\n * hand-editing per app, per service, per environment that declaring a footprint\n * exists to remove. Restating an origin the app would have allowed anyway costs\n * nothing — CSP source lists are a union.\n *\n * Thrown, not reported, and only HERE. This runs where the author is: in the\n * provider package's own `./companion` barrel and in the CLI's discovery walk,\n * so `wildo config sync` fails with the provider, the script and the missing\n * origin named. The backend's fallback projection deliberately does NOT repeat\n * it — refusing there would take an application's boot down for a provider\n * authoring mistake, long after the person who could fix it has gone.\n */\nfunction assertDeclaredScriptOriginsAreGranted(module: FrontendProviderModuleShape): void {\n const declaredScriptOrigins = new Set(module.csp?.scriptOrigins ?? []);\n const vendorHostedSdkScriptUrl = providerFrontendSdkVendorHostedScriptUrl(module.sdk?.descriptor);\n const scriptSources = [\n ...(module.scripts ?? []).map((script) => script.src),\n ...(vendorHostedSdkScriptUrl === undefined ? [] : [vendorHostedSdkScriptUrl]),\n ];\n\n for (const src of scriptSources) {\n let origin: string;\n try {\n origin = new URL(src).origin;\n } catch {\n throw new Error(\n `Frontend provider \"${module.metadata.ref}\" declares a script whose src is not an absolute URL: `\n + `\"${src}\". A script declaration names a third-party origin, so the framework can neither `\n + 'resolve it nor grant it in the composed Content-Security-Policy.',\n );\n }\n\n if (!declaredScriptOrigins.has(origin)) {\n throw new Error(\n `Frontend provider \"${module.metadata.ref}\" declares the script \"${src}\" but does not list `\n + `\"${origin}\" in csp.scriptOrigins. The policy this provider contributes to would then block its own `\n + 'script — and only where CSP enforces, so the failure would first appear in production. Add the '\n + 'origin to the provider\\'s csp.scriptOrigins.',\n );\n }\n }\n}\n\n/**\n * Refuses a frontend provider whose consent classification is incomplete (#1702).\n *\n * Two shapes, both of which used to start the provider without consent and say nothing:\n *\n * - a capability no browser may host — anything `PROVIDER_CAPABILITY_FRONTEND_CONSENT_CLASSIFICATION`\n * marks `browserHosted: false`, or a string that is no capability at all. The consent table used to be\n * total only over `FRONTEND_*`-named members and treated every other capability as needing no\n * consent, so a vendor declaring, say, `LLM_CHAT` on its frontend module fell through unclassified;\n * - a module-level `consentPurposes` entry that is not a `ConsentPurpose`. Normalization would DROP\n * it, and a dropped purpose on an additive field is a lowered floor.\n *\n * Thrown here, where the author is, for the reason `assertDeclaredScriptOriginsAreGranted` gives. The\n * browser runners do not rely on it: they refuse to start such a provider on their own (fail closed), so\n * an entry that bypassed this projection is withheld rather than started.\n */\nfunction assertConsentClassificationIsComplete(module: FrontendProviderModuleShape): void {\n const unclassified = unclassifiedFrontendCapabilities(module);\n if (unclassified.length > 0) {\n throw new Error(\n `Frontend provider \"${module.metadata.ref}\" declares ${unclassified.map((capability) => `\"${capability}\"`).join(', ')}, `\n + 'which has no browser consent classification — no browser surface may host it. A frontend module may '\n + 'declare only capabilities PROVIDER_CAPABILITY_FRONTEND_CONSENT_CLASSIFICATION marks browserHosted; '\n + 'classify a new one there (deciding which consent purposes it rests on) before a frontend module declares it.',\n );\n }\n const unknownPurposes = unknownProviderConsentPurposes(module);\n if (unknownPurposes.length > 0) {\n throw new Error(\n `Frontend provider \"${module.metadata.ref}\" declares consentPurposes ${unknownPurposes.map((purpose) => `\"${purpose}\"`).join(', ')}, `\n + 'which are not members of ConsentPurpose. They would be dropped on the way to the browser, lowering what '\n + 'the provider was meant to rest on.',\n );\n }\n}\n\n/**\n * Refuses a CONSENT-BASED frontend provider that a withdrawal could not stop (#1704): one that injects\n * `<script>` tags, or whose SDK does not declare `stoppable`. The earliest of five applications of the same\n * predicate (`consentBasedProviderStopRefusal`), in the provider package's own `./companion` barrel where\n * the author is; hydration withholds the provider's code and scripts, the SDK runner refuses to start it,\n * the startup script collector skips it and the component registry does not register it, so neither a stale\n * artifact nor a hand-written module list can start one either.\n */\nfunction assertConsentBasedProviderIsStoppable(module: FrontendProviderModuleShape): void {\n // assurance-control: WILDO.PRIVACY.CONSENT_ENFORCEMENT — a consent-based provider must be stoppable when consent is withdrawn\n const refusal = consentBasedProviderStopRefusal(module.metadata.ref, module);\n if (refusal !== undefined) throw new Error(refusal);\n}\n\n/**\n * Refuses a consent-based provider for the technical documentation (#1905): it could never start there.\n *\n * The documentation asks no one for consent. It has no consent surface of its own, and today it reads no signed-in\n * reader's answer, so it starts every provider with no purpose granted (`activateFrontendProviderSdks` defaults the grant\n * to none, and the docs runtime passes none), and a provider resting on a purpose never starts. That is the application's own\n * rule for a person whose answer is not known (`ConsentBasedProviderSdksProvider`: \"until preferences arrive nothing is\n * granted, which is why pre-authentication pages start none\"). The website differs because it asks: its consent\n * gate (`useWebsiteConsent`) records the visitor's answer, and `useWebsiteProviderSdks` starts the consent-based group on it.\n *\n * So such a declaration would be a provider that silently never appears. Refused here, where the author is, rather\n * than discovered as a missing widget. The remedy: scope the provider to the website or the application, where consent\n * is asked.\n *\n * Rejected:\n * - starting it on an assumed consent: fail open;\n * - passing a signed-in reader's stored `privacy.consentedPurposes` through the docs auth session (the issue's first\n * suggestion): the docs session carries no preferences today, so it needs a new claim or call, and it would still\n * leave every signed-out reader of public docs ungranted, so the provider would run for some readers and silently not\n * for others. No application declares a consent-based docs provider, so nothing needs it yet;\n * - a consent banner on the documentation: a consent surface and its storage are a feature of their own.\n * Either of the last two is a docs consent phase, and building one is what lifts this refusal.\n */\nfunction assertConsentBasedProviderCanStartOnSurface(module: FrontendProviderModuleShape, serviceType: AppFrontendType): void {\n if (serviceType !== AppFrontendType.TECH_DOC) return;\n // assurance-control: WILDO.PRIVACY.CONSENT_ENFORCEMENT — a consent-based provider is not declared where no consent is asked\n const purposes = consentPurposesRequiredByProvider(module);\n if (purposes.length === 0) return;\n throw new Error(\n `Frontend provider \"${module.metadata.ref}\" rests on consent (${purposes.join(', ')}) and is declared for the technical `\n + 'documentation, which asks no one for consent, so it would never start there. Declare it for the website or the '\n + 'application, where consent is asked.',\n );\n}\n\n/**\n * Refuses a frontend provider that breaks the on-demand rule (#2790): an on-demand capability whose SDK the surface\n * would start (so no flow's call reaches it), or an on-demand SDK serving no on-demand capability or with no\n * predicate. Here, in the provider package's own `./companion` barrel, because that is what publish loads: the\n * author meets it before the module ships rather than as a provider that is declared and never called.\n */\nfunction assertOnDemandRuleIsKept(module: FrontendProviderModuleShape): void {\n const refusal = onDemandProviderSdkRefusal(module.metadata.ref, module);\n if (refusal !== undefined) throw new Error(refusal);\n}\n\n/**\n * Refuses a frontend provider that declares no `publicConfigSchema` whose keys can be read\n * without running it (#1705).\n *\n * Without that list nothing can hold what the provider is served to a set of keys, and \"admit\n * everything\" was the answer: 8 of the 13 engine modules declared none, including the two that run\n * vendor code (PostHog, Sentry), so any key — a secret under an innocent name included — passed\n * through to every browser. The overlay at `wildo config sync` refuses the same absence on the entry\n * (`SCHEMA_NOT_INTROSPECTABLE`) and hydration refuses it on the code module; this is the earliest of\n * the three, in the provider package's own `./companion` barrel, where the author is.\n *\n * Checked on the module's authored `publicConfig` too: a module whose own defaults carry a key its\n * schema does not declare would fail its own schema at hydration and run none of its code.\n */\nfunction assertPublicConfigSchemaIsIntrospectable(module: FrontendProviderModuleShape): void {\n // assurance-control: WILDO.SECURITY.FAIL_CLOSED — a frontend provider with no readable key list is not projected\n const declared = readDeclaredPublicConfigKeys(module.publicConfigSchema);\n if (declared === undefined) {\n throw new Error(\n `Frontend provider \"${module.metadata.ref}\" declares no publicConfigSchema whose keys can be read without running `\n + 'it. Its publicConfig is served to every browser, and without a declared key list nothing can refuse a key it '\n + 'never reads — a secret under an innocent name included. Declare one with `defineFrontendPublicConfigSchema` '\n + '(or a Zod object) listing every key its publicConfig carries.',\n );\n }\n const admissible = new Set(admissibleFrontendPublicConfigKeys({ declaredKeys: declared, providerCapabilities: module.providerCapabilities }));\n const undeclared = Object.keys(module.publicConfig ?? {}).filter((key) => !admissible.has(key));\n if (undeclared.length > 0) {\n throw new Error(\n `Frontend provider \"${module.metadata.ref}\" authors publicConfig ${undeclared.map((key) => `\"${key}\"`).join(', ')}, `\n + 'which its own publicConfigSchema does not declare. Declare the key, or remove it.',\n );\n }\n}\n\n/**\n * Turns a frontend provider module into the companion contribution tooling\n * reads — the ONE place a facet module becomes a discovery record.\n *\n * Exported because the engine is not the only producer. Every\n * `@wildo-ai/provider-<ref>` package's own `./companion` barrel has to do\n * exactly this for its own facet modules, and a projection each package\n * hand-rolls is a projection that drifts: the DATA half of the frontend\n * surface would end up carried by some packages and dropped by others, and a\n * dropped CSP footprint is invisible until a provider is blocked in production.\n *\n * What crosses and what does not is the whole contract. `csp`, `scripts`, the\n * SDK DESCRIPTOR and the `complianceProfile` cross, because tooling has to read\n * them without executing anything — this runs in Node and a facet module is browser-bound. The\n * executable half — `sdk.activate`, `publicConfigSchema` — does NOT, and cannot:\n * the contribution is serialized to JSON on its way into the generated\n * artifact, so a function would be dropped by `JSON.stringify` with no error\n * anywhere. Code reaches a bundle through the generated\n * `frontend-providers.generated.ts` instead.\n */\nexport function projectFrontendProviderContribution(\n module: FrontendProviderModuleShape,\n serviceType: AppFrontendType,\n runtimeImportPath: string,\n): ProviderCompanionContribution {\n assertDeclaredScriptOriginsAreGranted(module);\n assertConsentClassificationIsComplete(module);\n assertConsentBasedProviderIsStoppable(module);\n assertConsentBasedProviderCanStartOnSurface(module, serviceType);\n assertPublicConfigSchemaIsIntrospectable(module);\n assertOnDemandRuleIsKept(module);\n\n const frontendEntry: FrontendProviderEntry = {\n metadata: module.metadata,\n providerCapabilities: [...module.providerCapabilities],\n protocols: [...module.protocols],\n publicConfig: module.publicConfig,\n // The DATA half of the frontend surface (#332). It has to travel with the\n // contribution because the CSP of a service is composed by the CLI, from\n // the materialized artifact, long before any browser loads the module that\n // declares it — and the CLI cannot execute that module to ask.\n // Normalized here, once: a provider AUTHORS the buckets it reaches and the\n // wire carries all of them, so the CSP composer never branches on absence\n // and the hydration join compares two shapes of the same kind.\n csp: module.csp === undefined ? undefined : normalizeProviderFrontendCspFootprint(module.csp),\n scripts: module.scripts === undefined ? undefined : [...module.scripts],\n sdk: module.sdk?.descriptor,\n // The DATA half of each contributed component (#380). `load` is stripped\n // HERE rather than left to `JSON.stringify` to drop it: a function that\n // disappears silently on its way through a serializer is the failure this\n // whole two-channel split exists to remove, and stripping it explicitly is\n // what makes the projection's contract readable at the projection.\n //\n // Rebuilt field by field rather than spread-minus-`load`, so a future field\n // on the declaration is a COMPILE decision about whether it crosses the wire\n // instead of one that crosses by default. `sdk` makes the same choice by\n // naming `descriptor`; this is the same rule where the shape is a map.\n components: projectFrontendComponentDescriptors(module.components),\n // The keys the module's `publicConfigSchema` declares, as DATA (#394 P3).\n // The schema itself is CODE and stays behind; this list is what lets\n // `wildo config sync` refuse an application-supplied key the module never\n // reads, at the moment it is typed rather than when a picker opens.\n // UNION with the keys the module's own CAPABILITIES own (#380). A picker\n // declaring `appId` still reads `maxFileSizeMb`, because the framework reads\n // it on the picker's behalf — so a list built from the provider's schema\n // alone refuses the capability's whole vocabulary at the moment it is typed.\n publicConfigKeys: admissibleFrontendPublicConfigKeys({\n declaredKeys: readDeclaredPublicConfigKeys(module.publicConfigSchema),\n providerCapabilities: module.providerCapabilities,\n })?.slice(),\n // The keys the module cannot run without, as DATA, so the CLI and the doctor can say a declared\n // provider is not configured before any browser tries to start it. ALWAYS written, empty when the module\n // requires nothing: an entry without the list is then recognisably one written before the check existed,\n // never mistaken for \"configured\". The backend's fallback projection writes it the same way.\n requiredPublicConfigKeys: [...readRequiredPublicConfigKeys(module.publicConfigSchema)],\n // The z_file storage the picker fronts (#394 P5) — an enum member, so it\n // crosses the wire as-is; the chooser filters on it and the hydration join\n // compares it to the CODE side.\n fileStorage: module.fileStorage,\n // WHO runs the vendor, WHERE it processes and WHICH legal entity stands behind it (#1743).\n // Every engine facet module has declared this since #345 and this projection used to leave it\n // behind — so the browser vendors a privacy notice most needs to name (reCAPTCHA,\n // Sentry, the Drive/OneDrive/Dropbox pickers) reached no compliance reader at all. Pure DATA,\n // like `csp`, so it crosses as-is and lands in the per-service `frontendProviderBootstraps` of\n // the generated artifact, which is where `listServedFrontendProviderCompliance` reads it.\n complianceProfile: module.complianceProfile,\n // The vendor's purposes BEYOND its capabilities' floor (#1702). DATA, because the browser decides\n // on the hydrated module, whose consent inputs come from this entry — a purpose left behind here\n // would reach no gate. Normalized once; absent stays absent so \"adds nothing\" keeps one spelling.\n consentPurposes: module.consentPurposes === undefined || module.consentPurposes.length === 0\n ? undefined\n : normalizeConsentPurposes(module.consentPurposes),\n };\n return {\n ref: module.metadata.ref,\n identity: {\n packageName: module.metadata.packageName,\n tier: module.metadata.tier,\n vendor: module.metadata.vendor,\n origin: module.metadata.origin,\n },\n runtimeImportPath,\n runtimeTargets: [{ kind: 'frontendService', serviceType }],\n engineCapabilities: deriveEngineCapabilities(module.metadata.ref, module.providerCapabilities),\n providerCapabilities: [...module.providerCapabilities],\n protocols: [...module.protocols],\n // Browser-safe providers cannot own server secrets. The explicit empty\n // shape is authoritative and distinct from an unknown/missing contract.\n secretsContractShape: [],\n frontendEntry,\n };\n}\n\n/** One contribution per `EngineFrontendAppProviderRegistry` module, targeting `SAAS_APP`. */\nexport const engineFrontendAppProviderContributions: ProviderCompanionContribution[] =\n Array.from(EngineFrontendAppProviderRegistry.modules.values()).map((module) =>\n projectFrontendProviderContribution(module, AppFrontendType.SAAS_APP, APP_RUNTIME_IMPORT_PATH),\n );\n\n/** One contribution per `EngineFrontendTechdocProviderRegistry` module, targeting `TECH_DOC`. */\nexport const engineFrontendTechdocProviderContributions: ProviderCompanionContribution[] =\n Array.from(EngineFrontendTechdocProviderRegistry.modules.values()).map((module) =>\n projectFrontendProviderContribution(module, AppFrontendType.TECH_DOC, TECHDOC_RUNTIME_IMPORT_PATH),\n );\n\n/** One contribution per `EngineFrontendWebsiteProviderRegistry` module, targeting `STATIC_WEBSITE`. */\nexport const engineFrontendWebsiteProviderContributions: ProviderCompanionContribution[] =\n Array.from(EngineFrontendWebsiteProviderRegistry.modules.values()).map((module) =>\n projectFrontendProviderContribution(module, AppFrontendType.STATIC_WEBSITE, WEBSITE_RUNTIME_IMPORT_PATH),\n );\n\n/** Stable union — order: app providers, then techdoc, then website (matches the registry imports). */\nexport const engineFrontendProviderContributions: ProviderCompanionContribution[] = [\n ...engineFrontendAppProviderContributions,\n ...engineFrontendTechdocProviderContributions,\n ...engineFrontendWebsiteProviderContributions,\n];\n\n/**\n * Companion-discovery contract — see `RuntimeOwnerCompanionExports`.\n * The framework loader reads `providerContributions` via the package's\n * `./companion` subpath export.\n */\nconst companionExports: RuntimeOwnerCompanionExports = {\n providerContributions: engineFrontendProviderContributions,\n};\n\nexport default companionExports;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine-frontend-providers-package.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"engine-frontend-providers-package.d.ts","sourceRoot":"","sources":["../../src/engine-frontend-providers-package.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,sCAAsC,yCAAyC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine-frontend-providers-package.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"engine-frontend-providers-package.js","sourceRoot":"","sources":["../../src/engine-frontend-providers-package.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,sCAAsC,CAAC","sourcesContent":["/**\n * The npm package every ENGINE frontend provider module — on all three facets — names as its\n * `packageName` (#328). One constant, so a provider extracted into its own package changes ONE\n * import. Intra-package relative import from the provider modules; not a public entrypoint.\n */\nexport const ENGINE_FRONTEND_PROVIDERS_PACKAGE_NAME = '@wildo-ai/external-connectors-public';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropbox.frontend-app.module.d.ts","sourceRoot":"","sources":["../../../../src/providers/dropbox/dropbox.frontend-app.module.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AAE9F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,eAAO,MAAM,0BAA0B,EAAE,
|
|
1
|
+
{"version":3,"file":"dropbox.frontend-app.module.d.ts","sourceRoot":"","sources":["../../../../src/providers/dropbox/dropbox.frontend-app.module.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AAE9F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,eAAO,MAAM,0BAA0B,EAAE,yBAgExC,CAAC"}
|