@arbol-ai/maximus 8.8.0 → 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.
Files changed (45) hide show
  1. package/config/oxfmt.mjs +2 -0
  2. package/config/oxlint.mjs +3 -0
  3. package/dist/analytics/analytics.d.ts +1 -1
  4. package/dist/body.d.ts +1 -1
  5. package/dist/capture/index.d.ts +1 -1
  6. package/dist/chunks/{define-app-Bd6sRVHj.js → define-app-IhSbBWTD.js} +1 -1
  7. package/dist/chunks/{http-layout-DqE7LBsS.js → http-layout-B-9NbM5M.js} +1 -1
  8. package/dist/chunks/{meter-dTMGs_lr.js → meter-BpzCC7J3.js} +1 -1
  9. package/dist/chunks/{openapi-BX_eqRLX.js → openapi-Ye_Ypx-d.js} +1 -1
  10. package/dist/chunks/{openapi-file-BV-f_Wij.js → openapi-file-2fUP4JLw.js} +2 -2
  11. package/dist/chunks/{pages-DVORVVEZ.js → pages-BJKV04-G.js} +1 -1
  12. package/dist/chunks/{prepare-configured-Cithjf80.js → prepare-configured-DjCFAqdH.js} +6 -2
  13. package/dist/chunks/{prepare-configured-BmRJLg6J.js → prepare-configured-Dw3-u-b3.js} +1 -1
  14. package/dist/chunks/{runtime-CWORw_TD.js → runtime-Bg729nOQ.js} +3 -3
  15. package/dist/chunks/{server-DCwV3d2Y.js → server-ZGiWOeAp.js} +1 -1
  16. package/dist/chunks/{src-Bcl6xrV7.js → src-8mwPVI5H.js} +10 -6
  17. package/dist/chunks/{tokens-D0OMoQWV.js → tokens-CBQO5lc0.js} +35 -1
  18. package/dist/chunks/{types-t_09KY-x.d.ts → types-Dmw37bhl.d.ts} +27 -0
  19. package/dist/chunks/{workers-types-DyQBrA49.d.ts → workers-types-CYOvun0Q.d.ts} +1 -1
  20. package/dist/client.d.ts +1 -1
  21. package/dist/diagnostics.d.ts +1 -1
  22. package/dist/errors.d.ts +1 -1
  23. package/dist/http-paths.d.ts +1 -1
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.js +3 -3
  26. package/dist/internals.d.ts +1 -1
  27. package/dist/internals.js +2 -2
  28. package/dist/mcp/index.d.ts +1 -1
  29. package/dist/mcp/index.js +1 -1
  30. package/dist/mcp/tasks.d.ts +1 -1
  31. package/dist/project/config.d.ts +1 -1
  32. package/dist/project/index.d.ts +2 -2
  33. package/dist/project/index.js +2 -2
  34. package/dist/schemas.d.ts +1 -1
  35. package/dist/standard-failures.d.ts +1 -1
  36. package/dist/tooling/cli.js +3 -4
  37. package/dist/vite/index.d.ts +85 -7
  38. package/dist/vite/index.js +279 -34
  39. package/dist/webhooks.d.ts +1 -1
  40. package/dist/workers/runtime.d.ts +1 -1
  41. package/dist/workers/runtime.js +1 -1
  42. package/package.json +1 -1
  43. package/skills/maximus/SKILL.md +4 -0
  44. package/skills/maximus/references/deploying.md +9 -0
  45. package/skills/maximus/references/project.md +46 -3
