@zuplo/runtime 7.15.0 → 7.15.1

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 (51) hide show
  1. package/LICENSE.third-party.txt +511 -0
  2. package/LICENSE.txt +5 -78
  3. package/README.md +7 -0
  4. package/out/esm/chunk-5JGLAPFA.js +13 -0
  5. package/out/esm/chunk-5JGLAPFA.js.map +1 -0
  6. package/out/esm/{chunk-SX6JF7A6.js → chunk-AJ3MMWJS.js} +9 -22
  7. package/out/esm/chunk-AJ3MMWJS.js.map +1 -0
  8. package/out/esm/chunk-BH4DKEES.js +13 -0
  9. package/out/esm/chunk-BH4DKEES.js.map +1 -0
  10. package/out/esm/chunk-G42UYZ6V.js +24 -0
  11. package/out/esm/{chunk-M4IZPJP6.js.map → chunk-G42UYZ6V.js.map} +1 -1
  12. package/out/esm/chunk-OE2WMJXK.js +431 -0
  13. package/out/esm/chunk-OE2WMJXK.js.map +1 -0
  14. package/out/esm/chunk-R6UNMRUU.js +13 -0
  15. package/out/esm/chunk-R6UNMRUU.js.map +1 -0
  16. package/out/esm/{chunk-GWGCD6Z7.js → chunk-T2WKOG7J.js} +9 -22
  17. package/out/esm/chunk-T2WKOG7J.js.map +1 -0
  18. package/out/esm/{chunk-HTXNM72E.js → chunk-TOJD4RET.js} +9 -22
  19. package/out/esm/chunk-TOJD4RET.js.map +1 -0
  20. package/out/esm/chunk-VXPFMOL5.js +13 -0
  21. package/out/esm/chunk-VXPFMOL5.js.map +1 -0
  22. package/out/esm/index.js +8 -21
  23. package/out/esm/index.js.map +1 -1
  24. package/out/esm/internal/index.js +8 -21
  25. package/out/esm/mcp/messages/index.js +8 -21
  26. package/out/esm/mcp-gateway/index.js +11 -39
  27. package/out/esm/mcp-gateway/index.js.map +1 -1
  28. package/out/esm/mocks/index.js +8 -21
  29. package/out/esm/mocks/index.js.map +1 -1
  30. package/out/esm/sdks/aws/index.js +8 -21
  31. package/out/esm/sdks/aws/index.js.map +1 -1
  32. package/out/types/index.d.ts +248 -6
  33. package/out/types/internal/index.d.ts +101 -0
  34. package/out/types/mcp-gateway/index.d.ts +127 -0
  35. package/package.json +3 -2
  36. package/out/esm/chunk-A3QGJZO7.js +0 -26
  37. package/out/esm/chunk-A3QGJZO7.js.map +0 -1
  38. package/out/esm/chunk-F4G3YEN2.js +0 -429
  39. package/out/esm/chunk-F4G3YEN2.js.map +0 -1
  40. package/out/esm/chunk-GWGCD6Z7.js.map +0 -1
  41. package/out/esm/chunk-HTXNM72E.js.map +0 -1
  42. package/out/esm/chunk-M4IZPJP6.js +0 -37
  43. package/out/esm/chunk-SX6JF7A6.js.map +0 -1
  44. package/out/esm/chunk-TYV53J3B.js +0 -26
  45. package/out/esm/chunk-TYV53J3B.js.map +0 -1
  46. package/out/esm/chunk-UKQQD2JN.js +0 -26
  47. package/out/esm/chunk-UKQQD2JN.js.map +0 -1
  48. package/out/esm/chunk-VP5Q3DEN.js +0 -26
  49. package/out/esm/chunk-VP5Q3DEN.js.map +0 -1
  50. /package/out/esm/{chunk-M4IZPJP6.js.LEGAL.txt → chunk-G42UYZ6V.js.LEGAL.txt} +0 -0
  51. /package/out/esm/{chunk-F4G3YEN2.js.LEGAL.txt → chunk-OE2WMJXK.js.LEGAL.txt} +0 -0
