@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.
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-g0A34g8z.js → define-app-IhSbBWTD.js} +1 -1
  7. package/dist/chunks/{http-layout-CdFZEF2S.js → http-layout-B-9NbM5M.js} +1 -1
  8. package/dist/chunks/{meter-BnrQY5rb.js → meter-BpzCC7J3.js} +1 -1
  9. package/dist/chunks/{openapi-BkR-hcYJ.js → openapi-Ye_Ypx-d.js} +1 -1
  10. package/dist/chunks/{openapi-file-F5kJS8x-.js → openapi-file-2fUP4JLw.js} +2 -2
  11. package/dist/chunks/{pages-DLW65kXL.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-DoyJqzAv.js → runtime-Bg729nOQ.js} +3 -3
  15. package/dist/chunks/{server-DxifcN7e.js → server-ZGiWOeAp.js} +1 -1
  16. package/dist/chunks/{src-BNbGseOR.js → src-8mwPVI5H.js} +10 -6
  17. package/dist/chunks/{tokens-b9dEBUu9.js → tokens-CBQO5lc0.js} +109 -14
  18. package/dist/chunks/{types-Do00dTUs.d.ts → types-Dmw37bhl.d.ts} +61 -1
  19. package/dist/chunks/{workers-types-DjWyO_Pu.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 +2 -2
  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 +47 -4
@@ -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-Do00dTUs.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-Do00dTUs.js";
2
- import { n as WorkerOptions, r as WorkerRuntime } from "../chunks/workers-types-DjWyO_Pu.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-DoyJqzAv.js";
3
- import { t as checkPagePaths } from "../chunks/pages-DLW65kXL.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 AttachmentOutputSchema, 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, 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, zr as Attachment } from "./chunks/types-Do00dTUs.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-Do00dTUs.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-F5kJS8x-.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
@@ -1,12 +1,19 @@
1
- import { Mn as RoleDefinitions, dr as TokenAlgorithm, mr as TokenPolicy, pr as TokenDevelopment } from "../chunks/types-Do00dTUs.js";
2
- import { WorkerConfig } from "cf/config";
1
+ import { Mn as RoleDefinitions, dr as TokenAlgorithm, hr as TokenPolicy, pr as TokenDevelopment } from "../chunks/types-Dmw37bhl.js";
2
+ import { WorkerConfig, bindings } from "cf/config";
3
3
  import { Plugin } from "vite";
4
4
  /** Where the Worker runs: `development` under `vp dev`, `production` in every build. */
5
5
  type Phase = 'development' | 'production';
6
6
  /** How tokens are verified, as configuration states it; the code that verifies them itself is `auth.ts`. */
7
- type TokenOptions = Omit<TokenPolicy, 'resolve' | 'challenge' | 'resources' | 'resourceMetadataUrl' | 'audience' | 'development'> & {
7
+ type TokenOptions = Omit<TokenPolicy, 'resolve' | 'challenge' | 'resources' | 'resourceMetadataUrl' | 'audience' | 'development' | 'clients'> & {
8
8
  /** The audience tokens must carry, or several any one of which they may carry; by default, the origin. */
9
9
  audience?: TokenPolicy['audience'];
10
+ /**
11
+ * The OAuth clients whose access tokens the application admits: a list every environment admits, or each
12
+ * environment's own by its name, `{ production: 'notes-web', preview: 'notes-preview' }`, so a preview's
13
+ * tokens never open production. Under `vp dev`, a record without `development` gives production's; a build
14
+ * of an environment the record does not name is refused.
15
+ */
16
+ clients?: readonly string[] | Readonly<Record<string, string | readonly string[]>>;
10
17
  /**
11
18
  * The token `vp dev` accepts from localhost: its binding, `DEVELOPMENT_TOKEN` by default, which only
12
19
  * `vp dev` declares. `false` accepts none.
@@ -30,6 +37,14 @@ interface WebAppOptions {
30
37
  * runs inline scripts over plain HTTP.
31
38
  */
32
39
  headers?: Readonly<Record<string, string | false>>;
40
+ /**
41
+ * The pages of an app whose own router declares them, such as TanStack Router's, in place of `app/routes/`:
42
+ * each path the Worker answers with `index.html`, fixed (`/patients`) or with parameter segments
43
+ * (`/patients/:patientId`, or `$patientId` as TanStack Router writes it). Every other path that is no
44
+ * operation, page or file of the build answers `NOT_FOUND`. Without it or `app/routes/`, the app's one page
45
+ * is `/`.
46
+ */
47
+ pages?: readonly string[];
33
48
  }
34
49
  /**
35
50
  * What `vite.config.ts` states: the application's configuration, and the Worker's settings as Cloudflare
@@ -108,9 +123,39 @@ interface MaximusOptions extends Omit<WorkerConfig, 'name' | 'entrypoint' | 'env
108
123
  };
109
124
  /** The Worker's bindings, from `cf/config`'s `bindings`; the generated `Env` is inferred from them. */
110
125
  env?: WorkerConfig['env'];
111
- /** What a web app answers with besides its build: its response headers. */
126
+ /** What a web app answers with besides its build: its response headers, and the pages its own router declares. */
112
127
  webApp?: WebAppOptions;
128
+ /**
129
+ * The account's Secrets Store, by its id: the store `storeSecret()` bindings read their secrets from.
130
+ */
131
+ secretsStore?: string;
132
+ /**
133
+ * What each environment changes over these options, by its name, which is the Vite mode that builds it:
134
+ * `vp build --mode preview` builds `preview`. An environment states only what differs: `env` and `tokens`
135
+ * key by key, any other option whole. `production` and `development` (`vp dev`) only override.
136
+ *
137
+ * Any other environment is apart from production. It is served at addresses of its own: never the shared
138
+ * `domains`, but its own `origin` when it states one, and otherwise the Worker's preview URLs (`preview`) or
139
+ * its `workers.dev` subdomain. `preview` is the Worker's previews (`cf previews deploy`); every other one is
140
+ * a Worker of its own, named `<name>-<environment>`. It runs the `triggers` it states and no other: no shared
141
+ * route, cron schedule or queue consumer. And it shares no store with production by accident: a shared R2
142
+ * bucket becomes `<bucket>-<environment>`, and a shared D1, KV or Hyperdrive bound by its id, or a shared
143
+ * queue, is refused until the environment declares its own.
144
+ */
145
+ environments?: Readonly<Record<string, EnvironmentOptions>>;
113
146
  }
147
+ /** What an environment states over the shared options: any of them but the service's name and namespace. */
148
+ type EnvironmentOptions = Partial<Omit<MaximusOptions, 'name' | 'namespace' | 'environments'>>;
149
+ /**
150
+ * A secret of the account's Secrets Store that names no store of its own: read from `secretsStore`, under
151
+ * its binding's name unless it names another. `storeSecret()` writes such a binding.
152
+ */
153
+ export declare function storeSecret(secretName?: string): ReturnType<typeof bindings.secretsStoreSecret>;
154
+ /**
155
+ * What `auth0()` and `cloudflareAccess()` state: token options without clients by environment, so the same
156
+ * value also configures a Worker composed by hand, whose policy lists its clients.
157
+ */
158
+ type PresetTokens = Omit<TokenOptions, 'clients'>;
114
159
  /** The algorithms Auth0 signs an API's access tokens with that a JWKS publishes the keys of. */
115
160
  type Auth0Algorithm = Extract<TokenAlgorithm, 'RS256' | 'RS512' | 'PS256'>;
116
161
  /** What `auth0()` takes: the tenant's domain, the API's audience and its signing algorithms. */
@@ -125,6 +170,27 @@ interface Auth0Options {
125
170
  /** The algorithms the API signs its access tokens with, as its settings name them; `['RS256']` by default. */
126
171
  algorithms?: readonly Auth0Algorithm[];
127
172
  }
173
+ /** What `arbolIdentity()` takes: the API's audience, the clients it admits and what their people may do. */
174
+ interface ArbolIdentityOptions {
175
+ /**
176
+ * The API's audience, which Identity's access tokens for it carry, such as `https://notes.example.com`, or
177
+ * several; by default, the service's origin.
178
+ */
179
+ audience?: string | readonly string[];
180
+ /** Identity's origin, which its tokens name as `iss`; `https://id.getarbol.com` by default. */
181
+ issuer?: string;
182
+ /**
183
+ * The clients whose tokens the service admits, registered at Identity: a list every environment admits, or
184
+ * each environment's own, `{ production: '…', preview: '…' }`. Any client by default.
185
+ */
186
+ clients?: TokenOptions['clients'];
187
+ /**
188
+ * What a person signed in through one of `clients` may do: `all`, every public operation of the service,
189
+ * for one whose members Identity admits without granting its scopes; `token`, the default, what the token's
190
+ * scopes and permissions grant.
191
+ */
192
+ people?: TokenOptions['people'];
193
+ }
128
194
  /** What `cloudflareAccess()` takes: the team, the Access application and what its callers hold. */
129
195
  interface CloudflareAccessOptions {
130
196
  /** The Zero Trust team name: `acme` for `acme.cloudflareaccess.com`. */
@@ -153,7 +219,19 @@ interface CloudflareAccessOptions {
153
219
  * such as one with a scheme or a path, and for an algorithm other than RS256, RS512 and PS256: HS256 tokens
154
220
  * are signed with a secret, which no JWKS publishes.
155
221
  */
156
- export declare function auth0({ domain, audience, algorithms }: Auth0Options): TokenOptions;
222
+ export declare function auth0({ domain, audience, algorithms }: Auth0Options): PresetTokens;
223
+ /**
224
+ * The token options of a service whose access tokens Arbol's Identity issues, as its OpenID metadata publishes
225
+ * it: the issuer, its JWKS (`/api/auth/jwks`), its authorization and token endpoints (`/api/auth/oauth2/…`),
226
+ * access tokens that say so (`typ: at+jwt`), and machines whose subject is their client id. With `clients`, it
227
+ * admits only the tokens of those clients, each environment's own when they are named by environment; with
228
+ * `people: 'all'`, their people may call every public operation:
229
+ *
230
+ * tokens: arbolIdentity({ clients: { production: '…', preview: '…' }, people: 'all' })
231
+ *
232
+ * Throws a TypeError for an issuer that is not an HTTPS origin.
233
+ */
234
+ export declare function arbolIdentity({ audience, issuer, clients, people }?: ArbolIdentityOptions): TokenOptions;
157
235
  /**
158
236
  * The token options of an application behind Cloudflare Access: the application token Access sets in
159
237
  * `Cf-Access-Jwt-Assertion`, read from there alone and verified against the team's keys (RS256, issued by
@@ -162,11 +240,11 @@ export declare function auth0({ domain, audience, algorithms }: Auth0Options): T
162
240
  * for a team that is not a team name, such as the team's domain, and an AUD tag that is not 64 lowercase
163
241
  * hexadecimal characters.
164
242
  */
165
- export declare function cloudflareAccess({ team, aud, managedOAuth, organizationId, scopes }: CloudflareAccessOptions): TokenOptions;
243
+ export declare function cloudflareAccess({ team, aud, managedOAuth, organizationId, scopes }: CloudflareAccessOptions): PresetTokens;
166
244
  /**
167
245
  * Maximus in Vite+: prepares the project from its files before every build and source change, brings the
168
246
  * Maximus lint and format presets, and builds, runs and deploys the Worker these options describe through
169
247
  * Cloudflare's Vite plugin.
170
248
  */
171
249
  export declare function maximus(options: MaximusOptions): Plugin[];
172
- export type { Auth0Algorithm, Auth0Options, CloudflareAccessOptions, MaximusOptions, Phase, ServiceOptions, TokenOptions, WebAppOptions };
250
+ export type { ArbolIdentityOptions, Auth0Algorithm, Auth0Options, CloudflareAccessOptions, EnvironmentOptions, MaximusOptions, Phase, ServiceOptions, TokenOptions, WebAppOptions };