package/config/oxfmt.mjs CHANGED
@@ -25,6 +25,8 @@ export default defineConfig({
25
25
  '**/.agents/**',
26
26
  '**/.claude/**',
27
27
  '**/.codex/**',
28
+ '**/.tanstack/**',
29
+ '**/paraglide/**',
28
30
  'bun.lock',
29
31
  'CLAUDE.md',
30
32
  'AGENTS.md',
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-t_09KY-x.js";
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-t_09KY-x.js";
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 };
@@ -1,4 +1,4 @@
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-t_09KY-x.js";
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-D0OMoQWV.js";
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,4 +1,4 @@
1
- import { f as usesCloudflareAccess, l as usesOwnBearer } from "./tokens-D0OMoQWV.js";
1
+ import { f as usesCloudflareAccess, l as usesOwnBearer } from "./tokens-CBQO5lc0.js";
2
2
 
3
3
  // src/internal/http-layout.ts
4
4
  /**
@@ -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-Bd6sRVHj.js";
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-D0OMoQWV.js";
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-BX_eqRLX.js";
2
- import { t as prepareConfiguredProject } from "./prepare-configured-Cithjf80.js";
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";
@@ -1,4 +1,4 @@
1
- import { a as ownsPrefix, i as nativePaths, t as VERSIONED_PATH } from "./http-layout-DqE7LBsS.js";
1
+ import { a as ownsPrefix, i as nativePaths, t as VERSIONED_PATH } from "./http-layout-B-9NbM5M.js";
2
2
 
3
3
  // src/project/pages.ts
4
4
  /**
@@ -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) return api.prepare(root, mode);
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,3 +1,3 @@
1
- import { t as prepareConfiguredProject } from "./prepare-configured-Cithjf80.js";
1
+ import { t as prepareConfiguredProject } from "./prepare-configured-DjCFAqdH.js";
2
2
 
3
3
  export { prepareConfiguredProject };
@@ -1,8 +1,8 @@
1
- import { n as executeOperation, r as recordCapture, t as recordMeter } from "./meter-dTMGs_lr.js";
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-Bcl6xrV7.js";
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-D0OMoQWV.js";
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-D0OMoQWV.js";
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-Bd6sRVHj.js";
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-D0OMoQWV.js";
6
- import { n as executeOperation, r as recordCapture, t as recordMeter } from "./meter-dTMGs_lr.js";
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-DqE7LBsS.js";
11
- import { i as queryKinds, r as queryInput, t as createOpenApi } from "./openapi-BX_eqRLX.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-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 applicationScopes = Object.freeze([.../* @__PURE__ */ new Set([...operations.flatMap(([, op]) => [...operationScopes(op), ...op.conditionalScopes ?? []]), ...[...transports.byPath.values()].map((transport) => transport.scope(manifest.namespace))])]);
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);
@@ -628,6 +628,7 @@ function checkTokenAuthority(policy, namespace) {
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
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);
631
632
  if (usesOwnBearer(policy) || access && policy.resolve !== void 0 && policy.issuer === void 0) return;
632
633
  checkIssuerFacts(policy, "tokens");
633
634
  const issuers = tokenIssuers(policy);
@@ -638,6 +639,22 @@ function checkTokenAuthority(policy, namespace) {
638
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.");
639
640
  checkAdditionalIssuers(policy, issuers);
640
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
+ }
641
658
  /** Refuses an algorithm list, a claim mapping or a token type that could never verify a token. */
642
659
  function checkIssuerFacts(facts, at) {
643
660
  const { algorithms, claims, requireType } = facts;
@@ -841,8 +858,25 @@ function createTokenAuthorization(policy, given) {
841
858
  }
842
859
  const principal = project(claims);
843
860
  if (!principal.ok) return principal;
844
- return admits(principal.value.scopes) ? principal : err(standardErrors.forbidden.create());
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());
845
864
  };
846
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
+ }
847
881
 
