@arbol-ai/maximus 8.7.2 → 8.9.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.
- package/config/oxfmt.mjs +2 -0
- package/config/oxlint.mjs +3 -0
- package/dist/analytics/analytics.d.ts +1 -1
- package/dist/body.d.ts +1 -1
- package/dist/capture/index.d.ts +1 -1
- package/dist/chunks/{define-app-g0A34g8z.js → define-app-IhSbBWTD.js} +1 -1
- package/dist/chunks/{http-layout-CdFZEF2S.js → http-layout-B-9NbM5M.js} +1 -1
- package/dist/chunks/{meter-BnrQY5rb.js → meter-BpzCC7J3.js} +1 -1
- package/dist/chunks/{openapi-BkR-hcYJ.js → openapi-Ye_Ypx-d.js} +1 -1
- package/dist/chunks/{openapi-file-F5kJS8x-.js → openapi-file-2fUP4JLw.js} +2 -2
- package/dist/chunks/{pages-DLW65kXL.js → pages-BJKV04-G.js} +1 -1
- package/dist/chunks/{prepare-configured-Cithjf80.js → prepare-configured-DjCFAqdH.js} +6 -2
- package/dist/chunks/{prepare-configured-BmRJLg6J.js → prepare-configured-Dw3-u-b3.js} +1 -1
- package/dist/chunks/{runtime-DoyJqzAv.js → runtime-Bg729nOQ.js} +3 -3
- package/dist/chunks/{server-DxifcN7e.js → server-ZGiWOeAp.js} +1 -1
- package/dist/chunks/{src-BNbGseOR.js → src-8mwPVI5H.js} +10 -6
- package/dist/chunks/{tokens-b9dEBUu9.js → tokens-CBQO5lc0.js} +109 -14
- package/dist/chunks/{types-Do00dTUs.d.ts → types-Dmw37bhl.d.ts} +61 -1
- package/dist/chunks/{workers-types-DjWyO_Pu.d.ts → workers-types-CYOvun0Q.d.ts} +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/diagnostics.d.ts +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/http-paths.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/internals.d.ts +1 -1
- package/dist/internals.js +2 -2
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/tasks.d.ts +1 -1
- package/dist/project/config.d.ts +1 -1
- package/dist/project/index.d.ts +2 -2
- package/dist/project/index.js +2 -2
- package/dist/schemas.d.ts +1 -1
- package/dist/standard-failures.d.ts +1 -1
- package/dist/tooling/cli.js +3 -4
- package/dist/vite/index.d.ts +85 -7
- package/dist/vite/index.js +279 -34
- package/dist/webhooks.d.ts +1 -1
- package/dist/workers/runtime.d.ts +1 -1
- package/dist/workers/runtime.js +1 -1
- package/package.json +1 -1
- package/skills/maximus/SKILL.md +4 -0
- package/skills/maximus/references/deploying.md +9 -0
- package/skills/maximus/references/project.md +47 -4
package/config/oxfmt.mjs
CHANGED
package/config/oxlint.mjs
CHANGED
|
@@ -38,6 +38,9 @@ export default defineConfig({
|
|
|
38
38
|
'**/.agents',
|
|
39
39
|
'**/.claude',
|
|
40
40
|
'**/.codex',
|
|
41
|
+
// What a web app's tools generate: TanStack Router's cache and Paraglide's compiled messages.
|
|
42
|
+
'**/.tanstack',
|
|
43
|
+
'**/paraglide',
|
|
41
44
|
],
|
|
42
45
|
rules: {
|
|
43
46
|
// Guardrails: each one has broken, or would silently weaken, a Maximus service.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { rr as Observer } from "../chunks/types-
|
|
1
|
+
import { rr as Observer } from "../chunks/types-Dmw37bhl.js";
|
|
2
2
|
import { Static, Type } from "typebox";
|
|
3
3
|
/** An analytics event: the allowlisted metadata of one operation call, flattened, with an id of its own. */
|
|
4
4
|
export declare const ExecutionEventSchema: Type.TObject<{
|
package/dist/body.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as readBodyText, c as isJsonMediaType, d as retryAfterSeconds, f as publicDestination, g as readBodyBytes, h as HttpBodyFailureReason, l as readJsonBody, m as HttpBodyFailure, p as BodyReadOptions, u as readJsonResponse } from "./chunks/types-
|
|
1
|
+
import { _ as readBodyText, c as isJsonMediaType, d as retryAfterSeconds, f as publicDestination, g as readBodyBytes, h as HttpBodyFailureReason, l as readJsonBody, m as HttpBodyFailure, p as BodyReadOptions, u as readJsonResponse } from "./chunks/types-Dmw37bhl.js";
|
|
2
2
|
export { type BodyReadOptions, type HttpBodyFailure, type HttpBodyFailureReason, isJsonMediaType, publicDestination, readBodyBytes, readBodyText, readJsonBody, readJsonResponse, retryAfterSeconds };
|
package/dist/capture/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ar as
|
|
1
|
+
import { Ar as CaptureRecord, Gn as CaptureConfig, Jn as CaptureSink, Kn as CaptureDimensions, Kt as RegisteredEnv, Wn as AnyContext, ct as withoutSecrets, jr as CaptureRecordSchema, qn as CaptureInvocation } from "../chunks/types-Dmw37bhl.js";
|
|
2
2
|
/** What `pipeline()` takes. */
|
|
3
3
|
interface PipelineOptions<E> {
|
|
4
4
|
/**
|
|
@@ -4,7 +4,7 @@ import { a as operationPathParameters, r as isInputHeaderName, t as createHttpRo
|
|
|
4
4
|
import { R as holdsSecrets, T as hasUncompiledCodecs } from "./schemas-_UJcx_uY.js";
|
|
5
5
|
import { t as pathParameterSchemas } from "./http-routes-B6tCsnxB.js";
|
|
6
6
|
import { b as operationScopes, d as MAX_BODY_BYTES_CEILING, f as STANDARD_CODES, t as MAX_TASK_TTL_MS, x as isNamespacedScope } from "./tasks-CD-B6_nv.js";
|
|
7
|
-
import { b as checkRoles, g as hasSchemaReferences, m as bundleSchemas, o as tokenAudiences, t as checkTokenAuthority } from "./tokens-
|
|
7
|
+
import { b as checkRoles, g as hasSchemaReferences, m as bundleSchemas, o as tokenAudiences, t as checkTokenAuthority } from "./tokens-CBQO5lc0.js";
|
|
8
8
|
import { IsKind } from "typebox";
|
|
9
9
|
|
|
10
10
|
// src/internal/exact-length.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { f as Value, t as admitInput } from "./validation-CpzAxj2_.js";
|
|
2
2
|
import { B as withoutSecrets, R as holdsSecrets } from "./schemas-_UJcx_uY.js";
|
|
3
3
|
import { i as standardErrors } from "./errors-BoutSmiy.js";
|
|
4
|
-
import { a as isAttachmentSchema, o as validAttachment } from "./define-app-
|
|
4
|
+
import { a as isAttachmentSchema, o as validAttachment } from "./define-app-IhSbBWTD.js";
|
|
5
5
|
import { b as operationScopes, c as ADMISSION_CODES, f as STANDARD_CODES, l as BODY_CODES, v as operationMatchesScopes, y as operationOutputLimit } from "./tasks-CD-B6_nv.js";
|
|
6
6
|
import { t as err } from "./result-CF4OzG9O.js";
|
|
7
7
|
import { t as sha256Hex } from "./digest-C51F1bhA.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as resolveRoles, _ as schemaIds, f as usesCloudflareAccess, h as canonical, m as bundleSchemas, s as tokenEndpoints } from "./tokens-
|
|
1
|
+
import { S as resolveRoles, _ as schemaIds, f as usesCloudflareAccess, h as canonical, m as bundleSchemas, s as tokenEndpoints } from "./tokens-CBQO5lc0.js";
|
|
2
2
|
import { a as operationPathParameters } from "./http-paths-D043DkJv.js";
|
|
3
3
|
import { L as wireInput } from "./schemas-_UJcx_uY.js";
|
|
4
4
|
import { t as queryKind } from "./query-kind-CWKAXEME.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as createRpcOpenApi } from "./openapi-
|
|
2
|
-
import { t as prepareConfiguredProject } from "./prepare-configured-
|
|
1
|
+
import { n as createRpcOpenApi } from "./openapi-Ye_Ypx-d.js";
|
|
2
|
+
import { t as prepareConfiguredProject } from "./prepare-configured-DjCFAqdH.js";
|
|
3
3
|
import { t as packageDirectory } from "./scaffold-BfrJN0Yk.js";
|
|
4
4
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { dirname, join, relative, resolve } from "node:path";
|
|
@@ -31,7 +31,8 @@ function projectApi(plugin) {
|
|
|
31
31
|
/**
|
|
32
32
|
* Prepares the project at `directory`: loads its `vite.config.ts` with Vite, which evaluates it as every
|
|
33
33
|
* `vp` command does, and prepares it through the `maximus()` plugin it configures. Application modules are
|
|
34
|
-
* only parsed.
|
|
34
|
+
* only parsed. `mode` is `production`, as a build prepares it, `development`, as `vp dev` does, or an
|
|
35
|
+
* environment the configuration declares, as `vp build --mode <environment>` does; any other is refused.
|
|
35
36
|
*/
|
|
36
37
|
async function prepareConfiguredProject(directory, mode = "production") {
|
|
37
38
|
const root = resolve(directory);
|
|
@@ -44,7 +45,10 @@ async function prepareConfiguredProject(directory, mode = "production") {
|
|
|
44
45
|
}, join(root, viteConfig), root);
|
|
45
46
|
for (const plugin of await pluginsOf(loaded?.config.plugins)) {
|
|
46
47
|
const api = projectApi(plugin);
|
|
47
|
-
if (api)
|
|
48
|
+
if (api) {
|
|
49
|
+
if (mode !== "production" && mode !== "development" && !api.environments?.includes(mode)) throw new TypeError(`Prepare with --mode production, as a build does, development, as vp dev does, or an environment ${viteConfig} declares${api.environments?.length ? `: ${api.environments.join(", ")}` : ""}.`);
|
|
50
|
+
return api.prepare(root, mode === "development" ? "development" : "production", mode);
|
|
51
|
+
}
|
|
48
52
|
}
|
|
49
53
|
throw new TypeError(`${viteConfig} configures no maximus() plugin from @arbol-ai/maximus/vite.`);
|
|
50
54
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as executeOperation, r as recordCapture, t as recordMeter } from "./meter-
|
|
1
|
+
import { n as executeOperation, r as recordCapture, t as recordMeter } from "./meter-BpzCC7J3.js";
|
|
2
2
|
import { i as standardErrors } from "./errors-BoutSmiy.js";
|
|
3
|
-
import { r as createHttpHandler } from "./src-
|
|
3
|
+
import { r as createHttpHandler } from "./src-8mwPVI5H.js";
|
|
4
4
|
import { r as ok, t as err } from "./result-CF4OzG9O.js";
|
|
5
|
-
import { p as PrincipalSchema } from "./tokens-
|
|
5
|
+
import { p as PrincipalSchema } from "./tokens-CBQO5lc0.js";
|
|
6
6
|
import { i as parseInput } from "./validation-CpzAxj2_.js";
|
|
7
7
|
import { a as recordExecution, l as withTelemetry, o as reportUnexpected, s as telemetryEnabled } from "./telemetry-BtxJh69Q.js";
|
|
8
8
|
import { r as isRequestId } from "./correlation-4b23a-a4.js";
|
|
@@ -2,7 +2,7 @@ import { d as MAX_BODY_BYTES_CEILING, h as mcpOpenWorld, v as operationMatchesSc
|
|
|
2
2
|
import { o as reportUnexpected } from "./telemetry-BtxJh69Q.js";
|
|
3
3
|
import { i as standardErrors } from "./errors-BoutSmiy.js";
|
|
4
4
|
import { L as wireInput } from "./schemas-_UJcx_uY.js";
|
|
5
|
-
import { h as canonical, v as standaloneSchema } from "./tokens-
|
|
5
|
+
import { h as canonical, v as standaloneSchema } from "./tokens-CBQO5lc0.js";
|
|
6
6
|
import { t as toYaml } from "./yaml-Dk2L24yQ.js";
|
|
7
7
|
import { a as mcpTask, n as attachTasks, o as toolResult, r as declaresTasks } from "./tasks-DELqUSq8.js";
|
|
8
8
|
import { McpServer, ProtocolError, ProtocolErrorCode, createMcpHandler } from "@modelcontextprotocol/server";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { i as binaryBody, n as defineApp, r as attachmentResponse } from "./define-app-
|
|
1
|
+
import { i as binaryBody, n as defineApp, r as attachmentResponse } from "./define-app-IhSbBWTD.js";
|
|
2
2
|
import { a as taskAccess, b as operationScopes, m as isPublicOperation, o as taskView, p as composeOperations, s as withTaskOperations, u as DEFAULT_MAX_BODY_BYTES, v as operationMatchesScopes } from "./tasks-CD-B6_nv.js";
|
|
3
3
|
import { r as ok, t as err } from "./result-CF4OzG9O.js";
|
|
4
4
|
import { i as standardErrors } from "./errors-BoutSmiy.js";
|
|
5
|
-
import { c as tokenIssuer, i as presentedToken, n as createTokenAuthorization, o as tokenAudiences, u as isCrossSiteWrite } from "./tokens-
|
|
6
|
-
import { n as executeOperation, r as recordCapture, t as recordMeter } from "./meter-
|
|
5
|
+
import { c as tokenIssuer, i as presentedToken, n as createTokenAuthorization, o as tokenAudiences, u as isCrossSiteWrite } from "./tokens-CBQO5lc0.js";
|
|
6
|
+
import { n as executeOperation, r as recordCapture, t as recordMeter } from "./meter-BpzCC7J3.js";
|
|
7
7
|
import { t as createHttpRouteResolver } from "./http-paths-D043DkJv.js";
|
|
8
8
|
import { r as readBodyText } from "./body-DOIHwIIl.js";
|
|
9
9
|
import { t as sha256Hex } from "./digest-C51F1bhA.js";
|
|
10
|
-
import { a as ownsPrefix, i as nativePaths, n as composition, o as servesCloudflareAccess, r as httpTransports, s as servesOwnBearer, t as VERSIONED_PATH } from "./http-layout-
|
|
11
|
-
import { i as queryKinds, r as queryInput, t as createOpenApi } from "./openapi-
|
|
10
|
+
import { a as ownsPrefix, i as nativePaths, n as composition, o as servesCloudflareAccess, r as httpTransports, s as servesOwnBearer, t as VERSIONED_PATH } from "./http-layout-B-9NbM5M.js";
|
|
11
|
+
import { i as queryKinds, r as queryInput, t as createOpenApi } from "./openapi-Ye_Ypx-d.js";
|
|
12
12
|
import { n as mediaType } from "./json-B14evE6-.js";
|
|
13
13
|
import { t as toYaml } from "./yaml-Dk2L24yQ.js";
|
|
14
14
|
import { a as recordExecution, i as recordAdmission, l as withTelemetry, o as reportUnexpected, s as telemetryEnabled } from "./telemetry-BtxJh69Q.js";
|
|
@@ -188,7 +188,9 @@ function createHttpHandler(manifest, hooks = {}) {
|
|
|
188
188
|
* it may send, so no one else's large operation widens it.
|
|
189
189
|
*/
|
|
190
190
|
const runnableBy = (caller) => operations.filter(([, op]) => operationMatchesScopes(op, caller.scopes) && (!op.actorKinds || op.actorKinds.includes(caller.actorKind)));
|
|
191
|
-
const
|
|
191
|
+
const transportScopes = [...transports.byPath.values()].map((transport) => transport.scope(manifest.namespace));
|
|
192
|
+
const applicationScopes = Object.freeze([.../* @__PURE__ */ new Set([...operations.flatMap(([, op]) => [...operationScopes(op), ...op.conditionalScopes ?? []]), ...transportScopes])]);
|
|
193
|
+
const publicScopes = Object.freeze([.../* @__PURE__ */ new Set([...operations.filter(([, op]) => isPublicOperation(op)).flatMap(([, op]) => [...operationScopes(op), ...op.conditionalScopes ?? []]), ...transportScopes])]);
|
|
192
194
|
const ownBearer = servesOwnBearer(manifest.tokens, mcpTransport);
|
|
193
195
|
const access = servesCloudflareAccess(manifest.tokens, mcpTransport);
|
|
194
196
|
const oauth = !ownBearer && !access;
|
|
@@ -311,6 +313,7 @@ function createHttpHandler(manifest, hooks = {}) {
|
|
|
311
313
|
request: incoming,
|
|
312
314
|
surface,
|
|
313
315
|
applicationScopes,
|
|
316
|
+
publicScopes,
|
|
314
317
|
background
|
|
315
318
|
});
|
|
316
319
|
/** Captures a refusal before execution, of this request's operation or the one a transport names. */
|
|
@@ -397,6 +400,7 @@ function createHttpHandler(manifest, hooks = {}) {
|
|
|
397
400
|
request: incoming,
|
|
398
401
|
surface,
|
|
399
402
|
applicationScopes,
|
|
403
|
+
publicScopes,
|
|
400
404
|
background
|
|
401
405
|
}, operationRoute?.definition.op.scopeMatch);
|
|
402
406
|
if (!result.ok) return reject(result.error);
|
|
@@ -6,7 +6,7 @@ import { S as matchesScopes, b as operationScopes, m as isPublicOperation, x as
|
|
|
6
6
|
import { r as ok, t as err } from "./result-CF4OzG9O.js";
|
|
7
7
|
import { t as sha256Hex } from "./digest-C51F1bhA.js";
|
|
8
8
|
import { Type } from "typebox";
|
|
9
|
-
import { createRemoteJWKSet, jwtVerify } from "jose";
|
|
9
|
+
import { createRemoteJWKSet, decodeJwt, jwtVerify } from "jose";
|
|
10
10
|
|
|
11
11
|
// src/roles.ts
|
|
12
12
|
/**
|
|
@@ -627,9 +627,39 @@ function checkTokenAuthority(policy, namespace) {
|
|
|
627
627
|
const access = usesCloudflareAccess(policy);
|
|
628
628
|
if (policy.access !== void 0 && !access) throw new TypeError("tokens.access grants Cloudflare Access callers: set tokens.source to cloudflare-access.");
|
|
629
629
|
if (access) checkAccessPolicy(policy, namespace);
|
|
630
|
+
if (policy.additionalIssuers !== void 0 && (access || policy.resolve !== void 0 || usesOwnBearer(policy))) throw new TypeError("tokens.additionalIssuers verifies OAuth access tokens: not under cloudflare-access, a resolve of its own, or a bearer scheme.");
|
|
631
|
+
checkAdmission(policy, access);
|
|
630
632
|
if (usesOwnBearer(policy) || access && policy.resolve !== void 0 && policy.issuer === void 0) return;
|
|
631
|
-
|
|
632
|
-
|
|
633
|
+
checkIssuerFacts(policy, "tokens");
|
|
634
|
+
const issuers = tokenIssuers(policy);
|
|
635
|
+
if (issuers.some((issuer) => !httpsUrl(issuer)) || [
|
|
636
|
+
policy.jwksUri,
|
|
637
|
+
policy.authorizationEndpoint,
|
|
638
|
+
policy.tokenEndpoint
|
|
639
|
+
].some((endpoint) => endpoint !== void 0 && !httpsUrl(endpoint, issuers[0]))) throw new TypeError("tokens.issuer, jwksUri, authorizationEndpoint and tokenEndpoint must be absolute HTTPS URLs, the last three resolved against the issuer.");
|
|
640
|
+
checkAdditionalIssuers(policy, issuers);
|
|
641
|
+
}
|
|
642
|
+
/** The actor kinds `actorKinds` may list. */
|
|
643
|
+
const ACTOR_KINDS = /* @__PURE__ */ new Set(["user", "service"]);
|
|
644
|
+
/**
|
|
645
|
+
* Refuses a declarative admission that could admit nothing, or that would sit beside an admission of its own:
|
|
646
|
+
* an empty or repeated client or actor kind, an unknown grant for people, and any of them with a resolver of the
|
|
647
|
+
* application's own, a bearer scheme or Cloudflare Access, whose tokens carry no OAuth client.
|
|
648
|
+
*/
|
|
649
|
+
function checkAdmission(policy, access) {
|
|
650
|
+
const { clients, actorKinds, people } = policy;
|
|
651
|
+
if (clients === void 0 && actorKinds === void 0 && people === void 0) return;
|
|
652
|
+
if (access || policy.resolve !== void 0 || usesOwnBearer(policy)) throw new TypeError("tokens.clients, actorKinds and people admit OAuth access tokens: not under cloudflare-access, a resolve of its own, or a bearer scheme.");
|
|
653
|
+
if (clients !== void 0 && (!Array.isArray(clients) || !clients.length || clients.some((client) => typeof client !== "string" || !client) || new Set(clients).size !== clients.length)) throw new TypeError("tokens.clients lists one or more distinct client ids, or is absent.");
|
|
654
|
+
if (actorKinds !== void 0 && (!Array.isArray(actorKinds) || !actorKinds.length || actorKinds.some((kind) => !ACTOR_KINDS.has(kind)) || new Set(actorKinds).size !== actorKinds.length)) throw new TypeError("tokens.actorKinds lists user, service or both, once each, or is absent.");
|
|
655
|
+
if (people !== void 0 && people !== "token" && people !== "all") throw new TypeError("tokens.people is token or all, or is absent.");
|
|
656
|
+
if (people === "all" && clients === void 0) throw new TypeError("tokens.people 'all' needs tokens.clients: the clients whose people it admits.");
|
|
657
|
+
}
|
|
658
|
+
/** Refuses an algorithm list, a claim mapping or a token type that could never verify a token. */
|
|
659
|
+
function checkIssuerFacts(facts, at) {
|
|
660
|
+
const { algorithms, claims, requireType } = facts;
|
|
661
|
+
if (algorithms !== void 0 && (!algorithms.length || algorithms.some((name) => !TOKEN_ALGORITHMS.has(name)))) throw new TypeError(`${at}.algorithms lists one or more asymmetric JWS algorithms.`);
|
|
662
|
+
if (requireType !== void 0 && requireType !== "at+jwt") throw new TypeError(`${at}.requireType is at+jwt or absent.`);
|
|
633
663
|
if (claims !== void 0) {
|
|
634
664
|
const { permissions, machineSubject } = claims;
|
|
635
665
|
if ([
|
|
@@ -637,14 +667,26 @@ function checkTokenAuthority(policy, namespace) {
|
|
|
637
667
|
claims.scopes,
|
|
638
668
|
claims.client,
|
|
639
669
|
permissions === false ? void 0 : permissions
|
|
640
|
-
].some((path) => path !== void 0 && (typeof path !== "string" || !path)) || machineSubject !== void 0 && !["{client}@clients", "{client}"].includes(machineSubject)) throw new TypeError(
|
|
670
|
+
].some((path) => path !== void 0 && (typeof path !== "string" || !path)) || machineSubject !== void 0 && !["{client}@clients", "{client}"].includes(machineSubject)) throw new TypeError(`${at}.claims names each claim by a non-empty string (permissions may be false), and machineSubject is {client}@clients or {client}.`);
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
/**
|
|
674
|
+
* Refuses additional issuers that could never verify a token, or that would make one server's token read as
|
|
675
|
+
* another's: one that is not an HTTPS URL, one the policy's `issuer` already names, one listed twice, a JWKS
|
|
676
|
+
* that is not HTTPS, a malformed algorithm list, claim mapping or token type.
|
|
677
|
+
*/
|
|
678
|
+
function checkAdditionalIssuers(policy, issuers) {
|
|
679
|
+
const additional = policy.additionalIssuers;
|
|
680
|
+
if (additional === void 0) return;
|
|
681
|
+
if (!Array.isArray(additional) || !additional.length) throw new TypeError("tokens.additionalIssuers lists one or more authorization servers, or is absent.");
|
|
682
|
+
const seen = new Set(issuers);
|
|
683
|
+
for (const [index, server] of additional.entries()) {
|
|
684
|
+
const at = `tokens.additionalIssuers[${index}]`;
|
|
685
|
+
if (typeof server?.issuer !== "string" || !httpsUrl(server.issuer) || server.jwksUri !== void 0 && !httpsUrl(server.jwksUri, server.issuer)) throw new TypeError(`${at}.issuer and jwksUri must be absolute HTTPS URLs, jwksUri resolved against issuer.`);
|
|
686
|
+
if (seen.has(server.issuer)) throw new TypeError(`${at}.issuer is named twice: each server's tokens are verified against its own keys.`);
|
|
687
|
+
seen.add(server.issuer);
|
|
688
|
+
checkIssuerFacts(server, at);
|
|
641
689
|
}
|
|
642
|
-
const issuers = tokenIssuers(policy);
|
|
643
|
-
if (issuers.some((issuer) => !httpsUrl(issuer)) || [
|
|
644
|
-
policy.jwksUri,
|
|
645
|
-
policy.authorizationEndpoint,
|
|
646
|
-
policy.tokenEndpoint
|
|
647
|
-
].some((endpoint) => endpoint !== void 0 && !httpsUrl(endpoint, issuers[0]))) throw new TypeError("tokens.issuer, jwksUri, authorizationEndpoint and tokenEndpoint must be absolute HTTPS URLs, the last three resolved against the issuer.");
|
|
648
690
|
}
|
|
649
691
|
/** The authorization server's authorization and token endpoints, which OpenAPI publishes. */
|
|
650
692
|
function tokenEndpoints(policy) {
|
|
@@ -691,9 +733,19 @@ function createTokenVerifier(policy) {
|
|
|
691
733
|
requiredClaims: ["exp", "sub"]
|
|
692
734
|
});
|
|
693
735
|
if (!accessTokenType(protectedHeader.typ)) throw new Error("The token is typed as another kind of JWT than an access token.");
|
|
736
|
+
if (policy.requireType && String(protectedHeader.typ).toLowerCase().replace(/^application\//, "") !== "at+jwt") throw new Error("The token does not say it is an access token, which its issuer requires.");
|
|
694
737
|
return payload;
|
|
695
738
|
};
|
|
696
739
|
}
|
|
740
|
+
/** The `iss` a token names, read without verifying it: only to choose which server's keys verify it. */
|
|
741
|
+
function claimedIssuer(token) {
|
|
742
|
+
try {
|
|
743
|
+
const { iss } = decodeJwt(token);
|
|
744
|
+
return typeof iss === "string" ? iss : void 0;
|
|
745
|
+
} catch {
|
|
746
|
+
return;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
697
749
|
/** The longest token admission reads; a longer one is refused unread. */
|
|
698
750
|
const MAX_TOKEN_LENGTH = 16384;
|
|
699
751
|
/** A compact JWS: three base64url segments separated by dots. */
|
|
@@ -729,13 +781,39 @@ function presentedToken(request, policy) {
|
|
|
729
781
|
*/
|
|
730
782
|
function createTokenAuthorization(policy, given) {
|
|
731
783
|
let verifier = given;
|
|
732
|
-
|
|
784
|
+
const additional = policy.additionalIssuers ?? [];
|
|
785
|
+
/** Each additional server's verifier, built on first use, by its issuer. */
|
|
786
|
+
const additionalVerifiers = /* @__PURE__ */ new Map();
|
|
787
|
+
/**
|
|
788
|
+
* Verifies an OAuth access token against the server its `iss` names, building that verifier on first use.
|
|
789
|
+
* A token naming none of the trusted servers is verified against the policy's own, which refuses it.
|
|
790
|
+
*/
|
|
733
791
|
const verify = (token) => {
|
|
792
|
+
const server = additional.find(({ issuer }) => issuer === claimedIssuer(token));
|
|
793
|
+
if (server && !given) {
|
|
794
|
+
let serverVerifier = additionalVerifiers.get(server.issuer);
|
|
795
|
+
if (!serverVerifier) {
|
|
796
|
+
serverVerifier = createTokenVerifier({
|
|
797
|
+
...server,
|
|
798
|
+
audience: policy.audience
|
|
799
|
+
});
|
|
800
|
+
additionalVerifiers.set(server.issuer, serverVerifier);
|
|
801
|
+
}
|
|
802
|
+
return serverVerifier(token);
|
|
803
|
+
}
|
|
734
804
|
verifier ??= createTokenVerifier(policy);
|
|
735
805
|
return verifier(token);
|
|
736
806
|
};
|
|
737
|
-
/**
|
|
738
|
-
|
|
807
|
+
/**
|
|
808
|
+
* The principal a verified token's claims grant: Access's projection, or the claim mapping of the server
|
|
809
|
+
* whose `iss` the verified token carries.
|
|
810
|
+
*/
|
|
811
|
+
const project = (claims) => {
|
|
812
|
+
if (usesCloudflareAccess(policy)) return projectAccessToken(claims, policy);
|
|
813
|
+
const iss = typeof claims === "object" && claims !== null ? claims.iss : void 0;
|
|
814
|
+
const server = additional.find(({ issuer }) => issuer === iss);
|
|
815
|
+
return projectToken(claims, server ? server.claims : policy.claims);
|
|
816
|
+
};
|
|
739
817
|
/**
|
|
740
818
|
* Admits the request when its token carries `scope` or, for a list, any one of them (every one with
|
|
741
819
|
* `scopeMatch` `all`).
|
|
@@ -780,8 +858,25 @@ function createTokenAuthorization(policy, given) {
|
|
|
780
858
|
}
|
|
781
859
|
const principal = project(claims);
|
|
782
860
|
if (!principal.ok) return principal;
|
|
783
|
-
|
|
861
|
+
const admitted = admit(principal.value, policy, context);
|
|
862
|
+
if (!admitted.ok) return admitted;
|
|
863
|
+
return admits(admitted.value.scopes) ? admitted : err(standardErrors.forbidden.create());
|
|
784
864
|
};
|
|
785
865
|
}
|
|
866
|
+
/**
|
|
867
|
+
* The policy's declarative admission of a verified token's principal: its client among `clients`, its kind
|
|
868
|
+
* among `actorKinds`, and a person's scopes as `people` says. Without any of them, the principal as the
|
|
869
|
+
* token's claims grant it.
|
|
870
|
+
*/
|
|
871
|
+
function admit(principal, policy, context) {
|
|
872
|
+
const { clients, actorKinds, people } = policy;
|
|
873
|
+
if (clients && (!principal.client || !clients.includes(principal.client.id))) return err(standardErrors.unauthorized.create());
|
|
874
|
+
if (actorKinds && !actorKinds.includes(principal.actorKind)) return err(standardErrors.forbidden.create());
|
|
875
|
+
if (people === "all" && principal.actorKind === "user") return ok({
|
|
876
|
+
...principal,
|
|
877
|
+
scopes: [...context?.publicScopes ?? []]
|
|
878
|
+
});
|
|
879
|
+
return ok(principal);
|
|
880
|
+
}
|
|
786
881
|
|
|
787
882
|
export { resolveRoles as S, schemaIds as _, projectToken as a, checkRoles as b, tokenIssuer as c, projectAccessToken as d, usesCloudflareAccess as f, hasSchemaReferences as g, canonical as h, presentedToken as i, usesOwnBearer as l, bundleSchemas as m, createTokenAuthorization as n, tokenAudiences as o, PrincipalSchema as p, createTokenVerifier as r, tokenEndpoints as s, checkTokenAuthority as t, isCrossSiteWrite as u, standaloneSchema as v, defineRoles as x, MAX_ROLES as y };
|
|
@@ -521,6 +521,11 @@ interface TokenResolutionContext<E = unknown> {
|
|
|
521
521
|
* what the caller holds.
|
|
522
522
|
*/
|
|
523
523
|
readonly applicationScopes: readonly string[];
|
|
524
|
+
/**
|
|
525
|
+
* The scopes the application's public operations take (their scopes and conditional scopes) and each
|
|
526
|
+
* transport's scope: what `people: 'all'` grants an admitted person. Never an internal operation's.
|
|
527
|
+
*/
|
|
528
|
+
readonly publicScopes?: readonly string[];
|
|
524
529
|
/**
|
|
525
530
|
* Keeps work running after the response, such as the Worker's `ExecutionContext`; absent when the handler
|
|
526
531
|
* was called without one.
|
|
@@ -574,6 +579,25 @@ interface TokenDevelopment {
|
|
|
574
579
|
/** The organization the developer acts in; `local-development` by default. */
|
|
575
580
|
organizationId?: string;
|
|
576
581
|
}
|
|
582
|
+
/**
|
|
583
|
+
* Another authorization server whose access tokens an application also accepts, with what is particular to
|
|
584
|
+
* its tokens: during a move from one server to another, both are trusted for a while.
|
|
585
|
+
*/
|
|
586
|
+
interface TokenIssuer {
|
|
587
|
+
/** The exact `iss` its tokens carry: an absolute HTTPS URL. */
|
|
588
|
+
issuer: string;
|
|
589
|
+
/** Its JWKS URL, resolved against `issuer` and HTTPS only; defaults to `.well-known/jwks.json`. */
|
|
590
|
+
jwksUri?: string;
|
|
591
|
+
/** The algorithms it signs access tokens with; `['RS256']` by default. */
|
|
592
|
+
algorithms?: readonly TokenAlgorithm[];
|
|
593
|
+
/** Where its access tokens put the organization, the scopes, the client and permissions; as `claims`. */
|
|
594
|
+
claims?: TokenClaims;
|
|
595
|
+
/**
|
|
596
|
+
* `at+jwt` when its access tokens must say they are access tokens (RFC 9068): set it for a server that signs
|
|
597
|
+
* other JWTs, such as ID tokens, with the same keys. Without it, a plain JWT is accepted too.
|
|
598
|
+
*/
|
|
599
|
+
requireType?: 'at+jwt';
|
|
600
|
+
}
|
|
577
601
|
/**
|
|
578
602
|
* How the application verifies bearer tokens: the audiences they must carry, the OAuth issuer and its JWKS,
|
|
579
603
|
* or the application's own `resolve`, the scheme OpenAPI publishes and the OAuth discovery it serves; or,
|
|
@@ -614,6 +638,42 @@ interface TokenPolicy<E = unknown> {
|
|
|
614
638
|
* Access, only the organization's claim.
|
|
615
639
|
*/
|
|
616
640
|
claims?: TokenClaims;
|
|
641
|
+
/**
|
|
642
|
+
* `at+jwt` when the issuer's access tokens must say they are access tokens (RFC 9068): set it for a server
|
|
643
|
+
* that signs other JWTs, such as ID tokens, with the same keys. Without it, a plain JWT is accepted too.
|
|
644
|
+
*/
|
|
645
|
+
requireType?: 'at+jwt';
|
|
646
|
+
/**
|
|
647
|
+
* Other authorization servers whose access tokens the application also accepts, each with its own JWKS,
|
|
648
|
+
* algorithms, claim mapping and token type: while the application moves from one server to another. A
|
|
649
|
+
* token is verified against the server its `iss` names, and only that one, and its claims are read with that
|
|
650
|
+
* server's mapping. Discovery and OpenAPI keep naming `issuer`; to move, make the new server `issuer` and
|
|
651
|
+
* list the old one here until its tokens have expired. Not under the `cloudflare-access` source, nor with
|
|
652
|
+
* the application's own `resolve`.
|
|
653
|
+
*/
|
|
654
|
+
additionalIssuers?: readonly TokenIssuer[];
|
|
655
|
+
/**
|
|
656
|
+
* The OAuth clients whose access tokens the application admits, by client id (the claim `claims.client`
|
|
657
|
+
* names, `azp` or `client_id` by default): a token of another client, or of none, is refused as
|
|
658
|
+
* `UNAUTHORIZED`. Any client by default. Set it when the authorization server issues tokens for the same
|
|
659
|
+
* audience to clients this application must not trust, such as another environment's.
|
|
660
|
+
*/
|
|
661
|
+
clients?: readonly string[];
|
|
662
|
+
/**
|
|
663
|
+
* Who the application admits: people (`user`), machines (`service`), or both, the default. A verified token
|
|
664
|
+
* of another kind is refused as `FORBIDDEN` before any operation runs; an operation's own `actorKinds`
|
|
665
|
+
* narrows further.
|
|
666
|
+
*/
|
|
667
|
+
actorKinds?: readonly ('user' | 'service')[];
|
|
668
|
+
/**
|
|
669
|
+
* What an admitted person may do. `token`, the default: what the scopes the token grants allow, those its
|
|
670
|
+
* permissions claim also lists. `all`: every public operation of the application, and each transport, such
|
|
671
|
+
* as MCP, whatever the token grants: for an authorization server that admits a person only as a member of
|
|
672
|
+
* the organization the token names and grants none of this application's scopes yet. An internal
|
|
673
|
+
* operation's scope is never granted this way, and a machine always holds what its token grants. It needs
|
|
674
|
+
* `clients`, so only the people of a client this application trusts are admitted.
|
|
675
|
+
*/
|
|
676
|
+
people?: 'token' | 'all';
|
|
617
677
|
/**
|
|
618
678
|
* Where requests present their tokens: `authorization` (the default), as a bearer token, or
|
|
619
679
|
* `cloudflare-access`, as the application token Cloudflare Access sets in `Cf-Access-Jwt-Assertion`, which
|
|
@@ -3002,4 +3062,4 @@ declare function createRpcOpenApi<E, C, O extends Record<string, OperationShape>
|
|
|
3002
3062
|
* the argument.
|
|
3003
3063
|
*/
|
|
3004
3064
|
declare function defineApp<Env, C>(): <const Ops extends Record<string, OperationShape>>(manifest: AppManifest<Env, C, Ops>) => AppManifest<Env, C, Ops>;
|
|
3005
|
-
export { PageInfo as $, executeOperation as $n,
|
|
3065
|
+
export { PageInfo as $, executeOperation as $n, DurableCorrelation as $r, defineContext as $t, TransportContext as A, ResolvedRole as An, CaptureRecord as Ar, decodeSchema as At, DeletedObject as B, TokenUsage as Bn, Attachment as Br, HandlerArguments as Bt, isPathParameterValue as C, isPublicOperation as Cn, matchesScopes as Cr, stripObject as Ct, HttpRoute as D, SchemaKeywords as Dn, TokenPrincipal as Dr, SchemaValidationError as Dt, HttpOptions as E, operationScopes as En, TokenClient as Er, SchemaIssue as Et, Static$2 as F, BillingService as Fn, Result as Fr, ContextDeclaration as Ft, NamedReference as G, CaptureConfig as Gn, ErrorDefinition as Gr, PreparedContext as Gt, EmailAddressSchema as H, UsageReceipt as Hn, CreateArguments as Hr, HandlerHttp as Ht, TSchema$2 as I, LimitVerdict as In, Success as Ir, DomainCode as It, PostalAddress as J, CaptureSink as Jn, FailureData as Jr, SchemaOf as Jt, NamedReferenceSchema as K, CaptureDimensions as Kn, ErrorFactory as Kr, RegisteredEnv as Kt, Type$2 as L, MeteredCall as Ln, err as Lr, Fail as Lt, projectAccessToken as M, RoleDefinitions as Mn, BinaryBody as Mr, parseSchema as Mt, EmptyInputSchema as N, defineRoles as Nn, BodyFailure as Nr, AuthOptions as Nt, HttpTransport as O, StaticDecode as On, OAuthResource as Or, InputIssue as Ot, OrganizationIdSchema as P, resolveRoles as Pn, FailureResult as Pr, ContextArguments as Pt, Page as Q, ExecutionCall as Qn, standardErrors as Qr, defineAuth as Qt, UuidSchema as R, OperationMeter as Rn, isResult as Rr, Failed as Rt, isInputHeaderName as S, composeOperations as Sn, ScopeMatch as Sr, strictObject as St, HttpMiddleware as T, operationMatchesScopes as Tn, PrincipalSchema as Tr, urlSchema as Tt, HexColorSchema as U, recordMeter as Un, DefinedErrors as Ur, HandlerMcp as Ut, DeletedObjectSchema as V, UsageEvent as Vn, AttachmentOutputSchema as Vr, HandlerDeclaration as Vt, HttpsUrlSchema as W, AnyContext as Wn, ErrorCatalog as Wr, HandlerOptions as Wt, SignedUrl as X, VerifiedCaller as Xn, defineErrors as Xr, ToolDeclaration as Xt, PostalAddressSchema as Y, CapturedCall as Yn, FailureSchema as Yr, SchemaOrFields as Yt, SignedUrlSchema as Z, recordCapture as Zn, resultSchema as Zr, ToolOptions as Zt, readBodyText as _, McpSkill as _n, TokenScheme as _r, literalUnion as _t, t as a, ApplicationBuilder as an, diagnosticsEnabled as ar, cursorKey as at, createHttpRouteResolver as b, OperationScope as bn, createTokenVerifier as br, pipeSchema as bt, isJsonMediaType as c, TaskAccess as cn, telemetryEnabled as cr, withoutSecrets as ct, retryAfterSeconds as d, AppManifest as dn, TokenAlgorithm as dr, readSchema as dt, TraceParent as ei, defineHandler as en, AdmissionObservation as er, PageInfoSchema as et, publicDestination as f, Exposure as fn, TokenClaims as fr, SchemaInput as ft, readBodyBytes as g, McpGuide as gn, TokenResolutionContext as gr, inspectSchema as gt, HttpBodyFailureReason as h, McpConfiguration as hn, TokenPolicy as hr, inputSchema as ht, Type$1 as i, parseTraceParent as ii, StandardFailure as in, TelemetryConfig as ir, TPage as it, createHttpHandler as j, RoleDefinition as jn, CaptureRecordSchema as jr, parseInput as jt, RouteContext as k, MAX_ROLES as kn, protectedResourceMetadata as kr, decodeInput as kt, readJsonBody as l, TaskRecord as ln, withDiagnostics as lr, Checked as lt, HttpBodyFailure as m, InvocationAuthority as mn, TokenIssuer as mr, extendObject as mt, Static$1 as n, durableCorrelation as ni, defineTool as nn, ExecutionObservation as nr, PageQuery as nt, createOpenApi as o, ApplicationConfiguration as on, recordExecution as or, cutPage as ot, BodyReadOptions as p, Invocation as pn, TokenDevelopment as pr, defaultSchema as pt, PhoneNumberSchema as q, CaptureInvocation as qn, Failure as qr, RouteBody as qt, TSchema$1 as r, isRequestId as ri, STANDARD_FAILURES as rn, Observer as rr, PageQueryFields as rt, createRpcOpenApi as s, maximus as sn, reportUnexpected as sr, pageLimit as st, defineApp as t, createRequestId as ti, defineTelemetry as tn, BackgroundContext as tr, PageOrder as tt, readJsonResponse as u, TaskStore as un, TokenAccess as ur, checkSchema as ut, HttpRouteDefinition as v, OperationHandler as vn, TokenSource as vr, looseObject as vt, operationPathParameters as w, operation as wn, Principal as wr, transformSchema as wt, decodePathParameter as x, OperationShape as xn, projectToken as xr, refineSchema as xt, HttpRouteMatch as y, OperationMiddleware as yn, createTokenAuthorization as yr, normalizeSchema as yt, t$1 as z, SpendVerdict as zn, ok as zr, HandlerAnswer as zt };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as HttpRoute, E as HttpOptions, Fr as Result, dn as AppManifest, n as Static, qr as Failure, r as TSchema, un as TaskStore, wr as Principal, xn as OperationShape } from "./types-Dmw37bhl.js";
|
|
2
2
|
import { DurableObject, WorkerEntrypoint } from "cloudflare:workers";
|
|
3
3
|
/** A Workers static-assets binding; product stores and secrets never satisfy this capability. */
|
|
4
4
|
interface AssetBinding {
|
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as Static,
|
|
1
|
+
import { F as Static, qr as Failure, xn as OperationShape } from "./chunks/types-Dmw37bhl.js";
|
|
2
2
|
/** What every HTTP operation answers: its data on success, its failure otherwise, and the request id. */
|
|
3
3
|
export type Envelope<T> = {
|
|
4
4
|
success: true;
|
package/dist/diagnostics.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $r as
|
|
1
|
+
import { $r as DurableCorrelation, ar as diagnosticsEnabled, cr as telemetryEnabled, ei as TraceParent, ii as parseTraceParent, ir as TelemetryConfig, lr as withDiagnostics, ni as durableCorrelation, nr as ExecutionObservation, or as recordExecution, ri as isRequestId, rr as Observer, sr as reportUnexpected, ti as createRequestId, tr as BackgroundContext } from "./chunks/types-Dmw37bhl.js";
|
|
2
2
|
/**
|
|
3
3
|
* What diagnostics may say about an error: its name, its causes' names, its issue count and its stack
|
|
4
4
|
* locations.
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Gr as
|
|
1
|
+
import { Gr as ErrorDefinition, Hr as CreateArguments, Jr as FailureData, Kr as ErrorFactory, Qr as standardErrors, Ur as DefinedErrors, Wr as ErrorCatalog, Xr as defineErrors, Yr as FailureSchema, Zr as resultSchema, qr as Failure, ri as isRequestId } from "./chunks/types-Dmw37bhl.js";
|
|
2
2
|
export { CreateArguments, DefinedErrors, ErrorCatalog, ErrorDefinition, ErrorFactory, Failure, FailureData, FailureSchema, defineErrors, isRequestId, resultSchema, standardErrors };
|
package/dist/http-paths.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as isPathParameterValue, S as isInputHeaderName, b as createHttpRouteResolver, v as HttpRouteDefinition, w as operationPathParameters, x as decodePathParameter, y as HttpRouteMatch } from "./chunks/types-
|
|
1
|
+
import { C as isPathParameterValue, S as isInputHeaderName, b as createHttpRouteResolver, v as HttpRouteDefinition, w as operationPathParameters, x as decodePathParameter, y as HttpRouteMatch } from "./chunks/types-Dmw37bhl.js";
|
|
2
2
|
export { HttpRouteDefinition, HttpRouteMatch, createHttpRouteResolver, decodePathParameter, isInputHeaderName, isPathParameterValue, operationPathParameters };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as PageInfo, $t as defineContext, A as TransportContext, An as ResolvedRole, B as DeletedObject, Bn as TokenUsage, Br as
|
|
2
|
-
export { type AdmissionObservation, type AppManifest, type ApplicationBuilder, type ApplicationConfiguration, type Attachment, AttachmentOutputSchema, type AuthOptions, type BackgroundContext, type BillingService, type BinaryBody, type BodyFailure, type BodyReadOptions, type ContextArguments, type ContextDeclaration, type DefinedErrors, type DeletedObject, DeletedObjectSchema, type DomainCode, EmailAddressSchema, EmptyInputSchema, type ErrorCatalog, type ErrorDefinition, type ErrorFactory, type ExecutionObservation, type Exposure, type Fail, type Failed, type Failure, type FailureData, type FailureResult, FailureSchema, type HandlerAnswer, type HandlerArguments, type HandlerDeclaration, type HandlerHttp, type HandlerMcp, type HandlerOptions, HexColorSchema, type HttpBodyFailure, type HttpBodyFailureReason, type HttpMiddleware, type HttpOptions, type HttpRoute, type HttpRouteDefinition, type HttpRouteMatch, type HttpTransport, HttpsUrlSchema, type Invocation, type InvocationAuthority, type LimitVerdict, MAX_ROLES, type McpConfiguration, type McpGuide, type McpSkill, type NamedReference, NamedReferenceSchema, type OAuthResource, type Observer, type OperationMeter, type OperationMiddleware, type OperationScope, type OperationShape, OrganizationIdSchema, Page, type PageInfo, PageInfoSchema, type PageOrder, type PageQuery, PageQueryFields, PhoneNumberSchema, type PostalAddress, PostalAddressSchema, type PreparedContext, type Principal, PrincipalSchema, type ResolvedRole, type Result, type RoleDefinition, type RoleDefinitions, type RouteBody, type RouteContext, type SchemaKeywords, type SchemaOf, type SchemaOrFields, type ScopeMatch, type SignedUrl, SignedUrlSchema, type SpendVerdict, type Static, type Success, type TPage, type TSchema, type TelemetryConfig, type TokenAccess, type TokenAlgorithm, type TokenClaims, type TokenClient, type TokenDevelopment, type TokenPolicy, type TokenPrincipal, type TokenResolutionContext, type TokenScheme, type TokenSource, type TokenUsage, type ToolDeclaration, type ToolOptions, type TransportContext, Type, type UsageEvent, type UsageReceipt, UuidSchema, createHttpHandler, createHttpRouteResolver, createOpenApi, createRpcOpenApi, createTokenAuthorization, createTokenVerifier, cursorKey, cutPage, defineAuth, defineContext, defineErrors, defineHandler, defineRoles, defineTelemetry, defineTool, err, isJsonMediaType, isPublicOperation, isResult, matchesScopes, maximus, ok, operationMatchesScopes, operationScopes, pageLimit, parseInput, parseSchema, projectAccessToken, projectToken, protectedResourceMetadata, publicDestination, readBodyBytes, readBodyText, readJsonBody, readJsonResponse, reportUnexpected, resolveRoles, resultSchema, retryAfterSeconds, standardErrors, t };
|
|
1
|
+
import { $ as PageInfo, $t as defineContext, A as TransportContext, An as ResolvedRole, B as DeletedObject, Bn as TokenUsage, Br as Attachment, Bt as HandlerArguments, Cn as isPublicOperation, Cr as matchesScopes, D as HttpRoute, Dn as SchemaKeywords, Dr as TokenPrincipal, E as HttpOptions, En as operationScopes, Er as TokenClient, Fn as BillingService, Fr as Result, Ft as ContextDeclaration, G as NamedReference, Gr as ErrorDefinition, Gt as PreparedContext, H as EmailAddressSchema, Hn as UsageReceipt, Ht as HandlerHttp, In as LimitVerdict, Ir as Success, It as DomainCode, J as PostalAddress, Jr as FailureData, Jt as SchemaOf, K as NamedReferenceSchema, Kr as ErrorFactory, Lr as err, Lt as Fail, M as projectAccessToken, Mn as RoleDefinitions, Mr as BinaryBody, Mt as parseSchema, N as EmptyInputSchema, Nn as defineRoles, Nr as BodyFailure, Nt as AuthOptions, O as HttpTransport, Or as OAuthResource, P as OrganizationIdSchema, Pn as resolveRoles, Pr as FailureResult, Pt as ContextArguments, Q as Page, Qr as standardErrors, Qt as defineAuth, R as UuidSchema, Rn as OperationMeter, Rr as isResult, Rt as Failed, Sr as ScopeMatch, T as HttpMiddleware, Tn as operationMatchesScopes, Tr as PrincipalSchema, U as HexColorSchema, Ur as DefinedErrors, Ut as HandlerMcp, V as DeletedObjectSchema, Vn as UsageEvent, Vr as AttachmentOutputSchema, Vt as HandlerDeclaration, W as HttpsUrlSchema, Wr as ErrorCatalog, Wt as HandlerOptions, X as SignedUrl, Xr as defineErrors, Xt as ToolDeclaration, Y as PostalAddressSchema, Yr as FailureSchema, Yt as SchemaOrFields, Z as SignedUrlSchema, Zr as resultSchema, Zt as ToolOptions, _ as readBodyText, _n as McpSkill, _r as TokenScheme, a as t, an as ApplicationBuilder, at as cursorKey, b as createHttpRouteResolver, bn as OperationScope, br as createTokenVerifier, c as isJsonMediaType, d as retryAfterSeconds, dn as AppManifest, dr as TokenAlgorithm, en as defineHandler, er as AdmissionObservation, et as PageInfoSchema, f as publicDestination, fn as Exposure, fr as TokenClaims, g as readBodyBytes, gn as McpGuide, gr as TokenResolutionContext, h as HttpBodyFailureReason, hn as McpConfiguration, hr as TokenPolicy, i as Type, ir as TelemetryConfig, it as TPage, j as createHttpHandler, jn as RoleDefinition, jt as parseInput, k as RouteContext, kn as MAX_ROLES, kr as protectedResourceMetadata, l as readJsonBody, m as HttpBodyFailure, mn as InvocationAuthority, mr as TokenIssuer, n as Static, nn as defineTool, nr as ExecutionObservation, nt as PageQuery, o as createOpenApi, on as ApplicationConfiguration, ot as cutPage, p as BodyReadOptions, pn as Invocation, pr as TokenDevelopment, q as PhoneNumberSchema, qr as Failure, qt as RouteBody, r as TSchema, rr as Observer, rt as PageQueryFields, s as createRpcOpenApi, sn as maximus, sr as reportUnexpected, st as pageLimit, tn as defineTelemetry, tr as BackgroundContext, tt as PageOrder, u as readJsonResponse, ur as TokenAccess, v as HttpRouteDefinition, vr as TokenSource, wr as Principal, xn as OperationShape, xr as projectToken, y as HttpRouteMatch, yn as OperationMiddleware, yr as createTokenAuthorization, zn as SpendVerdict, zr as ok, zt as HandlerAnswer } from "./chunks/types-Dmw37bhl.js";
|
|
2
|
+
export { type AdmissionObservation, type AppManifest, type ApplicationBuilder, type ApplicationConfiguration, type Attachment, AttachmentOutputSchema, type AuthOptions, type BackgroundContext, type BillingService, type BinaryBody, type BodyFailure, type BodyReadOptions, type ContextArguments, type ContextDeclaration, type DefinedErrors, type DeletedObject, DeletedObjectSchema, type DomainCode, EmailAddressSchema, EmptyInputSchema, type ErrorCatalog, type ErrorDefinition, type ErrorFactory, type ExecutionObservation, type Exposure, type Fail, type Failed, type Failure, type FailureData, type FailureResult, FailureSchema, type HandlerAnswer, type HandlerArguments, type HandlerDeclaration, type HandlerHttp, type HandlerMcp, type HandlerOptions, HexColorSchema, type HttpBodyFailure, type HttpBodyFailureReason, type HttpMiddleware, type HttpOptions, type HttpRoute, type HttpRouteDefinition, type HttpRouteMatch, type HttpTransport, HttpsUrlSchema, type Invocation, type InvocationAuthority, type LimitVerdict, MAX_ROLES, type McpConfiguration, type McpGuide, type McpSkill, type NamedReference, NamedReferenceSchema, type OAuthResource, type Observer, type OperationMeter, type OperationMiddleware, type OperationScope, type OperationShape, OrganizationIdSchema, Page, type PageInfo, PageInfoSchema, type PageOrder, type PageQuery, PageQueryFields, PhoneNumberSchema, type PostalAddress, PostalAddressSchema, type PreparedContext, type Principal, PrincipalSchema, type ResolvedRole, type Result, type RoleDefinition, type RoleDefinitions, type RouteBody, type RouteContext, type SchemaKeywords, type SchemaOf, type SchemaOrFields, type ScopeMatch, type SignedUrl, SignedUrlSchema, type SpendVerdict, type Static, type Success, type TPage, type TSchema, type TelemetryConfig, type TokenAccess, type TokenAlgorithm, type TokenClaims, type TokenClient, type TokenDevelopment, type TokenIssuer, type TokenPolicy, type TokenPrincipal, type TokenResolutionContext, type TokenScheme, type TokenSource, type TokenUsage, type ToolDeclaration, type ToolOptions, type TransportContext, Type, type UsageEvent, type UsageReceipt, UuidSchema, createHttpHandler, createHttpRouteResolver, createOpenApi, createRpcOpenApi, createTokenAuthorization, createTokenVerifier, cursorKey, cutPage, defineAuth, defineContext, defineErrors, defineHandler, defineRoles, defineTelemetry, defineTool, err, isJsonMediaType, isPublicOperation, isResult, matchesScopes, maximus, ok, operationMatchesScopes, operationScopes, pageLimit, parseInput, parseSchema, projectAccessToken, projectToken, protectedResourceMetadata, publicDestination, readBodyBytes, readBodyText, readJsonBody, readJsonResponse, reportUnexpected, resolveRoles, resultSchema, retryAfterSeconds, standardErrors, t };
|
package/dist/index.js
CHANGED
|
@@ -4,12 +4,12 @@ import { i as standardErrors, n as defineErrors, r as resultSchema, t as Failure
|
|
|
4
4
|
import { n as readBodyBytes, r as readBodyText } from "./chunks/body-DOIHwIIl.js";
|
|
5
5
|
import { t as createHttpRouteResolver } from "./chunks/http-paths-D043DkJv.js";
|
|
6
6
|
import { S as matchesScopes, b as operationScopes, m as isPublicOperation, v as operationMatchesScopes } from "./chunks/tasks-CD-B6_nv.js";
|
|
7
|
-
import { S as resolveRoles, a as projectToken, d as projectAccessToken, n as createTokenAuthorization, p as PrincipalSchema, r as createTokenVerifier, x as defineRoles, y as MAX_ROLES } from "./chunks/tokens-
|
|
7
|
+
import { S as resolveRoles, a as projectToken, d as projectAccessToken, n as createTokenAuthorization, p as PrincipalSchema, r as createTokenVerifier, x as defineRoles, y as MAX_ROLES } from "./chunks/tokens-CBQO5lc0.js";
|
|
8
8
|
import { n as isResult, r as ok, t as err } from "./chunks/result-CF4OzG9O.js";
|
|
9
|
-
import { a as maximus, i as protectedResourceMetadata, n as t, r as createHttpHandler, t as Type } from "./chunks/src-
|
|
9
|
+
import { a as maximus, i as protectedResourceMetadata, n as t, r as createHttpHandler, t as Type } from "./chunks/src-8mwPVI5H.js";
|
|
10
10
|
import { a as defineTelemetry, i as defineHandler, n as defineAuth, o as defineTool, r as defineContext } from "./chunks/handler-DSpyrWc-.js";
|
|
11
11
|
import { o as reportUnexpected } from "./chunks/telemetry-BtxJh69Q.js";
|
|
12
|
-
import { n as createRpcOpenApi, t as createOpenApi } from "./chunks/openapi-
|
|
12
|
+
import { n as createRpcOpenApi, t as createOpenApi } from "./chunks/openapi-Ye_Ypx-d.js";
|
|
13
13
|
import { a as retryAfterSeconds, i as readJsonResponse, r as readJsonBody, t as isJsonMediaType } from "./chunks/json-B14evE6-.js";
|
|
14
14
|
import { t as publicDestination } from "./chunks/destination-5xTX0b7E.js";
|
|
15
15
|
|
package/dist/internals.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $n as executeOperation, A as TransportContext, E as HttpOptions, En as operationScopes, Gn as CaptureConfig, Ln as MeteredCall, O as HttpTransport, Qn as ExecutionCall, Sn as composeOperations, Un as recordMeter, Xn as VerifiedCaller, Yn as CapturedCall, Zn as recordCapture, b as createHttpRouteResolver, cr as telemetryEnabled, dn as AppManifest, ir as TelemetryConfig, lr as withDiagnostics, mn as InvocationAuthority, or as recordExecution, pn as Invocation, t as defineApp, tr as BackgroundContext, v as HttpRouteDefinition, wn as operation, xn as OperationShape, y as HttpRouteMatch, yn as OperationMiddleware } from "./chunks/types-
|
|
1
|
+
import { $n as executeOperation, A as TransportContext, E as HttpOptions, En as operationScopes, Gn as CaptureConfig, Ln as MeteredCall, O as HttpTransport, Qn as ExecutionCall, Sn as composeOperations, Un as recordMeter, Xn as VerifiedCaller, Yn as CapturedCall, Zn as recordCapture, b as createHttpRouteResolver, cr as telemetryEnabled, dn as AppManifest, ir as TelemetryConfig, lr as withDiagnostics, mn as InvocationAuthority, or as recordExecution, pn as Invocation, t as defineApp, tr as BackgroundContext, v as HttpRouteDefinition, wn as operation, xn as OperationShape, y as HttpRouteMatch, yn as OperationMiddleware } from "./chunks/types-Dmw37bhl.js";
|
|
2
2
|
export { type AppManifest, type BackgroundContext, type CaptureConfig, type CapturedCall, type ExecutionCall, type HttpOptions, type HttpRouteDefinition, type HttpRouteMatch, type HttpTransport, type Invocation, type InvocationAuthority, type MeteredCall, type OperationMiddleware, type OperationShape, type TelemetryConfig, type TransportContext, type VerifiedCaller, composeOperations, createHttpRouteResolver, defineApp, executeOperation, operation, operationScopes, recordCapture, recordExecution, recordMeter, telemetryEnabled, withDiagnostics };
|
package/dist/internals.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as executeOperation, r as recordCapture, t as recordMeter } from "./chunks/meter-
|
|
2
|
-
import { n as defineApp } from "./chunks/define-app-
|
|
1
|
+
import { n as executeOperation, r as recordCapture, t as recordMeter } from "./chunks/meter-BpzCC7J3.js";
|
|
2
|
+
import { n as defineApp } from "./chunks/define-app-IhSbBWTD.js";
|
|
3
3
|
import { b as operationScopes, g as operation, p as composeOperations } from "./chunks/tasks-CD-B6_nv.js";
|
|
4
4
|
import { a as recordExecution, c as withDiagnostics, s as telemetryEnabled } from "./chunks/telemetry-BtxJh69Q.js";
|
|
5
5
|
import { t as createHttpRouteResolver } from "./chunks/http-paths-D043DkJv.js";
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as HttpTransport } from "../chunks/types-
|
|
1
|
+
import { O as HttpTransport } from "../chunks/types-Dmw37bhl.js";
|
|
2
2
|
/**
|
|
3
3
|
* The MCP transport, for `createWorker(app, { transports: [mcp()] })`: serves the operations that declare
|
|
4
4
|
* `mcp` as tools over Streamable HTTP at `/mcp` (or `path`), with the OpenAPI document and guides as
|
package/dist/mcp/index.js
CHANGED
|
@@ -13,7 +13,7 @@ function mcp(options = {}) {
|
|
|
13
13
|
scope: (namespace) => `${namespace}:mcp:use`,
|
|
14
14
|
maxBodyBytes: (operations, fallback) => Math.max(fallback, ...operations.flatMap(([, op]) => op.mcp ? [op.maxBodyBytes ?? fallback] : [])),
|
|
15
15
|
async handle(context) {
|
|
16
|
-
const { handleMcp } = await import("../chunks/server-
|
|
16
|
+
const { handleMcp } = await import("../chunks/server-ZGiWOeAp.js");
|
|
17
17
|
return handleMcp(context);
|
|
18
18
|
}
|
|
19
19
|
};
|
package/dist/mcp/tasks.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fr as Result, cn as TaskAccess, ln as TaskRecord, qr as Failure } from "../chunks/types-Dmw37bhl.js";
|
|
2
2
|
import { CallToolResult, McpServer } from "@modelcontextprotocol/server";
|
|
3
3
|
/** The Tasks extension's id, which a client declares on each request and a server among its capabilities. */
|
|
4
4
|
export declare const TASKS_EXTENSION = "io.modelcontextprotocol/tasks";
|