@aglyn/aglyn 1.23.1 → 1.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/package.json +11 -11
  2. package/src/lib/app-utils/activity-presenter.d.ts +11 -0
  3. package/src/lib/app-utils/activity-presenter.js +9 -0
  4. package/src/lib/app-utils/activity-presenter.js.map +1 -1
  5. package/src/lib/app-utils/activity-search.d.ts +1 -0
  6. package/src/lib/app-utils/activity-search.js +1 -0
  7. package/src/lib/app-utils/activity-search.js.map +1 -1
  8. package/src/lib/app-utils/agent-api-catalog.d.ts +18 -0
  9. package/src/lib/app-utils/agent-api-catalog.js +8 -1
  10. package/src/lib/app-utils/agent-api-catalog.js.map +1 -1
  11. package/src/lib/app-utils/binding-token-catalog.d.ts +15 -0
  12. package/src/lib/app-utils/binding-token-catalog.js +16 -0
  13. package/src/lib/app-utils/binding-token-catalog.js.map +1 -1
  14. package/src/lib/app-utils/connector-discovery.d.ts +80 -0
  15. package/src/lib/app-utils/connector-discovery.js +107 -0
  16. package/src/lib/app-utils/connector-discovery.js.map +1 -0
  17. package/src/lib/app-utils/docs-help-sections.generated.js +1 -0
  18. package/src/lib/app-utils/docs-help-sections.generated.js.map +1 -1
  19. package/src/lib/app-utils/docs-help.generated.d.ts +4 -4
  20. package/src/lib/app-utils/docs-help.generated.js +5 -3
  21. package/src/lib/app-utils/docs-help.generated.js.map +1 -1
  22. package/src/lib/app-utils/docs-index.generated.js +122 -3
  23. package/src/lib/app-utils/docs-index.generated.js.map +1 -1
  24. package/src/lib/app-utils/entity-picker-context.d.ts +6 -0
  25. package/src/lib/app-utils/entity-picker-context.js.map +1 -1
  26. package/src/lib/app-utils/expand-repeatables.js +25 -2
  27. package/src/lib/app-utils/expand-repeatables.js.map +1 -1
  28. package/src/lib/app-utils/native-app-association.d.ts +4 -2
  29. package/src/lib/app-utils/native-app-association.js +5 -2
  30. package/src/lib/app-utils/native-app-association.js.map +1 -1
  31. package/src/lib/app-utils/organizations.js +4 -2
  32. package/src/lib/app-utils/organizations.js.map +1 -1
  33. package/src/lib/app-utils/plugin-release-flags.generated.js +2 -2
  34. package/src/lib/app-utils/plugin-release-flags.generated.js.map +1 -1
  35. package/src/lib/plugin-manager/plugin-contact-capture.d.ts +2 -0
  36. package/src/lib/plugin-manager/plugin-contact-capture.js.map +1 -1
