@arbol-ai/maximus 8.1.0 → 8.5.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 +16 -16
- package/dist/analytics/analytics.js +3 -3
- package/dist/body.d.ts +2 -2
- package/dist/body.js +2 -1
- package/dist/capture/index.d.ts +1 -1
- package/dist/capture/index.js +3 -4
- package/dist/chunks/{define-app-BxGZdNmS.js → define-app-CQpWqqqE.js} +33 -14
- package/dist/chunks/destination-5xTX0b7E.js +65 -0
- package/dist/chunks/{digest-C7UGt760.js → digest-C51F1bhA.js} +1 -2
- package/dist/chunks/{errors-CWgE9uvM.js → errors-BoutSmiy.js} +2 -3
- package/dist/chunks/{execution-BTiAWA4n.js → execution-Bpq6s4nA.js} +9 -8
- package/dist/chunks/{generate-C-9FKW0o.js → generate-Dg88LzLU.js} +1 -1
- package/dist/chunks/{handler-iebR-urt.js → handler-DSpyrWc-.js} +6 -2
- package/dist/chunks/{http-layout-BvlbD__1.js → http-layout-BcYH4I2w.js} +1 -1
- package/dist/chunks/{http-paths-DMBxwpp6.js → http-paths-D043DkJv.js} +50 -81
- package/dist/chunks/http-routes-B6tCsnxB.js +29 -0
- package/dist/chunks/{openapi-BF3eCpux.js → openapi-D2rds7vy.js} +27 -116
- package/dist/chunks/{openapi-file-RcXoq0AF.js → openapi-file-BK8zET5U.js} +24 -6
- package/dist/chunks/{pages-BCksUeRf.js → pages-B7ysoFAM.js} +1 -1
- package/dist/chunks/result-CF4OzG9O.js +29 -0
- package/dist/chunks/{runtime-D5eR9-Es.js → runtime-8OpxAvsI.js} +132 -7
- package/dist/chunks/schemas-_UJcx_uY.js +813 -0
- package/dist/chunks/{server-B9C8KPwa.js → server-CVhTLNj2.js} +37 -101
- package/dist/chunks/{src-C-4z443M.js → src-B_LthUVU.js} +39 -18
- package/dist/chunks/tasks-C873C3le.js +100 -0
- package/dist/chunks/tasks-DYdY-dBI.js +267 -0
- package/dist/chunks/{types-Dqo3oGig.d.ts → types-BfGa2aJT.d.ts} +346 -138
- package/dist/chunks/validation-CpzAxj2_.js +201 -0
- package/dist/chunks/{workers-types-BgjyDtGd.d.ts → workers-types-Cxf-5cH7.d.ts} +6 -1
- package/dist/client.d.ts +92 -0
- package/dist/client.js +300 -0
- package/dist/diagnostics.d.ts +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +1 -1
- package/dist/http-paths.d.ts +1 -1
- package/dist/http-paths.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +11 -9
- package/dist/internals.d.ts +1 -1
- package/dist/internals.js +4 -4
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/tasks.d.ts +33 -0
- package/dist/mcp/tasks.js +3 -0
- package/dist/project/config.d.ts +2 -2
- package/dist/project/config.js +3 -2
- package/dist/project/index.d.ts +2 -2
- package/dist/project/index.js +3 -3
- package/dist/schemas.d.ts +2 -2
- package/dist/schemas.js +3 -3
- package/dist/standard-failures.d.ts +1 -1
- package/dist/tooling/cli.js +2 -2
- package/dist/vite/index.d.ts +1 -1
- package/dist/vite/index.js +6 -5
- package/dist/webhooks.d.ts +13 -2
- package/dist/webhooks.js +38 -1
- package/dist/workers/runtime.d.ts +1 -1
- package/dist/workers/runtime.js +1 -1
- package/package.json +15 -3
- package/skills/maximus/SKILL.md +7 -4
- package/skills/maximus/references/routes-and-tools.md +9 -1
- package/dist/chunks/result-CKgZHrnj.js +0 -56
- package/dist/chunks/schemas-BOFxZP1c.js +0 -227
- package/dist/chunks/validation-DMu0rkMQ.js +0 -670
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
import { c as SchemaValidationError, f as inputSchema, l as defaultSchema, o as codecFault, r as decodeSchema, s as decodeIssues } from "./validation-DMu0rkMQ.js";
|
|
2
|
-
import { Kind, Type, Type as Type$1, Type as t } from "@sinclair/typebox";
|
|
3
|
-
|
|
4
|
-
// src/schema-reader.ts
|
|
5
|
-
/**
|
|
6
|
-
* Reads untrusted data — a stored record, a provider or model answer — through its schema's owner
|
|
7
|
-
* semantics: defaults applied, normalizers run before their checks, unknown keys of a strip object
|
|
8
|
-
* dropped. A refusal carries every issue with its path; nothing is coerced. An owner codec that fails
|
|
9
|
-
* throws what it threw.
|
|
10
|
-
*/
|
|
11
|
-
function checkSchema(schema, input) {
|
|
12
|
-
try {
|
|
13
|
-
return {
|
|
14
|
-
success: true,
|
|
15
|
-
data: decodeSchema(inputSchema(schema, { stripUnknown: true }), input)
|
|
16
|
-
};
|
|
17
|
-
} catch (error) {
|
|
18
|
-
const issues = decodeIssues(error);
|
|
19
|
-
if (!issues) throw codecFault(error);
|
|
20
|
-
return {
|
|
21
|
-
success: false,
|
|
22
|
-
error: new SchemaValidationError(issues)
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
/** `checkSchema`, throwing its SchemaValidationError on refusal. */
|
|
27
|
-
function readSchema(schema, input) {
|
|
28
|
-
const checked = checkSchema(schema, input);
|
|
29
|
-
if (!checked.success) throw checked.error;
|
|
30
|
-
return checked.data;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// src/attachment-schema.ts
|
|
34
|
-
/**
|
|
35
|
-
* The file an HTTP operation answers with and its output schema, with nothing that needs a runtime. An
|
|
36
|
-
* attachment is never a JSON or RPC value.
|
|
37
|
-
*/
|
|
38
|
-
/** The output of an operation that answers with a file (`http.response: 'attachment'`). */
|
|
39
|
-
const AttachmentOutputSchema = Type.Unsafe({
|
|
40
|
-
[Kind]: "HttpAttachment",
|
|
41
|
-
type: "string",
|
|
42
|
-
format: "binary",
|
|
43
|
-
description: "Authenticated attachment bytes with validated media type, filename and exact length."
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
// src/pagination.ts
|
|
47
|
-
/**
|
|
48
|
-
* The one list contract: bidirectional keyset pagination. A list takes the query fields `cursor`,
|
|
49
|
-
* `direction` and `limit` and answers `{ object: 'list', data, pageInfo }`. The cursor is opaque to
|
|
50
|
-
* callers; there is no page number, page size, offset or implicit total.
|
|
51
|
-
*
|
|
52
|
-
* `PageInfo` and each `Page` are named schemas, so an OpenAPI document carries them once as
|
|
53
|
-
* `#/components/schemas/<name>` and every SDK generated from it shares their types.
|
|
54
|
-
*/
|
|
55
|
-
/** A public schema name: an SDK type in every language generated from the document. */
|
|
56
|
-
const PAGE_ID = /^[A-Z][A-Za-z0-9]{0,127}$/;
|
|
57
|
-
/**
|
|
58
|
-
* How to reach a list's neighboring pages: whether they exist and their opaque cursors, named `PageInfo`.
|
|
59
|
-
*/
|
|
60
|
-
const PageInfoSchema = Type.Object({
|
|
61
|
-
hasNextPage: Type.Boolean({ description: "Whether a later page exists in the current ordering." }),
|
|
62
|
-
hasPreviousPage: Type.Boolean({ description: "Whether an earlier page exists in the current ordering." }),
|
|
63
|
-
nextCursor: Type.Union([Type.String(), Type.Null()], { description: "Opaque cursor for the next page, or null when there is none." }),
|
|
64
|
-
previousCursor: Type.Union([Type.String(), Type.Null()], { description: "Opaque cursor for the previous page, or null when there is none." })
|
|
65
|
-
}, {
|
|
66
|
-
$id: "PageInfo",
|
|
67
|
-
additionalProperties: false
|
|
68
|
-
});
|
|
69
|
-
/**
|
|
70
|
-
* A list's `limit`: an integer from 1 to `maximum` (100), `default` (25, or the maximum when it is lower)
|
|
71
|
-
* when the caller sends none. A list whose items are costly lowers the maximum:
|
|
72
|
-
* `{ ...PageQueryFields, limit: pageLimit({ maximum: 20 }) }`. A default outside 1 to the maximum, or a
|
|
73
|
-
* value that is not an integer, throws a TypeError.
|
|
74
|
-
*/
|
|
75
|
-
function pageLimit(options = {}) {
|
|
76
|
-
const { maximum = 100, default: fallback = Math.min(25, maximum) } = options;
|
|
77
|
-
if (!(Number.isInteger(maximum) && Number.isInteger(fallback) && fallback >= 1 && fallback <= maximum)) throw new TypeError("A page limit has an integer default from 1 to its integer maximum.");
|
|
78
|
-
return defaultSchema(Type.Integer({
|
|
79
|
-
minimum: 1,
|
|
80
|
-
maximum,
|
|
81
|
-
description: `Maximum items returned in one page. Defaults to ${fallback}; larger reads require another cursor.`
|
|
82
|
-
}), fallback);
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* The query fields of a list, spread into its input beside its own filters: an optional opaque `cursor`, a
|
|
86
|
-
* `direction` (`forward` by default, or `backward`) and a `limit` (`pageLimit()`).
|
|
87
|
-
*/
|
|
88
|
-
const PageQueryFields = {
|
|
89
|
-
cursor: Type.Optional(Type.String({ description: "Opaque cursor returned by pageInfo; omit it to request the first page." })),
|
|
90
|
-
direction: defaultSchema(Type.Union([Type.Literal("forward"), Type.Literal("backward")], { description: "Direction to traverse the stable keyset ordering from the supplied cursor." }), "forward"),
|
|
91
|
-
limit: pageLimit()
|
|
92
|
-
};
|
|
93
|
-
/**
|
|
94
|
-
* The output of a list of `item`, named by `$id` (`AppointmentPage`), a PascalCase name of up to 128
|
|
95
|
-
* characters; any other throws a TypeError. Give each list its own name and use it for that list only: two
|
|
96
|
-
* different shapes under one `$id` become two components, the second one suffixed `_2`.
|
|
97
|
-
*/
|
|
98
|
-
function Page(item, options) {
|
|
99
|
-
if (!PAGE_ID.test(options.$id)) throw new TypeError(`Page "${options.$id}" needs a PascalCase schema name, such as AppointmentPage.`);
|
|
100
|
-
return Type.Object({
|
|
101
|
-
data: Type.Array(item, { description: "Items admitted by this resource contract within the verified organization." }),
|
|
102
|
-
object: Type.Literal("list", { description: "Discriminator for a resource list response." }),
|
|
103
|
-
pageInfo: {
|
|
104
|
-
...PageInfoSchema,
|
|
105
|
-
description: "Opaque navigation cursors for this page’s stable keyset order."
|
|
106
|
-
}
|
|
107
|
-
}, {
|
|
108
|
-
$id: options.$id,
|
|
109
|
-
additionalProperties: false
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// src/common-schemas.ts
|
|
114
|
-
/**
|
|
115
|
-
* Values and objects that services publish alike, each named by its `$id`: an OpenAPI document carries
|
|
116
|
-
* it once as `#/components/schemas/<name>`, and every SDK generated from those documents has one type
|
|
117
|
-
* for it. A name is public, so it names exactly one shape. Domain records (people, patients,
|
|
118
|
-
* identity documents) stay with the service that owns them.
|
|
119
|
-
*/
|
|
120
|
-
/** An email address of at most 254 characters, named `EmailAddress`. */
|
|
121
|
-
const EmailAddressSchema = Type.String({
|
|
122
|
-
$id: "EmailAddress",
|
|
123
|
-
format: "email",
|
|
124
|
-
maxLength: 254,
|
|
125
|
-
description: "Email address."
|
|
126
|
-
});
|
|
127
|
-
/** A phone number in E.164 format, named `PhoneNumber`. */
|
|
128
|
-
const PhoneNumberSchema = Type.String({
|
|
129
|
-
$id: "PhoneNumber",
|
|
130
|
-
pattern: "^\\+[1-9][0-9]{1,14}$",
|
|
131
|
-
description: "Phone number in E.164 format."
|
|
132
|
-
});
|
|
133
|
-
/** An HTTPS URL of at most 2048 characters, named `HttpsUrl`. */
|
|
134
|
-
const HttpsUrlSchema = Type.String({
|
|
135
|
-
$id: "HttpsUrl",
|
|
136
|
-
format: "uri",
|
|
137
|
-
pattern: "^https://",
|
|
138
|
-
maxLength: 2048,
|
|
139
|
-
description: "An HTTPS URL."
|
|
140
|
-
});
|
|
141
|
-
/** A `#rrggbb` color, named `HexColor`. */
|
|
142
|
-
const HexColorSchema = Type.String({
|
|
143
|
-
$id: "HexColor",
|
|
144
|
-
pattern: "^#[0-9a-fA-F]{6}$",
|
|
145
|
-
description: "A color, as #rrggbb."
|
|
146
|
-
});
|
|
147
|
-
/** What a delete answers: the deleted resource's id and `deleted: true`, named `DeletedObject`. */
|
|
148
|
-
const DeletedObjectSchema = Type.Object({
|
|
149
|
-
id: Type.String({ description: "The id of the deleted resource." }),
|
|
150
|
-
deleted: Type.Literal(true)
|
|
151
|
-
}, {
|
|
152
|
-
$id: "DeletedObject",
|
|
153
|
-
additionalProperties: false
|
|
154
|
-
});
|
|
155
|
-
/** The URL of a `SignedUrl`, described as the credential it is. */
|
|
156
|
-
const SignedUrlFieldSchema = {
|
|
157
|
-
...HttpsUrlSchema,
|
|
158
|
-
description: "The signed URL. Anyone holding it has access until it expires."
|
|
159
|
-
};
|
|
160
|
-
/**
|
|
161
|
-
* A link that grants access by itself until it expires, such as a file download: its HTTPS `url` and its
|
|
162
|
-
* `expiresAt` date-time, named `SignedUrl`.
|
|
163
|
-
*/
|
|
164
|
-
const SignedUrlSchema = Type.Object({
|
|
165
|
-
url: SignedUrlFieldSchema,
|
|
166
|
-
expiresAt: Type.String({
|
|
167
|
-
format: "date-time",
|
|
168
|
-
description: "When the URL stops working."
|
|
169
|
-
})
|
|
170
|
-
}, {
|
|
171
|
-
$id: "SignedUrl",
|
|
172
|
-
additionalProperties: false
|
|
173
|
-
});
|
|
174
|
-
/** Another resource, by its id and the name people know it by, named `NamedReference`. */
|
|
175
|
-
const NamedReferenceSchema = Type.Object({
|
|
176
|
-
id: Type.String({ description: "The id of the referenced resource." }),
|
|
177
|
-
name: Type.String({ description: "Its name." })
|
|
178
|
-
}, {
|
|
179
|
-
$id: "NamedReference",
|
|
180
|
-
additionalProperties: false
|
|
181
|
-
});
|
|
182
|
-
/**
|
|
183
|
-
* A postal address, shaped as FHIR `Address` (its lines, city, state, postal code, ISO 3166-1 alpha-2 country
|
|
184
|
-
* code and use), every field optional, named `PostalAddress`.
|
|
185
|
-
*/
|
|
186
|
-
const PostalAddressSchema = Type.Object({
|
|
187
|
-
city: Type.Optional(Type.String({ maxLength: 120 })),
|
|
188
|
-
countryCode: Type.Optional(Type.String({
|
|
189
|
-
description: "ISO 3166-1 alpha-2.",
|
|
190
|
-
pattern: "^[A-Z]{2}$"
|
|
191
|
-
})),
|
|
192
|
-
line: Type.Optional(Type.Array(Type.String({ maxLength: 200 }), { maxItems: 4 })),
|
|
193
|
-
postalCode: Type.Optional(Type.String({ maxLength: 20 })),
|
|
194
|
-
state: Type.Optional(Type.String({ maxLength: 120 })),
|
|
195
|
-
use: Type.Optional(Type.Union([Type.Literal("home"), Type.Literal("work")]))
|
|
196
|
-
}, {
|
|
197
|
-
$id: "PostalAddress",
|
|
198
|
-
additionalProperties: false
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
// src/schemas.ts
|
|
202
|
-
/**
|
|
203
|
-
* `@arbol-ai/maximus/schemas`: the browser-safe schema vocabulary: TypeBox (`t`), its types, the validators
|
|
204
|
-
* and the shared identifier schemas, with nothing that needs a Worker runtime. A contract module that
|
|
205
|
-
* browsers import (a Dashboard reading an API's limits, a widget's settings) imports from here rather than
|
|
206
|
-
* the package root.
|
|
207
|
-
*/
|
|
208
|
-
/** The input of an operation that takes none: an empty strict object. */
|
|
209
|
-
const EmptyInputSchema = Type.Object({}, { additionalProperties: false });
|
|
210
|
-
/**
|
|
211
|
-
* An organization id as identity providers issue them (`org_…`, a UUID, a slug): 1 to 128 letters, digits,
|
|
212
|
-
* `_` and `-`, starting with a letter or digit, named `OrganizationId`. Nothing in it can change the meaning
|
|
213
|
-
* of a storage key, a path or a log line.
|
|
214
|
-
*/
|
|
215
|
-
const OrganizationIdSchema = Type.String({
|
|
216
|
-
$id: "OrganizationId",
|
|
217
|
-
pattern: "^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$",
|
|
218
|
-
description: "Verified organization identifier."
|
|
219
|
-
});
|
|
220
|
-
/** A lowercase RFC 9562 UUID of version 1 to 8, named `Uuid`. */
|
|
221
|
-
const UuidSchema = Type.String({
|
|
222
|
-
$id: "Uuid",
|
|
223
|
-
format: "uuid",
|
|
224
|
-
pattern: "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
|
|
225
|
-
});
|
|
226
|
-
|
|
227
|
-
export { pageLimit as _, t as a, readSchema as b, HexColorSchema as c, PhoneNumberSchema as d, PostalAddressSchema as f, PageQueryFields as g, PageInfoSchema as h, UuidSchema as i, HttpsUrlSchema as l, Page as m, OrganizationIdSchema as n, DeletedObjectSchema as o, SignedUrlSchema as p, Type$1 as r, EmailAddressSchema as s, EmptyInputSchema as t, NamedReferenceSchema as u, AttachmentOutputSchema as v, checkSchema as y };
|