@arbol-ai/maximus 7.3.1 → 8.0.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/README.md +36 -38
- package/bin/maximus.js +4 -0
- package/config/oxfmt.mjs +1 -0
- package/config/oxlint.mjs +10 -0
- package/dist/analytics/analytics.d.ts +21 -9
- package/dist/analytics/analytics.js +19 -5
- package/dist/body.d.ts +1 -1
- package/dist/body.js +2 -2
- package/dist/chunks/agent-skills-Ef65jTf_.js +49 -0
- package/dist/chunks/agent-skills-m7y1EUch.js +3 -0
- package/dist/chunks/{body-6LichrQm.js → body-DOIHwIIl.js} +14 -7
- package/dist/chunks/{correlation-BEkcFFGT.js → correlation-4b23a-a4.js} +8 -5
- package/dist/chunks/define-app-CfVZBt7D.js +336 -0
- package/dist/chunks/errors-WfyKhiyk.js +131 -0
- package/dist/chunks/execution-CfZEx_JP.js +84 -0
- package/dist/chunks/generate-C-9FKW0o.js +197 -0
- package/dist/chunks/handler-DWTGoduQ.js +140 -0
- package/dist/chunks/http-layout-_h7xwgPC.js +128 -0
- package/dist/chunks/http-paths-DMBxwpp6.js +218 -0
- package/dist/chunks/{json-Bu4BLT25.js → json-B14evE6-.js} +21 -5
- package/dist/chunks/names-ncD7A3DV.js +280 -0
- package/dist/chunks/openapi-CV0KmJpS.js +1588 -0
- package/dist/chunks/openapi-file-OjSs9mRv.js +83 -0
- package/dist/chunks/pages-DyC0m8Zb.js +14 -0
- package/dist/chunks/prepare-configured-BmRJLg6J.js +3 -0
- package/dist/chunks/prepare-configured-Cithjf80.js +52 -0
- package/dist/chunks/project-files-C0OX7MQQ.js +130 -0
- package/dist/chunks/query-kind-CWKAXEME.js +40 -0
- package/dist/chunks/record-DQUDTpEA.js +10 -0
- package/dist/chunks/result-CKgZHrnj.js +56 -0
- package/dist/chunks/{runtime-BPnaa-NK.js → runtime-CVVf5hmp.js} +50 -25
- package/dist/chunks/scaffold-DGrcjR3h.js +3 -0
- package/dist/chunks/scaffold-DZD6dfoZ.js +138 -0
- package/dist/chunks/{schemas-CzTvbXb6.js → schemas-p_aRcMC1.js} +30 -14
- package/dist/chunks/server-CCc7fil4.js +410 -0
- package/dist/chunks/src--HZrH1U9.js +568 -0
- package/dist/chunks/standard-failures-CLjxS2ea.js +74 -0
- package/dist/chunks/{telemetry-BTwB68m5.js → telemetry-C3LfZcOB.js} +32 -11
- package/dist/chunks/{types-BWxDd3tY.d.ts → types-BQYB4Ads.d.ts} +998 -337
- package/dist/chunks/{validation-r-sgmsqb.js → validation-fTohBT6R.js} +69 -28
- package/dist/chunks/workers-types-iONp32T4.d.ts +143 -0
- package/dist/chunks/yaml-Dk2L24yQ.js +74 -0
- package/dist/diagnostics.d.ts +6 -4
- package/dist/diagnostics.js +2 -2
- package/dist/errors.d.ts +2 -2
- package/dist/errors.js +2 -125
- 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 +12 -10
- package/dist/internals.d.ts +1 -1
- package/dist/internals.js +5 -3
- package/dist/mcp/index.d.ts +3 -2
- package/dist/mcp/index.js +5 -387
- package/dist/postgres/index.d.ts +25 -8
- package/dist/postgres/index.js +17 -8
- package/dist/project/config.d.ts +139 -0
- package/dist/project/config.js +196 -0
- package/dist/project/index.d.ts +17 -4
- package/dist/project/index.js +44 -9
- package/dist/projection.d.ts +14 -13
- package/dist/projection.js +8 -32
- package/dist/schemas.d.ts +1 -1
- package/dist/schemas.js +2 -2
- package/dist/standard-failures.d.ts +2 -89
- package/dist/standard-failures.js +1 -72
- package/dist/tooling/cli.js +151 -107
- package/dist/tooling/testing.js +2 -2
- package/dist/vite/cloudflare-workers.js +25 -0
- package/dist/vite/index.d.ts +157 -0
- package/dist/vite/index.js +1477 -0
- package/dist/webhooks.d.ts +12 -10
- package/dist/webhooks.js +26 -12
- package/dist/workers/runtime.d.ts +1 -1
- package/dist/workers/runtime.js +1 -1
- package/package.json +30 -22
- package/skills/maximus/SKILL.md +165 -69
- package/skills/maximus/references/deploying.md +73 -0
- package/skills/maximus/references/errors-and-results.md +114 -55
- package/skills/maximus/references/project.md +202 -0
- package/skills/maximus/references/routes-and-tools.md +256 -0
- package/skills/maximus/references/testing.md +137 -50
- package/skills/maximus/references/transports.md +113 -100
- package/skills/maximus/references/writing-code.md +84 -0
- package/templates/mcp/mcp/instructions.md.template +2 -0
- package/templates/mcp/routes/v1/greeting.get.ts.template +12 -0
- package/templates/mcp/tests/mcp.test.ts.template +36 -0
- package/templates/project/.agents/skills/project/SKILL.md.template +21 -12
- package/templates/project/.github/workflows/ci.yml.template +4 -1
- package/templates/project/CLAUDE.md.template +41 -22
- package/templates/project/README.md.template +54 -47
- package/templates/project/middleware/10-response.ts.template +16 -0
- package/templates/project/package.json.template +16 -8
- package/templates/project/pages/index.ts.template +2 -4
- package/templates/project/routes/v1/greeting.get.ts.template +10 -0
- package/templates/project/routes/v1/greeting.post.ts.template +12 -0
- package/templates/project/tests/greeting.test.ts.template +45 -0
- package/templates/project/tsconfig.json.template +8 -5
- package/templates/project/vite.config.ts.template +15 -7
- package/templates/web/app/main.tsx.template +16 -0
- package/templates/web/app/root.tsx.template +17 -0
- package/templates/web/app/routes/index.tsx.template +9 -0
- package/templates/web/index.html.template +12 -0
- package/templates/web/package.json.template +12 -0
- package/templates/web/tsconfig.json.template +7 -0
- package/templates/web/vite.config.ts.template +22 -0
- package/dist/chunks/execution-B-yy4C7N.js +0 -691
- package/dist/chunks/prepare-project-zi106pWF.js +0 -146
- package/dist/chunks/record-DY-lX9w1.js +0 -34
- package/dist/chunks/src-DPSpGNnT.js +0 -1164
- package/dist/client/client.d.ts +0 -129
- package/dist/client/client.js +0 -321
- package/dist/tooling/vite.d.ts +0 -3
- package/dist/tooling/vite.js +0 -44
- package/skills/maximus/references/adding-an-operation.md +0 -179
- package/skills/maximus/references/building-a-service.md +0 -167
- package/skills/maximus/references/migration-from-v2.md +0 -62
- package/skills/maximus/references/migration-to-v5.md +0 -37
- package/skills/maximus/references/publishing-and-verification.md +0 -39
- package/templates/project/cloudflare.config.ts.template +0 -24
- package/templates/project/routes/v1/greeting.ts.template +0 -22
- package/templates/project/src/app.ts.template +0 -2
- package/templates/project/src/application.ts.template +0 -26
- package/templates/project/src/index.ts.template +0 -3
- package/templates/project/src/worker.ts.template +0 -6
- package/templates/service/.agents/skills/project/SKILL.md.template +0 -10
- package/templates/service/.github/workflows/ci.yml.template +0 -21
- package/templates/service/.gitignore.template +0 -9
- package/templates/service/CLAUDE.md.template +0 -5
- package/templates/service/README.md.template +0 -45
- package/templates/service/cloudflare.config.ts.template +0 -30
- package/templates/service/package.json.template +0 -36
- package/templates/service/src/app.ts.template +0 -30
- package/templates/service/src/index.ts.template +0 -13
- package/templates/service/tests/contract.test.ts.template +0 -12
- package/templates/service/tsconfig.json.template +0 -16
- package/templates/service/vite.config.ts.template +0 -13
- package/templates/service/vitest.config.ts.template +0 -10
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-DMBxwpp6.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 PageInfo, $n as Success, A as TransportContext, An as TokenAlgorithm, At as ContextArguments, B as DeletedObject, Bn as Principal, Bt as HandlerOptions, Cn as TelemetryConfig, D as HttpRoute, Dt as parseInput, E as HttpOptions, En as reportUnexpected, Fn as TokenScheme, Ft as HandlerAnswer, G as NamedReference, Gn as protectedResourceMetadata, Gt as ToolDeclaration, H as EmailAddressSchema, Hn as TokenClient, Ht as RouteBody, In as TokenSource, It as HandlerArguments, J as PostalAddress, Jt as defineContext, K as NamedReferenceSchema, Kn as ScopeMatch, Kt as ToolOptions, Ln as createTokenAuthorization, Lt as HandlerDeclaration, M as projectAccessToken, Mn as TokenDevelopment, Mt as DomainCode, N as EmptyInputSchema, Nn as TokenPolicy, Nt as Fail, O as HttpTransport, Ot as parseSchema, P as OrganizationIdSchema, Pn as TokenResolutionContext, Pt as Failed, Q as Page, Qn as Result, R as UuidSchema, Rn as createTokenVerifier, Rt as HandlerHttp, Sn as Observer, T as HttpMiddleware, U as HexColorSchema, Un as TokenPrincipal, Ut as SchemaOf, V as DeletedObjectSchema, Vn as PrincipalSchema, Vt as PreparedContext, W as HttpsUrlSchema, Wn as OAuthResource, Wt as SchemaOrFields, X as SignedUrl, Xn as BodyFailure, Xt as defineTelemetry, Y as PostalAddressSchema, Yn as BinaryBody, Yt as defineHandler, Z as SignedUrlSchema, Zn as FailureResult, Zt as defineTool, _ as readBodyText, _n as operationMatchesScopes, a as Type, an as Invocation, b as createHttpRouteResolver, bn as BackgroundContext, c as createRpcOpenApi, cn as McpGuide, cr as ErrorDefinition, d as readJsonResponse, dn as OperationMiddleware, dr as FailureData, en as ApplicationBuilder, er as err, et as PageInfoSchema, f as retryAfterSeconds, fn as OperationScope, fr as FailureSchema, g as readBodyBytes, h as HttpBodyFailureReason, hn as isPublicOperation, hr as standardErrors, i as TSchema, in as Exposure, ir as AttachmentOutputSchema, it as pageLimit, j as createHttpHandler, jn as TokenClaims, jt as ContextDeclaration, k as RouteContext, kn as TokenAccess, kt as AuthOptions, l as isJsonMediaType, ln as McpSkill, lr as ErrorFactory, m as HttpBodyFailure, mr as resultSchema, nn as maximus, nr as ok, nt as PageQueryFields, o as t, on as InvocationAuthority, or as DefinedErrors, p as BodyReadOptions, pn as OperationShape, pr as defineErrors, q as PhoneNumberSchema, qn as matchesScopes, qt as defineAuth, r as Static, rn as AppManifest, rr as Attachment, rt as TPage, s as createOpenApi, sn as McpConfiguration, sr as ErrorCatalog, tn as ApplicationConfiguration, tr as isResult, tt as PageQuery, u as readJsonBody, ur as Failure, v as HttpRouteDefinition, vn as operationScopes, xn as ExecutionObservation, y as HttpRouteMatch, yn as AdmissionObservation, zn as projectToken, zt as HandlerMcp } from "./chunks/types-BQYB4Ads.js";
|
|
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 PageQuery, PageQueryFields, PhoneNumberSchema, type PostalAddress, PostalAddressSchema, type PreparedContext, type Principal, PrincipalSchema, type Result, type RouteBody, type RouteContext, 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, defineAuth, defineContext, defineErrors, defineHandler, defineTelemetry, defineTool, err, isJsonMediaType, isPublicOperation, isResult, matchesScopes, maximus, ok, operationMatchesScopes, operationScopes, pageLimit, parseInput, parseSchema, projectAccessToken, projectToken, protectedResourceMetadata, readBodyBytes, readBodyText, readJsonBody, readJsonResponse, reportUnexpected, resultSchema, retryAfterSeconds, standardErrors, t };
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { i as parseSchema, r as parseInput } from "./chunks/validation-
|
|
2
|
-
import {
|
|
3
|
-
import { n as readBodyBytes, r as readBodyText } from "./chunks/body-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { d as
|
|
8
|
-
import { i as
|
|
9
|
-
import { a as
|
|
1
|
+
import { i as parseSchema, r as parseInput } from "./chunks/validation-fTohBT6R.js";
|
|
2
|
+
import { i as standardErrors, n as defineErrors, r as resultSchema, t as FailureSchema } from "./chunks/errors-WfyKhiyk.js";
|
|
3
|
+
import { n as readBodyBytes, r as readBodyText } from "./chunks/body-DOIHwIIl.js";
|
|
4
|
+
import { t as createHttpRouteResolver } from "./chunks/http-paths-DMBxwpp6.js";
|
|
5
|
+
import { n as isResult, r as ok, t as err } from "./chunks/result-CKgZHrnj.js";
|
|
6
|
+
import { E as isPublicOperation, N as matchesScopes, _ as projectAccessToken, a as createTokenVerifier, i as createTokenAuthorization, j as operationScopes, k as operationMatchesScopes, n as createRpcOpenApi, o as projectToken, t as createOpenApi, y as PrincipalSchema } from "./chunks/openapi-CV0KmJpS.js";
|
|
7
|
+
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-p_aRcMC1.js";
|
|
8
|
+
import { a as maximus, i as protectedResourceMetadata, n as t, r as createHttpHandler, t as Type } from "./chunks/src--HZrH1U9.js";
|
|
9
|
+
import { a as defineTelemetry, i as defineHandler, n as defineAuth, o as defineTool, r as defineContext } from "./chunks/handler-DWTGoduQ.js";
|
|
10
|
+
import { i as reportUnexpected } from "./chunks/telemetry-C3LfZcOB.js";
|
|
11
|
+
import { a as retryAfterSeconds, i as readJsonResponse, r as readJsonBody, t as isJsonMediaType } from "./chunks/json-B14evE6-.js";
|
|
10
12
|
|
|
11
|
-
export { AttachmentOutputSchema, DeletedObjectSchema, EmailAddressSchema, EmptyInputSchema, FailureSchema, HexColorSchema, HttpsUrlSchema, NamedReferenceSchema, OrganizationIdSchema, Page, PageInfoSchema, PageQueryFields, PhoneNumberSchema, PostalAddressSchema, PrincipalSchema, SignedUrlSchema, 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 };
|
|
13
|
+
export { AttachmentOutputSchema, DeletedObjectSchema, EmailAddressSchema, EmptyInputSchema, FailureSchema, HexColorSchema, HttpsUrlSchema, NamedReferenceSchema, OrganizationIdSchema, Page, PageInfoSchema, PageQueryFields, PhoneNumberSchema, PostalAddressSchema, PrincipalSchema, SignedUrlSchema, Type, UuidSchema, createHttpHandler, createHttpRouteResolver, createOpenApi, createRpcOpenApi, createTokenAuthorization, createTokenVerifier, defineAuth, defineContext, defineErrors, defineHandler, defineTelemetry, defineTool, err, isJsonMediaType, isPublicOperation, isResult, matchesScopes, maximus, ok, operationMatchesScopes, operationScopes, pageLimit, parseInput, parseSchema, projectAccessToken, projectToken, protectedResourceMetadata, readBodyBytes, readBodyText, readJsonBody, readJsonResponse, reportUnexpected, resultSchema, retryAfterSeconds, standardErrors, t };
|
package/dist/internals.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as TransportContext, Cn as TelemetryConfig, Dn as telemetryEnabled, E as HttpOptions, O as HttpTransport, On as withDiagnostics, Tn as recordExecution, an as Invocation, b as createHttpRouteResolver, bn as BackgroundContext, dn as OperationMiddleware, gn as operation, mn as composeOperations, n as executeOperation, on as InvocationAuthority, pn as OperationShape, rn as AppManifest, t as defineApp, v as HttpRouteDefinition, vn as operationScopes, y as HttpRouteMatch } from "./chunks/types-BQYB4Ads.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,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createHttpRouteResolver } from "./http-paths.js";
|
|
3
|
-
import {
|
|
1
|
+
import { n as defineApp } from "./chunks/define-app-CfVZBt7D.js";
|
|
2
|
+
import { t as createHttpRouteResolver } from "./chunks/http-paths-DMBxwpp6.js";
|
|
3
|
+
import { O as operation, T as composeOperations, j as operationScopes } from "./chunks/openapi-CV0KmJpS.js";
|
|
4
|
+
import { a as telemetryEnabled, o as withDiagnostics, r as recordExecution } from "./chunks/telemetry-C3LfZcOB.js";
|
|
5
|
+
import { t as executeOperation } from "./chunks/execution-CfZEx_JP.js";
|
|
4
6
|
|
|
5
7
|
export { composeOperations, createHttpRouteResolver, defineApp, executeOperation, operation, operationScopes, recordExecution, telemetryEnabled, withDiagnostics };
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { O as HttpTransport } from "../chunks/types-BQYB4Ads.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
|
|
5
5
|
* resources, guides as prompts and skills through the Skills extension. A caller needs `<namespace>:mcp:use`
|
|
6
|
-
* and sees only the tools its scopes admit.
|
|
6
|
+
* and sees only the tools its scopes and actor kind admit. Each message of a JSON-RPC batch passes the rate
|
|
7
|
+
* limit as a request of its own, and each call is held to its operation's body limit.
|
|
7
8
|
*/
|
|
8
9
|
export declare function mcp(options?: {
|
|
9
10
|
path?: string;
|