@@ -0,0 +1,107 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ /*==========================================
17
+ * WHERE A CONNECTOR FINDS THE CONSOLE'S SIGN-IN (AGL-4225).
18
+ *
19
+ * An MCP client that is handed `<console>/api/mcp` and answered 401 reads the
20
+ * protected-resource document the challenge names (RFC 9728), then the
21
+ * authorization-server document (RFC 8414), and from there registers, sends
22
+ * the person to the consent page and trades the code for credentials.
23
+ *
24
+ * Every address in that walk is here, in one module with no imports, because
25
+ * the edge middleware has to know the three discovery documents by exact path
26
+ * (it 404s the rest of `/.well-known/*`) and must not pull the server-side
27
+ * credential code into the edge bundle to learn them. The documents
28
+ * themselves are built by `connector-oauth.ts` in the data layer, from these
29
+ * same constants.
30
+ *
31
+ * Nothing here names a host: these are paths, and the functions below take
32
+ * the origin as an argument. Which origin is decided in ONE place, the
33
+ * console's `connectorOrigin` — the configured console URL
34
+ * (`NEXT_PUBLIC_CONSOLE_URL`) when it is set, and only otherwise the host the
35
+ * deployment's proxy reports. A request header cannot choose the issuer of a
36
+ * deployment that has configured its console URL.
37
+ *==========================================*/ /** The MCP endpoint, which is the protected resource. */ export const CONNECTOR_RESOURCE_PATH = '/api/mcp';
38
+ /** The consent page a person is sent to. A console page, behind sign-in. */ export const CONNECTOR_AUTHORIZE_PATH = '/oauth/authorize';
39
+ /** Dynamic client registration (RFC 7591). */ export const CONNECTOR_REGISTER_PATH = '/api/oauth/register';
40
+ /** Code and refresh exchange. */ export const CONNECTOR_TOKEN_PATH = '/api/oauth/token';
41
+ /** Revocation (RFC 7009). */ export const CONNECTOR_REVOKE_PATH = '/api/oauth/revoke';
42
+ /** RFC 9728 §3: the document for the server as a whole. */ export const PROTECTED_RESOURCE_METADATA_PATH = '/.well-known/oauth-protected-resource';
43
+ /**
44
+ * RFC 9728 §3.1: the document for one resource, at the well-known prefix
45
+ * followed by the resource's path. What the 401 challenge names.
46
+ */ export const MCP_PROTECTED_RESOURCE_METADATA_PATH = `${PROTECTED_RESOURCE_METADATA_PATH}${CONNECTOR_RESOURCE_PATH}`;
47
+ /** RFC 8414 §3. The issuer has no path, so neither does this. */ export const AUTHORIZATION_SERVER_METADATA_PATH = '/.well-known/oauth-authorization-server';
48
+ /**
49
+ * The MCP Server Card: a static description of the MCP endpoint that a client
50
+ * or a registry can read BEFORE connecting — where it is, which transport,
51
+ * which protocol revisions.
52
+ *
53
+ * SEP-2127 (MCP Server Cards, Final, Extensions Track) reserves
54
+ * `<streamable-http-url>/server-card` as the recommended location, and its
55
+ * discovery document advises against `.well-known` for cards, so this sits
56
+ * under the endpoint it describes rather than beside the OAuth documents.
57
+ * https://modelcontextprotocol.io/seps/2127-mcp-server-cards
58
+ */ export const MCP_SERVER_CARD_PATH = `${CONNECTOR_RESOURCE_PATH}/server-card`;
59
+ /** The card's media type, per the extension's `docs/discovery.md`. */ export const MCP_SERVER_CARD_MEDIA_TYPE = 'application/mcp-server-card+json';
60
+ /**
61
+ * The `$schema` a card must carry. The extension's schema pins this exact
62
+ * URL (versioned by the `v1` segment, not by date).
63
+ */ export const MCP_SERVER_CARD_SCHEMA = 'https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json';
64
+ /**
65
+ * The three discovery documents the console serves, by EXACT path, and the
66
+ * route handler each is rewritten to. Exactly these: any other path under
67
+ * `/.well-known/` still answers 404, which is the posture the namespace is
68
+ * held to (AGL-3016).
69
+ */ export const CONNECTOR_DISCOVERY_ROUTES = {
70
+ [PROTECTED_RESOURCE_METADATA_PATH]: '/api/oauth/metadata/protected-resource',
71
+ [MCP_PROTECTED_RESOURCE_METADATA_PATH]: '/api/oauth/metadata/protected-resource',
72
+ [AUTHORIZATION_SERVER_METADATA_PATH]: '/api/oauth/metadata/authorization-server'
73
+ };
74
+ /** The route handler serving `pathname`, or `null` when it is not one of the three. */ export function connectorDiscoveryRoute(pathname) {
75
+ return Object.prototype.hasOwnProperty.call(CONNECTOR_DISCOVERY_ROUTES, pathname) ? CONNECTOR_DISCOVERY_ROUTES[pathname] : null;
76
+ }
77
+ /** The resource identifier for the MCP endpoint on `origin`. */ export function connectorResourceFor(origin) {
78
+ return `${origin}${CONNECTOR_RESOURCE_PATH}`;
79
+ }
80
+ /** What a 401 from the MCP endpoint names, so a client can begin the walk. */ export function connectorResourceMetadataUrl(origin) {
81
+ return `${origin}${MCP_PROTECTED_RESOURCE_METADATA_PATH}`;
82
+ }
83
+ /** The authorization server's own document (RFC 8414) on `origin`. */ export function connectorAuthorizationServerMetadataUrl(origin) {
84
+ return `${origin}${AUTHORIZATION_SERVER_METADATA_PATH}`;
85
+ }
86
+ /** The MCP Server Card (SEP-2127) on `origin`. */ export function mcpServerCardUrl(origin) {
87
+ return `${origin}${MCP_SERVER_CARD_PATH}`;
88
+ }
89
+ /**
90
+ * The card's `name`: reverse-DNS of the host that serves the endpoint, then
91
+ * `/mcp`. The card schema (and the MCP Registry's `server.json`) require
92
+ * `namespace/name` matching `^[a-zA-Z0-9.-]+/[a-zA-Z0-9._-]+$`, and a
93
+ * reverse-DNS namespace is the one a registry can verify against the domain,
94
+ * so a self-hosted console names itself rather than borrowing ours.
95
+ * `app.aglyn.com` → `com.aglyn.app/mcp`.
96
+ */ export function mcpServerCardName(origin) {
97
+ let host;
98
+ try {
99
+ host = new URL(origin).hostname;
100
+ } catch (unused) {
101
+ host = '';
102
+ }
103
+ const namespace = host.split('.').filter(Boolean).reverse().join('.').replace(/[^a-zA-Z0-9.-]/g, '-');
104
+ return `${namespace || 'local'}/mcp`;
105
+ }
106
+
107
+ //# sourceMappingURL=connector-discovery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../libs/aglyn/src/lib/app-utils/connector-discovery.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 * WHERE A CONNECTOR FINDS THE CONSOLE'S SIGN-IN (AGL-4225).\n *\n * An MCP client that is handed `<console>/api/mcp` and answered 401 reads the\n * protected-resource document the challenge names (RFC 9728), then the\n * authorization-server document (RFC 8414), and from there registers, sends\n * the person to the consent page and trades the code for credentials.\n *\n * Every address in that walk is here, in one module with no imports, because\n * the edge middleware has to know the three discovery documents by exact path\n * (it 404s the rest of `/.well-known/*`) and must not pull the server-side\n * credential code into the edge bundle to learn them. The documents\n * themselves are built by `connector-oauth.ts` in the data layer, from these\n * same constants.\n *\n * Nothing here names a host: these are paths, and the functions below take\n * the origin as an argument. Which origin is decided in ONE place, the\n * console's `connectorOrigin` — the configured console URL\n * (`NEXT_PUBLIC_CONSOLE_URL`) when it is set, and only otherwise the host the\n * deployment's proxy reports. A request header cannot choose the issuer of a\n * deployment that has configured its console URL.\n *==========================================*/\n\n/** The MCP endpoint, which is the protected resource. */\nexport const CONNECTOR_RESOURCE_PATH = '/api/mcp'\n\n/** The consent page a person is sent to. A console page, behind sign-in. */\nexport const CONNECTOR_AUTHORIZE_PATH = '/oauth/authorize'\n\n/** Dynamic client registration (RFC 7591). */\nexport const CONNECTOR_REGISTER_PATH = '/api/oauth/register'\n\n/** Code and refresh exchange. */\nexport const CONNECTOR_TOKEN_PATH = '/api/oauth/token'\n\n/** Revocation (RFC 7009). */\nexport const CONNECTOR_REVOKE_PATH = '/api/oauth/revoke'\n\n/** RFC 9728 §3: the document for the server as a whole. */\nexport const PROTECTED_RESOURCE_METADATA_PATH = '/.well-known/oauth-protected-resource'\n\n/**\n * RFC 9728 §3.1: the document for one resource, at the well-known prefix\n * followed by the resource's path. What the 401 challenge names.\n */\nexport const MCP_PROTECTED_RESOURCE_METADATA_PATH = `${PROTECTED_RESOURCE_METADATA_PATH}${CONNECTOR_RESOURCE_PATH}`\n\n/** RFC 8414 §3. The issuer has no path, so neither does this. */\nexport const AUTHORIZATION_SERVER_METADATA_PATH = '/.well-known/oauth-authorization-server'\n\n/**\n * The MCP Server Card: a static description of the MCP endpoint that a client\n * or a registry can read BEFORE connecting — where it is, which transport,\n * which protocol revisions.\n *\n * SEP-2127 (MCP Server Cards, Final, Extensions Track) reserves\n * `<streamable-http-url>/server-card` as the recommended location, and its\n * discovery document advises against `.well-known` for cards, so this sits\n * under the endpoint it describes rather than beside the OAuth documents.\n * https://modelcontextprotocol.io/seps/2127-mcp-server-cards\n */\nexport const MCP_SERVER_CARD_PATH = `${CONNECTOR_RESOURCE_PATH}/server-card`\n\n/** The card's media type, per the extension's `docs/discovery.md`. */\nexport const MCP_SERVER_CARD_MEDIA_TYPE = 'application/mcp-server-card+json'\n\n/**\n * The `$schema` a card must carry. The extension's schema pins this exact\n * URL (versioned by the `v1` segment, not by date).\n */\nexport const MCP_SERVER_CARD_SCHEMA =\n 'https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json'\n\n/**\n * The three discovery documents the console serves, by EXACT path, and the\n * route handler each is rewritten to. Exactly these: any other path under\n * `/.well-known/` still answers 404, which is the posture the namespace is\n * held to (AGL-3016).\n */\nexport const CONNECTOR_DISCOVERY_ROUTES: Readonly<Record<string, string>> = {\n [PROTECTED_RESOURCE_METADATA_PATH]: '/api/oauth/metadata/protected-resource',\n [MCP_PROTECTED_RESOURCE_METADATA_PATH]: '/api/oauth/metadata/protected-resource',\n [AUTHORIZATION_SERVER_METADATA_PATH]: '/api/oauth/metadata/authorization-server',\n}\n\n/** The route handler serving `pathname`, or `null` when it is not one of the three. */\nexport function connectorDiscoveryRoute(pathname: string): string | null {\n return Object.prototype.hasOwnProperty.call(CONNECTOR_DISCOVERY_ROUTES, pathname)\n ? CONNECTOR_DISCOVERY_ROUTES[pathname]\n : null\n}\n\n/** The resource identifier for the MCP endpoint on `origin`. */\nexport function connectorResourceFor(origin: string): string {\n return `${origin}${CONNECTOR_RESOURCE_PATH}`\n}\n\n/** What a 401 from the MCP endpoint names, so a client can begin the walk. */\nexport function connectorResourceMetadataUrl(origin: string): string {\n return `${origin}${MCP_PROTECTED_RESOURCE_METADATA_PATH}`\n}\n\n/** The authorization server's own document (RFC 8414) on `origin`. */\nexport function connectorAuthorizationServerMetadataUrl(origin: string): string {\n return `${origin}${AUTHORIZATION_SERVER_METADATA_PATH}`\n}\n\n/** The MCP Server Card (SEP-2127) on `origin`. */\nexport function mcpServerCardUrl(origin: string): string {\n return `${origin}${MCP_SERVER_CARD_PATH}`\n}\n\n/**\n * The card's `name`: reverse-DNS of the host that serves the endpoint, then\n * `/mcp`. The card schema (and the MCP Registry's `server.json`) require\n * `namespace/name` matching `^[a-zA-Z0-9.-]+/[a-zA-Z0-9._-]+$`, and a\n * reverse-DNS namespace is the one a registry can verify against the domain,\n * so a self-hosted console names itself rather than borrowing ours.\n * `app.aglyn.com` → `com.aglyn.app/mcp`.\n */\nexport function mcpServerCardName(origin: string): string {\n let host: string\n try {\n host = new URL(origin).hostname\n } catch {\n host = ''\n }\n const namespace = host\n .split('.')\n .filter(Boolean)\n .reverse()\n .join('.')\n .replace(/[^a-zA-Z0-9.-]/g, '-')\n return `${namespace || 'local'}/mcp`\n}\n"],"names":["CONNECTOR_RESOURCE_PATH","CONNECTOR_AUTHORIZE_PATH","CONNECTOR_REGISTER_PATH","CONNECTOR_TOKEN_PATH","CONNECTOR_REVOKE_PATH","PROTECTED_RESOURCE_METADATA_PATH","MCP_PROTECTED_RESOURCE_METADATA_PATH","AUTHORIZATION_SERVER_METADATA_PATH","MCP_SERVER_CARD_PATH","MCP_SERVER_CARD_MEDIA_TYPE","MCP_SERVER_CARD_SCHEMA","CONNECTOR_DISCOVERY_ROUTES","connectorDiscoveryRoute","pathname","Object","prototype","hasOwnProperty","call","connectorResourceFor","origin","connectorResourceMetadataUrl","connectorAuthorizationServerMetadataUrl","mcpServerCardUrl","mcpServerCardName","host","URL","hostname","namespace","split","filter","Boolean","reverse","join","replace"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;;;;;;4CAqB4C,GAE5C,uDAAuD,GACvD,OAAO,MAAMA,0BAA0B,WAAU;AAEjD,0EAA0E,GAC1E,OAAO,MAAMC,2BAA2B,mBAAkB;AAE1D,4CAA4C,GAC5C,OAAO,MAAMC,0BAA0B,sBAAqB;AAE5D,+BAA+B,GAC/B,OAAO,MAAMC,uBAAuB,mBAAkB;AAEtD,2BAA2B,GAC3B,OAAO,MAAMC,wBAAwB,oBAAmB;AAExD,yDAAyD,GACzD,OAAO,MAAMC,mCAAmC,wCAAuC;AAEvF;;;CAGC,GACD,OAAO,MAAMC,uCAAuC,GAAGD,mCAAmCL,yBAAyB,CAAA;AAEnH,+DAA+D,GAC/D,OAAO,MAAMO,qCAAqC,0CAAyC;AAE3F;;;;;;;;;;CAUC,GACD,OAAO,MAAMC,uBAAuB,GAAGR,wBAAwB,YAAY,CAAC,CAAA;AAE5E,oEAAoE,GACpE,OAAO,MAAMS,6BAA6B,mCAAkC;AAE5E;;;CAGC,GACD,OAAO,MAAMC,yBACX,4EAA2E;AAE7E;;;;;CAKC,GACD,OAAO,MAAMC,6BAA+D;IAC1E,CAACN,iCAAiC,EAAE;IACpC,CAACC,qCAAqC,EAAE;IACxC,CAACC,mCAAmC,EAAE;AACxC,EAAC;AAED,qFAAqF,GACrF,OAAO,SAASK,wBAAwBC,QAAgB;IACtD,OAAOC,OAAOC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACN,4BAA4BE,YACpEF,0BAA0B,CAACE,SAAS,GACpC;AACN;AAEA,8DAA8D,GAC9D,OAAO,SAASK,qBAAqBC,MAAc;IACjD,OAAO,GAAGA,SAASnB,yBAAyB;AAC9C;AAEA,4EAA4E,GAC5E,OAAO,SAASoB,6BAA6BD,MAAc;IACzD,OAAO,GAAGA,SAASb,sCAAsC;AAC3D;AAEA,oEAAoE,GACpE,OAAO,SAASe,wCAAwCF,MAAc;IACpE,OAAO,GAAGA,SAASZ,oCAAoC;AACzD;AAEA,gDAAgD,GAChD,OAAO,SAASe,iBAAiBH,MAAc;IAC7C,OAAO,GAAGA,SAASX,sBAAsB;AAC3C;AAEA;;;;;;;CAOC,GACD,OAAO,SAASe,kBAAkBJ,MAAc;IAC9C,IAAIK;IACJ,IAAI;QACFA,OAAO,IAAIC,IAAIN,QAAQO,QAAQ;IACjC,EAAE,eAAM;QACNF,OAAO;IACT;IACA,MAAMG,YAAYH,KACfI,KAAK,CAAC,KACNC,MAAM,CAACC,SACPC,OAAO,GACPC,IAAI,CAAC,KACLC,OAAO,CAAC,mBAAmB;IAC9B,OAAO,GAAGN,aAAa,QAAQ,IAAI,CAAC;AACtC"}
@@ -177,6 +177,7 @@
177
177
  '#billing-link': 'A billing link in an email from Aglyn — a failed-payment notice, say — opens the Billing page of your workspace, asking you to sign in first if you need to.',
178
178
  '#billing-page': 'Organization → Billing is where your workspace\'s plan, usage, invoices and billing details live, in four tabs: Plan, Usage, Invoices and Settings.',
179
179
  '#campaign-sending-pace': 'Campaign emails (this hour, organization) shows how many campaign emails your workspace has sent this hour against the most it may send in an hour, so a very large send is spread out rather than refused.',
180
+ '#connected-apps': 'Connected apps lists every app that was connected to the workspace by signing in instead of with an API key, such as an AI assistant.',
180
181
  '#crm-records': 'Your CRM — the contacts captured from forms, member sign-ups, buyers and bookings, and the companies and deals your team files beside them — is priced as one CRM records band, not a hard cap.',
181
182
  '#current-plan': 'The Current plan card at the top of the Plan tab names your plan, the state of its subscription and its price, with the plan\'s headline limits — sites, team seats and campaign emails a month — beside it.',
182
183
  '#if-you-would-rather-uploads-stopped': 'Set a monthly storage cap on the Storage cap card under Billing → Usage when you would rather new uploads stopped than pay for extra storage past a figure you choose.',