apps 0.0.1-beta.139 → 0.0.1-beta.140
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/framework-reference.json +1 -1
- package/js/{chunk-GGDUOJT5.js → chunk-5JBDHSLK.js} +2 -2
- package/js/{chunk-W4WVDYQU.js → chunk-DQ6FIDC3.js} +1 -1
- package/js/{chunk-WXHRUWNT.js → chunk-EKXBHVMR.js} +61 -15
- package/js/{chunk-KOL4PQIA.js → chunk-EYZHR4UA.js} +5 -5
- package/js/{chunk-R62755EK.js → chunk-GJG5G6CH.js} +2 -2
- package/js/{chunk-WTRNAN4H.js → chunk-JHAHT26O.js} +2 -2
- package/js/{chunk-T2PEBOBK.js → chunk-JIXIOWZP.js} +2 -2
- package/js/{chunk-DXAVGW7B.js → chunk-SB2DNKDL.js} +42 -25
- package/js/{chunk-2CMT4JYG.js → chunk-Z6DSU4VL.js} +2 -2
- package/js/client.js +1 -1
- package/js/effect.js +6 -6
- package/js/graphql.js +8 -8
- package/js/host.js +6 -6
- package/js/index.js +3 -3
- package/js/mcp/effect.js +7 -7
- package/js/mcp.js +9 -9
- package/js/openapi.js +4 -4
- package/js/skills.js +3 -3
- package/package.json +1 -1
- package/runtime.json +1 -1
- package/types/apps/src/implementation/schema.d.ts +25 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Author schema facade. Internals use the native decoder retained by each value. */
|
|
2
2
|
import { Effect, Schema as EffectSchema } from "effect";
|
|
3
|
-
import { DeclarationInvalid, JsonObject, ValidationError } from "../contracts/schema.js";
|
|
3
|
+
import { DeclarationInvalid, JsonObject, ValidationError, type JsonValue } from "../contracts/schema.js";
|
|
4
4
|
import type { FieldExposure } from "../contracts/provider.js";
|
|
5
5
|
declare const Decoder: unique symbol;
|
|
6
6
|
/** An author-facing value schema. Effect is never required in author code. */
|
|
@@ -135,13 +135,36 @@ export declare const withLazyJsonSchemaDocument: <S extends EffectSchema.Decoder
|
|
|
135
135
|
* patched validator applies it like `"#"` was: the recursive anchor in scope, else that target.
|
|
136
136
|
*/
|
|
137
137
|
export declare const nestJsonSchema: (input: JsonObject, pointer: string) => JsonObject;
|
|
138
|
+
/**
|
|
139
|
+
* What one listing learns about the definitions its tools' schemas hold. Routers such as the
|
|
140
|
+
* OpenAPI importer give every tool that reaches a definition the same object, and a densely
|
|
141
|
+
* connected API reaches most of its definitions from every tool: Stripe's 610 tools name about
|
|
142
|
+
* 330,000 `$defs` entries but only a few thousand distinct definitions. Combining schemas reads
|
|
143
|
+
* each definition object once per listing, rather than once for every tool that reaches it, so a
|
|
144
|
+
* listing's cost follows its distinct definitions instead of its tools times its definitions.
|
|
145
|
+
* Values are only read, never changed: the memo is valid while the listing's objects are, so
|
|
146
|
+
* make one for each listing or description and drop it with them.
|
|
147
|
+
*/
|
|
148
|
+
export interface SchemaMemo {
|
|
149
|
+
/** Equal numbers for definitions whose JSON text is equal. */
|
|
150
|
+
readonly textId: (definition: JsonValue) => number;
|
|
151
|
+
/** The `$defs` names the definition refers to, or undefined, as `definitionReferences`. */
|
|
152
|
+
readonly references: (definition: JsonValue) => ReadonlySet<string> | undefined;
|
|
153
|
+
}
|
|
154
|
+
export declare const schemaMemo: () => SchemaMemo;
|
|
155
|
+
/**
|
|
156
|
+
* A key equal for schemas whose JSON text is equal, without writing the definitions in their
|
|
157
|
+
* `$defs`: each definition stands for its memo number.
|
|
158
|
+
*/
|
|
159
|
+
export declare const schemaIdentity: (schema: JsonObject, memo: SchemaMemo) => string;
|
|
138
160
|
/**
|
|
139
161
|
* Self-contained schemas placed side by side in one document, such as the branches of a union.
|
|
140
162
|
* A schema whose references all name its root `$defs` gives those entries to the document's root
|
|
141
163
|
* `$defs` when no entry of the same name differs, so definitions stay where listings share them
|
|
142
164
|
* among tools. Any other schema is relocated with `nestJsonSchema` under `pointer(index)`.
|
|
165
|
+
* Definitions are compared by object first and by text only when two objects share a name.
|
|
143
166
|
*/
|
|
144
|
-
export declare const combineJsonSchemas: (schemas: readonly JsonObject[], pointer: (index: number) => string) => {
|
|
167
|
+
export declare const combineJsonSchemas: (schemas: readonly JsonObject[], pointer: (index: number) => string, memo?: SchemaMemo) => {
|
|
145
168
|
readonly $defs?: JsonObject;
|
|
146
169
|
readonly schemas: readonly JsonObject[];
|
|
147
170
|
};
|