@@ -3025,6 +3025,12 @@ export declare interface McpTokenExchangeInboundPolicyOptions {
3025
3025
  * Overrides the OIDC `prompt` parameter on upstream authorization requests. The MCP SDK adds `prompt=consent` whenever the requested scope includes `offline_access`, which forces a consent screen on every authorization on providers like Microsoft Entra ID even after a tenant admin has granted org-wide admin consent. Leave unset to keep the SDK's behavior; set to `false` to strip the `prompt` parameter; set an explicit value to replace it. Warning: stripping `prompt=consent` while requesting `offline_access` can silently prevent refresh-token issuance on providers that require a fresh consent grant for offline access (e.g. Google) — only use this when the provider grants offline access via pre-authorized/admin consent (e.g. Entra tenant admin consent).
3026
3026
  */
3027
3027
  prompt?: ("none" | "login" | "consent" | "select_account") | false;
3028
+ /**
3029
+ * Extra query parameters added to upstream authorization requests, for providers that need a parameter the MCP authorization flow does not send. For example, Google issues a refresh token only when the request carries `access_type=offline`, so Google upstreams set `{ "access_type": "offline" }`, usually with `prompt: "consent"`. A value replaces any parameter of the same name. Parameters the gateway manages cannot be set here: `response_type`, `response_mode`, `client_id`, `redirect_uri`, `scope`, `state`, `code_challenge`, `code_challenge_method`, `resource`, and `prompt` (use the `prompt` option). Available only with `user-oauth` and `shared-oauth`.
3030
+ */
3031
+ authorizationParams?: {
3032
+ [k: string]: string;
3033
+ };
3028
3034
  /**
3029
3035
  * Allows the authorization server metadata's `issuer` to differ from the server URL used for discovery. Defaults to `false`. Enable only for a confirmed provider metadata mismatch after verifying that its metadata and OAuth endpoints are trusted. This disables the RFC 8414 section 3.3 issuer check; authorization-response and callback checks still apply. Available only with `user-oauth` and `shared-oauth`.
3030
3036
  */
@@ -4063,6 +4069,63 @@ declare interface PromptProjection {
4063
4069
  */
4064
4070
  declare type Public = boolean;
4065
4071
 
4072
+ /**
4073
+ * Describes the value a {@link TelemetryRedactor} is asked to redact.
4074
+ *
4075
+ * @public
4076
+ */
4077
+ declare interface RedactionContext {
4078
+ /**
4079
+ * The kind of record the value is written to.
4080
+ */
4081
+ readonly kind: RedactionRecordKind;
4082
+ /**
4083
+ * The path of the value in the record, for example `message[0]`,
4084
+ * `message[1].user.email`, `properties.customerId`, `attributes.http.url`,
4085
+ * `events[0].attributes.exception.message` or `url`.
4086
+ */
4087
+ readonly field: string;
4088
+ /**
4089
+ * The last property name in {@link RedactionContext.field}, for example `email`
4090
+ * or `http.url`. `undefined` when the value is not a property of an object
4091
+ * (a log message string, an array element, a span name).
4092
+ */
4093
+ readonly key: string | undefined;
4094
+ /**
4095
+ * Every property name on the way from the record to the value, outermost
4096
+ * first: `["user", "email"]` for `message[1].user.email`, `["dob"]` for
4097
+ * `message[1].dob[0]`. Array indices are left out, so a value in an array
4098
+ * keeps the name the array is under. When {@link RedactionContext.key} is
4099
+ * set, it is the last entry. Empty for a value with no property name above
4100
+ * it (a log message string, a span name).
4101
+ */
4102
+ readonly keys: readonly string[];
4103
+ }
4104
+
4105
+ /**
4106
+ * The kind of record a value is about to be written to.
4107
+ *
4108
+ * - `log`: a log entry from `context.log`, `console.*` in customer code, or the
4109
+ * gateway's own request logs. Goes to Zuplo's log pipeline and to every
4110
+ * configured log integration.
4111
+ * - `span`: an OpenTelemetry span: its name, attributes, events and status.
4112
+ * - `analytics`: the URL and customer-set properties on the per-request
4113
+ * analytics row (also sent to metrics plugins), and URL fields of analytics
4114
+ * events. Fields that usage and billing are computed from are never
4115
+ * redacted.
4116
+ * - `request-log`: an entry produced by a request logger plugin (Azure Blob,
4117
+ * Azure Event Hubs, Hydrolix).
4118
+ * - `audit-log`: an event recorded by the Audit Log policy.
4119
+ *
4120
+ * @public
4121
+ */
4122
+ declare type RedactionRecordKind =
4123
+ | "log"
4124
+ | "span"
4125
+ | "analytics"
4126
+ | "request-log"
4127
+ | "audit-log";
4128
+
4066
4129
  /**
4067
4130
  * Generic type parameters for a request.
4068
4131
  * Extends RequestInitGeneric and adds query parameter typing.
@@ -4295,6 +4358,29 @@ declare interface RuntimeExtensions {
4295
4358
  * @param hook - The pre-routing hook function
4296
4359
  */
4297
4360
  addPreRoutingHook(hook: PreRoutingHook): void;
4361
+ /**
4362
+ * Add a redactor that redacts sensitive data before Zuplo records it.
4363
+ *
4364
+ * Request content the gateway records passes through the registered
4365
+ * redactors first: log entries (messages, structured fields, errors, log
4366
+ * properties), OpenTelemetry spans (names, attributes, events, status), the
4367
+ * URL and custom properties on the per-request analytics row, request
4368
+ * logger plugin entries and Audit Log policy events. The fields usage and
4369
+ * billing are computed from (route pattern, method, status, consumer) are
4370
+ * never redacted. Redactors run in the order they are added. With none
4371
+ * added, nothing is redacted and nothing changes.
4372
+ *
4373
+ * Call it only in `runtimeInit`; calls after startup throw. At most 16
4374
+ * redactors can be registered.
4375
+ *
4376
+ * If a redactor throws or returns something other than a string, the value
4377
+ * is recorded as `"[REDACTION_FAILED]"` and a warning, without the value, is
4378
+ * written to the request log at most once a minute.
4379
+ *
4380
+ * @param redactor - The redactor function. Use `createRedactor` for
4381
+ * built-in patterns.
4382
+ */
4383
+ addTelemetryRedactor(redactor: TelemetryRedactor): void;
4298
4384
  }
4299
4385
 
4300
4386
  /**
@@ -4313,6 +4399,46 @@ declare abstract class SystemRuntimePlugin extends RuntimePlugin {
4313
4399
  /* Excluded from this release type: registerRoutes */
4314
4400
  }
