@arbol-ai/maximus 7.3.0 → 7.4.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/body.d.ts +1 -1
- package/dist/chunks/builder-BiXv7d2v.js +100 -0
- package/dist/chunks/{execution-B-yy4C7N.js → define-app-DvD_1jUE.js} +5 -71
- package/dist/chunks/errors-D7zG9kx9.js +126 -0
- package/dist/chunks/execution-kVUJPy1A.js +71 -0
- package/dist/chunks/http-paths-yKD6TSNJ.js +199 -0
- package/dist/chunks/prepare-project-CMyGSEtI.js +236 -0
- package/dist/chunks/prepare-project-MtS0-W_n.js +3 -0
- package/dist/chunks/{runtime-BPnaa-NK.js → runtime-DlqA7J38.js} +4 -3
- package/dist/chunks/{src-DPSpGNnT.js → src-N3oyx5QF.js} +31 -104
- package/dist/chunks/standard-failures-CLjxS2ea.js +74 -0
- package/dist/chunks/{types-BWxDd3tY.d.ts → types-DQdfRF3f.d.ts} +13 -4
- package/dist/client/client.d.ts +1 -1
- package/dist/client/client.js +2 -2
- package/dist/diagnostics.d.ts +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +1 -124
- package/dist/http-paths.d.ts +1 -1
- package/dist/http-paths.js +1 -197
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -4
- package/dist/internals.d.ts +1 -1
- package/dist/internals.js +3 -2
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +3 -3
- package/dist/project/config.d.ts +101 -0
- package/dist/project/config.js +80 -0
- package/dist/project/index.d.ts +1 -1
- package/dist/project/index.js +3 -3
- package/dist/schemas.d.ts +1 -1
- package/dist/standard-failures.js +1 -72
- package/dist/tooling/cli.js +10 -10
- package/dist/tooling/vite.d.ts +1 -1
- package/dist/tooling/vite.js +38 -25
- 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 +5 -1
- package/skills/maximus/SKILL.md +4 -5
- package/skills/maximus/references/building-a-service.md +8 -8
- package/skills/maximus/references/publishing-and-verification.md +14 -11
- package/templates/project/.agents/skills/project/SKILL.md.template +7 -7
- package/templates/project/CLAUDE.md.template +10 -7
- package/templates/project/README.md.template +9 -8
- package/templates/project/cloudflare.config.ts.template +1 -1
- package/templates/project/{src/application.ts.template → maximus.config.ts.template} +4 -10
- package/templates/project/middleware/10-response.ts.template +13 -0
- package/templates/project/package.json.template +4 -0
- package/templates/project/routes/v1/greeting.ts.template +33 -17
- package/templates/project/tsconfig.json.template +1 -0
- package/templates/service/README.md.template +1 -1
- package/dist/chunks/prepare-project-zi106pWF.js +0 -146
- package/templates/project/src/app.ts.template +0 -2
- package/templates/project/src/index.ts.template +0 -3
- package/templates/project/src/worker.ts.template +0 -6
package/dist/errors.js
CHANGED
|
@@ -1,127 +1,4 @@
|
|
|
1
|
-
import { STANDARD_FAILURES } from "./standard-failures.js";
|
|
2
|
-
import { i as parseSchema } from "./chunks/validation-r-sgmsqb.js";
|
|
3
1
|
import { r as isRequestId } from "./chunks/correlation-BEkcFFGT.js";
|
|
4
|
-
import {
|
|
5
|
-
import { Value } from "@sinclair/typebox/value";
|
|
6
|
-
|
|
7
|
-
// src/errors.ts
|
|
8
|
-
/**
|
|
9
|
-
* `@arbol-ai/maximus/errors`: error catalogs. `defineErrors` joins the standard failures and an
|
|
10
|
-
* application's own into one catalog whose factories build each failure and whose schema validates every
|
|
11
|
-
* failure an operation returns.
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* Every failure, whatever its code: the base each catalog's failures narrow. The OpenAPI document
|
|
15
|
-
* names it `Failure`, so every service's errors share one type.
|
|
16
|
-
*/
|
|
17
|
-
const FailureSchema = Type.Object({
|
|
18
|
-
code: Type.String({ description: "The failure code, stable across releases." }),
|
|
19
|
-
message: Type.String({ description: "What went wrong, for people; it never contains input values." }),
|
|
20
|
-
retryable: Type.Boolean({ description: "Whether repeating the same request may succeed." }),
|
|
21
|
-
data: Type.Object({}, { description: "Diagnostics the code declares; empty for most codes." })
|
|
22
|
-
}, {
|
|
23
|
-
$id: "Failure",
|
|
24
|
-
additionalProperties: false
|
|
25
|
-
});
|
|
26
|
-
/** The first field issues of a refused input: where, and what was expected. Never a value. */
|
|
27
|
-
const InputIssuesSchema = Type.Object({ issues: Type.Optional(Type.Array(Type.Object({
|
|
28
|
-
path: Type.String({
|
|
29
|
-
maxLength: 256,
|
|
30
|
-
description: "RFC 6901 JSON Pointer to the refused field; empty for the whole input."
|
|
31
|
-
}),
|
|
32
|
-
message: Type.String({ maxLength: 256 })
|
|
33
|
-
}, {
|
|
34
|
-
$id: "ValidationIssue",
|
|
35
|
-
additionalProperties: false
|
|
36
|
-
}), { maxItems: 10 })) }, { additionalProperties: false });
|
|
37
|
-
/** The standard failures as a catalog defines them; INVALID_INPUT carries its field issues. */
|
|
38
|
-
const STANDARD = {
|
|
39
|
-
...STANDARD_FAILURES,
|
|
40
|
-
invalidInput: {
|
|
41
|
-
...STANDARD_FAILURES.invalidInput,
|
|
42
|
-
dataSchema: InputIssuesSchema
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
/** One failure's schema, its `create()` and its `is()`, from its definition. */
|
|
46
|
-
function factory(definition) {
|
|
47
|
-
const dataSchema = definition.dataSchema ?? Type.Object({}, { additionalProperties: false });
|
|
48
|
-
const schema = Type.Object({
|
|
49
|
-
code: Type.Literal(definition.code),
|
|
50
|
-
message: Type.Literal(definition.message),
|
|
51
|
-
retryable: Type.Literal(definition.retryable ?? false),
|
|
52
|
-
data: dataSchema
|
|
53
|
-
}, { additionalProperties: false });
|
|
54
|
-
return {
|
|
55
|
-
schema,
|
|
56
|
-
create(...args) {
|
|
57
|
-
const data = parseSchema(dataSchema, args.at(0) ?? {});
|
|
58
|
-
return {
|
|
59
|
-
code: definition.code,
|
|
60
|
-
message: definition.message,
|
|
61
|
-
retryable: definition.retryable ?? false,
|
|
62
|
-
data
|
|
63
|
-
};
|
|
64
|
-
},
|
|
65
|
-
is(value) {
|
|
66
|
-
return Value.Check(schema, value);
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
/** The catalog's own members, which no failure may be named after. */
|
|
71
|
-
const CATALOG_MEMBERS = {
|
|
72
|
-
schema: true,
|
|
73
|
-
definitions: true,
|
|
74
|
-
status: true,
|
|
75
|
-
retryAfter: true,
|
|
76
|
-
validate: true
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* An error catalog: the standard failures and the application's own, each with a fixed code, status, message
|
|
80
|
-
* and retry semantics. `catalog.name.create(data?)` builds a failure; the application validates every failure
|
|
81
|
-
* an operation returns against the catalog.
|
|
82
|
-
*/
|
|
83
|
-
function defineErrors(domain) {
|
|
84
|
-
const own = domain;
|
|
85
|
-
if (Object.keys(own).some((name) => Object.hasOwn(STANDARD, name) || Object.hasOwn(CATALOG_MEMBERS, name))) throw new TypeError("Domain errors cannot replace framework errors or catalog members.");
|
|
86
|
-
const definitions = {
|
|
87
|
-
...STANDARD,
|
|
88
|
-
...own
|
|
89
|
-
};
|
|
90
|
-
const byCode = /* @__PURE__ */ new Map();
|
|
91
|
-
for (const definition of Object.values(definitions)) {
|
|
92
|
-
if (byCode.has(definition.code) || definition.status < 400 || definition.status > 599) throw new TypeError("Error definitions require unique codes and failure statuses.");
|
|
93
|
-
if ("dataSchema" in definition && definition.dataSchema && (definition.dataSchema.type !== "object" || definition.dataSchema.additionalProperties !== false)) throw new TypeError("Domain error data must be a strict object schema.");
|
|
94
|
-
byCode.set(definition.code, definition);
|
|
95
|
-
}
|
|
96
|
-
const factories = Object.fromEntries(Object.entries(definitions).map(([name, value]) => [name, factory(value)]));
|
|
97
|
-
const schema = Type.Union(Object.values(factories).map((value) => value.schema));
|
|
98
|
-
return Object.assign(factories, {
|
|
99
|
-
schema,
|
|
100
|
-
definitions,
|
|
101
|
-
status(code) {
|
|
102
|
-
return byCode.get(code)?.status ?? 500;
|
|
103
|
-
},
|
|
104
|
-
retryAfter(code) {
|
|
105
|
-
return byCode.get(code)?.retryAfter;
|
|
106
|
-
},
|
|
107
|
-
validate(error) {
|
|
108
|
-
return parseSchema(schema, error);
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* The catalog of the framework's own failures (`INVALID_INPUT`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, …).
|
|
114
|
-
*/
|
|
115
|
-
const standardErrors = defineErrors({});
|
|
116
|
-
/** The schema of a Result: `{ ok: true, value } | { ok: false, error }`. */
|
|
117
|
-
function resultSchema(value, error) {
|
|
118
|
-
return Type.Union([Type.Object({
|
|
119
|
-
ok: Type.Literal(true),
|
|
120
|
-
value
|
|
121
|
-
}, { additionalProperties: false }), Type.Object({
|
|
122
|
-
ok: Type.Literal(false),
|
|
123
|
-
error
|
|
124
|
-
}, { additionalProperties: false })]);
|
|
125
|
-
}
|
|
2
|
+
import { i as standardErrors, n as defineErrors, r as resultSchema, t as FailureSchema } from "./chunks/errors-D7zG9kx9.js";
|
|
126
3
|
|
|
127
4
|
export { FailureSchema, defineErrors, isRequestId, resultSchema, standardErrors };
|
package/dist/http-paths.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as HttpRouteDefinition, D as isInputHeaderName, E as decodePathParameter, O as isPathParameterValue, T as createHttpRouteResolver, k as operationPathParameters, w as HttpRouteMatch } from "./chunks/types-
|
|
1
|
+
import { C as HttpRouteDefinition, D as isInputHeaderName, E as decodePathParameter, O as isPathParameterValue, T as createHttpRouteResolver, k as operationPathParameters, w as HttpRouteMatch } from "./chunks/types-DQdfRF3f.js";
|
|
2
2
|
export { HttpRouteDefinition, HttpRouteMatch, createHttpRouteResolver, decodePathParameter, isInputHeaderName, isPathParameterValue, operationPathParameters };
|
package/dist/http-paths.js
CHANGED
|
@@ -1,199 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* `@arbol-ai/maximus/http-paths`: versioned route templates, path parameter decoding, and the router that
|
|
4
|
-
* matches a request to exactly one operation.
|
|
5
|
-
*/
|
|
6
|
-
/** A fixed path segment of a route template. */
|
|
7
|
-
const STATIC_SEGMENT = /^[a-zA-Z0-9_-]+$/;
|
|
8
|
-
/** A parameter segment of a route template, `{name}`, occupying the whole segment. */
|
|
9
|
-
const PARAMETER_SEGMENT = /^\{([a-zA-Z][a-zA-Z0-9_]*)\}$/;
|
|
10
|
-
/** Parameter names that would reach an object's prototype. */
|
|
11
|
-
const UNSAFE_PARAMETERS = /* @__PURE__ */ new Set([
|
|
12
|
-
"constructor",
|
|
13
|
-
"prototype",
|
|
14
|
-
"__proto__"
|
|
15
|
-
]);
|
|
16
|
-
/** Headers that carry authority or framing: never an operation's input metadata. */
|
|
17
|
-
const RESERVED_HEADERS = /* @__PURE__ */ new Set([
|
|
18
|
-
"authorization",
|
|
19
|
-
"cookie",
|
|
20
|
-
"host",
|
|
21
|
-
"content-length",
|
|
22
|
-
"content-encoding"
|
|
23
|
-
]);
|
|
24
|
-
/** Whether a byte operation may read one of its input fields from this header. */
|
|
25
|
-
function isInputHeaderName(header) {
|
|
26
|
-
return /^[A-Za-z0-9-]+$/u.test(header) && !RESERVED_HEADERS.has(header.toLowerCase());
|
|
27
|
-
}
|
|
28
|
-
/** Parse declared templates, never caller paths. Parameters occupy one complete path segment. */
|
|
29
|
-
function operationPathParameters(path) {
|
|
30
|
-
const segments = path.split("/");
|
|
31
|
-
if (segments[0] !== "" || !/^v[1-9][0-9]*$/.test(segments[1] ?? "") || segments.length < 3) throw new TypeError("Operations require a versioned path.");
|
|
32
|
-
const parameters = [];
|
|
33
|
-
for (const segment of segments.slice(2)) {
|
|
34
|
-
const parameter = PARAMETER_SEGMENT.exec(segment)?.[1];
|
|
35
|
-
if (parameter) {
|
|
36
|
-
if (UNSAFE_PARAMETERS.has(parameter) || parameters.includes(parameter)) throw new TypeError("Path parameter names must be unique and safe.");
|
|
37
|
-
parameters.push(parameter);
|
|
38
|
-
} else if (!STATIC_SEGMENT.test(segment)) throw new TypeError("Use fixed routes or complete {parameter} segments; empty and malformed segments are forbidden.");
|
|
39
|
-
}
|
|
40
|
-
return parameters;
|
|
41
|
-
}
|
|
42
|
-
/** A decoded item key stays in one segment; dot segments and controls cannot alter URL ownership. */
|
|
43
|
-
function decodePathParameter(segment) {
|
|
44
|
-
try {
|
|
45
|
-
const value = decodeURIComponent(segment);
|
|
46
|
-
return isPathParameterValue(value) ? value : null;
|
|
47
|
-
} catch {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
/** Item keys are nonempty strings that cannot change URL path ownership when encoded. */
|
|
52
|
-
function isPathParameterValue(value) {
|
|
53
|
-
if (typeof value !== "string" || value.length === 0 || value === "." || value === ".." || /[\\/]/.test(value)) return false;
|
|
54
|
-
for (const character of value) {
|
|
55
|
-
const code = character.charCodeAt(0);
|
|
56
|
-
if (code < 32 || code === 127) return false;
|
|
57
|
-
}
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
/** The methods an operation route may use. */
|
|
61
|
-
const HTTP_METHODS = /* @__PURE__ */ new Set([
|
|
62
|
-
"GET",
|
|
63
|
-
"POST",
|
|
64
|
-
"PUT",
|
|
65
|
-
"PATCH",
|
|
66
|
-
"DELETE"
|
|
67
|
-
]);
|
|
68
|
-
/**
|
|
69
|
-
* Exact routes use a Map. Template branches compile into deterministic states at construction:
|
|
70
|
-
* one transition per segment, including overlapping fixed prefixes, with no per-request route scan.
|
|
71
|
-
*/
|
|
72
|
-
function createHttpRouteResolver(definitions) {
|
|
73
|
-
const exact = /* @__PURE__ */ new Map();
|
|
74
|
-
const roots = /* @__PURE__ */ new Map();
|
|
75
|
-
let nextId = 0;
|
|
76
|
-
/** A new tree node with the next id. */
|
|
77
|
-
const branch = () => {
|
|
78
|
-
const node = {
|
|
79
|
-
id: nextId,
|
|
80
|
-
fixed: /* @__PURE__ */ new Map()
|
|
81
|
-
};
|
|
82
|
-
nextId += 1;
|
|
83
|
-
return node;
|
|
84
|
-
};
|
|
85
|
-
for (const definition of definitions) {
|
|
86
|
-
if (!definition.http) continue;
|
|
87
|
-
if (!HTTP_METHODS.has(definition.http.method)) throw new TypeError("Operation routes require a supported HTTP method.");
|
|
88
|
-
const names = operationPathParameters(definition.http.path);
|
|
89
|
-
const segments = definition.http.path.slice(1).split("/");
|
|
90
|
-
const route = {
|
|
91
|
-
definition,
|
|
92
|
-
parameters: segments.flatMap((segment, position) => {
|
|
93
|
-
const parameter = segment.startsWith("{") ? segment.slice(1, -1) : void 0;
|
|
94
|
-
return parameter ? [{
|
|
95
|
-
name: parameter,
|
|
96
|
-
position
|
|
97
|
-
}] : [];
|
|
98
|
-
})
|
|
99
|
-
};
|
|
100
|
-
if (names.length === 0) {
|
|
101
|
-
const key = `${definition.http.method} ${definition.http.path}`;
|
|
102
|
-
if (exact.has(key)) throw new TypeError("Duplicate operation route.");
|
|
103
|
-
exact.set(key, route);
|
|
104
|
-
continue;
|
|
105
|
-
}
|
|
106
|
-
let node = roots.get(definition.http.method);
|
|
107
|
-
if (!node) {
|
|
108
|
-
node = branch();
|
|
109
|
-
roots.set(definition.http.method, node);
|
|
110
|
-
}
|
|
111
|
-
for (const segment of segments) if (segment.startsWith("{")) {
|
|
112
|
-
node.parameter ??= branch();
|
|
113
|
-
node = node.parameter;
|
|
114
|
-
} else {
|
|
115
|
-
let child = node.fixed.get(segment);
|
|
116
|
-
if (!child) {
|
|
117
|
-
child = branch();
|
|
118
|
-
node.fixed.set(segment, child);
|
|
119
|
-
}
|
|
120
|
-
node = child;
|
|
121
|
-
}
|
|
122
|
-
if (node.route) throw new TypeError("Ambiguous operation path templates.");
|
|
123
|
-
node.route = route;
|
|
124
|
-
}
|
|
125
|
-
const states = /* @__PURE__ */ new Map();
|
|
126
|
-
/**
|
|
127
|
-
* The state for a set of tree nodes: their routes (at most one), and for each next segment the state of
|
|
128
|
-
* every node it can lead to, compiled once per set.
|
|
129
|
-
*/
|
|
130
|
-
function compile(nodes) {
|
|
131
|
-
const distinct = [...new Map(nodes.map((node) => [node.id, node])).values()];
|
|
132
|
-
const key = distinct.map((node) => node.id).toSorted((left, right) => left - right).join(",");
|
|
133
|
-
const known = states.get(key);
|
|
134
|
-
if (known) return known;
|
|
135
|
-
const routes = distinct.flatMap((node) => node.route ? [node.route] : []);
|
|
136
|
-
if (routes.length > 1) throw new TypeError("Ambiguous overlapping operation path templates.");
|
|
137
|
-
const state = {
|
|
138
|
-
fixed: /* @__PURE__ */ new Map(),
|
|
139
|
-
route: routes[0]
|
|
140
|
-
};
|
|
141
|
-
states.set(key, state);
|
|
142
|
-
const parameters = distinct.flatMap((node) => node.parameter ? [node.parameter] : []);
|
|
143
|
-
if (parameters.length > 0) state.parameter = compile(parameters);
|
|
144
|
-
const fixed = new Set(distinct.flatMap((node) => [...node.fixed.keys()]));
|
|
145
|
-
for (const segment of fixed) {
|
|
146
|
-
const children = distinct.flatMap((node) => {
|
|
147
|
-
const child = node.fixed.get(segment);
|
|
148
|
-
return child ? [child] : [];
|
|
149
|
-
});
|
|
150
|
-
state.fixed.set(segment, compile([...children, ...parameters]));
|
|
151
|
-
}
|
|
152
|
-
return state;
|
|
153
|
-
}
|
|
154
|
-
const templates = new Map([...roots].map(([method, root]) => [method, compile([root])]));
|
|
155
|
-
/**
|
|
156
|
-
* The route for a method and path: an exact route first, then one transition per segment through the
|
|
157
|
-
* compiled states.
|
|
158
|
-
*/
|
|
159
|
-
function findRoute(method, path) {
|
|
160
|
-
const fixed = exact.get(`${method} ${path}`);
|
|
161
|
-
if (fixed) return fixed;
|
|
162
|
-
if (!path.startsWith("/") || path.endsWith("/")) return null;
|
|
163
|
-
const segments = path.slice(1).split("/");
|
|
164
|
-
let state = templates.get(method);
|
|
165
|
-
for (const segment of segments) {
|
|
166
|
-
if (!segment || !state) return null;
|
|
167
|
-
state = state.fixed.get(segment) ?? state.parameter;
|
|
168
|
-
}
|
|
169
|
-
return state?.route ?? null;
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* The route a request reaches, with its path parameters decoded; null when none matches or a parameter
|
|
173
|
-
* value is unsafe.
|
|
174
|
-
*/
|
|
175
|
-
function match(method, path) {
|
|
176
|
-
const route = findRoute(method, path);
|
|
177
|
-
if (!route) return null;
|
|
178
|
-
const segments = path.slice(1).split("/");
|
|
179
|
-
const parameters = {};
|
|
180
|
-
for (const parameter of route.parameters) {
|
|
181
|
-
const value = decodePathParameter(segments[parameter.position] ?? "");
|
|
182
|
-
if (value === null) return null;
|
|
183
|
-
parameters[parameter.name] = value;
|
|
184
|
-
}
|
|
185
|
-
return {
|
|
186
|
-
definition: route.definition,
|
|
187
|
-
parameters
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
return {
|
|
191
|
-
match,
|
|
192
|
-
/** Used only at construction to prevent a transport from bypassing item-route authorization. */
|
|
193
|
-
ownsPath(path) {
|
|
194
|
-
return [...HTTP_METHODS].some((method) => findRoute(method, path) !== null);
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
}
|
|
1
|
+
import { a as operationPathParameters, i as isPathParameterValue, n as decodePathParameter, r as isInputHeaderName, t as createHttpRouteResolver } from "./chunks/http-paths-yKD6TSNJ.js";
|
|
198
2
|
|
|
199
3
|
export { createHttpRouteResolver, decodePathParameter, isInputHeaderName, isPathParameterValue, operationPathParameters };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
export { type AdmissionObservation, type AppManifest, type ApplicationBuilder, type ApplicationConfiguration, type Attachment, AttachmentOutputSchema, type BackgroundContext, type BinaryBody, type BodyReadOptions, type DefinedErrors, type DeletedObject, DeletedObjectSchema, EmailAddressSchema, EmptyInputSchema, type ErrorCatalog, type ErrorDefinition, type ErrorFactory, type ExecutionObservation, type Exposure, type Failure, type FailureData, type FailureResult, FailureSchema, HexColorSchema, type HttpBodyFailure, type HttpBodyFailureReason, 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 PageQuery, PageQueryFields, PhoneNumberSchema, type PostalAddress, PostalAddressSchema, type Principal, PrincipalSchema, type Result, type RouteContext, type ScopeMatch, type SignedUrl, SignedUrlSchema, type Static, type Success, type TPage, type TSchema, type TelemetryConfig, type TokenAlgorithm, type TokenClaims, type TokenClient, type TokenDevelopment, type TokenPolicy, type TokenPrincipal, type TokenResolutionContext, type TokenScheme, type TransportContext, Type, UuidSchema, createHttpHandler, createHttpRouteResolver, createOpenApi, createTokenAuthorization, createTokenVerifier, defineErrors, err, isJsonMediaType, isPublicOperation, isResult, matchesScopes, maximus, ok, operationMatchesScopes, operationScopes, pageLimit, parseInput, parseSchema, projectToken, protectedResourceMetadata, readBodyBytes, readBodyText, readJsonBody, readJsonResponse, reportUnexpected, resultSchema, retryAfterSeconds, standardErrors, t };
|
|
1
|
+
import { $ as PostalAddressSchema, $t as AdmissionObservation, A as HttpMiddleware, An as Success, Bn as FailureSchema, Bt as Invocation, C as HttpRouteDefinition, Cn as protectedResourceMetadata, Dn as BinaryBody, F as TransportContext, Fn as ErrorCatalog, G as DeletedObjectSchema, Gt as OperationMiddleware, H as UuidSchema, Hn as resultSchema, Ht as McpConfiguration, I as createHttpHandler, In as ErrorDefinition, J as HttpsUrlSchema, K as EmailAddressSchema, Kt as OperationScope, L as EmptyInputSchema, Ln as ErrorFactory, Lt as maximus, M as HttpRoute, Mn as isResult, Mt as parseSchema, N as HttpTransport, Nn as ok, Nt as ApplicationBuilder, On as FailureResult, P as RouteContext, Pn as DefinedErrors, Pt as ApplicationConfiguration, Q as PostalAddress, Qt as operationScopes, R as OrganizationIdSchema, Rn as Failure, Rt as AppManifest, S as readBodyText, Sn as OAuthResource, T as createHttpRouteResolver, Tn as matchesScopes, Un as standardErrors, Ut as McpGuide, Vn as defineErrors, Vt as InvocationAuthority, W as DeletedObject, Wt as McpSkill, X as NamedReferenceSchema, Xn as Attachment, Y as NamedReference, Yt as isPublicOperation, Z as PhoneNumberSchema, Zn as AttachmentOutputSchema, Zt as operationMatchesScopes, _ as retryAfterSeconds, _n as TokenResolutionContext, at as PageQuery, b as HttpBodyFailureReason, bn as createTokenVerifier, ct as pageLimit, d as Type, dn as TokenAlgorithm, en as BackgroundContext, et as SignedUrl, f as t, fn as TokenClaims, g as readJsonResponse, gn as TokenPrincipal, h as readJsonBody, hn as TokenPolicy, it as PageInfoSchema, j as HttpOptions, jn as err, jt as parseInput, kn as Result, l as Static, ln as Principal, m as isJsonMediaType, mn as TokenDevelopment, nn as Observer, nt as Page, on as reportUnexpected, ot as PageQueryFields, p as createOpenApi, pn as TokenClient, q as HexColorSchema, qt as OperationShape, rn as TelemetryConfig, rt as PageInfo, st as TPage, tn as ExecutionObservation, tt as SignedUrlSchema, u as TSchema, un as PrincipalSchema, v as BodyReadOptions, vn as TokenScheme, w as HttpRouteMatch, wn as ScopeMatch, x as readBodyBytes, xn as projectToken, y as HttpBodyFailure, yn as createTokenAuthorization, zn as FailureData, zt as Exposure } from "./chunks/types-DQdfRF3f.js";
|
|
2
|
+
export { type AdmissionObservation, type AppManifest, type ApplicationBuilder, type ApplicationConfiguration, type Attachment, AttachmentOutputSchema, type BackgroundContext, type BinaryBody, type BodyReadOptions, type DefinedErrors, type DeletedObject, DeletedObjectSchema, EmailAddressSchema, EmptyInputSchema, type ErrorCatalog, type ErrorDefinition, type ErrorFactory, type ExecutionObservation, type Exposure, type Failure, type FailureData, type FailureResult, FailureSchema, 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 PageQuery, PageQueryFields, PhoneNumberSchema, type PostalAddress, PostalAddressSchema, type Principal, PrincipalSchema, type Result, type RouteContext, type ScopeMatch, type SignedUrl, SignedUrlSchema, type Static, type Success, type TPage, type TSchema, type TelemetryConfig, type TokenAlgorithm, type TokenClaims, type TokenClient, type TokenDevelopment, type TokenPolicy, type TokenPrincipal, type TokenResolutionContext, type TokenScheme, type TransportContext, Type, UuidSchema, createHttpHandler, createHttpRouteResolver, createOpenApi, createTokenAuthorization, createTokenVerifier, defineErrors, err, isJsonMediaType, isPublicOperation, isResult, matchesScopes, maximus, ok, operationMatchesScopes, operationScopes, pageLimit, parseInput, parseSchema, projectToken, protectedResourceMetadata, readBodyBytes, readBodyText, readJsonBody, readJsonResponse, reportUnexpected, resultSchema, retryAfterSeconds, standardErrors, t };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { i as parseSchema, r as parseInput } from "./chunks/validation-r-sgmsqb.js";
|
|
2
|
-
import {
|
|
2
|
+
import { i as standardErrors, n as defineErrors, r as resultSchema, t as FailureSchema } from "./chunks/errors-D7zG9kx9.js";
|
|
3
3
|
import { n as readBodyBytes, r as readBodyText } from "./chunks/body-6LichrQm.js";
|
|
4
|
-
import {
|
|
5
|
-
import { createHttpRouteResolver } from "./http-paths.js";
|
|
4
|
+
import { S as operationMatchesScopes, T as matchesScopes, a as projectToken, d as isResult, f as ok, i as createTokenVerifier, n as PrincipalSchema, r as createTokenAuthorization, u as err, v as isPublicOperation, w as operationScopes } from "./chunks/define-app-DvD_1jUE.js";
|
|
5
|
+
import { t as createHttpRouteResolver } from "./chunks/http-paths-yKD6TSNJ.js";
|
|
6
6
|
import { _ as pageLimit, c as HexColorSchema, d as PhoneNumberSchema, f as PostalAddressSchema, g as PageQueryFields, h as PageInfoSchema, i as UuidSchema, l as HttpsUrlSchema, m as Page, n as OrganizationIdSchema, o as DeletedObjectSchema, p as SignedUrlSchema, s as EmailAddressSchema, t as EmptyInputSchema, u as NamedReferenceSchema, v as AttachmentOutputSchema } from "./chunks/schemas-CzTvbXb6.js";
|
|
7
|
-
import {
|
|
7
|
+
import { t as maximus } from "./chunks/builder-BiXv7d2v.js";
|
|
8
|
+
import { i as createOpenApi, n as t, r as createHttpHandler, t as Type, u as protectedResourceMetadata } from "./chunks/src-N3oyx5QF.js";
|
|
8
9
|
import { i as reportUnexpected } from "./chunks/telemetry-BTwB68m5.js";
|
|
9
10
|
import { a as retryAfterSeconds, i as readJsonResponse, r as readJsonBody, t as isJsonMediaType } from "./chunks/json-Bu4BLT25.js";
|
|
10
11
|
|
package/dist/internals.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bt as Invocation, C as HttpRouteDefinition, F as TransportContext, Gt as OperationMiddleware, Jt as composeOperations, N as HttpTransport, Qt as operationScopes, Rt as AppManifest, T as createHttpRouteResolver, Vt as InvocationAuthority, Xt as operation, an as recordExecution, c as executeOperation, cn as withDiagnostics, en as BackgroundContext, j as HttpOptions, qt as OperationShape, rn as TelemetryConfig, s as defineApp, sn as telemetryEnabled, w as HttpRouteMatch } from "./chunks/types-DQdfRF3f.js";
|
|
2
2
|
export { type AppManifest, type BackgroundContext, type HttpOptions, type HttpRouteDefinition, type HttpRouteMatch, type HttpTransport, type Invocation, type InvocationAuthority, type OperationMiddleware, type OperationShape, type TelemetryConfig, type TransportContext, composeOperations, createHttpRouteResolver, defineApp, executeOperation, operation, operationScopes, recordExecution, telemetryEnabled, withDiagnostics };
|
package/dist/internals.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createHttpRouteResolver } from "./http-paths.js";
|
|
1
|
+
import { _ as composeOperations, b as operation, t as defineApp, w as operationScopes } from "./chunks/define-app-DvD_1jUE.js";
|
|
2
|
+
import { t as createHttpRouteResolver } from "./chunks/http-paths-yKD6TSNJ.js";
|
|
3
3
|
import { a as telemetryEnabled, o as withDiagnostics, r as recordExecution } from "./chunks/telemetry-BTwB68m5.js";
|
|
4
|
+
import { t as executeOperation } from "./chunks/execution-kVUJPy1A.js";
|
|
4
5
|
|
|
5
6
|
export { composeOperations, createHttpRouteResolver, defineApp, executeOperation, operation, operationScopes, recordExecution, telemetryEnabled, withDiagnostics };
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { N as HttpTransport } from "../chunks/types-DQdfRF3f.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
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { standardErrors } from "../errors.js";
|
|
2
|
-
import {
|
|
3
|
-
import { a as canonical, o as standaloneSchema } from "../chunks/src-
|
|
1
|
+
import { i as standardErrors } from "../chunks/errors-D7zG9kx9.js";
|
|
2
|
+
import { S as operationMatchesScopes, h as MAX_BODY_BYTES_CEILING, p as sha256Hex, y as mcpOpenWorld } from "../chunks/define-app-DvD_1jUE.js";
|
|
3
|
+
import { a as canonical, o as standaloneSchema } from "../chunks/src-N3oyx5QF.js";
|
|
4
4
|
import { i as reportUnexpected } from "../chunks/telemetry-BTwB68m5.js";
|
|
5
5
|
import { Type } from "@sinclair/typebox";
|
|
6
6
|
import { Value } from "@sinclair/typebox/value";
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { A as HttpMiddleware, Bt as Invocation, Dn as BinaryBody, En as StaticDecode$1, Ft as KnownOperationFields, Gt as OperationMiddleware, It as OperationFields, Nt as ApplicationBuilder, Pt as ApplicationConfiguration, Rn as Failure, Rt as AppManifest, kn as Result, n as WorkerOptions, qt as OperationShape, zn as FailureData, zt as Exposure } from "../chunks/types-DQdfRF3f.js";
|
|
2
|
+
import { Static, TSchema } from "@sinclair/typebox";
|
|
3
|
+
type RouteExposure = Omit<Exposure, 'http'> & {
|
|
4
|
+
http?: Omit<NonNullable<Exposure['http']>, 'method' | 'path'>;
|
|
5
|
+
};
|
|
6
|
+
type Definition<I extends TSchema, O extends TSchema, X extends RouteExposure> = X & OperationFields<I, O>;
|
|
7
|
+
type KnownRouteFields<X> = KnownOperationFields<X> & (X extends {
|
|
8
|
+
http: infer H;
|
|
9
|
+
} ? {
|
|
10
|
+
http: H & Readonly<Record<Exclude<keyof H, keyof NonNullable<RouteExposure['http']>>, never>>;
|
|
11
|
+
} : unknown);
|
|
12
|
+
/** Bind named method declarations to one shared, fully inferred application context. */
|
|
13
|
+
export declare function createRoute<E, C>(base: ApplicationBuilder<E, C, Record<never, never>>): <const N extends string, I extends TSchema, O extends TSchema, const X extends RouteExposure>(name: N, definition: Definition<I, O, X> & KnownRouteFields<X>, execute: (context: C & (X extends {
|
|
14
|
+
http: {
|
|
15
|
+
body: 'bytes';
|
|
16
|
+
};
|
|
17
|
+
} ? {
|
|
18
|
+
body: BinaryBody;
|
|
19
|
+
} : object), input: StaticDecode$1<I>) => Promise<Result<Static<O>, Failure>>) => <const P extends string, const M extends NonNullable<Exposure['http']>['method']>(path: P, method: M) => ApplicationBuilder<E, C, Record<never, never> & Record<N, X & {
|
|
20
|
+
http: (X extends {
|
|
21
|
+
http: infer H;
|
|
22
|
+
} ? H : object) & {
|
|
23
|
+
path: P;
|
|
24
|
+
method: M;
|
|
25
|
+
};
|
|
26
|
+
} & Omit<OperationShape, "execute" | "input" | "output" | "pipeline" | keyof Exposure> & {
|
|
27
|
+
input: I;
|
|
28
|
+
output: O;
|
|
29
|
+
} & {
|
|
30
|
+
execute: (context: C & (X & {
|
|
31
|
+
http: (X extends {
|
|
32
|
+
http: infer H;
|
|
33
|
+
} ? H : object) & {
|
|
34
|
+
path: P;
|
|
35
|
+
method: M;
|
|
36
|
+
};
|
|
37
|
+
} extends (infer T) ? T extends X & {
|
|
38
|
+
http: (X extends {
|
|
39
|
+
http: infer H;
|
|
40
|
+
} ? H : object) & {
|
|
41
|
+
path: P;
|
|
42
|
+
method: M;
|
|
43
|
+
};
|
|
44
|
+
} ? T extends {
|
|
45
|
+
http: {
|
|
46
|
+
body: 'bytes';
|
|
47
|
+
};
|
|
48
|
+
} ? {
|
|
49
|
+
body: BinaryBody;
|
|
50
|
+
} : object : never : never), input: StaticDecode$1<I>) => Promise<Result<(O & {
|
|
51
|
+
params: [];
|
|
52
|
+
})["static"], Failure<FailureData>>>;
|
|
53
|
+
}>>;
|
|
54
|
+
/** Configuration owns the shared builder and transport policy, never discovered application modules. */
|
|
55
|
+
export interface ProjectConfiguration<E, C> {
|
|
56
|
+
application: ApplicationBuilder<E, C, Record<never, never>>;
|
|
57
|
+
worker: WorkerOptions<E>;
|
|
58
|
+
}
|
|
59
|
+
/** A simple application configuration needs no hand-written builder or Worker entry. */
|
|
60
|
+
export declare function defineConfig<E>(configuration: ApplicationConfiguration<E> & {
|
|
61
|
+
worker?: WorkerOptions<E>;
|
|
62
|
+
}): ProjectConfiguration<E, Invocation<E>>;
|
|
63
|
+
/** An existing fluent base retains its derived context and middleware. */
|
|
64
|
+
export declare function defineConfig<E, C>(configuration: {
|
|
65
|
+
application: ApplicationBuilder<E, C, Record<never, never>>;
|
|
66
|
+
worker?: WorkerOptions<E>;
|
|
67
|
+
}): ProjectConfiguration<E, C>;
|
|
68
|
+
/** Request middleware has no principal; authentication belongs to the native transport continuation. */
|
|
69
|
+
export interface RequestMiddlewareModule<E> {
|
|
70
|
+
readonly phase: 'request';
|
|
71
|
+
readonly handle: HttpMiddleware<E>;
|
|
72
|
+
}
|
|
73
|
+
/** Declare a global HTTP wrapper in middleware/, ordered by filename. */
|
|
74
|
+
export declare function defineMiddleware<E>(handle: HttpMiddleware<E>): RequestMiddlewareModule<E>;
|
|
75
|
+
/** Post-admission middleware runs on HTTP, MCP and RPC and may inspect verified invocation context. */
|
|
76
|
+
export interface OperationMiddlewareModule<C> {
|
|
77
|
+
readonly phase: 'operation';
|
|
78
|
+
readonly handle: OperationMiddleware<C>;
|
|
79
|
+
}
|
|
80
|
+
/** Use this phase for business policy that must apply to every operation transport. */
|
|
81
|
+
export declare function defineOperationMiddleware<C>(handle: OperationMiddleware<C>): OperationMiddlewareModule<C>;
|
|
82
|
+
/** Legacy bare functions retain their post-admission meaning. */
|
|
83
|
+
export type ProjectMiddleware<E, C> = OperationMiddleware<C> | OperationMiddlewareModule<C> | RequestMiddlewareModule<E>;
|
|
84
|
+
type OperationHandle<M> = M extends OperationMiddlewareModule<infer C> ? OperationMiddleware<C> : M extends OperationMiddleware<never> ? M : never;
|
|
85
|
+
type RequestHandle<M> = M extends RequestMiddlewareModule<infer E> ? HttpMiddleware<E> : never;
|
|
86
|
+
/** Split phases, retaining every module's context type rather than widening legacy middleware. */
|
|
87
|
+
export declare function collectMiddleware<const Modules extends readonly ProjectMiddleware<never, never>[]>(modules: Modules): {
|
|
88
|
+
middleware: OperationHandle<Modules[number]>[];
|
|
89
|
+
requestMiddleware: RequestHandle<Modules[number]>[];
|
|
90
|
+
};
|
|
91
|
+
/** Apply discovered policy before route factories capture the base's native execution pipeline. */
|
|
92
|
+
export declare function useProjectMiddleware<E, C>(base: ApplicationBuilder<E, C, Record<never, never>>, middleware: readonly OperationMiddleware<C>[]): ApplicationBuilder<E, C, Record<never, never>>;
|
|
93
|
+
/** Typed invocation of a project, available to middleware through a type-only configuration import. */
|
|
94
|
+
export type ProjectContext<T> = T extends ProjectConfiguration<infer _E, infer C> ? C : T extends ApplicationBuilder<infer _E, infer C, infer _O> ? C : never;
|
|
95
|
+
/** Bindings inferred from the project's configuration. */
|
|
96
|
+
export type ProjectEnv<T> = T extends ProjectConfiguration<infer E, infer _C> ? E : T extends ApplicationBuilder<infer E, infer _C, infer _O> ? E : never;
|
|
97
|
+
/** Refuse a route factory that captured an earlier base and silently omitted discovered policy. */
|
|
98
|
+
export declare function checkProjectPipeline<E, C, BC, O extends Record<string, OperationShape>>(base: ApplicationBuilder<E, BC, Record<never, never>>, app: AppManifest<E, C, O>): AppManifest<E, C, O>;
|
|
99
|
+
/** Explicit request-phase spelling; defineMiddleware remains the concise file-convention helper. */
|
|
100
|
+
export declare const defineRequestMiddleware: typeof defineMiddleware;
|
|
101
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { t as maximus } from "../chunks/builder-BiXv7d2v.js";
|
|
2
|
+
|
|
3
|
+
// src/project/route.ts
|
|
4
|
+
/** Bind named method declarations to one shared, fully inferred application context. */
|
|
5
|
+
function createRoute(base) {
|
|
6
|
+
return function defineRoute(name, definition, execute) {
|
|
7
|
+
if (definition.http && ("method" in definition.http || "path" in definition.http)) throw new TypeError("The route filename and method export own http.path and http.method.");
|
|
8
|
+
return (path, method) => {
|
|
9
|
+
const bound = {
|
|
10
|
+
...definition,
|
|
11
|
+
http: {
|
|
12
|
+
...definition.http,
|
|
13
|
+
path,
|
|
14
|
+
method
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
return base.operation(name, bound, (context, input) => execute(context, input));
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// src/project/config.ts
|
|
23
|
+
/** Runtime-neutral project configuration. Importing it never loads workerd or build tooling. */
|
|
24
|
+
function defineConfig(configuration) {
|
|
25
|
+
if ("application" in configuration) {
|
|
26
|
+
if (Object.keys(configuration.application.definition.operations).length) throw new TypeError("Project configuration accepts a base before operations are declared.");
|
|
27
|
+
return {
|
|
28
|
+
application: configuration.application,
|
|
29
|
+
worker: configuration.worker ?? {}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const { worker = {}, ...application } = configuration;
|
|
33
|
+
return {
|
|
34
|
+
application: maximus(application),
|
|
35
|
+
worker
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/** Declare a global HTTP wrapper in middleware/, ordered by filename. */
|
|
39
|
+
function defineMiddleware(handle) {
|
|
40
|
+
return {
|
|
41
|
+
phase: "request",
|
|
42
|
+
handle
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/** Use this phase for business policy that must apply to every operation transport. */
|
|
46
|
+
function defineOperationMiddleware(handle) {
|
|
47
|
+
return {
|
|
48
|
+
phase: "operation",
|
|
49
|
+
handle
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/** Split phases, retaining every module's context type rather than widening legacy middleware. */
|
|
53
|
+
function collectMiddleware(modules) {
|
|
54
|
+
const middleware = [];
|
|
55
|
+
const requestMiddleware = [];
|
|
56
|
+
for (const module of modules) if (typeof module === "function") middleware.push(module);
|
|
57
|
+
else if (module.phase === "operation" && typeof module.handle === "function") middleware.push(module.handle);
|
|
58
|
+
else if (module.phase === "request" && typeof module.handle === "function") requestMiddleware.push(module.handle);
|
|
59
|
+
else throw new TypeError("A middleware module must use defineMiddleware or defineOperationMiddleware.");
|
|
60
|
+
return {
|
|
61
|
+
middleware,
|
|
62
|
+
requestMiddleware
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/** Apply discovered policy before route factories capture the base's native execution pipeline. */
|
|
66
|
+
function useProjectMiddleware(base, middleware) {
|
|
67
|
+
let application = base;
|
|
68
|
+
for (const handler of middleware) application = application.use(handler);
|
|
69
|
+
return application;
|
|
70
|
+
}
|
|
71
|
+
/** Refuse a route factory that captured an earlier base and silently omitted discovered policy. */
|
|
72
|
+
function checkProjectPipeline(base, app) {
|
|
73
|
+
const expected = base.definition.middleware ?? [];
|
|
74
|
+
for (const [name, operation] of Object.entries(app.operations)) if (expected.some((handler, index) => operation.pipeline?.middleware[index] !== handler)) throw new TypeError(`Operation "${name}" omits project middleware. Derive its factory from .maximus/base or .maximus/routes.`);
|
|
75
|
+
return app;
|
|
76
|
+
}
|
|
77
|
+
/** Explicit request-phase spelling; defineMiddleware remains the concise file-convention helper. */
|
|
78
|
+
const defineRequestMiddleware = defineMiddleware;
|
|
79
|
+
|
|
80
|
+
export { checkProjectPipeline, collectMiddleware, createRoute, defineConfig, defineMiddleware, defineOperationMiddleware, defineRequestMiddleware, useProjectMiddleware };
|
package/dist/project/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { M as HttpRoute, Rt as AppManifest, n as WorkerOptions, qt as OperationShape, r as WorkerRuntime } from "../chunks/types-DQdfRF3f.js";
|
|
2
2
|
/** File modules use native Workers handlers; unmatched events fail instead of disappearing. */
|
|
3
3
|
type Handlers<E> = Omit<ExportedHandler<E>, 'fetch'>;
|
|
4
4
|
/** 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
|
-
import { standardErrors } from "../errors.js";
|
|
2
|
-
import { c as nativePaths, l as ownsPrefix, s as VERSIONED_PATH } from "../chunks/src-
|
|
3
|
-
import { r as createAssetHandler, t as createWorker } from "../chunks/runtime-
|
|
1
|
+
import { i as standardErrors } from "../chunks/errors-D7zG9kx9.js";
|
|
2
|
+
import { c as nativePaths, l as ownsPrefix, s as VERSIONED_PATH } from "../chunks/src-N3oyx5QF.js";
|
|
3
|
+
import { r as createAssetHandler, t as createWorker } from "../chunks/runtime-DlqA7J38.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
|
|
1
|
+
import { $ as PostalAddressSchema, At as decodeSchema, B as TSchema, Ct as refineSchema, Dt as urlSchema, En as StaticDecode, Et as transformSchema, G as DeletedObjectSchema, H as UuidSchema, J as HttpsUrlSchema, K as EmailAddressSchema, L as EmptyInputSchema, Mt as parseSchema, Ot as InputIssue, Q as PostalAddress, R as OrganizationIdSchema, St as pipeSchema, Tt as stripObject, U as t, V as Type, W as DeletedObject, X as NamedReferenceSchema, Xn as Attachment, Y as NamedReference, Z as PhoneNumberSchema, Zn as AttachmentOutputSchema, _t as inputSchema, at as PageQuery, bt as looseObject, ct as pageLimit, dt as readSchema, et as SignedUrl, ft as SchemaInput, gt as extendObject, ht as defaultSchema, it as PageInfoSchema, jt as parseInput, kt as decodeInput, lt as Checked, mt as SchemaValidationError, nt as Page, ot as PageQueryFields, pt as SchemaIssue, q as HexColorSchema, rt as PageInfo, st as TPage, tt as SignedUrlSchema, ut as checkSchema, vt as inspectSchema, wt as strictObject, xt as normalizeSchema, yt as literalUnion, z as Static } from "./chunks/types-DQdfRF3f.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 PageQuery, PageQueryFields, PhoneNumberSchema, type PostalAddress, PostalAddressSchema, type SchemaInput, type SchemaIssue, SchemaValidationError, type SignedUrl, SignedUrlSchema, type Static, type StaticDecode, type TPage, type TSchema, Type, UuidSchema, checkSchema, decodeInput, decodeSchema, defaultSchema, extendObject, inputSchema, inspectSchema, literalUnion, looseObject, normalizeSchema, pageLimit, parseInput, parseSchema, pipeSchema, readSchema, refineSchema, strictObject, stripObject, t, transformSchema, urlSchema };
|