apps 0.0.1-beta.3 → 0.0.1-beta.30
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 +68 -44
- package/framework-reference.json +1 -1
- package/js/{chunk-G7ZIRKMK.js → chunk-2D2PKLGQ.js} +118 -197
- package/js/chunk-3SPRHIEE.js +42 -0
- package/js/{chunk-FDNTX5QJ.js → chunk-4N26L465.js} +2 -2
- package/js/chunk-5ZHHO4OM.js +92 -0
- package/js/{chunk-EVJUVWN2.js → chunk-65SZ23BK.js} +2 -2
- package/js/{chunk-M6ZRRIBI.js → chunk-6JBTHTI5.js} +1 -1
- package/js/{chunk-J7O55ZV7.js → chunk-6NK26ONC.js} +332 -187
- package/js/chunk-6VWYEQ4X.js +254 -0
- package/js/{chunk-RN2MXB4R.js → chunk-AE4FWJQU.js} +128 -24
- package/js/{chunk-HDJH3RPR.js → chunk-BBTELEAN.js} +2 -2
- package/js/{chunk-LGIYBDWA.js → chunk-BRGF7VFN.js} +65 -1
- package/js/{chunk-MYYEW3RA.js → chunk-BSRU52RU.js} +984 -61
- package/js/{chunk-FZJOYIZO.js → chunk-BTJMXW4I.js} +1 -1
- package/js/{chunk-HDTGZWP2.js → chunk-IMCEF6KE.js} +139 -32
- package/js/chunk-KQCMHI3K.js +118 -0
- package/js/{chunk-BMOIAIVR.js → chunk-M2KEEOIQ.js} +49 -1
- package/js/{chunk-YEJOQEII.js → chunk-MYCVMDWI.js} +45 -7
- package/js/{chunk-FW5HBOIK.js → chunk-NXTXZ635.js} +1841 -1701
- package/js/chunk-OD3KFKZD.js +1617 -0
- package/js/{chunk-JN55AYQH.js → chunk-OI5CKSBU.js} +61 -32
- package/js/{chunk-NQ3OMCA5.js → chunk-P46HIAX6.js} +2 -2
- package/js/chunk-PUC24GZP.js +801 -0
- package/js/{chunk-SATWJKN6.js → chunk-PWF2DRJ3.js} +1 -1
- package/js/{chunk-D47C7KG5.js → chunk-VUVBMNKC.js} +2 -2
- package/js/{chunk-ZCAMUXSG.js → chunk-WGBI5MVX.js} +3 -4
- package/js/{chunk-T2LAZCAD.js → chunk-WQ5MVBTP.js} +1 -1
- package/js/{chunk-PLCMJREA.js → chunk-XBQTJP76.js} +60 -20
- package/js/{chunk-QKHR7BMF.js → chunk-XGN5IFOZ.js} +3 -3
- package/js/{chunk-WFSQXYUT.js → chunk-YML53Z7H.js} +42 -5
- package/js/{chunk-5MQZEB6Y.js → chunk-ZZOCEUTB.js} +37 -12
- package/js/client.js +120 -84
- package/js/contracts.js +110 -16
- package/js/effect.js +20 -20
- package/js/{es-APDZKREY.js → es-DIULA3ZF.js} +62 -1659
- package/js/graphql.js +58 -54
- package/js/host.js +20 -20
- package/js/index.js +247 -204
- package/js/mcp/effect.js +24 -22
- package/js/mcp/stdio.js +35 -30
- package/js/mcp.js +105 -68
- package/js/openapi.js +4087 -1503
- package/js/react.js +3 -3
- package/js/skills/effect.js +5 -3
- package/js/skills.js +15 -15
- package/js/storage/facet.js +4 -4
- package/js/ui/auth/contracts.js +2 -2
- package/js/ui/auth.js +5 -5
- package/js/ui/contracts.js +5 -4
- package/js/ui/serving.js +8516 -214
- package/package.json +1 -1
- package/runtime.json +1 -1
- package/types/app-data/src/contracts/database.d.ts +33 -6
- package/types/app-data/src/implementation/schema.d.ts +2 -17
- package/types/apps/src/contracts/api-response-error.d.ts +4 -0
- package/types/apps/src/contracts/app.d.ts +7 -6
- package/types/apps/src/contracts/failure.d.ts +54 -0
- package/types/apps/src/contracts/graphql.d.ts +2 -1
- package/types/apps/src/contracts/host.d.ts +34 -11
- package/types/apps/src/contracts/mcp.d.ts +91 -10
- package/types/apps/src/contracts/network.d.ts +84 -0
- package/types/apps/src/contracts/openapi-compile.d.ts +31 -3
- package/types/apps/src/contracts/openapi.d.ts +45 -9
- package/types/apps/src/contracts/operations.d.ts +5 -6
- package/types/apps/src/contracts/protocol-version.d.ts +2 -2
- package/types/apps/src/contracts/protocols/1.d.ts +251 -69
- package/types/apps/src/contracts/protocols/2.d.ts +710 -0
- package/types/apps/src/contracts/protocols/3.d.ts +716 -0
- package/types/apps/src/contracts/protocols/4.d.ts +1298 -0
- package/types/apps/src/contracts/protocols/5.d.ts +1174 -0
- package/types/apps/src/contracts/protocols/6.d.ts +1620 -0
- package/types/apps/src/contracts/protocols/7.d.ts +1784 -0
- package/types/apps/src/contracts/protocols/8.d.ts +1119 -0
- package/types/apps/src/contracts/protocols/oauth.d.ts +89 -0
- package/types/apps/src/contracts/provider-error.d.ts +9 -0
- package/types/apps/src/contracts/provider.d.ts +115 -10
- package/types/apps/src/contracts/router.d.ts +59 -0
- package/types/apps/src/contracts/skills.d.ts +18 -5
- package/types/apps/src/contracts/storage.d.ts +3 -3
- package/types/apps/src/contracts/ui.d.ts +18 -0
- package/types/apps/src/contracts/workflows.d.ts +34 -3
- package/types/apps/src/graphql.d.ts +1 -3
- package/types/apps/src/implementation/account-router.d.ts +12 -0
- package/types/apps/src/implementation/app.d.ts +5 -4
- package/types/apps/src/implementation/browser-scripts.gen.d.ts +6 -0
- package/types/apps/src/implementation/catalog-cache.d.ts +34 -4
- package/types/apps/src/implementation/elicitation.d.ts +9 -9
- package/types/apps/src/implementation/failure-detail.d.ts +46 -0
- package/types/apps/src/implementation/graphql-catalog.d.ts +4 -7
- package/types/apps/src/implementation/graphql.d.ts +4 -3
- package/types/apps/src/implementation/mcp-call.d.ts +6 -5
- package/types/apps/src/implementation/mcp-catalog.d.ts +7 -8
- package/types/apps/src/implementation/mcp-client.d.ts +49 -25
- package/types/apps/src/implementation/mcp-stdio.d.ts +1 -1
- package/types/apps/src/implementation/mcp-tools.d.ts +2 -1
- package/types/apps/src/implementation/mcp.d.ts +52 -25
- package/types/apps/src/implementation/network.d.ts +16 -0
- package/types/apps/src/implementation/openapi-compile.d.ts +27 -6
- package/types/apps/src/implementation/openapi-document.d.ts +35 -8
- package/types/apps/src/implementation/openapi-names.d.ts +9 -4
- package/types/apps/src/implementation/openapi-request.d.ts +10 -2
- package/types/apps/src/implementation/openapi-source.d.ts +8 -6
- package/types/apps/src/implementation/openapi-upgrade.d.ts +4 -0
- package/types/apps/src/implementation/operations.d.ts +36 -3
- package/types/apps/src/implementation/protocol-operations.d.ts +6 -4
- package/types/apps/src/implementation/provider-error.d.ts +28 -1
- package/types/apps/src/implementation/provider.d.ts +19 -5
- package/types/apps/src/implementation/router-catalog.d.ts +224 -0
- package/types/apps/src/implementation/router.d.ts +68 -0
- package/types/apps/src/implementation/runtime-yield.d.ts +7 -0
- package/types/apps/src/implementation/schema.d.ts +52 -1
- package/types/apps/src/implementation/skills.d.ts +2 -2
- package/types/apps/src/implementation/storage.d.ts +5 -3
- package/types/apps/src/implementation/ui-account-notice.d.ts +9 -0
- package/types/apps/src/implementation/ui-client.d.ts +2 -2
- package/types/apps/src/implementation/ui-document.d.ts +5 -0
- package/types/apps/src/implementation/ui-errors.d.ts +1 -1
- package/types/apps/src/implementation/ui-serving.d.ts +10 -4
- package/types/apps/src/implementation/ui-watch.d.ts +1 -1
- package/types/apps/src/implementation/upstream-error.d.ts +7 -0
- package/types/apps/src/implementation/webhooks.d.ts +1 -1
- package/types/apps/src/implementation/workflow-context.d.ts +11 -3
- package/types/apps/src/index.d.ts +29 -11
- package/types/apps/src/mcp-stdio.d.ts +2 -5
- package/types/apps/src/mcp.d.ts +25 -5
- package/types/apps/src/openapi.d.ts +6 -6
- package/types/apps/src/skills.d.ts +4 -4
- package/types/telemetry/src/browser-operations.d.ts +5 -2
- package/types/telemetry/src/config.d.ts +2 -2
- package/types/utils/src/api-error.d.ts +48 -0
- package/js/chunk-PYUYJRSK.js +0 -93
- package/js/chunk-SWPD52J7.js +0 -35
- package/js/chunk-W7D7WVSY.js +0 -18
- package/js/chunk-Z5NMEGJN.js +0 -29
- package/js/chunk-ZJWDMTE3.js +0 -63
- package/types/apps/src/contracts/dynamic-tools.d.ts +0 -13
- package/types/apps/src/implementation/account-operations.d.ts +0 -151
- package/types/apps/src/implementation/dynamic-tools.d.ts +0 -8
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ProviderError } from "./provider-error.js";
|
|
2
|
+
import type { NetworkRefused } from "./network.js";
|
|
2
3
|
/** Credential-free OpenAPI request declarations and validation schemas retained with app source. */
|
|
3
4
|
import { Schema, type Effect } from "effect";
|
|
4
5
|
import { JsonObject } from "./schema.js";
|
|
@@ -20,7 +21,8 @@ export type OpenapiErrorResponse = typeof OpenapiErrorResponse.Type;
|
|
|
20
21
|
/** Resolved OpenAPI parameter shared by import validation and request construction. */
|
|
21
22
|
export declare const OpenapiParameter: Schema.Struct<{
|
|
22
23
|
readonly name: Schema.String;
|
|
23
|
-
|
|
24
|
+
/** OpenAPI 3.2's `querystring` is the whole query string, serialized from one `content` value. */
|
|
25
|
+
readonly in: Schema.Literals<readonly ["path", "query", "querystring", "header", "cookie"]>;
|
|
24
26
|
readonly required: Schema.optionalKey<Schema.Boolean>;
|
|
25
27
|
readonly schema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
26
28
|
readonly style: Schema.optionalKey<Schema.String>;
|
|
@@ -45,7 +47,7 @@ export declare const OpenapiOperation: Schema.Struct<{
|
|
|
45
47
|
/** The document's operationId, when it declares one. `kinds` overrides are keyed by it. */
|
|
46
48
|
readonly operationId: Schema.optionalKey<Schema.String>;
|
|
47
49
|
readonly description: Schema.String;
|
|
48
|
-
readonly method: Schema.Literals<readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]>;
|
|
50
|
+
readonly method: Schema.Literals<readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "QUERY"]>;
|
|
49
51
|
readonly path: Schema.String;
|
|
50
52
|
readonly baseUrl: Schema.String;
|
|
51
53
|
readonly openapi: Schema.String;
|
|
@@ -54,7 +56,8 @@ export declare const OpenapiOperation: Schema.Struct<{
|
|
|
54
56
|
readonly request: Schema.Struct<{
|
|
55
57
|
readonly parameters: Schema.$Array<Schema.Struct<{
|
|
56
58
|
readonly name: Schema.String;
|
|
57
|
-
|
|
59
|
+
/** OpenAPI 3.2's `querystring` is the whole query string, serialized from one `content` value. */
|
|
60
|
+
readonly in: Schema.Literals<readonly ["path", "query", "querystring", "header", "cookie"]>;
|
|
58
61
|
readonly required: Schema.optionalKey<Schema.Boolean>;
|
|
59
62
|
readonly schema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
60
63
|
readonly style: Schema.optionalKey<Schema.String>;
|
|
@@ -75,6 +78,8 @@ export declare const OpenapiOperation: Schema.Struct<{
|
|
|
75
78
|
}>;
|
|
76
79
|
/** Streams remain in the metadata but cannot run through a single-result tool call. */
|
|
77
80
|
readonly streaming: Schema.optionalKey<Schema.Literal<true>>;
|
|
81
|
+
/** The operation's OpenAPI tags, shown to agents as labels within its router. */
|
|
82
|
+
readonly tags: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
|
|
78
83
|
readonly input: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
79
84
|
readonly outputSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
80
85
|
readonly errorResponses: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
@@ -90,6 +95,8 @@ export declare const OpenapiOperation: Schema.Struct<{
|
|
|
90
95
|
}>>>;
|
|
91
96
|
}>;
|
|
92
97
|
export type OpenapiOperation = typeof OpenapiOperation.Type;
|
|
98
|
+
/** Safe methods, whose operations are queries unless `kinds` says otherwise. QUERY is OpenAPI 3.2's. */
|
|
99
|
+
export declare const isOpenapiReadMethod: (method: OpenapiOperation["method"]) => method is "GET" | "HEAD" | "OPTIONS" | "QUERY";
|
|
93
100
|
/** Map a selected account field to one Swagger credential value. */
|
|
94
101
|
export declare const CredentialBinding: Schema.Struct<{
|
|
95
102
|
readonly scheme: Schema.String;
|
|
@@ -123,7 +130,7 @@ export declare const OpenapiToolsOptions: Schema.Struct<{
|
|
|
123
130
|
/** The document's operationId, when it declares one. `kinds` overrides are keyed by it. */
|
|
124
131
|
readonly operationId: Schema.optionalKey<Schema.String>;
|
|
125
132
|
readonly description: Schema.String;
|
|
126
|
-
readonly method: Schema.Literals<readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]>;
|
|
133
|
+
readonly method: Schema.Literals<readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "QUERY"]>;
|
|
127
134
|
readonly path: Schema.String;
|
|
128
135
|
readonly baseUrl: Schema.String;
|
|
129
136
|
readonly openapi: Schema.String;
|
|
@@ -132,7 +139,8 @@ export declare const OpenapiToolsOptions: Schema.Struct<{
|
|
|
132
139
|
readonly request: Schema.Struct<{
|
|
133
140
|
readonly parameters: Schema.$Array<Schema.Struct<{
|
|
134
141
|
readonly name: Schema.String;
|
|
135
|
-
|
|
142
|
+
/** OpenAPI 3.2's `querystring` is the whole query string, serialized from one `content` value. */
|
|
143
|
+
readonly in: Schema.Literals<readonly ["path", "query", "querystring", "header", "cookie"]>;
|
|
136
144
|
readonly required: Schema.optionalKey<Schema.Boolean>;
|
|
137
145
|
readonly schema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
138
146
|
readonly style: Schema.optionalKey<Schema.String>;
|
|
@@ -153,6 +161,8 @@ export declare const OpenapiToolsOptions: Schema.Struct<{
|
|
|
153
161
|
}>;
|
|
154
162
|
/** Streams remain in the metadata but cannot run through a single-result tool call. */
|
|
155
163
|
readonly streaming: Schema.optionalKey<Schema.Literal<true>>;
|
|
164
|
+
/** The operation's OpenAPI tags, shown to agents as labels within its router. */
|
|
165
|
+
readonly tags: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
|
|
156
166
|
readonly input: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
157
167
|
readonly outputSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
158
168
|
readonly errorResponses: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
@@ -197,11 +207,32 @@ export type OpenapiToolsOptions = Omit<typeof OpenapiToolsOptions.Type, "operati
|
|
|
197
207
|
readonly operations: unknown;
|
|
198
208
|
readonly definitions?: unknown;
|
|
199
209
|
};
|
|
210
|
+
/** The operation a failed call addressed: its method and templated path, never parameter values. */
|
|
211
|
+
export declare const OpenapiFailedOperation: Schema.Struct<{
|
|
212
|
+
readonly method: Schema.Literals<readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "QUERY"]>;
|
|
213
|
+
readonly path: Schema.String;
|
|
214
|
+
}>;
|
|
215
|
+
export type OpenapiFailedOperation = typeof OpenapiFailedOperation.Type;
|
|
216
|
+
/** A response media type without parameters, such as `text/html`. */
|
|
217
|
+
export declare const OpenapiMediaType: Schema.String;
|
|
200
218
|
declare const OpenapiError_base: Schema.Class<OpenapiError, Schema.TaggedStruct<"OpenapiError", {
|
|
201
219
|
readonly reason: Schema.Literals<readonly ["invalid_definition", "invalid_input", "request"]>;
|
|
202
220
|
readonly status: Schema.optional<Schema.Number>;
|
|
221
|
+
/** Absent only when the definition itself could not be read. */
|
|
222
|
+
readonly operation: Schema.optional<Schema.Struct<{
|
|
223
|
+
readonly method: Schema.Literals<readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "QUERY"]>;
|
|
224
|
+
readonly path: Schema.String;
|
|
225
|
+
}>>;
|
|
226
|
+
readonly contentType: Schema.optional<Schema.String>;
|
|
227
|
+
/** The response's `content-length`, when it declared one. */
|
|
228
|
+
readonly bytes: Schema.optional<Schema.Int>;
|
|
203
229
|
}>, import("effect/Cause").YieldableError>;
|
|
204
|
-
/**
|
|
230
|
+
/**
|
|
231
|
+
* Safe failures omit request headers, credentials and upstream body text: the failure message is
|
|
232
|
+
* also recorded in traces. A `request` failure with a status names the response that no declared
|
|
233
|
+
* error matched, or the success response whose body could not be read, by its media type and
|
|
234
|
+
* declared length.
|
|
235
|
+
*/
|
|
205
236
|
export declare class OpenapiError extends OpenapiError_base {
|
|
206
237
|
}
|
|
207
238
|
/** An ordinary native tool bound to one selected account. */
|
|
@@ -210,7 +241,7 @@ export interface OpenapiTool {
|
|
|
210
241
|
readonly readOnly: boolean;
|
|
211
242
|
readonly outputSchema?: JsonObject;
|
|
212
243
|
readonly input: Schema.Decoder<Schema.Json>;
|
|
213
|
-
readonly run: (context: unknown, input: Schema.Json) => Effect.Effect<unknown, OpenapiError | OpenapiResponseError | ProviderError>;
|
|
244
|
+
readonly run: (context: unknown, input: Schema.Json) => Effect.Effect<unknown, OpenapiError | OpenapiResponseError | ProviderError | NetworkRefused>;
|
|
214
245
|
}
|
|
215
246
|
/** Executable operations keyed by their generated names. */
|
|
216
247
|
export type OpenapiTools = Readonly<Record<string, OpenapiTool>>;
|
|
@@ -219,7 +250,12 @@ export declare const defaultOpenapiResponseLimits: {
|
|
|
219
250
|
readonly maxBodyBytes: 16777216;
|
|
220
251
|
readonly readTimeoutMs: 30000;
|
|
221
252
|
};
|
|
222
|
-
/**
|
|
253
|
+
/**
|
|
254
|
+
* A sequence of JSON values, one per line or record: NDJSON, JSON Lines and `json-seq`, whose
|
|
255
|
+
* items OpenAPI 3.2 describes with `itemSchema`. The body is not one JSON value.
|
|
256
|
+
*/
|
|
257
|
+
export declare const isOpenapiJsonSequence: (type: string) => boolean;
|
|
258
|
+
/** Media returned as text rather than a base64 file. JSON sequences remain unparsed text. */
|
|
223
259
|
export declare const isOpenapiTextMedia: (type: string) => boolean;
|
|
224
260
|
/** A form field that carries raw file bytes: OpenAPI 3.1 `contentMediaType` without an
|
|
225
261
|
* encoding, or the `format: binary` string that 3.1 documents still commonly use. */
|
|
@@ -227,5 +263,5 @@ export declare const isOpenapiFileSchema: (shape: Readonly<Record<string, unknow
|
|
|
227
263
|
/** JSON-safe binary result, independent of the host's file storage. */
|
|
228
264
|
export declare const openapiBinaryResultSchema: JsonObject;
|
|
229
265
|
/** Classify request media for JSON-safe tool arguments; Swagger owns wire serialization. */
|
|
230
|
-
export declare const openapiMediaKind: (type: string) => "form" | "
|
|
266
|
+
export declare const openapiMediaKind: (type: string) => "form" | "json" | "binary" | "multipart" | "text";
|
|
231
267
|
export {};
|
|
@@ -17,14 +17,13 @@ export interface AppOperation<Input = unknown, Output = unknown> {
|
|
|
17
17
|
readonly annotations?: ToolAnnotations;
|
|
18
18
|
readonly _meta?: JsonObject;
|
|
19
19
|
readonly input: Schema.Decoder<Input>;
|
|
20
|
+
/** Checks every value `run` returns and is the output schema the operation is described with. */
|
|
20
21
|
readonly output?: Schema.Decoder<Output>;
|
|
21
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* An upstream protocol's description of the value `run` returns, used only when `output` is
|
|
24
|
+
* absent. The host does not check it, so declare `output` when the result can be checked.
|
|
25
|
+
*/
|
|
22
26
|
readonly outputSchema?: JsonObject;
|
|
23
27
|
readonly approval?: Approval<Input>;
|
|
24
28
|
readonly run: (context: OperationContext, input: Input) => Effect.Effect<Output, unknown>;
|
|
25
29
|
}
|
|
26
|
-
/** Agent tool names carry the operation kind; catalogs may reuse the same local name. */
|
|
27
|
-
export declare const OperationToolPrefixes: {
|
|
28
|
-
readonly query: "queries.";
|
|
29
|
-
readonly mutate: "mutations.";
|
|
30
|
-
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The host protocol this framework speaks. It is written into `runtime.json` and every host
|
|
3
|
-
* snapshot. Released protocols are frozen: see `protocols/
|
|
3
|
+
* snapshot. Released protocols are frozen: see `protocols/8.ts` and notes/apps-publishing.md.
|
|
4
4
|
* This file has no imports so the package build script can read it directly.
|
|
5
5
|
*/
|
|
6
|
-
export declare const frameworkProtocol =
|
|
6
|
+
export declare const frameworkProtocol = 8;
|