848
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.
@@ -647,6 +652,28 @@ interface TokenPolicy<E = unknown> {
647
652
  * the application's own `resolve`.
648
653
  */
649
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';
650
677
  /**
651
678
  * Where requests present their tokens: `authorization` (the default), as a bearer token, or
652
679
  * `cloudflare-access`, as the application token Cloudflare Access sets in `Cf-Access-Jwt-Assertion`, which
@@ -1,4 +1,4 @@
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-t_09KY-x.js";
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, qr as Failure, xn as OperationShape } from "./chunks/types-t_09KY-x.js";
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;
@@ -1,4 +1,4 @@
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-t_09KY-x.js";
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 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-t_09KY-x.js";
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 };
@@ -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-t_09KY-x.js";
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 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-t_09KY-x.js";
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
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-D0OMoQWV.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-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-Bcl6xrV7.js";
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-BX_eqRLX.js";
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
 
@@ -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-t_09KY-x.js";
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-dTMGs_lr.js";
2
- import { n as defineApp } from "./chunks/define-app-Bd6sRVHj.js";
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";
@@ -1,4 +1,4 @@
1
- import { O as HttpTransport } from "../chunks/types-t_09KY-x.js";
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-DCwV3d2Y.js");
16
+ const { handleMcp } = await import("../chunks/server-ZGiWOeAp.js");
17
17
  return handleMcp(context);
18
18
  }
19
19
  };
@@ -1,4 +1,4 @@
1
- import { Fr as Result, cn as TaskAccess, ln as TaskRecord, qr as Failure } from "../chunks/types-t_09KY-x.js";
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";
@@ -1,4 +1,4 @@
1
- import { Ft as ContextDeclaration, Rn as OperationMeter, T as HttpMiddleware, Vt as HandlerDeclaration, Xt as ToolDeclaration, an as ApplicationBuilder, dn as AppManifest, fn as Exposure, pn as Invocation, vn as OperationHandler, xn as OperationShape, yn as OperationMiddleware } from "../chunks/types-t_09KY-x.js";
1
+ import { Ft as ContextDeclaration, Rn as OperationMeter, T as HttpMiddleware, Vt as HandlerDeclaration, Xt as ToolDeclaration, an as ApplicationBuilder, dn as AppManifest, fn as Exposure, pn as Invocation, vn as OperationHandler, xn as OperationShape, yn as OperationMiddleware } from "../chunks/types-Dmw37bhl.js";
2
2
  import { TSchema } from "typebox";
3
3
  /** A route's HTTP method. */
4
4
  type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
@@ -1,5 +1,5 @@
1
- import { D as HttpRoute, dn as AppManifest, xn as OperationShape } from "../chunks/types-t_09KY-x.js";
2
- import { n as WorkerOptions, r as WorkerRuntime } from "../chunks/workers-types-DyQBrA49.js";
1
+ import { D as HttpRoute, dn as AppManifest, xn as OperationShape } from "../chunks/types-Dmw37bhl.js";
2
+ import { n as WorkerOptions, r as WorkerRuntime } from "../chunks/workers-types-CYOvun0Q.js";
3
3
  /** File modules use native Workers handlers; unmatched events fail instead of disappearing. */
4
4
  type Handlers<E> = Omit<ExportedHandler<E>, 'fetch'>;
5
5
  /** One schedule, declared beside the code it runs. Configure its trigger in Cloudflare as well. */
@@ -1,6 +1,6 @@
1
1
  import { i as standardErrors } from "../chunks/errors-BoutSmiy.js";
2
- import { r as createAssetHandler, t as createWorker } from "../chunks/runtime-CWORw_TD.js";
3
- import { t as checkPagePaths } from "../chunks/pages-DVORVVEZ.js";
2
+ import { r as createAssetHandler, t as createWorker } from "../chunks/runtime-Bg729nOQ.js";
3
+ import { t as checkPagePaths } from "../chunks/pages-BJKV04-G.js";
4
4
 
5
5
  // src/project/handlers.ts
6
6
  /** Compose file handlers with explicit fallbacks, preserving the platform's execution context. */
package/dist/schemas.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as PageInfo, At as decodeSchema, B as DeletedObject, Br as Attachment, Ct as stripObject, Dn as SchemaKeywords, Dt as SchemaValidationError, Et as SchemaIssue, F as Static, G as NamedReference, H as EmailAddressSchema, I as TSchema, J as PostalAddress, K as NamedReferenceSchema, L as Type, Mt as parseSchema, N as EmptyInputSchema, On as StaticDecode, Ot as InputIssue, P as OrganizationIdSchema, Q as Page, R as UuidSchema, St as strictObject, Tt as urlSchema, U as HexColorSchema, V as DeletedObjectSchema, Vr as AttachmentOutputSchema, W as HttpsUrlSchema, X as SignedUrl, Y as PostalAddressSchema, Z as SignedUrlSchema, _t as literalUnion, at as cursorKey, bt as pipeSchema, ct as withoutSecrets, dt as readSchema, et as PageInfoSchema, ft as SchemaInput, gt as inspectSchema, ht as inputSchema, it as TPage, jt as parseInput, kt as decodeInput, lt as Checked, mt as extendObject, nt as PageQuery, ot as cutPage, pt as defaultSchema, q as PhoneNumberSchema, rt as PageQueryFields, st as pageLimit, tt as PageOrder, ut as checkSchema, vt as looseObject, wt as transformSchema, xt as refineSchema, yt as normalizeSchema, z as t } from "./chunks/types-t_09KY-x.js";
1
+ import { $ as PageInfo, At as decodeSchema, B as DeletedObject, Br as Attachment, Ct as stripObject, Dn as SchemaKeywords, Dt as SchemaValidationError, Et as SchemaIssue, F as Static, G as NamedReference, H as EmailAddressSchema, I as TSchema, J as PostalAddress, K as NamedReferenceSchema, L as Type, Mt as parseSchema, N as EmptyInputSchema, On as StaticDecode, Ot as InputIssue, P as OrganizationIdSchema, Q as Page, R as UuidSchema, St as strictObject, Tt as urlSchema, U as HexColorSchema, V as DeletedObjectSchema, Vr as AttachmentOutputSchema, W as HttpsUrlSchema, X as SignedUrl, Y as PostalAddressSchema, Z as SignedUrlSchema, _t as literalUnion, at as cursorKey, bt as pipeSchema, ct as withoutSecrets, dt as readSchema, et as PageInfoSchema, ft as SchemaInput, gt as inspectSchema, ht as inputSchema, it as TPage, jt as parseInput, kt as decodeInput, lt as Checked, mt as extendObject, nt as PageQuery, ot as cutPage, pt as defaultSchema, q as PhoneNumberSchema, rt as PageQueryFields, st as pageLimit, tt as PageOrder, ut as checkSchema, vt as looseObject, wt as transformSchema, xt as refineSchema, yt as normalizeSchema, z as t } from "./chunks/types-Dmw37bhl.js";
2
2
  export { type Attachment, AttachmentOutputSchema, type Checked, type DeletedObject, DeletedObjectSchema, EmailAddressSchema, EmptyInputSchema, HexColorSchema, HttpsUrlSchema, type InputIssue, type NamedReference, NamedReferenceSchema, OrganizationIdSchema, Page, type PageInfo, PageInfoSchema, type PageOrder, type PageQuery, PageQueryFields, PhoneNumberSchema, type PostalAddress, PostalAddressSchema, type SchemaInput, type SchemaIssue, type SchemaKeywords, SchemaValidationError, type SignedUrl, SignedUrlSchema, type Static, type StaticDecode, type TPage, type TSchema, Type, UuidSchema, checkSchema, cursorKey, cutPage, decodeInput, decodeSchema, defaultSchema, extendObject, inputSchema, inspectSchema, literalUnion, looseObject, normalizeSchema, pageLimit, parseInput, parseSchema, pipeSchema, readSchema, refineSchema, strictObject, stripObject, t, transformSchema, urlSchema, withoutSecrets };
