@arbol-ai/maximus 8.5.1 → 8.6.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/dist/analytics/analytics.d.ts +1 -1
- package/dist/analytics/analytics.js +1 -1
- package/dist/body.d.ts +1 -1
- package/dist/body.js +1 -1
- package/dist/capture/index.d.ts +1 -1
- package/dist/capture/index.js +2 -2
- package/dist/chunks/{define-app-CvTei9a8.js → define-app-BpSKvXET.js} +45 -5
- package/dist/chunks/{http-layout-pnmGxDOY.js → http-layout-BsQlLNeo.js} +4 -5
- package/dist/chunks/{execution-BJGx5Kxb.js → meter-B_WuFl_c.js} +64 -3
- package/dist/chunks/{openapi-CoKhMm1C.js → openapi-C2A4SxMi.js} +4 -4
- package/dist/chunks/{openapi-file-Crm9fT4U.js → openapi-file-DlBVI3lc.js} +2 -2
- package/dist/chunks/{pages-D0zdaO0w.js → pages-B0xdWws9.js} +1 -1
- package/dist/chunks/{runtime-CUhyce4d.js → runtime-DjCjXIdf.js} +18 -6
- package/dist/chunks/{scaffold-DZD6dfoZ.js → scaffold-BfrJN0Yk.js} +1 -1
- package/dist/chunks/{scaffold-DGrcjR3h.js → scaffold-C16tbL7M.js} +1 -1
- package/dist/chunks/{server-tygU8dw_.js → server-UtQtcegf.js} +5 -5
- package/dist/chunks/{src-DfMzoKE_.js → src-CYk0Af0t.js} +17 -10
- package/dist/chunks/{tasks-DYdY-dBI.js → tasks-CD-B6_nv.js} +2 -2
- package/dist/chunks/{tasks-C873C3le.js → tasks-DELqUSq8.js} +1 -1
- package/dist/chunks/{tokens-D4gRyyPu.js → tokens-D6yVDtEU.js} +2 -1
- package/dist/chunks/{types-BfGa2aJT.d.ts → types-AjJyXA62.d.ts} +181 -8
- package/dist/chunks/{workers-types-Cxf-5cH7.d.ts → workers-types-B6F5WEuu.d.ts} +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +1 -1
- package/dist/diagnostics.d.ts +1 -1
- package/dist/diagnostics.js +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 +4 -4
- package/dist/internals.d.ts +2 -2
- package/dist/internals.js +5 -5
- 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/mcp/tasks.js +1 -1
- package/dist/project/config.d.ts +5 -3
- package/dist/project/config.js +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 +2 -2
- package/dist/vite/index.d.ts +11 -2
- package/dist/vite/index.js +20 -10
- 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 +10 -10
- package/skills/maximus/SKILL.md +9 -7
- package/skills/maximus/references/project.md +5 -4
- package/skills/maximus/references/routes-and-tools.md +22 -0
- package/skills/maximus/references/testing.md +1 -1
- package/templates/project/.github/workflows/ci.yml.template +23 -2
- package/templates/project/CLAUDE.md.template +1 -1
- package/templates/project/README.md.template +3 -3
- package/templates/project/package.json.template +13 -13
|
@@ -492,6 +492,8 @@ type TokenSource = 'authorization' | 'cloudflare-access';
|
|
|
492
492
|
* once, as `organizationId` or as the claim `claims.organization` names.
|
|
493
493
|
*/
|
|
494
494
|
interface TokenAccess {
|
|
495
|
+
/** Cloudflare's edge serves Managed OAuth for this application's MCP transport. Off by default. */
|
|
496
|
+
managedOAuth?: boolean;
|
|
495
497
|
/** The organization every caller acts in, when the tokens carry none: an application of one tenant. */
|
|
496
498
|
organizationId?: string;
|
|
497
499
|
/** The scopes every person Access lets through holds, each of the application's namespace. */
|
|
@@ -617,8 +619,8 @@ interface TokenPolicy<E = unknown> {
|
|
|
617
619
|
* `cloudflare-access`, as the application token Cloudflare Access sets in `Cf-Access-Jwt-Assertion`, which
|
|
618
620
|
* is then the only place a token is read: never `Authorization`, never the `CF_Authorization` cookie. The
|
|
619
621
|
* development token is a bearer token from localhost under either source. Under `cloudflare-access`, no
|
|
620
|
-
* OAuth discovery is served, a 401 challenges with a plain `Bearer`, writes a browser
|
|
621
|
-
* site are refused
|
|
622
|
+
* OAuth discovery is served by the Worker, a 401 challenges with a plain `Bearer`, and writes a browser
|
|
623
|
+
* sends for another site are refused. MCP requires `access.managedOAuth` and discovery at the edge.
|
|
622
624
|
*/
|
|
623
625
|
source?: TokenSource;
|
|
624
626
|
/**
|
|
@@ -982,6 +984,143 @@ interface CapturedCall {
|
|
|
982
984
|
* or while capture is off, whether telemetry is on or not.
|
|
983
985
|
*/
|
|
984
986
|
declare function recordCapture<E>(application: CaptureApplication<E>, env: E, background: BackgroundContext | undefined, captured: CapturedCall): void;
|
|
987
|
+
/**
|
|
988
|
+
* One fact a service measured, as its billing service takes it: what happened and how many of its units,
|
|
989
|
+
* never a price, which the organization's plan decides. Only `feature` is required.
|
|
990
|
+
*/
|
|
991
|
+
interface UsageEvent<Feature extends string = string> {
|
|
992
|
+
/** The fact, by the name the billing service gives it. */
|
|
993
|
+
feature: Feature;
|
|
994
|
+
/** How many of the fact's units; 1 when omitted. */
|
|
995
|
+
value?: number;
|
|
996
|
+
/**
|
|
997
|
+
* Unique to the fact, so the fact sent again is counted once. Omit it when every call is a new fact, such as a
|
|
998
|
+
* lookup, and the billing service makes one.
|
|
999
|
+
*/
|
|
1000
|
+
idempotencyKey?: string;
|
|
1001
|
+
/** When the fact happened, an RFC 3339 instant; when it is reported, unless given. */
|
|
1002
|
+
occurredAt?: string;
|
|
1003
|
+
/** Its labels: ids and short codes, such as a connection's id, never text a person wrote. */
|
|
1004
|
+
properties?: Readonly<Record<string, string>>;
|
|
1005
|
+
/** What the service paid a provider for this fact, which the billing service keeps beside it as a cost. */
|
|
1006
|
+
cost?: number;
|
|
1007
|
+
}
|
|
1008
|
+
/** One model call, as a billing service prices it: the model that answered and what it used, in its units. */
|
|
1009
|
+
interface TokenUsage {
|
|
1010
|
+
/** The model that answered, as its provider names it. */
|
|
1011
|
+
model: string;
|
|
1012
|
+
/** Prompt tokens no cache served. */
|
|
1013
|
+
inputTokens?: number;
|
|
1014
|
+
/** Tokens the model wrote. */
|
|
1015
|
+
outputTokens?: number;
|
|
1016
|
+
/** Prompt tokens a cache served. */
|
|
1017
|
+
cacheReadTokens?: number;
|
|
1018
|
+
/** Prompt tokens written to a cache. */
|
|
1019
|
+
cacheWriteTokens?: number;
|
|
1020
|
+
/** Pages read, for a model priced by the page. */
|
|
1021
|
+
pages?: number;
|
|
1022
|
+
/** Seconds of audio, for a model priced by the second. */
|
|
1023
|
+
audioSeconds?: number;
|
|
1024
|
+
/** Unique to the call, so the call sent again is counted once. */
|
|
1025
|
+
idempotencyKey?: string;
|
|
1026
|
+
/** When the call happened, an RFC 3339 instant; when it is reported, unless given. */
|
|
1027
|
+
occurredAt?: string;
|
|
1028
|
+
/** Its labels: ids and short codes, never text a person wrote. */
|
|
1029
|
+
properties?: Readonly<Record<string, string>>;
|
|
1030
|
+
}
|
|
1031
|
+
/**
|
|
1032
|
+
* What became of a report. `recorded`: the billing service took it and delivers it on its own, so the caller
|
|
1033
|
+
* never sends it again. `unpriced`: recorded at no price. `unavailable`: the billing service could not take it,
|
|
1034
|
+
* and only a caller that keeps its own record of the fact sends it again, with the same key. `duplicate` and
|
|
1035
|
+
* `refused`: a key already counted, and a fact the billing service turned down.
|
|
1036
|
+
*/
|
|
1037
|
+
interface UsageReceipt {
|
|
1038
|
+
/** What became of the report. */
|
|
1039
|
+
status: 'recorded' | 'duplicate' | 'refused' | 'unpriced' | 'unavailable';
|
|
1040
|
+
/** The fact's value at the organization's rates, when the billing service read them in time. */
|
|
1041
|
+
credits?: number;
|
|
1042
|
+
}
|
|
1043
|
+
/** Whether an organization may spend now. While a refusal stops nothing, `allowed` stays true. */
|
|
1044
|
+
interface SpendVerdict {
|
|
1045
|
+
/** Whether to go on. */
|
|
1046
|
+
allowed: boolean;
|
|
1047
|
+
/** Whether a refusal stops service now, or is only recorded. */
|
|
1048
|
+
enforced: boolean;
|
|
1049
|
+
/** The billing service did not answer in time, so the call was let through without knowing the balance. */
|
|
1050
|
+
degraded: boolean;
|
|
1051
|
+
/** Why it would refuse: no credits left, or a plan that does not include the fact. */
|
|
1052
|
+
reason?: 'no_credits' | 'not_in_plan';
|
|
1053
|
+
/** The credits left, when the billing service answered. */
|
|
1054
|
+
balance?: number;
|
|
1055
|
+
}
|
|
1056
|
+
/** Whether one more of a counted fact fits what the organization's plan includes. */
|
|
1057
|
+
interface LimitVerdict {
|
|
1058
|
+
/** Whether to add one more. */
|
|
1059
|
+
allowed: boolean;
|
|
1060
|
+
/** Whether a refusal stops service now, or is only recorded. */
|
|
1061
|
+
enforced: boolean;
|
|
1062
|
+
/** The billing service did not answer in time, so one more was let through. */
|
|
1063
|
+
degraded: boolean;
|
|
1064
|
+
/** How many the plan includes, or null when it grants no fixed number. */
|
|
1065
|
+
limit: number | null;
|
|
1066
|
+
}
|
|
1067
|
+
/**
|
|
1068
|
+
* A billing service's native RPC entrypoint, as a Service Binding reaches it: the binding an application names
|
|
1069
|
+
* with `meter: { binding }`, which a handler may also call itself. `Feature` names the facts this service
|
|
1070
|
+
* reports, `BillingService<'lookups' | 'provider_cost'>`, so a fact it does not report does not compile. The
|
|
1071
|
+
* billing service prices each fact: a service reports facts, never prices.
|
|
1072
|
+
*/
|
|
1073
|
+
interface BillingService<Feature extends string = string> {
|
|
1074
|
+
/** Records one fact for the organization, once per idempotency key, and answers what became of it. */
|
|
1075
|
+
reportUsage: (organizationId: string, event: UsageEvent<Feature>) => Promise<UsageReceipt>;
|
|
1076
|
+
/** Records one model call for the organization, priced by what it used. */
|
|
1077
|
+
reportTokens: (organizationId: string, usage: TokenUsage) => Promise<UsageReceipt>;
|
|
1078
|
+
/** Without a fact, whether the organization holds any credits; with one, whether it can pay one unit. */
|
|
1079
|
+
canSpend: (organizationId: string, feature?: Feature, properties?: Readonly<Record<string, string>>) => Promise<SpendVerdict>;
|
|
1080
|
+
/** Whether one more of a counted fact fits what the plan includes, given how many there are now. */
|
|
1081
|
+
checkLimit: (organizationId: string, feature: Feature, currentCount: number) => Promise<LimitVerdict>;
|
|
1082
|
+
}
|
|
1083
|
+
/**
|
|
1084
|
+
* The fact a billable call of an operation is, as its contract declares it:
|
|
1085
|
+
* `meter: { feature: 'lookups', when: (output) => output.verified }`. Once a call has answered with its checked
|
|
1086
|
+
* output, the fact is reported to the application's billing service for the verified organization, as
|
|
1087
|
+
* background work: never before the answer, never changing it, never failing it.
|
|
1088
|
+
*/
|
|
1089
|
+
interface OperationMeter<Output = never, Input = never, Feature extends string = string> {
|
|
1090
|
+
/** The fact one billable call is, by the name the billing service gives it. */
|
|
1091
|
+
feature: Feature;
|
|
1092
|
+
/** Whether this answer is billable, from its output and its input; every successful answer when omitted. */
|
|
1093
|
+
when?: (output: Output, input: Input) => boolean;
|
|
1094
|
+
/** How many of the fact's units this answer is; 1 when omitted. */
|
|
1095
|
+
value?: (output: Output, input: Input) => number;
|
|
1096
|
+
/** The fact's labels for this answer: ids and short codes, never text a person wrote. */
|
|
1097
|
+
properties?: (output: Output, input: Input) => Readonly<Record<string, string>>;
|
|
1098
|
+
}
|
|
1099
|
+
/** One call that answered, as a transport hands it to `recordMeter`. */
|
|
1100
|
+
interface MeteredCall {
|
|
1101
|
+
/** The operation's name. */
|
|
1102
|
+
operation: string;
|
|
1103
|
+
/** The verified caller, whose organization the fact belongs to. */
|
|
1104
|
+
principal: Principal;
|
|
1105
|
+
/** What the caller received. */
|
|
1106
|
+
result: Result<unknown, Failure>;
|
|
1107
|
+
/** Where execution left the admitted input. */
|
|
1108
|
+
call?: ExecutionCall;
|
|
1109
|
+
}
|
|
1110
|
+
/** What the recording point reads of the application: its operations and its billing service's binding. */
|
|
1111
|
+
interface MeterApplication<E> {
|
|
1112
|
+
operations: Readonly<Record<string, OperationShape>>;
|
|
1113
|
+
meter?: {
|
|
1114
|
+
binding: keyof E;
|
|
1115
|
+
};
|
|
1116
|
+
}
|
|
1117
|
+
/**
|
|
1118
|
+
* Reports the fact a successful call is, beside `recordCapture`, when its operation declares `meter`: to the
|
|
1119
|
+
* billing service the application names, for the verified organization, as background work after the answer,
|
|
1120
|
+
* once and never retried. It never throws, and never delays or changes the answer. Nothing is reported for a
|
|
1121
|
+
* failure, without a background context, or while the env has no such binding, as in a preview.
|
|
1122
|
+
*/
|
|
1123
|
+
declare function recordMeter<E>(application: MeterApplication<E>, env: E, background: BackgroundContext | undefined, metered: MeteredCall): void;
|
|
985
1124
|
/**
|
|
986
1125
|
* A schema's JSON Schema keywords, as Maximus reads them to publish, route and check a contract. TypeBox 1.x
|
|
987
1126
|
* types a schema without its options, so a service reads one through this view:
|
|
@@ -1223,6 +1362,11 @@ interface OperationShape extends Exposure {
|
|
|
1223
1362
|
* server's error, `INTERNAL_ERROR`.
|
|
1224
1363
|
*/
|
|
1225
1364
|
maxOutputBytes?: number;
|
|
1365
|
+
/**
|
|
1366
|
+
* The fact a billable call is, which the application's billing service records once the call has answered
|
|
1367
|
+
* with its checked output: `{ feature, when?, value?, properties? }`. It needs the application's `meter`.
|
|
1368
|
+
*/
|
|
1369
|
+
meter?: OperationMeter;
|
|
1226
1370
|
/** The handler: it receives the prepared context and the decoded input and returns a `Result`. */
|
|
1227
1371
|
execute: (context: never, input: never) => unknown;
|
|
1228
1372
|
/**
|
|
@@ -1238,11 +1382,13 @@ interface OperationShape extends Exposure {
|
|
|
1238
1382
|
}
|
|
1239
1383
|
/**
|
|
1240
1384
|
* The fields of an operation's definition besides its exposure, as `.operation()` takes them: its scope,
|
|
1241
|
-
* words, effect, failures, schemas and
|
|
1385
|
+
* words, effect, failures, schemas, limits and meter.
|
|
1242
1386
|
*/
|
|
1243
|
-
type OperationFields<I extends TSchema, O extends TSchema> = Omit<OperationShape, keyof Exposure | 'input' | 'output' | 'execute' | 'pipeline'> & {
|
|
1387
|
+
type OperationFields<I extends TSchema, O extends TSchema> = Omit<OperationShape, keyof Exposure | 'input' | 'output' | 'execute' | 'pipeline' | 'meter'> & {
|
|
1244
1388
|
input: I;
|
|
1245
1389
|
output: O;
|
|
1390
|
+
/** The fact a billable call is, its functions typed by the operation's output and decoded input. */
|
|
1391
|
+
meter?: OperationMeter<Static<O>, StaticDecode<I>>;
|
|
1246
1392
|
};
|
|
1247
1393
|
/** A definition with the exposure its declaration names, keeping that exposure's literal types. */
|
|
1248
1394
|
type OperationDefinition<I extends TSchema, O extends TSchema, X> = X & OperationFields<I, O>;
|
|
@@ -1262,9 +1408,11 @@ type OperationHandler<C, I extends TSchema, O extends TSchema, X> = (context: Op
|
|
|
1262
1408
|
*/
|
|
1263
1409
|
declare function operation<C, I extends TSchema, O extends TSchema, const X extends Exposure>(definition: OperationDefinition<I, O, X> & {
|
|
1264
1410
|
execute: OperationHandler<C, I, O, X>;
|
|
1265
|
-
}): X & Omit<OperationShape, "execute" | "input" | "output" | "pipeline" | keyof Exposure> & {
|
|
1411
|
+
}): X & Omit<OperationShape, "execute" | "input" | "meter" | "output" | "pipeline" | keyof Exposure> & {
|
|
1266
1412
|
input: I;
|
|
1267
1413
|
output: O;
|
|
1414
|
+
/** The fact a billable call is, its functions typed by the operation's output and decoded input. */
|
|
1415
|
+
meter?: OperationMeter<Static<O>, StaticDecode<I>, string> | undefined;
|
|
1268
1416
|
} & {
|
|
1269
1417
|
execute: OperationHandler<C, I, O, X>;
|
|
1270
1418
|
};
|
|
@@ -1389,6 +1537,13 @@ interface AppManifest<Env, C, Ops extends Record<string, OperationShape>> {
|
|
|
1389
1537
|
* telemetry: `defineCapture` from `@arbol-ai/maximus/capture`.
|
|
1390
1538
|
*/
|
|
1391
1539
|
capture?: CaptureConfig<Env>;
|
|
1540
|
+
/**
|
|
1541
|
+
* The billing service the operations that declare `meter` report to: its Service Binding in the env, typed
|
|
1542
|
+
* with `BillingService`. An env without that binding, such as a preview's, reports nothing.
|
|
1543
|
+
*/
|
|
1544
|
+
meter?: {
|
|
1545
|
+
binding: keyof Env;
|
|
1546
|
+
};
|
|
1392
1547
|
/**
|
|
1393
1548
|
* A Workers rate limiting binding each HTTP and MCP call must pass, per organization and actor; each
|
|
1394
1549
|
* message of an MCP batch counts as a call. A refusal answers `RATE_LIMITED`.
|
|
@@ -1705,6 +1860,12 @@ declare global {
|
|
|
1705
1860
|
type Registered<K extends string, Fallback> = K extends keyof MaximusRegister ? MaximusRegister[K] : Fallback;
|
|
1706
1861
|
/** The registered Worker's bindings. */
|
|
1707
1862
|
type RegisteredEnv = Registered<'env', unknown>;
|
|
1863
|
+
/**
|
|
1864
|
+
* The facts the registered billing service takes, as its binding's `BillingService<Feature>` names them: what a
|
|
1865
|
+
* contract's `meter` may name. Any name when the project registers no billing service, or types it otherwise.
|
|
1866
|
+
* A binding a preview leaves out is optional in `Env`, and still names its facts.
|
|
1867
|
+
*/
|
|
1868
|
+
type RegisteredFeature = [NonNullable<Registered<'meter', unknown>>] extends [Pick<BillingService<infer Feature>, 'reportUsage'>] ? Feature : string;
|
|
1708
1869
|
/** The context every handler receives: what the registered base prepares. */
|
|
1709
1870
|
type RegisteredContext = Registered<'base', never> extends ApplicationBuilder<infer _E, infer C, infer _O> ? C : Invocation<unknown>;
|
|
1710
1871
|
/** The definitions of the registered error catalog. */
|
|
@@ -1897,6 +2058,11 @@ interface HandlerOptions {
|
|
|
1897
2058
|
maxBodyBytes?: number;
|
|
1898
2059
|
/** The largest output it answers, in bytes. By default, the application's limit. */
|
|
1899
2060
|
maxOutputBytes?: number;
|
|
2061
|
+
/**
|
|
2062
|
+
* The fact a billable call is, reported to the application's billing service once the call has answered:
|
|
2063
|
+
* `{ feature: 'lookups', when: (output) => output.verified }`. None by default.
|
|
2064
|
+
*/
|
|
2065
|
+
meter?: OperationMeter<never, never, RegisteredFeature>;
|
|
1900
2066
|
}
|
|
1901
2067
|
/**
|
|
1902
2068
|
* A route as `defineHandler` declares it, before binding gives it a path and a method. `X` holds the fields
|
|
@@ -1913,8 +2079,13 @@ interface HandlerDeclaration<I extends TSchema, O extends TSchema, X, C = Regist
|
|
|
1913
2079
|
/** Answers one call. */
|
|
1914
2080
|
readonly handler: (args: HandlerArguments<C, I, X>) => HandlerAnswer<O, X>;
|
|
1915
2081
|
}
|
|
2082
|
+
/**
|
|
2083
|
+
* A contract's `meter`: a fact the registered billing service takes, and functions of the contract's own output
|
|
2084
|
+
* and decoded input.
|
|
2085
|
+
*/
|
|
2086
|
+
type ContractMeter<I, O> = OperationMeter<Static<OutputSchema<O>>, StaticDecode<SchemaOf<I>>, RegisteredFeature>;
|
|
1916
2087
|
/** The fields `defineHandler` types from its contract, as the contract names them. */
|
|
1917
|
-
type HandlerContract<I, O, F, H, M, R, E, V, N> = Omit<HandlerOptions, 'input' | 'output' | 'failures' | 'http' | 'mcp' | 'rpc' | 'effect' | 'visibility' | 'operationId'> & {
|
|
2088
|
+
type HandlerContract<I, O, F, H, M, R, E, V, N> = Omit<HandlerOptions, 'input' | 'output' | 'failures' | 'http' | 'mcp' | 'rpc' | 'effect' | 'visibility' | 'operationId' | 'meter'> & {
|
|
1918
2089
|
input?: I;
|
|
1919
2090
|
output?: O;
|
|
1920
2091
|
failures?: F;
|
|
@@ -1924,6 +2095,7 @@ type HandlerContract<I, O, F, H, M, R, E, V, N> = Omit<HandlerOptions, 'input' |
|
|
|
1924
2095
|
effect?: E;
|
|
1925
2096
|
visibility?: V;
|
|
1926
2097
|
operationId?: N;
|
|
2098
|
+
meter?: ContractMeter<I, O>;
|
|
1927
2099
|
} & ([M] extends [never] ? unknown : {
|
|
1928
2100
|
description: string;
|
|
1929
2101
|
});
|
|
@@ -1971,11 +2143,12 @@ interface ToolDeclaration<I extends TSchema, O extends TSchema, X, C = Registere
|
|
|
1971
2143
|
*/
|
|
1972
2144
|
declare function defineTool<const E extends OperationShape['effect'] = never, O extends SchemaOrFields = never, I extends SchemaOrFields = TObject<Record<never, never>>, const F extends readonly DomainCode[] = never, const R extends NonNullable<Exposure['rpc']> = never>(
|
|
1973
2145
|
/** Answers one call: its output, or `fail(code)`. */
|
|
1974
|
-
handler: (args: HandlerArguments<RegisteredContext, SchemaOf<I>, DeclaredFields<F, never, never, R, E, never, never>>) => Answer<OutputValue<O>, DeclaredFields<F, never, never, R, E, never, never>>, contract: Omit<ToolOptions, 'input' | 'output' | 'effect' | 'failures' | 'rpc'> & {
|
|
2146
|
+
handler: (args: HandlerArguments<RegisteredContext, SchemaOf<I>, DeclaredFields<F, never, never, R, E, never, never>>) => Answer<OutputValue<O>, DeclaredFields<F, never, never, R, E, never, never>>, contract: Omit<ToolOptions, 'input' | 'output' | 'effect' | 'failures' | 'rpc' | 'meter'> & {
|
|
1975
2147
|
input?: I;
|
|
1976
2148
|
output?: O;
|
|
1977
2149
|
failures?: F;
|
|
1978
2150
|
rpc?: R;
|
|
2151
|
+
meter?: ContractMeter<I, O>;
|
|
1979
2152
|
} & ([E] extends [never] ? {
|
|
1980
2153
|
effect: OperationShape['effect'];
|
|
1981
2154
|
} : {
|
|
@@ -2771,4 +2944,4 @@ declare function createRpcOpenApi<E, C, O extends Record<string, OperationShape>
|
|
|
2771
2944
|
* the argument.
|
|
2772
2945
|
*/
|
|
2773
2946
|
declare function defineApp<Env, C>(): <const Ops extends Record<string, OperationShape>>(manifest: AppManifest<Env, C, Ops>) => AppManifest<Env, C, Ops>;
|
|
2774
|
-
export { PageInfo as $,
|
|
2947
|
+
export { PageInfo as $, diagnosticsEnabled as $n, defineContext as $t, TransportContext as A, LimitVerdict as An, err as Ar, decodeSchema as At, DeletedObject as B, CaptureDimensions as Bn, Failure as Br, HandlerArguments as Bt, isPathParameterValue as C, isPublicOperation as Cn, CaptureRecord as Cr, stripObject as Ct, HttpRoute as D, SchemaKeywords as Dn, FailureResult as Dr, SchemaValidationError as Dt, HttpOptions as E, operationScopes as En, BodyFailure as Er, SchemaIssue as Et, Static$2 as F, UsageEvent as Fn, CreateArguments as Fr, ContextDeclaration as Ft, NamedReference as G, recordCapture as Gn, standardErrors as Gr, PreparedContext as Gt, EmailAddressSchema as H, CaptureSink as Hn, FailureSchema as Hr, HandlerHttp as Ht, TSchema$2 as I, UsageReceipt as In, DefinedErrors as Ir, DomainCode as It, PostalAddress as J, AdmissionObservation as Jn, createRequestId as Jr, SchemaOf as Jt, NamedReferenceSchema as K, ExecutionCall as Kn, DurableCorrelation as Kr, RegisteredEnv as Kt, Type$2 as L, recordMeter as Ln, ErrorCatalog as Lr, Fail as Lt, projectAccessToken as M, OperationMeter as Mn, ok as Mr, parseSchema as Mt, EmptyInputSchema as N, SpendVerdict as Nn, Attachment as Nr, AuthOptions as Nt, HttpTransport as O, StaticDecode as On, Result as Or, InputIssue as Ot, OrganizationIdSchema as P, TokenUsage as Pn, AttachmentOutputSchema as Pr, ContextArguments as Pt, Page as Q, TelemetryConfig as Qn, defineAuth as Qt, UuidSchema as R, AnyContext as Rn, ErrorDefinition as Rr, Failed as Rt, isInputHeaderName as S, composeOperations as Sn, protectedResourceMetadata as Sr, strictObject as St, HttpMiddleware as T, operationMatchesScopes as Tn, BinaryBody as Tr, urlSchema as Tt, HexColorSchema as U, CapturedCall as Un, defineErrors as Ur, HandlerMcp as Ut, DeletedObjectSchema as V, CaptureInvocation as Vn, FailureData as Vr, HandlerDeclaration as Vt, HttpsUrlSchema as W, VerifiedCaller as Wn, resultSchema as Wr, HandlerOptions as Wt, SignedUrl as X, ExecutionObservation as Xn, isRequestId as Xr, ToolDeclaration as Xt, PostalAddressSchema as Y, BackgroundContext as Yn, durableCorrelation as Yr, SchemaOrFields as Yt, SignedUrlSchema as Z, Observer as Zn, parseTraceParent as Zr, ToolOptions as Zt, readBodyText as _, McpSkill as _n, Principal as _r, literalUnion as _t, t as a, ApplicationBuilder as an, TokenAlgorithm as ar, cursorKey as at, createHttpRouteResolver as b, OperationScope as bn, TokenPrincipal as br, pipeSchema as bt, isJsonMediaType as c, TaskAccess as cn, TokenPolicy as cr, withoutSecrets as ct, retryAfterSeconds as d, AppManifest as dn, TokenSource as dr, readSchema as dt, defineHandler as en, recordExecution as er, PageInfoSchema as et, publicDestination as f, Exposure as fn, createTokenAuthorization as fr, SchemaInput as ft, readBodyBytes as g, McpGuide as gn, matchesScopes as gr, inspectSchema as gt, HttpBodyFailureReason as h, McpConfiguration as hn, ScopeMatch as hr, inputSchema as ht, Type$1 as i, StandardFailure as in, TokenAccess as ir, TPage as it, createHttpHandler as j, MeteredCall as jn, isResult as jr, parseInput as jt, RouteContext as k, BillingService as kn, Success as kr, decodeInput as kt, readJsonBody as l, TaskRecord as ln, TokenResolutionContext as lr, Checked as lt, HttpBodyFailure as m, InvocationAuthority as mn, projectToken as mr, extendObject as mt, Static$1 as n, defineTool as nn, telemetryEnabled as nr, PageQuery as nt, createOpenApi as o, ApplicationConfiguration as on, TokenClaims as or, cutPage as ot, BodyReadOptions as p, Invocation as pn, createTokenVerifier as pr, defaultSchema as pt, PhoneNumberSchema as q, executeOperation as qn, TraceParent as qr, RouteBody as qt, TSchema$1 as r, STANDARD_FAILURES as rn, withDiagnostics as rr, PageQueryFields as rt, createRpcOpenApi as s, maximus as sn, TokenDevelopment as sr, pageLimit as st, defineApp as t, defineTelemetry as tn, reportUnexpected as tr, PageOrder as tt, readJsonResponse as u, TaskStore as un, TokenScheme as ur, checkSchema as ut, HttpRouteDefinition as v, OperationHandler as vn, PrincipalSchema as vr, looseObject as vt, operationPathParameters as w, operation as wn, CaptureRecordSchema as wr, transformSchema as wt, decodePathParameter as x, OperationShape as xn, OAuthResource as xr, refineSchema as xt, HttpRouteMatch as y, OperationMiddleware as yn, TokenClient as yr, normalizeSchema as yt, t$1 as z, CaptureConfig as zn, ErrorFactory as zr, HandlerAnswer as zt };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as HttpRoute, E as HttpOptions,
|
|
1
|
+
import { Br as Failure, D as HttpRoute, E as HttpOptions, Or as Result, _r as Principal, dn as AppManifest, n as Static, r as TSchema, un as TaskStore, xn as OperationShape } from "./types-AjJyXA62.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 {
|
|
1
|
+
import { Br as Failure, F as Static, xn as OperationShape } from "./chunks/types-AjJyXA62.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/client.js
CHANGED
|
@@ -3,7 +3,7 @@ import { i as readJsonResponse } from "./chunks/json-B14evE6-.js";
|
|
|
3
3
|
|
|
4
4
|
// src/client.ts
|
|
5
5
|
const TIMEOUT_MS = 3e4;
|
|
6
|
-
const MAX_CONTRACT_BYTES =
|
|
6
|
+
const MAX_CONTRACT_BYTES = 8388608;
|
|
7
7
|
const DEFAULT_MAX_RESPONSE_BYTES = 1048576;
|
|
8
8
|
const MAX_FAILURE_BYTES = 16384;
|
|
9
9
|
const MAX_ATTACHMENT_BYTES = 16777216;
|
package/dist/diagnostics.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $n as diagnosticsEnabled, Jr as createRequestId, Kr as DurableCorrelation, Qn as TelemetryConfig, Xn as ExecutionObservation, Xr as isRequestId, Yn as BackgroundContext, Yr as durableCorrelation, Zn as Observer, Zr as parseTraceParent, er as recordExecution, nr as telemetryEnabled, qr as TraceParent, rr as withDiagnostics, tr as reportUnexpected } from "./chunks/types-AjJyXA62.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/diagnostics.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as parseTraceParent, n as durableCorrelation, r as isRequestId, t as createRequestId } from "./chunks/correlation-4b23a-a4.js";
|
|
2
1
|
import { a as recordExecution, c as withDiagnostics, n as diagnosticsEnabled, o as reportUnexpected, s as telemetryEnabled, u as createDiagnostics } from "./chunks/telemetry-BtxJh69Q.js";
|
|
2
|
+
import { i as parseTraceParent, n as durableCorrelation, r as isRequestId, t as createRequestId } from "./chunks/correlation-4b23a-a4.js";
|
|
3
3
|
|
|
4
4
|
export { createDiagnostics, createRequestId, diagnosticsEnabled, durableCorrelation, isRequestId, parseTraceParent, recordExecution, reportUnexpected, telemetryEnabled, withDiagnostics };
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Br as Failure, Fr as CreateArguments, Gr as standardErrors, Hr as FailureSchema, Ir as DefinedErrors, Lr as ErrorCatalog, Rr as ErrorDefinition, Ur as defineErrors, Vr as FailureData, Wr as resultSchema, Xr as isRequestId, zr as ErrorFactory } from "./chunks/types-AjJyXA62.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-AjJyXA62.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, $
|
|
2
|
-
export { type AdmissionObservation, type AppManifest, type ApplicationBuilder, type ApplicationConfiguration, type Attachment, AttachmentOutputSchema, type AuthOptions, type BackgroundContext, 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 McpConfiguration, type McpGuide, type McpSkill, type NamedReference, NamedReferenceSchema, type OAuthResource, type Observer, 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 Result, type RouteBody, type RouteContext, type SchemaKeywords, type SchemaOf, type SchemaOrFields, type ScopeMatch, type SignedUrl, SignedUrlSchema, 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 ToolDeclaration, type ToolOptions, type TransportContext, Type, UuidSchema, createHttpHandler, createHttpRouteResolver, createOpenApi, createRpcOpenApi, createTokenAuthorization, createTokenVerifier, cursorKey, cutPage, defineAuth, defineContext, defineErrors, defineHandler, defineTelemetry, defineTool, err, isJsonMediaType, isPublicOperation, isResult, matchesScopes, maximus, ok, operationMatchesScopes, operationScopes, pageLimit, parseInput, parseSchema, projectAccessToken, projectToken, protectedResourceMetadata, publicDestination, readBodyBytes, readBodyText, readJsonBody, readJsonResponse, reportUnexpected, resultSchema, retryAfterSeconds, standardErrors, t };
|
|
1
|
+
import { $ as PageInfo, $t as defineContext, A as TransportContext, An as LimitVerdict, Ar as err, B as DeletedObject, Br as Failure, Bt as HandlerArguments, Cn as isPublicOperation, D as HttpRoute, Dn as SchemaKeywords, Dr as FailureResult, E as HttpOptions, En as operationScopes, Er as BodyFailure, Fn as UsageEvent, Ft as ContextDeclaration, G as NamedReference, Gr as standardErrors, Gt as PreparedContext, H as EmailAddressSchema, Hr as FailureSchema, Ht as HandlerHttp, In as UsageReceipt, Ir as DefinedErrors, It as DomainCode, J as PostalAddress, Jn as AdmissionObservation, Jt as SchemaOf, K as NamedReferenceSchema, Lr as ErrorCatalog, Lt as Fail, M as projectAccessToken, Mn as OperationMeter, Mr as ok, Mt as parseSchema, N as EmptyInputSchema, Nn as SpendVerdict, Nr as Attachment, Nt as AuthOptions, O as HttpTransport, Or as Result, P as OrganizationIdSchema, Pn as TokenUsage, Pr as AttachmentOutputSchema, Pt as ContextArguments, Q as Page, Qn as TelemetryConfig, Qt as defineAuth, R as UuidSchema, Rr as ErrorDefinition, Rt as Failed, Sr as protectedResourceMetadata, T as HttpMiddleware, Tn as operationMatchesScopes, Tr as BinaryBody, U as HexColorSchema, Ur as defineErrors, Ut as HandlerMcp, V as DeletedObjectSchema, Vr as FailureData, Vt as HandlerDeclaration, W as HttpsUrlSchema, Wr as resultSchema, Wt as HandlerOptions, X as SignedUrl, Xn as ExecutionObservation, Xt as ToolDeclaration, Y as PostalAddressSchema, Yn as BackgroundContext, Yt as SchemaOrFields, Z as SignedUrlSchema, Zn as Observer, Zt as ToolOptions, _ as readBodyText, _n as McpSkill, _r as Principal, a as t, an as ApplicationBuilder, ar as TokenAlgorithm, at as cursorKey, b as createHttpRouteResolver, bn as OperationScope, br as TokenPrincipal, c as isJsonMediaType, cr as TokenPolicy, d as retryAfterSeconds, dn as AppManifest, dr as TokenSource, en as defineHandler, et as PageInfoSchema, f as publicDestination, fn as Exposure, fr as createTokenAuthorization, g as readBodyBytes, gn as McpGuide, gr as matchesScopes, h as HttpBodyFailureReason, hn as McpConfiguration, hr as ScopeMatch, i as Type, ir as TokenAccess, it as TPage, j as createHttpHandler, jr as isResult, jt as parseInput, k as RouteContext, kn as BillingService, kr as Success, l as readJsonBody, lr as TokenResolutionContext, m as HttpBodyFailure, mn as InvocationAuthority, mr as projectToken, n as Static, nn as defineTool, nt as PageQuery, o as createOpenApi, on as ApplicationConfiguration, or as TokenClaims, ot as cutPage, p as BodyReadOptions, pn as Invocation, pr as createTokenVerifier, q as PhoneNumberSchema, qt as RouteBody, r as TSchema, rt as PageQueryFields, s as createRpcOpenApi, sn as maximus, sr as TokenDevelopment, st as pageLimit, tn as defineTelemetry, tr as reportUnexpected, tt as PageOrder, u as readJsonResponse, ur as TokenScheme, v as HttpRouteDefinition, vr as PrincipalSchema, xn as OperationShape, xr as OAuthResource, y as HttpRouteMatch, yn as OperationMiddleware, yr as TokenClient, zr as ErrorFactory, zt as HandlerAnswer } from "./chunks/types-AjJyXA62.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, 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 Result, 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, defineTelemetry, defineTool, err, isJsonMediaType, isPublicOperation, isResult, matchesScopes, maximus, ok, operationMatchesScopes, operationScopes, pageLimit, parseInput, parseSchema, projectAccessToken, projectToken, protectedResourceMetadata, publicDestination, readBodyBytes, readBodyText, readJsonBody, readJsonResponse, reportUnexpected, resultSchema, retryAfterSeconds, standardErrors, t };
|
package/dist/index.js
CHANGED
|
@@ -3,13 +3,13 @@ import { _ as cursorKey, b as AttachmentOutputSchema, c as HexColorSchema, d as
|
|
|
3
3
|
import { i as standardErrors, n as defineErrors, r as resultSchema, t as FailureSchema } from "./chunks/errors-BoutSmiy.js";
|
|
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
|
-
import { S as matchesScopes, b as operationScopes, m as isPublicOperation, v as operationMatchesScopes } from "./chunks/tasks-
|
|
7
|
-
import { a as projectToken, d as projectAccessToken, n as createTokenAuthorization, p as PrincipalSchema, r as createTokenVerifier } from "./chunks/tokens-
|
|
6
|
+
import { S as matchesScopes, b as operationScopes, m as isPublicOperation, v as operationMatchesScopes } from "./chunks/tasks-CD-B6_nv.js";
|
|
7
|
+
import { a as projectToken, d as projectAccessToken, n as createTokenAuthorization, p as PrincipalSchema, r as createTokenVerifier } from "./chunks/tokens-D6yVDtEU.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-CYk0Af0t.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-C2A4SxMi.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 { A as TransportContext,
|
|
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 OperationMiddleware, type OperationShape, type TelemetryConfig, type TransportContext, type VerifiedCaller, composeOperations, createHttpRouteResolver, defineApp, executeOperation, operation, operationScopes, recordCapture, recordExecution, telemetryEnabled, withDiagnostics };
|
|
1
|
+
import { A as TransportContext, E as HttpOptions, En as operationScopes, Gn as recordCapture, Kn as ExecutionCall, Ln as recordMeter, O as HttpTransport, Qn as TelemetryConfig, Sn as composeOperations, Un as CapturedCall, Wn as VerifiedCaller, Yn as BackgroundContext, b as createHttpRouteResolver, dn as AppManifest, er as recordExecution, jn as MeteredCall, mn as InvocationAuthority, nr as telemetryEnabled, pn as Invocation, qn as executeOperation, rr as withDiagnostics, t as defineApp, v as HttpRouteDefinition, wn as operation, xn as OperationShape, y as HttpRouteMatch, yn as OperationMiddleware, zn as CaptureConfig } from "./chunks/types-AjJyXA62.js";
|
|
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,7 +1,7 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import {
|
|
3
|
-
import { b as operationScopes, g as operation, p as composeOperations } from "./chunks/tasks-
|
|
1
|
+
import { n as executeOperation, r as recordCapture, t as recordMeter } from "./chunks/meter-B_WuFl_c.js";
|
|
2
|
+
import { n as defineApp } from "./chunks/define-app-BpSKvXET.js";
|
|
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
|
-
import {
|
|
5
|
+
import { t as createHttpRouteResolver } from "./chunks/http-paths-D043DkJv.js";
|
|
6
6
|
|
|
7
|
-
export { composeOperations, createHttpRouteResolver, defineApp, executeOperation, operation, operationScopes, recordCapture, recordExecution, telemetryEnabled, withDiagnostics };
|
|
7
|
+
export { composeOperations, createHttpRouteResolver, defineApp, executeOperation, operation, operationScopes, recordCapture, recordExecution, recordMeter, telemetryEnabled, withDiagnostics };
|
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-AjJyXA62.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-UtQtcegf.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 { Br as Failure, Or as Result, cn as TaskAccess, ln as TaskRecord } from "../chunks/types-AjJyXA62.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";
|
package/dist/mcp/tasks.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as mcpTask, i as isTaskResult, n as attachTasks, o as toolResult, r as declaresTasks, t as TASKS_EXTENSION } from "../chunks/tasks-
|
|
1
|
+
import { a as mcpTask, i as isTaskResult, n as attachTasks, o as toolResult, r as declaresTasks, t as TASKS_EXTENSION } from "../chunks/tasks-DELqUSq8.js";
|
|
2
2
|
|
|
3
3
|
export { TASKS_EXTENSION, attachTasks, declaresTasks, isTaskResult, mcpTask, toolResult };
|
package/dist/project/config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ft as ContextDeclaration, 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-
|
|
1
|
+
import { Ft as ContextDeclaration, Mn 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-AjJyXA62.js";
|
|
2
2
|
import { TSchema } from "typebox";
|
|
3
3
|
/** A route's HTTP method. */
|
|
4
4
|
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
@@ -73,9 +73,10 @@ export declare function bindRoute<E, C, I extends TSchema, O extends TSchema, X,
|
|
|
73
73
|
mcp: T & {
|
|
74
74
|
idempotent: boolean;
|
|
75
75
|
};
|
|
76
|
-
} : unknown) & Omit<OperationShape, "execute" | "input" | "output" | "pipeline" | keyof Exposure> & {
|
|
76
|
+
} : unknown) & Omit<OperationShape, "execute" | "input" | "meter" | "output" | "pipeline" | keyof Exposure> & {
|
|
77
77
|
input: I;
|
|
78
78
|
output: O;
|
|
79
|
+
meter?: OperationMeter<import("typebox").Static<O>, import("typebox").StaticDecode<I>, string> | undefined;
|
|
79
80
|
} & {
|
|
80
81
|
execute: OperationHandler<C, I, O, BoundRoute<X, M, P>>;
|
|
81
82
|
}>>;
|
|
@@ -89,9 +90,10 @@ export declare function bindTool<E, C, I extends TSchema, O extends TSchema, X,
|
|
|
89
90
|
idempotent: boolean;
|
|
90
91
|
openWorld?: boolean;
|
|
91
92
|
};
|
|
92
|
-
} & Omit<OperationShape, "execute" | "input" | "output" | "pipeline" | keyof Exposure> & {
|
|
93
|
+
} & Omit<OperationShape, "execute" | "input" | "meter" | "output" | "pipeline" | keyof Exposure> & {
|
|
93
94
|
input: I;
|
|
94
95
|
output: O;
|
|
96
|
+
meter?: OperationMeter<import("typebox").Static<O>, import("typebox").StaticDecode<I>, string> | undefined;
|
|
95
97
|
} & {
|
|
96
98
|
execute: OperationHandler<C, I, O, BoundTool<X, F>>;
|
|
97
99
|
}>>;
|
package/dist/project/config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as routeGroup } from "../chunks/http-routes-B6tCsnxB.js";
|
|
2
|
-
import { r as ok, t as err } from "../chunks/result-CF4OzG9O.js";
|
|
3
2
|
import { c as isHandlerDeclaration, l as isToolDeclaration, s as isContextDeclaration, t as Failed } from "../chunks/handler-DSpyrWc-.js";
|
|
3
|
+
import { r as ok, t as err } from "../chunks/result-CF4OzG9O.js";
|
|
4
4
|
import { n as routeTitle, t as routeName } from "../chunks/names-ncD7A3DV.js";
|
|
5
5
|
|
|
6
6
|
// src/project/bind.ts
|
package/dist/project/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as HttpRoute, dn as AppManifest, xn as OperationShape } from "../chunks/types-
|
|
2
|
-
import { n as WorkerOptions, r as WorkerRuntime } from "../chunks/workers-types-
|
|
1
|
+
import { D as HttpRoute, dn as AppManifest, xn as OperationShape } from "../chunks/types-AjJyXA62.js";
|
|
2
|
+
import { n as WorkerOptions, r as WorkerRuntime } from "../chunks/workers-types-B6F5WEuu.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. */
|
package/dist/project/index.js
CHANGED
|
@@ -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-
|
|
3
|
-
import { t as checkPagePaths } from "../chunks/pages-
|
|
2
|
+
import { r as createAssetHandler, t as createWorker } from "../chunks/runtime-DjCjXIdf.js";
|
|
3
|
+
import { t as checkPagePaths } from "../chunks/pages-B0xdWws9.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, 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,
|
|
1
|
+
import { $ as PageInfo, At as decodeSchema, B as DeletedObject, 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, Nr as Attachment, On as StaticDecode, Ot as InputIssue, P as OrganizationIdSchema, Pr as AttachmentOutputSchema, 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 } from "./chunks/types-AjJyXA62.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-
|
|
1
|
+
import { in as StandardFailure, rn as STANDARD_FAILURES } from "./chunks/types-AjJyXA62.js";
|
|
2
2
|
export { STANDARD_FAILURES, StandardFailure };
|
package/dist/tooling/cli.js
CHANGED
|
@@ -98,7 +98,7 @@ async function run() {
|
|
|
98
98
|
case "init": {
|
|
99
99
|
const [target] = rest;
|
|
100
100
|
if (!target) throw new TypeError("Use maximus init <new-directory> [--name <name>].");
|
|
101
|
-
const { scaffold } = await import("../chunks/scaffold-
|
|
101
|
+
const { scaffold } = await import("../chunks/scaffold-C16tbL7M.js");
|
|
102
102
|
const name = values.name ?? basename(resolve(target));
|
|
103
103
|
const created = scaffold(target, name, {
|
|
104
104
|
mcp: values.mcp,
|
|
@@ -139,7 +139,7 @@ async function run() {
|
|
|
139
139
|
return;
|
|
140
140
|
}
|
|
141
141
|
case "openapi": {
|
|
142
|
-
const { writeOpenApi } = await import("../chunks/openapi-file-
|
|
142
|
+
const { writeOpenApi } = await import("../chunks/openapi-file-DlBVI3lc.js");
|
|
143
143
|
const written = await writeOpenApi(rest[0] ?? ".", {
|
|
144
144
|
...values.out === void 0 ? {} : { out: values.out },
|
|
145
145
|
check: values.check
|
package/dist/vite/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ar as TokenAlgorithm, cr as TokenPolicy, sr as TokenDevelopment } from "../chunks/types-AjJyXA62.js";
|
|
2
2
|
import { WorkerConfig } from "cf/config";
|
|
3
3
|
import { Plugin } from "vite";
|
|
4
4
|
/** Where the Worker runs: `development` under `vp dev`, `production` in every build. */
|
|
@@ -93,6 +93,13 @@ interface MaximusOptions extends Omit<WorkerConfig, 'name' | 'entrypoint' | 'env
|
|
|
93
93
|
binding: string;
|
|
94
94
|
retryAfter?: number;
|
|
95
95
|
};
|
|
96
|
+
/**
|
|
97
|
+
* The billing service the routes that declare `meter` report to: the binding `env` gives its entrypoint,
|
|
98
|
+
* such as `{ binding: 'BILLING' }`, whose type `BillingService` names the facts it takes.
|
|
99
|
+
*/
|
|
100
|
+
meter?: {
|
|
101
|
+
binding: string;
|
|
102
|
+
};
|
|
96
103
|
/** The Worker's bindings, from `cf/config`'s `bindings`; the generated `Env` is inferred from them. */
|
|
97
104
|
env?: WorkerConfig['env'];
|
|
98
105
|
/** What a web app answers with besides its build: its response headers. */
|
|
@@ -118,6 +125,8 @@ interface CloudflareAccessOptions {
|
|
|
118
125
|
team: string;
|
|
119
126
|
/** The Access application's Application Audience (AUD) tag, from its overview in the dashboard. */
|
|
120
127
|
aud: string;
|
|
128
|
+
/** Allow MCP when Cloudflare Access serves Managed OAuth on this application. Off by default. */
|
|
129
|
+
managedOAuth?: boolean;
|
|
121
130
|
/**
|
|
122
131
|
* The organization every caller acts in. Leave it out to read each caller's from a claim, named as
|
|
123
132
|
* `claims.organization` beside the preset, such as `custom.org_id` for a custom OIDC claim.
|
|
@@ -147,7 +156,7 @@ export declare function auth0({ domain, audience, algorithms }: Auth0Options): T
|
|
|
147
156
|
* for a team that is not a team name, such as the team's domain, and an AUD tag that is not 64 lowercase
|
|
148
157
|
* hexadecimal characters.
|
|
149
158
|
*/
|
|
150
|
-
export declare function cloudflareAccess({ team, aud, organizationId, scopes }: CloudflareAccessOptions): TokenOptions;
|
|
159
|
+
export declare function cloudflareAccess({ team, aud, managedOAuth, organizationId, scopes }: CloudflareAccessOptions): TokenOptions;
|
|
151
160
|
/**
|
|
152
161
|
* Maximus in Vite+: prepares the project from its files before every build and source change, brings the
|
|
153
162
|
* Maximus lint and format presets, and builds, runs and deploys the Worker these options describe through
|