@arbol-ai/maximus 8.4.0 → 8.5.1
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/body.js +2 -1
- package/dist/chunks/{define-app-CQpWqqqE.js → define-app-CvTei9a8.js} +8 -5
- package/dist/chunks/destination-5xTX0b7E.js +65 -0
- package/dist/chunks/{execution-Bpq6s4nA.js → execution-BJGx5Kxb.js} +1 -1
- package/dist/chunks/{http-layout-BcYH4I2w.js → http-layout-pnmGxDOY.js} +1 -1
- package/dist/chunks/{destination-DIkn8W6K.js → json-B14evE6-.js} +1 -65
- package/dist/chunks/openapi-CoKhMm1C.js +792 -0
- package/dist/chunks/{openapi-file-BK8zET5U.js → openapi-file-Crm9fT4U.js} +1 -1
- package/dist/chunks/{pages-B7ysoFAM.js → pages-D0zdaO0w.js} +1 -1
- package/dist/chunks/{runtime-CGtS2rOb.js → runtime-CUhyce4d.js} +3 -3
- package/dist/chunks/{server-CVhTLNj2.js → server-tygU8dw_.js} +1 -1
- package/dist/chunks/{src-D67OfW9B.js → src-DfMzoKE_.js} +6 -5
- package/dist/chunks/{openapi-D2rds7vy.js → tokens-D4gRyyPu.js} +205 -991
- package/dist/client.d.ts +92 -0
- package/dist/client.js +300 -0
- package/dist/index.js +5 -3
- package/dist/internals.js +2 -2
- package/dist/mcp/index.js +1 -1
- package/dist/project/index.js +2 -2
- package/dist/tooling/cli.js +1 -1
- package/dist/vite/index.js +3 -3
- package/dist/workers/runtime.js +1 -1
- package/package.json +5 -1
package/dist/body.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { n as readBodyBytes, r as readBodyText } from "./chunks/body-DOIHwIIl.js";
|
|
2
|
-
import { a as
|
|
2
|
+
import { a as retryAfterSeconds, i as readJsonResponse, r as readJsonBody, t as isJsonMediaType } from "./chunks/json-B14evE6-.js";
|
|
3
|
+
import { t as publicDestination } from "./chunks/destination-5xTX0b7E.js";
|
|
3
4
|
|
|
4
5
|
export { isJsonMediaType, publicDestination, readBodyBytes, readBodyText, readJsonBody, readJsonResponse, retryAfterSeconds };
|
|
@@ -4,7 +4,7 @@ import { n as readBodyBytes } from "./body-DOIHwIIl.js";
|
|
|
4
4
|
import { a as operationPathParameters, r as isInputHeaderName, t as createHttpRouteResolver } from "./http-paths-D043DkJv.js";
|
|
5
5
|
import { t as pathParameterSchemas } from "./http-routes-B6tCsnxB.js";
|
|
6
6
|
import { b as operationScopes, d as MAX_BODY_BYTES_CEILING, f as STANDARD_CODES, t as MAX_TASK_TTL_MS, x as isNamespacedScope } from "./tasks-DYdY-dBI.js";
|
|
7
|
-
import {
|
|
7
|
+
import { g as hasSchemaReferences, m as bundleSchemas, o as tokenAudiences, t as checkTokenAuthority } from "./tokens-D4gRyyPu.js";
|
|
8
8
|
import { IsKind } from "typebox";
|
|
9
9
|
|
|
10
10
|
// src/internal/exact-length.ts
|
|
@@ -301,12 +301,15 @@ function checkHttpExposure(name, op, routes) {
|
|
|
301
301
|
}
|
|
302
302
|
/**
|
|
303
303
|
* A schema reference (TypeBox `Ref` or `Cyclic`) resolves when the OpenAPI document bundles the schemas,
|
|
304
|
-
* to the one definition its name has. An application whose schemas refer to a name
|
|
305
|
-
* construction, so a reference that names no single definition is refused before the service starts
|
|
306
|
-
* than when the document is first requested; schemas without references have nothing to resolve.
|
|
304
|
+
* to the one definition its name has. An application whose schemas refer to a name has its schemas bundled
|
|
305
|
+
* at construction, so a reference that names no single definition is refused before the service starts
|
|
306
|
+
* rather than when the document is first requested; schemas without references have nothing to resolve.
|
|
307
|
+
* Only the schemas are bundled: building the whole document here cost a large service's Worker hundreds of
|
|
308
|
+
* milliseconds of startup, past what Workers allow, and `maximus openapi --check` builds it before a deploy.
|
|
307
309
|
*/
|
|
308
310
|
function checkSchemaReferences(manifest) {
|
|
309
|
-
|
|
311
|
+
const schemas = [...Object.values(manifest.operations).flatMap((op) => [op.input, op.output]), ...Object.values(manifest.errors.definitions).map((definition) => definition.dataSchema)];
|
|
312
|
+
if (schemas.some(hasSchemaReferences)) bundleSchemas(schemas, {});
|
|
310
313
|
}
|
|
311
314
|
/** Guides are named resources and prompts: each name safe and unique. */
|
|
312
315
|
function checkGuides(guides) {
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// src/internal/destination.ts
|
|
2
|
+
/**
|
|
3
|
+
* Where a Worker may send a request for someone it does not control, such as a server an organization
|
|
4
|
+
* registered. A Worker cannot resolve a name before it fetches it, so the rules hold on the URL itself.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Top-level names reserved for special use or private networks (RFC 2606, 6761, 6762, 7686, 8375 and 9476),
|
|
8
|
+
* and the ones internal networks use.
|
|
9
|
+
*/
|
|
10
|
+
const PRIVATE_TOP_LEVEL_NAMES = /* @__PURE__ */ new Set([
|
|
11
|
+
"alt",
|
|
12
|
+
"arpa",
|
|
13
|
+
"cloudflare",
|
|
14
|
+
"corp",
|
|
15
|
+
"example",
|
|
16
|
+
"home",
|
|
17
|
+
"internal",
|
|
18
|
+
"intranet",
|
|
19
|
+
"invalid",
|
|
20
|
+
"lan",
|
|
21
|
+
"local",
|
|
22
|
+
"localdomain",
|
|
23
|
+
"localhost",
|
|
24
|
+
"onion",
|
|
25
|
+
"private",
|
|
26
|
+
"test"
|
|
27
|
+
]);
|
|
28
|
+
/**
|
|
29
|
+
* Cloudflare's own domains and Arbol's, subdomains included: Arbol's services are reached through the Gateway
|
|
30
|
+
* and native RPC, and neither ever stands for someone else's server.
|
|
31
|
+
*/
|
|
32
|
+
const PLATFORM_DOMAINS = [
|
|
33
|
+
"cloudflare.com",
|
|
34
|
+
"cloudflareaccess.com",
|
|
35
|
+
"cloudflareclient.com",
|
|
36
|
+
"cloudflare-dns.com",
|
|
37
|
+
"cloudflare-gateway.com",
|
|
38
|
+
"getarbol.app",
|
|
39
|
+
"getarbol.com"
|
|
40
|
+
];
|
|
41
|
+
/**
|
|
42
|
+
* A DNS name of two labels or more: letters, digits and inner hyphens, at most 63 characters a label and 253
|
|
43
|
+
* in all, under a top-level name of letters. An IP literal is none.
|
|
44
|
+
*/
|
|
45
|
+
const DNS_NAME = /^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;
|
|
46
|
+
/**
|
|
47
|
+
* The URL, when a Worker may send a request there for someone it does not control: https on its default port,
|
|
48
|
+
* with no credentials or fragment, to a public DNS name; never an IP literal, a special-use or private-network
|
|
49
|
+
* name, nor Cloudflare's or Arbol's own hosts. Undefined for anything else. Send the request with
|
|
50
|
+
* `redirect: 'manual'` and refuse a `3xx`, so no redirect takes it elsewhere.
|
|
51
|
+
*/
|
|
52
|
+
function publicDestination(value) {
|
|
53
|
+
let url;
|
|
54
|
+
try {
|
|
55
|
+
url = new URL(value);
|
|
56
|
+
} catch {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const host = url.hostname;
|
|
60
|
+
const topLevelName = host.slice(host.lastIndexOf(".") + 1);
|
|
61
|
+
if (url.protocol !== "https:" || url.port !== "" || url.username !== "" || url.password !== "" || url.hash !== "" || !DNS_NAME.test(host) || PRIVATE_TOP_LEVEL_NAMES.has(topLevelName) || PLATFORM_DOMAINS.some((domain) => host === domain || host.endsWith(`.${domain}`))) return;
|
|
62
|
+
return url;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export { publicDestination as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { f as Value, t as admitInput } from "./validation-CpzAxj2_.js";
|
|
2
2
|
import { B as withoutSecrets, R as holdsSecrets } from "./schemas-_UJcx_uY.js";
|
|
3
3
|
import { i as standardErrors } from "./errors-BoutSmiy.js";
|
|
4
|
-
import { a as isAttachmentSchema, o as validAttachment } from "./define-app-
|
|
4
|
+
import { a as isAttachmentSchema, o as validAttachment } from "./define-app-CvTei9a8.js";
|
|
5
5
|
import { b as operationScopes, c as ADMISSION_CODES, f as STANDARD_CODES, l as BODY_CODES, v as operationMatchesScopes, y as operationOutputLimit } from "./tasks-DYdY-dBI.js";
|
|
6
6
|
import { t as err } from "./result-CF4OzG9O.js";
|
|
7
7
|
import { t as sha256Hex } from "./digest-C51F1bhA.js";
|
|
@@ -75,68 +75,4 @@ function retryAfterSeconds(value, nowMs, maximum = 3600) {
|
|
|
75
75
|
return Number.isFinite(seconds) ? Math.min(maximum, Math.max(0, Math.ceil(seconds))) : void 0;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Where a Worker may send a request for someone it does not control, such as a server an organization
|
|
81
|
-
* registered. A Worker cannot resolve a name before it fetches it, so the rules hold on the URL itself.
|
|
82
|
-
*/
|
|
83
|
-
/**
|
|
84
|
-
* Top-level names reserved for special use or private networks (RFC 2606, 6761, 6762, 7686, 8375 and 9476),
|
|
85
|
-
* and the ones internal networks use.
|
|
86
|
-
*/
|
|
87
|
-
const PRIVATE_TOP_LEVEL_NAMES = /* @__PURE__ */ new Set([
|
|
88
|
-
"alt",
|
|
89
|
-
"arpa",
|
|
90
|
-
"cloudflare",
|
|
91
|
-
"corp",
|
|
92
|
-
"example",
|
|
93
|
-
"home",
|
|
94
|
-
"internal",
|
|
95
|
-
"intranet",
|
|
96
|
-
"invalid",
|
|
97
|
-
"lan",
|
|
98
|
-
"local",
|
|
99
|
-
"localdomain",
|
|
100
|
-
"localhost",
|
|
101
|
-
"onion",
|
|
102
|
-
"private",
|
|
103
|
-
"test"
|
|
104
|
-
]);
|
|
105
|
-
/**
|
|
106
|
-
* Cloudflare's own domains and Arbol's, subdomains included: Arbol's services are reached through the Gateway
|
|
107
|
-
* and native RPC, and neither ever stands for someone else's server.
|
|
108
|
-
*/
|
|
109
|
-
const PLATFORM_DOMAINS = [
|
|
110
|
-
"cloudflare.com",
|
|
111
|
-
"cloudflareaccess.com",
|
|
112
|
-
"cloudflareclient.com",
|
|
113
|
-
"cloudflare-dns.com",
|
|
114
|
-
"cloudflare-gateway.com",
|
|
115
|
-
"getarbol.app",
|
|
116
|
-
"getarbol.com"
|
|
117
|
-
];
|
|
118
|
-
/**
|
|
119
|
-
* A DNS name of two labels or more: letters, digits and inner hyphens, at most 63 characters a label and 253
|
|
120
|
-
* in all, under a top-level name of letters. An IP literal is none.
|
|
121
|
-
*/
|
|
122
|
-
const DNS_NAME = /^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;
|
|
123
|
-
/**
|
|
124
|
-
* The URL, when a Worker may send a request there for someone it does not control: https on its default port,
|
|
125
|
-
* with no credentials or fragment, to a public DNS name; never an IP literal, a special-use or private-network
|
|
126
|
-
* name, nor Cloudflare's or Arbol's own hosts. Undefined for anything else. Send the request with
|
|
127
|
-
* `redirect: 'manual'` and refuse a `3xx`, so no redirect takes it elsewhere.
|
|
128
|
-
*/
|
|
129
|
-
function publicDestination(value) {
|
|
130
|
-
let url;
|
|
131
|
-
try {
|
|
132
|
-
url = new URL(value);
|
|
133
|
-
} catch {
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
const host = url.hostname;
|
|
137
|
-
const topLevelName = host.slice(host.lastIndexOf(".") + 1);
|
|
138
|
-
if (url.protocol !== "https:" || url.port !== "" || url.username !== "" || url.password !== "" || url.hash !== "" || !DNS_NAME.test(host) || PRIVATE_TOP_LEVEL_NAMES.has(topLevelName) || PLATFORM_DOMAINS.some((domain) => host === domain || host.endsWith(`.${domain}`))) return;
|
|
139
|
-
return url;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
export { readJsonResponse as a, readJsonBody as i, isJsonMediaType as n, retryAfterSeconds as o, mediaType as r, publicDestination as t };
|
|
78
|
+
export { retryAfterSeconds as a, readJsonResponse as i, mediaType as n, readJsonBody as r, isJsonMediaType as t };
|