4315
4401
 
4402
+ /**
4403
+ * A function that redacts sensitive data from a value before Zuplo records
4404
+ * it. Return the value to record: the input unchanged, or a redacted copy.
4405
+ *
4406
+ * The function runs synchronously on the request path for every string (and
4407
+ * every number, as its decimal string) the gateway records, so keep it fast.
4408
+ * It must be pure: the same input and context must always give the same
4409
+ * output, because results for short values are cached and reused. Values over
4410
+ * 32,768 characters are cut to that length before the function sees them.
4411
+ * Anything the function logs is dropped.
4412
+ * If it throws, or returns something other than a string, the value is
4413
+ * replaced with `"[REDACTION_FAILED]"` and the failure is recorded without the
4414
+ * value.
4415
+ *
4416
+ * @example
4417
+ * ```ts
4418
+ * import { RuntimeExtensions, createRedactor } from "@zuplo/runtime";
4419
+ *
4420
+ * export function runtimeInit(runtime: RuntimeExtensions) {
4421
+ * // Built-in patterns
4422
+ * runtime.addTelemetryRedactor(
4423
+ * createRedactor({
4424
+ * entities: ["finance-credit-card", "id-us-ssn"],
4425
+ * queryParameters: ["ssn", "card_number"],
4426
+ * })
4427
+ * );
4428
+ *
4429
+ * // A custom rule: drop the value of any field named "dob"
4430
+ * runtime.addTelemetryRedactor((value, { key }) =>
4431
+ * key === "dob" ? "[REDACTED]" : value
4432
+ * );
4433
+ * }
4434
+ * ```
4435
+ *
4436
+ * @public
4437
+ */
4438
+ declare interface TelemetryRedactor {
4439
+ (value: string, context: RedactionContext): string;
4440
+ }
4441
+
4316
4442
  declare interface ToolProjection {
4317
4443
  /**
4318
4444
  * Tool name to expose.
@@ -4397,6 +4523,7 @@ declare interface UpstreamOAuthConfig {
4397
4523
  scopes: string[];
4398
4524
  scopeDelimiter: string;
4399
4525
  prompt?: UpstreamOAuthPromptOverride;
4526
+ authorizationParams?: Record<string, string>;
4400
4527
  skipIssuerMetadataValidation?: boolean;
4401
4528
  skipResourceIndicatorValidation?: boolean;
4402
4529
  clientRegistration: UpstreamOAuthClientRegistrationConfig;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
3
  "type": "module",
4
- "version": "7.15.0",
4
+ "version": "7.15.1",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {
@@ -37,7 +37,8 @@
37
37
  "files": [
38
38
  "out/**/*",
39
39
  "README.md",
40
- "LICENSE.txt"
40
+ "LICENSE.txt",
41
+ "LICENSE.third-party.txt"
41
42
  ],
42
43
  "devDependencies": {
43
44
  "@types/node": "^22.13.4",
@@ -1,26 +0,0 @@
1
-
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Zuplo, Inc. All rights reserved.
4
- *
5
- * This software and associated documentation files (the "Software") is intended to be used
6
- * only by Zuplo customers solely to develop and test applications that will be deployed
7
- * to Zuplo hosted services. You and others in your organization may use these files on your
8
- * Development Devices solely for the above stated purpose.
9
- *
10
- * Outside of uses stated above, no license is granted for any other purpose including
11
- * without limitation the rights to use, copy, modify, merge, publish, distribute,
12
- * sublicense, host, and/or sell copies of the Software.
13
- *
14
- * The software may include third party components with separate legal notices or governed by
15
- * other agreements, as described in licenses either embedded in or accompanying the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18
- * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
19
- * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
20
- * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
- * DEALINGS IN THE SOFTWARE.
23
- *--------------------------------------------------------------------------------------------*/
24
-
25
- import{a as o}from"./chunk-TYV53J3B.js";function t(e){for(let r in e){let n=e[r];n&&typeof n=="object"&&t(n)}return Object.freeze(e)}o(t,"deepFreeze");export{t as a};
26
- //# sourceMappingURL=chunk-A3QGJZO7.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@zuplo/runtime/utils/freeze.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;wCAKO,SAASA,EAAoBC,EAAwB,CAC1D,QAAWC,KAAQD,EAAQ,CACzB,IAAME,EAAQF,EAAOC,CAAI,EACrBC,GAAS,OAAOA,GAAU,UAC5BH,EAAWG,CAAK,CAEpB,CACA,OAAO,OAAO,OAAUF,CAAM,CAChC,CARgBG,EAAAJ,EAAA","names":["deepFreeze","object","name","value","__name"]}