@aglyn/aglyn 1.0.0-beta.211 → 1.0.0-beta.213
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/package.json +11 -11
- package/src/lib/app-utils/docs-index.generated.js +14 -7
- package/src/lib/app-utils/docs-index.generated.js.map +1 -1
- package/src/lib/app-utils/plugin-bundle-checks.d.ts +3 -2
- package/src/lib/app-utils/plugin-bundle-checks.js +242 -3
- package/src/lib/app-utils/plugin-bundle-checks.js.map +1 -1
- package/src/lib/app-utils/plugin-host-abi.d.ts +61 -0
- package/src/lib/app-utils/plugin-host-abi.js +68 -0
- package/src/lib/app-utils/plugin-host-abi.js.map +1 -0
- package/src/lib/app-utils/realm-host-surface.generated.d.ts +9 -0
- package/src/lib/app-utils/realm-host-surface.generated.js +143 -0
- package/src/lib/app-utils/realm-host-surface.generated.js.map +1 -0
- package/src/lib/app-utils/search-engine-verification.d.ts +98 -0
- package/src/lib/app-utils/search-engine-verification.js +140 -0
- package/src/lib/app-utils/search-engine-verification.js.map +1 -0
- package/src/lib/app-utils/site-entity-json-ld.d.ts +9 -1
- package/src/lib/app-utils/site-entity-json-ld.js +25 -7
- package/src/lib/app-utils/site-entity-json-ld.js.map +1 -1
- package/src/lib/app-utils/variables.d.ts +18 -19
- package/src/lib/app-utils/variables.js +24 -23
- package/src/lib/app-utils/variables.js.map +1 -1
- package/src/lib/app-utils/webhook-delivery.js +3 -1
- package/src/lib/app-utils/webhook-delivery.js.map +1 -1
- package/src/lib/foundation/definitions/platform.types.d.ts +24 -0
- package/src/lib/foundation/definitions/platform.types.js +2 -1
- package/src/lib/foundation/definitions/platform.types.js.map +1 -1
- package/src/lib/plugin-manager/enabled-plugins.d.ts +6 -0
- package/src/lib/plugin-manager/enabled-plugins.js +5 -0
- package/src/lib/plugin-manager/enabled-plugins.js.map +1 -1
- package/src/lib/plugin-manager/first-party-plugins.generated.d.ts +6 -0
- package/src/lib/plugin-manager/first-party-plugins.generated.js +8 -1
- package/src/lib/plugin-manager/first-party-plugins.generated.js.map +1 -1
- package/src/lib/plugin-manager/plugin-contributions.d.ts +59 -0
- package/src/lib/plugin-manager/plugin-contributions.js +113 -0
- package/src/lib/plugin-manager/plugin-contributions.js.map +1 -1
- package/src/lib/plugin-manager/realm-host-aglyn.generated.d.ts +8 -0
- package/src/lib/plugin-manager/realm-host-aglyn.generated.js +101 -0
- package/src/lib/plugin-manager/realm-host-aglyn.generated.js.map +1 -0
- package/src/lib/plugin-manager/realm-plugins.d.ts +3 -2
- package/src/lib/plugin-manager/realm-plugins.js +8 -3
- package/src/lib/plugin-manager/realm-plugins.js.map +1 -1
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import type { FirstPartyPlugin, PluginEditBarLink, PublishedSiteImpact } from './enabled-plugins';
|
|
10
10
|
import type { ResolvedPluginHostCollection, ResolvedPluginOrgCollection } from './plugin-host-collections';
|
|
11
11
|
import type { ResolvedPluginOrgCapacity } from './plugin-org-capacity';
|
|
12
|
+
import type { FunctionBindings } from './plugin-contributions';
|
|
12
13
|
export declare const FIRST_PARTY_PLUGINS: readonly FirstPartyPlugin[];
|
|
13
14
|
export declare const PUBLISHED_SITE_IMPACT: Readonly<Record<string, PublishedSiteImpact>>;
|
|
14
15
|
/**
|
|
@@ -32,3 +33,8 @@ export declare const PLUGIN_ORG_COLLECTIONS_DECLARED: readonly ResolvedPluginOrg
|
|
|
32
33
|
* called.
|
|
33
34
|
*/
|
|
34
35
|
export declare const PLUGIN_ORG_CAPACITIES_DECLARED: readonly ResolvedPluginOrgCapacity[];
|
|
36
|
+
/**
|
|
37
|
+
* Every first-party element that runs a site function, and the prop naming
|
|
38
|
+
* it, declared by that element's plugin (AGL-3393). Core names no element.
|
|
39
|
+
*/
|
|
40
|
+
export declare const FIRST_PARTY_FUNCTION_BINDINGS: FunctionBindings;
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
{
|
|
41
41
|
"id": "accounts",
|
|
42
42
|
"label": "User Accounts",
|
|
43
|
-
"description": "Visitor accounts on the site: the /signin, /signup and /recover pages, and the Members blocks.
|
|
43
|
+
"description": "Visitor accounts on the site: the /signin, /signup and /recover pages, and the Members blocks. On for a new site; a site created before that stays off until you turn it on.",
|
|
44
44
|
"releaseFlag": "release_member_accounts",
|
|
45
45
|
"defaultOffPerSite": true,
|
|
46
46
|
"requires": [
|
|
@@ -445,5 +445,12 @@ export const PUBLISHED_SITE_IMPACT = {
|
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
447
|
];
|
|
448
|
+
/**
|
|
449
|
+
* Every first-party element that runs a site function, and the prop naming
|
|
450
|
+
* it, declared by that element's plugin (AGL-3393). Core names no element.
|
|
451
|
+
*/ export const FIRST_PARTY_FUNCTION_BINDINGS = {
|
|
452
|
+
"functionScope": "functionName",
|
|
453
|
+
"functionWidget": "functionName"
|
|
454
|
+
};
|
|
448
455
|
|
|
449
456
|
//# sourceMappingURL=first-party-plugins.generated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/plugin-manager/first-party-plugins.generated.ts"],"sourcesContent":["/**\n * GENERATED FILE — do not edit. Regenerate with:\n * node tools/scripts/generate-plugin-manifests.mjs\n *\n * The switchboard catalog (AGL-3080): one row per plugin and capability, each\n * declared by its own `catalog` block in plugins.config.json. The core holds\n * the types and the resolvers in `enabled-plugins.ts`; it holds no row.\n */\n\nimport type { FirstPartyPlugin, PluginEditBarLink, PublishedSiteImpact } from './enabled-plugins'\nimport type { ResolvedPluginHostCollection, ResolvedPluginOrgCollection } from './plugin-host-collections'\nimport type { ResolvedPluginOrgCapacity } from './plugin-org-capacity'\n\nexport const FIRST_PARTY_PLUGINS: readonly FirstPartyPlugin[] = [\n {\n \"id\": \"mui\",\n \"label\": \"Components\",\n \"alwaysOn\": true,\n \"description\": \"The base component and theme library every site builds on.\"\n },\n {\n \"id\": \"forms\",\n \"label\": \"Forms\",\n \"alwaysOnForWorkspace\": true,\n \"description\": \"Forms on the site and the catalog that owns them.\",\n \"siteOff\": {\n \"stops\": \"Switching Forms off for this site stops forms rendering on its published pages, refuses every submission sent to it, and blocks publishing a form, or a page that carries one, until Forms is back on.\",\n \"keeps\": \"Submissions already received, the workspace’s form catalog and the CRM leads its forms created are kept, and forms keep working on the workspace’s other sites.\",\n \"confirm\": true,\n \"pages\": {\n \"heading\": \"These published pages carry a form. Their forms stop rendering and stop accepting submissions:\",\n \"none\": \"No published page on this site carries a form.\"\n }\n }\n },\n {\n \"id\": \"ai\",\n \"label\": \"AI\",\n \"alwaysOnForWorkspace\": true,\n \"description\": \"The assistant, generative building and automation, and the AI add-on.\",\n \"siteOff\": {\n \"stops\": \"Switching AI off for this site hides the assistant, Describe it, the AI cards and the editor’s AI controls on this site, refuses every AI request made for it, and stops its queued AI jobs without spending credits.\",\n \"keeps\": \"It does not stop the workspace’s AI add-on, credits, allotments or overage billing, and AI keeps working on the workspace’s other sites.\"\n }\n },\n {\n \"id\": \"accounts\",\n \"label\": \"User Accounts\",\n \"description\": \"Visitor accounts on the site: the /signin, /signup and /recover pages, and the Members blocks. Off for a site until you turn it on.\",\n \"releaseFlag\": \"release_member_accounts\",\n \"defaultOffPerSite\": true,\n \"requires\": [\n \"commerce\"\n ]\n },\n {\n \"id\": \"bookings\",\n \"label\": \"Bookings\",\n \"description\": \"Services, open slots, and paid bookings.\",\n \"releaseFlag\": \"release_bookings\"\n },\n {\n \"id\": \"commerce\",\n \"label\": \"Commerce\",\n \"description\": \"Products, carts, checkout, orders, POS.\",\n \"releaseFlag\": \"release_commerce_v2\"\n },\n {\n \"id\": \"marketplace\",\n \"label\": \"Marketplace\",\n \"description\": \"Marketplace listings, templates, and installs.\",\n \"releaseFlag\": \"release_marketplace\"\n },\n {\n \"id\": \"crm\",\n \"label\": \"CRM\",\n \"description\": \"Leads, contacts, companies, deals, tasks and reports.\",\n \"releaseFlag\": \"release_crm\"\n },\n {\n \"id\": \"outreach\",\n \"label\": \"Sequences\",\n \"description\": \"One-to-one email sequences sent from connected mailboxes.\",\n \"releaseFlag\": \"release_outreach\"\n },\n {\n \"id\": \"data\",\n \"label\": \"Data\",\n \"description\": \"Datasets, records, and CSV import/export.\",\n \"releaseFlag\": \"release_data_store\"\n },\n {\n \"id\": \"email\",\n \"label\": \"Email\",\n \"description\": \"Designed emails and campaign sending.\",\n \"releaseFlag\": \"release_email\"\n },\n {\n \"id\": \"events-calendar\",\n \"label\": \"Events Calendar\",\n \"description\": \"Event lists and calendars.\",\n \"releaseFlag\": \"release_events\"\n },\n {\n \"id\": \"inbox\",\n \"label\": \"Inbox\",\n \"description\": \"Form submissions and lead inbox.\",\n \"releaseFlag\": \"release_inbox\"\n },\n {\n \"id\": \"logic\",\n \"label\": \"Logic\",\n \"description\": \"Variables, functions, and reference health.\",\n \"releaseFlag\": \"release_logic\"\n },\n {\n \"id\": \"marketing\",\n \"label\": \"Marketing\",\n \"description\": \"Overlays, campaigns, and experiments.\",\n \"releaseFlag\": \"release_marketing\"\n },\n {\n \"id\": \"redirects\",\n \"label\": \"Redirects\",\n \"description\": \"URL redirect rules.\",\n \"releaseFlag\": \"release_redirects\"\n },\n {\n \"id\": \"workflows\",\n \"label\": \"Automation\",\n \"description\": \"Workflows, actions, webhooks, and run logs.\",\n \"releaseFlag\": \"release_workflows\"\n },\n]\n\nexport const PUBLISHED_SITE_IMPACT: Readonly<Record<string, PublishedSiteImpact>> = {\n \"mui\": \"elements\",\n \"forms\": \"elements\",\n \"ai\": \"console-only\",\n \"accounts\": \"routes\",\n \"bookings\": \"elements\",\n \"commerce\": \"elements\",\n \"marketplace\": \"console-only\",\n \"crm\": \"console-only\",\n \"outreach\": \"console-only\",\n \"data\": \"console-only\",\n \"email\": \"elements\",\n \"events-calendar\": \"elements\",\n \"inbox\": \"console-only\",\n \"logic\": \"console-only\",\n \"marketing\": \"elements\",\n \"redirects\": \"routes\",\n \"workflows\": \"routes\",\n}\n\n/**\n * The admin edit bar's quick links, in the order they are drawn — each\n * declared by the plugin whose console page it opens (AGL-3080).\n */\nexport const PLUGIN_EDIT_BAR_LINKS: readonly PluginEditBarLink[] = [\n {\n \"pluginId\": \"inbox\",\n \"order\": 20,\n \"label\": \"Inbox\",\n \"path\": \"/inbox\"\n },\n {\n \"pluginId\": \"commerce\",\n \"order\": 30,\n \"label\": \"Orders\",\n \"path\": \"/products/orders\"\n },\n]\n\n/**\n * Every host subcollection a first-party plugin owns, declared by that plugin\n * (AGL-3080). Core's readers ask this list; core names no collection.\n */\nexport const PLUGIN_HOST_COLLECTIONS_DECLARED: readonly ResolvedPluginHostCollection[] = [\n {\n \"pluginId\": \"forms\",\n \"name\": \"forms\",\n \"routeSlug\": \"forms\"\n },\n {\n \"pluginId\": \"bookings\",\n \"name\": \"services\",\n \"routeSlug\": \"bookings\"\n },\n {\n \"pluginId\": \"bookings\",\n \"name\": \"bookings\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Booking records — a customer, a time and a service pointer. The service holds the imagery and IS scanned; a booking is the transaction against it.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"products\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"productCategories\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"suppliers\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"locations\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"coupons\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"discounts\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"reviews\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"memberPosts\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"resources\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"settings\",\n \"label\": \"Store settings\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"siteMembers\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"siteMemberCredentials\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"A site member's password hash, one document per member, read and written only by the membership routes (AGL-3308). A credential with no content field, and no client may read it.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"orders\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Completed orders. Line items COPY a product's `imageUrl` at purchase time, so these would match — and matching would be the wrong answer: an order is an immutable record of what was sold, deleting the asset changes nothing about it, and no author can edit one. A busy store also holds more of these than the whole read budget.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"carts\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Live and abandoned carts, with the same copied line-item image and the same reasoning, at higher volume — one document per shopper session.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"checkouts\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"In-flight checkout sessions. Transient buyer state carrying the same line-item snapshot as `carts`.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"reservations\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"POS and booking holds. Short-lived transaction rows pointing at a resource that is itself scanned.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"stockHolds\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Inventory holds taken during checkout. Machine-written, short-lived, and a quantity rather than content.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"subscriptions\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Site membership subscriptions: a plan pointer, a status and Stripe ids. Server-written from the billing webhook.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"registers\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"POS register allocations — a count against the register add-on, read by billing (AGL-1775). No content field at all.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"giftCards\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Gift card balances and redemption history. Money, not content.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"licenseKeys\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Digital-product license keys issued at fulfilment: a code, an order pointer and a revocation flag.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"inventoryAdjustments\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"The append-only stock adjustment ledger (AGL-2269). One row per manual stock edit and per cancellation release, unbounded over a store's life.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"inventoryReconciliation\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Reconciliation runs comparing counted stock against recorded stock. Machine-written totals.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"restockAlerts\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Back-in-stock requests: an email address and a product pointer, written by visitors.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"stripeTaxRates\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Cached Stripe tax rate ids, written by the tax sync. Vendor ids.\"\n },\n {\n \"pluginId\": \"marketplace\",\n \"name\": \"installs\"\n },\n {\n \"pluginId\": \"crm\",\n \"name\": \"leads\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Captured leads, on the same footing as `formSubmissions`: visitor-submitted, unbounded, and never a place an author places an asset.\"\n },\n {\n \"pluginId\": \"email\",\n \"name\": \"suppressions\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Unsubscribes, bounces and spam complaints. Email addresses and a reason.\"\n },\n {\n \"pluginId\": \"events-calendar\",\n \"name\": \"events\",\n \"routeSlug\": \"events\"\n },\n {\n \"pluginId\": \"inbox\",\n \"name\": \"formSubmissions\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Visitor form submissions. Unbounded, PII-heavy, and a file attached to one is the visitor's upload — not a library asset an author picked, and not something deleting a library asset would break.\"\n },\n {\n \"pluginId\": \"logic\",\n \"name\": \"functions\",\n \"routeSlug\": \"logic\"\n },\n {\n \"pluginId\": \"logic\",\n \"name\": \"variables\",\n \"routeSlug\": \"logic\"\n },\n {\n \"pluginId\": \"marketing\",\n \"name\": \"experiments\",\n \"routeSlug\": \"marketing\"\n },\n {\n \"pluginId\": \"marketing\",\n \"name\": \"overlays\",\n \"routeSlug\": \"marketing\"\n },\n {\n \"pluginId\": \"marketing\",\n \"name\": \"campaignAttributions\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"One row per conversion — a form submission, a lead, a contact or a booking — recording which campaign the visitor arrived from. Written only by the Admin SDK, and the whole record is three sanitized UTM strings capped at a hundred characters: there is no field an asset could occupy and no surface that could pick one into it. Unbounded on the same footing as the conversions it credits.\"\n },\n {\n \"pluginId\": \"redirects\",\n \"name\": \"redirects\",\n \"routeSlug\": \"redirects\"\n },\n {\n \"pluginId\": \"workflows\",\n \"name\": \"workflows\",\n \"routeSlug\": \"automation\"\n },\n {\n \"pluginId\": \"workflows\",\n \"name\": \"webhooks\",\n \"routeSlug\": \"automation\"\n },\n {\n \"pluginId\": \"workflows\",\n \"name\": \"actions\",\n \"routeSlug\": \"automation\"\n },\n]\n\n/**\n * Every org collection a first-party plugin owns whose documents the media\n * scan reads, declared by that plugin (AGL-3273).\n */\nexport const PLUGIN_ORG_COLLECTIONS_DECLARED: readonly ResolvedPluginOrgCollection[] = [\n {\n \"pluginId\": \"marketing\",\n \"name\": \"campaigns\",\n \"routeSlug\": \"marketing\",\n \"siteField\": \"hostId\",\n \"holdsTransferWhile\": {\n \"field\": \"status\",\n \"values\": [\n \"scheduled\",\n \"sending\"\n ]\n }\n },\n {\n \"pluginId\": \"marketing\",\n \"name\": \"emailCampaigns\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"The campaign CONTAINER — a name, a date window, the list ids it is aimed at, a topic and the sites it runs on. Distinct from `campaigns`, which holds the sends and IS scanned because a send carries the copy that went out. A container carries no copy and no asset reference: the design a send renders is a screen, and the screen is where the picker writes.\"\n },\n {\n \"pluginId\": \"workflows\",\n \"name\": \"automations\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"An org automation (AGL-3302) — a trigger, its conditions, the sites it is placed on, and a step list drawn from the server steps only: email subject and body as plain text, list, dataset and campaign ids, CRM fields and waits. No step it may hold carries a media reference, the in-page steps that could (custom HTML, popups) are refused by its save route, and it is written only by that route.\"\n },\n]\n\n/**\n * Every org capacity a first-party plugin backs, declared by that plugin\n * (AGL-3080). Core owns the money; this says what is counted and what it is\n * called.\n */\nexport const PLUGIN_ORG_CAPACITIES_DECLARED: readonly ResolvedPluginOrgCapacity[] = [\n {\n \"pluginId\": \"data\",\n \"kind\": \"datasets\",\n \"order\": 30,\n \"collection\": \"datasets\",\n \"addonKind\": \"datasets\",\n \"includedEntitlement\": \"datasetsPerOrg\",\n \"purchaseCeilingEntitlement\": \"maxDatasetsPerOrg\",\n \"nouns\": {\n \"one\": \"dataset\",\n \"many\": \"datasets\",\n \"addon\": \"extra datasets\"\n }\n },\n]\n"],"names":["FIRST_PARTY_PLUGINS","PUBLISHED_SITE_IMPACT","PLUGIN_EDIT_BAR_LINKS","PLUGIN_HOST_COLLECTIONS_DECLARED","PLUGIN_ORG_COLLECTIONS_DECLARED","PLUGIN_ORG_CAPACITIES_DECLARED"],"mappings":"AAAA;;;;;;;CAOC,GAMD,OAAO,MAAMA,sBAAmD;IAC9D;QACE,MAAM;QACN,SAAS;QACT,YAAY;QACZ,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,wBAAwB;QACxB,eAAe;QACf,WAAW;YACT,SAAS;YACT,SAAS;YACT,WAAW;YACX,SAAS;gBACP,WAAW;gBACX,QAAQ;YACV;QACF;IACF;IACA;QACE,MAAM;QACN,SAAS;QACT,wBAAwB;QACxB,eAAe;QACf,WAAW;YACT,SAAS;YACT,SAAS;QACX;IACF;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;QACf,qBAAqB;QACrB,YAAY;YACV;SACD;IACH;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;CACD,CAAA;AAED,OAAO,MAAMC,wBAAuE;IAClF,OAAO;IACP,SAAS;IACT,MAAM;IACN,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,eAAe;IACf,OAAO;IACP,YAAY;IACZ,QAAQ;IACR,SAAS;IACT,mBAAmB;IACnB,SAAS;IACT,SAAS;IACT,aAAa;IACb,aAAa;IACb,aAAa;AACf,EAAC;AAED;;;CAGC,GACD,OAAO,MAAMC,wBAAsD;IACjE;QACE,YAAY;QACZ,SAAS;QACT,SAAS;QACT,QAAQ;IACV;IACA;QACE,YAAY;QACZ,SAAS;QACT,SAAS;QACT,QAAQ;IACV;CACD,CAAA;AAED;;;CAGC,GACD,OAAO,MAAMC,mCAA4E;IACvF;QAC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F;QACE,YAAY;QACZ,QAAQ;QACR,SAAS;QACT,cAAc;QACd,aAAa;QACb,uBAAuB;QACvB,8BAA8B;QAC9B,SAAS;YACP,OAAO;YACP,QAAQ;YACR,SAAS;QACX;IACF;CACD,CAAA"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/plugin-manager/first-party-plugins.generated.ts"],"sourcesContent":["/**\n * GENERATED FILE — do not edit. Regenerate with:\n * node tools/scripts/generate-plugin-manifests.mjs\n *\n * The switchboard catalog (AGL-3080): one row per plugin and capability, each\n * declared by its own `catalog` block in plugins.config.json. The core holds\n * the types and the resolvers in `enabled-plugins.ts`; it holds no row.\n */\n\nimport type { FirstPartyPlugin, PluginEditBarLink, PublishedSiteImpact } from './enabled-plugins'\nimport type { ResolvedPluginHostCollection, ResolvedPluginOrgCollection } from './plugin-host-collections'\nimport type { ResolvedPluginOrgCapacity } from './plugin-org-capacity'\nimport type { FunctionBindings } from './plugin-contributions'\n\nexport const FIRST_PARTY_PLUGINS: readonly FirstPartyPlugin[] = [\n {\n \"id\": \"mui\",\n \"label\": \"Components\",\n \"alwaysOn\": true,\n \"description\": \"The base component and theme library every site builds on.\"\n },\n {\n \"id\": \"forms\",\n \"label\": \"Forms\",\n \"alwaysOnForWorkspace\": true,\n \"description\": \"Forms on the site and the catalog that owns them.\",\n \"siteOff\": {\n \"stops\": \"Switching Forms off for this site stops forms rendering on its published pages, refuses every submission sent to it, and blocks publishing a form, or a page that carries one, until Forms is back on.\",\n \"keeps\": \"Submissions already received, the workspace’s form catalog and the CRM leads its forms created are kept, and forms keep working on the workspace’s other sites.\",\n \"confirm\": true,\n \"pages\": {\n \"heading\": \"These published pages carry a form. Their forms stop rendering and stop accepting submissions:\",\n \"none\": \"No published page on this site carries a form.\"\n }\n }\n },\n {\n \"id\": \"ai\",\n \"label\": \"AI\",\n \"alwaysOnForWorkspace\": true,\n \"description\": \"The assistant, generative building and automation, and the AI add-on.\",\n \"siteOff\": {\n \"stops\": \"Switching AI off for this site hides the assistant, Describe it, the AI cards and the editor’s AI controls on this site, refuses every AI request made for it, and stops its queued AI jobs without spending credits.\",\n \"keeps\": \"It does not stop the workspace’s AI add-on, credits, allotments or overage billing, and AI keeps working on the workspace’s other sites.\"\n }\n },\n {\n \"id\": \"accounts\",\n \"label\": \"User Accounts\",\n \"description\": \"Visitor accounts on the site: the /signin, /signup and /recover pages, and the Members blocks. On for a new site; a site created before that stays off until you turn it on.\",\n \"releaseFlag\": \"release_member_accounts\",\n \"defaultOffPerSite\": true,\n \"requires\": [\n \"commerce\"\n ]\n },\n {\n \"id\": \"bookings\",\n \"label\": \"Bookings\",\n \"description\": \"Services, open slots, and paid bookings.\",\n \"releaseFlag\": \"release_bookings\"\n },\n {\n \"id\": \"commerce\",\n \"label\": \"Commerce\",\n \"description\": \"Products, carts, checkout, orders, POS.\",\n \"releaseFlag\": \"release_commerce_v2\"\n },\n {\n \"id\": \"marketplace\",\n \"label\": \"Marketplace\",\n \"description\": \"Marketplace listings, templates, and installs.\",\n \"releaseFlag\": \"release_marketplace\"\n },\n {\n \"id\": \"crm\",\n \"label\": \"CRM\",\n \"description\": \"Leads, contacts, companies, deals, tasks and reports.\",\n \"releaseFlag\": \"release_crm\"\n },\n {\n \"id\": \"outreach\",\n \"label\": \"Sequences\",\n \"description\": \"One-to-one email sequences sent from connected mailboxes.\",\n \"releaseFlag\": \"release_outreach\"\n },\n {\n \"id\": \"data\",\n \"label\": \"Data\",\n \"description\": \"Datasets, records, and CSV import/export.\",\n \"releaseFlag\": \"release_data_store\"\n },\n {\n \"id\": \"email\",\n \"label\": \"Email\",\n \"description\": \"Designed emails and campaign sending.\",\n \"releaseFlag\": \"release_email\"\n },\n {\n \"id\": \"events-calendar\",\n \"label\": \"Events Calendar\",\n \"description\": \"Event lists and calendars.\",\n \"releaseFlag\": \"release_events\"\n },\n {\n \"id\": \"inbox\",\n \"label\": \"Inbox\",\n \"description\": \"Form submissions and lead inbox.\",\n \"releaseFlag\": \"release_inbox\"\n },\n {\n \"id\": \"logic\",\n \"label\": \"Logic\",\n \"description\": \"Variables, functions, and reference health.\",\n \"releaseFlag\": \"release_logic\"\n },\n {\n \"id\": \"marketing\",\n \"label\": \"Marketing\",\n \"description\": \"Overlays, campaigns, and experiments.\",\n \"releaseFlag\": \"release_marketing\"\n },\n {\n \"id\": \"redirects\",\n \"label\": \"Redirects\",\n \"description\": \"URL redirect rules.\",\n \"releaseFlag\": \"release_redirects\"\n },\n {\n \"id\": \"workflows\",\n \"label\": \"Automation\",\n \"description\": \"Workflows, actions, webhooks, and run logs.\",\n \"releaseFlag\": \"release_workflows\"\n },\n]\n\nexport const PUBLISHED_SITE_IMPACT: Readonly<Record<string, PublishedSiteImpact>> = {\n \"mui\": \"elements\",\n \"forms\": \"elements\",\n \"ai\": \"console-only\",\n \"accounts\": \"routes\",\n \"bookings\": \"elements\",\n \"commerce\": \"elements\",\n \"marketplace\": \"console-only\",\n \"crm\": \"console-only\",\n \"outreach\": \"console-only\",\n \"data\": \"console-only\",\n \"email\": \"elements\",\n \"events-calendar\": \"elements\",\n \"inbox\": \"console-only\",\n \"logic\": \"console-only\",\n \"marketing\": \"elements\",\n \"redirects\": \"routes\",\n \"workflows\": \"routes\",\n}\n\n/**\n * The admin edit bar's quick links, in the order they are drawn — each\n * declared by the plugin whose console page it opens (AGL-3080).\n */\nexport const PLUGIN_EDIT_BAR_LINKS: readonly PluginEditBarLink[] = [\n {\n \"pluginId\": \"inbox\",\n \"order\": 20,\n \"label\": \"Inbox\",\n \"path\": \"/inbox\"\n },\n {\n \"pluginId\": \"commerce\",\n \"order\": 30,\n \"label\": \"Orders\",\n \"path\": \"/products/orders\"\n },\n]\n\n/**\n * Every host subcollection a first-party plugin owns, declared by that plugin\n * (AGL-3080). Core's readers ask this list; core names no collection.\n */\nexport const PLUGIN_HOST_COLLECTIONS_DECLARED: readonly ResolvedPluginHostCollection[] = [\n {\n \"pluginId\": \"forms\",\n \"name\": \"forms\",\n \"routeSlug\": \"forms\"\n },\n {\n \"pluginId\": \"bookings\",\n \"name\": \"services\",\n \"routeSlug\": \"bookings\"\n },\n {\n \"pluginId\": \"bookings\",\n \"name\": \"bookings\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Booking records — a customer, a time and a service pointer. The service holds the imagery and IS scanned; a booking is the transaction against it.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"products\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"productCategories\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"suppliers\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"locations\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"coupons\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"discounts\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"reviews\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"memberPosts\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"resources\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"settings\",\n \"label\": \"Store settings\",\n \"routeSlug\": \"products\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"siteMembers\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"siteMemberCredentials\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"A site member's password hash, one document per member, read and written only by the membership routes (AGL-3308). A credential with no content field, and no client may read it.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"orders\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Completed orders. Line items COPY a product's `imageUrl` at purchase time, so these would match — and matching would be the wrong answer: an order is an immutable record of what was sold, deleting the asset changes nothing about it, and no author can edit one. A busy store also holds more of these than the whole read budget.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"carts\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Live and abandoned carts, with the same copied line-item image and the same reasoning, at higher volume — one document per shopper session.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"checkouts\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"In-flight checkout sessions. Transient buyer state carrying the same line-item snapshot as `carts`.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"reservations\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"POS and booking holds. Short-lived transaction rows pointing at a resource that is itself scanned.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"stockHolds\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Inventory holds taken during checkout. Machine-written, short-lived, and a quantity rather than content.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"subscriptions\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Site membership subscriptions: a plan pointer, a status and Stripe ids. Server-written from the billing webhook.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"registers\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"POS register allocations — a count against the register add-on, read by billing (AGL-1775). No content field at all.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"giftCards\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Gift card balances and redemption history. Money, not content.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"licenseKeys\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Digital-product license keys issued at fulfilment: a code, an order pointer and a revocation flag.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"inventoryAdjustments\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"The append-only stock adjustment ledger (AGL-2269). One row per manual stock edit and per cancellation release, unbounded over a store's life.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"inventoryReconciliation\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Reconciliation runs comparing counted stock against recorded stock. Machine-written totals.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"restockAlerts\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Back-in-stock requests: an email address and a product pointer, written by visitors.\"\n },\n {\n \"pluginId\": \"commerce\",\n \"name\": \"stripeTaxRates\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Cached Stripe tax rate ids, written by the tax sync. Vendor ids.\"\n },\n {\n \"pluginId\": \"marketplace\",\n \"name\": \"installs\"\n },\n {\n \"pluginId\": \"crm\",\n \"name\": \"leads\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Captured leads, on the same footing as `formSubmissions`: visitor-submitted, unbounded, and never a place an author places an asset.\"\n },\n {\n \"pluginId\": \"email\",\n \"name\": \"suppressions\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Unsubscribes, bounces and spam complaints. Email addresses and a reason.\"\n },\n {\n \"pluginId\": \"events-calendar\",\n \"name\": \"events\",\n \"routeSlug\": \"events\"\n },\n {\n \"pluginId\": \"inbox\",\n \"name\": \"formSubmissions\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"Visitor form submissions. Unbounded, PII-heavy, and a file attached to one is the visitor's upload — not a library asset an author picked, and not something deleting a library asset would break.\"\n },\n {\n \"pluginId\": \"logic\",\n \"name\": \"functions\",\n \"routeSlug\": \"logic\"\n },\n {\n \"pluginId\": \"logic\",\n \"name\": \"variables\",\n \"routeSlug\": \"logic\"\n },\n {\n \"pluginId\": \"marketing\",\n \"name\": \"experiments\",\n \"routeSlug\": \"marketing\"\n },\n {\n \"pluginId\": \"marketing\",\n \"name\": \"overlays\",\n \"routeSlug\": \"marketing\"\n },\n {\n \"pluginId\": \"marketing\",\n \"name\": \"campaignAttributions\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"One row per conversion — a form submission, a lead, a contact or a booking — recording which campaign the visitor arrived from. Written only by the Admin SDK, and the whole record is three sanitized UTM strings capped at a hundred characters: there is no field an asset could occupy and no surface that could pick one into it. Unbounded on the same footing as the conversions it credits.\"\n },\n {\n \"pluginId\": \"redirects\",\n \"name\": \"redirects\",\n \"routeSlug\": \"redirects\"\n },\n {\n \"pluginId\": \"workflows\",\n \"name\": \"workflows\",\n \"routeSlug\": \"automation\"\n },\n {\n \"pluginId\": \"workflows\",\n \"name\": \"webhooks\",\n \"routeSlug\": \"automation\"\n },\n {\n \"pluginId\": \"workflows\",\n \"name\": \"actions\",\n \"routeSlug\": \"automation\"\n },\n]\n\n/**\n * Every org collection a first-party plugin owns whose documents the media\n * scan reads, declared by that plugin (AGL-3273).\n */\nexport const PLUGIN_ORG_COLLECTIONS_DECLARED: readonly ResolvedPluginOrgCollection[] = [\n {\n \"pluginId\": \"marketing\",\n \"name\": \"campaigns\",\n \"routeSlug\": \"marketing\",\n \"siteField\": \"hostId\",\n \"holdsTransferWhile\": {\n \"field\": \"status\",\n \"values\": [\n \"scheduled\",\n \"sending\"\n ]\n }\n },\n {\n \"pluginId\": \"marketing\",\n \"name\": \"emailCampaigns\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"The campaign CONTAINER — a name, a date window, the list ids it is aimed at, a topic and the sites it runs on. Distinct from `campaigns`, which holds the sends and IS scanned because a send carries the copy that went out. A container carries no copy and no asset reference: the design a send renders is a screen, and the screen is where the picker writes.\"\n },\n {\n \"pluginId\": \"workflows\",\n \"name\": \"automations\",\n \"mediaScan\": \"none\",\n \"mediaScanReason\": \"An org automation (AGL-3302) — a trigger, its conditions, the sites it is placed on, and a step list drawn from the server steps only: email subject and body as plain text, list, dataset and campaign ids, CRM fields and waits. No step it may hold carries a media reference, the in-page steps that could (custom HTML, popups) are refused by its save route, and it is written only by that route.\"\n },\n]\n\n/**\n * Every org capacity a first-party plugin backs, declared by that plugin\n * (AGL-3080). Core owns the money; this says what is counted and what it is\n * called.\n */\nexport const PLUGIN_ORG_CAPACITIES_DECLARED: readonly ResolvedPluginOrgCapacity[] = [\n {\n \"pluginId\": \"data\",\n \"kind\": \"datasets\",\n \"order\": 30,\n \"collection\": \"datasets\",\n \"addonKind\": \"datasets\",\n \"includedEntitlement\": \"datasetsPerOrg\",\n \"purchaseCeilingEntitlement\": \"maxDatasetsPerOrg\",\n \"nouns\": {\n \"one\": \"dataset\",\n \"many\": \"datasets\",\n \"addon\": \"extra datasets\"\n }\n },\n]\n\n/**\n * Every first-party element that runs a site function, and the prop naming\n * it, declared by that element's plugin (AGL-3393). Core names no element.\n */\nexport const FIRST_PARTY_FUNCTION_BINDINGS: FunctionBindings = {\n \"functionScope\": \"functionName\",\n \"functionWidget\": \"functionName\",\n}\n"],"names":["FIRST_PARTY_PLUGINS","PUBLISHED_SITE_IMPACT","PLUGIN_EDIT_BAR_LINKS","PLUGIN_HOST_COLLECTIONS_DECLARED","PLUGIN_ORG_COLLECTIONS_DECLARED","PLUGIN_ORG_CAPACITIES_DECLARED","FIRST_PARTY_FUNCTION_BINDINGS"],"mappings":"AAAA;;;;;;;CAOC,GAOD,OAAO,MAAMA,sBAAmD;IAC9D;QACE,MAAM;QACN,SAAS;QACT,YAAY;QACZ,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,wBAAwB;QACxB,eAAe;QACf,WAAW;YACT,SAAS;YACT,SAAS;YACT,WAAW;YACX,SAAS;gBACP,WAAW;gBACX,QAAQ;YACV;QACF;IACF;IACA;QACE,MAAM;QACN,SAAS;QACT,wBAAwB;QACxB,eAAe;QACf,WAAW;YACT,SAAS;YACT,SAAS;QACX;IACF;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;QACf,qBAAqB;QACrB,YAAY;YACV;SACD;IACH;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;IACA;QACE,MAAM;QACN,SAAS;QACT,eAAe;QACf,eAAe;IACjB;CACD,CAAA;AAED,OAAO,MAAMC,wBAAuE;IAClF,OAAO;IACP,SAAS;IACT,MAAM;IACN,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,eAAe;IACf,OAAO;IACP,YAAY;IACZ,QAAQ;IACR,SAAS;IACT,mBAAmB;IACnB,SAAS;IACT,SAAS;IACT,aAAa;IACb,aAAa;IACb,aAAa;AACf,EAAC;AAED;;;CAGC,GACD,OAAO,MAAMC,wBAAsD;IACjE;QACE,YAAY;QACZ,SAAS;QACT,SAAS;QACT,QAAQ;IACV;IACA;QACE,YAAY;QACZ,SAAS;QACT,SAAS;QACT,QAAQ;IACV;CACD,CAAA;AAED;;;CAGC,GACD,OAAO,MAAMC,mCAA4E;IACvF;QACE,YAAY;QACZ,QAAQ;QACR,aAAa;IACf;IACA;QACE,YAAY;QACZ,QAAQ;QACR,aAAa;IACf;IACA;QACE,YAAY;QACZ,QAAQ;QACR,aAAa;QACb,mBAAmB;IACrB;IACA;QACE,YAAY;QACZ,QAAQ;QACR,aAAa;IACf;IACA;QACE,YAAY;QACZ,QAAQ;QACR,aAAa;IACf;IAC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AC"}
|
|
@@ -65,6 +65,19 @@ export interface PluginSiteContributions {
|
|
|
65
65
|
* such a site, which is what a feature is.
|
|
66
66
|
*/
|
|
67
67
|
features?: string[];
|
|
68
|
+
/**
|
|
69
|
+
* The elements that run a site function in the visitor's browser (AGL-3393),
|
|
70
|
+
* each keyed by its component id and naming the prop that holds the
|
|
71
|
+
* function's name. Compose hands such a node the function's definition and
|
|
72
|
+
* the site variables it reads; no other node is given either.
|
|
73
|
+
*
|
|
74
|
+
* Declared DATA rather than read off a registered schema: compose runs where
|
|
75
|
+
* no plugin code loads — the tenant's server components — so the only thing
|
|
76
|
+
* it can consult is a declaration. A first-party plugin declares it in
|
|
77
|
+
* `plugins.config.json`, a marketplace plugin in its manifest, and both reach
|
|
78
|
+
* compose as the same map. Every key must also be one of `components`.
|
|
79
|
+
*/
|
|
80
|
+
functionBindings?: Record<string, string>;
|
|
68
81
|
}
|
|
69
82
|
/** What a plugin adds to the console. */
|
|
70
83
|
export interface PluginConsoleContributions {
|
|
@@ -184,6 +197,46 @@ export interface PresenceSubject {
|
|
|
184
197
|
* elements — the default in the module note.
|
|
185
198
|
*/
|
|
186
199
|
export declare function isPluginUsedOnPage(subject: PresenceSubject, page: PagePresence): boolean;
|
|
200
|
+
/**
|
|
201
|
+
* Whether a plugin declares anything a site draws: an element an author can
|
|
202
|
+
* place, or a feature that runs on the site's pages. The editor loads exactly
|
|
203
|
+
* these (AGL-3391). A plugin that declares nothing is not among them: its
|
|
204
|
+
* site half is only discoverable by running `register()`, and the console
|
|
205
|
+
* shell already does that for it.
|
|
206
|
+
*/
|
|
207
|
+
export declare function declaresSiteElements(contributes: PluginContributions | undefined): boolean;
|
|
208
|
+
/**
|
|
209
|
+
* Every id a plugin's elements and presets may carry as their `pluginId`: its
|
|
210
|
+
* own id and, for a marketplace plugin, its listing id. A surface that filters
|
|
211
|
+
* registry entries by plugin set needs all of them, or it hides the elements
|
|
212
|
+
* of a plugin it just loaded.
|
|
213
|
+
*/
|
|
214
|
+
export declare function presenceIds(subject: PresenceSubject): string[];
|
|
215
|
+
/**
|
|
216
|
+
* Function bindings (AGL-3393): component id → the prop naming the site
|
|
217
|
+
* function that element runs.
|
|
218
|
+
*/
|
|
219
|
+
export type FunctionBindings = Readonly<Record<string, string>>;
|
|
220
|
+
/**
|
|
221
|
+
* The function bindings a set of plugins declares, merged into one map.
|
|
222
|
+
*
|
|
223
|
+
* Where two plugins bind the same component id the FIRST one listed wins, so a
|
|
224
|
+
* caller that passes first-party declarations ahead of marketplace ones keeps
|
|
225
|
+
* a marketplace manifest from rebinding a first-party element. Marketplace ids
|
|
226
|
+
* are namespaced by their publisher (see {@link isNamespacedComponentId}), so
|
|
227
|
+
* a collision is a mistake, never a feature.
|
|
228
|
+
*/
|
|
229
|
+
export declare function mergeFunctionBindings(...sources: ReadonlyArray<FunctionBindings | {
|
|
230
|
+
contributes?: PluginContributions;
|
|
231
|
+
} | null | undefined>): FunctionBindings;
|
|
232
|
+
/**
|
|
233
|
+
* Whether a component id belongs to a marketplace plugin's namespace
|
|
234
|
+
* (AGL-3387): `<publisher handle>.<plugin id>.<role>`. A `.` is reserved for
|
|
235
|
+
* those ids — no first-party component carries one, which the manifest
|
|
236
|
+
* generator enforces — so compose can tell, without loading anything, that a
|
|
237
|
+
* tree places an element only an installed plugin can declare.
|
|
238
|
+
*/
|
|
239
|
+
export declare function isNamespacedComponentId(componentId: unknown): boolean;
|
|
187
240
|
/**
|
|
188
241
|
* Where a plugin's console code loads, resolved with the default applied: a
|
|
189
242
|
* plugin that declares nothing loads with the shell, as it always did.
|
|
@@ -215,6 +268,10 @@ export declare function routeServes(route: string, href: string): boolean;
|
|
|
215
268
|
* - `route`: the path the reader has open, plugin-relative (`/products`,
|
|
216
269
|
* `/products/orders`), on the level its route tree serves — `site` beneath
|
|
217
270
|
* `/hosts/[host]`, `org` beneath the organization.
|
|
271
|
+
* - `editor`: the Besigner, which draws a site's elements and offers them in
|
|
272
|
+
* its Elements panel (AGL-3391). A plugin loads here when it declares site
|
|
273
|
+
* elements or site features, whether or not the page open uses them, since
|
|
274
|
+
* the author is choosing what to place.
|
|
218
275
|
*/
|
|
219
276
|
export type ConsoleLoadWhere = {
|
|
220
277
|
at: 'shell';
|
|
@@ -225,6 +282,8 @@ export type ConsoleLoadWhere = {
|
|
|
225
282
|
at: 'route';
|
|
226
283
|
href: string;
|
|
227
284
|
level: 'site' | 'org';
|
|
285
|
+
} | {
|
|
286
|
+
at: 'editor';
|
|
228
287
|
};
|
|
229
288
|
/**
|
|
230
289
|
* Whether a console surface uses a plugin, so it must load it.
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
* A console route: one or more path segments, as a nav item's `href` names
|
|
59
59
|
* them. Never a URL, never `..`.
|
|
60
60
|
*/ const CONTRIBUTION_ROUTE = /^(\/[A-Za-z0-9_-]+){1,8}$/;
|
|
61
|
+
/** A prop name a function binding may name: a plain identifier. */ const BINDING_PROP = /^[A-Za-z_$][A-Za-z0-9_$]{0,63}$/;
|
|
61
62
|
/**
|
|
62
63
|
* Validates a declared `contributes` block.
|
|
63
64
|
*
|
|
@@ -95,6 +96,7 @@
|
|
|
95
96
|
}
|
|
96
97
|
const next = {};
|
|
97
98
|
for (const key of Object.keys(site)){
|
|
99
|
+
if (key === 'functionBindings') continue;
|
|
98
100
|
if (key !== 'components' && key !== 'features') {
|
|
99
101
|
return {
|
|
100
102
|
ok: false,
|
|
@@ -108,6 +110,17 @@
|
|
|
108
110
|
};
|
|
109
111
|
if (list.values.length) next[key] = list.values;
|
|
110
112
|
}
|
|
113
|
+
if (site['functionBindings'] !== undefined) {
|
|
114
|
+
var _next_components;
|
|
115
|
+
const bindings = functionBindingMap(site['functionBindings'], (_next_components = next.components) != null ? _next_components : []);
|
|
116
|
+
if (bindings.ok === false) return {
|
|
117
|
+
ok: false,
|
|
118
|
+
error: bindings.error
|
|
119
|
+
};
|
|
120
|
+
if (Object.keys(bindings.value).length) {
|
|
121
|
+
next.functionBindings = bindings.value;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
111
124
|
if (Object.keys(next).length) out.site = next;
|
|
112
125
|
}
|
|
113
126
|
if (input['console'] !== undefined) {
|
|
@@ -179,6 +192,47 @@ function idList(value, where, pattern) {
|
|
|
179
192
|
values
|
|
180
193
|
};
|
|
181
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* `contributes.site.functionBindings`, validated against the components the
|
|
197
|
+
* same block declares: a binding on an element the plugin does not register
|
|
198
|
+
* would hand a function's definition, and the variable values it reads, to
|
|
199
|
+
* whichever element happens to own that id.
|
|
200
|
+
*/ function functionBindingMap(value, components) {
|
|
201
|
+
const where = 'contributes.site.functionBindings';
|
|
202
|
+
if (!isPlainObject(value)) {
|
|
203
|
+
return {
|
|
204
|
+
ok: false,
|
|
205
|
+
error: `${where} must be an object`
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
const entries = Object.entries(value);
|
|
209
|
+
if (entries.length > PLUGIN_MAX_CONTRIBUTIONS) {
|
|
210
|
+
return {
|
|
211
|
+
ok: false,
|
|
212
|
+
error: `${where} lists more than ${PLUGIN_MAX_CONTRIBUTIONS}`
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
const out = {};
|
|
216
|
+
for (const [componentId, prop] of entries){
|
|
217
|
+
if (!components.includes(componentId)) {
|
|
218
|
+
return {
|
|
219
|
+
ok: false,
|
|
220
|
+
error: `${where} names "${componentId}", which contributes.site.components does not declare`
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
if (typeof prop !== 'string' || !BINDING_PROP.test(prop)) {
|
|
224
|
+
return {
|
|
225
|
+
ok: false,
|
|
226
|
+
error: `${where}.${componentId} must name a prop, not "${String(prop)}"`
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
out[componentId] = prop;
|
|
230
|
+
}
|
|
231
|
+
return {
|
|
232
|
+
ok: true,
|
|
233
|
+
value: out
|
|
234
|
+
};
|
|
235
|
+
}
|
|
182
236
|
/**
|
|
183
237
|
* A declared `contributes` block as a loader may trust it: the sanitized
|
|
184
238
|
* block, or `undefined` for one that is absent or does not validate.
|
|
@@ -233,6 +287,64 @@ function idList(value, where, pattern) {
|
|
|
233
287
|
if ((_site_features = site.features) == null ? void 0 : _site_features.length) return true;
|
|
234
288
|
return ((_site_components = site.components) != null ? _site_components : []).some((id)=>page.componentIds.has(id));
|
|
235
289
|
}
|
|
290
|
+
/**
|
|
291
|
+
* Whether a plugin declares anything a site draws: an element an author can
|
|
292
|
+
* place, or a feature that runs on the site's pages. The editor loads exactly
|
|
293
|
+
* these (AGL-3391). A plugin that declares nothing is not among them: its
|
|
294
|
+
* site half is only discoverable by running `register()`, and the console
|
|
295
|
+
* shell already does that for it.
|
|
296
|
+
*/ export function declaresSiteElements(contributes) {
|
|
297
|
+
var _site_components, _site_features;
|
|
298
|
+
const site = contributes == null ? void 0 : contributes.site;
|
|
299
|
+
return Boolean((site == null ? void 0 : (_site_components = site.components) == null ? void 0 : _site_components.length) || (site == null ? void 0 : (_site_features = site.features) == null ? void 0 : _site_features.length));
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Every id a plugin's elements and presets may carry as their `pluginId`: its
|
|
303
|
+
* own id and, for a marketplace plugin, its listing id. A surface that filters
|
|
304
|
+
* registry entries by plugin set needs all of them, or it hides the elements
|
|
305
|
+
* of a plugin it just loaded.
|
|
306
|
+
*/ export function presenceIds(subject) {
|
|
307
|
+
const ids = [];
|
|
308
|
+
for (const id of [
|
|
309
|
+
subject.pluginId,
|
|
310
|
+
subject.listingId
|
|
311
|
+
]){
|
|
312
|
+
if (id && !ids.includes(id)) ids.push(id);
|
|
313
|
+
}
|
|
314
|
+
return ids;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* The function bindings a set of plugins declares, merged into one map.
|
|
318
|
+
*
|
|
319
|
+
* Where two plugins bind the same component id the FIRST one listed wins, so a
|
|
320
|
+
* caller that passes first-party declarations ahead of marketplace ones keeps
|
|
321
|
+
* a marketplace manifest from rebinding a first-party element. Marketplace ids
|
|
322
|
+
* are namespaced by their publisher (see {@link isNamespacedComponentId}), so
|
|
323
|
+
* a collision is a mistake, never a feature.
|
|
324
|
+
*/ export function mergeFunctionBindings(...sources) {
|
|
325
|
+
const merged = {};
|
|
326
|
+
for (const source of sources){
|
|
327
|
+
var _source_contributes_site, _source_contributes;
|
|
328
|
+
if (!source) continue;
|
|
329
|
+
const declared = 'contributes' in source ? (_source_contributes = source.contributes) == null ? void 0 : (_source_contributes_site = _source_contributes.site) == null ? void 0 : _source_contributes_site.functionBindings : source;
|
|
330
|
+
for (const [componentId, prop] of Object.entries(declared != null ? declared : {})){
|
|
331
|
+
if (typeof prop !== 'string') continue;
|
|
332
|
+
if (!Object.prototype.hasOwnProperty.call(merged, componentId)) {
|
|
333
|
+
merged[componentId] = prop;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
return merged;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Whether a component id belongs to a marketplace plugin's namespace
|
|
341
|
+
* (AGL-3387): `<publisher handle>.<plugin id>.<role>`. A `.` is reserved for
|
|
342
|
+
* those ids — no first-party component carries one, which the manifest
|
|
343
|
+
* generator enforces — so compose can tell, without loading anything, that a
|
|
344
|
+
* tree places an element only an installed plugin can declare.
|
|
345
|
+
*/ export function isNamespacedComponentId(componentId) {
|
|
346
|
+
return typeof componentId === 'string' && componentId.includes('.');
|
|
347
|
+
}
|
|
236
348
|
export function consoleLoadPoints(contributes) {
|
|
237
349
|
var _contributes_console, _declared_slots, _declared_routes, _declared_orgRoutes;
|
|
238
350
|
if (!contributes) return {
|
|
@@ -271,6 +383,7 @@ export function consoleLoadPoints(contributes) {
|
|
|
271
383
|
* provider is only discoverable by running `register()`, so narrowing it
|
|
272
384
|
* anywhere else would take a tab away with no way to notice.
|
|
273
385
|
*/ export function isPluginUsedInConsole(contributes, where) {
|
|
386
|
+
if (where.at === 'editor') return declaresSiteElements(contributes);
|
|
274
387
|
const points = consoleLoadPoints(contributes);
|
|
275
388
|
if (where.at === 'shell') return points.shell;
|
|
276
389
|
if (where.at === 'slots') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/plugin-manager/plugin-contributions.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * What a plugin contributes, and where (AGL-3116).\n *\n * A plugin loads only where something uses it. Installing one loads nothing:\n * a published page fetches a plugin's code when the page places one of its\n * elements or the site runs one of its features, and a console screen\n * fetches it when the screen renders one of its slots or routes, or when the\n * plugin draws something the shell renders on every screen.\n *\n * The loaders cannot learn that by running a plugin, because running it is\n * the cost being avoided. So each plugin DECLARES its contributions:\n * first-party plugins in `plugins.config.json`, marketplace plugins in the\n * manifest they publish (`contributes`). The declaration is the whole of what\n * a loader reads, and it is data: this module is dependency-free so the\n * server, both apps, the verifier and the build tools share one reading.\n *\n * A declared surface only narrows where to look. Presence is the rule: a\n * plugin that declares a component loads on the pages that place it, not on\n * every page of the site that installed it.\n *\n * ## A plugin that declares nothing\n *\n * Every marketplace version published before this contract has no\n * `contributes`. Such a plugin keeps working under one default:\n *\n * - **On a published page it loads only where its element is placed**: a\n * node whose `pluginId` names the plugin (its manifest id or its listing\n * id). That is the one presence signal a page carries without running the\n * bundle, and it is the only way a page can show an element the plugin\n * registers. A site runtime of an undeclared plugin does not load, and the\n * publish pipeline refuses a bundle that registers one without declaring\n * it, so the only plugins this default governs are the ones already\n * published.\n * - **In the console it loads with the workspace shell**, as it always did,\n * because a nav tab or a provider is only discoverable by running\n * `register()`. Nothing on a published page depends on this.\n */\n\n/** What a plugin adds to a published site. */\nexport interface PluginSiteContributions {\n /**\n * Canvas component ids the plugin registers: the elements a page places. A\n * published page loads the plugin only when its node tree places one.\n */\n components?: string[]\n /**\n * Site features: runtimes the plugin mounts on every page of a site that\n * switched it on (an announcement bar, an experiment runner), named by the\n * `runtimeId` it registers. A plugin with a feature loads on every page of\n * such a site, which is what a feature is.\n */\n features?: string[]\n}\n\n/** What a plugin adds to the console. */\nexport interface PluginConsoleContributions {\n /**\n * The widget slots its widgets fill: the `CONSOLE_WIDGET_SLOTS` zones, the\n * panels the shell draws as slots (the assistant dock `assistPanel`, the\n * besigner's `besignerInspector`), and zones another plugin hosts. A screen\n * that renders one of them loads the plugin.\n */\n slots?: string[]\n /** Site-level console routes it serves (`/forms`), beneath `/hosts/[host]`. */\n routes?: string[]\n /** Organization-level console routes it serves (`/outreach`). */\n orgRoutes?: string[]\n /**\n * The shell draws something of it on every screen of a workspace: a nav\n * tab, an organization tab, a staff tab or a provider. Such a plugin loads\n * with the shell, because every screen renders it.\n */\n shell?: boolean\n}\n\nexport interface PluginContributions {\n site?: PluginSiteContributions\n console?: PluginConsoleContributions\n}\n\n/** Bound on each declared list, so a manifest cannot hand a loader a novel. */\nexport const PLUGIN_MAX_CONTRIBUTIONS = 128\n\n/**\n * A component, feature or slot id: an identifier with the separators ids in\n * the platform use (`muiTypography`, `marketplacePlugin`, `ai.assist`).\n */\nconst CONTRIBUTION_ID = /^[A-Za-z_][A-Za-z0-9_.:-]{0,79}$/\n\n/**\n * A console route: one or more path segments, as a nav item's `href` names\n * them. Never a URL, never `..`.\n */\nconst CONTRIBUTION_ROUTE = /^(\\/[A-Za-z0-9_-]+){1,8}$/\n\ntype Sanitized =\n | { ok: true; contributions: PluginContributions }\n | { ok: false; error: string }\n\n/**\n * Validates a declared `contributes` block.\n *\n * Malformed input is REFUSED rather than trimmed: a loader reads this to\n * decide where a plugin runs, so a declaration that silently lost an entry\n * would stop the plugin loading where it is used, and nobody would see why.\n * Duplicates are collapsed and empty lists dropped, because neither changes\n * what the declaration means.\n *\n * `{}` is valid and means \"contributes nothing anywhere\", which is a\n * different statement from an absent block (see the module note).\n */\nexport function sanitizePluginContributions(input: unknown): Sanitized {\n if (!isPlainObject(input)) {\n return { ok: false, error: 'contributes must be an object' }\n }\n const out: PluginContributions = {}\n for (const key of Object.keys(input)) {\n if (key !== 'site' && key !== 'console') {\n return { ok: false, error: `contributes.${key} is not a known surface` }\n }\n }\n\n if (input['site'] !== undefined) {\n const site = input['site']\n if (!isPlainObject(site)) {\n return { ok: false, error: 'contributes.site must be an object' }\n }\n const next: PluginSiteContributions = {}\n for (const key of Object.keys(site)) {\n if (key !== 'components' && key !== 'features') {\n return { ok: false, error: `contributes.site.${key} is not a known contribution` }\n }\n const list = idList(site[key], `contributes.site.${key}`, CONTRIBUTION_ID)\n if (list.ok === false) return { ok: false, error: list.error }\n if (list.values.length) next[key] = list.values\n }\n if (Object.keys(next).length) out.site = next\n }\n\n if (input['console'] !== undefined) {\n const consoleInput = input['console']\n if (!isPlainObject(consoleInput)) {\n return { ok: false, error: 'contributes.console must be an object' }\n }\n const next: PluginConsoleContributions = {}\n for (const key of Object.keys(consoleInput)) {\n if (key === 'shell') {\n if (typeof consoleInput['shell'] !== 'boolean') {\n return { ok: false, error: 'contributes.console.shell must be true or false' }\n }\n if (consoleInput['shell']) next.shell = true\n continue\n }\n if (key !== 'slots' && key !== 'routes' && key !== 'orgRoutes') {\n return {\n ok: false,\n error: `contributes.console.${key} is not a known contribution`,\n }\n }\n const list = idList(\n consoleInput[key],\n `contributes.console.${key}`,\n key === 'slots' ? CONTRIBUTION_ID : CONTRIBUTION_ROUTE,\n )\n if (list.ok === false) return { ok: false, error: list.error }\n if (list.values.length) next[key] = list.values\n }\n if (Object.keys(next).length) out.console = next\n }\n\n return { ok: true, contributions: out }\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return Boolean(value) && typeof value === 'object' && !Array.isArray(value)\n}\n\nfunction idList(\n value: unknown,\n where: string,\n pattern: RegExp,\n): { ok: true; values: string[] } | { ok: false; error: string } {\n if (!Array.isArray(value)) return { ok: false, error: `${where} must be a list` }\n if (value.length > PLUGIN_MAX_CONTRIBUTIONS) {\n return { ok: false, error: `${where} lists more than ${PLUGIN_MAX_CONTRIBUTIONS}` }\n }\n const values: string[] = []\n for (const entry of value) {\n if (typeof entry !== 'string' || !pattern.test(entry)) {\n return { ok: false, error: `${where} has an invalid entry \"${String(entry)}\"` }\n }\n if (!values.includes(entry)) values.push(entry)\n }\n return { ok: true, values }\n}\n\n/**\n * A declared `contributes` block as a loader may trust it: the sanitized\n * block, or `undefined` for one that is absent or does not validate.\n *\n * Loaders read this from stored documents (a pinned version's manifest), and\n * a malformed stored block is treated as UNDECLARED — the default applies —\n * never as \"contributes nothing\", which would stop a plugin that is in use.\n */\nexport function readPluginContributions(\n input: unknown,\n): PluginContributions | undefined {\n if (input === undefined || input === null) return undefined\n const verdict = sanitizePluginContributions(input)\n return verdict.ok ? verdict.contributions : undefined\n}\n\n/**\n * What the surface a plugin is being registered into actually uses\n * (AGL-3141).\n *\n * The loaders carry this from the surface that computed it to each plugin's\n * register function, unchanged. A plugin that can register a part of itself\n * reads it; one that cannot ignores it, and the platform's behavior is the\n * same either way.\n *\n * An absent field means \"everything of that kind\". A surface that cannot say\n * what it uses must be handed all of it, because an element the surface\n * places and the set omits has no registered component and renders NOTHING,\n * silently (the blank-canvas invariant, AGL-52). Narrowing is an optimization\n * and must fail toward the whole.\n */\nexport interface PluginUse {\n /**\n * Canvas component ids the surface places, read from the FULL composed\n * document the way `pagePresence` reads it — withheld lazy-panel subtrees\n * included, because an element inside a panel the visitor opens later is\n * still this page's element.\n */\n componentIds?: readonly string[]\n}\n\n/** A node as presence reads it: the two ids a placed element carries. */\nexport interface PresenceNode {\n componentId?: string\n pluginId?: string\n}\n\n/** What a published page places: its component ids and the plugin ids stamped on its nodes. */\nexport interface PagePresence {\n componentIds: ReadonlySet<string>\n pluginIds: ReadonlySet<string>\n}\n\n/**\n * The component ids and plugin ids a node tree places.\n *\n * Read from the FULL composed document — layouts, grafted reusable\n * components and withheld lazy panels included — because an element inside\n * a panel the visitor opens later is still this page's element.\n */\nexport function pagePresence(\n nodes: Record<string, PresenceNode | null | undefined> | null | undefined,\n): PagePresence {\n const componentIds = new Set<string>()\n const pluginIds = new Set<string>()\n for (const node of Object.values(nodes ?? {})) {\n if (typeof node?.componentId === 'string' && node.componentId) {\n componentIds.add(node.componentId)\n }\n if (typeof node?.pluginId === 'string' && node.pluginId) {\n pluginIds.add(node.pluginId)\n }\n }\n return { componentIds, pluginIds }\n}\n\n/** A plugin as the presence rules see it. */\nexport interface PresenceSubject {\n /** The plugin's own id (a manifest `id`, or a first-party catalog id). */\n pluginId?: string\n /** A marketplace plugin's listing id, which its elements may carry instead. */\n listingId?: string\n /** Its declaration; `undefined` when it declares nothing. */\n contributes?: PluginContributions\n}\n\n/**\n * Whether a published page uses a plugin, so the page must load it.\n *\n * - An element of it is placed: a node stamped with the plugin's id, or,\n * for a declared plugin, a node whose component id it declares.\n * - It declares a site feature. The caller only asks about plugins the site\n * has switched on, and a feature runs on every page of such a site.\n *\n * A plugin that declares nothing is present only through its stamped\n * elements — the default in the module note.\n */\nexport function isPluginUsedOnPage(\n subject: PresenceSubject,\n page: PagePresence,\n): boolean {\n if (subject.pluginId && page.pluginIds.has(subject.pluginId)) return true\n if (subject.listingId && page.pluginIds.has(subject.listingId)) return true\n const site = subject.contributes?.site\n if (!site) return false\n if (site.features?.length) return true\n return (site.components ?? []).some((id) => page.componentIds.has(id))\n}\n\n/**\n * Where a plugin's console code loads, resolved with the default applied: a\n * plugin that declares nothing loads with the shell, as it always did.\n */\nexport interface ConsoleLoadPoints {\n shell: boolean\n slots: readonly string[]\n routes: readonly string[]\n orgRoutes: readonly string[]\n}\n\nexport function consoleLoadPoints(\n contributes: PluginContributions | undefined,\n): ConsoleLoadPoints {\n if (!contributes) return { shell: true, slots: [], routes: [], orgRoutes: [] }\n const declared = contributes.console ?? {}\n return {\n shell: Boolean(declared.shell),\n slots: declared.slots ?? [],\n routes: declared.routes ?? [],\n orgRoutes: declared.orgRoutes ?? [],\n }\n}\n\n/**\n * Whether a declared route serves `href`: the route itself, or a path beneath\n * it on a segment boundary, the way the shell's page resolver matches a nav\n * item that owns its subtree. `/products` serves `/products/orders` and never\n * `/products-archive`.\n */\nexport function routeServes(route: string, href: string): boolean {\n return href === route || href.startsWith(`${route}/`)\n}\n\n/**\n * A place in the console that loads plugins, as the surface drawing it names\n * itself (AGL-3142).\n *\n * - `shell`: the workspace chrome every screen has. It draws whatever a\n * plugin adds to every screen — a nav tab, an organization tab, a staff\n * tab, a provider — so a plugin that declares any of those loads here, and\n * so does one that declares nothing at all.\n * - `slots`: the zones a screen renders. The zones it names, not the plugins\n * it expects in them: a screen must never hold a plugin id.\n * - `route`: the path the reader has open, plugin-relative (`/products`,\n * `/products/orders`), on the level its route tree serves — `site` beneath\n * `/hosts/[host]`, `org` beneath the organization.\n */\nexport type ConsoleLoadWhere =\n | { at: 'shell' }\n | { at: 'slots'; slots: readonly string[] }\n | { at: 'route'; href: string; level: 'site' | 'org' }\n\n/**\n * Whether a console surface uses a plugin, so it must load it.\n *\n * The console twin of {@link isPluginUsedOnPage}, and the same rule: a\n * declaration says where a plugin's code belongs, and the surface that draws\n * that place is the one that fetches it. A screen asks about the zones it\n * renders and the path it serves; it never asks about a plugin by name.\n *\n * A plugin that declares nothing loads with the shell — the default in the\n * module note, and the reason the shell branch reads\n * {@link consoleLoadPoints} rather than the raw block. Its nav tab or its\n * provider is only discoverable by running `register()`, so narrowing it\n * anywhere else would take a tab away with no way to notice.\n */\nexport function isPluginUsedInConsole(\n contributes: PluginContributions | undefined,\n where: ConsoleLoadWhere,\n): boolean {\n const points = consoleLoadPoints(contributes)\n if (where.at === 'shell') return points.shell\n if (where.at === 'slots') {\n return points.slots.some((slot) => where.slots.includes(slot))\n }\n const routes = where.level === 'org' ? points.orgRoutes : points.routes\n return routes.some((route) => routeServes(route, where.href))\n}\n"],"names":["PLUGIN_MAX_CONTRIBUTIONS","CONTRIBUTION_ID","CONTRIBUTION_ROUTE","sanitizePluginContributions","input","isPlainObject","ok","error","out","key","Object","keys","undefined","site","next","list","idList","values","length","consoleInput","shell","console","contributions","value","Boolean","Array","isArray","where","pattern","entry","test","String","includes","push","readPluginContributions","verdict","pagePresence","nodes","componentIds","Set","pluginIds","node","componentId","add","pluginId","isPluginUsedOnPage","subject","page","has","listingId","contributes","features","components","some","id","consoleLoadPoints","declared","slots","routes","orgRoutes","routeServes","route","href","startsWith","isPluginUsedInConsole","points","at","slot","level"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCC,GAED,4CAA4C,GA0C5C,6EAA6E,GAC7E,OAAO,MAAMA,2BAA2B,IAAG;AAE3C;;;CAGC,GACD,MAAMC,kBAAkB;AAExB;;;CAGC,GACD,MAAMC,qBAAqB;AAM3B;;;;;;;;;;;CAWC,GACD,OAAO,SAASC,4BAA4BC,KAAc;IACxD,IAAI,CAACC,cAAcD,QAAQ;QACzB,OAAO;YAAEE,IAAI;YAAOC,OAAO;QAAgC;IAC7D;IACA,MAAMC,MAA2B,CAAC;IAClC,KAAK,MAAMC,OAAOC,OAAOC,IAAI,CAACP,OAAQ;QACpC,IAAIK,QAAQ,UAAUA,QAAQ,WAAW;YACvC,OAAO;gBAAEH,IAAI;gBAAOC,OAAO,CAAC,YAAY,EAAEE,IAAI,uBAAuB,CAAC;YAAC;QACzE;IACF;IAEA,IAAIL,KAAK,CAAC,OAAO,KAAKQ,WAAW;QAC/B,MAAMC,OAAOT,KAAK,CAAC,OAAO;QAC1B,IAAI,CAACC,cAAcQ,OAAO;YACxB,OAAO;gBAAEP,IAAI;gBAAOC,OAAO;YAAqC;QAClE;QACA,MAAMO,OAAgC,CAAC;QACvC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AAMqC,OAAO,EAAE;QAAEC,QAAQ,EAAE;QAAEC,WAAW,EAAE;IAAC;IAC7E,MAAMH,YAAWN,uBAAAA,YAAY7B,OAAO,YAAnB6B,uBAAuB,CAAC;IACzC,OAAO;QACL9B,OAAOI,QAAQgC,SAASpC,KAAK;QAC7BqC,KAAK,GAAED,kBAAAA,SAASC,KAAK,YAAdD,kBAAkB,EAAE;QAC3BE,MAAM,GAAEF,mBAAAA,SAASE,MAAM,YAAfF,mBAAmB,EAAE;QAC7BG,SAAS,GAAEH,sBAAAA,SAASG,SAAS,YAAlBH,sBAAsB,EAAE;IACrC;AACF;AAEA;;;;;CAKC,GACD,OAAO,SAASI,YAAYC,KAAa,EAAEC,IAAY;IACrD,OAAOA,SAASD,SAASC,KAAKC,UAAU,CAAC,GAAGF,MAAM,CAAC,CAAC;AACtD;AAqBA;;;;;;;;;;;;;CAaC,GACD,OAAO,SAASG,sBACdd,WAA4C,EAC5CvB,KAAuB;IAEvB,MAAMsC,SAASV,kBAAkBL;IACjC,IAAIvB,MAAMuC,EAAE,KAAK,SAAS,OAAOD,OAAO7C,KAAK;IAC7C,IAAIO,MAAMuC,EAAE,KAAK,SAAS;QACxB,OAAOD,OAAOR,KAAK,CAACJ,IAAI,CAAC,CAACc,OAASxC,MAAM8B,KAAK,CAACzB,QAAQ,CAACmC;IAC1D;IACA,MAAMT,SAAS/B,MAAMyC,KAAK,KAAK,QAAQH,OAAON,SAAS,GAAGM,OAAOP,MAAM;IACvE,OAAOA,OAAOL,IAAI,CAAC,CAACQ,QAAUD,YAAYC,OAAOlC,MAAMmC,IAAI;AAC7D"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/plugin-manager/plugin-contributions.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * What a plugin contributes, and where (AGL-3116).\n *\n * A plugin loads only where something uses it. Installing one loads nothing:\n * a published page fetches a plugin's code when the page places one of its\n * elements or the site runs one of its features, and a console screen\n * fetches it when the screen renders one of its slots or routes, or when the\n * plugin draws something the shell renders on every screen.\n *\n * The loaders cannot learn that by running a plugin, because running it is\n * the cost being avoided. So each plugin DECLARES its contributions:\n * first-party plugins in `plugins.config.json`, marketplace plugins in the\n * manifest they publish (`contributes`). The declaration is the whole of what\n * a loader reads, and it is data: this module is dependency-free so the\n * server, both apps, the verifier and the build tools share one reading.\n *\n * A declared surface only narrows where to look. Presence is the rule: a\n * plugin that declares a component loads on the pages that place it, not on\n * every page of the site that installed it.\n *\n * ## A plugin that declares nothing\n *\n * Every marketplace version published before this contract has no\n * `contributes`. Such a plugin keeps working under one default:\n *\n * - **On a published page it loads only where its element is placed**: a\n * node whose `pluginId` names the plugin (its manifest id or its listing\n * id). That is the one presence signal a page carries without running the\n * bundle, and it is the only way a page can show an element the plugin\n * registers. A site runtime of an undeclared plugin does not load, and the\n * publish pipeline refuses a bundle that registers one without declaring\n * it, so the only plugins this default governs are the ones already\n * published.\n * - **In the console it loads with the workspace shell**, as it always did,\n * because a nav tab or a provider is only discoverable by running\n * `register()`. Nothing on a published page depends on this.\n */\n\n/** What a plugin adds to a published site. */\nexport interface PluginSiteContributions {\n /**\n * Canvas component ids the plugin registers: the elements a page places. A\n * published page loads the plugin only when its node tree places one.\n */\n components?: string[]\n /**\n * Site features: runtimes the plugin mounts on every page of a site that\n * switched it on (an announcement bar, an experiment runner), named by the\n * `runtimeId` it registers. A plugin with a feature loads on every page of\n * such a site, which is what a feature is.\n */\n features?: string[]\n /**\n * The elements that run a site function in the visitor's browser (AGL-3393),\n * each keyed by its component id and naming the prop that holds the\n * function's name. Compose hands such a node the function's definition and\n * the site variables it reads; no other node is given either.\n *\n * Declared DATA rather than read off a registered schema: compose runs where\n * no plugin code loads — the tenant's server components — so the only thing\n * it can consult is a declaration. A first-party plugin declares it in\n * `plugins.config.json`, a marketplace plugin in its manifest, and both reach\n * compose as the same map. Every key must also be one of `components`.\n */\n functionBindings?: Record<string, string>\n}\n\n/** What a plugin adds to the console. */\nexport interface PluginConsoleContributions {\n /**\n * The widget slots its widgets fill: the `CONSOLE_WIDGET_SLOTS` zones, the\n * panels the shell draws as slots (the assistant dock `assistPanel`, the\n * besigner's `besignerInspector`), and zones another plugin hosts. A screen\n * that renders one of them loads the plugin.\n */\n slots?: string[]\n /** Site-level console routes it serves (`/forms`), beneath `/hosts/[host]`. */\n routes?: string[]\n /** Organization-level console routes it serves (`/outreach`). */\n orgRoutes?: string[]\n /**\n * The shell draws something of it on every screen of a workspace: a nav\n * tab, an organization tab, a staff tab or a provider. Such a plugin loads\n * with the shell, because every screen renders it.\n */\n shell?: boolean\n}\n\nexport interface PluginContributions {\n site?: PluginSiteContributions\n console?: PluginConsoleContributions\n}\n\n/** Bound on each declared list, so a manifest cannot hand a loader a novel. */\nexport const PLUGIN_MAX_CONTRIBUTIONS = 128\n\n/**\n * A component, feature or slot id: an identifier with the separators ids in\n * the platform use (`muiTypography`, `marketplacePlugin`, `ai.assist`).\n */\nconst CONTRIBUTION_ID = /^[A-Za-z_][A-Za-z0-9_.:-]{0,79}$/\n\n/**\n * A console route: one or more path segments, as a nav item's `href` names\n * them. Never a URL, never `..`.\n */\nconst CONTRIBUTION_ROUTE = /^(\\/[A-Za-z0-9_-]+){1,8}$/\n\n/** A prop name a function binding may name: a plain identifier. */\nconst BINDING_PROP = /^[A-Za-z_$][A-Za-z0-9_$]{0,63}$/\n\ntype Sanitized =\n | { ok: true; contributions: PluginContributions }\n | { ok: false; error: string }\n\n/**\n * Validates a declared `contributes` block.\n *\n * Malformed input is REFUSED rather than trimmed: a loader reads this to\n * decide where a plugin runs, so a declaration that silently lost an entry\n * would stop the plugin loading where it is used, and nobody would see why.\n * Duplicates are collapsed and empty lists dropped, because neither changes\n * what the declaration means.\n *\n * `{}` is valid and means \"contributes nothing anywhere\", which is a\n * different statement from an absent block (see the module note).\n */\nexport function sanitizePluginContributions(input: unknown): Sanitized {\n if (!isPlainObject(input)) {\n return { ok: false, error: 'contributes must be an object' }\n }\n const out: PluginContributions = {}\n for (const key of Object.keys(input)) {\n if (key !== 'site' && key !== 'console') {\n return { ok: false, error: `contributes.${key} is not a known surface` }\n }\n }\n\n if (input['site'] !== undefined) {\n const site = input['site']\n if (!isPlainObject(site)) {\n return { ok: false, error: 'contributes.site must be an object' }\n }\n const next: PluginSiteContributions = {}\n for (const key of Object.keys(site)) {\n if (key === 'functionBindings') continue\n if (key !== 'components' && key !== 'features') {\n return { ok: false, error: `contributes.site.${key} is not a known contribution` }\n }\n const list = idList(site[key], `contributes.site.${key}`, CONTRIBUTION_ID)\n if (list.ok === false) return { ok: false, error: list.error }\n if (list.values.length) next[key] = list.values\n }\n if (site['functionBindings'] !== undefined) {\n const bindings = functionBindingMap(\n site['functionBindings'],\n next.components ?? [],\n )\n if (bindings.ok === false) return { ok: false, error: bindings.error }\n if (Object.keys(bindings.value).length) {\n next.functionBindings = bindings.value\n }\n }\n if (Object.keys(next).length) out.site = next\n }\n\n if (input['console'] !== undefined) {\n const consoleInput = input['console']\n if (!isPlainObject(consoleInput)) {\n return { ok: false, error: 'contributes.console must be an object' }\n }\n const next: PluginConsoleContributions = {}\n for (const key of Object.keys(consoleInput)) {\n if (key === 'shell') {\n if (typeof consoleInput['shell'] !== 'boolean') {\n return { ok: false, error: 'contributes.console.shell must be true or false' }\n }\n if (consoleInput['shell']) next.shell = true\n continue\n }\n if (key !== 'slots' && key !== 'routes' && key !== 'orgRoutes') {\n return {\n ok: false,\n error: `contributes.console.${key} is not a known contribution`,\n }\n }\n const list = idList(\n consoleInput[key],\n `contributes.console.${key}`,\n key === 'slots' ? CONTRIBUTION_ID : CONTRIBUTION_ROUTE,\n )\n if (list.ok === false) return { ok: false, error: list.error }\n if (list.values.length) next[key] = list.values\n }\n if (Object.keys(next).length) out.console = next\n }\n\n return { ok: true, contributions: out }\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return Boolean(value) && typeof value === 'object' && !Array.isArray(value)\n}\n\nfunction idList(\n value: unknown,\n where: string,\n pattern: RegExp,\n): { ok: true; values: string[] } | { ok: false; error: string } {\n if (!Array.isArray(value)) return { ok: false, error: `${where} must be a list` }\n if (value.length > PLUGIN_MAX_CONTRIBUTIONS) {\n return { ok: false, error: `${where} lists more than ${PLUGIN_MAX_CONTRIBUTIONS}` }\n }\n const values: string[] = []\n for (const entry of value) {\n if (typeof entry !== 'string' || !pattern.test(entry)) {\n return { ok: false, error: `${where} has an invalid entry \"${String(entry)}\"` }\n }\n if (!values.includes(entry)) values.push(entry)\n }\n return { ok: true, values }\n}\n\n/**\n * `contributes.site.functionBindings`, validated against the components the\n * same block declares: a binding on an element the plugin does not register\n * would hand a function's definition, and the variable values it reads, to\n * whichever element happens to own that id.\n */\nfunction functionBindingMap(\n value: unknown,\n components: readonly string[],\n): { ok: true; value: Record<string, string> } | { ok: false; error: string } {\n const where = 'contributes.site.functionBindings'\n if (!isPlainObject(value)) {\n return { ok: false, error: `${where} must be an object` }\n }\n const entries = Object.entries(value)\n if (entries.length > PLUGIN_MAX_CONTRIBUTIONS) {\n return { ok: false, error: `${where} lists more than ${PLUGIN_MAX_CONTRIBUTIONS}` }\n }\n const out: Record<string, string> = {}\n for (const [componentId, prop] of entries) {\n if (!components.includes(componentId)) {\n return {\n ok: false,\n error: `${where} names \"${componentId}\", which contributes.site.components does not declare`,\n }\n }\n if (typeof prop !== 'string' || !BINDING_PROP.test(prop)) {\n return {\n ok: false,\n error: `${where}.${componentId} must name a prop, not \"${String(prop)}\"`,\n }\n }\n out[componentId] = prop\n }\n return { ok: true, value: out }\n}\n\n/**\n * A declared `contributes` block as a loader may trust it: the sanitized\n * block, or `undefined` for one that is absent or does not validate.\n *\n * Loaders read this from stored documents (a pinned version's manifest), and\n * a malformed stored block is treated as UNDECLARED — the default applies —\n * never as \"contributes nothing\", which would stop a plugin that is in use.\n */\nexport function readPluginContributions(\n input: unknown,\n): PluginContributions | undefined {\n if (input === undefined || input === null) return undefined\n const verdict = sanitizePluginContributions(input)\n return verdict.ok ? verdict.contributions : undefined\n}\n\n/**\n * What the surface a plugin is being registered into actually uses\n * (AGL-3141).\n *\n * The loaders carry this from the surface that computed it to each plugin's\n * register function, unchanged. A plugin that can register a part of itself\n * reads it; one that cannot ignores it, and the platform's behavior is the\n * same either way.\n *\n * An absent field means \"everything of that kind\". A surface that cannot say\n * what it uses must be handed all of it, because an element the surface\n * places and the set omits has no registered component and renders NOTHING,\n * silently (the blank-canvas invariant, AGL-52). Narrowing is an optimization\n * and must fail toward the whole.\n */\nexport interface PluginUse {\n /**\n * Canvas component ids the surface places, read from the FULL composed\n * document the way `pagePresence` reads it — withheld lazy-panel subtrees\n * included, because an element inside a panel the visitor opens later is\n * still this page's element.\n */\n componentIds?: readonly string[]\n}\n\n/** A node as presence reads it: the two ids a placed element carries. */\nexport interface PresenceNode {\n componentId?: string\n pluginId?: string\n}\n\n/** What a published page places: its component ids and the plugin ids stamped on its nodes. */\nexport interface PagePresence {\n componentIds: ReadonlySet<string>\n pluginIds: ReadonlySet<string>\n}\n\n/**\n * The component ids and plugin ids a node tree places.\n *\n * Read from the FULL composed document — layouts, grafted reusable\n * components and withheld lazy panels included — because an element inside\n * a panel the visitor opens later is still this page's element.\n */\nexport function pagePresence(\n nodes: Record<string, PresenceNode | null | undefined> | null | undefined,\n): PagePresence {\n const componentIds = new Set<string>()\n const pluginIds = new Set<string>()\n for (const node of Object.values(nodes ?? {})) {\n if (typeof node?.componentId === 'string' && node.componentId) {\n componentIds.add(node.componentId)\n }\n if (typeof node?.pluginId === 'string' && node.pluginId) {\n pluginIds.add(node.pluginId)\n }\n }\n return { componentIds, pluginIds }\n}\n\n/** A plugin as the presence rules see it. */\nexport interface PresenceSubject {\n /** The plugin's own id (a manifest `id`, or a first-party catalog id). */\n pluginId?: string\n /** A marketplace plugin's listing id, which its elements may carry instead. */\n listingId?: string\n /** Its declaration; `undefined` when it declares nothing. */\n contributes?: PluginContributions\n}\n\n/**\n * Whether a published page uses a plugin, so the page must load it.\n *\n * - An element of it is placed: a node stamped with the plugin's id, or,\n * for a declared plugin, a node whose component id it declares.\n * - It declares a site feature. The caller only asks about plugins the site\n * has switched on, and a feature runs on every page of such a site.\n *\n * A plugin that declares nothing is present only through its stamped\n * elements — the default in the module note.\n */\nexport function isPluginUsedOnPage(\n subject: PresenceSubject,\n page: PagePresence,\n): boolean {\n if (subject.pluginId && page.pluginIds.has(subject.pluginId)) return true\n if (subject.listingId && page.pluginIds.has(subject.listingId)) return true\n const site = subject.contributes?.site\n if (!site) return false\n if (site.features?.length) return true\n return (site.components ?? []).some((id) => page.componentIds.has(id))\n}\n\n/**\n * Whether a plugin declares anything a site draws: an element an author can\n * place, or a feature that runs on the site's pages. The editor loads exactly\n * these (AGL-3391). A plugin that declares nothing is not among them: its\n * site half is only discoverable by running `register()`, and the console\n * shell already does that for it.\n */\nexport function declaresSiteElements(\n contributes: PluginContributions | undefined,\n): boolean {\n const site = contributes?.site\n return Boolean(site?.components?.length || site?.features?.length)\n}\n\n/**\n * Every id a plugin's elements and presets may carry as their `pluginId`: its\n * own id and, for a marketplace plugin, its listing id. A surface that filters\n * registry entries by plugin set needs all of them, or it hides the elements\n * of a plugin it just loaded.\n */\nexport function presenceIds(subject: PresenceSubject): string[] {\n const ids: string[] = []\n for (const id of [subject.pluginId, subject.listingId]) {\n if (id && !ids.includes(id)) ids.push(id)\n }\n return ids\n}\n\n/**\n * Function bindings (AGL-3393): component id → the prop naming the site\n * function that element runs.\n */\nexport type FunctionBindings = Readonly<Record<string, string>>\n\n/**\n * The function bindings a set of plugins declares, merged into one map.\n *\n * Where two plugins bind the same component id the FIRST one listed wins, so a\n * caller that passes first-party declarations ahead of marketplace ones keeps\n * a marketplace manifest from rebinding a first-party element. Marketplace ids\n * are namespaced by their publisher (see {@link isNamespacedComponentId}), so\n * a collision is a mistake, never a feature.\n */\nexport function mergeFunctionBindings(\n ...sources: ReadonlyArray<\n FunctionBindings | { contributes?: PluginContributions } | null | undefined\n >\n): FunctionBindings {\n const merged: Record<string, string> = {}\n for (const source of sources) {\n if (!source) continue\n const declared: FunctionBindings | undefined =\n 'contributes' in source\n ? (source.contributes as PluginContributions | undefined)?.site\n ?.functionBindings\n : (source as FunctionBindings)\n for (const [componentId, prop] of Object.entries(declared ?? {})) {\n if (typeof prop !== 'string') continue\n if (!Object.prototype.hasOwnProperty.call(merged, componentId)) {\n merged[componentId] = prop\n }\n }\n }\n return merged\n}\n\n/**\n * Whether a component id belongs to a marketplace plugin's namespace\n * (AGL-3387): `<publisher handle>.<plugin id>.<role>`. A `.` is reserved for\n * those ids — no first-party component carries one, which the manifest\n * generator enforces — so compose can tell, without loading anything, that a\n * tree places an element only an installed plugin can declare.\n */\nexport function isNamespacedComponentId(componentId: unknown): boolean {\n return typeof componentId === 'string' && componentId.includes('.')\n}\n\n/**\n * Where a plugin's console code loads, resolved with the default applied: a\n * plugin that declares nothing loads with the shell, as it always did.\n */\nexport interface ConsoleLoadPoints {\n shell: boolean\n slots: readonly string[]\n routes: readonly string[]\n orgRoutes: readonly string[]\n}\n\nexport function consoleLoadPoints(\n contributes: PluginContributions | undefined,\n): ConsoleLoadPoints {\n if (!contributes) return { shell: true, slots: [], routes: [], orgRoutes: [] }\n const declared = contributes.console ?? {}\n return {\n shell: Boolean(declared.shell),\n slots: declared.slots ?? [],\n routes: declared.routes ?? [],\n orgRoutes: declared.orgRoutes ?? [],\n }\n}\n\n/**\n * Whether a declared route serves `href`: the route itself, or a path beneath\n * it on a segment boundary, the way the shell's page resolver matches a nav\n * item that owns its subtree. `/products` serves `/products/orders` and never\n * `/products-archive`.\n */\nexport function routeServes(route: string, href: string): boolean {\n return href === route || href.startsWith(`${route}/`)\n}\n\n/**\n * A place in the console that loads plugins, as the surface drawing it names\n * itself (AGL-3142).\n *\n * - `shell`: the workspace chrome every screen has. It draws whatever a\n * plugin adds to every screen — a nav tab, an organization tab, a staff\n * tab, a provider — so a plugin that declares any of those loads here, and\n * so does one that declares nothing at all.\n * - `slots`: the zones a screen renders. The zones it names, not the plugins\n * it expects in them: a screen must never hold a plugin id.\n * - `route`: the path the reader has open, plugin-relative (`/products`,\n * `/products/orders`), on the level its route tree serves — `site` beneath\n * `/hosts/[host]`, `org` beneath the organization.\n * - `editor`: the Besigner, which draws a site's elements and offers them in\n * its Elements panel (AGL-3391). A plugin loads here when it declares site\n * elements or site features, whether or not the page open uses them, since\n * the author is choosing what to place.\n */\nexport type ConsoleLoadWhere =\n | { at: 'shell' }\n | { at: 'slots'; slots: readonly string[] }\n | { at: 'route'; href: string; level: 'site' | 'org' }\n | { at: 'editor' }\n\n/**\n * Whether a console surface uses a plugin, so it must load it.\n *\n * The console twin of {@link isPluginUsedOnPage}, and the same rule: a\n * declaration says where a plugin's code belongs, and the surface that draws\n * that place is the one that fetches it. A screen asks about the zones it\n * renders and the path it serves; it never asks about a plugin by name.\n *\n * A plugin that declares nothing loads with the shell — the default in the\n * module note, and the reason the shell branch reads\n * {@link consoleLoadPoints} rather than the raw block. Its nav tab or its\n * provider is only discoverable by running `register()`, so narrowing it\n * anywhere else would take a tab away with no way to notice.\n */\nexport function isPluginUsedInConsole(\n contributes: PluginContributions | undefined,\n where: ConsoleLoadWhere,\n): boolean {\n if (where.at === 'editor') return declaresSiteElements(contributes)\n const points = consoleLoadPoints(contributes)\n if (where.at === 'shell') return points.shell\n if (where.at === 'slots') {\n return points.slots.some((slot) => where.slots.includes(slot))\n }\n const routes = where.level === 'org' ? points.orgRoutes : points.routes\n return routes.some((route) => routeServes(route, where.href))\n}\n"],"names":["PLUGIN_MAX_CONTRIBUTIONS","CONTRIBUTION_ID","CONTRIBUTION_ROUTE","BINDING_PROP","sanitizePluginContributions","input","isPlainObject","ok","error","out","key","Object","keys","undefined","site","next","list","idList","values","length","bindings","functionBindingMap","components","value","functionBindings","consoleInput","shell","console","contributions","Boolean","Array","isArray","where","pattern","entry","test","String","includes","push","entries","componentId","prop","readPluginContributions","verdict","pagePresence","nodes","componentIds","Set","pluginIds","node","add","pluginId","isPluginUsedOnPage","subject","page","has","listingId","contributes","features","some","id","declaresSiteElements","presenceIds","ids","mergeFunctionBindings","sources","merged","source","declared","prototype","hasOwnProperty","call","isNamespacedComponentId","consoleLoadPoints","slots","routes","orgRoutes","routeServes","route","href","startsWith","isPluginUsedInConsole","at","points","slot","level"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCC,GAED,4CAA4C,GAuD5C,6EAA6E,GAC7E,OAAO,MAAMA,2BAA2B,IAAG;AAE3C;;;CAGC,GACD,MAAMC,kBAAkB;AAExB;;;CAGC,GACD,MAAMC,qBAAqB;AAE3B,iEAAiE,GACjE,MAAMC,eAAe;AAMrB;;;;;;;;;;;CAWC,GACD,OAAO,SAASC,4BAA4BC,KAAc;IACxD,IAAI,CAACC,cAAcD,QAAQ;QACzB,OAAO;YAAEE,IAAI;YAAOC,OAAO;QAAgC;IAC7D;IACA,MAAMC,MAA2B,CAAC;IAClC,KAAK,MAAMC,OAAOC,OAAOC,IAAI,CAACP,OAAQ;QACpC,IAAIK,QAAQ,UAAUA,QAAQ,WAAW;YACvC,OAAO;gBAAEH,IAAI;gBAAOC,OAAO,CAAC,YAAY,EAAEE,IAAI,uBAAuB,CAAC;YAAC;QACzE;IACF;IAEA,IAAIL,KAAK,CAAC,OAAO,KAAKQ,WAAW;QAC/B,MAAMC,OAAOT,KAAK,CAAC,OAAO;QAC1B,IAAI,CAACC,cAAcQ,OAAO;YACxB,OAAO;gBAAEP,IAAI;gBAAOC,OAAO;YAAqC;QAClE;QACA,MAAMO,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.mjs
|
|
4
|
+
*
|
|
5
|
+
* The realm plugin surface of `@aglyn/aglyn` (AGL-3392): what a signed
|
|
6
|
+
* bundle reads from core. Imported only by the lazily loaded host module.
|
|
7
|
+
*/
|
|
8
|
+
export declare const AGLYN_HOST_SURFACE: Readonly<Record<string, unknown>>;
|