apps 0.0.1-beta.6 → 0.0.1-beta.60
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 +24 -21
- package/framework-reference.json +1 -1
- package/js/{chunk-ECQFRCH4.js → chunk-2ARGIHVD.js} +4 -3
- package/js/chunk-5FHWNLCI.js +88 -0
- package/js/{chunk-M3B3DE4K.js → chunk-74YVXBKY.js} +463 -218
- package/js/{chunk-NKLWZJLE.js → chunk-AQU56EPI.js} +9 -5
- package/js/chunk-CDXQDN7W.js +92 -0
- package/js/{chunk-ITM77QPO.js → chunk-CWW7QWP4.js} +126 -31
- package/js/{chunk-UK573G7W.js → chunk-EOPQ727L.js} +87 -51
- package/js/chunk-ERJ5JGCB.js +266 -0
- package/js/{chunk-RJDDBDSN.js → chunk-FFSO3J76.js} +633 -89
- package/js/{chunk-27F7W2LG.js → chunk-H2CJWXA3.js} +2 -2
- package/js/{chunk-JU7VHODU.js → chunk-H72MEDMN.js} +65 -10
- package/js/{chunk-CDL5PM2Q.js → chunk-IFJU5SYQ.js} +19082 -18402
- package/js/{chunk-RFVIONFX.js → chunk-IJ6Y2KFQ.js} +79 -41
- package/js/{chunk-T7GKZBLP.js → chunk-JIU25DIL.js} +67 -55
- package/js/{chunk-VFZKSM3T.js → chunk-JPEUKEV4.js} +3 -3
- package/js/{chunk-5T57N25Q.js → chunk-KGCTYL2S.js} +511 -63
- package/js/{chunk-KUMBKVJD.js → chunk-KLYSEHUD.js} +2 -2
- package/js/chunk-MRV45IXB.js +340 -0
- package/js/chunk-MWKHKOTL.js +240 -0
- package/js/{chunk-SB4HEPNJ.js → chunk-MZNCLCGJ.js} +883 -189
- package/js/chunk-NS3DEHVA.js +49 -0
- package/js/chunk-OD3KFKZD.js +1617 -0
- package/js/{chunk-57RKNWL2.js → chunk-PD6I2SDG.js} +4 -4
- package/js/chunk-T53665H5.js +171 -0
- package/js/{chunk-B3EOZTK3.js → chunk-TLWLJ7PD.js} +2227 -453
- package/js/{chunk-IJX4CYZO.js → chunk-TUMGL2OC.js} +228 -264
- package/js/{chunk-IPI4MFSN.js → chunk-XBG7HHXC.js} +2 -2
- package/js/{chunk-MNMNLXBL.js → chunk-ZYTA5MK4.js} +316 -69
- package/js/client.js +142 -94
- package/js/contracts.js +103 -26
- package/js/effect.js +19 -19
- package/js/{es-APDZKREY.js → es-DIULA3ZF.js} +62 -1659
- package/js/graphql.js +50 -40
- package/js/host.js +83 -58
- package/js/index.js +90 -61
- package/js/mcp/effect.js +23 -21
- package/js/mcp/stdio.js +44 -34
- package/js/mcp.js +76 -53
- package/js/openapi.js +4050 -1354
- package/js/react.js +2 -3
- package/js/skills/effect.js +6 -3
- package/js/skills.js +208 -81
- package/js/storage/facet.js +1 -540
- 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 +8517 -214
- package/package.json +2 -3
- package/runtime.json +1 -1
- package/types/app-cache/src/index.d.ts +10 -1
- package/types/apps/src/contracts/api-response-error.d.ts +4 -0
- package/types/apps/src/contracts/app.d.ts +7 -3
- package/types/apps/src/contracts/cache.d.ts +20 -0
- package/types/apps/src/contracts/context.d.ts +19 -11
- package/types/apps/src/contracts/elicitation.d.ts +6 -6
- package/types/apps/src/contracts/events.d.ts +93 -0
- package/types/apps/src/contracts/failure.d.ts +30 -1
- package/types/apps/src/contracts/graphql.d.ts +2 -1
- package/types/apps/src/contracts/host.d.ts +48 -13
- package/types/apps/src/contracts/live.d.ts +2 -0
- package/types/apps/src/contracts/mcp.d.ts +80 -10
- package/types/apps/src/contracts/network.d.ts +84 -0
- package/types/apps/src/contracts/openapi-compile.d.ts +82 -3
- package/types/apps/src/contracts/openapi.d.ts +41 -9
- package/types/apps/src/contracts/operations.d.ts +8 -4
- package/types/apps/src/contracts/protocol-version.d.ts +2 -2
- package/types/apps/src/contracts/protocols/1.d.ts +733 -81
- package/types/apps/src/contracts/protocols/10.d.ts +1450 -0
- package/types/apps/src/contracts/protocols/2.d.ts +69 -26
- package/types/apps/src/contracts/protocols/3.d.ts +133 -33
- package/types/apps/src/contracts/protocols/4.d.ts +122 -45
- package/types/apps/src/contracts/protocols/5.d.ts +1200 -0
- package/types/apps/src/contracts/protocols/6.d.ts +1629 -0
- package/types/apps/src/contracts/protocols/7.d.ts +1785 -0
- package/types/apps/src/contracts/protocols/8.d.ts +1182 -0
- package/types/apps/src/contracts/protocols/9.d.ts +1104 -0
- package/types/apps/src/contracts/protocols/current.d.ts +2476 -0
- package/types/apps/src/contracts/protocols/oauth-6.d.ts +74 -0
- package/types/apps/src/contracts/protocols/oauth.d.ts +134 -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/skills.d.ts +50 -13
- package/types/apps/src/contracts/sql.d.ts +58 -0
- package/types/apps/src/contracts/ui.d.ts +19 -1
- package/types/apps/src/contracts/workflows.d.ts +6 -0
- package/types/apps/src/facet.d.ts +4 -5
- package/types/apps/src/host.d.ts +5 -0
- package/types/apps/src/implementation/account-router.d.ts +4 -3
- package/types/apps/src/implementation/authoring.d.ts +25 -5
- package/types/apps/src/implementation/browser-scripts.gen.d.ts +6 -0
- package/types/apps/src/implementation/cache.d.ts +4 -0
- package/types/apps/src/implementation/catalog-cache.d.ts +35 -4
- package/types/apps/src/implementation/elicitation.d.ts +18 -15
- package/types/apps/src/implementation/events.d.ts +59 -0
- package/types/apps/src/implementation/failure-detail.d.ts +25 -3
- package/types/apps/src/implementation/graphql-catalog.d.ts +3 -3
- package/types/apps/src/implementation/graphql.d.ts +4 -3
- package/types/apps/src/implementation/input-problems.d.ts +6 -2
- package/types/apps/src/implementation/invocation-timing.d.ts +16 -0
- package/types/apps/src/implementation/live.d.ts +2 -2
- package/types/apps/src/implementation/mcp-call.d.ts +6 -5
- package/types/apps/src/implementation/mcp-catalog.d.ts +6 -4
- package/types/apps/src/implementation/mcp-client.d.ts +17 -9
- 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 +20 -9
- package/types/apps/src/implementation/network.d.ts +16 -0
- package/types/apps/src/implementation/openapi-compile.d.ts +26 -6
- package/types/apps/src/implementation/openapi-document.d.ts +46 -19
- 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 +18 -0
- package/types/apps/src/implementation/openapi-upgrade.d.ts +4 -0
- package/types/apps/src/implementation/operations.d.ts +17 -2
- package/types/apps/src/implementation/optimistic.d.ts +1 -1
- package/types/apps/src/implementation/protocol-operations.d.ts +3 -0
- 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/query-commit.d.ts +1 -1
- package/types/apps/src/implementation/router-catalog.d.ts +11 -13
- package/types/apps/src/implementation/router.d.ts +16 -5
- package/types/apps/src/implementation/runtime-yield.d.ts +7 -0
- package/types/apps/src/implementation/schema.d.ts +90 -10
- package/types/apps/src/implementation/skills.d.ts +18 -24
- package/types/apps/src/implementation/sql.d.ts +71 -0
- package/types/apps/src/implementation/ui-account-notice.d.ts +9 -0
- package/types/apps/src/implementation/ui-auth.d.ts +1 -1
- 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 +11 -5
- 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/workflows.d.ts +1 -1
- package/types/apps/src/index.d.ts +30 -12
- package/types/apps/src/mcp.d.ts +20 -1
- package/types/apps/src/openapi.d.ts +1 -1
- package/types/apps/src/react.d.ts +1 -1
- package/types/apps/src/skills.d.ts +10 -8
- package/types/telemetry/src/app-records.d.ts +42 -0
- package/types/telemetry/src/browser-operations.d.ts +7 -4
- package/types/telemetry/src/browser.d.ts +8 -3
- package/types/telemetry/src/config.d.ts +2 -2
- package/types/telemetry/src/index.d.ts +1 -0
- package/types/telemetry/src/layer.d.ts +2 -2
- package/types/telemetry/src/ownership.d.ts +56 -0
- package/types/telemetry/src/recorded-failure.d.ts +29 -0
- package/types/telemetry/src/relay.d.ts +11 -3
- package/types/telemetry/src/transport.d.ts +8 -1
- package/types/utils/src/api-error.d.ts +55 -0
- package/types/utils/src/connection-failure.d.ts +33 -0
- package/types/utils/src/recorded-message.d.ts +18 -0
- package/types/utils/src/user-facing-error.d.ts +83 -0
- package/js/chunk-6BSSI67S.js +0 -224
- package/js/chunk-MKWZPDR6.js +0 -63
- package/js/chunk-N7YDVXYJ.js +0 -186
- package/js/chunk-OE3QQTSB.js +0 -222
- package/js/chunk-PJJ24GU7.js +0 -877
- package/js/chunk-PZB6T6KU.js +0 -19
- package/js/chunk-R3EV5FTO.js +0 -97
- package/js/chunk-ZQINWV4W.js +0 -630
- package/types/app-data/src/implementation/cursor.d.ts +0 -10
- package/types/app-data/src/implementation/index-key.d.ts +0 -7
- package/types/app-data/src/implementation/promise.d.ts +0 -68
- package/types/app-data/src/implementation/range.d.ts +0 -8
- package/types/app-data/src/implementation/schema.d.ts +0 -18
- package/types/app-data/src/implementation/sqlite.d.ts +0 -11
- package/types/app-data/src/index.d.ts +0 -4
- package/types/apps/src/contracts/storage.d.ts +0 -68
- package/types/apps/src/implementation/storage.d.ts +0 -15
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What app code sees when Executor's app network refuses a request, and the fetch options the
|
|
3
|
+
* app runtime accepts. A refusal is Executor's decision, not the service's: the request never
|
|
4
|
+
* left Executor. App code runs on workerd, Cloudflare's runtime, on every host.
|
|
5
|
+
*/
|
|
6
|
+
import { Schema } from "effect";
|
|
7
|
+
/**
|
|
8
|
+
* Why Executor's app network refused a request.
|
|
9
|
+
* - `private_address`: the destination is a private, loopback or internal address, and this
|
|
10
|
+
* instance lets apps reach only public addresses.
|
|
11
|
+
* - `credential_host`: the request carries a credential handle, and its provider does not allow
|
|
12
|
+
* the destination host.
|
|
13
|
+
* - `credential_app`: the request carries a credential handle that is not valid for this app.
|
|
14
|
+
* - `credential_expired`: the request carries an expired credential handle.
|
|
15
|
+
*/
|
|
16
|
+
export declare const NetworkRefusal: Schema.Union<readonly [Schema.Struct<{
|
|
17
|
+
readonly reason: Schema.Literal<"private_address">;
|
|
18
|
+
}>, Schema.Struct<{
|
|
19
|
+
readonly reason: Schema.Literal<"credential_host">;
|
|
20
|
+
/** The provider of the credential handle the request carried. */
|
|
21
|
+
readonly provider: Schema.String;
|
|
22
|
+
/** The hosts that provider's credentials may reach; empty when it declares none. */
|
|
23
|
+
readonly allowedHosts: Schema.$Array<Schema.String>;
|
|
24
|
+
}>, Schema.Struct<{
|
|
25
|
+
readonly reason: Schema.Literal<"credential_app">;
|
|
26
|
+
}>, Schema.Struct<{
|
|
27
|
+
readonly reason: Schema.Literal<"credential_expired">;
|
|
28
|
+
/** The provider of the expired credential handle. */
|
|
29
|
+
readonly provider: Schema.String;
|
|
30
|
+
}>]>;
|
|
31
|
+
export type NetworkRefusal = typeof NetworkRefusal.Type;
|
|
32
|
+
declare const NetworkRefused_base: Schema.Class<NetworkRefused, Schema.TaggedStruct<"NetworkRefused", {
|
|
33
|
+
/** The refused destination, with its port when the URL names one. */
|
|
34
|
+
readonly host: Schema.String;
|
|
35
|
+
readonly refusal: Schema.Union<readonly [Schema.Struct<{
|
|
36
|
+
readonly reason: Schema.Literal<"private_address">;
|
|
37
|
+
}>, Schema.Struct<{
|
|
38
|
+
readonly reason: Schema.Literal<"credential_host">;
|
|
39
|
+
/** The provider of the credential handle the request carried. */
|
|
40
|
+
readonly provider: Schema.String;
|
|
41
|
+
/** The hosts that provider's credentials may reach; empty when it declares none. */
|
|
42
|
+
readonly allowedHosts: Schema.$Array<Schema.String>;
|
|
43
|
+
}>, Schema.Struct<{
|
|
44
|
+
readonly reason: Schema.Literal<"credential_app">;
|
|
45
|
+
}>, Schema.Struct<{
|
|
46
|
+
readonly reason: Schema.Literal<"credential_expired">;
|
|
47
|
+
/** The provider of the expired credential handle. */
|
|
48
|
+
readonly provider: Schema.String;
|
|
49
|
+
}>]>;
|
|
50
|
+
}>, import("effect/Cause").YieldableError>;
|
|
51
|
+
/** Executor's app network refused a request before it reached the service. */
|
|
52
|
+
export declare class NetworkRefused extends NetworkRefused_base {
|
|
53
|
+
get message(): string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A refusal reaches app code as a response with this status and header. The header holds the
|
|
57
|
+
* encoded `NetworkRefused`, so it survives responses without a body, such as to `HEAD`; the
|
|
58
|
+
* body repeats it as JSON with its message. `ctx.fetch` and the framework's protocol helpers
|
|
59
|
+
* raise it as `NetworkRefused`; the platform's global `fetch` returns the response. Only
|
|
60
|
+
* Executor's app network sets the mark: it removes the header from a service's 421 response.
|
|
61
|
+
*/
|
|
62
|
+
export declare const networkRefusalStatus = 421;
|
|
63
|
+
export declare const networkRefusalHeader = "x-executor-refused";
|
|
64
|
+
/** The header's value: the refusal as JSON, URI-encoded so any provider name fits in a header. */
|
|
65
|
+
export declare const NetworkRefusedHeader: Schema.compose<Schema.fromJsonString<typeof NetworkRefused>, Schema.StringFromUriComponent>;
|
|
66
|
+
/** The response Executor's app network returns in place of a request it refused. */
|
|
67
|
+
export declare const networkRefusalResponse: (refused: NetworkRefused) => Response;
|
|
68
|
+
/** RequestInit options the app runtime restricts. */
|
|
69
|
+
export declare const RestrictedFetchOption: Schema.Literals<readonly ["redirect", "cache", "integrity"]>;
|
|
70
|
+
export type RestrictedFetchOption = typeof RestrictedFetchOption.Type;
|
|
71
|
+
/** The values the app runtime accepts for each restricted option. */
|
|
72
|
+
export declare const supportedFetchOptions: Readonly<Record<RestrictedFetchOption, ReadonlyArray<string>>>;
|
|
73
|
+
declare const FetchOptionUnsupported_base: Schema.Class<FetchOptionUnsupported, Schema.TaggedStruct<"FetchOptionUnsupported", {
|
|
74
|
+
readonly option: Schema.Literals<readonly ["redirect", "cache", "integrity"]>;
|
|
75
|
+
readonly value: Schema.String;
|
|
76
|
+
readonly supported: Schema.$Array<Schema.String>;
|
|
77
|
+
}>, import("effect/Cause").YieldableError>;
|
|
78
|
+
/** `ctx.fetch` was given a standard RequestInit value the app runtime does not implement. */
|
|
79
|
+
export declare class FetchOptionUnsupported extends FetchOptionUnsupported_base {
|
|
80
|
+
get message(): string;
|
|
81
|
+
/** What to do instead, when the standard value has an equivalent the runtime supports. */
|
|
82
|
+
private get advice();
|
|
83
|
+
}
|
|
84
|
+
export {};
|
|
@@ -1,11 +1,90 @@
|
|
|
1
1
|
/** Shared OpenAPI compilation diagnostics. */
|
|
2
2
|
import { Schema } from "effect";
|
|
3
|
-
|
|
3
|
+
/** Which part of an OpenAPI document could not be compiled into tools. */
|
|
4
|
+
export declare const OpenapiCompileErrorCode: Schema.Literals<readonly ["server_protocol", "server_url", "external_reference", "circular_reference", "schema_keyword", "schema_reference", "missing_component", "openapi_version", "auth_helper", "auth_missing", "operation_path", "operation_method", "duplicate_operation", "server_missing", "multiple_hosts", "parameter_encoding", "parameter_style", "request_body", "combined_oauth", "auth_method", "event_stream", "input_schema", "no_operations", "no_supported_operations", "invalid_document", "source_generation", "authoring_reference"]>;
|
|
5
|
+
/** A declared operation the importer left out, and why. */
|
|
6
|
+
export declare const OpenapiSkippedOperation: Schema.Struct<{
|
|
7
|
+
/** The tool name the operation would have; reading that tool reports why it is missing. */
|
|
8
|
+
readonly name: Schema.String;
|
|
9
|
+
/** The HTTP method, such as `GET`. */
|
|
10
|
+
readonly method: Schema.String;
|
|
11
|
+
/** The path as the definition declares it. */
|
|
12
|
+
readonly path: Schema.String;
|
|
13
|
+
readonly code: Schema.Literals<readonly ["server_protocol", "server_url", "external_reference", "circular_reference", "schema_keyword", "schema_reference", "missing_component", "openapi_version", "auth_helper", "auth_missing", "operation_path", "operation_method", "duplicate_operation", "server_missing", "multiple_hosts", "parameter_encoding", "parameter_style", "request_body", "combined_oauth", "auth_method", "event_stream", "input_schema", "no_operations", "no_supported_operations", "invalid_document", "source_generation", "authoring_reference"]>;
|
|
14
|
+
readonly reason: Schema.String;
|
|
15
|
+
}>;
|
|
16
|
+
export type OpenapiSkippedOperation = typeof OpenapiSkippedOperation.Type;
|
|
4
17
|
declare const OpenapiCompileError_base: Schema.Class<OpenapiCompileError, Schema.TaggedStruct<"OpenapiCompileError", {
|
|
5
|
-
readonly code: Schema.Literals<readonly ["server_protocol", "server_url", "external_reference", "circular_reference", "schema_keyword", "schema_reference", "missing_component", "openapi_version", "auth_helper", "auth_missing", "operation_path", "duplicate_operation", "server_missing", "multiple_hosts", "parameter_encoding", "parameter_style", "request_body", "combined_oauth", "auth_method", "input_schema", "no_operations", "no_supported_operations", "invalid_document", "source_generation", "authoring_reference"]>;
|
|
18
|
+
readonly code: Schema.Literals<readonly ["server_protocol", "server_url", "external_reference", "circular_reference", "schema_keyword", "schema_reference", "missing_component", "openapi_version", "auth_helper", "auth_missing", "operation_path", "operation_method", "duplicate_operation", "server_missing", "multiple_hosts", "parameter_encoding", "parameter_style", "request_body", "combined_oauth", "auth_method", "event_stream", "input_schema", "no_operations", "no_supported_operations", "invalid_document", "source_generation", "authoring_reference"]>;
|
|
6
19
|
readonly reason: Schema.String;
|
|
20
|
+
readonly skipped: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
21
|
+
/** The tool name the operation would have; reading that tool reports why it is missing. */
|
|
22
|
+
readonly name: Schema.String;
|
|
23
|
+
/** The HTTP method, such as `GET`. */
|
|
24
|
+
readonly method: Schema.String;
|
|
25
|
+
/** The path as the definition declares it. */
|
|
26
|
+
readonly path: Schema.String;
|
|
27
|
+
readonly code: Schema.Literals<readonly ["server_protocol", "server_url", "external_reference", "circular_reference", "schema_keyword", "schema_reference", "missing_component", "openapi_version", "auth_helper", "auth_missing", "operation_path", "operation_method", "duplicate_operation", "server_missing", "multiple_hosts", "parameter_encoding", "parameter_style", "request_body", "combined_oauth", "auth_method", "event_stream", "input_schema", "no_operations", "no_supported_operations", "invalid_document", "source_generation", "authoring_reference"]>;
|
|
28
|
+
readonly reason: Schema.String;
|
|
29
|
+
}>>>;
|
|
30
|
+
readonly origins: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
7
31
|
}>, import("effect/Cause").YieldableError>;
|
|
8
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* A safe generation failure. `reason` explains the cause; `skipped` lists the declared operations
|
|
34
|
+
* it left out and why, and `origins` the origins operations resolve to when none of them matches
|
|
35
|
+
* the allowed origin. Reading one left-out tool fails with this error for that operation alone.
|
|
36
|
+
*/
|
|
9
37
|
export declare class OpenapiCompileError extends OpenapiCompileError_base {
|
|
38
|
+
get message(): string;
|
|
10
39
|
}
|
|
40
|
+
/** A tool a generated OpenAPI router exposes, read from the definition alone. */
|
|
41
|
+
export declare const OpenapiToolName: Schema.Struct<{
|
|
42
|
+
/** The tool name relative to the router, as `withApprovals` receives it. */
|
|
43
|
+
readonly name: Schema.String;
|
|
44
|
+
/** The HTTP method, such as `GET`. */
|
|
45
|
+
readonly method: Schema.String;
|
|
46
|
+
/** The request path, including any `pathPrefix`. */
|
|
47
|
+
readonly path: Schema.String;
|
|
48
|
+
readonly operationId: Schema.optionalKey<Schema.String>;
|
|
49
|
+
/** After `kinds` (keyed by `operationId`, else `name`); otherwise reading methods are queries. */
|
|
50
|
+
readonly kind: Schema.Literals<readonly ["query", "mutation"]>;
|
|
51
|
+
/** Callable without credentials, so every account and a router without one expose it. */
|
|
52
|
+
readonly public: Schema.Boolean;
|
|
53
|
+
/** The `methods` and `oauth` entries whose accounts expose it. */
|
|
54
|
+
readonly methods: Schema.$Array<Schema.String>;
|
|
55
|
+
}>;
|
|
56
|
+
export type OpenapiToolName = typeof OpenapiToolName.Type;
|
|
57
|
+
/** Every tool a definition yields for some account, and the operations the compiler left out. */
|
|
58
|
+
export declare const OpenapiToolNames: Schema.Struct<{
|
|
59
|
+
readonly tools: Schema.$Array<Schema.Struct<{
|
|
60
|
+
/** The tool name relative to the router, as `withApprovals` receives it. */
|
|
61
|
+
readonly name: Schema.String;
|
|
62
|
+
/** The HTTP method, such as `GET`. */
|
|
63
|
+
readonly method: Schema.String;
|
|
64
|
+
/** The request path, including any `pathPrefix`. */
|
|
65
|
+
readonly path: Schema.String;
|
|
66
|
+
readonly operationId: Schema.optionalKey<Schema.String>;
|
|
67
|
+
/** After `kinds` (keyed by `operationId`, else `name`); otherwise reading methods are queries. */
|
|
68
|
+
readonly kind: Schema.Literals<readonly ["query", "mutation"]>;
|
|
69
|
+
/** Callable without credentials, so every account and a router without one expose it. */
|
|
70
|
+
readonly public: Schema.Boolean;
|
|
71
|
+
/** The `methods` and `oauth` entries whose accounts expose it. */
|
|
72
|
+
readonly methods: Schema.$Array<Schema.String>;
|
|
73
|
+
}>>;
|
|
74
|
+
/**
|
|
75
|
+
* Operations the compiler left out, and why. An operation it imports but no configured `methods`
|
|
76
|
+
* or `oauth` entry can authorize is missing from `tools` and is not listed here.
|
|
77
|
+
*/
|
|
78
|
+
readonly skipped: Schema.$Array<Schema.Struct<{
|
|
79
|
+
/** The tool name the operation would have; reading that tool reports why it is missing. */
|
|
80
|
+
readonly name: Schema.String;
|
|
81
|
+
/** The HTTP method, such as `GET`. */
|
|
82
|
+
readonly method: Schema.String;
|
|
83
|
+
/** The path as the definition declares it. */
|
|
84
|
+
readonly path: Schema.String;
|
|
85
|
+
readonly code: Schema.Literals<readonly ["server_protocol", "server_url", "external_reference", "circular_reference", "schema_keyword", "schema_reference", "missing_component", "openapi_version", "auth_helper", "auth_missing", "operation_path", "operation_method", "duplicate_operation", "server_missing", "multiple_hosts", "parameter_encoding", "parameter_style", "request_body", "combined_oauth", "auth_method", "event_stream", "input_schema", "no_operations", "no_supported_operations", "invalid_document", "source_generation", "authoring_reference"]>;
|
|
86
|
+
readonly reason: Schema.String;
|
|
87
|
+
}>>;
|
|
88
|
+
}>;
|
|
89
|
+
export type OpenapiToolNames = typeof OpenapiToolNames.Type;
|
|
11
90
|
export {};
|
|
@@ -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>;
|
|
@@ -92,6 +95,8 @@ export declare const OpenapiOperation: Schema.Struct<{
|
|
|
92
95
|
}>>>;
|
|
93
96
|
}>;
|
|
94
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 "HEAD" | "GET" | "OPTIONS" | "QUERY";
|
|
95
100
|
/** Map a selected account field to one Swagger credential value. */
|
|
96
101
|
export declare const CredentialBinding: Schema.Struct<{
|
|
97
102
|
readonly scheme: Schema.String;
|
|
@@ -125,7 +130,7 @@ export declare const OpenapiToolsOptions: Schema.Struct<{
|
|
|
125
130
|
/** The document's operationId, when it declares one. `kinds` overrides are keyed by it. */
|
|
126
131
|
readonly operationId: Schema.optionalKey<Schema.String>;
|
|
127
132
|
readonly description: Schema.String;
|
|
128
|
-
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"]>;
|
|
129
134
|
readonly path: Schema.String;
|
|
130
135
|
readonly baseUrl: Schema.String;
|
|
131
136
|
readonly openapi: Schema.String;
|
|
@@ -134,7 +139,8 @@ export declare const OpenapiToolsOptions: Schema.Struct<{
|
|
|
134
139
|
readonly request: Schema.Struct<{
|
|
135
140
|
readonly parameters: Schema.$Array<Schema.Struct<{
|
|
136
141
|
readonly name: Schema.String;
|
|
137
|
-
|
|
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"]>;
|
|
138
144
|
readonly required: Schema.optionalKey<Schema.Boolean>;
|
|
139
145
|
readonly schema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
140
146
|
readonly style: Schema.optionalKey<Schema.String>;
|
|
@@ -201,11 +207,32 @@ export type OpenapiToolsOptions = Omit<typeof OpenapiToolsOptions.Type, "operati
|
|
|
201
207
|
readonly operations: unknown;
|
|
202
208
|
readonly definitions?: unknown;
|
|
203
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;
|
|
204
218
|
declare const OpenapiError_base: Schema.Class<OpenapiError, Schema.TaggedStruct<"OpenapiError", {
|
|
205
219
|
readonly reason: Schema.Literals<readonly ["invalid_definition", "invalid_input", "request"]>;
|
|
206
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>;
|
|
207
229
|
}>, import("effect/Cause").YieldableError>;
|
|
208
|
-
/**
|
|
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
|
+
*/
|
|
209
236
|
export declare class OpenapiError extends OpenapiError_base {
|
|
210
237
|
}
|
|
211
238
|
/** An ordinary native tool bound to one selected account. */
|
|
@@ -214,7 +241,7 @@ export interface OpenapiTool {
|
|
|
214
241
|
readonly readOnly: boolean;
|
|
215
242
|
readonly outputSchema?: JsonObject;
|
|
216
243
|
readonly input: Schema.Decoder<Schema.Json>;
|
|
217
|
-
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>;
|
|
218
245
|
}
|
|
219
246
|
/** Executable operations keyed by their generated names. */
|
|
220
247
|
export type OpenapiTools = Readonly<Record<string, OpenapiTool>>;
|
|
@@ -223,7 +250,12 @@ export declare const defaultOpenapiResponseLimits: {
|
|
|
223
250
|
readonly maxBodyBytes: 16777216;
|
|
224
251
|
readonly readTimeoutMs: 30000;
|
|
225
252
|
};
|
|
226
|
-
/**
|
|
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. */
|
|
227
259
|
export declare const isOpenapiTextMedia: (type: string) => boolean;
|
|
228
260
|
/** A form field that carries raw file bytes: OpenAPI 3.1 `contentMediaType` without an
|
|
229
261
|
* encoding, or the `format: binary` string that 3.1 documents still commonly use. */
|
|
@@ -231,5 +263,5 @@ export declare const isOpenapiFileSchema: (shape: Readonly<Record<string, unknow
|
|
|
231
263
|
/** JSON-safe binary result, independent of the host's file storage. */
|
|
232
264
|
export declare const openapiBinaryResultSchema: JsonObject;
|
|
233
265
|
/** Classify request media for JSON-safe tool arguments; Swagger owns wire serialization. */
|
|
234
|
-
export declare const openapiMediaKind: (type: string) => "form" | "
|
|
266
|
+
export declare const openapiMediaKind: (type: string) => "form" | "json" | "binary" | "multipart" | "text";
|
|
235
267
|
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/** Native operation declarations.
|
|
1
|
+
/** Native operation declarations. SQL access is an optional invocation capability. */
|
|
2
2
|
import type { Effect, Schema } from "effect";
|
|
3
3
|
import type { Approval } from "./approval.js";
|
|
4
4
|
import type { BoundContext, AccountSlots } from "./app.js";
|
|
5
|
-
import type {
|
|
5
|
+
import type { Sql, SqlReader } from "./sql.js";
|
|
6
6
|
import type { ToolAnnotations } from "./tools.js";
|
|
7
7
|
import type { JsonObject } from "./schema.js";
|
|
8
8
|
/** Host-bound operation capabilities; the author declaration refines accounts and storage. */
|
|
9
9
|
export type OperationContext = BoundContext<AccountSlots> & {
|
|
10
|
-
readonly
|
|
10
|
+
readonly sql?: SqlReader | Sql;
|
|
11
11
|
};
|
|
12
12
|
/** The host validates input, checks approval, then owns the transaction and output validation. */
|
|
13
13
|
export interface AppOperation<Input = unknown, Output = unknown> {
|
|
@@ -17,8 +17,12 @@ 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>;
|
|
@@ -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.
|
|
3
|
+
* snapshot. Its schemas are `protocols/current.ts`; released protocols are frozen. See 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 = 11;
|