apps 0.0.1-beta.0 → 0.0.1-beta.10
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 +145 -30
- package/framework-reference.json +1 -1
- package/js/browser-XIPJGLH2.js +65 -0
- package/js/{chunk-36DNRFZQ.js → chunk-27F7W2LG.js} +1 -1
- package/js/{chunk-VFUZI3NY.js → chunk-57RKNWL2.js} +4 -4
- package/js/{chunk-BPEFS4YF.js → chunk-5T57N25Q.js} +122 -18
- package/js/chunk-72JNVHPK.js +41 -0
- package/js/{chunk-2OTCEKL2.js → chunk-CDL5PM2Q.js} +2643 -1646
- package/js/{chunk-KWTCHVLT.js → chunk-CRDWFA74.js} +69 -54
- package/js/chunk-CZ7CSFO4.js +39 -0
- package/js/{chunk-WIDTG42X.js → chunk-EPT3ZP52.js} +79 -26
- package/js/chunk-FL2QR3XW.js +507 -0
- package/js/{chunk-3ANFZFCV.js → chunk-IJX4CYZO.js} +15 -18
- package/js/chunk-IPI4MFSN.js +78 -0
- package/js/chunk-JU7VHODU.js +104 -0
- package/js/chunk-KUMBKVJD.js +39 -0
- package/js/{chunk-YDR4CPJA.js → chunk-M3B3DE4K.js} +8 -8
- package/js/chunk-MKWZPDR6.js +63 -0
- package/js/{chunk-7JXHF5IF.js → chunk-N7YDVXYJ.js} +49 -1
- package/js/chunk-NKLWZJLE.js +172 -0
- package/js/{chunk-OWD2YICM.js → chunk-ODEIDRGW.js} +116 -88
- package/js/{chunk-D6BKYP2L.js → chunk-PJJ24GU7.js} +4 -4
- package/js/{chunk-EP6AEUZO.js → chunk-PZB6T6KU.js} +1 -1
- package/js/chunk-R3EV5FTO.js +97 -0
- package/js/chunk-RFVIONFX.js +189 -0
- package/js/{chunk-W7Q5EOTS.js → chunk-UK573G7W.js} +32 -32
- package/js/chunk-UVL56Z6E.js +6641 -0
- package/js/{chunk-Q2FD5IBM.js → chunk-V5KNQVCT.js} +505 -124
- package/js/{chunk-SBKHUC5L.js → chunk-VFZKSM3T.js} +5 -25
- package/js/{chunk-HP7E42X6.js → chunk-WLE7WX2U.js} +1158 -232
- package/js/{chunk-X3YBZCJW.js → chunk-YXQHV65J.js} +58 -62
- package/js/chunk-Z5M2LQOZ.js +209 -0
- package/js/{chunk-R6JMJSVT.js → chunk-ZQINWV4W.js} +60 -20
- package/js/client.js +11 -27
- package/js/contracts.js +138 -27
- package/js/effect.js +20 -15
- package/js/es-APDZKREY.js +40968 -0
- package/js/graphql.js +220 -123
- package/js/host.js +75 -19
- package/js/index.js +261 -117
- package/js/mcp/effect.js +24 -17
- package/js/mcp/stdio.js +26 -21
- package/js/mcp.js +127 -26
- package/js/openapi.js +3048 -150
- package/js/operations/approval.js +1 -1
- package/js/react.js +4 -4
- package/js/skills/effect.js +11 -0
- package/js/skills.js +893 -0
- package/js/storage/facet.js +7 -7
- package/js/ui/auth/contracts.js +9 -10
- package/js/ui/auth.js +17 -15
- package/js/ui/contracts.js +5 -5
- package/js/ui/serving.js +14 -13
- package/package.json +9 -1
- package/runtime.json +1 -1
- package/types/app-cache/src/contracts/cache.d.ts +119 -0
- package/types/app-cache/src/index.d.ts +93 -0
- 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 +43 -0
- package/types/apps/src/contracts/app.d.ts +16 -4
- package/types/apps/src/contracts/cache.d.ts +44 -0
- package/types/apps/src/contracts/dynamic-skills.d.ts +10 -0
- package/types/apps/src/contracts/failure.d.ts +25 -0
- package/types/apps/src/contracts/graphql.d.ts +18 -1
- package/types/apps/src/contracts/host.d.ts +76 -528
- package/types/apps/src/contracts/mcp.d.ts +19 -1
- package/types/apps/src/contracts/openapi-compile.d.ts +11 -0
- package/types/apps/src/contracts/openapi-document.d.ts +53 -0
- package/types/apps/src/contracts/openapi.d.ts +160 -30
- package/types/apps/src/contracts/operations.d.ts +0 -5
- package/types/apps/src/contracts/protocol-version.d.ts +6 -0
- package/types/apps/src/contracts/protocols/1.d.ts +1589 -0
- package/types/apps/src/contracts/protocols/2.d.ts +668 -0
- package/types/apps/src/contracts/protocols/3.d.ts +676 -0
- package/types/apps/src/contracts/protocols/4.d.ts +1229 -0
- package/types/apps/src/contracts/protocols/5.d.ts +1090 -0
- package/types/apps/src/contracts/provider-error.d.ts +15 -0
- package/types/apps/src/contracts/provider.d.ts +69 -6
- package/types/apps/src/contracts/router.d.ts +59 -0
- package/types/apps/src/contracts/skills.d.ts +122 -0
- package/types/apps/src/contracts/storage.d.ts +3 -3
- package/types/apps/src/contracts/swagger-client.d.ts +29 -0
- package/types/apps/src/contracts/ui-auth.d.ts +6 -14
- package/types/apps/src/contracts/workflows.d.ts +34 -3
- package/types/apps/src/graphql.d.ts +5 -7
- package/types/apps/src/host.d.ts +1 -0
- 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/cache-session.d.ts +7 -0
- package/types/apps/src/implementation/cache.d.ts +8 -0
- package/types/apps/src/implementation/catalog-cache.d.ts +36 -0
- package/types/apps/src/implementation/dynamic-skills.d.ts +7 -0
- package/types/apps/src/implementation/elicitation.d.ts +13 -13
- package/types/apps/src/implementation/failure-detail.d.ts +25 -0
- package/types/apps/src/implementation/git.d.ts +25 -0
- package/types/apps/src/implementation/graphql-catalog.d.ts +7 -0
- package/types/apps/src/implementation/graphql.d.ts +81 -3
- package/types/apps/src/implementation/inflate.d.ts +16 -0
- package/types/apps/src/implementation/input-problems.d.ts +3 -0
- package/types/apps/src/implementation/mcp-call.d.ts +3 -2
- package/types/apps/src/implementation/mcp-catalog.d.ts +9 -0
- package/types/apps/src/implementation/mcp-client.d.ts +39 -22
- package/types/apps/src/implementation/mcp-stdio.d.ts +1 -1
- package/types/apps/src/implementation/mcp-tools.d.ts +6 -3
- package/types/apps/src/implementation/mcp.d.ts +55 -2
- package/types/apps/src/implementation/openapi-compile.d.ts +120 -0
- package/types/apps/src/implementation/openapi-document.d.ts +51 -0
- package/types/apps/src/implementation/openapi-names.d.ts +18 -0
- package/types/apps/src/implementation/openapi-request.d.ts +10 -4
- package/types/apps/src/implementation/openapi-source.d.ts +36 -0
- package/types/apps/src/implementation/openapi.d.ts +39 -3
- package/types/apps/src/implementation/operations.d.ts +26 -3
- package/types/apps/src/implementation/protocol-operations.d.ts +3 -4
- package/types/apps/src/implementation/provider-error.d.ts +10 -0
- package/types/apps/src/implementation/provider.d.ts +9 -4
- package/types/apps/src/implementation/router-catalog.d.ts +225 -0
- package/types/apps/src/implementation/router.d.ts +59 -0
- package/types/apps/src/implementation/schema.d.ts +11 -6
- package/types/apps/src/implementation/skill-files.d.ts +10 -0
- package/types/apps/src/implementation/skills.d.ts +43 -0
- package/types/apps/src/implementation/storage.d.ts +5 -3
- package/types/apps/src/implementation/swagger-client.d.ts +28 -0
- package/types/apps/src/implementation/ui-auth.d.ts +11 -5
- package/types/apps/src/implementation/ui-serving.d.ts +4 -2
- 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 +11 -3
- package/types/apps/src/mcp-stdio.d.ts +2 -5
- package/types/apps/src/mcp.d.ts +8 -7
- package/types/apps/src/openapi.d.ts +8 -6
- package/types/apps/src/skills.d.ts +75 -0
- package/types/apps/src/ui-auth.d.ts +2 -2
- package/types/telemetry/src/browser-operations.d.ts +5 -2
- package/types/telemetry/src/config.d.ts +2 -0
- package/js/chunk-22WRQZT7.js +0 -389
- package/js/chunk-BKVL7XAJ.js +0 -47
- package/js/chunk-C24KEZXR.js +0 -59
- package/js/chunk-LOKGDT6B.js +0 -28
- package/js/chunk-MLKGABMK.js +0 -9
- package/types/apps/src/implementation/account-operations.d.ts +0 -32
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ProviderError } from "./provider-error.js";
|
|
1
2
|
/** MCP protocol data uses Effect Schema; executable tool methods use Effect. */
|
|
2
3
|
import { type Effect, type Redacted, Schema } from "effect";
|
|
3
4
|
import type { Elicit, ElicitationFailed } from "./elicitation.js";
|
|
@@ -24,6 +25,7 @@ export declare const mcpSdkTimerCeilingMs = 2147483647;
|
|
|
24
25
|
/** Server and headers for this selected account. Headers are a credential snapshot. */
|
|
25
26
|
export declare const McpToolsOptions: Schema.Struct<{
|
|
26
27
|
readonly url: Schema.String;
|
|
28
|
+
readonly accountId: Schema.optional<Schema.brand<Schema.String, "acc">>;
|
|
27
29
|
readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
28
30
|
readonly signal: Schema.optional<Schema.instanceOf<AbortSignal, AbortSignal>>;
|
|
29
31
|
readonly timeoutMs: Schema.optional<Schema.Number>;
|
|
@@ -61,6 +63,22 @@ export declare const McpToolMetadata: Schema.Struct<{
|
|
|
61
63
|
readonly _meta: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
62
64
|
}>;
|
|
63
65
|
export type McpToolMetadata = typeof McpToolMetadata.Type;
|
|
66
|
+
/** What a server reports about itself when a session initializes. Icons are for display only. */
|
|
67
|
+
export declare const McpServerHeader: Schema.Struct<{
|
|
68
|
+
readonly name: Schema.optionalKey<Schema.String>;
|
|
69
|
+
readonly title: Schema.optionalKey<Schema.String>;
|
|
70
|
+
readonly version: Schema.optionalKey<Schema.String>;
|
|
71
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
72
|
+
readonly websiteUrl: Schema.optionalKey<Schema.String>;
|
|
73
|
+
readonly icons: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
74
|
+
readonly src: Schema.NonEmptyString;
|
|
75
|
+
readonly mimeType: Schema.optionalKey<Schema.String>;
|
|
76
|
+
readonly sizes: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
77
|
+
readonly theme: Schema.optionalKey<Schema.Literals<readonly ["light", "dark"]>>;
|
|
78
|
+
}>>>;
|
|
79
|
+
readonly instructions: Schema.optionalKey<Schema.String>;
|
|
80
|
+
}>;
|
|
81
|
+
export type McpServerHeader = typeof McpServerHeader.Type;
|
|
64
82
|
/** Direct callers can omit interaction capabilities. A server that asks for input then fails explicitly. */
|
|
65
83
|
export interface McpToolContext {
|
|
66
84
|
readonly elicit?: Elicit;
|
|
@@ -70,7 +88,7 @@ export interface McpTool extends McpToolMetadata {
|
|
|
70
88
|
readonly description: string;
|
|
71
89
|
readonly input: Schema.Decoder<JsonValue>;
|
|
72
90
|
readonly readOnly?: boolean;
|
|
73
|
-
readonly run: (context: McpToolContext, input: JsonValue) => Effect.Effect<McpToolResult, McpError | ElicitationFailed>;
|
|
91
|
+
readonly run: (context: McpToolContext, input: JsonValue) => Effect.Effect<McpToolResult, McpError | ProviderError | ElicitationFailed>;
|
|
74
92
|
}
|
|
75
93
|
/** The discovered catalog keyed by remote tool name. */
|
|
76
94
|
export type McpTools = Readonly<Record<string, McpTool>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Shared OpenAPI compilation diagnostics. */
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
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", "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"]>;
|
|
4
|
+
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"]>;
|
|
6
|
+
readonly reason: Schema.String;
|
|
7
|
+
}>, import("effect/Cause").YieldableError>;
|
|
8
|
+
/** A safe generation failure, translated into product HTTP errors at the boundary. */
|
|
9
|
+
export declare class OpenapiCompileError extends OpenapiCompileError_base {
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/** OpenAPI boundary parsing. Unsupported transport/auth features fail before deployment. */
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
/** Parsed OpenAPI 3 source; individual operation references are resolved separately. */
|
|
4
|
+
export declare const Specification: Schema.Struct<{
|
|
5
|
+
readonly openapi: Schema.String;
|
|
6
|
+
readonly servers: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
7
|
+
readonly url: Schema.String;
|
|
8
|
+
readonly variables: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
9
|
+
}>>>;
|
|
10
|
+
readonly paths: Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
11
|
+
readonly components: Schema.optionalKey<Schema.Struct<{
|
|
12
|
+
readonly schemas: Schema.optionalKey<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>;
|
|
13
|
+
readonly securitySchemes: Schema.optionalKey<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>;
|
|
14
|
+
}>>;
|
|
15
|
+
readonly security: Schema.optionalKey<Schema.$Array<Schema.$Record<Schema.String, Schema.$Array<Schema.String>>>>;
|
|
16
|
+
}>;
|
|
17
|
+
export type Specification = typeof Specification.Type;
|
|
18
|
+
export { OpenapiParameter as Parameter, OpenapiRequestBody as RequestBody } from "./openapi.js";
|
|
19
|
+
/** Operation transport details. We never interpolate upstream executable code. */
|
|
20
|
+
export declare const Operation: Schema.Struct<{
|
|
21
|
+
readonly operationId: Schema.optionalKey<Schema.String>;
|
|
22
|
+
readonly responses: Schema.optionalKey<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>;
|
|
23
|
+
readonly summary: Schema.optionalKey<Schema.String>;
|
|
24
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
25
|
+
readonly parameters: Schema.optionalKey<Schema.$Array<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>;
|
|
26
|
+
readonly requestBody: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
27
|
+
readonly security: Schema.optionalKey<Schema.$Array<Schema.$Record<Schema.String, Schema.$Array<Schema.String>>>>;
|
|
28
|
+
readonly servers: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
29
|
+
readonly url: Schema.String;
|
|
30
|
+
readonly variables: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
31
|
+
}>>>;
|
|
32
|
+
}>;
|
|
33
|
+
export type Operation = typeof Operation.Type;
|
|
34
|
+
import type { CredentialBinding } from "./openapi.js";
|
|
35
|
+
export type { OpenapiOperation as GeneratedOperation, CredentialBinding } from "./openapi.js";
|
|
36
|
+
/** A secrets method can satisfy an AND-set of OpenAPI security schemes. */
|
|
37
|
+
export interface GeneratedSecrets {
|
|
38
|
+
readonly name: string;
|
|
39
|
+
readonly label: string;
|
|
40
|
+
readonly bindings: readonly CredentialBinding[];
|
|
41
|
+
}
|
|
42
|
+
/** Import hints after product catalog overrides have been applied. */
|
|
43
|
+
export interface OpenApiImport {
|
|
44
|
+
readonly name: string;
|
|
45
|
+
readonly connectUrl?: string | undefined;
|
|
46
|
+
/** Prefer protected-resource discovery when the API supports dynamic OAuth client registration. */
|
|
47
|
+
readonly oauthDiscoveryUrl?: string | undefined;
|
|
48
|
+
readonly auth?: {
|
|
49
|
+
readonly kind: string;
|
|
50
|
+
readonly header?: string | undefined;
|
|
51
|
+
} | undefined;
|
|
52
|
+
readonly scopes?: readonly string[] | undefined;
|
|
53
|
+
}
|
|
@@ -1,89 +1,205 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ProviderError } from "./provider-error.js";
|
|
2
|
+
/** Credential-free OpenAPI request declarations and validation schemas retained with app source. */
|
|
2
3
|
import { Schema, type Effect } from "effect";
|
|
3
4
|
import { JsonObject } from "./schema.js";
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
import { type OpenapiResponseError } from "./api-response-error.js";
|
|
6
|
+
/** Tagged error shapes retain an explicit source for their public message. */
|
|
7
|
+
export declare const OpenapiErrorResponse: Schema.Struct<{
|
|
8
|
+
readonly code: Schema.NonEmptyString;
|
|
9
|
+
readonly status: Schema.Int;
|
|
10
|
+
readonly message: Schema.Union<readonly [Schema.Struct<{
|
|
11
|
+
readonly source: Schema.Literal<"body">;
|
|
12
|
+
}>, Schema.Struct<{
|
|
13
|
+
readonly source: Schema.Literal<"schema">;
|
|
14
|
+
readonly value: Schema.NonEmptyString;
|
|
15
|
+
}>]>;
|
|
16
|
+
readonly schema: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
17
|
+
}>;
|
|
18
|
+
/** A retained declaration used to validate an HTTP failure before exposing its code. */
|
|
19
|
+
export type OpenapiErrorResponse = typeof OpenapiErrorResponse.Type;
|
|
20
|
+
/** Resolved OpenAPI parameter shared by import validation and request construction. */
|
|
21
|
+
export declare const OpenapiParameter: Schema.Struct<{
|
|
6
22
|
readonly name: Schema.String;
|
|
7
|
-
readonly in: Schema.Literals<readonly ["path", "query", "header"]>;
|
|
8
|
-
readonly
|
|
9
|
-
readonly
|
|
23
|
+
readonly in: Schema.Literals<readonly ["path", "query", "header", "cookie"]>;
|
|
24
|
+
readonly required: Schema.optionalKey<Schema.Boolean>;
|
|
25
|
+
readonly schema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
26
|
+
readonly style: Schema.optionalKey<Schema.String>;
|
|
27
|
+
readonly explode: Schema.optionalKey<Schema.Boolean>;
|
|
28
|
+
readonly allowReserved: Schema.optionalKey<Schema.Boolean>;
|
|
29
|
+
readonly allowEmptyValue: Schema.optionalKey<Schema.Boolean>;
|
|
30
|
+
readonly content: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
31
|
+
}>;
|
|
32
|
+
export type OpenapiParameter = typeof OpenapiParameter.Type;
|
|
33
|
+
/** Preserve media schemas and Encoding Objects for Swagger request construction. */
|
|
34
|
+
export declare const OpenapiRequestBody: Schema.Struct<{
|
|
35
|
+
readonly required: Schema.optionalKey<Schema.Boolean>;
|
|
36
|
+
readonly content: Schema.$Record<Schema.String, Schema.Struct<{
|
|
37
|
+
readonly schema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
38
|
+
readonly encoding: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
39
|
+
}>>;
|
|
10
40
|
}>;
|
|
11
|
-
export type RequestParameter = typeof RequestParameter.Type;
|
|
12
41
|
/** Credential-free operation data emitted by the OpenAPI importer. */
|
|
13
42
|
export declare const OpenapiOperation: Schema.Struct<{
|
|
43
|
+
/** The tool name after `queries.` or `mutations.`, grouped as `<group>.<leaf>`. */
|
|
14
44
|
readonly name: Schema.NonEmptyString;
|
|
45
|
+
/** The document's operationId, when it declares one. `kinds` overrides are keyed by it. */
|
|
46
|
+
readonly operationId: Schema.optionalKey<Schema.String>;
|
|
15
47
|
readonly description: Schema.String;
|
|
16
48
|
readonly method: Schema.Literals<readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]>;
|
|
17
49
|
readonly path: Schema.String;
|
|
18
50
|
readonly baseUrl: Schema.String;
|
|
19
|
-
readonly
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
readonly
|
|
24
|
-
|
|
25
|
-
|
|
51
|
+
readonly openapi: Schema.String;
|
|
52
|
+
readonly securitySchemes: Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
53
|
+
/** The resolved OpenAPI Operation Object; Executor schemas remain separate. */
|
|
54
|
+
readonly request: Schema.Struct<{
|
|
55
|
+
readonly parameters: Schema.$Array<Schema.Struct<{
|
|
56
|
+
readonly name: Schema.String;
|
|
57
|
+
readonly in: Schema.Literals<readonly ["path", "query", "header", "cookie"]>;
|
|
58
|
+
readonly required: Schema.optionalKey<Schema.Boolean>;
|
|
59
|
+
readonly schema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
60
|
+
readonly style: Schema.optionalKey<Schema.String>;
|
|
61
|
+
readonly explode: Schema.optionalKey<Schema.Boolean>;
|
|
62
|
+
readonly allowReserved: Schema.optionalKey<Schema.Boolean>;
|
|
63
|
+
readonly allowEmptyValue: Schema.optionalKey<Schema.Boolean>;
|
|
64
|
+
readonly content: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
65
|
+
}>>;
|
|
66
|
+
readonly requestBody: Schema.optionalKey<Schema.Struct<{
|
|
67
|
+
readonly required: Schema.optionalKey<Schema.Boolean>;
|
|
68
|
+
readonly content: Schema.$Record<Schema.String, Schema.Struct<{
|
|
69
|
+
readonly schema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
70
|
+
readonly encoding: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
71
|
+
}>>;
|
|
72
|
+
}>>;
|
|
73
|
+
readonly security: Schema.$Array<Schema.$Record<Schema.String, Schema.$Array<Schema.String>>>;
|
|
74
|
+
readonly responses: Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
75
|
+
}>;
|
|
26
76
|
/** Streams remain in the metadata but cannot run through a single-result tool call. */
|
|
27
77
|
readonly streaming: Schema.optionalKey<Schema.Literal<true>>;
|
|
28
|
-
|
|
78
|
+
/** The operation's OpenAPI tags, shown to agents as labels within its router. */
|
|
79
|
+
readonly tags: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
|
|
29
80
|
readonly input: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
30
81
|
readonly outputSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
82
|
+
readonly errorResponses: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
83
|
+
readonly code: Schema.NonEmptyString;
|
|
84
|
+
readonly status: Schema.Int;
|
|
85
|
+
readonly message: Schema.Union<readonly [Schema.Struct<{
|
|
86
|
+
readonly source: Schema.Literal<"body">;
|
|
87
|
+
}>, Schema.Struct<{
|
|
88
|
+
readonly source: Schema.Literal<"schema">;
|
|
89
|
+
readonly value: Schema.NonEmptyString;
|
|
90
|
+
}>]>;
|
|
91
|
+
readonly schema: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
92
|
+
}>>>;
|
|
31
93
|
}>;
|
|
32
94
|
export type OpenapiOperation = typeof OpenapiOperation.Type;
|
|
33
|
-
/**
|
|
95
|
+
/** Map a selected account field to one Swagger credential value. */
|
|
34
96
|
export declare const CredentialBinding: Schema.Struct<{
|
|
35
97
|
readonly scheme: Schema.String;
|
|
36
98
|
readonly field: Schema.String;
|
|
37
|
-
readonly
|
|
38
|
-
readonly name: Schema.String;
|
|
99
|
+
readonly part: Schema.Literals<readonly ["value", "username", "password"]>;
|
|
39
100
|
readonly prefix: Schema.String;
|
|
40
101
|
}>;
|
|
41
102
|
export type CredentialBinding = typeof CredentialBinding.Type;
|
|
42
103
|
/** Selected credentials stay in the server runtime, separate from operation metadata. */
|
|
43
104
|
export declare const OpenapiAccount: Schema.Struct<{
|
|
105
|
+
readonly id: Schema.optional<Schema.brand<Schema.String, "acc">>;
|
|
44
106
|
readonly method: Schema.String;
|
|
45
107
|
readonly fields: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
46
108
|
}>;
|
|
47
109
|
export type OpenapiAccount = typeof OpenapiAccount.Type;
|
|
110
|
+
/**
|
|
111
|
+
* Parameter values bound by the selected account, grouped as in tool input. Callers may omit
|
|
112
|
+
* these parameters; an explicit value still takes precedence and the API still authorizes it.
|
|
113
|
+
*/
|
|
114
|
+
export declare const OpenapiParameterDefaults: Schema.Struct<{
|
|
115
|
+
readonly path: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
116
|
+
readonly query: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
117
|
+
readonly headers: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
118
|
+
}>;
|
|
119
|
+
export type OpenapiParameterDefaults = typeof OpenapiParameterDefaults.Type;
|
|
48
120
|
/** Parsed options for one account's evaluation. */
|
|
49
121
|
export declare const OpenapiToolsOptions: Schema.Struct<{
|
|
50
122
|
readonly operations: Schema.$Array<Schema.Struct<{
|
|
123
|
+
/** The tool name after `queries.` or `mutations.`, grouped as `<group>.<leaf>`. */
|
|
51
124
|
readonly name: Schema.NonEmptyString;
|
|
125
|
+
/** The document's operationId, when it declares one. `kinds` overrides are keyed by it. */
|
|
126
|
+
readonly operationId: Schema.optionalKey<Schema.String>;
|
|
52
127
|
readonly description: Schema.String;
|
|
53
128
|
readonly method: Schema.Literals<readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]>;
|
|
54
129
|
readonly path: Schema.String;
|
|
55
130
|
readonly baseUrl: Schema.String;
|
|
56
|
-
readonly
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
readonly
|
|
61
|
-
|
|
62
|
-
|
|
131
|
+
readonly openapi: Schema.String;
|
|
132
|
+
readonly securitySchemes: Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
133
|
+
/** The resolved OpenAPI Operation Object; Executor schemas remain separate. */
|
|
134
|
+
readonly request: Schema.Struct<{
|
|
135
|
+
readonly parameters: Schema.$Array<Schema.Struct<{
|
|
136
|
+
readonly name: Schema.String;
|
|
137
|
+
readonly in: Schema.Literals<readonly ["path", "query", "header", "cookie"]>;
|
|
138
|
+
readonly required: Schema.optionalKey<Schema.Boolean>;
|
|
139
|
+
readonly schema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
140
|
+
readonly style: Schema.optionalKey<Schema.String>;
|
|
141
|
+
readonly explode: Schema.optionalKey<Schema.Boolean>;
|
|
142
|
+
readonly allowReserved: Schema.optionalKey<Schema.Boolean>;
|
|
143
|
+
readonly allowEmptyValue: Schema.optionalKey<Schema.Boolean>;
|
|
144
|
+
readonly content: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
145
|
+
}>>;
|
|
146
|
+
readonly requestBody: Schema.optionalKey<Schema.Struct<{
|
|
147
|
+
readonly required: Schema.optionalKey<Schema.Boolean>;
|
|
148
|
+
readonly content: Schema.$Record<Schema.String, Schema.Struct<{
|
|
149
|
+
readonly schema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
150
|
+
readonly encoding: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
151
|
+
}>>;
|
|
152
|
+
}>>;
|
|
153
|
+
readonly security: Schema.$Array<Schema.$Record<Schema.String, Schema.$Array<Schema.String>>>;
|
|
154
|
+
readonly responses: Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
155
|
+
}>;
|
|
63
156
|
/** Streams remain in the metadata but cannot run through a single-result tool call. */
|
|
64
157
|
readonly streaming: Schema.optionalKey<Schema.Literal<true>>;
|
|
65
|
-
|
|
158
|
+
/** The operation's OpenAPI tags, shown to agents as labels within its router. */
|
|
159
|
+
readonly tags: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
|
|
66
160
|
readonly input: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
67
161
|
readonly outputSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
162
|
+
readonly errorResponses: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
163
|
+
readonly code: Schema.NonEmptyString;
|
|
164
|
+
readonly status: Schema.Int;
|
|
165
|
+
readonly message: Schema.Union<readonly [Schema.Struct<{
|
|
166
|
+
readonly source: Schema.Literal<"body">;
|
|
167
|
+
}>, Schema.Struct<{
|
|
168
|
+
readonly source: Schema.Literal<"schema">;
|
|
169
|
+
readonly value: Schema.NonEmptyString;
|
|
170
|
+
}>]>;
|
|
171
|
+
readonly schema: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
172
|
+
}>>>;
|
|
68
173
|
}>>;
|
|
174
|
+
/**
|
|
175
|
+
* Component schemas stored once per app and referenced as `#/$defs/<name>`. Operations
|
|
176
|
+
* generated before shared definitions carry their own `$defs` and omit this.
|
|
177
|
+
*/
|
|
178
|
+
readonly definitions: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>;
|
|
69
179
|
readonly methods: Schema.$Record<Schema.String, Schema.$Array<Schema.Struct<{
|
|
70
180
|
readonly scheme: Schema.String;
|
|
71
181
|
readonly field: Schema.String;
|
|
72
|
-
readonly
|
|
73
|
-
readonly name: Schema.String;
|
|
182
|
+
readonly part: Schema.Literals<readonly ["value", "username", "password"]>;
|
|
74
183
|
readonly prefix: Schema.String;
|
|
75
184
|
}>>>;
|
|
76
185
|
readonly oauth: Schema.$Array<Schema.String>;
|
|
77
186
|
readonly account: Schema.optional<Schema.Struct<{
|
|
187
|
+
readonly id: Schema.optional<Schema.brand<Schema.String, "acc">>;
|
|
78
188
|
readonly method: Schema.String;
|
|
79
189
|
readonly fields: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
80
190
|
}>>;
|
|
191
|
+
readonly parameterDefaults: Schema.optional<Schema.Struct<{
|
|
192
|
+
readonly path: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
193
|
+
readonly query: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
194
|
+
readonly headers: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
195
|
+
}>>;
|
|
81
196
|
readonly signal: Schema.optional<Schema.instanceOf<AbortSignal, AbortSignal>>;
|
|
82
197
|
readonly fetch: Schema.optional<Schema.declare<typeof fetch, typeof fetch>>;
|
|
83
198
|
}>;
|
|
84
199
|
/** JSON imports are decoded at the helper boundary, without assertions in app source. */
|
|
85
|
-
export type OpenapiToolsOptions = Omit<typeof OpenapiToolsOptions.Type, "operations"> & {
|
|
200
|
+
export type OpenapiToolsOptions = Omit<typeof OpenapiToolsOptions.Type, "operations" | "definitions"> & {
|
|
86
201
|
readonly operations: unknown;
|
|
202
|
+
readonly definitions?: unknown;
|
|
87
203
|
};
|
|
88
204
|
declare const OpenapiError_base: Schema.Class<OpenapiError, Schema.TaggedStruct<"OpenapiError", {
|
|
89
205
|
readonly reason: Schema.Literals<readonly ["invalid_definition", "invalid_input", "request"]>;
|
|
@@ -98,8 +214,22 @@ export interface OpenapiTool {
|
|
|
98
214
|
readonly readOnly: boolean;
|
|
99
215
|
readonly outputSchema?: JsonObject;
|
|
100
216
|
readonly input: Schema.Decoder<Schema.Json>;
|
|
101
|
-
readonly run: (context: unknown, input: Schema.Json) => Effect.Effect<unknown, OpenapiError>;
|
|
217
|
+
readonly run: (context: unknown, input: Schema.Json) => Effect.Effect<unknown, OpenapiError | OpenapiResponseError | ProviderError>;
|
|
102
218
|
}
|
|
103
219
|
/** Executable operations keyed by their generated names. */
|
|
104
220
|
export type OpenapiTools = Readonly<Record<string, OpenapiTool>>;
|
|
221
|
+
/** Tool calls buffer one bounded result; live event streams require an authored subscription. */
|
|
222
|
+
export declare const defaultOpenapiResponseLimits: {
|
|
223
|
+
readonly maxBodyBytes: 16777216;
|
|
224
|
+
readonly readTimeoutMs: 30000;
|
|
225
|
+
};
|
|
226
|
+
/** Media returned as text rather than a base64 file. NDJSON remains an unparsed text result. */
|
|
227
|
+
export declare const isOpenapiTextMedia: (type: string) => boolean;
|
|
228
|
+
/** A form field that carries raw file bytes: OpenAPI 3.1 `contentMediaType` without an
|
|
229
|
+
* encoding, or the `format: binary` string that 3.1 documents still commonly use. */
|
|
230
|
+
export declare const isOpenapiFileSchema: (shape: Readonly<Record<string, unknown>>) => boolean;
|
|
231
|
+
/** JSON-safe binary result, independent of the host's file storage. */
|
|
232
|
+
export declare const openapiBinaryResultSchema: JsonObject;
|
|
233
|
+
/** Classify request media for JSON-safe tool arguments; Swagger owns wire serialization. */
|
|
234
|
+
export declare const openapiMediaKind: (type: string) => "form" | "binary" | "json" | "multipart" | "text";
|
|
105
235
|
export {};
|
|
@@ -23,8 +23,3 @@ export interface AppOperation<Input = unknown, Output = unknown> {
|
|
|
23
23
|
readonly approval?: Approval<Input>;
|
|
24
24
|
readonly run: (context: OperationContext, input: Input) => Effect.Effect<Output, unknown>;
|
|
25
25
|
}
|
|
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
|
-
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The host protocol this framework speaks. It is written into `runtime.json` and every host
|
|
3
|
+
* snapshot. Released protocols are frozen: see `protocols/4.ts` and notes/apps-publishing.md.
|
|
4
|
+
* This file has no imports so the package build script can read it directly.
|
|
5
|
+
*/
|
|
6
|
+
export declare const frameworkProtocol = 5;
|