@@ -1,2 +1,2 @@
1
- import { in as StandardFailure, rn as STANDARD_FAILURES } from "./chunks/types-t_09KY-x.js";
1
+ import { in as StandardFailure, rn as STANDARD_FAILURES } from "./chunks/types-Dmw37bhl.js";
2
2
  export { STANDARD_FAILURES, StandardFailure };
@@ -13,7 +13,7 @@ const USAGE = [
13
13
  " maximus gen route <method> <path> [--tool <mcp_tool_name>] [--root <directory>]",
14
14
  " maximus gen tool <name> [--root <directory>]",
15
15
  " maximus skills [directory]",
16
- " maximus prepare [directory] [--mode production|development]",
16
+ " maximus prepare [directory] [--mode production|development|<environment>]",
17
17
  " maximus openapi [directory] [--out <file>] [--check]",
18
18
  "",
19
19
  "init creates a project: an API whose greeting route is also an MCP tool, and with --web a React app.",
@@ -132,14 +132,13 @@ async function run() {
132
132
  return;
133
133
  }
134
134
  case "prepare": {
135
- if (values.mode !== "production" && values.mode !== "development") throw new TypeError("Prepare with --mode production, as a build does, or development, as vp dev does.");
136
- const { prepareConfiguredProject } = await import("../chunks/prepare-configured-BmRJLg6J.js");
135
+ const { prepareConfiguredProject } = await import("../chunks/prepare-configured-Dw3-u-b3.js");
137
136
  const prepared = await prepareConfiguredProject(rest[0] ?? ".", values.mode);
138
137
  report(prepared, `${prepared.changed ? "Prepared" : "Kept"} .maximus/ for ${prepared.mode}: ${modules(prepared.modules)}.`);
139
138
  return;
140
139
  }
141
140
  case "openapi": {
142
- const { writeOpenApi } = await import("../chunks/openapi-file-BV-f_Wij.js");
141
+ const { writeOpenApi } = await import("../chunks/openapi-file-2fUP4JLw.js");
143
142
  const written = await writeOpenApi(rest[0] ?? ".", {
144
143
  ...values.out === void 0 ? {} : { out: values.out },
145
144
  check: values.check